@signalflare-ai/ui 1.1.0 → 1.3.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 +102 -5
- package/README.md +1 -1
- package/ai/component-registry.json +531 -79
- package/ai/component-registry.md +4067 -6
- package/ai/schemas.ts +6 -1
- package/dist/.build-complete +1 -1
- package/dist/ai/schemas.d.ts +76 -58
- package/dist/ai/schemas.d.ts.map +1 -1
- package/dist/{ai-actions-DSVeQn4e.js → ai-actions-CBfz5XEf.js} +4 -4
- package/dist/{ai-actions-DSVeQn4e.js.map → ai-actions-CBfz5XEf.js.map} +1 -1
- package/dist/{ai-agent-card-BXHwhWAU.js → ai-agent-card-CByAUe0q.js} +3 -3
- package/dist/ai-agent-card-CByAUe0q.js.map +1 -0
- package/dist/{ai-approval-aa0qvjFN.js → ai-approval-Ci8N70a7.js} +4 -3
- package/dist/{ai-approval-aa0qvjFN.js.map → ai-approval-Ci8N70a7.js.map} +1 -1
- package/dist/{ai-code-block-BgtIxtZZ.js → ai-code-block-P9TJHvaC.js} +37 -39
- package/dist/ai-code-block-P9TJHvaC.js.map +1 -0
- package/dist/ai-conversation-Qslfdi1t.js +228 -0
- package/dist/ai-conversation-Qslfdi1t.js.map +1 -0
- package/dist/{ai-info-banner-uFxHHwBA.js → ai-info-banner-B_9vtGK3.js} +8 -4
- package/dist/ai-info-banner-B_9vtGK3.js.map +1 -0
- package/dist/{ai-message-BjnFznXy.js → ai-message-Ci3gwM7G.js} +29 -10
- package/dist/ai-message-Ci3gwM7G.js.map +1 -0
- package/dist/{ai-mission-header-08__gULL.js → ai-mission-header-CaBc19-t.js} +2 -2
- package/dist/{ai-mission-header-08__gULL.js.map → ai-mission-header-CaBc19-t.js.map} +1 -1
- package/dist/{ai-part-group-DBtgTgAn.js → ai-part-group-Dx1Mr92B.js} +5 -4
- package/dist/ai-part-group-Dx1Mr92B.js.map +1 -0
- package/dist/{ai-prompt-input-CuluUzpf.js → ai-prompt-input-Bm4XoSj2.js} +44 -55
- package/dist/ai-prompt-input-Bm4XoSj2.js.map +1 -0
- package/dist/{ai-question-CHHoDJMg.js → ai-question-OyJovxGe.js} +4 -3
- package/dist/{ai-question-CHHoDJMg.js.map → ai-question-OyJovxGe.js.map} +1 -1
- package/dist/{ai-reasoning-CnL6ZSr5.js → ai-reasoning-BLfBXx3F.js} +9 -5
- package/dist/ai-reasoning-BLfBXx3F.js.map +1 -0
- package/dist/{ai-response-BEUg3xvd.js → ai-response-hbVCZJmo.js} +9 -4
- package/dist/ai-response-hbVCZJmo.js.map +1 -0
- package/dist/{ai-shimmer-By5_L05p.js → ai-shimmer-BamNMNK3.js} +2 -2
- package/dist/{ai-shimmer-By5_L05p.js.map → ai-shimmer-BamNMNK3.js.map} +1 -1
- package/dist/{ai-status-badge-BGYGWYF6.js → ai-status-badge-BZLczdkI.js} +2 -2
- package/dist/{ai-status-badge-BGYGWYF6.js.map → ai-status-badge-BZLczdkI.js.map} +1 -1
- package/dist/{ai-streaming-text-CMfoThV0.js → ai-streaming-text-DgYu64UH.js} +44 -16
- package/dist/ai-streaming-text-DgYu64UH.js.map +1 -0
- package/dist/{ai-subagent-DcPRqkAA.js → ai-subagent-p97AI1h9.js} +14 -6
- package/dist/ai-subagent-p97AI1h9.js.map +1 -0
- package/dist/{ai-suggestion-MgeCg5Ar.js → ai-suggestion-Bj6vF7CT.js} +3 -3
- package/dist/{ai-suggestion-MgeCg5Ar.js.map → ai-suggestion-Bj6vF7CT.js.map} +1 -1
- package/dist/{ai-task-list-Da9zIm00.js → ai-task-list-C_UQYpk9.js} +15 -6
- package/dist/ai-task-list-C_UQYpk9.js.map +1 -0
- package/dist/{ai-timeline-Cwu045IR.js → ai-timeline-CePL1LOU.js} +3 -3
- package/dist/ai-timeline-CePL1LOU.js.map +1 -0
- package/dist/{ai-tool-Cn1O4xjP.js → ai-tool-CfRcwmHT.js} +35 -16
- package/dist/ai-tool-CfRcwmHT.js.map +1 -0
- package/dist/{ai-usage-bar-DjS12DMp.js → ai-usage-bar-45pVRCGA.js} +2 -2
- package/dist/{ai-usage-bar-DjS12DMp.js.map → ai-usage-bar-45pVRCGA.js.map} +1 -1
- package/dist/{badge-D_eaA6wv.js → badge-Beb-6uut.js} +5 -5
- package/dist/{badge-D_eaA6wv.js.map → badge-Beb-6uut.js.map} +1 -1
- package/dist/{banner-B_6oBrsu.js → banner-CCEksxPg.js} +8 -3
- package/dist/banner-CCEksxPg.js.map +1 -0
- package/dist/{breadcrumbs-BlmeYfgq.js → breadcrumbs-HiTmgaZ4.js} +5 -5
- package/dist/{breadcrumbs-BlmeYfgq.js.map → breadcrumbs-HiTmgaZ4.js.map} +1 -1
- package/dist/{button-De0267YU.js → button-BHOgXJRU.js} +4 -4
- package/dist/{button-De0267YU.js.map → button-BHOgXJRU.js.map} +1 -1
- package/dist/catalog.js +1 -1
- package/dist/catalog.js.map +1 -1
- package/dist/{chart-BK3sVPnD.js → chart-B9FfZdKs.js} +7 -7
- package/dist/chart-B9FfZdKs.js.map +1 -0
- package/dist/{checkbox-DYhUmZNw.js → checkbox-Cy_OCyay.js} +3 -3
- package/dist/{checkbox-DYhUmZNw.js.map → checkbox-Cy_OCyay.js.map} +1 -1
- package/dist/{clipboard-text-ssybngLw.js → clipboard-text-CKSvNp9L.js} +6 -5
- package/dist/clipboard-text-CKSvNp9L.js.map +1 -0
- package/dist/{cn-YROP2_ox.js → cn-CmAOpn49.js} +2 -2
- package/dist/{cn-YROP2_ox.js.map → cn-CmAOpn49.js.map} +1 -1
- package/dist/{code-Cx-QSoOT.js → code-JsQz-0G_.js} +4 -4
- package/dist/{code-Cx-QSoOT.js.map → code-JsQz-0G_.js.map} +1 -1
- package/dist/{collapsible-DWsXeXmS.js → collapsible-1kOZ-89L.js} +2 -2
- package/dist/{collapsible-DWsXeXmS.js.map → collapsible-1kOZ-89L.js.map} +1 -1
- package/dist/{combobox-C0iW6a0r.js → combobox-CQwDmqgA.js} +4 -4
- package/dist/{combobox-C0iW6a0r.js.map → combobox-CQwDmqgA.js.map} +1 -1
- package/dist/command-line/cli.js +3 -3
- package/dist/{command-palette-DGzioeki.js → command-palette-Bkuv3e6o.js} +20 -5
- package/dist/command-palette-Bkuv3e6o.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 +2 -2
- 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 +1 -1
- package/dist/components/ai-prompt-input.js +1 -1
- 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 +2 -2
- 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/badge.js +1 -1
- package/dist/components/banner.js +1 -1
- package/dist/components/breadcrumbs.js +1 -1
- package/dist/components/button.js +1 -1
- package/dist/components/chart.js +2 -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/collapsible.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/date-range-picker.js +1 -1
- package/dist/components/dialog.js +1 -1
- package/dist/components/dropdown.js +1 -1
- package/dist/components/empty.js +1 -1
- package/dist/components/field.js +1 -1
- package/dist/components/filters.js +1 -1
- package/dist/components/flow.js +1 -1
- package/dist/components/grid.js +1 -1
- package/dist/components/input.js +2 -2
- package/dist/components/label.js +1 -1
- package/dist/components/layer-card.js +1 -1
- package/dist/components/link.js +3 -3
- package/dist/components/link.js.map +1 -1
- package/dist/components/loader.js +2 -2
- package/dist/components/menubar.js +1 -1
- package/dist/components/meter.js +1 -1
- package/dist/components/pagination.js +1 -1
- package/dist/components/popover.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/signalflare-ai-logo.js +1 -1
- package/dist/components/sparkline.js +1 -1
- package/dist/components/stat-card.js +1 -1
- package/dist/components/surface.js +1 -1
- package/dist/components/switch.js +1 -1
- package/dist/components/table.js +1 -1
- package/dist/components/tabs.js +1 -1
- package/dist/components/text-roll.js +1 -1
- package/dist/components/text.js +1 -1
- package/dist/components/theme-toggle.js +1 -1
- package/dist/components/toast.js +1 -1
- package/dist/components/tooltip.js +1 -1
- package/dist/components/use-agent-harness.js +1 -1
- package/dist/{data-grid-CG76N_hK.js → data-grid-DDSFMHud.js} +136 -53
- package/dist/data-grid-DDSFMHud.js.map +1 -0
- package/dist/{date-picker-Dqg9L4xu.js → date-picker-O34AqG3f.js} +2 -2
- package/dist/{date-picker-Dqg9L4xu.js.map → date-picker-O34AqG3f.js.map} +1 -1
- package/dist/{date-range-picker-D75LLINc.js → date-range-picker-YKYvum_r.js} +29 -39
- package/dist/{date-range-picker-D75LLINc.js.map → date-range-picker-YKYvum_r.js.map} +1 -1
- package/dist/{dialog-CyHEQXEY.js → dialog-DYqu4aDO.js} +3 -3
- package/dist/{dialog-CyHEQXEY.js.map → dialog-DYqu4aDO.js.map} +1 -1
- package/dist/{dist-1-gcEL2L.js → dist-6AtBsaJE.js} +153 -47
- package/dist/dist-6AtBsaJE.js.map +1 -0
- package/dist/{dropdown-qnEYRFXZ.js → dropdown-XzbnRLYR.js} +15 -5
- package/dist/dropdown-XzbnRLYR.js.map +1 -0
- package/dist/{echart-DURZEyai.js → echart-DGBIVAv1.js} +23 -57
- package/dist/{echart-DURZEyai.js.map → echart-DGBIVAv1.js.map} +1 -1
- package/dist/{empty-D2TypIId.js → empty-C1tAkawe.js} +12 -7
- package/dist/empty-C1tAkawe.js.map +1 -0
- package/dist/{field-Y_UK1_Cg.js → field-DBpFzzBS.js} +3 -3
- package/dist/{field-Y_UK1_Cg.js.map → field-DBpFzzBS.js.map} +1 -1
- package/dist/{filters-Bw_U6ZTx.js → filters-SmEl93za.js} +10 -10
- package/dist/filters-SmEl93za.js.map +1 -0
- package/dist/{flow-BRsYUCJa.js → flow-BLzgbq1T.js} +6 -6
- package/dist/flow-BLzgbq1T.js.map +1 -0
- package/dist/genui.js +2 -2
- package/dist/genui.js.map +1 -1
- package/dist/{grid-qUAN9hFx.js → grid-CifjQL-5.js} +2 -2
- package/dist/{grid-qUAN9hFx.js.map → grid-CifjQL-5.js.map} +1 -1
- package/dist/{highlight-to-react-ClEfL81q.js → highlight-to-react-DN9dUCS2.js} +9 -15
- package/dist/highlight-to-react-DN9dUCS2.js.map +1 -0
- package/dist/index.js +72 -72
- package/dist/index.js.map +1 -1
- package/dist/{input-DddtBN-g.js → input-COmx2M_R.js} +5 -5
- package/dist/{input-DddtBN-g.js.map → input-COmx2M_R.js.map} +1 -1
- package/dist/{input-DXYUjGgD.js → input-GkfMQZC_.js} +3 -3
- package/dist/{input-DXYUjGgD.js.map → input-GkfMQZC_.js.map} +1 -1
- package/dist/{label-QtJxtJ4u.js → label-CiGZ464N.js} +3 -3
- package/dist/{label-QtJxtJ4u.js.map → label-CiGZ464N.js.map} +1 -1
- package/dist/{layer-card-BME0eljh.js → layer-card-8l8GuLQr.js} +2 -2
- package/dist/{layer-card-BME0eljh.js.map → layer-card-8l8GuLQr.js.map} +1 -1
- package/dist/layout-CWBE0qwx.js +6207 -0
- package/dist/layout-CWBE0qwx.js.map +1 -0
- package/dist/{link-provider-BUZKXaNE.js → link-provider-BSn8YJon.js} +2 -2
- package/dist/link-provider-BSn8YJon.js.map +1 -0
- package/dist/{loader-DAcc-Uag.js → loader-BEMz8pJO.js} +1 -1
- package/dist/{loader-DAcc-Uag.js.map → loader-BEMz8pJO.js.map} +1 -1
- package/dist/measured-text-CXkdw9Yr.js +305 -0
- package/dist/measured-text-CXkdw9Yr.js.map +1 -0
- package/dist/{menubar-C8NzAjfd.js → menubar-CoOr4ocj.js} +3 -3
- package/dist/{menubar-C8NzAjfd.js.map → menubar-CoOr4ocj.js.map} +1 -1
- package/dist/{meter-CpmTenEr.js → meter-Pf_VOl59.js} +2 -2
- package/dist/{meter-CpmTenEr.js.map → meter-Pf_VOl59.js.map} +1 -1
- package/dist/{pagination-BVqdlONY.js → pagination-DSY279Ta.js} +2 -2
- package/dist/{pagination-BVqdlONY.js.map → pagination-DSY279Ta.js.map} +1 -1
- package/dist/{popover-BRQZ2b6z.js → popover-BY-e9co1.js} +2 -2
- package/dist/{popover-BRQZ2b6z.js.map → popover-BY-e9co1.js.map} +1 -1
- package/dist/{radio-BNSwOt3B.js → radio-DZwL13j0.js} +2 -2
- package/dist/{radio-BNSwOt3B.js.map → radio-DZwL13j0.js.map} +1 -1
- package/dist/{select-1w2aebGQ.js → select-BFifYqHA.js} +6 -6
- package/dist/{select-1w2aebGQ.js.map → select-BFifYqHA.js.map} +1 -1
- package/dist/{sensitive-input-82Cez3vj.js → sensitive-input-DHLZcM73.js} +4 -4
- package/dist/{sensitive-input-82Cez3vj.js.map → sensitive-input-DHLZcM73.js.map} +1 -1
- package/dist/{sidebar-CAsCmSpM.js → sidebar-odGsdvG4.js} +6 -7
- package/dist/sidebar-odGsdvG4.js.map +1 -0
- package/dist/{signalflare-ai-logo-DDhxMJD6.js → signalflare-ai-logo-CNaDT_w8.js} +2 -2
- package/dist/{signalflare-ai-logo-DDhxMJD6.js.map → signalflare-ai-logo-CNaDT_w8.js.map} +1 -1
- package/dist/{skeleton-line-Do3UmGk9.js → skeleton-line-CxxYVTO2.js} +2 -2
- package/dist/{skeleton-line-Do3UmGk9.js.map → skeleton-line-CxxYVTO2.js.map} +1 -1
- package/dist/{sparkline-DdbeM4Ai.js → sparkline-BQ-4j2W2.js} +2 -2
- package/dist/{sparkline-DdbeM4Ai.js.map → sparkline-BQ-4j2W2.js.map} +1 -1
- package/dist/src/blocks/agent-harness/agent-harness.d.ts.map +1 -1
- package/dist/src/blocks/agent-harness/agent-harness.tsx +40 -16
- package/dist/src/blocks/commander/commander.tsx +15 -15
- package/dist/src/blocks/map-block/map-block.d.ts.map +1 -1
- package/dist/src/blocks/map-block/map-block.tsx +11 -7
- package/dist/src/components/ai-approval/ai-approval.d.ts.map +1 -1
- package/dist/src/components/ai-code-block/ai-code-block.d.ts +14 -13
- package/dist/src/components/ai-code-block/ai-code-block.d.ts.map +1 -1
- package/dist/src/components/ai-conversation/ai-conversation.d.ts +69 -37
- package/dist/src/components/ai-conversation/ai-conversation.d.ts.map +1 -1
- package/dist/src/components/ai-conversation/index.d.ts +2 -1
- package/dist/src/components/ai-conversation/index.d.ts.map +1 -1
- package/dist/src/components/ai-conversation/measurement-constants.d.ts +30 -0
- package/dist/src/components/ai-conversation/measurement-constants.d.ts.map +1 -0
- package/dist/src/components/ai-info-banner/ai-info-banner.d.ts.map +1 -1
- package/dist/src/components/ai-message/ai-message.d.ts +3 -0
- package/dist/src/components/ai-message/ai-message.d.ts.map +1 -1
- package/dist/src/components/ai-part-group/ai-part-group.d.ts.map +1 -1
- package/dist/src/components/ai-prompt-input/ai-prompt-input.d.ts +13 -3
- 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.map +1 -1
- package/dist/src/components/ai-prompt-input/index.d.ts +1 -1
- package/dist/src/components/ai-prompt-input/index.d.ts.map +1 -1
- package/dist/src/components/ai-prompt-input/types.d.ts.map +1 -1
- package/dist/src/components/ai-question/ai-question.d.ts.map +1 -1
- package/dist/src/components/ai-reasoning/ai-reasoning.d.ts.map +1 -1
- package/dist/src/components/ai-response/ai-response.d.ts +12 -1
- package/dist/src/components/ai-response/ai-response.d.ts.map +1 -1
- package/dist/src/components/ai-streaming-text/ai-streaming-text.d.ts +27 -0
- package/dist/src/components/ai-streaming-text/ai-streaming-text.d.ts.map +1 -1
- package/dist/src/components/ai-streaming-text/index.d.ts +1 -1
- package/dist/src/components/ai-streaming-text/index.d.ts.map +1 -1
- package/dist/src/components/ai-subagent/ai-subagent.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.map +1 -1
- package/dist/src/components/banner/banner.d.ts.map +1 -1
- package/dist/src/components/chart/echart.d.ts.map +1 -1
- package/dist/src/components/clipboard-text/clipboard-text.d.ts.map +1 -1
- package/dist/src/components/data-grid/data-grid.d.ts +2 -1
- package/dist/src/components/data-grid/data-grid.d.ts.map +1 -1
- package/dist/src/components/data-grid/features.d.ts +20 -0
- package/dist/src/components/data-grid/features.d.ts.map +1 -0
- package/dist/src/components/data-grid/types.d.ts +38 -7
- package/dist/src/components/data-grid/types.d.ts.map +1 -1
- package/dist/src/components/empty/empty.d.ts.map +1 -1
- package/dist/src/components/filters/filters.d.ts.map +1 -1
- package/dist/src/components/flow/use-children.d.ts +1 -1
- package/dist/src/components/link/link.d.ts.map +1 -1
- package/dist/src/components/sidebar/sidebar.d.ts +1 -1
- package/dist/src/components/signalflare-ai-logo/signalflare-ai-logo.d.ts.map +1 -1
- package/dist/src/components/stat-card/stat-card.d.ts +5 -0
- package/dist/src/components/stat-card/stat-card.d.ts.map +1 -1
- package/dist/src/components/text/text.d.ts +36 -1
- package/dist/src/components/text/text.d.ts.map +1 -1
- package/dist/src/components/text-roll/text-roll.d.ts.map +1 -1
- package/dist/src/components/theme-toggle/theme-toggle.d.ts.map +1 -1
- package/dist/src/components/toast/toast.d.ts.map +1 -1
- package/dist/src/components/tooltip/tooltip.d.ts.map +1 -1
- package/dist/src/index.d.ts +2 -2
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/utils/highlight-to-react.d.ts.map +1 -1
- package/dist/src/utils/index.d.ts +2 -0
- package/dist/src/utils/index.d.ts.map +1 -1
- package/dist/src/utils/measured-text.d.ts +40 -0
- package/dist/src/utils/measured-text.d.ts.map +1 -0
- package/dist/src/utils/use-measured-text.d.ts +59 -0
- package/dist/src/utils/use-measured-text.d.ts.map +1 -0
- package/dist/{stat-card-CEZscNh8.js → stat-card-Bspk4XFr.js} +30 -12
- package/dist/stat-card-Bspk4XFr.js.map +1 -0
- package/dist/styles/sf-binding.css +1 -1
- package/dist/styles/sf-standalone.css +2 -2
- package/dist/styles/shadcn.css +1 -1
- package/dist/styles/theme-minimal.css +9 -9
- package/dist/styles/theme-sf.css +14 -20
- package/dist/styles/theme-vesper.css +91 -0
- package/dist/{surface-BduI7Ehl.js → surface-CWdSFVUx.js} +3 -3
- package/dist/{surface-BduI7Ehl.js.map → surface-CWdSFVUx.js.map} +1 -1
- package/dist/{switch-CzZBRBL7.js → switch-TA4cByCJ.js} +5 -5
- package/dist/switch-TA4cByCJ.js.map +1 -0
- package/dist/{table-Rv4JMy0B.js → table-BM8JBGBs.js} +3 -3
- package/dist/{table-Rv4JMy0B.js.map → table-BM8JBGBs.js.map} +1 -1
- package/dist/{tabs-1cHrYoel.js → tabs-bnH2vGLv.js} +2 -2
- package/dist/{tabs-1cHrYoel.js.map → tabs-bnH2vGLv.js.map} +1 -1
- package/dist/{text-KJmGkwnf.js → text-iQ0YUFNg.js} +27 -6
- package/dist/text-iQ0YUFNg.js.map +1 -0
- package/dist/{text-roll-BZ3I1umc.js → text-roll-C3U2jd2u.js} +5 -2
- package/dist/text-roll-C3U2jd2u.js.map +1 -0
- package/dist/{theme-toggle-Bhu681D7.js → theme-toggle-BTVxD-fD.js} +10 -9
- package/dist/theme-toggle-BTVxD-fD.js.map +1 -0
- package/dist/{toast-Nw28a5Cx.js → toast-CgZVaAkw.js} +3 -3
- package/dist/{toast-Nw28a5Cx.js.map → toast-CgZVaAkw.js.map} +1 -1
- package/dist/{tooltip-Cb7QW-7H.js → tooltip-uobk6Oh-.js} +9 -3
- package/dist/tooltip-uobk6Oh-.js.map +1 -0
- package/dist/{use-agent-harness-BMyF8pTq.js → use-agent-harness-Dl8w6X5O.js} +3 -3
- package/dist/{use-agent-harness-BMyF8pTq.js.map → use-agent-harness-Dl8w6X5O.js.map} +1 -1
- package/dist/utils.js +4 -3
- package/package.json +27 -24
- package/scripts/component-registry/discovery.ts +11 -10
- package/scripts/component-registry/example-cleanup.ts +8 -8
- package/scripts/component-registry/index.ts +6 -6
- package/scripts/component-registry/schema-generator.ts +1 -1
- package/scripts/component-registry/sub-components.ts +35 -23
- package/scripts/component-registry/utils.ts +11 -11
- package/scripts/component-registry/variant-parser.ts +17 -15
- package/scripts/convert-demos-to-stories.ts +5 -5
- package/scripts/css-build.ts +1 -1
- package/scripts/theme-generator/config.ts +28 -146
- package/scripts/theme-generator/generate-css.ts +1 -2
- package/scripts/theme-generator/index.ts +0 -1
- package/scripts/theme-generator/migrate.ts +3 -3
- package/dist/ai-agent-card-BXHwhWAU.js.map +0 -1
- package/dist/ai-code-block-BgtIxtZZ.js.map +0 -1
- package/dist/ai-conversation-CArP7C8K.js +0 -184
- package/dist/ai-conversation-CArP7C8K.js.map +0 -1
- package/dist/ai-info-banner-uFxHHwBA.js.map +0 -1
- package/dist/ai-message-BjnFznXy.js.map +0 -1
- package/dist/ai-part-group-DBtgTgAn.js.map +0 -1
- package/dist/ai-prompt-input-CuluUzpf.js.map +0 -1
- package/dist/ai-reasoning-CnL6ZSr5.js.map +0 -1
- package/dist/ai-response-BEUg3xvd.js.map +0 -1
- package/dist/ai-streaming-text-CMfoThV0.js.map +0 -1
- package/dist/ai-subagent-DcPRqkAA.js.map +0 -1
- package/dist/ai-task-list-Da9zIm00.js.map +0 -1
- package/dist/ai-timeline-Cwu045IR.js.map +0 -1
- package/dist/ai-tool-Cn1O4xjP.js.map +0 -1
- package/dist/banner-B_6oBrsu.js.map +0 -1
- package/dist/chart-BK3sVPnD.js.map +0 -1
- package/dist/clipboard-text-ssybngLw.js.map +0 -1
- package/dist/command-palette-DGzioeki.js.map +0 -1
- package/dist/data-grid-CG76N_hK.js.map +0 -1
- package/dist/dist-1-gcEL2L.js.map +0 -1
- package/dist/dropdown-qnEYRFXZ.js.map +0 -1
- package/dist/empty-D2TypIId.js.map +0 -1
- package/dist/filters-Bw_U6ZTx.js.map +0 -1
- package/dist/flow-BRsYUCJa.js.map +0 -1
- package/dist/highlight-to-react-ClEfL81q.js.map +0 -1
- package/dist/link-provider-BUZKXaNE.js.map +0 -1
- package/dist/sidebar-CAsCmSpM.js.map +0 -1
- package/dist/stat-card-CEZscNh8.js.map +0 -1
- package/dist/styles/theme-blue-tint.css +0 -98
- package/dist/switch-CzZBRBL7.js.map +0 -1
- package/dist/text-KJmGkwnf.js.map +0 -1
- package/dist/text-roll-BZ3I1umc.js.map +0 -1
- package/dist/theme-toggle-Bhu681D7.js.map +0 -1
- package/dist/tooltip-Cb7QW-7H.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@signalflare-ai/ui",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "SignalFlare AI component library for building modern web applications",
|
|
6
6
|
"keywords": [
|
|
@@ -550,64 +550,67 @@
|
|
|
550
550
|
"build-storybook": "storybook build"
|
|
551
551
|
},
|
|
552
552
|
"dependencies": {
|
|
553
|
-
"@base-ui/react": "1.
|
|
554
|
-
"@
|
|
555
|
-
"@json-render/
|
|
553
|
+
"@base-ui/react": "1.5.0",
|
|
554
|
+
"@chenglou/pretext": "^0.0.7",
|
|
555
|
+
"@json-render/core": "^0.19.0",
|
|
556
|
+
"@json-render/react": "^0.19.0",
|
|
556
557
|
"@tanstack/react-store": "^0.11.0",
|
|
557
558
|
"@tanstack/store": "^0.11.0",
|
|
558
559
|
"clsx": "^2.1.1",
|
|
559
|
-
"tailwind-merge": "^3.
|
|
560
|
+
"tailwind-merge": "^3.6.0"
|
|
560
561
|
},
|
|
561
562
|
"devDependencies": {
|
|
562
|
-
"@storybook/addon-mcp": "^0.
|
|
563
|
-
"@storybook/addon-themes": "^10.
|
|
564
|
-
"@storybook/addon-vitest": "^10.
|
|
565
|
-
"@storybook/react-vite": "^10.
|
|
563
|
+
"@storybook/addon-mcp": "^0.6.0",
|
|
564
|
+
"@storybook/addon-themes": "^10.4.2",
|
|
565
|
+
"@storybook/addon-vitest": "^10.4.2",
|
|
566
|
+
"@storybook/react-vite": "^10.4.2",
|
|
566
567
|
"@streamdown/code": "^1.1.1",
|
|
567
568
|
"@tailwindcss/cli": "catalog:",
|
|
568
569
|
"@tailwindcss/vite": "catalog:",
|
|
569
|
-
"@tanstack/intent": "^0.0.
|
|
570
|
-
"@tanstack/react-table": "
|
|
571
|
-
"@tanstack/react-virtual": "^3.
|
|
570
|
+
"@tanstack/intent": "^0.0.41",
|
|
571
|
+
"@tanstack/react-table": "9.0.0-alpha.52",
|
|
572
|
+
"@tanstack/react-virtual": "^3.14.2",
|
|
572
573
|
"@testing-library/react": "16.3.2",
|
|
573
574
|
"@testing-library/user-event": "14.6.1",
|
|
574
575
|
"@types/leaflet": "^1.9.21",
|
|
575
576
|
"@types/node": "catalog:",
|
|
576
577
|
"@types/react": "catalog:",
|
|
577
578
|
"@types/react-dom": "catalog:",
|
|
578
|
-
"@vitejs/plugin-react": "^6.0.
|
|
579
|
-
"@vitest/browser": "^4.1.
|
|
579
|
+
"@vitejs/plugin-react": "^6.0.2",
|
|
580
|
+
"@vitest/browser": "^4.1.8",
|
|
581
|
+
"@vitest/browser-playwright": "4.1.8",
|
|
582
|
+
"@vitest/coverage-v8": "^4.1.8",
|
|
580
583
|
"@vitest/ui": "catalog:",
|
|
581
|
-
"echarts": "^6.
|
|
584
|
+
"echarts": "^6.1.0",
|
|
582
585
|
"h3-js": "^4.4.0",
|
|
583
586
|
"happy-dom": "catalog:",
|
|
584
587
|
"leaflet": "^1.9.4",
|
|
585
|
-
"motion": "^12.
|
|
588
|
+
"motion": "^12.40.0",
|
|
586
589
|
"oxlint": "catalog:",
|
|
587
|
-
"playwright": "^1.
|
|
590
|
+
"playwright": "^1.60.0",
|
|
588
591
|
"plop": "4.0.5",
|
|
589
592
|
"react-day-picker": "^9.13.2",
|
|
590
|
-
"storybook": "^10.
|
|
593
|
+
"storybook": "^10.4.2",
|
|
591
594
|
"streamdown": "^2.5.0",
|
|
592
|
-
"sugar-high": "^1.
|
|
595
|
+
"sugar-high": "^1.2.1",
|
|
593
596
|
"tailwindcss": "catalog:",
|
|
594
597
|
"ts-json-schema-generator": "2.9.0",
|
|
595
598
|
"typescript": "catalog:",
|
|
596
599
|
"vite": "catalog:",
|
|
597
600
|
"vite-plugin-dts": "catalog:",
|
|
598
601
|
"vitest": "catalog:",
|
|
599
|
-
"zod": "^4.3
|
|
602
|
+
"zod": "^4.4.3"
|
|
600
603
|
},
|
|
601
604
|
"peerDependencies": {
|
|
602
605
|
"@phosphor-icons/react": "^2.1.10",
|
|
603
606
|
"@streamdown/code": "^1.1.1",
|
|
604
|
-
"@tanstack/react-table": "
|
|
605
|
-
"@tanstack/react-virtual": "^3.13.
|
|
607
|
+
"@tanstack/react-table": "9.0.0-alpha.52",
|
|
608
|
+
"@tanstack/react-virtual": "^3.13.26",
|
|
606
609
|
"echarts": "^6.0.0",
|
|
607
610
|
"motion": "^12.38.0",
|
|
608
|
-
"react": "^19.2.
|
|
611
|
+
"react": "^19.2.7",
|
|
609
612
|
"react-day-picker": "^9.13.2",
|
|
610
|
-
"react-dom": "^19.2.
|
|
613
|
+
"react-dom": "^19.2.7",
|
|
611
614
|
"streamdown": "^2.5.0",
|
|
612
615
|
"sugar-high": "^1.0.0",
|
|
613
616
|
"zod": "^3.25.67 || ^4.3.6"
|
|
@@ -104,7 +104,7 @@ export function detectExportsFromIndex(dirPath: string): DetectedExports {
|
|
|
104
104
|
|
|
105
105
|
// Match named exports: export { Foo, Bar, type BazProps } from "./file"
|
|
106
106
|
// Also handles: export { Foo } from "./file"
|
|
107
|
-
const exportPattern = /export\s*\{([^}]+)\}/
|
|
107
|
+
const exportPattern = /export\s*\{([^}]+)\}/gu;
|
|
108
108
|
let match: RegExpExecArray | null;
|
|
109
109
|
|
|
110
110
|
const namedExports: string[] = [];
|
|
@@ -120,13 +120,13 @@ export function detectExportsFromIndex(dirPath: string): DetectedExports {
|
|
|
120
120
|
|
|
121
121
|
for (const item of items) {
|
|
122
122
|
// Check if it's a type export: "type FooProps" or "type Foo as Bar"
|
|
123
|
-
const typeMatch = /^type\s+(\w+)(?:\s+as\s+(\w+))
|
|
123
|
+
const typeMatch = /^type\s+(\w+)(?:\s+as\s+(\w+))?/u.exec(item);
|
|
124
124
|
if (typeMatch) {
|
|
125
125
|
// Use aliased name if present, otherwise original name
|
|
126
126
|
typeExports.push(typeMatch[2] || typeMatch[1]);
|
|
127
127
|
} else {
|
|
128
128
|
// Regular named export, could have "as" alias: "Foo as Bar"
|
|
129
|
-
const nameMatch = /^(\w+)(?:\s+as\s+(\w+))
|
|
129
|
+
const nameMatch = /^(\w+)(?:\s+as\s+(\w+))?/u.exec(item);
|
|
130
130
|
if (nameMatch) {
|
|
131
131
|
// Use aliased name if present, otherwise original name
|
|
132
132
|
namedExports.push(nameMatch[2] || nameMatch[1]);
|
|
@@ -136,7 +136,7 @@ export function detectExportsFromIndex(dirPath: string): DetectedExports {
|
|
|
136
136
|
}
|
|
137
137
|
|
|
138
138
|
// Also match direct exports: export const Foo = ...
|
|
139
|
-
const directExportPattern = /export\s+(?:const|function)\s+(\w+)/
|
|
139
|
+
const directExportPattern = /export\s+(?:const|function)\s+(\w+)/gu;
|
|
140
140
|
while ((match = directExportPattern.exec(content)) !== null) {
|
|
141
141
|
namedExports.push(match[1]);
|
|
142
142
|
}
|
|
@@ -196,9 +196,9 @@ export function detectPropsTypeFromFile(
|
|
|
196
196
|
|
|
197
197
|
// Look for interface/type that ends with Props (both exported and non-exported)
|
|
198
198
|
// Pattern: [export] interface FooProps or [export] type FooProps
|
|
199
|
-
const exportedPropsPattern = /export\s+(?:interface|type)\s+(\w+Props)/
|
|
199
|
+
const exportedPropsPattern = /export\s+(?:interface|type)\s+(\w+Props)/gu;
|
|
200
200
|
const nonExportedPropsPattern =
|
|
201
|
-
/(?:^|\n)\s*(?:interface|type)\s+(\w+Props)\s*[=<{]/
|
|
201
|
+
/(?:^|\n)\s*(?:interface|type)\s+(\w+Props)\s*[=<{]/gu;
|
|
202
202
|
|
|
203
203
|
const exportedTypes: string[] = [];
|
|
204
204
|
const nonExportedTypes: string[] = [];
|
|
@@ -243,7 +243,7 @@ function extractDescriptionFromJSDoc(jsdocContent: string): string | null {
|
|
|
243
243
|
const lines: string[] = [];
|
|
244
244
|
|
|
245
245
|
for (const rawLine of jsdocContent.split("\n")) {
|
|
246
|
-
const line = rawLine.replace(/^\s*\*\s
|
|
246
|
+
const line = rawLine.replace(/^\s*\*\s?/u, "").trim();
|
|
247
247
|
|
|
248
248
|
// Stop at any @tag
|
|
249
249
|
if (line.startsWith("@")) {
|
|
@@ -291,7 +291,8 @@ export function extractDescription(
|
|
|
291
291
|
// First, find the position of the component declaration
|
|
292
292
|
// Handles: export function X, export const X =, function X(
|
|
293
293
|
const componentDeclPattern = new RegExp(
|
|
294
|
-
`(?:export\\s+)?(?:function|const)\\s+${componentName}\\s*(?:=|\\()
|
|
294
|
+
`(?:export\\s+)?(?:function|const)\\s+${componentName}\\s*(?:=|\\()`,
|
|
295
|
+
"u"
|
|
295
296
|
);
|
|
296
297
|
const componentMatch = content.match(componentDeclPattern);
|
|
297
298
|
|
|
@@ -302,7 +303,7 @@ export function extractDescription(
|
|
|
302
303
|
const componentPos = componentMatch.index;
|
|
303
304
|
|
|
304
305
|
// Find all JSDoc comments in the file
|
|
305
|
-
const jsdocPattern = /\/\*\*\s*\n([\s\S]*?)\*\//
|
|
306
|
+
const jsdocPattern = /\/\*\*\s*\n([\s\S]*?)\*\//gu;
|
|
306
307
|
let lastJSDoc: { content: string; endPos: number } | null = null;
|
|
307
308
|
let match: RegExpExecArray | null;
|
|
308
309
|
|
|
@@ -317,7 +318,7 @@ export function extractDescription(
|
|
|
317
318
|
// Check if this JSDoc is immediately before the component
|
|
318
319
|
// (only whitespace/newlines between JSDoc end and component declaration)
|
|
319
320
|
const textBetween = content.slice(jsdocEndPos, componentPos);
|
|
320
|
-
if (/^\s
|
|
321
|
+
if (/^\s*$/u.test(textBetween)) {
|
|
321
322
|
lastJSDoc = { content: match[1], endPos: jsdocEndPos };
|
|
322
323
|
}
|
|
323
324
|
}
|
|
@@ -21,26 +21,26 @@ export function cleanupExample(example: string): string {
|
|
|
21
21
|
let cleaned = example;
|
|
22
22
|
|
|
23
23
|
// Fix stringified functions: prop="() => {}" -> prop={() => {}}
|
|
24
|
-
cleaned = cleaned.replace(/(\w+)="(\(\)\s*=>\s*\{[^}]*\})"/
|
|
24
|
+
cleaned = cleaned.replace(/(\w+)="(\(\)\s*=>\s*\{[^}]*\})"/gu, "$1={$2}");
|
|
25
25
|
|
|
26
26
|
// Fix stringified arrays: prop={`[...]`} -> prop={[...]}
|
|
27
27
|
// Match prop={`[...multiline content...]`}
|
|
28
|
-
cleaned = cleaned.replace(/(\w+)=\{`(\[[\s\S]*?\])`\}/
|
|
28
|
+
cleaned = cleaned.replace(/(\w+)=\{`(\[[\s\S]*?\])`\}/gu, "$1={$2}");
|
|
29
29
|
|
|
30
30
|
// Fix escaped template literals: \` -> `
|
|
31
|
-
cleaned = cleaned.replace(/\\`/
|
|
31
|
+
cleaned = cleaned.replace(/\\`/gu, "`");
|
|
32
32
|
|
|
33
33
|
// Fix double backticks that result from escaping: {``content``} -> {`content`}
|
|
34
34
|
// This happens when template literals get double-escaped
|
|
35
|
-
cleaned = cleaned.replace(/\{``/
|
|
36
|
-
cleaned = cleaned.replace(/``\}/
|
|
35
|
+
cleaned = cleaned.replace(/\{``/gu, "{`");
|
|
36
|
+
cleaned = cleaned.replace(/``\}/gu, "`}");
|
|
37
37
|
|
|
38
38
|
// Fix unquoted identifiers that should be strings (common in Checkbox labels)
|
|
39
39
|
// label={Checked} -> label="Checked" (when it's clearly meant to be a string)
|
|
40
40
|
const identifierAsStringProps = ["label"];
|
|
41
41
|
for (const prop of identifierAsStringProps) {
|
|
42
42
|
// Match prop={SingleWord} where SingleWord is a simple identifier (not a component or expression)
|
|
43
|
-
const pattern = new RegExp(`(${prop})=\\{([A-Z][a-z]+)\\}(?![\\w.])`, "
|
|
43
|
+
const pattern = new RegExp(`(${prop})=\\{([A-Z][a-z]+)\\}(?![\\w.])`, "gu");
|
|
44
44
|
cleaned = cleaned.replace(pattern, '$1="$2"');
|
|
45
45
|
}
|
|
46
46
|
|
|
@@ -91,7 +91,7 @@ export function shouldIncludeExample(
|
|
|
91
91
|
}
|
|
92
92
|
|
|
93
93
|
// Skip examples that are just the component with no props (not useful)
|
|
94
|
-
const emptyPattern = new RegExp(`^<${componentName}\\s
|
|
94
|
+
const emptyPattern = new RegExp(`^<${componentName}\\s*/>$`, "u");
|
|
95
95
|
if (emptyPattern.test(example.trim())) {
|
|
96
96
|
return false;
|
|
97
97
|
}
|
|
@@ -122,7 +122,7 @@ const seenExampleSignatures = new Map<string, Set<string>>();
|
|
|
122
122
|
*/
|
|
123
123
|
export function getExampleSignature(example: string): string {
|
|
124
124
|
// Extract prop assignments like variant="primary" or size="sm"
|
|
125
|
-
const propPattern = /(\w+)=["'{]/
|
|
125
|
+
const propPattern = /(\w+)=["'{]/gu;
|
|
126
126
|
const props: string[] = [];
|
|
127
127
|
let match: RegExpExecArray | null;
|
|
128
128
|
while ((match = propPattern.exec(example)) !== null) {
|
|
@@ -548,15 +548,15 @@ async function processComponent(
|
|
|
548
548
|
const additionalProps = ADDITIONAL_COMPONENT_PROPS[config.name];
|
|
549
549
|
if (additionalProps) {
|
|
550
550
|
for (const [propName, propSchema] of Object.entries(additionalProps)) {
|
|
551
|
-
if (
|
|
552
|
-
props[propName] = propSchema;
|
|
553
|
-
} else {
|
|
551
|
+
if (props[propName]) {
|
|
554
552
|
if (propSchema.type) {
|
|
555
553
|
props[propName].type = propSchema.type;
|
|
556
554
|
}
|
|
557
555
|
if (propSchema.description) {
|
|
558
556
|
props[propName].description = propSchema.description;
|
|
559
557
|
}
|
|
558
|
+
} else {
|
|
559
|
+
props[propName] = propSchema;
|
|
560
560
|
}
|
|
561
561
|
}
|
|
562
562
|
}
|
|
@@ -575,9 +575,7 @@ async function processComponent(
|
|
|
575
575
|
|
|
576
576
|
// Determine examples
|
|
577
577
|
let examples: readonly string[];
|
|
578
|
-
if (config.examples
|
|
579
|
-
examples = config.examples;
|
|
580
|
-
} else {
|
|
578
|
+
if (config.examples === undefined) {
|
|
581
579
|
const extracted = input.storyExamples.get(config.name);
|
|
582
580
|
examples = extracted?.aiExamples ?? [];
|
|
583
581
|
if (examples.length > 0 && CLI_FLAGS.verbose) {
|
|
@@ -585,6 +583,8 @@ async function processComponent(
|
|
|
585
583
|
` → Auto-extracted ${examples.length} examples from stories`
|
|
586
584
|
);
|
|
587
585
|
}
|
|
586
|
+
} else {
|
|
587
|
+
examples = config.examples;
|
|
588
588
|
}
|
|
589
589
|
|
|
590
590
|
// Detect and process sub-components
|
|
@@ -75,7 +75,7 @@ function generateComponentPropsSchema(
|
|
|
75
75
|
const zodType = propTypeToZod(propSchema);
|
|
76
76
|
// Replace newlines with spaces to keep comments on a single line
|
|
77
77
|
const sanitizedDescription = propSchema.description
|
|
78
|
-
?.replace(/\n+/
|
|
78
|
+
?.replace(/\n+/gu, " ")
|
|
79
79
|
.trim();
|
|
80
80
|
const comment = sanitizedDescription ? ` // ${sanitizedDescription}` : "";
|
|
81
81
|
return ` ${propName}: ${zodType},${comment}`;
|
|
@@ -30,7 +30,7 @@ export function detectSubComponents(filePath: string): SubComponentConfig[] {
|
|
|
30
30
|
// Pattern 1: Object.assign with sub-components
|
|
31
31
|
// Find the start of Object.assign and then extract the balanced braces
|
|
32
32
|
// Supports both simple names (Component) and dotted names (SomeBase.Root)
|
|
33
|
-
const objectAssignStart = /Object\.assign\s*\(\s*[\w.]+\s*,\s*\{/
|
|
33
|
+
const objectAssignStart = /Object\.assign\s*\(\s*[\w.]+\s*,\s*\{/gu;
|
|
34
34
|
let startMatch: RegExpExecArray | null;
|
|
35
35
|
|
|
36
36
|
while ((startMatch = objectAssignStart.exec(content)) !== null) {
|
|
@@ -42,7 +42,7 @@ export function detectSubComponents(filePath: string): SubComponentConfig[] {
|
|
|
42
42
|
|
|
43
43
|
// Extract sub-component assignments: SubName: Value or SubName: SomeBase.SubName
|
|
44
44
|
// Handle multi-line with comments
|
|
45
|
-
const subPattern = /^\s*(\w+)\s*[,:]/
|
|
45
|
+
const subPattern = /^\s*(\w+)\s*[,:]/gmu;
|
|
46
46
|
let subMatch: RegExpExecArray | null;
|
|
47
47
|
|
|
48
48
|
while ((subMatch = subPattern.exec(assignBlock)) !== null) {
|
|
@@ -59,14 +59,15 @@ export function detectSubComponents(filePath: string): SubComponentConfig[] {
|
|
|
59
59
|
"function",
|
|
60
60
|
"description",
|
|
61
61
|
].includes(subName) ||
|
|
62
|
-
!/^[A-Z]
|
|
62
|
+
!/^[A-Z]/u.test(subName)
|
|
63
63
|
) {
|
|
64
64
|
continue;
|
|
65
65
|
}
|
|
66
66
|
|
|
67
67
|
// Find the value after the colon for this sub-component
|
|
68
68
|
const valuePattern = new RegExp(
|
|
69
|
-
`\\b${subName}\\s*:\\s*(\\w+(?:\\.\\w+)?)
|
|
69
|
+
`\\b${subName}\\s*:\\s*(\\w+(?:\\.\\w+)?)`,
|
|
70
|
+
"u"
|
|
70
71
|
);
|
|
71
72
|
const valueMatch = assignBlock.match(valuePattern);
|
|
72
73
|
const value = valueMatch ? valueMatch[1] : subName;
|
|
@@ -81,7 +82,8 @@ export function detectSubComponents(filePath: string): SubComponentConfig[] {
|
|
|
81
82
|
// Look for function signature or interface for this sub-component
|
|
82
83
|
// Pattern: function SubName({ ... }: SubNameProps) or function SubName(props: SubNameProps)
|
|
83
84
|
const funcPropsPattern = new RegExp(
|
|
84
|
-
`function\\s+${value}\\s*(?:<[^>]*>)?\\s*\\([^)]*:\\s*(\\w+Props)
|
|
85
|
+
`function\\s+${value}\\s*(?:<[^>]*>)?\\s*\\([^)]*:\\s*(\\w+Props)`,
|
|
86
|
+
"u"
|
|
85
87
|
);
|
|
86
88
|
const funcMatch = content.match(funcPropsPattern);
|
|
87
89
|
if (funcMatch) {
|
|
@@ -90,7 +92,8 @@ export function detectSubComponents(filePath: string): SubComponentConfig[] {
|
|
|
90
92
|
|
|
91
93
|
// Also check for inline type in PropsWithChildren pattern
|
|
92
94
|
const propsWithChildrenPattern = new RegExp(
|
|
93
|
-
`function\\s+${value}\\s*\\([^)]*:\\s*PropsWithChildren<\\{([^}]+)\\}
|
|
95
|
+
`function\\s+${value}\\s*\\([^)]*:\\s*PropsWithChildren<\\{([^}]+)\\}>`,
|
|
96
|
+
"u"
|
|
94
97
|
);
|
|
95
98
|
const pwcMatch = content.match(propsWithChildrenPattern);
|
|
96
99
|
if (pwcMatch && !propsType) {
|
|
@@ -122,7 +125,7 @@ export function detectSubComponents(filePath: string): SubComponentConfig[] {
|
|
|
122
125
|
|
|
123
126
|
// Pattern 2: Direct property assignment at module level (e.g., Breadcrumb.Link = Link)
|
|
124
127
|
// Must be at start of line (module level) and sub-component name must be PascalCase
|
|
125
|
-
const directAssignPattern = /^([A-Z]\w+)\.([A-Z]\w+)\s*=\s*(\w+)\s*;/
|
|
128
|
+
const directAssignPattern = /^([A-Z]\w+)\.([A-Z]\w+)\s*=\s*(\w+)\s*;/gmu;
|
|
126
129
|
let directMatch: RegExpExecArray | null;
|
|
127
130
|
|
|
128
131
|
while ((directMatch = directAssignPattern.exec(content)) !== null) {
|
|
@@ -142,7 +145,8 @@ export function detectSubComponents(filePath: string): SubComponentConfig[] {
|
|
|
142
145
|
// Try to find props type for this sub-component
|
|
143
146
|
let propsType: string | null = null;
|
|
144
147
|
const funcPropsPattern = new RegExp(
|
|
145
|
-
`function\\s+${value}\\s*(?:<[^>]*>)?\\s*\\([^)]*:\\s*(\\w+Props)
|
|
148
|
+
`function\\s+${value}\\s*(?:<[^>]*>)?\\s*\\([^)]*:\\s*(\\w+Props)`,
|
|
149
|
+
"u"
|
|
146
150
|
);
|
|
147
151
|
const funcMatch = content.match(funcPropsPattern);
|
|
148
152
|
if (funcMatch) {
|
|
@@ -195,11 +199,13 @@ export function extractSubComponentProps(
|
|
|
195
199
|
const inlinePropsPatterns = [
|
|
196
200
|
// function Name({ destructured }: { inline props })
|
|
197
201
|
new RegExp(
|
|
198
|
-
`(?:function|const)\\s+${funcName}\\s*=?\\s*\\([^)]*:\\s*(?:PropsWithChildren<)?\\{([^}]+)\\}
|
|
202
|
+
`(?:function|const)\\s+${funcName}\\s*=?\\s*\\([^)]*:\\s*(?:PropsWithChildren<)?\\{([^}]+)\\}`,
|
|
203
|
+
"u"
|
|
199
204
|
),
|
|
200
205
|
// function Name({ destructured }: PropsWithChildren<InterfaceName>)
|
|
201
206
|
new RegExp(
|
|
202
|
-
`(?:function|const)\\s+${funcName}\\s*=?\\s*\\([^)]*:\\s*PropsWithChildren<(\\w+)
|
|
207
|
+
`(?:function|const)\\s+${funcName}\\s*=?\\s*\\([^)]*:\\s*PropsWithChildren<(\\w+)>`,
|
|
208
|
+
"u"
|
|
203
209
|
),
|
|
204
210
|
];
|
|
205
211
|
|
|
@@ -209,7 +215,7 @@ export function extractSubComponentProps(
|
|
|
209
215
|
const propsBlock = match[1];
|
|
210
216
|
|
|
211
217
|
// Check if it's an interface name (single word) or inline props
|
|
212
|
-
if (/^\w
|
|
218
|
+
if (/^\w+$/u.test(propsBlock)) {
|
|
213
219
|
// It's an interface name, try to find and parse it
|
|
214
220
|
const interfaceProps = extractPropsFromInterface(
|
|
215
221
|
content,
|
|
@@ -219,7 +225,7 @@ export function extractSubComponentProps(
|
|
|
219
225
|
Object.assign(props, interfaceProps);
|
|
220
226
|
} else {
|
|
221
227
|
// Parse inline props: propName?: Type or propName: Type
|
|
222
|
-
const propPattern = /(\w+)(\?)?:\s*([^;,\n}]+)/
|
|
228
|
+
const propPattern = /(\w+)(\?)?:\s*([^;,\n}]+)/gu;
|
|
223
229
|
let propMatch: RegExpExecArray | null;
|
|
224
230
|
|
|
225
231
|
while ((propMatch = propPattern.exec(propsBlock)) !== null) {
|
|
@@ -228,7 +234,7 @@ export function extractSubComponentProps(
|
|
|
228
234
|
let propType = propMatch[3].trim();
|
|
229
235
|
|
|
230
236
|
// Clean up type
|
|
231
|
-
propType = propType.replace(/[,;]
|
|
237
|
+
propType = propType.replace(/[,;]$/u, "").trim();
|
|
232
238
|
|
|
233
239
|
if (shouldSkipProp(propName, cliFlags)) continue;
|
|
234
240
|
|
|
@@ -263,9 +269,9 @@ export function extractSubComponentProps(
|
|
|
263
269
|
// This handles multi-line destructuring patterns
|
|
264
270
|
const funcDefPatterns = [
|
|
265
271
|
// Arrow function: const Name = (...)
|
|
266
|
-
new RegExp(`const\\s+${funcName}\\s*=\\s*\\([\\s\\S]*?\\)\\s
|
|
272
|
+
new RegExp(`const\\s+${funcName}\\s*=\\s*\\([\\s\\S]*?\\)\\s*=>`, "u"),
|
|
267
273
|
// Regular function: function Name(...)
|
|
268
|
-
new RegExp(`function\\s+${funcName}\\s*\\([\\s\\S]*?\\)\\s*\\{
|
|
274
|
+
new RegExp(`function\\s+${funcName}\\s*\\([\\s\\S]*?\\)\\s*\\{`, "u"),
|
|
269
275
|
];
|
|
270
276
|
|
|
271
277
|
for (const defPattern of funcDefPatterns) {
|
|
@@ -275,9 +281,9 @@ export function extractSubComponentProps(
|
|
|
275
281
|
|
|
276
282
|
// Extract PropsWithChildren<InterfaceName> or direct interface reference
|
|
277
283
|
const typePatterns = [
|
|
278
|
-
/PropsWithChildren<(\w+)
|
|
279
|
-
/:\s*(\w+Props)\s*\)
|
|
280
|
-
/:\s*(\w+ItemProps)\s*\)
|
|
284
|
+
/PropsWithChildren<(\w+)>/u,
|
|
285
|
+
/:\s*(\w+Props)\s*\)/u,
|
|
286
|
+
/:\s*(\w+ItemProps)\s*\)/u,
|
|
281
287
|
];
|
|
282
288
|
|
|
283
289
|
for (const typePattern of typePatterns) {
|
|
@@ -319,15 +325,21 @@ export function extractPropsFromInterface(
|
|
|
319
325
|
): Record<string, PropSchema> {
|
|
320
326
|
const props: Record<string, PropSchema> = {};
|
|
321
327
|
|
|
322
|
-
// Match interface definition
|
|
328
|
+
// Match interface definition, or a type alias whose definition contains an
|
|
329
|
+
// inline object literal (e.g. `type FooProps = ComponentProps<X> & { ... }`).
|
|
323
330
|
const interfacePattern = new RegExp(
|
|
324
|
-
`interface\\s+${interfaceName}\\s*(?:extends[^{]*)?\\{([^}]+)\\}
|
|
331
|
+
`interface\\s+${interfaceName}\\s*(?:extends[^{]*)?\\{([^}]+)\\}`,
|
|
332
|
+
"u"
|
|
325
333
|
);
|
|
326
|
-
const
|
|
334
|
+
const typePattern = new RegExp(
|
|
335
|
+
`type\\s+${interfaceName}\\s*=[^{]*\\{([^}]+)\\}`,
|
|
336
|
+
"u"
|
|
337
|
+
);
|
|
338
|
+
const match = content.match(interfacePattern) ?? content.match(typePattern);
|
|
327
339
|
|
|
328
340
|
if (match) {
|
|
329
341
|
const propsBlock = match[1];
|
|
330
|
-
const propPattern = /(\w+)(\?)?:\s*([^;,\n}]+)/
|
|
342
|
+
const propPattern = /(\w+)(\?)?:\s*([^;,\n}]+)/gu;
|
|
331
343
|
let propMatch: RegExpExecArray | null;
|
|
332
344
|
|
|
333
345
|
while ((propMatch = propPattern.exec(propsBlock)) !== null) {
|
|
@@ -335,7 +347,7 @@ export function extractPropsFromInterface(
|
|
|
335
347
|
const isOptional = propMatch[2] === "?";
|
|
336
348
|
let propType = propMatch[3].trim();
|
|
337
349
|
|
|
338
|
-
propType = propType.replace(/[,;]
|
|
350
|
+
propType = propType.replace(/[,;]$/u, "").trim();
|
|
339
351
|
|
|
340
352
|
if (shouldSkipProp(propName, cliFlags)) continue;
|
|
341
353
|
|
|
@@ -31,8 +31,8 @@ export function toPascalCase(str: string): string {
|
|
|
31
31
|
*/
|
|
32
32
|
export function toScreamingSnakeCase(str: string): string {
|
|
33
33
|
return str
|
|
34
|
-
.replace(/([a-z])([A-Z])/
|
|
35
|
-
.replace(/([A-Z]+)([A-Z][a-z])/
|
|
34
|
+
.replace(/([a-z])([A-Z])/gu, "$1_$2")
|
|
35
|
+
.replace(/([A-Z]+)([A-Z][a-z])/gu, "$1_$2")
|
|
36
36
|
.toUpperCase();
|
|
37
37
|
}
|
|
38
38
|
|
|
@@ -90,7 +90,7 @@ export function parseSemanticColorNames(): string[] {
|
|
|
90
90
|
// Pattern: "--color-<name>: light-dark(" or "--text-color-<name>: light-dark("
|
|
91
91
|
// This excludes raw palette colors which are defined with direct values like "oklch(...)"
|
|
92
92
|
const semanticColorPattern =
|
|
93
|
-
/--(?:text-)?color-([a-zA-Z][a-zA-Z0-9-]*)\s*:\s*light-dark\(/
|
|
93
|
+
/--(?:text-)?color-([a-zA-Z][a-zA-Z0-9-]*)\s*:\s*light-dark\(/gu;
|
|
94
94
|
let match: RegExpExecArray | null;
|
|
95
95
|
|
|
96
96
|
while ((match = semanticColorPattern.exec(content)) !== null) {
|
|
@@ -129,7 +129,7 @@ export function extractSemanticColors(sourceFile: string): string[] {
|
|
|
129
129
|
// Escape hyphens for regex and create pattern
|
|
130
130
|
const pattern = new RegExp(
|
|
131
131
|
`(?:[\\w\\[\\]=_-]+:)*(${prefix}-${colorName})(?![a-zA-Z0-9-])`,
|
|
132
|
-
"
|
|
132
|
+
"gu"
|
|
133
133
|
);
|
|
134
134
|
let match: RegExpExecArray | null;
|
|
135
135
|
while ((match = pattern.exec(content)) !== null) {
|
|
@@ -159,19 +159,19 @@ export function extractStateClasses(
|
|
|
159
159
|
const states: Record<string, string> = {};
|
|
160
160
|
|
|
161
161
|
// Split by whitespace to process each class individually
|
|
162
|
-
const classes = classString.split(/\s+/);
|
|
162
|
+
const classes = classString.split(/\s+/u);
|
|
163
163
|
|
|
164
164
|
for (const cls of classes) {
|
|
165
165
|
if (!cls) continue;
|
|
166
166
|
|
|
167
167
|
// Check for hover states
|
|
168
|
-
if (cls.startsWith("hover:") || /^\[&:hover[^\]]*\]
|
|
168
|
+
if (cls.startsWith("hover:") || /^\[&:hover[^\]]*\]:/u.exec(cls)) {
|
|
169
169
|
states.hover = states.hover ? `${states.hover} ${cls}` : cls;
|
|
170
170
|
}
|
|
171
171
|
// Check for focus states (focus, focus-visible, focus-within)
|
|
172
172
|
else if (
|
|
173
|
-
/^(focus|focus-visible|focus-within)
|
|
174
|
-
/^\[&:focus(-visible|-within)?[^\]]*\]
|
|
173
|
+
/^(focus|focus-visible|focus-within):/u.exec(cls) ||
|
|
174
|
+
/^\[&:focus(-visible|-within)?[^\]]*\]:/u.exec(cls)
|
|
175
175
|
) {
|
|
176
176
|
states.focus = states.focus ? `${states.focus} ${cls}` : cls;
|
|
177
177
|
}
|
|
@@ -190,7 +190,7 @@ export function extractStateClasses(
|
|
|
190
190
|
: cls;
|
|
191
191
|
}
|
|
192
192
|
// Check for data-state
|
|
193
|
-
else if (/^data-\[state=[^\]]+\]
|
|
193
|
+
else if (/^data-\[state=[^\]]+\]:/u.test(cls)) {
|
|
194
194
|
states["data-state"] = states["data-state"]
|
|
195
195
|
? `${states["data-state"]} ${cls}`
|
|
196
196
|
: cls;
|
|
@@ -218,7 +218,7 @@ export function extractBlockDependencies(sourceFile: string): string[] {
|
|
|
218
218
|
// Pattern: import { Foo, Bar } from "../../components/something"
|
|
219
219
|
// Pattern: import { Foo } from "../../blocks/something"
|
|
220
220
|
const importPattern =
|
|
221
|
-
/import\s+(?:type\s+)?\{([^}]+)\}\s+from\s+["']\.\.\/\.\.\/(?:components|blocks)\/[^"']+["']/
|
|
221
|
+
/import\s+(?:type\s+)?\{([^}]+)\}\s+from\s+["']\.\.\/\.\.\/(?:components|blocks)\/[^"']+["']/gu;
|
|
222
222
|
let match: RegExpExecArray | null;
|
|
223
223
|
|
|
224
224
|
while ((match = importPattern.exec(content)) !== null) {
|
|
@@ -235,7 +235,7 @@ export function extractBlockDependencies(sourceFile: string): string[] {
|
|
|
235
235
|
continue;
|
|
236
236
|
}
|
|
237
237
|
// Extract name (handle "Foo as Bar" -> "Foo")
|
|
238
|
-
const nameMatch = /^(\w+)(?:\s+as\s+\w+)
|
|
238
|
+
const nameMatch = /^(\w+)(?:\s+as\s+\w+)?/u.exec(item);
|
|
239
239
|
if (nameMatch) {
|
|
240
240
|
dependencies.add(nameMatch[1]);
|
|
241
241
|
}
|
|
@@ -36,7 +36,7 @@ export function extractBaseStylesFromFile(filePath: string): string | null {
|
|
|
36
36
|
// Match: export const SF_*_BASE_STYLES = "..." or '...' or `...`
|
|
37
37
|
// Handles multi-line strings with template literals
|
|
38
38
|
const baseStylesMatch =
|
|
39
|
-
/export\s+const\s+SF_\w+_BASE_STYLES\s*=\s*["'`]([^"'`]+)["'`]
|
|
39
|
+
/export\s+const\s+SF_\w+_BASE_STYLES\s*=\s*["'`]([^"'`]+)["'`]/u.exec(
|
|
40
40
|
content
|
|
41
41
|
);
|
|
42
42
|
|
|
@@ -67,7 +67,7 @@ export function parseVariantsObject(
|
|
|
67
67
|
|
|
68
68
|
// Find top-level property names (e.g., shape, size, variant)
|
|
69
69
|
// These are identifiers followed by `: {` at the first nesting level
|
|
70
|
-
const topLevelPropPattern = /^\s*(\w+)\s*:\s*\{/
|
|
70
|
+
const topLevelPropPattern = /^\s*(\w+)\s*:\s*\{/gmu;
|
|
71
71
|
let propMatch: RegExpExecArray | null;
|
|
72
72
|
|
|
73
73
|
while ((propMatch = topLevelPropPattern.exec(objStr)) !== null) {
|
|
@@ -86,7 +86,7 @@ export function parseVariantsObject(
|
|
|
86
86
|
// biome-ignore lint/suspicious/noExplicitAny: Variants have varying shapes
|
|
87
87
|
const variants: Record<string, any> = {};
|
|
88
88
|
// Match variant names including quoted keys like "secondary-destructive"
|
|
89
|
-
const variantPropPattern = /^\s*(?:"([^"]+)"|'([^']+)'|(\w+))\s*:\s*\{/
|
|
89
|
+
const variantPropPattern = /^\s*(?:"([^"]+)"|'([^']+)'|(\w+))\s*:\s*\{/gmu;
|
|
90
90
|
let variantMatch: RegExpExecArray | null;
|
|
91
91
|
|
|
92
92
|
while ((variantMatch = variantPropPattern.exec(propBlock)) !== null) {
|
|
@@ -103,9 +103,11 @@ export function parseVariantsObject(
|
|
|
103
103
|
if (!variantBlock) continue;
|
|
104
104
|
|
|
105
105
|
// Extract description if present
|
|
106
|
-
const descMatch = /description\s*:\s*["']([^"']*)["']
|
|
106
|
+
const descMatch = /description\s*:\s*["']([^"']*)["']/u.exec(
|
|
107
|
+
variantBlock
|
|
108
|
+
);
|
|
107
109
|
// Extract classes if present (for Figma plugin consumption)
|
|
108
|
-
const classesMatch = /classes\s*:\s*["']([^"']*)["']
|
|
110
|
+
const classesMatch = /classes\s*:\s*["']([^"']*)["']/u.exec(variantBlock);
|
|
109
111
|
|
|
110
112
|
// Extract state classes from the classes string
|
|
111
113
|
const stateClasses = classesMatch
|
|
@@ -134,7 +136,7 @@ export function parseDefaultsObject(objStr: string): Record<string, string> {
|
|
|
134
136
|
const result: Record<string, string> = {};
|
|
135
137
|
|
|
136
138
|
// Match properties like: variant: "primary", size: "base"
|
|
137
|
-
const propPattern = /(\w+)\s*:\s*["']([^"']*)["']/
|
|
139
|
+
const propPattern = /(\w+)\s*:\s*["']([^"']*)["']/gu;
|
|
138
140
|
let match: RegExpExecArray | null;
|
|
139
141
|
|
|
140
142
|
while ((match = propPattern.exec(objStr)) !== null) {
|
|
@@ -159,12 +161,12 @@ export function extractVariantsFromFile(
|
|
|
159
161
|
const content = readFileSync(filePath, "utf-8");
|
|
160
162
|
|
|
161
163
|
// Find SF_*_VARIANTS export start position
|
|
162
|
-
const variantsStartMatch = /export\s+const\s+SF_\w+_VARIANTS\s*=\s
|
|
164
|
+
const variantsStartMatch = /export\s+const\s+SF_\w+_VARIANTS\s*=\s*/u.exec(
|
|
163
165
|
content
|
|
164
166
|
);
|
|
165
167
|
// Find SF_*_DEFAULT_VARIANTS export start position
|
|
166
168
|
const defaultsStartMatch =
|
|
167
|
-
/export\s+const\s+SF_\w+_DEFAULT_VARIANTS\s*=\s
|
|
169
|
+
/export\s+const\s+SF_\w+_DEFAULT_VARIANTS\s*=\s*/u.exec(content);
|
|
168
170
|
|
|
169
171
|
if (!variantsStartMatch || !defaultsStartMatch) {
|
|
170
172
|
return null;
|
|
@@ -212,7 +214,7 @@ export function extractVariantsFromFile(
|
|
|
212
214
|
function parseStylingObject(objStr: string): ComponentStyling | null {
|
|
213
215
|
try {
|
|
214
216
|
// Remove 'as const' suffix if present
|
|
215
|
-
const cleanedStr = objStr.replace(/\s*as\s+const\s
|
|
217
|
+
const cleanedStr = objStr.replace(/\s*as\s+const\s*$/u, "");
|
|
216
218
|
|
|
217
219
|
// Security: Parse as JSON-like structure instead of executing code
|
|
218
220
|
// This prevents RCE if a source file is compromised
|
|
@@ -234,14 +236,14 @@ function parseObjectLiteralSafely(
|
|
|
234
236
|
const result: Record<string, unknown> = {};
|
|
235
237
|
|
|
236
238
|
// Remove outer braces
|
|
237
|
-
const content = objStr.trim().replace(/^\{
|
|
239
|
+
const content = objStr.trim().replace(/^\{/u, "").replace(/\}$/u, "").trim();
|
|
238
240
|
if (!content) return {};
|
|
239
241
|
|
|
240
242
|
// Split by top-level commas (not inside nested braces)
|
|
241
243
|
const properties = splitTopLevelProperties(content);
|
|
242
244
|
|
|
243
245
|
for (const prop of properties) {
|
|
244
|
-
const match = /^\s*(\w+)\s*:\s*(.+)$/
|
|
246
|
+
const match = /^\s*(\w+)\s*:\s*(.+)$/su.exec(prop);
|
|
245
247
|
if (!match) continue;
|
|
246
248
|
|
|
247
249
|
const key = match[1];
|
|
@@ -301,20 +303,20 @@ function parseValue(valueStr: string): unknown {
|
|
|
301
303
|
if (valueStr.startsWith("[")) {
|
|
302
304
|
try {
|
|
303
305
|
// Arrays are typically simple in styling configs
|
|
304
|
-
return JSON.parse(valueStr.replace(/'/
|
|
306
|
+
return JSON.parse(valueStr.replace(/'/gu, '"'));
|
|
305
307
|
} catch {
|
|
306
308
|
return null;
|
|
307
309
|
}
|
|
308
310
|
}
|
|
309
311
|
|
|
310
312
|
// Handle strings (single or double quotes)
|
|
311
|
-
const stringMatch = /^["'](.+)["']$/
|
|
313
|
+
const stringMatch = /^["'](.+)["']$/su.exec(valueStr);
|
|
312
314
|
if (stringMatch) {
|
|
313
315
|
return stringMatch[1];
|
|
314
316
|
}
|
|
315
317
|
|
|
316
318
|
// Handle numbers
|
|
317
|
-
if (/^-?\d+(\.\d+)
|
|
319
|
+
if (/^-?\d+(\.\d+)?$/u.test(valueStr)) {
|
|
318
320
|
return Number(valueStr);
|
|
319
321
|
}
|
|
320
322
|
|
|
@@ -343,7 +345,7 @@ export function extractStylingFromFile(
|
|
|
343
345
|
const content = readFileSync(filePath, "utf-8");
|
|
344
346
|
|
|
345
347
|
// Find SF_*_STYLING export start position
|
|
346
|
-
const stylingStartMatch = /export\s+const\s+SF_\w+_STYLING\s*=\s
|
|
348
|
+
const stylingStartMatch = /export\s+const\s+SF_\w+_STYLING\s*=\s*/u.exec(
|
|
347
349
|
content
|
|
348
350
|
);
|
|
349
351
|
|