@vllnt/ui 0.4.0-canary.sha0abbc44 → 0.4.0-canary.sha174b331

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 (83) hide show
  1. package/CHANGELOG.md +59 -0
  2. package/README.md +30 -5
  3. package/dist/components/atoms/accordion/accordion.js +28 -7
  4. package/dist/components/atoms/agent-activity/agent-activity.js +1 -1
  5. package/dist/components/atoms/ai-source-citation/ai-source-citation.js +1 -1
  6. package/dist/components/atoms/avatar/avatar.js +129 -24
  7. package/dist/components/atoms/bottom-activity-strip/bottom-activity-strip.js +1 -1
  8. package/dist/components/atoms/breadcrumb/breadcrumb.js +89 -37
  9. package/dist/components/atoms/checklist/checklist.js +2 -2
  10. package/dist/components/atoms/curriculum/curriculum.js +4 -4
  11. package/dist/components/atoms/drawer/drawer.js +1 -1
  12. package/dist/components/atoms/dropdown-menu/dropdown-menu.js +1 -1
  13. package/dist/components/atoms/gauge-chart/gauge-chart.js +1 -1
  14. package/dist/components/atoms/glass-progress/glass-progress.js +1 -1
  15. package/dist/components/atoms/jarvis-dock/jarvis-dock.js +2 -2
  16. package/dist/components/atoms/kbd/kbd.js +41 -11
  17. package/dist/components/atoms/keyboard-shortcuts-help/keyboard-shortcuts-help.js +1 -1
  18. package/dist/components/atoms/menubar/menubar.js +1 -1
  19. package/dist/components/atoms/meter/meter.js +2 -2
  20. package/dist/components/atoms/policy-delivery-panel/policy-delivery-panel.js +1 -1
  21. package/dist/components/atoms/presence-stack/presence-stack.js +1 -1
  22. package/dist/components/atoms/progress-bar/progress-bar.js +164 -29
  23. package/dist/components/atoms/pull-quote/pull-quote.js +77 -0
  24. package/dist/components/atoms/quiz/quiz.js +2 -2
  25. package/dist/components/atoms/relationship-inspector/relationship-inspector.js +1 -1
  26. package/dist/components/atoms/routing-assignment-panel/routing-assignment-panel.js +2 -2
  27. package/dist/components/atoms/scrim/scrim.js +32 -0
  28. package/dist/components/atoms/segmented-control/segmented-control.js +1 -1
  29. package/dist/components/atoms/select/select.js +1 -1
  30. package/dist/components/atoms/sheet/sheet.js +3 -2
  31. package/dist/components/atoms/skeleton/skeleton.js +1 -1
  32. package/dist/components/atoms/stepper/stepper.js +1 -1
  33. package/dist/components/atoms/table/table.js +1 -1
  34. package/dist/components/atoms/table-of-contents/table-of-contents.js +1 -1
  35. package/dist/components/atoms/table-of-contents-panel/table-of-contents-panel.js +4 -4
  36. package/dist/components/atoms/tabs/tabs.js +34 -11
  37. package/dist/components/atoms/tag-group/tag-group.js +10 -5
  38. package/dist/components/atoms/tags-input/tags-input.js +1 -1
  39. package/dist/components/atoms/thread-bubble/thread-bubble.js +1 -1
  40. package/dist/components/atoms/threshold-ring/threshold-ring.js +1 -1
  41. package/dist/components/atoms/timeline/timeline.js +15 -3
  42. package/dist/components/atoms/timeline-scrubber/timeline-scrubber.js +1 -1
  43. package/dist/components/atoms/tldr-section/tldr-section.js +5 -5
  44. package/dist/components/atoms/toggle/toggle.js +1 -1
  45. package/dist/components/atoms/view-switcher/view-switcher.js +1 -1
  46. package/dist/components/atoms/viewport-bookmarks/viewport-bookmarks.js +1 -1
  47. package/dist/components/atoms/watchlist/watchlist.js +1 -1
  48. package/dist/components/atoms/workspace-switcher/workspace-switcher.js +1 -1
  49. package/dist/components/index.js +38 -2
  50. package/dist/components/molecules/approval-request/approval-request.js +168 -0
  51. package/dist/components/molecules/civilization-card/civilization-card.js +1 -1
  52. package/dist/components/molecules/content-intro/content-intro.js +2 -2
  53. package/dist/components/molecules/conversation-thread/conversation-thread.js +5 -5
  54. package/dist/components/molecules/cookie-consent/cookie-consent.js +188 -80
  55. package/dist/components/molecules/countdown-timer/countdown-timer.js +1 -1
  56. package/dist/components/molecules/filter-bar/filter-bar.js +2 -2
  57. package/dist/components/molecules/historical-figure-card/historical-figure-card.js +1 -1
  58. package/dist/components/molecules/pricing-table/pricing-table.js +1 -1
  59. package/dist/components/molecules/progress-tracker/progress-tracker.js +8 -17
  60. package/dist/components/molecules/sidebar/sidebar.js +24 -9
  61. package/dist/components/molecules/tour/tour.js +1 -1
  62. package/dist/components/molecules/tutorial-filters/tutorial-filters.js +2 -2
  63. package/dist/components/molecules/usage-breakdown/usage-breakdown.js +1 -1
  64. package/dist/components/organisms/access-matrix/access-matrix.js +271 -0
  65. package/dist/components/organisms/activity-heatmap/activity-heatmap.js +1 -1
  66. package/dist/components/organisms/code-block/code-block.js +145 -81
  67. package/dist/components/organisms/cta-band/cta-band.js +79 -0
  68. package/dist/components/organisms/flow-diagram/flow-controls.js +1 -1
  69. package/dist/components/organisms/flow-diagram/flow-fullscreen.js +1 -1
  70. package/dist/components/organisms/gantt-chart/gantt-chart.js +1 -1
  71. package/dist/components/organisms/historic-timeline/historic-timeline.js +1 -1
  72. package/dist/components/organisms/navbar-saas/navbar-saas.js +1 -1
  73. package/dist/components/organisms/order-summary/order-summary.js +172 -0
  74. package/dist/components/organisms/settings-list/settings-list.js +125 -0
  75. package/dist/components/organisms/share-dialog-people/share-dialog-people.js +412 -0
  76. package/dist/components/organisms/slideshow/slideshow.js +6 -6
  77. package/dist/components/organisms/tutorial-complete/tutorial-complete.js +2 -2
  78. package/dist/components/organisms/tutorial-mdx/tutorial-mdx.js +1 -1
  79. package/dist/index.d.ts +925 -62
  80. package/package.json +14 -3
  81. package/styles.css +5 -5
  82. package/themes/default.css +5 -5
  83. package/themes/products.css +3 -3
