@vllnt/ui 0.4.0-canary.sha8f4d258 → 0.4.0-canary.sha9d4e97e
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 +104 -6
- package/README.md +33 -2
- 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/avatar/avatar.js +129 -24
- package/dist/components/atoms/bottom-activity-strip/bottom-activity-strip.js +1 -1
- 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/drawer/drawer.js +1 -1
- package/dist/components/atoms/dropdown-menu/dropdown-menu.js +1 -1
- 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/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/policy-delivery-panel/policy-delivery-panel.js +1 -1
- package/dist/components/atoms/presence-stack/presence-stack.js +1 -1
- package/dist/components/atoms/progress-bar/progress-bar.js +164 -29
- 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 +2 -2
- package/dist/components/atoms/scrim/scrim.js +32 -0
- package/dist/components/atoms/segmented-control/segmented-control.js +1 -1
- package/dist/components/atoms/select/select.js +1 -1
- package/dist/components/atoms/sheet/sheet.js +3 -2
- package/dist/components/atoms/skeleton/skeleton.js +1 -1
- package/dist/components/atoms/stepper/stepper.js +1 -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 +1 -1
- package/dist/components/atoms/timeline/timeline.js +15 -3
- package/dist/components/atoms/timeline-scrubber/timeline-scrubber.js +1 -1
- 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/approval-request/approval-request.js +168 -0
- package/dist/components/molecules/civilization-card/civilization-card.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/countdown-timer/countdown-timer.js +1 -1
- 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/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/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/tutorial-complete/tutorial-complete.js +2 -2
- package/dist/components/organisms/tutorial-mdx/tutorial-mdx.js +1 -1
- package/dist/index.d.ts +925 -62
- package/dist/tailwind-preset.js +16 -0
- package/package.json +8 -7
- package/styles.css +24 -5
- package/themes/default.css +24 -5
- package/themes/products.css +146 -0
|
@@ -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: [
|
|
@@ -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
|
}
|
|
@@ -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,
|
|
@@ -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}`
|
|
@@ -43,7 +43,7 @@ const Row = (props) => {
|
|
|
43
43
|
return /* @__PURE__ */ jsx(
|
|
44
44
|
"button",
|
|
45
45
|
{
|
|
46
|
-
className: "flex w-full items-center gap-2 rounded-md border border-transparent px-2 py-1.5 text-left transition-colors hover:border-border hover:bg-
|
|
46
|
+
className: "flex w-full items-center gap-2 rounded-md border border-transparent px-2 py-1.5 text-left transition-colors hover:border-border hover:bg-secondary/40 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
47
47
|
"data-policy-row": policy.id,
|
|
48
48
|
"data-policy-status": policy.status,
|
|
49
49
|
onClick: handleTogglePolicy,
|
|
@@ -95,7 +95,7 @@ const renderOverflow = (input) => {
|
|
|
95
95
|
"aria-label": aria,
|
|
96
96
|
className: cn(
|
|
97
97
|
className,
|
|
98
|
-
"transition-colors hover:bg-
|
|
98
|
+
"transition-colors hover:bg-secondary/80 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"
|
|
99
99
|
),
|
|
100
100
|
"data-presence-stack-overflow": true,
|
|
101
101
|
onClick: input.handleClick,
|
|
@@ -1,56 +1,191 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { cva } from "class-variance-authority";
|
|
2
5
|
import { cn } from "../../../lib/utils.js";
|
|
3
|
-
|
|
6
|
+
const progressBarTrackVariants = cva(
|
|
7
|
+
"overflow-hidden rounded-full bg-secondary",
|
|
8
|
+
{
|
|
9
|
+
defaultVariants: {
|
|
10
|
+
size: "md"
|
|
11
|
+
},
|
|
12
|
+
variants: {
|
|
13
|
+
size: {
|
|
14
|
+
lg: "h-3",
|
|
15
|
+
md: "h-2",
|
|
16
|
+
sm: "h-1"
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
);
|
|
21
|
+
const progressBarFillVariants = cva("h-full", {
|
|
22
|
+
defaultVariants: {
|
|
23
|
+
tone: "primary"
|
|
24
|
+
},
|
|
25
|
+
variants: {
|
|
26
|
+
tone: {
|
|
27
|
+
danger: "bg-destructive",
|
|
28
|
+
info: "bg-info",
|
|
29
|
+
neutral: "bg-muted-foreground",
|
|
30
|
+
primary: "bg-primary",
|
|
31
|
+
success: "bg-success",
|
|
32
|
+
warning: "bg-warning"
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
const progressBarCompleteVariants = cva("", {
|
|
37
|
+
defaultVariants: {
|
|
38
|
+
tone: "primary"
|
|
39
|
+
},
|
|
40
|
+
variants: {
|
|
41
|
+
tone: {
|
|
42
|
+
danger: "border-destructive/50 bg-destructive/5",
|
|
43
|
+
info: "border-info/50 bg-info/5",
|
|
44
|
+
neutral: "border-border bg-muted/30",
|
|
45
|
+
primary: "border-primary/50 bg-primary/5",
|
|
46
|
+
success: "border-success/50 bg-success/5",
|
|
47
|
+
warning: "border-warning/50 bg-warning/5"
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
function renderValueText({
|
|
52
|
+
completedLabel,
|
|
53
|
+
isIndeterminate,
|
|
54
|
+
max,
|
|
55
|
+
percent,
|
|
56
|
+
showValue,
|
|
57
|
+
value,
|
|
58
|
+
valueLabel
|
|
59
|
+
}) {
|
|
60
|
+
if (valueLabel !== void 0) {
|
|
61
|
+
return valueLabel;
|
|
62
|
+
}
|
|
63
|
+
if (isIndeterminate) {
|
|
64
|
+
return null;
|
|
65
|
+
}
|
|
66
|
+
if (showValue) {
|
|
67
|
+
return `${percent}%`;
|
|
68
|
+
}
|
|
69
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
70
|
+
value,
|
|
71
|
+
" / ",
|
|
72
|
+
max,
|
|
73
|
+
" ",
|
|
74
|
+
completedLabel ?? ""
|
|
75
|
+
] });
|
|
76
|
+
}
|
|
77
|
+
function ProgressBarHeader(props) {
|
|
78
|
+
return /* @__PURE__ */ jsx("div", { className: "flex items-center justify-between mb-2 h-5", children: props.isLoading ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
79
|
+
/* @__PURE__ */ jsx("span", { className: "h-5 w-16 bg-secondary rounded animate-pulse motion-reduce:animate-none" }),
|
|
80
|
+
/* @__PURE__ */ jsx("span", { className: "h-5 w-24 bg-secondary rounded animate-pulse motion-reduce:animate-none" })
|
|
81
|
+
] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
82
|
+
/* @__PURE__ */ jsx("span", { className: "text-sm font-medium leading-5", id: props.labelId, children: props.label }),
|
|
83
|
+
/* @__PURE__ */ jsx("span", { className: "text-sm text-muted-foreground leading-5", children: renderValueText(props) })
|
|
84
|
+
] }) });
|
|
85
|
+
}
|
|
86
|
+
function ProgressBarTrack({
|
|
87
|
+
ariaLabel,
|
|
88
|
+
isIndeterminate,
|
|
89
|
+
isLoading,
|
|
90
|
+
labelledBy,
|
|
91
|
+
max,
|
|
92
|
+
percent,
|
|
93
|
+
size,
|
|
94
|
+
tone,
|
|
95
|
+
value
|
|
96
|
+
}) {
|
|
97
|
+
const isValueKnown = !isLoading && !isIndeterminate;
|
|
98
|
+
return /* @__PURE__ */ jsx(
|
|
99
|
+
"div",
|
|
100
|
+
{
|
|
101
|
+
"aria-label": labelledBy ? void 0 : ariaLabel ?? "Progress",
|
|
102
|
+
"aria-labelledby": labelledBy,
|
|
103
|
+
"aria-valuemax": max,
|
|
104
|
+
"aria-valuemin": 0,
|
|
105
|
+
"aria-valuenow": isValueKnown ? value : void 0,
|
|
106
|
+
className: progressBarTrackVariants({ size }),
|
|
107
|
+
role: "progressbar",
|
|
108
|
+
children: /* @__PURE__ */ jsx(
|
|
109
|
+
"div",
|
|
110
|
+
{
|
|
111
|
+
className: cn(
|
|
112
|
+
progressBarFillVariants({ tone }),
|
|
113
|
+
isIndeterminate ? "w-full animate-shimmer motion-reduce:w-1/3 motion-reduce:animate-none" : "transition-all duration-300",
|
|
114
|
+
isLoading && "w-0"
|
|
115
|
+
),
|
|
116
|
+
style: isValueKnown ? { width: `${percent}%` } : void 0
|
|
117
|
+
}
|
|
118
|
+
)
|
|
119
|
+
}
|
|
120
|
+
);
|
|
121
|
+
}
|
|
122
|
+
const ProgressBar = ({
|
|
123
|
+
"aria-label": ariaLabel,
|
|
4
124
|
className,
|
|
5
125
|
completedLabel,
|
|
6
126
|
currentLabel,
|
|
7
127
|
isComplete = false,
|
|
8
128
|
isLoading = false,
|
|
129
|
+
label,
|
|
9
130
|
max,
|
|
131
|
+
mode = "determinate",
|
|
132
|
+
ref,
|
|
10
133
|
showLabels = true,
|
|
11
|
-
|
|
12
|
-
|
|
134
|
+
showValue = false,
|
|
135
|
+
size,
|
|
136
|
+
tone,
|
|
137
|
+
value,
|
|
138
|
+
valueLabel
|
|
139
|
+
}) => {
|
|
140
|
+
const labelId = React.useId();
|
|
13
141
|
const percent = max > 0 ? Math.round(value / max * 100) : 0;
|
|
142
|
+
const isIndeterminate = mode === "indeterminate" && !isLoading && !isComplete;
|
|
143
|
+
const resolvedTone = tone ?? (isComplete ? "success" : "primary");
|
|
144
|
+
const labelledBy = showLabels && !isLoading && ariaLabel === void 0 ? labelId : void 0;
|
|
14
145
|
return /* @__PURE__ */ jsxs(
|
|
15
146
|
"div",
|
|
16
147
|
{
|
|
17
148
|
className: cn(
|
|
18
149
|
"border rounded-lg p-4 transition-colors",
|
|
19
|
-
isLoading && "border-border bg-muted/30",
|
|
20
|
-
!isLoading && isComplete && "border-green-500/50 bg-green-500/5",
|
|
21
|
-
!isLoading && !isComplete && "border-border bg-muted/30",
|
|
150
|
+
!isLoading && isComplete ? progressBarCompleteVariants({ tone: resolvedTone }) : "border-border bg-muted/30",
|
|
22
151
|
className
|
|
23
152
|
),
|
|
153
|
+
ref,
|
|
24
154
|
children: [
|
|
25
|
-
showLabels ? /* @__PURE__ */ jsx(
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
155
|
+
showLabels ? /* @__PURE__ */ jsx(
|
|
156
|
+
ProgressBarHeader,
|
|
157
|
+
{
|
|
158
|
+
completedLabel,
|
|
159
|
+
isIndeterminate,
|
|
160
|
+
isLoading,
|
|
161
|
+
label: label ?? currentLabel ?? (isComplete ? "Complete" : "Progress"),
|
|
162
|
+
labelId,
|
|
33
163
|
max,
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
164
|
+
percent,
|
|
165
|
+
showValue,
|
|
166
|
+
value,
|
|
167
|
+
valueLabel
|
|
168
|
+
}
|
|
169
|
+
) : null,
|
|
170
|
+
/* @__PURE__ */ jsx(
|
|
171
|
+
ProgressBarTrack,
|
|
40
172
|
{
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
173
|
+
ariaLabel,
|
|
174
|
+
isIndeterminate,
|
|
175
|
+
isLoading,
|
|
176
|
+
labelledBy,
|
|
177
|
+
max,
|
|
178
|
+
percent,
|
|
179
|
+
size,
|
|
180
|
+
tone: resolvedTone,
|
|
181
|
+
value
|
|
48
182
|
}
|
|
49
|
-
)
|
|
183
|
+
)
|
|
50
184
|
]
|
|
51
185
|
}
|
|
52
186
|
);
|
|
53
|
-
}
|
|
187
|
+
};
|
|
188
|
+
ProgressBar.displayName = "ProgressBar";
|
|
54
189
|
export {
|
|
55
190
|
ProgressBar
|
|
56
191
|
};
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { cva } from "class-variance-authority";
|
|
3
|
+
import { cn } from "../../../lib/utils.js";
|
|
4
|
+
const pullQuoteVariants = cva(
|
|
5
|
+
"flex flex-col font-[family-name:var(--font-sans)] text-foreground",
|
|
6
|
+
{
|
|
7
|
+
defaultVariants: {
|
|
8
|
+
size: "md"
|
|
9
|
+
},
|
|
10
|
+
variants: {
|
|
11
|
+
size: {
|
|
12
|
+
lg: "gap-6",
|
|
13
|
+
md: "gap-4"
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
);
|
|
18
|
+
const pullQuoteRuleVariants = cva("block rounded-full bg-primary", {
|
|
19
|
+
defaultVariants: {
|
|
20
|
+
size: "md"
|
|
21
|
+
},
|
|
22
|
+
variants: {
|
|
23
|
+
size: {
|
|
24
|
+
lg: "h-1 w-16",
|
|
25
|
+
md: "h-0.5 w-12"
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
const pullQuoteBodyVariants = cva(
|
|
30
|
+
"font-[family-name:var(--font-display)] tracking-tight text-balance",
|
|
31
|
+
{
|
|
32
|
+
defaultVariants: {
|
|
33
|
+
size: "md"
|
|
34
|
+
},
|
|
35
|
+
variants: {
|
|
36
|
+
size: {
|
|
37
|
+
lg: "text-[length:var(--font-size-h2)] leading-[var(--line-height-h2)]",
|
|
38
|
+
md: "text-[length:var(--font-size-h4)] leading-[var(--line-height-h4)]"
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
);
|
|
43
|
+
const pullQuoteCiteVariants = cva("text-muted-foreground", {
|
|
44
|
+
defaultVariants: {
|
|
45
|
+
size: "md"
|
|
46
|
+
},
|
|
47
|
+
variants: {
|
|
48
|
+
size: {
|
|
49
|
+
lg: "text-[length:var(--font-size-body)] leading-[var(--line-height-body)]",
|
|
50
|
+
md: "text-[length:var(--font-size-body-sm)] leading-[var(--line-height-body-sm)]"
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
const PullQuote = ({
|
|
55
|
+
children,
|
|
56
|
+
cite,
|
|
57
|
+
className,
|
|
58
|
+
ref,
|
|
59
|
+
size = "md",
|
|
60
|
+
...props
|
|
61
|
+
}) => /* @__PURE__ */ jsxs(
|
|
62
|
+
"figure",
|
|
63
|
+
{
|
|
64
|
+
className: cn(pullQuoteVariants({ size }), className),
|
|
65
|
+
ref,
|
|
66
|
+
...props,
|
|
67
|
+
children: [
|
|
68
|
+
/* @__PURE__ */ jsx("span", { "aria-hidden": "true", className: pullQuoteRuleVariants({ size }) }),
|
|
69
|
+
/* @__PURE__ */ jsx("blockquote", { className: pullQuoteBodyVariants({ size }), children }),
|
|
70
|
+
cite ? /* @__PURE__ */ jsx("figcaption", { className: pullQuoteCiteVariants({ size }), children: cite }) : null
|
|
71
|
+
]
|
|
72
|
+
}
|
|
73
|
+
);
|
|
74
|
+
PullQuote.displayName = "PullQuote";
|
|
75
|
+
export {
|
|
76
|
+
PullQuote
|
|
77
|
+
};
|
|
@@ -39,7 +39,7 @@ function QuizOptionButton({
|
|
|
39
39
|
"button",
|
|
40
40
|
{
|
|
41
41
|
className: cn(
|
|
42
|
-
"w-full text-left p-3 rounded-md border transition-colors hover:bg-
|
|
42
|
+
"w-full text-left p-3 rounded-md border transition-colors hover:bg-secondary/50 focus:outline-none focus:ring-2 focus:ring-primary",
|
|
43
43
|
isSelected && !submitted && "border-primary bg-primary/10",
|
|
44
44
|
showResult && option.correct && "border-green-500 bg-green-500/10",
|
|
45
45
|
showResult && !option.correct && "border-red-500 bg-red-500/10",
|
|
@@ -141,7 +141,7 @@ function QuizActions({
|
|
|
141
141
|
return /* @__PURE__ */ jsx("div", { className: "flex gap-2", children: submitted ? /* @__PURE__ */ jsx(
|
|
142
142
|
"button",
|
|
143
143
|
{
|
|
144
|
-
className: "px-3 py-1.5 text-sm rounded-md border border-border hover:bg-
|
|
144
|
+
className: "px-3 py-1.5 text-sm rounded-md border border-border hover:bg-secondary transition-colors",
|
|
145
145
|
onClick: onReset,
|
|
146
146
|
type: "button",
|
|
147
147
|
children: "Try Again"
|
|
@@ -31,7 +31,7 @@ const Row = (props) => {
|
|
|
31
31
|
return /* @__PURE__ */ jsx(
|
|
32
32
|
"button",
|
|
33
33
|
{
|
|
34
|
-
className: "flex w-full items-center gap-2 rounded-md border border-transparent px-2 py-1.5 text-left transition-colors hover:border-border hover:bg-
|
|
34
|
+
className: "flex w-full items-center gap-2 rounded-md border border-transparent px-2 py-1.5 text-left transition-colors hover:border-border hover:bg-secondary/40 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
35
35
|
"data-relationship-direction": edge.direction,
|
|
36
36
|
"data-relationship-row": true,
|
|
37
37
|
onClick: handleActivateRelationship,
|
|
@@ -45,7 +45,7 @@ const RowBody = (props) => {
|
|
|
45
45
|
"span",
|
|
46
46
|
{
|
|
47
47
|
"aria-hidden": "true",
|
|
48
|
-
className: "h-1 w-full overflow-hidden rounded-full bg-
|
|
48
|
+
className: "h-1 w-full overflow-hidden rounded-full bg-secondary/40",
|
|
49
49
|
children: /* @__PURE__ */ jsx(
|
|
50
50
|
"span",
|
|
51
51
|
{
|
|
@@ -66,7 +66,7 @@ const Row = (props) => {
|
|
|
66
66
|
return /* @__PURE__ */ jsx(
|
|
67
67
|
"button",
|
|
68
68
|
{
|
|
69
|
-
className: "flex w-full items-center gap-2 rounded-md border border-transparent px-2 py-1.5 text-left transition-colors hover:border-border hover:bg-
|
|
69
|
+
className: "flex w-full items-center gap-2 rounded-md border border-transparent px-2 py-1.5 text-left transition-colors hover:border-border hover:bg-secondary/40 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
70
70
|
"data-routing-assignment": assignment.id,
|
|
71
71
|
"data-routing-role": assignment.role,
|
|
72
72
|
onClick: handleActivateAssignment,
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { cva } from "class-variance-authority";
|
|
3
|
+
import { cn } from "../../../lib/utils.js";
|
|
4
|
+
const scrimVariants = cva("absolute inset-0", {
|
|
5
|
+
defaultVariants: {
|
|
6
|
+
level: "dim"
|
|
7
|
+
},
|
|
8
|
+
variants: {
|
|
9
|
+
level: {
|
|
10
|
+
dim: "bg-black/50",
|
|
11
|
+
strong: "bg-black/80"
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
const Scrim = ({
|
|
16
|
+
className,
|
|
17
|
+
level,
|
|
18
|
+
ref,
|
|
19
|
+
...props
|
|
20
|
+
}) => /* @__PURE__ */ jsx(
|
|
21
|
+
"div",
|
|
22
|
+
{
|
|
23
|
+
"aria-hidden": "true",
|
|
24
|
+
className: cn(scrimVariants({ level }), className),
|
|
25
|
+
ref,
|
|
26
|
+
...props
|
|
27
|
+
}
|
|
28
|
+
);
|
|
29
|
+
Scrim.displayName = "Scrim";
|
|
30
|
+
export {
|
|
31
|
+
Scrim
|
|
32
|
+
};
|