themelia-react-ui 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +53 -1
- package/README.md +39 -6
- package/dist/{accordion-BRWh3BM1.js → accordion-B-5Focs8.js} +2 -2
- package/dist/{accordion-BRWh3BM1.js.map → accordion-B-5Focs8.js.map} +1 -1
- package/dist/{affordance-geometry.generated-DXl-Zb3Z.js → affordance-geometry.generated-D8Jcfb0G.js} +10 -1
- package/dist/affordance-geometry.generated-D8Jcfb0G.js.map +1 -0
- package/dist/{ai-artifact-DkOArd3-.js → ai-artifact-B5tPpXnS.js} +5 -5
- package/dist/{ai-artifact-DkOArd3-.js.map → ai-artifact-B5tPpXnS.js.map} +1 -1
- package/dist/{app-shell-BH_bGcE2.js → app-shell-at8Kt4l_.js} +3 -3
- package/dist/{app-shell-BH_bGcE2.js.map → app-shell-at8Kt4l_.js.map} +1 -1
- package/dist/{attachment-DsLgNHXt.js → attachment-BO2R47wn.js} +2 -2
- package/dist/{attachment-DsLgNHXt.js.map → attachment-BO2R47wn.js.map} +1 -1
- package/dist/{auth-BDB1V_2q.js → auth-OFwWSAap.js} +4 -4
- package/dist/{auth-BDB1V_2q.js.map → auth-OFwWSAap.js.map} +1 -1
- package/dist/{avatar-CsnWaYmt.js → avatar-Bpzty83c.js} +73 -68
- package/dist/avatar-Bpzty83c.js.map +1 -0
- package/dist/base/accordion.js +1 -1
- package/dist/base/attachment.js +1 -1
- package/dist/base/avatar.js +1 -1
- package/dist/base/cards.js +2 -2
- package/dist/base/cascader.js +6 -6
- 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/date-pickers.js +2 -2
- package/dist/base/display.js +1 -1
- 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 +236 -0
- package/dist/base/inline-edit.js.map +1 -0
- package/dist/base/media-gallery.js +1 -1
- package/dist/base/navigation.js +3 -3
- package/dist/base/popover-menu.js +1 -1
- package/dist/base/popover.js +1 -1
- package/dist/base/repeaters.js +4 -4
- package/dist/base/sheet.js +1 -1
- package/dist/base/sidebar.js +1 -1
- package/dist/base/signature-pad.js +3 -3
- package/dist/base/skeleton.js +1 -1
- package/dist/base/spinner.js +1 -1
- package/dist/base/structure.js +1 -1
- package/dist/base/text-inputs.js +2 -2
- package/dist/base/tree.js +1 -1
- package/dist/base/upload-queue.js +1 -1
- package/dist/base/upload.js +3 -3
- package/dist/base/value-inputs.js +1 -1
- package/dist/blocks/admin.js +6 -6
- package/dist/blocks/ai.js +6 -6
- package/dist/blocks/analytics/usage-card.js +3 -0
- package/dist/blocks/analytics.js +361 -360
- 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 +15 -15
- package/dist/blocks/data-display.js +1 -1
- package/dist/blocks/onboarding.js +3 -3
- package/dist/blocks/planning.js +311 -0
- package/dist/blocks/planning.js.map +1 -0
- package/dist/blocks/timelines.js +1 -1
- package/dist/{cards-BMB0laLG.js → cards-Cum56XOF.js} +3 -3
- package/dist/{cards-BMB0laLG.js.map → cards-Cum56XOF.js.map} +1 -1
- package/dist/checkbox-BavDRjF7.js +34 -0
- package/dist/checkbox-BavDRjF7.js.map +1 -0
- package/dist/{choice-inputs-CavA-SGV.js → choice-inputs-CC7XqPQO.js} +166 -191
- package/dist/choice-inputs-CC7XqPQO.js.map +1 -0
- package/dist/{code-block-DIlqzoiD.js → code-block-xHKbAJDj.js} +2 -2
- package/dist/{code-block-DIlqzoiD.js.map → code-block-xHKbAJDj.js.map} +1 -1
- package/dist/{combobox-HDftpzxt.js → combobox-DEbdr-3u.js} +2 -2
- package/dist/{combobox-HDftpzxt.js.map → combobox-DEbdr-3u.js.map} +1 -1
- package/dist/{combobox-CHD750do.js → combobox-xv3yJbzl.js} +7 -7
- package/dist/{combobox-CHD750do.js.map → combobox-xv3yJbzl.js.map} +1 -1
- package/dist/{command-D0kWBZfd.js → command-C0xe7u9B.js} +2 -2
- package/dist/{command-D0kWBZfd.js.map → command-C0xe7u9B.js.map} +1 -1
- package/dist/{comments-CvYeglMS.js → comments-DviPLnwy.js} +8 -8
- package/dist/{comments-CvYeglMS.js.map → comments-DviPLnwy.js.map} +1 -1
- package/dist/components/base/cards/smart-card.types.d.ts +2 -0
- 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/structure/structure.recipes.d.ts +6 -0
- package/dist/components/blocks/analytics/index.d.ts +1 -0
- 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/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/{containers-CPNyNo1_.js → containers-6s-ucRQQ.js} +3 -2
- package/dist/containers-6s-ucRQQ.js.map +1 -0
- package/dist/{data-display-b3d1TfL4.js → data-display-cWIRdeaf.js} +8 -8
- package/dist/{data-display-b3d1TfL4.js.map → data-display-cWIRdeaf.js.map} +1 -1
- package/dist/{date-picker-DI6kPNof.js → date-picker-CA6ogMQB.js} +5 -5
- package/dist/{date-picker-DI6kPNof.js.map → date-picker-CA6ogMQB.js.map} +1 -1
- package/dist/{date-pickers-ByP6Cv2z.js → date-pickers-BPIKLdsD.js} +4 -4
- package/dist/{date-pickers-ByP6Cv2z.js.map → date-pickers-BPIKLdsD.js.map} +1 -1
- package/dist/{display-ByI5tkqy.js → display-CFM5myut.js} +3 -3
- package/dist/{display-ByI5tkqy.js.map → display-CFM5myut.js.map} +1 -1
- package/dist/features/activities.js +4 -4
- package/dist/features/ai-chat.js +4 -4
- package/dist/features/async-preview.js +4 -4
- package/dist/features/combobox.js +1 -1
- package/dist/features/comments.js +1 -1
- package/dist/features/data-view.js +5 -5
- package/dist/features/email-composer.js +11 -11
- package/dist/features/event-calendar.js +2 -2
- package/dist/features/event-calendar.js.map +1 -1
- package/dist/features/filters.js +1 -1
- package/dist/features/global-search.js +6 -6
- package/dist/features/map.js +3 -3
- package/dist/features/media-library.js +8 -8
- package/dist/features/mentions.js +1 -1
- package/dist/features/overlays.js +1 -1
- package/dist/features/products.js +43 -42
- package/dist/features/products.js.map +1 -1
- package/dist/features/questionnaire.js +107 -106
- package/dist/features/questionnaire.js.map +1 -1
- package/dist/features/resource-assignment.js +5 -5
- package/dist/features/resource.js +7 -7
- package/dist/features/rich-text-editor.js +1 -1
- package/dist/features/schema-form.js +11 -11
- package/dist/features/schema-form.js.map +1 -1
- package/dist/features/suggestions.js +2 -2
- package/dist/features/sync.js +2 -2
- package/dist/features/table.js +1 -1
- package/dist/features/theme-tweaker.js +11 -11
- package/dist/feedback-DWUkgEjR.js +233 -0
- package/dist/feedback-DWUkgEjR.js.map +1 -0
- package/dist/{field-affordance-recipes-CHdUtn2Z.js → field-affordance-recipes-IjzPrCTw.js} +2 -2
- package/dist/{field-affordance-recipes-CHdUtn2Z.js.map → field-affordance-recipes-IjzPrCTw.js.map} +1 -1
- package/dist/{filters-qtrcv1hf.js → filters-BhsUtsxW.js} +9 -9
- package/dist/{filters-qtrcv1hf.js.map → filters-BhsUtsxW.js.map} +1 -1
- package/dist/{form-field-C6W-y2hR.js → form-field-Bn7ZH1rA.js} +2 -2
- package/dist/{form-field-C6W-y2hR.js.map → form-field-Bn7ZH1rA.js.map} +1 -1
- package/dist/{form-sizing-39NohSqn.js → form-sizing-BWs70_a2.js} +4 -3
- package/dist/{form-sizing-39NohSqn.js.map → form-sizing-BWs70_a2.js.map} +1 -1
- package/dist/{forms-BF-HSbff.js → forms-B7pzS25o.js} +5 -5
- package/dist/{forms-BF-HSbff.js.map → forms-B7pzS25o.js.map} +1 -1
- package/dist/{forms-numeric-Y15Bg5Nr.js → forms-numeric-BUBxELBv.js} +18 -18
- package/dist/{forms-numeric-Y15Bg5Nr.js.map → forms-numeric-BUBxELBv.js.map} +1 -1
- package/dist/{header-B8ex54cY.js → header-C59QZyxV.js} +6 -6
- package/dist/{header-B8ex54cY.js.map → header-C59QZyxV.js.map} +1 -1
- package/dist/{hooks-D6UBVzf2.js → hooks-CM1Vp9Pe.js} +2 -2
- package/dist/{hooks-D6UBVzf2.js.map → hooks-CM1Vp9Pe.js.map} +1 -1
- package/dist/{input-DMorJiTI.js → input-WwYQZJzG.js} +3 -3
- package/dist/{input-DMorJiTI.js.map → input-WwYQZJzG.js.map} +1 -1
- 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 +9 -0
- package/dist/{media-gallery-Ca4YmvBi.js → media-gallery-DhDRgnVZ.js} +2 -2
- package/dist/{media-gallery-Ca4YmvBi.js.map → media-gallery-DhDRgnVZ.js.map} +1 -1
- package/dist/{mentions-CRio8mTm.js → mentions-B8Ko-fhS.js} +4 -4
- package/dist/{mentions-CRio8mTm.js.map → mentions-B8Ko-fhS.js.map} +1 -1
- package/dist/{message-B5-6LeYl.js → message-COsdEvXT.js} +2 -2
- package/dist/{message-B5-6LeYl.js.map → message-COsdEvXT.js.map} +1 -1
- package/dist/{navigation-DqEITuD2.js → navigation-BUIn2Qxx.js} +2 -2
- package/dist/{navigation-DqEITuD2.js.map → navigation-BUIn2Qxx.js.map} +1 -1
- package/dist/{navigation-BTrEb5u4.js → navigation-DBEu4POU.js} +3 -3
- package/dist/{navigation-BTrEb5u4.js.map → navigation-DBEu4POU.js.map} +1 -1
- package/dist/{navigation-row-recipes-BFpvGPGE.js → navigation-row-recipes-GVh11KiT.js} +2 -2
- package/dist/{navigation-row-recipes-BFpvGPGE.js.map → navigation-row-recipes-GVh11KiT.js.map} +1 -1
- package/dist/{overlays-DBqV0J_V.js → overlays-B11wZka6.js} +4 -4
- package/dist/{overlays-DBqV0J_V.js.map → overlays-B11wZka6.js.map} +1 -1
- package/dist/{page-BMBGjJY8.js → page-BV6ioQg3.js} +5 -5
- package/dist/{page-BMBGjJY8.js.map → page-BV6ioQg3.js.map} +1 -1
- package/dist/{page-header-BH41wCyY.js → page-header-DQRa0jug.js} +2 -2
- package/dist/{page-header-BH41wCyY.js.map → page-header-DQRa0jug.js.map} +1 -1
- package/dist/{popover-TInGXsjg.js → popover-CoLDEg19.js} +2 -2
- package/dist/{popover-TInGXsjg.js.map → popover-CoLDEg19.js.map} +1 -1
- package/dist/{popover-menu-BzqXqE72.js → popover-menu-GLIQTJTx.js} +4 -4
- package/dist/{popover-menu-BzqXqE72.js.map → popover-menu-GLIQTJTx.js.map} +1 -1
- package/dist/progress-BOe8l_FZ.js +168 -0
- package/dist/progress-BOe8l_FZ.js.map +1 -0
- package/dist/{receipt-DYWTQGEc.js → receipt-BM8xsGFy.js} +3 -3
- package/dist/{receipt-DYWTQGEc.js.map → receipt-BM8xsGFy.js.map} +1 -1
- package/dist/{rich-text-editor-BZSJchAF.js → rich-text-editor-CoVrTiSv.js} +2 -2
- package/dist/{rich-text-editor-BZSJchAF.js.map → rich-text-editor-CoVrTiSv.js.map} +1 -1
- package/dist/services/actions.js +1 -1
- package/dist/{settings-D9f_wdIC.js → settings-BnCyyPOJ.js} +3 -3
- package/dist/{settings-D9f_wdIC.js.map → settings-BnCyyPOJ.js.map} +1 -1
- package/dist/{sheet-vOUloJ4O.js → sheet-B-q914Ad.js} +2 -2
- package/dist/{sheet-vOUloJ4O.js.map → sheet-B-q914Ad.js.map} +1 -1
- package/dist/{sidebar-C3UKkbC5.js → sidebar-C_2p3Tfj.js} +6 -6
- package/dist/{sidebar-C3UKkbC5.js.map → sidebar-C_2p3Tfj.js.map} +1 -1
- package/dist/{sidebar-CNBKFDRW.js → sidebar-DPR7fmqN.js} +4 -4
- package/dist/{sidebar-CNBKFDRW.js.map → sidebar-DPR7fmqN.js.map} +1 -1
- package/dist/{skeleton-BvRhK8y-.js → skeleton-CmT1ppqb.js} +2 -2
- package/dist/{skeleton-BvRhK8y-.js.map → skeleton-CmT1ppqb.js.map} +1 -1
- package/dist/{smart-card-B5FcKODh.js → smart-card-CYLn46e6.js} +119 -118
- package/dist/smart-card-CYLn46e6.js.map +1 -0
- package/dist/{spinner-JtlFJ7Nc.js → spinner-BY9HbUEh.js} +2 -2
- package/dist/{spinner-JtlFJ7Nc.js.map → spinner-BY9HbUEh.js.map} +1 -1
- package/dist/{structure-BvW4vG4H.js → structure-MvKVq-oL.js} +13 -13
- package/dist/{structure-BvW4vG4H.js.map → structure-MvKVq-oL.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/{table-ghtAQ-JJ.js → table-BS39xnlq.js} +6 -6
- package/dist/{table-ghtAQ-JJ.js.map → table-BS39xnlq.js.map} +1 -1
- package/dist/{tabs-DY09eoZg.js → tabs-B5cNMWiP.js} +2 -2
- package/dist/{tabs-DY09eoZg.js.map → tabs-B5cNMWiP.js.map} +1 -1
- package/dist/{text-inputs-BhOcedTo.js → text-inputs-Dh9XGyiS.js} +4 -4
- package/dist/{text-inputs-BhOcedTo.js.map → text-inputs-Dh9XGyiS.js.map} +1 -1
- package/dist/{timelines-CnZ2S_Gr.js → timelines-B9ICkQcV.js} +2 -2
- package/dist/{timelines-CnZ2S_Gr.js.map → timelines-B9ICkQcV.js.map} +1 -1
- package/dist/{tree-COD9BGdU.js → tree-BdWSaoFT.js} +2 -2
- package/dist/{tree-COD9BGdU.js.map → tree-BdWSaoFT.js.map} +1 -1
- package/dist/{upload-DIzw1dx1.js → upload-D8Za5x_c.js} +4 -4
- package/dist/{upload-DIzw1dx1.js.map → upload-D8Za5x_c.js.map} +1 -1
- package/dist/{upload-queue-xRJ3qDmd.js → upload-queue-hIIYBLS7.js} +3 -3
- package/dist/{upload-queue-xRJ3qDmd.js.map → upload-queue-hIIYBLS7.js.map} +1 -1
- package/dist/usage-card-DnmnJ58D.js +458 -0
- package/dist/usage-card-DnmnJ58D.js.map +1 -0
- package/dist/{value-inputs-Co1fu-xv.js → value-inputs-DX2dbxjj.js} +7 -7
- package/dist/{value-inputs-Co1fu-xv.js.map → value-inputs-DX2dbxjj.js.map} +1 -1
- package/dist/{workspace-Cbqz4FzN.js → workspace-C1PZmk8L.js} +4 -4
- package/dist/{workspace-Cbqz4FzN.js.map → workspace-C1PZmk8L.js.map} +1 -1
- package/docs/consumer-skill/SKILL.md +120 -17
- package/docs/consumer-skill/examples/detail.tsx +7 -8
- package/docs/consumer-skill/examples/manifest.json +14 -0
- 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/references/composition.md +103 -0
- package/docs/consumer-skill/references/design-contract.md +4 -3
- package/docs/consumer-skill/references/discovery.md +17 -0
- package/docs/consumer-skill/references/installation.md +20 -3
- package/docs/consumer-skill/references/integration.md +12 -0
- package/docs/consumer-skill/references/public-api.json +452 -229
- package/docs/consumer-skill/references/review.md +74 -0
- package/docs/consumer-skill/references/tokens.json +1 -1
- package/docs/consumer-skill/references/workflows.md +97 -1
- package/docs/consumer-skill/scripts/check-composition.mjs +31 -0
- package/docs/consumer-skill/scripts/composition-policy.mjs +155 -0
- package/docs/consumer-skill/scripts/discovery.mjs +6 -1
- package/docs/consumer-skill/scripts/surface-policy.mjs +22 -0
- package/package.json +24 -3
- package/dist/affordance-geometry.generated-DXl-Zb3Z.js.map +0 -1
- package/dist/avatar-CsnWaYmt.js.map +0 -1
- package/dist/choice-inputs-CavA-SGV.js.map +0 -1
- package/dist/containers-CPNyNo1_.js.map +0 -1
- package/dist/feedback-a9j9J-9A.js +0 -391
- package/dist/feedback-a9j9J-9A.js.map +0 -1
- package/dist/smart-card-B5FcKODh.js.map +0 -1
- package/dist/structure.recipes-DjqnBpwz.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rich-text-editor-BZSJchAF.js","names":["NumberValue","_Fragment","EditorContent","StarterKit","Text","editableContentClassName","SecondaryValue","Number","Textarea","RichTextEditorToolbar","richTextEditorRecipes","defaultRichTextEditorStrings","Fragment$1","TiptapReact","StarterKitModule","readCaretContext","sel","range","startNode","startOffset","block","editable","text","cursor","prev","rect","r","replaceBeforeCaret","caret","remaining","length","take","previousTextNode","editor","html","notifyChange","fragment","insertHtmlIntoEditable","current","node","CountsFooterText","chars","words","overLimit","maxLength","cn","className","strings","CountsFooter","sourceMode","sourceValue","normalizeHtml","trimmed","value","toEditorContent","normalized","EditorContent$1","useTiptapEditor","StarterKit$1","TiptapRichTextEditor","forwardRef","stringsProp","useStrings","isFocused","setIsFocused","useState","setSourceMode","setSourceValue","isFocusedRef","useRef","externalValueRef","onCaretChangeRef","onCaretChange","disabled","autoFocus","currentEditor","onValueChange","useEffect","next","handler","useImperativeHandle","ref","contentStyle","useMemo","minHeight","compact","maxHeight","toggleSourceMode","useCallback","handleSourceChange","toolbarButtons","Bold","Italic","Strikethrough","List","ListOrdered","Quote","Undo2","Redo2","countsFooter","showCounts","placeholderText","placeholder","placeholderNode","footerSlot","hasTiptapRuntime","FallbackRichTextEditor","editableRef","setEditableRef","emitEditableChange","isEmpty","RichTextEditor","props"],"sources":["../src/components/features/rich-text-editor/partials/caret-helpers.ts","../src/components/features/rich-text-editor/partials/counts-footer.tsx","../src/components/features/rich-text-editor/partials/html-helpers.ts","../src/components/features/rich-text-editor/partials/rich-text-editor-tiptap.tsx","../src/components/features/rich-text-editor/partials/rich-text-editor-fallback.tsx","../src/components/features/rich-text-editor/rich-text-editor.tsx"],"sourcesContent":["/**\n * Caret-introspection helpers used by `<RichTextEditor>` to expose the\n * text before the caret and replace a leading run of characters with\n * inline HTML — the building blocks for `@`-mention chips and similar\n * inline triggers.\n */\nimport type { RichTextCaretContext, TiptapEditor } from '../rich-text-editor.types';\n\n/**\n * Read the current selection's caret context.\n *\n * Walks back from the caret through the current text node and any\n * preceding sibling text nodes inside the same block-level container\n * (paragraph / list-item / heading) collecting plain text. Returns the\n * accumulated text plus the caret's bounding rect when available.\n *\n * Returns `null` when there is no live selection or the selection isn't\n * a text caret inside a contenteditable.\n */\nexport function readCaretContext(): RichTextCaretContext | null {\n\tif (typeof window === 'undefined') return null;\n\tconst sel = window.getSelection();\n\tif (!sel || sel.rangeCount === 0) return null;\n\tconst range = sel.getRangeAt(0);\n\tif (!range.collapsed) return null;\n\n\tconst startNode = range.startContainer;\n\tconst startOffset = range.startOffset;\n\n\tlet block: Node | null = startNode;\n\twhile (block && block.nodeType !== Node.ELEMENT_NODE) {\n\t\tblock = block.parentNode;\n\t}\n\tif (!block) return null;\n\tconst editable =\n\t\t(block as Element).closest('[contenteditable=\"true\"]') ??\n\t\t(block as Element).closest('.ProseMirror');\n\tif (!editable) return null;\n\n\tlet text = '';\n\tif (startNode.nodeType === Node.TEXT_NODE) {\n\t\ttext = (startNode.textContent ?? '').slice(0, startOffset);\n\t}\n\n\tlet cursor: Node | null = startNode;\n\twhile (cursor && cursor !== editable && cursor !== block) {\n\t\tlet prev: Node | null = cursor.previousSibling;\n\t\twhile (prev) {\n\t\t\ttext = (prev.textContent ?? '') + text;\n\t\t\tprev = prev.previousSibling;\n\t\t}\n\t\tcursor = cursor.parentNode;\n\t\tif (cursor && (cursor as Element).matches?.('p, li, h1, h2, h3, h4, h5, h6, blockquote')) {\n\t\t\tbreak;\n\t\t}\n\t}\n\n\tlet rect: RichTextCaretContext['rect'];\n\tconst r = range.getBoundingClientRect();\n\tif (r && (r.top || r.left || r.right || r.bottom)) {\n\t\trect = { top: r.top, left: r.left, bottom: r.bottom, right: r.right };\n\t}\n\n\treturn { textBefore: text, rect };\n}\n\n/**\n * Extend the selection backwards by `length` characters, then insert\n * `html`. The selection extension means `editor.insertContent` (or the\n * fallback's `range.deleteContents()` + insert) replaces the trigger\n * range with the chip atomically — no manual text-content mutation, no\n * timing races between \"delete\" and \"insert\".\n */\nexport function replaceBeforeCaret(\n\teditor: TiptapEditor | null,\n\tlength: number,\n\thtml: string,\n\tnotifyChange: (next: string) => void,\n): void {\n\tif (typeof window === 'undefined') return;\n\tconst sel = window.getSelection();\n\tif (!sel || sel.rangeCount === 0) return;\n\tconst caret = sel.getRangeAt(0);\n\tif (!caret.collapsed) return;\n\n\tlet remaining = length;\n\tlet startNode: Node = caret.startContainer;\n\tlet startOffset = caret.startOffset;\n\n\twhile (remaining > 0) {\n\t\tif (startNode.nodeType === Node.TEXT_NODE) {\n\t\t\tconst take = Math.min(startOffset, remaining);\n\t\t\tstartOffset -= take;\n\t\t\tremaining -= take;\n\t\t\tif (remaining === 0) break;\n\t\t}\n\t\tconst prev = previousTextNode(startNode);\n\t\tif (!prev) break;\n\t\tstartNode = prev;\n\t\tstartOffset = prev.textContent?.length ?? 0;\n\t}\n\n\tconst range = document.createRange();\n\trange.setStart(startNode, startOffset);\n\trange.setEnd(caret.endContainer, caret.endOffset);\n\tsel.removeAllRanges();\n\tsel.addRange(range);\n\n\tif (editor) {\n\t\teditor.chain().focus().insertContent(html).run();\n\t\tnotifyChange(editor.getHTML());\n\t\treturn;\n\t}\n\n\trange.deleteContents();\n\tconst fragment = document.createRange().createContextualFragment(html);\n\trange.insertNode(fragment);\n\tsel.collapseToEnd();\n\tconst editable =\n\t\t(startNode as Element | null)?.parentElement?.closest?.('[contenteditable=\"true\"]') ?? null;\n\tif (editable) notifyChange((editable as HTMLElement).innerHTML);\n}\n\nexport function insertHtmlIntoEditable(editable: HTMLElement | null, html: string): void {\n\tif (typeof window === 'undefined' || !editable) return;\n\teditable.focus();\n\n\tconst sel = window.getSelection();\n\tif (!sel || sel.rangeCount === 0) {\n\t\teditable.insertAdjacentHTML('beforeend', html);\n\t\treturn;\n\t}\n\n\tconst range = sel.getRangeAt(0);\n\tif (!editable.contains(range.commonAncestorContainer)) {\n\t\teditable.insertAdjacentHTML('beforeend', html);\n\t\treturn;\n\t}\n\n\trange.deleteContents();\n\tconst fragment = document.createRange().createContextualFragment(html);\n\trange.insertNode(fragment);\n\trange.collapse(false);\n\tsel.removeAllRanges();\n\tsel.addRange(range);\n}\n\nfunction previousTextNode(node: Node): Node | null {\n\tlet current: Node | null = node;\n\twhile (current) {\n\t\tif (current.previousSibling) {\n\t\t\tcurrent = current.previousSibling;\n\t\t\twhile (current && current.lastChild) {\n\t\t\t\tcurrent = current.lastChild;\n\t\t\t}\n\t\t\tif (current && current.nodeType === Node.TEXT_NODE) return current;\n\t\t\tcontinue;\n\t\t}\n\t\tcurrent = current.parentNode;\n\t\tif (!current || (current as Element).matches?.('p, li, h1, h2, h3, h4, h5, h6, blockquote, [contenteditable=\"true\"]')) {\n\t\t\treturn null;\n\t\t}\n\t}\n\treturn null;\n}\n","import { Number as NumberValue, SecondaryValue } from '../../../primitives';\nimport { Text } from '../../../typography';\nimport { cn } from '../../../../lib/utils';\n\nimport type { RichTextEditorStrings } from '../rich-text-editor.strings';\nimport type { TiptapEditor } from '../rich-text-editor.types';\n\nexport interface CountsFooterTextProps {\n\t/** Plain-text projection of the document, used for the character count. */\n\ttext: string;\n\t/** Character cap the count is measured against. */\n\tmaxLength?: number;\n\t/** Overrides this surface's own copy. */\n\tstrings: RichTextEditorStrings;\n\t/** Merged onto the outermost node. */\n\tclassName?: string;\n}\n\nexport function CountsFooterText({ text, maxLength, strings, className }: CountsFooterTextProps) {\n\tconst chars = text.length;\n\tconst words = text.trim().length > 0 ? text.trim().split(/\\s+/).length : 0;\n\tconst overLimit = typeof maxLength === 'number' && chars > maxLength;\n\n\treturn (\n\t\t<div className={cn('counts-footer-text--component border-border flex items-center justify-end gap-space-lg border-t px-control py-space-sm', className)}>\n\t\t\t<Text\n\t\t\t\ttag=\"span\"\n\t\t\t\tsize=\"xs\"\n\t\t\t\ttype={overLimit ? 'error' : 'secondary'}\n\t\t\t\tweight={overLimit ? 'medium' : 'regular'}\n\t\t\t\tclassName={cn('tabular-nums')}\n\t\t\t>\n\t\t\t\t<NumberValue value={chars} size=\"xs\" type={overLimit ? 'error' : 'secondary'} align=\"left\" />\n\t\t\t\t{typeof maxLength === 'number' && (\n\t\t\t\t\t<> / <NumberValue value={maxLength} size=\"xs\" type={overLimit ? 'error' : 'secondary'} align=\"left\" /></>\n\t\t\t\t)} {strings.counts.characters}\n\t\t\t</Text>\n\t\t\t<SecondaryValue size=\"xs\" className=\"tabular-nums\">\n\t\t\t\t<NumberValue value={words} size=\"xs\" type=\"secondary\" align=\"left\" /> {strings.counts.words}\n\t\t\t</SecondaryValue>\n\t\t</div>\n\t);\n}\n\nCountsFooterText.displayName = 'CountsFooterText';\n\nexport interface CountsFooterProps {\n\t/** The editor instance, for reading counts directly. */\n\teditor: TiptapEditor;\n\t/** Whether the editor is showing HTML source. */\n\tsourceMode: boolean;\n\t/** Raw HTML while in source mode. */\n\tsourceValue: string;\n\t/** Character cap the count is measured against. */\n\tmaxLength?: number;\n\t/** Overrides this surface's own copy. */\n\tstrings: RichTextEditorStrings;\n}\n\nexport function CountsFooter({\n\teditor,\n\tsourceMode,\n\tsourceValue,\n\tmaxLength,\n\tstrings,\n}: CountsFooterProps) {\n\tconst text = sourceMode\n\t\t? sourceValue.replace(/<[^>]*>/g, '')\n\t\t: (editor?.getText() ?? '');\n\n\treturn <CountsFooterText text={text} maxLength={maxLength} strings={strings} />;\n}\n\nCountsFooter.displayName = 'CountsFooter';\n","/**\n * Plain HTML normalization shared by the TipTap and contenteditable\n * fallback editors. Keeping these out of the React tree means the\n * editor partials stay focused on rendering.\n */\n\nexport function normalizeHtml(value: string): string {\n\tconst trimmed = value.trim();\n\n\tif (trimmed === '' || trimmed === '<p></p>' || trimmed === '<p><br></p>') {\n\t\treturn '';\n\t}\n\n\treturn trimmed;\n}\n\nexport function toEditorContent(value: string): string {\n\tconst normalized = normalizeHtml(value);\n\treturn normalized === '' ? '<p></p>' : normalized;\n}\n","import {\n\tforwardRef,\n\tuseCallback,\n\tuseEffect,\n\tuseImperativeHandle,\n\tuseMemo,\n\tuseRef,\n\tuseState,\n} from 'react';\nimport {\n\tBold,\n\tItalic,\n\tList,\n\tListOrdered,\n\tQuote,\n\tRedo2,\n\tStrikethrough,\n\tUndo2,\n} from 'lucide-react';\nimport * as TiptapReact from '@tiptap/react';\nimport * as StarterKitModule from '@tiptap/starter-kit';\n\nimport { richTextEditorRecipes } from '../rich-text-editor.recipes';\nimport { editableContentClassName } from '../../../typography/content-typography';\n\nimport { Textarea } from '../../../base/text-inputs';\nimport { Text } from '../../../typography';\nimport { useStrings } from '../../../../lib/strings';\nimport { cn } from '../../../../lib/utils';\n\nimport { defaultRichTextEditorStrings } from '../rich-text-editor.strings';\nimport type {\n\tRichTextEditorHandle,\n\tRichTextEditorProps,\n\tToolbarButtonConfig,\n} from '../rich-text-editor.types';\nimport { readCaretContext, replaceBeforeCaret } from './caret-helpers';\nimport { CountsFooter } from './counts-footer';\nimport { normalizeHtml, toEditorContent } from './html-helpers';\nimport { RichTextEditorToolbar } from './rich-text-editor-toolbar';\n\nconst EditorContent = TiptapReact.EditorContent;\nconst useTiptapEditor = TiptapReact.useEditor;\nconst StarterKit =\n\t'default' in StarterKitModule ? StarterKitModule.default : StarterKitModule;\n\nexport const TiptapRichTextEditor = forwardRef<RichTextEditorHandle, RichTextEditorProps>(function TiptapRichTextEditor(\n\t{\n\t\tvalue,\n\t\tonValueChange,\n\t\tplaceholder,\n\t\tcompact = false,\n\t\tminHeight,\n\t\tmaxHeight,\n\t\tdisabled = false,\n\t\tshowCounts = false,\n\t\tmaxLength,\n\t\textraToolbarItems,\n\t\ttoolbarTrailing,\n\t\tfooterSlot,\n\t\thideSourceToggle = false,\n\t\tautoFocus = false,\n\t\tclassName,\n\t\tonCaretChange,\n\t\tstrings: stringsProp,\n\t},\n\tref,\n) {\n\tconst strings = useStrings(defaultRichTextEditorStrings, stringsProp);\n\tconst [isFocused, setIsFocused] = useState(false);\n\tconst [sourceMode, setSourceMode] = useState(false);\n\tconst [sourceValue, setSourceValue] = useState('');\n\tconst isFocusedRef = useRef(false);\n\tconst externalValueRef = useRef<string>(normalizeHtml(value));\n\tconst onCaretChangeRef = useRef(onCaretChange);\n\tonCaretChangeRef.current = onCaretChange;\n\n\tconst editor = useTiptapEditor({\n\t\textensions: [StarterKit],\n\t\tcontent: toEditorContent(value),\n\t\teditable: !disabled,\n\t\timmediatelyRender: false,\n\t\tautofocus: autoFocus ? 'end' : false,\n\t\tonFocus: () => {\n\t\t\tisFocusedRef.current = true;\n\t\t\tsetIsFocused(true);\n\t\t},\n\t\tonBlur: () => {\n\t\t\tisFocusedRef.current = false;\n\t\t\tsetIsFocused(false);\n\t\t},\n\t\tonUpdate: ({ editor: currentEditor }: { editor: { getHTML: () => string } }) => {\n\t\t\tconst html = normalizeHtml(currentEditor.getHTML());\n\t\t\tif (!isFocusedRef.current) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (html !== externalValueRef.current) {\n\t\t\t\texternalValueRef.current = html;\n\t\t\t\tonValueChange(html);\n\t\t\t}\n\n\t\t\tonCaretChangeRef.current?.();\n\t\t},\n\t\teditorProps: {\n\t\t\tattributes: {\n\t\t\t\trole: 'textbox',\n\t\t\t\t'aria-label': strings.editorLabel,\n\t\t\t\t'aria-multiline': 'true',\n\t\t\t\tclass: editableContentClassName,\n\t\t\t},\n\t\t},\n\t});\n\n\tuseEffect(() => {\n\t\tif (!editor) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst current = normalizeHtml(editor.getHTML());\n\t\tconst next = normalizeHtml(value);\n\t\texternalValueRef.current = next;\n\n\t\tif (current !== next) {\n\t\t\teditor.commands.setContent(toEditorContent(next), { emitUpdate: false });\n\t\t}\n\t}, [editor, value]);\n\n\tuseEffect(() => {\n\t\tif (!editor) {\n\t\t\treturn;\n\t\t}\n\n\t\teditor.setEditable(!disabled);\n\t}, [disabled, editor]);\n\n\tuseEffect(() => {\n\t\tif (typeof document === 'undefined') return;\n\t\tconst handler = () => {\n\t\t\tif (!isFocusedRef.current) return;\n\t\t\tonCaretChangeRef.current?.();\n\t\t};\n\t\tdocument.addEventListener('selectionchange', handler);\n\t\treturn () => document.removeEventListener('selectionchange', handler);\n\t}, []);\n\n\tuseImperativeHandle(\n\t\tref,\n\t\t() => ({\n\t\t\tfocus: () => {\n\t\t\t\teditor?.chain().focus().run();\n\t\t\t},\n\t\t\tgetHTML: () => normalizeHtml(editor?.getHTML() ?? ''),\n\t\t\tsetHTML: (html: string) => {\n\t\t\t\tconst next = normalizeHtml(html);\n\t\t\t\texternalValueRef.current = next;\n\t\t\t\teditor?.commands.setContent(toEditorContent(next), { emitUpdate: false });\n\t\t\t\tonValueChange(next);\n\t\t\t},\n\t\t\tinsertHTML: (html: string) => {\n\t\t\t\tif (!editor) return;\n\t\t\t\teditor.chain().focus().insertContent(html).run();\n\t\t\t},\n\t\t\tisEmpty: () => normalizeHtml(editor?.getHTML() ?? '') === '',\n\t\t\tclear: () => {\n\t\t\t\texternalValueRef.current = '';\n\t\t\t\teditor?.commands.setContent('<p></p>', { emitUpdate: false });\n\t\t\t\tonValueChange('');\n\t\t\t},\n\t\t\tgetCaretContext: () => readCaretContext(),\n\t\t\treplaceBeforeCaret: (length: number, html: string) => {\n\t\t\t\treplaceBeforeCaret(editor, length, html, (next) => {\n\t\t\t\t\texternalValueRef.current = normalizeHtml(next);\n\t\t\t\t\tonValueChange(externalValueRef.current);\n\t\t\t\t});\n\t\t\t},\n\t\t}),\n\t\t[editor, onValueChange],\n\t);\n\n\tconst contentStyle = useMemo(\n\t\t() => ({\n\t\t\tminHeight: minHeight ?? (compact ? '2rem' : '12rem'),\n\t\t\t...(maxHeight ? { maxHeight, overflowY: 'auto' as const } : {}),\n\t\t}),\n\t\t[compact, maxHeight, minHeight],\n\t);\n\n\tconst toggleSourceMode = useCallback(() => {\n\t\tif (!editor) return;\n\n\t\tif (sourceMode) {\n\t\t\tconst html = toEditorContent(sourceValue);\n\t\t\teditor.commands.setContent(html, { emitUpdate: false });\n\t\t\tconst normalized = normalizeHtml(sourceValue);\n\t\t\texternalValueRef.current = normalized;\n\t\t\tonValueChange(normalized);\n\t\t\tsetSourceMode(false);\n\t\t} else {\n\t\t\tsetSourceValue(editor.getHTML());\n\t\t\tsetSourceMode(true);\n\t\t}\n\t}, [editor, onValueChange, sourceMode, sourceValue]);\n\n\tconst handleSourceChange = useCallback(\n\t\t(e: React.ChangeEvent<HTMLTextAreaElement>) => {\n\t\t\tconst next = e.target.value;\n\t\t\tsetSourceValue(next);\n\t\t\tconst normalized = normalizeHtml(next);\n\t\t\texternalValueRef.current = normalized;\n\t\t\tonValueChange(normalized);\n\t\t},\n\t\t[onValueChange],\n\t);\n\n\tconst toolbarButtons = useMemo<ToolbarButtonConfig[]>(\n\t\t() => [\n\t\t\t{\n\t\t\t\tid: 'bold',\n\t\t\t\ticon: Bold,\n\t\t\t\tlabel: strings.toolbar.bold,\n\t\t\t\tisActive: () => Boolean(editor?.isActive('bold')),\n\t\t\t\trun: () => editor?.chain().focus().toggleBold().run(),\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'italic',\n\t\t\t\ticon: Italic,\n\t\t\t\tlabel: strings.toolbar.italic,\n\t\t\t\tisActive: () => Boolean(editor?.isActive('italic')),\n\t\t\t\trun: () => editor?.chain().focus().toggleItalic().run(),\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'strike',\n\t\t\t\ticon: Strikethrough,\n\t\t\t\tlabel: strings.toolbar.strike,\n\t\t\t\tisActive: () => Boolean(editor?.isActive('strike')),\n\t\t\t\trun: () => editor?.chain().focus().toggleStrike().run(),\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'bullet-list',\n\t\t\t\ticon: List,\n\t\t\t\tlabel: strings.toolbar.bulletList,\n\t\t\t\tisActive: () => Boolean(editor?.isActive('bulletList')),\n\t\t\t\trun: () => editor?.chain().focus().toggleBulletList().run(),\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'ordered-list',\n\t\t\t\ticon: ListOrdered,\n\t\t\t\tlabel: strings.toolbar.orderedList,\n\t\t\t\tisActive: () => Boolean(editor?.isActive('orderedList')),\n\t\t\t\trun: () => editor?.chain().focus().toggleOrderedList().run(),\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'blockquote',\n\t\t\t\ticon: Quote,\n\t\t\t\tlabel: strings.toolbar.blockquote,\n\t\t\t\tisActive: () => Boolean(editor?.isActive('blockquote')),\n\t\t\t\trun: () => editor?.chain().focus().toggleBlockquote().run(),\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'undo',\n\t\t\t\ticon: Undo2,\n\t\t\t\tlabel: strings.toolbar.undo,\n\t\t\t\tisActive: () => false,\n\t\t\t\trun: () => editor?.chain().focus().undo().run(),\n\t\t\t\tdisabled: !editor?.can().chain().focus().undo().run(),\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'redo',\n\t\t\t\ticon: Redo2,\n\t\t\t\tlabel: strings.toolbar.redo,\n\t\t\t\tisActive: () => false,\n\t\t\t\trun: () => editor?.chain().focus().redo().run(),\n\t\t\t\tdisabled: !editor?.can().chain().focus().redo().run(),\n\t\t\t},\n\t\t],\n\t\t[editor, strings],\n\t);\n\n\tconst countsFooter =\n\t\tshowCounts && editor ? (\n\t\t\t<CountsFooter\n\t\t\t\teditor={editor}\n\t\t\t\tsourceMode={sourceMode}\n\t\t\t\tsourceValue={sourceValue}\n\t\t\t\tmaxLength={maxLength}\n\t\t\t\tstrings={strings}\n\t\t\t/>\n\t\t) : null;\n\n\tconst placeholderText = typeof placeholder === 'string' ? placeholder : '';\n\tconst showPlaceholder =\n\t\tplaceholderText.length > 0 && !isFocused && Boolean(editor?.isEmpty);\n\tconst placeholderNode = showPlaceholder ? (\n\t\t<Text\n\t\t\ttag=\"span\"\n\t\t\tsize=\"sm\"\n\t\t\ttype=\"secondary\"\n\t\t\tclassName=\"pointer-events-none absolute inset-0 px-control py-control-y-offset\"\n\t\t>\n\t\t\t{placeholderText}\n\t\t</Text>\n\t) : null;\n\n\treturn (\n\t\t<div\n\t\t\tclassName={cn(\n\t\t\t\trichTextEditorRecipes.frame,\n\t\t\t\tdisabled && richTextEditorRecipes.disabled,\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t>\n\t\t\t<RichTextEditorToolbar\n\t\t\t\tbuttons={toolbarButtons}\n\t\t\t\textraToolbarItems={extraToolbarItems}\n\t\t\t\thideSourceToggle={hideSourceToggle}\n\t\t\t\tsourceMode={sourceMode}\n\t\t\t\ttoggleSourceMode={toggleSourceMode}\n\t\t\t\tdisabled={disabled}\n\t\t\t\thasEditor={Boolean(editor)}\n\t\t\t\ttoolbarTrailing={toolbarTrailing}\n\t\t\t\tstrings={strings}\n\t\t\t/>\n\n\t\t\t{sourceMode ? (\n\t\t\t\t<Textarea\n\t\t\t\t\taria-label={strings.sourceLabel}\n\t\t\t\t\tvalue={sourceValue}\n\t\t\t\t\tonChange={handleSourceChange}\n\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\tspellCheck={false}\n\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t'min-h-0 w-full resize-y rounded-none border-0 bg-muted/50 px-control py-control-y-offset font-mono text-xs leading-relaxed focus-visible:ring-0',\n\t\t\t\t\t\tdisabled && 'cursor-not-allowed',\n\t\t\t\t\t)}\n\t\t\t\t\tstyle={contentStyle}\n\t\t\t\t/>\n\t\t\t) : (\n\t\t\t\t<div className=\"relative\" style={contentStyle}>\n\t\t\t\t\t{placeholderNode}\n\n\t\t\t\t\t<EditorContent\n\t\t\t\t\t\teditor={editor}\n\t\t\t\t\t\tclassName={richTextEditorRecipes.content}\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t)}\n\n\t\t\t{!!footerSlot && (\n\t\t\t\t<div className=\"px-control pb-space-md pt-space-xs\">{footerSlot}</div>\n\t\t\t)}\n\n\t\t\t{countsFooter}\n\t\t</div>\n\t);\n});\n\nTiptapRichTextEditor.displayName = 'TiptapRichTextEditor';\n\nexport const hasTiptapRuntime =\n\ttypeof EditorContent === 'function' &&\n\ttypeof useTiptapEditor === 'function' &&\n\ttypeof StarterKit === 'object' &&\n\tStarterKit !== null;\n","import {\n\tforwardRef,\n\tuseCallback,\n\tuseEffect,\n\tuseImperativeHandle,\n\tuseMemo,\n\tuseRef,\n\tuseState,\n} from 'react';\nimport {\n\tBold,\n\tItalic,\n\tList,\n\tListOrdered,\n\tQuote,\n\tRedo2,\n\tStrikethrough,\n\tUndo2,\n} from 'lucide-react';\n\nimport { richTextEditorRecipes } from '../rich-text-editor.recipes';\nimport { editableContentClassName } from '../../../typography/content-typography';\n\nimport { Textarea } from '../../../base/text-inputs';\nimport { Text } from '../../../typography';\nimport { useStrings } from '../../../../lib/strings';\nimport { cn } from '../../../../lib/utils';\n\nimport { defaultRichTextEditorStrings } from '../rich-text-editor.strings';\nimport type {\n\tRichTextEditorHandle,\n\tRichTextEditorProps,\n\tToolbarButtonConfig,\n} from '../rich-text-editor.types';\nimport {\n\tinsertHtmlIntoEditable,\n\treadCaretContext,\n\treplaceBeforeCaret,\n} from './caret-helpers';\nimport { CountsFooterText } from './counts-footer';\nimport { normalizeHtml, toEditorContent } from './html-helpers';\nimport { RichTextEditorToolbar } from './rich-text-editor-toolbar';\n\n/**\n * Fallback editor used when the TipTap runtime is unavailable (e.g. in\n * environments where the package failed to load). Renders a\n * `contenteditable` surface with the same imperative handle so callers\n * never need to care which variant they got.\n */\nexport const FallbackRichTextEditor = forwardRef<RichTextEditorHandle, RichTextEditorProps>(function FallbackRichTextEditor(\n\t{\n\t\tvalue,\n\t\tonValueChange,\n\t\tplaceholder,\n\t\tcompact = false,\n\t\tminHeight,\n\t\tmaxHeight,\n\t\tdisabled = false,\n\t\tshowCounts = false,\n\t\tmaxLength,\n\t\textraToolbarItems,\n\t\ttoolbarTrailing,\n\t\tfooterSlot,\n\t\thideSourceToggle = false,\n\t\tautoFocus = false,\n\t\tclassName,\n\t\tonCaretChange,\n\t\tstrings: stringsProp,\n\t},\n\tref,\n) {\n\tconst strings = useStrings(defaultRichTextEditorStrings, stringsProp);\n\tconst editableRef = useRef<HTMLDivElement>(null);\n\tconst [isFocused, setIsFocused] = useState(false);\n\tconst [sourceMode, setSourceMode] = useState(false);\n\tconst [sourceValue, setSourceValue] = useState('');\n\tconst externalValueRef = useRef<string>(normalizeHtml(value));\n\tconst onCaretChangeRef = useRef(onCaretChange);\n\tonCaretChangeRef.current = onCaretChange;\n\n\tconst setEditableRef = useCallback((node: HTMLDivElement | null) => {\n\t\teditableRef.current = node;\n\t\tif (node && node.innerHTML === '') {\n\t\t\tnode.innerHTML = toEditorContent(externalValueRef.current);\n\t\t}\n\t}, []);\n\n\tuseEffect(() => {\n\t\tconst editable = editableRef.current;\n\t\tif (!editable || isFocused) return;\n\t\tconst next = toEditorContent(value);\n\t\tif (normalizeHtml(editable.innerHTML) !== normalizeHtml(next)) {\n\t\t\teditable.innerHTML = next;\n\t\t}\n\t\texternalValueRef.current = normalizeHtml(value);\n\t}, [isFocused, value]);\n\n\tuseEffect(() => {\n\t\tif (!autoFocus) return;\n\t\teditableRef.current?.focus();\n\t}, [autoFocus]);\n\n\tconst emitEditableChange = useCallback(() => {\n\t\tconst editable = editableRef.current;\n\t\tconst html = normalizeHtml(editable?.innerHTML ?? '');\n\t\texternalValueRef.current = html;\n\t\tonValueChange(html);\n\t\tonCaretChangeRef.current?.();\n\t}, [onValueChange]);\n\n\tuseImperativeHandle(\n\t\tref,\n\t\t() => ({\n\t\t\tfocus: () => editableRef.current?.focus(),\n\t\t\tgetHTML: () => normalizeHtml(editableRef.current?.innerHTML ?? ''),\n\t\t\tsetHTML: (html: string) => {\n\t\t\t\tconst next = normalizeHtml(html);\n\t\t\t\texternalValueRef.current = next;\n\t\t\t\tif (editableRef.current) {\n\t\t\t\t\teditableRef.current.innerHTML = toEditorContent(next);\n\t\t\t\t}\n\t\t\t\tonValueChange(next);\n\t\t\t},\n\t\t\tinsertHTML: (html: string) => {\n\t\t\t\tinsertHtmlIntoEditable(editableRef.current, html);\n\t\t\t\temitEditableChange();\n\t\t\t},\n\t\t\tisEmpty: () => normalizeHtml(editableRef.current?.innerHTML ?? '') === '',\n\t\t\tclear: () => {\n\t\t\t\texternalValueRef.current = '';\n\t\t\t\tif (editableRef.current) editableRef.current.innerHTML = '<p></p>';\n\t\t\t\tonValueChange('');\n\t\t\t},\n\t\t\tgetCaretContext: () => readCaretContext(),\n\t\t\treplaceBeforeCaret: (length: number, html: string) => {\n\t\t\t\treplaceBeforeCaret(null, length, html, () => emitEditableChange());\n\t\t\t},\n\t\t}),\n\t\t[emitEditableChange, onValueChange],\n\t);\n\n\tconst contentStyle = useMemo(\n\t\t() => ({\n\t\t\tminHeight: minHeight ?? (compact ? '2rem' : '12rem'),\n\t\t\t...(maxHeight ? { maxHeight, overflowY: 'auto' as const } : {}),\n\t\t}),\n\t\t[compact, maxHeight, minHeight],\n\t);\n\n\tconst toggleSourceMode = useCallback(() => {\n\t\tif (sourceMode) {\n\t\t\tconst normalized = normalizeHtml(sourceValue);\n\t\t\texternalValueRef.current = normalized;\n\t\t\tif (editableRef.current) {\n\t\t\t\teditableRef.current.innerHTML = toEditorContent(normalized);\n\t\t\t}\n\t\t\tonValueChange(normalized);\n\t\t\tsetSourceMode(false);\n\t\t\treturn;\n\t\t}\n\t\tsetSourceValue(editableRef.current?.innerHTML ?? toEditorContent(value));\n\t\tsetSourceMode(true);\n\t}, [onValueChange, sourceMode, sourceValue, value]);\n\n\tconst handleSourceChange = useCallback(\n\t\t(e: React.ChangeEvent<HTMLTextAreaElement>) => {\n\t\t\tconst next = e.target.value;\n\t\t\tsetSourceValue(next);\n\t\t\tconst normalized = normalizeHtml(next);\n\t\t\texternalValueRef.current = normalized;\n\t\t\tonValueChange(normalized);\n\t\t},\n\t\t[onValueChange],\n\t);\n\n\tconst placeholderText = typeof placeholder === 'string' ? placeholder : '';\n\tconst isEmpty = normalizeHtml(externalValueRef.current) === '';\n\tconst placeholderNode =\n\t\tplaceholderText.length > 0 && !isFocused && isEmpty ? (\n\t\t\t<Text\n\t\t\t\ttag=\"span\"\n\t\t\t\tsize=\"sm\"\n\t\t\t\ttype=\"secondary\"\n\t\t\t\tclassName=\"pointer-events-none absolute inset-0 px-control py-control-y-offset\"\n\t\t\t>\n\t\t\t\t{placeholderText}\n\t\t\t</Text>\n\t\t) : null;\n\n\tconst toolbarButtons = useMemo<ToolbarButtonConfig[]>(\n\t\t() => [\n\t\t\t{ id: 'bold', icon: Bold, label: strings.toolbar.bold, isActive: () => false, run: () => undefined, disabled: true },\n\t\t\t{ id: 'italic', icon: Italic, label: strings.toolbar.italic, isActive: () => false, run: () => undefined, disabled: true },\n\t\t\t{ id: 'strike', icon: Strikethrough, label: strings.toolbar.strike, isActive: () => false, run: () => undefined, disabled: true },\n\t\t\t{ id: 'bullet-list', icon: List, label: strings.toolbar.bulletList, isActive: () => false, run: () => undefined, disabled: true },\n\t\t\t{ id: 'ordered-list', icon: ListOrdered, label: strings.toolbar.orderedList, isActive: () => false, run: () => undefined, disabled: true },\n\t\t\t{ id: 'blockquote', icon: Quote, label: strings.toolbar.blockquote, isActive: () => false, run: () => undefined, disabled: true },\n\t\t\t{ id: 'undo', icon: Undo2, label: strings.toolbar.undo, isActive: () => false, run: () => undefined, disabled: true },\n\t\t\t{ id: 'redo', icon: Redo2, label: strings.toolbar.redo, isActive: () => false, run: () => undefined, disabled: true },\n\t\t],\n\t\t[strings],\n\t);\n\n\tconst text = sourceMode\n\t\t? sourceValue.replace(/<[^>]*>/g, '')\n\t\t: (editableRef.current?.innerText ?? normalizeHtml(value).replace(/<[^>]*>/g, ''));\n\tconst countsFooter =\n\t\tshowCounts ? (\n\t\t\t<CountsFooterText text={text} maxLength={maxLength} strings={strings} />\n\t\t) : null;\n\n\treturn (\n\t\t<div\n\t\t\tclassName={cn(\n\t\t\t\trichTextEditorRecipes.frame,\n\t\t\t\tdisabled && richTextEditorRecipes.disabled,\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t>\n\t\t\t<RichTextEditorToolbar\n\t\t\t\tbuttons={toolbarButtons}\n\t\t\t\textraToolbarItems={extraToolbarItems}\n\t\t\t\thideSourceToggle={hideSourceToggle}\n\t\t\t\tsourceMode={sourceMode}\n\t\t\t\ttoggleSourceMode={toggleSourceMode}\n\t\t\t\tdisabled={disabled}\n\t\t\t\thasEditor\n\t\t\t\ttoolbarTrailing={toolbarTrailing}\n\t\t\t\tstrings={strings}\n\t\t\t/>\n\n\t\t\t{sourceMode ? (\n\t\t\t\t<Textarea\n\t\t\t\t\taria-label={strings.sourceLabel}\n\t\t\t\t\tvalue={sourceValue}\n\t\t\t\t\tonChange={handleSourceChange}\n\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\tspellCheck={false}\n\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t'min-h-0 w-full resize-y rounded-none border-0 bg-muted/50 px-control py-control-y-offset font-mono text-xs leading-relaxed focus-visible:ring-0',\n\t\t\t\t\t\tdisabled && 'cursor-not-allowed',\n\t\t\t\t\t)}\n\t\t\t\t\tstyle={contentStyle}\n\t\t\t\t/>\n\t\t\t) : (\n\t\t\t\t<div className=\"relative\" style={contentStyle}>\n\t\t\t\t\t{placeholderNode}\n\t\t\t\t\t<div\n\t\t\t\t\t\tref={setEditableRef}\n\t\t\t\t\t\trole=\"textbox\"\n\t\t\t\t\t\taria-label={strings.editorLabel}\n\t\t\t\t\t\taria-multiline=\"true\"\n\t\t\t\t\t\tcontentEditable={!disabled}\n\t\t\t\t\t\tsuppressContentEditableWarning\n\t\t\t\t\t\tonInput={emitEditableChange}\n\t\t\t\t\t\tonKeyUp={() => onCaretChangeRef.current?.()}\n\t\t\t\t\t\tonMouseUp={() => onCaretChangeRef.current?.()}\n\t\t\t\t\t\tonFocus={() => setIsFocused(true)}\n\t\t\t\t\t\tonBlur={() => setIsFocused(false)}\n\t\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t\teditableContentClassName,\n\t\t\t\t\t\t\t'h-full min-h-full',\n\t\t\t\t\t\t\tdisabled && 'cursor-not-allowed',\n\t\t\t\t\t\t)}\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t)}\n\n\t\t\t{!!footerSlot && (\n\t\t\t\t<div className=\"px-control pb-space-md pt-space-xs\">{footerSlot}</div>\n\t\t\t)}\n\n\t\t\t{countsFooter}\n\t\t</div>\n\t);\n});\n\nFallbackRichTextEditor.displayName = 'FallbackRichTextEditor';\n","/**\n * Public `<RichTextEditor>` shell — picks the TipTap-backed editor when\n * the runtime is loaded and falls back to a plain `contenteditable`\n * surface otherwise. Both variants implement the same imperative\n * `RichTextEditorHandle`, so callers don't have to branch.\n *\n * Heavy lifting lives in `partials/`:\n * - `partials/rich-text-editor-tiptap.tsx` — TipTap variant\n * - `partials/rich-text-editor-fallback.tsx` — contenteditable variant\n * - `partials/rich-text-editor-toolbar.tsx` — shared toolbar\n * - `partials/counts-footer.tsx` — char/word counts\n * - `partials/caret-helpers.ts` — caret introspection\n * - `partials/html-helpers.ts` — HTML normalization\n */\nimport { forwardRef } from 'react';\n\nimport {\n\tFallbackRichTextEditor,\n\tTiptapRichTextEditor,\n\thasTiptapRuntime,\n} from './partials';\nimport type {\n\tRichTextEditorHandle,\n\tRichTextEditorProps,\n} from './rich-text-editor.types';\n\nexport const RichTextEditor = forwardRef<RichTextEditorHandle, RichTextEditorProps>(function RichTextEditor(\n\tprops,\n\tref,\n) {\n\tif (!hasTiptapRuntime) {\n\t\treturn <FallbackRichTextEditor className=\"rich-text-editor--component\" {...props} ref={ref} />;\n\t}\n\n\treturn <TiptapRichTextEditor {...props} ref={ref} />;\n});\n\nRichTextEditor.displayName = 'RichTextEditor';\n\nexport type {\n\tRichTextEditorProps,\n\tRichTextEditorHandle,\n\tRichTextEditorToolbarItem,\n\tRichTextCaretContext,\n} from './rich-text-editor.types';\n"],"mappings":";;;;;;;;;;;;;;;;AAmBA,SAAgBe,KAAgD;CAC/D,IAAI,OAAO,SAAW,KAAa,OAAO;CAC1C,IAAMC,IAAM,OAAO,aAAa;CAChC,IAAI,CAACA,KAAOA,EAAI,eAAe,GAAG,OAAO;CACzC,IAAMC,IAAQD,EAAI,WAAW,CAAC;CAC9B,IAAI,CAACC,EAAM,WAAW,OAAO;CAE7B,IAAMC,IAAYD,EAAM,gBAClBE,IAAcF,EAAM,aAEtBG,IAAqBF;CACzB,OAAOE,KAASA,EAAM,aAAa,KAAK,eACvC,IAAQA,EAAM;CAEf,IAAI,CAACA,GAAO,OAAO;CACnB,IAAMC,IACJD,EAAkB,QAAQ,4BAA0B,KACpDA,EAAkB,QAAQ,cAAc;CAC1C,IAAI,CAACC,GAAU,OAAO;CAEtB,IAAIC,IAAO;CACX,AAAIJ,EAAU,aAAa,KAAK,cAC/B,KAAQA,EAAU,eAAe,GAAA,CAAI,MAAM,GAAGC,CAAW;CAG1D,IAAII,IAAsBL;CAC1B,OAAOK,KAAUA,MAAWF,KAAYE,MAAWH,IAAO;EACzD,IAAII,IAAoBD,EAAO;EAC/B,OAAOC,IAEN,AADA,KAAQA,EAAK,eAAe,MAAMF,GAClC,IAAOE,EAAK;EAGb,IADA,IAASD,EAAO,YACZA,KAAWA,EAAmB,UAAU,2CAA2C,GACtF;CAEF;CAEA,IAAIE,GACEC,IAAIT,EAAM,sBAAsB;CAKtC,OAJI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C,WAAWK,EACVnC,EAAsB,OACtB+D,KAAY/D,EAAsB,UAClCoC,CACD;EALD,UAAA;GAOC,kBAACrC,GAAD;IACC,SAASiF;IACU;IACD;IACN;IACM;IACR;IACV,WAAA;IACiB;IACR;GACT,CAAA;GAEAzC,IACA,kBAACzC,GAAD;IACC,cAAYuC,EAAQ;IACpB,OAAOG;IACP,UAAUuC;IACA;IACV,YAAY;IACZ,WAAW5C,EACV,mJACA4B,KAAY,oBACb;IACA,OAAOS;GACP,CAAA,IAED,kBAAC,OAAD;IAAK,WAAU;IAAW,OAAOA;IAAjC,UAAA,CACEqB,IACD,kBAAC,OAAD;KACC,KAAKK;KACL,MAAK;KACL,cAAY7D,EAAQ;KACpB,kBAAe;KACf,iBAAiB,CAAC0B;KAClB,gCAAA;KACA,SAASoC;KACT,eAAetC,EAAiB,UAAU;KAC1C,iBAAiBA,EAAiB,UAAU;KAC5C,eAAeP,EAAa,EAAI;KAChC,cAAcA,EAAa,EAAK;KAChC,WAAWnB,EACVxC,GACA,qBACAoE,KAAY,oBACb;IACA,CAAA,CACG;;GAGL,CAAC,CAAC+B,KACF,kBAAC,OAAD;IAAK,WAAU;IAAsC,UAAAA;GAAgB,CAAA;GAGrEL;EACG;;AAEP,CAAC;AAED,EAAuB,cAAc;;;AC3PrC,IAAaY,IAAiBnD,EAAsD,SACnF,GACA,GACC;CAKD,OAJK6C,IAIE,kBAAC9C,GAAD;EAAsB,GAAIqD;EAAY;CAAM,CAAA,IAH3C,kBAACN,GAAD;EAAwB,WAAU;EAA8B,GAAIM;EAAY;CAAM,CAAA;AAI/F,CAAC;AAED,EAAe,cAAc"}
|
|
1
|
+
{"version":3,"file":"rich-text-editor-CoVrTiSv.js","names":["NumberValue","_Fragment","EditorContent","StarterKit","Text","editableContentClassName","SecondaryValue","Number","Textarea","RichTextEditorToolbar","richTextEditorRecipes","defaultRichTextEditorStrings","Fragment$1","TiptapReact","StarterKitModule","readCaretContext","sel","range","startNode","startOffset","block","editable","text","cursor","prev","rect","r","replaceBeforeCaret","caret","remaining","length","take","previousTextNode","editor","html","notifyChange","fragment","insertHtmlIntoEditable","current","node","CountsFooterText","chars","words","overLimit","maxLength","cn","className","strings","CountsFooter","sourceMode","sourceValue","normalizeHtml","trimmed","value","toEditorContent","normalized","EditorContent$1","useTiptapEditor","StarterKit$1","TiptapRichTextEditor","forwardRef","stringsProp","useStrings","isFocused","setIsFocused","useState","setSourceMode","setSourceValue","isFocusedRef","useRef","externalValueRef","onCaretChangeRef","onCaretChange","disabled","autoFocus","currentEditor","onValueChange","useEffect","next","handler","useImperativeHandle","ref","contentStyle","useMemo","minHeight","compact","maxHeight","toggleSourceMode","useCallback","handleSourceChange","toolbarButtons","Bold","Italic","Strikethrough","List","ListOrdered","Quote","Undo2","Redo2","countsFooter","showCounts","placeholderText","placeholder","placeholderNode","footerSlot","hasTiptapRuntime","FallbackRichTextEditor","editableRef","setEditableRef","emitEditableChange","isEmpty","RichTextEditor","props"],"sources":["../src/components/features/rich-text-editor/partials/caret-helpers.ts","../src/components/features/rich-text-editor/partials/counts-footer.tsx","../src/components/features/rich-text-editor/partials/html-helpers.ts","../src/components/features/rich-text-editor/partials/rich-text-editor-tiptap.tsx","../src/components/features/rich-text-editor/partials/rich-text-editor-fallback.tsx","../src/components/features/rich-text-editor/rich-text-editor.tsx"],"sourcesContent":["/**\n * Caret-introspection helpers used by `<RichTextEditor>` to expose the\n * text before the caret and replace a leading run of characters with\n * inline HTML — the building blocks for `@`-mention chips and similar\n * inline triggers.\n */\nimport type { RichTextCaretContext, TiptapEditor } from '../rich-text-editor.types';\n\n/**\n * Read the current selection's caret context.\n *\n * Walks back from the caret through the current text node and any\n * preceding sibling text nodes inside the same block-level container\n * (paragraph / list-item / heading) collecting plain text. Returns the\n * accumulated text plus the caret's bounding rect when available.\n *\n * Returns `null` when there is no live selection or the selection isn't\n * a text caret inside a contenteditable.\n */\nexport function readCaretContext(): RichTextCaretContext | null {\n\tif (typeof window === 'undefined') return null;\n\tconst sel = window.getSelection();\n\tif (!sel || sel.rangeCount === 0) return null;\n\tconst range = sel.getRangeAt(0);\n\tif (!range.collapsed) return null;\n\n\tconst startNode = range.startContainer;\n\tconst startOffset = range.startOffset;\n\n\tlet block: Node | null = startNode;\n\twhile (block && block.nodeType !== Node.ELEMENT_NODE) {\n\t\tblock = block.parentNode;\n\t}\n\tif (!block) return null;\n\tconst editable =\n\t\t(block as Element).closest('[contenteditable=\"true\"]') ??\n\t\t(block as Element).closest('.ProseMirror');\n\tif (!editable) return null;\n\n\tlet text = '';\n\tif (startNode.nodeType === Node.TEXT_NODE) {\n\t\ttext = (startNode.textContent ?? '').slice(0, startOffset);\n\t}\n\n\tlet cursor: Node | null = startNode;\n\twhile (cursor && cursor !== editable && cursor !== block) {\n\t\tlet prev: Node | null = cursor.previousSibling;\n\t\twhile (prev) {\n\t\t\ttext = (prev.textContent ?? '') + text;\n\t\t\tprev = prev.previousSibling;\n\t\t}\n\t\tcursor = cursor.parentNode;\n\t\tif (cursor && (cursor as Element).matches?.('p, li, h1, h2, h3, h4, h5, h6, blockquote')) {\n\t\t\tbreak;\n\t\t}\n\t}\n\n\tlet rect: RichTextCaretContext['rect'];\n\tconst r = range.getBoundingClientRect();\n\tif (r && (r.top || r.left || r.right || r.bottom)) {\n\t\trect = { top: r.top, left: r.left, bottom: r.bottom, right: r.right };\n\t}\n\n\treturn { textBefore: text, rect };\n}\n\n/**\n * Extend the selection backwards by `length` characters, then insert\n * `html`. The selection extension means `editor.insertContent` (or the\n * fallback's `range.deleteContents()` + insert) replaces the trigger\n * range with the chip atomically — no manual text-content mutation, no\n * timing races between \"delete\" and \"insert\".\n */\nexport function replaceBeforeCaret(\n\teditor: TiptapEditor | null,\n\tlength: number,\n\thtml: string,\n\tnotifyChange: (next: string) => void,\n): void {\n\tif (typeof window === 'undefined') return;\n\tconst sel = window.getSelection();\n\tif (!sel || sel.rangeCount === 0) return;\n\tconst caret = sel.getRangeAt(0);\n\tif (!caret.collapsed) return;\n\n\tlet remaining = length;\n\tlet startNode: Node = caret.startContainer;\n\tlet startOffset = caret.startOffset;\n\n\twhile (remaining > 0) {\n\t\tif (startNode.nodeType === Node.TEXT_NODE) {\n\t\t\tconst take = Math.min(startOffset, remaining);\n\t\t\tstartOffset -= take;\n\t\t\tremaining -= take;\n\t\t\tif (remaining === 0) break;\n\t\t}\n\t\tconst prev = previousTextNode(startNode);\n\t\tif (!prev) break;\n\t\tstartNode = prev;\n\t\tstartOffset = prev.textContent?.length ?? 0;\n\t}\n\n\tconst range = document.createRange();\n\trange.setStart(startNode, startOffset);\n\trange.setEnd(caret.endContainer, caret.endOffset);\n\tsel.removeAllRanges();\n\tsel.addRange(range);\n\n\tif (editor) {\n\t\teditor.chain().focus().insertContent(html).run();\n\t\tnotifyChange(editor.getHTML());\n\t\treturn;\n\t}\n\n\trange.deleteContents();\n\tconst fragment = document.createRange().createContextualFragment(html);\n\trange.insertNode(fragment);\n\tsel.collapseToEnd();\n\tconst editable =\n\t\t(startNode as Element | null)?.parentElement?.closest?.('[contenteditable=\"true\"]') ?? null;\n\tif (editable) notifyChange((editable as HTMLElement).innerHTML);\n}\n\nexport function insertHtmlIntoEditable(editable: HTMLElement | null, html: string): void {\n\tif (typeof window === 'undefined' || !editable) return;\n\teditable.focus();\n\n\tconst sel = window.getSelection();\n\tif (!sel || sel.rangeCount === 0) {\n\t\teditable.insertAdjacentHTML('beforeend', html);\n\t\treturn;\n\t}\n\n\tconst range = sel.getRangeAt(0);\n\tif (!editable.contains(range.commonAncestorContainer)) {\n\t\teditable.insertAdjacentHTML('beforeend', html);\n\t\treturn;\n\t}\n\n\trange.deleteContents();\n\tconst fragment = document.createRange().createContextualFragment(html);\n\trange.insertNode(fragment);\n\trange.collapse(false);\n\tsel.removeAllRanges();\n\tsel.addRange(range);\n}\n\nfunction previousTextNode(node: Node): Node | null {\n\tlet current: Node | null = node;\n\twhile (current) {\n\t\tif (current.previousSibling) {\n\t\t\tcurrent = current.previousSibling;\n\t\t\twhile (current && current.lastChild) {\n\t\t\t\tcurrent = current.lastChild;\n\t\t\t}\n\t\t\tif (current && current.nodeType === Node.TEXT_NODE) return current;\n\t\t\tcontinue;\n\t\t}\n\t\tcurrent = current.parentNode;\n\t\tif (!current || (current as Element).matches?.('p, li, h1, h2, h3, h4, h5, h6, blockquote, [contenteditable=\"true\"]')) {\n\t\t\treturn null;\n\t\t}\n\t}\n\treturn null;\n}\n","import { Number as NumberValue, SecondaryValue } from '../../../primitives';\nimport { Text } from '../../../typography';\nimport { cn } from '../../../../lib/utils';\n\nimport type { RichTextEditorStrings } from '../rich-text-editor.strings';\nimport type { TiptapEditor } from '../rich-text-editor.types';\n\nexport interface CountsFooterTextProps {\n\t/** Plain-text projection of the document, used for the character count. */\n\ttext: string;\n\t/** Character cap the count is measured against. */\n\tmaxLength?: number;\n\t/** Overrides this surface's own copy. */\n\tstrings: RichTextEditorStrings;\n\t/** Merged onto the outermost node. */\n\tclassName?: string;\n}\n\nexport function CountsFooterText({ text, maxLength, strings, className }: CountsFooterTextProps) {\n\tconst chars = text.length;\n\tconst words = text.trim().length > 0 ? text.trim().split(/\\s+/).length : 0;\n\tconst overLimit = typeof maxLength === 'number' && chars > maxLength;\n\n\treturn (\n\t\t<div className={cn('counts-footer-text--component border-border flex items-center justify-end gap-space-lg border-t px-control py-space-sm', className)}>\n\t\t\t<Text\n\t\t\t\ttag=\"span\"\n\t\t\t\tsize=\"xs\"\n\t\t\t\ttype={overLimit ? 'error' : 'secondary'}\n\t\t\t\tweight={overLimit ? 'medium' : 'regular'}\n\t\t\t\tclassName={cn('tabular-nums')}\n\t\t\t>\n\t\t\t\t<NumberValue value={chars} size=\"xs\" type={overLimit ? 'error' : 'secondary'} align=\"left\" />\n\t\t\t\t{typeof maxLength === 'number' && (\n\t\t\t\t\t<> / <NumberValue value={maxLength} size=\"xs\" type={overLimit ? 'error' : 'secondary'} align=\"left\" /></>\n\t\t\t\t)} {strings.counts.characters}\n\t\t\t</Text>\n\t\t\t<SecondaryValue size=\"xs\" className=\"tabular-nums\">\n\t\t\t\t<NumberValue value={words} size=\"xs\" type=\"secondary\" align=\"left\" /> {strings.counts.words}\n\t\t\t</SecondaryValue>\n\t\t</div>\n\t);\n}\n\nCountsFooterText.displayName = 'CountsFooterText';\n\nexport interface CountsFooterProps {\n\t/** The editor instance, for reading counts directly. */\n\teditor: TiptapEditor;\n\t/** Whether the editor is showing HTML source. */\n\tsourceMode: boolean;\n\t/** Raw HTML while in source mode. */\n\tsourceValue: string;\n\t/** Character cap the count is measured against. */\n\tmaxLength?: number;\n\t/** Overrides this surface's own copy. */\n\tstrings: RichTextEditorStrings;\n}\n\nexport function CountsFooter({\n\teditor,\n\tsourceMode,\n\tsourceValue,\n\tmaxLength,\n\tstrings,\n}: CountsFooterProps) {\n\tconst text = sourceMode\n\t\t? sourceValue.replace(/<[^>]*>/g, '')\n\t\t: (editor?.getText() ?? '');\n\n\treturn <CountsFooterText text={text} maxLength={maxLength} strings={strings} />;\n}\n\nCountsFooter.displayName = 'CountsFooter';\n","/**\n * Plain HTML normalization shared by the TipTap and contenteditable\n * fallback editors. Keeping these out of the React tree means the\n * editor partials stay focused on rendering.\n */\n\nexport function normalizeHtml(value: string): string {\n\tconst trimmed = value.trim();\n\n\tif (trimmed === '' || trimmed === '<p></p>' || trimmed === '<p><br></p>') {\n\t\treturn '';\n\t}\n\n\treturn trimmed;\n}\n\nexport function toEditorContent(value: string): string {\n\tconst normalized = normalizeHtml(value);\n\treturn normalized === '' ? '<p></p>' : normalized;\n}\n","import {\n\tforwardRef,\n\tuseCallback,\n\tuseEffect,\n\tuseImperativeHandle,\n\tuseMemo,\n\tuseRef,\n\tuseState,\n} from 'react';\nimport {\n\tBold,\n\tItalic,\n\tList,\n\tListOrdered,\n\tQuote,\n\tRedo2,\n\tStrikethrough,\n\tUndo2,\n} from 'lucide-react';\nimport * as TiptapReact from '@tiptap/react';\nimport * as StarterKitModule from '@tiptap/starter-kit';\n\nimport { richTextEditorRecipes } from '../rich-text-editor.recipes';\nimport { editableContentClassName } from '../../../typography/content-typography';\n\nimport { Textarea } from '../../../base/text-inputs';\nimport { Text } from '../../../typography';\nimport { useStrings } from '../../../../lib/strings';\nimport { cn } from '../../../../lib/utils';\n\nimport { defaultRichTextEditorStrings } from '../rich-text-editor.strings';\nimport type {\n\tRichTextEditorHandle,\n\tRichTextEditorProps,\n\tToolbarButtonConfig,\n} from '../rich-text-editor.types';\nimport { readCaretContext, replaceBeforeCaret } from './caret-helpers';\nimport { CountsFooter } from './counts-footer';\nimport { normalizeHtml, toEditorContent } from './html-helpers';\nimport { RichTextEditorToolbar } from './rich-text-editor-toolbar';\n\nconst EditorContent = TiptapReact.EditorContent;\nconst useTiptapEditor = TiptapReact.useEditor;\nconst StarterKit =\n\t'default' in StarterKitModule ? StarterKitModule.default : StarterKitModule;\n\nexport const TiptapRichTextEditor = forwardRef<RichTextEditorHandle, RichTextEditorProps>(function TiptapRichTextEditor(\n\t{\n\t\tvalue,\n\t\tonValueChange,\n\t\tplaceholder,\n\t\tcompact = false,\n\t\tminHeight,\n\t\tmaxHeight,\n\t\tdisabled = false,\n\t\tshowCounts = false,\n\t\tmaxLength,\n\t\textraToolbarItems,\n\t\ttoolbarTrailing,\n\t\tfooterSlot,\n\t\thideSourceToggle = false,\n\t\tautoFocus = false,\n\t\tclassName,\n\t\tonCaretChange,\n\t\tstrings: stringsProp,\n\t},\n\tref,\n) {\n\tconst strings = useStrings(defaultRichTextEditorStrings, stringsProp);\n\tconst [isFocused, setIsFocused] = useState(false);\n\tconst [sourceMode, setSourceMode] = useState(false);\n\tconst [sourceValue, setSourceValue] = useState('');\n\tconst isFocusedRef = useRef(false);\n\tconst externalValueRef = useRef<string>(normalizeHtml(value));\n\tconst onCaretChangeRef = useRef(onCaretChange);\n\tonCaretChangeRef.current = onCaretChange;\n\n\tconst editor = useTiptapEditor({\n\t\textensions: [StarterKit],\n\t\tcontent: toEditorContent(value),\n\t\teditable: !disabled,\n\t\timmediatelyRender: false,\n\t\tautofocus: autoFocus ? 'end' : false,\n\t\tonFocus: () => {\n\t\t\tisFocusedRef.current = true;\n\t\t\tsetIsFocused(true);\n\t\t},\n\t\tonBlur: () => {\n\t\t\tisFocusedRef.current = false;\n\t\t\tsetIsFocused(false);\n\t\t},\n\t\tonUpdate: ({ editor: currentEditor }: { editor: { getHTML: () => string } }) => {\n\t\t\tconst html = normalizeHtml(currentEditor.getHTML());\n\t\t\tif (!isFocusedRef.current) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (html !== externalValueRef.current) {\n\t\t\t\texternalValueRef.current = html;\n\t\t\t\tonValueChange(html);\n\t\t\t}\n\n\t\t\tonCaretChangeRef.current?.();\n\t\t},\n\t\teditorProps: {\n\t\t\tattributes: {\n\t\t\t\trole: 'textbox',\n\t\t\t\t'aria-label': strings.editorLabel,\n\t\t\t\t'aria-multiline': 'true',\n\t\t\t\tclass: editableContentClassName,\n\t\t\t},\n\t\t},\n\t});\n\n\tuseEffect(() => {\n\t\tif (!editor) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst current = normalizeHtml(editor.getHTML());\n\t\tconst next = normalizeHtml(value);\n\t\texternalValueRef.current = next;\n\n\t\tif (current !== next) {\n\t\t\teditor.commands.setContent(toEditorContent(next), { emitUpdate: false });\n\t\t}\n\t}, [editor, value]);\n\n\tuseEffect(() => {\n\t\tif (!editor) {\n\t\t\treturn;\n\t\t}\n\n\t\teditor.setEditable(!disabled);\n\t}, [disabled, editor]);\n\n\tuseEffect(() => {\n\t\tif (typeof document === 'undefined') return;\n\t\tconst handler = () => {\n\t\t\tif (!isFocusedRef.current) return;\n\t\t\tonCaretChangeRef.current?.();\n\t\t};\n\t\tdocument.addEventListener('selectionchange', handler);\n\t\treturn () => document.removeEventListener('selectionchange', handler);\n\t}, []);\n\n\tuseImperativeHandle(\n\t\tref,\n\t\t() => ({\n\t\t\tfocus: () => {\n\t\t\t\teditor?.chain().focus().run();\n\t\t\t},\n\t\t\tgetHTML: () => normalizeHtml(editor?.getHTML() ?? ''),\n\t\t\tsetHTML: (html: string) => {\n\t\t\t\tconst next = normalizeHtml(html);\n\t\t\t\texternalValueRef.current = next;\n\t\t\t\teditor?.commands.setContent(toEditorContent(next), { emitUpdate: false });\n\t\t\t\tonValueChange(next);\n\t\t\t},\n\t\t\tinsertHTML: (html: string) => {\n\t\t\t\tif (!editor) return;\n\t\t\t\teditor.chain().focus().insertContent(html).run();\n\t\t\t},\n\t\t\tisEmpty: () => normalizeHtml(editor?.getHTML() ?? '') === '',\n\t\t\tclear: () => {\n\t\t\t\texternalValueRef.current = '';\n\t\t\t\teditor?.commands.setContent('<p></p>', { emitUpdate: false });\n\t\t\t\tonValueChange('');\n\t\t\t},\n\t\t\tgetCaretContext: () => readCaretContext(),\n\t\t\treplaceBeforeCaret: (length: number, html: string) => {\n\t\t\t\treplaceBeforeCaret(editor, length, html, (next) => {\n\t\t\t\t\texternalValueRef.current = normalizeHtml(next);\n\t\t\t\t\tonValueChange(externalValueRef.current);\n\t\t\t\t});\n\t\t\t},\n\t\t}),\n\t\t[editor, onValueChange],\n\t);\n\n\tconst contentStyle = useMemo(\n\t\t() => ({\n\t\t\tminHeight: minHeight ?? (compact ? '2rem' : '12rem'),\n\t\t\t...(maxHeight ? { maxHeight, overflowY: 'auto' as const } : {}),\n\t\t}),\n\t\t[compact, maxHeight, minHeight],\n\t);\n\n\tconst toggleSourceMode = useCallback(() => {\n\t\tif (!editor) return;\n\n\t\tif (sourceMode) {\n\t\t\tconst html = toEditorContent(sourceValue);\n\t\t\teditor.commands.setContent(html, { emitUpdate: false });\n\t\t\tconst normalized = normalizeHtml(sourceValue);\n\t\t\texternalValueRef.current = normalized;\n\t\t\tonValueChange(normalized);\n\t\t\tsetSourceMode(false);\n\t\t} else {\n\t\t\tsetSourceValue(editor.getHTML());\n\t\t\tsetSourceMode(true);\n\t\t}\n\t}, [editor, onValueChange, sourceMode, sourceValue]);\n\n\tconst handleSourceChange = useCallback(\n\t\t(e: React.ChangeEvent<HTMLTextAreaElement>) => {\n\t\t\tconst next = e.target.value;\n\t\t\tsetSourceValue(next);\n\t\t\tconst normalized = normalizeHtml(next);\n\t\t\texternalValueRef.current = normalized;\n\t\t\tonValueChange(normalized);\n\t\t},\n\t\t[onValueChange],\n\t);\n\n\tconst toolbarButtons = useMemo<ToolbarButtonConfig[]>(\n\t\t() => [\n\t\t\t{\n\t\t\t\tid: 'bold',\n\t\t\t\ticon: Bold,\n\t\t\t\tlabel: strings.toolbar.bold,\n\t\t\t\tisActive: () => Boolean(editor?.isActive('bold')),\n\t\t\t\trun: () => editor?.chain().focus().toggleBold().run(),\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'italic',\n\t\t\t\ticon: Italic,\n\t\t\t\tlabel: strings.toolbar.italic,\n\t\t\t\tisActive: () => Boolean(editor?.isActive('italic')),\n\t\t\t\trun: () => editor?.chain().focus().toggleItalic().run(),\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'strike',\n\t\t\t\ticon: Strikethrough,\n\t\t\t\tlabel: strings.toolbar.strike,\n\t\t\t\tisActive: () => Boolean(editor?.isActive('strike')),\n\t\t\t\trun: () => editor?.chain().focus().toggleStrike().run(),\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'bullet-list',\n\t\t\t\ticon: List,\n\t\t\t\tlabel: strings.toolbar.bulletList,\n\t\t\t\tisActive: () => Boolean(editor?.isActive('bulletList')),\n\t\t\t\trun: () => editor?.chain().focus().toggleBulletList().run(),\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'ordered-list',\n\t\t\t\ticon: ListOrdered,\n\t\t\t\tlabel: strings.toolbar.orderedList,\n\t\t\t\tisActive: () => Boolean(editor?.isActive('orderedList')),\n\t\t\t\trun: () => editor?.chain().focus().toggleOrderedList().run(),\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'blockquote',\n\t\t\t\ticon: Quote,\n\t\t\t\tlabel: strings.toolbar.blockquote,\n\t\t\t\tisActive: () => Boolean(editor?.isActive('blockquote')),\n\t\t\t\trun: () => editor?.chain().focus().toggleBlockquote().run(),\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'undo',\n\t\t\t\ticon: Undo2,\n\t\t\t\tlabel: strings.toolbar.undo,\n\t\t\t\tisActive: () => false,\n\t\t\t\trun: () => editor?.chain().focus().undo().run(),\n\t\t\t\tdisabled: !editor?.can().chain().focus().undo().run(),\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'redo',\n\t\t\t\ticon: Redo2,\n\t\t\t\tlabel: strings.toolbar.redo,\n\t\t\t\tisActive: () => false,\n\t\t\t\trun: () => editor?.chain().focus().redo().run(),\n\t\t\t\tdisabled: !editor?.can().chain().focus().redo().run(),\n\t\t\t},\n\t\t],\n\t\t[editor, strings],\n\t);\n\n\tconst countsFooter =\n\t\tshowCounts && editor ? (\n\t\t\t<CountsFooter\n\t\t\t\teditor={editor}\n\t\t\t\tsourceMode={sourceMode}\n\t\t\t\tsourceValue={sourceValue}\n\t\t\t\tmaxLength={maxLength}\n\t\t\t\tstrings={strings}\n\t\t\t/>\n\t\t) : null;\n\n\tconst placeholderText = typeof placeholder === 'string' ? placeholder : '';\n\tconst showPlaceholder =\n\t\tplaceholderText.length > 0 && !isFocused && Boolean(editor?.isEmpty);\n\tconst placeholderNode = showPlaceholder ? (\n\t\t<Text\n\t\t\ttag=\"span\"\n\t\t\tsize=\"sm\"\n\t\t\ttype=\"secondary\"\n\t\t\tclassName=\"pointer-events-none absolute inset-0 px-control py-control-y-offset\"\n\t\t>\n\t\t\t{placeholderText}\n\t\t</Text>\n\t) : null;\n\n\treturn (\n\t\t<div\n\t\t\tclassName={cn(\n\t\t\t\trichTextEditorRecipes.frame,\n\t\t\t\tdisabled && richTextEditorRecipes.disabled,\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t>\n\t\t\t<RichTextEditorToolbar\n\t\t\t\tbuttons={toolbarButtons}\n\t\t\t\textraToolbarItems={extraToolbarItems}\n\t\t\t\thideSourceToggle={hideSourceToggle}\n\t\t\t\tsourceMode={sourceMode}\n\t\t\t\ttoggleSourceMode={toggleSourceMode}\n\t\t\t\tdisabled={disabled}\n\t\t\t\thasEditor={Boolean(editor)}\n\t\t\t\ttoolbarTrailing={toolbarTrailing}\n\t\t\t\tstrings={strings}\n\t\t\t/>\n\n\t\t\t{sourceMode ? (\n\t\t\t\t<Textarea\n\t\t\t\t\taria-label={strings.sourceLabel}\n\t\t\t\t\tvalue={sourceValue}\n\t\t\t\t\tonChange={handleSourceChange}\n\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\tspellCheck={false}\n\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t'min-h-0 w-full resize-y rounded-none border-0 bg-muted/50 px-control py-control-y-offset font-mono text-xs leading-relaxed focus-visible:ring-0',\n\t\t\t\t\t\tdisabled && 'cursor-not-allowed',\n\t\t\t\t\t)}\n\t\t\t\t\tstyle={contentStyle}\n\t\t\t\t/>\n\t\t\t) : (\n\t\t\t\t<div className=\"relative\" style={contentStyle}>\n\t\t\t\t\t{placeholderNode}\n\n\t\t\t\t\t<EditorContent\n\t\t\t\t\t\teditor={editor}\n\t\t\t\t\t\tclassName={richTextEditorRecipes.content}\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t)}\n\n\t\t\t{!!footerSlot && (\n\t\t\t\t<div className=\"px-control pb-space-md pt-space-xs\">{footerSlot}</div>\n\t\t\t)}\n\n\t\t\t{countsFooter}\n\t\t</div>\n\t);\n});\n\nTiptapRichTextEditor.displayName = 'TiptapRichTextEditor';\n\nexport const hasTiptapRuntime =\n\ttypeof EditorContent === 'function' &&\n\ttypeof useTiptapEditor === 'function' &&\n\ttypeof StarterKit === 'object' &&\n\tStarterKit !== null;\n","import {\n\tforwardRef,\n\tuseCallback,\n\tuseEffect,\n\tuseImperativeHandle,\n\tuseMemo,\n\tuseRef,\n\tuseState,\n} from 'react';\nimport {\n\tBold,\n\tItalic,\n\tList,\n\tListOrdered,\n\tQuote,\n\tRedo2,\n\tStrikethrough,\n\tUndo2,\n} from 'lucide-react';\n\nimport { richTextEditorRecipes } from '../rich-text-editor.recipes';\nimport { editableContentClassName } from '../../../typography/content-typography';\n\nimport { Textarea } from '../../../base/text-inputs';\nimport { Text } from '../../../typography';\nimport { useStrings } from '../../../../lib/strings';\nimport { cn } from '../../../../lib/utils';\n\nimport { defaultRichTextEditorStrings } from '../rich-text-editor.strings';\nimport type {\n\tRichTextEditorHandle,\n\tRichTextEditorProps,\n\tToolbarButtonConfig,\n} from '../rich-text-editor.types';\nimport {\n\tinsertHtmlIntoEditable,\n\treadCaretContext,\n\treplaceBeforeCaret,\n} from './caret-helpers';\nimport { CountsFooterText } from './counts-footer';\nimport { normalizeHtml, toEditorContent } from './html-helpers';\nimport { RichTextEditorToolbar } from './rich-text-editor-toolbar';\n\n/**\n * Fallback editor used when the TipTap runtime is unavailable (e.g. in\n * environments where the package failed to load). Renders a\n * `contenteditable` surface with the same imperative handle so callers\n * never need to care which variant they got.\n */\nexport const FallbackRichTextEditor = forwardRef<RichTextEditorHandle, RichTextEditorProps>(function FallbackRichTextEditor(\n\t{\n\t\tvalue,\n\t\tonValueChange,\n\t\tplaceholder,\n\t\tcompact = false,\n\t\tminHeight,\n\t\tmaxHeight,\n\t\tdisabled = false,\n\t\tshowCounts = false,\n\t\tmaxLength,\n\t\textraToolbarItems,\n\t\ttoolbarTrailing,\n\t\tfooterSlot,\n\t\thideSourceToggle = false,\n\t\tautoFocus = false,\n\t\tclassName,\n\t\tonCaretChange,\n\t\tstrings: stringsProp,\n\t},\n\tref,\n) {\n\tconst strings = useStrings(defaultRichTextEditorStrings, stringsProp);\n\tconst editableRef = useRef<HTMLDivElement>(null);\n\tconst [isFocused, setIsFocused] = useState(false);\n\tconst [sourceMode, setSourceMode] = useState(false);\n\tconst [sourceValue, setSourceValue] = useState('');\n\tconst externalValueRef = useRef<string>(normalizeHtml(value));\n\tconst onCaretChangeRef = useRef(onCaretChange);\n\tonCaretChangeRef.current = onCaretChange;\n\n\tconst setEditableRef = useCallback((node: HTMLDivElement | null) => {\n\t\teditableRef.current = node;\n\t\tif (node && node.innerHTML === '') {\n\t\t\tnode.innerHTML = toEditorContent(externalValueRef.current);\n\t\t}\n\t}, []);\n\n\tuseEffect(() => {\n\t\tconst editable = editableRef.current;\n\t\tif (!editable || isFocused) return;\n\t\tconst next = toEditorContent(value);\n\t\tif (normalizeHtml(editable.innerHTML) !== normalizeHtml(next)) {\n\t\t\teditable.innerHTML = next;\n\t\t}\n\t\texternalValueRef.current = normalizeHtml(value);\n\t}, [isFocused, value]);\n\n\tuseEffect(() => {\n\t\tif (!autoFocus) return;\n\t\teditableRef.current?.focus();\n\t}, [autoFocus]);\n\n\tconst emitEditableChange = useCallback(() => {\n\t\tconst editable = editableRef.current;\n\t\tconst html = normalizeHtml(editable?.innerHTML ?? '');\n\t\texternalValueRef.current = html;\n\t\tonValueChange(html);\n\t\tonCaretChangeRef.current?.();\n\t}, [onValueChange]);\n\n\tuseImperativeHandle(\n\t\tref,\n\t\t() => ({\n\t\t\tfocus: () => editableRef.current?.focus(),\n\t\t\tgetHTML: () => normalizeHtml(editableRef.current?.innerHTML ?? ''),\n\t\t\tsetHTML: (html: string) => {\n\t\t\t\tconst next = normalizeHtml(html);\n\t\t\t\texternalValueRef.current = next;\n\t\t\t\tif (editableRef.current) {\n\t\t\t\t\teditableRef.current.innerHTML = toEditorContent(next);\n\t\t\t\t}\n\t\t\t\tonValueChange(next);\n\t\t\t},\n\t\t\tinsertHTML: (html: string) => {\n\t\t\t\tinsertHtmlIntoEditable(editableRef.current, html);\n\t\t\t\temitEditableChange();\n\t\t\t},\n\t\t\tisEmpty: () => normalizeHtml(editableRef.current?.innerHTML ?? '') === '',\n\t\t\tclear: () => {\n\t\t\t\texternalValueRef.current = '';\n\t\t\t\tif (editableRef.current) editableRef.current.innerHTML = '<p></p>';\n\t\t\t\tonValueChange('');\n\t\t\t},\n\t\t\tgetCaretContext: () => readCaretContext(),\n\t\t\treplaceBeforeCaret: (length: number, html: string) => {\n\t\t\t\treplaceBeforeCaret(null, length, html, () => emitEditableChange());\n\t\t\t},\n\t\t}),\n\t\t[emitEditableChange, onValueChange],\n\t);\n\n\tconst contentStyle = useMemo(\n\t\t() => ({\n\t\t\tminHeight: minHeight ?? (compact ? '2rem' : '12rem'),\n\t\t\t...(maxHeight ? { maxHeight, overflowY: 'auto' as const } : {}),\n\t\t}),\n\t\t[compact, maxHeight, minHeight],\n\t);\n\n\tconst toggleSourceMode = useCallback(() => {\n\t\tif (sourceMode) {\n\t\t\tconst normalized = normalizeHtml(sourceValue);\n\t\t\texternalValueRef.current = normalized;\n\t\t\tif (editableRef.current) {\n\t\t\t\teditableRef.current.innerHTML = toEditorContent(normalized);\n\t\t\t}\n\t\t\tonValueChange(normalized);\n\t\t\tsetSourceMode(false);\n\t\t\treturn;\n\t\t}\n\t\tsetSourceValue(editableRef.current?.innerHTML ?? toEditorContent(value));\n\t\tsetSourceMode(true);\n\t}, [onValueChange, sourceMode, sourceValue, value]);\n\n\tconst handleSourceChange = useCallback(\n\t\t(e: React.ChangeEvent<HTMLTextAreaElement>) => {\n\t\t\tconst next = e.target.value;\n\t\t\tsetSourceValue(next);\n\t\t\tconst normalized = normalizeHtml(next);\n\t\t\texternalValueRef.current = normalized;\n\t\t\tonValueChange(normalized);\n\t\t},\n\t\t[onValueChange],\n\t);\n\n\tconst placeholderText = typeof placeholder === 'string' ? placeholder : '';\n\tconst isEmpty = normalizeHtml(externalValueRef.current) === '';\n\tconst placeholderNode =\n\t\tplaceholderText.length > 0 && !isFocused && isEmpty ? (\n\t\t\t<Text\n\t\t\t\ttag=\"span\"\n\t\t\t\tsize=\"sm\"\n\t\t\t\ttype=\"secondary\"\n\t\t\t\tclassName=\"pointer-events-none absolute inset-0 px-control py-control-y-offset\"\n\t\t\t>\n\t\t\t\t{placeholderText}\n\t\t\t</Text>\n\t\t) : null;\n\n\tconst toolbarButtons = useMemo<ToolbarButtonConfig[]>(\n\t\t() => [\n\t\t\t{ id: 'bold', icon: Bold, label: strings.toolbar.bold, isActive: () => false, run: () => undefined, disabled: true },\n\t\t\t{ id: 'italic', icon: Italic, label: strings.toolbar.italic, isActive: () => false, run: () => undefined, disabled: true },\n\t\t\t{ id: 'strike', icon: Strikethrough, label: strings.toolbar.strike, isActive: () => false, run: () => undefined, disabled: true },\n\t\t\t{ id: 'bullet-list', icon: List, label: strings.toolbar.bulletList, isActive: () => false, run: () => undefined, disabled: true },\n\t\t\t{ id: 'ordered-list', icon: ListOrdered, label: strings.toolbar.orderedList, isActive: () => false, run: () => undefined, disabled: true },\n\t\t\t{ id: 'blockquote', icon: Quote, label: strings.toolbar.blockquote, isActive: () => false, run: () => undefined, disabled: true },\n\t\t\t{ id: 'undo', icon: Undo2, label: strings.toolbar.undo, isActive: () => false, run: () => undefined, disabled: true },\n\t\t\t{ id: 'redo', icon: Redo2, label: strings.toolbar.redo, isActive: () => false, run: () => undefined, disabled: true },\n\t\t],\n\t\t[strings],\n\t);\n\n\tconst text = sourceMode\n\t\t? sourceValue.replace(/<[^>]*>/g, '')\n\t\t: (editableRef.current?.innerText ?? normalizeHtml(value).replace(/<[^>]*>/g, ''));\n\tconst countsFooter =\n\t\tshowCounts ? (\n\t\t\t<CountsFooterText text={text} maxLength={maxLength} strings={strings} />\n\t\t) : null;\n\n\treturn (\n\t\t<div\n\t\t\tclassName={cn(\n\t\t\t\trichTextEditorRecipes.frame,\n\t\t\t\tdisabled && richTextEditorRecipes.disabled,\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t>\n\t\t\t<RichTextEditorToolbar\n\t\t\t\tbuttons={toolbarButtons}\n\t\t\t\textraToolbarItems={extraToolbarItems}\n\t\t\t\thideSourceToggle={hideSourceToggle}\n\t\t\t\tsourceMode={sourceMode}\n\t\t\t\ttoggleSourceMode={toggleSourceMode}\n\t\t\t\tdisabled={disabled}\n\t\t\t\thasEditor\n\t\t\t\ttoolbarTrailing={toolbarTrailing}\n\t\t\t\tstrings={strings}\n\t\t\t/>\n\n\t\t\t{sourceMode ? (\n\t\t\t\t<Textarea\n\t\t\t\t\taria-label={strings.sourceLabel}\n\t\t\t\t\tvalue={sourceValue}\n\t\t\t\t\tonChange={handleSourceChange}\n\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\tspellCheck={false}\n\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t'min-h-0 w-full resize-y rounded-none border-0 bg-muted/50 px-control py-control-y-offset font-mono text-xs leading-relaxed focus-visible:ring-0',\n\t\t\t\t\t\tdisabled && 'cursor-not-allowed',\n\t\t\t\t\t)}\n\t\t\t\t\tstyle={contentStyle}\n\t\t\t\t/>\n\t\t\t) : (\n\t\t\t\t<div className=\"relative\" style={contentStyle}>\n\t\t\t\t\t{placeholderNode}\n\t\t\t\t\t<div\n\t\t\t\t\t\tref={setEditableRef}\n\t\t\t\t\t\trole=\"textbox\"\n\t\t\t\t\t\taria-label={strings.editorLabel}\n\t\t\t\t\t\taria-multiline=\"true\"\n\t\t\t\t\t\tcontentEditable={!disabled}\n\t\t\t\t\t\tsuppressContentEditableWarning\n\t\t\t\t\t\tonInput={emitEditableChange}\n\t\t\t\t\t\tonKeyUp={() => onCaretChangeRef.current?.()}\n\t\t\t\t\t\tonMouseUp={() => onCaretChangeRef.current?.()}\n\t\t\t\t\t\tonFocus={() => setIsFocused(true)}\n\t\t\t\t\t\tonBlur={() => setIsFocused(false)}\n\t\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t\teditableContentClassName,\n\t\t\t\t\t\t\t'h-full min-h-full',\n\t\t\t\t\t\t\tdisabled && 'cursor-not-allowed',\n\t\t\t\t\t\t)}\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t)}\n\n\t\t\t{!!footerSlot && (\n\t\t\t\t<div className=\"px-control pb-space-md pt-space-xs\">{footerSlot}</div>\n\t\t\t)}\n\n\t\t\t{countsFooter}\n\t\t</div>\n\t);\n});\n\nFallbackRichTextEditor.displayName = 'FallbackRichTextEditor';\n","/**\n * Public `<RichTextEditor>` shell — picks the TipTap-backed editor when\n * the runtime is loaded and falls back to a plain `contenteditable`\n * surface otherwise. Both variants implement the same imperative\n * `RichTextEditorHandle`, so callers don't have to branch.\n *\n * Heavy lifting lives in `partials/`:\n * - `partials/rich-text-editor-tiptap.tsx` — TipTap variant\n * - `partials/rich-text-editor-fallback.tsx` — contenteditable variant\n * - `partials/rich-text-editor-toolbar.tsx` — shared toolbar\n * - `partials/counts-footer.tsx` — char/word counts\n * - `partials/caret-helpers.ts` — caret introspection\n * - `partials/html-helpers.ts` — HTML normalization\n */\nimport { forwardRef } from 'react';\n\nimport {\n\tFallbackRichTextEditor,\n\tTiptapRichTextEditor,\n\thasTiptapRuntime,\n} from './partials';\nimport type {\n\tRichTextEditorHandle,\n\tRichTextEditorProps,\n} from './rich-text-editor.types';\n\nexport const RichTextEditor = forwardRef<RichTextEditorHandle, RichTextEditorProps>(function RichTextEditor(\n\tprops,\n\tref,\n) {\n\tif (!hasTiptapRuntime) {\n\t\treturn <FallbackRichTextEditor className=\"rich-text-editor--component\" {...props} ref={ref} />;\n\t}\n\n\treturn <TiptapRichTextEditor {...props} ref={ref} />;\n});\n\nRichTextEditor.displayName = 'RichTextEditor';\n\nexport type {\n\tRichTextEditorProps,\n\tRichTextEditorHandle,\n\tRichTextEditorToolbarItem,\n\tRichTextCaretContext,\n} from './rich-text-editor.types';\n"],"mappings":";;;;;;;;;;;;;;;;AAmBA,SAAgBe,KAAgD;CAC/D,IAAI,OAAO,SAAW,KAAa,OAAO;CAC1C,IAAMC,IAAM,OAAO,aAAa;CAChC,IAAI,CAACA,KAAOA,EAAI,eAAe,GAAG,OAAO;CACzC,IAAMC,IAAQD,EAAI,WAAW,CAAC;CAC9B,IAAI,CAACC,EAAM,WAAW,OAAO;CAE7B,IAAMC,IAAYD,EAAM,gBAClBE,IAAcF,EAAM,aAEtBG,IAAqBF;CACzB,OAAOE,KAASA,EAAM,aAAa,KAAK,eACvC,IAAQA,EAAM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AC,OAAD;IAAK,WAAU;IAAsC,UAAAA;GAAgB,CAAA;GAGrEL;EACG;;AAEP,CAAC;AAED,EAAuB,cAAc;;;AC3PrC,IAAaY,IAAiBnD,EAAsD,SACnF,GACA,GACC;CAKD,OAJK6C,IAIE,kBAAC9C,GAAD;EAAsB,GAAIqD;EAAY;CAAM,CAAA,IAH3C,kBAACN,GAAD;EAAwB,WAAU;EAA8B,GAAIM;EAAY;CAAM,CAAA;AAI/F,CAAC;AAED,EAAe,cAAc"}
|
package/dist/services/actions.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { useStrings as e } from "../lib/strings.js";
|
|
3
|
-
import { n as t, r as n, t as r } from "../overlays-
|
|
3
|
+
import { n as t, r as n, t as r } from "../overlays-B11wZka6.js";
|
|
4
4
|
import { createContext as i, createElement as a, useContext as o, useEffect as s, useId as c, useMemo as l, useRef as u, useSyncExternalStore as d } from "react";
|
|
5
5
|
import { jsx as f, jsxs as p } from "react/jsx-runtime";
|
|
6
6
|
//#region src/services/actions/actions.types.ts
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
import { useStrings as e } from "./lib/strings.js";
|
|
3
3
|
import { t } from "./utils-C2EKeIw3.js";
|
|
4
4
|
import { a as n, i as r, r as i } from "./typography-Cv8MT-82.js";
|
|
5
|
-
import { t as a } from "./structure-
|
|
6
|
-
import { t as o } from "./smart-card-
|
|
5
|
+
import { t as a } from "./structure-MvKVq-oL.js";
|
|
6
|
+
import { t as o } from "./smart-card-CYLn46e6.js";
|
|
7
7
|
import { t as s } from "./badge-BZXZT9wd.js";
|
|
8
8
|
import { n as c } from "./layout.types-Cn7aUzJp.js";
|
|
9
9
|
import { jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
@@ -157,4 +157,4 @@ m.displayName = "AsideNavShell";
|
|
|
157
157
|
//#endregion
|
|
158
158
|
export { h as n, d as r, m as t };
|
|
159
159
|
|
|
160
|
-
//# sourceMappingURL=settings-
|
|
160
|
+
//# sourceMappingURL=settings-BnCyyPOJ.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"settings-D9f_wdIC.js","names":["Text","Heading","DisplayLabel","Stack","Card","Badge","resolveLayoutLinkRenderer","defaultAsideNavShellStrings","normalizePath","rawUrl","baseOrigin","trimmed","isActiveItem","currentId","item","currentPath","activePath","itemPath","AsideNavShell","stringsProp","strings","useStrings","linkRenderer","cn","className","navClassName","aside","groups","group","Icon","active","content","contentClassName","title","description","actions","footer","SettingsShell"],"sources":["../src/components/layout/settings/settings.tsx"],"sourcesContent":["import type { ComponentType, ReactNode } from 'react';\n\nimport { Badge } from '../../base/badge';\nimport { Card } from '../../base/cards';\nimport { Stack } from '../../base/structure';\nimport { DisplayLabel, Heading, Text } from '../../typography';\nimport { useStrings, type StringsProp } from '../../../lib/strings';\nimport { cn } from '../../../lib/utils';\n\nimport {\n\tresolveLayoutLinkRenderer,\n\ttype LayoutNavigationAdapter,\n} from '../layout.types';\n\nexport interface AsideNavShellStrings {\n\tnavigationAriaLabel: string;\n}\n\nexport const defaultAsideNavShellStrings: AsideNavShellStrings = {\n\tnavigationAriaLabel: 'Settings navigation',\n};\n\nexport interface AsideNavItem {\n\tid: string;\n\t/** Display label. */\n\tlabel: ReactNode;\n\t/** Destination for the entry, when it navigates. */\n\thref?: string;\n\t/** Supporting copy under the title. */\n\tdescription?: ReactNode;\n\t/** Leading glyph. */\n\ticon?: ComponentType<{ className?: string }>;\n\t/** Chip rendered beside the label. */\n\tbadge?: ReactNode;\n\t/** Disables the control. */\n\tdisabled?: boolean;\n\texternal?: boolean;\n\tonSelect?: (id: string) => void;\n}\n\nexport interface AsideNavGroup {\n\tid: string;\n\t/** Display label. */\n\tlabel?: ReactNode;\n\t/** Entries to render, in order. */\n\titems: AsideNavItem[];\n}\n\nexport interface AsideNavShellProps extends LayoutNavigationAdapter {\n\t/** Surface title. */\n\ttitle?: ReactNode;\n\t/** Supporting copy under the title. */\n\tdescription?: ReactNode;\n\t/** Sections of the settings navigation. */\n\tgroups: AsideNavGroup[];\n\t/** Id of the active entry. */\n\tcurrentId?: string;\n\t/** Path of the active route. */\n\tcurrentPath?: string;\n\tchildren?: ReactNode;\n\t/** Content beside the main settings panel. */\n\taside?: ReactNode;\n\t/** Controls offered on the surface. */\n\tactions?: ReactNode;\n\t/** Content below the body. */\n\tfooter?: ReactNode;\n\tclassName?: string;\n\t/** Merged onto the navigation region. */\n\tnavClassName?: string;\n\t/** Merged onto the content region. */\n\tcontentClassName?: string;\n\t/** Overrides this surface's own copy. */\n\tstrings?: StringsProp<AsideNavShellStrings>;\n}\n\nexport type SettingsShellProps = AsideNavShellProps;\n\nfunction normalizePath(rawUrl?: string): string {\n\tif (!rawUrl) return '';\n\ttry {\n\t\tconst baseOrigin = typeof window !== 'undefined' ? window.location.origin : 'http://localhost';\n\t\tconst parsed = new URL(rawUrl, baseOrigin);\n\t\tconst trimmed = parsed.pathname.replace(/\\/+$/, '');\n\t\treturn trimmed.length > 0 ? trimmed : '/';\n\t} catch {\n\t\tconst clean = rawUrl.split('?')[0] ?? rawUrl;\n\t\tconst trimmed = clean.replace(/\\/+$/, '');\n\t\treturn trimmed.length > 0 ? trimmed : '/';\n\t}\n}\n\nfunction isActiveItem(item: AsideNavItem, currentId?: string, currentPath?: string): boolean {\n\tif (currentId) return item.id === currentId;\n\tif (!currentPath || !item.href) return false;\n\tconst activePath = normalizePath(currentPath);\n\tconst itemPath = normalizePath(item.href);\n\treturn activePath === itemPath || activePath.startsWith(`${itemPath}/`);\n}\n\nexport function AsideNavShell({\n\ttitle,\n\tdescription,\n\tgroups,\n\tcurrentId,\n\tcurrentPath,\n\tchildren,\n\taside,\n\tactions,\n\tfooter,\n\tclassName,\n\tnavClassName,\n\tcontentClassName,\n\trenderLink,\n\tstrings: stringsProp,\n}: AsideNavShellProps) {\n\tconst strings = useStrings(defaultAsideNavShellStrings, stringsProp);\n\tconst linkRenderer = resolveLayoutLinkRenderer({ renderLink });\n\n\treturn (\n\t\t<section\n\t\t\tdata-component=\"aside-nav-shell\"\n\t\t\tdata-slot=\"aside-nav-shell\"\n\t\t\tclassName={cn('aside-nav-shell--component grid min-w-0 gap-space-xl lg:grid-cols-[17rem_minmax(0,1fr)]', className)}\n\t\t>\n\t\t\t<aside data-slot=\"aside-nav-shell-aside\" className=\"aside-nav-shell--aside min-w-0\">\n\t\t\t\t<Card\n\t\t\t\t\tsurface=\"card\"\n\t\t\t\t\tclassName={cn('aside-nav-shell--nav-card sticky top-[calc(var(--shell-header-height)_+_var(--spacing-space-xl))]', navClassName)}\n\t\t\t\t\tcontentClassName=\"grid gap-space-xl\"\n\t\t\t\t>\n\t\t\t\t\t{!!aside && <div className=\"aside-nav-shell--aside-header\">{aside}</div>}\n\t\t\t\t\t<Stack render={<nav aria-label={strings.navigationAriaLabel} />} gap=\"xl\">\n\t\t\t\t\t\t{groups.map((group) => (\n\t\t\t\t\t\t\t<Stack key={group.id} gap=\"sm\">\n\t\t\t\t\t\t\t\t{!!group.label && (\n\t\t\t\t\t\t\t\t\t<DisplayLabel className=\"px-row-x\">\n\t\t\t\t\t\t\t\t\t\t{group.label}\n\t\t\t\t\t\t\t\t\t</DisplayLabel>\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t<Stack gap=\"2xs\">\n\t\t\t\t\t\t\t\t\t{group.items.map((item) => {\n\t\t\t\t\t\t\t\t\t\tconst Icon = item.icon;\n\t\t\t\t\t\t\t\t\t\tconst active = isActiveItem(item, currentId, currentPath);\n\t\t\t\t\t\t\t\t\t\tconst content = (\n\t\t\t\t\t\t\t\t\t\t\t<Stack direction=\"horizontal\" align=\"start\" gap=\"md\" wrap={false} render={<span />} className=\"min-w-0 w-full\">\n\t\t\t\t\t\t\t\t\t\t\t\t{!!Icon && (\n\t\t\t\t\t\t\t\t\t\t\t\t\t<Icon\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'size-icon shrink-0 mt-space-2xs',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tactive ? 'text-primary-accent' : 'text-muted-foreground',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\t\t\t\t<Stack render={<span />} gap=\"dense\" className=\"min-w-0 flex-1\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<Text tag=\"span\" weight={active ? 'semibold' : 'medium'} className=\"truncate\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{item.label}\n\t\t\t\t\t\t\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t\t\t\t\t\t\t\t{!!item.description && (\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<Text tag=\"span\" size=\"xs\" type=\"secondary\" className=\"truncate\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{item.description}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\t\t\t\t</Stack>\n\t\t\t\t\t\t\t\t\t\t\t\t{!!item.badge && (\n\t\t\t\t\t\t\t\t\t\t\t\t\t<Badge tone={active ? 'primary' : 'secondary'} className=\"shrink-0\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{item.badge}\n\t\t\t\t\t\t\t\t\t\t\t\t\t</Badge>\n\t\t\t\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\t\t\t</Stack>\n\t\t\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t\t\t\t<div key={item.id} onClick={() => { if (!item.disabled) item.onSelect?.(item.id); }}>\n\t\t\t\t\t\t\t\t\t\t\t\t{linkRenderer({\n\t\t\t\t\t\t\t\t\t\t\t\t\thref: item.href,\n\t\t\t\t\t\t\t\t\t\t\t\t\tchildren: content,\n\t\t\t\t\t\t\t\t\t\t\t\t\tactive,\n\t\t\t\t\t\t\t\t\t\t\t\t\tdisabled: item.disabled,\n\t\t\t\t\t\t\t\t\t\t\t\t\texternal: item.external,\n\t\t\t\t\t\t\t\t\t\t\t\t\tclassName: cn(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'aside-nav-shell--item flex min-w-0 rounded-radius-md px-row-x py-row-y transition-colors',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tactive\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t? 'bg-accent text-accent-foreground'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t: 'text-foreground hover:bg-accent hover:text-accent-foreground',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\titem.disabled && 'pointer-events-none opacity-50',\n\t\t\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\t\t\t'aria-label': typeof item.label === 'string' ? item.label : undefined,\n\t\t\t\t\t\t\t\t\t\t\t\t})}\n\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t})}\n\t\t\t\t\t\t\t\t</Stack>\n\t\t\t\t\t\t\t</Stack>\n\t\t\t\t\t\t))}\n\t\t\t\t\t</Stack>\n\t\t\t\t</Card>\n\t\t\t</aside>\n\n\t\t\t\t<Stack gap=\"xl\" data-slot=\"aside-nav-shell-main\" className={cn('aside-nav-shell--main', contentClassName)}>\n\t\t\t\t{(title || description || actions) && (\n\t\t\t\t\t<Stack\n\t\t\t\t\t\trender={<header />}\n\t\t\t\t\t\tdirection={{ base: 'vertical', sm: 'horizontal' }}\n\t\t\t\t\t\tgap=\"lg\"\n\t\t\t\t\t\talign={{ sm: 'start' }}\n\t\t\t\t\t\tjustify={{ sm: 'between' }}\n\t\t\t\t\t\tclassName=\"aside-nav-shell--header\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{/* `flex-1` so the text yields width to the actions instead of\n\t\t\t\t\t\t claiming its full content width. The header wraps on `sm`,\n\t\t\t\t\t\t and the description's `max-w-3xl` is wider than the content\n\t\t\t\t\t\t column, so without this the actions wrapped onto their own\n\t\t\t\t\t\t line below the description rather than sitting beside the\n\t\t\t\t\t\t title. */}\n\t\t\t\t\t\t<div className=\"min-w-0 flex-1\">\n\t\t\t\t\t\t\t{!!title && <Heading tag=\"h2\" className=\"border-0 pb-0\">{title}</Heading>}\n\t\t\t\t\t\t\t{!!description && (\n\t\t\t\t\t\t\t\t<Text type=\"secondary\" className=\"mt-space-xs max-w-3xl\">\n\t\t\t\t\t\t\t\t\t{description}\n\t\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t{!!actions && <Stack direction=\"horizontal\" wrap align=\"center\" gap=\"md\" className=\"shrink-0\">{actions}</Stack>}\n\t\t\t\t\t</Stack>\n\t\t\t\t)}\n\t\t\t\t\t<div data-slot=\"aside-nav-shell-content\" className=\"aside-nav-shell--content min-w-0\">\n\t\t\t\t\t\t{children}\n\t\t\t\t\t</div>\n\t\t\t\t\t{!!footer && <footer className=\"aside-nav-shell--footer\">{footer}</footer>}\n\t\t\t\t</Stack>\n\t\t</section>\n\t);\n}\n\nexport const SettingsShell = AsideNavShell;\n\nAsideNavShell.displayName = 'AsideNavShell';\n"],"mappings":";;;;;;;;;;AAkBA,IAAaO,IAAoD,EAChE,qBAAqB,sBACtB;AAyDA,SAASC,EAAc,GAAyB;CAC/C,IAAI,CAACC,GAAQ,OAAO;CACpB,IAAI;EACH,IAAMC,IAAa,OAAO,SAAW,MAAc,OAAO,SAAS,SAAS,oBAEtEC,IAAU,IADG,IAAIF,GAAQC,CACf,CAAA,CAAO,SAAS,QAAQ,QAAQ,EAAE;EAClD,OAAOC,EAAQ,SAAS,IAAIA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AAO,KAAI;GAAK,aAAU;GAAuB,WAAWoB,EAAG,yBAAyBS,CAAgB;GAAxG,UAAA;KACEC,KAASC,KAAeC,MACzB,kBAAChC,GAAD;KACC,QAAQ,kBAAC,UAAD,CAAS,CAAA;KACjB,WAAW;MAAE,MAAM;MAAY,IAAI;KAAa;KAChD,KAAI;KACJ,OAAO,EAAE,IAAI,QAAQ;KACrB,SAAS,EAAE,IAAI,UAAU;KACzB,WAAU;KANX,UAAA,CAcC,kBAAC,OAAD;MAAK,WAAU;MAAf,UAAA,CACE,CAAC,CAAC8B,KAAS,kBAAChC,GAAD;OAAS,KAAI;OAAK,WAAU;OAAiB,UAAAgC;MAAe,CAAA,GACvE,CAAC,CAACC,KACF,kBAAClC,GAAD;OAAM,MAAK;OAAY,WAAU;OAC/B,UAAAkC;MACI,CAAA,CAEH;KACJ,CAAA,GAAA,CAAC,CAACC,KAAW,kBAAChC,GAAD;MAAO,WAAU;MAAa,MAAA;MAAK,OAAM;MAAS,KAAI;MAAK,WAAU;MAAY,UAAAgC;KAAe,CAAA,CACxG;;IAEP,kBAAC,OAAD;KAAK,aAAU;KAA0B,WAAU;KACjD;IACG,CAAA;IACJ,CAAC,CAACC,KAAU,kBAAC,UAAD;KAAQ,WAAU;KAA2B,UAAAA;IAAe,CAAA;GACnE;EACA,CAAA,CAAA;;AAEX;AAEA,IAAaC,IAAgBnB;AAE7B,EAAc,cAAc"}
|
|
1
|
+
{"version":3,"file":"settings-BnCyyPOJ.js","names":["Text","Heading","DisplayLabel","Stack","Card","Badge","resolveLayoutLinkRenderer","defaultAsideNavShellStrings","normalizePath","rawUrl","baseOrigin","trimmed","isActiveItem","currentId","item","currentPath","activePath","itemPath","AsideNavShell","stringsProp","strings","useStrings","linkRenderer","cn","className","navClassName","aside","groups","group","Icon","active","content","contentClassName","title","description","actions","footer","SettingsShell"],"sources":["../src/components/layout/settings/settings.tsx"],"sourcesContent":["import type { ComponentType, ReactNode } from 'react';\n\nimport { Badge } from '../../base/badge';\nimport { Card } from '../../base/cards';\nimport { Stack } from '../../base/structure';\nimport { DisplayLabel, Heading, Text } from '../../typography';\nimport { useStrings, type StringsProp } from '../../../lib/strings';\nimport { cn } from '../../../lib/utils';\n\nimport {\n\tresolveLayoutLinkRenderer,\n\ttype LayoutNavigationAdapter,\n} from '../layout.types';\n\nexport interface AsideNavShellStrings {\n\tnavigationAriaLabel: string;\n}\n\nexport const defaultAsideNavShellStrings: AsideNavShellStrings = {\n\tnavigationAriaLabel: 'Settings navigation',\n};\n\nexport interface AsideNavItem {\n\tid: string;\n\t/** Display label. */\n\tlabel: ReactNode;\n\t/** Destination for the entry, when it navigates. */\n\thref?: string;\n\t/** Supporting copy under the title. */\n\tdescription?: ReactNode;\n\t/** Leading glyph. */\n\ticon?: ComponentType<{ className?: string }>;\n\t/** Chip rendered beside the label. */\n\tbadge?: ReactNode;\n\t/** Disables the control. */\n\tdisabled?: boolean;\n\texternal?: boolean;\n\tonSelect?: (id: string) => void;\n}\n\nexport interface AsideNavGroup {\n\tid: string;\n\t/** Display label. */\n\tlabel?: ReactNode;\n\t/** Entries to render, in order. */\n\titems: AsideNavItem[];\n}\n\nexport interface AsideNavShellProps extends LayoutNavigationAdapter {\n\t/** Surface title. */\n\ttitle?: ReactNode;\n\t/** Supporting copy under the title. */\n\tdescription?: ReactNode;\n\t/** Sections of the settings navigation. */\n\tgroups: AsideNavGroup[];\n\t/** Id of the active entry. */\n\tcurrentId?: string;\n\t/** Path of the active route. */\n\tcurrentPath?: string;\n\tchildren?: ReactNode;\n\t/** Content beside the main settings panel. */\n\taside?: ReactNode;\n\t/** Controls offered on the surface. */\n\tactions?: ReactNode;\n\t/** Content below the body. */\n\tfooter?: ReactNode;\n\tclassName?: string;\n\t/** Merged onto the navigation region. */\n\tnavClassName?: string;\n\t/** Merged onto the content region. */\n\tcontentClassName?: string;\n\t/** Overrides this surface's own copy. */\n\tstrings?: StringsProp<AsideNavShellStrings>;\n}\n\nexport type SettingsShellProps = AsideNavShellProps;\n\nfunction normalizePath(rawUrl?: string): string {\n\tif (!rawUrl) return '';\n\ttry {\n\t\tconst baseOrigin = typeof window !== 'undefined' ? window.location.origin : 'http://localhost';\n\t\tconst parsed = new URL(rawUrl, baseOrigin);\n\t\tconst trimmed = parsed.pathname.replace(/\\/+$/, '');\n\t\treturn trimmed.length > 0 ? trimmed : '/';\n\t} catch {\n\t\tconst clean = rawUrl.split('?')[0] ?? rawUrl;\n\t\tconst trimmed = clean.replace(/\\/+$/, '');\n\t\treturn trimmed.length > 0 ? trimmed : '/';\n\t}\n}\n\nfunction isActiveItem(item: AsideNavItem, currentId?: string, currentPath?: string): boolean {\n\tif (currentId) return item.id === currentId;\n\tif (!currentPath || !item.href) return false;\n\tconst activePath = normalizePath(currentPath);\n\tconst itemPath = normalizePath(item.href);\n\treturn activePath === itemPath || activePath.startsWith(`${itemPath}/`);\n}\n\nexport function AsideNavShell({\n\ttitle,\n\tdescription,\n\tgroups,\n\tcurrentId,\n\tcurrentPath,\n\tchildren,\n\taside,\n\tactions,\n\tfooter,\n\tclassName,\n\tnavClassName,\n\tcontentClassName,\n\trenderLink,\n\tstrings: stringsProp,\n}: AsideNavShellProps) {\n\tconst strings = useStrings(defaultAsideNavShellStrings, stringsProp);\n\tconst linkRenderer = resolveLayoutLinkRenderer({ renderLink });\n\n\treturn (\n\t\t<section\n\t\t\tdata-component=\"aside-nav-shell\"\n\t\t\tdata-slot=\"aside-nav-shell\"\n\t\t\tclassName={cn('aside-nav-shell--component grid min-w-0 gap-space-xl lg:grid-cols-[17rem_minmax(0,1fr)]', className)}\n\t\t>\n\t\t\t<aside data-slot=\"aside-nav-shell-aside\" className=\"aside-nav-shell--aside min-w-0\">\n\t\t\t\t<Card\n\t\t\t\t\tsurface=\"card\"\n\t\t\t\t\tclassName={cn('aside-nav-shell--nav-card sticky top-[calc(var(--shell-header-height)_+_var(--spacing-space-xl))]', navClassName)}\n\t\t\t\t\tcontentClassName=\"grid gap-space-xl\"\n\t\t\t\t>\n\t\t\t\t\t{!!aside && <div className=\"aside-nav-shell--aside-header\">{aside}</div>}\n\t\t\t\t\t<Stack render={<nav aria-label={strings.navigationAriaLabel} />} gap=\"xl\">\n\t\t\t\t\t\t{groups.map((group) => (\n\t\t\t\t\t\t\t<Stack key={group.id} gap=\"sm\">\n\t\t\t\t\t\t\t\t{!!group.label && (\n\t\t\t\t\t\t\t\t\t<DisplayLabel className=\"px-row-x\">\n\t\t\t\t\t\t\t\t\t\t{group.label}\n\t\t\t\t\t\t\t\t\t</DisplayLabel>\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t<Stack gap=\"2xs\">\n\t\t\t\t\t\t\t\t\t{group.items.map((item) => {\n\t\t\t\t\t\t\t\t\t\tconst Icon = item.icon;\n\t\t\t\t\t\t\t\t\t\tconst active = isActiveItem(item, currentId, currentPath);\n\t\t\t\t\t\t\t\t\t\tconst content = (\n\t\t\t\t\t\t\t\t\t\t\t<Stack direction=\"horizontal\" align=\"start\" gap=\"md\" wrap={false} render={<span />} className=\"min-w-0 w-full\">\n\t\t\t\t\t\t\t\t\t\t\t\t{!!Icon && (\n\t\t\t\t\t\t\t\t\t\t\t\t\t<Icon\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'size-icon shrink-0 mt-space-2xs',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tactive ? 'text-primary-accent' : 'text-muted-foreground',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\t\t\t\t<Stack render={<span />} gap=\"dense\" className=\"min-w-0 flex-1\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<Text tag=\"span\" weight={active ? 'semibold' : 'medium'} className=\"truncate\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{item.label}\n\t\t\t\t\t\t\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t\t\t\t\t\t\t\t{!!item.description && (\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<Text tag=\"span\" size=\"xs\" type=\"secondary\" className=\"truncate\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{item.description}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\t\t\t\t</Stack>\n\t\t\t\t\t\t\t\t\t\t\t\t{!!item.badge && (\n\t\t\t\t\t\t\t\t\t\t\t\t\t<Badge tone={active ? 'primary' : 'secondary'} className=\"shrink-0\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{item.badge}\n\t\t\t\t\t\t\t\t\t\t\t\t\t</Badge>\n\t\t\t\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\t\t\t</Stack>\n\t\t\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t\t\t\t<div key={item.id} onClick={() => { if (!item.disabled) item.onSelect?.(item.id); }}>\n\t\t\t\t\t\t\t\t\t\t\t\t{linkRenderer({\n\t\t\t\t\t\t\t\t\t\t\t\t\thref: item.href,\n\t\t\t\t\t\t\t\t\t\t\t\t\tchildren: content,\n\t\t\t\t\t\t\t\t\t\t\t\t\tactive,\n\t\t\t\t\t\t\t\t\t\t\t\t\tdisabled: item.disabled,\n\t\t\t\t\t\t\t\t\t\t\t\t\texternal: item.external,\n\t\t\t\t\t\t\t\t\t\t\t\t\tclassName: cn(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'aside-nav-shell--item flex min-w-0 rounded-radius-md px-row-x py-row-y transition-colors',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tactive\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t? 'bg-accent text-accent-foreground'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t: 'text-foreground hover:bg-accent hover:text-accent-foreground',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\titem.disabled && 'pointer-events-none opacity-50',\n\t\t\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\t\t\t'aria-label': typeof item.label === 'string' ? item.label : undefined,\n\t\t\t\t\t\t\t\t\t\t\t\t})}\n\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t})}\n\t\t\t\t\t\t\t\t</Stack>\n\t\t\t\t\t\t\t</Stack>\n\t\t\t\t\t\t))}\n\t\t\t\t\t</Stack>\n\t\t\t\t</Card>\n\t\t\t</aside>\n\n\t\t\t\t<Stack gap=\"xl\" data-slot=\"aside-nav-shell-main\" className={cn('aside-nav-shell--main', contentClassName)}>\n\t\t\t\t{(title || description || actions) && (\n\t\t\t\t\t<Stack\n\t\t\t\t\t\trender={<header />}\n\t\t\t\t\t\tdirection={{ base: 'vertical', sm: 'horizontal' }}\n\t\t\t\t\t\tgap=\"lg\"\n\t\t\t\t\t\talign={{ sm: 'start' }}\n\t\t\t\t\t\tjustify={{ sm: 'between' }}\n\t\t\t\t\t\tclassName=\"aside-nav-shell--header\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{/* `flex-1` so the text yields width to the actions instead of\n\t\t\t\t\t\t claiming its full content width. The header wraps on `sm`,\n\t\t\t\t\t\t and the description's `max-w-3xl` is wider than the content\n\t\t\t\t\t\t column, so without this the actions wrapped onto their own\n\t\t\t\t\t\t line below the description rather than sitting beside the\n\t\t\t\t\t\t title. */}\n\t\t\t\t\t\t<div className=\"min-w-0 flex-1\">\n\t\t\t\t\t\t\t{!!title && <Heading tag=\"h2\" className=\"border-0 pb-0\">{title}</Heading>}\n\t\t\t\t\t\t\t{!!description && (\n\t\t\t\t\t\t\t\t<Text type=\"secondary\" className=\"mt-space-xs max-w-3xl\">\n\t\t\t\t\t\t\t\t\t{description}\n\t\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t{!!actions && <Stack direction=\"horizontal\" wrap align=\"center\" gap=\"md\" className=\"shrink-0\">{actions}</Stack>}\n\t\t\t\t\t</Stack>\n\t\t\t\t)}\n\t\t\t\t\t<div data-slot=\"aside-nav-shell-content\" className=\"aside-nav-shell--content min-w-0\">\n\t\t\t\t\t\t{children}\n\t\t\t\t\t</div>\n\t\t\t\t\t{!!footer && <footer className=\"aside-nav-shell--footer\">{footer}</footer>}\n\t\t\t\t</Stack>\n\t\t</section>\n\t);\n}\n\nexport const SettingsShell = AsideNavShell;\n\nAsideNavShell.displayName = 'AsideNavShell';\n"],"mappings":";;;;;;;;;;AAkBA,IAAaO,IAAoD,EAChE,qBAAqB,sBACtB;AAyDA,SAASC,EAAc,GAAyB;CAC/C,IAAI,CAACC,GAAQ,OAAO;CACpB,IAAI;EACH,IAAMC,IAAa,OAAO,SAAW,MAAc,OAAO,SAAS,SAAS,oBAEtEC,IAAU,IADG,IAAIF,GAAQC,CACf,CAAA,CAAO,SAAS,QAAQ,QAAQ,EAAE;EAClD,OAAOC,EAAQ,SAAS,IAAIA,IAAU;CACvC,QAAQ;EAEP,IAAMA,KADQF,EAAO,MAAM,GAAG,CAAC,CAAC,MAAMA,EAAA,CAChB,QAAQ,QAAQ,EAAE;EACxC,OAAOE,EAAQ,SAAS,IAAIA,IAAU;CACvC;AACD;AAEA,SAASC,EAAa,GAAoB,GAAoB,GAA+B;CAC5F,IAAIC,GAAW,OAAOC,EAAK,OAAOD;CAClC,IAAI,CAACE,KAAe,CAACD,EAAK,MAAM,OAAO;CACvC,IAAME,IAAaR,EAAcO,CAAW,GACtCE,IAAWT,EAAcM,EAAK,IAAI;CACxC,OAAOE,MAAeC,KAAYD,EAAW,WAAW,GAAGC,EAAS,EAAE;AACvE;AA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A,GACvE,CAAC,CAACC,KACF,kBAAClC,GAAD;OAAM,MAAK;OAAY,WAAU;OAC/B,UAAAkC;MACI,CAAA,CAEH;KACJ,CAAA,GAAA,CAAC,CAACC,KAAW,kBAAChC,GAAD;MAAO,WAAU;MAAa,MAAA;MAAK,OAAM;MAAS,KAAI;MAAK,WAAU;MAAY,UAAAgC;KAAe,CAAA,CACxG;;IAEP,kBAAC,OAAD;KAAK,aAAU;KAA0B,WAAU;KACjD;IACG,CAAA;IACJ,CAAC,CAACC,KAAU,kBAAC,UAAD;KAAQ,WAAU;KAA2B,UAAAA;IAAe,CAAA;GACnE;EACA,CAAA,CAAA;;AAEX;AAEA,IAAaC,IAAgBnB;AAE7B,EAAc,cAAc"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { r as e } from "./theme-scope-kStaAer0.js";
|
|
3
3
|
import { t } from "./utils-C2EKeIw3.js";
|
|
4
|
-
import { t as n } from "./affordance-geometry.generated-
|
|
4
|
+
import { t as n } from "./affordance-geometry.generated-D8Jcfb0G.js";
|
|
5
5
|
import { a as r } from "./typography-Cv8MT-82.js";
|
|
6
6
|
import { t as i } from "./motion-recipes-B6jKXEcN.js";
|
|
7
7
|
import { t as a } from "./slot-CLF9kLrS.js";
|
|
@@ -202,4 +202,4 @@ P.displayName = "SheetDescription";
|
|
|
202
202
|
//#endregion
|
|
203
203
|
export { P as a, N as c, k as i, D as l, j as n, M as o, O as r, A as s, E as t, m as u };
|
|
204
204
|
|
|
205
|
-
//# sourceMappingURL=sheet-
|
|
205
|
+
//# sourceMappingURL=sheet-B-q914Ad.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sheet-vOUloJ4O.js","names":["Sheet","SheetPrimitive","SheetTrigger","SheetClose","SheetContent","SheetHeader","SheetFooter","SheetTitle","SheetDescription","SheetPrimitive","React","SheetTriggerPrimitive","SheetClosePrimitive","SheetContentPrimitive","SheetHeaderPrimitive","SheetFooterPrimitive","SheetTitlePrimitive","SheetDescriptionPrimitive","useThemePortalContainer","affordanceGeometry","Text","motionRecipes","Slot","Button","modalRegionRecipes","modalBackdropRecipe","React$1","overlayAnatomyRecipes","Sheet$1","props","Dialog","SheetTrigger$1","renderSlot","asChild","SheetClose$1","SheetPortal","resolvedContainer","container","SheetOverlay","cn","className","SheetContent$1","side","children","showCloseButton","XIcon","SheetHeader$1","SheetFooter$1","SheetTitle$1","SheetDescription$1","isSimpleText","value","Sheet","SheetTrigger","SheetClose","SheetContent","SheetHeader","textGap","SheetBody","SheetFooter","SheetTitle","SheetDescription"],"sources":["../src/lib/overlay-anatomy-recipes.ts","../src/components/ui/sheet.tsx","../src/components/base/sheet/sheet.tsx"],"sourcesContent":["import { affordanceGeometry } from './affordance-geometry.generated';\n/** Dismiss controls follow the surface's logical inset; headers reserve the\n * actual small-action width plus an action gap only when a close control exists.\n * These are derived recipes, not additional theme settings.\n */\nexport const overlayAnatomyRecipes = {\n\tclose: affordanceGeometry.overlayClose,\n\theader: affordanceGeometry.overlayHeader,\n} as const;\n","import { overlayAnatomyRecipes } from '../../lib/overlay-anatomy-recipes';\nimport { motionRecipes } from '../../lib/motion-recipes';\nimport { modalBackdropRecipe } from './overlay.recipes';\n\"use client\"\n\nimport { useThemePortalContainer, type ThemePortalContainer } from '../../lib/theme-scope';\n\nimport { Dialog as SheetPrimitive } from \"@base-ui/react/dialog\"\nimport { XIcon } from \"lucide-react\"\nimport * as React from \"react\"\n\nimport { Button } from \"./button\"\nimport { Slot } from \"./slot\"\nimport { cn } from \"../../lib/utils\"\n\nfunction Sheet({ ...props }: SheetPrimitive.Root.Props) {\n return <SheetPrimitive.Root data-slot=\"sheet\" modal=\"trap-focus\" {...props} />\n}\n\nfunction SheetTrigger({\n asChild = false,\n ...props\n}: SheetPrimitive.Trigger.Props & { asChild?: boolean }) {\n const renderSlot = asChild ? <Slot /> : undefined\n\n return (\n <SheetPrimitive.Trigger\n data-slot=\"sheet-trigger\"\n render={renderSlot}\n {...props}\n />\n )\n}\n\nfunction SheetClose({\n asChild = false,\n ...props\n}: SheetPrimitive.Close.Props & { asChild?: boolean }) {\n const renderSlot = asChild ? <Slot /> : undefined\n\n return (\n <SheetPrimitive.Close\n data-slot=\"sheet-close\"\n render={renderSlot}\n {...props}\n />\n )\n}\n\nfunction SheetPortal({ container, ...props }: SheetPrimitive.Portal.Props) {\n const resolvedContainer = useThemePortalContainer(container)\n return <SheetPrimitive.Portal container={resolvedContainer} data-slot=\"sheet-portal\" {...props} />\n}\n\nfunction SheetOverlay({ className, ...props }: SheetPrimitive.Backdrop.Props) {\n return (\n <SheetPrimitive.Backdrop\n data-slot=\"sheet-overlay\"\n className={cn(modalBackdropRecipe, motionRecipes.backdrop, className)}\n {...props}\n />\n )\n}\n\nfunction SheetContent({\n className,\n container,\n children,\n side = \"right\",\n showCloseButton = true,\n ...props\n}: SheetPrimitive.Popup.Props & {\n side?: \"top\" | \"right\" | \"bottom\" | \"left\"\n showCloseButton?: boolean\n} & { container?: ThemePortalContainer }) {\n const resolvedContainer = useThemePortalContainer(container)\n return (\n <SheetPortal container={resolvedContainer}>\n <SheetOverlay />\n <SheetPrimitive.Popup\n data-slot=\"sheet-content\"\n data-side={side}\n className={cn(\n motionRecipes.drawer,\n \"border-border bg-background fixed z-50 flex flex-col gap-4 bg-clip-padding text-sm shadow-lg data-[side=bottom]:inset-x-0 data-[side=bottom]:bottom-0 data-[side=bottom]:h-auto data-[side=bottom]:border-t data-[side=left]:inset-y-0 data-[side=left]:left-0 data-[side=left]:h-full data-[side=left]:w-3/4 data-[side=left]:border-r data-[side=right]:inset-y-0 data-[side=right]:right-0 data-[side=right]:h-full data-[side=right]:w-3/4 data-[side=right]:border-l data-[side=top]:inset-x-0 data-[side=top]:top-0 data-[side=top]:h-auto data-[side=top]:border-b data-[side=left]:sm:max-w-sm data-[side=right]:sm:max-w-sm\",\n className\n )}\n {...props}\n >\n {children}\n {!!showCloseButton && (\n <SheetPrimitive.Close\n data-slot=\"sheet-close\"\n render={\n <Button\n variant=\"ghost\"\n data-overlay-close=\"\"\n className={overlayAnatomyRecipes.close}\n size=\"icon-sm\"\n />\n }\n >\n <XIcon\n />\n <span className=\"sr-only\">Close</span>\n </SheetPrimitive.Close>\n )}\n </SheetPrimitive.Popup>\n </SheetPortal>\n )\n}\n\nfunction SheetHeader({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"sheet-header\"\n className={cn(\"gap-1.5 p-4 flex flex-col\", className)}\n {...props}\n />\n )\n}\n\nfunction SheetFooter({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"sheet-footer\"\n className={cn(\"gap-2 p-4 mt-auto flex flex-col\", className)}\n {...props}\n />\n )\n}\n\nfunction SheetTitle({\n className,\n asChild = false,\n ...props\n}: SheetPrimitive.Title.Props & { asChild?: boolean }) {\n const renderSlot = asChild ? <Slot /> : undefined\n\n return (\n <SheetPrimitive.Title\n data-slot=\"sheet-title\"\n render={renderSlot}\n className={cn(\"text-foreground font-medium\", className)}\n {...props}\n />\n )\n}\n\nfunction SheetDescription({\n className,\n asChild = false,\n ...props\n}: SheetPrimitive.Description.Props & { asChild?: boolean }) {\n const renderSlot = asChild ? <Slot /> : undefined\n\n return (\n <SheetPrimitive.Description\n data-slot=\"sheet-description\"\n render={renderSlot}\n className={cn(\"text-muted-foreground text-sm\", className)}\n {...props}\n />\n )\n}\n\nexport {\n Sheet,\n SheetTrigger,\n SheetClose,\n SheetContent,\n SheetHeader,\n SheetFooter,\n SheetTitle,\n SheetDescription,\n}\n","import { modalRegionRecipes } from '../../../lib/surface-recipes';\nimport { overlayAnatomyRecipes } from '../../../lib/overlay-anatomy-recipes';\nimport type { TextGap } from '../structure';\n/**\n * Sheet — design-system wrapper around the shadcn compound primitive.\n *\n * The root and trigger behavior stay primitive-compatible. The package layer\n * adds a deliberate header / scrollable body / footer structure, calm admin\n * spacing, and stable BEM hooks without narrowing primitive props.\n */\nimport * as React from 'react';\n\nimport {\n\tSheet as SheetPrimitive,\n\tSheetClose as SheetClosePrimitive,\n\tSheetContent as SheetContentPrimitive,\n\tSheetDescription as SheetDescriptionPrimitive,\n\tSheetFooter as SheetFooterPrimitive,\n\tSheetHeader as SheetHeaderPrimitive,\n\tSheetTitle as SheetTitlePrimitive,\n\tSheetTrigger as SheetTriggerPrimitive,\n} from '../../ui/sheet';\nimport { Text } from '../../typography';\nimport { cn } from '../../../lib/utils';\n\nfunction isSimpleText(value: React.ReactNode): value is string | number | bigint {\n\treturn typeof value === 'string' || typeof value === 'number' || typeof value === 'bigint';\n}\n\nexport const Sheet = SheetPrimitive;\n\nexport const SheetTrigger = React.forwardRef<\n\tReact.ElementRef<typeof SheetTriggerPrimitive>,\n\tReact.ComponentPropsWithoutRef<typeof SheetTriggerPrimitive>\n>(function SheetTrigger({ className, ...props }, ref) {\n\treturn (\n\t\t<SheetTriggerPrimitive\n\t\t\tref={ref}\n\t\t\tclassName={cn('sheet-trigger--component', className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n});\n\nSheetTrigger.displayName = 'SheetTrigger';\n\nexport const SheetClose = React.forwardRef<\n\tReact.ElementRef<typeof SheetClosePrimitive>,\n\tReact.ComponentPropsWithoutRef<typeof SheetClosePrimitive>\n>(function SheetClose({ className, ...props }, ref) {\n\treturn (\n\t\t<SheetClosePrimitive\n\t\t\tref={ref}\n\t\t\tclassName={cn('sheet-close--component active:translate-y-0!', className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n});\n\nSheetClose.displayName = 'SheetClose';\n\nexport const SheetContent = React.forwardRef<\n\tReact.ElementRef<typeof SheetContentPrimitive>,\n\tReact.ComponentPropsWithoutRef<typeof SheetContentPrimitive>\n>(function SheetContent({ className, ...props }, ref) {\n\treturn (\n\t\t<SheetContentPrimitive\n\t\t\tref={ref}\n\t\t\tclassName={cn(\n\t\t\t\t// The shell stays flush so its separated regions can each own the\n\t\t\t\t// same default p-surface inset without stacking padding.\n\t\t\t\t'sheet-content--component border-0 data-[side=left]:border-r-0 data-[side=right]:border-l-0 data-[side=top]:border-b-0 data-[side=bottom]:border-t-0 min-h-0 gap-0 overflow-hidden bg-background text-foreground [&_[data-slot=sheet-close]]:active:translate-y-0!',\n\t\t\t\t'data-[side=top]:max-h-[85vh] data-[side=bottom]:max-h-[85vh]',\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n});\n\nSheetContent.displayName = 'SheetContent';\n\nexport const SheetHeader = React.forwardRef<\n\tHTMLDivElement,\n\tReact.ComponentPropsWithoutRef<typeof SheetHeaderPrimitive> & { textGap?: TextGap }\n>(function SheetHeader({ className, textGap = 'normal', ...props }, ref) {\n\treturn (\n\t\t<SheetHeaderPrimitive\n\t\t\tref={ref}\n\t\t\tclassName={cn(\n\t\t\t\t'sheet-header--component', modalRegionRecipes.header,\n\t\t\t\toverlayAnatomyRecipes.header,\n\t\t\t\ttextGap === 'dense' ? 'gap-dense' : 'gap-normal',\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n});\n\nSheetHeader.displayName = 'SheetHeader';\n\n/** Scroll-owning content region between the fixed sheet header and footer. */\nexport const SheetBody = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(\n\tfunction SheetBody({ className, ...props }, ref) {\n\t\treturn (\n\t\t\t<div\n\t\t\t\tref={ref}\n\t\t\t\tdata-slot=\"sheet-body\"\n\t\t\t\tclassName={cn(\n\t\t\t\t\t'sheet-body--component bg-muted/10', modalRegionRecipes.body,\n\t\t\t\t\tclassName,\n\t\t\t\t)}\n\t\t\t\t{...props}\n\t\t\t/>\n\t\t);\n\t},\n);\n\nSheetBody.displayName = 'SheetBody';\n\nexport const SheetFooter = React.forwardRef<\n\tHTMLDivElement,\n\tReact.ComponentPropsWithoutRef<typeof SheetFooterPrimitive>\n>(function SheetFooter({ className, ...props }, ref) {\n\treturn (\n\t\t<SheetFooterPrimitive\n\t\t\tref={ref}\n\t\t\tclassName={cn(\n\t\t\t\t'sheet-footer--component mt-auto flex-row items-center justify-end', modalRegionRecipes.footer,\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n});\n\nSheetFooter.displayName = 'SheetFooter';\n\nexport const SheetTitle = React.forwardRef<\n\tReact.ElementRef<typeof SheetTitlePrimitive>,\n\tReact.ComponentPropsWithoutRef<typeof SheetTitlePrimitive>\n>(function SheetTitle({ children, className, ...props }, ref) {\n\treturn (\n\t\t<SheetTitlePrimitive\n\t\t\tref={ref}\n\t\t\tclassName={cn('sheet-title--component', className)}\n\t\t\t{...props}\n\t\t>\n\t\t\t{isSimpleText(children) ? (\n\t\t\t\t<Text\n\t\t\t\t\ttag=\"span\"\n\t\t\t\t\tsize=\"base\"\n\t\t\t\t\tweight=\"semibold\"\n\t\t\t\t\tlineHeight=\"snug\"\n\t\t\t\t\tclassName=\"sheet-title--text\"\n\t\t\t\t>\n\t\t\t\t\t{children}\n\t\t\t\t</Text>\n\t\t\t) : children}\n\t\t</SheetTitlePrimitive>\n\t);\n});\n\nSheetTitle.displayName = 'SheetTitle';\n\nexport const SheetDescription = React.forwardRef<\n\tReact.ElementRef<typeof SheetDescriptionPrimitive>,\n\tReact.ComponentPropsWithoutRef<typeof SheetDescriptionPrimitive>\n>(function SheetDescription({ children, className, ...props }, ref) {\n\treturn (\n\t\t<SheetDescriptionPrimitive\n\t\t\tref={ref}\n\t\t\tclassName={cn('sheet-description--component', className)}\n\t\t\t{...props}\n\t\t>\n\t\t\t{isSimpleText(children) ? (\n\t\t\t\t<Text\n\t\t\t\t\ttag=\"span\"\n\t\t\t\t\ttype=\"secondary\"\n\t\t\t\t\tlineHeight=\"relaxed\"\n\t\t\t\t\tclassName=\"sheet-description--text\"\n\t\t\t\t>\n\t\t\t\t\t{children}\n\t\t\t\t</Text>\n\t\t\t) : children}\n\t\t</SheetDescriptionPrimitive>\n\t);\n});\n\nSheetDescription.displayName = 'SheetDescription';\n"],"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f,EAAmB,QACxFgB,CACD;EACA,GAAIX;CACJ,CAAA;AAEH,CAAC;AAED,EAAY,cAAc;AAE1B,IAAa+B,IAAalD,EAAM,WAG9B,SAAoB,EAAE,aAAU,cAAW,GAAGmB,KAAS,GAAK;CAC7D,OACC,kBAACb,GAAD;EACM;EACL,WAAWuB,EAAG,0BAA0BC,CAAS;EACjD,GAAIX;EAEH,UAAAqB,EAAaP,CAAQ,IACrB,kBAACvB,GAAD;GACC,KAAI;GACJ,MAAK;GACL,QAAO;GACP,YAAW;GACX,WAAU;GAET;EACI,CAAA,IACHuB;CACgB,CAAA;AAEvB,CAAC;AAED,EAAW,cAAc;AAEzB,IAAakB,IAAmBnD,EAAM,WAGpC,SAA0B,EAAE,aAAU,cAAW,GAAGmB,KAAS,GAAK;CACnE,OACC,kBAACZ,GAAD;EACM;EACL,WAAWsB,EAAG,gCAAgCC,CAAS;EACvD,GAAIX;EAEH,UAAAqB,EAAaP,CAAQ,IACrB,kBAACvB,GAAD;GACC,KAAI;GACJ,MAAK;GACL,YAAW;GACX,WAAU;GAET;EACI,CAAA,IACHuB;CACsB,CAAA;AAE7B,CAAC;AAED,EAAiB,cAAc"}
|
|
1
|
+
{"version":3,"file":"sheet-B-q914Ad.js","names":["Sheet","SheetPrimitive","SheetTrigger","SheetClose","SheetContent","SheetHeader","SheetFooter","SheetTitle","SheetDescription","SheetPrimitive","React","SheetTriggerPrimitive","SheetClosePrimitive","SheetContentPrimitive","SheetHeaderPrimitive","SheetFooterPrimitive","SheetTitlePrimitive","SheetDescriptionPrimitive","useThemePortalContainer","affordanceGeometry","Text","motionRecipes","Slot","Button","modalRegionRecipes","modalBackdropRecipe","React$1","overlayAnatomyRecipes","Sheet$1","props","Dialog","SheetTrigger$1","renderSlot","asChild","SheetClose$1","SheetPortal","resolvedContainer","container","SheetOverlay","cn","className","SheetContent$1","side","children","showCloseButton","XIcon","SheetHeader$1","SheetFooter$1","SheetTitle$1","SheetDescription$1","isSimpleText","value","Sheet","SheetTrigger","SheetClose","SheetContent","SheetHeader","textGap","SheetBody","SheetFooter","SheetTitle","SheetDescription"],"sources":["../src/lib/overlay-anatomy-recipes.ts","../src/components/ui/sheet.tsx","../src/components/base/sheet/sheet.tsx"],"sourcesContent":["import { affordanceGeometry } from './affordance-geometry.generated';\n/** Dismiss controls follow the surface's logical inset; headers reserve the\n * actual small-action width plus an action gap only when a close control exists.\n * These are derived recipes, not additional theme settings.\n */\nexport const overlayAnatomyRecipes = {\n\tclose: affordanceGeometry.overlayClose,\n\theader: affordanceGeometry.overlayHeader,\n} as const;\n","import { overlayAnatomyRecipes } from '../../lib/overlay-anatomy-recipes';\nimport { motionRecipes } from '../../lib/motion-recipes';\nimport { modalBackdropRecipe } from './overlay.recipes';\n\"use client\"\n\nimport { useThemePortalContainer, type ThemePortalContainer } from '../../lib/theme-scope';\n\nimport { Dialog as SheetPrimitive } from \"@base-ui/react/dialog\"\nimport { XIcon } from \"lucide-react\"\nimport * as React from \"react\"\n\nimport { Button } from \"./button\"\nimport { Slot } from \"./slot\"\nimport { cn } from \"../../lib/utils\"\n\nfunction Sheet({ ...props }: SheetPrimitive.Root.Props) {\n return <SheetPrimitive.Root data-slot=\"sheet\" modal=\"trap-focus\" {...props} />\n}\n\nfunction SheetTrigger({\n asChild = false,\n ...props\n}: SheetPrimitive.Trigger.Props & { asChild?: boolean }) {\n const renderSlot = asChild ? <Slot /> : undefined\n\n return (\n <SheetPrimitive.Trigger\n data-slot=\"sheet-trigger\"\n render={renderSlot}\n {...props}\n />\n )\n}\n\nfunction SheetClose({\n asChild = false,\n ...props\n}: SheetPrimitive.Close.Props & { asChild?: boolean }) {\n const renderSlot = asChild ? <Slot /> : undefined\n\n return (\n <SheetPrimitive.Close\n data-slot=\"sheet-close\"\n render={renderSlot}\n {...props}\n />\n )\n}\n\nfunction SheetPortal({ container, ...props }: SheetPrimitive.Portal.Props) {\n const resolvedContainer = useThemePortalContainer(container)\n return <SheetPrimitive.Portal container={resolvedContainer} data-slot=\"sheet-portal\" {...props} />\n}\n\nfunction SheetOverlay({ className, ...props }: SheetPrimitive.Backdrop.Props) {\n return (\n <SheetPrimitive.Backdrop\n data-slot=\"sheet-overlay\"\n className={cn(modalBackdropRecipe, motionRecipes.backdrop, className)}\n {...props}\n />\n )\n}\n\nfunction SheetContent({\n className,\n container,\n children,\n side = \"right\",\n showCloseButton = true,\n ...props\n}: SheetPrimitive.Popup.Props & {\n side?: \"top\" | \"right\" | \"bottom\" | \"left\"\n showCloseButton?: boolean\n} & { container?: ThemePortalContainer }) {\n const resolvedContainer = useThemePortalContainer(container)\n return (\n <SheetPortal container={resolvedContainer}>\n <SheetOverlay />\n <SheetPrimitive.Popup\n data-slot=\"sheet-content\"\n data-side={side}\n className={cn(\n motionRecipes.drawer,\n \"border-border bg-background fixed z-50 flex flex-col gap-4 bg-clip-padding text-sm shadow-lg data-[side=bottom]:inset-x-0 data-[side=bottom]:bottom-0 data-[side=bottom]:h-auto data-[side=bottom]:border-t data-[side=left]:inset-y-0 data-[side=left]:left-0 data-[side=left]:h-full data-[side=left]:w-3/4 data-[side=left]:border-r data-[side=right]:inset-y-0 data-[side=right]:right-0 data-[side=right]:h-full data-[side=right]:w-3/4 data-[side=right]:border-l data-[side=top]:inset-x-0 data-[side=top]:top-0 data-[side=top]:h-auto data-[side=top]:border-b data-[side=left]:sm:max-w-sm data-[side=right]:sm:max-w-sm\",\n className\n )}\n {...props}\n >\n {children}\n {!!showCloseButton && (\n <SheetPrimitive.Close\n data-slot=\"sheet-close\"\n render={\n <Button\n variant=\"ghost\"\n data-overlay-close=\"\"\n className={overlayAnatomyRecipes.close}\n size=\"icon-sm\"\n />\n }\n >\n <XIcon\n />\n <span className=\"sr-only\">Close</span>\n </SheetPrimitive.Close>\n )}\n </SheetPrimitive.Popup>\n </SheetPortal>\n )\n}\n\nfunction SheetHeader({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"sheet-header\"\n className={cn(\"gap-1.5 p-4 flex flex-col\", className)}\n {...props}\n />\n )\n}\n\nfunction SheetFooter({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"sheet-footer\"\n className={cn(\"gap-2 p-4 mt-auto flex flex-col\", className)}\n {...props}\n />\n )\n}\n\nfunction SheetTitle({\n className,\n asChild = false,\n ...props\n}: SheetPrimitive.Title.Props & { asChild?: boolean }) {\n const renderSlot = asChild ? <Slot /> : undefined\n\n return (\n <SheetPrimitive.Title\n data-slot=\"sheet-title\"\n render={renderSlot}\n className={cn(\"text-foreground font-medium\", className)}\n {...props}\n />\n )\n}\n\nfunction SheetDescription({\n className,\n asChild = false,\n ...props\n}: SheetPrimitive.Description.Props & { asChild?: boolean }) {\n const renderSlot = asChild ? <Slot /> : undefined\n\n return (\n <SheetPrimitive.Description\n data-slot=\"sheet-description\"\n render={renderSlot}\n className={cn(\"text-muted-foreground text-sm\", className)}\n {...props}\n />\n )\n}\n\nexport {\n Sheet,\n SheetTrigger,\n SheetClose,\n SheetContent,\n SheetHeader,\n SheetFooter,\n SheetTitle,\n SheetDescription,\n}\n","import { modalRegionRecipes } from '../../../lib/surface-recipes';\nimport { overlayAnatomyRecipes } from '../../../lib/overlay-anatomy-recipes';\nimport type { TextGap } from '../structure';\n/**\n * Sheet — design-system wrapper around the shadcn compound primitive.\n *\n * The root and trigger behavior stay primitive-compatible. The package layer\n * adds a deliberate header / scrollable body / footer structure, calm admin\n * spacing, and stable BEM hooks without narrowing primitive props.\n */\nimport * as React from 'react';\n\nimport {\n\tSheet as SheetPrimitive,\n\tSheetClose as SheetClosePrimitive,\n\tSheetContent as SheetContentPrimitive,\n\tSheetDescription as SheetDescriptionPrimitive,\n\tSheetFooter as SheetFooterPrimitive,\n\tSheetHeader as SheetHeaderPrimitive,\n\tSheetTitle as SheetTitlePrimitive,\n\tSheetTrigger as SheetTriggerPrimitive,\n} from '../../ui/sheet';\nimport { Text } from '../../typography';\nimport { cn } from '../../../lib/utils';\n\nfunction isSimpleText(value: React.ReactNode): value is string | number | bigint {\n\treturn typeof value === 'string' || typeof value === 'number' || typeof value === 'bigint';\n}\n\nexport const Sheet = SheetPrimitive;\n\nexport const SheetTrigger = React.forwardRef<\n\tReact.ElementRef<typeof SheetTriggerPrimitive>,\n\tReact.ComponentPropsWithoutRef<typeof SheetTriggerPrimitive>\n>(function SheetTrigger({ className, ...props }, ref) {\n\treturn (\n\t\t<SheetTriggerPrimitive\n\t\t\tref={ref}\n\t\t\tclassName={cn('sheet-trigger--component', className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n});\n\nSheetTrigger.displayName = 'SheetTrigger';\n\nexport const SheetClose = React.forwardRef<\n\tReact.ElementRef<typeof SheetClosePrimitive>,\n\tReact.ComponentPropsWithoutRef<typeof SheetClosePrimitive>\n>(function SheetClose({ className, ...props }, ref) {\n\treturn (\n\t\t<SheetClosePrimitive\n\t\t\tref={ref}\n\t\t\tclassName={cn('sheet-close--component active:translate-y-0!', className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n});\n\nSheetClose.displayName = 'SheetClose';\n\nexport const SheetContent = React.forwardRef<\n\tReact.ElementRef<typeof SheetContentPrimitive>,\n\tReact.ComponentPropsWithoutRef<typeof SheetContentPrimitive>\n>(function SheetContent({ className, ...props }, ref) {\n\treturn (\n\t\t<SheetContentPrimitive\n\t\t\tref={ref}\n\t\t\tclassName={cn(\n\t\t\t\t// The shell stays flush so its separated regions can each own the\n\t\t\t\t// same default p-surface inset without stacking padding.\n\t\t\t\t'sheet-content--component border-0 data-[side=left]:border-r-0 data-[side=right]:border-l-0 data-[side=top]:border-b-0 data-[side=bottom]:border-t-0 min-h-0 gap-0 overflow-hidden bg-background text-foreground [&_[data-slot=sheet-close]]:active:translate-y-0!',\n\t\t\t\t'data-[side=top]:max-h-[85vh] data-[side=bottom]:max-h-[85vh]',\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n});\n\nSheetContent.displayName = 'SheetContent';\n\nexport const SheetHeader = React.forwardRef<\n\tHTMLDivElement,\n\tReact.ComponentPropsWithoutRef<typeof SheetHeaderPrimitive> & { textGap?: TextGap }\n>(function SheetHeader({ className, textGap = 'normal', ...props }, ref) {\n\treturn (\n\t\t<SheetHeaderPrimitive\n\t\t\tref={ref}\n\t\t\tclassName={cn(\n\t\t\t\t'sheet-header--component', modalRegionRecipes.header,\n\t\t\t\toverlayAnatomyRecipes.header,\n\t\t\t\ttextGap === 'dense' ? 'gap-dense' : 'gap-normal',\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n});\n\nSheetHeader.displayName = 'SheetHeader';\n\n/** Scroll-owning content region between the fixed sheet header and footer. */\nexport const SheetBody = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(\n\tfunction SheetBody({ className, ...props }, ref) {\n\t\treturn (\n\t\t\t<div\n\t\t\t\tref={ref}\n\t\t\t\tdata-slot=\"sheet-body\"\n\t\t\t\tclassName={cn(\n\t\t\t\t\t'sheet-body--component bg-muted/10', modalRegionRecipes.body,\n\t\t\t\t\tclassName,\n\t\t\t\t)}\n\t\t\t\t{...props}\n\t\t\t/>\n\t\t);\n\t},\n);\n\nSheetBody.displayName = 'SheetBody';\n\nexport const SheetFooter = React.forwardRef<\n\tHTMLDivElement,\n\tReact.ComponentPropsWithoutRef<typeof SheetFooterPrimitive>\n>(function SheetFooter({ className, ...props }, ref) {\n\treturn (\n\t\t<SheetFooterPrimitive\n\t\t\tref={ref}\n\t\t\tclassName={cn(\n\t\t\t\t'sheet-footer--component mt-auto flex-row items-center justify-end', modalRegionRecipes.footer,\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n});\n\nSheetFooter.displayName = 'SheetFooter';\n\nexport const SheetTitle = React.forwardRef<\n\tReact.ElementRef<typeof SheetTitlePrimitive>,\n\tReact.ComponentPropsWithoutRef<typeof SheetTitlePrimitive>\n>(function SheetTitle({ children, className, ...props }, ref) {\n\treturn (\n\t\t<SheetTitlePrimitive\n\t\t\tref={ref}\n\t\t\tclassName={cn('sheet-title--component', className)}\n\t\t\t{...props}\n\t\t>\n\t\t\t{isSimpleText(children) ? (\n\t\t\t\t<Text\n\t\t\t\t\ttag=\"span\"\n\t\t\t\t\tsize=\"base\"\n\t\t\t\t\tweight=\"semibold\"\n\t\t\t\t\tlineHeight=\"snug\"\n\t\t\t\t\tclassName=\"sheet-title--text\"\n\t\t\t\t>\n\t\t\t\t\t{children}\n\t\t\t\t</Text>\n\t\t\t) : children}\n\t\t</SheetTitlePrimitive>\n\t);\n});\n\nSheetTitle.displayName = 'SheetTitle';\n\nexport const SheetDescription = React.forwardRef<\n\tReact.ElementRef<typeof SheetDescriptionPrimitive>,\n\tReact.ComponentPropsWithoutRef<typeof SheetDescriptionPrimitive>\n>(function SheetDescription({ children, className, ...props }, ref) {\n\treturn (\n\t\t<SheetDescriptionPrimitive\n\t\t\tref={ref}\n\t\t\tclassName={cn('sheet-description--component', className)}\n\t\t\t{...props}\n\t\t>\n\t\t\t{isSimpleText(children) ? (\n\t\t\t\t<Text\n\t\t\t\t\ttag=\"span\"\n\t\t\t\t\ttype=\"secondary\"\n\t\t\t\t\tlineHeight=\"relaxed\"\n\t\t\t\t\tclassName=\"sheet-description--text\"\n\t\t\t\t>\n\t\t\t\t\t{children}\n\t\t\t\t</Text>\n\t\t\t) : children}\n\t\t</SheetDescriptionPrimitive>\n\t);\n});\n\nSheetDescription.displayName = 'SheetDescription';\n"],"mappings":";;;;;;;;;;;;;;;AAKA,IAAa2B,IAAwB;CACpC,OAAOR,EAAmB;CAC1B,QAAQA,EAAmB;AAC5B;;;ACOA,SAASnB,EAAM,EAAE,GAAG6B,KAAoC;CACtD,OAAO,kBAAC5B,EAAe,MAAhB;EAAqB,aAAU;EAAQ,OAAM;EAAa,GAAI4B;CAAQ,CAAA;AAC/E;AAEA,SAAS3B,EAAa,EACpB,aAAU,IACV,GAAG2B,KACoD;CACvD,IAAMG,IAAaC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AK;GACL,QAAO;GACP,YAAW;GACX,WAAU;GAET;EACI,CAAA,IACHuB;CACgB,CAAA;AAEvB,CAAC;AAED,EAAW,cAAc;AAEzB,IAAakB,IAAmBnD,EAAM,WAGpC,SAA0B,EAAE,aAAU,cAAW,GAAGmB,KAAS,GAAK;CACnE,OACC,kBAACZ,GAAD;EACM;EACL,WAAWsB,EAAG,gCAAgCC,CAAS;EACvD,GAAIX;EAEH,UAAAqB,EAAaP,CAAQ,IACrB,kBAACvB,GAAD;GACC,KAAI;GACJ,MAAK;GACL,YAAW;GACX,WAAU;GAET;EACI,CAAA,IACHuB;CACsB,CAAA;AAE7B,CAAC;AAED,EAAiB,cAAc"}
|
|
@@ -3,16 +3,16 @@ import { useStrings as e } from "./lib/strings.js";
|
|
|
3
3
|
import { t } from "./utils-C2EKeIw3.js";
|
|
4
4
|
import { c as n } from "./buttons-Co6GavvM.js";
|
|
5
5
|
import { a as r } from "./typography-Cv8MT-82.js";
|
|
6
|
-
import { t as i } from "./structure-
|
|
6
|
+
import { t as i } from "./structure-MvKVq-oL.js";
|
|
7
7
|
import { g as a, r as o, t as s } from "./dropdown-menu-BlnyHr-9.js";
|
|
8
8
|
import { n as c } from "./action-menu-Cx3SdfbN.js";
|
|
9
|
-
import { r as l } from "./skeleton-
|
|
9
|
+
import { r as l } from "./skeleton-CmT1ppqb.js";
|
|
10
10
|
import { t as u } from "./initials-format-CDoQEOd_.js";
|
|
11
|
-
import { i as d, n as f, s as p } from "./avatar-
|
|
11
|
+
import { i as d, n as f, s as p } from "./avatar-Bpzty83c.js";
|
|
12
12
|
import { n as m, r as h, t as g } from "./collapsible-DsnktFNv.js";
|
|
13
13
|
import { t as _ } from "./scroll-area-BheMQ270.js";
|
|
14
|
-
import { E as v, S as y, T as b, _ as ee, b as x, c as S, d as C, f as w, h as T, i as E, l as te, m as D, n as ne, o as O, r as re, s as k, t as A, v as ie, y as ae } from "./sidebar-
|
|
15
|
-
import { a as j, c as M, d as N, i as P, l as F, o as I, r as L, s as R, u as z } from "./hooks-
|
|
14
|
+
import { E as v, S as y, T as b, _ as ee, b as x, c as S, d as C, f as w, h as T, i as E, l as te, m as D, n as ne, o as O, r as re, s as k, t as A, v as ie, y as ae } from "./sidebar-DPR7fmqN.js";
|
|
15
|
+
import { a as j, c as M, d as N, i as P, l as F, o as I, r as L, s as R, u as z } from "./hooks-CM1Vp9Pe.js";
|
|
16
16
|
import * as B from "react";
|
|
17
17
|
import { Fragment as V, jsx as H, jsxs as U } from "react/jsx-runtime";
|
|
18
18
|
import { ChevronRight as oe, ChevronsUpDown as W, ExternalLink as se, LogOut as G, Settings as K, User as q } from "lucide-react";
|
|
@@ -498,4 +498,4 @@ function _e({ user: t, customContent: n, onProfile: l, onSettings: m, onLogout:
|
|
|
498
498
|
//#endregion
|
|
499
499
|
export { $ as a, Z as c, ce as d, Y as f, fe as i, le as l, ge as n, de as o, J as p, he as r, Q as s, _e as t, X as u };
|
|
500
500
|
|
|
501
|
-
//# sourceMappingURL=sidebar-
|
|
501
|
+
//# sourceMappingURL=sidebar-C_2p3Tfj.js.map
|