@yarcl/react 0.1.0 → 0.2.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/README.md +14 -2
- package/{src/apply.ts → dist/apply.d.ts} +4 -23
- package/dist/apply.js +37 -0
- package/dist/classes.d.ts +13 -0
- package/dist/classes.js +22 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +58 -0
- package/dist/color.js +49 -32
- package/dist/components/Accordion.d.ts +96 -0
- package/dist/components/Accordion.js +148 -0
- package/dist/components/Alert.d.ts +60 -0
- package/dist/components/Alert.js +61 -0
- package/dist/components/Avatar.d.ts +100 -0
- package/dist/components/Avatar.js +89 -0
- package/dist/components/Badge.d.ts +44 -0
- package/dist/components/Badge.js +43 -0
- package/dist/components/Breadcrumb.d.ts +77 -0
- package/dist/components/Breadcrumb.js +126 -0
- package/dist/components/Button.d.ts +18 -0
- package/dist/components/Button.js +33 -0
- package/dist/components/ButtonGroup.d.ts +29 -0
- package/dist/components/ButtonGroup.js +37 -0
- package/dist/components/Card.d.ts +36 -0
- package/dist/components/Card.js +26 -0
- package/dist/components/Checkbox.d.ts +28 -0
- package/dist/components/Checkbox.js +38 -0
- package/dist/components/Combobox.d.ts +75 -0
- package/dist/components/Combobox.js +362 -0
- package/dist/components/CommandPalette.d.ts +92 -0
- package/dist/components/CommandPalette.js +293 -0
- package/dist/components/DatePicker.d.ts +157 -0
- package/dist/components/DatePicker.js +230 -0
- package/dist/components/Dialog.d.ts +25 -0
- package/dist/components/Dialog.js +29 -0
- package/dist/components/Divider.d.ts +23 -0
- package/dist/components/Divider.js +25 -0
- package/dist/components/Drawer.d.ts +21 -0
- package/dist/components/Drawer.js +25 -0
- package/dist/components/EmptyState.d.ts +51 -0
- package/dist/components/EmptyState.js +47 -0
- package/dist/components/Field.d.ts +27 -0
- package/dist/components/Field.js +59 -0
- package/dist/components/Heading.d.ts +26 -0
- package/dist/components/Heading.js +25 -0
- package/dist/components/HoverCard.d.ts +47 -0
- package/dist/components/HoverCard.js +53 -0
- package/dist/components/IconButton.d.ts +19 -0
- package/dist/components/IconButton.js +32 -0
- package/dist/components/Inline.d.ts +21 -0
- package/dist/components/Inline.js +24 -0
- package/dist/components/Input.d.ts +19 -0
- package/dist/components/Input.js +25 -0
- package/dist/components/Label.d.ts +46 -0
- package/dist/components/Label.js +33 -0
- package/dist/components/Link.d.ts +27 -0
- package/dist/components/Link.js +26 -0
- package/dist/components/Menu.d.ts +73 -0
- package/dist/components/Menu.js +143 -0
- package/dist/components/Modal.d.ts +45 -0
- package/dist/components/Modal.js +110 -0
- package/dist/components/NumberInput.d.ts +49 -0
- package/dist/components/NumberInput.js +130 -0
- package/dist/components/Pagination.d.ts +86 -0
- package/dist/components/Pagination.js +119 -0
- package/dist/components/Popover.d.ts +72 -0
- package/dist/components/Popover.js +87 -0
- package/dist/components/Progress.d.ts +60 -0
- package/dist/components/Progress.js +59 -0
- package/dist/components/Radio.d.ts +32 -0
- package/dist/components/Radio.js +47 -0
- package/dist/components/RadioGroup.d.ts +57 -0
- package/dist/components/RadioGroup.js +68 -0
- package/dist/components/Select.d.ts +47 -0
- package/dist/components/Select.js +138 -0
- package/dist/components/Skeleton.d.ts +46 -0
- package/dist/components/Skeleton.js +40 -0
- package/dist/components/Slider.d.ts +126 -0
- package/dist/components/Slider.js +166 -0
- package/dist/components/Spinner.d.ts +23 -0
- package/dist/components/Spinner.js +23 -0
- package/dist/components/Stack.d.ts +35 -0
- package/dist/components/Stack.js +24 -0
- package/dist/components/Switch.d.ts +27 -0
- package/dist/components/Switch.js +33 -0
- package/dist/components/Table.d.ts +71 -0
- package/dist/components/Table.js +61 -0
- package/dist/components/Tabs.d.ts +66 -0
- package/dist/components/Tabs.js +109 -0
- package/dist/components/Text.d.ts +32 -0
- package/dist/components/Text.js +28 -0
- package/dist/components/Textarea.d.ts +15 -0
- package/dist/components/Textarea.js +24 -0
- package/dist/components/Toast.d.ts +90 -0
- package/dist/components/Toast.js +156 -0
- package/dist/components/ToggleGroup.d.ts +79 -0
- package/dist/components/ToggleGroup.js +101 -0
- package/dist/components/Tooltip.d.ts +46 -0
- package/dist/components/Tooltip.js +62 -0
- package/dist/components/VisuallyHidden.d.ts +18 -0
- package/dist/components/VisuallyHidden.js +22 -0
- package/dist/contrast.d.ts +32 -0
- package/dist/css.d.ts +2 -2
- package/dist/css.js +193 -157
- package/dist/define.d.ts +40 -15
- package/dist/define.js +30 -27
- package/dist/demo.d.ts +2 -0
- package/dist/demo.js +2 -0
- package/dist/esbuild.cjs +5 -0
- package/dist/esbuild.d.ts +4 -0
- package/dist/esbuild.js +6 -0
- package/dist/field-context.d.ts +16 -0
- package/dist/field-context.js +17 -0
- package/dist/floating.d.ts +12 -0
- package/dist/floating.js +52 -0
- package/dist/hooks.d.ts +1 -0
- package/dist/hooks.js +12 -0
- package/{src/index.ts → dist/index.d.ts} +11 -33
- package/dist/index.js +50 -0
- package/dist/init.d.ts +18 -0
- package/dist/init.js +224 -0
- package/dist/plugin.d.ts +10 -26
- package/dist/plugin.js +152 -78
- package/dist/reference/DemoYarcl.d.ts +12 -0
- package/dist/reference/DemoYarcl.js +312 -0
- package/dist/reference/DesignReference.d.ts +24 -0
- package/dist/reference/DesignReference.js +403 -0
- package/dist/reference/index.js +2 -0
- package/dist/rollup.cjs +5 -0
- package/dist/rollup.d.ts +4 -0
- package/dist/rollup.js +6 -0
- package/dist/rspack.cjs +5 -0
- package/dist/rspack.d.ts +4 -0
- package/dist/rspack.js +6 -0
- package/dist/runtime.d.ts +13 -0
- package/dist/runtime.js +30 -0
- package/dist/setup.d.ts +6 -0
- package/dist/setup.js +33 -0
- package/{src → dist}/styles.css +224 -106
- package/dist/themes/bloom.d.ts +295 -0
- package/dist/themes/bloom.js +202 -0
- package/dist/themes/brutalist.d.ts +277 -0
- package/dist/themes/brutalist.js +199 -0
- package/dist/themes/compact.d.ts +274 -0
- package/dist/themes/compact.js +200 -0
- package/dist/themes/contract.d.ts +23 -0
- package/dist/themes/editorial.d.ts +277 -0
- package/dist/themes/editorial.js +183 -0
- package/dist/themes/index.d.ts +1425 -0
- package/dist/themes/index.js +45 -0
- package/{src/types.ts → dist/types.d.ts} +40 -37
- package/dist/vite.cjs +5 -0
- package/dist/vite.d.ts +4 -0
- package/dist/vite.js +6 -0
- package/dist/webpack.cjs +5 -0
- package/dist/webpack.d.ts +4 -0
- package/dist/webpack.js +6 -0
- package/dist/yarcl.config.d.ts +276 -0
- package/dist/yarcl.config.js +273 -0
- package/package.json +69 -17
- package/src/classes.ts +0 -23
- package/src/color.ts +0 -48
- package/src/components/Accordion.tsx +0 -274
- package/src/components/Alert.tsx +0 -85
- package/src/components/Badge.tsx +0 -79
- package/src/components/Breadcrumb.tsx +0 -239
- package/src/components/Button.tsx +0 -58
- package/src/components/ButtonGroup.tsx +0 -61
- package/src/components/Card.tsx +0 -50
- package/src/components/Checkbox.tsx +0 -49
- package/src/components/Combobox.tsx +0 -522
- package/src/components/CommandPalette.tsx +0 -452
- package/src/components/DatePicker.tsx +0 -432
- package/src/components/Dialog.tsx +0 -39
- package/src/components/Divider.tsx +0 -34
- package/src/components/Drawer.tsx +0 -31
- package/src/components/Field.tsx +0 -61
- package/src/components/Heading.tsx +0 -40
- package/src/components/HoverCard.tsx +0 -108
- package/src/components/IconButton.tsx +0 -59
- package/src/components/Inline.tsx +0 -42
- package/src/components/Input.tsx +0 -28
- package/src/components/Label.tsx +0 -58
- package/src/components/Link.tsx +0 -41
- package/src/components/Menu.tsx +0 -207
- package/src/components/Modal.tsx +0 -164
- package/src/components/NumberInput.tsx +0 -208
- package/src/components/Pagination.tsx +0 -227
- package/src/components/Popover.tsx +0 -140
- package/src/components/Progress.tsx +0 -122
- package/src/components/Radio.tsx +0 -59
- package/src/components/RadioGroup.tsx +0 -114
- package/src/components/Select.tsx +0 -197
- package/src/components/Skeleton.tsx +0 -95
- package/src/components/Slider.tsx +0 -315
- package/src/components/Spinner.tsx +0 -38
- package/src/components/Stack.tsx +0 -57
- package/src/components/Switch.tsx +0 -42
- package/src/components/Table.tsx +0 -99
- package/src/components/Tabs.tsx +0 -159
- package/src/components/Text.tsx +0 -67
- package/src/components/Textarea.tsx +0 -26
- package/src/components/Toast.tsx +0 -190
- package/src/components/ToggleGroup.tsx +0 -227
- package/src/components/Tooltip.tsx +0 -78
- package/src/contrast.ts +0 -82
- package/src/css.ts +0 -228
- package/src/define.check.ts +0 -259
- package/src/define.ts +0 -379
- package/src/field-context.ts +0 -31
- package/src/floating.tsx +0 -61
- package/src/hooks.ts +0 -19
- package/src/plugin.ts +0 -94
- package/src/reference/DesignReference.tsx +0 -374
- package/src/runtime.ts +0 -38
- package/src/themes/bloom.ts +0 -72
- package/src/themes/brutalist.ts +0 -63
- package/src/themes/compact.ts +0 -63
- package/src/themes/contract.ts +0 -24
- package/src/themes/editorial.ts +0 -55
- package/src/themes/index.ts +0 -47
- package/src/yarcl.config.ts +0 -104
- /package/{src/reference/index.ts → dist/reference/index.d.ts} +0 -0
- /package/{src → dist}/reference/reference.css +0 -0
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import yarcl_config_default from "../yarcl.config.js";
|
|
2
|
+
import { brutalist } from "./brutalist.js";
|
|
3
|
+
import { compact } from "./compact.js";
|
|
4
|
+
import { editorial } from "./editorial.js";
|
|
5
|
+
import { bloom } from "./bloom.js";
|
|
6
|
+
//#region src/themes/index.ts
|
|
7
|
+
/**
|
|
8
|
+
* Every bundled theme, keyed by id, including the library defaults as `yarcl`.
|
|
9
|
+
* All of them satisfy {@link ThemeContract}, so they're interchangeable.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```ts
|
|
13
|
+
* // src/yarcl.config.ts: use a theme as is
|
|
14
|
+
* export { editorial as default } from '@yarcl/react/themes';
|
|
15
|
+
* ```
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```ts
|
|
19
|
+
* // or start from one and change what you need
|
|
20
|
+
* import { defineConfig } from '@yarcl/react/define';
|
|
21
|
+
* import { bloom } from '@yarcl/react/themes';
|
|
22
|
+
*
|
|
23
|
+
* export default defineConfig({
|
|
24
|
+
* ...bloom,
|
|
25
|
+
* colors: { ...bloom.colors, primary: { light: '#db2777', dark: '#f9a8d4' } },
|
|
26
|
+
* });
|
|
27
|
+
* ```
|
|
28
|
+
*/
|
|
29
|
+
var themes = {
|
|
30
|
+
yarcl: yarcl_config_default,
|
|
31
|
+
brutalist,
|
|
32
|
+
bloom,
|
|
33
|
+
compact,
|
|
34
|
+
editorial
|
|
35
|
+
};
|
|
36
|
+
/** Display names of the bundled themes. */
|
|
37
|
+
var themeNames = {
|
|
38
|
+
yarcl: "yarcl (default)",
|
|
39
|
+
brutalist: "Brutalist",
|
|
40
|
+
bloom: "Bloom",
|
|
41
|
+
compact: "Compact",
|
|
42
|
+
editorial: "Editorial"
|
|
43
|
+
};
|
|
44
|
+
//#endregion
|
|
45
|
+
export { bloom, brutalist, compact, editorial, themeNames, themes };
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type config from '@yarcl/config';
|
|
2
|
-
|
|
2
|
+
import type { ComponentName } from './define';
|
|
3
3
|
type Config = typeof config;
|
|
4
|
-
|
|
5
4
|
/** A key of the consumer's `sizes` config. */
|
|
6
5
|
export type Size = keyof Config['sizes'] & string;
|
|
7
6
|
/** A key of the consumer's `radii` config. */
|
|
@@ -20,50 +19,54 @@ export type Density = keyof Config['density'] & string;
|
|
|
20
19
|
export type ModalSize = keyof Config['modalSizes'] & string;
|
|
21
20
|
/** A key of the consumer's `typography.styles` config. */
|
|
22
21
|
export type TextStyle = keyof Config['typography']['styles'] & string;
|
|
23
|
-
|
|
22
|
+
type ConfiguredComponents = Config extends {
|
|
23
|
+
components?: infer C;
|
|
24
|
+
} ? NonNullable<C> : Record<never, never>;
|
|
25
|
+
/** A component's allowed size keys, or every global size when it has no restriction. */
|
|
26
|
+
export type ComponentSize<C extends ComponentName> = C extends keyof ConfiguredComponents ? ConfiguredComponents[C] extends {
|
|
27
|
+
allowedSizes: readonly (infer S)[];
|
|
28
|
+
} ? Extract<S, Size> : Size : Size;
|
|
24
29
|
/** Design token props shared by every sized, colored component. */
|
|
25
|
-
export interface TokenProps {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
30
|
+
export interface TokenProps<C extends ComponentName | undefined = undefined> {
|
|
31
|
+
/**
|
|
32
|
+
* Control size, from the `sizes` config.
|
|
33
|
+
* @default config.defaults.size
|
|
34
|
+
*/
|
|
35
|
+
size?: C extends ComponentName ? ComponentSize<C> : Size;
|
|
36
|
+
/**
|
|
37
|
+
* Border radius, from the `radii` config, or `'size'` for the radius named like the control's size.
|
|
38
|
+
* @default config.defaults.radius
|
|
39
|
+
*/
|
|
40
|
+
radius?: Radius | 'size';
|
|
41
|
+
/**
|
|
42
|
+
* Semantic color, from the `colors` config.
|
|
43
|
+
* @default config.defaults.color
|
|
44
|
+
*/
|
|
45
|
+
color?: Color;
|
|
41
46
|
}
|
|
42
|
-
|
|
43
47
|
/** Cross-axis alignment for layout components. */
|
|
44
48
|
export type Align = 'start' | 'center' | 'end' | 'stretch' | 'baseline';
|
|
45
49
|
/** Main-axis distribution for layout components. */
|
|
46
50
|
export type Justify = 'start' | 'center' | 'end' | 'between';
|
|
47
|
-
|
|
48
51
|
/** The `variant` prop shared by components that apply a style recipe. */
|
|
49
52
|
export interface VariantProps {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
53
|
+
/**
|
|
54
|
+
* Style recipe, from the `variants` config.
|
|
55
|
+
* @default config.defaults.variant
|
|
56
|
+
*/
|
|
57
|
+
variant?: Variant;
|
|
55
58
|
}
|
|
56
|
-
|
|
57
59
|
/** Values a component can receive from `components` in the config. */
|
|
58
60
|
export interface ComponentDefaults {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
61
|
+
size?: Size;
|
|
62
|
+
radius?: Radius | 'size';
|
|
63
|
+
color?: Color;
|
|
64
|
+
variant?: Variant;
|
|
65
|
+
selectedVariant?: Variant;
|
|
66
|
+
gap?: Spacing;
|
|
67
|
+
padding?: Spacing;
|
|
68
|
+
shadow?: Shadow;
|
|
69
|
+
density?: Density;
|
|
70
|
+
textStyle?: TextStyle;
|
|
69
71
|
}
|
|
72
|
+
export {};
|
package/dist/vite.cjs
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
let e=require("node:fs"),t=require("node:fs/promises"),n=require("node:module"),r=require("node:path"),i=require("jiti"),a=require("unplugin"),o=require("jsonc-parser");function s(e){let t=e.trim().replace(/^#/,``);if(!/^([0-9a-f]{3}|[0-9a-f]{6})$/i.test(t))return null;let n=t.length===3?[...t].map(e=>e+e).join(``):t;return[0,2,4].map(e=>parseInt(n.slice(e,e+2),16))}function c([e,t,n]){let[r,i,a]=[e,t,n].map(e=>{let t=e/255;return t<=.03928?t/12.92:((t+.055)/1.055)**2.4});return .2126*r+.7152*i+.0722*a}function l(e,t){let[n,r]=[c(e),c(t)].sort((e,t)=>t-e);return(n+.05)/(r+.05)}var u=[255,255,255],d=[0,0,0];function f(e,t,n){return e.map((e,r)=>Math.round(e+(t[r]-e)*n))}function p(e){return`#${e.map(e=>e.toString(16).padStart(2,`0`)).join(``)}`}function m(e,t,n,r){for(let i=0;i<=20;i++){let a=f(e,n,i/20);if(t.every(e=>l(a,e)>=r))return a}return n}function h(e){return l(e,u)>=l(e,d)?`#ffffff`:`#000000`}var g=4.5;function _(e){return e.replace(/[^a-zA-Z0-9_-]/g,e=>`\\${e}`)}function v({light:e,dark:t}){return e===t?e:`light-dark(${e}, ${t})`}function y(e,t,n){let r=[`light`,`dark`],i=typeof t.on==`string`?{light:t.on,dark:t.on}:t.on,a=r.map(r=>{let a=s(t[r]);if(i){let t=s(i[r]);return a&&t&&l(a,t)<g&&n(`colors.${e}: ${r} foreground contrast ${l(a,t).toFixed(2)}:1 is below ${g}:1`),i[r]}if(!a)return n(`colors.${e}: cannot compute a ${r} foreground from "${t[r]}"; use a hex value or set \`on\``),`#ffffff`;let o=h(a),c=l(a,s(o));return c<g&&n(`colors.${e}: best ${r} foreground contrast is ${c.toFixed(2)}:1, below ${g}:1`),o});return v({light:a[0],dark:a[1]})}var b=e=>`color-mix(in oklab, var(--yarcl-c) ${e}%, transparent)`,x=e=>`color-mix(in oklab, var(--yarcl-c), var(--yarcl-c-on) ${e}%)`,S={fill:[`var(--yarcl-c)`,x(12),x(20)],tint:[b(14),b(22),b(30)],none:[`transparent`,b(10),b(18)]},C={color:`var(--yarcl-c)`,neutral:`var(--yarcl-neutral-border)`,none:`transparent`},w={on:`var(--yarcl-c-on)`,color:`var(--yarcl-c-text)`,neutral:`var(--yarcl-neutral-text)`},T={woff2:`woff2`,woff:`woff`,ttf:`truetype`,otf:`opentype`};function E(e){let t=(Array.isArray(e.src)?e.src:[e.src]).map(e=>{if(e.startsWith(`local(`))return e;let t=T[e.split(/[?#]/)[0].split(`.`).pop()?.toLowerCase()??``];return`url(${JSON.stringify(e)})${t?` format("${t}")`:``}`});return k(`@font-face`,[[`font-family`,JSON.stringify(e.family)],[`src`,t.join(`, `)],...e.weight==null?[]:[[`font-weight`,e.weight]],...e.style?[[`font-style`,e.style]]:[],[`font-display`,e.display??`swap`]])}var D=[0,.14,.22];function O(e,t,n){if(t.text)return v(typeof t.text==`string`?{light:t.text,dark:t.text}:t.text);let r=[`light`,`dark`].map(e=>{let r=s(t[e]),i=s(n.text[e]),a=[s(n.bg[e]),s(n.surface[e])];return!r||!i||a.some(e=>!e)?t[e]:p(m(r,a.flatMap(e=>D.map(t=>f(e,r,t))),i,g))});return v({light:r[0],dark:r[1]})}function k(e,t){return`${e} {\n${t.map(([e,t])=>` ${e}: ${t};`).join(`
|
|
2
|
+
`)}\n}`}var A={height:`h`,paddingX:`px`,fontSize:`fs`,iconSize:`icon`};function j(e,t=()=>{}){let n=[[`color-scheme`,`light dark`]],r=[];for(let[i,a]of Object.entries(e.colors)){let o=_(i);n.push([`--yarcl-color-${o}`,v(a)],[`--yarcl-color-${o}-on`,y(i,a,t)],[`--yarcl-color-${o}-text`,O(i,a,e.neutrals)]),r.push(k(`.yarcl-color-${o}`,[[`--yarcl-c`,`var(--yarcl-color-${o})`],[`--yarcl-c-on`,`var(--yarcl-color-${o}-on)`],[`--yarcl-c-text`,`var(--yarcl-color-${o}-text)`]]))}for(let[t,r]of Object.entries(e.neutrals))n.push([`--yarcl-neutral-${_(t)}`,v(r)]);for(let[t,i]of Object.entries(e.sizes)){let e=_(t);n.push([`--yarcl-size-${e}-height`,i.height],[`--yarcl-size-${e}-padding-x`,i.paddingX],[`--yarcl-size-${e}-font-size`,i.fontSize],[`--yarcl-size-${e}-icon-size`,i.iconSize]),r.push(k(`.yarcl-size-${e}`,[[`--yarcl-h`,`var(--yarcl-size-${e}-height)`],[`--yarcl-px`,`var(--yarcl-size-${e}-padding-x)`],[`--yarcl-fs`,`var(--yarcl-size-${e}-font-size)`],[`--yarcl-icon`,`var(--yarcl-size-${e}-icon-size)`]]))}for(let[t,{sizeOverrides:n}]of Object.entries(e.components??{}))for(let[e,i]of Object.entries(n??{})){let n=Object.entries(i).map(([e,t])=>[`--yarcl-${A[e]}`,t]),a=`.yarcl-sized-${_(t)}`,o=`.yarcl-size-${_(e)}`;n.length&&r.push(k(`${a}${o},\n${a}${a} ${o}`,n))}for(let[t,i]of Object.entries(e.radii)){let e=_(t);n.push([`--yarcl-radius-${e}`,i]),r.push(k(`.yarcl-radius-${e}`,[[`--yarcl-r`,`var(--yarcl-radius-${e})`]]))}for(let[t,n]of Object.entries(e.variants)){let[e,i,a]=S[n.background];r.push(k(`.yarcl-variant-${_(t)}`,[[`--yarcl-v-bg`,e],[`--yarcl-v-bg-hover`,i],[`--yarcl-v-bg-active`,a],[`--yarcl-v-border`,C[n.border]],[`--yarcl-v-fg`,w[n.text]]]))}for(let[t,i]of Object.entries(e.spacing)){let e=_(t);n.push([`--yarcl-space-${e}`,i]),r.push(k(`.yarcl-gap-${e}`,[[`--yarcl-component-gap`,`var(--yarcl-space-${e})`]]),k(`.yarcl-padding-${e}`,[[`--yarcl-component-padding`,`var(--yarcl-space-${e})`]]))}for(let[t,i]of Object.entries(e.shadows)){let e=_(t);n.push([`--yarcl-shadow-${e}`,i]),r.push(k(`.yarcl-shadow-${e}`,[[`box-shadow`,`var(--yarcl-shadow-${e})`]]))}for(let[t,i]of Object.entries(e.modalSizes)){let e=_(t);n.push([`--yarcl-modal-${e}`,i]),r.push(k(`.yarcl-modal-size-${e}`,[[`--yarcl-modal-width`,`var(--yarcl-modal-${e})`]]))}for(let[t,n]of Object.entries(e.density))r.push(k(`.yarcl-density-${_(t)}`,[[`--yarcl-cell-px`,n.paddingX],[`--yarcl-cell-py`,n.paddingY],[`--yarcl-cell-fs`,n.fontSize]]));for(let[t,r]of Object.entries(e.typography.families))n.push([`--yarcl-font-${_(t)}`,r]);for(let[t,n]of Object.entries(e.typography.styles))r.push(k(`.yarcl-type-${_(t)}`,[[`font-family`,`var(--yarcl-font-${_(n.family)})`],[`font-size`,n.size],[`font-weight`,n.weight],[`line-height`,n.lineHeight],...n.letterSpacing?[[`letter-spacing`,n.letterSpacing]]:[]]));for(let[t,r]of Object.entries(e.zIndex))n.push([`--yarcl-z-${_(t)}`,r]);for(let[t,r]of Object.entries(e.motion))n.push([`--yarcl-motion-${_(t)}`,r]);for(let[t,r]of Object.entries(e.borders))n.push([`--yarcl-border-${_(t)}`,r]);let i=_(e.defaults.size),a=e.defaults.radius===`size`?i:_(e.defaults.radius);return n.push([`--yarcl-focus-width`,e.focusRing.width],[`--yarcl-focus-offset`,e.focusRing.offset],[`--yarcl-focus-style`,e.focusRing.style??`solid`],[`--yarcl-focus-color`,`var(--yarcl-color-${_(e.focusRing.color)})`],[`--yarcl-error`,`var(--yarcl-color-${_(e.defaults.errorColor)})`],[`--yarcl-floating-shadow`,`var(--yarcl-shadow-${_(e.defaults.floatingShadow)})`],[`--yarcl-padding`,`var(--yarcl-space-${_(e.defaults.padding)})`],[`--yarcl-gap`,`var(--yarcl-space-${_(e.defaults.gap)})`],[`--yarcl-h`,`var(--yarcl-size-${i}-height)`],[`--yarcl-px`,`var(--yarcl-size-${i}-padding-x)`],[`--yarcl-fs`,`var(--yarcl-size-${i}-font-size)`],[`--yarcl-icon`,`var(--yarcl-size-${i}-icon-size)`],[`--yarcl-r`,`var(--yarcl-radius-${a}, 0)`]),[...(e.typography.fontFaces??[]).map(E),k(`:root`,n),...r].join(`
|
|
3
|
+
|
|
4
|
+
`)+`
|
|
5
|
+
`}var M=`@yarcl/config`,N=[`tsconfig.app.json`,`tsconfig.json`];function P(t){return N.map(e=>(0,r.resolve)(t,e)).find(t=>(0,e.existsSync)(t))}function F(e,t){let n=(0,r.relative)(e,t).split(r.sep).join(`/`);return n.startsWith(`.`)?n:`./${n}`}function I(t,n,i=`build tool`){let a=P(t);if(!a)throw Error(`yarcl: No tsconfig.app.json or tsconfig.json found in ${t}. Run "yarcl init".`);let s=[],c=(0,o.parse)((0,e.readFileSync)(a,`utf8`),s,{allowTrailingComma:!0});if(s.length>0)throw Error(`yarcl: Could not parse ${F(t,a)}.`);let l=c?.compilerOptions?.paths?.[M],u=(0,r.resolve)(t,n),d=Array.isArray(l)&&typeof l[0]==`string`?(0,r.resolve)((0,r.dirname)(a),l[0]):void 0;if(d===u)return;let f=d?`"${F(t,d)}"`:`no path`;throw Error(`yarcl: Config path mismatch. ${i} uses "${n}", but ${F(t,a)} has ${f} for "${M}". Run "yarcl init --config ${n}".`)}var L=`@yarcl/react/styles.css`,R=`\0${L}`,z=`@yarcl/config`,B=`@yarcl/react`,V=(0,n.createRequire)(typeof __filename==`string`?__filename:{}.url),H=[``,`.ts`,`.tsx`,`.mts`,`.cts`,`.js`,`.jsx`,`.mjs`,`.cjs`,`.json`],U=/(?:\bimport\s*(?:[\s\S]*?\sfrom\s*)?|\bexport\s*[\s\S]*?\sfrom\s*|\bimport\s*\()(['"])(\.{1,2}\/[^'"]+)\1/g;function W(t,n){let i=(0,r.resolve)((0,r.dirname)(t),n);for(let t of H){let n=`${i}${t}`;if((0,e.existsSync)(n))return n}for(let t of H.slice(1)){let n=(0,r.resolve)(i,`index${t}`);if((0,e.existsSync)(n))return n}}async function G(e){let n=new Set,i=async e=>{if(n.has(e)||(n.add(e),(0,r.extname)(e)===`.json`))return;let a=[...(await(0,t.readFile)(e,`utf8`)).matchAll(U)].map(t=>W(e,t[2])).filter(e=>e!==void 0);await Promise.all(a.map(i))};return await i(e),n}function K(){return V.resolve(`@yarcl/react/defaults`)}var q=(0,a.createUnplugin)((n={},a)=>{let o=n.config??`src/yarcl.config.ts`,s=(0,r.resolve)(n.root??process.cwd()),c=``,l=``,u=``,d=``,f=``,p=new Set,m=()=>{I(s,o,a.framework);let t=(0,r.resolve)(s,o),n=K();c=(0,e.existsSync)(t)?t:n,d=(0,r.resolve)((0,r.dirname)(n),`styles.css`),f=(0,r.resolve)((0,r.dirname)(n),`reference/reference.css`)};return{name:`yarcl`,enforce:`pre`,buildStart(){m()},resolveId:{filter:{id:/^(?:@yarcl\/config|@yarcl\/react\/styles\.css)$/},handler(e){if(e===z)return a.framework===`esbuild`?void 0:c;if(e===L)return R}},load:{filter:{id:/(?:@yarcl\/react\/styles\.css|\/(?:styles|reference)\.css)$/},async handler(n){if(a.framework===`rollup`&&(n===d||n===f))return l+=`${await(0,t.readFile)(n,`utf8`)}\n`,``;if(n!==R)return;let o=await(0,i.createJiti)((0,r.resolve)(s,`package.json`),{moduleCache:!1}).import(c,{default:!0});p=(0,e.existsSync)(c)?await G(c):new Set([c]),p.forEach(e=>this.addWatchFile(e));let m=j(o,e=>this.warn(e));return a.framework===`rollup`?(u=m,``):m}},rollup:{generateBundle(){this.emitFile({type:`asset`,fileName:`yarcl.css`,source:`${u}\n${l}`})}},vite:{config(e){return s=(0,r.resolve)(n.root??e.root??process.cwd()),{optimizeDeps:{exclude:[B],include:[`@floating-ui/react`,`date-fns`,`date-fns/locale`,`date-fns/locale/en-US`].map(e=>`${B} > ${e}`)},ssr:{noExternal:[B]}}},handleHotUpdate({file:e,server:t,modules:n}){if(!p.has(e))return;let r=t.moduleGraph.getModuleById(R);if(r)return t.moduleGraph.invalidateModule(r),[...n,r]}},webpack(e){s=(0,r.resolve)(n.root??e.context)},rspack(e){s=(0,r.resolve)(n.root??e.context)},esbuild:{config(e){s=(0,r.resolve)(n.root??e.absWorkingDir??process.cwd()),m()},setup(e){e.onResolve({filter:/^@yarcl\/config$/},()=>({path:c}))},loader:`css`}}}).vite;module.exports=q;
|
package/dist/vite.d.ts
ADDED
package/dist/vite.js
ADDED
package/dist/webpack.cjs
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
let e=require("node:fs"),t=require("node:fs/promises"),n=require("node:module"),r=require("node:path"),i=require("jiti"),a=require("unplugin"),o=require("jsonc-parser");function s(e){let t=e.trim().replace(/^#/,``);if(!/^([0-9a-f]{3}|[0-9a-f]{6})$/i.test(t))return null;let n=t.length===3?[...t].map(e=>e+e).join(``):t;return[0,2,4].map(e=>parseInt(n.slice(e,e+2),16))}function c([e,t,n]){let[r,i,a]=[e,t,n].map(e=>{let t=e/255;return t<=.03928?t/12.92:((t+.055)/1.055)**2.4});return .2126*r+.7152*i+.0722*a}function l(e,t){let[n,r]=[c(e),c(t)].sort((e,t)=>t-e);return(n+.05)/(r+.05)}var u=[255,255,255],d=[0,0,0];function f(e,t,n){return e.map((e,r)=>Math.round(e+(t[r]-e)*n))}function p(e){return`#${e.map(e=>e.toString(16).padStart(2,`0`)).join(``)}`}function m(e,t,n,r){for(let i=0;i<=20;i++){let a=f(e,n,i/20);if(t.every(e=>l(a,e)>=r))return a}return n}function h(e){return l(e,u)>=l(e,d)?`#ffffff`:`#000000`}var g=4.5;function _(e){return e.replace(/[^a-zA-Z0-9_-]/g,e=>`\\${e}`)}function v({light:e,dark:t}){return e===t?e:`light-dark(${e}, ${t})`}function y(e,t,n){let r=[`light`,`dark`],i=typeof t.on==`string`?{light:t.on,dark:t.on}:t.on,a=r.map(r=>{let a=s(t[r]);if(i){let t=s(i[r]);return a&&t&&l(a,t)<g&&n(`colors.${e}: ${r} foreground contrast ${l(a,t).toFixed(2)}:1 is below ${g}:1`),i[r]}if(!a)return n(`colors.${e}: cannot compute a ${r} foreground from "${t[r]}"; use a hex value or set \`on\``),`#ffffff`;let o=h(a),c=l(a,s(o));return c<g&&n(`colors.${e}: best ${r} foreground contrast is ${c.toFixed(2)}:1, below ${g}:1`),o});return v({light:a[0],dark:a[1]})}var b=e=>`color-mix(in oklab, var(--yarcl-c) ${e}%, transparent)`,x=e=>`color-mix(in oklab, var(--yarcl-c), var(--yarcl-c-on) ${e}%)`,S={fill:[`var(--yarcl-c)`,x(12),x(20)],tint:[b(14),b(22),b(30)],none:[`transparent`,b(10),b(18)]},C={color:`var(--yarcl-c)`,neutral:`var(--yarcl-neutral-border)`,none:`transparent`},w={on:`var(--yarcl-c-on)`,color:`var(--yarcl-c-text)`,neutral:`var(--yarcl-neutral-text)`},T={woff2:`woff2`,woff:`woff`,ttf:`truetype`,otf:`opentype`};function E(e){let t=(Array.isArray(e.src)?e.src:[e.src]).map(e=>{if(e.startsWith(`local(`))return e;let t=T[e.split(/[?#]/)[0].split(`.`).pop()?.toLowerCase()??``];return`url(${JSON.stringify(e)})${t?` format("${t}")`:``}`});return k(`@font-face`,[[`font-family`,JSON.stringify(e.family)],[`src`,t.join(`, `)],...e.weight==null?[]:[[`font-weight`,e.weight]],...e.style?[[`font-style`,e.style]]:[],[`font-display`,e.display??`swap`]])}var D=[0,.14,.22];function O(e,t,n){if(t.text)return v(typeof t.text==`string`?{light:t.text,dark:t.text}:t.text);let r=[`light`,`dark`].map(e=>{let r=s(t[e]),i=s(n.text[e]),a=[s(n.bg[e]),s(n.surface[e])];return!r||!i||a.some(e=>!e)?t[e]:p(m(r,a.flatMap(e=>D.map(t=>f(e,r,t))),i,g))});return v({light:r[0],dark:r[1]})}function k(e,t){return`${e} {\n${t.map(([e,t])=>` ${e}: ${t};`).join(`
|
|
2
|
+
`)}\n}`}var A={height:`h`,paddingX:`px`,fontSize:`fs`,iconSize:`icon`};function j(e,t=()=>{}){let n=[[`color-scheme`,`light dark`]],r=[];for(let[i,a]of Object.entries(e.colors)){let o=_(i);n.push([`--yarcl-color-${o}`,v(a)],[`--yarcl-color-${o}-on`,y(i,a,t)],[`--yarcl-color-${o}-text`,O(i,a,e.neutrals)]),r.push(k(`.yarcl-color-${o}`,[[`--yarcl-c`,`var(--yarcl-color-${o})`],[`--yarcl-c-on`,`var(--yarcl-color-${o}-on)`],[`--yarcl-c-text`,`var(--yarcl-color-${o}-text)`]]))}for(let[t,r]of Object.entries(e.neutrals))n.push([`--yarcl-neutral-${_(t)}`,v(r)]);for(let[t,i]of Object.entries(e.sizes)){let e=_(t);n.push([`--yarcl-size-${e}-height`,i.height],[`--yarcl-size-${e}-padding-x`,i.paddingX],[`--yarcl-size-${e}-font-size`,i.fontSize],[`--yarcl-size-${e}-icon-size`,i.iconSize]),r.push(k(`.yarcl-size-${e}`,[[`--yarcl-h`,`var(--yarcl-size-${e}-height)`],[`--yarcl-px`,`var(--yarcl-size-${e}-padding-x)`],[`--yarcl-fs`,`var(--yarcl-size-${e}-font-size)`],[`--yarcl-icon`,`var(--yarcl-size-${e}-icon-size)`]]))}for(let[t,{sizeOverrides:n}]of Object.entries(e.components??{}))for(let[e,i]of Object.entries(n??{})){let n=Object.entries(i).map(([e,t])=>[`--yarcl-${A[e]}`,t]),a=`.yarcl-sized-${_(t)}`,o=`.yarcl-size-${_(e)}`;n.length&&r.push(k(`${a}${o},\n${a}${a} ${o}`,n))}for(let[t,i]of Object.entries(e.radii)){let e=_(t);n.push([`--yarcl-radius-${e}`,i]),r.push(k(`.yarcl-radius-${e}`,[[`--yarcl-r`,`var(--yarcl-radius-${e})`]]))}for(let[t,n]of Object.entries(e.variants)){let[e,i,a]=S[n.background];r.push(k(`.yarcl-variant-${_(t)}`,[[`--yarcl-v-bg`,e],[`--yarcl-v-bg-hover`,i],[`--yarcl-v-bg-active`,a],[`--yarcl-v-border`,C[n.border]],[`--yarcl-v-fg`,w[n.text]]]))}for(let[t,i]of Object.entries(e.spacing)){let e=_(t);n.push([`--yarcl-space-${e}`,i]),r.push(k(`.yarcl-gap-${e}`,[[`--yarcl-component-gap`,`var(--yarcl-space-${e})`]]),k(`.yarcl-padding-${e}`,[[`--yarcl-component-padding`,`var(--yarcl-space-${e})`]]))}for(let[t,i]of Object.entries(e.shadows)){let e=_(t);n.push([`--yarcl-shadow-${e}`,i]),r.push(k(`.yarcl-shadow-${e}`,[[`box-shadow`,`var(--yarcl-shadow-${e})`]]))}for(let[t,i]of Object.entries(e.modalSizes)){let e=_(t);n.push([`--yarcl-modal-${e}`,i]),r.push(k(`.yarcl-modal-size-${e}`,[[`--yarcl-modal-width`,`var(--yarcl-modal-${e})`]]))}for(let[t,n]of Object.entries(e.density))r.push(k(`.yarcl-density-${_(t)}`,[[`--yarcl-cell-px`,n.paddingX],[`--yarcl-cell-py`,n.paddingY],[`--yarcl-cell-fs`,n.fontSize]]));for(let[t,r]of Object.entries(e.typography.families))n.push([`--yarcl-font-${_(t)}`,r]);for(let[t,n]of Object.entries(e.typography.styles))r.push(k(`.yarcl-type-${_(t)}`,[[`font-family`,`var(--yarcl-font-${_(n.family)})`],[`font-size`,n.size],[`font-weight`,n.weight],[`line-height`,n.lineHeight],...n.letterSpacing?[[`letter-spacing`,n.letterSpacing]]:[]]));for(let[t,r]of Object.entries(e.zIndex))n.push([`--yarcl-z-${_(t)}`,r]);for(let[t,r]of Object.entries(e.motion))n.push([`--yarcl-motion-${_(t)}`,r]);for(let[t,r]of Object.entries(e.borders))n.push([`--yarcl-border-${_(t)}`,r]);let i=_(e.defaults.size),a=e.defaults.radius===`size`?i:_(e.defaults.radius);return n.push([`--yarcl-focus-width`,e.focusRing.width],[`--yarcl-focus-offset`,e.focusRing.offset],[`--yarcl-focus-style`,e.focusRing.style??`solid`],[`--yarcl-focus-color`,`var(--yarcl-color-${_(e.focusRing.color)})`],[`--yarcl-error`,`var(--yarcl-color-${_(e.defaults.errorColor)})`],[`--yarcl-floating-shadow`,`var(--yarcl-shadow-${_(e.defaults.floatingShadow)})`],[`--yarcl-padding`,`var(--yarcl-space-${_(e.defaults.padding)})`],[`--yarcl-gap`,`var(--yarcl-space-${_(e.defaults.gap)})`],[`--yarcl-h`,`var(--yarcl-size-${i}-height)`],[`--yarcl-px`,`var(--yarcl-size-${i}-padding-x)`],[`--yarcl-fs`,`var(--yarcl-size-${i}-font-size)`],[`--yarcl-icon`,`var(--yarcl-size-${i}-icon-size)`],[`--yarcl-r`,`var(--yarcl-radius-${a}, 0)`]),[...(e.typography.fontFaces??[]).map(E),k(`:root`,n),...r].join(`
|
|
3
|
+
|
|
4
|
+
`)+`
|
|
5
|
+
`}var M=`@yarcl/config`,N=[`tsconfig.app.json`,`tsconfig.json`];function P(t){return N.map(e=>(0,r.resolve)(t,e)).find(t=>(0,e.existsSync)(t))}function F(e,t){let n=(0,r.relative)(e,t).split(r.sep).join(`/`);return n.startsWith(`.`)?n:`./${n}`}function I(t,n,i=`build tool`){let a=P(t);if(!a)throw Error(`yarcl: No tsconfig.app.json or tsconfig.json found in ${t}. Run "yarcl init".`);let s=[],c=(0,o.parse)((0,e.readFileSync)(a,`utf8`),s,{allowTrailingComma:!0});if(s.length>0)throw Error(`yarcl: Could not parse ${F(t,a)}.`);let l=c?.compilerOptions?.paths?.[M],u=(0,r.resolve)(t,n),d=Array.isArray(l)&&typeof l[0]==`string`?(0,r.resolve)((0,r.dirname)(a),l[0]):void 0;if(d===u)return;let f=d?`"${F(t,d)}"`:`no path`;throw Error(`yarcl: Config path mismatch. ${i} uses "${n}", but ${F(t,a)} has ${f} for "${M}". Run "yarcl init --config ${n}".`)}var L=`@yarcl/react/styles.css`,R=`\0${L}`,z=`@yarcl/config`,B=`@yarcl/react`,V=(0,n.createRequire)(typeof __filename==`string`?__filename:{}.url),H=[``,`.ts`,`.tsx`,`.mts`,`.cts`,`.js`,`.jsx`,`.mjs`,`.cjs`,`.json`],U=/(?:\bimport\s*(?:[\s\S]*?\sfrom\s*)?|\bexport\s*[\s\S]*?\sfrom\s*|\bimport\s*\()(['"])(\.{1,2}\/[^'"]+)\1/g;function W(t,n){let i=(0,r.resolve)((0,r.dirname)(t),n);for(let t of H){let n=`${i}${t}`;if((0,e.existsSync)(n))return n}for(let t of H.slice(1)){let n=(0,r.resolve)(i,`index${t}`);if((0,e.existsSync)(n))return n}}async function G(e){let n=new Set,i=async e=>{if(n.has(e)||(n.add(e),(0,r.extname)(e)===`.json`))return;let a=[...(await(0,t.readFile)(e,`utf8`)).matchAll(U)].map(t=>W(e,t[2])).filter(e=>e!==void 0);await Promise.all(a.map(i))};return await i(e),n}function K(){return V.resolve(`@yarcl/react/defaults`)}var q=(0,a.createUnplugin)((n={},a)=>{let o=n.config??`src/yarcl.config.ts`,s=(0,r.resolve)(n.root??process.cwd()),c=``,l=``,u=``,d=``,f=``,p=new Set,m=()=>{I(s,o,a.framework);let t=(0,r.resolve)(s,o),n=K();c=(0,e.existsSync)(t)?t:n,d=(0,r.resolve)((0,r.dirname)(n),`styles.css`),f=(0,r.resolve)((0,r.dirname)(n),`reference/reference.css`)};return{name:`yarcl`,enforce:`pre`,buildStart(){m()},resolveId:{filter:{id:/^(?:@yarcl\/config|@yarcl\/react\/styles\.css)$/},handler(e){if(e===z)return a.framework===`esbuild`?void 0:c;if(e===L)return R}},load:{filter:{id:/(?:@yarcl\/react\/styles\.css|\/(?:styles|reference)\.css)$/},async handler(n){if(a.framework===`rollup`&&(n===d||n===f))return l+=`${await(0,t.readFile)(n,`utf8`)}\n`,``;if(n!==R)return;let o=await(0,i.createJiti)((0,r.resolve)(s,`package.json`),{moduleCache:!1}).import(c,{default:!0});p=(0,e.existsSync)(c)?await G(c):new Set([c]),p.forEach(e=>this.addWatchFile(e));let m=j(o,e=>this.warn(e));return a.framework===`rollup`?(u=m,``):m}},rollup:{generateBundle(){this.emitFile({type:`asset`,fileName:`yarcl.css`,source:`${u}\n${l}`})}},vite:{config(e){return s=(0,r.resolve)(n.root??e.root??process.cwd()),{optimizeDeps:{exclude:[B],include:[`@floating-ui/react`,`date-fns`,`date-fns/locale`,`date-fns/locale/en-US`].map(e=>`${B} > ${e}`)},ssr:{noExternal:[B]}}},handleHotUpdate({file:e,server:t,modules:n}){if(!p.has(e))return;let r=t.moduleGraph.getModuleById(R);if(r)return t.moduleGraph.invalidateModule(r),[...n,r]}},webpack(e){s=(0,r.resolve)(n.root??e.context)},rspack(e){s=(0,r.resolve)(n.root??e.context)},esbuild:{config(e){s=(0,r.resolve)(n.root??e.absWorkingDir??process.cwd()),m()},setup(e){e.onResolve({filter:/^@yarcl\/config$/},()=>({path:c}))},loader:`css`}}}).webpack;module.exports=q;
|
package/dist/webpack.js
ADDED
|
@@ -0,0 +1,276 @@
|
|
|
1
|
+
/** The library's default design system, used when the consumer provides no config. */
|
|
2
|
+
declare const _default: {
|
|
3
|
+
readonly colors: {
|
|
4
|
+
readonly primary: {
|
|
5
|
+
readonly light: "#2d4bb8";
|
|
6
|
+
readonly dark: "#8aa2ff";
|
|
7
|
+
};
|
|
8
|
+
readonly neutral: {
|
|
9
|
+
readonly light: "#4b5263";
|
|
10
|
+
readonly dark: "#a3a9b8";
|
|
11
|
+
};
|
|
12
|
+
readonly success: {
|
|
13
|
+
readonly light: "#15803d";
|
|
14
|
+
readonly dark: "#4ade80";
|
|
15
|
+
};
|
|
16
|
+
readonly warning: {
|
|
17
|
+
readonly light: "#b45309";
|
|
18
|
+
readonly dark: "#fbbf24";
|
|
19
|
+
};
|
|
20
|
+
readonly danger: {
|
|
21
|
+
readonly light: "#dc2626";
|
|
22
|
+
readonly dark: "#f87171";
|
|
23
|
+
};
|
|
24
|
+
readonly info: {
|
|
25
|
+
readonly light: "#0369a1";
|
|
26
|
+
readonly dark: "#38bdf8";
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
readonly neutrals: {
|
|
30
|
+
readonly bg: {
|
|
31
|
+
readonly light: "#f8f9fb";
|
|
32
|
+
readonly dark: "#0f1115";
|
|
33
|
+
};
|
|
34
|
+
readonly surface: {
|
|
35
|
+
readonly light: "#ffffff";
|
|
36
|
+
readonly dark: "#181b21";
|
|
37
|
+
};
|
|
38
|
+
readonly text: {
|
|
39
|
+
readonly light: "#101828";
|
|
40
|
+
readonly dark: "#e6e8ec";
|
|
41
|
+
};
|
|
42
|
+
readonly muted: {
|
|
43
|
+
readonly light: "#667085";
|
|
44
|
+
readonly dark: "#8b93a1";
|
|
45
|
+
};
|
|
46
|
+
readonly border: {
|
|
47
|
+
readonly light: "#d0d5dd";
|
|
48
|
+
readonly dark: "#2e333d";
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
readonly sizes: {
|
|
52
|
+
readonly xs: {
|
|
53
|
+
readonly height: "1.75rem";
|
|
54
|
+
readonly paddingX: "0.625rem";
|
|
55
|
+
readonly fontSize: "0.75rem";
|
|
56
|
+
readonly iconSize: "0.75rem";
|
|
57
|
+
};
|
|
58
|
+
readonly sm: {
|
|
59
|
+
readonly height: "2rem";
|
|
60
|
+
readonly paddingX: "0.75rem";
|
|
61
|
+
readonly fontSize: "0.8125rem";
|
|
62
|
+
readonly iconSize: "0.875rem";
|
|
63
|
+
};
|
|
64
|
+
readonly md: {
|
|
65
|
+
readonly height: "2.5rem";
|
|
66
|
+
readonly paddingX: "1rem";
|
|
67
|
+
readonly fontSize: "0.875rem";
|
|
68
|
+
readonly iconSize: "1rem";
|
|
69
|
+
};
|
|
70
|
+
readonly lg: {
|
|
71
|
+
readonly height: "3rem";
|
|
72
|
+
readonly paddingX: "1.25rem";
|
|
73
|
+
readonly fontSize: "1rem";
|
|
74
|
+
readonly iconSize: "1.25rem";
|
|
75
|
+
};
|
|
76
|
+
readonly xl: {
|
|
77
|
+
readonly height: "3.5rem";
|
|
78
|
+
readonly paddingX: "1.5rem";
|
|
79
|
+
readonly fontSize: "1.125rem";
|
|
80
|
+
readonly iconSize: "1.5rem";
|
|
81
|
+
};
|
|
82
|
+
};
|
|
83
|
+
readonly radii: {
|
|
84
|
+
readonly square: "0";
|
|
85
|
+
readonly sm: "0.25rem";
|
|
86
|
+
readonly md: "0.375rem";
|
|
87
|
+
readonly lg: "0.5rem";
|
|
88
|
+
readonly xl: "0.75rem";
|
|
89
|
+
readonly rounded: "9999px";
|
|
90
|
+
};
|
|
91
|
+
readonly variants: {
|
|
92
|
+
readonly solid: {
|
|
93
|
+
readonly background: "fill";
|
|
94
|
+
readonly border: "color";
|
|
95
|
+
readonly text: "on";
|
|
96
|
+
};
|
|
97
|
+
readonly soft: {
|
|
98
|
+
readonly background: "tint";
|
|
99
|
+
readonly border: "none";
|
|
100
|
+
readonly text: "color";
|
|
101
|
+
};
|
|
102
|
+
readonly outline: {
|
|
103
|
+
readonly background: "none";
|
|
104
|
+
readonly border: "color";
|
|
105
|
+
readonly text: "color";
|
|
106
|
+
};
|
|
107
|
+
readonly ghost: {
|
|
108
|
+
readonly background: "none";
|
|
109
|
+
readonly border: "none";
|
|
110
|
+
readonly text: "color";
|
|
111
|
+
};
|
|
112
|
+
};
|
|
113
|
+
readonly spacing: {
|
|
114
|
+
readonly xs: "0.25rem";
|
|
115
|
+
readonly sm: "0.5rem";
|
|
116
|
+
readonly md: "1rem";
|
|
117
|
+
readonly lg: "1.5rem";
|
|
118
|
+
readonly xl: "2rem";
|
|
119
|
+
};
|
|
120
|
+
readonly shadows: {
|
|
121
|
+
readonly sm: "0 1px 2px light-dark(rgb(0 0 0 / 0.08), rgb(0 0 0 / 0.5))";
|
|
122
|
+
readonly md: "0 4px 12px light-dark(rgb(0 0 0 / 0.12), rgb(0 0 0 / 0.6))";
|
|
123
|
+
readonly lg: "0 12px 32px light-dark(rgb(0 0 0 / 0.18), rgb(0 0 0 / 0.7))";
|
|
124
|
+
};
|
|
125
|
+
readonly density: {
|
|
126
|
+
readonly compact: {
|
|
127
|
+
readonly paddingX: "0.5rem";
|
|
128
|
+
readonly paddingY: "0.25rem";
|
|
129
|
+
readonly fontSize: "0.8125rem";
|
|
130
|
+
};
|
|
131
|
+
readonly comfortable: {
|
|
132
|
+
readonly paddingX: "0.75rem";
|
|
133
|
+
readonly paddingY: "0.625rem";
|
|
134
|
+
readonly fontSize: "0.875rem";
|
|
135
|
+
};
|
|
136
|
+
};
|
|
137
|
+
readonly modalSizes: {
|
|
138
|
+
readonly sm: "24rem";
|
|
139
|
+
readonly md: "32rem";
|
|
140
|
+
readonly lg: "48rem";
|
|
141
|
+
readonly xl: "64rem";
|
|
142
|
+
readonly full: "100vw";
|
|
143
|
+
};
|
|
144
|
+
readonly typography: {
|
|
145
|
+
readonly families: {
|
|
146
|
+
readonly sans: "system-ui, -apple-system, \"Segoe UI\", Roboto, sans-serif";
|
|
147
|
+
readonly mono: "ui-monospace, \"SF Mono\", Menlo, Consolas, monospace";
|
|
148
|
+
};
|
|
149
|
+
readonly styles: {
|
|
150
|
+
readonly display: {
|
|
151
|
+
readonly family: "sans";
|
|
152
|
+
readonly size: "2.25rem";
|
|
153
|
+
readonly weight: 800;
|
|
154
|
+
readonly lineHeight: 1.1;
|
|
155
|
+
readonly letterSpacing: "-0.02em";
|
|
156
|
+
};
|
|
157
|
+
readonly heading: {
|
|
158
|
+
readonly family: "sans";
|
|
159
|
+
readonly size: "1.5rem";
|
|
160
|
+
readonly weight: 700;
|
|
161
|
+
readonly lineHeight: 1.25;
|
|
162
|
+
readonly letterSpacing: "-0.01em";
|
|
163
|
+
};
|
|
164
|
+
readonly subheading: {
|
|
165
|
+
readonly family: "sans";
|
|
166
|
+
readonly size: "1.125rem";
|
|
167
|
+
readonly weight: 600;
|
|
168
|
+
readonly lineHeight: 1.35;
|
|
169
|
+
};
|
|
170
|
+
readonly body: {
|
|
171
|
+
readonly family: "sans";
|
|
172
|
+
readonly size: "1rem";
|
|
173
|
+
readonly weight: 400;
|
|
174
|
+
readonly lineHeight: 1.5;
|
|
175
|
+
};
|
|
176
|
+
readonly caption: {
|
|
177
|
+
readonly family: "sans";
|
|
178
|
+
readonly size: "0.8125rem";
|
|
179
|
+
readonly weight: 400;
|
|
180
|
+
readonly lineHeight: 1.4;
|
|
181
|
+
};
|
|
182
|
+
readonly code: {
|
|
183
|
+
readonly family: "mono";
|
|
184
|
+
readonly size: "0.875rem";
|
|
185
|
+
readonly weight: 400;
|
|
186
|
+
readonly lineHeight: 1.5;
|
|
187
|
+
};
|
|
188
|
+
readonly label: {
|
|
189
|
+
readonly family: "sans";
|
|
190
|
+
readonly size: "0.875rem";
|
|
191
|
+
readonly weight: 500;
|
|
192
|
+
readonly lineHeight: 1.4;
|
|
193
|
+
};
|
|
194
|
+
};
|
|
195
|
+
readonly headings: {
|
|
196
|
+
readonly h1: "display";
|
|
197
|
+
readonly h2: "heading";
|
|
198
|
+
readonly h3: "subheading";
|
|
199
|
+
readonly h4: "subheading";
|
|
200
|
+
readonly h5: "label";
|
|
201
|
+
readonly h6: "label";
|
|
202
|
+
};
|
|
203
|
+
};
|
|
204
|
+
readonly zIndex: {
|
|
205
|
+
readonly dropdown: 1000;
|
|
206
|
+
readonly tooltip: 1100;
|
|
207
|
+
readonly dialog: 1200;
|
|
208
|
+
readonly toast: 1300;
|
|
209
|
+
};
|
|
210
|
+
readonly motion: {
|
|
211
|
+
readonly fast: "120ms";
|
|
212
|
+
readonly base: "200ms";
|
|
213
|
+
readonly easing: "cubic-bezier(0.2, 0, 0, 1)";
|
|
214
|
+
};
|
|
215
|
+
readonly timing: {
|
|
216
|
+
readonly tooltipDelay: 400;
|
|
217
|
+
readonly hoverOpenDelay: 300;
|
|
218
|
+
readonly hoverCloseDelay: 150;
|
|
219
|
+
readonly toastDuration: 5000;
|
|
220
|
+
};
|
|
221
|
+
readonly borders: {
|
|
222
|
+
readonly width: "1px";
|
|
223
|
+
};
|
|
224
|
+
readonly focusRing: {
|
|
225
|
+
readonly width: "2px";
|
|
226
|
+
readonly offset: "2px";
|
|
227
|
+
readonly color: "primary";
|
|
228
|
+
};
|
|
229
|
+
readonly defaults: {
|
|
230
|
+
readonly size: "md";
|
|
231
|
+
readonly radius: "md";
|
|
232
|
+
readonly color: "primary";
|
|
233
|
+
readonly variant: "solid";
|
|
234
|
+
readonly errorColor: "danger";
|
|
235
|
+
readonly textStyle: "body";
|
|
236
|
+
readonly labelStyle: "label";
|
|
237
|
+
readonly helperStyle: "caption";
|
|
238
|
+
readonly gap: "md";
|
|
239
|
+
readonly padding: "lg";
|
|
240
|
+
readonly floatingShadow: "md";
|
|
241
|
+
readonly density: "comfortable";
|
|
242
|
+
readonly softVariant: "soft";
|
|
243
|
+
readonly modalSize: "md";
|
|
244
|
+
};
|
|
245
|
+
readonly components: {
|
|
246
|
+
readonly Avatar: {
|
|
247
|
+
readonly radius: "rounded";
|
|
248
|
+
};
|
|
249
|
+
readonly EmptyState: {
|
|
250
|
+
readonly color: "neutral";
|
|
251
|
+
readonly gap: "sm";
|
|
252
|
+
readonly padding: "lg";
|
|
253
|
+
readonly textStyle: "body";
|
|
254
|
+
};
|
|
255
|
+
readonly Alert: {
|
|
256
|
+
readonly gap: "sm";
|
|
257
|
+
readonly padding: "md";
|
|
258
|
+
readonly textStyle: "label";
|
|
259
|
+
};
|
|
260
|
+
readonly Drawer: {
|
|
261
|
+
readonly size: "sm";
|
|
262
|
+
};
|
|
263
|
+
readonly Tooltip: {
|
|
264
|
+
readonly radius: "md";
|
|
265
|
+
readonly padding: "sm";
|
|
266
|
+
readonly textStyle: "caption";
|
|
267
|
+
};
|
|
268
|
+
readonly Toast: {
|
|
269
|
+
readonly radius: "lg";
|
|
270
|
+
readonly gap: "sm";
|
|
271
|
+
readonly padding: "md";
|
|
272
|
+
readonly textStyle: "label";
|
|
273
|
+
};
|
|
274
|
+
};
|
|
275
|
+
};
|
|
276
|
+
export default _default;
|