@skdx/tokens 0.27.0 → 0.29.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.
Files changed (193) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +92 -69
  3. package/dist/foundation.css +1 -1
  4. package/dist/index.cjs +1 -1
  5. package/dist/index.d.cts +3 -2
  6. package/dist/index.d.ts +3 -2
  7. package/dist/index.js +1 -1
  8. package/dist/themes/AntDark.cjs +1 -1
  9. package/dist/themes/AntDark.d.cts +3 -12
  10. package/dist/themes/AntDark.d.ts +3 -12
  11. package/dist/themes/AntDark.js +1 -1
  12. package/dist/themes/{AntBrand.cjs → AntLight.cjs} +1 -1
  13. package/dist/themes/{AntBrand.d.cts → AntLight.d.cts} +1 -1
  14. package/dist/themes/{AntBrand.d.ts → AntLight.d.ts} +1 -1
  15. package/dist/themes/{AntBrand.js → AntLight.js} +1 -1
  16. package/dist/themes/CatppuccinLatte.cjs +1 -1
  17. package/dist/themes/CatppuccinLatte.d.cts +1 -7
  18. package/dist/themes/CatppuccinLatte.d.ts +1 -7
  19. package/dist/themes/CatppuccinLatte.js +1 -1
  20. package/dist/themes/CatppuccinMocha.cjs +1 -1
  21. package/dist/themes/CatppuccinMocha.d.cts +1 -7
  22. package/dist/themes/CatppuccinMocha.d.ts +1 -7
  23. package/dist/themes/CatppuccinMocha.js +1 -1
  24. package/dist/themes/ChakraDark.cjs +1 -1
  25. package/dist/themes/ChakraDark.d.cts +3 -12
  26. package/dist/themes/ChakraDark.d.ts +3 -12
  27. package/dist/themes/ChakraDark.js +1 -1
  28. package/dist/themes/{ChakraBrand.cjs → ChakraLight.cjs} +1 -1
  29. package/dist/themes/{ChakraBrand.d.cts → ChakraLight.d.cts} +1 -1
  30. package/dist/themes/{ChakraBrand.d.ts → ChakraLight.d.ts} +1 -1
  31. package/dist/themes/{ChakraBrand.js → ChakraLight.js} +1 -1
  32. package/dist/themes/CupcakeDark.cjs +1 -1
  33. package/dist/themes/CupcakeDark.d.cts +3 -5
  34. package/dist/themes/CupcakeDark.d.ts +3 -5
  35. package/dist/themes/CupcakeLight.cjs +1 -1
  36. package/dist/themes/CupcakeLight.d.cts +1 -8
  37. package/dist/themes/CupcakeLight.d.ts +1 -8
  38. package/dist/themes/CupcakeLight.js +1 -1
  39. package/dist/themes/DefaultTheme.cjs +1 -1
  40. package/dist/themes/DefaultTheme.d.cts +3 -15
  41. package/dist/themes/DefaultTheme.d.ts +3 -15
  42. package/dist/themes/DefaultTheme.js +1 -1
  43. package/dist/themes/DraculaLight.cjs +1 -1
  44. package/dist/themes/DraculaLight.d.cts +3 -10
  45. package/dist/themes/DraculaLight.d.ts +3 -10
  46. package/dist/themes/DraculaLight.js +1 -1
  47. package/dist/themes/EmeraldDark.cjs +1 -1
  48. package/dist/themes/EmeraldDark.d.cts +3 -8
  49. package/dist/themes/EmeraldDark.d.ts +3 -8
  50. package/dist/themes/EmeraldDark.js +1 -1
  51. package/dist/themes/{EmeraldBrand.cjs → EmeraldLight.cjs} +1 -1
  52. package/dist/themes/{EmeraldBrand.d.cts → EmeraldLight.d.cts} +1 -1
  53. package/dist/themes/{EmeraldBrand.d.ts → EmeraldLight.d.ts} +1 -1
  54. package/dist/themes/{EmeraldBrand.js → EmeraldLight.js} +1 -1
  55. package/dist/themes/EverforestDark.cjs +1 -1
  56. package/dist/themes/EverforestDark.d.cts +1 -2
  57. package/dist/themes/EverforestDark.d.ts +1 -2
  58. package/dist/themes/EverforestDark.js +1 -1
  59. package/dist/themes/EverforestLight.cjs +1 -1
  60. package/dist/themes/EverforestLight.d.cts +3 -9
  61. package/dist/themes/EverforestLight.d.ts +3 -9
  62. package/dist/themes/FluentDark.cjs +1 -1
  63. package/dist/themes/FluentDark.d.cts +3 -11
  64. package/dist/themes/FluentDark.d.ts +3 -11
  65. package/dist/themes/FluentDark.js +1 -1
  66. package/dist/themes/{FluentBrand.cjs → FluentLight.cjs} +1 -1
  67. package/dist/themes/{FluentBrand.d.cts → FluentLight.d.cts} +1 -1
  68. package/dist/themes/{FluentBrand.d.ts → FluentLight.d.ts} +1 -1
  69. package/dist/themes/{FluentBrand.js → FluentLight.js} +1 -1
  70. package/dist/themes/GraphiteDark.cjs +1 -1
  71. package/dist/themes/GraphiteDark.d.cts +3 -8
  72. package/dist/themes/GraphiteDark.d.ts +3 -8
  73. package/dist/themes/GraphiteDark.js +1 -1
  74. package/dist/themes/{GraphiteBrand.cjs → GraphiteLight.cjs} +1 -1
  75. package/dist/themes/{GraphiteBrand.d.cts → GraphiteLight.d.cts} +1 -1
  76. package/dist/themes/{GraphiteBrand.d.ts → GraphiteLight.d.ts} +1 -1
  77. package/dist/themes/{GraphiteBrand.js → GraphiteLight.js} +1 -1
  78. package/dist/themes/GruvboxDark.cjs +1 -1
  79. package/dist/themes/GruvboxDark.d.cts +1 -7
  80. package/dist/themes/GruvboxDark.d.ts +1 -7
  81. package/dist/themes/GruvboxDark.js +1 -1
  82. package/dist/themes/GruvboxLight.cjs +1 -1
  83. package/dist/themes/GruvboxLight.d.cts +3 -13
  84. package/dist/themes/GruvboxLight.d.ts +3 -13
  85. package/dist/themes/GruvboxLight.js +1 -1
  86. package/dist/themes/MaterialDark.cjs +1 -1
  87. package/dist/themes/MaterialDark.d.cts +3 -12
  88. package/dist/themes/MaterialDark.d.ts +3 -12
  89. package/dist/themes/MaterialDark.js +1 -1
  90. package/dist/themes/{MaterialBrand.cjs → MaterialLight.cjs} +1 -1
  91. package/dist/themes/MaterialLight.d.cts +3 -0
  92. package/dist/themes/MaterialLight.d.ts +3 -0
  93. package/dist/themes/{MaterialBrand.js → MaterialLight.js} +1 -1
  94. package/dist/themes/MidnightDark.cjs +1 -0
  95. package/dist/themes/MidnightDark.d.cts +3 -0
  96. package/dist/themes/MidnightDark.d.ts +3 -0
  97. package/dist/themes/{MidnightBrand.js → MidnightDark.js} +1 -1
  98. package/dist/themes/MidnightLight.cjs +1 -1
  99. package/dist/themes/MidnightLight.d.cts +4 -6
  100. package/dist/themes/MidnightLight.d.ts +4 -6
  101. package/dist/themes/MidnightLight.js +1 -1
  102. package/dist/themes/NordDark.cjs +1 -1
  103. package/dist/themes/NordDark.js +1 -1
  104. package/dist/themes/NordLight.cjs +1 -1
  105. package/dist/themes/NordLight.d.cts +3 -13
  106. package/dist/themes/NordLight.d.ts +3 -13
  107. package/dist/themes/NordLight.js +1 -1
  108. package/dist/themes/OneDark.cjs +1 -1
  109. package/dist/themes/OneDark.d.cts +1 -7
  110. package/dist/themes/OneDark.d.ts +1 -7
  111. package/dist/themes/OneDark.js +1 -1
  112. package/dist/themes/OneLight.cjs +1 -1
  113. package/dist/themes/OneLight.d.cts +3 -9
  114. package/dist/themes/OneLight.d.ts +3 -9
  115. package/dist/themes/OneLight.js +1 -1
  116. package/dist/themes/PrimerDark.cjs +1 -1
  117. package/dist/themes/PrimerDark.d.cts +0 -1
  118. package/dist/themes/PrimerDark.d.ts +0 -1
  119. package/dist/themes/PrimerDark.js +1 -1
  120. package/dist/themes/PrimerLight.d.cts +1 -7
  121. package/dist/themes/PrimerLight.d.ts +1 -7
  122. package/dist/themes/RosePine.cjs +1 -1
  123. package/dist/themes/RosePine.d.cts +1 -7
  124. package/dist/themes/RosePine.d.ts +1 -7
  125. package/dist/themes/RosePine.js +1 -1
  126. package/dist/themes/RosePineDawn.cjs +1 -1
  127. package/dist/themes/RosePineDawn.d.cts +3 -9
  128. package/dist/themes/RosePineDawn.d.ts +3 -9
  129. package/dist/themes/RosePineDawn.js +1 -1
  130. package/dist/themes/SkandaDark.cjs +1 -1
  131. package/dist/themes/SkandaDark.d.cts +5 -8
  132. package/dist/themes/SkandaDark.d.ts +5 -8
  133. package/dist/themes/SkandaDark.js +1 -1
  134. package/dist/themes/SkandaLight.cjs +1 -1
  135. package/dist/themes/SkandaLight.js +1 -1
  136. package/dist/themes/SolarizedDark.d.cts +1 -7
  137. package/dist/themes/SolarizedDark.d.ts +1 -7
  138. package/dist/themes/SolarizedLight.cjs +1 -1
  139. package/dist/themes/SolarizedLight.d.cts +1 -7
  140. package/dist/themes/SolarizedLight.d.ts +1 -7
  141. package/dist/themes/SolarizedLight.js +1 -1
  142. package/dist/themes/SynthwaveDark.d.cts +1 -7
  143. package/dist/themes/SynthwaveDark.d.ts +1 -7
  144. package/dist/themes/SynthwaveLight.cjs +1 -1
  145. package/dist/themes/SynthwaveLight.d.cts +3 -12
  146. package/dist/themes/SynthwaveLight.d.ts +3 -12
  147. package/dist/themes/SynthwaveLight.js +1 -1
  148. package/dist/themes/brands.cjs +1 -1
  149. package/dist/themes/brands.d.cts +5 -28
  150. package/dist/themes/brands.d.ts +5 -28
  151. package/dist/themes/brands.js +1 -1
  152. package/dist/themes/createBrandTheme.cjs +1 -1
  153. package/dist/themes/createBrandTheme.d.cts +11 -23
  154. package/dist/themes/createBrandTheme.d.ts +11 -23
  155. package/dist/themes/createBrandTheme.js +1 -1
  156. package/dist/themes/index.cjs +1 -1
  157. package/dist/themes/index.d.cts +10 -9
  158. package/dist/themes/index.d.ts +10 -9
  159. package/dist/themes/index.js +1 -1
  160. package/dist/themes.css +1 -1
  161. package/dist/tokens.css +1 -1
  162. package/dist/tokens.dtcg.json +14246 -0
  163. package/dist/utils/aliases.cjs +9 -3
  164. package/dist/utils/aliases.d.cts +19 -99
  165. package/dist/utils/aliases.d.ts +19 -99
  166. package/dist/utils/aliases.js +9 -3
  167. package/dist/utils/contrast.d.cts +2 -17
  168. package/dist/utils/contrast.d.ts +2 -17
  169. package/dist/utils/cssVars.cjs +2 -2
  170. package/dist/utils/cssVars.d.cts +12 -37
  171. package/dist/utils/cssVars.d.ts +12 -37
  172. package/dist/utils/cssVars.js +2 -2
  173. package/dist/utils/foundation.cjs +4 -4
  174. package/dist/utils/foundation.d.cts +24 -177
  175. package/dist/utils/foundation.d.ts +24 -177
  176. package/dist/utils/foundation.js +3 -3
  177. package/dist/utils/mode.cjs +1 -1
  178. package/dist/utils/mode.d.cts +18 -57
  179. package/dist/utils/mode.d.ts +18 -57
  180. package/dist/utils/mode.js +1 -1
  181. package/dist/utils/theme.cjs +1 -1
  182. package/dist/utils/theme.d.cts +68 -292
  183. package/dist/utils/theme.d.ts +68 -292
  184. package/dist/utils/toCss.cjs +5 -5
  185. package/dist/utils/toCss.d.cts +22 -60
  186. package/dist/utils/toCss.d.ts +22 -60
  187. package/dist/utils/toCss.js +5 -5
  188. package/package.json +5 -4
  189. package/dist/themes/MaterialBrand.d.cts +0 -3
  190. package/dist/themes/MaterialBrand.d.ts +0 -3
  191. package/dist/themes/MidnightBrand.cjs +0 -1
  192. package/dist/themes/MidnightBrand.d.cts +0 -11
  193. package/dist/themes/MidnightBrand.d.ts +0 -11
