@ashwa-io/ui 0.0.0-stage → 0.0.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Ashwa
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,73 @@
1
- # Temporary Holding Version
1
+ # @ashwa-io/ui
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Ashwa's design system: React components built on [shadcn/ui](https://ui.shadcn.com) (Base UI primitives) and Tailwind CSS v4, with a small, locked API and per-organisation brand theming.
4
+
5
+ - **Locked API.** Components take `variant`, `size` and a few booleans. They never accept `className` or `style`, so screens stay consistent.
6
+ - **Org theming.** One brand colour themes the whole app in light and dark mode, with WCAG contrast guaranteed in code.
7
+ - **Storybook:** https://ds.ashwa.io
8
+
9
+ ## Install
10
+
11
+ ```bash
12
+ yarn add @ashwa-io/ui react react-dom lucide-react
13
+ yarn add -D tailwindcss @tailwindcss/vite
14
+ ```
15
+
16
+ Requires React 19 and Tailwind CSS v4 (`@tailwindcss/vite` in your Vite config).
17
+
18
+ ## Styles
19
+
20
+ In your app's main CSS file, **replace** `@import 'tailwindcss';` with:
21
+
22
+ ```css
23
+ @import '@ashwa-io/ui/styles.css';
24
+ ```
25
+
26
+ That one import brings Tailwind, the design tokens, the Inter font and the classes the components use. Do not also import `tailwindcss`: it would duplicate the CSS. Your own Tailwind classes and `@theme` additions keep working below the import.
27
+
28
+ ## Use
29
+
30
+ ```tsx
31
+ import { Button } from '@ashwa-io/ui';
32
+ import { PlusIcon } from 'lucide-react';
33
+
34
+ <Button variant="primary" icon={PlusIcon} onClick={addVehicle}>
35
+ Add vehicle
36
+ </Button>;
37
+ ```
38
+
39
+ Layout is your app's job: wrap components in your own elements (`<div className="flex gap-2">…</div>`). Components themselves are never restyled from outside.
40
+
41
+ ## Theming
42
+
43
+ Dark mode follows a `dark` class on `<html>`.
44
+
45
+ Org brand colour comes from `@ashwa-io/ui/theme`:
46
+
47
+ ```ts
48
+ import { brandThemeCss } from '@ashwa-io/ui/theme';
49
+
50
+ const style = document.getElementById('org-theme') ?? document.createElement('style');
51
+ style.id = 'org-theme';
52
+ style.textContent = brandThemeCss(org.primaryColor); // '#1a73e8', or null for the default
53
+ document.head.appendChild(style);
54
+ ```
55
+
56
+ `brandTheme(hex)` returns the same tokens as data, plus `warnings` (`'adjusted'` when lightness was changed for contrast, `'near-destructive'` when the colour is close to the delete red) for an org-settings preview.
57
+
58
+ ## Develop
59
+
60
+ ```bash
61
+ corepack enable
62
+ yarn install
63
+ yarn playwright install chromium
64
+ yarn storybook # http://localhost:6006
65
+ yarn test # unit tests + every story as a browser test (play functions + a11y)
66
+ yarn lint && yarn typecheck && yarn build
67
+ ```
68
+
69
+ See [CONTRIBUTING.md](./CONTRIBUTING.md).
70
+
71
+ ## License
72
+
73
+ MIT
@@ -0,0 +1,22 @@
1
+ import { IconComponent, Size } from "../../../lib/types.js";
2
+ import React from "react";
3
+ export type ButtonVariant = 'primary' | 'secondary' | 'outline' | 'ghost' | 'destructive' | 'link';
4
+ export interface ButtonProps {
5
+ variant?: ButtonVariant;
6
+ size?: Size;
7
+ fullWidth?: boolean;
8
+ /** Disables the button, sets aria-busy and swaps the icon for a spinner. */
9
+ loading?: boolean;
10
+ disabled?: boolean;
11
+ type?: 'button' | 'submit';
12
+ /** Leading icon, decorative (aria-hidden). */
13
+ icon?: IconComponent;
14
+ onClick?: (event: React.MouseEvent<HTMLButtonElement>) => void;
15
+ children: React.ReactNode;
16
+ ref?: React.Ref<HTMLButtonElement>;
17
+ id?: string;
18
+ 'aria-label'?: string;
19
+ 'aria-describedby'?: string;
20
+ 'data-testid'?: string;
21
+ }
22
+ export declare const Button: React.FC<ButtonProps>;
@@ -0,0 +1,44 @@
1
+ import { Button as Button$1 } from "../../ui/button.js";
2
+ import { cn } from "../../../lib/utils.js";
3
+ import { LoaderCircleIcon } from "lucide-react";
4
+ import { jsx, jsxs } from "react/jsx-runtime";
5
+ // src/components/atomic/Button/Button.tsx
6
+ const VARIANT = {
7
+ primary: "default",
8
+ secondary: "secondary",
9
+ outline: "outline",
10
+ ghost: "ghost",
11
+ destructive: "destructive",
12
+ link: "link"
13
+ };
14
+ const VARIANT_CLASS = { link: "text-brand-text" };
15
+ const SIZE = {
16
+ sm: "sm",
17
+ md: "default",
18
+ lg: "lg"
19
+ };
20
+ const Button = (props) => {
21
+ const { variant = "primary", size = "md", fullWidth = false, loading = false, disabled = false, type = "button", icon, onClick, children, ref, id, "aria-label": ariaLabel, "aria-describedby": ariaDescribedBy, "data-testid": testId } = props;
22
+ const LeadingIcon = loading ? LoaderCircleIcon : icon;
23
+ return /* @__PURE__ */ jsxs(Button$1, {
24
+ ref,
25
+ id,
26
+ type,
27
+ variant: VARIANT[variant],
28
+ size: SIZE[size],
29
+ className: cn(VARIANT_CLASS[variant], fullWidth && "w-full"),
30
+ disabled: disabled || loading,
31
+ focusableWhenDisabled: loading,
32
+ "aria-busy": loading || void 0,
33
+ "aria-label": ariaLabel,
34
+ "aria-describedby": ariaDescribedBy,
35
+ "data-testid": testId,
36
+ onClick,
37
+ children: [LeadingIcon && /* @__PURE__ */ jsx(LeadingIcon, {
38
+ "data-icon": "inline-start",
39
+ "aria-hidden": true,
40
+ className: cn(loading && "animate-spin")
41
+ }), children]
42
+ });
43
+ };
44
+ export { Button };
@@ -0,0 +1,2 @@
1
+ import { Button, ButtonProps, ButtonVariant } from "./Button.js";
2
+ export { Button, type ButtonProps, type ButtonVariant };
@@ -0,0 +1,41 @@
1
+ import { Button } from "@base-ui/react/button";
2
+ import { cva } from "class-variance-authority";
3
+ import { cn } from "cn";
4
+ import { jsx } from "react/jsx-runtime";
5
+ // src/components/ui/button.tsx
6
+ const buttonVariants = cva("group/button inline-flex shrink-0 items-center justify-center rounded-lg border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", {
7
+ variants: {
8
+ variant: {
9
+ default: "bg-primary text-primary-foreground hover:bg-primary/80",
10
+ outline: "border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",
11
+ secondary: "bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)] aria-expanded:bg-secondary aria-expanded:text-secondary-foreground",
12
+ ghost: "hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50",
13
+ destructive: "bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40",
14
+ link: "text-primary underline-offset-4 hover:underline"
15
+ },
16
+ size: {
17
+ default: "h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",
18
+ xs: "h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3",
19
+ sm: "h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5",
20
+ lg: "h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",
21
+ icon: "size-8",
22
+ "icon-xs": "size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3",
23
+ "icon-sm": "size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg",
24
+ "icon-lg": "size-9"
25
+ }
26
+ },
27
+ defaultVariants: {
28
+ variant: "default",
29
+ size: "default"
30
+ }
31
+ });
32
+ const Button$1 = ({ className, variant = "default", size = "default", ...props }) => /* @__PURE__ */ jsx(Button, {
33
+ "data-slot": "button",
34
+ className: cn(buttonVariants({
35
+ variant,
36
+ size,
37
+ className
38
+ })),
39
+ ...props
40
+ });
41
+ export { Button$1 as Button, buttonVariants };
@@ -0,0 +1,4 @@
1
+ import "./components/atomic/Button/index.js";
2
+ import { Button, ButtonProps, ButtonVariant } from "./components/atomic/Button/Button.js";
3
+ import { IconComponent, Size } from "./lib/types.js";
4
+ export { Button, type ButtonProps, type ButtonVariant, type IconComponent, type Size };
package/dist/index.js ADDED
@@ -0,0 +1 @@
1
+ export { Button } from "./components/atomic/Button/Button.js";
@@ -0,0 +1,9 @@
1
+ import React from "react";
2
+ /** Shared size scale for every public component. */
3
+ export type Size = 'sm' | 'md' | 'lg';
4
+ /** An icon component (lucide-react, svgr): the design system controls its size and colour. */
5
+ export type IconComponent = React.ComponentType<{
6
+ className?: string;
7
+ 'aria-hidden'?: boolean;
8
+ 'data-icon'?: string;
9
+ }>;
@@ -0,0 +1 @@
1
+ export { cn } from "cn";
@@ -0,0 +1,18 @@
1
+ export declare const DEFAULT_BRAND_HEX = "#8750f6";
2
+ export type BrandWarning = 'adjusted' | 'near-destructive' | 'invalid';
3
+ export interface BrandTokens {
4
+ '--brand': string;
5
+ '--brand-foreground': string;
6
+ '--brand-text': string;
7
+ '--brand-tint': string;
8
+ '--brand-tint-foreground': string;
9
+ '--brand-map': string;
10
+ }
11
+ export interface BrandTheme {
12
+ light: BrandTokens;
13
+ dark: BrandTokens;
14
+ warnings: BrandWarning[];
15
+ }
16
+ /** Brand tokens for light and dark from one org hex. Never throws; bad input → default. */
17
+ export declare const brandTheme: (hex: string | null | undefined) => BrandTheme;
18
+ export declare const brandThemeCss: (hex: string | null | undefined) => string;
@@ -0,0 +1,152 @@
1
+ import { clampChroma, converter, formatHex, modeLrgb, modeOklab, modeOklch, modeRgb, parseHex, useMode, wcagContrast } from "culori/fn";
2
+ // src/theme/brandTheme.ts
3
+ useMode(modeRgb);
4
+ useMode(modeLrgb);
5
+ useMode(modeOklab);
6
+ useMode(modeOklch);
7
+ const DEFAULT_BRAND_HEX = "#8750f6";
8
+ const SURFACES = {
9
+ light: [{
10
+ mode: "oklch",
11
+ l: 1,
12
+ c: 0
13
+ }],
14
+ dark: [{
15
+ mode: "oklch",
16
+ l: .145,
17
+ c: 0
18
+ }, {
19
+ mode: "oklch",
20
+ l: .205,
21
+ c: 0
22
+ }]
23
+ };
24
+ const DIRECTION = {
25
+ light: -1,
26
+ dark: 1
27
+ };
28
+ const TINT = {
29
+ light: {
30
+ l: .965,
31
+ chromaScale: .15,
32
+ maxChroma: .03
33
+ },
34
+ dark: {
35
+ l: .3,
36
+ chromaScale: .2,
37
+ maxChroma: .04
38
+ }
39
+ };
40
+ const WHITE = {
41
+ mode: "oklch",
42
+ l: 1,
43
+ c: 0
44
+ };
45
+ const BLACK = {
46
+ mode: "oklch",
47
+ l: 0,
48
+ c: 0
49
+ };
50
+ const MIN_UI_CONTRAST = 3;
51
+ const MIN_TEXT_CONTRAST = 4.5;
52
+ const LIGHTNESS_STEP = .005;
53
+ const MAX_STEPS = 200;
54
+ const WHITE_LABEL_MAX_STEPS = 10;
55
+ const DESTRUCTIVE_HUE = 27;
56
+ const NEAR_DESTRUCTIVE_HUE_RANGE = 20;
57
+ const NEAR_DESTRUCTIVE_MIN_CHROMA = .1;
58
+ const HEX_PATTERN = /^#[0-9a-fA-F]{6}$/;
59
+ const toOklch = converter("oklch");
60
+ const settle = (color) => {
61
+ const clamped = clampChroma(color, "oklch");
62
+ return {
63
+ mode: "oklch",
64
+ l: Math.round(clamped.l * 1e3) / 1e3,
65
+ c: Math.floor(clamped.c * 1e3) / 1e3,
66
+ h: clamped.h === void 0 ? void 0 : Math.round(clamped.h * 10) / 10
67
+ };
68
+ };
69
+ const stepUntil = (start, direction, passes, maxSteps = MAX_STEPS) => {
70
+ let l = start.l;
71
+ let color = settle(start);
72
+ for (let step = 0; step < maxSteps && !passes(color); step += 1) {
73
+ l = Math.min(1, Math.max(0, l + direction * LIGHTNESS_STEP));
74
+ color = settle({
75
+ ...start,
76
+ l
77
+ });
78
+ }
79
+ return color;
80
+ };
81
+ const minContrast = (color, surfaces) => Math.min(...surfaces.map((surface) => wcagContrast(color, surface)));
82
+ const round = (value, digits) => Number(value.toFixed(digits));
83
+ const formatOklch = (color) => `oklch(${round(color.l, 3)} ${round(color.c, 3)} ${round(color.h ?? 0, 1)})`;
84
+ const withLabel = (brand, surfaces) => {
85
+ const whitePasses = (c) => wcagContrast(WHITE, c) >= MIN_TEXT_CONTRAST;
86
+ const darker = stepUntil(brand, -1, whitePasses, WHITE_LABEL_MAX_STEPS);
87
+ if (whitePasses(darker) && minContrast(darker, surfaces) >= MIN_UI_CONTRAST) return {
88
+ brand: darker,
89
+ label: WHITE
90
+ };
91
+ return {
92
+ brand,
93
+ label: BLACK
94
+ };
95
+ };
96
+ const isNearDestructive = (input) => {
97
+ if (input.h === void 0 || input.c < NEAR_DESTRUCTIVE_MIN_CHROMA) return false;
98
+ return Math.abs((input.h - DESTRUCTIVE_HUE + 540) % 360 - 180) <= NEAR_DESTRUCTIVE_HUE_RANGE;
99
+ };
100
+ const modeTokens = (input, mode) => {
101
+ const surfaces = SURFACES[mode];
102
+ const direction = DIRECTION[mode];
103
+ const tintSpec = TINT[mode];
104
+ const { brand, label } = withLabel(stepUntil(input, direction, (c) => minContrast(c, surfaces) >= MIN_UI_CONTRAST), surfaces);
105
+ const text = stepUntil(brand, direction, (c) => minContrast(c, surfaces) >= MIN_TEXT_CONTRAST);
106
+ const tint = settle({
107
+ mode: "oklch",
108
+ l: tintSpec.l,
109
+ c: Math.min(input.c * tintSpec.chromaScale, tintSpec.maxChroma),
110
+ h: input.h
111
+ });
112
+ const tintForeground = stepUntil(text, direction, (c) => wcagContrast(c, tint) >= MIN_TEXT_CONTRAST);
113
+ return {
114
+ "--brand": formatOklch(brand),
115
+ "--brand-foreground": formatOklch(label),
116
+ "--brand-text": formatOklch(text),
117
+ "--brand-tint": formatOklch(tint),
118
+ "--brand-tint-foreground": formatOklch(tintForeground),
119
+ "--brand-map": formatHex(brand)
120
+ };
121
+ };
122
+ const buildTheme = (input) => {
123
+ const light = modeTokens(input, "light");
124
+ const warnings = [];
125
+ if (light["--brand"] !== formatOklch(settle(input))) warnings.push("adjusted");
126
+ if (isNearDestructive(input)) warnings.push("near-destructive");
127
+ return {
128
+ light,
129
+ dark: modeTokens(input, "dark"),
130
+ warnings
131
+ };
132
+ };
133
+ const parseBrand = (hex) => {
134
+ if (!HEX_PATTERN.test(hex)) return void 0;
135
+ const rgb = parseHex(hex);
136
+ return rgb && toOklch(rgb);
137
+ };
138
+ /** Brand tokens for light and dark from one org hex. Never throws; bad input → default. */
139
+ const brandTheme = (hex) => {
140
+ const input = parseBrand(hex ?? "#8750f6");
141
+ if (input) return buildTheme(input);
142
+ return {
143
+ ...buildTheme(parseBrand("#8750f6") ?? BLACK),
144
+ warnings: ["invalid"]
145
+ };
146
+ };
147
+ const declarations = (tokens) => Object.entries(tokens).map(([name, value]) => `${name}:${value};`).join("");
148
+ const brandThemeCss = (hex) => {
149
+ const { light, dark } = brandTheme(hex);
150
+ return `:root:root{${declarations(light)}}:root:root.dark{${declarations(dark)}}`;
151
+ };
152
+ export { DEFAULT_BRAND_HEX, brandTheme, brandThemeCss };
@@ -0,0 +1,2 @@
1
+ import { BrandTheme, BrandTokens, BrandWarning, DEFAULT_BRAND_HEX, brandTheme, brandThemeCss } from "./theme/brandTheme.js";
2
+ export { BrandTheme, BrandTokens, BrandWarning, DEFAULT_BRAND_HEX, brandTheme, brandThemeCss };
package/dist/theme.js ADDED
@@ -0,0 +1 @@
1
+ export { DEFAULT_BRAND_HEX, brandTheme, brandThemeCss } from "./theme/brandTheme.js";
package/package.json CHANGED
@@ -1,6 +1,107 @@
1
1
  {
2
2
  "name": "@ashwa-io/ui",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.0.2",
4
+ "description": "Ashwa design system: locked React components on shadcn/ui (Base UI) and Tailwind v4, with per-org brand theming.",
5
+ "license": "MIT",
6
+ "type": "module",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "git+https://github.com/ashwa-io/ashwa_ui.git"
10
+ },
11
+ "engines": {
12
+ "node": ">=22.18"
13
+ },
14
+ "types": "./dist/index.d.ts",
15
+ "exports": {
16
+ ".": {
17
+ "types": "./dist/index.d.ts",
18
+ "import": "./dist/index.js"
19
+ },
20
+ "./theme": {
21
+ "types": "./dist/theme.d.ts",
22
+ "import": "./dist/theme.js"
23
+ },
24
+ "./styles.css": "./src/styles/index.css",
25
+ "./package.json": "./package.json"
26
+ },
27
+ "files": [
28
+ "dist",
29
+ "src/styles"
30
+ ],
31
+ "sideEffects": [
32
+ "*.css"
33
+ ],
34
+ "packageManager": "yarn@4.7.0",
35
+ "publishConfig": {
36
+ "access": "public"
37
+ },
38
+ "scripts": {
39
+ "lint": "eslint .",
40
+ "lint:fix": "eslint . --fix",
41
+ "format": "prettier --write .",
42
+ "typecheck": "tsc -b",
43
+ "test": "vitest run",
44
+ "storybook": "storybook dev -p 6006",
45
+ "build-storybook": "storybook build",
46
+ "build": "tsdown",
47
+ "check:dist": "node scripts/check-dist.mjs",
48
+ "prepublishOnly": "yarn build && yarn check:dist",
49
+ "changeset": "changeset",
50
+ "version-packages": "changeset version"
51
+ },
52
+ "peerDependencies": {
53
+ "lucide-react": "^1",
54
+ "react": "^19",
55
+ "react-dom": "^19",
56
+ "tailwindcss": "^4"
57
+ },
58
+ "devDependencies": {
59
+ "@changesets/cli": "^3",
60
+ "@eslint/compat": "^2.1.1",
61
+ "@eslint/js": "^9",
62
+ "@storybook/addon-a11y": "^10.6.6",
63
+ "@storybook/addon-docs": "^10.6.6",
64
+ "@storybook/addon-vitest": "^10.6.6",
65
+ "@storybook/react-vite": "^10.6.6",
66
+ "@tailwindcss/vite": "^4.3.5",
67
+ "@types/culori": "^4.0.1",
68
+ "@types/eslint-plugin-jsx-a11y": "^6",
69
+ "@types/node": "^26.6.6",
70
+ "@types/react": "^19.3.0",
71
+ "@types/react-dom": "^19.3.0",
72
+ "@vitejs/plugin-react": "^6.2.1",
73
+ "@vitest/browser-playwright": "5.1.0",
74
+ "eslint": "^9",
75
+ "eslint-config-prettier": "^10.1.8",
76
+ "eslint-plugin-import": "^2.32.0",
77
+ "eslint-plugin-jsx-a11y": "^6.10.2",
78
+ "eslint-plugin-prettier": "^5.5.7",
79
+ "eslint-plugin-react": "^7.37.5",
80
+ "eslint-plugin-react-hooks": "^7.1.1",
81
+ "eslint-plugin-react-refresh": "^0.5.7",
82
+ "eslint-plugin-storybook": "^10.6.6",
83
+ "globals": "^17.14.0",
84
+ "lucide-react": "^1.70.0",
85
+ "playwright": "^1.65.0",
86
+ "prettier": "^3.9.10",
87
+ "prettier-plugin-tailwindcss": "^0.8.1",
88
+ "react": "^19",
89
+ "react-dom": "^19",
90
+ "shadcn": "^4.23.0",
91
+ "storybook": "^10.6.6",
92
+ "tailwindcss": "^4",
93
+ "tsdown": "^0.23.7",
94
+ "typescript": "^6",
95
+ "typescript-eslint": "^8.72.1",
96
+ "vite": "^8",
97
+ "vitest": "^5"
98
+ },
99
+ "dependencies": {
100
+ "@base-ui/react": "^1.9.0",
101
+ "@fontsource-variable/inter": "^5.3.0",
102
+ "class-variance-authority": "^0.7.1",
103
+ "cn": "^0.5.2",
104
+ "culori": "^4.0.2",
105
+ "tw-animate-css": "^1.4.0"
106
+ }
107
+ }
@@ -0,0 +1,155 @@
1
+ @import 'tailwindcss';
2
+ @import 'tw-animate-css';
3
+ @import './shadcn.css';
4
+ @import '@fontsource-variable/inter';
5
+
6
+ /* Consumers compile our classes from the published JS: Tailwind skips node_modules
7
+ unless told. Path is relative to this file inside the package. */
8
+ @source '../../dist';
9
+
10
+ @custom-variant dark (&:is(.dark *));
11
+
12
+ @theme inline {
13
+ --font-heading: var(--font-sans);
14
+ --font-sans: 'Inter Variable', sans-serif;
15
+ --color-sidebar-ring: var(--sidebar-ring);
16
+ --color-sidebar-border: var(--sidebar-border);
17
+ --color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
18
+ --color-sidebar-accent: var(--sidebar-accent);
19
+ --color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
20
+ --color-sidebar-primary: var(--sidebar-primary);
21
+ --color-sidebar-foreground: var(--sidebar-foreground);
22
+ --color-sidebar: var(--sidebar);
23
+ --color-chart-5: var(--chart-5);
24
+ --color-chart-4: var(--chart-4);
25
+ --color-chart-3: var(--chart-3);
26
+ --color-chart-2: var(--chart-2);
27
+ --color-chart-1: var(--chart-1);
28
+ --color-ring: var(--ring);
29
+ --color-input: var(--input);
30
+ --color-border: var(--border);
31
+ --color-destructive: var(--destructive);
32
+ --color-accent-foreground: var(--accent-foreground);
33
+ --color-accent: var(--accent);
34
+ --color-muted-foreground: var(--muted-foreground);
35
+ --color-muted: var(--muted);
36
+ --color-secondary-foreground: var(--secondary-foreground);
37
+ --color-secondary: var(--secondary);
38
+ --color-primary-foreground: var(--primary-foreground);
39
+ --color-primary: var(--primary);
40
+ --color-popover-foreground: var(--popover-foreground);
41
+ --color-popover: var(--popover);
42
+ --color-card-foreground: var(--card-foreground);
43
+ --color-card: var(--card);
44
+ --color-foreground: var(--foreground);
45
+ --color-background: var(--background);
46
+ --color-brand: var(--brand);
47
+ --color-brand-foreground: var(--brand-foreground);
48
+ --color-brand-text: var(--brand-text);
49
+ --color-brand-tint: var(--brand-tint);
50
+ --color-brand-tint-foreground: var(--brand-tint-foreground);
51
+ /* Radius scale matches nigam_platform (user decision 2026-11-08). */
52
+ --radius-sm: calc(var(--radius) - 4px);
53
+ --radius-md: calc(var(--radius) - 2px);
54
+ --radius-lg: var(--radius);
55
+ --radius-xl: calc(var(--radius) + 4px);
56
+ --radius-2xl: calc(var(--radius) + 8px);
57
+ --radius-3xl: calc(var(--radius) + 12px);
58
+ --radius-4xl: calc(var(--radius) + 16px);
59
+ }
60
+
61
+ :root {
62
+ /* Brand group: defaults = brandTheme(DEFAULT_BRAND_HEX). Per-org values come from
63
+ brandThemeCss(hex) in @ashwa-io/ui/theme, injected at runtime, and outrank these. */
64
+ --brand: oklch(0.585 0.233 293);
65
+ --brand-foreground: oklch(1 0 0);
66
+ --brand-text: oklch(0.585 0.233 293);
67
+ --brand-tint: oklch(0.965 0.018 293);
68
+ --brand-tint-foreground: oklch(0.565 0.233 293);
69
+ --brand-map: #8750f6;
70
+
71
+ --background: oklch(1 0 0);
72
+ --foreground: oklch(0.145 0 0);
73
+ --card: oklch(1 0 0);
74
+ --card-foreground: oklch(0.145 0 0);
75
+ --popover: oklch(1 0 0);
76
+ --popover-foreground: oklch(0.145 0 0);
77
+ --primary: var(--brand);
78
+ --primary-foreground: var(--brand-foreground);
79
+ --secondary: oklch(0.97 0 0);
80
+ --secondary-foreground: oklch(0.205 0 0);
81
+ --muted: oklch(0.97 0 0);
82
+ --muted-foreground: oklch(0.556 0 0);
83
+ --accent: oklch(0.97 0 0);
84
+ --accent-foreground: oklch(0.205 0 0);
85
+ /* Tailwind red-700, darker than base-nova's red-600: destructive text on its 10% tint
86
+ (Button destructive) must reach WCAG AA 4.5:1; red-600 only reached 4:1. */
87
+ --destructive: oklch(0.505 0.213 27.518);
88
+ --border: oklch(0.922 0 0);
89
+ --input: oklch(0.922 0 0);
90
+ --ring: var(--brand);
91
+ --chart-1: var(--brand);
92
+ --chart-2: oklch(0.556 0 0);
93
+ --chart-3: oklch(0.439 0 0);
94
+ --chart-4: oklch(0.371 0 0);
95
+ --chart-5: oklch(0.269 0 0);
96
+ --radius: 0.5rem;
97
+ --sidebar: oklch(0.985 0 0);
98
+ --sidebar-foreground: oklch(0.145 0 0);
99
+ --sidebar-primary: var(--brand);
100
+ --sidebar-primary-foreground: var(--brand-foreground);
101
+ --sidebar-accent: oklch(0.97 0 0);
102
+ --sidebar-accent-foreground: oklch(0.205 0 0);
103
+ --sidebar-border: oklch(0.922 0 0);
104
+ --sidebar-ring: var(--brand);
105
+ }
106
+
107
+ .dark {
108
+ --brand: oklch(0.585 0.233 293);
109
+ --brand-foreground: oklch(1 0 0);
110
+ --brand-text: oklch(0.625 0.223 293);
111
+ --brand-tint: oklch(0.3 0.04 293);
112
+ --brand-tint-foreground: oklch(0.685 0.183 293);
113
+ --brand-map: #8750f6;
114
+
115
+ --background: oklch(0.145 0 0);
116
+ --foreground: oklch(0.985 0 0);
117
+ --card: oklch(0.205 0 0);
118
+ --card-foreground: oklch(0.985 0 0);
119
+ --popover: oklch(0.205 0 0);
120
+ --popover-foreground: oklch(0.985 0 0);
121
+ --secondary: oklch(0.269 0 0);
122
+ --secondary-foreground: oklch(0.985 0 0);
123
+ --muted: oklch(0.269 0 0);
124
+ --muted-foreground: oklch(0.708 0 0);
125
+ --accent: oklch(0.269 0 0);
126
+ --accent-foreground: oklch(0.985 0 0);
127
+ --destructive: oklch(0.704 0.191 22.216);
128
+ --border: oklch(1 0 0 / 10%);
129
+ --input: oklch(1 0 0 / 15%);
130
+ --chart-2: oklch(0.556 0 0);
131
+ --chart-3: oklch(0.439 0 0);
132
+ --chart-4: oklch(0.371 0 0);
133
+ --chart-5: oklch(0.269 0 0);
134
+ --sidebar: oklch(0.205 0 0);
135
+ --sidebar-foreground: oklch(0.985 0 0);
136
+ --sidebar-accent: oklch(0.269 0 0);
137
+ --sidebar-accent-foreground: oklch(0.985 0 0);
138
+ --sidebar-border: oklch(1 0 0 / 10%);
139
+ }
140
+
141
+ @layer base {
142
+ * {
143
+ @apply border-border outline-ring/50;
144
+ }
145
+ body {
146
+ @apply bg-background text-foreground;
147
+ }
148
+ button:not(:disabled),
149
+ [role='button']:not(:disabled) {
150
+ cursor: pointer;
151
+ }
152
+ html {
153
+ @apply font-sans;
154
+ }
155
+ }
@@ -0,0 +1,639 @@
1
+ /* Vendored from shadcn@4.23.0 dist/tailwind.css (Base UI data-* variants, keyframes).
2
+ Consumers must not need the shadcn CLI package. Re-copy on shadcn upgrades. */
3
+ @theme inline {
4
+ @keyframes accordion-down {
5
+ from {
6
+ height: 0;
7
+ }
8
+ to {
9
+ height: var(
10
+ --radix-accordion-content-height,
11
+ var(--accordion-panel-height, auto)
12
+ );
13
+ }
14
+ }
15
+
16
+ @keyframes accordion-up {
17
+ from {
18
+ height: var(
19
+ --radix-accordion-content-height,
20
+ var(--accordion-panel-height, auto)
21
+ );
22
+ }
23
+ to {
24
+ height: 0;
25
+ }
26
+ }
27
+ }
28
+
29
+ /* Custom variants */
30
+ @custom-variant data-open {
31
+ &:where([data-state="open"]),
32
+ &:where([data-open]:not([data-open="false"])) {
33
+ @slot;
34
+ }
35
+ }
36
+
37
+ @custom-variant data-closed {
38
+ &:where([data-state="closed"]),
39
+ &:where([data-closed]:not([data-closed="false"])) {
40
+ @slot;
41
+ }
42
+ }
43
+
44
+ @custom-variant data-checked {
45
+ &:where([data-state="checked"]),
46
+ &:where([data-checked]:not([data-checked="false"])) {
47
+ @slot;
48
+ }
49
+ }
50
+
51
+ @custom-variant data-unchecked {
52
+ &:where([data-state="unchecked"]),
53
+ &:where([data-unchecked]:not([data-unchecked="false"])) {
54
+ @slot;
55
+ }
56
+ }
57
+
58
+ @custom-variant data-selected {
59
+ &:where([data-selected="true"]) {
60
+ @slot;
61
+ }
62
+ }
63
+
64
+ @custom-variant data-disabled {
65
+ &:where([data-disabled="true"]),
66
+ &:where([data-disabled]:not([data-disabled="false"])) {
67
+ @slot;
68
+ }
69
+ }
70
+
71
+ @custom-variant data-active {
72
+ &:where([data-state="active"]),
73
+ &:where([data-active]:not([data-active="false"])) {
74
+ @slot;
75
+ }
76
+ }
77
+
78
+ @custom-variant data-horizontal {
79
+ &:where([data-orientation="horizontal"]) {
80
+ @slot;
81
+ }
82
+ }
83
+
84
+ @custom-variant data-vertical {
85
+ &:where([data-orientation="vertical"]) {
86
+ @slot;
87
+ }
88
+ }
89
+
90
+ @utility no-scrollbar {
91
+ -ms-overflow-style: none;
92
+ scrollbar-width: none;
93
+
94
+ &::-webkit-scrollbar {
95
+ display: none;
96
+ }
97
+ }
98
+
99
+ /* scroll-fade */
100
+ @property --scroll-fade-t {
101
+ syntax: "<length-percentage>";
102
+ inherits: false;
103
+ initial-value: 0px;
104
+ }
105
+ @property --scroll-fade-b {
106
+ syntax: "<length-percentage>";
107
+ inherits: false;
108
+ initial-value: 0px;
109
+ }
110
+ @property --scroll-fade-s {
111
+ syntax: "<length-percentage>";
112
+ inherits: false;
113
+ initial-value: 0px;
114
+ }
115
+ @property --scroll-fade-e {
116
+ syntax: "<length-percentage>";
117
+ inherits: false;
118
+ initial-value: 0px;
119
+ }
120
+ @property --scroll-fade-mask {
121
+ syntax: "*";
122
+ inherits: false;
123
+ }
124
+
125
+ @theme inline {
126
+ @keyframes scroll-fade-reveal-t {
127
+ from {
128
+ --scroll-fade-t: 0px;
129
+ }
130
+ to {
131
+ --scroll-fade-t: var(--_scroll-fade-size-t, var(--scroll-fade-size, min(12%, calc(var(--spacing) * 10))));
132
+ }
133
+ }
134
+ @keyframes scroll-fade-reveal-b {
135
+ from {
136
+ --scroll-fade-b: var(--_scroll-fade-size-b, var(--scroll-fade-size, min(12%, calc(var(--spacing) * 10))));
137
+ }
138
+ to {
139
+ --scroll-fade-b: 0px;
140
+ }
141
+ }
142
+ @keyframes scroll-fade-reveal-s {
143
+ from {
144
+ --scroll-fade-s: 0px;
145
+ }
146
+ to {
147
+ --scroll-fade-s: var(--_scroll-fade-size-s, var(--scroll-fade-size, min(12%, calc(var(--spacing) * 10))));
148
+ }
149
+ }
150
+ @keyframes scroll-fade-reveal-e {
151
+ from {
152
+ --scroll-fade-e: var(--_scroll-fade-size-e, var(--scroll-fade-size, min(12%, calc(var(--spacing) * 10))));
153
+ }
154
+ to {
155
+ --scroll-fade-e: 0px;
156
+ }
157
+ }
158
+ }
159
+
160
+ @utility scroll-fade {
161
+ --_scroll-fade-size-t: var(
162
+ --scroll-fade-t-size,
163
+ var(--scroll-fade-size, min(12%, calc(var(--spacing) * 10)))
164
+ );
165
+ --_scroll-fade-size-b: var(
166
+ --scroll-fade-b-size,
167
+ var(--scroll-fade-size, min(12%, calc(var(--spacing) * 10)))
168
+ );
169
+ --scroll-fade-block: linear-gradient(
170
+ to bottom,
171
+ transparent 0,
172
+ #000 var(--scroll-fade-t, 0px),
173
+ #000 calc(100% - var(--scroll-fade-b, 0px)),
174
+ transparent 100%
175
+ );
176
+ -webkit-mask-image: var(--scroll-fade-mask, var(--scroll-fade-block));
177
+ mask-image: var(--scroll-fade-mask, var(--scroll-fade-block));
178
+ -webkit-mask-composite: source-in;
179
+ mask-composite: intersect;
180
+ -webkit-mask-repeat: no-repeat;
181
+ mask-repeat: no-repeat;
182
+
183
+ @supports (animation-timeline: scroll()) {
184
+ animation:
185
+ scroll-fade-reveal-t 1ms ease-in-out,
186
+ scroll-fade-reveal-b 1ms ease-in-out;
187
+ animation-timeline: scroll(self y), scroll(self y);
188
+ animation-range:
189
+ 0 var(--scroll-fade-reveal, calc(var(--spacing) * 24)),
190
+ calc(100% - var(--scroll-fade-reveal, calc(var(--spacing) * 24))) 100%;
191
+ animation-fill-mode: both;
192
+ }
193
+
194
+ @supports not (animation-timeline: scroll()) {
195
+ --scroll-fade-t: var(--_scroll-fade-size-t);
196
+ --scroll-fade-b: var(--_scroll-fade-size-b);
197
+ }
198
+ }
199
+
200
+ @utility scroll-fade-y {
201
+ --_scroll-fade-size-t: var(
202
+ --scroll-fade-t-size,
203
+ var(--scroll-fade-size, min(12%, calc(var(--spacing) * 10)))
204
+ );
205
+ --_scroll-fade-size-b: var(
206
+ --scroll-fade-b-size,
207
+ var(--scroll-fade-size, min(12%, calc(var(--spacing) * 10)))
208
+ );
209
+ --scroll-fade-block: linear-gradient(
210
+ to bottom,
211
+ transparent 0,
212
+ #000 var(--scroll-fade-t, 0px),
213
+ #000 calc(100% - var(--scroll-fade-b, 0px)),
214
+ transparent 100%
215
+ );
216
+ -webkit-mask-image: var(--scroll-fade-mask, var(--scroll-fade-block));
217
+ mask-image: var(--scroll-fade-mask, var(--scroll-fade-block));
218
+ -webkit-mask-composite: source-in;
219
+ mask-composite: intersect;
220
+ -webkit-mask-repeat: no-repeat;
221
+ mask-repeat: no-repeat;
222
+
223
+ @supports (animation-timeline: scroll()) {
224
+ animation:
225
+ scroll-fade-reveal-t 1ms ease-in-out,
226
+ scroll-fade-reveal-b 1ms ease-in-out;
227
+ animation-timeline: scroll(self y), scroll(self y);
228
+ animation-range:
229
+ 0 var(--scroll-fade-reveal, calc(var(--spacing) * 24)),
230
+ calc(100% - var(--scroll-fade-reveal, calc(var(--spacing) * 24))) 100%;
231
+ animation-fill-mode: both;
232
+ }
233
+
234
+ @supports not (animation-timeline: scroll()) {
235
+ --scroll-fade-t: var(--_scroll-fade-size-t);
236
+ --scroll-fade-b: var(--_scroll-fade-size-b);
237
+ }
238
+ }
239
+
240
+ @utility scroll-fade-x {
241
+ --_scroll-fade-size-s: var(
242
+ --scroll-fade-s-size,
243
+ var(--scroll-fade-size, min(12%, calc(var(--spacing) * 10)))
244
+ );
245
+ --_scroll-fade-size-e: var(
246
+ --scroll-fade-e-size,
247
+ var(--scroll-fade-size, min(12%, calc(var(--spacing) * 10)))
248
+ );
249
+ --scroll-fade-inline: linear-gradient(
250
+ to right,
251
+ transparent 0,
252
+ #000 var(--scroll-fade-s, 0px),
253
+ #000 calc(100% - var(--scroll-fade-e, 0px)),
254
+ transparent 100%
255
+ );
256
+ &:where([dir="rtl"], [dir="rtl"] *) {
257
+ --scroll-fade-inline: linear-gradient(
258
+ to left,
259
+ transparent 0,
260
+ #000 var(--scroll-fade-s, 0px),
261
+ #000 calc(100% - var(--scroll-fade-e, 0px)),
262
+ transparent 100%
263
+ );
264
+ }
265
+ -webkit-mask-image: var(--scroll-fade-mask, var(--scroll-fade-inline));
266
+ mask-image: var(--scroll-fade-mask, var(--scroll-fade-inline));
267
+ -webkit-mask-composite: source-in;
268
+ mask-composite: intersect;
269
+ -webkit-mask-repeat: no-repeat;
270
+ mask-repeat: no-repeat;
271
+
272
+ @supports (animation-timeline: scroll()) {
273
+ animation:
274
+ scroll-fade-reveal-s 1ms ease-in-out,
275
+ scroll-fade-reveal-e 1ms ease-in-out;
276
+ animation-timeline: scroll(self inline), scroll(self inline);
277
+ animation-range:
278
+ 0 var(--scroll-fade-reveal, calc(var(--spacing) * 24)),
279
+ calc(100% - var(--scroll-fade-reveal, calc(var(--spacing) * 24))) 100%;
280
+ animation-fill-mode: both;
281
+ }
282
+
283
+ @supports not (animation-timeline: scroll()) {
284
+ --scroll-fade-s: var(--_scroll-fade-size-s);
285
+ --scroll-fade-e: var(--_scroll-fade-size-e);
286
+ }
287
+ }
288
+
289
+ @utility scroll-fade-t {
290
+ --_scroll-fade-size-t: var(
291
+ --scroll-fade-t-size,
292
+ var(--scroll-fade-size, min(12%, calc(var(--spacing) * 10)))
293
+ );
294
+ --scroll-fade-mask: linear-gradient(
295
+ to bottom,
296
+ transparent 0,
297
+ #000 var(--scroll-fade-t, 0px),
298
+ #000 100%
299
+ );
300
+ -webkit-mask-image: var(--scroll-fade-mask);
301
+ mask-image: var(--scroll-fade-mask);
302
+ -webkit-mask-composite: source-in;
303
+ mask-composite: intersect;
304
+ -webkit-mask-repeat: no-repeat;
305
+ mask-repeat: no-repeat;
306
+
307
+ @supports (animation-timeline: scroll()) {
308
+ animation: scroll-fade-reveal-t 1ms ease-in-out;
309
+ animation-timeline: scroll(self y);
310
+ animation-range: 0 var(--scroll-fade-reveal, calc(var(--spacing) * 24));
311
+ animation-fill-mode: both;
312
+ }
313
+
314
+ @supports not (animation-timeline: scroll()) {
315
+ --scroll-fade-t: var(--_scroll-fade-size-t);
316
+ }
317
+ }
318
+
319
+ @utility scroll-fade-b {
320
+ --_scroll-fade-size-b: var(
321
+ --scroll-fade-b-size,
322
+ var(--scroll-fade-size, min(12%, calc(var(--spacing) * 10)))
323
+ );
324
+ --scroll-fade-mask: linear-gradient(
325
+ to bottom,
326
+ #000 0,
327
+ #000 calc(100% - var(--scroll-fade-b, 0px)),
328
+ transparent 100%
329
+ );
330
+ -webkit-mask-image: var(--scroll-fade-mask);
331
+ mask-image: var(--scroll-fade-mask);
332
+ -webkit-mask-composite: source-in;
333
+ mask-composite: intersect;
334
+ -webkit-mask-repeat: no-repeat;
335
+ mask-repeat: no-repeat;
336
+
337
+ @supports (animation-timeline: scroll()) {
338
+ animation: scroll-fade-reveal-b 1ms ease-in-out;
339
+ animation-timeline: scroll(self y);
340
+ animation-range: calc(
341
+ 100% - var(--scroll-fade-reveal, calc(var(--spacing) * 24))
342
+ )
343
+ 100%;
344
+ animation-fill-mode: both;
345
+ }
346
+
347
+ @supports not (animation-timeline: scroll()) {
348
+ --scroll-fade-b: var(--_scroll-fade-size-b);
349
+ }
350
+ }
351
+
352
+ @utility scroll-fade-l {
353
+ --_scroll-fade-size-s: var(
354
+ --scroll-fade-s-size,
355
+ var(--scroll-fade-size, min(12%, calc(var(--spacing) * 10)))
356
+ );
357
+ --scroll-fade-mask: linear-gradient(
358
+ to right,
359
+ transparent 0,
360
+ #000 var(--scroll-fade-s, 0px),
361
+ #000 100%
362
+ );
363
+ -webkit-mask-image: var(--scroll-fade-mask);
364
+ mask-image: var(--scroll-fade-mask);
365
+ -webkit-mask-composite: source-in;
366
+ mask-composite: intersect;
367
+ -webkit-mask-repeat: no-repeat;
368
+ mask-repeat: no-repeat;
369
+
370
+ @supports (animation-timeline: scroll()) {
371
+ animation: scroll-fade-reveal-s 1ms ease-in-out;
372
+ animation-timeline: scroll(self x);
373
+ animation-range: 0 var(--scroll-fade-reveal, calc(var(--spacing) * 24));
374
+ animation-fill-mode: both;
375
+ }
376
+
377
+ @supports not (animation-timeline: scroll()) {
378
+ --scroll-fade-s: var(--_scroll-fade-size-s);
379
+ }
380
+ }
381
+
382
+ @utility scroll-fade-r {
383
+ --_scroll-fade-size-e: var(
384
+ --scroll-fade-e-size,
385
+ var(--scroll-fade-size, min(12%, calc(var(--spacing) * 10)))
386
+ );
387
+ --scroll-fade-mask: linear-gradient(
388
+ to right,
389
+ #000 0,
390
+ #000 calc(100% - var(--scroll-fade-e, 0px)),
391
+ transparent 100%
392
+ );
393
+ -webkit-mask-image: var(--scroll-fade-mask);
394
+ mask-image: var(--scroll-fade-mask);
395
+ -webkit-mask-composite: source-in;
396
+ mask-composite: intersect;
397
+ -webkit-mask-repeat: no-repeat;
398
+ mask-repeat: no-repeat;
399
+
400
+ @supports (animation-timeline: scroll()) {
401
+ animation: scroll-fade-reveal-e 1ms ease-in-out;
402
+ animation-timeline: scroll(self x);
403
+ animation-range: calc(
404
+ 100% - var(--scroll-fade-reveal, calc(var(--spacing) * 24))
405
+ )
406
+ 100%;
407
+ animation-fill-mode: both;
408
+ }
409
+
410
+ @supports not (animation-timeline: scroll()) {
411
+ --scroll-fade-e: var(--_scroll-fade-size-e);
412
+ }
413
+ }
414
+
415
+ @utility scroll-fade-s {
416
+ --_scroll-fade-size-s: var(
417
+ --scroll-fade-s-size,
418
+ var(--scroll-fade-size, min(12%, calc(var(--spacing) * 10)))
419
+ );
420
+ --scroll-fade-mask: linear-gradient(
421
+ to right,
422
+ transparent 0,
423
+ #000 var(--scroll-fade-s, 0px),
424
+ #000 100%
425
+ );
426
+ &:where([dir="rtl"], [dir="rtl"] *) {
427
+ --scroll-fade-mask: linear-gradient(
428
+ to left,
429
+ transparent 0,
430
+ #000 var(--scroll-fade-s, 0px),
431
+ #000 100%
432
+ );
433
+ }
434
+ -webkit-mask-image: var(--scroll-fade-mask);
435
+ mask-image: var(--scroll-fade-mask);
436
+ -webkit-mask-composite: source-in;
437
+ mask-composite: intersect;
438
+ -webkit-mask-repeat: no-repeat;
439
+ mask-repeat: no-repeat;
440
+
441
+ @supports (animation-timeline: scroll()) {
442
+ animation: scroll-fade-reveal-s 1ms ease-in-out;
443
+ animation-timeline: scroll(self inline);
444
+ animation-range: 0 var(--scroll-fade-reveal, calc(var(--spacing) * 24));
445
+ animation-fill-mode: both;
446
+ }
447
+
448
+ @supports not (animation-timeline: scroll()) {
449
+ --scroll-fade-s: var(--_scroll-fade-size-s);
450
+ }
451
+ }
452
+
453
+ @utility scroll-fade-e {
454
+ --_scroll-fade-size-e: var(
455
+ --scroll-fade-e-size,
456
+ var(--scroll-fade-size, min(12%, calc(var(--spacing) * 10)))
457
+ );
458
+ --scroll-fade-mask: linear-gradient(
459
+ to right,
460
+ #000 0,
461
+ #000 calc(100% - var(--scroll-fade-e, 0px)),
462
+ transparent 100%
463
+ );
464
+ &:where([dir="rtl"], [dir="rtl"] *) {
465
+ --scroll-fade-mask: linear-gradient(
466
+ to left,
467
+ #000 0,
468
+ #000 calc(100% - var(--scroll-fade-e, 0px)),
469
+ transparent 100%
470
+ );
471
+ }
472
+ -webkit-mask-image: var(--scroll-fade-mask);
473
+ mask-image: var(--scroll-fade-mask);
474
+ -webkit-mask-composite: source-in;
475
+ mask-composite: intersect;
476
+ -webkit-mask-repeat: no-repeat;
477
+ mask-repeat: no-repeat;
478
+
479
+ @supports (animation-timeline: scroll()) {
480
+ animation: scroll-fade-reveal-e 1ms ease-in-out;
481
+ animation-timeline: scroll(self inline);
482
+ animation-range: calc(
483
+ 100% - var(--scroll-fade-reveal, calc(var(--spacing) * 24))
484
+ )
485
+ 100%;
486
+ animation-fill-mode: both;
487
+ }
488
+
489
+ @supports not (animation-timeline: scroll()) {
490
+ --scroll-fade-e: var(--_scroll-fade-size-e);
491
+ }
492
+ }
493
+
494
+ @utility scroll-fade-* {
495
+ --scroll-fade-size: calc(var(--spacing) * --value(integer));
496
+ --scroll-fade-size: --value([length], [percentage]);
497
+ }
498
+
499
+ @utility scroll-fade-t-* {
500
+ --scroll-fade-t-size: calc(var(--spacing) * --value(integer));
501
+ --scroll-fade-t-size: --value([length], [percentage]);
502
+ }
503
+
504
+ @utility scroll-fade-b-* {
505
+ --scroll-fade-b-size: calc(var(--spacing) * --value(integer));
506
+ --scroll-fade-b-size: --value([length], [percentage]);
507
+ }
508
+
509
+ @utility scroll-fade-s-* {
510
+ --scroll-fade-s-size: calc(var(--spacing) * --value(integer));
511
+ --scroll-fade-s-size: --value([length], [percentage]);
512
+ }
513
+
514
+ @utility scroll-fade-e-* {
515
+ --scroll-fade-e-size: calc(var(--spacing) * --value(integer));
516
+ --scroll-fade-e-size: --value([length], [percentage]);
517
+ }
518
+
519
+ @utility scroll-fade-none {
520
+ --scroll-fade-mask: none;
521
+ }
522
+
523
+ /* shimmer */
524
+ @property --shimmer-angle {
525
+ syntax: "<angle>";
526
+ inherits: true;
527
+ initial-value: 20deg;
528
+ }
529
+ @property --shimmer-image {
530
+ syntax: "*";
531
+ inherits: false;
532
+ }
533
+ @property --shimmer-text-fill {
534
+ syntax: "*";
535
+ inherits: false;
536
+ }
537
+
538
+ @theme inline {
539
+ @keyframes tw-shimmer {
540
+ from {
541
+ background-position: 100% 0;
542
+ }
543
+ to {
544
+ background-position: 0 0;
545
+ }
546
+ }
547
+ }
548
+
549
+ @utility shimmer {
550
+ --_spread: var(--shimmer-spread, calc(3ch + 40px));
551
+ --_base: currentColor;
552
+ --_highlight: var(
553
+ --shimmer-color,
554
+ oklch(from currentColor l c h / calc(alpha* 0.2))
555
+ );
556
+
557
+ background-image: var(
558
+ --shimmer-image,
559
+ linear-gradient(
560
+ calc(90deg + var(--shimmer-angle)),
561
+ var(--_base) calc(50% - var(--_spread)),
562
+ color-mix(in oklch, var(--_highlight), var(--_base) 50%)
563
+ calc(50% - var(--_spread) * 0.5),
564
+ var(--_highlight) 50%,
565
+ color-mix(in oklch, var(--_highlight), var(--_base) 50%)
566
+ calc(50% + var(--_spread) * 0.5),
567
+ var(--_base) calc(50% + var(--_spread))
568
+ )
569
+ );
570
+ background-repeat: no-repeat;
571
+ background-size: calc(200% + var(--_spread) * 2) 100%;
572
+ background-position: 0 0;
573
+ background-clip: text;
574
+ -webkit-background-clip: text;
575
+ -webkit-text-fill-color: var(--shimmer-text-fill, transparent);
576
+ animation: tw-shimmer var(--shimmer-duration, 2s) linear infinite;
577
+
578
+ @variant dark {
579
+ --_highlight: var(
580
+ --shimmer-color,
581
+ oklch(from currentColor max(0.8, calc(l + 0.4)) c h / calc(alpha + 0.4))
582
+ );
583
+ }
584
+
585
+ &:where([dir="rtl"], [dir="rtl"] *) {
586
+ animation-direction: reverse;
587
+ }
588
+
589
+ @media (prefers-reduced-motion: reduce) {
590
+ animation: none;
591
+ background-image: none;
592
+ -webkit-text-fill-color: currentColor;
593
+ }
594
+ }
595
+
596
+ @utility shimmer-once {
597
+ animation-iteration-count: 1;
598
+ }
599
+
600
+ @utility shimmer-reverse {
601
+ animation-direction: reverse;
602
+ }
603
+
604
+ @utility shimmer-none {
605
+ --shimmer-image: none;
606
+ --shimmer-text-fill: currentColor;
607
+ }
608
+
609
+ @utility shimmer-color-* {
610
+ --shimmer-color: --value(--color, [color]);
611
+ --shimmer-color: color-mix(
612
+ in oklch,
613
+ --value(--color, [color]) calc(--modifier(integer) * 1%),
614
+ transparent
615
+ );
616
+ }
617
+
618
+ @utility shimmer-duration-* {
619
+ --shimmer-duration: calc(--value(integer) * 1ms);
620
+ }
621
+
622
+ @utility shimmer-spread-* {
623
+ --shimmer-spread: calc(var(--spacing) * --value(integer));
624
+ --shimmer-spread: --value([length], [percentage]);
625
+ }
626
+
627
+ @utility shimmer-angle-* {
628
+ --shimmer-angle: calc(--value(integer) * 1deg);
629
+ }
630
+
631
+ /* Kept for backwards compatibility. Unlayered, so it still wins over other
632
+ utilities on a plain .shimmer element. Variants are handled in the utility. */
633
+ @media (prefers-reduced-motion: reduce) {
634
+ .shimmer {
635
+ animation: none;
636
+ background-image: none;
637
+ -webkit-text-fill-color: currentColor;
638
+ }
639
+ }