draft-components 1.13.0 → 2.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/css/draft-components.css +553 -558
- package/css/draft-components.dark.css +185 -113
- package/dist/components/alert/alert.d.ts +15 -0
- package/dist/components/alert/alert.js +12 -0
- package/dist/components/alert/index.d.ts +1 -0
- package/dist/components/alert/index.js +1 -0
- package/{types → dist}/components/avatar/avatar.d.ts +8 -7
- package/dist/components/avatar/avatar.js +41 -0
- package/dist/components/avatar/index.d.ts +1 -0
- package/dist/components/avatar/index.js +1 -0
- package/dist/components/avatar-group/avatar-group.js +5 -0
- package/dist/components/avatar-group/index.d.ts +1 -0
- package/dist/components/avatar-group/index.js +1 -0
- package/{esm → dist}/components/badge/badge.js +3 -6
- package/dist/components/badge/index.d.ts +1 -0
- package/dist/components/badge/index.js +1 -0
- package/dist/components/breadcrumbs/breadcrumbs-context.js +13 -0
- package/dist/components/breadcrumbs/breadcrumbs-item.js +16 -0
- package/dist/components/breadcrumbs/breadcrumbs.js +7 -0
- package/dist/components/breadcrumbs/index.d.ts +2 -0
- package/dist/components/breadcrumbs/index.js +2 -0
- package/{types → dist}/components/button/button.d.ts +12 -10
- package/dist/components/button/button.js +22 -0
- package/dist/components/button/icon-button.d.ts +4 -0
- package/dist/components/button/icon-button.js +7 -0
- package/dist/components/button/index.d.ts +2 -0
- package/dist/components/button/index.js +2 -0
- package/dist/components/button-group/button-group.js +5 -0
- package/dist/components/button-group/index.d.ts +1 -0
- package/dist/components/button-group/index.js +1 -0
- package/dist/components/caption/caption.d.ts +10 -0
- package/dist/components/caption/caption.js +10 -0
- package/dist/components/caption/index.d.ts +1 -0
- package/dist/components/caption/index.js +1 -0
- package/dist/components/checkbox/checkbox.js +15 -0
- package/dist/components/checkbox/index.d.ts +1 -0
- package/dist/components/checkbox/index.js +1 -0
- package/dist/components/color-picker/color-picker-button.js +11 -0
- package/{esm → dist}/components/color-picker/color-picker.js +4 -7
- package/dist/components/color-picker/index.d.ts +1 -0
- package/dist/components/color-picker/index.js +1 -0
- package/{esm → dist}/components/date-picker/calendar-day.js +4 -7
- package/{types → dist}/components/date-picker/calendar-grid-head.d.ts +1 -1
- package/dist/components/date-picker/calendar-grid-head.js +11 -0
- package/{types → dist}/components/date-picker/calendar-grid.d.ts +2 -2
- package/{esm → dist}/components/date-picker/calendar-grid.js +7 -10
- package/dist/components/date-picker/calendar-header.js +43 -0
- package/{types → dist}/components/date-picker/calendar.d.ts +3 -3
- package/dist/components/date-picker/calendar.js +19 -0
- package/{esm → dist}/components/date-picker/date-helpers.js +20 -22
- package/{types → dist}/components/date-picker/date-picker.d.ts +2 -2
- package/dist/components/date-picker/date-picker.js +15 -0
- package/{types → dist}/components/date-picker/date-range-picker.d.ts +3 -3
- package/{esm → dist}/components/date-picker/date-range-picker.js +4 -7
- package/{types → dist}/components/date-picker/date-range.d.ts +1 -1
- package/{esm → dist}/components/date-picker/date-range.js +1 -4
- package/dist/components/date-picker/index.d.ts +2 -0
- package/dist/components/date-picker/index.js +2 -0
- package/{types → dist}/components/date-picker/parse-min-max-props.d.ts +1 -1
- package/{esm → dist}/components/date-picker/parse-min-max-props.js +1 -4
- package/{types → dist}/components/date-picker-popover/date-picker-popover.d.ts +2 -2
- package/dist/components/date-picker-popover/date-picker-popover.js +15 -0
- package/dist/components/date-picker-popover/index.d.ts +1 -0
- package/dist/components/date-picker-popover/index.js +1 -0
- package/dist/components/date-range-picker-popover/date-range-picker-popover-footer.js +5 -0
- package/{types → dist}/components/date-range-picker-popover/date-range-picker-popover-presets.d.ts +1 -1
- package/dist/components/date-range-picker-popover/date-range-picker-popover-presets.js +30 -0
- package/{types → dist}/components/date-range-picker-popover/date-range-picker-popover.d.ts +3 -3
- package/{esm → dist}/components/date-range-picker-popover/date-range-picker-popover.js +7 -14
- package/{types → dist}/components/date-range-picker-popover/helpers.d.ts +1 -1
- package/{esm → dist}/components/date-range-picker-popover/helpers.js +1 -3
- package/dist/components/date-range-picker-popover/index.d.ts +2 -0
- package/dist/components/date-range-picker-popover/index.js +2 -0
- package/{types → dist}/components/date-range-picker-popover/types.d.ts +1 -1
- package/dist/components/date-range-picker-popover/types.js +1 -0
- package/{esm → dist}/components/date-range-picker-popover/use-is-compact-view.js +2 -5
- package/dist/components/dialog/dialog-body.js +7 -0
- package/{esm → dist}/components/dialog/dialog-context.js +4 -7
- package/dist/components/dialog/dialog-footer.js +8 -0
- package/dist/components/dialog/dialog-header.js +15 -0
- package/{esm → dist}/components/dialog/dialog.js +9 -15
- package/dist/components/dialog/index.d.ts +4 -0
- package/dist/components/dialog/index.js +4 -0
- package/dist/components/empty-state/empty-state.d.ts +12 -0
- package/dist/components/empty-state/empty-state.js +17 -0
- package/dist/components/empty-state/index.d.ts +1 -0
- package/dist/components/empty-state/index.js +1 -0
- package/{esm → dist}/components/file-picker/file-picker.js +6 -10
- package/dist/components/file-picker/index.d.ts +1 -0
- package/dist/components/file-picker/index.js +1 -0
- package/dist/components/filter-buttons/filter-button.js +6 -0
- package/{esm → dist}/components/filter-buttons/filter-buttons.js +4 -7
- package/dist/components/filter-buttons/index.d.ts +2 -0
- package/dist/components/filter-buttons/index.js +2 -0
- package/{types → dist}/components/filtered-search/filter-item.d.ts +1 -1
- package/dist/components/filtered-search/filter-item.js +17 -0
- package/dist/components/filtered-search/filter-operator-select.js +12 -0
- package/dist/components/filtered-search/filter-token.js +12 -0
- package/dist/components/filtered-search/filter-value-list.js +15 -0
- package/{types → dist}/components/filtered-search/filtered-search.d.ts +1 -1
- package/{esm → dist}/components/filtered-search/filtered-search.js +11 -16
- package/{types → dist}/components/filtered-search/index.d.ts +4 -4
- package/dist/components/filtered-search/index.js +3 -0
- package/dist/components/filtered-search/model/abstract-filter.js +2 -0
- package/{types → dist}/components/filtered-search/model/string-filter.d.ts +2 -2
- package/{esm → dist}/components/filtered-search/model/string-filter.js +1 -4
- package/{types → dist}/components/filtered-search/model/string-set-filter.d.ts +1 -1
- package/{esm → dist}/components/filtered-search/model/string-set-filter.js +1 -4
- package/dist/components/filtered-search/model/validation-result.js +1 -0
- package/dist/components/filtered-search/string-filter-input.js +15 -0
- package/{types → dist}/components/filtered-search/string-filter-item.d.ts +1 -1
- package/{esm → dist}/components/filtered-search/string-filter-item.js +6 -10
- package/{types → dist}/components/filtered-search/string-set-filter-item.d.ts +1 -1
- package/{esm → dist}/components/filtered-search/string-set-filter-item.js +6 -10
- package/{types → dist}/components/filtered-search/types.d.ts +2 -2
- package/dist/components/filtered-search/types.js +1 -0
- package/{esm → dist}/components/filtered-search/use-combobox-ids.js +2 -5
- package/{esm → dist}/components/filtered-search/use-translations.js +4 -7
- package/{types → dist}/components/form-field/form-field.d.ts +7 -3
- package/dist/components/form-field/form-field.js +37 -0
- package/dist/components/form-field/index.d.ts +1 -0
- package/dist/components/form-field/index.js +1 -0
- package/dist/components/hero-icons/24/outline/arrow-small-down-icon.d.ts +4 -0
- package/dist/components/hero-icons/24/outline/arrow-small-down-icon.js +5 -0
- package/dist/components/hero-icons/24/outline/arrow-small-up-icon.d.ts +4 -0
- package/dist/components/hero-icons/24/outline/arrow-small-up-icon.js +5 -0
- package/dist/components/hero-icons/24/outline/arrows-up-down-icon.d.ts +4 -0
- package/dist/components/hero-icons/24/outline/arrows-up-down-icon.js +5 -0
- package/dist/components/hero-icons/24/outline/chevron-left-icon.d.ts +4 -0
- package/dist/components/hero-icons/24/outline/chevron-left-icon.js +5 -0
- package/dist/components/hero-icons/24/outline/chevron-right-icon.d.ts +4 -0
- package/dist/components/hero-icons/24/outline/chevron-right-icon.js +5 -0
- package/dist/components/hero-icons/24/outline/eye-icon.d.ts +4 -0
- package/dist/components/hero-icons/24/outline/eye-icon.js +5 -0
- package/dist/components/hero-icons/24/outline/eye-slash-icon.d.ts +4 -0
- package/dist/components/hero-icons/24/outline/eye-slash-icon.js +5 -0
- package/dist/components/hero-icons/24/outline/magnifying-glass-icon.d.ts +4 -0
- package/dist/components/hero-icons/24/outline/magnifying-glass-icon.js +5 -0
- package/dist/components/hero-icons/24/outline/trash-icon.d.ts +4 -0
- package/dist/components/hero-icons/24/outline/trash-icon.js +5 -0
- package/dist/components/hero-icons/24/outline/x-mark-icon.d.ts +4 -0
- package/dist/components/hero-icons/24/outline/x-mark-icon.js +5 -0
- package/dist/components/hero-icons/24/solid/exclamation-triangle-icon.d.ts +4 -0
- package/dist/components/hero-icons/24/solid/exclamation-triangle-icon.js +5 -0
- package/dist/components/index.d.ts +42 -0
- package/dist/components/index.js +42 -0
- package/dist/components/label/index.d.ts +1 -0
- package/dist/components/label/index.js +1 -0
- package/dist/components/label/label.js +8 -0
- package/dist/components/menu/index.d.ts +3 -0
- package/dist/components/menu/index.js +3 -0
- package/{types → dist}/components/menu/menu-item.d.ts +4 -6
- package/dist/components/menu/menu-item.js +16 -0
- package/dist/components/menu/menu-separator.js +5 -0
- package/{types → dist}/components/menu/menu.d.ts +6 -5
- package/{esm → dist}/components/menu/menu.js +7 -11
- package/dist/components/nav-list/index.d.ts +3 -0
- package/dist/components/nav-list/index.js +3 -0
- package/dist/components/nav-list/nav-list-item.js +15 -0
- package/dist/components/nav-list/nav-list-title.js +5 -0
- package/dist/components/nav-list/nav-list.js +5 -0
- package/dist/components/password-input/index.d.ts +1 -0
- package/dist/components/password-input/index.js +1 -0
- package/dist/components/password-input/password-input.d.ts +9 -0
- package/dist/components/password-input/password-input.js +17 -0
- package/dist/components/popover/index.d.ts +1 -0
- package/dist/components/popover/index.js +1 -0
- package/{types → dist}/components/popover/popover.d.ts +1 -1
- package/{esm → dist}/components/popover/popover.js +8 -11
- package/{esm → dist}/components/popover/use-page-click.js +2 -5
- package/dist/components/portal/index.d.ts +1 -0
- package/dist/components/portal/index.js +1 -0
- package/{esm → dist}/components/portal/portal-context.js +6 -5
- package/{esm → dist}/components/portal/portal.js +1 -4
- package/{types → dist}/components/positioner/calc-position.d.ts +1 -1
- package/{esm → dist}/components/positioner/calc-position.js +2 -4
- package/dist/components/positioner/index.d.ts +1 -0
- package/dist/components/positioner/index.js +1 -0
- package/{types → dist}/components/positioner/positioner.d.ts +1 -1
- package/{esm → dist}/components/positioner/positioner.js +5 -8
- package/dist/components/positioner/types.js +1 -0
- package/dist/components/radio/index.d.ts +1 -0
- package/dist/components/radio/index.js +1 -0
- package/dist/components/radio/radio.js +23 -0
- package/dist/components/segmented-control/index.d.ts +1 -0
- package/dist/components/segmented-control/index.js +1 -0
- package/dist/components/segmented-control/segmented-button.d.ts +11 -0
- package/dist/components/segmented-control/segmented-button.js +10 -0
- package/{types → dist}/components/segmented-control/segmented-control.d.ts +5 -3
- package/dist/components/segmented-control/segmented-control.js +15 -0
- package/dist/components/select/index.d.ts +1 -0
- package/dist/components/select/index.js +1 -0
- package/{types → dist}/components/select/select.d.ts +9 -9
- package/dist/components/select/select.js +34 -0
- package/dist/components/selection-control/index.d.ts +1 -0
- package/dist/components/selection-control/index.js +1 -0
- package/dist/components/selection-control/selection-control.js +15 -0
- package/{types → dist}/components/slide-over/index.d.ts +4 -4
- package/dist/components/slide-over/index.js +3 -0
- package/dist/components/slide-over/slide-over-body.js +5 -0
- package/{types → dist}/components/slide-over/slide-over-context.d.ts +1 -1
- package/dist/components/slide-over/slide-over-context.js +18 -0
- package/dist/components/slide-over/slide-over-header.js +13 -0
- package/{types → dist}/components/slide-over/slide-over.d.ts +3 -3
- package/{esm → dist}/components/slide-over/slide-over.js +7 -12
- package/dist/components/slide-over/types.js +1 -0
- package/dist/components/slider/index.d.ts +2 -0
- package/dist/components/slider/index.js +2 -0
- package/dist/components/slider/slider-tick-marks.js +12 -0
- package/{types → dist}/components/slider/slider.d.ts +1 -1
- package/{esm → dist}/components/slider/slider.js +5 -8
- package/dist/components/spinner/index.d.ts +1 -0
- package/dist/components/spinner/index.js +1 -0
- package/dist/components/spinner/spinner.js +6 -0
- package/dist/components/switch/index.d.ts +1 -0
- package/dist/components/switch/index.js +1 -0
- package/dist/components/switch/switch.js +12 -0
- package/dist/components/table/index.d.ts +7 -0
- package/dist/components/table/index.js +7 -0
- package/dist/components/table/table-body.js +6 -0
- package/dist/components/table/table-cell.js +6 -0
- package/{esm → dist}/components/table/table-container.js +3 -6
- package/{types → dist}/components/table/table-head-cell.d.ts +1 -1
- package/dist/components/table/table-head-cell.js +27 -0
- package/dist/components/table/table-head.js +9 -0
- package/dist/components/table/table-row.js +9 -0
- package/{esm → dist}/components/table/table.js +3 -6
- package/dist/components/tabs/index.d.ts +4 -0
- package/dist/components/tabs/index.js +4 -0
- package/{esm → dist}/components/tabs/tab-list.js +3 -6
- package/{types → dist}/components/tabs/tab-panel.d.ts +1 -1
- package/dist/components/tabs/tab-panel.js +11 -0
- package/dist/components/tabs/tab.js +14 -0
- package/{types → dist}/components/tabs/tabs-context.d.ts +1 -1
- package/{esm → dist}/components/tabs/tabs-context.js +5 -8
- package/{types → dist}/components/tabs/tabs.d.ts +1 -1
- package/dist/components/tabs/tabs.js +6 -0
- package/dist/components/tabs/types.js +1 -0
- package/dist/components/tag/index.d.ts +1 -0
- package/dist/components/tag/index.js +1 -0
- package/dist/components/tag/tag.d.ts +15 -0
- package/dist/components/tag/tag.js +11 -0
- package/dist/components/text-input/index.d.ts +1 -0
- package/dist/components/text-input/index.js +1 -0
- package/{types → dist}/components/text-input/text-input.d.ts +12 -13
- package/dist/components/text-input/text-input.js +42 -0
- package/dist/components/textarea/index.d.ts +1 -0
- package/dist/components/textarea/index.js +1 -0
- package/dist/components/textarea/textarea.d.ts +12 -0
- package/dist/components/textarea/textarea.js +19 -0
- package/dist/components/toast/index.d.ts +2 -0
- package/dist/components/toast/index.js +2 -0
- package/dist/components/toast/toast-button.js +6 -0
- package/dist/components/toast/toast.js +6 -0
- package/dist/components/toaster/index.d.ts +1 -0
- package/dist/components/toaster/index.js +1 -0
- package/{esm → dist}/components/toaster/toaster.js +9 -13
- package/dist/components/tooltip/index.d.ts +1 -0
- package/dist/components/tooltip/index.js +1 -0
- package/{types → dist}/components/tooltip/tooltip.d.ts +1 -1
- package/{esm → dist}/components/tooltip/tooltip.js +8 -11
- package/dist/hooks/index.d.ts +4 -0
- package/dist/hooks/index.js +4 -0
- package/{esm → dist}/hooks/use-disable-body-scroll.js +1 -4
- package/{esm → dist}/hooks/use-esc-key-down.js +2 -5
- package/{esm → dist}/hooks/use-focus-trap.js +1 -4
- package/{esm → dist}/hooks/use-mount-transition.js +2 -5
- package/dist/index.d.ts +3 -0
- package/dist/index.js +3 -0
- package/{esm → dist}/lib/helpers.js +3 -5
- package/dist/lib/index.d.ts +3 -0
- package/dist/lib/index.js +3 -0
- package/{esm → dist}/lib/keyboard-keys.js +1 -3
- package/{esm → dist}/lib/react-helpers.js +6 -9
- package/package.json +41 -55
- package/cjs/components/alert/alert.cjs +0 -19
- package/cjs/components/avatar/avatar.cjs +0 -31
- package/cjs/components/avatar-group/avatar-group.cjs +0 -10
- package/cjs/components/badge/badge.cjs +0 -23
- package/cjs/components/breadcrumbs/breadcrumbs-context.cjs +0 -19
- package/cjs/components/breadcrumbs/breadcrumbs-item.cjs +0 -21
- package/cjs/components/breadcrumbs/breadcrumbs.cjs +0 -12
- package/cjs/components/button/button.cjs +0 -41
- package/cjs/components/button/icon-button.cjs +0 -12
- package/cjs/components/button-group/button-group.cjs +0 -10
- package/cjs/components/caption/caption.cjs +0 -27
- package/cjs/components/caption/icons.cjs +0 -21
- package/cjs/components/checkbox/checkbox.cjs +0 -20
- package/cjs/components/color-picker/color-picker-button.cjs +0 -16
- package/cjs/components/color-picker/color-picker.cjs +0 -24
- package/cjs/components/date-picker/calendar-day.cjs +0 -17
- package/cjs/components/date-picker/calendar-grid-head.cjs +0 -16
- package/cjs/components/date-picker/calendar-grid.cjs +0 -106
- package/cjs/components/date-picker/calendar-header.cjs +0 -48
- package/cjs/components/date-picker/calendar.cjs +0 -24
- package/cjs/components/date-picker/date-helpers.cjs +0 -112
- package/cjs/components/date-picker/date-picker.cjs +0 -20
- package/cjs/components/date-picker/date-range-picker.cjs +0 -61
- package/cjs/components/date-picker/date-range.cjs +0 -28
- package/cjs/components/date-picker/icons.cjs +0 -13
- package/cjs/components/date-picker/parse-min-max-props.cjs +0 -20
- package/cjs/components/date-picker-popover/date-picker-popover.cjs +0 -24
- package/cjs/components/date-range-picker-popover/date-range-picker-popover-footer.cjs +0 -11
- package/cjs/components/date-range-picker-popover/date-range-picker-popover-presets.cjs +0 -35
- package/cjs/components/date-range-picker-popover/date-range-picker-popover.cjs +0 -59
- package/cjs/components/date-range-picker-popover/helpers.cjs +0 -15
- package/cjs/components/date-range-picker-popover/use-is-compact-view.cjs +0 -27
- package/cjs/components/dialog/dialog-body.cjs +0 -12
- package/cjs/components/dialog/dialog-context.cjs +0 -24
- package/cjs/components/dialog/dialog-footer.cjs +0 -13
- package/cjs/components/dialog/dialog-header.cjs +0 -21
- package/cjs/components/dialog/dialog.cjs +0 -50
- package/cjs/components/dialog/x-mark-icon.cjs +0 -9
- package/cjs/components/empty-state/empty-state.cjs +0 -10
- package/cjs/components/file-picker/file-picker.cjs +0 -47
- package/cjs/components/filter-buttons/filter-button.cjs +0 -11
- package/cjs/components/filter-buttons/filter-buttons.cjs +0 -27
- package/cjs/components/filtered-search/filter-item.cjs +0 -23
- package/cjs/components/filtered-search/filter-operator-select.cjs +0 -17
- package/cjs/components/filtered-search/filter-token.cjs +0 -17
- package/cjs/components/filtered-search/filter-value-list.cjs +0 -20
- package/cjs/components/filtered-search/filtered-search.cjs +0 -225
- package/cjs/components/filtered-search/icons.cjs +0 -21
- package/cjs/components/filtered-search/model/abstract-filter.cjs +0 -6
- package/cjs/components/filtered-search/model/string-filter.cjs +0 -46
- package/cjs/components/filtered-search/model/string-set-filter.cjs +0 -44
- package/cjs/components/filtered-search/string-filter-input.cjs +0 -17
- package/cjs/components/filtered-search/string-filter-item.cjs +0 -68
- package/cjs/components/filtered-search/string-set-filter-item.cjs +0 -77
- package/cjs/components/filtered-search/use-combobox-ids.cjs +0 -17
- package/cjs/components/filtered-search/use-translations.cjs +0 -24
- package/cjs/components/form-field/form-field.cjs +0 -26
- package/cjs/components/index.cjs +0 -141
- package/cjs/components/label/label.cjs +0 -13
- package/cjs/components/menu/menu-item.cjs +0 -21
- package/cjs/components/menu/menu-separator.cjs +0 -10
- package/cjs/components/menu/menu.cjs +0 -191
- package/cjs/components/nav-list/nav-list-item.cjs +0 -20
- package/cjs/components/nav-list/nav-list-title.cjs +0 -10
- package/cjs/components/nav-list/nav-list.cjs +0 -10
- package/cjs/components/password-input/icons.cjs +0 -13
- package/cjs/components/password-input/password-input.cjs +0 -30
- package/cjs/components/popover/popover.cjs +0 -96
- package/cjs/components/popover/use-page-click.cjs +0 -51
- package/cjs/components/portal/portal-context.cjs +0 -22
- package/cjs/components/portal/portal.cjs +0 -11
- package/cjs/components/positioner/calc-position.cjs +0 -117
- package/cjs/components/positioner/positioner.cjs +0 -64
- package/cjs/components/radio/radio.cjs +0 -28
- package/cjs/components/segmented-control/segmented-control-button.cjs +0 -15
- package/cjs/components/segmented-control/segmented-control.cjs +0 -48
- package/cjs/components/select/select.cjs +0 -39
- package/cjs/components/selection-control/selection-control.cjs +0 -18
- package/cjs/components/slide-over/slide-over-body.cjs +0 -10
- package/cjs/components/slide-over/slide-over-context.cjs +0 -24
- package/cjs/components/slide-over/slide-over-header.cjs +0 -21
- package/cjs/components/slide-over/slide-over.cjs +0 -113
- package/cjs/components/slider/slider-tick-marks.cjs +0 -17
- package/cjs/components/slider/slider.cjs +0 -41
- package/cjs/components/spinner/spinner.cjs +0 -11
- package/cjs/components/switch/switch.cjs +0 -17
- package/cjs/components/table/icons.cjs +0 -17
- package/cjs/components/table/table-body.cjs +0 -11
- package/cjs/components/table/table-cell.cjs +0 -11
- package/cjs/components/table/table-container.cjs +0 -23
- package/cjs/components/table/table-head-cell.cjs +0 -30
- package/cjs/components/table/table-head.cjs +0 -14
- package/cjs/components/table/table-row.cjs +0 -14
- package/cjs/components/table/table.cjs +0 -16
- package/cjs/components/tabs/tab-list.cjs +0 -67
- package/cjs/components/tabs/tab-panel.cjs +0 -16
- package/cjs/components/tabs/tab.cjs +0 -19
- package/cjs/components/tabs/tabs-context.cjs +0 -31
- package/cjs/components/tabs/tabs.cjs +0 -11
- package/cjs/components/tag/tag.cjs +0 -16
- package/cjs/components/text-input/text-input.cjs +0 -42
- package/cjs/components/textarea/textarea.cjs +0 -40
- package/cjs/components/toast/toast-button.cjs +0 -11
- package/cjs/components/toast/toast.cjs +0 -11
- package/cjs/components/toast/x-mark-icon.cjs +0 -9
- package/cjs/components/toaster/toaster.cjs +0 -115
- package/cjs/components/tooltip/tooltip.cjs +0 -75
- package/cjs/hooks/index.cjs +0 -13
- package/cjs/hooks/use-disable-body-scroll.cjs +0 -37
- package/cjs/hooks/use-esc-key-down.cjs +0 -56
- package/cjs/hooks/use-focus-trap.cjs +0 -89
- package/cjs/hooks/use-mount-transition.cjs +0 -41
- package/cjs/index.cjs +0 -161
- package/cjs/lib/helpers.cjs +0 -25
- package/cjs/lib/index.cjs +0 -17
- package/cjs/lib/keyboard-keys.cjs +0 -19
- package/cjs/lib/react-helpers.cjs +0 -58
- package/esm/components/alert/alert.js +0 -17
- package/esm/components/avatar/avatar.js +0 -29
- package/esm/components/avatar-group/avatar-group.js +0 -8
- package/esm/components/breadcrumbs/breadcrumbs-context.js +0 -16
- package/esm/components/breadcrumbs/breadcrumbs-item.js +0 -19
- package/esm/components/breadcrumbs/breadcrumbs.js +0 -10
- package/esm/components/button/button.js +0 -39
- package/esm/components/button/icon-button.js +0 -10
- package/esm/components/button-group/button-group.js +0 -8
- package/esm/components/caption/caption.js +0 -25
- package/esm/components/caption/icons.js +0 -16
- package/esm/components/checkbox/checkbox.js +0 -18
- package/esm/components/color-picker/color-picker-button.js +0 -14
- package/esm/components/date-picker/calendar-grid-head.js +0 -14
- package/esm/components/date-picker/calendar-header.js +0 -46
- package/esm/components/date-picker/calendar.js +0 -22
- package/esm/components/date-picker/date-picker.js +0 -18
- package/esm/components/date-picker/icons.js +0 -10
- package/esm/components/date-picker-popover/date-picker-popover.js +0 -22
- package/esm/components/date-range-picker-popover/date-range-picker-popover-footer.js +0 -9
- package/esm/components/date-range-picker-popover/date-range-picker-popover-presets.js +0 -33
- package/esm/components/dialog/dialog-body.js +0 -10
- package/esm/components/dialog/dialog-footer.js +0 -11
- package/esm/components/dialog/dialog-header.js +0 -19
- package/esm/components/dialog/x-mark-icon.js +0 -7
- package/esm/components/empty-state/empty-state.js +0 -8
- package/esm/components/filter-buttons/filter-button.js +0 -9
- package/esm/components/filtered-search/filter-item.js +0 -21
- package/esm/components/filtered-search/filter-operator-select.js +0 -15
- package/esm/components/filtered-search/filter-token.js +0 -15
- package/esm/components/filtered-search/filter-value-list.js +0 -18
- package/esm/components/filtered-search/icons.js +0 -16
- package/esm/components/filtered-search/model/abstract-filter.js +0 -4
- package/esm/components/filtered-search/string-filter-input.js +0 -15
- package/esm/components/form-field/form-field.js +0 -24
- package/esm/components/index.js +0 -68
- package/esm/components/label/label.js +0 -11
- package/esm/components/menu/menu-item.js +0 -19
- package/esm/components/menu/menu-separator.js +0 -8
- package/esm/components/nav-list/nav-list-item.js +0 -18
- package/esm/components/nav-list/nav-list-title.js +0 -8
- package/esm/components/nav-list/nav-list.js +0 -8
- package/esm/components/password-input/icons.js +0 -10
- package/esm/components/password-input/password-input.js +0 -28
- package/esm/components/radio/radio.js +0 -26
- package/esm/components/segmented-control/segmented-control-button.js +0 -13
- package/esm/components/segmented-control/segmented-control.js +0 -46
- package/esm/components/select/select.js +0 -37
- package/esm/components/selection-control/selection-control.js +0 -16
- package/esm/components/slide-over/slide-over-body.js +0 -8
- package/esm/components/slide-over/slide-over-context.js +0 -21
- package/esm/components/slide-over/slide-over-header.js +0 -19
- package/esm/components/slider/slider-tick-marks.js +0 -15
- package/esm/components/spinner/spinner.js +0 -9
- package/esm/components/switch/switch.js +0 -15
- package/esm/components/table/icons.js +0 -13
- package/esm/components/table/table-body.js +0 -9
- package/esm/components/table/table-cell.js +0 -9
- package/esm/components/table/table-head-cell.js +0 -28
- package/esm/components/table/table-head.js +0 -12
- package/esm/components/table/table-row.js +0 -12
- package/esm/components/tabs/tab-panel.js +0 -14
- package/esm/components/tabs/tab.js +0 -17
- package/esm/components/tabs/tabs.js +0 -9
- package/esm/components/tag/tag.js +0 -14
- package/esm/components/text-input/text-input.js +0 -40
- package/esm/components/textarea/textarea.js +0 -38
- package/esm/components/toast/toast-button.js +0 -9
- package/esm/components/toast/toast.js +0 -9
- package/esm/components/toast/x-mark-icon.js +0 -7
- package/esm/hooks/index.js +0 -4
- package/esm/index.js +0 -75
- package/esm/lib/index.js +0 -3
- package/types/components/alert/alert.d.ts +0 -12
- package/types/components/alert/index.d.ts +0 -1
- package/types/components/avatar/index.d.ts +0 -1
- package/types/components/avatar-group/index.d.ts +0 -1
- package/types/components/badge/index.d.ts +0 -1
- package/types/components/breadcrumbs/index.d.ts +0 -2
- package/types/components/button/icon-button.d.ts +0 -7
- package/types/components/button/index.d.ts +0 -2
- package/types/components/button-group/index.d.ts +0 -1
- package/types/components/caption/caption.d.ts +0 -7
- package/types/components/caption/icons.d.ts +0 -5
- package/types/components/caption/index.d.ts +0 -1
- package/types/components/checkbox/index.d.ts +0 -1
- package/types/components/color-picker/index.d.ts +0 -1
- package/types/components/date-picker/icons.d.ts +0 -3
- package/types/components/date-picker/index.d.ts +0 -2
- package/types/components/date-picker-popover/index.d.ts +0 -1
- package/types/components/date-range-picker-popover/index.d.ts +0 -2
- package/types/components/dialog/index.d.ts +0 -4
- package/types/components/dialog/x-mark-icon.d.ts +0 -2
- package/types/components/empty-state/empty-state.d.ts +0 -11
- package/types/components/empty-state/index.d.ts +0 -1
- package/types/components/file-picker/index.d.ts +0 -1
- package/types/components/filter-buttons/index.d.ts +0 -2
- package/types/components/filtered-search/icons.d.ts +0 -5
- package/types/components/form-field/index.d.ts +0 -1
- package/types/components/index.d.ts +0 -42
- package/types/components/label/index.d.ts +0 -1
- package/types/components/menu/index.d.ts +0 -3
- package/types/components/nav-list/index.d.ts +0 -3
- package/types/components/password-input/icons.d.ts +0 -3
- package/types/components/password-input/index.d.ts +0 -1
- package/types/components/password-input/password-input.d.ts +0 -10
- package/types/components/popover/index.d.ts +0 -1
- package/types/components/portal/index.d.ts +0 -1
- package/types/components/positioner/index.d.ts +0 -1
- package/types/components/radio/index.d.ts +0 -1
- package/types/components/segmented-control/index.d.ts +0 -1
- package/types/components/segmented-control/segmented-control-button.d.ts +0 -10
- package/types/components/select/index.d.ts +0 -1
- package/types/components/selection-control/index.d.ts +0 -1
- package/types/components/slider/index.d.ts +0 -2
- package/types/components/spinner/index.d.ts +0 -1
- package/types/components/switch/index.d.ts +0 -1
- package/types/components/table/icons.d.ts +0 -4
- package/types/components/table/index.d.ts +0 -7
- package/types/components/tabs/index.d.ts +0 -4
- package/types/components/tag/index.d.ts +0 -1
- package/types/components/tag/tag.d.ts +0 -18
- package/types/components/text-input/index.d.ts +0 -1
- package/types/components/textarea/index.d.ts +0 -1
- package/types/components/textarea/textarea.d.ts +0 -20
- package/types/components/toast/index.d.ts +0 -2
- package/types/components/toast/x-mark-icon.d.ts +0 -2
- package/types/components/toaster/index.d.ts +0 -1
- package/types/components/tooltip/index.d.ts +0 -1
- package/types/hooks/index.d.ts +0 -4
- package/types/index.d.ts +0 -3
- package/types/lib/index.d.ts +0 -3
- /package/{types → dist}/components/avatar-group/avatar-group.d.ts +0 -0
- /package/{types → dist}/components/badge/badge.d.ts +0 -0
- /package/{types → dist}/components/breadcrumbs/breadcrumbs-context.d.ts +0 -0
- /package/{types → dist}/components/breadcrumbs/breadcrumbs-item.d.ts +0 -0
- /package/{types → dist}/components/breadcrumbs/breadcrumbs.d.ts +0 -0
- /package/{types → dist}/components/button-group/button-group.d.ts +0 -0
- /package/{types → dist}/components/checkbox/checkbox.d.ts +0 -0
- /package/{types → dist}/components/color-picker/color-picker-button.d.ts +0 -0
- /package/{types → dist}/components/color-picker/color-picker.d.ts +0 -0
- /package/{types → dist}/components/date-picker/calendar-day.d.ts +0 -0
- /package/{types → dist}/components/date-picker/calendar-header.d.ts +0 -0
- /package/{types → dist}/components/date-picker/date-helpers.d.ts +0 -0
- /package/{types → dist}/components/date-range-picker-popover/date-range-picker-popover-footer.d.ts +0 -0
- /package/{types → dist}/components/date-range-picker-popover/use-is-compact-view.d.ts +0 -0
- /package/{types → dist}/components/dialog/dialog-body.d.ts +0 -0
- /package/{types → dist}/components/dialog/dialog-context.d.ts +0 -0
- /package/{types → dist}/components/dialog/dialog-footer.d.ts +0 -0
- /package/{types → dist}/components/dialog/dialog-header.d.ts +0 -0
- /package/{types → dist}/components/dialog/dialog.d.ts +0 -0
- /package/{types → dist}/components/file-picker/file-picker.d.ts +0 -0
- /package/{types → dist}/components/filter-buttons/filter-button.d.ts +0 -0
- /package/{types → dist}/components/filter-buttons/filter-buttons.d.ts +0 -0
- /package/{types → dist}/components/filtered-search/filter-operator-select.d.ts +0 -0
- /package/{types → dist}/components/filtered-search/filter-token.d.ts +0 -0
- /package/{types → dist}/components/filtered-search/filter-value-list.d.ts +0 -0
- /package/{types → dist}/components/filtered-search/model/abstract-filter.d.ts +0 -0
- /package/{types → dist}/components/filtered-search/model/validation-result.d.ts +0 -0
- /package/{types → dist}/components/filtered-search/string-filter-input.d.ts +0 -0
- /package/{types → dist}/components/filtered-search/use-combobox-ids.d.ts +0 -0
- /package/{types → dist}/components/filtered-search/use-translations.d.ts +0 -0
- /package/{types → dist}/components/label/label.d.ts +0 -0
- /package/{types → dist}/components/menu/menu-separator.d.ts +0 -0
- /package/{types → dist}/components/nav-list/nav-list-item.d.ts +0 -0
- /package/{types → dist}/components/nav-list/nav-list-title.d.ts +0 -0
- /package/{types → dist}/components/nav-list/nav-list.d.ts +0 -0
- /package/{types → dist}/components/popover/use-page-click.d.ts +0 -0
- /package/{types → dist}/components/portal/portal-context.d.ts +0 -0
- /package/{types → dist}/components/portal/portal.d.ts +0 -0
- /package/{types → dist}/components/positioner/types.d.ts +0 -0
- /package/{types → dist}/components/radio/radio.d.ts +0 -0
- /package/{types → dist}/components/selection-control/selection-control.d.ts +0 -0
- /package/{types → dist}/components/slide-over/slide-over-body.d.ts +0 -0
- /package/{types → dist}/components/slide-over/slide-over-header.d.ts +0 -0
- /package/{types → dist}/components/slide-over/types.d.ts +0 -0
- /package/{types → dist}/components/slider/slider-tick-marks.d.ts +0 -0
- /package/{types → dist}/components/spinner/spinner.d.ts +0 -0
- /package/{types → dist}/components/switch/switch.d.ts +0 -0
- /package/{types → dist}/components/table/table-body.d.ts +0 -0
- /package/{types → dist}/components/table/table-cell.d.ts +0 -0
- /package/{types → dist}/components/table/table-container.d.ts +0 -0
- /package/{types → dist}/components/table/table-head.d.ts +0 -0
- /package/{types → dist}/components/table/table-row.d.ts +0 -0
- /package/{types → dist}/components/table/table.d.ts +0 -0
- /package/{types → dist}/components/tabs/tab-list.d.ts +0 -0
- /package/{types → dist}/components/tabs/tab.d.ts +0 -0
- /package/{types → dist}/components/tabs/types.d.ts +0 -0
- /package/{types → dist}/components/toast/toast-button.d.ts +0 -0
- /package/{types → dist}/components/toast/toast.d.ts +0 -0
- /package/{types → dist}/components/toaster/toaster.d.ts +0 -0
- /package/{types → dist}/hooks/use-disable-body-scroll.d.ts +0 -0
- /package/{types → dist}/hooks/use-esc-key-down.d.ts +0 -0
- /package/{types → dist}/hooks/use-focus-trap.d.ts +0 -0
- /package/{types → dist}/hooks/use-mount-transition.d.ts +0 -0
- /package/{types → dist}/lib/helpers.d.ts +0 -0
- /package/{types → dist}/lib/keyboard-keys.d.ts +0 -0
- /package/{types → dist}/lib/react-helpers.d.ts +0 -0
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
-
import { forwardRef } from 'react';
|
|
3
|
-
import { classNames } from '../../lib/react-helpers.js';
|
|
4
|
-
import { InfoIcon, SuccessIcon, ErrorIcon, WarningIcon } from './icons.js';
|
|
5
|
-
|
|
6
|
-
const iconMapping = {
|
|
7
|
-
default: InfoIcon,
|
|
8
|
-
info: InfoIcon,
|
|
9
|
-
success: SuccessIcon,
|
|
10
|
-
error: ErrorIcon,
|
|
11
|
-
warning: WarningIcon,
|
|
12
|
-
};
|
|
13
|
-
const Caption = forwardRef(function Caption({ showIcon = false, appearance = 'default', className, children, ...props }, ref) {
|
|
14
|
-
let icon = null;
|
|
15
|
-
if (showIcon) {
|
|
16
|
-
const Icon = iconMapping[appearance];
|
|
17
|
-
icon = jsx(Icon, { className: "dc-caption__icon", "data-testid": "caption-icon" });
|
|
18
|
-
}
|
|
19
|
-
return (jsxs("div", { ...props, ref: ref, className: classNames(className, {
|
|
20
|
-
'dc-caption': true,
|
|
21
|
-
[`dc-caption_appearance_${appearance}`]: appearance,
|
|
22
|
-
}), children: [icon, children] }));
|
|
23
|
-
});
|
|
24
|
-
|
|
25
|
-
export { Caption };
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { jsx } from 'react/jsx-runtime';
|
|
2
|
-
|
|
3
|
-
function InfoIcon(props) {
|
|
4
|
-
return (jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 20 20", width: 20, height: 20, "aria-hidden": true, ...props, children: jsx("path", { fill: "currentColor", d: "M10 3C6.13425 3 3 6.13425 3 10C3 13.8657 6.13425 17 10 17C13.8657 17 17 13.8657 17 10C17 6.13425 13.8657 3 10 3ZM10.2631 12.7492C10.3698 12.7364 10.5361 12.7131 10.7863 12.6472C10.8454 12.6334 10.9075 12.6392 10.9629 12.6638C11.0184 12.6885 11.0644 12.7305 11.0937 12.7837C11.1252 12.8386 11.1395 12.9017 11.1351 12.9648C11.1306 13.0279 11.1075 13.0883 11.0687 13.1383C10.4241 13.9031 9.71592 14.2082 8.95875 14.0378C8.59417 13.9556 8.42267 13.7462 8.3445 13.5887C8.19283 13.2801 8.22317 12.8712 8.44075 12.3339C8.44075 12.3339 9.17283 10.532 9.2615 10.3202C9.29358 10.2479 9.25917 10.161 9.15358 10.168C8.97693 10.1893 8.80205 10.2234 8.63033 10.2701C8.57121 10.2842 8.50909 10.2785 8.45354 10.2538C8.39799 10.2292 8.35209 10.1869 8.32292 10.1336C8.29151 10.0786 8.27713 10.0156 8.2816 9.95244C8.28606 9.8893 8.30917 9.82891 8.348 9.77892C8.99258 9.01417 9.70075 8.70908 10.4579 8.87942C10.8225 8.96108 10.994 9.17108 11.0722 9.32858C11.2238 9.63717 11.1935 10.0461 10.9759 10.5833C10.9759 10.5833 10.2438 12.3852 10.1552 12.597C10.1231 12.6687 10.1581 12.7562 10.2631 12.7492V12.7492ZM12.3182 7.326C12.2535 7.62844 12.0715 7.89287 11.8121 8.06128C11.5527 8.22969 11.2371 8.28833 10.9345 8.22433C10.632 8.15965 10.3676 7.97767 10.1991 7.71829C10.0305 7.45892 9.97176 7.14331 10.0356 6.84067C10.107 6.54518 10.2909 6.28921 10.5481 6.1272C10.8053 5.96518 11.1156 5.90991 11.4129 5.97313C11.7103 6.03635 11.9712 6.21309 12.1403 6.46574C12.3093 6.71839 12.3732 7.02702 12.3182 7.326V7.326Z" }) }));
|
|
5
|
-
}
|
|
6
|
-
function SuccessIcon(props) {
|
|
7
|
-
return (jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 20 20", width: 20, height: 20, "aria-hidden": true, ...props, children: jsx("path", { fill: "currentColor", d: "M12.828 7.97583L9.91133 12.6425C9.86481 12.7169 9.8021 12.7799 9.72787 12.8268C9.65364 12.8737 9.5698 12.9032 9.48259 12.9132C9.46069 12.9155 9.43869 12.9166 9.41667 12.9167C9.34006 12.9167 9.26418 12.9017 9.19341 12.8724C9.12263 12.843 9.05835 12.8 9.00425 12.7457L7.25425 10.9957C7.14799 10.8857 7.0892 10.7384 7.09053 10.5854C7.09186 10.4325 7.1532 10.2862 7.26136 10.178C7.36951 10.0699 7.51582 10.0085 7.66877 10.0072C7.82172 10.0059 7.96907 10.0647 8.07909 10.1709L9.3105 11.4023L11.8387 7.3575C11.9207 7.22631 12.0514 7.13306 12.2022 7.09827C12.3529 7.06348 12.5113 7.09 12.6425 7.172C12.7737 7.254 12.8669 7.38475 12.9017 7.5355C12.9365 7.68625 12.91 7.84464 12.828 7.97583M10 3C8.61553 3 7.26215 3.41054 6.11101 4.17971C4.95987 4.94888 4.06266 6.04213 3.53285 7.32121C3.00303 8.6003 2.86441 10.0078 3.13451 11.3656C3.4046 12.7235 4.07129 13.9708 5.05026 14.9497C6.02922 15.9287 7.2765 16.5954 8.63437 16.8655C9.99224 17.1356 11.3997 16.997 12.6788 16.4672C13.9579 15.9373 15.0511 15.0401 15.8203 13.889C16.5895 12.7378 17 11.3845 17 10C17 8.14348 16.2625 6.36301 14.9497 5.05025C13.637 3.7375 11.8565 3 10 3" }) }));
|
|
8
|
-
}
|
|
9
|
-
function ErrorIcon(props) {
|
|
10
|
-
return (jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 20 20", width: 20, height: 20, "aria-hidden": true, ...props, children: jsx("path", { fill: "currentColor", d: "M10 14.0833C9.82694 14.0833 9.65777 14.032 9.51388 13.9359C9.36999 13.8397 9.25783 13.7031 9.19161 13.5432C9.12538 13.3833 9.10805 13.2074 9.14181 13.0376C9.17558 12.8679 9.25891 12.712 9.38128 12.5896C9.50365 12.4672 9.65956 12.3839 9.8293 12.3501C9.99903 12.3164 10.175 12.3337 10.3348 12.3999C10.4947 12.4662 10.6314 12.5783 10.7275 12.7222C10.8237 12.8661 10.875 13.0353 10.875 13.2083C10.8747 13.4403 10.7824 13.6627 10.6184 13.8267C10.4544 13.9907 10.232 14.083 10 14.0833M9.384 6.17742C9.54824 6.01568 9.7695 5.92502 10 5.92502C10.2305 5.92502 10.4518 6.01568 10.616 6.17742C10.6961 6.25973 10.7588 6.35742 10.8002 6.46458C10.8416 6.57175 10.8609 6.68618 10.8569 6.801L10.7344 10.7426C10.7309 10.8563 10.6833 10.9641 10.6016 11.0433C10.52 11.1225 10.4107 11.1667 10.2969 11.1667H9.70367C9.59017 11.1669 9.48105 11.1229 9.39939 11.0441C9.31774 10.9653 9.26996 10.8578 9.26617 10.7443L9.14309 6.80042C9.13919 6.6857 9.15852 6.57137 9.19992 6.46431C9.24132 6.35725 9.30393 6.25967 9.384 6.17742M10 3C8.61553 3 7.26215 3.41054 6.11101 4.17971C4.95987 4.94888 4.06266 6.04213 3.53285 7.32121C3.00303 8.6003 2.86441 10.0078 3.13451 11.3656C3.4046 12.7235 4.07129 13.9708 5.05026 14.9497C6.02922 15.9287 7.2765 16.5954 8.63437 16.8655C9.99224 17.1356 11.3997 16.997 12.6788 16.4672C13.9579 15.9373 15.0511 15.0401 15.8203 13.889C16.5895 12.7378 17 11.3845 17 10C17 8.14348 16.2625 6.36301 14.9497 5.05025C13.637 3.7375 11.8565 3 10 3" }) }));
|
|
11
|
-
}
|
|
12
|
-
function WarningIcon(props) {
|
|
13
|
-
return (jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 20 20", width: 20, height: 20, "aria-hidden": true, ...props, children: jsx("path", { fill: "currentColor", d: "M9.99999 14.4617C9.8681 14.4617 9.73919 14.4243 9.62953 14.3544C9.51988 14.2845 9.43441 14.1851 9.38394 14.0688C9.33347 13.9526 9.32027 13.8246 9.346 13.7012C9.37173 13.5777 9.43523 13.4644 9.52849 13.3754C9.62174 13.2864 9.74055 13.2258 9.8699 13.2012C9.99925 13.1767 10.1333 13.1893 10.2552 13.2374C10.377 13.2856 10.4811 13.3672 10.5544 13.4718C10.6277 13.5764 10.6668 13.6995 10.6668 13.8253C10.6664 13.994 10.5961 14.1556 10.4711 14.2749C10.3461 14.3942 10.1767 14.4613 9.99999 14.4617M9.52122 8.28223C9.64998 8.16431 9.82153 8.09847 9.99999 8.09847C10.1784 8.09847 10.35 8.16431 10.4787 8.28223C10.5409 8.34158 10.5897 8.41246 10.622 8.49049C10.6544 8.56853 10.6696 8.65206 10.6668 8.73593L10.5708 11.6077C10.5673 11.6913 10.5298 11.7702 10.4663 11.8279C10.4029 11.8855 10.3183 11.9172 10.2307 11.9163H9.76927C9.68192 11.9171 9.59768 11.8855 9.53425 11.8281C9.47083 11.7708 9.43317 11.6923 9.4292 11.609L9.33318 8.73593C9.33038 8.65206 9.34562 8.56853 9.37796 8.49049C9.4103 8.41246 9.45906 8.34158 9.52122 8.28223M17.8362 15.1171L11.1082 3.62045C10.998 3.43231 10.8372 3.27563 10.6424 3.16656C10.4476 3.0575 10.2258 3 9.99999 3C9.77413 3 9.55236 3.0575 9.35756 3.16656C9.16275 3.27563 9.00196 3.43231 8.89176 3.62045L2.16374 15.1171L2.16241 15.1203C2.05169 15.3142 1.9958 15.5322 2.00025 15.753C2.00469 15.9738 2.06931 16.1897 2.18774 16.3794C2.30618 16.5691 2.47434 16.7261 2.67568 16.8349C2.87702 16.9437 3.10459 17.0006 3.33598 17H16.6653C16.8969 17.0003 17.1245 16.943 17.3258 16.8338C17.5272 16.7246 17.6952 16.5672 17.8133 16.3771C17.9315 16.1871 17.9958 15.971 17.9998 15.75C18.0038 15.5291 17.9474 15.3109 17.8362 15.1171" }) }));
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export { ErrorIcon, InfoIcon, SuccessIcon, WarningIcon };
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
-
import { forwardRef } from 'react';
|
|
3
|
-
import { classNames } from '../../lib/react-helpers.js';
|
|
4
|
-
|
|
5
|
-
const Checkbox = forwardRef(function Checkbox({ hasMixedState = false, style, className, onChange, onToggle, ...props }, ref) {
|
|
6
|
-
return (jsxs("label", { style: style, className: classNames('dc-checkbox', className), children: [jsx("input", { ...props, ref: ref, type: "checkbox", className: "dc-checkbox__input", onChange: (event) => {
|
|
7
|
-
onChange?.(event);
|
|
8
|
-
onToggle?.(event.target.checked);
|
|
9
|
-
} }), jsx("span", { className: "dc-checkbox__check", "data-testid": "checkbox-check", "aria-hidden": true, children: hasMixedState ? (jsx(DashIcon, { className: "dc-checkbox__icon", "data-testid": "checkbox-dash-icon" })) : (jsx(CheckIcon, { className: "dc-checkbox__icon", "data-testid": "checkbox-check-icon" })) })] }));
|
|
10
|
-
});
|
|
11
|
-
function CheckIcon(props) {
|
|
12
|
-
return (jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 20 20", width: 20, height: 20, ...props, children: jsx("path", { d: "M5 10.4444L9 14L15 6", fill: "none", stroke: "currentColor", strokeWidth: 2.5, strokeLinecap: "round", strokeLinejoin: "round" }) }));
|
|
13
|
-
}
|
|
14
|
-
function DashIcon(props) {
|
|
15
|
-
return (jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 20 20", width: 20, height: 20, ...props, children: jsx("path", { d: "M5 10H15", fill: "none", stroke: "currentColor", strokeWidth: 2.5, strokeLinecap: "round" }) }));
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export { Checkbox };
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
-
import { classNames } from '../../lib/react-helpers.js';
|
|
3
|
-
|
|
4
|
-
function ColorPickerButton({ style, className, label, name, color, value, checked, defaultChecked, onChange, onChangeValue, }) {
|
|
5
|
-
const customProperties = {
|
|
6
|
-
'--dc-color-picker-btn-color': color,
|
|
7
|
-
};
|
|
8
|
-
return (jsxs("label", { style: { ...customProperties, ...style }, className: classNames('dc-color-picker__btn', className), children: [jsx("input", { type: "radio", name: name, value: value, checked: checked, defaultChecked: defaultChecked, onChange: (event) => {
|
|
9
|
-
onChange?.(event);
|
|
10
|
-
onChangeValue?.(value);
|
|
11
|
-
} }), jsx("span", { className: "dc-color-picker__btn-check", "aria-hidden": true }), label] }));
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export { ColorPickerButton };
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { jsx } from 'react/jsx-runtime';
|
|
2
|
-
import { getStartOfWeek, DAYS_IN_WEEK, addDays } from './date-helpers.js';
|
|
3
|
-
|
|
4
|
-
function CalendarGridHead({ locale, weekStartsOn, }) {
|
|
5
|
-
const columns = [];
|
|
6
|
-
const monday = getStartOfWeek(new Date(), weekStartsOn);
|
|
7
|
-
for (let weekday = 0; weekday < DAYS_IN_WEEK; weekday += 1) {
|
|
8
|
-
const date = addDays(monday, weekday);
|
|
9
|
-
columns.push(jsx("th", { role: "columnheader", abbr: date.toLocaleDateString(locale, { weekday: 'long' }), children: date.toLocaleDateString(locale, { weekday: 'short' }) }, weekday));
|
|
10
|
-
}
|
|
11
|
-
return (jsx("thead", { children: jsx("tr", { role: "row", children: columns }) }));
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export { CalendarGridHead };
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
-
import { addMonths, setDateMonth, setDateYear, MONTHS_IN_YEAR } from './date-helpers.js';
|
|
3
|
-
import { classNames } from '../../lib/react-helpers.js';
|
|
4
|
-
import { useState, useEffect } from 'react';
|
|
5
|
-
import '../button/button.js';
|
|
6
|
-
import { IconButton } from '../button/icon-button.js';
|
|
7
|
-
import { Select } from '../select/select.js';
|
|
8
|
-
import { TextInput } from '../text-input/text-input.js';
|
|
9
|
-
import { ChevronLeftIcon, ChevronRightIcon } from './icons.js';
|
|
10
|
-
|
|
11
|
-
function CalendarHeader({ focusDay, onChangeFocusDay, className, locale, nextMonthButtonLabel = 'next month', prevMonthButtonLabel = 'previous month', monthSelectLabel = 'month', yearInputLabel = 'year', }) {
|
|
12
|
-
const selectedYear = focusDay.getFullYear();
|
|
13
|
-
const selectedMonth = focusDay.getMonth();
|
|
14
|
-
const [year, setYear] = useState(formatYear(selectedYear));
|
|
15
|
-
useEffect(() => {
|
|
16
|
-
setYear((prevYear) => (parseYear(prevYear) === selectedYear
|
|
17
|
-
? prevYear
|
|
18
|
-
: formatYear(selectedYear)));
|
|
19
|
-
}, [selectedYear]);
|
|
20
|
-
return (jsxs("div", { className: classNames('dc-calendar__header', className), children: [jsx(IconButton, { className: "dc-calendar-prev-month", size: "sm", "aria-label": prevMonthButtonLabel, icon: jsx(ChevronLeftIcon, { width: 14, height: 14 }), onClick: () => onChangeFocusDay(addMonths(focusDay, -1)) }), jsx(Select, { className: "dc-calendar-month-select", "aria-label": monthSelectLabel, size: "sm", name: "month", value: selectedMonth, onChange: (event) => {
|
|
21
|
-
const month = Number(event.target.value);
|
|
22
|
-
onChangeFocusDay(setDateMonth(focusDay, month));
|
|
23
|
-
}, children: generateMonthOptions(locale) }), jsx(TextInput, { className: "dc-calendar-year-input", "aria-label": yearInputLabel, width: "4ch", size: "sm", value: year, maxLength: 4, onBlur: () => setYear(formatYear(year)), onChangeValue: (value) => {
|
|
24
|
-
if (value.match(/^\d*$/)) {
|
|
25
|
-
setYear(value);
|
|
26
|
-
onChangeFocusDay(setDateYear(focusDay, parseYear(value)));
|
|
27
|
-
}
|
|
28
|
-
} }), jsx(IconButton, { className: "dc-calendar-next-month", "aria-label": nextMonthButtonLabel, icon: jsx(ChevronRightIcon, { width: 14, height: 14 }), onClick: () => onChangeFocusDay(addMonths(focusDay, 1)) })] }));
|
|
29
|
-
}
|
|
30
|
-
function generateMonthOptions(locale = 'en') {
|
|
31
|
-
const options = [];
|
|
32
|
-
const date = new Date();
|
|
33
|
-
for (let month = 0; month < MONTHS_IN_YEAR; month += 1) {
|
|
34
|
-
date.setMonth(month);
|
|
35
|
-
options.push(jsx("option", { value: month, children: date.toLocaleDateString(locale, { month: 'long' }) }, month));
|
|
36
|
-
}
|
|
37
|
-
return options;
|
|
38
|
-
}
|
|
39
|
-
function formatYear(year) {
|
|
40
|
-
return String(year).padStart(4, '0');
|
|
41
|
-
}
|
|
42
|
-
function parseYear(year) {
|
|
43
|
-
return Number(year);
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
export { CalendarHeader };
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
-
import { useState } from 'react';
|
|
3
|
-
import { classNames } from '../../lib/react-helpers.js';
|
|
4
|
-
import { getStartOfDay } from './date-helpers.js';
|
|
5
|
-
import { CalendarHeader } from './calendar-header.js';
|
|
6
|
-
import { CalendarGrid } from './calendar-grid.js';
|
|
7
|
-
|
|
8
|
-
function Calendar({ className, defaultFocusDay, minDate, maxDate, locale, weekStartsOn, nextMonthButtonLabel, prevMonthButtonLabel, getDayProps, onHoverDay, onFocusDay, onSelectDay, }) {
|
|
9
|
-
const [focusDay, setFocusDay] = useState(() => {
|
|
10
|
-
const focusDate = getStartOfDay(defaultFocusDay ?? new Date());
|
|
11
|
-
if (minDate && focusDate < minDate) {
|
|
12
|
-
return minDate;
|
|
13
|
-
}
|
|
14
|
-
if (maxDate && focusDate > maxDate) {
|
|
15
|
-
return maxDate;
|
|
16
|
-
}
|
|
17
|
-
return focusDate;
|
|
18
|
-
});
|
|
19
|
-
return (jsxs("div", { className: classNames('dc-calendar', className), children: [jsx(CalendarHeader, { focusDay: focusDay, onChangeFocusDay: setFocusDay, locale: locale, nextMonthButtonLabel: nextMonthButtonLabel, prevMonthButtonLabel: prevMonthButtonLabel }), jsx(CalendarGrid, { focusDay: focusDay, minDate: minDate, maxDate: maxDate, locale: locale, weekStartsOn: weekStartsOn, getDayProps: getDayProps, onHoverDay: onHoverDay, onFocusDay: onFocusDay, onSelectDay: onSelectDay, onChangeFocusDay: setFocusDay })] }));
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
export { Calendar };
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { jsx } from 'react/jsx-runtime';
|
|
2
|
-
import { isValidDateISO, parseDateISO, toDateISO, isSameDay } from './date-helpers.js';
|
|
3
|
-
import { classNames } from '../../lib/react-helpers.js';
|
|
4
|
-
import { parseMinMaxProps } from './parse-min-max-props.js';
|
|
5
|
-
import { Calendar } from './calendar.js';
|
|
6
|
-
|
|
7
|
-
function DatePicker({ value, onChangeValue, weekStartsOn = 1, min, max, locale, prevMonthButtonLabel, nextMonthButtonLabel, monthSelectLabel, yearInputLabel, className, ...props }) {
|
|
8
|
-
const { minDate, maxDate } = parseMinMaxProps({ min, max });
|
|
9
|
-
const selectedDay = value && isValidDateISO(value)
|
|
10
|
-
? parseDateISO(value)
|
|
11
|
-
: null;
|
|
12
|
-
const getDayProps = (date) => ({
|
|
13
|
-
isSelected: selectedDay != null && isSameDay(selectedDay, date),
|
|
14
|
-
});
|
|
15
|
-
return (jsx("div", { ...props, className: classNames('dc-datepicker', className), children: jsx(Calendar, { defaultFocusDay: selectedDay, minDate: minDate, maxDate: maxDate, locale: locale, weekStartsOn: weekStartsOn, prevMonthButtonLabel: prevMonthButtonLabel, nextMonthButtonLabel: nextMonthButtonLabel, monthSelectLabel: monthSelectLabel, yearInputLabel: yearInputLabel, getDayProps: getDayProps, onSelectDay: (date) => onChangeValue(toDateISO(date)) }) }));
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export { DatePicker };
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { jsx } from 'react/jsx-runtime';
|
|
2
|
-
|
|
3
|
-
function ChevronLeftIcon(props) {
|
|
4
|
-
return (jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", width: "1em", height: "1em", ...props, children: jsx("path", { fill: "none", stroke: "currentColor", strokeWidth: 3, strokeLinecap: "round", strokeLinejoin: "round", d: "M15.75 19.5L8.25 12l7.5-7.5" }) }));
|
|
5
|
-
}
|
|
6
|
-
function ChevronRightIcon(props) {
|
|
7
|
-
return (jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", width: "1em", height: "1em", ...props, children: jsx("path", { fill: "none", stroke: "currentColor", strokeWidth: 3, strokeLinecap: "round", strokeLinejoin: "round", d: "M8.25 4.5l7.5 7.5-7.5 7.5" }) }));
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export { ChevronLeftIcon, ChevronRightIcon };
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
-
import { classNames } from '../../lib/react-helpers.js';
|
|
3
|
-
import { useRef } from 'react';
|
|
4
|
-
import { Popover } from '../popover/popover.js';
|
|
5
|
-
import { DatePicker } from '../date-picker/date-picker.js';
|
|
6
|
-
import '../button/button.js';
|
|
7
|
-
import '../button/icon-button.js';
|
|
8
|
-
import '../select/select.js';
|
|
9
|
-
import '../text-input/text-input.js';
|
|
10
|
-
|
|
11
|
-
function DatePickerPopover({ defaultIsOpen = false, footer, className, children, value, onChangeValue,
|
|
12
|
-
// DatePickerProps
|
|
13
|
-
min, max, locale, weekStartsOn, prevMonthButtonLabel, nextMonthButtonLabel, monthSelectLabel, yearInputLabel, }) {
|
|
14
|
-
const popoverRef = useRef(null);
|
|
15
|
-
const handleChangeValue = (value) => {
|
|
16
|
-
onChangeValue(value);
|
|
17
|
-
popoverRef.current?.close();
|
|
18
|
-
};
|
|
19
|
-
return (jsxs(Popover, { ref: popoverRef, className: classNames('dc-date-picker-popover', className), defaultIsOpen: defaultIsOpen, anchor: children, children: [jsx(DatePicker, { min: min, max: max, locale: locale, weekStartsOn: weekStartsOn, prevMonthButtonLabel: prevMonthButtonLabel, nextMonthButtonLabel: nextMonthButtonLabel, monthSelectLabel: monthSelectLabel, yearInputLabel: yearInputLabel, value: value, onChangeValue: handleChangeValue }), footer] }));
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
export { DatePickerPopover };
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
-
import { Button } from '../button/button.js';
|
|
3
|
-
import '../button/icon-button.js';
|
|
4
|
-
|
|
5
|
-
function DateRangePickerPopoverFooter({ children, cancelButtonLabel, confirmButtonLabel, onClickCancelButton, onClickConfirmButton, }) {
|
|
6
|
-
return (jsxs("div", { className: "dc-date-range-picker-popover__footer", children: [Boolean(children) && (jsx("div", { className: "dc-date-range-picker-popover__footer-content", children: children })), jsx(Button, { className: "dc-date-range-picker-popover__footer-cancel", variant: "tinted", onClick: onClickCancelButton, children: cancelButtonLabel }), jsx(Button, { className: "dc-date-range-picker-popover__footer-confirm", appearance: "primary", onClick: onClickConfirmButton, children: confirmButtonLabel })] }));
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
export { DateRangePickerPopoverFooter };
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
-
import { useId } from 'react';
|
|
3
|
-
import { findSelectedOption } from './helpers.js';
|
|
4
|
-
import { Select } from '../select/select.js';
|
|
5
|
-
import { Radio } from '../radio/radio.js';
|
|
6
|
-
import { SelectionControl } from '../selection-control/selection-control.js';
|
|
7
|
-
|
|
8
|
-
function DateRangePickerPopoverPresets({ isCompactView, customPresetLabel, options, value, onChangeValue, }) {
|
|
9
|
-
const id = useId();
|
|
10
|
-
const name = `${id}-date-preset`;
|
|
11
|
-
const selectedOption = findSelectedOption(value, options);
|
|
12
|
-
const selectedPreset = selectedOption ? selectedOption.preset : '';
|
|
13
|
-
function handleChange(event) {
|
|
14
|
-
const value = event.target.value;
|
|
15
|
-
const option = options.find((option) => option.preset === value);
|
|
16
|
-
if (option) {
|
|
17
|
-
onChangeValue({
|
|
18
|
-
preset: option.preset,
|
|
19
|
-
range: option.range,
|
|
20
|
-
});
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
if (isCompactView) {
|
|
24
|
-
return (jsx("div", { className: "dc-date-range-picker-popover__presets", children: jsxs(Select, { size: "md", isBlock: true, value: selectedPreset, onChange: handleChange, children: [jsx("option", { value: "", disabled: true, children: customPresetLabel }), options.map((option) => (jsx("option", { value: option.preset, children: option.label }, option.preset)))] }) }));
|
|
25
|
-
}
|
|
26
|
-
return (jsx("ul", { className: "dc-date-range-picker-popover__presets", children: options.map((option) => {
|
|
27
|
-
const preset = option.preset;
|
|
28
|
-
const id = `${name}-${preset}`;
|
|
29
|
-
return (jsx("li", { children: jsx(SelectionControl, { label: option.label, labelFor: id, children: jsx(Radio, { icon: "check", id: id, name: name, value: preset, checked: preset === selectedPreset, onChange: handleChange }) }) }, option.preset));
|
|
30
|
-
}) }));
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
export { DateRangePickerPopoverPresets };
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { jsx } from 'react/jsx-runtime';
|
|
2
|
-
import { useRef } from 'react';
|
|
3
|
-
import { classNames } from '../../lib/react-helpers.js';
|
|
4
|
-
|
|
5
|
-
function DialogBody({ className, children, }) {
|
|
6
|
-
const ref = useRef(null);
|
|
7
|
-
return (jsx("div", { ref: ref, className: classNames('dc-dialog-body', className), children: children }));
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export { DialogBody };
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { jsx } from 'react/jsx-runtime';
|
|
2
|
-
import { classNames } from '../../lib/react-helpers.js';
|
|
3
|
-
|
|
4
|
-
function DialogFooter({ hasBorder, className, children, }) {
|
|
5
|
-
return (jsx("div", { className: classNames(className, {
|
|
6
|
-
'dc-dialog-footer': true,
|
|
7
|
-
'dc-dialog-footer_has_border': hasBorder,
|
|
8
|
-
}), children: children }));
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export { DialogFooter };
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
-
import { classNames } from '../../lib/react-helpers.js';
|
|
3
|
-
import { useDialogContext } from './dialog-context.js';
|
|
4
|
-
import '../button/button.js';
|
|
5
|
-
import { IconButton } from '../button/icon-button.js';
|
|
6
|
-
import { XMarkIcon } from './x-mark-icon.js';
|
|
7
|
-
|
|
8
|
-
function DialogHeader({ hasBorder, heading, subheading, className, children, }) {
|
|
9
|
-
const { titleId, descriptionId, onClose, } = useDialogContext();
|
|
10
|
-
const shouldRenderHeading = Boolean(heading);
|
|
11
|
-
const shouldRenderDescription = Boolean(subheading);
|
|
12
|
-
const shouldRenderChildren = Boolean(children);
|
|
13
|
-
return (jsxs("div", { className: classNames(className, {
|
|
14
|
-
'dc-dialog-header': true,
|
|
15
|
-
'dc-dialog-header_has_border': hasBorder,
|
|
16
|
-
}), children: [jsxs("div", { className: "dc-dialog-header__title-bar", children: [shouldRenderHeading && (jsx("h2", { id: titleId, className: "dc-dialog-header__heading", children: heading })), jsx(IconButton, { icon: jsx(XMarkIcon, { width: 18, height: 18, strokeWidth: 2 }), variant: "plain", className: "dc-dialog-header__close-btn", onClick: () => onClose() })] }), shouldRenderDescription && (jsx("div", { id: descriptionId, className: "dc-dialog-header__subheading", children: subheading })), shouldRenderChildren && (jsx("div", { className: "dc-dialog-header__body", children: children }))] }));
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export { DialogHeader };
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { jsx } from 'react/jsx-runtime';
|
|
2
|
-
|
|
3
|
-
function XMarkIcon(props) {
|
|
4
|
-
return (jsx("svg", { width: 24, height: 24, fill: "none", stroke: "currentColor", strokeWidth: 1.5, ...props, xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" }) }));
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
export { XMarkIcon };
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
-
import { classNames } from '../../lib/react-helpers.js';
|
|
3
|
-
|
|
4
|
-
function EmptyState({ className, image, heading, description, primaryAction, secondaryAction, children, }) {
|
|
5
|
-
return (jsxs("section", { className: classNames('dc-empty-state', className), children: [Boolean(image) && (jsx("div", { className: "dc-empty-state__image", children: image })), Boolean(heading) && (jsx("h1", { className: "dc-empty-state__heading", children: heading })), Boolean(description) && (jsx("div", { className: "dc-empty-state__description", children: description })), Boolean(primaryAction) && (jsx("div", { className: "dc-empty-state__primary-action", children: primaryAction })), Boolean(secondaryAction) && (jsx("div", { className: "dc-empty-state__secondary-action", children: secondaryAction })), Boolean(children) && (jsx("div", { className: "dc-empty-state__content", children: children }))] }));
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
export { EmptyState };
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { jsx } from 'react/jsx-runtime';
|
|
2
|
-
import { forwardRef } from 'react';
|
|
3
|
-
import { classNames } from '../../lib/react-helpers.js';
|
|
4
|
-
|
|
5
|
-
const FilterButton = forwardRef(function FilterButton({ isActive = false, 'aria-pressed': ariaPressed = isActive, className, children, ...props }, ref) {
|
|
6
|
-
return (jsx("button", { ...props, ref: ref, className: classNames('dc-filter-button', isActive && 'active', className), "data-active": isActive, "aria-pressed": ariaPressed, children: children }));
|
|
7
|
-
});
|
|
8
|
-
|
|
9
|
-
export { FilterButton };
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { jsx } from 'react/jsx-runtime';
|
|
2
|
-
import { StringFilter } from './model/string-filter.js';
|
|
3
|
-
import { StringSetFilter } from './model/string-set-filter.js';
|
|
4
|
-
import { exhaustiveCheck } from '../../lib/helpers.js';
|
|
5
|
-
import 'react';
|
|
6
|
-
import { StringFilterItem } from './string-filter-item.js';
|
|
7
|
-
import { StringSetFilterItem } from './string-set-filter-item.js';
|
|
8
|
-
|
|
9
|
-
function FilterItem({ filter, isEditing, onEditStart, onEditCancel, onRemove, onChange, }) {
|
|
10
|
-
const filterType = filter.type;
|
|
11
|
-
switch (filterType) {
|
|
12
|
-
case StringFilter.Type:
|
|
13
|
-
return (jsx(StringFilterItem, { filter: filter, isEditing: isEditing, onEditStart: onEditStart, onEditCancel: onEditCancel, onRemove: onRemove, onChange: onChange }));
|
|
14
|
-
case StringSetFilter.Type:
|
|
15
|
-
return (jsx(StringSetFilterItem, { filter: filter, isEditing: isEditing, onEditStart: onEditStart, onEditCancel: onEditCancel, onRemove: onRemove, onChange: onChange }));
|
|
16
|
-
default:
|
|
17
|
-
exhaustiveCheck(filterType, `Unable to render filter type ${filterType}.`);
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export { FilterItem };
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
-
import { classNames } from '../../lib/react-helpers.js';
|
|
3
|
-
import { Select } from '../select/select.js';
|
|
4
|
-
|
|
5
|
-
function FilterOperatorSelect({ accessibleName, className, label, values, value, onChange, formatValue, }) {
|
|
6
|
-
const shouldRenderSelect = values.length > 1;
|
|
7
|
-
const onValueChanged = (newValue) => {
|
|
8
|
-
onChange(newValue);
|
|
9
|
-
};
|
|
10
|
-
return (jsxs("div", { className: classNames('dc-filter-operator-select', className), children: [jsx("span", { children: shouldRenderSelect
|
|
11
|
-
? label
|
|
12
|
-
: `${label} ${formatValue(value)}` }), shouldRenderSelect && (jsx(Select, { size: "sm", "data-testid": "filter-operator-select", "aria-label": accessibleName, value: value, onChangeValue: onValueChanged, children: values.map((value) => (jsx("option", { value: value, children: formatValue(value) }, value))) }))] }));
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export { FilterOperatorSelect };
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
-
import { forwardRef } from 'react';
|
|
3
|
-
import { classNames } from '../../lib/react-helpers.js';
|
|
4
|
-
import { XMarkIcon } from './icons.js';
|
|
5
|
-
import { useTranslations } from './use-translations.js';
|
|
6
|
-
|
|
7
|
-
const FilterToken = forwardRef(function FilterToken({ className, isHighlighted, children, onClickLabel, onClickCloseButton, }, ref) {
|
|
8
|
-
const { removeFilterButton } = useTranslations();
|
|
9
|
-
return (jsxs("div", { ref: ref, "data-testid": "filter-token", className: classNames(className, {
|
|
10
|
-
'dc-filter-token': true,
|
|
11
|
-
'dc-filter-token_highlighted': isHighlighted,
|
|
12
|
-
}), children: [jsx("button", { className: "dc-filter-token__label", onClick: onClickLabel, children: children }), jsx("button", { className: "dc-filter-token__button", type: "button", "aria-label": removeFilterButton, onClick: onClickCloseButton, children: jsx(XMarkIcon, {}) })] }));
|
|
13
|
-
});
|
|
14
|
-
|
|
15
|
-
export { FilterToken };
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { jsx } from 'react/jsx-runtime';
|
|
2
|
-
import { classNames } from '../../lib/react-helpers.js';
|
|
3
|
-
import { SelectionControl } from '../selection-control/selection-control.js';
|
|
4
|
-
import { Checkbox } from '../checkbox/checkbox.js';
|
|
5
|
-
|
|
6
|
-
function FilterValueList({ className, values, checkedValues, onChangeCheckedValues, formatValue, }) {
|
|
7
|
-
const onChange = (event) => {
|
|
8
|
-
const checkboxElement = event.currentTarget;
|
|
9
|
-
const value = checkboxElement.value;
|
|
10
|
-
const checked = checkboxElement.checked;
|
|
11
|
-
onChangeCheckedValues(checked
|
|
12
|
-
? [...checkedValues, value]
|
|
13
|
-
: checkedValues.filter((prevValue) => prevValue !== value));
|
|
14
|
-
};
|
|
15
|
-
return (jsx("ul", { className: classNames('dc-filter-value-list', className), children: values.map((value, index) => (jsx("li", { children: jsx(SelectionControl, { label: formatValue(value), children: jsx(Checkbox, { autoFocus: index === 0, value: value, checked: checkedValues.includes(value), onChange: onChange }) }) }, value))) }));
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export { FilterValueList };
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { jsx } from 'react/jsx-runtime';
|
|
2
|
-
|
|
3
|
-
function MagnifyingGlassIcon(props) {
|
|
4
|
-
return (jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", width: 18, height: 18, fill: "none", stroke: "currentColor", strokeWidth: 1.5, ...props, children: jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M21 21l-5.197-5.197m0 0A7.5 7.5 0 105.196 5.196a7.5 7.5 0 0010.607 10.607z" }) }));
|
|
5
|
-
}
|
|
6
|
-
function TrashIcon(props) {
|
|
7
|
-
return (jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", width: 18, height: 18, fill: "none", stroke: "currentColor", strokeWidth: 1.5, ...props, children: jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M14.74 9l-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 01-2.244 2.077H8.084a2.25 2.25 0 01-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 00-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 013.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 00-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 00-7.5 0" }) }));
|
|
8
|
-
}
|
|
9
|
-
function XMarkIcon(props) {
|
|
10
|
-
return (jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", width: 16, height: 16, fill: "none", stroke: "currentColor", strokeWidth: 1.5, ...props, children: jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" }) }));
|
|
11
|
-
}
|
|
12
|
-
function ArrowReturnRight(props) {
|
|
13
|
-
return (jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 16 16", width: 16, height: 16, fill: "currentColor", ...props, children: jsx("path", { fillRule: "evenodd", d: "M1.5 1.5A.5.5 0 0 0 1 2v4.8a2.5 2.5 0 0 0 2.5 2.5h9.793l-3.347 3.346a.5.5 0 0 0 .708.708l4.2-4.2a.5.5 0 0 0 0-.708l-4-4a.5.5 0 0 0-.708.708L13.293 8.3H3.5A1.5 1.5 0 0 1 2 6.8V2a.5.5 0 0 0-.5-.5z" }) }));
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export { ArrowReturnRight, MagnifyingGlassIcon, TrashIcon, XMarkIcon };
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
-
import { classNames } from '../../lib/react-helpers.js';
|
|
3
|
-
import { ArrowReturnRight } from './icons.js';
|
|
4
|
-
import { TextInput } from '../text-input/text-input.js';
|
|
5
|
-
import { Caption } from '../caption/caption.js';
|
|
6
|
-
import { useId } from 'react';
|
|
7
|
-
|
|
8
|
-
function StringFilterInput({ className, accessibleName, placeholder, error, value, onChangeValue, }) {
|
|
9
|
-
const id = useId();
|
|
10
|
-
const alertId = `${id}alert`;
|
|
11
|
-
const hasError = Boolean(error);
|
|
12
|
-
return (jsxs("div", { className: classNames('dc-string-filter-input', className), children: [jsx(ArrowReturnRight, {}), jsx(TextInput, { "data-testid": "string-filter-input", size: "sm", isBlock: true, "aria-label": accessibleName, "aria-describedby": hasError ? alertId : '', placeholder: placeholder, type: "text", required: true, autoFocus: true, value: value, hasError: hasError, onChangeValue: onChangeValue }), hasError && (jsx(Caption, { id: alertId, className: "dc-string-filter-input__error", appearance: "error", showIcon: true, role: "alert", children: error }))] }));
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export { StringFilterInput };
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
-
import { useId } from 'react';
|
|
3
|
-
import { classNames } from '../../lib/react-helpers.js';
|
|
4
|
-
import { Label } from '../label/label.js';
|
|
5
|
-
import { Caption } from '../caption/caption.js';
|
|
6
|
-
|
|
7
|
-
function FormField({ required = false, labelFor = '', label, caption, error, className = '', children, ...props }) {
|
|
8
|
-
const defaultId = useId();
|
|
9
|
-
const id = labelFor || defaultId;
|
|
10
|
-
const hasError = Boolean(error);
|
|
11
|
-
const shouldRenderLabel = Boolean(label);
|
|
12
|
-
let captionEl = null;
|
|
13
|
-
if (hasError) {
|
|
14
|
-
captionEl = (jsx(Caption, { className: "dc-form-field__error", appearance: "error", showIcon: true, children: error }));
|
|
15
|
-
}
|
|
16
|
-
else if (caption) {
|
|
17
|
-
captionEl = jsx(Caption, { className: "dc-form-field__caption", children: caption });
|
|
18
|
-
}
|
|
19
|
-
return (jsxs("div", { ...props, className: classNames('dc-form-field', className), children: [shouldRenderLabel && (jsx(Label, { className: "dc-form-field__label", htmlFor: id, required: required, children: label })), jsx("div", { className: "dc-form-field__input", children: typeof children === 'function'
|
|
20
|
-
? children({ id, required, hasError })
|
|
21
|
-
: children }), captionEl] }));
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export { FormField };
|
package/esm/components/index.js
DELETED
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
export { Alert } from './alert/alert.js';
|
|
2
|
-
export { Avatar } from './avatar/avatar.js';
|
|
3
|
-
export { AvatarGroup } from './avatar-group/avatar-group.js';
|
|
4
|
-
export { Badge } from './badge/badge.js';
|
|
5
|
-
export { Breadcrumbs } from './breadcrumbs/breadcrumbs.js';
|
|
6
|
-
export { BreadcrumbsItem } from './breadcrumbs/breadcrumbs-item.js';
|
|
7
|
-
export { Button } from './button/button.js';
|
|
8
|
-
export { IconButton } from './button/icon-button.js';
|
|
9
|
-
export { ButtonGroup } from './button-group/button-group.js';
|
|
10
|
-
export { Caption } from './caption/caption.js';
|
|
11
|
-
export { Checkbox } from './checkbox/checkbox.js';
|
|
12
|
-
export { ColorPicker } from './color-picker/color-picker.js';
|
|
13
|
-
export { DatePicker } from './date-picker/date-picker.js';
|
|
14
|
-
export { DateRangePicker } from './date-picker/date-range-picker.js';
|
|
15
|
-
export { DatePickerPopover } from './date-picker-popover/date-picker-popover.js';
|
|
16
|
-
export { DateRangePickerPopover } from './date-range-picker-popover/date-range-picker-popover.js';
|
|
17
|
-
export { Dialog } from './dialog/dialog.js';
|
|
18
|
-
export { DialogHeader } from './dialog/dialog-header.js';
|
|
19
|
-
export { DialogBody } from './dialog/dialog-body.js';
|
|
20
|
-
export { DialogFooter } from './dialog/dialog-footer.js';
|
|
21
|
-
export { EmptyState } from './empty-state/empty-state.js';
|
|
22
|
-
export { FilePicker } from './file-picker/file-picker.js';
|
|
23
|
-
export { FilterButtons } from './filter-buttons/filter-buttons.js';
|
|
24
|
-
export { FilterButton } from './filter-buttons/filter-button.js';
|
|
25
|
-
export { FilteredSearch } from './filtered-search/filtered-search.js';
|
|
26
|
-
export { StringFilter } from './filtered-search/model/string-filter.js';
|
|
27
|
-
export { StringSetFilter } from './filtered-search/model/string-set-filter.js';
|
|
28
|
-
export { FormField } from './form-field/form-field.js';
|
|
29
|
-
export { Label } from './label/label.js';
|
|
30
|
-
export { Menu } from './menu/menu.js';
|
|
31
|
-
export { MenuItem } from './menu/menu-item.js';
|
|
32
|
-
export { MenuSeparator } from './menu/menu-separator.js';
|
|
33
|
-
export { NavList } from './nav-list/nav-list.js';
|
|
34
|
-
export { NavListItem } from './nav-list/nav-list-item.js';
|
|
35
|
-
export { NavListTitle } from './nav-list/nav-list-title.js';
|
|
36
|
-
export { PasswordInput } from './password-input/password-input.js';
|
|
37
|
-
export { Popover } from './popover/popover.js';
|
|
38
|
-
export { Portal } from './portal/portal.js';
|
|
39
|
-
export { Positioner } from './positioner/positioner.js';
|
|
40
|
-
export { Radio } from './radio/radio.js';
|
|
41
|
-
export { SegmentedControl } from './segmented-control/segmented-control.js';
|
|
42
|
-
export { Select } from './select/select.js';
|
|
43
|
-
export { SelectionControl } from './selection-control/selection-control.js';
|
|
44
|
-
export { SlideOver } from './slide-over/slide-over.js';
|
|
45
|
-
export { SlideOverHeader } from './slide-over/slide-over-header.js';
|
|
46
|
-
export { SlideOverBody } from './slide-over/slide-over-body.js';
|
|
47
|
-
export { Slider } from './slider/slider.js';
|
|
48
|
-
export { SliderTickMarks } from './slider/slider-tick-marks.js';
|
|
49
|
-
export { Spinner } from './spinner/spinner.js';
|
|
50
|
-
export { Switch } from './switch/switch.js';
|
|
51
|
-
export { TableContainer } from './table/table-container.js';
|
|
52
|
-
export { Table } from './table/table.js';
|
|
53
|
-
export { TableHead } from './table/table-head.js';
|
|
54
|
-
export { TableBody } from './table/table-body.js';
|
|
55
|
-
export { TableRow } from './table/table-row.js';
|
|
56
|
-
export { TableHeadCell } from './table/table-head-cell.js';
|
|
57
|
-
export { TableCell } from './table/table-cell.js';
|
|
58
|
-
export { Tabs } from './tabs/tabs.js';
|
|
59
|
-
export { TabList } from './tabs/tab-list.js';
|
|
60
|
-
export { Tab } from './tabs/tab.js';
|
|
61
|
-
export { TabPanel } from './tabs/tab-panel.js';
|
|
62
|
-
export { Tag } from './tag/tag.js';
|
|
63
|
-
export { TextInput } from './text-input/text-input.js';
|
|
64
|
-
export { Textarea } from './textarea/textarea.js';
|
|
65
|
-
export { Toast } from './toast/toast.js';
|
|
66
|
-
export { ToastButton } from './toast/toast-button.js';
|
|
67
|
-
export { Toaster } from './toaster/toaster.js';
|
|
68
|
-
export { Tooltip } from './tooltip/tooltip.js';
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { jsx } from 'react/jsx-runtime';
|
|
2
|
-
import { forwardRef } from 'react';
|
|
3
|
-
import { classNames } from '../../lib/react-helpers.js';
|
|
4
|
-
|
|
5
|
-
const Label = forwardRef(function Label({ required = false, className = '', children, ...props }, ref) {
|
|
6
|
-
return (jsx("label", { ...props, ref: ref, className: classNames(className, 'dc-label', {
|
|
7
|
-
'dc-label_required': required,
|
|
8
|
-
}), children: children }));
|
|
9
|
-
});
|
|
10
|
-
|
|
11
|
-
export { Label };
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
-
import { forwardRef } from 'react';
|
|
3
|
-
import { classNames } from '../../lib/react-helpers.js';
|
|
4
|
-
|
|
5
|
-
const MenuItem = forwardRef(function MenuItem({ role = 'menuitem', appearance = 'default', leftIcon = null, rightIcon = null, className, children, ...props }, ref) {
|
|
6
|
-
let label = children;
|
|
7
|
-
if (leftIcon || rightIcon) {
|
|
8
|
-
const className = classNames('dc-menu-btn__label', {
|
|
9
|
-
'dc-menu-btn__label_gap_left': leftIcon,
|
|
10
|
-
'dc-menu-btn__label_gap_right': rightIcon,
|
|
11
|
-
});
|
|
12
|
-
label = jsx("span", { className: className, children: label });
|
|
13
|
-
}
|
|
14
|
-
return (jsx("li", { role: "presentation", children: jsxs("button", { ...props, ref: ref, className: classNames(className, 'dc-menu-btn', {
|
|
15
|
-
[`dc-menu-btn_${appearance}`]: appearance,
|
|
16
|
-
}), type: "button", role: role, tabIndex: -1, children: [leftIcon, label, rightIcon] }) }));
|
|
17
|
-
});
|
|
18
|
-
|
|
19
|
-
export { MenuItem };
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { jsx } from 'react/jsx-runtime';
|
|
2
|
-
import { classNames } from '../../lib/react-helpers.js';
|
|
3
|
-
|
|
4
|
-
function MenuSeparator({ className, ...props }) {
|
|
5
|
-
return (jsx("li", { ...props, className: classNames('dc-menu__separator', className), role: "separator" }));
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
export { MenuSeparator };
|