@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,7 +1,6 @@
|
|
|
1
1
|
import { useState, ReactNode } from 'react';
|
|
2
|
-
import { AriaLiveMessageHandler, sendAriaLiveMessage } from './AriaLiveMessageHandler';
|
|
3
|
-
import { useEventListener } from '-/hooks/useAddEventListener';
|
|
4
2
|
import { useDebounceState } from '-/hooks/useDebounceState';
|
|
3
|
+
import { useEventListener } from '-/hooks/useEventListener';
|
|
5
4
|
import { useIsomorphicEffect } from '-/hooks/useIsomorphicEffect';
|
|
6
5
|
import { UIContext, ColorTheme } from '-/utils/uiContext';
|
|
7
6
|
|
|
@@ -51,11 +50,9 @@ export function UIProvider({ children }: UIProviderProps) {
|
|
|
51
50
|
isMobile: deviceWidth < 640,
|
|
52
51
|
isTablet: deviceWidth > 640 && deviceWidth < 1024,
|
|
53
52
|
isDesktop: deviceWidth >= 1024,
|
|
54
|
-
sendAriaLiveMessage,
|
|
55
53
|
}}
|
|
56
54
|
>
|
|
57
55
|
{children}
|
|
58
|
-
<AriaLiveMessageHandler />
|
|
59
56
|
</UIContext.Provider>
|
|
60
57
|
);
|
|
61
58
|
}
|
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
import { UIProviderProps } from '.';
|
|
2
|
-
import { Button } from '-/components/Button';
|
|
3
|
-
import { useUIContext } from '-/hooks/useUIContext';
|
|
4
2
|
import { ComponentExample, Preset } from '-/utils/demo';
|
|
5
3
|
|
|
6
4
|
export const presets: Preset<UIProviderProps>[] = [];
|
|
7
5
|
|
|
8
6
|
export const UIProviderExample: ComponentExample<UIProviderProps> = {
|
|
9
|
-
containerStyle: { width: '100%' },
|
|
10
7
|
defaultState: {},
|
|
11
8
|
disableProps: [],
|
|
12
9
|
presets,
|
|
@@ -55,38 +52,6 @@ export function ResponsiveComponent() {
|
|
|
55
52
|
{isDesktop && <p>This is a desktop device.</p>}
|
|
56
53
|
</div>
|
|
57
54
|
);
|
|
58
|
-
}`}
|
|
59
|
-
language="typescript"
|
|
60
|
-
/>
|
|
61
|
-
</div>
|
|
62
|
-
),
|
|
63
|
-
},
|
|
64
|
-
{
|
|
65
|
-
title: 'ARIA Live Messages',
|
|
66
|
-
content: ({ Syntax }) => (
|
|
67
|
-
<div style={{}}>
|
|
68
|
-
<p>
|
|
69
|
-
Example usage of sending ARIA live messages. This allows for dynamic updates to assistive
|
|
70
|
-
technologies, such as screen readers.
|
|
71
|
-
</p>
|
|
72
|
-
<AriaLiveExample />
|
|
73
|
-
<Syntax
|
|
74
|
-
code={`// Example usage of sending ARIA live messages
|
|
75
|
-
import { useContext } from 'react';
|
|
76
|
-
import { useUIContext } from '-/hooks/useUIContext';
|
|
77
|
-
|
|
78
|
-
export function AriaLiveExample() {
|
|
79
|
-
const {sendAriaLiveMessage} = useUIContext();
|
|
80
|
-
|
|
81
|
-
const handleClick = () => {
|
|
82
|
-
sendAriaLiveMessage('Action completed successfully', 'polite');
|
|
83
|
-
};
|
|
84
|
-
|
|
85
|
-
return (
|
|
86
|
-
<div>
|
|
87
|
-
<button onClick={handleClick}>Perform Action</button>
|
|
88
|
-
</div>
|
|
89
|
-
);
|
|
90
55
|
}`}
|
|
91
56
|
language="typescript"
|
|
92
57
|
/>
|
|
@@ -96,51 +61,3 @@ export function AriaLiveExample() {
|
|
|
96
61
|
],
|
|
97
62
|
variants: {},
|
|
98
63
|
};
|
|
99
|
-
|
|
100
|
-
export function AriaLiveExample() {
|
|
101
|
-
const { sendAriaLiveMessage } = useUIContext();
|
|
102
|
-
|
|
103
|
-
return (
|
|
104
|
-
<p>
|
|
105
|
-
<Button
|
|
106
|
-
data-bspk="link"
|
|
107
|
-
label="Send a polite ARIA Live Message "
|
|
108
|
-
onClick={() => {
|
|
109
|
-
sendAriaLiveMessage?.(
|
|
110
|
-
`Action completed successfully at ${new Date().toLocaleTimeString()}`,
|
|
111
|
-
'polite',
|
|
112
|
-
);
|
|
113
|
-
}}
|
|
114
|
-
style={{
|
|
115
|
-
padding: 0,
|
|
116
|
-
margin: 0,
|
|
117
|
-
border: 'none',
|
|
118
|
-
background: 'none',
|
|
119
|
-
color: 'inherit',
|
|
120
|
-
cursor: 'pointer',
|
|
121
|
-
}}
|
|
122
|
-
variant="tertiary"
|
|
123
|
-
/>
|
|
124
|
-
|
|
125
|
-
<Button
|
|
126
|
-
data-bspk="link"
|
|
127
|
-
label="Send an assertive ARIA Live Message "
|
|
128
|
-
onClick={() => {
|
|
129
|
-
sendAriaLiveMessage?.(
|
|
130
|
-
`Critical update occurred at ${new Date().toLocaleTimeString()}`,
|
|
131
|
-
'assertive',
|
|
132
|
-
);
|
|
133
|
-
}}
|
|
134
|
-
style={{
|
|
135
|
-
padding: 0,
|
|
136
|
-
margin: 0,
|
|
137
|
-
border: 'none',
|
|
138
|
-
background: 'none',
|
|
139
|
-
color: 'inherit',
|
|
140
|
-
cursor: 'pointer',
|
|
141
|
-
}}
|
|
142
|
-
variant="tertiary"
|
|
143
|
-
/>
|
|
144
|
-
</p>
|
|
145
|
-
);
|
|
146
|
-
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { useState, useRef, useCallback } from 'react';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* A custom hook to manage controlled and uncontrolled state.
|
|
5
|
+
*
|
|
6
|
+
* Allows a component to either be controlled by an external value or manage its own internal state. This is helpful for
|
|
7
|
+
* components that should operate in both controlled and uncontrolled modes.
|
|
8
|
+
*/
|
|
9
|
+
export function useControlledState<T>(
|
|
10
|
+
initialValue: T,
|
|
11
|
+
onChange?: (value: T) => void,
|
|
12
|
+
): [T, (value: T | ((prev: T) => T)) => void] {
|
|
13
|
+
const [internalValue, setInternalValue] = useState(initialValue);
|
|
14
|
+
|
|
15
|
+
const stateRef = useRef<T>(initialValue);
|
|
16
|
+
|
|
17
|
+
return [
|
|
18
|
+
internalValue,
|
|
19
|
+
useCallback(
|
|
20
|
+
(next: T | ((prev: T) => T)) => {
|
|
21
|
+
const nextValue = typeof next === 'function' ? (next as (p: T) => T)(stateRef.current) : next;
|
|
22
|
+
|
|
23
|
+
setInternalValue(nextValue);
|
|
24
|
+
onChange?.(nextValue);
|
|
25
|
+
|
|
26
|
+
stateRef.current = nextValue;
|
|
27
|
+
},
|
|
28
|
+
[onChange],
|
|
29
|
+
),
|
|
30
|
+
] as const;
|
|
31
|
+
}
|
package/src/types/meta.ts
CHANGED
|
@@ -3,14 +3,6 @@
|
|
|
3
3
|
* the meta output file.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
export const COMPONENT_PHASE_ORDER: ComponentPhase[] = [
|
|
7
|
-
'Utility', // Utility components are not tracked in the progress
|
|
8
|
-
'Backlog', // components that are not actively being worked on
|
|
9
|
-
'Dev', // components that are actively being developed
|
|
10
|
-
'UXReview', // components that are in UX Review
|
|
11
|
-
'Stable', // production ready
|
|
12
|
-
];
|
|
13
|
-
|
|
14
6
|
export const COMPONENT_PHASES: Record<
|
|
15
7
|
ComponentPhase,
|
|
16
8
|
{
|
package/src/utils/demo.ts
CHANGED
|
@@ -108,6 +108,18 @@ export type ComponentExample<Props = Record<string, unknown>, PropName extends k
|
|
|
108
108
|
disableProps?: PropName[] | true;
|
|
109
109
|
/** The sections of the example. */
|
|
110
110
|
sections?: ComponentPageSection<Props>[];
|
|
111
|
+
/**
|
|
112
|
+
* Whether to render the example in a full page layout.
|
|
113
|
+
*
|
|
114
|
+
* @default false
|
|
115
|
+
*/
|
|
116
|
+
fullPage?: boolean;
|
|
117
|
+
/**
|
|
118
|
+
* Hide the demo entirely.
|
|
119
|
+
*
|
|
120
|
+
* @default false
|
|
121
|
+
*/
|
|
122
|
+
hideDemo?: boolean;
|
|
111
123
|
};
|
|
112
124
|
|
|
113
125
|
export type Syntax = (params: {
|
|
@@ -144,12 +156,17 @@ export type Preset<Props> = {
|
|
|
144
156
|
* A description of the design pattern this preset demonstrates. When applied, it showcases the specific use case or
|
|
145
157
|
* behavior of the component.
|
|
146
158
|
*/
|
|
147
|
-
designPattern?: string;
|
|
159
|
+
designPattern?: boolean | string;
|
|
148
160
|
/** The name of the preset. This is used to display the preset in the UI. */
|
|
149
161
|
label: string;
|
|
150
162
|
/** The props of the component. This is used to set props of the component. These values can't be changed in the UI. */
|
|
151
163
|
propState: Omit<Props, OnHandlers> & Record<OnHandlers, unknown>;
|
|
152
|
-
|
|
164
|
+
/**
|
|
165
|
+
* Hide the demo for this preset.
|
|
166
|
+
*
|
|
167
|
+
* @default false
|
|
168
|
+
*/
|
|
169
|
+
hideDemo?: boolean;
|
|
153
170
|
};
|
|
154
171
|
|
|
155
172
|
export type DemoPreset<P = Record<string, unknown>> = Preset<P> & {
|
package/src/utils/dom.ts
CHANGED
|
@@ -4,3 +4,11 @@ export function getElementById<T extends HTMLElement = HTMLElement>(id?: string
|
|
|
4
4
|
if (!id) return null;
|
|
5
5
|
return document.querySelector<T>(`[id="${id}"]`);
|
|
6
6
|
}
|
|
7
|
+
|
|
8
|
+
export function getElement<T extends HTMLElement = HTMLElement>(
|
|
9
|
+
selector: string,
|
|
10
|
+
parent: HTMLElement | ParentNode = document,
|
|
11
|
+
): T | null {
|
|
12
|
+
if (typeof parent === 'undefined') return null;
|
|
13
|
+
return parent.querySelector<T>(selector);
|
|
14
|
+
}
|
|
@@ -3,6 +3,14 @@ import { KeyboardEventCode } from './keyboard';
|
|
|
3
3
|
|
|
4
4
|
export type KeysCallback = Partial<Record<KeyboardEventCode, ((event: KeyboardEvent) => void) | null>>;
|
|
5
5
|
|
|
6
|
+
export const getEventCode = (event: KeyboardEvent) => {
|
|
7
|
+
let eventCode = event.code as KeyboardEventCode;
|
|
8
|
+
if (event.ctrlKey && event.altKey && event.code === 'Space') eventCode = 'Ctrl+Option+Space';
|
|
9
|
+
if (event.shiftKey && !eventCode.startsWith('Shift')) eventCode = `Shift+${event.code}` as KeyboardEventCode;
|
|
10
|
+
|
|
11
|
+
return eventCode;
|
|
12
|
+
};
|
|
13
|
+
|
|
6
14
|
/**
|
|
7
15
|
* Handles multiple keydown events with specific callbacks for each key.
|
|
8
16
|
*
|
|
@@ -14,9 +22,7 @@ export function handleKeyDown(
|
|
|
14
22
|
{ stopPropagation = false, preventDefault = false }: { stopPropagation?: boolean; preventDefault?: boolean } = {},
|
|
15
23
|
) {
|
|
16
24
|
return (event: KeyboardEvent) => {
|
|
17
|
-
|
|
18
|
-
if (event.ctrlKey && event.altKey && event.code === 'Space') eventCode = 'Ctrl+Option+Space';
|
|
19
|
-
|
|
25
|
+
const eventCode = getEventCode(event);
|
|
20
26
|
const callback = keysCallback[eventCode];
|
|
21
27
|
|
|
22
28
|
if (callback) {
|
package/src/utils/keyboard.ts
CHANGED
|
@@ -136,8 +136,11 @@ export type KeyboardEventKey =
|
|
|
136
136
|
|
|
137
137
|
export type KeyboardEventCodeCustom = 'Ctrl+Option+Space';
|
|
138
138
|
|
|
139
|
-
export type
|
|
140
|
-
|
|
139
|
+
export type KeyboardEventCodeShift = `Shift+${KeyboardEventCodeBase}`;
|
|
140
|
+
|
|
141
|
+
export type KeyboardEventCode = KeyboardEventCodeBase | KeyboardEventCodeCustom | KeyboardEventCodeShift;
|
|
142
|
+
|
|
143
|
+
export type KeyboardEventCodeBase =
|
|
141
144
|
| 'AltLeft'
|
|
142
145
|
| 'AltRight'
|
|
143
146
|
| 'ArrowDown'
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This utility function sends an ARIA live message to assistive technologies by dynamically creating a live region
|
|
3
|
+
* element in the DOM.
|
|
4
|
+
*
|
|
5
|
+
* @param message The message to be announced by screen readers.
|
|
6
|
+
* @param live The ARIA live attribute value, either 'assertive' or 'polite'. Defaults to 'polite'.
|
|
7
|
+
*/
|
|
8
|
+
export function sendAriaLiveMessage(message: string, live: 'assertive' | 'polite' = 'polite') {
|
|
9
|
+
// remove existing AriaLiveMessage element from dom
|
|
10
|
+
document.querySelectorAll('[data-bspk-aria-live]').forEach((el) => el.remove());
|
|
11
|
+
|
|
12
|
+
// add new AriaLiveMessage element to dom
|
|
13
|
+
document.body.insertAdjacentHTML(
|
|
14
|
+
'beforeend',
|
|
15
|
+
`<div data-bspk-aria-live aria-live=${live || 'polite'} data-sr-only role="alert">${message}</div>`,
|
|
16
|
+
);
|
|
17
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export const SIZING_VALUES = [
|
|
2
|
+
'0',
|
|
3
|
+
'4',
|
|
4
|
+
'8',
|
|
5
|
+
'12',
|
|
6
|
+
'16',
|
|
7
|
+
'20',
|
|
8
|
+
'24',
|
|
9
|
+
'28',
|
|
10
|
+
'32',
|
|
11
|
+
'40',
|
|
12
|
+
'44',
|
|
13
|
+
'48',
|
|
14
|
+
'52',
|
|
15
|
+
'56',
|
|
16
|
+
'60',
|
|
17
|
+
'64',
|
|
18
|
+
'68',
|
|
19
|
+
'72',
|
|
20
|
+
] as const;
|
|
21
|
+
|
|
22
|
+
export type SizingPixels = `${(typeof SIZING_VALUES)[number]}`;
|
|
23
|
+
|
|
24
|
+
export function numToSizingVar(numStr?: string): string | undefined {
|
|
25
|
+
if (numStr === undefined || ['auto', '0'].includes(numStr)) return numStr;
|
|
26
|
+
|
|
27
|
+
if (!SIZING_VALUES.includes(numStr as SizingPixels)) return undefined;
|
|
28
|
+
|
|
29
|
+
return `var(--spacing-sizing-${(Number(numStr) / 4).toString().padStart(2, '0')})`;
|
|
30
|
+
}
|
package/src/utils/uiContext.ts
CHANGED
|
@@ -12,7 +12,6 @@ export type UIContextProps = {
|
|
|
12
12
|
isMobile: boolean;
|
|
13
13
|
isTablet: boolean;
|
|
14
14
|
isDesktop: boolean;
|
|
15
|
-
sendAriaLiveMessage: (message: string, live?: AriaLiveMessage['live']) => void;
|
|
16
15
|
};
|
|
17
16
|
|
|
18
17
|
export const UIContext = createContext<UIContextProps | undefined>(undefined);
|
package/.scripts/index.ts
DELETED
|
@@ -1,110 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env npx tsx
|
|
2
|
-
/* eslint-disable @cspell/spellchecker */
|
|
3
|
-
/* eslint-disable no-console */
|
|
4
|
-
/**
|
|
5
|
-
* A simple CLI script to run development tasks.
|
|
6
|
-
*
|
|
7
|
-
* After you run `npm link` to install dependencies, you can run this script with: $ ui {task} [args]
|
|
8
|
-
*
|
|
9
|
-
* For example to create a new component, you can run:
|
|
10
|
-
*
|
|
11
|
-
* $ ui newc Dropdown
|
|
12
|
-
*
|
|
13
|
-
* To see a list of available tasks, run:
|
|
14
|
-
*
|
|
15
|
-
* $ ui
|
|
16
|
-
*
|
|
17
|
-
* This will show an arrow-navigable menu of available tasks.
|
|
18
|
-
*
|
|
19
|
-
* You can add new tasks by creating a new TypeScript file in the `.scripts/tasks` directory.
|
|
20
|
-
*
|
|
21
|
-
* Each task file should execute be able to be run directly with:
|
|
22
|
-
*
|
|
23
|
-
* $ npx tsx .scripts/tasks/{task-file}.ts [args]
|
|
24
|
-
*
|
|
25
|
-
* Each task file should have a comment block at the top with the following format:
|
|
26
|
-
*
|
|
27
|
-
* // UI: {tag} - {description}
|
|
28
|
-
*
|
|
29
|
-
* Where `{tag}` is the command you want to use to run the task, and `{description}` is a brief description of what the
|
|
30
|
-
* task does.
|
|
31
|
-
*
|
|
32
|
-
* For example:
|
|
33
|
-
*
|
|
34
|
-
* // UI: newc - Create a new component
|
|
35
|
-
*
|
|
36
|
-
* This will allow you to run the task with:
|
|
37
|
-
*
|
|
38
|
-
* $ ui newc [args]
|
|
39
|
-
*
|
|
40
|
-
* The script will pass any additional arguments to the task file.
|
|
41
|
-
*/
|
|
42
|
-
|
|
43
|
-
// look for tasks with the pattern "UI: {tag} - {description}" in a comment block near the top of the file
|
|
44
|
-
|
|
45
|
-
import { execSync } from 'child_process';
|
|
46
|
-
import fs from 'fs';
|
|
47
|
-
import path from 'path';
|
|
48
|
-
import inquirer from 'inquirer';
|
|
49
|
-
|
|
50
|
-
const tasksDir = path.resolve('./.scripts/tasks');
|
|
51
|
-
|
|
52
|
-
const tasks: { [key: string]: { description: string; filePath: string } } = {};
|
|
53
|
-
|
|
54
|
-
fs.readdirSync(tasksDir).forEach((file) => {
|
|
55
|
-
if (file.endsWith('.ts')) {
|
|
56
|
-
const filePath = path.join(tasksDir, file);
|
|
57
|
-
const content = fs.readFileSync(filePath, 'utf-8');
|
|
58
|
-
const match = content.match(/UI:\s*(\S+)\s*-\s*(.+)/);
|
|
59
|
-
if (match) {
|
|
60
|
-
const [, tag, description] = match;
|
|
61
|
-
tasks[tag] = { description, filePath };
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
});
|
|
65
|
-
|
|
66
|
-
const [taskTag, ...args] = process.argv.slice(2);
|
|
67
|
-
|
|
68
|
-
function runTask(taskKey?: string) {
|
|
69
|
-
const task = taskKey && tasks[taskKey];
|
|
70
|
-
if (!task) return;
|
|
71
|
-
|
|
72
|
-
console.log(`Running task: ${taskKey} - ${task.description}`);
|
|
73
|
-
try {
|
|
74
|
-
execSync(`npx tsx ${task.filePath} ${args.join(' ')}`, { stdio: 'inherit' });
|
|
75
|
-
process.exit(0);
|
|
76
|
-
} catch (error) {
|
|
77
|
-
console.error(`Task "${taskKey}" failed:`, error);
|
|
78
|
-
process.exit(1);
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
runTask(taskTag);
|
|
83
|
-
// List available tasks if no valid task is provided make it a arrow navigable menu
|
|
84
|
-
|
|
85
|
-
async function createArrowKeyMenu() {
|
|
86
|
-
const questions = [
|
|
87
|
-
{
|
|
88
|
-
type: 'list',
|
|
89
|
-
name: 'selectedOption',
|
|
90
|
-
message: 'Choose an task:',
|
|
91
|
-
choices: [
|
|
92
|
-
...Object.keys(tasks),
|
|
93
|
-
new inquirer.Separator(), // Optional separator
|
|
94
|
-
'Exit',
|
|
95
|
-
],
|
|
96
|
-
},
|
|
97
|
-
];
|
|
98
|
-
|
|
99
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
100
|
-
const answers = await inquirer.prompt(questions as any);
|
|
101
|
-
console.log('You selected:', answers.selectedOption);
|
|
102
|
-
runTask(answers.selectedOption);
|
|
103
|
-
|
|
104
|
-
if (answers.selectedOption === 'Exit') {
|
|
105
|
-
process.exit(); // Exit the process if 'Exit' is chosen
|
|
106
|
-
}
|
|
107
|
-
// You can add logic here based on the selected option
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
createArrowKeyMenu();
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import { ElementType, ReactNode } from 'react';
|
|
2
|
-
import { ElementProps } from '-/types/common';
|
|
3
|
-
export type LayoutProps<As extends ElementType = ElementType> = {
|
|
4
|
-
/**
|
|
5
|
-
* The content of the Layout.
|
|
6
|
-
*
|
|
7
|
-
* @required
|
|
8
|
-
*/
|
|
9
|
-
children?: ReactNode;
|
|
10
|
-
/**
|
|
11
|
-
* Determines if the flex-direction should be displayed as a column.
|
|
12
|
-
*
|
|
13
|
-
* @default false
|
|
14
|
-
*/
|
|
15
|
-
column?: boolean;
|
|
16
|
-
/** The gap between the children. */
|
|
17
|
-
gap?: '4' | '16';
|
|
18
|
-
/**
|
|
19
|
-
* The element type to render as.
|
|
20
|
-
*
|
|
21
|
-
* @default div
|
|
22
|
-
* @type ElementType
|
|
23
|
-
*/
|
|
24
|
-
as?: As;
|
|
25
|
-
/**
|
|
26
|
-
* The alignment style to apply to the Layout.
|
|
27
|
-
*
|
|
28
|
-
* @default flex-start
|
|
29
|
-
*/
|
|
30
|
-
align?: 'center' | 'flex-end' | 'flex-start' | 'stretch';
|
|
31
|
-
/**
|
|
32
|
-
* The justification style to apply to the Layout.
|
|
33
|
-
*
|
|
34
|
-
* @default flex-start
|
|
35
|
-
*/
|
|
36
|
-
justify?: 'center' | 'flex-end' | 'flex-start' | 'stretch';
|
|
37
|
-
};
|
|
38
|
-
/**
|
|
39
|
-
* Utility component used within other components for layout purposes.
|
|
40
|
-
*
|
|
41
|
-
* @example
|
|
42
|
-
* import { Layout } from '@bspk/ui/Layout';
|
|
43
|
-
*
|
|
44
|
-
* <Layout>Low effort example</Layout>;
|
|
45
|
-
*
|
|
46
|
-
* @name Layout
|
|
47
|
-
* @phase Utility
|
|
48
|
-
*/
|
|
49
|
-
export declare function Layout<As extends ElementType = ElementType>({ children, column, gap, style, as, align, justify, ...props }: ElementProps<LayoutProps<As>, As>): import("react/jsx-runtime").JSX.Element;
|
|
50
|
-
/** Copyright 2025 Anywhere Real Estate - CC BY 4.0 */
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
/**
|
|
3
|
-
* Utility component used within other components for layout purposes.
|
|
4
|
-
*
|
|
5
|
-
* @example
|
|
6
|
-
* import { Layout } from '@bspk/ui/Layout';
|
|
7
|
-
*
|
|
8
|
-
* <Layout>Low effort example</Layout>;
|
|
9
|
-
*
|
|
10
|
-
* @name Layout
|
|
11
|
-
* @phase Utility
|
|
12
|
-
*/
|
|
13
|
-
export function Layout({ children, column, gap = '16', style, as, align = 'flex-start', justify = 'flex-start', ...props }) {
|
|
14
|
-
const As = as || 'div';
|
|
15
|
-
const alignItems = align || 'flex-start';
|
|
16
|
-
const justifyContent = justify || 'flex-start';
|
|
17
|
-
return (_jsx(As, { ...props,
|
|
18
|
-
// data-bspk="layout" -- Utility components do not need a data-bspk attribute
|
|
19
|
-
style: {
|
|
20
|
-
...style,
|
|
21
|
-
display: 'flex',
|
|
22
|
-
flexDirection: column ? 'column' : 'row',
|
|
23
|
-
gap: gap ? `${gap}px` : 'px',
|
|
24
|
-
alignItems,
|
|
25
|
-
justifyContent,
|
|
26
|
-
}, children: children }));
|
|
27
|
-
}
|
|
28
|
-
//# sourceMappingURL=Layout.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Layout.js","sourceRoot":"","sources":["../../../src/components/Layout/Layout.tsx"],"names":[],"mappings":";AAwCA;;;;;;;;;;GAUG;AACH,MAAM,UAAU,MAAM,CAAuC,EACzD,QAAQ,EACR,MAAM,EACN,GAAG,GAAG,IAAI,EACV,KAAK,EACL,EAAE,EACF,KAAK,GAAG,YAAY,EACpB,OAAO,GAAG,YAAY,EACtB,GAAG,KAAK,EACwB;IAChC,MAAM,EAAE,GAAgB,EAAE,IAAI,KAAK,CAAC;IAEpC,MAAM,UAAU,GAAG,KAAK,IAAI,YAAY,CAAC;IACzC,MAAM,cAAc,GAAG,OAAO,IAAI,YAAY,CAAC;IAE/C,OAAO,CACH,KAAC,EAAE,OACK,KAAK;QACT,6EAA6E;QAC7E,KAAK,EAAE;YACH,GAAG,KAAK;YACR,OAAO,EAAE,MAAM;YACf,aAAa,EAAE,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,KAAK;YACxC,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC,GAAG,GAAG,IAAI,CAAC,CAAC,CAAC,IAAI;YAC5B,UAAU;YACV,cAAc;SACjB,YAEA,QAAQ,GACR,CACR,CAAC;AACN,CAAC"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
export const presets = [];
|
|
3
|
-
export const LayoutExample = {
|
|
4
|
-
render: ({ props, Component }) => {
|
|
5
|
-
return (_jsxs(Component, { ...props, children: [_jsx("div", { children: "Alpha" }), _jsx("div", { children: "Beta" }), _jsx("div", { children: "Gamma" })] }));
|
|
6
|
-
},
|
|
7
|
-
presets,
|
|
8
|
-
};
|
|
9
|
-
//# sourceMappingURL=LayoutExample.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"LayoutExample.js","sourceRoot":"","sources":["../../../src/components/Layout/LayoutExample.tsx"],"names":[],"mappings":";AAGA,MAAM,CAAC,MAAM,OAAO,GAA0B,EAAE,CAAC;AAEjD,MAAM,CAAC,MAAM,aAAa,GAAkC;IACxD,MAAM,EAAE,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,EAAE,EAAE;QAC7B,OAAO,CACH,MAAC,SAAS,OAAK,KAAK,aAChB,kCAAgB,EAChB,iCAAe,EACf,kCAAgB,IACR,CACf,CAAC;IACN,CAAC;IACD,OAAO;CACV,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './Layout';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/Layout/index.tsx"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export declare function sendAriaLiveMessage(message: string, live?: 'assertive' | 'polite'): void;
|
|
2
|
-
/**
|
|
3
|
-
* AriaLiveMessageHandler is a single use component that listens for aria-live messages and displays them to the user.
|
|
4
|
-
*
|
|
5
|
-
* We use a custom event to communicate between components and this handler.
|
|
6
|
-
*
|
|
7
|
-
* We don't store the message in context to avoid unnecessary re-renders of all components that consume the context. :)
|
|
8
|
-
*
|
|
9
|
-
* We queue messages to ensure that they are read by screen readers.
|
|
10
|
-
*
|
|
11
|
-
* After the message is read, we clear it after a short delay to allow for subsequent messages to be read.
|
|
12
|
-
*/
|
|
13
|
-
export declare function AriaLiveMessageHandler(): import("react/jsx-runtime").JSX.Element | undefined;
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useState } from 'react';
|
|
3
|
-
import { useEventListener } from '../../hooks/useAddEventListener';
|
|
4
|
-
import { useTimeout } from '../../hooks/useTimeout';
|
|
5
|
-
const CUSTOM_EVENT_NAME = 'bspk-aria-live';
|
|
6
|
-
export function sendAriaLiveMessage(message, live = 'polite') {
|
|
7
|
-
document.dispatchEvent(new CustomEvent(CUSTOM_EVENT_NAME, { detail: { message, live } }));
|
|
8
|
-
}
|
|
9
|
-
/**
|
|
10
|
-
* AriaLiveMessageHandler is a single use component that listens for aria-live messages and displays them to the user.
|
|
11
|
-
*
|
|
12
|
-
* We use a custom event to communicate between components and this handler.
|
|
13
|
-
*
|
|
14
|
-
* We don't store the message in context to avoid unnecessary re-renders of all components that consume the context. :)
|
|
15
|
-
*
|
|
16
|
-
* We queue messages to ensure that they are read by screen readers.
|
|
17
|
-
*
|
|
18
|
-
* After the message is read, we clear it after a short delay to allow for subsequent messages to be read.
|
|
19
|
-
*/
|
|
20
|
-
export function AriaLiveMessageHandler() {
|
|
21
|
-
const [ariaLiveMessage, setAriaLiveMessage] = useState(undefined);
|
|
22
|
-
const timeout = useTimeout();
|
|
23
|
-
useEventListener(CUSTOM_EVENT_NAME, (event) => {
|
|
24
|
-
const { message, live } = event.detail;
|
|
25
|
-
// Clear any existing message to ensure that screen readers read the new message
|
|
26
|
-
setAriaLiveMessage(undefined);
|
|
27
|
-
timeout.set(() => setAriaLiveMessage({ message, live: live || 'polite' }), 10);
|
|
28
|
-
}, document);
|
|
29
|
-
return (ariaLiveMessage && (_jsx("div", { "aria-live": ariaLiveMessage?.live || 'polite', "data-sr-only": true, role: "alert", children: ariaLiveMessage?.message })));
|
|
30
|
-
}
|
|
31
|
-
//# sourceMappingURL=AriaLiveMessageHandler.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AriaLiveMessageHandler.js","sourceRoot":"","sources":["../../../src/components/UIProvider/AriaLiveMessageHandler.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjC,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAGhD,MAAM,iBAAiB,GAAG,gBAAgB,CAAC;AAE3C,MAAM,UAAU,mBAAmB,CAAC,OAAe,EAAE,OAA+B,QAAQ;IACxF,QAAQ,CAAC,aAAa,CAAC,IAAI,WAAW,CAAC,iBAAiB,EAAE,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC;AAC9F,CAAC;AAED;;;;;;;;;;GAUG;AACH,MAAM,UAAU,sBAAsB;IAClC,MAAM,CAAC,eAAe,EAAE,kBAAkB,CAAC,GAAG,QAAQ,CAA8B,SAAS,CAAC,CAAC;IAE/F,MAAM,OAAO,GAAG,UAAU,EAAE,CAAC;IAE7B,gBAAgB,CACZ,iBAAiB,EACjB,CAAC,KAAkB,EAAE,EAAE;QACnB,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,GAAG,KAAK,CAAC,MAAM,CAAC;QACvC,gFAAgF;QAChF,kBAAkB,CAAC,SAAS,CAAC,CAAC;QAC9B,OAAO,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,kBAAkB,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,IAAI,QAAQ,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;IACnF,CAAC,EACD,QAAQ,CACX,CAAC;IAEF,OAAO,CACH,eAAe,IAAI,CACf,2BAAgB,eAAe,EAAE,IAAI,IAAI,QAAQ,wBAAe,IAAI,EAAC,OAAO,YACvE,eAAe,EAAE,OAAO,GACvB,CACT,CACJ,CAAC;AACN,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useAddEventListener.js","sourceRoot":"","sources":["../../src/hooks/useAddEventListener.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAE5D,MAAM,UAAU,gBAAgB,CAM5B,SAAgC,EAChC,OAOS,EACT,OAAW,EACX,QAAkB,EAClB,OAA2C;IAE3C,mCAAmC;IACnC,MAAM,YAAY,GAAG,MAAM,CAAC,OAAO,CAAC,CAAC;IAErC,mBAAmB,CAAC,GAAG,EAAE;QACrB,YAAY,CAAC,OAAO,GAAG,OAAO,CAAC;IACnC,CAAC,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC;IAEd,mBAAmB,CAAC,GAAG,EAAE;QACrB,IAAI,QAAQ;YAAE,OAAO;QAErB,8BAA8B;QAC9B,MAAM,aAAa,GAAe,OAAO,IAAI,MAAM,CAAC;QAEpD,IAAI,CAAC,CAAC,aAAa,IAAI,aAAa,CAAC,gBAAgB,CAAC;YAAE,OAAO;QAE/D,kEAAkE;QAClE,MAAM,QAAQ,GAAmB,CAAC,KAAK,EAAE,EAAE;YACvC,YAAY,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;QAChC,CAAC,CAAC;QAEF,aAAa,CAAC,gBAAgB,CAAC,SAAS,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC;QAE7D,mCAAmC;QACnC,OAAO,GAAG,EAAE;YACR,aAAa,CAAC,mBAAmB,CAAC,SAAS,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC;QACpE,CAAC,CAAC;IACN,CAAC,EAAE,CAAC,SAAS,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC;AACtC,CAAC"}
|