gridsmith-ui 0.4.0 → 0.6.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.
Files changed (58) hide show
  1. package/README.md +63 -3
  2. package/dist/charts.d.ts +246 -0
  3. package/dist/charts.js +1028 -0
  4. package/dist/charts.js.map +1 -0
  5. package/dist/chunk-4SDKQDYV.js +93 -0
  6. package/dist/chunk-4SDKQDYV.js.map +1 -0
  7. package/dist/chunk-CHNY75QI.js +278 -0
  8. package/dist/chunk-CHNY75QI.js.map +1 -0
  9. package/dist/chunk-DPF6776I.js +36 -0
  10. package/dist/chunk-DPF6776I.js.map +1 -0
  11. package/dist/{chunk-5XIPPVH7.js → chunk-IUBWNDUK.js} +15 -4
  12. package/dist/chunk-IUBWNDUK.js.map +1 -0
  13. package/dist/chunk-OUYJXVLQ.js +41 -0
  14. package/dist/chunk-OUYJXVLQ.js.map +1 -0
  15. package/dist/{chunk-6TMNEBBJ.js → chunk-XUBVMRIE.js} +44 -35
  16. package/dist/chunk-XUBVMRIE.js.map +1 -0
  17. package/dist/data-grid.d.ts +27 -0
  18. package/dist/data-grid.js +293 -0
  19. package/dist/data-grid.js.map +1 -0
  20. package/dist/editor.d.ts +18 -0
  21. package/dist/editor.js +632 -0
  22. package/dist/editor.js.map +1 -0
  23. package/dist/{feather-432JQGUB.js → feather-V32UNIQL.js} +2 -3
  24. package/dist/feather-V32UNIQL.js.map +1 -0
  25. package/dist/{heroicons-CCKJHFZY.js → heroicons-CA5OQ76O.js} +2 -3
  26. package/dist/heroicons-CA5OQ76O.js.map +1 -0
  27. package/dist/icons.js +1 -2
  28. package/dist/index.d.ts +430 -133
  29. package/dist/index.js +10510 -98031
  30. package/dist/index.js.map +1 -1
  31. package/dist/kanban.d.ts +25 -0
  32. package/dist/kanban.js +224 -0
  33. package/dist/kanban.js.map +1 -0
  34. package/dist/{lucide-Z74WVRAK.js → lucide-AILUUOAJ.js} +2 -3
  35. package/dist/lucide-AILUUOAJ.js.map +1 -0
  36. package/dist/{phosphor-DYUCR5S2.js → phosphor-A4JOBGMT.js} +2 -3
  37. package/dist/phosphor-A4JOBGMT.js.map +1 -0
  38. package/dist/resizable.d.ts +39 -0
  39. package/dist/resizable.js +89 -0
  40. package/dist/resizable.js.map +1 -0
  41. package/dist/roots.css +46 -11
  42. package/dist/{tabler-GRXDPAHR.js → tabler-TVOR6AFM.js} +2 -3
  43. package/dist/tabler-TVOR6AFM.js.map +1 -0
  44. package/dist/use-breakpoint-Cn51IubK.d.ts +30 -0
  45. package/dist/utils.js +1 -2
  46. package/dist/virtualized.d.ts +16 -0
  47. package/dist/virtualized.js +55 -0
  48. package/dist/virtualized.js.map +1 -0
  49. package/package.json +144 -4
  50. package/dist/chunk-5WRI5ZAA.js +0 -29
  51. package/dist/chunk-5WRI5ZAA.js.map +0 -1
  52. package/dist/chunk-5XIPPVH7.js.map +0 -1
  53. package/dist/chunk-6TMNEBBJ.js.map +0 -1
  54. package/dist/feather-432JQGUB.js.map +0 -1
  55. package/dist/heroicons-CCKJHFZY.js.map +0 -1
  56. package/dist/lucide-Z74WVRAK.js.map +0 -1
  57. package/dist/phosphor-DYUCR5S2.js.map +0 -1
  58. package/dist/tabler-GRXDPAHR.js.map +0 -1
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # gridsmith-ui
2
2
 
