@dodopayments/ui 1.7.0 → 1.7.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/ai/component-registry.json +253 -13
- package/ai/component-registry.md +2 -1
- package/ai/components/app-top-bar.md +2 -2
- package/ai/components/avatar.md +3 -0
- package/ai/components/brand-logos.md +1 -1
- package/ai/components/celebration-dialog.md +66 -0
- package/ai/components/code-block.md +2 -1
- package/ai/components/data-grid.md +1 -1
- package/ai/components/list-toolbar.md +3 -1
- package/ai/components/page-header.md +13 -11
- package/ai/components/payment-logos.md +5 -4
- package/ai/components/segmented-control.md +14 -1
- package/ai/components/sidebar.md +20 -2
- package/ai/components/spinner.md +2 -0
- package/ai/skills/dodo-design/SKILL.md +11 -6
- package/dist/components/app-top-bar/app-top-bar.d.ts +2 -2
- package/dist/components/app-top-bar/app-top-bar.d.ts.map +1 -1
- package/dist/components/app-top-bar/app-top-bar.js +14 -9
- package/dist/components/app-top-bar/app-top-bar.js.map +1 -1
- package/dist/components/avatar/avatar.d.ts +22 -1
- package/dist/components/avatar/avatar.d.ts.map +1 -1
- package/dist/components/avatar/avatar.js +13 -3
- package/dist/components/avatar/avatar.js.map +1 -1
- package/dist/components/brand-logos/brand-artwork.d.ts +10 -0
- package/dist/components/brand-logos/brand-artwork.d.ts.map +1 -1
- package/dist/components/brand-logos/brand-artwork.js +10 -0
- package/dist/components/brand-logos/brand-artwork.js.map +1 -1
- package/dist/components/brand-logos/brand-logos.d.ts +1 -1
- package/dist/components/brand-logos/brand-logos.d.ts.map +1 -1
- package/dist/components/brand-logos/brand-logos.js +4 -0
- package/dist/components/brand-logos/brand-logos.js.map +1 -1
- package/dist/components/celebration-dialog/celebration-dialog.d.ts +23 -0
- package/dist/components/celebration-dialog/celebration-dialog.d.ts.map +1 -0
- package/dist/components/celebration-dialog/celebration-dialog.js +158 -0
- package/dist/components/celebration-dialog/celebration-dialog.js.map +1 -0
- package/dist/components/celebration-dialog/index.d.ts +2 -0
- package/dist/components/celebration-dialog/index.d.ts.map +1 -0
- package/dist/components/celebration-dialog/index.js +2 -0
- package/dist/components/celebration-dialog/index.js.map +1 -0
- package/dist/components/code-block/code-block.d.ts +7 -2
- package/dist/components/code-block/code-block.d.ts.map +1 -1
- package/dist/components/code-block/code-block.js +30 -4
- package/dist/components/code-block/code-block.js.map +1 -1
- package/dist/components/code-block/highlight-code.d.ts +10 -0
- package/dist/components/code-block/highlight-code.d.ts.map +1 -0
- package/dist/components/code-block/highlight-code.js +45 -0
- package/dist/components/code-block/highlight-code.js.map +1 -0
- package/dist/components/data-grid/data-grid.d.ts +1 -1
- package/dist/components/data-grid/data-grid.js +2 -2
- package/dist/components/data-grid/data-grid.js.map +1 -1
- package/dist/components/list-toolbar/list-toolbar.d.ts +3 -1
- package/dist/components/list-toolbar/list-toolbar.d.ts.map +1 -1
- package/dist/components/list-toolbar/list-toolbar.js +13 -2
- package/dist/components/list-toolbar/list-toolbar.js.map +1 -1
- package/dist/components/page-header/page-header.d.ts +11 -7
- package/dist/components/page-header/page-header.d.ts.map +1 -1
- package/dist/components/page-header/page-header.js +34 -11
- package/dist/components/page-header/page-header.js.map +1 -1
- package/dist/components/payment-logos/payment-logos.d.ts +8 -3
- package/dist/components/payment-logos/payment-logos.d.ts.map +1 -1
- package/dist/components/payment-logos/payment-logos.js +5 -5
- package/dist/components/payment-logos/payment-logos.js.map +1 -1
- package/dist/components/radio-group/radio-group.d.ts +2 -2
- package/dist/components/radio-group/radio-group.js +5 -5
- package/dist/components/radio-group/radio-group.js.map +1 -1
- package/dist/components/segmented-control/index.d.ts +1 -1
- package/dist/components/segmented-control/index.d.ts.map +1 -1
- package/dist/components/segmented-control/index.js +1 -1
- package/dist/components/segmented-control/index.js.map +1 -1
- package/dist/components/segmented-control/segmented-control.d.ts +19 -0
- package/dist/components/segmented-control/segmented-control.d.ts.map +1 -1
- package/dist/components/segmented-control/segmented-control.js +28 -7
- package/dist/components/segmented-control/segmented-control.js.map +1 -1
- package/dist/components/select/select.d.ts.map +1 -1
- package/dist/components/select/select.js +8 -2
- package/dist/components/select/select.js.map +1 -1
- package/dist/components/sidebar/index.d.ts +1 -1
- package/dist/components/sidebar/index.d.ts.map +1 -1
- package/dist/components/sidebar/index.js +1 -1
- package/dist/components/sidebar/index.js.map +1 -1
- package/dist/components/sidebar/sidebar.d.ts +29 -3
- package/dist/components/sidebar/sidebar.d.ts.map +1 -1
- package/dist/components/sidebar/sidebar.js +67 -22
- package/dist/components/sidebar/sidebar.js.map +1 -1
- package/dist/components/spinner/spinner.d.ts +12 -1
- package/dist/components/spinner/spinner.d.ts.map +1 -1
- package/dist/components/spinner/spinner.js +2 -2
- package/dist/components/spinner/spinner.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/lib/cn-tables.js +5 -5
- package/dist/lib/cn-tables.js.map +1 -1
- package/dist/primitives/lib/segmented-control.js +2 -2
- package/dist/primitives/lib/segmented-control.js.map +1 -1
- package/dist/primitives/ui/alert-dialog.js +1 -1
- package/dist/primitives/ui/alert-dialog.js.map +1 -1
- package/dist/primitives/ui/dialog.d.ts.map +1 -1
- package/dist/primitives/ui/dialog.js +6 -3
- package/dist/primitives/ui/dialog.js.map +1 -1
- package/dist/primitives/ui/sheet.js +4 -4
- package/dist/primitives/ui/sheet.js.map +1 -1
- package/dist/primitives/ui/sidebar.js +2 -2
- package/dist/primitives/ui/sidebar.js.map +1 -1
- package/dist/primitives/ui/switch.d.ts +2 -2
- package/dist/primitives/ui/switch.d.ts.map +1 -1
- package/dist/primitives/ui/switch.js +2 -2
- package/dist/primitives/ui/switch.js.map +1 -1
- package/dist/primitives/ui/table.js +4 -4
- package/dist/primitives/ui/table.js.map +1 -1
- package/dist/styles/extensions.css +9 -0
- package/dist/styles/theme.css +67 -0
- package/dist/styles/tokens.css +97 -67
- package/dist/styles/tokens.test.tsx +147 -0
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"switch.d.ts","sourceRoot":"","sources":["../../../src/primitives/ui/switch.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAClE,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,
|
|
1
|
+
{"version":3,"file":"switch.d.ts","sourceRoot":"","sources":["../../../src/primitives/ui/switch.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAClE,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,uJAAuJ;AACvJ,eAAO,MAAM,oBAAoB,6TAC2R,CAAC;AAE7T,yFAAyF;AACzF,eAAO,MAAM,oBAAoB,yMACuK,CAAC;AAEzM,wHAAwH;AACxH,eAAO,MAAM,oBAAoB,oUACkS,CAAC;AAEpU,wBAAgB,MAAM,CAAC,EACrB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,eAAe,CAAC,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC,YAAY,CA8BjD;AAED,OAAO,EAAE,eAAe,EAAE,CAAC"}
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { Switch as SwitchPrimitive } from "@base-ui/react/switch";
|
|
4
4
|
import { cn } from "../lib/utils.js";
|
|
5
|
-
/** The switch track: 18×32 (22×40 below `sm`),
|
|
6
|
-
export const SWITCH_TRACK_CLASSES = "relative inline-flex h-[calc(var(--thumb-size)+4px)] w-[calc(var(--thumb-size)*2+4px)] shrink-0 items-center rounded-full p-0.5 transition-colors duration-quick ease-smooth-out [--thumb-size:--spacing(4.5)] data-checked:bg-
|
|
5
|
+
/** The switch track: 18×32 (22×40 below `sm`), Surface/Accent-primary blue when checked (Figma), grey when not. Shared with the menu's switch item. */
|
|
6
|
+
export const SWITCH_TRACK_CLASSES = "relative inline-flex h-[calc(var(--thumb-size)+4px)] w-[calc(var(--thumb-size)*2+4px)] shrink-0 items-center rounded-full p-0.5 transition-colors duration-quick ease-smooth-out [--thumb-size:--spacing(4.5)] data-checked:bg-info data-unchecked:bg-tertiary data-disabled:opacity-40 sm:[--thumb-size:--spacing(3.5)]";
|
|
7
7
|
/** The recessed depth of the track: a faint fill, an inner shadow and a gradient rim. */
|
|
8
8
|
export const SWITCH_DEPTH_CLASSES = "pointer-events-none absolute inset-0 rounded-full bg-black/4 inset-shadow-recessed before:absolute before:inset-0 before:rounded-full before:[--ring-gradient:var(--rim-depth)] before:gradient-ring";
|
|
9
9
|
/** The knob, without its travel: add `data-checked:` (or `in-data-checked:`) translate classes for the checked side. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"switch.js","sourceRoot":"","sources":["../../../src/primitives/ui/switch.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAElE,OAAO,EAAE,EAAE,EAAE,MAAM,iBAAiB,CAAC;AAErC,
|
|
1
|
+
{"version":3,"file":"switch.js","sourceRoot":"","sources":["../../../src/primitives/ui/switch.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAElE,OAAO,EAAE,EAAE,EAAE,MAAM,iBAAiB,CAAC;AAErC,uJAAuJ;AACvJ,MAAM,CAAC,MAAM,oBAAoB,GAC/B,0TAA0T,CAAC;AAE7T,yFAAyF;AACzF,MAAM,CAAC,MAAM,oBAAoB,GAC/B,sMAAsM,CAAC;AAEzM,wHAAwH;AACxH,MAAM,CAAC,MAAM,oBAAoB,GAC/B,iUAAiU,CAAC;AAEpU,MAAM,UAAU,MAAM,CAAC,EACrB,SAAS,EACT,GAAG,KAAK,EACmB;IAC3B,OAAO,CACL,MAAC,eAAe,CAAC,IAAI,IACnB,SAAS,EAAE,EAAE,CACX,oBAAoB,EACpB,yLAAyL,EACzL,SAAS,CACV,eACS,QAAQ,KACd,KAAK,aAGT,8BACc,MAAM,EAClB,SAAS,EAAE,oBAAoB,eACrB,cAAc,GACxB,EACF,KAAC,eAAe,CAAC,KAAK,IACpB,SAAS,EAAE,EAAE;gBACX,gGAAgG;gBAChG,6FAA6F;gBAC7F,iGAAiG;gBACjG,qFAAqF;gBACrF,oBAAoB,EACpB,mdAAmd,CACpd,eACS,cAAc,GACxB,IACmB,CACxB,CAAC;AACJ,CAAC;AAED,OAAO,EAAE,eAAe,EAAE,CAAC"}
|
|
@@ -38,16 +38,16 @@ export function TableRow({ className, ...props }) {
|
|
|
38
38
|
}
|
|
39
39
|
export function TableHead({ className, ...props }) {
|
|
40
40
|
return (_jsx("th", { className: cn(
|
|
41
|
-
// .Table header cell: 32 tall, padding 8/16, Labels/Secondary in Content/
|
|
42
|
-
"h-8 whitespace-nowrap px-4 py-2 text-start align-middle text-label-secondary text-
|
|
41
|
+
// .Table header cell: 32 tall, padding 8/16, Labels/Secondary in Content/Primary, on the tray.
|
|
42
|
+
"h-8 whitespace-nowrap px-4 py-2 text-start align-middle text-label-secondary text-foreground *:align-top has-[[role=checkbox]]:w-px", className), "data-slot": "table-head", ...props }));
|
|
43
43
|
}
|
|
44
44
|
export function TableCell({ className, ...props }) {
|
|
45
45
|
return (_jsx("td", { className: cn(
|
|
46
46
|
// The cells tint: hover at once, the selection tint in duration-micro.
|
|
47
47
|
"transition-colors duration-0 ease-smooth-out [[data-state=selected]_&]:duration-micro motion-reduce:transition-none",
|
|
48
|
-
// .Table cell on .Table row md: 48 tall, padding 0/16, Body/Primary in Content/
|
|
48
|
+
// .Table cell on .Table row md: 48 tall, padding 0/16, Body/Primary in Content/Secondary on the panel,
|
|
49
49
|
// a Border/Primary divider under each row but the last.
|
|
50
|
-
"h-12 whitespace-nowrap border-b border-border bg-background bg-clip-padding px-4 align-middle text-body-primary text-foreground has-[[role=checkbox]]:w-px", className), "data-slot": "table-cell", ...props }));
|
|
50
|
+
"h-12 whitespace-nowrap border-b border-border bg-background bg-clip-padding px-4 align-middle text-body-primary text-muted-foreground has-[[role=checkbox]]:w-px", className), "data-slot": "table-cell", ...props }));
|
|
51
51
|
}
|
|
52
52
|
export function TableCaption({ className, ...props }) {
|
|
53
53
|
return (_jsx("caption", { className: cn("mt-4 text-muted-foreground text-body-primary", className), "data-slot": "table-caption", ...props }));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"table.js","sourceRoot":"","sources":["../../../src/primitives/ui/table.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AACxD,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAEtD,OAAO,EAAE,EAAE,EAAE,MAAM,iBAAiB,CAAC;AASrC,MAAM,UAAU,KAAK,CAAC,EACpB,SAAS,EACT,OAAO,GAAG,SAAS,EACnB,MAAM,EACN,GAAG,KAAK,EACG;IACX,MAAM,YAAY,GAAG;QACnB,QAAQ,EAAE,CACR,gBACE,SAAS,EAAE,EAAE;YACX,+FAA+F;YAC/F,mFAAmF;YACnF,sYAAsY,EACtY,SAAS,CACV,eACS,OAAO,KACb,KAAK,GACT,CACH;QACD,SAAS,EAAE,0DAA0D;QACrE,WAAW,EAAE,iBAAiB;QAC9B,cAAc,EAAE,OAAO;KACxB,CAAC;IAEF,OAAO,SAAS,CAAC;QACf,cAAc,EAAE,KAAK;QACrB,KAAK,EAAE,UAAU,CAAQ,YAAY,EAAE,EAAE,CAAC;QAC1C,MAAM;KACP,CAAC,CAAC;AACL,CAAC;AAED,MAAM,UAAU,WAAW,CAAC,EAC1B,SAAS,EACT,GAAG,KAAK,EACsB;IAC9B,OAAO,CACL,gBACE,SAAS,EAAE,SAAS,eACV,cAAc,KACpB,KAAK,GACT,CACH,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,SAAS,CAAC,EACxB,SAAS,EACT,GAAG,KAAK,EACsB;IAC9B,OAAO,CACL,gBACE,SAAS,EAAE,EAAE;QACX,kGAAkG;QAClG,+EAA+E;QAC/E,mLAAmL,EACnL,SAAS,CACV,eACS,YAAY,KAClB,KAAK,GACT,CACH,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,WAAW,CAAC,EAC1B,SAAS,EACT,GAAG,KAAK,EACsB;IAC9B,OAAO,CACL,gBACE,SAAS,EAAE,EAAE,CACX,aAAa,EACb,SAAS,CACV,eACS,cAAc,KACpB,KAAK,GACT,CACH,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,QAAQ,CAAC,EACvB,SAAS,EACT,GAAG,KAAK,EACmB;IAC3B,OAAO,CACL,aACE,SAAS,EAAE,EAAE;QACX,yFAAyF;QACzF,iHAAiH,EACjH,UAAU,EACV,SAAS,CACV,eACS,WAAW,KACjB,KAAK,GACT,CACH,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,SAAS,CAAC,EACxB,SAAS,EACT,GAAG,KAAK,EACmB;IAC3B,OAAO,CACL,aACE,SAAS,EAAE,EAAE;QACX
|
|
1
|
+
{"version":3,"file":"table.js","sourceRoot":"","sources":["../../../src/primitives/ui/table.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AACxD,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAEtD,OAAO,EAAE,EAAE,EAAE,MAAM,iBAAiB,CAAC;AASrC,MAAM,UAAU,KAAK,CAAC,EACpB,SAAS,EACT,OAAO,GAAG,SAAS,EACnB,MAAM,EACN,GAAG,KAAK,EACG;IACX,MAAM,YAAY,GAAG;QACnB,QAAQ,EAAE,CACR,gBACE,SAAS,EAAE,EAAE;YACX,+FAA+F;YAC/F,mFAAmF;YACnF,sYAAsY,EACtY,SAAS,CACV,eACS,OAAO,KACb,KAAK,GACT,CACH;QACD,SAAS,EAAE,0DAA0D;QACrE,WAAW,EAAE,iBAAiB;QAC9B,cAAc,EAAE,OAAO;KACxB,CAAC;IAEF,OAAO,SAAS,CAAC;QACf,cAAc,EAAE,KAAK;QACrB,KAAK,EAAE,UAAU,CAAQ,YAAY,EAAE,EAAE,CAAC;QAC1C,MAAM;KACP,CAAC,CAAC;AACL,CAAC;AAED,MAAM,UAAU,WAAW,CAAC,EAC1B,SAAS,EACT,GAAG,KAAK,EACsB;IAC9B,OAAO,CACL,gBACE,SAAS,EAAE,SAAS,eACV,cAAc,KACpB,KAAK,GACT,CACH,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,SAAS,CAAC,EACxB,SAAS,EACT,GAAG,KAAK,EACsB;IAC9B,OAAO,CACL,gBACE,SAAS,EAAE,EAAE;QACX,kGAAkG;QAClG,+EAA+E;QAC/E,mLAAmL,EACnL,SAAS,CACV,eACS,YAAY,KAClB,KAAK,GACT,CACH,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,WAAW,CAAC,EAC1B,SAAS,EACT,GAAG,KAAK,EACsB;IAC9B,OAAO,CACL,gBACE,SAAS,EAAE,EAAE,CACX,aAAa,EACb,SAAS,CACV,eACS,cAAc,KACpB,KAAK,GACT,CACH,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,QAAQ,CAAC,EACvB,SAAS,EACT,GAAG,KAAK,EACmB;IAC3B,OAAO,CACL,aACE,SAAS,EAAE,EAAE;QACX,yFAAyF;QACzF,iHAAiH,EACjH,UAAU,EACV,SAAS,CACV,eACS,WAAW,KACjB,KAAK,GACT,CACH,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,SAAS,CAAC,EACxB,SAAS,EACT,GAAG,KAAK,EACmB;IAC3B,OAAO,CACL,aACE,SAAS,EAAE,EAAE;QACX,+FAA+F;QAC/F,qIAAqI,EACrI,SAAS,CACV,eACS,YAAY,KAClB,KAAK,GACT,CACH,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,SAAS,CAAC,EACxB,SAAS,EACT,GAAG,KAAK,EACmB;IAC3B,OAAO,CACL,aACE,SAAS,EAAE,EAAE;QACX,uEAAuE;QACvE,qHAAqH;QACrH,uGAAuG;QACvG,wDAAwD;QACxD,kKAAkK,EAClK,SAAS,CACV,eACS,YAAY,KAClB,KAAK,GACT,CACH,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,EAC3B,SAAS,EACT,GAAG,KAAK,EACwB;IAChC,OAAO,CACL,kBACE,SAAS,EAAE,EAAE,CACX,8CAA8C,EAC9C,SAAS,CACV,eACS,eAAe,KACrB,KAAK,GACT,CACH,CAAC;AACJ,CAAC"}
|
package/dist/styles/theme.css
CHANGED
|
@@ -66,6 +66,16 @@
|
|
|
66
66
|
}
|
|
67
67
|
|
|
68
68
|
@theme inline {
|
|
69
|
+
/*
|
|
70
|
+
* Use-case radii: where the corner is, on Tailwind's radius scale. Each is the size the components already
|
|
71
|
+
* use, so `rounded-control` and `rounded-lg` are the same corner. Prefer these in new code.
|
|
72
|
+
*/
|
|
73
|
+
--radius-chip: var(--radius-sm); /* 4px: badges, tags, checkboxes */
|
|
74
|
+
--radius-control: var(--radius-lg); /* 8px: buttons, inputs, select triggers, menu items */
|
|
75
|
+
--radius-panel: var(--radius-xl); /* 12px: the white panel in a tray, popovers, menus */
|
|
76
|
+
--radius-tray: var(--radius-2xl); /* 16px: trays, cards, dialogs, sheets */
|
|
77
|
+
--radius-pill: calc(infinity * 1px); /* avatars, switches, pills */
|
|
78
|
+
|
|
69
79
|
/*
|
|
70
80
|
* Fonts: Inter Variable for body text, Geist Variable for headings, Geist Mono for code. The app sets
|
|
71
81
|
* --font-sans / --font-heading / --font-mono (next/font), or imports `@dodopayments/ui/fonts.css`,
|
|
@@ -194,6 +204,8 @@
|
|
|
194
204
|
--color-highlight: var(--border-highlight);
|
|
195
205
|
--color-brand-edge: var(--brand-edge);
|
|
196
206
|
--color-brand-subtle: var(--brand-subtle);
|
|
207
|
+
--color-brand-selected: var(--brand-selected);
|
|
208
|
+
--color-segment-thumb: var(--segment-thumb);
|
|
197
209
|
--color-brand-subtle-hover: var(--brand-subtle-hover);
|
|
198
210
|
--color-error-edge: var(--error-edge);
|
|
199
211
|
--color-placeholder: var(--placeholder);
|
|
@@ -282,6 +294,52 @@
|
|
|
282
294
|
--color-logo-wordmark-on-light: var(--logo-wordmark-on-light);
|
|
283
295
|
--color-logo-wordmark-on-dark: var(--logo-wordmark-on-dark);
|
|
284
296
|
|
|
297
|
+
/*
|
|
298
|
+
* Use-case names (Figma > Foundations > Color Tokens): what the colour is applied to, then its role. Each
|
|
299
|
+
* reads the same token as the coss name beside it, so `bg-surface-secondary` and `bg-muted` are always the
|
|
300
|
+
* same colour, in every theme. `docs/token-names.md` maps every old name. The page, card and popover
|
|
301
|
+
* fills keep `bg-background`, `bg-card` and `bg-popover`: theme rules in tokens.css select those classes.
|
|
302
|
+
* surface-* fills a shape, content-* colours text and icons, border-* draws a border, a divider or a ring
|
|
303
|
+
* (`border-border-primary`, `divide-border-primary`, `ring-border-focus`).
|
|
304
|
+
*/
|
|
305
|
+
--color-surface-secondary: var(--muted);
|
|
306
|
+
--color-surface-tertiary: var(--tertiary);
|
|
307
|
+
--color-surface-hover: var(--accent);
|
|
308
|
+
--color-surface-inverted: var(--primary);
|
|
309
|
+
--color-surface-scrim: var(--scrim);
|
|
310
|
+
--color-surface-brand: var(--brand);
|
|
311
|
+
--color-surface-brand-subtle: var(--brand-subtle);
|
|
312
|
+
--color-surface-brand-selected: var(--brand-selected);
|
|
313
|
+
--color-surface-success: var(--success);
|
|
314
|
+
--color-surface-success-subtle: var(--success-subtle);
|
|
315
|
+
--color-surface-warning: var(--warning);
|
|
316
|
+
--color-surface-warning-subtle: var(--warning-subtle);
|
|
317
|
+
--color-surface-error: var(--destructive);
|
|
318
|
+
--color-surface-error-subtle: var(--destructive-subtle);
|
|
319
|
+
--color-surface-info: var(--info);
|
|
320
|
+
--color-surface-info-subtle: var(--info-subtle);
|
|
321
|
+
--color-content-primary: var(--foreground);
|
|
322
|
+
--color-content-secondary: var(--muted-foreground);
|
|
323
|
+
--color-content-tertiary: var(--tertiary-foreground);
|
|
324
|
+
--color-content-placeholder: var(--placeholder);
|
|
325
|
+
--color-content-inverted: var(--primary-foreground);
|
|
326
|
+
--color-content-link: var(--link);
|
|
327
|
+
--color-content-brand: var(--brand-content);
|
|
328
|
+
--color-content-on-brand: var(--brand-foreground);
|
|
329
|
+
--color-content-success: var(--success-foreground);
|
|
330
|
+
--color-content-warning: var(--warning-foreground);
|
|
331
|
+
--color-content-error: var(--destructive-foreground);
|
|
332
|
+
--color-content-info: var(--info-foreground);
|
|
333
|
+
--color-border-primary: var(--border);
|
|
334
|
+
--color-border-secondary: var(--border-subtle);
|
|
335
|
+
--color-border-overlay: var(--popover-border);
|
|
336
|
+
--color-border-focus: var(--ring);
|
|
337
|
+
--color-border-brand: var(--brand-border);
|
|
338
|
+
--color-border-success: var(--success-border);
|
|
339
|
+
--color-border-warning: var(--warning-border);
|
|
340
|
+
--color-border-error: var(--destructive-border);
|
|
341
|
+
--color-border-info: var(--info-border);
|
|
342
|
+
|
|
285
343
|
/* `z-dropdown` ... `z-tooltip` read the stacking scale in tokens.css. */
|
|
286
344
|
--z-index-dropdown: var(--z-dropdown);
|
|
287
345
|
--z-index-sticky: var(--z-sticky);
|
|
@@ -304,6 +362,15 @@
|
|
|
304
362
|
--transition-duration-medium: var(--motion-duration-medium);
|
|
305
363
|
--transition-duration-slow: var(--motion-duration-slow);
|
|
306
364
|
--transition-duration-very-slow: var(--motion-duration-very-slow);
|
|
365
|
+
/*
|
|
366
|
+
* Use-case durations: what the motion does, on the speed scale above. A close is faster than an open.
|
|
367
|
+
* `duration-open` / `duration-close` for popups, menus and tooltips; `duration-panel-open` /
|
|
368
|
+
* `duration-panel-close` for sheets, drawers and dialogs. Prefer these in new code.
|
|
369
|
+
*/
|
|
370
|
+
--transition-duration-open: var(--motion-duration-fast);
|
|
371
|
+
--transition-duration-close: var(--motion-duration-quick);
|
|
372
|
+
--transition-duration-panel-open: var(--motion-duration-slow);
|
|
373
|
+
--transition-duration-panel-close: var(--motion-duration-medium);
|
|
307
374
|
--transition-delay-stagger: var(--motion-duration-stagger);
|
|
308
375
|
--transition-delay-micro: var(--motion-duration-micro);
|
|
309
376
|
--ease-smooth-out: var(--motion-ease-smooth-out);
|
package/dist/styles/tokens.css
CHANGED
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
* Dodo Nest primitives (Figma "Dodo Nest Design System" > Foundations > Colors): 12 steps per family,
|
|
18
18
|
* 25 = lightest, 950 = darkest. pulse/200 is the brand colour. blue, green, amber, red, orange, violet
|
|
19
19
|
* and pink replace Tailwind's ramps of the same name, so every token that reads them follows the Dodo
|
|
20
|
-
* Nest palette. White
|
|
20
|
+
* Nest palette. White and black, and the brand and illustration shades, follow the ramps.
|
|
21
21
|
*/
|
|
22
22
|
--color-grey-25: #fbfbfb;
|
|
23
23
|
--color-grey-50: #f7f7f7;
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
--color-grey-800: #2a2a2a;
|
|
32
32
|
--color-grey-900: #202020;
|
|
33
33
|
--color-grey-950: #171717;
|
|
34
|
-
--color-grey-975: #
|
|
34
|
+
--color-grey-975: #0e0e0e; /* the dark page: below 950 so dark mode reads black, not grey */
|
|
35
35
|
|
|
36
36
|
--color-pulse-25: #f9feef;
|
|
37
37
|
--color-pulse-50: #eefcd4;
|
|
@@ -137,6 +137,35 @@
|
|
|
137
137
|
--color-pink-900: #62003f;
|
|
138
138
|
--color-pink-950: #49002c;
|
|
139
139
|
|
|
140
|
+
/* White and black (Figma White & Black), declared with the palette they belong to. */
|
|
141
|
+
--color-white: #ffffff;
|
|
142
|
+
--color-black: #000000;
|
|
143
|
+
|
|
144
|
+
/*
|
|
145
|
+
* Artwork colours (`--color-art-*`): the exact shades of the Dodo logo and of drawn artwork (milestone gems,
|
|
146
|
+
* leaderboard medals) that the ramps above do not hold. Single shades, not ramps, and not for UI: a control,
|
|
147
|
+
* a text or a surface never reads them. Artwork tokens below point here, so no token holds a raw value.
|
|
148
|
+
*/
|
|
149
|
+
--color-art-ink: #00160d; /* the logo's glyph and wordmark */
|
|
150
|
+
--color-art-lime-edge: #b3e910; /* the logo mark's edge */
|
|
151
|
+
--color-art-sky-200: #b2ddff;
|
|
152
|
+
--color-art-sky-300: #84caff;
|
|
153
|
+
--color-art-sky-400: #53b1fd;
|
|
154
|
+
--color-art-sky-600: #1570ef;
|
|
155
|
+
--color-art-mint-200: #abefc6;
|
|
156
|
+
--color-art-mint-300: #75e0a7;
|
|
157
|
+
--color-art-mint-400: #47cd89;
|
|
158
|
+
--color-art-indigo-300: #a4bcfd;
|
|
159
|
+
--color-art-indigo-400: #8098f9;
|
|
160
|
+
--color-art-indigo-700: #3538cd;
|
|
161
|
+
--color-art-purple-700: #5925dc;
|
|
162
|
+
--color-art-slate-300: #d0d5dd;
|
|
163
|
+
--color-art-taupe-400: #b8afaf;
|
|
164
|
+
--color-art-iron-500: #6b6b6b;
|
|
165
|
+
--color-art-gold: #efa006;
|
|
166
|
+
--color-art-silver: #868b95;
|
|
167
|
+
--color-art-bronze: #d67d56;
|
|
168
|
+
|
|
140
169
|
/*
|
|
141
170
|
* coss tokens with the Dodo Nest values (Figma > Foundations > Color Tokens). The Figma role is in the
|
|
142
171
|
* comment after each token. Components use only the coss names (`bg-background`, `text-foreground`).
|
|
@@ -240,6 +269,7 @@
|
|
|
240
269
|
--error-edge: var(--color-red-400); /* border/error-primary: the ring of a failed code (OTP) */
|
|
241
270
|
--success-edge: var(--color-green-400); /* border/success-primary: the ring of an accepted code (OTP) */
|
|
242
271
|
--brand-subtle: var(--color-pulse-50);
|
|
272
|
+
--brand-selected: var(--color-pulse-25); /* a selected Radio card's fill */
|
|
243
273
|
--brand-subtle-hover: var(--color-pulse-100); /* a hovered Surface/Brand-secondary control (Dodo Games) */
|
|
244
274
|
--tertiary: var(--color-grey-200);
|
|
245
275
|
--knob: var(--color-white);
|
|
@@ -274,8 +304,8 @@
|
|
|
274
304
|
--button-warning-hover-start: var(--color-amber-600);
|
|
275
305
|
--button-warning-hover-end: var(--color-amber-700);
|
|
276
306
|
/* Wallet buttons (Apple Pay, Google Pay): the brands' required black-on-light / white-on-dark marks. */
|
|
277
|
-
--wallet:
|
|
278
|
-
--wallet-foreground:
|
|
307
|
+
--wallet: var(--color-black);
|
|
308
|
+
--wallet-foreground: var(--color-white);
|
|
279
309
|
/* Series, in order. --chart-1 is the dashboard lime (2.1:1, pair it with a label); 2-8 keep 3:1. */
|
|
280
310
|
--chart-1: var(--color-pulse-500);
|
|
281
311
|
--chart-2: var(--color-blue-600); /* content/accent */
|
|
@@ -394,9 +424,9 @@
|
|
|
394
424
|
* The Leaderboard podium glows (Figma Leaderboard › .Podium cell): gold, silver and bronze at 40% from the top-left
|
|
395
425
|
* corner, transparent at 70%. Illustration, as in the dashboard code: the same in light and dark.
|
|
396
426
|
*/
|
|
397
|
-
--leaderboard-glow-first: radial-gradient(at top left,
|
|
398
|
-
--leaderboard-glow-second: radial-gradient(at top left,
|
|
399
|
-
--leaderboard-glow-third: radial-gradient(at top left,
|
|
427
|
+
--leaderboard-glow-first: radial-gradient(at top left, --alpha(var(--color-art-gold) / 40%), transparent 70%);
|
|
428
|
+
--leaderboard-glow-second: radial-gradient(at top left, --alpha(var(--color-art-silver) / 40%), transparent 70%);
|
|
429
|
+
--leaderboard-glow-third: radial-gradient(at top left, --alpha(var(--color-art-bronze) / 40%), transparent 70%);
|
|
400
430
|
/*
|
|
401
431
|
* The help panel's dot field (the dashboard's support/Blue.png and Green.png): 2px dots on a 5px grid, at half strength,
|
|
402
432
|
* fading in from the top-left and bottom-right corners. Blue in light, the brand lime in dark.
|
|
@@ -406,52 +436,53 @@
|
|
|
406
436
|
radial-gradient(at top left, black, transparent 45%), radial-gradient(at bottom right, black, transparent 55%);
|
|
407
437
|
/*
|
|
408
438
|
* Featured icon spheres (the dashboard's verification badges, `IconCircleBase`): each tone's fill runs from `-top`
|
|
409
|
-
* to `-bottom` under the sphere's white gloss
|
|
439
|
+
* to `-bottom` under the sphere's white gloss, on the status ramps (green, amber, red, blue, grey), the same in
|
|
440
|
+
* both themes. Warning starts at amber/600: amber/500 is too light under the white glyph.
|
|
410
441
|
*/
|
|
411
|
-
--sphere-neutral-top:
|
|
412
|
-
--sphere-neutral-bottom:
|
|
413
|
-
--sphere-success-top:
|
|
414
|
-
--sphere-success-bottom:
|
|
415
|
-
--sphere-warning-top:
|
|
416
|
-
--sphere-warning-bottom:
|
|
417
|
-
--sphere-error-top:
|
|
418
|
-
--sphere-error-bottom:
|
|
419
|
-
--sphere-info-top:
|
|
420
|
-
--sphere-info-bottom:
|
|
442
|
+
--sphere-neutral-top: var(--color-grey-600);
|
|
443
|
+
--sphere-neutral-bottom: var(--color-grey-700);
|
|
444
|
+
--sphere-success-top: var(--color-green-500);
|
|
445
|
+
--sphere-success-bottom: var(--color-green-700);
|
|
446
|
+
--sphere-warning-top: var(--color-amber-600);
|
|
447
|
+
--sphere-warning-bottom: var(--color-amber-700);
|
|
448
|
+
--sphere-error-top: var(--color-red-500);
|
|
449
|
+
--sphere-error-bottom: var(--color-red-700);
|
|
450
|
+
--sphere-info-top: var(--color-blue-500);
|
|
451
|
+
--sphere-info-bottom: var(--color-blue-600);
|
|
421
452
|
/*
|
|
422
453
|
* Milestones (Design File › Merchant Milestones): per category, `-gem` the gem art, `-tint` the card top, `-edge` its
|
|
423
454
|
* 1px ring, `-sparkle` the dots and the share card top. Gems are the same in both modes.
|
|
424
455
|
*/
|
|
425
|
-
--milestone-geography-gem:
|
|
426
|
-
--milestone-geography-tint:
|
|
427
|
-
--milestone-geography-edge:
|
|
428
|
-
--milestone-geography-sparkle:
|
|
429
|
-
--milestone-revenue-gem:
|
|
430
|
-
--milestone-revenue-tint:
|
|
431
|
-
--milestone-revenue-edge:
|
|
432
|
-
--milestone-revenue-sparkle:
|
|
433
|
-
--milestone-growth-gem:
|
|
434
|
-
--milestone-growth-tint:
|
|
435
|
-
--milestone-growth-edge:
|
|
436
|
-
--milestone-growth-sparkle:
|
|
437
|
-
--milestone-customers-gem:
|
|
438
|
-
--milestone-customers-tint:
|
|
439
|
-
--milestone-customers-edge:
|
|
440
|
-
--milestone-customers-sparkle:
|
|
456
|
+
--milestone-geography-gem: var(--color-art-sky-600);
|
|
457
|
+
--milestone-geography-tint: var(--color-art-sky-300);
|
|
458
|
+
--milestone-geography-edge: var(--color-art-sky-300);
|
|
459
|
+
--milestone-geography-sparkle: var(--color-art-sky-400);
|
|
460
|
+
--milestone-revenue-gem: var(--color-green-600);
|
|
461
|
+
--milestone-revenue-tint: var(--color-art-mint-300);
|
|
462
|
+
--milestone-revenue-edge: var(--color-art-mint-300);
|
|
463
|
+
--milestone-revenue-sparkle: var(--color-art-mint-400);
|
|
464
|
+
--milestone-growth-gem: var(--color-art-indigo-700);
|
|
465
|
+
--milestone-growth-tint: var(--color-art-indigo-300);
|
|
466
|
+
--milestone-growth-edge: var(--color-art-indigo-300);
|
|
467
|
+
--milestone-growth-sparkle: var(--color-art-indigo-400);
|
|
468
|
+
--milestone-customers-gem: var(--color-art-purple-700);
|
|
469
|
+
--milestone-customers-tint: var(--color-violet-300);
|
|
470
|
+
--milestone-customers-edge: var(--color-violet-300);
|
|
471
|
+
--milestone-customers-sparkle: var(--color-violet-400);
|
|
441
472
|
/* The "milestone reached" notice: the category's lightest tint (`-wash`) with a 1px edge a step darker. */
|
|
442
|
-
--milestone-geography-wash:
|
|
443
|
-
--milestone-geography-wash-edge:
|
|
444
|
-
--milestone-revenue-wash:
|
|
445
|
-
--milestone-revenue-wash-edge:
|
|
446
|
-
--milestone-growth-wash:
|
|
447
|
-
--milestone-growth-wash-edge:
|
|
448
|
-
--milestone-customers-wash:
|
|
449
|
-
--milestone-customers-wash-edge:
|
|
450
|
-
--milestone-glyph:
|
|
473
|
+
--milestone-geography-wash: var(--color-blue-25);
|
|
474
|
+
--milestone-geography-wash-edge: var(--color-art-sky-200);
|
|
475
|
+
--milestone-revenue-wash: var(--color-green-50);
|
|
476
|
+
--milestone-revenue-wash-edge: var(--color-art-mint-200);
|
|
477
|
+
--milestone-growth-wash: var(--color-blue-50);
|
|
478
|
+
--milestone-growth-wash-edge: var(--color-blue-200);
|
|
479
|
+
--milestone-customers-wash: var(--color-violet-50);
|
|
480
|
+
--milestone-customers-wash-edge: var(--color-violet-200);
|
|
481
|
+
--milestone-glyph: var(--color-white); /* the symbol on a reached gem */
|
|
451
482
|
/* A milestone not reached yet: a grey gem and a grey card top. */
|
|
452
|
-
--milestone-locked-gem:
|
|
453
|
-
--milestone-locked-glyph:
|
|
454
|
-
--milestone-locked-tint:
|
|
483
|
+
--milestone-locked-gem: var(--color-art-taupe-400);
|
|
484
|
+
--milestone-locked-glyph: var(--color-grey-400);
|
|
485
|
+
--milestone-locked-tint: var(--color-art-slate-300);
|
|
455
486
|
--milestone-locked-edge: var(--border);
|
|
456
487
|
--milestone-edge-end: var(--border); /* the bottom of a reached card's edge */
|
|
457
488
|
/* Glass streaks: white 0-30-0% (reached), 10-40-10% (locked). */
|
|
@@ -480,12 +511,14 @@
|
|
|
480
511
|
--rim-knob: linear-gradient(to bottom, --alpha(var(--color-white) / 30%), --alpha(var(--color-black) / 30%));
|
|
481
512
|
/*
|
|
482
513
|
* The Segmented control (Figma Segmented control): the track's depth is an inner shadow (0 1 2, Black 8%) and a 1px
|
|
483
|
-
* rim that fades from Black 8% at the top to transparent half way down
|
|
484
|
-
* (
|
|
514
|
+
* rim that fades from Black 8% at the top to transparent half way down. The active segment's ring is a full grey edge
|
|
515
|
+
* (Black 10% to 16%): Figma's White-to-Black knob ring vanished along the top of the white thumb. Dark keeps the knob.
|
|
516
|
+
* The segment itself is --segment-thumb: the page colour, and a step lighter than the track in dark.
|
|
485
517
|
*/
|
|
486
518
|
--inset-shadow-segmented: inset 0 1px 2px --alpha(var(--color-black) / 8%);
|
|
487
519
|
--rim-track: linear-gradient(to bottom, --alpha(var(--color-black) / 8%), transparent 50%);
|
|
488
|
-
--rim-segment: linear-gradient(to bottom, --alpha(var(--color-
|
|
520
|
+
--rim-segment: linear-gradient(to bottom, --alpha(var(--color-black) / 10%), --alpha(var(--color-black) / 16%));
|
|
521
|
+
--segment-thumb: var(--background); /* the raised segment: white on the grey track */
|
|
489
522
|
/*
|
|
490
523
|
* The glossy pill of a Progress fill (Figma Progress bar > fill): a 1px rim, faint along the top and dark from the
|
|
491
524
|
* middle down (Black 4% to Black at 22%), and a lit top edge (Shadow/Bar-highlight: White 16% + White 8%).
|
|
@@ -505,12 +538,12 @@
|
|
|
505
538
|
--focus-ring-offset: 1px;
|
|
506
539
|
|
|
507
540
|
/* Logo artwork only (Logo component): fixed Dodo brand colours, not for UI. */
|
|
508
|
-
--logo-mark:
|
|
509
|
-
--logo-mark-edge:
|
|
510
|
-
--logo-glyph:
|
|
511
|
-
--logo-wordmark:
|
|
512
|
-
--logo-wordmark-on-light:
|
|
513
|
-
--logo-wordmark-on-dark:
|
|
541
|
+
--logo-mark: var(--color-pulse-200);
|
|
542
|
+
--logo-mark-edge: var(--color-art-lime-edge);
|
|
543
|
+
--logo-glyph: var(--color-art-ink);
|
|
544
|
+
--logo-wordmark: var(--color-art-ink);
|
|
545
|
+
--logo-wordmark-on-light: var(--color-art-ink);
|
|
546
|
+
--logo-wordmark-on-dark: var(--color-white);
|
|
514
547
|
|
|
515
548
|
/*
|
|
516
549
|
* Stacking order (theme-independent), mapped to `z-dropdown` ... `z-tooltip` in theme.css. Page-level
|
|
@@ -613,6 +646,8 @@
|
|
|
613
646
|
--muted-foreground: var(--color-grey-400); /* content/secondary */
|
|
614
647
|
--placeholder: var(--muted-foreground);
|
|
615
648
|
--popover: var(--color-grey-900); /* surface/overlay: one step above the Grey 975 page, under the Grey 800 hover */
|
|
649
|
+
--rim-segment: linear-gradient(to bottom, --alpha(var(--color-white) / 16%), --alpha(var(--color-black) / 16%));
|
|
650
|
+
--segment-thumb: var(--accent); /* a step lighter than the track, never the page colour */
|
|
616
651
|
--scrim: --alpha(var(--color-black) / 64%); /* surface/scrim: darker in dark mode */
|
|
617
652
|
--popover-foreground: var(--color-grey-100); /* content/primary */
|
|
618
653
|
--popover-border: var(--border-subtle); /* a softer edge than --border: floating surfaces also cast a shadow */
|
|
@@ -656,6 +691,7 @@
|
|
|
656
691
|
--error-edge: var(--color-red-400);
|
|
657
692
|
--success-edge: var(--color-green-400);
|
|
658
693
|
--brand-subtle: var(--color-pulse-950);
|
|
694
|
+
--brand-selected: var(--color-pulse-950);
|
|
659
695
|
--brand-subtle-hover: var(--color-pulse-900);
|
|
660
696
|
--tertiary: var(--color-grey-700);
|
|
661
697
|
--knob: var(--color-grey-100);
|
|
@@ -684,8 +720,8 @@
|
|
|
684
720
|
--button-warning-end: var(--color-amber-600);
|
|
685
721
|
--button-warning-hover-start: var(--color-amber-600);
|
|
686
722
|
--button-warning-hover-end: var(--color-amber-700);
|
|
687
|
-
--wallet:
|
|
688
|
-
--wallet-foreground:
|
|
723
|
+
--wallet: var(--color-white);
|
|
724
|
+
--wallet-foreground: var(--color-black);
|
|
689
725
|
--chart-1: var(--color-pulse-400);
|
|
690
726
|
--chart-2: var(--color-blue-400);
|
|
691
727
|
--chart-3: var(--color-violet-400);
|
|
@@ -732,12 +768,6 @@
|
|
|
732
768
|
--shadow-highlight: 0 -1px --alpha(var(--color-white) / 6%);
|
|
733
769
|
--shadow-highlight-active: 0 -1px --alpha(var(--color-white) / 2%);
|
|
734
770
|
|
|
735
|
-
/* Spheres in dark: neutral and warning would go muddy on the dark page. */
|
|
736
|
-
--sphere-neutral-top: #52525b;
|
|
737
|
-
--sphere-neutral-bottom: #3f3f46;
|
|
738
|
-
--sphere-warning-top: #dc6803;
|
|
739
|
-
--sphere-warning-bottom: #dc6803;
|
|
740
|
-
|
|
741
771
|
/* Milestones in dark (Design File): tops start at the 400 step. */
|
|
742
772
|
--milestone-geography-tint: var(--milestone-geography-sparkle);
|
|
743
773
|
--milestone-revenue-tint: var(--milestone-revenue-sparkle);
|
|
@@ -751,15 +781,15 @@
|
|
|
751
781
|
--milestone-growth-wash-edge: color-mix(in srgb, var(--milestone-growth-sparkle) 32%, var(--card));
|
|
752
782
|
--milestone-customers-wash: color-mix(in srgb, var(--milestone-customers-sparkle) 12%, var(--card));
|
|
753
783
|
--milestone-customers-wash-edge: color-mix(in srgb, var(--milestone-customers-sparkle) 32%, var(--card));
|
|
754
|
-
--milestone-locked-gem:
|
|
755
|
-
--milestone-locked-glyph:
|
|
756
|
-
--milestone-locked-tint:
|
|
784
|
+
--milestone-locked-gem: var(--color-grey-950);
|
|
785
|
+
--milestone-locked-glyph: var(--color-art-iron-500);
|
|
786
|
+
--milestone-locked-tint: var(--color-grey-800);
|
|
757
787
|
--milestone-locked-edge: --alpha(var(--color-white) / 7%);
|
|
758
788
|
--milestone-edge-end: color-mix(in srgb, var(--color-white) 8%, var(--card));
|
|
759
789
|
--milestone-locked-streak: --alpha(var(--color-white) / 12%);
|
|
760
790
|
--milestone-locked-streak-edge: transparent;
|
|
761
791
|
|
|
762
|
-
--logo-wordmark:
|
|
792
|
+
--logo-wordmark: var(--color-white);
|
|
763
793
|
}
|
|
764
794
|
|
|
765
795
|
/*
|
|
@@ -3,6 +3,7 @@ import { cdp, userEvent } from "vitest/browser";
|
|
|
3
3
|
import { render } from "vitest-browser-react";
|
|
4
4
|
import { contrastRatio, parseShadows, toRgba } from "../../test/color.ts";
|
|
5
5
|
import { resolveToken } from "../../test/layout.ts";
|
|
6
|
+
import { durationMs, enableTransitions } from "../../test/motion.ts";
|
|
6
7
|
import { Button } from "../components/button/button.tsx";
|
|
7
8
|
import { Card, CardContent } from "../components/card/card.tsx";
|
|
8
9
|
import { Command, CommandInput, CommandItem, CommandList } from "../components/command/command.tsx";
|
|
@@ -743,3 +744,149 @@ describe("chart palette", () => {
|
|
|
743
744
|
},
|
|
744
745
|
);
|
|
745
746
|
});
|
|
747
|
+
|
|
748
|
+
describe("use-case colour names", () => {
|
|
749
|
+
// Each pair is written out in full: Tailwind only emits a class it can read in the source.
|
|
750
|
+
const pairs = [
|
|
751
|
+
["bg-surface-secondary", "bg-muted"],
|
|
752
|
+
["bg-surface-tertiary", "bg-tertiary"],
|
|
753
|
+
["bg-surface-hover", "bg-accent"],
|
|
754
|
+
["bg-surface-inverted", "bg-primary"],
|
|
755
|
+
["bg-surface-scrim", "bg-scrim"],
|
|
756
|
+
["bg-surface-brand", "bg-brand"],
|
|
757
|
+
["bg-surface-brand-subtle", "bg-brand-subtle"],
|
|
758
|
+
["bg-surface-success", "bg-success"],
|
|
759
|
+
["bg-surface-success-subtle", "bg-success-subtle"],
|
|
760
|
+
["bg-surface-warning", "bg-warning"],
|
|
761
|
+
["bg-surface-warning-subtle", "bg-warning-subtle"],
|
|
762
|
+
["bg-surface-error", "bg-destructive"],
|
|
763
|
+
["bg-surface-error-subtle", "bg-destructive-subtle"],
|
|
764
|
+
["bg-surface-info", "bg-info"],
|
|
765
|
+
["bg-surface-info-subtle", "bg-info-subtle"],
|
|
766
|
+
["text-content-primary", "text-foreground"],
|
|
767
|
+
["text-content-secondary", "text-muted-foreground"],
|
|
768
|
+
["text-content-tertiary", "text-tertiary-foreground"],
|
|
769
|
+
["text-content-placeholder", "text-placeholder"],
|
|
770
|
+
["text-content-inverted", "text-primary-foreground"],
|
|
771
|
+
["text-content-link", "text-link"],
|
|
772
|
+
["text-content-brand", "text-brand-content"],
|
|
773
|
+
["text-content-on-brand", "text-brand-foreground"],
|
|
774
|
+
["text-content-success", "text-success-foreground"],
|
|
775
|
+
["text-content-warning", "text-warning-foreground"],
|
|
776
|
+
["text-content-error", "text-destructive-foreground"],
|
|
777
|
+
["text-content-info", "text-info-foreground"],
|
|
778
|
+
["border-border-primary", "border-border"],
|
|
779
|
+
["border-border-secondary", "border-border-subtle"],
|
|
780
|
+
["border-border-overlay", "border-popover-border"],
|
|
781
|
+
["border-border-focus", "border-ring"],
|
|
782
|
+
["border-border-brand", "border-brand-border"],
|
|
783
|
+
["border-border-success", "border-success-border"],
|
|
784
|
+
["border-border-warning", "border-warning-border"],
|
|
785
|
+
["border-border-error", "border-destructive-border"],
|
|
786
|
+
["border-border-info", "border-info-border"],
|
|
787
|
+
] as const;
|
|
788
|
+
|
|
789
|
+
test("each use-case class paints the same colour as the coss class it stands for, in light and dark", async () => {
|
|
790
|
+
const screen = await render(
|
|
791
|
+
<div>
|
|
792
|
+
{(["light", "dark"] as const).map((mode) => (
|
|
793
|
+
<div key={mode} className={mode}>
|
|
794
|
+
{pairs.map(([next, previous]) => (
|
|
795
|
+
<div key={next}>
|
|
796
|
+
<span data-testid={`${mode}-${next}`} className={cn("border", next)} />
|
|
797
|
+
<span data-testid={`${mode}-${previous}-old`} className={cn("border", previous)} />
|
|
798
|
+
</div>
|
|
799
|
+
))}
|
|
800
|
+
</div>
|
|
801
|
+
))}
|
|
802
|
+
</div>,
|
|
803
|
+
);
|
|
804
|
+
for (const mode of ["light", "dark"]) {
|
|
805
|
+
for (const [next, previous] of pairs) {
|
|
806
|
+
const property = next.startsWith("bg-")
|
|
807
|
+
? "backgroundColor"
|
|
808
|
+
: next.startsWith("text-")
|
|
809
|
+
? "color"
|
|
810
|
+
: "borderTopColor";
|
|
811
|
+
const read = (testId: string) =>
|
|
812
|
+
getComputedStyle(screen.getByTestId(testId).element())[property];
|
|
813
|
+
expect(read(`${mode}-${next}`), `${mode} ${next}`).toBe(read(`${mode}-${previous}-old`));
|
|
814
|
+
}
|
|
815
|
+
}
|
|
816
|
+
// The classes really paint: two different roles give two different colours.
|
|
817
|
+
const paint = (testId: string, property: "backgroundColor" | "color") =>
|
|
818
|
+
getComputedStyle(screen.getByTestId(testId).element())[property];
|
|
819
|
+
expect(paint("light-bg-surface-secondary", "backgroundColor")).not.toBe(
|
|
820
|
+
paint("light-bg-surface-hover", "backgroundColor"),
|
|
821
|
+
);
|
|
822
|
+
expect(paint("dark-text-content-secondary", "color")).not.toBe(
|
|
823
|
+
paint("dark-text-content-primary", "color"),
|
|
824
|
+
);
|
|
825
|
+
});
|
|
826
|
+
|
|
827
|
+
test("cn() puts a use-case class and a coss class in the same group: the last one wins", () => {
|
|
828
|
+
expect(cn("bg-muted", "bg-surface-secondary")).toBe("bg-surface-secondary");
|
|
829
|
+
expect(cn("text-content-secondary", "text-foreground")).toBe("text-foreground");
|
|
830
|
+
expect(cn("border-border", "border-border-primary")).toBe("border-border-primary");
|
|
831
|
+
});
|
|
832
|
+
});
|
|
833
|
+
|
|
834
|
+
describe("use-case radius and duration names", () => {
|
|
835
|
+
test("each use-case radius is the corner of the size it stands for", async () => {
|
|
836
|
+
const pairs = [
|
|
837
|
+
["rounded-chip", "rounded-sm"],
|
|
838
|
+
["rounded-control", "rounded-lg"],
|
|
839
|
+
["rounded-panel", "rounded-xl"],
|
|
840
|
+
["rounded-tray", "rounded-2xl"],
|
|
841
|
+
["rounded-pill", "rounded-full"],
|
|
842
|
+
] as const;
|
|
843
|
+
const screen = await render(
|
|
844
|
+
<div>
|
|
845
|
+
{pairs.map(([next, previous]) => (
|
|
846
|
+
<div key={next}>
|
|
847
|
+
<span data-testid={next} className={cn("block size-10", next)} />
|
|
848
|
+
<span data-testid={previous} className={cn("block size-10", previous)} />
|
|
849
|
+
</div>
|
|
850
|
+
))}
|
|
851
|
+
</div>,
|
|
852
|
+
);
|
|
853
|
+
const radius = (testId: string) =>
|
|
854
|
+
getComputedStyle(screen.getByTestId(testId).element()).borderTopLeftRadius;
|
|
855
|
+
for (const [next, previous] of pairs) expect(radius(next), next).toBe(radius(previous));
|
|
856
|
+
expect(radius("rounded-control")).toBe("8px");
|
|
857
|
+
expect(radius("rounded-panel")).toBe("12px");
|
|
858
|
+
expect(radius("rounded-tray")).toBe("16px");
|
|
859
|
+
expect(cn("rounded-lg", "rounded-control")).toBe("rounded-control");
|
|
860
|
+
});
|
|
861
|
+
|
|
862
|
+
test("each use-case duration is the speed it stands for, and a close is faster than an open", async () => {
|
|
863
|
+
const pairs = [
|
|
864
|
+
["duration-open", "duration-fast"],
|
|
865
|
+
["duration-close", "duration-quick"],
|
|
866
|
+
["duration-panel-open", "duration-slow"],
|
|
867
|
+
["duration-panel-close", "duration-medium"],
|
|
868
|
+
] as const;
|
|
869
|
+
const screen = await render(
|
|
870
|
+
<div>
|
|
871
|
+
{pairs.map(([next, previous]) => (
|
|
872
|
+
<div key={next}>
|
|
873
|
+
<span data-testid={next} className={cn("transition-opacity", next)} />
|
|
874
|
+
<span data-testid={previous} className={cn("transition-opacity", previous)} />
|
|
875
|
+
</div>
|
|
876
|
+
))}
|
|
877
|
+
</div>,
|
|
878
|
+
);
|
|
879
|
+
// The test page switches transitions off; read the real durations with them on.
|
|
880
|
+
const restore = enableTransitions();
|
|
881
|
+
try {
|
|
882
|
+
const ms = (testId: string) => durationMs(screen.getByTestId(testId).element());
|
|
883
|
+
for (const [next, previous] of pairs) expect(ms(next), next).toBe(ms(previous));
|
|
884
|
+
expect(ms("duration-open")).toBeGreaterThan(0);
|
|
885
|
+
expect(ms("duration-close")).toBeLessThan(ms("duration-open"));
|
|
886
|
+
expect(ms("duration-panel-close")).toBeLessThan(ms("duration-panel-open"));
|
|
887
|
+
} finally {
|
|
888
|
+
restore();
|
|
889
|
+
}
|
|
890
|
+
expect(cn("duration-fast", "duration-open")).toBe("duration-open");
|
|
891
|
+
});
|
|
892
|
+
});
|
package/package.json
CHANGED