@epicbagel/saas-kit 0.0.0-stage → 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/LICENSE +21 -0
- package/README.md +71 -2
- package/THIRD_PARTY_NOTICES.md +47 -0
- package/dist/chunk-23UMHZ4S.cjs +124 -0
- package/dist/chunk-2BHI5ZWJ.cjs +117 -0
- package/dist/chunk-2HTYXBDU.cjs +34 -0
- package/dist/chunk-2XDFTB2W.cjs +35 -0
- package/dist/chunk-35YMAIEL.js +135 -0
- package/dist/chunk-373W6VAD.cjs +82 -0
- package/dist/chunk-3BZ4CQHW.js +94 -0
- package/dist/chunk-3OWGL4Q2.js +65 -0
- package/dist/chunk-3QT5VYZ3.js +141 -0
- package/dist/chunk-4HWCNRK4.js +117 -0
- package/dist/chunk-4LXN6GLZ.cjs +44 -0
- package/dist/chunk-4NN7EA3W.js +222 -0
- package/dist/chunk-62UTAG2C.js +152 -0
- package/dist/chunk-667ZCM4X.cjs +72 -0
- package/dist/chunk-6RVPQGYS.js +181 -0
- package/dist/chunk-6T2EULKN.cjs +42 -0
- package/dist/chunk-7CRDYV3C.js +137 -0
- package/dist/chunk-BEJJN2SY.cjs +73 -0
- package/dist/chunk-BGLGRUPP.cjs +31 -0
- package/dist/chunk-CS7DM3NV.js +98 -0
- package/dist/chunk-CTYOW3V2.cjs +59 -0
- package/dist/chunk-D4ZL2OEQ.js +61 -0
- package/dist/chunk-DFB4ILN6.cjs +137 -0
- package/dist/chunk-E2TQMDO7.js +34 -0
- package/dist/chunk-EIY5LLSP.js +82 -0
- package/dist/chunk-EJP2L5QV.cjs +74 -0
- package/dist/chunk-F73ONTCK.js +73 -0
- package/dist/chunk-F7JHSZNT.js +73 -0
- package/dist/chunk-FJLINIC6.js +48 -0
- package/dist/chunk-FLPYZNWZ.js +124 -0
- package/dist/chunk-FNDBM67K.cjs +61 -0
- package/dist/chunk-G54TQV2R.cjs +222 -0
- package/dist/chunk-G6SRSWXB.js +32 -0
- package/dist/chunk-G76JANB4.js +138 -0
- package/dist/chunk-GL5CV4FF.js +59 -0
- package/dist/chunk-GMJWBGTJ.js +34 -0
- package/dist/chunk-GRZMUGT6.cjs +94 -0
- package/dist/chunk-GXHGMI3Z.cjs +48 -0
- package/dist/chunk-H2O6NMLZ.js +52 -0
- package/dist/chunk-H2UFRLLN.cjs +100 -0
- package/dist/chunk-H7TETFLB.js +39 -0
- package/dist/chunk-HQRWRRZJ.js +179 -0
- package/dist/chunk-HYSWE75T.js +67 -0
- package/dist/chunk-HYTILYE5.js +31 -0
- package/dist/chunk-I6GUOEBO.cjs +61 -0
- package/dist/chunk-IQZLUT2Y.cjs +34 -0
- package/dist/chunk-J3GQXM37.js +61 -0
- package/dist/chunk-J6NXDZR5.js +145 -0
- package/dist/chunk-JH4GAGOQ.cjs +34 -0
- package/dist/chunk-KGFL3VWY.cjs +62 -0
- package/dist/chunk-KN4RPX35.js +36 -0
- package/dist/chunk-KWLSBTB2.cjs +34 -0
- package/dist/chunk-L4DH72UF.cjs +179 -0
- package/dist/chunk-LELBCBDT.cjs +52 -0
- package/dist/chunk-LELFPLTE.js +55 -0
- package/dist/chunk-LI5EOSQG.js +171 -0
- package/dist/chunk-LIE6W3QT.js +42 -0
- package/dist/chunk-MLHNYRFX.js +411 -0
- package/dist/chunk-NBUWGRQO.js +31 -0
- package/dist/chunk-NE3ZVJ6G.cjs +67 -0
- package/dist/chunk-NQK5ZWC7.cjs +31 -0
- package/dist/chunk-NW3OWKBN.js +57 -0
- package/dist/chunk-OICAYRVH.js +34 -0
- package/dist/chunk-PIU5SSUV.js +25 -0
- package/dist/chunk-PNWNU6JW.cjs +171 -0
- package/dist/chunk-PPX2VPGI.cjs +138 -0
- package/dist/chunk-PQUSJEXL.cjs +51 -0
- package/dist/chunk-QD63LB2F.js +62 -0
- package/dist/chunk-QMA3WVB7.js +51 -0
- package/dist/chunk-QNZYQLNP.js +125 -0
- package/dist/chunk-R35FT53G.cjs +25 -0
- package/dist/chunk-R3DQS6U4.cjs +135 -0
- package/dist/chunk-R4AIM3BQ.js +72 -0
- package/dist/chunk-R5L4CM6V.cjs +202 -0
- package/dist/chunk-RRRD5EUI.js +202 -0
- package/dist/chunk-RSFEKQDR.cjs +181 -0
- package/dist/chunk-RWWOFWLP.cjs +510 -0
- package/dist/chunk-SGW4FWBX.cjs +411 -0
- package/dist/chunk-T2ZFSPE4.cjs +36 -0
- package/dist/chunk-U2NES7VR.cjs +32 -0
- package/dist/chunk-UGF2K6NR.js +510 -0
- package/dist/chunk-V4LE2HWP.js +166 -0
- package/dist/chunk-V5SPFLKW.cjs +145 -0
- package/dist/chunk-V7542UGX.js +31 -0
- package/dist/chunk-VBPPFC7X.cjs +66 -0
- package/dist/chunk-VGTINL5Q.cjs +39 -0
- package/dist/chunk-VKIGJNJR.cjs +57 -0
- package/dist/chunk-W5HPHEE7.cjs +31 -0
- package/dist/chunk-W5I4FN7G.cjs +78 -0
- package/dist/chunk-WABCLRBR.cjs +65 -0
- package/dist/chunk-WDXEJDMO.cjs +141 -0
- package/dist/chunk-WNXVGUBF.cjs +40 -0
- package/dist/chunk-WQJKUKBL.cjs +125 -0
- package/dist/chunk-XAPPU3MD.js +35 -0
- package/dist/chunk-XLIAY56V.cjs +55 -0
- package/dist/chunk-YEW65ASC.js +66 -0
- package/dist/chunk-YG7FBJRM.js +40 -0
- package/dist/chunk-YWAQRAXP.js +78 -0
- package/dist/chunk-YYFVG5A6.cjs +152 -0
- package/dist/chunk-ZAITUDYD.cjs +166 -0
- package/dist/chunk-ZRLUUZHK.js +32 -0
- package/dist/chunk-ZWZAAGQF.js +44 -0
- package/dist/hooks/use-copy-to-clipboard.cjs +7 -0
- package/dist/hooks/use-copy-to-clipboard.d.cts +12 -0
- package/dist/hooks/use-copy-to-clipboard.d.ts +12 -0
- package/dist/hooks/use-copy-to-clipboard.js +7 -0
- package/dist/hooks/use-layout-preference.cjs +51 -0
- package/dist/hooks/use-layout-preference.d.cts +10 -0
- package/dist/hooks/use-layout-preference.d.ts +10 -0
- package/dist/hooks/use-layout-preference.js +51 -0
- package/dist/hooks/use-mobile.cjs +7 -0
- package/dist/hooks/use-mobile.d.cts +3 -0
- package/dist/hooks/use-mobile.d.ts +3 -0
- package/dist/hooks/use-mobile.js +7 -0
- package/dist/lib/date-utils.cjs +15 -0
- package/dist/lib/date-utils.d.cts +16 -0
- package/dist/lib/date-utils.d.ts +16 -0
- package/dist/lib/date-utils.js +14 -0
- package/dist/lib/filter-types.cjs +161 -0
- package/dist/lib/filter-types.d.cts +60 -0
- package/dist/lib/filter-types.d.ts +60 -0
- package/dist/lib/filter-types.js +160 -0
- package/dist/lib/neutral-theme.cjs +238 -0
- package/dist/lib/neutral-theme.d.cts +92 -0
- package/dist/lib/neutral-theme.d.ts +92 -0
- package/dist/lib/neutral-theme.js +236 -0
- package/dist/lib/status-colors.cjs +18 -0
- package/dist/lib/status-colors.d.cts +76 -0
- package/dist/lib/status-colors.d.ts +76 -0
- package/dist/lib/status-colors.js +17 -0
- package/dist/lib/utils.cjs +9 -0
- package/dist/lib/utils.d.cts +9 -0
- package/dist/lib/utils.d.ts +9 -0
- package/dist/lib/utils.js +8 -0
- package/dist/primitives/activity-feed.cjs +177 -0
- package/dist/primitives/activity-feed.d.cts +78 -0
- package/dist/primitives/activity-feed.d.ts +78 -0
- package/dist/primitives/activity-feed.js +177 -0
- package/dist/primitives/activity-log.cjs +79 -0
- package/dist/primitives/activity-log.d.cts +55 -0
- package/dist/primitives/activity-log.d.ts +55 -0
- package/dist/primitives/activity-log.js +79 -0
- package/dist/primitives/agent-comment.cjs +39 -0
- package/dist/primitives/agent-comment.d.cts +33 -0
- package/dist/primitives/agent-comment.d.ts +33 -0
- package/dist/primitives/agent-comment.js +39 -0
- package/dist/primitives/alert-dialog.cjs +30 -0
- package/dist/primitives/alert-dialog.d.cts +23 -0
- package/dist/primitives/alert-dialog.d.ts +23 -0
- package/dist/primitives/alert-dialog.js +30 -0
- package/dist/primitives/alert.cjs +12 -0
- package/dist/primitives/alert.d.cts +26 -0
- package/dist/primitives/alert.d.ts +26 -0
- package/dist/primitives/alert.js +12 -0
- package/dist/primitives/anchor-target.cjs +13 -0
- package/dist/primitives/anchor-target.d.cts +7 -0
- package/dist/primitives/anchor-target.d.ts +7 -0
- package/dist/primitives/anchor-target.js +13 -0
- package/dist/primitives/anchor.cjs +35 -0
- package/dist/primitives/anchor.d.cts +16 -0
- package/dist/primitives/anchor.d.ts +16 -0
- package/dist/primitives/anchor.js +35 -0
- package/dist/primitives/archive-confirmation-dialog.cjs +50 -0
- package/dist/primitives/archive-confirmation-dialog.d.cts +12 -0
- package/dist/primitives/archive-confirmation-dialog.d.ts +12 -0
- package/dist/primitives/archive-confirmation-dialog.js +50 -0
- package/dist/primitives/aspect-ratio.cjs +8 -0
- package/dist/primitives/aspect-ratio.d.cts +6 -0
- package/dist/primitives/aspect-ratio.d.ts +6 -0
- package/dist/primitives/aspect-ratio.js +8 -0
- package/dist/primitives/attachment.cjs +203 -0
- package/dist/primitives/attachment.d.cts +28 -0
- package/dist/primitives/attachment.d.ts +28 -0
- package/dist/primitives/attachment.js +203 -0
- package/dist/primitives/avatar.cjs +12 -0
- package/dist/primitives/avatar.d.cts +22 -0
- package/dist/primitives/avatar.d.ts +22 -0
- package/dist/primitives/avatar.js +12 -0
- package/dist/primitives/badge.cjs +10 -0
- package/dist/primitives/badge.d.cts +27 -0
- package/dist/primitives/badge.d.ts +27 -0
- package/dist/primitives/badge.js +10 -0
- package/dist/primitives/board-view-internals.cjs +16 -0
- package/dist/primitives/board-view-internals.d.cts +33 -0
- package/dist/primitives/board-view-internals.d.ts +33 -0
- package/dist/primitives/board-view-internals.js +16 -0
- package/dist/primitives/board-view.cjs +108 -0
- package/dist/primitives/board-view.d.cts +39 -0
- package/dist/primitives/board-view.d.ts +39 -0
- package/dist/primitives/board-view.js +108 -0
- package/dist/primitives/browser-preview.cjs +62 -0
- package/dist/primitives/browser-preview.d.cts +41 -0
- package/dist/primitives/browser-preview.d.ts +41 -0
- package/dist/primitives/browser-preview.js +62 -0
- package/dist/primitives/button.cjs +10 -0
- package/dist/primitives/button.d.cts +32 -0
- package/dist/primitives/button.d.ts +32 -0
- package/dist/primitives/button.js +10 -0
- package/dist/primitives/calendar.cjs +11 -0
- package/dist/primitives/calendar.d.cts +13 -0
- package/dist/primitives/calendar.d.ts +13 -0
- package/dist/primitives/calendar.js +11 -0
- package/dist/primitives/call-card.cjs +195 -0
- package/dist/primitives/call-card.d.cts +86 -0
- package/dist/primitives/call-card.d.ts +86 -0
- package/dist/primitives/call-card.js +195 -0
- package/dist/primitives/callout.cjs +8 -0
- package/dist/primitives/callout.d.cts +41 -0
- package/dist/primitives/callout.d.ts +41 -0
- package/dist/primitives/callout.js +8 -0
- package/dist/primitives/card.cjs +18 -0
- package/dist/primitives/card.d.cts +55 -0
- package/dist/primitives/card.d.ts +55 -0
- package/dist/primitives/card.js +18 -0
- package/dist/primitives/checkbox.cjs +8 -0
- package/dist/primitives/checkbox.d.cts +20 -0
- package/dist/primitives/checkbox.d.ts +20 -0
- package/dist/primitives/checkbox.js +8 -0
- package/dist/primitives/chip-tabs.cjs +10 -0
- package/dist/primitives/chip-tabs.d.cts +39 -0
- package/dist/primitives/chip-tabs.d.ts +39 -0
- package/dist/primitives/chip-tabs.js +10 -0
- package/dist/primitives/code-block.cjs +56 -0
- package/dist/primitives/code-block.d.cts +35 -0
- package/dist/primitives/code-block.d.ts +35 -0
- package/dist/primitives/code-block.js +56 -0
- package/dist/primitives/collapsible-section.cjs +69 -0
- package/dist/primitives/collapsible-section.d.cts +24 -0
- package/dist/primitives/collapsible-section.d.ts +24 -0
- package/dist/primitives/collapsible-section.js +69 -0
- package/dist/primitives/collapsible.cjs +12 -0
- package/dist/primitives/collapsible.d.cts +14 -0
- package/dist/primitives/collapsible.d.ts +14 -0
- package/dist/primitives/collapsible.js +12 -0
- package/dist/primitives/compact-app-shell.cjs +40 -0
- package/dist/primitives/compact-app-shell.d.cts +12 -0
- package/dist/primitives/compact-app-shell.d.ts +12 -0
- package/dist/primitives/compact-app-shell.js +40 -0
- package/dist/primitives/compact-log.cjs +39 -0
- package/dist/primitives/compact-log.d.cts +19 -0
- package/dist/primitives/compact-log.d.ts +19 -0
- package/dist/primitives/compact-log.js +39 -0
- package/dist/primitives/confirm-bar.cjs +101 -0
- package/dist/primitives/confirm-bar.d.cts +60 -0
- package/dist/primitives/confirm-bar.d.ts +60 -0
- package/dist/primitives/confirm-bar.js +101 -0
- package/dist/primitives/connection-status-bar.cjs +243 -0
- package/dist/primitives/connection-status-bar.d.cts +52 -0
- package/dist/primitives/connection-status-bar.d.ts +52 -0
- package/dist/primitives/connection-status-bar.js +243 -0
- package/dist/primitives/connection.cjs +206 -0
- package/dist/primitives/connection.d.cts +126 -0
- package/dist/primitives/connection.d.ts +126 -0
- package/dist/primitives/connection.js +206 -0
- package/dist/primitives/contact-header.cjs +60 -0
- package/dist/primitives/contact-header.d.cts +54 -0
- package/dist/primitives/contact-header.d.ts +54 -0
- package/dist/primitives/contact-header.js +60 -0
- package/dist/primitives/copy-button.cjs +10 -0
- package/dist/primitives/copy-button.d.cts +21 -0
- package/dist/primitives/copy-button.d.ts +21 -0
- package/dist/primitives/copy-button.js +10 -0
- package/dist/primitives/count-badge.cjs +9 -0
- package/dist/primitives/count-badge.d.cts +21 -0
- package/dist/primitives/count-badge.d.ts +21 -0
- package/dist/primitives/count-badge.js +9 -0
- package/dist/primitives/decision-actions.cjs +66 -0
- package/dist/primitives/decision-actions.d.cts +31 -0
- package/dist/primitives/decision-actions.d.ts +31 -0
- package/dist/primitives/decision-actions.js +66 -0
- package/dist/primitives/definition-list.cjs +65 -0
- package/dist/primitives/definition-list.d.cts +23 -0
- package/dist/primitives/definition-list.d.ts +23 -0
- package/dist/primitives/definition-list.js +65 -0
- package/dist/primitives/delete-confirmation-dialog.cjs +11 -0
- package/dist/primitives/delete-confirmation-dialog.d.cts +23 -0
- package/dist/primitives/delete-confirmation-dialog.d.ts +23 -0
- package/dist/primitives/delete-confirmation-dialog.js +11 -0
- package/dist/primitives/dialog.cjs +26 -0
- package/dist/primitives/dialog.d.cts +44 -0
- package/dist/primitives/dialog.d.ts +44 -0
- package/dist/primitives/dialog.js +26 -0
- package/dist/primitives/drawer.cjs +26 -0
- package/dist/primitives/drawer.d.cts +36 -0
- package/dist/primitives/drawer.d.ts +36 -0
- package/dist/primitives/drawer.js +26 -0
- package/dist/primitives/dropdown-menu.cjs +36 -0
- package/dist/primitives/dropdown-menu.d.cts +34 -0
- package/dist/primitives/dropdown-menu.d.ts +34 -0
- package/dist/primitives/dropdown-menu.js +36 -0
- package/dist/primitives/editable-list.cjs +108 -0
- package/dist/primitives/editable-list.d.cts +23 -0
- package/dist/primitives/editable-list.d.ts +23 -0
- package/dist/primitives/editable-list.js +108 -0
- package/dist/primitives/empty-state.cjs +9 -0
- package/dist/primitives/empty-state.d.cts +54 -0
- package/dist/primitives/empty-state.d.ts +54 -0
- package/dist/primitives/empty-state.js +9 -0
- package/dist/primitives/eyebrow.cjs +8 -0
- package/dist/primitives/eyebrow.d.cts +21 -0
- package/dist/primitives/eyebrow.d.ts +21 -0
- package/dist/primitives/eyebrow.js +8 -0
- package/dist/primitives/feature-empty-state.cjs +133 -0
- package/dist/primitives/feature-empty-state.d.cts +42 -0
- package/dist/primitives/feature-empty-state.d.ts +42 -0
- package/dist/primitives/feature-empty-state.js +133 -0
- package/dist/primitives/field.cjs +260 -0
- package/dist/primitives/field.d.cts +43 -0
- package/dist/primitives/field.d.ts +43 -0
- package/dist/primitives/field.js +260 -0
- package/dist/primitives/file-dropzone.cjs +118 -0
- package/dist/primitives/file-dropzone.d.cts +36 -0
- package/dist/primitives/file-dropzone.d.ts +36 -0
- package/dist/primitives/file-dropzone.js +118 -0
- package/dist/primitives/filter-bar.cjs +20 -0
- package/dist/primitives/filter-bar.d.cts +25 -0
- package/dist/primitives/filter-bar.d.ts +25 -0
- package/dist/primitives/filter-bar.js +20 -0
- package/dist/primitives/flex-item.cjs +34 -0
- package/dist/primitives/flex-item.d.cts +18 -0
- package/dist/primitives/flex-item.d.ts +18 -0
- package/dist/primitives/flex-item.js +34 -0
- package/dist/primitives/grid.cjs +47 -0
- package/dist/primitives/grid.d.cts +18 -0
- package/dist/primitives/grid.d.ts +18 -0
- package/dist/primitives/grid.js +47 -0
- package/dist/primitives/heading.cjs +8 -0
- package/dist/primitives/heading.d.cts +28 -0
- package/dist/primitives/heading.d.ts +28 -0
- package/dist/primitives/heading.js +8 -0
- package/dist/primitives/hidden-control.cjs +13 -0
- package/dist/primitives/hidden-control.d.cts +7 -0
- package/dist/primitives/hidden-control.d.ts +7 -0
- package/dist/primitives/hidden-control.js +13 -0
- package/dist/primitives/icon.cjs +8 -0
- package/dist/primitives/icon.d.cts +22 -0
- package/dist/primitives/icon.d.ts +22 -0
- package/dist/primitives/icon.js +8 -0
- package/dist/primitives/image.cjs +52 -0
- package/dist/primitives/image.d.cts +21 -0
- package/dist/primitives/image.d.ts +21 -0
- package/dist/primitives/image.js +52 -0
- package/dist/primitives/inline-code.cjs +34 -0
- package/dist/primitives/inline-code.d.cts +15 -0
- package/dist/primitives/inline-code.d.ts +15 -0
- package/dist/primitives/inline-code.js +34 -0
- package/dist/primitives/input.cjs +8 -0
- package/dist/primitives/input.d.cts +23 -0
- package/dist/primitives/input.d.ts +23 -0
- package/dist/primitives/input.js +8 -0
- package/dist/primitives/inset.cjs +20 -0
- package/dist/primitives/inset.d.cts +12 -0
- package/dist/primitives/inset.d.ts +12 -0
- package/dist/primitives/inset.js +20 -0
- package/dist/primitives/interactive-card.cjs +11 -0
- package/dist/primitives/interactive-card.d.cts +68 -0
- package/dist/primitives/interactive-card.d.ts +68 -0
- package/dist/primitives/interactive-card.js +11 -0
- package/dist/primitives/label.cjs +8 -0
- package/dist/primitives/label.d.cts +12 -0
- package/dist/primitives/label.d.ts +12 -0
- package/dist/primitives/label.js +8 -0
- package/dist/primitives/line-break.cjs +10 -0
- package/dist/primitives/line-break.d.cts +6 -0
- package/dist/primitives/line-break.d.ts +6 -0
- package/dist/primitives/line-break.js +10 -0
- package/dist/primitives/list.cjs +68 -0
- package/dist/primitives/list.d.cts +35 -0
- package/dist/primitives/list.d.ts +35 -0
- package/dist/primitives/list.js +68 -0
- package/dist/primitives/load-more-button.cjs +10 -0
- package/dist/primitives/load-more-button.d.cts +42 -0
- package/dist/primitives/load-more-button.d.ts +42 -0
- package/dist/primitives/load-more-button.js +10 -0
- package/dist/primitives/loading.cjs +10 -0
- package/dist/primitives/loading.d.cts +5 -0
- package/dist/primitives/loading.d.ts +5 -0
- package/dist/primitives/loading.js +10 -0
- package/dist/primitives/message.cjs +95 -0
- package/dist/primitives/message.d.cts +13 -0
- package/dist/primitives/message.d.ts +13 -0
- package/dist/primitives/message.js +95 -0
- package/dist/primitives/native-select.cjs +33 -0
- package/dist/primitives/native-select.d.cts +15 -0
- package/dist/primitives/native-select.d.ts +15 -0
- package/dist/primitives/native-select.js +33 -0
- package/dist/primitives/page-header-actions.cjs +11 -0
- package/dist/primitives/page-header-actions.d.cts +49 -0
- package/dist/primitives/page-header-actions.d.ts +49 -0
- package/dist/primitives/page-header-actions.js +11 -0
- package/dist/primitives/page-header.cjs +72 -0
- package/dist/primitives/page-header.d.cts +40 -0
- package/dist/primitives/page-header.d.ts +40 -0
- package/dist/primitives/page-header.js +72 -0
- package/dist/primitives/page-shell.cjs +46 -0
- package/dist/primitives/page-shell.d.cts +44 -0
- package/dist/primitives/page-shell.d.ts +44 -0
- package/dist/primitives/page-shell.js +46 -0
- package/dist/primitives/page-tabs.cjs +63 -0
- package/dist/primitives/page-tabs.d.cts +28 -0
- package/dist/primitives/page-tabs.d.ts +28 -0
- package/dist/primitives/page-tabs.js +63 -0
- package/dist/primitives/panel-section.cjs +52 -0
- package/dist/primitives/panel-section.d.cts +20 -0
- package/dist/primitives/panel-section.d.ts +20 -0
- package/dist/primitives/panel-section.js +52 -0
- package/dist/primitives/person-avatar.cjs +57 -0
- package/dist/primitives/person-avatar.d.cts +33 -0
- package/dist/primitives/person-avatar.d.ts +33 -0
- package/dist/primitives/person-avatar.js +57 -0
- package/dist/primitives/phone.cjs +69 -0
- package/dist/primitives/phone.d.cts +50 -0
- package/dist/primitives/phone.d.ts +50 -0
- package/dist/primitives/phone.js +69 -0
- package/dist/primitives/popover.cjs +12 -0
- package/dist/primitives/popover.d.cts +14 -0
- package/dist/primitives/popover.d.ts +14 -0
- package/dist/primitives/popover.js +12 -0
- package/dist/primitives/progress.cjs +31 -0
- package/dist/primitives/progress.d.cts +6 -0
- package/dist/primitives/progress.d.ts +6 -0
- package/dist/primitives/progress.js +31 -0
- package/dist/primitives/quick-filters.cjs +10 -0
- package/dist/primitives/quick-filters.d.cts +36 -0
- package/dist/primitives/quick-filters.d.ts +36 -0
- package/dist/primitives/quick-filters.js +10 -0
- package/dist/primitives/radio-group.cjs +46 -0
- package/dist/primitives/radio-group.d.cts +7 -0
- package/dist/primitives/radio-group.d.ts +7 -0
- package/dist/primitives/radio-group.js +46 -0
- package/dist/primitives/resource-card.cjs +104 -0
- package/dist/primitives/resource-card.d.cts +93 -0
- package/dist/primitives/resource-card.d.ts +93 -0
- package/dist/primitives/resource-card.js +104 -0
- package/dist/primitives/resource-list.cjs +28 -0
- package/dist/primitives/resource-list.d.cts +103 -0
- package/dist/primitives/resource-list.d.ts +103 -0
- package/dist/primitives/resource-list.js +28 -0
- package/dist/primitives/responsive-dialog.cjs +142 -0
- package/dist/primitives/responsive-dialog.d.cts +56 -0
- package/dist/primitives/responsive-dialog.d.ts +56 -0
- package/dist/primitives/responsive-dialog.js +142 -0
- package/dist/primitives/responsive-view.cjs +29 -0
- package/dist/primitives/responsive-view.d.cts +10 -0
- package/dist/primitives/responsive-view.d.ts +10 -0
- package/dist/primitives/responsive-view.js +29 -0
- package/dist/primitives/rich-text.cjs +43 -0
- package/dist/primitives/rich-text.d.cts +14 -0
- package/dist/primitives/rich-text.d.ts +14 -0
- package/dist/primitives/rich-text.js +43 -0
- package/dist/primitives/scroll-area.cjs +10 -0
- package/dist/primitives/scroll-area.d.cts +13 -0
- package/dist/primitives/scroll-area.d.ts +13 -0
- package/dist/primitives/scroll-area.js +10 -0
- package/dist/primitives/section-header.cjs +51 -0
- package/dist/primitives/section-header.d.cts +22 -0
- package/dist/primitives/section-header.d.ts +22 -0
- package/dist/primitives/section-header.js +51 -0
- package/dist/primitives/section.cjs +39 -0
- package/dist/primitives/section.d.cts +22 -0
- package/dist/primitives/section.d.ts +22 -0
- package/dist/primitives/section.js +39 -0
- package/dist/primitives/select.cjs +26 -0
- package/dist/primitives/select.d.cts +25 -0
- package/dist/primitives/select.d.ts +25 -0
- package/dist/primitives/select.js +26 -0
- package/dist/primitives/selection-overlay.cjs +24 -0
- package/dist/primitives/selection-overlay.d.cts +7 -0
- package/dist/primitives/selection-overlay.d.ts +7 -0
- package/dist/primitives/selection-overlay.js +24 -0
- package/dist/primitives/sentiment-dot.cjs +15 -0
- package/dist/primitives/sentiment-dot.d.cts +42 -0
- package/dist/primitives/sentiment-dot.d.ts +42 -0
- package/dist/primitives/sentiment-dot.js +15 -0
- package/dist/primitives/separator.cjs +8 -0
- package/dist/primitives/separator.d.cts +9 -0
- package/dist/primitives/separator.d.ts +9 -0
- package/dist/primitives/separator.js +8 -0
- package/dist/primitives/sheet.cjs +27 -0
- package/dist/primitives/sheet.d.cts +48 -0
- package/dist/primitives/sheet.d.ts +48 -0
- package/dist/primitives/sheet.js +27 -0
- package/dist/primitives/skeleton.cjs +8 -0
- package/dist/primitives/skeleton.d.cts +15 -0
- package/dist/primitives/skeleton.d.ts +15 -0
- package/dist/primitives/skeleton.js +8 -0
- package/dist/primitives/spacer.cjs +20 -0
- package/dist/primitives/spacer.d.cts +11 -0
- package/dist/primitives/spacer.d.ts +11 -0
- package/dist/primitives/spacer.js +20 -0
- package/dist/primitives/split-action-button.cjs +95 -0
- package/dist/primitives/split-action-button.d.cts +41 -0
- package/dist/primitives/split-action-button.d.ts +41 -0
- package/dist/primitives/split-action-button.js +95 -0
- package/dist/primitives/stack.cjs +8 -0
- package/dist/primitives/stack.d.cts +63 -0
- package/dist/primitives/stack.d.ts +63 -0
- package/dist/primitives/stack.js +8 -0
- package/dist/primitives/status-badge.cjs +9 -0
- package/dist/primitives/status-badge.d.cts +20 -0
- package/dist/primitives/status-badge.d.ts +20 -0
- package/dist/primitives/status-badge.js +9 -0
- package/dist/primitives/status-icon-tile.cjs +32 -0
- package/dist/primitives/status-icon-tile.d.cts +12 -0
- package/dist/primitives/status-icon-tile.d.ts +12 -0
- package/dist/primitives/status-icon-tile.js +32 -0
- package/dist/primitives/status-icon.cjs +8 -0
- package/dist/primitives/status-icon.d.cts +18 -0
- package/dist/primitives/status-icon.d.ts +18 -0
- package/dist/primitives/status-icon.js +8 -0
- package/dist/primitives/status-panel.cjs +83 -0
- package/dist/primitives/status-panel.d.cts +25 -0
- package/dist/primitives/status-panel.d.ts +25 -0
- package/dist/primitives/status-panel.js +83 -0
- package/dist/primitives/switch-field.cjs +44 -0
- package/dist/primitives/switch-field.d.cts +17 -0
- package/dist/primitives/switch-field.d.ts +17 -0
- package/dist/primitives/switch-field.js +44 -0
- package/dist/primitives/switch.cjs +8 -0
- package/dist/primitives/switch.d.cts +6 -0
- package/dist/primitives/switch.d.ts +6 -0
- package/dist/primitives/switch.js +8 -0
- package/dist/primitives/tabs.cjs +14 -0
- package/dist/primitives/tabs.d.cts +36 -0
- package/dist/primitives/tabs.d.ts +36 -0
- package/dist/primitives/tabs.js +14 -0
- package/dist/primitives/tag-input.cjs +90 -0
- package/dist/primitives/tag-input.d.cts +13 -0
- package/dist/primitives/tag-input.d.ts +13 -0
- package/dist/primitives/tag-input.js +90 -0
- package/dist/primitives/text.cjs +8 -0
- package/dist/primitives/text.d.cts +51 -0
- package/dist/primitives/text.d.ts +51 -0
- package/dist/primitives/text.js +8 -0
- package/dist/primitives/textarea.cjs +37 -0
- package/dist/primitives/textarea.d.cts +12 -0
- package/dist/primitives/textarea.d.ts +12 -0
- package/dist/primitives/textarea.js +37 -0
- package/dist/primitives/thinking-screen.cjs +87 -0
- package/dist/primitives/thinking-screen.d.cts +46 -0
- package/dist/primitives/thinking-screen.d.ts +46 -0
- package/dist/primitives/thinking-screen.js +87 -0
- package/dist/primitives/timeline.cjs +13 -0
- package/dist/primitives/timeline.d.cts +54 -0
- package/dist/primitives/timeline.d.ts +54 -0
- package/dist/primitives/timeline.js +13 -0
- package/dist/primitives/toggle-group.cjs +51 -0
- package/dist/primitives/toggle-group.d.cts +18 -0
- package/dist/primitives/toggle-group.d.ts +18 -0
- package/dist/primitives/toggle-group.js +51 -0
- package/dist/primitives/toggle.cjs +10 -0
- package/dist/primitives/toggle.d.cts +15 -0
- package/dist/primitives/toggle.d.ts +15 -0
- package/dist/primitives/toggle.js +10 -0
- package/dist/primitives/tooltip.cjs +14 -0
- package/dist/primitives/tooltip.d.cts +9 -0
- package/dist/primitives/tooltip.d.ts +9 -0
- package/dist/primitives/tooltip.js +14 -0
- package/dist/primitives/voice-dictation-button.cjs +244 -0
- package/dist/primitives/voice-dictation-button.d.cts +41 -0
- package/dist/primitives/voice-dictation-button.d.ts +41 -0
- package/dist/primitives/voice-dictation-button.js +244 -0
- package/package.json +1243 -3
- package/src/styles/components/attachment.css +61 -0
- package/src/styles/components/message.css +29 -0
- package/src/styles/components.css +3 -0
- package/src/styles/globals.css +10 -0
- package/src/styles/keyframes.css +26 -0
- package/src/styles/palette.gen.css +150 -0
- package/src/styles/shadcn.css +631 -0
- package/src/styles/source.css +4 -0
- package/src/styles/tokens/base.css +36 -0
- package/src/styles/tokens/container.css +9 -0
- package/src/styles/tokens/forms.css +61 -0
- package/src/styles/tokens/theme.css +93 -0
- package/src/styles/tokens.css +17 -0
- package/src/styles/utilities.css +9 -0
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
type FilterType = "enum" | "text" | "date" | "daterange" | "numberrange" | "boolean" | "number" | "multiselect" | "searchable-tags";
|
|
2
|
+
interface FilterOption {
|
|
3
|
+
value: string;
|
|
4
|
+
label: string;
|
|
5
|
+
}
|
|
6
|
+
type FilterTransform = "eq" | "like" | "range" | "null" | "stock";
|
|
7
|
+
interface FilterDefinition {
|
|
8
|
+
id: string;
|
|
9
|
+
label: string;
|
|
10
|
+
type: FilterType;
|
|
11
|
+
field: string;
|
|
12
|
+
placeholder?: string;
|
|
13
|
+
options?: FilterOption[];
|
|
14
|
+
icon?: any;
|
|
15
|
+
multiple?: boolean;
|
|
16
|
+
transform?: FilterTransform;
|
|
17
|
+
transformMap?: Record<string, any>;
|
|
18
|
+
/**
|
|
19
|
+
* Checkbox is the default for true-only flags: unchecked removes the filter.
|
|
20
|
+
* Tri-state renders Any / Yes / No when false is a meaningful query value.
|
|
21
|
+
*/
|
|
22
|
+
booleanMode?: "checkbox" | "tri-state";
|
|
23
|
+
trueLabel?: string;
|
|
24
|
+
falseLabel?: string;
|
|
25
|
+
}
|
|
26
|
+
interface GraphQLFilterInput {
|
|
27
|
+
[key: string]: {
|
|
28
|
+
eq?: string | number | boolean;
|
|
29
|
+
like?: string;
|
|
30
|
+
in?: string[];
|
|
31
|
+
gt?: string | number;
|
|
32
|
+
gte?: string | number;
|
|
33
|
+
lt?: string | number;
|
|
34
|
+
lte?: string | number;
|
|
35
|
+
isNull?: boolean;
|
|
36
|
+
isNotNull?: boolean;
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Transform UI filters to GraphQL filter variables
|
|
41
|
+
*/
|
|
42
|
+
declare function transformFiltersToVariables(filters: Record<string, any>, filterSchema: FilterDefinition[]): GraphQLFilterInput;
|
|
43
|
+
/**
|
|
44
|
+
* Get active filter count
|
|
45
|
+
*/
|
|
46
|
+
declare function getActiveFilterCount(filters: Record<string, any>): number;
|
|
47
|
+
/**
|
|
48
|
+
* Clear all filters
|
|
49
|
+
*/
|
|
50
|
+
declare function clearFilters(): Record<string, any>;
|
|
51
|
+
/**
|
|
52
|
+
* Check if a filter is active
|
|
53
|
+
*/
|
|
54
|
+
declare function isFilterActive(filters: Record<string, any>, filterId: string): boolean;
|
|
55
|
+
/**
|
|
56
|
+
* Get filter display value for badges/chips
|
|
57
|
+
*/
|
|
58
|
+
declare function getFilterDisplayValue(filters: Record<string, any>, filterSchema: FilterDefinition[], filterId: string): string | null;
|
|
59
|
+
|
|
60
|
+
export { type FilterDefinition, type FilterOption, type FilterTransform, type FilterType, type GraphQLFilterInput, clearFilters, getActiveFilterCount, getFilterDisplayValue, isFilterActive, transformFiltersToVariables };
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
type FilterType = "enum" | "text" | "date" | "daterange" | "numberrange" | "boolean" | "number" | "multiselect" | "searchable-tags";
|
|
2
|
+
interface FilterOption {
|
|
3
|
+
value: string;
|
|
4
|
+
label: string;
|
|
5
|
+
}
|
|
6
|
+
type FilterTransform = "eq" | "like" | "range" | "null" | "stock";
|
|
7
|
+
interface FilterDefinition {
|
|
8
|
+
id: string;
|
|
9
|
+
label: string;
|
|
10
|
+
type: FilterType;
|
|
11
|
+
field: string;
|
|
12
|
+
placeholder?: string;
|
|
13
|
+
options?: FilterOption[];
|
|
14
|
+
icon?: any;
|
|
15
|
+
multiple?: boolean;
|
|
16
|
+
transform?: FilterTransform;
|
|
17
|
+
transformMap?: Record<string, any>;
|
|
18
|
+
/**
|
|
19
|
+
* Checkbox is the default for true-only flags: unchecked removes the filter.
|
|
20
|
+
* Tri-state renders Any / Yes / No when false is a meaningful query value.
|
|
21
|
+
*/
|
|
22
|
+
booleanMode?: "checkbox" | "tri-state";
|
|
23
|
+
trueLabel?: string;
|
|
24
|
+
falseLabel?: string;
|
|
25
|
+
}
|
|
26
|
+
interface GraphQLFilterInput {
|
|
27
|
+
[key: string]: {
|
|
28
|
+
eq?: string | number | boolean;
|
|
29
|
+
like?: string;
|
|
30
|
+
in?: string[];
|
|
31
|
+
gt?: string | number;
|
|
32
|
+
gte?: string | number;
|
|
33
|
+
lt?: string | number;
|
|
34
|
+
lte?: string | number;
|
|
35
|
+
isNull?: boolean;
|
|
36
|
+
isNotNull?: boolean;
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Transform UI filters to GraphQL filter variables
|
|
41
|
+
*/
|
|
42
|
+
declare function transformFiltersToVariables(filters: Record<string, any>, filterSchema: FilterDefinition[]): GraphQLFilterInput;
|
|
43
|
+
/**
|
|
44
|
+
* Get active filter count
|
|
45
|
+
*/
|
|
46
|
+
declare function getActiveFilterCount(filters: Record<string, any>): number;
|
|
47
|
+
/**
|
|
48
|
+
* Clear all filters
|
|
49
|
+
*/
|
|
50
|
+
declare function clearFilters(): Record<string, any>;
|
|
51
|
+
/**
|
|
52
|
+
* Check if a filter is active
|
|
53
|
+
*/
|
|
54
|
+
declare function isFilterActive(filters: Record<string, any>, filterId: string): boolean;
|
|
55
|
+
/**
|
|
56
|
+
* Get filter display value for badges/chips
|
|
57
|
+
*/
|
|
58
|
+
declare function getFilterDisplayValue(filters: Record<string, any>, filterSchema: FilterDefinition[], filterId: string): string | null;
|
|
59
|
+
|
|
60
|
+
export { type FilterDefinition, type FilterOption, type FilterTransform, type FilterType, type GraphQLFilterInput, clearFilters, getActiveFilterCount, getFilterDisplayValue, isFilterActive, transformFiltersToVariables };
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
import {
|
|
2
|
+
formatDateOnly
|
|
3
|
+
} from "../chunk-CS7DM3NV.js";
|
|
4
|
+
|
|
5
|
+
// src/lib/filter-types.ts
|
|
6
|
+
function toDateString(value) {
|
|
7
|
+
if (!value) return null;
|
|
8
|
+
let d;
|
|
9
|
+
if (value instanceof Date) {
|
|
10
|
+
d = value;
|
|
11
|
+
} else if (typeof value === "string") {
|
|
12
|
+
if (/^\d{4}-\d{2}-\d{2}$/.test(value)) return value;
|
|
13
|
+
d = new Date(value);
|
|
14
|
+
} else {
|
|
15
|
+
return null;
|
|
16
|
+
}
|
|
17
|
+
if (isNaN(d.getTime())) return null;
|
|
18
|
+
return d.toISOString().split("T")[0] ?? null;
|
|
19
|
+
}
|
|
20
|
+
function transformFiltersToVariables(filters, filterSchema) {
|
|
21
|
+
const graphqlFilters = {};
|
|
22
|
+
for (const [filterId, value] of Object.entries(filters)) {
|
|
23
|
+
if (value === void 0 || value === null || value === "") {
|
|
24
|
+
continue;
|
|
25
|
+
}
|
|
26
|
+
const filterDef = filterSchema.find((f) => f.id === filterId);
|
|
27
|
+
if (!filterDef) continue;
|
|
28
|
+
const field = filterDef.field;
|
|
29
|
+
switch (filterDef.type) {
|
|
30
|
+
case "enum":
|
|
31
|
+
if (value) {
|
|
32
|
+
if (filterDef.transformMap && filterDef.transformMap[value]) {
|
|
33
|
+
graphqlFilters[field] = filterDef.transformMap[value];
|
|
34
|
+
} else {
|
|
35
|
+
graphqlFilters[field] = { eq: value };
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
break;
|
|
39
|
+
case "multiselect":
|
|
40
|
+
if (Array.isArray(value) && value.length > 0) {
|
|
41
|
+
graphqlFilters[field] = { in: value };
|
|
42
|
+
}
|
|
43
|
+
break;
|
|
44
|
+
case "text":
|
|
45
|
+
if (value && typeof value === "string") {
|
|
46
|
+
graphqlFilters[field] = { like: value };
|
|
47
|
+
}
|
|
48
|
+
break;
|
|
49
|
+
case "date":
|
|
50
|
+
if (value) {
|
|
51
|
+
if (typeof value === "object" && (value.start || value.from)) {
|
|
52
|
+
const rangeStart = value.start ?? value.from;
|
|
53
|
+
const rangeEnd = value.end ?? value.to;
|
|
54
|
+
const startDate = toDateString(rangeStart);
|
|
55
|
+
if (startDate && rangeEnd) {
|
|
56
|
+
const endDate = toDateString(rangeEnd);
|
|
57
|
+
if (endDate) {
|
|
58
|
+
graphqlFilters[field] = { gte: startDate, lte: endDate };
|
|
59
|
+
} else {
|
|
60
|
+
graphqlFilters[field] = { gte: startDate };
|
|
61
|
+
}
|
|
62
|
+
} else if (startDate) {
|
|
63
|
+
graphqlFilters[field] = { gte: startDate };
|
|
64
|
+
}
|
|
65
|
+
} else {
|
|
66
|
+
const dateString = toDateString(value);
|
|
67
|
+
if (dateString) {
|
|
68
|
+
graphqlFilters[field] = { eq: dateString };
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
break;
|
|
73
|
+
case "daterange":
|
|
74
|
+
if (value && typeof value === "object") {
|
|
75
|
+
const rangeFrom = value.from ?? value.start;
|
|
76
|
+
const rangeTo = value.to ?? value.end;
|
|
77
|
+
const fromStr = toDateString(rangeFrom);
|
|
78
|
+
if (fromStr) {
|
|
79
|
+
const toStr = toDateString(rangeTo);
|
|
80
|
+
if (toStr) {
|
|
81
|
+
graphqlFilters[field] = { gte: fromStr, lte: toStr };
|
|
82
|
+
} else {
|
|
83
|
+
graphqlFilters[field] = { gte: fromStr };
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
break;
|
|
88
|
+
case "boolean":
|
|
89
|
+
if (typeof value === "boolean") {
|
|
90
|
+
graphqlFilters[field] = { eq: value };
|
|
91
|
+
}
|
|
92
|
+
break;
|
|
93
|
+
case "number":
|
|
94
|
+
if (typeof value === "number") {
|
|
95
|
+
graphqlFilters[field] = { eq: value };
|
|
96
|
+
}
|
|
97
|
+
break;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
return graphqlFilters;
|
|
101
|
+
}
|
|
102
|
+
function getActiveFilterCount(filters) {
|
|
103
|
+
return Object.values(filters).filter(
|
|
104
|
+
(value) => value !== void 0 && value !== "" && value !== null && !(Array.isArray(value) && value.length === 0)
|
|
105
|
+
).length;
|
|
106
|
+
}
|
|
107
|
+
function clearFilters() {
|
|
108
|
+
return {};
|
|
109
|
+
}
|
|
110
|
+
function isFilterActive(filters, filterId) {
|
|
111
|
+
const value = filters[filterId];
|
|
112
|
+
return value !== void 0 && value !== "" && value !== null && !(Array.isArray(value) && value.length === 0);
|
|
113
|
+
}
|
|
114
|
+
function getFilterDisplayValue(filters, filterSchema, filterId) {
|
|
115
|
+
const value = filters[filterId];
|
|
116
|
+
const filterDef = filterSchema.find((f) => f.id === filterId);
|
|
117
|
+
if (!filterDef || !value) return null;
|
|
118
|
+
switch (filterDef.type) {
|
|
119
|
+
case "enum": {
|
|
120
|
+
const option = filterDef.options?.find((opt) => opt.value === value);
|
|
121
|
+
return option?.label || value;
|
|
122
|
+
}
|
|
123
|
+
case "multiselect":
|
|
124
|
+
if (Array.isArray(value)) {
|
|
125
|
+
return value.map((v) => {
|
|
126
|
+
const option = filterDef.options?.find((opt) => opt.value === v);
|
|
127
|
+
return option?.label || v;
|
|
128
|
+
}).join(", ");
|
|
129
|
+
}
|
|
130
|
+
return null;
|
|
131
|
+
case "text":
|
|
132
|
+
return value;
|
|
133
|
+
case "date":
|
|
134
|
+
case "daterange": {
|
|
135
|
+
const rangeStart = value?.start ?? value?.from;
|
|
136
|
+
const rangeEnd = value?.end ?? value?.to;
|
|
137
|
+
if (rangeStart && rangeEnd) {
|
|
138
|
+
const startStr = rangeStart instanceof Date ? formatDateOnly(rangeStart) : rangeStart;
|
|
139
|
+
const endStr = rangeEnd instanceof Date ? formatDateOnly(rangeEnd) : rangeEnd;
|
|
140
|
+
return `${startStr} \u2013 ${endStr}`;
|
|
141
|
+
} else if (rangeStart) {
|
|
142
|
+
return rangeStart instanceof Date ? formatDateOnly(rangeStart) : rangeStart;
|
|
143
|
+
} else if (value instanceof Date) {
|
|
144
|
+
return formatDateOnly(value);
|
|
145
|
+
}
|
|
146
|
+
return value;
|
|
147
|
+
}
|
|
148
|
+
case "boolean":
|
|
149
|
+
return value ? "Yes" : "No";
|
|
150
|
+
default:
|
|
151
|
+
return String(value);
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
export {
|
|
155
|
+
clearFilters,
|
|
156
|
+
getActiveFilterCount,
|
|
157
|
+
getFilterDisplayValue,
|
|
158
|
+
isFilterActive,
|
|
159
|
+
transformFiltersToVariables
|
|
160
|
+
};
|
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
|
|
2
|
+
|
|
3
|
+
// src/lib/neutral-theme.ts
|
|
4
|
+
var SEMANTIC_TOKENS = [
|
|
5
|
+
"background",
|
|
6
|
+
"foreground",
|
|
7
|
+
"card",
|
|
8
|
+
"card-foreground",
|
|
9
|
+
"popover",
|
|
10
|
+
"popover-foreground",
|
|
11
|
+
"primary",
|
|
12
|
+
"primary-foreground",
|
|
13
|
+
"secondary",
|
|
14
|
+
"secondary-foreground",
|
|
15
|
+
"muted",
|
|
16
|
+
"muted-foreground",
|
|
17
|
+
"accent",
|
|
18
|
+
"accent-foreground",
|
|
19
|
+
"destructive",
|
|
20
|
+
"destructive-foreground",
|
|
21
|
+
"border",
|
|
22
|
+
"input",
|
|
23
|
+
"ring",
|
|
24
|
+
"chart-1",
|
|
25
|
+
"chart-2",
|
|
26
|
+
"chart-3",
|
|
27
|
+
"chart-4",
|
|
28
|
+
"chart-5",
|
|
29
|
+
"sidebar-background",
|
|
30
|
+
"sidebar-foreground",
|
|
31
|
+
"sidebar-primary",
|
|
32
|
+
"sidebar-primary-foreground",
|
|
33
|
+
"sidebar-accent",
|
|
34
|
+
"sidebar-accent-foreground",
|
|
35
|
+
"sidebar-border",
|
|
36
|
+
"sidebar-ring"
|
|
37
|
+
];
|
|
38
|
+
function hexToRgb(hex) {
|
|
39
|
+
const h = hex.replace("#", "").trim();
|
|
40
|
+
const full = h.length === 3 ? h.split("").map((c) => c + c).join("") : h;
|
|
41
|
+
if (!/^[0-9a-fA-F]{6}$/.test(full)) {
|
|
42
|
+
throw new Error(`Not a hex colour: ${hex}`);
|
|
43
|
+
}
|
|
44
|
+
return [
|
|
45
|
+
parseInt(full.slice(0, 2), 16),
|
|
46
|
+
parseInt(full.slice(2, 4), 16),
|
|
47
|
+
parseInt(full.slice(4, 6), 16)
|
|
48
|
+
];
|
|
49
|
+
}
|
|
50
|
+
function hexToHsl(hex) {
|
|
51
|
+
const [r255, g255, b255] = hexToRgb(hex);
|
|
52
|
+
const r = r255 / 255;
|
|
53
|
+
const g = g255 / 255;
|
|
54
|
+
const b = b255 / 255;
|
|
55
|
+
const max = Math.max(r, g, b);
|
|
56
|
+
const min = Math.min(r, g, b);
|
|
57
|
+
const l = (max + min) / 2;
|
|
58
|
+
const d = max - min;
|
|
59
|
+
let h = 0;
|
|
60
|
+
let s = 0;
|
|
61
|
+
if (d !== 0) {
|
|
62
|
+
s = d / (1 - Math.abs(2 * l - 1));
|
|
63
|
+
if (max === r) h = (g - b) / d % 6;
|
|
64
|
+
else if (max === g) h = (b - r) / d + 2;
|
|
65
|
+
else h = (r - g) / d + 4;
|
|
66
|
+
h *= 60;
|
|
67
|
+
if (h < 0) h += 360;
|
|
68
|
+
}
|
|
69
|
+
const round = (n) => Math.round(n * 10) / 10;
|
|
70
|
+
return `${round(h)} ${round(s * 100)}% ${round(l * 100)}%`;
|
|
71
|
+
}
|
|
72
|
+
function luminance(hex) {
|
|
73
|
+
const [r, g, b] = hexToRgb(hex).map((v) => {
|
|
74
|
+
const c = v / 255;
|
|
75
|
+
return c <= 0.03928 ? c / 12.92 : Math.pow((c + 0.055) / 1.055, 2.4);
|
|
76
|
+
});
|
|
77
|
+
return 0.2126 * r + 0.7152 * g + 0.0722 * b;
|
|
78
|
+
}
|
|
79
|
+
function contrastRatio(a, b) {
|
|
80
|
+
const la = luminance(a);
|
|
81
|
+
const lb = luminance(b);
|
|
82
|
+
const [hi, lo] = la > lb ? [la, lb] : [lb, la];
|
|
83
|
+
return (hi + 0.05) / (lo + 0.05);
|
|
84
|
+
}
|
|
85
|
+
function bestForeground(bg, candidates) {
|
|
86
|
+
let best = candidates[0];
|
|
87
|
+
let bestRatio = 0;
|
|
88
|
+
for (const c of candidates) {
|
|
89
|
+
const ratio = contrastRatio(bg, c);
|
|
90
|
+
if (ratio > bestRatio) {
|
|
91
|
+
best = c;
|
|
92
|
+
bestRatio = ratio;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
return best;
|
|
96
|
+
}
|
|
97
|
+
var NEUTRAL_RADIUS = "0rem";
|
|
98
|
+
function neutral(mode) {
|
|
99
|
+
const light = mode === "light";
|
|
100
|
+
const danger = "#d71921";
|
|
101
|
+
const mono = light ? {
|
|
102
|
+
bg: "#ffffff",
|
|
103
|
+
fg: "#000000",
|
|
104
|
+
surface: "#f5f5f5",
|
|
105
|
+
subtle: "#666666",
|
|
106
|
+
border: "#e5e5e5",
|
|
107
|
+
sidebar: "#fafafa",
|
|
108
|
+
strong: "#333333"
|
|
109
|
+
} : {
|
|
110
|
+
bg: "#000000",
|
|
111
|
+
fg: "#ffffff",
|
|
112
|
+
surface: "#1a1a1a",
|
|
113
|
+
subtle: "#999999",
|
|
114
|
+
border: "#333333",
|
|
115
|
+
sidebar: "#0d0d0d",
|
|
116
|
+
strong: "#cccccc"
|
|
117
|
+
};
|
|
118
|
+
return {
|
|
119
|
+
background: mono.bg,
|
|
120
|
+
foreground: mono.fg,
|
|
121
|
+
card: mono.bg,
|
|
122
|
+
"card-foreground": mono.fg,
|
|
123
|
+
popover: mono.bg,
|
|
124
|
+
"popover-foreground": mono.fg,
|
|
125
|
+
primary: mono.fg,
|
|
126
|
+
"primary-foreground": mono.bg,
|
|
127
|
+
secondary: mono.surface,
|
|
128
|
+
"secondary-foreground": mono.fg,
|
|
129
|
+
muted: mono.surface,
|
|
130
|
+
"muted-foreground": mono.subtle,
|
|
131
|
+
accent: mono.surface,
|
|
132
|
+
"accent-foreground": mono.fg,
|
|
133
|
+
destructive: danger,
|
|
134
|
+
"destructive-foreground": bestForeground(danger, ["#ffffff", "#000000"]),
|
|
135
|
+
border: mono.border,
|
|
136
|
+
input: mono.border,
|
|
137
|
+
ring: mono.fg,
|
|
138
|
+
"chart-1": light ? "#333333" : "#cccccc",
|
|
139
|
+
"chart-2": light ? "#4d4d4d" : "#b3b3b3",
|
|
140
|
+
"chart-3": light ? "#666666" : "#999999",
|
|
141
|
+
"chart-4": light ? "#808080" : "#808080",
|
|
142
|
+
"chart-5": light ? "#999999" : "#666666",
|
|
143
|
+
"sidebar-background": mono.sidebar,
|
|
144
|
+
"sidebar-foreground": mono.fg,
|
|
145
|
+
"sidebar-primary": mono.fg,
|
|
146
|
+
"sidebar-primary-foreground": mono.bg,
|
|
147
|
+
"sidebar-accent": mono.surface,
|
|
148
|
+
"sidebar-accent-foreground": mono.fg,
|
|
149
|
+
"sidebar-border": mono.border,
|
|
150
|
+
"sidebar-ring": mono.border
|
|
151
|
+
};
|
|
152
|
+
}
|
|
153
|
+
var NEUTRAL = {
|
|
154
|
+
light: neutral("light"),
|
|
155
|
+
dark: neutral("dark")
|
|
156
|
+
};
|
|
157
|
+
function colorAlias(token) {
|
|
158
|
+
if (token.startsWith("chart-")) return null;
|
|
159
|
+
if (token === "sidebar-background") return "--color-sidebar";
|
|
160
|
+
return `--color-${token}`;
|
|
161
|
+
}
|
|
162
|
+
function paletteDeclarations(tokens, names, radius, { indent = " ", aliasSource = "neutral-theme.ts" } = {}) {
|
|
163
|
+
const value = (token) => {
|
|
164
|
+
const hex = tokens[token];
|
|
165
|
+
if (hex === void 0) throw new Error(`Missing token: ${token}`);
|
|
166
|
+
return hexToHsl(hex);
|
|
167
|
+
};
|
|
168
|
+
const lines = [`${indent}--radius: ${radius};`];
|
|
169
|
+
for (const token of names) {
|
|
170
|
+
lines.push(`${indent}--${token}: ${value(token)};`);
|
|
171
|
+
}
|
|
172
|
+
lines.push(`${indent}--sidebar: ${value("sidebar-background")};`);
|
|
173
|
+
lines.push(`${indent}/* Tailwind-facing aliases \u2014 see ${aliasSource} */`);
|
|
174
|
+
for (const token of names) {
|
|
175
|
+
const alias = colorAlias(token);
|
|
176
|
+
if (alias) lines.push(`${indent}${alias}: hsl(var(--${token}));`);
|
|
177
|
+
}
|
|
178
|
+
lines.push(`${indent}--radius-sm: calc(var(--radius) - 4px);`);
|
|
179
|
+
lines.push(`${indent}--radius-md: calc(var(--radius) - 2px);`);
|
|
180
|
+
lines.push(`${indent}--radius-lg: var(--radius);`);
|
|
181
|
+
lines.push(`${indent}--radius-xl: calc(var(--radius) + 4px);`);
|
|
182
|
+
lines.push(`${indent}--radius-2xl: calc(var(--radius) + 8px);`);
|
|
183
|
+
return lines.join("\n");
|
|
184
|
+
}
|
|
185
|
+
function paletteBlock(selector, declarations, indent = "") {
|
|
186
|
+
const head = selector.split("\n").map((line) => indent + line).join("\n");
|
|
187
|
+
return `${head} {
|
|
188
|
+
${declarations}
|
|
189
|
+
${indent}}
|
|
190
|
+
`;
|
|
191
|
+
}
|
|
192
|
+
function layerBlock(name, rules) {
|
|
193
|
+
return `@layer ${name} {
|
|
194
|
+
${rules.join("\n")}}
|
|
195
|
+
`;
|
|
196
|
+
}
|
|
197
|
+
var DARK_ROOT_SELECTOR = ":root:where(.dark)";
|
|
198
|
+
function baseLayerPalette(light, dark, indent = " ") {
|
|
199
|
+
return layerBlock("base", [
|
|
200
|
+
paletteBlock(":root", light, indent),
|
|
201
|
+
paletteBlock(DARK_ROOT_SELECTOR, dark, indent)
|
|
202
|
+
]);
|
|
203
|
+
}
|
|
204
|
+
var PALETTE_GENERATED_HEADER = `/* GENERATED FILE \u2014 do not edit.
|
|
205
|
+
* Source: src/lib/neutral-theme.ts \xB7 Regenerate: pnpm gen:themes
|
|
206
|
+
*
|
|
207
|
+
* The neutral palette: light on :root, dark when the root carries the
|
|
208
|
+
* \`.dark\` class. It sits in \`@layer base\`, so any unlayered palette rule
|
|
209
|
+
* or a host's own :root overrides wins on layer order alone. Imported by
|
|
210
|
+
* tokens.css; every --color-* alias and the radius scale are re-declared
|
|
211
|
+
* alongside the tokens they read.
|
|
212
|
+
*/`;
|
|
213
|
+
function renderPaletteCss() {
|
|
214
|
+
const declarations = (mode) => paletteDeclarations(NEUTRAL[mode], SEMANTIC_TOKENS, NEUTRAL_RADIUS, {
|
|
215
|
+
indent: " "
|
|
216
|
+
});
|
|
217
|
+
return [
|
|
218
|
+
PALETTE_GENERATED_HEADER,
|
|
219
|
+
baseLayerPalette(declarations("light"), declarations("dark"))
|
|
220
|
+
].join("\n");
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
|
|
224
|
+
|
|
225
|
+
|
|
226
|
+
|
|
227
|
+
|
|
228
|
+
|
|
229
|
+
|
|
230
|
+
|
|
231
|
+
|
|
232
|
+
|
|
233
|
+
|
|
234
|
+
|
|
235
|
+
|
|
236
|
+
|
|
237
|
+
|
|
238
|
+
exports.NEUTRAL = NEUTRAL; exports.NEUTRAL_RADIUS = NEUTRAL_RADIUS; exports.PALETTE_GENERATED_HEADER = PALETTE_GENERATED_HEADER; exports.SEMANTIC_TOKENS = SEMANTIC_TOKENS; exports.baseLayerPalette = baseLayerPalette; exports.bestForeground = bestForeground; exports.colorAlias = colorAlias; exports.contrastRatio = contrastRatio; exports.hexToHsl = hexToHsl; exports.hexToRgb = hexToRgb; exports.layerBlock = layerBlock; exports.luminance = luminance; exports.paletteBlock = paletteBlock; exports.paletteDeclarations = paletteDeclarations; exports.renderPaletteCss = renderPaletteCss;
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The neutral palette, plus the token contract, colour maths and CSS
|
|
3
|
+
* rendering that every palette shares.
|
|
4
|
+
*
|
|
5
|
+
* Neutral is plain black and white with square corners. `pnpm gen:themes`
|
|
6
|
+
* renders it to `src/styles/palette.gen.css`, which `styles/tokens.css`
|
|
7
|
+
* imports, so a stylesheet built from tokens.css + utilities.css carries
|
|
8
|
+
* exactly one palette. `lib/themes` builds its default palette from the
|
|
9
|
+
* same `NEUTRAL` values, so the two cannot drift.
|
|
10
|
+
*
|
|
11
|
+
* Tokens are authored as **hex** because that is what a human can eyeball
|
|
12
|
+
* in review; `hexToHsl` converts them to the `H S% L%` triples the kit's
|
|
13
|
+
* `@theme` block wraps in `hsl()`.
|
|
14
|
+
*/
|
|
15
|
+
type ThemeMode = "light" | "dark";
|
|
16
|
+
/**
|
|
17
|
+
* Semantic tokens — the contract every theme must satisfy in full.
|
|
18
|
+
* These are the names the kit's `@theme` block (styles/tokens/theme.css)
|
|
19
|
+
* maps to Tailwind colours (`bg-background`, `text-muted-foreground`, …).
|
|
20
|
+
*
|
|
21
|
+
* `sidebar-background` (not `sidebar`) is the real name: the `@theme`
|
|
22
|
+
* block maps `--color-sidebar: hsl(var(--sidebar-background))`.
|
|
23
|
+
*/
|
|
24
|
+
declare const SEMANTIC_TOKENS: readonly ["background", "foreground", "card", "card-foreground", "popover", "popover-foreground", "primary", "primary-foreground", "secondary", "secondary-foreground", "muted", "muted-foreground", "accent", "accent-foreground", "destructive", "destructive-foreground", "border", "input", "ring", "chart-1", "chart-2", "chart-3", "chart-4", "chart-5", "sidebar-background", "sidebar-foreground", "sidebar-primary", "sidebar-primary-foreground", "sidebar-accent", "sidebar-accent-foreground", "sidebar-border", "sidebar-ring"];
|
|
25
|
+
type SemanticToken = (typeof SEMANTIC_TOKENS)[number];
|
|
26
|
+
/** Every semantic token, as a hex string (`#rrggbb`). */
|
|
27
|
+
type SemanticTokenMap = Record<SemanticToken, string>;
|
|
28
|
+
/** `#rrggbb` → `[r, g, b]`, each 0-255. */
|
|
29
|
+
declare function hexToRgb(hex: string): [number, number, number];
|
|
30
|
+
/**
|
|
31
|
+
* `#rrggbb` → the bare `H S% L%` triple the kit's CSS vars hold (they
|
|
32
|
+
* are wrapped in `hsl(...)` at the `@theme` layer, so the var itself
|
|
33
|
+
* must NOT include the function).
|
|
34
|
+
*/
|
|
35
|
+
declare function hexToHsl(hex: string): string;
|
|
36
|
+
/** WCAG relative luminance. */
|
|
37
|
+
declare function luminance(hex: string): number;
|
|
38
|
+
/** WCAG contrast ratio between two hex colours (1–21). */
|
|
39
|
+
declare function contrastRatio(a: string, b: string): number;
|
|
40
|
+
/**
|
|
41
|
+
* Pick whichever candidate reads best on `bg`. Used for the *-foreground
|
|
42
|
+
* tokens so a palette author can't accidentally ship white-on-yellow —
|
|
43
|
+
* the choice is computed, not eyeballed.
|
|
44
|
+
*/
|
|
45
|
+
declare function bestForeground(bg: string, candidates: string[]): string;
|
|
46
|
+
/** `--radius` for the neutral palette: square. */
|
|
47
|
+
declare const NEUTRAL_RADIUS = "0rem";
|
|
48
|
+
/** The neutral palette's semantic tokens, per mode, as hex. */
|
|
49
|
+
declare const NEUTRAL: Readonly<Record<ThemeMode, SemanticTokenMap>>;
|
|
50
|
+
/**
|
|
51
|
+
* The Tailwind colour name each token feeds, or null for tokens with no
|
|
52
|
+
* utility (the chart series are read directly as `var(--chart-1)`).
|
|
53
|
+
* Mirrors the kit's `@theme` block.
|
|
54
|
+
*/
|
|
55
|
+
declare function colorAlias(token: string): string | null;
|
|
56
|
+
interface PaletteDeclarationOptions {
|
|
57
|
+
/** Prefix for every line. */
|
|
58
|
+
indent?: string;
|
|
59
|
+
/** File named by the aliases comment in the generated CSS. */
|
|
60
|
+
aliasSource?: string;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* The declarations of one palette block: `--radius`, each token as an
|
|
64
|
+
* `H S% L%` triple, the `--sidebar` alias, then the Tailwind-facing
|
|
65
|
+
* aliases and the radius scale.
|
|
66
|
+
*/
|
|
67
|
+
declare function paletteDeclarations(tokens: Readonly<Record<string, string>>, names: readonly string[], radius: string, { indent, aliasSource }?: PaletteDeclarationOptions): string;
|
|
68
|
+
/**
|
|
69
|
+
* One rule: `selector { declarations }`, newline-terminated. `indent`
|
|
70
|
+
* prefixes each selector line and the closing brace, for a rule nested in
|
|
71
|
+
* a layer; the declarations carry their own indent.
|
|
72
|
+
*/
|
|
73
|
+
declare function paletteBlock(selector: string, declarations: string, indent?: string): string;
|
|
74
|
+
/** Rules wrapped in a cascade layer: `@layer <name> { … }`. */
|
|
75
|
+
declare function layerBlock(name: string, rules: readonly string[]): string;
|
|
76
|
+
/**
|
|
77
|
+
* `@layer base { :root { light } :root:where(.dark) { dark } }` — the shape
|
|
78
|
+
* of a default palette. Layered so that anything unlayered (a palette
|
|
79
|
+
* scoped by an attribute, a host's own `:root` overrides) wins on layer
|
|
80
|
+
* order, not on specificity or import order.
|
|
81
|
+
*
|
|
82
|
+
* Both halves sit on the root only, like the mode itself: an element
|
|
83
|
+
* further down that happens to carry `.dark` inherits the document's
|
|
84
|
+
* tokens rather than having the default palette re-declared on it, which
|
|
85
|
+
* would paint over whichever palette the document picked.
|
|
86
|
+
*/
|
|
87
|
+
declare function baseLayerPalette(light: string, dark: string, indent?: string): string;
|
|
88
|
+
declare const PALETTE_GENERATED_HEADER = "/* GENERATED FILE \u2014 do not edit.\n * Source: src/lib/neutral-theme.ts \u00B7 Regenerate: pnpm gen:themes\n *\n * The neutral palette: light on :root, dark when the root carries the\n * `.dark` class. It sits in `@layer base`, so any unlayered palette rule\n * or a host's own :root overrides wins on layer order alone. Imported by\n * tokens.css; every --color-* alias and the radius scale are re-declared\n * alongside the tokens they read.\n */";
|
|
89
|
+
/** `src/styles/palette.gen.css`: the neutral palette, light then dark. */
|
|
90
|
+
declare function renderPaletteCss(): string;
|
|
91
|
+
|
|
92
|
+
export { NEUTRAL, NEUTRAL_RADIUS, PALETTE_GENERATED_HEADER, type PaletteDeclarationOptions, SEMANTIC_TOKENS, type SemanticToken, type SemanticTokenMap, type ThemeMode, baseLayerPalette, bestForeground, colorAlias, contrastRatio, hexToHsl, hexToRgb, layerBlock, luminance, paletteBlock, paletteDeclarations, renderPaletteCss };
|