@cimpress-ui/react 0.3.0 → 0.4.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/dist/commonjs/components/alert/alert.d.ts +25 -0
- package/dist/commonjs/components/alert/alert.d.ts.map +1 -0
- package/dist/commonjs/components/alert/alert.js +51 -0
- package/dist/commonjs/components/alert/alert.js.map +1 -0
- package/dist/commonjs/components/alert-dialog/alert-dialog.d.ts +51 -0
- package/dist/commonjs/components/alert-dialog/alert-dialog.d.ts.map +1 -0
- package/dist/commonjs/components/alert-dialog/alert-dialog.js +26 -0
- package/dist/commonjs/components/alert-dialog/alert-dialog.js.map +1 -0
- package/dist/commonjs/components/breadcrumbs/breadcrumbs.d.ts.map +1 -1
- package/dist/commonjs/components/breadcrumbs/breadcrumbs.js +17 -1
- package/dist/commonjs/components/breadcrumbs/breadcrumbs.js.map +1 -1
- package/dist/commonjs/components/button/button.d.ts.map +1 -1
- package/dist/commonjs/components/button/button.js +3 -3
- package/dist/commonjs/components/button/button.js.map +1 -1
- package/dist/commonjs/components/button/icon-button.d.ts.map +1 -1
- package/dist/commonjs/components/button/icon-button.js +3 -3
- package/dist/commonjs/components/button/icon-button.js.map +1 -1
- package/dist/commonjs/components/button/icon-link-button.js +1 -1
- package/dist/commonjs/components/button/icon-link-button.js.map +1 -1
- package/dist/commonjs/components/button/link-button.js +1 -1
- package/dist/commonjs/components/button/link-button.js.map +1 -1
- package/dist/commonjs/components/button/types.js.map +1 -1
- package/dist/commonjs/components/callout/callout.d.ts +27 -0
- package/dist/commonjs/components/callout/callout.d.ts.map +1 -0
- package/dist/commonjs/components/callout/callout.js +46 -0
- package/dist/commonjs/components/callout/callout.js.map +1 -0
- package/dist/commonjs/components/card/card.d.ts +21 -9
- package/dist/commonjs/components/card/card.d.ts.map +1 -1
- package/dist/commonjs/components/card/card.js +17 -11
- package/dist/commonjs/components/card/card.js.map +1 -1
- package/dist/commonjs/components/checkbox/checkbox-group.d.ts +1 -1
- package/dist/commonjs/components/checkbox/checkbox-group.d.ts.map +1 -1
- package/dist/commonjs/components/checkbox/checkbox-group.js +2 -2
- package/dist/commonjs/components/checkbox/checkbox-group.js.map +1 -1
- package/dist/commonjs/components/checkbox/checkbox.d.ts.map +1 -1
- package/dist/commonjs/components/checkbox/checkbox.js +2 -2
- package/dist/commonjs/components/checkbox/checkbox.js.map +1 -1
- package/dist/commonjs/components/combo-box/combo-box.d.ts +2 -1
- package/dist/commonjs/components/combo-box/combo-box.d.ts.map +1 -1
- package/dist/commonjs/components/combo-box/combo-box.js +5 -3
- package/dist/commonjs/components/combo-box/combo-box.js.map +1 -1
- package/dist/commonjs/components/container/container.d.ts +16 -0
- package/dist/commonjs/components/container/container.d.ts.map +1 -0
- package/dist/commonjs/components/container/container.js +13 -0
- package/dist/commonjs/components/container/container.js.map +1 -0
- package/dist/commonjs/components/date-picker/date-picker-calendar.d.ts +2 -0
- package/dist/commonjs/components/date-picker/date-picker-calendar.d.ts.map +1 -0
- package/dist/commonjs/components/date-picker/date-picker-calendar.js +26 -0
- package/dist/commonjs/components/date-picker/date-picker-calendar.js.map +1 -0
- package/dist/commonjs/components/date-picker/date-picker.d.ts +17 -0
- package/dist/commonjs/components/date-picker/date-picker.d.ts.map +1 -0
- package/dist/commonjs/components/date-picker/date-picker.js +54 -0
- package/dist/commonjs/components/date-picker/date-picker.js.map +1 -0
- package/dist/commonjs/components/date-picker/utils.d.ts +2 -0
- package/dist/commonjs/components/date-picker/utils.d.ts.map +1 -0
- package/dist/commonjs/components/date-picker/utils.js +31 -0
- package/dist/commonjs/components/date-picker/utils.js.map +1 -0
- package/dist/commonjs/components/date-picker/views/month/month-view.d.ts +2 -0
- package/dist/commonjs/components/date-picker/views/month/month-view.d.ts.map +1 -0
- package/dist/commonjs/components/date-picker/views/month/month-view.js +35 -0
- package/dist/commonjs/components/date-picker/views/month/month-view.js.map +1 -0
- package/dist/commonjs/components/date-picker/views/multi-year/multi-year-view.d.ts +2 -0
- package/dist/commonjs/components/date-picker/views/multi-year/multi-year-view.d.ts.map +1 -0
- package/dist/commonjs/components/date-picker/views/multi-year/multi-year-view.js +16 -0
- package/dist/commonjs/components/date-picker/views/multi-year/multi-year-view.js.map +1 -0
- package/dist/commonjs/components/date-picker/views/multi-year/use-multi-year-view-state.d.ts +2 -0
- package/dist/commonjs/components/date-picker/views/multi-year/use-multi-year-view-state.d.ts.map +1 -0
- package/dist/commonjs/components/date-picker/views/multi-year/use-multi-year-view-state.js +130 -0
- package/dist/commonjs/components/date-picker/views/multi-year/use-multi-year-view-state.js.map +1 -0
- package/dist/commonjs/components/date-picker/views/types.d.ts +2 -0
- package/dist/commonjs/components/date-picker/views/types.d.ts.map +1 -0
- package/dist/commonjs/components/date-picker/views/types.js +3 -0
- package/dist/commonjs/components/date-picker/views/types.js.map +1 -0
- package/dist/commonjs/components/date-picker/views/use-view-header.d.ts +2 -0
- package/dist/commonjs/components/date-picker/views/use-view-header.d.ts.map +1 -0
- package/dist/commonjs/components/date-picker/views/use-view-header.js +56 -0
- package/dist/commonjs/components/date-picker/views/use-view-header.js.map +1 -0
- package/dist/commonjs/components/date-picker/views/view-grid-cell.d.ts +2 -0
- package/dist/commonjs/components/date-picker/views/view-grid-cell.d.ts.map +1 -0
- package/dist/commonjs/components/date-picker/views/view-grid-cell.js +72 -0
- package/dist/commonjs/components/date-picker/views/view-grid-cell.js.map +1 -0
- package/dist/commonjs/components/date-picker/views/view-grid.d.ts +2 -0
- package/dist/commonjs/components/date-picker/views/view-grid.d.ts.map +1 -0
- package/dist/commonjs/components/date-picker/views/view-grid.js +75 -0
- package/dist/commonjs/components/date-picker/views/view-grid.js.map +1 -0
- package/dist/commonjs/components/date-picker/views/view-provider.d.ts +2 -0
- package/dist/commonjs/components/date-picker/views/view-provider.d.ts.map +1 -0
- package/dist/commonjs/components/date-picker/views/view-provider.js +21 -0
- package/dist/commonjs/components/date-picker/views/view-provider.js.map +1 -0
- package/dist/commonjs/components/date-picker/views/year/use-year-view-state.d.ts +2 -0
- package/dist/commonjs/components/date-picker/views/year/use-year-view-state.d.ts.map +1 -0
- package/dist/commonjs/components/date-picker/views/year/use-year-view-state.js +158 -0
- package/dist/commonjs/components/date-picker/views/year/use-year-view-state.js.map +1 -0
- package/dist/commonjs/components/date-picker/views/year/year-view.d.ts +2 -0
- package/dist/commonjs/components/date-picker/views/year/year-view.d.ts.map +1 -0
- package/dist/commonjs/components/date-picker/views/year/year-view.js +20 -0
- package/dist/commonjs/components/date-picker/views/year/year-view.js.map +1 -0
- package/dist/commonjs/components/dialog-root/dialog-root.d.ts +20 -0
- package/dist/commonjs/components/dialog-root/dialog-root.d.ts.map +1 -0
- package/dist/commonjs/components/dialog-root/dialog-root.js +15 -0
- package/dist/commonjs/components/dialog-root/dialog-root.js.map +1 -0
- package/dist/commonjs/components/disclosure/context.d.ts +3 -0
- package/dist/commonjs/components/disclosure/context.d.ts.map +1 -0
- package/dist/commonjs/components/disclosure/context.js +7 -0
- package/dist/commonjs/components/disclosure/context.js.map +1 -0
- package/dist/commonjs/components/disclosure/disclosure-group.d.ts +15 -4
- package/dist/commonjs/components/disclosure/disclosure-group.d.ts.map +1 -1
- package/dist/commonjs/components/disclosure/disclosure-group.js +11 -5
- package/dist/commonjs/components/disclosure/disclosure-group.js.map +1 -1
- package/dist/commonjs/components/disclosure/disclosure.d.ts +35 -4
- package/dist/commonjs/components/disclosure/disclosure.d.ts.map +1 -1
- package/dist/commonjs/components/disclosure/disclosure.js +16 -5
- package/dist/commonjs/components/disclosure/disclosure.js.map +1 -1
- package/dist/commonjs/components/divider/divider.d.ts +12 -0
- package/dist/commonjs/components/divider/divider.d.ts.map +1 -0
- package/dist/commonjs/components/divider/divider.js +19 -0
- package/dist/commonjs/components/divider/divider.js.map +1 -0
- package/dist/commonjs/components/file-picker/file-picker.d.ts +19 -0
- package/dist/commonjs/components/file-picker/file-picker.d.ts.map +1 -0
- package/dist/commonjs/components/file-picker/file-picker.js +68 -0
- package/dist/commonjs/components/file-picker/file-picker.js.map +1 -0
- package/dist/commonjs/components/header/cimpress-logo.d.ts +2 -0
- package/dist/commonjs/components/header/cimpress-logo.d.ts.map +1 -0
- package/dist/commonjs/components/header/cimpress-logo.js +9 -0
- package/dist/commonjs/components/header/cimpress-logo.js.map +1 -0
- package/dist/commonjs/components/header/header.d.ts +10 -0
- package/dist/commonjs/components/header/header.d.ts.map +1 -0
- package/dist/commonjs/components/header/header.js +19 -0
- package/dist/commonjs/components/header/header.js.map +1 -0
- package/dist/commonjs/components/internal/form-field/form-field.js +1 -1
- package/dist/commonjs/components/internal/form-field/form-field.js.map +1 -1
- package/dist/commonjs/components/internal/x-button/x-button.d.ts +2 -0
- package/dist/commonjs/components/internal/x-button/x-button.d.ts.map +1 -0
- package/dist/commonjs/components/internal/x-button/x-button.js +17 -0
- package/dist/commonjs/components/internal/x-button/x-button.js.map +1 -0
- package/dist/commonjs/components/menu/menu.d.ts +3 -6
- package/dist/commonjs/components/menu/menu.d.ts.map +1 -1
- package/dist/commonjs/components/menu/menu.js +4 -9
- package/dist/commonjs/components/menu/menu.js.map +1 -1
- package/dist/commonjs/components/modal-dialog/modal-dialog.d.ts +63 -0
- package/dist/commonjs/components/modal-dialog/modal-dialog.d.ts.map +1 -0
- package/dist/commonjs/components/modal-dialog/modal-dialog.js +50 -0
- package/dist/commonjs/components/modal-dialog/modal-dialog.js.map +1 -0
- package/dist/commonjs/components/number-field/number-field.d.ts +1 -1
- package/dist/commonjs/components/number-field/number-field.d.ts.map +1 -1
- package/dist/commonjs/components/number-field/number-field.js +6 -4
- package/dist/commonjs/components/number-field/number-field.js.map +1 -1
- package/dist/commonjs/components/pagination/base-pagination.d.ts.map +1 -1
- package/dist/commonjs/components/pagination/base-pagination.js +9 -10
- package/dist/commonjs/components/pagination/base-pagination.js.map +1 -1
- package/dist/commonjs/components/pagination/pagination.d.ts.map +1 -1
- package/dist/commonjs/components/pagination/pagination.js +7 -5
- package/dist/commonjs/components/pagination/pagination.js.map +1 -1
- package/dist/commonjs/components/popover/popover.d.ts +7 -2
- package/dist/commonjs/components/popover/popover.d.ts.map +1 -1
- package/dist/commonjs/components/popover/popover.js +2 -2
- package/dist/commonjs/components/popover/popover.js.map +1 -1
- package/dist/commonjs/components/radio/radio-group.d.ts +1 -1
- package/dist/commonjs/components/radio/radio-group.d.ts.map +1 -1
- package/dist/commonjs/components/radio/radio-group.js +2 -2
- package/dist/commonjs/components/radio/radio-group.js.map +1 -1
- package/dist/commonjs/components/radio/radio.d.ts.map +1 -1
- package/dist/commonjs/components/radio/radio.js +2 -2
- package/dist/commonjs/components/radio/radio.js.map +1 -1
- package/dist/commonjs/components/select/select.d.ts +2 -1
- package/dist/commonjs/components/select/select.d.ts.map +1 -1
- package/dist/commonjs/components/select/select.js +5 -4
- package/dist/commonjs/components/select/select.js.map +1 -1
- package/dist/commonjs/components/spacing/stack/stack.d.ts +1 -1
- package/dist/commonjs/components/spacing/stack/stack.js +1 -1
- package/dist/commonjs/components/spacing/stack/stack.js.map +1 -1
- package/dist/commonjs/components/spacing/types.d.ts +1 -1
- package/dist/commonjs/components/spacing/types.d.ts.map +1 -1
- package/dist/commonjs/components/spacing/types.js +2 -2
- package/dist/commonjs/components/spacing/types.js.map +1 -1
- package/dist/commonjs/components/spinner/spinner.d.ts.map +1 -1
- package/dist/commonjs/components/spinner/spinner.js +3 -3
- package/dist/commonjs/components/spinner/spinner.js.map +1 -1
- package/dist/commonjs/components/table/contexts/column-collection.d.ts.map +1 -1
- package/dist/commonjs/components/table/contexts/column-collection.js +2 -0
- package/dist/commonjs/components/table/contexts/column-collection.js.map +1 -1
- package/dist/commonjs/components/table/contexts/table-state.d.ts +1 -0
- package/dist/commonjs/components/table/contexts/table-state.d.ts.map +1 -1
- package/dist/commonjs/components/table/contexts/table-state.js +6 -1
- package/dist/commonjs/components/table/contexts/table-state.js.map +1 -1
- package/dist/commonjs/components/table/hooks/use-table-cell.js +2 -2
- package/dist/commonjs/components/table/hooks/use-table-cell.js.map +1 -1
- package/dist/commonjs/components/table/table-empty-state.js +1 -1
- package/dist/commonjs/components/table/table-empty-state.js.map +1 -1
- package/dist/commonjs/components/table/table-header-button.d.ts +2 -0
- package/dist/commonjs/components/table/table-header-button.d.ts.map +1 -0
- package/dist/commonjs/components/table/table-header-button.js +16 -0
- package/dist/commonjs/components/table/table-header-button.js.map +1 -0
- package/dist/commonjs/components/table/table-header-cell.d.ts.map +1 -1
- package/dist/commonjs/components/table/table-header-cell.js +7 -5
- package/dist/commonjs/components/table/table-header-cell.js.map +1 -1
- package/dist/commonjs/components/table/table.d.ts +1 -1
- package/dist/commonjs/components/table/table.d.ts.map +1 -1
- package/dist/commonjs/components/table/table.js +2 -2
- package/dist/commonjs/components/table/table.js.map +1 -1
- package/dist/commonjs/components/tag/tag-group.d.ts +1 -1
- package/dist/commonjs/components/tag/tag-group.d.ts.map +1 -1
- package/dist/commonjs/components/tag/tag-group.js.map +1 -1
- package/dist/commonjs/components/tag/tag.js +1 -1
- package/dist/commonjs/components/tag/tag.js.map +1 -1
- package/dist/commonjs/components/tag-field/tag-field-input.d.ts +2 -0
- package/dist/commonjs/components/tag-field/tag-field-input.d.ts.map +1 -0
- package/dist/commonjs/components/tag-field/tag-field-input.js +31 -0
- package/dist/commonjs/components/tag-field/tag-field-input.js.map +1 -0
- package/dist/commonjs/components/tag-field/tag-field-list-box.d.ts +2 -0
- package/dist/commonjs/components/tag-field/tag-field-list-box.d.ts.map +1 -0
- package/dist/commonjs/components/tag-field/tag-field-list-box.js +31 -0
- package/dist/commonjs/components/tag-field/tag-field-list-box.js.map +1 -0
- package/dist/commonjs/components/tag-field/tag-field-tags.d.ts +2 -0
- package/dist/commonjs/components/tag-field/tag-field-tags.d.ts.map +1 -0
- package/dist/commonjs/components/tag-field/tag-field-tags.js +27 -0
- package/dist/commonjs/components/tag-field/tag-field-tags.js.map +1 -0
- package/dist/commonjs/components/tag-field/tag-field.d.ts +43 -0
- package/dist/commonjs/components/tag-field/tag-field.d.ts.map +1 -0
- package/dist/commonjs/components/tag-field/tag-field.js +143 -0
- package/dist/commonjs/components/tag-field/tag-field.js.map +1 -0
- package/dist/commonjs/components/text-inputs/text-area.d.ts +1 -1
- package/dist/commonjs/components/text-inputs/text-area.d.ts.map +1 -1
- package/dist/commonjs/components/text-inputs/text-area.js +2 -2
- package/dist/commonjs/components/text-inputs/text-area.js.map +1 -1
- package/dist/commonjs/components/text-inputs/text-field.d.ts +1 -1
- package/dist/commonjs/components/text-inputs/text-field.d.ts.map +1 -1
- package/dist/commonjs/components/text-inputs/text-field.js +2 -2
- package/dist/commonjs/components/text-inputs/text-field.js.map +1 -1
- package/dist/commonjs/components/toast/toast-region.d.ts +5 -0
- package/dist/commonjs/components/toast/toast-region.d.ts.map +1 -0
- package/dist/commonjs/components/toast/toast-region.js +24 -0
- package/dist/commonjs/components/toast/toast-region.js.map +1 -0
- package/dist/commonjs/components/toast/toast.d.ts +2 -0
- package/dist/commonjs/components/toast/toast.d.ts.map +1 -0
- package/dist/commonjs/components/toast/toast.js +24 -0
- package/dist/commonjs/components/toast/toast.js.map +1 -0
- package/dist/commonjs/components/toast/types.d.ts +5 -0
- package/dist/commonjs/components/toast/types.d.ts.map +1 -0
- package/dist/commonjs/components/toast/types.js +3 -0
- package/dist/commonjs/components/toast/types.js.map +1 -0
- package/dist/commonjs/components/toggle/toggle.d.ts +14 -0
- package/dist/commonjs/components/toggle/toggle.d.ts.map +1 -0
- package/dist/commonjs/components/toggle/toggle.js +32 -0
- package/dist/commonjs/components/toggle/toggle.js.map +1 -0
- package/dist/commonjs/components/tooltip/tooltip.d.ts +4 -2
- package/dist/commonjs/components/tooltip/tooltip.d.ts.map +1 -1
- package/dist/commonjs/components/tooltip/tooltip.js.map +1 -1
- package/dist/commonjs/components/types.d.ts +4 -0
- package/dist/commonjs/components/types.d.ts.map +1 -1
- package/dist/commonjs/components/types.js.map +1 -1
- package/dist/commonjs/components/typography/text.d.ts.map +1 -1
- package/dist/commonjs/date.d.ts +2 -0
- package/dist/commonjs/date.d.ts.map +1 -0
- package/dist/commonjs/date.js +27 -0
- package/dist/commonjs/date.js.map +1 -0
- package/dist/commonjs/i18n/index.d.ts +3 -0
- package/dist/commonjs/i18n/index.d.ts.map +1 -0
- package/dist/commonjs/i18n/index.js +19 -0
- package/dist/commonjs/i18n/index.js.map +1 -0
- package/dist/commonjs/i18n/localization-provider.d.ts +59 -0
- package/dist/commonjs/i18n/localization-provider.d.ts.map +1 -0
- package/dist/commonjs/i18n/localization-provider.js +82 -0
- package/dist/commonjs/i18n/localization-provider.js.map +1 -0
- package/dist/commonjs/i18n/messages/en-US.d.ts +4 -0
- package/dist/commonjs/i18n/messages/en-US.d.ts.map +1 -0
- package/dist/commonjs/i18n/messages/en-US.js +38 -0
- package/dist/commonjs/i18n/messages/en-US.js.map +1 -0
- package/dist/commonjs/i18n/messages/index.d.ts +3 -0
- package/dist/commonjs/i18n/messages/index.d.ts.map +1 -0
- package/dist/commonjs/i18n/messages/index.js +6 -0
- package/dist/commonjs/i18n/messages/index.js.map +1 -0
- package/dist/commonjs/i18n/messages/types.d.ts +72 -0
- package/dist/commonjs/i18n/messages/types.d.ts.map +1 -0
- package/dist/commonjs/i18n/messages/types.js +3 -0
- package/dist/commonjs/i18n/messages/types.js.map +1 -0
- package/dist/commonjs/index.d.ts +18 -3
- package/dist/commonjs/index.d.ts.map +1 -1
- package/dist/commonjs/index.js +16 -3
- package/dist/commonjs/index.js.map +1 -1
- package/dist/commonjs/providers/ssr/ssr-provider.d.ts +1 -3
- package/dist/commonjs/providers/ssr/ssr-provider.d.ts.map +1 -1
- package/dist/commonjs/providers/ssr/ssr-provider.js +2 -2
- package/dist/commonjs/providers/ssr/ssr-provider.js.map +1 -1
- package/dist/commonjs/utils/is-production.d.ts +2 -0
- package/dist/commonjs/utils/is-production.d.ts.map +1 -0
- package/dist/commonjs/utils/is-production.js +7 -0
- package/dist/commonjs/utils/is-production.js.map +1 -0
- package/dist/commonjs/utils/style/types.d.ts +1 -1
- package/dist/commonjs/utils/style/types.d.ts.map +1 -1
- package/dist/commonjs/utils/style/types.js.map +1 -1
- package/dist/commonjs/utils/use-media-query.d.ts +2 -0
- package/dist/commonjs/utils/use-media-query.d.ts.map +1 -0
- package/dist/commonjs/utils/use-media-query.js +35 -0
- package/dist/commonjs/utils/use-media-query.js.map +1 -0
- package/dist/commonjs/utils/use-production-warning.d.ts +3 -0
- package/dist/commonjs/utils/use-production-warning.d.ts.map +1 -0
- package/dist/commonjs/utils/use-production-warning.js +7 -0
- package/dist/commonjs/utils/use-production-warning.js.map +1 -0
- package/dist/commonjs/with-style-props.d.ts.map +1 -1
- package/dist/esm/components/alert/alert.d.ts +25 -0
- package/dist/esm/components/alert/alert.d.ts.map +1 -0
- package/dist/esm/components/alert/alert.js +45 -0
- package/dist/esm/components/alert/alert.js.map +1 -0
- package/dist/esm/components/alert-dialog/alert-dialog.d.ts +51 -0
- package/dist/esm/components/alert-dialog/alert-dialog.d.ts.map +1 -0
- package/dist/esm/components/alert-dialog/alert-dialog.js +20 -0
- package/dist/esm/components/alert-dialog/alert-dialog.js.map +1 -0
- package/dist/esm/components/breadcrumbs/breadcrumbs.d.ts.map +1 -1
- package/dist/esm/components/breadcrumbs/breadcrumbs.js +18 -2
- package/dist/esm/components/breadcrumbs/breadcrumbs.js.map +1 -1
- package/dist/esm/components/button/button.d.ts.map +1 -1
- package/dist/esm/components/button/button.js +3 -3
- package/dist/esm/components/button/button.js.map +1 -1
- package/dist/esm/components/button/icon-button.d.ts.map +1 -1
- package/dist/esm/components/button/icon-button.js +3 -3
- package/dist/esm/components/button/icon-button.js.map +1 -1
- package/dist/esm/components/button/icon-link-button.js +1 -1
- package/dist/esm/components/button/icon-link-button.js.map +1 -1
- package/dist/esm/components/button/link-button.js +1 -1
- package/dist/esm/components/button/link-button.js.map +1 -1
- package/dist/esm/components/button/types.js.map +1 -1
- package/dist/esm/components/callout/callout.d.ts +27 -0
- package/dist/esm/components/callout/callout.d.ts.map +1 -0
- package/dist/esm/components/callout/callout.js +40 -0
- package/dist/esm/components/callout/callout.js.map +1 -0
- package/dist/esm/components/card/card.d.ts +21 -9
- package/dist/esm/components/card/card.d.ts.map +1 -1
- package/dist/esm/components/card/card.js +16 -11
- package/dist/esm/components/card/card.js.map +1 -1
- package/dist/esm/components/checkbox/checkbox-group.d.ts +1 -1
- package/dist/esm/components/checkbox/checkbox-group.d.ts.map +1 -1
- package/dist/esm/components/checkbox/checkbox-group.js +2 -2
- package/dist/esm/components/checkbox/checkbox-group.js.map +1 -1
- package/dist/esm/components/checkbox/checkbox.d.ts.map +1 -1
- package/dist/esm/components/checkbox/checkbox.js +2 -2
- package/dist/esm/components/checkbox/checkbox.js.map +1 -1
- package/dist/esm/components/combo-box/combo-box.d.ts +2 -1
- package/dist/esm/components/combo-box/combo-box.d.ts.map +1 -1
- package/dist/esm/components/combo-box/combo-box.js +6 -4
- package/dist/esm/components/combo-box/combo-box.js.map +1 -1
- package/dist/esm/components/container/container.d.ts +16 -0
- package/dist/esm/components/container/container.d.ts.map +1 -0
- package/dist/esm/components/container/container.js +7 -0
- package/dist/esm/components/container/container.js.map +1 -0
- package/dist/esm/components/date-picker/date-picker-calendar.d.ts +2 -0
- package/dist/esm/components/date-picker/date-picker-calendar.d.ts.map +1 -0
- package/dist/esm/components/date-picker/date-picker-calendar.js +23 -0
- package/dist/esm/components/date-picker/date-picker-calendar.js.map +1 -0
- package/dist/esm/components/date-picker/date-picker.d.ts +17 -0
- package/dist/esm/components/date-picker/date-picker.d.ts.map +1 -0
- package/dist/esm/components/date-picker/date-picker.js +48 -0
- package/dist/esm/components/date-picker/date-picker.js.map +1 -0
- package/dist/esm/components/date-picker/utils.d.ts +2 -0
- package/dist/esm/components/date-picker/utils.d.ts.map +1 -0
- package/dist/esm/components/date-picker/utils.js +26 -0
- package/dist/esm/components/date-picker/utils.js.map +1 -0
- package/dist/esm/components/date-picker/views/month/month-view.d.ts +2 -0
- package/dist/esm/components/date-picker/views/month/month-view.d.ts.map +1 -0
- package/dist/esm/components/date-picker/views/month/month-view.js +29 -0
- package/dist/esm/components/date-picker/views/month/month-view.js.map +1 -0
- package/dist/esm/components/date-picker/views/multi-year/multi-year-view.d.ts +2 -0
- package/dist/esm/components/date-picker/views/multi-year/multi-year-view.d.ts.map +1 -0
- package/dist/esm/components/date-picker/views/multi-year/multi-year-view.js +13 -0
- package/dist/esm/components/date-picker/views/multi-year/multi-year-view.js.map +1 -0
- package/dist/esm/components/date-picker/views/multi-year/use-multi-year-view-state.d.ts +2 -0
- package/dist/esm/components/date-picker/views/multi-year/use-multi-year-view-state.d.ts.map +1 -0
- package/dist/esm/components/date-picker/views/multi-year/use-multi-year-view-state.js +127 -0
- package/dist/esm/components/date-picker/views/multi-year/use-multi-year-view-state.js.map +1 -0
- package/dist/esm/components/date-picker/views/types.d.ts +2 -0
- package/dist/esm/components/date-picker/views/types.d.ts.map +1 -0
- package/dist/esm/components/date-picker/views/types.js +2 -0
- package/dist/esm/components/date-picker/views/types.js.map +1 -0
- package/dist/esm/components/date-picker/views/use-view-header.d.ts +2 -0
- package/dist/esm/components/date-picker/views/use-view-header.d.ts.map +1 -0
- package/dist/esm/components/date-picker/views/use-view-header.js +53 -0
- package/dist/esm/components/date-picker/views/use-view-header.js.map +1 -0
- package/dist/esm/components/date-picker/views/view-grid-cell.d.ts +2 -0
- package/dist/esm/components/date-picker/views/view-grid-cell.d.ts.map +1 -0
- package/dist/esm/components/date-picker/views/view-grid-cell.js +66 -0
- package/dist/esm/components/date-picker/views/view-grid-cell.js.map +1 -0
- package/dist/esm/components/date-picker/views/view-grid.d.ts +2 -0
- package/dist/esm/components/date-picker/views/view-grid.d.ts.map +1 -0
- package/dist/esm/components/date-picker/views/view-grid.js +69 -0
- package/dist/esm/components/date-picker/views/view-grid.js.map +1 -0
- package/dist/esm/components/date-picker/views/view-provider.d.ts +2 -0
- package/dist/esm/components/date-picker/views/view-provider.d.ts.map +1 -0
- package/dist/esm/components/date-picker/views/view-provider.js +17 -0
- package/dist/esm/components/date-picker/views/view-provider.js.map +1 -0
- package/dist/esm/components/date-picker/views/year/use-year-view-state.d.ts +2 -0
- package/dist/esm/components/date-picker/views/year/use-year-view-state.d.ts.map +1 -0
- package/dist/esm/components/date-picker/views/year/use-year-view-state.js +155 -0
- package/dist/esm/components/date-picker/views/year/use-year-view-state.js.map +1 -0
- package/dist/esm/components/date-picker/views/year/year-view.d.ts +2 -0
- package/dist/esm/components/date-picker/views/year/year-view.d.ts.map +1 -0
- package/dist/esm/components/date-picker/views/year/year-view.js +17 -0
- package/dist/esm/components/date-picker/views/year/year-view.js.map +1 -0
- package/dist/esm/components/dialog-root/dialog-root.d.ts +20 -0
- package/dist/esm/components/dialog-root/dialog-root.d.ts.map +1 -0
- package/dist/esm/components/dialog-root/dialog-root.js +12 -0
- package/dist/esm/components/dialog-root/dialog-root.js.map +1 -0
- package/dist/esm/components/disclosure/context.d.ts +3 -0
- package/dist/esm/components/disclosure/context.d.ts.map +1 -0
- package/dist/esm/components/disclosure/context.js +4 -0
- package/dist/esm/components/disclosure/context.js.map +1 -0
- package/dist/esm/components/disclosure/disclosure-group.d.ts +15 -4
- package/dist/esm/components/disclosure/disclosure-group.d.ts.map +1 -1
- package/dist/esm/components/disclosure/disclosure-group.js +10 -4
- package/dist/esm/components/disclosure/disclosure-group.js.map +1 -1
- package/dist/esm/components/disclosure/disclosure.d.ts +35 -4
- package/dist/esm/components/disclosure/disclosure.d.ts.map +1 -1
- package/dist/esm/components/disclosure/disclosure.js +16 -5
- package/dist/esm/components/disclosure/disclosure.js.map +1 -1
- package/dist/esm/components/divider/divider.d.ts +12 -0
- package/dist/esm/components/divider/divider.d.ts.map +1 -0
- package/dist/esm/components/divider/divider.js +13 -0
- package/dist/esm/components/divider/divider.js.map +1 -0
- package/dist/esm/components/file-picker/file-picker.d.ts +19 -0
- package/dist/esm/components/file-picker/file-picker.d.ts.map +1 -0
- package/dist/esm/components/file-picker/file-picker.js +62 -0
- package/dist/esm/components/file-picker/file-picker.js.map +1 -0
- package/dist/esm/components/header/cimpress-logo.d.ts +2 -0
- package/dist/esm/components/header/cimpress-logo.d.ts.map +1 -0
- package/dist/esm/components/header/cimpress-logo.js +6 -0
- package/dist/esm/components/header/cimpress-logo.js.map +1 -0
- package/dist/esm/components/header/header.d.ts +10 -0
- package/dist/esm/components/header/header.d.ts.map +1 -0
- package/dist/esm/components/header/header.js +13 -0
- package/dist/esm/components/header/header.js.map +1 -0
- package/dist/esm/components/internal/form-field/form-field.js +1 -1
- package/dist/esm/components/internal/form-field/form-field.js.map +1 -1
- package/dist/esm/components/internal/x-button/x-button.d.ts +2 -0
- package/dist/esm/components/internal/x-button/x-button.d.ts.map +1 -0
- package/dist/esm/components/internal/x-button/x-button.js +11 -0
- package/dist/esm/components/internal/x-button/x-button.js.map +1 -0
- package/dist/esm/components/menu/menu.d.ts +3 -6
- package/dist/esm/components/menu/menu.d.ts.map +1 -1
- package/dist/esm/components/menu/menu.js +5 -9
- package/dist/esm/components/menu/menu.js.map +1 -1
- package/dist/esm/components/modal-dialog/modal-dialog.d.ts +63 -0
- package/dist/esm/components/modal-dialog/modal-dialog.d.ts.map +1 -0
- package/dist/esm/components/modal-dialog/modal-dialog.js +42 -0
- package/dist/esm/components/modal-dialog/modal-dialog.js.map +1 -0
- package/dist/esm/components/number-field/number-field.d.ts +1 -1
- package/dist/esm/components/number-field/number-field.d.ts.map +1 -1
- package/dist/esm/components/number-field/number-field.js +5 -3
- package/dist/esm/components/number-field/number-field.js.map +1 -1
- package/dist/esm/components/pagination/base-pagination.d.ts.map +1 -1
- package/dist/esm/components/pagination/base-pagination.js +6 -7
- package/dist/esm/components/pagination/base-pagination.js.map +1 -1
- package/dist/esm/components/pagination/pagination.d.ts.map +1 -1
- package/dist/esm/components/pagination/pagination.js +7 -5
- package/dist/esm/components/pagination/pagination.js.map +1 -1
- package/dist/esm/components/popover/popover.d.ts +7 -2
- package/dist/esm/components/popover/popover.d.ts.map +1 -1
- package/dist/esm/components/popover/popover.js +2 -2
- package/dist/esm/components/popover/popover.js.map +1 -1
- package/dist/esm/components/radio/radio-group.d.ts +1 -1
- package/dist/esm/components/radio/radio-group.d.ts.map +1 -1
- package/dist/esm/components/radio/radio-group.js +2 -2
- package/dist/esm/components/radio/radio-group.js.map +1 -1
- package/dist/esm/components/radio/radio.d.ts.map +1 -1
- package/dist/esm/components/radio/radio.js +2 -2
- package/dist/esm/components/radio/radio.js.map +1 -1
- package/dist/esm/components/select/select.d.ts +2 -1
- package/dist/esm/components/select/select.d.ts.map +1 -1
- package/dist/esm/components/select/select.js +5 -4
- package/dist/esm/components/select/select.js.map +1 -1
- package/dist/esm/components/spacing/stack/stack.d.ts +1 -1
- package/dist/esm/components/spacing/stack/stack.js +1 -1
- package/dist/esm/components/spacing/stack/stack.js.map +1 -1
- package/dist/esm/components/spacing/types.d.ts +1 -1
- package/dist/esm/components/spacing/types.d.ts.map +1 -1
- package/dist/esm/components/spacing/types.js +2 -2
- package/dist/esm/components/spacing/types.js.map +1 -1
- package/dist/esm/components/spinner/spinner.d.ts.map +1 -1
- package/dist/esm/components/spinner/spinner.js +3 -3
- package/dist/esm/components/spinner/spinner.js.map +1 -1
- package/dist/esm/components/table/contexts/column-collection.d.ts.map +1 -1
- package/dist/esm/components/table/contexts/column-collection.js +2 -0
- package/dist/esm/components/table/contexts/column-collection.js.map +1 -1
- package/dist/esm/components/table/contexts/table-state.d.ts +1 -0
- package/dist/esm/components/table/contexts/table-state.d.ts.map +1 -1
- package/dist/esm/components/table/contexts/table-state.js +8 -3
- package/dist/esm/components/table/contexts/table-state.js.map +1 -1
- package/dist/esm/components/table/hooks/use-table-cell.js +2 -2
- package/dist/esm/components/table/hooks/use-table-cell.js.map +1 -1
- package/dist/esm/components/table/table-empty-state.js +1 -1
- package/dist/esm/components/table/table-empty-state.js.map +1 -1
- package/dist/esm/components/table/table-header-button.d.ts +2 -0
- package/dist/esm/components/table/table-header-button.d.ts.map +1 -0
- package/dist/esm/components/table/table-header-button.js +10 -0
- package/dist/esm/components/table/table-header-button.js.map +1 -0
- package/dist/esm/components/table/table-header-cell.d.ts.map +1 -1
- package/dist/esm/components/table/table-header-cell.js +9 -7
- package/dist/esm/components/table/table-header-cell.js.map +1 -1
- package/dist/esm/components/table/table.d.ts +1 -1
- package/dist/esm/components/table/table.d.ts.map +1 -1
- package/dist/esm/components/table/table.js +2 -2
- package/dist/esm/components/table/table.js.map +1 -1
- package/dist/esm/components/tag/tag-group.d.ts +1 -1
- package/dist/esm/components/tag/tag-group.d.ts.map +1 -1
- package/dist/esm/components/tag/tag-group.js.map +1 -1
- package/dist/esm/components/tag/tag.js +1 -1
- package/dist/esm/components/tag/tag.js.map +1 -1
- package/dist/esm/components/tag-field/tag-field-input.d.ts +2 -0
- package/dist/esm/components/tag-field/tag-field-input.d.ts.map +1 -0
- package/dist/esm/components/tag-field/tag-field-input.js +25 -0
- package/dist/esm/components/tag-field/tag-field-input.js.map +1 -0
- package/dist/esm/components/tag-field/tag-field-list-box.d.ts +2 -0
- package/dist/esm/components/tag-field/tag-field-list-box.d.ts.map +1 -0
- package/dist/esm/components/tag-field/tag-field-list-box.js +28 -0
- package/dist/esm/components/tag-field/tag-field-list-box.js.map +1 -0
- package/dist/esm/components/tag-field/tag-field-tags.d.ts +2 -0
- package/dist/esm/components/tag-field/tag-field-tags.d.ts.map +1 -0
- package/dist/esm/components/tag-field/tag-field-tags.js +24 -0
- package/dist/esm/components/tag-field/tag-field-tags.js.map +1 -0
- package/dist/esm/components/tag-field/tag-field.d.ts +43 -0
- package/dist/esm/components/tag-field/tag-field.d.ts.map +1 -0
- package/dist/esm/components/tag-field/tag-field.js +135 -0
- package/dist/esm/components/tag-field/tag-field.js.map +1 -0
- package/dist/esm/components/text-inputs/text-area.d.ts +1 -1
- package/dist/esm/components/text-inputs/text-area.d.ts.map +1 -1
- package/dist/esm/components/text-inputs/text-area.js +2 -2
- package/dist/esm/components/text-inputs/text-area.js.map +1 -1
- package/dist/esm/components/text-inputs/text-field.d.ts +1 -1
- package/dist/esm/components/text-inputs/text-field.d.ts.map +1 -1
- package/dist/esm/components/text-inputs/text-field.js +2 -2
- package/dist/esm/components/text-inputs/text-field.js.map +1 -1
- package/dist/esm/components/toast/toast-region.d.ts +5 -0
- package/dist/esm/components/toast/toast-region.d.ts.map +1 -0
- package/dist/esm/components/toast/toast-region.js +20 -0
- package/dist/esm/components/toast/toast-region.js.map +1 -0
- package/dist/esm/components/toast/toast.d.ts +2 -0
- package/dist/esm/components/toast/toast.d.ts.map +1 -0
- package/dist/esm/components/toast/toast.js +21 -0
- package/dist/esm/components/toast/toast.js.map +1 -0
- package/dist/esm/components/toast/types.d.ts +5 -0
- package/dist/esm/components/toast/types.d.ts.map +1 -0
- package/dist/esm/components/toast/types.js +2 -0
- package/dist/esm/components/toast/types.js.map +1 -0
- package/dist/esm/components/toggle/toggle.d.ts +14 -0
- package/dist/esm/components/toggle/toggle.d.ts.map +1 -0
- package/dist/esm/components/toggle/toggle.js +26 -0
- package/dist/esm/components/toggle/toggle.js.map +1 -0
- package/dist/esm/components/tooltip/tooltip.d.ts +4 -2
- package/dist/esm/components/tooltip/tooltip.d.ts.map +1 -1
- package/dist/esm/components/tooltip/tooltip.js.map +1 -1
- package/dist/esm/components/types.d.ts +4 -0
- package/dist/esm/components/types.d.ts.map +1 -1
- package/dist/esm/components/types.js.map +1 -1
- package/dist/esm/components/typography/text.d.ts.map +1 -1
- package/dist/esm/date.d.ts +2 -0
- package/dist/esm/date.d.ts.map +1 -0
- package/dist/esm/date.js +11 -0
- package/dist/esm/date.js.map +1 -0
- package/dist/esm/i18n/index.d.ts +3 -0
- package/dist/esm/i18n/index.d.ts.map +1 -0
- package/dist/esm/i18n/index.js +3 -0
- package/dist/esm/i18n/index.js.map +1 -0
- package/dist/esm/i18n/localization-provider.d.ts +59 -0
- package/dist/esm/i18n/localization-provider.d.ts.map +1 -0
- package/dist/esm/i18n/localization-provider.js +76 -0
- package/dist/esm/i18n/localization-provider.js.map +1 -0
- package/dist/esm/i18n/messages/en-US.d.ts +4 -0
- package/dist/esm/i18n/messages/en-US.d.ts.map +1 -0
- package/dist/esm/i18n/messages/en-US.js +35 -0
- package/dist/esm/i18n/messages/en-US.js.map +1 -0
- package/dist/esm/i18n/messages/index.d.ts +3 -0
- package/dist/esm/i18n/messages/index.d.ts.map +1 -0
- package/dist/esm/i18n/messages/index.js +2 -0
- package/dist/esm/i18n/messages/index.js.map +1 -0
- package/dist/esm/i18n/messages/types.d.ts +72 -0
- package/dist/esm/i18n/messages/types.d.ts.map +1 -0
- package/dist/esm/i18n/messages/types.js +2 -0
- package/dist/esm/i18n/messages/types.js.map +1 -0
- package/dist/esm/index.d.ts +18 -3
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +16 -3
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/providers/ssr/ssr-provider.d.ts +1 -3
- package/dist/esm/providers/ssr/ssr-provider.d.ts.map +1 -1
- package/dist/esm/providers/ssr/ssr-provider.js +3 -3
- package/dist/esm/providers/ssr/ssr-provider.js.map +1 -1
- package/dist/esm/utils/is-production.d.ts +2 -0
- package/dist/esm/utils/is-production.d.ts.map +1 -0
- package/dist/esm/utils/is-production.js +4 -0
- package/dist/esm/utils/is-production.js.map +1 -0
- package/dist/esm/utils/style/types.d.ts +1 -1
- package/dist/esm/utils/style/types.d.ts.map +1 -1
- package/dist/esm/utils/style/types.js.map +1 -1
- package/dist/esm/utils/use-media-query.d.ts +2 -0
- package/dist/esm/utils/use-media-query.d.ts.map +1 -0
- package/dist/esm/utils/use-media-query.js +32 -0
- package/dist/esm/utils/use-media-query.js.map +1 -0
- package/dist/esm/utils/use-production-warning.d.ts +3 -0
- package/dist/esm/utils/use-production-warning.d.ts.map +1 -0
- package/dist/esm/utils/use-production-warning.js +4 -0
- package/dist/esm/utils/use-production-warning.js.map +1 -0
- package/dist/esm/with-style-props.d.ts.map +1 -1
- package/dist-styles/core.css +1 -1
- package/dist-styles/normalize.css +1 -1
- package/dist-styles/styles.css +1 -1
- package/package.json +64 -20
- package/dist/commonjs/components/card/card-context.d.ts +0 -4
- package/dist/commonjs/components/card/card-context.d.ts.map +0 -1
- package/dist/commonjs/components/card/card-context.js +0 -6
- package/dist/commonjs/components/card/card-context.js.map +0 -1
- package/dist/commonjs/components/modal/modal.d.ts +0 -64
- package/dist/commonjs/components/modal/modal.d.ts.map +0 -1
- package/dist/commonjs/components/modal/modal.js +0 -40
- package/dist/commonjs/components/modal/modal.js.map +0 -1
- package/dist/esm/components/card/card-context.d.ts +0 -4
- package/dist/esm/components/card/card-context.d.ts.map +0 -1
- package/dist/esm/components/card/card-context.js +0 -3
- package/dist/esm/components/card/card-context.js.map +0 -1
- package/dist/esm/components/modal/modal.d.ts +0 -64
- package/dist/esm/components/modal/modal.d.ts.map +0 -1
- package/dist/esm/components/modal/modal.js +0 -33
- package/dist/esm/components/modal/modal.js.map +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
2
|
import { type TagGroupProps as RACTagGroupProps, type TagListProps as RACTagListProps } from 'react-aria-components';
|
|
3
3
|
import type { CollectionItem, CommonProps, FieldProps, Key } from '../types.js';
|
|
4
|
-
export interface TagGroupProps<T extends CollectionItem = CollectionItem> extends CommonProps, Omit<FieldProps<Key[]>, 'validate' | 'error'>, Pick<RACTagGroupProps, 'selectionMode' | 'defaultSelectedKeys' | 'selectedKeys' | 'disabledKeys' | 'onSelectionChange' | 'onRemove'>, Pick<RACTagListProps<T>, 'children' | 'items'> {
|
|
4
|
+
export interface TagGroupProps<T extends CollectionItem = CollectionItem> extends CommonProps, Omit<FieldProps<Key[]>, 'validate' | 'error' | 'name'>, Pick<RACTagGroupProps, 'selectionMode' | 'defaultSelectedKeys' | 'selectedKeys' | 'disabledKeys' | 'onSelectionChange' | 'onRemove'>, Pick<RACTagListProps<T>, 'children' | 'items'> {
|
|
5
5
|
/** Whether the tag group is required. */
|
|
6
6
|
isRequired?: boolean;
|
|
7
7
|
/** The error message to display. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tag-group.d.ts","sourceRoot":"","sources":["../../../../src/components/tag/tag-group.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAgB,SAAS,EAAE,MAAM,OAAO,CAAC;AACrD,OAAO,EAGL,KAAK,aAAa,IAAI,gBAAgB,EACtC,KAAK,YAAY,IAAI,eAAe,EACrC,MAAM,uBAAuB,CAAC;AAI/B,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,UAAU,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAEhF,MAAM,WAAW,aAAa,CAAC,CAAC,SAAS,cAAc,GAAG,cAAc,CACtE,SAAQ,WAAW,EAEjB,IAAI,CAAC,UAAU,CAAC,GAAG,EAAE,CAAC,EAAE,UAAU,GAAG,OAAO,CAAC,
|
|
1
|
+
{"version":3,"file":"tag-group.d.ts","sourceRoot":"","sources":["../../../../src/components/tag/tag-group.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAgB,SAAS,EAAE,MAAM,OAAO,CAAC;AACrD,OAAO,EAGL,KAAK,aAAa,IAAI,gBAAgB,EACtC,KAAK,YAAY,IAAI,eAAe,EACrC,MAAM,uBAAuB,CAAC;AAI/B,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,UAAU,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAEhF,MAAM,WAAW,aAAa,CAAC,CAAC,SAAS,cAAc,GAAG,cAAc,CACtE,SAAQ,WAAW,EAEjB,IAAI,CAAC,UAAU,CAAC,GAAG,EAAE,CAAC,EAAE,UAAU,GAAG,OAAO,GAAG,MAAM,CAAC,EACtD,IAAI,CACF,gBAAgB,EAChB,eAAe,GAAG,qBAAqB,GAAG,cAAc,GAAG,cAAc,GAAG,mBAAmB,GAAG,UAAU,CAC7G,EACD,IAAI,CAAC,eAAe,CAAC,CAAC,CAAC,EAAE,UAAU,GAAG,OAAO,CAAC;IAChD,yCAAyC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AE,KAAK,EAAE,gBAAgB,EAAE,gBAAgB,YACxF,QAAQ,GACE,EACZ,KAAK,IAAI,uBAAC,kCAAkB,cAAE,KAAK,GAAsB,EAC1D,uBAAC,oCAAoB,cAAE,WAAW,GAAwB,IAC9C,CACf,CAAC;AACJ,CAAC;AAED;;;;GAIG;AACH,MAAM,SAAS,GAAG,IAAA,oCAAc,EAAC,IAAA,2BAAU,EAAC,QAAQ,CAAC,EAAE,UAAU,CAAC,CAAC;AAE7C,6BAAQ","sourcesContent":["'use client';\n\nimport clsx from 'clsx';\nimport type { ForwardedRef, ReactNode } from 'react';\nimport {\n TagGroup as RACTagGroup,\n TagList as RACTagList,\n type TagGroupProps as RACTagGroupProps,\n type TagListProps as RACTagListProps,\n} from 'react-aria-components';\nimport { forwardRef } from '../../forward-ref.js';\nimport { withStyleProps } from '../../with-style-props.js';\nimport { FormFieldDescription, FormFieldErrorText, FormFieldLabel } from '../internal/form-field/form-field.js';\nimport type { CollectionItem, CommonProps, FieldProps, Key } from '../types.js';\n\nexport interface TagGroupProps<T extends CollectionItem = CollectionItem>\n extends CommonProps,\n // `TagGroup` doesn't support `validate` or `error` because it's not a form field\n Omit<FieldProps<Key[]>, 'validate' | 'error'>,\n Pick<\n RACTagGroupProps,\n 'selectionMode' | 'defaultSelectedKeys' | 'selectedKeys' | 'disabledKeys' | 'onSelectionChange' | 'onRemove'\n >,\n Pick<RACTagListProps<T>, 'children' | 'items'> {\n /** Whether the tag group is required. */\n isRequired?: boolean;\n /** The error message to display. */\n error?: string;\n /** The size of the tags. */\n size?: 'medium' | 'large';\n /** Provides content to display when there are no tags in the group. */\n renderEmptyState?: () => ReactNode;\n}\n\nfunction TagGroup<T extends CollectionItem>(\n {\n label,\n description,\n error,\n children,\n isRequired,\n items,\n renderEmptyState,\n size = 'medium',\n UNSAFE_className,\n UNSAFE_style,\n ...props\n }: TagGroupProps<T>,\n ref: ForwardedRef<HTMLDivElement>,\n) {\n if (props.selectionMode != null && props.selectionMode !== 'none' && props.onRemove != null) {\n console.error('`onRemove` is not supported when `selectionMode` is set to anything other than `\"none\"`');\n }\n\n return (\n <RACTagGroup\n {...props}\n ref={ref}\n className={clsx('cim-tag-group', UNSAFE_className)}\n style={UNSAFE_style}\n data-size={size}\n >\n <FormFieldLabel isRequired={isRequired}>{label}</FormFieldLabel>\n <RACTagList className=\"cim-tag-group-list\" items={items} renderEmptyState={renderEmptyState}>\n {children}\n </RACTagList>\n {error && <FormFieldErrorText>{error}</FormFieldErrorText>}\n <FormFieldDescription>{description}</FormFieldDescription>\n </RACTagGroup>\n );\n}\n\n/**\n * Displays a group of tags. Allows for selecting or removing tags.\n *\n * See [tag group usage guidelines](https://ui.cimpress.io/components/tag-group/).\n */\nconst _TagGroup = withStyleProps(forwardRef(TagGroup), 'TagGroup');\n\nexport { _TagGroup as TagGroup };\n"]}
|
|
1
|
+
{"version":3,"file":"tag-group.js","sourceRoot":"","sources":["../../../../src/components/tag/tag-group.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;;;;;;;AAEb,gDAAwB;AAExB,iEAK+B;AAC/B,yDAAkD;AAClD,mEAA2D;AAC3D,wEAAgH;AAsBhH,SAAS,QAAQ,CACf,EACE,KAAK,EACL,WAAW,EACX,KAAK,EACL,QAAQ,EACR,UAAU,EACV,KAAK,EACL,gBAAgB,EAChB,IAAI,GAAG,QAAQ,EACf,gBAAgB,EAChB,YAAY,EACZ,GAAG,KAAK,EACS,EACnB,GAAiC;IAEjC,IAAI,KAAK,CAAC,aAAa,IAAI,IAAI,IAAI,KAAK,CAAC,aAAa,KAAK,MAAM,IAAI,KAAK,CAAC,QAAQ,IAAI,IAAI,EAAE,CAAC;QAC5F,OAAO,CAAC,KAAK,CAAC,yFAAyF,CAAC,CAAC;IAC3G,CAAC;IAED,OAAO,CACL,wBAAC,gCAAW,OACN,KAAK,EACT,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,IAAA,cAAI,EAAC,eAAe,EAAE,gBAAgB,CAAC,EAClD,KAAK,EAAE,YAAY,eACR,IAAI,aAEf,uBAAC,8BAAc,IAAC,UAAU,EAAE,UAAU,YAAG,KAAK,GAAkB,EAChE,uBAAC,+BAAU,IAAC,SAAS,EAAC,oBAAoB,EAAC,KAAK,EAAE,KAAK,EAAE,gBAAgB,EAAE,gBAAgB,YACxF,QAAQ,GACE,EACZ,KAAK,IAAI,uBAAC,kCAAkB,cAAE,KAAK,GAAsB,EAC1D,uBAAC,oCAAoB,cAAE,WAAW,GAAwB,IAC9C,CACf,CAAC;AACJ,CAAC;AAED;;;;GAIG;AACH,MAAM,SAAS,GAAG,IAAA,oCAAc,EAAC,IAAA,2BAAU,EAAC,QAAQ,CAAC,EAAE,UAAU,CAAC,CAAC;AAE7C,6BAAQ","sourcesContent":["'use client';\n\nimport clsx from 'clsx';\nimport type { ForwardedRef, ReactNode } from 'react';\nimport {\n TagGroup as RACTagGroup,\n TagList as RACTagList,\n type TagGroupProps as RACTagGroupProps,\n type TagListProps as RACTagListProps,\n} from 'react-aria-components';\nimport { forwardRef } from '../../forward-ref.js';\nimport { withStyleProps } from '../../with-style-props.js';\nimport { FormFieldDescription, FormFieldErrorText, FormFieldLabel } from '../internal/form-field/form-field.js';\nimport type { CollectionItem, CommonProps, FieldProps, Key } from '../types.js';\n\nexport interface TagGroupProps<T extends CollectionItem = CollectionItem>\n extends CommonProps,\n // `TagGroup` doesn't support `validate` or `error` because it's not a form field\n Omit<FieldProps<Key[]>, 'validate' | 'error' | 'name'>,\n Pick<\n RACTagGroupProps,\n 'selectionMode' | 'defaultSelectedKeys' | 'selectedKeys' | 'disabledKeys' | 'onSelectionChange' | 'onRemove'\n >,\n Pick<RACTagListProps<T>, 'children' | 'items'> {\n /** Whether the tag group is required. */\n isRequired?: boolean;\n /** The error message to display. */\n error?: string;\n /** The size of the tags. */\n size?: 'medium' | 'large';\n /** Provides content to display when there are no tags in the group. */\n renderEmptyState?: () => ReactNode;\n}\n\nfunction TagGroup<T extends CollectionItem>(\n {\n label,\n description,\n error,\n children,\n isRequired,\n items,\n renderEmptyState,\n size = 'medium',\n UNSAFE_className,\n UNSAFE_style,\n ...props\n }: TagGroupProps<T>,\n ref: ForwardedRef<HTMLDivElement>,\n) {\n if (props.selectionMode != null && props.selectionMode !== 'none' && props.onRemove != null) {\n console.error('`onRemove` is not supported when `selectionMode` is set to anything other than `\"none\"`');\n }\n\n return (\n <RACTagGroup\n {...props}\n ref={ref}\n className={clsx('cim-tag-group', UNSAFE_className)}\n style={UNSAFE_style}\n data-size={size}\n >\n <FormFieldLabel isRequired={isRequired}>{label}</FormFieldLabel>\n <RACTagList className=\"cim-tag-group-list\" items={items} renderEmptyState={renderEmptyState}>\n {children}\n </RACTagList>\n {error && <FormFieldErrorText>{error}</FormFieldErrorText>}\n <FormFieldDescription>{description}</FormFieldDescription>\n </RACTagGroup>\n );\n}\n\n/**\n * Displays a group of tags. Allows for selecting or removing tags.\n *\n * See [tag group usage guidelines](https://ui.cimpress.io/components/tag-group/).\n */\nconst _TagGroup = withStyleProps(forwardRef(TagGroup), 'TagGroup');\n\nexport { _TagGroup as TagGroup };\n"]}
|
|
@@ -13,7 +13,7 @@ const index_js_1 = require("../../icons/index.js");
|
|
|
13
13
|
const with_style_props_js_1 = require("../../with-style-props.js");
|
|
14
14
|
function Tag({ children, iconStart, UNSAFE_className, UNSAFE_style, ...props }, ref) {
|
|
15
15
|
const textValue = typeof children === 'string' ? children : typeof children === 'number' ? String(children) : children.join('');
|
|
16
|
-
return ((0, jsx_runtime_1.jsx)(react_aria_components_1.Tag, { ...props, ref: ref, className: (0, clsx_1.default)('cim-tag', UNSAFE_className), style: UNSAFE_style, textValue: textValue, children: ({ allowsRemoving }) => ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [iconStart && (0, jsx_runtime_1.jsx)("div", { className: "cim-tag-icon", children: iconStart }), (0, jsx_runtime_1.jsx)("span", { className: "cim-tag-text", children: children }), allowsRemoving && ((0, jsx_runtime_1.jsx)(react_aria_components_1.Button, { slot: "remove", children: (0, jsx_runtime_1.jsx)(index_js_1.IconCloseBold, {}) }))] })) }));
|
|
16
|
+
return ((0, jsx_runtime_1.jsx)(react_aria_components_1.Tag, { ...props, ref: ref, className: (0, clsx_1.default)('cim-tag', UNSAFE_className), style: UNSAFE_style, textValue: textValue, children: ({ allowsRemoving }) => ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [iconStart && (0, jsx_runtime_1.jsx)("div", { className: "cim-tag-icon", children: iconStart }), (0, jsx_runtime_1.jsx)("span", { className: "cim-tag-text", children: children }), allowsRemoving && ((0, jsx_runtime_1.jsx)(react_aria_components_1.Button, { slot: "remove", excludeFromTabOrder: true, children: (0, jsx_runtime_1.jsx)(index_js_1.IconCloseBold, {}) }))] })) }));
|
|
17
17
|
}
|
|
18
18
|
/**
|
|
19
19
|
* Displays a single tag within a tag group.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tag.js","sourceRoot":"","sources":["../../../../src/components/tag/tag.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;;;;;;;AAEb,gDAAwB;AAExB,iEAAyG;AACzG,yDAAkD;AAClD,mDAAqD;AACrD,mEAA2D;AAW3D,SAAS,GAAG,CACV,EAAE,QAAQ,EAAE,SAAS,EAAE,gBAAgB,EAAE,YAAY,EAAE,GAAG,KAAK,EAAY,EAC3E,GAA8B;IAE9B,MAAM,SAAS,GACb,OAAO,QAAQ,KAAK,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,OAAO,QAAQ,KAAK,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAEhH,OAAO,CACL,uBAAC,2BAAM,OACD,KAAK,EACT,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,IAAA,cAAI,EAAC,SAAS,EAAE,gBAAgB,CAAC,EAC5C,KAAK,EAAE,YAAY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AG,GACP,CACb,IACA,CACJ,GACM,CACV,CAAC;AACJ,CAAC;AAED;;;;GAIG;AACH,MAAM,IAAI,GAAG,IAAA,oCAAc,EAAC,IAAA,2BAAU,EAAC,GAAG,CAAC,EAAE,KAAK,CAAC,CAAC;AAEnC,mBAAG","sourcesContent":["'use client';\n\nimport clsx from 'clsx';\nimport type { ForwardedRef, ReactNode } from 'react';\nimport { Tag as RACTag, type TagProps as RACTagProps, Button as RACButton } from 'react-aria-components';\nimport { forwardRef } from '../../forward-ref.js';\nimport { IconCloseBold } from '../../icons/index.js';\nimport { withStyleProps } from '../../with-style-props.js';\nimport type { StringLikeChildren } from '../types.js';\nimport type { CommonProps } from '../types.js';\n\nexport interface TagProps extends Omit<CommonProps, 'id'>, Pick<RACTagProps, 'id' | 'isDisabled'> {\n /** The content to display as the label. */\n children: StringLikeChildren;\n /** The icon to display at the start of the tag. */\n iconStart?: ReactNode;\n}\n\nfunction Tag(\n { children, iconStart, UNSAFE_className, UNSAFE_style, ...props }: TagProps,\n ref: ForwardedRef<HTMLElement>,\n) {\n const textValue =\n typeof children === 'string' ? children : typeof children === 'number' ? String(children) : children.join('');\n\n return (\n <RACTag\n {...props}\n ref={ref}\n className={clsx('cim-tag', UNSAFE_className)}\n style={UNSAFE_style}\n textValue={textValue}\n >\n {({ allowsRemoving }) => (\n <>\n {iconStart && <div className=\"cim-tag-icon\">{iconStart}</div>}\n <span className=\"cim-tag-text\">{children}</span>\n {allowsRemoving && (\n <RACButton slot=\"remove\" excludeFromTabOrder>\n <IconCloseBold />\n </RACButton>\n )}\n </>\n )}\n </RACTag>\n );\n}\n\n/**\n * Displays a single tag within a tag group.\n *\n * See [tag group usage guidelines](https://ui.cimpress.io/components/tag-group/).\n */\nconst _Tag = withStyleProps(forwardRef(Tag), 'Tag');\n\nexport { _Tag as Tag };\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tag-field-input.d.ts","sourceRoot":"","sources":["../../../../src/components/tag-field/tag-field-input.tsx"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.TagFieldInput = TagFieldInput;
|
|
7
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
+
const clsx_1 = __importDefault(require("clsx"));
|
|
9
|
+
const react_1 = require("react");
|
|
10
|
+
const react_aria_components_1 = require("react-aria-components");
|
|
11
|
+
const utils_js_1 = require("../typography/utils.js");
|
|
12
|
+
/** @internal */
|
|
13
|
+
function TagFieldInput({ isReadOnly, isRequired, isInvalid, placeholder, onFocusChange, 'aria-describedby': ariaDescribedby, }) {
|
|
14
|
+
const comboBoxState = (0, react_1.useContext)(react_aria_components_1.ComboBoxStateContext);
|
|
15
|
+
const inputContext = (0, react_1.useContext)(react_aria_components_1.InputContext);
|
|
16
|
+
// We use custom IDs for description and error message, so we need to manually attach them to the input
|
|
17
|
+
const { id: descriptionId } = (0, react_aria_components_1.useSlottedContext)(react_aria_components_1.TextContext, 'description');
|
|
18
|
+
const { id: errorMessageId } = (0, react_aria_components_1.useSlottedContext)(react_aria_components_1.TextContext, 'errorMessage');
|
|
19
|
+
return ((0, jsx_runtime_1.jsx)(react_aria_components_1.InputContext.Provider, { value: {
|
|
20
|
+
...inputContext,
|
|
21
|
+
// name: undefined,
|
|
22
|
+
// Change `required` to `aria-required` so that form submission isn't blocked, but required state is still announced by screen readers
|
|
23
|
+
required: false,
|
|
24
|
+
'aria-required': isRequired,
|
|
25
|
+
'aria-invalid': isInvalid || undefined,
|
|
26
|
+
}, children: (0, jsx_runtime_1.jsx)(react_aria_components_1.Input, { className: (0, clsx_1.default)('cim-combo-box-input', (0, utils_js_1.textStyle)({ variant: 'medium' })),
|
|
27
|
+
// Ensure the popover opens when the input is clicked.
|
|
28
|
+
// By default, React Aria only opens the popover when the input is focused.
|
|
29
|
+
onClick: () => !isReadOnly && comboBoxState.open(), placeholder: placeholder, onFocus: () => onFocusChange(true), onBlur: () => onFocusChange(false), "aria-describedby": [descriptionId, errorMessageId, ariaDescribedby].filter(Boolean).join(' ') || undefined }) }));
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=tag-field-input.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tag-field-input.js","sourceRoot":"","sources":["../../../../src/components/tag-field/tag-field-input.tsx"],"names":[],"mappings":";;;;;AAYA,sCA6CC;;AAzDD,gDAAwB;AACxB,iCAAmC;AACnC,iEAM+B;AAC/B,qDAAmD;AAEnD,gBAAgB;AAChB,SAAgB,aAAa,CAAC,EAC5B,UAAU,EACV,UAAU,EACV,SAAS,EACT,WAAW,EACX,aAAa,EACb,kBAAkB,EAAE,eAAe,GAQpC;IACC,MAAM,aAAa,GAAG,IAAA,kBAAU,EAAC,4CAAuB,CAAC,CAAC;IAC1D,MAAM,YAAY,GAAG,IAAA,kBAAU,EAAC,oCAAe,CAAC,CAAC;IAEjD,uGAAuG;IACvG,MAAM,EAAE,EAAE,EAAE,aAAa,EAAE,GAAG,IAAA,yCAAiB,EAAC,mCAAc,EAAE,aAAa,CAAE,CAAC;IAChF,MAAM,EAAE,EAAE,EAAE,cAAc,EAAE,GAAG,IAAA,yCAAiB,EAAC,mCAAc,EAAE,cAAc,CAAE,CAAC;IAElF,OAAO,CACL,uBAAC,oCAAe,CAAC,QAAQ,IACvB,KAAK,EAAE;YACL,GAAG,YAAY;YACf,mBAAmB;YACnB,sIAAsI;YACtI,QAAQ,EAAE,KAAK;YACf,eAAe,EAAE,UAAU;YAC3B,cAAc,EAAE,SAAS,IAAI,SAAS;SACvC,YAED,uBAAC,6BAAQ,IACP,SAAS,EAAE,IAAA,cAAI,EAAC,qBAAqB,EAAE,IAAA,oBAAS,EAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC,CAAC;YACxE,sDAAsD;YACtD,2EAA2E;YAC3E,OAAO,EAAE,GAAG,EAAE,CAAC,CAAC,UAAU,IAAI,aAAc,CAAC,IAAI,EAAE,EACnD,WAAW,EAAE,WAAW,EACxB,OAAO,EAAE,GAAG,EAAE,CAAC,aAAa,CAAC,IAAI,CAAC,EAClC,MAAM,EAAE,GAAG,EAAE,CAAC,aAAa,CAAC,KAAK,CAAC,sBAChB,CAAC,aAAa,EAAE,cAAc,EAAE,eAAe,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,SAAS,GACzG,GACuB,CAC5B,CAAC;AACJ,CAAC","sourcesContent":["import clsx from 'clsx';\nimport { useContext } from 'react';\nimport {\n ComboBoxStateContext as RACComboBoxStateContext,\n Input as RACInput,\n InputContext as RACInputContext,\n TextContext as RACTextContext,\n useSlottedContext,\n} from 'react-aria-components';\nimport { textStyle } from '../typography/utils.js';\n\n/** @internal */\nexport function TagFieldInput({\n isReadOnly,\n isRequired,\n isInvalid,\n placeholder,\n onFocusChange,\n 'aria-describedby': ariaDescribedby,\n}: {\n isReadOnly: boolean | undefined;\n isRequired: boolean | undefined;\n isInvalid: boolean | undefined;\n placeholder: string | undefined;\n onFocusChange: (isFocused: boolean) => void;\n 'aria-describedby': string | undefined;\n}) {\n const comboBoxState = useContext(RACComboBoxStateContext);\n const inputContext = useContext(RACInputContext);\n\n // We use custom IDs for description and error message, so we need to manually attach them to the input\n const { id: descriptionId } = useSlottedContext(RACTextContext, 'description')!;\n const { id: errorMessageId } = useSlottedContext(RACTextContext, 'errorMessage')!;\n\n return (\n <RACInputContext.Provider\n value={{\n ...inputContext,\n // name: undefined,\n // Change `required` to `aria-required` so that form submission isn't blocked, but required state is still announced by screen readers\n required: false,\n 'aria-required': isRequired,\n 'aria-invalid': isInvalid || undefined,\n }}\n >\n <RACInput\n className={clsx('cim-combo-box-input', textStyle({ variant: 'medium' }))}\n // Ensure the popover opens when the input is clicked.\n // By default, React Aria only opens the popover when the input is focused.\n onClick={() => !isReadOnly && comboBoxState!.open()}\n placeholder={placeholder}\n onFocus={() => onFocusChange(true)}\n onBlur={() => onFocusChange(false)}\n aria-describedby={[descriptionId, errorMessageId, ariaDescribedby].filter(Boolean).join(' ') || undefined}\n />\n </RACInputContext.Provider>\n );\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tag-field-list-box.d.ts","sourceRoot":"","sources":["../../../../src/components/tag-field/tag-field-list-box.tsx"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TagFieldListBox = TagFieldListBox;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const react_1 = require("react");
|
|
6
|
+
const react_aria_components_1 = require("react-aria-components");
|
|
7
|
+
/** @internal */
|
|
8
|
+
function TagFieldListBox({ children, selectedKeys, setSelectedKeys, items, onScroll, }) {
|
|
9
|
+
const listState = (0, react_1.useContext)(react_aria_components_1.ListStateContext);
|
|
10
|
+
// Override RACListStateContext to allow multiple selection within the list
|
|
11
|
+
const updatedListState = (0, react_1.useMemo)(() => {
|
|
12
|
+
if (!listState || !listState.selectionManager) {
|
|
13
|
+
return listState;
|
|
14
|
+
}
|
|
15
|
+
// @ts-expect-error `selectionManager.state` is private
|
|
16
|
+
// This is a temporary mutation before a context update, so this is fine
|
|
17
|
+
// eslint-disable-next-line react-hooks/react-compiler
|
|
18
|
+
listState.selectionManager.state.selectionMode = 'multiple';
|
|
19
|
+
// @ts-expect-error `selectionManager.state` is private
|
|
20
|
+
listState.selectionManager.state.selectedKeys = selectedKeys;
|
|
21
|
+
// @ts-expect-error `selectionManager.state` is private
|
|
22
|
+
listState.selectionManager.state.setSelectedKeys = setSelectedKeys;
|
|
23
|
+
// @ts-expect-error `selectionManager.state` is private
|
|
24
|
+
listState.selectionManager.state.disallowEmptySelection = false;
|
|
25
|
+
return {
|
|
26
|
+
...listState,
|
|
27
|
+
};
|
|
28
|
+
}, [listState, selectedKeys, setSelectedKeys]);
|
|
29
|
+
return ((0, jsx_runtime_1.jsx)(react_aria_components_1.ListStateContext.Provider, { value: updatedListState, children: (0, jsx_runtime_1.jsx)(react_aria_components_1.ListBox, { className: "cim-combo-box-listbox", onScroll: onScroll, items: items, children: children }) }));
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=tag-field-list-box.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tag-field-list-box.js","sourceRoot":"","sources":["../../../../src/components/tag-field/tag-field-list-box.tsx"],"names":[],"mappings":";;AAMA,0CAyCC;;AA/CD,iCAA4C;AAC5C,iEAAuG;AAIvG,gBAAgB;AAChB,SAAgB,eAAe,CAA2B,EACxD,QAAQ,EACR,YAAY,EACZ,eAAe,EACf,KAAK,EACL,QAAQ,GAIT;IACC,MAAM,SAAS,GAAG,IAAA,kBAAU,EAAC,wCAAmB,CAAC,CAAC;IAElD,2EAA2E;IAC3E,MAAM,gBAAgB,GAAG,IAAA,eAAO,EAAC,GAAG,EAAE;QACpC,IAAI,CAAC,SAAS,IAAI,CAAC,SAAS,CAAC,gBAAgB,EAAE,CAAC;YAC9C,OAAO,SAAS,CAAC;QACnB,CAAC;QAED,uDAAuD;QACvD,wEAAwE;QACxE,sDAAsD;QACtD,SAAS,CAAC,gBAAgB,CAAC,KAAK,CAAC,aAAa,GAAG,UAAU,CAAC;QAC5D,uDAAuD;QACvD,SAAS,CAAC,gBAAgB,CAAC,KAAK,CAAC,YAAY,GAAG,YAAY,CAAC;QAC7D,uDAAuD;QACvD,SAAS,CAAC,gBAAgB,CAAC,KAAK,CAAC,eAAe,GAAG,eAAe,CAAC;QACnE,uDAAuD;QACvD,SAAS,CAAC,gBAAgB,CAAC,KAAK,CAAC,sBAAsB,GAAG,KAAK,CAAC;QAEhE,OAAO;YACL,GAAG,SAAS;SACb,CAAC;IACJ,CAAC,EAAE,CAAC,SAAS,EAAE,YAAY,EAAE,eAAe,CAAC,CAAC,CAAC;IAE/C,OAAO,CACL,uBAAC,wCAAmB,CAAC,QAAQ,IAAC,KAAK,EAAE,gBAAgB,YACnD,uBAAC,+BAAU,IAAC,SAAS,EAAC,uBAAuB,EAAC,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,YAC3E,QAAQ,GACE,GACgB,CAChC,CAAC;AACJ,CAAC","sourcesContent":["import { useContext, useMemo } from 'react';\nimport { ListBox as RACListBox, ListStateContext as RACListStateContext } from 'react-aria-components';\nimport type { CollectionItem, Key } from '../types.js';\nimport type { UNSTABLE_TagFieldProps } from './tag-field.js';\n\n/** @internal */\nexport function TagFieldListBox<T extends CollectionItem>({\n children,\n selectedKeys,\n setSelectedKeys,\n items,\n onScroll,\n}: Pick<UNSTABLE_TagFieldProps<T>, 'children' | 'items' | 'onScroll'> & {\n selectedKeys: Set<Key>;\n setSelectedKeys: (keys: Set<Key>) => void;\n}) {\n const listState = useContext(RACListStateContext);\n\n // Override RACListStateContext to allow multiple selection within the list\n const updatedListState = useMemo(() => {\n if (!listState || !listState.selectionManager) {\n return listState;\n }\n\n // @ts-expect-error `selectionManager.state` is private\n // This is a temporary mutation before a context update, so this is fine\n // eslint-disable-next-line react-hooks/react-compiler\n listState.selectionManager.state.selectionMode = 'multiple';\n // @ts-expect-error `selectionManager.state` is private\n listState.selectionManager.state.selectedKeys = selectedKeys;\n // @ts-expect-error `selectionManager.state` is private\n listState.selectionManager.state.setSelectedKeys = setSelectedKeys;\n // @ts-expect-error `selectionManager.state` is private\n listState.selectionManager.state.disallowEmptySelection = false;\n\n return {\n ...listState,\n };\n }, [listState, selectedKeys, setSelectedKeys]);\n\n return (\n <RACListStateContext.Provider value={updatedListState}>\n <RACListBox className=\"cim-combo-box-listbox\" onScroll={onScroll} items={items}>\n {children}\n </RACListBox>\n </RACListStateContext.Provider>\n );\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tag-field-tags.d.ts","sourceRoot":"","sources":["../../../../src/components/tag-field/tag-field-tags.tsx"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TagFieldTags = TagFieldTags;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const react_1 = require("react");
|
|
6
|
+
const react_aria_components_1 = require("react-aria-components");
|
|
7
|
+
const tag_group_js_1 = require("../tag/tag-group.js");
|
|
8
|
+
const tag_js_1 = require("../tag/tag.js");
|
|
9
|
+
/** @internal */
|
|
10
|
+
function TagFieldTags({ inputId, selectedKeys, isDisabled, renderEmptyState, onRemove, }) {
|
|
11
|
+
const listState = (0, react_1.useContext)(react_aria_components_1.ListStateContext);
|
|
12
|
+
const selectedItems = (0, react_1.useMemo)(() => {
|
|
13
|
+
return [...selectedKeys.values()]
|
|
14
|
+
.map((key) => listState?.selectionManager.collection.getItem(key))
|
|
15
|
+
.filter((value) => !!value);
|
|
16
|
+
}, [selectedKeys, listState?.selectionManager.collection]);
|
|
17
|
+
return ((0, jsx_runtime_1.jsx)(react_aria_components_1.Provider, { values: [
|
|
18
|
+
// Reset contexts so that TagGroup doesn't inherit any data from RACComboBox
|
|
19
|
+
[react_aria_components_1.LabelContext, null],
|
|
20
|
+
[react_aria_components_1.ButtonContext, null],
|
|
21
|
+
[react_aria_components_1.TextContext, null],
|
|
22
|
+
[react_aria_components_1.ListStateContext, null],
|
|
23
|
+
], children: (0, jsx_runtime_1.jsx)(tag_group_js_1.TagGroup, { "aria-labelledby": inputId, disabledKeys: isDisabled ? selectedKeys : undefined, renderEmptyState: renderEmptyState, onRemove: (keys) => {
|
|
24
|
+
keys.forEach(onRemove);
|
|
25
|
+
}, children: selectedItems.map((item) => ((0, jsx_runtime_1.jsx)(tag_js_1.Tag, { id: item.key, isDisabled: item.props.isDisabled, children: item.textValue }, item.key))) }) }));
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=tag-field-tags.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tag-field-tags.js","sourceRoot":"","sources":["../../../../src/components/tag-field/tag-field-tags.tsx"],"names":[],"mappings":";;AAcA,oCA6CC;;AA3DD,iCAA4C;AAC5C,iEAM+B;AAC/B,sDAA+C;AAC/C,0CAAmD;AAInD,gBAAgB;AAChB,SAAgB,YAAY,CAA2B,EACrD,OAAO,EACP,YAAY,EACZ,UAAU,EACV,gBAAgB,EAChB,QAAQ,GAKT;IACC,MAAM,SAAS,GAAG,IAAA,kBAAU,EAAC,wCAAmB,CAAC,CAAC;IAElD,MAAM,aAAa,GAAG,IAAA,eAAO,EAAC,GAAG,EAAE;QACjC,OAAO,CAAC,GAAG,YAAY,CAAC,MAAM,EAAE,CAAC;aAC9B,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,SAAS,EAAE,gBAAgB,CAAC,UAAU,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;aACjE,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;IAChC,CAAC,EAAE,CAAC,YAAY,EAAE,SAAS,EAAE,gBAAgB,CAAC,UAAU,CAAC,CAAC,CAAC;IAE3D,OAAO,CACL,uBAAC,gCAAW,IACV,MAAM,EAAE;YACN,4EAA4E;YAC5E,CAAC,oCAAe,EAAE,IAAI,CAAC;YACvB,CAAC,qCAAgB,EAAE,IAAI,CAAC;YACxB,CAAC,mCAAc,EAAE,IAAI,CAAC;YACtB,CAAC,wCAAmB,EAAE,IAAI,CAAC;SAC5B,YAED,uBAAC,uBAAQ,uBACU,OAAO,EACxB,YAAY,EAAE,UAAU,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,SAAS,EACnD,gBAAgB,EAAE,gBAAgB,EAClC,QAAQ,EAAE,CAAC,IAAI,EAAE,EAAE;gBACjB,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;YACzB,CAAC,YAEA,aAAa,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAC3B,uBAAC,YAAG,IAAgB,EAAE,EAAE,IAAI,CAAC,GAAG,EAAE,UAAU,EAAG,IAAI,CAAC,KAAkB,CAAC,UAAU,YAC9E,IAAI,CAAC,SAAS,IADP,IAAI,CAAC,GAAG,CAEZ,CACP,CAAC,GACO,GACC,CACf,CAAC;AACJ,CAAC","sourcesContent":["import { useContext, useMemo } from 'react';\nimport {\n ButtonContext as RACButtonContext,\n LabelContext as RACLabelContext,\n ListStateContext as RACListStateContext,\n Provider as RACProvider,\n TextContext as RACTextContext,\n} from 'react-aria-components';\nimport { TagGroup } from '../tag/tag-group.js';\nimport { Tag, type TagProps } from '../tag/tag.js';\nimport type { CollectionItem, Key } from '../types.js';\nimport type { UNSTABLE_TagFieldProps } from './tag-field.js';\n\n/** @internal */\nexport function TagFieldTags<T extends CollectionItem>({\n inputId,\n selectedKeys,\n isDisabled,\n renderEmptyState,\n onRemove,\n}: Pick<UNSTABLE_TagFieldProps<T>, 'isDisabled' | 'renderEmptyState'> & {\n inputId: string;\n selectedKeys: Set<Key>;\n onRemove: (key: Key) => void;\n}) {\n const listState = useContext(RACListStateContext);\n\n const selectedItems = useMemo(() => {\n return [...selectedKeys.values()]\n .map((key) => listState?.selectionManager.collection.getItem(key))\n .filter((value) => !!value);\n }, [selectedKeys, listState?.selectionManager.collection]);\n\n return (\n <RACProvider\n values={[\n // Reset contexts so that TagGroup doesn't inherit any data from RACComboBox\n [RACLabelContext, null],\n [RACButtonContext, null],\n [RACTextContext, null],\n [RACListStateContext, null],\n ]}\n >\n <TagGroup\n aria-labelledby={inputId}\n disabledKeys={isDisabled ? selectedKeys : undefined}\n renderEmptyState={renderEmptyState}\n onRemove={(keys) => {\n keys.forEach(onRemove);\n }}\n >\n {selectedItems.map((item) => (\n <Tag key={item.key} id={item.key} isDisabled={(item.props as TagProps).isDisabled}>\n {item.textValue}\n </Tag>\n ))}\n </TagGroup>\n </RACProvider>\n );\n}\n"]}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { type ListBoxProps as RACListBoxProps, type ComboBoxProps as RACComboBoxProps, type ListBoxItemProps as RACListBoxItemProps } from 'react-aria-components';
|
|
2
|
+
import type { TagGroupProps } from '../tag/tag-group.js';
|
|
3
|
+
import type { CollectionItem, CollectionProps, CommonProps, FieldWithPlaceholderProps, Key, StringLikeChildren } from '../types.js';
|
|
4
|
+
/** Represents the state of the `TagField` component for validation purposes. */
|
|
5
|
+
export interface UNSTABLE_TagFieldValidationValue {
|
|
6
|
+
/** The selected keys in the TagField. */
|
|
7
|
+
selectedKeys: Set<Key> | null;
|
|
8
|
+
/** The value of the TagField input. */
|
|
9
|
+
inputValue: string;
|
|
10
|
+
}
|
|
11
|
+
export interface UNSTABLE_TagFieldProps<T extends CollectionItem = CollectionItem> extends CommonProps, FieldWithPlaceholderProps<UNSTABLE_TagFieldValidationValue>, CollectionProps<T>, Pick<RACComboBoxProps<T>, 'isRequired' | 'isDisabled' | 'isInvalid' | 'isReadOnly' | 'inputValue' | 'defaultInputValue' | 'autoFocus' | 'onInputChange' | 'onFocus' | 'onBlur' | 'onOpenChange'>, Pick<RACListBoxProps<T>, 'onScroll'>, Pick<TagGroupProps<T>, 'renderEmptyState'> {
|
|
12
|
+
selectedKeys?: Iterable<Key>;
|
|
13
|
+
defaultSelectedKeys?: Iterable<Key>;
|
|
14
|
+
onSelectionChange?: (keys: Set<Key>) => void;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Allows users to filter a collapsible list and select multiple items from it.
|
|
18
|
+
*
|
|
19
|
+
* See [tag field usage guidelines](https://ui.cimpress.com/components/tag-field)
|
|
20
|
+
*/
|
|
21
|
+
declare const _UNSTABLE_TagField: <T extends CollectionItem>(props: UNSTABLE_TagFieldProps<T> & import("react").RefAttributes<HTMLDivElement> & import("../../with-style-props.js").StyleProps) => import("react").JSX.Element | null;
|
|
22
|
+
export { _UNSTABLE_TagField as UNSTABLE_TagField };
|
|
23
|
+
export interface UNSTABLE_TagFieldItemProps<T extends CollectionItem> extends Pick<RACListBoxItemProps<T>, 'id' | 'isDisabled' | 'onHoverStart' | 'onHoverEnd'> {
|
|
24
|
+
/** The content to display as the label. */
|
|
25
|
+
children: StringLikeChildren;
|
|
26
|
+
}
|
|
27
|
+
/** Renders a single list item within `TagField`. */
|
|
28
|
+
export declare function UNSTABLE_TagFieldItem<T extends CollectionItem>({ children, ...props }: UNSTABLE_TagFieldItemProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
29
|
+
export declare namespace UNSTABLE_TagFieldItem {
|
|
30
|
+
var displayName: string;
|
|
31
|
+
}
|
|
32
|
+
export interface UNSTABLE_TagFieldSectionProps<T extends CollectionItem> extends CollectionProps<T> {
|
|
33
|
+
/** The ID of the section. Has to be unique across all sections and items. */
|
|
34
|
+
id?: Key;
|
|
35
|
+
/** The content to display as the section title. */
|
|
36
|
+
title: string;
|
|
37
|
+
}
|
|
38
|
+
/** Groups list items within `TagField` into a section. */
|
|
39
|
+
export declare function UNSTABLE_TagFieldSection<T extends CollectionItem>({ title, children, items, ...props }: UNSTABLE_TagFieldSectionProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
40
|
+
export declare namespace UNSTABLE_TagFieldSection {
|
|
41
|
+
var displayName: string;
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=tag-field.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tag-field.d.ts","sourceRoot":"","sources":["../../../../src/components/tag-field/tag-field.tsx"],"names":[],"mappings":"AAQA,OAAO,EAOL,KAAK,YAAY,IAAI,eAAe,EAIpC,KAAK,aAAa,IAAI,gBAAgB,EACtC,KAAK,gBAAgB,IAAI,mBAAmB,EAK7C,MAAM,u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,CAAC,CAAC,CAAC,EAAE,IAAI,GAAG,YAAY,GAAG,cAAc,GAAG,YAAY,CAAC;IACzF,2CAA2C;IAC3C,QAAQ,EAAE,kBAAkB,CAAC;CAC9B;AAED,oDAAoD;AACpD,wBAAgB,qBAAqB,CAAC,CAAC,SAAS,cAAc,EAAE,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,0BAA0B,CAAC,CAAC,CAAC,2CAqBpH;yBArBe,qBAAqB;;;AAyBrC,MAAM,WAAW,6BAA6B,CAAC,CAAC,SAAS,cAAc,CAAE,SAAQ,eAAe,CAAC,CAAC,CAAC;IACjG,6EAA6E;IAC7E,EAAE,CAAC,EAAE,GAAG,CAAC;IACT,mDAAmD;IACnD,KAAK,EAAE,MAAM,CAAC;CACf;AAED,0DAA0D;AAC1D,wBAAgB,wBAAwB,CAAC,CAAC,SAAS,cAAc,EAAE,EACjE,KAAK,EACL,QAAQ,EACR,KAAK,EACL,GAAG,KAAK,EACT,EAAE,6BAA6B,CAAC,CAAC,CAAC,2CAelC;yBApBe,wBAAwB"}
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
"use strict";
|
|
3
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
4
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
5
|
+
};
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.UNSTABLE_TagField = void 0;
|
|
8
|
+
exports.UNSTABLE_TagFieldItem = UNSTABLE_TagFieldItem;
|
|
9
|
+
exports.UNSTABLE_TagFieldSection = UNSTABLE_TagFieldSection;
|
|
10
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
11
|
+
const form_1 = require("@react-aria/form");
|
|
12
|
+
const utils_1 = require("@react-aria/utils");
|
|
13
|
+
const form_2 = require("@react-stately/form");
|
|
14
|
+
const utils_2 = require("@react-stately/utils");
|
|
15
|
+
const clsx_1 = __importDefault(require("clsx"));
|
|
16
|
+
const react_1 = require("react");
|
|
17
|
+
const react_aria_components_1 = require("react-aria-components");
|
|
18
|
+
const forward_ref_js_1 = require("../../forward-ref.js");
|
|
19
|
+
const localization_provider_js_1 = require("../../i18n/localization-provider.js");
|
|
20
|
+
const index_js_1 = require("../../icons/index.js");
|
|
21
|
+
const is_production_js_1 = require("../../utils/is-production.js");
|
|
22
|
+
const use_production_warning_js_1 = require("../../utils/use-production-warning.js");
|
|
23
|
+
const with_style_props_js_1 = require("../../with-style-props.js");
|
|
24
|
+
const collapsible_list_js_1 = require("../internal/collapsible-list/collapsible-list.js");
|
|
25
|
+
const form_field_js_1 = require("../internal/form-field/form-field.js");
|
|
26
|
+
const stack_js_1 = require("../spacing/stack/stack.js");
|
|
27
|
+
const text_js_1 = require("../typography/text.js");
|
|
28
|
+
const utils_js_1 = require("../typography/utils.js");
|
|
29
|
+
const tag_field_input_js_1 = require("./tag-field-input.js");
|
|
30
|
+
const tag_field_list_box_js_1 = require("./tag-field-list-box.js");
|
|
31
|
+
const tag_field_tags_js_1 = require("./tag-field-tags.js");
|
|
32
|
+
function UNSTABLE_TagField({ label, description, error, items, children, placeholder, UNSAFE_className, UNSAFE_style, isReadOnly, inputValue: consumerInputValue, defaultInputValue: defaultConsumerInputValue, onInputChange, name, validate, onScroll, selectedKeys: consumerSelectedKeys, defaultSelectedKeys: defaultConsumerSelectedKeys, onSelectionChange, id, renderEmptyState = () => ((0, jsx_runtime_1.jsx)(stack_js_1.Stack, { gap: 0, justify: "center", UNSAFE_style: { height: 24 }, children: (0, jsx_runtime_1.jsx)(text_js_1.Text, { as: "p", variant: "medium", tone: "base", children: "No items selected." }) })), ...props }, ref) {
|
|
33
|
+
const { 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledBy, isRequired, isDisabled, isInvalid } = props;
|
|
34
|
+
(0, use_production_warning_js_1.useProductionWarning)(() => {
|
|
35
|
+
if (!label && !ariaLabel && !ariaLabelledBy) {
|
|
36
|
+
console.warn('TagField requires one of label / aria-label / aria-labelledby for accessibility');
|
|
37
|
+
}
|
|
38
|
+
}, [label, ariaLabel, ariaLabelledBy]);
|
|
39
|
+
if (!(0, is_production_js_1.isProduction)() && items != null && typeof children !== 'function') {
|
|
40
|
+
console.warn('`TagField` requires `children` to be a function when using `items` prop');
|
|
41
|
+
}
|
|
42
|
+
const messages = (0, localization_provider_js_1.useLocalizedMessages)('tagField');
|
|
43
|
+
// State
|
|
44
|
+
const [defaultSelectedKeys] = (0, react_1.useState)(() => defaultConsumerSelectedKeys ?? new Set());
|
|
45
|
+
const [selectedKeys, setSelectedKeys] = (0, utils_2.useControlledState)(consumerSelectedKeys, defaultSelectedKeys, onSelectionChange);
|
|
46
|
+
const [inputValue, setInputValue] = (0, utils_2.useControlledState)(consumerInputValue, defaultConsumerInputValue ?? '', onInputChange);
|
|
47
|
+
const selectedSet = (0, react_1.useMemo)(() => {
|
|
48
|
+
// eslint-disable-next-line unicorn/no-instanceof-builtins
|
|
49
|
+
if (selectedKeys instanceof Set) {
|
|
50
|
+
return new Set(selectedKeys.values());
|
|
51
|
+
}
|
|
52
|
+
return new Set(selectedKeys);
|
|
53
|
+
}, [selectedKeys]);
|
|
54
|
+
// Validation
|
|
55
|
+
const inputId = (0, utils_1.useId)(id);
|
|
56
|
+
const formInputRef = (0, react_1.useRef)(null);
|
|
57
|
+
const validationState = (0, form_2.useFormValidationState)({
|
|
58
|
+
name,
|
|
59
|
+
value: (0, react_1.useMemo)(() => ({ selectedKeys: selectedSet, inputValue }), [selectedSet, inputValue]),
|
|
60
|
+
isInvalid,
|
|
61
|
+
isRequired,
|
|
62
|
+
validate,
|
|
63
|
+
validationBehavior: 'native',
|
|
64
|
+
});
|
|
65
|
+
(0, utils_1.useFormReset)(formInputRef, [selectedSet, inputValue], ([a, b]) => {
|
|
66
|
+
setSelectedKeys(a);
|
|
67
|
+
setInputValue(b);
|
|
68
|
+
});
|
|
69
|
+
(0, form_1.useFormValidation)({
|
|
70
|
+
focus: () => {
|
|
71
|
+
// Querying by element ID because a ref is always null here, I don't know why :(
|
|
72
|
+
document.getElementById(inputId)?.focus();
|
|
73
|
+
},
|
|
74
|
+
isInvalid,
|
|
75
|
+
isRequired,
|
|
76
|
+
validate,
|
|
77
|
+
validationBehavior: 'native',
|
|
78
|
+
}, validationState, formInputRef);
|
|
79
|
+
// Event handlers
|
|
80
|
+
// Commit validation on input blur if the values have changed
|
|
81
|
+
const inputValueOnFocus = (0, react_1.useRef)(inputValue);
|
|
82
|
+
const selectedSetOnFocus = (0, react_1.useRef)(selectedSet);
|
|
83
|
+
const onFocusChange = (isFocused) => {
|
|
84
|
+
if (isFocused) {
|
|
85
|
+
inputValueOnFocus.current = inputValue;
|
|
86
|
+
selectedSetOnFocus.current = selectedSet;
|
|
87
|
+
}
|
|
88
|
+
else if (inputValue !== inputValueOnFocus.current || selectedSet !== selectedSetOnFocus.current) {
|
|
89
|
+
validationState.commitValidation();
|
|
90
|
+
}
|
|
91
|
+
};
|
|
92
|
+
const onItemSelectionChange = (key) => {
|
|
93
|
+
if (selectedSet.has(key)) {
|
|
94
|
+
selectedSet.delete(key);
|
|
95
|
+
}
|
|
96
|
+
else {
|
|
97
|
+
selectedSet.add(key);
|
|
98
|
+
}
|
|
99
|
+
setSelectedKeys(new Set(selectedSet.values()));
|
|
100
|
+
validationState.commitValidation();
|
|
101
|
+
};
|
|
102
|
+
// Text slots
|
|
103
|
+
const descriptionId = (0, utils_1.useSlotId)([Boolean(description)]);
|
|
104
|
+
const errorMessageId = (0, utils_1.useSlotId)([
|
|
105
|
+
Boolean(error || validationState.displayValidation.validationErrors),
|
|
106
|
+
validationState.displayValidation.isInvalid,
|
|
107
|
+
]);
|
|
108
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(react_aria_components_1.ComboBox, { ...props, ref: ref, id: inputId, className: (0, clsx_1.default)('cim-combo-box', 'cim-tag-field', UNSAFE_className), style: UNSAFE_style,
|
|
109
|
+
// Force no internal selection - we handle selection manually
|
|
110
|
+
selectedKey: null, inputValue: inputValue, onInputChange: setInputValue, menuTrigger: "focus", isReadOnly: isReadOnly, "data-readonly": isReadOnly ? true : undefined, onSelectionChange: (key) => {
|
|
111
|
+
if (key) {
|
|
112
|
+
onItemSelectionChange(key);
|
|
113
|
+
}
|
|
114
|
+
}, children: (0, jsx_runtime_1.jsxs)(react_aria_components_1.Provider, { values: [
|
|
115
|
+
[react_aria_components_1.TextContext, { slots: { description: { id: descriptionId }, errorMessage: { id: errorMessageId } } }],
|
|
116
|
+
[react_aria_components_1.GroupContext, { isInvalid: validationState.displayValidation.isInvalid, isDisabled }],
|
|
117
|
+
[react_aria_components_1.FieldErrorContext, validationState.displayValidation],
|
|
118
|
+
], children: [(0, jsx_runtime_1.jsx)(form_field_js_1.FormFieldLabel, { isRequired: isRequired, isDisabled: isDisabled, children: label }), (0, jsx_runtime_1.jsx)(tag_field_tags_js_1.TagFieldTags, { inputId: inputId, selectedKeys: selectedSet, isDisabled: isDisabled || isReadOnly, renderEmptyState: renderEmptyState, onRemove: onItemSelectionChange }), (0, jsx_runtime_1.jsxs)(react_aria_components_1.Group, { className: "cim-combo-box-input-group", children: [(0, jsx_runtime_1.jsx)(tag_field_input_js_1.TagFieldInput, { "aria-describedby": props['aria-describedby'], isReadOnly: isReadOnly, isRequired: isRequired, isInvalid: validationState.displayValidation.isInvalid, placeholder: selectedSet.size === 0 && placeholder
|
|
119
|
+
? placeholder
|
|
120
|
+
: messages.format('itemsSelected', { selectedItemCount: selectedSet.size }), onFocusChange: onFocusChange }), (0, jsx_runtime_1.jsx)(react_aria_components_1.Button, { className: "cim-combo-box-button", children: (0, jsx_runtime_1.jsx)(index_js_1.IconChevronDown, {}) })] }), (0, jsx_runtime_1.jsx)(form_field_js_1.FormFieldError, { children: error }), (0, jsx_runtime_1.jsx)(form_field_js_1.FormFieldDescription, { children: description }), (0, jsx_runtime_1.jsx)(collapsible_list_js_1.CollapsibleList, { offset: 5, maxHeight: 315, children: (0, jsx_runtime_1.jsx)(tag_field_list_box_js_1.TagFieldListBox, { items: items, selectedKeys: selectedSet, setSelectedKeys: setSelectedKeys, onScroll: onScroll, children: children }) })] }) }), (0, jsx_runtime_1.jsx)(react_aria_components_1.Input, { ref: formInputRef, style: { display: 'none' }, value: selectedSet.size || '', required: isRequired, "aria-invalid": validationState.displayValidation.isInvalid || undefined, onChange: () => { } }), name && [...selectedSet].map((value) => (0, jsx_runtime_1.jsx)("input", { type: "hidden", name: name, value: value }, value))] }));
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* Allows users to filter a collapsible list and select multiple items from it.
|
|
124
|
+
*
|
|
125
|
+
* See [tag field usage guidelines](https://ui.cimpress.com/components/tag-field)
|
|
126
|
+
*/
|
|
127
|
+
const _UNSTABLE_TagField = (0, with_style_props_js_1.withStyleProps)((0, forward_ref_js_1.forwardRef)(UNSTABLE_TagField), 'TagField');
|
|
128
|
+
exports.UNSTABLE_TagField = _UNSTABLE_TagField;
|
|
129
|
+
/** Renders a single list item within `TagField`. */
|
|
130
|
+
function UNSTABLE_TagFieldItem({ children, ...props }) {
|
|
131
|
+
const textValue = typeof children === 'string' ? children : typeof children === 'number' ? String(children) : children.join('');
|
|
132
|
+
return ((0, jsx_runtime_1.jsx)(react_aria_components_1.ListBoxItem, { ...props, className: "cim-combo-box-item cim-tag-field-item cim-checkbox", textValue: textValue, children: ({ isDisabled }) => ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("div", { className: "cim-checkbox-toggle-wrapper", "aria-hidden": true, children: (0, jsx_runtime_1.jsx)("div", { className: "cim-checkbox-toggle", children: (0, jsx_runtime_1.jsx)(index_js_1.IconCheckBold, {}) }) }), (0, jsx_runtime_1.jsx)(react_aria_components_1.Text, { slot: "label", className: (0, utils_js_1.textStyle)({ variant: 'body', tone: isDisabled ? 'muted' : 'base' }), children: children })] })) }));
|
|
133
|
+
}
|
|
134
|
+
UNSTABLE_TagFieldItem.displayName = 'TagFieldItem';
|
|
135
|
+
/** Groups list items within `TagField` into a section. */
|
|
136
|
+
function UNSTABLE_TagFieldSection({ title, children, items, ...props }) {
|
|
137
|
+
if (!(0, is_production_js_1.isProduction)() && items != null && typeof children !== 'function') {
|
|
138
|
+
console.warn('`TagFieldSection` requires `children` to be a function when using `items` prop');
|
|
139
|
+
}
|
|
140
|
+
return ((0, jsx_runtime_1.jsxs)(react_aria_components_1.ListBoxSection, { ...props, className: "cim-combo-box-section", children: [(0, jsx_runtime_1.jsx)(react_aria_components_1.Header, { className: (0, clsx_1.default)('cim-combo-box-section-header', (0, utils_js_1.textStyle)({ variant: 'small-semibold', tone: 'subtle' })), children: title }), (0, jsx_runtime_1.jsx)(react_aria_components_1.Collection, { items: items, children: children })] }));
|
|
141
|
+
}
|
|
142
|
+
UNSTABLE_TagFieldSection.displayName = 'TagFieldSection';
|
|
143
|
+
//# sourceMappingURL=tag-field.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tag-field.js","sourceRoot":"","sources":["../../../../src/components/tag-field/tag-field.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;;;;;;AA0Ub,sDAqBC;AAYD,4DAoBC;;AA7XD,2CAAqD;AACrD,6CAAmE;AACnE,8CAA6D;AAC7D,gDAA0D;AAC1D,gDAAwB;AACxB,iCAAqE;AACrE,iEAiB+B;AAC/B,yDAAkD;AAClD,kFAA2E;AAC3E,mDAAsE;AACtE,mEAA4D;AAC5D,qFAA6E;AAC7E,mEAA2D;AAC3D,0FAAmF;AACnF,wEAA4G;AAC5G,wDAAkD;AAUlD,mDAA6C;AAC7C,qDAAmD;AACnD,6DAAqD;AACrD,mEAA0D;AAC1D,2DAAmD;AAmCnD,SAAS,iBAAiB,CACxB,EACE,KAAK,EACL,WAAW,EACX,KAAK,EACL,KAAK,EACL,QAAQ,EACR,WAAW,EACX,gBAAgB,EAChB,YAAY,EACZ,UAAU,EACV,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AI,IAAI,OAAO,QAAQ,KAAK,UAAU,EAAE,CAAC;QACvE,OAAO,CAAC,IAAI,CAAC,gFAAgF,CAAC,CAAC;IACjG,CAAC;IAED,OAAO,CACL,wBAAC,sCAAiB,OAAK,KAAK,EAAE,SAAS,EAAC,uBAAuB,aAC7D,uBAAC,8BAAS,IACR,SAAS,EAAE,IAAA,cAAI,EAAC,8BAA8B,EAAE,IAAA,oBAAS,EAAC,EAAE,OAAO,EAAE,gBAAgB,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAC,YAExG,KAAK,GACI,EACZ,uBAAC,kCAAa,IAAC,KAAK,EAAE,KAAK,YAAG,QAAQ,GAAiB,IACrC,CACrB,CAAC;AACJ,CAAC;AAED,wBAAwB,CAAC,WAAW,GAAG,iBAAiB,CAAC","sourcesContent":["'use client';\n\nimport { useFormValidation } from '@react-aria/form';\nimport { useFormReset, useId, useSlotId } from '@react-aria/utils';\nimport { useFormValidationState } from '@react-stately/form';\nimport { useControlledState } from '@react-stately/utils';\nimport clsx from 'clsx';\nimport { useMemo, useRef, useState, type ForwardedRef } from 'react';\nimport {\n Button as RACButton,\n Collection as RACCollection,\n ComboBox as RACComboBox,\n Group as RACGroup,\n Header as RACHeader,\n Input as RACInput,\n type ListBoxProps as RACListBoxProps,\n ListBoxItem as RACListBoxItem,\n ListBoxSection as RACListBoxSection,\n Text as RACText,\n type ComboBoxProps as RACComboBoxProps,\n type ListBoxItemProps as RACListBoxItemProps,\n Provider as RACProvider,\n TextContext as RACTextContext,\n GroupContext as RACGroupContext,\n FieldErrorContext as RACFieldErrorContext,\n} from 'react-aria-components';\nimport { forwardRef } from '../../forward-ref.js';\nimport { useLocalizedMessages } from '../../i18n/localization-provider.js';\nimport { IconCheckBold, IconChevronDown } from '../../icons/index.js';\nimport { isProduction } from '../../utils/is-production.js';\nimport { useProductionWarning } from '../../utils/use-production-warning.js';\nimport { withStyleProps } from '../../with-style-props.js';\nimport { CollapsibleList } from '../internal/collapsible-list/collapsible-list.js';\nimport { FormFieldDescription, FormFieldError, FormFieldLabel } from '../internal/form-field/form-field.js';\nimport { Stack } from '../spacing/stack/stack.js';\nimport type { TagGroupProps } from '../tag/tag-group.js';\nimport type {\n CollectionItem,\n CollectionProps,\n CommonProps,\n FieldWithPlaceholderProps,\n Key,\n StringLikeChildren,\n} from '../types.js';\nimport { Text } from '../typography/text.js';\nimport { textStyle } from '../typography/utils.js';\nimport { TagFieldInput } from './tag-field-input.js';\nimport { TagFieldListBox } from './tag-field-list-box.js';\nimport { TagFieldTags } from './tag-field-tags.js';\n\n/** Represents the state of the `TagField` component for validation purposes. */\nexport interface UNSTABLE_TagFieldValidationValue {\n /** The selected keys in the TagField. */\n selectedKeys: Set<Key> | null;\n /** The value of the TagField input. */\n inputValue: string;\n}\n\nexport interface UNSTABLE_TagFieldProps<T extends CollectionItem = CollectionItem>\n extends CommonProps,\n FieldWithPlaceholderProps<UNSTABLE_TagFieldValidationValue>,\n CollectionProps<T>,\n Pick<\n RACComboBoxProps<T>,\n | 'isRequired'\n | 'isDisabled'\n | 'isInvalid'\n | 'isReadOnly'\n | 'inputValue'\n | 'defaultInputValue'\n | 'autoFocus'\n | 'onInputChange'\n | 'onFocus'\n | 'onBlur'\n | 'onOpenChange'\n >,\n Pick<RACListBoxProps<T>, 'onScroll'>,\n Pick<TagGroupProps<T>, 'renderEmptyState'> {\n selectedKeys?: Iterable<Key>;\n defaultSelectedKeys?: Iterable<Key>;\n onSelectionChange?: (keys: Set<Key>) => void;\n}\n\nfunction UNSTABLE_TagField<T extends CollectionItem>(\n {\n label,\n description,\n error,\n items,\n children,\n placeholder,\n UNSAFE_className,\n UNSAFE_style,\n isReadOnly,\n inputValue: consumerInputValue,\n defaultInputValue: defaultConsumerInputValue,\n onInputChange,\n name,\n validate,\n onScroll,\n selectedKeys: consumerSelectedKeys,\n defaultSelectedKeys: defaultConsumerSelectedKeys,\n onSelectionChange,\n id,\n renderEmptyState = () => (\n <Stack gap={0} justify=\"center\" UNSAFE_style={{ height: 24 }}>\n <Text as=\"p\" variant=\"medium\" tone=\"base\">\n No items selected.\n </Text>\n </Stack>\n ),\n ...props\n }: UNSTABLE_TagFieldProps<T>,\n ref: ForwardedRef<HTMLDivElement>,\n) {\n const { 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledBy, isRequired, isDisabled, isInvalid } = props;\n\n useProductionWarning(() => {\n if (!label && !ariaLabel && !ariaLabelledBy) {\n console.warn('TagField requires one of label / aria-label / aria-labelledby for accessibility');\n }\n }, [label, ariaLabel, ariaLabelledBy]);\n\n if (!isProduction() && items != null && typeof children !== 'function') {\n console.warn('`TagField` requires `children` to be a function when using `items` prop');\n }\n\n const messages = useLocalizedMessages('tagField');\n\n // State\n\n const [defaultSelectedKeys] = useState(() => defaultConsumerSelectedKeys ?? new Set<Key>());\n const [selectedKeys, setSelectedKeys] = useControlledState(\n consumerSelectedKeys,\n defaultSelectedKeys,\n onSelectionChange,\n );\n const [inputValue, setInputValue] = useControlledState(\n consumerInputValue,\n defaultConsumerInputValue ?? '',\n onInputChange,\n );\n\n const selectedSet = useMemo(() => {\n // eslint-disable-next-line unicorn/no-instanceof-builtins\n if (selectedKeys instanceof Set) {\n return new Set<Key>(selectedKeys.values());\n }\n\n return new Set<Key>(selectedKeys);\n }, [selectedKeys]);\n\n // Validation\n\n const inputId = useId(id);\n const formInputRef = useRef<HTMLInputElement>(null);\n\n const validationState = useFormValidationState({\n name,\n value: useMemo(() => ({ selectedKeys: selectedSet, inputValue }), [selectedSet, inputValue]),\n isInvalid,\n isRequired,\n validate,\n validationBehavior: 'native',\n });\n\n useFormReset<[Set<Key>, string]>(formInputRef, [selectedSet, inputValue], ([a, b]) => {\n setSelectedKeys(a);\n setInputValue(b);\n });\n\n useFormValidation(\n {\n focus: () => {\n // Querying by element ID because a ref is always null here, I don't know why :(\n document.getElementById(inputId)?.focus();\n },\n isInvalid,\n isRequired,\n validate,\n validationBehavior: 'native',\n },\n validationState,\n formInputRef,\n );\n\n // Event handlers\n\n // Commit validation on input blur if the values have changed\n const inputValueOnFocus = useRef(inputValue);\n const selectedSetOnFocus = useRef(selectedSet);\n\n const onFocusChange = (isFocused: boolean) => {\n if (isFocused) {\n inputValueOnFocus.current = inputValue;\n selectedSetOnFocus.current = selectedSet;\n } else if (inputValue !== inputValueOnFocus.current || selectedSet !== selectedSetOnFocus.current) {\n validationState.commitValidation();\n }\n };\n\n const onItemSelectionChange = (key: Key) => {\n if (selectedSet.has(key)) {\n selectedSet.delete(key);\n } else {\n selectedSet.add(key);\n }\n\n setSelectedKeys(new Set(selectedSet.values()));\n validationState.commitValidation();\n };\n\n // Text slots\n\n const descriptionId = useSlotId([Boolean(description)]);\n\n const errorMessageId = useSlotId([\n Boolean(error || validationState.displayValidation.validationErrors),\n validationState.displayValidation.isInvalid,\n ]);\n\n return (\n <>\n <RACComboBox\n {...props}\n ref={ref}\n id={inputId}\n className={clsx('cim-combo-box', 'cim-tag-field', UNSAFE_className)}\n style={UNSAFE_style}\n // Force no internal selection - we handle selection manually\n selectedKey={null}\n inputValue={inputValue}\n onInputChange={setInputValue}\n menuTrigger=\"focus\"\n isReadOnly={isReadOnly}\n data-readonly={isReadOnly ? true : undefined}\n onSelectionChange={(key) => {\n if (key) {\n onItemSelectionChange(key);\n }\n }}\n >\n <RACProvider\n values={[\n [RACTextContext, { slots: { description: { id: descriptionId }, errorMessage: { id: errorMessageId } } }],\n [RACGroupContext, { isInvalid: validationState.displayValidation.isInvalid, isDisabled }],\n [RACFieldErrorContext, validationState.displayValidation],\n ]}\n >\n <FormFieldLabel isRequired={isRequired} isDisabled={isDisabled}>\n {label}\n </FormFieldLabel>\n\n <TagFieldTags<T>\n inputId={inputId}\n selectedKeys={selectedSet}\n isDisabled={isDisabled || isReadOnly}\n renderEmptyState={renderEmptyState}\n onRemove={onItemSelectionChange}\n />\n\n <RACGroup className=\"cim-combo-box-input-group\">\n <TagFieldInput\n aria-describedby={props['aria-describedby']}\n isReadOnly={isReadOnly}\n isRequired={isRequired}\n isInvalid={validationState.displayValidation.isInvalid}\n placeholder={\n selectedSet.size === 0 && placeholder\n ? placeholder\n : messages.format('itemsSelected', { selectedItemCount: selectedSet.size })\n }\n onFocusChange={onFocusChange}\n />\n <RACButton className=\"cim-combo-box-button\">\n <IconChevronDown />\n </RACButton>\n </RACGroup>\n\n <FormFieldError>{error}</FormFieldError>\n <FormFieldDescription>{description}</FormFieldDescription>\n\n <CollapsibleList\n offset={5} // 1px border + 4px actual offset\n maxHeight={315}\n >\n <TagFieldListBox<T>\n items={items}\n selectedKeys={selectedSet}\n setSelectedKeys={setSelectedKeys}\n onScroll={onScroll}\n >\n {children}\n </TagFieldListBox>\n </CollapsibleList>\n </RACProvider>\n </RACComboBox>\n\n {/* This input is used for native form validation. We can't use the combo box input because its value has no relation to the selected values. */}\n <RACInput\n ref={formInputRef}\n style={{ display: 'none' }}\n value={selectedSet.size || ''}\n required={isRequired}\n aria-invalid={validationState.displayValidation.isInvalid || undefined}\n onChange={() => {}}\n />\n\n {/* These hidden inputs provide values when a form is submitted. */}\n {name && [...selectedSet].map((value) => <input type=\"hidden\" key={value} name={name} value={value} />)}\n </>\n );\n}\n\n/**\n * Allows users to filter a collapsible list and select multiple items from it.\n *\n * See [tag field usage guidelines](https://ui.cimpress.com/components/tag-field)\n */\nconst _UNSTABLE_TagField = withStyleProps(forwardRef(UNSTABLE_TagField), 'TagField');\n\nexport { _UNSTABLE_TagField as UNSTABLE_TagField };\n\nexport interface UNSTABLE_TagFieldItemProps<T extends CollectionItem>\n extends Pick<RACListBoxItemProps<T>, 'id' | 'isDisabled' | 'onHoverStart' | 'onHoverEnd'> {\n /** The content to display as the label. */\n children: StringLikeChildren;\n}\n\n/** Renders a single list item within `TagField`. */\nexport function UNSTABLE_TagFieldItem<T extends CollectionItem>({ children, ...props }: UNSTABLE_TagFieldItemProps<T>) {\n const textValue =\n typeof children === 'string' ? children : typeof children === 'number' ? String(children) : children.join('');\n\n return (\n <RACListBoxItem {...props} className=\"cim-combo-box-item cim-tag-field-item cim-checkbox\" textValue={textValue}>\n {({ isDisabled }) => (\n <>\n <div className=\"cim-checkbox-toggle-wrapper\" aria-hidden>\n <div className=\"cim-checkbox-toggle\">\n <IconCheckBold />\n </div>\n </div>\n\n <RACText slot=\"label\" className={textStyle({ variant: 'body', tone: isDisabled ? 'muted' : 'base' })}>\n {children}\n </RACText>\n </>\n )}\n </RACListBoxItem>\n );\n}\n\nUNSTABLE_TagFieldItem.displayName = 'TagFieldItem';\n\nexport interface UNSTABLE_TagFieldSectionProps<T extends CollectionItem> extends CollectionProps<T> {\n /** The ID of the section. Has to be unique across all sections and items. */\n id?: Key;\n /** The content to display as the section title. */\n title: string;\n}\n\n/** Groups list items within `TagField` into a section. */\nexport function UNSTABLE_TagFieldSection<T extends CollectionItem>({\n title,\n children,\n items,\n ...props\n}: UNSTABLE_TagFieldSectionProps<T>) {\n if (!isProduction() && items != null && typeof children !== 'function') {\n console.warn('`TagFieldSection` requires `children` to be a function when using `items` prop');\n }\n\n return (\n <RACListBoxSection {...props} className=\"cim-combo-box-section\">\n <RACHeader\n className={clsx('cim-combo-box-section-header', textStyle({ variant: 'small-semibold', tone: 'subtle' }))}\n >\n {title}\n </RACHeader>\n <RACCollection items={items}>{children}</RACCollection>\n </RACListBoxSection>\n );\n}\n\nUNSTABLE_TagFieldSection.displayName = 'TagFieldSection';\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type TextAreaProps as RACTextAreaProps, type TextFieldProps as RACTextFieldProps } from 'react-aria-components';
|
|
2
2
|
import type { CommonProps, FieldWithPlaceholderProps } from '../types.js';
|
|
3
|
-
export interface TextAreaProps extends CommonProps, FieldWithPlaceholderProps<string>, Pick<RACTextFieldProps, 'value' | 'defaultValue' | 'onChange' | 'isDisabled' | 'isRequired' | 'isInvalid' | 'isReadOnly' | '
|
|
3
|
+
export interface TextAreaProps extends CommonProps, FieldWithPlaceholderProps<string>, Pick<RACTextFieldProps, 'value' | 'defaultValue' | 'onChange' | 'isDisabled' | 'isRequired' | 'isInvalid' | 'isReadOnly' | 'type' | 'autoFocus' | 'autoComplete' | 'inputMode' | 'minLength' | 'maxLength' | 'onFocus' | 'onBlur'>, Pick<RACTextAreaProps, 'autoCapitalize' | 'autoCorrect' | 'rows' | 'spellCheck' | 'wrap'> {
|
|
4
4
|
}
|
|
5
5
|
/**
|
|
6
6
|
* Allows users to enter multiple lines of text with a keyboard.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"text-area.d.ts","sourceRoot":"","sources":["../../../../src/components/text-inputs/text-area.tsx"],"names":[],"mappings":"AAIA,OAAO,EAGL,KAAK,aAAa,IAAI,gBAAgB,EACtC,KAAK,cAAc,IAAI,iBAAiB,EAEzC,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"text-area.d.ts","sourceRoot":"","sources":["../../../../src/components/text-inputs/text-area.tsx"],"names":[],"mappings":"AAIA,OAAO,EAGL,KAAK,aAAa,IAAI,gBAAgB,EACtC,KAAK,cAAc,IAAI,iBAAiB,EAEzC,MAAM,uBAAuB,CAAC;AAK/B,OAAO,KAAK,EAAE,WAAW,EAAE,yBAAyB,EAAE,MAAM,aAAa,CAAC;AAG1E,MAAM,WAAW,aACf,SAAQ,WAAW,EACjB,yBAAyB,CAAC,MAAM,CAAC,EACjC,IAAI,CACF,iBAAiB,EACf,OAAO,GACP,cAAc,GACd,UAAU,GACV,YAAY,GACZ,YAAY,GACZ,WAAW,GACX,YAAY,GACZ,MAAM,GACN,WAAW,GACX,cAAc,GACd,WAAW,GACX,WAAW,GACX,WAAW,GACX,SAAS,GACT,QAAQ,CACX,EACD,IAAI,CAAC,gBAAgB,EAAE,gBAAgB,GAAG,aAAa,GAAG,MAAM,GAAG,YAAY,GAAG,MAAM,CAAC;CAAG;AAsDhG;;;;GAIG;AACH,QAAA,MAAM,SAAS,+JAAmD,CAAC;AAEnE,OAAO,EAAE,SAAS,IAAI,QAAQ,EAAE,CAAC"}
|
|
@@ -7,15 +7,15 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
7
7
|
exports.TextArea = void 0;
|
|
8
8
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
9
9
|
const clsx_1 = __importDefault(require("clsx"));
|
|
10
|
-
const react_1 = require("react");
|
|
11
10
|
const react_aria_components_1 = require("react-aria-components");
|
|
12
11
|
const forward_ref_js_1 = require("../../forward-ref.js");
|
|
12
|
+
const use_production_warning_js_1 = require("../../utils/use-production-warning.js");
|
|
13
13
|
const with_style_props_js_1 = require("../../with-style-props.js");
|
|
14
14
|
const form_field_js_1 = require("../internal/form-field/form-field.js");
|
|
15
15
|
const utils_js_1 = require("../typography/utils.js");
|
|
16
16
|
function TextArea({ label, description, error: errorMessage, placeholder, autoCapitalize, autoCorrect, rows, spellCheck, wrap, UNSAFE_className, UNSAFE_style, ...props }, ref) {
|
|
17
17
|
const { 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledBy } = props;
|
|
18
|
-
(0,
|
|
18
|
+
(0, use_production_warning_js_1.useProductionWarning)(() => {
|
|
19
19
|
if (!label && !ariaLabel && !ariaLabelledBy) {
|
|
20
20
|
console.warn('TextArea requires one of label / aria-label / aria-labelledby for accessibility');
|
|
21
21
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"text-area.js","sourceRoot":"","sources":["../../../../src/components/text-inputs/text-area.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;;;;;;;AAEb,gDAAwB;
|
|
1
|
+
{"version":3,"file":"text-area.js","sourceRoot":"","sources":["../../../../src/components/text-inputs/text-area.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;;;;;;;AAEb,gDAAwB;AAExB,iEAM+B;AAC/B,yDAAkD;AAClD,qFAA6E;AAC7E,mEAA2D;AAC3D,wEAA4G;AAE5G,qDAAmD;AAyBnD,SAAS,QAAQ,CACf,EACE,KAAK,EACL,WAAW,EACX,KAAK,EAAE,YAAY,EACnB,WAAW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,GAAwB,IACzD,CACJ,GACY,CAChB,CAAC;AACJ,CAAC;AAED;;;;GAIG;AACH,MAAM,SAAS,GAAG,IAAA,oCAAc,EAAC,IAAA,2BAAU,EAAC,QAAQ,CAAC,EAAE,UAAU,CAAC,CAAC;AAE7C,6BAAQ","sourcesContent":["'use client';\n\nimport clsx from 'clsx';\nimport type { ForwardedRef } from 'react';\nimport {\n TextArea as RACTextArea,\n TextField as RACTextField,\n type TextAreaProps as RACTextAreaProps,\n type TextFieldProps as RACTextFieldProps,\n Group as RACGroup,\n} from 'react-aria-components';\nimport { forwardRef } from '../../forward-ref.js';\nimport { useProductionWarning } from '../../utils/use-production-warning.js';\nimport { withStyleProps } from '../../with-style-props.js';\nimport { FormFieldDescription, FormFieldError, FormFieldLabel } from '../internal/form-field/form-field.js';\nimport type { CommonProps, FieldWithPlaceholderProps } from '../types.js';\nimport { textStyle } from '../typography/utils.js';\n\nexport interface TextAreaProps\n extends CommonProps,\n FieldWithPlaceholderProps<string>,\n Pick<\n RACTextFieldProps,\n | 'value'\n | 'defaultValue'\n | 'onChange'\n | 'isDisabled'\n | 'isRequired'\n | 'isInvalid'\n | 'isReadOnly'\n | 'type'\n | 'autoFocus'\n | 'autoComplete'\n | 'inputMode'\n | 'minLength'\n | 'maxLength'\n | 'onFocus'\n | 'onBlur'\n >,\n Pick<RACTextAreaProps, 'autoCapitalize' | 'autoCorrect' | 'rows' | 'spellCheck' | 'wrap'> {}\n\nfunction TextArea(\n {\n label,\n description,\n error: errorMessage,\n placeholder,\n autoCapitalize,\n autoCorrect,\n rows,\n spellCheck,\n wrap,\n UNSAFE_className,\n UNSAFE_style,\n ...props\n }: TextAreaProps,\n ref: ForwardedRef<HTMLDivElement>,\n) {\n const { 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledBy } = props;\n\n useProductionWarning(() => {\n if (!label && !ariaLabel && !ariaLabelledBy) {\n console.warn('TextArea requires one of label / aria-label / aria-labelledby for accessibility');\n }\n }, [label, ariaLabel, ariaLabelledBy]);\n\n return (\n <RACTextField {...props} ref={ref} className={clsx('cim-text-area', UNSAFE_className)} style={UNSAFE_style}>\n {/* RAC doesn't pass `isDisabled` or `isInvalid` to `Group` through context as it does with `NumberField`, so we need to pass them manually */}\n {({ isDisabled, isInvalid, isRequired }) => (\n <>\n <FormFieldLabel isRequired={isRequired} isDisabled={isDisabled}>\n {label}\n </FormFieldLabel>\n <RACGroup className=\"cim-text-area-input-group\" isDisabled={isDisabled} isInvalid={isInvalid}>\n <RACTextArea\n className={clsx('cim-text-area-input', textStyle({ variant: 'medium' }))}\n placeholder={placeholder}\n autoCapitalize={autoCapitalize}\n autoCorrect={autoCorrect}\n rows={rows}\n spellCheck={spellCheck}\n wrap={wrap}\n />\n </RACGroup>\n <FormFieldError>{errorMessage}</FormFieldError>\n <FormFieldDescription>{description}</FormFieldDescription>\n </>\n )}\n </RACTextField>\n );\n}\n\n/**\n * Allows users to enter multiple lines of text with a keyboard.\n *\n * See [text area usage guidelines](https://ui.cimpress.io/components/text-area/).\n */\nconst _TextArea = withStyleProps(forwardRef(TextArea), 'TextArea');\n\nexport { _TextArea as TextArea };\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type TextFieldProps as RACTextFieldProps } from 'react-aria-components';
|
|
2
2
|
import type { CommonProps, FieldWithPlaceholderProps } from '../types.js';
|
|
3
|
-
export interface TextFieldProps extends CommonProps, FieldWithPlaceholderProps<string>, Pick<RACTextFieldProps, 'value' | 'defaultValue' | 'onChange' | 'isDisabled' | 'isRequired' | 'isInvalid' | 'isReadOnly' | '
|
|
3
|
+
export interface TextFieldProps extends CommonProps, FieldWithPlaceholderProps<string>, Pick<RACTextFieldProps, 'value' | 'defaultValue' | 'onChange' | 'isDisabled' | 'isRequired' | 'isInvalid' | 'isReadOnly' | 'type' | 'autoFocus' | 'autoComplete' | 'inputMode' | 'minLength' | 'maxLength' | 'pattern' | 'onFocus' | 'onBlur'> {
|
|
4
4
|
}
|
|
5
5
|
/**
|
|
6
6
|
* Allows users to enter a single line of text with a keyboard.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"text-field.d.ts","sourceRoot":"","sources":["../../../../src/components/text-inputs/text-field.tsx"],"names":[],"mappings":"AAIA,OAAO,EAGL,KAAK,cAAc,IAAI,iBAAiB,EAEzC,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"text-field.d.ts","sourceRoot":"","sources":["../../../../src/components/text-inputs/text-field.tsx"],"names":[],"mappings":"AAIA,OAAO,EAGL,KAAK,cAAc,IAAI,iBAAiB,EAEzC,MAAM,uBAAuB,CAAC;AAK/B,OAAO,KAAK,EAAE,WAAW,EAAE,yBAAyB,EAAE,MAAM,aAAa,CAAC;AAG1E,MAAM,WAAW,cACf,SAAQ,WAAW,EACjB,yBAAyB,CAAC,MAAM,CAAC,EACjC,IAAI,CACF,iBAAiB,EACf,OAAO,GACP,cAAc,GACd,UAAU,GACV,YAAY,GACZ,YAAY,GACZ,WAAW,GACX,YAAY,GACZ,MAAM,GACN,WAAW,GACX,cAAc,GACd,WAAW,GACX,WAAW,GACX,WAAW,GACX,SAAS,GACT,SAAS,GACT,QAAQ,CACX;CAAG;AAoCR;;;;GAIG;AACH,QAAA,MAAM,UAAU,gKAAqD,CAAC;AAEtE,OAAO,EAAE,UAAU,IAAI,SAAS,EAAE,CAAC"}
|
|
@@ -7,15 +7,15 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
7
7
|
exports.TextField = void 0;
|
|
8
8
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
9
9
|
const clsx_1 = __importDefault(require("clsx"));
|
|
10
|
-
const react_1 = require("react");
|
|
11
10
|
const react_aria_components_1 = require("react-aria-components");
|
|
12
11
|
const forward_ref_js_1 = require("../../forward-ref.js");
|
|
12
|
+
const use_production_warning_js_1 = require("../../utils/use-production-warning.js");
|
|
13
13
|
const with_style_props_js_1 = require("../../with-style-props.js");
|
|
14
14
|
const form_field_js_1 = require("../internal/form-field/form-field.js");
|
|
15
15
|
const utils_js_1 = require("../typography/utils.js");
|
|
16
16
|
function TextField({ label, description, error: errorMessage, placeholder, UNSAFE_className, UNSAFE_style, ...props }, ref) {
|
|
17
17
|
const { 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledBy } = props;
|
|
18
|
-
(0,
|
|
18
|
+
(0, use_production_warning_js_1.useProductionWarning)(() => {
|
|
19
19
|
if (!label && !ariaLabel && !ariaLabelledBy) {
|
|
20
20
|
console.warn('TextField requires one of label / aria-label / aria-labelledby for accessibility');
|
|
21
21
|
}
|