@bspk/ui 1.2.0 → 1.3.1
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 +44 -5
- package/dist/components/Accordion/Accordion.js +25 -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 +3 -3
- package/dist/components/Checkbox/Checkbox.js +3 -3
- package/dist/components/Checkbox/Checkbox.js.map +1 -1
- package/dist/components/Checkbox/checkbox.css +11 -8
- package/dist/components/Checkbox/checkbox.css.js +11 -8
- package/dist/components/CheckboxGroup/CheckboxGroup.js +1 -1
- package/dist/components/CheckboxGroup/CheckboxGroup.js.map +1 -1
- 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/CheckboxOption/CheckboxOption.d.ts +1 -1
- package/dist/components/CheckboxOption/CheckboxOption.js +2 -2
- package/dist/components/CheckboxOption/CheckboxOption.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/ProgressionStepper/progression-stepper.css +14 -2
- package/dist/components/ProgressionStepper/progression-stepper.css.js +14 -2
- 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 +54 -36
- package/dist/components/Select/Select.js +100 -28
- 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 -90
- package/dist/components/Select/SelectExample.js.map +1 -1
- package/dist/components/Select/select.css +18 -22
- package/dist/components/Select/select.css.js +18 -22
- package/dist/components/SelectField/SelectField.d.ts +1 -1
- package/dist/components/SelectField/SelectField.js +1 -1
- 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 +3 -3
- package/dist/components/ToggleOption/ToggleOption.js +2 -2
- 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 +90 -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 +9 -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 +5 -5
- package/src/components/Checkbox/checkbox.scss +5 -4
- package/src/components/CheckboxGroup/CheckboxGroup.rtl.test.tsx +19 -0
- package/src/components/CheckboxGroup/CheckboxGroup.tsx +8 -2
- package/src/components/CheckboxGroup/CheckboxGroupExample.tsx +51 -43
- package/src/components/CheckboxOption/CheckboxOption.rtl.test.tsx +24 -0
- package/src/components/CheckboxOption/CheckboxOption.tsx +15 -3
- 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/ProgressionStepper/progression-stepper.scss +16 -2
- 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 +230 -103
- package/src/components/Select/SelectExample.tsx +111 -92
- package/src/components/Select/select.scss +20 -26
- package/src/components/SelectField/SelectField.rtl.test.tsx +25 -0
- package/src/components/SelectField/SelectField.tsx +1 -1
- 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 +4 -5
- 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,16 +1,24 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useState } from 'react';
|
|
3
|
+
import { AriaLiveMessageHandler, sendAriaLiveMessage } from './AriaLiveMessageHandler';
|
|
3
4
|
import { useEventListener } from '../../hooks/useAddEventListener';
|
|
4
5
|
import { useDebounceState } from '../../hooks/useDebounceState';
|
|
5
6
|
import { useIsomorphicEffect } from '../../hooks/useIsomorphicEffect';
|
|
6
7
|
import { UIContext } from '../../utils/uiContext';
|
|
7
8
|
/**
|
|
8
|
-
* UIProvider is a React context provider that manages the UI state
|
|
9
|
+
* UIProvider is a React context provider that manages the UI state.
|
|
10
|
+
*
|
|
11
|
+
* UI state includes, theme, setTheme, responsive state, aria live messages
|
|
12
|
+
*
|
|
13
|
+
* This provider should wrap the root of your application to ensure that all components have access to the UI context.
|
|
9
14
|
*
|
|
10
15
|
* @name UIProvider
|
|
16
|
+
*
|
|
17
|
+
* @phase Utility
|
|
11
18
|
*/
|
|
12
19
|
export function UIProvider({ children }) {
|
|
13
20
|
const [theme, setTheme] = useState('light');
|
|
21
|
+
// Keep track of device width to determine if we are in mobile, tablet, or desktop mode
|
|
14
22
|
const [deviceWidth, setDeviceWidth] = useDebounceState(() => {
|
|
15
23
|
return typeof window !== 'undefined' ? window.innerWidth : 0;
|
|
16
24
|
}, 250);
|
|
@@ -19,12 +27,13 @@ export function UIProvider({ children }) {
|
|
|
19
27
|
document.documentElement.style.setProperty('--scrollbar-width', `${window.innerWidth - document.documentElement.clientWidth}px`);
|
|
20
28
|
}, [theme]);
|
|
21
29
|
useEventListener('resize', () => setDeviceWidth(window.innerWidth));
|
|
22
|
-
return (
|
|
30
|
+
return (_jsxs(UIContext.Provider, { "data-bspk-utility": "ui-provider", value: {
|
|
23
31
|
theme,
|
|
24
32
|
setTheme,
|
|
25
33
|
isMobile: deviceWidth < 640,
|
|
26
34
|
isTablet: deviceWidth > 640 && deviceWidth < 1024,
|
|
27
35
|
isDesktop: deviceWidth >= 1024,
|
|
28
|
-
|
|
36
|
+
sendAriaLiveMessage,
|
|
37
|
+
}, children: [children, _jsx(AriaLiveMessageHandler, {})] }));
|
|
29
38
|
}
|
|
30
39
|
//# sourceMappingURL=UIProvider.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UIProvider.js","sourceRoot":"","sources":["../../../src/components/UIProvider/UIProvider.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAa,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"UIProvider.js","sourceRo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AE;YACH,KAAK;YACL,QAAQ;YACR,QAAQ,EAAE,WAAW,GAAG,GAAG;YAC3B,QAAQ,EAAE,WAAW,GAAG,GAAG,IAAI,WAAW,GAAG,IAAI;YACjD,SAAS,EAAE,WAAW,IAAI,IAAI;YAC9B,mBAAmB;SACtB,aAEA,QAAQ,EACT,KAAC,sBAAsB,KAAG,IACT,CACxB,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { UIProviderProps } from '.';
|
|
2
|
+
import { ComponentExample, Preset } from '-/utils/demo';
|
|
3
|
+
export declare const presets: Preset<UIProviderProps>[];
|
|
4
|
+
export declare const UIProviderExample: ComponentExample<UIProviderProps>;
|
|
5
|
+
export declare function AriaLiveExample(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Button } from '../Button';
|
|
3
|
+
import { useUIContext } from '../../hooks/useUIContext';
|
|
4
|
+
export const presets = [];
|
|
5
|
+
export const UIProviderExample = {
|
|
6
|
+
containerStyle: { width: '100%' },
|
|
7
|
+
defaultState: {},
|
|
8
|
+
disableProps: [],
|
|
9
|
+
presets,
|
|
10
|
+
sections: [
|
|
11
|
+
{
|
|
12
|
+
title: 'Theme Switching',
|
|
13
|
+
content: ({ Syntax }) => (_jsx("div", { style: {}, children: _jsx(Syntax, { code: `// Example usage of theme switching
|
|
14
|
+
import { useContext } from 'react';
|
|
15
|
+
import { useUIContext } from '../../hooks/useUIContext';
|
|
16
|
+
|
|
17
|
+
export function ThemeSwitcher() {
|
|
18
|
+
const {theme, setTheme} = useUIContext();
|
|
19
|
+
|
|
20
|
+
return (
|
|
21
|
+
<div>
|
|
22
|
+
<p>Current theme: {theme}</p>
|
|
23
|
+
<button onClick={() => setTheme('light')}>Light Theme</button>
|
|
24
|
+
<button onClick={() => setTheme('dark')}>Dark Theme</button>
|
|
25
|
+
</div>
|
|
26
|
+
);
|
|
27
|
+
}`, language: "typescript" }) })),
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
title: 'Responsive Helpers',
|
|
31
|
+
content: ({ Syntax }) => (_jsx("div", { style: {}, children: _jsx(Syntax, { code: `// Example usage of isMobile, isTablet, and isDesktop
|
|
32
|
+
import { useContext } from 'react';
|
|
33
|
+
import { useUIContext } from '../../hooks/useUIContext';
|
|
34
|
+
|
|
35
|
+
export function ResponsiveComponent() {
|
|
36
|
+
const {isMobile, isTablet, isDesktop} = useUIContext();
|
|
37
|
+
|
|
38
|
+
return (
|
|
39
|
+
<div>
|
|
40
|
+
{isMobile && <p>This is a mobile device.</p>}
|
|
41
|
+
{isTablet && <p>This is a tablet device.</p>}
|
|
42
|
+
{isDesktop && <p>This is a desktop device.</p>}
|
|
43
|
+
</div>
|
|
44
|
+
);
|
|
45
|
+
}`, language: "typescript" }) })),
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
title: 'ARIA Live Messages',
|
|
49
|
+
content: ({ Syntax }) => (_jsxs("div", { style: {}, children: [_jsx("p", { children: "Example usage of sending ARIA live messages. This allows for dynamic updates to assistive technologies, such as screen readers." }), _jsx(AriaLiveExample, {}), _jsx(Syntax, { code: `// Example usage of sending ARIA live messages
|
|
50
|
+
import { useContext } from 'react';
|
|
51
|
+
import { useUIContext } from '../../hooks/useUIContext';
|
|
52
|
+
|
|
53
|
+
export function AriaLiveExample() {
|
|
54
|
+
const {sendAriaLiveMessage} = useUIContext();
|
|
55
|
+
|
|
56
|
+
const handleClick = () => {
|
|
57
|
+
sendAriaLiveMessage('Action completed successfully', 'polite');
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
return (
|
|
61
|
+
<div>
|
|
62
|
+
<button onClick={handleClick}>Perform Action</button>
|
|
63
|
+
</div>
|
|
64
|
+
);
|
|
65
|
+
}`, language: "typescript" })] })),
|
|
66
|
+
},
|
|
67
|
+
],
|
|
68
|
+
variants: {},
|
|
69
|
+
};
|
|
70
|
+
export function AriaLiveExample() {
|
|
71
|
+
const { sendAriaLiveMessage } = useUIContext();
|
|
72
|
+
return (_jsxs("p", { children: [_jsx(Button, { "data-bspk": "link", label: "Send a polite ARIA Live Message ", onClick: () => {
|
|
73
|
+
sendAriaLiveMessage?.(`Action completed successfully at ${new Date().toLocaleTimeString()}`, 'polite');
|
|
74
|
+
}, style: {
|
|
75
|
+
padding: 0,
|
|
76
|
+
margin: 0,
|
|
77
|
+
border: 'none',
|
|
78
|
+
background: 'none',
|
|
79
|
+
color: 'inherit',
|
|
80
|
+
cursor: 'pointer',
|
|
81
|
+
}, variant: "tertiary" }), _jsx(Button, { "data-bspk": "link", label: "Send an assertive ARIA Live Message ", onClick: () => {
|
|
82
|
+
sendAriaLiveMessage?.(`Critical update occurred at ${new Date().toLocaleTimeString()}`, 'assertive');
|
|
83
|
+
}, style: {
|
|
84
|
+
padding: 0,
|
|
85
|
+
margin: 0,
|
|
86
|
+
border: 'none',
|
|
87
|
+
background: 'none',
|
|
88
|
+
color: 'inherit',
|
|
89
|
+
cursor: 'pointer',
|
|
90
|
+
}, variant: "tertiary" })] }));
|
|
91
|
+
}
|
|
92
|
+
//# sourceMappingURL=UIProviderExample.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UIProviderExample.js","sourceRoot":"","sources":["../../../src/components/UIProvider/UIProviderExample.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAGpD,MAAM,CAAC,MAAM,OAAO,GAA8B,EAAE,CAAC;AAErD,MAAM,CAAC,MAAM,iBAAiB,GAAsC;IAChE,cAAc,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE;IACjC,YAAY,EAAE,EAAE;IAChB,YAAY,EAAE,EAAE;IAChB,OAAO;IACP,QAAQ,EAAE;QACN;YACI,KAAK,EAAE,iBAAiB;YACxB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C,MAAM,iBACO,MAAM,EAChB,KAAK,EAAC,sCAAsC,EAC5C,OAAO,EAAE,GAAG,EAAE;oBACV,mBAAmB,EAAE,CACjB,+BAA+B,IAAI,IAAI,EAAE,CAAC,kBAAkB,EAAE,EAAE,EAChE,WAAW,CACd,CAAC;gBACN,CAAC,EACD,KAAK,EAAE;oBACH,OAAO,EAAE,CAAC;oBACV,MAAM,EAAE,CAAC;oBACT,MAAM,EAAE,MAAM;oBACd,UAAU,EAAE,MAAM;oBAClB,KAAK,EAAE,SAAS;oBAChB,MAAM,EAAE,SAAS;iBACpB,EACD,OAAO,EAAC,UAAU,GACpB,IACF,CACP,CAAC;AACN,CAAC"}
|
package/dist/constants/phases.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"phases.js","sourceRoot":"","sources":["../../src/constants/phases.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,MAAM,sBAAsB,GAAyC;IACxE,OAAO,EAAE,MAAM;IACf,GAAG,EAAE,MAAM;IACX,
|
|
1
|
+
{"version":3,"file":"phases.js","sourceRoot":"","sources":["../../src/constants/phases.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,MAAM,sBAAsB,GAAyC;IACxE,OAAO,EAAE,MAAM;IACf,GAAG,EAAE,MAAM;IACX,QAAQ,EAAE,QAAQ;IAClB,MAAM,EAAE,OAAO;IACf,OAAO,EAAE,SAAS;CACrB,CAAC"}
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export
|
|
1
|
+
export type CustomEventName = 'aria-live';
|
|
2
|
+
export declare function useEventListener<KW extends keyof WindowEventMap, KH extends keyof HTMLElementEventMap & keyof SVGElementEventMap, KM extends keyof MediaQueryListEventMap, T extends Document | HTMLElement | MediaQueryList | SVGAElement | Window = HTMLElement>(eventName: CustomEventName | KH | KM | KW, handler: (event: Event | HTMLElementEventMap[KH] | MediaQueryListEventMap[KM] | SVGElementEventMap[KH] | WindowEventMap[KW]) => void, element?: T, disabled?: boolean, options?: AddEventListenerOptions | boolean): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useAddEventListener.js","sourceRoot":"","sources":["../../src/hooks/useAddEventListener.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"useAddEventListener.js","sourceRoot":"","sources":["../../src/hooks/useAddEventListener.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAI5D,MAAM,UAAU,gBAAgB,CAM5B,SAAyC,EACzC,OAOS,EACT,OAAW,EACX,QAAkB,EAClB,OAA2C;IAE3C,mCAAmC;IACnC,MAAM,YAAY,GAAG,MAAM,CAAC,OAAO,CAAC,CAAC;IAErC,mBAAmB,CAAC,GAAG,EAAE;QACrB,YAAY,CAAC,OAAO,GAAG,OAAO,CAAC;IACnC,CAAC,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC;IAEd,mBAAmB,CAAC,GAAG,EAAE;QACrB,IAAI,QAAQ;YAAE,OAAO;QAErB,8BAA8B;QAC9B,MAAM,aAAa,GAAe,OAAO,IAAI,MAAM,CAAC;QAEpD,IAAI,CAAC,CAAC,aAAa,IAAI,aAAa,CAAC,gBAAgB,CAAC;YAAE,OAAO;QAE/D,kEAAkE;QAClE,MAAM,QAAQ,GAAmB,CAAC,KAAK,EAAE,EAAE;YACvC,YAAY,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;QAChC,CAAC,CAAC;QAEF,aAAa,CAAC,gBAAgB,CAAC,SAAS,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC;QAE7D,mCAAmC;QACnC,OAAO,GAAG,EAAE;YACR,aAAa,CAAC,mBAAmB,CAAC,SAAS,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC;QACpE,CAAC,CAAC;IACN,CAAC,EAAE,CAAC,SAAS,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC;AACtC,CAAC"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { KeyboardEvent } from 'react';
|
|
2
|
+
import { KeysCallback } from '-/utils/handleKeyDown';
|
|
3
|
+
import { KeyboardEventCode } from '-/utils/keyboard';
|
|
4
|
+
type ArrowKeyNames = Extract<KeyboardEventCode, `Arrow${string}`>;
|
|
5
|
+
export type ArrowKeyNavigationCallbackParams = {
|
|
6
|
+
key: ArrowKeyNames;
|
|
7
|
+
event: KeyboardEvent;
|
|
8
|
+
activeElementId: string | null;
|
|
9
|
+
increment: number;
|
|
10
|
+
};
|
|
11
|
+
type UseArrowNavigationProps = {
|
|
12
|
+
/**
|
|
13
|
+
* An array of string IDs representing the navigable elements. These IDs should correspond to the `id` attributes of
|
|
14
|
+
* the elements in the DOM. Ensure the elements are not disabled.
|
|
15
|
+
*/
|
|
16
|
+
ids: string[];
|
|
17
|
+
/**
|
|
18
|
+
* An optional callback function that is invoked when an arrow key is pressed. This function receives the key name,
|
|
19
|
+
* the keyboard event, and the next active element ID. If the function returns `true`, the default navigation
|
|
20
|
+
* behavior is prevented; if it returns `false` or is not provided, the default behavior proceeds.
|
|
21
|
+
*/
|
|
22
|
+
callback?: (params: ArrowKeyNavigationCallbackParams) => boolean;
|
|
23
|
+
/** Optional configuration to set navigation direction increments. */
|
|
24
|
+
increments?: Record<ArrowKeyNames, number>;
|
|
25
|
+
/**
|
|
26
|
+
* The ID of the element that should be active by default. If not provided, the first ID in the `ids` array will be
|
|
27
|
+
* used.
|
|
28
|
+
*/
|
|
29
|
+
defaultActiveId?: string | null;
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* A hook to manage arrow key navigation for a list of elements.
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* ```tsx
|
|
36
|
+
* const { activeElementId, setActiveElementId, arrowKeyCallbacks } = useArrowNavigation(['id1', 'id2', 'id3']);
|
|
37
|
+
* ```;
|
|
38
|
+
*
|
|
39
|
+
* @returns An object containing:
|
|
40
|
+
*
|
|
41
|
+
* - `activeElementId`: The ID of the currently active element.
|
|
42
|
+
* - `setActiveElementId`: A function to manually set the active element ID.
|
|
43
|
+
* - `arrowKeyCallbacks`: An object with callback functions for arrow key navigation.
|
|
44
|
+
*/
|
|
45
|
+
export declare function useArrowNavigation({ ids, callback, increments, defaultActiveId, }: UseArrowNavigationProps): {
|
|
46
|
+
activeElementId: string | null;
|
|
47
|
+
setActiveElementId: (id: string | null) => void;
|
|
48
|
+
arrowKeyCallbacks: KeysCallback;
|
|
49
|
+
};
|
|
50
|
+
export {};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { useState } from 'react';
|
|
2
|
+
import { getElementById } from '../utils/dom';
|
|
3
|
+
const ARROW_KEYS = ['ArrowLeft', 'ArrowRight', 'ArrowUp', 'ArrowDown'];
|
|
4
|
+
/**
|
|
5
|
+
* A hook to manage arrow key navigation for a list of elements.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```tsx
|
|
9
|
+
* const { activeElementId, setActiveElementId, arrowKeyCallbacks } = useArrowNavigation(['id1', 'id2', 'id3']);
|
|
10
|
+
* ```;
|
|
11
|
+
*
|
|
12
|
+
* @returns An object containing:
|
|
13
|
+
*
|
|
14
|
+
* - `activeElementId`: The ID of the currently active element.
|
|
15
|
+
* - `setActiveElementId`: A function to manually set the active element ID.
|
|
16
|
+
* - `arrowKeyCallbacks`: An object with callback functions for arrow key navigation.
|
|
17
|
+
*/
|
|
18
|
+
export function useArrowNavigation({ ids = [], callback, increments = {
|
|
19
|
+
ArrowLeft: -1,
|
|
20
|
+
ArrowRight: 1,
|
|
21
|
+
ArrowUp: -1,
|
|
22
|
+
ArrowDown: 1,
|
|
23
|
+
}, defaultActiveId, }) {
|
|
24
|
+
const [activeElementId, setActiveElementIdBase] = useState(defaultActiveId || null);
|
|
25
|
+
const setActiveElementId = (id) => {
|
|
26
|
+
setActiveElementIdBase(id);
|
|
27
|
+
getElementById(id)?.scrollIntoView({
|
|
28
|
+
block: 'nearest',
|
|
29
|
+
behavior: 'smooth',
|
|
30
|
+
inline: 'nearest',
|
|
31
|
+
});
|
|
32
|
+
};
|
|
33
|
+
return {
|
|
34
|
+
activeElementId,
|
|
35
|
+
setActiveElementId,
|
|
36
|
+
arrowKeyCallbacks: Object.fromEntries(ARROW_KEYS.map((key) => [
|
|
37
|
+
key,
|
|
38
|
+
(event) => {
|
|
39
|
+
let nextIndex = 0;
|
|
40
|
+
let currentIndex = 0;
|
|
41
|
+
let nextId = ids[nextIndex];
|
|
42
|
+
const increment = increments[key];
|
|
43
|
+
if (activeElementId) {
|
|
44
|
+
currentIndex = ids.indexOf(activeElementId);
|
|
45
|
+
nextIndex = (currentIndex + increment + ids.length) % ids.length;
|
|
46
|
+
nextId = ids[nextIndex];
|
|
47
|
+
}
|
|
48
|
+
if (typeof callback === 'function' &&
|
|
49
|
+
callback({ key, event, activeElementId: nextId, increment }) === false)
|
|
50
|
+
return;
|
|
51
|
+
event.preventDefault();
|
|
52
|
+
setActiveElementId(nextId);
|
|
53
|
+
},
|
|
54
|
+
])),
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
//# sourceMappingURL=useArrowNavigation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useArrowNavigation.js","sourceRoot":"","sources":["../../src/hooks/useArrowNavigation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAiB,MAAM,OAAO,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAM7C,MAAM,UAAU,GAAoB,CAAC,WAAW,EAAE,YAAY,EAAE,SAAS,EAAE,WAAW,CAAC,CAAC;AA8BxF;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,kBAAkB,CAAC,EAC/B,GAAG,GAAG,EAAE,EACR,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,SAAS,EAAE,CAAC,KAAK,KAAK;oBAEtE,OAAO;gBACX,KAAK,CAAC,cAAc,EAAE,CAAC;gBACvB,kBAAkB,CAAC,MAAM,CAAC,CAAC;YAC/B,CAAC;SACJ,CAAC,CACW;KACpB,CAAC;AACN,CAAC"}
|
|
@@ -32,6 +32,6 @@ export declare function useCheckboxGroupState(allValues: string[], name: string,
|
|
|
32
32
|
allCheckboxProps: Pick<CheckboxProps, "name" | "value" | "onChange" | "checked" | "indeterminate">;
|
|
33
33
|
checkboxProps: (value: string) => Pick<CheckboxProps, "checked" | "name" | "onChange" | "value">;
|
|
34
34
|
values: string[];
|
|
35
|
-
setValues: (
|
|
35
|
+
setValues: import("react").Dispatch<import("react").SetStateAction<string[]>>;
|
|
36
36
|
};
|
|
37
37
|
/** Copyright 2025 Anywhere Real Estate - CC BY 4.0 */
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A hook to get the width of a container element.
|
|
3
|
+
*
|
|
4
|
+
* @example
|
|
5
|
+
* import { useRef } from 'react';
|
|
6
|
+
* import { useContainerWidth } from '@bspk/ui/hooks/useContainerWidth';
|
|
7
|
+
* export function Example() {
|
|
8
|
+
* const containerRef = useRef<HTMLDivElement>(null);
|
|
9
|
+
* const width = useContainerWidth(containerRef);
|
|
10
|
+
* return <div ref={containerRef}>Width: {width}px</div>;
|
|
11
|
+
* }
|
|
12
|
+
*
|
|
13
|
+
* @param ref - A ref to a container element.
|
|
14
|
+
* @returns The width of the container element.
|
|
15
|
+
*/
|
|
16
|
+
export declare function useContainerWidth(ref: React.RefObject<HTMLDivElement>): number;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { useState, useLayoutEffect } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* A hook to get the width of a container element.
|
|
4
|
+
*
|
|
5
|
+
* @example
|
|
6
|
+
* import { useRef } from 'react';
|
|
7
|
+
* import { useContainerWidth } from '@bspk/ui/hooks/useContainerWidth';
|
|
8
|
+
* export function Example() {
|
|
9
|
+
* const containerRef = useRef<HTMLDivElement>(null);
|
|
10
|
+
* const width = useContainerWidth(containerRef);
|
|
11
|
+
* return <div ref={containerRef}>Width: {width}px</div>;
|
|
12
|
+
* }
|
|
13
|
+
*
|
|
14
|
+
* @param ref - A ref to a container element.
|
|
15
|
+
* @returns The width of the container element.
|
|
16
|
+
*/
|
|
17
|
+
export function useContainerWidth(ref) {
|
|
18
|
+
const [width, setWidth] = useState(0);
|
|
19
|
+
useLayoutEffect(() => {
|
|
20
|
+
if (!ref.current)
|
|
21
|
+
return;
|
|
22
|
+
setWidth(ref.current.offsetWidth);
|
|
23
|
+
const observer = new window.ResizeObserver((entries) => {
|
|
24
|
+
for (const entry of entries) {
|
|
25
|
+
if (entry.target === ref.current) {
|
|
26
|
+
setWidth(entry.contentRect.width);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
observer.observe(ref.current);
|
|
31
|
+
return () => observer.disconnect();
|
|
32
|
+
}, [ref]);
|
|
33
|
+
return width;
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=useContainerWidth.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useContainerWidth.js","sourceRoot":"","sources":["../../src/hooks/useContainerWidth.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,OAAO,CAAC;AAClD;;;;;;;;;;;;;;GAcG;AACH,MAAM,UAAU,iBAAiB,CAAC,GAAoC;IAClE,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC;IAEtC,eAAe,CAAC,GAAG,EAAE;QACjB,IAAI,CAAC,GAAG,CAAC,OAAO;YAAE,OAAO;QACzB,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;QAElC,MAAM,QAAQ,GAAG,IAAI,MAAM,CAAC,cAAc,CAAC,CAAC,OAAO,EAAE,EAAE;YACnD,KAAK,MAAM,KAAK,IAAI,OAAO,EAAE,CAAC;gBAC1B,IAAI,KAAK,CAAC,MAAM,KAAK,GAAG,CAAC,OAAO,EAAE,CAAC;oBAC/B,QAAQ,CAAC,KAAK,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;gBACtC,CAAC;YACL,CAAC;QACL,CAAC,CAAC,CAAC;QACH,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;QAE9B,OAAO,GAAG,EAAE,CAAC,QAAQ,CAAC,UAAU,EAAE,CAAC;IACvC,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAEV,OAAO,KAAK,CAAC;AACjB,CAAC"}
|
|
@@ -45,16 +45,16 @@ export type UseFloatingProps = {
|
|
|
45
45
|
/**
|
|
46
46
|
* When set to true, the width of the floating element will match the width of the reference element.
|
|
47
47
|
*
|
|
48
|
-
* @default
|
|
48
|
+
* @default false
|
|
49
49
|
*/
|
|
50
50
|
refWidth?: boolean;
|
|
51
51
|
/** Whether to hide the floating element. */
|
|
52
52
|
hide?: boolean;
|
|
53
53
|
};
|
|
54
|
-
export type UseFloatingElements
|
|
55
|
-
reference:
|
|
54
|
+
export type UseFloatingElements = {
|
|
55
|
+
reference: HTMLElement | null;
|
|
56
56
|
floating: HTMLElement | null;
|
|
57
|
-
setReference: (element:
|
|
57
|
+
setReference: (element: HTMLElement | null) => void;
|
|
58
58
|
setFloating: (element: HTMLElement | null) => void;
|
|
59
59
|
};
|
|
60
60
|
/**
|
|
@@ -63,9 +63,10 @@ export type UseFloatingElements<ReferenceElementType extends HTMLElement = HTMLE
|
|
|
63
63
|
* @param param0
|
|
64
64
|
* @returns
|
|
65
65
|
*/
|
|
66
|
-
export declare function useFloating
|
|
67
|
-
elements: UseFloatingElements
|
|
66
|
+
export declare function useFloating({ placement, arrowRef, strategy, offsetOptions, refWidth, hide, }: UseFloatingProps): {
|
|
67
|
+
elements: UseFloatingElements;
|
|
68
68
|
floatingStyles: React.CSSProperties;
|
|
69
69
|
middlewareData: MiddlewareData;
|
|
70
|
+
currentPlacement: Placement | undefined;
|
|
70
71
|
};
|
|
71
72
|
/** Copyright 2025 Anywhere Real Estate - CC BY 4.0 */
|
|
@@ -23,7 +23,7 @@ const TRANSITION_DELAY = 250;
|
|
|
23
23
|
* @param param0
|
|
24
24
|
* @returns
|
|
25
25
|
*/
|
|
26
|
-
export function useFloating({ placement = 'bottom-start', arrowRef, strategy = 'fixed', offsetOptions = 0, refWidth =
|
|
26
|
+
export function useFloating({ placement = 'bottom-start', arrowRef, strategy = 'fixed', offsetOptions = 0, refWidth = false, hide = false, }) {
|
|
27
27
|
const [floatingStyles, setFloatingStylesState] = useState({
|
|
28
28
|
opacity: 0,
|
|
29
29
|
pointerEvents: 'none',
|
|
@@ -43,6 +43,7 @@ export function useFloating({ placement = 'bottom-start', arrowRef, strategy = '
|
|
|
43
43
|
const compute = useCallback(() => {
|
|
44
44
|
computeDebounce.clear();
|
|
45
45
|
transitionDelay.clear();
|
|
46
|
+
// console.log('compute', { referenceElement, floatingElement });
|
|
46
47
|
// check if the reference or floating element is null
|
|
47
48
|
if (referenceElement === null || floatingElement === null)
|
|
48
49
|
return;
|
|
@@ -50,14 +51,12 @@ export function useFloating({ placement = 'bottom-start', arrowRef, strategy = '
|
|
|
50
51
|
if (floatingElement?.style.top)
|
|
51
52
|
setFloatingStyles((prev) => ({
|
|
52
53
|
...prev,
|
|
53
|
-
display: undefined,
|
|
54
54
|
opacity: 0,
|
|
55
55
|
pointerEvents: 'none',
|
|
56
56
|
}));
|
|
57
57
|
transitionDelay.set(() => {
|
|
58
58
|
setFloatingStyles((prev) => ({
|
|
59
59
|
...prev,
|
|
60
|
-
display: 'none',
|
|
61
60
|
}));
|
|
62
61
|
}, TRANSITION_DELAY);
|
|
63
62
|
return;
|
|
@@ -74,15 +73,13 @@ export function useFloating({ placement = 'bottom-start', arrowRef, strategy = '
|
|
|
74
73
|
arrowRef?.current && arrow({ element: arrowRef.current, padding: 8 }),
|
|
75
74
|
offset(offsetOptions),
|
|
76
75
|
flip(),
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
},
|
|
85
|
-
}),
|
|
76
|
+
size({
|
|
77
|
+
apply({ rects, elements }) {
|
|
78
|
+
Object.assign(elements.floating.style, {
|
|
79
|
+
width: refWidth ? `${rects.reference.width}px` : undefined,
|
|
80
|
+
});
|
|
81
|
+
},
|
|
82
|
+
}),
|
|
86
83
|
],
|
|
87
84
|
}).then((value) => {
|
|
88
85
|
setFloatingStyles(() => ({
|
|
@@ -140,6 +137,7 @@ export function useFloating({ placement = 'bottom-start', arrowRef, strategy = '
|
|
|
140
137
|
},
|
|
141
138
|
floatingStyles,
|
|
142
139
|
middlewareData,
|
|
140
|
+
currentPlacement: middlewareData?.offset?.placement,
|
|
143
141
|
};
|
|
144
142
|
}
|
|
145
143
|
/** Copyright 2025 Anywhere Real Estate - CC BY 4.0 */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useFloating.js","sourceRoot":"","sources":["../../src/hooks/useFloating.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,EAOH,eAAe,EACf,KAAK,EACL,MAAM,EACN,IAAI,EACJ,UAAU,EACV,IAAI,GACP,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEzD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAI1C,MAAM,gBAAgB,GAAG,GAAG,CAAC;AA8C7B;;;;;GAKG;AACH,MAAM,UAAU,WAAW,
|
|
1
|
+
{"version":3,"file":"useFloating.js","sourceRoot":"","sources":["../../src/hooks/useFloating.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,EAOH,eAAe,EAC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K,IAAI;YAAE,OAAO;QAE1E,MAAM,OAAO,GAAG,UAAU,CAAC,gBAAgB,EAAE,eAAe,EAAE,OAAO,CAAC,CAAC;QAEvE,OAAO,GAAG,EAAE;YACR,OAAO,EAAE,CAAC;QACd,CAAC,CAAC;IACN,CAAC,EAAE,CAAC,OAAO,EAAE,IAAI,EAAE,eAAe,EAAE,gBAAgB,CAAC,CAAC,CAAC;IAEvD,OAAO;QACH,QAAQ,EAAE;YACN,SAAS,EAAE,gBAAgB;YAC3B,QAAQ,EAAE,eAAe;YACzB,YAAY,EAAE,mBAAmB;YACjC,WAAW,EAAE,kBAAkB;SAClC;QACD,cAAc;QACd,cAAc;QACd,gBAAgB,EAAE,cAAc,EAAE,MAAM,EAAE,SAAS;KACtD,CAAC;AACN,CAAC;AAED,sDAAsD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const useSnackbarContext: () => import("-/utils/snackbarContext").SnackbarContextProps;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/* eslint-disable no-console */
|
|
2
|
+
import { useContext } from 'react';
|
|
3
|
+
import { SnackbarContext } from '../utils/snackbarContext';
|
|
4
|
+
export const useSnackbarContext = () => {
|
|
5
|
+
const context = useContext(SnackbarContext);
|
|
6
|
+
if (!context) {
|
|
7
|
+
console.error('useSnackbarContext must be used within a SnackbarProvider!');
|
|
8
|
+
}
|
|
9
|
+
return (context ?? {
|
|
10
|
+
snackbars: [],
|
|
11
|
+
sendSnackbar: () => console.error('sendSnackbar must be used within a SnackbarProvider!'),
|
|
12
|
+
clearSnackbar: () => console.error('clearSnackbar must be used within a SnackbarProvider!'),
|
|
13
|
+
clearAll: () => console.error('clearAll must be used within a SnackbarProvider!'),
|
|
14
|
+
});
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=useSnackbarContext.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useSnackbarContext.js","sourceRoot":"","sources":["../../src/hooks/useSnackbarContext.ts"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AACnC,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE1D,MAAM,CAAC,MAAM,kBAAkB,GAAG,GAAG,EAAE;IACnC,MAAM,OAAO,GAAG,UAAU,CAAC,eAAe,CAAC,CAAC;IAC5C,IAAI,CAAC,OAAO,EAAE,CAAC;QACX,OAAO,CAAC,KAAK,CAAC,4DAA4D,CAAC,CAAC;IAChF,CAAC;IACD,OAAO,CACH,OAAO,IAAI;QACP,SAAS,EAAE,EAAE;QACb,YAAY,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,sDAAsD,CAAC;QACzF,aAAa,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,uDAAuD,CAAC;QAC3F,QAAQ,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,kDAAkD,CAAC;KACpF,CACJ,CAAC;AACN,CAAC,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { useRef } from 'react';
|
|
2
|
+
const MIN_SWIPE_DISTANCE = 50; // Minimum distance for a swipe to be recognized
|
|
3
|
+
export function useSwipe(onSwipeLeft, onSwipeRight) {
|
|
4
|
+
const touchStart = useRef(null);
|
|
5
|
+
const touchEnd = useRef(null);
|
|
6
|
+
const onTouchStart = (e) => {
|
|
7
|
+
touchEnd.current = null;
|
|
8
|
+
touchStart.current = e.targetTouches[0].clientX;
|
|
9
|
+
};
|
|
10
|
+
const onTouchMove = (e) => {
|
|
11
|
+
touchEnd.current = e.targetTouches[0].clientX;
|
|
12
|
+
};
|
|
13
|
+
const onTouchEnd = () => {
|
|
14
|
+
if (!touchStart.current || !touchEnd.current)
|
|
15
|
+
return;
|
|
16
|
+
const distance = touchStart.current - touchEnd.current;
|
|
17
|
+
const isLeftSwipe = distance > MIN_SWIPE_DISTANCE;
|
|
18
|
+
const isRightSwipe = distance < -MIN_SWIPE_DISTANCE;
|
|
19
|
+
if (isLeftSwipe) {
|
|
20
|
+
onSwipeLeft();
|
|
21
|
+
}
|
|
22
|
+
else if (isRightSwipe) {
|
|
23
|
+
onSwipeRight();
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
return { onTouchStart, onTouchMove, onTouchEnd };
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=useSwipe.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useSwipe.js","sourceRoot":"","sources":["../../src/hooks/useSwipe.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqB,MAAM,EAAE,MAAM,OAAO,CAAC;AAElD,MAAM,kBAAkB,GAAG,EAAE,CAAC,CAAC,gDAAgD;AAE/E,MAAM,UAAU,QAAQ,CAAC,WAAuB,EAAE,YAAwB;IACtE,MAAM,UAAU,GAAG,MAAM,CAAgB,IAAI,CAAC,CAAC;IAC/C,MAAM,QAAQ,GAAG,MAAM,CAAgB,IAAI,CAAC,CAAC;IAE7C,MAAM,YAAY,GAAsB,CAAC,CAAC,EAAE,EAAE;QAC1C,QAAQ,CAAC,OAAO,GAAG,IAAI,CAAC;QACxB,UAAU,CAAC,OAAO,GAAG,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC;IACpD,CAAC,CAAC;IAEF,MAAM,WAAW,GAAsB,CAAC,CAAC,EAAE,EAAE;QACzC,QAAQ,CAAC,OAAO,GAAG,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC;IAClD,CAAC,CAAC;IAEF,MAAM,UAAU,GAAsB,GAAG,EAAE;QACvC,IAAI,CAAC,UAAU,CAAC,OAAO,IAAI,CAAC,QAAQ,CAAC,OAAO;YAAE,OAAO;QACrD,MAAM,QAAQ,GAAG,UAAU,CAAC,OAAO,GAAG,QAAQ,CAAC,OAAO,CAAC;QACvD,MAAM,WAAW,GAAG,QAAQ,GAAG,kBAAk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