@@ -1,15 +1,15 @@
1
- "use strict";var i=Object.defineProperty;var $=Object.getOwnPropertyDescriptor;var v=Object.getOwnPropertyNames;var C=Object.prototype.hasOwnProperty;var b=(o,e)=>{for(var n in e)i(o,n,{get:e[n],enumerable:!0})},z=(o,e,n,m)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of v(e))!C.call(o,a)&&a!==n&&i(o,a,{get:()=>e[a],enumerable:!(m=$(e,a))||m.enumerable});return o};var M=o=>z(i({},"__esModule",{value:!0}),o);var V={};b(V,{borderWidth:()=>y,breakpoints:()=>F,coarsePointerToCssVars:()=>S,controls:()=>f,controlsCoarse:()=>w,focusRing:()=>h,foundationToCss:()=>I,foundationToCssVars:()=>T,motion:()=>x,opacity:()=>k,radii:()=>l,shadows:()=>g,space:()=>d,typography:()=>c,zIndex:()=>u});module.exports=M(V);var t=require("./cssVars.cjs"),p=require("./theme.cjs"),r="skdx",c={fontFamily:"-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif",fontFamilyMono:"'SF Mono', SFMono-Regular, ui-monospace, Menlo, Consolas, monospace",fontSize:{xs:"0.75rem",sm:"0.875rem",md:"1rem",lg:"1.125rem",xl:"1.25rem","2xl":"1.5rem","3xl":"1.875rem"},fontWeight:{regular:400,medium:500,semibold:600,bold:700},lineHeight:{tight:"1.25",snug:"1.43",normal:"1.5",relaxed:"1.75"},letterSpacing:{tight:"-0.015em",normal:"0em",wide:"0.025em",wider:"0.05em"}},d={1:"0.25rem",2:"0.5rem",3:"0.75rem",4:"1rem",5:"1.25rem",6:"1.5rem",8:"2rem",10:"2.5rem",12:"3rem",16:"4rem"},l={sm:"0.25rem",inner:"0.375rem",md:"0.5rem",lg:"0.75rem",xl:"1rem",full:"9999px"},g={sm:`0 1px 2px 0 ${s(.05)}`,md:`0 4px 6px -1px ${s(.1)}, 0 2px 4px -2px ${s(.1)}`,lg:`0 10px 15px -3px ${s(.1)}, 0 4px 6px -4px ${s(.1)}`,overlay:`0 25px 50px -12px ${s(.25)}`};function s(o){return`rgb(var(--${r}-shadow-color) / calc(${o} * var(--${r}-shadow-strength)))`}var x=p.defaultMotion,u={base:0,dropdown:10,sticky:20,overlay:30,modal:35,popover:40,toast:50,max:9999},h={width:"2px",offset:"2px",offsetInset:"calc(-1 * var(--skdx-focus-ring-width))"},y={thin:"1px",thick:"2px",thicker:"4px"},f={control:{height:{sm:"1.875rem",md:"2.25rem",lg:"2.625rem",compact:"2rem"},padding:{sm:"0.625rem",md:`var(--${r}-space-3)`,lg:`var(--${r}-space-4)`},gap:{sm:`var(--${r}-space-1)`,md:`var(--${r}-space-2)`,lg:`var(--${r}-space-2)`}},iconSize:{sm:"1rem",md:"1.25rem",lg:"1.5rem"},indicatorSize:{sm:"1rem",md:"1.25rem",lg:"1.5rem"},item:{height:{sm:"1.75rem",md:"2.25rem",lg:"2.5rem"},gap:"2px"},overlay:{padding:`var(--${r}-space-1)`,radius:`var(--${r}-radius-lg)`,minWidth:"7.5rem"},field:{gap:`var(--${r}-space-1)`,labelGap:`var(--${r}-space-1)`},target:{min:"24px"}},w={control:{height:{sm:"2.25rem",md:"2.75rem",lg:"3rem",compact:"2.75rem"}},item:{height:{sm:"2.25rem",md:"2.75rem",lg:"3rem"}},target:{min:"44px"}},k={disabled:"0.5",scrim:"0.6"},F={sm:640,md:768,lg:1024,xl:1280};function T(){return(0,t.sectionsToCssVars)([["font",c],["space",d],["radius",l],["shadow",g],["motion",x],["z-index",u],["focus-ring",h],["border-width",y],["opacity",k],...R(f)])}function R(o){let e=n=>o[n];return[["control",e("control")],["icon-size",e("iconSize")],["indicator-size",e("indicatorSize")],["item",e("item")],["overlay",e("overlay")],["field",e("field")],["target",e("target")]]}function S(){return(0,t.sectionsToCssVars)(R(w))}function I(){let o=T(),e=(0,t.reducedMotionVarNames)(o).map(n=>` ${n}: 0ms;`);return`:root {
2
- ${(0,t.varsToDeclarations)(o)}
1
+ "use strict";var a=Object.defineProperty;var v=Object.getOwnPropertyDescriptor;var b=Object.getOwnPropertyNames;var w=Object.prototype.hasOwnProperty;var R=(r,o)=>{for(var t in o)a(r,t,{get:o[t],enumerable:!0})},k=(r,o,t,m)=>{if(o&&typeof o=="object"||typeof o=="function")for(let s of b(o))!w.call(r,s)&&s!==t&&a(r,s,{get:()=>o[s],enumerable:!(m=v(o,s))||m.enumerable});return r};var z=r=>k(a({},"__esModule",{value:!0}),r);var F={};R(F,{borderWidth:()=>y,breakpoints:()=>M,coarsePointerToCssVars:()=>$,controls:()=>f,controlsCoarse:()=>u,focusRing:()=>h,foundationToCss:()=>V,foundationToCssVars:()=>C,motion:()=>x,opacity:()=>T,radii:()=>d,shadows:()=>l,space:()=>c,typography:()=>p,zIndex:()=>g});module.exports=z(F);var e=require("./cssVars.cjs"),i=require("./theme.cjs"),p={fontFamily:"-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif",fontFamilyMono:"'SF Mono', SFMono-Regular, ui-monospace, Menlo, Consolas, monospace",fontSize:{xs:"0.75rem",sm:"0.875rem",md:"1rem",lg:"1.125rem",xl:"1.25rem","2xl":"1.5rem","3xl":"1.875rem"},fontWeight:{regular:400,medium:500,semibold:600,bold:700},lineHeight:{tight:"1.25",snug:"1.43",normal:"1.5",relaxed:"1.75"},letterSpacing:{tight:"-0.015em",normal:"0em",wide:"0.025em",wider:"0.05em"}},c={1:"0.25rem",2:"0.5rem",3:"0.75rem",4:"1rem",5:"1.25rem",6:"1.5rem",8:"2rem",10:"2.5rem",12:"3rem",16:"4rem"},d={sm:"0.25rem",inner:"0.375rem",md:"0.5rem",lg:"0.75rem",xl:"1rem",full:"9999px"},l={sm:`0 1px 2px 0 ${n(.05)}`,md:`0 4px 6px -1px ${n(.1)}, 0 2px 4px -2px ${n(.1)}`,lg:`0 10px 15px -3px ${n(.1)}, 0 4px 6px -4px ${n(.1)}`,overlay:`0 25px 50px -12px ${n(.25)}`};function n(r){return`rgb(var(--${e.PREFIX}-shadow-color) / calc(${r} * var(--${e.PREFIX}-shadow-strength)))`}var x=i.defaultMotion,g={base:0,dropdown:10,sticky:20,overlay:30,modal:35,popover:40,toast:50,max:9999},h={width:"2px",offset:"2px",offsetInset:"calc(-1 * var(--skdx-focus-ring-width))"},y={thin:"1px",thick:"2px",thicker:"4px"},f={control:{height:{sm:"1.875rem",md:"2.25rem",lg:"2.625rem",compact:"2rem"},padding:{sm:"0.625rem",md:`var(--${e.PREFIX}-space-3)`,lg:`var(--${e.PREFIX}-space-4)`},gap:{sm:`var(--${e.PREFIX}-space-1)`,md:`var(--${e.PREFIX}-space-2)`,lg:`var(--${e.PREFIX}-space-2)`}},iconSize:{sm:"1rem",md:"1.25rem",lg:"1.5rem"},indicatorSize:{sm:"1rem",md:"1.25rem",lg:"1.5rem"},item:{height:{sm:"1.75rem",md:"2.25rem",lg:"2.5rem"},gap:"2px"},overlay:{padding:`var(--${e.PREFIX}-space-1)`,radius:`var(--${e.PREFIX}-radius-lg)`,minWidth:"7.5rem"},field:{gap:`var(--${e.PREFIX}-space-1)`,labelGap:`var(--${e.PREFIX}-space-1)`},target:{min:"24px"}},u={control:{height:{sm:"2.25rem",md:"2.75rem",lg:"3rem",compact:"2.75rem"}},item:{height:{sm:"2.25rem",md:"2.75rem",lg:"3rem"}},target:{min:"44px"}},T={disabled:"0.5",scrim:"0.6"},M={sm:640,md:768,lg:1024,xl:1280};function C(){return(0,e.sectionsToCssVars)([["font",p],["space",c],["radius",d],["shadow",l],["motion",x],["z-index",g],["focus-ring",h],["border-width",y],["opacity",T],...S(f)])}function S(r){let o=t=>r[t];return[["control",o("control")],["icon-size",o("iconSize")],["indicator-size",o("indicatorSize")],["item",o("item")],["overlay",o("overlay")],["field",o("field")],["target",o("target")]]}function $(){return(0,e.sectionsToCssVars)(S(u))}function V(){let r=C(),o=(0,e.reducedMotionVarNames)(r).map(t=>` ${t}: 0ms;`);return`:root {
2
+ ${(0,e.varsToDeclarations)(r)}
3
3
  }
4
4
  @media (prefers-reduced-motion: reduce) {
5
5
  :root {
6
- ${e.join(`
6
+ ${o.join(`
7
7
  `)}
8
8
  }
9
9
  }
10
10
  @media (pointer: coarse) {
11
11
  :root {
12
- ${(0,t.varsToDeclarations)(S()," ")}
12
+ ${(0,e.varsToDeclarations)($()," ")}
13
13
  }
14
14
  }
15
15
  `}0&&(module.exports={borderWidth,breakpoints,coarsePointerToCssVars,controls,controlsCoarse,focusRing,foundationToCss,foundationToCssVars,motion,opacity,radii,shadows,space,typography,zIndex});
@@ -1,79 +1,17 @@
1
+ import { type CssVar } from './cssVars.cjs';
1
2
  import { type ThemeControls, type ThemeControlsCoarse, type ThemeMotion, type ThemeRadii, type ThemeShadows, type ThemeSpace, type ThemeTypography } from './theme.cjs';
2
- /**
3
- * The type system: one font stack, one scale, one set of weights,
4
- * line-heights and tracking steps, shared by every theme.
5
- *
6
- * A theme picks colors. It does not get to resize the type scale, because a
7
- * layout that reflows when you switch brand is a layout that was never
8
- * designed — it was designed once, against one scale, and every other brand
9
- * was hoping. The two font *stacks* are the only part a theme can override,
10
- * and only through {@link ThemeTypographyDeviation}, because impersonating a
11
- * design language means impersonating its typeface.
12
- *
13
- * @public
14
- */
3
+ /** The shared type system — font stacks, scale, weights, line-heights, tracking — with only stacks overridable via {@link ThemeTypographyDeviation}. @public */
15
4
  export declare const typography: ThemeTypography;
16
- /**
17
- * The spacing scale — a 4px base with the usual gaps (no `7`, no `9`) so the
18
- * steps stay memorable rather than exhaustive. Structural: gap and padding are
19
- * rhythm, and rhythm is a property of the design system, not of the brand
20
- * painted on top of it.
21
- *
22
- * @public
23
- */
5
+ /** The spacing scale — a 4px base, structural rather than per-brand. @public */
24
6
  export declare const space: ThemeSpace;
25
- /**
26
- * The corner-radius scale. Shared for the same reason {@link space} is: a
27
- * component's silhouette is part of the system's shape language, and a brand
28
- * that rounds its corners differently is a different component library
29
- * wearing the same class names.
30
- *
31
- * @public
32
- */
7
+ /** The corner-radius scale, structural like {@link space} rather than per-brand. @public */
33
8
  export declare const radii: ThemeRadii;
34
- /**
35
- * The elevation scale — geometry only. Every value defers its color to
36
- * `var(--skdx-shadow-color)` and scales its alpha by
37
- * `var(--skdx-shadow-strength)`, both of which a theme supplies (see
38
- * {@link ThemeShadowColor}).
39
- *
40
- * This split is the whole reason shadows can be shared at all. A shadow is one
41
- * CSS string that welds geometry to a color, so before this every theme
42
- * restated `0 4px 6px -1px` purely to be able to change `rgb(…)` at the end of
43
- * it — 38 copies of the same three offsets, and no way to tell a deliberate
44
- * elevation change from a color change.
45
- *
46
- * The base alphas below are the original `skanda-light` values, so a theme
47
- * with `strength: '1'` renders exactly what it did before the split.
48
- * Substitution is lazy: these live at `:root`, but `var(--skdx-shadow-color)`
49
- * resolves against the element the shadow is finally *used* on, so the active
50
- * `[data-skdx-theme]` block wins. `calc()` is legal in the alpha slot, and an
51
- * alpha above 1 clamps rather than erroring — which is what keeps a
52
- * high-strength dark theme from being a footgun.
53
- *
54
- * @public
55
- */
9
+ /** The elevation scale (geometry only); color and alpha come from theme-supplied `--skdx-shadow-color`/`-strength` (see {@link ThemeShadowColor}). @public */
56
10
  export declare const shadows: ThemeShadows;
57
- /**
58
- * The shared animation timing — re-exported from {@link defaultMotion}, which
59
- * remains the single source so that `themeToCssVars` can keep merging it under
60
- * a theme's {@link Theme.motion} without importing this module.
61
- *
62
- * See {@link ThemeMotion} for why motion is theme-invariant.
63
- *
64
- * @public
65
- */
11
+ /** The shared animation timing, re-exported from {@link defaultMotion} and invariant per {@link ThemeMotion}. @public */
66
12
  export declare const motion: Required<ThemeMotion>;
67
13
  /**
68
- * A structural stacking-order scale for overlay-class UI (dropdowns, sticky
69
- * headers, dialog/popover backdrops, floating content, toasts). Unlike the
70
- * rest of the token system, z-index isn't a per-brand visual choice — every
71
- * theme should stack the same way — so it's exported once here rather than
72
- * duplicated into all 38 {@link Theme} objects. Consumers building an app
73
- * with multiple concurrent overlay types (e.g. a `Select` opened from inside
74
- * a `Dialog`, with a `Toast` on top of both) should coordinate their own
75
- * z-indices against this scale instead of picking ad hoc numbers per
76
- * component.
14
+ * Structural stacking-order scale for overlay-class UI (dropdowns, headers, dialogs, toasts), shared by every theme.
77
15
  *
78
16
  * @example
79
17
  * ```css
@@ -88,27 +26,19 @@ export declare const zIndex: {
88
26
  readonly base: 0;
89
27
  readonly dropdown: 10;
90
28
  readonly sticky: 20;
91
- /** The scrim behind a modal surface. */
29
+ /** Scrim behind modal. */
92
30
  readonly overlay: 30;
93
- /** The modal surface itself — above its own scrim, below any popover opened from inside it. */
31
+ /** Modal surface; above scrim, below popovers opened from inside. */
94
32
  readonly modal: 35;
95
33
  readonly popover: 40;
96
34
  readonly toast: 50;
97
- /**
98
- * Escape hatch for the one thing that must sit above everything, e.g. a
99
- * debug overlay or an "app is offline" banner. Deliberately far above
100
- * `toast` so app code never has to guess a bigger number.
101
- */
35
+ /** Escape hatch for the one thing that must sit above everything, e.g. a debug overlay. */
102
36
  readonly max: 9999;
103
37
  };
104
38
  /** The shape of the {@link zIndex} scale — a map of named stacking layers (`sticky`, `overlay`, `popover`, `toast`, …) to their numeric `z-index`. @public */
105
39
  export type ZIndexScale = typeof zIndex;
106
40
  /**
107
- * Structural focus-ring geometry (width/offset) — the *color* half of the
108
- * focus-ring contract is themed per brand ({@link SemanticColors.focusRing}),
109
- * but the ring's thickness and offset are a layout constant every theme
110
- * should share, so they live here rather than being repeated as identical
111
- * values across all 38 bundled themes.
41
+ * Structural focus-ring geometry (width/offset); color is themed separately via {@link SemanticColors.focusRing}.
112
42
  *
113
43
  * @example
114
44
  * ```css
@@ -123,31 +53,13 @@ export type ZIndexScale = typeof zIndex;
123
53
  export declare const focusRing: {
124
54
  readonly width: "2px";
125
55
  readonly offset: "2px";
126
- /**
127
- * The offset a *clipping* container hands down to its children.
128
- *
129
- * An outline is painted outward from the border edge and is clipped by an
130
- * ancestor's `overflow` exactly like any other overflowing paint — which
131
- * sliced the ring off inside every control group that rounds its corners by
132
- * clipping. Because `outline-offset` is read from a custom property, such a
133
- * container sets this on itself and every descendant ring moves *inside* the
134
- * border box, where nothing can reach it. One declaration per clipping
135
- * container, no per-part focus rules.
136
- *
137
- * Negative by exactly the ring width, which lands it flush against the
138
- * inside of the edge rather than floating in from it.
139
- */
56
+ /** Offset for clipping containers: moves the ring inside the border-box so overflow doesn't clip it. */
140
57
  readonly offsetInset: "calc(-1 * var(--skdx-focus-ring-width))";
141
58
  };
142
59
  /** The shape of the {@link focusRing} geometry — the structural `width`/`offset` of the focus ring (its color is themed separately). @public */
143
60
  export type FocusRingScale = typeof focusRing;
144
61
  /**
145
- * Border thicknesses. Structural for the same reason {@link focusRing}'s
146
- * geometry is: a brand changes border *color* (see
147
- * {@link SemanticColors.border}), not how many pixels thick a hairline is.
148
- * Three steps only — a hairline, an emphasis weight (focus/selected/invalid
149
- * outlines drawn without the focus ring), and a heavy weight for deliberate
150
- * structural rules. There is no `0`: that's `border: none`, not a token.
62
+ * Border thicknesses, structural like {@link focusRing}: brand changes border color via {@link SemanticColors.border}, not width; no `0` step exists.
151
63
  *
152
64
  * @example
153
65
  * ```css
@@ -164,38 +76,17 @@ export declare const borderWidth: {
164
76
  };
165
77
  /** The shape of the {@link borderWidth} scale — `thin`/`thick`/`thicker` border thicknesses. @public */
166
78
  export type BorderWidthScale = typeof borderWidth;
167
- /**
168
- * The shared control geometry — heights, paddings, icon boxes, row heights and
169
- * overlay insets. See {@link ThemeControls} for why this is structural rather
170
- * than per-brand, and for the retuning escape hatch.
171
- *
172
- * The ladder is an even 6px step (30/36/42) and every rung sits inside the
173
- * range the two reference libraries surveyed occupy. Several values are
174
- * `var()` references rather than lengths on purpose: a control's inline
175
- * padding *is* a step of {@link space}, and restating `0.75rem` here would let
176
- * the two drift. The exceptions are the four numbers that are deliberately off
177
- * a scale — `padding.sm` (10px), `height.compact` (32px), `item.gap` (2px) and
178
- * `target.min` (24px) — each documented where it is declared.
179
- *
180
- * @public
181
- */
79
+ /** The shared control geometry (heights, paddings, icon boxes, insets); see {@link ThemeControls} for the retuning escape hatch, and values reference {@link space} steps where they align. @public */
182
80
  export declare const controls: ThemeControls;
183
81
  /**
184
- * What a coarse pointer overrides. Emitted by {@link foundationToCss} as a
185
- * `@media (pointer: coarse)` block; see {@link ThemeControlsCoarse} for why
82
+ * What a coarse pointer overrides, emitted as a `@media (pointer: coarse)`
83
+ * block by {@link foundationToCss}; see {@link ThemeControlsCoarse} for why
186
84
  * only hit sizes are listed.
187
- *
188
85
  * @public
189
86
  */
190
87
  export declare const controlsCoarse: ThemeControlsCoarse;
191
88
  /**
192
- * The two opacities the system actually has an opinion about. Deliberately
193
- * *not* a 0–100 ramp: an arbitrary ramp invents decisions nobody made, while
194
- * these two are real, repeated cross-component choices — how faded a disabled
195
- * control is, and how much a modal scrim dims the page behind it.
196
- *
197
- * Scrim *color* is themed ({@link SemanticColors.overlay}); this is the
198
- * structural strength of the dim, so every brand's scrim occludes equally.
89
+ * The two intentional opacities — disabled fade and modal scrim dim — not an arbitrary ramp; scrim color is themed via {@link SemanticColors.overlay}.
199
90
  *
200
91
  * @example
201
92
  * ```css
@@ -212,16 +103,7 @@ export declare const opacity: {
212
103
  /** The shape of the {@link opacity} scale — the `disabled` and `scrim` opacities. @public */
213
104
  export type OpacityScale = typeof opacity;
214
105
  /**
215
- * Viewport widths, in pixels, as **TypeScript exports only** — deliberately
216
- * not emitted as CSS custom properties by {@link foundationToCss}. A custom
217
- * property cannot be used in a `@media` query's condition (`@media (min-width:
218
- * var(--x))` is invalid CSS), so a `--skdx-breakpoint-*` variable would be a
219
- * token that looks usable and isn't. Consume these from JS/TS, or from a
220
- * build step that inlines the number into your own media queries.
221
- *
222
- * The components themselves are headless and ship no responsive behavior;
223
- * this exists so consumers building a styled layer on top don't have to
224
- * invent their own set.
106
+ * Viewport widths in pixels, as TypeScript exports only — `@media (min-width: var(--x))` is invalid CSS.
225
107
  *
226
108
  * @example
227
109
  * ```ts
@@ -241,52 +123,17 @@ export declare const breakpoints: {
241
123
  /** The shape of the {@link breakpoints} scale — named viewport widths in pixels. @public */
242
124
  export type BreakpointScale = typeof breakpoints;
243
125
  /**
244
- * Flattens every shared token into a map of CSS custom property names to
245
- * values — the foundation's counterpart to `themeToCssVars`. Together the two
246
- * maps are the complete `--skdx-*` surface, and they never overlap.
247
- *
248
- * {@link breakpoints} is not included — see its docs for why a breakpoint
249
- * can't be a CSS custom property.
126
+ * Flattens every shared token into `--skdx-*` custom property values, the foundation's counterpart to `themeToCssVars`; excludes {@link breakpoints}, which can't be a CSS custom property.
250
127
  *
251
128
  * @returns A plain object keyed by CSS custom property name (e.g. `'--skdx-space-4'`), unprefixed by any selector.
252
- *
253
- * @public
254
- */
255
- export declare function foundationToCssVars(): Record<string, string>;
256
- /**
257
- * The control metrics a coarse pointer overrides, as a var map — the
258
- * `@media (pointer: coarse)` counterpart to {@link foundationToCssVars}.
259
- *
260
- * Exported because `@skdx/skins` renders its own no-tokens fallback copy of
261
- * both blocks from these functions rather than restating the values, which is
262
- * the only thing that keeps the two in step.
263
- *
264
129
  * @public
265
130
  */
266
- export declare function coarsePointerToCssVars(): Record<string, string>;
131
+ export declare function foundationToCssVars(): Record<CssVar, string>;
132
+ /** The control metrics a coarse pointer overrides, as a var map — the `@media (pointer: coarse)` counterpart to {@link foundationToCssVars}. @public */
133
+ export declare function coarsePointerToCssVars(): Record<CssVar, string>;
267
134
  /**
268
- * Renders every shared token as a `:root`-scoped `--skdx-*` rule block — the
269
- * theme-invariant counterpart to {@link themeToCss}. **Inject this exactly
270
- * once**, then inject `themeToCss(theme)` per theme alongside it. Without it
271
- * the type scale, spacing, radii, shadow geometry and motion are simply
272
- * absent, because no theme declares them any more.
273
- *
274
- * Followed by a `@media (prefers-reduced-motion: reduce)` block that
275
- * re-declares every `--skdx-motion-duration-*` and `--skdx-motion-stagger-*` as
276
- * `0ms`. Components are headless and animate nothing themselves, so honoring
277
- * the preference has to happen where the durations are *defined* rather than
278
- * where they're used — this way a consumer who writes `transition-duration:
279
- * var(--skdx-motion-duration-normal)` gets WCAG 2.3.3 behavior for free instead
280
- * of having to remember the media query at every call site. The easing curve
281
- * is left alone: it's a shape, not a duration, and is inert at `0ms`. A theme
282
- * that retunes motion via `ThemeMotionDeviation` emits its own copy of this
283
- * block, so the guarantee survives the escape hatch.
284
- *
285
- * Then a `@media (pointer: coarse)` block re-declaring the hit sizes from
286
- * {@link controlsCoarse}, for the same reason: the preference has to be honored
287
- * where the metric is *defined*, so a consumer who writes
288
- * `block-size: var(--skdx-control-height-md)` gets a touch-sized control without
289
- * having to remember the query.
135
+ * Renders every shared token as a `:root`-scoped `--skdx-*` rule block, plus `prefers-reduced-motion` and `pointer: coarse` override blocks.
136
+ * Inject this exactly once, then {@link themeToCss} per theme.
290
137
  *
291
138
  * @example
292
139
  * ```ts
@@ -1,79 +1,17 @@
1
+ import { type CssVar } from './cssVars.js';
1
2
  import { type ThemeControls, type ThemeControlsCoarse, type ThemeMotion, type ThemeRadii, type ThemeShadows, type ThemeSpace, type ThemeTypography } from './theme.js';
2
- /**
3
- * The type system: one font stack, one scale, one set of weights,
4
- * line-heights and tracking steps, shared by every theme.
5
- *
6
- * A theme picks colors. It does not get to resize the type scale, because a
7
- * layout that reflows when you switch brand is a layout that was never
8
- * designed — it was designed once, against one scale, and every other brand
9
- * was hoping. The two font *stacks* are the only part a theme can override,
10
- * and only through {@link ThemeTypographyDeviation}, because impersonating a
11
- * design language means impersonating its typeface.
12
- *
13
- * @public
14
- */
3
+ /** The shared type system — font stacks, scale, weights, line-heights, tracking — with only stacks overridable via {@link ThemeTypographyDeviation}. @public */
15
4
  export declare const typography: ThemeTypography;
16
- /**
17
- * The spacing scale — a 4px base with the usual gaps (no `7`, no `9`) so the
18
- * steps stay memorable rather than exhaustive. Structural: gap and padding are
19
- * rhythm, and rhythm is a property of the design system, not of the brand
20
- * painted on top of it.
21
- *
22
- * @public
23
- */
5
+ /** The spacing scale — a 4px base, structural rather than per-brand. @public */
24
6
  export declare const space: ThemeSpace;
25
- /**
26
- * The corner-radius scale. Shared for the same reason {@link space} is: a
27
- * component's silhouette is part of the system's shape language, and a brand
28
- * that rounds its corners differently is a different component library
29
- * wearing the same class names.
30
- *
31
- * @public
32
- */
7
+ /** The corner-radius scale, structural like {@link space} rather than per-brand. @public */
33
8
  export declare const radii: ThemeRadii;
34
- /**
35
- * The elevation scale — geometry only. Every value defers its color to
36
- * `var(--skdx-shadow-color)` and scales its alpha by
37
- * `var(--skdx-shadow-strength)`, both of which a theme supplies (see
38
- * {@link ThemeShadowColor}).
39
- *
40
- * This split is the whole reason shadows can be shared at all. A shadow is one
41
- * CSS string that welds geometry to a color, so before this every theme
42
- * restated `0 4px 6px -1px` purely to be able to change `rgb(…)` at the end of
43
- * it — 38 copies of the same three offsets, and no way to tell a deliberate
44
- * elevation change from a color change.
45
- *
46
- * The base alphas below are the original `skanda-light` values, so a theme
47
- * with `strength: '1'` renders exactly what it did before the split.
48
- * Substitution is lazy: these live at `:root`, but `var(--skdx-shadow-color)`
49
- * resolves against the element the shadow is finally *used* on, so the active
50
- * `[data-skdx-theme]` block wins. `calc()` is legal in the alpha slot, and an
51
- * alpha above 1 clamps rather than erroring — which is what keeps a
52
- * high-strength dark theme from being a footgun.
53
- *
54
- * @public
55
- */
9
+ /** The elevation scale (geometry only); color and alpha come from theme-supplied `--skdx-shadow-color`/`-strength` (see {@link ThemeShadowColor}). @public */
56
10
  export declare const shadows: ThemeShadows;
57
- /**
58
- * The shared animation timing — re-exported from {@link defaultMotion}, which
59
- * remains the single source so that `themeToCssVars` can keep merging it under
60
- * a theme's {@link Theme.motion} without importing this module.
61
- *
62
- * See {@link ThemeMotion} for why motion is theme-invariant.
63
- *
64
- * @public
65
- */
11
+ /** The shared animation timing, re-exported from {@link defaultMotion} and invariant per {@link ThemeMotion}. @public */
66
12
  export declare const motion: Required<ThemeMotion>;
67
13
  /**
68
- * A structural stacking-order scale for overlay-class UI (dropdowns, sticky
69
- * headers, dialog/popover backdrops, floating content, toasts). Unlike the
70
- * rest of the token system, z-index isn't a per-brand visual choice — every
71
- * theme should stack the same way — so it's exported once here rather than
72
- * duplicated into all 38 {@link Theme} objects. Consumers building an app
73
- * with multiple concurrent overlay types (e.g. a `Select` opened from inside
74
- * a `Dialog`, with a `Toast` on top of both) should coordinate their own
75
- * z-indices against this scale instead of picking ad hoc numbers per
76
- * component.
14
+ * Structural stacking-order scale for overlay-class UI (dropdowns, headers, dialogs, toasts), shared by every theme.
77
15
  *
78
16
  * @example
79
17
  * ```css
@@ -88,27 +26,19 @@ export declare const zIndex: {
88
26
  readonly base: 0;
89
27
  readonly dropdown: 10;
90
28
  readonly sticky: 20;
91
- /** The scrim behind a modal surface. */
29
+ /** Scrim behind modal. */
92
30
  readonly overlay: 30;
93
- /** The modal surface itself — above its own scrim, below any popover opened from inside it. */
31
+ /** Modal surface; above scrim, below popovers opened from inside. */
94
32
  readonly modal: 35;
95
33
  readonly popover: 40;
96
34
  readonly toast: 50;
97
- /**
98
- * Escape hatch for the one thing that must sit above everything, e.g. a
99
- * debug overlay or an "app is offline" banner. Deliberately far above
100
- * `toast` so app code never has to guess a bigger number.
101
- */
35
+ /** Escape hatch for the one thing that must sit above everything, e.g. a debug overlay. */
102
36
  readonly max: 9999;
103
37
  };
104
38
  /** The shape of the {@link zIndex} scale — a map of named stacking layers (`sticky`, `overlay`, `popover`, `toast`, …) to their numeric `z-index`. @public */
105
39
  export type ZIndexScale = typeof zIndex;
106
40
  /**
107
- * Structural focus-ring geometry (width/offset) — the *color* half of the
108
- * focus-ring contract is themed per brand ({@link SemanticColors.focusRing}),
109
- * but the ring's thickness and offset are a layout constant every theme
110
- * should share, so they live here rather than being repeated as identical
111
- * values across all 38 bundled themes.
41
+ * Structural focus-ring geometry (width/offset); color is themed separately via {@link SemanticColors.focusRing}.
112
42
  *
113
43
  * @example
114
44
  * ```css
@@ -123,31 +53,13 @@ export type ZIndexScale = typeof zIndex;
123
53
  export declare const focusRing: {
124
54
  readonly width: "2px";
125
55
  readonly offset: "2px";
126
- /**
127
- * The offset a *clipping* container hands down to its children.
128
- *
129
- * An outline is painted outward from the border edge and is clipped by an
130
- * ancestor's `overflow` exactly like any other overflowing paint — which
131
- * sliced the ring off inside every control group that rounds its corners by
132
- * clipping. Because `outline-offset` is read from a custom property, such a
133
- * container sets this on itself and every descendant ring moves *inside* the
134
- * border box, where nothing can reach it. One declaration per clipping
135
- * container, no per-part focus rules.
136
- *
137
- * Negative by exactly the ring width, which lands it flush against the
138
- * inside of the edge rather than floating in from it.
139
- */
56
+ /** Offset for clipping containers: moves the ring inside the border-box so overflow doesn't clip it. */
140
57
  readonly offsetInset: "calc(-1 * var(--skdx-focus-ring-width))";
141
58
  };
