@heirlight/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/components/button.d.ts +23 -0
- package/dist/components/button.js +90 -0
- package/dist/components/button.js.map +1 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +8 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/utils.d.ts +6 -0
- package/dist/lib/utils.js +37 -0
- package/dist/lib/utils.js.map +1 -0
- package/package.json +68 -4
- package/src/styles/index.css +10 -0
- package/src/styles/theme.css +73 -0
- package/src/styles/tokens.css +127 -0
- package/README.md +0 -3
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
3
|
+
import { Button as Button$1 } from '@base-ui/react/button';
|
|
4
|
+
import { VariantProps } from 'class-variance-authority';
|
|
5
|
+
|
|
6
|
+
declare const buttonVariants: (props?: ({
|
|
7
|
+
variant?: "primary" | "secondary" | "outline" | "danger" | "ghost" | "link" | null | undefined;
|
|
8
|
+
size?: "default" | "sm" | "icon" | null | undefined;
|
|
9
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
10
|
+
type ButtonProps = Omit<Button$1.Props, "className"> & VariantProps<typeof buttonVariants> & {
|
|
11
|
+
className?: string;
|
|
12
|
+
/** Shows a spinner and blocks presses, keeping the button's width and label for screen readers. */
|
|
13
|
+
loading?: boolean;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* HeirLight's button, on Base UI's accessible button.
|
|
17
|
+
*
|
|
18
|
+
* For navigation, style the link itself so it keeps the link role:
|
|
19
|
+
* `<Link href="/plan" className={buttonVariants()}>`.
|
|
20
|
+
*/
|
|
21
|
+
declare function Button({ className, variant, size, loading, disabled, focusableWhenDisabled, children, ...props }: ButtonProps): react.JSX.Element;
|
|
22
|
+
|
|
23
|
+
export { Button, type ButtonProps, buttonVariants };
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Button as ButtonPrimitive } from "@base-ui/react/button";
|
|
3
|
+
import { cva } from "class-variance-authority";
|
|
4
|
+
import { cn } from "../lib/utils";
|
|
5
|
+
const buttonVariants = cva(
|
|
6
|
+
[
|
|
7
|
+
"relative inline-flex shrink-0 cursor-pointer items-center justify-center gap-2 rounded-pill font-bold whitespace-nowrap select-none",
|
|
8
|
+
"transition-[opacity,background-color,box-shadow] outline-none active:opacity-80",
|
|
9
|
+
"focus-visible:ring-3 focus-visible:ring-ring/50",
|
|
10
|
+
"data-disabled:cursor-default data-disabled:opacity-50 data-disabled:active:opacity-50",
|
|
11
|
+
"aria-busy:cursor-default aria-busy:active:opacity-100",
|
|
12
|
+
"[&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-5"
|
|
13
|
+
],
|
|
14
|
+
{
|
|
15
|
+
variants: {
|
|
16
|
+
variant: {
|
|
17
|
+
/** The one main action on a screen. */
|
|
18
|
+
primary: "bg-primary text-primary-foreground",
|
|
19
|
+
/** A quieter action next to a primary one: "Not now", "Log out". */
|
|
20
|
+
secondary: "bg-secondary text-secondary-foreground",
|
|
21
|
+
/** Secondary with a hairline edge, for a light background. */
|
|
22
|
+
outline: "border border-border-strong bg-secondary text-secondary-foreground",
|
|
23
|
+
/** A destructive action: "Delete", "Remove access". */
|
|
24
|
+
danger: "bg-danger text-danger-foreground",
|
|
25
|
+
/** No fill until hovered, for toolbars and dense rows. */
|
|
26
|
+
ghost: "text-foreground hover:bg-muted",
|
|
27
|
+
/** Looks like a link, behaves like a button. */
|
|
28
|
+
link: "text-link underline-offset-4 hover:underline"
|
|
29
|
+
},
|
|
30
|
+
size: {
|
|
31
|
+
default: "min-h-14 p-button text-button",
|
|
32
|
+
sm: "min-h-10 px-4 py-2 text-body",
|
|
33
|
+
icon: "size-12"
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
defaultVariants: {
|
|
37
|
+
variant: "primary",
|
|
38
|
+
size: "default"
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
);
|
|
42
|
+
function Button({
|
|
43
|
+
className,
|
|
44
|
+
variant = "primary",
|
|
45
|
+
size = "default",
|
|
46
|
+
loading = false,
|
|
47
|
+
disabled,
|
|
48
|
+
focusableWhenDisabled,
|
|
49
|
+
children,
|
|
50
|
+
...props
|
|
51
|
+
}) {
|
|
52
|
+
return /* @__PURE__ */ jsxs(
|
|
53
|
+
ButtonPrimitive,
|
|
54
|
+
{
|
|
55
|
+
"data-slot": "button",
|
|
56
|
+
"data-variant": variant,
|
|
57
|
+
"data-size": size,
|
|
58
|
+
className: cn(buttonVariants({ variant, size }), className),
|
|
59
|
+
disabled: disabled || loading,
|
|
60
|
+
focusableWhenDisabled: focusableWhenDisabled ?? loading,
|
|
61
|
+
"aria-busy": loading || void 0,
|
|
62
|
+
...props,
|
|
63
|
+
children: [
|
|
64
|
+
loading && /* @__PURE__ */ jsx(
|
|
65
|
+
"span",
|
|
66
|
+
{
|
|
67
|
+
"aria-hidden": true,
|
|
68
|
+
"data-slot": "button-spinner",
|
|
69
|
+
className: "absolute size-5 animate-spin rounded-full border-2 border-current border-t-transparent"
|
|
70
|
+
}
|
|
71
|
+
),
|
|
72
|
+
/* @__PURE__ */ jsx(
|
|
73
|
+
"span",
|
|
74
|
+
{
|
|
75
|
+
className: cn(
|
|
76
|
+
"inline-flex items-center justify-center gap-2",
|
|
77
|
+
loading && "opacity-0"
|
|
78
|
+
),
|
|
79
|
+
children
|
|
80
|
+
}
|
|
81
|
+
)
|
|
82
|
+
]
|
|
83
|
+
}
|
|
84
|
+
);
|
|
85
|
+
}
|
|
86
|
+
export {
|
|
87
|
+
Button,
|
|
88
|
+
buttonVariants
|
|
89
|
+
};
|
|
90
|
+
//# sourceMappingURL=button.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/components/button.tsx"],"sourcesContent":["import { Button as ButtonPrimitive } from \"@base-ui/react/button\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport { cn } from \"../lib/utils\";\n\nconst buttonVariants = cva(\n [\n \"relative inline-flex shrink-0 cursor-pointer items-center justify-center gap-2 rounded-pill font-bold whitespace-nowrap select-none\",\n \"transition-[opacity,background-color,box-shadow] outline-none active:opacity-80\",\n \"focus-visible:ring-3 focus-visible:ring-ring/50\",\n \"data-disabled:cursor-default data-disabled:opacity-50 data-disabled:active:opacity-50\",\n \"aria-busy:cursor-default aria-busy:active:opacity-100\",\n \"[&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-5\",\n ],\n {\n variants: {\n variant: {\n /** The one main action on a screen. */\n primary: \"bg-primary text-primary-foreground\",\n /** A quieter action next to a primary one: \"Not now\", \"Log out\". */\n secondary: \"bg-secondary text-secondary-foreground\",\n /** Secondary with a hairline edge, for a light background. */\n outline:\n \"border border-border-strong bg-secondary text-secondary-foreground\",\n /** A destructive action: \"Delete\", \"Remove access\". */\n danger: \"bg-danger text-danger-foreground\",\n /** No fill until hovered, for toolbars and dense rows. */\n ghost: \"text-foreground hover:bg-muted\",\n /** Looks like a link, behaves like a button. */\n link: \"text-link underline-offset-4 hover:underline\",\n },\n size: {\n default: \"min-h-14 p-button text-button\",\n sm: \"min-h-10 px-4 py-2 text-body\",\n icon: \"size-12\",\n },\n },\n defaultVariants: {\n variant: \"primary\",\n size: \"default\",\n },\n },\n);\n\ntype ButtonProps = Omit<ButtonPrimitive.Props, \"className\"> &\n VariantProps<typeof buttonVariants> & {\n className?: string;\n /** Shows a spinner and blocks presses, keeping the button's width and label for screen readers. */\n loading?: boolean;\n };\n\n/**\n * HeirLight's button, on Base UI's accessible button.\n *\n * For navigation, style the link itself so it keeps the link role:\n * `<Link href=\"/plan\" className={buttonVariants()}>`.\n */\nfunction Button({\n className,\n variant = \"primary\",\n size = \"default\",\n loading = false,\n disabled,\n focusableWhenDisabled,\n children,\n ...props\n}: ButtonProps) {\n return (\n <ButtonPrimitive\n data-slot=\"button\"\n data-variant={variant}\n data-size={size}\n className={cn(buttonVariants({ variant, size }), className)}\n disabled={disabled || loading}\n // Keeps focus on the button while it loads, so keyboard users don't lose their place.\n focusableWhenDisabled={focusableWhenDisabled ?? loading}\n aria-busy={loading || undefined}\n {...props}\n >\n {loading && (\n <span\n aria-hidden\n data-slot=\"button-spinner\"\n className=\"absolute size-5 animate-spin rounded-full border-2 border-current border-t-transparent\"\n />\n )}\n <span\n className={cn(\n \"inline-flex items-center justify-center gap-2\",\n loading && \"opacity-0\",\n )}\n >\n {children}\n </span>\n </ButtonPrimitive>\n );\n}\n\nexport { Button, buttonVariants, type ButtonProps };\n"],"mappings":"AAmEI,SAYI,KAZJ;AAnEJ,SAAS,UAAU,uBAAuB;AAC1C,SAAS,WAA8B;AACvC,SAAS,UAAU;AAEnB,MAAM,iBAAiB;AAAA,EACrB;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE,UAAU;AAAA,MACR,SAAS;AAAA;AAAA,QAEP,SAAS;AAAA;AAAA,QAET,WAAW;AAAA;AAAA,QAEX,SACE;AAAA;AAAA,QAEF,QAAQ;AAAA;AAAA,QAER,OAAO;AAAA;AAAA,QAEP,MAAM;AAAA,MACR;AAAA,MACA,MAAM;AAAA,QACJ,SAAS;AAAA,QACT,IAAI;AAAA,QACJ,MAAM;AAAA,MACR;AAAA,IACF;AAAA,IACA,iBAAiB;AAAA,MACf,SAAS;AAAA,MACT,MAAM;AAAA,IACR;AAAA,EACF;AACF;AAeA,SAAS,OAAO;AAAA,EACd;AAAA,EACA,UAAU;AAAA,EACV,OAAO;AAAA,EACP,UAAU;AAAA,EACV;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,GAAgB;AACd,SACE;AAAA,IAAC;AAAA;AAAA,MACC,aAAU;AAAA,MACV,gBAAc;AAAA,MACd,aAAW;AAAA,MACX,WAAW,GAAG,eAAe,EAAE,SAAS,KAAK,CAAC,GAAG,SAAS;AAAA,MAC1D,UAAU,YAAY;AAAA,MAEtB,uBAAuB,yBAAyB;AAAA,MAChD,aAAW,WAAW;AAAA,MACrB,GAAG;AAAA,MAEH;AAAA,mBACC;AAAA,UAAC;AAAA;AAAA,YACC,eAAW;AAAA,YACX,aAAU;AAAA,YACV,WAAU;AAAA;AAAA,QACZ;AAAA,QAEF;AAAA,UAAC;AAAA;AAAA,YACC,WAAW;AAAA,cACT;AAAA,cACA,WAAW;AAAA,YACb;AAAA,YAEC;AAAA;AAAA,QACH;AAAA;AAAA;AAAA,EACF;AAEJ;","names":[]}
|
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["// Everything in one import: `import { Button, cn } from \"@heirlight/ui\"`.\nexport { Button, buttonVariants, type ButtonProps } from \"./components/button\";\nexport { cn } from \"./lib/utils\";\n"],"mappings":"AACA,SAAS,QAAQ,sBAAwC;AACzD,SAAS,UAAU;","names":[]}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { clsx } from "clsx";
|
|
2
|
+
import { extendTailwindMerge } from "tailwind-merge";
|
|
3
|
+
const twMerge = extendTailwindMerge({
|
|
4
|
+
extend: {
|
|
5
|
+
theme: {
|
|
6
|
+
text: [
|
|
7
|
+
"page-title",
|
|
8
|
+
"form-title",
|
|
9
|
+
"header-title",
|
|
10
|
+
"button",
|
|
11
|
+
"card-title",
|
|
12
|
+
"body",
|
|
13
|
+
"meta",
|
|
14
|
+
"caption"
|
|
15
|
+
],
|
|
16
|
+
radius: ["card", "compact", "pill"],
|
|
17
|
+
spacing: [
|
|
18
|
+
"screen",
|
|
19
|
+
"hero",
|
|
20
|
+
"card-x",
|
|
21
|
+
"card-y",
|
|
22
|
+
"card-icon",
|
|
23
|
+
"card-content",
|
|
24
|
+
"list",
|
|
25
|
+
"carousel",
|
|
26
|
+
"button"
|
|
27
|
+
]
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
function cn(...inputs) {
|
|
32
|
+
return twMerge(clsx(inputs));
|
|
33
|
+
}
|
|
34
|
+
export {
|
|
35
|
+
cn
|
|
36
|
+
};
|
|
37
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/lib/utils.ts"],"sourcesContent":["import { clsx, type ClassValue } from \"clsx\";\nimport { extendTailwindMerge } from \"tailwind-merge\";\n\n// tailwind-merge only knows Tailwind's default scale. Without these, it reads\n// `text-body` as a colour and drops it when `text-white` follows.\nconst twMerge = extendTailwindMerge({\n extend: {\n theme: {\n text: [\n \"page-title\",\n \"form-title\",\n \"header-title\",\n \"button\",\n \"card-title\",\n \"body\",\n \"meta\",\n \"caption\",\n ],\n radius: [\"card\", \"compact\", \"pill\"],\n spacing: [\n \"screen\",\n \"hero\",\n \"card-x\",\n \"card-y\",\n \"card-icon\",\n \"card-content\",\n \"list\",\n \"carousel\",\n \"button\",\n ],\n },\n },\n});\n\n/** Joins class names and lets a later Tailwind class win over an earlier one. */\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n"],"mappings":"AAAA,SAAS,YAA6B;AACtC,SAAS,2BAA2B;AAIpC,MAAM,UAAU,oBAAoB;AAAA,EAClC,QAAQ;AAAA,IACN,OAAO;AAAA,MACL,MAAM;AAAA,QACJ;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,MACF;AAAA,MACA,QAAQ,CAAC,QAAQ,WAAW,MAAM;AAAA,MAClC,SAAS;AAAA,QACP;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,MACF;AAAA,IACF;AAAA,EACF;AACF,CAAC;AAGM,SAAS,MAAM,QAAsB;AAC1C,SAAO,QAAQ,KAAK,MAAM,CAAC;AAC7B;","names":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,70 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@heirlight/ui",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "HeirLight's web design system: tokens, themes and React components.",
|
|
5
|
+
"license": "UNLICENSED",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/ZhengJieGan/web-design-system.git",
|
|
9
|
+
"directory": "packages/ui"
|
|
10
|
+
},
|
|
11
|
+
"homepage": "https://design-system.heirlight.com",
|
|
12
|
+
"publishConfig": {
|
|
13
|
+
"access": "public"
|
|
14
|
+
},
|
|
15
|
+
"keywords": [
|
|
16
|
+
"heirlight",
|
|
17
|
+
"design-system",
|
|
18
|
+
"react",
|
|
19
|
+
"tailwindcss",
|
|
20
|
+
"base-ui"
|
|
21
|
+
],
|
|
22
|
+
"type": "module",
|
|
23
|
+
"sideEffects": [
|
|
24
|
+
"*.css"
|
|
25
|
+
],
|
|
26
|
+
"files": [
|
|
27
|
+
"dist",
|
|
28
|
+
"src/styles"
|
|
29
|
+
],
|
|
30
|
+
"exports": {
|
|
31
|
+
".": {
|
|
32
|
+
"types": "./dist/index.d.ts",
|
|
33
|
+
"default": "./dist/index.js"
|
|
34
|
+
},
|
|
35
|
+
"./styles.css": "./src/styles/index.css",
|
|
36
|
+
"./tokens.css": "./src/styles/tokens.css",
|
|
37
|
+
"./theme.css": "./src/styles/theme.css",
|
|
38
|
+
"./package.json": "./package.json"
|
|
39
|
+
},
|
|
40
|
+
"scripts": {
|
|
41
|
+
"build": "tsup",
|
|
42
|
+
"dev": "tsup --watch",
|
|
43
|
+
"typecheck": "tsc --noEmit",
|
|
44
|
+
"test": "vitest run"
|
|
45
|
+
},
|
|
46
|
+
"peerDependencies": {
|
|
47
|
+
"react": ">=19",
|
|
48
|
+
"react-dom": ">=19"
|
|
49
|
+
},
|
|
50
|
+
"dependencies": {
|
|
51
|
+
"@base-ui/react": "^1.9.0",
|
|
52
|
+
"class-variance-authority": "^0.7.1",
|
|
53
|
+
"clsx": "^2.1.1",
|
|
54
|
+
"tailwind-merge": "^3.7.3"
|
|
55
|
+
},
|
|
56
|
+
"devDependencies": {
|
|
57
|
+
"@testing-library/jest-dom": "^6.9.1",
|
|
58
|
+
"@testing-library/react": "^16.3.3",
|
|
59
|
+
"@testing-library/user-event": "^14.6.1",
|
|
60
|
+
"@types/react": "^19.2.0",
|
|
61
|
+
"@types/react-dom": "^19.2.0",
|
|
62
|
+
"@vitejs/plugin-react": "^5.1.0",
|
|
63
|
+
"jsdom": "^27.0.0",
|
|
64
|
+
"react": "^19.2.3",
|
|
65
|
+
"react-dom": "^19.2.3",
|
|
66
|
+
"tsup": "^8.5.0",
|
|
67
|
+
"typescript": "^5.9.3",
|
|
68
|
+
"vitest": "^4.1.12"
|
|
69
|
+
}
|
|
70
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Everything the components need. In the app's CSS, after Tailwind:
|
|
3
|
+
* @import "tailwindcss";
|
|
4
|
+
* @import "@heirlight/ui/styles.css";
|
|
5
|
+
*/
|
|
6
|
+
@import "./tokens.css";
|
|
7
|
+
@import "./theme.css";
|
|
8
|
+
|
|
9
|
+
/* Lets Tailwind find the class names inside the built components. */
|
|
10
|
+
@source "../../dist";
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Layer 2 — semantic tokens. What each colour is for. Components only use
|
|
3
|
+
* these (`bg-primary`, `text-foreground`, `border-border`).
|
|
4
|
+
*
|
|
5
|
+
* Layer 3 — themes. A theme overrides the semantic tokens and nothing else.
|
|
6
|
+
* Switch with an attribute on any element, usually <html>:
|
|
7
|
+
* <html data-theme="dark">
|
|
8
|
+
* Add your own theme by copying the dark block with a new name.
|
|
9
|
+
*/
|
|
10
|
+
:root,
|
|
11
|
+
[data-theme="light"] {
|
|
12
|
+
--background: var(--color-white-background);
|
|
13
|
+
--foreground: var(--color-muted-text-black);
|
|
14
|
+
--surface: var(--color-white);
|
|
15
|
+
--surface-foreground: var(--color-muted-text-black);
|
|
16
|
+
--primary: var(--color-darker-green);
|
|
17
|
+
--primary-foreground: var(--color-white-background);
|
|
18
|
+
--secondary: var(--color-light-grey-border);
|
|
19
|
+
--secondary-foreground: var(--color-muted-text-black);
|
|
20
|
+
--muted: var(--color-light-grey);
|
|
21
|
+
--muted-foreground: var(--color-muted-text-grey);
|
|
22
|
+
--accent: var(--color-light-background-green);
|
|
23
|
+
--accent-foreground: var(--color-darker-green);
|
|
24
|
+
--border: var(--color-light-grey-border);
|
|
25
|
+
--border-strong: var(--color-muted-text-grey);
|
|
26
|
+
--ring: var(--color-dark-green);
|
|
27
|
+
--danger: var(--color-red);
|
|
28
|
+
--danger-foreground: var(--color-white);
|
|
29
|
+
--link: var(--color-dark-green);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
[data-theme="dark"] {
|
|
33
|
+
--background: var(--color-dark-background);
|
|
34
|
+
--foreground: var(--color-white-background);
|
|
35
|
+
--surface: var(--color-dark-surface);
|
|
36
|
+
--surface-foreground: var(--color-white-background);
|
|
37
|
+
--primary: var(--color-light-green);
|
|
38
|
+
--primary-foreground: var(--color-darker-green-deep);
|
|
39
|
+
--secondary: var(--color-dark-grey-border);
|
|
40
|
+
--secondary-foreground: var(--color-white-background);
|
|
41
|
+
--muted: var(--color-dark-surface);
|
|
42
|
+
--muted-foreground: var(--color-darker-grey);
|
|
43
|
+
--accent: var(--color-darker-green-deep);
|
|
44
|
+
--accent-foreground: var(--color-light-green);
|
|
45
|
+
--border: var(--color-dark-grey-border);
|
|
46
|
+
--border-strong: var(--color-darker-grey);
|
|
47
|
+
--ring: var(--color-light-green);
|
|
48
|
+
--danger: var(--color-red);
|
|
49
|
+
--danger-foreground: var(--color-white);
|
|
50
|
+
--link: var(--color-light-green);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/* Turns the semantic tokens into Tailwind classes: bg-primary, text-link, … */
|
|
54
|
+
@theme inline {
|
|
55
|
+
--color-background: var(--background);
|
|
56
|
+
--color-foreground: var(--foreground);
|
|
57
|
+
--color-surface: var(--surface);
|
|
58
|
+
--color-surface-foreground: var(--surface-foreground);
|
|
59
|
+
--color-primary: var(--primary);
|
|
60
|
+
--color-primary-foreground: var(--primary-foreground);
|
|
61
|
+
--color-secondary: var(--secondary);
|
|
62
|
+
--color-secondary-foreground: var(--secondary-foreground);
|
|
63
|
+
--color-muted: var(--muted);
|
|
64
|
+
--color-muted-foreground: var(--muted-foreground);
|
|
65
|
+
--color-accent: var(--accent);
|
|
66
|
+
--color-accent-foreground: var(--accent-foreground);
|
|
67
|
+
--color-border: var(--border);
|
|
68
|
+
--color-border-strong: var(--border-strong);
|
|
69
|
+
--color-ring: var(--ring);
|
|
70
|
+
--color-danger: var(--danger);
|
|
71
|
+
--color-danger-foreground: var(--danger-foreground);
|
|
72
|
+
--color-link: var(--link);
|
|
73
|
+
}
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Layer 1 — palette. Raw HeirLight values, the same as the Expo app
|
|
3
|
+
* (`heirlight/styles/constants.ts`) and the specs
|
|
4
|
+
* (`mobile-app-specs/design-system/tokens.md`). Names are the Expo names in
|
|
5
|
+
* kebab-case: `colours.darkerGreen` is `--color-darker-green`.
|
|
6
|
+
*
|
|
7
|
+
* Components never use these directly. They use the semantic names in
|
|
8
|
+
* theme.css, so a theme can swap the palette without touching a component.
|
|
9
|
+
* `static` keeps every value in the CSS, because theme.css reads them with
|
|
10
|
+
* var() and Tailwind can't see that use.
|
|
11
|
+
*/
|
|
12
|
+
@theme static {
|
|
13
|
+
--font-sans:
|
|
14
|
+
var(--font-nunito-sans, "Nunito Sans"), ui-sans-serif, system-ui, sans-serif;
|
|
15
|
+
|
|
16
|
+
/* ── Base ─────────────────────────────────────────────── */
|
|
17
|
+
--color-white: #ffffff;
|
|
18
|
+
--color-dark-background: #1f1f1f;
|
|
19
|
+
--color-white-background: #fafaf8;
|
|
20
|
+
|
|
21
|
+
/* ── Greens (brand) ───────────────────────────────────── */
|
|
22
|
+
--color-darker-green: #28462a;
|
|
23
|
+
--color-darker-green-light: #3f6b42;
|
|
24
|
+
--color-darker-green-deep: #1b321d;
|
|
25
|
+
--color-dark-green: #006838;
|
|
26
|
+
--color-bright-green: #7ec930;
|
|
27
|
+
--color-light-green: #a3d2a4;
|
|
28
|
+
--color-light-background-green: #e5f3e5;
|
|
29
|
+
--color-accent-green: #34c759;
|
|
30
|
+
|
|
31
|
+
/* ── Yellows ──────────────────────────────────────────── */
|
|
32
|
+
--color-darker-yellow: #b8860b;
|
|
33
|
+
--color-yellow: #fefadf;
|
|
34
|
+
--color-light-yellow: #fff9c4;
|
|
35
|
+
--color-light-green-yellow: #eeffb0;
|
|
36
|
+
--color-pale-yellow: #fde68a;
|
|
37
|
+
--color-brown-yellow: #854d0e;
|
|
38
|
+
--color-soft-yellow: #fff6de;
|
|
39
|
+
--color-muted-yellow: #8c6d1f;
|
|
40
|
+
--color-muted-yellow-light: #c9a443;
|
|
41
|
+
--color-muted-yellow-deep: #5c4510;
|
|
42
|
+
--color-accent-yellow: #ffb020;
|
|
43
|
+
|
|
44
|
+
/* ── Blues ────────────────────────────────────────────── */
|
|
45
|
+
--color-darker-blue: #1e3a8a;
|
|
46
|
+
--color-dark-blue: #1d4ed8;
|
|
47
|
+
--color-light-blue: #bfdbfe;
|
|
48
|
+
--color-soft-blue: #eaf2fe;
|
|
49
|
+
--color-accent-blue: #4a80f0;
|
|
50
|
+
--color-muted-blue: #3a5a8c;
|
|
51
|
+
--color-muted-blue-light: #5578b0;
|
|
52
|
+
--color-muted-blue-deep: #2a4470;
|
|
53
|
+
|
|
54
|
+
/* ── Reds ─────────────────────────────────────────────── */
|
|
55
|
+
--color-darker-red: #b90000;
|
|
56
|
+
--color-red: #c70000;
|
|
57
|
+
--color-light-red: rgb(220 38 38 / 0.1);
|
|
58
|
+
--color-light-red-border: rgb(220 38 38 / 0.35);
|
|
59
|
+
--color-darker-red-text: #b91c1c;
|
|
60
|
+
--color-pale-red: #fecaca;
|
|
61
|
+
--color-soft-red: #fdecec;
|
|
62
|
+
--color-muted-red: #7d3a45;
|
|
63
|
+
--color-muted-red-light: #9e5260;
|
|
64
|
+
--color-muted-red-deep: #5f2a33;
|
|
65
|
+
|
|
66
|
+
/* ── Purples (legacy) ─────────────────────────────────── */
|
|
67
|
+
--color-darker-purple: #7c3aed;
|
|
68
|
+
--color-light-purple: #ede9fe;
|
|
69
|
+
|
|
70
|
+
/* ── Neutrals ─────────────────────────────────────────── */
|
|
71
|
+
--color-muted-text-black: #4d4d4d;
|
|
72
|
+
--color-darker-grey: #969696;
|
|
73
|
+
--color-muted-text-grey: #999999;
|
|
74
|
+
--color-dark-grey: #d9d9d9;
|
|
75
|
+
--color-light-grey: #f7f7f7;
|
|
76
|
+
--color-grey-soft: #efefef;
|
|
77
|
+
--color-light-grey-border: rgb(77 77 77 / 0.12);
|
|
78
|
+
--color-form-border: rgb(0 0 0 / 0.1);
|
|
79
|
+
--color-form-disabled: rgb(0 0 0 / 0.05);
|
|
80
|
+
--color-cream: #e7e3c6;
|
|
81
|
+
|
|
82
|
+
/* ── Dark theme (web only, not in the mobile specs yet) ─ */
|
|
83
|
+
--color-dark-surface: #2a2a2a;
|
|
84
|
+
--color-dark-grey-border: rgb(250 250 248 / 0.12);
|
|
85
|
+
|
|
86
|
+
/* ── Documents ────────────────────────────────────────── */
|
|
87
|
+
--color-document-will-bg: #d0dfcc;
|
|
88
|
+
--color-document-will-button: #3e5c36;
|
|
89
|
+
--color-document-power-of-attorney-bg: #d7e8f6;
|
|
90
|
+
--color-document-power-of-attorney-button: #4a6b8a;
|
|
91
|
+
--color-document-health-directive-bg: #f0f3a2;
|
|
92
|
+
--color-document-health-directive-button: #7d802e;
|
|
93
|
+
|
|
94
|
+
/* ── Type scale (size / line height) ──────────────────── */
|
|
95
|
+
--text-page-title: 26px;
|
|
96
|
+
--text-page-title--line-height: 1.2;
|
|
97
|
+
--text-form-title: 20px;
|
|
98
|
+
--text-form-title--line-height: 1.25;
|
|
99
|
+
--text-header-title: 18px;
|
|
100
|
+
--text-header-title--line-height: 1.3;
|
|
101
|
+
--text-button: 16px;
|
|
102
|
+
--text-button--line-height: 1.375;
|
|
103
|
+
--text-card-title: 15px;
|
|
104
|
+
--text-card-title--line-height: 1.35;
|
|
105
|
+
--text-body: 14px;
|
|
106
|
+
--text-body--line-height: 1.43;
|
|
107
|
+
--text-meta: 13px;
|
|
108
|
+
--text-meta--line-height: 1.35;
|
|
109
|
+
--text-caption: 12px;
|
|
110
|
+
--text-caption--line-height: 1.35;
|
|
111
|
+
|
|
112
|
+
/* ── Shape ────────────────────────────────────────────── */
|
|
113
|
+
--radius-card: 24px;
|
|
114
|
+
--radius-compact: 12px;
|
|
115
|
+
--radius-pill: 999px;
|
|
116
|
+
|
|
117
|
+
/* ── Spacing (p-screen, gap-list, …) ──────────────────── */
|
|
118
|
+
--spacing-screen: 24px;
|
|
119
|
+
--spacing-hero: 28px;
|
|
120
|
+
--spacing-card-x: 18px;
|
|
121
|
+
--spacing-card-y: 16px;
|
|
122
|
+
--spacing-card-icon: 14px;
|
|
123
|
+
--spacing-card-content: 12px;
|
|
124
|
+
--spacing-list: 6px;
|
|
125
|
+
--spacing-carousel: 10px;
|
|
126
|
+
--spacing-button: 16px;
|
|
127
|
+
}
|
package/README.md
DELETED