@uxf/ui 1.0.0-beta.99 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -0
- package/_file-input-base/file-input-base.d.ts +12 -0
- package/_file-input-base/file-input-base.js +32 -0
- package/_file-input-base/index.d.ts +2 -0
- package/_file-input-base/index.js +5 -0
- package/_input-with-popover/index.d.ts +2 -0
- package/_input-with-popover/index.js +5 -0
- package/_input-with-popover/input-with-popover.d.ts +27 -0
- package/_input-with-popover/input-with-popover.js +89 -0
- package/_private-utils/get-provider-config.js +1 -0
- package/_select-base/_select-base.d.ts +53 -0
- package/_select-base/_select-base.js +94 -0
- package/_select-base/index.d.ts +2 -0
- package/_select-base/index.js +5 -0
- package/avatar/avatar.js +25 -5
- package/avatar/avatar.spec.js +2 -2
- package/avatar/avatar.stories.d.ts +1 -1
- package/avatar/index.d.ts +2 -1
- package/avatar/index.js +3 -15
- package/avatar-file-input/avatar-file-input.d.ts +5 -30
- package/avatar-file-input/avatar-file-input.js +12 -34
- package/avatar-file-input/avatar-file-input.spec.d.ts +1 -0
- package/avatar-file-input/avatar-file-input.spec.js +9 -0
- package/avatar-file-input/avatar-file-input.stories.d.ts +1 -1
- package/avatar-file-input/avatar-file-input.stories.js +44 -18
- package/avatar-file-input/index.d.ts +2 -1
- package/avatar-file-input/index.js +3 -15
- package/badge/badge.d.ts +1 -1
- package/badge/badge.js +25 -5
- package/badge/badge.spec.d.ts +1 -0
- package/badge/badge.spec.js +9 -0
- package/badge/badge.stories.d.ts +1 -1
- package/badge/index.d.ts +3 -1
- package/badge/index.js +3 -15
- package/badge/theme.d.ts +1 -0
- package/button/button.d.ts +3 -3
- package/button/button.js +26 -8
- package/button/button.spec.d.ts +1 -0
- package/button/button.spec.js +9 -0
- package/button/button.stories.d.ts +2 -6
- package/button/button.stories.js +19 -17
- package/button/index.d.ts +3 -1
- package/button/index.js +3 -15
- package/button/theme.d.ts +3 -0
- package/button-group/button-group.d.ts +6 -0
- package/button-group/button-group.js +13 -0
- package/button-group/button-group.spec.d.ts +1 -0
- package/button-group/button-group.spec.js +9 -0
- package/button-group/button-group.stories.d.ts +7 -0
- package/button-group/button-group.stories.js +40 -0
- package/button-group/index.d.ts +2 -0
- package/button-group/index.js +5 -0
- package/button-list/button-list.d.ts +21 -0
- package/button-list/button-list.js +77 -0
- package/button-list/button-list.spec.d.ts +1 -0
- package/button-list/button-list.spec.js +9 -0
- package/button-list/button-list.stories.d.ts +7 -0
- package/button-list/button-list.stories.js +55 -0
- package/button-list/index.d.ts +2 -0
- package/button-list/index.js +5 -0
- package/calendar/calendar-day-cell.d.ts +7 -0
- package/{date-picker-input/date-picker-day.js → calendar/calendar-day-cell.js} +8 -9
- package/calendar/calendar-provider.d.ts +6 -0
- package/{date-picker-input/date-picker-provider.js → calendar/calendar-provider.js} +9 -9
- package/calendar/calendar.d.ts +7 -0
- package/calendar/calendar.js +53 -0
- package/calendar/calendar.stories.d.ts +10 -0
- package/calendar/calendar.stories.js +49 -0
- package/calendar/index.d.ts +1 -0
- package/{form-control → calendar}/index.js +1 -1
- package/checkbox/checkbox.d.ts +6 -7
- package/checkbox/checkbox.js +48 -13
- package/checkbox/checkbox.spec.js +2 -4
- package/checkbox/checkbox.stories.d.ts +2 -2
- package/checkbox/checkbox.stories.js +8 -6
- package/checkbox/index.d.ts +3 -1
- package/checkbox/index.js +3 -15
- package/{checkbox-visual → checkbox}/theme.d.ts +1 -0
- package/checkbox-button/checkbox-button.d.ts +3 -2
- package/checkbox-button/checkbox-button.js +26 -6
- package/checkbox-button/checkbox-button.spec.js +2 -3
- package/checkbox-button/checkbox-button.stories.d.ts +1 -1
- package/checkbox-button/checkbox-button.stories.js +8 -18
- package/checkbox-button/index.d.ts +2 -1
- package/checkbox-button/index.js +3 -15
- package/checkbox-input/checkbox-input.d.ts +12 -0
- package/checkbox-input/checkbox-input.js +37 -0
- package/checkbox-input/checkbox-input.spec.d.ts +1 -0
- package/checkbox-input/checkbox-input.spec.js +9 -0
- package/{checkbox-visual/checkbox-visual.stories.d.ts → checkbox-input/checkbox-input.stories.d.ts} +2 -2
- package/{checkbox-visual/checkbox-visual.stories.js → checkbox-input/checkbox-input.stories.js} +9 -7
- package/checkbox-input/index.d.ts +2 -0
- package/checkbox-input/index.js +5 -0
- package/chip/chip.d.ts +5 -4
- package/chip/chip.js +26 -6
- package/chip/chip.stories.d.ts +2 -6
- package/chip/chip.stories.js +2 -2
- package/chip/theme.d.ts +5 -4
- package/color-radio/color-radio.d.ts +12 -0
- package/color-radio/color-radio.js +65 -0
- package/color-radio/color-radio.spec.d.ts +1 -0
- package/color-radio/color-radio.spec.js +9 -0
- package/color-radio/color-radio.stories.d.ts +7 -0
- package/color-radio/color-radio.stories.js +31 -0
- package/color-radio/index.d.ts +2 -0
- package/color-radio/index.js +5 -0
- package/color-radio-group/color-radio-group.d.ts +3 -2
- package/color-radio-group/color-radio-group.js +12 -10
- package/color-radio-group/color-radio-group.spec.d.ts +1 -0
- package/color-radio-group/color-radio-group.spec.js +9 -0
- package/color-radio-group/color-radio-group.stories.d.ts +1 -1
- package/color-radio-group/color-radio-group.stories.js +4 -2
- package/color-radio-group/index.d.ts +2 -1
- package/color-radio-group/index.js +3 -15
- package/color-scheme/index.d.ts +1 -0
- package/color-scheme/index.js +3 -1
- package/color-scheme/use-color-scheme.d.ts +1 -0
- package/color-scheme/use-color-scheme.js +19 -0
- package/combobox/combobox.d.ts +19 -20
- package/combobox/combobox.js +19 -31
- package/combobox/combobox.spec.d.ts +1 -0
- package/combobox/combobox.spec.js +10 -0
- package/combobox/combobox.stories.d.ts +7 -4
- package/combobox/combobox.stories.js +25 -12
- package/combobox/index.d.ts +2 -1
- package/combobox/index.js +3 -15
- package/config/icons-config.d.ts +1 -1
- package/config/icons-config.js +1 -1
- package/config/icons.d.ts +41 -1
- package/config/icons.js +8 -0
- package/content/types.d.ts +3 -3
- package/context/context.d.ts +2 -1
- package/context/provider.d.ts +1 -1
- package/context/provider.js +3 -0
- package/context/use-component-context.d.ts +1 -1
- package/date-picker/date-picker-content.d.ts +2 -0
- package/{date-picker-input/date-picker.js → date-picker/date-picker-content.js} +5 -3
- package/{date-picker-input → date-picker}/date-picker-decade.js +12 -10
- package/{date-picker-input → date-picker}/date-picker-month.js +21 -15
- package/date-picker/date-picker-navigation.d.ts +9 -0
- package/date-picker/date-picker-navigation.js +19 -0
- package/{date-picker-input → date-picker}/date-picker-year.js +16 -11
- package/date-picker/date-picker.d.ts +10 -0
- package/date-picker/date-picker.js +27 -0
- package/date-picker/date-picker.spec.d.ts +1 -0
- package/date-picker/date-picker.spec.js +9 -0
- package/date-picker/date-picker.stories.d.ts +7 -0
- package/date-picker/date-picker.stories.js +43 -0
- package/date-picker/index.d.ts +3 -0
- package/date-picker/index.js +5 -0
- package/date-picker/types.d.ts +1 -0
- package/date-picker-input/date-picker-input.d.ts +9 -18
- package/date-picker-input/date-picker-input.js +54 -59
- package/date-picker-input/date-picker-input.spec.d.ts +1 -0
- package/date-picker-input/date-picker-input.spec.js +9 -0
- package/date-picker-input/date-picker-input.stories.d.ts +1 -8
- package/date-picker-input/date-picker-input.stories.js +9 -14
- package/date-picker-input/index.d.ts +2 -3
- package/date-picker-input/index.js +6 -17
- package/datetime-picker/datetime-picker.d.ts +13 -0
- package/datetime-picker/datetime-picker.js +94 -0
- package/datetime-picker/datetime-picker.spec.d.ts +1 -0
- package/datetime-picker/datetime-picker.spec.js +9 -0
- package/datetime-picker/datetime-picker.stories.d.ts +7 -0
- package/datetime-picker/datetime-picker.stories.js +43 -0
- package/datetime-picker/index.d.ts +2 -0
- package/datetime-picker/index.js +7 -0
- package/datetime-picker-input/datetime-picker-input.d.ts +12 -0
- package/datetime-picker-input/datetime-picker-input.js +81 -0
- package/datetime-picker-input/datetime-picker-input.spec.d.ts +1 -0
- package/datetime-picker-input/datetime-picker-input.spec.js +9 -0
- package/datetime-picker-input/datetime-picker-input.stories.d.ts +7 -0
- package/datetime-picker-input/datetime-picker-input.stories.js +49 -0
- package/datetime-picker-input/index.d.ts +2 -0
- package/datetime-picker-input/index.js +7 -0
- package/dropdown/dropdown.d.ts +4 -4
- package/dropdown/dropdown.js +27 -6
- package/dropdown/dropdown.spec.d.ts +1 -0
- package/dropdown/dropdown.spec.js +9 -0
- package/dropdown/dropdown.stories.d.ts +2 -2
- package/dropdown/index.d.ts +2 -1
- package/dropdown/index.js +3 -15
- package/dropzone/dropzone-input.d.ts +19 -0
- package/dropzone/dropzone-input.js +121 -0
- package/dropzone/dropzone-list.d.ts +10 -0
- package/dropzone/dropzone-list.js +92 -0
- package/dropzone/dropzone.spec.d.ts +1 -0
- package/dropzone/dropzone.spec.js +9 -0
- package/dropzone/dropzone.stories.d.ts +10 -0
- package/dropzone/dropzone.stories.js +63 -0
- package/dropzone/index.d.ts +6 -0
- package/dropzone/index.js +6 -0
- package/dropzone/types.d.ts +10 -0
- package/dropzone/types.js +2 -0
- package/error-message/error-message.d.ts +3 -4
- package/error-message/error-message.js +3 -2
- package/error-message/error-message.spec.d.ts +1 -0
- package/error-message/error-message.spec.js +9 -0
- package/error-message/error-message.stories.d.ts +3 -4
- package/error-message/index.d.ts +1 -1
- package/error-message/index.js +3 -15
- package/file-input/file-input.d.ts +12 -0
- package/file-input/file-input.js +75 -0
- package/file-input/file-input.spec.d.ts +1 -0
- package/file-input/file-input.spec.js +9 -0
- package/file-input/file-input.stories.d.ts +7 -0
- package/file-input/file-input.stories.js +50 -0
- package/file-input/index.d.ts +2 -0
- package/file-input/index.js +5 -0
- package/flash-messages/flash-message.d.ts +1 -1
- package/flash-messages/flash-message.js +1 -0
- package/flash-messages/flash-messages.js +1 -1
- package/flash-messages/flash-messages.spec.d.ts +1 -0
- package/flash-messages/flash-messages.spec.js +9 -0
- package/flash-messages/flash-messages.stories.d.ts +1 -1
- package/flash-messages/flash-messages.stories.js +12 -7
- package/flash-messages/index.d.ts +3 -0
- package/flash-messages/index.js +8 -0
- package/{form-control/form-control.d.ts → form-component/form-component.d.ts} +2 -2
- package/form-component/form-component.js +41 -0
- package/form-component/form-component.spec.d.ts +1 -0
- package/form-component/form-component.spec.js +9 -0
- package/{form-control/form-control.stories.d.ts → form-component/form-component.stories.d.ts} +2 -2
- package/form-component/form-component.stories.js +25 -0
- package/form-component/index.d.ts +2 -0
- package/form-component/index.js +5 -0
- package/hooks/use-async-loading.d.ts +4 -0
- package/hooks/use-async-loading.js +32 -0
- package/hooks/use-dropdown.d.ts +32 -2
- package/hooks/use-dropdown.js +4 -6
- package/hooks/use-input-submit.d.ts +1 -1
- package/icon/icon.d.ts +3 -3
- package/icon/icon.js +25 -5
- package/icon/icon.spec.d.ts +1 -0
- package/icon/icon.spec.js +10 -0
- package/icon/icon.stories.d.ts +6 -10
- package/icon/icon.stories.js +2 -2
- package/icon/index.d.ts +2 -1
- package/icon/index.js +3 -15
- package/icon/types.d.ts +1 -1
- package/image-gallery/components/arrow-button.d.ts +7 -0
- package/image-gallery/components/{previous-button.js → arrow-button.js} +7 -5
- package/image-gallery/components/close-button.d.ts +4 -3
- package/image-gallery/components/close-button.js +9 -5
- package/image-gallery/components/dot.d.ts +3 -3
- package/image-gallery/components/dot.js +6 -4
- package/image-gallery/components/gallery.d.ts +4 -3
- package/image-gallery/components/gallery.js +20 -20
- package/image-gallery/context.d.ts +1 -1
- package/image-gallery/image-gallery.d.ts +4 -4
- package/image-gallery/image-gallery.js +7 -8
- package/image-gallery/image-gallery.spec.d.ts +1 -0
- package/image-gallery/image-gallery.spec.js +9 -0
- package/image-gallery/image-gallery.stories.d.ts +5 -4
- package/image-gallery/image-gallery.stories.js +21 -10
- package/image-gallery/image.d.ts +2 -3
- package/image-gallery/image.js +8 -4
- package/image-gallery/index.d.ts +6 -4
- package/image-gallery/index.js +6 -24
- package/image-gallery/types.d.ts +4 -2
- package/image-gallery/use-image.js +3 -2
- package/input/index.d.ts +9 -8
- package/input/index.js +4 -2
- package/input/input-element.d.ts +2 -1
- package/input/input-element.js +28 -6
- package/input/input-left-addon.d.ts +3 -7
- package/input/input-left-addon.js +6 -4
- package/input/input-left-element.d.ts +3 -7
- package/input/input-left-element.js +3 -3
- package/input/input-remove-button.d.ts +5 -0
- package/input/input-remove-button.js +29 -0
- package/input/input-right-addon.d.ts +2 -5
- package/input/input-right-addon.js +6 -4
- package/input/input-right-element.d.ts +3 -7
- package/input/input-right-element.js +3 -3
- package/input/input.d.ts +11 -1
- package/input/input.js +23 -23
- package/input/input.spec.d.ts +1 -0
- package/input/input.spec.js +10 -0
- package/input/input.stories.d.ts +10 -9
- package/input/input.stories.js +13 -10
- package/input/theme.d.ts +2 -0
- package/label/index.d.ts +2 -1
- package/label/index.js +3 -15
- package/label/label.js +28 -6
- package/label/label.spec.d.ts +1 -0
- package/label/label.spec.js +9 -0
- package/label/label.stories.d.ts +1 -1
- package/layout/index.d.ts +2 -1
- package/layout/index.js +3 -15
- package/layout/layout.js +5 -4
- package/layout/layout.spec.d.ts +1 -0
- package/layout/layout.spec.js +9 -0
- package/layout/layout.stories.d.ts +1 -1
- package/list-item/index.d.ts +2 -1
- package/list-item/index.js +3 -15
- package/list-item/list-item.js +25 -5
- package/list-item/list-item.spec.d.ts +1 -0
- package/list-item/list-item.spec.js +9 -0
- package/list-item/list-item.stories.d.ts +1 -1
- package/list-item/list-item.stories.js +7 -5
- package/loader/index.d.ts +2 -0
- package/loader/index.js +5 -0
- package/loader/loader.d.ts +5 -2
- package/loader/loader.js +27 -6
- package/loader/loader.spec.d.ts +1 -0
- package/loader/loader.spec.js +9 -0
- package/loader/loader.stories.d.ts +2 -2
- package/loader/loader.stories.js +4 -3
- package/modal/index.d.ts +3 -0
- package/modal/index.js +9 -0
- package/modal/modal-dialog.d.ts +11 -0
- package/modal/modal-dialog.js +38 -0
- package/modal/modal-service.d.ts +5 -0
- package/modal/modal-service.js +21 -0
- package/modal/modal.d.ts +14 -0
- package/modal/modal.js +51 -0
- package/modal/modal.spec.d.ts +1 -0
- package/modal/modal.spec.js +9 -0
- package/modal/modal.stories.d.ts +7 -0
- package/modal/modal.stories.js +50 -0
- package/modal/theme.d.ts +5 -0
- package/modal/theme.js +2 -0
- package/multi-combobox/_multi-combobox-base.d.ts +8 -0
- package/multi-combobox/_multi-combobox-base.js +112 -0
- package/multi-combobox/index.d.ts +2 -0
- package/multi-combobox/index.js +5 -0
- package/multi-combobox/multi-combobox.d.ts +3 -0
- package/multi-combobox/multi-combobox.js +67 -0
- package/multi-combobox/multi-combobox.spec.d.ts +1 -0
- package/multi-combobox/multi-combobox.spec.js +10 -0
- package/multi-combobox/multi-combobox.stories.d.ts +10 -0
- package/multi-combobox/multi-combobox.stories.js +86 -0
- package/multi-combobox/types.d.ts +36 -0
- package/multi-combobox/types.js +2 -0
- package/multi-select/_multi-select-base.d.ts +8 -0
- package/multi-select/_multi-select-base.js +77 -0
- package/multi-select/index.d.ts +2 -0
- package/multi-select/index.js +5 -0
- package/multi-select/multi-select.d.ts +3 -0
- package/multi-select/multi-select.js +55 -0
- package/multi-select/multi-select.spec.d.ts +1 -0
- package/multi-select/multi-select.spec.js +9 -0
- package/multi-select/multi-select.stories.d.ts +9 -0
- package/{mutli-combobox/multi-combobox.stories.js → multi-select/multi-select.stories.js} +17 -22
- package/multi-select/types.d.ts +31 -0
- package/multi-select/types.js +2 -0
- package/package.json +11 -11
- package/pagination/index.d.ts +2 -0
- package/pagination/index.js +5 -0
- package/pagination/pagination.d.ts +3 -0
- package/pagination/pagination.js +11 -6
- package/pagination/pagination.spec.d.ts +1 -0
- package/pagination/pagination.spec.js +9 -0
- package/pagination/pagination.stories.d.ts +4 -1
- package/pagination/pagination.stories.js +23 -3
- package/pagination/theme.d.ts +7 -0
- package/pagination/theme.js +2 -0
- package/paper/index.d.ts +2 -0
- package/paper/index.js +5 -0
- package/paper/paper.d.ts +2 -2
- package/paper/paper.js +25 -5
- package/paper/paper.spec.d.ts +1 -0
- package/paper/paper.spec.js +9 -0
- package/paper/paper.stories.d.ts +2 -2
- package/radio/index.d.ts +3 -1
- package/radio/index.js +3 -15
- package/radio/radio.d.ts +9 -6
- package/radio/radio.js +45 -9
- package/radio/radio.spec.js +2 -3
- package/radio/radio.stories.d.ts +2 -2
- package/radio/radio.stories.js +12 -12
- package/radio/theme.d.ts +1 -0
- package/radio-group/index.d.ts +3 -1
- package/radio-group/index.js +3 -15
- package/radio-group/radio-group.d.ts +3 -4
- package/radio-group/radio-group.js +10 -8
- package/radio-group/radio-group.spec.js +2 -17
- package/radio-group/radio-group.stories.d.ts +1 -1
- package/radio-group/radio-group.stories.js +7 -4
- package/radio-group/theme.d.ts +2 -0
- package/raster-image/index.d.ts +2 -1
- package/raster-image/index.js +3 -15
- package/raster-image/raster-image.d.ts +3 -3
- package/raster-image/raster-image.js +2 -1
- package/raster-image/raster-image.spec.d.ts +1 -0
- package/raster-image/raster-image.spec.js +9 -0
- package/raster-image/raster-image.stories.d.ts +2 -25
- package/select/index.d.ts +2 -1
- package/select/index.js +3 -15
- package/select/select.d.ts +16 -17
- package/select/select.js +16 -52
- package/select/select.spec.d.ts +1 -0
- package/select/select.spec.js +9 -0
- package/select/select.stories.d.ts +6 -4
- package/select/select.stories.js +24 -27
- package/select/theme.d.ts +5 -0
- package/select/theme.js +2 -0
- package/tabs/index.d.ts +2 -1
- package/tabs/index.js +3 -15
- package/tabs/tabs.d.ts +2 -1
- package/tabs/tabs.js +4 -3
- package/tabs/tabs.spec.d.ts +1 -0
- package/tabs/tabs.spec.js +9 -0
- package/tabs/tabs.stories.d.ts +1 -1
- package/text-input/index.d.ts +2 -1
- package/text-input/index.js +3 -15
- package/text-input/text-input.d.ts +2 -2
- package/text-input/text-input.js +12 -19
- package/text-input/text-input.spec.js +2 -2
- package/text-input/text-input.stories.d.ts +2 -2
- package/text-input/text-input.stories.js +23 -7
- package/text-link/index.d.ts +2 -1
- package/text-link/index.js +3 -15
- package/text-link/text-link.d.ts +3 -0
- package/text-link/text-link.js +27 -7
- package/text-link/text-link.spec.d.ts +1 -0
- package/text-link/text-link.spec.js +9 -0
- package/text-link/text-link.stories.d.ts +1 -1
- package/text-link/text-link.stories.js +4 -2
- package/text-link/theme.d.ts +3 -0
- package/text-link/theme.js +2 -0
- package/textarea/index.d.ts +2 -1
- package/textarea/index.js +3 -15
- package/textarea/textarea.js +11 -19
- package/textarea/textarea.spec.d.ts +1 -0
- package/textarea/textarea.spec.js +9 -0
- package/textarea/textarea.stories.d.ts +1 -1
- package/textarea/textarea.stories.js +4 -2
- package/time-picker/index.d.ts +2 -0
- package/time-picker/index.js +5 -0
- package/{time-picker-input → time-picker}/time-picker-hour.js +2 -0
- package/{time-picker-input → time-picker}/time-picker-hours.js +1 -0
- package/time-picker/time-picker-input.spec.d.ts +1 -0
- package/time-picker/time-picker-input.spec.js +9 -0
- package/time-picker/time-picker-input.stories.d.ts +7 -0
- package/time-picker/time-picker-input.stories.js +43 -0
- package/{time-picker-input → time-picker}/time-picker-minute.js +2 -0
- package/{time-picker-input → time-picker}/time-picker-minutes.js +1 -0
- package/{time-picker-input → time-picker}/time-picker.d.ts +1 -1
- package/{time-picker-input → time-picker}/time-picker.js +2 -1
- package/time-picker-input/index.d.ts +2 -2
- package/time-picker-input/index.js +6 -16
- package/time-picker-input/time-picker-input.d.ts +7 -19
- package/time-picker-input/time-picker-input.js +51 -62
- package/time-picker-input/time-picker-input.spec.d.ts +1 -0
- package/time-picker-input/time-picker-input.spec.js +9 -0
- package/time-picker-input/time-picker-input.stories.d.ts +1 -1
- package/time-picker-input/time-picker-input.stories.js +9 -6
- package/toggle/index.d.ts +3 -1
- package/toggle/index.js +3 -15
- package/toggle/theme.d.ts +1 -0
- package/toggle/toggle.d.ts +6 -6
- package/toggle/toggle.js +26 -6
- package/toggle/toggle.spec.d.ts +1 -0
- package/toggle/toggle.spec.js +9 -0
- package/toggle/toggle.stories.d.ts +1 -1
- package/toggle/toggle.stories.js +6 -12
- package/tooltip/index.d.ts +4 -0
- package/tooltip/index.js +7 -0
- package/tooltip/tooltip.d.ts +9 -0
- package/tooltip/tooltip.js +70 -0
- package/tooltip/tooltip.spec.d.ts +1 -0
- package/tooltip/tooltip.spec.js +9 -0
- package/tooltip/tooltip.stories.d.ts +7 -0
- package/tooltip/tooltip.stories.js +19 -0
- package/tooltip/use-tooltip.d.ts +43 -0
- package/tooltip/use-tooltip.js +36 -0
- package/tw-tokens/tw-box-shadow.d.ts +1 -1
- package/tw-tokens/tw-colors.d.ts +27 -1
- package/tw-tokens/tw-colors.js +26 -0
- package/tw-tokens/tw-containers.d.ts +1 -1
- package/tw-tokens/tw-font-size.d.ts +1 -1
- package/tw-tokens/tw-font-weight.d.ts +1 -1
- package/tw-tokens/tw-line-height.d.ts +1 -1
- package/tw-tokens/tw-screens.d.ts +1 -1
- package/tw-tokens/tw-spacing.d.ts +1 -1
- package/tw-tokens/tw-z-index.d.ts +1 -1
- package/types/color.d.ts +2 -2
- package/types/file-response.d.ts +12 -0
- package/types/file-response.js +2 -0
- package/types/form-control-props.d.ts +10 -6
- package/types/index.d.ts +1 -0
- package/types/index.js +1 -0
- package/typography/typography.spec.js +2 -14
- package/typography/typography.stories.d.ts +2 -2
- package/utils/component-structure-analyzer.d.ts +2 -2
- package/utils/files/get-file-url.d.ts +2 -0
- package/utils/files/get-file-url.js +7 -0
- package/utils/icons-config.js +40 -0
- package/utils/mocks/uploadFIle.mock.d.ts +2 -0
- package/utils/mocks/uploadFIle.mock.js +46 -0
- package/utils/snap-test.js +5 -0
- package/utils/storybook-config.d.ts +2 -2
- package/utils/storybook-config.js +1 -1
- package/utils/tailwind-config.js +17 -74
- package/utils/tailwind-plugins/container.js +39 -0
- package/utils/tailwind-plugins/variants.js +15 -0
- package/utils/tailwind-theme-defaults.js +20 -0
- package/checkbox-visual/checkbox-visual.d.ts +0 -10
- package/checkbox-visual/checkbox-visual.js +0 -17
- package/checkbox-visual/index.d.ts +0 -1
- package/checkbox-visual/index.js +0 -17
- package/color-radio-group/color-radio.d.ts +0 -7
- package/color-radio-group/color-radio.js +0 -22
- package/css/avatar-file-input.css +0 -7
- package/css/avatar.css +0 -15
- package/css/badge.css +0 -23
- package/css/button.css +0 -221
- package/css/button.old.css +0 -231
- package/css/checkbox-button.css +0 -98
- package/css/checkbox.css +0 -147
- package/css/chip.css +0 -171
- package/css/chip.old.css +0 -37
- package/css/color-radio-group.css +0 -21
- package/css/color-radio.css +0 -21
- package/css/combobox.css +0 -108
- package/css/combobox.old.css +0 -102
- package/css/component-structure-analyzer.css +0 -31
- package/css/date-picker-input.css +0 -135
- package/css/date-picker.css +0 -90
- package/css/dropdown.css +0 -24
- package/css/dropdown.old.css +0 -24
- package/css/error-message.css +0 -3
- package/css/flash-messages.css +0 -28
- package/css/form-control.css +0 -7
- package/css/icon.css +0 -7
- package/css/input-basic.css +0 -18
- package/css/input.css +0 -205
- package/css/input.old.css +0 -193
- package/css/label.css +0 -15
- package/css/layout.css +0 -47
- package/css/list-item.css +0 -29
- package/css/loader.css +0 -11
- package/css/multi-combobox.css +0 -72
- package/css/pagination.css +0 -28
- package/css/paper.css +0 -3
- package/css/radio-group.css +0 -160
- package/css/radio.css +0 -105
- package/css/raster-image.css +0 -20
- package/css/select.css +0 -72
- package/css/select.old.css +0 -66
- package/css/tabs.css +0 -131
- package/css/text-link.css +0 -12
- package/css/textarea.css +0 -117
- package/css/time-picker-input.css +0 -138
- package/css/time-picker.css +0 -27
- package/css/toggle.css +0 -80
- package/css/typography.css +0 -51
- package/date-picker-input/date-picker-day.d.ts +0 -8
- package/date-picker-input/date-picker-provider.d.ts +0 -8
- package/date-picker-input/date-picker.d.ts +0 -3
- package/date-picker-input/types.d.ts +0 -5
- package/form-control/form-control.js +0 -19
- package/form-control/form-control.stories.js +0 -25
- package/form-control/index.d.ts +0 -1
- package/image-gallery/components/next-button.d.ts +0 -6
- package/image-gallery/components/next-button.js +0 -12
- package/image-gallery/components/previous-button.d.ts +0 -6
- package/mutli-combobox/index.d.ts +0 -1
- package/mutli-combobox/index.js +0 -17
- package/mutli-combobox/multi-combobox.d.ts +0 -27
- package/mutli-combobox/multi-combobox.js +0 -94
- package/mutli-combobox/multi-combobox.stories.d.ts +0 -10
- /package/{checkbox-visual → checkbox}/theme.js +0 -0
- /package/{date-picker-input → date-picker}/date-picker-decade.d.ts +0 -0
- /package/{date-picker-input → date-picker}/date-picker-month.d.ts +0 -0
- /package/{date-picker-input → date-picker}/date-picker-year.d.ts +0 -0
- /package/{date-picker-input → date-picker}/types.js +0 -0
- /package/{time-picker-input → time-picker}/time-picker-hour.d.ts +0 -0
- /package/{time-picker-input → time-picker}/time-picker-hours.d.ts +0 -0
- /package/{time-picker-input → time-picker}/time-picker-minute.d.ts +0 -0
- /package/{time-picker-input → time-picker}/time-picker-minutes.d.ts +0 -0
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.MultiCombobox = void 0;
|
|
27
|
+
const react_1 = require("@headlessui/react");
|
|
28
|
+
const classes_1 = require("@uxf/core/constants/classes");
|
|
29
|
+
const cx_1 = require("@uxf/core/utils/cx");
|
|
30
|
+
const form_component_1 = require("../form-component");
|
|
31
|
+
const icon_1 = require("@uxf/ui/icon");
|
|
32
|
+
const react_2 = __importStar(require("react"));
|
|
33
|
+
const _multi_combobox_base_1 = require("./_multi-combobox-base");
|
|
34
|
+
exports.MultiCombobox = (0, react_2.forwardRef)((props, ref) => {
|
|
35
|
+
var _a, _b, _c;
|
|
36
|
+
const generatedId = (0, react_2.useId)();
|
|
37
|
+
const id = (_a = props.id) !== null && _a !== void 0 ? _a : generatedId;
|
|
38
|
+
const errorId = props.isInvalid ? `${id}--error-message` : undefined;
|
|
39
|
+
const fakeInputId = `${id}--fake-input`;
|
|
40
|
+
const iconName = (_b = props.iconName) !== null && _b !== void 0 ? _b : "caretDown";
|
|
41
|
+
const selectedOptions = (_c = props.value) !== null && _c !== void 0 ? _c : [];
|
|
42
|
+
const fakeInputRef = (0, react_2.useRef)(null);
|
|
43
|
+
const handlePopoverButtonKeyPress = (e) => {
|
|
44
|
+
var _a;
|
|
45
|
+
if (e.key.length === 1 || e.key === "Backspace" || e.key === "Delete") {
|
|
46
|
+
(_a = fakeInputRef.current) === null || _a === void 0 ? void 0 : _a.click();
|
|
47
|
+
e.stopPropagation();
|
|
48
|
+
if (e.key === "Backspace" || e.key === "Delete" || e.key === " ") {
|
|
49
|
+
e.preventDefault();
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
if (!props.withPopover) {
|
|
54
|
+
return react_2.default.createElement(_multi_combobox_base_1._MultiComboboxBase, { ...props, errorId: errorId, ref: ref });
|
|
55
|
+
}
|
|
56
|
+
return (react_2.default.createElement(form_component_1.FormComponent, { className: (0, cx_1.cx)(props.isDisabled && classes_1.CLASSES.IS_DISABLED, props.isInvalid && classes_1.CLASSES.IS_INVALID, props.isReadOnly && classes_1.CLASSES.IS_READONLY), errorId: errorId, form: props.form, helperText: props.helperText, inputId: fakeInputId, isRequired: props.isRequired, label: props.label },
|
|
57
|
+
react_2.default.createElement(react_1.Popover, { className: (0, cx_1.cx)("uxf-multi-combobox", props.isInvalid && classes_1.CLASSES.IS_INVALID, props.isRequired && classes_1.CLASSES.IS_REQUIRED, props.isReadOnly && classes_1.CLASSES.IS_READONLY, props.isDisabled && classes_1.CLASSES.IS_DISABLED, props.className) }, (popoverRenderProps) => (react_2.default.createElement(react_2.default.Fragment, null,
|
|
58
|
+
react_2.default.createElement(react_1.Popover.Button, { className: (0, cx_1.cx)("uxf-multi-combobox__button uxf-multi-combobox__button--with-popover", popoverRenderProps.open && classes_1.CLASSES.IS_OPEN, props.isReadOnly && classes_1.CLASSES.IS_READONLY, props.isInvalid && classes_1.CLASSES.IS_INVALID), id: fakeInputId, onKeyDown: handlePopoverButtonKeyPress, ref: fakeInputRef },
|
|
59
|
+
react_2.default.createElement("span", { className: (0, cx_1.cx)("uxf-multi-combobox__input uxf-multi-combobox__input--with-popover", selectedOptions.length === 0 &&
|
|
60
|
+
"uxf-multi-combobox__input-placeholder--with-popover") }, selectedOptions.length > 0
|
|
61
|
+
? selectedOptions.map((e) => e.label).join(", ")
|
|
62
|
+
: props.placeholder),
|
|
63
|
+
react_2.default.createElement(icon_1.Icon, { className: "uxf-select-base__arrow-icon", name: iconName })),
|
|
64
|
+
react_2.default.createElement(react_1.Popover.Panel, { className: "uxf-multi-combobox__popover-panel", focus: popoverRenderProps.open, unmount: false },
|
|
65
|
+
react_2.default.createElement(_multi_combobox_base_1._MultiComboboxBase, { ...props, errorId: errorId, isPopoverOpen: popoverRenderProps.open, ref: ref, withPopover: true })))))));
|
|
66
|
+
});
|
|
67
|
+
exports.MultiCombobox.displayName = "UxfUiMultiCombobox";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const react_1 = __importDefault(require("react"));
|
|
7
|
+
const snap_test_1 = require("../utils/snap-test");
|
|
8
|
+
const multi_combobox_stories_1 = require("./multi-combobox.stories");
|
|
9
|
+
(0, snap_test_1.snapTest)("render default stories", react_1.default.createElement(multi_combobox_stories_1.Default, null));
|
|
10
|
+
(0, snap_test_1.snapTest)("render async stories", react_1.default.createElement(multi_combobox_stories_1.Async, null));
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { MultiComboboxOption } from "./types";
|
|
3
|
+
declare const _default: {
|
|
4
|
+
title: string;
|
|
5
|
+
component: React.ForwardRefExoticComponent<import("./types").MultiComboboxProps<import("./types").MultiComboboxValueId, MultiComboboxOption<import("./types").MultiComboboxValueId>> & React.RefAttributes<HTMLInputElement>>;
|
|
6
|
+
};
|
|
7
|
+
export default _default;
|
|
8
|
+
export declare function Default(): React.JSX.Element;
|
|
9
|
+
export declare function Async(): React.JSX.Element;
|
|
10
|
+
export declare function ComponentStructure(): React.JSX.Element;
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
+
};
|
|
28
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
+
exports.ComponentStructure = exports.Async = exports.Default = void 0;
|
|
30
|
+
const react_1 = __importStar(require("react"));
|
|
31
|
+
const component_structure_analyzer_1 = __importDefault(require("../utils/component-structure-analyzer"));
|
|
32
|
+
const multi_combobox_1 = require("./multi-combobox");
|
|
33
|
+
const action_1 = require("../utils/action");
|
|
34
|
+
exports.default = {
|
|
35
|
+
title: "UI/MultiCombobox",
|
|
36
|
+
component: multi_combobox_1.MultiCombobox,
|
|
37
|
+
};
|
|
38
|
+
const options = [
|
|
39
|
+
{ id: "one", label: "Option red", color: "red" },
|
|
40
|
+
{ id: "two", label: "Option blue", color: "blue" },
|
|
41
|
+
{ id: "three", label: "Option green", color: "green" },
|
|
42
|
+
{ id: "four", label: "Option four" },
|
|
43
|
+
{ id: "five", label: "Option five" },
|
|
44
|
+
{ id: "six", label: "Option with diacritics (ěščřžýáíé)" },
|
|
45
|
+
];
|
|
46
|
+
function Default() {
|
|
47
|
+
const [value, setValue] = (0, react_1.useState)(null);
|
|
48
|
+
const onChange = (0, action_1.action)("onChange", (v) => {
|
|
49
|
+
// eslint-disable-next-line no-console
|
|
50
|
+
console.log("Select values: ", v);
|
|
51
|
+
setValue(v);
|
|
52
|
+
});
|
|
53
|
+
const storyComboboxes = (react_1.default.createElement("div", { className: "space-y-8" },
|
|
54
|
+
react_1.default.createElement(multi_combobox_1.MultiCombobox, { id: "multi-combobox-1", label: "MultiCombobox", name: "multi-combobox", onChange: onChange, options: options, placeholder: "Vyberte pros\u00EDm jednu nebo v\u00EDce mo\u017Enost\u00ED", value: value }),
|
|
55
|
+
react_1.default.createElement(multi_combobox_1.MultiCombobox, { id: "multi-combobox-2", label: "MultiCombobox with checkboxes", name: "multi-combobox", onChange: onChange, options: options, placeholder: "Vyberte...", value: value, withCheckboxes: true }),
|
|
56
|
+
react_1.default.createElement(multi_combobox_1.MultiCombobox, { dropdownPlacement: "top", id: "multi-combobox-3", label: "MultiCombobox with popover", name: "multi-combobox", onChange: onChange, options: options, placeholder: "Vyberte...", value: value, withPopover: true }),
|
|
57
|
+
react_1.default.createElement(multi_combobox_1.MultiCombobox, { id: "multi-combobox-4", label: "MultiCombobox with popup and checkboxes", name: "multi-combobox", onChange: onChange, options: options, placeholder: "Vyberte...", value: value, withCheckboxes: true, withPopover: true }),
|
|
58
|
+
react_1.default.createElement(multi_combobox_1.MultiCombobox, { helperText: "Start typing to see options...", id: "multi-combobox-5", label: "MultiCombobox with helper text", name: "multi-combobox", onChange: onChange, options: options, placeholder: "Vyberte...", value: value }),
|
|
59
|
+
react_1.default.createElement(multi_combobox_1.MultiCombobox, { helperText: "Error message", id: "multi-combobox-6", isInvalid: true, isRequired: true, label: "MultiCombobox invalid", name: "multi-combobox", onChange: onChange, options: options, placeholder: "Vyberte...", value: value }),
|
|
60
|
+
react_1.default.createElement(multi_combobox_1.MultiCombobox, { dropdownPlacement: "top", id: "multi-combobox-7", label: "MultiCombobox with dropdown top", name: "multi-combobox", onChange: onChange, options: options, placeholder: "Vyberte...", value: value })));
|
|
61
|
+
return (react_1.default.createElement("div", { className: "flex flex-col lg:flex-row" },
|
|
62
|
+
react_1.default.createElement("div", { className: "light space-y-2 p-20 lg:w-1/2" }, storyComboboxes),
|
|
63
|
+
react_1.default.createElement("div", { className: "dark space-y-2 bg-gray-900 p-20 lg:w-1/2" }, storyComboboxes)));
|
|
64
|
+
}
|
|
65
|
+
exports.Default = Default;
|
|
66
|
+
function Async() {
|
|
67
|
+
const [value, setValue] = (0, react_1.useState)(null);
|
|
68
|
+
const onChange = (0, action_1.action)("onChange", (v) => {
|
|
69
|
+
// eslint-disable-next-line no-console
|
|
70
|
+
console.log("Select values: ", v);
|
|
71
|
+
setValue(v);
|
|
72
|
+
});
|
|
73
|
+
const loadOptions = (query) => Promise.resolve(options.filter((option) => !query || option.label.toLowerCase().includes(query.toLowerCase())));
|
|
74
|
+
const storyComboboxes = (react_1.default.createElement("div", { className: "space-y-8" },
|
|
75
|
+
react_1.default.createElement(multi_combobox_1.MultiCombobox, { id: "multi-combobox-async-1", label: "MultiCombobox", name: "multi-combobox", onChange: onChange, loadOptions: loadOptions, placeholder: "Vyberte...", value: value })));
|
|
76
|
+
return (react_1.default.createElement("div", { className: "flex flex-col lg:flex-row" },
|
|
77
|
+
react_1.default.createElement("div", { className: "light space-y-2 p-20 lg:w-1/2" }, storyComboboxes),
|
|
78
|
+
react_1.default.createElement("div", { className: "dark space-y-2 bg-gray-900 p-20 lg:w-1/2" }, storyComboboxes)));
|
|
79
|
+
}
|
|
80
|
+
exports.Async = Async;
|
|
81
|
+
function ComponentStructure() {
|
|
82
|
+
const [value, onChange] = (0, react_1.useState)(null);
|
|
83
|
+
return (react_1.default.createElement(component_structure_analyzer_1.default, null,
|
|
84
|
+
react_1.default.createElement(multi_combobox_1.MultiCombobox, { id: "multi-combobox-structure", name: "multi-combobox", label: "MultiCombobox with helper text", options: options, onChange: onChange, value: value, helperText: "Start typing to see options..." })));
|
|
85
|
+
}
|
|
86
|
+
exports.ComponentStructure = ComponentStructure;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { Placement, Strategy } from "@floating-ui/react";
|
|
2
|
+
import { ReactNode } from "react";
|
|
3
|
+
import { ChipColor } from "../chip";
|
|
4
|
+
import { IconsSet } from "../icon/theme";
|
|
5
|
+
import { FormControlProps } from "../types";
|
|
6
|
+
export type MultiComboboxValueId = number | string;
|
|
7
|
+
export type MultiComboboxValue<ValueId = MultiComboboxValueId> = {
|
|
8
|
+
id: ValueId;
|
|
9
|
+
label: string;
|
|
10
|
+
};
|
|
11
|
+
export interface MultiComboboxOption<ValueId = MultiComboboxValueId> extends MultiComboboxValue<ValueId> {
|
|
12
|
+
color?: ChipColor;
|
|
13
|
+
disabled?: boolean;
|
|
14
|
+
}
|
|
15
|
+
export interface MultiComboboxProps<ValueId = MultiComboboxValueId, Option = MultiComboboxOption<ValueId>> extends FormControlProps<Option[] | null> {
|
|
16
|
+
allOptionsSelectedMessage?: string;
|
|
17
|
+
className?: string;
|
|
18
|
+
dropdownPlacement?: Placement;
|
|
19
|
+
dropdownStrategy?: Strategy;
|
|
20
|
+
form?: string;
|
|
21
|
+
helperText?: ReactNode;
|
|
22
|
+
hiddenLabel?: boolean;
|
|
23
|
+
iconName?: keyof IconsSet;
|
|
24
|
+
id?: string;
|
|
25
|
+
keyExtractor?: (option: Option) => string | number;
|
|
26
|
+
label: string;
|
|
27
|
+
loadOptions?: (query: string) => Promise<Option[]>;
|
|
28
|
+
noQueryMessage?: string;
|
|
29
|
+
notFoundMessage?: string;
|
|
30
|
+
options?: Option[];
|
|
31
|
+
placeholder?: string;
|
|
32
|
+
renderOption?: (option: Option) => ReactNode;
|
|
33
|
+
withCheckboxes?: boolean;
|
|
34
|
+
withPopover?: boolean;
|
|
35
|
+
}
|
|
36
|
+
export type MultiComboboxRef = HTMLInputElement;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { MultiSelectProps } from "./types";
|
|
3
|
+
interface Props extends MultiSelectProps {
|
|
4
|
+
errorId?: string;
|
|
5
|
+
isPopoverOpen?: boolean;
|
|
6
|
+
}
|
|
7
|
+
export declare const _MultiSelectBase: React.ForwardRefExoticComponent<Props & React.RefAttributes<HTMLDivElement>>;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports._MultiSelectBase = void 0;
|
|
27
|
+
const react_1 = require("@headlessui/react");
|
|
28
|
+
const classes_1 = require("@uxf/core/constants/classes");
|
|
29
|
+
const useInputFocus_1 = require("@uxf/core/hooks/useInputFocus");
|
|
30
|
+
const composeRefs_1 = require("@uxf/core/utils/composeRefs");
|
|
31
|
+
const cx_1 = require("@uxf/core/utils/cx");
|
|
32
|
+
const icon_1 = require("@uxf/ui//icon");
|
|
33
|
+
const chip_1 = require("@uxf/ui/chip");
|
|
34
|
+
const use_dropdown_1 = require("@uxf/ui/hooks/use-dropdown");
|
|
35
|
+
const label_1 = require("@uxf/ui/label");
|
|
36
|
+
const react_2 = __importStar(require("react"));
|
|
37
|
+
const react_3 = require("@floating-ui/react");
|
|
38
|
+
exports._MultiSelectBase = (0, react_2.forwardRef)((props, ref) => {
|
|
39
|
+
var _a, _b, _c;
|
|
40
|
+
const innerRef = (0, react_2.useRef)(null);
|
|
41
|
+
const input = (0, useInputFocus_1.useInputFocus)(innerRef, props.onBlur, props.onFocus);
|
|
42
|
+
const dropdown = (0, use_dropdown_1.useDropdown)((_a = props.dropdownPlacement) !== null && _a !== void 0 ? _a : "bottom", true, props.dropdownStrategy);
|
|
43
|
+
const stableRef = (0, react_2.useMemo)(() => (0, composeRefs_1.composeRefs)(innerRef, ref, dropdown.refs.setReference), [ref, dropdown.refs.setReference]);
|
|
44
|
+
const iconName = (_b = props.iconName) !== null && _b !== void 0 ? _b : "caretDown";
|
|
45
|
+
const selectedOptions = (_c = props.value) !== null && _c !== void 0 ? _c : [];
|
|
46
|
+
const filteredOptions = props.options.filter((option) => !selectedOptions.map((i) => i.id).includes(option.id));
|
|
47
|
+
const handleSelectValueChange = (v) => {
|
|
48
|
+
props.onChange(v.map((option) => option));
|
|
49
|
+
};
|
|
50
|
+
const handleRemove = (valueId) => (e) => {
|
|
51
|
+
var _a, _b;
|
|
52
|
+
e.preventDefault();
|
|
53
|
+
e.stopPropagation();
|
|
54
|
+
props.onChange((_b = (_a = props.value) === null || _a === void 0 ? void 0 : _a.filter((v) => v.id !== valueId)) !== null && _b !== void 0 ? _b : []);
|
|
55
|
+
};
|
|
56
|
+
const withoutPopover = !props.withPopover;
|
|
57
|
+
return (react_2.default.createElement(react_1.Listbox, { as: "div", className: (0, cx_1.cx)(withoutPopover && "uxf-form-component", "uxf-multi-combobox", props.isInvalid && classes_1.CLASSES.IS_INVALID, props.isRequired && classes_1.CLASSES.IS_REQUIRED, props.isReadOnly && classes_1.CLASSES.IS_READONLY, props.isDisabled && classes_1.CLASSES.IS_DISABLED, props.className), disabled: props.isDisabled || props.isReadOnly, multiple: true, onChange: handleSelectValueChange, value: selectedOptions }, (renderProps) => {
|
|
58
|
+
const inputElement = (react_2.default.createElement(react_2.default.Fragment, null,
|
|
59
|
+
react_2.default.createElement(react_1.Listbox.Button, { "aria-invalid": props.isInvalid, "aria-describedby": props.errorId, as: "div", className: (0, cx_1.cx)("uxf-multi-combobox__button", (renderProps.open || input.focused) && classes_1.CLASSES.IS_FOCUSED, renderProps.disabled && classes_1.CLASSES.IS_DISABLED, props.isReadOnly && classes_1.CLASSES.IS_READONLY, props.isInvalid && classes_1.CLASSES.IS_INVALID, dropdown.placement === "bottom" && `${classes_1.CLASSES.IS_OPEN}--bottom`, dropdown.placement === "top" && `${classes_1.CLASSES.IS_OPEN}--top`, renderProps.open && classes_1.CLASSES.IS_OPEN), onBlur: input.onBlur, onFocus: input.onFocus, tabIndex: props.isDisabled || props.isReadOnly ? undefined : 0, ref: stableRef },
|
|
60
|
+
react_2.default.createElement("div", { className: (0, cx_1.cx)("uxf-multi-select__input", selectedOptions.length === 0 && "uxf-multi-select__input--is-empty") }, selectedOptions.length === 0
|
|
61
|
+
? props.placeholder
|
|
62
|
+
: selectedOptions.map((item) => (react_2.default.createElement(chip_1.Chip, { className: "uxf-multi-combobox__input-chip", color: item.color, key: item.id, onClose: handleRemove(item.id), size: "large", suppressFocus: true }, item.label)))),
|
|
63
|
+
react_2.default.createElement(icon_1.Icon, { className: (0, cx_1.cx)("uxf-select-base__arrow-icon", renderProps.open && classes_1.CLASSES.IS_OPEN), name: iconName })),
|
|
64
|
+
renderProps.open && (react_2.default.createElement(react_3.FloatingPortal, null,
|
|
65
|
+
react_2.default.createElement(react_1.Listbox.Options, { className: (0, cx_1.cx)("uxf-dropdown", dropdown.placement === "bottom" && "uxf-dropdown--bottom", dropdown.placement === "top" && "uxf-dropdown--top"), ref: dropdown.refs.setFloating, static: true, style: dropdown.floatingStyles }, filteredOptions.map((option) => {
|
|
66
|
+
var _a;
|
|
67
|
+
const optionKey = (_a = props.keyExtractor) === null || _a === void 0 ? void 0 : _a.call(props, option);
|
|
68
|
+
return (react_2.default.createElement(react_1.Listbox.Option, { className: (optionState) => (0, cx_1.cx)("uxf-dropdown__item uxf-multi-select__dropdown-item", optionState.active && classes_1.CLASSES.IS_ACTIVE, optionState.disabled && classes_1.CLASSES.IS_DISABLED, optionState.selected && classes_1.CLASSES.IS_SELECTED), key: optionKey !== null && optionKey !== void 0 ? optionKey : option.id, value: option }, optionKey !== null && optionKey !== void 0 ? optionKey : option.label));
|
|
69
|
+
})))),
|
|
70
|
+
props.helperText && withoutPopover && (react_2.default.createElement("div", { className: (0, cx_1.cx)("uxf-helper-text", props.isInvalid && classes_1.CLASSES.IS_INVALID), id: props.errorId }, props.helperText))));
|
|
71
|
+
return (react_2.default.createElement(react_2.default.Fragment, null, withoutPopover ? (react_2.default.createElement(react_2.default.Fragment, null,
|
|
72
|
+
react_2.default.createElement("div", { className: "uxf-form-component__label" },
|
|
73
|
+
react_2.default.createElement(react_1.Listbox.Label, { as: label_1.Label, isHidden: props.hiddenLabel, onClick: props.isDisabled || props.isReadOnly ? undefined : input.focus }, props.label)),
|
|
74
|
+
react_2.default.createElement("div", { className: "uxf-form-component__input" }, inputElement))) : (inputElement)));
|
|
75
|
+
}));
|
|
76
|
+
});
|
|
77
|
+
exports._MultiSelectBase.displayName = "UxfUiMultiSelectBase";
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MultiSelect = void 0;
|
|
4
|
+
var multi_select_1 = require("./multi-select");
|
|
5
|
+
Object.defineProperty(exports, "MultiSelect", { enumerable: true, get: function () { return multi_select_1.MultiSelect; } });
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { MultiSelectProps } from "./types";
|
|
3
|
+
export declare const MultiSelect: React.ForwardRefExoticComponent<MultiSelectProps<import("./types").MultiSelectValueId, import("./types").MultiSelectOption<import("./types").MultiSelectValueId>> & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.MultiSelect = void 0;
|
|
27
|
+
const react_1 = require("@headlessui/react");
|
|
28
|
+
const classes_1 = require("@uxf/core/constants/classes");
|
|
29
|
+
const cx_1 = require("@uxf/core/utils/cx");
|
|
30
|
+
const form_component_1 = require("../form-component");
|
|
31
|
+
const icon_1 = require("@uxf/ui/icon");
|
|
32
|
+
const react_2 = __importStar(require("react"));
|
|
33
|
+
const _multi_select_base_1 = require("./_multi-select-base");
|
|
34
|
+
exports.MultiSelect = (0, react_2.forwardRef)((props, ref) => {
|
|
35
|
+
var _a, _b, _c;
|
|
36
|
+
const generatedId = (0, react_2.useId)();
|
|
37
|
+
const id = (_a = props.id) !== null && _a !== void 0 ? _a : generatedId;
|
|
38
|
+
const errorId = props.isInvalid ? `${id}--error-message` : undefined;
|
|
39
|
+
const iconName = (_b = props.iconName) !== null && _b !== void 0 ? _b : "caretDown";
|
|
40
|
+
const selectedOptions = (_c = props.value) !== null && _c !== void 0 ? _c : [];
|
|
41
|
+
if (!props.withPopover) {
|
|
42
|
+
return react_2.default.createElement(_multi_select_base_1._MultiSelectBase, { ...props, errorId: errorId, id: id, ref: ref });
|
|
43
|
+
}
|
|
44
|
+
return (react_2.default.createElement(form_component_1.FormComponent, { className: (0, cx_1.cx)(props.isDisabled && classes_1.CLASSES.IS_DISABLED, props.isInvalid && classes_1.CLASSES.IS_INVALID, props.isReadOnly && classes_1.CLASSES.IS_READONLY), errorId: errorId, form: props.form, helperText: props.helperText, inputId: id, isRequired: props.isRequired, label: props.label },
|
|
45
|
+
react_2.default.createElement(react_1.Popover, { className: (0, cx_1.cx)("uxf-multi-combobox", props.isInvalid && classes_1.CLASSES.IS_INVALID, props.isRequired && classes_1.CLASSES.IS_REQUIRED, props.isReadOnly && classes_1.CLASSES.IS_READONLY, props.isDisabled && classes_1.CLASSES.IS_DISABLED, props.className) }, (popoverRenderProps) => (react_2.default.createElement(react_2.default.Fragment, null,
|
|
46
|
+
react_2.default.createElement(react_1.Popover.Button, { className: (0, cx_1.cx)("uxf-multi-combobox__button uxf-multi-combobox__button--with-popover", popoverRenderProps.open && classes_1.CLASSES.IS_OPEN, props.isReadOnly && classes_1.CLASSES.IS_READONLY, props.isInvalid && classes_1.CLASSES.IS_INVALID) },
|
|
47
|
+
react_2.default.createElement("span", { className: (0, cx_1.cx)("uxf-multi-combobox__input uxf-multi-combobox__input--with-popover", selectedOptions.length === 0 &&
|
|
48
|
+
"uxf-multi-combobox__input-placeholder--with-popover") }, selectedOptions.length > 0
|
|
49
|
+
? selectedOptions.map((e) => e.label).join(", ")
|
|
50
|
+
: props.placeholder),
|
|
51
|
+
react_2.default.createElement(icon_1.Icon, { className: "uxf-select-base__arrow-icon", name: iconName })),
|
|
52
|
+
react_2.default.createElement(react_1.Popover.Panel, { className: "uxf-multi-combobox__popover-panel", focus: popoverRenderProps.open, unmount: false },
|
|
53
|
+
react_2.default.createElement(_multi_select_base_1._MultiSelectBase, { ...props, errorId: errorId, isPopoverOpen: popoverRenderProps.open, ref: ref, withPopover: true })))))));
|
|
54
|
+
});
|
|
55
|
+
exports.MultiSelect.displayName = "UxfUiMultiSelect";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const react_1 = __importDefault(require("react"));
|
|
7
|
+
const snap_test_1 = require("../utils/snap-test");
|
|
8
|
+
const multi_select_stories_1 = require("./multi-select.stories");
|
|
9
|
+
(0, snap_test_1.snapTest)("render stories", react_1.default.createElement(multi_select_stories_1.Default, null));
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { MultiSelectOption } from "./types";
|
|
3
|
+
declare const _default: {
|
|
4
|
+
title: string;
|
|
5
|
+
component: React.ForwardRefExoticComponent<import("./types").MultiSelectProps<import("./types").MultiSelectValueId, MultiSelectOption<import("./types").MultiSelectValueId>> & React.RefAttributes<HTMLDivElement>>;
|
|
6
|
+
};
|
|
7
|
+
export default _default;
|
|
8
|
+
export declare const Default: () => React.JSX.Element;
|
|
9
|
+
export declare function ComponentStructure(): React.JSX.Element;
|
|
@@ -27,12 +27,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
27
27
|
};
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
29
|
exports.ComponentStructure = exports.Default = void 0;
|
|
30
|
+
const component_structure_analyzer_1 = __importDefault(require("@uxf/ui/utils/component-structure-analyzer"));
|
|
30
31
|
const react_1 = __importStar(require("react"));
|
|
31
|
-
const component_structure_analyzer_1 = __importDefault(require("../utils/component-structure-analyzer"));
|
|
32
32
|
const index_1 = require("./index");
|
|
33
|
+
const action_1 = require("../utils/action");
|
|
33
34
|
exports.default = {
|
|
34
|
-
title: "UI/
|
|
35
|
-
component: index_1.
|
|
35
|
+
title: "UI/MultiSelect",
|
|
36
|
+
component: index_1.MultiSelect,
|
|
36
37
|
};
|
|
37
38
|
const options = [
|
|
38
39
|
{ id: "one", label: "Option red", color: "red" },
|
|
@@ -42,30 +43,24 @@ const options = [
|
|
|
42
43
|
{ id: "five", label: "Option five" },
|
|
43
44
|
{ id: "six", label: "Option with diacritics (ěščřžýáíé)" },
|
|
44
45
|
];
|
|
45
|
-
|
|
46
|
-
const [
|
|
47
|
-
const
|
|
46
|
+
const Default = () => {
|
|
47
|
+
const [value, setValue] = (0, react_1.useState)(null);
|
|
48
|
+
const onChange = (0, action_1.action)("onChange", (v) => {
|
|
48
49
|
// eslint-disable-next-line no-console
|
|
49
50
|
console.log("Select values: ", v);
|
|
50
|
-
|
|
51
|
-
};
|
|
52
|
-
const
|
|
53
|
-
react_1.default.createElement(index_1.
|
|
54
|
-
react_1.default.createElement(index_1.
|
|
55
|
-
react_1.default.createElement(index_1.MultiCombobox, { helperText: "Start typing to see options...", id: "multi-combobox-1", label: "MultiCombobox with helper text", name: "multi-combobox", onChange: handleChange, options: options, placeholder: "Vyberte ..", value: values }),
|
|
56
|
-
react_1.default.createElement(index_1.MultiCombobox, { helperText: "Error message", id: "multi-combobox-1", isInvalid: true, isRequired: true, label: "MultiCombobox invalid", name: "multi-combobox", onChange: handleChange, options: options, placeholder: "Vyberte ..", value: values }),
|
|
57
|
-
react_1.default.createElement(index_1.MultiCombobox, { dropdownPlacement: "top", id: "multi-combobox-1", label: "MultiCombobox with dropdown top", name: "multi-combobox", onChange: handleChange, options: options, placeholder: "Vyberte ..", value: values })));
|
|
51
|
+
setValue(v);
|
|
52
|
+
});
|
|
53
|
+
const component = (react_1.default.createElement(react_1.default.Fragment, null,
|
|
54
|
+
react_1.default.createElement(index_1.MultiSelect, { id: "multi-select-1", label: "MultiSelect", name: "multi-select", onChange: onChange, options: options, placeholder: "Vyberte pros\u00EDm jednu nebo v\u00EDce mo\u017Enost\u00ED", value: value }),
|
|
55
|
+
react_1.default.createElement(index_1.MultiSelect, { id: "multi-select-2", label: "MultiSelect with popover", name: "multi-select", onChange: onChange, options: options, placeholder: "Vyberte...", value: value, withPopover: true })));
|
|
58
56
|
return (react_1.default.createElement("div", { className: "flex flex-col lg:flex-row" },
|
|
59
|
-
react_1.default.createElement("div", { className: "light space-y-2 p-20 lg:w-1/2" },
|
|
60
|
-
react_1.default.createElement("div", { className: "dark space-y-2 bg-gray-900 p-20 lg:w-1/2" },
|
|
61
|
-
}
|
|
57
|
+
react_1.default.createElement("div", { className: "light space-y-2 p-20 lg:w-1/2" }, component),
|
|
58
|
+
react_1.default.createElement("div", { className: "dark space-y-2 bg-gray-900 p-20 lg:w-1/2" }, component)));
|
|
59
|
+
};
|
|
62
60
|
exports.Default = Default;
|
|
63
61
|
function ComponentStructure() {
|
|
64
|
-
const [
|
|
65
|
-
const handleChange = (v) => {
|
|
66
|
-
setValues(v);
|
|
67
|
-
};
|
|
62
|
+
const [value, onChange] = (0, react_1.useState)(null);
|
|
68
63
|
return (react_1.default.createElement(component_structure_analyzer_1.default, null,
|
|
69
|
-
react_1.default.createElement(index_1.
|
|
64
|
+
react_1.default.createElement(index_1.MultiSelect, { options: options, onChange: onChange, value: value })));
|
|
70
65
|
}
|
|
71
66
|
exports.ComponentStructure = ComponentStructure;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { Placement, Strategy } from "@floating-ui/react";
|
|
2
|
+
import { ReactNode } from "react";
|
|
3
|
+
import { ChipColor } from "../chip";
|
|
4
|
+
import { IconsSet } from "../icon/theme";
|
|
5
|
+
import { SelectSizes } from "../select/theme";
|
|
6
|
+
import { FormControlProps } from "../types";
|
|
7
|
+
export type MultiSelectValueId = number | string;
|
|
8
|
+
export type MultiSelectOption<T = MultiSelectValueId> = {
|
|
9
|
+
color?: ChipColor;
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
id: T;
|
|
12
|
+
label: ReactNode;
|
|
13
|
+
};
|
|
14
|
+
export interface MultiSelectProps<ValueId = MultiSelectValueId, Option = MultiSelectOption<ValueId>> extends FormControlProps<Option[] | null> {
|
|
15
|
+
className?: string;
|
|
16
|
+
dropdownPlacement?: Placement;
|
|
17
|
+
dropdownStrategy?: Strategy;
|
|
18
|
+
form?: string;
|
|
19
|
+
helperText?: ReactNode;
|
|
20
|
+
hiddenLabel?: boolean;
|
|
21
|
+
iconName?: keyof IconsSet;
|
|
22
|
+
id?: string;
|
|
23
|
+
keyExtractor?: (option: Option) => string | number;
|
|
24
|
+
label?: ReactNode;
|
|
25
|
+
options: Option[];
|
|
26
|
+
placeholder?: string;
|
|
27
|
+
renderOption?: (option: Option) => ReactNode;
|
|
28
|
+
size?: keyof SelectSizes;
|
|
29
|
+
withPopover?: boolean;
|
|
30
|
+
}
|
|
31
|
+
export type MultiSelectTypeRef = HTMLDivElement;
|
package/package.json
CHANGED
|
@@ -1,29 +1,29 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uxf/ui",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
8
8
|
"scripts": {
|
|
9
|
-
"build": "
|
|
10
|
-
"compile": "tsc -P tsconfig.json",
|
|
9
|
+
"build": "tsc -P tsconfig.json",
|
|
11
10
|
"typecheck": "../../node_modules/.bin/tsc --noEmit --skipLibCheck"
|
|
12
11
|
},
|
|
13
12
|
"author": "UX Fans s.r.o",
|
|
14
13
|
"license": "MIT",
|
|
15
14
|
"dependencies": {
|
|
16
|
-
"@floating-ui/react": "
|
|
17
|
-
"@headlessui/react": "
|
|
18
|
-
"@uxf/core": "
|
|
19
|
-
"@uxf/datepicker": "
|
|
20
|
-
"@uxf/styles": "
|
|
21
|
-
"color2k": "^2.0.
|
|
15
|
+
"@floating-ui/react": "0.24.2",
|
|
16
|
+
"@headlessui/react": "1.7.14",
|
|
17
|
+
"@uxf/core": "4.5.1",
|
|
18
|
+
"@uxf/datepicker": "1.2.1",
|
|
19
|
+
"@uxf/styles": "2.1.2",
|
|
20
|
+
"color2k": "^2.0.2",
|
|
22
21
|
"dayjs": "^1.11.7",
|
|
23
|
-
"jump.js": "^1.0.2"
|
|
22
|
+
"jump.js": "^1.0.2",
|
|
23
|
+
"react-dropzone": "14.2.3"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
26
|
"@types/jump.js": "^1.0.4",
|
|
27
27
|
"@uxf/icons-generator": "^1.3.0"
|
|
28
28
|
}
|
|
29
|
-
}
|
|
29
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Pagination = void 0;
|
|
4
|
+
var pagination_1 = require("./pagination");
|
|
5
|
+
Object.defineProperty(exports, "Pagination", { enumerable: true, get: function () { return pagination_1.Pagination; } });
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import { FC } from "react";
|
|
2
|
+
import { PaginationSizes } from "@uxf/ui/pagination/theme";
|
|
2
3
|
export interface PaginationProps {
|
|
3
4
|
count: number;
|
|
4
5
|
page: number;
|
|
5
6
|
onPageChange: (index: number) => void;
|
|
7
|
+
size?: keyof PaginationSizes;
|
|
8
|
+
className?: string;
|
|
6
9
|
}
|
|
7
10
|
export declare const Pagination: FC<PaginationProps>;
|
package/pagination/pagination.js
CHANGED
|
@@ -9,8 +9,10 @@ const icon_1 = require("../icon");
|
|
|
9
9
|
const cx_1 = require("@uxf/core/utils/cx");
|
|
10
10
|
const usePagination_1 = require("@uxf/core/hooks/usePagination");
|
|
11
11
|
const Pagination = (props) => {
|
|
12
|
+
var _a;
|
|
12
13
|
const isCurrentPageFirst = props.page === 1;
|
|
13
14
|
const isCurrentPageLast = props.page === props.count;
|
|
15
|
+
const className = (0, cx_1.cx)("uxf-pagination", `uxf-pagination--size-${(_a = props.size) !== null && _a !== void 0 ? _a : "default"}`, props.className);
|
|
14
16
|
const pagination = (0, usePagination_1.usePagination)({
|
|
15
17
|
count: props.count,
|
|
16
18
|
page: props.page,
|
|
@@ -32,18 +34,21 @@ const Pagination = (props) => {
|
|
|
32
34
|
return props.onPageChange(props.count);
|
|
33
35
|
}
|
|
34
36
|
};
|
|
35
|
-
return (react_1.default.createElement("nav", { className:
|
|
37
|
+
return (react_1.default.createElement("nav", { className: className }, pagination.map((item, index) => {
|
|
36
38
|
const isDisabled = ((item === "first" || item === "previous") && isCurrentPageFirst) ||
|
|
37
39
|
((item === "last" || item === "next") && isCurrentPageLast);
|
|
38
|
-
return (
|
|
39
|
-
|
|
40
|
+
return (
|
|
41
|
+
// eslint-disable-next-line jsx-a11y/click-events-have-key-events
|
|
42
|
+
react_1.default.createElement("a", { className: (0, cx_1.cx)("uxf-pagination__button", isDisabled && "is-disabled", (item === "start-ellipsis" || item === "end-ellipsis") && "is-ellipsis", item === props.page && "is-selected", index === 0 && "is-first", index === pagination.length - 1 && "is-last"), key: item, onClick: isDisabled ? undefined : () => onClick(item) }, item === "first" ? (react_1.default.createElement(react_1.default.Fragment, null,
|
|
43
|
+
react_1.default.createElement("span", { className: "uxf-pagination__label" }, "First"),
|
|
40
44
|
react_1.default.createElement(icon_1.Icon, { name: "chevronsLeft", size: 12 }))) : item === "previous" ? (react_1.default.createElement(react_1.default.Fragment, null,
|
|
41
|
-
react_1.default.createElement("span", { className: "
|
|
45
|
+
react_1.default.createElement("span", { className: "uxf-pagination__label" }, "Previous"),
|
|
42
46
|
react_1.default.createElement(icon_1.Icon, { name: "chevronLeft", size: 12 }))) : item === "start-ellipsis" || item === "end-ellipsis" ? (react_1.default.createElement(react_1.default.Fragment, null, "...")) : typeof item === "number" ? (react_1.default.createElement(react_1.default.Fragment, null, item)) : item === "next" ? (react_1.default.createElement(react_1.default.Fragment, null,
|
|
43
|
-
react_1.default.createElement("span", { className: "
|
|
47
|
+
react_1.default.createElement("span", { className: "uxf-pagination__label" }, "Next"),
|
|
44
48
|
react_1.default.createElement(icon_1.Icon, { name: "chevronRight", size: 12 }))) : (react_1.default.createElement(react_1.default.Fragment, null,
|
|
45
|
-
react_1.default.createElement("span", { className: "
|
|
49
|
+
react_1.default.createElement("span", { className: "uxf-pagination__label" }, "Last"),
|
|
46
50
|
react_1.default.createElement(icon_1.Icon, { name: "chevronsRight", size: 12 })))));
|
|
47
51
|
})));
|
|
48
52
|
};
|
|
49
53
|
exports.Pagination = Pagination;
|
|
54
|
+
exports.Pagination.displayName = "UxfUiPagination";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|