3
- 82 React components with a CSS custom property theming engine.
3
+ 98 React components with a CSS custom property theming engine, 14 chart components, and 5 icon packs.
4
4
 
5
5
  ## Installation
6
6
 
@@ -8,6 +8,30 @@
8
8
  npm install gridsmith-ui
9
9
  ```
10
10
 
11
+ ### Charts (optional)
12
+
13
+ ```bash
14
+ npm install recharts
15
+ ```
16
+
17
+ ### Heavy components (optional)
18
+
19
+ Five components depend on large third-party libraries. They live in their own entry points so the main bundle stays small — install the library only if you use the component:
20
+
21
+ ```bash
22
+ npm install @tiptap/react @tiptap/pm @tiptap/starter-kit lowlight \
23
+ @tiptap/extension-code-block-lowlight @tiptap/extension-color @tiptap/extension-font-family \
24
+ @tiptap/extension-highlight @tiptap/extension-image @tiptap/extension-link \
25
+ @tiptap/extension-placeholder @tiptap/extension-subscript @tiptap/extension-superscript \
26
+ @tiptap/extension-table @tiptap/extension-table-cell @tiptap/extension-table-header \
27
+ @tiptap/extension-table-row @tiptap/extension-task-item @tiptap/extension-task-list \
28
+ @tiptap/extension-text-align @tiptap/extension-text-style @tiptap/extension-underline # gridsmith-ui/editor
29
+ npm install @dnd-kit/core @dnd-kit/sortable @dnd-kit/utilities # gridsmith-ui/kanban
30
+ npm install @tanstack/react-table # gridsmith-ui/data-grid
31
+ npm install @tanstack/react-virtual # gridsmith-ui/virtualized
32
+ npm install react-resizable-panels # gridsmith-ui/resizable
33
+ ```
34
+
11
35
  ### Icon packs (optional)
12
36
 
13
37
  The `Icon` component uses `lucide-react` by default. Other packs are loaded on demand — install only what you need:
@@ -38,10 +62,40 @@ Import the design tokens and Tailwind bindings in your CSS entry point:
38
62
  - **tokens.css** — default Precision Minimal preset values (optional: use `generate-tokens.ts` to customise)
39
63
  - **tailwind.css** — maps `--ds-*` tokens to Tailwind utilities (`p-ds-4`, `text-2xs`, `opacity-disabled`)
40
64
 
65
+ For the fastest icon rendering on cold loads, call `preloadPack` in your entry point before `createRoot`:
66
+
67
+ ```tsx
68
+ import { preloadPack } from "gridsmith-ui/icons";
69
+ preloadPack("lucide");
70
+ ```
71
+
72
+ ## Entry Points
73
+
74
+ | Import path | What it provides |
75
+ |---|---|
76
+ | `gridsmith-ui` | 97 components (actions, forms, data display, navigation, overlays, feedback, layout) |
77
+ | `gridsmith-ui/charts` | 14 chart components (Bar, Line, Area, Pie, Composite, Scatter, Radar, RadialBar, Funnel, Treemap, Sankey, Sparkline, ChartContainer) + `useChartColors` hook |
78
+ | `gridsmith-ui/editor` | `RichTextEditor` (requires the tiptap packages + `lowlight`) |
79
+ | `gridsmith-ui/kanban` | `KanbanBoard` (requires `@dnd-kit/*`) |
80
+ | `gridsmith-ui/data-grid` | `DataGrid` (requires `@tanstack/react-table`) |
81
+ | `gridsmith-ui/virtualized` | `VirtualizedList` (requires `@tanstack/react-virtual`) |
82
+ | `gridsmith-ui/resizable` | `ResizablePanelGroup`, `ResizablePanel`, `ResizableHandle` (requires `react-resizable-panels`) |
83
+ | `gridsmith-ui/icons` | `Icon`, `IconProvider`, `preloadPack` — 5 icon packs with two-phase loading |
84
+ | `gridsmith-ui/utils` | `cn()` — className merge utility (clsx + tailwind-merge) |
85
+ | `gridsmith-ui/roots.css` | CSS custom property engine |
86
+ | `gridsmith-ui/tokens.css` | Default preset token values |
87
+ | `gridsmith-ui/tailwind.css` | Tailwind v4 `@theme` bindings for `--ds-*` tokens |
88
+
41
89
  ## Usage
42
90
 
43
91
  ```tsx
44
- import { Button, Card, Input } from "gridsmith-ui";
92
+ import { Button, Card, Input, Table } from "gridsmith-ui";
93
+ import { BarChart, LineChart } from "gridsmith-ui/charts";
94
+ import { RichTextEditor } from "gridsmith-ui/editor";
95
+ import { KanbanBoard } from "gridsmith-ui/kanban";
96
+ import { DataGrid } from "gridsmith-ui/data-grid";
97
+ import { VirtualizedList } from "gridsmith-ui/virtualized";
98
+ import { ResizablePanelGroup, ResizablePanel, ResizableHandle } from "gridsmith-ui/resizable";
45
99
  import { Icon, IconProvider } from "gridsmith-ui/icons";
46
100
  import { cn } from "gridsmith-ui/utils";
47
101
  ```
@@ -68,12 +122,18 @@ Wrap your app in `<IconProvider>` to select a pack:
68
122
  </IconProvider>
69
123
  ```
70
124
 
71
- ## Peer dependencies
125
+ ## Peer Dependencies
72
126
 
73
127
  | Package | Required |
74
128
  |---------|----------|
75
129
  | `react` / `react-dom` | Yes (^18 or ^19) |
76
130
  | `lucide-react` | Optional (default icon pack) |
131
+ | `recharts` | Optional (required for `gridsmith-ui/charts`) |
132
+ | `@tiptap/*`, `lowlight` | Optional (required for `gridsmith-ui/editor`) |
133
+ | `@dnd-kit/*` | Optional (required for `gridsmith-ui/kanban`) |
134
+ | `@tanstack/react-table` | Optional (required for `gridsmith-ui/data-grid`) |
135
+ | `@tanstack/react-virtual` | Optional (required for `gridsmith-ui/virtualized`) |
136
+ | `react-resizable-panels` | Optional (required for `gridsmith-ui/resizable`) |
77
137
  | `@phosphor-icons/react` | Optional |
78
138
  | `@heroicons/react` | Optional |
79
139
  | `@tabler/icons-react` | Optional |
@@ -0,0 +1,246 @@
1
+ import * as react from 'react';
2
+ import { ReactNode } from 'react';
3
+ import * as react_jsx_runtime from 'react/jsx-runtime';
4
+
5
+ interface BarDef {
6
+ dataKey: string;
7
+ label?: string;
8
+ soft?: boolean;
9
+ }
10
+ interface BarChartProps {
11
+ data: Record<string, unknown>[];
12
+ bars: BarDef[];
13
+ xAxisKey: string;
14
+ height?: "sm" | "md" | "lg" | number;
15
+ stacked?: boolean;
16
+ horizontal?: boolean;
17
+ showGrid?: boolean;
18
+ showTooltip?: boolean;
19
+ showLegend?: boolean;
20
+ xAxisLabel?: string;
21
+ yAxisLabel?: string;
22
+ animated?: boolean;
23
+ "aria-label"?: string;
24
+ className?: string;
25
+ }
26
+ declare const BarChart: react.ForwardRefExoticComponent<BarChartProps & react.RefAttributes<HTMLDivElement>>;
27
+
28
+ interface LineDef {
29
+ dataKey: string;
30
+ label?: string;
31
+ dashed?: boolean;
32
+ }
33
+ interface LineChartProps {
34
+ data: Record<string, unknown>[];
35
+ lines: LineDef[];
36
+ xAxisKey: string;
37
+ height?: "sm" | "md" | "lg" | number;
38
+ curved?: boolean;
39
+ showDots?: boolean;
40
+ showGrid?: boolean;
41
+ showTooltip?: boolean;
42
+ showLegend?: boolean;
43
+ xAxisLabel?: string;
44
+ yAxisLabel?: string;
45
+ animated?: boolean;
46
+ "aria-label"?: string;
47
+ className?: string;
48
+ }
49
+ declare const LineChart: react.ForwardRefExoticComponent<LineChartProps & react.RefAttributes<HTMLDivElement>>;
50
+
51
+ interface AreaDef {
52
+ dataKey: string;
53
+ label?: string;
54
+ }
55
+ interface AreaChartProps {
56
+ data: Record<string, unknown>[];
57
+ areas: AreaDef[];
58
+ xAxisKey: string;
59
+ height?: "sm" | "md" | "lg" | number;
60
+ stacked?: boolean;
61
+ curved?: boolean;
62
+ showGrid?: boolean;
63
+ showTooltip?: boolean;
64
+ showLegend?: boolean;
65
+ gradient?: boolean;
66
+ xAxisLabel?: string;
67
+ yAxisLabel?: string;
68
+ animated?: boolean;
69
+ "aria-label"?: string;
70
+ className?: string;
71
+ }
72
+ declare const AreaChart: react.ForwardRefExoticComponent<AreaChartProps & react.RefAttributes<HTMLDivElement>>;
73
+
74
+ interface PieChartProps {
75
+ data: {
76
+ name: string;
77
+ value: number;
78
+ [key: string]: unknown;
79
+ }[];
80
+ height?: "sm" | "md" | "lg" | number;
81
+ donut?: boolean;
82
+ showTooltip?: boolean;
83
+ showLegend?: boolean;
84
+ showLabels?: boolean;
85
+ animated?: boolean;
86
+ "aria-label"?: string;
87
+ className?: string;
88
+ }
89
+ declare const PieChart: react.ForwardRefExoticComponent<PieChartProps & react.RefAttributes<HTMLDivElement>>;
90
+
91
+ interface CompositeChartProps {
92
+ data: Record<string, unknown>[];
93
+ bars: BarDef[];
94
+ lines: LineDef[];
95
+ xAxisKey: string;
96
+ height?: "sm" | "md" | "lg" | number;
97
+ dualAxis?: boolean;
98
+ showGrid?: boolean;
99
+ showTooltip?: boolean;
100
+ showLegend?: boolean;
101
+ xAxisLabel?: string;
102
+ yAxisLabel?: string;
103
+ animated?: boolean;
104
+ "aria-label"?: string;
105
+ className?: string;
106
+ }
107
+ declare const CompositeChart: react.ForwardRefExoticComponent<CompositeChartProps & react.RefAttributes<HTMLDivElement>>;
108
+
109
+ interface ScatterSeries {
110
+ name: string;
111
+ points: {
112
+ x: number;
113
+ y: number;
114
+ z?: number;
115
+ }[];
116
+ }
117
+ interface ScatterChartProps {
118
+ data: ScatterSeries[];
119
+ xLabel?: string;
120
+ yLabel?: string;
121
+ height?: "sm" | "md" | "lg" | number;
122
+ showGrid?: boolean;
123
+ showTooltip?: boolean;
124
+ showLegend?: boolean;
125
+ animated?: boolean;
126
+ "aria-label"?: string;
127
+ className?: string;
128
+ }
129
+ declare const ScatterChart: react.ForwardRefExoticComponent<ScatterChartProps & react.RefAttributes<HTMLDivElement>>;
130
+
131
+ interface RadarDataKey {
132
+ key: string;
133
+ label?: string;
134
+ }
135
+ interface RadarChartProps {
136
+ data: Record<string, unknown>[];
137
+ dataKeys: RadarDataKey[];
138
+ axisKey: string;
139
+ height?: "sm" | "md" | "lg" | number;
140
+ filled?: boolean;
141
+ showDots?: boolean;
142
+ showTooltip?: boolean;
143
+ showLegend?: boolean;
144
+ animated?: boolean;
145
+ "aria-label"?: string;
146
+ className?: string;
147
+ }
148
+ declare const RadarChart: react.ForwardRefExoticComponent<RadarChartProps & react.RefAttributes<HTMLDivElement>>;
149
+
150
+ interface RadialBarChartProps {
151
+ data: {
152
+ name: string;
153
+ value: number;
154
+ max?: number;
155
+ [key: string]: unknown;
156
+ }[];
157
+ height?: "sm" | "md" | "lg" | number;
158
+ showTooltip?: boolean;
159
+ showLegend?: boolean;
160
+ showLabels?: boolean;
161
+ startAngle?: number;
162
+ endAngle?: number;
163
+ animated?: boolean;
164
+ "aria-label"?: string;
165
+ className?: string;
166
+ }
167
+ declare const RadialBarChart: react.ForwardRefExoticComponent<RadialBarChartProps & react.RefAttributes<HTMLDivElement>>;
168
+
169
+ interface FunnelChartProps {
170
+ data: {
171
+ name: string;
172
+ value: number;
173
+ [key: string]: unknown;
174
+ }[];
175
+ height?: "sm" | "md" | "lg" | number;
176
+ showTooltip?: boolean;
177
+ showLegend?: boolean;
178
+ showLabels?: boolean;
179
+ animated?: boolean;
180
+ "aria-label"?: string;
181
+ className?: string;
182
+ }
183
+ declare const FunnelChart: react.ForwardRefExoticComponent<FunnelChartProps & react.RefAttributes<HTMLDivElement>>;
184
+
185
+ interface TreemapNode {
186
+ name: string;
187
+ value?: number;
188
+ children?: TreemapNode[];
189
+ [key: string]: unknown;
190
+ }
191
+ interface TreemapChartProps {
192
+ data: TreemapNode[];
193
+ height?: "sm" | "md" | "lg" | number;
194
+ showTooltip?: boolean;
195
+ animated?: boolean;
196
+ "aria-label"?: string;
197
+ className?: string;
198
+ }
199
+ declare const TreemapChart: react.ForwardRefExoticComponent<TreemapChartProps & react.RefAttributes<HTMLDivElement>>;
200
+
201
+ interface SankeyChartProps {
202
+ data: {
203
+ nodes: {
204
+ name: string;
205
+ }[];
206
+ links: {
207
+ source: number;
208
+ target: number;
209
+ value: number;
210
+ }[];
211
+ };
212
+ height?: "sm" | "md" | "lg" | number;
213
+ showTooltip?: boolean;
214
+ animated?: boolean;
215
+ "aria-label"?: string;
216
+ className?: string;
217
+ }
218
+ declare const SankeyChart: react.ForwardRefExoticComponent<SankeyChartProps & react.RefAttributes<HTMLDivElement>>;
219
+
220
+ interface SparklineProps {
221
+ data: number[];
222
+ variant?: "line" | "area" | "bar";
223
+ color?: 1 | 2 | 3 | 4 | 5 | 6;
224
+ height?: number;
225
+ width?: number | "100%";
226
+ showTooltip?: boolean;
227
+ curved?: boolean;
228
+ animated?: boolean;
229
+ "aria-label"?: string;
230
+ className?: string;
231
+ }
232
+ declare const Sparkline: react.ForwardRefExoticComponent<SparklineProps & react.RefAttributes<HTMLDivElement>>;
233
+
234
+ interface ChartContainerProps {
235
+ height?: "sm" | "md" | "lg";
236
+ title?: string;
237
+ loading?: boolean;
238
+ emptyState?: ReactNode;
239
+ children: ReactNode;
240
+ className?: string;
241
+ }
242
+ declare function ChartContainer({ height, title, loading, emptyState, children, className, }: ChartContainerProps): react_jsx_runtime.JSX.Element;
243
+
244
+ declare function useChartColors(count: number, soft?: boolean): string[];
245
+
246
+ export { AreaChart, type AreaChartProps, type AreaDef, BarChart, type BarChartProps, type BarDef, ChartContainer, CompositeChart, type CompositeChartProps, FunnelChart, type FunnelChartProps, LineChart, type LineChartProps, type LineDef, PieChart, type PieChartProps, RadarChart, type RadarChartProps, type RadarDataKey, RadialBarChart, type RadialBarChartProps, SankeyChart, type SankeyChartProps, ScatterChart, type ScatterChartProps, type ScatterSeries, Sparkline, type SparklineProps, TreemapChart, type TreemapChartProps, type TreemapNode, useChartColors };