@bspk/ui 1.1.34 → 1.2.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/build.ts +75 -27
- package/dist/components/Accordion/Accordion.d.ts +34 -0
- package/dist/components/Accordion/Accordion.js +42 -0
- package/dist/components/Accordion/Accordion.js.map +1 -0
- package/dist/components/Accordion/AccordionExample.d.ts +3 -0
- package/dist/components/Accordion/AccordionExample.js +72 -0
- package/dist/components/Accordion/AccordionExample.js.map +1 -0
- package/dist/components/Accordion/AccordionSection.d.ts +84 -0
- package/dist/components/Accordion/AccordionSection.js +27 -0
- package/dist/components/Accordion/AccordionSection.js.map +1 -0
- package/dist/components/Accordion/accordion.css +74 -0
- package/dist/components/Accordion/accordion.css.js +79 -0
- package/dist/components/Accordion/index.d.ts +1 -0
- package/dist/components/Accordion/index.js +2 -0
- package/dist/components/Accordion/index.js.map +1 -0
- package/dist/components/Avatar/Avatar.d.ts +16 -12
- package/dist/components/Avatar/Avatar.js +7 -9
- package/dist/components/Avatar/Avatar.js.map +1 -1
- package/dist/components/Avatar/AvatarExample.d.ts +1 -1
- package/dist/components/Avatar/AvatarExample.js +11 -2
- package/dist/components/Avatar/AvatarExample.js.map +1 -1
- package/dist/components/Avatar/avatar.css +27 -1
- package/dist/components/Avatar/avatar.css.js +27 -2
- package/dist/components/AvatarGroup/AvatarGroup.d.ts +10 -12
- package/dist/components/AvatarGroup/AvatarGroup.js +6 -6
- package/dist/components/AvatarGroup/AvatarGroup.js.map +1 -1
- package/dist/components/AvatarGroup/AvatarGroupExample.d.ts +3 -0
- package/dist/components/AvatarGroup/AvatarGroupExample.js +31 -0
- package/dist/components/AvatarGroup/AvatarGroupExample.js.map +1 -0
- package/dist/components/AvatarGroup/avatar-group.css +12 -1
- package/dist/components/AvatarGroup/avatar-group.css.js +12 -2
- package/dist/components/Badge/Badge.d.ts +6 -12
- package/dist/components/Badge/Badge.js +8 -10
- package/dist/components/Badge/Badge.js.map +1 -1
- package/dist/components/Badge/BadgeExample.d.ts +1 -1
- package/dist/components/Badge/BadgeExample.js +7 -38
- package/dist/components/Badge/BadgeExample.js.map +1 -1
- package/dist/components/Badge/badge.css +15 -24
- package/dist/components/Badge/badge.css.js +15 -25
- package/dist/components/BadgeDot/BadgeDot.d.ts +47 -0
- package/dist/components/BadgeDot/BadgeDot.js +35 -0
- package/dist/components/BadgeDot/BadgeDot.js.map +1 -0
- package/dist/components/BadgeDot/BadgeDotExample.d.ts +3 -0
- package/dist/components/BadgeDot/BadgeDotExample.js +16 -0
- package/dist/components/BadgeDot/BadgeDotExample.js.map +1 -0
- package/dist/components/BadgeDot/badge-dot.css +22 -0
- package/dist/components/BadgeDot/badge-dot.css.js +27 -0
- package/dist/components/BadgeDot/index.d.ts +1 -0
- package/dist/components/BadgeDot/index.js +2 -0
- package/dist/components/BadgeDot/index.js.map +1 -0
- package/dist/components/BannerAlert/BannerAlert.d.ts +7 -7
- package/dist/components/BannerAlert/BannerAlert.js +7 -5
- package/dist/components/BannerAlert/BannerAlert.js.map +1 -1
- package/dist/components/BannerAlert/BannerAlertExample.d.ts +1 -1
- package/dist/components/BannerAlert/BannerAlertExample.js +6 -6
- package/dist/components/BannerAlert/BannerAlertExample.js.map +1 -1
- package/dist/components/BannerAlert/banner-alert.css.js +0 -1
- package/dist/components/Breadcrumb/Breadcrumb.d.ts +6 -9
- package/dist/components/Breadcrumb/Breadcrumb.js +6 -8
- package/dist/components/Breadcrumb/Breadcrumb.js.map +1 -1
- package/dist/components/Breadcrumb/BreadcrumbExample.d.ts +1 -1
- package/dist/components/Breadcrumb/BreadcrumbExample.js +67 -0
- package/dist/components/Breadcrumb/BreadcrumbExample.js.map +1 -1
- package/dist/components/Breadcrumb/breadcrumb.css.js +0 -1
- package/dist/components/Button/Button.d.ts +11 -12
- package/dist/components/Button/Button.js +19 -19
- package/dist/components/Button/Button.js.map +1 -1
- package/dist/components/Button/ButtonExample.d.ts +1 -1
- package/dist/components/Button/ButtonExample.js +8 -1
- package/dist/components/Button/ButtonExample.js.map +1 -1
- package/dist/components/Button/button.css +1 -1
- package/dist/components/Button/button.css.js +1 -2
- package/dist/components/Card/Card.d.ts +2 -6
- package/dist/components/Card/Card.js +2 -4
- package/dist/components/Card/Card.js.map +1 -1
- package/dist/components/Card/CardExample.d.ts +1 -1
- package/dist/components/Card/card.css.js +0 -1
- package/dist/components/Checkbox/Checkbox.d.ts +6 -8
- package/dist/components/Checkbox/Checkbox.js +4 -6
- package/dist/components/Checkbox/Checkbox.js.map +1 -1
- package/dist/components/Checkbox/checkbox.css +0 -6
- package/dist/components/Checkbox/checkbox.css.js +0 -7
- package/dist/components/CheckboxGroup/CheckboxGroup.d.ts +6 -10
- package/dist/components/CheckboxGroup/CheckboxGroup.js +3 -5
- package/dist/components/CheckboxGroup/CheckboxGroup.js.map +1 -1
- package/dist/components/CheckboxGroup/CheckboxGroupExample.d.ts +1 -1
- package/dist/components/CheckboxGroup/CheckboxGroupExample.js +23 -1
- package/dist/components/CheckboxGroup/CheckboxGroupExample.js.map +1 -1
- package/dist/components/CheckboxOption/CheckboxOption.d.ts +5 -17
- package/dist/components/CheckboxOption/CheckboxOption.js +4 -5
- package/dist/components/CheckboxOption/CheckboxOption.js.map +1 -1
- package/dist/components/ChipAssist/ChipAssist.d.ts +3 -7
- package/dist/components/ChipAssist/ChipAssist.js +3 -5
- package/dist/components/ChipAssist/ChipAssist.js.map +1 -1
- package/dist/components/ChipAssist/ChipAssistExample.d.ts +1 -1
- package/dist/components/ChipAssist/ChipAssistExample.js.map +1 -1
- package/dist/components/ChipFilter/ChipFilter.d.ts +3 -7
- package/dist/components/ChipFilter/ChipFilter.js +3 -5
- package/dist/components/ChipFilter/ChipFilter.js.map +1 -1
- package/dist/components/ChipFilter/ChipFilterExample.d.ts +2 -2
- package/dist/components/ChipFilter/ChipFilterExample.js.map +1 -1
- package/dist/components/ChipGroup/ChipGroup.d.ts +4 -8
- package/dist/components/ChipGroup/ChipGroup.js +3 -5
- package/dist/components/ChipGroup/ChipGroup.js.map +1 -1
- package/dist/components/ChipGroup/ChipGroupExample.d.ts +2 -2
- package/dist/components/ChipGroup/ChipGroupExample.js +1 -1
- package/dist/components/ChipGroup/ChipGroupExample.js.map +1 -1
- package/dist/components/ChipGroup/chip-group.css.js +0 -1
- package/dist/components/ChipInput/ChipInput.d.ts +3 -7
- package/dist/components/ChipInput/ChipInput.js +3 -5
- package/dist/components/ChipInput/ChipInput.js.map +1 -1
- package/dist/components/ChipInput/ChipInputExample.d.ts +1 -1
- package/dist/components/ChipInput/ChipInputExample.js.map +1 -1
- package/dist/components/ChipSuggestion/ChipSuggestion.d.ts +3 -7
- package/dist/components/ChipSuggestion/ChipSuggestion.js +3 -5
- package/dist/components/ChipSuggestion/ChipSuggestion.js.map +1 -1
- package/dist/components/ChipSuggestion/ChipSuggestionExample.d.ts +1 -1
- package/dist/components/ChipSuggestion/ChipSuggestionExample.js.map +1 -1
- package/dist/components/ChipUtility/ChipUtility.d.ts +4 -8
- package/dist/components/ChipUtility/ChipUtility.js +2 -5
- package/dist/components/ChipUtility/ChipUtility.js.map +1 -1
- package/dist/components/ChipUtility/ChipUtilityExample.d.ts +1 -1
- package/dist/components/ChipUtility/ChipUtilityExample.js +2 -0
- package/dist/components/ChipUtility/ChipUtilityExample.js.map +1 -1
- package/dist/components/ChipUtility/chip-utility.css +10 -10
- package/dist/components/ChipUtility/chip-utility.css.js +10 -11
- package/dist/components/Combobox/Combobox.d.ts +7 -11
- package/dist/components/Combobox/Combobox.js +8 -33
- package/dist/components/Combobox/Combobox.js.map +1 -1
- package/dist/components/Combobox/ListItems.d.ts +26 -0
- package/dist/components/Combobox/ListItems.js +22 -0
- package/dist/components/Combobox/ListItems.js.map +1 -0
- package/dist/components/Dialog/Dialog.d.ts +4 -10
- package/dist/components/Dialog/Dialog.js +11 -48
- package/dist/components/Dialog/Dialog.js.map +1 -1
- package/dist/components/Dialog/DialogExample.d.ts +1 -1
- package/dist/components/Dialog/DialogExample.js +3 -4
- package/dist/components/Dialog/DialogExample.js.map +1 -1
- package/dist/components/Dialog/dialog.css +67 -37
- package/dist/components/Dialog/dialog.css.js +67 -38
- package/dist/components/Divider/Divider.d.ts +3 -7
- package/dist/components/Divider/Divider.js +3 -5
- package/dist/components/Divider/Divider.js.map +1 -1
- package/dist/components/Divider/DividerExample.d.ts +1 -1
- package/dist/components/Divider/divider.css +3 -7
- package/dist/components/Divider/divider.css.js +3 -8
- package/dist/components/EmptyState/EmptyState.d.ts +3 -7
- package/dist/components/EmptyState/EmptyState.js +2 -4
- package/dist/components/EmptyState/EmptyState.js.map +1 -1
- package/dist/components/EmptyState/EmptyStateExample.d.ts +1 -1
- package/dist/components/EmptyState/EmptyStateExample.js +11 -6
- package/dist/components/EmptyState/EmptyStateExample.js.map +1 -1
- package/dist/components/ExamplePlaceholder/ExamplePlaceholder.d.ts +30 -11
- package/dist/components/ExamplePlaceholder/ExamplePlaceholder.js +2 -4
- package/dist/components/ExamplePlaceholder/ExamplePlaceholder.js.map +1 -1
- package/dist/components/Fab/Fab.d.ts +6 -10
- package/dist/components/Fab/Fab.js +19 -13
- package/dist/components/Fab/Fab.js.map +1 -1
- package/dist/components/Fab/FabExample.d.ts +1 -1
- package/dist/components/Fab/fab.css +1 -1
- package/dist/components/Fab/fab.css.js +1 -2
- package/dist/components/FileUpload/FileUpload.d.ts +87 -0
- package/dist/components/FileUpload/FileUpload.js +140 -0
- package/dist/components/FileUpload/FileUpload.js.map +1 -0
- package/dist/components/FileUpload/FileUploadExample.d.ts +3 -0
- package/dist/components/FileUpload/FileUploadExample.js +66 -0
- package/dist/components/FileUpload/FileUploadExample.js.map +1 -0
- package/dist/components/FileUpload/file-upload.css +20 -0
- package/dist/components/FileUpload/file-upload.css.js +25 -0
- package/dist/components/FileUpload/index.d.ts +1 -0
- package/dist/components/FileUpload/index.js +2 -0
- package/dist/components/FileUpload/index.js.map +1 -0
- package/dist/components/FileUploadItem/FileUploadItem.d.ts +40 -0
- package/dist/components/FileUploadItem/FileUploadItem.js +60 -0
- package/dist/components/FileUploadItem/FileUploadItem.js.map +1 -0
- package/dist/components/FileUploadItem/FileUploadItemExample.d.ts +3 -0
- package/dist/components/FileUploadItem/FileUploadItemExample.js +67 -0
- package/dist/components/FileUploadItem/FileUploadItemExample.js.map +1 -0
- package/dist/components/FileUploadItem/file-upload-item.css +40 -0
- package/dist/components/FileUploadItem/file-upload-item.css.js +45 -0
- package/dist/components/FileUploadItem/index.d.ts +1 -0
- package/dist/components/FileUploadItem/index.js +2 -0
- package/dist/components/FileUploadItem/index.js.map +1 -0
- package/dist/components/FormField/FormField.d.ts +10 -24
- package/dist/components/FormField/FormField.js +4 -7
- package/dist/components/FormField/FormField.js.map +1 -1
- package/dist/components/FormField/FormFieldExample.d.ts +4 -0
- package/dist/components/FormField/FormFieldExample.js +12 -0
- package/dist/components/FormField/FormFieldExample.js.map +1 -0
- package/dist/components/FormField/form-field.css.js +0 -1
- package/dist/components/Img/Img.d.ts +2 -6
- package/dist/components/Img/Img.js +1 -3
- package/dist/components/Img/Img.js.map +1 -1
- package/dist/components/InlineAlert/InlineAlert.d.ts +3 -7
- package/dist/components/InlineAlert/InlineAlert.js +4 -7
- package/dist/components/InlineAlert/InlineAlert.js.map +1 -1
- package/dist/components/InlineAlert/SvgWarningTwoTone.d.ts +1 -0
- package/dist/components/InlineAlert/SvgWarningTwoTone.js +5 -0
- package/dist/components/InlineAlert/SvgWarningTwoTone.js.map +1 -0
- package/dist/components/InlineAlert/inline-alert.css +1 -0
- package/dist/components/InlineAlert/inline-alert.css.js +1 -1
- package/dist/components/Layout/Layout.d.ts +4 -8
- package/dist/components/Layout/Layout.js +1 -3
- package/dist/components/Layout/Layout.js.map +1 -1
- package/dist/components/Layout/LayoutExample.d.ts +3 -0
- package/dist/components/Layout/LayoutExample.js +7 -0
- package/dist/components/Layout/LayoutExample.js.map +1 -0
- package/dist/components/Link/Link.d.ts +3 -7
- package/dist/components/Link/Link.js +2 -4
- package/dist/components/Link/Link.js.map +1 -1
- package/dist/components/Link/LinkExample.d.ts +1 -1
- package/dist/components/Link/LinkExample.js +7 -7
- package/dist/components/Link/LinkExample.js.map +1 -1
- package/dist/components/Link/link.css +1 -1
- package/dist/components/Link/link.css.js +1 -2
- package/dist/components/ListItem/ListItem.d.ts +9 -21
- package/dist/components/ListItem/ListItem.js +12 -66
- package/dist/components/ListItem/ListItem.js.map +1 -1
- package/dist/components/ListItem/ListItemButton.d.ts +2 -0
- package/dist/components/ListItem/ListItemButton.js +7 -0
- package/dist/components/ListItem/ListItemButton.js.map +1 -0
- package/dist/components/ListItem/ListItemExample.d.ts +2 -3
- package/dist/components/ListItem/ListItemExample.js +22 -41
- package/dist/components/ListItem/ListItemExample.js.map +1 -1
- package/dist/components/ListItem/list-item.css +11 -25
- package/dist/components/ListItem/list-item.css.js +12 -27
- package/dist/components/Listbox/Listbox.d.ts +7 -10
- package/dist/components/Listbox/Listbox.js +6 -8
- package/dist/components/Listbox/Listbox.js.map +1 -1
- package/dist/components/Menu/Menu.d.ts +27 -23
- package/dist/components/Menu/Menu.js +25 -32
- package/dist/components/Menu/Menu.js.map +1 -1
- package/dist/components/Menu/MenuExample.d.ts +2 -2
- package/dist/components/Menu/MenuExample.js +25 -2
- package/dist/components/Menu/MenuExample.js.map +1 -1
- package/dist/components/Menu/menu.css +5 -2
- package/dist/components/Menu/menu.css.js +5 -3
- package/dist/components/MenuButton/MenuButton.d.ts +3 -7
- package/dist/components/MenuButton/MenuButton.js +1 -3
- package/dist/components/MenuButton/MenuButton.js.map +1 -1
- package/dist/components/MenuButton/menu-button.css.js +0 -1
- package/dist/components/Modal/Modal.d.ts +6 -10
- package/dist/components/Modal/Modal.js +3 -5
- package/dist/components/Modal/Modal.js.map +1 -1
- package/dist/components/Modal/ModalExample.d.ts +1 -1
- package/dist/components/Modal/ModalExample.js +3 -3
- package/dist/components/Modal/ModalExample.js.map +1 -1
- package/dist/components/Modal/modal.css +6 -14
- package/dist/components/Modal/modal.css.js +6 -15
- package/dist/components/NumberField/NumberField.d.ts +5 -9
- package/dist/components/NumberField/NumberField.js +3 -6
- package/dist/components/NumberField/NumberField.js.map +1 -1
- package/dist/components/NumberInput/IncrementButton.d.ts +7 -0
- package/dist/components/NumberInput/IncrementButton.js +10 -0
- package/dist/components/NumberInput/IncrementButton.js.map +1 -0
- package/dist/components/NumberInput/NumberInput.d.ts +4 -11
- package/dist/components/NumberInput/NumberInput.js +22 -37
- package/dist/components/NumberInput/NumberInput.js.map +1 -1
- package/dist/components/NumberInput/NumberInputExample.d.ts +3 -0
- package/dist/components/NumberInput/NumberInputExample.js +5 -0
- package/dist/components/NumberInput/NumberInputExample.js.map +1 -0
- package/dist/components/NumberInput/number-input.css +8 -5
- package/dist/components/NumberInput/number-input.css.js +8 -6
- package/dist/components/OTPInput/OTPInput.d.ts +41 -0
- package/dist/components/OTPInput/OTPInput.js +57 -0
- package/dist/components/OTPInput/OTPInput.js.map +1 -0
- package/dist/components/OTPInput/OTPInputExample.d.ts +3 -0
- package/dist/components/OTPInput/OTPInputExample.js +25 -0
- package/dist/components/OTPInput/OTPInputExample.js.map +1 -0
- package/dist/components/OTPInput/index.d.ts +1 -0
- package/dist/components/OTPInput/index.js +2 -0
- package/dist/components/OTPInput/index.js.map +1 -0
- package/dist/components/OTPInput/otp-input.css +72 -0
- package/dist/components/OTPInput/otp-input.css.js +77 -0
- package/dist/components/PageControl/PageControl.d.ts +43 -0
- package/dist/components/PageControl/PageControl.js +46 -0
- package/dist/components/PageControl/PageControl.js.map +1 -0
- package/dist/components/PageControl/index.d.ts +1 -0
- package/dist/components/PageControl/index.js +2 -0
- package/dist/components/PageControl/index.js.map +1 -0
- package/dist/components/PageControl/page-control.css +33 -0
- package/dist/components/PageControl/page-control.css.js +38 -0
- package/dist/components/Pagination/PageInput.d.ts +5 -0
- package/dist/components/Pagination/PageInput.js +36 -0
- package/dist/components/Pagination/PageInput.js.map +1 -0
- package/dist/components/Pagination/PageList.d.ts +3 -0
- package/dist/components/Pagination/PageList.js +9 -0
- package/dist/components/Pagination/PageList.js.map +1 -0
- package/dist/components/Pagination/Pagination.d.ts +43 -0
- package/dist/components/Pagination/Pagination.js +49 -0
- package/dist/components/Pagination/Pagination.js.map +1 -0
- package/dist/components/Pagination/index.d.ts +1 -0
- package/dist/components/Pagination/index.js +2 -0
- package/dist/components/Pagination/index.js.map +1 -0
- package/dist/components/Pagination/pagination.css +31 -0
- package/dist/components/Pagination/pagination.css.js +36 -0
- package/dist/components/PasswordField/PasswordField.d.ts +31 -0
- package/dist/components/PasswordField/PasswordField.js +33 -0
- package/dist/components/PasswordField/PasswordField.js.map +1 -0
- package/dist/components/PasswordField/index.d.ts +1 -0
- package/dist/components/PasswordField/index.js +2 -0
- package/dist/components/PasswordField/index.js.map +1 -0
- package/dist/components/PasswordInput/PasswordInput.d.ts +21 -0
- package/dist/components/PasswordInput/PasswordInput.js +34 -0
- package/dist/components/PasswordInput/PasswordInput.js.map +1 -0
- package/dist/components/PasswordInput/index.d.ts +1 -0
- package/dist/components/PasswordInput/index.js +2 -0
- package/dist/components/PasswordInput/index.js.map +1 -0
- package/dist/components/PasswordInput/password-input.css +28 -0
- package/dist/components/PasswordInput/password-input.css.js +33 -0
- package/dist/components/PhoneNumberField/PhoneNumberField.d.ts +5 -9
- package/dist/components/PhoneNumberField/PhoneNumberField.js +3 -6
- package/dist/components/PhoneNumberField/PhoneNumberField.js.map +1 -1
- package/dist/components/PhoneNumberInput/PhoneNumberInput.d.ts +6 -10
- package/dist/components/PhoneNumberInput/PhoneNumberInput.js +5 -9
- package/dist/components/PhoneNumberInput/PhoneNumberInput.js.map +1 -1
- package/dist/components/PhoneNumberInput/phone-number-input.css.js +0 -1
- package/dist/components/Popover/Popover.d.ts +11 -9
- package/dist/components/Popover/Popover.js +27 -11
- package/dist/components/Popover/Popover.js.map +1 -1
- package/dist/components/Popover/PopoverExample.d.ts +1 -1
- package/dist/components/Popover/PopoverExample.js +19 -3
- package/dist/components/Popover/PopoverExample.js.map +1 -1
- package/dist/components/Popover/popover.css +17 -22
- package/dist/components/Popover/popover.css.js +17 -23
- package/dist/components/Portal/Portal.d.ts +1 -5
- package/dist/components/Portal/Portal.js +5 -5
- package/dist/components/Portal/Portal.js.map +1 -1
- package/dist/components/ProgressBar/ProgressBar.d.ts +16 -6
- package/dist/components/ProgressBar/ProgressBar.js +7 -6
- package/dist/components/ProgressBar/ProgressBar.js.map +1 -1
- package/dist/components/ProgressBar/progress-bar.css +3 -0
- package/dist/components/ProgressBar/progress-bar.css.js +3 -1
- package/dist/components/ProgressCircle/ProgressCircle.d.ts +1 -2
- package/dist/components/ProgressCircle/ProgressCircle.js +4 -10
- package/dist/components/ProgressCircle/ProgressCircle.js.map +1 -1
- package/dist/components/ProgressCircle/ProgressCircleSVG.d.ts +3 -0
- package/dist/components/ProgressCircle/ProgressCircleSVG.js +9 -0
- package/dist/components/ProgressCircle/ProgressCircleSVG.js.map +1 -0
- package/dist/components/ProgressCircle/progress-circle.css.js +0 -1
- package/dist/components/ProgressionStepper/ProgressionStepper.d.ts +4 -12
- package/dist/components/ProgressionStepper/ProgressionStepper.js +6 -8
- package/dist/components/ProgressionStepper/ProgressionStepper.js.map +1 -1
- package/dist/components/ProgressionStepper/ProgressionStepperExample.d.ts +1 -1
- package/dist/components/ProgressionStepper/ProgressionStepperExample.js +2 -1
- package/dist/components/ProgressionStepper/ProgressionStepperExample.js.map +1 -1
- package/dist/components/ProgressionStepper/progression-stepper.css +11 -0
- package/dist/components/ProgressionStepper/progression-stepper.css.js +11 -1
- package/dist/components/ProgressionStepperBar/ProgressionStepperBar.d.ts +2 -6
- package/dist/components/ProgressionStepperBar/ProgressionStepperBar.js +3 -5
- package/dist/components/ProgressionStepperBar/ProgressionStepperBar.js.map +1 -1
- package/dist/components/ProgressionStepperBar/progression-stepper-bar.css +1 -1
- package/dist/components/ProgressionStepperBar/progression-stepper-bar.css.js +1 -2
- package/dist/components/Radio/Radio.d.ts +3 -7
- package/dist/components/Radio/Radio.js +3 -5
- package/dist/components/Radio/Radio.js.map +1 -1
- package/dist/components/Radio/RadioExample.d.ts +1 -1
- package/dist/components/Radio/radio.css +1 -1
- package/dist/components/Radio/radio.css.js +1 -2
- package/dist/components/RadioGroup/RadioGroup.d.ts +9 -13
- package/dist/components/RadioGroup/RadioGroup.js +6 -9
- package/dist/components/RadioGroup/RadioGroup.js.map +1 -1
- package/dist/components/RadioGroup/RadioGroupExample.d.ts +1 -1
- package/dist/components/RadioGroup/RadioGroupExample.js +2 -22
- package/dist/components/RadioGroup/RadioGroupExample.js.map +1 -1
- package/dist/components/RadioGroup/radio-group.css +0 -1
- package/dist/components/RadioGroup/radio-group.css.js +0 -2
- package/dist/components/RadioOption/RadioOption.d.ts +4 -17
- package/dist/components/RadioOption/RadioOption.js +3 -4
- package/dist/components/RadioOption/RadioOption.js.map +1 -1
- package/dist/components/RadioOption/RadioOptionExample.d.ts +1 -1
- package/dist/components/Rating/Rating.d.ts +39 -0
- package/dist/components/Rating/Rating.js +41 -0
- package/dist/components/Rating/Rating.js.map +1 -0
- package/dist/components/Rating/RatingExample.d.ts +3 -0
- package/dist/components/Rating/RatingExample.js +17 -0
- package/dist/components/Rating/RatingExample.js.map +1 -0
- package/dist/components/Rating/index.d.ts +1 -0
- package/dist/components/Rating/index.js +2 -0
- package/dist/components/Rating/index.js.map +1 -0
- package/dist/components/Rating/rating.css +65 -0
- package/dist/components/Rating/rating.css.js +70 -0
- package/dist/components/Scrim/Scrim.d.ts +3 -15
- package/dist/components/Scrim/Scrim.js +2 -4
- package/dist/components/Scrim/Scrim.js.map +1 -1
- package/dist/components/Scrim/scrim.css +12 -2
- package/dist/components/Scrim/scrim.css.js +12 -3
- package/dist/components/SearchBar/SearchBar.d.ts +5 -9
- package/dist/components/SearchBar/SearchBar.js +10 -11
- package/dist/components/SearchBar/SearchBar.js.map +1 -1
- package/dist/components/SearchBar/SearchBarExample.d.ts +1 -1
- package/dist/components/SearchBar/SearchBarExample.js +1 -1
- package/dist/components/SearchBar/SearchBarExample.js.map +1 -1
- package/dist/components/SearchBar/search-bar.css +1 -1
- package/dist/components/SearchBar/search-bar.css.js +1 -2
- package/dist/components/SegmentedControl/SegmentedControl.d.ts +6 -86
- package/dist/components/SegmentedControl/SegmentedControl.js +5 -15
- package/dist/components/SegmentedControl/SegmentedControl.js.map +1 -1
- package/dist/components/SegmentedControl/SegmentedControlExample.d.ts +1 -1
- package/dist/components/SegmentedControl/SegmentedControlExample.js +41 -20
- package/dist/components/SegmentedControl/SegmentedControlExample.js.map +1 -1
- package/dist/components/SegmentedControl/segmented-control.css +26 -73
- package/dist/components/SegmentedControl/segmented-control.css.js +26 -74
- package/dist/components/Select/Select.d.ts +5 -9
- package/dist/components/Select/Select.js +6 -8
- package/dist/components/Select/Select.js.map +1 -1
- package/dist/components/Select/SelectExample.d.ts +1 -1
- package/dist/components/Select/SelectExample.js +3 -3
- package/dist/components/Select/SelectExample.js.map +1 -1
- package/dist/components/Select/select.css +9 -8
- package/dist/components/Select/select.css.js +9 -9
- package/dist/components/SelectField/SelectField.d.ts +5 -9
- package/dist/components/SelectField/SelectField.js +5 -6
- package/dist/components/SelectField/SelectField.js.map +1 -1
- package/dist/components/Skeleton/Circular.d.ts +2 -0
- package/dist/components/Skeleton/Circular.js +6 -0
- package/dist/components/Skeleton/Circular.js.map +1 -0
- package/dist/components/Skeleton/Photo.d.ts +2 -0
- package/dist/components/Skeleton/Photo.js +6 -0
- package/dist/components/Skeleton/Photo.js.map +1 -0
- package/dist/components/Skeleton/Profile.d.ts +2 -0
- package/dist/components/Skeleton/Profile.js +6 -0
- package/dist/components/Skeleton/Profile.js.map +1 -0
- package/dist/components/Skeleton/Rectangular.d.ts +2 -0
- package/dist/components/Skeleton/Rectangular.js +6 -0
- package/dist/components/Skeleton/Rectangular.js.map +1 -0
- package/dist/components/Skeleton/Skeleton.d.ts +4 -12
- package/dist/components/Skeleton/Skeleton.js +2 -19
- package/dist/components/Skeleton/Skeleton.js.map +1 -1
- package/dist/components/Skeleton/SkeletonExample.d.ts +1 -1
- package/dist/components/Skeleton/SkeletonExample.js +13 -10
- package/dist/components/Skeleton/SkeletonExample.js.map +1 -1
- package/dist/components/Skeleton/Thumbnail.d.ts +2 -0
- package/dist/components/Skeleton/Thumbnail.js +6 -0
- package/dist/components/Skeleton/Thumbnail.js.map +1 -0
- package/dist/components/Skeleton/index.d.ts +5 -0
- package/dist/components/Skeleton/index.js +5 -0
- package/dist/components/Skeleton/index.js.map +1 -1
- package/dist/components/SkeletonText/SkeletonText.d.ts +3 -7
- package/dist/components/SkeletonText/SkeletonText.js +2 -4
- package/dist/components/SkeletonText/SkeletonText.js.map +1 -1
- package/dist/components/SkeletonText/SkeletonTextExample.d.ts +1 -1
- package/dist/components/SkeletonText/SkeletonTextExample.js.map +1 -1
- package/dist/components/Slider/Slider.d.ts +80 -0
- package/dist/components/Slider/Slider.js +131 -0
- package/dist/components/Slider/Slider.js.map +1 -0
- package/dist/components/Slider/SliderExample.d.ts +3 -0
- package/dist/components/Slider/SliderExample.js +59 -0
- package/dist/components/Slider/SliderExample.js.map +1 -0
- package/dist/components/Slider/SliderIntervalDots.d.ts +6 -0
- package/dist/components/Slider/SliderIntervalDots.js +20 -0
- package/dist/components/Slider/SliderIntervalDots.js.map +1 -0
- package/dist/components/Slider/index.d.ts +1 -0
- package/dist/components/Slider/index.js +2 -0
- package/dist/components/Slider/index.js.map +1 -0
- package/dist/components/Slider/slider.css +122 -0
- package/dist/components/Slider/slider.css.js +127 -0
- package/dist/components/Slider/useNormalizeSliderValue.d.ts +7 -0
- package/dist/components/Slider/useNormalizeSliderValue.js +12 -0
- package/dist/components/Slider/useNormalizeSliderValue.js.map +1 -0
- package/dist/components/StylesProviderAnywhere/StylesProviderAnywhere.d.ts +4 -6
- package/dist/components/StylesProviderAnywhere/StylesProviderAnywhere.js +4 -4
- package/dist/components/StylesProviderAnywhere/StylesProviderAnywhere.js.map +1 -1
- package/dist/components/StylesProviderBetterHomesGardens/StylesProviderBetterHomesGardens.d.ts +4 -6
- package/dist/components/StylesProviderBetterHomesGardens/StylesProviderBetterHomesGardens.js +4 -4
- package/dist/components/StylesProviderBetterHomesGardens/StylesProviderBetterHomesGardens.js.map +1 -1
- package/dist/components/StylesProviderCartus/StylesProviderCartus.d.ts +4 -6
- package/dist/components/StylesProviderCartus/StylesProviderCartus.js +4 -4
- package/dist/components/StylesProviderCartus/StylesProviderCartus.js.map +1 -1
- package/dist/components/StylesProviderCentury21/StylesProviderCentury21.d.ts +4 -6
- package/dist/components/StylesProviderCentury21/StylesProviderCentury21.js +4 -4
- package/dist/components/StylesProviderCentury21/StylesProviderCentury21.js.map +1 -1
- package/dist/components/StylesProviderColdwellBanker/StylesProviderColdwellBanker.d.ts +4 -6
- package/dist/components/StylesProviderColdwellBanker/StylesProviderColdwellBanker.js +4 -4
- package/dist/components/StylesProviderColdwellBanker/StylesProviderColdwellBanker.js.map +1 -1
- package/dist/components/StylesProviderCorcoran/StylesProviderCorcoran.d.ts +4 -6
- package/dist/components/StylesProviderCorcoran/StylesProviderCorcoran.js +4 -4
- package/dist/components/StylesProviderCorcoran/StylesProviderCorcoran.js.map +1 -1
- package/dist/components/StylesProviderDemo/StylesProviderDemo.d.ts +25 -0
- package/dist/components/StylesProviderDemo/StylesProviderDemo.js +35 -0
- package/dist/components/StylesProviderDemo/StylesProviderDemo.js.map +1 -0
- package/dist/components/StylesProviderDemo/brandsCss.d.ts +2 -0
- package/dist/components/StylesProviderDemo/brandsCss.js +12 -0
- package/dist/components/StylesProviderDemo/brandsCss.js.map +1 -0
- package/dist/components/StylesProviderDemo/index.d.ts +1 -0
- package/dist/components/StylesProviderDemo/index.js +2 -0
- package/dist/components/StylesProviderDemo/index.js.map +1 -0
- package/dist/components/StylesProviderDenaliBoss/StylesProviderDenaliBoss.d.ts +4 -6
- package/dist/components/StylesProviderDenaliBoss/StylesProviderDenaliBoss.js +4 -4
- package/dist/components/StylesProviderDenaliBoss/StylesProviderDenaliBoss.js.map +1 -1
- package/dist/components/StylesProviderEra/StylesProviderEra.d.ts +4 -6
- package/dist/components/StylesProviderEra/StylesProviderEra.js +4 -4
- package/dist/components/StylesProviderEra/StylesProviderEra.js.map +1 -1
- package/dist/components/StylesProviderSothebys/StylesProviderSothebys.d.ts +4 -6
- package/dist/components/StylesProviderSothebys/StylesProviderSothebys.js +4 -4
- package/dist/components/StylesProviderSothebys/StylesProviderSothebys.js.map +1 -1
- package/dist/components/Switch/Switch.d.ts +3 -7
- package/dist/components/Switch/Switch.js +2 -4
- package/dist/components/Switch/Switch.js.map +1 -1
- package/dist/components/Switch/switch.css +1 -1
- package/dist/components/Switch/switch.css.js +1 -2
- package/dist/components/SwitchOption/SwitchOption.d.ts +5 -9
- package/dist/components/SwitchOption/SwitchOption.js +4 -5
- package/dist/components/SwitchOption/SwitchOption.js.map +1 -1
- package/dist/components/TabGroup/TabGroup.d.ts +5 -87
- package/dist/components/TabGroup/TabGroup.js +7 -22
- package/dist/components/TabGroup/TabGroup.js.map +1 -1
- package/dist/components/TabGroup/TabGroupExample.d.ts +1 -1
- package/dist/components/TabGroup/TabGroupExample.js +74 -70
- package/dist/components/TabGroup/TabGroupExample.js.map +1 -1
- package/dist/components/TabGroup/tab-group.css +18 -54
- package/dist/components/TabGroup/tab-group.css.js +18 -55
- package/dist/components/TabList/TabList.d.ts +129 -0
- package/dist/components/TabList/TabList.js +80 -0
- package/dist/components/TabList/TabList.js.map +1 -0
- package/dist/components/TabList/TabListExample.d.ts +3 -0
- package/dist/components/TabList/TabListExample.js +6 -0
- package/dist/components/TabList/TabListExample.js.map +1 -0
- package/dist/components/TabList/index.d.ts +1 -0
- package/dist/components/TabList/index.js +2 -0
- package/dist/components/TabList/index.js.map +1 -0
- package/dist/components/TabList/tab-list.css +64 -0
- package/dist/components/TabList/tab-list.css.js +69 -0
- package/dist/components/Table/Footer.d.ts +8 -0
- package/dist/components/Table/Footer.js +8 -0
- package/dist/components/Table/Footer.js.map +1 -0
- package/dist/components/Table/Table.d.ts +46 -30
- package/dist/components/Table/Table.js +73 -12
- package/dist/components/Table/Table.js.map +1 -1
- package/dist/components/Table/TableExample.d.ts +4 -0
- package/dist/components/Table/TableExample.js +126 -0
- package/dist/components/Table/TableExample.js.map +1 -0
- package/dist/components/Table/table.css +167 -20
- package/dist/components/Table/table.css.js +167 -21
- package/dist/components/Table/utils.d.ts +81 -0
- package/dist/components/Table/utils.js +89 -0
- package/dist/components/Table/utils.js.map +1 -0
- package/dist/components/Tag/Tag.d.ts +7 -35
- package/dist/components/Tag/Tag.js +5 -11
- package/dist/components/Tag/Tag.js.map +1 -1
- package/dist/components/Tag/TagExample.d.ts +3 -0
- package/dist/components/Tag/TagExample.js +14 -0
- package/dist/components/Tag/TagExample.js.map +1 -0
- package/dist/components/Tag/tag.css +7 -11
- package/dist/components/Tag/tag.css.js +7 -12
- package/dist/components/TextField/TextField.d.ts +5 -9
- package/dist/components/TextField/TextField.js +3 -5
- package/dist/components/TextField/TextField.js.map +1 -1
- package/dist/components/TextInput/TextInput.d.ts +17 -11
- package/dist/components/TextInput/TextInput.js +4 -6
- package/dist/components/TextInput/TextInput.js.map +1 -1
- package/dist/components/TextInput/TextInputExample.d.ts +1 -1
- package/dist/components/TextInput/TextInputExample.js +2 -0
- package/dist/components/TextInput/TextInputExample.js.map +1 -1
- package/dist/components/TextInput/text-input.css +2 -2
- package/dist/components/TextInput/text-input.css.js +2 -3
- package/dist/components/Textarea/Textarea.d.ts +4 -8
- package/dist/components/Textarea/Textarea.js +3 -5
- package/dist/components/Textarea/Textarea.js.map +1 -1
- package/dist/components/Textarea/TextareaExample.d.ts +1 -1
- package/dist/components/Textarea/TextareaExample.js +4 -1
- package/dist/components/Textarea/TextareaExample.js.map +1 -1
- package/dist/components/Textarea/textarea.css.js +0 -1
- package/dist/components/TextareaField/TextareaField.d.ts +5 -9
- package/dist/components/TextareaField/TextareaField.js +9 -12
- package/dist/components/TextareaField/TextareaField.js.map +1 -1
- package/dist/components/TextareaField/TextareaFieldExample.d.ts +1 -1
- package/dist/components/TextareaField/TextareaFieldExample.js +2 -1
- package/dist/components/TextareaField/TextareaFieldExample.js.map +1 -1
- package/dist/components/TimeInput/Listbox.d.ts +10 -0
- package/dist/components/TimeInput/Listbox.js +66 -0
- package/dist/components/TimeInput/Listbox.js.map +1 -0
- package/dist/components/TimeInput/Segment.d.ts +21 -0
- package/dist/components/TimeInput/Segment.js +160 -0
- package/dist/components/TimeInput/Segment.js.map +1 -0
- package/dist/components/TimeInput/TimeInput.d.ts +26 -0
- package/dist/components/TimeInput/TimeInput.js +66 -0
- package/dist/components/TimeInput/TimeInput.js.map +1 -0
- package/dist/components/TimeInput/TimeInputExample.d.ts +3 -0
- package/dist/components/TimeInput/TimeInputExample.js +4 -0
- package/dist/components/TimeInput/TimeInputExample.js.map +1 -0
- package/dist/components/TimeInput/index.d.ts +1 -0
- package/dist/components/TimeInput/index.js +2 -0
- package/dist/components/TimeInput/index.js.map +1 -0
- package/dist/components/TimeInput/time-input.css +138 -0
- package/dist/components/TimeInput/time-input.css.js +143 -0
- package/dist/components/ToggleOption/ToggleOption.d.ts +7 -7
- package/dist/components/ToggleOption/ToggleOption.js +2 -4
- package/dist/components/ToggleOption/ToggleOption.js.map +1 -1
- package/dist/components/ToggleOption/toggle-option.css +17 -12
- package/dist/components/ToggleOption/toggle-option.css.js +17 -13
- package/dist/components/Tooltip/Tooltip.d.ts +12 -11
- package/dist/components/Tooltip/Tooltip.js +17 -15
- package/dist/components/Tooltip/Tooltip.js.map +1 -1
- package/dist/components/Tooltip/TooltipExample.d.ts +3 -2
- package/dist/components/Tooltip/TooltipExample.js +1 -1
- package/dist/components/Tooltip/TooltipExample.js.map +1 -1
- package/dist/components/Tooltip/tooltip.css.js +0 -1
- package/dist/components/TopNavigation/TopNavigation.d.ts +1 -5
- package/dist/components/TopNavigation/TopNavigation.js +1 -3
- package/dist/components/TopNavigation/TopNavigation.js.map +1 -1
- package/dist/components/TopNavigation/top-navigation.css.js +0 -1
- package/dist/components/Truncated/Truncated.d.ts +7 -8
- package/dist/components/Truncated/Truncated.js +11 -6
- package/dist/components/Truncated/Truncated.js.map +1 -1
- package/dist/components/Txt/Txt.d.ts +4 -8
- package/dist/components/Txt/Txt.js +2 -4
- package/dist/components/Txt/Txt.js.map +1 -1
- package/dist/components/UIProvider/UIProvider.d.ts +1 -5
- package/dist/components/UIProvider/UIProvider.js +2 -4
- package/dist/components/UIProvider/UIProvider.js.map +1 -1
- package/dist/constants/brands.d.ts +7 -0
- package/dist/{index.js → constants/brands.js} +1 -9
- package/dist/{index.js.map → constants/brands.js.map} +1 -1
- package/dist/constants/phases.d.ts +3 -0
- package/dist/constants/phases.js +9 -0
- package/dist/constants/phases.js.map +1 -0
- package/dist/hooks/useCheckboxGroupState.d.ts +1 -1
- package/dist/hooks/useCheckboxState.d.ts +1 -1
- package/dist/hooks/useCombobox.d.ts +4 -3
- package/dist/hooks/useCombobox.js +7 -7
- package/dist/hooks/useCombobox.js.map +1 -1
- package/dist/hooks/useFloating.d.ts +1 -3
- package/dist/hooks/useFloating.js +4 -3
- package/dist/hooks/useFloating.js.map +1 -1
- package/dist/hooks/useId.js +5 -3
- package/dist/hooks/useId.js.map +1 -1
- package/dist/hooks/useKeyNavigation.d.ts +17 -0
- package/dist/hooks/useKeyNavigation.js +46 -0
- package/dist/hooks/useKeyNavigation.js.map +1 -0
- package/dist/hooks/useLongPress.d.ts +2 -1
- package/dist/hooks/useLongPress.js +2 -1
- package/dist/hooks/useLongPress.js.map +1 -1
- package/dist/hooks/useOutsideClick.d.ts +5 -1
- package/dist/hooks/useOutsideClick.js +1 -1
- package/dist/hooks/useOutsideClick.js.map +1 -1
- package/dist/hooks/usePaginationState.d.ts +4 -0
- package/dist/hooks/usePaginationState.js +22 -0
- package/dist/hooks/usePaginationState.js.map +1 -0
- package/dist/hooks/useRadioState.d.ts +2 -2
- package/dist/hooks/useTimeout.d.ts +8 -5
- package/dist/hooks/useTimeout.js +7 -23
- package/dist/hooks/useTimeout.js.map +1 -1
- package/dist/hooks/useUIContext.d.ts +1 -1
- package/dist/styles/anywhere.css +14 -14
- package/dist/styles/anywhere.css.js +14 -15
- package/dist/{base.css → styles/base.css} +27 -12
- package/dist/{base.css.js → styles/base.css.js} +27 -13
- package/dist/styles/better-homes-gardens.css +12 -12
- package/dist/styles/better-homes-gardens.css.js +12 -13
- package/dist/styles/cartus.css +13 -13
- package/dist/styles/cartus.css.js +13 -14
- package/dist/styles/century-21.css +14 -14
- package/dist/styles/century-21.css.js +14 -15
- package/dist/styles/coldwell-banker.css +12 -12
- package/dist/styles/coldwell-banker.css.js +12 -13
- package/dist/{colors.css.js → styles/colors.css.js} +0 -1
- package/dist/styles/corcoran.css +10 -10
- package/dist/styles/corcoran.css.js +10 -11
- package/dist/styles/denali-boss.css +13 -13
- package/dist/styles/denali-boss.css.js +13 -14
- package/dist/styles/era.css +13 -13
- package/dist/styles/era.css.js +13 -14
- package/dist/styles/sothebys.css +14 -14
- package/dist/styles/sothebys.css.js +14 -15
- package/dist/{index.d.ts → types/common.d.ts} +12 -22
- package/dist/types/common.js +10 -0
- package/dist/types/common.js.map +1 -0
- package/{meta-types.ts → dist/types/meta.d.ts} +7 -14
- package/dist/types/meta.js +47 -0
- package/dist/types/meta.js.map +1 -0
- package/dist/utils/bound.d.ts +18 -0
- package/dist/utils/bound.js +22 -0
- package/dist/utils/bound.js.map +1 -0
- package/dist/utils/createExampleChildElement.d.ts +17 -0
- package/dist/utils/createExampleChildElement.js +50 -0
- package/dist/utils/createExampleChildElement.js.map +1 -0
- package/dist/utils/demo.d.ts +29 -10
- package/dist/utils/demo.js.map +1 -1
- package/dist/utils/fileUploads.d.ts +51 -0
- package/dist/utils/fileUploads.js +2 -0
- package/dist/utils/fileUploads.js.map +1 -0
- package/dist/utils/handleKeyDown.d.ts +12 -0
- package/dist/utils/handleKeyDown.js +20 -0
- package/dist/utils/handleKeyDown.js.map +1 -0
- package/dist/utils/keyboard.js +2 -2
- package/dist/utils/keyboard.js.map +1 -1
- package/dist/utils/random.d.ts +15 -0
- package/dist/utils/random.js +26 -0
- package/dist/utils/random.js.map +1 -0
- package/dist/utils/scrollElementIntoView.d.ts +1 -1
- package/dist/utils/scrollElementIntoView.js +2 -0
- package/dist/utils/scrollElementIntoView.js.map +1 -1
- package/meta.ts +15 -28
- package/package.json +115 -91
- package/src/components/Accordion/Accordion.tsx +77 -0
- package/src/components/Accordion/AccordionExample.tsx +87 -0
- package/src/components/Accordion/AccordionSection.tsx +128 -0
- package/src/components/Accordion/accordion.scss +105 -0
- package/src/components/Accordion/index.tsx +1 -0
- package/src/components/Avatar/Avatar.tsx +37 -18
- package/src/components/Avatar/AvatarExample.tsx +12 -4
- package/src/components/Avatar/avatar.scss +34 -1
- package/src/components/AvatarGroup/AvatarGroup.tsx +20 -14
- package/src/components/AvatarGroup/AvatarGroupExample.tsx +33 -0
- package/src/components/AvatarGroup/avatar-group.scss +16 -1
- package/src/components/Badge/Badge.tsx +16 -16
- package/src/components/Badge/BadgeExample.tsx +11 -66
- package/src/components/Badge/badge.scss +18 -25
- package/src/components/BadgeDot/BadgeDot.tsx +83 -0
- package/src/components/BadgeDot/BadgeDotExample.tsx +25 -0
- package/src/components/BadgeDot/badge-dot.scss +26 -0
- package/src/components/BadgeDot/index.tsx +1 -0
- package/src/components/BannerAlert/BannerAlert.tsx +10 -9
- package/src/components/BannerAlert/BannerAlertExample.tsx +7 -8
- package/src/components/Breadcrumb/Breadcrumb.tsx +15 -17
- package/src/components/Breadcrumb/BreadcrumbExample.tsx +68 -2
- package/src/components/Button/Button.tsx +44 -29
- package/src/components/Button/ButtonExample.tsx +8 -3
- package/src/components/Button/button.scss +1 -1
- package/src/components/Card/Card.tsx +3 -6
- package/src/components/Checkbox/Checkbox.tsx +27 -25
- package/src/components/Checkbox/checkbox.scss +0 -7
- package/src/components/CheckboxGroup/CheckboxGroup.tsx +65 -59
- package/src/components/CheckboxGroup/CheckboxGroupExample.tsx +24 -3
- package/src/components/CheckboxOption/CheckboxOption.tsx +7 -20
- package/src/components/ChipAssist/ChipAssist.tsx +11 -7
- package/src/components/ChipAssist/ChipAssistExample.tsx +1 -2
- package/src/components/ChipFilter/ChipFilter.tsx +10 -6
- package/src/components/ChipFilter/ChipFilterExample.tsx +1 -2
- package/src/components/ChipGroup/ChipGroup.tsx +4 -8
- package/src/components/ChipGroup/ChipGroupExample.tsx +6 -7
- package/src/components/ChipInput/ChipInput.tsx +3 -6
- package/src/components/ChipInput/ChipInputExample.tsx +1 -2
- package/src/components/ChipSuggestion/ChipSuggestion.tsx +3 -7
- package/src/components/ChipSuggestion/ChipSuggestionExample.tsx +1 -2
- package/src/components/ChipUtility/ChipUtility.tsx +7 -12
- package/src/components/ChipUtility/ChipUtilityExample.tsx +2 -2
- package/src/components/ChipUtility/chip-utility.scss +1 -1
- package/src/components/Combobox/Combobox.tsx +33 -123
- package/src/components/Combobox/ListItems.tsx +107 -0
- package/src/components/Dialog/Dialog.tsx +54 -95
- package/src/components/Dialog/DialogExample.tsx +4 -13
- package/src/components/Dialog/dialog.scss +81 -63
- package/src/components/Divider/Divider.tsx +5 -7
- package/src/components/Divider/divider.scss +3 -7
- package/src/components/EmptyState/EmptyState.tsx +3 -7
- package/src/components/EmptyState/EmptyStateExample.tsx +16 -18
- package/src/components/ExamplePlaceholder/ExamplePlaceholder.tsx +33 -15
- package/src/components/Fab/Fab.tsx +50 -40
- package/src/components/Fab/fab.scss +1 -1
- package/src/components/FileUpload/FileUpload.tsx +285 -0
- package/src/components/FileUpload/FileUploadExample.tsx +91 -0
- package/src/components/FileUpload/file-upload.scss +20 -0
- package/src/components/FileUpload/index.tsx +1 -0
- package/src/components/FileUploadItem/FileUploadItem.tsx +121 -0
- package/src/components/FileUploadItem/FileUploadItemExample.tsx +78 -0
- package/src/components/FileUploadItem/file-upload-item.scss +46 -0
- package/src/components/FileUploadItem/index.tsx +1 -0
- package/src/components/FormField/FormField.tsx +30 -42
- package/src/components/FormField/FormFieldExample.tsx +41 -0
- package/src/components/Img/Img.tsx +2 -6
- package/src/components/InlineAlert/InlineAlert.tsx +6 -27
- package/src/components/InlineAlert/SvgWarningTwoTone.tsx +18 -0
- package/src/components/InlineAlert/inline-alert.scss +1 -0
- package/src/components/Layout/Layout.tsx +4 -8
- package/src/components/Layout/LayoutExample.tsx +14 -0
- package/src/components/Link/Link.tsx +3 -7
- package/src/components/Link/LinkExample.tsx +7 -8
- package/src/components/Link/link.scss +1 -1
- package/src/components/ListItem/ListItem.tsx +40 -121
- package/src/components/ListItem/ListItemButton.tsx +6 -0
- package/src/components/ListItem/ListItemExample.tsx +26 -77
- package/src/components/ListItem/list-item.scss +11 -30
- package/src/components/Listbox/Listbox.tsx +14 -14
- package/src/components/Menu/Menu.tsx +83 -85
- package/src/components/Menu/MenuExample.tsx +28 -6
- package/src/components/Menu/menu.scss +6 -2
- package/src/components/MenuButton/MenuButton.tsx +3 -6
- package/src/components/Modal/Modal.tsx +12 -15
- package/src/components/Modal/ModalExample.tsx +3 -4
- package/src/components/Modal/modal.scss +8 -21
- package/src/components/NumberField/NumberField.tsx +18 -27
- package/src/components/NumberInput/IncrementButton.tsx +31 -0
- package/src/components/NumberInput/NumberInput.tsx +54 -68
- package/src/components/NumberInput/NumberInputExample.tsx +6 -0
- package/src/components/NumberInput/number-input.scss +9 -5
- package/src/components/OTPInput/OTPInput.tsx +121 -0
- package/src/components/OTPInput/OTPInputExample.tsx +26 -0
- package/src/components/OTPInput/index.tsx +1 -0
- package/src/components/OTPInput/otp-input.scss +87 -0
- package/src/components/PageControl/PageControl.tsx +98 -0
- package/src/components/PageControl/index.tsx +1 -0
- package/src/components/PageControl/page-control.scss +38 -0
- package/src/components/Pagination/PageInput.tsx +65 -0
- package/src/components/Pagination/PageList.tsx +21 -0
- package/src/components/Pagination/Pagination.tsx +104 -0
- package/src/components/Pagination/index.tsx +1 -0
- package/src/components/Pagination/pagination.scss +36 -0
- package/src/components/PasswordField/PasswordField.tsx +68 -0
- package/src/components/PasswordField/index.tsx +1 -0
- package/src/components/PasswordInput/PasswordInput.tsx +115 -0
- package/src/components/PasswordInput/index.tsx +1 -0
- package/src/components/PasswordInput/password-input.scss +36 -0
- package/src/components/PhoneNumberField/PhoneNumberField.tsx +10 -49
- package/src/components/PhoneNumberInput/PhoneNumberInput.tsx +20 -19
- package/src/components/Popover/Popover.tsx +94 -53
- package/src/components/Popover/PopoverExample.tsx +20 -4
- package/src/components/Popover/popover.scss +17 -29
- package/src/components/Portal/Portal.tsx +4 -6
- package/src/components/ProgressBar/ProgressBar.tsx +33 -9
- package/src/components/ProgressBar/progress-bar.scss +6 -0
- package/src/components/ProgressCircle/ProgressCircle.tsx +5 -43
- package/src/components/ProgressCircle/ProgressCircleSVG.tsx +38 -0
- package/src/components/ProgressionStepper/ProgressionStepper.tsx +20 -19
- package/src/components/ProgressionStepper/ProgressionStepperExample.tsx +3 -3
- package/src/components/ProgressionStepper/progression-stepper.scss +13 -0
- package/src/components/ProgressionStepperBar/ProgressionStepperBar.tsx +5 -8
- package/src/components/ProgressionStepperBar/progression-stepper-bar.scss +1 -1
- package/src/components/Radio/Radio.tsx +4 -10
- package/src/components/Radio/radio.scss +1 -1
- package/src/components/RadioGroup/RadioGroup.tsx +80 -82
- package/src/components/RadioGroup/RadioGroupExample.tsx +3 -24
- package/src/components/RadioGroup/radio-group.scss +0 -1
- package/src/components/RadioOption/RadioOption.tsx +6 -21
- package/src/components/Rating/Rating.tsx +100 -0
- package/src/components/Rating/RatingExample.tsx +18 -0
- package/src/components/Rating/index.tsx +1 -0
- package/src/components/Rating/rating.scss +85 -0
- package/src/components/Scrim/Scrim.tsx +5 -24
- package/src/components/Scrim/scrim.scss +15 -4
- package/src/components/SearchBar/SearchBar.tsx +18 -13
- package/src/components/SearchBar/SearchBarExample.tsx +9 -3
- package/src/components/SearchBar/search-bar.scss +1 -1
- package/src/components/SegmentedControl/SegmentedControl.tsx +19 -123
- package/src/components/SegmentedControl/SegmentedControlExample.tsx +42 -21
- package/src/components/SegmentedControl/segmented-control.scss +37 -89
- package/src/components/Select/Select.tsx +26 -34
- package/src/components/Select/SelectExample.tsx +4 -13
- package/src/components/Select/select.scss +13 -10
- package/src/components/SelectField/SelectField.tsx +20 -28
- package/src/components/Skeleton/Circular.tsx +5 -0
- package/src/components/Skeleton/Photo.tsx +5 -0
- package/src/components/Skeleton/Profile.tsx +5 -0
- package/src/components/Skeleton/Rectangular.tsx +5 -0
- package/src/components/Skeleton/Skeleton.tsx +6 -29
- package/src/components/Skeleton/SkeletonExample.tsx +21 -36
- package/src/components/Skeleton/Thumbnail.tsx +5 -0
- package/src/components/Skeleton/index.tsx +5 -0
- package/src/components/SkeletonText/SkeletonText.tsx +2 -6
- package/src/components/SkeletonText/SkeletonTextExample.tsx +1 -2
- package/src/components/Slider/Slider.tsx +281 -0
- package/src/components/Slider/SliderExample.tsx +63 -0
- package/src/components/Slider/SliderIntervalDots.tsx +35 -0
- package/src/components/Slider/index.tsx +1 -0
- package/src/components/Slider/slider.scss +121 -0
- package/src/components/Slider/useNormalizeSliderValue.ts +16 -0
- package/src/components/StylesProviderAnywhere/StylesProviderAnywhere.tsx +4 -6
- package/src/components/StylesProviderBetterHomesGardens/StylesProviderBetterHomesGardens.tsx +4 -6
- package/src/components/StylesProviderCartus/StylesProviderCartus.tsx +4 -6
- package/src/components/StylesProviderCentury21/StylesProviderCentury21.tsx +4 -6
- package/src/components/StylesProviderColdwellBanker/StylesProviderColdwellBanker.tsx +4 -6
- package/src/components/StylesProviderCorcoran/StylesProviderCorcoran.tsx +4 -6
- package/src/components/StylesProviderDemo/StylesProviderDemo.tsx +49 -0
- package/src/components/StylesProviderDemo/brandsCss.ts +20 -0
- package/src/components/StylesProviderDemo/index.tsx +1 -0
- package/src/components/StylesProviderDenaliBoss/StylesProviderDenaliBoss.tsx +4 -6
- package/src/components/StylesProviderEra/StylesProviderEra.tsx +4 -6
- package/src/components/StylesProviderSothebys/StylesProviderSothebys.tsx +4 -6
- package/src/components/Switch/Switch.tsx +3 -7
- package/src/components/Switch/switch.scss +1 -1
- package/src/components/SwitchOption/SwitchOption.tsx +6 -9
- package/src/components/TabGroup/TabGroup.tsx +17 -130
- package/src/components/TabGroup/TabGroupExample.tsx +78 -71
- package/src/components/TabGroup/tab-group.scss +33 -79
- package/src/components/TabList/TabList.tsx +239 -0
- package/src/components/TabList/TabListExample.tsx +7 -0
- package/src/components/TabList/index.tsx +1 -0
- package/src/components/TabList/tab-list.scss +76 -0
- package/src/components/Table/Footer.tsx +40 -0
- package/src/components/Table/Table.tsx +181 -53
- package/src/components/Table/TableExample.tsx +138 -0
- package/src/components/Table/table.scss +228 -26
- package/src/components/Table/utils.ts +179 -0
- package/src/components/Tag/Tag.tsx +11 -54
- package/src/components/Tag/TagExample.tsx +16 -0
- package/src/components/Tag/tag.scss +7 -12
- package/src/components/TextField/TextField.tsx +6 -27
- package/src/components/TextInput/TextInput.tsx +72 -54
- package/src/components/TextInput/TextInputExample.tsx +2 -2
- package/src/components/TextInput/text-input.scss +2 -1
- package/src/components/Textarea/Textarea.tsx +10 -11
- package/src/components/Textarea/TextareaExample.tsx +4 -3
- package/src/components/TextareaField/TextareaField.tsx +22 -39
- package/src/components/TextareaField/TextareaFieldExample.tsx +3 -9
- package/src/components/TimeInput/Listbox.tsx +95 -0
- package/src/components/TimeInput/Segment.tsx +221 -0
- package/src/components/TimeInput/TimeInput.tsx +192 -0
- package/src/components/TimeInput/TimeInputExample.tsx +6 -0
- package/src/components/TimeInput/index.tsx +1 -0
- package/src/components/TimeInput/time-input.scss +176 -0
- package/src/components/ToggleOption/ToggleOption.tsx +11 -12
- package/src/components/ToggleOption/toggle-option.scss +15 -11
- package/src/components/Tooltip/Tooltip.tsx +30 -27
- package/src/components/Tooltip/TooltipExample.tsx +10 -6
- package/src/components/TopNavigation/TopNavigation.tsx +1 -5
- package/src/components/Truncated/Truncated.tsx +24 -13
- package/src/components/Txt/Txt.tsx +3 -7
- package/src/components/UIProvider/UIProvider.tsx +2 -5
- package/src/constants/brands.ts +45 -0
- package/src/constants/phases.ts +11 -0
- package/src/global.d.ts +3 -0
- package/src/hooks/useCombobox.ts +9 -12
- package/src/hooks/useFloating.ts +5 -7
- package/src/hooks/useId.ts +5 -3
- package/src/hooks/useKeyNavigation.ts +66 -0
- package/src/hooks/useLongPress.ts +3 -2
- package/src/hooks/useOutsideClick.ts +9 -5
- package/src/hooks/usePaginationState.tsx +24 -0
- package/src/hooks/useTimeout.ts +14 -4
- package/src/{base.scss → styles/base.scss} +24 -8
- package/src/{index.ts → types/common.ts} +15 -62
- package/src/types/meta.ts +109 -0
- package/src/utils/bound.ts +30 -0
- package/src/utils/createExampleChildElement.tsx +83 -0
- package/src/utils/demo.ts +25 -17
- package/src/utils/fileUploads.ts +73 -0
- package/src/utils/handleKeyDown.ts +24 -0
- package/src/utils/keyboard.ts +2 -2
- package/src/utils/random.ts +25 -0
- package/src/utils/scrollElementIntoView.ts +3 -1
- package/tsconfig.json +12 -5
- package/dist/components/Chip/Chip.d.ts +0 -64
- package/dist/components/Chip/Chip.js +0 -33
- package/dist/components/Chip/Chip.js.map +0 -1
- package/dist/components/Chip/chip.css +0 -44
- package/dist/components/Chip/chip.css.js +0 -50
- package/dist/components/Chip/index.d.ts +0 -1
- package/dist/components/Chip/index.js +0 -2
- package/dist/components/Chip/index.js.map +0 -1
- package/dist/hooks/useOptionIconsInvalid.d.ts +0 -36
- package/dist/hooks/useOptionIconsInvalid.js +0 -21
- package/dist/hooks/useOptionIconsInvalid.js.map +0 -1
- package/dist/hooks/useValidChildren.d.ts +0 -6
- package/dist/hooks/useValidChildren.js +0 -30
- package/dist/hooks/useValidChildren.js.map +0 -1
- package/dist/utils/children.d.ts +0 -29
- package/dist/utils/children.js +0 -67
- package/dist/utils/children.js.map +0 -1
- package/dist/utils/srOnly.d.ts +0 -14
- package/dist/utils/srOnly.js +0 -13
- package/dist/utils/srOnly.js.map +0 -1
- package/src/components/Chip/Chip.tsx +0 -104
- package/src/components/Chip/chip.scss +0 -66
- package/src/components/Chip/index.tsx +0 -1
- package/src/hooks/useOptionIconsInvalid.ts +0 -58
- package/src/hooks/useValidChildren.ts +0 -54
- package/src/utils/children.ts +0 -80
- package/src/utils/srOnly.ts +0 -14
- /package/dist/{colors.css → styles/colors.css} +0 -0
- /package/src/{colors.scss → styles/colors.scss} +0 -0
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { useRef, useState } from 'react';
|
|
3
3
|
import { Portal } from '../Portal';
|
|
4
4
|
import { useFloating } from '../../hooks/useFloating';
|
|
5
|
+
import { useId } from '../../hooks/useId';
|
|
5
6
|
import './tooltip.css.js';
|
|
6
7
|
const DEFAULT = {
|
|
7
8
|
placement: 'top',
|
|
@@ -18,24 +19,17 @@ const DEFAULT = {
|
|
|
18
19
|
* export function Example() {
|
|
19
20
|
* return (
|
|
20
21
|
* <Tooltip label="I explain what this button does" placement="top">
|
|
21
|
-
* <Button>Click me</Button>
|
|
22
|
+
* {(triggerProps) => <Button {...triggerProps}>Click me</Button>}
|
|
22
23
|
* </Tooltip>
|
|
23
24
|
* );
|
|
24
25
|
* }
|
|
25
26
|
*
|
|
26
27
|
* @name Tooltip
|
|
27
|
-
* @phase
|
|
28
|
+
* @phase UXReview
|
|
28
29
|
*/
|
|
29
|
-
function Tooltip({ placement = DEFAULT.placement, label, children, disabled = DEFAULT.disabled, showTail = DEFAULT.showTail, }) {
|
|
30
|
+
export function Tooltip({ placement = DEFAULT.placement, label, children, disabled = DEFAULT.disabled, showTail = DEFAULT.showTail, }) {
|
|
30
31
|
const id = useId();
|
|
31
32
|
const [show, setShow] = useState(false);
|
|
32
|
-
const child = useMemo(() => !disabled &&
|
|
33
|
-
children &&
|
|
34
|
-
cloneElement(children, {
|
|
35
|
-
onMouseOver: () => setShow(true),
|
|
36
|
-
onMouseLeave: () => setShow(false),
|
|
37
|
-
'aria-describedby': id,
|
|
38
|
-
}), [children, disabled, id]);
|
|
39
33
|
const arrowRef = useRef(null);
|
|
40
34
|
const { floatingStyles, middlewareData, elements } = useFloating({
|
|
41
35
|
placement,
|
|
@@ -44,18 +38,26 @@ function Tooltip({ placement = DEFAULT.placement, label, children, disabled = DE
|
|
|
44
38
|
arrowRef,
|
|
45
39
|
hide: !show,
|
|
46
40
|
});
|
|
47
|
-
|
|
41
|
+
const child = children(disabled
|
|
42
|
+
? {}
|
|
43
|
+
: {
|
|
44
|
+
onMouseOver: () => setShow(true),
|
|
45
|
+
onMouseLeave: () => setShow(false),
|
|
46
|
+
onFocus: () => setShow(true),
|
|
47
|
+
'aria-describedby': id,
|
|
48
|
+
});
|
|
49
|
+
if (disabled)
|
|
50
|
+
return child;
|
|
51
|
+
return (_jsxs(_Fragment, { children: [child, label && (_jsx(Portal, { children: _jsxs("div", { "data-bspk": "tooltip", "data-placement": middlewareData?.offset?.placement, id: id, ref: (node) => {
|
|
48
52
|
elements.setFloating(node);
|
|
49
53
|
elements.setReference(document.querySelector(`[aria-describedby="${id}"]`));
|
|
50
54
|
}, role: "tooltip", style: floatingStyles, children: [_jsx("span", { "data-text": true, children: label }), _jsx("span", { "aria-hidden": true, "data-arrow": true, ref: (node) => {
|
|
51
55
|
arrowRef.current = node;
|
|
52
56
|
}, style: {
|
|
53
|
-
zIndex:
|
|
57
|
+
zIndex: 'var(--z-index-tooltip-popover)',
|
|
54
58
|
opacity: showTail ? 1 : 0,
|
|
55
59
|
left: middlewareData.arrow?.x != null ? `${middlewareData.arrow?.x}px` : '',
|
|
56
60
|
top: middlewareData.arrow?.y != null ? `${middlewareData.arrow?.y}px` : '',
|
|
57
61
|
} })] }) }))] }));
|
|
58
62
|
}
|
|
59
|
-
Tooltip.bspkName = 'Tooltip';
|
|
60
|
-
export { Tooltip };
|
|
61
63
|
//# sourceMappingURL=Tooltip.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tooltip.js","sourceRoot":"","sources":["../../../src/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,CAAC"}
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { TooltipProps } from './Tooltip';
|
|
2
|
+
import { ComponentExample } from '-/utils/demo';
|
|
3
|
+
export declare const TooltipExample: ComponentExample<TooltipProps>;
|
|
@@ -2,7 +2,7 @@ import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
|
|
|
2
2
|
import { Button } from '../Button';
|
|
3
3
|
export const TooltipExample = {
|
|
4
4
|
render: ({ props: state, Component }) => {
|
|
5
|
-
return (_jsx(_Fragment, { children: _jsx(Component, {
|
|
5
|
+
return (_jsx(_Fragment, { children: _jsx(Component, { ...state, placement: [state.placement].flat()[0] || 'top', children: (triggerProps) => (_jsx(Button, { label: `Hover over me ${'data-variant-value' in state ? `(${state['data-variant-value']})` : ''}`, variant: "secondary", ...triggerProps })) }) }));
|
|
6
6
|
},
|
|
7
7
|
};
|
|
8
8
|
//# sourceMappingURL=TooltipExample.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TooltipExample.js","sourceRoot":"","sources":["../../../src/components/Tooltip/TooltipExample.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"TooltipExample.js","sourceRoot":"","sources":["../../../src/components/Tooltip/TooltipExample.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAG7C,MAAM,CAAC,MAAM,cAAc,GAAmC;IAC1D,MAAM,EAAE,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,EAAE,EAAE;QACpC,OAAO,CACH,4BACI,KAAC,SAAS,OAAK,KAAK,EAAE,SAAS,EAAE,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,YAChE,CAAC,YAAY,EAAE,EAAE,CAAC,CACf,KAAC,MAAM,IACH,KAAK,EAAE,iBAAiB,oBAAoB,IAAI,KAAK,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,oBAAoB,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,EACjG,OAAO,EAAC,WAAW,KACf,YAAY,GAClB,CACL,GACO,GACb,CACN,CAAC;IACN,CAAC;CACJ,CAAC"}
|
|
@@ -9,9 +9,5 @@ export type TopNavigationProps = {
|
|
|
9
9
|
* @name TopNavigation
|
|
10
10
|
* @phase Backlog
|
|
11
11
|
*/
|
|
12
|
-
declare function TopNavigation({ children }: TopNavigationProps): import("react/jsx-runtime").JSX.Element;
|
|
13
|
-
declare namespace TopNavigation {
|
|
14
|
-
var bspkName: string;
|
|
15
|
-
}
|
|
16
|
-
export { TopNavigation };
|
|
12
|
+
export declare function TopNavigation({ children }: TopNavigationProps): import("react/jsx-runtime").JSX.Element;
|
|
17
13
|
/** Copyright 2025 Anywhere Real Estate - CC BY 4.0 */
|
|
@@ -6,9 +6,7 @@ import './top-navigation.css.js';
|
|
|
6
6
|
* @name TopNavigation
|
|
7
7
|
* @phase Backlog
|
|
8
8
|
*/
|
|
9
|
-
function TopNavigation({ children }) {
|
|
9
|
+
export function TopNavigation({ children }) {
|
|
10
10
|
return _jsx("div", { "data-bspk": "top-navigation", children: children });
|
|
11
11
|
}
|
|
12
|
-
TopNavigation.bspkName = 'TopNavigation';
|
|
13
|
-
export { TopNavigation };
|
|
14
12
|
//# sourceMappingURL=TopNavigation.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TopNavigation.js","sourceRoot":"","sources":["../../../src/components/TopNavigation/TopNavigation.tsx"],"names":[],"mappings":";AAAA,OAAO,uBAAuB,CAAC;AAO/B;;;;;GAKG;AACH,
|
|
1
|
+
{"version":3,"file":"TopNavigation.js","sourceRoot":"","sources":["../../../src/components/TopNavigation/TopNavigation.tsx"],"names":[],"mappings":";AAAA,OAAO,uBAAuB,CAAC;AAO/B;;;;;GAKG;AACH,MAAM,UAAU,aAAa,CAAC,EAAE,QAAQ,EAAsB;IAC1D,OAAO,2BAAe,gBAAgB,YAAE,QAAQ,GAAO,CAAC;AAC5D,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ElementType } from 'react';
|
|
2
|
-
import { ElementConstructorProps } from '
|
|
3
|
-
export type TruncatedProps<As extends ElementType = 'span'> =
|
|
2
|
+
import { ElementConstructorProps } from '-/types/common';
|
|
3
|
+
export type TruncatedProps<As extends ElementType = 'span'> = {
|
|
4
4
|
/**
|
|
5
5
|
* The element type to render as.
|
|
6
6
|
*
|
|
@@ -10,6 +10,9 @@ export type TruncatedProps<As extends ElementType = 'span'> = ElementConstructor
|
|
|
10
10
|
/**
|
|
11
11
|
* The content to render.
|
|
12
12
|
*
|
|
13
|
+
* @example
|
|
14
|
+
* Some really long text that might be truncated when displayed in a small container.
|
|
15
|
+
*
|
|
13
16
|
* @type string
|
|
14
17
|
* @required
|
|
15
18
|
*/
|
|
@@ -25,10 +28,6 @@ export type TruncatedProps<As extends ElementType = 'span'> = ElementConstructor
|
|
|
25
28
|
* A utility component that displays a tooltip with the full text when hovered when text is truncated.
|
|
26
29
|
*
|
|
27
30
|
* @name Truncated
|
|
28
|
-
* @phase
|
|
31
|
+
* @phase Utility
|
|
29
32
|
*/
|
|
30
|
-
declare function Truncated({ children, label, ...props }: TruncatedProps): import("react/jsx-runtime").JSX.Element;
|
|
31
|
-
declare namespace Truncated {
|
|
32
|
-
var bspkName: string;
|
|
33
|
-
}
|
|
34
|
-
export { Truncated };
|
|
33
|
+
export declare function Truncated<As extends ElementType = 'span'>({ children, label, ...props }: ElementConstructorProps<As, 'children'> & TruncatedProps<As>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -5,13 +5,18 @@ import { useTruncatedText } from '../../hooks/useTruncatedText';
|
|
|
5
5
|
* A utility component that displays a tooltip with the full text when hovered when text is truncated.
|
|
6
6
|
*
|
|
7
7
|
* @name Truncated
|
|
8
|
-
* @phase
|
|
8
|
+
* @phase Utility
|
|
9
9
|
*/
|
|
10
|
-
function Truncated({ children, label, ...props }) {
|
|
10
|
+
export function Truncated({ children, label, ...props }) {
|
|
11
11
|
const { setElement, isTruncated } = useTruncatedText();
|
|
12
|
-
const span = (_jsx("span", { ...props, "data-bspk": "truncated", ref: (node) => setElement(node), style: {
|
|
13
|
-
|
|
12
|
+
const span = (triggerProps) => (_jsx("span", { ...props, "data-bspk-utility": "truncated", ref: (node) => setElement(node), style: {
|
|
13
|
+
maxWidth: '100%',
|
|
14
|
+
...props.style,
|
|
15
|
+
display: 'inline-block',
|
|
16
|
+
overflow: 'hidden',
|
|
17
|
+
textOverflow: 'ellipsis',
|
|
18
|
+
whiteSpace: 'nowrap',
|
|
19
|
+
}, ...triggerProps, children: children }));
|
|
20
|
+
return isTruncated ? _jsx(Tooltip, { label: label || children, children: span }) : span({});
|
|
14
21
|
}
|
|
15
|
-
Truncated.bspkName = 'Truncated';
|
|
16
|
-
export { Truncated };
|
|
17
22
|
//# sourceMappingURL=Truncated.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Truncated.js","sourceRoot":"","sources":["../../../src/components/Truncated/Truncated.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"Truncated.js","sourceRoot":"","sources":["../../../src/components/Truncated/Truncated.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,OAAO,EAAuB,MAAM,sBAAsB,CAAC;AACpE,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AA4B5D;;;;;GAKG;AACH,MAAM,UAAU,SAAS,CAAkC,EACvD,QAAQ,EACR,KAAK,EACL,GAAG,KAAK,EACmD;IAC3D,MAAM,EAAE,UAAU,EAAE,WAAW,EAAE,GAAG,gBAAgB,EAAE,CAAC;IAEvD,MAAM,IAAI,GAAG,CAAC,YAAiC,EAAE,EAAE,CAAC,CAChD,kBACQ,KAAK,uBACS,WAAW,EAC7B,GAAG,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,EAC/B,KAAK,EAAE;YACH,QAAQ,EAAE,MAAM;YAChB,GAAG,KAAK,CAAC,KAAK;YACd,OAAO,EAAE,cAAc;YACvB,QAAQ,EAAE,QAAQ;YAClB,YAAY,EAAE,UAAU;YACxB,UAAU,EAAE,QAAQ;SACvB,KACG,YAAY,YAEf,QAAQ,GACN,CACV,CAAC;IAEF,OAAO,WAAW,CAAC,CAAC,CAAC,KAAC,OAAO,IAAC,KAAK,EAAE,KAAK,IAAI,QAAQ,YAAG,IAAI,GAAW,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AACxF,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ElementType } from 'react';
|
|
2
|
-
import { ElementProps } from '
|
|
3
|
-
import { TxtVariant } from '
|
|
2
|
+
import { ElementProps } from '-/types/common';
|
|
3
|
+
import { TxtVariant } from '-/utils/txtVariants';
|
|
4
4
|
export type TxtProps<As extends ElementType = 'span'> = {
|
|
5
5
|
/**
|
|
6
6
|
* The element type to render as.
|
|
@@ -50,11 +50,7 @@ export type TxtProps<As extends ElementType = 'span'> = {
|
|
|
50
50
|
* }
|
|
51
51
|
*
|
|
52
52
|
* @name Txt
|
|
53
|
-
* @phase
|
|
53
|
+
* @phase UXReview
|
|
54
54
|
*/
|
|
55
|
-
declare function Txt<As extends ElementType = 'span'>({ children, as, variant, style: styleProp, skeletonLines, inherit, ...containerProps }: ElementProps<TxtProps<As>, As>): import("react/jsx-runtime").JSX.Element | null;
|
|
56
|
-
declare namespace Txt {
|
|
57
|
-
var bspkName: string;
|
|
58
|
-
}
|
|
59
|
-
export { Txt };
|
|
55
|
+
export declare function Txt<As extends ElementType = 'span'>({ children, as, variant, style: styleProp, skeletonLines, inherit, ...containerProps }: ElementProps<TxtProps<As>, As>): import("react/jsx-runtime").JSX.Element | null;
|
|
60
56
|
/** Copyright 2025 Anywhere Real Estate - CC BY 4.0 */
|
|
@@ -11,9 +11,9 @@ import { SkeletonText } from '../SkeletonText';
|
|
|
11
11
|
* }
|
|
12
12
|
*
|
|
13
13
|
* @name Txt
|
|
14
|
-
* @phase
|
|
14
|
+
* @phase UXReview
|
|
15
15
|
*/
|
|
16
|
-
function Txt({ children, as, variant = 'body-base', style: styleProp, skeletonLines = 0, inherit, ...containerProps }) {
|
|
16
|
+
export function Txt({ children, as, variant = 'body-base', style: styleProp, skeletonLines = 0, inherit, ...containerProps }) {
|
|
17
17
|
const content = children?.toString();
|
|
18
18
|
if (!content)
|
|
19
19
|
return skeletonLines ? _jsx(SkeletonText, { lines: skeletonLines, variant: variant }) : null;
|
|
@@ -23,6 +23,4 @@ function Txt({ children, as, variant = 'body-base', style: styleProp, skeletonLi
|
|
|
23
23
|
font: inherit ? undefined : `var(--${variant})`,
|
|
24
24
|
}, children: content }));
|
|
25
25
|
}
|
|
26
|
-
Txt.bspkName = 'Txt';
|
|
27
|
-
export { Txt };
|
|
28
26
|
//# sourceMappingURL=Txt.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Txt.js","sourceRoot":"","sources":["../../../src/components/Txt/Txt.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"Txt.js","sourceRoot":"","sources":["../../../src/components/Txt/Txt.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AA2CzD;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,GAAG,CAAkC,EACjD,QAAQ,EACR,EAAE,EACF,OAAO,GAAG,WAAW,EACrB,KAAK,EAAE,SAAS,EAChB,aAAa,GAAG,CAAC,EACjB,OAAO,EACP,GAAG,cAAc,EACY;IAC7B,MAAM,OAAO,GAAG,QAAQ,EAAE,QAAQ,EAAE,CAAC;IAErC,IAAI,CAAC,OAAO;QAAE,OAAO,aAAa,CAAC,CAAC,CAAC,KAAC,YAAY,IAAC,KAAK,EAAE,aAAa,EAAE,OAAO,EAAE,OAAO,GAAI,CAAC,CAAC,CAAC,IAAI,CAAC;IAErG,MAAM,EAAE,GAAgB,EAAE,IAAI,MAAM,CAAC;IAErC,OAAO,CACH,KAAC,EAAE,OACK,cAAc,eACR,KAAK,EACf,KAAK,EAAE;YACH,GAAG,SAAS;YACZ,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,OAAO,GAAG;SAClD,YAEA,OAAO,GACP,CACR,CAAC;AACN,CAAC"}
|
|
@@ -7,8 +7,4 @@ export type UIProviderProps = {
|
|
|
7
7
|
*
|
|
8
8
|
* @name UIProvider
|
|
9
9
|
*/
|
|
10
|
-
declare function UIProvider({ children }: UIProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
11
|
-
declare namespace UIProvider {
|
|
12
|
-
var bspkName: string;
|
|
13
|
-
}
|
|
14
|
-
export { UIProvider };
|
|
10
|
+
export declare function UIProvider({ children }: UIProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -9,7 +9,7 @@ import { UIContext } from '../../utils/uiContext';
|
|
|
9
9
|
*
|
|
10
10
|
* @name UIProvider
|
|
11
11
|
*/
|
|
12
|
-
function UIProvider({ children }) {
|
|
12
|
+
export function UIProvider({ children }) {
|
|
13
13
|
const [theme, setTheme] = useState('light');
|
|
14
14
|
const [deviceWidth, setDeviceWidth] = useDebounceState(() => {
|
|
15
15
|
return typeof window !== 'undefined' ? window.innerWidth : 0;
|
|
@@ -19,7 +19,7 @@ function UIProvider({ children }) {
|
|
|
19
19
|
document.documentElement.style.setProperty('--scrollbar-width', `${window.innerWidth - document.documentElement.clientWidth}px`);
|
|
20
20
|
}, [theme]);
|
|
21
21
|
useEventListener('resize', () => setDeviceWidth(window.innerWidth));
|
|
22
|
-
return (_jsx(UIContext.Provider, { value: {
|
|
22
|
+
return (_jsx(UIContext.Provider, { "data-bspk-utility": "ui-provider", value: {
|
|
23
23
|
theme,
|
|
24
24
|
setTheme,
|
|
25
25
|
isMobile: deviceWidth < 640,
|
|
@@ -27,6 +27,4 @@ function UIProvider({ children }) {
|
|
|
27
27
|
isDesktop: deviceWidth >= 1024,
|
|
28
28
|
}, children: children }));
|
|
29
29
|
}
|
|
30
|
-
UIProvider.bspkName = 'UIProvider';
|
|
31
|
-
export { UIProvider };
|
|
32
30
|
//# 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;AAE5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAClE,OAAO,EAAE,SAAS,EAAc,MAAM,mBAAmB,CAAC;AAM1D;;;;GAIG;AACH,
|
|
1
|
+
{"version":3,"file":"UIProvider.js","sourceRoot":"","sources":["../../../src/components/UIProvider/UIProvider.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAa,MAAM,OAAO,CAAC;AAE5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAClE,OAAO,EAAE,SAAS,EAAc,MAAM,mBAAmB,CAAC;AAM1D;;;;GAIG;AACH,MAAM,UAAU,UAAU,CAAC,EAAE,QAAQ,EAAmB;IACpD,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAa,OAAO,CAAC,CAAC;IAExD,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,gBAAgB,CAAC,GAAG,EAAE;QACxD,OAAO,OAAO,MAAM,KAAK,WAAW,CAAC,CAAC,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC;IACjE,CAAC,EAAE,GAAG,CAAC,CAAC;IAER,mBAAmB,CAAC,GAAG,EAAE;QACrB,QAAQ,CAAC,eAAe,CAAC,OAAO,CAAC,KAAK,GAAG,KAAK,CAAC;QAC/C,QAAQ,CAAC,eAAe,CAAC,KAAK,CAAC,WAAW,CACtC,mBAAmB,EACnB,GAAG,MAAM,CAAC,UAAU,GAAG,QAAQ,CAAC,eAAe,CAAC,WAAW,IAAI,CAClE,CAAC;IACN,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC;IAEZ,gBAAgB,CAAC,QAAQ,EAAE,GAAG,EAAE,CAAC,cAAc,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC;IAEpE,OAAO,CACH,KAAC,SAAS,CAAC,QAAQ,yBACG,aAAa,EAC/B,KAAK,EAAE;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;SACjC,YAEA,QAAQ,GACQ,CACxB,CAAC;AACN,CAAC"}
|
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* There are no barrel files for this repository.
|
|
3
|
-
*
|
|
4
|
-
* Components should be imported directly like "import { Txt } from
|
|
5
|
-
*
|
|
6
|
-
* @bspk/ui/Txt".
|
|
7
|
-
*/
|
|
8
1
|
export const BRANDS = [
|
|
9
2
|
{
|
|
10
3
|
title: 'Anywhere',
|
|
@@ -43,5 +36,4 @@ export const BRANDS = [
|
|
|
43
36
|
slug: 'sothebys',
|
|
44
37
|
},
|
|
45
38
|
];
|
|
46
|
-
|
|
47
|
-
//# sourceMappingURL=index.js.map
|
|
39
|
+
//# sourceMappingURL=brands.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"
|
|
1
|
+
{"version":3,"file":"brands.js","sourceRoot":"","sources":["../../src/constants/brands.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,MAAM,GAKb;IACF;QACI,KAAK,EAAE,UAAU;QACjB,IAAI,EAAE,UAAU;KACnB;IACD;QACI,KAAK,EAAE,wBAAwB;QAC/B,IAAI,EAAE,sBAAsB;KAC/B;IACD;QACI,KAAK,EAAE,QAAQ;QACf,IAAI,EAAE,QAAQ;KACjB;IACD;QACI,KAAK,EAAE,YAAY;QACnB,IAAI,EAAE,YAAY;KACrB;IACD;QACI,KAAK,EAAE,iBAAiB;QACxB,IAAI,EAAE,iBAAiB;KAC1B;IACD;QACI,KAAK,EAAE,UAAU;QACjB,IAAI,EAAE,UAAU;KACnB;IACD;QACI,KAAK,EAAE,aAAa;QACpB,IAAI,EAAE,aAAa;KACtB;IACD;QACI,KAAK,EAAE,KAAK;QACZ,IAAI,EAAE,KAAK;KACd;IACD;QACI,KAAK,EAAE,WAAW;QAClB,IAAI,EAAE,UAAU;KACnB;CACK,CAAC"}
|
|
@@ -0,0 +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,EAAE,EAAE,QAAQ;IACZ,QAAQ,EAAE,QAAQ;IAClB,MAAM,EAAE,OAAO;IACf,OAAO,EAAE,SAAS;CACrB,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AriaAttributes } from 'react';
|
|
2
|
-
import { CommonProps, InvalidPropsLibrary } from '..';
|
|
3
2
|
import { UseFloatingElements, UseFloatingProps } from './useFloating';
|
|
4
|
-
|
|
3
|
+
import { CommonProps } from '-/types/common';
|
|
4
|
+
export type UseComboboxProps = CommonProps<'disabled' | 'readOnly'> & Pick<UseFloatingProps, 'offsetOptions' | 'placement' | 'refWidth'> & {
|
|
5
5
|
/**
|
|
6
6
|
* The element to use for outside click detection.
|
|
7
7
|
*
|
|
@@ -37,7 +37,7 @@ export type ToggleProps = {
|
|
|
37
37
|
* @param {UseComboboxProps} props - The properties to configure the combobox.
|
|
38
38
|
* @returns An object containing props for the menu and toggle elements, and a function to close the menu.
|
|
39
39
|
*/
|
|
40
|
-
export declare function useCombobox({ placement, refWidth, disabled,
|
|
40
|
+
export declare function useCombobox({ placement, refWidth, disabled, readOnly, offsetOptions, }: UseComboboxProps): {
|
|
41
41
|
activeIndex: number;
|
|
42
42
|
menuProps: {
|
|
43
43
|
'data-placement': string | undefined;
|
|
@@ -51,5 +51,6 @@ export declare function useCombobox({ placement, refWidth, disabled, errorMessag
|
|
|
51
51
|
closeMenu: () => void;
|
|
52
52
|
isOpen: boolean;
|
|
53
53
|
elements: UseFloatingElements;
|
|
54
|
+
openMenu: () => void;
|
|
54
55
|
};
|
|
55
56
|
/** Copyright 2025 Anywhere Real Estate - CC BY 4.0 */
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { useState } from 'react';
|
|
2
|
+
import { useFloating } from './useFloating';
|
|
3
|
+
import { useId } from './useId';
|
|
2
4
|
import { EVENT_KEY } from '../utils/keyboard';
|
|
3
5
|
import { scrollElementIntoView } from '../utils/scrollElementIntoView';
|
|
4
|
-
import { useFloating } from './useFloating';
|
|
5
6
|
function useKeyDownNavigation(containerElement, setShow, disabled) {
|
|
6
7
|
const [activeIndex, setActiveIndex] = useState(-1);
|
|
7
8
|
const itemElements = Array.from(containerElement?.children || []);
|
|
@@ -13,7 +14,7 @@ function useKeyDownNavigation(containerElement, setShow, disabled) {
|
|
|
13
14
|
setShow(false);
|
|
14
15
|
return true;
|
|
15
16
|
}
|
|
16
|
-
if (event.key !== EVENT_KEY.Enter && !event.key.startsWith('Arrow'))
|
|
17
|
+
if (event.key !== EVENT_KEY.Enter && event.key !== EVENT_KEY[' '] && !event.key.startsWith('Arrow'))
|
|
17
18
|
return false;
|
|
18
19
|
if (event.key.startsWith('Arrow') && !containerElement) {
|
|
19
20
|
event.preventDefault();
|
|
@@ -24,7 +25,7 @@ function useKeyDownNavigation(containerElement, setShow, disabled) {
|
|
|
24
25
|
if (!containerElement?.children.length)
|
|
25
26
|
return false;
|
|
26
27
|
event.preventDefault();
|
|
27
|
-
if (event.key === EVENT_KEY.Enter && activeIndex !== -1) {
|
|
28
|
+
if ((event.key === EVENT_KEY[' '] || event.key === EVENT_KEY.Enter) && activeIndex !== -1) {
|
|
28
29
|
itemElements[activeIndex].click();
|
|
29
30
|
return true;
|
|
30
31
|
}
|
|
@@ -57,7 +58,7 @@ function useKeyDownNavigation(containerElement, setShow, disabled) {
|
|
|
57
58
|
* @param {UseComboboxProps} props - The properties to configure the combobox.
|
|
58
59
|
* @returns An object containing props for the menu and toggle elements, and a function to close the menu.
|
|
59
60
|
*/
|
|
60
|
-
export function useCombobox({ placement = 'bottom', refWidth = true, disabled,
|
|
61
|
+
export function useCombobox({ placement = 'bottom', refWidth = true, disabled, readOnly, offsetOptions, }) {
|
|
61
62
|
const menuId = useId();
|
|
62
63
|
const [show, setShow] = useState(false);
|
|
63
64
|
const { floatingStyles, middlewareData, elements } = useFloating({
|
|
@@ -79,13 +80,11 @@ export function useCombobox({ placement = 'bottom', refWidth = true, disabled, e
|
|
|
79
80
|
onOutsideClick: () => setShow(false),
|
|
80
81
|
},
|
|
81
82
|
toggleProps: {
|
|
82
|
-
'aria-errormessage': errorMessage || undefined,
|
|
83
83
|
'aria-activedescendant': selectedId || undefined,
|
|
84
84
|
'aria-controls': menuId,
|
|
85
85
|
'aria-disabled': disabled || undefined,
|
|
86
86
|
'aria-expanded': show,
|
|
87
87
|
'aria-haspopup': 'listbox',
|
|
88
|
-
'aria-invalid': invalid || undefined,
|
|
89
88
|
'aria-owns': menuId,
|
|
90
89
|
'aria-readonly': readOnly || undefined,
|
|
91
90
|
role: 'combobox',
|
|
@@ -96,6 +95,7 @@ export function useCombobox({ placement = 'bottom', refWidth = true, disabled, e
|
|
|
96
95
|
onKeyDownCapture,
|
|
97
96
|
},
|
|
98
97
|
closeMenu: () => setShow(false),
|
|
98
|
+
openMenu: () => setShow(true),
|
|
99
99
|
isOpen: show,
|
|
100
100
|
elements,
|
|
101
101
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useCombobox.js","sourceRoot":"","sources":["../../src/hooks/useCombobox.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,
|
|
1
|
+
{"version":3,"file":"useCombobox.js","sourceRoot":"","sources":["../../src/hooks/useCombobox.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEjD,OAAO,EAAE,WAAW,EAAyC,MAAM,eAAe,CAAC;AACnF,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAEhC,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AAiCtE,SAAS,oBAAoB,CAAC,gBAA6B,EAAE,OAAgC,EAAE,QAAkB;IAC7G,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;IAEnD,MAAM,YAAY,GAAG,KAAK,CAAC,IAAI,CAAC,gBAAgB,EAAE,QAAQ,IAAI,EAAE,CAAkB,CAAC;IACnF,MAAM,UAAU,GAAG,YAAY,CAAC,WAAW,CAAC,EAAE,EAAE,CAAC;IAEjD,MAAM,gBAAgB,GAAG,CAAC,KAA0B,EAAW,EAAE;QAC7D,IAAI,QAAQ;YAAE,OAAO,KAAK,CAAC;QAE3B,IAAI,KAAK,CAAC,GAAG,KAAK,SAAS,CAAC,GAAG,IAAI,KAAK,CAAC,GAAG,KAAK,SAAS,CAAC,MAAM,EAAE,CAAC;YAChE,OAAO,CAAC,KAAK,CAAC,CAAC;YACf,OAAO,IAAI,CAAC;QAChB,CAAC;Q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AAK,EAAE,cAAc;YACrB,QAAQ,EAAE,CAAC,CAAC;YACZ,cAAc,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC;SACvC;QACD,WAAW,EAAE;YACT,uBAAuB,EAAE,UAAU,IAAI,SAAS;YAChD,eAAe,EAAE,MAAM;YACvB,eAAe,EAAE,QAAQ,IAAI,SAAS;YACtC,eAAe,EAAE,IAAI;YACrB,eAAe,EAAE,SAA4C;YAC7D,WAAW,EAAE,MAAM;YACnB,eAAe,EAAE,QAAQ,IAAI,SAAS;YACtC,IAAI,EAAE,UAAU;YAChB,QAAQ,EAAE,CAAC;YACX,OAAO,EAAE,GAAG,EAAE;gBACV,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC;YAC7B,CAAC;YACD,gBAAgB;SACnB;QACD,SAAS,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC;QAC/B,QAAQ,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC;QAC7B,MAAM,EAAE,IAAI;QACZ,QAAQ;KACX,CAAC;AACN,CAAC;AAED,sDAAsD"}
|
|
@@ -45,11 +45,9 @@ 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
|
-
* When set to an HTMLElement, the width of the floating element will match the width of that HTMLElement.
|
|
49
|
-
*
|
|
50
48
|
* @default true
|
|
51
49
|
*/
|
|
52
|
-
refWidth?:
|
|
50
|
+
refWidth?: boolean;
|
|
53
51
|
/** Whether to hide the floating element. */
|
|
54
52
|
hide?: boolean;
|
|
55
53
|
};
|
|
@@ -77,9 +77,10 @@ export function useFloating({ placement = 'bottom-start', arrowRef, strategy = '
|
|
|
77
77
|
refWidth &&
|
|
78
78
|
size({
|
|
79
79
|
apply({ rects, elements }) {
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
80
|
+
if (refWidth)
|
|
81
|
+
Object.assign(elements.floating.style, {
|
|
82
|
+
width: `${rects.reference.width}px`,
|
|
83
|
+
});
|
|
83
84
|
},
|
|
84
85
|
}),
|
|
85
86
|
],
|
|
@@ -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;
|
|
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,CAAyD,EAChF,SAAS,GAAG,cAAc,EAC1B,QAAQ,EACR,QAAQ,GAAG,OAAO,EAClB,aAAa,GAAG,CAAC,EACjB,QAAQ,GAAG,IAAI,EACf,IAAI,GAAG,KAAK,GACG;IAKf,MAAM,CAAC,cAAc,EAAE,sBAAsB,CAAC,GAAG,QAAQ,CAAsB;QAC3E,OAAO,EAAE,CAAC;QACV,aAAa,EAAE,MAAM;QACrB,OAAO,EAAE,MAAM;KAClB,C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+
import { randomString } from '../utils/random';
|
|
2
3
|
/**
|
|
3
4
|
* A utility hook that generates a unique id for an element. If a default id is provided, it will use that instead.
|
|
4
5
|
*
|
|
@@ -6,8 +7,9 @@ import { useId as useIdReact } from 'react';
|
|
|
6
7
|
* @returns {string}
|
|
7
8
|
*/
|
|
8
9
|
export function useId(defaultId) {
|
|
9
|
-
|
|
10
|
-
|
|
10
|
+
return useMemo(() => {
|
|
11
|
+
return defaultId || randomString(8);
|
|
12
|
+
}, [defaultId]);
|
|
11
13
|
}
|
|
12
14
|
/** Copyright 2025 Anywhere Real Estate - CC BY 4.0 */
|
|
13
15
|
//# sourceMappingURL=useId.js.map
|
package/dist/hooks/useId.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useId.js","sourceRoot":"","sources":["../../src/hooks/useId.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"useId.js","sourceRoot":"","sources":["../../src/hooks/useId.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAChC,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C;;;;;GAKG;AACH,MAAM,UAAU,KAAK,CAAC,SAAyB;IAC3C,OAAO,OAAO,CAAC,GAAG,EAAE;QAChB,OAAO,SAAS,IAAI,YAAY,CAAC,CAAC,CAAC,CAAC;IACxC,CAAC,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC;AACpB,CAAC;AAED,sDAAsD"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Dispatch, DOMAttributes, SetStateAction } from 'react';
|
|
2
|
+
export type UseKeyNavigationProps = {
|
|
3
|
+
/** The callback function to call when a tab is selected (Enter or Space keys). */
|
|
4
|
+
onSelect: (activeId?: string) => void;
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* Custom hook to handle keyboard navigation for a list of elements.
|
|
8
|
+
*
|
|
9
|
+
* This hook provides functionality to navigate through elements using arrow keys and select an element with the Enter
|
|
10
|
+
* or Space key, or onClick.
|
|
11
|
+
*/
|
|
12
|
+
export declare function useKeyNavigation<T extends HTMLElement>({ onSelect, }: UseKeyNavigationProps): {
|
|
13
|
+
handleKeyDown: DOMAttributes<T>['onKeyDown'];
|
|
14
|
+
activeElementId: string | null;
|
|
15
|
+
setElements: (newElements: HTMLElement[]) => void;
|
|
16
|
+
setActiveElementId: Dispatch<SetStateAction<string | null>>;
|
|
17
|
+
};
|