142
59
  /** The shape of the {@link focusRing} geometry — the structural `width`/`offset` of the focus ring (its color is themed separately). @public */
143
60
  export type FocusRingScale = typeof focusRing;
144
61
  /**
145
- * Border thicknesses. Structural for the same reason {@link focusRing}'s
146
- * geometry is: a brand changes border *color* (see
147
- * {@link SemanticColors.border}), not how many pixels thick a hairline is.
148
- * Three steps only — a hairline, an emphasis weight (focus/selected/invalid
149
- * outlines drawn without the focus ring), and a heavy weight for deliberate
150
- * structural rules. There is no `0`: that's `border: none`, not a token.
62
+ * Border thicknesses, structural like {@link focusRing}: brand changes border color via {@link SemanticColors.border}, not width; no `0` step exists.
151
63
  *
152
64
  * @example
153
65
  * ```css
@@ -164,38 +76,17 @@ export declare const borderWidth: {
164
76
  };
165
77
  /** The shape of the {@link borderWidth} scale — `thin`/`thick`/`thicker` border thicknesses. @public */
166
78
  export type BorderWidthScale = typeof borderWidth;
167
- /**
168
- * The shared control geometry — heights, paddings, icon boxes, row heights and
169
- * overlay insets. See {@link ThemeControls} for why this is structural rather
170
- * than per-brand, and for the retuning escape hatch.
171
- *
172
- * The ladder is an even 6px step (30/36/42) and every rung sits inside the
173
- * range the two reference libraries surveyed occupy. Several values are
174
- * `var()` references rather than lengths on purpose: a control's inline
175
- * padding *is* a step of {@link space}, and restating `0.75rem` here would let
176
- * the two drift. The exceptions are the four numbers that are deliberately off
177
- * a scale — `padding.sm` (10px), `height.compact` (32px), `item.gap` (2px) and
178
- * `target.min` (24px) — each documented where it is declared.
179
- *
180
- * @public
181
- */
79
+ /** The shared control geometry (heights, paddings, icon boxes, insets); see {@link ThemeControls} for the retuning escape hatch, and values reference {@link space} steps where they align. @public */
182
80
  export declare const controls: ThemeControls;
