@vllnt/ui 0.4.0-canary.sha36bfa21 → 0.4.0-canary.sha49f831b
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 +170 -6
- package/README.md +61 -3
- package/dist/components/atoms/accordion/accordion.js +28 -7
- package/dist/components/atoms/agent-activity/agent-activity.js +1 -1
- package/dist/components/atoms/ai-source-citation/ai-source-citation.js +1 -1
- package/dist/components/atoms/alert/alert.js +1 -1
- package/dist/components/atoms/alert-pulse/alert-pulse.js +7 -4
- package/dist/components/atoms/avatar/avatar.js +129 -24
- package/dist/components/atoms/badge/badge.js +84 -5
- package/dist/components/atoms/bottom-activity-strip/bottom-activity-strip.js +3 -2
- package/dist/components/atoms/breadcrumb/breadcrumb.js +89 -37
- package/dist/components/atoms/checklist/checklist.js +2 -2
- package/dist/components/atoms/curriculum/curriculum.js +4 -4
- package/dist/components/atoms/dialog/dialog.js +4 -2
- package/dist/components/atoms/drawer/drawer.js +1 -1
- package/dist/components/atoms/dropdown-menu/dropdown-menu.js +1 -1
- package/dist/components/atoms/floating-toolbar/floating-toolbar.js +23 -2
- package/dist/components/atoms/gauge-chart/gauge-chart.js +1 -1
- package/dist/components/atoms/glass-progress/glass-progress.js +1 -1
- package/dist/components/atoms/heat-overlay/heat-overlay.js +3 -2
- package/dist/components/atoms/jarvis-dock/jarvis-dock.js +2 -2
- package/dist/components/atoms/kbd/kbd.js +41 -11
- package/dist/components/atoms/keyboard-shortcuts-help/keyboard-shortcuts-help.js +1 -1
- package/dist/components/atoms/menubar/menubar.js +1 -1
- package/dist/components/atoms/meter/meter.js +2 -2
- package/dist/components/atoms/metric-cluster/metric-cluster.js +2 -1
- package/dist/components/atoms/policy-delivery-panel/policy-delivery-panel.js +19 -10
- package/dist/components/atoms/presence-stack/presence-stack.js +1 -1
- package/dist/components/atoms/progress-bar/progress-bar.js +190 -30
- package/dist/components/atoms/pull-quote/pull-quote.js +77 -0
- package/dist/components/atoms/quiz/quiz.js +2 -2
- package/dist/components/atoms/relationship-inspector/relationship-inspector.js +1 -1
- package/dist/components/atoms/routing-assignment-panel/routing-assignment-panel.js +20 -11
- package/dist/components/atoms/runtime-overview-panel/runtime-overview-panel.js +2 -1
- package/dist/components/atoms/scrim/scrim.js +32 -0
- package/dist/components/atoms/segmented-control/segmented-control.js +2 -2
- package/dist/components/atoms/select/select.js +3 -3
- package/dist/components/atoms/sheet/sheet.js +3 -2
- package/dist/components/atoms/skeleton/skeleton.js +1 -1
- package/dist/components/atoms/state-badge-overlay/state-badge-overlay.js +14 -16
- package/dist/components/atoms/stepper/stepper.js +1 -1
- package/dist/components/atoms/sticky-metric/sticky-metric.js +2 -1
- package/dist/components/atoms/table/table.js +1 -1
- package/dist/components/atoms/table-of-contents/table-of-contents.js +1 -1
- package/dist/components/atoms/table-of-contents-panel/table-of-contents-panel.js +4 -4
- package/dist/components/atoms/tabs/tabs.js +34 -11
- package/dist/components/atoms/tag-group/tag-group.js +10 -5
- package/dist/components/atoms/tags-input/tags-input.js +1 -1
- package/dist/components/atoms/thread-bubble/thread-bubble.js +1 -1
- package/dist/components/atoms/threshold-ring/threshold-ring.js +3 -2
- package/dist/components/atoms/timeline/timeline.js +15 -3
- package/dist/components/atoms/timeline-scrubber/timeline-scrubber.js +3 -2
- package/dist/components/atoms/tldr-section/tldr-section.js +5 -5
- package/dist/components/atoms/toggle/toggle.js +1 -1
- package/dist/components/atoms/view-switcher/view-switcher.js +1 -1
- package/dist/components/atoms/viewport-bookmarks/viewport-bookmarks.js +1 -1
- package/dist/components/atoms/watchlist/watchlist.js +1 -1
- package/dist/components/atoms/workspace-switcher/workspace-switcher.js +1 -1
- package/dist/components/index.js +38 -2
- package/dist/components/molecules/ai-artifact/ai-artifact.js +2 -12
- package/dist/components/molecules/approval-request/approval-request.js +168 -0
- package/dist/components/molecules/civilization-card/civilization-card.js +1 -1
- package/dist/components/molecules/completion-dialog/completion-dialog.js +1 -1
- package/dist/components/molecules/content-intro/content-intro.js +2 -2
- package/dist/components/molecules/conversation-thread/conversation-thread.js +5 -5
- package/dist/components/molecules/cookie-consent/cookie-consent.js +188 -80
- package/dist/components/molecules/copy-button/use-copy-to-clipboard.js +10 -12
- package/dist/components/molecules/countdown-timer/countdown-timer.js +1 -1
- package/dist/components/molecules/credit-badge/credit-badge.js +13 -16
- package/dist/components/molecules/filter-bar/filter-bar.js +2 -2
- package/dist/components/molecules/historical-figure-card/historical-figure-card.js +1 -1
- package/dist/components/molecules/plan-badge/plan-badge.js +12 -13
- package/dist/components/molecules/pricing-table/pricing-table.js +1 -1
- package/dist/components/molecules/progress-tracker/progress-tracker.js +8 -17
- package/dist/components/molecules/sidebar/sidebar.js +24 -9
- package/dist/components/molecules/tour/tour.js +1 -1
- package/dist/components/molecules/transaction-list/transaction-list.js +7 -9
- package/dist/components/molecules/tutorial-filters/tutorial-filters.js +2 -2
- package/dist/components/molecules/usage-breakdown/usage-breakdown.js +1 -1
- package/dist/components/organisms/access-matrix/access-matrix.js +271 -0
- package/dist/components/organisms/activity-heatmap/activity-heatmap.js +1 -1
- package/dist/components/organisms/code-block/code-block.js +145 -81
- package/dist/components/organisms/cta-band/cta-band.js +79 -0
- package/dist/components/organisms/flow-diagram/flow-controls.js +1 -1
- package/dist/components/organisms/flow-diagram/flow-fullscreen.js +1 -1
- package/dist/components/organisms/gantt-chart/gantt-chart.js +1 -1
- package/dist/components/organisms/historic-timeline/historic-timeline.js +1 -1
- package/dist/components/organisms/navbar-saas/navbar-saas.js +1 -1
- package/dist/components/organisms/order-summary/order-summary.js +172 -0
- package/dist/components/organisms/settings-list/settings-list.js +125 -0
- package/dist/components/organisms/share-dialog-people/share-dialog-people.js +412 -0
- package/dist/components/organisms/slideshow/slideshow.js +6 -6
- package/dist/components/organisms/subscription-card/subscription-card.js +10 -10
- package/dist/components/organisms/tutorial-complete/tutorial-complete.js +2 -2
- package/dist/components/organisms/tutorial-mdx/tutorial-mdx.js +1 -1
- package/dist/index.d.ts +1143 -82
- package/dist/index.js +10 -0
- package/dist/lib/copy-text.js +64 -0
- package/dist/lib/status-dot.js +33 -0
- package/dist/tailwind-preset.js +16 -0
- package/package.json +17 -4
- package/styles.css +48 -7
- package/themes/default.css +48 -7
- package/themes/presets.css +24 -24
- package/themes/products.css +146 -0
|
@@ -1,24 +1,103 @@
|
|
|
1
|
-
import { jsx } from "react/jsx-runtime";
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { cva } from "class-variance-authority";
|
|
3
|
+
import { isStatusTone, statusDotVariants } from "../../../lib/status-dot.js";
|
|
3
4
|
import { cn } from "../../../lib/utils.js";
|
|
4
5
|
const badgeVariants = cva(
|
|
5
|
-
"inline-flex items-center rounded-full border
|
|
6
|
+
"inline-flex items-center rounded-full border font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
|
|
6
7
|
{
|
|
8
|
+
compoundVariants: [
|
|
9
|
+
{
|
|
10
|
+
class: "border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",
|
|
11
|
+
tone: "danger-solid"
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
class: "border-destructive/30 bg-destructive/10 text-foreground hover:bg-destructive/15",
|
|
15
|
+
tone: "danger-tint"
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
class: "border-transparent bg-primary text-primary-foreground hover:bg-primary/80",
|
|
19
|
+
tone: "solid"
|
|
20
|
+
},
|
|
21
|
+
{ border: "none", class: "border-transparent" },
|
|
22
|
+
{ border: "strong", class: "border-foreground" }
|
|
23
|
+
],
|
|
7
24
|
defaultVariants: {
|
|
25
|
+
dot: false,
|
|
26
|
+
size: "default",
|
|
8
27
|
variant: "default"
|
|
9
28
|
},
|
|
10
29
|
variants: {
|
|
30
|
+
border: {
|
|
31
|
+
none: "",
|
|
32
|
+
strong: ""
|
|
33
|
+
},
|
|
34
|
+
dot: {
|
|
35
|
+
false: "",
|
|
36
|
+
true: "gap-1.5"
|
|
37
|
+
},
|
|
38
|
+
size: {
|
|
39
|
+
default: "px-2.5 py-0.5 text-xs",
|
|
40
|
+
header: "px-3 py-1 text-sm",
|
|
41
|
+
inline: "px-1.5 py-0 text-[10px] leading-4",
|
|
42
|
+
sm: "px-2 py-0 text-[11px] leading-[1.125rem]"
|
|
43
|
+
},
|
|
44
|
+
tone: {
|
|
45
|
+
danger: "",
|
|
46
|
+
"danger-solid": "",
|
|
47
|
+
"danger-tint": "",
|
|
48
|
+
info: "",
|
|
49
|
+
neutral: "",
|
|
50
|
+
primary: "",
|
|
51
|
+
solid: "",
|
|
52
|
+
success: "",
|
|
53
|
+
warning: ""
|
|
54
|
+
},
|
|
11
55
|
variant: {
|
|
12
56
|
default: "border-transparent bg-primary text-primary-foreground hover:bg-primary/80",
|
|
13
57
|
destructive: "border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",
|
|
14
58
|
outline: "text-foreground",
|
|
15
|
-
secondary: "border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80"
|
|
59
|
+
secondary: "border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",
|
|
60
|
+
soft: "border-transparent bg-muted text-foreground hover:bg-secondary/80"
|
|
16
61
|
}
|
|
17
62
|
}
|
|
18
63
|
}
|
|
19
64
|
);
|
|
20
|
-
function Badge({
|
|
21
|
-
|
|
65
|
+
function Badge({
|
|
66
|
+
border,
|
|
67
|
+
children,
|
|
68
|
+
className,
|
|
69
|
+
dot = false,
|
|
70
|
+
ref,
|
|
71
|
+
size,
|
|
72
|
+
tone,
|
|
73
|
+
variant,
|
|
74
|
+
...props
|
|
75
|
+
}) {
|
|
76
|
+
const statusTone = isStatusTone(tone) ? tone : void 0;
|
|
77
|
+
const surface = variant ?? (statusTone ? "secondary" : "default");
|
|
78
|
+
const dotTone = tone === "danger-tint" ? "danger" : statusTone;
|
|
79
|
+
return /* @__PURE__ */ jsxs(
|
|
80
|
+
"span",
|
|
81
|
+
{
|
|
82
|
+
className: cn(
|
|
83
|
+
badgeVariants({ border, dot, size, tone, variant: surface }),
|
|
84
|
+
className
|
|
85
|
+
),
|
|
86
|
+
ref,
|
|
87
|
+
...props,
|
|
88
|
+
children: [
|
|
89
|
+
dot ? /* @__PURE__ */ jsx(
|
|
90
|
+
"span",
|
|
91
|
+
{
|
|
92
|
+
"aria-hidden": "true",
|
|
93
|
+
className: statusDotVariants({ tone: dotTone }),
|
|
94
|
+
"data-badge-dot": ""
|
|
95
|
+
}
|
|
96
|
+
) : null,
|
|
97
|
+
children
|
|
98
|
+
]
|
|
99
|
+
}
|
|
100
|
+
);
|
|
22
101
|
}
|
|
23
102
|
export {
|
|
24
103
|
Badge,
|
|
@@ -6,7 +6,8 @@ const TONE_DOT = {
|
|
|
6
6
|
info: "bg-blue-500",
|
|
7
7
|
neutral: "bg-muted-foreground",
|
|
8
8
|
success: "bg-emerald-500",
|
|
9
|
-
warn: "bg-amber-500"
|
|
9
|
+
warn: "bg-amber-500",
|
|
10
|
+
warning: "bg-amber-500"
|
|
10
11
|
};
|
|
11
12
|
const DEFAULT_LABELS = {
|
|
12
13
|
empty: "No recent activity",
|
|
@@ -37,7 +38,7 @@ const Chip = (props) => {
|
|
|
37
38
|
return /* @__PURE__ */ jsx(
|
|
38
39
|
"button",
|
|
39
40
|
{
|
|
40
|
-
className: "flex items-center rounded-full border border-border bg-background px-2 py-1 text-[11px] transition-colors hover:bg-
|
|
41
|
+
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
42
|
"data-strip-event": event.id,
|
|
42
43
|
"data-strip-event-tone": tone,
|
|
43
44
|
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
|
|
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":
|
|
89
|
+
"aria-label": labels?.region ?? DEFAULT_LABELS.region,
|
|
22
90
|
className: cn("flex items-center space-x-1 text-sm", className),
|
|
23
|
-
|
|
24
|
-
|
|
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
|
-
|
|
29
|
-
|
|
30
|
-
|
|
97
|
+
position > 0 && /* @__PURE__ */ jsx("span", { className: "mx-2", children: /* @__PURE__ */ jsx(SeparatorIcon, { type: separator }) }),
|
|
98
|
+
entry ? /* @__PURE__ */ jsx(
|
|
99
|
+
Crumb,
|
|
31
100
|
{
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
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: "
|
|
50
|
-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
148
|
-
isExpanded && "bg-
|
|
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-
|
|
300
|
+
!isLocked && href ? "cursor-pointer hover:bg-secondary/40" : "",
|
|
301
301
|
className
|
|
302
302
|
),
|
|
303
303
|
children: [
|
|
@@ -23,13 +23,15 @@ const DialogOverlay = ({
|
|
|
23
23
|
}
|
|
24
24
|
);
|
|
25
25
|
DialogOverlay.displayName = DialogPrimitive.Overlay.displayName;
|
|
26
|
+
const DialogScrollLock = () => /* @__PURE__ */ jsx(DialogPrimitive.Overlay, { className: "hidden" });
|
|
26
27
|
const DialogContent = ({
|
|
27
28
|
children,
|
|
28
29
|
className,
|
|
30
|
+
overlay = "scrim",
|
|
29
31
|
ref: reference,
|
|
30
32
|
...props
|
|
31
33
|
}) => /* @__PURE__ */ jsxs(DialogPortal, { children: [
|
|
32
|
-
/* @__PURE__ */ jsx(DialogOverlay, {}),
|
|
34
|
+
overlay === "scrim" ? /* @__PURE__ */ jsx(DialogOverlay, {}) : /* @__PURE__ */ jsx(DialogScrollLock, {}),
|
|
33
35
|
/* @__PURE__ */ jsxs(
|
|
34
36
|
DialogPrimitive.Content,
|
|
35
37
|
{
|
|
@@ -41,7 +43,7 @@ const DialogContent = ({
|
|
|
41
43
|
...props,
|
|
42
44
|
children: [
|
|
43
45
|
children,
|
|
44
|
-
/* @__PURE__ */ jsxs(DialogPrimitive.Close, { className: "absolute right-
|
|
46
|
+
/* @__PURE__ */ jsxs(DialogPrimitive.Close, { className: "absolute right-3 top-3 inline-flex min-h-6 min-w-6 items-center justify-center rounded-sm p-1 opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground", children: [
|
|
45
47
|
/* @__PURE__ */ jsx(X, { className: "size-4" }),
|
|
46
48
|
/* @__PURE__ */ jsx("span", { className: "sr-only", children: "Close" })
|
|
47
49
|
] })
|
|
@@ -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-
|
|
51
|
+
/* @__PURE__ */ jsx("div", { className: "mx-auto mt-4 h-2 w-[100px] rounded-full bg-secondary" }),
|
|
52
52
|
children
|
|
53
53
|
]
|
|
54
54
|
}
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import {
|
|
4
|
+
useState
|
|
5
|
+
} from "react";
|
|
6
|
+
import { moveRovingFocus } from "../../../lib/roving-focus.js";
|
|
3
7
|
import { cn } from "../../../lib/utils.js";
|
|
4
8
|
const VARIANT_CLASSES = {
|
|
5
9
|
destructive: "border-red-300 bg-red-500/10 text-red-700 hover:bg-red-500/20 dark:text-red-300",
|
|
@@ -9,12 +13,23 @@ const VARIANT_CLASSES = {
|
|
|
9
13
|
const DEFAULT_LABELS = {
|
|
10
14
|
region: "Selection actions"
|
|
11
15
|
};
|
|
16
|
+
const ACTION_SELECTOR = "button[data-action-id]";
|
|
17
|
+
function resolveTabStopId(actions, focusedId) {
|
|
18
|
+
const enabledIds = actions.filter((action) => !action.disabled).map((action) => action.id);
|
|
19
|
+
return focusedId !== void 0 && enabledIds.includes(focusedId) ? focusedId : enabledIds[0];
|
|
20
|
+
}
|
|
12
21
|
const FloatingToolbar = ({
|
|
13
22
|
ref,
|
|
14
23
|
...props
|
|
15
24
|
}) => {
|
|
16
|
-
const { actions, className, labels, x, y, ...rest } = props;
|
|
25
|
+
const { actions, className, labels, onKeyDown, x, y, ...rest } = props;
|
|
26
|
+
const [focusedId, setFocusedId] = useState();
|
|
17
27
|
const resolvedLabels = { ...DEFAULT_LABELS, ...labels };
|
|
28
|
+
const tabStopId = resolveTabStopId(actions, focusedId);
|
|
29
|
+
const handleKeyDownToolbar = (event) => {
|
|
30
|
+
onKeyDown?.(event);
|
|
31
|
+
moveRovingFocus(event, ACTION_SELECTOR);
|
|
32
|
+
};
|
|
18
33
|
return /* @__PURE__ */ jsx(
|
|
19
34
|
"div",
|
|
20
35
|
{
|
|
@@ -28,17 +43,21 @@ const FloatingToolbar = ({
|
|
|
28
43
|
role: "toolbar",
|
|
29
44
|
style: { left: `${x.toString()}px`, top: `${y.toString()}px` },
|
|
30
45
|
...rest,
|
|
46
|
+
onKeyDown: handleKeyDownToolbar,
|
|
31
47
|
children: actions.map((action) => {
|
|
32
48
|
const variant = action.variant ?? "ghost";
|
|
33
49
|
const handleActivateToolbarAction = () => {
|
|
34
50
|
action.onActivate();
|
|
35
51
|
};
|
|
52
|
+
const handleFocusToolbarAction = () => {
|
|
53
|
+
setFocusedId(action.id);
|
|
54
|
+
};
|
|
36
55
|
return /* @__PURE__ */ jsxs(
|
|
37
56
|
"button",
|
|
38
57
|
{
|
|
39
58
|
"aria-label": action.ariaLabel ?? void 0,
|
|
40
59
|
className: cn(
|
|
41
|
-
"inline-flex h-7 items-center gap-1 rounded-md border px-2 text-xs font-medium transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
60
|
+
"inline-flex h-7 items-center gap-1 rounded-md border px-2 text-xs font-medium transition-colors motion-reduce:transition-none focus:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
42
61
|
VARIANT_CLASSES[variant],
|
|
43
62
|
action.disabled ? "cursor-not-allowed opacity-50" : ""
|
|
44
63
|
),
|
|
@@ -46,6 +65,8 @@ const FloatingToolbar = ({
|
|
|
46
65
|
"data-variant": variant,
|
|
47
66
|
disabled: action.disabled,
|
|
48
67
|
onClick: handleActivateToolbarAction,
|
|
68
|
+
onFocus: handleFocusToolbarAction,
|
|
69
|
+
tabIndex: action.id === tabStopId ? 0 : -1,
|
|
49
70
|
type: "button",
|
|
50
71
|
children: [
|
|
51
72
|
action.glyph ? /* @__PURE__ */ jsx("span", { "aria-hidden": "true", className: "inline-flex size-3", children: action.glyph }) : null,
|
|
@@ -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-
|
|
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,
|
|
@@ -6,7 +6,8 @@ const TONE_FILL = {
|
|
|
6
6
|
cool: "fill-blue-500",
|
|
7
7
|
danger: "fill-red-500",
|
|
8
8
|
neutral: "fill-foreground",
|
|
9
|
-
warn: "fill-amber-500"
|
|
9
|
+
warn: "fill-amber-500",
|
|
10
|
+
warning: "fill-amber-500"
|
|
10
11
|
};
|
|
11
12
|
const DEFAULT_LABELS = {
|
|
12
13
|
region: "Heat overlay"
|
|
@@ -44,7 +45,7 @@ const HeatOverlay = ({
|
|
|
44
45
|
}) => {
|
|
45
46
|
const {
|
|
46
47
|
className,
|
|
47
|
-
defaultTone = "
|
|
48
|
+
defaultTone = "warning",
|
|
48
49
|
intensity = 48,
|
|
49
50
|
labels,
|
|
50
51
|
points,
|
|
@@ -20,7 +20,7 @@ const ActionButton = (props) => {
|
|
|
20
20
|
return /* @__PURE__ */ jsxs(
|
|
21
21
|
"button",
|
|
22
22
|
{
|
|
23
|
-
className: "group relative flex size-12 flex-col items-center justify-center gap-0.5 rounded-md border border-transparent text-[10px] uppercase tracking-wide text-muted-foreground transition-colors hover:border-border hover:bg-
|
|
23
|
+
className: "group relative flex size-12 flex-col items-center justify-center gap-0.5 rounded-md border border-transparent text-[10px] uppercase tracking-wide text-muted-foreground transition-colors hover:border-border hover:bg-secondary/40 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
24
24
|
"data-jarvis-action": action.id,
|
|
25
25
|
"data-jarvis-tone": tone,
|
|
26
26
|
onClick: handleActivateAction,
|
|
@@ -78,7 +78,7 @@ const JarvisDock = ({
|
|
|
78
78
|
"button",
|
|
79
79
|
{
|
|
80
80
|
"aria-label": resolvedLabels.paletteTrigger,
|
|
81
|
-
className: "flex size-12 items-center justify-center rounded-md border border-transparent text-base text-muted-foreground transition-colors hover:border-border hover:bg-
|
|
81
|
+
className: "flex size-12 items-center justify-center rounded-md border border-transparent text-base text-muted-foreground transition-colors hover:border-border hover:bg-secondary/40 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
82
82
|
"data-jarvis-palette-trigger": true,
|
|
83
83
|
onClick: handlePalette,
|
|
84
84
|
type: "button",
|
|
@@ -1,26 +1,34 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
3
3
|
import {
|
|
4
4
|
useSyncExternalStore
|
|
5
5
|
} from "react";
|
|
6
6
|
import { cva } from "class-variance-authority";
|
|
7
|
+
import { Command } from "lucide-react";
|
|
7
8
|
import { cn } from "../../../lib/utils.js";
|
|
8
9
|
const kbdVariants = cva(
|
|
9
|
-
"inline-flex select-none items-center justify-center
|
|
10
|
+
"inline-flex select-none items-center justify-center font-mono font-medium text-foreground [&>svg]:h-3 [&>svg]:w-3",
|
|
10
11
|
{
|
|
11
12
|
defaultVariants: {
|
|
12
|
-
size: "md"
|
|
13
|
+
size: "md",
|
|
14
|
+
variant: "default"
|
|
13
15
|
},
|
|
14
16
|
variants: {
|
|
15
17
|
size: {
|
|
16
18
|
lg: "h-7 min-w-[1.75rem] px-2 text-sm",
|
|
17
19
|
md: "h-5 min-w-[1.25rem] px-1.5 text-xs",
|
|
18
20
|
sm: "h-4 min-w-[1rem] px-1 text-[10px]"
|
|
21
|
+
},
|
|
22
|
+
variant: {
|
|
23
|
+
bracket: "gap-0.5",
|
|
24
|
+
default: "rounded border border-border bg-muted shadow-[0_1px_0_0_oklch(var(--border))]"
|
|
19
25
|
}
|
|
20
26
|
}
|
|
21
27
|
}
|
|
22
28
|
);
|
|
23
29
|
const MAC_PLATFORM_PATTERN = /mac|iphone|ipad|ipod/i;
|
|
30
|
+
const COMMAND_GLYPH = "\u2318";
|
|
31
|
+
const COMMAND_NAME = "Command";
|
|
24
32
|
const MODIFIER_LABELS = {
|
|
25
33
|
alt: { mac: "\u2325", other: "Alt" },
|
|
26
34
|
ctrl: { mac: "\u2303", other: "Ctrl" },
|
|
@@ -71,41 +79,63 @@ function formatToken(token, mac) {
|
|
|
71
79
|
if (special !== void 0) return special;
|
|
72
80
|
return token.length === 1 ? token.toUpperCase() : token;
|
|
73
81
|
}
|
|
82
|
+
function describeLabel(label) {
|
|
83
|
+
return label === COMMAND_GLYPH ? COMMAND_NAME : label;
|
|
84
|
+
}
|
|
85
|
+
function renderLabel(label) {
|
|
86
|
+
if (label !== COMMAND_GLYPH) return label;
|
|
87
|
+
return /* @__PURE__ */ jsx(Command, { "aria-label": COMMAND_NAME, role: "img" });
|
|
88
|
+
}
|
|
89
|
+
function withBrackets(content, variant) {
|
|
90
|
+
if (variant !== "bracket") return content;
|
|
91
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
92
|
+
/* @__PURE__ */ jsx("span", { "aria-hidden": "true", className: "text-muted-foreground", children: "[" }),
|
|
93
|
+
content,
|
|
94
|
+
/* @__PURE__ */ jsx("span", { "aria-hidden": "true", className: "text-muted-foreground", children: "]" })
|
|
95
|
+
] });
|
|
96
|
+
}
|
|
74
97
|
const Kbd = ({
|
|
75
98
|
children,
|
|
76
99
|
className,
|
|
100
|
+
platform = "auto",
|
|
77
101
|
ref,
|
|
78
102
|
shortcut,
|
|
79
103
|
size,
|
|
104
|
+
variant,
|
|
80
105
|
...rest
|
|
81
106
|
}) => {
|
|
82
|
-
const
|
|
107
|
+
const detectedMac = useIsMac();
|
|
108
|
+
const isMac = platform === "auto" ? detectedMac : platform === "mac";
|
|
109
|
+
const keyClassName = cn(kbdVariants({ size, variant }), className);
|
|
83
110
|
if (children !== void 0) {
|
|
84
|
-
return /* @__PURE__ */ jsx("kbd", { className:
|
|
111
|
+
return /* @__PURE__ */ jsx("kbd", { className: keyClassName, ref, ...rest, children: withBrackets(children, variant) });
|
|
85
112
|
}
|
|
86
113
|
if (shortcut) {
|
|
87
114
|
const tokens = shortcut.split(SHORTCUT_SEPARATOR).map((token) => token.trim()).filter(Boolean);
|
|
88
|
-
const
|
|
115
|
+
const keys = tokens.map((token) => ({
|
|
116
|
+
label: formatToken(token, isMac),
|
|
117
|
+
token
|
|
118
|
+
}));
|
|
89
119
|
return /* @__PURE__ */ jsx(
|
|
90
120
|
"span",
|
|
91
121
|
{
|
|
92
|
-
"aria-label":
|
|
122
|
+
"aria-label": keys.map(({ label }) => describeLabel(label)).join(" + "),
|
|
93
123
|
className: "inline-flex items-center gap-1",
|
|
94
124
|
role: "img",
|
|
95
|
-
children:
|
|
125
|
+
children: keys.map(({ label, token }, index) => /* @__PURE__ */ jsx(
|
|
96
126
|
"kbd",
|
|
97
127
|
{
|
|
98
|
-
className:
|
|
128
|
+
className: keyClassName,
|
|
99
129
|
ref: index === 0 ? ref : void 0,
|
|
100
130
|
...index === 0 ? rest : {},
|
|
101
|
-
children:
|
|
131
|
+
children: withBrackets(renderLabel(label), variant)
|
|
102
132
|
},
|
|
103
133
|
`${token}-${index.toString()}`
|
|
104
134
|
))
|
|
105
135
|
}
|
|
106
136
|
);
|
|
107
137
|
}
|
|
108
|
-
return /* @__PURE__ */ jsx("kbd", { className:
|
|
138
|
+
return /* @__PURE__ */ jsx("kbd", { className: keyClassName, ref, ...rest });
|
|
109
139
|
};
|
|
110
140
|
Kbd.displayName = "Kbd";
|
|
111
141
|
export {
|
|
@@ -100,7 +100,7 @@ function KeyboardShortcutsHelpImpl({
|
|
|
100
100
|
"button",
|
|
101
101
|
{
|
|
102
102
|
"aria-label": "Close shortcuts help",
|
|
103
|
-
className: "flex size-8 items-center justify-center rounded-md hover:bg-
|
|
103
|
+
className: "flex size-8 items-center justify-center rounded-md hover:bg-secondary",
|
|
104
104
|
onClick: onClose,
|
|
105
105
|
ref: closeButtonRef,
|
|
106
106
|
type: "button",
|
|
@@ -43,7 +43,7 @@ const Meter = ({
|
|
|
43
43
|
"aria-valuenow": current,
|
|
44
44
|
"aria-valuetext": valueText,
|
|
45
45
|
className: cn(
|
|
46
|
-
"h-2 w-full overflow-hidden rounded-full bg-
|
|
46
|
+
"h-2 w-full overflow-hidden rounded-full bg-secondary",
|
|
47
47
|
segmentCount > 0 && "flex gap-0.5 bg-transparent",
|
|
48
48
|
className
|
|
49
49
|
),
|
|
@@ -55,7 +55,7 @@ const Meter = ({
|
|
|
55
55
|
{
|
|
56
56
|
className: cn(
|
|
57
57
|
"h-full flex-1 rounded-full",
|
|
58
|
-
index < filledSegments ? meterFillVariants({ variant }) : "bg-
|
|
58
|
+
index < filledSegments ? meterFillVariants({ variant }) : "bg-secondary"
|
|
59
59
|
)
|
|
60
60
|
},
|
|
61
61
|
`meter-segment-${index}`
|