themelia-react-ui 2.0.1 → 2.0.3
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 +317 -131
- package/README.md +25 -9
- package/THIRD_PARTY_NOTICES.md +7 -0
- package/dist/{accordion-B6a3vVgA.js → accordion-Cjb6sx0G.js} +14 -13
- package/dist/accordion-Cjb6sx0G.js.map +1 -0
- package/dist/action-menu-CllU52Mm.js +280 -0
- package/dist/action-menu-CllU52Mm.js.map +1 -0
- package/dist/affordance-geometry.generated-tF36bREk.js +140 -0
- package/dist/affordance-geometry.generated-tF36bREk.js.map +1 -0
- package/dist/ai-artifact-DvTwDVyL.js +1148 -0
- package/dist/ai-artifact-DvTwDVyL.js.map +1 -0
- package/dist/{app-shell-ZK5RWdo6.js → app-shell-C4FhvCqF.js} +5 -5
- package/dist/{app-shell-ZK5RWdo6.js.map → app-shell-C4FhvCqF.js.map} +1 -1
- package/dist/attachment-BxDfL2mw.js +246 -0
- package/dist/attachment-BxDfL2mw.js.map +1 -0
- package/dist/{auth-CYxKfo69.js → auth-BGua8ouh.js} +58 -54
- package/dist/auth-BGua8ouh.js.map +1 -0
- package/dist/{avatar-BBnEJIx8.js → avatar-DAPlDvhJ.js} +7 -7
- package/dist/avatar-DAPlDvhJ.js.map +1 -0
- package/dist/{badge-MrKVNzW9.js → badge-HpFqoqSY.js} +40 -40
- package/dist/badge-HpFqoqSY.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 +1 -1
- package/dist/base/buttons.js +1 -1
- package/dist/base/cards.js +2 -2
- package/dist/base/carousel.js +40 -36
- package/dist/base/carousel.js.map +1 -1
- package/dist/base/cascader.js +92 -92
- package/dist/base/cascader.js.map +1 -1
- package/dist/base/chart.js +1 -1
- package/dist/base/choice-inputs.js +2 -2
- package/dist/base/code-block.js +1 -1
- package/dist/base/combobox.js +2 -2
- package/dist/base/command.js +1 -1
- package/dist/base/copyable.js +1 -1
- package/dist/base/date-pickers.js +2 -2
- package/dist/base/display.js +6 -6
- package/dist/base/feedback.js +3 -3
- package/dist/base/forms-numeric.js +1 -1
- package/dist/base/forms.js +2 -2
- package/dist/base/inline-edit.js +14 -14
- 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 +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 +171 -176
- 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 +6 -6
- package/dist/base/skeleton.js +1 -1
- package/dist/base/spinner.js +79 -2
- package/dist/base/spinner.js.map +1 -0
- 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 +46 -45
- package/dist/base/toaster.js.map +1 -1
- package/dist/base/tree.js +1 -1
- package/dist/base/upload-queue.js +1 -1
- package/dist/base/upload.js +3 -3
- package/dist/base/value-inputs.js +1 -1
- package/dist/{batch-action-bar-BZGDG-Si.js → batch-action-bar-DnUJ21NQ.js} +6 -5
- package/dist/batch-action-bar-DnUJ21NQ.js.map +1 -0
- package/dist/blocks/admin.js +42 -42
- package/dist/blocks/admin.js.map +1 -1
- package/dist/blocks/ai.js +260 -240
- package/dist/blocks/ai.js.map +1 -1
- package/dist/blocks/analytics/usage-card.js +1 -1
- package/dist/blocks/analytics.js +620 -585
- 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 +1152 -1109
- package/dist/blocks/commerce.js.map +1 -1
- package/dist/blocks/data-display.js +2 -2
- package/dist/blocks/onboarding.js +48 -39
- package/dist/blocks/onboarding.js.map +1 -1
- package/dist/blocks/planning.js +13 -12
- package/dist/blocks/planning.js.map +1 -1
- package/dist/blocks/timelines.js +1 -1
- package/dist/{breadcrumbs-D5t7I023.js → breadcrumbs-C-oqs1sQ.js} +5 -5
- package/dist/breadcrumbs-C-oqs1sQ.js.map +1 -0
- package/dist/{button-QYwiyhD2.js → button-DVzspB_G.js} +2 -2
- package/dist/{button-QYwiyhD2.js.map → button-DVzspB_G.js.map} +1 -1
- package/dist/{buttons-SbIcm1HJ.js → buttons-DPZekJFu.js} +20 -15
- package/dist/buttons-DPZekJFu.js.map +1 -0
- package/dist/cards-BaBZR-AU.js +68 -0
- package/dist/cards-BaBZR-AU.js.map +1 -0
- package/dist/{chart-QfrARkXl.js → chart-ZOYyK2xG.js} +58 -55
- package/dist/chart-ZOYyK2xG.js.map +1 -0
- package/dist/{checkbox-DhB6K0bK.js → checkbox-AWIhNhmo.js} +2 -2
- package/dist/{checkbox-DhB6K0bK.js.map → checkbox-AWIhNhmo.js.map} +1 -1
- package/dist/{choice-inputs-t6w3ATNz.js → choice-inputs-CNHvARCJ.js} +49 -45
- package/dist/choice-inputs-CNHvARCJ.js.map +1 -0
- package/dist/{code-block-Dgbu-CU3.js → code-block-DeneBJR_.js} +8 -8
- package/dist/code-block-DeneBJR_.js.map +1 -0
- package/dist/{collapsible-D8AEGU1-.js → collapsible-C-_l4hpy.js} +3 -3
- package/dist/{collapsible-D8AEGU1-.js.map → collapsible-C-_l4hpy.js.map} +1 -1
- package/dist/{collection-content-uK16Grv0.js → collection-content-By56pLog.js} +3 -3
- package/dist/{collection-content-uK16Grv0.js.map → collection-content-By56pLog.js.map} +1 -1
- package/dist/combobox-DaHESuiL.js +355 -0
- package/dist/combobox-DaHESuiL.js.map +1 -0
- package/dist/{combobox-DLl0bfiq.js → combobox-Dxo2fAYQ.js} +289 -279
- package/dist/combobox-Dxo2fAYQ.js.map +1 -0
- package/dist/{command-kNR20o7x.js → command-C25VMRII.js} +7 -7
- package/dist/{command-kNR20o7x.js.map → command-C25VMRII.js.map} +1 -1
- package/dist/{comments-BpDuCUUu.js → comments-DD0DUPwJ.js} +114 -105
- package/dist/comments-DD0DUPwJ.js.map +1 -0
- package/dist/components/base/badge/badge.recipes.d.ts +1 -1
- package/dist/components/base/buttons/loader-button.d.ts +2 -1
- package/dist/components/base/cards/card.recipes.d.ts +2 -3
- package/dist/components/base/cards/partials/smart-card-skeleton.d.ts +3 -13
- package/dist/components/base/cards/smart-card.types.d.ts +11 -4
- package/dist/components/base/chart/chart.d.ts +2 -5
- package/dist/components/base/combobox/combobox-field.d.ts +16 -0
- package/dist/components/base/combobox/combobox.strings.d.ts +7 -0
- package/dist/components/base/combobox/index.d.ts +30 -4
- package/dist/components/base/forms/form-sizing.d.ts +11 -3
- package/dist/components/base/navigation/pagination.d.ts +5 -2
- package/dist/components/base/popover/popover.recipes.d.ts +15 -1
- package/dist/components/base/table/index.d.ts +9 -2
- package/dist/components/base/text-inputs/input-group.d.ts +2 -2
- package/dist/components/blocks/ai/ai-shimmer/ai-shimmer.d.ts +1 -1
- package/dist/components/blocks/ai/ai-shimmer/types.d.ts +3 -0
- package/dist/components/blocks/commerce/fulfillment-group/types.d.ts +3 -1
- package/dist/components/blocks/data-display/inline-stat/inline-stat.d.ts +16 -8
- package/dist/components/features/activities/partials/activity-marker.d.ts +6 -3
- package/dist/components/features/appointment-calendar/appointment-calendar.d.ts +5 -0
- package/dist/components/features/appointment-calendar/appointment-calendar.types.d.ts +220 -0
- package/dist/components/features/appointment-calendar/appointment-calendar.utils.d.ts +41 -0
- package/dist/components/features/appointment-calendar/index.d.ts +3 -0
- package/dist/components/features/appointment-calendar/partials/appointment-agenda.d.ts +32 -0
- package/dist/components/features/appointment-calendar/partials/appointment-month.d.ts +13 -0
- package/dist/components/features/combobox/combobox.strings.d.ts +15 -1
- package/dist/components/features/combobox/types.d.ts +4 -0
- package/dist/components/features/media-library/media-library.strings.d.ts +2 -0
- package/dist/components/features/rich-text-editor/index.d.ts +1 -1
- package/dist/components/features/rich-text-editor/rich-text-editor.recipes.d.ts +6 -0
- package/dist/components/features/rich-text-editor/rich-text-editor.types.d.ts +9 -1
- package/dist/components/features/table/table-header.d.ts +1 -1
- package/dist/components/features/table/table.strings.d.ts +55 -1
- package/dist/components/features/table/table.types.d.ts +17 -4
- package/dist/components/features/theme-tweaker/theme-tweaker.types.d.ts +5 -0
- package/dist/components/primitives/number.d.ts +4 -2
- package/dist/components/primitives/value.d.ts +3 -1
- package/dist/components/typography/text-link.d.ts +4 -0
- package/dist/components/ui/combobox-dismiss.d.ts +16 -0
- package/dist/components/ui/combobox.d.ts +16 -7
- package/dist/components/ui/dialog.d.ts +1 -1
- package/dist/components/ui/item.d.ts +8 -8
- package/dist/components/ui/popover.d.ts +1 -1
- package/dist/components/ui/sheet.d.ts +1 -1
- package/dist/components/ui/tabs.d.ts +1 -1
- package/dist/{containers-DmWiJa2I.js → containers-Mu1LMGV1.js} +2 -2
- package/dist/{containers-DmWiJa2I.js.map → containers-Mu1LMGV1.js.map} +1 -1
- package/dist/{copyable-B3Gwgdqc.js → copyable-ClBuk_UK.js} +4 -4
- package/dist/{copyable-B3Gwgdqc.js.map → copyable-ClBuk_UK.js.map} +1 -1
- package/dist/{data-display-DafIvCl5.js → data-display-DT_khPl_.js} +98 -87
- package/dist/data-display-DT_khPl_.js.map +1 -0
- package/dist/{date-BgK3bTdo.js → date-DCrsDTZc.js} +5 -5
- package/dist/{date-BgK3bTdo.js.map → date-DCrsDTZc.js.map} +1 -1
- package/dist/{date-picker-CF-DtUpF.js → date-picker-B2K3ucWn.js} +594 -593
- package/dist/date-picker-B2K3ucWn.js.map +1 -0
- package/dist/date-pickers-Ds8gLaoP.js +175 -0
- package/dist/date-pickers-Ds8gLaoP.js.map +1 -0
- package/dist/{display-DsQTVzMz.js → display-hAc1HjpI.js} +49 -49
- package/dist/display-hAc1HjpI.js.map +1 -0
- package/dist/dropdown-menu-Cl4X7L5S.js +193 -0
- package/dist/dropdown-menu-Cl4X7L5S.js.map +1 -0
- package/dist/editable-text-recipe-Cn61kEcv.js +10 -0
- package/dist/editable-text-recipe-Cn61kEcv.js.map +1 -0
- package/dist/features/activities.js +398 -375
- package/dist/features/activities.js.map +1 -1
- package/dist/features/ai-chat.js +188 -179
- package/dist/features/ai-chat.js.map +1 -1
- package/dist/features/appointment-calendar.js +683 -0
- package/dist/features/appointment-calendar.js.map +1 -0
- package/dist/features/async-preview.js +109 -107
- 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 +137 -137
- package/dist/features/data-view.js.map +1 -1
- package/dist/features/email-composer.js +255 -255
- package/dist/features/email-composer.js.map +1 -1
- package/dist/features/event-calendar.js +254 -248
- package/dist/features/event-calendar.js.map +1 -1
- package/dist/features/filters.js +1 -1
- package/dist/features/global-search.js +35 -32
- package/dist/features/global-search.js.map +1 -1
- package/dist/features/kanban.js +118 -117
- package/dist/features/kanban.js.map +1 -1
- package/dist/features/map.js +233 -231
- package/dist/features/map.js.map +1 -1
- package/dist/features/media-library.js +789 -775
- 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 +922 -902
- package/dist/features/products.js.map +1 -1
- package/dist/features/questionnaire.js +28 -24
- package/dist/features/questionnaire.js.map +1 -1
- package/dist/features/resource-assignment.js +18 -15
- package/dist/features/resource-assignment.js.map +1 -1
- package/dist/features/resource.js +12 -12
- package/dist/features/resource.js.map +1 -1
- package/dist/features/rich-text-editor.js +2 -2
- package/dist/features/schema-form.js +15 -13
- package/dist/features/schema-form.js.map +1 -1
- package/dist/features/suggestions.js +3 -3
- package/dist/features/sync.js +11 -5
- package/dist/features/sync.js.map +1 -1
- package/dist/features/table.js +1 -1
- package/dist/features/theme-tweaker.js +493 -489
- package/dist/features/theme-tweaker.js.map +1 -1
- package/dist/feedback-BYIhtitP.js +239 -0
- package/dist/feedback-BYIhtitP.js.map +1 -0
- package/dist/{field-affordance-recipes-qQeIf4lG.js → field-affordance-recipes-DZhnIL_Y.js} +11 -18
- package/dist/field-affordance-recipes-DZhnIL_Y.js.map +1 -0
- package/dist/{filters-BkHH53uv.js → filters-DJVAveHA.js} +589 -580
- package/dist/filters-DJVAveHA.js.map +1 -0
- package/dist/{form-field-DUt4UxSV.js → form-field-CwH9y77i.js} +6 -5
- package/dist/form-field-CwH9y77i.js.map +1 -0
- package/dist/{form-sizing-By94KzXE.js → form-sizing-BdP_Mf5p.js} +39 -44
- package/dist/form-sizing-BdP_Mf5p.js.map +1 -0
- package/dist/{forms-Bzha-Y3B.js → forms-B9G_xwzi.js} +8 -8
- package/dist/{forms-Bzha-Y3B.js.map → forms-B9G_xwzi.js.map} +1 -1
- package/dist/{forms-numeric-C0bvjRPZ.js → forms-numeric-B_jraJaQ.js} +309 -309
- package/dist/forms-numeric-B_jraJaQ.js.map +1 -0
- package/dist/{header-BOefOKd1.js → header-BSfIEWbI.js} +160 -153
- package/dist/header-BSfIEWbI.js.map +1 -0
- package/dist/{hooks-9k_TtmKh.js → hooks-ClH9thn4.js} +2 -2
- package/dist/{hooks-9k_TtmKh.js.map → hooks-ClH9thn4.js.map} +1 -1
- package/dist/{icon-badge-CAuKupo9.js → icon-badge-DYKIwvOV.js} +4 -4
- package/dist/{icon-badge-CAuKupo9.js.map → icon-badge-DYKIwvOV.js.map} +1 -1
- package/dist/index.js +3 -3
- package/dist/input-CZw8iU99.js +21 -0
- package/dist/input-CZw8iU99.js.map +1 -0
- package/dist/input-DQdEd0YD.js +263 -0
- package/dist/input-DQdEd0YD.js.map +1 -0
- package/dist/{interaction-recipes-CHr0dJUs.js → interaction-recipes-XR9ZpVYL.js} +2 -1
- package/dist/interaction-recipes-XR9ZpVYL.js.map +1 -0
- package/dist/item-K5_ghvze.js +275 -0
- package/dist/item-K5_ghvze.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 +71 -0
- package/dist/lib/editable-text-recipe.d.ts +4 -4
- package/dist/lib/field-affordance-recipes.d.ts +2 -2
- package/dist/lib/interaction-recipes.d.ts +5 -0
- package/dist/lib/theme-mode-css.d.ts +7 -0
- package/dist/lib/tone-recipes.d.ts +8 -0
- package/dist/lib/ui-provider/types.d.ts +2 -2
- package/dist/lib/use-popup-focus-recovery.d.ts +8 -0
- package/dist/lib/utils.js +1 -1
- package/dist/{media-gallery-DcTtAaeC.js → media-gallery-3zIVLMWH.js} +8 -8
- package/dist/media-gallery-3zIVLMWH.js.map +1 -0
- package/dist/{mentions-D-uyCh01.js → mentions-CGlEJ15c.js} +144 -142
- package/dist/mentions-CGlEJ15c.js.map +1 -0
- package/dist/{message-CdHgIWKf.js → message-DZ_ruyUV.js} +6 -5
- package/dist/message-DZ_ruyUV.js.map +1 -0
- package/dist/{metadata-list-X5rYAKSB.js → metadata-list-8N16ZMW_.js} +130 -119
- package/dist/metadata-list-8N16ZMW_.js.map +1 -0
- package/dist/{navigation-D3KwXmaq.js → navigation-Bnotn4AQ.js} +19 -19
- package/dist/navigation-Bnotn4AQ.js.map +1 -0
- package/dist/{navigation-HJf5zxlH.js → navigation-BzhHI3lo.js} +36 -35
- package/dist/navigation-BzhHI3lo.js.map +1 -0
- package/dist/{navigation-row-recipes-BVowojQw.js → navigation-row-recipes-BFLCk_Aq.js} +2 -2
- package/dist/{navigation-row-recipes-BVowojQw.js.map → navigation-row-recipes-BFLCk_Aq.js.map} +1 -1
- package/dist/{number-DMhe-Vsk.js → number-DbV1Dija.js} +36 -34
- package/dist/{number-DMhe-Vsk.js.map → number-DbV1Dija.js.map} +1 -1
- package/dist/{overflow-tab-bar-sQHXLlwQ.js → overflow-tab-bar-CWY7Nogn.js} +105 -103
- package/dist/overflow-tab-bar-CWY7Nogn.js.map +1 -0
- package/dist/{overlays-I0axtYA6.js → overlays-tMkF-VAN.js} +282 -278
- package/dist/overlays-tMkF-VAN.js.map +1 -0
- package/dist/{page-B5dTH9gE.js → page-CL9YeH_V.js} +8 -8
- package/dist/{page-B5dTH9gE.js.map → page-CL9YeH_V.js.map} +1 -1
- package/dist/{page-header-commands-DjzFEq3E.js → page-header-commands-DOb6WsfD.js} +5 -5
- package/dist/{page-header-commands-DjzFEq3E.js.map → page-header-commands-DOb6WsfD.js.map} +1 -1
- package/dist/pagination-BL25hu2s.js +158 -0
- package/dist/pagination-BL25hu2s.js.map +1 -0
- package/dist/{popover-Di55PyAI.js → popover-gnTOhbFM.js} +69 -66
- package/dist/popover-gnTOhbFM.js.map +1 -0
- package/dist/popover-menu-Cn9rUkdc.js +100 -0
- package/dist/popover-menu-Cn9rUkdc.js.map +1 -0
- package/dist/{popover.recipes-Bdyhj2db.js → popover.recipes-D3j8R8Yp.js} +17 -10
- package/dist/popover.recipes-D3j8R8Yp.js.map +1 -0
- package/dist/{primitives-B-CkiEMU.js → primitives-BFK08r9M.js} +45 -44
- package/dist/primitives-BFK08r9M.js.map +1 -0
- package/dist/primitives.js +4 -4
- package/dist/{progress-rnS8-uAW.js → progress-B1VnCT0K.js} +5 -5
- package/dist/{progress-rnS8-uAW.js.map → progress-B1VnCT0K.js.map} +1 -1
- package/dist/{receipt-D0oswZ0p.js → receipt-BVSOH3Xo.js} +9 -6
- package/dist/{receipt-D0oswZ0p.js.map → receipt-BVSOH3Xo.js.map} +1 -1
- package/dist/{rich-text-DvGulsNJ.js → rich-text-GOUyKQ-s.js} +3 -3
- package/dist/{rich-text-DvGulsNJ.js.map → rich-text-GOUyKQ-s.js.map} +1 -1
- package/dist/{rich-text-editor-sMU_Scqm.js → rich-text-editor-cRLC-eBK.js} +418 -426
- package/dist/rich-text-editor-cRLC-eBK.js.map +1 -0
- package/dist/rich-text-editor-toolbar-DfXg0-VC.js +94 -0
- package/dist/rich-text-editor-toolbar-DfXg0-VC.js.map +1 -0
- package/dist/{scroll-area-Bt_vXY2b.js → scroll-area-DcI-M1UT.js} +2 -2
- package/dist/{scroll-area-Bt_vXY2b.js.map → scroll-area-DcI-M1UT.js.map} +1 -1
- package/dist/{separator-C8DlRGwF.js → separator-BDV-Y648.js} +3 -3
- package/dist/{separator-C8DlRGwF.js.map → separator-BDV-Y648.js.map} +1 -1
- package/dist/{separator-CYHnjsAb.js → separator-Bom7NsGO.js} +2 -2
- package/dist/{separator-CYHnjsAb.js.map → separator-Bom7NsGO.js.map} +1 -1
- package/dist/services/actions.js +1 -1
- package/dist/{settings-CQW3b-Cu.js → settings-ybnjVwbd.js} +20 -19
- package/dist/settings-ybnjVwbd.js.map +1 -0
- package/dist/{sheet-4SEvVYzA.js → sheet-ijlsjq-n.js} +76 -73
- package/dist/sheet-ijlsjq-n.js.map +1 -0
- package/dist/{sidebar-C7WWR29L.js → sidebar-Db6gkh3U.js} +183 -182
- package/dist/sidebar-Db6gkh3U.js.map +1 -0
- package/dist/{sidebar-d7Dg80ln.js → sidebar-DkTO4VTO.js} +14 -13
- package/dist/{sidebar-d7Dg80ln.js.map → sidebar-DkTO4VTO.js.map} +1 -1
- package/dist/{skeleton-Cz890JZF.js → skeleton-Byjnt7qr.js} +3 -3
- package/dist/{skeleton-Cz890JZF.js.map → skeleton-Byjnt7qr.js.map} +1 -1
- package/dist/smart-card-DiC5aac3.js +604 -0
- package/dist/smart-card-DiC5aac3.js.map +1 -0
- package/dist/{structure-DC2dygdA.js → structure-BmisBK-3.js} +2 -2
- package/dist/{structure-DC2dygdA.js.map → structure-BmisBK-3.js.map} +1 -1
- package/dist/style.css +1 -1
- package/dist/table-BweFy_P9.js +1530 -0
- package/dist/table-BweFy_P9.js.map +1 -0
- package/dist/{table-CIKyLUsy.js → table-DsfzoUia.js} +75 -63
- package/dist/table-DsfzoUia.js.map +1 -0
- package/dist/{tabs-DwBJfjxX.js → tabs-CDocW5D1.js} +14 -13
- package/dist/tabs-CDocW5D1.js.map +1 -0
- package/dist/text-inputs-f9Ia-aCi.js +353 -0
- package/dist/text-inputs-f9Ia-aCi.js.map +1 -0
- package/dist/theme-mode-css-BB-_RYab.js +14 -0
- package/dist/theme-mode-css-BB-_RYab.js.map +1 -0
- package/dist/theme-scope-BJ6eE2xt.js +50 -0
- package/dist/theme-scope-BJ6eE2xt.js.map +1 -0
- package/dist/theme.css +285 -228
- package/dist/themes/green.css +16 -12
- package/dist/timelines-CwM_9IhD.js +457 -0
- package/dist/timelines-CwM_9IhD.js.map +1 -0
- package/dist/{tone-recipes-CPoExcTE.js → tone-recipes-BPsRAvhu.js} +5 -2
- package/dist/tone-recipes-BPsRAvhu.js.map +1 -0
- package/dist/{tooltip-CsfgrfS7.js → tooltip-yiRJUFjp.js} +4 -4
- package/dist/{tooltip-CsfgrfS7.js.map → tooltip-yiRJUFjp.js.map} +1 -1
- package/dist/{tree-BiKhg8AY.js → tree-WnKQzwbq.js} +9 -9
- package/dist/{tree-BiKhg8AY.js.map → tree-WnKQzwbq.js.map} +1 -1
- package/dist/typography/rich-text.js +1 -1
- package/dist/{typography-DTRkE9zL.js → typography-UTnveOEy.js} +6 -6
- package/dist/typography-UTnveOEy.js.map +1 -0
- package/dist/typography.js +2 -2
- package/dist/{ui-provider-1D_NSYzO.js → ui-provider-C_U0Xma4.js} +3 -3
- package/dist/ui-provider-C_U0Xma4.js.map +1 -0
- package/dist/ui-provider.js +2 -2
- package/dist/{upload-BO8-CLN6.js → upload-CXyxmQBP.js} +13 -12
- package/dist/upload-CXyxmQBP.js.map +1 -0
- package/dist/{upload-queue-EOC8g1gf.js → upload-queue-Boscubn9.js} +11 -9
- package/dist/upload-queue-Boscubn9.js.map +1 -0
- package/dist/{usage-card-obRaBskq.js → usage-card-BhO5eqkX.js} +53 -37
- package/dist/usage-card-BhO5eqkX.js.map +1 -0
- package/dist/use-popup-focus-recovery-C0QPvgOR.js +36 -0
- package/dist/use-popup-focus-recovery-C0QPvgOR.js.map +1 -0
- package/dist/{utils-l5LpDw2z.js → utils-BRhFDwuU.js} +59 -44
- package/dist/utils-BRhFDwuU.js.map +1 -0
- package/dist/{value-inputs-TAYMX111.js → value-inputs-TaX4OjNk.js} +268 -252
- package/dist/value-inputs-TaX4OjNk.js.map +1 -0
- package/dist/{value-typography-b8wpz1eX.js → value-typography-BP8OG6h5.js} +2 -2
- package/dist/{value-typography-b8wpz1eX.js.map → value-typography-BP8OG6h5.js.map} +1 -1
- package/dist/{workspace-DH0v0KcB.js → workspace-B-OEm3Kf.js} +34 -33
- package/dist/workspace-B-OEm3Kf.js.map +1 -0
- package/docs/consumer-skill/SKILL.md +3 -3
- package/docs/consumer-skill/references/agents-md.md +1 -1
- package/docs/consumer-skill/references/composition.md +8 -6
- package/docs/consumer-skill/references/installation.md +6 -0
- package/docs/consumer-skill/references/integration.md +4 -3
- package/docs/consumer-skill/references/public-api.json +105 -2
- package/docs/consumer-skill/references/review.md +7 -0
- package/docs/consumer-skill/references/theming.md +71 -6
- package/docs/consumer-skill/references/tokens.json +1 -1
- package/docs/consumer-skill/references/workflows.md +26 -0
- package/docs/consumer-skill/scripts/composition-policy.mjs +3 -2
- package/docs/consumer-skill/scripts/surface-policy.mjs +11 -0
- package/package.json +8 -4
- package/dist/accordion-B6a3vVgA.js.map +0 -1
- package/dist/action-menu-TzCoSlwL.js +0 -280
- package/dist/action-menu-TzCoSlwL.js.map +0 -1
- package/dist/affordance-geometry.generated-B5iu-Mkr.js +0 -69
- package/dist/affordance-geometry.generated-B5iu-Mkr.js.map +0 -1
- package/dist/ai-artifact-BMJdv-6q.js +0 -1115
- package/dist/ai-artifact-BMJdv-6q.js.map +0 -1
- package/dist/attachment-BtfhGm8i.js +0 -245
- package/dist/attachment-BtfhGm8i.js.map +0 -1
- package/dist/auth-CYxKfo69.js.map +0 -1
- package/dist/avatar-BBnEJIx8.js.map +0 -1
- package/dist/badge-MrKVNzW9.js.map +0 -1
- package/dist/batch-action-bar-BZGDG-Si.js.map +0 -1
- package/dist/breadcrumbs-D5t7I023.js.map +0 -1
- package/dist/buttons-SbIcm1HJ.js.map +0 -1
- package/dist/cards-CiiHpKYd.js +0 -66
- package/dist/cards-CiiHpKYd.js.map +0 -1
- package/dist/chart-QfrARkXl.js.map +0 -1
- package/dist/choice-inputs-t6w3ATNz.js.map +0 -1
- package/dist/code-block-Dgbu-CU3.js.map +0 -1
- package/dist/combobox-2Ic8N9bL.js +0 -278
- package/dist/combobox-2Ic8N9bL.js.map +0 -1
- package/dist/combobox-DLl0bfiq.js.map +0 -1
- package/dist/comments-BpDuCUUu.js.map +0 -1
- package/dist/data-display-DafIvCl5.js.map +0 -1
- package/dist/date-picker-CF-DtUpF.js.map +0 -1
- package/dist/date-pickers-BmzxJl5l.js +0 -174
- package/dist/date-pickers-BmzxJl5l.js.map +0 -1
- package/dist/display-DsQTVzMz.js.map +0 -1
- package/dist/dropdown-menu-E2qmdC7o.js +0 -193
- package/dist/dropdown-menu-E2qmdC7o.js.map +0 -1
- package/dist/editable-text-recipe-Bkm6wKHp.js +0 -10
- package/dist/editable-text-recipe-Bkm6wKHp.js.map +0 -1
- package/dist/feedback-qNuMBtRH.js +0 -233
- package/dist/feedback-qNuMBtRH.js.map +0 -1
- package/dist/field-affordance-recipes-qQeIf4lG.js.map +0 -1
- package/dist/filters-BkHH53uv.js.map +0 -1
- package/dist/form-field-DUt4UxSV.js.map +0 -1
- package/dist/form-sizing-By94KzXE.js.map +0 -1
- package/dist/forms-numeric-C0bvjRPZ.js.map +0 -1
- package/dist/header-BOefOKd1.js.map +0 -1
- package/dist/input-DWhBBBww.js +0 -262
- package/dist/input-DWhBBBww.js.map +0 -1
- package/dist/input-Ddi_LSYv.js +0 -20
- package/dist/input-Ddi_LSYv.js.map +0 -1
- package/dist/interaction-recipes-CHr0dJUs.js.map +0 -1
- package/dist/item-DEmDiTlD.js +0 -265
- package/dist/item-DEmDiTlD.js.map +0 -1
- package/dist/media-gallery-DcTtAaeC.js.map +0 -1
- package/dist/mentions-D-uyCh01.js.map +0 -1
- package/dist/message-CdHgIWKf.js.map +0 -1
- package/dist/metadata-list-X5rYAKSB.js.map +0 -1
- package/dist/navigation-D3KwXmaq.js.map +0 -1
- package/dist/navigation-HJf5zxlH.js.map +0 -1
- package/dist/overflow-tab-bar-sQHXLlwQ.js.map +0 -1
- package/dist/overlays-I0axtYA6.js.map +0 -1
- package/dist/pagination-3bPA_a6K.js +0 -149
- package/dist/pagination-3bPA_a6K.js.map +0 -1
- package/dist/popover-Di55PyAI.js.map +0 -1
- package/dist/popover-menu-B71Tn2Qz.js +0 -99
- package/dist/popover-menu-B71Tn2Qz.js.map +0 -1
- package/dist/popover.recipes-Bdyhj2db.js.map +0 -1
- package/dist/primitives-B-CkiEMU.js.map +0 -1
- package/dist/rich-text-editor-sMU_Scqm.js.map +0 -1
- package/dist/rich-text-editor.recipes-CadiF_Uu.js +0 -88
- package/dist/rich-text-editor.recipes-CadiF_Uu.js.map +0 -1
- package/dist/settings-CQW3b-Cu.js.map +0 -1
- package/dist/sheet-4SEvVYzA.js.map +0 -1
- package/dist/sidebar-C7WWR29L.js.map +0 -1
- package/dist/smart-card-lFKxn5Hu.js +0 -595
- package/dist/smart-card-lFKxn5Hu.js.map +0 -1
- package/dist/spinner-fa3h1Aif.js +0 -80
- package/dist/spinner-fa3h1Aif.js.map +0 -1
- package/dist/table-CIKyLUsy.js.map +0 -1
- package/dist/table-CrcLN9Io.js +0 -1458
- package/dist/table-CrcLN9Io.js.map +0 -1
- package/dist/tabs-DwBJfjxX.js.map +0 -1
- package/dist/text-inputs-aaK9wcDT.js +0 -326
- package/dist/text-inputs-aaK9wcDT.js.map +0 -1
- package/dist/theme-scope-kStaAer0.js +0 -39
- package/dist/theme-scope-kStaAer0.js.map +0 -1
- package/dist/timelines-C_SBwHNP.js +0 -442
- package/dist/timelines-C_SBwHNP.js.map +0 -1
- package/dist/tone-recipes-CPoExcTE.js.map +0 -1
- package/dist/typography-DTRkE9zL.js.map +0 -1
- package/dist/ui-provider-1D_NSYzO.js.map +0 -1
- package/dist/upload-BO8-CLN6.js.map +0 -1
- package/dist/upload-queue-EOC8g1gf.js.map +0 -1
- package/dist/usage-card-obRaBskq.js.map +0 -1
- package/dist/utils-l5LpDw2z.js.map +0 -1
- package/dist/value-inputs-TAYMX111.js.map +0 -1
- package/dist/workspace-DH0v0KcB.js.map +0 -1
|
@@ -0,0 +1,353 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { s as e } from "./ui-provider-C_U0Xma4.js";
|
|
3
|
+
import { useStrings as t } from "./lib/strings.js";
|
|
4
|
+
import { t as n } from "./utils-BRhFDwuU.js";
|
|
5
|
+
import { t as r } from "./affordance-geometry.generated-tF36bREk.js";
|
|
6
|
+
import { n as i } from "./buttons-DPZekJFu.js";
|
|
7
|
+
import { c as a } from "./typography-UTnveOEy.js";
|
|
8
|
+
import { t as o } from "./field-state-recipes-BVA2CWHo.js";
|
|
9
|
+
import { n as s } from "./field-affordance-recipes-DZhnIL_Y.js";
|
|
10
|
+
import { t as c } from "./editable-text-recipe-Cn61kEcv.js";
|
|
11
|
+
import { _ as l, a as u, g as d, o as f, u as p, v as m, y as h } from "./form-sizing-BdP_Mf5p.js";
|
|
12
|
+
import { a as g, i as _, o as v, r as y, t as b } from "./input-DQdEd0YD.js";
|
|
13
|
+
import { t as x } from "./input-CZw8iU99.js";
|
|
14
|
+
import * as S from "react";
|
|
15
|
+
import { useCallback as C, useEffect as w, useRef as T } from "react";
|
|
16
|
+
import { jsx as E, jsxs as D } from "react/jsx-runtime";
|
|
17
|
+
import { Eye as O, EyeOff as k, Loader2Icon as ee } from "lucide-react";
|
|
18
|
+
import { cva as A } from "class-variance-authority";
|
|
19
|
+
//#region src/components/base/text-inputs/textarea.tsx
|
|
20
|
+
var te = { clear: "Clear textarea" }, j = S.forwardRef(({ className: i, maxLength: u, showCharacterCount: f, clearable: p, onClear: _, loading: b = !1, invalid: x, size: S, autoResize: O = !1, minRows: k = 2, maxRows: A, onChange: j, value: M, defaultValue: N, id: P, strings: F, ...I }, L) => {
|
|
21
|
+
let R = T(null), z = t(te, F), { defaultScale: B } = e(), V = h(S, B), { id: H, value: U, isReactHookForm: W, characterCount: G, hasCharacterLimit: K, showCount: q, hasValue: J, updateValue: Y, wouldExceedLimit: X } = v({
|
|
22
|
+
controlledValue: M,
|
|
23
|
+
defaultValue: N,
|
|
24
|
+
maxLength: u,
|
|
25
|
+
showCharacterCount: f,
|
|
26
|
+
providedId: P,
|
|
27
|
+
idPrefix: "textarea",
|
|
28
|
+
hasOnChange: j !== void 0
|
|
29
|
+
}), Z = !!x, Q = C(() => {
|
|
30
|
+
if (!O || !R.current) return;
|
|
31
|
+
let e = R.current, t = getComputedStyle(e), n = Number.parseFloat(t.lineHeight) || 20, r = (Number.parseFloat(t.paddingTop) || 0) + (Number.parseFloat(t.paddingBottom) || 0), i = t.boxSizing === "border-box" ? (Number.parseFloat(t.borderTopWidth) || 0) + (Number.parseFloat(t.borderBottomWidth) || 0) : 0;
|
|
32
|
+
e.style.height = "auto";
|
|
33
|
+
let a = n * k + r + i, o = A ? n * A + r + i : Infinity, s = Math.min(Math.max(e.scrollHeight + i, a), o);
|
|
34
|
+
e.style.height = `${s}px`;
|
|
35
|
+
}, [
|
|
36
|
+
O,
|
|
37
|
+
A,
|
|
38
|
+
k
|
|
39
|
+
]);
|
|
40
|
+
w(() => {
|
|
41
|
+
Q();
|
|
42
|
+
}, [
|
|
43
|
+
U,
|
|
44
|
+
I.placeholder,
|
|
45
|
+
O,
|
|
46
|
+
Q
|
|
47
|
+
]), w(() => {
|
|
48
|
+
let e = R.current;
|
|
49
|
+
if (!O || !e || typeof ResizeObserver > "u") return;
|
|
50
|
+
let t = "", n = new ResizeObserver(() => {
|
|
51
|
+
let n = getComputedStyle(e), r = `${e.clientWidth}:${n.fontSize}:${n.lineHeight}`;
|
|
52
|
+
r !== t && (t = r, Q());
|
|
53
|
+
});
|
|
54
|
+
return n.observe(e), () => n.disconnect();
|
|
55
|
+
}, [O, Q]);
|
|
56
|
+
let $ = C((e) => {
|
|
57
|
+
let t = e.target.value;
|
|
58
|
+
X(t) || (Y(t), j?.(e), O && setTimeout(Q, 0));
|
|
59
|
+
}, [
|
|
60
|
+
j,
|
|
61
|
+
Y,
|
|
62
|
+
X,
|
|
63
|
+
O,
|
|
64
|
+
Q
|
|
65
|
+
]), ne = C(() => {
|
|
66
|
+
I.disabled || I.readOnly || b || (R.current && g(R.current), _?.(), R.current?.focus());
|
|
67
|
+
}, [
|
|
68
|
+
I.disabled,
|
|
69
|
+
I.readOnly,
|
|
70
|
+
b,
|
|
71
|
+
_
|
|
72
|
+
]), re = p && J && !b && !q;
|
|
73
|
+
return /* @__PURE__ */ D("div", {
|
|
74
|
+
className: n("textarea--component", "relative w-full"),
|
|
75
|
+
children: [
|
|
76
|
+
/* @__PURE__ */ E("textarea", {
|
|
77
|
+
ref: (e) => {
|
|
78
|
+
typeof L == "function" ? L(e) : L && (L.current = e), R.current = e;
|
|
79
|
+
},
|
|
80
|
+
id: H,
|
|
81
|
+
...!W && { value: U },
|
|
82
|
+
onChange: $,
|
|
83
|
+
maxLength: u,
|
|
84
|
+
"aria-invalid": Z || void 0,
|
|
85
|
+
rows: k,
|
|
86
|
+
style: {
|
|
87
|
+
resize: O ? "none" : I.style?.resize,
|
|
88
|
+
overflow: O && A ? "auto" : "visible",
|
|
89
|
+
...I.style
|
|
90
|
+
},
|
|
91
|
+
className: n("placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground", "border-input box-border flex w-full rounded-inner border bg-transparent px-control", l[V], "transition-[color,box-shadow] outline-none", "disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50", "[&:read-only:not(:disabled)]:bg-muted", m[V], c[V], o.focus, o.invalid, re && s.clearPadding[V], q && s.textareaCountPadding, i),
|
|
92
|
+
...I,
|
|
93
|
+
disabled: I.disabled || b
|
|
94
|
+
}),
|
|
95
|
+
!!q && /* @__PURE__ */ E("div", {
|
|
96
|
+
className: n("pointer-events-none absolute bottom-control-y-offset text-xs tabular-nums", r.clearEnd.md, I.disabled && "opacity-50", Z ? "text-destructive" : "text-muted-foreground"),
|
|
97
|
+
"aria-live": "polite",
|
|
98
|
+
role: "status",
|
|
99
|
+
children: /* @__PURE__ */ D(a, {
|
|
100
|
+
tag: "span",
|
|
101
|
+
size: "xs",
|
|
102
|
+
type: Z ? "error" : "secondary",
|
|
103
|
+
children: [G, K ? `/${u}` : ""]
|
|
104
|
+
})
|
|
105
|
+
}),
|
|
106
|
+
!!b && !q && /* @__PURE__ */ E("div", {
|
|
107
|
+
className: n("pointer-events-none absolute end-[calc(var(--control-x)*var(--space-scale))]", d.icon[V], Z ? "text-destructive" : "text-muted-foreground"),
|
|
108
|
+
children: /* @__PURE__ */ E(ee, {
|
|
109
|
+
className: "size-icon animate-spin",
|
|
110
|
+
"aria-hidden": "true"
|
|
111
|
+
})
|
|
112
|
+
}),
|
|
113
|
+
!!re && !q && /* @__PURE__ */ E(y, {
|
|
114
|
+
className: n("absolute", d.target[V], s.clearEnd[V]),
|
|
115
|
+
"aria-label": z.clear,
|
|
116
|
+
onClick: ne,
|
|
117
|
+
disabled: I.disabled || I.readOnly || b
|
|
118
|
+
})
|
|
119
|
+
]
|
|
120
|
+
});
|
|
121
|
+
});
|
|
122
|
+
j.displayName = "Textarea";
|
|
123
|
+
//#endregion
|
|
124
|
+
//#region src/components/ui/textarea.tsx
|
|
125
|
+
function M({ className: e, ...t }) {
|
|
126
|
+
return /* @__PURE__ */ E("textarea", {
|
|
127
|
+
"data-slot": "textarea",
|
|
128
|
+
className: n("border-input rounded-inner border bg-transparent px-control py-space-md shadow-none transition-[color,box-shadow] placeholder:text-muted-foreground flex field-sizing-content min-h-textarea w-full outline-none disabled:cursor-not-allowed disabled:opacity-50 [&:read-only:not(:disabled)]:bg-muted", c.md, o.focus, o.invalid, e),
|
|
129
|
+
...t
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
//#endregion
|
|
133
|
+
//#region src/components/ui/input-group.tsx
|
|
134
|
+
function N({ className: e, ...t }) {
|
|
135
|
+
return /* @__PURE__ */ E("div", {
|
|
136
|
+
"data-slot": "input-group",
|
|
137
|
+
role: "group",
|
|
138
|
+
className: n("border-input h-control rounded-inner border shadow-none transition-[color,box-shadow] has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>[data-align=block-end]]:[&>input]:pt-space-lg has-[>[data-align=block-start]]:[&>input]:pb-space-lg has-[>[data-align=inline-end]]:[&>input]:pe-space-sm has-[>[data-align=inline-start]]:[&>input]:ps-space-sm [[data-slot=combobox-content]_&]:focus-within:border-inherit [[data-slot=combobox-content]_&]:focus-within:ring-0 group/input-group relative flex w-full min-w-0 items-center outline-none has-[>textarea]:h-auto", o.groupFocus, o.groupInvalid, e),
|
|
139
|
+
...t
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
var P = A("text-muted-foreground h-auto gap-space-md py-space-sm text-sm font-medium group-data-[disabled=true]/input-group:opacity-50 [&>kbd]:rounded-inner [&>svg:not([class*='size-'])]:size-icon flex cursor-text items-center justify-center select-none", {
|
|
143
|
+
variants: { align: {
|
|
144
|
+
"inline-start": "ps-control has-[>button]:-ms-space-xs has-[>kbd]:-ms-space-2xs order-first",
|
|
145
|
+
"inline-end": "pe-control has-[>button]:-me-space-xs has-[>kbd]:-me-space-2xs order-last",
|
|
146
|
+
"block-start": "px-control pt-space-md group-has-[>input]/input-group:pt-space-md [.border-b]:pb-space-md order-first w-full justify-start",
|
|
147
|
+
"block-end": "px-control pb-space-md group-has-[>input]/input-group:pb-space-md [.border-t]:pt-space-md order-last w-full justify-start"
|
|
148
|
+
} },
|
|
149
|
+
defaultVariants: { align: "inline-start" }
|
|
150
|
+
});
|
|
151
|
+
function F({ className: e, align: t = "inline-start", ...r }) {
|
|
152
|
+
return /* @__PURE__ */ E("div", {
|
|
153
|
+
role: "group",
|
|
154
|
+
"data-slot": "input-group-addon",
|
|
155
|
+
"data-align": t,
|
|
156
|
+
className: n(P({ align: t }), e),
|
|
157
|
+
onClick: (e) => {
|
|
158
|
+
e.target.closest("button") || e.currentTarget.parentElement?.querySelector("input")?.focus();
|
|
159
|
+
},
|
|
160
|
+
...r
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
A("gap-space-md text-sm shadow-none flex items-center", {
|
|
164
|
+
variants: { size: {
|
|
165
|
+
xs: "h-action-xs gap-space-xs rounded-inner px-control-xs [&>svg:not([class*='size-'])]:size-icon-sm",
|
|
166
|
+
sm: "",
|
|
167
|
+
"icon-xs": "size-action-xs rounded-inner p-0 has-[>svg]:p-0",
|
|
168
|
+
"icon-sm": "size-action-sm p-0 has-[>svg]:p-0"
|
|
169
|
+
} },
|
|
170
|
+
defaultVariants: { size: "xs" }
|
|
171
|
+
});
|
|
172
|
+
function I({ className: e, ...t }) {
|
|
173
|
+
return /* @__PURE__ */ E("span", {
|
|
174
|
+
className: n("text-muted-foreground gap-space-md text-sm [&_svg:not([class*='size-'])]:size-icon flex items-center [&_svg]:pointer-events-none", e),
|
|
175
|
+
...t
|
|
176
|
+
});
|
|
177
|
+
}
|
|
178
|
+
function L({ className: e, ...t }) {
|
|
179
|
+
return /* @__PURE__ */ E(x, {
|
|
180
|
+
"data-slot": "input-group-control",
|
|
181
|
+
className: n("rounded-none border-0 bg-transparent shadow-none ring-0 focus-visible:ring-0 aria-invalid:ring-0 flex-1", e),
|
|
182
|
+
...t
|
|
183
|
+
});
|
|
184
|
+
}
|
|
185
|
+
function R({ className: e, ...t }) {
|
|
186
|
+
return /* @__PURE__ */ E(M, {
|
|
187
|
+
"data-slot": "input-group-control",
|
|
188
|
+
className: n("rounded-none border-0 bg-transparent py-space-md shadow-none ring-0 focus-visible:ring-0 aria-invalid:ring-0 flex-1 resize-none", e),
|
|
189
|
+
...t
|
|
190
|
+
});
|
|
191
|
+
}
|
|
192
|
+
//#endregion
|
|
193
|
+
//#region src/components/base/text-inputs/input-group.tsx
|
|
194
|
+
function z() {
|
|
195
|
+
let { defaultScale: t } = e();
|
|
196
|
+
return h(void 0, t);
|
|
197
|
+
}
|
|
198
|
+
function B({ className: e, ...t }) {
|
|
199
|
+
let r = z();
|
|
200
|
+
return /* @__PURE__ */ E(N, {
|
|
201
|
+
className: n("input-group--component box-border rounded-inner font-sans text-foreground shadow-none", u[r], c[r], "has-[>[data-align=block-end]]:[&>input]:pt-space-lg has-[>[data-align=block-start]]:[&>input]:pb-space-lg", "has-[>[data-align=inline-end]]:[&>input]:pe-space-sm has-[>[data-align=inline-start]]:[&>input]:ps-space-sm", e),
|
|
202
|
+
...t
|
|
203
|
+
});
|
|
204
|
+
}
|
|
205
|
+
var V = {
|
|
206
|
+
"inline-start": "h-full py-0",
|
|
207
|
+
"inline-end": "h-full py-0",
|
|
208
|
+
"block-start": "pt-space-md group-has-[>input]/input-group:pt-space-md [.border-b]:pb-space-md",
|
|
209
|
+
"block-end": "pb-space-md group-has-[>input]/input-group:pb-space-md [.border-t]:pt-space-md"
|
|
210
|
+
}, H = {
|
|
211
|
+
sm: {
|
|
212
|
+
"inline-start": "ps-control-sm",
|
|
213
|
+
"inline-end": "pe-control-sm"
|
|
214
|
+
},
|
|
215
|
+
md: {
|
|
216
|
+
"inline-start": "ps-control",
|
|
217
|
+
"inline-end": "pe-control"
|
|
218
|
+
},
|
|
219
|
+
lg: {
|
|
220
|
+
"inline-start": "ps-control",
|
|
221
|
+
"inline-end": "pe-control"
|
|
222
|
+
}
|
|
223
|
+
}, U = {
|
|
224
|
+
sm: "[&>svg:not([class*='size-'])]:size-icon-sm",
|
|
225
|
+
md: "[&>svg:not([class*='size-'])]:size-icon",
|
|
226
|
+
lg: "[&>svg:not([class*='size-'])]:size-icon-lg"
|
|
227
|
+
};
|
|
228
|
+
function W({ className: e, align: t = "inline-start", ...r }) {
|
|
229
|
+
let i = z(), a = t ?? "inline-start";
|
|
230
|
+
return /* @__PURE__ */ E(F, {
|
|
231
|
+
align: t,
|
|
232
|
+
className: n("input-group-addon--component box-border gap-space-md py-space-sm", U[i], V[a], a === "inline-start" || a === "inline-end" ? H[i][a] : f[i], e),
|
|
233
|
+
...r
|
|
234
|
+
});
|
|
235
|
+
}
|
|
236
|
+
function G({ className: e, tone: t = "secondary", buttonStyle: r = "ghost", truncate: a = !0, iconOnly: o, ...s }) {
|
|
237
|
+
return /* @__PURE__ */ E(i, {
|
|
238
|
+
tone: t,
|
|
239
|
+
buttonStyle: r,
|
|
240
|
+
truncate: a,
|
|
241
|
+
iconOnly: o,
|
|
242
|
+
className: n("input-group-button--component max-h-full shadow-none", o ? "in-[[data-align=inline-start]]:w-auto in-[[data-align=inline-start]]:aspect-square in-[[data-align=inline-end]]:w-auto in-[[data-align=inline-end]]:aspect-square" : "in-[[data-align=inline-start]]:h-full in-[[data-align=inline-start]]:min-h-0 in-[[data-align=inline-end]]:h-full in-[[data-align=inline-end]]:min-h-0", e),
|
|
243
|
+
...s
|
|
244
|
+
});
|
|
245
|
+
}
|
|
246
|
+
function K(e) {
|
|
247
|
+
return typeof e == "string" || typeof e == "number" || typeof e == "bigint";
|
|
248
|
+
}
|
|
249
|
+
function q({ children: e, className: t, ...r }) {
|
|
250
|
+
return /* @__PURE__ */ E(I, {
|
|
251
|
+
className: n("input-group-text--component gap-space-md [&_svg:not([class*='size-'])]:size-icon", t),
|
|
252
|
+
...r,
|
|
253
|
+
children: K(e) ? /* @__PURE__ */ E(a, {
|
|
254
|
+
tag: "span",
|
|
255
|
+
size: "inherit",
|
|
256
|
+
lineHeight: "tight",
|
|
257
|
+
className: "text-inherit",
|
|
258
|
+
children: e
|
|
259
|
+
}) : e
|
|
260
|
+
});
|
|
261
|
+
}
|
|
262
|
+
function J({ className: e, ...t }) {
|
|
263
|
+
let r = z();
|
|
264
|
+
return /* @__PURE__ */ E(L, {
|
|
265
|
+
className: n("input-group-input--component box-border max-h-full font-sans text-foreground", u[r], "min-h-lh", p[r], c[r], e),
|
|
266
|
+
...t
|
|
267
|
+
});
|
|
268
|
+
}
|
|
269
|
+
function Y({ className: e, ...t }) {
|
|
270
|
+
let r = z();
|
|
271
|
+
return /* @__PURE__ */ E(R, {
|
|
272
|
+
className: n("input-group-textarea--component box-border py-space-md", m[r], f[r], c[r], e),
|
|
273
|
+
...t
|
|
274
|
+
});
|
|
275
|
+
}
|
|
276
|
+
//#endregion
|
|
277
|
+
//#region src/components/base/text-inputs/password-input.tsx
|
|
278
|
+
var X = {
|
|
279
|
+
showPassword: "Show password",
|
|
280
|
+
hidePassword: "Hide password"
|
|
281
|
+
}, Z = S.forwardRef(function({ visible: e, defaultVisible: r = !1, onVisibleChange: i, revealable: a = !0, wrapperClassName: o, visibilityButtonClassName: c, className: l, disabled: u, loading: d, inputStrings: f, strings: p, ...m }, h) {
|
|
282
|
+
let g = t(X, p), [v, y] = S.useState(r), x = e !== void 0, C = x ? e : v, w = u || d, T = S.useCallback(() => {
|
|
283
|
+
let e = !C;
|
|
284
|
+
x || y(e), i?.(e);
|
|
285
|
+
}, [
|
|
286
|
+
x,
|
|
287
|
+
C,
|
|
288
|
+
i
|
|
289
|
+
]), D = a ? /* @__PURE__ */ E("button", {
|
|
290
|
+
type: "button",
|
|
291
|
+
className: n("password-input--toggle", s.target, s.focus, s.toggle, c),
|
|
292
|
+
"aria-label": C ? g.hidePassword : g.showPassword,
|
|
293
|
+
"aria-pressed": C,
|
|
294
|
+
disabled: w,
|
|
295
|
+
onMouseDown: (e) => e.preventDefault(),
|
|
296
|
+
onClick: T,
|
|
297
|
+
children: E(C ? k : O, {
|
|
298
|
+
className: s.icon,
|
|
299
|
+
"aria-hidden": "true"
|
|
300
|
+
})
|
|
301
|
+
}) : null;
|
|
302
|
+
return /* @__PURE__ */ E("div", {
|
|
303
|
+
className: n("password-input--component", "relative", o),
|
|
304
|
+
children: /* @__PURE__ */ E(_.Provider, {
|
|
305
|
+
value: D,
|
|
306
|
+
children: /* @__PURE__ */ E(b, {
|
|
307
|
+
...m,
|
|
308
|
+
ref: h,
|
|
309
|
+
type: C ? "text" : "password",
|
|
310
|
+
disabled: u,
|
|
311
|
+
loading: d,
|
|
312
|
+
className: l,
|
|
313
|
+
strings: f
|
|
314
|
+
})
|
|
315
|
+
})
|
|
316
|
+
});
|
|
317
|
+
});
|
|
318
|
+
Z.displayName = "PasswordInput";
|
|
319
|
+
//#endregion
|
|
320
|
+
//#region src/components/base/text-inputs/slug-field.tsx
|
|
321
|
+
function Q(e, { separator: t = "-", lowercase: n = !0, trim: r = !0 } = {}) {
|
|
322
|
+
let i = t || "-", a = i.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), o = String(e ?? "").normalize("NFKD").replace(/[\u0300-\u036f]/g, "").replace(/&/g, " and ").replace(/['’]/g, "");
|
|
323
|
+
return n && (o = o.toLowerCase()), o = o.replace(/[^\p{Letter}\p{Number}]+/gu, i).replace(RegExp(`${a}{2,}`, "g"), i), r && (o = o.replace(RegExp(`^${a}|${a}$`, "g"), "")), o;
|
|
324
|
+
}
|
|
325
|
+
var $ = S.forwardRef(function({ value: e, slugify: t, separator: r = "-", lowercase: i = !0, trim: a = !0, wrapperClassName: o, className: s, ...c }, l) {
|
|
326
|
+
let u = S.useMemo(() => t?.(e) ?? Q(e, {
|
|
327
|
+
separator: r,
|
|
328
|
+
lowercase: i,
|
|
329
|
+
trim: a
|
|
330
|
+
}), [
|
|
331
|
+
i,
|
|
332
|
+
r,
|
|
333
|
+
t,
|
|
334
|
+
a,
|
|
335
|
+
e
|
|
336
|
+
]);
|
|
337
|
+
return /* @__PURE__ */ E("div", {
|
|
338
|
+
className: n("slug-field--component", o),
|
|
339
|
+
children: /* @__PURE__ */ E(b, {
|
|
340
|
+
ref: l,
|
|
341
|
+
...c,
|
|
342
|
+
type: "text",
|
|
343
|
+
value: u,
|
|
344
|
+
readOnly: !0,
|
|
345
|
+
className: s
|
|
346
|
+
})
|
|
347
|
+
});
|
|
348
|
+
});
|
|
349
|
+
$.displayName = "SlugField";
|
|
350
|
+
//#endregion
|
|
351
|
+
export { B as a, J as c, j as d, X as i, q as l, Q as n, W as o, Z as r, G as s, $ as t, Y as u };
|
|
352
|
+
|
|
353
|
+
//# sourceMappingURL=text-inputs-f9Ia-aCi.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"text-inputs-f9Ia-aCi.js","names":["Textarea","React","InputGroup","InputGroupAddon","InputGroupText","InputGroupInput","Input","InputGroupTextarea","InputGroupPrimitive","InputGroupAddonPrimitive","InputGroupTextPrimitive","InputGroupInputPrimitive","InputGroupTextareaPrimitive","React","React","useDensityConfig","cn","affordanceGeometry","Button","Text","fieldStateRecipes","fieldAffordanceRecipes","editableTextSizeClasses","formTextareaInsetClasses","formControlHeightClasses","formTextareaAffordanceTopClasses","formControlHorizontalPaddingClasses","formControlPaddingClasses","formTextareaSizeClasses","resolveFormControlSize","clearNativeField","InputTrailingActionContext","useFormFieldState","FieldClearButton","Input","Input$1","React$1","defaultTextareaStrings","Textarea$1","sizeProp","controlledValue","providedId","stringsProp","props","textareaRef","useRef","strings","useStrings","size","defaultScale","textareaValue","onChange","hasError","invalid","adjustHeight","useCallback","autoResize","textarea","css","lineHeight","padding","border","minHeight","minRows","maxHeight","maxRows","newHeight","useEffect","previous","observer","signature","handleTextareaChange","newValue","wouldExceedLimit","updateValue","handleClear","loading","onClear","showClearButton","clearable","hasValue","showCount","forwardedRef","node","isReactHookForm","className","characterCount","hasCharacterLimit","maxLength","Loader2Icon","Textarea","InputGroup$1","inputGroupAddonVariants","cva","InputGroupAddon$1","align","InputGroupText$1","InputGroupInput$1","InputGroupTextarea$1","useInputGroupScale","InputGroup","addonAlignmentClasses","addonInlinePaddingClasses","addonIconClasses","InputGroupAddon","alignment","InputGroupButton","iconOnly","isScalarContent","content","InputGroupText","children","InputGroupInput","InputGroupTextarea","defaultPasswordInputStrings","PasswordInput","internalVisible","setInternalVisible","defaultVisible","isControlled","visible","isVisible","disabledState","disabled","toggleVisibility","nextVisible","onVisibleChange","visibilityAction","revealable","visibilityButtonClassName","event","jsx","EyeOff","Eye","wrapperClassName","inputStrings","slugifyValue","safeSeparator","separator","escapedSeparator","normalized","value","lowercase","trim","SlugField","slug","slugify"],"sources":["../src/components/base/text-inputs/textarea.tsx","../src/components/ui/textarea.tsx","../src/components/ui/input-group.tsx","../src/components/base/text-inputs/input-group.tsx","../src/components/base/text-inputs/password-input.tsx","../src/components/base/text-inputs/slug-field.tsx"],"sourcesContent":["import { fieldStateRecipes } from '../../../lib/field-state-recipes';\nimport { affordanceGeometry } from '../../../lib/affordance-geometry.generated';\nimport { fieldAffordanceRecipes } from '../../../lib/field-affordance-recipes';\nimport { editableTextSizeClasses } from '../../../lib/editable-text-recipe';\nimport { Loader2Icon } from 'lucide-react';\nimport * as React from 'react';\nimport { useRef, useCallback, useEffect } from 'react';\nimport { Text } from '../../typography';\nimport { useDensityConfig, type FormControlSize } from '../../../lib/ui-provider';\nimport { useStrings, type StringsProp } from '../../../lib/strings';\nimport { cn } from '../../../lib/utils';\nimport { formTextareaAffordanceTopClasses, formTextareaInsetClasses, formTextareaSizeClasses, resolveFormControlSize } from '../forms/form-sizing';\nimport { useFormFieldState } from './hooks';\nimport { clearNativeField } from './clear-native-field';\nimport { FieldClearButton } from './field-clear-button';\n\nexport interface TextareaStrings {\n\t\tclear: string;\n}\n\nexport const defaultTextareaStrings: TextareaStrings = {\n\t\tclear: 'Clear textarea',\n};\n\nexport interface TextareaProps extends Omit<React.ComponentProps<'textarea'>, 'onChange'> {\n\t\t// String overrides (e.g. clear button aria-label)\n\t\t/** Overrides the character-count and clear copy. */\n\t\tstrings?: StringsProp<TextareaStrings>;\n\t\t// Character limit\n\t\t/** Character cap, also used as the denominator of the count. */\n\t\tmaxLength?: number;\n\t\t/** Shows the current and maximum character count. */\n\t\tshowCharacterCount?: boolean;\n\n\t\t// Clear button\n\t\t/** Shows an inline clear action when the field has a value. */\n\t\tclearable?: boolean;\n\t\tonClear?: () => void;\n\n\t\t// Loading state\n\t\t/** Replaces the trailing affordance with a loading indicator. */\n\t\tloading?: boolean;\n\n\t\t// Error state for styling (passed from FormField)\n\t\t/** Applies the invalid styling. Validation copy stays with FormField. */\n\t\tinvalid?: boolean;\n\n\t\t// Visual size\n\t\t/** Control density. Falls back to `UIProvider.density.defaultScale`. */\n\t\tsize?: FormControlSize;\n\n\t\t// Auto-resize functionality\n\t\t/** Grows the field with its content, between `minRows` and `maxRows`. */\n\t\tautoResize?: boolean;\n\t\t/** Smallest height, in rows, when `autoResize` is set. */\n\t\tminRows?: number;\n\t\t/** Height at which the field stops growing and starts scrolling. */\n\t\tmaxRows?: number;\n\n\t\t// Value props\n\t\tonChange?: (e: React.ChangeEvent<HTMLTextAreaElement>) => void;\n\t\t/** Current text. Controlled. */\n\t\tvalue?: string;\n\t\t/** Initial text for uncontrolled use. */\n\t\tdefaultValue?: string;\n}\n\nconst TextareaImpl = (\n\t\t{\n\t\t\t\tclassName,\n\t\t\t\tmaxLength,\n\t\t\t\tshowCharacterCount,\n\t\t\t\tclearable,\n\t\t\t\tonClear,\n\t\t\t\tloading = false,\n\t\t\t\tinvalid,\n\t\t\t\tsize: sizeProp,\n\t\t\t\tautoResize = false,\n\t\t\t\tminRows = 2,\n\t\t\t\tmaxRows,\n\t\t\t\tonChange,\n\t\t\t\tvalue: controlledValue,\n\t\t\t\tdefaultValue,\n\t\t\t\tid: providedId,\n\t\t\t\tstrings: stringsProp,\n\t\t\t\t...props\n\t\t}: TextareaProps,\n\t\tforwardedRef: React.ForwardedRef<HTMLTextAreaElement>,\n) => {\n\t\tconst textareaRef = useRef<HTMLTextAreaElement>(null);\n\t\tconst strings = useStrings(defaultTextareaStrings, stringsProp);\n\t\tconst { defaultScale } = useDensityConfig();\n\t\tconst size = resolveFormControlSize(sizeProp, defaultScale);\n\n\t\t// Use shared form field state hook\n\t\tconst {\n\t\t\t\tid,\n\t\t\t\tvalue: textareaValue,\n\t\t\t\tisReactHookForm,\n\t\t\t\tcharacterCount,\n\t\t\t\thasCharacterLimit,\n\t\t\t\tshowCount,\n\t\t\t\thasValue,\n\t\t\t\tupdateValue,\n\t\t\t\twouldExceedLimit,\n\t\t} = useFormFieldState({\n\t\t\t\tcontrolledValue,\n\t\t\t\tdefaultValue,\n\t\t\t\tmaxLength,\n\t\t\t\tshowCharacterCount,\n\t\t\t\tprovidedId,\n\t\t\t\tidPrefix: 'textarea',\n\t\t\t\thasOnChange: onChange !== undefined,\n\t\t});\n\n\t\t// Derive display states\n\t\tconst hasError = Boolean(invalid);\n\n\t\tconst adjustHeight = useCallback(() => {\n\t\t\t\tif (!autoResize || !textareaRef.current) return;\n\n\t\t\t\tconst textarea = textareaRef.current;\n\n\t\t\t\tconst css = getComputedStyle(textarea);\n\t\t\t\tconst lineHeight = Number.parseFloat(css.lineHeight) || 20;\n\t\t\t\tconst padding = (Number.parseFloat(css.paddingTop) || 0) + (Number.parseFloat(css.paddingBottom) || 0);\n\t\t\t\tconst border = css.boxSizing === 'border-box' ? (Number.parseFloat(css.borderTopWidth) || 0) + (Number.parseFloat(css.borderBottomWidth) || 0) : 0;\n\t\t\t\ttextarea.style.height = 'auto';\n\t\t\t\tconst minHeight = lineHeight * minRows + padding + border;\n\t\t\t\tconst maxHeight = maxRows ? lineHeight * maxRows + padding + border : Infinity;\n\n\t\t\t\tconst newHeight = Math.min(Math.max(textarea.scrollHeight + border, minHeight), maxHeight);\n\t\t\t\ttextarea.style.height = `${newHeight}px`;\n\t\t}, [autoResize, maxRows, minRows]);\n\n\t\tuseEffect(() => {\n\t\t\t\tadjustHeight();\n\t\t}, [textareaValue, props.placeholder, autoResize, adjustHeight]);\n\n\t\tuseEffect(() => {\n\t\t\t\tconst textarea = textareaRef.current;\n\t\t\t\tif (!autoResize || !textarea || typeof ResizeObserver === 'undefined') return;\n\t\t\t\tlet previous = '';\n\t\t\t\tconst observer = new ResizeObserver(() => {\n\t\t\t\t\t\tconst css = getComputedStyle(textarea);\n\t\t\t\t\t\tconst signature = `${textarea.clientWidth}:${css.fontSize}:${css.lineHeight}`;\n\t\t\t\t\t\tif (signature === previous) return;\n\t\t\t\t\t\tprevious = signature;\n\t\t\t\t\t\tadjustHeight();\n\t\t\t\t});\n\t\t\t\tobserver.observe(textarea);\n\t\t\t\treturn () => observer.disconnect();\n\t\t}, [autoResize, adjustHeight]);\n\n\t\tconst handleTextareaChange = useCallback(\n\t\t\t\t(e: React.ChangeEvent<HTMLTextAreaElement>) => {\n\t\t\t\t\t\tconst newValue = e.target.value;\n\n\t\t\t\t\t\t// Check character limit\n\t\t\t\t\t\tif (wouldExceedLimit(newValue)) {\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Update internal state if uncontrolled\n\t\t\t\t\t\tupdateValue(newValue);\n\n\t\t\t\t\t\t// Call external onChange\n\t\t\t\t\t\tonChange?.(e);\n\n\t\t\t\t\t\t// Auto-resize if enabled\n\t\t\t\t\t\tif (autoResize) {\n\t\t\t\t\t\t\t\tsetTimeout(adjustHeight, 0);\n\t\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t[onChange, updateValue, wouldExceedLimit, autoResize, adjustHeight]\n\t\t);\n\n\t\tconst handleClear = useCallback(() => {\n\t\t\t\tif (props.disabled || props.readOnly || loading) return;\n\n\t\t\t\tif (textareaRef.current) clearNativeField(textareaRef.current);\n\n\t\t\t\t// Execute optional onClear callback\n\t\t\t\tonClear?.();\n\n\t\t\t\t// Focus the textarea after clearing\n\t\t\t\ttextareaRef.current?.focus();\n\n\t\t}, [props.disabled, props.readOnly, loading, onClear]);\n\n\t\t// Determine what to show in the end position\n\t\tconst showClearButton = clearable && hasValue && !loading && !showCount;\n\n\t\treturn (\n\t\t\t\t<div className={cn('textarea--component', 'relative w-full')}>\n\t\t\t\t\t\t<textarea\n\t\t\t\t\t\t\t\tref={(node) => {\n\t\t\t\t\t\t\t\t\t\tif (typeof forwardedRef === 'function') {\n\t\t\t\t\t\t\t\t\t\t\t\tforwardedRef(node);\n\t\t\t\t\t\t\t\t\t\t} else if (forwardedRef) {\n\t\t\t\t\t\t\t\t\t\t\t\tforwardedRef.current = node;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\ttextareaRef.current = node;\n\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\tid={id}\n\t\t\t\t\t\t\t\t{...(!isReactHookForm && { value: textareaValue })}\n\t\t\t\t\t\t\t\tonChange={handleTextareaChange}\n\t\t\t\t\t\t\t\tmaxLength={maxLength}\n\t\t\t\t\t\t\t\taria-invalid={hasError || undefined}\n\t\t\t\t\t\t\t\trows={minRows}\n\t\t\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\t\t\t\tresize: autoResize ? 'none' : props.style?.resize,\n\t\t\t\t\t\t\t\t\t\toverflow: autoResize && maxRows ? 'auto' : 'visible',\n\t\t\t\t\t\t\t\t\t\t...props.style,\n\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t\t\t\t\t// Base styles\n\t\t\t\t\t\t\t\t\t\t'placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground',\n\t\t\t\t\t\t\t\t\t\t'border-input box-border flex w-full rounded-inner border bg-transparent px-control',\n\t\t\t\t\t\t\t\t\t\t// First line where a single-line control of this size draws its value.\n\t\t\t\t\t\t\t\t\t\tformTextareaInsetClasses[size],\n\t\t\t\t\t\t\t\t\t\t'transition-[color,box-shadow] outline-none',\n\t\t\t\t\t\t\t\t\t\t'disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50',\n\t\t\t\t\t\t\t\t\t\t// Same read-only fill as Input; disabled stays on the transparent fill.\n\t\t\t\t\t\t\t\t\t\t'[&:read-only:not(:disabled)]:bg-muted',\n\t\t\t\t\t\t\t\t\t\tformTextareaSizeClasses[size],\n\t\t\t\t\t\t\t\t\t\teditableTextSizeClasses[size],\n\t\t\t\t\t\t\t\t\t\t// Focus styles\n\t\t\t\t\t\t\t\t\t\tfieldStateRecipes.focus,\n\t\t\t\t\t\t\t\t\t\t// Invalid/error styles\n\t\t\t\t\t\t\t\t\t\tfieldStateRecipes.invalid,\n\t\t\t\t\t\t\t\t\t\t// Dynamic padding for overlays\n\t\t\t\t\t\t\t\t\t\tshowClearButton && fieldAffordanceRecipes.clearPadding[size],\n\t\t\t\t\t\t\t\t\t\tshowCount && fieldAffordanceRecipes.textareaCountPadding,\n\t\t\t\t\t\t\t\t\t\tclassName\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t{...props}\n\t\t\t\t\t\t\t\tdisabled={props.disabled || loading}\n\t\t\t\t\t\t/>\n\n\t\t\t\t\t\t{/* Character Count */}\n\t\t\t\t\t\t{!!showCount && (\n\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t\t\t\t\t\t\t'pointer-events-none absolute bottom-control-y-offset text-xs tabular-nums',\n\t\t\t\t\t\t\t\t\t\t\t\taffordanceGeometry.clearEnd.md,\n\t\t\t\t\t\t\t\t\t\t\t\tprops.disabled && 'opacity-50',\n\t\t\t\t\t\t\t\t\t\t\t\thasError ? 'text-destructive' : 'text-muted-foreground'\n\t\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\t\taria-live=\"polite\"\n\t\t\t\t\t\t\t\t\t\trole=\"status\"\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t<Text tag=\"span\" size=\"xs\" type={hasError ? 'error' : 'secondary'}>\n\t\t\t\t\t\t\t\t\t\t\t\t{characterCount}\n\t\t\t\t\t\t\t\t\t\t\t\t{hasCharacterLimit ? `/${maxLength}` : ''}\n\t\t\t\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t)}\n\n\t\t\t\t\t\t{/* Loading Spinner */}\n\t\t\t\t\t\t{!!loading && !showCount && (\n\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t\t\t\t\t\t\t'pointer-events-none absolute end-[calc(var(--control-x)*var(--space-scale))]',\n\t\t\t\t\t\t\t\t\t\t\t\tformTextareaAffordanceTopClasses.icon[size],\n\t\t\t\t\t\t\t\t\t\t\t\thasError ? 'text-destructive' : 'text-muted-foreground'\n\t\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t<Loader2Icon className=\"size-icon animate-spin\" aria-hidden=\"true\" />\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t)}\n\n\t\t\t\t\t\t{/* Clear Button */}\n\t\t\t\t\t\t{!!showClearButton && !showCount && (\n\t\t\t\t\t\t\t\t<FieldClearButton\n\t\t\t\t\t\t\t\t\t\tclassName={cn('absolute', formTextareaAffordanceTopClasses.target[size], fieldAffordanceRecipes.clearEnd[size])}\n\t\t\t\t\t\t\t\t\t\taria-label={strings.clear}\n\t\t\t\t\t\t\t\t\t\tonClick={handleClear}\n\t\t\t\t\t\t\t\t\t\tdisabled={props.disabled || props.readOnly || loading}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t)}\n\t\t\t\t</div>\n\t\t);\n};\n\nconst Textarea = React.forwardRef<HTMLTextAreaElement, TextareaProps>(TextareaImpl);\nTextarea.displayName = 'Textarea';\n\nexport { Textarea };\n","import { fieldStateRecipes } from '../../lib/field-state-recipes';\nimport { editableTextSizeClasses } from '../../lib/editable-text-recipe';\nimport * as React from \"react\"\n\nimport { cn } from \"../../lib/utils\"\n\nfunction Textarea({ className, ...props }: React.ComponentProps<\"textarea\">) {\n return (\n <textarea\n data-slot=\"textarea\"\n className={cn(\n \"border-input rounded-inner border bg-transparent px-control py-space-md shadow-none transition-[color,box-shadow] placeholder:text-muted-foreground flex field-sizing-content min-h-textarea w-full outline-none disabled:cursor-not-allowed disabled:opacity-50 [&:read-only:not(:disabled)]:bg-muted\",\n editableTextSizeClasses.md,\n fieldStateRecipes.focus,\n fieldStateRecipes.invalid,\n className\n )}\n {...props}\n />\n )\n}\n\nexport { Textarea }\n","import { fieldStateRecipes } from '../../lib/field-state-recipes';\nimport { cva, type VariantProps } from \"class-variance-authority\"\nimport * as React from \"react\"\n\nimport { Button } from \"./button\"\nimport { Input } from \"./input\"\nimport { Textarea } from \"./textarea\"\nimport { cn } from \"../../lib/utils\"\n\nfunction InputGroup({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"input-group\"\n role=\"group\"\n className={cn(\n \"border-input h-control rounded-inner border shadow-none transition-[color,box-shadow] has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>[data-align=block-end]]:[&>input]:pt-space-lg has-[>[data-align=block-start]]:[&>input]:pb-space-lg has-[>[data-align=inline-end]]:[&>input]:pe-space-sm has-[>[data-align=inline-start]]:[&>input]:ps-space-sm [[data-slot=combobox-content]_&]:focus-within:border-inherit [[data-slot=combobox-content]_&]:focus-within:ring-0 group/input-group relative flex w-full min-w-0 items-center outline-none has-[>textarea]:h-auto\",\n fieldStateRecipes.groupFocus,\n fieldStateRecipes.groupInvalid,\n className\n )}\n {...props}\n />\n )\n}\n\nconst inputGroupAddonVariants = cva(\n \"text-muted-foreground h-auto gap-space-md py-space-sm text-sm font-medium group-data-[disabled=true]/input-group:opacity-50 [&>kbd]:rounded-inner [&>svg:not([class*='size-'])]:size-icon flex cursor-text items-center justify-center select-none\",\n {\n variants: {\n align: {\n \"inline-start\": \"ps-control has-[>button]:-ms-space-xs has-[>kbd]:-ms-space-2xs order-first\",\n \"inline-end\": \"pe-control has-[>button]:-me-space-xs has-[>kbd]:-me-space-2xs order-last\",\n \"block-start\":\n \"px-control pt-space-md group-has-[>input]/input-group:pt-space-md [.border-b]:pb-space-md order-first w-full justify-start\",\n \"block-end\":\n \"px-control pb-space-md group-has-[>input]/input-group:pb-space-md [.border-t]:pt-space-md order-last w-full justify-start\",\n },\n },\n defaultVariants: {\n align: \"inline-start\",\n },\n }\n)\n\nfunction InputGroupAddon({\n className,\n align = \"inline-start\",\n ...props\n}: React.ComponentProps<\"div\"> & VariantProps<typeof inputGroupAddonVariants>) {\n return (\n <div\n role=\"group\"\n data-slot=\"input-group-addon\"\n data-align={align}\n className={cn(inputGroupAddonVariants({ align }), className)}\n onClick={(e) => {\n if ((e.target as HTMLElement).closest(\"button\")) {\n return\n }\n e.currentTarget.parentElement?.querySelector(\"input\")?.focus()\n }}\n {...props}\n />\n )\n}\n\nconst inputGroupButtonVariants = cva(\n \"gap-space-md text-sm shadow-none flex items-center\",\n {\n variants: {\n size: {\n xs: \"h-action-xs gap-space-xs rounded-inner px-control-xs [&>svg:not([class*='size-'])]:size-icon-sm\",\n sm: \"\",\n \"icon-xs\": \"size-action-xs rounded-inner p-0 has-[>svg]:p-0\",\n \"icon-sm\": \"size-action-sm p-0 has-[>svg]:p-0\",\n },\n },\n defaultVariants: {\n size: \"xs\",\n },\n }\n)\n\nfunction InputGroupButton({\n className,\n type = \"button\",\n variant = \"ghost\",\n size = \"xs\",\n ...props\n}: Omit<React.ComponentProps<typeof Button>, \"size\" | \"type\"> &\n VariantProps<typeof inputGroupButtonVariants> & {\n type?: \"button\" | \"submit\" | \"reset\"\n }) {\n return (\n <Button\n type={type}\n data-size={size}\n variant={variant}\n className={cn(inputGroupButtonVariants({ size }), className)}\n {...props}\n />\n )\n}\n\nfunction InputGroupText({ className, ...props }: React.ComponentProps<\"span\">) {\n return (\n <span\n className={cn(\n \"text-muted-foreground gap-space-md text-sm [&_svg:not([class*='size-'])]:size-icon flex items-center [&_svg]:pointer-events-none\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction InputGroupInput({\n className,\n ...props\n}: React.ComponentProps<\"input\">) {\n return (\n <Input\n data-slot=\"input-group-control\"\n className={cn(\"rounded-none border-0 bg-transparent shadow-none ring-0 focus-visible:ring-0 aria-invalid:ring-0 flex-1\", className)}\n {...props}\n />\n )\n}\n\nfunction InputGroupTextarea({\n className,\n ...props\n}: React.ComponentProps<\"textarea\">) {\n return (\n <Textarea\n data-slot=\"input-group-control\"\n className={cn(\"rounded-none border-0 bg-transparent py-space-md shadow-none ring-0 focus-visible:ring-0 aria-invalid:ring-0 flex-1 resize-none\", className)}\n {...props}\n />\n )\n}\n\nexport {\n InputGroup,\n InputGroupAddon,\n InputGroupButton,\n InputGroupText,\n InputGroupInput,\n InputGroupTextarea,\n}\n","/**\n * InputGroup — base wrapper around the shadcn `ui/input-group` primitive.\n *\n * What this layer adds on top of the primitive:\n * - Stable BEM hooks on every wrapped part's outermost node\n * (`input-group--component`, `input-group-addon--component`, and so on).\n * - Design-system typography for the scalar copy inside `InputGroupText`,\n * while arbitrary `ReactNode` content (icons, `kbd`, buttons) passes through\n * untouched so the compound pattern stays composable.\n * - Keeps the primitive's addon alignment and button-size variants, its\n * focus-within/aria-invalid ring behaviour, and every native prop by spread.\n *\n * Compose it as\n * `<InputGroup><InputGroupAddon><Icon/></InputGroupAddon><InputGroupInput/></InputGroup>`.\n *\n * Reach for it when one control needs inline affordances welded to its frame —\n * a search icon, a unit suffix, a busy indicator, an inline action. For the\n * label / control / hint / error row, use `FormField` instead; this wrapper\n * owns only the control frame.\n */\nimport type { ComponentProps, ReactNode } from 'react';\n\nimport {\n\tInputGroup as InputGroupPrimitive,\n\tInputGroupAddon as InputGroupAddonPrimitive,\n\tInputGroupInput as InputGroupInputPrimitive,\n\tInputGroupText as InputGroupTextPrimitive,\n\tInputGroupTextarea as InputGroupTextareaPrimitive,\n} from '../../ui/input-group';\nimport { Button, type ButtonProps } from '../buttons';\nimport { Text } from '../../typography';\nimport { useDensityConfig, type ComponentScale } from '../../../lib/ui-provider';\nimport { editableTextSizeClasses } from '../../../lib/editable-text-recipe';\nimport { cn } from '../../../lib/utils';\nimport {\n\tformControlHeightClasses,\n\tformControlHorizontalPaddingClasses,\n\tformControlPaddingClasses,\n\tformTextareaSizeClasses,\n\tresolveFormControlSize,\n} from '../forms/form-sizing';\n\nexport type InputGroupProps = ComponentProps<typeof InputGroupPrimitive>;\nexport type InputGroupAddonProps = ComponentProps<typeof InputGroupAddonPrimitive>;\nexport interface InputGroupButtonProps extends Omit<ButtonProps, 'size'> {\n\t/** Component scale. Falls back to `UIProvider.density.defaultScale`. */\n\tsize?: ComponentScale;\n}\nexport type InputGroupInputProps = ComponentProps<typeof InputGroupInputPrimitive>;\nexport type InputGroupTextProps = ComponentProps<typeof InputGroupTextPrimitive>;\nexport type InputGroupTextareaProps = ComponentProps<typeof InputGroupTextareaPrimitive>;\n\nfunction useInputGroupScale() {\n\tconst { defaultScale } = useDensityConfig();\n\treturn resolveFormControlSize(undefined, defaultScale);\n}\n\n/** Control frame that welds inline addons onto a single input or textarea. */\nfunction InputGroup({ className, ...props }: InputGroupProps) {\n\tconst size = useInputGroupScale();\n\treturn (\n\t\t<InputGroupPrimitive\n\t\t\tclassName={cn(\n\t\t\t\t'input-group--component box-border rounded-inner font-sans text-foreground shadow-none',\n\t\t\t\tformControlHeightClasses[size],\n\t\t\t\teditableTextSizeClasses[size],\n\t\t\t\t'has-[>[data-align=block-end]]:[&>input]:pt-space-lg has-[>[data-align=block-start]]:[&>input]:pb-space-lg',\n\t\t\t\t'has-[>[data-align=inline-end]]:[&>input]:pe-space-sm has-[>[data-align=inline-start]]:[&>input]:ps-space-sm',\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nconst addonAlignmentClasses = {\n\t'inline-start': 'h-full py-0',\n\t'inline-end': 'h-full py-0',\n\t'block-start': 'pt-space-md group-has-[>input]/input-group:pt-space-md [.border-b]:pb-space-md',\n\t'block-end': 'pb-space-md group-has-[>input]/input-group:pb-space-md [.border-t]:pt-space-md',\n} as const;\n\nconst addonInlinePaddingClasses = {\n\tsm: { 'inline-start': 'ps-control-sm', 'inline-end': 'pe-control-sm' },\n\tmd: { 'inline-start': 'ps-control', 'inline-end': 'pe-control' },\n\tlg: { 'inline-start': 'ps-control', 'inline-end': 'pe-control' },\n} as const;\n\nconst addonIconClasses = {\n\tsm: \"[&>svg:not([class*='size-'])]:size-icon-sm\",\n\tmd: \"[&>svg:not([class*='size-'])]:size-icon\",\n\tlg: \"[&>svg:not([class*='size-'])]:size-icon-lg\",\n} as const;\n\n/** Leading/trailing (or block start/end) affordance slot inside the frame. */\nfunction InputGroupAddon({ className, align = 'inline-start', ...props }: InputGroupAddonProps) {\n\tconst size = useInputGroupScale();\n\tconst alignment = align ?? 'inline-start';\n\treturn (\n\t\t<InputGroupAddonPrimitive\n\t\t\talign={align}\n\t\t\tclassName={cn(\n\t\t\t\t'input-group-addon--component box-border gap-space-md py-space-sm',\n\t\t\t\taddonIconClasses[size],\n\t\t\t\taddonAlignmentClasses[alignment],\n\t\t\t\talignment === 'inline-start' || alignment === 'inline-end'\n\t\t\t\t\t? addonInlinePaddingClasses[size][alignment]\n\t\t\t\t\t: formControlHorizontalPaddingClasses[size],\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\n/** Inline action button sized to sit inside the control frame; its label stays on one line. */\nfunction InputGroupButton({\n\tclassName,\n\ttone = 'secondary',\n\tbuttonStyle = 'ghost',\n\ttruncate = true,\n\ticonOnly,\n\t...props\n}: InputGroupButtonProps) {\n\treturn (\n\t\t<Button\n\t\t\ttone={tone}\n\t\t\tbuttonStyle={buttonStyle}\n\t\t\ttruncate={truncate}\n\t\t\ticonOnly={iconOnly}\n\t\t\tclassName={cn(\n\t\t\t\t'input-group-button--component max-h-full shadow-none',\n\t\t\t\t// Text actions fit the inner frame. Icon actions retain their own\n\t\t\t\t// height and derive a square width after the frame caps that height.\n\t\t\t\t// Block/footer actions keep their natural Button geometry.\n\t\t\t\ticonOnly\n\t\t\t\t\t? 'in-[[data-align=inline-start]]:w-auto in-[[data-align=inline-start]]:aspect-square in-[[data-align=inline-end]]:w-auto in-[[data-align=inline-end]]:aspect-square'\n\t\t\t\t\t: 'in-[[data-align=inline-start]]:h-full in-[[data-align=inline-start]]:min-h-0 in-[[data-align=inline-end]]:h-full in-[[data-align=inline-end]]:min-h-0',\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction isScalarContent(content: ReactNode): content is string | number | bigint {\n\treturn typeof content === 'string' || typeof content === 'number' || typeof content === 'bigint';\n}\n\n/** Static copy segment — scalar text renders through Typography. */\nfunction InputGroupText({ children, className, ...props }: InputGroupTextProps) {\n\treturn (\n\t\t<InputGroupTextPrimitive\n\t\t\tclassName={cn('input-group-text--component gap-space-md [&_svg:not([class*=\\'size-\\'])]:size-icon', className)}\n\t\t\t{...props}\n\t\t>\n\t\t\t{isScalarContent(children) ? (\n\t\t\t\t<Text tag=\"span\" size=\"inherit\" lineHeight=\"tight\" className=\"text-inherit\">\n\t\t\t\t\t{children}\n\t\t\t\t</Text>\n\t\t\t) : (\n\t\t\t\tchildren\n\t\t\t)}\n\t\t</InputGroupTextPrimitive>\n\t);\n}\n\n/** Single-line control that inherits the group's frame instead of its own. */\nfunction InputGroupInput({ className, ...props }: InputGroupInputProps) {\n\tconst size = useInputGroupScale();\n\treturn (\n\t\t<InputGroupInputPrimitive\n\t\t\tclassName={cn(\n\t\t\t\t// Inline frames grow for their shared editable line and clamp the\n\t\t\t\t// borderless input to the resulting content box.\n\t\t\t\t// Auto-height block compositions retain the shared control height.\n\t\t\t\t'input-group-input--component box-border max-h-full font-sans text-foreground',\n\t\t\t\tformControlHeightClasses[size],\n\t\t\t\t// The group owns the border; its native editor needs only its line.\n\t\t\t\t'min-h-lh',\n\t\t\t\tformControlPaddingClasses[size],\n\t\t\t\teditableTextSizeClasses[size],\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\n/** Multi-line control that inherits the group's frame instead of its own. */\nfunction InputGroupTextarea({ className, ...props }: InputGroupTextareaProps) {\n\tconst size = useInputGroupScale();\n\treturn (\n\t\t<InputGroupTextareaPrimitive\n\t\t\tclassName={cn(\n\t\t\t\t'input-group-textarea--component box-border py-space-md',\n\t\t\t\tformTextareaSizeClasses[size],\n\t\t\t\tformControlHorizontalPaddingClasses[size],\n\t\t\t\teditableTextSizeClasses[size],\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nexport {\n\tInputGroup,\n\tInputGroupAddon,\n\tInputGroupButton,\n\tInputGroupInput,\n\tInputGroupText,\n\tInputGroupTextarea,\n};\n","import { Eye, EyeOff } from 'lucide-react';\nimport * as React from 'react';\n\nimport { useStrings, type StringsProp } from '../../../lib/strings';\nimport { cn } from '../../../lib/utils';\n\nimport { Input, type InputProps } from './input';\nimport { InputTrailingActionContext } from './input-trailing-action';\nimport { fieldAffordanceRecipes } from '../../../lib/field-affordance-recipes';\n\nexport interface PasswordInputStrings {\n\tshowPassword: string;\n\thidePassword: string;\n}\n\nexport const defaultPasswordInputStrings: PasswordInputStrings = {\n\tshowPassword: 'Show password',\n\thidePassword: 'Hide password',\n};\n\nexport interface PasswordInputProps extends Omit<InputProps, 'type' | 'endIcon' | 'strings'> {\n\t/** Whether the value is revealed. Controlled. */\n\tvisible?: boolean;\n\t/** Whether the value starts revealed, for uncontrolled use. */\n\tdefaultVisible?: boolean;\n\t/** Fired whenever the reveal state changes. */\n\tonVisibleChange?: (visible: boolean) => void;\n\t/** Shows the reveal toggle. Turn it off for fields that must stay masked. */\n\trevealable?: boolean;\n\t/** Merged onto the field wrapper, outside the input frame. */\n\twrapperClassName?: string;\n\t/** Merged onto the reveal toggle. */\n\tvisibilityButtonClassName?: string;\n\t/** Copy overrides forwarded to the underlying text input. */\n\tinputStrings?: InputProps['strings'];\n\t/** Overrides the show/hide accessible names. */\n\tstrings?: StringsProp<PasswordInputStrings>;\n}\n\nconst PasswordInput = React.forwardRef<HTMLInputElement, PasswordInputProps>(\n\tfunction PasswordInput(\n\t\t{\n\t\t\tvisible,\n\t\t\tdefaultVisible = false,\n\t\t\tonVisibleChange,\n\t\t\trevealable = true,\n\t\t\twrapperClassName,\n\t\t\tvisibilityButtonClassName,\n\t\t\tclassName,\n\t\t\tdisabled,\n\t\t\tloading,\n\t\t\tinputStrings,\n\t\t\tstrings: stringsProp,\n\t\t\t...props\n\t\t},\n\t\tref,\n\t) {\n\t\tconst strings = useStrings(defaultPasswordInputStrings, stringsProp);\n\t\tconst [internalVisible, setInternalVisible] = React.useState(defaultVisible);\n\t\tconst isControlled = visible !== undefined;\n\t\tconst isVisible = isControlled ? visible : internalVisible;\n\t\tconst disabledState = disabled || loading;\n\n\t\tconst toggleVisibility = React.useCallback(() => {\n\t\t\tconst nextVisible = !isVisible;\n\t\t\tif (!isControlled) {\n\t\t\t\tsetInternalVisible(nextVisible);\n\t\t\t}\n\t\t\tonVisibleChange?.(nextVisible);\n\t\t}, [isControlled, isVisible, onVisibleChange]);\n\n\t\tconst visibilityAction = revealable ? (\n\t\t\t<button\n\t\t\t\ttype=\"button\"\n\t\t\t\tclassName={cn('password-input--toggle', fieldAffordanceRecipes.target, fieldAffordanceRecipes.focus, fieldAffordanceRecipes.toggle, visibilityButtonClassName)}\n\t\t\t\taria-label={isVisible ? strings.hidePassword : strings.showPassword}\n\t\t\t\taria-pressed={isVisible}\n\t\t\t\tdisabled={disabledState}\n\t\t\t\tonMouseDown={(event) => event.preventDefault()}\n\t\t\t\tonClick={toggleVisibility}\n\t\t\t>\n\t\t\t\t{isVisible ? <EyeOff className={fieldAffordanceRecipes.icon} aria-hidden=\"true\" /> : <Eye className={fieldAffordanceRecipes.icon} aria-hidden=\"true\" />}\n\t\t\t</button>\n\t\t) : null;\n\n\t\treturn (\n\t\t\t<div className={cn('password-input--component', 'relative', wrapperClassName)}>\n\t\t\t\t<InputTrailingActionContext.Provider value={visibilityAction}>\n\t\t\t\t\t<Input\n\t\t\t\t\t\t{...props}\n\t\t\t\t\t\tref={ref}\n\t\t\t\t\t\ttype={isVisible ? 'text' : 'password'}\n\t\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\t\tloading={loading}\n\t\t\t\t\t\tclassName={className}\n\t\t\t\t\t\tstrings={inputStrings}\n\t\t\t\t\t/>\n\t\t\t\t</InputTrailingActionContext.Provider>\n\t\t\t</div>\n\t\t);\n\t},\n);\n\nPasswordInput.displayName = 'PasswordInput';\n\nexport { PasswordInput };\n","import * as React from 'react';\n\nimport { cn } from '../../../lib/utils';\n\nimport { Input, type InputProps } from './input';\n\nexport interface SlugifyValueOptions {\n\t/** Character joining words in the generated slug. Default: `-`. */\n\tseparator?: string;\n\t/** Lowercases the generated slug. */\n\tlowercase?: boolean;\n\t/** Strips leading and trailing separators. */\n\ttrim?: boolean;\n}\n\nexport function slugifyValue(\n\tvalue: string | number | null | undefined,\n\t{\n\t\tseparator = '-',\n\t\tlowercase = true,\n\t\ttrim = true,\n\t}: SlugifyValueOptions = {},\n) {\n\tconst safeSeparator = separator || '-';\n\tconst escapedSeparator = safeSeparator.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&');\n\tlet normalized = String(value ?? '')\n\t\t.normalize('NFKD')\n\t\t.replace(/[\\u0300-\\u036f]/g, '')\n\t\t.replace(/&/g, ' and ')\n\t\t.replace(/['’]/g, '');\n\n\tif (lowercase) {\n\t\tnormalized = normalized.toLowerCase();\n\t}\n\n\tnormalized = normalized\n\t\t.replace(/[^\\p{Letter}\\p{Number}]+/gu, safeSeparator)\n\t\t.replace(new RegExp(`${escapedSeparator}{2,}`, 'g'), safeSeparator);\n\n\tif (trim) {\n\t\tnormalized = normalized.replace(new RegExp(`^${escapedSeparator}|${escapedSeparator}$`, 'g'), '');\n\t}\n\n\treturn normalized;\n}\n\nexport interface SlugFieldProps\n\textends Omit<\n\t\tInputProps,\n\t\t'value' | 'defaultValue' | 'onChange' | 'readOnly' | 'type'\n\t>,\n\t\tSlugifyValueOptions {\n\t/** Current slug. Controlled. */\n\tvalue: string | number | null | undefined;\n\t/** Replaces the built-in slug derivation entirely. */\n\tslugify?: (value: string | number | null | undefined) => string;\n\t/** Merged onto the field wrapper, outside the input frame. */\n\twrapperClassName?: string;\n}\n\nconst SlugField = React.forwardRef<HTMLInputElement, SlugFieldProps>(\n\tfunction SlugField(\n\t\t{\n\t\t\tvalue,\n\t\t\tslugify,\n\t\t\tseparator = '-',\n\t\t\tlowercase = true,\n\t\t\ttrim = true,\n\t\t\twrapperClassName,\n\t\t\tclassName,\n\t\t\t...props\n\t\t},\n\t\tref,\n\t) {\n\t\tconst slug = React.useMemo(\n\t\t\t() => slugify?.(value) ?? slugifyValue(value, { separator, lowercase, trim }),\n\t\t\t[lowercase, separator, slugify, trim, value],\n\t\t);\n\n\t\treturn (\n\t\t\t<div className={cn('slug-field--component', wrapperClassName)}>\n\t\t\t\t<Input\n\t\t\t\t\tref={ref}\n\t\t\t\t\t{...props}\n\t\t\t\t\ttype=\"text\"\n\t\t\t\t\tvalue={slug}\n\t\t\t\t\treadOnly\n\t\t\t\t\tclassName={className}\n\t\t\t\t/>\n\t\t\t</div>\n\t\t);\n\t},\n);\n\nSlugField.displayName = 'SlugField';\n\nexport { SlugField };\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAoBA,IAAaqC,KAA0C,EACrD,OAAO,iBACT,GAuQMrC,IAAWC,EAAM,YAzNrB,EACE,cACA,cACA,uBACA,cACA,YACA,aAAU,IACV,YACA,MAAMsC,GACN,gBAAa,IACb,aAAU,GACV,YACA,aACA,OAAOC,GACP,iBACA,IAAIC,GACJ,SAASC,GACT,GAAGC,KAEL,MACG;CACH,IAAMC,IAAcC,EAA4B,IAAI,GAC9CC,IAAUC,EAAWV,IAAwBK,CAAW,GACxD,EAAE,oBAAiB3B,EAAiB,GACpCiC,IAAOn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ASH;EAAMF;CAAK,CAC5C;CAEA,OACC,kBAAC,OAAD;EAAK,WAAW7H,EAAG,yBAAyBsH,CAAgB;EAC3D,UAAA,kBAACpG,GAAD;GACM;GACL,GAAIS;GACJ,MAAK;GACL,OAAOsG;GACP,UAAA;GACW;EACX,CAAA;CACG,CAAA;AAEP,CACD;AAEA,EAAU,cAAc"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
//#region src/lib/theme-mode-css.ts
|
|
2
|
+
function e(e, t) {
|
|
3
|
+
let n = `:is(${e})`, r = [], i = (e, t) => `${e} {\n${t.map((e) => `\t${e}`).join("\n")}\n}`;
|
|
4
|
+
if (t.light.length && r.push(i(n, t.light)), t.dark.length) {
|
|
5
|
+
r.push(i(`${n}:where(.dark)`, t.dark));
|
|
6
|
+
let e = i(`${n}:not(:where(.light))`, t.dark);
|
|
7
|
+
r.push(`@container style(--themelia-mode: dark) {\n${e.split("\n").map((e) => `\t${e}`).join("\n")}\n}`);
|
|
8
|
+
}
|
|
9
|
+
return r.join("\n\n");
|
|
10
|
+
}
|
|
11
|
+
//#endregion
|
|
12
|
+
export { e as t };
|
|
13
|
+
|
|
14
|
+
//# sourceMappingURL=theme-mode-css-BB-_RYab.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"theme-mode-css-BB-_RYab.js","names":["serializeScopedThemeModes","selector","scope","blocks","block","target","entries","entry","declarations","inherited","line"],"sources":["../src/lib/theme-mode-css.ts"],"sourcesContent":["/** CSS emitted by public chart/theme serializers follows the same inherited\n * mode marker as Tailwind's dark variant. A selector list is one scope, not a\n * string to prefix with an ancestor .dark selector. */\nexport function serializeScopedThemeModes(\n scope: string,\n declarations: { light: readonly string[]; dark: readonly string[] },\n): string {\n const selector = `:is(${scope})`;\n const blocks: string[] = [];\n const block = (target: string, entries: readonly string[]) => `${target} {\\n${entries.map(entry => `\\t${entry}`).join('\\n')}\\n}`;\n if (declarations.light.length) blocks.push(block(selector, declarations.light));\n if (declarations.dark.length) {\n blocks.push(block(`${selector}:where(.dark)`, declarations.dark));\n const inherited = block(`${selector}:not(:where(.light))`, declarations.dark);\n blocks.push(`@container style(--themelia-mode: dark) {\\n${inherited.split('\\n').map(line => `\\t${line}`).join('\\n')}\\n}`);\n }\n return blocks.join('\\n\\n');\n}\n"],"mappings":";AAGA,SAAgBA,EACf,GACA,GACS;CACT,IAAMC,IAAW,OAAOC,EAAM,IACxBC,IAAmB,CAAC,GACpBC,KAAS,GAAgB,MAA+B,GAAGC,EAAO,MAAMC,EAAQ,KAAI,MAAS,KAAKC,GAAO,CAAC,CAAC,KAAK,IAAI,EAAE;CAE5H,IADIC,EAAa,MAAM,UAAQL,EAAO,KAAKC,EAAMH,GAAUO,EAAa,KAAK,CAAC,GAC1EA,EAAa,KAAK,QAAQ;EAC7B,EAAO,KAAKJ,EAAM,GAAGH,EAAS,gBAAgBO,EAAa,IAAI,CAAC;EAChE,IAAMC,IAAYL,EAAM,GAAGH,EAAS,uBAAuBO,EAAa,IAAI;EAC5E,EAAO,KAAK,8CAA8CC,EAAU,MAAM,IAAI,CAAC,CAAC,KAAI,MAAQ,KAAKC,GAAM,CAAC,CAAC,KAAK,IAAI,EAAE,IAAI;CACzH;CACA,OAAOP,EAAO,KAAK,MAAM;AAC1B"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import * as e from "react";
|
|
3
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
4
|
+
//#region src/lib/theme-scope.tsx
|
|
5
|
+
var n = e.createContext(null), r = [
|
|
6
|
+
"--primary",
|
|
7
|
+
"--primary-foreground",
|
|
8
|
+
"--foreground",
|
|
9
|
+
"--font-sans"
|
|
10
|
+
];
|
|
11
|
+
function i(e) {
|
|
12
|
+
return r.filter((t) => e?.[t] != null && e[t] !== "").map((e) => e.slice(2)).join(" ") || void 0;
|
|
13
|
+
}
|
|
14
|
+
var a = n.Provider;
|
|
15
|
+
function o() {
|
|
16
|
+
let t = e.useRef(null), [n, r] = e.useState(!1);
|
|
17
|
+
return {
|
|
18
|
+
host: t,
|
|
19
|
+
attachHost: e.useCallback((e) => {
|
|
20
|
+
t.current = e, r(e !== null);
|
|
21
|
+
}, []),
|
|
22
|
+
context: e.useMemo(() => ({
|
|
23
|
+
host: t,
|
|
24
|
+
mounted: n
|
|
25
|
+
}), [n])
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
var s = e.forwardRef(function({ children: n, style: r, ...s }, c) {
|
|
29
|
+
let { host: l, attachHost: u, context: d } = o();
|
|
30
|
+
return e.useImperativeHandle(c, () => l.current, []), /* @__PURE__ */ t(a, {
|
|
31
|
+
value: d,
|
|
32
|
+
children: /* @__PURE__ */ t("div", {
|
|
33
|
+
"data-theme-scope": "",
|
|
34
|
+
...s,
|
|
35
|
+
"data-theme-roots": i(r),
|
|
36
|
+
style: r,
|
|
37
|
+
ref: u,
|
|
38
|
+
children: n
|
|
39
|
+
})
|
|
40
|
+
});
|
|
41
|
+
});
|
|
42
|
+
function c(t) {
|
|
43
|
+
let r = e.useContext(n);
|
|
44
|
+
if (t !== void 0) return t;
|
|
45
|
+
if (r) return r.mounted ? r.host : null;
|
|
46
|
+
}
|
|
47
|
+
//#endregion
|
|
48
|
+
export { o as i, a as n, c as r, s as t };
|
|
49
|
+
|
|
50
|
+
//# sourceMappingURL=theme-scope-BJ6eE2xt.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"theme-scope-BJ6eE2xt.js","names":["React","React$1","ThemeScopeContext","scopeAliasRoots","suppliedScopeRoots","style","root","ThemeScopeHostProvider","useThemeScopeHost","host","mounted","setMounted","node","ThemeScope","props","forwardedRef","context","attachHost","useThemePortalContainer","scope","container"],"sources":["../src/lib/theme-scope.tsx"],"sourcesContent":["import * as React from 'react';\n\n/** Native Base UI portal container contract, shared by internal portal owners. */\nexport type ThemePortalContainer = HTMLElement | ShadowRoot | React.RefObject<HTMLElement | ShadowRoot | null> | null;\n\ntype ThemeScopeContextValue = {\n host: React.RefObject<HTMLElement | null>;\n mounted: boolean;\n};\nconst ThemeScopeContext = React.createContext<ThemeScopeContextValue | null>(null);\n\nexport type ThemeScopeProps = Omit<React.ComponentPropsWithoutRef<'div'>, 'style'> & {\n style?: React.CSSProperties & { [property: `--${string}`]: string | number | undefined };\n};\n\n// CSS owns alias references. This private marker identifies explicitly supplied\n// source roots so low-specificity defaults can rebind at this boundary without\n// overriding independent roles from consumer classes or inline styles.\nconst scopeAliasRoots = ['--primary', '--primary-foreground', '--foreground', '--font-sans'] as const;\nfunction suppliedScopeRoots(style: ThemeScopeProps['style']) {\n return scopeAliasRoots.filter(root => style?.[root] != null && style[root] !== '').map(root => root.slice(2)).join(' ') || undefined;\n}\n\n/** Internal host mechanics shared by native themed regions and the public div scope. */\nexport const ThemeScopeHostProvider = ThemeScopeContext.Provider;\n\nexport function useThemeScopeHost<T extends HTMLElement>() {\n const host = React.useRef<T>(null);\n const [mounted, setMounted] = React.useState(false);\n const attachHost = React.useCallback((node: T | null) => {\n host.current = node;\n setMounted(node !== null);\n }, []);\n const context = React.useMemo(() => ({ host, mounted }), [mounted]);\n return { host, attachHost, context };\n}\n\n/** CSS inheritance boundary for local themes, including descendant overlays. */\nexport const ThemeScope = React.forwardRef<HTMLDivElement, ThemeScopeProps>(function ThemeScope(\n { children, style, ...props }, forwardedRef,\n) {\n const { host, attachHost, context } = useThemeScopeHost<HTMLDivElement>();\n React.useImperativeHandle(forwardedRef, () => host.current!, []);\n return <ThemeScopeHostProvider value={context}>\n <div data-theme-scope=\"\" {...props} data-theme-roots={suppliedScopeRoots(style)} style={style} ref={attachHost}>{children}</div>\n </ThemeScopeHostProvider>;\n});\n\n/** Explicit container wins; scoped portals wait until their CSS host is attached. */\nexport function useThemePortalContainer(container?: ThemePortalContainer): ThemePortalContainer | undefined {\n const scope = React.useContext(ThemeScopeContext);\n if (container !== undefined) return container;\n if (!scope) return undefined;\n return scope.mounted ? scope.host : null;\n}\n"],"mappings":";;;;AASA,IAAME,IAAoBF,EAAM,cAA6C,IAAI,GAS3EG,IAAkB;CAAC;CAAa;CAAwB;CAAgB;AAAa;AAC3F,SAASC,EAAmB,GAAiC;CAC5D,OAAOD,EAAgB,QAAO,MAAQE,IAAQC,MAAS,QAAQD,EAAMC,OAAU,EAAE,CAAC,CAAC,KAAI,MAAQA,EAAK,MAAM,CAAC,CAAC,CAAC,CAAC,KAAK,GAAG,KAAK,KAAA;AAC5H;AAGA,IAAaC,IAAyBL,EAAkB;AAExD,SAAgBM,IAA2C;CAC1D,IAAMC,IAAOT,EAAM,OAAU,IAAI,GAC3B,CAACU,GAASC,KAAcX,EAAM,SAAS,EAAK;CAMlD,OAAO;EAAE;EAAM,YALIA,EAAM,aAAa,MAAmB;GAExD,AADA,EAAK,UAAUY,GACfD,EAAWC,MAAS,IAAI;EACzB,GAAG,CAAC,CAEW;EAAY,SADXZ,EAAM,eAAe;GAAE;GAAM;EAAQ,IAAI,CAACU,CAAO,CACtC;CAAQ;AACpC;AAGA,IAAaG,IAAab,EAAM,WAA4C,SAC3E,EAAE,aAAU,UAAO,GAAGc,KAAS,GAC9B;CACD,IAAM,EAAE,SAAM,eAAY,eAAYN,EAAkC;CAExE,OADAP,EAAM,oBAAoBc,SAAoBN,EAAK,SAAU,CAAC,CAAC,GACxD,kBAACF,GAAD;EAAwB,OAAOS;EACrC,UAAA,kBAAC,OAAD;GAAK,oBAAiB;GAAG,GAAIF;GAAO,oBAAkBV,EAAmBC,CAAK;GAAU;GAAO,KAAKY;GAAa;EAAc,CAAA;CACxG,CAAA;AACzB,CAAC;AAGD,SAAgBC,EAAwB,GAAoE;CAC3G,IAAMC,IAAQnB,EAAM,WAAWE,CAAiB;CAChD,IAAIkB,MAAc,KAAA,GAAW,OAAOA;CACpC,IAAKD,GACL,OAAOA,EAAM,UAAUA,EAAM,OAAO;AACrC"}
|