183
81
  /**
184
- * What a coarse pointer overrides. Emitted by {@link foundationToCss} as a
185
- * `@media (pointer: coarse)` block; see {@link ThemeControlsCoarse} for why
82
+ * What a coarse pointer overrides, emitted as a `@media (pointer: coarse)`
83
+ * block by {@link foundationToCss}; see {@link ThemeControlsCoarse} for why
186
84
  * only hit sizes are listed.
187
- *
188
85
  * @public
189
86
  */
190
87
  export declare const controlsCoarse: ThemeControlsCoarse;
191
88
  /**
192
- * The two opacities the system actually has an opinion about. Deliberately
193
- * *not* a 0–100 ramp: an arbitrary ramp invents decisions nobody made, while
194
- * these two are real, repeated cross-component choices — how faded a disabled
195
- * control is, and how much a modal scrim dims the page behind it.
196
- *
197
- * Scrim *color* is themed ({@link SemanticColors.overlay}); this is the
198
- * structural strength of the dim, so every brand's scrim occludes equally.
89
+ * The two intentional opacities — disabled fade and modal scrim dim — not an arbitrary ramp; scrim color is themed via {@link SemanticColors.overlay}.
199
90
  *
200
91
  * @example
201
92
  * ```css
@@ -212,16 +103,7 @@ export declare const opacity: {
212
103
  /** The shape of the {@link opacity} scale — the `disabled` and `scrim` opacities. @public */
