@r0hitsharma/design-system 0.12.0-rohit-fork-ci.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +237 -0
- package/dist/ark.d.ts +28 -0
- package/dist/ark.js +27 -0
- package/dist/component-manifest.d.ts +475 -0
- package/dist/component-manifest.js +498 -0
- package/dist/components/AsyncStateRenderer.d.ts +12 -0
- package/dist/components/AsyncStateRenderer.js +13 -0
- package/dist/components/Badge.d.ts +25 -0
- package/dist/components/Badge.js +20 -0
- package/dist/components/Button.d.ts +21 -0
- package/dist/components/Button.js +27 -0
- package/dist/components/Chip.d.ts +25 -0
- package/dist/components/Chip.js +34 -0
- package/dist/components/Code.d.ts +7 -0
- package/dist/components/Code.js +19 -0
- package/dist/components/DateRangeFilter.d.ts +22 -0
- package/dist/components/DateRangeFilter.js +24 -0
- package/dist/components/Drawer.d.ts +31 -0
- package/dist/components/Drawer.js +56 -0
- package/dist/components/EmptyState.d.ts +12 -0
- package/dist/components/EmptyState.js +14 -0
- package/dist/components/ErrorBoundary.d.ts +21 -0
- package/dist/components/ErrorBoundary.js +87 -0
- package/dist/components/ErrorState.d.ts +26 -0
- package/dist/components/ErrorState.js +85 -0
- package/dist/components/FacetedMultiSelect.d.ts +32 -0
- package/dist/components/FacetedMultiSelect.js +33 -0
- package/dist/components/Figure.d.ts +35 -0
- package/dist/components/Figure.js +24 -0
- package/dist/components/FlashOnChange.d.ts +55 -0
- package/dist/components/FlashOnChange.js +108 -0
- package/dist/components/HeatCell.d.ts +41 -0
- package/dist/components/HeatCell.js +35 -0
- package/dist/components/Indicator.d.ts +22 -0
- package/dist/components/Indicator.js +22 -0
- package/dist/components/InfoPopover.d.ts +29 -0
- package/dist/components/InfoPopover.js +23 -0
- package/dist/components/InfoTip.d.ts +30 -0
- package/dist/components/InfoTip.js +20 -0
- package/dist/components/KeyValueTable.d.ts +28 -0
- package/dist/components/KeyValueTable.js +24 -0
- package/dist/components/LoadingIndicator.d.ts +8 -0
- package/dist/components/LoadingIndicator.js +23 -0
- package/dist/components/Meter.d.ts +56 -0
- package/dist/components/Meter.js +51 -0
- package/dist/components/Panel.d.ts +105 -0
- package/dist/components/Panel.js +45 -0
- package/dist/components/PlaybackBar.d.ts +105 -0
- package/dist/components/PlaybackBar.js +99 -0
- package/dist/components/Popover.d.ts +40 -0
- package/dist/components/Popover.js +70 -0
- package/dist/components/ProportionBar.d.ts +26 -0
- package/dist/components/ProportionBar.js +50 -0
- package/dist/components/ProportionList.d.ts +32 -0
- package/dist/components/ProportionList.js +40 -0
- package/dist/components/RangePicker.d.ts +19 -0
- package/dist/components/RangePicker.js +275 -0
- package/dist/components/RangeSlider.d.ts +30 -0
- package/dist/components/RangeSlider.js +35 -0
- package/dist/components/SearchInput.d.ts +21 -0
- package/dist/components/SearchInput.js +64 -0
- package/dist/components/SkeletonRows.d.ts +97 -0
- package/dist/components/SkeletonRows.js +141 -0
- package/dist/components/SkeletonStack.d.ts +23 -0
- package/dist/components/SkeletonStack.js +22 -0
- package/dist/components/Sparkline.d.ts +29 -0
- package/dist/components/Sparkline.js +38 -0
- package/dist/components/StatTile.d.ts +61 -0
- package/dist/components/StatTile.js +24 -0
- package/dist/components/StatusPill.d.ts +22 -0
- package/dist/components/StatusPill.js +23 -0
- package/dist/components/StyledSelect.d.ts +10 -0
- package/dist/components/StyledSelect.js +26 -0
- package/dist/components/SurfaceMessage.d.ts +55 -0
- package/dist/components/SurfaceMessage.js +34 -0
- package/dist/components/TextInput.d.ts +23 -0
- package/dist/components/TextInput.js +27 -0
- package/dist/components/ThemeToggle.d.ts +17 -0
- package/dist/components/ThemeToggle.js +60 -0
- package/dist/components/TreeRow.d.ts +20 -0
- package/dist/components/TreeRow.js +68 -0
- package/dist/components/data-table/DataTable.d.ts +216 -0
- package/dist/components/data-table/DataTable.js +543 -0
- package/dist/components/data-table/define-columns.d.ts +78 -0
- package/dist/components/data-table/define-columns.js +51 -0
- package/dist/components/data-table/features.d.ts +61 -0
- package/dist/components/data-table/features.js +35 -0
- package/dist/components/data-table/hooks.d.ts +13 -0
- package/dist/components/data-table/hooks.js +132 -0
- package/dist/components/data-table/index.d.ts +7 -0
- package/dist/components/data-table/index.js +4 -0
- package/dist/components/data-table/magnitude.d.ts +14 -0
- package/dist/components/data-table/magnitude.js +110 -0
- package/dist/components/data-table/types.d.ts +268 -0
- package/dist/components/data-table/types.js +1 -0
- package/dist/components/data-table/utils.d.ts +15 -0
- package/dist/components/data-table/utils.js +64 -0
- package/dist/components/skeletonPulse.d.ts +77 -0
- package/dist/components/skeletonPulse.js +77 -0
- package/dist/filter-state/FilterProvider.d.ts +118 -0
- package/dist/filter-state/FilterProvider.js +124 -0
- package/dist/filter-state/index.d.ts +3 -0
- package/dist/filter-state/index.js +3 -0
- package/dist/filter-state/types.d.ts +53 -0
- package/dist/filter-state/types.js +29 -0
- package/dist/filter-state/urlSync.d.ts +27 -0
- package/dist/filter-state/urlSync.js +44 -0
- package/dist/hooks/devWarning.d.ts +12 -0
- package/dist/hooks/devWarning.js +12 -0
- package/dist/hooks/index.d.ts +3 -0
- package/dist/hooks/index.js +3 -0
- package/dist/hooks/useHashRoute.d.ts +30 -0
- package/dist/hooks/useHashRoute.js +46 -0
- package/dist/hooks/useIdentityChurnWarning.d.ts +26 -0
- package/dist/hooks/useIdentityChurnWarning.js +48 -0
- package/dist/hooks/useMediaQuery.d.ts +12 -0
- package/dist/hooks/useMediaQuery.js +32 -0
- package/dist/hooks/useSettled.d.ts +7 -0
- package/dist/hooks/useSettled.js +15 -0
- package/dist/index.d.ts +62 -0
- package/dist/index.js +58 -0
- package/dist/layouts/PageShell.d.ts +10 -0
- package/dist/layouts/PageShell.js +17 -0
- package/dist/layouts/SidebarGrid.d.ts +30 -0
- package/dist/layouts/SidebarGrid.js +24 -0
- package/dist/layouts/SidebarLayout.d.ts +24 -0
- package/dist/layouts/SidebarLayout.js +176 -0
- package/dist/layouts/SplitLayout.d.ts +63 -0
- package/dist/layouts/SplitLayout.js +31 -0
- package/dist/layouts/splitSizes.d.ts +38 -0
- package/dist/layouts/splitSizes.js +55 -0
- package/dist/panda-preset.d.ts +31 -0
- package/dist/panda-preset.js +142 -0
- package/dist/playback/appendOnlyBuffer.d.ts +99 -0
- package/dist/playback/appendOnlyBuffer.js +187 -0
- package/dist/playback/index.d.ts +34 -0
- package/dist/playback/index.js +34 -0
- package/dist/playback/rafBatch.d.ts +27 -0
- package/dist/playback/rafBatch.js +48 -0
- package/dist/playback/types.d.ts +71 -0
- package/dist/playback/types.js +22 -0
- package/dist/playback/usePlayback.d.ts +80 -0
- package/dist/playback/usePlayback.js +531 -0
- package/dist/playback/useTransportHotkeys.d.ts +71 -0
- package/dist/playback/useTransportHotkeys.js +127 -0
- package/dist/recipes/badge.recipe.d.ts +16 -0
- package/dist/recipes/badge.recipe.js +82 -0
- package/dist/recipes/button.recipe.d.ts +21 -0
- package/dist/recipes/button.recipe.js +176 -0
- package/dist/recipes/chip.recipe.d.ts +9 -0
- package/dist/recipes/chip.recipe.js +103 -0
- package/dist/recipes/code.recipe.d.ts +8 -0
- package/dist/recipes/code.recipe.js +48 -0
- package/dist/recipes/dataTable.recipe.d.ts +55 -0
- package/dist/recipes/dataTable.recipe.js +723 -0
- package/dist/recipes/drawer.recipe.d.ts +1 -0
- package/dist/recipes/drawer.recipe.js +117 -0
- package/dist/recipes/emptyState.recipe.d.ts +8 -0
- package/dist/recipes/emptyState.recipe.js +78 -0
- package/dist/recipes/facetedMultiSelect.recipe.d.ts +7 -0
- package/dist/recipes/facetedMultiSelect.recipe.js +102 -0
- package/dist/recipes/figure.recipe.d.ts +12 -0
- package/dist/recipes/figure.recipe.js +47 -0
- package/dist/recipes/flash.recipe.d.ts +17 -0
- package/dist/recipes/flash.recipe.js +47 -0
- package/dist/recipes/heatCell.recipe.d.ts +17 -0
- package/dist/recipes/heatCell.recipe.js +69 -0
- package/dist/recipes/index.d.ts +36 -0
- package/dist/recipes/index.js +36 -0
- package/dist/recipes/indicator.recipe.d.ts +18 -0
- package/dist/recipes/indicator.recipe.js +67 -0
- package/dist/recipes/input.recipe.d.ts +1 -0
- package/dist/recipes/input.recipe.js +96 -0
- package/dist/recipes/interactiveItem.recipe.d.ts +1 -0
- package/dist/recipes/interactiveItem.recipe.js +68 -0
- package/dist/recipes/keyValueTable.recipe.d.ts +11 -0
- package/dist/recipes/keyValueTable.recipe.js +68 -0
- package/dist/recipes/meter.recipe.d.ts +29 -0
- package/dist/recipes/meter.recipe.js +231 -0
- package/dist/recipes/pageShell.recipe.d.ts +7 -0
- package/dist/recipes/pageShell.recipe.js +20 -0
- package/dist/recipes/panel.recipe.d.ts +11 -0
- package/dist/recipes/panel.recipe.js +143 -0
- package/dist/recipes/panelAction.recipe.d.ts +1 -0
- package/dist/recipes/panelAction.recipe.js +54 -0
- package/dist/recipes/panelSection.recipe.d.ts +1 -0
- package/dist/recipes/panelSection.recipe.js +39 -0
- package/dist/recipes/playbackBar.recipe.d.ts +12 -0
- package/dist/recipes/playbackBar.recipe.js +113 -0
- package/dist/recipes/popover.recipe.d.ts +12 -0
- package/dist/recipes/popover.recipe.js +100 -0
- package/dist/recipes/rangeSlider.recipe.d.ts +7 -0
- package/dist/recipes/rangeSlider.recipe.js +72 -0
- package/dist/recipes/searchInput.recipe.d.ts +8 -0
- package/dist/recipes/searchInput.recipe.js +97 -0
- package/dist/recipes/sectionHeading.recipe.d.ts +1 -0
- package/dist/recipes/sectionHeading.recipe.js +29 -0
- package/dist/recipes/segmentedControl.recipe.d.ts +1 -0
- package/dist/recipes/segmentedControl.recipe.js +43 -0
- package/dist/recipes/select.recipe.d.ts +9 -0
- package/dist/recipes/select.recipe.js +69 -0
- package/dist/recipes/sharedRecipes.d.ts +63 -0
- package/dist/recipes/sharedRecipes.js +99 -0
- package/dist/recipes/sidebarGrid.recipe.d.ts +9 -0
- package/dist/recipes/sidebarGrid.recipe.js +80 -0
- package/dist/recipes/sidebarLayout.recipe.d.ts +9 -0
- package/dist/recipes/sidebarLayout.recipe.js +199 -0
- package/dist/recipes/splitLayout.recipe.d.ts +12 -0
- package/dist/recipes/splitLayout.recipe.js +90 -0
- package/dist/recipes/statTile.recipe.d.ts +11 -0
- package/dist/recipes/statTile.recipe.js +151 -0
- package/dist/recipes/statusPill.recipe.d.ts +17 -0
- package/dist/recipes/statusPill.recipe.js +86 -0
- package/dist/recipes/surfaceMessage.recipe.d.ts +11 -0
- package/dist/recipes/surfaceMessage.recipe.js +75 -0
- package/dist/recipes/switch.recipe.d.ts +1 -0
- package/dist/recipes/switch.recipe.js +56 -0
- package/dist/recipes/themeToggle.recipe.d.ts +16 -0
- package/dist/recipes/themeToggle.recipe.js +132 -0
- package/dist/recipes/tooltip.recipe.d.ts +23 -0
- package/dist/recipes/tooltip.recipe.js +119 -0
- package/dist/staticCss.d.ts +68 -0
- package/dist/staticCss.js +68 -0
- package/dist/theme/ThemeProvider.d.ts +27 -0
- package/dist/theme/ThemeProvider.js +165 -0
- package/dist/theme/theme-bootstrap.d.ts +40 -0
- package/dist/theme/theme-bootstrap.js +77 -0
- package/dist/theme/theme-storage.d.ts +41 -0
- package/dist/theme/theme-storage.js +65 -0
- package/dist/theme/useIdentityPalette.d.ts +35 -0
- package/dist/theme/useIdentityPalette.js +87 -0
- package/dist/theme/useTheme.d.ts +8 -0
- package/dist/theme/useTheme.js +9 -0
- package/dist/theme-bootstrap.js +31 -0
- package/dist/tokens/chartColorTokens.d.ts +220 -0
- package/dist/tokens/chartColorTokens.js +132 -0
- package/dist/tokens/index.d.ts +1 -0
- package/dist/tokens/index.js +1 -0
- package/dist/tokens/sharedThemeTokens.d.ts +1469 -0
- package/dist/tokens/sharedThemeTokens.js +600 -0
- package/package.json +109 -0
- package/scripts/emit-theme-bootstrap.ts +72 -0
- package/src/ark.ts +32 -0
- package/src/component-manifest.test.ts +49 -0
- package/src/component-manifest.ts +560 -0
- package/src/components/AsyncStateRenderer.tsx +35 -0
- package/src/components/Badge.tsx +86 -0
- package/src/components/Button.tsx +102 -0
- package/src/components/Chip.tsx +111 -0
- package/src/components/Code.tsx +43 -0
- package/src/components/DateRangeFilter.tsx +55 -0
- package/src/components/Drawer.tsx +112 -0
- package/src/components/EmptyState.tsx +76 -0
- package/src/components/ErrorBoundary.tsx +159 -0
- package/src/components/ErrorState.tsx +177 -0
- package/src/components/FacetedMultiSelect.tsx +121 -0
- package/src/components/Figure.tsx +88 -0
- package/src/components/FlashOnChange.compare.test.ts +19 -0
- package/src/components/FlashOnChange.test.ts +25 -0
- package/src/components/FlashOnChange.tsx +228 -0
- package/src/components/HeatCell.test.ts +49 -0
- package/src/components/HeatCell.tsx +109 -0
- package/src/components/Indicator.tsx +77 -0
- package/src/components/InfoPopover.tsx +102 -0
- package/src/components/InfoTip.tsx +79 -0
- package/src/components/KeyValueTable.tsx +106 -0
- package/src/components/LoadingIndicator.tsx +53 -0
- package/src/components/Meter.test.ts +36 -0
- package/src/components/Meter.tsx +193 -0
- package/src/components/Panel.test.ts +37 -0
- package/src/components/Panel.tsx +263 -0
- package/src/components/PlaybackBar.test.ts +78 -0
- package/src/components/PlaybackBar.tsx +346 -0
- package/src/components/Popover.tsx +120 -0
- package/src/components/ProportionBar.tsx +159 -0
- package/src/components/ProportionList.tsx +135 -0
- package/src/components/RangePicker.tsx +478 -0
- package/src/components/RangeSlider.tsx +89 -0
- package/src/components/SearchInput.tsx +193 -0
- package/src/components/SkeletonRows.test.ts +116 -0
- package/src/components/SkeletonRows.tsx +312 -0
- package/src/components/SkeletonStack.test.ts +358 -0
- package/src/components/SkeletonStack.tsx +69 -0
- package/src/components/Sparkline.tsx +104 -0
- package/src/components/StatTile.tsx +157 -0
- package/src/components/StatusPill.tsx +88 -0
- package/src/components/StyledSelect.tsx +58 -0
- package/src/components/SurfaceMessage.test.ts +82 -0
- package/src/components/SurfaceMessage.tsx +188 -0
- package/src/components/TextInput.tsx +153 -0
- package/src/components/ThemeToggle.tsx +142 -0
- package/src/components/TreeRow.tsx +132 -0
- package/src/components/data-table/DataTable.flash.test.ts +113 -0
- package/src/components/data-table/DataTable.skeletonHints.test.ts +75 -0
- package/src/components/data-table/DataTable.tsx +1453 -0
- package/src/components/data-table/define-columns.ts +112 -0
- package/src/components/data-table/features.ts +58 -0
- package/src/components/data-table/hooks.ts +211 -0
- package/src/components/data-table/index.ts +37 -0
- package/src/components/data-table/magnitude.ts +191 -0
- package/src/components/data-table/types.ts +331 -0
- package/src/components/data-table/utils.test.ts +29 -0
- package/src/components/data-table/utils.ts +88 -0
- package/src/components/skeletonPulse.test.ts +126 -0
- package/src/components/skeletonPulse.ts +83 -0
- package/src/exports.test.ts +345 -0
- package/src/filter-state/FilterProvider.tsx +292 -0
- package/src/filter-state/index.ts +19 -0
- package/src/filter-state/types.ts +99 -0
- package/src/filter-state/urlSync.ts +74 -0
- package/src/hooks/devWarning.ts +19 -0
- package/src/hooks/index.ts +3 -0
- package/src/hooks/useHashRoute.ts +60 -0
- package/src/hooks/useIdentityChurnWarning.test.ts +78 -0
- package/src/hooks/useIdentityChurnWarning.ts +67 -0
- package/src/hooks/useMediaQuery.ts +35 -0
- package/src/hooks/useSettled.ts +18 -0
- package/src/index.ts +282 -0
- package/src/layouts/PageShell.tsx +46 -0
- package/src/layouts/SidebarGrid.tsx +93 -0
- package/src/layouts/SidebarLayout.tsx +405 -0
- package/src/layouts/SplitLayout.dom.test.ts +72 -0
- package/src/layouts/SplitLayout.test.ts +96 -0
- package/src/layouts/SplitLayout.tsx +128 -0
- package/src/layouts/splitSizes.ts +56 -0
- package/src/panda-preset.test.ts +91 -0
- package/src/panda-preset.ts +167 -0
- package/src/playback/appendOnlyBuffer.test.ts +163 -0
- package/src/playback/appendOnlyBuffer.ts +197 -0
- package/src/playback/index.ts +56 -0
- package/src/playback/rafBatch.test.ts +149 -0
- package/src/playback/rafBatch.ts +75 -0
- package/src/playback/types.ts +97 -0
- package/src/playback/usePlayback.live.test.ts +438 -0
- package/src/playback/usePlayback.memo.test.ts +166 -0
- package/src/playback/usePlayback.replay.test.ts +110 -0
- package/src/playback/usePlayback.reset.test.ts +124 -0
- package/src/playback/usePlayback.ssr.test.ts +33 -0
- package/src/playback/usePlayback.swap.test.ts +172 -0
- package/src/playback/usePlayback.ts +705 -0
- package/src/playback/useTransportHotkeys.dom.test.ts +169 -0
- package/src/playback/useTransportHotkeys.test.ts +142 -0
- package/src/playback/useTransportHotkeys.ts +185 -0
- package/src/recipes/badge.recipe.ts +84 -0
- package/src/recipes/button.recipe.ts +178 -0
- package/src/recipes/chip.recipe.ts +105 -0
- package/src/recipes/code.recipe.ts +50 -0
- package/src/recipes/dataTable.recipe.ts +728 -0
- package/src/recipes/drawer.recipe.ts +119 -0
- package/src/recipes/emptyState.recipe.ts +80 -0
- package/src/recipes/facetedMultiSelect.recipe.ts +104 -0
- package/src/recipes/figure.recipe.ts +49 -0
- package/src/recipes/flash.recipe.ts +49 -0
- package/src/recipes/heatCell.recipe.ts +71 -0
- package/src/recipes/index.ts +40 -0
- package/src/recipes/indicator.recipe.ts +69 -0
- package/src/recipes/input.recipe.ts +98 -0
- package/src/recipes/interactiveItem.recipe.ts +70 -0
- package/src/recipes/keyValueTable.recipe.ts +70 -0
- package/src/recipes/meter.recipe.ts +237 -0
- package/src/recipes/pageShell.recipe.ts +22 -0
- package/src/recipes/panel.recipe.ts +145 -0
- package/src/recipes/panelAction.recipe.ts +55 -0
- package/src/recipes/panelSection.recipe.ts +41 -0
- package/src/recipes/playbackBar.recipe.ts +115 -0
- package/src/recipes/popover.recipe.ts +102 -0
- package/src/recipes/rangeSlider.recipe.ts +74 -0
- package/src/recipes/searchInput.recipe.ts +99 -0
- package/src/recipes/sectionHeading.recipe.ts +30 -0
- package/src/recipes/segmentedControl.recipe.ts +44 -0
- package/src/recipes/select.recipe.ts +71 -0
- package/src/recipes/sharedRecipes.ts +105 -0
- package/src/recipes/sidebarGrid.recipe.ts +83 -0
- package/src/recipes/sidebarLayout.recipe.ts +203 -0
- package/src/recipes/splitLayout.recipe.ts +92 -0
- package/src/recipes/statTile.recipe.ts +154 -0
- package/src/recipes/statusPill.recipe.ts +89 -0
- package/src/recipes/surfaceMessage.recipe.ts +77 -0
- package/src/recipes/switch.recipe.ts +57 -0
- package/src/recipes/themeToggle.recipe.ts +134 -0
- package/src/recipes/tooltip.recipe.ts +123 -0
- package/src/staticCss.ts +68 -0
- package/src/theme/ThemeProvider.test.ts +145 -0
- package/src/theme/ThemeProvider.tsx +220 -0
- package/src/theme/theme-bootstrap.test.ts +206 -0
- package/src/theme/theme-bootstrap.ts +96 -0
- package/src/theme/theme-storage.test.ts +119 -0
- package/src/theme/theme-storage.ts +73 -0
- package/src/theme/useIdentityPalette.test.ts +64 -0
- package/src/theme/useIdentityPalette.ts +97 -0
- package/src/theme/useTheme.ts +21 -0
- package/src/tokens/chartColorTokens.test.ts +94 -0
- package/src/tokens/chartColorTokens.ts +181 -0
- package/src/tokens/index.ts +6 -0
- package/src/tokens/sharedThemeTokens.ts +670 -0
package/README.md
ADDED
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
# @r0hitsharma/design-system
|
|
2
|
+
|
|
3
|
+
Shared UI components and design tokens built with React and Panda CSS.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @r0hitsharma/design-system react react-dom
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Features
|
|
12
|
+
|
|
13
|
+
- Pre-built React components
|
|
14
|
+
- Design system tokens and recipes
|
|
15
|
+
- Theme customization via Panda CSS
|
|
16
|
+
- TypeScript support
|
|
17
|
+
- Component stories and documentation
|
|
18
|
+
|
|
19
|
+
## Usage
|
|
20
|
+
|
|
21
|
+
### Import components
|
|
22
|
+
|
|
23
|
+
```typescript
|
|
24
|
+
import { Panel, Button, Badge } from '@r0hitsharma/design-system';
|
|
25
|
+
|
|
26
|
+
export function Example() {
|
|
27
|
+
return (
|
|
28
|
+
<Panel title="Status" meta="updated 2m ago">
|
|
29
|
+
<Badge variant="solid" colorPalette="green">Healthy</Badge>
|
|
30
|
+
<Button onClick={() => console.log('clicked')}>Refresh</Button>
|
|
31
|
+
</Panel>
|
|
32
|
+
);
|
|
33
|
+
}
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
### What's available
|
|
37
|
+
|
|
38
|
+
The full inventory is the **component manifest** — [`src/component-manifest.ts`](./src/component-manifest.ts),
|
|
39
|
+
also exported at runtime as `designSystemComponentManifest`. Each entry's
|
|
40
|
+
`behaviorSource` tells you whether an export is owned here or a wrapper/re-export
|
|
41
|
+
around [Ark UI](https://ark-ui.com) (Dialog, Tabs, Menu, TreeView, Slider, …) or
|
|
42
|
+
[TanStack Table](https://tanstack.com/table) (`DataTable`), and `styleOwner` tells
|
|
43
|
+
you who owns its visuals. Because it is data, you can also list it programmatically:
|
|
44
|
+
|
|
45
|
+
```typescript
|
|
46
|
+
import { designSystemComponentManifest } from '@r0hitsharma/design-system';
|
|
47
|
+
|
|
48
|
+
const arkWrappers = designSystemComponentManifest.filter(
|
|
49
|
+
(c) => c.behaviorSource === 'ark-ui',
|
|
50
|
+
);
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
Charts live in the separate [`@r0hitsharma/charting`](../charting/README.md) package.
|
|
54
|
+
|
|
55
|
+
### Code-splitting heavy components
|
|
56
|
+
|
|
57
|
+
Every component is exported from the package root, and importing from the root stays
|
|
58
|
+
supported. The heavy ones also have a subpath entry point, so you can put a chunk
|
|
59
|
+
boundary in front of them without a wrapper module:
|
|
60
|
+
|
|
61
|
+
| Subpath | Exports | Cost, bundled alone |
|
|
62
|
+
| --- | --- | --- |
|
|
63
|
+
| `/data-table` | `DataTable` + column helpers (TanStack Table + Virtual) | ~278 kB min / ~85 kB gzip |
|
|
64
|
+
| `/ark` | the unstyled Ark UI pass-throughs: `Dialog`, `Menu`, `Tabs`, `Tooltip`, `TreeView`, `Switch`, `Slider`, `Progress`, `Field`, `Avatar`, `Toggle`, `ToggleGroup`, `Portal` | ~251 kB min / ~74 kB gzip for all thirteen |
|
|
65
|
+
| `/search-input` | `SearchInput` (Ark Combobox) | ~108 kB min / ~35 kB gzip |
|
|
66
|
+
| `/drawer` | `Drawer` (Ark Drawer) | ~94 kB min / ~30 kB gzip |
|
|
67
|
+
| `/info-popover` | `InfoPopover` | ~90 kB min / ~31 kB gzip |
|
|
68
|
+
| `/popover` | `Popover` (Ark Popover) | ~89 kB min / ~30 kB gzip |
|
|
69
|
+
| `/sidebar-layout` | `SidebarLayout` (Ark Splitter) | ~54 kB min / ~19 kB gzip |
|
|
70
|
+
| `/split-layout` | `SplitLayout` (Ark Splitter) | ~50 kB min / ~18 kB gzip |
|
|
71
|
+
| `/range-slider` | `RangeSlider` (Ark Slider) | ~42 kB min / ~15 kB gzip |
|
|
72
|
+
|
|
73
|
+
```typescript
|
|
74
|
+
import { lazy } from 'react';
|
|
75
|
+
|
|
76
|
+
const DataTable = lazy(() =>
|
|
77
|
+
import('@r0hitsharma/design-system/data-table').then((m) => ({ default: m.DataTable })),
|
|
78
|
+
);
|
|
79
|
+
// likewise: import('@r0hitsharma/design-system/drawer'), '/search-input', '/ark', ...
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
Those are the components measurement singles out; everything else in the package
|
|
83
|
+
costs single-digit kB, so a subpath for it would buy nothing a root import does not
|
|
84
|
+
already give you. `/ark` is on the list because the `design-system-boundaries` lint
|
|
85
|
+
preset (rightly) forbids importing `@ark-ui/react` directly, which left a consumer no
|
|
86
|
+
way to reach 250 kB of Ark except through the root barrel.
|
|
87
|
+
|
|
88
|
+
Every module except the theme bootstrap is marked side-effect-free
|
|
89
|
+
(`"sideEffects": ["./dist/theme-bootstrap.js"]`), so importing only what you use is
|
|
90
|
+
fully tree-shakeable (a `Badge`-only import ships ~1 KB, not the Ark/TanStack engine).
|
|
91
|
+
|
|
92
|
+
### Use design tokens
|
|
93
|
+
|
|
94
|
+
This package **emits no CSS of its own** — it builds with `tsc`, ships no generated
|
|
95
|
+
`styled-system`, and applies its recipes by stable Panda class names. The consumer
|
|
96
|
+
generates the CSS. Two steps, both required: add the preset, *and* spread
|
|
97
|
+
`designSystemStaticCssRecipes` into `staticCss`. Without the second, the preset
|
|
98
|
+
registers the recipes but Panda generates no rules for them (nothing in your source
|
|
99
|
+
calls a recipe function for it to extract), and every component renders unstyled.
|
|
100
|
+
`staticCss` is a Panda ROOT-config key, so a preset cannot carry it.
|
|
101
|
+
|
|
102
|
+
```typescript
|
|
103
|
+
import { defineConfig } from '@pandacss/dev';
|
|
104
|
+
import { designSystemStaticCssRecipes } from '@r0hitsharma/design-system';
|
|
105
|
+
import { designSystemPreset } from '@r0hitsharma/design-system/panda-preset';
|
|
106
|
+
|
|
107
|
+
export default defineConfig({
|
|
108
|
+
presets: [designSystemPreset],
|
|
109
|
+
staticCss: {
|
|
110
|
+
recipes: {
|
|
111
|
+
...designSystemStaticCssRecipes,
|
|
112
|
+
// ...your own recipes with runtime-driven variants
|
|
113
|
+
},
|
|
114
|
+
},
|
|
115
|
+
});
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
The recipe definitions themselves are available from the root barrel and from the
|
|
119
|
+
`@r0hitsharma/design-system/recipes` subpath. See
|
|
120
|
+
[PANDA_NOTES.md](./PANDA_NOTES.md) for this and the other Panda gotchas that bite
|
|
121
|
+
consumers of the preset.
|
|
122
|
+
|
|
123
|
+
### Theming and the no-flash bootstrap
|
|
124
|
+
|
|
125
|
+
`ThemeProvider` owns the theme at runtime: it resolves `light` / `dark` / `auto`,
|
|
126
|
+
persists the choice, and keeps `<html>`'s `dark` class and `data-theme` attribute
|
|
127
|
+
in sync.
|
|
128
|
+
|
|
129
|
+
```typescript
|
|
130
|
+
import { ThemeProvider, useTheme } from '@r0hitsharma/design-system';
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
Because the provider applies the theme from an effect, it can only run *after*
|
|
134
|
+
React mounts. On a reload with a dark theme stored, the page paints light first
|
|
135
|
+
and then snaps to dark — a visible flash. To remove it, apply the theme before
|
|
136
|
+
first paint with the bootstrap this package ships. It reads the same storage keys
|
|
137
|
+
the provider does, so the two can never disagree.
|
|
138
|
+
|
|
139
|
+
Pick the mode that matches your CSP.
|
|
140
|
+
|
|
141
|
+
**1. Inline (SSR and any app that allows inline scripts).** Render
|
|
142
|
+
`THEME_BOOTSTRAP_SCRIPT` as the first `<script>` in `<head>`, ahead of your
|
|
143
|
+
stylesheets:
|
|
144
|
+
|
|
145
|
+
```tsx
|
|
146
|
+
import { THEME_BOOTSTRAP_SCRIPT } from '@r0hitsharma/design-system';
|
|
147
|
+
|
|
148
|
+
export function Document() {
|
|
149
|
+
return (
|
|
150
|
+
<html lang="en">
|
|
151
|
+
<head>
|
|
152
|
+
<script>{THEME_BOOTSTRAP_SCRIPT}</script>
|
|
153
|
+
{/* stylesheets after the bootstrap */}
|
|
154
|
+
</head>
|
|
155
|
+
<body>{/* … */}</body>
|
|
156
|
+
</html>
|
|
157
|
+
);
|
|
158
|
+
}
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
With a strict CSP that allows inline scripts only by nonce, pass yours through:
|
|
162
|
+
`<script nonce={nonce}>{THEME_BOOTSTRAP_SCRIPT}</script>`.
|
|
163
|
+
|
|
164
|
+
**2. Copied file (`script-src 'self'` — no inline scripts allowed).** The same
|
|
165
|
+
code is built to `dist/theme-bootstrap.js` as a plain browser script. Copy it
|
|
166
|
+
into the directory you serve static assets from, as part of your build (under
|
|
167
|
+
the `uikit-cli link` flow this file exists only after the linked checkout has
|
|
168
|
+
run `npm run build` — resolution through the symlink then works as normal):
|
|
169
|
+
|
|
170
|
+
```jsonc
|
|
171
|
+
// package.json
|
|
172
|
+
{
|
|
173
|
+
"scripts": {
|
|
174
|
+
"prebuild": "cp node_modules/@r0hitsharma/design-system/dist/theme-bootstrap.js public/"
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
Then load it first in `<head>`:
|
|
180
|
+
|
|
181
|
+
```html
|
|
182
|
+
<script src="/theme-bootstrap.js"></script>
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
Copy it on every build rather than committing it — it is generated from
|
|
186
|
+
`src/theme/theme-bootstrap.ts` at package build time, and copying keeps it in
|
|
187
|
+
step with the version you have installed.
|
|
188
|
+
|
|
189
|
+
**3. Neither?** If you can already run code before React renders (a bundled entry
|
|
190
|
+
module, a framework pre-render hook), call the function form instead:
|
|
191
|
+
|
|
192
|
+
```typescript
|
|
193
|
+
import { applyThemeBootstrap } from '@r0hitsharma/design-system';
|
|
194
|
+
|
|
195
|
+
applyThemeBootstrap();
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
Or, as the first statement of your entry module, import the built script for its
|
|
199
|
+
side effect — the same code as the copied file in option 2, but bundled with your
|
|
200
|
+
app instead of served separately:
|
|
201
|
+
|
|
202
|
+
```typescript
|
|
203
|
+
import '@r0hitsharma/design-system/theme-bootstrap.js';
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
This form is safe from tree-shaking: `dist/theme-bootstrap.js` is the sole entry in
|
|
207
|
+
the package's `sideEffects` list, so bundlers keep it even though the import binds no
|
|
208
|
+
name. Note that it runs when your entry bundle runs, not before the document's
|
|
209
|
+
stylesheets — put it above every other import, and prefer option 1 or 2 if your entry
|
|
210
|
+
bundle is deferred.
|
|
211
|
+
|
|
212
|
+
Every form makes the same decision: a stored `light` / `dark` wins, `auto` (and no
|
|
213
|
+
stored value) resolves against `prefers-color-scheme`, the pre-rename storage key
|
|
214
|
+
is still honoured, and unavailable storage falls back to the system preference
|
|
215
|
+
rather than throwing. When a bootstrap has run, `ThemeProvider` seeds its first
|
|
216
|
+
render from the `data-theme` it stamped, so the pre-paint decision and the
|
|
217
|
+
provider agree. Without one, the provider behaves exactly as before.
|
|
218
|
+
|
|
219
|
+
### Browse components
|
|
220
|
+
|
|
221
|
+
View available components and their stories at:
|
|
222
|
+
https://r0hitsharma.github.io/uikit/
|
|
223
|
+
|
|
224
|
+
## Peer dependencies
|
|
225
|
+
|
|
226
|
+
- `react`: React UI library
|
|
227
|
+
- `react-dom`: React DOM rendering
|
|
228
|
+
|
|
229
|
+
## Key dependencies
|
|
230
|
+
|
|
231
|
+
- `@ark-ui/react`: Unstyled component primitives
|
|
232
|
+
- `@pandacss/dev`: CSS-in-JS styling solution
|
|
233
|
+
|
|
234
|
+
## See also
|
|
235
|
+
|
|
236
|
+
- [Live component preview](https://r0hitsharma.github.io/uikit/)
|
|
237
|
+
- [Development guide](../../DEVELOPMENT.md#preview-site) for local component development
|
package/dist/ark.d.ts
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `@r0hitsharma/design-system/ark` — the Ark UI components this package
|
|
3
|
+
* passes through unstyled, in one place.
|
|
4
|
+
*
|
|
5
|
+
* These are re-exported rather than left to consumers because the
|
|
6
|
+
* `design-system-boundaries` oxlint preset forbids importing `@ark-ui/react`
|
|
7
|
+
* directly, which is also why they need a subpath of their own: bundled
|
|
8
|
+
* together they are ~250 kB minified / ~74 kB gzipped (from ~1.7 kB for
|
|
9
|
+
* `Portal` to ~99 kB for `Menu`), and reaching them only through the root
|
|
10
|
+
* barrel gives a consumer nowhere to put a chunk boundary.
|
|
11
|
+
*
|
|
12
|
+
* Everything here is also re-exported from the root barrel.
|
|
13
|
+
*/
|
|
14
|
+
export { Avatar } from '@ark-ui/react/avatar';
|
|
15
|
+
export { Dialog } from '@ark-ui/react/dialog';
|
|
16
|
+
export { Field } from '@ark-ui/react/field';
|
|
17
|
+
export { Menu } from '@ark-ui/react/menu';
|
|
18
|
+
export { Portal } from '@ark-ui/react/portal';
|
|
19
|
+
export { Progress } from '@ark-ui/react/progress';
|
|
20
|
+
export { Slider } from '@ark-ui/react/slider';
|
|
21
|
+
export { Switch } from '@ark-ui/react/switch';
|
|
22
|
+
export { Tabs } from '@ark-ui/react/tabs';
|
|
23
|
+
export { Toggle } from '@ark-ui/react/toggle';
|
|
24
|
+
export { ToggleGroup } from '@ark-ui/react/toggle-group';
|
|
25
|
+
export { Tooltip } from '@ark-ui/react/tooltip';
|
|
26
|
+
export { TreeView, createTreeCollection } from '@ark-ui/react/tree-view';
|
|
27
|
+
export type { TreeCollection, TreeNode } from '@ark-ui/react/tree-view';
|
|
28
|
+
export { useTreeView, type UseTreeViewProps, type UseTreeViewReturn, } from '@ark-ui/react/tree-view';
|
package/dist/ark.js
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `@r0hitsharma/design-system/ark` — the Ark UI components this package
|
|
3
|
+
* passes through unstyled, in one place.
|
|
4
|
+
*
|
|
5
|
+
* These are re-exported rather than left to consumers because the
|
|
6
|
+
* `design-system-boundaries` oxlint preset forbids importing `@ark-ui/react`
|
|
7
|
+
* directly, which is also why they need a subpath of their own: bundled
|
|
8
|
+
* together they are ~250 kB minified / ~74 kB gzipped (from ~1.7 kB for
|
|
9
|
+
* `Portal` to ~99 kB for `Menu`), and reaching them only through the root
|
|
10
|
+
* barrel gives a consumer nowhere to put a chunk boundary.
|
|
11
|
+
*
|
|
12
|
+
* Everything here is also re-exported from the root barrel.
|
|
13
|
+
*/
|
|
14
|
+
export { Avatar } from '@ark-ui/react/avatar';
|
|
15
|
+
export { Dialog } from '@ark-ui/react/dialog';
|
|
16
|
+
export { Field } from '@ark-ui/react/field';
|
|
17
|
+
export { Menu } from '@ark-ui/react/menu';
|
|
18
|
+
export { Portal } from '@ark-ui/react/portal';
|
|
19
|
+
export { Progress } from '@ark-ui/react/progress';
|
|
20
|
+
export { Slider } from '@ark-ui/react/slider';
|
|
21
|
+
export { Switch } from '@ark-ui/react/switch';
|
|
22
|
+
export { Tabs } from '@ark-ui/react/tabs';
|
|
23
|
+
export { Toggle } from '@ark-ui/react/toggle';
|
|
24
|
+
export { ToggleGroup } from '@ark-ui/react/toggle-group';
|
|
25
|
+
export { Tooltip } from '@ark-ui/react/tooltip';
|
|
26
|
+
export { TreeView, createTreeCollection } from '@ark-ui/react/tree-view';
|
|
27
|
+
export { useTreeView, } from '@ark-ui/react/tree-view';
|