@bspk/ui 1.3.10 → 1.3.16
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/dist/components/Accordion/Accordion.d.ts +22 -20
- package/dist/components/Accordion/Accordion.js +22 -20
- package/dist/components/Accordion/Accordion.js.map +1 -1
- package/dist/components/Accordion/AccordionExample.js +5 -4
- package/dist/components/Accordion/AccordionExample.js.map +1 -1
- package/dist/components/Avatar/Avatar.d.ts +1 -2
- package/dist/components/Avatar/Avatar.js +2 -3
- package/dist/components/Avatar/Avatar.js.map +1 -1
- package/dist/components/Avatar/avatar.css +13 -8
- package/dist/components/Avatar/avatar.css.js +13 -8
- package/dist/components/AvatarGroup/AvatarGroup.d.ts +1 -1
- package/dist/components/AvatarGroup/AvatarGroup.js +1 -1
- package/dist/components/Badge/Badge.d.ts +1 -1
- package/dist/components/Badge/Badge.js +1 -1
- package/dist/components/Badge/BadgeExample.js +0 -1
- package/dist/components/Badge/BadgeExample.js.map +1 -1
- package/dist/components/BadgeDot/BadgeDot.d.ts +1 -1
- package/dist/components/BadgeDot/BadgeDot.js +1 -1
- package/dist/components/BadgeDot/BadgeDotExample.js +0 -1
- package/dist/components/BadgeDot/BadgeDotExample.js.map +1 -1
- package/dist/components/BannerAlert/BannerAlert.d.ts +14 -12
- package/dist/components/BannerAlert/BannerAlert.js +14 -12
- package/dist/components/BannerAlert/BannerAlert.js.map +1 -1
- package/dist/components/BannerAlert/BannerAlertExample.js +0 -1
- package/dist/components/BannerAlert/BannerAlertExample.js.map +1 -1
- package/dist/components/Breadcrumb/Breadcrumb.d.ts +20 -18
- package/dist/components/Breadcrumb/Breadcrumb.js +20 -18
- package/dist/components/Breadcrumb/Breadcrumb.js.map +1 -1
- package/dist/components/Button/Button.d.ts +29 -4
- package/dist/components/Button/Button.js +33 -8
- package/dist/components/Button/Button.js.map +1 -1
- package/dist/components/Button/button.css +4 -3
- package/dist/components/Button/button.css.js +4 -3
- package/dist/components/Calendar/Calendar.d.ts +5 -41
- package/dist/components/Calendar/Calendar.js +61 -185
- package/dist/components/Calendar/Calendar.js.map +1 -1
- package/dist/components/Calendar/CalendarExample.js +0 -1
- package/dist/components/Calendar/CalendarExample.js.map +1 -1
- package/dist/components/Calendar/calendar.css +35 -28
- package/dist/components/Calendar/calendar.css.js +35 -28
- package/dist/components/Calendar/index.d.ts +1 -0
- package/dist/components/Calendar/index.js +1 -0
- package/dist/components/Calendar/index.js.map +1 -1
- package/dist/components/Calendar/utils.d.ts +11 -0
- package/dist/components/Calendar/utils.js +76 -0
- package/dist/components/Calendar/utils.js.map +1 -0
- package/dist/components/Card/Card.d.ts +1 -1
- package/dist/components/Card/Card.js +1 -1
- package/dist/components/Carousel/Carousel.d.ts +8 -8
- package/dist/components/Carousel/Carousel.js +8 -8
- package/dist/components/Carousel/carousel.css +0 -1
- package/dist/components/Carousel/carousel.css.js +0 -1
- package/dist/components/Checkbox/Checkbox.d.ts +1 -1
- package/dist/components/Checkbox/Checkbox.js +1 -1
- package/dist/components/Checkbox/checkbox.css +3 -1
- package/dist/components/Checkbox/checkbox.css.js +3 -1
- package/dist/components/CheckboxGroup/CheckboxGroup.d.ts +1 -1
- package/dist/components/CheckboxGroup/CheckboxGroup.js +1 -1
- package/dist/components/CheckboxGroup/checkbox-group.css +1 -1
- package/dist/components/CheckboxGroup/checkbox-group.css.js +1 -1
- package/dist/components/CheckboxGroupField/CheckboxGroupField.d.ts +1 -1
- package/dist/components/CheckboxGroupField/CheckboxGroupField.js +1 -1
- package/dist/components/CheckboxOption/CheckboxOption.d.ts +1 -1
- package/dist/components/CheckboxOption/CheckboxOption.js +1 -1
- package/dist/components/Chip/Chip.d.ts +1 -1
- package/dist/components/Chip/Chip.js +1 -1
- package/dist/components/ChipGroup/ChipGroup.d.ts +16 -29
- package/dist/components/ChipGroup/ChipGroup.js +13 -23
- package/dist/components/ChipGroup/ChipGroup.js.map +1 -1
- package/dist/components/ChipGroup/ChipGroupExample.js +61 -6
- package/dist/components/ChipGroup/ChipGroupExample.js.map +1 -1
- package/dist/components/ChipGroup/chip-group.css +5 -3
- package/dist/components/ChipGroup/chip-group.css.js +5 -3
- package/dist/components/DatePicker/DatePicker.d.ts +23 -11
- package/dist/components/DatePicker/DatePicker.js +20 -83
- package/dist/components/DatePicker/DatePicker.js.map +1 -1
- package/dist/components/DatePicker/DatePickerExample.d.ts +1 -0
- package/dist/components/DatePicker/DatePickerExample.js +10 -2
- package/dist/components/DatePicker/DatePickerExample.js.map +1 -1
- package/dist/components/DatePicker/date-picker.css +9 -0
- package/dist/components/DatePicker/date-picker.css.js +9 -0
- package/dist/components/DatePickerField/DatePickerField.d.ts +1 -1
- package/dist/components/DatePickerField/DatePickerField.js +1 -1
- package/dist/components/Divider/Divider.d.ts +4 -4
- package/dist/components/Divider/Divider.js +4 -4
- package/dist/components/Divider/DividerExample.js +17 -20
- package/dist/components/Divider/DividerExample.js.map +1 -1
- package/dist/components/Drawer/Drawer.d.ts +8 -10
- package/dist/components/Drawer/Drawer.js +9 -12
- package/dist/components/Drawer/Drawer.js.map +1 -1
- package/dist/components/Drawer/DrawerExample.d.ts +1 -0
- package/dist/components/Drawer/DrawerExample.js +10 -4
- package/dist/components/Drawer/DrawerExample.js.map +1 -1
- package/dist/components/Drawer/drawer.css +6 -0
- package/dist/components/Drawer/drawer.css.js +6 -0
- package/dist/components/EmptyState/EmptyState.d.ts +2 -2
- package/dist/components/EmptyState/EmptyState.js +4 -7
- package/dist/components/EmptyState/EmptyState.js.map +1 -1
- package/dist/components/EmptyState/EmptyStateExample.js +5 -6
- package/dist/components/EmptyState/EmptyStateExample.js.map +1 -1
- package/dist/components/ExamplePlaceholder/ExamplePlaceholder.d.ts +6 -13
- package/dist/components/ExamplePlaceholder/ExamplePlaceholder.js +12 -7
- package/dist/components/ExamplePlaceholder/ExamplePlaceholder.js.map +1 -1
- package/dist/components/Fab/Fab.d.ts +5 -3
- package/dist/components/Fab/Fab.js +8 -6
- package/dist/components/Fab/Fab.js.map +1 -1
- package/dist/components/Fab/FabExample.d.ts +1 -0
- package/dist/components/Fab/FabExample.js +6 -0
- package/dist/components/Fab/FabExample.js.map +1 -1
- package/dist/components/Fab/fab.css +5 -3
- package/dist/components/Fab/fab.css.js +5 -3
- package/dist/components/FileUpload/FileUpload.d.ts +1 -1
- package/dist/components/FileUpload/FileUpload.js +1 -1
- package/dist/components/FileUploadItem/FileUploadItem.d.ts +1 -1
- package/dist/components/FileUploadItem/FileUploadItem.js +1 -1
- package/dist/components/Flex/Flex.d.ts +55 -0
- package/dist/components/Flex/Flex.js +38 -0
- package/dist/components/Flex/Flex.js.map +1 -0
- package/dist/components/Flex/FlexExample.d.ts +5 -0
- package/dist/components/Flex/FlexExample.js +13 -0
- package/dist/components/Flex/FlexExample.js.map +1 -0
- package/dist/components/Flex/index.d.ts +1 -0
- package/dist/components/Flex/index.js +2 -0
- package/dist/components/Flex/index.js.map +1 -0
- package/dist/components/FormField/FormFieldExample.js +0 -1
- package/dist/components/FormField/FormFieldExample.js.map +1 -1
- package/dist/components/Grid/Grid.d.ts +48 -0
- package/dist/components/Grid/Grid.js +36 -0
- package/dist/components/Grid/Grid.js.map +1 -0
- package/dist/components/Grid/GridExample.d.ts +3 -0
- package/dist/components/Grid/GridExample.js +28 -0
- package/dist/components/Grid/GridExample.js.map +1 -0
- package/dist/components/Grid/index.d.ts +1 -0
- package/dist/components/Grid/index.js +2 -0
- package/dist/components/Grid/index.js.map +1 -0
- package/dist/components/InlineAlert/InlineAlert.d.ts +1 -1
- package/dist/components/InlineAlert/InlineAlert.js +1 -1
- package/dist/components/Input/Input.d.ts +5 -9
- package/dist/components/Input/Input.js +5 -9
- package/dist/components/Input/Input.js.map +1 -1
- package/dist/components/Input/InputElement.js +3 -6
- package/dist/components/Input/InputElement.js.map +1 -1
- package/dist/components/Input/InputExample.d.ts +1 -0
- package/dist/components/Input/InputExample.js +10 -1
- package/dist/components/Input/InputExample.js.map +1 -1
- package/dist/components/Input/input.css +6 -1
- package/dist/components/Input/input.css.js +6 -1
- package/dist/components/InputField/InputField.d.ts +1 -1
- package/dist/components/InputField/InputField.js +1 -1
- package/dist/components/InputNumber/InputNumber.d.ts +6 -15
- package/dist/components/InputNumber/InputNumber.js +6 -15
- package/dist/components/InputNumber/InputNumber.js.map +1 -1
- package/dist/components/InputNumber/InputNumberExample.d.ts +1 -0
- package/dist/components/InputNumber/InputNumberExample.js +10 -1
- package/dist/components/InputNumber/InputNumberExample.js.map +1 -1
- package/dist/components/InputNumber/input-number.css +6 -4
- package/dist/components/InputNumber/input-number.css.js +6 -4
- package/dist/components/InputNumberField/InputNumberField.d.ts +1 -1
- package/dist/components/InputNumberField/InputNumberField.js +1 -1
- package/dist/components/InputPhone/InputPhone.d.ts +7 -9
- package/dist/components/InputPhone/InputPhone.js +19 -19
- package/dist/components/InputPhone/InputPhone.js.map +1 -1
- package/dist/components/InputPhone/InputPhoneExample.d.ts +2 -1
- package/dist/components/InputPhone/InputPhoneExample.js +9 -1
- package/dist/components/InputPhone/InputPhoneExample.js.map +1 -1
- package/dist/components/InputPhoneField/InputPhoneField.d.ts +1 -1
- package/dist/components/InputPhoneField/InputPhoneField.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 +1 -1
- package/dist/components/ListItem/ListItem.js +1 -1
- package/dist/components/Menu/Menu.d.ts +1 -3
- package/dist/components/Menu/Menu.js +1 -3
- package/dist/components/Menu/Menu.js.map +1 -1
- package/dist/components/Modal/Modal.d.ts +1 -3
- package/dist/components/Modal/Modal.js +2 -4
- package/dist/components/Modal/Modal.js.map +1 -1
- package/dist/components/OTPInput/OTPInput.d.ts +10 -4
- package/dist/components/OTPInput/OTPInput.js +8 -40
- package/dist/components/OTPInput/OTPInput.js.map +1 -1
- package/dist/components/OTPInput/OTPInputExample.js +6 -2
- package/dist/components/OTPInput/OTPInputExample.js.map +1 -1
- package/dist/components/OTPInput/otp-input.css +18 -17
- package/dist/components/OTPInput/otp-input.css.js +18 -17
- package/dist/components/PageControl/PageControl.d.ts +1 -1
- package/dist/components/PageControl/PageControl.js +1 -1
- package/dist/components/PageControl/PageControlExample.js +0 -1
- package/dist/components/PageControl/PageControlExample.js.map +1 -1
- package/dist/components/PageHeader/PageHeader.d.ts +57 -0
- package/dist/components/PageHeader/PageHeader.js +28 -0
- package/dist/components/PageHeader/PageHeader.js.map +1 -0
- package/dist/components/PageHeader/PageHeaderExample.d.ts +4 -0
- package/dist/components/PageHeader/PageHeaderExample.js +56 -0
- package/dist/components/PageHeader/PageHeaderExample.js.map +1 -0
- package/dist/components/PageHeader/index.d.ts +1 -0
- package/dist/components/PageHeader/index.js +2 -0
- package/dist/components/PageHeader/index.js.map +1 -0
- package/dist/components/PageHeader/page-header.css +35 -0
- package/dist/components/PageHeader/page-header.css.js +40 -0
- package/dist/components/Pagination/Pagination.d.ts +2 -2
- package/dist/components/Pagination/Pagination.js +8 -3
- package/dist/components/Pagination/Pagination.js.map +1 -1
- package/dist/components/Pagination/pagination.css +8 -2
- package/dist/components/Pagination/pagination.css.js +8 -2
- package/dist/components/Password/Password.d.ts +11 -16
- package/dist/components/Password/Password.js +11 -16
- package/dist/components/Password/Password.js.map +1 -1
- package/dist/components/Password/PasswordExample.d.ts +1 -0
- package/dist/components/Password/PasswordExample.js +9 -0
- package/dist/components/Password/PasswordExample.js.map +1 -1
- package/dist/components/PasswordField/PasswordField.d.ts +1 -1
- package/dist/components/PasswordField/PasswordField.js +1 -1
- package/dist/components/Popover/Popover.d.ts +1 -1
- package/dist/components/Popover/Popover.js +1 -1
- package/dist/components/Popover/PopoverExample.js +0 -1
- package/dist/components/Popover/PopoverExample.js.map +1 -1
- package/dist/components/Popover/popover.css +7 -5
- package/dist/components/Popover/popover.css.js +7 -5
- 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 +1 -1
- package/dist/components/ProgressionStepper/ProgressionStepperExample.js +0 -1
- package/dist/components/ProgressionStepper/ProgressionStepperExample.js.map +1 -1
- package/dist/components/ProgressionStepper/progression-stepper.css +5 -3
- package/dist/components/ProgressionStepper/progression-stepper.css.js +5 -3
- package/dist/components/ProgressionStepperBar/ProgressionStepperBar.d.ts +1 -1
- package/dist/components/ProgressionStepperBar/ProgressionStepperBar.js +1 -1
- package/dist/components/ProgressionStepperBar/progression-stepper-bar.css +6 -6
- package/dist/components/ProgressionStepperBar/progression-stepper-bar.css.js +7 -7
- package/dist/components/RadioGroup/RadioGroup.d.ts +1 -1
- package/dist/components/RadioGroup/RadioGroup.js +1 -1
- package/dist/components/RadioGroup/radio-group.css +1 -1
- package/dist/components/RadioGroup/radio-group.css.js +1 -1
- package/dist/components/RadioGroupField/RadioGroupField.d.ts +1 -1
- package/dist/components/RadioGroupField/RadioGroupField.js +1 -1
- package/dist/components/Rating/Rating.d.ts +3 -2
- package/dist/components/Rating/Rating.js +5 -3
- package/dist/components/Rating/Rating.js.map +1 -1
- package/dist/components/SearchBar/SearchBar.d.ts +1 -1
- package/dist/components/SearchBar/SearchBar.js +3 -4
- 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/SegmentedControl/segmented-control.css +3 -1
- package/dist/components/SegmentedControl/segmented-control.css.js +3 -1
- package/dist/components/Select/Select.d.ts +11 -24
- package/dist/components/Select/Select.js +11 -24
- package/dist/components/Select/Select.js.map +1 -1
- package/dist/components/Select/SelectExample.d.ts +1 -0
- package/dist/components/Select/SelectExample.js +18 -1
- package/dist/components/Select/SelectExample.js.map +1 -1
- package/dist/components/SelectField/SelectField.d.ts +1 -1
- package/dist/components/SelectField/SelectField.js +1 -1
- package/dist/components/Skeleton/Skeleton.d.ts +1 -1
- package/dist/components/Skeleton/Skeleton.js +1 -1
- package/dist/components/SkeletonText/SkeletonText.d.ts +1 -1
- package/dist/components/SkeletonText/SkeletonText.js +1 -1
- package/dist/components/Slider/Slider.d.ts +18 -3
- package/dist/components/Slider/Slider.js +20 -4
- package/dist/components/Slider/Slider.js.map +1 -1
- package/dist/components/Slider/SliderExample.d.ts +1 -0
- package/dist/components/Slider/SliderExample.js +7 -2
- package/dist/components/Slider/SliderExample.js.map +1 -1
- package/dist/components/Snackbar/Manager.d.ts +1 -1
- package/dist/components/Snackbar/Manager.js +1 -1
- package/dist/components/Snackbar/Snackbar.d.ts +1 -1
- package/dist/components/Snackbar/Snackbar.js +1 -1
- package/dist/components/Snackbar/SnackbarExample.js +0 -1
- package/dist/components/Snackbar/SnackbarExample.js.map +1 -1
- package/dist/components/Switch/Switch.d.ts +1 -1
- package/dist/components/Switch/Switch.js +1 -1
- package/dist/components/Switch/switch.css +11 -9
- package/dist/components/Switch/switch.css.js +11 -9
- package/dist/components/SwitchOption/SwitchOption.d.ts +1 -1
- package/dist/components/SwitchOption/SwitchOption.js +1 -1
- package/dist/components/TabGroup/TabGroup.d.ts +1 -1
- package/dist/components/TabGroup/TabGroup.js +1 -1
- package/dist/components/TabGroup/TabGroupExample.js +0 -1
- package/dist/components/TabGroup/TabGroupExample.js.map +1 -1
- package/dist/components/TabList/TabListExample.js +0 -1
- package/dist/components/TabList/TabListExample.js.map +1 -1
- package/dist/components/TabList/tab-list.css +5 -3
- package/dist/components/TabList/tab-list.css.js +5 -3
- package/dist/components/Table/Table.d.ts +2 -2
- package/dist/components/Table/Table.js +8 -8
- package/dist/components/Table/Table.js.map +1 -1
- package/dist/components/Table/TableExample.js +56 -54
- package/dist/components/Table/TableExample.js.map +1 -1
- package/dist/components/Table/utils.d.ts +2 -2
- package/dist/components/Table/utils.js +27 -22
- package/dist/components/Table/utils.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 +5 -8
- package/dist/components/Textarea/Textarea.js +5 -8
- package/dist/components/Textarea/Textarea.js.map +1 -1
- package/dist/components/Textarea/TextareaExample.d.ts +1 -0
- package/dist/components/Textarea/TextareaExample.js +12 -1
- package/dist/components/Textarea/TextareaExample.js.map +1 -1
- package/dist/components/Textarea/textarea.css +5 -3
- package/dist/components/Textarea/textarea.css.js +5 -3
- package/dist/components/TextareaField/TextareaField.d.ts +1 -1
- package/dist/components/TextareaField/TextareaField.js +1 -1
- package/dist/components/TimePicker/TimePicker.d.ts +5 -9
- package/dist/components/TimePicker/TimePicker.js +5 -9
- package/dist/components/TimePicker/TimePicker.js.map +1 -1
- package/dist/components/TimePicker/TimePickerExample.d.ts +1 -0
- package/dist/components/TimePicker/TimePickerExample.js +9 -1
- package/dist/components/TimePicker/TimePickerExample.js.map +1 -1
- package/dist/components/TimePickerField/TimePickerField.d.ts +1 -1
- package/dist/components/TimePickerField/TimePickerField.js +1 -1
- package/dist/components/Tooltip/Tooltip.d.ts +1 -1
- package/dist/components/Tooltip/Tooltip.js +2 -2
- package/dist/components/Tooltip/Tooltip.js.map +1 -1
- package/dist/components/Tooltip/tooltip.css +7 -3
- package/dist/components/Tooltip/tooltip.css.js +7 -3
- package/dist/components/Txt/Txt.d.ts +1 -1
- package/dist/components/Txt/Txt.js +1 -1
- package/dist/components/UIProvider/UIProvider.js +4 -6
- package/dist/components/UIProvider/UIProvider.js.map +1 -1
- package/dist/components/UIProvider/UIProviderExample.d.ts +0 -1
- package/dist/components/UIProvider/UIProviderExample.js +1 -46
- package/dist/components/UIProvider/UIProviderExample.js.map +1 -1
- package/dist/hooks/useControlledState.d.ts +7 -0
- package/dist/hooks/useControlledState.js +21 -0
- package/dist/hooks/useControlledState.js.map +1 -0
- package/dist/hooks/{useAddEventListener.js → useEventListener.js} +1 -1
- package/dist/hooks/useEventListener.js.map +1 -0
- package/dist/types/meta.d.ts +0 -1
- package/dist/types/meta.js +0 -7
- package/dist/types/meta.js.map +1 -1
- package/dist/utils/createCustomEvent.js +1 -1
- package/dist/utils/createCustomEvent.js.map +1 -1
- package/dist/utils/demo.d.ts +19 -2
- package/dist/utils/demo.js.map +1 -1
- package/dist/utils/dom.d.ts +1 -0
- package/dist/utils/dom.js +5 -0
- package/dist/utils/dom.js.map +1 -1
- package/dist/utils/handleKeyDown.d.ts +1 -0
- package/dist/utils/handleKeyDown.js +9 -3
- package/dist/utils/handleKeyDown.js.map +1 -1
- package/dist/utils/keyboard.d.ts +3 -1
- package/dist/utils/keyboard.js.map +1 -1
- package/dist/utils/sendAriaLiveMessage.d.ts +8 -0
- package/dist/utils/sendAriaLiveMessage.js +14 -0
- package/dist/utils/sendAriaLiveMessage.js.map +1 -0
- package/dist/utils/sizing.d.ts +3 -0
- package/dist/utils/sizing.js +28 -0
- package/dist/utils/sizing.js.map +1 -0
- package/dist/utils/uiContext.d.ts +0 -1
- package/dist/utils/uiContext.js.map +1 -1
- package/meta.ts +9 -8
- package/package.json +28 -22
- package/src/components/Accordion/Accordion.tsx +22 -20
- package/src/components/Accordion/AccordionExample.tsx +5 -4
- package/src/components/Avatar/Avatar.tsx +2 -3
- package/src/components/Avatar/avatar.scss +9 -6
- package/src/components/AvatarGroup/AvatarGroup.tsx +1 -1
- package/src/components/Badge/Badge.tsx +1 -1
- package/src/components/Badge/BadgeExample.tsx +0 -1
- package/src/components/BadgeDot/BadgeDot.tsx +1 -1
- package/src/components/BadgeDot/BadgeDotExample.tsx +0 -1
- package/src/components/BannerAlert/BannerAlert.tsx +14 -12
- package/src/components/BannerAlert/BannerAlertExample.tsx +0 -1
- package/src/components/Breadcrumb/Breadcrumb.tsx +20 -18
- package/src/components/Button/Button.tsx +36 -10
- package/src/components/Button/button.scss +13 -6
- package/src/components/Calendar/Calendar.rtl.test.tsx +1 -1
- package/src/components/Calendar/Calendar.tsx +156 -371
- package/src/components/Calendar/CalendarExample.tsx +0 -1
- package/src/components/Calendar/calendar.scss +46 -40
- package/src/components/Calendar/index.tsx +1 -0
- package/src/components/Calendar/utils.tsx +98 -0
- package/src/components/Card/Card.tsx +1 -1
- package/src/components/Carousel/Carousel.tsx +8 -8
- package/src/components/Carousel/carousel.scss +0 -1
- package/src/components/Checkbox/Checkbox.tsx +1 -1
- package/src/components/CheckboxGroup/CheckboxGroup.tsx +1 -1
- package/src/components/CheckboxGroupField/CheckboxGroupField.tsx +1 -1
- package/src/components/CheckboxOption/CheckboxOption.tsx +1 -1
- package/src/components/Chip/Chip.tsx +1 -1
- package/src/components/ChipGroup/ChipGroup.rtl.test.tsx +16 -11
- package/src/components/ChipGroup/ChipGroup.tsx +19 -37
- package/src/components/ChipGroup/ChipGroupExample.tsx +64 -36
- package/src/components/ChipGroup/chip-group.scss +5 -3
- package/src/components/DatePicker/DatePicker.rtl.test.tsx +1 -1
- package/src/components/DatePicker/DatePicker.tsx +51 -106
- package/src/components/DatePicker/DatePickerExample.tsx +20 -3
- package/src/components/DatePicker/date-picker.scss +11 -0
- package/src/components/DatePickerField/DatePickerField.tsx +1 -1
- package/src/components/Divider/Divider.tsx +4 -4
- package/src/components/Divider/DividerExample.tsx +22 -23
- package/src/components/Drawer/Drawer.tsx +9 -16
- package/src/components/Drawer/DrawerExample.tsx +28 -4
- package/src/components/Drawer/drawer.scss +7 -0
- package/src/components/EmptyState/EmptyState.rtl.test.tsx +1 -1
- package/src/components/EmptyState/EmptyState.tsx +14 -21
- package/src/components/EmptyState/EmptyStateExample.tsx +5 -5
- package/src/components/ExamplePlaceholder/ExamplePlaceholder.tsx +17 -22
- package/src/components/Fab/Fab.tsx +10 -7
- package/src/components/Fab/FabExample.tsx +10 -1
- package/src/components/FileUpload/FileUpload.tsx +1 -1
- package/src/components/FileUploadItem/FileUploadItem.tsx +1 -1
- package/src/components/{Layout/Layout.rtl.test.tsx → Flex/Flex.rtl.test.tsx} +3 -3
- package/src/components/Flex/Flex.tsx +100 -0
- package/src/components/Flex/FlexExample.tsx +27 -0
- package/src/components/Flex/index.tsx +1 -0
- package/src/components/FormField/FormFieldExample.tsx +1 -2
- package/src/components/Grid/Grid.rtl.test.tsx +19 -0
- package/src/components/Grid/Grid.tsx +75 -0
- package/src/components/Grid/GridExample.tsx +42 -0
- package/src/components/Grid/index.tsx +1 -0
- package/src/components/InlineAlert/InlineAlert.tsx +1 -1
- package/src/components/Input/Input.tsx +5 -9
- package/src/components/Input/InputElement.tsx +4 -7
- package/src/components/Input/InputExample.tsx +19 -1
- package/src/components/Input/input.scss +9 -1
- package/src/components/InputField/InputField.tsx +1 -1
- package/src/components/InputNumber/InputNumber.tsx +6 -15
- package/src/components/InputNumber/InputNumberExample.tsx +24 -1
- package/src/components/InputNumberField/InputNumberField.tsx +1 -1
- package/src/components/InputPhone/InputPhone.tsx +18 -17
- package/src/components/InputPhone/InputPhoneExample.tsx +27 -2
- package/src/components/InputPhoneField/InputPhoneField.tsx +1 -1
- package/src/components/Link/Link.tsx +1 -1
- package/src/components/ListItem/ListItem.tsx +1 -1
- package/src/components/Menu/Menu.tsx +1 -3
- package/src/components/Modal/Modal.tsx +2 -4
- package/src/components/OTPInput/OTPInput.rtl.test.tsx +4 -2
- package/src/components/OTPInput/OTPInput.tsx +31 -64
- package/src/components/OTPInput/OTPInputExample.tsx +6 -2
- package/src/components/OTPInput/otp-input.scss +50 -45
- package/src/components/PageControl/PageControl.tsx +1 -1
- package/src/components/PageControl/PageControlExample.tsx +0 -1
- package/src/components/PageHeader/PageHeader.rtl.test.tsx +18 -0
- package/src/components/PageHeader/PageHeader.tsx +78 -0
- package/src/components/PageHeader/PageHeaderExample.tsx +58 -0
- package/src/components/PageHeader/index.tsx +1 -0
- package/src/components/PageHeader/page-header.scss +41 -0
- package/src/components/Pagination/Pagination.tsx +14 -3
- package/src/components/Pagination/pagination.scss +12 -5
- package/src/components/Password/Password.tsx +11 -16
- package/src/components/Password/PasswordExample.tsx +18 -1
- package/src/components/PasswordField/PasswordField.tsx +1 -1
- package/src/components/Popover/Popover.tsx +1 -1
- package/src/components/Popover/PopoverExample.tsx +0 -1
- package/src/components/ProgressBar/ProgressBar.tsx +1 -1
- package/src/components/ProgressCircle/ProgressCircle.tsx +1 -1
- package/src/components/ProgressionStepper/ProgressionStepper.tsx +1 -1
- package/src/components/ProgressionStepper/ProgressionStepperExample.tsx +0 -1
- package/src/components/ProgressionStepperBar/ProgressionStepperBar.tsx +1 -1
- package/src/components/RadioGroup/RadioGroup.tsx +1 -1
- package/src/components/RadioGroupField/RadioGroupField.tsx +1 -1
- package/src/components/Rating/Rating.tsx +7 -3
- package/src/components/SearchBar/SearchBar.tsx +3 -5
- package/src/components/SegmentedControl/SegmentedControl.tsx +1 -1
- package/src/components/Select/Select.tsx +11 -24
- package/src/components/Select/SelectExample.tsx +36 -1
- package/src/components/SelectField/SelectField.tsx +1 -1
- package/src/components/Skeleton/Skeleton.tsx +1 -1
- package/src/components/SkeletonText/SkeletonText.tsx +1 -1
- package/src/components/Slider/Slider.tsx +21 -4
- package/src/components/Slider/SliderExample.tsx +16 -2
- package/src/components/Snackbar/Manager.tsx +1 -1
- package/src/components/Snackbar/Snackbar.tsx +1 -1
- package/src/components/Snackbar/SnackbarExample.tsx +0 -1
- package/src/components/Switch/Switch.tsx +1 -1
- package/src/components/SwitchOption/SwitchOption.tsx +1 -1
- package/src/components/TabGroup/TabGroup.tsx +1 -1
- package/src/components/TabGroup/TabGroupExample.tsx +0 -1
- package/src/components/TabList/TabListExample.tsx +0 -1
- package/src/components/Table/Table.tsx +11 -16
- package/src/components/Table/TableExample.tsx +56 -54
- package/src/components/Table/utils.ts +31 -20
- package/src/components/Tag/Tag.tsx +1 -1
- package/src/components/Textarea/Textarea.tsx +5 -8
- package/src/components/Textarea/TextareaExample.tsx +21 -1
- package/src/components/TextareaField/TextareaField.tsx +1 -1
- package/src/components/TimePicker/TimePicker.tsx +5 -9
- package/src/components/TimePicker/TimePickerExample.tsx +18 -1
- package/src/components/TimePickerField/TimePickerField.tsx +1 -1
- package/src/components/Tooltip/Tooltip.tsx +2 -2
- package/src/components/Tooltip/tooltip.scss +2 -0
- package/src/components/Txt/Txt.tsx +1 -1
- package/src/components/UIProvider/UIProvider.tsx +1 -4
- package/src/components/UIProvider/UIProviderExample.tsx +0 -83
- package/src/hooks/useControlledState.ts +31 -0
- package/src/types/meta.ts +0 -8
- package/src/utils/createCustomEvent.ts +1 -1
- package/src/utils/demo.ts +19 -2
- package/src/utils/dom.ts +8 -0
- package/src/utils/handleKeyDown.ts +9 -3
- package/src/utils/keyboard.ts +5 -2
- package/src/utils/sendAriaLiveMessage.ts +17 -0
- package/src/utils/sizing.ts +30 -0
- package/src/utils/uiContext.ts +0 -1
- package/.scripts/index.ts +0 -110
- package/dist/components/Layout/Layout.d.ts +0 -50
- package/dist/components/Layout/Layout.js +0 -28
- package/dist/components/Layout/Layout.js.map +0 -1
- package/dist/components/Layout/LayoutExample.d.ts +0 -4
- package/dist/components/Layout/LayoutExample.js +0 -9
- package/dist/components/Layout/LayoutExample.js.map +0 -1
- package/dist/components/Layout/index.d.ts +0 -1
- package/dist/components/Layout/index.js +0 -2
- package/dist/components/Layout/index.js.map +0 -1
- package/dist/components/UIProvider/AriaLiveMessageHandler.d.ts +0 -13
- package/dist/components/UIProvider/AriaLiveMessageHandler.js +0 -31
- package/dist/components/UIProvider/AriaLiveMessageHandler.js.map +0 -1
- package/dist/hooks/useAddEventListener.js.map +0 -1
- package/src/components/Layout/Layout.tsx +0 -85
- package/src/components/Layout/LayoutExample.tsx +0 -17
- package/src/components/Layout/index.tsx +0 -1
- package/src/components/UIProvider/AriaLiveMessageHandler.tsx +0 -46
- /package/dist/hooks/{useAddEventListener.d.ts → useEventListener.d.ts} +0 -0
- /package/src/hooks/{useAddEventListener.ts → useEventListener.ts} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
2
|
|
|
3
3
|
import { Txt } from '-/components/Txt';
|
|
4
4
|
import { ElementProps } from '-/types/common';
|
|
@@ -6,12 +6,6 @@ import { ElementProps } from '-/types/common';
|
|
|
6
6
|
const dimension = (value: number | string) => (typeof value === 'number' ? `${value}px` : `${value}`);
|
|
7
7
|
|
|
8
8
|
export type ExamplePlaceholderProps = {
|
|
9
|
-
/**
|
|
10
|
-
* Whether to hide the size text.
|
|
11
|
-
*
|
|
12
|
-
* @default false
|
|
13
|
-
*/
|
|
14
|
-
hideSize?: boolean;
|
|
15
9
|
/**
|
|
16
10
|
* The height of the placeholder.
|
|
17
11
|
*
|
|
@@ -26,12 +20,10 @@ export type ExamplePlaceholderProps = {
|
|
|
26
20
|
* @type string
|
|
27
21
|
*/
|
|
28
22
|
width?: number | string;
|
|
29
|
-
/**
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
*/
|
|
34
|
-
direction?: 'column' | 'row';
|
|
23
|
+
/** An optional label for the placeholder. */
|
|
24
|
+
label?: string;
|
|
25
|
+
/** Optional children to display inside the placeholder instead of the label. */
|
|
26
|
+
children?: ReactNode;
|
|
35
27
|
};
|
|
36
28
|
|
|
37
29
|
/**
|
|
@@ -41,28 +33,31 @@ export type ExamplePlaceholderProps = {
|
|
|
41
33
|
* @phase Utility
|
|
42
34
|
*/
|
|
43
35
|
export function ExamplePlaceholder({
|
|
44
|
-
hideSize = false,
|
|
45
36
|
height = 100,
|
|
46
37
|
width = '100%',
|
|
47
|
-
|
|
38
|
+
label,
|
|
39
|
+
children,
|
|
48
40
|
...props
|
|
49
41
|
}: ElementProps<ExamplePlaceholderProps, 'div'>) {
|
|
50
|
-
const ref = useRef<HTMLDivElement | null>(null);
|
|
51
|
-
|
|
52
42
|
return (
|
|
53
43
|
<div
|
|
54
44
|
{...props}
|
|
55
45
|
data-bspk-utility="example-placeholder"
|
|
56
|
-
data-example-placeholder
|
|
57
|
-
ref={ref}
|
|
58
46
|
style={{
|
|
59
|
-
|
|
47
|
+
flexDirection: 'column',
|
|
48
|
+
gap: 'var(--spacing-sizing-01)',
|
|
60
49
|
width: dimension(width),
|
|
61
50
|
height: dimension(height),
|
|
62
|
-
|
|
51
|
+
background: 'var(--surface-neutral-t3-low)',
|
|
52
|
+
display: 'flex',
|
|
53
|
+
alignItems: 'center',
|
|
54
|
+
justifyContent: 'center',
|
|
55
|
+
textAlign: 'center',
|
|
56
|
+
font: 'var(--body-x-small)',
|
|
57
|
+
...props.style,
|
|
63
58
|
}}
|
|
64
59
|
>
|
|
65
|
-
{
|
|
60
|
+
{children || label || (
|
|
66
61
|
<>
|
|
67
62
|
<Txt variant="labels-large">{dimension(width)}</Txt>
|
|
68
63
|
<Txt>×</Txt>
|
|
@@ -10,7 +10,7 @@ export type FabVariant = 'neutral' | 'primary' | 'secondary';
|
|
|
10
10
|
|
|
11
11
|
export type FabProps<As extends ElementType = ElementType> = Pick<
|
|
12
12
|
ButtonProps<As>,
|
|
13
|
-
'as' | 'icon' | 'iconOnly' | 'innerRef' | 'onClick' | '
|
|
13
|
+
'aria-label' | 'as' | 'icon' | 'iconOnly' | 'innerRef' | 'onClick' | 'tooltip'
|
|
14
14
|
> &
|
|
15
15
|
Required<Pick<ButtonProps<As>, 'label'>> & {
|
|
16
16
|
/**
|
|
@@ -47,13 +47,16 @@ export type FabProps<As extends ElementType = ElementType> = Pick<
|
|
|
47
47
|
* import { SvgBolt } from '@bspk/icons/Bolt';
|
|
48
48
|
* import { Fab } from '@bspk/ui/Fab';
|
|
49
49
|
*
|
|
50
|
-
* <
|
|
50
|
+
* <div style={{ width: '100%', height: 100 }}>
|
|
51
|
+
* <Fab icon={<SvgBolt />} label="Example label" placement="bottom-right" variant="neutral" />
|
|
52
|
+
* </div>;
|
|
51
53
|
*
|
|
52
54
|
* @name Fab
|
|
53
|
-
* @phase
|
|
55
|
+
* @phase Stable
|
|
54
56
|
*/
|
|
55
57
|
export function Fab<As extends ElementType = ElementType>(props: AriaAttributes & ElementProps<FabProps<As>, As>) {
|
|
56
58
|
const {
|
|
59
|
+
'aria-label': ariaLabel,
|
|
57
60
|
size = 'small',
|
|
58
61
|
variant = 'primary',
|
|
59
62
|
iconOnly: iconOnlyProp = false,
|
|
@@ -62,7 +65,7 @@ export function Fab<As extends ElementType = ElementType>(props: AriaAttributes
|
|
|
62
65
|
container = 'local',
|
|
63
66
|
label,
|
|
64
67
|
icon,
|
|
65
|
-
|
|
68
|
+
tooltip,
|
|
66
69
|
innerRef,
|
|
67
70
|
...otherProps
|
|
68
71
|
} = props;
|
|
@@ -74,7 +77,7 @@ export function Fab<As extends ElementType = ElementType>(props: AriaAttributes
|
|
|
74
77
|
<As
|
|
75
78
|
{...otherProps}
|
|
76
79
|
{...triggerProps}
|
|
77
|
-
aria-label={label}
|
|
80
|
+
aria-label={ariaLabel || label}
|
|
78
81
|
data-bspk="fab"
|
|
79
82
|
data-container={container}
|
|
80
83
|
data-placement={placement}
|
|
@@ -109,9 +112,9 @@ export function Fab<As extends ElementType = ElementType>(props: AriaAttributes
|
|
|
109
112
|
</As>
|
|
110
113
|
);
|
|
111
114
|
|
|
112
|
-
if (
|
|
115
|
+
if (tooltip || iconOnly)
|
|
113
116
|
return (
|
|
114
|
-
<Tooltip label={
|
|
117
|
+
<Tooltip label={tooltip || label} placement="top">
|
|
115
118
|
{button}
|
|
116
119
|
</Tooltip>
|
|
117
120
|
);
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { SvgBolt } from '@bspk/icons/Bolt';
|
|
2
|
+
import { Fab, FabProps } from './Fab';
|
|
2
3
|
import { ButtonExample } from '-/components/Button/ButtonExample';
|
|
3
4
|
import { ComponentExample } from '-/utils/demo';
|
|
4
5
|
|
|
@@ -27,3 +28,11 @@ export const FabExample: ComponentExample<FabProps> = {
|
|
|
27
28
|
},
|
|
28
29
|
},
|
|
29
30
|
};
|
|
31
|
+
|
|
32
|
+
export const Usage = () => {
|
|
33
|
+
return (
|
|
34
|
+
<div style={{ width: '100%', height: 100 }}>
|
|
35
|
+
<Fab icon={<SvgBolt />} label="Example label" placement="bottom-right" variant="neutral" />
|
|
36
|
+
</div>
|
|
37
|
+
);
|
|
38
|
+
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Flex } from './Flex';
|
|
2
2
|
import { hasNoBasicA11yIssues } from '-/rtl/hasNoBasicA11yIssues';
|
|
3
3
|
import { render } from '-/rtl/util';
|
|
4
4
|
|
|
5
|
-
const TestBed = () => <
|
|
5
|
+
const TestBed = () => <Flex>Example layout</Flex>;
|
|
6
6
|
|
|
7
|
-
describe('
|
|
7
|
+
describe('Flex (RTL)', () => {
|
|
8
8
|
it('has no basic a11y issues', hasNoBasicA11yIssues(<TestBed />));
|
|
9
9
|
|
|
10
10
|
it('renders', () => {
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { CSSProperties, ElementType, ReactNode } from 'react';
|
|
2
|
+
import { ElementProps } from '-/types/common';
|
|
3
|
+
import { SizingPixels, numToSizingVar } from '-/utils/sizing';
|
|
4
|
+
|
|
5
|
+
export type FlexProps<As extends ElementType = ElementType> = {
|
|
6
|
+
/**
|
|
7
|
+
* The content of the Flex.
|
|
8
|
+
*
|
|
9
|
+
* @required
|
|
10
|
+
*/
|
|
11
|
+
children?: ReactNode;
|
|
12
|
+
/** The gap between the children. */
|
|
13
|
+
gap?: SizingPixels | 'auto';
|
|
14
|
+
/**
|
|
15
|
+
* The element type to render as.
|
|
16
|
+
*
|
|
17
|
+
* @default div
|
|
18
|
+
* @type ElementType
|
|
19
|
+
*/
|
|
20
|
+
as?: As;
|
|
21
|
+
/**
|
|
22
|
+
* The align-items style to apply to the Flex.
|
|
23
|
+
*
|
|
24
|
+
* @default flex-start
|
|
25
|
+
*/
|
|
26
|
+
align?: CSSProperties['alignItems'] | 'end' | 'start';
|
|
27
|
+
/**
|
|
28
|
+
* The justification style to apply to the Flex.
|
|
29
|
+
*
|
|
30
|
+
* @default flex-start
|
|
31
|
+
*/
|
|
32
|
+
justify?: CSSProperties['justifyContent'];
|
|
33
|
+
/** The flex-wrap style to apply to the Flex. */
|
|
34
|
+
wrap?: CSSProperties['flexWrap'];
|
|
35
|
+
/** The flex-direction style to apply to the Flex. */
|
|
36
|
+
direction?: 'column-reverse' | 'column' | 'row-reverse' | 'row';
|
|
37
|
+
/** The padding to apply to the Flex. */
|
|
38
|
+
padding?: SizingPixels | SizingPixels[];
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Utility component used within other components for layout purposes.
|
|
43
|
+
*
|
|
44
|
+
* @example
|
|
45
|
+
* import { Flex } from '@bspk/ui/Flex';
|
|
46
|
+
*
|
|
47
|
+
* <Flex gap="24" justify="center" style={{ width: '100%' }}>
|
|
48
|
+
* <div>Alpha</div>
|
|
49
|
+
* <div>Beta</div>
|
|
50
|
+
* <div>Gamma</div>
|
|
51
|
+
* </Flex>;
|
|
52
|
+
*
|
|
53
|
+
* @name Flex
|
|
54
|
+
* @phase Utility
|
|
55
|
+
*/
|
|
56
|
+
export function Flex<As extends ElementType = ElementType>({
|
|
57
|
+
children,
|
|
58
|
+
gap,
|
|
59
|
+
style,
|
|
60
|
+
as,
|
|
61
|
+
align = 'flex-start',
|
|
62
|
+
justify = 'flex-start',
|
|
63
|
+
wrap,
|
|
64
|
+
direction = 'row',
|
|
65
|
+
padding,
|
|
66
|
+
...props
|
|
67
|
+
}: ElementProps<FlexProps<As>, As>) {
|
|
68
|
+
const As: ElementType = as || 'div';
|
|
69
|
+
|
|
70
|
+
const alignItems = align === 'start' ? 'flex-start' : align === 'end' ? 'flex-end' : align;
|
|
71
|
+
|
|
72
|
+
const paddingValue = getPaddingValue(padding);
|
|
73
|
+
|
|
74
|
+
return (
|
|
75
|
+
<As
|
|
76
|
+
{...props}
|
|
77
|
+
data-bspk-utility="flex"
|
|
78
|
+
style={{
|
|
79
|
+
display: 'flex',
|
|
80
|
+
flexDirection: direction,
|
|
81
|
+
gap: numToSizingVar(gap),
|
|
82
|
+
alignItems,
|
|
83
|
+
justifyContent: justify || 'flex-start',
|
|
84
|
+
flexWrap: wrap ? 'wrap' : 'nowrap',
|
|
85
|
+
padding: paddingValue,
|
|
86
|
+
...style,
|
|
87
|
+
}}
|
|
88
|
+
>
|
|
89
|
+
{children}
|
|
90
|
+
</As>
|
|
91
|
+
);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
function getPaddingValue(padding?: SizingPixels | SizingPixels[]): string | undefined {
|
|
95
|
+
if (!padding) return undefined;
|
|
96
|
+
|
|
97
|
+
return (!Array.isArray(padding) ? [padding] : padding).map((p) => numToSizingVar(p)).join(' ');
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/** Copyright 2025 Anywhere Real Estate - CC BY 4.0 */
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Flex, FlexProps } from './Flex';
|
|
2
|
+
import { ComponentExample, Preset } from '-/utils/demo';
|
|
3
|
+
|
|
4
|
+
export const presets: Preset<FlexProps>[] = [];
|
|
5
|
+
|
|
6
|
+
export const FlexExample: ComponentExample<FlexProps> = {
|
|
7
|
+
render: ({ props, Component }) => {
|
|
8
|
+
return (
|
|
9
|
+
<Component {...props}>
|
|
10
|
+
<div>Alpha</div>
|
|
11
|
+
<div>Beta</div>
|
|
12
|
+
<div>Gamma</div>
|
|
13
|
+
</Component>
|
|
14
|
+
);
|
|
15
|
+
},
|
|
16
|
+
presets,
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export const Usage = () => {
|
|
20
|
+
return (
|
|
21
|
+
<Flex gap="24" justify="center" style={{ width: '100%' }}>
|
|
22
|
+
<div>Alpha</div>
|
|
23
|
+
<div>Beta</div>
|
|
24
|
+
<div>Gamma</div>
|
|
25
|
+
</Flex>
|
|
26
|
+
);
|
|
27
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Flex';
|
|
@@ -25,7 +25,6 @@ export const presets: Preset<Partial<ExampleProps>>[] = [
|
|
|
25
25
|
];
|
|
26
26
|
|
|
27
27
|
export const FormFieldExample: ComponentExample<ExampleProps> = {
|
|
28
|
-
containerStyle: { width: '100%' },
|
|
29
28
|
defaultState: {},
|
|
30
29
|
disableProps: [],
|
|
31
30
|
presets: presets as Preset<ExampleProps>[],
|
|
@@ -184,7 +183,7 @@ export function FormFieldExampleRender({ ...props }: ExampleProps & { syntax?: S
|
|
|
184
183
|
onChange={(next) => setValue({ 'date-picker': next })}
|
|
185
184
|
placeholder="Example input"
|
|
186
185
|
required={required}
|
|
187
|
-
value={value['date-picker'] as
|
|
186
|
+
value={value['date-picker'] as string}
|
|
188
187
|
/>
|
|
189
188
|
</FormField>
|
|
190
189
|
<FormField {...props} {...internalProps('Input')}>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Grid } from './Grid';
|
|
2
|
+
import { GridExample } from './GridExample';
|
|
3
|
+
|
|
4
|
+
import { hasNoBasicA11yIssues } from '-/rtl/hasNoBasicA11yIssues';
|
|
5
|
+
import { render } from '-/rtl/util';
|
|
6
|
+
|
|
7
|
+
const testBed = () => <Grid {...GridExample.defaultState}>{GridExample.defaultState?.children}</Grid>;
|
|
8
|
+
|
|
9
|
+
describe('Grid (RTL)', () => {
|
|
10
|
+
it(`has no basic a11y issues - ${GridExample.defaultState}`, hasNoBasicA11yIssues(testBed()));
|
|
11
|
+
|
|
12
|
+
it('renders', () => {
|
|
13
|
+
const { getByText } = render(testBed());
|
|
14
|
+
expect(getByText('Cell 1')).toBeInTheDocument();
|
|
15
|
+
expect(getByText('Cell 2')).toBeInTheDocument();
|
|
16
|
+
});
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
/** Copyright 2025 Anywhere Real Estate - CC BY 4.0 */
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { SizingPixels, numToSizingVar } from '-/utils/sizing';
|
|
3
|
+
|
|
4
|
+
export type GridProps = {
|
|
5
|
+
/**
|
|
6
|
+
* The content of the grid.
|
|
7
|
+
*
|
|
8
|
+
* @required
|
|
9
|
+
*/
|
|
10
|
+
children: ReactNode;
|
|
11
|
+
/**
|
|
12
|
+
* The number of columns in the grid or an array of column widths in fractions or other CSS units.
|
|
13
|
+
*
|
|
14
|
+
* Values may be "100px, auto, 2fr, 20%" for four columns with specific widths.
|
|
15
|
+
*
|
|
16
|
+
* @default 1
|
|
17
|
+
*
|
|
18
|
+
* @exampleType string
|
|
19
|
+
*/
|
|
20
|
+
columns?: (number | string)[] | number;
|
|
21
|
+
/** The gap between the children. */
|
|
22
|
+
gap?: SizingPixels;
|
|
23
|
+
/** Additional styles for the grid container. */
|
|
24
|
+
style?: React.CSSProperties;
|
|
25
|
+
/**
|
|
26
|
+
* The minimum width of each column.
|
|
27
|
+
*
|
|
28
|
+
* @default auto
|
|
29
|
+
*/
|
|
30
|
+
minColumnWidth?: string;
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* A utility component that arranges its children in a grid layout.
|
|
35
|
+
*
|
|
36
|
+
* @example
|
|
37
|
+
* import { Grid } from '@bspk/ui/Grid';
|
|
38
|
+
*
|
|
39
|
+
* <Grid columns={4} gap="8">
|
|
40
|
+
* <ExamplePlaceholder label="Cell 1" />
|
|
41
|
+
* <ExamplePlaceholder label="Cell 2" />
|
|
42
|
+
* <ExamplePlaceholder label="Cell 3" />
|
|
43
|
+
* <ExamplePlaceholder label="Cell 4" />
|
|
44
|
+
* </Grid>;
|
|
45
|
+
*
|
|
46
|
+
* @name Grid
|
|
47
|
+
* @phase Utility
|
|
48
|
+
*/
|
|
49
|
+
export function Grid({ columns = 1, children, gap, style, minColumnWidth = 'auto' }: GridProps) {
|
|
50
|
+
let gridTemplateColumns = `repeat(auto-fit, minmax(${minColumnWidth}, 1fr))`;
|
|
51
|
+
|
|
52
|
+
// If columns is an array, map it to a string of fractions
|
|
53
|
+
if (Array.isArray(columns))
|
|
54
|
+
gridTemplateColumns =
|
|
55
|
+
columns?.map((width) => (typeof width === 'string' ? width : `${width}fr`)).join(' ') || 'auto';
|
|
56
|
+
// If columns is not an array, use the default repeat pattern
|
|
57
|
+
else gridTemplateColumns = `repeat(${columns}, minmax(${minColumnWidth}, 1fr))`;
|
|
58
|
+
|
|
59
|
+
return (
|
|
60
|
+
<div
|
|
61
|
+
data-bspk-utility="grid"
|
|
62
|
+
style={{
|
|
63
|
+
width: '100%',
|
|
64
|
+
display: 'grid',
|
|
65
|
+
gridTemplateColumns,
|
|
66
|
+
gap: numToSizingVar(gap),
|
|
67
|
+
...style,
|
|
68
|
+
}}
|
|
69
|
+
>
|
|
70
|
+
{children}
|
|
71
|
+
</div>
|
|
72
|
+
);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/** Copyright 2025 Anywhere Real Estate - CC BY 4.0 */
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { GridProps } from '.';
|
|
2
|
+
import { ExamplePlaceholder } from '-/components/ExamplePlaceholder';
|
|
3
|
+
import { ComponentExample } from '-/utils/demo';
|
|
4
|
+
|
|
5
|
+
export const GridExample: ComponentExample<GridProps> = {
|
|
6
|
+
defaultState: {
|
|
7
|
+
children: (
|
|
8
|
+
<>
|
|
9
|
+
<div>Cell 1</div>
|
|
10
|
+
<div>Cell 2</div>
|
|
11
|
+
</>
|
|
12
|
+
),
|
|
13
|
+
columns: [1, 2],
|
|
14
|
+
},
|
|
15
|
+
render: ({ Component, props }) => {
|
|
16
|
+
const columns = convertColumns(`${props.columns}`);
|
|
17
|
+
|
|
18
|
+
return (
|
|
19
|
+
<Component {...props} columns={columns.value}>
|
|
20
|
+
{[...Array(columns.count)].map((_, index) => (
|
|
21
|
+
<ExamplePlaceholder key={index}>Cell {index + 1}</ExamplePlaceholder>
|
|
22
|
+
))}
|
|
23
|
+
</Component>
|
|
24
|
+
);
|
|
25
|
+
},
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
const convertColumns = (columns: string): { value: (number | string)[] | number; count: number } => {
|
|
29
|
+
let value: (number | string)[] | number = 1;
|
|
30
|
+
|
|
31
|
+
if (columns.includes(','))
|
|
32
|
+
value = columns
|
|
33
|
+
.split(',')
|
|
34
|
+
.filter((col) => !!col.trim())
|
|
35
|
+
.map((col) => {
|
|
36
|
+
if (/^\d+$/.test(col.trim())) return parseInt(col.trim(), 10) || 1;
|
|
37
|
+
return col.trim();
|
|
38
|
+
});
|
|
39
|
+
else value = parseInt(columns, 10) || 1;
|
|
40
|
+
|
|
41
|
+
return { value, count: Array.isArray(value) ? value.length : value };
|
|
42
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Grid';
|
|
@@ -35,7 +35,7 @@ export type InlineAlertProps = CommonProps<'owner'> & {
|
|
|
35
35
|
* <InlineAlert variant="informational">Example informational inline alert</InlineAlert>;
|
|
36
36
|
*
|
|
37
37
|
* @name InlineAlert
|
|
38
|
-
* @phase
|
|
38
|
+
* @phase Stable
|
|
39
39
|
*/
|
|
40
40
|
export function InlineAlert({ children, variant = 'informational', id, owner }: InlineAlertProps) {
|
|
41
41
|
return (
|
|
@@ -13,23 +13,19 @@ export type InputProps = Omit<InputElementProps, 'ariaDescribedBy' | 'ariaErrorM
|
|
|
13
13
|
* @example
|
|
14
14
|
* import { useState } from 'react';
|
|
15
15
|
* import { Input } from '@bspk/ui/Input';
|
|
16
|
-
* import { Field, FieldLabel } from '@bspk/ui/Field';
|
|
16
|
+
* import { Field, FieldLabel, FieldDescription } from '@bspk/ui/Field';
|
|
17
17
|
*
|
|
18
18
|
* () => {
|
|
19
|
-
* const [
|
|
19
|
+
* const [fieldDate, setFieldDate] = useState<string>();
|
|
20
20
|
*
|
|
21
21
|
* return (
|
|
22
|
-
*
|
|
23
|
-
* // standalone input example
|
|
24
|
-
* <Input aria-label="Example Input" name="example-name" onChange={setValue} value={value} />
|
|
25
|
-
* <br />
|
|
26
|
-
* // input used within a field
|
|
22
|
+
* <div style={{ width: 320 }}>
|
|
27
23
|
* <Field>
|
|
28
24
|
* <FieldLabel>Example Label</FieldLabel>
|
|
29
|
-
* <Input name="example-name" onChange={
|
|
25
|
+
* <Input name="example-name" onChange={setFieldDate} value={fieldDate} />
|
|
30
26
|
* <FieldDescription>This is an example input field.</FieldDescription>
|
|
31
27
|
* </Field>
|
|
32
|
-
*
|
|
28
|
+
* </div>
|
|
33
29
|
* );
|
|
34
30
|
* };
|
|
35
31
|
*
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import './input.scss';
|
|
2
2
|
import { SvgCancel } from '@bspk/icons/Cancel';
|
|
3
|
-
import { HTMLInputTypeAttribute, ReactNode, useMemo, useRef
|
|
3
|
+
import { HTMLInputTypeAttribute, ReactNode, useMemo, useRef } from 'react';
|
|
4
4
|
import { Button } from '-/components/Button';
|
|
5
5
|
import { FieldContextProps } from '-/components/Field';
|
|
6
6
|
import { useTimeout } from '-/hooks/useTimeout';
|
|
@@ -112,11 +112,9 @@ export function InputElement({
|
|
|
112
112
|
ariaErrorMessage,
|
|
113
113
|
...props
|
|
114
114
|
}: ElementProps<InputElementProps, 'div'>) {
|
|
115
|
-
const [focused, setFocused] = useState(false);
|
|
116
|
-
|
|
117
115
|
const showClearButton = useMemo(
|
|
118
|
-
() =>
|
|
119
|
-
[showClearButtonProp, readOnly, disabled, value
|
|
116
|
+
() => showClearButtonProp !== false && !readOnly && !disabled && !!value?.toString().length,
|
|
117
|
+
[showClearButtonProp, readOnly, disabled, value],
|
|
120
118
|
);
|
|
121
119
|
|
|
122
120
|
const inputRefInternal = useRef<HTMLInputElement | null>(null);
|
|
@@ -150,14 +148,12 @@ export function InputElement({
|
|
|
150
148
|
id={id}
|
|
151
149
|
name={name}
|
|
152
150
|
onBlur={(event) => {
|
|
153
|
-
focusTimeout.set(() => setFocused(false), 750);
|
|
154
151
|
inputProps?.onBlur?.(event);
|
|
155
152
|
}}
|
|
156
153
|
onChange={(event) => {
|
|
157
154
|
onChange(event.target.value, event);
|
|
158
155
|
}}
|
|
159
156
|
onFocus={(event) => {
|
|
160
|
-
focusTimeout.set(() => setFocused(true), 0);
|
|
161
157
|
inputProps?.onFocus?.(event);
|
|
162
158
|
}}
|
|
163
159
|
placeholder={placeholder || ' '}
|
|
@@ -174,6 +170,7 @@ export function InputElement({
|
|
|
174
170
|
{trailing && <span data-trailing>{trailing}</span>}
|
|
175
171
|
{showClearButton && (
|
|
176
172
|
<Button
|
|
173
|
+
data-clear-button
|
|
177
174
|
icon={<SvgCancel />}
|
|
178
175
|
iconOnly
|
|
179
176
|
label="Clear"
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { useState } from 'react';
|
|
2
|
+
import { Input, InputProps } from '.';
|
|
3
|
+
import { Field, FieldLabel, FieldDescription } from '-/components/Field';
|
|
2
4
|
import { ComponentExample } from '-/utils/demo';
|
|
3
5
|
|
|
4
6
|
export type InputExampleProps = InputProps & { label: string; description?: string };
|
|
5
7
|
|
|
6
8
|
export const InputExample: ComponentExample<InputExampleProps> = {
|
|
9
|
+
containerStyle: { width: 320, padding: 0 },
|
|
7
10
|
defaultState: {
|
|
8
11
|
label: 'Property Description',
|
|
9
12
|
'aria-label': 'input aria-label',
|
|
@@ -55,4 +58,19 @@ export const InputExample: ComponentExample<InputExampleProps> = {
|
|
|
55
58
|
variants: {
|
|
56
59
|
type: false,
|
|
57
60
|
},
|
|
61
|
+
sections: [],
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
export const Usage = () => {
|
|
65
|
+
const [fieldDate, setFieldDate] = useState<string>();
|
|
66
|
+
|
|
67
|
+
return (
|
|
68
|
+
<div style={{ width: 320 }}>
|
|
69
|
+
<Field>
|
|
70
|
+
<FieldLabel>Example Label</FieldLabel>
|
|
71
|
+
<Input name="example-name" onChange={setFieldDate} value={fieldDate} />
|
|
72
|
+
<FieldDescription>This is an example input field.</FieldDescription>
|
|
73
|
+
</Field>
|
|
74
|
+
</div>
|
|
75
|
+
);
|
|
58
76
|
};
|
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
|
|
4
4
|
display: flex;
|
|
5
5
|
flex-flow: row nowrap;
|
|
6
|
+
justify-content: center;
|
|
7
|
+
align-items: center;
|
|
6
8
|
background-color: var(--surface-neutral-t1-base);
|
|
7
9
|
border: solid 1px var(--border-color);
|
|
8
10
|
height: var(--field-height);
|
|
@@ -11,7 +13,7 @@
|
|
|
11
13
|
gap: var(--spacing-sizing-01);
|
|
12
14
|
width: 100%;
|
|
13
15
|
|
|
14
|
-
&[data-show-clear-button] {
|
|
16
|
+
&[data-show-clear-button]:focus-within {
|
|
15
17
|
padding-right: 0;
|
|
16
18
|
}
|
|
17
19
|
|
|
@@ -62,6 +64,12 @@
|
|
|
62
64
|
--border-color: var(--status-error);
|
|
63
65
|
}
|
|
64
66
|
|
|
67
|
+
&:not(:focus-within) {
|
|
68
|
+
[data-clear-button] {
|
|
69
|
+
display: none;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
65
73
|
&:focus-within {
|
|
66
74
|
--border-color: var(--stroke-neutral-focus);
|
|
67
75
|
|