@bspk/ui 1.3.3 → 1.3.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build.ts +41 -10
- package/dist/components/AvatarGroup/AvatarGroup.d.ts +1 -1
- package/dist/components/AvatarGroup/AvatarGroup.js +1 -1
- package/dist/components/Breadcrumb/Breadcrumb.d.ts +4 -23
- package/dist/components/Breadcrumb/Breadcrumb.js +3 -7
- package/dist/components/Breadcrumb/Breadcrumb.js.map +1 -1
- package/dist/components/Breadcrumb/BreadcumbDropdown.d.ts +27 -0
- package/dist/components/Breadcrumb/BreadcumbDropdown.js +68 -0
- package/dist/components/Breadcrumb/BreadcumbDropdown.js.map +1 -0
- package/dist/components/Button/Button.d.ts +5 -1
- package/dist/components/Button/Button.js +2 -2
- package/dist/components/Button/Button.js.map +1 -1
- package/dist/components/Button/button.css +5 -5
- package/dist/components/Button/button.css.js +5 -5
- package/dist/components/Calendar/Calendar.d.ts +33 -0
- package/dist/components/{CalendarPicker/CalendarPicker.js → Calendar/Calendar.js} +30 -34
- package/dist/components/Calendar/Calendar.js.map +1 -0
- package/dist/components/Calendar/CalendarExample.d.ts +4 -0
- package/dist/components/Calendar/CalendarExample.js +29 -0
- package/dist/components/Calendar/CalendarExample.js.map +1 -0
- package/dist/components/{CalendarPicker/calendar-picker.css → Calendar/calendar.css} +16 -16
- package/dist/components/{CalendarPicker/calendar-picker.css.js → Calendar/calendar.css.js} +16 -16
- package/dist/components/Calendar/index.d.ts +1 -0
- package/dist/components/Calendar/index.js +2 -0
- package/dist/components/Calendar/index.js.map +1 -0
- package/dist/components/Checkbox/Checkbox.d.ts +5 -3
- package/dist/components/Checkbox/Checkbox.js +2 -2
- package/dist/components/Checkbox/Checkbox.js.map +1 -1
- package/dist/components/CheckboxGroup/CheckboxGroup.d.ts +6 -25
- package/dist/components/CheckboxGroup/CheckboxGroup.js +15 -5
- package/dist/components/CheckboxGroup/CheckboxGroup.js.map +1 -1
- package/dist/components/CheckboxGroup/CheckboxGroupExample.js +3 -0
- package/dist/components/CheckboxGroup/CheckboxGroupExample.js.map +1 -1
- package/dist/components/CheckboxGroup/checkbox-group.css +7 -0
- package/dist/components/{DateField/date-field.css.js → CheckboxGroup/checkbox-group.css.js} +4 -5
- package/dist/components/CheckboxGroupField/CheckboxGroupField.d.ts +15 -0
- package/dist/components/CheckboxGroupField/CheckboxGroupField.js +17 -0
- package/dist/components/CheckboxGroupField/CheckboxGroupField.js.map +1 -0
- package/dist/components/CheckboxGroupField/index.d.ts +1 -0
- package/dist/components/CheckboxGroupField/index.js +2 -0
- package/dist/components/CheckboxGroupField/index.js.map +1 -0
- package/dist/components/{ChipUtility/ChipUtility.d.ts → Chip/Chip.d.ts} +6 -6
- package/dist/components/Chip/Chip.js +25 -0
- package/dist/components/Chip/Chip.js.map +1 -0
- package/dist/components/Chip/ChipExample.d.ts +4 -0
- package/dist/components/{ChipUtility/ChipUtilityExample.js → Chip/ChipExample.js} +2 -2
- package/dist/components/Chip/ChipExample.js.map +1 -0
- package/dist/components/{ChipUtility/chip-utility.css → Chip/chip.css} +10 -10
- package/dist/components/{ChipUtility/chip-utility.css.js → Chip/chip.css.js} +10 -10
- package/dist/components/Chip/index.d.ts +1 -0
- package/dist/components/Chip/index.js +2 -0
- package/dist/components/Chip/index.js.map +1 -0
- package/dist/components/ChipGroup/ChipGroup.d.ts +8 -7
- package/dist/components/ChipGroup/ChipGroup.js +5 -4
- package/dist/components/ChipGroup/ChipGroup.js.map +1 -1
- package/dist/components/ChipGroup/ChipGroupExample.js +4 -31
- package/dist/components/ChipGroup/ChipGroupExample.js.map +1 -1
- package/dist/components/DatePicker/DatePicker.d.ts +50 -0
- package/dist/components/DatePicker/DatePicker.js +133 -0
- package/dist/components/DatePicker/DatePicker.js.map +1 -0
- package/dist/components/DatePicker/DatePickerExample.d.ts +3 -0
- package/dist/components/DatePicker/DatePickerExample.js +10 -0
- package/dist/components/DatePicker/DatePickerExample.js.map +1 -0
- package/dist/components/{DateInput/date-input.css → DatePicker/date-picker.css} +2 -3
- package/dist/components/{DateInput/date-input.css.js → DatePicker/date-picker.css.js} +2 -3
- package/dist/components/DatePicker/index.d.ts +1 -0
- package/dist/components/DatePicker/index.js +2 -0
- package/dist/components/DatePicker/index.js.map +1 -0
- package/dist/components/DatePickerField/DatePickerField.d.ts +15 -0
- package/dist/components/DatePickerField/DatePickerField.js +17 -0
- package/dist/components/DatePickerField/DatePickerField.js.map +1 -0
- package/dist/components/DatePickerField/index.d.ts +1 -0
- package/dist/components/DatePickerField/index.js +2 -0
- package/dist/components/DatePickerField/index.js.map +1 -0
- package/dist/components/Drawer/Drawer.d.ts +1 -1
- package/dist/components/Drawer/Drawer.js +1 -1
- package/dist/components/Drawer/DrawerExample.js +3 -3
- package/dist/components/Drawer/DrawerExample.js.map +1 -1
- package/dist/components/EmptyState/EmptyState.d.ts +1 -1
- package/dist/components/EmptyState/EmptyState.js +1 -1
- package/dist/components/Fab/Fab.d.ts +1 -1
- package/dist/components/Fab/Fab.js +1 -1
- package/dist/components/Field/Field.d.ts +58 -0
- package/dist/components/Field/Field.js +70 -0
- package/dist/components/Field/Field.js.map +1 -0
- package/dist/components/Field/FieldDescription.d.ts +7 -0
- package/dist/components/Field/FieldDescription.js +9 -0
- package/dist/components/Field/FieldDescription.js.map +1 -0
- package/dist/components/Field/FieldError.d.ts +5 -0
- package/dist/components/Field/FieldError.js +8 -0
- package/dist/components/Field/FieldError.js.map +1 -0
- package/dist/components/Field/FieldExample.d.ts +5 -0
- package/dist/components/Field/FieldExample.js +10 -0
- package/dist/components/Field/FieldExample.js.map +1 -0
- package/dist/components/Field/FieldLabel.d.ts +15 -0
- package/dist/components/Field/FieldLabel.js +8 -0
- package/dist/components/Field/FieldLabel.js.map +1 -0
- package/dist/components/Field/field.css +36 -0
- package/dist/components/Field/field.css.js +41 -0
- package/dist/components/Field/index.d.ts +5 -0
- package/dist/components/Field/index.js +6 -0
- package/dist/components/Field/index.js.map +1 -0
- package/dist/components/Field/utils.d.ts +39 -0
- package/dist/components/Field/utils.js +35 -0
- package/dist/components/Field/utils.js.map +1 -0
- package/dist/components/FormField/FormField.d.ts +32 -17
- package/dist/components/FormField/FormField.js +10 -18
- package/dist/components/FormField/FormField.js.map +1 -1
- package/dist/components/FormField/FormFieldExample.d.ts +10 -4
- package/dist/components/FormField/FormFieldExample.js +97 -9
- package/dist/components/FormField/FormFieldExample.js.map +1 -1
- package/dist/components/Img/Img.d.ts +1 -1
- package/dist/components/Img/Img.js +1 -1
- package/dist/components/InlineAlert/InlineAlert.d.ts +4 -4
- package/dist/components/InlineAlert/InlineAlert.js +3 -3
- package/dist/components/InlineAlert/InlineAlert.js.map +1 -1
- package/dist/components/Input/Input.d.ts +37 -0
- package/dist/components/Input/Input.js +48 -0
- package/dist/components/Input/Input.js.map +1 -0
- package/dist/components/Input/InputElement.d.ts +77 -0
- package/dist/components/{TextInput/TextInput.js → Input/InputElement.js} +17 -16
- package/dist/components/Input/InputElement.js.map +1 -0
- package/dist/components/Input/InputExample.d.ts +8 -0
- package/dist/components/{TextInput/TextInputExample.js → Input/InputExample.js} +20 -9
- package/dist/components/Input/InputExample.js.map +1 -0
- package/dist/components/Input/index.d.ts +2 -0
- package/dist/components/Input/index.js +3 -0
- package/dist/components/Input/index.js.map +1 -0
- package/dist/components/{TextInput/text-input.css → Input/input.css} +23 -23
- package/dist/components/{TextInput/text-input.css.js → Input/input.css.js} +23 -23
- package/dist/components/InputField/InputField.d.ts +15 -0
- package/dist/components/InputField/InputField.js +17 -0
- package/dist/components/InputField/InputField.js.map +1 -0
- package/dist/components/InputField/index.d.ts +1 -0
- package/dist/components/InputField/index.js +2 -0
- package/dist/components/InputField/index.js.map +1 -0
- package/dist/components/{NumberInput → InputNumber}/IncrementButton.js.map +1 -1
- package/dist/components/InputNumber/InputNumber.d.ts +74 -0
- package/dist/components/{NumberInput/NumberInput.js → InputNumber/InputNumber.js} +40 -13
- package/dist/components/InputNumber/InputNumber.js.map +1 -0
- package/dist/components/InputNumber/InputNumberExample.d.ts +3 -0
- package/dist/components/{NumberInput/NumberInputExample.js → InputNumber/InputNumberExample.js} +2 -2
- package/dist/components/InputNumber/InputNumberExample.js.map +1 -0
- package/dist/components/InputNumber/index.d.ts +1 -0
- package/dist/components/InputNumber/index.js +2 -0
- package/dist/components/InputNumber/index.js.map +1 -0
- package/dist/components/{NumberInput/number-input.css → InputNumber/input-number.css} +21 -21
- package/dist/components/{NumberInput/number-input.css.js → InputNumber/input-number.css.js} +21 -21
- package/dist/components/InputNumberField/InputNumberField.d.ts +15 -0
- package/dist/components/InputNumberField/InputNumberField.js +17 -0
- package/dist/components/InputNumberField/InputNumberField.js.map +1 -0
- package/dist/components/InputNumberField/index.d.ts +1 -0
- package/dist/components/InputNumberField/index.js +2 -0
- package/dist/components/InputNumberField/index.js.map +1 -0
- package/dist/components/InputPhone/InputPhone.d.ts +57 -0
- package/dist/components/InputPhone/InputPhone.js +161 -0
- package/dist/components/InputPhone/InputPhone.js.map +1 -0
- package/dist/components/InputPhone/InputPhoneExample.d.ts +4 -0
- package/dist/components/InputPhone/InputPhoneExample.js +7 -0
- package/dist/components/InputPhone/InputPhoneExample.js.map +1 -0
- package/dist/components/InputPhone/index.d.ts +1 -0
- package/dist/components/InputPhone/index.js +2 -0
- package/dist/components/InputPhone/index.js.map +1 -0
- package/dist/components/InputPhone/input-phone.css +42 -0
- package/dist/components/InputPhone/input-phone.css.js +47 -0
- package/dist/components/InputPhoneField/InputPhoneField.d.ts +15 -0
- package/dist/components/InputPhoneField/InputPhoneField.js +17 -0
- package/dist/components/InputPhoneField/InputPhoneField.js.map +1 -0
- package/dist/components/InputPhoneField/index.d.ts +1 -0
- package/dist/components/InputPhoneField/index.js +2 -0
- package/dist/components/InputPhoneField/index.js.map +1 -0
- package/dist/components/Layout/Layout.d.ts +1 -1
- package/dist/components/Layout/Layout.js +1 -1
- package/dist/components/Link/Link.d.ts +1 -1
- package/dist/components/Link/Link.js +1 -1
- package/dist/components/ListItem/ListItem.d.ts +19 -10
- package/dist/components/ListItem/ListItem.js +3 -3
- package/dist/components/ListItem/ListItem.js.map +1 -1
- package/dist/components/ListItem/ListItemExample.js +3 -3
- package/dist/components/ListItem/ListItemExample.js.map +1 -1
- package/dist/components/ListItem/list-item.css +5 -1
- package/dist/components/ListItem/list-item.css.js +5 -1
- package/dist/components/Menu/Menu.d.ts +1 -1
- package/dist/components/Menu/Menu.js +1 -1
- package/dist/components/Menu/MenuExample.js +1 -1
- package/dist/components/Menu/MenuExample.js.map +1 -1
- package/dist/components/MenuButton/MenuButton.d.ts +1 -1
- package/dist/components/MenuButton/MenuButton.js +1 -1
- package/dist/components/Modal/Modal.d.ts +1 -1
- package/dist/components/Modal/Modal.js +1 -1
- package/dist/components/Modal/ModalExample.js +1 -1
- package/dist/components/Modal/ModalExample.js.map +1 -1
- package/dist/components/Pagination/PageInput.js +2 -2
- package/dist/components/Pagination/PageInput.js.map +1 -1
- package/dist/components/Password/Password.d.ts +43 -0
- package/dist/components/Password/Password.js +63 -0
- package/dist/components/Password/Password.js.map +1 -0
- package/dist/components/Password/index.d.ts +1 -0
- package/dist/components/Password/index.js +2 -0
- package/dist/components/Password/index.js.map +1 -0
- package/dist/components/Password/password.css +21 -0
- package/dist/components/Password/password.css.js +26 -0
- package/dist/components/PasswordField/PasswordField.d.ts +8 -24
- package/dist/components/PasswordField/PasswordField.js +7 -23
- package/dist/components/PasswordField/PasswordField.js.map +1 -1
- package/dist/components/Popover/Popover.d.ts +3 -3
- package/dist/components/Popover/Popover.js +1 -1
- package/dist/components/Popover/PopoverExample.js +2 -2
- package/dist/components/Popover/PopoverExample.js.map +1 -1
- package/dist/components/ProgressBar/ProgressBar.d.ts +1 -1
- package/dist/components/ProgressBar/ProgressBar.js +1 -1
- package/dist/components/ProgressCircle/ProgressCircle.d.ts +1 -1
- package/dist/components/ProgressCircle/ProgressCircle.js +1 -1
- package/dist/components/ProgressionStepper/ProgressionStepper.d.ts +1 -1
- package/dist/components/ProgressionStepper/ProgressionStepper.js +3 -2
- package/dist/components/ProgressionStepper/ProgressionStepper.js.map +1 -1
- package/dist/components/ProgressionStepper/ProgressionStepperExample.js +2 -2
- package/dist/components/ProgressionStepper/ProgressionStepperExample.js.map +1 -1
- package/dist/components/Radio/Radio.d.ts +2 -2
- package/dist/components/Radio/Radio.js.map +1 -1
- package/dist/components/RadioGroup/RadioGroup.d.ts +7 -36
- package/dist/components/RadioGroup/RadioGroup.js +15 -9
- package/dist/components/RadioGroup/RadioGroup.js.map +1 -1
- package/dist/components/RadioGroup/radio-group.css +2 -1
- package/dist/components/RadioGroup/radio-group.css.js +2 -1
- package/dist/components/RadioGroupField/RadioGroupField.d.ts +15 -0
- package/dist/components/RadioGroupField/RadioGroupField.js +17 -0
- package/dist/components/RadioGroupField/RadioGroupField.js.map +1 -0
- package/dist/components/RadioGroupField/index.d.ts +1 -0
- package/dist/components/RadioGroupField/index.js +2 -0
- package/dist/components/RadioGroupField/index.js.map +1 -0
- package/dist/components/SearchBar/SearchBar.d.ts +7 -16
- package/dist/components/SearchBar/SearchBar.js +6 -6
- package/dist/components/SearchBar/SearchBar.js.map +1 -1
- package/dist/components/SegmentedControl/SegmentedControl.d.ts +1 -1
- package/dist/components/SegmentedControl/SegmentedControl.js +1 -1
- package/dist/components/Select/Select.d.ts +39 -34
- package/dist/components/Select/Select.js +49 -21
- package/dist/components/Select/Select.js.map +1 -1
- package/dist/components/Select/SelectExample.js +1 -9
- package/dist/components/Select/SelectExample.js.map +1 -1
- package/dist/components/SelectField/SelectField.d.ts +6 -26
- package/dist/components/SelectField/SelectField.js +5 -27
- package/dist/components/SelectField/SelectField.js.map +1 -1
- package/dist/components/Skeleton/SkeletonExample.js +2 -2
- package/dist/components/Skeleton/SkeletonExample.js.map +1 -1
- package/dist/components/Snackbar/Snackbar.d.ts +72 -14
- package/dist/components/Snackbar/Snackbar.js +38 -9
- package/dist/components/Snackbar/Snackbar.js.map +1 -1
- package/dist/components/Snackbar/SnackbarExample.d.ts +1 -1
- package/dist/components/Snackbar/SnackbarExample.js +5 -3
- package/dist/components/Snackbar/SnackbarExample.js.map +1 -1
- package/dist/components/Snackbar/snackbar.css +31 -2
- package/dist/components/Snackbar/snackbar.css.js +31 -2
- package/dist/components/StylesProviderDemo/StylesProviderDemo.d.ts +1 -1
- package/dist/components/StylesProviderDemo/StylesProviderDemo.js +3 -1
- package/dist/components/StylesProviderDemo/StylesProviderDemo.js.map +1 -1
- package/dist/components/StylesProviderDemo/exampleCss.d.ts +1 -0
- package/dist/components/StylesProviderDemo/exampleCss.js +1900 -0
- package/dist/components/StylesProviderDemo/exampleCss.js.map +1 -0
- package/dist/components/Switch/Switch.d.ts +5 -3
- package/dist/components/Switch/Switch.js +2 -2
- package/dist/components/Switch/Switch.js.map +1 -1
- package/dist/components/SwitchOption/SwitchOption.js +1 -1
- package/dist/components/SwitchOption/SwitchOption.js.map +1 -1
- package/dist/components/TabGroup/TabGroup.d.ts +2 -2
- package/dist/components/TabGroup/TabGroup.js +3 -3
- package/dist/components/TabGroup/TabGroup.js.map +1 -1
- package/dist/components/TabList/TabList.d.ts +6 -3
- package/dist/components/TabList/TabList.js +6 -4
- package/dist/components/TabList/TabList.js.map +1 -1
- package/dist/components/Tag/Tag.d.ts +1 -1
- package/dist/components/Tag/Tag.js +1 -1
- package/dist/components/Textarea/Textarea.d.ts +20 -26
- package/dist/components/Textarea/Textarea.js +29 -11
- package/dist/components/Textarea/Textarea.js.map +1 -1
- package/dist/components/Textarea/textarea.css +24 -10
- package/dist/components/Textarea/textarea.css.js +24 -10
- package/dist/components/TextareaField/TextareaField.d.ts +6 -30
- package/dist/components/TextareaField/TextareaField.js +5 -31
- package/dist/components/TextareaField/TextareaField.js.map +1 -1
- package/dist/components/TimePicker/Listbox.d.ts +15 -0
- package/dist/components/{TimeInput → TimePicker}/Listbox.js +2 -2
- package/dist/components/TimePicker/Listbox.js.map +1 -0
- package/dist/components/TimePicker/Segment.d.ts +21 -0
- package/dist/components/{TimeInput → TimePicker}/Segment.js +2 -1
- package/dist/components/TimePicker/Segment.js.map +1 -0
- package/dist/components/TimePicker/TimePicker.d.ts +36 -0
- package/dist/components/TimePicker/TimePicker.js +133 -0
- package/dist/components/TimePicker/TimePicker.js.map +1 -0
- package/dist/components/TimePicker/TimePickerExample.d.ts +3 -0
- package/dist/components/TimePicker/TimePickerExample.js +6 -0
- package/dist/components/TimePicker/TimePickerExample.js.map +1 -0
- package/dist/components/TimePicker/index.d.ts +1 -0
- package/dist/components/TimePicker/index.js +2 -0
- package/dist/components/TimePicker/index.js.map +1 -0
- package/dist/components/{TimeInput/time-input.css → TimePicker/time-picker.css} +28 -26
- package/dist/components/{TimeInput/time-input.css.js → TimePicker/time-picker.css.js} +28 -26
- package/dist/components/TimePicker/utils.d.ts +11 -0
- package/dist/components/TimePicker/utils.js +35 -0
- package/dist/components/TimePicker/utils.js.map +1 -0
- package/dist/components/TimePickerField/TimePickerField.d.ts +15 -0
- package/dist/components/TimePickerField/TimePickerField.js +17 -0
- package/dist/components/TimePickerField/TimePickerField.js.map +1 -0
- package/dist/components/TimePickerField/index.d.ts +1 -0
- package/dist/components/TimePickerField/index.js +2 -0
- package/dist/components/TimePickerField/index.js.map +1 -0
- package/dist/components/ToggleOption/ToggleOption.js +3 -2
- package/dist/components/ToggleOption/ToggleOption.js.map +1 -1
- package/dist/components/Tooltip/Tooltip.d.ts +1 -1
- package/dist/components/Tooltip/Tooltip.js +1 -1
- package/dist/components/Tooltip/TooltipExample.js +2 -2
- package/dist/components/Tooltip/TooltipExample.js.map +1 -1
- package/dist/components/Txt/Txt.d.ts +1 -1
- package/dist/components/Txt/Txt.js +1 -1
- package/dist/constants/brands.d.ts +1 -1
- package/dist/constants/brands.js +4 -0
- package/dist/constants/brands.js.map +1 -1
- package/dist/hooks/useCheckboxGroupState.d.ts +1 -1
- package/dist/hooks/useCheckboxGroupState.js +1 -1
- package/dist/hooks/useCheckboxState.d.ts +1 -1
- package/dist/hooks/useCheckboxState.js +1 -1
- package/dist/hooks/useContainerWidth.d.ts +1 -1
- package/dist/hooks/useContainerWidth.js +1 -1
- package/dist/hooks/useModalState.d.ts +1 -1
- package/dist/hooks/useModalState.js +1 -1
- package/dist/hooks/useOutsideClick.d.ts +1 -1
- package/dist/hooks/useOutsideClick.js +1 -1
- package/dist/hooks/useRadioState.d.ts +2 -2
- package/dist/hooks/useRadioState.js +1 -1
- package/dist/hooks/useTimeout.d.ts +1 -1
- package/dist/styles/base.css +3 -0
- package/dist/styles/base.css.js +3 -0
- package/dist/types/common.d.ts +18 -10
- package/dist/types/common.js.map +1 -1
- package/dist/types/meta.d.ts +1 -0
- package/dist/types/meta.js.map +1 -1
- package/dist/utils/demo.d.ts +1 -0
- package/dist/utils/demo.js.map +1 -1
- package/meta.ts +1 -0
- package/package.json +37 -37
- package/src/components/AvatarGroup/AvatarGroup.tsx +1 -1
- package/src/components/Breadcrumb/Breadcrumb.tsx +5 -56
- package/src/components/Breadcrumb/BreadcumbDropdown.tsx +135 -0
- package/src/components/Button/Button.tsx +7 -1
- package/src/components/Button/button.scss +5 -5
- package/src/components/Calendar/Calendar.rtl.test.tsx +22 -0
- package/src/components/{CalendarPicker/CalendarPicker.tsx → Calendar/Calendar.tsx} +86 -87
- package/src/components/Calendar/CalendarExample.tsx +31 -0
- package/src/components/{CalendarPicker/calendar-picker.scss → Calendar/calendar.scss} +1 -1
- package/src/components/Calendar/index.tsx +1 -0
- package/src/components/Checkbox/Checkbox.tsx +28 -26
- package/src/components/CheckboxGroup/CheckboxGroup.tsx +73 -77
- package/src/components/CheckboxGroup/CheckboxGroupExample.tsx +3 -0
- package/src/components/CheckboxGroup/checkbox-group.scss +8 -0
- package/src/components/CheckboxGroupField/CheckboxGroupField.rtl.test.tsx +27 -0
- package/src/components/CheckboxGroupField/CheckboxGroupField.tsx +36 -0
- package/src/components/CheckboxGroupField/index.tsx +1 -0
- package/src/components/{ChipUtility/ChipUtility.rtl.test.tsx → Chip/Chip.rtl.test.tsx} +5 -5
- package/src/components/{ChipUtility/ChipUtility.tsx → Chip/Chip.tsx} +26 -28
- package/src/components/{ChipUtility/ChipUtilityExample.tsx → Chip/ChipExample.tsx} +3 -3
- package/src/components/{ChipUtility/chip-utility.scss → Chip/chip.scss} +1 -1
- package/src/components/Chip/index.tsx +1 -0
- package/src/components/ChipGroup/ChipGroup.rtl.test.tsx +7 -7
- package/src/components/ChipGroup/ChipGroup.tsx +8 -7
- package/src/components/ChipGroup/ChipGroupExample.tsx +38 -138
- package/src/components/DatePicker/DatePicker.rtl.test.tsx +17 -0
- package/src/components/DatePicker/DatePicker.tsx +227 -0
- package/src/components/DatePicker/DatePickerExample.tsx +12 -0
- package/src/components/{DateInput/date-input.scss → DatePicker/date-picker.scss} +2 -3
- package/src/components/DatePicker/index.tsx +1 -0
- package/src/components/DatePickerField/DatePickerField.rtl.test.tsx +17 -0
- package/src/components/DatePickerField/DatePickerField.tsx +30 -0
- package/src/components/DatePickerField/index.tsx +1 -0
- package/src/components/Drawer/Drawer.tsx +1 -1
- package/src/components/Drawer/DrawerExample.tsx +2 -2
- package/src/components/EmptyState/EmptyState.tsx +1 -1
- package/src/components/Fab/Fab.tsx +1 -1
- package/src/components/Field/Field.rtl.test.tsx +23 -0
- package/src/components/Field/Field.tsx +110 -0
- package/src/components/Field/FieldDescription.tsx +15 -0
- package/src/components/Field/FieldError.tsx +19 -0
- package/src/components/Field/FieldExample.tsx +21 -0
- package/src/components/Field/FieldLabel.tsx +38 -0
- package/src/components/Field/field.scss +43 -0
- package/src/components/Field/index.tsx +5 -0
- package/src/components/Field/utils.ts +79 -0
- package/src/components/FormField/FormField.rtl.test.tsx +11 -21
- package/src/components/FormField/FormField.tsx +44 -66
- package/src/components/FormField/FormFieldExample.tsx +275 -38
- package/src/components/Img/Img.tsx +1 -1
- package/src/components/InlineAlert/InlineAlert.tsx +5 -5
- package/src/components/{NumberInput/NumberInput.rtl.test.tsx → Input/Input.rtl.test.tsx} +3 -3
- package/src/components/Input/Input.tsx +99 -0
- package/src/components/{TextInput/TextInput.tsx → Input/InputElement.tsx} +69 -77
- package/src/components/Input/InputExample.tsx +57 -0
- package/src/components/Input/index.tsx +2 -0
- package/src/components/{TextInput/text-input.scss → Input/input.scss} +7 -7
- package/src/components/InputField/InputField.rtl.test.tsx +15 -0
- package/src/components/InputField/InputField.tsx +24 -0
- package/src/components/InputField/index.tsx +1 -0
- package/src/components/{TextField/TextField.rtl.test.tsx → InputNumber/InputNumber.rtl.test.tsx} +3 -12
- package/src/components/{NumberInput/NumberInput.tsx → InputNumber/InputNumber.tsx} +48 -30
- package/src/components/{NumberInput/NumberInputExample.tsx → InputNumber/InputNumberExample.tsx} +2 -2
- package/src/components/InputNumber/index.tsx +1 -0
- package/src/components/{NumberInput/number-input.scss → InputNumber/input-number.scss} +1 -1
- package/src/components/InputNumberField/InputNumberField.rtl.test.tsx +17 -0
- package/src/components/InputNumberField/InputNumberField.tsx +30 -0
- package/src/components/InputNumberField/index.tsx +1 -0
- package/src/components/InputPhone/InputPhone.rtl.test.tsx +17 -0
- package/src/components/InputPhone/InputPhone.tsx +290 -0
- package/src/components/InputPhone/InputPhoneExample.tsx +9 -0
- package/src/components/InputPhone/index.tsx +1 -0
- package/src/components/{PhoneNumberInput/phone-number-input.scss → InputPhone/input-phone.scss} +13 -18
- package/src/components/InputPhoneField/InputPhoneField.rtl.test.tsx +17 -0
- package/src/components/InputPhoneField/InputPhoneField.tsx +30 -0
- package/src/components/InputPhoneField/index.tsx +1 -0
- package/src/components/Layout/Layout.tsx +1 -1
- package/src/components/Link/Link.tsx +1 -1
- package/src/components/ListItem/ListItem.tsx +31 -13
- package/src/components/ListItem/ListItemExample.tsx +3 -3
- package/src/components/ListItem/list-item.scss +6 -1
- package/src/components/Menu/Menu.tsx +1 -1
- package/src/components/Menu/MenuExample.tsx +1 -0
- package/src/components/MenuButton/MenuButton.tsx +1 -1
- package/src/components/Modal/Modal.tsx +1 -1
- package/src/components/Modal/ModalExample.tsx +4 -6
- package/src/components/Pagination/PageInput.tsx +2 -2
- package/src/components/{CalendarPicker/CalendarPicker.rtl.test.tsx → Password/Password.rtl.test.tsx} +4 -4
- package/src/components/Password/Password.tsx +113 -0
- package/src/components/Password/index.tsx +1 -0
- package/src/components/Password/password.scss +31 -0
- package/src/components/PasswordField/PasswordField.rtl.test.tsx +4 -11
- package/src/components/PasswordField/PasswordField.tsx +10 -53
- package/src/components/Popover/Popover.tsx +2 -2
- package/src/components/Popover/PopoverExample.tsx +2 -2
- package/src/components/ProgressBar/ProgressBar.tsx +1 -1
- package/src/components/ProgressCircle/ProgressCircle.tsx +1 -1
- package/src/components/ProgressionStepper/ProgressionStepper.tsx +9 -14
- package/src/components/ProgressionStepper/ProgressionStepperExample.tsx +2 -2
- package/src/components/Radio/Radio.tsx +15 -16
- package/src/components/RadioGroup/RadioGroup.rtl.test.tsx +4 -5
- package/src/components/RadioGroup/RadioGroup.tsx +51 -71
- package/src/components/RadioGroup/radio-group.scss +3 -1
- package/src/components/RadioGroupField/RadioGroupField.rtl.test.tsx +27 -0
- package/src/components/RadioGroupField/RadioGroupField.tsx +36 -0
- package/src/components/RadioGroupField/index.tsx +1 -0
- package/src/components/SearchBar/SearchBar.rtl.test.tsx +3 -3
- package/src/components/SearchBar/SearchBar.tsx +8 -21
- package/src/components/SegmentedControl/SegmentedControl.tsx +1 -1
- package/src/components/Select/Select.rtl.test.tsx +6 -5
- package/src/components/Select/Select.tsx +56 -54
- package/src/components/Select/SelectExample.tsx +1 -14
- package/src/components/SelectField/SelectField.rtl.test.tsx +9 -6
- package/src/components/SelectField/SelectField.tsx +9 -56
- package/src/components/Skeleton/SkeletonExample.tsx +1 -3
- package/src/components/Snackbar/Snackbar.tsx +124 -28
- package/src/components/Snackbar/SnackbarExample.tsx +9 -3
- package/src/components/Snackbar/snackbar.scss +48 -16
- package/src/components/StylesProviderDemo/StylesProviderDemo.tsx +5 -2
- package/src/components/StylesProviderDemo/exampleCss.ts +1899 -0
- package/src/components/Switch/Switch.rtl.test.tsx +3 -1
- package/src/components/Switch/Switch.tsx +5 -3
- package/src/components/SwitchOption/SwitchOption.rtl.test.tsx +3 -1
- package/src/components/SwitchOption/SwitchOption.tsx +1 -1
- package/src/components/TabGroup/TabGroup.tsx +2 -2
- package/src/components/TabList/TabList.tsx +16 -6
- package/src/components/Tag/Tag.tsx +1 -1
- package/src/components/Textarea/Textarea.rtl.test.tsx +1 -1
- package/src/components/Textarea/Textarea.tsx +72 -68
- package/src/components/Textarea/textarea.scss +41 -19
- package/src/components/TextareaField/TextareaField.rtl.test.tsx +4 -11
- package/src/components/TextareaField/TextareaField.tsx +9 -74
- package/src/components/{TimeInput → TimePicker}/Listbox.tsx +5 -5
- package/src/components/{TimeInput → TimePicker}/Segment.tsx +8 -5
- package/src/components/{TextInput/TextInput.rtl.test.tsx → TimePicker/TimePicker.rtl.test.tsx} +3 -3
- package/src/components/{TimeInput/TimeInput.tsx → TimePicker/TimePicker.tsx} +104 -67
- package/src/components/TimePicker/TimePickerExample.tsx +8 -0
- package/src/components/TimePicker/index.tsx +1 -0
- package/src/components/{TimeInput/time-input.scss → TimePicker/time-picker.scss} +7 -5
- package/src/components/TimePicker/utils.test.tsx +26 -0
- package/src/components/TimePicker/utils.ts +44 -0
- package/src/components/TimePickerField/TimePickerField.rtl.test.tsx +17 -0
- package/src/components/TimePickerField/TimePickerField.tsx +30 -0
- package/src/components/TimePickerField/index.tsx +1 -0
- package/src/components/ToggleOption/ToggleOption.tsx +10 -5
- package/src/components/Tooltip/Tooltip.tsx +1 -1
- package/src/components/Tooltip/TooltipExample.tsx +7 -9
- package/src/components/Txt/Txt.tsx +1 -1
- package/src/constants/brands.ts +5 -1
- package/src/hooks/useCheckboxGroupState.ts +1 -1
- package/src/hooks/useCheckboxState.ts +1 -1
- package/src/hooks/useContainerWidth.tsx +1 -1
- package/src/hooks/useModalState.ts +1 -1
- package/src/hooks/useOutsideClick.ts +1 -1
- package/src/hooks/useRadioState.ts +1 -1
- package/src/hooks/useTimeout.ts +1 -1
- package/src/styles/base.scss +3 -0
- package/src/types/common.ts +28 -10
- package/src/types/meta.ts +1 -0
- package/src/utils/demo.ts +1 -0
- package/dist/components/CalendarPicker/CalendarPicker.d.ts +0 -32
- package/dist/components/CalendarPicker/CalendarPicker.js.map +0 -1
- package/dist/components/CalendarPicker/CalendarPickerExample.d.ts +0 -3
- package/dist/components/CalendarPicker/CalendarPickerExample.js +0 -17
- package/dist/components/CalendarPicker/CalendarPickerExample.js.map +0 -1
- package/dist/components/CalendarPicker/index.d.ts +0 -1
- package/dist/components/CalendarPicker/index.js +0 -2
- package/dist/components/CalendarPicker/index.js.map +0 -1
- package/dist/components/ChipAssist/ChipAssist.d.ts +0 -24
- package/dist/components/ChipAssist/ChipAssist.js +0 -26
- package/dist/components/ChipAssist/ChipAssist.js.map +0 -1
- package/dist/components/ChipAssist/ChipAssistExample.d.ts +0 -4
- package/dist/components/ChipAssist/ChipAssistExample.js +0 -32
- package/dist/components/ChipAssist/ChipAssistExample.js.map +0 -1
- package/dist/components/ChipAssist/index.d.ts +0 -1
- package/dist/components/ChipAssist/index.js +0 -2
- package/dist/components/ChipAssist/index.js.map +0 -1
- package/dist/components/ChipFilter/ChipFilter.d.ts +0 -40
- package/dist/components/ChipFilter/ChipFilter.js +0 -31
- package/dist/components/ChipFilter/ChipFilter.js.map +0 -1
- package/dist/components/ChipFilter/ChipFilterExample.d.ts +0 -3
- package/dist/components/ChipFilter/ChipFilterExample.js +0 -62
- package/dist/components/ChipFilter/ChipFilterExample.js.map +0 -1
- package/dist/components/ChipFilter/index.d.ts +0 -1
- package/dist/components/ChipFilter/index.js +0 -2
- package/dist/components/ChipFilter/index.js.map +0 -1
- package/dist/components/ChipInput/ChipInput.d.ts +0 -31
- package/dist/components/ChipInput/ChipInput.js +0 -27
- package/dist/components/ChipInput/ChipInput.js.map +0 -1
- package/dist/components/ChipInput/ChipInputExample.d.ts +0 -4
- package/dist/components/ChipInput/ChipInputExample.js +0 -47
- package/dist/components/ChipInput/ChipInputExample.js.map +0 -1
- package/dist/components/ChipInput/index.d.ts +0 -1
- package/dist/components/ChipInput/index.js +0 -2
- package/dist/components/ChipInput/index.js.map +0 -1
- package/dist/components/ChipSuggestion/ChipSuggestion.d.ts +0 -17
- package/dist/components/ChipSuggestion/ChipSuggestion.js +0 -19
- package/dist/components/ChipSuggestion/ChipSuggestion.js.map +0 -1
- package/dist/components/ChipSuggestion/ChipSuggestionExample.d.ts +0 -4
- package/dist/components/ChipSuggestion/ChipSuggestionExample.js +0 -24
- package/dist/components/ChipSuggestion/ChipSuggestionExample.js.map +0 -1
- package/dist/components/ChipSuggestion/index.d.ts +0 -1
- package/dist/components/ChipSuggestion/index.js +0 -2
- package/dist/components/ChipSuggestion/index.js.map +0 -1
- package/dist/components/ChipUtility/ChipUtility.js +0 -25
- package/dist/components/ChipUtility/ChipUtility.js.map +0 -1
- package/dist/components/ChipUtility/ChipUtilityExample.d.ts +0 -4
- package/dist/components/ChipUtility/ChipUtilityExample.js.map +0 -1
- package/dist/components/ChipUtility/index.d.ts +0 -1
- package/dist/components/ChipUtility/index.js +0 -2
- package/dist/components/ChipUtility/index.js.map +0 -1
- package/dist/components/DateField/DateField.d.ts +0 -32
- package/dist/components/DateField/DateField.js +0 -34
- package/dist/components/DateField/DateField.js.map +0 -1
- package/dist/components/DateField/DateFieldExample.d.ts +0 -4
- package/dist/components/DateField/DateFieldExample.js +0 -11
- package/dist/components/DateField/DateFieldExample.js.map +0 -1
- package/dist/components/DateField/date-field.css +0 -8
- package/dist/components/DateField/index.d.ts +0 -1
- package/dist/components/DateField/index.js +0 -2
- package/dist/components/DateField/index.js.map +0 -1
- package/dist/components/DateInput/DateInput.d.ts +0 -39
- package/dist/components/DateInput/DateInput.js +0 -103
- package/dist/components/DateInput/DateInput.js.map +0 -1
- package/dist/components/DateInput/DateInputExample.d.ts +0 -4
- package/dist/components/DateInput/DateInputExample.js +0 -14
- package/dist/components/DateInput/DateInputExample.js.map +0 -1
- package/dist/components/DateInput/index.d.ts +0 -1
- package/dist/components/DateInput/index.js +0 -2
- package/dist/components/DateInput/index.js.map +0 -1
- package/dist/components/FormField/form-field.css +0 -17
- package/dist/components/FormField/form-field.css.js +0 -22
- package/dist/components/ListItemMenu/ListItemMenu.d.ts +0 -146
- package/dist/components/ListItemMenu/ListItemMenu.js +0 -159
- package/dist/components/ListItemMenu/ListItemMenu.js.map +0 -1
- package/dist/components/ListItemMenu/index.d.ts +0 -1
- package/dist/components/ListItemMenu/index.js +0 -2
- package/dist/components/ListItemMenu/index.js.map +0 -1
- package/dist/components/NumberField/NumberField.d.ts +0 -33
- package/dist/components/NumberField/NumberField.js +0 -35
- package/dist/components/NumberField/NumberField.js.map +0 -1
- package/dist/components/NumberField/index.d.ts +0 -1
- package/dist/components/NumberField/index.js +0 -2
- package/dist/components/NumberField/index.js.map +0 -1
- package/dist/components/NumberInput/NumberInput.d.ts +0 -63
- package/dist/components/NumberInput/NumberInput.js.map +0 -1
- package/dist/components/NumberInput/NumberInputExample.d.ts +0 -3
- package/dist/components/NumberInput/NumberInputExample.js.map +0 -1
- package/dist/components/NumberInput/index.d.ts +0 -1
- package/dist/components/NumberInput/index.js +0 -2
- package/dist/components/NumberInput/index.js.map +0 -1
- package/dist/components/PasswordInput/PasswordInput.d.ts +0 -21
- package/dist/components/PasswordInput/PasswordInput.js +0 -34
- package/dist/components/PasswordInput/PasswordInput.js.map +0 -1
- package/dist/components/PasswordInput/index.d.ts +0 -1
- package/dist/components/PasswordInput/index.js +0 -2
- package/dist/components/PasswordInput/index.js.map +0 -1
- package/dist/components/PasswordInput/password-input.css +0 -28
- package/dist/components/PasswordInput/password-input.css.js +0 -33
- package/dist/components/PhoneNumberField/PhoneNumberField.d.ts +0 -14
- package/dist/components/PhoneNumberField/PhoneNumberField.js +0 -16
- package/dist/components/PhoneNumberField/PhoneNumberField.js.map +0 -1
- package/dist/components/PhoneNumberField/index.d.ts +0 -1
- package/dist/components/PhoneNumberField/index.js +0 -2
- package/dist/components/PhoneNumberField/index.js.map +0 -1
- package/dist/components/PhoneNumberInput/PhoneNumberInput.d.ts +0 -37
- package/dist/components/PhoneNumberInput/PhoneNumberInput.js +0 -83
- package/dist/components/PhoneNumberInput/PhoneNumberInput.js.map +0 -1
- package/dist/components/PhoneNumberInput/PhoneNumberInputExample.d.ts +0 -4
- package/dist/components/PhoneNumberInput/PhoneNumberInputExample.js +0 -5
- package/dist/components/PhoneNumberInput/PhoneNumberInputExample.js.map +0 -1
- package/dist/components/PhoneNumberInput/index.d.ts +0 -1
- package/dist/components/PhoneNumberInput/index.js +0 -2
- package/dist/components/PhoneNumberInput/index.js.map +0 -1
- package/dist/components/PhoneNumberInput/phone-number-input.css +0 -46
- package/dist/components/PhoneNumberInput/phone-number-input.css.js +0 -51
- package/dist/components/SelectField/SelectFieldExample.d.ts +0 -23
- package/dist/components/SelectField/SelectFieldExample.js +0 -13
- package/dist/components/SelectField/SelectFieldExample.js.map +0 -1
- package/dist/components/SnackbarProvider/SnackbarProvider.d.ts +0 -90
- package/dist/components/SnackbarProvider/SnackbarProvider.js +0 -115
- package/dist/components/SnackbarProvider/SnackbarProvider.js.map +0 -1
- package/dist/components/SnackbarProvider/SnackbarProviderExample.d.ts +0 -4
- package/dist/components/SnackbarProvider/SnackbarProviderExample.js +0 -59
- package/dist/components/SnackbarProvider/SnackbarProviderExample.js.map +0 -1
- package/dist/components/SnackbarProvider/index.d.ts +0 -1
- package/dist/components/SnackbarProvider/index.js +0 -2
- package/dist/components/SnackbarProvider/index.js.map +0 -1
- package/dist/components/SnackbarProvider/snackbar-provider-example.css +0 -15
- package/dist/components/SnackbarProvider/snackbar-provider-example.css.js +0 -20
- package/dist/components/SnackbarProvider/snackbar-provider.css +0 -15
- package/dist/components/SnackbarProvider/snackbar-provider.css.js +0 -20
- package/dist/components/TextField/TextField.d.ts +0 -31
- package/dist/components/TextField/TextField.js +0 -33
- package/dist/components/TextField/TextField.js.map +0 -1
- package/dist/components/TextField/TextFieldExample.d.ts +0 -3
- package/dist/components/TextField/TextFieldExample.js +0 -6
- package/dist/components/TextField/TextFieldExample.js.map +0 -1
- package/dist/components/TextField/index.d.ts +0 -1
- package/dist/components/TextField/index.js +0 -2
- package/dist/components/TextField/index.js.map +0 -1
- package/dist/components/TextInput/TextInput.d.ts +0 -78
- package/dist/components/TextInput/TextInput.js.map +0 -1
- package/dist/components/TextInput/TextInputExample.d.ts +0 -3
- package/dist/components/TextInput/TextInputExample.js.map +0 -1
- package/dist/components/TextInput/index.d.ts +0 -1
- package/dist/components/TextInput/index.js +0 -2
- package/dist/components/TextInput/index.js.map +0 -1
- package/dist/components/TextareaField/TextareaFieldExample.d.ts +0 -3
- package/dist/components/TextareaField/TextareaFieldExample.js +0 -10
- package/dist/components/TextareaField/TextareaFieldExample.js.map +0 -1
- package/dist/components/TimeInput/Listbox.d.ts +0 -15
- package/dist/components/TimeInput/Listbox.js.map +0 -1
- package/dist/components/TimeInput/Segment.d.ts +0 -20
- package/dist/components/TimeInput/Segment.js.map +0 -1
- package/dist/components/TimeInput/TimeInput.d.ts +0 -24
- package/dist/components/TimeInput/TimeInput.js +0 -115
- package/dist/components/TimeInput/TimeInput.js.map +0 -1
- package/dist/components/TimeInput/TimeInputExample.d.ts +0 -3
- package/dist/components/TimeInput/TimeInputExample.js +0 -4
- package/dist/components/TimeInput/TimeInputExample.js.map +0 -1
- package/dist/components/TimeInput/index.d.ts +0 -1
- package/dist/components/TimeInput/index.js +0 -2
- package/dist/components/TimeInput/index.js.map +0 -1
- package/dist/hooks/useSnackbarContext.d.ts +0 -1
- package/dist/hooks/useSnackbarContext.js +0 -16
- package/dist/hooks/useSnackbarContext.js.map +0 -1
- package/dist/utils/snackbarContext.d.ts +0 -38
- package/dist/utils/snackbarContext.js +0 -3
- package/dist/utils/snackbarContext.js.map +0 -1
- package/src/components/CalendarPicker/CalendarPickerExample.tsx +0 -24
- package/src/components/CalendarPicker/index.tsx +0 -1
- package/src/components/ChipAssist/ChipAssist.rtl.test.tsx +0 -16
- package/src/components/ChipAssist/ChipAssist.tsx +0 -37
- package/src/components/ChipAssist/ChipAssistExample.tsx +0 -34
- package/src/components/ChipAssist/index.tsx +0 -1
- package/src/components/ChipFilter/ChipFilter.rtl.test.tsx +0 -15
- package/src/components/ChipFilter/ChipFilter.tsx +0 -75
- package/src/components/ChipFilter/ChipFilterExample.tsx +0 -63
- package/src/components/ChipFilter/index.tsx +0 -1
- package/src/components/ChipInput/ChipInput.rtl.test.tsx +0 -16
- package/src/components/ChipInput/ChipInput.tsx +0 -47
- package/src/components/ChipInput/ChipInputExample.tsx +0 -49
- package/src/components/ChipInput/index.tsx +0 -1
- package/src/components/ChipSuggestion/ChipSuggestion.rtl.test.tsx +0 -19
- package/src/components/ChipSuggestion/ChipSuggestion.tsx +0 -22
- package/src/components/ChipSuggestion/ChipSuggestionExample.tsx +0 -26
- package/src/components/ChipSuggestion/index.tsx +0 -1
- package/src/components/ChipUtility/index.tsx +0 -1
- package/src/components/DateField/DateField.rtl.test.tsx +0 -24
- package/src/components/DateField/DateField.tsx +0 -58
- package/src/components/DateField/DateFieldExample.tsx +0 -13
- package/src/components/DateField/date-field.scss +0 -8
- package/src/components/DateField/index.tsx +0 -1
- package/src/components/DateInput/DateInput.rtl.test.tsx +0 -17
- package/src/components/DateInput/DateInput.tsx +0 -198
- package/src/components/DateInput/DateInputExample.tsx +0 -17
- package/src/components/DateInput/index.tsx +0 -1
- package/src/components/FormField/form-field.scss +0 -19
- package/src/components/ListItemMenu/ListItemMenu.tsx +0 -359
- package/src/components/ListItemMenu/index.tsx +0 -1
- package/src/components/NumberField/NumberField.rtl.test.tsx +0 -24
- package/src/components/NumberField/NumberField.tsx +0 -70
- package/src/components/NumberField/index.tsx +0 -1
- package/src/components/NumberInput/index.tsx +0 -1
- package/src/components/PasswordInput/PasswordInput.rtl.test.tsx +0 -15
- package/src/components/PasswordInput/PasswordInput.tsx +0 -115
- package/src/components/PasswordInput/index.tsx +0 -1
- package/src/components/PasswordInput/password-input.scss +0 -36
- package/src/components/PhoneNumberField/PhoneNumberField.rtl.test.tsx +0 -24
- package/src/components/PhoneNumberField/PhoneNumberField.tsx +0 -41
- package/src/components/PhoneNumberField/index.tsx +0 -1
- package/src/components/PhoneNumberInput/PhoneNumberInput.rtl.test.tsx +0 -17
- package/src/components/PhoneNumberInput/PhoneNumberInput.tsx +0 -186
- package/src/components/PhoneNumberInput/PhoneNumberInputExample.tsx +0 -8
- package/src/components/PhoneNumberInput/index.tsx +0 -1
- package/src/components/SelectField/SelectFieldExample.tsx +0 -16
- package/src/components/SnackbarProvider/SnackbarProvider.tsx +0 -160
- package/src/components/SnackbarProvider/SnackbarProviderExample.tsx +0 -127
- package/src/components/SnackbarProvider/index.tsx +0 -1
- package/src/components/SnackbarProvider/snackbar-provider-example.scss +0 -17
- package/src/components/SnackbarProvider/snackbar-provider.scss +0 -15
- package/src/components/TextField/TextField.tsx +0 -67
- package/src/components/TextField/TextFieldExample.tsx +0 -8
- package/src/components/TextField/index.tsx +0 -1
- package/src/components/TextInput/TextInputExample.tsx +0 -44
- package/src/components/TextInput/index.tsx +0 -1
- package/src/components/TextareaField/TextareaFieldExample.tsx +0 -13
- package/src/components/TimeInput/TimeInput.rtl.test.tsx +0 -15
- package/src/components/TimeInput/TimeInputExample.tsx +0 -6
- package/src/components/TimeInput/index.tsx +0 -1
- package/src/hooks/useSnackbarContext.ts +0 -18
- package/src/utils/snackbarContext.tsx +0 -43
- /package/dist/components/{NumberInput → InputNumber}/IncrementButton.d.ts +0 -0
- /package/dist/components/{NumberInput → InputNumber}/IncrementButton.js +0 -0
- /package/src/components/{NumberInput → InputNumber}/IncrementButton.tsx +0 -0
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { FormFieldWrapProps } from '-/components/FormField';
|
|
2
|
-
import { TextInputProps } from '-/components/TextInput';
|
|
3
|
-
export type TextFieldProps = FormFieldWrapProps<TextInputProps>;
|
|
4
|
-
/**
|
|
5
|
-
* A text input that allows users to enter text, numbers or symbols in a singular line.
|
|
6
|
-
*
|
|
7
|
-
* This component takes properties from the FormField and TextInput components.
|
|
8
|
-
*
|
|
9
|
-
* @example
|
|
10
|
-
* import { useState } from 'react';
|
|
11
|
-
* import { TextField } from '@bspk/ui/TextField';
|
|
12
|
-
*
|
|
13
|
-
* export function Example() {
|
|
14
|
-
* const [value, setValue] = useState<string>('');
|
|
15
|
-
*
|
|
16
|
-
* return (
|
|
17
|
-
* <TextField
|
|
18
|
-
* controlId="Example controlId"
|
|
19
|
-
* label="Example label"
|
|
20
|
-
* name="Example name"
|
|
21
|
-
* onChange={setValue}
|
|
22
|
-
* value={value}
|
|
23
|
-
* />
|
|
24
|
-
* );
|
|
25
|
-
* }
|
|
26
|
-
*
|
|
27
|
-
* @name TextField
|
|
28
|
-
* @phase UXReview
|
|
29
|
-
*/
|
|
30
|
-
export declare function TextField({ label, errorMessage, helperText, controlId, labelTrailing, required, invalid, ...inputProps }: TextFieldProps): import("react/jsx-runtime").JSX.Element;
|
|
31
|
-
/** Copyright 2025 Anywhere Real Estate - CC BY 4.0 */
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { FormField } from '../FormField';
|
|
3
|
-
import { TextInput } from '../TextInput';
|
|
4
|
-
/**
|
|
5
|
-
* A text input that allows users to enter text, numbers or symbols in a singular line.
|
|
6
|
-
*
|
|
7
|
-
* This component takes properties from the FormField and TextInput components.
|
|
8
|
-
*
|
|
9
|
-
* @example
|
|
10
|
-
* import { useState } from 'react';
|
|
11
|
-
* import { TextField } from '@bspk/ui/TextField';
|
|
12
|
-
*
|
|
13
|
-
* export function Example() {
|
|
14
|
-
* const [value, setValue] = useState<string>('');
|
|
15
|
-
*
|
|
16
|
-
* return (
|
|
17
|
-
* <TextField
|
|
18
|
-
* controlId="Example controlId"
|
|
19
|
-
* label="Example label"
|
|
20
|
-
* name="Example name"
|
|
21
|
-
* onChange={setValue}
|
|
22
|
-
* value={value}
|
|
23
|
-
* />
|
|
24
|
-
* );
|
|
25
|
-
* }
|
|
26
|
-
*
|
|
27
|
-
* @name TextField
|
|
28
|
-
* @phase UXReview
|
|
29
|
-
*/
|
|
30
|
-
export function TextField({ label, errorMessage, helperText, controlId, labelTrailing, required, invalid, ...inputProps }) {
|
|
31
|
-
return (_jsx(FormField, { controlId: controlId, "data-bspk": "text-field", errorMessage: errorMessage, helperText: helperText, invalid: invalid, label: label, labelTrailing: labelTrailing, required: required, children: (fieldProps) => (_jsx(TextInput, { ...inputProps, ...fieldProps, id: controlId, invalid: invalid, required: required, value: inputProps.value ?? '' })) }));
|
|
32
|
-
}
|
|
33
|
-
//# sourceMappingURL=TextField.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TextField.js","sourceRoot":"","sources":["../../../src/components/TextField/TextField.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAsB,MAAM,wBAAwB,CAAC;AACvE,OAAO,EAAkB,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAInE;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,MAAM,UAAU,SAAS,CAAC,EACtB,KAAK,EACL,YAAY,EACZ,UAAU,EACV,SAAS,EACT,aAAa,EACb,QAAQ,EACR,OAAO,EACP,GAAG,UAAU,EACA;IACb,OAAO,CACH,KAAC,SAAS,IACN,SAAS,EAAE,SAAS,eACV,YAAY,EACtB,YAAY,EAAE,YAAY,EAC1B,UAAU,EAAE,UAAU,EACtB,OAAO,EAAE,OAAO,EAChB,KAAK,EAAE,KAAK,EACZ,aAAa,EAAE,aAAa,EAC5B,QAAQ,EAAE,QAAQ,YAEjB,CAAC,UAAU,EAAE,EAAE,CAAC,CACb,KAAC,SAAS,OACF,UAAU,KACV,UAAU,EACd,EAAE,EAAE,SAAS,EACb,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,QAAQ,EAClB,KAAK,EAAE,UAAU,CAAC,KAAK,IAAI,EAAE,GAC/B,CACL,GACO,CACf,CAAC;AACN,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TextFieldExample.js","sourceRoot":"","sources":["../../../src/components/TextField/TextFieldExample.tsx"],"names":[],"mappings":"AAGA,MAAM,CAAC,MAAM,gBAAgB,GAAqC;IAC9D,QAAQ,EAAE;QACN,IAAI,EAAE,KAAK;KACd;CACJ,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './TextField';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/TextField/index.tsx"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC"}
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
import './text-input.scss';
|
|
2
|
-
import { ChangeEvent, HTMLInputTypeAttribute, ReactNode } from 'react';
|
|
3
|
-
import { CommonProps, ElementProps, FormFieldControlProps, SetRef } from '-/types/common';
|
|
4
|
-
export declare const DEFAULT: {
|
|
5
|
-
readonly size: "medium";
|
|
6
|
-
readonly value: "";
|
|
7
|
-
readonly type: Extract<HTMLInputTypeAttribute, "number" | "text">;
|
|
8
|
-
readonly autoComplete: "off";
|
|
9
|
-
};
|
|
10
|
-
type TextInputBaseProps = {
|
|
11
|
-
/**
|
|
12
|
-
* Callback when the value of the field changes.
|
|
13
|
-
*
|
|
14
|
-
* @required
|
|
15
|
-
*/
|
|
16
|
-
onChange: (next: string, event?: ChangeEvent<HTMLInputElement>) => void;
|
|
17
|
-
/** The ref of the container. */
|
|
18
|
-
containerRef?: SetRef<HTMLDivElement>;
|
|
19
|
-
/** The ref of the input. */
|
|
20
|
-
inputRef?: SetRef<HTMLInputElement>;
|
|
21
|
-
/**
|
|
22
|
-
* The trailing element to display in the field.
|
|
23
|
-
*
|
|
24
|
-
* @exampleType string
|
|
25
|
-
*/
|
|
26
|
-
trailing?: ReactNode;
|
|
27
|
-
/**
|
|
28
|
-
* The leading element to display in the field.
|
|
29
|
-
*
|
|
30
|
-
* @exampleType string
|
|
31
|
-
*/
|
|
32
|
-
leading?: ReactNode;
|
|
33
|
-
/** The placeholder of the field. */
|
|
34
|
-
placeholder?: string;
|
|
35
|
-
/**
|
|
36
|
-
* The type of the input.
|
|
37
|
-
*
|
|
38
|
-
* @default text
|
|
39
|
-
*/
|
|
40
|
-
type?: Extract<HTMLInputTypeAttribute, 'number' | 'password' | 'text'>;
|
|
41
|
-
/**
|
|
42
|
-
* Specifies if user agent has any permission to provide automated assistance in filling out form field values
|
|
43
|
-
*
|
|
44
|
-
* @default off
|
|
45
|
-
*/
|
|
46
|
-
autoComplete?: '' | 'off' | 'on';
|
|
47
|
-
/**
|
|
48
|
-
* Specifies if the clear button should be shown. This should almost always be true, but can be set to false.
|
|
49
|
-
*
|
|
50
|
-
* @default true
|
|
51
|
-
*/
|
|
52
|
-
showClearButton?: boolean;
|
|
53
|
-
};
|
|
54
|
-
export type TextInputProps = CommonProps<'aria-label' | 'disabled' | 'id' | 'invalid' | 'name' | 'owner' | 'readOnly' | 'required' | 'size' | 'value'> & FormFieldControlProps & TextInputBaseProps & {
|
|
55
|
-
inputProps?: Omit<React.InputHTMLAttributes<HTMLInputElement>, keyof TextInputBaseProps>;
|
|
56
|
-
};
|
|
57
|
-
/**
|
|
58
|
-
* A text input that allows users to enter text, numbers or symbols in a singular line. This is the base element and is
|
|
59
|
-
* not intended to be used directly. Use the TextField component.
|
|
60
|
-
*
|
|
61
|
-
* @example
|
|
62
|
-
* import { useState } from 'react';
|
|
63
|
-
* import { TextInput } from '@bspk/ui/TextInput';
|
|
64
|
-
*
|
|
65
|
-
* export function Example() {
|
|
66
|
-
* const [value, setValue] = useState<string>('');
|
|
67
|
-
*
|
|
68
|
-
* return <TextInput aria-label="Example aria-label" name="Example name" onChange={setValue} value={value} />;
|
|
69
|
-
* }
|
|
70
|
-
*
|
|
71
|
-
* @element
|
|
72
|
-
*
|
|
73
|
-
* @name TextInput
|
|
74
|
-
* @phase Utility
|
|
75
|
-
*/
|
|
76
|
-
export declare function TextInput({ invalid: invalidProp, onChange, size, value, name, 'aria-label': ariaLabel, inputRef, required, placeholder, id: idProp, leading, trailing, type, readOnly, disabled, autoComplete, containerRef, showClearButton: showClearButtonProp, owner, 'aria-describedby': ariaDescribedBy, 'aria-errormessage': ariaErrorMessage, inputProps, ...props }: ElementProps<TextInputProps, 'div'>): import("react/jsx-runtime").JSX.Element;
|
|
77
|
-
export {};
|
|
78
|
-
/** Copyright 2025 Anywhere Real Estate - CC BY 4.0 */
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TextInput.js","sourceRoot":"","sources":["../../../src/components/TextInput/TextInput.tsx"],"names":[],"mappings":";AAAA,OAAO,mBAAmB,CAAC;AAC3B,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAkD,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAClG,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACtC,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAGhD,MAAM,CAAC,MAAM,OAAO,GAAG;IACnB,IAAI,EAAE,QAAQ;IACd,KAAK,EAAE,EAAE;IACT,IAAI,EAAE,MAA4D;IAClE,YAAY,EAAE,KAAK;CACb,CAAC;AAuDX;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,UAAU,SAAS,CAAC,EACtB,OAAO,EAAE,WAAW,EACpB,QAAQ,EACR,IAAI,GAAG,OAAO,CAAC,IAAI,EACnB,KAAK,GAAG,OAAO,CAAC,KAAK,EACrB,IAAI,EACJ,YAAY,EAAE,SAAS,EACvB,QAAQ,EACR,QAAQ,EACR,WAAW,EACX,EAAE,EAAE,MAAM,EACV,OAAO,EACP,QAAQ,EACR,IAAI,GAAG,OAAO,CAAC,IAAI,EACnB,QAAQ,EACR,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,OAAO,EAAE,KAAK,EAAE,CAAC;gBACtC,CAAC,EACD,OAAO,EAAE,GAAG,EAAE;oBACV,YAAY,CAAC,KAAK,EAAE,CAAC;gBACzB,CAAC,EACD,IAAI,EAAE,IAAI,EACV,OAAO,EAAC,UAAU,GACpB,CACL,IACC,CACT,CAAC;AACN,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TextInputExample.js","sourceRoot":"","sources":["../../../src/components/TextInput/TextInputExample.tsx"],"names":[],"mappings":";AAGA,MAAM,CAAC,MAAM,gBAAgB,GAAqC;IAC9D,MAAM,EAAE,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,EAAE,EAAE,CAAC,KAAC,SAAS,OAAK,KAAK,GAAI;IAC1D,OAAO,EAAE;QACL;YACI,KAAK,EAAE,UAAU;YACjB,SAAS,EAAE;gBACP,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,GAAG;gBACZ,QAAQ,EAAE,SAAS;gBACnB,WAAW,EAAE,UAAU;gBACvB,IAAI,EAAE,UAAU;gBAChB,YAAY,EAAE,gBAAgB;aACjC;SACJ;QACD;YACI,KAAK,EAAE,SAAS;YAChB,SAAS,EAAE;gBACP,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,SAAS;gBAClB,QAAQ,EAAE,GAAG;gBACb,WAAW,EAAE,SAAS;gBACtB,IAAI,EAAE,SAAS;gBACf,YAAY,EAAE,eAAe;aAChC;SACJ;QACD;YACI,KAAK,EAAE,WAAW;YAClB,SAAS,EAAE;gBACP,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,SAAS;gBAClB,WAAW,EAAE,YAAY;gBACzB,QAAQ,EAAE,IAAI;gBACd,IAAI,EAAE,WAAW;gBACjB,YAAY,EAAE,iBAAiB;aAClC;SACJ;KACJ;IACD,QAAQ,EAAE;QACN,IAAI,EAAE,KAAK;KACd;CACJ,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './TextInput';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/TextInput/index.tsx"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
export const TextareaFieldExample = {
|
|
3
|
-
render: ({ Component, props }) => {
|
|
4
|
-
const tooManyCharacters = Boolean(props.value && props.maxLength && props.value?.length > props.maxLength);
|
|
5
|
-
const invalid = props.invalid || tooManyCharacters;
|
|
6
|
-
const errorMessage = tooManyCharacters ? 'Too Many characters' : props.errorMessage || '';
|
|
7
|
-
return _jsx(Component, { ...props, errorMessage: errorMessage, invalid: invalid });
|
|
8
|
-
},
|
|
9
|
-
};
|
|
10
|
-
//# sourceMappingURL=TextareaFieldExample.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TextareaFieldExample.js","sourceRoot":"","sources":["../../../src/components/TextareaField/TextareaFieldExample.tsx"],"names":[],"mappings":";AAGA,MAAM,CAAC,MAAM,oBAAoB,GAAyC;IACtE,MAAM,EAAE,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,EAAE,EAAE;QAC7B,MAAM,iBAAiB,GAAG,OAAO,CAAC,KAAK,CAAC,KAAK,IAAI,KAAK,CAAC,SAAS,IAAI,KAAK,CAAC,KAAK,EAAE,MAAM,GAAG,KAAK,CAAC,SAAS,CAAC,CAAC;QAE3G,MAAM,OAAO,GAAG,KAAK,CAAC,OAAO,IAAI,iBAAiB,CAAC;QACnD,MAAM,YAAY,GAAG,iBAAiB,CAAC,CAAC,CAAC,qBAAqB,CAAC,CAAC,CAAC,KAAK,CAAC,YAAY,IAAI,EAAE,CAAC;QAE1F,OAAO,KAAC,SAAS,OAAK,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,OAAO,EAAE,OAAO,GAAI,CAAC;IAClF,CAAC;CACJ,CAAC"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { TimeInputType } from './Segment';
|
|
2
|
-
type Option = {
|
|
3
|
-
id: string;
|
|
4
|
-
value: string;
|
|
5
|
-
label: string;
|
|
6
|
-
};
|
|
7
|
-
type TimeInputListboxProps = {
|
|
8
|
-
options: Option[];
|
|
9
|
-
selectedValue?: string;
|
|
10
|
-
type: TimeInputType;
|
|
11
|
-
onSelect?: (value: string) => void;
|
|
12
|
-
onTab?: (e: React.KeyboardEvent) => void;
|
|
13
|
-
};
|
|
14
|
-
export declare function TimeInputListbox({ options, selectedValue, type: kind, onSelect, onTab }: TimeInputListboxProps): import("react/jsx-runtime").JSX.Element;
|
|
15
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Listbox.js","sourceRoot":"","sources":["../../../src/components/TimeInput/Listbox.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAgBtD,MAAM,UAAU,gBAAgB,CAAC,EAAE,OAAO,EAAE,aAAa,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAyB;IAC3G,MAAM,EAAE,eAAe,EAAE,iBAAiB,EAAE,GAAG,kBAAkB,CAAC;QAC9D,GAAG,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,EAAE,CAAC;QACvC,eAAe,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,KAAK,KAAK,aAAa,CAAC,IAAI,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,IAAI,IAAI;KACxG,CAAC,CAAC;IAEH,MAAM,eAAe,GAAG,GAAG,EAAE;QACzB,IAAI,eAAe;YAAE,cAAc,C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
|
-
};
|
|
9
|
-
export declare const NUMBER_PLACEHOLDER: "--";
|
|
10
|
-
export type TimeInputType = 'hours' | 'meridiem' | 'minutes';
|
|
11
|
-
type TimeInputSegmentProps<T extends string> = {
|
|
12
|
-
disabled?: boolean;
|
|
13
|
-
name: string;
|
|
14
|
-
readOnly?: boolean;
|
|
15
|
-
value?: T;
|
|
16
|
-
type: TimeInputType;
|
|
17
|
-
onChange: (value: T | null) => void;
|
|
18
|
-
};
|
|
19
|
-
export declare function TimeInputSegment<T extends string>({ disabled, name, readOnly, value: valueProp, type: kind, onChange, }: TimeInputSegmentProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
20
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Segment.js","sourceRoot":"","sources":["../../../src/components/TimeInput/Segment.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACvD,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACtC,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAEtD,MAAM,CAAC,MAAM,aAAa,GAAG,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,EAAE,EAAW,CAAC;AAC1D,MAAM,CAAC,MAAM,WAAW,GAAG,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,EAAE,EAAW,CAAC;AAExD,MAAM,CAAC,MAAM,kBAAkB,GAAG,IAAa,CAAC;AAahD,MAAM,UAAU,gBAAgB,CAAmB,EAC/C,QAAQ,EACR,IAAI,EACJ,QAAQ,EACR,KAAK,EAAE,SAAS,EAChB,IAAI,EAAE,IAAI,EACV,QAAQ,GACe;IACvB,MAAM,GAAG,GAAG,MAAM,CAAqB,IAAI,CAAC,CAAC;IAE7C,MAAM,SAAS,GAAG,CAAC,UAA8B,GAAG,CAAC,OAAO,EAAE,EAAE;QAC5D,IAAI,CAAC,OAAO;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C;IACzC,CAAC;IACD,OAAO,IAAI,CAAC;AAChB,CAAC;AAED,SAAS,kBAAkB,CAAC,IAAwB,EAAE,QAAgB;IAClE,mCAAmC;IACnC,IAAI,OAAO,GAAG,IAAI,EAAE,sBAAsB,CAAC;IAC3C,8CAA8C;IAC9C,6DAA6D;IAC7D,OAAO,OAAO,EAAE,CAAC;QACb,IAAI,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC;YAAE,OAAO,OAA6B,CAAC;QACpE,OAAO,GAAG,OAAO,CAAC,sBAAsB,CAAC;IAC7C,CAAC;IACD,OAAO,IAAI,CAAC;AAChB,CAAC"}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import './time-input.scss';
|
|
2
|
-
import { TextInputProps } from '-/components/TextInput';
|
|
3
|
-
export declare const MINUTE_OPTIONS: string[];
|
|
4
|
-
export declare const HOUR_OPTIONS: string[];
|
|
5
|
-
export declare const MERIDIEM_OPTIONS: string[];
|
|
6
|
-
export type TimeInputProps = Pick<TextInputProps, 'aria-describedby' | 'aria-errormessage' | 'aria-label' | 'disabled' | 'id' | 'invalid' | 'name' | 'readOnly' | 'size'> & {
|
|
7
|
-
value?: string;
|
|
8
|
-
};
|
|
9
|
-
/**
|
|
10
|
-
* An input field that allows a customer to manually type in a specific time or triggers a time picker combobox to
|
|
11
|
-
* select a date.
|
|
12
|
-
*
|
|
13
|
-
* @example
|
|
14
|
-
* import { TimeInput } from '@bspk/ui/TimeInput';
|
|
15
|
-
*
|
|
16
|
-
* function Example() {
|
|
17
|
-
* return <TimeInput>Example TimeInput</TimeInput>;
|
|
18
|
-
* }
|
|
19
|
-
*
|
|
20
|
-
* @name TimeInput
|
|
21
|
-
* @phase UXReview
|
|
22
|
-
*/
|
|
23
|
-
export declare function TimeInput({ value, 'aria-label': ariaLabel, disabled, id: idProp, invalid, readOnly, name, size, 'aria-describedby': ariaDescribedBy, 'aria-errormessage': ariaErrorMessage, }: TimeInputProps): import("react/jsx-runtime").JSX.Element;
|
|
24
|
-
/** Copyright 2025 Anywhere Real Estate - CC BY 4.0 */
|
|
@@ -1,115 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import './time-input.css.js';
|
|
3
|
-
import { SvgSchedule } from '@bspk/icons/Schedule';
|
|
4
|
-
import { FocusTrap } from 'focus-trap-react';
|
|
5
|
-
import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
6
|
-
import { TimeInputListbox } from './Listbox';
|
|
7
|
-
import { TimeInputSegment } from './Segment';
|
|
8
|
-
import { Button } from '../Button';
|
|
9
|
-
import { Menu } from '../Menu';
|
|
10
|
-
import { Portal } from '../Portal';
|
|
11
|
-
import { useFloating } from '../../hooks/useFloating';
|
|
12
|
-
import { useId } from '../../hooks/useId';
|
|
13
|
-
import { useOutsideClick } from '../../hooks/useOutsideClick';
|
|
14
|
-
import { handleKeyDown } from '../../utils/handleKeyDown';
|
|
15
|
-
export const MINUTE_OPTIONS = ['00', '05', '10', '15', '20', '25', '30', '35', '40', '45', '50', '55'];
|
|
16
|
-
export const HOUR_OPTIONS = ['01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12'];
|
|
17
|
-
export const MERIDIEM_OPTIONS = ['AM', 'PM'];
|
|
18
|
-
/**
|
|
19
|
-
* An input field that allows a customer to manually type in a specific time or triggers a time picker combobox to
|
|
20
|
-
* select a date.
|
|
21
|
-
*
|
|
22
|
-
* @example
|
|
23
|
-
* import { TimeInput } from '@bspk/ui/TimeInput';
|
|
24
|
-
*
|
|
25
|
-
* function Example() {
|
|
26
|
-
* return <TimeInput>Example TimeInput</TimeInput>;
|
|
27
|
-
* }
|
|
28
|
-
*
|
|
29
|
-
* @name TimeInput
|
|
30
|
-
* @phase UXReview
|
|
31
|
-
*/
|
|
32
|
-
export function TimeInput({ value, 'aria-label': ariaLabel, disabled, id: idProp, invalid, readOnly, name, size, 'aria-describedby': ariaDescribedBy, 'aria-errormessage': ariaErrorMessage, }) {
|
|
33
|
-
const id = useId(idProp);
|
|
34
|
-
const [inputValue, setInputValue] = useState(value);
|
|
35
|
-
const [hours, setHours] = useState();
|
|
36
|
-
const [minutes, setMinutes] = useState();
|
|
37
|
-
const [meridiem, setMeridiem] = useState('AM');
|
|
38
|
-
useEffect(() => {
|
|
39
|
-
setInputValue(`${hours?.toString().padStart(2, '0')}:${minutes?.toString().padStart(2, '0')} ${meridiem || ''}`.trim());
|
|
40
|
-
if (hours !== undefined && minutes === undefined)
|
|
41
|
-
setMinutes('00');
|
|
42
|
-
}, [hours, minutes, meridiem]);
|
|
43
|
-
const [open, setOpenState] = useState(false);
|
|
44
|
-
const { floatingStyles, elements } = useFloating({
|
|
45
|
-
strategy: 'fixed',
|
|
46
|
-
refWidth: true,
|
|
47
|
-
offsetOptions: 4,
|
|
48
|
-
hide: !open,
|
|
49
|
-
});
|
|
50
|
-
const setOpen = useCallback((nextOpen) => {
|
|
51
|
-
setOpenState(nextOpen);
|
|
52
|
-
if (!elements.reference || !buttonRef.current)
|
|
53
|
-
return;
|
|
54
|
-
// Focus the button when closing the menu
|
|
55
|
-
if (!nextOpen && open)
|
|
56
|
-
buttonRef.current.focus();
|
|
57
|
-
// Focus the hours listbox when opening the menu
|
|
58
|
-
if (nextOpen && !open)
|
|
59
|
-
elements.reference.querySelector('[data-scroll-column="hours"]')?.focus();
|
|
60
|
-
}, [elements?.reference, open]);
|
|
61
|
-
useOutsideClick({ elements: [elements.floating], callback: () => setOpen(false), disabled: !open });
|
|
62
|
-
const { hourOptions, minuteOptions, meridiemOptions } = useMemo(() => ({
|
|
63
|
-
hourOptions: HOUR_OPTIONS.map((h) => ({
|
|
64
|
-
id: `${id}-hours-${h}`,
|
|
65
|
-
value: h,
|
|
66
|
-
label: h.toString().padStart(2, '0'),
|
|
67
|
-
})),
|
|
68
|
-
minuteOptions: MINUTE_OPTIONS.map((m) => ({
|
|
69
|
-
id: `${id}-minutes-${m}`,
|
|
70
|
-
value: m,
|
|
71
|
-
label: m.toString().padStart(2, '0'),
|
|
72
|
-
})),
|
|
73
|
-
meridiemOptions: MERIDIEM_OPTIONS.map((m) => ({
|
|
74
|
-
id: `${id}-meridiem-${m}`,
|
|
75
|
-
value: m,
|
|
76
|
-
label: m,
|
|
77
|
-
})),
|
|
78
|
-
}), [id]);
|
|
79
|
-
const listBoxRefs = useRef(null);
|
|
80
|
-
const buttonRef = useRef(null);
|
|
81
|
-
return (_jsxs(_Fragment, { children: [_jsxs("div", { "aria-describedby": ariaErrorMessage || ariaDescribedBy || undefined, "data-aria-label": ariaLabel || undefined, "data-bspk": "time-input", "data-disabled": disabled || undefined, "data-invalid": invalid || undefined, "data-name": name || undefined, "data-open": open || undefined, "data-readonly": readOnly || undefined, "data-size": size || undefined, "data-value": inputValue || undefined, id: id, onClickCapture: () => {
|
|
82
|
-
if (disabled || readOnly)
|
|
83
|
-
return;
|
|
84
|
-
elements.reference?.querySelector('[tabIndex]')?.focus();
|
|
85
|
-
}, onKeyDownCapture: handleKeyDown({ Escape: () => setOpen(false) }), ref: (node) => {
|
|
86
|
-
elements.setReference(node);
|
|
87
|
-
}, role: "group", tabIndex: disabled || readOnly ? -1 : 0, children: [_jsx(TimeInputSegment, { disabled: disabled, name: `${name}-hours`, onChange: (next) => setHours(next || undefined), readOnly: readOnly, type: "hours", value: hours }), _jsx("span", { "aria-hidden": "true", children: ":" }), _jsx(TimeInputSegment, { disabled: disabled, name: `${name}-minutes`, onChange: (next) => setMinutes(next || undefined), readOnly: readOnly, type: "minutes", value: minutes }), _jsx(TimeInputSegment, { disabled: disabled, name: `${name}-meridiem`, onChange: (next) => setMeridiem(next || 'AM'), readOnly: readOnly, type: "meridiem", value: meridiem }), _jsx(Button, { disabled: disabled || readOnly, icon: _jsx(SvgSchedule, {}), iconOnly: true, innerRef: (node) => {
|
|
88
|
-
buttonRef.current = node;
|
|
89
|
-
}, label: `${open ? 'Close' : 'Open'} Time Picker`, onClick: () => setOpen(!open), variant: "tertiary" })] }), !!open && (_jsx(Portal, { children: _jsx(Menu, { innerRef: (node) => {
|
|
90
|
-
if (!node)
|
|
91
|
-
return;
|
|
92
|
-
elements.setFloating(node);
|
|
93
|
-
}, label: "Select time", owner: "time-input", style: floatingStyles, children: _jsx(FocusTrap, { focusTrapOptions: {
|
|
94
|
-
fallbackFocus: () => listBoxRefs.current.hours,
|
|
95
|
-
clickOutsideDeactivates: true,
|
|
96
|
-
}, children: _jsxs("div", { "data-scroll-values": true, ref: (node) => {
|
|
97
|
-
listBoxRefs.current = {
|
|
98
|
-
hours: node?.querySelector('[data-scroll-column="hours"]'),
|
|
99
|
-
minutes: node?.querySelector('[data-scroll-column="minutes"]'),
|
|
100
|
-
meridiem: node?.querySelector('[data-scroll-column="meridiem"]'),
|
|
101
|
-
};
|
|
102
|
-
listBoxRefs.current.hours?.focus();
|
|
103
|
-
}, children: [_jsx(TimeInputListbox, { onSelect: (next) => {
|
|
104
|
-
setHours(next);
|
|
105
|
-
setTimeout(() => listBoxRefs.current?.minutes?.focus(), 10);
|
|
106
|
-
}, options: hourOptions, selectedValue: hours, type: "hours" }), _jsx(TimeInputListbox, { onSelect: (next) => {
|
|
107
|
-
setMinutes(next);
|
|
108
|
-
setTimeout(() => listBoxRefs.current?.meridiem?.focus(), 10);
|
|
109
|
-
}, options: minuteOptions, selectedValue: minutes, type: "minutes" }), _jsx(TimeInputListbox, { onSelect: (next) => {
|
|
110
|
-
setMeridiem(next);
|
|
111
|
-
setOpen(false);
|
|
112
|
-
setTimeout(() => buttonRef.current?.focus(), 10);
|
|
113
|
-
}, options: meridiemOptions, selectedValue: meridiem, type: "meridiem" })] }) }) }) }))] }));
|
|
114
|
-
}
|
|
115
|
-
//# sourceMappingURL=TimeInput.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TimeInput.js","sourceRoot":"","sources":["../../../src/components/TimeInput/TimeInput.tsx"],"names":[],"mappings":";AAAA,OAAO,mBAAmB,CAAC;AAC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AE;wCACf,WAAW,CAAC,IAAgB,CAAC,CAAC;wCAC9B,OAAO,CAAC,KAAK,CAAC,CAAC;wCACf,UAAU,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,OAAO,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,CAAC;oCACrD,CAAC,EACD,OAAO,EAAE,eAAe,EACxB,aAAa,EAAE,QAAQ,EACvB,IAAI,EAAC,UAAU,GACjB,IACA,GACE,GACT,GACF,CACZ,IACF,CACN,CAAC;AACN,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TimeInputExample.js","sourceRoot":"","sources":["../../../src/components/TimeInput/TimeInputExample.tsx"],"names":[],"mappings":"AAGA,MAAM,CAAC,MAAM,gBAAgB,GAAqC;IAC9D,QAAQ,EAAE,KAAK;CAClB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './TimeInput';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/TimeInput/index.tsx"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const useSnackbarContext: () => import("-/utils/snackbarContext").SnackbarContextProps;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/* eslint-disable no-console */
|
|
2
|
-
import { useContext } from 'react';
|
|
3
|
-
import { SnackbarContext } from '../utils/snackbarContext';
|
|
4
|
-
export const useSnackbarContext = () => {
|
|
5
|
-
const context = useContext(SnackbarContext);
|
|
6
|
-
if (!context) {
|
|
7
|
-
console.error('useSnackbarContext must be used within a SnackbarProvider!');
|
|
8
|
-
}
|
|
9
|
-
return (context ?? {
|
|
10
|
-
snackbars: [],
|
|
11
|
-
sendSnackbar: () => console.error('sendSnackbar must be used within a SnackbarProvider!'),
|
|
12
|
-
clearSnackbar: () => console.error('clearSnackbar must be used within a SnackbarProvider!'),
|
|
13
|
-
clearAll: () => console.error('clearAll must be used within a SnackbarProvider!'),
|
|
14
|
-
});
|
|
15
|
-
};
|
|
16
|
-
//# sourceMappingURL=useSnackbarContext.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useSnackbarContext.js","sourceRoot":"","sources":["../../src/hooks/useSnackbarContext.ts"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AACnC,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE1D,MAAM,CAAC,MAAM,kBAAkB,GAAG,GAAG,EAAE;IACnC,MAAM,OAAO,GAAG,UAAU,CAAC,eAAe,CAAC,CAAC;IAC5C,IAAI,CAAC,OAAO,EAAE,CAAC;QACX,OAAO,CAAC,KAAK,CAAC,4DAA4D,CAAC,CAAC;IAChF,CAAC;IACD,OAAO,CACH,OAAO,IAAI;QACP,SAAS,EAAE,EAAE;QACb,YAAY,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,sDAAsD,CAAC;QACzF,aAAa,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,uDAAuD,CAAC;QAC3F,QAAQ,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,kDAAkD,CAAC;KACpF,CACJ,CAAC;AACN,CAAC,CAAC"}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
export interface SnackbarData {
|
|
2
|
-
/** Automatically set unique identifier. */
|
|
3
|
-
id: string;
|
|
4
|
-
/** The main body text of the snackbar */
|
|
5
|
-
text: string;
|
|
6
|
-
/**
|
|
7
|
-
* The variant of the snackbar.
|
|
8
|
-
*
|
|
9
|
-
* @default 'default'
|
|
10
|
-
*/
|
|
11
|
-
variant?: 'default' | 'error' | 'success' | 'warning';
|
|
12
|
-
/** Time in milliseconds after which the snackbar will auto dismiss. You can also set a default at the UIProvider */
|
|
13
|
-
timeout?: number | null;
|
|
14
|
-
/** Optional action button */
|
|
15
|
-
button?: {
|
|
16
|
-
/**
|
|
17
|
-
* The button text
|
|
18
|
-
*
|
|
19
|
-
* @default 'dismiss'
|
|
20
|
-
*/
|
|
21
|
-
label: string;
|
|
22
|
-
/**
|
|
23
|
-
* Either 'close' or a callback function that is called when the button is clicked. If 'close' is provided the
|
|
24
|
-
* snackbar will close when the button is clicked.
|
|
25
|
-
*
|
|
26
|
-
* @default 'close'
|
|
27
|
-
*/
|
|
28
|
-
onClick: 'close' | (() => void);
|
|
29
|
-
};
|
|
30
|
-
}
|
|
31
|
-
export type SnackbarInput = Omit<SnackbarData, 'id'>;
|
|
32
|
-
export type SnackbarContextProps = {
|
|
33
|
-
snackbars: SnackbarData[];
|
|
34
|
-
sendSnackbar: (data: Omit<SnackbarData, 'id'>) => void;
|
|
35
|
-
clearSnackbar: (id: SnackbarData['id']) => void;
|
|
36
|
-
clearAll: () => void;
|
|
37
|
-
};
|
|
38
|
-
export declare const SnackbarContext: import("react").Context<SnackbarContextProps | undefined>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"snackbarContext.js","sourceRoot":"","sources":["../../src/utils/snackbarContext.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AA0CtC,MAAM,CAAC,MAAM,eAAe,GAAG,aAAa,CAAmC,SAAS,CAAC,CAAC"}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { isValid } from 'date-fns';
|
|
2
|
-
import { CalendarPickerProps } from '.';
|
|
3
|
-
import { ComponentExampleFn } from '-/utils/demo';
|
|
4
|
-
|
|
5
|
-
export const CalendarPickerExample: ComponentExampleFn<CalendarPickerProps> = ({ action }) => ({
|
|
6
|
-
defaultState: {
|
|
7
|
-
value: new Date(),
|
|
8
|
-
},
|
|
9
|
-
containerStyle: { width: '100%' },
|
|
10
|
-
render: ({ props, Component }) => {
|
|
11
|
-
const value = isValid(props.value) ? props.value : new Date();
|
|
12
|
-
return (
|
|
13
|
-
<Component
|
|
14
|
-
{...props}
|
|
15
|
-
onChange={(next) => {
|
|
16
|
-
props.onChange?.(next);
|
|
17
|
-
action(`value updated to ${next.toDateString()}`);
|
|
18
|
-
}}
|
|
19
|
-
value={value}
|
|
20
|
-
/>
|
|
21
|
-
);
|
|
22
|
-
},
|
|
23
|
-
variants: false,
|
|
24
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './CalendarPicker';
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { ChipAssist } from './ChipAssist';
|
|
2
|
-
import { presets } from './ChipAssistExample';
|
|
3
|
-
import { hasNoBasicA11yIssues } from '-/rtl/hasNoBasicA11yIssues';
|
|
4
|
-
import { render } from '-/rtl/util';
|
|
5
|
-
|
|
6
|
-
describe('ChipAssist (RTL)', () => {
|
|
7
|
-
presets.forEach((preset) => {
|
|
8
|
-
it(`has no basic a11y issues - ${preset.label}`, hasNoBasicA11yIssues(<ChipAssist {...preset.propState} />));
|
|
9
|
-
});
|
|
10
|
-
|
|
11
|
-
it('renders', () => {
|
|
12
|
-
const { getByText } = render(<ChipAssist {...presets[0].propState} />);
|
|
13
|
-
|
|
14
|
-
expect(getByText('chip option')).toBeInTheDocument();
|
|
15
|
-
});
|
|
16
|
-
});
|