package/CHANGELOG.md CHANGED
@@ -6,6 +6,43 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ### Changed
10
+
11
+ - **Dark surfaces are pure black** - the default dark theme now renders
12
+ `--background`, `--muted`, `--card` and `--popover` as `0 0 0` (#000000).
13
+ Hairline borders separate the surfaces: `--border`, `--secondary` and
14
+ `--accent` stay `0.2686` (#262626), and `--input` is unchanged. Before,
15
+ `--muted` was `0.2686` (#262626) and `--card` / `--popover` were `0.1445`
16
+ (#0a0a0a). A `bg-card` or `bg-popover` surface needs a `border` to show its
17
+ edge; every shipped one has it, and a test now fails on one that does not.
18
+ The separators in `DropdownMenu`, `Menubar` and `Select` draw with
19
+ `bg-border` instead of `bg-muted`, which is the page color now, and a test
20
+ fails on any one-pixel divider that uses `bg-muted`. Light mode is unchanged.
21
+ Themes that override these roles (presets, Maia) keep their values; PaaS and
22
+ any app that reads the dark `--muted`, `--card` or `--popover` directly get
23
+ black.
24
+ - **Hover, selected and data-state fills use `secondary`** - 32 component files
25
+ (`Table`, `Tabs` pill, `Toggle`, `Slideshow`, `FilterBar` and others) used
26
+ `bg-muted` for that feedback, which is now the page color in dark.
27
+ They use `bg-secondary` with the same opacity. In the default and PaaS themes
28
+ the fill is the same color as before in light and dark, because `--secondary`
29
+ equals the old `--muted` there. Theme presets keep a quiet neutral
30
+ `--secondary` (their `--accent` is a brand color), so text on these fills
31
+ stays at 6.65 to 12.53:1 in dark. The Maia theme has its own dark `--muted`
32
+ (`0.2002`) and a core dark `--secondary` (`0.2686`), so its dark hover fills
33
+ are one step lighter than before.
34
+ `SegmentedControl`, `ViewSwitcher`, `WorkspaceSwitcher` and the `PricingTable`
35
+ period toggle draw their track with `bg-secondary` for the same reason: the
36
+ selected segment is `bg-background` on that track.
37
+ - **Skeletons, tracks and handles use `secondary`** - 29 `bg-muted` fills in 23
38
+ component files were the whole visual of their element: `Skeleton`, the
39
+ `ProgressBar`, `Meter`, `Tour`, `Checklist`, `UsageBreakdown` and other
40
+ progress, meter and usage tracks, the `Drawer` handle, the empty cells of
41
+ `ActivityHeatmap` and the neutral `GanttChart` bar. They use `bg-secondary`
42
+ (#262626) with the same opacity, because `bg-muted` is the page color in dark
43
+ and they would disappear. Chips, code spans and panels keep `bg-muted`: their
44
+ text and border carry them. A test fails on a `bg-muted` skeleton or bar.
45
+
9
46
  ### Added
10
47
 
11
48
  - **Product themes stylesheet** - `@vllnt/ui/themes/products.css` ships the
@@ -19,6 +56,28 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
19
56
  (`success`, `warning`, `info`, `diff.added`, `diff.removed`) in the preset.
20
57
  - **Label type step** - `--font-size-label`, `--line-height-label` and
21
58
  `--font-weight-label`.
59
+ - **Sidebar `pathname` prop** - names the page the sidebar marks as current.
60
+ It defaults to the router's pathname, so existing usage is unchanged. Pass
61
+ it when the URL the visitor sees differs from the route that renders, such as
62
+ a prerendered locale or variant route, instead of overriding the router's
63
+ pathname context.
64
+ - **Sidebar `prefetch` prop** - set it to `false` to stop the sidebar's links
65
+ from prefetching their pages. Left unset, the links keep the router's default
66
+ prefetching, so existing usage is unchanged. A sidebar with dozens of links
67
+ in view otherwise prefetches every one of them on page load.
68
+
69
+ ### Fixed
70
+
71
+ - **Tap targets** - the NavbarSaas links, the Breadcrumb crumbs, the
72
+ TableOfContents buttons and the Sidebar family heading link are at least
73
+ 24 px tall (WCAG 2.5.8); they were 20 px.
74
+
75
+ ### Fixed
76
+
77
+ - **Accordion accessibility** - each trigger now has `aria-controls` pointing
78
+ at its panel, and each panel is a `region` labelled by its trigger. Closed
79
+ panels are `inert`, so screen readers no longer read closed answers and Tab
80
+ skips links inside them. The open and close animation is unchanged.
22
81
 
23
82
  ## [0.4.0] - 2026-10-31
24
83
 
package/README.md CHANGED
@@ -1,9 +1,33 @@
1
1
  # @vllnt/ui
2
2
 
3
- React component library — 313 components built on Radix UI primitives, Tailwind CSS, and CVA.
3
+ React components built on Radix UI primitives, Tailwind CSS, and CVA. For humans and AI agents.
4
4
 
5
5
  See [CHANGELOG.md](./CHANGELOG.md) for release history.
6
6
 
7
+ ## For AI agents
8
+
9
+ An agent can read this library as text and JSON, without scraping pages. The site is <https://ui.vllnt.com>.
10
+
11
+ | URL | Returns |
12
+ | --- | --- |
13
+ | `https://ui.vllnt.com/llms.txt` | A short plain-text overview: install steps, docs links, and components grouped by category. |
14
+ | `https://ui.vllnt.com/llms-full.txt` | One long text file: guides, the design guide, latest release notes, templates, and a summary of every component. |
15
+ | `https://ui.vllnt.com/r/registry.json` | JSON index of every component in the shadcn registry. |
16
+ | `https://ui.vllnt.com/r/<name>` | One component as a shadcn registry item, with its source files inline. |
17
+ | `https://ui.vllnt.com/r/themes?t=<token>` | A shadcn theme item decoded from a theme token made in the theme editor. |
18
+ | `https://ui.vllnt.com/r/design.json` | The design tokens as JSON. |
19
+ | `https://ui.vllnt.com/design.txt` | The design guide as plain text. `https://ui.vllnt.com/DESIGN.md` is the same guide as Markdown. |
20
+ | `https://ui.vllnt.com/mcp` | An MCP server. It speaks JSON-RPC 2.0 over HTTP POST and has four read-only tools: `search_components`, `get_component`, `list_categories`, `list_platforms`. A GET returns server info. |
21
+ | `https://ui.vllnt.com/.well-known/api-catalog` | A catalog of these APIs (RFC 9727 linkset). |
22
+
23
+ The home page, the design and philosophy pages, and most docs and component pages also answer in Markdown. Send `Accept: text/markdown` to the same URL. A wildcard `Accept` does not select Markdown; the header must name `text/markdown`.
24
+
25
+ ```bash
26
+ curl -H "Accept: text/markdown" https://ui.vllnt.com/components/button
27
+ ```
28
+
29
+ More: <https://ui.vllnt.com/docs/agents>.
30
+
7
31
  ## Install
8
32
 
9
33
  ```bash
@@ -208,10 +232,11 @@ once near the root to restore the saved preset before paint.
208
232
  - `paas`: core neutrals and status tones in JetBrains Mono. Dark is the design
209
233
  default; light works too.
210
234
 
211
- The package does not ship fonts. Load Figtree (Maia) and JetBrains Mono (Maia
212
- and PaaS) in your app, for example with `next/font` or a font `<link>`; without
213
- them the themes fall back to the system font stack (`system-ui` for Maia,
214
- `ui-monospace` for PaaS).
235
+ The package does not ship fonts. Core puts Inter (sans) and JetBrains Mono
236
+ (mono) first, then the system stacks. Load Inter, JetBrains Mono (core, Maia and
237
+ PaaS) and Figtree (Maia) in your app, for example with `next/font` or a font
238
+ `<link>`; without them each stack falls back to the system font stack
239
+ (`system-ui` for core sans and Maia, `ui-monospace` for core mono and PaaS).
215
240
 
216
241
  Both define `success`, `warning`, `info`, `diff-added` and `diff-removed` roles
217
242
  (the core theme defines them as well). Web `--radius` carries the theme's
@@ -1,8 +1,22 @@
1
1
  "use client";
2
2
  import { jsx, jsxs } from "react/jsx-runtime";
3
- import { createContext, use, useCallback, useMemo, useState } from "react";
3
+ import {
4
+ createContext,
5
+ use,
6
+ useCallback,
7
+ useId,
8
+ useMemo,
9
+ useState
10
+ } from "react";
4
11
  import { cn } from "../../../lib/utils.js";
5
12
  const AccordionContext = createContext(null);
13
+ function getPartId(baseId, part, value) {
14
+ const key = value.replaceAll(
15
+ /[^\dA-Za-z-]/g,
16
+ (character) => `_${(character.codePointAt(0) ?? 0).toString(16)}_`
17
+ );
18
+ return `${baseId}-${part}-${key}`;
19
+ }
6
20
  function useAccordionContext() {
7
21
  const context = use(AccordionContext);
8
22
  if (!context) {
@@ -16,6 +30,7 @@ function Accordion({
16
30
  defaultValue,
17
31
  type = "single"
18
32
  }) {
33
+ const baseId = useId();
19
34
  const [openItems, setOpenItems] = useState(() => {
20
35
  if (!defaultValue) return /* @__PURE__ */ new Set();
21
36
  if (Array.isArray(defaultValue)) return new Set(defaultValue);
@@ -39,8 +54,8 @@ function Accordion({
39
54
  [type]
40
55
  );
41
56
  const contextValue = useMemo(
42
- () => ({ openItems, toggleItem, type }),
43
- [openItems, toggleItem, type]
57
+ () => ({ baseId, openItems, toggleItem, type }),
58
+ [baseId, openItems, toggleItem, type]
44
59
  );
45
60
  return /* @__PURE__ */ jsx(AccordionContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsx(
46
61
  "div",
@@ -76,18 +91,20 @@ function AccordionTrigger({
76
91
  icon,
77
92
  value
78
93
  }) {
79
- const { openItems, toggleItem } = useAccordionContext();
94
+ const { baseId, openItems, toggleItem } = useAccordionContext();
80
95
  const isOpen = openItems.has(value);
81
96
  return /* @__PURE__ */ jsxs(
82
97
  "button",
83
98
  {
99
+ "aria-controls": getPartId(baseId, "content", value),
84
100
  "aria-expanded": isOpen,
85
101
  className: cn(
86
102
  "w-full flex items-center justify-between p-4 text-left font-medium transition-colors",
87
- "hover:bg-muted/50",
88
- isOpen && "bg-muted/30",
103
+ "hover:bg-secondary/50",
104
+ isOpen && "bg-secondary/30",
89
105
  className
90
106
  ),
107
+ id: getPartId(baseId, "trigger", value),
91
108
  onClick: () => {
92
109
  toggleItem(value);
93
110
  },
@@ -134,15 +151,19 @@ function AccordionContent({
134
151
  className,
135
152
  value
136
153
  }) {
137
- const { openItems } = useAccordionContext();
154
+ const { baseId, openItems } = useAccordionContext();
138
155
  const isOpen = openItems.has(value);
139
156
  return /* @__PURE__ */ jsx(
140
157
  "div",
141
158
  {
159
+ "aria-labelledby": getPartId(baseId, "trigger", value),
142
160
  className: cn(
143
161
  "overflow-hidden transition-all duration-200",
144
162
  isOpen ? "max-h-[1000px] opacity-100" : "max-h-0 opacity-0"
145
163
  ),
164
+ id: getPartId(baseId, "content", value),
165
+ inert: !isOpen,
166
+ role: "region",
146
167
  children: /* @__PURE__ */ jsx(
147
168
  "div",
148
169
  {
@@ -296,7 +296,7 @@ const AgentStepProgress = ({
296
296
  "aria-valuemax": 100,
297
297
  "aria-valuemin": 0,
298
298
  "aria-valuenow": clamped,
299
- className: cn("h-1.5 w-full rounded-full bg-muted", className),
299
+ className: cn("h-1.5 w-full rounded-full bg-secondary", className),
300
300
  ref,
301
301
  role: "progressbar",
302
302
  ...rest,
@@ -15,7 +15,7 @@ const AISourceCitation = ({
15
15
  "a",
16
16
  {
17
17
  className: cn(
18
- "group inline-flex max-w-full flex-col gap-2 rounded-xl border border-border/70 bg-background px-3 py-2 text-left shadow-sm transition-colors hover:bg-muted/40 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
18
+ "group inline-flex max-w-full flex-col gap-2 rounded-xl border border-border/70 bg-background px-3 py-2 text-left shadow-sm transition-colors hover:bg-secondary/40 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
19
19
  className
20
20
  ),
21
21
  href,
@@ -1,51 +1,156 @@
1
1
  "use client";
2
- import { jsx } from "react/jsx-runtime";
2
+ import { jsx, jsxs } from "react/jsx-runtime";
3
+ import { createContext, use } from "react";
3
4
  import * as AvatarPrimitive from "@radix-ui/react-avatar";
5
+ import { cva } from "class-variance-authority";
4
6
  import { cn } from "../../../lib/utils.js";
7
+ const avatarSizeVariants = cva("relative flex shrink-0", {
8
+ defaultVariants: {
9
+ size: "md"
10
+ },
11
+ variants: {
12
+ size: {
13
+ lg: "size-12 text-lg",
14
+ md: "size-10",
15
+ sm: "size-8 text-sm",
16
+ xl: "size-16 text-2xl",
17
+ xs: "size-6 text-xs"
18
+ }
19
+ }
20
+ });
21
+ const avatarShapeVariants = cva("", {
22
+ defaultVariants: {
23
+ shape: "circle"
24
+ },
25
+ variants: {
26
+ shape: {
27
+ circle: "rounded-full",
28
+ square: "rounded-md"
29
+ }
30
+ }
31
+ });
32
+ const avatarPresenceVariants = cva(
33
+ "absolute bottom-0 right-0 flex items-center justify-center rounded-full ring-2 ring-background",
34
+ {
35
+ defaultVariants: {
36
+ size: "md"
37
+ },
38
+ variants: {
39
+ presence: {
40
+ away: "border-2 border-warning bg-background",
41
+ busy: "bg-destructive",
42
+ online: "bg-success"
43
+ },
44
+ size: {
45
+ lg: "size-3.5",
46
+ md: "size-3",
47
+ sm: "size-2.5",
48
+ xl: "size-4",
49
+ xs: "size-2"
50
+ }
51
+ }
52
+ }
53
+ );
54
+ const DEFAULT_PRESENCE_LABELS = {
55
+ away: "Away",
56
+ busy: "Busy",
57
+ online: "Online"
58
+ };
59
+ const AvatarShapeContext = createContext("circle");
60
+ const AvatarPresenceMarker = ({
61
+ label,
62
+ presence,
63
+ size
64
+ }) => /* @__PURE__ */ jsxs(
65
+ "span",
66
+ {
67
+ className: avatarPresenceVariants({ presence, size }),
68
+ "data-presence": presence,
69
+ children: [
70
+ presence === "busy" ? /* @__PURE__ */ jsx(
71
+ "span",
72
+ {
73
+ "aria-hidden": "true",
74
+ className: "h-0.5 w-1/2 rounded-full bg-background"
75
+ }
76
+ ) : null,
77
+ /* @__PURE__ */ jsx("span", { className: "sr-only", children: label })
78
+ ]
79
+ }
80
+ );
5
81
  const Avatar = ({
82
+ children,
6
83
  className,
84
+ presence,
85
+ presenceLabels,
7
86
  ref,
87
+ shape = "circle",
88
+ size = "md",
8
89
  ...props
9
- }) => /* @__PURE__ */ jsx(
90
+ }) => /* @__PURE__ */ jsx(AvatarShapeContext, { value: shape, children: /* @__PURE__ */ jsxs(
10
91
  AvatarPrimitive.Root,
11
92
  {
12
93
  className: cn(
13
- "relative flex size-10 shrink-0 overflow-hidden rounded-full",
94
+ avatarSizeVariants({ size }),
95
+ avatarShapeVariants({ shape }),
96
+ presence === void 0 && "overflow-hidden",
14
97
  className
15
98
  ),
16
99
  ref,
17
- ...props
100
+ ...props,
101
+ children: [
102
+ children,
103
+ presence === void 0 ? null : /* @__PURE__ */ jsx(
104
+ AvatarPresenceMarker,
105
+ {
106
+ label: presenceLabels?.[presence] ?? DEFAULT_PRESENCE_LABELS[presence],
107
+ presence,
108
+ size
109
+ }
110
+ )
111
+ ]
18
112
  }
19
- );
113
+ ) });
20
114
  Avatar.displayName = AvatarPrimitive.Root.displayName;
21
115
  const AvatarImage = ({
22
116
  className,
23
117
  ref,
24
118
  ...props
25
- }) => /* @__PURE__ */ jsx(
26
- AvatarPrimitive.Image,
27
- {
28
- className: cn("aspect-square h-full w-full", className),
29
- ref,
30
- ...props
31
- }
32
- );
119
+ }) => {
120
+ const shape = use(AvatarShapeContext);
121
+ return /* @__PURE__ */ jsx(
122
+ AvatarPrimitive.Image,
123
+ {
124
+ className: cn(
125
+ "aspect-square h-full w-full",
126
+ avatarShapeVariants({ shape }),
127
+ className
128
+ ),
129
+ ref,
130
+ ...props
131
+ }
132
+ );
133
+ };
33
134
  AvatarImage.displayName = AvatarPrimitive.Image.displayName;
34
135
  const AvatarFallback = ({
35
136
  className,
36
137
  ref,
37
138
  ...props
38
- }) => /* @__PURE__ */ jsx(
39
- AvatarPrimitive.Fallback,
40
- {
41
- className: cn(
42
- "flex h-full w-full items-center justify-center rounded-full bg-muted",
43
- className
44
- ),
45
- ref,
46
- ...props
47
- }
48
- );
139
+ }) => {
140
+ const shape = use(AvatarShapeContext);
141
+ return /* @__PURE__ */ jsx(
142
+ AvatarPrimitive.Fallback,
143
+ {
144
+ className: cn(
145
+ "flex h-full w-full items-center justify-center bg-muted",
146
+ avatarShapeVariants({ shape }),
147
+ className
148
+ ),
149
+ ref,
150
+ ...props
151
+ }
152
+ );
153
+ };
49
154
  AvatarFallback.displayName = AvatarPrimitive.Fallback.displayName;
50
155
  export {
51
156
  Avatar,
@@ -37,7 +37,7 @@ const Chip = (props) => {
37
37
  return /* @__PURE__ */ jsx(
38
38
  "button",
39
39
  {
40
- className: "flex items-center rounded-full border border-border bg-background px-2 py-1 text-[11px] transition-colors hover:bg-muted/40 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
40
+ className: "flex items-center rounded-full border border-border bg-background px-2 py-1 text-[11px] transition-colors hover:bg-secondary/40 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
41
41
  "data-strip-event": event.id,
42
42
  "data-strip-event-tone": tone,
43
43
  onClick: handleActivateEvent,
@@ -1,68 +1,120 @@
1
- import { jsx, jsxs } from "react/jsx-runtime";
1
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
2
+ import { cva } from "class-variance-authority";
2
3
  import Link from "next/link";
3
4
  import { cn } from "../../../lib/utils.js";
5
+ const DEFAULT_LABELS = {
6
+ more: "More",
7
+ region: "Breadcrumb"
8
+ };
9
+ const COLLAPSE_THRESHOLD = 3;
4
10
  const SEPARATOR_CHARS = {
5
11
  arrow: "\u2192",
6
12
  chevron: "\u203A",
7
13
  slash: "/"
8
14
  };
15
+ const crumbVariants = cva("flex min-h-6 items-center gap-1", {
16
+ defaultVariants: {
17
+ tone: "muted"
18
+ },
19
+ variants: {
20
+ tone: {
21
+ current: "font-medium text-foreground",
22
+ muted: "text-muted-foreground"
23
+ }
24
+ }
25
+ });
9
26
  function SeparatorIcon({ type }) {
10
27
  return /* @__PURE__ */ jsx("span", { "aria-hidden": "true", className: "text-muted-foreground", children: SEPARATOR_CHARS[type] ?? "\u203A" });
11
28
  }
12
- function Breadcrumb({
29
+ function CrumbBody({ item }) {
30
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
31
+ item.icon ? /* @__PURE__ */ jsx("span", { className: "flex-shrink-0", children: item.icon }) : null,
32
+ /* @__PURE__ */ jsx("span", { className: cn(typeof item.label === "string" && "truncate"), children: item.label })
33
+ ] });
34
+ }
35
+ function Crumb({
36
+ isCurrent,
37
+ item,
38
+ linkComponent: LinkComponent,
39
+ variant
40
+ }) {
41
+ if (isCurrent) {
42
+ return /* @__PURE__ */ jsx(
43
+ "span",
44
+ {
45
+ "aria-current": "page",
46
+ className: crumbVariants({
47
+ tone: variant === "default" ? "current" : "muted"
48
+ }),
49
+ children: /* @__PURE__ */ jsx(CrumbBody, { item })
50
+ }
51
+ );
52
+ }
53
+ if (item.href) {
54
+ return /* @__PURE__ */ jsx(
55
+ LinkComponent,
56
+ {
57
+ className: cn(
58
+ crumbVariants({ tone: "muted" }),
59
+ "transition-colors hover:text-foreground motion-reduce:transition-none"
60
+ ),
61
+ href: item.href,
62
+ children: /* @__PURE__ */ jsx(CrumbBody, { item })
63
+ }
64
+ );
65
+ }
66
+ return /* @__PURE__ */ jsx("span", { className: crumbVariants({ tone: "muted" }), children: /* @__PURE__ */ jsx(CrumbBody, { item }) });
67
+ }
68
+ function getVisibleEntries(items, overflow) {
69
+ const entries = items.map((item, index) => ({ index, item }));
70
+ if (overflow === "collapsed" && entries.length > COLLAPSE_THRESHOLD) {
71
+ return [...entries.slice(0, 1), null, ...entries.slice(-2)];
72
+ }
73
+ return entries;
74
+ }
75
+ const Breadcrumb = ({
13
76
  className,
14
77
  items,
78
+ labels,
79
+ linkComponent = Link,
80
+ overflow = "none",
81
+ ref,
15
82
  separator = "chevron",
16
83
  variant = "default"
17
- }) {
84
+ }) => {
85
+ const lastIndex = items.length - 1;
18
86
  return /* @__PURE__ */ jsx(
19
87
  "nav",
20
88
  {
21
- "aria-label": "Breadcrumb",
89
+ "aria-label": labels?.region ?? DEFAULT_LABELS.region,
22
90
  className: cn("flex items-center space-x-1 text-sm", className),
23
- children: items.map((item, index) => /* @__PURE__ */ jsxs(
24
- "div",
91
+ ref,
92
+ children: /* @__PURE__ */ jsx("ol", { className: "flex items-center space-x-1", children: getVisibleEntries(items, overflow).map((entry, position) => /* @__PURE__ */ jsxs(
93
+ "li",
25
94
  {
26
95
  className: "flex items-center",
27
96
  children: [
28
- index > 0 && /* @__PURE__ */ jsx("span", { className: "mx-2", children: /* @__PURE__ */ jsx(SeparatorIcon, { type: separator }) }),
29
- item.href ? /* @__PURE__ */ jsxs(
30
- Link,
97
+ position > 0 && /* @__PURE__ */ jsx("span", { className: "mx-2", children: /* @__PURE__ */ jsx(SeparatorIcon, { type: separator }) }),
98
+ entry ? /* @__PURE__ */ jsx(
99
+ Crumb,
31
100
  {
32
- className: "flex items-center gap-1 hover:text-foreground transition-colors",
33
- href: item.href,
34
- children: [
35
- item.icon ? /* @__PURE__ */ jsx("span", { className: "flex-shrink-0", children: item.icon }) : null,
36
- /* @__PURE__ */ jsx(
37
- "span",
38
- {
39
- className: cn(
40
- // Truncate plain string labels; custom React elements handle their own overflow
41
- typeof item.label === "string" && "truncate",
42
- variant === "minimal" ? "text-muted-foreground" : "text-foreground"
43
- ),
44
- children: item.label
45
- }
46
- )
47
- ]
101
+ isCurrent: entry.index === lastIndex,
102
+ item: entry.item,
103
+ linkComponent,
104
+ variant
48
105
  }
49
- ) : /* @__PURE__ */ jsxs("span", { className: "flex items-center gap-1 text-muted-foreground", children: [
50
- item.icon ? /* @__PURE__ */ jsx("span", { className: "flex-shrink-0", children: item.icon }) : null,
51
- /* @__PURE__ */ jsx(
52
- "span",
53
- {
54
- className: cn(typeof item.label === "string" && "truncate"),
55
- children: item.label
56
- }
57
- )
106
+ ) : /* @__PURE__ */ jsxs("span", { className: "text-muted-foreground", children: [
107
+ /* @__PURE__ */ jsx("span", { "aria-hidden": "true", children: "\u2026" }),
108
+ /* @__PURE__ */ jsx("span", { className: "sr-only", children: labels?.more ?? DEFAULT_LABELS.more })
58
109
  ] })
59
110
  ]
60
111
  },
61
- `${typeof item.label === "string" ? item.label : "breadcrumb"}-${index.toString()}`
62
- ))
112
+ entry ? `${typeof entry.item.label === "string" ? entry.item.label : "breadcrumb"}-${entry.index.toString()}` : "breadcrumb-more"
113
+ )) })
63
114
  }
64
115
  );
65
- }
116
+ };
117
+ Breadcrumb.displayName = "Breadcrumb";
66
118
  export {
67
119
  Breadcrumb
68
120
  };
@@ -37,7 +37,7 @@ function ChecklistItemRow({
37
37
  "button",
38
38
  {
39
39
  className: cn(
40
- "w-full flex items-start gap-3 p-2 rounded-md text-left transition-colors hover:bg-muted/50",
40
+ "w-full flex items-start gap-3 p-2 rounded-md text-left transition-colors hover:bg-secondary/50",
41
41
  isChecked && "opacity-60"
42
42
  ),
43
43
  onClick: onToggle,
@@ -192,7 +192,7 @@ function Checklist({
192
192
  total: items.length
193
193
  }
194
194
  ),
195
- /* @__PURE__ */ jsx("div", { className: "h-1 bg-muted rounded-full mb-4 overflow-hidden", children: /* @__PURE__ */ jsx(
195
+ /* @__PURE__ */ jsx("div", { className: "h-1 bg-secondary rounded-full mb-4 overflow-hidden", children: /* @__PURE__ */ jsx(
196
196
  "div",
197
197
  {
198
198
  className: cn(
@@ -78,7 +78,7 @@ function ProgressBar({
78
78
  }) {
79
79
  if (total === 0) return null;
80
80
  return /* @__PURE__ */ jsxs("div", { className: "mt-1 flex items-center gap-2", children: [
81
- /* @__PURE__ */ jsx("div", { className: "h-1.5 max-w-[120px] flex-1 overflow-hidden rounded-full bg-muted", children: /* @__PURE__ */ jsx(
81
+ /* @__PURE__ */ jsx("div", { className: "h-1.5 max-w-[120px] flex-1 overflow-hidden rounded-full bg-secondary", children: /* @__PURE__ */ jsx(
82
82
  "div",
83
83
  {
84
84
  className: "h-full rounded-full bg-primary transition-all",
@@ -144,8 +144,8 @@ function ModuleTrigger({
144
144
  "aria-expanded": isExpanded,
145
145
  className: cn(
146
146
  "w-full flex items-start justify-between gap-3 rounded-md px-6 py-4 text-left transition-colors",
147
- "hover:bg-muted/50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-2",
148
- isExpanded && "bg-muted/30"
147
+ "hover:bg-secondary/50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-2",
148
+ isExpanded && "bg-secondary/30"
149
149
  ),
150
150
  onClick: toggle,
151
151
  type: "button",
@@ -297,7 +297,7 @@ function CurriculumLesson({
297
297
  className: cn(
298
298
  "flex items-center gap-3 px-6 py-3 pl-10 text-sm transition-colors",
299
299
  isLocked ? "cursor-not-allowed opacity-60" : "",
300
- !isLocked && href ? "cursor-pointer hover:bg-muted/40" : "",
300
+ !isLocked && href ? "cursor-pointer hover:bg-secondary/40" : "",
301
301
  className
302
302
  ),
303
303
  children: [
@@ -48,7 +48,7 @@ const DrawerContent = ({
48
48
  ref,
49
49
  ...props,
50
50
  children: [
51
- /* @__PURE__ */ jsx("div", { className: "mx-auto mt-4 h-2 w-[100px] rounded-full bg-muted" }),
51
+ /* @__PURE__ */ jsx("div", { className: "mx-auto mt-4 h-2 w-[100px] rounded-full bg-secondary" }),
52
52
  children
53
53
  ]
54
54
  }
@@ -152,7 +152,7 @@ const DropdownMenuSeparator = ({
152
152
  }) => /* @__PURE__ */ jsx(
153
153
  DropdownMenuPrimitive.Separator,
154
154
  {
155
- className: cn("-m-1 h-px bg-muted", className),
155
+ className: cn("-m-1 h-px bg-border", className),
156
156
  ref: reference,
157
157
  ...props
158
158
  }
@@ -93,7 +93,7 @@ const GaugeChart = ({
93
93
  /* @__PURE__ */ jsx(
94
94
  "path",
95
95
  {
96
- className: "stroke-muted",
96
+ className: "stroke-secondary",
97
97
  d: arc({ center, end: 360, radius, start: 180 }),
98
98
  fill: "none",
99
99
  strokeLinecap: "round",
@@ -18,7 +18,7 @@ const GlassProgress = ({
18
18
  "aria-valuemin": 0,
19
19
  "aria-valuenow": clamped,
20
20
  className: cn(
21
- "relative h-2 w-full overflow-hidden rounded-full border border-border/50 bg-muted/40 backdrop-blur",
21
+ "relative h-2 w-full overflow-hidden rounded-full border border-border/50 bg-secondary/40 backdrop-blur",
22
22
  className
23
23
  ),
24
24
  ref,