@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
|
@@ -6,6 +6,7 @@ style.appendChild(document.createTextNode(`[data-bspk=list-item] {
|
|
|
6
6
|
width: 100%;
|
|
7
7
|
user-select: none;
|
|
8
8
|
color: var(--foreground-neutral-on-surface);
|
|
9
|
+
background-color: var(--surface-neutral-t1-base);
|
|
9
10
|
height: 100%;
|
|
10
11
|
overflow: hidden;
|
|
11
12
|
min-height: var(--list-item-height);
|
|
@@ -13,7 +14,6 @@ style.appendChild(document.createTextNode(`[data-bspk=list-item] {
|
|
|
13
14
|
gap: var(--spacing-sizing-03);
|
|
14
15
|
padding: var(--spacing-sizing-02);
|
|
15
16
|
justify-items: stretch;
|
|
16
|
-
background: unset;
|
|
17
17
|
border: unset;
|
|
18
18
|
margin: unset;
|
|
19
19
|
text-decoration: unset;
|
|
@@ -24,16 +24,12 @@ style.appendChild(document.createTextNode(`[data-bspk=list-item] {
|
|
|
24
24
|
[data-pseudo=focus] [data-bspk=list-item] [data-inner], [data-bspk=list-item]:focus-visible [data-inner], [data-bspk=list-item]:has(*:focus-visible) [data-inner] {
|
|
25
25
|
border-color: transparent;
|
|
26
26
|
}
|
|
27
|
-
[data-pseudo=hover] [data-bspk=list-item][data-action], [data-bspk=list-item][data-action]:hover {
|
|
27
|
+
[data-bspk=list-item][data-action][data-active], [data-pseudo=hover] [data-bspk=list-item][data-action], [data-bspk=list-item][data-action]:hover, [data-bspk=list-item]:is(label)[data-active], [data-pseudo=hover] [data-bspk=list-item]:is(label), [data-bspk=list-item]:is(label):hover {
|
|
28
28
|
background-color: var(--interactions-neutral-hover-opacity);
|
|
29
29
|
}
|
|
30
|
-
[data-pseudo=active] [data-bspk=list-item][data-action], [data-bspk=list-item][data-action][data-active]
|
|
30
|
+
[data-pseudo=active] [data-bspk=list-item][data-action], [data-bspk=list-item][data-action]:active, [data-pseudo=active] [data-bspk=list-item]:is(label), [data-bspk=list-item]:is(label):active {
|
|
31
31
|
background-color: var(--interactions-neutral-press-opacity);
|
|
32
32
|
}
|
|
33
|
-
[data-bspk=list-item][aria-disabled] [data-text],
|
|
34
|
-
[data-bspk=list-item][aria-disabled] [data-sub-text] {
|
|
35
|
-
color: var(--foreground-neutral-disabled-on-surface);
|
|
36
|
-
}
|
|
37
33
|
[data-bspk=list-item] [data-leading],
|
|
38
34
|
[data-bspk=list-item] [data-item-label],
|
|
39
35
|
[data-bspk=list-item] [data-trailing] {
|
|
@@ -68,6 +64,10 @@ style.appendChild(document.createTextNode(`[data-bspk=list-item] {
|
|
|
68
64
|
font: var(--body-small);
|
|
69
65
|
color: var(--foreground-neutral-on-surface-variant-01);
|
|
70
66
|
}
|
|
67
|
+
[data-bspk=list-item][aria-disabled] [data-text],
|
|
68
|
+
[data-bspk=list-item][aria-disabled] [data-sub-text] {
|
|
69
|
+
color: var(--foreground-neutral-disabled-on-surface);
|
|
70
|
+
}
|
|
71
71
|
[data-bspk=list-item] [data-trailing]:has(input) {
|
|
72
72
|
pointer-events: none;
|
|
73
73
|
}
|
|
@@ -80,6 +80,9 @@ style.appendChild(document.createTextNode(`[data-bspk=list-item] {
|
|
|
80
80
|
border-bottom: 0;
|
|
81
81
|
gap: var(--spacing-sizing-02);
|
|
82
82
|
}
|
|
83
|
+
[data-bspk=list-item][aria-selected=true] {
|
|
84
|
+
background-color: var(--surface-brand-primary-highlight);
|
|
85
|
+
}
|
|
83
86
|
|
|
84
87
|
/** Copyright 2025 Anywhere Real Estate - CC BY 4.0 */
|
|
85
88
|
`));
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
import { AriaAttributes, CSSProperties, HTMLAttributes, ReactNode, KeyboardEvent, MouseEvent, Dispatch, SetStateAction } from 'react';
|
|
2
|
+
import { ListItemProps } from '-/components/ListItem';
|
|
3
|
+
import { MenuProps } from '-/components/Menu';
|
|
4
|
+
import { ArrowKeyNavigationCallbackParams } from '-/hooks/useArrowNavigation';
|
|
5
|
+
import { UseFloatingProps } from '-/hooks/useFloating';
|
|
6
|
+
import { CommonProps, SetRef } from '-/types/common';
|
|
7
|
+
export type MenuListItem = Omit<ListItemProps, 'id'> & {
|
|
8
|
+
id: string;
|
|
9
|
+
};
|
|
10
|
+
export type ListItemMenuRole = keyof typeof LIST_ITEM_ROLES;
|
|
11
|
+
declare const LIST_ITEM_ROLES: {
|
|
12
|
+
readonly group: undefined;
|
|
13
|
+
readonly listbox: "option";
|
|
14
|
+
readonly menu: "menuitem";
|
|
15
|
+
readonly tree: "treeitem";
|
|
16
|
+
};
|
|
17
|
+
/** Props for the toggle element that opens the ListItemMenu. */
|
|
18
|
+
export type ToggleProps = Pick<AriaAttributes, 'aria-activedescendant' | 'aria-controls' | 'aria-disabled' | 'aria-errormessage' | 'aria-expanded' | 'aria-haspopup' | 'aria-invalid' | 'aria-owns' | 'aria-readonly'> & Pick<HTMLAttributes<HTMLElement>, 'role' | 'tabIndex'> & {
|
|
19
|
+
/** Event handler for the toggle element that change the menu state. */
|
|
20
|
+
onClick: (event: MouseEvent<HTMLElement>) => void;
|
|
21
|
+
/** Event handler for keydown events on the toggle element that change the menu state. */
|
|
22
|
+
onKeyDownCapture: (event: KeyboardEvent) => void;
|
|
23
|
+
};
|
|
24
|
+
/** Props for internal toggle functionality provided to the children render prop. */
|
|
25
|
+
export type InternalToggleProps = {
|
|
26
|
+
/**
|
|
27
|
+
* Sets a ref to the toggle element that opens the ListItemMenu.
|
|
28
|
+
*
|
|
29
|
+
* Used in determining the position of the floating menu.
|
|
30
|
+
*
|
|
31
|
+
* May also be used to set the menu width if `width="reference"` is provided in the ListItemMenu props.
|
|
32
|
+
*/
|
|
33
|
+
setRef: SetRef<HTMLElement | null>;
|
|
34
|
+
/**
|
|
35
|
+
* Function to toggle the menu open or closed.
|
|
36
|
+
*
|
|
37
|
+
* If `force` is provided as a boolean, it will set the menu to that state (true = open, false = closed). If `force`
|
|
38
|
+
* is not provided, it will toggle the current state.
|
|
39
|
+
*/
|
|
40
|
+
toggleMenu: (force?: boolean) => void;
|
|
41
|
+
/** The number of items in the menu. */
|
|
42
|
+
itemCount: number;
|
|
43
|
+
/** Whether or not the menu is currently open. */
|
|
44
|
+
show?: boolean;
|
|
45
|
+
/** The reference element the menu is anchored to. */
|
|
46
|
+
reference: HTMLElement | null;
|
|
47
|
+
};
|
|
48
|
+
export type ListItemMenuProps = CommonProps<'disabled' | 'readOnly'> & Pick<MenuProps, 'id' | 'label' | 'owner'> & Pick<UseFloatingProps, 'offsetOptions' | 'placement'> & {
|
|
49
|
+
/**
|
|
50
|
+
* The children to render inside the menu.
|
|
51
|
+
*
|
|
52
|
+
* @required
|
|
53
|
+
*/
|
|
54
|
+
children: (toggleProps: ToggleProps, internal: InternalToggleProps) => ReactNode;
|
|
55
|
+
/**
|
|
56
|
+
* The element that the menu is anchored to.
|
|
57
|
+
*
|
|
58
|
+
* @default listbox
|
|
59
|
+
*/
|
|
60
|
+
role?: ListItemMenuRole;
|
|
61
|
+
/**
|
|
62
|
+
* The width of the menu. If 'reference' is provided, the menu will match the width of the useFloating reference
|
|
63
|
+
* element.
|
|
64
|
+
*
|
|
65
|
+
* @default reference
|
|
66
|
+
*/
|
|
67
|
+
width?: CSSProperties['width'] | 'reference';
|
|
68
|
+
/**
|
|
69
|
+
* The items to display in the menu as ListItems.
|
|
70
|
+
*
|
|
71
|
+
* If an item does not have an `id` property, one will be generated automatically.
|
|
72
|
+
*
|
|
73
|
+
* @required
|
|
74
|
+
*/
|
|
75
|
+
items: MenuListItem[] | ((params: {
|
|
76
|
+
show?: boolean;
|
|
77
|
+
}) => MenuListItem[]);
|
|
78
|
+
/**
|
|
79
|
+
* Content to display in the floating menu element before the ListItems.
|
|
80
|
+
*
|
|
81
|
+
* If provided `scrollLimit` will be ignored.
|
|
82
|
+
*/
|
|
83
|
+
leading?: ReactNode;
|
|
84
|
+
/**
|
|
85
|
+
* Content to display in the floating menu element after the ListItems.
|
|
86
|
+
*
|
|
87
|
+
* If provided `scrollLimit` will be ignored.
|
|
88
|
+
*/
|
|
89
|
+
trailing?: ReactNode;
|
|
90
|
+
/** The ID of the currently active element. */
|
|
91
|
+
activeElementId?: string | null;
|
|
92
|
+
/** Optional callback fired when an item is clicked/selected. */
|
|
93
|
+
itemOnClick?: (params: {
|
|
94
|
+
event: MouseEvent;
|
|
95
|
+
currentId: string;
|
|
96
|
+
show: boolean;
|
|
97
|
+
setShow: Dispatch<SetStateAction<boolean>>;
|
|
98
|
+
}) => void;
|
|
99
|
+
/**
|
|
100
|
+
* Optional callback fired when the arrow keys are used for navigation.
|
|
101
|
+
*
|
|
102
|
+
* If the callback returns `true`, the change is accepted; if it returns `false`, the change is ignored.
|
|
103
|
+
*/
|
|
104
|
+
arrowKeyNavigationCallback?: (params: ArrowKeyNavigationCallbackParams) => boolean;
|
|
105
|
+
/** Optional callback fired when the menu is closed. */
|
|
106
|
+
onClose?: () => void;
|
|
107
|
+
/** The maximum number of items to show before scrolling is enabled. */
|
|
108
|
+
scrollLimit?: number;
|
|
109
|
+
/** Remove menu from dom when closed for performance and to prevent tabbing to hidden menu items. */
|
|
110
|
+
hideWhenClosed?: boolean;
|
|
111
|
+
};
|
|
112
|
+
/**
|
|
113
|
+
* A floating list Item menu for displaying additional actions or options presented as ListItems in a Menu.
|
|
114
|
+
*
|
|
115
|
+
* Includes keyboard navigation and accessibility features.
|
|
116
|
+
*
|
|
117
|
+
* The menu is anchored to a reference element provided as a children function with params that include the necessary
|
|
118
|
+
* ARIA attributes and event handlers.
|
|
119
|
+
*
|
|
120
|
+
* @example
|
|
121
|
+
* import { ListItemMenu } from '@bspk/ui/ListItemMenu';
|
|
122
|
+
*
|
|
123
|
+
* function Example() {
|
|
124
|
+
* return (
|
|
125
|
+
* <ListItemMenu
|
|
126
|
+
* items={[{ id: '1', label: 'Item 1' }]}
|
|
127
|
+
* label="Example Menu"
|
|
128
|
+
* role="menu"
|
|
129
|
+
* scrollLimit={5}
|
|
130
|
+
* width="200px"
|
|
131
|
+
* >
|
|
132
|
+
* {(toggleProps, { setRef, toggleMenu }) => (
|
|
133
|
+
* <button {...toggleProps} onClick={() => toggleMenu()} ref={setRef}>
|
|
134
|
+
* Toggle Menu
|
|
135
|
+
* </button>
|
|
136
|
+
* )}
|
|
137
|
+
* </ListItemMenu>
|
|
138
|
+
* );
|
|
139
|
+
* }
|
|
140
|
+
*
|
|
141
|
+
* @name ListItemMenu
|
|
142
|
+
* @phase Utility
|
|
143
|
+
*/
|
|
144
|
+
export declare function ListItemMenu({ activeElementId: activeElementIdProp, children, disabled, id: idProp, items: itemsProp, label, leading: menuLeading, offsetOptions, arrowKeyNavigationCallback, itemOnClick, owner, placement, readOnly, role: containerRole, scrollLimit, trailing: menuTrailing, width: menuWidth, onClose, hideWhenClosed, ...ariaProps }: ListItemMenuProps): import("react/jsx-runtime").JSX.Element;
|
|
145
|
+
export {};
|
|
146
|
+
/** Copyright 2025 Anywhere Real Estate - CC BY 4.0 */
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { useState, useMemo, } from 'react';
|
|
3
|
+
import { ListItem } from '../ListItem';
|
|
4
|
+
import { Menu } from '../Menu';
|
|
5
|
+
import { useArrowNavigation } from '../../hooks/useArrowNavigation';
|
|
6
|
+
import { useFloating } from '../../hooks/useFloating';
|
|
7
|
+
import { useId } from '../../hooks/useId';
|
|
8
|
+
import { useOutsideClick } from '../../hooks/useOutsideClick';
|
|
9
|
+
import { getElementById } from '../../utils/dom';
|
|
10
|
+
import { handleKeyDown } from '../../utils/handleKeyDown';
|
|
11
|
+
const LIST_ITEM_ROLES = {
|
|
12
|
+
group: undefined,
|
|
13
|
+
listbox: 'option',
|
|
14
|
+
menu: 'menuitem',
|
|
15
|
+
tree: 'treeitem',
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* A floating list Item menu for displaying additional actions or options presented as ListItems in a Menu.
|
|
19
|
+
*
|
|
20
|
+
* Includes keyboard navigation and accessibility features.
|
|
21
|
+
*
|
|
22
|
+
* The menu is anchored to a reference element provided as a children function with params that include the necessary
|
|
23
|
+
* ARIA attributes and event handlers.
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* import { ListItemMenu } from '@bspk/ui/ListItemMenu';
|
|
27
|
+
*
|
|
28
|
+
* function Example() {
|
|
29
|
+
* return (
|
|
30
|
+
* <ListItemMenu
|
|
31
|
+
* items={[{ id: '1', label: 'Item 1' }]}
|
|
32
|
+
* label="Example Menu"
|
|
33
|
+
* role="menu"
|
|
34
|
+
* scrollLimit={5}
|
|
35
|
+
* width="200px"
|
|
36
|
+
* >
|
|
37
|
+
* {(toggleProps, { setRef, toggleMenu }) => (
|
|
38
|
+
* <button {...toggleProps} onClick={() => toggleMenu()} ref={setRef}>
|
|
39
|
+
* Toggle Menu
|
|
40
|
+
* </button>
|
|
41
|
+
* )}
|
|
42
|
+
* </ListItemMenu>
|
|
43
|
+
* );
|
|
44
|
+
* }
|
|
45
|
+
*
|
|
46
|
+
* @name ListItemMenu
|
|
47
|
+
* @phase Utility
|
|
48
|
+
*/
|
|
49
|
+
export function ListItemMenu({ activeElementId: activeElementIdProp = null, children, disabled, id: idProp, items: itemsProp, label, leading: menuLeading, offsetOptions = 4, arrowKeyNavigationCallback, itemOnClick, owner, placement = 'bottom', readOnly, role: containerRole = 'listbox', scrollLimit, trailing: menuTrailing, width: menuWidth = 'reference', onClose, hideWhenClosed = false, ...ariaProps }) {
|
|
50
|
+
const containerId = useId(idProp);
|
|
51
|
+
const [show, setShowBase] = useState(false);
|
|
52
|
+
const items = useMemo(() => (typeof itemsProp === 'function' ? itemsProp({ show }) : itemsProp), [itemsProp, show]);
|
|
53
|
+
const setShow = (next) => {
|
|
54
|
+
if (disabled || readOnly)
|
|
55
|
+
return;
|
|
56
|
+
setShowBase((prev) => {
|
|
57
|
+
if (prev && !next) {
|
|
58
|
+
// closing
|
|
59
|
+
onClose?.();
|
|
60
|
+
}
|
|
61
|
+
if (typeof next === 'function')
|
|
62
|
+
return next(prev);
|
|
63
|
+
return next;
|
|
64
|
+
});
|
|
65
|
+
};
|
|
66
|
+
const { floatingStyles, elements, currentPlacement } = useFloating({
|
|
67
|
+
hide: !show,
|
|
68
|
+
offsetOptions,
|
|
69
|
+
placement,
|
|
70
|
+
refWidth: menuWidth === 'reference',
|
|
71
|
+
strategy: 'fixed',
|
|
72
|
+
});
|
|
73
|
+
useOutsideClick({
|
|
74
|
+
elements: [elements.floating, elements.reference],
|
|
75
|
+
callback: () => setShow(false),
|
|
76
|
+
disabled: !show,
|
|
77
|
+
});
|
|
78
|
+
const { activeElementId, setActiveElementId, arrowKeyCallbacks } = useArrowNavigation({
|
|
79
|
+
ids: items.flatMap((item) => (item.disabled ? [] : item.id)),
|
|
80
|
+
callback: (params) => {
|
|
81
|
+
if (!show)
|
|
82
|
+
setShow(true);
|
|
83
|
+
if (typeof arrowKeyNavigationCallback === 'function' && arrowKeyNavigationCallback)
|
|
84
|
+
return arrowKeyNavigationCallback(params);
|
|
85
|
+
return true;
|
|
86
|
+
},
|
|
87
|
+
});
|
|
88
|
+
const tabEscape = () => {
|
|
89
|
+
setShow(false);
|
|
90
|
+
setActiveElementId(null);
|
|
91
|
+
};
|
|
92
|
+
const enterSpace = (event) => {
|
|
93
|
+
event.preventDefault();
|
|
94
|
+
if (!show) {
|
|
95
|
+
setShow(true);
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
getElementById(activeElementId)?.click();
|
|
99
|
+
};
|
|
100
|
+
return (_jsxs(_Fragment, { children: [children({
|
|
101
|
+
'aria-disabled': disabled || undefined,
|
|
102
|
+
'aria-expanded': show,
|
|
103
|
+
'aria-haspopup': show && containerRole !== 'group' ? containerRole : undefined,
|
|
104
|
+
'aria-controls': containerId,
|
|
105
|
+
'aria-readonly': readOnly || undefined,
|
|
106
|
+
'aria-owns': containerId,
|
|
107
|
+
'aria-activedescendant': show ? activeElementId || undefined : undefined,
|
|
108
|
+
role: 'combobox',
|
|
109
|
+
tabIndex: 0,
|
|
110
|
+
onClick: (event) => {
|
|
111
|
+
const nextShow = !show;
|
|
112
|
+
setShow(nextShow);
|
|
113
|
+
setActiveElementId(nextShow ? activeElementIdProp || items[0]?.id || null : null);
|
|
114
|
+
event.preventDefault();
|
|
115
|
+
},
|
|
116
|
+
onKeyDownCapture: handleKeyDown({
|
|
117
|
+
...arrowKeyCallbacks,
|
|
118
|
+
Enter: enterSpace,
|
|
119
|
+
Space: enterSpace,
|
|
120
|
+
Tab: tabEscape,
|
|
121
|
+
Escape: tabEscape,
|
|
122
|
+
}),
|
|
123
|
+
}, {
|
|
124
|
+
setRef: elements.setReference,
|
|
125
|
+
toggleMenu: () => setShow(true),
|
|
126
|
+
itemCount: items.length,
|
|
127
|
+
reference: elements.reference,
|
|
128
|
+
}), (!hideWhenClosed || show) && (_jsxs(Menu, { ...ariaProps, "aria-label": label, as: "ul", "data-placement": currentPlacement, "data-scroll": !!scrollLimit && items.length > scrollLimit, id: containerId, innerRef: (node) => {
|
|
129
|
+
elements.setFloating(node);
|
|
130
|
+
}, owner: owner, role: containerRole, style: {
|
|
131
|
+
width: menuWidth !== 'reference' ? menuWidth : undefined,
|
|
132
|
+
...floatingStyles,
|
|
133
|
+
...scrollLimitStyle(scrollLimit, items.length),
|
|
134
|
+
}, children: [menuLeading, items.map((item, index) => {
|
|
135
|
+
return (_jsx(ListItem, { as: "li", ...item, active: activeElementId === item.id || undefined, onClick: (event) => {
|
|
136
|
+
elements.reference?.focus();
|
|
137
|
+
setActiveElementId(item.id);
|
|
138
|
+
item?.onClick?.(event);
|
|
139
|
+
itemOnClick?.({ event, currentId: item.id, show, setShow });
|
|
140
|
+
}, role: item.role || LIST_ITEM_ROLES[containerRole] || undefined, tabIndex: 0 }, index));
|
|
141
|
+
}), menuTrailing] }))] }));
|
|
142
|
+
}
|
|
143
|
+
const scrollLimitStyle = (scrollLimitProp, itemCount) => {
|
|
144
|
+
const scrollLimit = Number(scrollLimitProp);
|
|
145
|
+
// Check:
|
|
146
|
+
// 1. scrollLimit is valid
|
|
147
|
+
// 2. itemCount is a number
|
|
148
|
+
// 3. scrollLimit is less than itemCount
|
|
149
|
+
// If any of these fail, return undefined (no scrolling)
|
|
150
|
+
if (Number.isNaN(scrollLimit) || scrollLimit <= 0 || typeof itemCount !== 'number' || scrollLimit > itemCount)
|
|
151
|
+
return {};
|
|
152
|
+
return {
|
|
153
|
+
display: 'flex',
|
|
154
|
+
flexDirection: 'column',
|
|
155
|
+
maxHeight: `calc(var(--list-item-height) * ${scrollLimit})`,
|
|
156
|
+
overflow: 'hidden auto',
|
|
157
|
+
};
|
|
158
|
+
};
|
|
159
|
+
//# sourceMappingURL=ListItemMenu.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ListItemMenu.js","sourceRoot":"","sources":["../../../src/components/ListItemMenu/ListItemMenu.tsx"],"names":[],"mappings":";AAAA,OAAO,EAKH,QAAQ,EAKR,OAAO,GACV,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,QAAQ,EAAiB,MAAM,uBAAuB,CAAC;AAChE,OAAO,EAAE,IAAI,EAAa,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAoC,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAClG,OAAO,EAAE,WAAW,EAAoB,MAAM,qBAAqB,CAAC;AACpE,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACtC,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE1D,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7C,O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I,EAAE,IAAI,CAAC,IAAI,IAAI,eAAe,CAAC,aAAa,CAAC,IAAI,SAAS,EAC9D,QAAQ,EAAE,CAAC,IAVN,KAAK,CAWZ,CACL,CAAC;oBACN,CAAC,CAAC,EACD,YAAY,IACV,CACV,IACF,CACN,CAAC;AACN,CAAC;AAED,MAAM,gBAAgB,GAAG,CAAC,eAAwB,EAAE,SAAkB,EAAiB,EAAE;IACrF,MAAM,WAAW,GAAG,MAAM,CAAC,eAAe,CAAC,CAAC;IAE5C,SAAS;IACT,0BAA0B;IAC1B,2BAA2B;IAC3B,wCAAwC;IACxC,wDAAwD;IACxD,IAAI,MAAM,CAAC,KAAK,CAAC,WAAW,CAAC,IAAI,WAAW,IAAI,CAAC,IAAI,OAAO,SAAS,KAAK,QAAQ,IAAI,WAAW,GAAG,SAAS;QACzG,OAAO,EAAE,CAAC;IAEd,OAAO;QACH,OAAO,EAAE,MAAM;QACf,aAAa,EAAE,QAAQ;QACvB,SAAS,EAAE,kCAAkC,WAAW,GAAG;QAC3D,QAAQ,EAAE,aAAa;KAC1B,CAAC;AACN,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './ListItemMenu';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/ListItemMenu/index.tsx"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC"}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
import { PortalProps } from '-/components/Portal';
|
|
3
|
-
import { CommonProps, ElementProps, SetRef } from '-/types/common';
|
|
4
1
|
import './menu.scss';
|
|
2
|
+
import { ElementType, ReactNode } from 'react';
|
|
3
|
+
import { CommonProps, ElementProps, SetRef } from '-/types/common';
|
|
5
4
|
export declare function menuItemId(menuId: string, index: number): string;
|
|
6
|
-
export type MenuProps = CommonProps<'id' | 'owner'
|
|
5
|
+
export type MenuProps<As extends ElementType = ElementType> = CommonProps<'id' | 'owner' | 'role'> & {
|
|
7
6
|
/** A ref to the inner div element. */
|
|
8
7
|
innerRef?: SetRef<HTMLDivElement>;
|
|
9
8
|
/**
|
|
@@ -13,44 +12,18 @@ export type MenuProps = CommonProps<'id' | 'owner'> & Pick<PortalProps, 'contain
|
|
|
13
12
|
*/
|
|
14
13
|
children: ReactNode;
|
|
15
14
|
/**
|
|
16
|
-
*
|
|
17
|
-
* normal DOM flow, such as dropdowns or modals.
|
|
18
|
-
*
|
|
19
|
-
* @default true
|
|
20
|
-
*/
|
|
21
|
-
portal?: boolean;
|
|
22
|
-
/**
|
|
23
|
-
* The number of items to show in the menu. This is used to determine the height of the menu.
|
|
24
|
-
*
|
|
25
|
-
* @default 1
|
|
26
|
-
*/
|
|
27
|
-
itemDisplayCount?: number;
|
|
28
|
-
/**
|
|
29
|
-
* The number of items in the menu.
|
|
15
|
+
* A label for the menu for screen readers.
|
|
30
16
|
*
|
|
31
|
-
*
|
|
17
|
+
* This is required if the role is set to "menu" or "listbox".
|
|
32
18
|
*/
|
|
33
|
-
|
|
19
|
+
label?: string;
|
|
34
20
|
/**
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
-
* @default true
|
|
38
|
-
*/
|
|
39
|
-
floating?: boolean;
|
|
40
|
-
/**
|
|
41
|
-
* A function that is called when the user clicks outside of the menu.
|
|
42
|
-
*
|
|
43
|
-
* @required
|
|
44
|
-
*/
|
|
45
|
-
onOutsideClick: () => void;
|
|
46
|
-
/**
|
|
47
|
-
* Whether or not the menu is scrollable.
|
|
48
|
-
*
|
|
49
|
-
* Setting to false will override itemDisplayCount.
|
|
21
|
+
* The element type to render as.
|
|
50
22
|
*
|
|
51
|
-
* @default
|
|
23
|
+
* @default div
|
|
24
|
+
* @type ElementType
|
|
52
25
|
*/
|
|
53
|
-
|
|
26
|
+
as?: As;
|
|
54
27
|
};
|
|
55
28
|
/**
|
|
56
29
|
* A container housing a simple list of options presented to the customer to select one option at a time.
|
|
@@ -62,7 +35,7 @@ export type MenuProps = CommonProps<'id' | 'owner'> & Pick<PortalProps, 'contain
|
|
|
62
35
|
*
|
|
63
36
|
* export function Example() {
|
|
64
37
|
* return (
|
|
65
|
-
* <Menu
|
|
38
|
+
* <Menu>
|
|
66
39
|
* <ListItem label="List Item" />
|
|
67
40
|
* <ListItem label="List Item" />
|
|
68
41
|
* <ListItem label="List Item" />
|
|
@@ -73,5 +46,5 @@ export type MenuProps = CommonProps<'id' | 'owner'> & Pick<PortalProps, 'contain
|
|
|
73
46
|
* @name Menu
|
|
74
47
|
* @phase UXReview
|
|
75
48
|
*/
|
|
76
|
-
export declare function Menu({ innerRef, id: idProp, children,
|
|
49
|
+
export declare function Menu({ as, innerRef, id: idProp, children, owner, label, ...props }: ElementProps<MenuProps, 'div'>): import("react/jsx-runtime").JSX.Element;
|
|
77
50
|
/** Copyright 2025 Anywhere Real Estate - CC BY 4.0 */
|
|
@@ -1,11 +1,6 @@
|
|
|
1
|
-
import { jsx as _jsx
|
|
2
|
-
// import { ReactNode, useMemo, useRef } from 'react';
|
|
3
|
-
import { useRef } from 'react';
|
|
4
|
-
import { Portal } from '../Portal';
|
|
5
|
-
import { useId } from '../../hooks/useId';
|
|
6
|
-
import { useOutsideClick } from '../../hooks/useOutsideClick';
|
|
7
|
-
import { cssWithVars } from '../../utils/cwv';
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
2
|
import './menu.css.js';
|
|
3
|
+
import { useId } from '../../hooks/useId';
|
|
9
4
|
export function menuItemId(menuId, index) {
|
|
10
5
|
return `menu-${menuId}-item-${index}`;
|
|
11
6
|
}
|
|
@@ -19,7 +14,7 @@ export function menuItemId(menuId, index) {
|
|
|
19
14
|
*
|
|
20
15
|
* export function Example() {
|
|
21
16
|
* return (
|
|
22
|
-
* <Menu
|
|
17
|
+
* <Menu>
|
|
23
18
|
* <ListItem label="List Item" />
|
|
24
19
|
* <ListItem label="List Item" />
|
|
25
20
|
* <ListItem label="List Item" />
|
|
@@ -30,24 +25,9 @@ export function menuItemId(menuId, index) {
|
|
|
30
25
|
* @name Menu
|
|
31
26
|
* @phase UXReview
|
|
32
27
|
*/
|
|
33
|
-
export function Menu({
|
|
34
|
-
//
|
|
35
|
-
innerRef, id: idProp, children, portal = true, itemDisplayCount = 1, itemCount = 1, floating = true, onOutsideClick, owner, scroll = true, container, ...props }) {
|
|
28
|
+
export function Menu({ as, innerRef, id: idProp, children, owner, label, ...props }) {
|
|
36
29
|
const menuId = useId(idProp);
|
|
37
|
-
const
|
|
38
|
-
|
|
39
|
-
useOutsideClick({
|
|
40
|
-
elements: [menuElement.current],
|
|
41
|
-
callback: () => onOutsideClick?.(),
|
|
42
|
-
disabled: !onOutsideClick,
|
|
43
|
-
});
|
|
44
|
-
const menu = (_jsx(_Fragment, { children: _jsx("div", { ...props, "data-bspk": "menu", "data-bspk-owner": owner || undefined, "data-floating": floating || undefined, "data-scroll": scroll || scrollDefault || undefined, id: menuId, ref: (node) => {
|
|
45
|
-
innerRef?.(node);
|
|
46
|
-
menuElement.current = node;
|
|
47
|
-
}, style: cssWithVars({
|
|
48
|
-
...props.style,
|
|
49
|
-
'--item-display-count': itemDisplayCount,
|
|
50
|
-
}), children: children }) }));
|
|
51
|
-
return portal ? _jsx(Portal, { container: container, children: menu }) : menu;
|
|
30
|
+
const As = as || 'div';
|
|
31
|
+
return (_jsx(As, { ...props, "aria-label": label || undefined, "data-bspk-owner": owner || undefined, "data-bspk-utility": "menu", id: menuId, ref: innerRef, children: children }));
|
|
52
32
|
}
|
|
53
33
|
//# sourceMappingURL=Menu.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Menu.js","sourceRoot":"","sources":["../../../src/components/Menu/Menu.tsx"],"names":[],"mappings":";AAAA,
|
|
1
|
+
{"version":3,"file":"Menu.js","sourceRoot":"","sources":["../../../src/components/Menu/Menu.tsx"],"names":[],"mappings":";AAAA,OAAO,aAAa,CAAC;AAErB,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAGtC,MAAM,UAAU,UAAU,CAAC,MAAc,EAAE,KAAa;IACpD,OAAO,QAAQ,MAAM,SAAS,KAAK,EAAE,CAAC;AAC1C,CAAC;AA0BD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,UAAU,IAAI,CAAC,EAAE,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,GAAG,KAAK,EAAkC;IAC/G,MAAM,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC;IAE7B,MAAM,EAAE,GAAG,EAAE,IAAI,KAAK,CAAC;IAEvB,OAAO,CACH,KAAC,EAAE,OACK,KAAK,gBACG,KAAK,IAAI,SAAS,qBACb,KAAK,IAAI,SAAS,uBACjB,MAAM,EACxB,EAAE,EAAE,MAAM,EACV,GAAG,EAAE,QAAQ,YAEZ,QAAQ,GACR,CACR,CAAC;AACN,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { MenuProps } from '.';
|
|
2
|
-
import { ElementProps } from '-/types/common';
|
|
3
2
|
import { ComponentExampleFn } from '-/utils/demo';
|
|
4
|
-
export declare const MenuExample: ComponentExampleFn<
|
|
5
|
-
|
|
3
|
+
export declare const MenuExample: ComponentExampleFn<MenuProps & {
|
|
4
|
+
style?: unknown;
|
|
5
|
+
'data-dark-mode'?: boolean;
|
|
6
6
|
}>;
|
|
@@ -13,36 +13,13 @@ import { ListItem } from '../ListItem';
|
|
|
13
13
|
import { Switch } from '../Switch';
|
|
14
14
|
export const MenuExample = ({ action, }) => ({
|
|
15
15
|
render: ({ props, Component, setState }) => {
|
|
16
|
-
return (_jsxs(Component, { ...props,
|
|
16
|
+
return (_jsxs(Component, { ...props, style: { padding: 'var(--spacing-sizing-02) var(--spacing-sizing-02)' }, children: [_jsx(ListItem, { label: "Michael Scott", leading: _jsx(Avatar, { image: "/profile2.jpg", name: "Michael Scott" }), subText: "michael.scott@email.com" }), _jsx(Divider, { inset: 2, padding: true }), _jsx(ListItem, { href: "#/my-profile", label: "My profile", leading: _jsx(SvgAccountCircle, {}) }), _jsx(ListItem, { href: "#/settings", label: "Settings", leading: _jsx(SvgSettings, {}) }), _jsx(ListItem, { as: "label", label: "Dark mode", leading: props['data-dark-mode'] ? _jsx(SvgDarkModeFill, {}) : _jsx(SvgDarkMode, {}), trailing: _jsx(Switch, { "aria-label": "Toggle dark mode", checked: !!props['data-dark-mode'], name: "dark-mode", onChange: () => {
|
|
17
17
|
setState((prev) => ({ 'data-dark-mode': !prev['data-dark-mode'] }));
|
|
18
18
|
action('Dark mode toggled');
|
|
19
19
|
} }) }), _jsx(Divider, { inset: 2, padding: false, thickness: "light" }), _jsx(ListItem, { href: "#/guide-tutorial", label: "Guide and tutorial", leading: _jsx(SvgMenuBook, {}) }), _jsx(ListItem, { href: "#/help-center", label: "Help center", leading: _jsx(SvgHelp, {}) }), _jsx(Divider, { inset: 2, padding: true }), _jsx(ListItem, { href: "#/go-premium", label: "Go premium", leading: _jsx(SvgLicense, {}) }), _jsx(ListItem, { label: "Log out", leading: _jsx(SvgLogout, {}), onClick: () => {
|
|
20
20
|
action('Log out clicked');
|
|
21
21
|
}, role: "button" })] }));
|
|
22
22
|
},
|
|
23
|
-
presets: [
|
|
24
|
-
{
|
|
25
|
-
label: 'Scroll = False',
|
|
26
|
-
propState: {
|
|
27
|
-
floating: false,
|
|
28
|
-
portal: false,
|
|
29
|
-
itemDisplayCount: 5,
|
|
30
|
-
itemCount: 11,
|
|
31
|
-
scroll: false,
|
|
32
|
-
},
|
|
33
|
-
},
|
|
34
|
-
{
|
|
35
|
-
label: 'Item Display Count',
|
|
36
|
-
propState: {
|
|
37
|
-
floating: false,
|
|
38
|
-
portal: false,
|
|
39
|
-
itemDisplayCount: 5,
|
|
40
|
-
itemCount: 11,
|
|
41
|
-
scroll: true,
|
|
42
|
-
},
|
|
43
|
-
},
|
|
44
|
-
],
|
|
45
|
-
disableProps: ['floating', 'portal'],
|
|
46
23
|
variants: false,
|
|
47
24
|
});
|
|
48
25
|
//# sourceMappingURL=MenuExample.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MenuExample.js","sourceRoot":"","sources":["../../../src/components/Menu/MenuExample.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAC7D,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAC3D,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAGnD,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"MenuExample.js","sourceRoot":"","sources":["../../../src/components/Menu/MenuExample.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAC7D,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAC3D,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,O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
|
|
|
8
8
|
border-radius: var(--radius-lg);
|
|
9
9
|
display: flex;
|
|
10
10
|
flex-direction: column;
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
overflow: hidden scroll;
|
|
14
|
-
max-height: calc(var(--item-display-count, 1) * var(--list-item-height) + 2px);
|
|
15
|
-
}
|
|
16
|
-
[data-bspk=menu][data-floating] {
|
|
11
|
+
overflow: hidden auto;
|
|
12
|
+
height: fit-content;
|
|
17
13
|
z-index: var(--z-index-dropdown);
|
|
18
14
|
}
|
|
19
|
-
[data-bspk=menu] [data-bspk=list-item][data-selected] {
|
|
20
|
-
background-color: var(--surface-brand-primary-highlight);
|
|
21
|
-
}
|
|
22
15
|
|
|
23
16
|
/** Copyright 2025 Anywhere Real Estate - CC BY 4.0 */
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/** * This file is generated by the build script.
|
|
2
2
|
* Do not edit this file directly. */
|
|
3
3
|
const style = document.createElement('style');
|
|
4
|
-
style.appendChild(document.createTextNode(`[data-bspk=menu] {
|
|
4
|
+
style.appendChild(document.createTextNode(`[data-bspk-utility=menu] {
|
|
5
5
|
--overflow-y: hidden;
|
|
6
6
|
width: 332px;
|
|
7
7
|
box-sizing: border-box;
|
|
@@ -11,17 +11,10 @@ style.appendChild(document.createTextNode(`[data-bspk=menu] {
|
|
|
11
11
|
border-radius: var(--radius-lg);
|
|
12
12
|
display: flex;
|
|
13
13
|
flex-direction: column;
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
overflow: hidden scroll;
|
|
17
|
-
max-height: calc(var(--item-display-count, 1) * var(--list-item-height) + 2px);
|
|
18
|
-
}
|
|
19
|
-
[data-bspk=menu][data-floating] {
|
|
14
|
+
overflow: hidden auto;
|
|
15
|
+
height: fit-content;
|
|
20
16
|
z-index: var(--z-index-dropdown);
|
|
21
17
|
}
|
|
22
|
-
[data-bspk=menu] [data-bspk=list-item][data-selected] {
|
|
23
|
-
background-color: var(--surface-brand-primary-highlight);
|
|
24
|
-
}
|
|
25
18
|
|
|
26
19
|
/** Copyright 2025 Anywhere Real Estate - CC BY 4.0 */
|
|
27
20
|
`));
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import './menu-button.scss';
|
|
1
2
|
import { ButtonProps } from '-/components/Button';
|
|
2
3
|
import { ElementProps } from '-/types/common';
|
|
3
|
-
import './menu-button.scss';
|
|
4
4
|
export type MenuButtonProps = Pick<ButtonProps, 'as' | 'onClick'>;
|
|
5
5
|
/**
|
|
6
6
|
* Utility component used within top navigation.
|