@epilot/volt-ui-experimental-griffel 0.2.3 → 0.3.1
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/ADOPTING.md +416 -0
- package/README.md +32 -31
- package/dist/components/alert-dialog/alert-dialog.js +61 -59
- package/dist/components/alert-dialog/alert-dialog.js.map +1 -1
- package/dist/components/avatar/avatar.js +6 -6
- package/dist/components/avatar/avatar.js.map +1 -1
- package/dist/components/badge/badge.js +47 -39
- package/dist/components/badge/badge.js.map +1 -1
- package/dist/components/button/button.js +71 -68
- package/dist/components/button/button.js.map +1 -1
- package/dist/components/checkbox/checkbox.js +23 -20
- package/dist/components/checkbox/checkbox.js.map +1 -1
- package/dist/components/command/command.js +50 -35
- package/dist/components/command/command.js.map +1 -1
- package/dist/components/data-table/data-table.js +89 -88
- package/dist/components/data-table/data-table.js.map +1 -1
- package/dist/components/density-provider/density-provider.js +28 -0
- package/dist/components/density-provider/density-provider.js.map +1 -0
- package/dist/components/dialog/dialog.js +122 -100
- package/dist/components/dialog/dialog.js.map +1 -1
- package/dist/components/drawer/drawer.js +61 -59
- package/dist/components/drawer/drawer.js.map +1 -1
- package/dist/components/dropdown-menu/dropdown-menu.js +88 -85
- package/dist/components/dropdown-menu/dropdown-menu.js.map +1 -1
- package/dist/components/field/field-combobox.js +121 -106
- package/dist/components/field/field-combobox.js.map +1 -1
- package/dist/components/field/field.js +105 -104
- package/dist/components/field/field.js.map +1 -1
- package/dist/components/list/list.js +282 -308
- package/dist/components/list/list.js.map +1 -1
- package/dist/components/pill/pill.js +58 -56
- package/dist/components/pill/pill.js.map +1 -1
- package/dist/components/popover/popover.js +47 -38
- package/dist/components/popover/popover.js.map +1 -1
- package/dist/components/radio/radio.js +21 -18
- package/dist/components/radio/radio.js.map +1 -1
- package/dist/components/select/select.js +185 -156
- package/dist/components/select/select.js.map +1 -1
- package/dist/components/skeleton/skeleton.js +2 -2
- package/dist/components/skeleton/skeleton.js.map +1 -1
- package/dist/components/switch/switch.js +34 -29
- package/dist/components/switch/switch.js.map +1 -1
- package/dist/components/table/table-pagination.js +92 -90
- package/dist/components/table/table-pagination.js.map +1 -1
- package/dist/components/table/table.js +109 -121
- package/dist/components/table/table.js.map +1 -1
- package/dist/components/toggle/toggle.js +29 -29
- package/dist/components/toggle/toggle.js.map +1 -1
- package/dist/components/tooltip/tooltip.js +36 -34
- package/dist/components/tooltip/tooltip.js.map +1 -1
- package/dist/index.d.ts +600 -427
- package/dist/index.js +215 -212
- package/dist/index.js.map +1 -1
- package/dist/packages/volt-runtime/dist/sheet.js +27 -10
- package/dist/packages/volt-runtime/dist/sheet.js.map +1 -1
- package/dist/packages/volt-runtime/dist/styles/recipe.js +76 -0
- package/dist/packages/volt-runtime/dist/styles/recipe.js.map +1 -0
- package/dist/styles/document-context.js +12 -0
- package/dist/styles/document-context.js.map +1 -0
- package/dist/styles/make-styles.js +18 -10
- package/dist/styles/make-styles.js.map +1 -1
- package/dist/tokens/core.generated.js +1238 -1166
- package/dist/tokens/core.generated.js.map +1 -1
- package/dist/tokens/index.d.ts +442 -415
- package/dist/tokens/index.js +1105 -1078
- package/dist/tokens/index.js.map +1 -1
- package/dist/tokens/install.js +9 -5
- package/dist/tokens/install.js.map +1 -1
- package/dist/tokens/use-palette-tokens.js +20 -0
- package/dist/tokens/use-palette-tokens.js.map +1 -0
- package/dist/tokens.json +83 -2
- package/package.json +13 -5
- package/scripts/migration-diagnostics-core.mjs +859 -0
- package/scripts/migration-diagnostics.mjs +353 -0
- package/scripts/migration-sweep.mjs +179 -0
- package/AGENTS.md +0 -153
- package/AUTHORING.md +0 -292
- package/dist/packages/volt-runtime/dist/styles/make-styles.js +0 -22
- package/dist/packages/volt-runtime/dist/styles/make-styles.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"badge.js","sources":["../../../src/components/badge/badge.tsx"],"sourcesContent":["import * as React from \"react\"\n\nimport { mergeClasses, shorthands } from \"@epilot/volt-ui-runtime\"\n\nimport { SLOT_ATTR } from \"../../renderer/contract\"\nimport { makeVoltStyles } from \"../../styles/make-styles\"\nimport { NS } from \"../../tokens\"\nimport { ensurePaletteTokensFor } from \"../../tokens/install\"\nimport * as tokens from \"../../tokens\"\n\n/**\n * REFERENCE COMPONENT — the colour-matrix collapse. Read this before writing another component\n * that takes a `color` prop.\n *\n * v1 enumerates 20 colours x 3 styles as 60 `compoundVariants`, each a distinct class string like\n * `volt-bg-mint-soft`. Because those names are built by interpolation, Tailwind's scanner cannot\n * see them, which is what `safelist.css` exists to force — 9 lines that emit ~945 rules, 65.6 KB\n * and 59% of v1's entire rule count. The Griffel PoC carried the same shape forward as 60 static\n * style objects.\n *\n * Here the colour is a VALUE, not part of a class name. Three atoms read three custom properties;\n * the component sets those properties inline from the `color` prop. Total rules: one small set per\n * style variant, regardless of how many colours exist. Adding a 22nd palette family costs zero\n * rules.\n *\n * Two consequences worth knowing:\n * - `color` may legitimately arrive from a runtime expression (`getColorForEntityLabel(label)` and\n * `WCAG_BADGE_MAP[level].color` both exist in consumer code today), which no build step can\n * resolve. That is exactly why the palette sheet cannot be statically shaken, and why this\n * component calls `ensurePaletteTokens()`.\n * - Selectors key on SLOT_ATTR, never on `data-slot`. `data-slot` values are shared with v1, so a\n * rule keyed on one also matches v1-rendered DOM — the StyleX track had a v1 icon compute to\n * 0x0 through a green gate this way. `data-slot` is still emitted, purely as a diagnostic.\n */\n\nconst COLORS = [\n \"accent\",\n \"neutral\",\n \"gray\",\n \"success\",\n \"warning\",\n \"error\",\n \"info\",\n \"blue\",\n \"sky\",\n \"mint\",\n \"lime\",\n \"green\",\n \"teal\",\n \"cyan\",\n \"indigo\",\n \"purple\",\n \"pink\",\n \"red\",\n \"orange\",\n \"yellow\",\n \"bronze\",\n] as const\n\nexport type BadgeColor = (typeof COLORS)[number]\nexport type BadgeVariant = \"soft\" | \"solid\" | \"surface\"\nexport type BadgeSize = \"sm\" | \"base\" | \"lg\"\n\n/** The three slots a variant can paint. Set inline; read by the atoms below. */\nconst BG = \"--volt2-badge-bg\"\nconst FG = \"--volt2-badge-fg\"\nconst BD = \"--volt2-badge-bd\"\n\nconst resolveColor = (color: BadgeColor): string =>\n color === \"neutral\" ? \"gray\" : color\n\nconst semantic = (color: BadgeColor, slot: string): string =>\n `var(--volt2-${NS}-sem-${resolveColor(color)}-${slot})`\nconst primitive = (color: BadgeColor, step: string): string =>\n `var(--volt2-${NS}-${resolveColor(color)}-${step})`\n\n/**\n * Which token each variant pulls into each slot. This replaces the 60-entry compound matrix: it is\n * data about three variants, not about 60 combinations.\n */\nconst VARIANT_SLOTS: Record<\n BadgeVariant,\n (color: BadgeColor) => Record<string, string>\n> = {\n soft: (c) => ({\n [BG]: semantic(c, \"soft\"),\n [FG]: semantic(c, \"default\"),\n [BD]: \"transparent\",\n }),\n solid: (c) => ({\n [BG]: semantic(c, \"solid\"),\n [FG]: semantic(c, \"contrast\"),\n [BD]: \"transparent\",\n }),\n surface: (c) => ({\n [BG]: semantic(c, \"surface\"),\n [FG]: semantic(c, \"default\"),\n [BD]: primitive(c, \"a6\"),\n }),\n}\n\nconst useStyles = makeVoltStyles({\n root: {\n display: \"inline-flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n width: \"fit-content\",\n whiteSpace: \"nowrap\",\n flexShrink: 0,\n overflow: \"hidden\",\n fontWeight: tokens.fontWeightNormal,\n // NEVER write a CSS shorthand in a Griffel style object. Atoms are one declaration each, so a\n // shorthand cannot be resolved against a longhand — `border` and a later `borderColor` would\n // both survive with the winner decided by insertion order. Griffel warns at runtime, which\n // means the mistake ships silently in production where nobody reads the console.\n // `shorthands.*` expands to the individual longhands.\n ...shorthands.border(\"1px\", \"solid\", `var(${BD})`),\n // The whole point: one rule each, colour supplied per instance.\n backgroundColor: `var(${BG})`,\n color: `var(${FG})`,\n transitionProperty: \"color, box-shadow\",\n \":focus-visible\": {\n outlineWidth: \"2px\",\n outlineStyle: \"solid\",\n outlineOffset: \"2px\",\n outlineColor: tokens.accentA8,\n },\n // v1 `aria-invalid:outline-error-a8`. Declared after the focus ring so an invalid focused\n // badge paints the error ring, matching v1's variant ordering.\n \"&[aria-invalid]\": {\n outlineColor: tokens.errorA8,\n },\n \"& > svg\": { pointerEvents: \"none\" },\n },\n sm: {\n fontSize: tokens.textXs,\n lineHeight: \"1rem\",\n letterSpacing: \"0.04px\",\n gap: tokens.spacingElement1,\n paddingInline: tokens.spacingElement1,\n minWidth: \"1rem\",\n borderRadius: \"3px\",\n \"& > svg\": { width: \"0.75rem\", height: \"0.75rem\" },\n },\n base: {\n fontSize: tokens.textSm,\n lineHeight: \"1.25rem\",\n gap: tokens.spacingElement1,\n paddingInline: tokens.spacingElement2,\n minWidth: \"1.25rem\",\n borderRadius: tokens.radiusSm,\n \"& > svg\": { width: \"1rem\", height: \"1rem\" },\n },\n lg: {\n fontSize: tokens.textBase,\n lineHeight: \"1.5rem\",\n gap: tokens.spacingElement1,\n paddingInline: tokens.spacingElement3,\n minWidth: \"1.5rem\",\n borderRadius: tokens.radiusMd,\n \"& > svg\": { width: \"1rem\", height: \"1rem\" },\n },\n})\n\nexport type BadgeProps = Omit<React.ComponentProps<\"span\">, \"color\"> & {\n color?: BadgeColor\n /**\n * Named `variant`, not `style`. v1 called this `style`, which shadows the HTML `style` attribute\n * and made a badge unable to take both a visual treatment and an inline style. Retrocompat is\n * not a requirement here, so the collision is fixed rather than inherited.\n */\n variant?: BadgeVariant\n size?: BadgeSize\n}\n\nexport const Badge = React.forwardRef<HTMLSpanElement, BadgeProps>(\n function Badge(\n {\n className,\n color = \"accent\",\n variant = \"soft\",\n size = \"base\",\n style,\n ...props\n },\n ref\n ) {\n // A decorative family can still arrive from an expression the build cannot see, so this has to\n // run on every render — but it is the resolved family that decides, and a core one needs no\n // palette sheet.\n ensurePaletteTokensFor(color)\n\n const styles = useStyles()\n\n return (\n <span\n ref={ref}\n data-slot=\"badge\"\n {...{ [SLOT_ATTR]: \"badge\" }}\n className={mergeClasses(styles.root, styles[size], className)}\n style={\n { ...VARIANT_SLOTS[variant](color), ...style } as React.CSSProperties\n }\n {...props}\n />\n )\n }\n)\n\nexport { COLORS as BADGE_COLORS }\n"],"names":["COLORS","BG","FG","BD","resolveColor","color","semantic","slot","NS","primitive","step","VARIANT_SLOTS","c","useStyles","makeVoltStyles","tokens.fontWeightNormal","shorthands","tokens.accentA8","tokens.errorA8","tokens.textXs","tokens.spacingElement1","tokens.textSm","tokens.spacingElement2","tokens.radiusSm","tokens.textBase","tokens.spacingElement3","tokens.radiusMd","Badge","React","className","variant","size","style","props","ref","ensurePaletteTokensFor","styles","jsx","SLOT_ATTR","mergeClasses"],"mappings":";;;;;;;;;AAmCA,MAAMA,IAAS;AAAA,EACb;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAOMC,IAAK,oBACLC,IAAK,oBACLC,IAAK,oBAELC,IAAe,CAACC,MACpBA,MAAU,YAAY,SAASA,GAE3BC,IAAW,CAACD,GAAmBE,MACnC,eAAeC,CAAE,QAAQJ,EAAaC,CAAK,CAAC,IAAIE,CAAI,KAChDE,IAAY,CAACJ,GAAmBK,MACpC,eAAeF,CAAE,IAAIJ,EAAaC,CAAK,CAAC,IAAIK,CAAI,KAM5CC,IAGF;AAAA,EACF,MAAM,CAACC,OAAO;AAAA,IACZ,CAACX,CAAE,GAAGK,EAASM,GAAG,MAAM;AAAA,IACxB,CAACV,CAAE,GAAGI,EAASM,GAAG,SAAS;AAAA,IAC3B,CAACT,CAAE,GAAG;AAAA,EAAA;AAAA,EAER,OAAO,CAACS,OAAO;AAAA,IACb,CAACX,CAAE,GAAGK,EAASM,GAAG,OAAO;AAAA,IACzB,CAACV,CAAE,GAAGI,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AQ,OAAA;AAAA,EAAO;AAAA,EAE7C,IAAI;AAAA,IACF,UAAUC;AAAAA,IACV,YAAY;AAAA,IACZ,KAAKJ;AAAAA,IACL,eAAeK;AAAAA,IACf,UAAU;AAAA,IACV,cAAcC;AAAAA,IACd,WAAW,EAAE,OAAO,QAAQ,QAAQ,OAAA;AAAA,EAAO;AAE/C,CAAC,GAaYC,IAAQC,EAAM;AAAA,EACzB,SACE;AAAA,IACE,WAAAC;AAAA,IACA,OAAAxB,IAAQ;AAAA,IACR,SAAAyB,IAAU;AAAA,IACV,MAAAC,IAAO;AAAA,IACP,OAAAC;AAAA,IACA,GAAGC;AAAA,EAAA,GAELC,GACA;AAIA,IAAAC,EAAuB9B,CAAK;AAE5B,UAAM+B,IAASvB,EAAA;AAEf,WACE,gBAAAwB;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,KAAAH;AAAA,QACA,aAAU;AAAA,QACJ,CAACI,CAAS,GAAG;AAAA,QACnB,WAAWC,EAAaH,EAAO,MAAMA,EAAOL,CAAI,GAAGF,CAAS;AAAA,QAC5D,OACE,EAAE,GAAGlB,EAAcmB,CAAO,EAAEzB,CAAK,GAAG,GAAG2B,EAAA;AAAA,QAExC,GAAGC;AAAA,MAAA;AAAA,IAAA;AAAA,EAGV;AACF;"}
|
|
1
|
+
{"version":3,"file":"badge.js","sources":["../../../src/components/badge/badge.tsx"],"sourcesContent":["import * as React from \"react\"\n\nimport { mergeClasses, shorthands } from \"@epilot/volt-ui-runtime\"\n\nimport { SLOT_ATTR } from \"../../renderer/contract\"\nimport { makeVoltStyles } from \"../../styles/make-styles\"\nimport { NS, PALETTE_NS } from \"../../tokens\"\nimport { isCoreFamily } from \"../../tokens/install\"\nimport { useVoltPaletteTokensFor } from \"../../tokens/use-palette-tokens\"\nimport * as tokens from \"../../tokens\"\n\n/**\n * REFERENCE COMPONENT — the colour-matrix collapse. Read this before writing another component\n * that takes a `color` prop.\n *\n * v1 enumerates 20 colours x 3 styles as 60 `compoundVariants`, each a distinct class string like\n * `volt-bg-mint-soft`. Because those names are built by interpolation, Tailwind's scanner cannot\n * see them, which is what `safelist.css` exists to force — 9 lines that emit ~945 rules, 65.6 KB\n * and 59% of v1's entire rule count. The Griffel PoC carried the same shape forward as 60 static\n * style objects.\n *\n * Here the colour is a VALUE, not part of a class name. Three atoms read three custom properties;\n * the component sets those properties inline from the `color` prop. Total rules: one small set per\n * style variant, regardless of how many colours exist. Adding a 22nd palette family costs zero\n * rules.\n *\n * Two consequences worth knowing:\n * - `color` may legitimately arrive from a runtime expression (`getColorForEntityLabel(label)` and\n * `WCAG_BADGE_MAP[level].color` both exist in consumer code today), which no build step can\n * resolve. That is exactly why the palette sheet cannot be statically shaken, and why this\n * component calls `ensurePaletteTokens()`.\n * - Selectors key on SLOT_ATTR, never on `data-slot`. `data-slot` values are shared with v1, so a\n * rule keyed on one also matches v1-rendered DOM — the StyleX track had a v1 icon compute to\n * 0x0 through a green gate this way. `data-slot` is still emitted, purely as a diagnostic.\n */\n\nconst COLORS = [\n \"accent\",\n \"neutral\",\n \"gray\",\n \"success\",\n \"warning\",\n \"error\",\n \"info\",\n \"blue\",\n \"sky\",\n \"mint\",\n \"lime\",\n \"green\",\n \"teal\",\n \"cyan\",\n \"indigo\",\n \"purple\",\n \"pink\",\n \"red\",\n \"orange\",\n \"yellow\",\n \"bronze\",\n] as const\n\nexport type BadgeColor = (typeof COLORS)[number]\nexport type BadgeVariant = \"soft\" | \"solid\" | \"surface\"\nexport type BadgeSize = \"sm\" | \"base\" | \"lg\"\n\n/** The three slots a variant can paint. Set inline; read by the atoms below. */\nconst BG = \"--volt2-badge-bg\"\nconst FG = \"--volt2-badge-fg\"\nconst BD = \"--volt2-badge-bd\"\n\nconst resolveColor = (color: BadgeColor): string =>\n color === \"neutral\" ? \"gray\" : color\n\n/**\n * The namespace fix. `resolveColor` runs FIRST so `neutral` is classified as `gray` (core) rather\n * than as the literal string \"neutral\" (which is in neither sheet's family list) — same order\n * `semantic`/`primitive` already apply it in. This does not touch `useVoltPaletteTokensFor(color)`\n * above, which still receives the raw, unresolved `color` prop and therefore still installs the\n * palette sheet for `color=\"neutral\"` even though the resolved family needs none of it — a\n * separate, pre-existing inefficiency this fix does not optimize. See BADGE-PILL-NAMESPACE-FIX.md.\n */\nconst namespaceFor = (family: string): string =>\n isCoreFamily(family) ? NS : PALETTE_NS\n\nconst semantic = (color: BadgeColor, slot: string): string => {\n const family = resolveColor(color)\n return `var(--volt2-${namespaceFor(family)}-sem-${family}-${slot})`\n}\nconst primitive = (color: BadgeColor, step: string): string => {\n const family = resolveColor(color)\n return `var(--volt2-${namespaceFor(family)}-${family}-${step})`\n}\n\n/**\n * Which token each variant pulls into each slot. This replaces the 60-entry compound matrix: it is\n * data about three variants, not about 60 combinations.\n */\nconst VARIANT_SLOTS: Record<\n BadgeVariant,\n (color: BadgeColor) => Record<string, string>\n> = {\n soft: (c) => ({\n [BG]: semantic(c, \"soft\"),\n [FG]: semantic(c, \"default\"),\n [BD]: \"transparent\",\n }),\n solid: (c) => ({\n [BG]: semantic(c, \"solid\"),\n [FG]: semantic(c, \"contrast\"),\n [BD]: \"transparent\",\n }),\n surface: (c) => ({\n [BG]: semantic(c, \"surface\"),\n [FG]: semantic(c, \"default\"),\n [BD]: primitive(c, \"a6\"),\n }),\n}\n\nconst useStyles = makeVoltStyles({\n root: {\n display: \"inline-flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n width: \"fit-content\",\n whiteSpace: \"nowrap\",\n flexShrink: 0,\n overflow: \"hidden\",\n fontWeight: tokens.fontWeightNormal,\n // NEVER write a CSS shorthand in a Griffel style object. Atoms are one declaration each, so a\n // shorthand cannot be resolved against a longhand — `border` and a later `borderColor` would\n // both survive with the winner decided by insertion order. Griffel warns at runtime, which\n // means the mistake ships silently in production where nobody reads the console.\n // `shorthands.*` expands to the individual longhands.\n ...shorthands.border(\"1px\", \"solid\", `var(${BD})`),\n // The whole point: one rule each, colour supplied per instance.\n backgroundColor: `var(${BG})`,\n color: `var(${FG})`,\n transitionProperty: \"color, box-shadow\",\n \":focus-visible\": {\n outlineWidth: \"2px\",\n outlineStyle: \"solid\",\n outlineOffset: \"2px\",\n outlineColor: tokens.accentA8,\n },\n // v1 `aria-invalid:outline-error-a8`. Declared after the focus ring so an invalid focused\n // badge paints the error ring, matching v1's variant ordering.\n \"&[aria-invalid]\": {\n outlineColor: tokens.errorA8,\n },\n \"& > svg\": { pointerEvents: \"none\" },\n },\n sm: {\n fontSize: tokens.textXs,\n lineHeight: \"1rem\",\n letterSpacing: \"0.04px\",\n gap: tokens.spacingElement1,\n paddingInline: tokens.spacingElement1,\n minWidth: \"1rem\",\n borderRadius: \"3px\",\n \"& > svg\": { width: \"0.75rem\", height: \"0.75rem\" },\n },\n base: {\n fontSize: tokens.textSm,\n lineHeight: \"1.25rem\",\n gap: tokens.spacingElement1,\n paddingInline: tokens.spacingElement2,\n minWidth: \"1.25rem\",\n borderRadius: tokens.radiusSm,\n \"& > svg\": { width: \"1rem\", height: \"1rem\" },\n },\n lg: {\n fontSize: tokens.textBase,\n lineHeight: \"1.5rem\",\n gap: tokens.spacingElement1,\n paddingInline: tokens.spacingElement3,\n minWidth: \"1.5rem\",\n borderRadius: tokens.radiusMd,\n \"& > svg\": { width: \"1rem\", height: \"1rem\" },\n },\n})\n\nexport type BadgeProps = Omit<React.ComponentProps<\"span\">, \"color\"> & {\n color?: BadgeColor\n /**\n * Named `variant`, not `style`. v1 called this `style`, which shadows the HTML `style` attribute\n * and made a badge unable to take both a visual treatment and an inline style. Retrocompat is\n * not a requirement here, so the collision is fixed rather than inherited.\n */\n variant?: BadgeVariant\n size?: BadgeSize\n}\n\nexport const Badge = React.forwardRef<HTMLSpanElement, BadgeProps>(\n function Badge(\n {\n className,\n color = \"accent\",\n variant = \"soft\",\n size = \"base\",\n style,\n ...props\n },\n ref\n ) {\n // A decorative family can still arrive from an expression the build cannot see, so this has to\n // be re-evaluated every commit (WP2B2 — the hook closes over this render's resolved value) —\n // but it is the resolved family that decides, and a core one needs no palette sheet.\n useVoltPaletteTokensFor(color)\n\n const styles = useStyles()\n\n return (\n <span\n ref={ref}\n data-slot=\"badge\"\n {...{ [SLOT_ATTR]: \"badge\" }}\n className={mergeClasses(styles.root, styles[size], className)}\n style={\n { ...VARIANT_SLOTS[variant](color), ...style } as React.CSSProperties\n }\n {...props}\n />\n )\n }\n)\n\nexport { COLORS as BADGE_COLORS }\n"],"names":["COLORS","BG","FG","BD","resolveColor","color","namespaceFor","family","isCoreFamily","NS","PALETTE_NS","semantic","slot","primitive","step","VARIANT_SLOTS","c","useStyles","makeVoltStyles","tokens.fontWeightNormal","shorthands","tokens.accentA8","tokens.errorA8","tokens.textXs","tokens.spacingElement1","tokens.textSm","tokens.spacingElement2","tokens.radiusSm","tokens.textBase","tokens.spacingElement3","tokens.radiusMd","Badge","React","className","variant","size","style","props","ref","useVoltPaletteTokensFor","styles","jsx","SLOT_ATTR","mergeClasses"],"mappings":";;;;;;;;;;;AAoCA,MAAMA,IAAS;AAAA,EACb;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAOMC,IAAK,oBACLC,IAAK,oBACLC,IAAK,oBAELC,IAAe,CAACC,MACpBA,MAAU,YAAY,SAASA,GAU3BC,IAAe,CAACC,MACpBC,EAAaD,CAAM,IAAIE,IAAKC,GAExBC,IAAW,CAACN,GAAmBO,MAAyB;AAC5D,QAAML,IAASH,EAAaC,CAAK;AACjC,SAAO,eAAeC,EAAaC,CAAM,CAAC,QAAQA,CAAM,IAAIK,CAAI;AAClE,GACMC,IAAY,CAACR,GAAmBS,MAAyB;AAC7D,QAAMP,IAASH,EAAaC,CAAK;AACjC,SAAO,eAAeC,EAAaC,CA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-runtime";
|
|
2
|
+
import * as S from "react";
|
|
3
3
|
import { shorthands as o } from "../../packages/volt-runtime/dist/vendor/@griffel/core/src/index.js";
|
|
4
|
-
import { SLOT_ATTR as
|
|
5
|
-
import { mergeClasses as
|
|
6
|
-
import { makeVoltStyles as
|
|
7
|
-
import { spacingElement3 as
|
|
8
|
-
import { Root as
|
|
9
|
-
const
|
|
4
|
+
import { SLOT_ATTR as v } from "../../packages/volt-runtime/dist/renderer/contract.js";
|
|
5
|
+
import { mergeClasses as k } from "../../packages/volt-runtime/dist/vendor/@griffel/core/src/mergeClasses.js";
|
|
6
|
+
import { makeVoltStyles as C } from "../../styles/make-styles.js";
|
|
7
|
+
import { buttonBasePaddingInline as x, spacingElement3 as y, radiusLg as w, buttonIconSize as n, leadingLg as H, textLg as B, leadingBase as A, textBase as R, buttonBaseMinHeight as E, leadingSm as I, textSm as z, leadingXs as L, textXs as D, semErrorSoft as i, errorA11 as O, semErrorSoftHover as X, semErrorOnSoft as T, semErrorSolidHover as s, semErrorContrast as W, semErrorSolid as j, semAccentSoft as t, grayA12 as P, accentA11 as F, semAccentSoftHover as M, semAccentOnSoft as N, semAccentSolidHover as a, semAccentContrast as Q, semAccentSolid as V, semFocusRing as _, fontWeightSemibold as $ } from "../../tokens/index.js";
|
|
8
|
+
import { Root as q } from "../../vendor/@radix-ui/react-slot/dist/index.js";
|
|
9
|
+
const G = "button", J = C({
|
|
10
10
|
root: {
|
|
11
11
|
display: "inline-flex",
|
|
12
12
|
alignItems: "center",
|
|
13
13
|
justifyContent: "center",
|
|
14
|
-
fontWeight:
|
|
14
|
+
fontWeight: $,
|
|
15
15
|
whiteSpace: "nowrap",
|
|
16
16
|
transitionProperty: "all",
|
|
17
17
|
cursor: "pointer",
|
|
@@ -20,7 +20,11 @@ const q = "button", F = w({
|
|
|
20
20
|
":focus-visible": {
|
|
21
21
|
outlineWidth: "2px",
|
|
22
22
|
outlineStyle: "solid",
|
|
23
|
-
outlineOffset: "2px"
|
|
23
|
+
outlineOffset: "2px",
|
|
24
|
+
outlineColor: _
|
|
25
|
+
},
|
|
26
|
+
"@media (prefers-reduced-motion: reduce)": {
|
|
27
|
+
transitionDuration: "0.01ms"
|
|
24
28
|
},
|
|
25
29
|
"& svg": {
|
|
26
30
|
flexShrink: 0,
|
|
@@ -31,71 +35,68 @@ const q = "button", F = w({
|
|
|
31
35
|
primary: {
|
|
32
36
|
backgroundColor: V,
|
|
33
37
|
color: Q,
|
|
34
|
-
":hover": { backgroundColor:
|
|
35
|
-
":active": { backgroundColor:
|
|
36
|
-
":focus-visible": { outlineColor: n }
|
|
38
|
+
":hover": { backgroundColor: a },
|
|
39
|
+
":active": { backgroundColor: a }
|
|
37
40
|
},
|
|
38
41
|
secondary: {
|
|
39
|
-
backgroundColor:
|
|
40
|
-
color:
|
|
41
|
-
":hover": { backgroundColor:
|
|
42
|
-
":focus-visible": { outlineColor: n }
|
|
42
|
+
backgroundColor: t,
|
|
43
|
+
color: N,
|
|
44
|
+
":hover": { backgroundColor: M }
|
|
43
45
|
},
|
|
44
46
|
tertiary: {
|
|
45
47
|
backgroundColor: "transparent",
|
|
46
|
-
color:
|
|
47
|
-
":hover": { backgroundColor:
|
|
48
|
-
":focus-visible": { outlineColor: n }
|
|
48
|
+
color: F,
|
|
49
|
+
":hover": { backgroundColor: t }
|
|
49
50
|
},
|
|
50
51
|
ghost: {
|
|
51
52
|
backgroundColor: "transparent",
|
|
52
|
-
color:
|
|
53
|
-
":hover": { backgroundColor:
|
|
54
|
-
":focus-visible": { outlineColor: O }
|
|
53
|
+
color: P,
|
|
54
|
+
":hover": { backgroundColor: t }
|
|
55
55
|
},
|
|
56
56
|
primaryDestructive: {
|
|
57
57
|
backgroundColor: j,
|
|
58
58
|
color: W,
|
|
59
|
-
":hover": { backgroundColor:
|
|
60
|
-
":active": { backgroundColor:
|
|
61
|
-
":focus-visible": { outlineColor: t }
|
|
59
|
+
":hover": { backgroundColor: s },
|
|
60
|
+
":active": { backgroundColor: s }
|
|
62
61
|
},
|
|
63
62
|
secondaryDestructive: {
|
|
64
|
-
backgroundColor:
|
|
65
|
-
color:
|
|
66
|
-
":hover": { backgroundColor:
|
|
67
|
-
":focus-visible": { outlineColor: t }
|
|
63
|
+
backgroundColor: i,
|
|
64
|
+
color: T,
|
|
65
|
+
":hover": { backgroundColor: X }
|
|
68
66
|
},
|
|
69
67
|
tertiaryDestructive: {
|
|
70
68
|
backgroundColor: "transparent",
|
|
71
|
-
color:
|
|
72
|
-
":hover": { backgroundColor:
|
|
73
|
-
":focus-visible": { outlineColor: t }
|
|
69
|
+
color: O,
|
|
70
|
+
":hover": { backgroundColor: i }
|
|
74
71
|
},
|
|
75
72
|
xs: {
|
|
76
73
|
...o.paddingInline("0.5rem"),
|
|
77
74
|
...o.paddingBlock("0.25rem"),
|
|
78
75
|
minHeight: "1.25rem",
|
|
79
|
-
fontSize:
|
|
80
|
-
lineHeight:
|
|
76
|
+
fontSize: D,
|
|
77
|
+
lineHeight: L,
|
|
81
78
|
gap: "4px",
|
|
82
79
|
"& svg": { width: "0.75rem", height: "0.75rem" }
|
|
83
80
|
},
|
|
84
81
|
sm: {
|
|
85
|
-
...o.paddingInline(
|
|
82
|
+
...o.paddingInline(y),
|
|
86
83
|
...o.paddingBlock("0.25rem"),
|
|
87
84
|
minHeight: "1.5rem",
|
|
88
|
-
fontSize:
|
|
89
|
-
lineHeight:
|
|
85
|
+
fontSize: z,
|
|
86
|
+
lineHeight: I,
|
|
90
87
|
gap: "0.375rem",
|
|
91
88
|
"& svg": { width: "0.875rem", height: "0.875rem" }
|
|
92
89
|
},
|
|
93
90
|
base: {
|
|
94
|
-
|
|
91
|
+
// Density-bound (DENSITY-SPEC.md §2.4, WP9B1-ACCEPTANCE-WP9B2A): padding-inline is the
|
|
92
|
+
// compact/comfortable lever; min-height is floored by the fixed line-height + padding-block
|
|
93
|
+
// below and cannot shrink, so it is bound too (compact === normal, comfortable raised via an
|
|
94
|
+
// explicit minHeight above the natural content box, same mechanism `lg` already uses).
|
|
95
|
+
...o.paddingInline(x),
|
|
95
96
|
...o.paddingBlock("0.25rem"),
|
|
96
|
-
minHeight:
|
|
97
|
-
fontSize:
|
|
98
|
-
lineHeight:
|
|
97
|
+
minHeight: E,
|
|
98
|
+
fontSize: R,
|
|
99
|
+
lineHeight: A,
|
|
99
100
|
gap: "0.5rem",
|
|
100
101
|
"& svg": { width: "1rem", height: "1rem" }
|
|
101
102
|
},
|
|
@@ -103,8 +104,8 @@ const q = "button", F = w({
|
|
|
103
104
|
...o.paddingInline("1.25rem"),
|
|
104
105
|
...o.paddingBlock("0.25rem"),
|
|
105
106
|
minHeight: "2.5rem",
|
|
106
|
-
fontSize:
|
|
107
|
-
lineHeight:
|
|
107
|
+
fontSize: B,
|
|
108
|
+
lineHeight: H,
|
|
108
109
|
gap: "0.5rem",
|
|
109
110
|
"& svg": { width: "1rem", height: "1rem" }
|
|
110
111
|
},
|
|
@@ -119,8 +120,10 @@ const q = "button", F = w({
|
|
|
119
120
|
"& svg": { width: "0.875rem", height: "0.875rem" }
|
|
120
121
|
},
|
|
121
122
|
icon: {
|
|
122
|
-
|
|
123
|
-
|
|
123
|
+
// Density-bound: a fixed square, no line-height floor (unlike `base`), so compact/comfortable
|
|
124
|
+
// both move freely (DENSITY-SPEC.md §2.4).
|
|
125
|
+
width: n,
|
|
126
|
+
height: n,
|
|
124
127
|
"& svg": { width: "1.125rem", height: "1.125rem" }
|
|
125
128
|
},
|
|
126
129
|
iconLg: {
|
|
@@ -128,19 +131,19 @@ const q = "button", F = w({
|
|
|
128
131
|
height: "2.5rem",
|
|
129
132
|
"& svg": { width: "1.5rem", height: "1.5rem" }
|
|
130
133
|
},
|
|
131
|
-
normal: { borderRadius:
|
|
134
|
+
normal: { borderRadius: w },
|
|
132
135
|
rounded: { borderRadius: "9999px" }
|
|
133
|
-
}),
|
|
136
|
+
}), io = S.forwardRef(
|
|
134
137
|
function({
|
|
135
138
|
variant: r = "primary",
|
|
136
|
-
size:
|
|
137
|
-
shape:
|
|
138
|
-
destructive:
|
|
139
|
-
className:
|
|
140
|
-
asChild:
|
|
141
|
-
...
|
|
142
|
-
},
|
|
143
|
-
const e =
|
|
139
|
+
size: m = "base",
|
|
140
|
+
shape: c = "rounded",
|
|
141
|
+
destructive: l = !1,
|
|
142
|
+
className: g,
|
|
143
|
+
asChild: d = !1,
|
|
144
|
+
...h
|
|
145
|
+
}, u) {
|
|
146
|
+
const e = J(), p = l && r !== "ghost" ? `${r}Destructive` : r, f = {
|
|
144
147
|
xs: "xs",
|
|
145
148
|
sm: "sm",
|
|
146
149
|
base: "base",
|
|
@@ -149,26 +152,26 @@ const q = "button", F = w({
|
|
|
149
152
|
"icon-sm": "iconSm",
|
|
150
153
|
icon: "icon",
|
|
151
154
|
"icon-lg": "iconLg"
|
|
152
|
-
}[
|
|
153
|
-
return /* @__PURE__ */
|
|
154
|
-
|
|
155
|
+
}[m];
|
|
156
|
+
return /* @__PURE__ */ b(
|
|
157
|
+
d ? q : G,
|
|
155
158
|
{
|
|
156
|
-
ref:
|
|
159
|
+
ref: u,
|
|
157
160
|
"data-slot": "button",
|
|
158
|
-
[
|
|
159
|
-
className:
|
|
161
|
+
[v]: "button",
|
|
162
|
+
className: k(
|
|
160
163
|
e.root,
|
|
161
|
-
e[
|
|
162
|
-
e[
|
|
163
|
-
e[
|
|
164
|
-
|
|
164
|
+
e[p],
|
|
165
|
+
e[f],
|
|
166
|
+
e[c],
|
|
167
|
+
g
|
|
165
168
|
),
|
|
166
|
-
...
|
|
169
|
+
...h
|
|
167
170
|
}
|
|
168
171
|
);
|
|
169
172
|
}
|
|
170
173
|
);
|
|
171
174
|
export {
|
|
172
|
-
|
|
175
|
+
io as Button
|
|
173
176
|
};
|
|
174
177
|
//# sourceMappingURL=button.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button.js","sources":["../../../src/components/button/button.tsx"],"sourcesContent":["import * as React from \"react\"\n\nimport { mergeClasses, shorthands } from \"@epilot/volt-ui-runtime\"\n\nimport { SLOT_ATTR } from \"../../renderer/contract\"\nimport { makeVoltStyles } from \"../../styles/make-styles\"\nimport * as tokens from \"../../tokens\"\nimport { Slot } from \"@radix-ui/react-slot\"\n\n/**\n * Base UI's type declarations resolve `react` from the hoisted root's `@types/react` (v19), while\n * this package pins `@types/react` 18 in its own node_modules. Re-typing the primitive onto OUR\n * `React` keeps the button's pass-through props and ref on one React type for this package.\n */\n/**\n * A native `<button>`, no primitive.\n *\n * v1's only Radix use here is `Slot`, purely to implement `asChild`, and this does the same. Base\n * UI's button primitive supplied nothing v1 had: it added a dependency, and with it the\n * `@types/react` 19 requirement, for a plain element.\n */\nconst ButtonBase = \"button\" as const\n\nconst useStyles = makeVoltStyles({\n root: {\n display: \"inline-flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n fontWeight: tokens.fontWeightSemibold,\n whiteSpace: \"nowrap\",\n transitionProperty: \"all\",\n cursor: \"pointer\",\n flexShrink: 0,\n \":disabled\": { opacity: 0.5 },\n \":focus-visible\": {\n outlineWidth: \"2px\",\n outlineStyle: \"solid\",\n outlineOffset: \"2px\",\n },\n \"& svg\": {\n flexShrink: 0,\n pointerEvents: \"none\",\n color: \"currentColor\",\n },\n },\n primary: {\n backgroundColor: tokens.semAccentSolid,\n color: tokens.semAccentContrast,\n \":hover\": { backgroundColor: tokens.semAccentSolidHover },\n \":active\": { backgroundColor: tokens.semAccentSolidHover },\n \":focus-visible\": { outlineColor: tokens.accentA8 },\n },\n secondary: {\n backgroundColor: tokens.semAccentSoft,\n color: tokens.accentA11,\n \":hover\": { backgroundColor: tokens.semAccentSoftHover },\n \":focus-visible\": { outlineColor: tokens.accentA8 },\n },\n tertiary: {\n backgroundColor: \"transparent\",\n color: tokens.accentA11,\n \":hover\": { backgroundColor: tokens.semAccentSoft },\n \":focus-visible\": { outlineColor: tokens.accentA8 },\n },\n ghost: {\n backgroundColor: \"transparent\",\n color: tokens.grayA12,\n \":hover\": { backgroundColor: tokens.semAccentSoft },\n \":focus-visible\": { outlineColor: tokens.grayA8 },\n },\n primaryDestructive: {\n backgroundColor: tokens.semErrorSolid,\n color: tokens.semErrorContrast,\n \":hover\": { backgroundColor: tokens.semErrorSolidHover },\n \":active\": { backgroundColor: tokens.semErrorSolidHover },\n \":focus-visible\": { outlineColor: tokens.errorA8 },\n },\n secondaryDestructive: {\n backgroundColor: tokens.semErrorSoft,\n color: tokens.errorA11,\n \":hover\": { backgroundColor: tokens.semErrorSoftHover },\n \":focus-visible\": { outlineColor: tokens.errorA8 },\n },\n tertiaryDestructive: {\n backgroundColor: \"transparent\",\n color: tokens.errorA11,\n \":hover\": { backgroundColor: tokens.semErrorSoft },\n \":focus-visible\": { outlineColor: tokens.errorA8 },\n },\n xs: {\n ...shorthands.paddingInline(\"0.5rem\"),\n ...shorthands.paddingBlock(\"0.25rem\"),\n minHeight: \"1.25rem\",\n fontSize: tokens.textXs,\n lineHeight: tokens.leadingXs,\n gap: \"4px\",\n \"& svg\": { width: \"0.75rem\", height: \"0.75rem\" },\n },\n sm: {\n ...shorthands.paddingInline(tokens.spacingElement3),\n ...shorthands.paddingBlock(\"0.25rem\"),\n minHeight: \"1.5rem\",\n fontSize: tokens.textSm,\n lineHeight: tokens.leadingSm,\n gap: \"0.375rem\",\n \"& svg\": { width: \"0.875rem\", height: \"0.875rem\" },\n },\n base: {\n ...shorthands.paddingInline(\"1rem\"),\n ...shorthands.paddingBlock(\"0.25rem\"),\n minHeight: \"2rem\",\n fontSize: tokens.textBase,\n lineHeight: tokens.leadingBase,\n gap: \"0.5rem\",\n \"& svg\": { width: \"1rem\", height: \"1rem\" },\n },\n lg: {\n ...shorthands.paddingInline(\"1.25rem\"),\n ...shorthands.paddingBlock(\"0.25rem\"),\n minHeight: \"2.5rem\",\n fontSize: tokens.textLg,\n lineHeight: tokens.leadingLg,\n gap: \"0.5rem\",\n \"& svg\": { width: \"1rem\", height: \"1rem\" },\n },\n iconXs: {\n width: \"1.5rem\",\n height: \"1.5rem\",\n \"& svg\": { width: \"0.75rem\", height: \"0.75rem\" },\n },\n iconSm: {\n width: \"1.75rem\",\n height: \"1.75rem\",\n \"& svg\": { width: \"0.875rem\", height: \"0.875rem\" },\n },\n icon: {\n width: \"2rem\",\n height: \"2rem\",\n \"& svg\": { width: \"1.125rem\", height: \"1.125rem\" },\n },\n iconLg: {\n width: \"2.5rem\",\n height: \"2.5rem\",\n \"& svg\": { width: \"1.5rem\", height: \"1.5rem\" },\n },\n normal: { borderRadius: tokens.radiusLg },\n rounded: { borderRadius: \"9999px\" },\n})\n\nexport type ButtonVariant = \"primary\" | \"secondary\" | \"tertiary\" | \"ghost\"\nexport type ButtonSize =\n | \"xs\"\n | \"sm\"\n | \"base\"\n | \"lg\"\n | \"icon-xs\"\n | \"icon-sm\"\n | \"icon\"\n | \"icon-lg\"\nexport type ButtonShape = \"normal\" | \"rounded\"\n\nexport type ButtonProps = Omit<\n React.ComponentProps<\"button\">,\n \"variant\" | \"size\" | \"shape\" | \"destructive\" | \"className\" | \"render\"\n> & {\n variant?: ButtonVariant\n size?: ButtonSize\n shape?: ButtonShape\n destructive?: boolean\n className?: string\n /**\n * Render the child element instead of a `button`, keeping Button's styling and slot markers.\n * v1 supports this and consumers rely on it to wrap links; it was dropped here while the package\n * was briefly on Base UI, and restored once it moved back to Radix.\n */\n asChild?: boolean\n}\n\nexport const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(\n function Button(\n {\n variant = \"primary\",\n size = \"base\",\n shape = \"rounded\",\n destructive = false,\n className,\n asChild = false,\n ...props\n },\n ref\n ) {\n const styles = useStyles()\n const variantSlot:\n | ButtonVariant\n | \"primaryDestructive\"\n | \"secondaryDestructive\"\n | \"tertiaryDestructive\" =\n destructive && variant !== \"ghost\"\n ? (`${variant}Destructive` as\n | \"primaryDestructive\"\n | \"secondaryDestructive\"\n | \"tertiaryDestructive\")\n : variant\n const sizeSlot:\n | \"xs\"\n | \"sm\"\n | \"base\"\n | \"lg\"\n | \"iconXs\"\n | \"iconSm\"\n | \"icon\"\n | \"iconLg\" = (\n {\n xs: \"xs\",\n sm: \"sm\",\n base: \"base\",\n lg: \"lg\",\n \"icon-xs\": \"iconXs\",\n \"icon-sm\": \"iconSm\",\n icon: \"icon\",\n \"icon-lg\": \"iconLg\",\n } as const\n )[size]\n\n const Root = asChild ? Slot : ButtonBase\n\n return (\n <Root\n ref={ref}\n data-slot=\"button\"\n {...{ [SLOT_ATTR]: \"button\" }}\n className={mergeClasses(\n styles.root,\n styles[variantSlot],\n styles[sizeSlot],\n styles[shape],\n className\n )}\n {...props}\n />\n )\n }\n)\n"],"names":["ButtonBase","useStyles","makeVoltStyles","tokens.fontWeightSemibold","tokens.semAccentSolid","tokens.semAccentContrast","tokens.semAccentSolidHover","tokens.accentA8","tokens.semAccentSoft","tokens.accentA11","tokens.semAccentSoftHover","tokens.grayA12","tokens.grayA8","tokens.semErrorSolid","tokens.semErrorContrast","tokens.semErrorSolidHover","tokens.errorA8","tokens.semErrorSoft","tokens.errorA11","tokens.semErrorSoftHover","shorthands","tokens.textXs","tokens.leadingXs","tokens.spacingElement3","tokens.textSm","tokens.leadingSm","tokens.textBase","tokens.leadingBase","tokens.textLg","tokens.leadingLg","tokens.radiusLg","Button","React","variant","size","shape","destructive","className","asChild","props","ref","styles","variantSlot","sizeSlot","jsx","Slot","SLOT_ATTR","mergeClasses"],"mappings":";;;;;;;;AAqBA,MAAMA,IAAa,UAEbC,IAAYC,EAAe;AAAA,EAC/B,MAAM;AAAA,IACJ,SAAS;AAAA,IACT,YAAY;AAAA,IACZ,gBAAgB;AAAA,IAChB,YAAYC;AAAAA,IACZ,YAAY;AAAA,IACZ,oBAAoB;AAAA,IACpB,QAAQ;AAAA,IACR,YAAY;AAAA,IACZ,aAAa,EAAE,SAAS,IAAA;AAAA,IACxB,kBAAkB;AAAA,MAChB,cAAc;AAAA,MACd,cAAc;AAAA,MACd,eAAe;AAAA,IAAA;AAAA,IAEjB,SAAS;AAAA,MACP,YAAY;AAAA,MAC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,EAEnD,QAAQ;AAAA,IACN,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,SAAS,EAAE,OAAO,UAAU,QAAQ,SAAA;AAAA,EAAS;AAAA,EAE/C,QAAQ,EAAE,cAAcC,EAAO;AAAA,EAC/B,SAAS,EAAE,cAAc,SAAA;AAC3B,CAAC,GA+BYC,KAASC,EAAM;AAAA,EAC1B,SACE;AAAA,IACE,SAAAC,IAAU;AAAA,IACV,MAAAC,IAAO;AAAA,IACP,OAAAC,IAAQ;AAAA,IACR,aAAAC,IAAc;AAAA,IACd,WAAAC;AAAA,IACA,SAAAC,IAAU;AAAA,IACV,GAAGC;AAAA,EAAA,GAELC,GACA;AACA,UAAMC,IAASxC,EAAA,GACTyC,IAKJN,KAAeH,MAAY,UACtB,GAAGA,CAAO,gBAIXA,GACAU,IASJ;AAAA,MACE,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,MAAM;AAAA,MACN,IAAI;AAAA,MACJ,WAAW;AAAA,MACX,WAAW;AAAA,MACX,MAAM;AAAA,MACN,WAAW;AAAA,IAAA,EAEbT,CAAI;AAIN,WACE,gBAAAU;AAAA,MAHWN,IAAUO,IAAO7C;AAAA,MAG3B;AAAA,QACC,KAAAwC;AAAA,QACA,aAAU;AAAA,QACJ,CAACM,CAAS,GAAG;AAAA,QACnB,WAAWC;AAAAA,UACTN,EAAO;AAAA,UACPA,EAAOC,CAAW;AAAA,UAClBD,EAAOE,CAAQ;AAAA,UACfF,EAAON,CAAK;AAAA,UACZE;AAAA,QAAA;AAAA,QAED,GAAGE;AAAA,MAAA;AAAA,IAAA;AAAA,EAGV;AACF;"}
|
|
1
|
+
{"version":3,"file":"button.js","sources":["../../../src/components/button/button.tsx"],"sourcesContent":["import * as React from \"react\"\n\nimport { mergeClasses, shorthands } from \"@epilot/volt-ui-runtime\"\n\nimport { SLOT_ATTR } from \"../../renderer/contract\"\nimport { makeVoltStyles } from \"../../styles/make-styles\"\nimport * as tokens from \"../../tokens\"\nimport { Slot } from \"@radix-ui/react-slot\"\n\n/**\n * Base UI's type declarations resolve `react` from the hoisted root's `@types/react` (v19), while\n * this package pins `@types/react` 18 in its own node_modules. Re-typing the primitive onto OUR\n * `React` keeps the button's pass-through props and ref on one React type for this package.\n */\n/**\n * A native `<button>`, no primitive.\n *\n * v1's only Radix use here is `Slot`, purely to implement `asChild`, and this does the same. Base\n * UI's button primitive supplied nothing v1 had: it added a dependency, and with it the\n * `@types/react` 19 requirement, for a plain element.\n */\nconst ButtonBase = \"button\" as const\n\nconst useStyles = makeVoltStyles({\n root: {\n display: \"inline-flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n fontWeight: tokens.fontWeightSemibold,\n whiteSpace: \"nowrap\",\n transitionProperty: \"all\",\n cursor: \"pointer\",\n flexShrink: 0,\n \":disabled\": { opacity: 0.5 },\n \":focus-visible\": {\n outlineWidth: \"2px\",\n outlineStyle: \"solid\",\n outlineOffset: \"2px\",\n outlineColor: tokens.semFocusRing,\n },\n \"@media (prefers-reduced-motion: reduce)\": {\n transitionDuration: \"0.01ms\",\n },\n \"& svg\": {\n flexShrink: 0,\n pointerEvents: \"none\",\n color: \"currentColor\",\n },\n },\n primary: {\n backgroundColor: tokens.semAccentSolid,\n color: tokens.semAccentContrast,\n \":hover\": { backgroundColor: tokens.semAccentSolidHover },\n \":active\": { backgroundColor: tokens.semAccentSolidHover },\n },\n secondary: {\n backgroundColor: tokens.semAccentSoft,\n color: tokens.semAccentOnSoft,\n \":hover\": { backgroundColor: tokens.semAccentSoftHover },\n },\n tertiary: {\n backgroundColor: \"transparent\",\n color: tokens.accentA11,\n \":hover\": { backgroundColor: tokens.semAccentSoft },\n },\n ghost: {\n backgroundColor: \"transparent\",\n color: tokens.grayA12,\n \":hover\": { backgroundColor: tokens.semAccentSoft },\n },\n primaryDestructive: {\n backgroundColor: tokens.semErrorSolid,\n color: tokens.semErrorContrast,\n \":hover\": { backgroundColor: tokens.semErrorSolidHover },\n \":active\": { backgroundColor: tokens.semErrorSolidHover },\n },\n secondaryDestructive: {\n backgroundColor: tokens.semErrorSoft,\n color: tokens.semErrorOnSoft,\n \":hover\": { backgroundColor: tokens.semErrorSoftHover },\n },\n tertiaryDestructive: {\n backgroundColor: \"transparent\",\n color: tokens.errorA11,\n \":hover\": { backgroundColor: tokens.semErrorSoft },\n },\n xs: {\n ...shorthands.paddingInline(\"0.5rem\"),\n ...shorthands.paddingBlock(\"0.25rem\"),\n minHeight: \"1.25rem\",\n fontSize: tokens.textXs,\n lineHeight: tokens.leadingXs,\n gap: \"4px\",\n \"& svg\": { width: \"0.75rem\", height: \"0.75rem\" },\n },\n sm: {\n ...shorthands.paddingInline(tokens.spacingElement3),\n ...shorthands.paddingBlock(\"0.25rem\"),\n minHeight: \"1.5rem\",\n fontSize: tokens.textSm,\n lineHeight: tokens.leadingSm,\n gap: \"0.375rem\",\n \"& svg\": { width: \"0.875rem\", height: \"0.875rem\" },\n },\n base: {\n // Density-bound (DENSITY-SPEC.md §2.4, WP9B1-ACCEPTANCE-WP9B2A): padding-inline is the\n // compact/comfortable lever; min-height is floored by the fixed line-height + padding-block\n // below and cannot shrink, so it is bound too (compact === normal, comfortable raised via an\n // explicit minHeight above the natural content box, same mechanism `lg` already uses).\n ...shorthands.paddingInline(tokens.buttonBasePaddingInline),\n ...shorthands.paddingBlock(\"0.25rem\"),\n minHeight: tokens.buttonBaseMinHeight,\n fontSize: tokens.textBase,\n lineHeight: tokens.leadingBase,\n gap: \"0.5rem\",\n \"& svg\": { width: \"1rem\", height: \"1rem\" },\n },\n lg: {\n ...shorthands.paddingInline(\"1.25rem\"),\n ...shorthands.paddingBlock(\"0.25rem\"),\n minHeight: \"2.5rem\",\n fontSize: tokens.textLg,\n lineHeight: tokens.leadingLg,\n gap: \"0.5rem\",\n \"& svg\": { width: \"1rem\", height: \"1rem\" },\n },\n iconXs: {\n width: \"1.5rem\",\n height: \"1.5rem\",\n \"& svg\": { width: \"0.75rem\", height: \"0.75rem\" },\n },\n iconSm: {\n width: \"1.75rem\",\n height: \"1.75rem\",\n \"& svg\": { width: \"0.875rem\", height: \"0.875rem\" },\n },\n icon: {\n // Density-bound: a fixed square, no line-height floor (unlike `base`), so compact/comfortable\n // both move freely (DENSITY-SPEC.md §2.4).\n width: tokens.buttonIconSize,\n height: tokens.buttonIconSize,\n \"& svg\": { width: \"1.125rem\", height: \"1.125rem\" },\n },\n iconLg: {\n width: \"2.5rem\",\n height: \"2.5rem\",\n \"& svg\": { width: \"1.5rem\", height: \"1.5rem\" },\n },\n normal: { borderRadius: tokens.radiusLg },\n rounded: { borderRadius: \"9999px\" },\n})\n\nexport type ButtonVariant = \"primary\" | \"secondary\" | \"tertiary\" | \"ghost\"\nexport type ButtonSize =\n | \"xs\"\n | \"sm\"\n | \"base\"\n | \"lg\"\n | \"icon-xs\"\n | \"icon-sm\"\n | \"icon\"\n | \"icon-lg\"\nexport type ButtonShape = \"normal\" | \"rounded\"\n\nexport type ButtonProps = Omit<\n React.ComponentProps<\"button\">,\n \"variant\" | \"size\" | \"shape\" | \"destructive\" | \"className\" | \"render\"\n> & {\n variant?: ButtonVariant\n size?: ButtonSize\n shape?: ButtonShape\n destructive?: boolean\n className?: string\n /**\n * Render the child element instead of a `button`, keeping Button's styling and slot markers.\n * v1 supports this and consumers rely on it to wrap links; it was dropped here while the package\n * was briefly on Base UI, and restored once it moved back to Radix.\n */\n asChild?: boolean\n}\n\nexport const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(\n function Button(\n {\n variant = \"primary\",\n size = \"base\",\n shape = \"rounded\",\n destructive = false,\n className,\n asChild = false,\n ...props\n },\n ref\n ) {\n const styles = useStyles()\n const variantSlot:\n | ButtonVariant\n | \"primaryDestructive\"\n | \"secondaryDestructive\"\n | \"tertiaryDestructive\" =\n destructive && variant !== \"ghost\"\n ? (`${variant}Destructive` as\n | \"primaryDestructive\"\n | \"secondaryDestructive\"\n | \"tertiaryDestructive\")\n : variant\n const sizeSlot:\n | \"xs\"\n | \"sm\"\n | \"base\"\n | \"lg\"\n | \"iconXs\"\n | \"iconSm\"\n | \"icon\"\n | \"iconLg\" = (\n {\n xs: \"xs\",\n sm: \"sm\",\n base: \"base\",\n lg: \"lg\",\n \"icon-xs\": \"iconXs\",\n \"icon-sm\": \"iconSm\",\n icon: \"icon\",\n \"icon-lg\": \"iconLg\",\n } as const\n )[size]\n\n const Root = asChild ? Slot : ButtonBase\n\n return (\n <Root\n ref={ref}\n data-slot=\"button\"\n {...{ [SLOT_ATTR]: \"button\" }}\n className={mergeClasses(\n styles.root,\n styles[variantSlot],\n styles[sizeSlot],\n styles[shape],\n className\n )}\n {...props}\n />\n )\n }\n)\n"],"names":["ButtonBase","useStyles","makeVoltStyles","tokens.fontWeightSemibold","tokens.semFocusRing","tokens.semAccentSolid","tokens.semAccentContrast","tokens.semAccentSolidHover","tokens.semAccentSoft","tokens.semAccentOnSoft","tokens.semAccentSoftHover","tokens.accentA11","tokens.grayA12","tokens.semErrorSolid","tokens.semErrorContrast","tokens.semErrorSolidHover","tokens.semErrorSoft","tokens.semErrorOnSoft","tokens.semErrorSoftHover","tokens.errorA11","shorthands","tokens.textXs","tokens.leadingXs","tokens.spacingElement3","tokens.textSm","tokens.leadingSm","tokens.buttonBasePaddingInline","tokens.buttonBaseMinHeight","tokens.textBase","tokens.leadingBase","tokens.textLg","tokens.leadingLg","tokens.buttonIconSize","tokens.radiusLg","Button","React","variant","size","shape","destructive","className","asChild","props","ref","styles","variantSlot","sizeSlot","jsx","Slot","SLOT_ATTR","mergeClasses"],"mappings":";;;;;;;;AAqBA,MAAMA,IAAa,UAEbC,IAAYC,EAAe;AAAA,EAC/B,MAAM;AAAA,IACJ,SAAS;AAAA,IACT,YAAY;AAAA,IACZ,gBAAgB;AAAA,IAChB,YAAYC;AAAAA,IACZ,YAAY;AAAA,IACZ,oBAAoB;AAAA,IACpB,QAAQ;AAAA,IACR,YAAY;AAAA,IACZ,aAAa,EAAE,SAAS,IAAA;AAAA,IACxB,kBAAkB;AAAA,MAChB,cA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SAAS,EAAE,OAAO,UAAU,QAAQ,SAAA;AAAA,EAAS;AAAA,EAE/C,QAAQ,EAAE,cAAcC,EAAO;AAAA,EAC/B,SAAS,EAAE,cAAc,SAAA;AAC3B,CAAC,GA+BYC,KAASC,EAAM;AAAA,EAC1B,SACE;AAAA,IACE,SAAAC,IAAU;AAAA,IACV,MAAAC,IAAO;AAAA,IACP,OAAAC,IAAQ;AAAA,IACR,aAAAC,IAAc;AAAA,IACd,WAAAC;AAAA,IACA,SAAAC,IAAU;AAAA,IACV,GAAGC;AAAA,EAAA,GAELC,GACA;AACA,UAAMC,IAAS3C,EAAA,GACT4C,IAKJN,KAAeH,MAAY,UACtB,GAAGA,CAAO,gBAIXA,GACAU,IASJ;AAAA,MACE,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,MAAM;AAAA,MACN,IAAI;AAAA,MACJ,WAAW;AAAA,MACX,WAAW;AAAA,MACX,MAAM;AAAA,MACN,WAAW;AAAA,IAAA,EAEbT,CAAI;AAIN,WACE,gBAAAU;AAAA,MAHWN,IAAUO,IAAOhD;AAAA,MAG3B;AAAA,QACC,KAAA2C;AAAA,QACA,aAAU;AAAA,QACJ,CAACM,CAAS,GAAG;AAAA,QACnB,WAAWC;AAAAA,UACTN,EAAO;AAAA,UACPA,EAAOC,CAAW;AAAA,UAClBD,EAAOE,CAAQ;AAAA,UACfF,EAAON,CAAK;AAAA,UACZE;AAAA,QAAA;AAAA,QAED,GAAGE;AAAA,MAAA;AAAA,IAAA;AAAA,EAGV;AACF;"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
-
import * as
|
|
3
|
-
import { Checkbox as m, CheckboxIndicator as
|
|
2
|
+
import * as n from "react";
|
|
3
|
+
import { Checkbox as m, CheckboxIndicator as u } from "../../vendor/@radix-ui/react-checkbox/dist/index.js";
|
|
4
4
|
import { shorthands as e } from "../../packages/volt-runtime/dist/vendor/@griffel/core/src/index.js";
|
|
5
5
|
import { SLOT_ATTR as i } from "../../packages/volt-runtime/dist/renderer/contract.js";
|
|
6
|
-
import { mergeClasses as
|
|
7
|
-
import { makeVoltStyles as
|
|
8
|
-
import { errorA8 as
|
|
9
|
-
const y =
|
|
6
|
+
import { mergeClasses as x } from "../../packages/volt-runtime/dist/vendor/@griffel/core/src/mergeClasses.js";
|
|
7
|
+
import { makeVoltStyles as b } from "../../styles/make-styles.js";
|
|
8
|
+
import { errorA8 as p, grayA4 as f, accentA7 as s, semAccentContrast as g, semAccentSolid as k, semAccentOnSoft as w, semFocusRing as d, radiusSm as C, semAccentSoft as v } from "../../tokens/index.js";
|
|
9
|
+
const y = n.forwardRef(function(r, t) {
|
|
10
10
|
return /* @__PURE__ */ o(
|
|
11
11
|
"svg",
|
|
12
12
|
{
|
|
@@ -22,7 +22,7 @@ const y = c.forwardRef(function(r, t) {
|
|
|
22
22
|
children: /* @__PURE__ */ o("path", { d: "m382-354 339-339q12-12 28-12t28 12q12 12 12 28.5T777-636L410-268q-12 12-28 12t-28-12L182-440q-12-12-11.5-28.5T183-497q12-12 28.5-12t28.5 12l142 143Z" })
|
|
23
23
|
}
|
|
24
24
|
);
|
|
25
|
-
}), S =
|
|
25
|
+
}), S = n.forwardRef(function(r, t) {
|
|
26
26
|
return /* @__PURE__ */ o(
|
|
27
27
|
"svg",
|
|
28
28
|
{
|
|
@@ -38,9 +38,9 @@ const y = c.forwardRef(function(r, t) {
|
|
|
38
38
|
children: /* @__PURE__ */ o("path", { d: "M280-440q-17 0-28.5-11.5T240-480q0-17 11.5-28.5T280-520h400q17 0 28.5 11.5T720-480q0 17-11.5 28.5T680-440H280Z" })
|
|
39
39
|
}
|
|
40
40
|
);
|
|
41
|
-
}), T =
|
|
41
|
+
}), T = b({
|
|
42
42
|
root: {
|
|
43
|
-
...e.border("1px", "solid",
|
|
43
|
+
...e.border("1px", "solid", s),
|
|
44
44
|
backgroundColor: v,
|
|
45
45
|
display: "inline-block",
|
|
46
46
|
boxSizing: "border-box",
|
|
@@ -53,30 +53,33 @@ const y = c.forwardRef(function(r, t) {
|
|
|
53
53
|
transitionProperty: "box-shadow",
|
|
54
54
|
transitionTimingFunction: "cubic-bezier(0.4, 0, 0.2, 1)",
|
|
55
55
|
transitionDuration: "150ms",
|
|
56
|
+
"@media (prefers-reduced-motion: reduce)": {
|
|
57
|
+
transitionDuration: "0.01ms"
|
|
58
|
+
},
|
|
56
59
|
":focus-visible": {
|
|
57
60
|
outlineOffset: "2px",
|
|
58
61
|
outlineWidth: "2px",
|
|
59
62
|
outlineStyle: "solid",
|
|
60
|
-
outlineColor:
|
|
63
|
+
outlineColor: d
|
|
61
64
|
},
|
|
62
65
|
"&[data-disabled]": {
|
|
63
66
|
cursor: "not-allowed",
|
|
64
67
|
opacity: 0.5,
|
|
65
|
-
...e.borderColor(
|
|
68
|
+
...e.borderColor(f)
|
|
66
69
|
},
|
|
67
70
|
"&[aria-invalid='true']": {
|
|
68
|
-
outlineColor:
|
|
69
|
-
...e.borderColor(
|
|
71
|
+
outlineColor: d,
|
|
72
|
+
...e.borderColor(p)
|
|
70
73
|
},
|
|
71
74
|
"&[data-state='indeterminate']": {
|
|
72
|
-
backgroundColor:
|
|
75
|
+
backgroundColor: s,
|
|
73
76
|
...e.borderColor("transparent"),
|
|
74
|
-
color:
|
|
77
|
+
color: w
|
|
75
78
|
},
|
|
76
79
|
"&[data-state='checked']": {
|
|
77
80
|
backgroundColor: k,
|
|
78
81
|
...e.borderWidth("0px"),
|
|
79
|
-
color:
|
|
82
|
+
color: g
|
|
80
83
|
},
|
|
81
84
|
"&[data-state='checked'] svg, &[data-state='indeterminate'] svg": {
|
|
82
85
|
width: "0.875rem",
|
|
@@ -94,7 +97,7 @@ const y = c.forwardRef(function(r, t) {
|
|
|
94
97
|
height: "0.875rem"
|
|
95
98
|
}
|
|
96
99
|
}
|
|
97
|
-
}),
|
|
100
|
+
}), z = n.forwardRef(function({ className: r, checked: t, ...l }, h) {
|
|
98
101
|
const a = T();
|
|
99
102
|
return /* @__PURE__ */ o(
|
|
100
103
|
m,
|
|
@@ -103,10 +106,10 @@ const y = c.forwardRef(function(r, t) {
|
|
|
103
106
|
checked: t,
|
|
104
107
|
"data-slot": "checkbox",
|
|
105
108
|
[i]: "checkbox",
|
|
106
|
-
className:
|
|
109
|
+
className: x(a.root, r),
|
|
107
110
|
...l,
|
|
108
111
|
children: /* @__PURE__ */ o(
|
|
109
|
-
|
|
112
|
+
u,
|
|
110
113
|
{
|
|
111
114
|
"data-slot": "checkbox-indicator",
|
|
112
115
|
[i]: "checkbox-indicator",
|
|
@@ -118,6 +121,6 @@ const y = c.forwardRef(function(r, t) {
|
|
|
118
121
|
);
|
|
119
122
|
});
|
|
120
123
|
export {
|
|
121
|
-
|
|
124
|
+
z as Checkbox
|
|
122
125
|
};
|
|
123
126
|
//# sourceMappingURL=checkbox.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkbox.js","sources":["../../../src/components/checkbox/checkbox.tsx"],"sourcesContent":["import * as React from \"react\"\nimport * as CheckboxPrimitive from \"@radix-ui/react-checkbox\"\nimport { mergeClasses, shorthands } from \"@epilot/volt-ui-runtime\"\n\nimport { SLOT_ATTR } from \"../../renderer/contract\"\nimport { makeVoltStyles } from \"../../styles/make-styles\"\nimport * as tokens from \"../../tokens\"\n\nconst CheckIcon = React.forwardRef<\n SVGSVGElement,\n React.SVGProps<SVGSVGElement>\n>(function CheckIcon(props, ref) {\n return (\n <svg\n ref={ref}\n data-slot=\"checkbox-check-icon\"\n {...{ [SLOT_ATTR]: \"checkbox-check-icon\" }}\n xmlns=\"http://www.w3.org/2000/svg\"\n height=\"24px\"\n viewBox=\"0 -960 960 960\"\n width=\"24px\"\n fill=\"currentColor\"\n {...props}\n >\n <path d=\"m382-354 339-339q12-12 28-12t28 12q12 12 12 28.5T777-636L410-268q-12 12-28 12t-28-12L182-440q-12-12-11.5-28.5T183-497q12-12 28.5-12t28.5 12l142 143Z\" />\n </svg>\n )\n})\n\nconst MinusIcon = React.forwardRef<\n SVGSVGElement,\n React.SVGProps<SVGSVGElement>\n>(function MinusIcon(props, ref) {\n return (\n <svg\n ref={ref}\n data-slot=\"checkbox-minus-icon\"\n {...{ [SLOT_ATTR]: \"checkbox-minus-icon\" }}\n xmlns=\"http://www.w3.org/2000/svg\"\n height=\"24px\"\n viewBox=\"0 -960 960 960\"\n width=\"24px\"\n fill=\"currentColor\"\n {...props}\n >\n <path d=\"M280-440q-17 0-28.5-11.5T240-480q0-17 11.5-28.5T280-520h400q17 0 28.5 11.5T720-480q0 17-11.5 28.5T680-440H280Z\" />\n </svg>\n )\n})\n\nconst useStyles = makeVoltStyles({\n root: {\n ...shorthands.border(\"1px\", \"solid\", tokens.accentA7),\n backgroundColor: tokens.semAccentSoft,\n display: \"inline-block\",\n boxSizing: \"border-box\",\n width: \"1rem\",\n height: \"1rem\",\n flexShrink: 0,\n borderRadius: tokens.radiusSm,\n // v1 `shadow-xs` — elevation comes from Tailwind's shadow scale, which has no token (B7).\n boxShadow: \"0 1px 2px 0 #0000000d\",\n transitionProperty: \"box-shadow\",\n transitionTimingFunction: \"cubic-bezier(0.4, 0, 0.2, 1)\",\n transitionDuration: \"150ms\",\n \":focus-visible\": {\n outlineOffset: \"2px\",\n outlineWidth: \"2px\",\n outlineStyle: \"solid\",\n outlineColor: tokens.
|
|
1
|
+
{"version":3,"file":"checkbox.js","sources":["../../../src/components/checkbox/checkbox.tsx"],"sourcesContent":["import * as React from \"react\"\nimport * as CheckboxPrimitive from \"@radix-ui/react-checkbox\"\nimport { mergeClasses, shorthands } from \"@epilot/volt-ui-runtime\"\n\nimport { SLOT_ATTR } from \"../../renderer/contract\"\nimport { makeVoltStyles } from \"../../styles/make-styles\"\nimport * as tokens from \"../../tokens\"\n\nconst CheckIcon = React.forwardRef<\n SVGSVGElement,\n React.SVGProps<SVGSVGElement>\n>(function CheckIcon(props, ref) {\n return (\n <svg\n ref={ref}\n data-slot=\"checkbox-check-icon\"\n {...{ [SLOT_ATTR]: \"checkbox-check-icon\" }}\n xmlns=\"http://www.w3.org/2000/svg\"\n height=\"24px\"\n viewBox=\"0 -960 960 960\"\n width=\"24px\"\n fill=\"currentColor\"\n {...props}\n >\n <path d=\"m382-354 339-339q12-12 28-12t28 12q12 12 12 28.5T777-636L410-268q-12 12-28 12t-28-12L182-440q-12-12-11.5-28.5T183-497q12-12 28.5-12t28.5 12l142 143Z\" />\n </svg>\n )\n})\n\nconst MinusIcon = React.forwardRef<\n SVGSVGElement,\n React.SVGProps<SVGSVGElement>\n>(function MinusIcon(props, ref) {\n return (\n <svg\n ref={ref}\n data-slot=\"checkbox-minus-icon\"\n {...{ [SLOT_ATTR]: \"checkbox-minus-icon\" }}\n xmlns=\"http://www.w3.org/2000/svg\"\n height=\"24px\"\n viewBox=\"0 -960 960 960\"\n width=\"24px\"\n fill=\"currentColor\"\n {...props}\n >\n <path d=\"M280-440q-17 0-28.5-11.5T240-480q0-17 11.5-28.5T280-520h400q17 0 28.5 11.5T720-480q0 17-11.5 28.5T680-440H280Z\" />\n </svg>\n )\n})\n\nconst useStyles = makeVoltStyles({\n root: {\n ...shorthands.border(\"1px\", \"solid\", tokens.accentA7),\n backgroundColor: tokens.semAccentSoft,\n display: \"inline-block\",\n boxSizing: \"border-box\",\n width: \"1rem\",\n height: \"1rem\",\n flexShrink: 0,\n borderRadius: tokens.radiusSm,\n // v1 `shadow-xs` — elevation comes from Tailwind's shadow scale, which has no token (B7).\n boxShadow: \"0 1px 2px 0 #0000000d\",\n transitionProperty: \"box-shadow\",\n transitionTimingFunction: \"cubic-bezier(0.4, 0, 0.2, 1)\",\n transitionDuration: \"150ms\",\n \"@media (prefers-reduced-motion: reduce)\": {\n transitionDuration: \"0.01ms\",\n },\n \":focus-visible\": {\n outlineOffset: \"2px\",\n outlineWidth: \"2px\",\n outlineStyle: \"solid\",\n outlineColor: tokens.semFocusRing,\n },\n \"&[data-disabled]\": {\n cursor: \"not-allowed\",\n opacity: 0.5,\n ...shorthands.borderColor(tokens.grayA4),\n },\n \"&[aria-invalid='true']\": {\n outlineColor: tokens.semFocusRing,\n ...shorthands.borderColor(tokens.errorA8),\n },\n \"&[data-state='indeterminate']\": {\n backgroundColor: tokens.accentA7,\n ...shorthands.borderColor(\"transparent\"),\n color: tokens.semAccentOnSoft,\n },\n \"&[data-state='checked']\": {\n backgroundColor: tokens.semAccentSolid,\n ...shorthands.borderWidth(\"0px\"),\n color: tokens.semAccentContrast,\n },\n \"&[data-state='checked'] svg, &[data-state='indeterminate'] svg\": {\n width: \"0.875rem\",\n height: \"0.875rem\",\n },\n },\n indicator: {\n display: \"grid\",\n placeContent: \"center\",\n height: \"100%\",\n color: \"currentColor\",\n transitionProperty: \"none\",\n \"& svg\": {\n width: \"0.875rem\",\n height: \"0.875rem\",\n },\n },\n})\n\nexport type CheckboxProps = React.ComponentProps<typeof CheckboxPrimitive.Root>\n\nexport const Checkbox = React.forwardRef<\n React.ComponentRef<typeof CheckboxPrimitive.Root>,\n CheckboxProps\n>(function Checkbox({ className, checked, ...props }, ref) {\n const styles = useStyles()\n\n return (\n <CheckboxPrimitive.Root\n ref={ref}\n checked={checked}\n data-slot=\"checkbox\"\n {...{ [SLOT_ATTR]: \"checkbox\" }}\n className={mergeClasses(styles.root, className)}\n {...props}\n >\n <CheckboxPrimitive.Indicator\n data-slot=\"checkbox-indicator\"\n {...{ [SLOT_ATTR]: \"checkbox-indicator\" }}\n className={styles.indicator}\n >\n {checked === \"indeterminate\" ? <MinusIcon /> : <CheckIcon />}\n </CheckboxPrimitive.Indicator>\n </CheckboxPrimitive.Root>\n )\n})\n"],"names":["CheckIcon","React","props","ref","jsx","SLOT_ATTR","MinusIcon","useStyles","makeVoltStyles","shorthands","tokens.accentA7","tokens.semAccentSoft","tokens.radiusSm","tokens.semFocusRing","tokens.grayA4","tokens.errorA8","tokens.semAccentOnSoft","tokens.semAccentSolid","tokens.semAccentContrast","Checkbox","className","checked","styles","CheckboxPrimitive.Root","mergeClasses","Che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