@alexgorbatchev/shadcn 0.0.17 → 0.0.19

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 (88) hide show
  1. package/README.md +11 -7
  2. package/dist/{chunk-hhvp5352.js → chunk-0jb0xgdb.js} +1 -1
  3. package/dist/{chunk-yn3e9w1j.js → chunk-0q6mg89k.js} +1 -1
  4. package/dist/{chunk-jy6nfnbx.js → chunk-0zwxgwr4.js} +2 -2
  5. package/dist/{chunk-3esarnmt.js → chunk-155c0btb.js} +1 -1
  6. package/dist/{chunk-tsekdy3w.js → chunk-1tgrhacr.js} +12 -3
  7. package/dist/{chunk-7g39g3h8.js → chunk-2e4fnx0e.js} +1 -1
  8. package/dist/{chunk-0yqwq0ev.js → chunk-2qxy1r5y.js} +8 -8
  9. package/dist/{chunk-299wvwy8.js → chunk-38kwkd1a.js} +2 -2
  10. package/dist/{chunk-xvs5y4v7.js → chunk-45kmek5e.js} +1 -1
  11. package/dist/{chunk-rrd9fsz6.js → chunk-6wvtsf2m.js} +4 -4
  12. package/dist/{chunk-zhnwybhq.js → chunk-717ggspf.js} +1 -1
  13. package/dist/{chunk-5h7vkgvz.js → chunk-82cw4kcg.js} +1 -1
  14. package/dist/{chunk-1hbge1cb.js → chunk-82vfgkjv.js} +1 -1
  15. package/dist/{chunk-r9mng3ws.js → chunk-8x8yxf6x.js} +1 -1
  16. package/dist/{chunk-j5wk4ffj.js → chunk-aewjmzt9.js} +1 -1
  17. package/dist/{chunk-ets9h67e.js → chunk-akaezred.js} +2 -2
  18. package/dist/{chunk-34ndz1gf.js → chunk-c6b2cfw4.js} +1 -1
  19. package/dist/{chunk-fq8taatb.js → chunk-c900175p.js} +1 -1
  20. package/dist/{chunk-dnja1pz5.js → chunk-cre60717.js} +1 -1
  21. package/dist/{chunk-jwajmmfb.js → chunk-dppmqr99.js} +1 -1
  22. package/dist/{chunk-0xrvhezs.js → chunk-f73en61v.js} +1 -1
  23. package/dist/{chunk-5ntb7p4q.js → chunk-f8758vjx.js} +38 -18
  24. package/dist/{chunk-avrh238b.js → chunk-fyb0b7bp.js} +1 -1
  25. package/dist/{chunk-1apg76a7.js → chunk-g7v9cqyg.js} +1 -1
  26. package/dist/{chunk-22678d2t.js → chunk-h46mdagy.js} +1 -1
  27. package/dist/{chunk-dd53t01w.js → chunk-k4vvp62d.js} +1 -1
  28. package/dist/{chunk-q9qm7skj.js → chunk-k89xxj12.js} +4 -4
  29. package/dist/{chunk-a6e11wj6.js → chunk-kc4mmrwk.js} +1 -1
  30. package/dist/{chunk-3hvpcsb4.js → chunk-qw7229kj.js} +1 -1
  31. package/dist/{chunk-ha24sd50.js → chunk-r3artnc9.js} +1 -1
  32. package/dist/{chunk-wwfj7ga3.js → chunk-r4fr62ca.js} +1 -1
  33. package/dist/{chunk-erpzgt57.js → chunk-s3b87adw.js} +1 -1
  34. package/dist/chunk-v4yqjvzd.js +114 -0
  35. package/dist/{chunk-fh3nme7f.js → chunk-vpj3vk7v.js} +1 -1
  36. package/dist/{chunk-4gby2v61.js → chunk-waat2ksf.js} +1 -1
  37. package/dist/{chunk-gknaq8ep.js → chunk-wxncy44f.js} +1 -1
  38. package/dist/{chunk-jxwfkmdh.js → chunk-x82x81th.js} +3 -3
  39. package/dist/{chunk-9zyam2cn.js → chunk-z5d2zpnj.js} +1 -1
  40. package/dist/{chunk-h77yk9sn.js → chunk-zhdp6qrb.js} +1 -1
  41. package/dist/components/ButtonLink.d.ts +12 -0
  42. package/dist/components/Card.d.ts +6 -2
  43. package/dist/components/DensityProvider.d.ts +9 -4
  44. package/dist/components/assistant-ui/elements/BackgroundInbox.js +2 -2
  45. package/dist/components/assistant-ui/elements/Chart.js +2 -2
  46. package/dist/components/assistant-ui/elements/CodeDiff.js +2 -2
  47. package/dist/components/assistant-ui/elements/CommandPalette.js +3 -3
  48. package/dist/components/assistant-ui/elements/DataTable.js +2 -2
  49. package/dist/components/assistant-ui/elements/EditMessage.js +2 -2
  50. package/dist/components/assistant-ui/elements/ElicitationForm.js +2 -2
  51. package/dist/components/assistant-ui/elements/FeedbackDialog.js +2 -2
  52. package/dist/components/assistant-ui/elements/FileTree.js +2 -2
  53. package/dist/components/assistant-ui/elements/FlowGraph.js +2 -2
  54. package/dist/components/assistant-ui/elements/GenerativeUi.js +4 -4
  55. package/dist/components/assistant-ui/elements/Image.js +2 -2
  56. package/dist/components/assistant-ui/elements/ImageGallery.js +2 -2
  57. package/dist/components/assistant-ui/elements/McpServerPanel.js +2 -2
  58. package/dist/components/assistant-ui/elements/MermaidDiagram.js +3 -3
  59. package/dist/components/assistant-ui/elements/MermaidZoom.js +2 -2
  60. package/dist/components/assistant-ui/elements/ModelPicker.js +2 -2
  61. package/dist/components/assistant-ui/elements/ModelSelector.js +9 -9
  62. package/dist/components/assistant-ui/elements/ModelSelectorContent.js +8 -8
  63. package/dist/components/assistant-ui/elements/ModelSelectorEmpty.js +3 -3
  64. package/dist/components/assistant-ui/elements/ModelSelectorFocusAnchor.js +3 -3
  65. package/dist/components/assistant-ui/elements/ModelSelectorGroup.js +3 -3
  66. package/dist/components/assistant-ui/elements/ModelSelectorItem.js +3 -3
  67. package/dist/components/assistant-ui/elements/ModelSelectorList.js +5 -5
  68. package/dist/components/assistant-ui/elements/ModelSelectorSearch.js +3 -3
  69. package/dist/components/assistant-ui/elements/ModelSelectorSeparator.js +3 -3
  70. package/dist/components/assistant-ui/index.js +29 -29
  71. package/dist/components/assistant-ui/native/AssistantModal.js +6 -6
  72. package/dist/components/assistant-ui/native/AssistantSidebar.js +5 -5
  73. package/dist/components/assistant-ui/native/AttachmentPreview.js +2 -2
  74. package/dist/components/assistant-ui/native/McpConfigDialog.js +2 -2
  75. package/dist/components/assistant-ui/native/MermaidDiagram.js +4 -4
  76. package/dist/components/assistant-ui/native/ModelSelector.js +11 -11
  77. package/dist/components/assistant-ui/native/Thread.d.ts +9 -3
  78. package/dist/components/assistant-ui/native/Thread.js +4 -4
  79. package/dist/components/assistant-ui/native/ThreadList.js +1 -1
  80. package/dist/components/assistant-ui/native/ThreadListSidebar.js +3 -3
  81. package/dist/components/assistant-ui/native/index.js +23 -23
  82. package/dist/components/command/index.js +2 -2
  83. package/dist/hooks/useCardSpotlight.d.ts +7 -0
  84. package/dist/index.d.ts +1 -0
  85. package/dist/index.js +384 -342
  86. package/dist/theme.css +92 -16
  87. package/package.json +3 -3
  88. package/dist/chunk-fqekyjkh.js +0 -65
