@zentauri-ui/zentauri-components 1.8.1 → 1.8.3
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 +123 -25
- package/cli/cli.integration.test.ts +77 -2
- package/cli/index.mjs +53 -0
- package/cli/registry.json +136 -0
- package/cli/rewrite-imports.mjs +4 -1
- package/dist/charts/area.js +9 -10
- package/dist/charts/area.js.map +1 -1
- package/dist/charts/area.mjs +2 -3
- package/dist/charts/area.mjs.map +1 -1
- package/dist/charts/bar.js +10 -95
- package/dist/charts/bar.js.map +1 -1
- package/dist/charts/bar.mjs +2 -95
- package/dist/charts/bar.mjs.map +1 -1
- package/dist/charts/bubble.js +8 -9
- package/dist/charts/bubble.js.map +1 -1
- package/dist/charts/bubble.mjs +2 -3
- package/dist/charts/bubble.mjs.map +1 -1
- package/dist/charts/funnel/Funnel.d.ts +6 -0
- package/dist/charts/funnel/Funnel.d.ts.map +1 -0
- package/dist/charts/funnel/index.d.ts +4 -0
- package/dist/charts/funnel/index.d.ts.map +1 -0
- package/dist/charts/funnel.js +102 -0
- package/dist/charts/funnel.js.map +1 -0
- package/dist/charts/funnel.mjs +89 -0
- package/dist/charts/funnel.mjs.map +1 -0
- package/dist/charts/line.js +8 -9
- package/dist/charts/line.js.map +1 -1
- package/dist/charts/line.mjs +2 -3
- package/dist/charts/line.mjs.map +1 -1
- package/dist/charts/pie/Pie.d.ts +1 -1
- package/dist/charts/pie/Pie.d.ts.map +1 -1
- package/dist/charts/pie.js +19 -6
- package/dist/charts/pie.js.map +1 -1
- package/dist/charts/pie.mjs +17 -4
- package/dist/charts/pie.mjs.map +1 -1
- package/dist/charts/radar/Radar.d.ts +6 -0
- package/dist/charts/radar/Radar.d.ts.map +1 -0
- package/dist/charts/radar/index.d.ts +4 -0
- package/dist/charts/radar/index.d.ts.map +1 -0
- package/dist/charts/radar.js +94 -0
- package/dist/charts/radar.js.map +1 -0
- package/dist/charts/radar.mjs +81 -0
- package/dist/charts/radar.mjs.map +1 -0
- package/dist/charts/scatter/Scatter.d.ts +6 -0
- package/dist/charts/scatter/Scatter.d.ts.map +1 -0
- package/dist/charts/scatter/index.d.ts +4 -0
- package/dist/charts/scatter/index.d.ts.map +1 -0
- package/dist/charts/scatter.js +116 -0
- package/dist/charts/scatter.js.map +1 -0
- package/dist/charts/scatter.mjs +103 -0
- package/dist/charts/scatter.mjs.map +1 -0
- package/dist/charts/shared/chart-frame.d.ts +2 -1
- package/dist/charts/shared/chart-frame.d.ts.map +1 -1
- package/dist/charts/shared/types.d.ts +22 -2
- package/dist/charts/shared/types.d.ts.map +1 -1
- package/dist/charts/stacked-bar/StackedBar.d.ts +6 -0
- package/dist/charts/stacked-bar/StackedBar.d.ts.map +1 -0
- package/dist/charts/stacked-bar/index.d.ts +4 -0
- package/dist/charts/stacked-bar/index.d.ts.map +1 -0
- package/dist/charts/stacked-bar.js +29 -0
- package/dist/charts/stacked-bar.js.map +1 -0
- package/dist/charts/stacked-bar.mjs +15 -0
- package/dist/charts/stacked-bar.mjs.map +1 -0
- package/dist/{chunk-ABOZ5QIX.js → chunk-466QDL44.js} +5 -12
- package/dist/chunk-466QDL44.js.map +1 -0
- package/dist/chunk-4ZP444GA.mjs +19 -0
- package/dist/chunk-4ZP444GA.mjs.map +1 -0
- package/dist/{chunk-HDO5ZM2S.mjs → chunk-CIEZFHCO.mjs} +3 -10
- package/dist/chunk-CIEZFHCO.mjs.map +1 -0
- package/dist/chunk-F3V4POW3.mjs +8 -0
- package/dist/chunk-F3V4POW3.mjs.map +1 -0
- package/dist/{chunk-G2WARVAM.mjs → chunk-HZIRD3SR.mjs} +35 -15
- package/dist/chunk-HZIRD3SR.mjs.map +1 -0
- package/dist/{chunk-G66SXATZ.js → chunk-IL4LH2XX.js} +50 -4
- package/dist/chunk-IL4LH2XX.js.map +1 -0
- package/dist/{chunk-QQ6F4LZK.js → chunk-JFS5PJSH.js} +5 -5
- package/dist/{chunk-QQ6F4LZK.js.map → chunk-JFS5PJSH.js.map} +1 -1
- package/dist/chunk-LREMK2XR.js +97 -0
- package/dist/chunk-LREMK2XR.js.map +1 -0
- package/dist/chunk-MUP7DVQR.js +26 -0
- package/dist/chunk-MUP7DVQR.js.map +1 -0
- package/dist/chunk-O2KM3ETC.mjs +95 -0
- package/dist/chunk-O2KM3ETC.mjs.map +1 -0
- package/dist/{chunk-ZIFMIS7D.mjs → chunk-OL3BJSRC.mjs} +51 -5
- package/dist/chunk-OL3BJSRC.mjs.map +1 -0
- package/dist/{chunk-QNUDODDX.js → chunk-PWPMKXEG.js} +36 -14
- package/dist/chunk-PWPMKXEG.js.map +1 -0
- package/dist/{chunk-ASJQP53L.mjs → chunk-VARQ7W4G.mjs} +3 -3
- package/dist/{chunk-ASJQP53L.mjs.map → chunk-VARQ7W4G.mjs.map} +1 -1
- package/dist/chunk-XRM7GOIE.js +10 -0
- package/dist/chunk-XRM7GOIE.js.map +1 -0
- package/dist/design-system/tokens.js +32 -0
- package/dist/design-system/tokens.js.map +1 -0
- package/dist/design-system/tokens.mjs +3 -0
- package/dist/design-system/tokens.mjs.map +1 -0
- package/dist/hooks/index.d.ts +2 -0
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/useIsomorphicLayoutEffect.js +6 -4
- package/dist/hooks/useIsomorphicLayoutEffect.js.map +1 -1
- package/dist/hooks/useIsomorphicLayoutEffect.mjs +1 -6
- package/dist/hooks/useIsomorphicLayoutEffect.mjs.map +1 -1
- package/dist/hooks/useTableFilter/index.d.ts +3 -0
- package/dist/hooks/useTableFilter/index.d.ts.map +1 -0
- package/dist/hooks/useTableFilter/types.d.ts +20 -0
- package/dist/hooks/useTableFilter/types.d.ts.map +1 -0
- package/dist/hooks/useTableFilter/useTableFilter.d.ts +3 -0
- package/dist/hooks/useTableFilter/useTableFilter.d.ts.map +1 -0
- package/dist/hooks/useTableFilter.js +124 -0
- package/dist/hooks/useTableFilter.js.map +1 -0
- package/dist/hooks/useTableFilter.mjs +122 -0
- package/dist/hooks/useTableFilter.mjs.map +1 -0
- package/dist/hooks/useTableSort/index.d.ts +3 -0
- package/dist/hooks/useTableSort/index.d.ts.map +1 -0
- package/dist/hooks/useTableSort/types.d.ts +15 -0
- package/dist/hooks/useTableSort/types.d.ts.map +1 -0
- package/dist/hooks/useTableSort/useTableSort.d.ts +3 -0
- package/dist/hooks/useTableSort/useTableSort.d.ts.map +1 -0
- package/dist/hooks/useTableSort.js +99 -0
- package/dist/hooks/useTableSort.js.map +1 -0
- package/dist/hooks/useTableSort.mjs +97 -0
- package/dist/hooks/useTableSort.mjs.map +1 -0
- package/dist/ui/buttons/animated.js +4 -3
- package/dist/ui/buttons/animated.js.map +1 -1
- package/dist/ui/buttons/animated.mjs +2 -1
- package/dist/ui/buttons/animated.mjs.map +1 -1
- package/dist/ui/buttons.js +5 -4
- package/dist/ui/buttons.mjs +3 -2
- package/dist/ui/dynamic-stepper.js +5 -4
- package/dist/ui/dynamic-stepper.js.map +1 -1
- package/dist/ui/dynamic-stepper.mjs +3 -2
- package/dist/ui/dynamic-stepper.mjs.map +1 -1
- package/dist/ui/marquee/marquee.d.ts.map +1 -1
- package/dist/ui/marquee.js +82 -21
- package/dist/ui/marquee.js.map +1 -1
- package/dist/ui/marquee.mjs +83 -22
- package/dist/ui/marquee.mjs.map +1 -1
- package/dist/ui/pagination.js +5 -4
- package/dist/ui/pagination.js.map +1 -1
- package/dist/ui/pagination.mjs +2 -1
- package/dist/ui/pagination.mjs.map +1 -1
- package/dist/ui/table/animated.js +8 -8
- package/dist/ui/table/animated.mjs +2 -2
- package/dist/ui/table/index.d.ts +1 -1
- package/dist/ui/table/index.d.ts.map +1 -1
- package/dist/ui/table/table-base.d.ts +2 -2
- package/dist/ui/table/table-base.d.ts.map +1 -1
- package/dist/ui/table/types.d.ts +9 -1
- package/dist/ui/table/types.d.ts.map +1 -1
- package/dist/ui/table.js +14 -14
- package/dist/ui/table.mjs +1 -1
- package/package.json +8 -2
- package/src/charts/charts.test.tsx +80 -0
- package/src/charts/funnel/Funnel.tsx +105 -0
- package/src/charts/funnel/index.ts +14 -0
- package/src/charts/pie/Pie.tsx +28 -1
- package/src/charts/radar/Radar.tsx +84 -0
- package/src/charts/radar/index.ts +16 -0
- package/src/charts/scatter/Scatter.tsx +104 -0
- package/src/charts/scatter/index.ts +16 -0
- package/src/charts/shared/chart-frame.tsx +4 -2
- package/src/charts/shared/types.ts +42 -2
- package/src/charts/stacked-bar/StackedBar.tsx +12 -0
- package/src/charts/stacked-bar/index.ts +16 -0
- package/src/hooks/index.ts +12 -0
- package/src/hooks/useTableFilter/index.ts +7 -0
- package/src/hooks/useTableFilter/types.ts +28 -0
- package/src/hooks/useTableFilter/useTableFilter.test.ts +141 -0
- package/src/hooks/useTableFilter/useTableFilter.ts +153 -0
- package/src/hooks/useTableSort/index.ts +5 -0
- package/src/hooks/useTableSort/types.ts +23 -0
- package/src/hooks/useTableSort/useTableSort.test.ts +150 -0
- package/src/hooks/useTableSort/useTableSort.ts +121 -0
- package/src/ui/context-menu/context-menu.test.tsx +30 -0
- package/src/ui/divider/divider.test.tsx +55 -0
- package/src/ui/empty-state/empty-state.test.tsx +88 -0
- package/src/ui/marquee/marquee.test.tsx +45 -4
- package/src/ui/marquee/marquee.tsx +100 -18
- package/src/ui/modal/modal.test.tsx +24 -0
- package/src/ui/peer-isolation.test.ts +81 -0
- package/src/ui/select/select.test.tsx +98 -2
- package/src/ui/skeleton/skeleton.test.tsx +85 -0
- package/src/ui/table/index.ts +3 -0
- package/src/ui/table/table-base.tsx +69 -4
- package/src/ui/table/table.test.tsx +207 -0
- package/src/ui/table/types.ts +13 -1
- package/dist/chunk-ABOZ5QIX.js.map +0 -1
- package/dist/chunk-G2WARVAM.mjs.map +0 -1
- package/dist/chunk-G66SXATZ.js.map +0 -1
- package/dist/chunk-HDO5ZM2S.mjs.map +0 -1
- package/dist/chunk-OULU7OC4.mjs +0 -21
- package/dist/chunk-OULU7OC4.mjs.map +0 -1
- package/dist/chunk-QNUDODDX.js.map +0 -1
- package/dist/chunk-Z6S36PDD.js +0 -24
- package/dist/chunk-Z6S36PDD.js.map +0 -1
- package/dist/chunk-ZIFMIS7D.mjs.map +0 -1
package/README.md
CHANGED
|
@@ -11,38 +11,51 @@ The library targets **React 18+** apps that use **Tailwind CSS v4** (or an equiv
|
|
|
11
11
|
|
|
12
12
|
Published artifacts live under `dist/`. Imports use **per-entry subpaths**: `@zentauri-ui/zentauri-components/ui/<area>` for static UI, `@zentauri-ui/zentauri-components/ui/<area>/animated` where a motion bundle exists, `@zentauri-ui/zentauri-components/charts/<type>` for Recharts-powered chart primitives, and `@zentauri-ui/zentauri-components/hooks/<entry>` for React hooks (and shared helpers under `hooks/utils`). Base UI entries do **not** re-export animated components; motion lives on its own entry so optional `framer-motion` usage stays tree-shakeable and chunk-friendly. Each entry resolves to its own ESM (`.mjs`), CJS (`.js`), and types (`.d.ts`) so bundlers pull only what you import. Most apps rely on Tailwind scanning the package sources (see installation); a separate CSS import is not required for that setup.
|
|
13
13
|
|
|
14
|
+
## Current package surface
|
|
15
|
+
|
|
16
|
+
| Surface | Count | Import shape |
|
|
17
|
+
| ------------------- | ----: | ----------------------------------------------------- |
|
|
18
|
+
| Static UI entries | 42 | `@zentauri-ui/zentauri-components/ui/<name>` |
|
|
19
|
+
| Animated UI entries | 27 | `@zentauri-ui/zentauri-components/ui/<name>/animated` |
|
|
20
|
+
| Chart entries | 9 | `@zentauri-ui/zentauri-components/charts/<type>` |
|
|
21
|
+
| Hook entries | 28 | `@zentauri-ui/zentauri-components/hooks/<entry>` |
|
|
22
|
+
|
|
23
|
+
`spinner` is the only animated-only UI area. Import it from `@zentauri-ui/zentauri-components/ui/spinner/animated`; there is no `@zentauri-ui/zentauri-components/ui/spinner` static entry.
|
|
24
|
+
|
|
14
25
|
## Package status and test coverage
|
|
15
26
|
|
|
16
27
|
| Metric | Result |
|
|
17
28
|
| ---------- | ---------------- |
|
|
18
|
-
| Test files |
|
|
19
|
-
| Tests |
|
|
29
|
+
| Test files | 76 passed (76) |
|
|
30
|
+
| Tests | 548 passed (548) |
|
|
20
31
|
|
|
21
32
|
| Area | Test files | Tests |
|
|
22
33
|
| --------------------------- | ---------- | ----- |
|
|
23
|
-
| Components and UI utilities |
|
|
24
|
-
| React hooks |
|
|
25
|
-
| CLI and import rewriting | 2 |
|
|
34
|
+
| Components and UI utilities | 46 | 433 |
|
|
35
|
+
| React hooks | 28 | 101 |
|
|
36
|
+
| CLI and import rewriting | 2 | 14 |
|
|
26
37
|
|
|
27
38
|
### Per-suite snapshot
|
|
28
39
|
|
|
29
40
|
| Suite | Tests |
|
|
30
41
|
| ----------------------------------------------------------------------- | ----: |
|
|
31
42
|
| `src/ui/dynamic-stepper/dynamic-stepper.test.tsx` | 8 |
|
|
32
|
-
| `src/ui/select/select.test.tsx` |
|
|
33
|
-
| `src/
|
|
43
|
+
| `src/ui/select/select.test.tsx` | 10 |
|
|
44
|
+
| `src/charts/charts.test.tsx` | 6 |
|
|
45
|
+
| `src/ui/modal/modal.test.tsx` | 10 |
|
|
34
46
|
| `src/ui/drawer/drawer.test.tsx` | 7 |
|
|
35
|
-
| `
|
|
47
|
+
| `src/ui/peer-isolation.test.ts` | 29 |
|
|
48
|
+
| `cli/cli.integration.test.ts` | 9 |
|
|
36
49
|
| `src/ui/buttons/button.test.tsx` | 41 |
|
|
37
50
|
| `src/ui/inputs/input.test.tsx` | 40 |
|
|
38
|
-
| `src/ui/marquee/marquee.test.tsx` |
|
|
51
|
+
| `src/ui/marquee/marquee.test.tsx` | 10 |
|
|
39
52
|
| `src/ui/otp-input/otp-input.test.tsx` | 10 |
|
|
40
53
|
| `src/ui/tree-view/tree-view.test.tsx` | 10 |
|
|
41
54
|
| `src/ui/card/card.test.tsx` | 7 |
|
|
42
55
|
| `src/ui/checkbox/checkbox.test.tsx` | 6 |
|
|
43
56
|
| `src/ui/popover/popover.test.tsx` | 4 |
|
|
44
57
|
| `src/ui/command/command.test.tsx` | 7 |
|
|
45
|
-
| `src/ui/context-menu/context-menu.test.tsx` |
|
|
58
|
+
| `src/ui/context-menu/context-menu.test.tsx` | 10 |
|
|
46
59
|
| `src/ui/copy-button/copy-button.test.tsx` | 8 |
|
|
47
60
|
| `src/ui/kbd/kbd.test.tsx` | 7 |
|
|
48
61
|
| `src/ui/tooltip/tooltip.test.tsx` | 4 |
|
|
@@ -55,6 +68,7 @@ Published artifacts live under `dist/`. Imports use **per-entry subpaths**: `@ze
|
|
|
55
68
|
| `src/ui/accordion/accordion.test.tsx` | 7 |
|
|
56
69
|
| `src/ui/toast/toast.test.tsx` | 5 |
|
|
57
70
|
| `src/ui/pagination/pagination.test.tsx` | 15 |
|
|
71
|
+
| `src/ui/table/table.test.tsx` | 11 |
|
|
58
72
|
| `src/ui/tabs/tabs.test.tsx` | 3 |
|
|
59
73
|
| `src/ui/stepper/stepper.test.tsx` | 12 |
|
|
60
74
|
| `src/ui/timeline/timeline.test.tsx` | 14 |
|
|
@@ -62,6 +76,9 @@ Published artifacts live under `dist/`. Imports use **per-entry subpaths**: `@ze
|
|
|
62
76
|
| `src/ui/toggle/toggle.test.tsx` | 5 |
|
|
63
77
|
| `src/ui/slider/slider.test.tsx` | 9 |
|
|
64
78
|
| `src/ui/typography/typography.test.tsx` | 7 |
|
|
79
|
+
| `src/ui/skeleton/skeleton.test.tsx` | 8 |
|
|
80
|
+
| `src/ui/divider/divider.test.tsx` | 6 |
|
|
81
|
+
| `src/ui/empty-state/empty-state.test.tsx` | 6 |
|
|
65
82
|
| `src/ui/alert/alert.test.tsx` | 11 |
|
|
66
83
|
| `src/ui/badge/badge.test.tsx` | 6 |
|
|
67
84
|
| `src/hooks/useClipboard/useClipboard.test.ts` | 6 |
|
|
@@ -77,6 +94,8 @@ Published artifacts live under `dist/`. Imports use **per-entry subpaths**: `@ze
|
|
|
77
94
|
| `src/hooks/useThrottledCallback/useThrottledCallback.test.ts` | 4 |
|
|
78
95
|
| `src/hooks/useToggle/useToggle.test.ts` | 4 |
|
|
79
96
|
| `src/hooks/usePagination/usePagination.test.ts` | 10 |
|
|
97
|
+
| `src/hooks/useTableFilter/useTableFilter.test.ts` | 9 |
|
|
98
|
+
| `src/hooks/useTableSort/useTableSort.test.ts` | 7 |
|
|
80
99
|
| `src/hooks/useSessionStorage/useSessionStorage.test.ts` | 3 |
|
|
81
100
|
| `src/hooks/usePrefersColorScheme/usePrefersColorScheme.test.ts` | 1 |
|
|
82
101
|
| `src/hooks/useIsMounted/useIsMounted.test.ts` | 3 |
|
|
@@ -99,12 +118,12 @@ Published artifacts live under `dist/`. Imports use **per-entry subpaths**: `@ze
|
|
|
99
118
|
|
|
100
119
|
## Package exports
|
|
101
120
|
|
|
102
|
-
| Subpath | Description
|
|
103
|
-
| ----------------------------------------------------- |
|
|
104
|
-
| `@zentauri-ui/zentauri-components/ui/<name>` | Single UI area: static primitives, compound parts, variants, and types. Does **not** include Framer Motion–based animated exports.
|
|
105
|
-
| `@zentauri-ui/zentauri-components/ui/<name>/animated` | Motion entry for that area when published: animated components, motion presets, and related types (depends on **framer-motion**).
|
|
106
|
-
| `@zentauri-ui/zentauri-components/charts/<type>` | Responsive Recharts chart entry for `area`, `bar`, `bubble`, `line`, or `pie`, with shared variants, palettes, and exported chart prop types.
|
|
107
|
-
| `@zentauri-ui/zentauri-components/hooks/<entry>` | One hook module or `utils` (`cn`, `clampPage`, `range` from `src/lib/utils.ts`). Entries match files under `src/hooks/` (see **React hooks**).
|
|
121
|
+
| Subpath | Description |
|
|
122
|
+
| ----------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
123
|
+
| `@zentauri-ui/zentauri-components/ui/<name>` | Single UI area: static primitives, compound parts, variants, and types. Does **not** include Framer Motion–based animated exports. |
|
|
124
|
+
| `@zentauri-ui/zentauri-components/ui/<name>/animated` | Motion entry for that area when published: animated components, motion presets, and related types (depends on **framer-motion**). |
|
|
125
|
+
| `@zentauri-ui/zentauri-components/charts/<type>` | Responsive Recharts chart entry for `area`, `bar`, `stacked-bar`, `radar`, `scatter`, `bubble`, `funnel`, `line`, or `pie`, with shared variants, palettes, and exported chart prop types. |
|
|
126
|
+
| `@zentauri-ui/zentauri-components/hooks/<entry>` | One hook module or `utils` (`cn`, `clampPage`, `range` from `src/lib/utils.ts`). Entries match files under `src/hooks/` (see **React hooks**). |
|
|
108
127
|
|
|
109
128
|
The UI `<name>` segment matches the folder under `src/ui/` (for example `accordion`, `select`, `empty-state`, `buttons` for `Button`, `inputs` for `Input`, `typography` for `Heading` / `Text` and related primitives). The hooks `<entry>` is the file stem (for example `useMediaQuery`, `usePagination`) or `utils`.
|
|
110
129
|
|
|
@@ -117,7 +136,7 @@ Only a subset of UI areas publish a `/animated` entry (see **Components**). Some
|
|
|
117
136
|
|
|
118
137
|
Published motion entries (same `<name>` as the base UI folder):
|
|
119
138
|
|
|
120
|
-
`accordion`, `alert`, `avatar`, `badge`, `buttons`, `card`, `checkbox`, `divider`, `drawer`, `empty-state`, `inputs`, `modal`, `popover`, `progress`, `radio-group`, `skeleton`, `spinner`, `table`, `tabs`, `toast`, `toggle`, `tooltip`, `tree-view`
|
|
139
|
+
`accordion`, `alert`, `avatar`, `badge`, `buttons`, `card`, `checkbox`, `command`, `copy-button`, `divider`, `drawer`, `empty-state`, `inputs`, `kbd`, `modal`, `popover`, `progress`, `radio-group`, `skeleton`, `spinner`, `table`, `tabs`, `timeline`, `toast`, `toggle`, `tooltip`, `tree-view`
|
|
121
140
|
|
|
122
141
|
**Spinner:** only the motion entry is built—import from `@zentauri-ui/zentauri-components/ui/spinner/animated` (there is no separate `ui/spinner` static bundle).
|
|
123
142
|
|
|
@@ -135,6 +154,7 @@ Import static primitives from `@zentauri-ui/zentauri-components/ui/<subpath>` wh
|
|
|
135
154
|
| --------------- | ----------------- | ---------------------------------- |
|
|
136
155
|
| Accordion | `accordion` | `accordion/animated` |
|
|
137
156
|
| Alert | `alert` | `alert/animated` |
|
|
157
|
+
| Animated number | `animated-number` | — |
|
|
138
158
|
| Avatar | `avatar` | `avatar/animated` |
|
|
139
159
|
| Badge | `badge` | `badge/animated` |
|
|
140
160
|
| Breadcrumb | `breadcrumb` | — |
|
|
@@ -162,7 +182,7 @@ Import static primitives from `@zentauri-ui/zentauri-components/ui/<subpath>` wh
|
|
|
162
182
|
| Rating | `rating` | — |
|
|
163
183
|
| Radio group | `radio-group` | `radio-group/animated` |
|
|
164
184
|
| Scroll area | `scroll-area` | — |
|
|
165
|
-
| Search | `search` |
|
|
185
|
+
| Search | `search` | — |
|
|
166
186
|
| Select | `select` | — |
|
|
167
187
|
| Skeleton | `skeleton` | `skeleton/animated` |
|
|
168
188
|
| Slider | `slider` | — |
|
|
@@ -170,6 +190,7 @@ Import static primitives from `@zentauri-ui/zentauri-components/ui/<subpath>` wh
|
|
|
170
190
|
| Stepper | `stepper` | — |
|
|
171
191
|
| Table | `table` | `table/animated` |
|
|
172
192
|
| Tabs | `tabs` | `tabs/animated` |
|
|
193
|
+
| Timeline | `timeline` | `timeline/animated` |
|
|
173
194
|
| Toast | `toast` | `toast/animated` |
|
|
174
195
|
| Toggle | `toggle` | `toggle/animated` |
|
|
175
196
|
| Tooltip | `tooltip` | `tooltip/animated` |
|
|
@@ -240,11 +261,11 @@ export function ArticleIntro() {
|
|
|
240
261
|
|
|
241
262
|
Import the chart you need from `@zentauri-ui/zentauri-components/charts/<type>`, or vendor it with `zentauri-components add charts/<type>`. It is built on **Recharts**, so install `recharts` when you use these entries.
|
|
242
263
|
|
|
243
|
-
**Components:** `AreaChart`, `BarChart`, `BubbleChart`, `LineChart`, `PieChart`.
|
|
264
|
+
**Components:** `AreaChart`, `BarChart`, `StackedBarChart`, `RadarChart`, `ScatterChart`, `BubbleChart`, `FunnelChart`, `LineChart`, `PieChart`.
|
|
244
265
|
|
|
245
|
-
**Types:** `AreaChartProps`, `BarChartProps`, `BubbleChartProps`, `LineChartProps`, `PieChartProps`, plus shared `ChartSeries`, `ChartDatum`, `ChartColor`, `ChartMargin`, and `ChartSharedStatic`.
|
|
266
|
+
**Types:** `AreaChartProps`, `BarChartProps`, `StackedBarChartProps`, `RadarChartProps`, `ScatterChartProps`, `BubbleChartProps`, `FunnelChartProps`, `LineChartProps`, `PieChartProps`, plus shared `ChartSeries`, `ChartDatum`, `ChartColor`, `ChartMargin`, and `ChartSharedStatic`.
|
|
246
267
|
|
|
247
|
-
**Chart entries:** `charts/area`, `charts/bar`, `charts/bubble`, `charts/line`, `charts/pie`.
|
|
268
|
+
**Chart entries:** `charts/area`, `charts/bar`, `charts/stacked-bar`, `charts/radar`, `charts/scatter`, `charts/bubble`, `charts/funnel`, `charts/line`, `charts/pie`.
|
|
248
269
|
|
|
249
270
|
**Variants:** `appearance` (`default`, `muted`, `outline`, `glass`) and `density` (`compact`, `comfortable`, `spacious`). Color presets are exported via `chartPalette` and `chartColorValues`.
|
|
250
271
|
|
|
@@ -361,6 +382,8 @@ Hooks live in `src/hooks/`. Each hook is a separate published entry under `@zent
|
|
|
361
382
|
| `usePrefersReducedMotion` | `usePrefersReducedMotion` | `prefers-reduced-motion` |
|
|
362
383
|
| `useResizeObserver` | `useResizeObserver` | `ElementSize` |
|
|
363
384
|
| `useSessionStorage` | `useSessionStorage` | `UseSessionStorageResult` |
|
|
385
|
+
| `useTableFilter` | `useTableFilter` | `TableFilterState`, `UseTableFilterResult` |
|
|
386
|
+
| `useTableSort` | `useTableSort` | `UseTableSortParams`, `UseTableSortResult` |
|
|
364
387
|
| `useThrottledCallback` | `useThrottledCallback` | Throttled callback ref |
|
|
365
388
|
| `useToggle` | `useToggle` | Boolean toggle state |
|
|
366
389
|
| `useWindowSize` | `useWindowSize` | `WindowSize` |
|
|
@@ -376,6 +399,8 @@ import {
|
|
|
376
399
|
buildPaginationItems,
|
|
377
400
|
usePagination,
|
|
378
401
|
} from "@zentauri-ui/zentauri-components/hooks/usePagination";
|
|
402
|
+
import { useTableFilter } from "@zentauri-ui/zentauri-components/hooks/useTableFilter";
|
|
403
|
+
import { useTableSort } from "@zentauri-ui/zentauri-components/hooks/useTableSort";
|
|
379
404
|
import { cn } from "@zentauri-ui/zentauri-components/hooks/utils";
|
|
380
405
|
```
|
|
381
406
|
|
|
@@ -644,9 +669,10 @@ Defaults look like this; edit `resolvedPaths` and `aliases` so they match your a
|
|
|
644
669
|
|
|
645
670
|
### Registry (`cli/registry.json`)
|
|
646
671
|
|
|
647
|
-
- **`components`**: sorted list of folder names under **`src/ui/`**, plus chart entries from **`src/charts/<type>`**, that `add` may copy. The file is **generated**; the canonical build
|
|
672
|
+
- **`components`**: sorted list of folder names under **`src/ui/`**, plus chart entries from **`src/charts/<type>`**, that `add` may copy. The file is **generated**; the canonical build lists live in **`tsup.config.ts`** as `uiComponentNames`, `uiAnimatedComponentNames`, and `chartEntryNames`, so animated-only entries such as **`spinner`** stay aligned with the CLI.
|
|
648
673
|
- **`hooks`**: sorted list of folder names under **`src/hooks/`** that `add hook` may copy; generated from **`hooksEntryNames`** in **`tsup.config.ts`** (same entries as published `…/hooks/<name>` subpaths).
|
|
649
|
-
- **`nameAliases`**: optional map from a CLI token to a real folder name
|
|
674
|
+
- **`nameAliases`**: optional map from a CLI token to a real folder name: `button` → `buttons`, `input` → `inputs` (singular forms while folders stay plural), and `chart-<type>` → `charts/<type>` for every chart (so `add chart-line` and `add charts/line` are equivalent).
|
|
675
|
+
- **`peerHints`**: generated map from a component/chart name to the **optional peer dependencies** its source imports (`framer-motion` for components that ship an `animated/` variant, `react-icons` where icons are used, `recharts` for every chart). After `add`, the CLI prints a deduplicated install hint built from this map, so you never have to guess which peers a vendored component needs.
|
|
650
676
|
|
|
651
677
|
Example: these are equivalent when `nameAliases` is configured:
|
|
652
678
|
|
|
@@ -657,6 +683,45 @@ zentauri-components add buttons
|
|
|
657
683
|
|
|
658
684
|
After `add`, imports inside copied `.ts`/`.tsx` files are rewritten using your `aliases`; test files (`*.test.*`, `*.spec.*`) from the package are not copied.
|
|
659
685
|
|
|
686
|
+
### Worked examples
|
|
687
|
+
|
|
688
|
+
```bash
|
|
689
|
+
# A static UI primitive — copies src/ui/buttons plus the shared design-system tokens it imports.
|
|
690
|
+
zentauri-ui add button
|
|
691
|
+
|
|
692
|
+
# A chart — copies src/charts/line and the shared chart frame; CLI hints `recharts`.
|
|
693
|
+
zentauri-ui add charts/line
|
|
694
|
+
|
|
695
|
+
# A hook on its own — copies src/hooks/useClipboard (plus any sibling hooks it imports).
|
|
696
|
+
zentauri-ui add hook useClipboard
|
|
697
|
+
```
|
|
698
|
+
|
|
699
|
+
### Vendored destination structure
|
|
700
|
+
|
|
701
|
+
Given the default `components.json`, running `zentauri-ui add button charts/line` then `add hook useClipboard` produces:
|
|
702
|
+
|
|
703
|
+
```
|
|
704
|
+
your-app/
|
|
705
|
+
├── components.json
|
|
706
|
+
└── src/
|
|
707
|
+
├── components/
|
|
708
|
+
│ ├── design-system/ # shared token + variant strings (copied once, never overwritten)
|
|
709
|
+
│ │ └── button.ts
|
|
710
|
+
│ └── ui/
|
|
711
|
+
│ ├── buttons/ # the component folder (index.ts, button.tsx, variants.ts, …)
|
|
712
|
+
│ └── charts/
|
|
713
|
+
│ ├── shared/ # chart frame + helpers shared by every chart
|
|
714
|
+
│ └── line/ # the requested chart entry only
|
|
715
|
+
├── hooks/
|
|
716
|
+
│ └── useClipboard/ # hooks pulled in by components or `add hook`
|
|
717
|
+
└── lib/
|
|
718
|
+
└── utils.ts # cn() helper, created from the package template if missing
|
|
719
|
+
```
|
|
720
|
+
|
|
721
|
+
- `design-system/` lands beside `ui/` (one level up from `resolvedPaths.ui`) so vendored components keep their `../../design-system/*` imports working without a new alias. Existing files there are left untouched on re-add.
|
|
722
|
+
- Charts always land under `<ui>/charts/`, with a single shared `charts/shared/` folder regardless of how many chart types you add.
|
|
723
|
+
- Re-adding a component overwrites that component's files but preserves your `design-system/` and `lib/utils.ts` edits.
|
|
724
|
+
|
|
660
725
|
### When to use the CLI vs npm imports
|
|
661
726
|
|
|
662
727
|
| Approach | Best when |
|
|
@@ -670,14 +735,47 @@ Tailwind still needs to see the classes your **copied** files use—point `@sour
|
|
|
670
735
|
|
|
671
736
|
https://zentauri-ui.vercel.app/
|
|
672
737
|
|
|
738
|
+
## Accessibility checklist for contributors
|
|
739
|
+
|
|
740
|
+
Every new or changed component should clear this bar before it merges. The
|
|
741
|
+
highest-risk primitives (overlays and keyboard-heavy controls) are expected to
|
|
742
|
+
have explicit tests for the items below.
|
|
743
|
+
|
|
744
|
+
**Semantics & ARIA**
|
|
745
|
+
|
|
746
|
+
- [ ] Correct landmark/role for the pattern (`dialog`, `menu`/`menuitem`, `listbox`/`option`, `tab`/`tabpanel`, `slider`, `tree`/`treeitem`, …).
|
|
747
|
+
- [ ] State is announced: `aria-expanded`, `aria-selected`, `aria-checked`, `aria-disabled`, `aria-current` as appropriate.
|
|
748
|
+
- [ ] Overlays set `aria-modal` and wire `aria-labelledby` / `aria-describedby` to the rendered title/description.
|
|
749
|
+
- [ ] Compound parts are linked by id (`aria-controls`, `aria-haspopup`) rather than relying on DOM proximity.
|
|
750
|
+
|
|
751
|
+
**Keyboard**
|
|
752
|
+
|
|
753
|
+
- [ ] All interactive parts are reachable and operable by keyboard (Enter/Space activate; Arrow keys navigate where the role implies it).
|
|
754
|
+
- [ ] Roving tabindex for composite widgets (one tab stop; arrows move within).
|
|
755
|
+
- [ ] Dismissible surfaces close on `Escape`.
|
|
756
|
+
- [ ] Focus moves into an opened overlay and **returns to the trigger** on close.
|
|
757
|
+
|
|
758
|
+
**Disabled & edge states**
|
|
759
|
+
|
|
760
|
+
- [ ] Disabled items are skipped by keyboard navigation and ignore pointer activation, and expose `aria-disabled`.
|
|
761
|
+
- [ ] SSR-safe: no access to `window`/`document` during render (guard effects; the package targets React 18+ server rendering).
|
|
762
|
+
|
|
763
|
+
**Motion**
|
|
764
|
+
|
|
765
|
+
- [ ] Animated entries respect `prefers-reduced-motion` (use `usePrefersReducedMotion` / Framer Motion's `useReducedMotion`).
|
|
766
|
+
- [ ] `framer-motion` stays out of static entries — enforced by `src/ui/peer-isolation.test.ts`. Charts stay isolated to `src/charts/*`.
|
|
767
|
+
|
|
768
|
+
Add or extend the component's `*.test.tsx` to cover the items that apply; see
|
|
769
|
+
`modal`, `select`, and `context-menu` tests for worked examples.
|
|
770
|
+
|
|
673
771
|
## Development
|
|
674
772
|
|
|
675
773
|
From this package directory in the monorepo:
|
|
676
774
|
|
|
677
775
|
- `pnpm build` (or `npm run build`) — production bundle via `tsup` (Rollup treeshake + `scripts/prepend-use-client.mjs` via `onSuccess` so each UI entry under `dist/ui/`, the chart entry under `dist/charts/`, and `dist/ui/<name>/animated.*` starts with `"use client"` where needed)
|
|
678
776
|
- `pnpm dev` — `tsup` watch mode (same `onSuccess` hook after each rebuild)
|
|
679
|
-
- `pnpm test` / `pnpm test:watch` — **Vitest** and **Testing Library** unit tests // covered
|
|
680
|
-
- **`pnpm run generate:registry`** — runs `scripts/generate-registry.mjs`, which reads **`uiComponentNames`**, **`chartEntryNames`**, and **`hooksEntryNames`** from `tsup.config.ts`,
|
|
777
|
+
- `pnpm test` / `pnpm test:watch` — **Vitest** and **Testing Library** unit tests // covered 548 test cases in total
|
|
778
|
+
- **`pnpm run generate:registry`** — runs `scripts/generate-registry.mjs`, which reads **`uiComponentNames`**, **`uiAnimatedComponentNames`**, **`chartEntryNames`**, and **`hooksEntryNames`** from `tsup.config.ts`, applies fixed **`nameAliases`**, scans each component/chart source to build **`peerHints`**, and writes **`cli/registry.json`** (`components` + `hooks` + `peerHints`). Run this after adding or renaming UI/chart areas or hook entries so the CLI stays in sync (the script prints counts).
|
|
681
779
|
|
|
682
780
|
## Github Release log
|
|
683
781
|
|
|
@@ -9,8 +9,8 @@ const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
|
9
9
|
const packageRoot = join(__dirname, "..");
|
|
10
10
|
const cliEntry = join(packageRoot, "cli", "index.mjs");
|
|
11
11
|
|
|
12
|
-
function runCli(cwd: string, args: string[]) {
|
|
13
|
-
execFileSync(process.execPath, [cliEntry, ...args], {
|
|
12
|
+
function runCli(cwd: string, args: string[]): string {
|
|
13
|
+
return execFileSync(process.execPath, [cliEntry, ...args], {
|
|
14
14
|
cwd,
|
|
15
15
|
encoding: "utf8",
|
|
16
16
|
stdio: ["pipe", "pipe", "pipe"],
|
|
@@ -84,4 +84,79 @@ describe("zentauri-ui CLI", () => {
|
|
|
84
84
|
rmSync(dir, { recursive: true, force: true });
|
|
85
85
|
}
|
|
86
86
|
});
|
|
87
|
+
|
|
88
|
+
it("should add a chart entry under charts/ and hint recharts", () => {
|
|
89
|
+
const dir = mkdtempSync(join(tmpdir(), "zentauri-cli-chart-"));
|
|
90
|
+
try {
|
|
91
|
+
runCli(dir, ["init"]);
|
|
92
|
+
const out = runCli(dir, ["add", "charts/line"]);
|
|
93
|
+
expect(
|
|
94
|
+
existsSync(join(dir, "src/components/ui/charts/line/index.ts")),
|
|
95
|
+
).toBe(true);
|
|
96
|
+
// chart-line alias resolves to charts/line as well
|
|
97
|
+
expect(out).toContain("recharts");
|
|
98
|
+
} finally {
|
|
99
|
+
rmSync(dir, { recursive: true, force: true });
|
|
100
|
+
}
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
it("should add multiple components in one run", () => {
|
|
104
|
+
const dir = mkdtempSync(join(tmpdir(), "zentauri-cli-multi-"));
|
|
105
|
+
try {
|
|
106
|
+
runCli(dir, ["init"]);
|
|
107
|
+
const out = runCli(dir, ["add", "buttons", "card", "badge"]);
|
|
108
|
+
expect(existsSync(join(dir, "src/components/ui/buttons/button.tsx"))).toBe(
|
|
109
|
+
true,
|
|
110
|
+
);
|
|
111
|
+
expect(existsSync(join(dir, "src/components/ui/card/card.tsx"))).toBe(
|
|
112
|
+
true,
|
|
113
|
+
);
|
|
114
|
+
expect(existsSync(join(dir, "src/components/ui/badge/badge.tsx"))).toBe(
|
|
115
|
+
true,
|
|
116
|
+
);
|
|
117
|
+
expect(out).toContain("Adding buttons…");
|
|
118
|
+
expect(out).toContain("Adding badge…");
|
|
119
|
+
} finally {
|
|
120
|
+
rmSync(dir, { recursive: true, force: true });
|
|
121
|
+
}
|
|
122
|
+
});
|
|
123
|
+
|
|
124
|
+
it("should print react-icons peer hint for components that use icons", () => {
|
|
125
|
+
const dir = mkdtempSync(join(tmpdir(), "zentauri-cli-peer-"));
|
|
126
|
+
try {
|
|
127
|
+
runCli(dir, ["init"]);
|
|
128
|
+
const out = runCli(dir, ["add", "rating"]);
|
|
129
|
+
expect(out).toContain("Optional peer dependencies");
|
|
130
|
+
expect(out).toContain("react-icons");
|
|
131
|
+
} finally {
|
|
132
|
+
rmSync(dir, { recursive: true, force: true });
|
|
133
|
+
}
|
|
134
|
+
});
|
|
135
|
+
|
|
136
|
+
it("should print Tailwind v4 source guidance after adding", () => {
|
|
137
|
+
const dir = mkdtempSync(join(tmpdir(), "zentauri-cli-tw-"));
|
|
138
|
+
try {
|
|
139
|
+
runCli(dir, ["init"]);
|
|
140
|
+
const out = runCli(dir, ["add", "buttons"]);
|
|
141
|
+
expect(out).toContain("Tailwind v4");
|
|
142
|
+
expect(out).toContain("@source");
|
|
143
|
+
} finally {
|
|
144
|
+
rmSync(dir, { recursive: true, force: true });
|
|
145
|
+
}
|
|
146
|
+
});
|
|
147
|
+
|
|
148
|
+
it("should not error when re-adding a component (existing files)", () => {
|
|
149
|
+
const dir = mkdtempSync(join(tmpdir(), "zentauri-cli-reAdd-"));
|
|
150
|
+
try {
|
|
151
|
+
runCli(dir, ["init"]);
|
|
152
|
+
runCli(dir, ["add", "buttons"]);
|
|
153
|
+
// Second add over existing files must succeed and keep the design-system.
|
|
154
|
+
expect(() => runCli(dir, ["add", "buttons"])).not.toThrow();
|
|
155
|
+
expect(
|
|
156
|
+
existsSync(join(dir, "src/components/design-system/button.ts")),
|
|
157
|
+
).toBe(true);
|
|
158
|
+
} finally {
|
|
159
|
+
rmSync(dir, { recursive: true, force: true });
|
|
160
|
+
}
|
|
161
|
+
});
|
|
87
162
|
});
|
package/cli/index.mjs
CHANGED
|
@@ -599,6 +599,58 @@ async function ensureUtilsFile(config, configDir, packageRoot) {
|
|
|
599
599
|
console.log(`Created ${relative(configDir, dest)}`);
|
|
600
600
|
}
|
|
601
601
|
|
|
602
|
+
/**
|
|
603
|
+
* Human-readable note explaining why each optional peer dependency may be
|
|
604
|
+
* needed, so the install hint is self-explanatory.
|
|
605
|
+
*/
|
|
606
|
+
const PEER_HINT_REASONS = {
|
|
607
|
+
"framer-motion": "only if you use the animated variants",
|
|
608
|
+
"react-icons": "icons used by this component",
|
|
609
|
+
recharts: "required to render charts",
|
|
610
|
+
};
|
|
611
|
+
|
|
612
|
+
/**
|
|
613
|
+
* Prints optional peer-dependency install hints and Tailwind v4 scanning
|
|
614
|
+
* guidance after a successful `add`. Hints come from `registry.peerHints`
|
|
615
|
+
* (generated by scripts/generate-registry.mjs). Silent when nothing applies.
|
|
616
|
+
*
|
|
617
|
+
* @param {string[]} resolvedNames — canonical component/chart names that were added
|
|
618
|
+
* @param {object} registry — from `loadRegistry()`
|
|
619
|
+
* @param {object} config — validated `components.json` (for resolvedPaths.ui)
|
|
620
|
+
*/
|
|
621
|
+
function printAdoptionHints(resolvedNames, registry, config) {
|
|
622
|
+
const peerHints = registry.peerHints ?? {};
|
|
623
|
+
/** @type {Map<string, string[]>} peer -> component names that need it */
|
|
624
|
+
const needed = new Map();
|
|
625
|
+
for (const name of resolvedNames) {
|
|
626
|
+
for (const peer of peerHints[name] ?? []) {
|
|
627
|
+
if (!needed.has(peer)) {
|
|
628
|
+
needed.set(peer, []);
|
|
629
|
+
}
|
|
630
|
+
needed.get(peer).push(name);
|
|
631
|
+
}
|
|
632
|
+
}
|
|
633
|
+
|
|
634
|
+
if (needed.size > 0) {
|
|
635
|
+
console.log("\nOptional peer dependencies:");
|
|
636
|
+
for (const [peer, users] of needed) {
|
|
637
|
+
const reason = PEER_HINT_REASONS[peer] ?? "";
|
|
638
|
+
console.log(
|
|
639
|
+
` - ${peer}${reason ? ` (${reason})` : ""} — used by ${users.join(", ")}`,
|
|
640
|
+
);
|
|
641
|
+
}
|
|
642
|
+
console.log(` Install with: npm i ${[...needed.keys()].join(" ")}`);
|
|
643
|
+
}
|
|
644
|
+
|
|
645
|
+
const uiPath = config?.resolvedPaths?.ui ?? "your components directory";
|
|
646
|
+
console.log(
|
|
647
|
+
`\nTailwind v4: vendored files live in ${uiPath}, so they are scanned automatically when inside your app's content sources.`,
|
|
648
|
+
);
|
|
649
|
+
console.log(
|
|
650
|
+
` If you placed them elsewhere, add: @source "${uiPath}"; (light + dark: classes are paired, so the whole tree must be scanned)`,
|
|
651
|
+
);
|
|
652
|
+
}
|
|
653
|
+
|
|
602
654
|
/**
|
|
603
655
|
* `zentauri-components init` — writes default `components.json` next to `--cwd`.
|
|
604
656
|
*
|
|
@@ -707,6 +759,7 @@ async function cmdAdd(names, cwd) {
|
|
|
707
759
|
}
|
|
708
760
|
|
|
709
761
|
console.log("Done.");
|
|
762
|
+
printAdoptionHints(resolvedNames, registry, config);
|
|
710
763
|
}
|
|
711
764
|
|
|
712
765
|
/**
|
package/cli/registry.json
CHANGED
|
@@ -13,8 +13,12 @@
|
|
|
13
13
|
"charts/area",
|
|
14
14
|
"charts/bar",
|
|
15
15
|
"charts/bubble",
|
|
16
|
+
"charts/funnel",
|
|
16
17
|
"charts/line",
|
|
17
18
|
"charts/pie",
|
|
19
|
+
"charts/radar",
|
|
20
|
+
"charts/scatter",
|
|
21
|
+
"charts/stacked-bar",
|
|
18
22
|
"checkbox",
|
|
19
23
|
"command",
|
|
20
24
|
"context-menu",
|
|
@@ -75,17 +79,149 @@
|
|
|
75
79
|
"usePrefersReducedMotion",
|
|
76
80
|
"useResizeObserver",
|
|
77
81
|
"useSessionStorage",
|
|
82
|
+
"useTableFilter",
|
|
83
|
+
"useTableSort",
|
|
78
84
|
"useThrottledCallback",
|
|
79
85
|
"useToggle",
|
|
80
86
|
"useWindowSize"
|
|
81
87
|
],
|
|
88
|
+
"peerHints": {
|
|
89
|
+
"accordion": [
|
|
90
|
+
"framer-motion"
|
|
91
|
+
],
|
|
92
|
+
"alert": [
|
|
93
|
+
"react-icons",
|
|
94
|
+
"framer-motion"
|
|
95
|
+
],
|
|
96
|
+
"animated-number": [
|
|
97
|
+
"framer-motion"
|
|
98
|
+
],
|
|
99
|
+
"avatar": [
|
|
100
|
+
"framer-motion"
|
|
101
|
+
],
|
|
102
|
+
"badge": [
|
|
103
|
+
"react-icons",
|
|
104
|
+
"framer-motion"
|
|
105
|
+
],
|
|
106
|
+
"buttons": [
|
|
107
|
+
"framer-motion"
|
|
108
|
+
],
|
|
109
|
+
"card": [
|
|
110
|
+
"framer-motion"
|
|
111
|
+
],
|
|
112
|
+
"checkbox": [
|
|
113
|
+
"framer-motion"
|
|
114
|
+
],
|
|
115
|
+
"command": [
|
|
116
|
+
"framer-motion"
|
|
117
|
+
],
|
|
118
|
+
"context-menu": [
|
|
119
|
+
"react-icons"
|
|
120
|
+
],
|
|
121
|
+
"copy-button": [
|
|
122
|
+
"react-icons",
|
|
123
|
+
"framer-motion"
|
|
124
|
+
],
|
|
125
|
+
"divider": [
|
|
126
|
+
"framer-motion"
|
|
127
|
+
],
|
|
128
|
+
"drawer": [
|
|
129
|
+
"framer-motion"
|
|
130
|
+
],
|
|
131
|
+
"dropdown": [
|
|
132
|
+
"react-icons"
|
|
133
|
+
],
|
|
134
|
+
"empty-state": [
|
|
135
|
+
"framer-motion"
|
|
136
|
+
],
|
|
137
|
+
"inputs": [
|
|
138
|
+
"framer-motion"
|
|
139
|
+
],
|
|
140
|
+
"kbd": [
|
|
141
|
+
"framer-motion"
|
|
142
|
+
],
|
|
143
|
+
"modal": [
|
|
144
|
+
"framer-motion"
|
|
145
|
+
],
|
|
146
|
+
"popover": [
|
|
147
|
+
"framer-motion"
|
|
148
|
+
],
|
|
149
|
+
"progress": [
|
|
150
|
+
"framer-motion"
|
|
151
|
+
],
|
|
152
|
+
"radio-group": [
|
|
153
|
+
"framer-motion"
|
|
154
|
+
],
|
|
155
|
+
"rating": [
|
|
156
|
+
"react-icons"
|
|
157
|
+
],
|
|
158
|
+
"skeleton": [
|
|
159
|
+
"framer-motion"
|
|
160
|
+
],
|
|
161
|
+
"table": [
|
|
162
|
+
"framer-motion"
|
|
163
|
+
],
|
|
164
|
+
"tabs": [
|
|
165
|
+
"framer-motion"
|
|
166
|
+
],
|
|
167
|
+
"timeline": [
|
|
168
|
+
"framer-motion"
|
|
169
|
+
],
|
|
170
|
+
"toast": [
|
|
171
|
+
"framer-motion"
|
|
172
|
+
],
|
|
173
|
+
"toggle": [
|
|
174
|
+
"framer-motion"
|
|
175
|
+
],
|
|
176
|
+
"tooltip": [
|
|
177
|
+
"framer-motion"
|
|
178
|
+
],
|
|
179
|
+
"tree-view": [
|
|
180
|
+
"react-icons",
|
|
181
|
+
"framer-motion"
|
|
182
|
+
],
|
|
183
|
+
"spinner": [
|
|
184
|
+
"framer-motion"
|
|
185
|
+
],
|
|
186
|
+
"charts/area": [
|
|
187
|
+
"recharts"
|
|
188
|
+
],
|
|
189
|
+
"charts/bar": [
|
|
190
|
+
"recharts"
|
|
191
|
+
],
|
|
192
|
+
"charts/bubble": [
|
|
193
|
+
"recharts"
|
|
194
|
+
],
|
|
195
|
+
"charts/funnel": [
|
|
196
|
+
"recharts"
|
|
197
|
+
],
|
|
198
|
+
"charts/line": [
|
|
199
|
+
"recharts"
|
|
200
|
+
],
|
|
201
|
+
"charts/pie": [
|
|
202
|
+
"recharts"
|
|
203
|
+
],
|
|
204
|
+
"charts/radar": [
|
|
205
|
+
"recharts"
|
|
206
|
+
],
|
|
207
|
+
"charts/scatter": [
|
|
208
|
+
"recharts"
|
|
209
|
+
],
|
|
210
|
+
"charts/stacked-bar": [
|
|
211
|
+
"recharts"
|
|
212
|
+
]
|
|
213
|
+
},
|
|
82
214
|
"nameAliases": {
|
|
83
215
|
"button": "buttons",
|
|
84
216
|
"chart-area": "charts/area",
|
|
85
217
|
"chart-bar": "charts/bar",
|
|
86
218
|
"chart-bubble": "charts/bubble",
|
|
219
|
+
"chart-funnel": "charts/funnel",
|
|
87
220
|
"chart-line": "charts/line",
|
|
88
221
|
"chart-pie": "charts/pie",
|
|
222
|
+
"chart-radar": "charts/radar",
|
|
223
|
+
"chart-scatter": "charts/scatter",
|
|
224
|
+
"chart-stacked-bar": "charts/stacked-bar",
|
|
89
225
|
"input": "inputs"
|
|
90
226
|
}
|
|
91
227
|
}
|
package/cli/rewrite-imports.mjs
CHANGED
|
@@ -13,7 +13,10 @@ export function rewriteImports(source, options) {
|
|
|
13
13
|
const re = /from\s+(["'])((?:\.\.\/)+)hooks\/([^'"]+)\1/g;
|
|
14
14
|
let m;
|
|
15
15
|
while ((m = re.exec(text)) !== null) {
|
|
16
|
-
|
|
16
|
+
// Imports may target a file inside the hook folder
|
|
17
|
+
// (e.g. hooks/useResizeObserver/useResizeObserver); the copyable unit is
|
|
18
|
+
// the folder, so keep only the first path segment.
|
|
19
|
+
usedHooks.add(m[3].split("/")[0]);
|
|
17
20
|
}
|
|
18
21
|
};
|
|
19
22
|
|