213
104
  export type OpacityScale = typeof opacity;
214
105
  /**
215
- * Viewport widths, in pixels, as **TypeScript exports only** — deliberately
216
- * not emitted as CSS custom properties by {@link foundationToCss}. A custom
217
- * property cannot be used in a `@media` query's condition (`@media (min-width:
218
- * var(--x))` is invalid CSS), so a `--skdx-breakpoint-*` variable would be a
219
- * token that looks usable and isn't. Consume these from JS/TS, or from a
220
- * build step that inlines the number into your own media queries.
221
- *
222
- * The components themselves are headless and ship no responsive behavior;
223
- * this exists so consumers building a styled layer on top don't have to
224
- * invent their own set.
106
+ * Viewport widths in pixels, as TypeScript exports only — `@media (min-width: var(--x))` is invalid CSS.
225
107
  *
226
108
  * @example
227
109
  * ```ts
@@ -241,52 +123,17 @@ export declare const breakpoints: {
241
123
  /** The shape of the {@link breakpoints} scale — named viewport widths in pixels. @public */
242
124
  export type BreakpointScale = typeof breakpoints;
243
125
  /**
244
- * Flattens every shared token into a map of CSS custom property names to
245
- * values — the foundation's counterpart to `themeToCssVars`. Together the two
246
- * maps are the complete `--skdx-*` surface, and they never overlap.
247
- *
248
- * {@link breakpoints} is not included — see its docs for why a breakpoint
249
- * can't be a CSS custom property.
126
+ * Flattens every shared token into `--skdx-*` custom property values, the foundation's counterpart to `themeToCssVars`; excludes {@link breakpoints}, which can't be a CSS custom property.
250
127
  *
251
128
  * @returns A plain object keyed by CSS custom property name (e.g. `'--skdx-space-4'`), unprefixed by any selector.
252
- *
253
- * @public
254
- */
255
- export declare function foundationToCssVars(): Record<string, string>;
256
- /**
257
- * The control metrics a coarse pointer overrides, as a var map — the
258
- * `@media (pointer: coarse)` counterpart to {@link foundationToCssVars}.
259
- *
260
- * Exported because `@skdx/skins` renders its own no-tokens fallback copy of
261
- * both blocks from these functions rather than restating the values, which is
262
- * the only thing that keeps the two in step.
263
- *
264
129
  * @public
265
130
  */
