@vouched-id/ui 0.0.0-stage → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Accordion.d.ts +8 -0
- package/dist/Accordion.d.ts.map +1 -0
- package/dist/Accordion.js +20 -0
- package/dist/Accordion.js.map +1 -0
- package/dist/Alert.d.ts +12 -0
- package/dist/Alert.d.ts.map +1 -0
- package/dist/Alert.js +64 -0
- package/dist/Alert.js.map +1 -0
- package/dist/AlertDialog.d.ts +90 -0
- package/dist/AlertDialog.d.ts.map +1 -0
- package/dist/AlertDialog.js +148 -0
- package/dist/AlertDialog.js.map +1 -0
- package/dist/Avatar.d.ts +43 -0
- package/dist/Avatar.d.ts.map +1 -0
- package/dist/Avatar.js +29 -0
- package/dist/Avatar.js.map +1 -0
- package/dist/Badge.d.ts +31 -0
- package/dist/Badge.d.ts.map +1 -0
- package/dist/Badge.js +22 -0
- package/dist/Badge.js.map +1 -0
- package/dist/Banner.d.ts +57 -0
- package/dist/Banner.d.ts.map +1 -0
- package/dist/Banner.js +30 -0
- package/dist/Banner.js.map +1 -0
- package/dist/Button.d.ts +56 -0
- package/dist/Button.d.ts.map +1 -0
- package/dist/Button.js +106 -0
- package/dist/Button.js.map +1 -0
- package/dist/Card.d.ts +79 -0
- package/dist/Card.d.ts.map +1 -0
- package/dist/Card.js +50 -0
- package/dist/Card.js.map +1 -0
- package/dist/Chart.d.ts +63 -0
- package/dist/Chart.d.ts.map +1 -0
- package/dist/Chart.js +120 -0
- package/dist/Chart.js.map +1 -0
- package/dist/Checkbox.d.ts +4 -0
- package/dist/Checkbox.d.ts.map +1 -0
- package/dist/Checkbox.js +10 -0
- package/dist/Checkbox.js.map +1 -0
- package/dist/CodeBlock.d.ts +101 -0
- package/dist/CodeBlock.d.ts.map +1 -0
- package/dist/CodeBlock.js +99 -0
- package/dist/CodeBlock.js.map +1 -0
- package/dist/Collapsible.d.ts +6 -0
- package/dist/Collapsible.d.ts.map +1 -0
- package/dist/Collapsible.js +14 -0
- package/dist/Collapsible.js.map +1 -0
- package/dist/DataTable.d.ts +59 -0
- package/dist/DataTable.d.ts.map +1 -0
- package/dist/DataTable.js +162 -0
- package/dist/DataTable.js.map +1 -0
- package/dist/Dialog.d.ts +71 -0
- package/dist/Dialog.d.ts.map +1 -0
- package/dist/Dialog.js +185 -0
- package/dist/Dialog.js.map +1 -0
- package/dist/DropdownMenu.d.ts +82 -0
- package/dist/DropdownMenu.d.ts.map +1 -0
- package/dist/DropdownMenu.js +111 -0
- package/dist/DropdownMenu.js.map +1 -0
- package/dist/EditorialHeading.d.ts +42 -0
- package/dist/EditorialHeading.d.ts.map +1 -0
- package/dist/EditorialHeading.js +36 -0
- package/dist/EditorialHeading.js.map +1 -0
- package/dist/EmptyState.d.ts +40 -0
- package/dist/EmptyState.d.ts.map +1 -0
- package/dist/EmptyState.js +7 -0
- package/dist/EmptyState.js.map +1 -0
- package/dist/Eyebrow.d.ts +27 -0
- package/dist/Eyebrow.d.ts.map +1 -0
- package/dist/Eyebrow.js +23 -0
- package/dist/Eyebrow.js.map +1 -0
- package/dist/Field.d.ts +33 -0
- package/dist/Field.d.ts.map +1 -0
- package/dist/Field.js +26 -0
- package/dist/Field.js.map +1 -0
- package/dist/HoverCard.d.ts +7 -0
- package/dist/HoverCard.d.ts.map +1 -0
- package/dist/HoverCard.js +17 -0
- package/dist/HoverCard.js.map +1 -0
- package/dist/Input.d.ts +20 -0
- package/dist/Input.d.ts.map +1 -0
- package/dist/Input.js +17 -0
- package/dist/Input.js.map +1 -0
- package/dist/InstallCommand.d.ts +48 -0
- package/dist/InstallCommand.d.ts.map +1 -0
- package/dist/InstallCommand.js +60 -0
- package/dist/InstallCommand.js.map +1 -0
- package/dist/Kbd.d.ts +23 -0
- package/dist/Kbd.d.ts.map +1 -0
- package/dist/Kbd.js +7 -0
- package/dist/Kbd.js.map +1 -0
- package/dist/Label.d.ts +5 -0
- package/dist/Label.d.ts.map +1 -0
- package/dist/Label.js +9 -0
- package/dist/Label.js.map +1 -0
- package/dist/Popover.d.ts +41 -0
- package/dist/Popover.d.ts.map +1 -0
- package/dist/Popover.js +27 -0
- package/dist/Popover.js.map +1 -0
- package/dist/Progress.d.ts +6 -0
- package/dist/Progress.d.ts.map +1 -0
- package/dist/Progress.js +9 -0
- package/dist/Progress.js.map +1 -0
- package/dist/RadioGroup.d.ts +5 -0
- package/dist/RadioGroup.d.ts.map +1 -0
- package/dist/RadioGroup.js +15 -0
- package/dist/RadioGroup.js.map +1 -0
- package/dist/ScrollArea.d.ts +32 -0
- package/dist/ScrollArea.d.ts.map +1 -0
- package/dist/ScrollArea.js +13 -0
- package/dist/ScrollArea.js.map +1 -0
- package/dist/SegmentedControl.d.ts +37 -0
- package/dist/SegmentedControl.d.ts.map +1 -0
- package/dist/SegmentedControl.js +85 -0
- package/dist/SegmentedControl.js.map +1 -0
- package/dist/Select.d.ts +21 -0
- package/dist/Select.d.ts.map +1 -0
- package/dist/Select.js +52 -0
- package/dist/Select.js.map +1 -0
- package/dist/Separator.d.ts +4 -0
- package/dist/Separator.d.ts.map +1 -0
- package/dist/Separator.js +9 -0
- package/dist/Separator.js.map +1 -0
- package/dist/Sheet.d.ts +71 -0
- package/dist/Sheet.d.ts.map +1 -0
- package/dist/Sheet.js +173 -0
- package/dist/Sheet.js.map +1 -0
- package/dist/Skeleton.d.ts +26 -0
- package/dist/Skeleton.d.ts.map +1 -0
- package/dist/Skeleton.js +9 -0
- package/dist/Skeleton.js.map +1 -0
- package/dist/Slider.d.ts +5 -0
- package/dist/Slider.d.ts.map +1 -0
- package/dist/Slider.js +12 -0
- package/dist/Slider.js.map +1 -0
- package/dist/StatusDot.d.ts +29 -0
- package/dist/StatusDot.d.ts.map +1 -0
- package/dist/StatusDot.js +55 -0
- package/dist/StatusDot.js.map +1 -0
- package/dist/StatusText.d.ts +15 -0
- package/dist/StatusText.d.ts.map +1 -0
- package/dist/StatusText.js +49 -0
- package/dist/StatusText.js.map +1 -0
- package/dist/Switch.d.ts +47 -0
- package/dist/Switch.d.ts.map +1 -0
- package/dist/Switch.js +17 -0
- package/dist/Switch.js.map +1 -0
- package/dist/Table.d.ts +22 -0
- package/dist/Table.d.ts.map +1 -0
- package/dist/Table.js +42 -0
- package/dist/Table.js.map +1 -0
- package/dist/Tabs.d.ts +96 -0
- package/dist/Tabs.d.ts.map +1 -0
- package/dist/Tabs.js +319 -0
- package/dist/Tabs.js.map +1 -0
- package/dist/Tag.d.ts +19 -0
- package/dist/Tag.d.ts.map +1 -0
- package/dist/Tag.js +50 -0
- package/dist/Tag.js.map +1 -0
- package/dist/Textarea.d.ts +32 -0
- package/dist/Textarea.d.ts.map +1 -0
- package/dist/Textarea.js +11 -0
- package/dist/Textarea.js.map +1 -0
- package/dist/Toast.d.ts +47 -0
- package/dist/Toast.d.ts.map +1 -0
- package/dist/Toast.js +110 -0
- package/dist/Toast.js.map +1 -0
- package/dist/ToggleGroup.d.ts +48 -0
- package/dist/ToggleGroup.d.ts.map +1 -0
- package/dist/ToggleGroup.js +27 -0
- package/dist/ToggleGroup.js.map +1 -0
- package/dist/Tooltip.d.ts +8 -0
- package/dist/Tooltip.d.ts.map +1 -0
- package/dist/Tooltip.js +81 -0
- package/dist/Tooltip.js.map +1 -0
- package/dist/_code-copy-button.d.ts +9 -0
- package/dist/_code-copy-button.d.ts.map +1 -0
- package/dist/_code-copy-button.js +72 -0
- package/dist/_code-copy-button.js.map +1 -0
- package/dist/_code-syntax.d.ts +81 -0
- package/dist/_code-syntax.d.ts.map +1 -0
- package/dist/_code-syntax.js +293 -0
- package/dist/_code-syntax.js.map +1 -0
- package/dist/_status-icons.d.ts +22 -0
- package/dist/_status-icons.d.ts.map +1 -0
- package/dist/_status-icons.js +40 -0
- package/dist/_status-icons.js.map +1 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +11 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/format-numbers.d.ts +51 -0
- package/dist/lib/format-numbers.d.ts.map +1 -0
- package/dist/lib/format-numbers.js +158 -0
- package/dist/lib/format-numbers.js.map +1 -0
- package/dist/lib/utils.d.ts +20 -0
- package/dist/lib/utils.d.ts.map +1 -0
- package/dist/lib/utils.js +23 -0
- package/dist/lib/utils.js.map +1 -0
- package/dist/public.d.ts +61 -0
- package/dist/public.d.ts.map +1 -0
- package/dist/public.js +65 -0
- package/dist/public.js.map +1 -0
- package/dist/theme-scope.d.ts +55 -0
- package/dist/theme-scope.d.ts.map +1 -0
- package/dist/theme-scope.js +90 -0
- package/dist/theme-scope.js.map +1 -0
- package/dist/tokens.generated.d.ts +335 -0
- package/dist/tokens.generated.d.ts.map +1 -0
- package/dist/tokens.generated.js +349 -0
- package/dist/tokens.generated.js.map +1 -0
- package/package.json +100 -3
- package/styles/README.md +104 -0
- package/styles/base.css +301 -0
- package/styles/canvas.css +147 -0
- package/styles/colors_and_type.css +136 -0
- package/styles/component-contracts.css +471 -0
- package/styles/fonts.css +28 -0
- package/styles/package.css +6 -0
- package/styles/primitive-skins.css +104 -0
- package/styles/semantic-bindings.css +119 -0
- package/styles/shell.css +50 -0
- package/styles/source.css +4 -0
- package/styles/tailwind-bridge.css +255 -0
- package/styles/theme.css +14 -0
- package/styles/tokens.css +1281 -0
- package/README.md +0 -3
package/dist/Dialog.js
ADDED
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import * as DialogPrimitive from '@radix-ui/react-dialog';
|
|
5
|
+
import { X } from 'lucide-react';
|
|
6
|
+
import { cn } from './lib/utils.js';
|
|
7
|
+
import { useThemeScope } from './theme-scope.js';
|
|
8
|
+
/**
|
|
9
|
+
* Checkpoint · Dialog (Modal)
|
|
10
|
+
*
|
|
11
|
+
* Wraps Radix Dialog with v5 ssot `.cp-modal` chrome. Behavior layer
|
|
12
|
+
* (focus trap, escape close, scroll lock, ARIA, portal) is Radix;
|
|
13
|
+
* look layer is ours:
|
|
14
|
+
*
|
|
15
|
+
* - Surface: `--bg-surface` + 1px `--border-default` (heavier
|
|
16
|
+
* border than the card's --border-subtle — modals carry more
|
|
17
|
+
* visual weight as floating chrome)
|
|
18
|
+
* - Radius: `--radius-lg` (12 px) per ssot
|
|
19
|
+
* - Padding: 24 26 per ssot
|
|
20
|
+
* - Shadow: `--shadow-lg`
|
|
21
|
+
* - Width: 340 px / max 92 vw — opinionated default per ssot;
|
|
22
|
+
* consumers can override via `className="w-[…]"` or a responsive
|
|
23
|
+
* `max-w-*` utility for wider dialogs
|
|
24
|
+
* - Overlay: `--overlay-scrim` (a black mute over the page) and
|
|
25
|
+
* a `--blur-modal` (12 px) backdrop blur
|
|
26
|
+
* - Motion: fade + zoom on open, fade + zoom out on close —
|
|
27
|
+
* standard Radix data-state animations at duration-medium
|
|
28
|
+
*
|
|
29
|
+
* Title typography: Manrope 500, 18 px, -0.012em tracking
|
|
30
|
+
* Description: 14 px, --fg-secondary, line-height 1.5
|
|
31
|
+
* Action row: flex gap-2 justify-end
|
|
32
|
+
*
|
|
33
|
+
* Usage:
|
|
34
|
+
*
|
|
35
|
+
* <Dialog open={open} onOpenChange={setOpen}>
|
|
36
|
+
* <DialogTrigger asChild><Button>Delete policy</Button></DialogTrigger>
|
|
37
|
+
* <DialogContent>
|
|
38
|
+
* <DialogHeader>
|
|
39
|
+
* <DialogTitle>Delete policy?</DialogTitle>
|
|
40
|
+
* <DialogDescription>
|
|
41
|
+
* The customer-success policy will be removed from 3 production routes.
|
|
42
|
+
* </DialogDescription>
|
|
43
|
+
* </DialogHeader>
|
|
44
|
+
* <DialogFooter>
|
|
45
|
+
* <DialogClose asChild><Button variant="ghost">Cancel</Button></DialogClose>
|
|
46
|
+
* <Button variant="danger">Delete policy</Button>
|
|
47
|
+
* </DialogFooter>
|
|
48
|
+
* </DialogContent>
|
|
49
|
+
* </Dialog>
|
|
50
|
+
*
|
|
51
|
+
* Mirrors the shadcn Dialog API exactly (Dialog / DialogTrigger /
|
|
52
|
+
* DialogPortal / DialogClose / DialogOverlay / DialogContent /
|
|
53
|
+
* DialogHeader / DialogFooter / DialogTitle / DialogDescription) so
|
|
54
|
+
* existing consumers migrate via import-path swap.
|
|
55
|
+
*/
|
|
56
|
+
function Dialog(props) {
|
|
57
|
+
return _jsx(DialogPrimitive.Root, { "data-slot": "dialog", ...props });
|
|
58
|
+
}
|
|
59
|
+
function DialogTrigger(props) {
|
|
60
|
+
return _jsx(DialogPrimitive.Trigger, { "data-slot": "dialog-trigger", ...props });
|
|
61
|
+
}
|
|
62
|
+
function DialogPortal(props) {
|
|
63
|
+
return _jsx(DialogPrimitive.Portal, { "data-slot": "dialog-portal", ...props });
|
|
64
|
+
}
|
|
65
|
+
function DialogClose(props) {
|
|
66
|
+
return _jsx(DialogPrimitive.Close, { "data-slot": "dialog-close", ...props });
|
|
67
|
+
}
|
|
68
|
+
function DialogOverlay({ className, ...props }) {
|
|
69
|
+
const scope = useThemeScope();
|
|
70
|
+
return (_jsx(DialogPrimitive.Overlay, { "data-slot": "dialog-overlay", "data-theme": scope.theme, className: cn(scope.mode,
|
|
71
|
+
// SSOT v5 scrim: the `--overlay-scrim` black mute over the page
|
|
72
|
+
// + `--blur-modal` (12 px) backdrop blur. "A MUTE, not a tint" —
|
|
73
|
+
// the black mute pulls focus to the dialog regardless of the
|
|
74
|
+
// page atmosphere underneath, while the heavier blur softens
|
|
75
|
+
// what shows through so the page feels like ambient context,
|
|
76
|
+
// not legible content competing for attention.
|
|
77
|
+
//
|
|
78
|
+
// Previously this was `color-mix(canvas, transparent 30%)` +
|
|
79
|
+
// `backdrop-blur-sm` (4 px) — a canvas tint, which read as
|
|
80
|
+
// "the page is just darker", not as a deliberate modal scrim.
|
|
81
|
+
// The SSOT calls out the difference explicitly.
|
|
82
|
+
'fixed inset-0 z-50', 'bg-[var(--overlay-scrim)]', 'backdrop-blur-[var(--blur-modal)]',
|
|
83
|
+
// Fade in/out per Radix data-state.
|
|
84
|
+
'data-[state=open]:animate-in data-[state=open]:fade-in-0', 'data-[state=closed]:animate-out data-[state=closed]:fade-out-0', 'duration-[var(--duration-medium)]', className), ...props }));
|
|
85
|
+
}
|
|
86
|
+
function DialogContent({ className, children, hideCloseButton = false, showCloseButton, ...props }) {
|
|
87
|
+
const scope = useThemeScope();
|
|
88
|
+
// The legacy/shadcn contract let consumers widen a dialog with only a
|
|
89
|
+
// `max-w-*` utility (`max-w-4xl`, `sm:max-w-md`, ...), while Checkpoint's
|
|
90
|
+
// authored dialogs commonly set an explicit `w-*` utility. Preserve both
|
|
91
|
+
// call patterns: use the 340 px SSOT width until a consumer supplies its own
|
|
92
|
+
// max-width, then make the responsive viewport width the expandable axis.
|
|
93
|
+
const hasMaxWidthOverride = /(?:^|\s)(?:[a-z0-9-]+:)*!?max-w-/.test(className ?? '');
|
|
94
|
+
return (_jsxs(DialogPortal, { children: [_jsx(DialogOverlay, {}), _jsxs(DialogPrimitive.Content, { "data-slot": "dialog-content", "data-theme": scope.theme,
|
|
95
|
+
// `checkpoint-canvas` paints the wisp / dot / grain atmosphere
|
|
96
|
+
// pseudo-elements (`::before` + `::after`) inside the dialog's
|
|
97
|
+
// own stacking context. Without it the chrome reads as a flat
|
|
98
|
+
// solid fill because Radix portals the content to
|
|
99
|
+
// `document.body`, outside the page-level `.checkpoint-canvas`
|
|
100
|
+
// subtree, so the page atmosphere paints behind the dialog and
|
|
101
|
+
// the dialog's own opaque bg covers it.
|
|
102
|
+
//
|
|
103
|
+
// The `--tex-*` inline overrides mirror the shell-layout's
|
|
104
|
+
// values so the wisp / glow / grain inside the dialog reads at
|
|
105
|
+
// the same intensity as the dashboard page. shell-layout sets
|
|
106
|
+
// these as inline CSS vars on the outermost shell div, but
|
|
107
|
+
// since Radix portals to document.body, the inline values
|
|
108
|
+
// don't inherit. The defaults baked into tokens.css
|
|
109
|
+
// are roughly half as intense (e.g. `--tex-wisp-a: 0.04` vs
|
|
110
|
+
// shell's `0.1`), so without these the wisps render invisibly
|
|
111
|
+
// against the dark `--bg-surface`.
|
|
112
|
+
//
|
|
113
|
+
// `--tex-vignette: 0` — the page-level vignette darkens
|
|
114
|
+
// viewport edges, which inside chrome would just darken the
|
|
115
|
+
// dialog's own corners. The dialog already has a containing
|
|
116
|
+
// block via its `-translate-x-1/2 -translate-y-1/2` centering
|
|
117
|
+
// transform, so the `.checkpoint-canvas::before` pseudo-element
|
|
118
|
+
// is already scoped to the dialog's bounds (no `contain: paint`
|
|
119
|
+
// needed here, unlike Sheet).
|
|
120
|
+
style: {
|
|
121
|
+
'--tex-grain': 0.03,
|
|
122
|
+
'--tex-dots': 0.036,
|
|
123
|
+
'--tex-wisp-a': 0.1,
|
|
124
|
+
'--tex-wisp-b': 0.075,
|
|
125
|
+
'--tex-glow': 0.099,
|
|
126
|
+
'--tex-vignette': 0,
|
|
127
|
+
}, className: cn(scope.mode, 'checkpoint-canvas', 'fixed left-1/2 top-1/2 z-50 -translate-x-1/2 -translate-y-1/2',
|
|
128
|
+
// Width — SSOT defaults to 340 px / max 92 vw. A max-width-only
|
|
129
|
+
// override gets a responsive viewport width so migrated shadcn
|
|
130
|
+
// consumers can actually expand; explicit w-* overrides continue to
|
|
131
|
+
// replace the 340 px default and remain capped to the viewport.
|
|
132
|
+
hasMaxWidthOverride ? 'w-[calc(100%-2rem)]' : 'w-[340px]', 'max-w-[92vw] max-h-[calc(100dvh-2rem)] overflow-y-auto',
|
|
133
|
+
// Chrome — `--bg-surface` (ink-950 = #0a0d12) is the correct
|
|
134
|
+
// floating-chrome token: one shade lighter than the canvas
|
|
135
|
+
// (`--bg-canvas` = ink-1000) so the dialog reads as elevated,
|
|
136
|
+
// and one shade darker than `--bg-elevated` (ink-900) so
|
|
137
|
+
// inner cards / sections using `--bg-elevated` step UP from
|
|
138
|
+
// the dialog's surface (canvas → surface → elevated). The
|
|
139
|
+
// earlier `--bg-elevated` mapping inverted that hierarchy.
|
|
140
|
+
'bg-[var(--bg-surface)] border border-[color:var(--border-default)]', 'rounded-[var(--radius-lg)]', 'shadow-[var(--shadow-lg)]', 'px-[26px] py-6',
|
|
141
|
+
// Type fallback so descendants read in checkpoint chrome
|
|
142
|
+
// even if the consumer forgets to set font-family.
|
|
143
|
+
'font-checkpoint-sans text-ink',
|
|
144
|
+
// Motion — fade + zoom on enter / exit. Slightly slower
|
|
145
|
+
// than tooltips since modals are heavier UI moments.
|
|
146
|
+
'data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95', 'data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95', 'duration-[var(--duration-medium)] ease-[var(--ease-out)]',
|
|
147
|
+
// A11y focus ring.
|
|
148
|
+
'focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-ring', className), ...props, children: [children, !hideCloseButton && showCloseButton !== false ? (_jsx(DialogPrimitive.Close
|
|
149
|
+
// Tiny X button absolutely positioned in the corner.
|
|
150
|
+
// Inherits `currentColor` for the icon so the muted →
|
|
151
|
+
// primary hover treatment cascades through.
|
|
152
|
+
, {
|
|
153
|
+
// Tiny X button absolutely positioned in the corner.
|
|
154
|
+
// Inherits `currentColor` for the icon so the muted →
|
|
155
|
+
// primary hover treatment cascades through.
|
|
156
|
+
className: cn('absolute right-3 top-3', 'h-6 w-6 inline-grid place-items-center', 'rounded-sm text-[color:var(--fg-muted)]', 'hover:text-[color:var(--fg-primary)] hover:bg-[color:var(--surface-default)]', 'focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring', 'transition-colors duration-[var(--duration-fast)]'), "aria-label": "Close dialog", children: _jsx(X, { className: "h-3.5 w-3.5", strokeWidth: 2 }) })) : null] })] }));
|
|
157
|
+
}
|
|
158
|
+
function DialogHeader({ className, ...props }) {
|
|
159
|
+
return (_jsx("div", { "data-slot": "dialog-header", className: cn('flex min-w-0 flex-col gap-1.5 mb-4', className), ...props }));
|
|
160
|
+
}
|
|
161
|
+
function DialogFooter({ className, ...props }) {
|
|
162
|
+
return (_jsx("div", { "data-slot": "dialog-footer", className: cn('flex justify-end gap-2 mt-5', className), ...props }));
|
|
163
|
+
}
|
|
164
|
+
function DialogTitle({ className, ...props }) {
|
|
165
|
+
return (_jsx(DialogPrimitive.Title, { "data-slot": "dialog-title",
|
|
166
|
+
// Inline style for font + size — same rationale as Tabs:
|
|
167
|
+
// feedback-v2.css resets text-transform / font-family on
|
|
168
|
+
// broad selectors. Inline binds directly to the element so
|
|
169
|
+
// the cascade can't strip it.
|
|
170
|
+
style: {
|
|
171
|
+
fontFamily: 'var(--font-display)',
|
|
172
|
+
fontSize: 'var(--text-lg)',
|
|
173
|
+
fontWeight: 'var(--font-weight-medium)',
|
|
174
|
+
letterSpacing: 'var(--tracking-tight)',
|
|
175
|
+
margin: 0,
|
|
176
|
+
}, className: cn('[overflow-wrap:anywhere] text-[color:var(--fg-primary)]', className), ...props }));
|
|
177
|
+
}
|
|
178
|
+
function DialogDescription({ className, ...props }) {
|
|
179
|
+
return (_jsx(DialogPrimitive.Description, { "data-slot": "dialog-description",
|
|
180
|
+
// --text-base (15px): descriptions are body copy, and the SSOT moved
|
|
181
|
+
// body 14→15px. Design-ruled during WS8; +1px from the old raw 14.
|
|
182
|
+
className: cn('text-[length:var(--text-base)] leading-normal text-[color:var(--fg-secondary)]', 'm-0 [overflow-wrap:anywhere]', className), ...props }));
|
|
183
|
+
}
|
|
184
|
+
export { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, };
|
|
185
|
+
//# sourceMappingURL=Dialog.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Dialog.js","sourceRoot":"","sources":["../src/Dialog.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,eAAe,MAAM,wBAAwB,CAAC;AAC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CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAsD;IAC9F,OAAO,CACL,KAAC,eAAe,CAAC,KAAK,iBACV,cAAc;QACxB,yDAAyD;QACzD,yDAAyD;QACzD,2DAA2D;QAC3D,8BAA8B;QAC9B,KAAK,EAAE;YACL,UAAU,EAAE,qBAAqB;YACjC,QAAQ,EAAE,gBAAgB;YAC1B,UAAU,EAAE,2BAA2B;YACvC,aAAa,EAAE,uBAAuB;YACtC,MAAM,EAAE,CAAC;SACV,EACD,SAAS,EAAE,EAAE,CAAC,yDAAyD,EAAE,SAAS,CAAC,KAC/E,KAAK,GACT,CACH,CAAC;AACJ,CAAC;AAED,SAAS,iBAAiB,CAAC,EACzB,SAAS,EACT,GAAG,KAAK,EACiD;IACzD,OAAO,CACL,KAAC,eAAe,CAAC,WAAW,iBAChB,oBAAoB;QAC9B,qEAAqE;QACrE,mEAAmE;QACnE,SAAS,EAAE,EAAE,CACX,gFAAgF,EAChF,8BAA8B,EAC9B,SAAS,CACV,KACG,KAAK,GACT,CACH,CAAC;AACJ,CAAC;AAED,OAAO,EACL,MAAM,EACN,WAAW,EACX,aAAa,EACb,iBAAiB,EACjB,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,YAAY,EACZ,WAAW,EACX,aAAa,GACd,CAAC"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
|
|
3
|
+
/**
|
|
4
|
+
* Checkpoint · DropdownMenu
|
|
5
|
+
*
|
|
6
|
+
* Wraps Radix DropdownMenu with checkpoint chrome. Behavior layer
|
|
7
|
+
* (open/close, roving focus, typeahead, submenu timers, ARIA, portal)
|
|
8
|
+
* is Radix; look layer is ours:
|
|
9
|
+
*
|
|
10
|
+
* - Surface: `--bg-elevated` + 1px `--border-default`, `--radius-md`
|
|
11
|
+
* corners, `--shadow-lg` — same floating-chrome recipe as Popover
|
|
12
|
+
* - Items: `--radius-sm` rows, `--surface-default` focus/highlight
|
|
13
|
+
* fill, `--fg-secondary` default text stepping up to
|
|
14
|
+
* `--fg-primary` on focus; `variant="destructive"` swaps in
|
|
15
|
+
* `--deny` text over a `--deny-soft` focus fill
|
|
16
|
+
* - Motion: fade + zoom + slide-from-side per Radix data-side, at
|
|
17
|
+
* `--duration-fast` — menus are quick, low-weight UI moments
|
|
18
|
+
* compared to the `--duration-medium` Dialog/Sheet use
|
|
19
|
+
*
|
|
20
|
+
* `DropdownMenuContent` and `DropdownMenuSubContent` both portal to
|
|
21
|
+
* `document.body` — outside the ShellLayout's `data-theme` scope —
|
|
22
|
+
* so each stamps the RESOLVED scope from `useThemeScope()` itself:
|
|
23
|
+
* `data-theme` names the theme and the `dark`/`light` class picks the
|
|
24
|
+
* mode. See `src/Dialog.tsx` for the full rationale.
|
|
25
|
+
* A caller may override the theme via the `data-theme` prop (spread
|
|
26
|
+
* after the default); to force a mode, wrap the tree in
|
|
27
|
+
* `ThemeScopeProvider`.
|
|
28
|
+
*
|
|
29
|
+
* Mirrors the shadcn DropdownMenu API exactly (DropdownMenu /
|
|
30
|
+
* DropdownMenuPortal / DropdownMenuTrigger / DropdownMenuContent /
|
|
31
|
+
* DropdownMenuGroup / DropdownMenuLabel / DropdownMenuItem /
|
|
32
|
+
* DropdownMenuCheckboxItem / DropdownMenuRadioGroup /
|
|
33
|
+
* DropdownMenuRadioItem / DropdownMenuSeparator /
|
|
34
|
+
* DropdownMenuShortcut / DropdownMenuSub / DropdownMenuSubTrigger /
|
|
35
|
+
* DropdownMenuSubContent) so existing consumers migrate via
|
|
36
|
+
* import-path swap.
|
|
37
|
+
*
|
|
38
|
+
* Usage:
|
|
39
|
+
*
|
|
40
|
+
* <DropdownMenu>
|
|
41
|
+
* <DropdownMenuTrigger asChild><Button variant="ghost">⋯</Button></DropdownMenuTrigger>
|
|
42
|
+
* <DropdownMenuContent align="end">
|
|
43
|
+
* <DropdownMenuLabel>Actions</DropdownMenuLabel>
|
|
44
|
+
* <DropdownMenuItem onSelect={rename}>Rename</DropdownMenuItem>
|
|
45
|
+
* <DropdownMenuSeparator />
|
|
46
|
+
* <DropdownMenuItem variant="destructive" onSelect={remove}>Delete</DropdownMenuItem>
|
|
47
|
+
* </DropdownMenuContent>
|
|
48
|
+
* </DropdownMenu>
|
|
49
|
+
*/
|
|
50
|
+
declare function DropdownMenu(props: React.ComponentProps<typeof DropdownMenuPrimitive.Root>): React.JSX.Element;
|
|
51
|
+
declare function DropdownMenuPortal(props: React.ComponentProps<typeof DropdownMenuPrimitive.Portal>): React.JSX.Element;
|
|
52
|
+
declare function DropdownMenuTrigger(props: React.ComponentProps<typeof DropdownMenuPrimitive.Trigger>): React.JSX.Element;
|
|
53
|
+
interface DropdownMenuContentProps extends React.ComponentProps<typeof DropdownMenuPrimitive.Content> {
|
|
54
|
+
/** Override the theme stamped by default; the mode class still follows the scope. */
|
|
55
|
+
'data-theme'?: string;
|
|
56
|
+
}
|
|
57
|
+
declare function DropdownMenuContent({ className, sideOffset, ...props }: DropdownMenuContentProps): React.JSX.Element;
|
|
58
|
+
declare function DropdownMenuGroup(props: React.ComponentProps<typeof DropdownMenuPrimitive.Group>): React.JSX.Element;
|
|
59
|
+
declare function DropdownMenuLabel({ className, inset, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Label> & {
|
|
60
|
+
inset?: boolean;
|
|
61
|
+
}): React.JSX.Element;
|
|
62
|
+
declare function DropdownMenuItem({ className, inset, variant, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Item> & {
|
|
63
|
+
inset?: boolean;
|
|
64
|
+
variant?: 'default' | 'destructive';
|
|
65
|
+
}): React.JSX.Element;
|
|
66
|
+
declare function DropdownMenuCheckboxItem({ className, children, checked, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.CheckboxItem>): React.JSX.Element;
|
|
67
|
+
declare function DropdownMenuRadioGroup(props: React.ComponentProps<typeof DropdownMenuPrimitive.RadioGroup>): React.JSX.Element;
|
|
68
|
+
declare function DropdownMenuRadioItem({ className, children, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.RadioItem>): React.JSX.Element;
|
|
69
|
+
declare function DropdownMenuSeparator({ className, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Separator>): React.JSX.Element;
|
|
70
|
+
declare function DropdownMenuShortcut({ className, ...props }: React.ComponentProps<'span'>): React.JSX.Element;
|
|
71
|
+
declare function DropdownMenuSub(props: React.ComponentProps<typeof DropdownMenuPrimitive.Sub>): React.JSX.Element;
|
|
72
|
+
declare function DropdownMenuSubTrigger({ className, inset, children, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.SubTrigger> & {
|
|
73
|
+
inset?: boolean;
|
|
74
|
+
}): React.JSX.Element;
|
|
75
|
+
interface DropdownMenuSubContentProps extends React.ComponentProps<typeof DropdownMenuPrimitive.SubContent> {
|
|
76
|
+
/** Override the theme stamped by default; the mode class still follows the scope. */
|
|
77
|
+
'data-theme'?: string;
|
|
78
|
+
}
|
|
79
|
+
declare function DropdownMenuSubContent({ className, ...props }: DropdownMenuSubContentProps): React.JSX.Element;
|
|
80
|
+
export { DropdownMenu, DropdownMenuPortal, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuGroup, DropdownMenuLabel, DropdownMenuItem, DropdownMenuCheckboxItem, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubTrigger, DropdownMenuSubContent, };
|
|
81
|
+
export type { DropdownMenuContentProps, DropdownMenuSubContentProps };
|
|
82
|
+
//# sourceMappingURL=DropdownMenu.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DropdownMenu.d.ts","sourceRoot":"","sources":["../src/DropdownMenu.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,qBAAqB,MAAM,+BAA+B,CAAC;AAMvE;;;;;;;;;;;;;;;;;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AqB,EACrB,qBAAqB,EACrB,oBAAoB,EACpB,eAAe,EACf,sBAAsB,EACtB,sBAAsB,GACvB,CAAC;AACF,YAAY,EAAE,wBAAwB,EAAE,2BAA2B,EAAE,CAAC"}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
|
|
5
|
+
import { CheckIcon, ChevronRightIcon, CircleIcon } from 'lucide-react';
|
|
6
|
+
import { cn } from './lib/utils.js';
|
|
7
|
+
import { useThemeScope } from './theme-scope.js';
|
|
8
|
+
/**
|
|
9
|
+
* Checkpoint · DropdownMenu
|
|
10
|
+
*
|
|
11
|
+
* Wraps Radix DropdownMenu with checkpoint chrome. Behavior layer
|
|
12
|
+
* (open/close, roving focus, typeahead, submenu timers, ARIA, portal)
|
|
13
|
+
* is Radix; look layer is ours:
|
|
14
|
+
*
|
|
15
|
+
* - Surface: `--bg-elevated` + 1px `--border-default`, `--radius-md`
|
|
16
|
+
* corners, `--shadow-lg` — same floating-chrome recipe as Popover
|
|
17
|
+
* - Items: `--radius-sm` rows, `--surface-default` focus/highlight
|
|
18
|
+
* fill, `--fg-secondary` default text stepping up to
|
|
19
|
+
* `--fg-primary` on focus; `variant="destructive"` swaps in
|
|
20
|
+
* `--deny` text over a `--deny-soft` focus fill
|
|
21
|
+
* - Motion: fade + zoom + slide-from-side per Radix data-side, at
|
|
22
|
+
* `--duration-fast` — menus are quick, low-weight UI moments
|
|
23
|
+
* compared to the `--duration-medium` Dialog/Sheet use
|
|
24
|
+
*
|
|
25
|
+
* `DropdownMenuContent` and `DropdownMenuSubContent` both portal to
|
|
26
|
+
* `document.body` — outside the ShellLayout's `data-theme` scope —
|
|
27
|
+
* so each stamps the RESOLVED scope from `useThemeScope()` itself:
|
|
28
|
+
* `data-theme` names the theme and the `dark`/`light` class picks the
|
|
29
|
+
* mode. See `src/Dialog.tsx` for the full rationale.
|
|
30
|
+
* A caller may override the theme via the `data-theme` prop (spread
|
|
31
|
+
* after the default); to force a mode, wrap the tree in
|
|
32
|
+
* `ThemeScopeProvider`.
|
|
33
|
+
*
|
|
34
|
+
* Mirrors the shadcn DropdownMenu API exactly (DropdownMenu /
|
|
35
|
+
* DropdownMenuPortal / DropdownMenuTrigger / DropdownMenuContent /
|
|
36
|
+
* DropdownMenuGroup / DropdownMenuLabel / DropdownMenuItem /
|
|
37
|
+
* DropdownMenuCheckboxItem / DropdownMenuRadioGroup /
|
|
38
|
+
* DropdownMenuRadioItem / DropdownMenuSeparator /
|
|
39
|
+
* DropdownMenuShortcut / DropdownMenuSub / DropdownMenuSubTrigger /
|
|
40
|
+
* DropdownMenuSubContent) so existing consumers migrate via
|
|
41
|
+
* import-path swap.
|
|
42
|
+
*
|
|
43
|
+
* Usage:
|
|
44
|
+
*
|
|
45
|
+
* <DropdownMenu>
|
|
46
|
+
* <DropdownMenuTrigger asChild><Button variant="ghost">⋯</Button></DropdownMenuTrigger>
|
|
47
|
+
* <DropdownMenuContent align="end">
|
|
48
|
+
* <DropdownMenuLabel>Actions</DropdownMenuLabel>
|
|
49
|
+
* <DropdownMenuItem onSelect={rename}>Rename</DropdownMenuItem>
|
|
50
|
+
* <DropdownMenuSeparator />
|
|
51
|
+
* <DropdownMenuItem variant="destructive" onSelect={remove}>Delete</DropdownMenuItem>
|
|
52
|
+
* </DropdownMenuContent>
|
|
53
|
+
* </DropdownMenu>
|
|
54
|
+
*/
|
|
55
|
+
function DropdownMenu(props) {
|
|
56
|
+
return _jsx(DropdownMenuPrimitive.Root, { "data-slot": "dropdown-menu", ...props });
|
|
57
|
+
}
|
|
58
|
+
function DropdownMenuPortal(props) {
|
|
59
|
+
return _jsx(DropdownMenuPrimitive.Portal, { "data-slot": "dropdown-menu-portal", ...props });
|
|
60
|
+
}
|
|
61
|
+
function DropdownMenuTrigger(props) {
|
|
62
|
+
return _jsx(DropdownMenuPrimitive.Trigger, { "data-slot": "dropdown-menu-trigger", ...props });
|
|
63
|
+
}
|
|
64
|
+
function DropdownMenuContent({ className, sideOffset = 4, ...props }) {
|
|
65
|
+
const scope = useThemeScope();
|
|
66
|
+
return (_jsx(DropdownMenuPrimitive.Portal, { children: _jsx(DropdownMenuPrimitive.Content, { "data-slot": "dropdown-menu-content", "data-theme": scope.theme, sideOffset: sideOffset, className: cn(scope.mode, 'box-border max-w-[min(var(--radix-dropdown-menu-content-available-width,100vw),100vw)] whitespace-normal [overflow-wrap:anywhere]', 'z-50 min-w-[8rem] max-h-(--radix-dropdown-menu-content-available-height) overflow-x-hidden overflow-y-auto', 'origin-(--radix-dropdown-menu-content-transform-origin)', 'bg-[var(--bg-elevated)] border border-[color:var(--border-default)]', 'rounded-[var(--radius-md)]', 'shadow-[var(--shadow-lg)]', 'p-1', 'font-sans text-[length:var(--text-sm)] text-[color:var(--fg-primary)]', 'data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95', 'data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2', 'duration-[var(--duration-fast,0.15s)]', className), ...props }) }));
|
|
67
|
+
}
|
|
68
|
+
function DropdownMenuGroup(props) {
|
|
69
|
+
return _jsx(DropdownMenuPrimitive.Group, { "data-slot": "dropdown-menu-group", ...props });
|
|
70
|
+
}
|
|
71
|
+
function DropdownMenuLabel({ className, inset, ...props }) {
|
|
72
|
+
return (_jsx(DropdownMenuPrimitive.Label, { "data-slot": "dropdown-menu-label", "data-inset": inset, className: cn(
|
|
73
|
+
// Mirrors the v2 column-header vocabulary (mono, uppercase,
|
|
74
|
+
// wide tracking) rather than the item font — labels are
|
|
75
|
+
// section headings inside the menu, not actionable rows.
|
|
76
|
+
// Tertiary ink, like the shortcut: muted clears the dark menu by only
|
|
77
|
+
// 0.04 (4.54:1).
|
|
78
|
+
'px-2 py-1.5 font-mono text-[length:var(--text-eyebrow)] uppercase tracking-[var(--tracking-label)] text-[color:var(--fg-tertiary)]', 'data-[inset]:pl-8', className), ...props }));
|
|
79
|
+
}
|
|
80
|
+
function DropdownMenuItem({ className, inset, variant = 'default', ...props }) {
|
|
81
|
+
return (_jsx(DropdownMenuPrimitive.Item, { "data-slot": "dropdown-menu-item", "data-inset": inset, "data-variant": variant, className: cn('relative flex cursor-default select-none items-center gap-2', 'rounded-[var(--radius-sm)] px-2 py-1.5 text-[length:var(--text-sm)]', 'outline-none', 'text-[color:var(--fg-secondary)]', 'focus:bg-[var(--surface-default)] focus:text-[color:var(--fg-primary)]', 'data-[variant=destructive]:text-deny-text', 'data-[variant=destructive]:focus:bg-[color:var(--deny-soft)] data-[variant=destructive]:focus:text-deny-text', 'data-[disabled]:pointer-events-none data-[disabled]:opacity-50', 'data-[inset]:pl-8', '[&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0', className), ...props }));
|
|
82
|
+
}
|
|
83
|
+
function DropdownMenuCheckboxItem({ className, children, checked, ...props }) {
|
|
84
|
+
return (_jsxs(DropdownMenuPrimitive.CheckboxItem, { "data-slot": "dropdown-menu-checkbox-item", className: cn('relative flex cursor-default select-none items-center gap-2', 'rounded-[var(--radius-sm)] py-1.5 pr-2 pl-8 text-[length:var(--text-sm)]', 'outline-none', 'text-[color:var(--fg-secondary)]', 'focus:bg-[var(--surface-default)] focus:text-[color:var(--fg-primary)]', 'data-[disabled]:pointer-events-none data-[disabled]:opacity-50', '[&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0', className), checked: checked, ...props, children: [_jsx("span", { className: "pointer-events-none absolute left-2 flex size-3.5 items-center justify-center", children: _jsx(DropdownMenuPrimitive.ItemIndicator, { children: _jsx(CheckIcon, { className: "size-4" }) }) }), children] }));
|
|
85
|
+
}
|
|
86
|
+
function DropdownMenuRadioGroup(props) {
|
|
87
|
+
return _jsx(DropdownMenuPrimitive.RadioGroup, { "data-slot": "dropdown-menu-radio-group", ...props });
|
|
88
|
+
}
|
|
89
|
+
function DropdownMenuRadioItem({ className, children, ...props }) {
|
|
90
|
+
return (_jsxs(DropdownMenuPrimitive.RadioItem, { "data-slot": "dropdown-menu-radio-item", className: cn('relative flex cursor-default select-none items-center gap-2', 'rounded-[var(--radius-sm)] py-1.5 pr-2 pl-8 text-[length:var(--text-sm)]', 'outline-none', 'text-[color:var(--fg-secondary)]', 'focus:bg-[var(--surface-default)] focus:text-[color:var(--fg-primary)]', 'data-[disabled]:pointer-events-none data-[disabled]:opacity-50', '[&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0', className), ...props, children: [_jsx("span", { className: "pointer-events-none absolute left-2 flex size-3.5 items-center justify-center", children: _jsx(DropdownMenuPrimitive.ItemIndicator, { children: _jsx(CircleIcon, { className: "size-2 fill-current" }) }) }), children] }));
|
|
91
|
+
}
|
|
92
|
+
function DropdownMenuSeparator({ className, ...props }) {
|
|
93
|
+
return (_jsx(DropdownMenuPrimitive.Separator, { "data-slot": "dropdown-menu-separator", className: cn('-mx-1 my-1 h-px bg-[var(--border-subtle)]', className), ...props }));
|
|
94
|
+
}
|
|
95
|
+
function DropdownMenuShortcut({ className, ...props }) {
|
|
96
|
+
return (_jsx("span", { "data-slot": "dropdown-menu-shortcut", className: cn(
|
|
97
|
+
// Tertiary ink: the shortcut sits on the focused row, where muted is 4.44:1 in dark.
|
|
98
|
+
'ml-auto font-mono text-[length:var(--text-eyebrow)] tracking-widest text-[color:var(--fg-tertiary)]', className), ...props }));
|
|
99
|
+
}
|
|
100
|
+
function DropdownMenuSub(props) {
|
|
101
|
+
return _jsx(DropdownMenuPrimitive.Sub, { "data-slot": "dropdown-menu-sub", ...props });
|
|
102
|
+
}
|
|
103
|
+
function DropdownMenuSubTrigger({ className, inset, children, ...props }) {
|
|
104
|
+
return (_jsxs(DropdownMenuPrimitive.SubTrigger, { "data-slot": "dropdown-menu-sub-trigger", "data-inset": inset, className: cn('flex cursor-default select-none items-center', 'rounded-[var(--radius-sm)] px-2 py-1.5 text-[length:var(--text-sm)]', 'outline-none', 'text-[color:var(--fg-secondary)]', 'focus:bg-[var(--surface-default)] focus:text-[color:var(--fg-primary)]', 'data-[state=open]:bg-[var(--surface-default)] data-[state=open]:text-[color:var(--fg-primary)]', 'data-[inset]:pl-8', '[&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0', className), ...props, children: [children, _jsx(ChevronRightIcon, { className: "ml-auto size-4" })] }));
|
|
105
|
+
}
|
|
106
|
+
function DropdownMenuSubContent({ className, ...props }) {
|
|
107
|
+
const scope = useThemeScope();
|
|
108
|
+
return (_jsx(DropdownMenuPrimitive.SubContent, { "data-slot": "dropdown-menu-sub-content", "data-theme": scope.theme, className: cn(scope.mode, 'z-50 min-w-[8rem] overflow-hidden', 'origin-(--radix-dropdown-menu-content-transform-origin)', 'bg-[var(--bg-elevated)] border border-[color:var(--border-default)]', 'rounded-[var(--radius-md)]', 'shadow-[var(--shadow-lg)]', 'p-1', 'font-sans text-[length:var(--text-sm)] text-[color:var(--fg-primary)]', 'data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95', 'data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2', 'duration-[var(--duration-fast,0.15s)]', className), ...props }));
|
|
109
|
+
}
|
|
110
|
+
export { DropdownMenu, DropdownMenuPortal, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuGroup, DropdownMenuLabel, DropdownMenuItem, DropdownMenuCheckboxItem, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubTrigger, DropdownMenuSubContent, };
|
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sB,GACvB,CAAC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Checkpoint · EditorialHeading
|
|
3
|
+
*
|
|
4
|
+
* The hero headline pattern. Pairs a sans body (Manrope display)
|
|
5
|
+
* with a highlighted accent word. Two variants:
|
|
6
|
+
*
|
|
7
|
+
* - `standard` (default) — accent word renders in `--highlight`
|
|
8
|
+
* (cream on dark / brass on light) using the same Manrope
|
|
9
|
+
* family as the body. Used on Product surfaces.
|
|
10
|
+
*
|
|
11
|
+
* - `dispatch` — accent word switches to Instrument Serif italic.
|
|
12
|
+
* Reserved for the Dispatch pocket (blog, changelog, longform);
|
|
13
|
+
* don't reach for it on dashboard surfaces or the
|
|
14
|
+
* mint/violet/cream story gets muddy with serif italics.
|
|
15
|
+
*
|
|
16
|
+
* Usage:
|
|
17
|
+
*
|
|
18
|
+
* <EditorialHeading accent="share.">A vault you can</EditorialHeading>
|
|
19
|
+
* <EditorialHeading accent="trust." variant="dispatch" as="h2">
|
|
20
|
+
* The receipt you can
|
|
21
|
+
* </EditorialHeading>
|
|
22
|
+
*
|
|
23
|
+
* Sizing: fluid clamp so the hero reads at 2.5rem on phones up to
|
|
24
|
+
* 4.5rem at desktop, with a single declared tracking that holds
|
|
25
|
+
* across the range.
|
|
26
|
+
*/
|
|
27
|
+
import * as React from 'react';
|
|
28
|
+
interface EditorialHeadingProps {
|
|
29
|
+
/** The highlighted word that sits at the end of the headline. */
|
|
30
|
+
accent: string;
|
|
31
|
+
/** The non-accented body of the headline. */
|
|
32
|
+
children: React.ReactNode;
|
|
33
|
+
/** Editorial pocket (Instrument Serif italic) vs Product (sans). */
|
|
34
|
+
variant?: 'standard' | 'dispatch';
|
|
35
|
+
/** Heading level — defaults to h1; pages with prior h1 should
|
|
36
|
+
* step down to h2/h3. */
|
|
37
|
+
as?: 'h1' | 'h2' | 'h3';
|
|
38
|
+
className?: string;
|
|
39
|
+
}
|
|
40
|
+
export declare function EditorialHeading({ accent, children, variant, as: Tag, className, }: EditorialHeadingProps): React.JSX.Element;
|
|
41
|
+
export {};
|
|
42
|
+
//# sourceMappingURL=EditorialHeading.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EditorialHeading.d.ts","sourceRoot":"","sources":["../src/EditorialHeading.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,UAAU,qBAAqB;IAC7B,iEAAiE;IACjE,MAAM,EAAE,MAAM,CAAC;IACf,6CAA6C;IAC7C,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,oEAAoE;IACpE,OAAO,CAAC,EAAE,UAAU,GAAG,UAAU,CAAC;IAClC;8BAC0B;IAC1B,EAAE,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,wBAAgB,gBAAgB,CAAC,EAC/B,MAAM,EACN,QAAQ,EACR,OAAoB,EACpB,EAAE,EAAE,GAAU,EACd,SAAS,GACV,EAAE,qBAAqB,qBAsBvB"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* Checkpoint · EditorialHeading
|
|
4
|
+
*
|
|
5
|
+
* The hero headline pattern. Pairs a sans body (Manrope display)
|
|
6
|
+
* with a highlighted accent word. Two variants:
|
|
7
|
+
*
|
|
8
|
+
* - `standard` (default) — accent word renders in `--highlight`
|
|
9
|
+
* (cream on dark / brass on light) using the same Manrope
|
|
10
|
+
* family as the body. Used on Product surfaces.
|
|
11
|
+
*
|
|
12
|
+
* - `dispatch` — accent word switches to Instrument Serif italic.
|
|
13
|
+
* Reserved for the Dispatch pocket (blog, changelog, longform);
|
|
14
|
+
* don't reach for it on dashboard surfaces or the
|
|
15
|
+
* mint/violet/cream story gets muddy with serif italics.
|
|
16
|
+
*
|
|
17
|
+
* Usage:
|
|
18
|
+
*
|
|
19
|
+
* <EditorialHeading accent="share.">A vault you can</EditorialHeading>
|
|
20
|
+
* <EditorialHeading accent="trust." variant="dispatch" as="h2">
|
|
21
|
+
* The receipt you can
|
|
22
|
+
* </EditorialHeading>
|
|
23
|
+
*
|
|
24
|
+
* Sizing: fluid clamp so the hero reads at 2.5rem on phones up to
|
|
25
|
+
* 4.5rem at desktop, with a single declared tracking that holds
|
|
26
|
+
* across the range.
|
|
27
|
+
*/
|
|
28
|
+
import * as React from 'react';
|
|
29
|
+
import { cn } from './lib/utils.js';
|
|
30
|
+
export function EditorialHeading({ accent, children, variant = 'standard', as: Tag = 'h1', className, }) {
|
|
31
|
+
return (_jsxs(Tag, { className: cn('font-display font-normal text-balance text-ink', 'text-[length:var(--text-editorial)] leading-[var(--text-editorial--line-height)] tracking-[var(--tracking-h1)]', className), children: [children, ' ', _jsx("em", { className: cn(
|
|
32
|
+
// Default: brass-hi color, NO italic, same Manrope family.
|
|
33
|
+
// Cream-on-dark / brass-on-light handled by --highlight.
|
|
34
|
+
'not-italic font-display text-highlight-text', variant === 'dispatch' && 'font-editorial italic tracking-tight'), children: accent })] }));
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=EditorialHeading.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EditorialHeading.js","sourceRoot":"","sources":["../src/EditorialHeading.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,EAAE,EAAE,MAAM,gBAAgB,CAAC;AAepC,MAAM,UAAU,gBAAgB,CAAC,EAC/B,MAAM,EACN,QAAQ,EACR,OAAO,GAAG,UAAU,EACpB,EAAE,EAAE,GAAG,GAAG,IAAI,EACd,SAAS,GACa;IACtB,OAAO,CACL,MAAC,GAAG,IACF,SAAS,EAAE,EAAE,CACX,gDAAgD,EAChD,gHAAgH,EAChH,SAAS,CACV,aAEA,QAAQ,EAAE,GAAG,EACd,aACE,SAAS,EAAE,EAAE;gBACX,2DAA2D;gBAC3D,yDAAyD;gBACzD,6CAA6C,EAC7C,OAAO,KAAK,UAAU,IAAI,sCAAsC,CACjE,YAEA,MAAM,GACJ,IACD,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Checkpoint · EmptyState
|
|
4
|
+
*
|
|
5
|
+
* The "nothing here yet" treatment. Dashed border + centered glyph
|
|
6
|
+
* + title + supporting copy + single CTA. Always one action — if a
|
|
7
|
+
* surface needs two, the second is a quiet text link inside the
|
|
8
|
+
* description, not a second button. Mirrors the v4 SSOT `.demo-empty`
|
|
9
|
+
* spec.
|
|
10
|
+
*
|
|
11
|
+
* Type scale: title `text-lg` (18px, font-display/500/text-ink),
|
|
12
|
+
* description `text-sm` (14px, text-ink-subtle). Tokens file Rule 05
|
|
13
|
+
* forbids 11/13/15px in product chrome — an earlier sweep left this
|
|
14
|
+
* component below its own floor (15px/13px); retuned to the scale here.
|
|
15
|
+
*
|
|
16
|
+
* Usage:
|
|
17
|
+
*
|
|
18
|
+
* <EmptyState
|
|
19
|
+
* icon={<GridIcon />}
|
|
20
|
+
* title="No agents yet"
|
|
21
|
+
* description="When an agent makes its first request, it'll show up here with a verdict trail."
|
|
22
|
+
* >
|
|
23
|
+
* <Button variant="primary">Read the quickstart</Button>
|
|
24
|
+
* </EmptyState>
|
|
25
|
+
*
|
|
26
|
+
* The `<svg>` icon is consumer-supplied so the empty state can carry
|
|
27
|
+
* a glyph specific to the absent content (table icon for "no rows",
|
|
28
|
+
* agent icon for "no agents", etc.). Render at 36×36 stroke-1.6 per
|
|
29
|
+
* the SSOT icon spec — the wrapper sizes the icon slot, you supply
|
|
30
|
+
* the glyph.
|
|
31
|
+
*/
|
|
32
|
+
export interface EmptyStateProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'title'> {
|
|
33
|
+
icon?: React.ReactNode;
|
|
34
|
+
title: React.ReactNode;
|
|
35
|
+
description?: React.ReactNode;
|
|
36
|
+
/** CTA button(s). Conventionally a single `<Button>`. */
|
|
37
|
+
children?: React.ReactNode;
|
|
38
|
+
}
|
|
39
|
+
export declare function EmptyState({ icon, title, description, children, className, ...rest }: EmptyStateProps): React.JSX.Element;
|
|
40
|
+
//# sourceMappingURL=EmptyState.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EmptyState.d.ts","sourceRoot":"","sources":["../src/EmptyState.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAIH,MAAM,WAAW,eAAgB,SAAQ,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,OAAO,CAAC;IAC1F,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC9B,yDAAyD;IACzD,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAED,wBAAgB,UAAU,CAAC,EACzB,IAAI,EACJ,KAAK,EACL,WAAW,EACX,QAAQ,EACR,SAAS,EACT,GAAG,IAAI,EACR,EAAE,eAAe,qBAwBjB"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { cn } from './lib/utils.js';
|
|
4
|
+
export function EmptyState({ icon, title, description, children, className, ...rest }) {
|
|
5
|
+
return (_jsxs("div", { className: cn('flex flex-col items-center text-center', 'px-6 py-12 rounded-md', 'border border-dashed border-border-default', 'bg-[var(--surface-subtle)]', className), ...rest, children: [icon ? (_jsx("div", { className: "mb-3.5 h-9 w-9 text-ink-subtle [&>svg]:h-full [&>svg]:w-full", children: icon })) : null, _jsx("div", { className: "font-display text-lg font-medium text-ink mb-1.5", children: title }), description ? (_jsx("div", { className: "max-w-[42ch] text-sm leading-relaxed text-ink-subtle mb-4", children: description })) : null, children] }));
|
|
6
|
+
}
|
|
7
|
+
//# sourceMappingURL=EmptyState.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EmptyState.js","sourceRoot":"","sources":["../src/EmptyState.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,EAAE,EAAE,MAAM,gBAAgB,CAAC;AA2CpC,MAAM,UAAU,UAAU,CAAC,EACzB,IAAI,EACJ,KAAK,EACL,WAAW,EACX,QAAQ,EACR,SAAS,EACT,GAAG,IAAI,EACS;IAChB,OAAO,CACL,eACE,SAAS,EAAE,EAAE,CACX,wCAAwC,EACxC,uBAAuB,EACvB,4CAA4C,EAC5C,4BAA4B,EAC5B,SAAS,CACV,KACG,IAAI,aAEP,IAAI,CAAC,CAAC,CAAC,CACN,cAAK,SAAS,EAAC,8DAA8D,YAAE,IAAI,GAAO,CAC3F,CAAC,CAAC,CAAC,IAAI,EACR,cAAK,SAAS,EAAC,kDAAkD,YAAE,KAAK,GAAO,EAC9E,WAAW,CAAC,CAAC,CAAC,CACb,cAAK,SAAS,EAAC,2DAA2D,YACvE,WAAW,GACR,CACP,CAAC,CAAC,CAAC,IAAI,EACP,QAAQ,IACL,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Checkpoint · Eyebrow
|
|
3
|
+
*
|
|
4
|
+
* The small mono chrome label that precedes hero headlines and
|
|
5
|
+
* section titles. Always uppercase, always Geist Mono, always
|
|
6
|
+
* prefixed with an em-dash. The "— CHECKPOINT" / "— DISPATCH 04"
|
|
7
|
+
* pattern.
|
|
8
|
+
*
|
|
9
|
+
* Spec from v5: text-eyebrow (11px, `--text-eyebrow` token), font-mono,
|
|
10
|
+
* tracking-eyebrow (0.18em), uppercase. v5 used ink-faint; the default is
|
|
11
|
+
* now ink-subtle (--fg-tertiary), because ink-faint read 4.52:1 on the dark
|
|
12
|
+
* canvas and under 4.5:1 on the hover ground and most tinted ones, while
|
|
13
|
+
* ink-subtle holds 4.9:1 or better on every ground and still reads quieter
|
|
14
|
+
* than body text. Surfaces that need stronger emphasis bump the color via
|
|
15
|
+
* className.
|
|
16
|
+
*/
|
|
17
|
+
import * as React from 'react';
|
|
18
|
+
interface EyebrowProps {
|
|
19
|
+
/** Suppress the leading em-dash. Default false — the dash is
|
|
20
|
+
* load-bearing for the editorial voice. */
|
|
21
|
+
noDash?: boolean;
|
|
22
|
+
className?: string;
|
|
23
|
+
children: React.ReactNode;
|
|
24
|
+
}
|
|
25
|
+
export declare function Eyebrow({ noDash, className, children }: EyebrowProps): React.JSX.Element;
|
|
26
|
+
export {};
|
|
27
|
+
//# sourceMappingURL=Eyebrow.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Eyebrow.d.ts","sourceRoot":"","sources":["../src/Eyebrow.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,UAAU,YAAY;IACpB;gDAC4C;IAC5C,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAED,wBAAgB,OAAO,CAAC,EAAE,MAAc,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE,YAAY,qBAY5E"}
|
package/dist/Eyebrow.js
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* Checkpoint · Eyebrow
|
|
4
|
+
*
|
|
5
|
+
* The small mono chrome label that precedes hero headlines and
|
|
6
|
+
* section titles. Always uppercase, always Geist Mono, always
|
|
7
|
+
* prefixed with an em-dash. The "— CHECKPOINT" / "— DISPATCH 04"
|
|
8
|
+
* pattern.
|
|
9
|
+
*
|
|
10
|
+
* Spec from v5: text-eyebrow (11px, `--text-eyebrow` token), font-mono,
|
|
11
|
+
* tracking-eyebrow (0.18em), uppercase. v5 used ink-faint; the default is
|
|
12
|
+
* now ink-subtle (--fg-tertiary), because ink-faint read 4.52:1 on the dark
|
|
13
|
+
* canvas and under 4.5:1 on the hover ground and most tinted ones, while
|
|
14
|
+
* ink-subtle holds 4.9:1 or better on every ground and still reads quieter
|
|
15
|
+
* than body text. Surfaces that need stronger emphasis bump the color via
|
|
16
|
+
* className.
|
|
17
|
+
*/
|
|
18
|
+
import * as React from 'react';
|
|
19
|
+
import { cn } from './lib/utils.js';
|
|
20
|
+
export function Eyebrow({ noDash = false, className, children }) {
|
|
21
|
+
return (_jsxs("div", { className: cn('font-mono text-[length:var(--text-eyebrow)] uppercase tracking-[var(--tracking-eyebrow)] text-ink-subtle', className), children: [noDash ? null : _jsx("span", { "aria-hidden": "true", children: "\u2014 " }), children] }));
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=Eyebrow.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Eyebrow.js","sourceRoot":"","sources":["../src/Eyebrow.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,EAAE,EAAE,MAAM,gBAAgB,CAAC;AAUpC,MAAM,UAAU,OAAO,CAAC,EAAE,MAAM,GAAG,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAgB;IAC3E,OAAO,CACL,eACE,SAAS,EAAE,EAAE,CACX,0GAA0G,EAC1G,SAAS,CACV,aAEA,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,8BAAkB,MAAM,wBAAU,EAClD,QAAQ,IACL,CACP,CAAC;AACJ,CAAC"}
|