From fa3ddc83095583554ef5de92a0b4616871606bcd Mon Sep 17 00:00:00 2001 From: Federico Ercoles Date: Tue, 28 Nov 2023 18:42:04 +0100 Subject: [PATCH] Export base input components --- .../{InternalNumberInput.tsx => BaseNumberInput.tsx} | 2 +- packages/bento-design-system/src/NumberField/NumberField.tsx | 4 ++-- packages/bento-design-system/src/NumberField/NumberInput.tsx | 4 ++-- .../src/SelectField/{InternalSelect.tsx => BaseSelect.tsx} | 2 +- packages/bento-design-system/src/SelectField/SelectField.tsx | 4 ++-- packages/bento-design-system/src/SelectField/SelectInput.tsx | 4 ++-- .../TextField/{InternalTextInput.tsx => BaseTextInput.tsx} | 2 +- packages/bento-design-system/src/TextField/TextField.tsx | 4 ++-- packages/bento-design-system/src/TextField/TextInput.tsx | 4 ++-- packages/bento-design-system/src/index.ts | 3 +++ .../configuration-builder/src/ColorEditor/CounterField.tsx | 4 ++-- 11 files changed, 20 insertions(+), 17 deletions(-) rename packages/bento-design-system/src/NumberField/{InternalNumberInput.tsx => BaseNumberInput.tsx} (98%) rename packages/bento-design-system/src/SelectField/{InternalSelect.tsx => BaseSelect.tsx} (98%) rename packages/bento-design-system/src/TextField/{InternalTextInput.tsx => BaseTextInput.tsx} (98%) diff --git a/packages/bento-design-system/src/NumberField/InternalNumberInput.tsx b/packages/bento-design-system/src/NumberField/BaseNumberInput.tsx similarity index 98% rename from packages/bento-design-system/src/NumberField/InternalNumberInput.tsx rename to packages/bento-design-system/src/NumberField/BaseNumberInput.tsx index a8fc29bc7..aa414d370 100644 --- a/packages/bento-design-system/src/NumberField/InternalNumberInput.tsx +++ b/packages/bento-design-system/src/NumberField/BaseNumberInput.tsx @@ -17,7 +17,7 @@ type Props = BaseNumberProps & { disabled?: boolean; } & FormatProps; -export function InternalNumberInput(props: Props) { +export function BaseNumberInput(props: Props) { const config = useBentoConfig().input; const { locale } = useLocale(); diff --git a/packages/bento-design-system/src/NumberField/NumberField.tsx b/packages/bento-design-system/src/NumberField/NumberField.tsx index 2a538359f..44ec676fc 100644 --- a/packages/bento-design-system/src/NumberField/NumberField.tsx +++ b/packages/bento-design-system/src/NumberField/NumberField.tsx @@ -6,7 +6,7 @@ import { FieldProps } from "../Field/FieldProps"; import { BaseNumberProps, FormatProps } from "./types"; import { useFormatOptions } from "./formatOptions"; import { Field } from "../Field/Field"; -import { InternalNumberInput } from "./InternalNumberInput"; +import { BaseNumberInput } from "./BaseNumberInput"; type Props = FieldProps & BaseNumberProps & @@ -42,7 +42,7 @@ export function NumberField(props: Props) { assistiveTextProps={descriptionProps} errorMessageProps={errorMessageProps} > - , "aria-label" | "aria-labelledby">> & @@ -34,7 +34,7 @@ export function NumberInput(props: Props) { inputRef ); - return ; + return ; } export type { Props as NumberInputProps }; diff --git a/packages/bento-design-system/src/SelectField/InternalSelect.tsx b/packages/bento-design-system/src/SelectField/BaseSelect.tsx similarity index 98% rename from packages/bento-design-system/src/SelectField/InternalSelect.tsx rename to packages/bento-design-system/src/SelectField/BaseSelect.tsx index fa00d1f68..2aa4a9c9a 100644 --- a/packages/bento-design-system/src/SelectField/InternalSelect.tsx +++ b/packages/bento-design-system/src/SelectField/BaseSelect.tsx @@ -21,7 +21,7 @@ type Props = BaseSelectProps & { validationState: "valid" | "invalid"; } & (SingleProps | MultiProps); -export function InternalSelect(props: Props) { +export function BaseSelect(props: Props) { const dropdownConfig = useBentoConfig().dropdown; const { defaultMessages } = useDefaultMessages(); diff --git a/packages/bento-design-system/src/SelectField/SelectField.tsx b/packages/bento-design-system/src/SelectField/SelectField.tsx index 6d7429a73..a51c8c7d4 100644 --- a/packages/bento-design-system/src/SelectField/SelectField.tsx +++ b/packages/bento-design-system/src/SelectField/SelectField.tsx @@ -3,7 +3,7 @@ import { ListSize, LocalizedString } from ".."; import { useField } from "@react-aria/label"; import { FieldProps } from "../Field/FieldProps"; import { Field } from "../Field/Field"; -import { InternalSelect } from "./InternalSelect"; +import { BaseSelect } from "./BaseSelect"; import { BaseMultiProps, BaseSelectProps, BaseSingleProps } from "./types"; type MultiProps = BaseMultiProps & FieldProps; @@ -51,7 +51,7 @@ export function SelectField(props: Props) { disabled={disabled} {...hintProps} > - + ); } diff --git a/packages/bento-design-system/src/SelectField/SelectInput.tsx b/packages/bento-design-system/src/SelectField/SelectInput.tsx index 69fd6a5b1..67bdf7e4a 100644 --- a/packages/bento-design-system/src/SelectField/SelectInput.tsx +++ b/packages/bento-design-system/src/SelectField/SelectInput.tsx @@ -3,7 +3,7 @@ import { FieldProps } from "../Field/FieldProps"; import { BaseMultiProps, BaseSelectProps, BaseSingleProps } from "./types"; import { AtLeast } from "../util/AtLeast"; import { HTMLAttributes } from "react"; -import { InternalSelect } from "./InternalSelect"; +import { BaseSelect } from "./BaseSelect"; type MultiProps = BaseMultiProps & Pick, "autoFocus" | "disabled" | "name" | "onBlur" | "onChange" | "value">; @@ -24,7 +24,7 @@ export function SelectInput(props: Props) { ...props, }); - return ; + return ; } export type { Props as SelectInputProps }; diff --git a/packages/bento-design-system/src/TextField/InternalTextInput.tsx b/packages/bento-design-system/src/TextField/BaseTextInput.tsx similarity index 98% rename from packages/bento-design-system/src/TextField/InternalTextInput.tsx rename to packages/bento-design-system/src/TextField/BaseTextInput.tsx index b9810b65a..2dc34297d 100644 --- a/packages/bento-design-system/src/TextField/InternalTextInput.tsx +++ b/packages/bento-design-system/src/TextField/BaseTextInput.tsx @@ -26,7 +26,7 @@ type Props = { hidePasswordLabel?: never; }; -export function InternalTextInput(props: Props) { +export function BaseTextInput(props: Props) { const config = useBentoConfig().input; const { defaultMessages } = useDefaultMessages(); diff --git a/packages/bento-design-system/src/TextField/TextField.tsx b/packages/bento-design-system/src/TextField/TextField.tsx index 4456a999a..6a3d45b29 100644 --- a/packages/bento-design-system/src/TextField/TextField.tsx +++ b/packages/bento-design-system/src/TextField/TextField.tsx @@ -3,7 +3,7 @@ import { useRef } from "react"; import { Field, Children } from ".."; import { LocalizedString } from "../util/LocalizedString"; import { FieldProps } from "../Field/FieldProps"; -import { InternalTextInput } from "./InternalTextInput"; +import { BaseTextInput } from "./BaseTextInput"; type Props = FieldProps & { placeholder?: LocalizedString; @@ -37,7 +37,7 @@ export function TextField(props: Props) { assistiveTextProps={descriptionProps} errorMessageProps={errorMessageProps} > - ; + return ; } export type { Props as TextInputProps }; diff --git a/packages/bento-design-system/src/index.ts b/packages/bento-design-system/src/index.ts index d0693798f..8fcf755e9 100644 --- a/packages/bento-design-system/src/index.ts +++ b/packages/bento-design-system/src/index.ts @@ -52,6 +52,7 @@ export * from "./List/ListItem"; export * from "./Menu/Menu"; export * from "./Modal/Modal"; export * from "./Navigation/Navigation"; +export * from "./NumberField/BaseNumberInput"; export * from "./NumberField/NumberField"; export * from "./NumberField/NumberInput"; export * from "./Pagination/Pagination"; @@ -61,6 +62,7 @@ export * from "./ProgressBar/ProgressBar"; export * from "./RadioGroupField/RadioGroupField"; export * from "./ReadOnlyField/ReadOnlyField"; export * from "./SearchBar/SearchBar"; +export * from "./SelectField/BaseSelect"; export * from "./SelectField/SelectField"; export * from "./SelectField/SelectInput"; export * from "./Slider/Slider"; @@ -71,6 +73,7 @@ export * from "./Table/Table"; export * from "./Tabs/Tabs"; export { bentoSprinkles } from "./internal/sprinkles.css"; export * from "./TextArea/TextArea"; +export * from "./TextField/BaseTextInput"; export * from "./TextField/TextField"; export * from "./TextField/TextInput"; export * from "./TimeField/TimeField"; diff --git a/packages/configuration-builder/src/ColorEditor/CounterField.tsx b/packages/configuration-builder/src/ColorEditor/CounterField.tsx index 8b0423b3c..35f000c03 100644 --- a/packages/configuration-builder/src/ColorEditor/CounterField.tsx +++ b/packages/configuration-builder/src/ColorEditor/CounterField.tsx @@ -6,7 +6,7 @@ import { IconMinus, IconPlus, NumberFieldProps, - NumberInput, + BaseNumberInput, } from "@buildo/bento-design-system"; import { useRef } from "react"; import { useTranslation } from "react-i18next"; @@ -61,7 +61,7 @@ export function CounterField(props: Omit) }} /> -