266
- export declare function coarsePointerToCssVars(): Record<string, string>;
131
+ export declare function foundationToCssVars(): Record<CssVar, string>;
132
+ /** The control metrics a coarse pointer overrides, as a var map — the `@media (pointer: coarse)` counterpart to {@link foundationToCssVars}. @public */
133
+ export declare function coarsePointerToCssVars(): Record<CssVar, string>;
267
134
  /**
268
- * Renders every shared token as a `:root`-scoped `--skdx-*` rule block — the
269
- * theme-invariant counterpart to {@link themeToCss}. **Inject this exactly
270
- * once**, then inject `themeToCss(theme)` per theme alongside it. Without it
271
- * the type scale, spacing, radii, shadow geometry and motion are simply
272
- * absent, because no theme declares them any more.
273
- *
274
- * Followed by a `@media (prefers-reduced-motion: reduce)` block that
275
- * re-declares every `--skdx-motion-duration-*` and `--skdx-motion-stagger-*` as
276
- * `0ms`. Components are headless and animate nothing themselves, so honoring
277
- * the preference has to happen where the durations are *defined* rather than
278
- * where they're used — this way a consumer who writes `transition-duration:
279
- * var(--skdx-motion-duration-normal)` gets WCAG 2.3.3 behavior for free instead
280
- * of having to remember the media query at every call site. The easing curve
281
- * is left alone: it's a shape, not a duration, and is inert at `0ms`. A theme
282
- * that retunes motion via `ThemeMotionDeviation` emits its own copy of this
283
- * block, so the guarantee survives the escape hatch.
284
- *
285
- * Then a `@media (pointer: coarse)` block re-declaring the hit sizes from
286
- * {@link controlsCoarse}, for the same reason: the preference has to be honored
287
- * where the metric is *defined*, so a consumer who writes
288
- * `block-size: var(--skdx-control-height-md)` gets a touch-sized control without
289
- * having to remember the query.
135
+ * Renders every shared token as a `:root`-scoped `--skdx-*` rule block, plus `prefers-reduced-motion` and `pointer: coarse` override blocks.
136
+ * Inject this exactly once, then {@link themeToCss} per theme.
290
137
  *
291
138
  * @example
292
139
  * ```ts
@@ -1,4 +1,4 @@
1
- import{reducedMotionVarNames as m,sectionsToCssVars as a,varsToDeclarations as s}from"./cssVars.js";import{defaultMotion as p}from"./theme.js";var e="skdx",c={fontFamily:"-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif",fontFamilyMono:"'SF Mono', SFMono-Regular, ui-monospace, Menlo, Consolas, monospace",fontSize:{xs:"0.75rem",sm:"0.875rem",md:"1rem",lg:"1.125rem",xl:"1.25rem","2xl":"1.5rem","3xl":"1.875rem"},fontWeight:{regular:400,medium:500,semibold:600,bold:700},lineHeight:{tight:"1.25",snug:"1.43",normal:"1.5",relaxed:"1.75"},letterSpacing:{tight:"-0.015em",normal:"0em",wide:"0.025em",wider:"0.05em"}},d={1:"0.25rem",2:"0.5rem",3:"0.75rem",4:"1rem",5:"1.25rem",6:"1.5rem",8:"2rem",10:"2.5rem",12:"3rem",16:"4rem"},l={sm:"0.25rem",inner:"0.375rem",md:"0.5rem",lg:"0.75rem",xl:"1rem",full:"9999px"},g={sm:`0 1px 2px 0 ${n(.05)}`,md:`0 4px 6px -1px ${n(.1)}, 0 2px 4px -2px ${n(.1)}`,lg:`0 10px 15px -3px ${n(.1)}, 0 4px 6px -4px ${n(.1)}`,overlay:`0 25px 50px -12px ${n(.25)}`};function n(r){return`rgb(var(--${e}-shadow-color) / calc(${r} * var(--${e}-shadow-strength)))`}var x=p,u={base:0,dropdown:10,sticky:20,overlay:30,modal:35,popover:40,toast:50,max:9999},h={width:"2px",offset:"2px",offsetInset:"calc(-1 * var(--skdx-focus-ring-width))"},y={thin:"1px",thick:"2px",thicker:"4px"},f={control:{height:{sm:"1.875rem",md:"2.25rem",lg:"2.625rem",compact:"2rem"},padding:{sm:"0.625rem",md:`var(--${e}-space-3)`,lg:`var(--${e}-space-4)`},gap:{sm:`var(--${e}-space-1)`,md:`var(--${e}-space-2)`,lg:`var(--${e}-space-2)`}},iconSize:{sm:"1rem",md:"1.25rem",lg:"1.5rem"},indicatorSize:{sm:"1rem",md:"1.25rem",lg:"1.5rem"},item:{height:{sm:"1.75rem",md:"2.25rem",lg:"2.5rem"},gap:"2px"},overlay:{padding:`var(--${e}-space-1)`,radius:`var(--${e}-radius-lg)`,minWidth:"7.5rem"},field:{gap:`var(--${e}-space-1)`,labelGap:`var(--${e}-space-1)`},target:{min:"24px"}},w={control:{height:{sm:"2.25rem",md:"2.75rem",lg:"3rem",compact:"2.75rem"}},item:{height:{sm:"2.25rem",md:"2.75rem",lg:"3rem"}},target:{min:"44px"}},k={disabled:"0.5",scrim:"0.6"},v={sm:640,md:768,lg:1024,xl:1280};function T(){return a([["font",c],["space",d],["radius",l],["shadow",g],["motion",x],["z-index",u],["focus-ring",h],["border-width",y],["opacity",k],...i(f)])}function i(r){let o=t=>r[t];return[["control",o("control")],["icon-size",o("iconSize")],["indicator-size",o("indicatorSize")],["item",o("item")],["overlay",o("overlay")],["field",o("field")],["target",o("target")]]}function R(){return a(i(w))}function C(){let r=T(),o=m(r).map(t=>` ${t}: 0ms;`);return`:root {
1
+ import{PREFIX as e,reducedMotionVarNames as i,sectionsToCssVars as a,varsToDeclarations as s}from"./cssVars.js";import{defaultMotion as p}from"./theme.js";var c={fontFamily:"-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif",fontFamilyMono:"'SF Mono', SFMono-Regular, ui-monospace, Menlo, Consolas, monospace",fontSize:{xs:"0.75rem",sm:"0.875rem",md:"1rem",lg:"1.125rem",xl:"1.25rem","2xl":"1.5rem","3xl":"1.875rem"},fontWeight:{regular:400,medium:500,semibold:600,bold:700},lineHeight:{tight:"1.25",snug:"1.43",normal:"1.5",relaxed:"1.75"},letterSpacing:{tight:"-0.015em",normal:"0em",wide:"0.025em",wider:"0.05em"}},d={1:"0.25rem",2:"0.5rem",3:"0.75rem",4:"1rem",5:"1.25rem",6:"1.5rem",8:"2rem",10:"2.5rem",12:"3rem",16:"4rem"},l={sm:"0.25rem",inner:"0.375rem",md:"0.5rem",lg:"0.75rem",xl:"1rem",full:"9999px"},x={sm:`0 1px 2px 0 ${t(.05)}`,md:`0 4px 6px -1px ${t(.1)}, 0 2px 4px -2px ${t(.1)}`,lg:`0 10px 15px -3px ${t(.1)}, 0 4px 6px -4px ${t(.1)}`,overlay:`0 25px 50px -12px ${t(.25)}`};function t(r){return`rgb(var(--${e}-shadow-color) / calc(${r} * var(--${e}-shadow-strength)))`}var g=p,h={base:0,dropdown:10,sticky:20,overlay:30,modal:35,popover:40,toast:50,max:9999},y={width:"2px",offset:"2px",offsetInset:"calc(-1 * var(--skdx-focus-ring-width))"},f={thin:"1px",thick:"2px",thicker:"4px"},u={control:{height:{sm:"1.875rem",md:"2.25rem",lg:"2.625rem",compact:"2rem"},padding:{sm:"0.625rem",md:`var(--${e}-space-3)`,lg:`var(--${e}-space-4)`},gap:{sm:`var(--${e}-space-1)`,md:`var(--${e}-space-2)`,lg:`var(--${e}-space-2)`}},iconSize:{sm:"1rem",md:"1.25rem",lg:"1.5rem"},indicatorSize:{sm:"1rem",md:"1.25rem",lg:"1.5rem"},item:{height:{sm:"1.75rem",md:"2.25rem",lg:"2.5rem"},gap:"2px"},overlay:{padding:`var(--${e}-space-1)`,radius:`var(--${e}-radius-lg)`,minWidth:"7.5rem"},field:{gap:`var(--${e}-space-1)`,labelGap:`var(--${e}-space-1)`},target:{min:"24px"}},T={control:{height:{sm:"2.25rem",md:"2.75rem",lg:"3rem",compact:"2.75rem"}},item:{height:{sm:"2.25rem",md:"2.75rem",lg:"3rem"}},target:{min:"44px"}},C={disabled:"0.5",scrim:"0.6"},w={sm:640,md:768,lg:1024,xl:1280};function S(){return a([["font",c],["space",d],["radius",l],["shadow",x],["motion",g],["z-index",h],["focus-ring",y],["border-width",f],["opacity",C],...m(u)])}function m(r){let o=n=>r[n];return[["control",o("control")],["icon-size",o("iconSize")],["indicator-size",o("indicatorSize")],["item",o("item")],["overlay",o("overlay")],["field",o("field")],["target",o("target")]]}function $(){return a(m(T))}function R(){let r=S(),o=i(r).map(n=>` ${n}: 0ms;`);return`:root {
2
2
  ${s(r)}
3
3
  }
4
4
  @media (prefers-reduced-motion: reduce) {
@@ -9,7 +9,7 @@ ${o.join(`
9
9
  }
10
10
  @media (pointer: coarse) {
11
11
  :root {
12
- ${s(R()," ")}
12
+ ${s($()," ")}
13
13
  }
14
14
  }
15
- `}export{y as borderWidth,v as breakpoints,R as coarsePointerToCssVars,f as controls,w as controlsCoarse,h as focusRing,C as foundationToCss,T as foundationToCssVars,x as motion,k as opacity,l as radii,g as shadows,d as space,c as typography,u as zIndex};
15
+ `}export{f as borderWidth,w as breakpoints,$ as coarsePointerToCssVars,u as controls,T as controlsCoarse,y as focusRing,R as foundationToCss,S as foundationToCssVars,g as motion,C as opacity,l as radii,x as shadows,d as space,c as typography,h as zIndex};
@@ -1 +1 @@
1
- "use strict";var d=Object.defineProperty;var u=Object.getOwnPropertyDescriptor;var S=Object.getOwnPropertyNames;var b=Object.prototype.hasOwnProperty;var O=(t,e)=>{for(var n in e)d(t,n,{get:e[n],enumerable:!0})},k=(t,e,n,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of S(e))!b.call(t,r)&&r!==n&&d(t,r,{get:()=>e[r],enumerable:!(o=u(e,r))||o.enumerable});return t};var E=t=>k(d({},"__esModule",{value:!0}),t);var M={};O(M,{BRAND_STORAGE_KEY:()=>g,MODE_STORAGE_KEY:()=>c,getThemeInitScript:()=>x,watchSystemMode:()=>v});module.exports=E(M);var a=require("../themes/brands.cjs"),f=require("./toCss.cjs"),c="skdx-mode",g="skdx-brand",y="(prefers-color-scheme: dark)";function v(t={}){let{brand:e,element:n,persist:o=!1,storageKey:r=c}=t,s=(e===void 0?void 0:(0,a.getBrand)(e))??a.defaultBrand,i=window.matchMedia(y),h=m=>{let p=m?"dark":"light";if((0,f.applyTheme)(s.themes[p],n),!!o)try{localStorage.setItem(r,p)}catch{}};h(i.matches);let l=m=>h(m.matches);return i.addEventListener("change",l),()=>i.removeEventListener("change",l)}function x(t={}){let{brandKey:e=g,modeKey:n=c,fallbackBrand:o=a.defaultBrand.name}=t,r=Object.fromEntries(a.brands.map(s=>[s.name,[s.themes.light.name,s.themes.dark.name]]));return`(function(){try{var t=${JSON.stringify(r)},f=${JSON.stringify(o)};var b=localStorage.getItem(${JSON.stringify(e)})||f;var m=localStorage.getItem(${JSON.stringify(n)});if(m!=="light"&&m!=="dark")m=matchMedia(${JSON.stringify(y)}).matches?"dark":"light";var p=t[b]||t[f];if(!p)return;var e=document.documentElement;e.setAttribute("data-skdx-theme",p[m==="dark"?1:0]);e.setAttribute("data-skdx-mode",m);}catch(e){}})();`}0&&(module.exports={BRAND_STORAGE_KEY,MODE_STORAGE_KEY,getThemeInitScript,watchSystemMode});
1
+ "use strict";var l=Object.defineProperty;var O=Object.getOwnPropertyDescriptor;var E=Object.getOwnPropertyNames;var k=Object.prototype.hasOwnProperty;var v=(t,e)=>{for(var n in e)l(t,n,{get:e[n],enumerable:!0})},x=(t,e,n,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of E(e))!k.call(t,r)&&r!==n&&l(t,r,{get:()=>e[r],enumerable:!(a=O(e,r))||a.enumerable});return t};var M=t=>x(l({},"__esModule",{value:!0}),t);var I={};v(I,{BRAND_STORAGE_KEY:()=>S,MODE_STORAGE_KEY:()=>h,getThemeInitScript:()=>K,watchSystemMode:()=>T});module.exports=M(I);var o=require("../themes/brands.cjs"),y=require("./toCss.cjs"),h="skdx-mode",S="skdx-brand",b="(prefers-color-scheme: dark)";function T(t={}){let{brand:e,element:n,persist:a=!1,storageKey:r=h}=t,i=(e===void 0?void 0:(0,o.getBrand)(e))??o.defaultBrand,d=window.matchMedia(b),g,p=m=>{let s=null;try{s=localStorage.getItem(r)}catch{}let u=s==="light"||s==="dark"?s:void 0,c=(u!==g?u:void 0)??(m?"dark":"light");if((0,y.applyTheme)(i.themes[c],n),!!a)try{localStorage.setItem(r,c),g=c}catch{}};p(d.matches);let f=m=>p(m.matches);return d.addEventListener("change",f),()=>d.removeEventListener("change",f)}function K(t={}){let{brandKey:e=S,modeKey:n=h,brand:a=o.defaultBrand.name}=t,r=Object.fromEntries(o.brands.map(i=>[i.name,[i.themes.light.name,i.themes.dark.name]]));return`(function(){try{var t=${JSON.stringify(r)},f=${JSON.stringify(a)};var b=localStorage.getItem(${JSON.stringify(e)})||f;var m=localStorage.getItem(${JSON.stringify(n)});if(m!=="light"&&m!=="dark")m=matchMedia(${JSON.stringify(b)}).matches?"dark":"light";var p=t[b]||t[f];if(!p)return;var e=document.documentElement;e.setAttribute("data-skdx-theme",p[m==="dark"?1:0]);e.setAttribute("data-skdx-mode",m);}catch(e){}})();`}0&&(module.exports={BRAND_STORAGE_KEY,MODE_STORAGE_KEY,getThemeInitScript,watchSystemMode});