@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
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { Avatar, AvatarProps } from '-/components/Avatar';
|
|
2
|
+
import { Breadcrumb, BreadcrumbProps } from '-/components/Breadcrumb';
|
|
3
|
+
import './page-header.scss';
|
|
4
|
+
|
|
5
|
+
export type PageHeaderProps = {
|
|
6
|
+
/**
|
|
7
|
+
* The actions slot content.
|
|
8
|
+
*
|
|
9
|
+
* Appears in the top right of the header next to the title.
|
|
10
|
+
*/
|
|
11
|
+
actions?: React.ReactNode;
|
|
12
|
+
/**
|
|
13
|
+
* Breadcrumb properties.
|
|
14
|
+
*
|
|
15
|
+
* If provided, a breadcrumb will be rendered above the title.
|
|
16
|
+
*/
|
|
17
|
+
breadcrumb?: BreadcrumbProps;
|
|
18
|
+
/**
|
|
19
|
+
* The avatar slot content.
|
|
20
|
+
*
|
|
21
|
+
* Appears to the left of the title.
|
|
22
|
+
*/
|
|
23
|
+
avatar?: AvatarProps;
|
|
24
|
+
/**
|
|
25
|
+
* The subheader slot content.
|
|
26
|
+
*
|
|
27
|
+
* Appears below the header.
|
|
28
|
+
*/
|
|
29
|
+
subHeader?: React.ReactNode;
|
|
30
|
+
/**
|
|
31
|
+
* The page title content.
|
|
32
|
+
*
|
|
33
|
+
* Appears as the main title of the page.
|
|
34
|
+
*/
|
|
35
|
+
title: string;
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* A standard page header component.
|
|
40
|
+
*
|
|
41
|
+
* @example
|
|
42
|
+
* import { PageHeader } from '@bspk/ui/PageHeader';
|
|
43
|
+
*
|
|
44
|
+
* <PageHeader
|
|
45
|
+
* actions={<Slot height={32} label="Page actions slot" width={372} />}
|
|
46
|
+
* subHeader={
|
|
47
|
+
* <>
|
|
48
|
+
* <Slot height="var(--spacing-sizing-06)" label="Slot component" width={200} />
|
|
49
|
+
* <Slot height="var(--spacing-sizing-06)" label="Slot component 2" width={200} />
|
|
50
|
+
* </>
|
|
51
|
+
* }
|
|
52
|
+
* title="Page Title"
|
|
53
|
+
* />;
|
|
54
|
+
*
|
|
55
|
+
* @name PageHeader
|
|
56
|
+
* @phase Dev
|
|
57
|
+
*/
|
|
58
|
+
export function PageHeader({ actions, breadcrumb, avatar, subHeader, title }: PageHeaderProps) {
|
|
59
|
+
return (
|
|
60
|
+
<span data-bspk="page-header">
|
|
61
|
+
{breadcrumb && (
|
|
62
|
+
<div data-breadcrumb>
|
|
63
|
+
<Breadcrumb {...breadcrumb} />
|
|
64
|
+
</div>
|
|
65
|
+
)}
|
|
66
|
+
<div data-has-avatar={!!avatar} data-header>
|
|
67
|
+
<div data-title>
|
|
68
|
+
{avatar && <Avatar {...avatar} size="xx-large" />}
|
|
69
|
+
<h1>{title}</h1>
|
|
70
|
+
</div>
|
|
71
|
+
{actions && <div data-page-actions>{actions}</div>}
|
|
72
|
+
</div>
|
|
73
|
+
{subHeader && <div data-subheader>{subHeader}</div>}
|
|
74
|
+
</span>
|
|
75
|
+
);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/** Copyright 2025 Anywhere Real Estate - CC BY 4.0 */
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { PageHeaderProps } from '.';
|
|
2
|
+
import { ExamplePlaceholder } from '-/components/ExamplePlaceholder';
|
|
3
|
+
import { ComponentExample, Preset } from '-/utils/demo';
|
|
4
|
+
|
|
5
|
+
export const presets: Preset<PageHeaderProps>[] = [
|
|
6
|
+
{
|
|
7
|
+
label: 'Title Only',
|
|
8
|
+
propState: {
|
|
9
|
+
title: 'Page Title',
|
|
10
|
+
},
|
|
11
|
+
designPattern: true,
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
label: 'With Actions',
|
|
15
|
+
propState: {
|
|
16
|
+
title: 'Page Title',
|
|
17
|
+
actions: <ExamplePlaceholder height={32} label="Page actions slot" width={372} />,
|
|
18
|
+
},
|
|
19
|
+
designPattern: true,
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
label: 'With Breadcrumb',
|
|
23
|
+
propState: {
|
|
24
|
+
title: 'Page Title',
|
|
25
|
+
breadcrumb: {
|
|
26
|
+
items: [
|
|
27
|
+
{ label: 'Home', href: '#/home' },
|
|
28
|
+
{ label: 'Section', href: '#/section' },
|
|
29
|
+
{ label: 'Page Title', href: '#/page' },
|
|
30
|
+
],
|
|
31
|
+
},
|
|
32
|
+
actions: <ExamplePlaceholder height={32} label="Page actions slot" width={372} />,
|
|
33
|
+
},
|
|
34
|
+
designPattern: true,
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
label: 'Profile',
|
|
38
|
+
propState: {
|
|
39
|
+
title: 'Charlie Brown',
|
|
40
|
+
avatar: { image: '/avatar-01.png', name: 'CB' },
|
|
41
|
+
actions: <ExamplePlaceholder height={32} label="Page actions slot" width={372} />,
|
|
42
|
+
},
|
|
43
|
+
designPattern: true,
|
|
44
|
+
},
|
|
45
|
+
];
|
|
46
|
+
|
|
47
|
+
export const PageHeaderExample: ComponentExample<PageHeaderProps> = {
|
|
48
|
+
defaultState: {
|
|
49
|
+
title: 'Page Title',
|
|
50
|
+
actions: <ExamplePlaceholder height={32} label="Page actions slot" width={372} />,
|
|
51
|
+
},
|
|
52
|
+
disableProps: [],
|
|
53
|
+
presets,
|
|
54
|
+
render: ({ props, Component }) => <Component {...props} />,
|
|
55
|
+
variants: false,
|
|
56
|
+
fullPage: true,
|
|
57
|
+
hideDemo: true,
|
|
58
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './PageHeader';
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
[data-bspk='page-header'] {
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-direction: column;
|
|
4
|
+
width: 100%;
|
|
5
|
+
background-color: var(--background-base);
|
|
6
|
+
|
|
7
|
+
[data-breadcrumb] {
|
|
8
|
+
padding: var(--spacing-sizing-05) var(--spacing-sizing-05) 0;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
[data-header] {
|
|
12
|
+
padding: var(--spacing-sizing-05);
|
|
13
|
+
display: flex;
|
|
14
|
+
justify-content: space-between;
|
|
15
|
+
align-items: end;
|
|
16
|
+
|
|
17
|
+
[data-title] {
|
|
18
|
+
display: flex;
|
|
19
|
+
align-items: center;
|
|
20
|
+
gap: var(--spacing-sizing-03);
|
|
21
|
+
|
|
22
|
+
h1 {
|
|
23
|
+
margin: 0;
|
|
24
|
+
font: var(--heading-h3);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
&[data-has-avatar] {
|
|
29
|
+
align-items: center;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
[data-subheader] {
|
|
34
|
+
padding: 0 var(--spacing-sizing-05);
|
|
35
|
+
display: flex;
|
|
36
|
+
align-items: end;
|
|
37
|
+
justify-content: space-between;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/** Copyright 2025 Anywhere Real Estate - CC BY 4.0 */
|
|
@@ -4,6 +4,7 @@ import { AriaAttributes, useEffect, useState } from 'react';
|
|
|
4
4
|
import { PageList } from './PageList';
|
|
5
5
|
import { Button } from '-/components/Button';
|
|
6
6
|
import { InputElement } from '-/components/Input';
|
|
7
|
+
import { sendAriaLiveMessage } from '-/utils/sendAriaLiveMessage';
|
|
7
8
|
|
|
8
9
|
// After this point the manual input renders. With equal or fewer pages the individual page buttons render instead.
|
|
9
10
|
const INPUT_TYPE_THRESHOLD = 7;
|
|
@@ -42,9 +43,19 @@ export type PaginationProps = {
|
|
|
42
43
|
* }
|
|
43
44
|
*
|
|
44
45
|
* @name Pagination
|
|
45
|
-
* @phase
|
|
46
|
+
* @phase Stable
|
|
46
47
|
*/
|
|
47
|
-
export function Pagination({
|
|
48
|
+
export function Pagination({
|
|
49
|
+
numPages,
|
|
50
|
+
value,
|
|
51
|
+
onChange: onChangeProp,
|
|
52
|
+
...ariaProps
|
|
53
|
+
}: AriaAttributes & PaginationProps) {
|
|
54
|
+
const onChange = (newPage: number) => {
|
|
55
|
+
onChangeProp(newPage);
|
|
56
|
+
sendAriaLiveMessage(`Page ${newPage} of ${numPages}`);
|
|
57
|
+
};
|
|
58
|
+
|
|
48
59
|
const nextPage = () => {
|
|
49
60
|
if (value < numPages) onChange(value + 1);
|
|
50
61
|
};
|
|
@@ -102,7 +113,7 @@ export function Pagination({ numPages, value, onChange, ...ariaProps }: AriaAttr
|
|
|
102
113
|
type="number"
|
|
103
114
|
value={inputValue}
|
|
104
115
|
/>
|
|
105
|
-
of {numPages}
|
|
116
|
+
<span>of {numPages}</span>
|
|
106
117
|
</form>
|
|
107
118
|
) : (
|
|
108
119
|
<PageList numPages={numPages} onChange={onChange} value={value} />
|
|
@@ -8,13 +8,20 @@
|
|
|
8
8
|
|
|
9
9
|
[data-input-form] {
|
|
10
10
|
display: contents;
|
|
11
|
-
}
|
|
12
11
|
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
[data-bspk='input'] {
|
|
13
|
+
max-width: var(--spacing-sizing-12);
|
|
14
|
+
margin-right: var(--spacing-sizing-01);
|
|
15
|
+
|
|
16
|
+
input {
|
|
17
|
+
text-align: center;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
15
20
|
|
|
16
|
-
|
|
17
|
-
|
|
21
|
+
span {
|
|
22
|
+
display: block;
|
|
23
|
+
white-space: nowrap;
|
|
24
|
+
font: var(--body-small);
|
|
18
25
|
}
|
|
19
26
|
}
|
|
20
27
|
|
|
@@ -14,34 +14,29 @@ export type PasswordProps = FieldControlProps & Pick<InputProps, 'containerRef'
|
|
|
14
14
|
*
|
|
15
15
|
* @example
|
|
16
16
|
* import { Password } from '@bspk/ui/Password';
|
|
17
|
-
* import {
|
|
17
|
+
* import { Field, FieldLabel, FieldDescription } from '-/components/Field';
|
|
18
18
|
*
|
|
19
19
|
* () => {
|
|
20
|
-
* const [value, setValue] = useState('');
|
|
20
|
+
* const [value, setValue] = useState<string | undefined>('');
|
|
21
21
|
*
|
|
22
22
|
* return (
|
|
23
|
-
*
|
|
24
|
-
* // standalone password example
|
|
25
|
-
* <Password
|
|
26
|
-
* aria-label="Enter password"
|
|
27
|
-
* value={value}
|
|
28
|
-
* onChange={setValue}
|
|
29
|
-
* aria-label="password"
|
|
30
|
-
* name="password"
|
|
31
|
-
* />
|
|
32
|
-
* <br />
|
|
33
|
-
* // password used within a field
|
|
23
|
+
* <div style={{ width: 320 }}>
|
|
34
24
|
* <Field>
|
|
35
25
|
* <FieldLabel>Password</FieldLabel>
|
|
36
|
-
* <Password
|
|
26
|
+
* <Password
|
|
27
|
+
* aria-label="password"
|
|
28
|
+
* name="password"
|
|
29
|
+
* onChange={(next) => setValue(next)}
|
|
30
|
+
* value={value}
|
|
31
|
+
* />
|
|
37
32
|
* <FieldDescription>The password field allows you to enter a secure password.</FieldDescription>
|
|
38
33
|
* </Field>
|
|
39
|
-
*
|
|
34
|
+
* </div>
|
|
40
35
|
* );
|
|
41
36
|
* };
|
|
42
37
|
*
|
|
43
38
|
* @name Password
|
|
44
|
-
* @phase
|
|
39
|
+
* @phase Stable
|
|
45
40
|
*/
|
|
46
41
|
export function Password({
|
|
47
42
|
inputProps,
|
|
@@ -1,8 +1,25 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { useState } from 'react';
|
|
2
|
+
import { Password, PasswordProps } from '.';
|
|
3
|
+
import { Field, FieldLabel, FieldDescription } from '-/components/Field';
|
|
2
4
|
import { ComponentExample } from '-/utils/demo';
|
|
3
5
|
|
|
4
6
|
export const PasswordExample: ComponentExample<PasswordProps> = {
|
|
5
7
|
defaultState: {
|
|
6
8
|
'aria-label': 'password aria-label',
|
|
7
9
|
},
|
|
10
|
+
containerStyle: { width: 320, padding: 0 },
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export const Usage = () => {
|
|
14
|
+
const [value, setValue] = useState<string | undefined>('');
|
|
15
|
+
|
|
16
|
+
return (
|
|
17
|
+
<div>
|
|
18
|
+
<Field>
|
|
19
|
+
<FieldLabel>Password</FieldLabel>
|
|
20
|
+
<Password aria-label="password" name="password" onChange={(next) => setValue(next)} value={value} />
|
|
21
|
+
<FieldDescription>The password field allows you to enter a secure password.</FieldDescription>
|
|
22
|
+
</Field>
|
|
23
|
+
</div>
|
|
24
|
+
);
|
|
8
25
|
};
|
|
@@ -4,7 +4,6 @@ import { Txt } from '-/components/Txt';
|
|
|
4
4
|
import { ComponentExampleFn } from '-/utils/demo';
|
|
5
5
|
|
|
6
6
|
export const PopoverExample: ComponentExampleFn<PopoverProps> = ({ action }) => ({
|
|
7
|
-
containerStyle: { width: '100%' },
|
|
8
7
|
render: ({ props, Component }) => {
|
|
9
8
|
return (
|
|
10
9
|
<>
|
|
@@ -30,7 +30,7 @@ export type ProgressCircleProps = {
|
|
|
30
30
|
* <ProgressCircle label="Example label" />;
|
|
31
31
|
*
|
|
32
32
|
* @name ProgressCircle
|
|
33
|
-
* @phase
|
|
33
|
+
* @phase Stable
|
|
34
34
|
*/
|
|
35
35
|
function ProgressCircle({ label, labelPosition, size = 'medium' }: ProgressCircleProps) {
|
|
36
36
|
let variant: TxtVariant = 'labels-base';
|
|
@@ -62,7 +62,7 @@ export type ProgressionStepperProps = {
|
|
|
62
62
|
* <ProgressionStepper steps={[{ name: 'Step 1' }, { name: 'Step 2' }, { name: 'Step 3' }]} />;
|
|
63
63
|
*
|
|
64
64
|
* @name ProgressionStepper
|
|
65
|
-
* @phase
|
|
65
|
+
* @phase Stable
|
|
66
66
|
*/
|
|
67
67
|
export function ProgressionStepper({
|
|
68
68
|
steps = [],
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import './rating.scss';
|
|
2
2
|
import { SvgStarFill } from '@bspk/icons/StarFill';
|
|
3
|
+
import { useControlledState } from '-/hooks/useControlledState';
|
|
3
4
|
|
|
4
5
|
export type RatingSize = 'large' | 'medium' | 'small';
|
|
5
6
|
export type RatingProps = {
|
|
6
7
|
/**
|
|
7
8
|
* The value of the rating between 0 and 5.
|
|
8
9
|
*
|
|
10
|
+
* @default 0
|
|
9
11
|
* @minimum 0
|
|
10
12
|
* @maximum 5
|
|
11
13
|
*/
|
|
@@ -41,10 +43,12 @@ const iconWidths: Record<RatingSize, number> = {
|
|
|
41
43
|
* <Rating value={4.5} size="large" />;
|
|
42
44
|
*
|
|
43
45
|
* @name Rating
|
|
44
|
-
* @phase
|
|
46
|
+
* @phase Stable
|
|
45
47
|
*/
|
|
46
|
-
export function Rating({ size = 'medium', value, onChange }: RatingProps) {
|
|
47
|
-
|
|
48
|
+
export function Rating({ size = 'medium', value: valueProp, onChange: onChangeProp }: RatingProps) {
|
|
49
|
+
const [value, onChange] = useControlledState(valueProp, onChangeProp);
|
|
50
|
+
|
|
51
|
+
if (!onChangeProp)
|
|
48
52
|
return (
|
|
49
53
|
<div
|
|
50
54
|
aria-label={value ? `${value} out of ${MAX_STARS} stars` : 'Rating'}
|
|
@@ -9,11 +9,11 @@ import { useArrowNavigation } from '-/hooks/useArrowNavigation';
|
|
|
9
9
|
import { useFloating } from '-/hooks/useFloating';
|
|
10
10
|
import { useId } from '-/hooks/useId';
|
|
11
11
|
import { useOutsideClick } from '-/hooks/useOutsideClick';
|
|
12
|
-
import { useUIContext } from '-/hooks/useUIContext';
|
|
13
12
|
import { FieldControlProps } from '-/types/common';
|
|
14
13
|
import { getElementById } from '-/utils/dom';
|
|
15
14
|
import { handleKeyDown } from '-/utils/handleKeyDown';
|
|
16
15
|
import { scrollListItemsStyle, ScrollListItemsStyleProps } from '-/utils/scrollListItemsStyle';
|
|
16
|
+
import { sendAriaLiveMessage } from '-/utils/sendAriaLiveMessage';
|
|
17
17
|
import { useIds } from '-/utils/useIds';
|
|
18
18
|
|
|
19
19
|
/**
|
|
@@ -99,7 +99,7 @@ export type SearchBarProps<O extends SearchBarOption = SearchBarOption> = Omit<
|
|
|
99
99
|
* };
|
|
100
100
|
*
|
|
101
101
|
* @name SearchBar
|
|
102
|
-
* @phase
|
|
102
|
+
* @phase Stable
|
|
103
103
|
*/
|
|
104
104
|
export function SearchBar<O extends SearchBarOption>({
|
|
105
105
|
items: itemsProp,
|
|
@@ -129,11 +129,9 @@ export function SearchBar<O extends SearchBarOption>({
|
|
|
129
129
|
return items.filter((item) => !valueStr || item.label.toLowerCase().includes(valueStr));
|
|
130
130
|
}, [items, value]);
|
|
131
131
|
|
|
132
|
-
const { sendAriaLiveMessage } = useUIContext();
|
|
133
|
-
|
|
134
132
|
useEffect(() => {
|
|
135
133
|
if (!items.length) sendAriaLiveMessage('No results found', 'assertive');
|
|
136
|
-
}, [items.length,
|
|
134
|
+
}, [items.length, value]);
|
|
137
135
|
|
|
138
136
|
const { activeElementId, setActiveElementId, arrowKeyCallbacks } = useArrowNavigation({
|
|
139
137
|
ids: filteredItems.map((i) => i.id),
|
|
@@ -70,39 +70,26 @@ export type SelectProps = CommonProps<'size'> &
|
|
|
70
70
|
*
|
|
71
71
|
* () => {
|
|
72
72
|
* const OPTIONS = [
|
|
73
|
-
* { id: '1', label: 'Option 1' },
|
|
74
|
-
* { id: '2', label: 'Option 2' },
|
|
75
|
-
* { id: '3', label: 'Option 3' },
|
|
76
|
-
* { id: '4', label: 'Option 4' },
|
|
77
|
-
* { id: '5', label: 'Option 5' },
|
|
78
|
-
* { id: '6', label: 'Option 6' },
|
|
73
|
+
* { id: '1', label: 'Option 1', value: '1' },
|
|
74
|
+
* { id: '2', label: 'Option 2', value: '2' },
|
|
75
|
+
* { id: '3', label: 'Option 3', value: '3' },
|
|
76
|
+
* { id: '4', label: 'Option 4', value: '4' },
|
|
77
|
+
* { id: '5', label: 'Option 5', value: '5' },
|
|
78
|
+
* { id: '6', label: 'Option 6', value: '6' },
|
|
79
79
|
* ];
|
|
80
80
|
*
|
|
81
|
-
* const [selected, setSelected] = useState<string
|
|
81
|
+
* const [selected, setSelected] = useState<string | undefined>(undefined);
|
|
82
82
|
*
|
|
83
83
|
* return (
|
|
84
|
-
*
|
|
85
|
-
* // standalone select example
|
|
86
|
-
* <Select
|
|
87
|
-
* aria-label="Select an option"
|
|
88
|
-
* scrollLimit={5}
|
|
89
|
-
* name="example-select"
|
|
90
|
-
* onChange={setSelected}
|
|
91
|
-
* options={OPTIONS}
|
|
92
|
-
* placeholder="Select an option"
|
|
93
|
-
* size="medium"
|
|
94
|
-
* value={selected}
|
|
95
|
-
* />
|
|
96
|
-
* <br />
|
|
97
|
-
* // select used within a field
|
|
84
|
+
* <div style={{ width: 320 }}>
|
|
98
85
|
* <Field>
|
|
99
86
|
* <FieldLabel>Select an option</FieldLabel>
|
|
100
87
|
* <Select
|
|
101
|
-
* scrollLimit={5}
|
|
102
88
|
* name="example-select"
|
|
103
89
|
* onChange={setSelected}
|
|
104
90
|
* options={OPTIONS}
|
|
105
91
|
* placeholder="Select an option"
|
|
92
|
+
* scrollLimit={5}
|
|
106
93
|
* size="medium"
|
|
107
94
|
* value={selected}
|
|
108
95
|
* />
|
|
@@ -110,12 +97,12 @@ export type SelectProps = CommonProps<'size'> &
|
|
|
110
97
|
* The select allows you to choose one option from a list of options.
|
|
111
98
|
* </FieldDescription>
|
|
112
99
|
* </Field>
|
|
113
|
-
*
|
|
100
|
+
* </div>
|
|
114
101
|
* );
|
|
115
102
|
* };
|
|
116
103
|
*
|
|
117
104
|
* @name Select
|
|
118
|
-
* @phase
|
|
105
|
+
* @phase Stable
|
|
119
106
|
*/
|
|
120
107
|
export function Select({
|
|
121
108
|
options: optionsProp = [],
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
/* eslint-disable react/no-multi-comp */
|
|
2
|
+
import { useState } from 'react';
|
|
3
|
+
import { Select, SelectProps } from '.';
|
|
2
4
|
import { Avatar } from '-/components/Avatar';
|
|
5
|
+
import { Field, FieldDescription, FieldLabel } from '-/components/Field';
|
|
3
6
|
import { Tag } from '-/components/Tag';
|
|
4
7
|
import { Txt } from '-/components/Txt';
|
|
5
8
|
import { ComponentExample, Preset } from '-/utils/demo';
|
|
@@ -160,4 +163,36 @@ export const SelectExample: ComponentExample<SelectProps> = {
|
|
|
160
163
|
},
|
|
161
164
|
render: ({ props, Component, preset }) => <Component key={preset?.label} {...props} />,
|
|
162
165
|
presets,
|
|
166
|
+
containerStyle: { width: 320, padding: 0 },
|
|
167
|
+
};
|
|
168
|
+
|
|
169
|
+
export const Usage = () => {
|
|
170
|
+
const OPTIONS = [
|
|
171
|
+
{ id: '1', label: 'Option 1', value: '1' },
|
|
172
|
+
{ id: '2', label: 'Option 2', value: '2' },
|
|
173
|
+
{ id: '3', label: 'Option 3', value: '3' },
|
|
174
|
+
{ id: '4', label: 'Option 4', value: '4' },
|
|
175
|
+
{ id: '5', label: 'Option 5', value: '5' },
|
|
176
|
+
{ id: '6', label: 'Option 6', value: '6' },
|
|
177
|
+
];
|
|
178
|
+
|
|
179
|
+
const [selected, setSelected] = useState<string | undefined>(undefined);
|
|
180
|
+
|
|
181
|
+
return (
|
|
182
|
+
<div style={{ width: 320 }}>
|
|
183
|
+
<Field>
|
|
184
|
+
<FieldLabel>Select an option</FieldLabel>
|
|
185
|
+
<Select
|
|
186
|
+
name="example-select"
|
|
187
|
+
onChange={setSelected}
|
|
188
|
+
options={OPTIONS}
|
|
189
|
+
placeholder="Select an option"
|
|
190
|
+
scrollLimit={5}
|
|
191
|
+
size="medium"
|
|
192
|
+
value={selected}
|
|
193
|
+
/>
|
|
194
|
+
<FieldDescription>The select allows you to choose one option from a list of options.</FieldDescription>
|
|
195
|
+
</Field>
|
|
196
|
+
</div>
|
|
197
|
+
);
|
|
163
198
|
};
|
|
@@ -63,7 +63,7 @@ export type SkeletonProps = {
|
|
|
63
63
|
* @exampleDescription This example shows a skeleton loading state for an image but can be used for any element.
|
|
64
64
|
*
|
|
65
65
|
* @name Skeleton
|
|
66
|
-
* @phase
|
|
66
|
+
* @phase Stable
|
|
67
67
|
*/
|
|
68
68
|
export function Skeleton({ width = 100, height = 100, variant = 'rectangular', children = null }: SkeletonProps) {
|
|
69
69
|
return children !== null && children !== undefined && children !== false ? (
|
|
@@ -42,7 +42,7 @@ export type SkeletonTextProps = {
|
|
|
42
42
|
* @exampleDescription This example shows a skeleton loading state for some text but can be used for any element.
|
|
43
43
|
*
|
|
44
44
|
* @name SkeletonText
|
|
45
|
-
* @phase
|
|
45
|
+
* @phase Stable
|
|
46
46
|
*/
|
|
47
47
|
export function SkeletonText({ lines = 3, variant = 'body-base', children = null }: SkeletonTextProps) {
|
|
48
48
|
return children !== null && children !== undefined && children !== false ? (
|