@bspk/ui 1.2.0 → 1.3.0
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/.scripts/index.ts +110 -0
- package/README.md +13 -0
- package/build.ts +2 -2
- package/dist/components/Accordion/Accordion.d.ts +42 -5
- package/dist/components/Accordion/Accordion.js +24 -20
- package/dist/components/Accordion/Accordion.js.map +1 -1
- package/dist/components/Accordion/AccordionExample.d.ts +2 -1
- package/dist/components/Accordion/AccordionExample.js +77 -64
- package/dist/components/Accordion/AccordionExample.js.map +1 -1
- package/dist/components/Accordion/accordion.css +37 -34
- package/dist/components/Accordion/accordion.css.js +37 -34
- package/dist/components/Avatar/Avatar.d.ts +10 -6
- package/dist/components/Avatar/Avatar.js +5 -10
- package/dist/components/Avatar/Avatar.js.map +1 -1
- package/dist/components/Avatar/AvatarExample.d.ts +2 -1
- package/dist/components/Avatar/AvatarExample.js +42 -41
- package/dist/components/Avatar/AvatarExample.js.map +1 -1
- package/dist/components/AvatarGroup/AvatarGroup.d.ts +1 -1
- package/dist/components/AvatarGroup/AvatarGroup.js +1 -1
- package/dist/components/AvatarGroup/AvatarGroup.js.map +1 -1
- package/dist/components/AvatarGroup/AvatarGroupExample.d.ts +2 -1
- package/dist/components/AvatarGroup/AvatarGroupExample.js +33 -27
- package/dist/components/AvatarGroup/AvatarGroupExample.js.map +1 -1
- package/dist/components/Badge/Badge.d.ts +1 -1
- package/dist/components/Badge/Badge.js +1 -1
- package/dist/components/Badge/Badge.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/BadgeDot.js.map +1 -1
- package/dist/components/BannerAlert/BannerAlert.d.ts +1 -1
- package/dist/components/BannerAlert/BannerAlert.js +3 -2
- package/dist/components/BannerAlert/BannerAlert.js.map +1 -1
- package/dist/components/BannerAlert/BannerAlertExample.js +4 -0
- package/dist/components/BannerAlert/BannerAlertExample.js.map +1 -1
- package/dist/components/BannerAlert/banner-alert.css +0 -26
- package/dist/components/BannerAlert/banner-alert.css.js +0 -26
- package/dist/components/BottomNavigation/BottomNavigation.d.ts +53 -0
- package/dist/components/BottomNavigation/BottomNavigation.js +42 -0
- package/dist/components/BottomNavigation/BottomNavigation.js.map +1 -0
- package/dist/components/BottomNavigation/BottomNavigationExample.d.ts +4 -0
- package/dist/components/BottomNavigation/BottomNavigationExample.js +119 -0
- package/dist/components/BottomNavigation/BottomNavigationExample.js.map +1 -0
- package/dist/components/BottomNavigation/bottom-navigation.css +68 -0
- package/dist/components/BottomNavigation/bottom-navigation.css.js +73 -0
- package/dist/components/BottomNavigation/index.d.ts +1 -0
- package/dist/components/BottomNavigation/index.js +2 -0
- package/dist/components/BottomNavigation/index.js.map +1 -0
- package/dist/components/Breadcrumb/Breadcrumb.d.ts +4 -4
- package/dist/components/Breadcrumb/Breadcrumb.js +7 -16
- package/dist/components/Breadcrumb/Breadcrumb.js.map +1 -1
- package/dist/components/Breadcrumb/BreadcrumbExample.d.ts +2 -1
- package/dist/components/Breadcrumb/BreadcrumbExample.js +150 -149
- package/dist/components/Breadcrumb/BreadcrumbExample.js.map +1 -1
- package/dist/components/Button/Button.d.ts +1 -1
- package/dist/components/Button/Button.js +6 -3
- package/dist/components/Button/Button.js.map +1 -1
- package/dist/components/Button/ButtonExample.d.ts +2 -1
- package/dist/components/Button/ButtonExample.js +25 -24
- package/dist/components/Button/ButtonExample.js.map +1 -1
- package/dist/components/ButtonDock/ButtonDock.d.ts +55 -0
- package/dist/components/ButtonDock/ButtonDock.js +33 -0
- package/dist/components/ButtonDock/ButtonDock.js.map +1 -0
- package/dist/components/ButtonDock/ButtonDockExample.d.ts +4 -0
- package/dist/components/ButtonDock/ButtonDockExample.js +75 -0
- package/dist/components/ButtonDock/ButtonDockExample.js.map +1 -0
- package/dist/components/ButtonDock/button-dock.css +42 -0
- package/dist/components/ButtonDock/button-dock.css.js +47 -0
- package/dist/components/ButtonDock/index.d.ts +1 -0
- package/dist/components/ButtonDock/index.js +2 -0
- package/dist/components/ButtonDock/index.js.map +1 -0
- package/dist/components/CalendarPicker/CalendarPicker.d.ts +32 -0
- package/dist/components/CalendarPicker/CalendarPicker.js +203 -0
- package/dist/components/CalendarPicker/CalendarPicker.js.map +1 -0
- package/dist/components/CalendarPicker/CalendarPickerExample.d.ts +3 -0
- package/dist/components/CalendarPicker/CalendarPickerExample.js +17 -0
- package/dist/components/CalendarPicker/CalendarPickerExample.js.map +1 -0
- package/dist/components/CalendarPicker/calendar-picker.css +70 -0
- package/dist/components/CalendarPicker/calendar-picker.css.js +75 -0
- package/dist/components/CalendarPicker/index.d.ts +1 -0
- package/dist/components/CalendarPicker/index.js +2 -0
- package/dist/components/CalendarPicker/index.js.map +1 -0
- package/dist/components/Card/Card.d.ts +3 -9
- package/dist/components/Card/Card.js +2 -2
- package/dist/components/Card/Card.js.map +1 -1
- package/dist/components/Card/CardExample.js +1 -0
- package/dist/components/Card/CardExample.js.map +1 -1
- package/dist/components/Card/card.css +0 -4
- package/dist/components/Card/card.css.js +0 -4
- package/dist/components/Carousel/Carousel.d.ts +63 -0
- package/dist/components/Carousel/Carousel.js +68 -0
- package/dist/components/Carousel/Carousel.js.map +1 -0
- package/dist/components/Carousel/CarouselExample.d.ts +5 -0
- package/dist/components/Carousel/CarouselExample.js +51 -0
- package/dist/components/Carousel/CarouselExample.js.map +1 -0
- package/dist/components/Carousel/carousel.css +34 -0
- package/dist/components/Carousel/carousel.css.js +39 -0
- package/dist/components/Carousel/index.d.ts +1 -0
- package/dist/components/Carousel/index.js +2 -0
- package/dist/components/Carousel/index.js.map +1 -0
- package/dist/components/Checkbox/Checkbox.d.ts +1 -1
- package/dist/components/Checkbox/Checkbox.js +1 -1
- package/dist/components/Checkbox/Checkbox.js.map +1 -1
- package/dist/components/Checkbox/checkbox.css +8 -8
- package/dist/components/Checkbox/checkbox.css.js +8 -8
- package/dist/components/CheckboxGroup/CheckboxGroupExample.d.ts +2 -1
- package/dist/components/CheckboxGroup/CheckboxGroupExample.js +49 -42
- package/dist/components/CheckboxGroup/CheckboxGroupExample.js.map +1 -1
- package/dist/components/ChipAssist/ChipAssistExample.d.ts +2 -1
- package/dist/components/ChipAssist/ChipAssistExample.js +24 -23
- package/dist/components/ChipAssist/ChipAssistExample.js.map +1 -1
- package/dist/components/ChipFilter/ChipFilterExample.js +3 -0
- package/dist/components/ChipFilter/ChipFilterExample.js.map +1 -1
- package/dist/components/ChipGroup/ChipGroupExample.d.ts +2 -1
- package/dist/components/ChipGroup/ChipGroupExample.js +9 -8
- package/dist/components/ChipGroup/ChipGroupExample.js.map +1 -1
- package/dist/components/ChipInput/ChipInputExample.d.ts +2 -1
- package/dist/components/ChipInput/ChipInputExample.js +39 -38
- package/dist/components/ChipInput/ChipInputExample.js.map +1 -1
- package/dist/components/ChipSuggestion/ChipSuggestionExample.d.ts +2 -1
- package/dist/components/ChipSuggestion/ChipSuggestionExample.js +16 -15
- package/dist/components/ChipSuggestion/ChipSuggestionExample.js.map +1 -1
- package/dist/components/ChipUtility/ChipUtility.d.ts +1 -1
- package/dist/components/ChipUtility/ChipUtility.js +1 -1
- package/dist/components/ChipUtility/ChipUtility.js.map +1 -1
- package/dist/components/ChipUtility/ChipUtilityExample.d.ts +2 -1
- package/dist/components/ChipUtility/ChipUtilityExample.js +53 -52
- package/dist/components/ChipUtility/ChipUtilityExample.js.map +1 -1
- package/dist/components/DateField/DateField.d.ts +32 -0
- package/dist/components/DateField/DateField.js +34 -0
- package/dist/components/DateField/DateField.js.map +1 -0
- package/dist/components/DateField/DateFieldExample.d.ts +4 -0
- package/dist/components/DateField/DateFieldExample.js +11 -0
- package/dist/components/DateField/DateFieldExample.js.map +1 -0
- package/dist/components/DateField/date-field.css +8 -0
- package/dist/components/DateField/date-field.css.js +13 -0
- package/dist/components/DateField/index.d.ts +1 -0
- package/dist/components/DateField/index.js +2 -0
- package/dist/components/DateField/index.js.map +1 -0
- package/dist/components/DateInput/DateInput.d.ts +39 -0
- package/dist/components/DateInput/DateInput.js +102 -0
- package/dist/components/DateInput/DateInput.js.map +1 -0
- package/dist/components/DateInput/DateInputExample.d.ts +4 -0
- package/dist/components/DateInput/DateInputExample.js +14 -0
- package/dist/components/DateInput/DateInputExample.js.map +1 -0
- package/dist/components/DateInput/date-input.css +12 -0
- package/dist/components/DateInput/date-input.css.js +17 -0
- package/dist/components/DateInput/index.d.ts +1 -0
- package/dist/components/DateInput/index.js +2 -0
- package/dist/components/DateInput/index.js.map +1 -0
- package/dist/components/Dialog/Dialog.d.ts +15 -2
- package/dist/components/Dialog/Dialog.js +11 -9
- package/dist/components/Dialog/Dialog.js.map +1 -1
- package/dist/components/Dialog/DialogExample.d.ts +2 -1
- package/dist/components/Dialog/DialogExample.js +2 -0
- package/dist/components/Dialog/DialogExample.js.map +1 -1
- package/dist/components/Dialog/dialog.css +19 -67
- package/dist/components/Dialog/dialog.css.js +19 -67
- package/dist/components/Divider/Divider.d.ts +1 -1
- package/dist/components/Divider/Divider.js +1 -1
- package/dist/components/Divider/Divider.js.map +1 -1
- package/dist/components/Divider/DividerExample.d.ts +4 -2
- package/dist/components/Divider/DividerExample.js +2 -0
- package/dist/components/Divider/DividerExample.js.map +1 -1
- package/dist/components/Divider/divider.css +1 -1
- package/dist/components/Divider/divider.css.js +1 -1
- package/dist/components/Drawer/Drawer.d.ts +75 -0
- package/dist/components/Drawer/Drawer.js +49 -0
- package/dist/components/Drawer/Drawer.js.map +1 -0
- package/dist/components/Drawer/DrawerExample.d.ts +4 -0
- package/dist/components/Drawer/DrawerExample.js +47 -0
- package/dist/components/Drawer/DrawerExample.js.map +1 -0
- package/dist/components/Drawer/drawer.css +56 -0
- package/dist/components/Drawer/drawer.css.js +61 -0
- package/dist/components/Drawer/index.d.ts +1 -0
- package/dist/components/Drawer/index.js +2 -0
- package/dist/components/Drawer/index.js.map +1 -0
- package/dist/components/EmptyState/EmptyStateExample.d.ts +2 -1
- package/dist/components/EmptyState/EmptyStateExample.js +18 -11
- package/dist/components/EmptyState/EmptyStateExample.js.map +1 -1
- package/dist/components/Fab/Fab.d.ts +1 -1
- package/dist/components/Fab/Fab.js +5 -2
- package/dist/components/Fab/Fab.js.map +1 -1
- package/dist/components/Fab/FabExample.d.ts +1 -0
- package/dist/components/Fab/FabExample.js +4 -2
- package/dist/components/Fab/FabExample.js.map +1 -1
- package/dist/components/FileUpload/FileUpload.d.ts +1 -1
- package/dist/components/FileUpload/FileUpload.js +1 -1
- package/dist/components/FileUpload/FileUpload.js.map +1 -1
- package/dist/components/FileUpload/FileUploadExample.d.ts +2 -1
- package/dist/components/FileUpload/FileUploadExample.js +17 -16
- package/dist/components/FileUpload/FileUploadExample.js.map +1 -1
- package/dist/components/FileUploadItem/FileUploadItem.d.ts +1 -1
- package/dist/components/FileUploadItem/FileUploadItem.js +1 -1
- package/dist/components/FileUploadItem/FileUploadItem.js.map +1 -1
- package/dist/components/FileUploadItem/FileUploadItemExample.d.ts +2 -1
- package/dist/components/FileUploadItem/FileUploadItemExample.js +44 -39
- package/dist/components/FileUploadItem/FileUploadItemExample.js.map +1 -1
- package/dist/components/FormField/FormField.d.ts +3 -3
- package/dist/components/FormField/FormField.js +2 -2
- package/dist/components/FormField/FormField.js.map +1 -1
- package/dist/components/FormField/form-field.css +3 -3
- package/dist/components/FormField/form-field.css.js +3 -3
- package/dist/components/InlineAlert/InlineAlert.d.ts +1 -1
- package/dist/components/InlineAlert/InlineAlert.js +1 -1
- package/dist/components/InlineAlert/InlineAlert.js.map +1 -1
- package/dist/components/Layout/LayoutExample.d.ts +2 -1
- package/dist/components/Layout/LayoutExample.js +2 -0
- package/dist/components/Layout/LayoutExample.js.map +1 -1
- package/dist/components/Link/Link.d.ts +1 -1
- package/dist/components/Link/Link.js +1 -1
- package/dist/components/Link/Link.js.map +1 -1
- package/dist/components/Link/LinkExample.d.ts +2 -1
- package/dist/components/Link/LinkExample.js +2 -0
- package/dist/components/Link/LinkExample.js.map +1 -1
- package/dist/components/ListItem/ListItem.d.ts +40 -14
- package/dist/components/ListItem/ListItem.js +26 -13
- package/dist/components/ListItem/ListItem.js.map +1 -1
- package/dist/components/ListItem/ListItemExample.d.ts +2 -1
- package/dist/components/ListItem/ListItemExample.js +12 -12
- package/dist/components/ListItem/ListItemExample.js.map +1 -1
- package/dist/components/ListItem/list-item.css +10 -7
- package/dist/components/ListItem/list-item.css.js +10 -7
- package/dist/components/ListItemMenu/ListItemMenu.d.ts +146 -0
- package/dist/components/ListItemMenu/ListItemMenu.js +159 -0
- package/dist/components/ListItemMenu/ListItemMenu.js.map +1 -0
- package/dist/components/ListItemMenu/index.d.ts +1 -0
- package/dist/components/ListItemMenu/index.js +2 -0
- package/dist/components/ListItemMenu/index.js.map +1 -0
- package/dist/components/Menu/Menu.d.ts +12 -39
- package/dist/components/Menu/Menu.js +6 -26
- package/dist/components/Menu/Menu.js.map +1 -1
- package/dist/components/Menu/MenuExample.d.ts +3 -3
- package/dist/components/Menu/MenuExample.js +1 -24
- package/dist/components/Menu/MenuExample.js.map +1 -1
- package/dist/components/Menu/menu.css +3 -10
- package/dist/components/Menu/menu.css.js +3 -10
- package/dist/components/MenuButton/MenuButton.d.ts +1 -1
- package/dist/components/MenuButton/MenuButton.js +1 -1
- package/dist/components/MenuButton/MenuButton.js.map +1 -1
- package/dist/components/Modal/Modal.d.ts +4 -4
- package/dist/components/Modal/Modal.js +4 -4
- package/dist/components/Modal/Modal.js.map +1 -1
- package/dist/components/NumberInput/NumberInput.d.ts +8 -4
- package/dist/components/NumberInput/NumberInput.js +5 -14
- package/dist/components/NumberInput/NumberInput.js.map +1 -1
- package/dist/components/NumberInput/number-input.css +0 -1
- package/dist/components/NumberInput/number-input.css.js +0 -1
- package/dist/components/OTPInput/OTPInput.d.ts +3 -3
- package/dist/components/OTPInput/OTPInput.js +3 -3
- package/dist/components/OTPInput/OTPInput.js.map +1 -1
- package/dist/components/OTPInput/OTPInputExample.d.ts +2 -1
- package/dist/components/OTPInput/OTPInputExample.js +19 -16
- package/dist/components/OTPInput/OTPInputExample.js.map +1 -1
- package/dist/components/PageControl/PageControl.d.ts +5 -3
- package/dist/components/PageControl/PageControl.js +17 -16
- package/dist/components/PageControl/PageControl.js.map +1 -1
- package/dist/components/PageControl/PageControlExample.d.ts +4 -0
- package/dist/components/PageControl/PageControlExample.js +34 -0
- package/dist/components/PageControl/PageControlExample.js.map +1 -0
- package/dist/components/Pagination/Pagination.d.ts +1 -5
- package/dist/components/Pagination/Pagination.js +2 -6
- package/dist/components/Pagination/Pagination.js.map +1 -1
- package/dist/components/PasswordField/PasswordField.d.ts +2 -2
- package/dist/components/PasswordField/PasswordField.js +3 -3
- package/dist/components/PasswordField/PasswordField.js.map +1 -1
- package/dist/components/PasswordInput/PasswordInput.d.ts +1 -1
- package/dist/components/PasswordInput/PasswordInput.js +2 -2
- package/dist/components/PasswordInput/PasswordInput.js.map +1 -1
- package/dist/components/PhoneNumberInput/PhoneNumberInput.d.ts +3 -3
- package/dist/components/PhoneNumberInput/PhoneNumberInput.js +49 -52
- package/dist/components/PhoneNumberInput/PhoneNumberInput.js.map +1 -1
- package/dist/components/PhoneNumberInput/PhoneNumberInputExample.d.ts +4 -0
- package/dist/components/PhoneNumberInput/PhoneNumberInputExample.js +5 -0
- package/dist/components/PhoneNumberInput/PhoneNumberInputExample.js.map +1 -0
- package/dist/components/PhoneNumberInput/phone-number-input.css +36 -26
- package/dist/components/PhoneNumberInput/phone-number-input.css.js +36 -26
- package/dist/components/Popover/Popover.d.ts +7 -4
- package/dist/components/Popover/Popover.js +22 -19
- package/dist/components/Popover/Popover.js.map +1 -1
- package/dist/components/Popover/PopoverExample.js +7 -1
- package/dist/components/Popover/PopoverExample.js.map +1 -1
- package/dist/components/Popover/popover.css +3 -12
- package/dist/components/Popover/popover.css.js +3 -12
- package/dist/components/ProgressBar/ProgressBar.js +1 -1
- package/dist/components/ProgressBar/ProgressBar.js.map +1 -1
- package/dist/components/ProgressCircle/ProgressCircle.js +1 -1
- package/dist/components/ProgressCircle/ProgressCircle.js.map +1 -1
- package/dist/components/ProgressionStepper/ProgressionStepper.d.ts +1 -1
- package/dist/components/ProgressionStepper/ProgressionStepper.js +2 -2
- package/dist/components/ProgressionStepper/ProgressionStepper.js.map +1 -1
- package/dist/components/ProgressionStepper/ProgressionStepperExample.d.ts +2 -1
- package/dist/components/ProgressionStepper/ProgressionStepperExample.js +47 -46
- package/dist/components/ProgressionStepper/ProgressionStepperExample.js.map +1 -1
- package/dist/components/ProgressionStepperBar/ProgressionStepperBar.d.ts +1 -1
- package/dist/components/ProgressionStepperBar/ProgressionStepperBar.js +3 -3
- package/dist/components/ProgressionStepperBar/ProgressionStepperBar.js.map +1 -1
- package/dist/components/Radio/Radio.d.ts +1 -1
- package/dist/components/Radio/Radio.js.map +1 -1
- package/dist/components/RadioGroup/RadioGroup.d.ts +1 -1
- package/dist/components/RadioGroup/RadioGroup.js +2 -2
- package/dist/components/RadioGroup/RadioGroup.js.map +1 -1
- package/dist/components/RadioGroup/RadioGroupExample.d.ts +1 -0
- package/dist/components/RadioGroup/RadioGroupExample.js +2 -1
- package/dist/components/RadioGroup/RadioGroupExample.js.map +1 -1
- package/dist/components/RadioOption/RadioOption.js +1 -1
- package/dist/components/RadioOption/RadioOption.js.map +1 -1
- package/dist/components/Rating/Rating.js +2 -2
- package/dist/components/Rating/Rating.js.map +1 -1
- package/dist/components/Rating/RatingExample.d.ts +2 -1
- package/dist/components/Rating/RatingExample.js +9 -8
- package/dist/components/Rating/RatingExample.js.map +1 -1
- package/dist/components/Scrim/Scrim.d.ts +2 -2
- package/dist/components/Scrim/Scrim.js +2 -2
- package/dist/components/Scrim/Scrim.js.map +1 -1
- package/dist/components/Scrim/scrim.css +0 -3
- package/dist/components/Scrim/scrim.css.js +0 -3
- package/dist/components/SearchBar/SearchBar.d.ts +11 -8
- package/dist/components/SearchBar/SearchBar.js +46 -34
- package/dist/components/SearchBar/SearchBar.js.map +1 -1
- package/dist/components/SearchBar/SearchBarExample.d.ts +2 -1
- package/dist/components/SearchBar/SearchBarExample.js +2 -6
- package/dist/components/SearchBar/SearchBarExample.js.map +1 -1
- package/dist/components/SegmentedControl/SegmentedControl.d.ts +2 -2
- package/dist/components/SegmentedControl/SegmentedControl.js +1 -1
- package/dist/components/SegmentedControl/SegmentedControl.js.map +1 -1
- package/dist/components/SegmentedControl/SegmentedControlExample.d.ts +2 -1
- package/dist/components/SegmentedControl/SegmentedControlExample.js +32 -23
- package/dist/components/SegmentedControl/SegmentedControlExample.js.map +1 -1
- package/dist/components/SegmentedControl/segmented-control.css +7 -7
- package/dist/components/SegmentedControl/segmented-control.css.js +7 -7
- package/dist/components/Select/Select.d.ts +53 -35
- package/dist/components/Select/Select.js +99 -27
- package/dist/components/Select/Select.js.map +1 -1
- package/dist/components/Select/SelectExample.d.ts +2 -1
- package/dist/components/Select/SelectExample.js +104 -89
- package/dist/components/Select/SelectExample.js.map +1 -1
- package/dist/components/Select/select.css +12 -18
- package/dist/components/Select/select.css.js +12 -18
- package/dist/components/SelectField/SelectFieldExample.d.ts +23 -0
- package/dist/components/SelectField/SelectFieldExample.js +13 -0
- package/dist/components/SelectField/SelectFieldExample.js.map +1 -0
- package/dist/components/Skeleton/SkeletonExample.d.ts +2 -1
- package/dist/components/Skeleton/SkeletonExample.js +10 -9
- package/dist/components/Skeleton/SkeletonExample.js.map +1 -1
- package/dist/components/SkeletonText/SkeletonTextExample.d.ts +2 -1
- package/dist/components/SkeletonText/SkeletonTextExample.js +12 -11
- package/dist/components/SkeletonText/SkeletonTextExample.js.map +1 -1
- package/dist/components/Slider/Slider.js +1 -1
- package/dist/components/Slider/Slider.js.map +1 -1
- package/dist/components/Slider/SliderExample.js +3 -0
- package/dist/components/Slider/SliderExample.js.map +1 -1
- package/dist/components/Snackbar/Snackbar.d.ts +27 -0
- package/dist/components/Snackbar/Snackbar.js +23 -0
- package/dist/components/Snackbar/Snackbar.js.map +1 -0
- package/dist/components/Snackbar/SnackbarExample.d.ts +3 -0
- package/dist/components/Snackbar/SnackbarExample.js +11 -0
- package/dist/components/Snackbar/SnackbarExample.js.map +1 -0
- package/dist/components/Snackbar/index.d.ts +1 -0
- package/dist/components/Snackbar/index.js +2 -0
- package/dist/components/Snackbar/index.js.map +1 -0
- package/dist/components/Snackbar/snackbar.css +19 -0
- package/dist/components/Snackbar/snackbar.css.js +24 -0
- package/dist/components/SnackbarProvider/SnackbarProvider.d.ts +90 -0
- package/dist/components/SnackbarProvider/SnackbarProvider.js +115 -0
- package/dist/components/SnackbarProvider/SnackbarProvider.js.map +1 -0
- package/dist/components/SnackbarProvider/SnackbarProviderExample.d.ts +4 -0
- package/dist/components/SnackbarProvider/SnackbarProviderExample.js +59 -0
- package/dist/components/SnackbarProvider/SnackbarProviderExample.js.map +1 -0
- package/dist/components/SnackbarProvider/index.d.ts +1 -0
- package/dist/components/SnackbarProvider/index.js +2 -0
- package/dist/components/SnackbarProvider/index.js.map +1 -0
- package/dist/components/SnackbarProvider/snackbar-provider-example.css +15 -0
- package/dist/components/SnackbarProvider/snackbar-provider-example.css.js +20 -0
- package/dist/components/SnackbarProvider/snackbar-provider.css +15 -0
- package/dist/components/SnackbarProvider/snackbar-provider.css.js +20 -0
- package/dist/components/Switch/Switch.d.ts +1 -1
- package/dist/components/Switch/Switch.js.map +1 -1
- package/dist/components/TabGroup/TabGroup.d.ts +1 -1
- package/dist/components/TabGroup/TabGroup.js +1 -1
- package/dist/components/TabGroup/TabGroup.js.map +1 -1
- package/dist/components/TabGroup/TabGroupExample.d.ts +2 -1
- package/dist/components/TabGroup/TabGroupExample.js +50 -45
- package/dist/components/TabGroup/TabGroupExample.js.map +1 -1
- package/dist/components/TabGroup/tab-group.css +6 -6
- package/dist/components/TabGroup/tab-group.css.js +6 -6
- package/dist/components/TabList/TabList.d.ts +1 -1
- package/dist/components/TabList/TabList.js +32 -22
- package/dist/components/TabList/TabList.js.map +1 -1
- package/dist/components/TabList/tab-list.css +6 -9
- package/dist/components/TabList/tab-list.css.js +6 -9
- package/dist/components/Tag/Tag.d.ts +1 -1
- package/dist/components/Tag/Tag.js +1 -1
- package/dist/components/Tag/Tag.js.map +1 -1
- package/dist/components/Tag/TagExample.d.ts +2 -1
- package/dist/components/Tag/TagExample.js +12 -11
- package/dist/components/Tag/TagExample.js.map +1 -1
- package/dist/components/TextField/TextField.js +1 -1
- package/dist/components/TextField/TextField.js.map +1 -1
- package/dist/components/TextField/TextFieldExample.d.ts +3 -0
- package/dist/components/TextField/TextFieldExample.js +6 -0
- package/dist/components/TextField/TextFieldExample.js.map +1 -0
- package/dist/components/TextInput/TextInput.d.ts +2 -2
- package/dist/components/TextInput/TextInput.js +27 -4
- package/dist/components/TextInput/TextInput.js.map +1 -1
- package/dist/components/TextInput/TextInputExample.js +9 -0
- package/dist/components/TextInput/TextInputExample.js.map +1 -1
- package/dist/components/TextInput/text-input.css +12 -25
- package/dist/components/TextInput/text-input.css.js +12 -25
- package/dist/components/Textarea/Textarea.d.ts +3 -3
- package/dist/components/Textarea/Textarea.js +2 -10
- package/dist/components/Textarea/Textarea.js.map +1 -1
- package/dist/components/TextareaField/TextareaField.d.ts +1 -1
- package/dist/components/TextareaField/TextareaField.js +2 -2
- package/dist/components/TextareaField/TextareaField.js.map +1 -1
- package/dist/components/TimeInput/Listbox.d.ts +10 -5
- package/dist/components/TimeInput/Listbox.js +14 -55
- package/dist/components/TimeInput/Listbox.js.map +1 -1
- package/dist/components/TimeInput/Segment.d.ts +3 -4
- package/dist/components/TimeInput/Segment.js +17 -13
- package/dist/components/TimeInput/Segment.js.map +1 -1
- package/dist/components/TimeInput/TimeInput.d.ts +3 -5
- package/dist/components/TimeInput/TimeInput.js +70 -23
- package/dist/components/TimeInput/TimeInput.js.map +1 -1
- package/dist/components/TimeInput/time-input.css +10 -9
- package/dist/components/TimeInput/time-input.css.js +10 -9
- package/dist/components/ToggleOption/ToggleOption.d.ts +1 -1
- package/dist/components/ToggleOption/ToggleOption.js.map +1 -1
- package/dist/components/Tooltip/Tooltip.d.ts +4 -3
- package/dist/components/Tooltip/Tooltip.js +12 -18
- package/dist/components/Tooltip/Tooltip.js.map +1 -1
- package/dist/components/Tooltip/TooltipExample.js +1 -1
- package/dist/components/Tooltip/TooltipExample.js.map +1 -1
- package/dist/components/Tooltip/tooltip.css +0 -2
- package/dist/components/Tooltip/tooltip.css.js +0 -2
- package/dist/components/Truncated/Truncated.d.ts +1 -0
- package/dist/components/Truncated/Truncated.js +2 -8
- package/dist/components/Truncated/Truncated.js.map +1 -1
- package/dist/components/Truncated/truncated.css +8 -0
- package/dist/components/Truncated/truncated.css.js +13 -0
- package/dist/components/UIProvider/AriaLiveMessageHandler.d.ts +13 -0
- package/dist/components/UIProvider/AriaLiveMessageHandler.js +30 -0
- package/dist/components/UIProvider/AriaLiveMessageHandler.js.map +1 -0
- package/dist/components/UIProvider/UIProvider.d.ts +12 -1
- package/dist/components/UIProvider/UIProvider.js +13 -4
- package/dist/components/UIProvider/UIProvider.js.map +1 -1
- package/dist/components/UIProvider/UIProviderExample.d.ts +5 -0
- package/dist/components/UIProvider/UIProviderExample.js +92 -0
- package/dist/components/UIProvider/UIProviderExample.js.map +1 -0
- package/dist/constants/phases.js +0 -1
- package/dist/constants/phases.js.map +1 -1
- package/dist/hooks/useAddEventListener.d.ts +2 -1
- package/dist/hooks/useAddEventListener.js.map +1 -1
- package/dist/hooks/useArrowNavigation.d.ts +50 -0
- package/dist/hooks/useArrowNavigation.js +57 -0
- package/dist/hooks/useArrowNavigation.js.map +1 -0
- package/dist/hooks/useCheckboxGroupState.d.ts +1 -1
- package/dist/hooks/useContainerWidth.d.ts +16 -0
- package/dist/hooks/useContainerWidth.js +35 -0
- package/dist/hooks/useContainerWidth.js.map +1 -0
- package/dist/hooks/useFloating.d.ts +7 -6
- package/dist/hooks/useFloating.js +10 -12
- package/dist/hooks/useFloating.js.map +1 -1
- package/dist/hooks/useSnackbarContext.d.ts +1 -0
- package/dist/hooks/useSnackbarContext.js +16 -0
- package/dist/hooks/useSnackbarContext.js.map +1 -0
- package/dist/hooks/useSwipe.d.ts +6 -0
- package/dist/hooks/useSwipe.js +28 -0
- package/dist/hooks/useSwipe.js.map +1 -0
- package/dist/styles/base.css +87 -15
- package/dist/styles/base.css.js +87 -15
- package/dist/types/common.d.ts +9 -4
- package/dist/types/common.js.map +1 -1
- package/dist/types/meta.d.ts +1 -1
- package/dist/types/meta.js +0 -7
- package/dist/types/meta.js.map +1 -1
- package/dist/utils/createExampleChildElement.js +1 -1
- package/dist/utils/createExampleChildElement.js.map +1 -1
- package/dist/utils/demo.d.ts +31 -6
- package/dist/utils/demo.js.map +1 -1
- package/dist/utils/dom.d.ts +2 -0
- package/dist/utils/dom.js +9 -0
- package/dist/utils/dom.js.map +1 -0
- package/dist/utils/handleKeyDown.d.ts +4 -3
- package/dist/utils/handleKeyDown.js +6 -3
- package/dist/utils/handleKeyDown.js.map +1 -1
- package/dist/utils/keyboard.d.ts +2 -1
- package/dist/utils/keyboard.js.map +1 -1
- package/dist/utils/scrollListItemsStyle.d.ts +10 -0
- package/dist/utils/scrollListItemsStyle.js +17 -0
- package/dist/utils/scrollListItemsStyle.js.map +1 -0
- package/dist/utils/snackbarContext.d.ts +38 -0
- package/dist/utils/snackbarContext.js +3 -0
- package/dist/utils/snackbarContext.js.map +1 -0
- package/dist/utils/uiContext.d.ts +6 -0
- package/dist/utils/uiContext.js.map +1 -1
- package/dist/utils/useIds.d.ts +4 -0
- package/dist/utils/useIds.js +11 -0
- package/dist/utils/useIds.js.map +1 -0
- package/package.json +41 -12
- package/src/components/Accordion/Accordion.rtl.test.tsx +17 -0
- package/src/components/Accordion/Accordion.tsx +87 -24
- package/src/components/Accordion/AccordionExample.tsx +78 -72
- package/src/components/Accordion/accordion.scss +37 -36
- package/src/components/Avatar/Avatar.rtl.test.tsx +16 -0
- package/src/components/Avatar/Avatar.tsx +30 -26
- package/src/components/Avatar/AvatarExample.tsx +44 -42
- package/src/components/AvatarGroup/AvatarGroup.rtl.test.tsx +16 -0
- package/src/components/AvatarGroup/AvatarGroup.tsx +1 -2
- package/src/components/AvatarGroup/AvatarGroupExample.tsx +36 -28
- package/src/components/Badge/Badge.rtl.test.tsx +19 -0
- package/src/components/Badge/Badge.tsx +1 -2
- package/src/components/BadgeDot/BadgeDot.rtl.test.tsx +19 -0
- package/src/components/BadgeDot/BadgeDot.tsx +1 -2
- package/src/components/BannerAlert/BannerAlert.rtl.test.tsx +26 -0
- package/src/components/BannerAlert/BannerAlert.tsx +16 -7
- package/src/components/BannerAlert/BannerAlertExample.tsx +4 -0
- package/src/components/BannerAlert/banner-alert.scss +0 -28
- package/src/components/BottomNavigation/BottomNavigation.rtl.test.tsx +21 -0
- package/src/components/BottomNavigation/BottomNavigation.tsx +60 -0
- package/src/components/BottomNavigation/BottomNavigationExample.tsx +121 -0
- package/src/components/BottomNavigation/bottom-navigation.scss +87 -0
- package/src/components/BottomNavigation/index.tsx +1 -0
- package/src/components/Breadcrumb/Breadcrumb.rtl.test.tsx +16 -0
- package/src/components/Breadcrumb/Breadcrumb.tsx +57 -73
- package/src/components/Breadcrumb/BreadcrumbExample.tsx +152 -150
- package/src/components/Button/Button.rtl.test.tsx +16 -0
- package/src/components/Button/Button.tsx +8 -5
- package/src/components/Button/ButtonExample.tsx +27 -25
- package/src/components/ButtonDock/ButtonDock.rtl.test.tsx +18 -0
- package/src/components/ButtonDock/ButtonDock.tsx +68 -0
- package/src/components/ButtonDock/ButtonDockExample.tsx +77 -0
- package/src/components/ButtonDock/button-dock.scss +49 -0
- package/src/components/ButtonDock/index.tsx +1 -0
- package/src/components/CalendarPicker/CalendarPicker.rtl.test.tsx +15 -0
- package/src/components/CalendarPicker/CalendarPicker.tsx +424 -0
- package/src/components/CalendarPicker/CalendarPickerExample.tsx +24 -0
- package/src/components/CalendarPicker/calendar-picker.scss +89 -0
- package/src/components/CalendarPicker/index.tsx +1 -0
- package/src/components/Card/Card.rtl.test.tsx +19 -0
- package/src/components/Card/Card.tsx +4 -11
- package/src/components/Card/CardExample.tsx +1 -0
- package/src/components/Card/card.scss +0 -5
- package/src/components/Carousel/Carousel.tsx +177 -0
- package/src/components/Carousel/CarouselExample.tsx +82 -0
- package/src/components/Carousel/carousel.scss +39 -0
- package/src/components/Carousel/index.tsx +1 -0
- package/src/components/Checkbox/Checkbox.rtl.test.tsx +27 -0
- package/src/components/Checkbox/Checkbox.tsx +1 -3
- package/src/components/Checkbox/checkbox.scss +4 -4
- package/src/components/CheckboxGroup/CheckboxGroup.rtl.test.tsx +19 -0
- package/src/components/CheckboxGroup/CheckboxGroupExample.tsx +51 -43
- package/src/components/CheckboxOption/CheckboxOption.rtl.test.tsx +24 -0
- package/src/components/ChipAssist/ChipAssist.rtl.test.tsx +16 -0
- package/src/components/ChipAssist/ChipAssistExample.tsx +26 -24
- package/src/components/ChipFilter/ChipFilter.rtl.test.tsx +15 -0
- package/src/components/ChipFilter/ChipFilterExample.tsx +3 -0
- package/src/components/ChipGroup/ChipGroup.rtl.test.tsx +32 -0
- package/src/components/ChipGroup/ChipGroupExample.tsx +11 -9
- package/src/components/ChipInput/ChipInput.rtl.test.tsx +16 -0
- package/src/components/ChipInput/ChipInputExample.tsx +41 -39
- package/src/components/ChipSuggestion/ChipSuggestion.rtl.test.tsx +19 -0
- package/src/components/ChipSuggestion/ChipSuggestionExample.tsx +18 -16
- package/src/components/ChipUtility/ChipUtility.rtl.test.tsx +16 -0
- package/src/components/ChipUtility/ChipUtility.tsx +1 -3
- package/src/components/ChipUtility/ChipUtilityExample.tsx +56 -54
- package/src/components/DateField/DateField.rtl.test.tsx +24 -0
- package/src/components/DateField/DateField.tsx +58 -0
- package/src/components/DateField/DateFieldExample.tsx +13 -0
- package/src/components/DateField/date-field.scss +8 -0
- package/src/components/DateField/index.tsx +1 -0
- package/src/components/DateInput/DateInput.rtl.test.tsx +17 -0
- package/src/components/DateInput/DateInput.tsx +197 -0
- package/src/components/DateInput/DateInputExample.tsx +17 -0
- package/src/components/DateInput/date-input.scss +13 -0
- package/src/components/DateInput/index.tsx +1 -0
- package/src/components/Dialog/Dialog.rtl.test.tsx +22 -0
- package/src/components/Dialog/Dialog.tsx +26 -7
- package/src/components/Dialog/DialogExample.tsx +4 -1
- package/src/components/Dialog/dialog.scss +25 -79
- package/src/components/Divider/Divider.rtl.test.tsx +8 -0
- package/src/components/Divider/Divider.tsx +1 -2
- package/src/components/Divider/DividerExample.tsx +6 -2
- package/src/components/Divider/divider.scss +1 -1
- package/src/components/Drawer/Drawer.rtl.test.tsx +27 -0
- package/src/components/Drawer/Drawer.tsx +135 -0
- package/src/components/Drawer/DrawerExample.tsx +93 -0
- package/src/components/Drawer/drawer.scss +67 -0
- package/src/components/Drawer/index.tsx +1 -0
- package/src/components/EmptyState/EmptyState.rtl.test.tsx +16 -0
- package/src/components/EmptyState/EmptyStateExample.tsx +24 -16
- package/src/components/Fab/Fab.rtl.test.tsx +15 -0
- package/src/components/Fab/Fab.tsx +6 -4
- package/src/components/Fab/FabExample.tsx +5 -2
- package/src/components/FileUpload/FileUpload.rtl.test.tsx +14 -0
- package/src/components/FileUpload/FileUpload.tsx +1 -2
- package/src/components/FileUpload/FileUploadExample.tsx +19 -17
- package/src/components/FileUploadItem/FileUploadItem.rtl.test.tsx +19 -0
- package/src/components/FileUploadItem/FileUploadItem.tsx +1 -3
- package/src/components/FileUploadItem/FileUploadItemExample.tsx +47 -40
- package/src/components/FormField/FormField.rtl.test.tsx +30 -0
- package/src/components/FormField/FormField.tsx +3 -4
- package/src/components/FormField/form-field.scss +1 -1
- package/src/components/Img/Img.rtl.test.tsx +15 -0
- package/src/components/InlineAlert/InlineAlert.rtl.test.tsx +15 -0
- package/src/components/InlineAlert/InlineAlert.tsx +1 -2
- package/src/components/Layout/Layout.rtl.test.tsx +15 -0
- package/src/components/Layout/LayoutExample.tsx +4 -1
- package/src/components/Link/Link.rtl.test.tsx +14 -0
- package/src/components/Link/Link.tsx +1 -3
- package/src/components/Link/LinkExample.tsx +4 -1
- package/src/components/ListItem/ListItem.rtl.test.tsx +18 -0
- package/src/components/ListItem/ListItem.tsx +132 -73
- package/src/components/ListItem/ListItemExample.tsx +14 -13
- package/src/components/ListItem/list-item.scss +16 -10
- package/src/components/ListItemMenu/ListItemMenu.tsx +358 -0
- package/src/components/ListItemMenu/index.tsx +1 -0
- package/src/components/Menu/Menu.rtl.test.tsx +15 -0
- package/src/components/Menu/Menu.tsx +39 -106
- package/src/components/Menu/MenuExample.tsx +2 -32
- package/src/components/Menu/menu.scss +4 -16
- package/src/components/MenuButton/MenuButton.rtl.test.tsx +15 -0
- package/src/components/MenuButton/MenuButton.tsx +1 -3
- package/src/components/Modal/Modal.rtl.test.tsx +20 -0
- package/src/components/Modal/Modal.tsx +8 -5
- package/src/components/NumberField/NumberField.rtl.test.tsx +24 -0
- package/src/components/NumberInput/NumberInput.rtl.test.tsx +15 -0
- package/src/components/NumberInput/NumberInput.tsx +16 -22
- package/src/components/NumberInput/number-input.scss +0 -1
- package/src/components/OTPInput/OTPInput.rtl.test.tsx +19 -0
- package/src/components/OTPInput/OTPInput.tsx +3 -4
- package/src/components/OTPInput/OTPInputExample.tsx +21 -17
- package/src/components/PageControl/PageControl.rtl.test.tsx +15 -0
- package/src/components/PageControl/PageControl.tsx +23 -23
- package/src/components/PageControl/PageControlExample.tsx +36 -0
- package/src/components/Pagination/Pagination.rtl.test.tsx +15 -0
- package/src/components/Pagination/Pagination.tsx +2 -7
- package/src/components/PasswordField/PasswordField.rtl.test.tsx +24 -0
- package/src/components/PasswordField/PasswordField.tsx +4 -5
- package/src/components/PasswordInput/PasswordInput.rtl.test.tsx +15 -0
- package/src/components/PasswordInput/PasswordInput.tsx +2 -2
- package/src/components/PhoneNumberField/PhoneNumberField.rtl.test.tsx +24 -0
- package/src/components/PhoneNumberInput/PhoneNumberInput.rtl.test.tsx +17 -0
- package/src/components/PhoneNumberInput/PhoneNumberInput.tsx +103 -144
- package/src/components/PhoneNumberInput/PhoneNumberInputExample.tsx +8 -0
- package/src/components/PhoneNumberInput/phone-number-input.scss +40 -31
- package/src/components/Popover/Popover.rtl.test.tsx +28 -0
- package/src/components/Popover/Popover.tsx +82 -72
- package/src/components/Popover/PopoverExample.tsx +7 -1
- package/src/components/Popover/popover.scss +3 -13
- package/src/components/Portal/Portal.rtl.test.tsx +15 -0
- package/src/components/ProgressBar/ProgressBar.rtl.test.tsx +15 -0
- package/src/components/ProgressBar/ProgressBar.tsx +1 -2
- package/src/components/ProgressCircle/ProgressCircle.rtl.test.tsx +15 -0
- package/src/components/ProgressCircle/ProgressCircle.tsx +1 -2
- package/src/components/ProgressionStepper/ProgressionStepper.rtl.test.tsx +19 -0
- package/src/components/ProgressionStepper/ProgressionStepper.tsx +2 -4
- package/src/components/ProgressionStepper/ProgressionStepperExample.tsx +49 -47
- package/src/components/ProgressionStepperBar/ProgressionStepperBar.rtl.test.tsx +15 -0
- package/src/components/ProgressionStepperBar/ProgressionStepperBar.tsx +9 -4
- package/src/components/Radio/Radio.rtl.test.tsx +15 -0
- package/src/components/Radio/Radio.tsx +1 -3
- package/src/components/RadioGroup/RadioGroup.rtl.test.tsx +32 -0
- package/src/components/RadioGroup/RadioGroup.tsx +2 -3
- package/src/components/RadioGroup/RadioGroupExample.tsx +3 -1
- package/src/components/RadioOption/RadioOption.rtl.test.tsx +15 -0
- package/src/components/RadioOption/RadioOption.tsx +1 -1
- package/src/components/Rating/Rating.rtl.test.tsx +16 -0
- package/src/components/Rating/Rating.tsx +9 -12
- package/src/components/Rating/RatingExample.tsx +11 -9
- package/src/components/Scrim/Scrim.rtl.test.tsx +15 -0
- package/src/components/Scrim/Scrim.tsx +11 -4
- package/src/components/Scrim/scrim.scss +0 -4
- package/src/components/SearchBar/SearchBar.rtl.test.tsx +41 -0
- package/src/components/SearchBar/SearchBar.tsx +95 -89
- package/src/components/SearchBar/SearchBarExample.tsx +3 -20
- package/src/components/SegmentedControl/SegmentedControl.rtl.test.tsx +26 -0
- package/src/components/SegmentedControl/SegmentedControl.tsx +2 -4
- package/src/components/SegmentedControl/SegmentedControlExample.tsx +34 -24
- package/src/components/SegmentedControl/segmented-control.scss +19 -14
- package/src/components/Select/Select.rtl.test.tsx +25 -0
- package/src/components/Select/Select.tsx +229 -102
- package/src/components/Select/SelectExample.tsx +111 -91
- package/src/components/Select/select.scss +13 -23
- package/src/components/SelectField/SelectField.rtl.test.tsx +25 -0
- package/src/components/SelectField/SelectFieldExample.tsx +16 -0
- package/src/components/Skeleton/Skeleton.rtl.test.tsx +16 -0
- package/src/components/Skeleton/SkeletonExample.tsx +12 -10
- package/src/components/SkeletonText/SkeletonText.rtl.test.tsx +16 -0
- package/src/components/SkeletonText/SkeletonTextExample.tsx +14 -13
- package/src/components/Slider/Slider.rtl.test.tsx +8 -0
- package/src/components/Slider/Slider.tsx +1 -2
- package/src/components/Slider/SliderExample.tsx +3 -0
- package/src/components/Snackbar/Snackbar.tsx +48 -0
- package/src/components/Snackbar/SnackbarExample.tsx +12 -0
- package/src/components/Snackbar/index.tsx +1 -0
- package/src/components/Snackbar/snackbar.scss +22 -0
- package/src/components/SnackbarProvider/SnackbarProvider.tsx +160 -0
- package/src/components/SnackbarProvider/SnackbarProviderExample.tsx +127 -0
- package/src/components/SnackbarProvider/index.tsx +1 -0
- package/src/components/SnackbarProvider/snackbar-provider-example.scss +17 -0
- package/src/components/SnackbarProvider/snackbar-provider.scss +15 -0
- package/src/components/Switch/Switch.rtl.test.tsx +15 -0
- package/src/components/Switch/Switch.tsx +1 -3
- package/src/components/SwitchOption/SwitchOption.rtl.test.tsx +15 -0
- package/src/components/TabGroup/TabGroup.rtl.test.tsx +19 -0
- package/src/components/TabGroup/TabGroup.tsx +1 -2
- package/src/components/TabGroup/TabGroupExample.tsx +52 -46
- package/src/components/TabGroup/tab-group.scss +7 -5
- package/src/components/TabList/TabList.rtl.test.tsx +26 -0
- package/src/components/TabList/TabList.tsx +36 -31
- package/src/components/TabList/tab-list.scss +6 -9
- package/src/components/Table/Table.rtl.test.tsx +28 -0
- package/src/components/Tag/Tag.rtl.test.tsx +20 -0
- package/src/components/Tag/Tag.tsx +1 -3
- package/src/components/Tag/TagExample.tsx +14 -12
- package/src/components/TextField/TextField.rtl.test.tsx +24 -0
- package/src/components/TextField/TextField.tsx +0 -1
- package/src/components/TextField/TextFieldExample.tsx +8 -0
- package/src/components/TextInput/TextInput.rtl.test.tsx +17 -0
- package/src/components/TextInput/TextInput.tsx +46 -12
- package/src/components/TextInput/TextInputExample.tsx +9 -0
- package/src/components/TextInput/text-input.scss +9 -31
- package/src/components/Textarea/Textarea.rtl.test.tsx +17 -0
- package/src/components/Textarea/Textarea.tsx +5 -16
- package/src/components/TextareaField/TextareaField.rtl.test.tsx +24 -0
- package/src/components/TextareaField/TextareaField.tsx +2 -0
- package/src/components/TimeInput/Listbox.tsx +37 -64
- package/src/components/TimeInput/Segment.tsx +31 -21
- package/src/components/TimeInput/TimeInput.rtl.test.tsx +15 -0
- package/src/components/TimeInput/TimeInput.tsx +132 -65
- package/src/components/TimeInput/time-input.scss +5 -4
- package/src/components/ToggleOption/ToggleOption.rtl.test.tsx +15 -0
- package/src/components/ToggleOption/ToggleOption.tsx +1 -2
- package/src/components/Tooltip/Tooltip.rtl.test.tsx +24 -0
- package/src/components/Tooltip/Tooltip.tsx +14 -31
- package/src/components/Tooltip/TooltipExample.tsx +6 -8
- package/src/components/Tooltip/tooltip.scss +0 -2
- package/src/components/TopNavigation/TopNavigation.rtl.test.tsx +15 -0
- package/src/components/Truncated/Truncated.rtl.test.tsx +15 -0
- package/src/components/Truncated/Truncated.tsx +2 -9
- package/src/components/Truncated/truncated.scss +8 -0
- package/src/components/Txt/Txt.rtl.test.tsx +15 -0
- package/src/components/UIProvider/AriaLiveMessageHandler.tsx +44 -0
- package/src/components/UIProvider/UIProvider.tsx +16 -2
- package/src/components/UIProvider/UIProviderExample.tsx +146 -0
- package/src/constants/phases.ts +0 -1
- package/src/hooks/useAddEventListener.ts +3 -1
- package/src/hooks/useArrowNavigation.ts +107 -0
- package/src/hooks/useContainerWidth.tsx +37 -0
- package/src/hooks/useFloating.ts +20 -19
- package/src/hooks/useSnackbarContext.ts +18 -0
- package/src/hooks/useSwipe.ts +32 -0
- package/src/rtl/hasNoBasicA11yIssues.tsx +27 -0
- package/src/rtl/util.tsx +10 -0
- package/src/styles/base.scss +131 -70
- package/src/types/common.ts +9 -4
- package/src/types/meta.ts +1 -9
- package/src/utils/createExampleChildElement.tsx +1 -1
- package/src/utils/demo.ts +41 -7
- package/src/utils/dom.ts +6 -0
- package/src/utils/handleKeyDown.ts +11 -6
- package/src/utils/keyboard.ts +3 -0
- package/src/utils/scrollListItemsStyle.ts +29 -0
- package/src/utils/snackbarContext.tsx +43 -0
- package/src/utils/uiContext.ts +4 -1
- package/src/utils/useIds.ts +16 -0
- package/tsconfig.build.json +21 -0
- package/tsconfig.json +9 -1
- package/dist/components/Accordion/AccordionSection.d.ts +0 -84
- package/dist/components/Accordion/AccordionSection.js +0 -27
- package/dist/components/Accordion/AccordionSection.js.map +0 -1
- package/dist/components/Combobox/Combobox.d.ts +0 -92
- package/dist/components/Combobox/Combobox.js +0 -58
- package/dist/components/Combobox/Combobox.js.map +0 -1
- package/dist/components/Combobox/ListItems.d.ts +0 -26
- package/dist/components/Combobox/ListItems.js +0 -22
- package/dist/components/Combobox/ListItems.js.map +0 -1
- package/dist/components/Combobox/index.d.ts +0 -1
- package/dist/components/Combobox/index.js +0 -2
- package/dist/components/Combobox/index.js.map +0 -1
- package/dist/components/Listbox/Listbox.d.ts +0 -116
- package/dist/components/Listbox/Listbox.js +0 -83
- package/dist/components/Listbox/Listbox.js.map +0 -1
- package/dist/components/Listbox/index.d.ts +0 -1
- package/dist/components/Listbox/index.js +0 -2
- package/dist/components/Listbox/index.js.map +0 -1
- package/dist/hooks/useCombobox.d.ts +0 -56
- package/dist/hooks/useCombobox.js +0 -104
- package/dist/hooks/useCombobox.js.map +0 -1
- package/dist/hooks/useKeyNavigation.d.ts +0 -17
- package/dist/hooks/useKeyNavigation.js +0 -46
- package/dist/hooks/useKeyNavigation.js.map +0 -1
- package/src/components/Accordion/AccordionSection.tsx +0 -128
- package/src/components/Combobox/Combobox.tsx +0 -224
- package/src/components/Combobox/ListItems.tsx +0 -107
- package/src/components/Combobox/index.tsx +0 -1
- package/src/components/Listbox/Listbox.tsx +0 -257
- package/src/components/Listbox/index.tsx +0 -1
- package/src/hooks/useCombobox.ts +0 -173
- package/src/hooks/useKeyNavigation.ts +0 -66
- package/src/utils/placeholder.test.ts +0 -7
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { SvgKeyboardArrowDown } from '@bspk/icons/KeyboardArrowDown';
|
|
3
|
-
import { SvgKeyboardArrowUp } from '@bspk/icons/KeyboardArrowUp';
|
|
4
|
-
import './accordion.css.js';
|
|
5
|
-
import { Txt } from '../Txt';
|
|
6
|
-
/**
|
|
7
|
-
* A vertical stack of collapsible panels or that allows customers to expand or collapse each panel individually to
|
|
8
|
-
* reveal or hide their content.
|
|
9
|
-
*
|
|
10
|
-
* @example
|
|
11
|
-
* import { Accordion } from '@bspk/ui/Accordion';
|
|
12
|
-
*
|
|
13
|
-
* function Example() {
|
|
14
|
-
* return (
|
|
15
|
-
* <Accordion title="Accordion Title" subTitle="Accordion Subtitle">
|
|
16
|
-
* Accordion Content
|
|
17
|
-
* </Accordion>
|
|
18
|
-
* );
|
|
19
|
-
* }
|
|
20
|
-
*
|
|
21
|
-
* @name Accordion
|
|
22
|
-
* @phase WorkInProgress
|
|
23
|
-
*/
|
|
24
|
-
export function AccordionSection({ children, title, subTitle, leading, isOpen = false, toggleOpen, divider = true, trailing, disabled = false, id, }) {
|
|
25
|
-
return (_jsxs("section", { "data-accordion-section": true, "data-disabled": disabled || undefined, "data-divider": divider || undefined, id: id, children: [_jsxs("button", { "aria-expanded": isOpen ? true : false, "data-accordion-header": true, disabled: disabled, onClick: !disabled ? toggleOpen : undefined, children: [_jsxs("span", { "data-accordion-header-body": true, children: [leading ?? null, _jsxs("span", { "data-accordion-title-wrapper": true, children: [_jsx(Txt, { variant: "labels-base", children: title }), !!subTitle && _jsx(Txt, { variant: "body-x-small", children: subTitle })] }), trailing ?? null] }), isOpen ? _jsx(SvgKeyboardArrowUp, {}) : _jsx(SvgKeyboardArrowDown, {})] }), isOpen && _jsx("div", { "data-accordion-content": true, children: children }), _jsx("div", { "data-not-a-divider-divider": true })] }));
|
|
26
|
-
}
|
|
27
|
-
//# sourceMappingURL=AccordionSection.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AccordionSection.js","sourceRoot":"","sources":["../../../src/components/Accordion/AccordionSection.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AACrE,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AAEjE,OAAO,kBAAkB,CAAC;AAC1B,OAAO,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAC;AAkEvC;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,UAAU,gBAAgB,CAAC,EAC7B,QAAQ,EACR,KAAK,EACL,QAAQ,EACR,OAAO,EACP,MAAM,GAAG,KAAK,EACd,UAAU,EACV,OAAO,GAAG,IAAI,EACd,QAAQ,EACR,QAAQ,GAAG,KAAK,EAChB,EAAE,GACkB;IACpB,OAAO,CACH,oEAEmB,QAAQ,IAAI,SAAS,kBACtB,OAAO,IAAI,SAAS,EAClC,EAAE,EAAE,EAAE,aAEN,mCACmB,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,iCAEpC,QAAQ,EAAE,QAAQ,EAClB,OAAO,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,SAAS,aAE3C,+DACK,OAAO,IAAI,IAAI,EAChB,iEACI,KAAC,GAAG,IAAC,OAAO,EAAC,aAAa,YAAE,KAAK,GAAO,EACvC,CAAC,CAAC,QAAQ,IAAI,KAAC,GAAG,IAAC,OAAO,EAAC,cAAc,YAAE,QAAQ,GAAO,IACxD,EACN,QAAQ,IAAI,IAAI,IACd,EACN,MAAM,CAAC,CAAC,CAAC,KAAC,kBAAkB,KAAG,CAAC,CAAC,CAAC,KAAC,oBAAoB,KAAG,IACtD,EACR,MAAM,IAAI,wDAA6B,QAAQ,GAAO,EACvD,mDAAkC,IAC5B,CACb,CAAC;AACN,CAAC"}
|
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
import { ListItemProps } from '-/components/ListItem';
|
|
3
|
-
import { MenuProps } from '-/components/Menu';
|
|
4
|
-
import { ModalProps } from '-/components/Modal';
|
|
5
|
-
import { ToggleProps, UseComboboxProps } from '-/hooks/useCombobox';
|
|
6
|
-
import { CommonProps, ElementProps } from '-/types/common';
|
|
7
|
-
export declare const MIN_ITEM_COUNT = 3;
|
|
8
|
-
export declare const MAX_ITEM_COUNT = 10;
|
|
9
|
-
/** The props for the listbox items. */
|
|
10
|
-
export type ComboboxItemProps = CommonProps<'disabled'> & ListItemProps & {
|
|
11
|
-
/** The content to display in the listbox item. */
|
|
12
|
-
label: string;
|
|
13
|
-
/** The value of the listbox item. */
|
|
14
|
-
value: string;
|
|
15
|
-
};
|
|
16
|
-
export type ComboboxProps<Item extends ComboboxItemProps = ComboboxItemProps> = CommonProps<'id' | 'owner'> & Pick<MenuProps, 'itemDisplayCount'> & Pick<ModalProps, 'description'> & Pick<UseComboboxProps, 'disabled' | 'offsetOptions' | 'readOnly' | 'refWidth'> & {
|
|
17
|
-
/**
|
|
18
|
-
* Content to display in the listbox.
|
|
19
|
-
*
|
|
20
|
-
* @example
|
|
21
|
-
* [
|
|
22
|
-
* { value: '1', label: 'Option 1' },
|
|
23
|
-
* { value: '2', label: 'Option 2' },
|
|
24
|
-
* { value: '3', label: 'Option 3' },
|
|
25
|
-
* { value: '4', label: 'Option 4' },
|
|
26
|
-
* { value: '5', label: 'Option 5' },
|
|
27
|
-
* { value: '6', label: 'Option 6' },
|
|
28
|
-
* { value: '7', label: 'Option 7' },
|
|
29
|
-
* { value: '8', label: 'Option 8' },
|
|
30
|
-
* { value: '9', label: 'Option 9' },
|
|
31
|
-
* { value: '10', label: 'Option 10' },
|
|
32
|
-
* ];
|
|
33
|
-
*
|
|
34
|
-
* @type Array<MenuItem>
|
|
35
|
-
*/
|
|
36
|
-
items?: Item[];
|
|
37
|
-
/**
|
|
38
|
-
* Array of selected values
|
|
39
|
-
*
|
|
40
|
-
* @type Array<string>
|
|
41
|
-
*/
|
|
42
|
-
value?: Array<string>;
|
|
43
|
-
/**
|
|
44
|
-
* Whether the listbox allows multiple selections.
|
|
45
|
-
*
|
|
46
|
-
* @default false
|
|
47
|
-
*/
|
|
48
|
-
isMulti?: boolean;
|
|
49
|
-
/**
|
|
50
|
-
* The label for the "Select All" option.
|
|
51
|
-
*
|
|
52
|
-
* Ignored if `isMulti` is false.
|
|
53
|
-
*
|
|
54
|
-
* If `isMulti` is `true`, defaults to "Select All". If a string, it will be used as the label. If false the
|
|
55
|
-
* select all option will not be rendered.
|
|
56
|
-
*
|
|
57
|
-
* @default false
|
|
58
|
-
*/
|
|
59
|
-
selectAll?: boolean | string;
|
|
60
|
-
/**
|
|
61
|
-
* The function to call when the selected values change.
|
|
62
|
-
*
|
|
63
|
-
* @example
|
|
64
|
-
* (selectedValues, event) => setState({ selectedValues });
|
|
65
|
-
*
|
|
66
|
-
* @required
|
|
67
|
-
*/
|
|
68
|
-
onChange: (selectedValues: string[], event?: React.MouseEvent<HTMLElement, MouseEvent>) => void;
|
|
69
|
-
/**
|
|
70
|
-
* The children of the listbox added after the items.
|
|
71
|
-
*
|
|
72
|
-
* Usually only used for showing no items found.
|
|
73
|
-
*/
|
|
74
|
-
children: (params: {
|
|
75
|
-
setReference: (node: HTMLElement) => void;
|
|
76
|
-
toggleProps: ToggleProps;
|
|
77
|
-
}) => ReactNode;
|
|
78
|
-
/**
|
|
79
|
-
* The label for the select element, used for accessibility, and the dropdown modal header.
|
|
80
|
-
*
|
|
81
|
-
* @required
|
|
82
|
-
*/
|
|
83
|
-
label: string;
|
|
84
|
-
};
|
|
85
|
-
/**
|
|
86
|
-
* A utility widget that allows users to select one or more items from a list of choices.
|
|
87
|
-
*
|
|
88
|
-
* @name Combobox
|
|
89
|
-
* @phase Utility
|
|
90
|
-
*/
|
|
91
|
-
export declare function Combobox<Item extends ComboboxItemProps>({ itemDisplayCount, items, onChange, value: selectedValues, disabled, id: idProp, isMulti, selectAll: selectAllProp, children, readOnly, refWidth, offsetOptions, description, owner, label, ...props }: ElementProps<ComboboxProps<Item>, 'div'>): import("react/jsx-runtime").JSX.Element;
|
|
92
|
-
/** Copyright 2025 Anywhere Real Estate - CC BY 4.0 */
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useMemo } from 'react';
|
|
3
|
-
import { ListItems } from './ListItems';
|
|
4
|
-
import { Menu } from '../Menu';
|
|
5
|
-
import { Modal } from '../Modal';
|
|
6
|
-
import { useCombobox } from '../../hooks/useCombobox';
|
|
7
|
-
import { useId } from '../../hooks/useId';
|
|
8
|
-
import { useUIContext } from '../../hooks/useUIContext';
|
|
9
|
-
import { cssWithVars } from '../../utils/cwv';
|
|
10
|
-
const DEFAULT = {
|
|
11
|
-
selectAll: 'Select All',
|
|
12
|
-
};
|
|
13
|
-
export const MIN_ITEM_COUNT = 3;
|
|
14
|
-
export const MAX_ITEM_COUNT = 10;
|
|
15
|
-
/**
|
|
16
|
-
* A utility widget that allows users to select one or more items from a list of choices.
|
|
17
|
-
*
|
|
18
|
-
* @name Combobox
|
|
19
|
-
* @phase Utility
|
|
20
|
-
*/
|
|
21
|
-
export function Combobox({ itemDisplayCount, items = [], onChange, value: selectedValues = [], disabled, id: idProp, isMulti, selectAll: selectAllProp, children, readOnly, refWidth, offsetOptions = 4, description, owner, label, ...props }) {
|
|
22
|
-
const menuId = useId(idProp);
|
|
23
|
-
const { isMobile } = useUIContext();
|
|
24
|
-
const { toggleProps, activeIndex, menuProps, closeMenu, isOpen, elements } = useCombobox({
|
|
25
|
-
refOutsideClick: !isMobile,
|
|
26
|
-
refWidth,
|
|
27
|
-
placement: 'bottom-start',
|
|
28
|
-
disabled,
|
|
29
|
-
readOnly,
|
|
30
|
-
offsetOptions,
|
|
31
|
-
});
|
|
32
|
-
const selectAll = useMemo(() => {
|
|
33
|
-
if (!isMulti)
|
|
34
|
-
return false;
|
|
35
|
-
if (selectAllProp && typeof selectAllProp === 'string')
|
|
36
|
-
return selectAllProp;
|
|
37
|
-
return selectAllProp === true ? DEFAULT.selectAll : false;
|
|
38
|
-
}, [isMulti, selectAllProp]);
|
|
39
|
-
const allSelected = useMemo(() => !!(items.length && items.every((item) => selectedValues.includes(item.value))), [items, selectedValues]);
|
|
40
|
-
if (!isOpen)
|
|
41
|
-
return _jsx(_Fragment, { children: children({ toggleProps, setReference: elements.setReference }) });
|
|
42
|
-
/* data-bspk="combobox" -- I don't need a wrapper here and this passes lint. :) */
|
|
43
|
-
return (_jsxs(_Fragment, { children: [children({ toggleProps, setReference: elements.setReference }), isMobile ? (_jsx(Modal, { description: description, header: label, onClose: closeMenu, open: isOpen, owner: owner || undefined, children: _jsx("div", { "aria-multiselectable": isMulti || undefined, id: menuId, role: "listbox", style: { display: 'contents' }, children: _jsx(ListItems, { activeIndex: activeIndex, allSelected: allSelected, "data-testid": "listbox-items", isMulti: isMulti, items: items, menuId: menuId, onChange: (next) => {
|
|
44
|
-
onChange(next);
|
|
45
|
-
if (!isMulti)
|
|
46
|
-
closeMenu();
|
|
47
|
-
}, selectAll: selectAll, selectedValues: selectedValues }) }) })) : (_jsx(Menu, { "aria-multiselectable": isMulti || undefined, "data-bspk": "listbox", "data-disabled": disabled || undefined, "data-no-items": !items.length || undefined, id: menuId, innerRef: (node) => {
|
|
48
|
-
elements.setFloating(node);
|
|
49
|
-
}, itemCount: items.length, itemDisplayCount: itemDisplayCount, onOutsideClick: closeMenu, role: "listbox", style: cssWithVars({
|
|
50
|
-
...props.style,
|
|
51
|
-
...menuProps.style,
|
|
52
|
-
}), tabIndex: -1, children: _jsx(ListItems, { activeIndex: activeIndex, allSelected: allSelected, "data-testid": "listbox-items", isMulti: isMulti, items: items, menuId: menuId, onChange: (nextValue) => {
|
|
53
|
-
onChange(nextValue);
|
|
54
|
-
if (!isMulti)
|
|
55
|
-
closeMenu();
|
|
56
|
-
}, selectAll: selectAll, selectedValues: selectedValues }) }))] }));
|
|
57
|
-
}
|
|
58
|
-
//# sourceMappingURL=Combobox.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Combobox.js","sourceRoot":"","sources":["../../../src/components/Combobox/Combobox.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAa,OAAO,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,OAAO,EAAE,IAAI,EAAa,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,KAAK,EAAc,MAAM,oBAAoB,CAAC;AACvD,OAAO,EAAe,WAAW,EAAoB,MAAM,qBAAqB,CAAC;AACjF,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACtC,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAEpD,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE1C,MAAM,OAAO,GAAG;IACZ,SAAS,EAAE,YAAY;CAC1B,CAAC;AAEF,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,CAAC;AAChC,MAAM,CAAC,MAAM,cAAc,GAAG,EAAE,CAAC;AAiFjC;;;;;GAKG;AACH,MAAM,UAAU,QAAQ,CAAiC,EACrD,gBAAgB,EAChB,KAAK,GAAG,EAAE,EACV,QAAQ,EACR,KAAK,EAAE,cAAc,GAAG,EAAE,EAC1B,QAAQ,EACR,E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oBACd,GAAG,SAAS,CAAC,KAAK;iBACrB,CAAC,EACF,QAAQ,EAAE,CAAC,CAAC,YAEZ,KAAC,SAAS,IACN,WAAW,EAAE,WAAW,EACxB,WAAW,EAAE,WAAW,iBACZ,eAAe,EAC3B,OAAO,EAAE,OAAO,EAChB,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,CAAC,SAAS,EAAE,EAAE;wBACpB,QAAQ,CAAC,SAAS,CAAC,CAAC;wBACpB,IAAI,CAAC,OAAO;4BAAE,SAAS,EAAE,CAAC;oBAC9B,CAAC,EACD,SAAS,EAAE,SAAS,EACpB,cAAc,EAAE,cAAc,GAChC,GACC,CACV,IACF,CACN,CAAC;AACN,CAAC"}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
type Item = {
|
|
2
|
-
value: string;
|
|
3
|
-
label: string;
|
|
4
|
-
disabled?: boolean;
|
|
5
|
-
trailing?: React.ReactNode;
|
|
6
|
-
};
|
|
7
|
-
export type ListItemsProps<I extends Item> = {
|
|
8
|
-
/** Whether the listbox allows multiple selections. */
|
|
9
|
-
isMulti?: boolean;
|
|
10
|
-
/** The items to display in the listbox. */
|
|
11
|
-
items?: I[];
|
|
12
|
-
/** The index of the currently active item. */
|
|
13
|
-
activeIndex?: number;
|
|
14
|
-
/** The values that are currently selected. */
|
|
15
|
-
selectedValues?: string[];
|
|
16
|
-
/** Callback function when the selected values change. */
|
|
17
|
-
onChange?: (nextSelectedValues: string[], event?: React.MouseEvent<HTMLElement, MouseEvent>) => void;
|
|
18
|
-
/** The label for the "Select All" option. */
|
|
19
|
-
selectAll?: string | false;
|
|
20
|
-
/** The ID of the menu for accessibility purposes. */
|
|
21
|
-
menuId?: string;
|
|
22
|
-
/** Whether all items are selected in a multi-select scenario. */
|
|
23
|
-
allSelected?: boolean;
|
|
24
|
-
};
|
|
25
|
-
export declare function ListItems<I extends Item>({ isMulti, items, activeIndex, selectedValues, onChange, selectAll, menuId, allSelected, }: ListItemsProps<I>): import("react/jsx-runtime").JSX.Element;
|
|
26
|
-
export {};
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { createElement as _createElement } from "react";
|
|
2
|
-
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { Checkbox } from '../Checkbox';
|
|
4
|
-
import { ListItem } from '../ListItem';
|
|
5
|
-
export function ListItems({ isMulti = false, items = [], activeIndex, selectedValues = [], onChange, selectAll = false, menuId = '', allSelected = false, }) {
|
|
6
|
-
const multiSelectValue = (selected, itemValue) => {
|
|
7
|
-
return selected ? selectedValues.filter((value) => value !== itemValue) : [...selectedValues, itemValue];
|
|
8
|
-
};
|
|
9
|
-
return (_jsxs(_Fragment, { children: [isMulti && selectAll && (_jsx(ListItem, { as: "label", "data-selected": allSelected || undefined, label: selectAll, onClick: (event) => {
|
|
10
|
-
onChange?.(allSelected ? [] : items.map((item) => item.value), event);
|
|
11
|
-
}, tabIndex: -1, trailing: _jsx(Checkbox, { "aria-label": selectAll, checked: !!allSelected, indeterminate: !allSelected && selectedValues.length > 0, name: "", onChange: (checked) => {
|
|
12
|
-
onChange?.(checked ? items.map((item) => item.value) : []);
|
|
13
|
-
}, value: "" }) }, "select-all")), items.map((item, index) => {
|
|
14
|
-
const selected = Boolean(Array.isArray(selectedValues) && selectedValues.includes(item.value));
|
|
15
|
-
return (_createElement(ListItem, { ...item, active: activeIndex === index || undefined, "aria-disabled": item.disabled || undefined, "aria-selected": selected || undefined, as: isMulti ? 'label' : 'button', disabled: item.disabled || undefined, id: `${menuId}-item-${index}`, key: `${menuId}-item-${index}`, label: item.label, onClick: (event) => {
|
|
16
|
-
onChange?.(isMulti ? multiSelectValue(selected, item.value) : [item.value], event);
|
|
17
|
-
}, tabIndex: -1, trailing: isMulti ? (_jsx(Checkbox, { "aria-label": item.label, checked: selected, name: item.value, onChange: (checked) => {
|
|
18
|
-
onChange?.(multiSelectValue(checked, item.value));
|
|
19
|
-
}, value: item.value })) : (item.trailing || undefined) }));
|
|
20
|
-
})] }));
|
|
21
|
-
}
|
|
22
|
-
//# sourceMappingURL=ListItems.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ListItems.js","sourceRoot":"","sources":["../../../src/components/Combobox/ListItems.tsx"],"names":[],"mappings":";;AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AA4BjD,MAAM,UAAU,SAAS,CAAiB,EACtC,OAAO,GAAG,KAAK,EACf,KAAK,GAAG,EAAE,EACV,WAAW,EACX,cAAc,GAAG,EAAE,EACnB,QAAQ,EACR,SAAS,GAAG,KAAK,EACjB,MAAM,GAAG,EAAE,EACX,WAAW,GAAG,KAAK,GACH;IAChB,MAAM,gBAAgB,GAAG,CAAC,QAAiB,EAAE,SAAiB,EAAE,EAAE;QAC9D,OAAO,QAAQ,CAAC,CAAC,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,cAAc,EAAE,SAAS,CAAC,CAAC;IAC7G,CAAC,CAAC;IAEF,OAAO,CACH,8BACK,OAAO,IAAI,SAAS,IAAI,CACrB,KAAC,QAAQ,IACL,EAAE,EAAC,OAAO,mBACK,WAAW,IAAI,SAAS,EAEvC,KAAK,EAAE,SAAS,EAChB,OAAO,EAAE,CAAC,KAAgD,EAAE,EAAE;oBAC1D,QAAQ,EAAE,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,KAAK,CAAC,CAAC;gBAC1E,CAAC,EACD,QAAQ,EAAE,CAAC,CAAC,EACZ,QAAQ,EACJ,KAAC,QAAQ,kBACO,SAAS,EACr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,CAAC;oBACvF,CAAC,EACD,QAAQ,EAAE,CAAC,CAAC,EACZ,QAAQ,EACJ,OAAO,CAAC,CAAC,CAAC,CACN,KAAC,QAAQ,kBACO,IAAI,CAAC,KAAK,EACtB,OAAO,EAAE,QAAQ,EACjB,IAAI,EAAE,IAAI,CAAC,KAAK,EAChB,QAAQ,EAAE,CAAC,OAAO,EAAE,EAAE;4BAClB,QAAQ,EAAE,CAAC,gBAAgB,CAAC,OAAO,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;wBACtD,CAAC,EACD,KAAK,EAAE,IAAI,CAAC,KAAK,GACnB,CACL,CAAC,CAAC,CAAC,CACA,IAAI,CAAC,QAAQ,IAAI,SAAS,CAC7B,GAEP,CACL,CAAC;YACN,CAAC,CAAC,IACH,CACN,CAAC;AACN,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './Combobox';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/Combobox/index.tsx"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC"}
|
|
@@ -1,116 +0,0 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
import { ListItemProps } from '-/components/ListItem';
|
|
3
|
-
import { MenuProps } from '-/components/Menu';
|
|
4
|
-
import { CommonProps, ElementProps, SetRef } from '-/types/common';
|
|
5
|
-
/** The props for the listbox items. */
|
|
6
|
-
export type ListboxItemProps = CommonProps<'disabled'> & ListItemProps & {
|
|
7
|
-
/** The content to display in the listbox item. */
|
|
8
|
-
label: string;
|
|
9
|
-
/** The value of the listbox item. */
|
|
10
|
-
value: string;
|
|
11
|
-
};
|
|
12
|
-
export type ListboxProps<Item extends ListboxItemProps = ListboxItemProps> = CommonProps<'disabled' | 'id'> & Pick<MenuProps, 'itemCount' | 'itemDisplayCount' | 'onOutsideClick' | 'owner'> & {
|
|
13
|
-
/**
|
|
14
|
-
* Content to display in the listbox.
|
|
15
|
-
*
|
|
16
|
-
* @example
|
|
17
|
-
* [
|
|
18
|
-
* { value: '1', label: 'Option 1' },
|
|
19
|
-
* { value: '2', label: 'Option 2' },
|
|
20
|
-
* { value: '3', label: 'Option 3' },
|
|
21
|
-
* { value: '4', label: 'Option 4' },
|
|
22
|
-
* { value: '5', label: 'Option 5' },
|
|
23
|
-
* { value: '6', label: 'Option 6' },
|
|
24
|
-
* { value: '7', label: 'Option 7' },
|
|
25
|
-
* { value: '8', label: 'Option 8' },
|
|
26
|
-
* { value: '9', label: 'Option 9' },
|
|
27
|
-
* { value: '10', label: 'Option 10' },
|
|
28
|
-
* ];
|
|
29
|
-
*
|
|
30
|
-
* @type Array<MenuItem>
|
|
31
|
-
*/
|
|
32
|
-
items?: Item[];
|
|
33
|
-
/** A ref to the inner div element. */
|
|
34
|
-
innerRef?: SetRef<HTMLDivElement>;
|
|
35
|
-
/**
|
|
36
|
-
* The index of the currently highlighted item.
|
|
37
|
-
*
|
|
38
|
-
* @default undefined
|
|
39
|
-
*/
|
|
40
|
-
activeIndex?: number;
|
|
41
|
-
/** The values of the selected items */
|
|
42
|
-
selectedValues?: string[];
|
|
43
|
-
/** A function which returns additional ListItem props to apply to each ListItem. */
|
|
44
|
-
listItemProps?: (props: {
|
|
45
|
-
index: number;
|
|
46
|
-
item: Item;
|
|
47
|
-
selected: boolean;
|
|
48
|
-
}) => Partial<ListItemProps<'button'>>;
|
|
49
|
-
/**
|
|
50
|
-
* Whether the listbox allows multiple selections.
|
|
51
|
-
*
|
|
52
|
-
* @default false
|
|
53
|
-
*/
|
|
54
|
-
isMulti?: boolean;
|
|
55
|
-
/**
|
|
56
|
-
* The label for the "Select All" option.
|
|
57
|
-
*
|
|
58
|
-
* Ignored if `isMulti` is false.
|
|
59
|
-
*
|
|
60
|
-
* If `isMulti` is `true`, defaults to "Select All". If a string, it will be used as the label. If false the
|
|
61
|
-
* select all option will not be rendered.
|
|
62
|
-
*
|
|
63
|
-
* @default false
|
|
64
|
-
*/
|
|
65
|
-
selectAll?: boolean | string;
|
|
66
|
-
/**
|
|
67
|
-
* The function to call when the selected values change.
|
|
68
|
-
*
|
|
69
|
-
* @example
|
|
70
|
-
* (selectedValues, event) => setState({ selectedValues });
|
|
71
|
-
*/
|
|
72
|
-
onChange?: (selectedValues: string[], event?: React.MouseEvent<HTMLElement, MouseEvent>) => void;
|
|
73
|
-
/**
|
|
74
|
-
* The children of the listbox added after the items.
|
|
75
|
-
*
|
|
76
|
-
* Usually only used for showing no items found.
|
|
77
|
-
*/
|
|
78
|
-
children?: ReactNode;
|
|
79
|
-
includeAriaLabel?: boolean;
|
|
80
|
-
};
|
|
81
|
-
/**
|
|
82
|
-
* A utility widget that allows users to select one or more items from a list of choices.
|
|
83
|
-
*
|
|
84
|
-
* @example
|
|
85
|
-
* import React from 'react';
|
|
86
|
-
*
|
|
87
|
-
* import { ListBox } from '@bspk/ui/ListBox';
|
|
88
|
-
*
|
|
89
|
-
* export function Example() {
|
|
90
|
-
* const [selected, setSelected] = React.useState<string[]>([]);
|
|
91
|
-
*
|
|
92
|
-
* return (
|
|
93
|
-
* <ListBox
|
|
94
|
-
* items={[
|
|
95
|
-
* { value: '1', label: 'Option 1' },
|
|
96
|
-
* { value: '2', label: 'Option 2' },
|
|
97
|
-
* { value: '3', label: 'Option 3' },
|
|
98
|
-
* { value: '4', label: 'Option 4' },
|
|
99
|
-
* { value: '5', label: 'Option 5' },
|
|
100
|
-
* { value: '6', label: 'Option 6' },
|
|
101
|
-
* { value: '7', label: 'Option 7' },
|
|
102
|
-
* { value: '8', label: 'Option 8' },
|
|
103
|
-
* { value: '9', label: 'Option 9' },
|
|
104
|
-
* { value: '10', label: 'Option 10' },
|
|
105
|
-
* ]}
|
|
106
|
-
* onChange={(selectedValues: string[]) => setSelected(selectedValues)}
|
|
107
|
-
* selectedValues={selected}
|
|
108
|
-
* />
|
|
109
|
-
* );
|
|
110
|
-
* }
|
|
111
|
-
*
|
|
112
|
-
* @name Listbox
|
|
113
|
-
* @phase Utility
|
|
114
|
-
*/
|
|
115
|
-
export declare function Listbox<Item extends ListboxItemProps>({ includeAriaLabel, itemDisplayCount, itemCount, items, innerRef, onChange, activeIndex, selectedValues, disabled, id: idProp, listItemProps, isMulti, selectAll: selectAllProp, children, owner, ...props }: ElementProps<ListboxProps<Item>, 'div'>): import("react/jsx-runtime").JSX.Element;
|
|
116
|
-
/** Copyright 2025 Anywhere Real Estate - CC BY 4.0 */
|
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
import { createElement as _createElement } from "react";
|
|
2
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { useMemo } from 'react';
|
|
4
|
-
import { Checkbox } from '../Checkbox';
|
|
5
|
-
import { ListItem } from '../ListItem';
|
|
6
|
-
import { Menu } from '../Menu';
|
|
7
|
-
import { useId } from '../../hooks/useId';
|
|
8
|
-
const DEFAULT = {
|
|
9
|
-
selectAll: 'Select All',
|
|
10
|
-
};
|
|
11
|
-
/**
|
|
12
|
-
* A utility widget that allows users to select one or more items from a list of choices.
|
|
13
|
-
*
|
|
14
|
-
* @example
|
|
15
|
-
* import React from 'react';
|
|
16
|
-
*
|
|
17
|
-
* import { ListBox } from '@bspk/ui/ListBox';
|
|
18
|
-
*
|
|
19
|
-
* export function Example() {
|
|
20
|
-
* const [selected, setSelected] = React.useState<string[]>([]);
|
|
21
|
-
*
|
|
22
|
-
* return (
|
|
23
|
-
* <ListBox
|
|
24
|
-
* items={[
|
|
25
|
-
* { value: '1', label: 'Option 1' },
|
|
26
|
-
* { value: '2', label: 'Option 2' },
|
|
27
|
-
* { value: '3', label: 'Option 3' },
|
|
28
|
-
* { value: '4', label: 'Option 4' },
|
|
29
|
-
* { value: '5', label: 'Option 5' },
|
|
30
|
-
* { value: '6', label: 'Option 6' },
|
|
31
|
-
* { value: '7', label: 'Option 7' },
|
|
32
|
-
* { value: '8', label: 'Option 8' },
|
|
33
|
-
* { value: '9', label: 'Option 9' },
|
|
34
|
-
* { value: '10', label: 'Option 10' },
|
|
35
|
-
* ]}
|
|
36
|
-
* onChange={(selectedValues: string[]) => setSelected(selectedValues)}
|
|
37
|
-
* selectedValues={selected}
|
|
38
|
-
* />
|
|
39
|
-
* );
|
|
40
|
-
* }
|
|
41
|
-
*
|
|
42
|
-
* @name Listbox
|
|
43
|
-
* @phase Utility
|
|
44
|
-
*/
|
|
45
|
-
export function Listbox({ includeAriaLabel, itemDisplayCount, itemCount, items = [], innerRef, onChange, activeIndex, selectedValues = [], disabled, id: idProp, listItemProps, isMulti, selectAll: selectAllProp, children, owner, ...props }) {
|
|
46
|
-
const menuId = useId(idProp);
|
|
47
|
-
const selectAll = useMemo(() => {
|
|
48
|
-
if (!isMulti)
|
|
49
|
-
return false;
|
|
50
|
-
if (selectAllProp && typeof selectAllProp === 'string')
|
|
51
|
-
return selectAllProp;
|
|
52
|
-
return selectAllProp === true ? DEFAULT.selectAll : false;
|
|
53
|
-
}, [isMulti, selectAllProp]);
|
|
54
|
-
const allSelected = useMemo(() => !!(items.length && items.every((item) => selectedValues.includes(item.value))), [items, selectedValues]);
|
|
55
|
-
return (_jsxs(Menu, { ...props, "aria-multiselectable": isMulti || undefined, "data-bspk": "listbox", "data-bspk-owner": owner || undefined, "data-disabled": disabled || undefined, "data-no-items": !items.length || undefined, id: menuId, innerRef: innerRef, itemCount: itemCount || items.length, itemDisplayCount: itemDisplayCount || items.length, role: "listbox", children: [isMulti && selectAll && (_jsx(ListItem, { as: "label", "data-selected": allSelected || undefined, id: `${menuId}-select-all`, label: selectAll, onClick: (event) => {
|
|
56
|
-
onChange?.(allSelected ? [] : items.map((item) => item.value), event);
|
|
57
|
-
}, role: "option", trailing: _jsx(Checkbox, { "aria-label": selectAll, checked: !!allSelected, indeterminate: !allSelected && selectedValues.length > 0, name: "", onChange: (checked) => {
|
|
58
|
-
onChange?.(checked ? items.map((item) => item.value) : []);
|
|
59
|
-
}, value: "" }) }, "select-all")), items.map((item, index) => {
|
|
60
|
-
const selected = Boolean(Array.isArray(selectedValues) && selectedValues.includes(item.value));
|
|
61
|
-
const renderProps = listItemProps?.({
|
|
62
|
-
selected,
|
|
63
|
-
index,
|
|
64
|
-
item,
|
|
65
|
-
});
|
|
66
|
-
return (_createElement(ListItem, { ...item, ...renderProps, active: activeIndex === index || undefined, "aria-disabled": item.disabled || undefined, "aria-selected": selected || undefined, as: isMulti ? 'label' : 'button', disabled: item.disabled || undefined, id: `${menuId}-item-${index}`, includeAriaLabel: includeAriaLabel, key: `${menuId}-item-${index}`, label: renderProps?.label?.toString() || item.label?.toString(), onClick: (event) => {
|
|
67
|
-
if (onChange) {
|
|
68
|
-
if (!isMulti) {
|
|
69
|
-
onChange?.([item.value], event);
|
|
70
|
-
return;
|
|
71
|
-
}
|
|
72
|
-
onChange(selected
|
|
73
|
-
? selectedValues.filter((value) => value !== item.value)
|
|
74
|
-
: [...selectedValues, item.value], event);
|
|
75
|
-
}
|
|
76
|
-
}, role: "option", trailing: isMulti ? (_jsx(Checkbox, { "aria-label": item.label, checked: selected, name: item.value, onChange: (checked) => {
|
|
77
|
-
onChange?.(checked
|
|
78
|
-
? selectedValues.filter((value) => value !== item.value)
|
|
79
|
-
: [...selectedValues, item.value]);
|
|
80
|
-
}, value: item.value })) : (renderProps?.trailing || item.trailing || undefined) }));
|
|
81
|
-
}), children] }));
|
|
82
|
-
}
|
|
83
|
-
//# sourceMappingURL=Listbox.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Listbox.js","sourceRoot":"","sources":["../../../src/components/Listbox/Listbox.tsx"],"names":[],"mappings":";;AAAA,OAAO,EAAa,OAAO,EAAE,MAAM,OAAO,CAAC;AAE3C,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,EAAE,QAAQ,EAAiB,MAAM,uBAAuB,CAAC;AAChE,OAAO,EAAE,IAAI,EAAa,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,KAAK,EAAE,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,EACjB,IAAI,EAAE,IAAI,CAAC,KAAK,EAChB,QAAQ,EAAE,CAAC,OAAO,EAAE,EAAE;4BAClB,QAAQ,EAAE,CACN,OAAO;gCACH,CAAC,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,KAAK,IAAI,CAAC,KAAK,CAAC;gCACxD,CAAC,CAAC,CAAC,GAAG,cAAc,EAAE,IAAI,CAAC,KAAK,CAAC,CACxC,CAAC;wBACN,CAAC,EACD,KAAK,EAAE,IAAI,CAAC,KAAK,GACnB,CACL,CAAC,CAAC,CAAC,CACA,WAAW,EAAE,QAAQ,IAAI,IAAI,CAAC,QAAQ,IAAI,SAAS,CACtD,GAEP,CACL,CAAC;YACN,CAAC,CAAC,EACD,QAAQ,IACN,CACV,CAAC;AACN,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './Listbox';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/Listbox/index.tsx"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC"}
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import { AriaAttributes } from 'react';
|
|
2
|
-
import { UseFloatingElements, UseFloatingProps } from './useFloating';
|
|
3
|
-
import { CommonProps } from '-/types/common';
|
|
4
|
-
export type UseComboboxProps = CommonProps<'disabled' | 'readOnly'> & Pick<UseFloatingProps, 'offsetOptions' | 'placement' | 'refWidth'> & {
|
|
5
|
-
/**
|
|
6
|
-
* The element to use for outside click detection.
|
|
7
|
-
*
|
|
8
|
-
* If set to true, it will use the floating, and reference elements.
|
|
9
|
-
*
|
|
10
|
-
* If set to HTMLElements, it will use those element for outside click detection.
|
|
11
|
-
*
|
|
12
|
-
* If set to false, it will not use outside click detection.
|
|
13
|
-
*/
|
|
14
|
-
refOutsideClick?: HTMLElement[] | boolean;
|
|
15
|
-
};
|
|
16
|
-
export type ComboboxContext = ReturnType<typeof useCombobox>;
|
|
17
|
-
export type ToggleProps = {
|
|
18
|
-
'aria-errormessage'?: string | undefined;
|
|
19
|
-
'aria-activedescendant'?: string | undefined;
|
|
20
|
-
'aria-controls': string;
|
|
21
|
-
'aria-disabled'?: boolean | undefined;
|
|
22
|
-
'aria-expanded': boolean;
|
|
23
|
-
'aria-haspopup': AriaAttributes['aria-haspopup'];
|
|
24
|
-
'aria-invalid'?: boolean | undefined;
|
|
25
|
-
'aria-owns': string;
|
|
26
|
-
'aria-readonly'?: boolean | undefined;
|
|
27
|
-
role: 'combobox';
|
|
28
|
-
tabIndex: number;
|
|
29
|
-
onClick: () => void;
|
|
30
|
-
onKeyDownCapture: (event: React.KeyboardEvent) => boolean;
|
|
31
|
-
};
|
|
32
|
-
/**
|
|
33
|
-
* Utility hook to manage a combobox component.
|
|
34
|
-
*
|
|
35
|
-
* It provides functionality for showing/hiding the menu, handling keyboard navigation, and managing ARIA attributes.
|
|
36
|
-
*
|
|
37
|
-
* @param {UseComboboxProps} props - The properties to configure the combobox.
|
|
38
|
-
* @returns An object containing props for the menu and toggle elements, and a function to close the menu.
|
|
39
|
-
*/
|
|
40
|
-
export declare function useCombobox({ placement, refWidth, disabled, readOnly, offsetOptions, }: UseComboboxProps): {
|
|
41
|
-
activeIndex: number;
|
|
42
|
-
menuProps: {
|
|
43
|
-
'data-placement': string | undefined;
|
|
44
|
-
id: string;
|
|
45
|
-
role: 'listbox';
|
|
46
|
-
style: React.CSSProperties;
|
|
47
|
-
tabIndex: -1;
|
|
48
|
-
onOutsideClick: () => void;
|
|
49
|
-
};
|
|
50
|
-
toggleProps: ToggleProps;
|
|
51
|
-
closeMenu: () => void;
|
|
52
|
-
isOpen: boolean;
|
|
53
|
-
elements: UseFloatingElements;
|
|
54
|
-
openMenu: () => void;
|
|
55
|
-
};
|
|
56
|
-
/** Copyright 2025 Anywhere Real Estate - CC BY 4.0 */
|
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
import { useState } from 'react';
|
|
2
|
-
import { useFloating } from './useFloating';
|
|
3
|
-
import { useId } from './useId';
|
|
4
|
-
import { EVENT_KEY } from '../utils/keyboard';
|
|
5
|
-
import { scrollElementIntoView } from '../utils/scrollElementIntoView';
|
|
6
|
-
function useKeyDownNavigation(containerElement, setShow, disabled) {
|
|
7
|
-
const [activeIndex, setActiveIndex] = useState(-1);
|
|
8
|
-
const itemElements = Array.from(containerElement?.children || []);
|
|
9
|
-
const selectedId = itemElements[activeIndex]?.id;
|
|
10
|
-
const onKeyDownCapture = (event) => {
|
|
11
|
-
if (disabled)
|
|
12
|
-
return false;
|
|
13
|
-
if (event.key === EVENT_KEY.Tab || event.key === EVENT_KEY.Escape) {
|
|
14
|
-
setShow(false);
|
|
15
|
-
return true;
|
|
16
|
-
}
|
|
17
|
-
if (event.key !== EVENT_KEY.Enter && event.key !== EVENT_KEY[' '] && !event.key.startsWith('Arrow'))
|
|
18
|
-
return false;
|
|
19
|
-
if (event.key.startsWith('Arrow') && !containerElement) {
|
|
20
|
-
event.preventDefault();
|
|
21
|
-
setShow(true);
|
|
22
|
-
setActiveIndex(0);
|
|
23
|
-
return true;
|
|
24
|
-
}
|
|
25
|
-
if (!containerElement?.children.length)
|
|
26
|
-
return false;
|
|
27
|
-
event.preventDefault();
|
|
28
|
-
if ((event.key === EVENT_KEY[' '] || event.key === EVENT_KEY.Enter) && activeIndex !== -1) {
|
|
29
|
-
itemElements[activeIndex].click();
|
|
30
|
-
return true;
|
|
31
|
-
}
|
|
32
|
-
let next = 0;
|
|
33
|
-
if (event.key === EVENT_KEY.ArrowUp || event.key === EVENT_KEY.ArrowLeft)
|
|
34
|
-
next = activeIndex - 1;
|
|
35
|
-
if (event.key === EVENT_KEY.ArrowDown || event.key === EVENT_KEY.ArrowRight)
|
|
36
|
-
next = activeIndex + 1;
|
|
37
|
-
if (next < 0)
|
|
38
|
-
next = itemElements.length - 1;
|
|
39
|
-
if (next >= itemElements.length)
|
|
40
|
-
next = 0;
|
|
41
|
-
itemElements.forEach((el, index) => {
|
|
42
|
-
if (index === next)
|
|
43
|
-
el.setAttribute('data-selected', 'true');
|
|
44
|
-
else
|
|
45
|
-
el.removeAttribute('data-selected');
|
|
46
|
-
});
|
|
47
|
-
scrollElementIntoView(itemElements[next], containerElement);
|
|
48
|
-
setActiveIndex(next);
|
|
49
|
-
return true;
|
|
50
|
-
};
|
|
51
|
-
return { onKeyDownCapture, selectedId, activeIndex };
|
|
52
|
-
}
|
|
53
|
-
/**
|
|
54
|
-
* Utility hook to manage a combobox component.
|
|
55
|
-
*
|
|
56
|
-
* It provides functionality for showing/hiding the menu, handling keyboard navigation, and managing ARIA attributes.
|
|
57
|
-
*
|
|
58
|
-
* @param {UseComboboxProps} props - The properties to configure the combobox.
|
|
59
|
-
* @returns An object containing props for the menu and toggle elements, and a function to close the menu.
|
|
60
|
-
*/
|
|
61
|
-
export function useCombobox({ placement = 'bottom', refWidth = true, disabled, readOnly, offsetOptions, }) {
|
|
62
|
-
const menuId = useId();
|
|
63
|
-
const [show, setShow] = useState(false);
|
|
64
|
-
const { floatingStyles, middlewareData, elements } = useFloating({
|
|
65
|
-
placement,
|
|
66
|
-
strategy: 'fixed',
|
|
67
|
-
offsetOptions,
|
|
68
|
-
refWidth,
|
|
69
|
-
hide: !show,
|
|
70
|
-
});
|
|
71
|
-
const { onKeyDownCapture, activeIndex, selectedId } = useKeyDownNavigation(elements.floating, setShow, disabled || readOnly);
|
|
72
|
-
return {
|
|
73
|
-
activeIndex,
|
|
74
|
-
menuProps: {
|
|
75
|
-
'data-placement': middlewareData?.offset?.placement,
|
|
76
|
-
id: menuId,
|
|
77
|
-
role: 'listbox',
|
|
78
|
-
style: floatingStyles,
|
|
79
|
-
tabIndex: -1,
|
|
80
|
-
onOutsideClick: () => setShow(false),
|
|
81
|
-
},
|
|
82
|
-
toggleProps: {
|
|
83
|
-
'aria-activedescendant': selectedId || undefined,
|
|
84
|
-
'aria-controls': menuId,
|
|
85
|
-
'aria-disabled': disabled || undefined,
|
|
86
|
-
'aria-expanded': show,
|
|
87
|
-
'aria-haspopup': 'listbox',
|
|
88
|
-
'aria-owns': menuId,
|
|
89
|
-
'aria-readonly': readOnly || undefined,
|
|
90
|
-
role: 'combobox',
|
|
91
|
-
tabIndex: 0,
|
|
92
|
-
onClick: () => {
|
|
93
|
-
setShow((prev) => !prev);
|
|
94
|
-
},
|
|
95
|
-
onKeyDownCapture,
|
|
96
|
-
},
|
|
97
|
-
closeMenu: () => setShow(false),
|
|
98
|
-
openMenu: () => setShow(true),
|
|
99
|
-
isOpen: show,
|
|
100
|
-
elements,
|
|
101
|
-
};
|
|
102
|
-
}
|
|
103
|
-
/** Copyright 2025 Anywhere Real Estate - CC BY 4.0 */
|
|
104
|
-
//# sourceMappingURL=useCombobox.js.map
|