@dinachi/cli 1.1.0 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +55 -0
- package/dist/index.js +244 -72
- package/package.json +5 -1
- package/templates/agent/agent.tsx +35 -18
- package/templates/alert/alert.tsx +345 -0
- package/templates/alert/index.ts +16 -0
- package/templates/ask-bar/ask-bar.tsx +1061 -0
- package/templates/ask-bar/index.ts +1 -0
- package/templates/autocomplete/autocomplete.tsx +0 -1
- package/templates/breadcrumb/breadcrumb.tsx +606 -0
- package/templates/breadcrumb/index.ts +9 -0
- package/templates/calendar/calendar.tsx +1155 -0
- package/templates/calendar/index.ts +15 -0
- package/templates/combobox/combobox.tsx +0 -1
- package/templates/command-items/command-items.tsx +69 -0
- package/templates/command-items/index.ts +1 -0
- package/templates/command-palette/command-palette.tsx +954 -0
- package/templates/command-palette/index.ts +1 -0
- package/templates/comparison-table/comparison-table.tsx +540 -0
- package/templates/comparison-table/index.ts +15 -0
- package/templates/data-table/data-table.tsx +2077 -0
- package/templates/data-table/index.ts +14 -0
- package/templates/date-picker/date-picker.tsx +527 -0
- package/templates/date-picker/index.ts +2 -0
- package/templates/date-range-picker/date-range-picker.tsx +504 -0
- package/templates/date-range-picker/index.ts +2 -0
- package/templates/detail-list/detail-list.tsx +419 -0
- package/templates/detail-list/index.ts +12 -0
- package/templates/heat-table/heat-table.tsx +613 -0
- package/templates/heat-table/index.ts +9 -0
- package/templates/menu/menu.tsx +8 -3
- package/templates/month-picker/index.ts +1 -0
- package/templates/month-picker/month-picker.tsx +351 -0
- package/templates/omnibar/index.ts +1 -0
- package/templates/omnibar/omnibar.tsx +1009 -0
- package/templates/pagination/index.ts +8 -0
- package/templates/pagination/pagination.tsx +389 -0
- package/templates/table/index.ts +13 -0
- package/templates/table/table.tsx +265 -0
- package/templates/time-slots/index.ts +1 -0
- package/templates/time-slots/time-slots.tsx +589 -0
- package/templates/week-strip/index.ts +1 -0
- package/templates/week-strip/week-strip.tsx +329 -0
- package/templates/year-view/index.ts +1 -0
- package/templates/year-view/year-view.tsx +362 -0
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,61 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [1.3.0] - 2026-11-21
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
|
|
14
|
+
- Five navigation and feedback components, each registered with the agent
|
|
15
|
+
bridge:
|
|
16
|
+
- **Alert**: an inline message with variants, an action and dismiss.
|
|
17
|
+
- **Breadcrumb**: a trail that folds what does not fit, measured, and opens
|
|
18
|
+
a sheet on phones.
|
|
19
|
+
- **Command Palette**: Cmd+K search over pages, actions and records, with
|
|
20
|
+
sub-lists.
|
|
21
|
+
- **Omnibar**: a header search that grows into scoped results.
|
|
22
|
+
- **Ask Bar**: a docked bar that turns a request into a plan to review.
|
|
23
|
+
- **Agent**: registered components carry a hint, so an agent reading the
|
|
24
|
+
snapshot knows what each control takes before it acts.
|
|
25
|
+
- Six table components:
|
|
26
|
+
- **Table**: styled native table parts, with numeric columns, density,
|
|
27
|
+
dividers and a stacked layout for phones.
|
|
28
|
+
- **Pagination**: previous, next and seven fixed page slots, with gaps that
|
|
29
|
+
open a go-to-page field and a compact "Page 6 of 25" form. Registers with
|
|
30
|
+
the agent bridge.
|
|
31
|
+
- **Data Table**: TanStack Table with sorting, search, status filters,
|
|
32
|
+
selection across pages, column visibility, resizing, reordering and
|
|
33
|
+
pinning, loading, empty and error states, expandable rows, row actions,
|
|
34
|
+
a keyboard grid, server mode, virtualization and its own phone layout.
|
|
35
|
+
Registers with the agent bridge. It is the only component that installs
|
|
36
|
+
`@tanstack/react-table` and `@tanstack/react-virtual`.
|
|
37
|
+
- **Comparison Table**: plans against grouped features, with billing and an
|
|
38
|
+
"Only differences" switch. Registers with the agent bridge.
|
|
39
|
+
- **Heat Table**: values shaded by size, as a keyboard grid, with squares
|
|
40
|
+
and a readout on phones.
|
|
41
|
+
- **Detail List**: labelled values with copy and inline edit per row.
|
|
42
|
+
Registers with the agent bridge.
|
|
43
|
+
|
|
44
|
+
### Changed
|
|
45
|
+
|
|
46
|
+
- **Menu**: `MenuContent` takes `side`, `align`, `sideOffset` and
|
|
47
|
+
`alignOffset`.
|
|
48
|
+
- **Theme**: the light `--info` is darker, so it passes contrast as text.
|
|
49
|
+
|
|
50
|
+
## [1.2.0] - 2026-11-17
|
|
51
|
+
|
|
52
|
+
### Added
|
|
53
|
+
|
|
54
|
+
- Seven date and time components, each registered with the agent bridge:
|
|
55
|
+
- **Calendar**: a month grid for one day, several days or a range, with months
|
|
56
|
+
that scroll as one column or page side by side.
|
|
57
|
+
- **Date Picker** and **Date Range Picker**: a field that opens the calendar in
|
|
58
|
+
a popover, or a drawer on narrow screens.
|
|
59
|
+
- **Month Picker**: twelve months a year, for one month or a span.
|
|
60
|
+
- **Week Strip**: a scrolling row of days with counts.
|
|
61
|
+
- **Year View**: a year of daily counts, as weeks or stacked months.
|
|
62
|
+
- **Time Slots**: a day as a track to drag a booking across, around busy and
|
|
63
|
+
past time, with rows on phones.
|
|
64
|
+
|
|
10
65
|
## [1.1.0] - 2026-11-17
|
|
11
66
|
|
|
12
67
|
### Added
|
package/dist/index.js
CHANGED
|
@@ -85,6 +85,14 @@ function getComponentRegistry() {
|
|
|
85
85
|
files: [{ name: "agent.tsx" }, { name: "index.ts" }],
|
|
86
86
|
dependencies: []
|
|
87
87
|
},
|
|
88
|
+
alert: {
|
|
89
|
+
name: "alert",
|
|
90
|
+
description: "An inline message that stays on the page, with an optional action and dismiss.",
|
|
91
|
+
files: [{ name: "alert.tsx" }, { name: "index.ts" }],
|
|
92
|
+
dependencies: ["class-variance-authority", "lucide-react"],
|
|
93
|
+
componentDependencies: ["agent", "button"],
|
|
94
|
+
utilityDependencies: ["cn"]
|
|
95
|
+
},
|
|
88
96
|
"alert-dialog": {
|
|
89
97
|
name: "alert-dialog",
|
|
90
98
|
description: "A modal dialog that interrupts the user with important content and expects a response.",
|
|
@@ -93,6 +101,14 @@ function getComponentRegistry() {
|
|
|
93
101
|
componentDependencies: ["agent"],
|
|
94
102
|
utilityDependencies: ["cn"]
|
|
95
103
|
},
|
|
104
|
+
"ask-bar": {
|
|
105
|
+
name: "ask-bar",
|
|
106
|
+
description: "A bar docked at the bottom of the page that turns a request into a plan, read back as one editable sentence and run on a press.",
|
|
107
|
+
files: [{ name: "ask-bar.tsx" }, { name: "index.ts" }],
|
|
108
|
+
dependencies: ["@base-ui/react", "lucide-react"],
|
|
109
|
+
componentDependencies: ["agent", "command-items"],
|
|
110
|
+
utilityDependencies: ["cn"]
|
|
111
|
+
},
|
|
96
112
|
autocomplete: {
|
|
97
113
|
name: "autocomplete",
|
|
98
114
|
description: "A text input with dynamic suggestions that helps users find and select values quickly.",
|
|
@@ -115,6 +131,14 @@ function getComponentRegistry() {
|
|
|
115
131
|
dependencies: ["class-variance-authority"],
|
|
116
132
|
utilityDependencies: ["cn"]
|
|
117
133
|
},
|
|
134
|
+
breadcrumb: {
|
|
135
|
+
name: "breadcrumb",
|
|
136
|
+
description: "A trail of links to the current page that folds its middle into a menu, and a back link with the trail in a sheet on phones.",
|
|
137
|
+
files: [{ name: "breadcrumb.tsx" }, { name: "index.ts" }],
|
|
138
|
+
dependencies: ["@base-ui/react", "lucide-react"],
|
|
139
|
+
componentDependencies: ["agent", "drawer", "link", "menu"],
|
|
140
|
+
utilityDependencies: ["cn"]
|
|
141
|
+
},
|
|
118
142
|
button: {
|
|
119
143
|
name: "button",
|
|
120
144
|
description: "A customizable button component with multiple variants.",
|
|
@@ -161,6 +185,28 @@ function getComponentRegistry() {
|
|
|
161
185
|
componentDependencies: ["agent"],
|
|
162
186
|
utilityDependencies: ["cn"]
|
|
163
187
|
},
|
|
188
|
+
"command-items": {
|
|
189
|
+
name: "command-items",
|
|
190
|
+
description: "The item, action and filter types a command palette, omnibar or assistant list share.",
|
|
191
|
+
files: [{ name: "command-items.tsx" }, { name: "index.ts" }],
|
|
192
|
+
dependencies: []
|
|
193
|
+
},
|
|
194
|
+
"command-palette": {
|
|
195
|
+
name: "command-palette",
|
|
196
|
+
description: "A Cmd+K search over pages, actions and records, with groups, recents, a preview pane and sub-lists.",
|
|
197
|
+
files: [{ name: "command-palette.tsx" }, { name: "index.ts" }],
|
|
198
|
+
dependencies: ["@base-ui/react", "lucide-react"],
|
|
199
|
+
componentDependencies: ["agent", "command-items"],
|
|
200
|
+
utilityDependencies: ["cn"]
|
|
201
|
+
},
|
|
202
|
+
"comparison-table": {
|
|
203
|
+
name: "comparison-table",
|
|
204
|
+
description: "Plans as columns and features as rows, with a sticky plan row, billing period and only-differences filter.",
|
|
205
|
+
files: [{ name: "comparison-table.tsx" }, { name: "index.ts" }],
|
|
206
|
+
dependencies: ["@base-ui/react", "lucide-react"],
|
|
207
|
+
componentDependencies: ["agent", "button", "select", "switch", "table"],
|
|
208
|
+
utilityDependencies: ["cn"]
|
|
209
|
+
},
|
|
164
210
|
"context-menu": {
|
|
165
211
|
name: "context-menu",
|
|
166
212
|
description: "A menu that appears at the pointer on right click or long press.",
|
|
@@ -169,6 +215,22 @@ function getComponentRegistry() {
|
|
|
169
215
|
componentDependencies: ["agent"],
|
|
170
216
|
utilityDependencies: ["cn"]
|
|
171
217
|
},
|
|
218
|
+
"data-table": {
|
|
219
|
+
name: "data-table",
|
|
220
|
+
description: "A sortable, filterable, selectable table on TanStack Table, with its own phone layout.",
|
|
221
|
+
files: [{ name: "data-table.tsx" }, { name: "index.ts" }],
|
|
222
|
+
dependencies: ["@tanstack/react-table", "@tanstack/react-virtual", "lucide-react"],
|
|
223
|
+
componentDependencies: ["agent", "button", "checkbox", "drawer", "input", "menu", "pagination", "select", "skeleton", "table", "toggle-group"],
|
|
224
|
+
utilityDependencies: ["cn"]
|
|
225
|
+
},
|
|
226
|
+
"detail-list": {
|
|
227
|
+
name: "detail-list",
|
|
228
|
+
description: "Labelled values in a dl, with copy and inline edit per row.",
|
|
229
|
+
files: [{ name: "detail-list.tsx" }, { name: "index.ts" }],
|
|
230
|
+
dependencies: ["lucide-react"],
|
|
231
|
+
componentDependencies: ["agent", "button"],
|
|
232
|
+
utilityDependencies: ["cn"]
|
|
233
|
+
},
|
|
172
234
|
dialog: {
|
|
173
235
|
name: "dialog",
|
|
174
236
|
description: "A popup that opens on top of the entire page, providing a modal interface for user interactions.",
|
|
@@ -206,6 +268,14 @@ function getComponentRegistry() {
|
|
|
206
268
|
dependencies: ["@base-ui/react"],
|
|
207
269
|
utilityDependencies: ["cn"]
|
|
208
270
|
},
|
|
271
|
+
"heat-table": {
|
|
272
|
+
name: "heat-table",
|
|
273
|
+
description: "A grid of values shaded by size, with the row and column lit for the cell in focus.",
|
|
274
|
+
files: [{ name: "heat-table.tsx" }, { name: "index.ts" }],
|
|
275
|
+
dependencies: ["@tanstack/react-virtual"],
|
|
276
|
+
componentDependencies: ["table"],
|
|
277
|
+
utilityDependencies: ["cn"]
|
|
278
|
+
},
|
|
209
279
|
input: {
|
|
210
280
|
name: "input",
|
|
211
281
|
description: "A customizable input field component with variants and sizes.",
|
|
@@ -267,6 +337,14 @@ function getComponentRegistry() {
|
|
|
267
337
|
componentDependencies: ["agent"],
|
|
268
338
|
utilityDependencies: ["cn"]
|
|
269
339
|
},
|
|
340
|
+
"omnibar": {
|
|
341
|
+
name: "omnibar",
|
|
342
|
+
description: "A header search field that grows into scoped results with inline actions, and a full-screen search on a phone.",
|
|
343
|
+
files: [{ name: "omnibar.tsx" }, { name: "index.ts" }],
|
|
344
|
+
dependencies: ["@base-ui/react", "lucide-react"],
|
|
345
|
+
componentDependencies: ["agent", "command-items", "drawer"],
|
|
346
|
+
utilityDependencies: ["cn"]
|
|
347
|
+
},
|
|
270
348
|
"otp-field": {
|
|
271
349
|
name: "otp-field",
|
|
272
350
|
description: "A one-time password / verification code input with auto-focus, paste handling, and validation.",
|
|
@@ -275,6 +353,14 @@ function getComponentRegistry() {
|
|
|
275
353
|
componentDependencies: ["agent"],
|
|
276
354
|
utilityDependencies: ["cn"]
|
|
277
355
|
},
|
|
356
|
+
pagination: {
|
|
357
|
+
name: "pagination",
|
|
358
|
+
description: "Pages of a list, in seven fixed slots, with gaps that open a go-to-page field.",
|
|
359
|
+
files: [{ name: "pagination.tsx" }, { name: "index.ts" }],
|
|
360
|
+
dependencies: ["lucide-react"],
|
|
361
|
+
componentDependencies: ["agent", "button"],
|
|
362
|
+
utilityDependencies: ["cn"]
|
|
363
|
+
},
|
|
278
364
|
popover: {
|
|
279
365
|
name: "popover",
|
|
280
366
|
description: "An anchored floating panel for contextual information and lightweight interactions.",
|
|
@@ -335,6 +421,62 @@ function getComponentRegistry() {
|
|
|
335
421
|
dependencies: [],
|
|
336
422
|
utilityDependencies: ["cn"]
|
|
337
423
|
},
|
|
424
|
+
calendar: {
|
|
425
|
+
name: "calendar",
|
|
426
|
+
description: "A month grid for picking a day, several days or a range, scrolled or paged.",
|
|
427
|
+
files: [{ name: "calendar.tsx" }, { name: "index.ts" }],
|
|
428
|
+
dependencies: ["@base-ui/react", "react-day-picker", "date-fns", "lucide-react"],
|
|
429
|
+
componentDependencies: ["agent"],
|
|
430
|
+
utilityDependencies: ["cn"]
|
|
431
|
+
},
|
|
432
|
+
"date-picker": {
|
|
433
|
+
name: "date-picker",
|
|
434
|
+
description: "A date field that reads what you type, with a calendar in a popover or a phone drawer.",
|
|
435
|
+
files: [{ name: "date-picker.tsx" }, { name: "index.ts" }],
|
|
436
|
+
dependencies: ["@base-ui/react", "date-fns", "lucide-react"],
|
|
437
|
+
componentDependencies: ["agent", "button", "calendar", "drawer", "popover"],
|
|
438
|
+
utilityDependencies: ["cn"]
|
|
439
|
+
},
|
|
440
|
+
"date-range-picker": {
|
|
441
|
+
name: "date-range-picker",
|
|
442
|
+
description: "A trigger naming a range, opening presets beside a calendar, applied on Apply.",
|
|
443
|
+
files: [{ name: "date-range-picker.tsx" }, { name: "index.ts" }],
|
|
444
|
+
dependencies: ["date-fns", "lucide-react"],
|
|
445
|
+
componentDependencies: ["agent", "button", "calendar", "drawer", "popover"],
|
|
446
|
+
utilityDependencies: ["cn"]
|
|
447
|
+
},
|
|
448
|
+
"month-picker": {
|
|
449
|
+
name: "month-picker",
|
|
450
|
+
description: "Twelve months a year at a time, for a billing month or a span of months.",
|
|
451
|
+
files: [{ name: "month-picker.tsx" }, { name: "index.ts" }],
|
|
452
|
+
dependencies: ["date-fns", "lucide-react"],
|
|
453
|
+
componentDependencies: ["agent", "calendar"],
|
|
454
|
+
utilityDependencies: ["cn"]
|
|
455
|
+
},
|
|
456
|
+
"time-slots": {
|
|
457
|
+
name: "time-slots",
|
|
458
|
+
description: "A day as a track to drag a booking across, held off busy and past time.",
|
|
459
|
+
files: [{ name: "time-slots.tsx" }, { name: "index.ts" }],
|
|
460
|
+
dependencies: ["date-fns"],
|
|
461
|
+
componentDependencies: ["agent"],
|
|
462
|
+
utilityDependencies: ["cn"]
|
|
463
|
+
},
|
|
464
|
+
"week-strip": {
|
|
465
|
+
name: "week-strip",
|
|
466
|
+
description: "Days in a row that snap a week at a time, with a dot for each booking.",
|
|
467
|
+
files: [{ name: "week-strip.tsx" }, { name: "index.ts" }],
|
|
468
|
+
dependencies: ["date-fns", "lucide-react"],
|
|
469
|
+
componentDependencies: ["agent", "calendar"],
|
|
470
|
+
utilityDependencies: ["cn"]
|
|
471
|
+
},
|
|
472
|
+
"year-view": {
|
|
473
|
+
name: "year-view",
|
|
474
|
+
description: "A year of days shaded by count, that turns a day into a filter.",
|
|
475
|
+
files: [{ name: "year-view.tsx" }, { name: "index.ts" }],
|
|
476
|
+
dependencies: ["date-fns"],
|
|
477
|
+
componentDependencies: ["agent", "calendar"],
|
|
478
|
+
utilityDependencies: ["cn"]
|
|
479
|
+
},
|
|
338
480
|
slider: {
|
|
339
481
|
name: "slider",
|
|
340
482
|
description: "An input where the user selects a value from within a given range.",
|
|
@@ -351,6 +493,13 @@ function getComponentRegistry() {
|
|
|
351
493
|
componentDependencies: ["agent"],
|
|
352
494
|
utilityDependencies: ["cn"]
|
|
353
495
|
},
|
|
496
|
+
table: {
|
|
497
|
+
name: "table",
|
|
498
|
+
description: "Styled native table parts, with numeric columns and a stacked phone layout.",
|
|
499
|
+
files: [{ name: "table.tsx" }, { name: "index.ts" }],
|
|
500
|
+
dependencies: [],
|
|
501
|
+
utilityDependencies: ["cn"]
|
|
502
|
+
},
|
|
354
503
|
tabs: {
|
|
355
504
|
name: "tabs",
|
|
356
505
|
description: "A component for toggling between related panels on the same page.",
|
|
@@ -642,25 +791,35 @@ var LOCK_FILE_MAP = [
|
|
|
642
791
|
{ file: "yarn.lock", manager: "yarn" },
|
|
643
792
|
{ file: "package-lock.json", manager: "npm" }
|
|
644
793
|
];
|
|
645
|
-
function
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
794
|
+
function fromPackageManagerField(dir) {
|
|
795
|
+
const packageJsonPath = path2.join(dir, "package.json");
|
|
796
|
+
if (!fs2.existsSync(packageJsonPath)) return null;
|
|
797
|
+
try {
|
|
798
|
+
const value = JSON.parse(fs2.readFileSync(packageJsonPath, "utf-8")).packageManager ?? "";
|
|
799
|
+
for (const pm of ["pnpm", "yarn", "bun", "npm"]) if (value.startsWith(`${pm}@`)) return pm;
|
|
800
|
+
} catch {
|
|
650
801
|
}
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
802
|
+
return null;
|
|
803
|
+
}
|
|
804
|
+
function fromUserAgent() {
|
|
805
|
+
const agent = process.env.npm_config_user_agent ?? "";
|
|
806
|
+
for (const pm of ["pnpm", "yarn", "bun"]) if (agent.startsWith(`${pm}/`)) return pm;
|
|
807
|
+
return null;
|
|
808
|
+
}
|
|
809
|
+
function detectPackageManager(startDir = process.cwd()) {
|
|
810
|
+
let dir = path2.resolve(startDir);
|
|
811
|
+
while (true) {
|
|
812
|
+
for (const entry of LOCK_FILE_MAP) {
|
|
813
|
+
if (fs2.existsSync(path2.join(dir, entry.file))) return entry.manager;
|
|
661
814
|
}
|
|
662
|
-
|
|
663
|
-
|
|
815
|
+
if (fs2.existsSync(path2.join(dir, "pnpm-workspace.yaml"))) return "pnpm";
|
|
816
|
+
const field = fromPackageManagerField(dir);
|
|
817
|
+
if (field) return field;
|
|
818
|
+
const parent = path2.dirname(dir);
|
|
819
|
+
if (parent === dir) break;
|
|
820
|
+
dir = parent;
|
|
821
|
+
}
|
|
822
|
+
return fromUserAgent() ?? "npm";
|
|
664
823
|
}
|
|
665
824
|
function getInstallCommand(pm, deps) {
|
|
666
825
|
const depsStr = deps.join(" ");
|
|
@@ -745,7 +904,11 @@ var DEPENDENCY_VERSION_MAP = {
|
|
|
745
904
|
"tailwind-merge": "^3.5.0",
|
|
746
905
|
"@json-render/core": "^0.14.0",
|
|
747
906
|
"@json-render/react": "^0.14.0",
|
|
748
|
-
"zod": "^4.3.6"
|
|
907
|
+
"zod": "^4.3.6",
|
|
908
|
+
"react-day-picker": "^9.14.0",
|
|
909
|
+
"date-fns": "^4.4.0",
|
|
910
|
+
"@tanstack/react-table": "^8.21.3",
|
|
911
|
+
"@tanstack/react-virtual": "^3.14.26"
|
|
749
912
|
};
|
|
750
913
|
function toInstallSpec(dep) {
|
|
751
914
|
const version = DEPENDENCY_VERSION_MAP[dep];
|
|
@@ -1238,6 +1401,12 @@ var addCommand = new Command("add").description("Add a component to your project
|
|
|
1238
1401
|
continue;
|
|
1239
1402
|
}
|
|
1240
1403
|
if (fs3.existsSync(targetPath) && !options.overwrite) {
|
|
1404
|
+
if (options.yes) {
|
|
1405
|
+
spinner.stop();
|
|
1406
|
+
console.log(` ${chalk.yellow("\u2298")} Kept existing ${file.name} (pass --overwrite to replace it)`);
|
|
1407
|
+
spinner.start();
|
|
1408
|
+
continue;
|
|
1409
|
+
}
|
|
1241
1410
|
spinner.stop();
|
|
1242
1411
|
const { overwrite } = await prompts({
|
|
1243
1412
|
type: "confirm",
|
|
@@ -1425,33 +1594,34 @@ function extractPreservedThemeVars(css) {
|
|
|
1425
1594
|
return line.startsWith("--") && !DINACHI_THEME_PREFIXES.some((p) => line.startsWith(p));
|
|
1426
1595
|
});
|
|
1427
1596
|
}
|
|
1597
|
+
var DARK_VARIANT = "@custom-variant dark (&:where(.dark, .dark *));";
|
|
1428
1598
|
function getThemeCSS(tailwindMajor, mode, preservedThemeVars = []) {
|
|
1429
1599
|
const lightVars = `:root {
|
|
1430
|
-
--background: oklch(0.986 0
|
|
1431
|
-
--foreground: oklch(0.1459 0
|
|
1432
|
-
--card: oklch(0.9781 0
|
|
1433
|
-
--card-foreground: oklch(0.1459 0
|
|
1600
|
+
--background: oklch(0.986 0 0);
|
|
1601
|
+
--foreground: oklch(0.1459 0 0);
|
|
1602
|
+
--card: oklch(0.9781 0 0);
|
|
1603
|
+
--card-foreground: oklch(0.1459 0 0);
|
|
1434
1604
|
--popover: oklch(1 0 0);
|
|
1435
|
-
--popover-foreground: oklch(0.1324 0
|
|
1436
|
-
--primary: oklch(0.1324 0
|
|
1437
|
-
--primary-foreground: oklch(0.9729 0
|
|
1438
|
-
--secondary: oklch(0.9248 0
|
|
1439
|
-
--secondary-foreground: oklch(0.1324 0
|
|
1440
|
-
--muted: oklch(0.9631 0
|
|
1441
|
-
--muted-foreground: oklch(0.
|
|
1442
|
-
--accent: oklch(0.9248 0
|
|
1443
|
-
--accent-foreground: oklch(0.1459 0
|
|
1605
|
+
--popover-foreground: oklch(0.1324 0 0);
|
|
1606
|
+
--primary: oklch(0.1324 0 0);
|
|
1607
|
+
--primary-foreground: oklch(0.9729 0 0);
|
|
1608
|
+
--secondary: oklch(0.9248 0 0);
|
|
1609
|
+
--secondary-foreground: oklch(0.1324 0 0);
|
|
1610
|
+
--muted: oklch(0.9631 0 0);
|
|
1611
|
+
--muted-foreground: oklch(0.5 0 0);
|
|
1612
|
+
--accent: oklch(0.9248 0 0);
|
|
1613
|
+
--accent-foreground: oklch(0.1459 0 0);
|
|
1444
1614
|
--destructive: oklch(0.5248 0.1368 20.8317);
|
|
1445
1615
|
--destructive-foreground: oklch(1 0 0);
|
|
1446
1616
|
--success: oklch(0.5882 0.1655 145.39);
|
|
1447
1617
|
--success-foreground: oklch(1 0 0);
|
|
1448
1618
|
--warning: oklch(0.6365 0.1639 55.49);
|
|
1449
1619
|
--warning-foreground: oklch(1 0 0);
|
|
1450
|
-
--info: oklch(0.
|
|
1620
|
+
--info: oklch(0.546 0.214 259.815);
|
|
1451
1621
|
--info-foreground: oklch(1 0 0);
|
|
1452
|
-
--border: oklch(0.9239 0
|
|
1453
|
-
--input: oklch(0.8481 0
|
|
1454
|
-
--ring: oklch(0.1459 0
|
|
1622
|
+
--border: oklch(0.9239 0 0);
|
|
1623
|
+
--input: oklch(0.8481 0 0);
|
|
1624
|
+
--ring: oklch(0.1459 0 0);
|
|
1455
1625
|
--chart-1: oklch(0.6038 0.2363 344.4657);
|
|
1456
1626
|
--chart-2: oklch(0.4445 0.2251 300.6246);
|
|
1457
1627
|
--chart-3: oklch(0.379 0.0438 226.1538);
|
|
@@ -1460,14 +1630,14 @@ function getThemeCSS(tailwindMajor, mode, preservedThemeVars = []) {
|
|
|
1460
1630
|
/* A panel surface, distinct from the page. The docs site points --sidebar at
|
|
1461
1631
|
--background instead, because its nav is part of the page rather than docked beside
|
|
1462
1632
|
it \u2014 that is a choice about that layout, not a value this theme is drifting from. */
|
|
1463
|
-
--sidebar: oklch(0.972 0
|
|
1464
|
-
--sidebar-foreground: oklch(0.2284 0
|
|
1465
|
-
--sidebar-primary: oklch(0.1324 0
|
|
1466
|
-
--sidebar-primary-foreground: oklch(0.9742 0
|
|
1467
|
-
--sidebar-accent: oklch(0.9248 0
|
|
1468
|
-
--sidebar-accent-foreground: oklch(0.1459 0
|
|
1469
|
-
--sidebar-border: oklch(0.9407 0
|
|
1470
|
-
--sidebar-ring: oklch(0.5916 0
|
|
1633
|
+
--sidebar: oklch(0.972 0 0);
|
|
1634
|
+
--sidebar-foreground: oklch(0.2284 0 0);
|
|
1635
|
+
--sidebar-primary: oklch(0.1324 0 0);
|
|
1636
|
+
--sidebar-primary-foreground: oklch(0.9742 0 0);
|
|
1637
|
+
--sidebar-accent: oklch(0.9248 0 0);
|
|
1638
|
+
--sidebar-accent-foreground: oklch(0.1459 0 0);
|
|
1639
|
+
--sidebar-border: oklch(0.9407 0 0);
|
|
1640
|
+
--sidebar-ring: oklch(0.5916 0 0);
|
|
1471
1641
|
--radius: 1.05rem;
|
|
1472
1642
|
/* Every component inlines these same values as a var() fallback, so motion works
|
|
1473
1643
|
without them. Declaring them here is what lets a project retune the feel of every
|
|
@@ -1497,19 +1667,19 @@ function getThemeCSS(tailwindMajor, mode, preservedThemeVars = []) {
|
|
|
1497
1667
|
}`;
|
|
1498
1668
|
const darkVars = `.dark {
|
|
1499
1669
|
--background: oklch(0.1149 0 0);
|
|
1500
|
-
--foreground: oklch(0.7999 0
|
|
1501
|
-
--card: oklch(0.133 0
|
|
1502
|
-
--card-foreground: oklch(0.7996 0
|
|
1503
|
-
--popover: oklch(0.
|
|
1504
|
-
--popover-foreground: oklch(0.9742 0
|
|
1505
|
-
--primary: oklch(0.9729 0
|
|
1506
|
-
--primary-foreground: oklch(0.1324 0
|
|
1507
|
-
--secondary: oklch(0.1844 0
|
|
1508
|
-
--secondary-foreground: oklch(0.8009 0
|
|
1509
|
-
--muted: oklch(0.1579 0
|
|
1510
|
-
--muted-foreground: oklch(0.
|
|
1511
|
-
--accent: oklch(0.1391 0
|
|
1512
|
-
--accent-foreground: oklch(0.9742 0
|
|
1670
|
+
--foreground: oklch(0.7999 0 0);
|
|
1671
|
+
--card: oklch(0.133 0 0);
|
|
1672
|
+
--card-foreground: oklch(0.7996 0 0);
|
|
1673
|
+
--popover: oklch(0.14 0 0);
|
|
1674
|
+
--popover-foreground: oklch(0.9742 0 0);
|
|
1675
|
+
--primary: oklch(0.9729 0 0);
|
|
1676
|
+
--primary-foreground: oklch(0.1324 0 0);
|
|
1677
|
+
--secondary: oklch(0.1844 0 0);
|
|
1678
|
+
--secondary-foreground: oklch(0.8009 0 0);
|
|
1679
|
+
--muted: oklch(0.1579 0 0);
|
|
1680
|
+
--muted-foreground: oklch(0.62 0 0);
|
|
1681
|
+
--accent: oklch(0.1391 0 0);
|
|
1682
|
+
--accent-foreground: oklch(0.9742 0 0);
|
|
1513
1683
|
--destructive: oklch(0.585 0.15 20.8317);
|
|
1514
1684
|
--destructive-foreground: oklch(1 0 0);
|
|
1515
1685
|
--success: oklch(0.5484 0.1497 145.39);
|
|
@@ -1517,29 +1687,30 @@ function getThemeCSS(tailwindMajor, mode, preservedThemeVars = []) {
|
|
|
1517
1687
|
--warning: oklch(0.5966 0.1499 55.49);
|
|
1518
1688
|
--warning-foreground: oklch(1 0 0);
|
|
1519
1689
|
--info: oklch(0.707 0.165 254.624);
|
|
1520
|
-
--info-foreground: oklch(0.1324 0
|
|
1521
|
-
--border: oklch(0.
|
|
1522
|
-
--input: oklch(0.2213 0
|
|
1523
|
-
--ring: oklch(0.9248 0
|
|
1690
|
+
--info-foreground: oklch(0.1324 0 0);
|
|
1691
|
+
--border: oklch(0.192 0 0);
|
|
1692
|
+
--input: oklch(0.2213 0 0);
|
|
1693
|
+
--ring: oklch(0.9248 0 0);
|
|
1524
1694
|
--chart-1: oklch(0.5316 0.1409 355.1999);
|
|
1525
1695
|
--chart-2: oklch(0.5633 0.1912 306.8561);
|
|
1526
1696
|
--chart-3: oklch(0.7227 0.1502 60.5799);
|
|
1527
1697
|
--chart-4: oklch(0.6193 0.2029 312.7422);
|
|
1528
1698
|
--chart-5: oklch(0.6118 0.2093 6.1387);
|
|
1529
|
-
--sidebar: oklch(0.1495 0
|
|
1530
|
-
--sidebar-foreground: oklch(0.8942 0
|
|
1531
|
-
--sidebar-primary: oklch(0.9729 0
|
|
1532
|
-
--sidebar-primary-foreground: oklch(0.1324 0
|
|
1533
|
-
--sidebar-accent: oklch(0.2163 0
|
|
1534
|
-
--sidebar-accent-foreground: oklch(0.9699 0
|
|
1535
|
-
--sidebar-border: oklch(0.2757 0
|
|
1536
|
-
--sidebar-ring: oklch(0.9248 0
|
|
1699
|
+
--sidebar: oklch(0.1495 0 0);
|
|
1700
|
+
--sidebar-foreground: oklch(0.8942 0 0);
|
|
1701
|
+
--sidebar-primary: oklch(0.9729 0 0);
|
|
1702
|
+
--sidebar-primary-foreground: oklch(0.1324 0 0);
|
|
1703
|
+
--sidebar-accent: oklch(0.2163 0 0);
|
|
1704
|
+
--sidebar-accent-foreground: oklch(0.9699 0 0);
|
|
1705
|
+
--sidebar-border: oklch(0.2757 0 0);
|
|
1706
|
+
--sidebar-ring: oklch(0.9248 0 0);
|
|
1537
1707
|
}`;
|
|
1538
1708
|
const parts = [];
|
|
1539
1709
|
if (tailwindMajor >= 4) {
|
|
1540
1710
|
if (mode === "full") {
|
|
1541
1711
|
parts.push('@import "tailwindcss";');
|
|
1542
1712
|
}
|
|
1713
|
+
parts.push(DARK_VARIANT);
|
|
1543
1714
|
parts.push(lightVars, darkVars);
|
|
1544
1715
|
const preservedLines = preservedThemeVars.length > 0 ? "\n" + preservedThemeVars.map((v) => ` ${v}`).join("\n") : "";
|
|
1545
1716
|
parts.push(`@theme inline {
|
|
@@ -1637,7 +1808,10 @@ async function injectThemeCSS(cssFilePath, tailwindMajor) {
|
|
|
1637
1808
|
}
|
|
1638
1809
|
const preservedVars = tailwindMajor >= 4 ? extractPreservedThemeVars(existing) : [];
|
|
1639
1810
|
const cleaned = stripConflictingCSS(existing);
|
|
1640
|
-
|
|
1811
|
+
let theme2 = getThemeCSS(tailwindMajor, "append", preservedVars);
|
|
1812
|
+
if (/@custom-variant\s+dark\b/.test(cleaned)) theme2 = theme2.replace(`${DARK_VARIANT}
|
|
1813
|
+
|
|
1814
|
+
`, "");
|
|
1641
1815
|
const result = cleaned.length > 0 ? cleaned + "\n\n" + theme2 : getThemeCSS(tailwindMajor, "full", preservedVars);
|
|
1642
1816
|
await fs4.writeFile(cssFilePath, result);
|
|
1643
1817
|
return { path: cssFilePath, updated: true };
|
|
@@ -2010,9 +2184,7 @@ var initCommand = new Command2("init").description("Initialize Dinachi UI in you
|
|
|
2010
2184
|
if (options.skipInstall) {
|
|
2011
2185
|
console.log();
|
|
2012
2186
|
console.log("Dependencies to install manually:");
|
|
2013
|
-
|
|
2014
|
-
console.log(` ${chalk2.yellow("\u2022")} ${toInstallSpec(dep)}`);
|
|
2015
|
-
});
|
|
2187
|
+
console.log(` ${chalk2.cyan(getInstallCommand(detectPackageManager(projectRoot), deps.map(toInstallSpec)))}`);
|
|
2016
2188
|
}
|
|
2017
2189
|
console.log();
|
|
2018
2190
|
console.log("\u{1F4A1} Tip: Install globally for shorter commands:");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dinachi/cli",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.0",
|
|
4
4
|
"description": "CLI for adding Dinachi UI components to your project",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"keywords": [
|
|
@@ -47,14 +47,18 @@
|
|
|
47
47
|
"@base-ui/react": "1.9.0",
|
|
48
48
|
"@json-render/core": "^0.14.0",
|
|
49
49
|
"@json-render/react": "^0.14.0",
|
|
50
|
+
"@tanstack/react-table": "^8.21.3",
|
|
51
|
+
"@tanstack/react-virtual": "^3.14.26",
|
|
50
52
|
"@types/fs-extra": "^11.0.4",
|
|
51
53
|
"@types/prompts": "^2.4.9",
|
|
52
54
|
"@types/react": "^19.2.18",
|
|
53
55
|
"class-variance-authority": "^0.7.1",
|
|
54
56
|
"clsx": "^2.1.1",
|
|
57
|
+
"date-fns": "^4.4.0",
|
|
55
58
|
"lucide-react": "0.552.0",
|
|
56
59
|
"motion": "^12.23.6",
|
|
57
60
|
"react": "19.2.8",
|
|
61
|
+
"react-day-picker": "^9.14.0",
|
|
58
62
|
"tailwind-merge": "^3.5.0",
|
|
59
63
|
"tsup": "^8.5.1",
|
|
60
64
|
"typescript": "^6.0.3",
|