@repraze/kernelkit 0.0.0-stage → 0.1.0-alpha.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/README.md +41 -2
- package/dist/components/accordion.d.ts +13 -0
- package/dist/components/accordion.d.ts.map +1 -0
- package/dist/components/accordion.js +33 -0
- package/dist/components/accordion.js.map +1 -0
- package/dist/components/alert-dialog.d.ts +24 -0
- package/dist/components/alert-dialog.d.ts.map +1 -0
- package/dist/components/alert-dialog.js +49 -0
- package/dist/components/alert-dialog.js.map +1 -0
- package/dist/components/alert.d.ts +22 -0
- package/dist/components/alert.d.ts.map +1 -0
- package/dist/components/alert.js +61 -0
- package/dist/components/alert.js.map +1 -0
- package/dist/components/aspect-ratio.d.ts +10 -0
- package/dist/components/aspect-ratio.d.ts.map +1 -0
- package/dist/components/aspect-ratio.js +18 -0
- package/dist/components/aspect-ratio.js.map +1 -0
- package/dist/components/attachment.d.ts +27 -0
- package/dist/components/attachment.d.ts.map +1 -0
- package/dist/components/attachment.js +76 -0
- package/dist/components/attachment.js.map +1 -0
- package/dist/components/avatar.d.ts +18 -0
- package/dist/components/avatar.d.ts.map +1 -0
- package/dist/components/avatar.js +38 -0
- package/dist/components/avatar.js.map +1 -0
- package/dist/components/badge.d.ts +18 -0
- package/dist/components/badge.d.ts.map +1 -0
- package/dist/components/badge.js +49 -0
- package/dist/components/badge.js.map +1 -0
- package/dist/components/breadcrumb.d.ts +11 -0
- package/dist/components/breadcrumb.d.ts.map +1 -0
- package/dist/components/breadcrumb.js +40 -0
- package/dist/components/breadcrumb.js.map +1 -0
- package/dist/components/bubble.d.ts +22 -0
- package/dist/components/bubble.d.ts.map +1 -0
- package/dist/components/bubble.js +72 -0
- package/dist/components/bubble.js.map +1 -0
- package/dist/components/button-group.d.ts +11 -0
- package/dist/components/button-group.d.ts.map +1 -0
- package/dist/components/button-group.js +38 -0
- package/dist/components/button-group.js.map +1 -0
- package/dist/components/button.d.ts +26 -0
- package/dist/components/button.d.ts.map +1 -0
- package/dist/components/button.js +78 -0
- package/dist/components/button.js.map +1 -0
- package/dist/components/calendar.d.ts +11 -0
- package/dist/components/calendar.d.ts.map +1 -0
- package/dist/components/calendar.js +89 -0
- package/dist/components/calendar.js.map +1 -0
- package/dist/components/callout.d.ts +25 -0
- package/dist/components/callout.d.ts.map +1 -0
- package/dist/components/callout.js +40 -0
- package/dist/components/callout.js.map +1 -0
- package/dist/components/card.d.ts +43 -0
- package/dist/components/card.d.ts.map +1 -0
- package/dist/components/card.js +80 -0
- package/dist/components/card.js.map +1 -0
- package/dist/components/carousel.d.ts +31 -0
- package/dist/components/carousel.d.ts.map +1 -0
- package/dist/components/carousel.js +120 -0
- package/dist/components/carousel.js.map +1 -0
- package/dist/components/chart.d.ts +45 -0
- package/dist/components/chart.d.ts.map +1 -0
- package/dist/components/chart.js +137 -0
- package/dist/components/chart.js.map +1 -0
- package/dist/components/checkbox-group.d.ts +9 -0
- package/dist/components/checkbox-group.d.ts.map +1 -0
- package/dist/components/checkbox-group.js +14 -0
- package/dist/components/checkbox-group.js.map +1 -0
- package/dist/components/checkbox.d.ts +6 -0
- package/dist/components/checkbox.d.ts.map +1 -0
- package/dist/components/checkbox.js +27 -0
- package/dist/components/checkbox.js.map +1 -0
- package/dist/components/code-block.d.ts +29 -0
- package/dist/components/code-block.d.ts.map +1 -0
- package/dist/components/code-block.js +87 -0
- package/dist/components/code-block.js.map +1 -0
- package/dist/components/collapsible.d.ts +11 -0
- package/dist/components/collapsible.d.ts.map +1 -0
- package/dist/components/collapsible.js +21 -0
- package/dist/components/collapsible.js.map +1 -0
- package/dist/components/combobox.d.ts +26 -0
- package/dist/components/combobox.d.ts.map +1 -0
- package/dist/components/combobox.js +66 -0
- package/dist/components/combobox.js.map +1 -0
- package/dist/components/command.d.ts +25 -0
- package/dist/components/command.d.ts.map +1 -0
- package/dist/components/command.js +48 -0
- package/dist/components/command.js.map +1 -0
- package/dist/components/context-menu.d.ts +32 -0
- package/dist/components/context-menu.d.ts.map +1 -0
- package/dist/components/context-menu.js +58 -0
- package/dist/components/context-menu.js.map +1 -0
- package/dist/components/copy-button.d.ts +21 -0
- package/dist/components/copy-button.d.ts.map +1 -0
- package/dist/components/copy-button.js +34 -0
- package/dist/components/copy-button.js.map +1 -0
- package/dist/components/data-table/data-table-utils.d.ts +18 -0
- package/dist/components/data-table/data-table-utils.d.ts.map +1 -0
- package/dist/components/data-table/data-table-utils.js +92 -0
- package/dist/components/data-table/data-table-utils.js.map +1 -0
- package/dist/components/data-table/elements/data-table-base.d.ts +24 -0
- package/dist/components/data-table/elements/data-table-base.d.ts.map +1 -0
- package/dist/components/data-table/elements/data-table-base.js +28 -0
- package/dist/components/data-table/elements/data-table-base.js.map +1 -0
- package/dist/components/data-table/elements/data-table-body.d.ts +8 -0
- package/dist/components/data-table/elements/data-table-body.d.ts.map +1 -0
- package/dist/components/data-table/elements/data-table-body.js +16 -0
- package/dist/components/data-table/elements/data-table-body.js.map +1 -0
- package/dist/components/data-table/elements/data-table-cell.d.ts +12 -0
- package/dist/components/data-table/elements/data-table-cell.d.ts.map +1 -0
- package/dist/components/data-table/elements/data-table-cell.js +23 -0
- package/dist/components/data-table/elements/data-table-cell.js.map +1 -0
- package/dist/components/data-table/elements/data-table-filter-row.d.ts +40 -0
- package/dist/components/data-table/elements/data-table-filter-row.d.ts.map +1 -0
- package/dist/components/data-table/elements/data-table-filter-row.js +117 -0
- package/dist/components/data-table/elements/data-table-filter-row.js.map +1 -0
- package/dist/components/data-table/elements/data-table-foot.d.ts +9 -0
- package/dist/components/data-table/elements/data-table-foot.d.ts.map +1 -0
- package/dist/components/data-table/elements/data-table-foot.js +11 -0
- package/dist/components/data-table/elements/data-table-foot.js.map +1 -0
- package/dist/components/data-table/elements/data-table-head.d.ts +9 -0
- package/dist/components/data-table/elements/data-table-head.d.ts.map +1 -0
- package/dist/components/data-table/elements/data-table-head.js +11 -0
- package/dist/components/data-table/elements/data-table-head.js.map +1 -0
- package/dist/components/data-table/elements/data-table-info-row.d.ts +7 -0
- package/dist/components/data-table/elements/data-table-info-row.d.ts.map +1 -0
- package/dist/components/data-table/elements/data-table-info-row.js +19 -0
- package/dist/components/data-table/elements/data-table-info-row.js.map +1 -0
- package/dist/components/data-table/elements/data-table-row.d.ts +13 -0
- package/dist/components/data-table/elements/data-table-row.d.ts.map +1 -0
- package/dist/components/data-table/elements/data-table-row.js +19 -0
- package/dist/components/data-table/elements/data-table-row.js.map +1 -0
- package/dist/components/data-table/elements/data-table-scroll.d.ts +11 -0
- package/dist/components/data-table/elements/data-table-scroll.d.ts.map +1 -0
- package/dist/components/data-table/elements/data-table-scroll.js +10 -0
- package/dist/components/data-table/elements/data-table-scroll.js.map +1 -0
- package/dist/components/data-table/elements/data-table-sort-row.d.ts +28 -0
- package/dist/components/data-table/elements/data-table-sort-row.d.ts.map +1 -0
- package/dist/components/data-table/elements/data-table-sort-row.js +114 -0
- package/dist/components/data-table/elements/data-table-sort-row.js.map +1 -0
- package/dist/components/data-table/elements/data-table-title-row.d.ts +11 -0
- package/dist/components/data-table/elements/data-table-title-row.d.ts.map +1 -0
- package/dist/components/data-table/elements/data-table-title-row.js +16 -0
- package/dist/components/data-table/elements/data-table-title-row.js.map +1 -0
- package/dist/components/data-table/elements/data-table-virtualized-body.d.ts +10 -0
- package/dist/components/data-table/elements/data-table-virtualized-body.d.ts.map +1 -0
- package/dist/components/data-table/elements/data-table-virtualized-body.js +38 -0
- package/dist/components/data-table/elements/data-table-virtualized-body.js.map +1 -0
- package/dist/components/data-table/set-utils.d.ts +41 -0
- package/dist/components/data-table/set-utils.d.ts.map +1 -0
- package/dist/components/data-table/set-utils.js +97 -0
- package/dist/components/data-table/set-utils.js.map +1 -0
- package/dist/components/data-table/views/data-table-filter-view.d.ts +18 -0
- package/dist/components/data-table/views/data-table-filter-view.d.ts.map +1 -0
- package/dist/components/data-table/views/data-table-filter-view.js +63 -0
- package/dist/components/data-table/views/data-table-filter-view.js.map +1 -0
- package/dist/components/data-table/views/data-table-prop-view.d.ts +297 -0
- package/dist/components/data-table/views/data-table-prop-view.d.ts.map +1 -0
- package/dist/components/data-table/views/data-table-prop-view.js +44 -0
- package/dist/components/data-table/views/data-table-prop-view.js.map +1 -0
- package/dist/components/data-table/views/data-table-root-view.d.ts +8 -0
- package/dist/components/data-table/views/data-table-root-view.d.ts.map +1 -0
- package/dist/components/data-table/views/data-table-root-view.js +18 -0
- package/dist/components/data-table/views/data-table-root-view.js.map +1 -0
- package/dist/components/data-table/views/data-table-sort-view.d.ts +18 -0
- package/dist/components/data-table/views/data-table-sort-view.d.ts.map +1 -0
- package/dist/components/data-table/views/data-table-sort-view.js +70 -0
- package/dist/components/data-table/views/data-table-sort-view.js.map +1 -0
- package/dist/components/data-table/views/data-table-view.d.ts +44 -0
- package/dist/components/data-table/views/data-table-view.d.ts.map +1 -0
- package/dist/components/data-table/views/data-table-view.js +86 -0
- package/dist/components/data-table/views/data-table-view.js.map +1 -0
- package/dist/components/data-table.d.ts +20 -0
- package/dist/components/data-table.d.ts.map +1 -0
- package/dist/components/data-table.js +26 -0
- package/dist/components/data-table.js.map +1 -0
- package/dist/components/date-picker.d.ts +43 -0
- package/dist/components/date-picker.d.ts.map +1 -0
- package/dist/components/date-picker.js +45 -0
- package/dist/components/date-picker.js.map +1 -0
- package/dist/components/dialog.d.ts +24 -0
- package/dist/components/dialog.d.ts.map +1 -0
- package/dist/components/dialog.js +57 -0
- package/dist/components/dialog.js.map +1 -0
- package/dist/components/direction.d.ts +2 -0
- package/dist/components/direction.d.ts.map +1 -0
- package/dist/components/direction.js +3 -0
- package/dist/components/direction.js.map +1 -0
- package/dist/components/drawer.d.ts +18 -0
- package/dist/components/drawer.d.ts.map +1 -0
- package/dist/components/drawer.js +84 -0
- package/dist/components/drawer.js.map +1 -0
- package/dist/components/dropdown-menu.d.ts +45 -0
- package/dist/components/dropdown-menu.d.ts.map +1 -0
- package/dist/components/dropdown-menu.js +77 -0
- package/dist/components/dropdown-menu.js.map +1 -0
- package/dist/components/empty.d.ts +15 -0
- package/dist/components/empty.d.ts.map +1 -0
- package/dist/components/empty.js +44 -0
- package/dist/components/empty.js.map +1 -0
- package/dist/components/field.d.ts +25 -0
- package/dist/components/field.d.ts.map +1 -0
- package/dist/components/field.js +72 -0
- package/dist/components/field.js.map +1 -0
- package/dist/components/file-upload.d.ts +24 -0
- package/dist/components/file-upload.d.ts.map +1 -0
- package/dist/components/file-upload.js +78 -0
- package/dist/components/file-upload.js.map +1 -0
- package/dist/components/hero.d.ts +39 -0
- package/dist/components/hero.d.ts.map +1 -0
- package/dist/components/hero.js +71 -0
- package/dist/components/hero.js.map +1 -0
- package/dist/components/hover-card.d.ts +6 -0
- package/dist/components/hover-card.d.ts.map +1 -0
- package/dist/components/hover-card.js +17 -0
- package/dist/components/hover-card.js.map +1 -0
- package/dist/components/input-group.d.ts +23 -0
- package/dist/components/input-group.d.ts.map +1 -0
- package/dist/components/input-group.js +86 -0
- package/dist/components/input-group.js.map +1 -0
- package/dist/components/input-otp.d.ts +13 -0
- package/dist/components/input-otp.d.ts.map +1 -0
- package/dist/components/input-otp.js +25 -0
- package/dist/components/input-otp.js.map +1 -0
- package/dist/components/input.d.ts +13 -0
- package/dist/components/input.d.ts.map +1 -0
- package/dist/components/input.js +29 -0
- package/dist/components/input.js.map +1 -0
- package/dist/components/item.d.ts +23 -0
- package/dist/components/item.d.ts.map +1 -0
- package/dist/components/item.js +89 -0
- package/dist/components/item.js.map +1 -0
- package/dist/components/kbd.d.ts +11 -0
- package/dist/components/kbd.d.ts.map +1 -0
- package/dist/components/kbd.js +26 -0
- package/dist/components/kbd.js.map +1 -0
- package/dist/components/label.d.ts +4 -0
- package/dist/components/label.d.ts.map +1 -0
- package/dist/components/label.js +9 -0
- package/dist/components/label.js.map +1 -0
- package/dist/components/marker.d.ts +11 -0
- package/dist/components/marker.d.ts.map +1 -0
- package/dist/components/marker.js +37 -0
- package/dist/components/marker.js.map +1 -0
- package/dist/components/menubar.d.ts +23 -0
- package/dist/components/menubar.d.ts.map +1 -0
- package/dist/components/menubar.js +60 -0
- package/dist/components/menubar.js.map +1 -0
- package/dist/components/message-scroller.d.ts +11 -0
- package/dist/components/message-scroller.d.ts.map +1 -0
- package/dist/components/message-scroller.js +27 -0
- package/dist/components/message-scroller.js.map +1 -0
- package/dist/components/message.d.ts +17 -0
- package/dist/components/message.d.ts.map +1 -0
- package/dist/components/message.js +24 -0
- package/dist/components/message.js.map +1 -0
- package/dist/components/meter.d.ts +18 -0
- package/dist/components/meter.d.ts.map +1 -0
- package/dist/components/meter.js +25 -0
- package/dist/components/meter.js.map +1 -0
- package/dist/components/native-select.d.ts +14 -0
- package/dist/components/native-select.d.ts.map +1 -0
- package/dist/components/native-select.js +34 -0
- package/dist/components/native-select.js.map +1 -0
- package/dist/components/navbar.d.ts +11 -0
- package/dist/components/navbar.d.ts.map +1 -0
- package/dist/components/navbar.js +44 -0
- package/dist/components/navbar.js.map +1 -0
- package/dist/components/navigation-menu.d.ts +23 -0
- package/dist/components/navigation-menu.d.ts.map +1 -0
- package/dist/components/navigation-menu.js +51 -0
- package/dist/components/navigation-menu.js.map +1 -0
- package/dist/components/number-field.d.ts +16 -0
- package/dist/components/number-field.d.ts.map +1 -0
- package/dist/components/number-field.js +49 -0
- package/dist/components/number-field.js.map +1 -0
- package/dist/components/page-header.d.ts +13 -0
- package/dist/components/page-header.d.ts.map +1 -0
- package/dist/components/page-header.js +51 -0
- package/dist/components/page-header.js.map +1 -0
- package/dist/components/pager.d.ts +14 -0
- package/dist/components/pager.d.ts.map +1 -0
- package/dist/components/pager.js +36 -0
- package/dist/components/pager.js.map +1 -0
- package/dist/components/pagination.d.ts +21 -0
- package/dist/components/pagination.d.ts.map +1 -0
- package/dist/components/pagination.js +29 -0
- package/dist/components/pagination.js.map +1 -0
- package/dist/components/password-input.d.ts +18 -0
- package/dist/components/password-input.d.ts.map +1 -0
- package/dist/components/password-input.js +17 -0
- package/dist/components/password-input.js.map +1 -0
- package/dist/components/password-strength.d.ts +21 -0
- package/dist/components/password-strength.d.ts.map +1 -0
- package/dist/components/password-strength.js +52 -0
- package/dist/components/password-strength.js.map +1 -0
- package/dist/components/popover.d.ts +10 -0
- package/dist/components/popover.d.ts.map +1 -0
- package/dist/components/popover.js +27 -0
- package/dist/components/popover.js.map +1 -0
- package/dist/components/progress.d.ts +26 -0
- package/dist/components/progress.d.ts.map +1 -0
- package/dist/components/progress.js +39 -0
- package/dist/components/progress.js.map +1 -0
- package/dist/components/questionnaire.d.ts +20 -0
- package/dist/components/questionnaire.d.ts.map +1 -0
- package/dist/components/questionnaire.js +57 -0
- package/dist/components/questionnaire.js.map +1 -0
- package/dist/components/radio-group.d.ts +8 -0
- package/dist/components/radio-group.d.ts.map +1 -0
- package/dist/components/radio-group.js +27 -0
- package/dist/components/radio-group.js.map +1 -0
- package/dist/components/resizable.d.ts +13 -0
- package/dist/components/resizable.d.ts.map +1 -0
- package/dist/components/resizable.js +24 -0
- package/dist/components/resizable.js.map +1 -0
- package/dist/components/scroll-area.d.ts +17 -0
- package/dist/components/scroll-area.d.ts.map +1 -0
- package/dist/components/scroll-area.js +12 -0
- package/dist/components/scroll-area.js.map +1 -0
- package/dist/components/search-dialog.d.ts +38 -0
- package/dist/components/search-dialog.d.ts.map +1 -0
- package/dist/components/search-dialog.js +39 -0
- package/dist/components/search-dialog.js.map +1 -0
- package/dist/components/search-trigger.d.ts +20 -0
- package/dist/components/search-trigger.d.ts.map +1 -0
- package/dist/components/search-trigger.js +52 -0
- package/dist/components/search-trigger.js.map +1 -0
- package/dist/components/section.d.ts +30 -0
- package/dist/components/section.d.ts.map +1 -0
- package/dist/components/section.js +79 -0
- package/dist/components/section.js.map +1 -0
- package/dist/components/select.d.ts +16 -0
- package/dist/components/select.d.ts.map +1 -0
- package/dist/components/select.js +38 -0
- package/dist/components/select.js.map +1 -0
- package/dist/components/separator.d.ts +4 -0
- package/dist/components/separator.d.ts.map +1 -0
- package/dist/components/separator.js +9 -0
- package/dist/components/separator.js.map +1 -0
- package/dist/components/sheet.d.ts +16 -0
- package/dist/components/sheet.d.ts.map +1 -0
- package/dist/components/sheet.js +44 -0
- package/dist/components/sheet.js.map +1 -0
- package/dist/components/sidebar.d.ts +76 -0
- package/dist/components/sidebar.d.ts.map +1 -0
- package/dist/components/sidebar.js +289 -0
- package/dist/components/sidebar.js.map +1 -0
- package/dist/components/site-footer.d.ts +22 -0
- package/dist/components/site-footer.d.ts.map +1 -0
- package/dist/components/site-footer.js +42 -0
- package/dist/components/site-footer.js.map +1 -0
- package/dist/components/site-header.d.ts +48 -0
- package/dist/components/site-header.d.ts.map +1 -0
- package/dist/components/site-header.js +104 -0
- package/dist/components/site-header.js.map +1 -0
- package/dist/components/site-layout.d.ts +35 -0
- package/dist/components/site-layout.d.ts.map +1 -0
- package/dist/components/site-layout.js +99 -0
- package/dist/components/site-layout.js.map +1 -0
- package/dist/components/skeleton.d.ts +6 -0
- package/dist/components/skeleton.d.ts.map +1 -0
- package/dist/components/skeleton.js +16 -0
- package/dist/components/skeleton.js.map +1 -0
- package/dist/components/slider.d.ts +4 -0
- package/dist/components/slider.d.ts.map +1 -0
- package/dist/components/slider.js +11 -0
- package/dist/components/slider.js.map +1 -0
- package/dist/components/spinner.d.ts +12 -0
- package/dist/components/spinner.d.ts.map +1 -0
- package/dist/components/spinner.js +26 -0
- package/dist/components/spinner.js.map +1 -0
- package/dist/components/stat.d.ts +31 -0
- package/dist/components/stat.d.ts.map +1 -0
- package/dist/components/stat.js +66 -0
- package/dist/components/stat.js.map +1 -0
- package/dist/components/status-dot.d.ts +25 -0
- package/dist/components/status-dot.d.ts.map +1 -0
- package/dist/components/status-dot.js +45 -0
- package/dist/components/status-dot.js.map +1 -0
- package/dist/components/switch.d.ts +17 -0
- package/dist/components/switch.d.ts.map +1 -0
- package/dist/components/switch.js +49 -0
- package/dist/components/switch.js.map +1 -0
- package/dist/components/table.d.ts +25 -0
- package/dist/components/table.d.ts.map +1 -0
- package/dist/components/table.js +45 -0
- package/dist/components/table.js.map +1 -0
- package/dist/components/tabs.d.ts +18 -0
- package/dist/components/tabs.d.ts.map +1 -0
- package/dist/components/tabs.js +51 -0
- package/dist/components/tabs.js.map +1 -0
- package/dist/components/textarea.d.ts +4 -0
- package/dist/components/textarea.d.ts.map +1 -0
- package/dist/components/textarea.js +10 -0
- package/dist/components/textarea.js.map +1 -0
- package/dist/components/toast.d.ts +27 -0
- package/dist/components/toast.d.ts.map +1 -0
- package/dist/components/toast.js +68 -0
- package/dist/components/toast.js.map +1 -0
- package/dist/components/toc.d.ts +35 -0
- package/dist/components/toc.d.ts.map +1 -0
- package/dist/components/toc.js +94 -0
- package/dist/components/toc.js.map +1 -0
- package/dist/components/toggle-group.d.ts +19 -0
- package/dist/components/toggle-group.d.ts.map +1 -0
- package/dist/components/toggle-group.js +33 -0
- package/dist/components/toggle-group.js.map +1 -0
- package/dist/components/toggle.d.ts +15 -0
- package/dist/components/toggle.d.ts.map +1 -0
- package/dist/components/toggle.js +42 -0
- package/dist/components/toggle.js.map +1 -0
- package/dist/components/toolbar.d.ts +14 -0
- package/dist/components/toolbar.d.ts.map +1 -0
- package/dist/components/toolbar.js +37 -0
- package/dist/components/toolbar.js.map +1 -0
- package/dist/components/tooltip.d.ts +7 -0
- package/dist/components/tooltip.d.ts.map +1 -0
- package/dist/components/tooltip.js +22 -0
- package/dist/components/tooltip.js.map +1 -0
- package/dist/components/trace.d.ts +20 -0
- package/dist/components/trace.d.ts.map +1 -0
- package/dist/components/trace.js +32 -0
- package/dist/components/trace.js.map +1 -0
- package/dist/components/typography.d.ts +37 -0
- package/dist/components/typography.d.ts.map +1 -0
- package/dist/components/typography.js +140 -0
- package/dist/components/typography.js.map +1 -0
- package/dist/hooks/use-highlighted-code.d.ts +3 -0
- package/dist/hooks/use-highlighted-code.d.ts.map +1 -0
- package/dist/hooks/use-highlighted-code.js +50 -0
- package/dist/hooks/use-highlighted-code.js.map +1 -0
- package/dist/hooks/use-mobile.d.ts +2 -0
- package/dist/hooks/use-mobile.d.ts.map +1 -0
- package/dist/hooks/use-mobile.js +16 -0
- package/dist/hooks/use-mobile.js.map +1 -0
- package/dist/lib/color.d.ts +30 -0
- package/dist/lib/color.d.ts.map +1 -0
- package/dist/lib/color.js +56 -0
- package/dist/lib/color.js.map +1 -0
- package/dist/lib/highlighter.d.ts +10 -0
- package/dist/lib/highlighter.d.ts.map +1 -0
- package/dist/lib/highlighter.js +94 -0
- package/dist/lib/highlighter.js.map +1 -0
- package/dist/lib/recipes.d.ts +30 -0
- package/dist/lib/recipes.d.ts.map +1 -0
- package/dist/lib/recipes.js +30 -0
- package/dist/lib/recipes.js.map +1 -0
- package/dist/lib/utils.d.ts +2 -0
- package/dist/lib/utils.d.ts.map +1 -0
- package/dist/lib/utils.js +2 -0
- package/dist/lib/utils.js.map +1 -0
- package/dist/provider/index.d.ts +3 -0
- package/dist/provider/index.d.ts.map +1 -0
- package/dist/provider/index.js +3 -0
- package/dist/provider/index.js.map +1 -0
- package/dist/provider/theme-provider.d.ts +47 -0
- package/dist/provider/theme-provider.d.ts.map +1 -0
- package/dist/provider/theme-provider.js +118 -0
- package/dist/provider/theme-provider.js.map +1 -0
- package/dist/provider/theme.d.ts +42 -0
- package/dist/provider/theme.d.ts.map +1 -0
- package/dist/provider/theme.js +58 -0
- package/dist/provider/theme.js.map +1 -0
- package/package.json +145 -5
- package/src/components/accordion.tsx +92 -0
- package/src/components/alert-dialog.tsx +167 -0
- package/src/components/alert.tsx +110 -0
- package/src/components/aspect-ratio.tsx +29 -0
- package/src/components/attachment.tsx +198 -0
- package/src/components/avatar.tsx +115 -0
- package/src/components/badge.tsx +75 -0
- package/src/components/breadcrumb.tsx +104 -0
- package/src/components/bubble.tsx +125 -0
- package/src/components/button-group.tsx +75 -0
- package/src/components/button.tsx +124 -0
- package/src/components/calendar.tsx +204 -0
- package/src/components/callout.tsx +131 -0
- package/src/components/card.tsx +178 -0
- package/src/components/carousel.tsx +294 -0
- package/src/components/chart.tsx +332 -0
- package/src/components/checkbox-group.tsx +21 -0
- package/src/components/checkbox.tsx +39 -0
- package/src/components/code-block.tsx +246 -0
- package/src/components/collapsible.tsx +47 -0
- package/src/components/combobox.tsx +295 -0
- package/src/components/command.tsx +174 -0
- package/src/components/context-menu.tsx +238 -0
- package/src/components/copy-button.tsx +80 -0
- package/src/components/data-table/data-table-utils.tsx +125 -0
- package/src/components/data-table/elements/data-table-base.tsx +78 -0
- package/src/components/data-table/elements/data-table-body.tsx +50 -0
- package/src/components/data-table/elements/data-table-cell.tsx +42 -0
- package/src/components/data-table/elements/data-table-filter-row.tsx +222 -0
- package/src/components/data-table/elements/data-table-foot.tsx +36 -0
- package/src/components/data-table/elements/data-table-head.tsx +36 -0
- package/src/components/data-table/elements/data-table-info-row.tsx +38 -0
- package/src/components/data-table/elements/data-table-row.tsx +58 -0
- package/src/components/data-table/elements/data-table-scroll.tsx +33 -0
- package/src/components/data-table/elements/data-table-sort-row.tsx +180 -0
- package/src/components/data-table/elements/data-table-title-row.tsx +33 -0
- package/src/components/data-table/elements/data-table-virtualized-body.tsx +87 -0
- package/src/components/data-table/set-utils.ts +103 -0
- package/src/components/data-table/views/data-table-filter-view.tsx +75 -0
- package/src/components/data-table/views/data-table-prop-view.tsx +55 -0
- package/src/components/data-table/views/data-table-root-view.tsx +20 -0
- package/src/components/data-table/views/data-table-sort-view.tsx +81 -0
- package/src/components/data-table/views/data-table-view.tsx +147 -0
- package/src/components/data-table.tsx +30 -0
- package/src/components/date-picker.tsx +166 -0
- package/src/components/dialog.tsx +158 -0
- package/src/components/direction.tsx +3 -0
- package/src/components/drawer.tsx +222 -0
- package/src/components/dropdown-menu.tsx +267 -0
- package/src/components/empty.tsx +97 -0
- package/src/components/field.tsx +229 -0
- package/src/components/file-upload.tsx +180 -0
- package/src/components/hero.tsx +137 -0
- package/src/components/hover-card.tsx +44 -0
- package/src/components/input-group.tsx +186 -0
- package/src/components/input-otp.tsx +82 -0
- package/src/components/input.tsx +50 -0
- package/src/components/item.tsx +191 -0
- package/src/components/kbd.tsx +39 -0
- package/src/components/label.tsx +19 -0
- package/src/components/marker.tsx +69 -0
- package/src/components/menubar.tsx +146 -0
- package/src/components/message-scroller.tsx +113 -0
- package/src/components/message.tsx +90 -0
- package/src/components/meter.tsx +69 -0
- package/src/components/native-select.tsx +76 -0
- package/src/components/navbar.tsx +55 -0
- package/src/components/navigation-menu.tsx +193 -0
- package/src/components/number-field.tsx +133 -0
- package/src/components/page-header.tsx +63 -0
- package/src/components/pager.tsx +70 -0
- package/src/components/pagination.tsx +106 -0
- package/src/components/password-input.tsx +71 -0
- package/src/components/password-strength.tsx +99 -0
- package/src/components/popover.tsx +68 -0
- package/src/components/progress.tsx +105 -0
- package/src/components/questionnaire.tsx +299 -0
- package/src/components/radio-group.tsx +43 -0
- package/src/components/resizable.tsx +62 -0
- package/src/components/scroll-area.tsx +68 -0
- package/src/components/search-dialog.tsx +87 -0
- package/src/components/search-trigger.tsx +74 -0
- package/src/components/section.tsx +110 -0
- package/src/components/select.tsx +184 -0
- package/src/components/separator.tsx +20 -0
- package/src/components/sheet.tsx +116 -0
- package/src/components/sidebar.tsx +722 -0
- package/src/components/site-footer.tsx +55 -0
- package/src/components/site-header.tsx +169 -0
- package/src/components/site-layout.tsx +147 -0
- package/src/components/skeleton.tsx +19 -0
- package/src/components/slider.tsx +46 -0
- package/src/components/spinner.tsx +42 -0
- package/src/components/stat.tsx +155 -0
- package/src/components/status-dot.tsx +94 -0
- package/src/components/switch.tsx +70 -0
- package/src/components/table.tsx +133 -0
- package/src/components/tabs.tsx +99 -0
- package/src/components/textarea.tsx +23 -0
- package/src/components/toast.tsx +221 -0
- package/src/components/toc.tsx +122 -0
- package/src/components/toggle-group.tsx +95 -0
- package/src/components/toggle.tsx +59 -0
- package/src/components/toolbar.tsx +97 -0
- package/src/components/tooltip.tsx +57 -0
- package/src/components/trace.tsx +143 -0
- package/src/components/typography.tsx +205 -0
- package/src/hooks/use-highlighted-code.ts +71 -0
- package/src/hooks/use-mobile.ts +19 -0
- package/src/lib/color.ts +76 -0
- package/src/lib/highlighter.tsx +121 -0
- package/src/lib/recipes.ts +47 -0
- package/src/lib/utils.ts +1 -0
- package/src/provider/index.ts +2 -0
- package/src/provider/theme-provider.tsx +210 -0
- package/src/provider/theme.ts +83 -0
- package/src/styles/kernelkit.css +301 -0
- package/src/styles/shadcn.css +555 -0
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
createContext,
|
|
5
|
+
type ReactNode,
|
|
6
|
+
useCallback,
|
|
7
|
+
useContext,
|
|
8
|
+
useEffect,
|
|
9
|
+
useLayoutEffect,
|
|
10
|
+
useMemo,
|
|
11
|
+
useState,
|
|
12
|
+
useSyncExternalStore,
|
|
13
|
+
} from "react";
|
|
14
|
+
|
|
15
|
+
import {
|
|
16
|
+
applyTheme,
|
|
17
|
+
DEFAULT_STORAGE_KEY,
|
|
18
|
+
DEFAULT_THEME,
|
|
19
|
+
type ResolvedMode,
|
|
20
|
+
sanitizeTheme,
|
|
21
|
+
themeClassName,
|
|
22
|
+
themeScript,
|
|
23
|
+
type ThemeScriptOptions,
|
|
24
|
+
type ThemeState,
|
|
25
|
+
} from "./theme";
|
|
26
|
+
|
|
27
|
+
export interface ThemeContextValue extends ThemeState {
|
|
28
|
+
/** `mode` with "system" resolved against the OS preference. */
|
|
29
|
+
resolvedMode: ResolvedMode;
|
|
30
|
+
setTheme: (patch: Partial<ThemeState>) => void;
|
|
31
|
+
setMode: (mode: ThemeState["mode"]) => void;
|
|
32
|
+
setContrast: (contrast: ThemeState["contrast"]) => void;
|
|
33
|
+
setAccent: (accent: ThemeState["accent"]) => void;
|
|
34
|
+
setRadius: (radius: ThemeState["radius"]) => void;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
const ThemeContext = createContext<ThemeContextValue | null>(null);
|
|
38
|
+
|
|
39
|
+
/** Element overlays portal into, so popups inside a ThemeScope keep its theme. */
|
|
40
|
+
const PortalContainerContext = createContext<HTMLElement | null>(null);
|
|
41
|
+
|
|
42
|
+
const useIsoLayoutEffect = typeof window === "undefined" ? useEffect : useLayoutEffect;
|
|
43
|
+
|
|
44
|
+
const DARK_QUERY = "(prefers-color-scheme: dark)";
|
|
45
|
+
|
|
46
|
+
function subscribeSystem(onChange: () => void) {
|
|
47
|
+
const mq = window.matchMedia(DARK_QUERY);
|
|
48
|
+
mq.addEventListener("change", onChange);
|
|
49
|
+
return () => mq.removeEventListener("change", onChange);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
function useSystemMode(): ResolvedMode {
|
|
53
|
+
return useSyncExternalStore(
|
|
54
|
+
subscribeSystem,
|
|
55
|
+
() => (window.matchMedia(DARK_QUERY).matches ? "dark" : "light"),
|
|
56
|
+
() => "light",
|
|
57
|
+
);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
function readStored(key: string, fallback: ThemeState): ThemeState {
|
|
61
|
+
if (typeof window === "undefined") {
|
|
62
|
+
return fallback;
|
|
63
|
+
}
|
|
64
|
+
try {
|
|
65
|
+
return sanitizeTheme(JSON.parse(window.localStorage.getItem(key) ?? "null"), fallback);
|
|
66
|
+
} catch {
|
|
67
|
+
return fallback;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export interface ThemeProviderProps {
|
|
72
|
+
children?: ReactNode;
|
|
73
|
+
/** Initial values when nothing is stored. Default: system mode, normal contrast, pink, md radius. */
|
|
74
|
+
defaultTheme?: Partial<ThemeState>;
|
|
75
|
+
/** localStorage key; `null` disables persistence. */
|
|
76
|
+
storageKey?: string | null;
|
|
77
|
+
/** Force values regardless of storage/user choice (e.g. a site that is always red). */
|
|
78
|
+
forcedTheme?: Partial<ThemeState>;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Owns the app theme: applies `.light/.dark`, `.hc`, `.accent-*`, `.radius-*` to <html>, persists the
|
|
83
|
+
* choice and syncs it across tabs. Pair with <ThemeScript /> in <head> to avoid a flash on load.
|
|
84
|
+
*/
|
|
85
|
+
export function ThemeProvider({
|
|
86
|
+
children,
|
|
87
|
+
defaultTheme,
|
|
88
|
+
storageKey = DEFAULT_STORAGE_KEY,
|
|
89
|
+
forcedTheme,
|
|
90
|
+
}: ThemeProviderProps) {
|
|
91
|
+
const fallback = useMemo(
|
|
92
|
+
() => ({...DEFAULT_THEME, ...defaultTheme}),
|
|
93
|
+
[defaultTheme?.mode, defaultTheme?.contrast, defaultTheme?.accent, defaultTheme?.radius],
|
|
94
|
+
);
|
|
95
|
+
// Server and first client render use the defaults; the stored value lands in a layout effect
|
|
96
|
+
// (the pre-paint script has already put the right classes on <html>, so nothing flashes).
|
|
97
|
+
const [stored, setStored] = useState<ThemeState>(fallback);
|
|
98
|
+
useIsoLayoutEffect(() => {
|
|
99
|
+
if (storageKey) {
|
|
100
|
+
setStored(readStored(storageKey, fallback));
|
|
101
|
+
}
|
|
102
|
+
}, [storageKey, fallback]);
|
|
103
|
+
|
|
104
|
+
useEffect(() => {
|
|
105
|
+
if (!storageKey) {
|
|
106
|
+
return;
|
|
107
|
+
}
|
|
108
|
+
const onStorage = (e: StorageEvent) => {
|
|
109
|
+
if (e.key === storageKey) {
|
|
110
|
+
setStored(readStored(storageKey, fallback));
|
|
111
|
+
}
|
|
112
|
+
};
|
|
113
|
+
window.addEventListener("storage", onStorage);
|
|
114
|
+
return () => window.removeEventListener("storage", onStorage);
|
|
115
|
+
}, [storageKey, fallback]);
|
|
116
|
+
|
|
117
|
+
const theme = useMemo(() => ({...stored, ...forcedTheme}), [stored, forcedTheme]);
|
|
118
|
+
const system = useSystemMode();
|
|
119
|
+
const resolvedMode = theme.mode === "system" ? system : theme.mode;
|
|
120
|
+
|
|
121
|
+
useIsoLayoutEffect(() => {
|
|
122
|
+
applyTheme(document.documentElement, {...theme, mode: resolvedMode});
|
|
123
|
+
}, [theme.contrast, theme.accent, theme.radius, resolvedMode]);
|
|
124
|
+
|
|
125
|
+
const setTheme = useCallback(
|
|
126
|
+
(patch: Partial<ThemeState>) => {
|
|
127
|
+
setStored((prev) => {
|
|
128
|
+
const next = sanitizeTheme({...prev, ...patch}, fallback);
|
|
129
|
+
if (storageKey) {
|
|
130
|
+
try {
|
|
131
|
+
window.localStorage.setItem(storageKey, JSON.stringify(next));
|
|
132
|
+
} catch {
|
|
133
|
+
// storage blocked (private mode, quota): keep the in-memory choice
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
return next;
|
|
137
|
+
});
|
|
138
|
+
},
|
|
139
|
+
[storageKey, fallback],
|
|
140
|
+
);
|
|
141
|
+
|
|
142
|
+
const value = useMemo<ThemeContextValue>(
|
|
143
|
+
() => ({
|
|
144
|
+
...theme,
|
|
145
|
+
resolvedMode,
|
|
146
|
+
setTheme,
|
|
147
|
+
setMode: (mode) => setTheme({mode}),
|
|
148
|
+
setContrast: (contrast) => setTheme({contrast}),
|
|
149
|
+
setAccent: (accent) => setTheme({accent}),
|
|
150
|
+
setRadius: (radius) => setTheme({radius}),
|
|
151
|
+
}),
|
|
152
|
+
[theme, resolvedMode, setTheme],
|
|
153
|
+
);
|
|
154
|
+
|
|
155
|
+
return <ThemeContext.Provider value={value}>{children}</ThemeContext.Provider>;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
/** Current theme and setters. Must be used under <ThemeProvider>. */
|
|
159
|
+
export function useTheme(): ThemeContextValue {
|
|
160
|
+
const ctx = useContext(ThemeContext);
|
|
161
|
+
if (!ctx) {
|
|
162
|
+
throw new Error("useTheme must be used within <ThemeProvider>");
|
|
163
|
+
}
|
|
164
|
+
return ctx;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
/** Renders the pre-paint script. Place in <head> (Next.js: in the root layout). */
|
|
168
|
+
export function ThemeScript({nonce, ...options}: ThemeScriptOptions & {nonce?: string}) {
|
|
169
|
+
return <script nonce={nonce} suppressHydrationWarning dangerouslySetInnerHTML={{__html: themeScript(options)}} />;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
export interface ThemeScopeProps extends Omit<React.ComponentProps<"div">, "children"> {
|
|
173
|
+
children?: ReactNode;
|
|
174
|
+
/** Values not given inherit from the surrounding <ThemeProvider> (or the defaults). */
|
|
175
|
+
mode?: ResolvedMode;
|
|
176
|
+
contrast?: ThemeState["contrast"];
|
|
177
|
+
accent?: ThemeState["accent"];
|
|
178
|
+
radius?: ThemeState["radius"];
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
/**
|
|
182
|
+
* A subtree with its own theme (previews, side-by-side comparisons). Overlays opened inside portal into
|
|
183
|
+
* the scope, so they keep its colors and radius.
|
|
184
|
+
*/
|
|
185
|
+
export function ThemeScope({mode, contrast, accent, radius, className, children, ...props}: ThemeScopeProps) {
|
|
186
|
+
const parent = useContext(ThemeContext);
|
|
187
|
+
const [container, setContainer] = useState<HTMLDivElement | null>(null);
|
|
188
|
+
const theme = {
|
|
189
|
+
mode: mode ?? parent?.resolvedMode ?? "light",
|
|
190
|
+
contrast: contrast ?? parent?.contrast ?? DEFAULT_THEME.contrast,
|
|
191
|
+
accent: accent ?? parent?.accent ?? DEFAULT_THEME.accent,
|
|
192
|
+
radius: radius ?? parent?.radius ?? DEFAULT_THEME.radius,
|
|
193
|
+
};
|
|
194
|
+
const classes = themeClassName(theme);
|
|
195
|
+
return (
|
|
196
|
+
<div
|
|
197
|
+
data-slot="theme-scope"
|
|
198
|
+
className={[classes, "bg-background text-foreground", className].filter(Boolean).join(" ")}
|
|
199
|
+
{...props}
|
|
200
|
+
>
|
|
201
|
+
<PortalContainerContext.Provider value={container}>{children}</PortalContainerContext.Provider>
|
|
202
|
+
<div ref={setContainer} data-slot="theme-scope-portal" className={classes} />
|
|
203
|
+
</div>
|
|
204
|
+
);
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
/** Container for `*.Portal` parts: the nearest ThemeScope's portal root, else document.body. */
|
|
208
|
+
export function usePortalContainer(): HTMLElement | undefined {
|
|
209
|
+
return useContext(PortalContainerContext) ?? undefined;
|
|
210
|
+
}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
/** Theme model shared by the provider, the pre-paint script and ThemeScope. No React here. */
|
|
2
|
+
|
|
3
|
+
export const MODES = ["system", "light", "dark"] as const;
|
|
4
|
+
export const CONTRASTS = ["normal", "high"] as const;
|
|
5
|
+
/** TermiColor accents (same names and order as @repraze/termicolor's ACCENTS). */
|
|
6
|
+
export const ACCENTS = ["red", "orange", "yellow", "green", "cyan", "blue", "purple", "pink"] as const;
|
|
7
|
+
export const RADII = ["none", "sm", "md", "lg", "xl"] as const;
|
|
8
|
+
|
|
9
|
+
export type Mode = (typeof MODES)[number];
|
|
10
|
+
export type ResolvedMode = Exclude<Mode, "system">;
|
|
11
|
+
export type Contrast = (typeof CONTRASTS)[number];
|
|
12
|
+
export type Accent = (typeof ACCENTS)[number];
|
|
13
|
+
export type Radius = (typeof RADII)[number];
|
|
14
|
+
|
|
15
|
+
export interface ThemeState {
|
|
16
|
+
mode: Mode;
|
|
17
|
+
contrast: Contrast;
|
|
18
|
+
accent: Accent;
|
|
19
|
+
radius: Radius;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export const DEFAULT_THEME: ThemeState = {mode: "system", contrast: "normal", accent: "pink", radius: "md"};
|
|
23
|
+
export const DEFAULT_STORAGE_KEY = "kernelkit-theme";
|
|
24
|
+
|
|
25
|
+
/** Keep only known values, falling back per field (storage may hold stale or hand-edited JSON). */
|
|
26
|
+
export function sanitizeTheme(value: unknown, fallback: ThemeState): ThemeState {
|
|
27
|
+
const v = (value && typeof value === "object" ? value : {}) as Record<string, unknown>;
|
|
28
|
+
const pick = <T extends string>(list: readonly T[], key: keyof ThemeState): T =>
|
|
29
|
+
list.includes(v[key] as T) ? (v[key] as T) : (fallback[key] as T);
|
|
30
|
+
return {
|
|
31
|
+
mode: pick(MODES, "mode"),
|
|
32
|
+
contrast: pick(CONTRASTS, "contrast"),
|
|
33
|
+
accent: pick(ACCENTS, "accent"),
|
|
34
|
+
radius: pick(RADII, "radius"),
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/** Class toggles for a theme scope: .light/.dark, .hc, .accent-<name>, .radius-<size>. */
|
|
39
|
+
export function themeClasses(theme: Omit<ThemeState, "mode"> & {mode: ResolvedMode}): Record<string, boolean> {
|
|
40
|
+
return {
|
|
41
|
+
light: theme.mode === "light",
|
|
42
|
+
dark: theme.mode === "dark",
|
|
43
|
+
hc: theme.contrast === "high",
|
|
44
|
+
...Object.fromEntries(ACCENTS.map((a) => [`accent-${a}`, a === theme.accent])),
|
|
45
|
+
...Object.fromEntries(RADII.map((r) => [`radius-${r}`, r === theme.radius])),
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/** Space-separated class string for a resolved theme (for SSR markup and ThemeScope). */
|
|
50
|
+
export function themeClassName(theme: Omit<ThemeState, "mode"> & {mode: ResolvedMode}): string {
|
|
51
|
+
return Object.entries(themeClasses(theme))
|
|
52
|
+
.filter(([, on]) => on)
|
|
53
|
+
.map(([name]) => name)
|
|
54
|
+
.join(" ");
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export function applyTheme(el: Element, theme: Omit<ThemeState, "mode"> & {mode: ResolvedMode}) {
|
|
58
|
+
for (const [name, on] of Object.entries(themeClasses(theme))) {
|
|
59
|
+
el.classList.toggle(name, on);
|
|
60
|
+
}
|
|
61
|
+
(el as HTMLElement).style.colorScheme = theme.mode;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export interface ThemeScriptOptions {
|
|
65
|
+
storageKey?: string;
|
|
66
|
+
defaults?: Partial<ThemeState>;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Inline script source that applies the stored theme to <html> before first paint. Put it in <head>
|
|
71
|
+
* (or use <ThemeScript />). Self-contained: it can't import anything, so it repeats the class logic.
|
|
72
|
+
*/
|
|
73
|
+
export function themeScript({storageKey = DEFAULT_STORAGE_KEY, defaults}: ThemeScriptOptions = {}): string {
|
|
74
|
+
const d = {...DEFAULT_THEME, ...defaults};
|
|
75
|
+
const lists = {mode: MODES, contrast: CONTRASTS, accent: ACCENTS, radius: RADII};
|
|
76
|
+
return `(function(){try{var k=${JSON.stringify(storageKey)},d=${JSON.stringify(d)},l=${JSON.stringify(lists)},s={};
|
|
77
|
+
try{s=JSON.parse(localStorage.getItem(k))||{}}catch(e){}
|
|
78
|
+
var t={};for(var f in l){t[f]=l[f].indexOf(s[f])>=0?s[f]:d[f]}
|
|
79
|
+
var m=t.mode==="system"?(matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"):t.mode;
|
|
80
|
+
var c=document.documentElement.classList;c.toggle("light",m==="light");c.toggle("dark",m==="dark");c.toggle("hc",t.contrast==="high");
|
|
81
|
+
l.accent.forEach(function(a){c.toggle("accent-"+a,a===t.accent)});l.radius.forEach(function(r){c.toggle("radius-"+r,r===t.radius)});
|
|
82
|
+
document.documentElement.style.colorScheme=m}catch(e){}})();`;
|
|
83
|
+
}
|
|
@@ -0,0 +1,301 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* KernelKit styles. Import after Tailwind in your app stylesheet:
|
|
3
|
+
*
|
|
4
|
+
* @import "tailwindcss";
|
|
5
|
+
* @import "@repraze/kernelkit/styles.css";
|
|
6
|
+
*
|
|
7
|
+
* Layers: TermiColor palette (--tc-*) → shadcn tokens (--primary, …) → kernelkit knobs (--kk-*).
|
|
8
|
+
* Theme with classes on <html> (or any subtree): .light/.dark, .hc, .accent-<name>, .radius-<size>.
|
|
9
|
+
*/
|
|
10
|
+
@import "tw-animate-css";
|
|
11
|
+
@import "@repraze/termicolor/palette.css";
|
|
12
|
+
@import "@repraze/termicolor/shadcn.css";
|
|
13
|
+
@import "./shadcn.css";
|
|
14
|
+
|
|
15
|
+
/* KernelKit's own class names live in its sources: let Tailwind see them from node_modules. */
|
|
16
|
+
@source "../components";
|
|
17
|
+
@source "../provider";
|
|
18
|
+
@source "../lib";
|
|
19
|
+
@source "../hooks";
|
|
20
|
+
|
|
21
|
+
/* Nearest scope wins, so a .light preview nested in a .dark page isn't styled as dark. */
|
|
22
|
+
@custom-variant dark (&:is(.dark, .dark *):not(.dark .light, .dark .light *));
|
|
23
|
+
@custom-variant hc (&:is(.hc, .hc *));
|
|
24
|
+
|
|
25
|
+
/* ─── Accent: pink unless an .accent-<name> ancestor says otherwise ─────────────────────────────── */
|
|
26
|
+
/* Same specificity as the palette's mode scopes and loaded later, so it replaces their purple
|
|
27
|
+
default; palette.css's .accent-<name> rules are more specific, so they still win. */
|
|
28
|
+
:root,
|
|
29
|
+
.light,
|
|
30
|
+
.dark {
|
|
31
|
+
--tc-accent: var(--tc-accent-pink-accent);
|
|
32
|
+
--tc-on-accent: var(--tc-accent-pink-on-accent);
|
|
33
|
+
--tc-accent-tint: var(--tc-accent-pink-accent-tint);
|
|
34
|
+
--tc-accent-bright: var(--tc-accent-pink-accent-bright);
|
|
35
|
+
--tc-accent-fill: var(--tc-accent-pink-accent-fill);
|
|
36
|
+
--tc-on-accent-fill: var(--tc-accent-pink-on-accent-fill);
|
|
37
|
+
--tc-cursor: var(--tc-accent-pink-cursor);
|
|
38
|
+
--tc-selection: var(--tc-accent-pink-selection);
|
|
39
|
+
--tc-selection-inactive: var(--tc-accent-pink-selection-inactive);
|
|
40
|
+
--tc-focus-ring: var(--tc-accent-pink-focus-ring);
|
|
41
|
+
--tc-tab-indicator: var(--tc-accent-pink-tab-indicator);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/* Light mode: TermiColor's bgRaised is ~2% off the sunken page background, so secondary surfaces
|
|
45
|
+
(neutral buttons, badges, user bubbles) vanished. Nudge them toward the foreground. */
|
|
46
|
+
:root:not(.dark),
|
|
47
|
+
.light {
|
|
48
|
+
--secondary: color-mix(in oklch, var(--tc-bg-raised), var(--tc-fg) 5%);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/* Field backgrounds as tokens, not `dark:bg-input/30` classes: a variant-prefixed background outranks
|
|
52
|
+
`hover:` and `data-*:` states, which killed hover on dark outline surfaces. One plain `bg-field` class
|
|
53
|
+
and the mode decides. Fields sit on TermiColor's bgRaised ("things that take input", DESIGN.md §4);
|
|
54
|
+
hover steps toward the foreground so it reads on any surface. */
|
|
55
|
+
:root,
|
|
56
|
+
.light,
|
|
57
|
+
.dark {
|
|
58
|
+
--field: var(--tc-bg-raised);
|
|
59
|
+
--field-hover: color-mix(in oklch, var(--tc-bg-raised), var(--tc-fg) 7%);
|
|
60
|
+
--field-disabled: var(--tc-bg-raised);
|
|
61
|
+
}
|
|
62
|
+
/* hc: bgRaised is ~flat there, so hover needs a stronger step to stay visible */
|
|
63
|
+
.hc,
|
|
64
|
+
.hc .light,
|
|
65
|
+
.hc .dark {
|
|
66
|
+
--field-hover: color-mix(in oklch, var(--tc-bg-raised), var(--tc-fg) 18%);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/* ─── Status roles (never follow the accent) ────────────────────────────────────────────────────── */
|
|
70
|
+
:root,
|
|
71
|
+
.light,
|
|
72
|
+
.dark {
|
|
73
|
+
--destructive-foreground: var(--tc-red-on);
|
|
74
|
+
--danger: var(--tc-danger);
|
|
75
|
+
--danger-foreground: var(--tc-red-on);
|
|
76
|
+
--danger-tint: var(--tc-red-tint);
|
|
77
|
+
--warning: var(--tc-warning);
|
|
78
|
+
--warning-foreground: var(--tc-yellow-on);
|
|
79
|
+
--warning-tint: var(--tc-yellow-tint);
|
|
80
|
+
--success: var(--tc-success);
|
|
81
|
+
--success-foreground: var(--tc-green-on);
|
|
82
|
+
--success-tint: var(--tc-green-tint);
|
|
83
|
+
--info: var(--tc-info);
|
|
84
|
+
--info-foreground: var(--tc-blue-on);
|
|
85
|
+
--info-tint: var(--tc-blue-tint);
|
|
86
|
+
--selection: var(--tc-selection);
|
|
87
|
+
--shadow-color: var(--tc-shadow);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/* ─── Code: Shiki css-variables theme (lib/highlighter.tsx) → TermiColor syntax roles ───────────── */
|
|
91
|
+
:root,
|
|
92
|
+
.light,
|
|
93
|
+
.dark {
|
|
94
|
+
--kk-code-foreground: var(--tc-fg);
|
|
95
|
+
--kk-code-background: transparent;
|
|
96
|
+
--kk-code-token-comment: var(--tc-syntax-comment);
|
|
97
|
+
--kk-code-token-constant: var(--tc-syntax-constant);
|
|
98
|
+
--kk-code-token-string: var(--tc-syntax-string);
|
|
99
|
+
--kk-code-token-string-expression: var(--tc-syntax-string);
|
|
100
|
+
--kk-code-token-keyword: var(--tc-syntax-keyword);
|
|
101
|
+
--kk-code-token-parameter: var(--tc-syntax-parameter);
|
|
102
|
+
--kk-code-token-function: var(--tc-syntax-function);
|
|
103
|
+
--kk-code-token-punctuation: var(--tc-syntax-punctuation);
|
|
104
|
+
--kk-code-token-link: var(--tc-syntax-link);
|
|
105
|
+
--kk-code-token-inserted: var(--tc-added);
|
|
106
|
+
--kk-code-token-deleted: var(--tc-removed);
|
|
107
|
+
--kk-code-token-changed: var(--tc-modified);
|
|
108
|
+
--kk-code-ansi-black: var(--tc-ansi-black);
|
|
109
|
+
--kk-code-ansi-bright-black: var(--tc-ansi-bright-black);
|
|
110
|
+
--kk-code-ansi-red: var(--tc-ansi-red);
|
|
111
|
+
--kk-code-ansi-bright-red: var(--tc-ansi-bright-red);
|
|
112
|
+
--kk-code-ansi-green: var(--tc-ansi-green);
|
|
113
|
+
--kk-code-ansi-bright-green: var(--tc-ansi-bright-green);
|
|
114
|
+
--kk-code-ansi-yellow: var(--tc-ansi-yellow);
|
|
115
|
+
--kk-code-ansi-bright-yellow: var(--tc-ansi-bright-yellow);
|
|
116
|
+
--kk-code-ansi-blue: var(--tc-ansi-blue);
|
|
117
|
+
--kk-code-ansi-bright-blue: var(--tc-ansi-bright-blue);
|
|
118
|
+
--kk-code-ansi-magenta: var(--tc-ansi-magenta);
|
|
119
|
+
--kk-code-ansi-bright-magenta: var(--tc-ansi-bright-magenta);
|
|
120
|
+
--kk-code-ansi-cyan: var(--tc-ansi-cyan);
|
|
121
|
+
--kk-code-ansi-bright-cyan: var(--tc-ansi-bright-cyan);
|
|
122
|
+
--kk-code-ansi-white: var(--tc-ansi-white);
|
|
123
|
+
--kk-code-ansi-bright-white: var(--tc-ansi-bright-white);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
/* ─── Knobs ─────────────────────────────────────────────────────────────────────────────────────── */
|
|
127
|
+
:root {
|
|
128
|
+
/* Corner radius of a md control; every rounded-* step derives from it. 0 = sharp. */
|
|
129
|
+
--kk-radius: 0.5rem;
|
|
130
|
+
/* shadcn name, for app code and third-party snippets that read var(--radius) */
|
|
131
|
+
--radius: var(--kk-radius);
|
|
132
|
+
--kk-font-sans: ui-sans-serif, system-ui, sans-serif;
|
|
133
|
+
--kk-font-mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
|
|
134
|
+
/* Titles: card, dialog, sheet, empty, alert. Mono by default (the TermiColor look). */
|
|
135
|
+
--kk-font-heading: var(--kk-font-mono);
|
|
136
|
+
/* Site shell (site-header, site-layout): content width, and the sticky header's height that
|
|
137
|
+
sidebars and anchors offset by. A site with a banner above the header row adds it here. */
|
|
138
|
+
--kk-site-width: 80rem;
|
|
139
|
+
--kk-header-height: 3.5rem;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
.radius-none {
|
|
143
|
+
--kk-radius: 0px;
|
|
144
|
+
}
|
|
145
|
+
.radius-sm {
|
|
146
|
+
--kk-radius: 0.25rem;
|
|
147
|
+
}
|
|
148
|
+
.radius-md {
|
|
149
|
+
--kk-radius: 0.5rem;
|
|
150
|
+
}
|
|
151
|
+
.radius-lg {
|
|
152
|
+
--kk-radius: 0.75rem;
|
|
153
|
+
}
|
|
154
|
+
.radius-xl {
|
|
155
|
+
--kk-radius: 1rem;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
@theme inline {
|
|
159
|
+
--font-sans: var(--kk-font-sans);
|
|
160
|
+
--font-mono: var(--kk-font-mono);
|
|
161
|
+
--font-heading: var(--kk-font-heading);
|
|
162
|
+
|
|
163
|
+
--radius-xs: calc(var(--kk-radius) * 0.25);
|
|
164
|
+
--radius-sm: calc(var(--kk-radius) * 0.5);
|
|
165
|
+
--radius-md: calc(var(--kk-radius) * 0.75);
|
|
166
|
+
--radius-lg: var(--kk-radius);
|
|
167
|
+
--radius-xl: calc(var(--kk-radius) * 1.5);
|
|
168
|
+
--radius-2xl: calc(var(--kk-radius) * 2);
|
|
169
|
+
--radius-3xl: calc(var(--kk-radius) * 3);
|
|
170
|
+
--radius-4xl: calc(var(--kk-radius) * 4);
|
|
171
|
+
/* Pills (switch, badge, avatar, radio): fully round, but square when the radius knob is 0. */
|
|
172
|
+
--radius-pill: calc(var(--kk-radius) * 999);
|
|
173
|
+
|
|
174
|
+
/* Indeterminate bar: a 40% segment sweeping across its track (progress, loading strips). */
|
|
175
|
+
--animate-indeterminate: kk-indeterminate 1.2s ease-in-out infinite;
|
|
176
|
+
@keyframes kk-indeterminate {
|
|
177
|
+
from {
|
|
178
|
+
translate: -100% 0;
|
|
179
|
+
}
|
|
180
|
+
to {
|
|
181
|
+
translate: 250% 0;
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
/* Boxes under 20px (checkbox, kbd keys, tiny chips): capped so they never turn into circles at xl. */
|
|
185
|
+
--radius-box: min(calc(var(--kk-radius) * 0.5), 0.25rem);
|
|
186
|
+
|
|
187
|
+
--color-background: var(--background);
|
|
188
|
+
--color-foreground: var(--foreground);
|
|
189
|
+
--color-card: var(--card);
|
|
190
|
+
--color-card-foreground: var(--card-foreground);
|
|
191
|
+
--color-popover: var(--popover);
|
|
192
|
+
--color-popover-foreground: var(--popover-foreground);
|
|
193
|
+
--color-primary: var(--primary);
|
|
194
|
+
--color-primary-foreground: var(--primary-foreground);
|
|
195
|
+
/* accent-colored text and icons: the text tier (light mode darkens it for contrast on white).
|
|
196
|
+
--primary itself is the vivid fill tier, for solid surfaces. */
|
|
197
|
+
--color-primary-text: var(--primary-text);
|
|
198
|
+
/* current row in a nav list (sidebar, phone menu): the accent's tint */
|
|
199
|
+
--color-primary-tint: var(--tc-accent-tint);
|
|
200
|
+
--color-secondary: var(--secondary);
|
|
201
|
+
--color-secondary-foreground: var(--secondary-foreground);
|
|
202
|
+
--color-muted: var(--muted);
|
|
203
|
+
--color-muted-foreground: var(--muted-foreground);
|
|
204
|
+
--color-accent: var(--accent);
|
|
205
|
+
--color-accent-foreground: var(--accent-foreground);
|
|
206
|
+
/* hover wash: visible in high contrast, unlike a surface shade (TermiColor DESIGN.md §6) */
|
|
207
|
+
--color-hover: var(--hover);
|
|
208
|
+
--color-destructive: var(--destructive);
|
|
209
|
+
--color-destructive-foreground: var(--destructive-foreground);
|
|
210
|
+
--color-border: var(--border);
|
|
211
|
+
--color-input: var(--input);
|
|
212
|
+
--color-field: var(--field);
|
|
213
|
+
--color-field-hover: var(--field-hover);
|
|
214
|
+
--color-field-disabled: var(--field-disabled);
|
|
215
|
+
--color-ring: var(--ring);
|
|
216
|
+
--color-selection: var(--selection);
|
|
217
|
+
|
|
218
|
+
--color-danger: var(--danger);
|
|
219
|
+
--color-danger-foreground: var(--danger-foreground);
|
|
220
|
+
--color-danger-tint: var(--danger-tint);
|
|
221
|
+
--color-warning: var(--warning);
|
|
222
|
+
--color-warning-foreground: var(--warning-foreground);
|
|
223
|
+
--color-warning-tint: var(--warning-tint);
|
|
224
|
+
--color-success: var(--success);
|
|
225
|
+
--color-success-foreground: var(--success-foreground);
|
|
226
|
+
--color-success-tint: var(--success-tint);
|
|
227
|
+
--color-info: var(--info);
|
|
228
|
+
--color-info-foreground: var(--info-foreground);
|
|
229
|
+
--color-info-tint: var(--info-tint);
|
|
230
|
+
|
|
231
|
+
--color-chart-1: var(--chart-1);
|
|
232
|
+
--color-chart-2: var(--chart-2);
|
|
233
|
+
--color-chart-3: var(--chart-3);
|
|
234
|
+
--color-chart-4: var(--chart-4);
|
|
235
|
+
--color-chart-5: var(--chart-5);
|
|
236
|
+
|
|
237
|
+
--color-sidebar: var(--sidebar);
|
|
238
|
+
--color-sidebar-foreground: var(--sidebar-foreground);
|
|
239
|
+
--color-sidebar-primary: var(--sidebar-primary);
|
|
240
|
+
--color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
|
|
241
|
+
--color-sidebar-accent: var(--sidebar-accent);
|
|
242
|
+
--color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
|
|
243
|
+
--color-sidebar-border: var(--sidebar-border);
|
|
244
|
+
--color-sidebar-ring: var(--sidebar-ring);
|
|
245
|
+
|
|
246
|
+
/* TermiColor accents as utilities: text-tc-pink, bg-tc-blue-tint, bg-tc-green-fill, … */
|
|
247
|
+
--color-tc-red: var(--tc-red);
|
|
248
|
+
--color-tc-red-on: var(--tc-red-on);
|
|
249
|
+
--color-tc-red-fill: var(--tc-red-fill);
|
|
250
|
+
--color-tc-red-on-fill: var(--tc-red-on-fill);
|
|
251
|
+
--color-tc-red-tint: var(--tc-red-tint);
|
|
252
|
+
--color-tc-orange: var(--tc-orange);
|
|
253
|
+
--color-tc-orange-on: var(--tc-orange-on);
|
|
254
|
+
--color-tc-orange-fill: var(--tc-orange-fill);
|
|
255
|
+
--color-tc-orange-on-fill: var(--tc-orange-on-fill);
|
|
256
|
+
--color-tc-orange-tint: var(--tc-orange-tint);
|
|
257
|
+
--color-tc-yellow: var(--tc-yellow);
|
|
258
|
+
--color-tc-yellow-on: var(--tc-yellow-on);
|
|
259
|
+
--color-tc-yellow-fill: var(--tc-yellow-fill);
|
|
260
|
+
--color-tc-yellow-on-fill: var(--tc-yellow-on-fill);
|
|
261
|
+
--color-tc-yellow-tint: var(--tc-yellow-tint);
|
|
262
|
+
--color-tc-green: var(--tc-green);
|
|
263
|
+
--color-tc-green-on: var(--tc-green-on);
|
|
264
|
+
--color-tc-green-fill: var(--tc-green-fill);
|
|
265
|
+
--color-tc-green-on-fill: var(--tc-green-on-fill);
|
|
266
|
+
--color-tc-green-tint: var(--tc-green-tint);
|
|
267
|
+
--color-tc-cyan: var(--tc-cyan);
|
|
268
|
+
--color-tc-cyan-on: var(--tc-cyan-on);
|
|
269
|
+
--color-tc-cyan-fill: var(--tc-cyan-fill);
|
|
270
|
+
--color-tc-cyan-on-fill: var(--tc-cyan-on-fill);
|
|
271
|
+
--color-tc-cyan-tint: var(--tc-cyan-tint);
|
|
272
|
+
--color-tc-blue: var(--tc-blue);
|
|
273
|
+
--color-tc-blue-on: var(--tc-blue-on);
|
|
274
|
+
--color-tc-blue-fill: var(--tc-blue-fill);
|
|
275
|
+
--color-tc-blue-on-fill: var(--tc-blue-on-fill);
|
|
276
|
+
--color-tc-blue-tint: var(--tc-blue-tint);
|
|
277
|
+
--color-tc-purple: var(--tc-purple);
|
|
278
|
+
--color-tc-purple-on: var(--tc-purple-on);
|
|
279
|
+
--color-tc-purple-fill: var(--tc-purple-fill);
|
|
280
|
+
--color-tc-purple-on-fill: var(--tc-purple-on-fill);
|
|
281
|
+
--color-tc-purple-tint: var(--tc-purple-tint);
|
|
282
|
+
--color-tc-pink: var(--tc-pink);
|
|
283
|
+
--color-tc-pink-on: var(--tc-pink-on);
|
|
284
|
+
--color-tc-pink-fill: var(--tc-pink-fill);
|
|
285
|
+
--color-tc-pink-on-fill: var(--tc-pink-on-fill);
|
|
286
|
+
--color-tc-pink-tint: var(--tc-pink-tint);
|
|
287
|
+
--color-tc-fg-soft: var(--tc-fg-soft);
|
|
288
|
+
--color-tc-fg-muted: var(--tc-fg-muted);
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
@layer base {
|
|
292
|
+
* {
|
|
293
|
+
@apply border-border outline-ring/50;
|
|
294
|
+
}
|
|
295
|
+
body {
|
|
296
|
+
@apply bg-background text-foreground font-sans antialiased;
|
|
297
|
+
}
|
|
298
|
+
::selection {
|
|
299
|
+
background: var(--selection);
|
|
300
|
+
}
|
|
301
|
+
}
|