package/dist/theme.css CHANGED
@@ -32,14 +32,14 @@
32
32
  --color-frame-halo: var(--frame-halo);
33
33
  --color-backdrop: var(--backdrop);
34
34
  --color-terminal-background: var(--terminal-background);
35
- --color-sidebar: var(--sidebar);
36
- --color-sidebar-foreground: var(--sidebar-foreground);
37
- --color-sidebar-primary: var(--sidebar-primary);
38
- --color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
39
- --color-sidebar-accent: var(--sidebar-accent);
40
- --color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
41
- --color-sidebar-border: var(--sidebar-border);
42
- --color-sidebar-ring: var(--sidebar-ring);
35
+ --color-sidebar: var(--sidebar, var(--background));
36
+ --color-sidebar-foreground: var(--sidebar-foreground, var(--foreground));
37
+ --color-sidebar-primary: var(--sidebar-primary, var(--primary));
38
+ --color-sidebar-primary-foreground: var(--sidebar-primary-foreground, var(--primary-foreground));
39
+ --color-sidebar-accent: var(--sidebar-accent, var(--accent));
40
+ --color-sidebar-accent-foreground: var(--sidebar-accent-foreground, var(--accent-foreground));
41
+ --color-sidebar-border: var(--sidebar-border, var(--border));
42
+ --color-sidebar-ring: var(--sidebar-ring, var(--ring));
43
43
  --font-sans: var(--ag-font);
