@bspk/ui 1.3.3 → 1.3.5
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/Avatar/Avatar.d.ts +3 -3
- package/dist/components/Avatar/Avatar.js +8 -8
- package/dist/components/Avatar/Avatar.js.map +1 -1
- package/dist/components/Avatar/AvatarExample.js +1 -1
- package/dist/components/Avatar/AvatarExample.js.map +1 -1
- package/dist/components/Avatar/avatar.css +5 -1
- package/dist/components/Avatar/avatar.css.js +5 -1
- package/dist/components/AvatarGroup/AvatarGroup.d.ts +12 -7
- package/dist/components/AvatarGroup/AvatarGroup.js +6 -7
- package/dist/components/AvatarGroup/AvatarGroup.js.map +1 -1
- package/dist/components/AvatarGroup/AvatarGroupExample.js +36 -9
- package/dist/components/AvatarGroup/AvatarGroupExample.js.map +1 -1
- package/dist/components/AvatarGroup/Overflow.d.ts +11 -0
- package/dist/components/AvatarGroup/Overflow.js +37 -0
- package/dist/components/AvatarGroup/Overflow.js.map +1 -0
- package/dist/components/AvatarGroup/avatar-group.css +27 -13
- package/dist/components/AvatarGroup/avatar-group.css.js +27 -13
- package/dist/components/Badge/BadgeExample.js +1 -1
- package/dist/components/Badge/BadgeExample.js.map +1 -1
- package/dist/components/BadgeDot/BadgeDotExample.js +1 -1
- package/dist/components/BadgeDot/BadgeDotExample.js.map +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 +7 -3
- 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/Card/Card.d.ts +2 -1
- package/dist/components/Card/Card.js +2 -2
- package/dist/components/Card/Card.js.map +1 -1
- 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 +10 -29
- package/dist/components/CheckboxGroup/CheckboxGroup.js +19 -9
- 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/CheckboxOption/CheckboxOption.d.ts +3 -2
- package/dist/components/CheckboxOption/CheckboxOption.js +2 -2
- package/dist/components/CheckboxOption/CheckboxOption.js.map +1 -1
- 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 +3 -3
- package/dist/components/Fab/Fab.js +1 -1
- package/dist/components/Fab/Fab.js.map +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 +33 -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 +3 -3
- package/dist/components/Layout/Layout.js +1 -1
- package/dist/components/Layout/Layout.js.map +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 +20 -11
- 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 +9 -2
- package/dist/components/Menu/Menu.js +2 -2
- package/dist/components/Menu/Menu.js.map +1 -1
- package/dist/components/Menu/MenuExample.js +2 -2
- package/dist/components/Menu/MenuExample.js.map +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/ProgressCircle/progress-circle.css +2 -0
- package/dist/components/ProgressCircle/progress-circle.css.js +2 -0
- 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 +7 -7
- 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 +47 -35
- package/dist/components/Select/Select.js +52 -23
- package/dist/components/Select/Select.js.map +1 -1
- package/dist/components/Select/SelectExample.js +36 -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/SkeletonText/SkeletonText.js +1 -1
- package/dist/components/SkeletonText/SkeletonText.js.map +1 -1
- package/dist/components/Slider/slider.css +1 -0
- package/dist/components/Slider/slider.css.js +1 -0
- 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 -32
- 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 +139 -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.d.ts +3 -3
- package/dist/components/ToggleOption/ToggleOption.js +4 -3
- 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/Truncated/Truncated.d.ts +2 -2
- package/dist/components/Truncated/Truncated.js.map +1 -1
- package/dist/components/Txt/Txt.d.ts +3 -3
- package/dist/components/Txt/Txt.js +1 -1
- package/dist/components/Txt/Txt.js.map +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/useArrowNavigation.d.ts +0 -2
- package/dist/hooks/useArrowNavigation.js +0 -2
- package/dist/hooks/useArrowNavigation.js.map +1 -1
- package/dist/hooks/useCheckboxGroupState.d.ts +8 -11
- package/dist/hooks/useCheckboxGroupState.js +8 -11
- package/dist/hooks/useCheckboxGroupState.js.map +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/useFloating.js +8 -7
- package/dist/hooks/useFloating.js.map +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 +7 -0
- package/dist/styles/base.css.js +7 -0
- package/dist/types/common.d.ts +29 -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 +5 -4
- package/package.json +37 -39
- package/src/components/Avatar/Avatar.tsx +10 -11
- package/src/components/Avatar/AvatarExample.tsx +1 -1
- package/src/components/Avatar/avatar.scss +6 -1
- package/src/components/AvatarGroup/AvatarGroup.tsx +21 -25
- package/src/components/AvatarGroup/AvatarGroupExample.tsx +35 -9
- package/src/components/AvatarGroup/Overflow.tsx +91 -0
- package/src/components/AvatarGroup/avatar-group.scss +34 -14
- package/src/components/Badge/BadgeExample.tsx +1 -1
- package/src/components/BadgeDot/BadgeDotExample.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 +9 -3
- 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/Card/Card.tsx +3 -2
- package/src/components/Checkbox/Checkbox.tsx +28 -26
- package/src/components/CheckboxGroup/CheckboxGroup.tsx +77 -81
- 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 +37 -0
- package/src/components/CheckboxGroupField/index.tsx +1 -0
- package/src/components/CheckboxOption/CheckboxOption.tsx +4 -1
- 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 +37 -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 +3 -3
- 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 +49 -61
- 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/{MenuButton/MenuButton.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 +37 -0
- package/src/components/InputField/index.tsx +1 -0
- package/src/components/{NumberInput/NumberInput.rtl.test.tsx → InputNumber/InputNumber.rtl.test.tsx} +3 -3
- 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 +37 -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 +37 -0
- package/src/components/InputPhoneField/index.tsx +1 -0
- package/src/components/Layout/Layout.tsx +3 -3
- package/src/components/Link/Link.tsx +1 -1
- package/src/components/ListItem/ListItem.tsx +32 -14
- package/src/components/ListItem/ListItemExample.tsx +3 -3
- package/src/components/ListItem/list-item.scss +6 -1
- package/src/components/Menu/Menu.tsx +10 -2
- package/src/components/Menu/MenuExample.tsx +2 -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 +13 -43
- 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/ProgressCircle/progress-circle.scss +2 -0
- 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 +63 -85
- 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 +37 -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 +10 -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 +68 -57
- package/src/components/Select/SelectExample.tsx +36 -14
- package/src/components/SelectField/SelectField.rtl.test.tsx +9 -6
- package/src/components/SelectField/SelectField.tsx +10 -44
- package/src/components/Skeleton/SkeletonExample.tsx +1 -3
- package/src/components/SkeletonText/SkeletonText.tsx +1 -1
- package/src/components/Slider/slider.scss +1 -0
- 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 +40 -41
- package/src/components/Textarea/textarea.scss +41 -19
- package/src/components/TextareaField/TextareaField.rtl.test.tsx +4 -11
- package/src/components/TextareaField/TextareaField.tsx +13 -65
- 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} +117 -70
- 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 +37 -0
- package/src/components/TimePickerField/index.tsx +1 -0
- package/src/components/ToggleOption/ToggleOption.tsx +29 -23
- package/src/components/Tooltip/Tooltip.tsx +1 -1
- package/src/components/Tooltip/TooltipExample.tsx +7 -9
- package/src/components/Truncated/Truncated.tsx +2 -2
- package/src/components/Txt/Txt.tsx +3 -3
- package/src/constants/brands.ts +5 -1
- package/src/hooks/useArrowNavigation.ts +0 -2
- package/src/hooks/useCheckboxGroupState.ts +8 -11
- package/src/hooks/useCheckboxState.ts +1 -1
- package/src/hooks/useContainerWidth.tsx +1 -1
- package/src/hooks/useFloating.ts +8 -7
- 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 +7 -0
- package/src/types/common.ts +39 -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/MenuButton/MenuButton.d.ts +0 -19
- package/dist/components/MenuButton/MenuButton.js +0 -20
- package/dist/components/MenuButton/MenuButton.js.map +0 -1
- package/dist/components/MenuButton/index.d.ts +0 -1
- package/dist/components/MenuButton/index.js +0 -2
- package/dist/components/MenuButton/index.js.map +0 -1
- package/dist/components/MenuButton/menu-button.css +0 -16
- package/dist/components/MenuButton/menu-button.css.js +0 -21
- 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/MenuButton/MenuButton.tsx +0 -29
- package/src/components/MenuButton/index.tsx +0 -1
- package/src/components/MenuButton/menu-button.scss +0 -16
- 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.rtl.test.tsx +0 -24
- 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
|
@@ -10,7 +10,7 @@ import { Tooltip } from '../Tooltip';
|
|
|
10
10
|
* import { SvgBolt } from '@bspk/icons/Bolt';
|
|
11
11
|
* import { Fab } from '@bspk/ui/Fab';
|
|
12
12
|
*
|
|
13
|
-
*
|
|
13
|
+
* function Example() {
|
|
14
14
|
* return <Fab icon={<SvgBolt />} label="Example label" placement="bottom-right" variant="neutral" />;
|
|
15
15
|
* }
|
|
16
16
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Fab.js","sourceRoot":"","sources":["../../../src/components/Fab/Fab.tsx"],"names":[],"mappings":";AAAA,OAAO,YAAY,CAAC;AACpB,OAAO,EAA+B,cAAc,EAAE,MAAM,OAAO,CAAC;AAEpE,OAAO,EAAE,OAAO,EAAuB,MAAM,sBAAsB,CAAC;AAoCpE;;;;;;;;;;;;;;GAcG;AACH,MAAM,UAAU,GAAG,
|
|
1
|
+
{"version":3,"file":"Fab.js","sourceRoot":"","sources":["../../../src/components/Fab/Fab.tsx"],"names":[],"mappings":";AAAA,OAAO,YAAY,CAAC;AACpB,OAAO,EAA+B,cAAc,EAAE,MAAM,OAAO,CAAC;AAEpE,OAAO,EAAE,OAAO,EAAuB,MAAM,sBAAsB,CAAC;AAoCpE;;;;;;;;;;;;;;GAcG;AACH,MAAM,UAAU,GAAG,CAAuC,KAAsD;IAC5G,MAAM,EACF,IAAI,GAAG,OAAO,EACd,OAAO,GAAG,SAAS,EACnB,QAAQ,EAAE,YAAY,GAAG,KAAK,EAC9B,EAAE,EAAE,EAAE,GAAG,QAAQ,EACjB,SAAS,GAAG,cAAc,EAC1B,SAAS,GAAG,OAAO,EACnB,KAAK,EACL,IAAI,EACJ,OAAO,EACP,GAAG,UAAU,EAChB,GAAG,KAAK,CAAC;IAEV,2CAA2C;IAC3C,MAAM,QAAQ,GAAG,YAAY,KAAK,IAAI,IAAI,CAAC,CAAC,IAAI,CAAC;IAEjD,MAAM,MAAM,GAAG,CAAC,YAAiC,EAAE,EAAE,CAAC,CAClD,MAAC,EAAE,OACK,UAAU,KACV,YAAY,gBACJ,KAAK,eACP,KAAK,oBACC,SAAS,oBACT,SAAS,gBACb,QAAQ,IAAI,SAAS,eACtB,IAAI,kBACD,OAAO,EACrB,MAAM,EAAE,CAAC,CAAC,EAAE,EAAE;YACV,YAAY,CAAC,MAAM,EAAE,EAAE,CAAC;YACxB,UAAU,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,CAAC;QAC3B,CAAC,EACD,OAAO,EAAE,CAAC,CAAC,EAAE,EAAE;YACX,YAAY,CAAC,OAAO,EAAE,EAAE,CAAC;YACzB,UAAU,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC;QAC5B,CAAC,EACD,YAAY,EAAE,CAAC,CAAC,EAAE,EAAE;YAChB,YAAY,CAAC,YAAY,EAAE,EAAE,CAAC;YAC9B,UAAU,CAAC,YAAY,EAAE,CAAC,CAAC,CAAC,CAAC;QACjC,CAAC,EACD,WAAW,EAAE,CAAC,CAAC,EAAE,EAAE;YACf,YAAY,CAAC,WAAW,EAAE,EAAE,CAAC;YAC7B,UAAU,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,CAAC;QAChC,CAAC,aAEA,CAAC,CAAC,IAAI,IAAI,cAAc,CAAC,IAAI,CAAC,IAAI,CAC/B,8BAAmB,IAAI,mCAClB,IAAI,GACF,CACV,EACA,CAAC,QAAQ,IAAI,iDAAsB,KAAK,GAAQ,IAChD,CACR,CAAC;IAEF,IAAI,OAAO,IAAI,QAAQ;QACnB,OAAO,CACH,KAAC,OAAO,IAAC,KAAK,EAAE,OAAO,IAAI,KAAK,EAAE,SAAS,EAAC,KAAK,YAC5C,MAAM,GACD,CACb,CAAC;IAEN,OAAO,MAAM,CAAC,EAAE,CAAC,CAAC;AACtB,CAAC"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import './field.scss';
|
|
2
|
+
import { ElementType, ReactNode } from 'react';
|
|
3
|
+
import { ElementProps } from '-/types/common';
|
|
4
|
+
export type FieldProps<As extends ElementType = ElementType> = {
|
|
5
|
+
/**
|
|
6
|
+
* The children of the form field. This should be a control such as DatePicker, Input, InputNumber, InputPhone,
|
|
7
|
+
* Password, Select, Textarea, or TimePicker.
|
|
8
|
+
*
|
|
9
|
+
* @required
|
|
10
|
+
*/
|
|
11
|
+
children: ReactNode;
|
|
12
|
+
/**
|
|
13
|
+
* The element type to render the field as.
|
|
14
|
+
*
|
|
15
|
+
* @default div
|
|
16
|
+
* @type ElementType
|
|
17
|
+
*/
|
|
18
|
+
as?: As;
|
|
19
|
+
/** The unique id for the field. */
|
|
20
|
+
id?: string;
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* Wrapper component for form controls.
|
|
24
|
+
*
|
|
25
|
+
* Children should be one of the following: DatePicker, Input, InputNumber, InputPhone, Password, Select, Textarea, or
|
|
26
|
+
* TimePicker.
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* import { Input } from '@bspk/ui/Input';
|
|
30
|
+
* import { Field, FieldLabel, FieldDescription, FieldError } from '@bspk/ui/Field';
|
|
31
|
+
*
|
|
32
|
+
* function Example() {
|
|
33
|
+
* const [state, setState] = React.useState<string | undefined>(undefined);
|
|
34
|
+
* const [error, setError] = React.useState<string | undefined>(undefined);
|
|
35
|
+
*
|
|
36
|
+
* return (
|
|
37
|
+
* <Field label="Example label">
|
|
38
|
+
* <FieldLabel>Example label</FieldLabel>
|
|
39
|
+
* <Input
|
|
40
|
+
* aria-label="example aria-label"
|
|
41
|
+
* name="example-text"
|
|
42
|
+
* onChange={(next) => {
|
|
43
|
+
* setState(next);
|
|
44
|
+
* }}
|
|
45
|
+
* value={state}
|
|
46
|
+
* {...fieldProps}
|
|
47
|
+
* />
|
|
48
|
+
* <FieldDescription>This is an example description.</FieldDescription>
|
|
49
|
+
* {error && <FieldError>{error}</FieldError>}
|
|
50
|
+
* </Field>
|
|
51
|
+
* );
|
|
52
|
+
* }
|
|
53
|
+
*
|
|
54
|
+
* @name Field
|
|
55
|
+
* @phase Utility
|
|
56
|
+
*/
|
|
57
|
+
export declare function Field<As extends ElementType = ElementType>({ children, as, id: idProp, ...props }: ElementProps<FieldProps<As>, As>): import("react/jsx-runtime").JSX.Element;
|
|
58
|
+
/** Copyright 2025 Anywhere Real Estate - CC BY 4.0 */
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import './field.css.js';
|
|
3
|
+
import { Children, isValidElement, useMemo, useState } from 'react';
|
|
4
|
+
import { describedById, errorMessageId, fieldContext, labelledById } from './utils';
|
|
5
|
+
import { randomString } from '../../utils/random';
|
|
6
|
+
const isComponentName = (child, name) => {
|
|
7
|
+
const componentType = child.type;
|
|
8
|
+
return componentType.displayName === name || componentType.name === name;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* Wrapper component for form controls.
|
|
12
|
+
*
|
|
13
|
+
* Children should be one of the following: DatePicker, Input, InputNumber, InputPhone, Password, Select, Textarea, or
|
|
14
|
+
* TimePicker.
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* import { Input } from '@bspk/ui/Input';
|
|
18
|
+
* import { Field, FieldLabel, FieldDescription, FieldError } from '@bspk/ui/Field';
|
|
19
|
+
*
|
|
20
|
+
* function Example() {
|
|
21
|
+
* const [state, setState] = React.useState<string | undefined>(undefined);
|
|
22
|
+
* const [error, setError] = React.useState<string | undefined>(undefined);
|
|
23
|
+
*
|
|
24
|
+
* return (
|
|
25
|
+
* <Field label="Example label">
|
|
26
|
+
* <FieldLabel>Example label</FieldLabel>
|
|
27
|
+
* <Input
|
|
28
|
+
* aria-label="example aria-label"
|
|
29
|
+
* name="example-text"
|
|
30
|
+
* onChange={(next) => {
|
|
31
|
+
* setState(next);
|
|
32
|
+
* }}
|
|
33
|
+
* value={state}
|
|
34
|
+
* {...fieldProps}
|
|
35
|
+
* />
|
|
36
|
+
* <FieldDescription>This is an example description.</FieldDescription>
|
|
37
|
+
* {error && <FieldError>{error}</FieldError>}
|
|
38
|
+
* </Field>
|
|
39
|
+
* );
|
|
40
|
+
* }
|
|
41
|
+
*
|
|
42
|
+
* @name Field
|
|
43
|
+
* @phase Utility
|
|
44
|
+
*/
|
|
45
|
+
export function Field({ children, as, id: idProp, ...props }) {
|
|
46
|
+
const id = useMemo(() => idProp || `field-${randomString(8)}`, [idProp]);
|
|
47
|
+
const childContext = useMemo(() => {
|
|
48
|
+
const next = {};
|
|
49
|
+
Children.forEach(children, (child) => {
|
|
50
|
+
if (!isValidElement(child) || typeof child.type === 'string' || !child.props.children)
|
|
51
|
+
return;
|
|
52
|
+
if (isComponentName(child, 'FieldError'))
|
|
53
|
+
next.ariaErrorMessage = errorMessageId(id);
|
|
54
|
+
else if (isComponentName(child, 'FieldLabel'))
|
|
55
|
+
next.ariaLabelledBy = labelledById(id);
|
|
56
|
+
else if (isComponentName(child, 'FieldDescription'))
|
|
57
|
+
next.ariaDescribedBy = describedById(id);
|
|
58
|
+
});
|
|
59
|
+
return next;
|
|
60
|
+
}, [children, id]);
|
|
61
|
+
const [contextState, setContext] = useState({});
|
|
62
|
+
const As = as || 'div';
|
|
63
|
+
return (_jsx(fieldContext.Provider, { value: {
|
|
64
|
+
...childContext,
|
|
65
|
+
...contextState,
|
|
66
|
+
id,
|
|
67
|
+
setContext,
|
|
68
|
+
}, children: _jsx(As, { ...props, "data-bspk-utility": "field", id: id, role: "group", children: children }) }));
|
|
69
|
+
}
|
|
70
|
+
//# sourceMappingURL=Field.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Field.js","sourceRoot":"","sources":["../../../src/components/Field/Field.tsx"],"names":[],"mappings":";AAAA,OAAO,cAAc,CAAC;AACtB,OAAO,EAAE,QAAQ,EAAe,cAAc,EAAa,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAE5F,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,YAAY,EAAgB,YAAY,EAAE,MAAM,SAAS,CAAC;AAElG,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAqB9C,MAAM,eAAe,GAAG,CACpB,KAAqG,EACrG,IAAY,EACd,EAAE;IACA,MAAM,aAAa,GAAG,KAAK,CAAC,IAA+C,CAAC;IAC5E,OAAO,aAAa,CAAC,WAAW,KAAK,IAAI,IAAI,aAAa,CAAC,IAAI,KAAK,IAAI,CAAC;AAC7E,CAAC,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,MAAM,UAAU,KAAK,CAAuC,EACxD,QAAQ,EACR,EAAE,EACF,EAAE,EAAE,MAAM,EACV,GAAG,KAAK,EACuB;IAC/B,MAAM,EAAE,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC,MAAM,IAAI,SAAS,YAAY,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC;IAEzE,MAAM,YAAY,GAAG,OAAO,CAAC,GAAG,EAAE;QAC9B,MAAM,IAAI,GAAkF,EAAE,CAAC;QAC/F,QAAQ,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,EAAE;YACjC,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,IAAI,OAAO,KAAK,CAAC,IAAI,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,QAAQ;gBAAE,OAAO;YAE9F,IAAI,eAAe,CAAC,KAAK,EAAE,YAAY,CAAC;gBAAE,IAAI,CAAC,gBAAgB,GAAG,cAAc,CAAC,EAAE,CAAC,CAAC;iBAChF,IAAI,eAAe,CAAC,KAAK,EAAE,YAAY,CAAC;gBAAE,IAAI,CAAC,cAAc,GAAG,YAAY,CAAC,EAAE,CAAC,CAAC;iBACjF,IAAI,eAAe,CAAC,KAAK,EAAE,kBAAkB,CAAC;gBAAE,IAAI,CAAC,eAAe,GAAG,aAAa,CAAC,EAAE,CAAC,CAAC;QAClG,CAAC,CAAC,CAAC;QACH,OAAO,IAAI,CAAC;IAChB,CAAC,EAAE,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,CAAC;IAEnB,MAAM,CAAC,YAAY,EAAE,UAAU,CAAC,GAAG,QAAQ,CAA6C,EAAE,CAAC,CAAC;IAE5F,MAAM,EAAE,GAAG,EAAE,IAAI,KAAK,CAAC;IAEvB,OAAO,CACH,KAAC,YAAY,CAAC,QAAQ,IAClB,KAAK,EAAE;YACH,GAAG,YAAY;YACf,GAAG,YAAY;YACf,EAAE;YACF,UAAU;SACb,YAED,KAAC,EAAE,OAAK,KAAK,uBAAoB,OAAO,EAAC,EAAE,EAAE,EAAE,EAAE,IAAI,EAAC,OAAO,YACxD,QAAQ,GACR,GACe,CAC3B,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useFieldContext, describedById } from './utils';
|
|
3
|
+
function FieldDescription({ children }) {
|
|
4
|
+
const { id } = useFieldContext();
|
|
5
|
+
return children ? (_jsx("p", { "data-bspk": "field-description", id: describedById(id), children: children })) : null;
|
|
6
|
+
}
|
|
7
|
+
FieldDescription.displayName = 'FieldDescription';
|
|
8
|
+
export { FieldDescription };
|
|
9
|
+
//# sourceMappingURL=FieldDescription.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FieldDescription.js","sourceRoot":"","sources":["../../../src/components/Field/FieldDescription.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAEzD,SAAS,gBAAgB,CAAC,EAAE,QAAQ,EAAyB;IACzD,MAAM,EAAE,EAAE,EAAE,GAAG,eAAe,EAAE,CAAC;IAEjC,OAAO,QAAQ,CAAC,CAAC,CAAC,CACd,yBAAa,mBAAmB,EAAC,EAAE,EAAE,aAAa,CAAC,EAAE,CAAC,YACjD,QAAQ,GACT,CACP,CAAC,CAAC,CAAC,IAAI,CAAC;AACb,CAAC;AAED,gBAAgB,CAAC,WAAW,GAAG,kBAAkB,CAAC;AAElD,OAAO,EAAE,gBAAgB,EAAE,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { errorMessageId, useFieldContext } from './utils';
|
|
3
|
+
import { InlineAlert } from '../InlineAlert';
|
|
4
|
+
export function FieldError({ children }) {
|
|
5
|
+
const { id } = useFieldContext();
|
|
6
|
+
return (children && (_jsx(InlineAlert, { id: errorMessageId(id), owner: "field-error", variant: "error", children: children })));
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=FieldError.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FieldError.js","sourceRoot":"","sources":["../../../src/components/Field/FieldError.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAC1D,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAOvD,MAAM,UAAU,UAAU,CAAC,EAAE,QAAQ,EAAmB;IACpD,MAAM,EAAE,EAAE,EAAE,GAAG,eAAe,EAAE,CAAC;IAEjC,OAAO,CACH,QAAQ,IAAI,CACR,KAAC,WAAW,IAAC,EAAE,EAAE,cAAc,CAAC,EAAE,CAAC,EAAE,KAAK,EAAC,aAAa,EAAC,OAAO,EAAC,OAAO,YACnE,QAAQ,GACC,CACjB,CACJ,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Field, FieldDescription, FieldError, FieldLabel } from './';
|
|
3
|
+
import { Input } from '../Input';
|
|
4
|
+
import { randomString } from '../../utils/random';
|
|
5
|
+
export const FieldExample = {
|
|
6
|
+
render: ({ props, setState }) => {
|
|
7
|
+
return (_jsxs(Field, { ...props, children: [_jsx(FieldLabel, { children: "Example label" }), _jsx(Input, { name: `example-${randomString(6)}`, onChange: (next) => setState({ value: next }), value: props.value }), _jsx(FieldDescription, { children: "This is an example description." }), _jsx(FieldError, { children: "This is an error message." })] }));
|
|
8
|
+
},
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=FieldExample.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FieldExample.js","sourceRoot":"","sources":["../../../src/components/Field/FieldExample.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,KAAK,EAAE,gBAAgB,EAAE,UAAU,EAAE,UAAU,EAAc,MAAM,IAAI,CAAC;AACjF,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAE3C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C,MAAM,CAAC,MAAM,YAAY,GAAsD;IAC3E,MAAM,EAAE,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,EAAE;QAC5B,OAAO,CACH,MAAC,KAAK,OAAK,KAAK,aACZ,KAAC,UAAU,gCAA2B,EACtC,KAAC,KAAK,IACF,IAAI,EAAE,WAAW,YAAY,CAAC,CAAC,CAAC,EAAE,EAClC,QAAQ,EAAE,CAAC,IAAY,EAAE,EAAE,CAAC,QAAQ,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,EACrD,KAAK,EAAE,KAAK,CAAC,KAAK,GACpB,EACF,KAAC,gBAAgB,kDAAmD,EACpE,KAAC,UAAU,4CAAuC,IAC9C,CACX,CAAC;IACN,CAAC;CACJ,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ElementType } from 'react';
|
|
2
|
+
import { FieldContext } from './utils';
|
|
3
|
+
import { ElementProps } from '-/types/common';
|
|
4
|
+
export type FieldLabelProps<As extends ElementType = ElementType> = Pick<FieldContext, 'labelTrailing' | 'required'> & {
|
|
5
|
+
/** The label text. */
|
|
6
|
+
children: string;
|
|
7
|
+
/**
|
|
8
|
+
* The element type to render as.
|
|
9
|
+
*
|
|
10
|
+
* @default label
|
|
11
|
+
* @type ElementType
|
|
12
|
+
*/
|
|
13
|
+
as?: As;
|
|
14
|
+
};
|
|
15
|
+
export declare function FieldLabel<As extends ElementType = ElementType>({ children, labelTrailing, as, ...props }: ElementProps<FieldLabelProps<As>, As>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useFieldContext, labelledById } from './utils';
|
|
3
|
+
export function FieldLabel({ children, labelTrailing, as, ...props }) {
|
|
4
|
+
const As = as || 'label';
|
|
5
|
+
const { required, id, htmlFor, ...context } = useFieldContext();
|
|
6
|
+
return (_jsxs(As, { "data-bspk": "field-label", htmlFor: As === 'label' ? htmlFor : undefined, id: labelledById(id), ...props, children: [_jsx("span", { children: children }), required && _jsx("span", { "data-required": true, children: ' (Required)' }), (labelTrailing || context.labelTrailing) && (_jsx("span", { "aria-hidden": true, "data-trailing": true, children: labelTrailing || context.labelTrailing }))] }));
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=FieldLabel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FieldLabel.js","sourceRoot":"","sources":["../../../src/components/Field/FieldLabel.tsx"],"names":[],"mappings":";AACA,OAAO,EAAgB,eAAe,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAetE,MAAM,UAAU,UAAU,CAAuC,EAC7D,QAAQ,EACR,aAAa,EACb,EAAE,EACF,GAAG,KAAK,EAC4B;IACpC,MAAM,EAAE,GAAG,EAAE,IAAI,OAAO,CAAC;IAEzB,MAAM,EAAE,QAAQ,EAAE,EAAE,EAAE,OAAO,EAAE,GAAG,OAAO,EAAE,GAAG,eAAe,EAAE,CAAC;IAEhE,OAAO,CACH,MAAC,EAAE,iBAAW,aAAa,EAAC,OAAO,EAAE,EAAE,KAAK,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,EAAE,EAAE,EAAE,YAAY,CAAC,EAAE,CAAC,KAAM,KAAK,aACtG,yBAAO,QAAQ,GAAQ,EACtB,QAAQ,IAAI,gDAAqB,aAAa,GAAQ,EACtD,CAAC,aAAa,IAAI,OAAO,CAAC,aAAa,CAAC,IAAI,CACzC,qEACK,aAAa,IAAI,OAAO,CAAC,aAAa,GACpC,CACV,IACA,CACR,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
[data-bspk-utility=field] {
|
|
2
|
+
width: 100%;
|
|
3
|
+
display: flex;
|
|
4
|
+
flex-direction: column;
|
|
5
|
+
gap: var(--spacing-sizing-01);
|
|
6
|
+
border: none;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
[data-bspk=field-label] {
|
|
10
|
+
display: flex;
|
|
11
|
+
flex-direction: row;
|
|
12
|
+
align-items: center;
|
|
13
|
+
gap: var(--spacing-sizing-01);
|
|
14
|
+
}
|
|
15
|
+
[data-bspk=field-label] span {
|
|
16
|
+
font: var(--labels-small);
|
|
17
|
+
color: var(--foreground-neutral-on-surface);
|
|
18
|
+
}
|
|
19
|
+
[data-bspk=field-label] span[data-required] {
|
|
20
|
+
font: var(--body-small);
|
|
21
|
+
color: var(--foreground-neutral-on-surface-variant-01);
|
|
22
|
+
}
|
|
23
|
+
[data-bspk=field-label] span[data-trailing] {
|
|
24
|
+
font: var(--body-small);
|
|
25
|
+
color: var(--foreground-neutral-on-surface-variant-02);
|
|
26
|
+
margin-left: auto;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
[data-bspk=field-description] {
|
|
30
|
+
font: var(--body-small);
|
|
31
|
+
color: var(--foreground-neutral-on-surface-variant-01);
|
|
32
|
+
margin: 0;
|
|
33
|
+
padding: 0;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/** Copyright 2025 Anywhere Real Estate - CC BY 4.0 */
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/** * This file is generated by the build script.
|
|
2
|
+
* Do not edit this file directly. */
|
|
3
|
+
const style = document.createElement('style');
|
|
4
|
+
style.appendChild(document.createTextNode(`[data-bspk-utility=field] {
|
|
5
|
+
width: 100%;
|
|
6
|
+
display: flex;
|
|
7
|
+
flex-direction: column;
|
|
8
|
+
gap: var(--spacing-sizing-01);
|
|
9
|
+
border: none;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
[data-bspk=field-label] {
|
|
13
|
+
display: flex;
|
|
14
|
+
flex-direction: row;
|
|
15
|
+
align-items: center;
|
|
16
|
+
gap: var(--spacing-sizing-01);
|
|
17
|
+
}
|
|
18
|
+
[data-bspk=field-label] span {
|
|
19
|
+
font: var(--labels-small);
|
|
20
|
+
color: var(--foreground-neutral-on-surface);
|
|
21
|
+
}
|
|
22
|
+
[data-bspk=field-label] span[data-required] {
|
|
23
|
+
font: var(--body-small);
|
|
24
|
+
color: var(--foreground-neutral-on-surface-variant-01);
|
|
25
|
+
}
|
|
26
|
+
[data-bspk=field-label] span[data-trailing] {
|
|
27
|
+
font: var(--body-small);
|
|
28
|
+
color: var(--foreground-neutral-on-surface-variant-02);
|
|
29
|
+
margin-left: auto;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
[data-bspk=field-description] {
|
|
33
|
+
font: var(--body-small);
|
|
34
|
+
color: var(--foreground-neutral-on-surface-variant-01);
|
|
35
|
+
margin: 0;
|
|
36
|
+
padding: 0;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/** Copyright 2025 Anywhere Real Estate - CC BY 4.0 */
|
|
40
|
+
`));
|
|
41
|
+
document.head.appendChild(style);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/Field/index.tsx"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC;AAC7B,cAAc,oBAAoB,CAAC;AACnC,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { CommonProps } from '-/types/common';
|
|
2
|
+
export declare const errorMessageId: (id: string) => string;
|
|
3
|
+
export declare const labelledById: (id: string) => string;
|
|
4
|
+
export declare const describedById: (id: string) => string;
|
|
5
|
+
/** The props that are provided via context to all Field subcomponents. */
|
|
6
|
+
export type FieldContextProps = CommonProps<'required'> & {
|
|
7
|
+
/** The aria-describedby attribute value that should be applied to the field input element. */
|
|
8
|
+
ariaDescribedBy?: string;
|
|
9
|
+
/** The aria-errormessage attribute value that should be applied to the field input element. */
|
|
10
|
+
ariaErrorMessage?: string;
|
|
11
|
+
/** Text that appears after the label, but before the input (e.g. "optional"). */
|
|
12
|
+
labelTrailing?: string;
|
|
13
|
+
/** The aria-labelledby attribute value that should be applied to the field input element. */
|
|
14
|
+
ariaLabelledBy?: string;
|
|
15
|
+
/** The htmlFor attribute value that should be applied to the field label element. */
|
|
16
|
+
htmlFor?: string;
|
|
17
|
+
/** The id of the field. */
|
|
18
|
+
id: string;
|
|
19
|
+
};
|
|
20
|
+
export type FieldContext = FieldContextProps & {
|
|
21
|
+
setContext: (next: Pick<FieldContextProps, 'htmlFor' | 'required'>) => void;
|
|
22
|
+
};
|
|
23
|
+
export declare const fieldContext: import("react").Context<FieldContext | null>;
|
|
24
|
+
export declare function useFieldContext(): FieldContext;
|
|
25
|
+
/**
|
|
26
|
+
* Initializes field-related attributes and state for a form control component.
|
|
27
|
+
*
|
|
28
|
+
* Creates id if not provided, manages invalid state, and syncs with Field context.
|
|
29
|
+
*/
|
|
30
|
+
export declare function useFieldInit({ idProp, required, disabled, readOnly, invalidProp, }: {
|
|
31
|
+
idProp: string | undefined;
|
|
32
|
+
required: boolean | undefined;
|
|
33
|
+
disabled: boolean | undefined;
|
|
34
|
+
readOnly: boolean | undefined;
|
|
35
|
+
invalidProp: boolean | undefined;
|
|
36
|
+
}): Pick<FieldContext, 'ariaDescribedBy' | 'ariaErrorMessage'> & {
|
|
37
|
+
invalid: boolean;
|
|
38
|
+
id: string;
|
|
39
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { createContext, useContext, useEffect, useMemo } from 'react';
|
|
2
|
+
import { useId } from '../../hooks/useId';
|
|
3
|
+
export const errorMessageId = (id) => `${id}-field-error`;
|
|
4
|
+
export const labelledById = (id) => `${id}-label`;
|
|
5
|
+
export const describedById = (id) => `${id}-description`;
|
|
6
|
+
export const fieldContext = createContext(null);
|
|
7
|
+
export function useFieldContext() {
|
|
8
|
+
return (useContext(fieldContext) || {
|
|
9
|
+
id: undefined,
|
|
10
|
+
setContext: () => { },
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Initializes field-related attributes and state for a form control component.
|
|
15
|
+
*
|
|
16
|
+
* Creates id if not provided, manages invalid state, and syncs with Field context.
|
|
17
|
+
*/
|
|
18
|
+
export function useFieldInit({ idProp, required, disabled, readOnly, invalidProp, }) {
|
|
19
|
+
const context = useContext(fieldContext);
|
|
20
|
+
const controlId = useId(idProp || context?.htmlFor);
|
|
21
|
+
const invalid = useMemo(() => !disabled && !readOnly && (invalidProp || !!context?.ariaErrorMessage), [disabled, readOnly, invalidProp, context?.ariaErrorMessage]);
|
|
22
|
+
useEffect(() => {
|
|
23
|
+
if (!context)
|
|
24
|
+
return;
|
|
25
|
+
if (controlId !== context?.htmlFor || !!required !== !!context?.required) {
|
|
26
|
+
context.setContext({ htmlFor: controlId, required: required });
|
|
27
|
+
}
|
|
28
|
+
}, [context, controlId, required]);
|
|
29
|
+
return {
|
|
30
|
+
...(context || {}),
|
|
31
|
+
invalid,
|
|
32
|
+
id: controlId,
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/components/Field/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AACtE,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAGtC,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,EAAU,EAAE,EAAE,CAAC,GAAG,EAAE,cAAc,CAAC;AAClE,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,EAAU,EAAE,EAAE,CAAC,GAAG,EAAE,QAAQ,CAAC;AAC1D,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,EAAU,EAAE,EAAE,CAAC,GAAG,EAAE,cAAc,CAAC;AAsBjE,MAAM,CAAC,MAAM,YAAY,GAAG,aAAa,CAAsB,IAAI,CAAC,CAAC;AAErE,MAAM,UAAU,eAAe;IAC3B,OAAO,CACH,UAAU,CAAC,YAAY,CAAC,IAAI;QACxB,EAAE,EAAE,SAA8B;QAClC,UAAU,EAAE,GAAG,EAAE,GAAE,CAAC;KACvB,CACJ,CAAC;AACN,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,YAAY,CAAC,EACzB,MAAM,EACN,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,WAAW,GAOd;IACG,MAAM,OAAO,GAAG,UAAU,CAAC,YAAY,CAAC,CAAC;IACzC,MAAM,SAAS,GAAG,KAAK,CAAC,MAAM,IAAI,OAAO,EAAE,OAAO,CAAC,CAAC;IAEpD,MAAM,OAAO,GAAG,OAAO,CACnB,GAAG,EAAE,CAAC,CAAC,QAAQ,IAAI,CAAC,QAAQ,IAAI,CAAC,WAAW,IAAI,CAAC,CAAC,OAAO,EAAE,gBAAgB,CAAC,EAC5E,CAAC,QAAQ,EAAE,QAAQ,EAAE,WAAW,EAAE,OAAO,EAAE,gBAAgB,CAAC,CAC/D,CAAC;IAEF,SAAS,CAAC,GAAG,EAAE;QACX,IAAI,CAAC,OAAO;YAAE,OAAO;QAErB,IAAI,SAAS,KAAK,OAAO,EAAE,OAAO,IAAI,CAAC,CAAC,QAAQ,KAAK,CAAC,CAAC,OAAO,EAAE,QAAQ,EAAE,CAAC;YACvE,OAAO,CAAC,UAAU,CAAC,EAAE,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAC,CAAC;QACnE,CAAC;IACL,CAAC,EAAE,CAAC,OAAO,EAAE,SAAS,EAAE,QAAQ,CAAC,CAAC,CAAC;IAEnC,OAAO;QACH,GAAG,CAAC,OAAO,IAAI,EAAE,CAAC;QAClB,OAAO;QACP,EAAE,EAAE,SAAS;KAChB,CAAC;AACN,CAAC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import '
|
|
2
|
-
import { CommonProps
|
|
3
|
-
export type
|
|
4
|
-
export type FormFieldProps = CommonProps<'
|
|
5
|
-
/**
|
|
1
|
+
import { ElementType, ReactNode } from 'react';
|
|
2
|
+
import { CommonProps } from '-/types/common';
|
|
3
|
+
export type FormFieldControlProps<P extends Record<string, unknown>> = Omit<FormFieldProps, 'children'> & Omit<P, keyof FormFieldProps>;
|
|
4
|
+
export type FormFieldProps<As extends ElementType = ElementType> = CommonProps<'style'> & {
|
|
5
|
+
/** Displays an error message and marks the field as invalid. */
|
|
6
6
|
errorMessage?: string;
|
|
7
7
|
/**
|
|
8
8
|
* The label of the field.
|
|
@@ -10,36 +10,52 @@ export type FormFieldProps = CommonProps<'invalid' | 'required'> & {
|
|
|
10
10
|
* @required
|
|
11
11
|
*/
|
|
12
12
|
label: string;
|
|
13
|
-
/** The id of the control. */
|
|
14
|
-
controlId: string;
|
|
15
13
|
/**
|
|
16
|
-
* The children of the form field. This should
|
|
14
|
+
* The children of the form field. This should at least contain a FieldLabel component and a control such as
|
|
15
|
+
* DatePicker, Input, InputNumber, InputPhone, Password, Select, Textarea, or TimePicker.
|
|
16
|
+
*
|
|
17
|
+
* Other components such as FieldDescription and FieldError can also be included.
|
|
17
18
|
*
|
|
18
|
-
* @type (childProps: FormFieldControlProps) => JSX.Element
|
|
19
19
|
* @required
|
|
20
20
|
*/
|
|
21
|
-
children:
|
|
22
|
-
/**
|
|
21
|
+
children: ReactNode;
|
|
22
|
+
/**
|
|
23
|
+
* This text provides additional context or instructions for the field.
|
|
24
|
+
*
|
|
25
|
+
* If an errorMessage is present, the helperText will not be displayed.
|
|
26
|
+
*/
|
|
23
27
|
helperText?: string;
|
|
24
28
|
/** The trailing element of the label. */
|
|
25
|
-
labelTrailing?:
|
|
29
|
+
labelTrailing?: string;
|
|
30
|
+
/** Marks the field as required. */
|
|
31
|
+
required?: boolean;
|
|
32
|
+
/**
|
|
33
|
+
* The element type to render as.
|
|
34
|
+
*
|
|
35
|
+
* With grouped fields, this is typically set to "fieldset".
|
|
36
|
+
*
|
|
37
|
+
* @default div
|
|
38
|
+
* @type ElementType
|
|
39
|
+
*/
|
|
40
|
+
as?: As;
|
|
26
41
|
};
|
|
27
42
|
/**
|
|
28
43
|
* Wrapper component for form controls.
|
|
29
44
|
*
|
|
30
|
-
* Children should be one of the following:
|
|
45
|
+
* Children should be one of the following: DatePicker, Input, InputNumber, InputPhone, Password, Select, Textarea, or
|
|
46
|
+
* TimePicker.
|
|
31
47
|
*
|
|
32
48
|
* @example
|
|
33
|
-
* import {
|
|
49
|
+
* import { Input } from '@bspk/ui/Input';
|
|
34
50
|
* import { FormField } from '@bspk/ui/FormField';
|
|
35
51
|
*
|
|
36
|
-
*
|
|
52
|
+
* function Example() {
|
|
37
53
|
* const [state, setState] = React.useState<string | undefined>(undefined);
|
|
38
54
|
* return (
|
|
39
55
|
* <FormField controlId="Example controlId" label="Example label">
|
|
40
56
|
* {(fieldProps) => {
|
|
41
57
|
* return (
|
|
42
|
-
* <
|
|
58
|
+
* <Input
|
|
43
59
|
* aria-label="example aria-label"
|
|
44
60
|
* name="example-text"
|
|
45
61
|
* onChange={(next) => {
|
|
@@ -57,5 +73,5 @@ export type FormFieldProps = CommonProps<'invalid' | 'required'> & {
|
|
|
57
73
|
* @name FormField
|
|
58
74
|
* @phase Utility
|
|
59
75
|
*/
|
|
60
|
-
export declare function FormField({ label,
|
|
76
|
+
export declare function FormField({ label, errorMessage, helperText, children, labelTrailing, required, as, style, }: FormFieldProps): import("react/jsx-runtime").JSX.Element;
|
|
61
77
|
/** Copyright 2025 Anywhere Real Estate - CC BY 4.0 */
|
|
@@ -1,23 +1,22 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import '
|
|
3
|
-
import { InlineAlert } from '../InlineAlert';
|
|
4
|
-
import { Txt } from '../Txt';
|
|
2
|
+
import { Field, FieldLabel, FieldDescription, FieldError } from '../Field';
|
|
5
3
|
/**
|
|
6
4
|
* Wrapper component for form controls.
|
|
7
5
|
*
|
|
8
|
-
* Children should be one of the following:
|
|
6
|
+
* Children should be one of the following: DatePicker, Input, InputNumber, InputPhone, Password, Select, Textarea, or
|
|
7
|
+
* TimePicker.
|
|
9
8
|
*
|
|
10
9
|
* @example
|
|
11
|
-
* import {
|
|
10
|
+
* import { Input } from '@bspk/ui/Input';
|
|
12
11
|
* import { FormField } from '@bspk/ui/FormField';
|
|
13
12
|
*
|
|
14
|
-
*
|
|
13
|
+
* function Example() {
|
|
15
14
|
* const [state, setState] = React.useState<string | undefined>(undefined);
|
|
16
15
|
* return (
|
|
17
16
|
* <FormField controlId="Example controlId" label="Example label">
|
|
18
17
|
* {(fieldProps) => {
|
|
19
18
|
* return (
|
|
20
|
-
* <
|
|
19
|
+
* <Input
|
|
21
20
|
* aria-label="example aria-label"
|
|
22
21
|
* name="example-text"
|
|
23
22
|
* onChange={(next) => {
|
|
@@ -35,16 +34,9 @@ import { Txt } from '../Txt';
|
|
|
35
34
|
* @name FormField
|
|
36
35
|
* @phase Utility
|
|
37
36
|
*/
|
|
38
|
-
export function FormField({ label,
|
|
39
|
-
const
|
|
40
|
-
const
|
|
41
|
-
|
|
42
|
-
const helperTextId = !errorMessage && helperText ? `${controlId}-helper-text` : undefined;
|
|
43
|
-
if (typeof children !== 'function')
|
|
44
|
-
return null;
|
|
45
|
-
return (_jsxs("div", { ...props, "data-bspk-utility": "form-field", "data-invalid": invalid || undefined, children: [_jsxs("header", { children: [_jsxs("label", { htmlFor: controlId, children: [_jsx(Txt, { as: "span", variant: "labels-small", children: label }), required && (_jsx(Txt, { as: "span", variant: "body-small", children: ' (Required)' }))] }), labelTrailing] }), children({
|
|
46
|
-
'aria-describedby': helperTextId,
|
|
47
|
-
'aria-errormessage': errorMessageId,
|
|
48
|
-
}), errorMessage && (_jsx(InlineAlert, { id: errorMessageId, variant: "error", children: errorMessage })), helperText && (_jsx(Txt, { id: helperTextId, variant: "body-small", children: helperText }))] }));
|
|
37
|
+
export function FormField({ label, errorMessage, helperText, children, labelTrailing, required, as, style, }) {
|
|
38
|
+
const fieldAs = as || 'div';
|
|
39
|
+
const labelAs = fieldAs === 'fieldset' ? 'legend' : undefined;
|
|
40
|
+
return (_jsxs(Field, { as: fieldAs, style: style, children: [_jsx(FieldLabel, { as: labelAs, labelTrailing: labelTrailing, required: required, children: label }), children, !errorMessage && helperText && _jsx(FieldDescription, { children: helperText }), _jsx(FieldError, { children: errorMessage })] }));
|
|
49
41
|
}
|
|
50
42
|
//# sourceMappingURL=FormField.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormField.js","sourceRoot":"","sources":["../../../src/components/FormField/FormField.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"FormField.js","sourceRoot":"","sources":["../../../src/components/FormField/FormField.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AA6CrF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,MAAM,UAAU,SAAS,CAAC,EACtB,KAAK,EACL,YAAY,EACZ,UAAU,EACV,QAAQ,EACR,aAAa,EACb,QAAQ,EACR,EAAE,EACF,KAAK,GACQ;IACb,MAAM,OAAO,GAAG,EAAE,IAAI,KAAK,CAAC;IAE5B,MAAM,OAAO,GAAG,OAAO,KAAK,UAAU,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC;IAC9D,OAAO,CACH,MAAC,KAAK,IAAC,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,aAC5B,KAAC,UAAU,IAAC,EAAE,EAAE,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,QAAQ,EAAE,QAAQ,YACpE,KAAK,GACG,EACZ,QAAQ,EACR,CAAC,YAAY,IAAI,UAAU,IAAI,KAAC,gBAAgB,cAAE,UAAU,GAAoB,EACjF,KAAC,UAAU,cAAE,YAAY,GAAc,IACnC,CACX,CAAC;AACN,CAAC"}
|
|
@@ -1,4 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { ComponentExample } from '-/utils/demo';
|
|
4
|
-
|
|
1
|
+
import { FormFieldProps } from '.';
|
|
2
|
+
import { FieldControlProps } from '-/types/common';
|
|
3
|
+
import { ComponentExample, Preset, Syntax } from '-/utils/demo';
|
|
4
|
+
type ExampleProps = Partial<FieldControlProps & FormFieldProps>;
|
|
5
|
+
export declare const presets: Preset<Partial<ExampleProps>>[];
|
|
6
|
+
export declare const FormFieldExample: ComponentExample<ExampleProps>;
|
|
7
|
+
export declare function FormFieldExampleRender({ ...props }: ExampleProps & {
|
|
8
|
+
syntax?: Syntax;
|
|
9
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export {};
|