themelia-react-ui 2.0.4 → 2.0.6
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/CHANGELOG.md +211 -0
- package/MIGRATION.md +119 -0
- package/README.md +122 -20
- package/dist/{accordion-96o0pN62.js → accordion-0tQUZ20r.js} +13 -13
- package/dist/accordion-0tQUZ20r.js.map +1 -0
- package/dist/{action-menu-CHgs8vmj.js → action-menu-C0gjzLyE.js} +48 -45
- package/dist/action-menu-C0gjzLyE.js.map +1 -0
- package/dist/{affordance-geometry.generated-B8yGOr8-.js → affordance-geometry.generated-P-aVJisu.js} +36 -36
- package/dist/affordance-geometry.generated-P-aVJisu.js.map +1 -0
- package/dist/{ai-artifact-BZUGwBq6.js → ai-artifact-CGGpQryR.js} +281 -230
- package/dist/ai-artifact-CGGpQryR.js.map +1 -0
- package/dist/app-shell-EHuuRDGy.js +321 -0
- package/dist/app-shell-EHuuRDGy.js.map +1 -0
- package/dist/{attachment-DkoqHPPl.js → attachment-BCpA4e7i.js} +10 -10
- package/dist/{attachment-DkoqHPPl.js.map → attachment-BCpA4e7i.js.map} +1 -1
- package/dist/{auth-D2FVZ1MH.js → auth-B0girIk_.js} +49 -52
- package/dist/auth-B0girIk_.js.map +1 -0
- package/dist/{avatar-DWO_HHhB.js → avatar-B9Jnp-T-.js} +8 -8
- package/dist/avatar-B9Jnp-T-.js.map +1 -0
- package/dist/{badge-DErMA7ul.js → badge-wWauMgAt.js} +5 -5
- package/dist/{badge-DErMA7ul.js.map → badge-wWauMgAt.js.map} +1 -1
- package/dist/base/accordion.js +1 -1
- package/dist/base/action-menu.js +1 -1
- package/dist/base/attachment.js +1 -1
- package/dist/base/avatar.js +1 -1
- package/dist/base/badge.js +1 -1
- package/dist/base/batch-action-bar.js +1 -1
- package/dist/base/buttons.js +1 -1
- package/dist/base/cards.js +2 -2
- package/dist/base/carousel.js +3 -3
- package/dist/base/cascader.js +2 -372
- package/dist/base/chart.js +1 -1
- package/dist/base/choice-inputs.js +2 -2
- package/dist/base/code-block.js +1 -1
- package/dist/base/combobox.js +2 -2
- package/dist/base/command.js +1 -1
- package/dist/base/copyable.js +1 -1
- package/dist/base/date-pickers.js +2 -2
- package/dist/base/display.js +6 -6
- package/dist/base/feedback.js +4 -4
- package/dist/base/forms-numeric.js +1 -1
- package/dist/base/forms.js +2 -2
- package/dist/base/inline-edit.js +10 -10
- package/dist/base/item.js +1 -1
- package/dist/base/media-gallery.js +1 -1
- package/dist/base/metadata-list.js +1 -1
- package/dist/base/navigation.js +7 -7
- package/dist/base/popover-menu.js +1 -1
- package/dist/base/popover.js +1 -1
- package/dist/base/qr-code.js +1 -1
- package/dist/base/repeaters.js +200 -193
- package/dist/base/repeaters.js.map +1 -1
- package/dist/base/sheet.js +1 -1
- package/dist/base/sidebar.js +2 -2
- package/dist/base/signature-pad.js +8 -8
- package/dist/base/signature-pad.js.map +1 -1
- package/dist/base/skeleton.js +1 -1
- package/dist/base/spinner.js +6 -6
- package/dist/base/spinner.js.map +1 -1
- package/dist/base/structure.js +1 -1
- package/dist/base/table.js +1 -1
- package/dist/base/text-inputs.js +2 -2
- package/dist/base/toaster.js +36 -36
- package/dist/base/toaster.js.map +1 -1
- package/dist/base/tree.js +1 -1
- package/dist/base/upload-queue.js +1 -1
- package/dist/base/upload.js +3 -3
- package/dist/base/value-inputs.js +1 -1
- package/dist/{batch-action-bar-CdfIkCsV.js → batch-action-bar-BoqWIIpV.js} +7 -7
- package/dist/batch-action-bar-BoqWIIpV.js.map +1 -0
- package/dist/blocks/admin.js +21 -21
- package/dist/blocks/admin.js.map +1 -1
- package/dist/blocks/ai.js +267 -247
- package/dist/blocks/ai.js.map +1 -1
- package/dist/blocks/analytics/usage-card.js +1 -1
- package/dist/blocks/analytics.js +537 -543
- package/dist/blocks/analytics.js.map +1 -1
- package/dist/blocks/collaboration.js +1 -1
- package/dist/blocks/commerce/receipt.js +1 -1
- package/dist/blocks/commerce.js +1330 -1250
- package/dist/blocks/commerce.js.map +1 -1
- package/dist/blocks/data-display.js +2 -2
- package/dist/blocks/onboarding.js +6 -6
- package/dist/blocks/onboarding.js.map +1 -1
- package/dist/blocks/planning.js +11 -11
- package/dist/blocks/timelines.js +1 -1
- package/dist/{breadcrumbs-B-WFKecD.js → breadcrumbs-Bp9Ke7kd.js} +7 -7
- package/dist/breadcrumbs-Bp9Ke7kd.js.map +1 -0
- package/dist/{button-DkmK-z8E.js → button-ChBovTx0.js} +3 -3
- package/dist/button-ChBovTx0.js.map +1 -0
- package/dist/{buttons-BbfzgczK.js → buttons-DeW0bQeK.js} +16 -16
- package/dist/buttons-DeW0bQeK.js.map +1 -0
- package/dist/cards-CNXnmvV5.js +69 -0
- package/dist/cards-CNXnmvV5.js.map +1 -0
- package/dist/cascader-CrAl9zD5.js +439 -0
- package/dist/cascader-CrAl9zD5.js.map +1 -0
- package/dist/chart-I7ROnsl8.js +162 -0
- package/dist/chart-I7ROnsl8.js.map +1 -0
- package/dist/{checkbox-CzYUTPeJ.js → checkbox-MoyHIAPs.js} +3 -3
- package/dist/{checkbox-CzYUTPeJ.js.map → checkbox-MoyHIAPs.js.map} +1 -1
- package/dist/choice-inputs-DHGtx0QV.js +789 -0
- package/dist/choice-inputs-DHGtx0QV.js.map +1 -0
- package/dist/{code-block-CGNaUtAE.js → code-block-BSJyq9e-.js} +9 -9
- package/dist/code-block-BSJyq9e-.js.map +1 -0
- package/dist/{collapsible-Do4G0zcC.js → collapsible-BzJ91LUG.js} +5 -5
- package/dist/{collapsible-Do4G0zcC.js.map → collapsible-BzJ91LUG.js.map} +1 -1
- package/dist/{collection-content-C0e8SsTm.js → collection-content-CSnwtOTH.js} +3 -3
- package/dist/{collection-content-C0e8SsTm.js.map → collection-content-CSnwtOTH.js.map} +1 -1
- package/dist/combobox-Bcvu5J8O.js +363 -0
- package/dist/combobox-Bcvu5J8O.js.map +1 -0
- package/dist/combobox-C2JiSQPc.js +915 -0
- package/dist/combobox-C2JiSQPc.js.map +1 -0
- package/dist/{command-D8NrBj-b.js → command-9e52NPgK.js} +11 -11
- package/dist/command-9e52NPgK.js.map +1 -0
- package/dist/{comments-Di4w0H_S.js → comments-BsgErEqd.js} +44 -39
- package/dist/comments-BsgErEqd.js.map +1 -0
- package/dist/components/base/action-menu/action-menu.d.ts +7 -1
- package/dist/components/base/buttons/button-group.recipes.d.ts +2 -2
- package/dist/components/base/cards/card.recipes.d.ts +6 -4
- package/dist/components/base/cards/partials/card-primitives.d.ts +9 -2
- package/dist/components/base/cards/partials/smart-card-header-row.d.ts +3 -1
- package/dist/components/base/cards/smart-card.types.d.ts +3 -4
- package/dist/components/base/cascader/cascader-panel.d.ts +76 -0
- package/dist/components/base/chart/chart.d.ts +6 -1
- package/dist/components/base/choice-inputs/choice-types.d.ts +5 -1
- package/dist/components/base/choice-inputs/pill-radio-group.d.ts +7 -6
- package/dist/components/base/combobox/combobox-field.d.ts +2 -2
- package/dist/components/base/combobox/index.d.ts +4 -2
- package/dist/components/base/date-pickers/date-picker-internals.d.ts +3 -1
- package/dist/components/base/date-pickers/datepicker.types.d.ts +10 -4
- package/dist/components/base/date-pickers/time-picker.d.ts +17 -3
- package/dist/components/base/feedback/alert.d.ts +1 -1
- package/dist/components/base/feedback/state-display.d.ts +5 -1
- package/dist/components/base/feedback/state-display.strings.d.ts +9 -0
- package/dist/components/base/forms/form-field.d.ts +7 -2
- package/dist/components/base/forms/form-sizing.d.ts +7 -7
- package/dist/components/base/forms/workflow.d.ts +7 -1
- package/dist/components/base/forms-numeric/coordinates-input.d.ts +8 -1
- package/dist/components/base/forms-numeric/decimal-input.d.ts +2 -2
- package/dist/components/base/forms-numeric/dimensions-input.d.ts +4 -1
- package/dist/components/base/forms-numeric/numeric-composite-field.d.ts +12 -0
- package/dist/components/base/forms-numeric/weight-input.d.ts +6 -1
- package/dist/components/base/metadata-list/metadata-list.d.ts +1 -1
- package/dist/components/base/navigation/dropdown-menu.d.ts +1 -1
- package/dist/components/base/navigation/language-switcher.d.ts +12 -4
- package/dist/components/base/navigation/page-header/page-header-commands.d.ts +14 -7
- package/dist/components/base/navigation/page-header/page-header.d.ts +10 -3
- package/dist/components/base/popover/popover.d.ts +3 -3
- package/dist/components/base/popover/popover.recipes.d.ts +10 -6
- package/dist/components/base/repeaters/key-value-editor.d.ts +2 -1
- package/dist/components/base/sheet/sheet.d.ts +2 -0
- package/dist/components/base/sidebar/index.d.ts +1 -1
- package/dist/components/base/sidebar/sidebar.d.ts +29 -5
- package/dist/components/base/toaster/index.d.ts +1 -0
- package/dist/components/base/upload/avatar-upload.d.ts +2 -1
- package/dist/components/base/upload/image-upload.d.ts +2 -1
- package/dist/components/blocks/ai/ai-citation/types.d.ts +2 -0
- package/dist/components/blocks/ai/ai-file-tree/types.d.ts +1 -1
- package/dist/components/blocks/ai/ai-reasoning/types.d.ts +2 -0
- package/dist/components/blocks/ai/ai-sources/types.d.ts +2 -0
- package/dist/components/blocks/ai/ai-tool-call/types.d.ts +5 -1
- package/dist/components/blocks/ai/ai.strings.d.ts +2 -0
- package/dist/components/blocks/analytics/metric/metric.d.ts +4 -0
- package/dist/components/blocks/analytics/metric-comparison/metric-comparison.d.ts +4 -0
- package/dist/components/blocks/analytics/metric-grid/metric-grid.d.ts +4 -5
- package/dist/components/blocks/analytics/types.d.ts +2 -2
- package/dist/components/blocks/analytics/usage-card/usage-card.strings.d.ts +2 -0
- package/dist/components/blocks/commerce/cart-summary/cart-summary.d.ts +1 -1
- package/dist/components/blocks/commerce/cart-summary/types.d.ts +3 -1
- package/dist/components/blocks/commerce/discount-stack/discount-stack.d.ts +1 -1
- package/dist/components/blocks/commerce/discount-stack/types.d.ts +3 -1
- package/dist/components/blocks/commerce/fulfillment-group/fulfillment-group.d.ts +1 -1
- package/dist/components/blocks/commerce/fulfillment-group/types.d.ts +11 -2
- package/dist/components/blocks/commerce/index.d.ts +7 -6
- package/dist/components/blocks/commerce/inventory-section/inventory-section.d.ts +1 -1
- package/dist/components/blocks/commerce/inventory-section/types.d.ts +7 -2
- package/dist/components/blocks/commerce/invoice-header/index.d.ts +2 -1
- package/dist/components/blocks/commerce/invoice-header/invoice-header.d.ts +1 -1
- package/dist/components/blocks/commerce/invoice-header/types.d.ts +20 -6
- package/dist/components/blocks/commerce/invoice-line-items/invoice-line-items.d.ts +1 -1
- package/dist/components/blocks/commerce/invoice-line-items/types.d.ts +24 -7
- package/dist/components/blocks/commerce/invoice-mini/index.d.ts +2 -1
- package/dist/components/blocks/commerce/invoice-mini/types.d.ts +7 -1
- package/dist/components/blocks/commerce/order-customer/order-customer.d.ts +1 -1
- package/dist/components/blocks/commerce/order-customer/types.d.ts +9 -1
- package/dist/components/blocks/commerce/order-status/types.d.ts +4 -0
- package/dist/components/blocks/commerce/refund-status/refund-status.d.ts +1 -1
- package/dist/components/blocks/commerce/refund-status/types.d.ts +3 -1
- package/dist/components/blocks/commerce/shipment-tracking/shipment-tracking.d.ts +1 -1
- package/dist/components/blocks/commerce/shipment-tracking/types.d.ts +3 -1
- package/dist/components/blocks/commerce/tax-breakdown/tax-breakdown.d.ts +1 -1
- package/dist/components/blocks/commerce/tax-breakdown/types.d.ts +3 -1
- package/dist/components/blocks/data-display/empty-state/empty-state.types.d.ts +4 -3
- package/dist/components/features/activities/activities.types.d.ts +26 -13
- package/dist/components/features/activities/hooks/use-activity-resources.d.ts +2 -1
- package/dist/components/features/activities/partials/activity-marker.d.ts +7 -3
- package/dist/components/features/activities/partials/activity-row.d.ts +24 -0
- package/dist/components/features/ai-chat/hooks/use-ai-chat-scroll.d.ts +1 -1
- package/dist/components/features/appointment-calendar/appointment-calendar.d.ts +1 -1
- package/dist/components/features/appointment-calendar/appointment-calendar.types.d.ts +4 -2
- package/dist/components/features/combobox/async-resource-combobox.d.ts +2 -2
- package/dist/components/features/combobox/combobox.d.ts +2 -2
- package/dist/components/features/combobox/hooks/use-combobox-core.d.ts +2 -1
- package/dist/components/features/combobox/hooks/use-combobox-state.d.ts +1 -0
- package/dist/components/features/combobox/hooks/use-load-more.d.ts +1 -0
- package/dist/components/features/combobox/types.d.ts +37 -8
- package/dist/components/features/email-composer/types.d.ts +3 -1
- package/dist/components/features/event-calendar/colors.d.ts +2 -2
- package/dist/components/features/event-calendar/event-calendar.types.d.ts +4 -0
- package/dist/components/features/filters/facets/date-facet.d.ts +4 -2
- package/dist/components/features/filters/facets/range-facet.d.ts +12 -0
- package/dist/components/features/filters/facets/select-facet.d.ts +2 -1
- package/dist/components/features/filters/filters.strings.d.ts +4 -0
- package/dist/components/features/filters/filters.types.d.ts +6 -3
- package/dist/components/features/filters/partials/date-filter-content.d.ts +3 -2
- package/dist/components/features/filters/partials/filter-editor-header.d.ts +16 -0
- package/dist/components/features/filters/partials/filter-popover-content.d.ts +5 -3
- package/dist/components/features/filters/partials/nested-filter-options.d.ts +21 -0
- package/dist/components/features/filters/partials/range-filter-content.d.ts +12 -0
- package/dist/components/features/filters/partials/regular-filter-content.d.ts +2 -1
- package/dist/components/features/filters/utils/filter-utils.d.ts +25 -3
- package/dist/components/features/global-search/global-search.types.d.ts +2 -0
- package/dist/components/features/global-search/partials/global-search-input.d.ts +10 -0
- package/dist/components/features/global-search/partials/global-search-result-row.d.ts +7 -1
- package/dist/components/features/media-library/hooks/use-media-library.d.ts +1 -1
- package/dist/components/features/media-library/media-library.d.ts +1 -1
- package/dist/components/features/media-library/media-library.strings.d.ts +8 -0
- package/dist/components/features/media-library/media-library.types.d.ts +50 -12
- package/dist/components/features/media-library/partials/media-library-partials.d.ts +4 -4
- package/dist/components/features/mentions/hooks/use-mentions.d.ts +16 -1
- package/dist/components/features/mentions/partials/mention-inline-suggestions.d.ts +5 -1
- package/dist/components/features/mentions/utils/split-html-by-mentions.d.ts +1 -7
- package/dist/components/features/overlays/hooks/use-overlay-visibility.d.ts +2 -2
- package/dist/components/features/products/components/product-options-matrix.d.ts +1 -1
- package/dist/components/features/products/components/product-variant-editor.d.ts +1 -1
- package/dist/components/features/products/components/product-variants-manager.d.ts +1 -1
- package/dist/components/features/products/products.strings.d.ts +9 -1
- package/dist/components/features/products/products.types.d.ts +45 -8
- package/dist/components/features/questionnaire/questionnaire.types.d.ts +3 -0
- package/dist/components/features/resource/resource.d.ts +6 -2
- package/dist/components/features/resource/resource.types.d.ts +14 -1
- package/dist/components/features/rich-text-editor/form-rich-text-editor.d.ts +1 -1
- package/dist/components/features/rich-text-editor/partials/caret-helpers.d.ts +1 -1
- package/dist/components/features/rich-text-editor/partials/editor-field-aria.d.ts +14 -0
- package/dist/components/features/rich-text-editor/partials/image-uploads.d.ts +1 -1
- package/dist/components/features/rich-text-editor/partials/rich-text-editor-toolbar.d.ts +3 -1
- package/dist/components/features/rich-text-editor/rich-text-editor.recipes.d.ts +12 -2
- package/dist/components/features/rich-text-editor/rich-text-editor.types.d.ts +17 -3
- package/dist/components/features/schema-form/hooks/use-schema-form.d.ts +5 -1
- package/dist/components/features/schema-form/partials/schema-form-field.d.ts +3 -1
- package/dist/components/features/schema-form/schema-form.utils.d.ts +1 -1
- package/dist/components/features/suggestions/suggestions.types.d.ts +1 -1
- package/dist/components/features/table/data-table.d.ts +1 -1
- package/dist/components/features/table/index.d.ts +1 -0
- package/dist/components/features/table/partials/resource-cell.d.ts +22 -5
- package/dist/components/features/table/table-body.d.ts +1 -1
- package/dist/components/features/table/table-helpers.d.ts +6 -3
- package/dist/components/features/table/table.strings.d.ts +3 -0
- package/dist/components/features/table/table.types.d.ts +18 -2
- package/dist/components/layout/app-shell/app-shell.types.d.ts +35 -6
- package/dist/components/layout/app-shell/index.d.ts +1 -1
- package/dist/components/layout/app-shell/shell-regions.d.ts +27 -0
- package/dist/components/layout/app-shell/sidebar-inset-layout.d.ts +1 -1
- package/dist/components/layout/app-shell/stacked-layout.d.ts +1 -1
- package/dist/components/layout/app-shell/topbar-sidebar-layout.d.ts +1 -1
- package/dist/components/layout/containers/two-column-layout.d.ts +2 -0
- package/dist/components/layout/header/header.recipes.d.ts +6 -0
- package/dist/components/layout/header/header.types.d.ts +9 -8
- package/dist/components/layout/layout.types.d.ts +5 -3
- package/dist/components/layout/navigation/section-nav/section-nav.d.ts +5 -0
- package/dist/components/layout/navigation/side-nav.d.ts +3 -2
- package/dist/components/layout/normalize-layout-path.d.ts +1 -0
- package/dist/components/layout/page/index.d.ts +2 -1
- package/dist/components/layout/page/page.d.ts +1 -0
- package/dist/components/layout/page/page.strings.d.ts +11 -0
- package/dist/components/layout/page/page.types.d.ts +69 -17
- package/dist/components/layout/page/partials/page-header.d.ts +1 -1
- package/dist/components/layout/settings/settings.d.ts +10 -3
- package/dist/components/layout/sidebar/app-sidebar.d.ts +1 -1
- package/dist/components/layout/sidebar/components/sidebar-grouped-navigation.d.ts +1 -1
- package/dist/components/layout/sidebar/components/sidebar-navigation.d.ts +1 -1
- package/dist/components/layout/sidebar/index.d.ts +2 -1
- package/dist/components/layout/sidebar/sidebar-navigation-rail.d.ts +38 -0
- package/dist/components/layout/sidebar/sidebar.context.d.ts +6 -7
- package/dist/components/layout/sidebar/sidebar.types.d.ts +50 -10
- package/dist/components/layout/sidebar/sidebar.utils.d.ts +9 -1
- package/dist/components/layout/workspace/workspace.types.d.ts +8 -1
- package/dist/components/primitives/link.d.ts +3 -2
- package/dist/components/primitives/money.d.ts +1 -1
- package/dist/components/primitives/number.d.ts +1 -1
- package/dist/components/typography/rich-text/rich-text-tree.d.ts +7 -5
- package/dist/components/ui/alert-dialog.d.ts +2 -2
- package/dist/components/ui/combobox.d.ts +1 -1
- package/dist/components/ui/dialog.d.ts +2 -2
- package/dist/components/ui/overlay-layer.d.ts +18 -0
- package/dist/components/ui/sheet.d.ts +5 -1
- package/dist/components/ui/sidebar-state.d.ts +82 -0
- package/dist/components/ui/sidebar.d.ts +5 -17
- package/dist/{containers-CRmHf7GP.js → containers-CSdc32h9.js} +26 -18
- package/dist/containers-CSdc32h9.js.map +1 -0
- package/dist/{control-group-recipes-DBXmfh2E.js → control-group-recipes-fMuFo0H7.js} +6 -6
- package/dist/control-group-recipes-fMuFo0H7.js.map +1 -0
- package/dist/{copyable-CnGCZdX4.js → copyable-3fdHfMR3.js} +7 -7
- package/dist/{copyable-CnGCZdX4.js.map → copyable-3fdHfMR3.js.map} +1 -1
- package/dist/{data-display-D4oujtx0.js → data-display-Cmj-xZYl.js} +271 -279
- package/dist/data-display-Cmj-xZYl.js.map +1 -0
- package/dist/{date-Q7jnXxpk.js → date-Br0FicVv.js} +5 -5
- package/dist/{date-Q7jnXxpk.js.map → date-Br0FicVv.js.map} +1 -1
- package/dist/date-picker-CyQlFYsP.js +1617 -0
- package/dist/date-picker-CyQlFYsP.js.map +1 -0
- package/dist/date-pickers-tj2MXmXd.js +185 -0
- package/dist/date-pickers-tj2MXmXd.js.map +1 -0
- package/dist/{display-BB4BL_-K.js → display-CT_N2a3w.js} +9 -9
- package/dist/{display-BB4BL_-K.js.map → display-CT_N2a3w.js.map} +1 -1
- package/dist/dropdown-menu-C08iIugv.js +194 -0
- package/dist/dropdown-menu-C08iIugv.js.map +1 -0
- package/dist/features/activities.js +388 -326
- package/dist/features/activities.js.map +1 -1
- package/dist/features/ai-chat.js +46 -32
- package/dist/features/ai-chat.js.map +1 -1
- package/dist/features/appointment-calendar.js +130 -130
- package/dist/features/appointment-calendar.js.map +1 -1
- package/dist/features/async-preview.js +11 -10
- package/dist/features/async-preview.js.map +1 -1
- package/dist/features/combobox.js +1 -1
- package/dist/features/comments.js +1 -1
- package/dist/features/data-view.js +13 -13
- package/dist/features/data-view.js.map +1 -1
- package/dist/features/email-composer.js +243 -239
- package/dist/features/email-composer.js.map +1 -1
- package/dist/features/event-calendar.js +197 -199
- package/dist/features/event-calendar.js.map +1 -1
- package/dist/features/filters.js +2 -2
- package/dist/features/global-search.js +168 -143
- package/dist/features/global-search.js.map +1 -1
- package/dist/features/kanban.js +19 -30
- package/dist/features/kanban.js.map +1 -1
- package/dist/features/map/style.css +15 -0
- package/dist/features/map.js +369 -343
- package/dist/features/map.js.map +1 -1
- package/dist/features/media-library.js +1202 -975
- package/dist/features/media-library.js.map +1 -1
- package/dist/features/mentions.js +2 -2
- package/dist/features/overlays.js +1 -1
- package/dist/features/products.js +1270 -1183
- package/dist/features/products.js.map +1 -1
- package/dist/features/questionnaire.js +160 -153
- package/dist/features/questionnaire.js.map +1 -1
- package/dist/features/resource-assignment.js +8 -8
- package/dist/features/resource.js +119 -113
- package/dist/features/resource.js.map +1 -1
- package/dist/features/rich-text-editor.js +28 -19
- package/dist/features/rich-text-editor.js.map +1 -1
- package/dist/features/schema-form.js +297 -256
- package/dist/features/schema-form.js.map +1 -1
- package/dist/features/suggestions.js +57 -50
- package/dist/features/suggestions.js.map +1 -1
- package/dist/features/sync.js +3 -3
- package/dist/features/table.js +1 -1
- package/dist/features/theme-tweaker.js +470 -470
- package/dist/features/theme-tweaker.js.map +1 -1
- package/dist/feedback-Dzo1xtAU.js +246 -0
- package/dist/feedback-Dzo1xtAU.js.map +1 -0
- package/dist/{field-affordance-recipes-DjwGx8eM.js → field-affordance-recipes-D6H7tVJi.js} +5 -5
- package/dist/field-affordance-recipes-D6H7tVJi.js.map +1 -0
- package/dist/field-control-attributes-B6i335wr.js +18 -0
- package/dist/field-control-attributes-B6i335wr.js.map +1 -0
- package/dist/{field-state-recipes-BVA2CWHo.js → field-state-recipes-7sza8QbC.js} +4 -2
- package/dist/{field-state-recipes-BVA2CWHo.js.map → field-state-recipes-7sza8QbC.js.map} +1 -1
- package/dist/filters-Dl80yYtN.js +2415 -0
- package/dist/filters-Dl80yYtN.js.map +1 -0
- package/dist/form-field-CAPdwdnZ.js +74 -0
- package/dist/form-field-CAPdwdnZ.js.map +1 -0
- package/dist/{form-sizing-NXgjkmBG.js → form-sizing-CgcrUbLU.js} +5 -5
- package/dist/form-sizing-CgcrUbLU.js.map +1 -0
- package/dist/{forms-BV5m5aQF.js → forms-B3W8CH7-.js} +17 -13
- package/dist/forms-B3W8CH7-.js.map +1 -0
- package/dist/forms-numeric-CwjQJe-O.js +991 -0
- package/dist/forms-numeric-CwjQJe-O.js.map +1 -0
- package/dist/{header-BA697l4a.js → header-ZIIsRKxP.js} +145 -141
- package/dist/header-ZIIsRKxP.js.map +1 -0
- package/dist/header.recipes-BigdJjw1.js +6 -0
- package/dist/header.recipes-BigdJjw1.js.map +1 -0
- package/dist/hooks/use-files.d.ts +2 -0
- package/dist/{hooks-BQ-L7Uu2.js → hooks-BitHSh-Y.js} +27 -15
- package/dist/hooks-BitHSh-Y.js.map +1 -0
- package/dist/{icon-badge-COWbCCWu.js → icon-badge-npxF1SLX.js} +4 -4
- package/dist/{icon-badge-COWbCCWu.js.map → icon-badge-npxF1SLX.js.map} +1 -1
- package/dist/index.js +4 -5
- package/dist/{input-Cdw4k0fb.js → input-7KAc7XQL.js} +9 -9
- package/dist/{input-Cdw4k0fb.js.map → input-7KAc7XQL.js.map} +1 -1
- package/dist/input-DIREVYHs.js +21 -0
- package/dist/input-DIREVYHs.js.map +1 -0
- package/dist/{interaction-recipes-XR9ZpVYL.js → interaction-recipes-4wZ2tvfb.js} +2 -2
- package/dist/{interaction-recipes-XR9ZpVYL.js.map → interaction-recipes-4wZ2tvfb.js.map} +1 -1
- package/dist/item-FfWnaYST.js +278 -0
- package/dist/item-FfWnaYST.js.map +1 -0
- package/dist/layout/app-shell.js +1 -1
- package/dist/layout/auth.js +1 -1
- package/dist/layout/containers.js +1 -1
- package/dist/layout/header.js +1 -1
- package/dist/layout/hooks.js +1 -1
- package/dist/layout/navigation.js +1 -1
- package/dist/layout/page.js +2 -2
- package/dist/layout/settings.js +1 -1
- package/dist/layout/sidebar.js +3 -3
- package/dist/layout/workspace.js +1 -1
- package/dist/layout.js +12 -12
- package/dist/layout.types-E_GAApzO.js +30 -0
- package/dist/layout.types-E_GAApzO.js.map +1 -0
- package/dist/lib/affordance-geometry.generated.d.ts +35 -35
- package/dist/lib/control-group-recipes.d.ts +5 -5
- package/dist/lib/field-affordance-recipes.d.ts +2 -2
- package/dist/lib/field-control-attributes.d.ts +11 -0
- package/dist/lib/field-state-recipes.d.ts +2 -0
- package/dist/lib/format.d.ts +1 -0
- package/dist/lib/motion-recipes.d.ts +3 -0
- package/dist/lib/navigation-row-recipes.d.ts +7 -7
- package/dist/lib/overlay-anatomy-recipes.d.ts +3 -3
- package/dist/lib/portal-recipes.d.ts +3 -0
- package/dist/lib/surface-recipes.d.ts +1 -1
- package/dist/lib/token-merge.generated.d.ts +18 -15
- package/dist/lib/utils.js +1 -1
- package/dist/map-demo-tile.svg +1 -1
- package/dist/{media-gallery-CSl5W1Fy.js → media-gallery-C81DAnKI.js} +6 -6
- package/dist/{media-gallery-CSl5W1Fy.js.map → media-gallery-C81DAnKI.js.map} +1 -1
- package/dist/{mentions-RKOQaaIB.js → mentions-qOnedSt4.js} +237 -168
- package/dist/mentions-qOnedSt4.js.map +1 -0
- package/dist/message-BJHnn43M.js +135 -0
- package/dist/message-BJHnn43M.js.map +1 -0
- package/dist/{metadata-list-qVV7AVxa.js → metadata-list-XkqZ_UXH.js} +64 -64
- package/dist/metadata-list-XkqZ_UXH.js.map +1 -0
- package/dist/{motion-recipes-ChBg4HBq.js → motion-recipes-DitYv6P2.js} +10 -2
- package/dist/motion-recipes-DitYv6P2.js.map +1 -0
- package/dist/navigation-BgtPJAhi.js +288 -0
- package/dist/navigation-BgtPJAhi.js.map +1 -0
- package/dist/navigation-Bt-v7rWP.js +261 -0
- package/dist/navigation-Bt-v7rWP.js.map +1 -0
- package/dist/{navigation-row-recipes-WZEs-hYo.js → navigation-row-recipes-BGVLvU_O.js} +9 -9
- package/dist/navigation-row-recipes-BGVLvU_O.js.map +1 -0
- package/dist/normalize-layout-path-BmEgg6fu.js +14 -0
- package/dist/normalize-layout-path-BmEgg6fu.js.map +1 -0
- package/dist/{number-E_OiIfJz.js → number-CYqBcrSj.js} +79 -87
- package/dist/number-CYqBcrSj.js.map +1 -0
- package/dist/overflow-tab-bar-BQCA2Zn2.js +172 -0
- package/dist/overflow-tab-bar-BQCA2Zn2.js.map +1 -0
- package/dist/overlays-CC8zI3Du.js +1017 -0
- package/dist/overlays-CC8zI3Du.js.map +1 -0
- package/dist/page-BoQ1VaFJ.js +331 -0
- package/dist/page-BoQ1VaFJ.js.map +1 -0
- package/dist/page-header-commands-DIKspJfx.js +193 -0
- package/dist/page-header-commands-DIKspJfx.js.map +1 -0
- package/dist/{pagination-Ch8X_47u.js → pagination-Br8TdV9A.js} +7 -7
- package/dist/{pagination-Ch8X_47u.js.map → pagination-Br8TdV9A.js.map} +1 -1
- package/dist/popover-k8TdUcAt.js +201 -0
- package/dist/popover-k8TdUcAt.js.map +1 -0
- package/dist/{popover-menu-BYaCdFhf.js → popover-menu-yn-o0kyA.js} +7 -7
- package/dist/{popover-menu-BYaCdFhf.js.map → popover-menu-yn-o0kyA.js.map} +1 -1
- package/dist/{popover.recipes-D3j8R8Yp.js → popover.recipes-DJ0AkUan.js} +19 -12
- package/dist/popover.recipes-DJ0AkUan.js.map +1 -0
- package/dist/portal-recipes-DyUXqUtD.js +9 -0
- package/dist/portal-recipes-DyUXqUtD.js.map +1 -0
- package/dist/{primitives-Du64iDbb.js → primitives-BkkQjYl7.js} +23 -18
- package/dist/primitives-BkkQjYl7.js.map +1 -0
- package/dist/primitives.js +4 -4
- package/dist/{progress-BvF2oCdV.js → progress-DZFXXzPs.js} +9 -9
- package/dist/{progress-BvF2oCdV.js.map → progress-DZFXXzPs.js.map} +1 -1
- package/dist/{receipt-D789Jwyy.js → receipt-C7LhOg7Q.js} +7 -7
- package/dist/receipt-C7LhOg7Q.js.map +1 -0
- package/dist/rich-text-BnTzZjIo.js +45 -0
- package/dist/rich-text-BnTzZjIo.js.map +1 -0
- package/dist/{rich-text-editor-Cm1dpUpQ.js → rich-text-editor-CAurDwT5.js} +501 -424
- package/dist/rich-text-editor-CAurDwT5.js.map +1 -0
- package/dist/rich-text-editor-toolbar-DbXig7Jk.js +99 -0
- package/dist/rich-text-editor-toolbar-DbXig7Jk.js.map +1 -0
- package/dist/rich-text-tree-BqyQ_7-R.js +66 -0
- package/dist/rich-text-tree-BqyQ_7-R.js.map +1 -0
- package/dist/{sanitize-html-DsQmI48u.js → sanitize-html-BWkH4dLM.js} +29 -16
- package/dist/sanitize-html-BWkH4dLM.js.map +1 -0
- package/dist/{scroll-area-La5RXsEk.js → scroll-area-Bj6CRUif.js} +2 -2
- package/dist/{scroll-area-La5RXsEk.js.map → scroll-area-Bj6CRUif.js.map} +1 -1
- package/dist/{separator-DAEV0w65.js → separator-B9ewiCGO.js} +2 -2
- package/dist/{separator-DAEV0w65.js.map → separator-B9ewiCGO.js.map} +1 -1
- package/dist/{separator-GNfPG-90.js → separator-DM6gs2vu.js} +3 -3
- package/dist/{separator-GNfPG-90.js.map → separator-DM6gs2vu.js.map} +1 -1
- package/dist/services/actions.js +1 -1
- package/dist/settings-DZPHgpx4.js +155 -0
- package/dist/settings-DZPHgpx4.js.map +1 -0
- package/dist/sheet-C4DHsgLk.js +250 -0
- package/dist/sheet-C4DHsgLk.js.map +1 -0
- package/dist/sidebar-C8BnDwTH.js +709 -0
- package/dist/sidebar-C8BnDwTH.js.map +1 -0
- package/dist/sidebar-CmD6a-HK.js +1004 -0
- package/dist/sidebar-CmD6a-HK.js.map +1 -0
- package/dist/skeleton-DDgdhmu9.js +265 -0
- package/dist/skeleton-DDgdhmu9.js.map +1 -0
- package/dist/smart-card-B6vLxqa_.js +617 -0
- package/dist/smart-card-B6vLxqa_.js.map +1 -0
- package/dist/{structure-C0V0_Fyf.js → structure-DZJ2wbAU.js} +2 -2
- package/dist/{structure-C0V0_Fyf.js.map → structure-DZJ2wbAU.js.map} +1 -1
- package/dist/style.css +1 -1
- package/dist/{surface-recipes-BKRVW8Os.js → surface-recipes-C8mNycaY.js} +2 -2
- package/dist/{surface-recipes-BKRVW8Os.js.map → surface-recipes-C8mNycaY.js.map} +1 -1
- package/dist/{table-DH7rozUv.js → table-CBonSdTp.js} +573 -519
- package/dist/table-CBonSdTp.js.map +1 -0
- package/dist/{table-CpvnzJn9.js → table-CXSPHH25.js} +75 -71
- package/dist/table-CXSPHH25.js.map +1 -0
- package/dist/tabs-C4Kr_hCr.js +192 -0
- package/dist/tabs-C4Kr_hCr.js.map +1 -0
- package/dist/{text-inputs-DXItiR0O.js → text-inputs-jdkS3ReG.js} +18 -18
- package/dist/text-inputs-jdkS3ReG.js.map +1 -0
- package/dist/theme.css +40 -37
- package/dist/{timelines-DmtztAY_.js → timelines-CoPwdJP0.js} +13 -12
- package/dist/timelines-CoPwdJP0.js.map +1 -0
- package/dist/tooltip-31NwIpTo.js +113 -0
- package/dist/tooltip-31NwIpTo.js.map +1 -0
- package/dist/{tree-CV11PURP.js → tree-CeYVzdFE.js} +9 -9
- package/dist/{tree-CV11PURP.js.map → tree-CeYVzdFE.js.map} +1 -1
- package/dist/typography/rich-text.js +1 -1
- package/dist/{typography-CSyJrh28.js → typography-C7-YMW1S.js} +12 -12
- package/dist/{typography-CSyJrh28.js.map → typography-C7-YMW1S.js.map} +1 -1
- package/dist/typography.js +1 -1
- package/dist/ui-provider-C-74NVLc.js +178 -0
- package/dist/ui-provider-C-74NVLc.js.map +1 -0
- package/dist/ui-provider.js +2 -3
- package/dist/{upload-C9SA0X-8.js → upload-Hdm5gObf.js} +309 -296
- package/dist/upload-Hdm5gObf.js.map +1 -0
- package/dist/{upload-queue-DhQJiSRc.js → upload-queue-D0sYPuqo.js} +16 -14
- package/dist/upload-queue-D0sYPuqo.js.map +1 -0
- package/dist/{usage-card-DVTRDmGz.js → usage-card-9s8hLDfn.js} +24 -17
- package/dist/usage-card-9s8hLDfn.js.map +1 -0
- package/dist/{utils-CF3c95Io.js → utils-DhuoqFy4.js} +255 -165
- package/dist/utils-DhuoqFy4.js.map +1 -0
- package/dist/value-inputs-D3aPgq9H.js +980 -0
- package/dist/value-inputs-D3aPgq9H.js.map +1 -0
- package/dist/{value-typography-ClupF0Gz.js → value-typography-uSzzG9Gf.js} +32 -26
- package/dist/value-typography-uSzzG9Gf.js.map +1 -0
- package/dist/{workspace-9EFVXUyk.js → workspace-CC8Vchiu.js} +51 -50
- package/dist/workspace-CC8Vchiu.js.map +1 -0
- package/docs/consumer-skill/SKILL.md +4 -3
- package/docs/consumer-skill/agents/themelia-ui-designer.md +96 -0
- package/docs/consumer-skill/examples/app-layout.tsx +52 -1
- package/docs/consumer-skill/examples/commerce-lines.tsx +271 -0
- package/docs/consumer-skill/examples/custom-composition.tsx +21 -0
- package/docs/consumer-skill/examples/detail.tsx +5 -4
- package/docs/consumer-skill/examples/edit.tsx +3 -3
- package/docs/consumer-skill/examples/editable-sections.tsx +38 -0
- package/docs/consumer-skill/examples/index-table.tsx +4 -4
- package/docs/consumer-skill/examples/manifest.json +38 -1
- package/docs/consumer-skill/examples/product-media.tsx +41 -0
- package/docs/consumer-skill/examples/product-parts.tsx +81 -0
- package/docs/consumer-skill/examples/rhf-edit-page.tsx +1 -1
- package/docs/consumer-skill/examples/rhf-overlay-form.tsx +24 -11
- package/docs/consumer-skill/examples/token-domain-structure.tsx +68 -0
- package/docs/consumer-skill/references/agents-md.md +21 -19
- package/docs/consumer-skill/references/analytics.md +33 -1
- package/docs/consumer-skill/references/commerce-composition.md +97 -0
- package/docs/consumer-skill/references/component-contracts.json +21249 -14205
- package/docs/consumer-skill/references/composition-mapping.md +17 -3
- package/docs/consumer-skill/references/composition.md +177 -32
- package/docs/consumer-skill/references/critique-rubric.md +98 -0
- package/docs/consumer-skill/references/custom-composition.md +261 -0
- package/docs/consumer-skill/references/data-reading.md +79 -0
- package/docs/consumer-skill/references/design-contract.md +12 -9
- package/docs/consumer-skill/references/discovery.md +27 -3
- package/docs/consumer-skill/references/domain-structures.md +124 -0
- package/docs/consumer-skill/references/installation.md +62 -8
- package/docs/consumer-skill/references/integration.md +59 -1
- package/docs/consumer-skill/references/product-composition.md +94 -0
- package/docs/consumer-skill/references/public-api.json +3044 -445
- package/docs/consumer-skill/references/review.md +87 -10
- package/docs/consumer-skill/references/rhf-workflows.md +79 -0
- package/docs/consumer-skill/references/screen-archetypes.md +19 -7
- package/docs/consumer-skill/references/screen-decisions.md +126 -0
- package/docs/consumer-skill/references/theming.md +24 -20
- package/docs/consumer-skill/references/tokens.json +9 -9
- package/docs/consumer-skill/references/view-craft.md +153 -0
- package/docs/consumer-skill/references/view-spec.md +73 -0
- package/docs/consumer-skill/references/workflows.md +7 -1
- package/docs/consumer-skill/scripts/composition-policy.mjs +176 -26
- package/docs/consumer-skill/scripts/composition-schema.mjs +1 -1
- package/docs/consumer-skill/scripts/composition.mjs +61 -5
- package/docs/consumer-skill/scripts/discovery.mjs +54 -0
- package/docs/consumer-skill/scripts/inspect-component.mjs +1 -1
- package/docs/consumer-skill/scripts/inspection.mjs +73 -18
- package/docs/consumer-skill/scripts/setup-skills.mjs +79 -7
- package/docs/consumer-skill/scripts/surface-policy.mjs +5 -5
- package/docs/consumer-skills/themelia-components/SKILL.md +14 -13
- package/docs/consumer-skills/themelia-composition/SKILL.md +16 -17
- package/docs/consumer-skills/themelia-design/SKILL.md +55 -0
- package/docs/consumer-skills/themelia-foundation/SKILL.md +2 -1
- package/docs/consumer-skills/themelia-tokenization/SKILL.md +24 -17
- package/package.json +4 -2
- package/templates/admin-shell-template.tsx +1 -2
- package/templates/customers-template.tsx +18 -16
- package/dist/accordion-96o0pN62.js.map +0 -1
- package/dist/action-menu-CHgs8vmj.js.map +0 -1
- package/dist/affordance-geometry.generated-B8yGOr8-.js.map +0 -1
- package/dist/ai-artifact-BZUGwBq6.js.map +0 -1
- package/dist/app-shell-D63ATkIK.js +0 -237
- package/dist/app-shell-D63ATkIK.js.map +0 -1
- package/dist/auth-D2FVZ1MH.js.map +0 -1
- package/dist/avatar-DWO_HHhB.js.map +0 -1
- package/dist/base/cascader.js.map +0 -1
- package/dist/batch-action-bar-CdfIkCsV.js.map +0 -1
- package/dist/breadcrumbs-B-WFKecD.js.map +0 -1
- package/dist/button-DkmK-z8E.js.map +0 -1
- package/dist/buttons-BbfzgczK.js.map +0 -1
- package/dist/cards-4JTWqvVe.js +0 -68
- package/dist/cards-4JTWqvVe.js.map +0 -1
- package/dist/chart-C19flDQb.js +0 -155
- package/dist/chart-C19flDQb.js.map +0 -1
- package/dist/choice-inputs-JLtij2y4.js +0 -776
- package/dist/choice-inputs-JLtij2y4.js.map +0 -1
- package/dist/code-block-CGNaUtAE.js.map +0 -1
- package/dist/combobox-CBJDs6w_.js +0 -877
- package/dist/combobox-CBJDs6w_.js.map +0 -1
- package/dist/combobox-hbhSS18O.js +0 -355
- package/dist/combobox-hbhSS18O.js.map +0 -1
- package/dist/command-D8NrBj-b.js.map +0 -1
- package/dist/comments-Di4w0H_S.js.map +0 -1
- package/dist/containers-CRmHf7GP.js.map +0 -1
- package/dist/control-group-recipes-DBXmfh2E.js.map +0 -1
- package/dist/data-display-D4oujtx0.js.map +0 -1
- package/dist/date-picker-zOt1oNss.js +0 -1542
- package/dist/date-picker-zOt1oNss.js.map +0 -1
- package/dist/date-pickers-cj8IXbDC.js +0 -179
- package/dist/date-pickers-cj8IXbDC.js.map +0 -1
- package/dist/dropdown-menu-CjY8Vt7W.js +0 -193
- package/dist/dropdown-menu-CjY8Vt7W.js.map +0 -1
- package/dist/feedback-DZNL5Lg1.js +0 -239
- package/dist/feedback-DZNL5Lg1.js.map +0 -1
- package/dist/field-affordance-recipes-DjwGx8eM.js.map +0 -1
- package/dist/filters-BcT-uoFy.js +0 -2209
- package/dist/filters-BcT-uoFy.js.map +0 -1
- package/dist/form-field-CsgRmdit.js +0 -63
- package/dist/form-field-CsgRmdit.js.map +0 -1
- package/dist/form-sizing-NXgjkmBG.js.map +0 -1
- package/dist/forms-BV5m5aQF.js.map +0 -1
- package/dist/forms-numeric-Cd33AKbD.js +0 -906
- package/dist/forms-numeric-Cd33AKbD.js.map +0 -1
- package/dist/header-BA697l4a.js.map +0 -1
- package/dist/hooks-BQ-L7Uu2.js.map +0 -1
- package/dist/input-DOPL5_QE.js +0 -21
- package/dist/input-DOPL5_QE.js.map +0 -1
- package/dist/item-BvZ2DR_x.js +0 -277
- package/dist/item-BvZ2DR_x.js.map +0 -1
- package/dist/layout.types-Cn7aUzJp.js +0 -20
- package/dist/layout.types-Cn7aUzJp.js.map +0 -1
- package/dist/mentions-RKOQaaIB.js.map +0 -1
- package/dist/message-INU2xsxu.js +0 -128
- package/dist/message-INU2xsxu.js.map +0 -1
- package/dist/metadata-list-qVV7AVxa.js.map +0 -1
- package/dist/motion-recipes-ChBg4HBq.js.map +0 -1
- package/dist/navigation-BQNcg1jT.js +0 -269
- package/dist/navigation-BQNcg1jT.js.map +0 -1
- package/dist/navigation-DLF3E1IC.js +0 -145
- package/dist/navigation-DLF3E1IC.js.map +0 -1
- package/dist/navigation-row-recipes-WZEs-hYo.js.map +0 -1
- package/dist/number-E_OiIfJz.js.map +0 -1
- package/dist/overflow-tab-bar-CrbqMteP.js +0 -284
- package/dist/overflow-tab-bar-CrbqMteP.js.map +0 -1
- package/dist/overlays-BlKynmde.js +0 -1004
- package/dist/overlays-BlKynmde.js.map +0 -1
- package/dist/page-CIwNUtGr.js +0 -227
- package/dist/page-CIwNUtGr.js.map +0 -1
- package/dist/page-header-commands-DFMlNYzN.js +0 -128
- package/dist/page-header-commands-DFMlNYzN.js.map +0 -1
- package/dist/popover-uwzX2vo7.js +0 -198
- package/dist/popover-uwzX2vo7.js.map +0 -1
- package/dist/popover.recipes-D3j8R8Yp.js.map +0 -1
- package/dist/primitives-Du64iDbb.js.map +0 -1
- package/dist/receipt-D789Jwyy.js.map +0 -1
- package/dist/rich-text-CLJEf76s.js +0 -78
- package/dist/rich-text-CLJEf76s.js.map +0 -1
- package/dist/rich-text-editor-Cm1dpUpQ.js.map +0 -1
- package/dist/rich-text-editor-toolbar-L__e4x47.js +0 -94
- package/dist/rich-text-editor-toolbar-L__e4x47.js.map +0 -1
- package/dist/safe-image-src-C6kQSMBZ.js +0 -17
- package/dist/safe-image-src-C6kQSMBZ.js.map +0 -1
- package/dist/sanitize-html-DsQmI48u.js.map +0 -1
- package/dist/settings-BA2iboic.js +0 -174
- package/dist/settings-BA2iboic.js.map +0 -1
- package/dist/sheet-DoAxTb2J.js +0 -213
- package/dist/sheet-DoAxTb2J.js.map +0 -1
- package/dist/sidebar-ByqKR_W5.js +0 -512
- package/dist/sidebar-ByqKR_W5.js.map +0 -1
- package/dist/sidebar-D2iSnGJ7.js +0 -619
- package/dist/sidebar-D2iSnGJ7.js.map +0 -1
- package/dist/skeleton-CUj8O5Bd.js +0 -264
- package/dist/skeleton-CUj8O5Bd.js.map +0 -1
- package/dist/smart-card-CqkzQsK-.js +0 -614
- package/dist/smart-card-CqkzQsK-.js.map +0 -1
- package/dist/table-CpvnzJn9.js.map +0 -1
- package/dist/table-DH7rozUv.js.map +0 -1
- package/dist/tabs-eqVsJZWO.js +0 -191
- package/dist/tabs-eqVsJZWO.js.map +0 -1
- package/dist/text-inputs-DXItiR0O.js.map +0 -1
- package/dist/theme-scope-BJ6eE2xt.js +0 -50
- package/dist/theme-scope-BJ6eE2xt.js.map +0 -1
- package/dist/timelines-DmtztAY_.js.map +0 -1
- package/dist/tooltip-B4hjKtoV.js +0 -111
- package/dist/tooltip-B4hjKtoV.js.map +0 -1
- package/dist/ui-provider-CQCuCBcy.js +0 -136
- package/dist/ui-provider-CQCuCBcy.js.map +0 -1
- package/dist/upload-C9SA0X-8.js.map +0 -1
- package/dist/upload-queue-DhQJiSRc.js.map +0 -1
- package/dist/usage-card-DVTRDmGz.js.map +0 -1
- package/dist/use-mobile-vaLKwgyf.js +0 -15
- package/dist/use-mobile-vaLKwgyf.js.map +0 -1
- package/dist/utils-CF3c95Io.js.map +0 -1
- package/dist/value-inputs-C0o70p-U.js +0 -980
- package/dist/value-inputs-C0o70p-U.js.map +0 -1
- package/dist/value-typography-ClupF0Gz.js.map +0 -1
- package/dist/workspace-9EFVXUyk.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"primitives-BkkQjYl7.js","names":["_Fragment","useFormattingConfig","useTypographyConfig","cn","Text","RunningTextContext","inlineLinkClassName","useInRunningText","resolveTextClassNames","useValueTypography","formatDuration","formatWithMinusSign","emptyValueTypography","formatInitials","Fragment$1","VALUE_ROLE","SECONDARY_ROLE","MONO_ROLE","isEmptyValue","children","ValueText","props","resolved","valueRole","empty","typography","weight","numeric","hookClassName","className","emptyLabel","Value","SecondaryValue","MutedValue","MonoValue","EmptyValue","WORD_SEPARATOR","NAME_CONNECTOR","LETTER_MATCHER","LETTERS_MATCHER","normalizeNameWhitespace","value","getLetters","getFirstLetter","match","isFormattedSegment","first","segment","letters","isAllUpper","isAllLower","isFormattedName","word","formatNameSegment","before","after","formatNameWord","formatName","normalized","options","Name","rawValue","content","Initials","Link","inText","EmptyLinkValue","defaultTextSize","linkUnderlineClassName","_href","_target","_rel","_download","_hrefLang","_ping","_referrerPolicy","_media","_type","spanProps","linkProps","Email","query","subject","body","href","display","normalizeTel","Phone","normalizeUrl","Url","isExternal","external","resolvedTarget","target","resolvedRel","rel","FILE_SIZE_ROLE","FILE_SIZE_UNITS","FILE_SIZE_UNIT_MULTIPLIER","normalizeFileSizeValue","from","formatFileSize","locale","bytes","displayValue","unitIndex","FileSize","formatting","label","DURATION_ROLE","Duration","maximumFractionDigits","DIMENSIONS_ROLE","parseDimensionPart","parsed","formatDimensions","parsedWidth","width","parsedHeight","height","parsedDepth","depth","formatter","values","separator","unit","Dimensions","index","part"],"sources":["../src/components/primitives/value.tsx","../src/components/primitives/name.tsx","../src/components/primitives/initials.tsx","../src/components/primitives/link.tsx","../src/components/primitives/file-size.tsx","../src/components/primitives/duration.tsx","../src/components/primitives/dimensions.tsx"],"sourcesContent":["import { type ComponentPropsWithoutRef, type ReactNode, type Ref } from 'react';\n\nimport { Text, type TextProps } from '../typography';\nimport type { TextSize } from '../../lib/ui-provider';\nimport { EMPTY } from '../../lib/format';\nimport { cn } from '../../lib/utils';\n\nimport { emptyValueTypography, useValueTypography, type ValueTypographyRole } from './value-typography';\n\ntype SpanProps = Omit<ComponentPropsWithoutRef<'span'>, 'children' | 'color'>;\n/** Value colour roles: foreground, secondary, or the surrounding text colour. */\nexport type ValueType = Extract<TextProps['type'], 'main' | 'secondary' | 'inherit'>;\n\nexport interface ValueProps extends SpanProps {\n\tchildren?: ReactNode;\n\t/** Rendered with the shared empty treatment when children are absent. Defaults to an em dash. */\n\temptyLabel?: ReactNode;\n\t/**\n\t * Text size. A standalone value uses the provider text size; inside running\n\t * text (`Text`, `Heading`, labels, links, other values) it inherits the size.\n\t */\n\tsize?: TextSize;\n\talign?: TextProps['align'];\n\t/** Font weight. Defaults to the component's role weight; inside running text, the surrounding weight. */\n\tweight?: TextProps['weight'];\n\t/** Colour role. Defaults to the component's role; inside running text `Value` and `MonoValue` take the surrounding colour. */\n\ttype?: ValueType;\n\t/** Line height. Defaults to the role leading; inside running text, the surrounding leading. */\n\tlineHeight?: TextProps['lineHeight'];\n\tref?: Ref<HTMLSpanElement>;\n}\n\nconst VALUE_ROLE: ValueTypographyRole = { type: 'main', weight: 'regular' };\nconst SECONDARY_ROLE: ValueTypographyRole = { type: 'secondary', weight: 'regular', keepType: true };\nconst MONO_ROLE: ValueTypographyRole = { type: 'main', weight: 'medium', inTextLineHeight: 'none' };\n\nfunction isEmptyValue(children: ReactNode) {\n\treturn children === null || children === undefined || children === '';\n}\n\ninterface ValueTextProps extends ValueProps {\n\tvalueRole: ValueTypographyRole;\n\thookClassName: string;\n\tnumeric?: boolean;\n}\n\n/** Shared span for the value family: role resolution plus the empty treatment. */\nfunction ValueText({ valueRole, hookClassName, numeric = false, children, emptyLabel = EMPTY, size, align, weight, type, lineHeight, className, ref, ...props }: ValueTextProps) {\n\tconst resolved = useValueTypography({ size, type, weight, lineHeight }, valueRole);\n\tconst empty = isEmptyValue(children);\n\tconst typography = empty ? emptyValueTypography(resolved, weight) : resolved;\n\treturn (\n\t\t<Text\n\t\t\tref={ref}\n\t\t\ttag=\"span\"\n\t\t\tsize={typography.size}\n\t\t\talign={align}\n\t\t\tweight={typography.weight}\n\t\t\ttype={typography.type}\n\t\t\tlineHeight={typography.lineHeight}\n\t\t\tnumeric={numeric && !empty}\n\t\t\tclassName={cn(hookClassName, className)}\n\t\t\t{...props}\n\t\t>\n\t\t\t{empty ? emptyLabel : children}\n\t\t</Text>\n\t);\n}\n\n/**\n * An ordinary displayed fact: foreground, regular weight. Inside running text it\n * takes the sentence's size, colour and weight.\n */\nexport function Value(props: ValueProps) {\n\treturn <ValueText {...props} valueRole={VALUE_ROLE} hookClassName=\"value--component inline min-w-0\" />;\n}\n\n/** Supporting detail in the secondary colour. Inside running text it keeps the colour and takes the size and weight. */\nexport function SecondaryValue(props: ValueProps) {\n\treturn <ValueText {...props} valueRole={SECONDARY_ROLE} hookClassName=\"secondary-value--component inline min-w-0\" />;\n}\n\n/** A quiet note using the shared secondary foreground. */\nexport function MutedValue(props: ValueProps) {\n\treturn <ValueText {...props} valueRole={SECONDARY_ROLE} hookClassName=\"muted-value--component inline min-w-0\" />;\n}\n\n/**\n * An identifier or code (SKU, reference, tracking number, key) in the monospace\n * family. Standalone it is foreground medium at the provider size; inside running\n * text only the family changes, so an SKU in a description matches the words\n * around it. Amounts and dates belong to the number primitives, which keep the\n * sans font with tabular figures.\n */\nexport function MonoValue(props: ValueProps) {\n\treturn <ValueText {...props} valueRole={MONO_ROLE} numeric hookClassName=\"mono-value--component inline min-w-0 break-words\" />;\n}\n\nexport interface EmptyValueProps extends Omit<ValueProps, 'emptyLabel'> {\n\tref?: Ref<HTMLSpanElement>;\n}\n\n/**\n * An intentionally absent value: secondary colour, regular weight. Every value\n * primitive renders its missing state with this treatment.\n */\nexport function EmptyValue({ children = EMPTY, ...props }: EmptyValueProps) {\n\treturn <ValueText {...props} valueRole={SECONDARY_ROLE} emptyLabel={EMPTY} hookClassName=\"empty-value--component inline min-w-0\">{children}</ValueText>;\n}\n","import { type ReactNode } from 'react';\n\nimport { cn } from '../../lib/utils';\n\nimport { Value, type ValueProps } from './value';\n\nconst WORD_SEPARATOR = /(\\s+)/u;\nconst NAME_CONNECTOR = /([-'])/u;\nconst LETTER_MATCHER = /\\p{L}/u;\nconst LETTERS_MATCHER = /\\p{L}/gu;\n\nexport interface NameFormatOptions {\n\t/** Force title-casing even when the name already looks intentionally cased. */\n\tforce?: boolean;\n}\n\nexport interface NameProps extends Omit<ValueProps, 'children'> {\n\t/** Raw name value to normalize for display. */\n\tvalue?: string | null;\n\t/** String children are normalized when value is not provided. */\n\tchildren?: ReactNode;\n\t/** Force title-casing even when the name already looks intentionally cased. */\n\tforce?: boolean;\n}\n\nfunction normalizeNameWhitespace(value: string) {\n\treturn value.trim().replace(/\\s+/g, ' ');\n}\n\nfunction getLetters(value: string) {\n\treturn value.match(LETTERS_MATCHER)?.join('') ?? '';\n}\n\nfunction getFirstLetter(value: string) {\n\tconst match = LETTER_MATCHER.exec(value);\n\tif (!match) return null;\n\treturn {\n\t\tindex: match.index,\n\t\tvalue: match[0],\n\t};\n}\n\nfunction isFormattedSegment(segment: string) {\n\tconst first = getFirstLetter(segment);\n\tif (!first) return true;\n\n\tconst letters = getLetters(segment);\n\tif (letters.length <= 1) return first.value === first.value.toLocaleUpperCase();\n\n\tconst isAllUpper = letters === letters.toLocaleUpperCase();\n\tconst isAllLower = letters === letters.toLocaleLowerCase();\n\n\treturn first.value === first.value.toLocaleUpperCase() && !isAllUpper && !isAllLower;\n}\n\nfunction isFormattedName(value: string) {\n\treturn normalizeNameWhitespace(value)\n\t\t.split(WORD_SEPARATOR)\n\t\t.filter((word) => word.trim() !== '')\n\t\t.every((word) =>\n\t\t\tword\n\t\t\t\t.split(NAME_CONNECTOR)\n\t\t\t\t.filter((segment) => segment !== '-' && segment !== \"'\")\n\t\t\t\t.every(isFormattedSegment),\n\t\t);\n}\n\nfunction formatNameSegment(segment: string) {\n\tconst first = getFirstLetter(segment);\n\tif (!first) return segment;\n\n\tconst before = segment.slice(0, first.index);\n\tconst after = segment.slice(first.index + first.value.length);\n\n\treturn `${before}${first.value.toLocaleUpperCase()}${after.toLocaleLowerCase()}`;\n}\n\nfunction formatNameWord(word: string) {\n\treturn word\n\t\t.split(NAME_CONNECTOR)\n\t\t.map((segment) => (segment === '-' || segment === \"'\" ? segment : formatNameSegment(segment)))\n\t\t.join('');\n}\n\nexport function formatName(value: string | null | undefined, options: NameFormatOptions = {}) {\n\tif (value === null || value === undefined) return '';\n\n\tconst normalized = normalizeNameWhitespace(value);\n\tif (!normalized) return '';\n\tif (!options.force && isFormattedName(normalized)) return normalized;\n\n\treturn normalized\n\t\t.split(WORD_SEPARATOR)\n\t\t.map((word) => (word.trim() === '' ? word : formatNameWord(word)))\n\t\t.join('');\n}\n\nexport function Name({\n\tvalue,\n\tchildren,\n\tforce,\n\tclassName,\n\tref,\n\t...props\n}: NameProps) {\n\tconst rawValue = value ?? (typeof children === 'string' ? children : undefined);\n\tconst content = rawValue === undefined ? children : formatName(rawValue, { force });\n\n\treturn (\n\t\t<Value ref={ref} className={cn('name--component', className)} {...props}>\n\t\t\t{content}\n\t\t</Value>\n\t);\n}\n","import { cn } from '../../lib/utils';\n\nimport { Value, type ValueProps } from './value';\nimport {\n\tformatInitials,\n\ttype InitialsMaxCharacters,\n\ttype InitialsStrategy,\n} from './initials-format';\n\nexport interface InitialsProps extends Omit<ValueProps, 'children'> {\n\t/** Person, organization, or resource name used to derive initials. */\n\tvalue?: string | null;\n\t/** First + last word by default; use first-words to preserve the first N words. */\n\tstrategy?: InitialsStrategy;\n\t/** Maximum visible characters. Defaults to 2. */\n\tmaxCharacters?: InitialsMaxCharacters;\n\t/** Optional BCP-47 locale used for locale-sensitive uppercasing. */\n\tlocale?: string;\n\t/** Returned when no usable letter or number exists. Defaults to an empty string. */\n\tfallback?: string;\n\t/** Defaults to `inherit`: the avatar or chip that hosts the initials owns their size. */\n\tsize?: ValueProps['size'];\n\t/** Defaults to `inherit`: the host owns the colour, such as an avatar fallback tone. */\n\ttype?: ValueProps['type'];\n\t/** Defaults to `inherit`: the host owns the weight. */\n\tweight?: ValueProps['weight'];\n}\n\n/**\n * Semantic displayed initials for identities and avatar fallbacks. They take the\n * size, colour and weight of the avatar or chip that hosts them.\n */\nexport function Initials({\n\tvalue,\n\tstrategy,\n\tmaxCharacters,\n\tlocale,\n\tfallback,\n\tsize = 'inherit',\n\ttype = 'inherit',\n\tweight = 'inherit',\n\tclassName,\n\tref,\n\t...props\n}: InitialsProps) {\n\treturn (\n\t\t<Value\n\t\t\tref={ref}\n\t\t\t{...props}\n\t\t\tsize={size}\n\t\t\ttype={type}\n\t\t\tweight={weight}\n\t\t\tclassName={cn('initials--component', className)}\n\t\t>\n\t\t\t{formatInitials(value, {\n\t\t\t\tstrategy,\n\t\t\t\tmaxCharacters,\n\t\t\t\tlocale,\n\t\t\t\tfallback,\n\t\t\t})}\n\t\t</Value>\n\t);\n}\n","import { type AnchorHTMLAttributes, type ReactNode, type Ref } from 'react';\n\nimport { useTypographyConfig } from '../../lib/ui-provider';\nimport { EMPTY } from '../../lib/format';\nimport { cn } from '../../lib/utils';\nimport { RunningTextContext, useInRunningText } from '../typography/running-text';\nimport { inlineLinkClassName, linkUnderlineClassName } from '../typography/text-link';\nimport { resolveTextClassNames } from '../typography/text.styles';\n\nimport { EmptyValue } from './value';\n\nexport interface LinkProps extends AnchorHTMLAttributes<HTMLElement> {\n\tchildren?: ReactNode;\n\t/** Rendered instead of a dead link when there is nothing to show. Defaults to an em dash. */\n\temptyLabel?: ReactNode;\n\t/** The anchor when populated, or the shared empty span when content is absent. */\n\tref?: Ref<HTMLElement>;\n}\n\n/**\n * Link-coloured inline value. Standalone it uses the provider text size with an\n * underline on hover. Inside running text it takes the sentence's size, weight\n * and leading and stays underlined, because colour alone does not set a link\n * apart from the words around it.\n */\nexport function Link({\n\tchildren,\n\temptyLabel = EMPTY,\n\tclassName,\n\tref,\n\t...props\n}: LinkProps) {\n\tconst inText = useInRunningText();\n\tconst { defaultTextSize } = useTypographyConfig();\n\tif (children === null || children === undefined || children === '') {\n\t\treturn <EmptyLinkValue ref={ref} className={cn('link--component', className)} emptyLabel={emptyLabel} linkProps={props} />;\n\t}\n\n\treturn (\n\t\t<a\n\t\t\tref={ref as Ref<HTMLAnchorElement>}\n\t\t\tdata-typography=\"link\"\n\t\t\tclassName={cn(\n\t\t\t\tresolveTextClassNames({\n\t\t\t\t\ttype: null,\n\t\t\t\t\tsize: inText ? 'inherit' : defaultTextSize,\n\t\t\t\t\tweight: null,\n\t\t\t\t\talign: null,\n\t\t\t\t\tlineHeight: inText ? null : 'normal',\n\t\t\t\t}),\n\t\t\t\t'link--component text-link-color wrap-anywhere',\n\t\t\t\tinlineLinkClassName,\n\t\t\t\tinText ? `${linkUnderlineClassName} hover:decoration-transparent` : 'no-underline underline-offset-[0.2em] hover:underline',\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t>\n\t\t\t<RunningTextContext.Provider value>{children}</RunningTextContext.Provider>\n\t\t</a>\n\t);\n}\n\ntype EmptyLinkSpanProps = Omit<LinkProps, 'children' | 'emptyLabel' | 'ref' | 'href' | 'target' | 'rel' | 'download' | 'hrefLang' | 'ping' | 'referrerPolicy' | 'media' | 'type'>;\n\n/**\n * The missing link/contact value: the shared empty treatment, never a dead link.\n * Global attributes (ARIA, data, id, title) still reach the rendered span.\n */\nfunction EmptyLinkValue({ className, emptyLabel, ref, linkProps }: { className: string; emptyLabel: ReactNode; ref?: Ref<HTMLElement>; linkProps: LinkProps }) {\n\tconst { href: _href, target: _target, rel: _rel, download: _download, hrefLang: _hrefLang, ping: _ping, referrerPolicy: _referrerPolicy, media: _media, type: _type, ...spanProps } = linkProps;\n\treturn <EmptyValue {...(spanProps as EmptyLinkSpanProps)} ref={ref as Ref<HTMLSpanElement>} className={className}>{emptyLabel}</EmptyValue>;\n}\n\nexport interface EmailProps extends Omit<LinkProps, 'href' | 'children' | 'ref'> {\n\tvalue?: string | null;\n\tdisplay?: ReactNode;\n\tsubject?: string;\n\tbody?: string;\n\tref?: Ref<HTMLElement>;\n}\n\nexport function Email({\n\tvalue,\n\tdisplay,\n\tsubject,\n\tbody,\n\tclassName,\n\temptyLabel = EMPTY,\n\tref,\n\t...props\n}: EmailProps) {\n\tif (!value) return <EmptyLinkValue ref={ref} className={cn('email--component', className)} emptyLabel={emptyLabel} linkProps={props} />;\n\n\tconst query = new URLSearchParams();\n\tif (subject) query.set('subject', subject);\n\tif (body) query.set('body', body);\n\tconst href = `mailto:${value}${query.size ? `?${query.toString()}` : ''}`;\n\n\treturn (\n\t\t<Link ref={ref} className={cn('email--component', className)} href={href} emptyLabel={emptyLabel} {...props}>\n\t\t\t{display ?? value}\n\t\t</Link>\n\t);\n}\n\nexport interface PhoneProps extends Omit<LinkProps, 'href' | 'children' | 'ref'> {\n\tvalue?: string | null;\n\tdisplay?: ReactNode;\n\tref?: Ref<HTMLElement>;\n}\n\nfunction normalizeTel(value: string) {\n\treturn value.replace(/[^\\d+*#;,.]/g, '');\n}\n\nexport function Phone({\n\tvalue,\n\tdisplay,\n\tclassName,\n\temptyLabel = EMPTY,\n\tref,\n\t...props\n}: PhoneProps) {\n\tif (!value) return <EmptyLinkValue ref={ref} className={cn('phone--component', className)} emptyLabel={emptyLabel} linkProps={props} />;\n\n\treturn (\n\t\t<Link ref={ref} className={cn('phone--component wrap-normal', className)} href={`tel:${normalizeTel(value)}`} emptyLabel={emptyLabel} {...props}>\n\t\t\t{display ?? value}\n\t\t</Link>\n\t);\n}\n\nexport interface UrlProps extends Omit<LinkProps, 'href' | 'children' | 'ref'> {\n\tvalue?: string | null;\n\tdisplay?: ReactNode;\n\texternal?: boolean;\n\tref?: Ref<HTMLElement>;\n}\n\nfunction normalizeUrl(value: string) {\n\tif (/^[a-z][a-z\\d+\\-.]*:/i.test(value) || value.startsWith('/') || value.startsWith('#')) return value;\n\treturn `https://${value}`;\n}\n\nexport function Url({\n\tvalue,\n\tdisplay,\n\texternal,\n\ttarget,\n\trel,\n\tclassName,\n\temptyLabel = EMPTY,\n\tref,\n\t...props\n}: UrlProps) {\n\tif (!value) return <EmptyLinkValue ref={ref} className={cn('url--component', className)} emptyLabel={emptyLabel} linkProps={{ ...props, target, rel }} />;\n\n\tconst href = normalizeUrl(value);\n\tconst isExternal = external ?? /^https?:\\/\\//i.test(href);\n\tconst resolvedTarget = target ?? (isExternal ? '_blank' : undefined);\n\tconst resolvedRel = rel ?? (isExternal ? 'noreferrer' : undefined);\n\n\treturn (\n\t\t<Link\n\t\t\tref={ref}\n\t\t\tclassName={cn('url--component', className)}\n\t\t\thref={href}\n\t\t\ttarget={resolvedTarget}\n\t\t\trel={resolvedRel}\n\t\t\temptyLabel={emptyLabel}\n\t\t\t{...props}\n\t\t>\n\t\t\t{display ?? value}\n\t\t</Link>\n\t);\n}\n","import { type ComponentPropsWithoutRef, type ReactNode, type Ref } from 'react';\n\nimport { Text, type TextProps } from '../typography';\nimport type { TextSize } from '../../lib/ui-provider';\nimport { EMPTY } from '../../lib/format';\nimport { useFormattingConfig } from '../../lib/ui-provider';\nimport { cn } from '../../lib/utils';\n\nimport { emptyValueTypography, useValueTypography, type ValueTypographyRole } from './value-typography';\n\ntype SpanProps = Omit<ComponentPropsWithoutRef<'span'>, 'children' | 'color'>;\n\nexport type FileSizeUnit = 'bytes' | 'kb' | 'mb' | 'gb' | 'tb';\n\nexport interface FileSizeProps extends SpanProps {\n\tvalue?: number | null;\n\tfrom?: FileSizeUnit;\n\tlocale?: string;\n\t/** Rendered with the shared empty treatment when the value is absent or not positive. Defaults to an em dash. */\n\temptyLabel?: ReactNode;\n\t/** Text size. Defaults to the provider text size; inside running text, the surrounding size. */\n\tsize?: TextSize;\n\t/** Text alignment. Defaults to `right` so columns of sizes line up. */\n\talign?: TextProps['align'];\n\t/** Font weight. Defaults to `regular`; inside running text, the surrounding weight. */\n\tweight?: TextProps['weight'];\n\t/** Colour role. Defaults to `main`; inside running text, the surrounding colour. */\n\ttype?: TextProps['type'];\n\tref?: Ref<HTMLSpanElement>;\n}\n\nconst FILE_SIZE_ROLE: ValueTypographyRole = { type: 'main', weight: 'regular' };\n\nconst FILE_SIZE_UNITS = ['B', 'KB', 'MB', 'GB', 'TB'] as const;\nconst FILE_SIZE_UNIT_MULTIPLIER: Record<FileSizeUnit, number> = {\n\tbytes: 1,\n\tkb: 1024,\n\tmb: 1024 ** 2,\n\tgb: 1024 ** 3,\n\ttb: 1024 ** 4,\n};\n\nexport interface FileSizeFormatOptions {\n\tfrom?: FileSizeUnit;\n\tlocale?: string;\n}\n\nfunction normalizeFileSizeValue(value?: number | null, from: FileSizeUnit = 'bytes') {\n\tif (typeof value !== 'number' || !Number.isFinite(value) || value <= 0) return null;\n\treturn value * FILE_SIZE_UNIT_MULTIPLIER[from];\n}\n\nexport function formatFileSize(\n\tvalue?: number | null,\n\toptions?: FileSizeFormatOptions | string,\n): string | null {\n\tconst locale = typeof options === 'string' ? options : options?.locale;\n\tconst from = typeof options === 'string' ? 'bytes' : options?.from ?? 'bytes';\n\tconst bytes = normalizeFileSizeValue(value, from);\n\tif (bytes === null) return null;\n\n\tlet displayValue = bytes;\n\tlet unitIndex = 0;\n\twhile (displayValue >= 1024 && unitIndex < FILE_SIZE_UNITS.length - 1) {\n\t\tdisplayValue /= 1024;\n\t\tunitIndex += 1;\n\t}\n\n\tconst formattedValue = new Intl.NumberFormat(locale, {\n\t\tmaximumFractionDigits: unitIndex === 0 ? 0 : 1,\n\t\tminimumFractionDigits: 0,\n\t}).format(displayValue);\n\n\treturn `${formattedValue} ${FILE_SIZE_UNITS[unitIndex]}`;\n}\n\n/** A byte count in the largest readable unit, sans UI font with tabular figures. */\nexport function FileSize({\n\tvalue,\n\tfrom = 'bytes',\n\tlocale,\n\temptyLabel = EMPTY,\n\tsize,\n\talign = 'right',\n\tweight,\n\ttype,\n\tclassName,\n\tref,\n\t...props\n}: FileSizeProps) {\n\tconst formatting = useFormattingConfig();\n\tconst resolved = useValueTypography({ size, type, weight }, FILE_SIZE_ROLE);\n\tconst label = formatFileSize(value, { from, locale: locale ?? formatting.locale });\n\tconst typography = label === null ? emptyValueTypography(resolved, weight) : resolved;\n\n\treturn (\n\t\t<Text\n\t\t\tref={ref}\n\t\t\ttag=\"span\"\n\t\t\tsize={typography.size}\n\t\t\talign={align}\n\t\t\tweight={typography.weight}\n\t\t\ttype={typography.type}\n\t\t\tlineHeight={typography.lineHeight}\n\t\t\tclassName={cn('file-size--component inline tabular-nums', className)}\n\t\t\t{...props}\n\t\t>\n\t\t\t{label ?? emptyLabel}\n\t\t</Text>\n\t);\n}\n","import { type ComponentPropsWithoutRef, type ReactNode, type Ref } from 'react';\n\nimport { Text, type TextProps } from '../typography';\nimport type { TextSize } from '../../lib/ui-provider';\nimport {\n\tEMPTY,\n\tformatDuration,\n\ttype DurationUnit,\n\ttype DurationUnitDisplay,\n} from '../../lib/format';\nimport { useFormattingConfig } from '../../lib/ui-provider';\nimport { cn } from '../../lib/utils';\n\nimport { emptyValueTypography, useValueTypography, type ValueTypographyRole } from './value-typography';\n\ntype SpanProps = Omit<ComponentPropsWithoutRef<'span'>, 'children' | 'color'>;\n\nexport interface DurationProps extends SpanProps {\n\tvalue?: number | null;\n\tfrom?: DurationUnit;\n\tlocale?: string;\n\tmaxParts?: number;\n\tunitDisplay?: DurationUnitDisplay;\n\tminimumFractionDigits?: number;\n\tmaximumFractionDigits?: number;\n\t/** Rendered with the shared empty treatment when the value is absent. Defaults to an em dash. */\n\temptyLabel?: ReactNode;\n\t/** Text size. Defaults to the provider text size; inside running text, the surrounding size. */\n\tsize?: TextSize;\n\t/** Text alignment. Defaults to `right` so columns of durations line up. */\n\talign?: TextProps['align'];\n\t/** Font weight. Defaults to `regular`; inside running text, the surrounding weight. */\n\tweight?: TextProps['weight'];\n\t/** Colour role. Defaults to `main`; inside running text, the surrounding colour. */\n\ttype?: TextProps['type'];\n\tref?: Ref<HTMLSpanElement>;\n}\n\nconst DURATION_ROLE: ValueTypographyRole = { type: 'main', weight: 'regular' };\n\n/** An elapsed span in localized units, sans UI font with tabular figures. */\nexport function Duration({\n\tvalue,\n\tfrom = 'seconds',\n\tlocale,\n\tmaxParts = 2,\n\tunitDisplay = 'narrow',\n\tminimumFractionDigits,\n\tmaximumFractionDigits,\n\temptyLabel = EMPTY,\n\tsize,\n\talign = 'right',\n\tweight,\n\ttype,\n\tclassName,\n\tref,\n\t...props\n}: DurationProps) {\n\tconst formatting = useFormattingConfig();\n\tconst resolved = useValueTypography({ size, type, weight }, DURATION_ROLE);\n\tconst label = value === null || value === undefined\n\t\t? null\n\t\t: formatDuration(value, {\n\t\t\t\tfrom,\n\t\t\t\tlocale: locale ?? formatting.locale,\n\t\t\t\tmaxParts,\n\t\t\t\tunitDisplay,\n\t\t\t\tminimumFractionDigits,\n\t\t\t\tmaximumFractionDigits: maximumFractionDigits ?? (\n\t\t\t\t\tfrom === 'milliseconds' ? 1 : undefined\n\t\t\t\t),\n\t\t\t});\n\n\tconst empty = label === null || label === EMPTY;\n\tconst typography = empty ? emptyValueTypography(resolved, weight) : resolved;\n\n\treturn (\n\t\t<Text\n\t\t\tref={ref}\n\t\t\ttag=\"span\"\n\t\t\tsize={typography.size}\n\t\t\talign={align}\n\t\t\tweight={typography.weight}\n\t\t\ttype={typography.type}\n\t\t\tlineHeight={typography.lineHeight}\n\t\t\tclassName={cn('duration--component inline tabular-nums', className)}\n\t\t\t{...props}\n\t\t>\n\t\t\t{empty ? emptyLabel : label}\n\t\t</Text>\n\t);\n}\n\nexport { formatDuration } from '../../lib/format';\nexport type { DurationUnit, DurationUnitDisplay, FormatDurationOptions } from '../../lib/format';\n","import { type ComponentPropsWithoutRef, type ReactNode, type Ref } from 'react';\n\nimport { Text, type TextProps } from '../typography';\nimport type { TextSize } from '../../lib/ui-provider';\nimport { EMPTY, formatWithMinusSign } from '../../lib/format';\nimport { useFormattingConfig } from '../../lib/ui-provider';\nimport { cn } from '../../lib/utils';\n\nimport { emptyValueTypography, useValueTypography, type ValueTypographyRole } from './value-typography';\n\ntype SpanProps = Omit<ComponentPropsWithoutRef<'span'>, 'children' | 'color'>;\ntype DimensionPart = number | string | null | undefined;\n\nexport interface FormatDimensionsOptions {\n\tdepth?: DimensionPart;\n\tunit?: string;\n\tseparator?: string;\n\tlocale?: string;\n\toptions?: Intl.NumberFormatOptions;\n}\n\nexport interface DimensionsProps extends SpanProps {\n\twidth?: DimensionPart;\n\theight?: DimensionPart;\n\tdepth?: DimensionPart;\n\tunit?: ReactNode;\n\tseparator?: ReactNode;\n\tlocale?: string;\n\toptions?: Intl.NumberFormatOptions;\n\t/** Rendered with the shared empty treatment when width or height is missing. Defaults to an em dash. */\n\temptyLabel?: ReactNode;\n\t/** Text size. Defaults to the provider text size; inside running text, the surrounding size. */\n\tsize?: TextSize;\n\t/** Text alignment. Defaults to `right` so columns of readings line up. */\n\talign?: TextProps['align'];\n\t/** Font weight. Defaults to `regular`; inside running text, the surrounding weight. */\n\tweight?: TextProps['weight'];\n\t/** Colour role. Defaults to `main`; inside running text, the surrounding colour. */\n\ttype?: TextProps['type'];\n\tref?: Ref<HTMLSpanElement>;\n}\n\nconst DIMENSIONS_ROLE: ValueTypographyRole = { type: 'main', weight: 'regular' };\n\nfunction parseDimensionPart(value: DimensionPart): number | null {\n\tif (value === null || value === undefined || value === '') return null;\n\tif (typeof value === 'number') return Number.isFinite(value) ? value : null;\n\tconst normalized = value.trim().replace(',', '.');\n\tif (!normalized) return null;\n\tconst parsed = Number(normalized);\n\treturn Number.isFinite(parsed) ? parsed : null;\n}\n\nexport function formatDimensions(\n\twidth: DimensionPart,\n\theight: DimensionPart,\n\t{\n\t\tdepth,\n\t\tunit,\n\t\tseparator = ' × ',\n\t\tlocale,\n\t\toptions,\n\t}: FormatDimensionsOptions = {},\n): string | null {\n\tconst parsedWidth = parseDimensionPart(width);\n\tconst parsedHeight = parseDimensionPart(height);\n\tconst parsedDepth = parseDimensionPart(depth);\n\tif (parsedWidth === null || parsedHeight === null) return null;\n\tif (depth !== null && depth !== undefined && depth !== '' && parsedDepth === null) return null;\n\n\tconst formatter = new Intl.NumberFormat(locale, options);\n\tconst values = [parsedWidth, parsedHeight];\n\tif (parsedDepth !== null) values.push(parsedDepth);\n\tconst label = values.map((value) => formatWithMinusSign(formatter, value)).join(separator);\n\treturn unit ? `${label} ${unit}` : label;\n}\n\n/** A width × height (× depth) reading with localized numbers, sans UI font with tabular figures. */\nexport function Dimensions({\n\twidth,\n\theight,\n\tdepth,\n\tunit,\n\tseparator = ' × ',\n\tlocale,\n\toptions,\n\temptyLabel = EMPTY,\n\tsize,\n\talign = 'right',\n\tweight,\n\ttype,\n\tclassName,\n\tref,\n\t...props\n}: DimensionsProps) {\n\tconst formatting = useFormattingConfig();\n\tconst resolved = useValueTypography({ size, type, weight }, DIMENSIONS_ROLE);\n\tconst label = formatDimensions(width, height, {\n\t\tdepth,\n\t\tseparator: typeof separator === 'string' ? separator : ' × ',\n\t\tlocale: locale ?? formatting.locale,\n\t\toptions,\n\t});\n\n\tconst typography = label === null ? emptyValueTypography(resolved, weight) : resolved;\n\n\treturn (\n\t\t<Text\n\t\t\tref={ref}\n\t\t\ttag=\"span\"\n\t\t\tsize={typography.size}\n\t\t\talign={align}\n\t\t\tweight={typography.weight}\n\t\t\ttype={typography.type}\n\t\t\tlineHeight={typography.lineHeight}\n\t\t\tclassName={cn('dimensions--component inline tabular-nums', className)}\n\t\t\t{...props}\n\t\t>\n\t\t\t{label === null ? emptyLabel : (\n\t\t\t\t<>\n\t\t\t\t\t{typeof separator === 'string' ? label : label.split(' × ').map((part, index) => (\n\t\t\t\t\t\t<span key={`${part}-${index}`}>\n\t\t\t\t\t\t\t{index > 0 && separator}\n\t\t\t\t\t\t\t{part}\n\t\t\t\t\t\t</span>\n\t\t\t\t\t))}\n\t\t\t\t\t{!!unit && <> {unit}</>}\n\t\t\t\t</>\n\t\t\t)}\n\t\t</Text>\n\t);\n}\n"],"mappings":";;;;;;;;;;AAgCA,IAAMe,IAAkC;CAAE,MAAM;CAAQ,QAAQ;AAAU,GACpEC,IAAsC;CAAE,MAAM;CAAa,QAAQ;CAAW,UAAU;AAAK,GAC7FC,IAAiC;CAAE,MAAM;CAAQ,QAAQ;CAAU,kBAAkB;AAAO;AAElG,SAASC,E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,OAAO4H,KAAc,WAAWhB,IAAQA,EAAM,MAAM,KAAK,CAAC,CAAC,KAAK,GAAM,MACtE,kBAAC,QAAD,EAAA,UAAA,CACEmB,IAAQ,KAAKH,GACbI,CACI,EAAA,GAHK,GAAGA,EAAK,GAAGD,GAGhB,CACN,GACA,CAAC,CAACF,KAAQ,kBAAA7H,GAAA,EAAA,UAAA,CAAE,KAAE6H,CAAO,EAAA,CAAA,CACrB,EAAA,CAAA;CAEE,CAAA;AAER"}
|
package/dist/primitives.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { r as e } from "./value-typography-
|
|
3
|
-
import { _ as t, a as n, c as r, d as i, f as a, g as o, h as s, i as c, l, m as u, n as d, o as f, p, r as m, s as h, t as g, u as _ } from "./primitives-
|
|
2
|
+
import { r as e } from "./value-typography-uSzzG9Gf.js";
|
|
3
|
+
import { _ as t, a as n, c as r, d as i, f as a, g as o, h as s, i as c, l, m as u, n as d, o as f, p, r as m, s as h, t as g, u as _ } from "./primitives-BkkQjYl7.js";
|
|
4
4
|
import { t as v } from "./initials-format-CDoQEOd_.js";
|
|
5
|
-
import { i as y, n as b, r as x, t as S } from "./number-
|
|
6
|
-
import { a as C, i as w, n as T, o as E, r as D, s as O, t as k } from "./date-
|
|
5
|
+
import { i as y, n as b, r as x, t as S } from "./number-CYqBcrSj.js";
|
|
6
|
+
import { a as C, i as w, n as T, o as E, r as D, s as O, t as k } from "./date-Br0FicVv.js";
|
|
7
7
|
export { k as Date, T as DateRange, D as DateTime, g as Dimensions, m as Duration, f as Email, p as EmptyValue, c as FileSize, _ as Initials, h as Link, x as Money, u as MonoValue, s as MutedValue, i as Name, S as Number, b as Percent, r as Phone, w as RelativeTime, o as SecondaryValue, C as Time, l as Url, t as Value, E as formatDateRange, d as formatDimensions, e as formatDuration, n as formatFileSize, v as formatInitials, a as formatName, O as parseDateInput, y as useMoneyFormatter };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
2
|
+
import { S as e, d as t, f as n } from "./ui-provider-C-74NVLc.js";
|
|
3
3
|
import { useStrings as r } from "./lib/strings.js";
|
|
4
|
-
import { t as i } from "./utils-
|
|
5
|
-
import { c as a } from "./typography-
|
|
6
|
-
import { t as o } from "./structure-
|
|
4
|
+
import { t as i } from "./utils-DhuoqFy4.js";
|
|
5
|
+
import { c as a } from "./typography-C7-YMW1S.js";
|
|
6
|
+
import { t as o } from "./structure-DZJ2wbAU.js";
|
|
7
7
|
import { n as s } from "./track-recipes-CDcKmndW.js";
|
|
8
8
|
import { createContext as c, forwardRef as l, useContext as u, useId as d, useMemo as f } from "react";
|
|
9
9
|
import { Fragment as ee, jsx as p, jsxs as m } from "react/jsx-runtime";
|
|
@@ -45,7 +45,7 @@ function S(e, t, n, r, i) {
|
|
|
45
45
|
}).format(a);
|
|
46
46
|
}
|
|
47
47
|
var C = l(function({ value: i, min: s, max: c, format: l, locale: u, getAriaValueText: y, children: C, label: O, description: k, metadata: A, showValue: j, valueSlot: M, headerSlot: N, trackSlot: P, size: F, tone: I = "primary", trackProps: L, indicatorProps: R, strings: ne, className: z, "aria-describedby": B, ...V }, H) {
|
|
48
|
-
let U = r(g, ne), W =
|
|
48
|
+
let U = r(g, ne), W = n(), { defaultScale: G } = t(), K = e(F, G), q = u ?? W.locale, J = d(), { min: Y, max: X } = te(s, c), Z = x(i, Y, X), Q = S(Z, Y, X, q, l), re = N === void 0 && C === void 0, $ = j ?? O !== void 0, ie = O !== void 0 || k !== void 0 || A !== void 0 || M !== void 0 || $, ae = [B, re && k !== void 0 ? J : void 0].filter(Boolean).join(" ") || void 0, oe = (e, t) => {
|
|
49
49
|
let n = S(t, Y, X, q, l);
|
|
50
50
|
return y ? y(n, t) : n ?? U.indeterminateValue;
|
|
51
51
|
}, se = f(() => ({
|
|
@@ -106,13 +106,13 @@ var C = l(function({ value: i, min: s, max: c, format: l, locale: u, getAriaValu
|
|
|
106
106
|
});
|
|
107
107
|
});
|
|
108
108
|
C.displayName = "Progress";
|
|
109
|
-
var w = l(function({ className:
|
|
110
|
-
let { defaultScale: c } = t(), l =
|
|
109
|
+
var w = l(function({ className: n, size: r, ...a }, o) {
|
|
110
|
+
let { defaultScale: c } = t(), l = e(r, c);
|
|
111
111
|
return /* @__PURE__ */ p(h.Track, {
|
|
112
112
|
ref: o,
|
|
113
113
|
"data-slot": "progress-track",
|
|
114
114
|
"data-size": l,
|
|
115
|
-
className: b(i("progress-track--component progress--track relative col-span-full flex w-full items-center overflow-hidden rounded-full bg-muted", s[l]),
|
|
115
|
+
className: b(i("progress-track--component progress--track relative col-span-full flex w-full items-center overflow-hidden rounded-full bg-muted", s[l]), n),
|
|
116
116
|
...a
|
|
117
117
|
});
|
|
118
118
|
});
|
|
@@ -166,4 +166,4 @@ D.displayName = "ProgressValue";
|
|
|
166
166
|
//#endregion
|
|
167
167
|
export { D as a, w as i, T as n, g as o, E as r, C as t };
|
|
168
168
|
|
|
169
|
-
//# sourceMappingURL=progress-
|
|
169
|
+
//# sourceMappingURL=progress-DZFXXzPs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"progress-BvF2oCdV.js","names":["Progress","_Fragment","ProgressPrimitive","useFormattingConfig","useDensityConfig","resolveComponentScale","cn","Text","Stack","trackHeightClasses","Fragment$1","defaultProgressStrings","ProgressContext","createContext","isSimpleText","value","INDICATOR_TONE_CLASSNAMES","mergeStateClassName","className","baseClassName","state","normalizeRange","min","minProp","maxCandidate","maxProp","normalizeValue","max","formatProgressValue","format","locale","normalized","Progress$1","forwardRef","valueProp","showValueProp","sizeProp","stringsProp","ariaDescribedBy","props","strings","useStrings","formatting","size","defaultScale","resolvedLocale","descriptionId","useId","formattedValue","usesGeneratedHeader","headerSlot","children","showValue","label","hasSummary","description","metadata","valueSlot","descriptionIds","resolvedGetAriaValueText","normalizedFormattedValue","currentValue","getAriaValueText","contextValue","useMemo","resolvedHeader","ProgressLabel","ProgressValue","resolvedTrack","trackSlot","ProgressTrack","trackProps","ProgressIndicator","indicatorProps","tone","Progress","context","useContext","primitiveValue","_primitiveFormattedValue","content"],"sources":["../src/components/base/feedback/progress.strings.ts","../src/components/base/feedback/progress.tsx"],"sourcesContent":["export interface ProgressStrings {\n\t/** Screen-reader value announced while progress is indeterminate. */\n\tindeterminateValue: string;\n}\n\nexport const defaultProgressStrings: ProgressStrings = {\n\tindeterminateValue: 'In progress',\n};\n","import { trackHeightClasses } from '../../../lib/track-recipes';\n/**\n * Progress — token-driven Base UI progress wrapper for completion, quota,\n * and long-running task states.\n *\n * The root keeps the Base UI accessibility contract while adding a concise\n * admin summary API (`label`, `description`, `metadata`, `showValue`),\n * semantic tones, structural sizes, stable DOM hooks, and composition slots.\n * Consumers can still assemble `ProgressLabel`, `ProgressValue`,\n * `ProgressTrack`, and `ProgressIndicator` directly.\n */\nimport { Progress as ProgressPrimitive } from '@base-ui/react/progress';\nimport { createContext, forwardRef, useContext, useId, useMemo, type ReactNode } from 'react';\n\nimport { Text } from '../../typography';\nimport { Stack } from '../structure';\nimport { useDensityConfig, useFormattingConfig, type ComponentScale } from '../../../lib/ui-provider';\nimport { resolveComponentScale } from '../../../lib/ui-provider/scale';\nimport { useStrings, type StringsProp } from '../../../lib/strings';\nimport { cn } from '../../../lib/utils';\nimport type { SemanticTone } from '../../../lib/component-vocabulary';\n\nimport { defaultProgressStrings, type ProgressStrings } from './progress.strings';\n\nexport type ProgressSize = ComponentScale;\nexport type ProgressTone = SemanticTone;\n\ntype ProgressRootState = ProgressPrimitive.Root.State;\ntype ProgressTrackState = ProgressPrimitive.Track.State;\ntype ProgressIndicatorState = ProgressPrimitive.Indicator.State;\ntype ProgressLabelState = ProgressPrimitive.Label.State;\ntype ProgressValueState = ProgressPrimitive.Value.State;\n\ntype StatefulClassName<TState> = string | ((state: TState) => string | undefined) | undefined;\n\nexport interface ProgressProps extends Omit<\n\tProgressPrimitive.Root.Props,\n\t'children' | 'format' | 'getAriaValueText' | 'locale' | 'max' | 'min' | 'value'\n> {\n\t/** Current value. `null` renders an indeterminate state. */\n\tvalue: number | null;\n\t/** Minimum value used to normalize the visual percentage. @default 0 */\n\tmin?: number;\n\t/** Maximum value used to normalize the visual percentage. @default 100 */\n\tmax?: number;\n\t/** Intl options for formatting the raw value instead of the default normalized percentage. */\n\tformat?: Intl.NumberFormatOptions;\n\t/** Locale forwarded to `Intl.NumberFormat`. */\n\tlocale?: Intl.LocalesArgument;\n\t/** Human-readable text for the current value. Receives the wrapper's normalized display value. */\n\tgetAriaValueText?: (formattedValue: string | null, value: number | null) => string;\n\t/** Low-level compound content. `headerSlot` takes precedence when both are supplied. */\n\tchildren?: ReactNode;\n\t/** Accessible visual label. Supplying it also enables `showValue` by default. */\n\tlabel?: ReactNode;\n\t/** Supporting text automatically connected with `aria-describedby`. */\n\tdescription?: ReactNode;\n\t/** Optional right-aligned task metadata, such as \"18,400 of 25,000 rows\". */\n\tmetadata?: ReactNode;\n\t/** Show the formatted value beside the label. Defaults to `true` when `label` is supplied. */\n\tshowValue?: boolean;\n\t/** Replaces the formatted value while retaining the default summary layout. */\n\tvalueSlot?: ReactNode;\n\t/** Replaces the entire content above the track. */\n\theaderSlot?: ReactNode;\n\t/** Replaces the default track and indicator composition. */\n\ttrackSlot?: ReactNode;\n\t/** Track thickness. @default \"default\" */\n\tsize?: ProgressSize;\n\t/** Semantic indicator color. @default \"primary\" */\n\ttone?: ProgressTone;\n\t/** Props forwarded to the default track. Ignored when `trackSlot` is supplied. */\n\ttrackProps?: ProgressTrackProps;\n\t/** Props forwarded to the default indicator. Ignored when `trackSlot` is supplied. */\n\tindicatorProps?: ProgressIndicatorProps;\n\t/** Override the indeterminate screen-reader copy. */\n\tstrings?: StringsProp<ProgressStrings>;\n}\n\nexport interface ProgressTrackProps extends ProgressPrimitive.Track.Props {\n\t/** Track thickness. @default \"default\" */\n\tsize?: ProgressSize;\n}\n\nexport interface ProgressIndicatorProps extends ProgressPrimitive.Indicator.Props {\n\t/** Semantic fill color. @default \"primary\" */\n\ttone?: ProgressTone;\n}\n\nexport interface ProgressLabelProps extends ProgressPrimitive.Label.Props {\n\t/** Accessible label content. */\n\tchildren?: ReactNode;\n}\n\nexport interface ProgressValueProps extends Omit<ProgressPrimitive.Value.Props, 'children'> {\n\t/** Customize the formatted display while preserving the value semantics. */\n\tchildren?: (formattedValue: string | null, value: number | null) => ReactNode;\n}\n\ninterface ProgressContextValue {\n\tformattedValue: string | null;\n\tvalue: number | null;\n}\n\nconst ProgressContext = createContext<ProgressContextValue | null>(null);\n\nfunction isSimpleText(value: ReactNode): value is string | number | bigint {\n\treturn typeof value === 'string' || typeof value === 'number' || typeof value === 'bigint';\n}\n\n\n\nconst INDICATOR_TONE_CLASSNAMES: Record<ProgressTone, string> = {\n\tneutral: 'bg-muted-foreground',\n\tprimary: 'bg-primary',\n\tsecondary: 'bg-secondary-foreground',\n\tsuccess: 'bg-success',\n\tinfo: 'bg-info',\n\twarning: 'bg-warning',\n\tdestructive: 'bg-destructive',\n};\n\nfunction mergeStateClassName<TState>(\n\tbaseClassName: string,\n\tclassName: StatefulClassName<TState>,\n): string | ((state: TState) => string) {\n\tif (typeof className === 'function') {\n\t\treturn (state) => cn(baseClassName, className(state));\n\t}\n\n\treturn cn(baseClassName, className);\n}\n\nfunction normalizeRange(minProp: number | undefined, maxProp: number | undefined) {\n\tconst min = Number.isFinite(minProp) ? (minProp as number) : 0;\n\tconst maxCandidate = Number.isFinite(maxProp) ? (maxProp as number) : 100;\n\tconst max = maxCandidate > min ? maxCandidate : min + 100;\n\n\treturn { min, max };\n}\n\nfunction normalizeValue(value: number | null, min: number, max: number): number | null {\n\tif (value === null || !Number.isFinite(value)) return null;\n\treturn Math.min(max, Math.max(min, value));\n}\n\nfunction formatProgressValue(\n\tvalue: number | null,\n\tmin: number,\n\tmax: number,\n\tlocale: Intl.LocalesArgument | undefined,\n\tformat: Intl.NumberFormatOptions | undefined,\n): string | null {\n\tif (value === null) return null;\n\n\tif (format) {\n\t\treturn new Intl.NumberFormat(locale, format).format(value);\n\t}\n\n\tconst normalized = max === min ? 0 : (value - min) / (max - min);\n\treturn new Intl.NumberFormat(locale, {\n\t\tstyle: 'percent',\n\t\tmaximumFractionDigits: 0,\n\t}).format(normalized);\n}\n\nconst Progress = forwardRef<HTMLDivElement, ProgressProps>(function Progress(\n\t{\n\t\tvalue: valueProp,\n\t\tmin: minProp,\n\t\tmax: maxProp,\n\t\tformat,\n\t\tlocale,\n\t\tgetAriaValueText,\n\t\tchildren,\n\t\tlabel,\n\t\tdescription,\n\t\tmetadata,\n\t\tshowValue: showValueProp,\n\t\tvalueSlot,\n\t\theaderSlot,\n\t\ttrackSlot,\n\t\tsize: sizeProp,\n\t\ttone = 'primary',\n\t\ttrackProps,\n\t\tindicatorProps,\n\t\tstrings: stringsProp,\n\t\tclassName,\n\t\t'aria-describedby': ariaDescribedBy,\n\t\t...props\n\t},\n\tref,\n) {\n\tconst strings = useStrings(defaultProgressStrings, stringsProp);\n\tconst formatting = useFormattingConfig();\n\tconst { defaultScale } = useDensityConfig();\n\tconst size = resolveComponentScale(sizeProp, defaultScale);\n\tconst resolvedLocale = locale ?? formatting.locale;\n\tconst descriptionId = useId();\n\tconst { min, max } = normalizeRange(minProp, maxProp);\n\tconst value = normalizeValue(valueProp, min, max);\n\tconst formattedValue = formatProgressValue(value, min, max, resolvedLocale, format);\n\tconst usesGeneratedHeader = headerSlot === undefined && children === undefined;\n\tconst showValue = showValueProp ?? label !== undefined;\n\tconst hasSummary =\n\t\tlabel !== undefined || description !== undefined || metadata !== undefined || valueSlot !== undefined || showValue;\n\tconst descriptionIds =\n\t\t[ariaDescribedBy, usesGeneratedHeader && description !== undefined ? descriptionId : undefined]\n\t\t\t.filter(Boolean)\n\t\t\t.join(' ') || undefined;\n\tconst resolvedGetAriaValueText = (_formattedValue: string | null, currentValue: number | null) => {\n\t\tconst normalizedFormattedValue = formatProgressValue(currentValue, min, max, resolvedLocale, format);\n\t\tif (getAriaValueText) {\n\t\t\treturn getAriaValueText(normalizedFormattedValue, currentValue);\n\t\t}\n\t\treturn normalizedFormattedValue ?? strings.indeterminateValue;\n\t};\n\tconst contextValue = useMemo(() => ({ formattedValue, value }), [formattedValue, value]);\n\tconst resolvedHeader =\n\t\theaderSlot ??\n\t\tchildren ??\n\t\t(hasSummary ? (\n\t\t\t<>\n\t\t\t\t<Stack gap=\"dense\" className=\"progress--summary min-w-0\">\n\t\t\t\t\t{label !== undefined && <ProgressLabel>{label}</ProgressLabel>}\n\t\t\t\t\t{description !== undefined &&\n\t\t\t\t\t\t(isSimpleText(description) ? (\n\t\t\t\t\t\t\t<Text\n\t\t\t\t\t\t\t\tid={descriptionId}\n\t\t\t\t\t\t\t\ttag=\"span\"\n\t\t\t\t\t\t\t\tsize=\"xs\"\n\t\t\t\t\t\t\t\ttype=\"secondary\"\n\t\t\t\t\t\t\t\tclassName=\"progress--description block\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{description}\n\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t<div id={descriptionId} className=\"progress--description\">\n\t\t\t\t\t\t\t\t{description}\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t))}\n\t\t\t\t</Stack>\n\t\t\t\t{(showValue || valueSlot !== undefined || metadata !== undefined) && (\n\t\t\t\t\t<Stack gap=\"dense\" align=\"end\" className=\"progress--details text-end\">\n\t\t\t\t\t\t{valueSlot ?? (showValue ? <ProgressValue /> : null)}\n\t\t\t\t\t\t{metadata !== undefined &&\n\t\t\t\t\t\t\t(isSimpleText(metadata) ? (\n\t\t\t\t\t\t\t\t<Text tag=\"span\" size=\"xs\" type=\"secondary\" className=\"progress--metadata tabular-nums\">\n\t\t\t\t\t\t\t\t\t{metadata}\n\t\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\tmetadata\n\t\t\t\t\t\t\t))}\n\t\t\t\t\t</Stack>\n\t\t\t\t)}\n\t\t\t</>\n\t\t) : null);\n\tconst resolvedTrack = trackSlot ?? (\n\t\t<ProgressTrack {...trackProps} size={trackProps?.size ?? size}>\n\t\t\t{trackProps?.children ?? <ProgressIndicator {...indicatorProps} tone={indicatorProps?.tone ?? tone} />}\n\t\t</ProgressTrack>\n\t);\n\n\treturn (\n\t\t<ProgressContext.Provider value={contextValue}>\n\t\t\t<ProgressPrimitive.Root\n\t\t\t\tref={ref}\n\t\t\t\tvalue={value}\n\t\t\t\tmin={min}\n\t\t\t\tmax={max}\n\t\t\t\tformat={format}\n\t\t\t\tlocale={resolvedLocale}\n\t\t\t\tgetAriaValueText={resolvedGetAriaValueText}\n\t\t\t\taria-describedby={descriptionIds}\n\t\t\t\tdata-slot=\"progress\"\n\t\t\t\tdata-size={size}\n\t\t\t\tdata-tone={tone}\n\t\t\t\tclassName={mergeStateClassName<ProgressRootState>(\n\t\t\t\t\t'progress--component grid min-w-0 w-full grid-cols-[minmax(0,1fr)_auto] items-start gap-x-space-lg gap-y-space-sm',\n\t\t\t\t\tclassName,\n\t\t\t\t)}\n\t\t\t\t{...props}\n\t\t\t>\n\t\t\t\t{resolvedHeader}\n\t\t\t\t{resolvedTrack}\n\t\t\t</ProgressPrimitive.Root>\n\t\t</ProgressContext.Provider>\n\t);\n});\nProgress.displayName = 'Progress';\n\nconst ProgressTrack = forwardRef<HTMLDivElement, ProgressTrackProps>(function ProgressTrack(\n\t{ className, size: sizeProp, ...props },\n\tref,\n) {\n\tconst { defaultScale } = useDensityConfig();\n\tconst size = resolveComponentScale(sizeProp, defaultScale);\n\treturn (\n\t\t<ProgressPrimitive.Track\n\t\t\tref={ref}\n\t\t\tdata-slot=\"progress-track\"\n\t\t\tdata-size={size}\n\t\t\tclassName={mergeStateClassName<ProgressTrackState>(\n\t\t\t\tcn(\n\t\t\t\t\t'progress-track--component progress--track relative col-span-full flex w-full items-center overflow-hidden rounded-full bg-muted',\n\t\t\t\t\ttrackHeightClasses[size],\n\t\t\t\t),\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n});\nProgressTrack.displayName = 'ProgressTrack';\n\nconst ProgressIndicator = forwardRef<HTMLDivElement, ProgressIndicatorProps>(function ProgressIndicator(\n\t{ className, tone = 'primary', ...props },\n\tref,\n) {\n\treturn (\n\t\t<ProgressPrimitive.Indicator\n\t\t\tref={ref}\n\t\t\tdata-slot=\"progress-indicator\"\n\t\t\tdata-tone={tone}\n\t\t\tclassName={mergeStateClassName<ProgressIndicatorState>(\n\t\t\t\tcn(\n\t\t\t\t\t'progress-indicator--component progress--indicator h-full rounded-full transition-[width] duration-300 ease-out motion-reduce:transition-none',\n\t\t\t\t\t'data-[indeterminate]:w-full motion-safe:data-[indeterminate]:animate-pulse',\n\t\t\t\t\tINDICATOR_TONE_CLASSNAMES[tone],\n\t\t\t\t),\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n});\nProgressIndicator.displayName = 'ProgressIndicator';\n\nconst ProgressLabel = forwardRef<HTMLSpanElement, ProgressLabelProps>(function ProgressLabel(\n\t{ className, children, ...props },\n\tref,\n) {\n\treturn (\n\t\t<ProgressPrimitive.Label\n\t\t\tref={ref}\n\t\t\tdata-slot=\"progress-label\"\n\t\t\tclassName={mergeStateClassName<ProgressLabelState>(\n\t\t\t\t'progress-label--component progress--label min-w-0',\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t>\n\t\t\t{isSimpleText(children) ? (\n\t\t\t\t<Text tag=\"span\" weight=\"medium\" lineHeight=\"tight\" className=\"block\">\n\t\t\t\t\t{children}\n\t\t\t\t</Text>\n\t\t\t) : (\n\t\t\t\tchildren\n\t\t\t)}\n\t\t</ProgressPrimitive.Label>\n\t);\n});\nProgressLabel.displayName = 'ProgressLabel';\n\nconst ProgressValue = forwardRef<HTMLSpanElement, ProgressValueProps>(function ProgressValue(\n\t{ className, children, ...props },\n\tref,\n) {\n\tconst context = useContext(ProgressContext);\n\n\treturn (\n\t\t<ProgressPrimitive.Value\n\t\t\tref={ref}\n\t\t\tdata-slot=\"progress-value\"\n\t\t\tclassName={mergeStateClassName<ProgressValueState>(\n\t\t\t\t'progress-value--component progress--value whitespace-nowrap',\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t>\n\t\t\t{(_primitiveFormattedValue, primitiveValue) => {\n\t\t\t\tconst value = context?.value ?? primitiveValue;\n\t\t\t\tconst formattedValue = context?.formattedValue ?? _primitiveFormattedValue;\n\t\t\t\tconst content = children ? children(formattedValue, value) : formattedValue;\n\n\t\t\t\tif (content === null || content === undefined) return null;\n\t\t\t\treturn isSimpleText(content) ? (\n\t\t\t\t\t// The percentage is the bar's primary value, so it mirrors\n\t\t\t\t\t// ProgressLabel: provider-default size and medium weight. Pinning\n\t\t\t\t\t// it to `xs`/secondary demoted the headline number below its own\n\t\t\t\t\t// caption and left the two off a shared baseline.\n\t\t\t\t\t<Text tag=\"span\" weight=\"medium\" lineHeight=\"tight\" className=\"block tabular-nums\">\n\t\t\t\t\t\t{content}\n\t\t\t\t\t</Text>\n\t\t\t\t) : (\n\t\t\t\t\tcontent\n\t\t\t\t);\n\t\t\t}}\n\t\t</ProgressPrimitive.Value>\n\t);\n});\nProgressValue.displayName = 'ProgressValue';\n\nexport { Progress, ProgressTrack, ProgressIndicator, ProgressLabel, ProgressValue, defaultProgressStrings };\nexport type { ProgressStrings };\n"],"mappings":";;;;;;;;;;;AAKA,IAAaW,IAA0C,EACtD,oBAAoB,cACrB,GCiGMC,IAAkBC,EAA2C,IAAI;AAEvE,SAASC,EAAa,GAAqD;CAC1E,OAAO,OAAOC,KAAU,YAAY,OAAOA,KAAU,YAAY,OAAOA,KAAU;AACnF;AAIA,IAAMC,IAA0D;CAC/D,SAAS;CACT,SAAS;CACT,WAAW;CACX,SAAS;CACT,MAAM;CACN,SAAS;CACT,aAAa;AACd;AAEA,SAASC,EACR,GACA,GACuC;CAKvC,OAJI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AU,EAA0B0D,EAC3B,GACAxD,CACD;EACA,GAAIqB;CACJ,CAAA;AAEH,CAAC;AACD,EAAkB,cAAc;AAEhC,IAAM2B,IAAgBjC,EAAgD,SACrE,EAAE,cAAW,aAAU,GAAGM,KAC1B,GACC;CACD,OACC,kBAACrC,EAAkB,OAAnB;EACM;EACL,aAAU;EACV,WAAWe,EACV,qDACAC,CACD;EACA,GAAIqB;EAEH,UAAAzB,EAAaqC,CAAQ,IACrB,kBAAC5C,GAAD;GAAM,KAAI;GAAO,QAAO;GAAS,YAAW;GAAQ,WAAU;GAC5D;EACI,CAAA,IAEN4C;CAEuB,CAAA;AAE3B,CAAC;AACD,EAAc,cAAc;AAE5B,IAAMgB,IAAgBlC,EAAgD,SACrE,EAAE,cAAW,aAAU,GAAGM,KAC1B,GACC;CACD,IAAMqC,IAAUC,EAAWjE,CAAe;CAE1C,OACC,kBAACV,EAAkB,OAAnB;EACM;EACL,aAAU;EACV,WAAWe,EACV,+DACAC,CACD;EACA,GAAIqB;EAEF,WAAA,GAA0B,MAAmB;GAC9C,IAAMxB,IAAQ6D,GAAS,SAASE,GAC1B9B,IAAiB4B,GAAS,kBAAkBG,GAC5CC,IAAU7B,IAAWA,EAASH,GAAgBjC,CAAK,IAAIiC;GAG7D,OADIgC,KAAY,OAAsC,OAC/ClE,EAAakE,CAAO,IAK1B,kBAACzE,GAAD;IAAM,KAAI;IAAO,QAAO;IAAS,YAAW;IAAQ,WAAU;IAC5D,UAAAyE;GACI,CAAA,IAENA;EAEF;CACwB,CAAA;AAE3B,CAAC;AACD,EAAc,cAAc"}
|
|
1
|
+
{"version":3,"file":"progress-DZFXXzPs.js","names":["Progress","_Fragment","ProgressPrimitive","resolveComponentScale","useDensityConfig","useFormattingConfig","cn","Text","Stack","trackHeightClasses","Fragment$1","defaultProgressStrings","ProgressContext","createContext","isSimpleText","value","INDICATOR_TONE_CLASSNAMES","mergeStateClassName","className","baseClassName","state","normalizeRange","min","minProp","maxCandidate","maxProp","normalizeValue","max","formatProgressValue","format","locale","normalized","Progress$1","forwardRef","valueProp","showValueProp","sizeProp","stringsProp","ariaDescribedBy","props","strings","useStrings","formatting","size","defaultScale","resolvedLocale","descriptionId","useId","formattedValue","usesGeneratedHeader","headerSlot","children","showValue","label","hasSummary","description","metadata","valueSlot","descriptionIds","resolvedGetAriaValueText","normalizedFormattedValue","currentValue","getAriaValueText","contextValue","useMemo","resolvedHeader","ProgressLabel","ProgressValue","resolvedTrack","trackSlot","ProgressTrack","trackProps","ProgressIndicator","indicatorProps","tone","Progress","context","useContext","primitiveValue","_primitiveFormattedValue","content"],"sources":["../src/components/base/feedback/progress.strings.ts","../src/components/base/feedback/progress.tsx"],"sourcesContent":["export interface ProgressStrings {\n\t/** Screen-reader value announced while progress is indeterminate. */\n\tindeterminateValue: string;\n}\n\nexport const defaultProgressStrings: ProgressStrings = {\n\tindeterminateValue: 'In progress',\n};\n","import { trackHeightClasses } from '../../../lib/track-recipes';\n/**\n * Progress — token-driven Base UI progress wrapper for completion, quota,\n * and long-running task states.\n *\n * The root keeps the Base UI accessibility contract while adding a concise\n * admin summary API (`label`, `description`, `metadata`, `showValue`),\n * semantic tones, structural sizes, stable DOM hooks, and composition slots.\n * Consumers can still assemble `ProgressLabel`, `ProgressValue`,\n * `ProgressTrack`, and `ProgressIndicator` directly.\n */\nimport { Progress as ProgressPrimitive } from '@base-ui/react/progress';\nimport { createContext, forwardRef, useContext, useId, useMemo, type ReactNode } from 'react';\n\nimport { Text } from '../../typography';\nimport { Stack } from '../structure';\nimport { useDensityConfig, useFormattingConfig, type ComponentScale } from '../../../lib/ui-provider';\nimport { resolveComponentScale } from '../../../lib/ui-provider/scale';\nimport { useStrings, type StringsProp } from '../../../lib/strings';\nimport { cn } from '../../../lib/utils';\nimport type { SemanticTone } from '../../../lib/component-vocabulary';\n\nimport { defaultProgressStrings, type ProgressStrings } from './progress.strings';\n\nexport type ProgressSize = ComponentScale;\nexport type ProgressTone = SemanticTone;\n\ntype ProgressRootState = ProgressPrimitive.Root.State;\ntype ProgressTrackState = ProgressPrimitive.Track.State;\ntype ProgressIndicatorState = ProgressPrimitive.Indicator.State;\ntype ProgressLabelState = ProgressPrimitive.Label.State;\ntype ProgressValueState = ProgressPrimitive.Value.State;\n\ntype StatefulClassName<TState> = string | ((state: TState) => string | undefined) | undefined;\n\nexport interface ProgressProps extends Omit<\n\tProgressPrimitive.Root.Props,\n\t'children' | 'format' | 'getAriaValueText' | 'locale' | 'max' | 'min' | 'value'\n> {\n\t/** Current value. `null` renders an indeterminate state. */\n\tvalue: number | null;\n\t/** Minimum value used to normalize the visual percentage. @default 0 */\n\tmin?: number;\n\t/** Maximum value used to normalize the visual percentage. @default 100 */\n\tmax?: number;\n\t/** Intl options for formatting the raw value instead of the default normalized percentage. */\n\tformat?: Intl.NumberFormatOptions;\n\t/** Locale forwarded to `Intl.NumberFormat`. */\n\tlocale?: Intl.LocalesArgument;\n\t/** Human-readable text for the current value. Receives the wrapper's normalized display value. */\n\tgetAriaValueText?: (formattedValue: string | null, value: number | null) => string;\n\t/** Low-level compound content. `headerSlot` takes precedence when both are supplied. */\n\tchildren?: ReactNode;\n\t/** Accessible visual label. Supplying it also enables `showValue` by default. */\n\tlabel?: ReactNode;\n\t/** Supporting text automatically connected with `aria-describedby`. */\n\tdescription?: ReactNode;\n\t/** Optional right-aligned task metadata, such as \"18,400 of 25,000 rows\". */\n\tmetadata?: ReactNode;\n\t/** Show the formatted value beside the label. Defaults to `true` when `label` is supplied. */\n\tshowValue?: boolean;\n\t/** Replaces the formatted value while retaining the default summary layout. */\n\tvalueSlot?: ReactNode;\n\t/** Replaces the entire content above the track. */\n\theaderSlot?: ReactNode;\n\t/** Replaces the default track and indicator composition. */\n\ttrackSlot?: ReactNode;\n\t/** Track thickness. @default \"default\" */\n\tsize?: ProgressSize;\n\t/** Semantic indicator color. @default \"primary\" */\n\ttone?: ProgressTone;\n\t/** Props forwarded to the default track. Ignored when `trackSlot` is supplied. */\n\ttrackProps?: ProgressTrackProps;\n\t/** Props forwarded to the default indicator. Ignored when `trackSlot` is supplied. */\n\tindicatorProps?: ProgressIndicatorProps;\n\t/** Override the indeterminate screen-reader copy. */\n\tstrings?: StringsProp<ProgressStrings>;\n}\n\nexport interface ProgressTrackProps extends ProgressPrimitive.Track.Props {\n\t/** Track thickness. @default \"default\" */\n\tsize?: ProgressSize;\n}\n\nexport interface ProgressIndicatorProps extends ProgressPrimitive.Indicator.Props {\n\t/** Semantic fill color. @default \"primary\" */\n\ttone?: ProgressTone;\n}\n\nexport interface ProgressLabelProps extends ProgressPrimitive.Label.Props {\n\t/** Accessible label content. */\n\tchildren?: ReactNode;\n}\n\nexport interface ProgressValueProps extends Omit<ProgressPrimitive.Value.Props, 'children'> {\n\t/** Customize the formatted display while preserving the value semantics. */\n\tchildren?: (formattedValue: string | null, value: number | null) => ReactNode;\n}\n\ninterface ProgressContextValue {\n\tformattedValue: string | null;\n\tvalue: number | null;\n}\n\nconst ProgressContext = createContext<ProgressContextValue | null>(null);\n\nfunction isSimpleText(value: ReactNode): value is string | number | bigint {\n\treturn typeof value === 'string' || typeof value === 'number' || typeof value === 'bigint';\n}\n\n\n\nconst INDICATOR_TONE_CLASSNAMES: Record<ProgressTone, string> = {\n\tneutral: 'bg-muted-foreground',\n\tprimary: 'bg-primary',\n\tsecondary: 'bg-secondary-foreground',\n\tsuccess: 'bg-success',\n\tinfo: 'bg-info',\n\twarning: 'bg-warning',\n\tdestructive: 'bg-destructive',\n};\n\nfunction mergeStateClassName<TState>(\n\tbaseClassName: string,\n\tclassName: StatefulClassName<TState>,\n): string | ((state: TState) => string) {\n\tif (typeof className === 'function') {\n\t\treturn (state) => cn(baseClassName, className(state));\n\t}\n\n\treturn cn(baseClassName, className);\n}\n\nfunction normalizeRange(minProp: number | undefined, maxProp: number | undefined) {\n\tconst min = Number.isFinite(minProp) ? (minProp as number) : 0;\n\tconst maxCandidate = Number.isFinite(maxProp) ? (maxProp as number) : 100;\n\tconst max = maxCandidate > min ? maxCandidate : min + 100;\n\n\treturn { min, max };\n}\n\nfunction normalizeValue(value: number | null, min: number, max: number): number | null {\n\tif (value === null || !Number.isFinite(value)) return null;\n\treturn Math.min(max, Math.max(min, value));\n}\n\nfunction formatProgressValue(\n\tvalue: number | null,\n\tmin: number,\n\tmax: number,\n\tlocale: Intl.LocalesArgument | undefined,\n\tformat: Intl.NumberFormatOptions | undefined,\n): string | null {\n\tif (value === null) return null;\n\n\tif (format) {\n\t\treturn new Intl.NumberFormat(locale, format).format(value);\n\t}\n\n\tconst normalized = max === min ? 0 : (value - min) / (max - min);\n\treturn new Intl.NumberFormat(locale, {\n\t\tstyle: 'percent',\n\t\tmaximumFractionDigits: 0,\n\t}).format(normalized);\n}\n\nconst Progress = forwardRef<HTMLDivElement, ProgressProps>(function Progress(\n\t{\n\t\tvalue: valueProp,\n\t\tmin: minProp,\n\t\tmax: maxProp,\n\t\tformat,\n\t\tlocale,\n\t\tgetAriaValueText,\n\t\tchildren,\n\t\tlabel,\n\t\tdescription,\n\t\tmetadata,\n\t\tshowValue: showValueProp,\n\t\tvalueSlot,\n\t\theaderSlot,\n\t\ttrackSlot,\n\t\tsize: sizeProp,\n\t\ttone = 'primary',\n\t\ttrackProps,\n\t\tindicatorProps,\n\t\tstrings: stringsProp,\n\t\tclassName,\n\t\t'aria-describedby': ariaDescribedBy,\n\t\t...props\n\t},\n\tref,\n) {\n\tconst strings = useStrings(defaultProgressStrings, stringsProp);\n\tconst formatting = useFormattingConfig();\n\tconst { defaultScale } = useDensityConfig();\n\tconst size = resolveComponentScale(sizeProp, defaultScale);\n\tconst resolvedLocale = locale ?? formatting.locale;\n\tconst descriptionId = useId();\n\tconst { min, max } = normalizeRange(minProp, maxProp);\n\tconst value = normalizeValue(valueProp, min, max);\n\tconst formattedValue = formatProgressValue(value, min, max, resolvedLocale, format);\n\tconst usesGeneratedHeader = headerSlot === undefined && children === undefined;\n\tconst showValue = showValueProp ?? label !== undefined;\n\tconst hasSummary =\n\t\tlabel !== undefined || description !== undefined || metadata !== undefined || valueSlot !== undefined || showValue;\n\tconst descriptionIds =\n\t\t[ariaDescribedBy, usesGeneratedHeader && description !== undefined ? descriptionId : undefined]\n\t\t\t.filter(Boolean)\n\t\t\t.join(' ') || undefined;\n\tconst resolvedGetAriaValueText = (_formattedValue: string | null, currentValue: number | null) => {\n\t\tconst normalizedFormattedValue = formatProgressValue(currentValue, min, max, resolvedLocale, format);\n\t\tif (getAriaValueText) {\n\t\t\treturn getAriaValueText(normalizedFormattedValue, currentValue);\n\t\t}\n\t\treturn normalizedFormattedValue ?? strings.indeterminateValue;\n\t};\n\tconst contextValue = useMemo(() => ({ formattedValue, value }), [formattedValue, value]);\n\tconst resolvedHeader =\n\t\theaderSlot ??\n\t\tchildren ??\n\t\t(hasSummary ? (\n\t\t\t<>\n\t\t\t\t<Stack gap=\"dense\" className=\"progress--summary min-w-0\">\n\t\t\t\t\t{label !== undefined && <ProgressLabel>{label}</ProgressLabel>}\n\t\t\t\t\t{description !== undefined &&\n\t\t\t\t\t\t(isSimpleText(description) ? (\n\t\t\t\t\t\t\t<Text\n\t\t\t\t\t\t\t\tid={descriptionId}\n\t\t\t\t\t\t\t\ttag=\"span\"\n\t\t\t\t\t\t\t\tsize=\"xs\"\n\t\t\t\t\t\t\t\ttype=\"secondary\"\n\t\t\t\t\t\t\t\tclassName=\"progress--description block\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{description}\n\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t<div id={descriptionId} className=\"progress--description\">\n\t\t\t\t\t\t\t\t{description}\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t))}\n\t\t\t\t</Stack>\n\t\t\t\t{(showValue || valueSlot !== undefined || metadata !== undefined) && (\n\t\t\t\t\t<Stack gap=\"dense\" align=\"end\" className=\"progress--details text-end\">\n\t\t\t\t\t\t{valueSlot ?? (showValue ? <ProgressValue /> : null)}\n\t\t\t\t\t\t{metadata !== undefined &&\n\t\t\t\t\t\t\t(isSimpleText(metadata) ? (\n\t\t\t\t\t\t\t\t<Text tag=\"span\" size=\"xs\" type=\"secondary\" className=\"progress--metadata tabular-nums\">\n\t\t\t\t\t\t\t\t\t{metadata}\n\t\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\tmetadata\n\t\t\t\t\t\t\t))}\n\t\t\t\t\t</Stack>\n\t\t\t\t)}\n\t\t\t</>\n\t\t) : null);\n\tconst resolvedTrack = trackSlot ?? (\n\t\t<ProgressTrack {...trackProps} size={trackProps?.size ?? size}>\n\t\t\t{trackProps?.children ?? <ProgressIndicator {...indicatorProps} tone={indicatorProps?.tone ?? tone} />}\n\t\t</ProgressTrack>\n\t);\n\n\treturn (\n\t\t<ProgressContext.Provider value={contextValue}>\n\t\t\t<ProgressPrimitive.Root\n\t\t\t\tref={ref}\n\t\t\t\tvalue={value}\n\t\t\t\tmin={min}\n\t\t\t\tmax={max}\n\t\t\t\tformat={format}\n\t\t\t\tlocale={resolvedLocale}\n\t\t\t\tgetAriaValueText={resolvedGetAriaValueText}\n\t\t\t\taria-describedby={descriptionIds}\n\t\t\t\tdata-slot=\"progress\"\n\t\t\t\tdata-size={size}\n\t\t\t\tdata-tone={tone}\n\t\t\t\tclassName={mergeStateClassName<ProgressRootState>(\n\t\t\t\t\t'progress--component grid min-w-0 w-full grid-cols-[minmax(0,1fr)_auto] items-start gap-x-space-lg gap-y-space-sm',\n\t\t\t\t\tclassName,\n\t\t\t\t)}\n\t\t\t\t{...props}\n\t\t\t>\n\t\t\t\t{resolvedHeader}\n\t\t\t\t{resolvedTrack}\n\t\t\t</ProgressPrimitive.Root>\n\t\t</ProgressContext.Provider>\n\t);\n});\nProgress.displayName = 'Progress';\n\nconst ProgressTrack = forwardRef<HTMLDivElement, ProgressTrackProps>(function ProgressTrack(\n\t{ className, size: sizeProp, ...props },\n\tref,\n) {\n\tconst { defaultScale } = useDensityConfig();\n\tconst size = resolveComponentScale(sizeProp, defaultScale);\n\treturn (\n\t\t<ProgressPrimitive.Track\n\t\t\tref={ref}\n\t\t\tdata-slot=\"progress-track\"\n\t\t\tdata-size={size}\n\t\t\tclassName={mergeStateClassName<ProgressTrackState>(\n\t\t\t\tcn(\n\t\t\t\t\t'progress-track--component progress--track relative col-span-full flex w-full items-center overflow-hidden rounded-full bg-muted',\n\t\t\t\t\ttrackHeightClasses[size],\n\t\t\t\t),\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n});\nProgressTrack.displayName = 'ProgressTrack';\n\nconst ProgressIndicator = forwardRef<HTMLDivElement, ProgressIndicatorProps>(function ProgressIndicator(\n\t{ className, tone = 'primary', ...props },\n\tref,\n) {\n\treturn (\n\t\t<ProgressPrimitive.Indicator\n\t\t\tref={ref}\n\t\t\tdata-slot=\"progress-indicator\"\n\t\t\tdata-tone={tone}\n\t\t\tclassName={mergeStateClassName<ProgressIndicatorState>(\n\t\t\t\tcn(\n\t\t\t\t\t'progress-indicator--component progress--indicator h-full rounded-full transition-[width] duration-300 ease-out motion-reduce:transition-none',\n\t\t\t\t\t'data-[indeterminate]:w-full motion-safe:data-[indeterminate]:animate-pulse',\n\t\t\t\t\tINDICATOR_TONE_CLASSNAMES[tone],\n\t\t\t\t),\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n});\nProgressIndicator.displayName = 'ProgressIndicator';\n\nconst ProgressLabel = forwardRef<HTMLSpanElement, ProgressLabelProps>(function ProgressLabel(\n\t{ className, children, ...props },\n\tref,\n) {\n\treturn (\n\t\t<ProgressPrimitive.Label\n\t\t\tref={ref}\n\t\t\tdata-slot=\"progress-label\"\n\t\t\tclassName={mergeStateClassName<ProgressLabelState>(\n\t\t\t\t'progress-label--component progress--label min-w-0',\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t>\n\t\t\t{isSimpleText(children) ? (\n\t\t\t\t<Text tag=\"span\" weight=\"medium\" lineHeight=\"tight\" className=\"block\">\n\t\t\t\t\t{children}\n\t\t\t\t</Text>\n\t\t\t) : (\n\t\t\t\tchildren\n\t\t\t)}\n\t\t</ProgressPrimitive.Label>\n\t);\n});\nProgressLabel.displayName = 'ProgressLabel';\n\nconst ProgressValue = forwardRef<HTMLSpanElement, ProgressValueProps>(function ProgressValue(\n\t{ className, children, ...props },\n\tref,\n) {\n\tconst context = useContext(ProgressContext);\n\n\treturn (\n\t\t<ProgressPrimitive.Value\n\t\t\tref={ref}\n\t\t\tdata-slot=\"progress-value\"\n\t\t\tclassName={mergeStateClassName<ProgressValueState>(\n\t\t\t\t'progress-value--component progress--value whitespace-nowrap',\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t>\n\t\t\t{(_primitiveFormattedValue, primitiveValue) => {\n\t\t\t\tconst value = context?.value ?? primitiveValue;\n\t\t\t\tconst formattedValue = context?.formattedValue ?? _primitiveFormattedValue;\n\t\t\t\tconst content = children ? children(formattedValue, value) : formattedValue;\n\n\t\t\t\tif (content === null || content === undefined) return null;\n\t\t\t\treturn isSimpleText(content) ? (\n\t\t\t\t\t// The percentage is the bar's primary value, so it mirrors\n\t\t\t\t\t// ProgressLabel: provider-default size and medium weight. Pinning\n\t\t\t\t\t// it to `xs`/secondary demoted the headline number below its own\n\t\t\t\t\t// caption and left the two off a shared baseline.\n\t\t\t\t\t<Text tag=\"span\" weight=\"medium\" lineHeight=\"tight\" className=\"block tabular-nums\">\n\t\t\t\t\t\t{content}\n\t\t\t\t\t</Text>\n\t\t\t\t) : (\n\t\t\t\t\tcontent\n\t\t\t\t);\n\t\t\t}}\n\t\t</ProgressPrimitive.Value>\n\t);\n});\nProgressValue.displayName = 'ProgressValue';\n\nexport { Progress, ProgressTrack, ProgressIndicator, ProgressLabel, ProgressValue, defaultProgressStrings };\nexport type { ProgressStrings };\n"],"mappings":";;;;;;;;;;;AAKA,IAAaW,IAA0C,EACtD,oBAA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AAE3B,CAAC;AACD,EAAc,cAAc"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { t as e } from "./utils-
|
|
3
|
-
import { c as t } from "./typography-
|
|
4
|
-
import { t as n } from "./structure-
|
|
5
|
-
import { d as r, t as i } from "./smart-card-
|
|
6
|
-
import { r as a, t as o } from "./number-
|
|
2
|
+
import { t as e } from "./utils-DhuoqFy4.js";
|
|
3
|
+
import { c as t } from "./typography-C7-YMW1S.js";
|
|
4
|
+
import { t as n } from "./structure-DZJ2wbAU.js";
|
|
5
|
+
import { d as r, t as i } from "./smart-card-B6vLxqa_.js";
|
|
6
|
+
import { r as a, t as o } from "./number-CYqBcrSj.js";
|
|
7
7
|
import { forwardRef as s, useEffect as c, useRef as l, useState as u } from "react";
|
|
8
8
|
import { jsx as d, jsxs as f } from "react/jsx-runtime";
|
|
9
9
|
//#region src/components/blocks/commerce/receipt/receipt.tsx
|
|
@@ -42,7 +42,7 @@ var m = s(function({ children: t, header: a, footer: o, qrCode: s, padding: m =
|
|
|
42
42
|
className: e("receipt--component relative isolate w-full min-w-0", v),
|
|
43
43
|
children: [_ && /* @__PURE__ */ d("div", {
|
|
44
44
|
"aria-hidden": "true",
|
|
45
|
-
className: "receipt--shadow pointer-events-none absolute inset-x-0 rounded-
|
|
45
|
+
className: "receipt--shadow pointer-events-none absolute inset-x-0 rounded-surface shadow-sm",
|
|
46
46
|
style: { insetBlock: w }
|
|
47
47
|
}), /* @__PURE__ */ d(i, {
|
|
48
48
|
ref: x,
|
|
@@ -113,4 +113,4 @@ function h({ items: r, currency: i, locale: s, unit: c, minorUnitScale: l, forma
|
|
|
113
113
|
//#endregion
|
|
114
114
|
export { m as n, h as t };
|
|
115
115
|
|
|
116
|
-
//# sourceMappingURL=receipt-
|
|
116
|
+
//# sourceMappingURL=receipt-C7LhOg7Q.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"receipt-C7LhOg7Q.js","names":["NumberValue","cn","Text","Stack","hasRenderableContent","Card","Money","Number$1","paperClip","width","height","depth","inset","count","toothWidth","step","point","x","y","points","segment","Receipt","forwardRef","props","paper","useRef","clipPath","setClipPath","useState","toothDepth","element","update","rectangle","observer","children","header","footer","qrCode","hasFooter","className","shadow","ReceiptItems","items","item"],"sources":["../src/components/blocks/commerce/receipt/receipt.tsx","../src/components/blocks/commerce/receipt/receipt-items.tsx"],"sourcesContent":["import { forwardRef, useEffect, useRef, useState } from 'react';\nimport { Card, hasRenderableContent } from '../../../base/cards';\nimport { Stack } from '../../../base/structure';\nimport { cn } from '../../../../lib/utils';\nimport type { ReceiptProps } from './types';\n\nfunction paperClip(width: number, height: number, depth: number, toothWidth: number) {\n\tif (!(width > 0 && height > 0 && depth > 0)) return undefined;\n\tconst inset = Math.min(depth, height / 4);\n\tconst count = Math.max(1, Math.min(1024, Math.round(width / toothWidth)));\n\tconst step = width / count;\n\tconst point = (x: number, y: number) => `${Number(x.toFixed(2))}px ${Number(y.toFixed(2))}px`;\n\tconst points: string[] = [point(0, inset)];\n\tfor (let segment = 0; segment < count; segment++) {\n\t\tpoints.push(point((segment + 0.5) * step, 0), point((segment + 1) * step, inset));\n\t}\n\tpoints.push(point(width, height - inset));\n\tfor (let segment = count - 1; segment >= 0; segment--) {\n\t\tpoints.push(point((segment + 0.5) * step, height), point(segment * step, height - inset));\n\t}\n\treturn `polygon(${points.join(', ')})`;\n}\n\n/** Explicit paper surface: Card owns all content insets; clipping is decorative geometry. */\nexport const Receipt = forwardRef<HTMLDivElement, ReceiptProps>(function Receipt({\n\tchildren, header, footer, qrCode, padding = 'md', toothDepth = 5, toothWidth = 8,\n\tshadow = true, className, ...props\n}, ref) {\n\tconst paper = useRef<HTMLDivElement>(null);\n\tconst [clipPath, setClipPath] = useState<string>();\n\tconst depth = Number.isFinite(toothDepth) ? Math.max(0, toothDepth) : 5;\n\tconst width = Number.isFinite(toothWidth) ? Math.max(2, toothWidth) : 8;\n\tuseEffect(() => {\n\t\tconst element = paper.current;\n\t\tif (!element) return;\n\t\tconst update = () => {\n\t\t\tconst rectangle = element.getBoundingClientRect();\n\t\t\tsetClipPath(paperClip(rectangle.width, rectangle.height, depth, width));\n\t\t};\n\t\tupdate();\n\t\tif (typeof ResizeObserver === 'undefined') {\n\t\t\twindow.addEventListener('resize', update);\n\t\t\treturn () => window.removeEventListener('resize', update);\n\t\t}\n\t\tconst observer = new ResizeObserver(update);\n\t\tobserver.observe(element);\n\t\treturn () => observer.disconnect();\n\t}, [depth, width, children, header, footer, qrCode]);\n\tconst hasFooter = hasRenderableContent(footer) || hasRenderableContent(qrCode);\n\treturn <div {...props} ref={ref} className={cn('receipt--component relative isolate w-full min-w-0', className)}>\n\t\t{shadow && <div aria-hidden=\"true\" className=\"receipt--shadow pointer-events-none absolute inset-x-0 rounded-surface shadow-sm\" style={{ insetBlock: depth }} />}\n\t\t<Card ref={paper} surface=\"flat\" padding={padding} headerStart={header}\n\t\t\tfooterSlot={hasFooter ? <Stack gap=\"normal\" align=\"center\" className=\"receipt--footer w-full min-w-0\">{qrCode}{footer}</Stack> : undefined}\n\t\t\tclassName=\"receipt--paper relative bg-card text-card-foreground\" style={{ clipPath }}>\n\t\t\t{children}\n\t\t</Card>\n\t</div>;\n});\n","import { Stack } from '../../../base/structure';\nimport { Money } from '../../../primitives/money';\nimport { Number as NumberValue } from '../../../primitives/number';\nimport { Text } from '../../../typography/text';\nimport { cn } from '../../../../lib/utils';\nimport type { ReceiptItemsProps } from './types';\n\nexport function ReceiptItems({ items, currency, locale, unit, minorUnitScale, formatMode, className, ...props }: ReceiptItemsProps) {\n\tif (items.length === 0) return null;\n\treturn <Stack {...props} gap=\"md\" className={cn('receipt-items--component min-w-0', className)}>\n\t\t{items.map(item => <Stack key={item.id} direction=\"horizontal\" gap=\"md\" justify=\"between\" align=\"start\" wrap={false} className=\"receipt-items--item min-w-0\">\n\t\t\t<Stack gap=\"dense\" className=\"receipt-items--copy min-w-0 flex-1\">\n\t\t\t\t<Text type=\"inherit\" className=\"break-words [overflow-wrap:anywhere]\">{item.name} × <NumberValue type=\"inherit\" value={item.quantity} locale={locale} align=\"left\" /></Text>\n\t\t\t\t{item.description != null && <Text size=\"xs\" type=\"secondary\" className=\"break-words [overflow-wrap:anywhere]\">{item.description}</Text>}\n\t\t\t</Stack>\n\t\t\t<Money type=\"inherit\" amount={item.total ?? item.quantity * item.unitPrice} currency={currency} locale={locale} unit={unit} minorUnitScale={minorUnitScale} formatMode={formatMode} className=\"receipt-items--amount min-w-0 max-w-full whitespace-normal [overflow-wrap:anywhere]\" />\n\t\t</Stack>)}\n\t</Stack>;\n}\n"],"mappings":";;;;;;;;;AAMA,SAASQ,EAAU,GAAe,GAAgB,GAAe,GAAoB;CACpF,IAAI,EAAEC,IAAQ,KAAKC,IAAS,KAAKC,IAAQ,IAAI;CAC7C,IAAMC,IAAQ,KAAK,IAAID,GAAOD,IAAS,CAAC,GAClCG,IAAQ,KAAK,IAAI,GAAG,KAAK,IAAI,MAAM,KAAK,MAAMJ,IAAQK,CAAU,CAAC,CAAC,GAClEC,IAAON,IAAQI,GACfG,KAAS,GAAW,MAAc,GAAG,OAAOC,EAAE,QAAQ,CAAC,CAAC,EAAE,KAAK,OAAOC,EAAE,QAAQ,CAAC,CAAC,EAAE,KACpFC,IAAmB,CAACH,EAAM,GAAGJ,CAAK,CAAC;CACzC,KAAK,IAAIQ,IAAU,GAAGA,IAAUP,GAAO,KACtC,EAAO,KAAKG,GAAOI,IAAU,MAAOL,GAAM,CAAC,GAAGC,GAAOI,IAAU,KAAKL,GAAMH,CAAK,CAAC;CAEjF,EAAO,KAAKI,EAAMP,GAAOC,IAASE,CAAK,CAAC;CACxC,KAAK,IAAIQ,IAAUP,IAAQ,GAAGO,KAAW,GAAG,KAC3C,EAAO,KAAKJ,GAAOI,IAAU,MAAOL,GAAML,CAAM,GAAGM,EAAMI,IAAUL,GAAML,IAASE,CAAK,CAAC;CAEzF,OAAO,WAAWO,EAAO,KAAK,IAAI,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UAAA,CAA+EkC,GAAQD,CAAc;GAAI,CAAA,IAAA,KAAA;GACjI,WAAU;GAAuD,OAAO,EAAE,YAAS;GAClF;EACI,CAAA,CACF;;AACN,CAAC;;;AClDD,SAAgBK,EAAa,EAAE,UAAO,aAAU,WAAQ,SAAM,mBAAgB,eAAY,cAAW,GAAGlB,KAA4B;CAEnI,OADImB,EAAM,WAAW,IAAU,OACxB,kBAACvC,GAAD;EAAO,GAAIoB;EAAO,KAAI;EAAK,WAAWtB,EAAG,oCAAoCsC,CAAS;EAC3F,UAAAG,EAAM,KAAI,MAAQ,kBAACvC,GAAD;GAAqB,WAAU;GAAa,KAAI;GAAK,SAAQ;GAAU,OAAM;GAAQ,MAAM;GAAO,WAAU;GAA5G,UAAA,CAClB,kBAACA,GAAD;IAAO,KAAI;IAAQ,WAAU;IAA7B,UAAA,CACC,kBAACD,GAAD;KAAM,MAAK;KAAU,WAAU;KAA/B,UAAA;MAAuEyC,EAAK;MAAK;MAAG,kBAAC3C,GAAD;OAAa,MAAK;OAAU,OAAO2C,EAAK;OAAkB;OAAQ,OAAM;MAAQ,CAAA;KAAO;IAC1K,CAAA,GAAAA,EAAK,eAAe,QAAQ,kBAACzC,GAAD;KAAM,MAAK;KAAK,MAAK;KAAY,WAAU;KAAwC,UAAAyC,EAAK;IAAkB,CAAA,CACjI;GACP,CAAA,GAAA,kBAACrC,GAAD;IAAO,MAAK;IAAU,QAAQqC,EAAK,SAASA,EAAK,WAAWA,EAAK;IAAqB;IAAkB;IAAc;IAAsB;IAA4B;IAAY,WAAU;GAAuF,CAAA,CAC/Q;EANwB,GAAAA,EAAK,EAM7B,CAAC;CACF,CAAA;AACR"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { v as e } from "./ui-provider-C-74NVLc.js";
|
|
3
|
+
import { t } from "./utils-DhuoqFy4.js";
|
|
4
|
+
import { i as n } from "./text.styles-B64My8RZ.js";
|
|
5
|
+
import { n as r, t as i } from "./sanitize-html-BWkH4dLM.js";
|
|
6
|
+
import { t as a } from "./content-typography-CnwgMJ37.js";
|
|
7
|
+
import { t as o } from "./rich-text-tree-BqyQ_7-R.js";
|
|
8
|
+
import { forwardRef as s, useMemo as c } from "react";
|
|
9
|
+
import { jsx as l } from "react/jsx-runtime";
|
|
10
|
+
//#region src/components/typography/rich-text/rich-text.tsx
|
|
11
|
+
var u = s(function({ html: s, type: u = "main", size: d, align: f = "left", lineHeight: p = "normal", weight: m = "regular", className: h, numeric: g = !1, tag: _ = "p", images: v = !1, ...y }, b) {
|
|
12
|
+
let { defaultTextSize: x } = e(), S = d ?? x ?? "sm", C = !!v, w = typeof v == "object" ? v.renderImage : void 0, T = c(() => i(s ?? "", { images: C }), [C, s]), E = c(() => w && T ? o(r(s ?? "", { images: !0 }), w) : null, [
|
|
13
|
+
s,
|
|
14
|
+
w,
|
|
15
|
+
T
|
|
16
|
+
]);
|
|
17
|
+
if (!T) return null;
|
|
18
|
+
let D = t(a, n({
|
|
19
|
+
type: u,
|
|
20
|
+
size: S,
|
|
21
|
+
align: f,
|
|
22
|
+
lineHeight: p,
|
|
23
|
+
weight: m,
|
|
24
|
+
numeric: g,
|
|
25
|
+
className: h
|
|
26
|
+
}));
|
|
27
|
+
return E ? /* @__PURE__ */ l(_, {
|
|
28
|
+
ref: b,
|
|
29
|
+
className: D,
|
|
30
|
+
"data-typography": "rich-text",
|
|
31
|
+
...y,
|
|
32
|
+
children: E
|
|
33
|
+
}) : /* @__PURE__ */ l(_, {
|
|
34
|
+
ref: b,
|
|
35
|
+
className: D,
|
|
36
|
+
"data-typography": "rich-text",
|
|
37
|
+
dangerouslySetInnerHTML: { __html: T },
|
|
38
|
+
...y
|
|
39
|
+
});
|
|
40
|
+
});
|
|
41
|
+
u.displayName = "RichText";
|
|
42
|
+
//#endregion
|
|
43
|
+
export { u as t };
|
|
44
|
+
|
|
45
|
+
//# sourceMappingURL=rich-text-BnTzZjIo.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rich-text-BnTzZjIo.js","names":["useTypographyConfig","resolveTextClassNames","sanitizeHtmlTree","sanitizeHtml","contentTypographyClassName","renderRichTextTree","RichText","forwardRef","sizeProp","Tag","props","size","defaultTextSize","allowImages","images","renderImage","sanitizedHtml","useMemo","html","tree","classNames","cn"],"sources":["../src/components/typography/rich-text/rich-text.tsx"],"sourcesContent":["import { forwardRef, useMemo } from 'react';\n\nimport { sanitizeHtml, sanitizeHtmlTree } from '../../../lib/sanitize-html';\nimport { useTypographyConfig } from '../../../lib/ui-provider';\nimport { cn } from '../../../lib/utils';\nimport { contentTypographyClassName } from '../content-typography';\n\nimport type { TextProps } from '../text';\nimport { resolveTextClassNames } from '../text.styles';\nimport { renderRichTextTree, type RenderRichTextImage } from './rich-text-tree';\n\nexport type { RenderRichTextImage, RichTextImageAttributes } from './rich-text-tree';\n\n/** Image rendering for read-only rich text. */\nexport interface RichTextImageRendering {\n\t/**\n\t * Renders each image, for example with a framework image component. It\n\t * receives only sources that passed the package image policy.\n\t */\n\trenderImage?: RenderRichTextImage;\n}\n\nexport interface RichTextProps\n\textends Omit<\n\t\tTextProps,\n\t\t'children' | 'content' | 'dangerouslySetInnerHTML'\n\t> {\n\t/** HTML sanitized through the package allowlist before rendering. */\n\thtml?: string | null;\n\t/**\n\t * Keeps images whose source is a web URL, a `blob:` preview or a relative\n\t * path (script and `data:` sources are removed). Pass `renderImage` to draw\n\t * each image with your own component. Default: images are removed.\n\t */\n\timages?: boolean | RichTextImageRendering;\n}\n\nexport const RichText = forwardRef<HTMLElement, RichTextProps>(\n\tfunction RichText(\n\t\t{\n\t\t\thtml,\n\t\t\ttype = 'main',\n\t\t\tsize: sizeProp,\n\t\t\talign = 'left',\n\t\t\tlineHeight = 'normal',\n\t\t\tweight = 'regular',\n\t\t\tclassName,\n\t\t\tnumeric = false,\n\t\t\ttag: Tag = 'p',\n\t\t\timages = false,\n\t\t\t...props\n\t\t},\n\t\tref,\n\t) {\n\t\tconst { defaultTextSize } = useTypographyConfig();\n\t\tconst size = sizeProp ?? defaultTextSize ?? 'sm';\n\t\tconst allowImages = Boolean(images);\n\t\tconst renderImage = typeof images === 'object' ? images.renderImage : undefined;\n\t\tconst sanitizedHtml = useMemo(() => sanitizeHtml(html ?? '', { images: allowImages }), [allowImages, html]);\n\t\t// Consumer image components need React elements; plain images keep the HTML path.\n\t\tconst tree = useMemo(\n\t\t\t() => (renderImage && sanitizedHtml ? renderRichTextTree(sanitizeHtmlTree(html ?? '', { images: true }), renderImage) : null),\n\t\t\t[html, renderImage, sanitizedHtml],\n\t\t);\n\n\t\tif (!sanitizedHtml) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst classNames = cn(contentTypographyClassName, resolveTextClassNames({\n\t\t\ttype,\n\t\t\tsize,\n\t\t\talign,\n\t\t\tlineHeight,\n\t\t\tweight,\n\t\t\tnumeric,\n\t\t\tclassName,\n\t\t}));\n\n\t\tif (tree) {\n\t\t\treturn (\n\t\t\t\t<Tag ref={ref as never} className={classNames} data-typography=\"rich-text\" {...props}>\n\t\t\t\t\t{tree}\n\t\t\t\t</Tag>\n\t\t\t);\n\t\t}\n\n\t\treturn (\n\t\t\t<Tag\n\t\t\t\tref={ref as never}\n\t\t\t\tclassName={classNames}\n\t\t\t\tdata-typography=\"rich-text\"\n\t\t\t\tdangerouslySetInnerHTML={{ __html: sanitizedHtml }}\n\t\t\t\t{...props}\n\t\t\t/>\n\t\t);\n\t},\n);\n\nRichText.displayName = 'RichText';\n"],"mappings":";;;;;;;;;;AAqCA,IAAaM,IAAWC,EACvB,SACC,EACC,SACA,UAAO,QACP,MAAMC,GACN,WAAQ,QACR,gBAAa,UACb,YAAS,WACT,cACA,aAAU,IACV,KAAKC,IAAM,KACX,YAAS,IACT,GAAGC,KAEJ,GACC;CACD,IAAM,EAAE,uBAAoBV,EAAoB,GAC1CW,IAAOH,KAAYI,KAAmB,MACtCC,IAAc,EAAQC,GACtBC,IAAc,OAAOD,KAAW,WAAWA,EAAO,cAAc,KAAA,GAChEE,IAAgBC,QAAcd,EAAae,KAAQ,IAAI,EAAE,QAAQL,EAAY,CAAC,GAAG,CAACA,GAAaK,CAAI,CAAC,GAEpGC,IAAOF,QACLF,KAAeC,IAAgBX,EAAmBH,EAAiBgB,KAAQ,IAAI,EAAE,QAAQ,GAAK,CAAC,GAAGH,CAAW,IAAI,MACxH;EAACG;EAAMH;EAAaC;CAAa,CAClC;CAEA,IAAI,CAACA,GACJ,OAAO;CAGR,IAAMI,IAAaC,EAAGjB,GAA4BH,EAAsB;EACvE;EACA;EACA;EACA;EACA;EACA;EACA;CACD,CAAC,CAAC;CAUF,OARIkB,IAEF,kBAACV,GAAD;EAAU;EAAc,WAAWW;EAAY,mBAAgB;EAAY,GAAIV;EAC7E,UAAAS;CACG,CAAA,IAKN,kBAACV,GAAD;EACM;EACL,WAAWW;EACX,mBAAgB;EAChB,yBAAyB,EAAE,QAAQJ,EAAc;EACjD,GAAIN;CACJ,CAAA;AAEH,CACD;AAEA,EAAS,cAAc"}
|