44
44
  --font-mono: var(--ag-font);
45
45
  --text-xs: var(--ag-text-xs);
@@ -68,14 +68,6 @@
68
68
  :root {
69
69
  --ag-font: "JetBrains Mono Variable", "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
70
70
  --radius: 4px;
71
- --sidebar: var(--background);
72
- --sidebar-foreground: var(--foreground);
73
- --sidebar-primary: var(--primary);
74
- --sidebar-primary-foreground: var(--primary-foreground);
75
- --sidebar-accent: var(--accent);
76
- --sidebar-accent-foreground: var(--accent-foreground);
77
- --sidebar-border: var(--border);
78
- --sidebar-ring: var(--ring);
79
71
  --ag-text-xs: 11px;
80
72
  --ag-control-text: 12px;
81
73
  --ag-text: 14px;
@@ -191,6 +183,8 @@
191
183
  }
192
184
 
193
185
  [data-density="comfortable"] {
186
+ --ag-text-xs: 11px;
187
+ --ag-control-text: 12px;
194
188
  --ag-text: 14px;
195
189
  --ag-heading: 18px;
196
190
  --ag-leading: 1.65;
@@ -205,6 +199,8 @@
205
199
  }
206
200
 
207
201
  [data-density="compact"] {
202
+ --ag-text-xs: 11px;
203
+ --ag-control-text: 12px;
208
204
  --ag-text: 12px;
209
205
  --ag-heading: 13px;
210
206
  --ag-leading: 1.35;
@@ -226,6 +222,44 @@
226
222
  @apply bg-background text-foreground font-sans text-base;
227
223
  }
228
224
 
225
+ @media (forced-colors: none) {
226
+ @supports selector(::-webkit-scrollbar) {
227
+ ::-webkit-scrollbar {
228
+ width: 10px;
229
+ height: 10px;
230
+ }
231
+
232
+ ::-webkit-scrollbar-track,
233
+ ::-webkit-scrollbar-corner {
234
+ background: transparent;
235
+ }
236
+
237
+ ::-webkit-scrollbar-thumb {
238
+ min-width: 24px;
239
+ min-height: 24px;
240
+ border: 2px solid transparent;
241
+ border-radius: 999px;
242
+ background: var(--input);
243
+ background-clip: padding-box;
244
+ }
245
+
246
+ ::-webkit-scrollbar-thumb:hover {
247
+ background-color: var(--muted-foreground);
248
+ }
249
+
250
+ ::-webkit-scrollbar-button {
251
+ display: none;
252
+ }
253
+ }
254
+
255
+ @supports not selector(::-webkit-scrollbar) {
256
+ * {
257
+ scrollbar-width: thin;
258
+ scrollbar-color: var(--input) transparent;
259
+ }
260
+ }
261
+ }
262
+
229
263
  @media (prefers-reduced-motion: reduce) {
230
264
  *,
231
265
  *::before,
@@ -452,3 +486,45 @@
452
486
  --scroll-fade-b: var(--_scroll-fade-size-b);
453
487
  }
454
488
  }
489
+
490
+ /* Pointer-following border highlight and surface glow. useCardSpotlight writes --card-spotlight-x/y while the
491
+ pointer is inside the card; without them both gradients sit off-screen and the frame shows the plain border. */
492
+ @utility card-spotlight {
493
+ @media (forced-colors: none) {
494
+ position: relative;
495
+ isolation: isolate;
496
+ border-color: transparent;
497
+ background-image:
498
+ linear-gradient(var(--card), var(--card)),
499
+ radial-gradient(
500
+ 240px circle at var(--card-spotlight-x, -999px) var(--card-spotlight-y, -999px),
501
+ color-mix(in oklab, var(--primary) 75%, transparent),
502
+ transparent 70%
503
+ ),
504
+ linear-gradient(var(--border), var(--border));
505
+ background-origin: border-box;
506
+ background-clip: padding-box, border-box, border-box;
507
+
508
+ &::before {
509
+ content: "";
510
+ position: absolute;
511
+ inset: 0;
512
+ z-index: -1;
513
+ border-radius: inherit;
514
+ pointer-events: none;
515
+ background: radial-gradient(
516
+ 420px circle at var(--card-spotlight-x, -999px) var(--card-spotlight-y, -999px),
517
+ color-mix(in oklab, var(--primary) 9%, transparent),
518
+ transparent 45%
519
+ );
520
+ opacity: 0;
521
+ transition: opacity 350ms ease-out;
522
+ }
523
+
524
+ @media (hover: hover) {
525
+ &:hover::before {
526
+ opacity: 1;
527
+ }
528
+ }
529
+ }
530
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alexgorbatchev/shadcn",
3
- "version": "0.0.17",
3
+ "version": "0.0.19",
4
4
  "description": "Sharp, monospace React components with compact and comfortable densities.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -1000,7 +1000,7 @@
1000
1000
  },
