@vouched-id/ui 0.1.0 → 0.1.2
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/Button.d.ts +3 -3
- package/dist/Button.js +3 -3
- package/dist/Toast.d.ts +1 -1
- package/dist/VouchedLogo.d.ts +31 -0
- package/dist/VouchedLogo.d.ts.map +1 -0
- package/dist/VouchedLogo.js +215 -0
- package/dist/VouchedLogo.js.map +1 -0
- package/dist/public.d.ts +2 -1
- package/dist/public.d.ts.map +1 -1
- package/dist/public.js +2 -1
- package/dist/public.js.map +1 -1
- package/dist/theme-scope.d.ts +4 -12
- package/dist/theme-scope.d.ts.map +1 -1
- package/dist/theme-scope.js +6 -21
- package/dist/theme-scope.js.map +1 -1
- package/dist/tokens.generated.d.ts +1 -1
- package/dist/tokens.generated.js +1 -1
- package/package.json +1 -1
- package/styles/README.md +14 -12
- package/styles/base.css +2 -4
- package/styles/canvas.css +1 -1
- package/styles/colors_and_type.css +14 -14
- package/styles/primitive-skins.css +12 -12
- package/styles/semantic-bindings.css +5 -6
- package/styles/shell.css +13 -13
- package/styles/tailwind-bridge.css +1 -1
- package/styles/theme.css +1 -0
- package/styles/tokens.css +18 -29
- package/styles/vouched-logo.css +336 -0
package/dist/Button.d.ts
CHANGED
|
@@ -22,11 +22,11 @@
|
|
|
22
22
|
*
|
|
23
23
|
* Radius is `--radius-btn` (tokens.css) — the SAME token
|
|
24
24
|
* the SSOT `.btn` chrome consumes, so this primitive and the top-nav
|
|
25
|
-
* buttons cannot drift apart. NOT `rounded-md`: the
|
|
26
|
-
* `--radius-md` token is also 8px, but inside the
|
|
25
|
+
* buttons cannot drift apart. NOT `rounded-md`: the
|
|
26
|
+
* `--radius-md` token is also 8px, but inside the base theme scope the
|
|
27
27
|
* radius doctrine in shell.css flattens `.rounded-md` to `--radius-xs` (2px),
|
|
28
28
|
* which would make this component sharper than the `.btn` chrome next
|
|
29
|
-
* to it. The 8px fallback covers render scopes where the
|
|
29
|
+
* to it. The 8px fallback covers render scopes where the design system's tokens
|
|
30
30
|
* aren't mounted. Focus ring uses the brand-soft halo + brand border
|
|
31
31
|
* per the v5 accessibility commitment.
|
|
32
32
|
*/
|
package/dist/Button.js
CHANGED
|
@@ -23,11 +23,11 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
23
23
|
*
|
|
24
24
|
* Radius is `--radius-btn` (tokens.css) — the SAME token
|
|
25
25
|
* the SSOT `.btn` chrome consumes, so this primitive and the top-nav
|
|
26
|
-
* buttons cannot drift apart. NOT `rounded-md`: the
|
|
27
|
-
* `--radius-md` token is also 8px, but inside the
|
|
26
|
+
* buttons cannot drift apart. NOT `rounded-md`: the
|
|
27
|
+
* `--radius-md` token is also 8px, but inside the base theme scope the
|
|
28
28
|
* radius doctrine in shell.css flattens `.rounded-md` to `--radius-xs` (2px),
|
|
29
29
|
* which would make this component sharper than the `.btn` chrome next
|
|
30
|
-
* to it. The 8px fallback covers render scopes where the
|
|
30
|
+
* to it. The 8px fallback covers render scopes where the design system's tokens
|
|
31
31
|
* aren't mounted. Focus ring uses the brand-soft halo + brand border
|
|
32
32
|
* per the v5 accessibility commitment.
|
|
33
33
|
*/
|
package/dist/Toast.d.ts
CHANGED
|
@@ -16,7 +16,7 @@ import { Toaster as SonnerToaster, toast as sonnerToast } from 'sonner';
|
|
|
16
16
|
*
|
|
17
17
|
* Theme scope — identical problem/solution as Tooltip's portal scope.
|
|
18
18
|
* Sonner renders its container inline (not via Radix portal), but it still
|
|
19
|
-
* sits outside the `[data-theme
|
|
19
|
+
* sits outside the `[data-theme="base"]` ancestry unless we stamp
|
|
20
20
|
* the scope ourselves. `useThemeScope()` gives the theme and the mode
|
|
21
21
|
* (the nearest ThemeScopeProvider's, else next-themes') so the toast
|
|
22
22
|
* chrome follows the shell's active theme instead of being pinned to dark.
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export type VouchedLogoPulseKind = 'vouch' | 'alert';
|
|
3
|
+
/**
|
|
4
|
+
* A one-shot outcome for the mark to play. `id` tells two pulses of the same
|
|
5
|
+
* kind apart, so a second save that goes through plays again.
|
|
6
|
+
*/
|
|
7
|
+
export interface VouchedLogoPulse {
|
|
8
|
+
kind: VouchedLogoPulseKind;
|
|
9
|
+
id: number;
|
|
10
|
+
}
|
|
11
|
+
export interface VouchedLogoProps {
|
|
12
|
+
/** Lockup height in px; widths follow the artwork. */
|
|
13
|
+
height?: number;
|
|
14
|
+
/**
|
|
15
|
+
* When compact, the letters fold away and the ring's sixth
|
|
16
|
+
* chevron takes the letter o's place, leaving the standalone brand mark.
|
|
17
|
+
*/
|
|
18
|
+
collapsed?: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* The app is waiting on work (a first load or a save). The check writes
|
|
21
|
+
* itself every lap, after a short delay so quick work never shows, and
|
|
22
|
+
* the loop finishes the lap it is in before it stops.
|
|
23
|
+
*/
|
|
24
|
+
busy?: boolean;
|
|
25
|
+
/** An outcome to play once the ring is free: vouch or alert. */
|
|
26
|
+
pulse?: VouchedLogoPulse | null;
|
|
27
|
+
decorative?: boolean;
|
|
28
|
+
className?: string;
|
|
29
|
+
}
|
|
30
|
+
export declare function VouchedLogo({ height, collapsed, busy, pulse, className, decorative, }: VouchedLogoProps): React.JSX.Element;
|
|
31
|
+
//# sourceMappingURL=VouchedLogo.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VouchedLogo.d.ts","sourceRoot":"","sources":["../src/VouchedLogo.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,MAAM,MAAM,oBAAoB,GAAG,OAAO,GAAG,OAAO,CAAC;AAErD;;;GAGG;AACH,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,oBAAoB,CAAC;IAC3B,EAAE,EAAE,MAAM,CAAC;CACZ;AA2FD,MAAM,WAAW,gBAAgB;IAC/B,sDAAsD;IACtD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;;;OAIG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,gEAAgE;IAChE,KAAK,CAAC,EAAE,gBAAgB,GAAG,IAAI,CAAC;IAChC,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AA+HD,wBAAgB,WAAW,CAAC,EAC1B,MAAW,EACX,SAAiB,EACjB,IAAY,EACZ,KAAK,EACL,SAAS,EACT,UAAkB,GACnB,EAAE,gBAAgB,qBAoGlB"}
|
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { cn } from './lib/utils.js';
|
|
5
|
+
/**
|
|
6
|
+
* Artwork bounds of the Vouched lockup:
|
|
7
|
+
* the chevron ring plus "ouched". The ring's top V doubles as the V of the
|
|
8
|
+
* word, and the letter o sits where the ring's sixth chevron would be.
|
|
9
|
+
*/
|
|
10
|
+
const LOCKUP_WIDTH = 676.3;
|
|
11
|
+
/** The ring alone ends at the right chevron's tip. */
|
|
12
|
+
const RING_WIDTH = 250.5;
|
|
13
|
+
const ARTWORK_HEIGHT = 272.2;
|
|
14
|
+
const SATELLITES = [
|
|
15
|
+
{
|
|
16
|
+
position: 'lower-right',
|
|
17
|
+
d: 'M238.1,166.4c-3.8-.2-7.5-.2-11.2-.2h-19.3c-3.6-.1-7.2-.3-10.8-.3h-23.6c-5.4,0-10.8-.2-16.2-.2s-.7,0-1.1,0v.4c4.1,7.1,8.2,14.2,12.4,21.3,5,8.6,9.9,17.1,14.9,25.7,4.5,7.7,9,15.5,13.5,23.2,2.3,4,4.6,8,7,12l14.5-25.3c-6-10.2-11.9-20.4-17.9-30.6-.2-.4-.4-.8-.6-1.3.6,0,.9-.1,1.3-.1s.2,0,.3,0h.2c4.2,0,8.3.2,12.5.3h.5c7.2,0,14.5.2,21.8.2l14.2-24.8-12.3-.2h-.1,0Z',
|
|
18
|
+
restOpacity: 0.2,
|
|
19
|
+
order: 1,
|
|
20
|
+
towardX: 0.92,
|
|
21
|
+
towardY: 0.4,
|
|
22
|
+
hue: 'var(--color-vouched-violet)',
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
position: 'bottom',
|
|
26
|
+
d: 'M175.7,252.4c-3.2-5.6-6.4-11.1-9.6-16.7-1.7-3.1-3.3-6.3-5.1-9.4-3.9-6.8-7.8-13.7-11.7-20.5-2.6-4.7-5.3-9.4-7.9-14.1-.2-.3-.4-.5-.7-.9-.2.2-.4.4-.4.5-4.1,7.2-8.2,14.3-12.3,21.4-5,8.6-9.9,17.2-14.8,25.8-4.4,7.8-8.9,15.5-13.3,23.3-2,3.4-3.9,6.9-5.9,10.4h28.8-.2c5.6-9.9,11.3-19.7,16.9-29.6.3-.4.5-.7.9-1.2h0c.3.5.6.8.8,1.1,2.1,3.8,4.2,7.7,6.3,11.5,3.4,6,6.8,12,10.1,18.1h28.9l-5.6-9.9c-1.8-3.2-3.6-6.5-5.4-9.7h.2Z',
|
|
27
|
+
restOpacity: 0.4,
|
|
28
|
+
order: 2,
|
|
29
|
+
towardX: 0.17,
|
|
30
|
+
towardY: 0.99,
|
|
31
|
+
hue: 'var(--color-vouched-magenta)',
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
position: 'lower-left',
|
|
35
|
+
d: 'M86.1,189.9H16l14.3,24.7c11.8,0,23.6-.1,35.5-.2.4,0,.8,0,1.4.2,0,.1,0,.2,0,.3h.2c-.3.5-.4.9-.6,1.2h0c-2.3,3.7-4.6,7.4-6.8,11.2-3.8,6.3-7.5,12.7-11.3,19l-.2-.3h0l14.6,25.1,6.6-11h0l.2.2c1.9-3.2,3.8-6.4,5.7-9.6,3.3-5.5,6.4-11.1,9.7-16.7,1.8-3.1,3.8-6.1,5.6-9.2,4-6.8,7.9-13.6,11.9-20.4,2.7-4.6,5.5-9.3,8.2-13.9l.3-.6h-25.2,0Z',
|
|
36
|
+
restOpacity: 0.6,
|
|
37
|
+
order: 3,
|
|
38
|
+
towardX: -0.66,
|
|
39
|
+
towardY: 0.75,
|
|
40
|
+
hue: 'var(--color-vouched-pink)',
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
position: 'upper-left',
|
|
44
|
+
d: 'M85,142.3c-5-8.6-9.9-17.1-14.9-25.7-4.5-7.8-9-15.5-13.5-23.2-2.8-4.8-5.6-9.6-8.4-14.4v-.2q0,0,0,0l-14.5,25.3c0,.2.2.4.4.6,6.3,10.8,12.6,21.7,19,32.5.2.4.3.8.6,1.3h-1.4c-4.3,0-8.4-.2-12.7-.3h-1.4c-7.3,0-14.7-.2-22-.3h-1.9L0,162.7l.3.4,15.1.2h0c3.7,0,7.4.1,11.2.2h19.3c3.6,0,7.2.2,10.8.3,7.9,0,15.7,0,23.6.1,5.4,0,10.8,0,16.2.2h.9c0-.2,0-.3,0-.4-4.2-7.1-8.3-14.2-12.4-21.3h0Z',
|
|
45
|
+
restOpacity: 0.8,
|
|
46
|
+
order: 4,
|
|
47
|
+
towardX: -0.91,
|
|
48
|
+
towardY: -0.41,
|
|
49
|
+
hue: 'var(--color-vouched-sun)',
|
|
50
|
+
},
|
|
51
|
+
];
|
|
52
|
+
/** The letters of "ouched". */
|
|
53
|
+
const LETTERS = [
|
|
54
|
+
'M237.5,89.5c-1.7-5.8-4.3-11.2-8.5-15.5-8.5-8.8-18.8-13.6-31.2-13.6s-6.5.3-9.6.9c-3.4.7-6.7,1.8-9.8,3.3-6.1,2.9-11.2,7.1-15.1,12.6-6.2,8.8-8.4,18.7-7,29.4.3,2.2.8,4.3,1.4,6.4.7,2.2,1.5,4.3,2.6,6.4,1.3,2.4,2.9,4.7,4.6,6.8,6,7.3,13.3,11.8,21.8,13.9,3.3.8,6.8,1.2,10.5,1.3v.2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.1Z',
|
|
59
|
+
'M676.4,36.5c0-.8,0-1.2-1.1-1.2h-18.8c-6.3,0-1.2.2-1.2,1.2v31.6c0,9.7-.2.6-.2,1h0c-.5-.5-.9-.7-1.2-1-2.6-2.4-5.6-4.2-8.8-5.5-6.8-2.7-13.8-2.8-20.9-1.5-10.2,1.9-18.1,7.5-23.5,16.4-5.7,9.2-7.3,19.3-5.9,30,.6,5,1.9,9.8,4.4,14.3,2.9,5.1,6.4,9.7,11.3,13.2,5,3.5,10.6,5.4,16.5,6.3,4.1.6,8.2.5,12.2-.3,6.6-1.2,12.3-4.1,16.7-9.3.2-.4.5-.7.8-1,.2.4.2.7.2,1.1v7c0,.7.2,1,1,1h17.5c.8,0,.9-.3.9-1.1-.2-1.5-.2-3-.2-4.5V40.3c0-1.3.2-2.5.2-3.8h0ZM651.1,114.9c-4.5,5.5-10.4,7.9-17.5,7.1-9.6-1.1-16.6-8.8-17.6-18.7-.4-4.6.3-8.9,2.2-12.9,2.8-5.8,7.5-9.4,13.8-10.6,7.3-1.4,13.7.6,18.6,6.3,3.6,4.1,5,9.2,5,13.1,0,6.8-1.2,11.6-4.5,15.7Z',
|
|
60
|
+
];
|
|
61
|
+
/**
|
|
62
|
+
* The check's centerline, which the mask's ink stroke follows: from just
|
|
63
|
+
* above the short arm's top, down to the joint, then up past the long
|
|
64
|
+
* arm's top. Measured from V_PATH: the short arm tops out at y 52.7 (x 64
|
|
65
|
+
* to 93.1), the long arm at y 0 (x 162.7 to 192.3), and the joint sits
|
|
66
|
+
* between the inner notch (y 87.4) and the outer point (y 139). Each end
|
|
67
|
+
* runs 12 units past its arm so the square cap clears the slanted top.
|
|
68
|
+
*/
|
|
69
|
+
const CHECK_INK_PATH = 'M72.7,42.3 L112.8,113 L183.5,-10.4';
|
|
70
|
+
/** Wider than either arm (about 26 units across) so the ink covers it. */
|
|
71
|
+
const CHECK_INK_WIDTH = 40;
|
|
72
|
+
const V_PATH = 'M64,52.7l8.3,14.9c1.8,3.2,3.6,6.5,5.4,9.8,3.2,5.6,6.4,11.1,9.6,16.7,1.8,3.1,3.4,6.3,5.2,9.4,3.9,6.8,7.8,13.7,11.7,20.5,2.7,4.7,5.3,9.4,7.9,14.1.2.3.4.6.7.9.2-.3.3-.4.4-.5,4.1-7.1,8.2-14.2,12.3-21.3,4.9-8.6,9.9-17.2,14.8-25.8,4.4-7.8,8.9-15.5,13.3-23.3,4.4-7.8,8.9-15.5,13.3-23.3,1.9-3.4,3.8-6.9,5.7-10.3,3.6-6.2,7.3-12.5,10.9-18.7,2.9-5,5.6-10.1,8.5-15.1.2-.3.3-.6.3-.8h-28.9s0,.1-.1.2h0c-.8,1.4-1.6,2.8-2.4,4.1-.8,1.4-1.6,2.8-2.5,4.3-1.5,2.5-2.9,5.1-4.4,7.6-1,1.7-2,3.5-3,5.2-6.3,10.9-12.4,21.9-18.7,32.9v.2c-6.2,10.9-12.4,21.8-18.7,32.7-.2.4-.5.7-.8,1.2-.3-.5-.6-.8-.8-1.1-2.1-3.8-4.2-7.7-6.3-11.5-3.8-6.8-7.6-13.6-11.4-20.4h0l-1.2-2.3v-.2h-29.1Z';
|
|
73
|
+
const LOADER_ANIMATION = /^v-logo-load-/;
|
|
74
|
+
const PULSE_END_ANIMATION = /^v-logo-(vouch-v|alert)$/;
|
|
75
|
+
function isOnTheV(event) {
|
|
76
|
+
return event.target instanceof Element && event.target.classList.contains('v-logo-v');
|
|
77
|
+
}
|
|
78
|
+
function prefersReducedMotion() {
|
|
79
|
+
return (typeof window !== 'undefined' &&
|
|
80
|
+
typeof window.matchMedia === 'function' &&
|
|
81
|
+
window.matchMedia('(prefers-reduced-motion: reduce)').matches);
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Turns `busy` and `pulse` into the lockup's data-busy and data-pulse.
|
|
85
|
+
*
|
|
86
|
+
* The loop stops only on the V's cycle boundary, where every chevron is at
|
|
87
|
+
* rest, so the mark never snaps mid-sweep; if the loop never became visible
|
|
88
|
+
* (the work beat --v-logo-load-delay) it stops at once. A pulse that arrives while
|
|
89
|
+
* the ring is looping waits for it, so a save reads: working, then vouched.
|
|
90
|
+
* Starts idle on the first render so the server markup matches.
|
|
91
|
+
*/
|
|
92
|
+
function useMarkMotion(busy, pulse) {
|
|
93
|
+
const [looping, setLooping] = React.useState(false);
|
|
94
|
+
const [activePulse, setActivePulse] = React.useState(null);
|
|
95
|
+
const loopingRef = React.useRef(false);
|
|
96
|
+
const loopVisibleRef = React.useRef(false);
|
|
97
|
+
const stopRequestedRef = React.useRef(false);
|
|
98
|
+
const queuedPulseRef = React.useRef(null);
|
|
99
|
+
const seenPulseIdRef = React.useRef(null);
|
|
100
|
+
const frameRef = React.useRef(null);
|
|
101
|
+
React.useEffect(() => {
|
|
102
|
+
const preference = window.matchMedia?.('(prefers-reduced-motion: reduce)');
|
|
103
|
+
function onPreferenceChange(event) {
|
|
104
|
+
if (!event.matches)
|
|
105
|
+
return;
|
|
106
|
+
queuedPulseRef.current = null;
|
|
107
|
+
loopVisibleRef.current = false;
|
|
108
|
+
setActivePulse(null);
|
|
109
|
+
if (stopRequestedRef.current) {
|
|
110
|
+
loopingRef.current = false;
|
|
111
|
+
setLooping(false);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
preference?.addEventListener('change', onPreferenceChange);
|
|
115
|
+
return () => {
|
|
116
|
+
preference?.removeEventListener('change', onPreferenceChange);
|
|
117
|
+
if (frameRef.current !== null) {
|
|
118
|
+
window.cancelAnimationFrame(frameRef.current);
|
|
119
|
+
frameRef.current = null;
|
|
120
|
+
seenPulseIdRef.current = null;
|
|
121
|
+
}
|
|
122
|
+
};
|
|
123
|
+
}, []);
|
|
124
|
+
const playPulse = React.useCallback((kind) => {
|
|
125
|
+
// Clear first, then set on the next frame, so the same kind replays.
|
|
126
|
+
// Work that starts in between wins: the loop never runs under a pulse.
|
|
127
|
+
setActivePulse(null);
|
|
128
|
+
if (frameRef.current !== null)
|
|
129
|
+
window.cancelAnimationFrame(frameRef.current);
|
|
130
|
+
frameRef.current = window.requestAnimationFrame(() => {
|
|
131
|
+
frameRef.current = null;
|
|
132
|
+
if (!loopingRef.current && !prefersReducedMotion())
|
|
133
|
+
setActivePulse(kind);
|
|
134
|
+
});
|
|
135
|
+
}, []);
|
|
136
|
+
React.useEffect(() => {
|
|
137
|
+
if (busy) {
|
|
138
|
+
stopRequestedRef.current = false;
|
|
139
|
+
loopingRef.current = true;
|
|
140
|
+
setActivePulse(null);
|
|
141
|
+
setLooping(true);
|
|
142
|
+
return;
|
|
143
|
+
}
|
|
144
|
+
if (!loopingRef.current)
|
|
145
|
+
return;
|
|
146
|
+
// Under reduced motion no animation runs, so no lap boundary will come
|
|
147
|
+
// (it may have switched on mid-loop): stop now instead of waiting.
|
|
148
|
+
if (loopVisibleRef.current && !prefersReducedMotion()) {
|
|
149
|
+
stopRequestedRef.current = true;
|
|
150
|
+
return;
|
|
151
|
+
}
|
|
152
|
+
loopingRef.current = false;
|
|
153
|
+
setLooping(false);
|
|
154
|
+
}, [busy]);
|
|
155
|
+
React.useEffect(() => {
|
|
156
|
+
if (looping)
|
|
157
|
+
return;
|
|
158
|
+
loopVisibleRef.current = false;
|
|
159
|
+
stopRequestedRef.current = false;
|
|
160
|
+
const queued = queuedPulseRef.current;
|
|
161
|
+
queuedPulseRef.current = null;
|
|
162
|
+
if (queued)
|
|
163
|
+
playPulse(queued);
|
|
164
|
+
}, [looping, playPulse]);
|
|
165
|
+
React.useEffect(() => {
|
|
166
|
+
if (!pulse || pulse.id === seenPulseIdRef.current)
|
|
167
|
+
return;
|
|
168
|
+
seenPulseIdRef.current = pulse.id;
|
|
169
|
+
if (prefersReducedMotion())
|
|
170
|
+
return;
|
|
171
|
+
if (loopingRef.current) {
|
|
172
|
+
queuedPulseRef.current = pulse.kind;
|
|
173
|
+
return;
|
|
174
|
+
}
|
|
175
|
+
playPulse(pulse.kind);
|
|
176
|
+
}, [pulse, playPulse]);
|
|
177
|
+
const onAnimationStart = React.useCallback((event) => {
|
|
178
|
+
if (LOADER_ANIMATION.test(event.animationName))
|
|
179
|
+
loopVisibleRef.current = true;
|
|
180
|
+
}, []);
|
|
181
|
+
const onAnimationIteration = React.useCallback((event) => {
|
|
182
|
+
if (!stopRequestedRef.current || !isOnTheV(event))
|
|
183
|
+
return;
|
|
184
|
+
if (!LOADER_ANIMATION.test(event.animationName))
|
|
185
|
+
return;
|
|
186
|
+
loopingRef.current = false;
|
|
187
|
+
setLooping(false);
|
|
188
|
+
}, []);
|
|
189
|
+
const onAnimationEnd = React.useCallback((event) => {
|
|
190
|
+
if (isOnTheV(event) && PULSE_END_ANIMATION.test(event.animationName))
|
|
191
|
+
setActivePulse(null);
|
|
192
|
+
}, []);
|
|
193
|
+
return { looping, activePulse, onAnimationStart, onAnimationIteration, onAnimationEnd };
|
|
194
|
+
}
|
|
195
|
+
export function VouchedLogo({ height = 40, collapsed = false, busy = false, pulse, className, decorative = false, }) {
|
|
196
|
+
const motion = useMarkMotion(busy, pulse);
|
|
197
|
+
// url(#id) breaks on the colons and guillemets React puts in useId values.
|
|
198
|
+
const maskId = `v-logo-check-${React.useId().replace(/[^a-zA-Z0-9_-]/g, '')}`;
|
|
199
|
+
const scale = height / ARTWORK_HEIGHT;
|
|
200
|
+
const style = {
|
|
201
|
+
'--v-logo-height': `${height}px`,
|
|
202
|
+
'--v-logo-width-full': `${Math.round(LOCKUP_WIDTH * scale)}px`,
|
|
203
|
+
'--v-logo-width-ring': `${Math.round(RING_WIDTH * scale)}px`,
|
|
204
|
+
};
|
|
205
|
+
return (_jsx("span", { className: cn('v-logo-lockup', className), "data-collapsed": collapsed ? 'true' : undefined, "data-busy": motion.looping ? 'true' : undefined, "data-pulse": motion.activePulse ?? undefined, style: style, onAnimationStart: motion.onAnimationStart, onAnimationIteration: motion.onAnimationIteration, onAnimationEnd: motion.onAnimationEnd, children: _jsx("span", { className: "v-logo-clip", children: _jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: `0 0 ${LOCKUP_WIDTH} ${ARTWORK_HEIGHT}`, height: height, width: Math.round(LOCKUP_WIDTH * scale), fill: "var(--kya-mark)", role: decorative ? undefined : 'img', "aria-hidden": decorative || undefined, "aria-label": decorative ? undefined : 'Vouched', className: "v-logo-art", children: [_jsx("defs", { children: _jsx("mask", { id: maskId, className: "v-logo-check-mask", maskUnits: "userSpaceOnUse", x: -20, y: -40, width: LOCKUP_WIDTH + 40, height: ARTWORK_HEIGHT + 80, children: _jsx("path", { className: "v-logo-check-ink", d: CHECK_INK_PATH, pathLength: 1, strokeWidth: CHECK_INK_WIDTH, strokeLinejoin: "miter" }) }) }), SATELLITES.map((satellite) => (_jsx("g", { className: "v-logo-arrive", style: {
|
|
206
|
+
'--v-logo-order': satellite.order,
|
|
207
|
+
'--v-logo-toward-x': satellite.towardX,
|
|
208
|
+
'--v-logo-toward-y': satellite.towardY,
|
|
209
|
+
}, children: _jsx("path", { className: "v-logo-satellite", "data-position": satellite.position, d: satellite.d, style: {
|
|
210
|
+
'--v-logo-rest': satellite.restOpacity,
|
|
211
|
+
'--v-logo-hue': satellite.hue,
|
|
212
|
+
'--v-logo-order': satellite.order,
|
|
213
|
+
} }) }, satellite.position))), _jsx("path", { className: "v-logo-sixth", d: "M86.1,189.9H16l14.3,24.7c11.8,0,23.6-.1,35.5-.2.4,0,.8,0,1.4.2,0,.1,0,.2,0,.3h.2c-.3.5-.4.9-.6,1.2h0c-2.3,3.7-4.6,7.4-6.8,11.2-3.8,6.3-7.5,12.7-11.3,19l-.2-.3h0l14.6,25.1,6.6-11h0l.2.2c1.9-3.2,3.8-6.4,5.7-9.6,3.3-5.5,6.4-11.1,9.7-16.7,1.8-3.1,3.8-6.1,5.6-9.2,4-6.8,7.9-13.6,11.9-20.4,2.7-4.6,5.5-9.3,8.2-13.9l.3-.6h-25.2,0Z", transform: "rotate(180 126.75 164.75)" }), _jsx("g", { className: "v-logo-letters", children: LETTERS.map((d) => (_jsx("path", { d: d }, d.slice(0, 12)))) }), _jsx("path", { className: "v-logo-v", d: V_PATH, mask: `url(#${maskId})` })] }) }) }));
|
|
214
|
+
}
|
|
215
|
+
//# sourceMappingURL=VouchedLogo.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VouchedLogo.js","sourceRoot":"","sources":["../src/VouchedLogo.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EAAE,EAAE,EAAE,MAAM,gBAAgB,CAAC;AAapC;;;;GAIG;AACH,MAAM,YAAY,GAAG,KAAK,CAAC;AAC3B,sDAAsD;AACtD,MAAM,UAAU,GAAG,KAAK,CAAC;AACzB,MAAM,cAAc,GAAG,KAAK,CAAC;AAiB7B,MAAM,UAAU,GAAyB;IACvC;QACE,QAAQ,EAAE,aAAa;QACvB,CAAC,EAAE,sWAAsW;QACzW,WAAW,EAAE,GAAG;QAChB,KAAK,EAAE,CAAC;QACR,OAAO,EAAE,IAAI;QACb,OAAO,EAAE,GAAG;QACZ,GAAG,EAAE,6BAA6B;KACnC;IACD;QACE,QAAQ,EAAE,QAAQ;QAClB,CAAC,EAAE,4ZAA4Z;QAC/Z,WAAW,EAAE,GAAG;QAChB,KAAK,EAAE,CAAC;QACR,OAAO,EAAE,IAAI;QACb,OAAO,EAAE,IAAI;QACb,GAAG,EAAE,8BAA8B;KACpC;IACD;QACE,QAAQ,EAAE,YAAY;QACtB,CAAC,EAAE,qUAAqU;QACxU,WAAW,EAAE,GAAG;QAChB,KAAK,EAAE,CAAC;QACR,OAAO,EAAE,CAAC,IAAI;QACd,OAAO,EAAE,IAAI;QACb,GAAG,EAAE,2BAA2B;KACjC;IACD;QACE,QAAQ,EAAE,YAAY;QACtB,CAAC,EAAE,uXAAuX;QAC1X,WAAW,EAAE,GAAG;QAChB,KAAK,EAAE,CAAC;QACR,OAAO,EAAE,CAAC,IAAI;QACd,OAAO,EAAE,CAAC,IAAI;QACd,GAAG,EAAE,0BAA0B;K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SAAS,CAAC,KAAK;6BACjB,GAEpB,IArBG,SAAS,CAAC,QAAQ,CAsBrB,CACL,CAAC,EAIF,eACE,SAAS,EAAC,cAAc,EACxB,CAAC,EAAC,qUAAqU,EACvU,SAAS,EAAC,2BAA2B,GACrC,EACF,YAAG,SAAS,EAAC,gBAAgB,YAC1B,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAClB,eAA2B,CAAC,EAAE,CAAC,IAApB,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAU,CACpC,CAAC,GACA,EACJ,eAAM,SAAS,EAAC,UAAU,EAAC,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,MAAM,GAAG,GAAI,IAC7D,GACD,GACF,CACR,CAAC;AACJ,CAAC"}
|
package/dist/public.d.ts
CHANGED
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
* variables instead.
|
|
14
14
|
*/
|
|
15
15
|
export { Button, Slot, buttonVariants, type ButtonProps } from './Button.js';
|
|
16
|
+
export { VouchedLogo, type VouchedLogoProps, type VouchedLogoPulse, type VouchedLogoPulseKind, } from './VouchedLogo.js';
|
|
16
17
|
export { Alert, AlertDescription, AlertTitle, alertVariants, type AlertProps } from './Alert.js';
|
|
17
18
|
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger } from './Accordion.js';
|
|
18
19
|
export { Input, type InputProps } from './Input.js';
|
|
@@ -46,7 +47,7 @@ export { Kbd, type KbdProps } from './Kbd.js';
|
|
|
46
47
|
export { EmptyState, type EmptyStateProps } from './EmptyState.js';
|
|
47
48
|
export { Skeleton, type SkeletonProps } from './Skeleton.js';
|
|
48
49
|
export { DenyGlyph, SuccessGlyph } from './_status-icons.js';
|
|
49
|
-
export { DEFAULT_THEME, ThemeScopeProvider, themeScopeProps, modeOfScope, useThemeScope,
|
|
50
|
+
export { DEFAULT_THEME, ThemeScopeProvider, themeScopeProps, modeOfScope, useThemeScope, type ThemeMode, type ThemeScope, } from './theme-scope.js';
|
|
50
51
|
export { CodeBlock, CodeToken, CodeCopyButton, type CodeBlockProps, type CodeTokenProps, type CodeTokenKind, type CodeCopyButtonProps, } from './CodeBlock.js';
|
|
51
52
|
export { InstallCommand, buildInstallCommand, type InstallCommandProps, type PackageManager, type InstallKind, } from './InstallCommand.js';
|
|
52
53
|
export { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider } from './Tooltip.js';
|
package/dist/public.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"public.d.ts","sourceRoot":"","sources":["../src/public.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,cAAc,EAAE,KAAK,WAAW,EAAE,MAAM,aAAa,CAAC;AAC7E,OAAO,EAAE,KAAK,EAAE,gBAAgB,EAAE,UAAU,EAAE,aAAa,EAAE,KAAK,UAAU,EAAE,MAAM,YAAY,CAAC;AACjG,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAC9F,OAAO,EAAE,KAAK,EAAE,KAAK,UAAU,EAAE,MAAM,YAAY,CAAC;AACpD,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAC/E,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AACvF,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAC7D,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,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Z,WAAW,EACX,UAAU,EACV,YAAY,EACZ,KAAK,iBAAiB,GACvB,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,WAAW,EACX,iBAAiB,EACjB,kBAAkB,EAClB,kBAAkB,EAClB,kBAAkB,EAClB,iBAAiB,EACjB,iBAAiB,EACjB,gBAAgB,EAChB,sBAAsB,EACtB,iBAAiB,EACjB,iBAAiB,EACjB,KAAK,uBAAuB,EAC5B,KAAK,sBAAsB,GAC5B,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,YAAY,EACZ,kBAAkB,EAClB,mBAAmB,EACnB,mBAAmB,EACnB,iBAAiB,EACjB,iBAAiB,EACjB,gBAAgB,EAChB,wBAAwB,EACxB,sBAAsB,EACtB,qBAAqB,EACrB,qBAAqB,EACrB,oBAAoB,EACpB,eAAe,EACf,sBAAsB,EACtB,sBAAsB,EACtB,KAAK,wBAAwB,EAC7B,KAAK,2BAA2B,GACjC,MAAM,mBAAmB,CAAC"}
|
package/dist/public.js
CHANGED
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
* variables instead.
|
|
14
14
|
*/
|
|
15
15
|
export { Button, Slot, buttonVariants } from './Button.js';
|
|
16
|
+
export { VouchedLogo, } from './VouchedLogo.js';
|
|
16
17
|
export { Alert, AlertDescription, AlertTitle, alertVariants } from './Alert.js';
|
|
17
18
|
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger } from './Accordion.js';
|
|
18
19
|
export { Input } from './Input.js';
|
|
@@ -48,7 +49,7 @@ export { Kbd } from './Kbd.js';
|
|
|
48
49
|
export { EmptyState } from './EmptyState.js';
|
|
49
50
|
export { Skeleton } from './Skeleton.js';
|
|
50
51
|
export { DenyGlyph, SuccessGlyph } from './_status-icons.js';
|
|
51
|
-
export { DEFAULT_THEME, ThemeScopeProvider, themeScopeProps, modeOfScope, useThemeScope,
|
|
52
|
+
export { DEFAULT_THEME, ThemeScopeProvider, themeScopeProps, modeOfScope, useThemeScope, } from './theme-scope.js';
|
|
52
53
|
// Code display — recessed ink-well code + install commands
|
|
53
54
|
export { CodeBlock, CodeToken, CodeCopyButton, } from './CodeBlock.js';
|
|
54
55
|
export { InstallCommand, buildInstallCommand, } from './InstallCommand.js';
|
package/dist/public.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"public.js","sourceRoot":"","sources":["../src/public.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,cAAc,EAAoB,MAAM,aAAa,CAAC;AAC7E,OAAO,EAAE,KAAK,EAAE,gBAAgB,EAAE,UAAU,EAAE,aAAa,EAAmB,MAAM,YAAY,CAAC;AACjG,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAC9F,OAAO,EAAE,KAAK,EAAmB,MAAM,YAAY,CAAC;AACpD,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAC/E,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AACvF,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAC7D,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EACL,YAAY,EACZ,QAAQ,EACR,IAAI,EACJ,WAAW,EACX,QAAQ,EACR,WAAW,GAKZ,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,gBAAgB,EAAE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B,EAClB,iBAAiB,EACjB,iBAAiB,EACjB,gBAAgB,EAChB,sBAAsB,EACtB,iBAAiB,EACjB,iBAAiB,GAGlB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,YAAY,EACZ,kBAAkB,EAClB,mBAAmB,EACnB,mBAAmB,EACnB,iBAAiB,EACjB,iBAAiB,EACjB,gBAAgB,EAChB,wBAAwB,EACxB,sBAAsB,EACtB,qBAAqB,EACrB,qBAAqB,EACrB,oBAAoB,EACpB,eAAe,EACf,sBAAsB,EACtB,sBAAsB,GAGvB,MAAM,mBAAmB,CAAC"}
|
package/dist/theme-scope.d.ts
CHANGED
|
@@ -12,21 +12,20 @@ export interface ThemeScope {
|
|
|
12
12
|
mode: ThemeMode;
|
|
13
13
|
}
|
|
14
14
|
/** The theme the primitives render in when no scope above them names another. */
|
|
15
|
-
export declare const DEFAULT_THEME = "
|
|
15
|
+
export declare const DEFAULT_THEME = "base";
|
|
16
16
|
/**
|
|
17
17
|
* The stamps for a scope element. Spread them on the element and merge
|
|
18
18
|
* `className` into its own classes, or set both by hand.
|
|
19
19
|
*
|
|
20
|
-
* @example <div {...themeScopeProps({ theme: '
|
|
20
|
+
* @example <div {...themeScopeProps({ theme: 'base', mode: 'dark' })} />
|
|
21
21
|
*/
|
|
22
22
|
export declare function themeScopeProps(scope: ThemeScope): {
|
|
23
23
|
'data-theme': string;
|
|
24
24
|
className: ThemeMode;
|
|
25
25
|
};
|
|
26
26
|
/**
|
|
27
|
-
* The mode a scope element selects, or undefined when it selects none
|
|
28
|
-
* mode class
|
|
29
|
-
* the theme name still read: `checkpoint` is dark, any `*-light` is light.
|
|
27
|
+
* The mode a scope element selects, or undefined when it selects none: its
|
|
28
|
+
* mode class, since the theme name never carries a mode.
|
|
30
29
|
*/
|
|
31
30
|
export declare function modeOfScope(element: Element | null | undefined): ThemeMode | undefined;
|
|
32
31
|
/**
|
|
@@ -45,11 +44,4 @@ export declare function ThemeScopeProvider({ scope, children, }: {
|
|
|
45
44
|
* ThemeScopeProvider's, else DEFAULT_THEME in the page's mode.
|
|
46
45
|
*/
|
|
47
46
|
export declare function useThemeScope(): ThemeScope;
|
|
48
|
-
/**
|
|
49
|
-
* The scope as one `data-theme` value, in the deprecated form that folds the
|
|
50
|
-
* mode into the theme name (`checkpoint` for dark, `checkpoint-light`).
|
|
51
|
-
*
|
|
52
|
-
* @deprecated Stamp `useThemeScope()` with `themeScopeProps`.
|
|
53
|
-
*/
|
|
54
|
-
export declare function useCheckpointThemeAttr(): 'checkpoint' | 'checkpoint-light';
|
|
55
47
|
//# sourceMappingURL=theme-scope.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"theme-scope.d.ts","sourceRoot":"","sources":["../src/theme-scope.ts"],"names":[],"mappings":"AAEA,OAAO,EAA4C,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAGjF;;;;;;GAMG;AACH,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG,OAAO,CAAC;AAEzC,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,SAAS,CAAC;CACjB;AAED,iFAAiF;AACjF,eAAO,MAAM,aAAa,
|
|
1
|
+
{"version":3,"file":"theme-scope.d.ts","sourceRoot":"","sources":["../src/theme-scope.ts"],"names":[],"mappings":"AAEA,OAAO,EAA4C,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAGjF;;;;;;GAMG;AACH,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG,OAAO,CAAC;AAEzC,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,SAAS,CAAC;CACjB;AAED,iFAAiF;AACjF,eAAO,MAAM,aAAa,SAAS,CAAC;AAEpC;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,UAAU,GAAG;IAClD,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,SAAS,CAAC;CACtB,CAEA;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,GAAG,SAAS,GAAG,SAAS,GAAG,SAAS,CAKtF;AAID;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,EACjC,KAAK,EACL,QAAQ,GACT,EAAE;IACD,KAAK,EAAE,UAAU,CAAC;IAClB,QAAQ,EAAE,SAAS,CAAC;CACrB,8FAEA;AA4BD;;;GAGG;AACH,wBAAgB,aAAa,IAAI,UAAU,CAI1C"}
|
package/dist/theme-scope.js
CHANGED
|
@@ -2,20 +2,19 @@
|
|
|
2
2
|
import { createContext, createElement, useContext } from 'react';
|
|
3
3
|
import { useTheme } from 'next-themes';
|
|
4
4
|
/** The theme the primitives render in when no scope above them names another. */
|
|
5
|
-
export const DEFAULT_THEME = '
|
|
5
|
+
export const DEFAULT_THEME = 'base';
|
|
6
6
|
/**
|
|
7
7
|
* The stamps for a scope element. Spread them on the element and merge
|
|
8
8
|
* `className` into its own classes, or set both by hand.
|
|
9
9
|
*
|
|
10
|
-
* @example <div {...themeScopeProps({ theme: '
|
|
10
|
+
* @example <div {...themeScopeProps({ theme: 'base', mode: 'dark' })} />
|
|
11
11
|
*/
|
|
12
12
|
export function themeScopeProps(scope) {
|
|
13
13
|
return { 'data-theme': scope.theme, className: scope.mode };
|
|
14
14
|
}
|
|
15
15
|
/**
|
|
16
|
-
* The mode a scope element selects, or undefined when it selects none
|
|
17
|
-
* mode class
|
|
18
|
-
* the theme name still read: `checkpoint` is dark, any `*-light` is light.
|
|
16
|
+
* The mode a scope element selects, or undefined when it selects none: its
|
|
17
|
+
* mode class, since the theme name never carries a mode.
|
|
19
18
|
*/
|
|
20
19
|
export function modeOfScope(element) {
|
|
21
20
|
if (!element)
|
|
@@ -24,11 +23,6 @@ export function modeOfScope(element) {
|
|
|
24
23
|
return 'dark';
|
|
25
24
|
if (element.classList.contains('light'))
|
|
26
25
|
return 'light';
|
|
27
|
-
const theme = element.getAttribute('data-theme');
|
|
28
|
-
if (theme === DEFAULT_THEME)
|
|
29
|
-
return 'dark';
|
|
30
|
-
if (theme?.endsWith('-light'))
|
|
31
|
-
return 'light';
|
|
32
26
|
return undefined;
|
|
33
27
|
}
|
|
34
28
|
const ThemeScopeContext = createContext(null);
|
|
@@ -47,7 +41,7 @@ export function ThemeScopeProvider({ scope, children, }) {
|
|
|
47
41
|
*
|
|
48
42
|
* `resolvedTheme` is undefined until next-themes hydrates. A portaled surface
|
|
49
43
|
* has no scope ancestor to inherit from, so during that window it adopts the
|
|
50
|
-
* mode the pre-paint script stamped on the first
|
|
44
|
+
* mode the pre-paint script stamped on the first base theme scope in the
|
|
51
45
|
* document rather than defaulting to dark, or a dialog open before hydration
|
|
52
46
|
* would render dark chrome under a light shell. With nothing stamped it is
|
|
53
47
|
* light: brand surfaces are pinned light, and server-rendered portals must not
|
|
@@ -63,7 +57,7 @@ function usePageMode() {
|
|
|
63
57
|
if (effectiveTheme !== undefined)
|
|
64
58
|
return effectiveTheme === 'dark' ? 'dark' : 'light';
|
|
65
59
|
if (typeof document !== 'undefined') {
|
|
66
|
-
const stamped = modeOfScope(document.querySelector(
|
|
60
|
+
const stamped = modeOfScope(document.querySelector(`[data-theme='${DEFAULT_THEME}']`));
|
|
67
61
|
if (stamped)
|
|
68
62
|
return stamped;
|
|
69
63
|
}
|
|
@@ -78,13 +72,4 @@ export function useThemeScope() {
|
|
|
78
72
|
const mode = usePageMode();
|
|
79
73
|
return provided ?? { theme: DEFAULT_THEME, mode };
|
|
80
74
|
}
|
|
81
|
-
/**
|
|
82
|
-
* The scope as one `data-theme` value, in the deprecated form that folds the
|
|
83
|
-
* mode into the theme name (`checkpoint` for dark, `checkpoint-light`).
|
|
84
|
-
*
|
|
85
|
-
* @deprecated Stamp `useThemeScope()` with `themeScopeProps`.
|
|
86
|
-
*/
|
|
87
|
-
export function useCheckpointThemeAttr() {
|
|
88
|
-
return useThemeScope().mode === 'dark' ? 'checkpoint' : 'checkpoint-light';
|
|
89
|
-
}
|
|
90
75
|
//# sourceMappingURL=theme-scope.js.map
|
package/dist/theme-scope.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"theme-scope.js","sourceRoot":"","sources":["../src/theme-scope.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,UAAU,EAAkB,MAAM,OAAO,CAAC;AACjF,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAgBvC,iFAAiF;AACjF,MAAM,CAAC,MAAM,aAAa,GAAG,
|
|
1
|
+
{"version":3,"file":"theme-scope.js","sourceRoot":"","sources":["../src/theme-scope.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,UAAU,EAAkB,MAAM,OAAO,CAAC;AACjF,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAgBvC,iFAAiF;AACjF,MAAM,CAAC,MAAM,aAAa,GAAG,MAAM,CAAC;AAEpC;;;;;GAKG;AACH,MAAM,UAAU,eAAe,CAAC,KAAiB;IAI/C,OAAO,EAAE,YAAY,EAAE,KAAK,CAAC,KAAK,EAAE,SAAS,EAAE,KAAK,CAAC,IAAI,EAAE,CAAC;AAC9D,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,WAAW,CAAC,OAAmC;IAC7D,IAAI,CAAC,OAAO;QAAE,OAAO,SAAS,CAAC;IAC/B,IAAI,OAAO,CAAC,SAAS,CAAC,QAAQ,CAAC,MAAM,CAAC;QAAE,OAAO,MAAM,CAAC;IACtD,IAAI,OAAO,CAAC,SAAS,CAAC,QAAQ,CAAC,OAAO,CAAC;QAAE,OAAO,OAAO,CAAC;IACxD,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,MAAM,iBAAiB,GAAG,aAAa,CAAoB,IAAI,CAAC,CAAC;AAEjE;;;;;;GAMG;AACH,MAAM,UAAU,kBAAkB,CAAC,EACjC,KAAK,EACL,QAAQ,GAIT;IACC,OAAO,aAAa,CAAC,iBAAiB,CAAC,QAAQ,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,QAAQ,CAAC,CAAC;AAC/E,CAAC;AAED;;;;;;;;;;;GAWG;AACH,SAAS,WAAW;IAClB,MAAM,EAAE,aAAa,EAAE,WAAW,EAAE,GAAG,QAAQ,EAAE,CAAC;IAClD,uEAAuE;IACvE,wEAAwE;IACxE,8DAA8D;IAC9D,MAAM,cAAc,GAAG,WAAW,IAAI,aAAa,CAAC;IACpD,IAAI,cAAc,KAAK,SAAS;QAAE,OAAO,cAAc,KAAK,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC;IACtF,IAAI,OAAO,QAAQ,KAAK,WAAW,EAAE,CAAC;QACpC,MAAM,OAAO,GAAG,WAAW,CAAC,QAAQ,CAAC,aAAa,CAAC,gBAAgB,aAAa,IAAI,CAAC,CAAC,CAAC;QACvF,IAAI,OAAO;YAAE,OAAO,OAAO,CAAC;IAC9B,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,aAAa;IAC3B,MAAM,QAAQ,GAAG,UAAU,CAAC,iBAAiB,CAAC,CAAC;IAC/C,MAAM,IAAI,GAAG,WAAW,EAAE,CAAC;IAC3B,OAAO,QAAQ,IAAI,EAAE,KAAK,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC;AACpD,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* GENERATED - do not edit. Run `pnpm ds:generate` to refresh it.
|
|
3
3
|
*
|
|
4
|
-
* Inputs (sha256
|
|
4
|
+
* Inputs (sha256 45e0c9267f73e2ea, generator v1):
|
|
5
5
|
* - packages/ui/styles/tokens.css
|
|
6
6
|
* - packages/ui/styles/tailwind-bridge.css
|
|
7
7
|
* - packages/ui/styles/semantic-bindings.css
|
package/dist/tokens.generated.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* GENERATED - do not edit. Run `pnpm ds:generate` to refresh it.
|
|
3
3
|
*
|
|
4
|
-
* Inputs (sha256
|
|
4
|
+
* Inputs (sha256 45e0c9267f73e2ea, generator v1):
|
|
5
5
|
* - packages/ui/styles/tokens.css
|
|
6
6
|
* - packages/ui/styles/tailwind-bridge.css
|
|
7
7
|
* - packages/ui/styles/semantic-bindings.css
|
package/package.json
CHANGED
package/styles/README.md
CHANGED
|
@@ -22,9 +22,11 @@ Two sheets are opt-in: the registry ships them beside the theme, `theme.css` doe
|
|
|
22
22
|
| Bindings | `semantic-bindings.css` | The shadcn and component names, bound to the semantic tokens on every theme |
|
|
23
23
|
| Base | `base.css` | The `dark` variant, element defaults, the vertical scroll fade and the dialog motion guards |
|
|
24
24
|
| Public component contracts | `component-contracts.css` | `data-slot` and `data-variant` treatments for the primitives |
|
|
25
|
-
| Primitive skins | `primitive-skins.css` | The Avatar fallback and the Toast skin inside a
|
|
26
|
-
| Type (opt-in) | `colors_and_type.css` |
|
|
27
|
-
| Radius doctrine (opt-in) | `shell.css` | Inside a
|
|
25
|
+
| Primitive skins | `primitive-skins.css` | The Avatar fallback and the Toast skin inside a base theme scope |
|
|
26
|
+
| Type (opt-in) | `colors_and_type.css` | Heading, body and chrome assignments inside a base theme scope |
|
|
27
|
+
| Radius doctrine (opt-in) | `shell.css` | Inside a base theme scope, the medium and large Tailwind radii flatten to 2px |
|
|
28
|
+
|
|
29
|
+
The shared theme also loads `vouched-logo.css` for the logo artwork's motion and reduced-motion treatment.
|
|
28
30
|
|
|
29
31
|
Two more sheets exist only for the npm package:
|
|
30
32
|
|
|
@@ -33,21 +35,21 @@ Two more sheets exist only for the npm package:
|
|
|
33
35
|
|
|
34
36
|
## Semantic token contract
|
|
35
37
|
|
|
36
|
-
A scope carries two stamps: `data-theme` names the theme (`
|
|
37
|
-
Light semantics are defined at `:root` and on a `data-theme="
|
|
38
|
+
A scope carries two stamps: `data-theme` names the theme (`base`) and a `dark` or `light` class picks the mode.
|
|
39
|
+
Light semantics are defined at `:root` and on a `data-theme="base"` scope with the `.light` class; `.dark` selects dark mode, so next-themes' class on `<html>` sets the page mode.
|
|
38
40
|
A bare `.light` does not select light, because libraries put one on their own roots (React Flow does on every canvas).
|
|
39
|
-
The
|
|
40
|
-
Put both stamps on an element to force a subtree, for example `<div data-theme="
|
|
41
|
+
The theme-scoped rules (the Avatar fallback and Toast skin in `primitive-skins.css`, the opt-in radius doctrine in `shell.css` and type assignments in `colors_and_type.css`, the bare `--spacing` unit) apply inside an element whose `data-theme` names `base`, so an app puts `data-theme="base"` on `<html>` or its root element.
|
|
42
|
+
Put both stamps on an element to force a subtree, for example `<div data-theme="base" className="dark">` for a dark panel on a light page.
|
|
41
43
|
`themeScopeProps({ theme, mode })` returns the two stamps.
|
|
42
|
-
|
|
44
|
+
Only the class picks the mode: `data-theme="base"` without one takes its mode from the nearest ancestor that sets one.
|
|
43
45
|
|
|
44
46
|
Primitives that portal to `<body>` (Dialog, AlertDialog, Sheet, Popover, Tooltip, Select, DropdownMenu, Toast) render outside the element that carries the scope, so they stamp a scope on their own surface.
|
|
45
|
-
That scope is the nearest `ThemeScopeProvider`'s, else the
|
|
46
|
-
A subtree that forces a mode its portals should follow wraps itself in `<ThemeScopeProvider scope={{ theme: '
|
|
47
|
+
That scope is the nearest `ThemeScopeProvider`'s, else the base theme in the page's next-themes mode.
|
|
48
|
+
A subtree that forces a mode its portals should follow wraps itself in `<ThemeScopeProvider scope={{ theme: 'base', mode: 'dark' }}>` beside the stamps on its element.
|
|
47
49
|
|
|
48
50
|
Metric primitives (`--text-*`, `--spacing-*` steps, `--radius-*`, weights, tracking) are also global.
|
|
49
51
|
They intentionally shadow Tailwind's theme variables, so both `var()` consumers and compiled `text-*`/`tracking-*` utilities resolve the design system's ladder everywhere.
|
|
50
|
-
Only the bare `--spacing` base unit stays scoped to `[data-theme
|
|
52
|
+
Only the bare `--spacing` base unit stays scoped to `[data-theme="base"]` (see its in-place note in `tokens.css`).
|
|
51
53
|
|
|
52
54
|
Every design token lives in these sheets, inside `@layer base`.
|
|
53
55
|
An app declares no design token in its own stylesheet; its product tokens go in its own sheets, in the same layer.
|
|
@@ -87,7 +89,7 @@ A registry consumer imports the installed theme entry once, after Tailwind:
|
|
|
87
89
|
`shadcn init` adds the `tw-animate-css` line.
|
|
88
90
|
The theme item installs `tailwindcss-animate`, which `tailwind-bridge.css` loads with `@plugin`.
|
|
89
91
|
|
|
90
|
-
Either way, to opt in to the
|
|
92
|
+
Either way, to opt in to the theme's type assignments or the radius doctrine, import the sheet after the theme (`@vouched-id/ui/styles/colors_and_type.css` from the package, `./components/kya-ds/colors_and_type.css` from the registry; the same for `shell.css`).
|
|
91
93
|
|
|
92
94
|
The catalog imports the sheets one by one in `apps/catalog/.ladle/catalog.css`, the opt-in ones included, and loads the faces from `apps/catalog/.ladle/fonts.ts`.
|
|
93
95
|
|
package/styles/base.css
CHANGED
|
@@ -7,10 +7,8 @@
|
|
|
7
7
|
tokens.css and semantic-bindings.css, on each mode selector, so a scope on
|
|
8
8
|
<html> or any element below it owns them. */
|
|
9
9
|
|
|
10
|
-
/* `dark:` follows the `.dark` mode class.
|
|
11
|
-
|
|
12
|
-
which meant dark. */
|
|
13
|
-
@custom-variant dark (&:is(.dark *, [data-theme='checkpoint']:where(:not(.light)) *));
|
|
10
|
+
/* `dark:` follows the `.dark` mode class. */
|
|
11
|
+
@custom-variant dark (&:is(.dark *));
|
|
14
12
|
|
|
15
13
|
/* Element defaults. Utility classes and the primitives' data-slot styles
|
|
16
14
|
live in the utilities layer and override these. */
|