themelia-react-ui 1.0.0 → 1.0.2
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 +190 -1
- package/README.md +92 -13
- package/dist/{accordion-BRWh3BM1.js → accordion-BRTcsp8J.js} +8 -8
- package/dist/accordion-BRTcsp8J.js.map +1 -0
- package/dist/{action-menu-Cx3SdfbN.js → action-menu-Drxw_vJk.js} +36 -36
- package/dist/action-menu-Drxw_vJk.js.map +1 -0
- package/dist/affordance-geometry.generated-CL84ZN9A.js +63 -0
- package/dist/affordance-geometry.generated-CL84ZN9A.js.map +1 -0
- package/dist/{ai-artifact-DkOArd3-.js → ai-artifact-DLVdK0Py.js} +151 -155
- package/dist/ai-artifact-DLVdK0Py.js.map +1 -0
- package/dist/{app-shell-BH_bGcE2.js → app-shell-C_fKpljx.js} +11 -10
- package/dist/app-shell-C_fKpljx.js.map +1 -0
- package/dist/{attachment-DsLgNHXt.js → attachment-DbjUWsP0.js} +12 -12
- package/dist/{attachment-DsLgNHXt.js.map → attachment-DbjUWsP0.js.map} +1 -1
- package/dist/auth-CAQcasMV.js +723 -0
- package/dist/auth-CAQcasMV.js.map +1 -0
- package/dist/{avatar-CsnWaYmt.js → avatar-Bu2HhitA.js} +76 -71
- package/dist/avatar-Bu2HhitA.js.map +1 -0
- package/dist/{badge-BZXZT9wd.js → badge-CzId1Wlm.js} +4 -4
- package/dist/{badge-BZXZT9wd.js.map → badge-CzId1Wlm.js.map} +1 -1
- package/dist/base/accordion.js +1 -1
- package/dist/base/action-menu.js +1 -1
- package/dist/base/attachment.js +1 -1
- package/dist/base/avatar.js +1 -1
- package/dist/base/badge.js +1 -1
- package/dist/base/buttons.js +3 -2
- package/dist/base/cards.js +3 -3
- package/dist/base/carousel.js +25 -27
- package/dist/base/carousel.js.map +1 -1
- package/dist/base/cascader.js +150 -148
- package/dist/base/cascader.js.map +1 -1
- package/dist/base/chart.js +1 -1
- package/dist/base/choice-inputs.js +3 -2
- 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 +3 -3
- package/dist/base/display.js +7 -7
- package/dist/base/feedback.js +4 -3
- package/dist/base/forms-numeric.js +1 -1
- package/dist/base/forms.js +2 -2
- package/dist/base/inline-edit.js +233 -0
- package/dist/base/inline-edit.js.map +1 -0
- package/dist/base/item.js +1 -1
- package/dist/base/media-gallery.js +1 -1
- package/dist/base/navigation.js +6 -6
- 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 +33 -33
- 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 +83 -81
- 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 +6 -6
- package/dist/base/toaster.js.map +1 -1
- package/dist/base/tree.js +1 -1
- package/dist/base/upload-queue.js +1 -1
- package/dist/base/upload.js +3 -3
- package/dist/base/value-inputs.js +1 -1
- package/dist/blocks/admin.js +134 -134
- package/dist/blocks/admin.js.map +1 -1
- package/dist/blocks/ai.js +120 -117
- package/dist/blocks/ai.js.map +1 -1
- package/dist/blocks/analytics/usage-card.js +3 -0
- package/dist/blocks/analytics.js +530 -491
- package/dist/blocks/analytics.js.map +1 -1
- package/dist/blocks/collaboration.js +2 -2
- package/dist/blocks/commerce/receipt.js +1 -1
- package/dist/blocks/commerce.js +395 -383
- package/dist/blocks/commerce.js.map +1 -1
- package/dist/blocks/data-display.js +1 -1
- package/dist/blocks/onboarding.js +6 -6
- package/dist/blocks/onboarding.js.map +1 -1
- package/dist/blocks/planning.js +311 -0
- package/dist/blocks/planning.js.map +1 -0
- package/dist/blocks/timelines.js +1 -1
- package/dist/{breadcrumbs-DdQ_I5ra.js → breadcrumbs-BuYz5SDU.js} +9 -8
- package/dist/breadcrumbs-BuYz5SDU.js.map +1 -0
- package/dist/button-BZDasD04.js +651 -0
- package/dist/button-BZDasD04.js.map +1 -0
- package/dist/{button-BS6l5JUw.js → button-BZyfTvwm.js} +3 -3
- package/dist/button-BZyfTvwm.js.map +1 -0
- package/dist/buttons-D_6KJvEE.js +99 -0
- package/dist/buttons-D_6KJvEE.js.map +1 -0
- package/dist/{cards-BMB0laLG.js → cards-qGSErLw_.js} +12 -12
- package/dist/{cards-BMB0laLG.js.map → cards-qGSErLw_.js.map} +1 -1
- package/dist/chart-Bsc5BICK.js +150 -0
- package/dist/chart-Bsc5BICK.js.map +1 -0
- package/dist/checkbox-BQNDjUCh.js +34 -0
- package/dist/checkbox-BQNDjUCh.js.map +1 -0
- package/dist/choice-inputs-Mk3iWbhr.js +725 -0
- package/dist/choice-inputs-Mk3iWbhr.js.map +1 -0
- package/dist/{code-block-DIlqzoiD.js → code-block-DzHKRybS.js} +23 -23
- package/dist/code-block-DzHKRybS.js.map +1 -0
- package/dist/{collapsible-DsnktFNv.js → collapsible-ClvC7Bj3.js} +3 -3
- package/dist/{collapsible-DsnktFNv.js.map → collapsible-ClvC7Bj3.js.map} +1 -1
- package/dist/{collection-content-C4fthJV_.js → collection-content-D6S8cv_n.js} +3 -3
- package/dist/{collection-content-C4fthJV_.js.map → collection-content-D6S8cv_n.js.map} +1 -1
- package/dist/{combobox-HDftpzxt.js → combobox-BFnbJJp3.js} +18 -18
- package/dist/combobox-BFnbJJp3.js.map +1 -0
- package/dist/{combobox-CHD750do.js → combobox-hozNwUcc.js} +313 -316
- package/dist/combobox-hozNwUcc.js.map +1 -0
- package/dist/{command-D0kWBZfd.js → command-BnmSchli.js} +9 -9
- package/dist/command-BnmSchli.js.map +1 -0
- package/dist/comments-u5L0OGip.js +1156 -0
- package/dist/comments-u5L0OGip.js.map +1 -0
- package/dist/components/base/buttons/button-group.recipes.d.ts +1 -1
- package/dist/components/base/buttons/button.recipes.d.ts +10 -19
- package/dist/components/base/buttons/use-pending-button-focus.d.ts +3 -0
- package/dist/components/base/cards/card.recipes.d.ts +13 -5
- package/dist/components/base/cards/partials/card-primitives.d.ts +9 -4
- package/dist/components/base/cards/smart-card.types.d.ts +3 -1
- package/dist/components/base/date-pickers/date-picker.recipes.d.ts +5 -18
- package/dist/components/base/date-pickers/datepicker.types.d.ts +3 -0
- package/dist/components/base/forms/form-field.d.ts +1 -0
- package/dist/components/base/forms/form-sizing.d.ts +3 -3
- package/dist/components/base/inline-edit/index.d.ts +2 -0
- package/dist/components/base/inline-edit/inline-edit.d.ts +81 -0
- package/dist/components/base/inline-edit/inline-edit.recipes.d.ts +6 -0
- package/dist/components/base/navigation/tabs.d.ts +3 -5
- package/dist/components/base/popover/popover.recipes.d.ts +3 -3
- package/dist/components/base/structure/structure.recipes.d.ts +6 -0
- package/dist/components/base/table/index.d.ts +1 -1
- package/dist/components/base/text-inputs/clear-native-field.d.ts +2 -0
- package/dist/components/base/text-inputs/input-trailing-action.d.ts +3 -0
- package/dist/components/blocks/analytics/index.d.ts +1 -0
- package/dist/components/blocks/analytics/types.d.ts +1 -1
- package/dist/components/blocks/analytics/usage-card/index.d.ts +3 -0
- package/dist/components/blocks/analytics/usage-card/types.d.ts +52 -0
- package/dist/components/blocks/analytics/usage-card/usage-card.d.ts +6 -0
- package/dist/components/blocks/analytics/usage-card/usage-card.data.d.ts +19 -0
- package/dist/components/blocks/analytics/usage-card/usage-card.strings.d.ts +22 -0
- package/dist/components/blocks/collaboration/message/message.recipes.d.ts +12 -0
- package/dist/components/blocks/data-display/empty-state/partials/illustrations/document-stack.d.ts +1 -4
- package/dist/components/blocks/data-display/empty-state/partials/illustrations/inbox-clean.d.ts +1 -4
- package/dist/components/blocks/data-display/empty-state/partials/illustrations/index.d.ts +3 -3
- package/dist/components/blocks/data-display/empty-state/partials/illustrations/stacked-cards.d.ts +1 -6
- package/dist/components/blocks/planning/index.d.ts +3 -0
- package/dist/components/blocks/planning/task-card.d.ts +3 -0
- package/dist/components/blocks/planning/task-card.strings.d.ts +15 -0
- package/dist/components/blocks/planning/task-card.types.d.ts +66 -0
- package/dist/components/features/combobox/components/error-message.d.ts +1 -1
- package/dist/components/features/comments/hooks/use-attachment-upload.d.ts +5 -0
- package/dist/components/features/filters/facets/search-facet.d.ts +0 -12
- package/dist/components/features/filters/facets/tags-facet.d.ts +1 -1
- package/dist/components/features/media-library/media-library.d.ts +1 -1
- package/dist/components/features/media-library/media-library.types.d.ts +9 -1
- package/dist/components/features/media-library/partials/media-library-partials.d.ts +1 -1
- package/dist/components/features/overlays/hooks/use-pending-overlay-focus.d.ts +2 -0
- package/dist/components/features/overlays/overlays.types.d.ts +5 -4
- package/dist/components/features/rich-text-editor/rich-text-editor.recipes.d.ts +2 -1
- package/dist/components/features/table/data-table.d.ts +1 -1
- package/dist/components/features/table/table.types.d.ts +1 -1
- package/dist/components/features/theme-tweaker/theme-provider-settings.d.ts +3 -1
- package/dist/components/layout/auth/auth.types.d.ts +1 -0
- package/dist/components/layout/page/page.d.ts +0 -1
- package/dist/components/layout/page/page.types.d.ts +9 -3
- package/dist/components/layout/sidebar/sidebar.context.d.ts +1 -1
- package/dist/components/layout/sidebar/sidebar.types.d.ts +4 -0
- package/dist/components/layout/workspace/workspace.types.d.ts +3 -0
- package/dist/components/typography/heading.d.ts +5 -2
- package/dist/components/typography/index.d.ts +1 -1
- package/dist/components/typography/text.styles.d.ts +10 -0
- package/dist/components/ui/popover.d.ts +1 -1
- package/dist/components/ui/sidebar.d.ts +1 -1
- package/dist/components/ui/table.d.ts +2 -1
- package/dist/container.recipes-D9t8MHR3.js +27 -0
- package/dist/container.recipes-D9t8MHR3.js.map +1 -0
- package/dist/{containers-CPNyNo1_.js → containers-DqB-bSYE.js} +34 -56
- package/dist/containers-DqB-bSYE.js.map +1 -0
- package/dist/control-group-recipes-DBXmfh2E.js +21 -0
- package/dist/control-group-recipes-DBXmfh2E.js.map +1 -0
- package/dist/{copyable-B7SBXJMr.js → copyable-BTSByfmq.js} +6 -6
- package/dist/{copyable-B7SBXJMr.js.map → copyable-BTSByfmq.js.map} +1 -1
- package/dist/{data-display-b3d1TfL4.js → data-display-Bihs9Ven.js} +542 -329
- package/dist/data-display-Bihs9Ven.js.map +1 -0
- package/dist/{date-BFNMnrS5.js → date-DOKhJPu7.js} +4 -4
- package/dist/{date-BFNMnrS5.js.map → date-DOKhJPu7.js.map} +1 -1
- package/dist/{date-picker-DI6kPNof.js → date-picker-DzP5HQq7.js} +492 -472
- package/dist/date-picker-DzP5HQq7.js.map +1 -0
- package/dist/date-pickers-BpgGz7S-.js +196 -0
- package/dist/date-pickers-BpgGz7S-.js.map +1 -0
- package/dist/{display-ByI5tkqy.js → display-CS6Hbk18.js} +8 -8
- package/dist/{display-ByI5tkqy.js.map → display-CS6Hbk18.js.map} +1 -1
- package/dist/{dropdown-menu-BlnyHr-9.js → dropdown-menu-D-boNgGO.js} +7 -7
- package/dist/{dropdown-menu-BlnyHr-9.js.map → dropdown-menu-D-boNgGO.js.map} +1 -1
- package/dist/features/activities.js +152 -141
- package/dist/features/activities.js.map +1 -1
- package/dist/features/ai-chat.js +182 -179
- package/dist/features/ai-chat.js.map +1 -1
- package/dist/features/async-preview.js +9 -9
- 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 +25 -23
- package/dist/features/data-view.js.map +1 -1
- package/dist/features/email-composer/engine.js +1 -1
- package/dist/features/email-composer.js +103 -104
- package/dist/features/email-composer.js.map +1 -1
- package/dist/features/event-calendar.js +375 -373
- package/dist/features/event-calendar.js.map +1 -1
- package/dist/features/filters.js +1 -1
- package/dist/features/global-search.js +222 -224
- package/dist/features/global-search.js.map +1 -1
- package/dist/features/kanban.js +29 -29
- package/dist/features/kanban.js.map +1 -1
- package/dist/features/map.js +59 -58
- package/dist/features/map.js.map +1 -1
- package/dist/features/media-library.js +856 -855
- 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 +1210 -1209
- package/dist/features/products.js.map +1 -1
- package/dist/features/questionnaire.js +133 -132
- package/dist/features/questionnaire.js.map +1 -1
- package/dist/features/resource-assignment.js +29 -31
- package/dist/features/resource-assignment.js.map +1 -1
- package/dist/features/resource.js +13 -13
- package/dist/features/resource.js.map +1 -1
- package/dist/features/rich-text-editor.js +2 -2
- package/dist/features/schema-form.js +82 -82
- package/dist/features/schema-form.js.map +1 -1
- package/dist/features/suggestions.js +3 -3
- package/dist/features/sync.js +4 -4
- package/dist/features/sync.js.map +1 -1
- package/dist/features/table.js +1 -1
- package/dist/features/theme-tweaker.js +456 -450
- package/dist/features/theme-tweaker.js.map +1 -1
- package/dist/feedback-CJkUAapr.js +233 -0
- package/dist/feedback-CJkUAapr.js.map +1 -0
- package/dist/field-affordance-recipes-uKY4MsZ_.js +25 -0
- package/dist/field-affordance-recipes-uKY4MsZ_.js.map +1 -0
- package/dist/{field-state-recipes-CBTRt9Bt.js → field-state-recipes-DQQpiLWC.js} +3 -3
- package/dist/field-state-recipes-DQQpiLWC.js.map +1 -0
- package/dist/{filters-qtrcv1hf.js → filters-D6FF8L6s.js} +715 -720
- package/dist/filters-D6FF8L6s.js.map +1 -0
- package/dist/{form-field-C6W-y2hR.js → form-field-CZwrkP7m.js} +17 -9
- package/dist/form-field-CZwrkP7m.js.map +1 -0
- package/dist/{form-sizing-39NohSqn.js → form-sizing-QP8aIRaW.js} +10 -6
- package/dist/form-sizing-QP8aIRaW.js.map +1 -0
- package/dist/{forms-BF-HSbff.js → forms-B5NCbkSC.js} +35 -35
- package/dist/{forms-BF-HSbff.js.map → forms-B5NCbkSC.js.map} +1 -1
- package/dist/forms-numeric-Crrm80Lm.js +867 -0
- package/dist/forms-numeric-Crrm80Lm.js.map +1 -0
- package/dist/{header-B8ex54cY.js → header-kxruN3RM.js} +53 -49
- package/dist/header-kxruN3RM.js.map +1 -0
- package/dist/{hooks-D6UBVzf2.js → hooks-BrlnCwQd.js} +2 -2
- package/dist/{hooks-D6UBVzf2.js.map → hooks-BrlnCwQd.js.map} +1 -1
- package/dist/{http-CLTVJc5I.js → http-CdEIHyQf.js} +2 -2
- package/dist/http-CdEIHyQf.js.map +1 -0
- package/dist/{icon-badge-Dv0RYQwj.js → icon-badge-Btc6pQrp.js} +4 -4
- package/dist/{icon-badge-Dv0RYQwj.js.map → icon-badge-Btc6pQrp.js.map} +1 -1
- package/dist/index.js +2 -2
- package/dist/input-SX9V0AL3.js +255 -0
- package/dist/input-SX9V0AL3.js.map +1 -0
- package/dist/input-vxcaNCYC.js +20 -0
- package/dist/input-vxcaNCYC.js.map +1 -0
- package/dist/{item-pJ0GsOiJ.js → item-DE4YnuJx.js} +18 -17
- package/dist/item-DE4YnuJx.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 +44 -4
- package/dist/lib/control-group-recipes.d.ts +22 -0
- package/dist/lib/field-affordance-recipes.d.ts +35 -2
- package/dist/lib/field-state-recipes.d.ts +2 -2
- package/dist/lib/navigation-row-recipes.d.ts +3 -2
- package/dist/lib/overlay-anatomy-recipes.d.ts +1 -1
- package/dist/lib/surface-recipes.d.ts +5 -2
- package/dist/lib/token-merge.generated.d.ts +144 -2
- package/dist/lib/ui-provider/types.d.ts +4 -2
- package/dist/lib/use-prefers-reduced-motion.d.ts +2 -0
- package/dist/lib/utils.js +1 -1
- package/dist/{media-gallery-Ca4YmvBi.js → media-gallery-DLp3HAz0.js} +75 -74
- package/dist/media-gallery-DLp3HAz0.js.map +1 -0
- package/dist/{mentions-CRio8mTm.js → mentions-Cl0Kt_Pd.js} +52 -50
- package/dist/{mentions-CRio8mTm.js.map → mentions-Cl0Kt_Pd.js.map} +1 -1
- package/dist/message-SZUNB1eX.js +127 -0
- package/dist/message-SZUNB1eX.js.map +1 -0
- package/dist/{navigation-BTrEb5u4.js → navigation-DnQSNMT0.js} +64 -55
- package/dist/navigation-DnQSNMT0.js.map +1 -0
- package/dist/{navigation-DqEITuD2.js → navigation-DyytsLRB.js} +37 -37
- package/dist/navigation-DyytsLRB.js.map +1 -0
- package/dist/{navigation-row-recipes-BFpvGPGE.js → navigation-row-recipes-DQEXQcqY.js} +3 -3
- package/dist/navigation-row-recipes-DQEXQcqY.js.map +1 -0
- package/dist/{number-BNT_BIzJ.js → number-DasMFWEG.js} +4 -4
- package/dist/{number-BNT_BIzJ.js.map → number-DasMFWEG.js.map} +1 -1
- package/dist/overlays-DUbs1KEi.js +1011 -0
- package/dist/overlays-DUbs1KEi.js.map +1 -0
- package/dist/{page-BMBGjJY8.js → page-hGmT4nWK.js} +75 -64
- package/dist/page-hGmT4nWK.js.map +1 -0
- package/dist/{page-header-BH41wCyY.js → page-header-D8nERkn5.js} +9 -9
- package/dist/page-header-D8nERkn5.js.map +1 -0
- package/dist/{pagination-C29vvt3I.js → pagination-NLGqRirf.js} +20 -20
- package/dist/pagination-NLGqRirf.js.map +1 -0
- package/dist/{popover-TInGXsjg.js → popover-CghIYdQf.js} +23 -22
- package/dist/popover-CghIYdQf.js.map +1 -0
- package/dist/{popover-menu-BzqXqE72.js → popover-menu-B4PoWhRl.js} +6 -6
- package/dist/{popover-menu-BzqXqE72.js.map → popover-menu-B4PoWhRl.js.map} +1 -1
- package/dist/{popover.recipes-zgBhMlUu.js → popover.recipes-QlD4JenO.js} +5 -5
- package/dist/popover.recipes-QlD4JenO.js.map +1 -0
- package/dist/{primitives-DKPOGVpj.js → primitives-C7ff0QaI.js} +120 -113
- package/dist/primitives-C7ff0QaI.js.map +1 -0
- package/dist/primitives.js +3 -3
- package/dist/progress-BroqrAyV.js +169 -0
- package/dist/progress-BroqrAyV.js.map +1 -0
- package/dist/{receipt-DYWTQGEc.js → receipt-BuJynLgf.js} +8 -8
- package/dist/{receipt-DYWTQGEc.js.map → receipt-BuJynLgf.js.map} +1 -1
- package/dist/{rich-text-B7sBAdDG.js → rich-text-DlxDOtf4.js} +4 -4
- package/dist/{rich-text-B7sBAdDG.js.map → rich-text-DlxDOtf4.js.map} +1 -1
- package/dist/rich-text-editor-BKyG7rWz.js +574 -0
- package/dist/rich-text-editor-BKyG7rWz.js.map +1 -0
- package/dist/{rich-text-editor.recipes-DxvOE0Lp.js → rich-text-editor.recipes-B72Nfuze.js} +35 -26
- package/dist/rich-text-editor.recipes-B72Nfuze.js.map +1 -0
- package/dist/{scroll-area-BheMQ270.js → scroll-area-D-pIhEKl.js} +3 -3
- package/dist/scroll-area-D-pIhEKl.js.map +1 -0
- package/dist/{separator-Gk_WXH-l.js → separator-BNIgG3au.js} +3 -3
- package/dist/{separator-Gk_WXH-l.js.map → separator-BNIgG3au.js.map} +1 -1
- package/dist/{separator-DO0EbCEm.js → separator-BhtFyo4x.js} +2 -2
- package/dist/{separator-DO0EbCEm.js.map → separator-BhtFyo4x.js.map} +1 -1
- package/dist/services/actions.js +1 -1
- package/dist/{settings-D9f_wdIC.js → settings-DOTOzeZ2.js} +10 -9
- package/dist/{settings-D9f_wdIC.js.map → settings-DOTOzeZ2.js.map} +1 -1
- package/dist/{sheet-vOUloJ4O.js → sheet-BFhrNehm.js} +11 -11
- package/dist/sheet-BFhrNehm.js.map +1 -0
- package/dist/{sidebar-CNBKFDRW.js → sidebar-CyR4XKwR.js} +219 -200
- package/dist/sidebar-CyR4XKwR.js.map +1 -0
- package/dist/{sidebar-C3UKkbC5.js → sidebar-SvGJ0Zwi.js} +63 -58
- package/dist/sidebar-SvGJ0Zwi.js.map +1 -0
- package/dist/{skeleton-BvRhK8y-.js → skeleton-3F0uhYn3.js} +4 -4
- package/dist/{skeleton-BvRhK8y-.js.map → skeleton-3F0uhYn3.js.map} +1 -1
- package/dist/{smart-card-B5FcKODh.js → smart-card-DjGVV2xr.js} +206 -199
- package/dist/smart-card-DjGVV2xr.js.map +1 -0
- package/dist/{spinner-JtlFJ7Nc.js → spinner-Cpf7oRkF.js} +5 -5
- package/dist/{spinner-JtlFJ7Nc.js.map → spinner-Cpf7oRkF.js.map} +1 -1
- package/dist/{structure-BvW4vG4H.js → structure-CRdqVawd.js} +14 -14
- package/dist/{structure-BvW4vG4H.js.map → structure-CRdqVawd.js.map} +1 -1
- package/dist/{structure.recipes-DjqnBpwz.js → structure.recipes-Bqhf9oIh.js} +2 -2
- package/dist/structure.recipes-Bqhf9oIh.js.map +1 -0
- package/dist/style.css +1 -1
- package/dist/{surface-recipes-CQfRr-VL.js → surface-recipes-Dd__PD-w.js} +4 -3
- package/dist/surface-recipes-Dd__PD-w.js.map +1 -0
- package/dist/{table-DnlAJ-xR.js → table-CLtJTxoR.js} +17 -16
- package/dist/table-CLtJTxoR.js.map +1 -0
- package/dist/table-CcRDZiLP.js +1444 -0
- package/dist/table-CcRDZiLP.js.map +1 -0
- package/dist/tabs-BNgu7g0u.js +188 -0
- package/dist/tabs-BNgu7g0u.js.map +1 -0
- package/dist/text-inputs-DsR56TR-.js +330 -0
- package/dist/text-inputs-DsR56TR-.js.map +1 -0
- package/dist/{text.styles-BwB7vAF2.js → text.styles-Q4sGAIgA.js} +18 -10
- package/dist/text.styles-Q4sGAIgA.js.map +1 -0
- package/dist/theme.css +77 -115
- package/dist/{timelines-CnZ2S_Gr.js → timelines-D1pkt3se.js} +84 -78
- package/dist/timelines-D1pkt3se.js.map +1 -0
- package/dist/{tree-COD9BGdU.js → tree-BtmYyMZV.js} +8 -8
- package/dist/{tree-COD9BGdU.js.map → tree-BtmYyMZV.js.map} +1 -1
- package/dist/typography/rich-text.js +1 -1
- package/dist/typography-BxQgiZyw.js +96 -0
- package/dist/typography-BxQgiZyw.js.map +1 -0
- package/dist/typography.js +1 -1
- package/dist/{ui-provider-CftIB6TY.js → ui-provider-DRPn3qNl.js} +3 -2
- package/dist/ui-provider-DRPn3qNl.js.map +1 -0
- package/dist/ui-provider.js +1 -1
- package/dist/{upload-DIzw1dx1.js → upload-CDbYw1WN.js} +326 -323
- package/dist/upload-CDbYw1WN.js.map +1 -0
- package/dist/{upload-queue-xRJ3qDmd.js → upload-queue-CNd_hH_a.js} +25 -25
- package/dist/upload-queue-CNd_hH_a.js.map +1 -0
- package/dist/usage-card-VyJLUwRr.js +457 -0
- package/dist/usage-card-VyJLUwRr.js.map +1 -0
- package/dist/utils-BvH9PSmq.js +4275 -0
- package/dist/utils-BvH9PSmq.js.map +1 -0
- package/dist/value-inputs-D0KCrfVC.js +840 -0
- package/dist/value-inputs-D0KCrfVC.js.map +1 -0
- package/dist/{workspace-Cbqz4FzN.js → workspace-CcR8r-Nt.js} +115 -122
- package/dist/workspace-CcR8r-Nt.js.map +1 -0
- package/docs/consumer-skill/SKILL.md +112 -18
- package/docs/consumer-skill/examples/analytics.tsx +34 -0
- package/docs/consumer-skill/examples/app-layout.tsx +42 -12
- package/docs/consumer-skill/examples/detail.tsx +24 -9
- package/docs/consumer-skill/examples/manifest.json +27 -1
- package/docs/consumer-skill/examples/planning-usage-edit.tsx +29 -0
- package/docs/consumer-skill/examples/scoped-directory.tsx +77 -0
- package/docs/consumer-skill/examples/website.tsx +56 -0
- package/docs/consumer-skill/references/analytics.md +70 -0
- package/docs/consumer-skill/references/composition.md +219 -2
- package/docs/consumer-skill/references/design-contract.md +37 -10
- package/docs/consumer-skill/references/discovery.md +93 -5
- package/docs/consumer-skill/references/installation.md +20 -3
- package/docs/consumer-skill/references/integration.md +26 -0
- package/docs/consumer-skill/references/public-api.json +2416 -388
- package/docs/consumer-skill/references/review.md +126 -0
- package/docs/consumer-skill/references/theming.md +52 -7
- package/docs/consumer-skill/references/tokens.json +177 -9
- package/docs/consumer-skill/references/workflows.md +129 -1
- package/docs/consumer-skill/scripts/check-composition.mjs +31 -0
- package/docs/consumer-skill/scripts/composition-policy.mjs +317 -0
- package/docs/consumer-skill/scripts/discovery.mjs +65 -8
- package/docs/consumer-skill/scripts/surface-policy.mjs +66 -0
- package/package.json +30 -6
- package/dist/accordion-BRWh3BM1.js.map +0 -1
- package/dist/action-menu-Cx3SdfbN.js.map +0 -1
- package/dist/affordance-geometry.generated-DXl-Zb3Z.js +0 -23
- package/dist/affordance-geometry.generated-DXl-Zb3Z.js.map +0 -1
- package/dist/ai-artifact-DkOArd3-.js.map +0 -1
- package/dist/app-shell-BH_bGcE2.js.map +0 -1
- package/dist/auth-BDB1V_2q.js +0 -704
- package/dist/auth-BDB1V_2q.js.map +0 -1
- package/dist/avatar-CsnWaYmt.js.map +0 -1
- package/dist/breadcrumbs-DdQ_I5ra.js.map +0 -1
- package/dist/button-BS6l5JUw.js.map +0 -1
- package/dist/buttons-Co6GavvM.js +0 -674
- package/dist/buttons-Co6GavvM.js.map +0 -1
- package/dist/chart-DVfcwQu6.js +0 -149
- package/dist/chart-DVfcwQu6.js.map +0 -1
- package/dist/choice-inputs-CavA-SGV.js +0 -644
- package/dist/choice-inputs-CavA-SGV.js.map +0 -1
- package/dist/code-block-DIlqzoiD.js.map +0 -1
- package/dist/combobox-CHD750do.js.map +0 -1
- package/dist/combobox-HDftpzxt.js.map +0 -1
- package/dist/command-D0kWBZfd.js.map +0 -1
- package/dist/comments-CvYeglMS.js +0 -1132
- package/dist/comments-CvYeglMS.js.map +0 -1
- package/dist/containers-CPNyNo1_.js.map +0 -1
- package/dist/data-display-b3d1TfL4.js.map +0 -1
- package/dist/date-picker-DI6kPNof.js.map +0 -1
- package/dist/date-pickers-ByP6Cv2z.js +0 -224
- package/dist/date-pickers-ByP6Cv2z.js.map +0 -1
- package/dist/feedback-a9j9J-9A.js +0 -391
- package/dist/feedback-a9j9J-9A.js.map +0 -1
- package/dist/field-affordance-recipes-CHdUtn2Z.js +0 -17
- package/dist/field-affordance-recipes-CHdUtn2Z.js.map +0 -1
- package/dist/field-state-recipes-CBTRt9Bt.js.map +0 -1
- package/dist/filters-qtrcv1hf.js.map +0 -1
- package/dist/form-field-C6W-y2hR.js.map +0 -1
- package/dist/form-sizing-39NohSqn.js.map +0 -1
- package/dist/forms-numeric-Y15Bg5Nr.js +0 -867
- package/dist/forms-numeric-Y15Bg5Nr.js.map +0 -1
- package/dist/header-B8ex54cY.js.map +0 -1
- package/dist/http-CLTVJc5I.js.map +0 -1
- package/dist/input-DMorJiTI.js +0 -202
- package/dist/input-DMorJiTI.js.map +0 -1
- package/dist/input-ci9fIgFH.js +0 -20
- package/dist/input-ci9fIgFH.js.map +0 -1
- package/dist/item-pJ0GsOiJ.js.map +0 -1
- package/dist/media-gallery-Ca4YmvBi.js.map +0 -1
- package/dist/message-B5-6LeYl.js +0 -108
- package/dist/message-B5-6LeYl.js.map +0 -1
- package/dist/navigation-BTrEb5u4.js.map +0 -1
- package/dist/navigation-DqEITuD2.js.map +0 -1
- package/dist/navigation-row-recipes-BFpvGPGE.js.map +0 -1
- package/dist/overlays-DBqV0J_V.js +0 -982
- package/dist/overlays-DBqV0J_V.js.map +0 -1
- package/dist/page-BMBGjJY8.js.map +0 -1
- package/dist/page-header-BH41wCyY.js.map +0 -1
- package/dist/pagination-C29vvt3I.js.map +0 -1
- package/dist/popover-TInGXsjg.js.map +0 -1
- package/dist/popover.recipes-zgBhMlUu.js.map +0 -1
- package/dist/primitives-DKPOGVpj.js.map +0 -1
- package/dist/rich-text-editor-BZSJchAF.js +0 -575
- package/dist/rich-text-editor-BZSJchAF.js.map +0 -1
- package/dist/rich-text-editor.recipes-DxvOE0Lp.js.map +0 -1
- package/dist/scroll-area-BheMQ270.js.map +0 -1
- package/dist/select-B2mb-qN2.js +0 -108
- package/dist/select-B2mb-qN2.js.map +0 -1
- package/dist/sheet-vOUloJ4O.js.map +0 -1
- package/dist/sidebar-C3UKkbC5.js.map +0 -1
- package/dist/sidebar-CNBKFDRW.js.map +0 -1
- package/dist/smart-card-B5FcKODh.js.map +0 -1
- package/dist/structure.recipes-DjqnBpwz.js.map +0 -1
- package/dist/surface-recipes-CQfRr-VL.js.map +0 -1
- package/dist/table-DnlAJ-xR.js.map +0 -1
- package/dist/table-ghtAQ-JJ.js +0 -1424
- package/dist/table-ghtAQ-JJ.js.map +0 -1
- package/dist/tabs-DY09eoZg.js +0 -187
- package/dist/tabs-DY09eoZg.js.map +0 -1
- package/dist/text-inputs-BhOcedTo.js +0 -331
- package/dist/text-inputs-BhOcedTo.js.map +0 -1
- package/dist/text.styles-BwB7vAF2.js.map +0 -1
- package/dist/timelines-CnZ2S_Gr.js.map +0 -1
- package/dist/typography-Cv8MT-82.js +0 -96
- package/dist/typography-Cv8MT-82.js.map +0 -1
- package/dist/ui-provider-CftIB6TY.js.map +0 -1
- package/dist/upload-DIzw1dx1.js.map +0 -1
- package/dist/upload-queue-xRJ3qDmd.js.map +0 -1
- package/dist/utils-C2EKeIw3.js +0 -72
- package/dist/utils-C2EKeIw3.js.map +0 -1
- package/dist/value-inputs-Co1fu-xv.js +0 -824
- package/dist/value-inputs-Co1fu-xv.js.map +0 -1
- package/dist/workspace-Cbqz4FzN.js.map +0 -1
|
@@ -1,21 +1,22 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { _ as e, c as t, s as n } from "./ui-provider-
|
|
2
|
+
import { _ as e, c as t, s as n } from "./ui-provider-DRPn3qNl.js";
|
|
3
3
|
import { useStrings as r } from "./lib/strings.js";
|
|
4
|
-
import { t as i } from "./utils-
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import { a as u, i as d } from "./primitives-
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import { a as
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
4
|
+
import { t as i } from "./utils-BvH9PSmq.js";
|
|
5
|
+
import { a } from "./typography-BxQgiZyw.js";
|
|
6
|
+
import { t as o } from "./button-BZDasD04.js";
|
|
7
|
+
import { h as s, p as c, v as l } from "./smart-card-DjGVV2xr.js";
|
|
8
|
+
import { a as u, i as d } from "./primitives-C7ff0QaI.js";
|
|
9
|
+
import { t as f } from "./field-affordance-recipes-uKY4MsZ_.js";
|
|
10
|
+
import { o as p } from "./item-DE4YnuJx.js";
|
|
11
|
+
import { t as ee } from "./use-file-drop-target-BX7GnhoQ.js";
|
|
12
|
+
import { a as te, s as ne } from "./upload-queue-CNd_hH_a.js";
|
|
13
|
+
import { a as m, c as h, i as g, n as _, o as v, r as y, t as b } from "./attachment-DbjUWsP0.js";
|
|
14
|
+
import * as x from "react";
|
|
15
|
+
import S, { forwardRef as C, useCallback as w, useEffect as T, useId as re, useLayoutEffect as ie, useMemo as E, useRef as D, useState as O } from "react";
|
|
16
|
+
import { jsx as k, jsxs as A } from "react/jsx-runtime";
|
|
17
|
+
import { Camera as j, ImageIcon as ae, Trash2 as oe, Trash2Icon as M, TriangleAlert as se, UploadIcon as N, X as ce } from "lucide-react";
|
|
17
18
|
//#region src/components/base/upload/file-upload.strings.ts
|
|
18
|
-
var
|
|
19
|
+
var P = {
|
|
19
20
|
instruction: "Drag files here or click to browse",
|
|
20
21
|
helper: "",
|
|
21
22
|
browse: "Browse files",
|
|
@@ -34,17 +35,17 @@ var I = {
|
|
|
34
35
|
};
|
|
35
36
|
//#endregion
|
|
36
37
|
//#region src/components/base/upload/file-upload.validation.ts
|
|
37
|
-
function
|
|
38
|
+
function F(e) {
|
|
38
39
|
return `${e.name}\u0000${e.size}\u0000${e.type}\u0000${e.lastModified}`;
|
|
39
40
|
}
|
|
40
|
-
function
|
|
41
|
+
function I(e, t) {
|
|
41
42
|
if (!t?.trim()) return !0;
|
|
42
43
|
let n = e.name.toLowerCase(), r = e.type.toLowerCase();
|
|
43
44
|
return t.split(",").map((e) => e.trim().toLowerCase()).filter(Boolean).some((e) => e.startsWith(".") ? n.endsWith(e) : e.endsWith("/*") ? r.startsWith(e.slice(0, -1)) : r === e);
|
|
44
45
|
}
|
|
45
|
-
function
|
|
46
|
+
function L(e, t) {
|
|
46
47
|
let { accept: n, minSizeBytes: r, maxSizeBytes: i, validateFile: a, formatSize: o, strings: s } = t;
|
|
47
|
-
if (!
|
|
48
|
+
if (!I(e, n)) return {
|
|
48
49
|
file: e,
|
|
49
50
|
code: "invalid-type",
|
|
50
51
|
message: s.invalidType(e.name, n ?? "")
|
|
@@ -73,10 +74,10 @@ function z(e, t) {
|
|
|
73
74
|
};
|
|
74
75
|
}
|
|
75
76
|
}
|
|
76
|
-
function
|
|
77
|
-
let u = o ? [...t] : [], d = new Set(u.map(
|
|
77
|
+
function R({ incoming: e, current: t, accept: n, minSizeBytes: r, maxSizeBytes: i, maxFiles: a, append: o, validateFile: s, formatSize: c, strings: l }) {
|
|
78
|
+
let u = o ? [...t] : [], d = new Set(u.map(F)), f = [], p = [];
|
|
78
79
|
for (let t of e) {
|
|
79
|
-
let e =
|
|
80
|
+
let e = L(t, {
|
|
80
81
|
accept: n,
|
|
81
82
|
minSizeBytes: r,
|
|
82
83
|
maxSizeBytes: i,
|
|
@@ -88,7 +89,7 @@ function oe({ incoming: e, current: t, accept: n, minSizeBytes: r, maxSizeBytes:
|
|
|
88
89
|
p.push(e);
|
|
89
90
|
continue;
|
|
90
91
|
}
|
|
91
|
-
let o =
|
|
92
|
+
let o = F(t);
|
|
92
93
|
if (d.has(o)) {
|
|
93
94
|
p.push({
|
|
94
95
|
file: t,
|
|
@@ -115,40 +116,40 @@ function oe({ incoming: e, current: t, accept: n, minSizeBytes: r, maxSizeBytes:
|
|
|
115
116
|
}
|
|
116
117
|
//#endregion
|
|
117
118
|
//#region src/components/base/upload/file-upload.tsx
|
|
118
|
-
function
|
|
119
|
+
function le(e) {
|
|
119
120
|
return Object.prototype.hasOwnProperty.call(e, "value");
|
|
120
121
|
}
|
|
121
|
-
function
|
|
122
|
+
function ue(e) {
|
|
122
123
|
return e === void 0 || !Number.isFinite(e) ? 2 ** 53 - 1 : Math.max(1, Math.floor(e));
|
|
123
124
|
}
|
|
124
|
-
function
|
|
125
|
+
function de(e, t) {
|
|
125
126
|
return `${e.name}-${e.size}-${e.type}-${e.lastModified}-${t}`;
|
|
126
127
|
}
|
|
127
|
-
function
|
|
128
|
+
function z(e, t, n) {
|
|
128
129
|
t.current = e, typeof n == "function" ? n(e) : n && (n.current = e);
|
|
129
130
|
}
|
|
130
|
-
function
|
|
131
|
+
function fe({ file: e, index: t, disabled: n, size: r, locale: i, strings: s, showReplace: c, onReplace: l, onRemove: u }) {
|
|
131
132
|
let f = s.replaceFileAria(e.name), p = s.removeFileAria(e.name);
|
|
132
|
-
return /* @__PURE__ */
|
|
133
|
+
return /* @__PURE__ */ A(b, {
|
|
133
134
|
variant: "outline",
|
|
134
135
|
size: r,
|
|
135
136
|
className: "file-upload--file flex-nowrap bg-card text-card-foreground",
|
|
136
137
|
children: [
|
|
137
|
-
/* @__PURE__ */
|
|
138
|
+
/* @__PURE__ */ k(v, {
|
|
138
139
|
variant: "icon",
|
|
139
140
|
className: "file-upload--file-media self-center group-has-data-[slot=item-description]/item:self-center",
|
|
140
|
-
children: /* @__PURE__ */
|
|
141
|
+
children: /* @__PURE__ */ k(m, { name: e.name })
|
|
141
142
|
}),
|
|
142
|
-
/* @__PURE__ */
|
|
143
|
+
/* @__PURE__ */ A(y, {
|
|
143
144
|
className: "file-upload--file-content min-w-0",
|
|
144
|
-
children: [/* @__PURE__ */
|
|
145
|
+
children: [/* @__PURE__ */ k(h, {
|
|
145
146
|
className: "file-upload--file-name truncate",
|
|
146
147
|
title: e.name,
|
|
147
148
|
children: e.name
|
|
148
|
-
}), /* @__PURE__ */
|
|
149
|
+
}), /* @__PURE__ */ k(g, {
|
|
149
150
|
className: "file-upload--file-size",
|
|
150
151
|
clamp: 1,
|
|
151
|
-
children: /* @__PURE__ */
|
|
152
|
+
children: /* @__PURE__ */ k(d, {
|
|
152
153
|
value: e.size,
|
|
153
154
|
locale: i,
|
|
154
155
|
size: "xs",
|
|
@@ -157,37 +158,37 @@ function B({ file: e, index: t, disabled: n, size: r, locale: i, strings: s, sho
|
|
|
157
158
|
})
|
|
158
159
|
})]
|
|
159
160
|
}),
|
|
160
|
-
/* @__PURE__ */
|
|
161
|
+
/* @__PURE__ */ A(_, {
|
|
161
162
|
className: "file-upload--actions gap-space-xs",
|
|
162
|
-
children: [c && /* @__PURE__ */
|
|
163
|
+
children: [c && /* @__PURE__ */ k(o, {
|
|
163
164
|
type: "button",
|
|
164
165
|
tone: "secondary",
|
|
165
166
|
buttonStyle: "ghost",
|
|
166
167
|
size: "sm",
|
|
167
168
|
iconOnly: !0,
|
|
168
|
-
icon:
|
|
169
|
+
icon: N,
|
|
169
170
|
"aria-label": f,
|
|
170
171
|
title: f,
|
|
171
172
|
disabled: n,
|
|
172
173
|
onClick: l,
|
|
173
|
-
children: /* @__PURE__ */
|
|
174
|
+
children: /* @__PURE__ */ k(a, {
|
|
174
175
|
tag: "span",
|
|
175
176
|
size: "inherit",
|
|
176
177
|
className: "sr-only",
|
|
177
178
|
children: s.replace
|
|
178
179
|
})
|
|
179
|
-
}), /* @__PURE__ */
|
|
180
|
+
}), /* @__PURE__ */ k(o, {
|
|
180
181
|
type: "button",
|
|
181
182
|
tone: "destructive",
|
|
182
183
|
buttonStyle: "ghost",
|
|
183
184
|
size: "sm",
|
|
184
185
|
iconOnly: !0,
|
|
185
|
-
icon:
|
|
186
|
+
icon: M,
|
|
186
187
|
"aria-label": p,
|
|
187
188
|
title: p,
|
|
188
189
|
disabled: n,
|
|
189
190
|
onClick: () => u(t),
|
|
190
|
-
children: /* @__PURE__ */
|
|
191
|
+
children: /* @__PURE__ */ k(a, {
|
|
191
192
|
tag: "span",
|
|
192
193
|
size: "inherit",
|
|
193
194
|
className: "sr-only",
|
|
@@ -198,208 +199,208 @@ function B({ file: e, index: t, disabled: n, size: r, locale: i, strings: s, sho
|
|
|
198
199
|
]
|
|
199
200
|
});
|
|
200
201
|
}
|
|
201
|
-
function
|
|
202
|
-
let { accept:
|
|
203
|
-
|
|
202
|
+
function B(d, f) {
|
|
203
|
+
let { accept: m, disabled: h = !1, invalid: g = !1, size: _, minSizeBytes: v, maxSizeBytes: y, validateFile: b, onRejectedFiles: x, className: S, strings: C, multiple: T = !1, value: j, defaultValue: ae, onValueChange: oe, selectionMode: M, maxFiles: N, "aria-describedby": ce, "aria-invalid": F, ...I } = d, L = r(P, C), { defaultScale: B } = n(), { locale: V } = t(), H = e(_, B), U = le(d), [pe, me] = O(() => d.multiple ? [...d.defaultValue ?? []] : d.defaultValue ? [d.defaultValue] : []), [W, he] = O([]), G = D(null), K = D(null), q = D(!1), J = D(!1), ge = re(), Y = E(() => U ? d.multiple ? d.value ?? [] : d.value ? [d.value] : [] : pe, [
|
|
204
|
+
U,
|
|
204
205
|
d.multiple,
|
|
205
206
|
d.value,
|
|
206
|
-
|
|
207
|
+
pe
|
|
207
208
|
]);
|
|
208
|
-
|
|
209
|
-
if (!
|
|
210
|
-
let e =
|
|
211
|
-
e && (e.focus(),
|
|
212
|
-
}, [
|
|
213
|
-
let
|
|
214
|
-
if (
|
|
209
|
+
ie(() => {
|
|
210
|
+
if (!q.current) return;
|
|
211
|
+
let e = K.current?.querySelector(".file-upload--actions button, .file-upload--dropzone input[type=file], .file-upload--dropzone button");
|
|
212
|
+
e && (e.focus(), q.current = !1);
|
|
213
|
+
}, [Y]);
|
|
214
|
+
let X = d.multiple ? d : void 0, _e = T ? ue(X?.maxFiles) : 1, ve = T && (X?.selectionMode ?? "append") === "append", ye = `${I.id ?? `file-upload-${ge}`}-errors`, be = [ce, W.length > 0 ? ye : void 0].filter(Boolean).join(" ") || void 0, Z = g || W.length > 0, Q = w((e) => {
|
|
215
|
+
if (U || me(e), d.multiple) d.onValueChange?.(e);
|
|
215
216
|
else {
|
|
216
217
|
let t = e[0];
|
|
217
218
|
d.onValueChange?.(t);
|
|
218
219
|
}
|
|
219
|
-
}, [
|
|
220
|
-
if (
|
|
221
|
-
let t =
|
|
220
|
+
}, [U, d]), xe = w((e) => u(e, { locale: V }) ?? `${e} B`, [V]), $ = w((e) => {
|
|
221
|
+
if (h || e.length === 0) return !1;
|
|
222
|
+
let t = R({
|
|
222
223
|
incoming: e,
|
|
223
|
-
current:
|
|
224
|
-
accept:
|
|
225
|
-
minSizeBytes:
|
|
226
|
-
maxSizeBytes:
|
|
227
|
-
maxFiles:
|
|
228
|
-
append:
|
|
229
|
-
validateFile:
|
|
230
|
-
formatSize:
|
|
231
|
-
strings:
|
|
224
|
+
current: Y,
|
|
225
|
+
accept: m,
|
|
226
|
+
minSizeBytes: v,
|
|
227
|
+
maxSizeBytes: y,
|
|
228
|
+
maxFiles: _e,
|
|
229
|
+
append: ve,
|
|
230
|
+
validateFile: b,
|
|
231
|
+
formatSize: xe,
|
|
232
|
+
strings: L
|
|
232
233
|
});
|
|
233
|
-
return
|
|
234
|
+
return he(t.rejections), t.rejections.length > 0 && x?.(t.rejections), t.accepted.length !== 0 && (q.current = !T && (J.current || !!K.current?.contains(document.activeElement)), J.current = !1, Q(t.nextFiles), t.rejections.length === 0);
|
|
234
235
|
}, [
|
|
235
|
-
|
|
236
|
+
m,
|
|
237
|
+
ve,
|
|
238
|
+
Q,
|
|
239
|
+
h,
|
|
240
|
+
T,
|
|
241
|
+
Y,
|
|
242
|
+
xe,
|
|
236
243
|
_e,
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
M,
|
|
240
|
-
Z,
|
|
241
|
-
be,
|
|
242
|
-
ge,
|
|
244
|
+
y,
|
|
245
|
+
v,
|
|
243
246
|
x,
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
]),
|
|
249
|
-
q.current
|
|
250
|
-
}, []), Ce = T((e) => {
|
|
251
|
-
_ || (pe([]), Se(), Y.current = !!J.current?.contains(document.activeElement), $(Z.filter((t, n) => n !== e)));
|
|
247
|
+
L,
|
|
248
|
+
b
|
|
249
|
+
]), Se = w(() => {
|
|
250
|
+
G.current && (G.current.value = "");
|
|
251
|
+
}, []), Ce = w((e) => {
|
|
252
|
+
h || (he([]), Se(), q.current = !!K.current?.contains(document.activeElement), Q(Y.filter((t, n) => n !== e)));
|
|
252
253
|
}, [
|
|
253
254
|
Se,
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
]), we =
|
|
258
|
-
|
|
259
|
-
}, [
|
|
260
|
-
disabled:
|
|
261
|
-
onFiles:
|
|
255
|
+
Q,
|
|
256
|
+
h,
|
|
257
|
+
Y
|
|
258
|
+
]), we = w(() => {
|
|
259
|
+
h || (J.current = !!K.current?.contains(document.activeElement), G.current?.click());
|
|
260
|
+
}, [h]), { isDragging: Te, dropTargetProps: Ee } = ee({
|
|
261
|
+
disabled: h,
|
|
262
|
+
onFiles: $
|
|
262
263
|
}), De = {
|
|
263
|
-
...
|
|
264
|
-
accept:
|
|
265
|
-
multiple:
|
|
266
|
-
disabled:
|
|
267
|
-
"aria-describedby":
|
|
268
|
-
"aria-invalid":
|
|
269
|
-
}, Oe = /* @__PURE__ */
|
|
270
|
-
ref: (e) =>
|
|
271
|
-
onDrop:
|
|
272
|
-
accept:
|
|
273
|
-
multiple:
|
|
274
|
-
disabled:
|
|
275
|
-
invalid:
|
|
276
|
-
size:
|
|
264
|
+
...I,
|
|
265
|
+
accept: m,
|
|
266
|
+
multiple: T,
|
|
267
|
+
disabled: h,
|
|
268
|
+
"aria-describedby": be,
|
|
269
|
+
"aria-invalid": Z ? !0 : F
|
|
270
|
+
}, Oe = /* @__PURE__ */ k(te, {
|
|
271
|
+
ref: (e) => z(e, G, f),
|
|
272
|
+
onDrop: $,
|
|
273
|
+
accept: m,
|
|
274
|
+
multiple: T,
|
|
275
|
+
disabled: h,
|
|
276
|
+
invalid: Z,
|
|
277
|
+
size: H,
|
|
277
278
|
className: "file-upload--dropzone",
|
|
278
279
|
inputProps: De,
|
|
279
280
|
strings: {
|
|
280
|
-
instruction:
|
|
281
|
-
helper:
|
|
282
|
-
dragOver:
|
|
281
|
+
instruction: L.instruction,
|
|
282
|
+
helper: L.helper,
|
|
283
|
+
dragOver: L.dragOver
|
|
283
284
|
},
|
|
284
|
-
children: /* @__PURE__ */
|
|
285
|
+
children: /* @__PURE__ */ k(o, {
|
|
285
286
|
type: "button",
|
|
286
287
|
tone: "secondary",
|
|
287
288
|
buttonStyle: "outline",
|
|
288
|
-
size:
|
|
289
|
-
disabled:
|
|
289
|
+
size: H,
|
|
290
|
+
disabled: h,
|
|
290
291
|
onClick: we,
|
|
291
|
-
children:
|
|
292
|
+
children: L.browse
|
|
292
293
|
})
|
|
293
294
|
});
|
|
294
|
-
return /* @__PURE__ */
|
|
295
|
-
ref:
|
|
296
|
-
"data-disabled":
|
|
297
|
-
"data-invalid":
|
|
298
|
-
className: i("file-upload--component grid gap-space-md",
|
|
295
|
+
return /* @__PURE__ */ A("div", {
|
|
296
|
+
ref: K,
|
|
297
|
+
"data-disabled": h || void 0,
|
|
298
|
+
"data-invalid": Z || void 0,
|
|
299
|
+
className: i("file-upload--component grid gap-space-md", S),
|
|
299
300
|
children: [
|
|
300
|
-
(
|
|
301
|
-
!
|
|
301
|
+
(T || Y.length === 0) && Oe,
|
|
302
|
+
!T && Y[0] && /* @__PURE__ */ A("div", {
|
|
302
303
|
...Ee,
|
|
303
304
|
"data-dragging": Te || void 0,
|
|
304
|
-
"data-invalid":
|
|
305
|
-
className: i("file-upload--selected rounded-radius transition-shadow",
|
|
306
|
-
children: [/* @__PURE__ */
|
|
305
|
+
"data-invalid": Z || void 0,
|
|
306
|
+
className: i("file-upload--selected rounded-radius transition-shadow", Z && "[&_.file-upload--file]:border-destructive", !h && Te && (Z ? "ring-2 ring-destructive/50 ring-offset-2" : "ring-2 ring-primary/50 ring-offset-2")),
|
|
307
|
+
children: [/* @__PURE__ */ k(ne, {
|
|
307
308
|
...De,
|
|
308
|
-
ref: (e) =>
|
|
309
|
+
ref: (e) => z(e, G, f),
|
|
309
310
|
tabIndex: -1,
|
|
310
311
|
className: "file-upload--input",
|
|
311
|
-
onFiles:
|
|
312
|
-
}), /* @__PURE__ */
|
|
313
|
-
file:
|
|
312
|
+
onFiles: $
|
|
313
|
+
}), /* @__PURE__ */ k(fe, {
|
|
314
|
+
file: Y[0],
|
|
314
315
|
index: 0,
|
|
315
|
-
disabled:
|
|
316
|
-
size:
|
|
317
|
-
locale:
|
|
318
|
-
strings:
|
|
316
|
+
disabled: h,
|
|
317
|
+
size: H,
|
|
318
|
+
locale: V,
|
|
319
|
+
strings: L,
|
|
319
320
|
showReplace: !0,
|
|
320
321
|
onReplace: we,
|
|
321
322
|
onRemove: Ce
|
|
322
323
|
})]
|
|
323
324
|
}),
|
|
324
|
-
|
|
325
|
+
T && Y.length > 0 && /* @__PURE__ */ k(p, {
|
|
325
326
|
className: "file-upload--files",
|
|
326
|
-
children:
|
|
327
|
+
children: Y.map((e, t) => /* @__PURE__ */ k(fe, {
|
|
327
328
|
file: e,
|
|
328
329
|
index: t,
|
|
329
|
-
disabled:
|
|
330
|
-
size:
|
|
331
|
-
locale:
|
|
332
|
-
strings:
|
|
330
|
+
disabled: h,
|
|
331
|
+
size: H,
|
|
332
|
+
locale: V,
|
|
333
|
+
strings: L,
|
|
333
334
|
showReplace: !1,
|
|
334
335
|
onReplace: we,
|
|
335
336
|
onRemove: Ce
|
|
336
|
-
},
|
|
337
|
+
}, de(e, t)))
|
|
337
338
|
}),
|
|
338
|
-
|
|
339
|
-
id:
|
|
339
|
+
W.length > 0 && /* @__PURE__ */ A(c, {
|
|
340
|
+
id: ye,
|
|
340
341
|
tone: "destructive",
|
|
341
342
|
"aria-live": "polite",
|
|
342
|
-
className: i("file-upload--errors",
|
|
343
|
+
className: i("file-upload--errors", H === "sm" && "p-surface-xs"),
|
|
343
344
|
children: [
|
|
344
|
-
/* @__PURE__ */
|
|
345
|
-
/* @__PURE__ */
|
|
346
|
-
/* @__PURE__ */
|
|
347
|
-
className: "grid gap-space-2xs",
|
|
348
|
-
children:
|
|
345
|
+
/* @__PURE__ */ k(se, { "aria-hidden": "true" }),
|
|
346
|
+
/* @__PURE__ */ k(l, { children: L.errorsHeading }),
|
|
347
|
+
/* @__PURE__ */ k(s, { children: /* @__PURE__ */ k("ul", {
|
|
348
|
+
className: "m-0 p-0 list-none grid gap-space-2xs",
|
|
349
|
+
children: W.map((e, t) => /* @__PURE__ */ k("li", {
|
|
349
350
|
className: "file-upload--error",
|
|
350
|
-
children: /* @__PURE__ */
|
|
351
|
+
children: /* @__PURE__ */ k(a, {
|
|
351
352
|
tag: "span",
|
|
352
353
|
size: "xs",
|
|
353
354
|
type: "error",
|
|
354
355
|
children: e.message
|
|
355
356
|
})
|
|
356
|
-
}, `${e.code}-${
|
|
357
|
+
}, `${e.code}-${de(e.file, t)}`))
|
|
357
358
|
}) })
|
|
358
359
|
]
|
|
359
360
|
})
|
|
360
361
|
]
|
|
361
362
|
});
|
|
362
363
|
}
|
|
363
|
-
var
|
|
364
|
-
|
|
364
|
+
var V = C(B);
|
|
365
|
+
V.displayName = "FileUpload";
|
|
365
366
|
//#endregion
|
|
366
367
|
//#region src/hooks/use-files.ts
|
|
367
|
-
var
|
|
368
|
+
var H = [
|
|
368
369
|
"B",
|
|
369
370
|
"KB",
|
|
370
371
|
"MB",
|
|
371
372
|
"GB",
|
|
372
373
|
"TB"
|
|
373
374
|
];
|
|
374
|
-
function
|
|
375
|
+
function U(e) {
|
|
375
376
|
if (!Number.isFinite(e) || e <= 0) return "0 B";
|
|
376
|
-
let t = Math.min(Math.floor(Math.log(e) / Math.log(1024)),
|
|
377
|
-
return `${t === 0 ? n.toFixed(0) : Number(n.toFixed(1)).toString()} ${
|
|
377
|
+
let t = Math.min(Math.floor(Math.log(e) / Math.log(1024)), H.length - 1), n = e / 1024 ** t;
|
|
378
|
+
return `${t === 0 ? n.toFixed(0) : Number(n.toFixed(1)).toString()} ${H[t]}`;
|
|
378
379
|
}
|
|
379
|
-
var
|
|
380
|
-
function
|
|
381
|
-
return `${Date.now().toString(36)}-${(
|
|
380
|
+
var pe = 0;
|
|
381
|
+
function me() {
|
|
382
|
+
return `${Date.now().toString(36)}-${(pe++).toString(36)}`;
|
|
382
383
|
}
|
|
383
|
-
function
|
|
384
|
+
function W(e) {
|
|
384
385
|
return e.name.split(".").pop()?.toLowerCase() ?? "";
|
|
385
386
|
}
|
|
386
|
-
function
|
|
387
|
+
function he(e) {
|
|
387
388
|
return `${e.name}\u0000${e.size}\u0000${e.type}\u0000${e.lastModified}`;
|
|
388
389
|
}
|
|
389
|
-
function
|
|
390
|
+
function G(e) {
|
|
390
391
|
return {
|
|
391
|
-
id:
|
|
392
|
+
id: me(),
|
|
392
393
|
file: e,
|
|
393
394
|
name: e.name,
|
|
394
395
|
size: e.size,
|
|
395
|
-
formattedSize:
|
|
396
|
+
formattedSize: U(e.size),
|
|
396
397
|
type: e.type,
|
|
397
|
-
extension:
|
|
398
|
+
extension: W(e),
|
|
398
399
|
lastModified: e.lastModified
|
|
399
400
|
};
|
|
400
401
|
}
|
|
401
|
-
function
|
|
402
|
-
let n =
|
|
402
|
+
function K(e, t) {
|
|
403
|
+
let n = W(e);
|
|
403
404
|
if (t?.minSize !== void 0 && e.size < t.minSize) return {
|
|
404
405
|
file: e,
|
|
405
406
|
code: "too-small",
|
|
@@ -429,14 +430,14 @@ function q(e, t) {
|
|
|
429
430
|
};
|
|
430
431
|
}
|
|
431
432
|
}
|
|
432
|
-
function
|
|
433
|
+
function q(e) {
|
|
433
434
|
return Object.fromEntries(e.map((e) => [e.file.name, e]));
|
|
434
435
|
}
|
|
435
|
-
function
|
|
436
|
-
let [t, n] =
|
|
437
|
-
let o = Array.isArray(t) ? t : Array.from(t), s = r.current, c = i ? [] : [...s], l = new Set(c.map((e) =>
|
|
436
|
+
function J(e) {
|
|
437
|
+
let [t, n] = O([]), r = D([]), [i, a] = O([]), o = w(U, []), s = w((t, i) => {
|
|
438
|
+
let o = Array.isArray(t) ? t : Array.from(t), s = r.current, c = i ? [] : [...s], l = new Set(c.map((e) => he(e.file))), u = [], d = [];
|
|
438
439
|
for (let t of o) {
|
|
439
|
-
let n =
|
|
440
|
+
let n = he(t);
|
|
440
441
|
if (l.has(n)) {
|
|
441
442
|
d.push({
|
|
442
443
|
file: t,
|
|
@@ -445,7 +446,7 @@ function Y(e) {
|
|
|
445
446
|
});
|
|
446
447
|
continue;
|
|
447
448
|
}
|
|
448
|
-
let r =
|
|
449
|
+
let r = K(t, e);
|
|
449
450
|
if (r) {
|
|
450
451
|
d.push(r);
|
|
451
452
|
continue;
|
|
@@ -458,7 +459,7 @@ function Y(e) {
|
|
|
458
459
|
});
|
|
459
460
|
continue;
|
|
460
461
|
}
|
|
461
|
-
let i =
|
|
462
|
+
let i = G(t);
|
|
462
463
|
u.push(i), c.push(i), l.add(n);
|
|
463
464
|
}
|
|
464
465
|
return i && u.length === 0 && d.length > 0 && (c = s), r.current = c, n(c), a(d), {
|
|
@@ -469,28 +470,28 @@ function Y(e) {
|
|
|
469
470
|
}, [e]);
|
|
470
471
|
return {
|
|
471
472
|
files: t,
|
|
472
|
-
addFiles:
|
|
473
|
-
setFiles:
|
|
474
|
-
remove:
|
|
473
|
+
addFiles: w((e) => s(e, !1), [s]),
|
|
474
|
+
setFiles: w((e) => s(e, !0), [s]),
|
|
475
|
+
remove: w((e) => {
|
|
475
476
|
let t = r.current.filter((t) => t.id !== e);
|
|
476
477
|
r.current = t, n(t);
|
|
477
478
|
}, []),
|
|
478
|
-
removeAll:
|
|
479
|
+
removeAll: w(() => {
|
|
479
480
|
r.current = [], n([]), a([]);
|
|
480
481
|
}, []),
|
|
481
482
|
formatSize: o,
|
|
482
|
-
validationErrors:
|
|
483
|
+
validationErrors: q(i),
|
|
483
484
|
rejections: i
|
|
484
485
|
};
|
|
485
486
|
}
|
|
486
487
|
//#endregion
|
|
487
488
|
//#region src/components/base/upload/image-upload.tsx
|
|
488
|
-
var
|
|
489
|
+
var ge = 2, Y = {
|
|
489
490
|
square: "aspect-square",
|
|
490
491
|
standard: "aspect-[4/3]",
|
|
491
492
|
widescreen: "aspect-[16/9]",
|
|
492
493
|
portrait: "aspect-[9/16]"
|
|
493
|
-
},
|
|
494
|
+
}, X = {
|
|
494
495
|
select: "Select image",
|
|
495
496
|
change: "Change image",
|
|
496
497
|
remove: "Remove",
|
|
@@ -506,7 +507,7 @@ var X = 2, me = {
|
|
|
506
507
|
customValidationFailed: (e) => `${e} did not pass validation.`,
|
|
507
508
|
moreFiles: (e) => `+ ${e} more file${e === 1 ? "" : "s"}`
|
|
508
509
|
};
|
|
509
|
-
function
|
|
510
|
+
function _e(e, t, n) {
|
|
510
511
|
let { file: r, code: i, details: a } = e;
|
|
511
512
|
switch (i) {
|
|
512
513
|
case "invalid-type": return t.invalidType(r.name, a.extension ?? "");
|
|
@@ -517,8 +518,8 @@ function he(e, t, n) {
|
|
|
517
518
|
case "custom": return a.customMessage ?? t.customValidationFailed(r.name);
|
|
518
519
|
}
|
|
519
520
|
}
|
|
520
|
-
function
|
|
521
|
-
let
|
|
521
|
+
function ve({ accept: e = ".png,.jpg,.jpeg,.gif,.svg", multiple: t = !1, value: n, onValueChange: s, disabled: c, initialPreviewUrl: l, aspectRatio: u = "square", fit: d = "cover", maxWidth: f, layout: p = "stacked", invalid: te, strings: ne }, m) {
|
|
522
|
+
let h = r(X, ne), g = re(), _ = D(null), v = E(() => {
|
|
522
523
|
if (!e) return [
|
|
523
524
|
"png",
|
|
524
525
|
"jpg",
|
|
@@ -536,167 +537,167 @@ function ge({ accept: e = ".png,.jpg,.jpeg,.gif,.svg", multiple: t = !1, value:
|
|
|
536
537
|
return e.toLowerCase();
|
|
537
538
|
}).filter((e) => !!e);
|
|
538
539
|
if (t.length !== 0) return Array.from(new Set(t));
|
|
539
|
-
}, [e]), { files:
|
|
540
|
+
}, [e]), { files: y, setFiles: b, remove: x, removeAll: S, formatSize: C, rejections: ie } = J(E(() => ({
|
|
540
541
|
maxFiles: t ? void 0 : 1,
|
|
541
|
-
maxSize:
|
|
542
|
-
allowedExtensions:
|
|
543
|
-
}), [t,
|
|
544
|
-
|
|
545
|
-
n ?
|
|
542
|
+
maxSize: ge * 1024 * 1024,
|
|
543
|
+
allowedExtensions: v
|
|
544
|
+
}), [t, v]));
|
|
545
|
+
T(() => {
|
|
546
|
+
n ? b([n]) : (S(), _.current && (_.current.value = ""));
|
|
546
547
|
}, [
|
|
547
548
|
n,
|
|
548
|
-
|
|
549
|
-
|
|
549
|
+
b,
|
|
550
|
+
S
|
|
550
551
|
]);
|
|
551
|
-
let
|
|
552
|
-
|
|
553
|
-
let e =
|
|
552
|
+
let j = y[0], M = j ? h.change : h.select, [se, N] = O(void 0), ce = E(() => !v || v.length === 0 ? null : v.map((e) => e.toUpperCase()).join(", "), [v]);
|
|
553
|
+
T(() => {
|
|
554
|
+
let e = j?.file ?? n;
|
|
554
555
|
if (!e) {
|
|
555
|
-
|
|
556
|
+
N(void 0);
|
|
556
557
|
return;
|
|
557
558
|
}
|
|
558
559
|
let t = URL.createObjectURL(e);
|
|
559
|
-
return
|
|
560
|
-
}, [
|
|
561
|
-
let
|
|
562
|
-
maxWidth: f ?
|
|
560
|
+
return N(t), () => URL.revokeObjectURL(t);
|
|
561
|
+
}, [j, n]);
|
|
562
|
+
let P = se ?? l, F = !!P, I = j?.name ?? h.previewAlt ?? X.previewAlt, L = Y[u] ?? Y.square, R = d === "contain" ? "object-contain p-space-sm" : "object-cover", le = f ? typeof f == "number" ? `${f}px` : f : "240px", ue = p === "inline" ? void 0 : { maxWidth: le }, de = p === "inline" ? {
|
|
563
|
+
maxWidth: f ? le : "185px",
|
|
563
564
|
width: "100%"
|
|
564
|
-
} : void 0,
|
|
565
|
+
} : void 0, z = w((e) => {
|
|
565
566
|
if (c || e.length === 0) return;
|
|
566
|
-
let t =
|
|
567
|
+
let t = b(e).accepted[0]?.file;
|
|
567
568
|
t && s?.(t);
|
|
568
569
|
}, [
|
|
569
570
|
c,
|
|
570
|
-
|
|
571
|
+
b,
|
|
571
572
|
s
|
|
572
|
-
]),
|
|
573
|
-
|
|
574
|
-
}, [
|
|
573
|
+
]), fe = w((e) => {
|
|
574
|
+
z(Array.from(e.target.files ?? []));
|
|
575
|
+
}, [z]), { isDragging: B, dropTargetProps: V } = ee({
|
|
575
576
|
disabled: c,
|
|
576
|
-
onFiles:
|
|
577
|
-
}),
|
|
578
|
-
c ||
|
|
579
|
-
}, [c]),
|
|
580
|
-
|
|
577
|
+
onFiles: z
|
|
578
|
+
}), H = w(() => {
|
|
579
|
+
c || _.current?.click();
|
|
580
|
+
}, [c]), U = w(() => {
|
|
581
|
+
j && x(j.id), s?.(void 0), _.current && (_.current.value = "");
|
|
581
582
|
}, [
|
|
582
|
-
|
|
583
|
-
|
|
583
|
+
j,
|
|
584
|
+
x,
|
|
584
585
|
s
|
|
585
586
|
]);
|
|
586
|
-
return /* @__PURE__ */
|
|
587
|
+
return /* @__PURE__ */ A("div", {
|
|
587
588
|
className: i("image-upload--component", "grid gap-space-md"),
|
|
588
|
-
style:
|
|
589
|
+
style: ue,
|
|
589
590
|
children: [
|
|
590
|
-
/* @__PURE__ */
|
|
591
|
+
/* @__PURE__ */ k("input", {
|
|
591
592
|
ref: (e) => {
|
|
592
|
-
|
|
593
|
+
_.current = e, typeof m == "function" ? m(e) : m && (m.current = e);
|
|
593
594
|
},
|
|
594
|
-
id:
|
|
595
|
+
id: g,
|
|
595
596
|
type: "file",
|
|
596
597
|
className: "sr-only",
|
|
597
|
-
"aria-label":
|
|
598
|
+
"aria-label": M,
|
|
598
599
|
accept: e,
|
|
599
600
|
multiple: t,
|
|
600
601
|
disabled: c,
|
|
601
|
-
onChange:
|
|
602
|
+
onChange: fe
|
|
602
603
|
}),
|
|
603
|
-
/* @__PURE__ */
|
|
604
|
-
className: i(
|
|
605
|
-
children: [/* @__PURE__ */
|
|
606
|
-
...
|
|
607
|
-
"data-dragging":
|
|
608
|
-
className: i("relative overflow-hidden rounded-radius
|
|
609
|
-
style:
|
|
610
|
-
children:
|
|
611
|
-
src:
|
|
612
|
-
alt:
|
|
613
|
-
className: i("absolute inset-0 h-full w-full",
|
|
614
|
-
}) : /* @__PURE__ */
|
|
604
|
+
/* @__PURE__ */ A("div", {
|
|
605
|
+
className: i(p === "inline" ? "flex flex-wrap items-start gap-space-xl" : "grid gap-space-md"),
|
|
606
|
+
children: [/* @__PURE__ */ k("div", {
|
|
607
|
+
...V,
|
|
608
|
+
"data-dragging": B || void 0,
|
|
609
|
+
className: i("relative overflow-hidden rounded-radius border transition-colors", p === "inline" ? "flex-shrink-0 w-full" : "w-full", L, !c && B && "ring-2 ring-ring", F ? "border-border bg-muted/20" : i("border-dashed bg-background text-muted-foreground ", te ? "border-destructive" : "border-border")),
|
|
610
|
+
style: de,
|
|
611
|
+
children: F && P ? /* @__PURE__ */ k("img", {
|
|
612
|
+
src: P,
|
|
613
|
+
alt: I,
|
|
614
|
+
className: i("absolute inset-0 box-border h-full w-full", R)
|
|
615
|
+
}) : /* @__PURE__ */ k("div", {
|
|
615
616
|
className: "absolute inset-0 flex items-center justify-center",
|
|
616
|
-
children: /* @__PURE__ */
|
|
617
|
+
children: /* @__PURE__ */ k(ae, {
|
|
617
618
|
"aria-hidden": !0,
|
|
618
619
|
className: "size-icon-lg"
|
|
619
620
|
})
|
|
620
621
|
})
|
|
621
|
-
}), /* @__PURE__ */
|
|
622
|
-
className: i("grid gap-space-sm",
|
|
622
|
+
}), /* @__PURE__ */ A("div", {
|
|
623
|
+
className: i("grid gap-space-sm", p === "inline" && "flex-1 min-w-0 basis-40"),
|
|
623
624
|
children: [
|
|
624
|
-
/* @__PURE__ */
|
|
625
|
+
/* @__PURE__ */ A("div", {
|
|
625
626
|
className: "flex flex-wrap items-center gap-space-md",
|
|
626
|
-
children: [/* @__PURE__ */
|
|
627
|
+
children: [/* @__PURE__ */ k(o, {
|
|
627
628
|
type: "button",
|
|
628
629
|
tone: "secondary",
|
|
629
630
|
buttonStyle: "outline",
|
|
630
|
-
onClick:
|
|
631
|
+
onClick: H,
|
|
631
632
|
disabled: c,
|
|
632
|
-
children:
|
|
633
|
-
}), !
|
|
633
|
+
children: M
|
|
634
|
+
}), !j && !!F && /* @__PURE__ */ k(a, {
|
|
634
635
|
size: "xs",
|
|
635
636
|
type: "secondary",
|
|
636
|
-
children:
|
|
637
|
+
children: h.keepCurrent
|
|
637
638
|
})]
|
|
638
639
|
}),
|
|
639
|
-
!!
|
|
640
|
+
!!ce && /* @__PURE__ */ k(a, {
|
|
640
641
|
size: "xs",
|
|
641
642
|
type: "secondary",
|
|
642
|
-
children:
|
|
643
|
+
children: h.supportsTemplate.replace("{ext}", ce).replace("{size}", String(ge))
|
|
643
644
|
}),
|
|
644
|
-
!!
|
|
645
|
+
!!j && /* @__PURE__ */ A("div", {
|
|
645
646
|
className: "grid gap-space-2xs",
|
|
646
647
|
children: [
|
|
647
|
-
/* @__PURE__ */
|
|
648
|
+
/* @__PURE__ */ k(a, {
|
|
648
649
|
weight: "medium",
|
|
649
|
-
title:
|
|
650
|
+
title: j.name,
|
|
650
651
|
className: "truncate",
|
|
651
|
-
children:
|
|
652
|
+
children: j.name
|
|
652
653
|
}),
|
|
653
|
-
/* @__PURE__ */
|
|
654
|
+
/* @__PURE__ */ k(a, {
|
|
654
655
|
size: "xs",
|
|
655
656
|
type: "secondary",
|
|
656
|
-
children:
|
|
657
|
+
children: j.formattedSize
|
|
657
658
|
}),
|
|
658
|
-
!!t &&
|
|
659
|
+
!!t && y.length > 1 && /* @__PURE__ */ k(a, {
|
|
659
660
|
size: "xs",
|
|
660
661
|
type: "secondary",
|
|
661
|
-
children:
|
|
662
|
+
children: h.moreFiles(y.length - 1)
|
|
662
663
|
}),
|
|
663
|
-
/* @__PURE__ */
|
|
664
|
+
/* @__PURE__ */ k(o, {
|
|
664
665
|
type: "button",
|
|
665
666
|
tone: "destructive",
|
|
666
667
|
buttonStyle: "ghost",
|
|
667
668
|
size: "sm",
|
|
668
|
-
icon:
|
|
669
|
-
onClick:
|
|
670
|
-
children:
|
|
669
|
+
icon: oe,
|
|
670
|
+
onClick: U,
|
|
671
|
+
children: h.remove
|
|
671
672
|
})
|
|
672
673
|
]
|
|
673
674
|
}),
|
|
674
|
-
!
|
|
675
|
+
!j && !F && /* @__PURE__ */ k(a, {
|
|
675
676
|
size: "xs",
|
|
676
677
|
type: "secondary",
|
|
677
|
-
children:
|
|
678
|
+
children: h.noSelection
|
|
678
679
|
})
|
|
679
680
|
]
|
|
680
681
|
})]
|
|
681
682
|
}),
|
|
682
|
-
|
|
683
|
+
ie.length > 0 && /* @__PURE__ */ k("div", {
|
|
683
684
|
className: "image-upload--errors grid gap-space-2xs",
|
|
684
685
|
role: "alert",
|
|
685
686
|
"aria-live": "polite",
|
|
686
|
-
children:
|
|
687
|
+
children: ie.map((e, t) => /* @__PURE__ */ k(a, {
|
|
687
688
|
size: "xs",
|
|
688
689
|
type: "error",
|
|
689
|
-
children:
|
|
690
|
+
children: _e(e, h, C)
|
|
690
691
|
}, `${e.file.name}-${e.code}-${t}`))
|
|
691
692
|
})
|
|
692
693
|
]
|
|
693
694
|
});
|
|
694
695
|
}
|
|
695
|
-
var
|
|
696
|
-
|
|
696
|
+
var ye = S.forwardRef(ve);
|
|
697
|
+
ye.displayName = "ImageUpload";
|
|
697
698
|
//#endregion
|
|
698
699
|
//#region src/components/base/upload/avatar-upload.tsx
|
|
699
|
-
var
|
|
700
|
+
var be = {
|
|
700
701
|
change: "Change photo",
|
|
701
702
|
remove: "Remove photo",
|
|
702
703
|
hint: "Click or drop an image",
|
|
@@ -708,7 +709,7 @@ var ve = {
|
|
|
708
709
|
duplicate: (e) => `${e} is already selected.`,
|
|
709
710
|
customValidationFailed: (e) => `${e} did not pass validation.`
|
|
710
711
|
};
|
|
711
|
-
function
|
|
712
|
+
function Z(e, t, n) {
|
|
712
713
|
let { file: r, code: i, details: a } = e;
|
|
713
714
|
switch (i) {
|
|
714
715
|
case "invalid-type": return t.invalidType(r.name, a.extension ?? "");
|
|
@@ -736,114 +737,116 @@ var Q = {
|
|
|
736
737
|
remove: "size-action-lg"
|
|
737
738
|
}
|
|
738
739
|
};
|
|
739
|
-
function
|
|
740
|
-
let { defaultScale:
|
|
740
|
+
function xe({ value: t, onValueChange: o, initialPreviewUrl: s, accept: c = ".png,.jpg,.jpeg,.gif,.webp", disabled: l = !1, invalid: u = !1, size: d, className: p, strings: te, initials: ne }, m) {
|
|
741
|
+
let { defaultScale: h } = n(), g = e(d, h), _ = r(be, te), v = re(), y = D(null), b = Q[g], { files: x, setFiles: S, removeAll: C, formatSize: ie, rejections: ae } = J({
|
|
741
742
|
maxFiles: 1,
|
|
742
|
-
allowedExtensions:
|
|
743
|
+
allowedExtensions: E(() => c.split(",").map((e) => e.trim().replace(/^\./, "").toLowerCase()).filter(Boolean), [c])
|
|
743
744
|
});
|
|
744
|
-
|
|
745
|
-
t ?
|
|
745
|
+
T(() => {
|
|
746
|
+
t ? S([t]) : C();
|
|
746
747
|
}, [t]);
|
|
747
|
-
let
|
|
748
|
-
|
|
749
|
-
let e =
|
|
748
|
+
let oe = x[0], [M, se] = O(void 0);
|
|
749
|
+
T(() => {
|
|
750
|
+
let e = oe?.file ?? t;
|
|
750
751
|
if (!e) {
|
|
751
|
-
|
|
752
|
+
se(void 0);
|
|
752
753
|
return;
|
|
753
754
|
}
|
|
754
755
|
let n = URL.createObjectURL(e);
|
|
755
|
-
return
|
|
756
|
-
}, [
|
|
757
|
-
let
|
|
756
|
+
return se(n), () => URL.revokeObjectURL(n);
|
|
757
|
+
}, [oe, t]);
|
|
758
|
+
let N = M ?? s, P = !!N, F = w((e) => {
|
|
758
759
|
let t = e.target.files;
|
|
759
760
|
if (!t || t.length === 0) return;
|
|
760
|
-
let n =
|
|
761
|
-
n &&
|
|
762
|
-
}, [
|
|
763
|
-
|
|
764
|
-
}, [
|
|
765
|
-
let t =
|
|
766
|
-
t &&
|
|
767
|
-
}, [
|
|
761
|
+
let n = S(t).accepted[0]?.file;
|
|
762
|
+
n && o?.(n), y.current && (y.current.value = "");
|
|
763
|
+
}, [o, S]), I = w(() => {
|
|
764
|
+
C(), o?.(void 0), y.current && (y.current.value = "");
|
|
765
|
+
}, [o, C]), L = w((e) => {
|
|
766
|
+
let t = S(e).accepted[0]?.file;
|
|
767
|
+
t && o?.(t);
|
|
768
|
+
}, [o, S]), { isDragging: R, dropTargetProps: le } = ee({
|
|
768
769
|
disabled: l,
|
|
769
|
-
onFiles:
|
|
770
|
+
onFiles: L
|
|
770
771
|
});
|
|
771
|
-
return /* @__PURE__ */
|
|
772
|
-
className: i("avatar-upload--component", "inline-flex flex-col items-center gap-space-md",
|
|
772
|
+
return /* @__PURE__ */ A("div", {
|
|
773
|
+
className: i("avatar-upload--component", "inline-flex flex-col items-center gap-space-md", p),
|
|
773
774
|
children: [
|
|
774
|
-
/* @__PURE__ */
|
|
775
|
-
...
|
|
776
|
-
className: i("group relative flex shrink-0 items-center justify-center
|
|
775
|
+
/* @__PURE__ */ A("div", {
|
|
776
|
+
...le,
|
|
777
|
+
className: i("group relative flex shrink-0 items-center justify-center rounded-full", "border border-dashed transition-colors duration-150 outline-none", "focus-within:ring-2 focus-within:ring-ring", P ? "border-border/60 bg-muted/20" : i("bg-muted/30 hover:border-primary hover:bg-primary/5", u ? "border-destructive" : "border-muted-foreground/40"), l && "cursor-not-allowed opacity-50", !l && R && "border-primary bg-primary/10", b.box),
|
|
777
778
|
children: [
|
|
778
|
-
/* @__PURE__ */
|
|
779
|
-
id:
|
|
779
|
+
/* @__PURE__ */ k("input", {
|
|
780
|
+
id: v,
|
|
780
781
|
ref: (e) => {
|
|
781
|
-
|
|
782
|
+
y.current = e, typeof m == "function" ? m(e) : m && (m.current = e);
|
|
782
783
|
},
|
|
783
784
|
type: "file",
|
|
784
785
|
className: "absolute inset-0 z-10 size-full cursor-pointer opacity-0 disabled:cursor-not-allowed",
|
|
785
|
-
"aria-label":
|
|
786
|
+
"aria-label": _.change,
|
|
786
787
|
"aria-invalid": u || void 0,
|
|
787
788
|
accept: c,
|
|
788
789
|
disabled: l,
|
|
789
|
-
onChange:
|
|
790
|
-
}),
|
|
791
|
-
I && F ? /* @__PURE__ */ A("img", {
|
|
792
|
-
src: F,
|
|
793
|
-
alt: v.change,
|
|
794
|
-
className: "absolute inset-0 size-full object-cover"
|
|
795
|
-
}) : ee ? /* @__PURE__ */ A(o, {
|
|
796
|
-
size: _ === "sm" ? "sm" : _ === "lg" ? "lg" : "base",
|
|
797
|
-
weight: "bold",
|
|
798
|
-
className: "leading-none",
|
|
799
|
-
children: ee
|
|
800
|
-
}) : /* @__PURE__ */ A(M, {
|
|
801
|
-
className: i(x.icon, "text-muted-foreground"),
|
|
802
|
-
"aria-hidden": "true"
|
|
790
|
+
onChange: F
|
|
803
791
|
}),
|
|
804
|
-
|
|
805
|
-
className: "pointer-events-none absolute inset-0
|
|
806
|
-
|
|
807
|
-
|
|
792
|
+
/* @__PURE__ */ A("div", {
|
|
793
|
+
className: "pointer-events-none absolute inset-0 flex items-center justify-center overflow-hidden rounded-full",
|
|
794
|
+
children: [P && N ? /* @__PURE__ */ k("img", {
|
|
795
|
+
src: N,
|
|
796
|
+
alt: _.change,
|
|
797
|
+
className: "absolute inset-0 size-full object-cover"
|
|
798
|
+
}) : ne ? /* @__PURE__ */ k(a, {
|
|
799
|
+
size: g === "sm" ? "sm" : g === "lg" ? "lg" : "base",
|
|
800
|
+
weight: "bold",
|
|
801
|
+
className: "leading-none",
|
|
802
|
+
children: ne
|
|
803
|
+
}) : /* @__PURE__ */ k(j, {
|
|
804
|
+
className: i(b.icon, "text-muted-foreground"),
|
|
805
|
+
"aria-hidden": "true"
|
|
806
|
+
}), !l && P && /* @__PURE__ */ k("div", {
|
|
807
|
+
className: "absolute inset-0 hidden items-center justify-center bg-foreground/50 text-background backdrop-blur-[1px] group-hover:flex",
|
|
808
|
+
"aria-hidden": "true",
|
|
809
|
+
children: /* @__PURE__ */ k(j, { className: b.icon })
|
|
810
|
+
})]
|
|
808
811
|
}),
|
|
809
|
-
!l &&
|
|
812
|
+
!l && P && /* @__PURE__ */ k("button", {
|
|
810
813
|
type: "button",
|
|
811
|
-
"aria-label":
|
|
814
|
+
"aria-label": _.remove,
|
|
812
815
|
onClick: (e) => {
|
|
813
|
-
e.stopPropagation(),
|
|
816
|
+
e.stopPropagation(), I();
|
|
814
817
|
},
|
|
815
|
-
className: i("absolute right-0.5 top-0.5 z-20
|
|
816
|
-
children: /* @__PURE__ */
|
|
818
|
+
className: i(f.target, f.focus, "absolute right-0.5 top-0.5 z-20 bg-card text-foreground shadow ring-1 ring-border", "opacity-100 transition-opacity sm:opacity-0 sm:group-hover:opacity-100 group-focus-within:opacity-100 focus-visible:opacity-100", b.remove),
|
|
819
|
+
children: /* @__PURE__ */ k(ce, { className: f.icon })
|
|
817
820
|
}),
|
|
818
|
-
!l && !
|
|
821
|
+
!l && !P && R && /* @__PURE__ */ k(a, {
|
|
819
822
|
size: "xs",
|
|
820
823
|
weight: "medium",
|
|
821
824
|
className: "absolute inset-x-0 bottom-1.5 text-center text-primary-accent",
|
|
822
|
-
children:
|
|
825
|
+
children: _.dragOver
|
|
823
826
|
})
|
|
824
827
|
]
|
|
825
828
|
}),
|
|
826
|
-
!
|
|
829
|
+
!P && /* @__PURE__ */ k(a, {
|
|
827
830
|
size: "xs",
|
|
828
831
|
type: "secondary",
|
|
829
|
-
children:
|
|
832
|
+
children: _.hint
|
|
830
833
|
}),
|
|
831
|
-
|
|
834
|
+
ae.length > 0 && /* @__PURE__ */ k("div", {
|
|
832
835
|
className: "avatar-upload--errors grid gap-space-2xs",
|
|
833
836
|
role: "alert",
|
|
834
837
|
"aria-live": "polite",
|
|
835
|
-
children:
|
|
838
|
+
children: ae.map((e, t) => /* @__PURE__ */ k(a, {
|
|
836
839
|
size: "xs",
|
|
837
840
|
type: "error",
|
|
838
|
-
children:
|
|
841
|
+
children: Z(e, _, ie)
|
|
839
842
|
}, `${e.file.name}-${e.code}-${t}`))
|
|
840
843
|
})
|
|
841
844
|
]
|
|
842
845
|
});
|
|
843
846
|
}
|
|
844
|
-
var
|
|
845
|
-
|
|
847
|
+
var $ = x.forwardRef(xe);
|
|
848
|
+
$.displayName = "AvatarUpload";
|
|
846
849
|
//#endregion
|
|
847
|
-
export {
|
|
850
|
+
export { V as a, X as i, be as n, P as o, ye as r, $ as t };
|
|
848
851
|
|
|
849
|
-
//# sourceMappingURL=upload-
|
|
852
|
+
//# sourceMappingURL=upload-CDbYw1WN.js.map
|