thread-ui 0.16.5 → 0.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/components/content-display/carousel/carousel-context.d.ts +15 -15
- package/dist/components/content-display/carousel/carousel.types.d.ts +1 -1
- package/dist/components/content-display/carousel/components/carousel-header.js +1 -1
- package/dist/components/content-display/carousel/components/carousel-header.js.map +1 -1
- package/dist/components/content-display/gallery/components/gallery-content.js +1 -1
- package/dist/components/content-display/gallery/components/gallery-content.js.map +1 -1
- package/dist/components/content-display/gallery/gallery-context.d.ts +15 -15
- package/dist/components/content-display/gallery/gallery.types.d.ts +1 -1
- package/dist/components/content-display/lightbox/components/lightbox-title.js +2 -2
- package/dist/components/content-display/lightbox/components/lightbox-title.js.map +1 -1
- package/dist/components/content-display/lightbox/lightbox-context.d.ts +6 -6
- package/dist/components/content-display/lightbox/lightbox.js +1 -1
- package/dist/components/content-display/lightbox/lightbox.js.map +1 -1
- package/dist/components/content-display/tab-view/components/tab-item-content.js +1 -1
- package/dist/components/content-display/tab-view/components/tab-item-content.js.map +1 -1
- package/dist/components/data-display/filter-controls/variants/filter-controls.js +13 -2
- package/dist/components/data-display/filter-controls/variants/filter-controls.js.map +1 -1
- package/dist/components/data-display/filter-controls/variants/inline-filter-controls.js +1 -1
- package/dist/components/data-display/filter-controls/variants/inline-filter-controls.js.map +1 -1
- package/dist/components/data-display/sort-controls/sort-controls.js +1 -1
- package/dist/components/data-display/sort-controls/sort-controls.js.map +1 -1
- package/dist/components/data-input/dropdowns/dropdown/dropdown.d.ts +19 -0
- package/dist/components/data-input/dropdowns/dropdown/dropdown.js +22 -0
- package/dist/components/data-input/dropdowns/dropdown/dropdown.js.map +1 -0
- package/dist/components/data-input/dropdowns/dropdown/dropdown.types.d.ts +4 -0
- package/dist/components/data-input/dropdowns/dropdown/dropdown.types.js.map +1 -0
- package/dist/components/data-input/dropdowns/dropdown/index.js.map +1 -0
- package/dist/components/data-input/dropdowns/dropdown-base/dropdown-base.d.ts +42 -0
- package/dist/components/data-input/dropdowns/dropdown-base/dropdown-base.js +233 -0
- package/dist/components/data-input/dropdowns/dropdown-base/dropdown-base.js.map +1 -0
- package/dist/components/data-input/dropdowns/dropdown-base/dropdown-base.types.d.ts +36 -0
- package/dist/components/data-input/dropdowns/dropdown-base/dropdown-base.types.js.map +1 -0
- package/dist/components/data-input/dropdowns/dropdown-base/index.js.map +1 -0
- package/dist/components/data-input/dropdowns/index.js.map +1 -0
- package/dist/components/data-input/dropdowns/multi-dropdown/index.js.map +1 -0
- package/dist/components/data-input/dropdowns/multi-dropdown/multi-dropdown.d.ts +19 -0
- package/dist/components/data-input/dropdowns/multi-dropdown/multi-dropdown.js +21 -0
- package/dist/components/data-input/dropdowns/multi-dropdown/multi-dropdown.js.map +1 -0
- package/dist/components/data-input/dropdowns/multi-dropdown/multi-dropdown.types.d.ts +4 -0
- package/dist/components/data-input/dropdowns/multi-dropdown/multi-dropdown.types.js.map +1 -0
- package/dist/components/data-input/file-upload/components/dropzone.d.ts +8 -0
- package/dist/components/data-input/file-upload/components/dropzone.js +117 -0
- package/dist/components/data-input/file-upload/components/dropzone.js.map +1 -0
- package/dist/components/data-input/file-upload/components/file-item.d.ts +14 -0
- package/dist/components/data-input/file-upload/components/file-item.js +69 -0
- package/dist/components/data-input/file-upload/components/file-item.js.map +1 -0
- package/dist/components/data-input/file-upload/components/file-upload-content.d.ts +10 -0
- package/dist/components/data-input/file-upload/components/file-upload-content.js +55 -0
- package/dist/components/data-input/file-upload/components/file-upload-content.js.map +1 -0
- package/dist/components/data-input/file-upload/components/item-previews.d.ts +28 -0
- package/dist/components/data-input/file-upload/components/item-previews.js +95 -0
- package/dist/components/data-input/file-upload/components/item-previews.js.map +1 -0
- package/dist/components/data-input/file-upload/file-upload-context.js.map +1 -0
- package/dist/components/data-input/file-upload/file-upload.d.ts +23 -0
- package/dist/components/data-input/file-upload/file-upload.js +58 -0
- package/dist/components/data-input/file-upload/file-upload.js.map +1 -0
- package/dist/components/data-input/file-upload/file-upload.types.d.ts +54 -0
- package/dist/components/data-input/file-upload/file-upload.types.js.map +1 -0
- package/dist/components/data-input/file-upload/file-upload.utils.d.ts +21 -0
- package/dist/components/data-input/file-upload/file-upload.utils.js +86 -0
- package/dist/components/data-input/file-upload/file-upload.utils.js.map +1 -0
- package/dist/components/data-input/file-upload/index.d.ts +3 -0
- package/dist/components/data-input/file-upload/index.js.map +1 -0
- package/dist/components/data-input/file-upload/use-file-upload.d.ts +58 -0
- package/dist/components/data-input/file-upload/use-file-upload.js +154 -0
- package/dist/components/data-input/file-upload/use-file-upload.js.map +1 -0
- package/dist/components/data-input/file-upload/use-object-url.d.ts +9 -0
- package/dist/components/data-input/file-upload/use-object-url.js +24 -0
- package/dist/components/data-input/file-upload/use-object-url.js.map +1 -0
- package/dist/components/{form-elements → data-input}/index.d.ts +2 -1
- package/dist/components/{form-elements → data-input}/index.js +2 -1
- package/dist/components/data-input/index.js.map +1 -0
- package/dist/components/data-input/number-input/index.js.map +1 -0
- package/dist/components/{form-elements → data-input}/number-input/number-input.d.ts +4 -1
- package/dist/components/{form-elements → data-input}/number-input/number-input.js +47 -52
- package/dist/components/data-input/number-input/number-input.js.map +1 -0
- package/dist/components/{form-elements → data-input}/number-input/number-input.types.d.ts +1 -1
- package/dist/components/data-input/number-input/number-input.types.js.map +1 -0
- package/dist/components/data-input/reorderable/index.d.ts +4 -0
- package/dist/components/data-input/reorderable/index.js +4 -0
- package/dist/components/data-input/reorderable/index.js.map +1 -0
- package/dist/components/data-input/reorderable/reorderable-groups/group-title.d.ts +8 -0
- package/dist/components/data-input/reorderable/reorderable-groups/group-title.js +20 -0
- package/dist/components/data-input/reorderable/reorderable-groups/group-title.js.map +1 -0
- package/dist/components/data-input/reorderable/reorderable-groups/group-utils.d.ts +13 -0
- package/dist/components/data-input/reorderable/reorderable-groups/group-utils.js +26 -0
- package/dist/components/data-input/reorderable/reorderable-groups/group-utils.js.map +1 -0
- package/dist/components/data-input/reorderable/reorderable-groups/index.d.ts +2 -0
- package/dist/components/data-input/reorderable/reorderable-groups/index.js +2 -0
- package/dist/components/data-input/reorderable/reorderable-groups/index.js.map +1 -0
- package/dist/components/data-input/reorderable/reorderable-groups/reorderable-groups.d.ts +18 -0
- package/dist/components/data-input/reorderable/reorderable-groups/reorderable-groups.js +135 -0
- package/dist/components/data-input/reorderable/reorderable-groups/reorderable-groups.js.map +1 -0
- package/dist/components/data-input/reorderable/reorderable-groups/reorderable-groups.types.d.ts +66 -0
- package/dist/components/data-input/reorderable/reorderable-groups/reorderable-groups.types.js +2 -0
- package/dist/components/data-input/reorderable/reorderable-groups/reorderable-groups.types.js.map +1 -0
- package/dist/components/data-input/reorderable/reorderable-groups/sortable-group.d.ts +30 -0
- package/dist/components/data-input/reorderable/reorderable-groups/sortable-group.js +65 -0
- package/dist/components/data-input/reorderable/reorderable-groups/sortable-group.js.map +1 -0
- package/dist/components/data-input/reorderable/reorderable-groups/use-group-drag.d.ts +30 -0
- package/dist/components/data-input/reorderable/reorderable-groups/use-group-drag.js +186 -0
- package/dist/components/data-input/reorderable/reorderable-groups/use-group-drag.js.map +1 -0
- package/dist/components/data-input/reorderable/reorderable-list/index.d.ts +2 -0
- package/dist/components/data-input/reorderable/reorderable-list/index.js +2 -0
- package/dist/components/data-input/reorderable/reorderable-list/index.js.map +1 -0
- package/dist/components/data-input/reorderable/reorderable-list/reorderable-list.d.ts +19 -0
- package/dist/components/data-input/reorderable/reorderable-list/reorderable-list.js +95 -0
- package/dist/components/data-input/reorderable/reorderable-list/reorderable-list.js.map +1 -0
- package/dist/components/data-input/reorderable/reorderable-list/reorderable-list.types.d.ts +28 -0
- package/dist/components/data-input/reorderable/reorderable-list/reorderable-list.types.js +2 -0
- package/dist/components/data-input/reorderable/reorderable-list/reorderable-list.types.js.map +1 -0
- package/dist/components/data-input/reorderable/reorderable-list/sortable-item/index.d.ts +2 -0
- package/dist/components/data-input/reorderable/reorderable-list/sortable-item/index.js +2 -0
- package/dist/components/data-input/reorderable/reorderable-list/sortable-item/index.js.map +1 -0
- package/dist/components/data-input/reorderable/reorderable-list/sortable-item/sortable-item.d.ts +8 -0
- package/dist/components/data-input/reorderable/reorderable-list/sortable-item/sortable-item.js +66 -0
- package/dist/components/data-input/reorderable/reorderable-list/sortable-item/sortable-item.js.map +1 -0
- package/dist/components/data-input/reorderable/reorderable-list/sortable-item/sortable-item.types.d.ts +31 -0
- package/dist/components/data-input/reorderable/reorderable-list/sortable-item/sortable-item.types.js +2 -0
- package/dist/components/data-input/reorderable/reorderable-list/sortable-item/sortable-item.types.js.map +1 -0
- package/dist/components/data-input/reorderable/shared/components/drag-handle.d.ts +24 -0
- package/dist/components/data-input/reorderable/shared/components/drag-handle.js +50 -0
- package/dist/components/data-input/reorderable/shared/components/drag-handle.js.map +1 -0
- package/dist/components/data-input/reorderable/shared/components/sortable-item.d.ts +9 -0
- package/dist/components/data-input/reorderable/shared/components/sortable-item.js +42 -0
- package/dist/components/data-input/reorderable/shared/components/sortable-item.js.map +1 -0
- package/dist/components/data-input/reorderable/shared/functions/announcements.d.ts +4 -0
- package/dist/components/data-input/reorderable/shared/functions/announcements.js +20 -0
- package/dist/components/data-input/reorderable/shared/functions/announcements.js.map +1 -0
- package/dist/components/data-input/reorderable/shared/functions/apply-order.d.ts +2 -0
- package/dist/components/data-input/reorderable/shared/functions/apply-order.js +8 -0
- package/dist/components/data-input/reorderable/shared/functions/apply-order.js.map +1 -0
- package/dist/components/data-input/reorderable/shared/functions/form-value.d.ts +30 -0
- package/dist/components/data-input/reorderable/shared/functions/form-value.js +49 -0
- package/dist/components/data-input/reorderable/shared/functions/form-value.js.map +1 -0
- package/dist/components/data-input/reorderable/shared/functions/layout.d.ts +18 -0
- package/dist/components/data-input/reorderable/shared/functions/layout.js +27 -0
- package/dist/components/data-input/reorderable/shared/functions/layout.js.map +1 -0
- package/dist/components/data-input/reorderable/shared/index.d.ts +9 -0
- package/dist/components/data-input/reorderable/shared/index.js +7 -0
- package/dist/components/data-input/reorderable/shared/index.js.map +1 -0
- package/dist/components/data-input/reorderable/shared/types/reorderable.types.d.ts +45 -0
- package/dist/components/data-input/reorderable/shared/types/reorderable.types.js +2 -0
- package/dist/components/data-input/reorderable/shared/types/reorderable.types.js.map +1 -0
- package/dist/components/data-input/reorderable/shared/types/sortable-item.types.d.ts +14 -0
- package/dist/components/data-input/reorderable/shared/types/sortable-item.types.js +2 -0
- package/dist/components/data-input/reorderable/shared/types/sortable-item.types.js.map +1 -0
- package/dist/components/data-input/shared/form-label/form-label.d.ts +15 -0
- package/dist/components/data-input/shared/form-label/form-label.js +53 -0
- package/dist/components/data-input/shared/form-label/form-label.js.map +1 -0
- package/dist/components/data-input/shared/form-label/form-label.types.d.ts +10 -0
- package/dist/components/data-input/shared/form-label/form-label.types.js.map +1 -0
- package/dist/components/data-input/shared/form-label/index.js.map +1 -0
- package/dist/components/{form-elements → data-input/shared}/input-props.types.d.ts +11 -5
- package/dist/components/data-input/shared/input-props.types.js.map +1 -0
- package/dist/components/data-input/shared/input-wrapper.d.ts +31 -0
- package/dist/components/data-input/shared/input-wrapper.js +50 -0
- package/dist/components/data-input/shared/input-wrapper.js.map +1 -0
- package/dist/components/{form-elements/styles/index.d.ts → data-input/shared/styles.d.ts} +26 -3
- package/dist/components/data-input/shared/styles.js +107 -0
- package/dist/components/data-input/shared/styles.js.map +1 -0
- package/dist/components/data-input/shared/use-field-error.d.ts +58 -0
- package/dist/components/data-input/shared/use-field-error.js +82 -0
- package/dist/components/data-input/shared/use-field-error.js.map +1 -0
- package/dist/components/data-input/shared/use-input-id.d.ts +8 -0
- package/dist/components/data-input/shared/use-input-id.js +14 -0
- package/dist/components/data-input/shared/use-input-id.js.map +1 -0
- package/dist/components/data-input/text-input/index.js.map +1 -0
- package/dist/components/data-input/text-input/text-input.d.ts +16 -0
- package/dist/components/data-input/text-input/text-input.js +37 -0
- package/dist/components/data-input/text-input/text-input.js.map +1 -0
- package/dist/components/{form-elements → data-input}/text-input/text-input.types.d.ts +1 -1
- package/dist/components/data-input/text-input/text-input.types.js.map +1 -0
- package/dist/components/index.d.ts +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/index.js.map +1 -1
- package/dist/components/layouts/column-layout/column-layout.js +1 -1
- package/dist/components/layouts/column-layout/column-layout.js.map +1 -1
- package/dist/components/layouts/column-layout/column-layout.types.d.ts +1 -1
- package/dist/components/layouts/footer/footer.js +1 -1
- package/dist/components/layouts/footer/footer.js.map +1 -1
- package/dist/components/layouts/index.d.ts +2 -0
- package/dist/components/layouts/index.js +2 -0
- package/dist/components/layouts/index.js.map +1 -1
- package/dist/components/layouts/layout-wrapper.js +1 -1
- package/dist/components/layouts/layout-wrapper.js.map +1 -1
- package/dist/components/layouts/masonry-layout/masonry-layout.js +1 -1
- package/dist/components/layouts/masonry-layout/masonry-layout.js.map +1 -1
- package/dist/components/layouts/masonry-layout/masonry-layout.types.d.ts +1 -1
- package/dist/components/layouts/split-navigator/index.d.ts +2 -0
- package/dist/components/layouts/split-navigator/index.js +2 -0
- package/dist/components/layouts/split-navigator/index.js.map +1 -0
- package/dist/components/layouts/split-navigator/split-navigator.d.ts +19 -0
- package/dist/components/layouts/split-navigator/split-navigator.js +91 -0
- package/dist/components/layouts/split-navigator/split-navigator.js.map +1 -0
- package/dist/components/layouts/split-navigator/split-navigator.types.d.ts +55 -0
- package/dist/components/layouts/split-navigator/split-navigator.types.js +2 -0
- package/dist/components/layouts/split-navigator/split-navigator.types.js.map +1 -0
- package/dist/components/layouts/split-view/components/split-view-back-button.d.ts +3 -0
- package/dist/components/layouts/split-view/components/split-view-back-button.js +18 -0
- package/dist/components/layouts/split-view/components/split-view-back-button.js.map +1 -0
- package/dist/components/layouts/split-view/components/split-view-column.d.ts +5 -0
- package/dist/components/layouts/split-view/components/split-view-column.js +204 -0
- package/dist/components/layouts/split-view/components/split-view-column.js.map +1 -0
- package/dist/components/layouts/split-view/components/split-view-header.d.ts +6 -0
- package/dist/components/layouts/split-view/components/split-view-header.js +44 -0
- package/dist/components/layouts/split-view/components/split-view-header.js.map +1 -0
- package/dist/components/layouts/split-view/components/split-view-item.d.ts +11 -0
- package/dist/components/layouts/split-view/components/split-view-item.js +19 -0
- package/dist/components/layouts/split-view/components/split-view-item.js.map +1 -0
- package/dist/components/layouts/split-view/components/split-view-panes.d.ts +7 -0
- package/dist/components/layouts/split-view/components/split-view-panes.js +10 -0
- package/dist/components/layouts/split-view/components/split-view-panes.js.map +1 -0
- package/dist/components/layouts/split-view/components/split-view-sidebar-toggle.d.ts +3 -0
- package/dist/components/layouts/split-view/components/split-view-sidebar-toggle.js +14 -0
- package/dist/components/layouts/split-view/components/split-view-sidebar-toggle.js.map +1 -0
- package/dist/components/layouts/split-view/index.d.ts +10 -0
- package/dist/components/layouts/split-view/index.js +15 -0
- package/dist/components/layouts/split-view/index.js.map +1 -0
- package/dist/components/layouts/split-view/split-view-context.d.ts +4 -0
- package/dist/components/layouts/split-view/split-view-context.js +6 -0
- package/dist/components/layouts/split-view/split-view-context.js.map +1 -0
- package/dist/components/layouts/split-view/split-view.d.ts +20 -0
- package/dist/components/layouts/split-view/split-view.js +153 -0
- package/dist/components/layouts/split-view/split-view.js.map +1 -0
- package/dist/components/layouts/split-view/split-view.types.d.ts +90 -0
- package/dist/components/layouts/split-view/split-view.types.js +2 -0
- package/dist/components/layouts/split-view/split-view.types.js.map +1 -0
- package/dist/components/media-display/image-panel/image-panel.js +1 -1
- package/dist/components/media-display/image-panel/image-panel.js.map +1 -1
- package/dist/components/media-display/info-card/info-card.js +2 -2
- package/dist/components/media-display/info-card/info-card.js.map +1 -1
- package/dist/components/media-display/info-card/info-card.types.d.ts +1 -1
- package/dist/components/media-display/media-card/media-card.js +2 -2
- package/dist/components/media-display/media-card/media-card.js.map +1 -1
- package/dist/components/navigation/nav-menu/components/nav-drop-down-item.js +1 -1
- package/dist/components/navigation/nav-menu/components/nav-drop-down-item.js.map +1 -1
- package/dist/components/navigation/nav-menu/components/nav-item.js +1 -1
- package/dist/components/navigation/nav-menu/components/nav-item.js.map +1 -1
- package/dist/components/navigation/nav-menu/components/nav-link.js +1 -1
- package/dist/components/navigation/nav-menu/components/nav-link.js.map +1 -1
- package/dist/components/navigation/side-nav/side-nav-item/side-nav-item.d.ts +1 -1
- package/dist/components/navigation/side-nav/side-nav-item/side-nav-item.js +5 -48
- package/dist/components/navigation/side-nav/side-nav-item/side-nav-item.js.map +1 -1
- package/dist/components/navigation/side-nav/side-nav-item/side-nav-item.types.d.ts +3 -0
- package/dist/components/navigation/side-nav/side-nav.d.ts +4 -2
- package/dist/components/navigation/side-nav/side-nav.js +27 -11
- package/dist/components/navigation/side-nav/side-nav.js.map +1 -1
- package/dist/components/navigation/side-nav/side-nav.types.d.ts +6 -1
- package/dist/components/typography/body/body.types.d.ts +8 -5
- package/dist/components/typography/body/text.d.ts +5 -3
- package/dist/components/typography/body/text.js +20 -6
- package/dist/components/typography/body/text.js.map +1 -1
- package/dist/components/typography/code/code.d.ts +8 -0
- package/dist/components/typography/code/code.js +12 -1
- package/dist/components/typography/code/code.js.map +1 -1
- package/dist/components/typography/code/code.types.d.ts +2 -2
- package/dist/components/typography/heading/heading.js +7 -2
- package/dist/components/typography/heading/heading.js.map +1 -1
- package/dist/components/typography/heading/heading.types.d.ts +3 -1
- package/dist/components/typography/heading/render-heading.d.ts +1 -1
- package/dist/components/typography/heading/render-heading.js +6 -4
- package/dist/components/typography/heading/render-heading.js.map +1 -1
- package/dist/components/typography/page-header/page-header.js +1 -1
- package/dist/components/typography/page-header/page-header.js.map +1 -1
- package/dist/components/typography/shared-utils/get-presentation-styles.js +8 -0
- package/dist/components/typography/shared-utils/get-presentation-styles.js.map +1 -1
- package/dist/components/typography/shared-utils/resolve-margin-bottom.d.ts +22 -0
- package/dist/components/typography/shared-utils/resolve-margin-bottom.js +25 -0
- package/dist/components/typography/shared-utils/resolve-margin-bottom.js.map +1 -0
- package/dist/components/typography/typography.types.d.ts +8 -3
- package/dist/components/ui/button/button-recipe.js +8 -0
- package/dist/components/ui/button/button-recipe.js.map +1 -1
- package/dist/components/ui/button/button.d.ts +7 -1
- package/dist/components/ui/button/button.js +8 -2
- package/dist/components/ui/button/button.js.map +1 -1
- package/dist/components/ui/button/button.types.d.ts +6 -6
- package/dist/components/ui/card/card.js +2 -2
- package/dist/components/ui/card/card.js.map +1 -1
- package/dist/components/ui/icon/icon.types.d.ts +1 -1
- package/dist/components/ui/icon-button/icon-button.js +2 -2
- package/dist/components/ui/icon-button/icon-button.js.map +1 -1
- package/dist/components/ui/icon-button/icon-button.types.d.ts +4 -3
- package/dist/components/ui/modal/components/modal-content.js +1 -1
- package/dist/components/ui/modal/components/modal-content.js.map +1 -1
- package/dist/components/ui/modal/modal.js +1 -1
- package/dist/components/ui/modal/modal.js.map +1 -1
- package/dist/components/ui/modal/modal.types.d.ts +1 -1
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/index.js +1 -0
- package/dist/hooks/index.js.map +1 -1
- package/dist/hooks/use-media-query/index.d.ts +1 -0
- package/dist/hooks/use-media-query/index.js +2 -0
- package/dist/hooks/use-media-query/index.js.map +1 -0
- package/dist/hooks/use-media-query/use-media-query.d.ts +8 -0
- package/dist/hooks/use-media-query/use-media-query.js +22 -0
- package/dist/hooks/use-media-query/use-media-query.js.map +1 -0
- package/dist/hooks/use-pathname/use-pathname.d.ts +2 -1
- package/dist/hooks/use-pathname/use-pathname.js +28 -4
- package/dist/hooks/use-pathname/use-pathname.js.map +1 -1
- package/dist/internal/components/conditional-wrapper/conditional-wrapper.js.map +1 -0
- package/dist/internal/components/conditional-wrapper/conditional-wrapper.types.js.map +1 -0
- package/dist/internal/components/conditional-wrapper/index.js.map +1 -0
- package/dist/{internal-components → internal/components}/content-header/content-header.js +3 -3
- package/dist/internal/components/content-header/content-header.js.map +1 -0
- package/dist/{internal-components → internal/components}/content-header/content-header.types.d.ts +3 -3
- package/dist/internal/components/content-header/content-header.types.js.map +1 -0
- package/dist/internal/components/content-header/index.js.map +1 -0
- package/dist/{internal-components → internal/components}/dynamic-icon/dynamic-icon.js +1 -1
- package/dist/internal/components/dynamic-icon/dynamic-icon.js.map +1 -0
- package/dist/internal/components/dynamic-icon/dynamic-icon.types.d.ts +6 -0
- package/dist/internal/components/dynamic-icon/dynamic-icon.types.js.map +1 -0
- package/dist/internal/components/dynamic-icon/index.js.map +1 -0
- package/dist/internal/components/image/index.js.map +1 -0
- package/dist/{internal-components → internal/components}/image/is-html-image-props.d.ts +1 -1
- package/dist/internal/components/image/is-html-image-props.js.map +1 -0
- package/dist/{internal-components → internal/components}/image/render-image.d.ts +1 -1
- package/dist/{internal-components → internal/components}/image/render-image.js +1 -1
- package/dist/internal/components/image/render-image.js.map +1 -0
- package/dist/{internal-components → internal/components}/index.d.ts +1 -0
- package/dist/{internal-components → internal/components}/index.js +1 -0
- package/dist/internal/components/index.js.map +1 -0
- package/dist/internal/components/link/index.js.map +1 -0
- package/dist/{internal-components → internal/components}/link/link.js +1 -1
- package/dist/internal/components/link/link.js.map +1 -0
- package/dist/internal/components/link/link.types.js.map +1 -0
- package/dist/internal/components/modal-primitive/index.js.map +1 -0
- package/dist/{internal-components → internal/components}/modal-primitive/modal-primitive.js +1 -1
- package/dist/internal/components/modal-primitive/modal-primitive.js.map +1 -0
- package/dist/internal/components/modal-primitive/modal-primitive.types.js.map +1 -0
- package/dist/internal/components/nav-list-item/index.d.ts +2 -0
- package/dist/internal/components/nav-list-item/index.js +2 -0
- package/dist/internal/components/nav-list-item/index.js.map +1 -0
- package/dist/internal/components/nav-list-item/nav-list-item.d.ts +9 -0
- package/dist/internal/components/nav-list-item/nav-list-item.js +105 -0
- package/dist/internal/components/nav-list-item/nav-list-item.js.map +1 -0
- package/dist/internal/components/nav-list-item/nav-list-item.types.d.ts +24 -0
- package/dist/internal/components/nav-list-item/nav-list-item.types.js +2 -0
- package/dist/internal/components/nav-list-item/nav-list-item.types.js.map +1 -0
- package/dist/internal/components/optional-icon-button/index.js.map +1 -0
- package/dist/{internal-components → internal/components}/optional-icon-button/optional-icon-button.js +1 -1
- package/dist/internal/components/optional-icon-button/optional-icon-button.js.map +1 -0
- package/dist/{internal-components → internal/components}/optional-icon-button/optional-icon-button.types.d.ts +1 -1
- package/dist/internal/components/optional-icon-button/optional-icon-button.types.js.map +1 -0
- package/dist/internal/components/surface/index.js.map +1 -0
- package/dist/{internal-components → internal/components}/surface/surface.js +2 -2
- package/dist/internal/components/surface/surface.js.map +1 -0
- package/dist/{internal-components → internal/components}/surface/surface.types.d.ts +2 -2
- package/dist/internal/components/surface/surface.types.js.map +1 -0
- package/dist/internal/hooks/index.d.ts +2 -0
- package/dist/internal/hooks/index.js +3 -0
- package/dist/internal/hooks/index.js.map +1 -0
- package/dist/internal/hooks/use-controllable-state.d.ts +22 -0
- package/dist/internal/hooks/use-controllable-state.js +34 -0
- package/dist/internal/hooks/use-controllable-state.js.map +1 -0
- package/dist/internal/hooks/use-latest-ref.d.ts +7 -0
- package/dist/internal/hooks/use-latest-ref.js +16 -0
- package/dist/internal/hooks/use-latest-ref.js.map +1 -0
- package/dist/internal/index.d.ts +2 -0
- package/dist/internal/index.js +5 -0
- package/dist/internal/index.js.map +1 -0
- package/dist/styled-system/recipes/button.js +7 -0
- package/dist/styles/panda.css +1 -1
- package/package.json +4 -1
- package/dist/components/form-elements/dropdowns/dropdown/dropdown.d.ts +0 -13
- package/dist/components/form-elements/dropdowns/dropdown/dropdown.js +0 -41
- package/dist/components/form-elements/dropdowns/dropdown/dropdown.js.map +0 -1
- package/dist/components/form-elements/dropdowns/dropdown/dropdown.types.d.ts +0 -21
- package/dist/components/form-elements/dropdowns/dropdown/dropdown.types.js.map +0 -1
- package/dist/components/form-elements/dropdowns/dropdown/index.js.map +0 -1
- package/dist/components/form-elements/dropdowns/dropdown-base/dropdown-base.d.ts +0 -8
- package/dist/components/form-elements/dropdowns/dropdown-base/dropdown-base.js +0 -44
- package/dist/components/form-elements/dropdowns/dropdown-base/dropdown-base.js.map +0 -1
- package/dist/components/form-elements/dropdowns/dropdown-base/dropdown-base.types.d.ts +0 -26
- package/dist/components/form-elements/dropdowns/dropdown-base/dropdown-base.types.js.map +0 -1
- package/dist/components/form-elements/dropdowns/dropdown-base/index.js.map +0 -1
- package/dist/components/form-elements/dropdowns/index.js.map +0 -1
- package/dist/components/form-elements/dropdowns/multi-dropdown/index.js.map +0 -1
- package/dist/components/form-elements/dropdowns/multi-dropdown/multi-dropdown.d.ts +0 -15
- package/dist/components/form-elements/dropdowns/multi-dropdown/multi-dropdown.js +0 -55
- package/dist/components/form-elements/dropdowns/multi-dropdown/multi-dropdown.js.map +0 -1
- package/dist/components/form-elements/dropdowns/multi-dropdown/multi-dropdown.types.d.ts +0 -25
- package/dist/components/form-elements/dropdowns/multi-dropdown/multi-dropdown.types.js.map +0 -1
- package/dist/components/form-elements/file-upload/components/file-input.d.ts +0 -1
- package/dist/components/form-elements/file-upload/components/file-input.js +0 -95
- package/dist/components/form-elements/file-upload/components/file-input.js.map +0 -1
- package/dist/components/form-elements/file-upload/components/file-upload-content.d.ts +0 -1
- package/dist/components/form-elements/file-upload/components/file-upload-content.js +0 -29
- package/dist/components/form-elements/file-upload/components/file-upload-content.js.map +0 -1
- package/dist/components/form-elements/file-upload/components/file-upload-preview.d.ts +0 -1
- package/dist/components/form-elements/file-upload/components/file-upload-preview.js +0 -51
- package/dist/components/form-elements/file-upload/components/file-upload-preview.js.map +0 -1
- package/dist/components/form-elements/file-upload/components/item-previews.d.ts +0 -11
- package/dist/components/form-elements/file-upload/components/item-previews.js +0 -58
- package/dist/components/form-elements/file-upload/components/item-previews.js.map +0 -1
- package/dist/components/form-elements/file-upload/file-upload-context.js.map +0 -1
- package/dist/components/form-elements/file-upload/file-upload.d.ts +0 -19
- package/dist/components/form-elements/file-upload/file-upload.js +0 -149
- package/dist/components/form-elements/file-upload/file-upload.js.map +0 -1
- package/dist/components/form-elements/file-upload/file-upload.types.d.ts +0 -36
- package/dist/components/form-elements/file-upload/file-upload.types.js.map +0 -1
- package/dist/components/form-elements/file-upload/index.d.ts +0 -3
- package/dist/components/form-elements/file-upload/index.js.map +0 -1
- package/dist/components/form-elements/form-label/form-label.d.ts +0 -8
- package/dist/components/form-elements/form-label/form-label.js +0 -32
- package/dist/components/form-elements/form-label/form-label.js.map +0 -1
- package/dist/components/form-elements/form-label/form-label.types.d.ts +0 -11
- package/dist/components/form-elements/form-label/form-label.types.js.map +0 -1
- package/dist/components/form-elements/form-label/index.js.map +0 -1
- package/dist/components/form-elements/index.js.map +0 -1
- package/dist/components/form-elements/input-props.types.js.map +0 -1
- package/dist/components/form-elements/input-wrapper.d.ts +0 -4
- package/dist/components/form-elements/input-wrapper.js +0 -13
- package/dist/components/form-elements/input-wrapper.js.map +0 -1
- package/dist/components/form-elements/number-input/index.js.map +0 -1
- package/dist/components/form-elements/number-input/number-input.js.map +0 -1
- package/dist/components/form-elements/number-input/number-input.types.js.map +0 -1
- package/dist/components/form-elements/styles/index.js +0 -74
- package/dist/components/form-elements/styles/index.js.map +0 -1
- package/dist/components/form-elements/text-input/index.js.map +0 -1
- package/dist/components/form-elements/text-input/text-input.d.ts +0 -9
- package/dist/components/form-elements/text-input/text-input.js +0 -20
- package/dist/components/form-elements/text-input/text-input.js.map +0 -1
- package/dist/components/form-elements/text-input/text-input.types.js.map +0 -1
- package/dist/components/typography/typography.d.ts +0 -116
- package/dist/components/typography/typography.js +0 -249
- package/dist/components/typography/typography.js.map +0 -1
- package/dist/internal-components/conditional-wrapper/conditional-wrapper.js.map +0 -1
- package/dist/internal-components/conditional-wrapper/conditional-wrapper.types.js.map +0 -1
- package/dist/internal-components/conditional-wrapper/index.js.map +0 -1
- package/dist/internal-components/content-header/content-header.js.map +0 -1
- package/dist/internal-components/content-header/content-header.types.js.map +0 -1
- package/dist/internal-components/content-header/index.js.map +0 -1
- package/dist/internal-components/dynamic-icon/dynamic-icon.js.map +0 -1
- package/dist/internal-components/dynamic-icon/dynamic-icon.types.d.ts +0 -6
- package/dist/internal-components/dynamic-icon/dynamic-icon.types.js.map +0 -1
- package/dist/internal-components/dynamic-icon/index.js.map +0 -1
- package/dist/internal-components/image/index.js.map +0 -1
- package/dist/internal-components/image/is-html-image-props.js.map +0 -1
- package/dist/internal-components/image/render-image.js.map +0 -1
- package/dist/internal-components/index.js.map +0 -1
- package/dist/internal-components/link/index.js.map +0 -1
- package/dist/internal-components/link/link.js.map +0 -1
- package/dist/internal-components/link/link.types.js.map +0 -1
- package/dist/internal-components/modal-primitive/index.js.map +0 -1
- package/dist/internal-components/modal-primitive/modal-primitive.js.map +0 -1
- package/dist/internal-components/modal-primitive/modal-primitive.types.js.map +0 -1
- package/dist/internal-components/optional-icon-button/index.js.map +0 -1
- package/dist/internal-components/optional-icon-button/optional-icon-button.js.map +0 -1
- package/dist/internal-components/optional-icon-button/optional-icon-button.types.js.map +0 -1
- package/dist/internal-components/surface/index.js.map +0 -1
- package/dist/internal-components/surface/surface.js.map +0 -1
- package/dist/internal-components/surface/surface.types.js.map +0 -1
- /package/dist/components/{form-elements → data-input}/dropdowns/dropdown/dropdown.types.js +0 -0
- /package/dist/components/{form-elements → data-input}/dropdowns/dropdown/index.d.ts +0 -0
- /package/dist/components/{form-elements → data-input}/dropdowns/dropdown/index.js +0 -0
- /package/dist/components/{form-elements → data-input}/dropdowns/dropdown-base/dropdown-base.types.js +0 -0
- /package/dist/components/{form-elements → data-input}/dropdowns/dropdown-base/index.d.ts +0 -0
- /package/dist/components/{form-elements → data-input}/dropdowns/dropdown-base/index.js +0 -0
- /package/dist/components/{form-elements → data-input}/dropdowns/index.d.ts +0 -0
- /package/dist/components/{form-elements → data-input}/dropdowns/index.js +0 -0
- /package/dist/components/{form-elements → data-input}/dropdowns/multi-dropdown/index.d.ts +0 -0
- /package/dist/components/{form-elements → data-input}/dropdowns/multi-dropdown/index.js +0 -0
- /package/dist/components/{form-elements → data-input}/dropdowns/multi-dropdown/multi-dropdown.types.js +0 -0
- /package/dist/components/{form-elements → data-input}/file-upload/file-upload-context.d.ts +0 -0
- /package/dist/components/{form-elements → data-input}/file-upload/file-upload-context.js +0 -0
- /package/dist/components/{form-elements → data-input}/file-upload/file-upload.types.js +0 -0
- /package/dist/components/{form-elements → data-input}/file-upload/index.js +0 -0
- /package/dist/components/{form-elements → data-input}/number-input/index.d.ts +0 -0
- /package/dist/components/{form-elements → data-input}/number-input/index.js +0 -0
- /package/dist/components/{form-elements → data-input}/number-input/number-input.types.js +0 -0
- /package/dist/components/{form-elements → data-input/shared}/form-label/form-label.types.js +0 -0
- /package/dist/components/{form-elements → data-input/shared}/form-label/index.d.ts +0 -0
- /package/dist/components/{form-elements → data-input/shared}/form-label/index.js +0 -0
- /package/dist/components/{form-elements → data-input/shared}/input-props.types.js +0 -0
- /package/dist/components/{form-elements → data-input}/text-input/index.d.ts +0 -0
- /package/dist/components/{form-elements → data-input}/text-input/index.js +0 -0
- /package/dist/components/{form-elements → data-input}/text-input/text-input.types.js +0 -0
- /package/dist/{internal-components → internal/components}/conditional-wrapper/conditional-wrapper.d.ts +0 -0
- /package/dist/{internal-components → internal/components}/conditional-wrapper/conditional-wrapper.js +0 -0
- /package/dist/{internal-components → internal/components}/conditional-wrapper/conditional-wrapper.types.d.ts +0 -0
- /package/dist/{internal-components → internal/components}/conditional-wrapper/conditional-wrapper.types.js +0 -0
- /package/dist/{internal-components → internal/components}/conditional-wrapper/index.d.ts +0 -0
- /package/dist/{internal-components → internal/components}/conditional-wrapper/index.js +0 -0
- /package/dist/{internal-components → internal/components}/content-header/content-header.d.ts +0 -0
- /package/dist/{internal-components → internal/components}/content-header/content-header.types.js +0 -0
- /package/dist/{internal-components → internal/components}/content-header/index.d.ts +0 -0
- /package/dist/{internal-components → internal/components}/content-header/index.js +0 -0
- /package/dist/{internal-components → internal/components}/dynamic-icon/dynamic-icon.d.ts +0 -0
- /package/dist/{internal-components → internal/components}/dynamic-icon/dynamic-icon.types.js +0 -0
- /package/dist/{internal-components → internal/components}/dynamic-icon/index.d.ts +0 -0
- /package/dist/{internal-components → internal/components}/dynamic-icon/index.js +0 -0
- /package/dist/{internal-components → internal/components}/image/index.d.ts +0 -0
- /package/dist/{internal-components → internal/components}/image/index.js +0 -0
- /package/dist/{internal-components → internal/components}/image/is-html-image-props.js +0 -0
- /package/dist/{internal-components → internal/components}/link/index.d.ts +0 -0
- /package/dist/{internal-components → internal/components}/link/index.js +0 -0
- /package/dist/{internal-components → internal/components}/link/link.d.ts +0 -0
- /package/dist/{internal-components → internal/components}/link/link.types.d.ts +0 -0
- /package/dist/{internal-components → internal/components}/link/link.types.js +0 -0
- /package/dist/{internal-components → internal/components}/modal-primitive/index.d.ts +0 -0
- /package/dist/{internal-components → internal/components}/modal-primitive/index.js +0 -0
- /package/dist/{internal-components → internal/components}/modal-primitive/modal-primitive.d.ts +0 -0
- /package/dist/{internal-components → internal/components}/modal-primitive/modal-primitive.types.d.ts +0 -0
- /package/dist/{internal-components → internal/components}/modal-primitive/modal-primitive.types.js +0 -0
- /package/dist/{internal-components → internal/components}/optional-icon-button/index.d.ts +0 -0
- /package/dist/{internal-components → internal/components}/optional-icon-button/index.js +0 -0
- /package/dist/{internal-components → internal/components}/optional-icon-button/optional-icon-button.d.ts +0 -0
- /package/dist/{internal-components → internal/components}/optional-icon-button/optional-icon-button.types.js +0 -0
- /package/dist/{internal-components → internal/components}/surface/index.d.ts +0 -0
- /package/dist/{internal-components → internal/components}/surface/index.js +0 -0
- /package/dist/{internal-components → internal/components}/surface/surface.d.ts +0 -0
- /package/dist/{internal-components → internal/components}/surface/surface.types.js +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dropdown.js","sourceRoot":"","sources":["../../../../../src/components/data-input/dropdowns/dropdown/dropdown.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAGb,OAAO,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAE9D,MAAM,OAAO,GAAG,CAAK,KAAe,EAAE,EAAE,CAAC,CAAC,KAAK,KAAK,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;AAEzE;;;;;;;;;;;;;;;GAeG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG,CAA0B,EACjD,KAAK,EACL,YAAY,EACZ,QAAQ,EACR,GAAG,KAAK,EACU,EAAE,EAAE,CAAC,CACvB,KAAC,YAAY,OACR,KAAK,EACT,KAAK,EAAE,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,EACvD,YAAY,EAAE,YAAY,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,YAAY,CAAC,EAC5E,QAAQ,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,QAAQ,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,GAC9C,CACF,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { InputProps } from '../../shared/input-props.types';
|
|
2
|
+
import { DropdownSharedProps, DropdownValue } from '../dropdown-base/dropdown-base.types';
|
|
3
|
+
/** Props for the single-select `Dropdown`. */
|
|
4
|
+
export type DropdownProps<T extends DropdownValue = DropdownValue> = InputProps<T | null, T | null> & DropdownSharedProps<T>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dropdown.types.js","sourceRoot":"","sources":["../../../../../src/components/data-input/dropdowns/dropdown/dropdown.types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/components/data-input/dropdowns/dropdown/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { DropdownBaseProps, DropdownValue } from './dropdown-base.types';
|
|
2
|
+
export declare const styles: {
|
|
3
|
+
interior: string;
|
|
4
|
+
fieldTrigger: string;
|
|
5
|
+
triggerLabel: import("../../../../styled-system/types").RecipeRuntimeFn<{
|
|
6
|
+
placeholder: {
|
|
7
|
+
true: {
|
|
8
|
+
opacity: "0.6";
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
}>;
|
|
12
|
+
popover: string;
|
|
13
|
+
listHeader: string;
|
|
14
|
+
option: import("../../../../styled-system/types").RecipeRuntimeFn<{
|
|
15
|
+
isSelected: {
|
|
16
|
+
true: {
|
|
17
|
+
backgroundColor: "active";
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
isActive: {
|
|
21
|
+
true: {
|
|
22
|
+
boxShadow: "inset 0 0 0 2px {colors.info.main}";
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
disabled: {
|
|
26
|
+
true: {
|
|
27
|
+
opacity: "0.5";
|
|
28
|
+
cursor: "not-allowed";
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
}>;
|
|
32
|
+
srOnly: string;
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* Shared engine for `Dropdown` and `MultiDropdown`: trigger, listbox, keyboard navigation,
|
|
36
|
+
* and a hidden native `select` for form submission and validation. Label and error slot come from `InputWrapper`.
|
|
37
|
+
* Selection is always an array; wrappers map it to their own value shape.
|
|
38
|
+
*
|
|
39
|
+
* @example
|
|
40
|
+
* <DropdownBase name="tags" title="Tags" options={options} value={tags} onChange={setTags} multiple />
|
|
41
|
+
*/
|
|
42
|
+
export declare const DropdownBase: <T extends DropdownValue>({ name, id: idProp, title, required, placeholder, size, disabled, divider, error, options, variant, color, icon, showLabel, value, defaultValue, onChange, multiple, }: DropdownBaseProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useEffect, useRef, useState } from 'react';
|
|
4
|
+
import { InputWrapper } from '../../shared/input-wrapper';
|
|
5
|
+
import { useFieldError } from '../../shared/use-field-error';
|
|
6
|
+
import { useInputId } from '../../shared/use-input-id';
|
|
7
|
+
import { baseInputStyles, inputIconSizes } from '../../shared/styles';
|
|
8
|
+
import { Icon, IconButton } from '../../../../components/ui';
|
|
9
|
+
import { css, cva, cx } from '../../../../styled-system/css';
|
|
10
|
+
import { useDismiss } from '../../../../hooks';
|
|
11
|
+
import { getUtilityIconSize } from '../../../../utils';
|
|
12
|
+
import { OptionalIconButton, useControllableState } from '../../../../internal';
|
|
13
|
+
export const styles = {
|
|
14
|
+
interior: css({
|
|
15
|
+
width: '100%',
|
|
16
|
+
position: 'relative',
|
|
17
|
+
color: 'text.standard',
|
|
18
|
+
// The `button` variant renders a library `Button`, so its invalid state is styled from here
|
|
19
|
+
'& > button[aria-invalid=true]': {
|
|
20
|
+
boxShadow: '0 0 0 2px {colors.error.main}',
|
|
21
|
+
},
|
|
22
|
+
}),
|
|
23
|
+
fieldTrigger: css({
|
|
24
|
+
display: 'flex',
|
|
25
|
+
alignItems: 'center',
|
|
26
|
+
gap: '2',
|
|
27
|
+
textAlign: 'start',
|
|
28
|
+
cursor: 'pointer',
|
|
29
|
+
}),
|
|
30
|
+
triggerLabel: cva({
|
|
31
|
+
base: {
|
|
32
|
+
flex: '1',
|
|
33
|
+
overflow: 'hidden',
|
|
34
|
+
textOverflow: 'ellipsis',
|
|
35
|
+
whiteSpace: 'nowrap',
|
|
36
|
+
},
|
|
37
|
+
variants: {
|
|
38
|
+
placeholder: {
|
|
39
|
+
true: { opacity: '0.6' },
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
}),
|
|
43
|
+
popover: css({
|
|
44
|
+
backgroundColor: 'overlay',
|
|
45
|
+
position: 'absolute',
|
|
46
|
+
width: 'fit-content',
|
|
47
|
+
minWidth: '75%',
|
|
48
|
+
borderRadius: 'md',
|
|
49
|
+
marginTop: '3',
|
|
50
|
+
boxShadow: 'lg',
|
|
51
|
+
zIndex: 'overlay',
|
|
52
|
+
maxHeight: '60',
|
|
53
|
+
overflow: 'auto',
|
|
54
|
+
}),
|
|
55
|
+
listHeader: css({
|
|
56
|
+
paddingX: '3',
|
|
57
|
+
paddingY: '1',
|
|
58
|
+
display: 'flex',
|
|
59
|
+
}),
|
|
60
|
+
option: cva({
|
|
61
|
+
base: {
|
|
62
|
+
cursor: 'pointer',
|
|
63
|
+
paddingX: '4',
|
|
64
|
+
paddingY: '2',
|
|
65
|
+
display: 'flex',
|
|
66
|
+
alignItems: 'center',
|
|
67
|
+
gap: '2',
|
|
68
|
+
_hover: { backgroundColor: 'hover' },
|
|
69
|
+
},
|
|
70
|
+
variants: {
|
|
71
|
+
isSelected: {
|
|
72
|
+
true: { backgroundColor: 'active' },
|
|
73
|
+
},
|
|
74
|
+
// Keyboard highlight; a ring so it stays visible on selected options
|
|
75
|
+
isActive: {
|
|
76
|
+
true: { boxShadow: 'inset 0 0 0 2px {colors.info.main}' },
|
|
77
|
+
},
|
|
78
|
+
disabled: {
|
|
79
|
+
true: { opacity: '0.5', cursor: 'not-allowed' },
|
|
80
|
+
},
|
|
81
|
+
},
|
|
82
|
+
}),
|
|
83
|
+
srOnly: css({ srOnly: true }),
|
|
84
|
+
};
|
|
85
|
+
/**
|
|
86
|
+
* Shared engine for `Dropdown` and `MultiDropdown`: trigger, listbox, keyboard navigation,
|
|
87
|
+
* and a hidden native `select` for form submission and validation. Label and error slot come from `InputWrapper`.
|
|
88
|
+
* Selection is always an array; wrappers map it to their own value shape.
|
|
89
|
+
*
|
|
90
|
+
* @example
|
|
91
|
+
* <DropdownBase name="tags" title="Tags" options={options} value={tags} onChange={setTags} multiple />
|
|
92
|
+
*/
|
|
93
|
+
export const DropdownBase = ({ name, id: idProp, title, required, placeholder, size = 'md', disabled, divider, error, options, variant = 'field', color = 'neutral', icon, showLabel = true, value, defaultValue, onChange, multiple = false, }) => {
|
|
94
|
+
const id = useInputId(idProp, name);
|
|
95
|
+
const containerRef = useRef(null);
|
|
96
|
+
const triggerRef = useRef(null);
|
|
97
|
+
const selectRef = useRef(null);
|
|
98
|
+
const [selected, setSelected] = useControllableState({
|
|
99
|
+
value,
|
|
100
|
+
defaultValue: defaultValue ?? [],
|
|
101
|
+
onChange,
|
|
102
|
+
elementRef: selectRef,
|
|
103
|
+
});
|
|
104
|
+
const { ref, message, validationProps, ariaProps } = useFieldError({
|
|
105
|
+
id,
|
|
106
|
+
error,
|
|
107
|
+
value: selected.join(),
|
|
108
|
+
elementRef: selectRef,
|
|
109
|
+
focusRef: triggerRef,
|
|
110
|
+
});
|
|
111
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
112
|
+
// Highlighted option for keyboard navigation; `-1` when none
|
|
113
|
+
const [activeIndex, setActiveIndex] = useState(-1);
|
|
114
|
+
const listId = `${id}-listbox`;
|
|
115
|
+
const optionId = (index) => `${id}-option-${index}`;
|
|
116
|
+
const close = () => {
|
|
117
|
+
setIsOpen(false);
|
|
118
|
+
setActiveIndex(-1);
|
|
119
|
+
};
|
|
120
|
+
useDismiss({ elementRef: containerRef, isOpen, onClose: close, dismissOnBlur: true });
|
|
121
|
+
// Keep the highlighted option in view while navigating
|
|
122
|
+
useEffect(() => {
|
|
123
|
+
if (isOpen && activeIndex >= 0) {
|
|
124
|
+
document.getElementById(optionId(activeIndex))?.scrollIntoView({ block: 'nearest' });
|
|
125
|
+
}
|
|
126
|
+
}, [isOpen, activeIndex]);
|
|
127
|
+
// Next enabled option from `from` in direction `dir`; stays put when there is none
|
|
128
|
+
const stepFrom = (from, dir) => {
|
|
129
|
+
const start = from === -1 && dir === -1 ? options.length : from;
|
|
130
|
+
for (let i = start + dir; i >= 0 && i < options.length; i += dir) {
|
|
131
|
+
if (!options[i].disabled)
|
|
132
|
+
return i;
|
|
133
|
+
}
|
|
134
|
+
return from;
|
|
135
|
+
};
|
|
136
|
+
// Open from the keyboard, highlighting the current selection or the first/last enabled option
|
|
137
|
+
const openFromKeyboard = (dir) => {
|
|
138
|
+
const selectedIndex = options.findIndex((option) => selected.includes(option.value));
|
|
139
|
+
setIsOpen(true);
|
|
140
|
+
setActiveIndex(selectedIndex >= 0 ? selectedIndex : stepFrom(-1, dir));
|
|
141
|
+
};
|
|
142
|
+
const selectOption = (option) => {
|
|
143
|
+
if (option.disabled)
|
|
144
|
+
return;
|
|
145
|
+
if (multiple) {
|
|
146
|
+
setSelected(selected.includes(option.value)
|
|
147
|
+
? selected.filter((v) => v !== option.value)
|
|
148
|
+
: [...selected, option.value]);
|
|
149
|
+
return;
|
|
150
|
+
}
|
|
151
|
+
setSelected([option.value]);
|
|
152
|
+
close();
|
|
153
|
+
};
|
|
154
|
+
const handleKeyDown = (e) => {
|
|
155
|
+
switch (e.key) {
|
|
156
|
+
case 'ArrowDown':
|
|
157
|
+
case 'ArrowUp': {
|
|
158
|
+
e.preventDefault();
|
|
159
|
+
const dir = e.key === 'ArrowDown' ? 1 : -1;
|
|
160
|
+
if (!isOpen) {
|
|
161
|
+
openFromKeyboard(dir);
|
|
162
|
+
}
|
|
163
|
+
else {
|
|
164
|
+
setActiveIndex((i) => stepFrom(i, dir));
|
|
165
|
+
}
|
|
166
|
+
break;
|
|
167
|
+
}
|
|
168
|
+
case 'Home':
|
|
169
|
+
case 'End': {
|
|
170
|
+
if (!isOpen)
|
|
171
|
+
return;
|
|
172
|
+
e.preventDefault();
|
|
173
|
+
setActiveIndex(stepFrom(-1, e.key === 'Home' ? 1 : -1));
|
|
174
|
+
break;
|
|
175
|
+
}
|
|
176
|
+
case 'Enter':
|
|
177
|
+
case ' ': {
|
|
178
|
+
// Handled here instead of the native click so an open list selects rather than toggles
|
|
179
|
+
e.preventDefault();
|
|
180
|
+
if (!isOpen) {
|
|
181
|
+
openFromKeyboard(1);
|
|
182
|
+
}
|
|
183
|
+
else if (options[activeIndex]) {
|
|
184
|
+
selectOption(options[activeIndex]);
|
|
185
|
+
}
|
|
186
|
+
else {
|
|
187
|
+
close();
|
|
188
|
+
}
|
|
189
|
+
break;
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
};
|
|
193
|
+
// Space fires the native click on keyup; block it so it can't re-toggle after `handleKeyDown`
|
|
194
|
+
const handleKeyUp = (e) => {
|
|
195
|
+
if (e.key === ' ')
|
|
196
|
+
e.preventDefault();
|
|
197
|
+
};
|
|
198
|
+
const selectedOptions = options.filter((option) => selected.includes(option.value));
|
|
199
|
+
const isPlaceholder = selectedOptions.length === 0;
|
|
200
|
+
const triggerLabel = isPlaceholder
|
|
201
|
+
? (placeholder ?? (!showLabel && title ? title : 'Select...'))
|
|
202
|
+
: multiple
|
|
203
|
+
? `${title ?? 'Selected'} (${selectedOptions.length})`
|
|
204
|
+
: selectedOptions[0].label;
|
|
205
|
+
const triggerProps = {
|
|
206
|
+
ref: triggerRef,
|
|
207
|
+
id,
|
|
208
|
+
type: 'button',
|
|
209
|
+
role: 'combobox',
|
|
210
|
+
disabled,
|
|
211
|
+
'aria-expanded': isOpen,
|
|
212
|
+
'aria-haspopup': 'listbox',
|
|
213
|
+
'aria-controls': isOpen ? listId : undefined,
|
|
214
|
+
'aria-activedescendant': isOpen && activeIndex >= 0 ? optionId(activeIndex) : undefined,
|
|
215
|
+
...ariaProps,
|
|
216
|
+
onClick: () => (isOpen ? close() : setIsOpen(true)),
|
|
217
|
+
onKeyDown: handleKeyDown,
|
|
218
|
+
onKeyUp: handleKeyUp,
|
|
219
|
+
};
|
|
220
|
+
return (_jsx(InputWrapper, { id: id, title: title, size: size, divider: divider, hideLabel: !showLabel, error: message, children: _jsxs("div", { ref: containerRef, className: styles.interior, children: [variant === 'field' ? (_jsxs("button", { ...triggerProps, className: cx(baseInputStyles({ size }), styles.fieldTrigger), children: [icon && _jsx(Icon, { name: icon, size: inputIconSizes[size] }), _jsx("span", { className: styles.triggerLabel({ placeholder: isPlaceholder }), children: triggerLabel }), _jsx(Icon, { name: isOpen ? 'CaretUp' : 'CaretDown', size: inputIconSizes[size] })] })) : (_jsxs(OptionalIconButton, { ...triggerProps, size: size, color: color, name: icon, children: [triggerLabel, _jsx(Icon, { name: isOpen ? 'CaretUp' : 'CaretDown', size: getUtilityIconSize(size) })] })), isOpen && (
|
|
221
|
+
// Block mousedown so focus stays on the trigger for `aria-activedescendant` and blur dismissal
|
|
222
|
+
_jsxs("div", { className: styles.popover, onMouseDown: (e) => e.preventDefault(), children: [multiple && selected.length > 0 && (_jsx("div", { className: styles.listHeader, children: _jsx(IconButton, { ariaLabel: "Clear selection", onClick: () => setSelected([]), color: "text", name: "X", text: true, size: "sm", children: "Clear" }) })), _jsx("ul", { id: listId, role: "listbox", "aria-multiselectable": multiple || undefined, "aria-labelledby": title ? `${id}-label` : undefined, children: options.map((option, index) => {
|
|
223
|
+
const isSelected = selected.includes(option.value);
|
|
224
|
+
return (_jsxs("li", { id: optionId(index), role: "option", "aria-selected": isSelected, "aria-disabled": option.disabled || undefined, className: styles.option({
|
|
225
|
+
isSelected,
|
|
226
|
+
isActive: index === activeIndex,
|
|
227
|
+
disabled: !!option.disabled,
|
|
228
|
+
}), onClick: () => selectOption(option), children: [multiple && (_jsx(Icon, { name: isSelected ? 'CheckSquare' : 'Square', size: 12 })), option.label] }, option.value));
|
|
229
|
+
}) })] })), _jsxs("select", { ref: ref, ...validationProps, name: name, required: required, disabled: disabled, multiple: multiple, value: multiple ? selected.map(String) : String(selected[0] ?? ''),
|
|
230
|
+
// Driven by the custom list; the handler only satisfies React's controlled-field check
|
|
231
|
+
onChange: () => { }, tabIndex: -1, "aria-hidden": true, className: styles.srOnly, children: [!multiple && _jsx("option", { value: "" }), options.map((option) => (_jsx("option", { value: String(option.value), disabled: option.disabled, children: option.label }, option.value)))] })] }) }));
|
|
232
|
+
};
|
|
233
|
+
//# sourceMappingURL=dropdown-base.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dropdown-base.js","sourceRoot":"","sources":["../../../../../src/components/data-input/dropdowns/dropdown-base/dropdown-base.tsx"],"names":[],"mappings":"AAAA,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,KAAK,CAKT,CACT,CAAC,IACM,IACJ,GACQ,CACf,CAAC;AACH,CAAC,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { ButtonProps, IconNames } from '../../../../components/ui';
|
|
2
|
+
import { BaseInputProps } from '../../shared/input-props.types';
|
|
3
|
+
/** Values a dropdown option can hold. */
|
|
4
|
+
export type DropdownValue = string | number;
|
|
5
|
+
/** A single option in the dropdown list. */
|
|
6
|
+
export type DropdownOption<T extends DropdownValue = DropdownValue> = {
|
|
7
|
+
/** Display text shown in the list */
|
|
8
|
+
label: string;
|
|
9
|
+
/** Value passed to `onChange` when this option is chosen */
|
|
10
|
+
value: T;
|
|
11
|
+
/** Block selecting this option */
|
|
12
|
+
disabled?: boolean;
|
|
13
|
+
};
|
|
14
|
+
/** Props shared by `Dropdown` and `MultiDropdown` on top of the base input props. */
|
|
15
|
+
export type DropdownSharedProps<T extends DropdownValue> = {
|
|
16
|
+
options: DropdownOption<T>[];
|
|
17
|
+
/** Trigger style: a form `field` or a `button` @default `field` */
|
|
18
|
+
variant?: 'field' | 'button';
|
|
19
|
+
/** Trigger color; applies to the `button` variant only @default `neutral` */
|
|
20
|
+
color?: ButtonProps['color'];
|
|
21
|
+
/** Icon rendered at the start of the trigger */
|
|
22
|
+
icon?: IconNames;
|
|
23
|
+
/** Show the `title` label above the trigger; when `false` it stays available to screen readers @default `true` */
|
|
24
|
+
showLabel?: boolean;
|
|
25
|
+
};
|
|
26
|
+
/** Internal props for `DropdownBase`; values are always arrays so single and multi share one path. */
|
|
27
|
+
export type DropdownBaseProps<T extends DropdownValue> = BaseInputProps & DropdownSharedProps<T> & {
|
|
28
|
+
/** Controlled selection */
|
|
29
|
+
value?: T[];
|
|
30
|
+
/** Initial selection for uncontrolled use */
|
|
31
|
+
defaultValue?: T[];
|
|
32
|
+
/** Called with the full next selection */
|
|
33
|
+
onChange?: (value: T[]) => void | Promise<void>;
|
|
34
|
+
/** Allow several selections and keep the list open on select @default `false` */
|
|
35
|
+
multiple?: boolean;
|
|
36
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dropdown-base.types.js","sourceRoot":"","sources":["../../../../../src/components/data-input/dropdowns/dropdown-base/dropdown-base.types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/components/data-input/dropdowns/dropdown-base/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/data-input/dropdowns/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,kBAAkB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/components/data-input/dropdowns/multi-dropdown/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { MultiDropdownProps } from './multi-dropdown.types';
|
|
2
|
+
import { DropdownValue } from '../dropdown-base/dropdown-base.types';
|
|
3
|
+
/**
|
|
4
|
+
* Multi-select dropdown that stays open on selection, shows a selected count on the trigger,
|
|
5
|
+
* and offers a clear action. Controlled when `value` is passed, uncontrolled otherwise.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* <MultiDropdown
|
|
9
|
+
* name="course"
|
|
10
|
+
* title="Course"
|
|
11
|
+
* options={[{ label: 'Main', value: 'main' }, { label: 'Dessert', value: 'dessert' }]}
|
|
12
|
+
* value={selected}
|
|
13
|
+
* onChange={setSelected}
|
|
14
|
+
* />
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* <MultiDropdown name="course" title="Course" options={options} variant="button" icon="Funnel" showLabel={false} />
|
|
18
|
+
*/
|
|
19
|
+
export declare const MultiDropdown: <T extends DropdownValue>(props: MultiDropdownProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { DropdownBase } from '../dropdown-base/dropdown-base';
|
|
4
|
+
/**
|
|
5
|
+
* Multi-select dropdown that stays open on selection, shows a selected count on the trigger,
|
|
6
|
+
* and offers a clear action. Controlled when `value` is passed, uncontrolled otherwise.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* <MultiDropdown
|
|
10
|
+
* name="course"
|
|
11
|
+
* title="Course"
|
|
12
|
+
* options={[{ label: 'Main', value: 'main' }, { label: 'Dessert', value: 'dessert' }]}
|
|
13
|
+
* value={selected}
|
|
14
|
+
* onChange={setSelected}
|
|
15
|
+
* />
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* <MultiDropdown name="course" title="Course" options={options} variant="button" icon="Funnel" showLabel={false} />
|
|
19
|
+
*/
|
|
20
|
+
export const MultiDropdown = (props) => (_jsx(DropdownBase, { ...props, multiple: true }));
|
|
21
|
+
//# sourceMappingURL=multi-dropdown.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"multi-dropdown.js","sourceRoot":"","sources":["../../../../../src/components/data-input/dropdowns/multi-dropdown/multi-dropdown.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAGb,OAAO,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAE9D;;;;;;;;;;;;;;;GAeG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,CAA0B,KAA4B,EAAE,EAAE,CAAC,CACvF,KAAC,YAAY,OAAK,KAAK,EAAE,QAAQ,SAAG,CACpC,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { InputProps } from '../../shared/input-props.types';
|
|
2
|
+
import { DropdownSharedProps, DropdownValue } from '../dropdown-base/dropdown-base.types';
|
|
3
|
+
/** Props for `MultiDropdown`. */
|
|
4
|
+
export type MultiDropdownProps<T extends DropdownValue = DropdownValue> = InputProps<T[], T[]> & DropdownSharedProps<T>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"multi-dropdown.types.js","sourceRoot":"","sources":["../../../../../src/components/data-input/dropdowns/multi-dropdown/multi-dropdown.types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Drag-and-drop target with a browse button and supported-formats notes for `FileUpload`.
|
|
3
|
+
* The browse button is the focus target when validation fails and carries the error ARIA wiring.
|
|
4
|
+
*
|
|
5
|
+
* @example
|
|
6
|
+
* {!isFull && <Dropzone />}
|
|
7
|
+
*/
|
|
8
|
+
export declare const Dropzone: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useRef, useState } from 'react';
|
|
4
|
+
import { Button, Icon } from '../../../../components/ui';
|
|
5
|
+
import { useFileUploadContext } from '../file-upload-context';
|
|
6
|
+
import { cva } from '../../../../styled-system/css';
|
|
7
|
+
import { Text } from '../../../../components/typography';
|
|
8
|
+
const styles = {
|
|
9
|
+
dropzone: cva({
|
|
10
|
+
base: {
|
|
11
|
+
borderWidth: 'lg',
|
|
12
|
+
borderStyle: 'dashed',
|
|
13
|
+
mx: 'auto',
|
|
14
|
+
rounded: 'lg',
|
|
15
|
+
display: 'flex',
|
|
16
|
+
alignItems: 'center',
|
|
17
|
+
borderColor: 'structure.default',
|
|
18
|
+
backgroundColor: 'inset',
|
|
19
|
+
width: '100%',
|
|
20
|
+
},
|
|
21
|
+
variants: {
|
|
22
|
+
size: {
|
|
23
|
+
sm: { flexDirection: 'row', gap: '3', p: '2', textAlign: 'start', fontSize: 'xs' },
|
|
24
|
+
md: { flexDirection: 'row', gap: '4', p: '4', textAlign: 'start' },
|
|
25
|
+
lg: { flexDirection: 'column', gap: '2', p: '6', textAlign: 'center' },
|
|
26
|
+
},
|
|
27
|
+
isDragging: {
|
|
28
|
+
true: { borderColor: 'info.main' },
|
|
29
|
+
},
|
|
30
|
+
disabled: {
|
|
31
|
+
true: { opacity: '0.5', cursor: 'not-allowed' },
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
defaultVariants: {
|
|
35
|
+
size: 'md',
|
|
36
|
+
},
|
|
37
|
+
}),
|
|
38
|
+
// Column items align with the dropzone's text direction so the button doesn't stretch
|
|
39
|
+
contents: cva({
|
|
40
|
+
base: {
|
|
41
|
+
display: 'flex',
|
|
42
|
+
flexDirection: 'column',
|
|
43
|
+
gap: '0.5',
|
|
44
|
+
},
|
|
45
|
+
variants: {
|
|
46
|
+
size: {
|
|
47
|
+
sm: { alignItems: 'flex-start' },
|
|
48
|
+
md: { alignItems: 'flex-start' },
|
|
49
|
+
lg: { alignItems: 'center' },
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
defaultVariants: {
|
|
53
|
+
size: 'md',
|
|
54
|
+
},
|
|
55
|
+
}),
|
|
56
|
+
// Drag prompt is hidden in `sm` to keep the compact layout to the button and notes
|
|
57
|
+
dragText: cva({
|
|
58
|
+
variants: {
|
|
59
|
+
size: {
|
|
60
|
+
sm: { display: 'none' },
|
|
61
|
+
md: {},
|
|
62
|
+
lg: {},
|
|
63
|
+
},
|
|
64
|
+
},
|
|
65
|
+
defaultVariants: {
|
|
66
|
+
size: 'md',
|
|
67
|
+
},
|
|
68
|
+
}),
|
|
69
|
+
};
|
|
70
|
+
// Sized to roughly match the text block beside it so row layouts center evenly
|
|
71
|
+
const iconSizes = {
|
|
72
|
+
sm: 24,
|
|
73
|
+
md: 32,
|
|
74
|
+
lg: 48,
|
|
75
|
+
};
|
|
76
|
+
/**
|
|
77
|
+
* Drag-and-drop target with a browse button and supported-formats notes for `FileUpload`.
|
|
78
|
+
* The browse button is the focus target when validation fails and carries the error ARIA wiring.
|
|
79
|
+
*
|
|
80
|
+
* @example
|
|
81
|
+
* {!isFull && <Dropzone />}
|
|
82
|
+
*/
|
|
83
|
+
export const Dropzone = () => {
|
|
84
|
+
const { size, disabled, maxFiles, formatsText, browseRef, browseAriaProps, addFiles, openPicker, } = useFileUploadContext();
|
|
85
|
+
const [isDragging, setIsDragging] = useState(false);
|
|
86
|
+
// Counts nested `dragenter`/`dragleave` pairs so moving over children doesn't flicker the highlight
|
|
87
|
+
const dragDepth = useRef(0);
|
|
88
|
+
const plural = maxFiles !== 1;
|
|
89
|
+
const handleDragEnter = (e) => {
|
|
90
|
+
e.preventDefault();
|
|
91
|
+
if (disabled)
|
|
92
|
+
return;
|
|
93
|
+
dragDepth.current++;
|
|
94
|
+
setIsDragging(true);
|
|
95
|
+
};
|
|
96
|
+
const handleDragOver = (e) => {
|
|
97
|
+
// Required for the element to accept a drop
|
|
98
|
+
e.preventDefault();
|
|
99
|
+
};
|
|
100
|
+
const handleDragLeave = (e) => {
|
|
101
|
+
e.preventDefault();
|
|
102
|
+
dragDepth.current = Math.max(0, dragDepth.current - 1);
|
|
103
|
+
if (dragDepth.current === 0)
|
|
104
|
+
setIsDragging(false);
|
|
105
|
+
};
|
|
106
|
+
const handleDrop = (e) => {
|
|
107
|
+
e.preventDefault();
|
|
108
|
+
dragDepth.current = 0;
|
|
109
|
+
setIsDragging(false);
|
|
110
|
+
if (!disabled)
|
|
111
|
+
addFiles(e.dataTransfer.files);
|
|
112
|
+
};
|
|
113
|
+
return (_jsxs("div", { className: styles.dropzone({ size, isDragging, disabled: !!disabled }), onDragEnter: handleDragEnter, onDragOver: handleDragOver, onDragLeave: handleDragLeave, onDrop: handleDrop, children: [_jsx(Icon, { name: "UploadSimple", size: iconSizes[size], color: "gray" }), _jsxs("div", { className: styles.contents({ size }), children: [_jsx("span", { className: styles.dragText({ size }), children: _jsxs(Text, { size: size == 'lg' ? 'md' : size, marginBottom: false, children: [plural
|
|
114
|
+
? 'Drag and Drop Your Files Here'
|
|
115
|
+
: 'Drag and Drop Your File Here', ' '] }) }), _jsx(Button, { ref: browseRef, text: true, size: size == 'lg' ? 'md' : size, onClick: openPicker, disabled: disabled, ...browseAriaProps, color: "info", children: plural ? 'Select Files' : 'Select a File' }), formatsText && (_jsx(Text, { marginBottom: false, color: "text-secondary", size: "xxs", children: formatsText }))] })] }));
|
|
116
|
+
};
|
|
117
|
+
//# sourceMappingURL=dropzone.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dropzone.js","sourceRoot":"","sources":["../../../../../src/components/data-input/file-upload/components/dropzone.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AACb,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACzC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,GAAG,EAAE,MAAM,qBAAqB,CAAC;AAC1C,OAAO,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAE/C,MAAM,MAAM,GAAG;IACd,QAAQ,EAAE,GAAG,CAAC;QACb,IAAI,EAAE;YACL,WAAW,EAAE,IAAI;YACjB,WAAW,EAAE,QAAQ;YACrB,EAAE,EAAE,MAAM;YACV,OAAO,EAAE,IAAI;YACb,OAAO,EAAE,MAAM;YACf,UAAU,EAAE,QAAQ;YACpB,WAAW,EAAE,mBAAmB;YAChC,eAAe,EAAE,OAAO;YACxB,KAAK,EAAE,MAAM;SACb;QACD,QAAQ,EAAE;YACT,IAAI,EAAE;gBACL,EAAE,EAAE,EAAE,aAAa,EAAE,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE;gBA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"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { FileUploadItem } from '../file-upload.types';
|
|
2
|
+
/** Props for `FileItem`. */
|
|
3
|
+
type FileItemProps = {
|
|
4
|
+
item: FileUploadItem;
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* Row in the `FileUpload` list: preview, remove, and, for new files, an inline editor for the name
|
|
8
|
+
* (and alt text for images). Editor fields have no `name`, so they never submit with the form.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* {items.map((item) => <FileItem key={getKey(item)} item={item} />)}
|
|
12
|
+
*/
|
|
13
|
+
export declare const FileItem: ({ item }: FileItemProps) => import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export {};
|