@cimpress-ui/react 1.20.0 → 1.22.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/app-header/side-nav.js +1 -1
- package/dist/commonjs/components/app-header/side-nav.js.map +1 -1
- package/dist/commonjs/components/breadcrumbs/breadcrumbs.d.ts.map +1 -1
- package/dist/commonjs/components/breadcrumbs/breadcrumbs.js +3 -2
- package/dist/commonjs/components/breadcrumbs/breadcrumbs.js.map +1 -1
- package/dist/commonjs/components/combo-box/combo-box.d.ts +7 -1
- package/dist/commonjs/components/combo-box/combo-box.d.ts.map +1 -1
- package/dist/commonjs/components/combo-box/combo-box.js +6 -2
- package/dist/commonjs/components/combo-box/combo-box.js.map +1 -1
- package/dist/commonjs/components/date-picker/views/view-grid-cell.js +5 -5
- package/dist/commonjs/components/date-picker/views/view-grid-cell.js.map +1 -1
- package/dist/commonjs/components/file-picker/file-picker.d.ts.map +1 -1
- package/dist/commonjs/components/file-picker/file-picker.js +4 -3
- package/dist/commonjs/components/file-picker/file-picker.js.map +1 -1
- package/dist/commonjs/components/internal/focusable-container/focusable-container.js +4 -4
- package/dist/commonjs/components/internal/focusable-container/focusable-container.js.map +1 -1
- package/dist/commonjs/components/link-tabs/link-tabs.d.ts.map +1 -1
- package/dist/commonjs/components/link-tabs/link-tabs.js +4 -4
- package/dist/commonjs/components/link-tabs/link-tabs.js.map +1 -1
- package/dist/commonjs/components/progress-bar/progress-bar.js +2 -2
- package/dist/commonjs/components/progress-bar/progress-bar.js.map +1 -1
- package/dist/commonjs/components/slider/slider.js +2 -2
- package/dist/commonjs/components/slider/slider.js.map +1 -1
- package/dist/commonjs/components/table/contexts/table-state.d.ts.map +1 -1
- package/dist/commonjs/components/table/contexts/table-state.js +2 -1
- package/dist/commonjs/components/table/contexts/table-state.js.map +1 -1
- package/dist/commonjs/components/table/hooks/use-table-cell.d.ts.map +1 -1
- package/dist/commonjs/components/table/hooks/use-table-cell.js +3 -2
- package/dist/commonjs/components/table/hooks/use-table-cell.js.map +1 -1
- package/dist/commonjs/components/table/hooks/use-table.d.ts.map +1 -1
- package/dist/commonjs/components/table/hooks/use-table.js +4 -3
- package/dist/commonjs/components/table/hooks/use-table.js.map +1 -1
- package/dist/commonjs/components/table/table-body-cell.d.ts.map +1 -1
- package/dist/commonjs/components/table/table-body-cell.js +3 -3
- package/dist/commonjs/components/table/table-body-cell.js.map +1 -1
- package/dist/commonjs/components/table/table-body-row.d.ts.map +1 -1
- package/dist/commonjs/components/table/table-body-row.js +2 -3
- package/dist/commonjs/components/table/table-body-row.js.map +1 -1
- package/dist/commonjs/components/table/table-empty-state.d.ts.map +1 -1
- package/dist/commonjs/components/table/table-empty-state.js +4 -4
- package/dist/commonjs/components/table/table-empty-state.js.map +1 -1
- package/dist/commonjs/components/table/table-header-cell.d.ts.map +1 -1
- package/dist/commonjs/components/table/table-header-cell.js +4 -4
- package/dist/commonjs/components/table/table-header-cell.js.map +1 -1
- package/dist/commonjs/components/table/table-header-row.d.ts.map +1 -1
- package/dist/commonjs/components/table/table-header-row.js +2 -2
- package/dist/commonjs/components/table/table-header-row.js.map +1 -1
- package/dist/commonjs/components/table/table.d.ts.map +1 -1
- package/dist/commonjs/components/table/table.js +3 -3
- package/dist/commonjs/components/table/table.js.map +1 -1
- package/dist/commonjs/components/tag-field/tag-field-input.js +8 -15
- package/dist/commonjs/components/tag-field/tag-field-input.js.map +1 -1
- package/dist/commonjs/components/tag-field/tag-field-list-box.js +2 -36
- package/dist/commonjs/components/tag-field/tag-field-list-box.js.map +1 -1
- package/dist/commonjs/components/tag-field/tag-field.d.ts +1 -1
- package/dist/commonjs/components/tag-field/tag-field.d.ts.map +1 -1
- package/dist/commonjs/components/tag-field/tag-field.js +17 -92
- package/dist/commonjs/components/tag-field/tag-field.js.map +1 -1
- package/dist/commonjs/components/text-inputs/text-field.js +4 -4
- package/dist/commonjs/components/text-inputs/text-field.js.map +1 -1
- package/dist/commonjs/components/toggle-button/internal-toggle-button.d.ts.map +1 -1
- package/dist/commonjs/components/toggle-button/internal-toggle-button.js +2 -1
- package/dist/commonjs/components/toggle-button/internal-toggle-button.js.map +1 -1
- package/dist/commonjs/components/typography/link.d.ts +1 -1
- package/dist/commonjs/components/typography/link.d.ts.map +1 -1
- package/dist/commonjs/components/typography/link.js.map +1 -1
- package/dist/commonjs/icons/{unstable-expand.d.ts → bookmark-fill.d.ts} +3 -3
- package/dist/commonjs/icons/bookmark-fill.d.ts.map +1 -0
- package/dist/commonjs/icons/{unstable-expand.js → bookmark-fill.js} +6 -6
- package/dist/commonjs/icons/bookmark-fill.js.map +1 -0
- package/dist/{esm/icons/unstable-expand.d.ts → commonjs/icons/bookmark.d.ts} +3 -3
- package/dist/commonjs/icons/bookmark.d.ts.map +1 -0
- package/dist/commonjs/icons/bookmark.js +24 -0
- package/dist/commonjs/icons/bookmark.js.map +1 -0
- package/dist/commonjs/icons/carousel.d.ts +8 -0
- package/dist/commonjs/icons/carousel.d.ts.map +1 -0
- package/dist/commonjs/icons/carousel.js +24 -0
- package/dist/commonjs/icons/carousel.js.map +1 -0
- package/dist/commonjs/icons/cloud-links.d.ts +8 -0
- package/dist/commonjs/icons/cloud-links.d.ts.map +1 -0
- package/dist/commonjs/icons/cloud-links.js +24 -0
- package/dist/commonjs/icons/cloud-links.js.map +1 -0
- package/dist/commonjs/icons/columns.d.ts +8 -0
- package/dist/commonjs/icons/columns.d.ts.map +1 -0
- package/dist/commonjs/icons/columns.js +24 -0
- package/dist/commonjs/icons/columns.js.map +1 -0
- package/dist/commonjs/icons/crop.d.ts +8 -0
- package/dist/commonjs/icons/crop.d.ts.map +1 -0
- package/dist/commonjs/icons/crop.js +24 -0
- package/dist/commonjs/icons/crop.js.map +1 -0
- package/dist/commonjs/icons/expand.d.ts +8 -0
- package/dist/commonjs/icons/expand.d.ts.map +1 -0
- package/dist/commonjs/icons/expand.js +24 -0
- package/dist/commonjs/icons/expand.js.map +1 -0
- package/dist/commonjs/icons/fill.d.ts +8 -0
- package/dist/commonjs/icons/fill.d.ts.map +1 -0
- package/dist/commonjs/icons/fill.js +24 -0
- package/dist/commonjs/icons/fill.js.map +1 -0
- package/dist/commonjs/icons/fit.d.ts +8 -0
- package/dist/commonjs/icons/fit.d.ts.map +1 -0
- package/dist/commonjs/icons/fit.js +24 -0
- package/dist/commonjs/icons/fit.js.map +1 -0
- package/dist/commonjs/icons/flow.d.ts +8 -0
- package/dist/commonjs/icons/flow.d.ts.map +1 -0
- package/dist/commonjs/icons/flow.js +24 -0
- package/dist/commonjs/icons/flow.js.map +1 -0
- package/dist/commonjs/icons/folder-database.d.ts +8 -0
- package/dist/commonjs/icons/folder-database.d.ts.map +1 -0
- package/dist/commonjs/icons/folder-database.js +24 -0
- package/dist/commonjs/icons/folder-database.js.map +1 -0
- package/dist/commonjs/icons/grid.d.ts +8 -0
- package/dist/commonjs/icons/grid.d.ts.map +1 -0
- package/dist/commonjs/icons/grid.js +24 -0
- package/dist/commonjs/icons/grid.js.map +1 -0
- package/dist/commonjs/icons/index.d.ts +19 -1
- package/dist/commonjs/icons/index.d.ts.map +1 -1
- package/dist/commonjs/icons/index.js +43 -7
- package/dist/commonjs/icons/index.js.map +1 -1
- package/dist/commonjs/icons/placement.d.ts +8 -0
- package/dist/commonjs/icons/placement.d.ts.map +1 -0
- package/dist/commonjs/icons/placement.js +24 -0
- package/dist/commonjs/icons/placement.js.map +1 -0
- package/dist/commonjs/icons/query.d.ts +8 -0
- package/dist/commonjs/icons/query.d.ts.map +1 -0
- package/dist/commonjs/icons/query.js +24 -0
- package/dist/commonjs/icons/query.js.map +1 -0
- package/dist/commonjs/icons/rows.d.ts +8 -0
- package/dist/commonjs/icons/rows.d.ts.map +1 -0
- package/dist/commonjs/icons/rows.js +24 -0
- package/dist/commonjs/icons/rows.js.map +1 -0
- package/dist/commonjs/icons/rules.d.ts +8 -0
- package/dist/commonjs/icons/rules.d.ts.map +1 -0
- package/dist/commonjs/icons/rules.js +24 -0
- package/dist/commonjs/icons/rules.js.map +1 -0
- package/dist/commonjs/icons/table.d.ts +8 -0
- package/dist/commonjs/icons/table.d.ts.map +1 -0
- package/dist/commonjs/icons/table.js +24 -0
- package/dist/commonjs/icons/table.js.map +1 -0
- package/dist/commonjs/icons/tags.d.ts +8 -0
- package/dist/commonjs/icons/tags.d.ts.map +1 -0
- package/dist/commonjs/icons/tags.js +24 -0
- package/dist/commonjs/icons/tags.js.map +1 -0
- package/dist/commonjs/icons/variants.d.ts +8 -0
- package/dist/commonjs/icons/variants.d.ts.map +1 -0
- package/dist/commonjs/icons/variants.js +24 -0
- package/dist/commonjs/icons/variants.js.map +1 -0
- package/dist/esm/components/app-header/side-nav.js +2 -2
- package/dist/esm/components/app-header/side-nav.js.map +1 -1
- package/dist/esm/components/breadcrumbs/breadcrumbs.d.ts.map +1 -1
- package/dist/esm/components/breadcrumbs/breadcrumbs.js +2 -1
- package/dist/esm/components/breadcrumbs/breadcrumbs.js.map +1 -1
- package/dist/esm/components/combo-box/combo-box.d.ts +7 -1
- package/dist/esm/components/combo-box/combo-box.d.ts.map +1 -1
- package/dist/esm/components/combo-box/combo-box.js +6 -2
- package/dist/esm/components/combo-box/combo-box.js.map +1 -1
- package/dist/esm/components/date-picker/views/view-grid-cell.js +3 -3
- package/dist/esm/components/date-picker/views/view-grid-cell.js.map +1 -1
- package/dist/esm/components/file-picker/file-picker.d.ts.map +1 -1
- package/dist/esm/components/file-picker/file-picker.js +2 -1
- package/dist/esm/components/file-picker/file-picker.js.map +1 -1
- package/dist/esm/components/internal/focusable-container/focusable-container.js +2 -2
- package/dist/esm/components/internal/focusable-container/focusable-container.js.map +1 -1
- package/dist/esm/components/link-tabs/link-tabs.d.ts.map +1 -1
- package/dist/esm/components/link-tabs/link-tabs.js +1 -1
- package/dist/esm/components/link-tabs/link-tabs.js.map +1 -1
- package/dist/esm/components/progress-bar/progress-bar.js +1 -1
- package/dist/esm/components/progress-bar/progress-bar.js.map +1 -1
- package/dist/esm/components/slider/slider.js +1 -1
- package/dist/esm/components/slider/slider.js.map +1 -1
- package/dist/esm/components/table/contexts/table-state.d.ts.map +1 -1
- package/dist/esm/components/table/contexts/table-state.js +2 -1
- package/dist/esm/components/table/contexts/table-state.js.map +1 -1
- package/dist/esm/components/table/hooks/use-table-cell.d.ts.map +1 -1
- package/dist/esm/components/table/hooks/use-table-cell.js +3 -2
- package/dist/esm/components/table/hooks/use-table-cell.js.map +1 -1
- package/dist/esm/components/table/hooks/use-table.d.ts.map +1 -1
- package/dist/esm/components/table/hooks/use-table.js +4 -3
- package/dist/esm/components/table/hooks/use-table.js.map +1 -1
- package/dist/esm/components/table/table-body-cell.d.ts.map +1 -1
- package/dist/esm/components/table/table-body-cell.js +1 -1
- package/dist/esm/components/table/table-body-cell.js.map +1 -1
- package/dist/esm/components/table/table-body-row.d.ts.map +1 -1
- package/dist/esm/components/table/table-body-row.js +1 -2
- package/dist/esm/components/table/table-body-row.js.map +1 -1
- package/dist/esm/components/table/table-empty-state.d.ts.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-cell.d.ts.map +1 -1
- package/dist/esm/components/table/table-header-cell.js +1 -1
- package/dist/esm/components/table/table-header-cell.js.map +1 -1
- package/dist/esm/components/table/table-header-row.d.ts.map +1 -1
- package/dist/esm/components/table/table-header-row.js +1 -1
- package/dist/esm/components/table/table-header-row.js.map +1 -1
- package/dist/esm/components/table/table.d.ts.map +1 -1
- package/dist/esm/components/table/table.js +1 -1
- package/dist/esm/components/table/table.js.map +1 -1
- package/dist/esm/components/tag-field/tag-field-input.js +9 -16
- package/dist/esm/components/tag-field/tag-field-input.js.map +1 -1
- package/dist/esm/components/tag-field/tag-field-list-box.js +4 -38
- package/dist/esm/components/tag-field/tag-field-list-box.js.map +1 -1
- package/dist/esm/components/tag-field/tag-field.d.ts +1 -1
- package/dist/esm/components/tag-field/tag-field.d.ts.map +1 -1
- package/dist/esm/components/tag-field/tag-field.js +19 -94
- package/dist/esm/components/tag-field/tag-field.js.map +1 -1
- package/dist/esm/components/text-inputs/text-field.js +1 -1
- package/dist/esm/components/text-inputs/text-field.js.map +1 -1
- package/dist/esm/components/toggle-button/internal-toggle-button.d.ts.map +1 -1
- package/dist/esm/components/toggle-button/internal-toggle-button.js +2 -1
- package/dist/esm/components/toggle-button/internal-toggle-button.js.map +1 -1
- package/dist/esm/components/typography/link.d.ts +1 -1
- package/dist/esm/components/typography/link.d.ts.map +1 -1
- package/dist/esm/components/typography/link.js.map +1 -1
- package/dist/esm/icons/bookmark-fill.d.ts +8 -0
- package/dist/esm/icons/bookmark-fill.d.ts.map +1 -0
- package/dist/esm/icons/bookmark-fill.js +19 -0
- package/dist/esm/icons/bookmark-fill.js.map +1 -0
- package/dist/esm/icons/bookmark.d.ts +8 -0
- package/dist/esm/icons/bookmark.d.ts.map +1 -0
- package/dist/esm/icons/bookmark.js +19 -0
- package/dist/esm/icons/bookmark.js.map +1 -0
- package/dist/esm/icons/carousel.d.ts +8 -0
- package/dist/esm/icons/carousel.d.ts.map +1 -0
- package/dist/esm/icons/carousel.js +19 -0
- package/dist/esm/icons/carousel.js.map +1 -0
- package/dist/esm/icons/cloud-links.d.ts +8 -0
- package/dist/esm/icons/cloud-links.d.ts.map +1 -0
- package/dist/esm/icons/cloud-links.js +19 -0
- package/dist/esm/icons/cloud-links.js.map +1 -0
- package/dist/esm/icons/columns.d.ts +8 -0
- package/dist/esm/icons/columns.d.ts.map +1 -0
- package/dist/esm/icons/columns.js +19 -0
- package/dist/esm/icons/columns.js.map +1 -0
- package/dist/esm/icons/crop.d.ts +8 -0
- package/dist/esm/icons/crop.d.ts.map +1 -0
- package/dist/esm/icons/crop.js +19 -0
- package/dist/esm/icons/crop.js.map +1 -0
- package/dist/esm/icons/expand.d.ts +8 -0
- package/dist/esm/icons/expand.d.ts.map +1 -0
- package/dist/esm/icons/expand.js +19 -0
- package/dist/esm/icons/expand.js.map +1 -0
- package/dist/esm/icons/fill.d.ts +8 -0
- package/dist/esm/icons/fill.d.ts.map +1 -0
- package/dist/esm/icons/fill.js +19 -0
- package/dist/esm/icons/fill.js.map +1 -0
- package/dist/esm/icons/fit.d.ts +8 -0
- package/dist/esm/icons/fit.d.ts.map +1 -0
- package/dist/esm/icons/fit.js +19 -0
- package/dist/esm/icons/fit.js.map +1 -0
- package/dist/esm/icons/flow.d.ts +8 -0
- package/dist/esm/icons/flow.d.ts.map +1 -0
- package/dist/esm/icons/flow.js +19 -0
- package/dist/esm/icons/flow.js.map +1 -0
- package/dist/esm/icons/folder-database.d.ts +8 -0
- package/dist/esm/icons/folder-database.d.ts.map +1 -0
- package/dist/esm/icons/folder-database.js +19 -0
- package/dist/esm/icons/folder-database.js.map +1 -0
- package/dist/esm/icons/grid.d.ts +8 -0
- package/dist/esm/icons/grid.d.ts.map +1 -0
- package/dist/esm/icons/grid.js +19 -0
- package/dist/esm/icons/grid.js.map +1 -0
- package/dist/esm/icons/index.d.ts +19 -1
- package/dist/esm/icons/index.d.ts.map +1 -1
- package/dist/esm/icons/index.js +19 -1
- package/dist/esm/icons/index.js.map +1 -1
- package/dist/esm/icons/placement.d.ts +8 -0
- package/dist/esm/icons/placement.d.ts.map +1 -0
- package/dist/esm/icons/placement.js +19 -0
- package/dist/esm/icons/placement.js.map +1 -0
- package/dist/esm/icons/query.d.ts +8 -0
- package/dist/esm/icons/query.d.ts.map +1 -0
- package/dist/esm/icons/query.js +19 -0
- package/dist/esm/icons/query.js.map +1 -0
- package/dist/esm/icons/rows.d.ts +8 -0
- package/dist/esm/icons/rows.d.ts.map +1 -0
- package/dist/esm/icons/rows.js +19 -0
- package/dist/esm/icons/rows.js.map +1 -0
- package/dist/esm/icons/rules.d.ts +8 -0
- package/dist/esm/icons/rules.d.ts.map +1 -0
- package/dist/esm/icons/rules.js +19 -0
- package/dist/esm/icons/rules.js.map +1 -0
- package/dist/esm/icons/table.d.ts +8 -0
- package/dist/esm/icons/table.d.ts.map +1 -0
- package/dist/esm/icons/table.js +19 -0
- package/dist/esm/icons/table.js.map +1 -0
- package/dist/esm/icons/tags.d.ts +8 -0
- package/dist/esm/icons/tags.d.ts.map +1 -0
- package/dist/esm/icons/tags.js +19 -0
- package/dist/esm/icons/tags.js.map +1 -0
- package/dist/esm/icons/variants.d.ts +8 -0
- package/dist/esm/icons/variants.d.ts.map +1 -0
- package/dist/esm/icons/variants.js +19 -0
- package/dist/esm/icons/variants.js.map +1 -0
- package/dist-styles/core.css +1 -1
- package/dist-styles/styles.css +1 -1
- package/package.json +12 -12
- package/dist/commonjs/components/tag-field/tag-field-tags.d.ts +0 -2
- package/dist/commonjs/components/tag-field/tag-field-tags.d.ts.map +0 -1
- package/dist/commonjs/components/tag-field/tag-field-tags.js +0 -31
- package/dist/commonjs/components/tag-field/tag-field-tags.js.map +0 -1
- package/dist/commonjs/icons/unstable-expand.d.ts.map +0 -1
- package/dist/commonjs/icons/unstable-expand.js.map +0 -1
- package/dist/esm/components/tag-field/tag-field-tags.d.ts +0 -2
- package/dist/esm/components/tag-field/tag-field-tags.d.ts.map +0 -1
- package/dist/esm/components/tag-field/tag-field-tags.js +0 -28
- package/dist/esm/components/tag-field/tag-field-tags.js.map +0 -1
- package/dist/esm/icons/unstable-expand.d.ts.map +0 -1
- package/dist/esm/icons/unstable-expand.js +0 -19
- package/dist/esm/icons/unstable-expand.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tag-field.d.ts","sourceRoot":"","sources":["../../../../src/components/tag-field/tag-field.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"tag-field.d.ts","sourceRoot":"","sources":["../../../../src/components/tag-field/tag-field.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAqB,KAAK,cAAc,EAA+B,MAAM,OAAO,CAAC;AAE5F,OAAO,EASL,KAAK,aAAa,IAAI,gBAAgB,EACtC,KAAK,gBAAgB,IAAI,mBAAmB,EAE7C,MAAM,uBAAuB,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C;CACnB;AAgID;;;;GAIG;AACH,QAAA,MAAM,SAAS,GAnIG,CAAC,SAAS,cAAc,iKAmIwB,CAAC;AAEnE,OAAO,EAAE,SAAS,IAAI,QAAQ,EAAE,CAAC;AAEjC,MAAM,WAAW,iBAAiB,CAAC,CAAC,SAAS,cAAc,CAAE,SAAQ,IAAI,CACvE,mBAAmB,CAAC,CAAC,CAAC,EACtB,YAAY,GAAG,cAAc,GAAG,YAAY,CAC7C;IACC,0EAA0E;IAC1E,EAAE,CAAC,EAAE,GAAG,CAAC;IACT,2CAA2C;IAC3C,QAAQ,EAAE,kBAAkB,CAAC;CAC9B;AAED,oDAAoD;AACpD,wBAAgB,YAAY,CAAC,CAAC,SAAS,cAAc,EAAE,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,iBAAiB,CAAC,CAAC,CAAC,2CAiBlG;yBAjBe,YAAY;;;AAqB5B,MAAM,WAAW,oBAAoB,CAAC,CAAC,SAAS,cAAc,CAAE,SAAQ,eAAe,CAAC,CAAC,CAAC;IACxF,6EAA6E;IAC7E,EAAE,CAAC,EAAE,GAAG,CAAC;IACT,mDAAmD;IACnD,KAAK,EAAE,MAAM,CAAC;CACf;AAED,0DAA0D;AAC1D,wBAAgB,eAAe,CAAC,CAAC,SAAS,cAAc,EAAE,EACxD,KAAK,EACL,QAAQ,EACR,KAAK,EACL,GAAG,KAAK,EACT,EAAE,oBAAoB,CAAC,CAAC,CAAC,2CAezB;yBApBe,eAAe"}
|
|
@@ -1,14 +1,10 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
-
import { useFormValidation } from '@react-aria/form';
|
|
4
|
-
import { useFormReset, useId, useSlotId } from '@react-aria/utils';
|
|
5
|
-
import { useFormValidationState } from '@react-stately/form';
|
|
6
|
-
import { useControlledState } from '@react-stately/utils';
|
|
7
3
|
import clsx from 'clsx';
|
|
8
|
-
import { useImperativeHandle,
|
|
9
|
-
import {
|
|
4
|
+
import { useImperativeHandle, useRef } from 'react';
|
|
5
|
+
import { useId } from 'react-aria';
|
|
6
|
+
import { Button as RACButton, Collection as RACCollection, ComboBox as RACComboBox, Group as RACGroup, Header as RACHeader, ListBoxItem as RACListBoxItem, ListBoxSection as RACListBoxSection, Text as RACText, ComboBoxValue as RACComboBoxValue, } from 'react-aria-components';
|
|
10
7
|
import { forwardRef } from '../../forward-ref.js';
|
|
11
|
-
import { useLocalizedMessages } from '../../i18n/localization-provider.js';
|
|
12
8
|
import { IconChevronDown } from '../../icons/index.js';
|
|
13
9
|
import { isProduction } from '../../utils/is-production.js';
|
|
14
10
|
import { useProductionWarning } from '../../utils/use-production-warning.js';
|
|
@@ -16,13 +12,14 @@ import { withStyleProps } from '../../with-style-props.js';
|
|
|
16
12
|
import { CheckboxIndicator } from '../internal/checkbox-indicator/checkbox-indicator.js';
|
|
17
13
|
import { CollapsibleList } from '../internal/collapsible-list/collapsible-list.js';
|
|
18
14
|
import { FormFieldDescription, FormFieldError, FormFieldLabel } from '../internal/form-field/form-field.js';
|
|
15
|
+
import { TagGroup } from '../tag/tag-group.js';
|
|
16
|
+
import { Tag } from '../tag/tag.js';
|
|
19
17
|
import { textStyle } from '../typography/utils.js';
|
|
20
18
|
import { TagFieldInput } from './tag-field-input.js';
|
|
21
19
|
import { TagFieldListBox } from './tag-field-list-box.js';
|
|
22
|
-
|
|
23
|
-
function TagField({ label, description, error, items, children, placeholder, UNSAFE_className, UNSAFE_style, isReadOnly, inputValue: consumerInputValue, defaultInputValue: defaultConsumerInputValue, onInputChange, form, name, validate, onScroll, selectedKeys: consumerSelectedKeys, defaultSelectedKeys: defaultConsumerSelectedKeys, onSelectionChange, id, renderEmptyState, isVirtualized = false, apiRef, ...props }, ref) {
|
|
20
|
+
function TagField({ label, description, error, items, children, placeholder, UNSAFE_className, UNSAFE_style, validate, isReadOnly, onScroll, selectedKeys, defaultSelectedKeys, onSelectionChange, id, renderEmptyState, isVirtualized = false, apiRef, ...props }, ref) {
|
|
24
21
|
const inputRef = useRef(null);
|
|
25
|
-
const { 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledBy, isRequired, isDisabled
|
|
22
|
+
const { 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledBy, isRequired, isDisabled } = props;
|
|
26
23
|
useProductionWarning(() => {
|
|
27
24
|
if (!label && !ariaLabel && !ariaLabelledBy) {
|
|
28
25
|
console.warn('TagField requires one of label / aria-label / aria-labelledby for accessibility');
|
|
@@ -31,93 +28,21 @@ function TagField({ label, description, error, items, children, placeholder, UNS
|
|
|
31
28
|
if (!isProduction() && items != null && typeof children !== 'function') {
|
|
32
29
|
console.warn('`TagField` requires `children` to be a function when using `items` prop');
|
|
33
30
|
}
|
|
34
|
-
const
|
|
31
|
+
const inputId = useId(id);
|
|
35
32
|
useImperativeHandle(apiRef, () => ({
|
|
36
33
|
focus: () => inputRef.current?.focus(),
|
|
37
34
|
}), []);
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
// Validation
|
|
50
|
-
const inputId = useId(id);
|
|
51
|
-
const formInputRef = useRef(null);
|
|
52
|
-
const validationState = useFormValidationState({
|
|
53
|
-
name,
|
|
54
|
-
value: useMemo(() => ({ selectedKeys: selectedSet, inputValue }), [selectedSet, inputValue]),
|
|
55
|
-
isInvalid,
|
|
56
|
-
isRequired,
|
|
57
|
-
validate,
|
|
58
|
-
validationBehavior: 'native',
|
|
59
|
-
});
|
|
60
|
-
const [initialSelectedKeys] = useState(selectedKeys);
|
|
61
|
-
const [initialInputValue] = useState(inputValue);
|
|
62
|
-
useFormReset(formInputRef, [defaultConsumerSelectedKeys ?? initialSelectedKeys, defaultConsumerInputValue ?? initialInputValue], ([a, b]) => {
|
|
63
|
-
setSelectedKeys(a);
|
|
64
|
-
setInputValue(b);
|
|
65
|
-
});
|
|
66
|
-
useFormValidation({
|
|
67
|
-
focus: () => {
|
|
68
|
-
// Querying by element ID because a ref is always null here, I don't know why :(
|
|
69
|
-
document.getElementById(inputId)?.focus();
|
|
70
|
-
},
|
|
71
|
-
isInvalid,
|
|
72
|
-
isRequired,
|
|
73
|
-
validate,
|
|
74
|
-
validationBehavior: 'native',
|
|
75
|
-
}, validationState, formInputRef);
|
|
76
|
-
// Event handlers
|
|
77
|
-
// Commit validation on input blur if the values have changed
|
|
78
|
-
const inputValueOnFocus = useRef(inputValue);
|
|
79
|
-
const selectedSetOnFocus = useRef(selectedSet);
|
|
80
|
-
const onFocusChange = (isFocused) => {
|
|
81
|
-
if (isFocused) {
|
|
82
|
-
inputValueOnFocus.current = inputValue;
|
|
83
|
-
selectedSetOnFocus.current = selectedSet;
|
|
84
|
-
}
|
|
85
|
-
else if (inputValue !== inputValueOnFocus.current || selectedSet !== selectedSetOnFocus.current) {
|
|
86
|
-
validationState.commitValidation();
|
|
87
|
-
}
|
|
88
|
-
};
|
|
89
|
-
const onItemSelectionChange = (key) => {
|
|
90
|
-
if (selectedSet.has(key)) {
|
|
91
|
-
// This is a temporary mutation followed immediately by a state update, so this is fine
|
|
92
|
-
// eslint-disable-next-line react-hooks/immutability
|
|
93
|
-
selectedSet.delete(key);
|
|
94
|
-
}
|
|
95
|
-
else {
|
|
96
|
-
selectedSet.add(key);
|
|
97
|
-
}
|
|
98
|
-
setSelectedKeys(new Set(selectedSet.values()));
|
|
99
|
-
validationState.commitValidation();
|
|
100
|
-
};
|
|
101
|
-
// Text slots
|
|
102
|
-
const descriptionId = useSlotId([Boolean(description)]);
|
|
103
|
-
const errorMessageId = useSlotId([
|
|
104
|
-
Boolean(error || validationState.displayValidation.validationErrors),
|
|
105
|
-
validationState.displayValidation.isInvalid,
|
|
106
|
-
]);
|
|
107
|
-
return (_jsxs(_Fragment, { children: [_jsx(RACComboBox, { ...props, ref: ref, id: inputId, className: clsx('cim-combo-box', 'cim-tag-field', UNSAFE_className), style: UNSAFE_style,
|
|
108
|
-
// Force no internal selection - we handle selection manually
|
|
109
|
-
selectedKey: null, inputValue: inputValue, onInputChange: setInputValue, menuTrigger: "focus", isReadOnly: isReadOnly, "data-readonly": isReadOnly ? true : undefined, onSelectionChange: (key) => {
|
|
110
|
-
if (key) {
|
|
111
|
-
onItemSelectionChange(key);
|
|
112
|
-
}
|
|
113
|
-
}, children: _jsxs(RACProvider, { values: [
|
|
114
|
-
[RACTextContext, { slots: { description: { id: descriptionId }, errorMessage: { id: errorMessageId } } }],
|
|
115
|
-
[RACGroupContext, { isInvalid: validationState.displayValidation.isInvalid, isDisabled }],
|
|
116
|
-
[RACFieldErrorContext, validationState.displayValidation],
|
|
117
|
-
], children: [_jsx(FormFieldLabel, { isRequired: isRequired, isDisabled: isDisabled, children: label }), _jsxs(RACGroup, { className: "cim-combo-box-input-group", children: [_jsx(TagFieldInput, { inputRef: inputRef, "aria-describedby": props['aria-describedby'], isReadOnly: isReadOnly, isRequired: isRequired, isInvalid: validationState.displayValidation.isInvalid, placeholder: selectedSet.size === 0 && placeholder
|
|
118
|
-
? placeholder
|
|
119
|
-
: messages.format('itemsSelected', { selectedItemCount: selectedSet.size }), onFocusChange: onFocusChange }), _jsx(RACButton, { className: "cim-combo-box-button", children: _jsx(IconChevronDown, {}) })] }), _jsx(FormFieldError, { children: error }), _jsx(FormFieldDescription, { children: description }), _jsx(TagFieldTags, { inputId: inputId, selectedKeys: selectedSet, isDisabled: isDisabled, isReadOnly: isReadOnly, renderEmptyState: renderEmptyState, onRemove: onItemSelectionChange }), _jsx(CollapsibleList, { offset: 5, maxHeight: 315, children: _jsx(TagFieldListBox, { inputId: inputId, items: items, selectedKeys: selectedSet, setSelectedKeys: setSelectedKeys, onScroll: onScroll, isVirtualized: isVirtualized, children: children }) })] }) }), _jsx(RACInput, { ref: formInputRef, style: { display: 'none' }, value: selectedSet.size || '', required: isRequired, "aria-invalid": validationState.displayValidation.isInvalid || undefined, onChange: () => { } }), name &&
|
|
120
|
-
[...selectedSet].map((value) => _jsx("input", { type: "hidden", form: form, name: name, value: value }, value))] }));
|
|
35
|
+
return (_jsxs(RACComboBox, { ...props, ref: ref, className: clsx('cim-combo-box', 'cim-tag-field', UNSAFE_className), style: UNSAFE_style, id: inputId, selectionMode: "multiple", value: selectedKeys ? Array.from(selectedKeys) : undefined, defaultValue: defaultSelectedKeys ? Array.from(defaultSelectedKeys) : undefined, onChange: (keys) => onSelectionChange?.(new Set(keys)), menuTrigger: "focus", isReadOnly: isReadOnly, "data-readonly": isReadOnly ? true : undefined, validate: validate
|
|
36
|
+
? ({ inputValue, value }) => {
|
|
37
|
+
return validate({ inputValue, selectedKeys: new Set(value) });
|
|
38
|
+
}
|
|
39
|
+
: undefined, children: [_jsx(FormFieldLabel, { isRequired: isRequired, isDisabled: isDisabled, children: label }), _jsxs(RACGroup, { className: "cim-combo-box-input-group", children: [_jsx(TagFieldInput, { inputRef: inputRef, "aria-describedby": props['aria-describedby'], isReadOnly: isReadOnly, placeholder: placeholder }), _jsx(RACButton, { className: "cim-combo-box-button", children: _jsx(IconChevronDown, {}) })] }), _jsx(FormFieldError, { children: error }), _jsx(FormFieldDescription, { children: description }), _jsx(RACComboBoxValue, { children: ({ state }) => (_jsx(TagGroup, { "aria-labelledby": inputId, disabledKeys: isDisabled ? state.selectedItems.map((item) => item.key) : undefined, renderEmptyState: renderEmptyState, onRemove: isReadOnly
|
|
40
|
+
? undefined
|
|
41
|
+
: (keys) => {
|
|
42
|
+
if (Array.isArray(state.value)) {
|
|
43
|
+
state.setValue(state.value.filter((k) => !keys.has(k)));
|
|
44
|
+
}
|
|
45
|
+
}, children: state.selectedItems.map((item) => (_jsx(Tag, { id: item.key, isDisabled: item.props.isDisabled, children: item.textValue }, item.key))) })) }), _jsx(CollapsibleList, { offset: 5, maxHeight: 315, children: _jsx(TagFieldListBox, { items: items, onScroll: onScroll, isVirtualized: isVirtualized, children: children }) })] }));
|
|
121
46
|
}
|
|
122
47
|
/**
|
|
123
48
|
* Allows users to filter a collapsible list and select multiple items from it.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tag-field.js","sourceRoot":"","sources":["../../../../src/components/tag-field/tag-field.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAC7D,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAA0C,mBAAmB,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC/G,OAAO,EACL,MAAM,IAAI,SAAS,EACnB,UAAU,IAAI,aAAa,EAC3B,QAAQ,IAAI,WAAW,EACvB,KAAK,IAAI,QAAQ,EACjB,MAAM,IAAI,SAAS,EACnB,KAAK,IAAI,QAAQ,EACjB,WAAW,IAAI,cAAc,EAC7B,cAAc,IAAI,iBAAiB,EACnC,IAAI,IAAI,OAAO,EAGf,QAAQ,IAAI,WAAW,EACvB,WAAW,IAAI,cAAc,EAC7B,YAAY,IAAI,eAAe,EAC/B,iBAAiB,IAAI,oBAAoB,GAC1C,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,oBAAoB,EAAE,MAAM,qCAAqC,CAAC;AAC3E,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAC5D,OAAO,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;AAC7E,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CA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CAAC,CAAC;IAEhH,OAAO,CACL,KAAC,cAAc,OAAK,KAAK,EAAE,SAAS,EAAC,mDAAmD,EAAC,SAAS,EAAE,SAAS,YAC1G,CAAC,EAAE,UAAU,EAAE,EAAE,EAAE,CAAC,CACnB,8BACE,KAAC,iBAAiB,KAAG,EAErB,KAAC,OAAO,IAAC,IAAI,EAAC,OAAO,EAAC,SAAS,EAAE,SAAS,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,UAAU,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,YACnG,QAAQ,GACD,IACT,CACJ,GACc,CAClB,CAAC;AACJ,CAAC;AAED,YAAY,CAAC,WAAW,GAAG,cAAc,CAAC;AAS1C,0DAA0D;AAC1D,MAAM,UAAU,eAAe,CAA2B,EACxD,KAAK,EACL,QAAQ,EACR,KAAK,EACL,GAAG,KAAK,EACgB;IACxB,IAAI,CAAC,YAAY,EAAE,IAAI,KAAK,IAAI,IAAI,IAAI,OAAO,QAAQ,KAAK,UAAU,EAAE,CAAC;QACvE,OAAO,CAAC,IAAI,CAAC,gFAAgF,CAAC,CAAC;IACjG,CAAC;IAED,OAAO,CACL,MAAC,iBAAiB,OAAK,KAAK,EAAE,SAAS,EAAC,uBAAuB,aAC7D,KAAC,SAAS,IACR,SAAS,EAAE,IAAI,CAAC,8BAA8B,EAAE,SAAS,CAAC,EAAE,OAAO,EAAE,gBAAgB,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAC,YAExG,KAAK,GACI,EACZ,KAAC,aAAa,IAAC,KAAK,EAAE,KAAK,YAAG,QAAQ,GAAiB,IACrC,CACrB,CAAC;AACJ,CAAC;AAED,eAAe,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 { type ForwardedRef, type UIEventHandler, useImperativeHandle, useMemo, useRef, useState } 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 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 { 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 { CheckboxIndicator } from '../internal/checkbox-indicator/checkbox-indicator.js';\nimport { CollapsibleList } from '../internal/collapsible-list/collapsible-list.js';\nimport { FormFieldDescription, FormFieldError, FormFieldLabel } from '../internal/form-field/form-field.js';\nimport type { TagGroupProps } from '../tag/tag-group.js';\nimport type {\n ApiProps,\n CollectionItem,\n CollectionProps,\n CommonProps,\n FieldWithPlaceholderProps,\n Key,\n StringLikeChildren,\n} from '../types.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 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 TagFieldProps<T extends CollectionItem = CollectionItem>\n extends\n CommonProps,\n FieldWithPlaceholderProps<TagFieldValidationValue>,\n CollectionProps<T>,\n ApiProps<TagFieldApi>,\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<TagGroupProps<T>, 'renderEmptyState'> {\n /** The currently selected keys in the collection (controlled). */\n selectedKeys?: Iterable<Key>;\n /** The initial selected keys in the collection (uncontrolled). */\n defaultSelectedKeys?: Iterable<Key>;\n /** Handler that is called when the selection changes. */\n onSelectionChange?: (keys: Set<Key>) => void;\n /**\n * Whether the list of options should be virtualized. Use this as a performance optimization for large lists.\n * @default false\n */\n isVirtualized?: boolean;\n /** Handler that is called when the list of items is scrolled. */\n onScroll?: UIEventHandler<HTMLDivElement>;\n}\n\n/** The imperative API exposed by the `TagField` component. */\nexport interface TagFieldApi {\n /** Focuses the input field and opens the list of items. */\n focus: () => void;\n}\n\nfunction 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 form,\n name,\n validate,\n onScroll,\n selectedKeys: consumerSelectedKeys,\n defaultSelectedKeys: defaultConsumerSelectedKeys,\n onSelectionChange,\n id,\n renderEmptyState,\n isVirtualized = false,\n apiRef,\n ...props\n }: TagFieldProps<T>,\n ref: ForwardedRef<HTMLDivElement>,\n) {\n const inputRef = useRef<HTMLInputElement>(null);\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 useImperativeHandle(\n apiRef,\n () => ({\n focus: () => inputRef.current?.focus(),\n }),\n [],\n );\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 const [initialSelectedKeys] = useState(selectedKeys);\n const [initialInputValue] = useState(inputValue);\n\n useFormReset<[Iterable<Key>, string]>(\n formInputRef,\n [defaultConsumerSelectedKeys ?? initialSelectedKeys, defaultConsumerInputValue ?? initialInputValue],\n ([a, b]) => {\n setSelectedKeys(a);\n setInputValue(b);\n },\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 // This is a temporary mutation followed immediately by a state update, so this is fine\n // eslint-disable-next-line react-hooks/immutability\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 <RACGroup className=\"cim-combo-box-input-group\">\n <TagFieldInput\n inputRef={inputRef}\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 <TagFieldTags<T>\n inputId={inputId}\n selectedKeys={selectedSet}\n isDisabled={isDisabled}\n isReadOnly={isReadOnly}\n renderEmptyState={renderEmptyState}\n onRemove={onItemSelectionChange}\n />\n\n <CollapsibleList\n offset={5} // 1px border + 4px actual offset\n maxHeight={315}\n >\n <TagFieldListBox<T>\n inputId={inputId}\n items={items}\n selectedKeys={selectedSet}\n setSelectedKeys={setSelectedKeys}\n onScroll={onScroll}\n isVirtualized={isVirtualized}\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 &&\n [...selectedSet].map((value) => <input type=\"hidden\" key={value} form={form} 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.io/components/tag-field).\n */\nconst _TagField = withStyleProps(forwardRef(TagField), 'TagField');\n\nexport { _TagField as TagField };\n\nexport interface TagFieldItemProps<T extends CollectionItem> extends Pick<\n RACListBoxItemProps<T>,\n 'isDisabled' | 'onHoverStart' | 'onHoverEnd'\n> {\n /** The ID of the item. Has to be unique across all sections and items. */\n id?: Key;\n /** The content to display as the label. */\n children: StringLikeChildren;\n}\n\n/** Renders a single list item within `TagField`. */\nexport function TagFieldItem<T extends CollectionItem>({ children, ...props }: 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-tag-field-item cim-checkbox-indicator-wrapper\" textValue={textValue}>\n {({ isDisabled }) => (\n <>\n <CheckboxIndicator />\n\n <RACText slot=\"label\" className={textStyle({ variant: 'medium', tone: isDisabled ? 'muted' : 'base' })}>\n {children}\n </RACText>\n </>\n )}\n </RACListBoxItem>\n );\n}\n\nTagFieldItem.displayName = 'TagFieldItem';\n\nexport interface 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 TagFieldSection<T extends CollectionItem>({\n title,\n children,\n items,\n ...props\n}: 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\nTagFieldSection.displayName = 'TagFieldSection';\n"]}
|
|
1
|
+
{"version":3,"file":"tag-field.js","sourceRoot":"","sources":["../../../../src/components/tag-field/tag-field.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAA0C,mBAAmB,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAC5F,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,EACL,MAAM,IAAI,SAAS,EACnB,UAAU,IAAI,aAAa,EAC3B,QAAQ,IAAI,WAAW,EACvB,KAAK,IAAI,QAAQ,EACjB,MAAM,IAAI,SAAS,EACnB,WAAW,IAAI,cAAc,EAC7B,cAAc,IAAI,iBAAiB,EACnC,IAAI,IAAI,OAAO,EAGf,aAAa,IAAI,gBAAgB,GAClC,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAC5D,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,MAAM,UAAU,eAAe,CAA2B,EACxD,KAAK,EACL,QAAQ,EACR,KAAK,EACL,GAAG,KAAK,EACgB;IACxB,IAAI,CAAC,YAAY,EAAE,IAAI,KAAK,IAAI,IAAI,IAAI,OAAO,QAAQ,KAAK,UAAU,EAAE,CAAC;QACvE,OAAO,CAAC,IAAI,CAAC,gFAAgF,CAAC,CAAC;IACjG,CAAC;IAED,OAAO,CACL,MAAC,iBAAiB,OAAK,KAAK,EAAE,SAAS,EAAC,uBAAuB,aAC7D,KAAC,SAAS,IACR,SAAS,EAAE,IAAI,CAAC,8BAA8B,EAAE,SAAS,CAAC,EAAE,OAAO,EAAE,gBAAgB,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAC,YAExG,KAAK,GACI,EACZ,KAAC,aAAa,IAAC,KAAK,EAAE,KAAK,YAAG,QAAQ,GAAiB,IACrC,CACrB,CAAC;AACJ,CAAC;AAED,eAAe,CAAC,WAAW,GAAG,iBAAiB,CAAC","sourcesContent":["'use client';\n\nimport clsx from 'clsx';\nimport { type ForwardedRef, type UIEventHandler, useImperativeHandle, useRef } from 'react';\nimport { useId } from 'react-aria';\nimport {\n Button as RACButton,\n Collection as RACCollection,\n ComboBox as RACComboBox,\n Group as RACGroup,\n Header as RACHeader,\n ListBoxItem as RACListBoxItem,\n ListBoxSection as RACListBoxSection,\n Text as RACText,\n type ComboBoxProps as RACComboBoxProps,\n type ListBoxItemProps as RACListBoxItemProps,\n ComboBoxValue as RACComboBoxValue,\n} from 'react-aria-components';\nimport { forwardRef } from '../../forward-ref.js';\nimport { 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 { CheckboxIndicator } from '../internal/checkbox-indicator/checkbox-indicator.js';\nimport { CollapsibleList } from '../internal/collapsible-list/collapsible-list.js';\nimport { FormFieldDescription, FormFieldError, FormFieldLabel } from '../internal/form-field/form-field.js';\nimport { TagGroup, type TagGroupProps } from '../tag/tag-group.js';\nimport { Tag, type TagProps } from '../tag/tag.js';\nimport type {\n ApiProps,\n CollectionItem,\n CollectionProps,\n CommonProps,\n FieldWithPlaceholderProps,\n Key,\n StringLikeChildren,\n} from '../types.js';\nimport { textStyle } from '../typography/utils.js';\nimport { TagFieldInput } from './tag-field-input.js';\nimport { TagFieldListBox } from './tag-field-list-box.js';\n\n/** Represents the state of the `TagField` component for validation purposes. */\nexport interface 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 TagFieldProps<T extends CollectionItem = CollectionItem>\n extends\n CommonProps,\n FieldWithPlaceholderProps<TagFieldValidationValue>,\n CollectionProps<T>,\n ApiProps<TagFieldApi>,\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<TagGroupProps<T>, 'renderEmptyState'> {\n /** The currently selected keys in the collection (controlled). */\n selectedKeys?: Iterable<Key>;\n /** The initial selected keys in the collection (uncontrolled). */\n defaultSelectedKeys?: Iterable<Key>;\n /** Handler that is called when the selection changes. */\n onSelectionChange?: (keys: Set<Key>) => void;\n /**\n * Whether the list of options should be virtualized. Use this as a performance optimization for large lists.\n * @default false\n */\n isVirtualized?: boolean;\n /** Handler that is called when the list of items is scrolled. */\n onScroll?: UIEventHandler<HTMLDivElement>;\n}\n\n/** The imperative API exposed by the `TagField` component. */\nexport interface TagFieldApi {\n /** Focuses the input field and opens the list of items. */\n focus: () => void;\n}\n\nfunction TagField<T extends CollectionItem>(\n {\n label,\n description,\n error,\n items,\n children,\n placeholder,\n UNSAFE_className,\n UNSAFE_style,\n validate,\n isReadOnly,\n onScroll,\n selectedKeys,\n defaultSelectedKeys,\n onSelectionChange,\n id,\n renderEmptyState,\n isVirtualized = false,\n apiRef,\n ...props\n }: TagFieldProps<T>,\n ref: ForwardedRef<HTMLDivElement>,\n) {\n const inputRef = useRef<HTMLInputElement>(null);\n\n const { 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledBy, isRequired, isDisabled } = 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 inputId = useId(id);\n\n useImperativeHandle(\n apiRef,\n () => ({\n focus: () => inputRef.current?.focus(),\n }),\n [],\n );\n\n return (\n <RACComboBox\n {...props}\n ref={ref}\n className={clsx('cim-combo-box', 'cim-tag-field', UNSAFE_className)}\n style={UNSAFE_style}\n id={inputId}\n selectionMode=\"multiple\"\n value={selectedKeys ? Array.from(selectedKeys) : undefined}\n defaultValue={defaultSelectedKeys ? Array.from(defaultSelectedKeys) : undefined}\n onChange={(keys) => onSelectionChange?.(new Set(keys))}\n menuTrigger=\"focus\"\n isReadOnly={isReadOnly}\n data-readonly={isReadOnly ? true : undefined}\n validate={\n validate\n ? ({ inputValue, value }) => {\n return validate({ inputValue, selectedKeys: new Set(value as unknown as Key[]) });\n }\n : undefined\n }\n >\n <FormFieldLabel isRequired={isRequired} isDisabled={isDisabled}>\n {label}\n </FormFieldLabel>\n\n <RACGroup className=\"cim-combo-box-input-group\">\n <TagFieldInput\n inputRef={inputRef}\n aria-describedby={props['aria-describedby']}\n isReadOnly={isReadOnly}\n placeholder={placeholder}\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 <RACComboBoxValue>\n {({ state }) => (\n <TagGroup\n aria-labelledby={inputId}\n disabledKeys={isDisabled ? state.selectedItems.map((item) => item.key) : undefined}\n renderEmptyState={renderEmptyState}\n onRemove={\n isReadOnly\n ? undefined\n : (keys) => {\n if (Array.isArray(state.value)) {\n state.setValue(state.value.filter((k) => !keys.has(k)));\n }\n }\n }\n >\n {state.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 )}\n </RACComboBoxValue>\n\n <CollapsibleList\n offset={5} // 1px border + 4px actual offset\n maxHeight={315}\n >\n <TagFieldListBox<T> items={items} onScroll={onScroll} isVirtualized={isVirtualized}>\n {children}\n </TagFieldListBox>\n </CollapsibleList>\n </RACComboBox>\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.io/components/tag-field).\n */\nconst _TagField = withStyleProps(forwardRef(TagField), 'TagField');\n\nexport { _TagField as TagField };\n\nexport interface TagFieldItemProps<T extends CollectionItem> extends Pick<\n RACListBoxItemProps<T>,\n 'isDisabled' | 'onHoverStart' | 'onHoverEnd'\n> {\n /** The ID of the item. Has to be unique across all sections and items. */\n id?: Key;\n /** The content to display as the label. */\n children: StringLikeChildren;\n}\n\n/** Renders a single list item within `TagField`. */\nexport function TagFieldItem<T extends CollectionItem>({ children, ...props }: 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-tag-field-item cim-checkbox-indicator-wrapper\" textValue={textValue}>\n {({ isDisabled }) => (\n <>\n <CheckboxIndicator />\n\n <RACText slot=\"label\" className={textStyle({ variant: 'medium', tone: isDisabled ? 'muted' : 'base' })}>\n {children}\n </RACText>\n </>\n )}\n </RACListBoxItem>\n );\n}\n\nTagFieldItem.displayName = 'TagFieldItem';\n\nexport interface 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 TagFieldSection<T extends CollectionItem>({\n title,\n children,\n items,\n ...props\n}: 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\nTagFieldSection.displayName = 'TagFieldSection';\n"]}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
-
import { useId } from '@react-aria/utils';
|
|
4
3
|
import { useControlledState } from '@react-stately/utils';
|
|
5
4
|
import clsx from 'clsx';
|
|
6
5
|
import { useImperativeHandle, useRef } from 'react';
|
|
6
|
+
import { useId } from 'react-aria';
|
|
7
7
|
import { Group as RACGroup, Input as RACInput, TextField as RACTextField, } from 'react-aria-components';
|
|
8
8
|
import { forwardRef } from '../../forward-ref.js';
|
|
9
9
|
import { useLocalizedMessages } from '../../i18n/localization-provider.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"text-field.js","sourceRoot":"","sources":["../../../../src/components/text-inputs/text-field.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"text-field.js","sourceRoot":"","sources":["../../../../src/components/text-inputs/text-field.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAyC,mBAA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C,KAAC,oBAAoB,cAAE,WAAW,GAAwB,EACzD,gBAAgB,IAAI,CACnB,YAAG,EAAE,EAAE,kBAAkB,EAAE,SAAS,EAAC,kCAAkC,EAAC,MAAM,kBAC3E,QAAQ,CAAC,MAAM,CAAC,uBAAuB,CAAC,GACvC,CACL,IACA,CACJ,GACY,CAChB,CAAC;AACJ,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,GAAG,cAAc,CAAC,UAAU,CAAC,SAAS,CAAC,EAAE,WAAW,CAAC,CAAC;AAEtE,OAAO,EAAE,UAAU,IAAI,SAAS,EAAE,CAAC","sourcesContent":["'use client';\n\nimport { useControlledState } from '@react-stately/utils';\nimport clsx from 'clsx';\nimport { type ForwardedRef, type KeyboardEvent, useImperativeHandle, useRef } from 'react';\nimport { useId } from 'react-aria';\nimport {\n type TextFieldProps as RACTextFieldProps,\n Group as RACGroup,\n Input as RACInput,\n TextField as RACTextField,\n} from 'react-aria-components';\nimport { forwardRef } from '../../forward-ref.js';\nimport { useLocalizedMessages } from '../../i18n/localization-provider.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 { XButton } from '../internal/x-button/x-button.js';\nimport type { AffixProps, ApiProps, CommonProps, FieldWithPlaceholderProps } from '../types.js';\nimport { textStyle } from '../typography/utils.js';\n\nexport interface TextFieldProps\n extends\n CommonProps,\n FieldWithPlaceholderProps<string>,\n AffixProps,\n ApiProps<TextFieldApi>,\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 | 'pattern'\n | 'onFocus'\n | 'onBlur'\n | 'onKeyDown'\n > {\n /**\n * Whether to render a button that can be used to clear the text field.\n * @default false\n */\n isClearable?: boolean;\n}\n\n/** The imperative API exposed by the `TextField` component. */\nexport interface TextFieldApi {\n /** Focuses the input field. */\n focus: () => void;\n /** Selects the contents of the input field. */\n select: () => void;\n}\n\nfunction TextField(\n {\n label,\n description,\n error: errorMessage,\n placeholder,\n prefix,\n suffix,\n UNSAFE_className,\n UNSAFE_style,\n isClearable = false,\n value: consumerValue,\n defaultValue: consumerDefaultValue,\n onChange,\n apiRef,\n ...props\n }: TextFieldProps,\n ref: ForwardedRef<HTMLDivElement>,\n) {\n const { isDisabled, isReadOnly } = props;\n const inputRef = useRef<HTMLInputElement>(null);\n const [value, setValue] = useControlledState(consumerValue, consumerDefaultValue ?? '', onChange);\n const messages = useLocalizedMessages('common');\n const clearDescriptionId = useId();\n\n useImperativeHandle(\n apiRef,\n () => ({\n focus: () => inputRef.current?.focus(),\n select: () => inputRef.current?.select(),\n }),\n [],\n );\n\n const { 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledBy } = props;\n\n const isFieldClearable = isClearable && !isDisabled && !isReadOnly;\n\n function onKeyDown(e: KeyboardEvent) {\n if (!isFieldClearable) {\n return;\n }\n\n if (e.key === 'Escape') {\n e.preventDefault();\n\n setValue('');\n }\n }\n\n useProductionWarning(() => {\n if (!label && !ariaLabel && !ariaLabelledBy) {\n console.warn('TextField requires one of label / aria-label / aria-labelledby for accessibility');\n }\n }, [label, ariaLabel, ariaLabelledBy]);\n\n return (\n <RACTextField\n {...props}\n ref={ref}\n className={clsx('cim-text-field', UNSAFE_className)}\n style={UNSAFE_style}\n value={value}\n onChange={setValue}\n aria-describedby={[props['aria-describedby'], isFieldClearable ? clearDescriptionId : undefined]\n .filter(Boolean)\n .join(' ')}\n >\n {({ isDisabled, isRequired }) => (\n <>\n <FormFieldLabel isRequired={isRequired} isDisabled={isDisabled}>\n {label}\n </FormFieldLabel>\n <RACGroup className=\"cim-text-field-input-group\" onClick={() => inputRef.current?.focus()}>\n {prefix && (\n <div\n className={clsx(\n 'cim-text-field-affix',\n textStyle({ variant: 'body', tone: isDisabled ? 'muted' : 'subtle' }),\n )}\n aria-hidden\n >\n {prefix}\n </div>\n )}\n\n <RACInput\n ref={inputRef}\n className={clsx('cim-text-field-input', textStyle({ variant: 'body' }))}\n placeholder={placeholder}\n onKeyDown={onKeyDown}\n />\n\n {isClearable && (\n <XButton\n slot={null}\n UNSAFE_className=\"cim-text-field-clear\"\n data-visible={(isFieldClearable && value !== '') || undefined}\n aria-label={messages.format('clearValue')}\n onPress={() => setValue('')}\n iconType=\"circled\"\n excludeFromTabOrder\n />\n )}\n\n {suffix && (\n <div\n className={clsx(\n 'cim-text-field-affix',\n textStyle({ variant: 'body', tone: isDisabled ? 'muted' : 'subtle' }),\n )}\n aria-hidden\n >\n {suffix}\n </div>\n )}\n </RACGroup>\n <FormFieldError>{errorMessage}</FormFieldError>\n <FormFieldDescription>{description}</FormFieldDescription>\n {isFieldClearable && (\n <p id={clearDescriptionId} className=\"cim-text-field-clear-description\" hidden>\n {messages.format('clearValueDescription')}\n </p>\n )}\n </>\n )}\n </RACTextField>\n );\n}\n\n/**\n * Allows users to enter a single line of text with a keyboard.\n *\n * See [text field usage guidelines](https://ui.cimpress.io/components/text-field/).\n */\nconst _TextField = withStyleProps(forwardRef(TextField), 'TextField');\n\nexport { _TextField as TextField };\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal-toggle-button.d.ts","sourceRoot":"","sources":["../../../../src/components/toggle-button/internal-toggle-button.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"internal-toggle-button.d.ts","sourceRoot":"","sources":["../../../../src/components/toggle-button/internal-toggle-button.tsx"],"names":[],"mappings":"AAOA,OAAO,EAGL,KAAK,iBAAiB,IAAI,oBAAoB,EAG/C,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,KAAK,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAGlE,MAAM,WAAW,qBACf,SACE,IAAI,CAAC,WAAW,EAAE,IAAI,CAAC,EACvB,iBAAiB,EACjB,IAAI,CAAC,eAAe,EAAE,MAAM,GAAG,WAAW,CAAC,EAC3C,IAAI,CACF,oBAAoB,EAClB,iBAAiB,GACjB,YAAY,GACZ,SAAS,GACT,cAAc,GACd,YAAY,GACZ,UAAU,GACV,YAAY,GACZ,WAAW,CACd;IACH;;;;OAIG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;;;OAKG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB"}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useFormValidation } from '@react-aria/form';
|
|
3
|
-
import { useFormReset
|
|
3
|
+
import { useFormReset } from '@react-aria/utils';
|
|
4
4
|
import { privateValidationStateProp, useFormValidationState } from '@react-stately/form';
|
|
5
5
|
import { useControlledState } from '@react-stately/utils';
|
|
6
6
|
import clsx from 'clsx';
|
|
7
7
|
import { useContext, useRef, useState } from 'react';
|
|
8
|
+
import { useObjectRef } from 'react-aria';
|
|
8
9
|
import { TextContext as RACTextContext, ToggleButton as RACToggleButton, ToggleGroupStateContext as RACToggleGroupStateContext, useSlottedContext, } from 'react-aria-components';
|
|
9
10
|
import { ToggleButtonGroupContext } from './context.js';
|
|
10
11
|
/** @internal */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal-toggle-button.js","sourceRoot":"","sources":["../../../../src/components/toggle-button/internal-toggle-button.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,
|
|
1
|
+
{"version":3,"file":"internal-toggle-button.js","sourceRoot":"","sources":["../../../../src/components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AAmB,EAAE,gBAAgB,CAAC,EACtD,KAAK,EAAE,YAAY,EACnB,EAAE,EAAE,wBAAwB,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,EAChD,UAAU,EAAE,UAAU,EACtB,UAAU,EAAE,UAAU,EACtB,QAAQ,EAAE,aAAa,sBAErB;oBACE,KAAK,CAAC,kBAAkB,CAAC;oBACzB,wBAAwB,EAAE,SAAS,CAAC,CAAC,CAAC,iBAAiB,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI;oBAClE,gBAAgB,EAAE,EAAE;iBACrB;qBACE,MAAM,CAAC,OAAO,CAAC;qBACf,IAAI,CAAC,GAAG,CAAC,IAAI,SAAS,kBAEd,WAAW,eACd,MAAM,eACL,IAAI,qBACE,SAAS,IAAI,SAAS,YAEtC,QAAQ,GACO,EAEjB,aAAa,IAAI,CAChB,gBACE,GAAG,EAAE,YAAY,EACjB,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,EAC1B,IAAI,EAAC,UAAU,EACf,IAAI,EAAE,wBAAwB,EAAE,IAAI,IAAI,IAAI,EAC5C,IAAI,EAAE,aAAa,EACnB,OAAO,EAAE,UAAU,EACnB,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,wBAAwB,EAAE,UAAU,kBAE5C,wBAAwB,EAAE,eAAe,CAAC,iBAAiB,CAAC,SAAS;oBACrE,eAAe,CAAC,iBAAiB,CAAC,SAAS;oBAC3C,SAAS,EAEX,QAAQ,EAAE,GAAG,EAAE,GAAE,CAAC,GAClB,CACH,IACA,CACJ,CAAC;AACJ,CAAC","sourcesContent":["import { useFormValidation } from '@react-aria/form';\nimport { useFormReset } from '@react-aria/utils';\nimport { privateValidationStateProp, useFormValidationState } from '@react-stately/form';\nimport { useControlledState } from '@react-stately/utils';\nimport clsx from 'clsx';\nimport { type ReactNode, useContext, useRef, useState, type Ref } from 'react';\nimport { useObjectRef } from 'react-aria';\nimport {\n TextContext as RACTextContext,\n ToggleButton as RACToggleButton,\n type ToggleButtonProps as RACToggleButtonProps,\n ToggleGroupStateContext as RACToggleGroupStateContext,\n useSlottedContext,\n} from 'react-aria-components';\nimport type { BaseButtonProps } from '../button/types.js';\nimport type { AriaLabelingProps, CommonProps } from '../types.js';\nimport { ToggleButtonGroupContext } from './context.js';\n\nexport interface BaseToggleButtonProps\n extends\n Omit<CommonProps, 'id'>,\n AriaLabelingProps,\n Pick<BaseButtonProps, 'size' | 'fullWidth'>,\n Pick<\n RACToggleButtonProps,\n | 'defaultSelected'\n | 'isSelected'\n | 'onPress'\n | 'onHoverStart'\n | 'onHoverEnd'\n | 'onChange'\n | 'isDisabled'\n | 'autoFocus'\n > {\n /**\n * The `<form>` element to associate the input with.\n * The value of this attribute must be the id of a `<form>` in the same document.\n * See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/input#form).\n */\n form?: string;\n /**\n * The name of the input element, used when submitting an HTML form.\n * See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/input#name).\n */\n name?: string;\n /**\n * The value of the input element, used when submitting an HTML form.\n * See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/input#value).\n *\n * When used in a `ToggleButtonGroup`, `value` serves as an identifier for this button, and has to be unique across all buttons in the group.\n */\n value?: string;\n}\n\ninterface InternalToggleButtonProps extends BaseToggleButtonProps {\n children?: ReactNode;\n buttonRef?: Ref<HTMLButtonElement>;\n}\n\n/** @internal */\nexport function InternalToggleButton({\n buttonRef: ref,\n children,\n size = 'medium',\n isDisabled,\n fullWidth,\n UNSAFE_className,\n UNSAFE_style,\n form,\n name,\n value,\n isSelected: consumerIsSelected,\n defaultSelected: consumerDefaultSelected,\n onChange,\n ...props\n}: InternalToggleButtonProps) {\n // State\n\n const toggleButtonGroupContext = useContext(ToggleButtonGroupContext);\n const toggleGroupState = useContext(RACToggleGroupStateContext);\n const descriptionProps = useSlottedContext(RACTextContext, 'description');\n const errorMessageProps = useSlottedContext(RACTextContext, 'errorMessage');\n\n const validationState = useFormValidationState({\n // If part of a group, validation is handled at group level\n name: toggleButtonGroupContext ? undefined : name,\n value,\n validationBehavior: 'native',\n [privateValidationStateProp]: toggleButtonGroupContext?.validationState ?? undefined,\n });\n\n const [isSelected, setIsSelected] = useControlledState(\n toggleGroupState && value ? toggleGroupState.selectedKeys.has(value) : consumerIsSelected,\n consumerDefaultSelected ?? false,\n (newIsSelected) => {\n onChange?.(newIsSelected);\n\n if (toggleGroupState && value) {\n toggleGroupState.setSelected(value, newIsSelected);\n }\n\n validationState.commitValidation();\n },\n );\n\n // Validation\n\n const buttonRef = useObjectRef(ref);\n const formInputRef = useRef<HTMLInputElement>(null);\n const formInputName = toggleButtonGroupContext?.name ?? name;\n\n const [initialSelected] = useState(isSelected);\n useFormReset(formInputRef, consumerDefaultSelected ?? initialSelected, setIsSelected);\n\n useFormValidation(\n {\n focus: () => buttonRef.current?.focus(),\n validationBehavior: 'native',\n },\n validationState,\n formInputRef,\n );\n\n return (\n <>\n <RACToggleButton\n {...props}\n ref={buttonRef}\n className={clsx('cim-toggle-button', UNSAFE_className)}\n style={UNSAFE_style}\n id={toggleButtonGroupContext ? value : undefined}\n isDisabled={isDisabled}\n isSelected={isSelected}\n onChange={setIsSelected}\n aria-describedby={\n [\n props['aria-describedby'],\n toggleButtonGroupContext?.isInvalid ? errorMessageProps?.id : null,\n descriptionProps?.id,\n ]\n .filter(Boolean)\n .join(' ') || undefined\n }\n data-variant=\"secondary\"\n data-tone=\"base\"\n data-size={size}\n data-full-width={fullWidth || undefined}\n >\n {children}\n </RACToggleButton>\n\n {formInputName && (\n <input\n ref={formInputRef}\n style={{ display: 'none' }}\n type=\"checkbox\"\n form={toggleButtonGroupContext?.form ?? form}\n name={formInputName}\n checked={isSelected}\n value={value}\n required={toggleButtonGroupContext?.isRequired}\n aria-invalid={\n toggleButtonGroupContext?.validationState.displayValidation.isInvalid ??\n validationState.displayValidation.isInvalid ??\n undefined\n }\n onChange={() => {}}\n />\n )}\n </>\n );\n}\n"]}
|
|
@@ -2,7 +2,7 @@ import type { ReactNode } from 'react';
|
|
|
2
2
|
import { type LinkProps as RACLinkProps } from 'react-aria-components';
|
|
3
3
|
import type { NavigationProps, WithRequired } from '../types.js';
|
|
4
4
|
import type { BaseTypographyProps, TextStyleOptions } from './types.js';
|
|
5
|
-
export interface LinkProps extends
|
|
5
|
+
export interface LinkProps extends BaseTypographyProps, WithRequired<NavigationProps, 'href'>, Pick<TextStyleOptions, 'variant' | 'fontStyle' | 'alignment'>, Pick<RACLinkProps, 'isDisabled' | 'onHoverStart' | 'onHoverEnd'> {
|
|
6
6
|
/** An icon displayed before the link text. */
|
|
7
7
|
iconStart?: ReactNode;
|
|
8
8
|
/** An icon displayed after the link text. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"link.d.ts","sourceRoot":"","sources":["../../../../src/components/typography/link.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAgB,SAAS,EAAE,MAAM,OAAO,CAAC;AACrD,OAAO,EAAmB,KAAK,SAAS,IAAI,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAGxF,OAAO,KAAK,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AACjE,OAAO,KAAK,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAMxE,MAAM,WAAW,SACf,SACE,
|
|
1
|
+
{"version":3,"file":"link.d.ts","sourceRoot":"","sources":["../../../../src/components/typography/link.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAgB,SAAS,EAAE,MAAM,OAAO,CAAC;AACrD,OAAO,EAAmB,KAAK,SAAS,IAAI,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAGxF,OAAO,KAAK,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AACjE,OAAO,KAAK,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAMxE,MAAM,WAA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Y,aAElB,SAAS,IAAI,CACZ,8BACE,eAAM,SAAS,EAAC,eAAe,YAAE,SAAS,GAAQ,EACjD,WAAW,IACX,CACJ,EACD,eAAM,SAAS,EAAC,eAAe,YAAE,QAAQ,GAAQ,EAChD,OAAO,IAAI,CACV,8BACG,WAAW,EACZ,eAAM,SAAS,EAAC,eAAe,YAAE,OAAO,GAAQ,IAC/C,CACJ,IACO,CACX,CAAC;AACJ,CAAC;AAED;;;;GAIG;AACH,MAAM,KAAK,GAAG,cAAc,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC,CAAC;AAEvD,OAAO,EAAE,KAAK,IAAI,IAAI,EAAE,CAAC","sourcesContent":["'use client';\n\nimport clsx from 'clsx';\nimport type { ForwardedRef, ReactNode } from 'react';\nimport { Link as RACLink, type LinkProps as RACLinkProps } from 'react-aria-components';\nimport { forwardRef } from '../../forward-ref.js';\nimport { withStyleProps } from '../../with-style-props.js';\nimport type { NavigationProps, WithRequired } from '../types.js';\nimport type { BaseTypographyProps, TextStyleOptions } from './types.js';\nimport { textStyle } from './utils.js';\n\n// Used to prevent word wrap between icons and text\nconst WORD_JOINER = '\\u2060';\n\nexport interface LinkProps\n extends\n
|
|
1
|
+
{"version":3,"file":"link.js","sourceRoot":"","sources":["../../../../src/components/typography/link.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,IAAI,IAAI,OAAO,EAAkC,MAAM,uBAAuB,CAAC;AACxF,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAG3D,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAEvC,mDAAmD;AACnD,MAAM,WAAW,GAAG,QAAQ,CAAC;AAc7B,SAAS,IAAI,CACX,EAAE,QAAQ,EAAE,SAAS,EAAE,OAAO,EAAE,gBAAgB,EAAE,YAAY,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,GAAG,KAAK,EAAa,EACpH,GAAoC;IAEpC,OAAO,CACL,MAAC,OAAO,OACF,KAAK,EACT,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,IAAI,CAAC,UAAU,EAAE,SAAS,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,CAAC,EAAE,gBAAgB,CAAC,EAC3G,KAAK,EAAE,YAAY,aAElB,SAAS,IAAI,CACZ,8BACE,eAAM,SAAS,EAAC,eAAe,YAAE,SAAS,GAAQ,EACjD,WAAW,IACX,CACJ,EACD,eAAM,SAAS,EAAC,eAAe,YAAE,QAAQ,GAAQ,EAChD,OAAO,IAAI,CACV,8BACG,WAAW,EACZ,eAAM,SAAS,EAAC,eAAe,YAAE,OAAO,GAAQ,IAC/C,CACJ,IACO,CACX,CAAC;AACJ,CAAC;AAED;;;;GAIG;AACH,MAAM,KAAK,GAAG,cAAc,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC,CAAC;AAEvD,OAAO,EAAE,KAAK,IAAI,IAAI,EAAE,CAAC","sourcesContent":["'use client';\n\nimport clsx from 'clsx';\nimport type { ForwardedRef, ReactNode } from 'react';\nimport { Link as RACLink, type LinkProps as RACLinkProps } from 'react-aria-components';\nimport { forwardRef } from '../../forward-ref.js';\nimport { withStyleProps } from '../../with-style-props.js';\nimport type { NavigationProps, WithRequired } from '../types.js';\nimport type { BaseTypographyProps, TextStyleOptions } from './types.js';\nimport { textStyle } from './utils.js';\n\n// Used to prevent word wrap between icons and text\nconst WORD_JOINER = '\\u2060';\n\nexport interface LinkProps\n extends\n BaseTypographyProps,\n WithRequired<NavigationProps, 'href'>,\n Pick<TextStyleOptions, 'variant' | 'fontStyle' | 'alignment'>,\n Pick<RACLinkProps, 'isDisabled' | 'onHoverStart' | 'onHoverEnd'> {\n /** An icon displayed before the link text. */\n iconStart?: ReactNode;\n /** An icon displayed after the link text. */\n iconEnd?: ReactNode;\n}\n\nfunction Link(\n { children, iconStart, iconEnd, UNSAFE_className, UNSAFE_style, variant, fontStyle, alignment, ...props }: LinkProps,\n ref: ForwardedRef<HTMLAnchorElement>,\n) {\n return (\n <RACLink\n {...props}\n ref={ref}\n className={clsx('cim-link', textStyle({ tone: 'accent', variant, fontStyle, alignment }), UNSAFE_className)}\n style={UNSAFE_style}\n >\n {iconStart && (\n <>\n <span className=\"cim-link-icon\">{iconStart}</span>\n {WORD_JOINER}\n </>\n )}\n <span className=\"cim-link-text\">{children}</span>\n {iconEnd && (\n <>\n {WORD_JOINER}\n <span className=\"cim-link-icon\">{iconEnd}</span>\n </>\n )}\n </RACLink>\n );\n}\n\n/**\n * Displays a textual link that allows users to navigate to another page or resource.\n *\n * See [link usage guidelines](https://ui.cimpress.io/components/link/).\n */\nconst _Link = withStyleProps(forwardRef(Link), 'Link');\n\nexport { _Link as Link };\n"]}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { IconProps } from '../components/types.js';
|
|
2
|
+
/** Renders an SVG icon. */
|
|
3
|
+
declare const SvgBookmarkFill: {
|
|
4
|
+
({ size, "aria-hidden": ariaHidden, tone, UNSAFE_className, UNSAFE_style, ...rest }: IconProps): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
displayName: string;
|
|
6
|
+
};
|
|
7
|
+
export default SvgBookmarkFill;
|
|
8
|
+
//# sourceMappingURL=bookmark-fill.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bookmark-fill.d.ts","sourceRoot":"","sources":["../../../src/icons/bookmark-fill.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAGxD,2BAA2B;AAC3B,QAAA,MAAM,eAAe;yFAOlB,SAAS;;CAiBX,CAAC;AAEF,eAAe,eAAe,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import clsx from 'clsx';
|
|
3
|
+
import { fgTone } from '../utils/style/tone.js';
|
|
4
|
+
const displayName = 'IconBookmarkFill';
|
|
5
|
+
/** Renders an SVG icon. */
|
|
6
|
+
const SvgBookmarkFill = ({ size, 'aria-hidden': ariaHidden, tone, UNSAFE_className, UNSAFE_style, ...rest }) => {
|
|
7
|
+
const props = {
|
|
8
|
+
...rest,
|
|
9
|
+
'aria-hidden': ariaHidden ?? (rest['aria-label'] == null && rest['aria-labelledby'] == null),
|
|
10
|
+
className: clsx('cim-icon', tone && fgTone(tone), UNSAFE_className),
|
|
11
|
+
style: UNSAFE_style,
|
|
12
|
+
width: size != null ? size + 'px' : '1em',
|
|
13
|
+
height: size != null ? size + 'px' : '1em',
|
|
14
|
+
};
|
|
15
|
+
return (_jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", "data-icon": "true", fill: "currentColor", ...props, children: _jsx("path", { fill: "currentColor", d: "M24 9a3 3 0 0 0-3-3H11a3 3 0 0 0-3 3v17.028c0 1.182 1.294 1.885 2.277 1.284L16 23.227l5.723 4.083c.983.602 2.277-.1 2.277-1.283z" }) }));
|
|
16
|
+
};
|
|
17
|
+
SvgBookmarkFill.displayName = displayName;
|
|
18
|
+
export default SvgBookmarkFill;
|
|
19
|
+
//# sourceMappingURL=bookmark-fill.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bookmark-fill.js","sourceRoot":"","sources":["../../../src/icons/bookmark-fill.tsx"],"names":[],"mappings":";AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAChD,MAAM,WAAW,GAAG,kBAAkB,CAAC;AACvC,2BAA2B;AAC3B,MAAM,eAAe,GAAG,CAAC,EACvB,IAAI,EACJ,aAAa,EAAE,UAAU,EACzB,IAAI,EACJ,gBAAgB,EAChB,YAAY,EACZ,GAAG,IAAI,EACG,EAAE,EAAE;IACd,MAAM,KAAK,GAAG;QACZ,GAAG,IAAI;QACP,aAAa,EAAE,UAAU,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,IAAI,IAAI,IAAI,IAAI,CAAC,iBAAiB,CAAC,IAAI,IAAI,CAAC;QAC5F,SAAS,EAAE,IAAI,CAAC,UAAU,EAAE,IAAI,IAAI,MAAM,CAAC,IAAI,CAAC,EAAE,gBAAgB,CAAC;QACnE,KAAK,EAAE,YAAY;QACnB,KAAK,EAAE,IAAI,IAAI,IAAI,CAAC,CAAC,CAAC,IAAI,GAAG,IAAI,CAAC,CAAC,CAAC,KAAK;QACzC,MAAM,EAAE,IAAI,IAAI,IAAI,CAAC,CAAC,CAAC,IAAI,GAAG,IAAI,CAAC,CAAC,CAAC,KAAK;KAC3C,CAAC;IACF,OAAO,CACL,cAAK,KAAK,EAAC,4BAA4B,EAAC,OAAO,EAAC,WAAW,eAAW,MAAM,EAAC,IAAI,EAAC,cAAc,KAAK,KAAK,YACxG,eACE,IAAI,EAAC,cAAc,EACnB,CAAC,EAAC,kIAAkI,GACpI,GACE,CACP,CAAC;AACJ,CAAC,CAAC;AACF,eAAe,CAAC,WAAW,GAAG,WAAW,CAAC;AAC1C,eAAe,eAAe,CAAC","sourcesContent":["import clsx from 'clsx';\nimport type { IconProps } from '../components/types.js';\nimport { fgTone } from '../utils/style/tone.js';\nconst displayName = 'IconBookmarkFill';\n/** Renders an SVG icon. */\nconst SvgBookmarkFill = ({\n size,\n 'aria-hidden': ariaHidden,\n tone,\n UNSAFE_className,\n UNSAFE_style,\n ...rest\n}: IconProps) => {\n const props = {\n ...rest,\n 'aria-hidden': ariaHidden ?? (rest['aria-label'] == null && rest['aria-labelledby'] == null),\n className: clsx('cim-icon', tone && fgTone(tone), UNSAFE_className),\n style: UNSAFE_style,\n width: size != null ? size + 'px' : '1em',\n height: size != null ? size + 'px' : '1em',\n };\n return (\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 32 32\" data-icon=\"true\" fill=\"currentColor\" {...props}>\n <path\n fill=\"currentColor\"\n d=\"M24 9a3 3 0 0 0-3-3H11a3 3 0 0 0-3 3v17.028c0 1.182 1.294 1.885 2.277 1.284L16 23.227l5.723 4.083c.983.602 2.277-.1 2.277-1.283z\"\n />\n </svg>\n );\n};\nSvgBookmarkFill.displayName = displayName;\nexport default SvgBookmarkFill;\n"]}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { IconProps } from '../components/types.js';
|
|
2
|
+
/** Renders an SVG icon. */
|
|
3
|
+
declare const SvgBookmark: {
|
|
4
|
+
({ size, "aria-hidden": ariaHidden, tone, UNSAFE_className, UNSAFE_style, ...rest }: IconProps): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
displayName: string;
|
|
6
|
+
};
|
|
7
|
+
export default SvgBookmark;
|
|
8
|
+
//# sourceMappingURL=bookmark.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bookmark.d.ts","sourceRoot":"","sources":["../../../src/icons/bookmark.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAGxD,2BAA2B;AAC3B,QAAA,MAAM,WAAW;yFAAwF,SAAS;;CAiBjH,CAAC;AAEF,eAAe,WAAW,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import clsx from 'clsx';
|
|
3
|
+
import { fgTone } from '../utils/style/tone.js';
|
|
4
|
+
const displayName = 'IconBookmark';
|
|
5
|
+
/** Renders an SVG icon. */
|
|
6
|
+
const SvgBookmark = ({ size, 'aria-hidden': ariaHidden, tone, UNSAFE_className, UNSAFE_style, ...rest }) => {
|
|
7
|
+
const props = {
|
|
8
|
+
...rest,
|
|
9
|
+
'aria-hidden': ariaHidden ?? (rest['aria-label'] == null && rest['aria-labelledby'] == null),
|
|
10
|
+
className: clsx('cim-icon', tone && fgTone(tone), UNSAFE_className),
|
|
11
|
+
style: UNSAFE_style,
|
|
12
|
+
width: size != null ? size + 'px' : '1em',
|
|
13
|
+
height: size != null ? size + 'px' : '1em',
|
|
14
|
+
};
|
|
15
|
+
return (_jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", "data-icon": "true", fill: "currentColor", ...props, children: _jsx("path", { fill: "currentColor", d: "m22 25.057-4.838-3.455a2 2 0 0 0-2.324 0L10 25.057V9a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1zM24 9a3 3 0 0 0-3-3H11a3 3 0 0 0-3 3v17.028c0 1.182 1.294 1.885 2.277 1.284l.095-.063L16 23.229l5.628 4.02.095.063c.983.601 2.277-.102 2.277-1.284z" }) }));
|
|
16
|
+
};
|
|
17
|
+
SvgBookmark.displayName = displayName;
|
|
18
|
+
export default SvgBookmark;
|
|
19
|
+
//# sourceMappingURL=bookmark.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bookmark.js","sourceRoot":"","sources":["../../../src/icons/bookmark.tsx"],"names":[],"mappings":";AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAChD,MAAM,WAAW,GAAG,cAAc,CAAC;AACnC,2BAA2B;AAC3B,MAAM,WAAW,GAAG,CAAC,EAAE,IAAI,EAAE,aAAa,EAAE,UAAU,EAAE,IAAI,EAAE,gBAAgB,EAAE,YAAY,EAAE,GAAG,IAAI,EAAa,EAAE,EAAE;IACpH,MAAM,KAAK,GAAG;QACZ,GAAG,IAAI;QACP,aAAa,EAAE,UAAU,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,IAAI,IAAI,IAAI,IAAI,CAAC,iBAAiB,CAAC,IAAI,IAAI,CAAC;QAC5F,SAAS,EAAE,IAAI,CAAC,UAAU,EAAE,IAAI,IAAI,MAAM,CAAC,IAAI,CAAC,EAAE,gBAAgB,CAAC;QACnE,KAAK,EAAE,YAAY;QACnB,KAAK,EAAE,IAAI,IAAI,IAAI,CAAC,CAAC,CAAC,IAAI,GAAG,IAAI,CAAC,CAAC,CAAC,KAAK;QACzC,MAAM,EAAE,IAAI,IAAI,IAAI,CAAC,CAAC,CAAC,IAAI,GAAG,IAAI,CAAC,CAAC,CAAC,KAAK;KAC3C,CAAC;IACF,OAAO,CACL,cAAK,KAAK,EAAC,4BAA4B,EAAC,OAAO,EAAC,WAAW,eAAW,MAAM,EAAC,IAAI,EAAC,cAAc,KAAK,KAAK,YACxG,eACE,IAAI,EAAC,cAAc,EACnB,CAAC,EAAC,yOAAyO,GAC3O,GACE,CACP,CAAC;AACJ,CAAC,CAAC;AACF,WAAW,CAAC,WAAW,GAAG,WAAW,CAAC;AACtC,eAAe,WAAW,CAAC","sourcesContent":["import clsx from 'clsx';\nimport type { IconProps } from '../components/types.js';\nimport { fgTone } from '../utils/style/tone.js';\nconst displayName = 'IconBookmark';\n/** Renders an SVG icon. */\nconst SvgBookmark = ({ size, 'aria-hidden': ariaHidden, tone, UNSAFE_className, UNSAFE_style, ...rest }: IconProps) => {\n const props = {\n ...rest,\n 'aria-hidden': ariaHidden ?? (rest['aria-label'] == null && rest['aria-labelledby'] == null),\n className: clsx('cim-icon', tone && fgTone(tone), UNSAFE_className),\n style: UNSAFE_style,\n width: size != null ? size + 'px' : '1em',\n height: size != null ? size + 'px' : '1em',\n };\n return (\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 32 32\" data-icon=\"true\" fill=\"currentColor\" {...props}>\n <path\n fill=\"currentColor\"\n d=\"m22 25.057-4.838-3.455a2 2 0 0 0-2.324 0L10 25.057V9a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1zM24 9a3 3 0 0 0-3-3H11a3 3 0 0 0-3 3v17.028c0 1.182 1.294 1.885 2.277 1.284l.095-.063L16 23.229l5.628 4.02.095.063c.983.601 2.277-.102 2.277-1.284z\"\n />\n </svg>\n );\n};\nSvgBookmark.displayName = displayName;\nexport default SvgBookmark;\n"]}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { IconProps } from '../components/types.js';
|
|
2
|
+
/** Renders an SVG icon. */
|
|
3
|
+
declare const SvgCarousel: {
|
|
4
|
+
({ size, "aria-hidden": ariaHidden, tone, UNSAFE_className, UNSAFE_style, ...rest }: IconProps): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
displayName: string;
|
|
6
|
+
};
|
|
7
|
+
export default SvgCarousel;
|
|
8
|
+
//# sourceMappingURL=carousel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"carousel.d.ts","sourceRoot":"","sources":["../../../src/icons/carousel.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAGxD,2BAA2B;AAC3B,QAAA,MAAM,WAAW;yFAAwF,SAAS;;CAiBjH,CAAC;AAEF,eAAe,WAAW,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import clsx from 'clsx';
|
|
3
|
+
import { fgTone } from '../utils/style/tone.js';
|
|
4
|
+
const displayName = 'IconCarousel';
|
|
5
|
+
/** Renders an SVG icon. */
|
|
6
|
+
const SvgCarousel = ({ size, 'aria-hidden': ariaHidden, tone, UNSAFE_className, UNSAFE_style, ...rest }) => {
|
|
7
|
+
const props = {
|
|
8
|
+
...rest,
|
|
9
|
+
'aria-hidden': ariaHidden ?? (rest['aria-label'] == null && rest['aria-labelledby'] == null),
|
|
10
|
+
className: clsx('cim-icon', tone && fgTone(tone), UNSAFE_className),
|
|
11
|
+
style: UNSAFE_style,
|
|
12
|
+
width: size != null ? size + 'px' : '1em',
|
|
13
|
+
height: size != null ? size + 'px' : '1em',
|
|
14
|
+
};
|
|
15
|
+
return (_jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", "data-icon": "true", fill: "currentColor", ...props, children: _jsx("path", { fill: "currentColor", d: "M21 24a1 1 0 0 1-1 1h-8a1 1 0 0 1-1-1V8a1 1 0 0 1 1-1h8a1 1 0 0 1 1 1zM5 11v10a1 1 0 0 1-1 1H3a1 1 0 1 0 0 2h1a3 3 0 0 0 3-3V11a3 3 0 0 0-3-3H3a1 1 0 0 0 0 2h1a1 1 0 0 1 1 1m20 0v10a3 3 0 0 0 3 3h1a1 1 0 1 0 0-2h-1a1 1 0 0 1-1-1V11a1 1 0 0 1 1-1h1a1 1 0 1 0 0-2h-1a3 3 0 0 0-3 3m-2-3a3 3 0 0 0-3-3h-8a3 3 0 0 0-3 3v16a3 3 0 0 0 3 3h8a3 3 0 0 0 3-3z" }) }));
|
|
16
|
+
};
|
|
17
|
+
SvgCarousel.displayName = displayName;
|
|
18
|
+
export default SvgCarousel;
|
|
19
|
+
//# sourceMappingURL=carousel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"carousel.js","sourceRoot":"","sources":["../../../src/icons/carousel.tsx"],"names":[],"mappings":";AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAChD,MAAM,WAAW,GAAG,cAAc,CAAC;AACnC,2BAA2B;AAC3B,MAAM,WAAW,GAAG,CAAC,EAAE,IAAI,EAAE,aAAa,EAAE,UAAU,EAAE,IAAI,EAAE,gBAAgB,EAAE,YAAY,EAAE,GAAG,IAAI,EAAa,EAAE,EAAE;IACpH,MAAM,KAAK,GAAG;QACZ,GAAG,IAAI;QACP,aAAa,EAAE,UAAU,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,IAAI,IAAI,IAAI,IAAI,CAAC,iBAAiB,CAAC,IAAI,IAAI,CAAC;QAC5F,SAAS,EAAE,IAAI,CAAC,UAAU,EAAE,IAAI,IAAI,MAAM,CAAC,IAAI,CAAC,EAAE,gBAAgB,CAAC;QACnE,KAAK,EAAE,YAAY;QACnB,KAAK,EAAE,IAAI,IAAI,IAAI,CAAC,CAAC,CAAC,IAAI,GAAG,IAAI,CAAC,CAAC,CAAC,KAAK;QACzC,MAAM,EAAE,IAAI,IAAI,IAAI,CAAC,CAAC,CAAC,IAAI,GAAG,IAAI,CAAC,CAAC,CAAC,KAAK;KAC3C,CAAC;IACF,OAAO,CACL,cAAK,KAAK,EAAC,4BAA4B,EAAC,OAAO,EAAC,WAAW,eAAW,MAAM,EAAC,IAAI,EAAC,cAAc,KAAK,KAAK,YACxG,eACE,IAAI,EAAC,cAAc,EACnB,CAAC,EAAC,8VAA8V,GAChW,GACE,CACP,CAAC;AACJ,CAAC,CAAC;AACF,WAAW,CAAC,WAAW,GAAG,WAAW,CAAC;AACtC,eAAe,WAAW,CAAC","sourcesContent":["import clsx from 'clsx';\nimport type { IconProps } from '../components/types.js';\nimport { fgTone } from '../utils/style/tone.js';\nconst displayName = 'IconCarousel';\n/** Renders an SVG icon. */\nconst SvgCarousel = ({ size, 'aria-hidden': ariaHidden, tone, UNSAFE_className, UNSAFE_style, ...rest }: IconProps) => {\n const props = {\n ...rest,\n 'aria-hidden': ariaHidden ?? (rest['aria-label'] == null && rest['aria-labelledby'] == null),\n className: clsx('cim-icon', tone && fgTone(tone), UNSAFE_className),\n style: UNSAFE_style,\n width: size != null ? size + 'px' : '1em',\n height: size != null ? size + 'px' : '1em',\n };\n return (\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 32 32\" data-icon=\"true\" fill=\"currentColor\" {...props}>\n <path\n fill=\"currentColor\"\n d=\"M21 24a1 1 0 0 1-1 1h-8a1 1 0 0 1-1-1V8a1 1 0 0 1 1-1h8a1 1 0 0 1 1 1zM5 11v10a1 1 0 0 1-1 1H3a1 1 0 1 0 0 2h1a3 3 0 0 0 3-3V11a3 3 0 0 0-3-3H3a1 1 0 0 0 0 2h1a1 1 0 0 1 1 1m20 0v10a3 3 0 0 0 3 3h1a1 1 0 1 0 0-2h-1a1 1 0 0 1-1-1V11a1 1 0 0 1 1-1h1a1 1 0 1 0 0-2h-1a3 3 0 0 0-3 3m-2-3a3 3 0 0 0-3-3h-8a3 3 0 0 0-3 3v16a3 3 0 0 0 3 3h8a3 3 0 0 0 3-3z\"\n />\n </svg>\n );\n};\nSvgCarousel.displayName = displayName;\nexport default SvgCarousel;\n"]}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { IconProps } from '../components/types.js';
|
|
2
|
+
/** Renders an SVG icon. */
|
|
3
|
+
declare const SvgCloudLinks: {
|
|
4
|
+
({ size, "aria-hidden": ariaHidden, tone, UNSAFE_className, UNSAFE_style, ...rest }: IconProps): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
displayName: string;
|
|
6
|
+
};
|
|
7
|
+
export default SvgCloudLinks;
|
|
8
|
+
//# sourceMappingURL=cloud-links.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cloud-links.d.ts","sourceRoot":"","sources":["../../../src/icons/cloud-links.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAGxD,2BAA2B;AAC3B,QAAA,MAAM,aAAa;yFAOhB,SAAS;;CAqBX,CAAC;AAEF,eAAe,aAAa,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import clsx from 'clsx';
|
|
3
|
+
import { fgTone } from '../utils/style/tone.js';
|
|
4
|
+
const displayName = 'IconCloudLinks';
|
|
5
|
+
/** Renders an SVG icon. */
|
|
6
|
+
const SvgCloudLinks = ({ size, 'aria-hidden': ariaHidden, tone, UNSAFE_className, UNSAFE_style, ...rest }) => {
|
|
7
|
+
const props = {
|
|
8
|
+
...rest,
|
|
9
|
+
'aria-hidden': ariaHidden ?? (rest['aria-label'] == null && rest['aria-labelledby'] == null),
|
|
10
|
+
className: clsx('cim-icon', tone && fgTone(tone), UNSAFE_className),
|
|
11
|
+
style: UNSAFE_style,
|
|
12
|
+
width: size != null ? size + 'px' : '1em',
|
|
13
|
+
height: size != null ? size + 'px' : '1em',
|
|
14
|
+
};
|
|
15
|
+
return (_jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", "data-icon": "true", fill: "currentColor", ...props, children: [_jsx("path", { fill: "currentColor", d: "M10 17v6H8.826A2.998 2.998 0 0 0 3 24a3 3 0 0 0 5.826 1H10a2 2 0 0 0 2-2v-6a1 1 0 1 0-2 0m-5 7a1 1 0 1 1 2 0 1 1 0 0 1-2 0m12 2a1 1 0 1 1-2 0 1 1 0 0 1 2 0m2 0a3 3 0 0 0-2-2.825V17a1 1 0 1 0-2 0v6.175A2.998 2.998 0 0 0 16 29a3 3 0 0 0 3-3m8-4a1 1 0 1 1-2 0 1 1 0 0 1 2 0m2 0a3 3 0 0 0-5.826-1H22v-3.5a1 1 0 1 0-2 0V21a2 2 0 0 0 2 2h1.174A2.998 2.998 0 0 0 29 22" }), _jsx("path", { fill: "currentColor", d: "M25 13.556C25 14.818 23.842 16 22.224 16H9.776C8.158 16 7 14.818 7 13.556c0-.813.49-1.631 1.377-2.094a1 1 0 0 0 .531-.998l-.023-.175-.015-.104-.003-.037C8.867 7.946 10.863 6 13.511 6c.843 0 1.665.21 2.376.599a4.5 4.5 0 0 1 1.636 1.51l.053.076a1 1 0 0 0 1.197.298q.484-.214.961-.212c1.271 0 2.147.921 2.153 1.868a1 1 0 0 0 .84 1.022c1.392.226 2.273 1.28 2.273 2.395m2 0c0-1.97-1.35-3.586-3.195-4.185-.392-1.82-2.133-3.1-4.07-3.1a4.2 4.2 0 0 0-.998.122 6.6 6.6 0 0 0-1.89-1.55A6.96 6.96 0 0 0 13.51 4c-3.542 0-6.584 2.622-6.642 6.049C5.726 10.868 5 12.146 5 13.556 5 16.092 7.23 18 9.776 18h12.448C24.77 18 27 16.092 27 13.556" })] }));
|
|
16
|
+
};
|
|
17
|
+
SvgCloudLinks.displayName = displayName;
|
|
18
|
+
export default SvgCloudLinks;
|
|
19
|
+
//# sourceMappingURL=cloud-links.js.map
|