themelia-react-ui 2.0.0 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +351 -0
- package/README.md +26 -13
- package/dist/{accordion-CQXVcd7Q.js → accordion-B6a3vVgA.js} +84 -82
- package/dist/accordion-B6a3vVgA.js.map +1 -0
- package/dist/action-menu-TzCoSlwL.js +280 -0
- package/dist/action-menu-TzCoSlwL.js.map +1 -0
- package/dist/{affordance-geometry.generated-CCIXb2A1.js → affordance-geometry.generated-B5iu-Mkr.js} +3 -2
- package/dist/affordance-geometry.generated-B5iu-Mkr.js.map +1 -0
- package/dist/{ai-artifact-2PQ2fItc.js → ai-artifact-BMJdv-6q.js} +379 -376
- package/dist/ai-artifact-BMJdv-6q.js.map +1 -0
- package/dist/{app-shell-BE_j8-AT.js → app-shell-ZK5RWdo6.js} +4 -4
- package/dist/{app-shell-BE_j8-AT.js.map → app-shell-ZK5RWdo6.js.map} +1 -1
- package/dist/attachment-BtfhGm8i.js +245 -0
- package/dist/attachment-BtfhGm8i.js.map +1 -0
- package/dist/{auth-M3vGMgDR.js → auth-CYxKfo69.js} +237 -235
- package/dist/auth-CYxKfo69.js.map +1 -0
- package/dist/{avatar-djdaaQ_s.js → avatar-BBnEJIx8.js} +66 -65
- package/dist/avatar-BBnEJIx8.js.map +1 -0
- package/dist/badge-MrKVNzW9.js +93 -0
- package/dist/badge-MrKVNzW9.js.map +1 -0
- 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 +3 -0
- package/dist/base/buttons.js +2 -3
- package/dist/base/cards.js +2 -2
- package/dist/base/carousel.js +13 -13
- package/dist/base/carousel.js.map +1 -1
- package/dist/base/cascader.js +103 -115
- package/dist/base/cascader.js.map +1 -1
- package/dist/base/chart.js +1 -1
- package/dist/base/choice-inputs.js +3 -3
- package/dist/base/code-block.js +1 -1
- package/dist/base/combobox.js +1 -1
- 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 +7 -7
- package/dist/base/feedback.js +3 -3
- package/dist/base/forms-numeric.js +1 -1
- package/dist/base/forms.js +2 -2
- package/dist/base/inline-edit.js +17 -17
- package/dist/base/inline-edit.js.map +1 -1
- package/dist/base/item.js +1 -1
- package/dist/base/media-gallery.js +1 -1
- package/dist/base/metadata-list.js +3 -0
- 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 +171 -170
- package/dist/base/repeaters.js.map +1 -1
- package/dist/base/sheet.js +1 -1
- package/dist/base/sidebar.js +1 -1
- package/dist/base/signature-pad.js +147 -137
- package/dist/base/signature-pad.js.map +1 -1
- package/dist/base/skeleton.js +1 -1
- package/dist/base/spinner.js +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 +2 -2
- 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 +2 -2
- package/dist/batch-action-bar-BZGDG-Si.js +104 -0
- package/dist/batch-action-bar-BZGDG-Si.js.map +1 -0
- package/dist/blocks/admin.js +173 -171
- package/dist/blocks/admin.js.map +1 -1
- package/dist/blocks/ai.js +266 -263
- package/dist/blocks/ai.js.map +1 -1
- package/dist/blocks/analytics/usage-card.js +1 -1
- package/dist/blocks/analytics.js +440 -438
- 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 +1945 -1266
- package/dist/blocks/commerce.js.map +1 -1
- package/dist/blocks/data-display.js +3 -2
- package/dist/blocks/onboarding.js +50 -49
- package/dist/blocks/onboarding.js.map +1 -1
- package/dist/blocks/planning.js +25 -25
- package/dist/blocks/planning.js.map +1 -1
- package/dist/blocks/timelines.js +1 -1
- package/dist/breadcrumbs-D5t7I023.js +129 -0
- package/dist/breadcrumbs-D5t7I023.js.map +1 -0
- package/dist/{button-R9CCoH7A.js → button-QYwiyhD2.js} +15 -14
- package/dist/button-QYwiyhD2.js.map +1 -0
- package/dist/{button-BS3KDg00.js → buttons-SbIcm1HJ.js} +200 -213
- package/dist/buttons-SbIcm1HJ.js.map +1 -0
- package/dist/{cards-QoJ4syG9.js → cards-CiiHpKYd.js} +8 -8
- package/dist/cards-CiiHpKYd.js.map +1 -0
- package/dist/{chart-DwYRKKc-.js → chart-QfrARkXl.js} +5 -5
- package/dist/{chart-DwYRKKc-.js.map → chart-QfrARkXl.js.map} +1 -1
- package/dist/checkbox-DhB6K0bK.js +36 -0
- package/dist/checkbox-DhB6K0bK.js.map +1 -0
- package/dist/choice-inputs-t6w3ATNz.js +766 -0
- package/dist/choice-inputs-t6w3ATNz.js.map +1 -0
- package/dist/code-block-Dgbu-CU3.js +185 -0
- package/dist/code-block-Dgbu-CU3.js.map +1 -0
- package/dist/{collapsible-oMUGM4tr.js → collapsible-D8AEGU1-.js} +4 -4
- package/dist/{collapsible-oMUGM4tr.js.map → collapsible-D8AEGU1-.js.map} +1 -1
- package/dist/{collection-content-Ys-OZOkY.js → collection-content-uK16Grv0.js} +3 -3
- package/dist/{collection-content-Ys-OZOkY.js.map → collection-content-uK16Grv0.js.map} +1 -1
- package/dist/{combobox-6dvVny2q.js → combobox-2Ic8N9bL.js} +74 -68
- package/dist/combobox-2Ic8N9bL.js.map +1 -0
- package/dist/{combobox-CB7039j7.js → combobox-DLl0bfiq.js} +307 -305
- package/dist/combobox-DLl0bfiq.js.map +1 -0
- package/dist/{command-kPMPjIxJ.js → command-kNR20o7x.js} +7 -7
- package/dist/{command-kPMPjIxJ.js.map → command-kNR20o7x.js.map} +1 -1
- package/dist/{comments-You0Bzbr.js → comments-BpDuCUUu.js} +341 -339
- package/dist/comments-BpDuCUUu.js.map +1 -0
- package/dist/components/base/action-menu/action-menu.d.ts +21 -4
- package/dist/components/base/action-menu/action-menu.recipes.d.ts +21 -0
- package/dist/components/base/action-menu/index.d.ts +1 -0
- package/dist/components/base/badge/badge.recipes.d.ts +4 -4
- package/dist/components/base/batch-action-bar/batch-action-bar.d.ts +50 -0
- package/dist/components/base/batch-action-bar/batch-action-bar.strings.d.ts +20 -0
- package/dist/components/base/batch-action-bar/index.d.ts +8 -0
- package/dist/components/base/buttons/button-group.recipes.d.ts +1 -1
- package/dist/components/base/buttons/button.recipes.d.ts +2 -2
- package/dist/components/base/choice-inputs/checkbox.d.ts +2 -2
- package/dist/components/base/choice-inputs/choice-types.d.ts +18 -6
- package/dist/components/base/display/alert-dialog.d.ts +6 -5
- package/dist/components/base/display/dialog.d.ts +4 -8
- package/dist/components/base/display/icon-badge/icon-badge.d.ts +1 -1
- package/dist/components/base/forms/form-sizing.d.ts +15 -12
- package/dist/components/base/metadata-list/index.d.ts +12 -0
- package/dist/components/{blocks/data-display/metadata → base/metadata-list}/metadata-list.d.ts +28 -25
- package/dist/components/{blocks/data-display/metadata → base/metadata-list}/metadata-value.d.ts +2 -2
- package/dist/components/base/navigation/index.d.ts +1 -1
- package/dist/components/base/navigation/page-header/index.d.ts +1 -0
- package/dist/components/base/navigation/page-header/page-header-commands.d.ts +73 -0
- package/dist/components/base/navigation/page-header/page-header.d.ts +26 -3
- package/dist/components/base/sheet/sheet.d.ts +4 -8
- package/dist/components/base/signature-pad/signature-pad.types.d.ts +5 -1
- package/dist/components/base/signature-pad/signature-pad.utils.d.ts +11 -3
- package/dist/components/base/text-inputs/field-clear-button.d.ts +6 -0
- package/dist/components/base/upload/upload.recipes.d.ts +25 -3
- package/dist/components/base/value-inputs/index.d.ts +5 -5
- package/dist/components/base/value-inputs/tags-input.d.ts +36 -12
- package/dist/components/blocks/commerce/address-card/address-card.d.ts +1 -1
- package/dist/components/blocks/commerce/address-card/types.d.ts +2 -1
- package/dist/components/blocks/commerce/cart-summary/cart-summary.d.ts +3 -1
- package/dist/components/blocks/commerce/cart-summary/index.d.ts +2 -2
- package/dist/components/blocks/commerce/cart-summary/types.d.ts +6 -1
- package/dist/components/blocks/commerce/discount-stack/discount-stack.d.ts +3 -1
- package/dist/components/blocks/commerce/discount-stack/index.d.ts +2 -2
- package/dist/components/blocks/commerce/discount-stack/types.d.ts +16 -4
- package/dist/components/blocks/commerce/fulfillment-group/fulfillment-group.d.ts +5 -0
- package/dist/components/blocks/commerce/fulfillment-group/index.d.ts +2 -0
- package/dist/components/blocks/commerce/fulfillment-group/types.d.ts +43 -0
- package/dist/components/blocks/commerce/index.d.ts +13 -5
- package/dist/components/blocks/commerce/invoice-header/invoice-header.d.ts +1 -1
- package/dist/components/blocks/commerce/invoice-header/types.d.ts +4 -2
- package/dist/components/blocks/commerce/invoice-mini/invoice-mini.d.ts +1 -1
- package/dist/components/blocks/commerce/invoice-mini/types.d.ts +2 -1
- package/dist/components/blocks/commerce/order-customer/index.d.ts +2 -0
- package/dist/components/blocks/commerce/order-customer/order-customer.d.ts +5 -0
- package/dist/components/blocks/commerce/order-customer/types.d.ts +48 -0
- package/dist/components/blocks/commerce/order-header/index.d.ts +2 -0
- package/dist/components/blocks/commerce/order-header/order-header.d.ts +5 -0
- package/dist/components/blocks/commerce/order-header/types.d.ts +37 -0
- package/dist/components/blocks/commerce/order-line-item/index.d.ts +2 -0
- package/dist/components/blocks/commerce/order-line-item/order-line-item.d.ts +5 -0
- package/dist/components/blocks/commerce/order-line-item/types.d.ts +46 -0
- package/dist/components/blocks/commerce/order-summary/index.d.ts +2 -0
- package/dist/components/blocks/commerce/order-summary/order-summary.d.ts +5 -0
- package/dist/components/blocks/commerce/order-summary/types.d.ts +42 -0
- package/dist/components/blocks/commerce/order-transactions/index.d.ts +2 -0
- package/dist/components/blocks/commerce/order-transactions/order-transactions.d.ts +5 -0
- package/dist/components/blocks/commerce/order-transactions/types.d.ts +46 -0
- package/dist/components/blocks/commerce/payment-method/index.d.ts +2 -2
- package/dist/components/blocks/commerce/payment-method/payment-method.d.ts +9 -1
- package/dist/components/blocks/commerce/payment-method/types.d.ts +12 -1
- package/dist/components/blocks/commerce/refund-status/index.d.ts +2 -2
- package/dist/components/blocks/commerce/refund-status/refund-status.d.ts +3 -1
- package/dist/components/blocks/commerce/refund-status/types.d.ts +6 -3
- package/dist/components/blocks/commerce/shared/address-lines.d.ts +21 -0
- package/dist/components/blocks/commerce/shared/line-thumbnail.d.ts +9 -0
- package/dist/components/blocks/commerce/shared/order-status.d.ts +51 -0
- package/dist/components/blocks/commerce/shipment-tracking/shipment-tracking.d.ts +1 -1
- package/dist/components/blocks/commerce/shipment-tracking/types.d.ts +27 -6
- package/dist/components/blocks/commerce/summary-panel/amount-row.d.ts +2 -0
- package/dist/components/blocks/commerce/summary-panel/index.d.ts +3 -0
- package/dist/components/blocks/commerce/summary-panel/summary-panel.d.ts +2 -0
- package/dist/components/blocks/commerce/summary-panel/types.d.ts +26 -0
- package/dist/components/blocks/commerce/tax-breakdown/tax-breakdown.d.ts +1 -1
- package/dist/components/blocks/commerce/tax-breakdown/types.d.ts +2 -1
- package/dist/components/blocks/data-display/metadata/index.d.ts +30 -4
- package/dist/components/features/activities/partials/activity-row.d.ts +6 -2
- package/dist/components/features/activities/partials/tone-tokens.d.ts +0 -6
- package/dist/components/features/global-search/partials/global-search-group-heading.d.ts +15 -0
- package/dist/components/features/global-search/partials/tone-palettes.d.ts +0 -5
- package/dist/components/features/kanban/kanban.d.ts +1 -1
- package/dist/components/features/kanban/kanban.strings.d.ts +1 -1
- package/dist/components/features/kanban/kanban.types.d.ts +2 -2
- package/dist/components/features/media-library/hooks/use-media-library.d.ts +1 -1
- package/dist/components/features/media-library/index.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 +4 -0
- package/dist/components/features/media-library/media-library.types.d.ts +74 -1
- package/dist/components/features/media-library/partials/media-library-partials.d.ts +3 -3
- package/dist/components/features/mentions/partials/mention-kind-toggles.d.ts +16 -0
- package/dist/components/features/overlays/alert-dialog.d.ts +1 -1
- package/dist/components/features/overlays/dialog.d.ts +1 -1
- package/dist/components/features/overlays/index.d.ts +1 -1
- package/dist/components/features/overlays/overlay-tone-icon.d.ts +3 -3
- package/dist/components/features/overlays/overlays.types.d.ts +20 -0
- package/dist/components/features/products/components/product-contract-overview.d.ts +5 -0
- package/dist/components/features/products/components/product-details-card.d.ts +5 -0
- package/dist/components/features/products/components/product-operations-card.d.ts +5 -0
- package/dist/components/features/products/components/product-option-action-menu.d.ts +5 -0
- package/dist/components/features/products/components/product-options-summary.d.ts +5 -0
- package/dist/components/features/products/components/product-policies-card.d.ts +5 -0
- package/dist/components/features/products/components/product-quote-preview-card.d.ts +5 -0
- package/dist/components/features/products/components/product-readiness-card.d.ts +5 -0
- package/dist/components/features/products/components/product-structure-card.d.ts +5 -0
- package/dist/components/features/products/components/product-variant-action-menu.d.ts +23 -1
- package/dist/components/features/products/products.types.d.ts +9 -2
- package/dist/components/features/resource/index.d.ts +1 -1
- package/dist/components/features/resource/resource.d.ts +1 -1
- package/dist/components/features/resource/resource.types.d.ts +34 -6
- package/dist/components/features/rich-text-editor/index.d.ts +2 -1
- package/dist/components/features/rich-text-editor/partials/image-nodes.d.ts +13 -0
- package/dist/components/features/rich-text-editor/partials/image-uploads.d.ts +66 -0
- package/dist/components/features/rich-text-editor/partials/inline-reference-node.d.ts +19 -0
- package/dist/components/features/rich-text-editor/rich-text-editor.recipes.d.ts +1 -1
- package/dist/components/features/rich-text-editor/rich-text-editor.strings.d.ts +14 -0
- package/dist/components/features/rich-text-editor/rich-text-editor.types.d.ts +45 -0
- package/dist/components/features/rich-text-editor/use-rich-text-images.d.ts +18 -0
- package/dist/components/features/sync/index.d.ts +26 -3
- package/dist/components/features/table/data-table.d.ts +1 -1
- package/dist/components/features/table/table.types.d.ts +32 -7
- package/dist/components/layout/page/index.d.ts +1 -1
- package/dist/components/layout/page/page.types.d.ts +33 -36
- package/dist/components/layout/page/partials/page-actions.d.ts +1 -0
- package/dist/components/layout/page/partials/page-header.d.ts +1 -1
- package/dist/components/layout/settings/settings.d.ts +16 -2
- package/dist/components/layout/workspace/workspace.types.d.ts +21 -4
- package/dist/components/typography/rich-text/index.d.ts +1 -1
- package/dist/components/typography/rich-text/rich-text-tree.d.ts +19 -0
- package/dist/components/typography/rich-text/rich-text.d.ts +16 -0
- package/dist/components/typography/text-link.d.ts +4 -3
- package/dist/components/ui/checkbox.d.ts +4 -3
- package/dist/components/ui/overlay.recipes.d.ts +0 -9
- package/dist/components/ui/switch.d.ts +2 -2
- package/dist/{containers-D_L4mTVb.js → containers-DmWiJa2I.js} +36 -35
- package/dist/containers-DmWiJa2I.js.map +1 -0
- package/dist/{copyable-DDjTeW_j.js → copyable-B3Gwgdqc.js} +6 -6
- package/dist/{copyable-DDjTeW_j.js.map → copyable-B3Gwgdqc.js.map} +1 -1
- package/dist/data-display-DafIvCl5.js +960 -0
- package/dist/data-display-DafIvCl5.js.map +1 -0
- package/dist/{date-uf3z37Nm.js → date-BgK3bTdo.js} +5 -5
- package/dist/{date-uf3z37Nm.js.map → date-BgK3bTdo.js.map} +1 -1
- package/dist/date-picker-CF-DtUpF.js +1529 -0
- package/dist/date-picker-CF-DtUpF.js.map +1 -0
- package/dist/{date-pickers-CnFCb0n2.js → date-pickers-BmzxJl5l.js} +19 -19
- package/dist/{date-pickers-CnFCb0n2.js.map → date-pickers-BmzxJl5l.js.map} +1 -1
- package/dist/{display-DrdvPwF0.js → display-DsQTVzMz.js} +88 -87
- package/dist/display-DsQTVzMz.js.map +1 -0
- package/dist/{dropdown-menu-CURh59jb.js → dropdown-menu-E2qmdC7o.js} +7 -7
- package/dist/{dropdown-menu-CURh59jb.js.map → dropdown-menu-E2qmdC7o.js.map} +1 -1
- package/dist/features/activities.js +414 -501
- package/dist/features/activities.js.map +1 -1
- package/dist/features/ai-chat.js +170 -169
- package/dist/features/ai-chat.js.map +1 -1
- package/dist/features/async-preview.js +8 -8
- 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 +139 -138
- package/dist/features/data-view.js.map +1 -1
- package/dist/features/email-composer/engine.js +1 -1
- package/dist/features/email-composer.js +73 -71
- package/dist/features/email-composer.js.map +1 -1
- package/dist/features/event-calendar.js +278 -275
- package/dist/features/event-calendar.js.map +1 -1
- package/dist/features/filters.js +1 -1
- package/dist/features/global-search.js +307 -310
- package/dist/features/global-search.js.map +1 -1
- package/dist/features/kanban.js +95 -97
- package/dist/features/kanban.js.map +1 -1
- package/dist/features/map.js +56 -57
- package/dist/features/map.js.map +1 -1
- package/dist/features/media-library.js +918 -825
- package/dist/features/media-library.js.map +1 -1
- package/dist/features/mentions.js +1 -1
- package/dist/features/overlays.js +1 -1
- package/dist/features/products.js +1115 -1122
- package/dist/features/products.js.map +1 -1
- package/dist/features/questionnaire.js +202 -194
- package/dist/features/questionnaire.js.map +1 -1
- package/dist/features/resource-assignment.js +25 -25
- package/dist/features/resource-assignment.js.map +1 -1
- package/dist/features/resource.js +77 -69
- package/dist/features/resource.js.map +1 -1
- package/dist/features/rich-text-editor.js +30 -11
- package/dist/features/rich-text-editor.js.map +1 -1
- package/dist/features/schema-form.js +33 -33
- package/dist/features/schema-form.js.map +1 -1
- package/dist/features/suggestions.js +3 -3
- package/dist/features/sync.js +3 -3
- package/dist/features/table.js +1 -1
- package/dist/features/theme-tweaker.js +397 -396
- package/dist/features/theme-tweaker.js.map +1 -1
- package/dist/{feedback-C7nR0UtT.js → feedback-qNuMBtRH.js} +84 -83
- package/dist/feedback-qNuMBtRH.js.map +1 -0
- package/dist/{field-affordance-recipes-CkOCdE2y.js → field-affordance-recipes-qQeIf4lG.js} +8 -6
- package/dist/field-affordance-recipes-qQeIf4lG.js.map +1 -0
- package/dist/field-state-recipes-BVA2CWHo.js +12 -0
- package/dist/field-state-recipes-BVA2CWHo.js.map +1 -0
- package/dist/{filters-Da-gNPsE.js → filters-BkHH53uv.js} +565 -563
- package/dist/filters-BkHH53uv.js.map +1 -0
- package/dist/focus-recipes-B653VaLq.js +12 -0
- package/dist/focus-recipes-B653VaLq.js.map +1 -0
- package/dist/{form-field-VZRULhUK.js → form-field-DUt4UxSV.js} +4 -4
- package/dist/{form-field-VZRULhUK.js.map → form-field-DUt4UxSV.js.map} +1 -1
- package/dist/{form-sizing-uWP4lzVh.js → form-sizing-By94KzXE.js} +19 -15
- package/dist/form-sizing-By94KzXE.js.map +1 -0
- package/dist/{forms-DDeEnXSY.js → forms-Bzha-Y3B.js} +22 -22
- package/dist/{forms-DDeEnXSY.js.map → forms-Bzha-Y3B.js.map} +1 -1
- package/dist/{forms-numeric-D3CO60IF.js → forms-numeric-C0bvjRPZ.js} +265 -264
- package/dist/forms-numeric-C0bvjRPZ.js.map +1 -0
- package/dist/{header-2ycNqGOR.js → header-BOefOKd1.js} +47 -51
- package/dist/header-BOefOKd1.js.map +1 -0
- package/dist/{hooks-DQ5SPwZw.js → hooks-9k_TtmKh.js} +2 -2
- package/dist/{hooks-DQ5SPwZw.js.map → hooks-9k_TtmKh.js.map} +1 -1
- package/dist/{http-CdEIHyQf.js → http-D_6rOnzU.js} +2 -2
- package/dist/{http-CdEIHyQf.js.map → http-D_6rOnzU.js.map} +1 -1
- package/dist/icon-badge-CAuKupo9.js +55 -0
- package/dist/icon-badge-CAuKupo9.js.map +1 -0
- package/dist/index.js +7 -7
- package/dist/input-DWhBBBww.js +262 -0
- package/dist/input-DWhBBBww.js.map +1 -0
- package/dist/{input-BoLm9Hks.js → input-Ddi_LSYv.js} +3 -3
- package/dist/{input-BoLm9Hks.js.map → input-Ddi_LSYv.js.map} +1 -1
- package/dist/interaction-recipes-CHr0dJUs.js +24 -0
- package/dist/interaction-recipes-CHr0dJUs.js.map +1 -0
- package/dist/{item-xzh8Df65.js → item-DEmDiTlD.js} +98 -97
- package/dist/item-DEmDiTlD.js.map +1 -0
- package/dist/layer-recipes-CCpklYME.js +13 -0
- package/dist/layer-recipes-CCpklYME.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 +1 -1
- package/dist/layout/settings.js +1 -1
- package/dist/layout/sidebar.js +2 -2
- package/dist/layout/workspace.js +1 -1
- package/dist/layout.js +10 -10
- package/dist/lib/affordance-geometry.generated.d.ts +1 -0
- package/dist/lib/field-affordance-recipes.d.ts +6 -1
- package/dist/lib/field-state-recipes.d.ts +9 -8
- package/dist/lib/focus-recipes.d.ts +24 -0
- package/dist/lib/interaction-recipes.d.ts +35 -0
- package/dist/lib/layer-recipes.d.ts +19 -0
- package/dist/lib/motion-recipes.d.ts +1 -0
- package/dist/lib/overlay-anatomy-recipes.d.ts +1 -0
- package/dist/lib/safe-image-src.d.ts +10 -0
- package/dist/lib/sanitize-html.d.ts +15 -3
- package/dist/lib/surface-recipes.d.ts +47 -7
- package/dist/lib/token-merge.generated.d.ts +9 -6
- package/dist/lib/tone-recipes.d.ts +79 -0
- package/dist/lib/ui-provider/hooks.d.ts +2 -1
- package/dist/lib/ui-provider/index.d.ts +2 -2
- package/dist/lib/ui-provider/types.d.ts +9 -0
- package/dist/lib/utils.js +1 -1
- package/dist/media-gallery-DcTtAaeC.js +203 -0
- package/dist/media-gallery-DcTtAaeC.js.map +1 -0
- package/dist/mentions-D-uyCh01.js +568 -0
- package/dist/mentions-D-uyCh01.js.map +1 -0
- package/dist/{message-YfFmbXNP.js → message-CdHgIWKf.js} +5 -5
- package/dist/{message-YfFmbXNP.js.map → message-CdHgIWKf.js.map} +1 -1
- package/dist/metadata-list-X5rYAKSB.js +394 -0
- package/dist/metadata-list-X5rYAKSB.js.map +1 -0
- package/dist/{motion-recipes-B6jKXEcN.js → motion-recipes-ChBg4HBq.js} +3 -2
- package/dist/{motion-recipes-B6jKXEcN.js.map → motion-recipes-ChBg4HBq.js.map} +1 -1
- package/dist/navigation-D3KwXmaq.js +145 -0
- package/dist/navigation-D3KwXmaq.js.map +1 -0
- package/dist/navigation-HJf5zxlH.js +268 -0
- package/dist/navigation-HJf5zxlH.js.map +1 -0
- package/dist/{navigation-row-recipes-DlU-4QYO.js → navigation-row-recipes-BVowojQw.js} +2 -2
- package/dist/{navigation-row-recipes-DlU-4QYO.js.map → navigation-row-recipes-BVowojQw.js.map} +1 -1
- package/dist/{number-CKRBYmZK.js → number-DMhe-Vsk.js} +5 -5
- package/dist/{number-CKRBYmZK.js.map → number-DMhe-Vsk.js.map} +1 -1
- package/dist/overflow-tab-bar-sQHXLlwQ.js +280 -0
- package/dist/overflow-tab-bar-sQHXLlwQ.js.map +1 -0
- package/dist/overlay.recipes-8GHqmlb4.js +6 -0
- package/dist/overlay.recipes-8GHqmlb4.js.map +1 -0
- package/dist/overlays-I0axtYA6.js +999 -0
- package/dist/overlays-I0axtYA6.js.map +1 -0
- package/dist/page-B5dTH9gE.js +224 -0
- package/dist/page-B5dTH9gE.js.map +1 -0
- package/dist/page-header-commands-DjzFEq3E.js +126 -0
- package/dist/page-header-commands-DjzFEq3E.js.map +1 -0
- package/dist/{pagination-Cm0jqa3I.js → pagination-3bPA_a6K.js} +15 -15
- package/dist/{pagination-Cm0jqa3I.js.map → pagination-3bPA_a6K.js.map} +1 -1
- package/dist/{popover-Dcv_9jxr.js → popover-Di55PyAI.js} +8 -8
- package/dist/popover-Di55PyAI.js.map +1 -0
- package/dist/{popover-menu-DnRFKnHP.js → popover-menu-B71Tn2Qz.js} +6 -6
- package/dist/{popover-menu-DnRFKnHP.js.map → popover-menu-B71Tn2Qz.js.map} +1 -1
- package/dist/{popover.recipes-wmbvL8Ah.js → popover.recipes-Bdyhj2db.js} +2 -2
- package/dist/{popover.recipes-wmbvL8Ah.js.map → popover.recipes-Bdyhj2db.js.map} +1 -1
- package/dist/{primitives-BHrwQXFC.js → primitives-B-CkiEMU.js} +5 -5
- package/dist/{primitives-BHrwQXFC.js.map → primitives-B-CkiEMU.js.map} +1 -1
- package/dist/primitives.js +4 -4
- package/dist/{progress-Br9WTFya.js → progress-rnS8-uAW.js} +9 -9
- package/dist/{progress-Br9WTFya.js.map → progress-rnS8-uAW.js.map} +1 -1
- package/dist/{receipt-CV89q1fs.js → receipt-D0oswZ0p.js} +6 -6
- package/dist/{receipt-CV89q1fs.js.map → receipt-D0oswZ0p.js.map} +1 -1
- package/dist/rich-text-DvGulsNJ.js +78 -0
- package/dist/rich-text-DvGulsNJ.js.map +1 -0
- package/dist/rich-text-editor-sMU_Scqm.js +1204 -0
- package/dist/rich-text-editor-sMU_Scqm.js.map +1 -0
- package/dist/rich-text-editor.recipes-CadiF_Uu.js +88 -0
- package/dist/rich-text-editor.recipes-CadiF_Uu.js.map +1 -0
- package/dist/rich-text-editor.strings-CB59ekH2.js +38 -0
- package/dist/rich-text-editor.strings-CB59ekH2.js.map +1 -0
- package/dist/safe-image-src-C6kQSMBZ.js +17 -0
- package/dist/safe-image-src-C6kQSMBZ.js.map +1 -0
- package/dist/sanitize-html-DsQmI48u.js +92 -0
- package/dist/sanitize-html-DsQmI48u.js.map +1 -0
- package/dist/scroll-area-Bt_vXY2b.js +48 -0
- package/dist/scroll-area-Bt_vXY2b.js.map +1 -0
- package/dist/{separator-Do5GWDYi.js → separator-C8DlRGwF.js} +3 -3
- package/dist/{separator-Do5GWDYi.js.map → separator-C8DlRGwF.js.map} +1 -1
- package/dist/{separator-BMEvwnSX.js → separator-CYHnjsAb.js} +2 -2
- package/dist/{separator-BMEvwnSX.js.map → separator-CYHnjsAb.js.map} +1 -1
- package/dist/services/actions/action-adapters.d.ts +18 -0
- package/dist/services/actions/index.d.ts +1 -1
- package/dist/services/actions.js +16 -4
- package/dist/services/actions.js.map +1 -1
- package/dist/settings-CQW3b-Cu.js +170 -0
- package/dist/settings-CQW3b-Cu.js.map +1 -0
- package/dist/sheet-4SEvVYzA.js +210 -0
- package/dist/sheet-4SEvVYzA.js.map +1 -0
- package/dist/{sidebar-Crc9M9JV.js → sidebar-C7WWR29L.js} +180 -179
- package/dist/sidebar-C7WWR29L.js.map +1 -0
- package/dist/{sidebar-Cb8WzOvE.js → sidebar-d7Dg80ln.js} +16 -16
- package/dist/sidebar-d7Dg80ln.js.map +1 -0
- package/dist/{skeleton-DVMXr15h.js → skeleton-Cz890JZF.js} +9 -9
- package/dist/{skeleton-DVMXr15h.js.map → skeleton-Cz890JZF.js.map} +1 -1
- package/dist/smart-card-lFKxn5Hu.js +595 -0
- package/dist/smart-card-lFKxn5Hu.js.map +1 -0
- package/dist/{spinner-CmTAbEp0.js → spinner-fa3h1Aif.js} +7 -7
- package/dist/{spinner-CmTAbEp0.js.map → spinner-fa3h1Aif.js.map} +1 -1
- package/dist/{structure-hzCW-XsV.js → structure-DC2dygdA.js} +2 -2
- package/dist/{structure-hzCW-XsV.js.map → structure-DC2dygdA.js.map} +1 -1
- package/dist/style.css +1 -1
- package/dist/surface-recipes-BKRVW8Os.js +43 -0
- package/dist/surface-recipes-BKRVW8Os.js.map +1 -0
- package/dist/{table-D6zKeYQX.js → table-CIKyLUsy.js} +59 -58
- package/dist/table-CIKyLUsy.js.map +1 -0
- package/dist/table-CrcLN9Io.js +1458 -0
- package/dist/table-CrcLN9Io.js.map +1 -0
- package/dist/{tabs-Dk8E_knt.js → tabs-DwBJfjxX.js} +58 -57
- package/dist/tabs-DwBJfjxX.js.map +1 -0
- package/dist/{text-inputs-BFpku0Qd.js → text-inputs-aaK9wcDT.js} +74 -79
- package/dist/text-inputs-aaK9wcDT.js.map +1 -0
- package/dist/theme.css +3 -3
- package/dist/{timelines-CxuAFIc2.js → timelines-C_SBwHNP.js} +153 -150
- package/dist/timelines-C_SBwHNP.js.map +1 -0
- package/dist/tone-recipes-CPoExcTE.js +70 -0
- package/dist/tone-recipes-CPoExcTE.js.map +1 -0
- package/dist/tooltip-CsfgrfS7.js +111 -0
- package/dist/tooltip-CsfgrfS7.js.map +1 -0
- package/dist/{tree-BotPlyiD.js → tree-BiKhg8AY.js} +68 -66
- package/dist/tree-BiKhg8AY.js.map +1 -0
- package/dist/typography/rich-text.js +1 -1
- package/dist/typography-DTRkE9zL.js +117 -0
- package/dist/typography-DTRkE9zL.js.map +1 -0
- package/dist/typography.js +1 -1
- package/dist/{ui-provider-D2_TeLqw.js → ui-provider-1D_NSYzO.js} +11 -3
- package/dist/ui-provider-1D_NSYzO.js.map +1 -0
- package/dist/ui-provider.js +3 -3
- package/dist/{upload-B0WHW7ak.js → upload-BO8-CLN6.js} +209 -209
- package/dist/upload-BO8-CLN6.js.map +1 -0
- package/dist/{upload-queue-BHZ_wBfd.js → upload-queue-EOC8g1gf.js} +109 -111
- package/dist/upload-queue-EOC8g1gf.js.map +1 -0
- package/dist/upload.recipes-BbxTqrCT.js +61 -0
- package/dist/upload.recipes-BbxTqrCT.js.map +1 -0
- package/dist/{usage-card-U0YBLTNT.js → usage-card-obRaBskq.js} +46 -46
- package/dist/{usage-card-U0YBLTNT.js.map → usage-card-obRaBskq.js.map} +1 -1
- package/dist/{utils-Cospvlj1.js → utils-l5LpDw2z.js} +56 -24
- package/dist/utils-l5LpDw2z.js.map +1 -0
- package/dist/value-inputs-TAYMX111.js +947 -0
- package/dist/value-inputs-TAYMX111.js.map +1 -0
- package/dist/{value-typography-Deb3yQZg.js → value-typography-b8wpz1eX.js} +2 -2
- package/dist/{value-typography-Deb3yQZg.js.map → value-typography-b8wpz1eX.js.map} +1 -1
- package/dist/workspace-DH0v0KcB.js +407 -0
- package/dist/workspace-DH0v0KcB.js.map +1 -0
- package/docs/consumer-skill/SKILL.md +19 -20
- package/docs/consumer-skill/examples/app-layout.tsx +1 -1
- package/docs/consumer-skill/examples/composition.tsx +3 -3
- package/docs/consumer-skill/examples/detail.tsx +59 -12
- package/docs/consumer-skill/examples/edit.tsx +1 -1
- package/docs/consumer-skill/examples/receipt.tsx +2 -2
- package/docs/consumer-skill/examples/scoped-directory.tsx +1 -1
- package/docs/consumer-skill/examples/website.tsx +1 -1
- package/docs/consumer-skill/references/agents-md.md +33 -0
- package/docs/consumer-skill/references/analytics.md +1 -1
- package/docs/consumer-skill/references/composition.md +51 -8
- package/docs/consumer-skill/references/design-contract.md +12 -3
- package/docs/consumer-skill/references/installation.md +11 -1
- package/docs/consumer-skill/references/public-api.json +847 -447
- package/docs/consumer-skill/references/review.md +25 -5
- package/docs/consumer-skill/references/theming.md +8 -4
- package/docs/consumer-skill/references/tokens.json +1 -1
- package/docs/consumer-skill/references/workflows.md +29 -10
- package/docs/consumer-skill/scripts/composition-policy.mjs +41 -11
- package/docs/consumer-skill/scripts/surface-policy.mjs +139 -5
- package/package.json +10 -2
- package/dist/accordion-CQXVcd7Q.js.map +0 -1
- package/dist/action-menu-BTpyPWJ2.js +0 -264
- package/dist/action-menu-BTpyPWJ2.js.map +0 -1
- package/dist/affordance-geometry.generated-CCIXb2A1.js.map +0 -1
- package/dist/ai-artifact-2PQ2fItc.js.map +0 -1
- package/dist/attachment-q69dlt5Y.js +0 -244
- package/dist/attachment-q69dlt5Y.js.map +0 -1
- package/dist/auth-M3vGMgDR.js.map +0 -1
- package/dist/avatar-djdaaQ_s.js.map +0 -1
- package/dist/badge-0tATj-tW.js +0 -92
- package/dist/badge-0tATj-tW.js.map +0 -1
- package/dist/breadcrumbs-BG_FfMK4.js +0 -128
- package/dist/breadcrumbs-BG_FfMK4.js.map +0 -1
- package/dist/button-BS3KDg00.js.map +0 -1
- package/dist/button-R9CCoH7A.js.map +0 -1
- package/dist/buttons-DS0ZIwJ_.js +0 -99
- package/dist/buttons-DS0ZIwJ_.js.map +0 -1
- package/dist/cards-QoJ4syG9.js.map +0 -1
- package/dist/checkbox-B7ygNTYp.js +0 -35
- package/dist/checkbox-B7ygNTYp.js.map +0 -1
- package/dist/choice-inputs-DrJ17tpL.js +0 -752
- package/dist/choice-inputs-DrJ17tpL.js.map +0 -1
- package/dist/code-block-CD0B7M93.js +0 -183
- package/dist/code-block-CD0B7M93.js.map +0 -1
- package/dist/combobox-6dvVny2q.js.map +0 -1
- package/dist/combobox-CB7039j7.js.map +0 -1
- package/dist/comments-You0Bzbr.js.map +0 -1
- package/dist/components/layout/page/partials/page-header-commands.d.ts +0 -13
- package/dist/containers-D_L4mTVb.js.map +0 -1
- package/dist/data-display-3xWQUnMA.js +0 -1335
- package/dist/data-display-3xWQUnMA.js.map +0 -1
- package/dist/date-picker-DrDFj8Lo.js +0 -1527
- package/dist/date-picker-DrDFj8Lo.js.map +0 -1
- package/dist/display-DrdvPwF0.js.map +0 -1
- package/dist/feedback-C7nR0UtT.js.map +0 -1
- package/dist/field-affordance-recipes-CkOCdE2y.js.map +0 -1
- package/dist/field-state-recipes-C-MFBX_8.js +0 -11
- package/dist/field-state-recipes-C-MFBX_8.js.map +0 -1
- package/dist/filters-Da-gNPsE.js.map +0 -1
- package/dist/form-sizing-uWP4lzVh.js.map +0 -1
- package/dist/forms-numeric-D3CO60IF.js.map +0 -1
- package/dist/header-2ycNqGOR.js.map +0 -1
- package/dist/icon-badge-DKlaKXoo.js +0 -53
- package/dist/icon-badge-DKlaKXoo.js.map +0 -1
- package/dist/input-DhQdBnV3.js +0 -255
- package/dist/input-DhQdBnV3.js.map +0 -1
- package/dist/item-xzh8Df65.js.map +0 -1
- package/dist/media-gallery-DQUQ0m3O.js +0 -201
- package/dist/media-gallery-DQUQ0m3O.js.map +0 -1
- package/dist/mentions-DwnO1hh4.js +0 -564
- package/dist/mentions-DwnO1hh4.js.map +0 -1
- package/dist/navigation-Cbp5V8gG.js +0 -264
- package/dist/navigation-Cbp5V8gG.js.map +0 -1
- package/dist/navigation-Cs1npsPm.js +0 -300
- package/dist/navigation-Cs1npsPm.js.map +0 -1
- package/dist/overlay.recipes-CNO2S9V6.js +0 -34
- package/dist/overlay.recipes-CNO2S9V6.js.map +0 -1
- package/dist/overlays-DhZO7N-I.js +0 -994
- package/dist/overlays-DhZO7N-I.js.map +0 -1
- package/dist/page-C6R_8jFt.js +0 -325
- package/dist/page-C6R_8jFt.js.map +0 -1
- package/dist/page-header-hUTzcRZX.js +0 -112
- package/dist/page-header-hUTzcRZX.js.map +0 -1
- package/dist/popover-Dcv_9jxr.js.map +0 -1
- package/dist/rich-text-editor-CF8QYt5p.js +0 -574
- package/dist/rich-text-editor-CF8QYt5p.js.map +0 -1
- package/dist/rich-text-editor.recipes-CnrbmTS1.js +0 -81
- package/dist/rich-text-editor.recipes-CnrbmTS1.js.map +0 -1
- package/dist/rich-text-editor.strings-BpnIQgMl.js +0 -25
- package/dist/rich-text-editor.strings-BpnIQgMl.js.map +0 -1
- package/dist/rich-text-j-FGAeZW.js +0 -32
- package/dist/rich-text-j-FGAeZW.js.map +0 -1
- package/dist/sanitize-html-BG9FGe-j.js +0 -64
- package/dist/sanitize-html-BG9FGe-j.js.map +0 -1
- package/dist/scroll-area-DRdr16Pt.js +0 -47
- package/dist/scroll-area-DRdr16Pt.js.map +0 -1
- package/dist/settings-DHk0L2MF.js +0 -161
- package/dist/settings-DHk0L2MF.js.map +0 -1
- package/dist/sheet-DRFNY1_D.js +0 -207
- package/dist/sheet-DRFNY1_D.js.map +0 -1
- package/dist/sidebar-Cb8WzOvE.js.map +0 -1
- package/dist/sidebar-Crc9M9JV.js.map +0 -1
- package/dist/smart-card-Bek-TwUp.js +0 -599
- package/dist/smart-card-Bek-TwUp.js.map +0 -1
- package/dist/surface-recipes-DOdoBXGm.js +0 -28
- package/dist/surface-recipes-DOdoBXGm.js.map +0 -1
- package/dist/table-D6zKeYQX.js.map +0 -1
- package/dist/table-Dn4XSrSB.js +0 -1444
- package/dist/table-Dn4XSrSB.js.map +0 -1
- package/dist/tabs-Dk8E_knt.js.map +0 -1
- package/dist/text-inputs-BFpku0Qd.js.map +0 -1
- package/dist/timelines-CxuAFIc2.js.map +0 -1
- package/dist/tree-BotPlyiD.js.map +0 -1
- package/dist/typography-CAr3dQhX.js +0 -116
- package/dist/typography-CAr3dQhX.js.map +0 -1
- package/dist/ui-provider-D2_TeLqw.js.map +0 -1
- package/dist/upload-B0WHW7ak.js.map +0 -1
- package/dist/upload-queue-BHZ_wBfd.js.map +0 -1
- package/dist/use-file-drop-target-BX7GnhoQ.js +0 -39
- package/dist/use-file-drop-target-BX7GnhoQ.js.map +0 -1
- package/dist/utils-Cospvlj1.js.map +0 -1
- package/dist/value-inputs-CjfzGMsN.js +0 -854
- package/dist/value-inputs-CjfzGMsN.js.map +0 -1
- package/dist/workspace-YoFjXi6i.js +0 -394
- package/dist/workspace-YoFjXi6i.js.map +0 -1
- /package/dist/components/{blocks/data-display/metadata → base/metadata-list}/metadata-list.strings.d.ts +0 -0
|
@@ -0,0 +1,1529 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { o as e, s as t } from "./ui-provider-1D_NSYzO.js";
|
|
3
|
+
import { useStrings as n } from "./lib/strings.js";
|
|
4
|
+
import { t as r } from "./utils-l5LpDw2z.js";
|
|
5
|
+
import { n as i } from "./buttons-SbIcm1HJ.js";
|
|
6
|
+
import { i as a, o, s } from "./typography-DTRkE9zL.js";
|
|
7
|
+
import { t as c } from "./focus-recipes-B653VaLq.js";
|
|
8
|
+
import { n as l, t as u } from "./button-QYwiyhD2.js";
|
|
9
|
+
import { r as d, t as f } from "./structure-DC2dygdA.js";
|
|
10
|
+
import { o as p } from "./date-BgK3bTdo.js";
|
|
11
|
+
import { t as ee } from "./separator-C8DlRGwF.js";
|
|
12
|
+
import { t as m } from "./field-state-recipes-BVA2CWHo.js";
|
|
13
|
+
import { r as h } from "./field-affordance-recipes-qQeIf4lG.js";
|
|
14
|
+
import { _ as g, f as _, o as te, u as v } from "./form-sizing-By94KzXE.js";
|
|
15
|
+
import { t as ne } from "./input-DWhBBBww.js";
|
|
16
|
+
import { c as re, o as ie, t as ae } from "./popover-Di55PyAI.js";
|
|
17
|
+
import { t as y } from "./form-field-DUt4UxSV.js";
|
|
18
|
+
import { t as b } from "./use-mobile-vaLKwgyf.js";
|
|
19
|
+
import * as x from "react";
|
|
20
|
+
import { Fragment as S, jsx as C, jsxs as w } from "react/jsx-runtime";
|
|
21
|
+
import { Calendar as T, ChevronDownIcon as E, ChevronLeftIcon as D, ChevronRightIcon as O, Clock as k } from "lucide-react";
|
|
22
|
+
import { cva as A } from "class-variance-authority";
|
|
23
|
+
import { addDays as oe, endOfMonth as j, endOfWeek as M, format as N, startOfMonth as P, startOfWeek as F } from "date-fns";
|
|
24
|
+
import { DayPicker as se, getDefaultClassNames as I } from "react-day-picker";
|
|
25
|
+
import { Toggle as L } from "@base-ui/react/toggle";
|
|
26
|
+
import { ToggleGroup as R } from "@base-ui/react/toggle-group";
|
|
27
|
+
import { enUS as z } from "date-fns/locale";
|
|
28
|
+
function B(e) {
|
|
29
|
+
return e.toString().padStart(2, "0");
|
|
30
|
+
}
|
|
31
|
+
function V(e, t, n) {
|
|
32
|
+
return Math.min(Math.max(e, t), n);
|
|
33
|
+
}
|
|
34
|
+
function H(e, t) {
|
|
35
|
+
if (t <= 0) return e;
|
|
36
|
+
let n = Math.floor(86399 / t) * t, r = Math.round(e / t) * t;
|
|
37
|
+
return Math.max(0, Math.min(r, n));
|
|
38
|
+
}
|
|
39
|
+
function ce(e) {
|
|
40
|
+
if (!e) return null;
|
|
41
|
+
let t = e.split(":");
|
|
42
|
+
if (t.length < 2 || t.length > 3) return null;
|
|
43
|
+
let [n, r, i] = t, a = V(Number.parseInt(n, 10), 0, 23), o = V(Number.parseInt(r, 10), 0, 59), s = V(Number.parseInt(i ?? "0", 10), 0, 59);
|
|
44
|
+
return Number.isNaN(a) || Number.isNaN(o) || Number.isNaN(s) ? null : {
|
|
45
|
+
hours: a,
|
|
46
|
+
minutes: o,
|
|
47
|
+
seconds: s
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
function le(e, t) {
|
|
51
|
+
let n = t ? `:${B(e.seconds)}` : "";
|
|
52
|
+
return `${B(e.hours)}:${B(e.minutes)}${n}`;
|
|
53
|
+
}
|
|
54
|
+
function ue(e, t, n) {
|
|
55
|
+
let r = Number.isFinite(e?.getTime?.()) ? e : /* @__PURE__ */ new Date(), i = r.getHours(), a = r.getMinutes(), o = t ? r.getSeconds() : 0, s = H(i * 3600 + a * 60 + o, n), c = Math.floor(s / 3600), l = Math.floor(s % 3600 / 60), u = s % 60;
|
|
56
|
+
return {
|
|
57
|
+
hours: c,
|
|
58
|
+
minutes: l,
|
|
59
|
+
seconds: t ? u : 0
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
function U(e, t, n) {
|
|
63
|
+
if (t === "12") {
|
|
64
|
+
let t = e.hours >= 12 ? "PM" : "AM", r = e.hours % 12;
|
|
65
|
+
return r === 0 && (r = 12), {
|
|
66
|
+
hours: B(r),
|
|
67
|
+
minutes: B(e.minutes),
|
|
68
|
+
seconds: n ? B(e.seconds) : void 0,
|
|
69
|
+
period: t
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
return {
|
|
73
|
+
hours: B(e.hours),
|
|
74
|
+
minutes: B(e.minutes),
|
|
75
|
+
seconds: n ? B(e.seconds) : void 0
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
function W(e, t, n) {
|
|
79
|
+
let r = (e) => {
|
|
80
|
+
let t = Number.parseInt(e ?? "0", 10);
|
|
81
|
+
return Number.isNaN(t) ? 0 : t;
|
|
82
|
+
}, i = r(e.hours), a = V(r(e.minutes), 0, 59), o = n ? V(r(e.seconds), 0, 59) : 0;
|
|
83
|
+
if (t === "12") {
|
|
84
|
+
i = V(i, 1, 12);
|
|
85
|
+
let t = (e.period ?? "AM") === "PM";
|
|
86
|
+
i %= 12, t && (i += 12);
|
|
87
|
+
} else i = V(i, 0, 23);
|
|
88
|
+
return {
|
|
89
|
+
hours: i,
|
|
90
|
+
minutes: a,
|
|
91
|
+
seconds: o
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
function de(e, t, n) {
|
|
95
|
+
let r = H(e.hours * 3600 + e.minutes * 60 + e.seconds, t);
|
|
96
|
+
return {
|
|
97
|
+
hours: Math.floor(r / 3600),
|
|
98
|
+
minutes: Math.floor(r % 3600 / 60),
|
|
99
|
+
seconds: n ? r % 60 : 0
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
function fe(e, t, n, r) {
|
|
103
|
+
let i = B(e.minutes), a = t ? `:${B(e.seconds)}` : "";
|
|
104
|
+
if (n === "24") return `${B(e.hours)}:${i}${a}`;
|
|
105
|
+
let o = e.hours >= 12 ? "PM" : "AM", s = e.hours % 12;
|
|
106
|
+
s === 0 && (s = 12);
|
|
107
|
+
let c = o === "AM" ? r?.am ?? "AM" : r?.pm ?? "PM";
|
|
108
|
+
return `${B(s)}:${i}${a} ${c}`;
|
|
109
|
+
}
|
|
110
|
+
var G = /'[^']*'/g, K = /[HKhk]|\bp\b|\bt\b|\ba\b/;
|
|
111
|
+
function pe(e) {
|
|
112
|
+
if (!e) return !1;
|
|
113
|
+
let t = e.replace(G, "");
|
|
114
|
+
return K.test(t);
|
|
115
|
+
}
|
|
116
|
+
function me(e) {
|
|
117
|
+
return {
|
|
118
|
+
startMonth: typeof e?.fromYear == "number" ? new Date(e.fromYear, 0) : void 0,
|
|
119
|
+
endMonth: typeof e?.toYear == "number" ? new Date(e.toYear, 11) : void 0
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
function he(e, t, n, r) {
|
|
123
|
+
let i = r ? { locale: r } : void 0;
|
|
124
|
+
return {
|
|
125
|
+
date: e,
|
|
126
|
+
formatted: e ? N(e, t, i) : void 0,
|
|
127
|
+
readable: e ? N(e, n, i) : void 0
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
function ge(e, t, n, r) {
|
|
131
|
+
let i = r ? { locale: r } : void 0;
|
|
132
|
+
return {
|
|
133
|
+
dates: e,
|
|
134
|
+
formatted: e.map((e) => N(e, t, i)),
|
|
135
|
+
readable: e.map((e) => N(e, n, i))
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
function _e(e, t, n, r) {
|
|
139
|
+
let i = r ? { locale: r } : void 0;
|
|
140
|
+
return {
|
|
141
|
+
range: e,
|
|
142
|
+
formatted: {
|
|
143
|
+
from: e?.from ? N(e.from, t, i) : void 0,
|
|
144
|
+
to: e?.to ? N(e.to, t, i) : void 0
|
|
145
|
+
},
|
|
146
|
+
readable: {
|
|
147
|
+
from: e?.from ? N(e.from, n, i) : void 0,
|
|
148
|
+
to: e?.to ? N(e.to, n, i) : void 0
|
|
149
|
+
}
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
function ve(e, t) {
|
|
153
|
+
let n = typeof t == "string" ? ce(t) : t, r = new Date(e);
|
|
154
|
+
return !Number.isFinite(r.getTime()) || !n ? /* @__PURE__ */ new Date(NaN) : (r.setHours(n.hours, n.minutes, n.seconds, 0), r);
|
|
155
|
+
}
|
|
156
|
+
function ye(e, t) {
|
|
157
|
+
return Math.ceil((t.getTime() - e.getTime()) / 864e5) + 1;
|
|
158
|
+
}
|
|
159
|
+
function be(e, t, n) {
|
|
160
|
+
if (!e?.from || !e?.to) return { isValid: !0 };
|
|
161
|
+
let r = ye(e.from, e.to);
|
|
162
|
+
return t && r < t || n && r > n ? {
|
|
163
|
+
isValid: !1,
|
|
164
|
+
daysDiff: r
|
|
165
|
+
} : {
|
|
166
|
+
isValid: !0,
|
|
167
|
+
daysDiff: r
|
|
168
|
+
};
|
|
169
|
+
}
|
|
170
|
+
function xe(e, t, n, r) {
|
|
171
|
+
if (!e?.from || !e?.to) return null;
|
|
172
|
+
let i = ye(e.from, e.to);
|
|
173
|
+
return t && i < t ? r.minimumDays(t) : n && i > n ? r.maximumDays(n) : null;
|
|
174
|
+
}
|
|
175
|
+
function q(e, t, n, r, i) {
|
|
176
|
+
return r && e.length === 0 ? i.datesRequired : t && e.length < t ? i.minimumDates(t) : n && e.length > 0 ? i.maximumDates(n) : null;
|
|
177
|
+
}
|
|
178
|
+
function Se(e, t, n, r, i, a) {
|
|
179
|
+
if (e) {
|
|
180
|
+
let n = N(e, t, a ? { locale: a } : void 0);
|
|
181
|
+
return i && (n += ` ${i}`), n;
|
|
182
|
+
}
|
|
183
|
+
return n ?? r;
|
|
184
|
+
}
|
|
185
|
+
function J(e, t, n, r, i, a) {
|
|
186
|
+
if (e.length > 0) {
|
|
187
|
+
if (e.length === 1) {
|
|
188
|
+
let n = a ? { locale: a } : void 0;
|
|
189
|
+
return N(e[0], t, n);
|
|
190
|
+
}
|
|
191
|
+
return i.datesSelected(e.length);
|
|
192
|
+
}
|
|
193
|
+
return n ?? r;
|
|
194
|
+
}
|
|
195
|
+
function Ce(e, t, n, r, i) {
|
|
196
|
+
return e?.from ? p(e, {
|
|
197
|
+
format: t,
|
|
198
|
+
locale: i
|
|
199
|
+
}) ?? n ?? r : n ?? r;
|
|
200
|
+
}
|
|
201
|
+
//#endregion
|
|
202
|
+
//#region src/components/base/date-pickers/date-picker-internals.ts
|
|
203
|
+
function we(e, t) {
|
|
204
|
+
return {
|
|
205
|
+
tone: e ?? "secondary",
|
|
206
|
+
buttonStyle: t ?? "outline"
|
|
207
|
+
};
|
|
208
|
+
}
|
|
209
|
+
function Te(e) {
|
|
210
|
+
return !e.mode || e.mode === "single";
|
|
211
|
+
}
|
|
212
|
+
function Y(e) {
|
|
213
|
+
return e.mode === "multiple";
|
|
214
|
+
}
|
|
215
|
+
function Ee(e) {
|
|
216
|
+
return e.mode === "range";
|
|
217
|
+
}
|
|
218
|
+
function De(e, t) {
|
|
219
|
+
return [
|
|
220
|
+
{
|
|
221
|
+
label: e.today,
|
|
222
|
+
getValue: () => ({
|
|
223
|
+
from: /* @__PURE__ */ new Date(),
|
|
224
|
+
to: /* @__PURE__ */ new Date()
|
|
225
|
+
})
|
|
226
|
+
},
|
|
227
|
+
{
|
|
228
|
+
label: e.thisWeek,
|
|
229
|
+
getValue: () => ({
|
|
230
|
+
from: F(/* @__PURE__ */ new Date(), { weekStartsOn: t }),
|
|
231
|
+
to: M(/* @__PURE__ */ new Date(), { weekStartsOn: t })
|
|
232
|
+
})
|
|
233
|
+
},
|
|
234
|
+
{
|
|
235
|
+
label: e.thisMonth,
|
|
236
|
+
getValue: () => ({
|
|
237
|
+
from: P(/* @__PURE__ */ new Date()),
|
|
238
|
+
to: j(/* @__PURE__ */ new Date())
|
|
239
|
+
})
|
|
240
|
+
},
|
|
241
|
+
{
|
|
242
|
+
label: e.last30Days,
|
|
243
|
+
getValue: () => ({
|
|
244
|
+
from: oe(/* @__PURE__ */ new Date(), -30),
|
|
245
|
+
to: /* @__PURE__ */ new Date()
|
|
246
|
+
})
|
|
247
|
+
}
|
|
248
|
+
];
|
|
249
|
+
}
|
|
250
|
+
//#endregion
|
|
251
|
+
//#region src/components/ui/calendar.tsx
|
|
252
|
+
function Oe({ className: e, classNames: t, showOutsideDays: n = !0, captionLayout: i = "label", buttonVariant: a = "ghost", locale: o, formatters: s, components: c, ...u }) {
|
|
253
|
+
let d = I();
|
|
254
|
+
return /* @__PURE__ */ C(se, {
|
|
255
|
+
showOutsideDays: n,
|
|
256
|
+
className: r("p-space-lg [--cell-radius:min(calc(var(--radius)*0.75),calc(min(var(--height-action),var(--height-control))*var(--density-scale)/4))] [--cell-size:calc(var(--height-action)*8/9*var(--density-scale))] bg-background group/calendar [[data-slot=card-content]_&]:bg-transparent [[data-slot=popover-content]_&]:bg-transparent", String.raw`rtl:**:[.rdp-button\_next>svg]:rotate-180`, String.raw`rtl:**:[.rdp-button\_previous>svg]:rotate-180`, e),
|
|
257
|
+
captionLayout: i,
|
|
258
|
+
locale: o,
|
|
259
|
+
formatters: {
|
|
260
|
+
formatMonthDropdown: (e) => e.toLocaleString(o?.code, { month: "short" }),
|
|
261
|
+
...s
|
|
262
|
+
},
|
|
263
|
+
classNames: {
|
|
264
|
+
root: r("w-fit", d.root),
|
|
265
|
+
months: r("flex gap-space-xl flex-col md:flex-row relative", d.months),
|
|
266
|
+
month: r("flex flex-col w-full gap-space-xl", d.month),
|
|
267
|
+
nav: r("flex items-center gap-space-xs w-full absolute top-0 inset-x-0 justify-between", d.nav),
|
|
268
|
+
button_previous: r(l({ variant: a }), "size-(--cell-size) aria-disabled:opacity-50 p-0 select-none", d.button_previous),
|
|
269
|
+
button_next: r(l({ variant: a }), "size-(--cell-size) aria-disabled:opacity-50 p-0 select-none", d.button_next),
|
|
270
|
+
month_caption: r("flex items-center justify-center h-(--cell-size) w-full px-(--cell-size)", d.month_caption),
|
|
271
|
+
dropdowns: r("w-full flex items-center text-sm font-medium justify-center h-(--cell-size) gap-space-sm", d.dropdowns),
|
|
272
|
+
dropdown_root: r("relative rounded-(--cell-radius)", d.dropdown_root),
|
|
273
|
+
dropdown: r("absolute bg-popover inset-0 opacity-0", d.dropdown),
|
|
274
|
+
caption_label: r("select-none font-medium", i === "label" ? "text-sm" : "rounded-(--cell-radius) flex items-center gap-space-xs text-sm [&>svg]:text-muted-foreground [&>svg]:size-icon-md", d.caption_label),
|
|
275
|
+
month_grid: "w-full border-collapse",
|
|
276
|
+
weekdays: r("flex", d.weekdays),
|
|
277
|
+
weekday: r("text-muted-foreground rounded-(--cell-radius) flex-1 font-normal text-xs select-none", d.weekday),
|
|
278
|
+
week: r("flex w-full mt-space-md", d.week),
|
|
279
|
+
week_number_header: r("select-none w-(--cell-size)", d.week_number_header),
|
|
280
|
+
week_number: r("text-xs select-none text-muted-foreground", d.week_number),
|
|
281
|
+
day: r("relative w-full rounded-(--cell-radius) h-full p-0 text-center [&:last-child[data-selected=true]_button]:rounded-r-(--cell-radius) group/day aspect-square select-none", u.showWeekNumber ? "[&:nth-child(2)[data-selected=true]_button]:rounded-l-(--cell-radius)" : "[&:first-child[data-selected=true]_button]:rounded-l-(--cell-radius)", d.day),
|
|
282
|
+
range_start: r("rounded-l-(--cell-radius) bg-muted relative after:bg-muted after:absolute after:inset-y-0 after:w-4 after:right-0 z-0 isolate", d.range_start),
|
|
283
|
+
range_middle: r("rounded-none", d.range_middle),
|
|
284
|
+
range_end: r("rounded-r-(--cell-radius) bg-muted relative after:bg-muted after:absolute after:inset-y-0 after:w-4 after:left-0 z-0 isolate", d.range_end),
|
|
285
|
+
today: r("bg-muted text-foreground rounded-(--cell-radius) data-[selected=true]:rounded-none", d.today),
|
|
286
|
+
outside: r("text-muted-foreground aria-selected:text-muted-foreground", d.outside),
|
|
287
|
+
disabled: r("text-muted-foreground opacity-50", d.disabled),
|
|
288
|
+
hidden: r("invisible", d.hidden),
|
|
289
|
+
...t
|
|
290
|
+
},
|
|
291
|
+
components: {
|
|
292
|
+
Root: ({ className: e, rootRef: t, ...n }) => /* @__PURE__ */ C("div", {
|
|
293
|
+
"data-slot": "calendar",
|
|
294
|
+
ref: t,
|
|
295
|
+
className: r(e),
|
|
296
|
+
...n
|
|
297
|
+
}),
|
|
298
|
+
Chevron: ({ className: e, orientation: t, ...n }) => t === "left" ? /* @__PURE__ */ C(D, {
|
|
299
|
+
className: r("size-icon", e),
|
|
300
|
+
...n
|
|
301
|
+
}) : t === "right" ? /* @__PURE__ */ C(O, {
|
|
302
|
+
className: r("size-icon", e),
|
|
303
|
+
...n
|
|
304
|
+
}) : /* @__PURE__ */ C(E, {
|
|
305
|
+
className: r(h.icon.md, e),
|
|
306
|
+
...n
|
|
307
|
+
}),
|
|
308
|
+
DayButton: ({ ...e }) => /* @__PURE__ */ C(ke, {
|
|
309
|
+
locale: o,
|
|
310
|
+
...e
|
|
311
|
+
}),
|
|
312
|
+
WeekNumber: ({ children: e, ...t }) => /* @__PURE__ */ C("td", {
|
|
313
|
+
...t,
|
|
314
|
+
children: /* @__PURE__ */ C("div", {
|
|
315
|
+
className: "flex size-(--cell-size) items-center justify-center text-center",
|
|
316
|
+
children: e
|
|
317
|
+
})
|
|
318
|
+
}),
|
|
319
|
+
...c
|
|
320
|
+
},
|
|
321
|
+
...u
|
|
322
|
+
});
|
|
323
|
+
}
|
|
324
|
+
function ke({ className: e, day: t, modifiers: n, locale: i, ...a }) {
|
|
325
|
+
let o = I(), s = x.useRef(null);
|
|
326
|
+
return x.useEffect(() => {
|
|
327
|
+
n.focused && s.current?.focus();
|
|
328
|
+
}, [n.focused]), /* @__PURE__ */ C(u, {
|
|
329
|
+
ref: s,
|
|
330
|
+
variant: "ghost",
|
|
331
|
+
size: "icon",
|
|
332
|
+
"data-day": t.date.toLocaleDateString(i?.code),
|
|
333
|
+
"data-selected-single": !!n.selected && !n.range_start && !n.range_end && !n.range_middle,
|
|
334
|
+
"data-range-start": n.range_start,
|
|
335
|
+
"data-range-end": n.range_end,
|
|
336
|
+
"data-range-middle": n.range_middle,
|
|
337
|
+
className: r("data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground data-[range-middle=true]:bg-muted data-[range-middle=true]:text-foreground data-[range-start=true]:bg-primary data-[range-start=true]:text-primary-foreground data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground group-data-[focused=true]/day:inset-ring group-data-[focused=true]/day:inset-ring-ring group-data-[focused=true]/day:ring-ring/50 relative isolate z-10 flex aspect-square size-auto w-full min-w-(--cell-size) flex-col gap-space-xs border-0 leading-none font-normal group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:ring-3 data-[range-end=true]:rounded-(--cell-radius) data-[range-end=true]:rounded-r-(--cell-radius) data-[range-middle=true]:rounded-none data-[range-start=true]:rounded-(--cell-radius) data-[range-start=true]:rounded-l-(--cell-radius) [&>span]:text-xs [&>span]:opacity-70", o.day, e),
|
|
338
|
+
...a
|
|
339
|
+
});
|
|
340
|
+
}
|
|
341
|
+
//#endregion
|
|
342
|
+
//#region src/components/base/date-pickers/date-picker-field.tsx
|
|
343
|
+
function Ae({ rootRef: e, className: t, label: n, hint: r, error: i, triggerId: o, describedById: c, children: l }) {
|
|
344
|
+
let u = typeof i == "string" && i !== "", d = !u && typeof r == "string" && r !== "";
|
|
345
|
+
return /* @__PURE__ */ w(f, {
|
|
346
|
+
ref: e,
|
|
347
|
+
gap: "xs",
|
|
348
|
+
className: t,
|
|
349
|
+
children: [
|
|
350
|
+
!!(n || d) && /* @__PURE__ */ w(f, {
|
|
351
|
+
direction: "horizontal",
|
|
352
|
+
align: "center",
|
|
353
|
+
justify: "between",
|
|
354
|
+
gap: "xs",
|
|
355
|
+
children: [!!n && /* @__PURE__ */ C(a, {
|
|
356
|
+
htmlFor: o,
|
|
357
|
+
className: "date-picker--label leading-6",
|
|
358
|
+
children: n
|
|
359
|
+
}), d && /* @__PURE__ */ C(s, {
|
|
360
|
+
tag: "span",
|
|
361
|
+
size: "xs",
|
|
362
|
+
type: "secondary",
|
|
363
|
+
className: "date-picker--hint",
|
|
364
|
+
children: r
|
|
365
|
+
})]
|
|
366
|
+
}),
|
|
367
|
+
l,
|
|
368
|
+
u && /* @__PURE__ */ C(s, {
|
|
369
|
+
id: c,
|
|
370
|
+
size: "xs",
|
|
371
|
+
type: "error",
|
|
372
|
+
role: "alert",
|
|
373
|
+
"aria-live": "polite",
|
|
374
|
+
className: "date-picker--error",
|
|
375
|
+
content: i
|
|
376
|
+
})
|
|
377
|
+
]
|
|
378
|
+
});
|
|
379
|
+
}
|
|
380
|
+
//#endregion
|
|
381
|
+
//#region src/components/base/date-pickers/date-picker-footer.tsx
|
|
382
|
+
function je({ config: e, output: t, hasSelection: n, autoSummary: a, className: o }) {
|
|
383
|
+
let { text: c, actions: l, showOnlyWhenSelected: u = !1, showSummary: d = !1 } = e, p = l?.filter((e) => e.visible !== !1) ?? [], m = x.useMemo(() => {
|
|
384
|
+
if (c) return typeof c == "function" ? c(t) : c;
|
|
385
|
+
}, [c, t]), h = m || (d ? a : void 0);
|
|
386
|
+
return u && !n || !h && p.length === 0 ? null : /* @__PURE__ */ w(S, { children: [/* @__PURE__ */ C(ee, {}), /* @__PURE__ */ C("div", {
|
|
387
|
+
className: r("date-picker-footer--component p-surface", o),
|
|
388
|
+
children: /* @__PURE__ */ w(f, {
|
|
389
|
+
gap: "lg",
|
|
390
|
+
children: [!!h && /* @__PURE__ */ w(f, {
|
|
391
|
+
gap: "xs",
|
|
392
|
+
className: "date-picker-footer--summary",
|
|
393
|
+
children: [
|
|
394
|
+
!!d && !!m && !!a && /* @__PURE__ */ w(S, { children: [/* @__PURE__ */ C(s, {
|
|
395
|
+
type: "secondary",
|
|
396
|
+
children: a
|
|
397
|
+
}), /* @__PURE__ */ C(s, {
|
|
398
|
+
weight: "medium",
|
|
399
|
+
children: m
|
|
400
|
+
})] }),
|
|
401
|
+
!d && !!m && /* @__PURE__ */ C(s, {
|
|
402
|
+
weight: "medium",
|
|
403
|
+
children: m
|
|
404
|
+
}),
|
|
405
|
+
!!d && !m && !!a && /* @__PURE__ */ C(s, {
|
|
406
|
+
type: "secondary",
|
|
407
|
+
children: a
|
|
408
|
+
})
|
|
409
|
+
]
|
|
410
|
+
}), p.length > 0 && /* @__PURE__ */ C(f, {
|
|
411
|
+
direction: "horizontal",
|
|
412
|
+
gap: "md",
|
|
413
|
+
align: "center",
|
|
414
|
+
className: "date-picker-footer--actions",
|
|
415
|
+
children: p.map((e) => {
|
|
416
|
+
let n = typeof e.disabled == "function" ? e.disabled(t) : e.disabled, a = e.buttonStyle === "link" ? "ghost" : e.buttonStyle ?? "solid";
|
|
417
|
+
return /* @__PURE__ */ C(i, {
|
|
418
|
+
tone: e.tone ?? "primary",
|
|
419
|
+
buttonStyle: a,
|
|
420
|
+
disabled: n,
|
|
421
|
+
loading: e.loading,
|
|
422
|
+
onClick: () => e.onClick(t),
|
|
423
|
+
className: r("flex-1", e.buttonStyle === "link" && "underline underline-offset-4"),
|
|
424
|
+
children: e.label
|
|
425
|
+
}, e.label);
|
|
426
|
+
})
|
|
427
|
+
})]
|
|
428
|
+
})
|
|
429
|
+
})] });
|
|
430
|
+
}
|
|
431
|
+
je.displayName = "DatePickerFooter";
|
|
432
|
+
//#endregion
|
|
433
|
+
//#region src/components/base/date-pickers/date-picker-header.tsx
|
|
434
|
+
function Me({ config: e, className: t }) {
|
|
435
|
+
let { title: n, description: i, icon: a, align: c = "left" } = e;
|
|
436
|
+
return /* @__PURE__ */ C("div", {
|
|
437
|
+
className: r("date-picker-header--component", "border-b border-border p-surface", c === "center" ? "text-center" : "text-left", t),
|
|
438
|
+
children: /* @__PURE__ */ w(f, {
|
|
439
|
+
direction: "horizontal",
|
|
440
|
+
gap: "md",
|
|
441
|
+
wrap: !1,
|
|
442
|
+
children: [!!a && /* @__PURE__ */ C("div", {
|
|
443
|
+
className: "shrink-0",
|
|
444
|
+
children: /* @__PURE__ */ C(a, {
|
|
445
|
+
"aria-hidden": "true",
|
|
446
|
+
className: "size-icon text-muted-foreground"
|
|
447
|
+
})
|
|
448
|
+
}), /* @__PURE__ */ w(f, {
|
|
449
|
+
gap: "dense",
|
|
450
|
+
className: r("flex-1", c === "center" && !a && "text-center"),
|
|
451
|
+
children: [/* @__PURE__ */ C(o, {
|
|
452
|
+
tag: "h3",
|
|
453
|
+
align: c === "center" ? "center" : "left",
|
|
454
|
+
containerClassName: "space-y-0",
|
|
455
|
+
children: n
|
|
456
|
+
}), !!i && /* @__PURE__ */ C(s, {
|
|
457
|
+
type: "secondary",
|
|
458
|
+
children: i
|
|
459
|
+
})]
|
|
460
|
+
})]
|
|
461
|
+
})
|
|
462
|
+
});
|
|
463
|
+
}
|
|
464
|
+
Me.displayName = "DatePickerHeader";
|
|
465
|
+
//#endregion
|
|
466
|
+
//#region src/components/base/date-pickers/date-picker.recipes.ts
|
|
467
|
+
function Ne(e) {
|
|
468
|
+
let { defaultScale: n } = t();
|
|
469
|
+
return g(e, n);
|
|
470
|
+
}
|
|
471
|
+
var Pe = {
|
|
472
|
+
sm: "w-control-sm",
|
|
473
|
+
md: "w-control",
|
|
474
|
+
lg: "w-control-lg"
|
|
475
|
+
};
|
|
476
|
+
function Fe(e, t = !1) {
|
|
477
|
+
return r(_(e), "justify-start", t && [Pe[e], "shrink-0 justify-center px-0"]);
|
|
478
|
+
}
|
|
479
|
+
//#endregion
|
|
480
|
+
//#region src/components/base/date-pickers/date-pickers.strings.ts
|
|
481
|
+
var Ie = {
|
|
482
|
+
selectDate: "Select a date",
|
|
483
|
+
selectDates: "Select dates",
|
|
484
|
+
selectDateRange: "Select date range",
|
|
485
|
+
from: "From",
|
|
486
|
+
to: "To",
|
|
487
|
+
confirm: "Confirm",
|
|
488
|
+
clear: "Clear",
|
|
489
|
+
today: "Today",
|
|
490
|
+
startDate: "Start date",
|
|
491
|
+
endDate: "End date",
|
|
492
|
+
startTime: "Start time",
|
|
493
|
+
endTime: "End time",
|
|
494
|
+
hours: "Hours",
|
|
495
|
+
minutes: "Minutes",
|
|
496
|
+
seconds: "Seconds",
|
|
497
|
+
am: "AM",
|
|
498
|
+
pm: "PM",
|
|
499
|
+
minimumDays: (e) => `A minimum of ${e} days is required`,
|
|
500
|
+
maximumDays: (e) => `A maximum of ${e} days is allowed`,
|
|
501
|
+
minimumDates: (e) => `Select at least ${e} dates`,
|
|
502
|
+
maximumDates: (e) => `Select up to ${e} dates`,
|
|
503
|
+
datesRequired: "At least one date must be selected",
|
|
504
|
+
datesSelected: (e) => `${e} dates selected`,
|
|
505
|
+
lastWeek: "Last week",
|
|
506
|
+
lastMonth: "Last month",
|
|
507
|
+
lastYear: "Last year",
|
|
508
|
+
nextWeek: "Next week",
|
|
509
|
+
nextMonth: "Next month",
|
|
510
|
+
nextYear: "Next year",
|
|
511
|
+
thisWeek: "This Week",
|
|
512
|
+
thisMonth: "This Month",
|
|
513
|
+
last30Days: "Last 30 Days",
|
|
514
|
+
selectMonthYear: "Select month and year",
|
|
515
|
+
month: "Month",
|
|
516
|
+
year: "Year"
|
|
517
|
+
}, Le = A(`box-border border border-transparent py-0 font-sans text-foreground hover:text-foreground aria-pressed:bg-accent aria-pressed:text-accent-foreground ${c.frame} ${m.invalid} gap-space-xs rounded-inner text-sm font-medium transition-[color,background-color,box-shadow] [&_svg:not([class*='size-'])]:size-icon group/toggle hover:bg-muted inline-flex items-center justify-center whitespace-nowrap outline-none disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0`, {
|
|
518
|
+
variants: {
|
|
519
|
+
variant: {
|
|
520
|
+
default: "bg-transparent",
|
|
521
|
+
outline: "border-input hover:bg-muted border bg-transparent shadow-none"
|
|
522
|
+
},
|
|
523
|
+
size: {
|
|
524
|
+
default: "h-control min-w-9 px-control",
|
|
525
|
+
sm: "h-control-sm min-w-8 px-control-sm",
|
|
526
|
+
lg: "h-control-lg min-w-10 px-control"
|
|
527
|
+
}
|
|
528
|
+
},
|
|
529
|
+
defaultVariants: {
|
|
530
|
+
variant: "default",
|
|
531
|
+
size: "default"
|
|
532
|
+
}
|
|
533
|
+
}), Re = x.createContext({
|
|
534
|
+
size: "default",
|
|
535
|
+
variant: "default",
|
|
536
|
+
spacing: 0,
|
|
537
|
+
orientation: "horizontal"
|
|
538
|
+
});
|
|
539
|
+
function ze({ className: e, variant: t, size: n, spacing: i = 0, orientation: a = "horizontal", children: o, ...s }) {
|
|
540
|
+
return /* @__PURE__ */ C(R, {
|
|
541
|
+
"data-slot": "toggle-group",
|
|
542
|
+
"data-variant": t,
|
|
543
|
+
"data-size": n,
|
|
544
|
+
"data-spacing": i,
|
|
545
|
+
"data-orientation": a,
|
|
546
|
+
style: { "--gap": i },
|
|
547
|
+
className: r("rounded-inner group/toggle-group flex w-fit flex-row items-center gap-[--spacing(var(--gap))] data-[orientation=vertical]:flex-col data-[orientation=vertical]:items-stretch", e),
|
|
548
|
+
...s,
|
|
549
|
+
children: /* @__PURE__ */ C(Re.Provider, {
|
|
550
|
+
value: {
|
|
551
|
+
variant: t,
|
|
552
|
+
size: n,
|
|
553
|
+
spacing: i,
|
|
554
|
+
orientation: a
|
|
555
|
+
},
|
|
556
|
+
children: o
|
|
557
|
+
})
|
|
558
|
+
});
|
|
559
|
+
}
|
|
560
|
+
function Be({ className: e, children: t, variant: n = "default", size: i = "default", ...a }) {
|
|
561
|
+
let o = x.useContext(Re);
|
|
562
|
+
return /* @__PURE__ */ C(L, {
|
|
563
|
+
"data-slot": "toggle-group-item",
|
|
564
|
+
"data-variant": o.variant || n,
|
|
565
|
+
"data-size": o.size || i,
|
|
566
|
+
"data-spacing": o.spacing,
|
|
567
|
+
className: r("border-border group-data-[spacing=0]/toggle-group:rounded-none group-data-[spacing=0]/toggle-group:px-control-sm group-data-[spacing=0]/toggle-group:shadow-none group-data-[orientation=horizontal]/toggle-group:data-[spacing=0]:first:rounded-l-inner group-data-[orientation=vertical]/toggle-group:data-[spacing=0]:first:rounded-t-inner group-data-[orientation=horizontal]/toggle-group:data-[spacing=0]:last:rounded-r-inner group-data-[orientation=vertical]/toggle-group:data-[spacing=0]:last:rounded-b-inner shrink-0 focus:z-10 focus-visible:z-10 group-data-[orientation=horizontal]/toggle-group:data-[spacing=0]:data-[variant=outline]:border-l-0 group-data-[orientation=vertical]/toggle-group:data-[spacing=0]:data-[variant=outline]:border-t-0 group-data-[orientation=horizontal]/toggle-group:data-[spacing=0]:data-[variant=outline]:first:border-l group-data-[orientation=vertical]/toggle-group:data-[spacing=0]:data-[variant=outline]:first:border-t", Le({
|
|
568
|
+
variant: o.variant || n,
|
|
569
|
+
size: o.size || i
|
|
570
|
+
}), e),
|
|
571
|
+
...a,
|
|
572
|
+
children: t
|
|
573
|
+
});
|
|
574
|
+
}
|
|
575
|
+
//#endregion
|
|
576
|
+
//#region src/components/base/date-pickers/time-picker.tsx
|
|
577
|
+
var Ve = {
|
|
578
|
+
placeholder: "Select time",
|
|
579
|
+
hours: "Hours",
|
|
580
|
+
minutes: "Minutes",
|
|
581
|
+
seconds: "Seconds",
|
|
582
|
+
am: "AM",
|
|
583
|
+
pm: "PM"
|
|
584
|
+
}, X = [
|
|
585
|
+
"hours",
|
|
586
|
+
"minutes",
|
|
587
|
+
"seconds"
|
|
588
|
+
], He = "00", Ue = "12", Z = "--", Q = "aria-pressed:bg-primary aria-pressed:text-primary-foreground", We = {
|
|
589
|
+
sm: "w-12",
|
|
590
|
+
md: "w-14",
|
|
591
|
+
lg: "w-16"
|
|
592
|
+
};
|
|
593
|
+
function Ge(e) {
|
|
594
|
+
return e.replace(/\D/g, "").slice(-2);
|
|
595
|
+
}
|
|
596
|
+
function $(e) {
|
|
597
|
+
return e.length === 0 ? "00" : e.length === 1 ? `0${e}` : e;
|
|
598
|
+
}
|
|
599
|
+
function Ke(e, t) {
|
|
600
|
+
let n = t ? X : X.slice(0, 2), r = n.indexOf(e);
|
|
601
|
+
return r > -1 && r < n.length - 1 ? n[r + 1] : null;
|
|
602
|
+
}
|
|
603
|
+
function qe(e, t) {
|
|
604
|
+
let n = t ? X : X.slice(0, 2), r = n.indexOf(e);
|
|
605
|
+
return r > 0 ? n[r - 1] : null;
|
|
606
|
+
}
|
|
607
|
+
function Je(e, t) {
|
|
608
|
+
return t === "24" ? e : e % 12 || 12;
|
|
609
|
+
}
|
|
610
|
+
function Ye(e) {
|
|
611
|
+
return e >= 12 ? "PM" : "AM";
|
|
612
|
+
}
|
|
613
|
+
function Xe(e, t) {
|
|
614
|
+
return t === "12" ? {
|
|
615
|
+
...e,
|
|
616
|
+
period: e.period ?? "AM"
|
|
617
|
+
} : {
|
|
618
|
+
...e,
|
|
619
|
+
period: void 0
|
|
620
|
+
};
|
|
621
|
+
}
|
|
622
|
+
function Ze(e) {
|
|
623
|
+
return {
|
|
624
|
+
hours: Z,
|
|
625
|
+
minutes: Z,
|
|
626
|
+
seconds: e ? Z : void 0
|
|
627
|
+
};
|
|
628
|
+
}
|
|
629
|
+
function Qe(e, t) {
|
|
630
|
+
let n = t === "12" ? Ue : He;
|
|
631
|
+
return {
|
|
632
|
+
hours: e.hours === Z ? n : e.hours,
|
|
633
|
+
minutes: e.minutes === Z ? He : e.minutes,
|
|
634
|
+
seconds: e.seconds === Z ? He : e.seconds,
|
|
635
|
+
period: e.period
|
|
636
|
+
};
|
|
637
|
+
}
|
|
638
|
+
function $e(e, t, n) {
|
|
639
|
+
let r = ce(e ?? void 0);
|
|
640
|
+
return r ? Xe(U(r, t, n), t) : Ze(n);
|
|
641
|
+
}
|
|
642
|
+
var et = x.forwardRef(function({ value: e, onValueChange: i, mode: a = "inline", format: o = "24", precision: c = "minutes", step: l = 60, size: u, disabled: d, invalid: f, placeholder: p, strings: ee, className: m, id: h }, te) {
|
|
643
|
+
let y = n(Ve, ee), { defaultScale: b } = t(), S = g(u, b), T = c === "seconds", [E, D] = x.useState(!1), O = x.useMemo(() => T ? X : X.slice(0, 2), [T]), [A, oe] = x.useState(() => $e(e, o, T)), j = x.useRef(A), M = x.useRef(!1), N = x.useRef(null), P = x.useCallback((e) => {
|
|
644
|
+
j.current = e, oe(e);
|
|
645
|
+
}, []), F = x.useRef({
|
|
646
|
+
hours: null,
|
|
647
|
+
minutes: null,
|
|
648
|
+
seconds: null
|
|
649
|
+
});
|
|
650
|
+
x.useEffect(() => {
|
|
651
|
+
if (M.current) {
|
|
652
|
+
M.current = !1;
|
|
653
|
+
return;
|
|
654
|
+
}
|
|
655
|
+
N.current = null, P($e(e, o, T));
|
|
656
|
+
}, [
|
|
657
|
+
e,
|
|
658
|
+
o,
|
|
659
|
+
T,
|
|
660
|
+
P
|
|
661
|
+
]);
|
|
662
|
+
let se = x.useCallback((e) => le(e, T), [T]), I = x.useCallback((e) => {
|
|
663
|
+
M.current = !0;
|
|
664
|
+
let t = W(Qe(e, o), o, T);
|
|
665
|
+
i?.(se(de(t, l, T)));
|
|
666
|
+
}, [
|
|
667
|
+
o,
|
|
668
|
+
T,
|
|
669
|
+
i,
|
|
670
|
+
l,
|
|
671
|
+
se
|
|
672
|
+
]), L = x.useCallback((e) => {
|
|
673
|
+
let t = de(W(Qe(e, o), o, T), l, T);
|
|
674
|
+
i?.(se(t)), P(Xe(U(t, o, T), o));
|
|
675
|
+
}, [
|
|
676
|
+
o,
|
|
677
|
+
T,
|
|
678
|
+
i,
|
|
679
|
+
l,
|
|
680
|
+
se,
|
|
681
|
+
P
|
|
682
|
+
]), R = x.useCallback((e) => {
|
|
683
|
+
if (!e) return;
|
|
684
|
+
let t = F.current[e];
|
|
685
|
+
t && (t.focus(), t.select());
|
|
686
|
+
}, []), z = x.useCallback((e, t) => {
|
|
687
|
+
let n = Qe(j.current, o), r = N.current, i = r && r.key === e && r.typed.length === 1 ? `${r.typed}${t}` : String(t);
|
|
688
|
+
N.current = {
|
|
689
|
+
key: e,
|
|
690
|
+
typed: i
|
|
691
|
+
};
|
|
692
|
+
let a = Number.parseInt(i, 10), s = { ...n }, c = s.period ?? "AM";
|
|
693
|
+
e === "hours" ? o === "24" ? s.hours = $(Math.min(Math.max(a, 0), 23).toString()) : a === 0 ? (c = "AM", s.hours = Ue) : a > 12 ? (c = Ye(a), s.hours = $(Je(a, "12").toString())) : (s.hours = $(Math.min(Math.max(a, 1), 12).toString()), c = n.period ?? Ye(a)) : e === "minutes" ? s.minutes = $(Math.min(Math.max(a, 0), 59).toString()) : e === "seconds" && (s.seconds = $(Math.min(Math.max(a, 0), 59).toString()));
|
|
694
|
+
let l = {
|
|
695
|
+
...s,
|
|
696
|
+
period: o === "12" ? c : void 0
|
|
697
|
+
};
|
|
698
|
+
P(l), I(l);
|
|
699
|
+
}, [
|
|
700
|
+
o,
|
|
701
|
+
P,
|
|
702
|
+
I
|
|
703
|
+
]), B = x.useCallback((e, t) => {
|
|
704
|
+
N.current = null;
|
|
705
|
+
let n = Ge(t), r = { ...Qe(j.current, o) }, i = r.period ?? "AM";
|
|
706
|
+
if (e === "hours") {
|
|
707
|
+
if (o === "24") {
|
|
708
|
+
let e = Number.parseInt(n || "0", 10);
|
|
709
|
+
r.hours = $((Number.isNaN(e) ? 0 : Math.min(Math.max(e, 0), 23)).toString());
|
|
710
|
+
} else {
|
|
711
|
+
let e = Number.parseInt(n || "0", 10);
|
|
712
|
+
Number.isNaN(e) ? (r.hours = Ue, i = r.period ?? "AM") : n.length === 2 && e > 12 ? (i = Ye(e), r.hours = $(Je(e, "12").toString())) : e === 0 ? (i = "AM", r.hours = Ue) : (r.hours = $(Math.min(Math.max(e, 1), 12).toString()), n.length === 2 && (i = r.period ?? Ye(e)));
|
|
713
|
+
}
|
|
714
|
+
} else if (e === "minutes") {
|
|
715
|
+
let e = Number.parseInt(n || "0", 10);
|
|
716
|
+
r.minutes = $((Number.isNaN(e) ? 0 : Math.min(Math.max(e, 0), 59)).toString());
|
|
717
|
+
} else if (e === "seconds") {
|
|
718
|
+
let e = Number.parseInt(n || "0", 10);
|
|
719
|
+
r.seconds = $((Number.isNaN(e) ? 0 : Math.min(Math.max(e, 0), 59)).toString());
|
|
720
|
+
}
|
|
721
|
+
let a = {
|
|
722
|
+
...r,
|
|
723
|
+
period: o === "12" ? i : void 0
|
|
724
|
+
};
|
|
725
|
+
P(a), I(a);
|
|
726
|
+
}, [
|
|
727
|
+
o,
|
|
728
|
+
P,
|
|
729
|
+
I
|
|
730
|
+
]), V = x.useCallback((e) => {
|
|
731
|
+
o === "12" && (N.current = null, L({
|
|
732
|
+
...Qe(j.current, o),
|
|
733
|
+
period: e
|
|
734
|
+
}));
|
|
735
|
+
}, [L, o]), H = x.useCallback(() => {
|
|
736
|
+
N.current = null, L(j.current);
|
|
737
|
+
}, [L]), ce = x.useCallback((e) => {
|
|
738
|
+
N.current = null, e.target.select();
|
|
739
|
+
}, []), ue = x.useCallback((e, t) => {
|
|
740
|
+
if (e.key.length === 1 && /\d/.test(e.key) && !e.metaKey && !e.ctrlKey && !e.altKey) {
|
|
741
|
+
e.preventDefault(), z(t, Number.parseInt(e.key, 10));
|
|
742
|
+
return;
|
|
743
|
+
}
|
|
744
|
+
if (e.key === "ArrowRight") {
|
|
745
|
+
R(Ke(t, T));
|
|
746
|
+
return;
|
|
747
|
+
}
|
|
748
|
+
if (e.key === "ArrowLeft") {
|
|
749
|
+
R(qe(t, T));
|
|
750
|
+
return;
|
|
751
|
+
}
|
|
752
|
+
if (e.key === "Backspace") {
|
|
753
|
+
let n = e.currentTarget;
|
|
754
|
+
n.selectionStart === 0 && n.selectionEnd === 0 && R(qe(t, T));
|
|
755
|
+
}
|
|
756
|
+
}, [
|
|
757
|
+
z,
|
|
758
|
+
R,
|
|
759
|
+
T
|
|
760
|
+
]), G = x.useMemo(() => {
|
|
761
|
+
if (o === "12") return A.period ? [A.period] : void 0;
|
|
762
|
+
}, [o, A.period]), K = {
|
|
763
|
+
hours: y.hours,
|
|
764
|
+
minutes: y.minutes,
|
|
765
|
+
seconds: y.seconds
|
|
766
|
+
}, pe = /* @__PURE__ */ w("div", {
|
|
767
|
+
ref: a === "inline" ? te : void 0,
|
|
768
|
+
className: r("flex items-center gap-space-md [&>.input--component]:w-auto [&>.input--component]:shrink-0", a === "inline" && ["time-picker--component", m]),
|
|
769
|
+
children: [O.map((e, t) => /* @__PURE__ */ w(x.Fragment, { children: [/* @__PURE__ */ C(ne, {
|
|
770
|
+
ref: (t) => {
|
|
771
|
+
F.current[e] = t;
|
|
772
|
+
},
|
|
773
|
+
id: e === "hours" && a === "inline" ? h : void 0,
|
|
774
|
+
value: A[e] ?? Z,
|
|
775
|
+
onChange: (t) => B(e, t.target.value),
|
|
776
|
+
onFocus: ce,
|
|
777
|
+
onBlur: H,
|
|
778
|
+
onKeyDown: (t) => ue(t, e),
|
|
779
|
+
inputMode: "numeric",
|
|
780
|
+
pattern: "\\d*",
|
|
781
|
+
maxLength: 2,
|
|
782
|
+
showCharacterCount: !1,
|
|
783
|
+
disabled: d,
|
|
784
|
+
invalid: f,
|
|
785
|
+
"aria-label": K[e],
|
|
786
|
+
size: S,
|
|
787
|
+
className: r("time-picker--segment text-center", We[S])
|
|
788
|
+
}), t < O.length - 1 && /* @__PURE__ */ C(s, {
|
|
789
|
+
tag: "span",
|
|
790
|
+
type: "secondary",
|
|
791
|
+
children: ":"
|
|
792
|
+
})] }, e)), o === "12" && /* @__PURE__ */ w(ze, {
|
|
793
|
+
value: G,
|
|
794
|
+
onValueChange: (e) => {
|
|
795
|
+
let t = e[0];
|
|
796
|
+
t && V(t);
|
|
797
|
+
},
|
|
798
|
+
disabled: d,
|
|
799
|
+
variant: "outline",
|
|
800
|
+
size: S === "sm" ? "sm" : "default",
|
|
801
|
+
className: "time-picker--period",
|
|
802
|
+
children: [/* @__PURE__ */ C(Be, {
|
|
803
|
+
value: "AM",
|
|
804
|
+
"aria-label": y.am,
|
|
805
|
+
className: r(v[S], Q),
|
|
806
|
+
children: /* @__PURE__ */ C(s, {
|
|
807
|
+
tag: "span",
|
|
808
|
+
size: "inherit",
|
|
809
|
+
weight: "medium",
|
|
810
|
+
lineHeight: "tight",
|
|
811
|
+
className: "text-inherit",
|
|
812
|
+
children: y.am
|
|
813
|
+
})
|
|
814
|
+
}), /* @__PURE__ */ C(Be, {
|
|
815
|
+
value: "PM",
|
|
816
|
+
"aria-label": y.pm,
|
|
817
|
+
className: r(v[S], Q),
|
|
818
|
+
children: /* @__PURE__ */ C(s, {
|
|
819
|
+
tag: "span",
|
|
820
|
+
size: "inherit",
|
|
821
|
+
weight: "medium",
|
|
822
|
+
lineHeight: "tight",
|
|
823
|
+
className: "text-inherit",
|
|
824
|
+
children: y.pm
|
|
825
|
+
})
|
|
826
|
+
})]
|
|
827
|
+
})]
|
|
828
|
+
});
|
|
829
|
+
if (a === "inline") return pe;
|
|
830
|
+
let me = A.hours === Z && A.minutes === Z, he = me ? p ?? y.placeholder : fe(W(Qe(A, o), o, T), T, o, {
|
|
831
|
+
am: y.am,
|
|
832
|
+
pm: y.pm
|
|
833
|
+
});
|
|
834
|
+
return /* @__PURE__ */ w(ie, {
|
|
835
|
+
open: E,
|
|
836
|
+
onOpenChange: D,
|
|
837
|
+
children: [/* @__PURE__ */ w(re, {
|
|
838
|
+
ref: te,
|
|
839
|
+
id: h,
|
|
840
|
+
"aria-expanded": E,
|
|
841
|
+
"aria-invalid": f,
|
|
842
|
+
disabled: d,
|
|
843
|
+
className: r("time-picker--component", _(S), "justify-start", me && "text-muted-foreground", m),
|
|
844
|
+
children: [/* @__PURE__ */ C(k, { className: "size-icon shrink-0" }), /* @__PURE__ */ C(s, {
|
|
845
|
+
tag: "span",
|
|
846
|
+
size: "inherit",
|
|
847
|
+
lineHeight: "tight",
|
|
848
|
+
className: "min-w-0 truncate text-inherit",
|
|
849
|
+
children: he
|
|
850
|
+
})]
|
|
851
|
+
}), /* @__PURE__ */ C(ae, {
|
|
852
|
+
className: "time-picker--panel w-auto",
|
|
853
|
+
align: "start",
|
|
854
|
+
children: pe
|
|
855
|
+
})]
|
|
856
|
+
});
|
|
857
|
+
});
|
|
858
|
+
et.displayName = "TimePicker";
|
|
859
|
+
//#endregion
|
|
860
|
+
//#region src/components/base/date-pickers/date-picker-single.tsx
|
|
861
|
+
function tt({ value: e, defaultValue: t, onValueChange: n, format: a = "yyyy-MM-dd", readableFormat: o = "PPP", placeholder: c, closeOnSelect: l = !0, withTime: u, disabledDates: d, calendarProps: f, open: p, setOpen: m, t: h, dateFnsLocale: g, captionLayout: _, yearBounds: v, rootRef: ne, ...b }) {
|
|
862
|
+
let E = Ne(b.size), D = x.useId(), O = b.id ?? D, k = `${O}-description`, A = b.error !== void 0 && b.error !== null && b.error !== "", oe = A || !!b.invalid, j = A ? k : void 0, M = u?.format ?? "24", P = u?.step ?? 60, F = u?.showSeconds ?? !1, se = pe(o), I = u?.showTimeInButton ?? !se, [L, R] = x.useState(() => e ?? t), [z, B] = x.useState(() => {
|
|
863
|
+
let n = e ?? t;
|
|
864
|
+
return n ? ue(n, F, P) : null;
|
|
865
|
+
}), V = x.useRef(e ?? t ?? void 0), H = x.useRef(!1), U = x.useRef(e !== void 0), W = x.useCallback((e, t) => {
|
|
866
|
+
let n = e, r = t ?? z;
|
|
867
|
+
if (e && u?.enabled && r) {
|
|
868
|
+
let t = ve(e, r);
|
|
869
|
+
n = Number.isFinite(t.getTime()) ? t : void 0;
|
|
870
|
+
}
|
|
871
|
+
return he(n, a, o, g);
|
|
872
|
+
}, [
|
|
873
|
+
a,
|
|
874
|
+
o,
|
|
875
|
+
g,
|
|
876
|
+
u,
|
|
877
|
+
z
|
|
878
|
+
]);
|
|
879
|
+
x.useEffect(() => {
|
|
880
|
+
let r = !!u?.enabled, i = U.current, s = e !== void 0, c = (e, t) => {
|
|
881
|
+
let i = de(ue(e, F, P), P, F);
|
|
882
|
+
if (R((t) => t?.getTime?.() === e.getTime() ? t : e), B((e) => e && e.hours === i.hours && e.minutes === i.minutes && e.seconds === i.seconds ? e : i), V.current = e, H.current = !0, t && r) {
|
|
883
|
+
let t = ve(e, i);
|
|
884
|
+
n?.(he(t, a, o, g));
|
|
885
|
+
}
|
|
886
|
+
};
|
|
887
|
+
if (!r) {
|
|
888
|
+
H.current = !1, V.current = e ?? t ?? void 0, R(e ?? t), U.current = s;
|
|
889
|
+
return;
|
|
890
|
+
}
|
|
891
|
+
let l = V.current?.getTime?.(), d = e?.getTime?.();
|
|
892
|
+
if (!s && i && t === void 0 && (H.current = !1, V.current = void 0), e !== void 0 && d !== l) {
|
|
893
|
+
c(e, !1), U.current = s;
|
|
894
|
+
return;
|
|
895
|
+
}
|
|
896
|
+
if (e === void 0 && t !== void 0) {
|
|
897
|
+
(l !== t.getTime() || !H.current) && c(t, !1), U.current = s;
|
|
898
|
+
return;
|
|
899
|
+
}
|
|
900
|
+
if (e === void 0 && t === void 0 && !H.current) {
|
|
901
|
+
H.current = !0, U.current = s;
|
|
902
|
+
return;
|
|
903
|
+
}
|
|
904
|
+
U.current = s;
|
|
905
|
+
}, [
|
|
906
|
+
u?.enabled,
|
|
907
|
+
e,
|
|
908
|
+
t,
|
|
909
|
+
F,
|
|
910
|
+
P,
|
|
911
|
+
n,
|
|
912
|
+
a,
|
|
913
|
+
o,
|
|
914
|
+
g
|
|
915
|
+
]), x.useEffect(() => {
|
|
916
|
+
u?.enabled && B((e) => {
|
|
917
|
+
if (!e) return e;
|
|
918
|
+
let t = de(e, P, F);
|
|
919
|
+
return e.hours === t.hours && e.minutes === t.minutes && e.seconds === t.seconds ? e : t;
|
|
920
|
+
});
|
|
921
|
+
}, [
|
|
922
|
+
u?.enabled,
|
|
923
|
+
P,
|
|
924
|
+
F
|
|
925
|
+
]);
|
|
926
|
+
let G = x.useCallback((e) => {
|
|
927
|
+
R(e);
|
|
928
|
+
let t;
|
|
929
|
+
u?.enabled && e && (H.current = !0, V.current = e, z || (t = ue(e, F, P), B(t))), n?.(W(e, t)), l && e && m(!1);
|
|
930
|
+
}, [
|
|
931
|
+
n,
|
|
932
|
+
W,
|
|
933
|
+
l,
|
|
934
|
+
m,
|
|
935
|
+
u,
|
|
936
|
+
z,
|
|
937
|
+
F,
|
|
938
|
+
P
|
|
939
|
+
]), K = x.useCallback((e) => {
|
|
940
|
+
let t = ce(e ?? void 0);
|
|
941
|
+
t && (B(t), L && n?.(W(L, t)));
|
|
942
|
+
}, [
|
|
943
|
+
L,
|
|
944
|
+
n,
|
|
945
|
+
W
|
|
946
|
+
]), me = x.useMemo(() => {
|
|
947
|
+
if (u?.enabled && z) return fe(z, F, M, {
|
|
948
|
+
am: h.am,
|
|
949
|
+
pm: h.pm
|
|
950
|
+
});
|
|
951
|
+
}, [
|
|
952
|
+
u?.enabled,
|
|
953
|
+
z,
|
|
954
|
+
F,
|
|
955
|
+
M,
|
|
956
|
+
h
|
|
957
|
+
]), ge = x.useMemo(() => Se(L, o, c, h.selectDate, I ? me : void 0, g), [
|
|
958
|
+
L,
|
|
959
|
+
o,
|
|
960
|
+
c,
|
|
961
|
+
h,
|
|
962
|
+
me,
|
|
963
|
+
I,
|
|
964
|
+
g
|
|
965
|
+
]), _e = x.useMemo(() => L ? N(L, o, { locale: g }) : void 0, [
|
|
966
|
+
L,
|
|
967
|
+
o,
|
|
968
|
+
g
|
|
969
|
+
]);
|
|
970
|
+
return /* @__PURE__ */ C(Ae, {
|
|
971
|
+
rootRef: ne,
|
|
972
|
+
className: b.className,
|
|
973
|
+
label: b.label,
|
|
974
|
+
hint: b.hint,
|
|
975
|
+
error: b.error,
|
|
976
|
+
triggerId: O,
|
|
977
|
+
describedById: k,
|
|
978
|
+
children: /* @__PURE__ */ w(ie, {
|
|
979
|
+
open: p,
|
|
980
|
+
onOpenChange: m,
|
|
981
|
+
children: [/* @__PURE__ */ C(re, { render: (e) => {
|
|
982
|
+
let t = we(b.buttonTone, b.buttonStyle);
|
|
983
|
+
return /* @__PURE__ */ w(i, {
|
|
984
|
+
...e,
|
|
985
|
+
id: O,
|
|
986
|
+
tone: t.tone,
|
|
987
|
+
buttonStyle: t.buttonStyle,
|
|
988
|
+
size: E,
|
|
989
|
+
"aria-invalid": oe,
|
|
990
|
+
"aria-describedby": j,
|
|
991
|
+
className: r(Fe(E), !L && "text-muted-foreground", e.className),
|
|
992
|
+
disabled: b.disabled,
|
|
993
|
+
children: [/* @__PURE__ */ C(T, {
|
|
994
|
+
className: te[E],
|
|
995
|
+
"aria-hidden": "true"
|
|
996
|
+
}), /* @__PURE__ */ C(s, {
|
|
997
|
+
tag: "span",
|
|
998
|
+
size: "inherit",
|
|
999
|
+
lineHeight: "tight",
|
|
1000
|
+
className: "min-w-0 truncate text-inherit",
|
|
1001
|
+
children: ge
|
|
1002
|
+
})]
|
|
1003
|
+
});
|
|
1004
|
+
} }), /* @__PURE__ */ w(ae, {
|
|
1005
|
+
inset: "flush",
|
|
1006
|
+
className: "w-auto gap-0",
|
|
1007
|
+
align: "start",
|
|
1008
|
+
children: [
|
|
1009
|
+
!!b.header && /* @__PURE__ */ C(Me, { config: b.header }),
|
|
1010
|
+
/* @__PURE__ */ C(Oe, {
|
|
1011
|
+
mode: "single",
|
|
1012
|
+
selected: L,
|
|
1013
|
+
onSelect: G,
|
|
1014
|
+
defaultMonth: L,
|
|
1015
|
+
numberOfMonths: b.numberOfMonths,
|
|
1016
|
+
showOutsideDays: b.showOutsideDays,
|
|
1017
|
+
disabled: d ?? b.disabled,
|
|
1018
|
+
locale: g,
|
|
1019
|
+
captionLayout: _,
|
|
1020
|
+
startMonth: v.startMonth,
|
|
1021
|
+
endMonth: v.endMonth,
|
|
1022
|
+
...f
|
|
1023
|
+
}),
|
|
1024
|
+
!!u?.enabled && /* @__PURE__ */ w(S, { children: [/* @__PURE__ */ C(ee, {}), /* @__PURE__ */ C("div", {
|
|
1025
|
+
className: "date-picker--time p-surface",
|
|
1026
|
+
children: /* @__PURE__ */ C(y, {
|
|
1027
|
+
label: h.startTime,
|
|
1028
|
+
children: /* @__PURE__ */ C(et, {
|
|
1029
|
+
value: z ? le(z, F) : null,
|
|
1030
|
+
onValueChange: K,
|
|
1031
|
+
format: M,
|
|
1032
|
+
precision: F ? "seconds" : "minutes",
|
|
1033
|
+
step: P,
|
|
1034
|
+
disabled: b.disabled,
|
|
1035
|
+
size: "sm",
|
|
1036
|
+
strings: {
|
|
1037
|
+
hours: h.hours,
|
|
1038
|
+
minutes: h.minutes,
|
|
1039
|
+
seconds: h.seconds,
|
|
1040
|
+
am: h.am,
|
|
1041
|
+
pm: h.pm
|
|
1042
|
+
}
|
|
1043
|
+
})
|
|
1044
|
+
})
|
|
1045
|
+
})] }),
|
|
1046
|
+
!!b.footer && /* @__PURE__ */ C(je, {
|
|
1047
|
+
config: b.footer,
|
|
1048
|
+
output: W(L),
|
|
1049
|
+
hasSelection: !!L,
|
|
1050
|
+
autoSummary: _e
|
|
1051
|
+
})
|
|
1052
|
+
]
|
|
1053
|
+
})]
|
|
1054
|
+
})
|
|
1055
|
+
});
|
|
1056
|
+
}
|
|
1057
|
+
//#endregion
|
|
1058
|
+
//#region src/components/base/date-pickers/date-picker-multiple.tsx
|
|
1059
|
+
function nt({ value: e, defaultValue: t, onValueChange: n, format: a = "yyyy-MM-dd", readableFormat: o = "PPP", placeholder: c, min: l, max: u, required: d, closeOnSelect: f = !1, disabledDates: p, calendarProps: m, open: h, setOpen: g, t: _, dateFnsLocale: v, captionLayout: ne, yearBounds: y, rootRef: b, ...E }) {
|
|
1060
|
+
let D = Ne(E.size), O = x.useId(), k = E.id ?? O, A = `${k}-description`, oe = E.error !== void 0 && E.error !== null && E.error !== "", j = oe || !!E.invalid, M = oe ? A : void 0, [N, P] = x.useState(e ?? t ?? []);
|
|
1061
|
+
x.useEffect(() => {
|
|
1062
|
+
e !== void 0 && P(e);
|
|
1063
|
+
}, [e]);
|
|
1064
|
+
let F = x.useCallback((e) => ge(e, a, o, v), [
|
|
1065
|
+
a,
|
|
1066
|
+
o,
|
|
1067
|
+
v
|
|
1068
|
+
]), se = x.useCallback((e) => {
|
|
1069
|
+
let t = Array.isArray(e) ? e : e ? [e] : [];
|
|
1070
|
+
P(t), n?.(F(t)), f && t.length > 0 && g(!1);
|
|
1071
|
+
}, [
|
|
1072
|
+
n,
|
|
1073
|
+
F,
|
|
1074
|
+
f,
|
|
1075
|
+
g
|
|
1076
|
+
]), I = x.useMemo(() => J(N, o, c, _.selectDates, _, v), [
|
|
1077
|
+
N,
|
|
1078
|
+
o,
|
|
1079
|
+
c,
|
|
1080
|
+
_,
|
|
1081
|
+
v
|
|
1082
|
+
]), L = x.useMemo(() => q(N, l, u, d, _), [
|
|
1083
|
+
N,
|
|
1084
|
+
l,
|
|
1085
|
+
u,
|
|
1086
|
+
d,
|
|
1087
|
+
_
|
|
1088
|
+
]), R = x.useMemo(() => N.length > 0 ? _.datesSelected(N.length) : void 0, [N.length, _]);
|
|
1089
|
+
return /* @__PURE__ */ C(Ae, {
|
|
1090
|
+
rootRef: b,
|
|
1091
|
+
className: E.className,
|
|
1092
|
+
label: E.label,
|
|
1093
|
+
hint: E.hint,
|
|
1094
|
+
error: E.error,
|
|
1095
|
+
triggerId: k,
|
|
1096
|
+
describedById: A,
|
|
1097
|
+
children: /* @__PURE__ */ w(ie, {
|
|
1098
|
+
open: h,
|
|
1099
|
+
onOpenChange: g,
|
|
1100
|
+
children: [/* @__PURE__ */ C(re, { render: (e) => {
|
|
1101
|
+
let t = we(E.buttonTone, E.buttonStyle);
|
|
1102
|
+
return /* @__PURE__ */ w(i, {
|
|
1103
|
+
...e,
|
|
1104
|
+
id: k,
|
|
1105
|
+
tone: t.tone,
|
|
1106
|
+
buttonStyle: t.buttonStyle,
|
|
1107
|
+
size: D,
|
|
1108
|
+
"aria-invalid": j,
|
|
1109
|
+
"aria-describedby": M,
|
|
1110
|
+
className: r(Fe(D), N.length === 0 && "text-muted-foreground", e.className),
|
|
1111
|
+
disabled: E.disabled,
|
|
1112
|
+
children: [/* @__PURE__ */ C(T, {
|
|
1113
|
+
className: te[D],
|
|
1114
|
+
"aria-hidden": "true"
|
|
1115
|
+
}), /* @__PURE__ */ C(s, {
|
|
1116
|
+
tag: "span",
|
|
1117
|
+
size: "inherit",
|
|
1118
|
+
lineHeight: "tight",
|
|
1119
|
+
className: "min-w-0 truncate text-inherit",
|
|
1120
|
+
children: I
|
|
1121
|
+
})]
|
|
1122
|
+
});
|
|
1123
|
+
} }), /* @__PURE__ */ w(ae, {
|
|
1124
|
+
inset: "flush",
|
|
1125
|
+
className: "w-auto gap-0",
|
|
1126
|
+
align: "start",
|
|
1127
|
+
children: [
|
|
1128
|
+
!!E.header && /* @__PURE__ */ C(Me, { config: E.header }),
|
|
1129
|
+
/* @__PURE__ */ C(Oe, {
|
|
1130
|
+
mode: "multiple",
|
|
1131
|
+
selected: N,
|
|
1132
|
+
onSelect: se,
|
|
1133
|
+
defaultMonth: N[0],
|
|
1134
|
+
numberOfMonths: E.numberOfMonths,
|
|
1135
|
+
showOutsideDays: E.showOutsideDays,
|
|
1136
|
+
disabled: p ?? E.disabled,
|
|
1137
|
+
locale: v,
|
|
1138
|
+
captionLayout: ne,
|
|
1139
|
+
startMonth: y.startMonth,
|
|
1140
|
+
endMonth: y.endMonth,
|
|
1141
|
+
required: d,
|
|
1142
|
+
max: u,
|
|
1143
|
+
...m
|
|
1144
|
+
}),
|
|
1145
|
+
!!L && /* @__PURE__ */ w(S, { children: [/* @__PURE__ */ C(ee, {}), /* @__PURE__ */ C("div", {
|
|
1146
|
+
className: "p-surface",
|
|
1147
|
+
children: /* @__PURE__ */ C(s, {
|
|
1148
|
+
type: "secondary",
|
|
1149
|
+
children: L
|
|
1150
|
+
})
|
|
1151
|
+
})] }),
|
|
1152
|
+
!!E.footer && /* @__PURE__ */ C(je, {
|
|
1153
|
+
config: E.footer,
|
|
1154
|
+
output: F(N),
|
|
1155
|
+
hasSelection: N.length > 0,
|
|
1156
|
+
autoSummary: R
|
|
1157
|
+
})
|
|
1158
|
+
]
|
|
1159
|
+
})]
|
|
1160
|
+
})
|
|
1161
|
+
});
|
|
1162
|
+
}
|
|
1163
|
+
//#endregion
|
|
1164
|
+
//#region src/components/base/date-pickers/date-picker-range.tsx
|
|
1165
|
+
function rt({ value: t, defaultValue: n, onValueChange: a, format: o = "yyyy-MM-dd", readableFormat: c = "PPP", placeholder: l, withConfirm: u = !1, min: p, max: m, closeOnSelect: h = !0, withTime: g, presets: _, disabledDates: v, calendarProps: ne, open: E, setOpen: D, t: O, dateFnsLocale: k, captionLayout: A, yearBounds: oe, rootRef: j, ...M }) {
|
|
1166
|
+
let P = b(), F = M.numberOfMonths ?? (P ? 1 : 2), { weekStartsOn: se = 1 } = e(), I = _ ?? De(O, se), L = Ne(M.size), R = x.useId(), z = M.id ?? R, B = `${z}-description`, V = M.error !== void 0 && M.error !== null && M.error !== "", H = V || !!M.invalid, U = V ? B : void 0, W = g?.format ?? "24", G = g?.step ?? 60, K = g?.showSeconds ?? !1, me = pe(c), he = g?.showTimeInButton ?? !me, ge = g?.showTimeInSummary ?? !me, ye = t ?? n, [q, Se] = x.useState(ye), [J, Te] = x.useState(() => ye?.from ? ue(ye.from, K, G) : null), [Y, Ee] = x.useState(() => ye?.to ? ue(ye.to, K, G) : null), ke = x.useRef(t), Pe = x.useMemo(() => xe(q, p, m, O), [
|
|
1167
|
+
q,
|
|
1168
|
+
p,
|
|
1169
|
+
m,
|
|
1170
|
+
O
|
|
1171
|
+
]), Ie = Pe != null && Pe !== "", Le = typeof Pe == "string" ? Pe : "";
|
|
1172
|
+
x.useEffect(() => {
|
|
1173
|
+
t !== void 0 && Se(t);
|
|
1174
|
+
}, [t]), x.useEffect(() => {
|
|
1175
|
+
if (!g?.enabled) {
|
|
1176
|
+
ke.current = t;
|
|
1177
|
+
return;
|
|
1178
|
+
}
|
|
1179
|
+
let e = ke.current, n = t?.from, r = t?.to;
|
|
1180
|
+
n ? Te(ue(n, K, G)) : e?.from && Te(null), r ? Ee(ue(r, K, G)) : e?.to && Ee(null), ke.current = t;
|
|
1181
|
+
}, [
|
|
1182
|
+
t,
|
|
1183
|
+
g?.enabled,
|
|
1184
|
+
K,
|
|
1185
|
+
G
|
|
1186
|
+
]), x.useEffect(() => {
|
|
1187
|
+
if (!g?.enabled) return;
|
|
1188
|
+
let e = (e) => {
|
|
1189
|
+
if (!e) return e;
|
|
1190
|
+
let t = de(e, G, K);
|
|
1191
|
+
return e.hours === t.hours && e.minutes === t.minutes && e.seconds === t.seconds ? e : t;
|
|
1192
|
+
};
|
|
1193
|
+
Te(e), Ee(e);
|
|
1194
|
+
}, [
|
|
1195
|
+
g?.enabled,
|
|
1196
|
+
G,
|
|
1197
|
+
K
|
|
1198
|
+
]);
|
|
1199
|
+
let Re = x.useCallback((e) => {
|
|
1200
|
+
let t = e;
|
|
1201
|
+
return e && g?.enabled && (t = {
|
|
1202
|
+
...e,
|
|
1203
|
+
from: e.from && J ? ve(e.from, J) : e.from,
|
|
1204
|
+
to: e.to && Y ? ve(e.to, Y) : e.to
|
|
1205
|
+
}), _e(t, o, c, k);
|
|
1206
|
+
}, [
|
|
1207
|
+
o,
|
|
1208
|
+
c,
|
|
1209
|
+
k,
|
|
1210
|
+
g,
|
|
1211
|
+
J,
|
|
1212
|
+
Y
|
|
1213
|
+
]), ze = x.useCallback((e) => {
|
|
1214
|
+
let t = ce(e ?? void 0);
|
|
1215
|
+
t && Te(t);
|
|
1216
|
+
}, []), Be = x.useCallback((e) => {
|
|
1217
|
+
let t = ce(e ?? void 0);
|
|
1218
|
+
t && Ee(t);
|
|
1219
|
+
}, []), Ve = x.useCallback((e, t, n) => t ? !n?.from || n.to ? {
|
|
1220
|
+
from: t,
|
|
1221
|
+
to: void 0
|
|
1222
|
+
} : t < n.from ? {
|
|
1223
|
+
from: t,
|
|
1224
|
+
to: n.from
|
|
1225
|
+
} : {
|
|
1226
|
+
from: n.from,
|
|
1227
|
+
to: t
|
|
1228
|
+
} : e, []), X = x.useCallback((e, t) => {
|
|
1229
|
+
let n = Ve(e, t, q);
|
|
1230
|
+
if (Se(n), u || g?.enabled) return;
|
|
1231
|
+
a?.(Re(n));
|
|
1232
|
+
let r = !!(n?.from && n?.to), i = be(n, p, m).isValid;
|
|
1233
|
+
h && r && i && D(!1);
|
|
1234
|
+
}, [
|
|
1235
|
+
q,
|
|
1236
|
+
Ve,
|
|
1237
|
+
u,
|
|
1238
|
+
g,
|
|
1239
|
+
a,
|
|
1240
|
+
Re,
|
|
1241
|
+
p,
|
|
1242
|
+
m,
|
|
1243
|
+
h,
|
|
1244
|
+
D
|
|
1245
|
+
]), He = x.useCallback((e) => {
|
|
1246
|
+
let t = e.getValue();
|
|
1247
|
+
X(t);
|
|
1248
|
+
}, [X]), Ue = x.useCallback(() => {
|
|
1249
|
+
a?.(Re(q)), D(!1);
|
|
1250
|
+
}, [
|
|
1251
|
+
q,
|
|
1252
|
+
a,
|
|
1253
|
+
Re,
|
|
1254
|
+
D
|
|
1255
|
+
]), Z = x.useMemo(() => {
|
|
1256
|
+
if (g?.enabled && J) return fe(J, K, W, {
|
|
1257
|
+
am: O.am,
|
|
1258
|
+
pm: O.pm
|
|
1259
|
+
});
|
|
1260
|
+
}, [
|
|
1261
|
+
g?.enabled,
|
|
1262
|
+
J,
|
|
1263
|
+
K,
|
|
1264
|
+
W,
|
|
1265
|
+
O
|
|
1266
|
+
]), Q = x.useMemo(() => {
|
|
1267
|
+
if (g?.enabled && Y) return fe(Y, K, W, {
|
|
1268
|
+
am: O.am,
|
|
1269
|
+
pm: O.pm
|
|
1270
|
+
});
|
|
1271
|
+
}, [
|
|
1272
|
+
g?.enabled,
|
|
1273
|
+
Y,
|
|
1274
|
+
K,
|
|
1275
|
+
W,
|
|
1276
|
+
O
|
|
1277
|
+
]), We = x.useMemo(() => {
|
|
1278
|
+
if (g?.enabled && q?.from) {
|
|
1279
|
+
let e = N(q.from, c, { locale: k }), t = he && Z ? `${e} ${Z}` : e;
|
|
1280
|
+
if (q.to) {
|
|
1281
|
+
let e = N(q.to, c, { locale: k });
|
|
1282
|
+
return `${t} - ${he && Q ? `${e} ${Q}` : e}`;
|
|
1283
|
+
}
|
|
1284
|
+
return t;
|
|
1285
|
+
}
|
|
1286
|
+
return Ce(q, c, l, O.selectDateRange, k);
|
|
1287
|
+
}, [
|
|
1288
|
+
g?.enabled,
|
|
1289
|
+
q,
|
|
1290
|
+
c,
|
|
1291
|
+
he,
|
|
1292
|
+
Z,
|
|
1293
|
+
Q,
|
|
1294
|
+
l,
|
|
1295
|
+
O,
|
|
1296
|
+
k
|
|
1297
|
+
]), Ge = x.useMemo(() => {
|
|
1298
|
+
if (!q?.from || !q?.to) return;
|
|
1299
|
+
let e = N(q.from, c, { locale: k }), t = N(q.to, c, { locale: k });
|
|
1300
|
+
return `${ge && Z ? `${e} ${Z}` : e} - ${ge && Q ? `${t} ${Q}` : t}`;
|
|
1301
|
+
}, [
|
|
1302
|
+
q,
|
|
1303
|
+
c,
|
|
1304
|
+
k,
|
|
1305
|
+
ge,
|
|
1306
|
+
Z,
|
|
1307
|
+
Q
|
|
1308
|
+
]);
|
|
1309
|
+
return /* @__PURE__ */ C(Ae, {
|
|
1310
|
+
rootRef: j,
|
|
1311
|
+
className: M.className,
|
|
1312
|
+
label: M.label,
|
|
1313
|
+
hint: M.hint,
|
|
1314
|
+
error: M.error,
|
|
1315
|
+
triggerId: z,
|
|
1316
|
+
describedById: B,
|
|
1317
|
+
children: /* @__PURE__ */ w(ie, {
|
|
1318
|
+
open: E,
|
|
1319
|
+
onOpenChange: D,
|
|
1320
|
+
children: [/* @__PURE__ */ C(re, { render: (e) => {
|
|
1321
|
+
let t = we(M.buttonTone, M.buttonStyle);
|
|
1322
|
+
return /* @__PURE__ */ w(i, {
|
|
1323
|
+
...e,
|
|
1324
|
+
id: z,
|
|
1325
|
+
tone: t.tone,
|
|
1326
|
+
buttonStyle: t.buttonStyle,
|
|
1327
|
+
size: L,
|
|
1328
|
+
"aria-invalid": H,
|
|
1329
|
+
"aria-describedby": U,
|
|
1330
|
+
className: r(Fe(L), !q && "text-muted-foreground", e.className),
|
|
1331
|
+
disabled: M.disabled,
|
|
1332
|
+
children: [/* @__PURE__ */ C(T, {
|
|
1333
|
+
className: r(te[L], "shrink-0"),
|
|
1334
|
+
"aria-hidden": "true"
|
|
1335
|
+
}), /* @__PURE__ */ C(s, {
|
|
1336
|
+
tag: "span",
|
|
1337
|
+
size: "inherit",
|
|
1338
|
+
lineHeight: "tight",
|
|
1339
|
+
className: "min-w-0 truncate text-inherit",
|
|
1340
|
+
children: We
|
|
1341
|
+
})]
|
|
1342
|
+
});
|
|
1343
|
+
} }), /* @__PURE__ */ w(ae, {
|
|
1344
|
+
inset: "flush",
|
|
1345
|
+
className: "w-auto gap-0",
|
|
1346
|
+
align: "start",
|
|
1347
|
+
children: [!!M.header && /* @__PURE__ */ C(Me, { config: M.header }), /* @__PURE__ */ w("div", {
|
|
1348
|
+
className: "flex flex-col sm:flex-row",
|
|
1349
|
+
children: [I.length > 0 && /* @__PURE__ */ C("div", {
|
|
1350
|
+
className: "grid grid-cols-2 gap-space-2xs border-b border-border p-surface-xs sm:flex sm:min-w-30 sm:flex-col sm:border-r sm:border-b-0",
|
|
1351
|
+
children: I.map((e) => /* @__PURE__ */ C(i, {
|
|
1352
|
+
tone: "secondary",
|
|
1353
|
+
buttonStyle: "ghost",
|
|
1354
|
+
onClick: () => He(e),
|
|
1355
|
+
className: "justify-start text-muted-foreground hover:text-foreground",
|
|
1356
|
+
children: e.label
|
|
1357
|
+
}, e.label))
|
|
1358
|
+
}), /* @__PURE__ */ w("div", {
|
|
1359
|
+
className: "flex flex-col",
|
|
1360
|
+
children: [
|
|
1361
|
+
/* @__PURE__ */ C(Oe, {
|
|
1362
|
+
mode: "range",
|
|
1363
|
+
selected: q,
|
|
1364
|
+
onSelect: X,
|
|
1365
|
+
defaultMonth: q?.from,
|
|
1366
|
+
numberOfMonths: F,
|
|
1367
|
+
showOutsideDays: M.showOutsideDays,
|
|
1368
|
+
disabled: v ?? M.disabled,
|
|
1369
|
+
locale: k,
|
|
1370
|
+
captionLayout: A,
|
|
1371
|
+
startMonth: oe.startMonth,
|
|
1372
|
+
endMonth: oe.endMonth,
|
|
1373
|
+
...ne,
|
|
1374
|
+
className: r("[--cell-size:1.875rem] sm:[--cell-size:calc(var(--height-action)*8/9*var(--density-scale))]", ne?.className)
|
|
1375
|
+
}),
|
|
1376
|
+
(() => {
|
|
1377
|
+
let e = !!q?.from && !M.footer, t = !!g?.enabled && !!q?.from, n = !!(u || g?.enabled) && !M.footer;
|
|
1378
|
+
return !e && !t && !Ie && !n ? null : /* @__PURE__ */ w(S, { children: [/* @__PURE__ */ C(ee, {}), /* @__PURE__ */ C("div", {
|
|
1379
|
+
className: "date-picker--range-footer p-surface",
|
|
1380
|
+
children: /* @__PURE__ */ w(f, {
|
|
1381
|
+
gap: "lg",
|
|
1382
|
+
children: [
|
|
1383
|
+
e && !!q?.from && /* @__PURE__ */ w(f, {
|
|
1384
|
+
direction: "horizontal",
|
|
1385
|
+
align: "center",
|
|
1386
|
+
justify: "between",
|
|
1387
|
+
gap: "xl",
|
|
1388
|
+
children: [/* @__PURE__ */ w(f, {
|
|
1389
|
+
direction: "horizontal",
|
|
1390
|
+
align: "center",
|
|
1391
|
+
gap: "md",
|
|
1392
|
+
children: [/* @__PURE__ */ w(s, {
|
|
1393
|
+
tag: "span",
|
|
1394
|
+
type: "secondary",
|
|
1395
|
+
children: [O.from, ":"]
|
|
1396
|
+
}), /* @__PURE__ */ w(s, {
|
|
1397
|
+
tag: "span",
|
|
1398
|
+
weight: "medium",
|
|
1399
|
+
children: [N(q.from, c, { locale: k }), ge && Z ? ` ${Z}` : ""]
|
|
1400
|
+
})]
|
|
1401
|
+
}), !!q.to && /* @__PURE__ */ w(f, {
|
|
1402
|
+
direction: "horizontal",
|
|
1403
|
+
align: "center",
|
|
1404
|
+
gap: "md",
|
|
1405
|
+
children: [/* @__PURE__ */ w(s, {
|
|
1406
|
+
tag: "span",
|
|
1407
|
+
type: "secondary",
|
|
1408
|
+
children: [O.to, ":"]
|
|
1409
|
+
}), /* @__PURE__ */ w(s, {
|
|
1410
|
+
tag: "span",
|
|
1411
|
+
weight: "medium",
|
|
1412
|
+
children: [N(q.to, c, { locale: k }), ge && Q ? ` ${Q}` : ""]
|
|
1413
|
+
})]
|
|
1414
|
+
})]
|
|
1415
|
+
}),
|
|
1416
|
+
t && !!q?.from && /* @__PURE__ */ w(d, {
|
|
1417
|
+
columns: {
|
|
1418
|
+
base: 1,
|
|
1419
|
+
sm: 2
|
|
1420
|
+
},
|
|
1421
|
+
gap: "lg",
|
|
1422
|
+
children: [/* @__PURE__ */ C(y, {
|
|
1423
|
+
label: O.startTime,
|
|
1424
|
+
children: /* @__PURE__ */ C(et, {
|
|
1425
|
+
value: J ? le(J, K) : null,
|
|
1426
|
+
onValueChange: ze,
|
|
1427
|
+
format: W,
|
|
1428
|
+
precision: K ? "seconds" : "minutes",
|
|
1429
|
+
step: G,
|
|
1430
|
+
disabled: M.disabled,
|
|
1431
|
+
size: "sm",
|
|
1432
|
+
strings: {
|
|
1433
|
+
hours: O.hours,
|
|
1434
|
+
minutes: O.minutes,
|
|
1435
|
+
seconds: O.seconds,
|
|
1436
|
+
am: O.am,
|
|
1437
|
+
pm: O.pm
|
|
1438
|
+
}
|
|
1439
|
+
})
|
|
1440
|
+
}), !!q.to && /* @__PURE__ */ C(y, {
|
|
1441
|
+
label: O.endTime,
|
|
1442
|
+
children: /* @__PURE__ */ C(et, {
|
|
1443
|
+
value: Y ? le(Y, K) : null,
|
|
1444
|
+
onValueChange: Be,
|
|
1445
|
+
format: W,
|
|
1446
|
+
precision: K ? "seconds" : "minutes",
|
|
1447
|
+
step: G,
|
|
1448
|
+
disabled: M.disabled,
|
|
1449
|
+
size: "sm",
|
|
1450
|
+
strings: {
|
|
1451
|
+
hours: O.hours,
|
|
1452
|
+
minutes: O.minutes,
|
|
1453
|
+
seconds: O.seconds,
|
|
1454
|
+
am: O.am,
|
|
1455
|
+
pm: O.pm
|
|
1456
|
+
}
|
|
1457
|
+
})
|
|
1458
|
+
})]
|
|
1459
|
+
}),
|
|
1460
|
+
/* @__PURE__ */ C(s, {
|
|
1461
|
+
type: "error",
|
|
1462
|
+
content: Le,
|
|
1463
|
+
hidden: !Ie
|
|
1464
|
+
}),
|
|
1465
|
+
n && /* @__PURE__ */ C(i, {
|
|
1466
|
+
tone: "primary",
|
|
1467
|
+
onClick: Ue,
|
|
1468
|
+
disabled: !q?.from || !q?.to || !!Pe,
|
|
1469
|
+
className: "w-full",
|
|
1470
|
+
children: O.confirm
|
|
1471
|
+
})
|
|
1472
|
+
]
|
|
1473
|
+
})
|
|
1474
|
+
})] });
|
|
1475
|
+
})(),
|
|
1476
|
+
!!M.footer && /* @__PURE__ */ C(je, {
|
|
1477
|
+
config: M.footer,
|
|
1478
|
+
output: Re(q),
|
|
1479
|
+
hasSelection: !!(q?.from && q?.to),
|
|
1480
|
+
autoSummary: Ge
|
|
1481
|
+
})
|
|
1482
|
+
]
|
|
1483
|
+
})]
|
|
1484
|
+
})]
|
|
1485
|
+
})]
|
|
1486
|
+
})
|
|
1487
|
+
});
|
|
1488
|
+
}
|
|
1489
|
+
//#endregion
|
|
1490
|
+
//#region src/components/base/date-pickers/date-picker.tsx
|
|
1491
|
+
var it = x.forwardRef(function(t, i) {
|
|
1492
|
+
let [a, o] = x.useState(!1), s = e(), c = t.locale ?? s.locale ?? z, l = n(Ie, t.strings), u = x.useMemo(() => t.enableYearDropdown || t.yearSelection?.enabled ? "dropdown" : "label", [t.enableYearDropdown, t.yearSelection]), d = x.useMemo(() => me(t.yearSelection), [t.yearSelection]), f = r("date-picker--component", t.className);
|
|
1493
|
+
return Te(t) ? /* @__PURE__ */ C(tt, {
|
|
1494
|
+
...t,
|
|
1495
|
+
rootRef: i,
|
|
1496
|
+
className: f,
|
|
1497
|
+
open: a,
|
|
1498
|
+
setOpen: o,
|
|
1499
|
+
t: l,
|
|
1500
|
+
dateFnsLocale: c,
|
|
1501
|
+
captionLayout: u,
|
|
1502
|
+
yearBounds: d
|
|
1503
|
+
}) : Y(t) ? /* @__PURE__ */ C(nt, {
|
|
1504
|
+
...t,
|
|
1505
|
+
rootRef: i,
|
|
1506
|
+
className: f,
|
|
1507
|
+
open: a,
|
|
1508
|
+
setOpen: o,
|
|
1509
|
+
t: l,
|
|
1510
|
+
dateFnsLocale: c,
|
|
1511
|
+
captionLayout: u,
|
|
1512
|
+
yearBounds: d
|
|
1513
|
+
}) : Ee(t) ? /* @__PURE__ */ C(rt, {
|
|
1514
|
+
...t,
|
|
1515
|
+
rootRef: i,
|
|
1516
|
+
className: f,
|
|
1517
|
+
open: a,
|
|
1518
|
+
setOpen: o,
|
|
1519
|
+
t: l,
|
|
1520
|
+
dateFnsLocale: c,
|
|
1521
|
+
captionLayout: u,
|
|
1522
|
+
yearBounds: d
|
|
1523
|
+
}) : null;
|
|
1524
|
+
});
|
|
1525
|
+
it.displayName = "DatePicker";
|
|
1526
|
+
//#endregion
|
|
1527
|
+
export { Fe as a, je as c, Ie as i, Ae as l, et as n, Ne as o, Ve as r, Me as s, it as t, we as u };
|
|
1528
|
+
|
|
1529
|
+
//# sourceMappingURL=date-picker-CF-DtUpF.js.map
|