@bspk/ui 1.3.8 → 1.3.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Accordion/Accordion.d.ts +19 -3
- package/dist/components/Accordion/Accordion.js +20 -3
- package/dist/components/Accordion/Accordion.js.map +1 -1
- package/dist/components/Avatar/Avatar.d.ts +13 -14
- package/dist/components/Avatar/Avatar.js +13 -14
- package/dist/components/Avatar/Avatar.js.map +1 -1
- package/dist/components/AvatarGroup/AvatarGroup.d.ts +29 -12
- package/dist/components/AvatarGroup/AvatarGroup.js +29 -12
- package/dist/components/AvatarGroup/AvatarGroup.js.map +1 -1
- package/dist/components/Badge/Badge.d.ts +1 -3
- package/dist/components/Badge/Badge.js +1 -3
- package/dist/components/Badge/Badge.js.map +1 -1
- package/dist/components/BadgeDot/BadgeDot.d.ts +4 -4
- package/dist/components/BadgeDot/BadgeDot.js +5 -4
- package/dist/components/BadgeDot/BadgeDot.js.map +1 -1
- package/dist/components/BannerAlert/BannerAlert.d.ts +11 -12
- package/dist/components/BannerAlert/BannerAlert.js +11 -12
- package/dist/components/BannerAlert/BannerAlert.js.map +1 -1
- package/dist/components/BottomNavigation/BottomNavigation.d.ts +6 -3
- package/dist/components/BottomNavigation/BottomNavigation.js +6 -3
- package/dist/components/BottomNavigation/BottomNavigation.js.map +1 -1
- package/dist/components/BottomNavigation/BottomNavigationExample.js +31 -36
- package/dist/components/BottomNavigation/BottomNavigationExample.js.map +1 -1
- package/dist/components/BottomNavigation/bottom-navigation.css +8 -1
- package/dist/components/BottomNavigation/bottom-navigation.css.js +8 -1
- package/dist/components/Breadcrumb/Breadcrumb.d.ts +17 -18
- package/dist/components/Breadcrumb/Breadcrumb.js +17 -18
- package/dist/components/Breadcrumb/Breadcrumb.js.map +1 -1
- package/dist/components/Breadcrumb/BreadcrumbDropdown.d.ts +6 -0
- package/dist/components/Breadcrumb/BreadcrumbDropdown.js +6 -0
- package/dist/components/Breadcrumb/BreadcrumbDropdown.js.map +1 -1
- package/dist/components/Button/Button.d.ts +1 -11
- package/dist/components/Button/Button.js +1 -11
- package/dist/components/Button/Button.js.map +1 -1
- package/dist/components/Button/ButtonExample.js +1 -3
- package/dist/components/Button/ButtonExample.js.map +1 -1
- package/dist/components/ButtonDock/ButtonDock.d.ts +10 -14
- package/dist/components/ButtonDock/ButtonDock.js +10 -14
- package/dist/components/ButtonDock/ButtonDock.js.map +1 -1
- package/dist/components/Card/Card.d.ts +8 -10
- package/dist/components/Card/Card.js +6 -10
- package/dist/components/Card/Card.js.map +1 -1
- package/dist/components/Carousel/Carousel.d.ts +9 -13
- package/dist/components/Carousel/Carousel.js +9 -13
- package/dist/components/Carousel/Carousel.js.map +1 -1
- package/dist/components/Carousel/CarouselExample.js +14 -14
- package/dist/components/Carousel/CarouselExample.js.map +1 -1
- package/dist/components/Checkbox/Checkbox.d.ts +7 -4
- package/dist/components/Checkbox/Checkbox.js +7 -4
- package/dist/components/Checkbox/Checkbox.js.map +1 -1
- package/dist/components/CheckboxGroup/CheckboxGroup.d.ts +3 -3
- package/dist/components/CheckboxGroup/CheckboxGroup.js +3 -3
- package/dist/components/CheckboxGroup/CheckboxGroupExample.js +1 -0
- package/dist/components/CheckboxGroup/CheckboxGroupExample.js.map +1 -1
- package/dist/components/CheckboxOption/CheckboxOption.d.ts +4 -4
- package/dist/components/CheckboxOption/CheckboxOption.js +4 -4
- package/dist/components/Chip/Chip.d.ts +3 -7
- package/dist/components/Chip/Chip.js +3 -7
- package/dist/components/Chip/Chip.js.map +1 -1
- package/dist/components/Chip/ChipExample.js +50 -3
- package/dist/components/Chip/ChipExample.js.map +1 -1
- package/dist/components/ChipGroup/ChipGroup.d.ts +21 -10
- package/dist/components/ChipGroup/ChipGroup.js +21 -10
- package/dist/components/ChipGroup/ChipGroup.js.map +1 -1
- package/dist/components/ChipGroup/ChipGroupExample.js +1 -0
- package/dist/components/ChipGroup/ChipGroupExample.js.map +1 -1
- package/dist/components/DatePicker/DatePicker.d.ts +13 -12
- package/dist/components/DatePicker/DatePicker.js +13 -12
- package/dist/components/DatePicker/DatePicker.js.map +1 -1
- package/dist/components/Dialog/Dialog.d.ts +11 -6
- package/dist/components/Dialog/Dialog.js +11 -6
- package/dist/components/Dialog/Dialog.js.map +1 -1
- package/dist/components/Divider/Divider.d.ts +5 -9
- package/dist/components/Divider/Divider.js +5 -9
- package/dist/components/Divider/Divider.js.map +1 -1
- package/dist/components/Divider/DividerExample.js +16 -1
- package/dist/components/Divider/DividerExample.js.map +1 -1
- package/dist/components/Drawer/Drawer.d.ts +3 -3
- package/dist/components/Drawer/Drawer.js +3 -3
- package/dist/components/Drawer/Drawer.js.map +1 -1
- package/dist/components/EmptyState/EmptyState.d.ts +3 -7
- package/dist/components/EmptyState/EmptyState.js +3 -7
- package/dist/components/EmptyState/EmptyState.js.map +1 -1
- package/dist/components/Fab/Fab.d.ts +4 -5
- package/dist/components/Fab/Fab.js +4 -6
- package/dist/components/Fab/Fab.js.map +1 -1
- package/dist/components/Fab/FabExample.d.ts +2 -1
- package/dist/components/Fab/FabExample.js +20 -2
- package/dist/components/Fab/FabExample.js.map +1 -1
- package/dist/components/Field/Field.d.ts +4 -5
- package/dist/components/Field/Field.js +4 -5
- package/dist/components/Field/Field.js.map +1 -1
- package/dist/components/Field/FieldDescription.d.ts +7 -5
- package/dist/components/Field/FieldDescription.js +7 -3
- package/dist/components/Field/FieldDescription.js.map +1 -1
- package/dist/components/Field/FieldError.d.ts +6 -0
- package/dist/components/Field/FieldError.js +6 -0
- package/dist/components/Field/FieldError.js.map +1 -1
- package/dist/components/Field/FieldLabel.d.ts +6 -0
- package/dist/components/Field/FieldLabel.js +6 -0
- package/dist/components/Field/FieldLabel.js.map +1 -1
- package/dist/components/Field/utils.d.ts +5 -0
- package/dist/components/Field/utils.js +5 -0
- package/dist/components/Field/utils.js.map +1 -1
- package/dist/components/FileUpload/FileUpload.d.ts +3 -3
- package/dist/components/FileUpload/FileUpload.js +3 -3
- package/dist/components/FileUploadItem/FileUploadItem.d.ts +6 -10
- package/dist/components/FileUploadItem/FileUploadItem.js +6 -10
- package/dist/components/FileUploadItem/FileUploadItem.js.map +1 -1
- package/dist/components/FormField/FormField.d.ts +5 -16
- package/dist/components/FormField/FormField.js +5 -16
- package/dist/components/FormField/FormField.js.map +1 -1
- package/dist/components/Img/Img.d.ts +1 -3
- package/dist/components/Img/Img.js +1 -3
- package/dist/components/Img/Img.js.map +1 -1
- package/dist/components/InlineAlert/InlineAlert.d.ts +1 -3
- package/dist/components/InlineAlert/InlineAlert.js +1 -3
- package/dist/components/InlineAlert/InlineAlert.js.map +1 -1
- package/dist/components/InlineAlert/SvgWarningTwoTone.d.ts +6 -0
- package/dist/components/InlineAlert/SvgWarningTwoTone.js +6 -0
- package/dist/components/InlineAlert/SvgWarningTwoTone.js.map +1 -1
- package/dist/components/Input/Input.d.ts +13 -13
- package/dist/components/Input/Input.js +13 -13
- package/dist/components/Input/InputElement.d.ts +11 -5
- package/dist/components/Input/InputElement.js +11 -5
- package/dist/components/Input/InputElement.js.map +1 -1
- package/dist/components/InputNumber/IncrementButton.d.ts +13 -3
- package/dist/components/InputNumber/IncrementButton.js +11 -4
- package/dist/components/InputNumber/IncrementButton.js.map +1 -1
- package/dist/components/InputNumber/InputNumber.d.ts +20 -20
- package/dist/components/InputNumber/InputNumber.js +46 -30
- package/dist/components/InputNumber/InputNumber.js.map +1 -1
- package/dist/components/InputNumber/InputNumberExample.js +1 -0
- package/dist/components/InputNumber/InputNumberExample.js.map +1 -1
- package/dist/components/InputNumber/input-number.css +6 -0
- package/dist/components/InputNumber/input-number.css.js +6 -0
- package/dist/components/InputPhone/InputPhone.d.ts +21 -16
- package/dist/components/InputPhone/InputPhone.js +21 -16
- package/dist/components/InputPhone/InputPhone.js.map +1 -1
- package/dist/components/Layout/Layout.d.ts +1 -3
- package/dist/components/Layout/Layout.js +1 -3
- package/dist/components/Layout/Layout.js.map +1 -1
- package/dist/components/Link/Link.d.ts +1 -3
- package/dist/components/Link/Link.js +1 -3
- package/dist/components/Link/Link.js.map +1 -1
- package/dist/components/ListItem/ListItem.d.ts +22 -21
- package/dist/components/ListItem/ListItem.js +19 -16
- package/dist/components/ListItem/ListItem.js.map +1 -1
- package/dist/components/Menu/Menu.d.ts +5 -9
- package/dist/components/Menu/Menu.js +5 -9
- package/dist/components/Menu/Menu.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/Modal/modal.css +12 -1
- package/dist/components/Modal/modal.css.js +12 -1
- package/dist/components/OTPInput/OTPInput.d.ts +5 -3
- package/dist/components/OTPInput/OTPInput.js +5 -3
- package/dist/components/OTPInput/OTPInput.js.map +1 -1
- package/dist/components/PageControl/PageControl.d.ts +1 -3
- package/dist/components/PageControl/PageControl.js +1 -3
- package/dist/components/PageControl/PageControl.js.map +1 -1
- package/dist/components/Pagination/PageList.d.ts +6 -0
- package/dist/components/Pagination/PageList.js +6 -0
- package/dist/components/Pagination/PageList.js.map +1 -1
- package/dist/components/Pagination/Pagination.d.ts +6 -7
- package/dist/components/Pagination/Pagination.js +28 -15
- package/dist/components/Pagination/Pagination.js.map +1 -1
- package/dist/components/Pagination/pagination.css +5 -14
- package/dist/components/Pagination/pagination.css.js +5 -14
- package/dist/components/Password/Password.d.ts +19 -20
- package/dist/components/Password/Password.js +19 -20
- package/dist/components/Password/Password.js.map +1 -1
- package/dist/components/Popover/Popover.d.ts +11 -20
- package/dist/components/Popover/Popover.js +11 -20
- package/dist/components/Popover/Popover.js.map +1 -1
- package/dist/components/Popover/PopoverExample.js +1 -1
- package/dist/components/Popover/PopoverExample.js.map +1 -1
- package/dist/components/ProgressBar/ProgressBar.d.ts +1 -3
- package/dist/components/ProgressBar/ProgressBar.js +1 -3
- package/dist/components/ProgressBar/ProgressBar.js.map +1 -1
- package/dist/components/ProgressCircle/ProgressCircle.d.ts +1 -3
- package/dist/components/ProgressCircle/ProgressCircle.js +1 -3
- package/dist/components/ProgressCircle/ProgressCircle.js.map +1 -1
- package/dist/components/ProgressionStepper/ProgressionStepper.d.ts +1 -3
- package/dist/components/ProgressionStepper/ProgressionStepper.js +1 -3
- package/dist/components/ProgressionStepper/ProgressionStepper.js.map +1 -1
- package/dist/components/RadioGroup/RadioGroup.d.ts +2 -2
- package/dist/components/RadioGroup/RadioGroup.js +2 -2
- package/dist/components/Rating/Rating.d.ts +2 -4
- package/dist/components/Rating/Rating.js +8 -6
- package/dist/components/Rating/Rating.js.map +1 -1
- package/dist/components/Rating/RatingExample.js +17 -1
- package/dist/components/Rating/RatingExample.js.map +1 -1
- package/dist/components/Scrim/Scrim.d.ts +0 -1
- package/dist/components/Scrim/Scrim.js +0 -1
- package/dist/components/Scrim/Scrim.js.map +1 -1
- package/dist/components/SearchBar/SearchBar.d.ts +2 -2
- package/dist/components/SearchBar/SearchBar.js +2 -2
- package/dist/components/SegmentedControl/SegmentedControl.d.ts +3 -3
- package/dist/components/SegmentedControl/SegmentedControl.js +3 -3
- package/dist/components/SegmentedControl/SegmentedControlExample.js +10 -12
- package/dist/components/SegmentedControl/SegmentedControlExample.js.map +1 -1
- package/dist/components/Select/Select.d.ts +33 -34
- package/dist/components/Select/Select.js +33 -34
- package/dist/components/Select/Select.js.map +1 -1
- package/dist/components/Skeleton/Circular.d.ts +6 -0
- package/dist/components/Skeleton/Circular.js +6 -0
- package/dist/components/Skeleton/Circular.js.map +1 -1
- package/dist/components/Skeleton/Photo.d.ts +6 -0
- package/dist/components/Skeleton/Photo.js +6 -0
- package/dist/components/Skeleton/Photo.js.map +1 -1
- package/dist/components/Skeleton/Profile.d.ts +6 -0
- package/dist/components/Skeleton/Profile.js +6 -0
- package/dist/components/Skeleton/Profile.js.map +1 -1
- package/dist/components/Skeleton/Rectangular.d.ts +6 -0
- package/dist/components/Skeleton/Rectangular.js +6 -0
- package/dist/components/Skeleton/Rectangular.js.map +1 -1
- package/dist/components/Skeleton/Skeleton.d.ts +10 -14
- package/dist/components/Skeleton/Skeleton.js +10 -14
- package/dist/components/Skeleton/Skeleton.js.map +1 -1
- package/dist/components/Skeleton/SkeletonExample.js +4 -3
- package/dist/components/Skeleton/SkeletonExample.js.map +1 -1
- package/dist/components/Skeleton/Thumbnail.d.ts +6 -0
- package/dist/components/Skeleton/Thumbnail.js +6 -0
- package/dist/components/Skeleton/Thumbnail.js.map +1 -1
- package/dist/components/SkeletonText/SkeletonText.d.ts +5 -9
- package/dist/components/SkeletonText/SkeletonText.js +5 -9
- package/dist/components/SkeletonText/SkeletonText.js.map +1 -1
- package/dist/components/Slider/Slider.d.ts +2 -2
- package/dist/components/Slider/Slider.js +2 -2
- package/dist/components/Slider/SliderExample.js +40 -18
- package/dist/components/Slider/SliderExample.js.map +1 -1
- package/dist/components/Slider/SliderIntervalDots.d.ts +6 -0
- package/dist/components/Slider/SliderIntervalDots.js +6 -0
- package/dist/components/Slider/SliderIntervalDots.js.map +1 -1
- package/dist/components/Snackbar/Manager.d.ts +28 -0
- package/dist/components/Snackbar/Manager.js +34 -0
- package/dist/components/Snackbar/Manager.js.map +1 -0
- package/dist/components/Snackbar/Snackbar.d.ts +23 -6
- package/dist/components/Snackbar/Snackbar.js +23 -5
- package/dist/components/Snackbar/Snackbar.js.map +1 -1
- package/dist/components/Snackbar/SnackbarExample.js +8 -1
- package/dist/components/Snackbar/SnackbarExample.js.map +1 -1
- package/dist/components/Snackbar/index.d.ts +1 -0
- package/dist/components/Snackbar/index.js +1 -0
- package/dist/components/Snackbar/index.js.map +1 -1
- package/dist/components/StylesProviderDemo/StylesProviderDemo.d.ts +1 -3
- package/dist/components/StylesProviderDemo/StylesProviderDemo.js +1 -3
- package/dist/components/StylesProviderDemo/StylesProviderDemo.js.map +1 -1
- package/dist/components/Switch/Switch.d.ts +2 -2
- package/dist/components/Switch/Switch.js +2 -2
- package/dist/components/TabGroup/TabGroup.d.ts +2 -2
- package/dist/components/TabGroup/TabGroup.js +2 -2
- package/dist/components/TabGroup/TabGroupExample.js +5 -11
- package/dist/components/TabGroup/TabGroupExample.js.map +1 -1
- package/dist/components/TabGroup/tab-group.css +1 -0
- package/dist/components/TabGroup/tab-group.css.js +1 -0
- package/dist/components/TabList/TabList.d.ts +2 -2
- package/dist/components/TabList/TabList.js +3 -4
- package/dist/components/TabList/TabList.js.map +1 -1
- package/dist/components/TabList/tab-list.css +0 -1
- package/dist/components/TabList/tab-list.css.js +0 -1
- package/dist/components/Table/Footer.d.ts +6 -0
- package/dist/components/Table/Footer.js +6 -0
- package/dist/components/Table/Footer.js.map +1 -1
- package/dist/components/Table/Table.d.ts +53 -16
- package/dist/components/Table/Table.js +53 -16
- package/dist/components/Table/Table.js.map +1 -1
- package/dist/components/Table/table.css +0 -1
- package/dist/components/Table/table.css.js +0 -1
- package/dist/components/Tag/Tag.d.ts +1 -3
- package/dist/components/Tag/Tag.js +1 -3
- package/dist/components/Tag/Tag.js.map +1 -1
- package/dist/components/Textarea/Textarea.d.ts +13 -13
- package/dist/components/Textarea/Textarea.js +13 -13
- package/dist/components/TimePicker/Listbox.d.ts +6 -0
- package/dist/components/TimePicker/Listbox.js +6 -0
- package/dist/components/TimePicker/Listbox.js.map +1 -1
- package/dist/components/TimePicker/Segment.d.ts +6 -0
- package/dist/components/TimePicker/Segment.js +6 -0
- package/dist/components/TimePicker/Segment.js.map +1 -1
- package/dist/components/TimePicker/TimePicker.d.ts +14 -14
- package/dist/components/TimePicker/TimePicker.js +14 -14
- package/dist/components/ToggleOption/ToggleOption.js +1 -1
- package/dist/components/ToggleOption/ToggleOption.js.map +1 -1
- package/dist/components/ToggleOption/toggle-option.css +2 -49
- package/dist/components/ToggleOption/toggle-option.css.js +2 -49
- package/dist/components/Tooltip/Tooltip.d.ts +3 -7
- package/dist/components/Tooltip/Tooltip.js +3 -7
- package/dist/components/Tooltip/Tooltip.js.map +1 -1
- package/dist/components/Tooltip/TooltipExample.js +23 -3
- package/dist/components/Tooltip/TooltipExample.js.map +1 -1
- package/dist/components/Truncated/Truncated.d.ts +0 -1
- package/dist/components/Truncated/Truncated.js +1 -2
- package/dist/components/Truncated/Truncated.js.map +1 -1
- package/dist/components/Txt/Txt.d.ts +1 -3
- package/dist/components/Txt/Txt.js +1 -3
- package/dist/components/Txt/Txt.js.map +1 -1
- package/dist/components/UIProvider/AriaLiveMessageHandler.js +3 -2
- package/dist/components/UIProvider/AriaLiveMessageHandler.js.map +1 -1
- package/dist/components/UIProvider/UIProvider.d.ts +0 -1
- package/dist/components/UIProvider/UIProvider.js +0 -1
- package/dist/components/UIProvider/UIProvider.js.map +1 -1
- package/dist/hooks/useAddEventListener.d.ts +1 -2
- package/dist/hooks/useAddEventListener.js.map +1 -1
- package/dist/hooks/useLongPress.d.ts +30 -15
- package/dist/hooks/useLongPress.js +26 -42
- package/dist/hooks/useLongPress.js.map +1 -1
- package/dist/hooks/useRadioState.d.ts +1 -1
- package/dist/hooks/useTimeout.d.ts +1 -2
- package/dist/hooks/useTimeout.js +20 -4
- package/dist/hooks/useTimeout.js.map +1 -1
- package/dist/styles/base.css +9 -0
- package/dist/styles/base.css.js +9 -0
- package/dist/types/common.d.ts +3 -0
- package/dist/types/common.js.map +1 -1
- package/dist/types/meta.d.ts +1 -0
- package/dist/types/meta.js.map +1 -1
- package/dist/utils/createCustomEvent.d.ts +17 -0
- package/dist/utils/createCustomEvent.js +21 -0
- package/dist/utils/createCustomEvent.js.map +1 -0
- package/dist/utils/createExampleChildElement.js +3 -3
- package/dist/utils/createExampleChildElement.js.map +1 -1
- package/dist/utils/demo.d.ts +18 -26
- package/dist/utils/demo.js.map +1 -1
- package/meta.ts +6 -1
- package/package.json +1 -1
- package/src/components/Accordion/Accordion.tsx +20 -3
- package/src/components/Avatar/Avatar.tsx +13 -14
- package/src/components/AvatarGroup/AvatarGroup.tsx +30 -13
- package/src/components/Badge/Badge.tsx +1 -3
- package/src/components/BadgeDot/BadgeDot.tsx +6 -4
- package/src/components/BannerAlert/BannerAlert.tsx +11 -12
- package/src/components/BottomNavigation/BottomNavigation.tsx +6 -3
- package/src/components/BottomNavigation/BottomNavigationExample.tsx +31 -36
- package/src/components/BottomNavigation/bottom-navigation.scss +10 -1
- package/src/components/Breadcrumb/Breadcrumb.tsx +17 -18
- package/src/components/Breadcrumb/BreadcrumbDropdown.tsx +6 -0
- package/src/components/Button/Button.tsx +1 -11
- package/src/components/Button/ButtonExample.tsx +1 -2
- package/src/components/ButtonDock/ButtonDock.tsx +10 -14
- package/src/components/Card/Card.tsx +9 -11
- package/src/components/Carousel/Carousel.tsx +9 -13
- package/src/components/Carousel/CarouselExample.tsx +25 -25
- package/src/components/Checkbox/Checkbox.tsx +7 -4
- package/src/components/CheckboxGroup/CheckboxGroup.tsx +3 -3
- package/src/components/CheckboxGroup/CheckboxGroupExample.tsx +1 -0
- package/src/components/CheckboxOption/CheckboxOption.tsx +4 -4
- package/src/components/Chip/Chip.tsx +3 -7
- package/src/components/Chip/ChipExample.tsx +52 -3
- package/src/components/ChipGroup/ChipGroup.tsx +21 -10
- package/src/components/ChipGroup/ChipGroupExample.tsx +1 -1
- package/src/components/DatePicker/DatePicker.tsx +13 -12
- package/src/components/Dialog/Dialog.tsx +11 -6
- package/src/components/Divider/Divider.tsx +5 -9
- package/src/components/Divider/DividerExample.tsx +18 -1
- package/src/components/Drawer/Drawer.tsx +3 -4
- package/src/components/EmptyState/EmptyState.tsx +3 -7
- package/src/components/Fab/Fab.tsx +8 -5
- package/src/components/Fab/FabExample.tsx +22 -3
- package/src/components/Field/Field.tsx +4 -5
- package/src/components/Field/FieldDescription.tsx +7 -5
- package/src/components/Field/FieldError.tsx +6 -0
- package/src/components/Field/FieldLabel.tsx +6 -0
- package/src/components/Field/utils.ts +5 -0
- package/src/components/FileUpload/FileUpload.tsx +3 -3
- package/src/components/FileUploadItem/FileUploadItem.tsx +6 -10
- package/src/components/FormField/FormField.tsx +5 -16
- package/src/components/Img/Img.tsx +1 -3
- package/src/components/InlineAlert/InlineAlert.tsx +1 -3
- package/src/components/InlineAlert/SvgWarningTwoTone.tsx +6 -0
- package/src/components/Input/Input.tsx +13 -13
- package/src/components/Input/InputElement.tsx +11 -5
- package/src/components/InputNumber/IncrementButton.tsx +21 -11
- package/src/components/InputNumber/InputNumber.tsx +53 -51
- package/src/components/InputNumber/InputNumberExample.tsx +1 -0
- package/src/components/InputNumber/input-number.scss +10 -0
- package/src/components/InputPhone/InputPhone.tsx +21 -16
- package/src/components/Layout/Layout.tsx +1 -3
- package/src/components/Link/Link.tsx +1 -3
- package/src/components/ListItem/ListItem.tsx +22 -20
- package/src/components/Menu/Menu.tsx +5 -9
- package/src/components/Modal/Modal.tsx +10 -5
- package/src/components/Modal/modal.scss +13 -1
- package/src/components/OTPInput/OTPInput.tsx +5 -3
- package/src/components/PageControl/PageControl.tsx +1 -3
- package/src/components/Pagination/PageList.tsx +6 -0
- package/src/components/Pagination/Pagination.tsx +50 -24
- package/src/components/Pagination/pagination.scss +7 -17
- package/src/components/Password/Password.tsx +19 -20
- package/src/components/Popover/Popover.tsx +11 -20
- package/src/components/Popover/PopoverExample.tsx +1 -1
- package/src/components/ProgressBar/ProgressBar.tsx +1 -3
- package/src/components/ProgressCircle/ProgressCircle.tsx +1 -3
- package/src/components/ProgressionStepper/ProgressionStepper.tsx +1 -3
- package/src/components/RadioGroup/RadioGroup.tsx +2 -2
- package/src/components/Rating/Rating.tsx +34 -14
- package/src/components/Rating/RatingExample.tsx +18 -1
- package/src/components/Scrim/Scrim.tsx +0 -1
- package/src/components/SearchBar/SearchBar.tsx +2 -2
- package/src/components/SegmentedControl/SegmentedControl.tsx +3 -3
- package/src/components/SegmentedControl/SegmentedControlExample.tsx +10 -12
- package/src/components/Select/Select.tsx +33 -34
- package/src/components/Skeleton/Circular.tsx +6 -0
- package/src/components/Skeleton/Photo.tsx +6 -0
- package/src/components/Skeleton/Profile.tsx +6 -0
- package/src/components/Skeleton/Rectangular.tsx +6 -0
- package/src/components/Skeleton/Skeleton.tsx +10 -14
- package/src/components/Skeleton/SkeletonExample.tsx +5 -3
- package/src/components/Skeleton/Thumbnail.tsx +6 -0
- package/src/components/SkeletonText/SkeletonText.tsx +5 -9
- package/src/components/Slider/Slider.tsx +2 -2
- package/src/components/Slider/SliderExample.tsx +42 -17
- package/src/components/Slider/SliderIntervalDots.tsx +6 -0
- package/src/components/Snackbar/Manager.tsx +63 -0
- package/src/components/Snackbar/Snackbar.tsx +23 -7
- package/src/components/Snackbar/SnackbarExample.tsx +28 -6
- package/src/components/Snackbar/index.tsx +1 -0
- package/src/components/StylesProviderDemo/StylesProviderDemo.tsx +1 -3
- package/src/components/Switch/Switch.tsx +2 -2
- package/src/components/TabGroup/TabGroup.tsx +2 -2
- package/src/components/TabGroup/TabGroupExample.tsx +5 -11
- package/src/components/TabGroup/tab-group.scss +1 -0
- package/src/components/TabList/TabList.tsx +3 -4
- package/src/components/TabList/tab-list.scss +0 -1
- package/src/components/Table/Footer.tsx +6 -0
- package/src/components/Table/Table.tsx +53 -16
- package/src/components/Table/table.scss +0 -1
- package/src/components/Tag/Tag.tsx +1 -3
- package/src/components/Textarea/Textarea.tsx +13 -13
- package/src/components/TimePicker/Listbox.tsx +6 -0
- package/src/components/TimePicker/Segment.tsx +6 -0
- package/src/components/TimePicker/TimePicker.tsx +14 -14
- package/src/components/ToggleOption/ToggleOption.tsx +1 -0
- package/src/components/ToggleOption/toggle-option.scss +2 -61
- package/src/components/Tooltip/Tooltip.tsx +3 -7
- package/src/components/Tooltip/TooltipExample.tsx +23 -11
- package/src/components/Truncated/Truncated.tsx +1 -2
- package/src/components/Txt/Txt.tsx +1 -3
- package/src/components/UIProvider/AriaLiveMessageHandler.tsx +4 -2
- package/src/components/UIProvider/UIProvider.tsx +0 -1
- package/src/hooks/useAddEventListener.ts +1 -3
- package/src/hooks/useLongPress.ts +58 -48
- package/src/hooks/useTimeout.ts +1 -5
- package/src/styles/base.scss +9 -0
- package/src/types/common.ts +4 -0
- package/src/types/meta.ts +1 -0
- package/src/utils/createCustomEvent.ts +35 -0
- package/src/utils/createExampleChildElement.tsx +3 -8
- package/src/utils/demo.ts +24 -27
- package/dist/components/ListItem/ListItemButton.d.ts +0 -2
- package/dist/components/ListItem/ListItemButton.js +0 -7
- package/dist/components/ListItem/ListItemButton.js.map +0 -1
- package/dist/components/Pagination/PageInput.d.ts +0 -4
- package/dist/components/Pagination/PageInput.js +0 -36
- package/dist/components/Pagination/PageInput.js.map +0 -1
- package/dist/components/Truncated/truncated.css +0 -8
- package/dist/components/Truncated/truncated.css.js +0 -13
- package/dist/hooks/usePaginationState.d.ts +0 -4
- package/dist/hooks/usePaginationState.js +0 -22
- package/dist/hooks/usePaginationState.js.map +0 -1
- package/src/components/ListItem/ListItemButton.tsx +0 -6
- package/src/components/Pagination/PageInput.tsx +0 -65
- package/src/components/Truncated/truncated.scss +0 -8
- package/src/hooks/usePaginationState.tsx +0 -24
|
@@ -1,57 +1,67 @@
|
|
|
1
|
-
import { useRef
|
|
2
|
-
|
|
1
|
+
import { useRef } from 'react';
|
|
3
2
|
import { useTimeout } from './useTimeout';
|
|
4
3
|
|
|
5
|
-
export
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
4
|
+
export type LongPressProps = {
|
|
5
|
+
/** The callback to be invoked on long press. If false is returned, the repeating will stop. */
|
|
6
|
+
callback: () => boolean;
|
|
7
|
+
/**
|
|
8
|
+
* The initial delay (in ms) before repeating starts. Default is 750ms.
|
|
9
|
+
*
|
|
10
|
+
* @default 750
|
|
11
|
+
*/
|
|
12
|
+
delay?: number;
|
|
13
|
+
/**
|
|
14
|
+
* The amount (in percent) to decrement the delay after each repeat. Default is 15%.
|
|
15
|
+
*
|
|
16
|
+
* @default 15
|
|
17
|
+
*/
|
|
18
|
+
delayDecrement?: number;
|
|
19
|
+
/**
|
|
20
|
+
* The minimum delay (in ms) between repeats. Default is 100ms.
|
|
21
|
+
*
|
|
22
|
+
* @default 100
|
|
23
|
+
*/
|
|
24
|
+
delayMin?: number;
|
|
25
|
+
};
|
|
17
26
|
|
|
18
|
-
|
|
27
|
+
/**
|
|
28
|
+
* A hook that provides long press functionality. The provided callback will be invoked once immediately on press, and
|
|
29
|
+
* then repeatedly after a delay, with the delay decreasing by a specified amount after each repeat.
|
|
30
|
+
*/
|
|
31
|
+
export function useLongPress({
|
|
32
|
+
callback,
|
|
33
|
+
delay: initialDelay = 750,
|
|
34
|
+
delayDecrement = 15,
|
|
35
|
+
delayMin = 100,
|
|
36
|
+
}: LongPressProps) {
|
|
19
37
|
const timeout = useTimeout();
|
|
20
|
-
const
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
+
const isPressing = useRef(false);
|
|
39
|
+
const delay = useRef(initialDelay);
|
|
40
|
+
|
|
41
|
+
const setPressing = (pressing: boolean) => {
|
|
42
|
+
isPressing.current = pressing;
|
|
43
|
+
|
|
44
|
+
if (pressing) {
|
|
45
|
+
if (!callback()) return setPressing(false);
|
|
46
|
+
|
|
47
|
+
timeout.set(() => {
|
|
48
|
+
if (!isPressing.current) return setPressing(false);
|
|
49
|
+
|
|
50
|
+
const decrementMs = (delay.current * delayDecrement) / 100;
|
|
51
|
+
delay.current = delay.current <= delayMin ? delayMin : delay.current - decrementMs;
|
|
52
|
+
|
|
53
|
+
setPressing(true);
|
|
54
|
+
}, delay.current);
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
delay.current = initialDelay;
|
|
59
|
+
timeout.clear();
|
|
38
60
|
};
|
|
39
61
|
|
|
40
62
|
return {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
callback();
|
|
45
|
-
timeout.set(run, intervalRef.current);
|
|
46
|
-
},
|
|
47
|
-
onMouseUp: () => {
|
|
48
|
-
timeout.clear();
|
|
49
|
-
},
|
|
50
|
-
onMouseLeave: () => {
|
|
51
|
-
timeout.clear();
|
|
52
|
-
},
|
|
53
|
-
setTriggerElement,
|
|
63
|
+
onPointerDown: () => setPressing(true),
|
|
64
|
+
onPointerLeave: () => setPressing(false),
|
|
65
|
+
onPointerUp: () => setPressing(false),
|
|
54
66
|
};
|
|
55
67
|
}
|
|
56
|
-
|
|
57
|
-
/** Copyright 2025 Anywhere Real Estate - CC BY 4.0 */
|
package/src/hooks/useTimeout.ts
CHANGED
|
@@ -25,15 +25,11 @@ export type TimeoutHook = {
|
|
|
25
25
|
*
|
|
26
26
|
* @returns A ref object that can be used to store a timeout id.
|
|
27
27
|
*/
|
|
28
|
-
export function useTimeout(): TimeoutHook
|
|
29
|
-
export function useTimeout(initialCallback: () => void, durationMs: number): TimeoutHook;
|
|
30
|
-
export function useTimeout(initialCallback?: () => void, durationMs = 1000): TimeoutHook {
|
|
28
|
+
export function useTimeout(durationMs = 1000): TimeoutHook {
|
|
31
29
|
const timeoutRef = useRef<ReturnType<typeof setTimeout> | null>(null);
|
|
32
30
|
|
|
33
31
|
useEffect(() => {
|
|
34
32
|
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
35
|
-
if (initialCallback) timeoutRef.current = setTimeout(initialCallback, durationMs);
|
|
36
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps -- only run at mount
|
|
37
33
|
}, []);
|
|
38
34
|
|
|
39
35
|
return useMemo(
|
package/src/styles/base.scss
CHANGED
|
@@ -179,6 +179,15 @@ body[data-bspk] {
|
|
|
179
179
|
left: auto;
|
|
180
180
|
}
|
|
181
181
|
|
|
182
|
+
[data-truncated] {
|
|
183
|
+
max-width: 100%;
|
|
184
|
+
display: inline-block;
|
|
185
|
+
overflow: hidden;
|
|
186
|
+
text-overflow: ellipsis;
|
|
187
|
+
white-space: nowrap;
|
|
188
|
+
background-color: transparent;
|
|
189
|
+
}
|
|
190
|
+
|
|
182
191
|
[data-sr-only] {
|
|
183
192
|
height: 1px;
|
|
184
193
|
overflow: hidden;
|
package/src/types/common.ts
CHANGED
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
* @bspk/ui/Txt".
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
+
import { IconName } from '@bspk/icons';
|
|
9
10
|
import {
|
|
10
11
|
JSXElementConstructor,
|
|
11
12
|
ReactNode,
|
|
@@ -40,6 +41,9 @@ export type DataProps = Record<`data-${string}`, string>;
|
|
|
40
41
|
|
|
41
42
|
export type ButtonSize = 'large' | 'medium' | 'small' | 'x-small';
|
|
42
43
|
|
|
44
|
+
/** The name of an icon in the Bspk icon library. */
|
|
45
|
+
export type BspkIcon = IconName;
|
|
46
|
+
|
|
43
47
|
export type CallToActionButton = {
|
|
44
48
|
/**
|
|
45
49
|
* The label of the call to action button.
|
package/src/types/meta.ts
CHANGED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { useEventListener } from '-/hooks/useAddEventListener';
|
|
2
|
+
|
|
3
|
+
export type CustomEventDetail =
|
|
4
|
+
| Array<CustomEventDetail>
|
|
5
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
|
|
6
|
+
| Function
|
|
7
|
+
| boolean
|
|
8
|
+
| number
|
|
9
|
+
| string
|
|
10
|
+
| { [key: string]: CustomEventDetail }
|
|
11
|
+
| null
|
|
12
|
+
| undefined;
|
|
13
|
+
|
|
14
|
+
export type CustomEventHandler<TDetail extends CustomEventDetail> = (detail: TDetail) => void;
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Like React.createContext but for custom events using the DOM's CustomEvent system.
|
|
18
|
+
*
|
|
19
|
+
* This allows for communication between components without using React.Context, which can cause unnecessary re-renders.
|
|
20
|
+
*
|
|
21
|
+
* This generator ensures only safe detail types are used. !important;
|
|
22
|
+
*/
|
|
23
|
+
export function createCustomEvent<TDetail extends CustomEventDetail>(
|
|
24
|
+
/** The name of the custom event to create. Prefix with 'bspk-' to avoid conflicts. */
|
|
25
|
+
eventName: string,
|
|
26
|
+
) {
|
|
27
|
+
return {
|
|
28
|
+
send(detail: TDetail) {
|
|
29
|
+
document.dispatchEvent(new CustomEvent<TDetail>(eventName, { detail }));
|
|
30
|
+
},
|
|
31
|
+
useEventListener(listener: CustomEventHandler<TDetail>) {
|
|
32
|
+
useEventListener(eventName, (event) => listener((event as CustomEvent<TDetail>).detail), document);
|
|
33
|
+
},
|
|
34
|
+
};
|
|
35
|
+
}
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
/* eslint-disable @typescript-eslint/no-explicit-any */ import { SvgContentCopy } from '@bspk/icons/ContentCopy';
|
|
2
2
|
import { SvgDiamond } from '@bspk/icons/Diamond';
|
|
3
3
|
import { DemoAction, DemoSetState } from './demo';
|
|
4
|
-
|
|
5
4
|
import { Avatar } from '-/components/Avatar';
|
|
5
|
+
import { Button } from '-/components/Button';
|
|
6
6
|
import { Checkbox } from '-/components/Checkbox';
|
|
7
7
|
import { Img } from '-/components/Img';
|
|
8
|
-
import { ListItem } from '-/components/ListItem';
|
|
9
8
|
import { Radio } from '-/components/Radio';
|
|
10
9
|
import { Switch } from '-/components/Switch';
|
|
11
10
|
import { Tag } from '-/components/Tag';
|
|
@@ -55,14 +54,10 @@ export function createExampleChildElement({ exampleState, name, setState, action
|
|
|
55
54
|
};
|
|
56
55
|
}
|
|
57
56
|
|
|
58
|
-
if (componentName === '
|
|
57
|
+
if (componentName === 'Button')
|
|
59
58
|
return {
|
|
60
59
|
element: (
|
|
61
|
-
<ListItem
|
|
62
|
-
icon={<SvgContentCopy />}
|
|
63
|
-
label="LI Button"
|
|
64
|
-
onClick={() => action('ListItem button clicked')}
|
|
65
|
-
/>
|
|
60
|
+
<Button icon={<SvgContentCopy />} label="LI Button" onClick={() => action('ListItem button clicked')} />
|
|
66
61
|
),
|
|
67
62
|
componentName,
|
|
68
63
|
};
|
package/src/utils/demo.ts
CHANGED
|
@@ -2,22 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import { CSSProperties, ReactNode } from 'react';
|
|
4
4
|
import { AlertVariant, DataProps } from '-/types/common';
|
|
5
|
-
import { ComponentMeta } from '-/types/meta';
|
|
6
|
-
|
|
7
|
-
export type TypeProperty = {
|
|
8
|
-
name: string;
|
|
9
|
-
description?: string;
|
|
10
|
-
type?: string[] | string;
|
|
11
|
-
default?: unknown;
|
|
12
|
-
required?: boolean;
|
|
13
|
-
options?: number[] | string[];
|
|
14
|
-
variants?: string[];
|
|
15
|
-
references?: string[];
|
|
16
|
-
minimum?: number;
|
|
17
|
-
maximum?: number;
|
|
18
|
-
example?: string;
|
|
19
|
-
exampleType?: string;
|
|
20
|
-
};
|
|
5
|
+
import { ComponentMeta, TypeProperty } from '-/types/meta';
|
|
21
6
|
|
|
22
7
|
export type DemoAction = (message: string, variant?: AlertVariant) => void;
|
|
23
8
|
|
|
@@ -59,8 +44,24 @@ export type ComponentVariantOverride<Props> = {
|
|
|
59
44
|
[K in keyof Props]?: Props[K] | { options: Props[K][] };
|
|
60
45
|
};
|
|
61
46
|
|
|
47
|
+
export type ComponentPageSection<Props = Record<string, unknown>> = {
|
|
48
|
+
title: string;
|
|
49
|
+
content: (params: {
|
|
50
|
+
Component?: React.ComponentType<Props>;
|
|
51
|
+
props: Props;
|
|
52
|
+
CodeExample: CodeExample;
|
|
53
|
+
Syntax: Syntax;
|
|
54
|
+
}) => React.ReactNode;
|
|
55
|
+
location?: 'afterDemo' | 'beforeDemo';
|
|
56
|
+
};
|
|
57
|
+
|
|
62
58
|
export type ComponentVariantOverrides<Props = Record<string, unknown>, PropName extends keyof Props = keyof Props> = {
|
|
63
|
-
|
|
59
|
+
/**
|
|
60
|
+
* Hide the variant entirely by setting to false.
|
|
61
|
+
*
|
|
62
|
+
* Set specific prop overrides for the variant. e.g. when demoing iconOnly, we want to set the icon prop.
|
|
63
|
+
*/
|
|
64
|
+
[Key in PropName]?: ComponentVariantOverride<Props> | false;
|
|
64
65
|
};
|
|
65
66
|
|
|
66
67
|
export type ComponentExample<Props = Record<string, unknown>, PropName extends keyof Props = keyof Props> = {
|
|
@@ -106,16 +107,7 @@ export type ComponentExample<Props = Record<string, unknown>, PropName extends k
|
|
|
106
107
|
*/
|
|
107
108
|
disableProps?: PropName[] | true;
|
|
108
109
|
/** The sections of the example. */
|
|
109
|
-
sections?:
|
|
110
|
-
title: string;
|
|
111
|
-
content: (params: {
|
|
112
|
-
Component: React.ComponentType<Props>;
|
|
113
|
-
props: Props;
|
|
114
|
-
CodeExample: CodeExample;
|
|
115
|
-
Syntax: Syntax;
|
|
116
|
-
}) => React.ReactNode;
|
|
117
|
-
location?: 'afterDemo' | 'beforeDemo';
|
|
118
|
-
}[];
|
|
110
|
+
sections?: ComponentPageSection<Props>[];
|
|
119
111
|
};
|
|
120
112
|
|
|
121
113
|
export type Syntax = (params: {
|
|
@@ -148,6 +140,11 @@ export type ComponentExampleFn<Props = Record<string, unknown>> = (params: {
|
|
|
148
140
|
export type OnHandlers = `on${string}`;
|
|
149
141
|
|
|
150
142
|
export type Preset<Props> = {
|
|
143
|
+
/**
|
|
144
|
+
* A description of the design pattern this preset demonstrates. When applied, it showcases the specific use case or
|
|
145
|
+
* behavior of the component.
|
|
146
|
+
*/
|
|
147
|
+
designPattern?: string;
|
|
151
148
|
/** The name of the preset. This is used to display the preset in the UI. */
|
|
152
149
|
label: string;
|
|
153
150
|
/** The props of the component. This is used to set props of the component. These values can't be changed in the UI. */
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { Button } from '../Button';
|
|
3
|
-
// A button that can be used as a trailing element in a ListItem.
|
|
4
|
-
export function ListItemButton({ label, icon, ...buttonProps }) {
|
|
5
|
-
return _jsx(Button, { icon: icon, iconOnly: true, label: label, ...buttonProps, size: "large", variant: "tertiary" });
|
|
6
|
-
}
|
|
7
|
-
//# sourceMappingURL=ListItemButton.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ListItemButton.js","sourceRoot":"","sources":["../../../src/components/ListItem/ListItemButton.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAe,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE1D,iEAAiE;AACjE,MAAM,UAAU,cAAc,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,WAAW,EAAmD;IAC3G,OAAO,KAAC,MAAM,IAAC,IAAI,EAAE,IAAI,EAAE,QAAQ,QAAC,KAAK,EAAE,KAAK,KAAM,WAAW,EAAE,IAAI,EAAC,OAAO,EAAC,OAAO,EAAC,UAAU,GAAG,CAAC;AAC1G,CAAC"}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useEffect, useState } from 'react';
|
|
3
|
-
import { Input } from '../Input';
|
|
4
|
-
import { Txt } from '../Txt';
|
|
5
|
-
export const PageInput = ({ numPages, onChange, value }) => {
|
|
6
|
-
const [page, setPage] = useState(String(value));
|
|
7
|
-
useEffect(() => {
|
|
8
|
-
const stringValue = String(value);
|
|
9
|
-
if (stringValue !== page) {
|
|
10
|
-
setPage(stringValue);
|
|
11
|
-
}
|
|
12
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
13
|
-
}, [value]);
|
|
14
|
-
const handleChange = (val) => {
|
|
15
|
-
const pageNumber = parseInt(val, 10);
|
|
16
|
-
const isValidPageNumber = !isNaN(pageNumber) && pageNumber >= 1 && pageNumber <= numPages;
|
|
17
|
-
if (isValidPageNumber || val === '') {
|
|
18
|
-
setPage(val);
|
|
19
|
-
}
|
|
20
|
-
};
|
|
21
|
-
const handleSubmit = () => {
|
|
22
|
-
const pageNumber = parseInt(page, 10);
|
|
23
|
-
if (!isNaN(pageNumber) && pageNumber >= 1 && pageNumber <= numPages) {
|
|
24
|
-
onChange(pageNumber);
|
|
25
|
-
}
|
|
26
|
-
else {
|
|
27
|
-
setPage(String(value));
|
|
28
|
-
}
|
|
29
|
-
};
|
|
30
|
-
const pageCountMessage = `of ${numPages}`;
|
|
31
|
-
return (_jsx("form", { onSubmit: (e) => {
|
|
32
|
-
e.preventDefault();
|
|
33
|
-
handleSubmit();
|
|
34
|
-
}, style: { display: 'contents' }, children: _jsxs("div", { "data-bspk": "page-input", children: [_jsx(Input, { "aria-label": "Page input", name: "page-input", onBlur: handleSubmit, onChange: handleChange, showClearButton: false, size: "small", value: page }), _jsx(Txt, { variant: "body-small", children: pageCountMessage })] }) }));
|
|
35
|
-
};
|
|
36
|
-
//# sourceMappingURL=PageInput.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PageInput.js","sourceRoot":"","sources":["../../../src/components/Pagination/PageInput.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAM,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAGhD,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAC;AAIvC,MAAM,CAAC,MAAM,SAAS,GAAuB,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE,EAAE;IAC3E,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,QAAQ,CAAS,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;IAExD,SAAS,CAAC,GAAG,EAAE;QACX,MAAM,WAAW,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;QAElC,IAAI,WAAW,KAAK,IAAI,EAAE,CAAC;YACvB,OAAO,CAAC,WAAW,CAAC,CAAC;QACzB,CAAC;QACD,uDAAuD;IAC3D,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC;IAEZ,MAAM,YAAY,GAAG,CAAC,GAAW,EAAE,EAAE;QACjC,MAAM,UAAU,GAAG,QAAQ,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;QACrC,MAAM,iBAAiB,GAAG,CAAC,KAAK,CAAC,UAAU,CAAC,IAAI,UAAU,IAAI,CAAC,IAAI,UAAU,IAAI,QAAQ,CAAC;QAE1F,IAAI,iBAAiB,IAAI,GAAG,KAAK,EAAE,EAAE,CAAC;YAClC,OAAO,CAAC,GAAG,CAAC,CAAC;QACjB,CAAC;IACL,CAAC,CAAC;IAEF,MAAM,YAAY,GAAG,GAAG,EAAE;QACtB,MAAM,UAAU,GAAG,QAAQ,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;QAEtC,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,IAAI,UAAU,IAAI,CAAC,IAAI,UAAU,IAAI,QAAQ,EAAE,CAAC;YAClE,QAAQ,CAAC,UAAU,CAAC,CAAC;QACzB,CAAC;aAAM,CAAC;YACJ,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;QAC3B,CAAC;IACL,CAAC,CAAC;IAEF,MAAM,gBAAgB,GAAG,MAAM,QAAQ,EAAE,CAAC;IAE1C,OAAO,CACH,eACI,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE;YACZ,CAAC,CAAC,cAAc,EAAE,CAAC;YACnB,YAAY,EAAE,CAAC;QACnB,CAAC,EACD,KAAK,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,YAE9B,4BAAe,YAAY,aACvB,KAAC,KAAK,kBACS,YAAY,EACvB,IAAI,EAAC,YAAY,EACjB,MAAM,EAAE,YAAY,EACpB,QAAQ,EAAE,YAAY,EACtB,eAAe,EAAE,KAAK,EACtB,IAAI,EAAC,OAAO,EACZ,KAAK,EAAE,IAAI,GACb,EAEF,KAAC,GAAG,IAAC,OAAO,EAAC,YAAY,YAAE,gBAAgB,GAAO,IAChD,GACH,CACV,CAAC;AACN,CAAC,CAAC"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/** * This file is generated by the build script.
|
|
2
|
-
* Do not edit this file directly. */
|
|
3
|
-
const style = document.createElement('style');
|
|
4
|
-
style.appendChild(document.createTextNode(`[data-bspk-utility=truncated] {
|
|
5
|
-
max-width: 100%;
|
|
6
|
-
display: inline-block;
|
|
7
|
-
overflow: hidden;
|
|
8
|
-
text-overflow: ellipsis;
|
|
9
|
-
white-space: nowrap;
|
|
10
|
-
background-color: transparent;
|
|
11
|
-
}
|
|
12
|
-
`));
|
|
13
|
-
document.head.appendChild(style);
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { useState } from 'react';
|
|
2
|
-
/*
|
|
3
|
-
* A hook to manage the state of pagination.
|
|
4
|
-
|
|
5
|
-
* @param numPages - The total number of pages.
|
|
6
|
-
* @param initialPage - The initial page to start on (default is 1).
|
|
7
|
-
* @returns An object containing the current page and a function to set the current page.
|
|
8
|
-
*/
|
|
9
|
-
export const usePaginationState = (numPages, initialPage) => {
|
|
10
|
-
const [currentPage, setCurrentPage] = useState(initialPage || 1);
|
|
11
|
-
const setPage = (page) => {
|
|
12
|
-
if (page < 1 || page > numPages) {
|
|
13
|
-
return;
|
|
14
|
-
}
|
|
15
|
-
setCurrentPage(page);
|
|
16
|
-
};
|
|
17
|
-
return {
|
|
18
|
-
currentPage,
|
|
19
|
-
setCurrentPage: setPage,
|
|
20
|
-
};
|
|
21
|
-
};
|
|
22
|
-
//# sourceMappingURL=usePaginationState.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"usePaginationState.js","sourceRoot":"","sources":["../../src/hooks/usePaginationState.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEjC;;;;;;MAMM;AACN,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,QAAgB,EAAE,WAAoB,EAAE,EAAE;IACzE,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,QAAQ,CAAC,WAAW,IAAI,CAAC,CAAC,CAAC;IAEjE,MAAM,OAAO,GAAG,CAAC,IAAY,EAAE,EAAE;QAC7B,IAAI,IAAI,GAAG,CAAC,IAAI,IAAI,GAAG,QAAQ,EAAE,CAAC;YAC9B,OAAO;QACX,CAAC;QACD,cAAc,CAAC,IAAI,CAAC,CAAC;IACzB,CAAC,CAAC;IAEF,OAAO;QACH,WAAW;QACX,cAAc,EAAE,OAAO;KAC1B,CAAC;AACN,CAAC,CAAC"}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { ButtonProps, Button } from '-/components/Button';
|
|
2
|
-
|
|
3
|
-
// A button that can be used as a trailing element in a ListItem.
|
|
4
|
-
export function ListItemButton({ label, icon, ...buttonProps }: Pick<ButtonProps, 'icon' | 'label' | 'onClick'>) {
|
|
5
|
-
return <Button icon={icon} iconOnly label={label} {...buttonProps} size="large" variant="tertiary" />;
|
|
6
|
-
}
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import { FC, useEffect, useState } from 'react';
|
|
2
|
-
|
|
3
|
-
import { PaginationProps } from './Pagination';
|
|
4
|
-
import { Input } from '-/components/Input';
|
|
5
|
-
import { Txt } from '-/components/Txt';
|
|
6
|
-
|
|
7
|
-
export type PageInputProps = Pick<PaginationProps, 'numPages' | 'onChange' | 'value'>;
|
|
8
|
-
|
|
9
|
-
export const PageInput: FC<PageInputProps> = ({ numPages, onChange, value }) => {
|
|
10
|
-
const [page, setPage] = useState<string>(String(value));
|
|
11
|
-
|
|
12
|
-
useEffect(() => {
|
|
13
|
-
const stringValue = String(value);
|
|
14
|
-
|
|
15
|
-
if (stringValue !== page) {
|
|
16
|
-
setPage(stringValue);
|
|
17
|
-
}
|
|
18
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
19
|
-
}, [value]);
|
|
20
|
-
|
|
21
|
-
const handleChange = (val: string) => {
|
|
22
|
-
const pageNumber = parseInt(val, 10);
|
|
23
|
-
const isValidPageNumber = !isNaN(pageNumber) && pageNumber >= 1 && pageNumber <= numPages;
|
|
24
|
-
|
|
25
|
-
if (isValidPageNumber || val === '') {
|
|
26
|
-
setPage(val);
|
|
27
|
-
}
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
const handleSubmit = () => {
|
|
31
|
-
const pageNumber = parseInt(page, 10);
|
|
32
|
-
|
|
33
|
-
if (!isNaN(pageNumber) && pageNumber >= 1 && pageNumber <= numPages) {
|
|
34
|
-
onChange(pageNumber);
|
|
35
|
-
} else {
|
|
36
|
-
setPage(String(value));
|
|
37
|
-
}
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
const pageCountMessage = `of ${numPages}`;
|
|
41
|
-
|
|
42
|
-
return (
|
|
43
|
-
<form
|
|
44
|
-
onSubmit={(e) => {
|
|
45
|
-
e.preventDefault();
|
|
46
|
-
handleSubmit();
|
|
47
|
-
}}
|
|
48
|
-
style={{ display: 'contents' }}
|
|
49
|
-
>
|
|
50
|
-
<div data-bspk="page-input">
|
|
51
|
-
<Input
|
|
52
|
-
aria-label="Page input"
|
|
53
|
-
name="page-input"
|
|
54
|
-
onBlur={handleSubmit}
|
|
55
|
-
onChange={handleChange}
|
|
56
|
-
showClearButton={false}
|
|
57
|
-
size="small"
|
|
58
|
-
value={page}
|
|
59
|
-
/>
|
|
60
|
-
|
|
61
|
-
<Txt variant="body-small">{pageCountMessage}</Txt>
|
|
62
|
-
</div>
|
|
63
|
-
</form>
|
|
64
|
-
);
|
|
65
|
-
};
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { useState } from 'react';
|
|
2
|
-
|
|
3
|
-
/*
|
|
4
|
-
* A hook to manage the state of pagination.
|
|
5
|
-
|
|
6
|
-
* @param numPages - The total number of pages.
|
|
7
|
-
* @param initialPage - The initial page to start on (default is 1).
|
|
8
|
-
* @returns An object containing the current page and a function to set the current page.
|
|
9
|
-
*/
|
|
10
|
-
export const usePaginationState = (numPages: number, initialPage?: number) => {
|
|
11
|
-
const [currentPage, setCurrentPage] = useState(initialPage || 1);
|
|
12
|
-
|
|
13
|
-
const setPage = (page: number) => {
|
|
14
|
-
if (page < 1 || page > numPages) {
|
|
15
|
-
return;
|
|
16
|
-
}
|
|
17
|
-
setCurrentPage(page);
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
return {
|
|
21
|
-
currentPage,
|
|
22
|
-
setCurrentPage: setPage,
|
|
23
|
-
};
|
|
24
|
-
};
|