1001
1001
  "scripts": {
1002
1002
  "test": "vitest run --config .storybook/vitest.config.ts && bun run test:native && bun run test:package",
1003
- "test:package": "bun run build && bun test scripts/__tests__",
1003
+ "test:package": "bun run build && bun test scripts/__tests__ ./.storybook/__tests__/createStorybookViteConfig.test.ts",
1004
1004
  "test:preview": "bun test scripts/storybookPreview.test.ts",
1005
1005
  "test:native": "vitest run --config .storybook/vitest.native.config.ts",
1006
1006
  "test:coverage": "vitest run --config .storybook/vitest.coverage.config.ts --coverage",
@@ -1013,7 +1013,7 @@
1013
1013
  "build-storybook": "storybook build",
1014
1014
  "prepack": "bun run build",
1015
1015
  "test:reduced-motion": "vitest run --config .storybook/vitest.reduced-motion.config.ts",
1016
- "test:visual": "vitest run --config .storybook/vitest.visual.config.ts Button.stories.tsx Badge.stories.tsx Card.stories.tsx Input.stories.tsx",
1016
+ "test:visual": "vitest run --config .storybook/vitest.visual.config.ts Button.stories.tsx Badge.stories.tsx Card.stories.tsx Input.stories.tsx ScrollArea.stories.tsx",
1017
1017
  "test:visual:update": "bun run test:visual --update"
1018
1018
  },
1019
1019
  "dependencies": {
@@ -1,65 +0,0 @@
1
- import {
2
- cn2
3
- } from "./chunk-cp2m7y7v.js";
4
-
5
- // src/components/Card.tsx
6
- import { jsx } from "react/jsx-runtime";
7
- function Card2({ density, className, size = "default", ...props }) {
8
- return /* @__PURE__ */ jsx("div", {
9
- "data-density": density,
10
- "data-slot": "card",
11
- "data-size": size,
12
- className: cn2("group/card flex flex-col gap-(--card-spacing) overflow-hidden rounded-md bg-card py-(--card-spacing) text-sm text-card-foreground border border-border [--card-spacing:var(--ag-panel-padding)] has-data-[slot=card-footer]:pb-0 has-[>img:first-child]:pt-0 data-[size=sm]:[--card-spacing:var(--ag-panel-padding-sm)] data-[size=sm]:has-data-[slot=card-footer]:pb-0 *:[img:first-child]:rounded-t-md *:[img:last-child]:rounded-b-md", className),
13
- ...props
14
- });
15
- }
16
- function CardHeader2({ density, className, ...props }) {
17
- return /* @__PURE__ */ jsx("div", {
18
- "data-density": density,
19
- "data-slot": "card-header",
20
- className: cn2("group/card-header @container/card-header grid auto-rows-min items-start gap-1 rounded-t-md px-(--card-spacing) has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto] [.border-b]:pb-(--card-spacing)", className),
21
- ...props
22
- });
23
- }
24
- function CardTitle2({ density, className, ...props }) {
25
- return /* @__PURE__ */ jsx("div", {
26
- "data-density": density,
27
- "data-slot": "card-title",
28
- className: cn2("text-base leading-snug font-medium group-data-[size=sm]/card:text-sm", className),
29
- ...props
30
- });
31
- }
32
- function CardDescription2({ density, className, ...props }) {
33
- return /* @__PURE__ */ jsx("div", {
34
- "data-density": density,
35
- "data-slot": "card-description",
36
- className: cn2("text-sm text-muted-foreground", className),
37
- ...props
38
- });
39
- }
40
- function CardAction2({ density, className, ...props }) {
41
- return /* @__PURE__ */ jsx("div", {
42
- "data-density": density,
43
- "data-slot": "card-action",
44
- className: cn2("col-start-2 row-span-2 row-start-1 self-start justify-self-end", className),
45
- ...props
46
- });
47
- }
48
- function CardContent2({ density, className, ...props }) {
49
- return /* @__PURE__ */ jsx("div", {
50
- "data-density": density,
51
- "data-slot": "card-content",
52
- className: cn2("px-(--card-spacing)", className),
53
- ...props
54
- });
55
- }
56
- function CardFooter2({ density, className, ...props }) {
57
- return /* @__PURE__ */ jsx("div", {
58
- "data-density": density,
59
- "data-slot": "card-footer",
60
- className: cn2("flex items-center rounded-b-md border-t bg-muted/50 p-(--card-spacing)", className),
61
- ...props
62
- });
63
- }
64
-
65
- export { Card2, CardHeader2, CardTitle2, CardDescription2, CardAction2, CardContent2, CardFooter2 };