@signalflare-ai/ui 0.5.0 → 1.0.0
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 +117 -1
- package/ai/USAGE.md +64 -0
- package/ai/component-registry.json +492 -618
- package/ai/component-registry.md +167 -85
- package/ai/schemas.ts +545 -102
- package/bin/sf.js +2 -3
- package/dist/.build-complete +1 -1
- package/dist/ai/schemas.d.ts +1659 -5532
- package/dist/ai/schemas.d.ts.map +1 -1
- package/dist/{ai-actions-DG1dhDMP.js → ai-actions-DSVeQn4e.js} +1 -1
- package/dist/{ai-actions-DG1dhDMP.js.map → ai-actions-DSVeQn4e.js.map} +1 -1
- package/dist/{ai-agent-card-BbtL4NII.js → ai-agent-card-BXHwhWAU.js} +1 -1
- package/dist/{ai-agent-card-BbtL4NII.js.map → ai-agent-card-BXHwhWAU.js.map} +1 -1
- package/dist/{ai-approval-Mb7-BY6i.js → ai-approval-aa0qvjFN.js} +1 -1
- package/dist/{ai-approval-Mb7-BY6i.js.map → ai-approval-aa0qvjFN.js.map} +1 -1
- package/dist/{ai-code-block-BI_z0UVR.js → ai-code-block-BgtIxtZZ.js} +1 -1
- package/dist/{ai-code-block-BI_z0UVR.js.map → ai-code-block-BgtIxtZZ.js.map} +1 -1
- package/dist/{ai-conversation-DYtExcrw.js → ai-conversation-CArP7C8K.js} +1 -1
- package/dist/{ai-conversation-DYtExcrw.js.map → ai-conversation-CArP7C8K.js.map} +1 -1
- package/dist/{ai-info-banner-BpzauUAY.js → ai-info-banner-uFxHHwBA.js} +1 -1
- package/dist/{ai-info-banner-BpzauUAY.js.map → ai-info-banner-uFxHHwBA.js.map} +1 -1
- package/dist/{ai-message-CV8SBoHM.js → ai-message-BjnFznXy.js} +1 -1
- package/dist/{ai-message-CV8SBoHM.js.map → ai-message-BjnFznXy.js.map} +1 -1
- package/dist/{ai-mission-header-ByYkJ6YP.js → ai-mission-header-08__gULL.js} +1 -1
- package/dist/{ai-mission-header-ByYkJ6YP.js.map → ai-mission-header-08__gULL.js.map} +1 -1
- package/dist/ai-part-group-DBtgTgAn.js +277 -0
- package/dist/ai-part-group-DBtgTgAn.js.map +1 -0
- package/dist/ai-prompt-input-Dy1LfxPk.js +1541 -0
- package/dist/ai-prompt-input-Dy1LfxPk.js.map +1 -0
- package/dist/{ai-question-Dp1g9k2o.js → ai-question-CHHoDJMg.js} +1 -1
- package/dist/{ai-question-Dp1g9k2o.js.map → ai-question-CHHoDJMg.js.map} +1 -1
- package/dist/{ai-reasoning-UAmNx_LD.js → ai-reasoning-CnL6ZSr5.js} +84 -5
- package/dist/ai-reasoning-CnL6ZSr5.js.map +1 -0
- package/dist/{ai-response-BWoVsNQG.js → ai-response-BEUg3xvd.js} +13 -16
- package/dist/ai-response-BEUg3xvd.js.map +1 -0
- package/dist/{ai-shimmer-BpOmfonu.js → ai-shimmer-By5_L05p.js} +1 -1
- package/dist/{ai-shimmer-BpOmfonu.js.map → ai-shimmer-By5_L05p.js.map} +1 -1
- package/dist/{ai-status-badge-WhbKVeqn.js → ai-status-badge-BGYGWYF6.js} +1 -1
- package/dist/{ai-status-badge-WhbKVeqn.js.map → ai-status-badge-BGYGWYF6.js.map} +1 -1
- package/dist/{ai-streaming-text-ClL7FwvD.js → ai-streaming-text-CMfoThV0.js} +1 -1
- package/dist/{ai-streaming-text-ClL7FwvD.js.map → ai-streaming-text-CMfoThV0.js.map} +1 -1
- package/dist/{ai-subagent-BruGN1UE.js → ai-subagent-DcPRqkAA.js} +1 -1
- package/dist/{ai-subagent-BruGN1UE.js.map → ai-subagent-DcPRqkAA.js.map} +1 -1
- package/dist/{ai-suggestion-CNsCZj5P.js → ai-suggestion-MgeCg5Ar.js} +1 -1
- package/dist/{ai-suggestion-CNsCZj5P.js.map → ai-suggestion-MgeCg5Ar.js.map} +1 -1
- package/dist/{ai-task-list-B9CpMDYN.js → ai-task-list-Da9zIm00.js} +9 -12
- package/dist/ai-task-list-Da9zIm00.js.map +1 -0
- package/dist/{ai-timeline-Bb5ntsr3.js → ai-timeline-Cwu045IR.js} +1 -1
- package/dist/ai-timeline-Cwu045IR.js.map +1 -0
- package/dist/{ai-tool-BGH8nQ_D.js → ai-tool-Cn1O4xjP.js} +168 -11
- package/dist/ai-tool-Cn1O4xjP.js.map +1 -0
- package/dist/{ai-usage-bar-BI-p-JBk.js → ai-usage-bar-DjS12DMp.js} +1 -1
- package/dist/{ai-usage-bar-BI-p-JBk.js.map → ai-usage-bar-DjS12DMp.js.map} +1 -1
- package/dist/catalog.js +3 -3
- package/dist/catalog.js.map +1 -1
- package/dist/{chart-Bes4MN3C.js → chart-BK3sVPnD.js} +442 -248
- package/dist/chart-BK3sVPnD.js.map +1 -0
- package/dist/{checkbox-CPX7lBaU.js → checkbox-DYhUmZNw.js} +4 -4
- package/dist/checkbox-DYhUmZNw.js.map +1 -0
- package/dist/{clipboard-text-92YeCybc.js → clipboard-text-ssybngLw.js} +2 -2
- package/dist/{clipboard-text-92YeCybc.js.map → clipboard-text-ssybngLw.js.map} +1 -1
- package/dist/{code-DE1Yy1Cu.js → code-Cx-QSoOT.js} +2 -2
- package/dist/{code-DE1Yy1Cu.js.map → code-Cx-QSoOT.js.map} +1 -1
- package/dist/{combobox-B0bLdsX8.js → combobox-C0iW6a0r.js} +2 -2
- package/dist/{combobox-B0bLdsX8.js.map → combobox-C0iW6a0r.js.map} +1 -1
- package/dist/command-line/cli.js +22 -27
- package/dist/{command-palette-CBTY8EiF.js → command-palette-DGzioeki.js} +2 -2
- package/dist/command-palette-DGzioeki.js.map +1 -0
- package/dist/components/ai-actions.js +1 -1
- package/dist/components/ai-agent-card.js +1 -1
- package/dist/components/ai-approval.js +1 -1
- package/dist/components/ai-code-block.js +1 -1
- package/dist/components/ai-conversation.js +1 -1
- package/dist/components/ai-info-banner.js +1 -1
- package/dist/components/ai-message.js +1 -1
- package/dist/components/ai-mission-header.js +1 -1
- package/dist/components/ai-part-group.js +3 -0
- package/dist/components/ai-prompt-input.js +2 -2
- package/dist/components/ai-question.js +1 -1
- package/dist/components/ai-reasoning.js +1 -1
- package/dist/components/ai-response.js +1 -1
- package/dist/components/ai-shimmer.js +1 -1
- package/dist/components/ai-status-badge.js +1 -1
- package/dist/components/ai-streaming-text.js +1 -1
- package/dist/components/ai-subagent.js +1 -1
- package/dist/components/ai-suggestion.js +1 -1
- package/dist/components/ai-task-list.js +1 -1
- package/dist/components/ai-timeline.js +1 -1
- package/dist/components/ai-tool.js +1 -1
- package/dist/components/ai-usage-bar.js +1 -1
- package/dist/components/chart.js +3 -2
- package/dist/components/checkbox.js +1 -1
- package/dist/components/clipboard-text.js +1 -1
- package/dist/components/code.js +1 -1
- package/dist/components/combobox.js +1 -1
- package/dist/components/command-palette.js +1 -1
- package/dist/components/data-grid.js +1 -1
- package/dist/components/date-picker.js +1 -1
- package/dist/components/dropdown.js +1 -1
- package/dist/components/filters.js +1 -1
- package/dist/components/input.js +2 -2
- package/dist/components/link.js +2 -2
- package/dist/components/link.js.map +1 -1
- package/dist/components/pagination.js +1 -1
- package/dist/components/radio.js +1 -1
- package/dist/components/select.js +1 -1
- package/dist/components/sensitive-input.js +1 -1
- package/dist/components/sidebar.js +1 -1
- package/dist/components/sparkline.js +3 -0
- package/dist/components/stat-card.js +3 -0
- package/dist/components/table.js +1 -1
- package/dist/components/text-roll.js +3 -0
- package/dist/components/theme-toggle.js +1 -1
- package/dist/components/use-agent-harness.js +1 -1
- package/dist/{data-grid-UJ9ja5cu.js → data-grid-CG76N_hK.js} +6 -6
- package/dist/data-grid-CG76N_hK.js.map +1 -0
- package/dist/{date-picker-ebekkC3R.js → date-picker-Dqg9L4xu.js} +2 -2
- package/dist/{date-picker-ebekkC3R.js.map → date-picker-Dqg9L4xu.js.map} +1 -1
- package/dist/{dist-BNlyONdD.js → dist-1-gcEL2L.js} +224 -135
- package/dist/dist-1-gcEL2L.js.map +1 -0
- package/dist/{dropdown-J5T4pHaR.js → dropdown-qnEYRFXZ.js} +2 -2
- package/dist/{dropdown-J5T4pHaR.js.map → dropdown-qnEYRFXZ.js.map} +1 -1
- package/dist/echart-DURZEyai.js +314 -0
- package/dist/echart-DURZEyai.js.map +1 -0
- package/dist/{filters-BdBogf7D.js → filters-Bw_U6ZTx.js} +5 -5
- package/dist/filters-Bw_U6ZTx.js.map +1 -0
- package/dist/flow-BRsYUCJa.js.map +1 -1
- package/dist/genui.js +2 -2
- package/dist/genui.js.map +1 -1
- package/dist/index.js +45 -42
- package/dist/index.js.map +1 -1
- package/dist/{input-BxQAnXki.js → input-DXYUjGgD.js} +2 -2
- package/dist/{input-BxQAnXki.js.map → input-DXYUjGgD.js.map} +1 -1
- package/dist/{input-Cn25I4o5.js → input-DddtBN-g.js} +2 -2
- package/dist/{input-Cn25I4o5.js.map → input-DddtBN-g.js.map} +1 -1
- package/dist/layer-card-BME0eljh.js.map +1 -1
- package/dist/{pagination-C_YqCy8l.js → pagination-BVqdlONY.js} +2 -2
- package/dist/{pagination-C_YqCy8l.js.map → pagination-BVqdlONY.js.map} +1 -1
- package/dist/primitives/otp-field.js +2 -0
- package/dist/primitives.js +1 -0
- package/dist/{radio-B7zg1wUI.js → radio-BNSwOt3B.js} +3 -3
- package/dist/radio-BNSwOt3B.js.map +1 -0
- package/dist/{select-9p721G00.js → select-1w2aebGQ.js} +2 -2
- package/dist/select-1w2aebGQ.js.map +1 -0
- package/dist/{sensitive-input-D5je2NLl.js → sensitive-input-82Cez3vj.js} +2 -2
- package/dist/{sensitive-input-D5je2NLl.js.map → sensitive-input-82Cez3vj.js.map} +1 -1
- package/dist/{sidebar-DOwBrq57.js → sidebar-CAsCmSpM.js} +3 -3
- package/dist/sidebar-CAsCmSpM.js.map +1 -0
- package/dist/sparkline-DdbeM4Ai.js +108 -0
- package/dist/sparkline-DdbeM4Ai.js.map +1 -0
- package/dist/src/blocks/agent-harness/agent-harness.d.ts +30 -9
- package/dist/src/blocks/agent-harness/agent-harness.d.ts.map +1 -1
- package/dist/src/blocks/agent-harness/agent-harness.stories.tsx +114 -0
- package/dist/src/blocks/agent-harness/agent-harness.tsx +144 -63
- package/dist/src/blocks/commander/commander.stories.tsx +31 -0
- package/dist/src/blocks/dashboard-grid/dashboard-grid.d.ts +48 -0
- package/dist/src/blocks/dashboard-grid/dashboard-grid.d.ts.map +1 -0
- package/dist/src/blocks/dashboard-grid/dashboard-grid.stories.tsx +19 -0
- package/dist/src/blocks/dashboard-grid/dashboard-grid.tsx +110 -0
- package/dist/src/blocks/dashboard-grid/index.d.ts +2 -0
- package/dist/src/blocks/dashboard-grid/index.d.ts.map +1 -0
- package/dist/src/blocks/delete-resource/delete-resource.stories.tsx +31 -0
- package/dist/src/blocks/map-block/map-block.stories.tsx +41 -0
- package/dist/src/blocks/metrics-overview/index.d.ts +2 -0
- package/dist/src/blocks/metrics-overview/index.d.ts.map +1 -0
- package/dist/src/blocks/metrics-overview/metrics-overview.d.ts +67 -0
- package/dist/src/blocks/metrics-overview/metrics-overview.d.ts.map +1 -0
- package/dist/src/blocks/metrics-overview/metrics-overview.stories.tsx +26 -0
- package/dist/src/blocks/metrics-overview/metrics-overview.tsx +139 -0
- package/dist/src/blocks/page-header/page-header.stories.tsx +56 -0
- package/dist/src/blocks/resource-list/resource-list.stories.tsx +31 -0
- package/dist/src/catalog/catalog.d.ts +1 -1
- package/dist/src/catalog/index.d.ts +1 -1
- package/dist/src/catalog/types.d.ts +1 -1
- package/dist/src/command-line/build-cli.d.ts +1 -1
- package/dist/src/command-line/cli.d.ts +1 -1
- package/dist/src/command-line/commands/add.d.ts +1 -1
- package/dist/src/command-line/commands/add.d.ts.map +1 -1
- package/dist/src/command-line/commands/ai.d.ts.map +1 -1
- package/dist/src/command-line/commands/blocks.d.ts +1 -1
- package/dist/src/command-line/commands/blocks.d.ts.map +1 -1
- package/dist/src/command-line/commands/doc.d.ts +1 -1
- package/dist/src/command-line/commands/doc.d.ts.map +1 -1
- package/dist/src/command-line/commands/ls.d.ts +1 -1
- package/dist/src/command-line/commands/ls.d.ts.map +1 -1
- package/dist/src/command-line/commands/migrate.d.ts +3 -3
- package/dist/src/command-line/commands/migrate.d.ts.map +1 -1
- package/dist/src/command-line/utils/config.d.ts +1 -1
- package/dist/src/command-line/utils/transformer.d.ts +1 -1
- package/dist/src/components/ai-part-group/ai-part-group.d.ts +134 -0
- package/dist/src/components/ai-part-group/ai-part-group.d.ts.map +1 -0
- package/dist/src/components/ai-part-group/index.d.ts +2 -0
- package/dist/src/components/ai-part-group/index.d.ts.map +1 -0
- package/dist/src/components/ai-prompt-input/ai-prompt-input.d.ts +196 -7
- package/dist/src/components/ai-prompt-input/ai-prompt-input.d.ts.map +1 -1
- package/dist/src/components/ai-prompt-input/controller.d.ts +41 -0
- package/dist/src/components/ai-prompt-input/controller.d.ts.map +1 -0
- package/dist/src/components/ai-prompt-input/index.d.ts +3 -1
- package/dist/src/components/ai-prompt-input/index.d.ts.map +1 -1
- package/dist/src/components/ai-prompt-input/types.d.ts +86 -0
- package/dist/src/components/ai-prompt-input/types.d.ts.map +1 -0
- package/dist/src/components/ai-reasoning/ai-reasoning.d.ts +17 -1
- package/dist/src/components/ai-reasoning/ai-reasoning.d.ts.map +1 -1
- package/dist/src/components/ai-response/ai-response.d.ts +1 -2
- package/dist/src/components/ai-response/ai-response.d.ts.map +1 -1
- package/dist/src/components/ai-task-list/ai-task-list.d.ts.map +1 -1
- package/dist/src/components/ai-tool/ai-tool.d.ts +17 -1
- package/dist/src/components/ai-tool/ai-tool.d.ts.map +1 -1
- package/dist/src/components/chart/area-chart.d.ts +69 -0
- package/dist/src/components/chart/area-chart.d.ts.map +1 -0
- package/dist/src/components/chart/bar-chart.d.ts +60 -0
- package/dist/src/components/chart/bar-chart.d.ts.map +1 -0
- package/dist/src/components/chart/color.d.ts +56 -0
- package/dist/src/components/chart/color.d.ts.map +1 -1
- package/dist/src/components/chart/echart.d.ts.map +1 -1
- package/dist/src/components/chart/index.d.ts +5 -0
- package/dist/src/components/chart/index.d.ts.map +1 -1
- package/dist/src/components/chart/pie-chart.d.ts +64 -0
- package/dist/src/components/chart/pie-chart.d.ts.map +1 -0
- package/dist/src/components/chart/scatter-chart.d.ts +57 -0
- package/dist/src/components/chart/scatter-chart.d.ts.map +1 -0
- package/dist/src/components/chart/stacked-bar-chart.d.ts +59 -0
- package/dist/src/components/chart/stacked-bar-chart.d.ts.map +1 -0
- package/dist/src/components/chart/timeseries-chart.d.ts.map +1 -1
- package/dist/src/components/code/code.d.ts +1 -1
- package/dist/src/components/command-palette/command-palette.d.ts +1 -1
- package/dist/src/components/data-grid/data-grid.d.ts.map +1 -1
- package/dist/src/components/data-grid/index.d.ts +1 -1
- package/dist/src/components/data-grid/index.d.ts.map +1 -1
- package/dist/src/components/data-grid/types.d.ts.map +1 -1
- package/dist/src/components/date-picker/date-picker.d.ts +2 -2
- package/dist/src/components/filters/filters.d.ts.map +1 -1
- package/dist/src/components/filters/helpers.d.ts.map +1 -1
- package/dist/src/components/filters/types.d.ts.map +1 -1
- package/dist/src/components/layer-card/layer-card.d.ts +1 -1
- package/dist/src/components/link/link.d.ts +2 -2
- package/dist/src/components/radio/radio.d.ts +1 -1
- package/dist/src/components/select/select.d.ts +1 -1
- package/dist/src/components/sidebar/sidebar.d.ts +2 -2
- package/dist/src/components/sparkline/index.d.ts +2 -0
- package/dist/src/components/sparkline/index.d.ts.map +1 -0
- package/dist/src/components/sparkline/sparkline.d.ts +52 -0
- package/dist/src/components/sparkline/sparkline.d.ts.map +1 -0
- package/dist/src/components/stat-card/index.d.ts +2 -0
- package/dist/src/components/{ai-loader → stat-card}/index.d.ts.map +1 -1
- package/dist/src/components/stat-card/stat-card.d.ts +80 -0
- package/dist/src/components/stat-card/stat-card.d.ts.map +1 -0
- package/dist/src/components/text-roll/index.d.ts +2 -0
- package/dist/src/components/text-roll/index.d.ts.map +1 -0
- package/dist/src/components/text-roll/text-roll.d.ts +49 -0
- package/dist/src/components/text-roll/text-roll.d.ts.map +1 -0
- package/dist/src/components/toast/toast.d.ts.map +1 -1
- package/dist/src/components/use-agent-harness/use-agent-harness.d.ts +2 -2
- package/dist/src/genui/genui.d.ts.map +1 -1
- package/dist/src/index.d.ts +5 -2
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/primitives/index.d.ts +1 -0
- package/dist/src/primitives/index.d.ts.map +1 -1
- package/dist/src/primitives/otp-field.d.ts +13 -0
- package/dist/src/primitives/otp-field.d.ts.map +1 -0
- package/dist/src/registry/index.d.ts +1 -1
- package/dist/src/registry/types.d.ts +1 -1
- package/dist/stat-card-CEZscNh8.js +103 -0
- package/dist/stat-card-CEZscNh8.js.map +1 -0
- package/dist/styles/sf-binding.css +20 -62
- package/dist/styles/sf-standalone.css +2 -2
- package/dist/styles/shadcn.css +120 -0
- package/dist/styles/theme-blue-tint.css +98 -0
- package/dist/styles/theme-fedramp.css +3 -12
- package/dist/styles/theme-minimal.css +26 -104
- package/dist/styles/theme-sf.css +96 -114
- package/dist/{table-CIMx0Oq0.js → table-Rv4JMy0B.js} +2 -2
- package/dist/{table-CIMx0Oq0.js.map → table-Rv4JMy0B.js.map} +1 -1
- package/dist/text-roll-BZ3I1umc.js +79 -0
- package/dist/text-roll-BZ3I1umc.js.map +1 -0
- package/dist/{theme-toggle-Dpgnoj_Q.js → theme-toggle-Bhu681D7.js} +1 -1
- package/dist/{theme-toggle-Dpgnoj_Q.js.map → theme-toggle-Bhu681D7.js.map} +1 -1
- package/dist/{use-agent-harness-DZzcn96L.js → use-agent-harness-BMyF8pTq.js} +5 -5
- package/dist/use-agent-harness-BMyF8pTq.js.map +1 -0
- package/package.json +48 -19
- package/scripts/component-registry/discovery.ts +2 -2
- package/scripts/component-registry/index.ts +1 -1
- package/scripts/component-registry/props-filter.ts +1 -1
- package/scripts/component-registry/utils.ts +5 -5
- package/scripts/component-registry/variant-parser.ts +124 -19
- package/scripts/convert-demos-to-stories.ts +253 -0
- package/scripts/css-build.ts +4 -3
- package/scripts/generate-primitives.ts +11 -3
- package/scripts/theme-generator/config.ts +339 -71
- package/scripts/theme-generator/generate-css.ts +17 -3
- package/scripts/theme-generator/index.ts +3 -3
- package/scripts/theme-generator/migrate.ts +1 -1
- package/dist/ai-loader-Cr3eQkNS.js +0 -134
- package/dist/ai-loader-Cr3eQkNS.js.map +0 -1
- package/dist/ai-prompt-input-Bo1YuJly.js +0 -769
- package/dist/ai-prompt-input-Bo1YuJly.js.map +0 -1
- package/dist/ai-reasoning-UAmNx_LD.js.map +0 -1
- package/dist/ai-response-BWoVsNQG.js.map +0 -1
- package/dist/ai-task-list-B9CpMDYN.js.map +0 -1
- package/dist/ai-timeline-Bb5ntsr3.js.map +0 -1
- package/dist/ai-tool-BGH8nQ_D.js.map +0 -1
- package/dist/chart-Bes4MN3C.js.map +0 -1
- package/dist/checkbox-CPX7lBaU.js.map +0 -1
- package/dist/command-palette-CBTY8EiF.js.map +0 -1
- package/dist/components/ai-loader.js +0 -3
- package/dist/data-grid-UJ9ja5cu.js.map +0 -1
- package/dist/dist-BNlyONdD.js.map +0 -1
- package/dist/filters-BdBogf7D.js.map +0 -1
- package/dist/radio-B7zg1wUI.js.map +0 -1
- package/dist/select-9p721G00.js.map +0 -1
- package/dist/sidebar-DOwBrq57.js.map +0 -1
- package/dist/src/components/ai-loader/ai-loader.d.ts +0 -44
- package/dist/src/components/ai-loader/ai-loader.d.ts.map +0 -1
- package/dist/src/components/ai-loader/index.d.ts +0 -2
- package/dist/styles/theme-navigator.css +0 -137
- package/dist/use-agent-harness-DZzcn96L.js.map +0 -1
|
@@ -35,9 +35,10 @@ export function extractBaseStylesFromFile(filePath: string): string | null {
|
|
|
35
35
|
|
|
36
36
|
// Match: export const SF_*_BASE_STYLES = "..." or '...' or `...`
|
|
37
37
|
// Handles multi-line strings with template literals
|
|
38
|
-
const baseStylesMatch =
|
|
39
|
-
/export\s+const\s+SF_\w+_BASE_STYLES\s*=\s*["'`]([^"'`]+)["'`]
|
|
40
|
-
|
|
38
|
+
const baseStylesMatch =
|
|
39
|
+
/export\s+const\s+SF_\w+_BASE_STYLES\s*=\s*["'`]([^"'`]+)["'`]/.exec(
|
|
40
|
+
content
|
|
41
|
+
);
|
|
41
42
|
|
|
42
43
|
if (baseStylesMatch) {
|
|
43
44
|
return baseStylesMatch[1].trim();
|
|
@@ -102,11 +103,9 @@ export function parseVariantsObject(
|
|
|
102
103
|
if (!variantBlock) continue;
|
|
103
104
|
|
|
104
105
|
// Extract description if present
|
|
105
|
-
const descMatch = variantBlock
|
|
106
|
-
/description\s*:\s*["']([^"']*)["']/
|
|
107
|
-
);
|
|
106
|
+
const descMatch = /description\s*:\s*["']([^"']*)["']/.exec(variantBlock);
|
|
108
107
|
// Extract classes if present (for Figma plugin consumption)
|
|
109
|
-
const classesMatch =
|
|
108
|
+
const classesMatch = /classes\s*:\s*["']([^"']*)["']/.exec(variantBlock);
|
|
110
109
|
|
|
111
110
|
// Extract state classes from the classes string
|
|
112
111
|
const stateClasses = classesMatch
|
|
@@ -160,13 +159,12 @@ export function extractVariantsFromFile(
|
|
|
160
159
|
const content = readFileSync(filePath, "utf-8");
|
|
161
160
|
|
|
162
161
|
// Find SF_*_VARIANTS export start position
|
|
163
|
-
const variantsStartMatch =
|
|
164
|
-
|
|
162
|
+
const variantsStartMatch = /export\s+const\s+SF_\w+_VARIANTS\s*=\s*/.exec(
|
|
163
|
+
content
|
|
165
164
|
);
|
|
166
165
|
// Find SF_*_DEFAULT_VARIANTS export start position
|
|
167
|
-
const defaultsStartMatch =
|
|
168
|
-
/export\s+const\s+SF_\w+_DEFAULT_VARIANTS\s*=\s
|
|
169
|
-
);
|
|
166
|
+
const defaultsStartMatch =
|
|
167
|
+
/export\s+const\s+SF_\w+_DEFAULT_VARIANTS\s*=\s*/.exec(content);
|
|
170
168
|
|
|
171
169
|
if (!variantsStartMatch || !defaultsStartMatch) {
|
|
172
170
|
return null;
|
|
@@ -207,23 +205,130 @@ export function extractVariantsFromFile(
|
|
|
207
205
|
/**
|
|
208
206
|
* Parse a styling object string into a ComponentStyling object.
|
|
209
207
|
* Handles nested objects like container, title, description, closeButton, etc.
|
|
208
|
+
*
|
|
209
|
+
* Uses regex-based parsing instead of eval/new Function for security.
|
|
210
|
+
* Prevents RCE if file contents are compromised.
|
|
210
211
|
*/
|
|
211
212
|
function parseStylingObject(objStr: string): ComponentStyling | null {
|
|
212
213
|
try {
|
|
213
214
|
// Remove 'as const' suffix if present
|
|
214
215
|
const cleanedStr = objStr.replace(/\s*as\s+const\s*$/, "");
|
|
215
216
|
|
|
216
|
-
//
|
|
217
|
-
// This
|
|
218
|
-
|
|
219
|
-
const parsed = new Function(`return ${cleanedStr}`)();
|
|
217
|
+
// Security: Parse as JSON-like structure instead of executing code
|
|
218
|
+
// This prevents RCE if a source file is compromised
|
|
219
|
+
const result = parseObjectLiteralSafely(cleanedStr);
|
|
220
220
|
|
|
221
|
-
return
|
|
221
|
+
return result as ComponentStyling;
|
|
222
222
|
} catch {
|
|
223
223
|
return null;
|
|
224
224
|
}
|
|
225
225
|
}
|
|
226
226
|
|
|
227
|
+
/**
|
|
228
|
+
* Safely parse a JavaScript object literal without using eval/Function.
|
|
229
|
+
* Handles nested objects and string values.
|
|
230
|
+
*/
|
|
231
|
+
function parseObjectLiteralSafely(
|
|
232
|
+
objStr: string
|
|
233
|
+
): Record<string, unknown> | null {
|
|
234
|
+
const result: Record<string, unknown> = {};
|
|
235
|
+
|
|
236
|
+
// Remove outer braces
|
|
237
|
+
const content = objStr.trim().replace(/^\{/, "").replace(/\}$/, "").trim();
|
|
238
|
+
if (!content) return {};
|
|
239
|
+
|
|
240
|
+
// Split by top-level commas (not inside nested braces)
|
|
241
|
+
const properties = splitTopLevelProperties(content);
|
|
242
|
+
|
|
243
|
+
for (const prop of properties) {
|
|
244
|
+
const match = /^\s*(\w+)\s*:\s*(.+)$/s.exec(prop);
|
|
245
|
+
if (!match) continue;
|
|
246
|
+
|
|
247
|
+
const key = match[1];
|
|
248
|
+
const valueStr = match[2].trim();
|
|
249
|
+
|
|
250
|
+
// Parse the value
|
|
251
|
+
result[key] = parseValue(valueStr);
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
return result;
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
/**
|
|
258
|
+
* Split object properties by commas, respecting nested braces.
|
|
259
|
+
*/
|
|
260
|
+
function splitTopLevelProperties(content: string): string[] {
|
|
261
|
+
const properties: string[] = [];
|
|
262
|
+
let depth = 0;
|
|
263
|
+
let current = "";
|
|
264
|
+
|
|
265
|
+
for (const char of content) {
|
|
266
|
+
if (char === "{") {
|
|
267
|
+
depth++;
|
|
268
|
+
current += char;
|
|
269
|
+
} else if (char === "}") {
|
|
270
|
+
depth--;
|
|
271
|
+
current += char;
|
|
272
|
+
} else if (char === "," && depth === 0) {
|
|
273
|
+
if (current.trim()) {
|
|
274
|
+
properties.push(current.trim());
|
|
275
|
+
}
|
|
276
|
+
current = "";
|
|
277
|
+
} else {
|
|
278
|
+
current += char;
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
if (current.trim()) {
|
|
283
|
+
properties.push(current.trim());
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
return properties;
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
/**
|
|
290
|
+
* Parse a value string into its JavaScript representation.
|
|
291
|
+
*/
|
|
292
|
+
function parseValue(valueStr: string): unknown {
|
|
293
|
+
valueStr = valueStr.trim();
|
|
294
|
+
|
|
295
|
+
// Handle nested objects
|
|
296
|
+
if (valueStr.startsWith("{")) {
|
|
297
|
+
return parseObjectLiteralSafely(valueStr);
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
// Handle arrays
|
|
301
|
+
if (valueStr.startsWith("[")) {
|
|
302
|
+
try {
|
|
303
|
+
// Arrays are typically simple in styling configs
|
|
304
|
+
return JSON.parse(valueStr.replace(/'/g, '"'));
|
|
305
|
+
} catch {
|
|
306
|
+
return null;
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
// Handle strings (single or double quotes)
|
|
311
|
+
const stringMatch = /^["'](.+)["']$/s.exec(valueStr);
|
|
312
|
+
if (stringMatch) {
|
|
313
|
+
return stringMatch[1];
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
// Handle numbers
|
|
317
|
+
if (/^-?\d+(\.\d+)?$/.test(valueStr)) {
|
|
318
|
+
return Number(valueStr);
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
// Handle booleans
|
|
322
|
+
if (valueStr === "true") return true;
|
|
323
|
+
if (valueStr === "false") return false;
|
|
324
|
+
|
|
325
|
+
// Handle null/undefined
|
|
326
|
+
if (valueStr === "null") return null;
|
|
327
|
+
if (valueStr === "undefined") return undefined;
|
|
328
|
+
|
|
329
|
+
return valueStr;
|
|
330
|
+
}
|
|
331
|
+
|
|
227
332
|
/**
|
|
228
333
|
* Extract SF_*_STYLING from a component file.
|
|
229
334
|
* Returns the styling object or null if not found.
|
|
@@ -238,8 +343,8 @@ export function extractStylingFromFile(
|
|
|
238
343
|
const content = readFileSync(filePath, "utf-8");
|
|
239
344
|
|
|
240
345
|
// Find SF_*_STYLING export start position
|
|
241
|
-
const stylingStartMatch =
|
|
242
|
-
|
|
346
|
+
const stylingStartMatch = /export\s+const\s+SF_\w+_STYLING\s*=\s*/.exec(
|
|
347
|
+
content
|
|
243
348
|
);
|
|
244
349
|
|
|
245
350
|
if (!stylingStartMatch) {
|
|
@@ -0,0 +1,253 @@
|
|
|
1
|
+
#!/usr/bin/env bun
|
|
2
|
+
/**
|
|
3
|
+
* One-shot script: Generate Storybook story files from docs demos.
|
|
4
|
+
*
|
|
5
|
+
* Reads `packages/docs/src/components/demos/{Name}Demo.tsx`, extracts all
|
|
6
|
+
* exported functions, and writes `.stories.tsx` files that re-use the
|
|
7
|
+
* demo components as individual story renders.
|
|
8
|
+
*
|
|
9
|
+
* Stories are dev-only files (excluded from the library build), so
|
|
10
|
+
* cross-package imports into `packages/docs/...` are acceptable here.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
import fs from "node:fs";
|
|
14
|
+
import path from "node:path";
|
|
15
|
+
|
|
16
|
+
const REGISTRY_ROOT = path.resolve(import.meta.dir, "..");
|
|
17
|
+
const DOCS_DEMOS_DIR = path.resolve(
|
|
18
|
+
REGISTRY_ROOT,
|
|
19
|
+
"../docs/src/components/demos"
|
|
20
|
+
);
|
|
21
|
+
|
|
22
|
+
type Entry = {
|
|
23
|
+
kind: "component" | "block";
|
|
24
|
+
dirName: string; // kebab-case
|
|
25
|
+
pascalName: string;
|
|
26
|
+
demoFile: string; // path to demo file
|
|
27
|
+
storyFile: string; // path where story should be written
|
|
28
|
+
title: string; // storybook title
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
function toPascalCase(kebab: string): string {
|
|
32
|
+
return kebab
|
|
33
|
+
.split("-")
|
|
34
|
+
.map((p) => {
|
|
35
|
+
// Special cases for AI and common acronyms
|
|
36
|
+
if (p === "ai") return "Ai";
|
|
37
|
+
return p.charAt(0).toUpperCase() + p.slice(1);
|
|
38
|
+
})
|
|
39
|
+
.join("");
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
// Some demo files have non-standard names; map them manually
|
|
43
|
+
const SPECIAL_DEMO_NAMES: Record<string, string> = {
|
|
44
|
+
"signalflare-ai-logo": "SignalFlareAILogoDemo.tsx",
|
|
45
|
+
chart: "chart-demo.tsx",
|
|
46
|
+
menubar: "MenuBarDemo.tsx",
|
|
47
|
+
loader: "LoaderDemo.tsx", // also has SkeletonLineDemo
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
function getDemoFilename(kebabName: string): string {
|
|
51
|
+
if (SPECIAL_DEMO_NAMES[kebabName]) return SPECIAL_DEMO_NAMES[kebabName];
|
|
52
|
+
return `${toPascalCase(kebabName)}Demo.tsx`;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
function collectEntries(): Entry[] {
|
|
56
|
+
const entries: Entry[] = [];
|
|
57
|
+
|
|
58
|
+
// Components
|
|
59
|
+
const componentsDir = path.join(REGISTRY_ROOT, "src/components");
|
|
60
|
+
for (const dirName of fs.readdirSync(componentsDir)) {
|
|
61
|
+
const compDir = path.join(componentsDir, dirName);
|
|
62
|
+
if (!fs.statSync(compDir).isDirectory()) continue;
|
|
63
|
+
|
|
64
|
+
const storyPath = path.join(compDir, `${dirName}.stories.tsx`);
|
|
65
|
+
if (fs.existsSync(storyPath)) continue; // Skip existing
|
|
66
|
+
|
|
67
|
+
const demoFilename = getDemoFilename(dirName);
|
|
68
|
+
const demoPath = path.join(DOCS_DEMOS_DIR, demoFilename);
|
|
69
|
+
if (!fs.existsSync(demoPath)) continue; // Skip if no demo
|
|
70
|
+
|
|
71
|
+
entries.push({
|
|
72
|
+
kind: "component",
|
|
73
|
+
dirName,
|
|
74
|
+
pascalName: toPascalCase(dirName),
|
|
75
|
+
demoFile: demoPath,
|
|
76
|
+
storyFile: storyPath,
|
|
77
|
+
title: `Components/${toPascalCase(dirName)}`,
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
// Blocks
|
|
82
|
+
const blocksDir = path.join(REGISTRY_ROOT, "src/blocks");
|
|
83
|
+
if (fs.existsSync(blocksDir)) {
|
|
84
|
+
for (const dirName of fs.readdirSync(blocksDir)) {
|
|
85
|
+
const blockDir = path.join(blocksDir, dirName);
|
|
86
|
+
if (!fs.statSync(blockDir).isDirectory()) continue;
|
|
87
|
+
|
|
88
|
+
const storyPath = path.join(blockDir, `${dirName}.stories.tsx`);
|
|
89
|
+
if (fs.existsSync(storyPath)) continue;
|
|
90
|
+
|
|
91
|
+
const demoFilename = getDemoFilename(dirName);
|
|
92
|
+
const demoPath = path.join(DOCS_DEMOS_DIR, demoFilename);
|
|
93
|
+
if (!fs.existsSync(demoPath)) continue;
|
|
94
|
+
|
|
95
|
+
entries.push({
|
|
96
|
+
kind: "block",
|
|
97
|
+
dirName,
|
|
98
|
+
pascalName: toPascalCase(dirName),
|
|
99
|
+
demoFile: demoPath,
|
|
100
|
+
storyFile: storyPath,
|
|
101
|
+
title: `Blocks/${toPascalCase(dirName)}`,
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
return entries;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* Extract exported function names from a demo source file.
|
|
111
|
+
* Matches: `export function Foo(` and `export const Foo = (...) =>`
|
|
112
|
+
*/
|
|
113
|
+
function extractExportedDemoFunctions(source: string): string[] {
|
|
114
|
+
// Strip template literal contents so we don't match `export function`
|
|
115
|
+
// inside code strings.
|
|
116
|
+
const cleaned = source.replace(/`(?:\\.|[^`\\])*`/g, "``");
|
|
117
|
+
|
|
118
|
+
const names = new Set<string>();
|
|
119
|
+
|
|
120
|
+
// Only match at start of a line (after optional whitespace) to avoid
|
|
121
|
+
// matching inside expressions/strings.
|
|
122
|
+
const fnRegex = /^\s*export\s+function\s+([A-Z][A-Za-z0-9_]*)\s*\(/gm;
|
|
123
|
+
let m: RegExpExecArray | null = fnRegex.exec(cleaned);
|
|
124
|
+
while (m) {
|
|
125
|
+
names.add(m[1]);
|
|
126
|
+
m = fnRegex.exec(cleaned);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
const constRegex =
|
|
130
|
+
/^\s*export\s+const\s+([A-Z][A-Za-z0-9_]*)\s*(?::\s*[^=]+)?=\s*(?:\([^)]*\)\s*=>|function)/gm;
|
|
131
|
+
m = constRegex.exec(cleaned);
|
|
132
|
+
while (m) {
|
|
133
|
+
names.add(m[1]);
|
|
134
|
+
m = constRegex.exec(cleaned);
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
return Array.from(names);
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* Strip trailing "Demo" from a demo function name to get a cleaner Story name.
|
|
142
|
+
* e.g., "BannerVariantsDemo" → "Variants", "BannerDefaultDemo" → "Default"
|
|
143
|
+
* Falls back to the original name if stripping doesn't yield something useful.
|
|
144
|
+
*/
|
|
145
|
+
function deriveStoryName(demoFnName: string, componentPascal: string): string {
|
|
146
|
+
let s = demoFnName;
|
|
147
|
+
// Strip "Demo" suffix
|
|
148
|
+
if (s.endsWith("Demo")) s = s.slice(0, -4);
|
|
149
|
+
// Strip component prefix
|
|
150
|
+
if (s.startsWith(componentPascal) && s.length > componentPascal.length) {
|
|
151
|
+
s = s.slice(componentPascal.length);
|
|
152
|
+
}
|
|
153
|
+
// If empty, use "Default"
|
|
154
|
+
if (!s) s = "Default";
|
|
155
|
+
return s;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
function demoImportPath(entry: Entry): string {
|
|
159
|
+
// From src/components/{name}/ or src/blocks/{name}/ to docs demos
|
|
160
|
+
const depth = entry.kind === "component" ? 4 : 4;
|
|
161
|
+
const up = "../".repeat(depth);
|
|
162
|
+
const relFromRegistry = path.relative(
|
|
163
|
+
REGISTRY_ROOT,
|
|
164
|
+
entry.demoFile.replace(/\.tsx$/, "")
|
|
165
|
+
);
|
|
166
|
+
return `${up}docs/${relFromRegistry.replace("../", "")}`;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
function buildDemoImportPath(entry: Entry): string {
|
|
170
|
+
// Story lives at packages/registry/src/{components|blocks}/{name}/{name}.stories.tsx
|
|
171
|
+
// Demo lives at packages/docs/src/components/demos/{Name}Demo.tsx
|
|
172
|
+
// Relative path: ../../../../docs/src/components/demos/{Name}Demo
|
|
173
|
+
const demoBase = path.basename(entry.demoFile).replace(/\.tsx$/, "");
|
|
174
|
+
return `../../../../docs/src/components/demos/${demoBase}`;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
function generateStoryFile(entry: Entry): string | null {
|
|
178
|
+
const source = fs.readFileSync(entry.demoFile, "utf8");
|
|
179
|
+
const demoFns = extractExportedDemoFunctions(source);
|
|
180
|
+
if (demoFns.length === 0) return null;
|
|
181
|
+
|
|
182
|
+
const importPath = buildDemoImportPath(entry);
|
|
183
|
+
|
|
184
|
+
const storyNames = new Set<string>();
|
|
185
|
+
const storyExports = demoFns.map((fn) => {
|
|
186
|
+
let storyName = deriveStoryName(fn, entry.pascalName);
|
|
187
|
+
// Ensure uniqueness within this file
|
|
188
|
+
let i = 2;
|
|
189
|
+
const base = storyName;
|
|
190
|
+
while (storyNames.has(storyName)) {
|
|
191
|
+
storyName = `${base}${i}`;
|
|
192
|
+
i++;
|
|
193
|
+
}
|
|
194
|
+
storyNames.add(storyName);
|
|
195
|
+
// Alias the imported demo to avoid colliding with the story name
|
|
196
|
+
const aliased = `Demo_${fn}`;
|
|
197
|
+
return {
|
|
198
|
+
exportLine: `export const ${storyName}: Story = {
|
|
199
|
+
render: () => <${aliased} />,
|
|
200
|
+
};`,
|
|
201
|
+
importEntry: `${fn} as ${aliased}`,
|
|
202
|
+
};
|
|
203
|
+
});
|
|
204
|
+
|
|
205
|
+
const importsList = storyExports.map((s) => s.importEntry).join(",\n ");
|
|
206
|
+
|
|
207
|
+
return `import type { Meta, StoryObj } from "@storybook/react";
|
|
208
|
+
|
|
209
|
+
import {
|
|
210
|
+
${importsList},
|
|
211
|
+
} from "${importPath}";
|
|
212
|
+
|
|
213
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
214
|
+
const meta: Meta<any> = {
|
|
215
|
+
title: "${entry.title}",
|
|
216
|
+
parameters: {
|
|
217
|
+
layout: "padded",
|
|
218
|
+
},
|
|
219
|
+
};
|
|
220
|
+
|
|
221
|
+
export default meta;
|
|
222
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
223
|
+
type Story = StoryObj<any>;
|
|
224
|
+
|
|
225
|
+
${storyExports.map((s) => s.exportLine).join("\n\n")}
|
|
226
|
+
`;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
function main() {
|
|
230
|
+
const entries = collectEntries();
|
|
231
|
+
console.log(`Found ${entries.length} entries to process:`);
|
|
232
|
+
for (const e of entries) {
|
|
233
|
+
console.log(` [${e.kind}] ${e.dirName} ← ${path.basename(e.demoFile)}`);
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
let written = 0;
|
|
237
|
+
let skipped = 0;
|
|
238
|
+
for (const entry of entries) {
|
|
239
|
+
const content = generateStoryFile(entry);
|
|
240
|
+
if (!content) {
|
|
241
|
+
console.log(` ⚠ Skipped ${entry.dirName} (no exported demo functions)`);
|
|
242
|
+
skipped++;
|
|
243
|
+
continue;
|
|
244
|
+
}
|
|
245
|
+
fs.writeFileSync(entry.storyFile, content, "utf8");
|
|
246
|
+
console.log(` ✓ Wrote ${path.relative(REGISTRY_ROOT, entry.storyFile)}`);
|
|
247
|
+
written++;
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
console.log(`\nDone. Wrote ${written} story files, skipped ${skipped}.`);
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
main();
|
package/scripts/css-build.ts
CHANGED
|
@@ -9,8 +9,8 @@ import {
|
|
|
9
9
|
import { join, dirname } from "node:path";
|
|
10
10
|
import { fileURLToPath } from "node:url";
|
|
11
11
|
|
|
12
|
-
const __filename =
|
|
13
|
-
const __dirname = dirname
|
|
12
|
+
const __filename = import.meta.filename;
|
|
13
|
+
const __dirname = import.meta.dirname;
|
|
14
14
|
|
|
15
15
|
const srcDir = join(__dirname, "../src/styles");
|
|
16
16
|
const distDir = join(__dirname, "../dist/styles");
|
|
@@ -29,7 +29,8 @@ const cssFiles: string[] = [
|
|
|
29
29
|
"theme-sf.css",
|
|
30
30
|
"theme-fedramp.css",
|
|
31
31
|
"theme-minimal.css",
|
|
32
|
-
"theme-
|
|
32
|
+
"theme-blue-tint.css",
|
|
33
|
+
"shadcn.css",
|
|
33
34
|
];
|
|
34
35
|
|
|
35
36
|
cssFiles.forEach((file) => {
|
|
@@ -11,8 +11,8 @@ import { readFileSync, writeFileSync, mkdirSync, existsSync } from "node:fs";
|
|
|
11
11
|
import { join, dirname } from "node:path";
|
|
12
12
|
import { fileURLToPath } from "node:url";
|
|
13
13
|
|
|
14
|
-
const __filename =
|
|
15
|
-
const __dirname = dirname
|
|
14
|
+
const __filename = import.meta.filename;
|
|
15
|
+
const __dirname = import.meta.dirname;
|
|
16
16
|
|
|
17
17
|
const PRIMITIVES_DIR = join(__dirname, "../src/primitives");
|
|
18
18
|
const PRIMITIVES_FILE = join(PRIMITIVES_DIR, "index.ts");
|
|
@@ -33,6 +33,14 @@ const EXCLUDED_EXPORTS = new Set([
|
|
|
33
33
|
"./use-render", // Internal hook
|
|
34
34
|
]);
|
|
35
35
|
|
|
36
|
+
// Prefixes to exclude (e.g. "./internals/*" are implementation details)
|
|
37
|
+
const EXCLUDED_PREFIXES = ["./internals/"];
|
|
38
|
+
|
|
39
|
+
function isExcluded(subpath: string): boolean {
|
|
40
|
+
if (EXCLUDED_EXPORTS.has(subpath)) return true;
|
|
41
|
+
return EXCLUDED_PREFIXES.some((prefix) => subpath.startsWith(prefix));
|
|
42
|
+
}
|
|
43
|
+
|
|
36
44
|
function main() {
|
|
37
45
|
// Read base-ui package.json
|
|
38
46
|
if (!existsSync(BASE_UI_PACKAGE)) {
|
|
@@ -45,7 +53,7 @@ function main() {
|
|
|
45
53
|
|
|
46
54
|
// Extract and sort component subpaths alphabetically
|
|
47
55
|
const subpaths = Object.keys(exports)
|
|
48
|
-
.filter((key) => key.startsWith("./") && !
|
|
56
|
+
.filter((key) => key.startsWith("./") && !isExcluded(key))
|
|
49
57
|
.sort();
|
|
50
58
|
|
|
51
59
|
// Ensure directory exists
|