@astryxdesign/core 0.4.0 → 0.4.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.
Files changed (194) hide show
  1. package/CHANGELOG.md +39 -0
  2. package/dist/AspectRatio/AspectRatio.d.ts.map +1 -1
  3. package/dist/AspectRatio/AspectRatio.js +1 -2
  4. package/dist/AspectRatio/index.d.ts.map +1 -1
  5. package/dist/AspectRatio/index.js +1 -2
  6. package/dist/Badge/Badge.d.ts.map +1 -1
  7. package/dist/Badge/Badge.js +1 -2
  8. package/dist/Badge/index.d.ts.map +1 -1
  9. package/dist/Badge/index.js +1 -2
  10. package/dist/Banner/Banner.d.ts +3 -0
  11. package/dist/Banner/Banner.d.ts.map +1 -1
  12. package/dist/Banner/Banner.js +17 -3
  13. package/dist/Blockquote/Blockquote.d.ts.map +1 -1
  14. package/dist/Blockquote/Blockquote.js +1 -2
  15. package/dist/Blockquote/index.d.ts.map +1 -1
  16. package/dist/Blockquote/index.js +1 -2
  17. package/dist/Button/Button.d.ts.map +1 -1
  18. package/dist/Button/Button.js +2 -2
  19. package/dist/Card/Card.d.ts.map +1 -1
  20. package/dist/Card/Card.js +1 -2
  21. package/dist/Card/index.d.ts.map +1 -1
  22. package/dist/Card/index.js +1 -2
  23. package/dist/Center/Center.d.ts.map +1 -1
  24. package/dist/Center/Center.js +1 -2
  25. package/dist/Center/index.d.ts.map +1 -1
  26. package/dist/Center/index.js +1 -2
  27. package/dist/Code/Code.d.ts.map +1 -1
  28. package/dist/Code/Code.js +1 -2
  29. package/dist/CommandPalette/CommandPalette.d.ts.map +1 -1
  30. package/dist/CommandPalette/CommandPalette.js +5 -0
  31. package/dist/ComplexSelector/ComplexSelector.d.ts.map +1 -1
  32. package/dist/ComplexSelector/ComplexSelector.js +7 -8
  33. package/dist/DateInput/DateInput.d.ts.map +1 -1
  34. package/dist/DateInput/DateInput.js +23 -10
  35. package/dist/DateRangeInput/DateRangeInput.d.ts.map +1 -1
  36. package/dist/DateRangeInput/DateRangeInput.js +44 -16
  37. package/dist/DateTimeInput/DateTimeInput.d.ts.map +1 -1
  38. package/dist/DateTimeInput/DateTimeInput.js +32 -13
  39. package/dist/DropdownMenu/DropdownMenuRadioGroup.d.ts +1 -1
  40. package/dist/DropdownMenu/DropdownMenuRadioGroup.d.ts.map +1 -1
  41. package/dist/DropdownMenu/DropdownMenuRadioGroup.js +10 -3
  42. package/dist/Field/PanelSearchInput.d.ts +81 -0
  43. package/dist/Field/PanelSearchInput.d.ts.map +1 -0
  44. package/dist/Field/PanelSearchInput.js +151 -0
  45. package/dist/FileInput/FileInput.d.ts.map +1 -1
  46. package/dist/FileInput/FileInput.js +21 -10
  47. package/dist/Grid/Grid.d.ts.map +1 -1
  48. package/dist/Grid/Grid.js +1 -2
  49. package/dist/Grid/index.d.ts.map +1 -1
  50. package/dist/Grid/index.js +1 -2
  51. package/dist/Icon/globalIconRegistry.d.ts +5 -4
  52. package/dist/Icon/globalIconRegistry.d.ts.map +1 -1
  53. package/dist/Icon/globalIconRegistry.js +5 -4
  54. package/dist/Indicator/index.d.ts +1 -1
  55. package/dist/Indicator/index.d.ts.map +1 -1
  56. package/dist/Indicator/types.d.ts +10 -0
  57. package/dist/Indicator/types.d.ts.map +1 -1
  58. package/dist/Lightbox/Lightbox.d.ts.map +1 -1
  59. package/dist/Lightbox/Lightbox.js +24 -50
  60. package/dist/MultiSelector/MultiSelector.d.ts +8 -1
  61. package/dist/MultiSelector/MultiSelector.d.ts.map +1 -1
  62. package/dist/MultiSelector/MultiSelector.js +134 -102
  63. package/dist/Popover/usePopover.d.ts +15 -0
  64. package/dist/Popover/usePopover.d.ts.map +1 -1
  65. package/dist/Popover/usePopover.js +14 -2
  66. package/dist/ProgressBar/ProgressBar.d.ts.map +1 -1
  67. package/dist/ProgressBar/ProgressBar.js +2 -3
  68. package/dist/Section/Section.d.ts.map +1 -1
  69. package/dist/Section/Section.js +1 -2
  70. package/dist/Section/index.d.ts.map +1 -1
  71. package/dist/Section/index.js +1 -2
  72. package/dist/Selector/Selector.d.ts +10 -0
  73. package/dist/Selector/Selector.d.ts.map +1 -1
  74. package/dist/Selector/Selector.js +135 -95
  75. package/dist/Skeleton/Skeleton.d.ts.map +1 -1
  76. package/dist/Skeleton/Skeleton.js +1 -2
  77. package/dist/Skeleton/index.d.ts.map +1 -1
  78. package/dist/Skeleton/index.js +1 -2
  79. package/dist/Slider/Slider.d.ts.map +1 -1
  80. package/dist/Slider/Slider.js +2 -6
  81. package/dist/Switch/Switch.d.ts.map +1 -1
  82. package/dist/Switch/Switch.js +3 -3
  83. package/dist/Table/TableRow.d.ts +1 -1
  84. package/dist/Table/TableRow.d.ts.map +1 -1
  85. package/dist/Table/TableRow.js +4 -2
  86. package/dist/TimeInput/TimeInput.d.ts.map +1 -1
  87. package/dist/TimeInput/TimeInput.js +7 -2
  88. package/dist/Timestamp/Timestamp.d.ts.map +1 -1
  89. package/dist/Timestamp/Timestamp.js +14 -3
  90. package/dist/Timestamp/formatInstant.d.ts +11 -1
  91. package/dist/Timestamp/formatInstant.d.ts.map +1 -1
  92. package/dist/Timestamp/formatInstant.js +3 -1
  93. package/dist/VisuallyHidden/VisuallyHidden.d.ts.map +1 -1
  94. package/dist/VisuallyHidden/VisuallyHidden.js +1 -2
  95. package/dist/VisuallyHidden/index.d.ts.map +1 -1
  96. package/dist/VisuallyHidden/index.js +1 -2
  97. package/dist/astryx.css +18 -17
  98. package/dist/astryx.umd.js +45 -45
  99. package/dist/astryx.umd.js.map +4 -4
  100. package/dist/hooks/useInputStatusIcon.d.ts.map +1 -1
  101. package/dist/hooks/useInputStatusIcon.js +17 -4
  102. package/dist/theme/defineTheme.d.ts +2 -2
  103. package/dist/theme/defineTheme.d.ts.map +1 -1
  104. package/dist/theme/defineTheme.js +2 -1
  105. package/dist/theme/index.d.ts +1 -1
  106. package/dist/theme/index.d.ts.map +1 -1
  107. package/dist/theme/index.js +1 -1
  108. package/dist/theme/tokens.stylex.d.ts +12 -0
  109. package/dist/theme/tokens.stylex.d.ts.map +1 -1
  110. package/dist/theme/tokens.stylex.js +23 -0
  111. package/dist/utils/focusOutline.stylex.d.ts +34 -19
  112. package/dist/utils/focusOutline.stylex.d.ts.map +1 -1
  113. package/dist/utils/focusOutline.stylex.js +46 -33
  114. package/dist/utils/index.d.ts +1 -0
  115. package/dist/utils/index.d.ts.map +1 -1
  116. package/dist/utils/index.js +5 -1
  117. package/dist/utils/interactionModality.d.ts +34 -0
  118. package/dist/utils/interactionModality.d.ts.map +1 -0
  119. package/dist/utils/interactionModality.js +70 -0
  120. package/locales/en.json +40 -0
  121. package/locales/pseudo.json +30 -0
  122. package/package.json +2 -2
  123. package/src/AppShell/AppShell.doc.mjs +3 -0
  124. package/src/AspectRatio/AspectRatio.tsx +0 -2
  125. package/src/AspectRatio/index.ts +0 -2
  126. package/src/Badge/Badge.tsx +0 -2
  127. package/src/Badge/index.ts +0 -2
  128. package/src/Banner/Banner.test.tsx +58 -1
  129. package/src/Banner/Banner.tsx +24 -5
  130. package/src/Blockquote/Blockquote.tsx +0 -2
  131. package/src/Blockquote/index.ts +0 -2
  132. package/src/Button/Button.doc.mjs +2 -2
  133. package/src/Button/Button.tsx +5 -4
  134. package/src/Card/Card.tsx +0 -2
  135. package/src/Card/index.ts +0 -2
  136. package/src/Center/Center.tsx +0 -2
  137. package/src/Center/index.ts +0 -2
  138. package/src/CheckboxInput/CheckboxInput.test.tsx +8 -3
  139. package/src/Code/Code.tsx +0 -2
  140. package/src/CommandPalette/CommandPalette.test.tsx +54 -0
  141. package/src/CommandPalette/CommandPalette.tsx +5 -0
  142. package/src/ComplexSelector/ComplexSelector.test.tsx +15 -6
  143. package/src/ComplexSelector/ComplexSelector.tsx +6 -10
  144. package/src/DateInput/DateInput.test.tsx +19 -0
  145. package/src/DateInput/DateInput.tsx +3 -6
  146. package/src/DateRangeInput/DateRangeInput.tsx +3 -9
  147. package/src/DateTimeInput/DateTimeInput.test.tsx +79 -1
  148. package/src/DateTimeInput/DateTimeInput.tsx +23 -9
  149. package/src/DropdownMenu/DropdownMenuRadioGroup.tsx +2 -1
  150. package/src/Field/PanelSearchInput.tsx +271 -0
  151. package/src/FileInput/FileInput.tsx +21 -8
  152. package/src/Grid/Grid.tsx +0 -2
  153. package/src/Grid/index.ts +0 -2
  154. package/src/Icon/globalIconRegistry.tsx +5 -4
  155. package/src/Indicator/Indicator.doc.mjs +1 -1
  156. package/src/Indicator/index.ts +1 -0
  157. package/src/Indicator/types.ts +11 -0
  158. package/src/Lightbox/Lightbox.tsx +2 -11
  159. package/src/MultiSelector/MultiSelector.doc.mjs +9 -0
  160. package/src/MultiSelector/MultiSelector.test.tsx +135 -5
  161. package/src/MultiSelector/MultiSelector.tsx +170 -127
  162. package/src/Popover/Popover.doc.mjs +2 -0
  163. package/src/Popover/usePopover.tsx +37 -4
  164. package/src/ProgressBar/ProgressBar.tsx +2 -8
  165. package/src/Section/Section.tsx +0 -2
  166. package/src/Section/index.ts +0 -2
  167. package/src/Selector/Selector.doc.mjs +10 -0
  168. package/src/Selector/Selector.test.tsx +386 -2
  169. package/src/Selector/Selector.tsx +182 -122
  170. package/src/Skeleton/Skeleton.tsx +0 -2
  171. package/src/Skeleton/index.ts +0 -2
  172. package/src/Slider/Slider.tsx +2 -11
  173. package/src/Switch/Switch.tsx +10 -2
  174. package/src/Table/Table.test.tsx +31 -0
  175. package/src/Table/TableRow.tsx +6 -0
  176. package/src/TimeInput/TimeInput.test.tsx +54 -0
  177. package/src/TimeInput/TimeInput.tsx +17 -2
  178. package/src/Timestamp/Timestamp.test.tsx +91 -14
  179. package/src/Timestamp/Timestamp.tsx +14 -2
  180. package/src/Timestamp/formatInstant.ts +16 -1
  181. package/src/TopNav/TopNavMegaMenu.doc.mjs +5 -0
  182. package/src/TreeList/TreeList.test.tsx +3 -2
  183. package/src/VisuallyHidden/VisuallyHidden.tsx +0 -2
  184. package/src/VisuallyHidden/index.ts +0 -2
  185. package/src/hooks/useInputStatusIcon.tsx +8 -8
  186. package/src/serverSafeComponents.test.ts +665 -0
  187. package/src/theme/defineTheme.ts +3 -0
  188. package/src/theme/generateThemeRules.test.ts +17 -0
  189. package/src/theme/index.ts +2 -0
  190. package/src/theme/tokens.stylex.ts +18 -0
  191. package/src/theme/tokens.test.ts +37 -0
  192. package/src/utils/focusOutline.stylex.ts +37 -23
  193. package/src/utils/index.ts +4 -0
  194. package/src/utils/interactionModality.ts +74 -0
@@ -1 +1 @@
1
- {"version":3,"file":"useInputStatusIcon.d.ts","sourceRoot":"","sources":["../../src/hooks/useInputStatusIcon.tsx"],"names":[],"mappings":"AAmCA,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,OAAO,CAAC;AAErC,OAAO,EAAsB,KAAK,QAAQ,EAAC,MAAM,SAAS,CAAC;AAC3D,OAAO,KAAK,EAAC,kBAAkB,EAAC,MAAM,4BAA4B,CAAC;AACnE,OAAO,KAAK,EAAC,WAAW,EAAkB,MAAM,gBAAgB,CAAC;AAuDjE,MAAM,WAAW,yBAAyB;IACxC,2DAA2D;IAC3D,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,yDAAyD;IACzD,aAAa,CAAC,EAAE,kBAAkB,CAAC;IACnC,+EAA+E;IAC/E,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,+CAA+C;IAC/C,IAAI,CAAC,EAAE,QAAQ,CAAC;CACjB;AAED,MAAM,WAAW,wBAAwB;IACvC;;;;;OAKG;IACH,UAAU,EAAE,SAAS,CAAC;IACtB;;;;;;;OAOG;IACH,WAAW,EAAE,MAAM,GAAG,SAAS,CAAC;CACjC;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,EACjC,MAAM,EACN,aAA0B,EAC1B,SAAiB,EACjB,IAAW,GACZ,EAAE,yBAAyB,GAAG,wBAAwB,CAqGtD"}
1
+ {"version":3,"file":"useInputStatusIcon.d.ts","sourceRoot":"","sources":["../../src/hooks/useInputStatusIcon.tsx"],"names":[],"mappings":"AAmCA,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,OAAO,CAAC;AAErC,OAAO,EAAsB,KAAK,QAAQ,EAAC,MAAM,SAAS,CAAC;AAC3D,OAAO,KAAK,EAAC,kBAAkB,EAAC,MAAM,4BAA4B,CAAC;AACnE,OAAO,KAAK,EAAC,WAAW,EAAkB,MAAM,gBAAgB,CAAC;AAoDjE,MAAM,WAAW,yBAAyB;IACxC,2DAA2D;IAC3D,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,yDAAyD;IACzD,aAAa,CAAC,EAAE,kBAAkB,CAAC;IACnC,+EAA+E;IAC/E,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,+CAA+C;IAC/C,IAAI,CAAC,EAAE,QAAQ,CAAC;CACjB;AAED,MAAM,WAAW,wBAAwB;IACvC;;;;;OAKG;IACH,UAAU,EAAE,SAAS,CAAC;IACtB;;;;;;;OAOG;IACH,WAAW,EAAE,MAAM,GAAG,SAAS,CAAC;CACjC;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,EACjC,MAAM,EACN,aAA0B,EAC1B,SAAiB,EACjB,IAAW,GACZ,EAAE,yBAAyB,GAAG,wBAAwB,CAwGtD"}
@@ -37,8 +37,9 @@ import { Icon } from "../Icon/index.js";
37
37
  import { useTooltip } from "../Tooltip/index.js";
38
38
  import { useTranslator } from "../i18n/index.js";
39
39
  import "../theme/tokens.stylex.js";
40
- import { colorVars, radiusVars } from "../theme/tokens.stylex.js";
40
+ import { radiusVars } from "../theme/tokens.stylex.js";
41
41
  import { themeProps } from "../utils/themeProps.js";
42
+ import { focusOutlineStyles } from "../utils/focusOutline.stylex.js";
42
43
 
43
44
  /**
44
45
  * Maps each status type to its glyph. Shared so every input shows the same icon
@@ -59,6 +60,20 @@ const STATUS_BUTTON_LABEL_KEY = {
59
60
  error: '@astryx.input.statusButton.error',
60
61
  success: '@astryx.input.statusButton.success'
61
62
  };
63
+ const styles = {
64
+ statusButton: {
65
+ k1xSpc: "x3nfvp2",
66
+ kGNEyG: "x6s0dn4",
67
+ kjj79g: "xl56j7k",
68
+ kmVPX3: "x1717udv",
69
+ kogj98: "x1ghz6dp",
70
+ kMwMTN: "x1heor9g",
71
+ kkrTdU: "x1ypdohk",
72
+ kaIpWk: "xjspbzw",
73
+ kInvED: "x7s97pk",
74
+ $$css: true
75
+ }
76
+ };
62
77
  /**
63
78
  * Builds the on-field status icon and its accessibility wiring for a bordered
64
79
  * input. See the file header for the per-variant behavior.
@@ -158,9 +173,7 @@ export function useInputStatusIcon({
158
173
  "aria-describedby": tooltip.describedBy,
159
174
  onClick: handleButtonClick,
160
175
  onBlur: handleButtonBlur,
161
- ...{
162
- className: "x3nfvp2 x6s0dn4 xl56j7k x1717udv x1ghz6dp x1heor9g x1ypdohk xjspbzw x784prv x9v5kkp xzunyri x7s97pk"
163
- },
176
+ ...stylex.props(focusOutlineStyles.focusVisible, styles.statusButton),
164
177
  children: icon
165
178
  }), tooltip.renderTooltip(status.message)]
166
179
  }),
@@ -31,14 +31,14 @@ import type { IconRegistry } from '../Icon/globalIconRegistry';
31
31
  import type { IndicatorRegistry } from '../Indicator/types';
32
32
  import type { TypographyConfig } from './types';
33
33
  import { type OnMediaOverrides, type ResolvedOnMedia } from './onMediaTokens';
34
- import { colorDefaults, spacingDefaults, sizeDefaults, radiusDefaults, shadowDefaults, durationDefaults, easeDefaults, typographyDefaults, textSizeDefaults, fontWeightDefaults, typeScaleDefaults } from './tokens.stylex';
34
+ import { colorDefaults, spacingDefaults, sizeDefaults, focusDefaults, radiusDefaults, shadowDefaults, durationDefaults, easeDefaults, typographyDefaults, textSizeDefaults, fontWeightDefaults, typeScaleDefaults } from './tokens.stylex';
35
35
  import { type MotionScaleConfig } from './expandMotionScale';
36
36
  import { type RadiusScaleConfig } from './expandRadiusScale';
37
37
  import { type ColorScaleConfig } from './expandColorScale';
38
38
  import type { DomainTokenName } from './domainTokens';
39
39
  import type { SyntaxThemeDefinition } from './syntax';
40
40
  /** All valid Astryx core token names */
41
- export type CoreTokenName = keyof typeof colorDefaults | keyof typeof spacingDefaults | keyof typeof sizeDefaults | keyof typeof radiusDefaults | keyof typeof shadowDefaults | keyof typeof durationDefaults | keyof typeof easeDefaults | keyof typeof typographyDefaults | keyof typeof textSizeDefaults | keyof typeof fontWeightDefaults | keyof typeof typeScaleDefaults;
41
+ export type CoreTokenName = keyof typeof colorDefaults | keyof typeof spacingDefaults | keyof typeof sizeDefaults | keyof typeof focusDefaults | keyof typeof radiusDefaults | keyof typeof shadowDefaults | keyof typeof durationDefaults | keyof typeof easeDefaults | keyof typeof typographyDefaults | keyof typeof textSizeDefaults | keyof typeof fontWeightDefaults | keyof typeof typeScaleDefaults;
42
42
  /** All valid Astryx token names — core + domain tokens */
43
43
  export type TokenName = CoreTokenName | DomainTokenName;
44
44
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"defineTheme.d.ts","sourceRoot":"","sources":["../../src/theme/defineTheme.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,4BAA4B,CAAC;AAC7D,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,oBAAoB,CAAC;AAC1D,OAAO,KAAK,EAAC,gBAAgB,EAAa,MAAM,SAAS,CAAC;AAC1D,OAAO,EAEL,KAAK,gBAAgB,EACrB,KAAK,eAAe,EACrB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,aAAa,EACb,eAAe,EACf,YAAY,EACZ,cAAc,EACd,cAAc,EACd,gBAAgB,EAChB,YAAY,EACZ,kBAAkB,EAClB,gBAAgB,EAChB,kBAAkB,EAClB,iBAAiB,EAClB,MAAM,iBAAiB,CAAC;AAMzB,OAAO,EAAoB,KAAK,iBAAiB,EAAC,MAAM,qBAAqB,CAAC;AAC9E,OAAO,EAAoB,KAAK,iBAAiB,EAAC,MAAM,qBAAqB,CAAC;AAC9E,OAAO,EAAmB,KAAK,gBAAgB,EAAC,MAAM,oB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;AACrF,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAchD,CAAC;AA6FF;;;;;;;;;GASG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,gBAAgB,GAAG,YAAY,CAyKjE;AAMD,OAAO,EACL,kBAAkB,EAClB,uBAAuB,EACvB,kBAAkB,EAClB,gBAAgB,EAChB,KAAK,eAAe,EACpB,KAAK,cAAc,GACpB,MAAM,sBAAsB,CAAC;AAM9B,2DAA2D;AAC3D,wBAAgB,cAAc,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,YAAY,CAQpE"}
@@ -31,7 +31,7 @@
31
31
  */
32
32
 
33
33
  import { resolveOnMedia } from "./onMediaTokens.js";
34
- import { colorDefaults, spacingDefaults, sizeDefaults, radiusDefaults, shadowDefaults, durationDefaults, easeDefaults, typographyDefaults, textSizeDefaults, fontWeightDefaults, typeScaleDefaults } from "./tokens.stylex.js";
34
+ import { colorDefaults, spacingDefaults, sizeDefaults, focusDefaults, radiusDefaults, shadowDefaults, durationDefaults, easeDefaults, typographyDefaults, textSizeDefaults, fontWeightDefaults, typeScaleDefaults } from "./tokens.stylex.js";
35
35
  import { expandTypeScale, generateTypeScaleComponents } from "./expandTypeScale.js";
36
36
  import { expandMotionScale } from "./expandMotionScale.js";
37
37
  import { expandRadiusScale } from "./expandRadiusScale.js";
@@ -120,6 +120,7 @@ export const tokenDefaults = {
120
120
  ...colorDefaults,
121
121
  ...spacingDefaults,
122
122
  ...sizeDefaults,
123
+ ...focusDefaults,
123
124
  ...radiusDefaults,
124
125
  ...shadowDefaults,
125
126
  ...durationDefaults,
@@ -30,7 +30,7 @@ export { expandColorScale } from './expandColorScale';
30
30
  export type { ColorScaleConfig, ColorScaleTokens } from './expandColorScale';
31
31
  export { expandMotionScale } from './expandMotionScale';
32
32
  export type { MotionScaleConfig, MotionScaleTokens } from './expandMotionScale';
33
- export { colorDefaults, spacingDefaults, sizeDefaults, borderDefaults, radiusDefaults, shadowDefaults, durationDefaults, easeDefaults, typographyDefaults, textSizeDefaults, fontWeightDefaults, typeScaleDefaults, colorVars, spacingVars, sizeVars, borderVars, radiusVars, shadowVars, durationVars, easeVars, typographyVars, textSizeVars, fontWeightVars, typeScaleVars, } from './tokens.stylex';
33
+ export { colorDefaults, spacingDefaults, sizeDefaults, borderDefaults, focusDefaults, radiusDefaults, shadowDefaults, durationDefaults, easeDefaults, typographyDefaults, textSizeDefaults, fontWeightDefaults, typeScaleDefaults, colorVars, spacingVars, sizeVars, borderVars, focusVars, radiusVars, shadowVars, durationVars, easeVars, typographyVars, textSizeVars, fontWeightVars, typeScaleVars, } from './tokens.stylex';
34
34
  export type { ColorVarName, SpacingVarName, SizeVarName, BorderVarName, RadiusVarName, ShadowVarName, DurationVarName, EaseVarName, TypographyVarName, TextSizeVarName, FontWeightVarName, TypeScaleVarName, } from './tokens.stylex';
35
35
  export { useTheme, useThemeName, ThemeContext } from './useTheme';
36
36
  export type { UseThemeReturn, ThemeContextValue } from './useTheme';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/theme/index.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAC,KAAK,EAAC,MAAM,SAAS,CAAC;AAC9B,OAAO,EAAC,UAAU,EAAC,MAAM,cAAc,CAAC;AACxC,YAAY,EAAC,eAAe,EAAC,MAAM,cAAc,CAAC;AAClD,OAAO,EACL,WAAW,EACX,gBAAgB,EAChB,kBAAkB,EAClB,kBAAkB,EAClB,uBAAuB,EACvB,KAAK,cAAc,EACnB,KAAK,eAAe,EACpB,cAAc,EACd,aAAa,GACd,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,aAAa,EACb,kBAAkB,EAClB,mBAAmB,EACnB,WAAW,GACZ,MAAM,iBAAiB,CAAC;AACzB,YAAY,EACV,gBAAgB,EAChB,YAAY,EACZ,aAAa,EACb,SAAS,EACT,UAAU,EACV,iBAAiB,EACjB,cAAc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ACZ,cAAc,EACd,aAAa,GACd,MAAM,iBAAiB,CAAC;AAGzB,YAAY,EACV,YAAY,EACZ,cAAc,EACd,WAAW,EACX,aAAa,EACb,aAAa,EACb,aAAa,EACb,eAAe,EACf,WAAW,EACX,iBAAiB,EACjB,eAAe,EACf,iBAAiB,EACjB,gBAAgB,GACjB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAC,QAAQ,EAAE,YAAY,EAAE,YAAY,EAAC,MAAM,YAAY,CAAC;AAChE,YAAY,EAAC,cAAc,EAAE,iBAAiB,EAAC,MAAM,YAAY,CAAC;AAElE,YAAY,EACV,kBAAkB,EAClB,eAAe,EACf,kBAAkB,EAClB,YAAY,EACZ,aAAa,EACb,qBAAqB,EACrB,cAAc,EACd,iBAAiB,EACjB,aAAa,EACb,cAAc,GACf,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAClB,QAAQ,EACR,SAAS,GACV,MAAM,UAAU,CAAC;AAClB,YAAY,EACV,wBAAwB,EACxB,yBAAyB,EACzB,iBAAiB,GAClB,MAAM,UAAU,CAAC;AAElB,YAAY,EAAC,YAAY,EAAC,MAAM,SAAS,CAAC;AAC1C,YAAY,EACV,SAAS,EACT,UAAU,EACV,QAAQ,EACR,eAAe,EACf,eAAe,EACf,QAAQ,EACR,UAAU,EACV,SAAS,EACT,gBAAgB,EAChB,gBAAgB,EAChB,cAAc,EACd,UAAU,GACX,MAAM,SAAS,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/theme/index.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAC,KAAK,EAAC,MAAM,SAAS,CAAC;AAC9B,OAAO,EAAC,UAAU,EAAC,MAAM,cAAc,CAAC;AACxC,YAAY,EAAC,eAAe,EAAC,MAAM,cAAc,CAAC;AAClD,OAAO,EACL,WAAW,EACX,gBAAgB,EAChB,kBAAkB,EAClB,kBAAkB,EAClB,uBAAuB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Scale } from "./expandRadiusScale.js";
29
29
  export { expandColorScale } from "./expandColorScale.js";
30
30
  export { expandMotionScale } from "./expandMotionScale.js";
31
31
  // Export token defaults and vars for use in custom components and themes
32
- export { colorDefaults, spacingDefaults, sizeDefaults, borderDefaults, radiusDefaults, shadowDefaults, durationDefaults, easeDefaults, typographyDefaults, textSizeDefaults, fontWeightDefaults, typeScaleDefaults, colorVars, spacingVars, sizeVars, borderVars, radiusVars, shadowVars, durationVars, easeVars, typographyVars, textSizeVars, fontWeightVars, typeScaleVars } from "./tokens.stylex.js";
32
+ export { colorDefaults, spacingDefaults, sizeDefaults, borderDefaults, focusDefaults, radiusDefaults, shadowDefaults, durationDefaults, easeDefaults, typographyDefaults, textSizeDefaults, fontWeightDefaults, typeScaleDefaults, colorVars, spacingVars, sizeVars, borderVars, focusVars, radiusVars, shadowVars, durationVars, easeVars, typographyVars, textSizeVars, fontWeightVars, typeScaleVars } from "./tokens.stylex.js";
33
33
 
34
34
  // Export token key types for theme authoring
35
35
 
@@ -225,6 +225,18 @@ export declare const borderVars: stylex.VarGroup<Readonly<{
225
225
  readonly '--border-width': "1px";
226
226
  }>, symbol>;
227
227
  export type BorderVarName = keyof typeof borderDefaults;
228
+ export declare const focusDefaults: {
229
+ readonly '--focus-outline-width': "2px";
230
+ readonly '--focus-outline-style': "solid";
231
+ readonly '--focus-outline-color': "var(--color-accent)";
232
+ readonly '--focus-outline-offset': "3px";
233
+ };
234
+ export declare const focusVars: stylex.VarGroup<Readonly<{
235
+ readonly '--focus-outline-width': "2px";
236
+ readonly '--focus-outline-style': "solid";
237
+ readonly '--focus-outline-color': "var(--color-accent)";
238
+ readonly '--focus-outline-offset': "3px";
239
+ }>, symbol>;
228
240
  export declare const radiusDefaults: {
229
241
  readonly '--radius-none': "0px";
230
242
  readonly '--radius-inner': "4px";
@@ -1 +1 @@
1
- {"version":3,"file":"tokens.stylex.d.ts","sourceRoot":"","sources":["../../src/theme/tokens.stylex.ts"],"names":[],"mappings":"AAEA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,CAAC;AAMpE,MAAM,MAAM,YAAY,GAAG,MAAM,OAAO,aAAa,CAAC;AACtD,MAAM,MAAM,cAAc,GAAG,MAAM,OAAO,eAAe,CAAC;AAC1D,MAAM,MAAM,WAAW,GAAG,MAAM,OAAO,YAAY,CAAC;AACpD,MAAM,MAAM,aAAa,GAAG,MAAM,OAAO,cAAc,CAAC;AACxD,MAAM,MAAM,aAAa,GAAG,MAAM,OAAO,cAAc,CAAC;AACxD,MAAM,MAAM,iBAAiB,GAAG,MAAM,OAAO,kBAAkB,CAAC;AAChE,MAAM,MAAM,eAAe,GAAG,MAAM,OAAO,gBAAgB,CAAC;AAC5D,MAAM,MAAM,iBAAiB,GAAG,MAAM,OAAO,kBAAkB,CAAC;AAehE,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0DpB,CAAC;AAEX,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;WAAuC,CAAC;AAElE,MAAM,MAAM,gBAAgB,GAAG,MAAM,OAAO,iBAAiB,CAAC"}
@@ -284,6 +284,29 @@ export const borderVars = {
284
284
  "--border-width": "var(--border-width)",
285
285
  __varGroupHash__: "xafi2nm"
286
286
  };
287
+ // =============================================================================
288
+ // Focus Tokens
289
+ // =============================================================================
290
+ // The keyboard focus ring, as one definition for the whole system. Values come
291
+ // from Design Conventions §User Interaction States: 2px --color-accent at 3px
292
+ // offset. Components read these through utils/focusOutline.stylex.ts; the
293
+ // `:focus-visible` condition stays in core, so a theme can restyle the ring
294
+ // but cannot show it to pointer users.
295
+
296
+ export const focusDefaults = {
297
+ '--focus-outline-width': '2px',
298
+ '--focus-outline-style': 'solid',
299
+ '--focus-outline-color': 'var(--color-accent)',
300
+ '--focus-outline-offset': '3px'
301
+ };
302
+ export const focusVars = {
303
+ "--focus-outline-width": "var(--focus-outline-width)",
304
+ "--focus-outline-style": "var(--focus-outline-style)",
305
+ "--focus-outline-color": "var(--focus-outline-color)",
306
+ "--focus-outline-offset": "var(--focus-outline-offset)",
307
+ __varGroupHash__: "xzxs3qz"
308
+ };
309
+
287
310
  // =============================================================================
288
311
  // Radius Tokens
289
312
  // =============================================================================
@@ -5,18 +5,33 @@
5
5
  * @position Internal utility for consistent keyboard focus outlines across core components
6
6
  *
7
7
  * Centralizes the standard Astryx focus outline, shown only for keyboard focus.
8
- * Every focusable surface drew the same 2px accent ring at 2px offset already;
9
- * writing it per component meant five identical definitions to keep in step.
8
+ * Every focusable surface drew the same 2px accent ring already; writing it per
9
+ * component meant dozens of identical definitions to keep in step, and they did
10
+ * not stay in step — offsets drifted and one ring was a border-width thick.
10
11
  *
11
- * These are utility styles, deliberately NOT a theme target. A shared
12
- * `astryx-focus-outline` class was tried and pulled: a theme can only override
13
- * the ring unconditionally through it (`generateThemeRules` mangles
14
- * `:focus-visible` into `.focus-visible` and truncates `:has(:focus-visible)`
15
- * at the paren), so the one thing such a target exists for — restyling a
16
- * STATE — is exactly what it cannot express. Making focus outlines themeable
17
- * is worth doing on top of this consolidation, once that is fixed.
12
+ * Every ring in core and lab is drawn from here, with one exception recorded in
13
+ * Switch: its condition is a component-scoped ancestor marker, which cannot be
14
+ * shared without leaking focus state between components. A component may still
15
+ * override the OFFSET (a ring that must sit inset, or clear of a field border);
16
+ * width, style and color are not restated anywhere.
17
+ *
18
+ * Every value comes from the `--focus-outline-*` tokens, which is how a theme
19
+ * restyles the ring: one override reaches every component at once. The
20
+ * `:focus-visible` condition is not themeable and stays here, so a theme can
21
+ * change what the ring looks like but cannot show it to pointer users.
18
22
  */
19
23
  import * as stylex from '@stylexjs/stylex';
24
+ /**
25
+ * The ring as a single `outline` value, for reading it at runtime — an
26
+ * assertion, or an element styled imperatively.
27
+ *
28
+ * NOT usable inside another file's `stylex.create`: StyleX resolves imported
29
+ * `defineVars` and nothing else, so a component whose condition
30
+ * {@link focusOutlineStyles} cannot express (Switch, whose ring keys off a
31
+ * component-scoped ancestor marker) has to compose the `focusVars` tokens
32
+ * itself.
33
+ */
34
+ export declare const FOCUS_OUTLINE: string;
20
35
  /**
21
36
  * The standard focus ring as plain CSS values, for the one case that has to
22
37
  * apply it imperatively: a control whose focusable input is visually hidden and
@@ -26,8 +41,8 @@ import * as stylex from '@stylexjs/stylex';
26
41
  * Longhands, not the `outline` shorthand, for the same reason the styles are:
27
42
  * a shorthand resets every longhand it covers, so a caller could not re-color
28
43
  * the ring without restating its width and style. Split, each part is
29
- * independently overridable — and `--color-accent` stays a var, so a theme's
30
- * accent still flows through.
44
+ * independently overridable — and every part stays a var, so a theme's
45
+ * `--focus-outline-*` overrides still flow through.
31
46
  *
32
47
  * Keys are camelCase to match `HTMLElement.style`, so this spreads straight
33
48
  * onto an element:
@@ -38,10 +53,10 @@ import * as stylex from '@stylexjs/stylex';
38
53
  * ```
39
54
  */
40
55
  export declare const FOCUS_OUTLINE_PARTS: {
41
- readonly outlineWidth: "2px";
42
- readonly outlineStyle: "solid";
43
- readonly outlineColor: stylex.StyleXVar<"light-dark(#0064E0, #2694FE)">;
44
- readonly outlineOffset: "3px";
56
+ readonly outlineWidth: stylex.StyleXVar<"2px">;
57
+ readonly outlineStyle: stylex.StyleXVar<"solid">;
58
+ readonly outlineColor: stylex.StyleXVar<"var(--color-accent)">;
59
+ readonly outlineOffset: stylex.StyleXVar<"3px">;
45
60
  };
46
61
  /** Clears {@link FOCUS_OUTLINE_PARTS}, one key per part so nothing lingers. */
47
62
  export declare const FOCUS_OUTLINE_PARTS_NONE: {
@@ -54,21 +69,21 @@ export declare const focusOutlineStyles: Readonly<{
54
69
  readonly focusVisible: Readonly<{
55
70
  readonly outlineWidth: stylex.StyleXClassNameFor<"outlineWidth", "0" | "2px">;
56
71
  readonly outlineStyle: stylex.StyleXClassNameFor<"outlineStyle", "none" | "solid">;
57
- readonly outlineColor: stylex.StyleXClassNameFor<"outlineColor", "light-dark(#0064E0, #2694FE)" | null>;
72
+ readonly outlineColor: stylex.StyleXClassNameFor<"outlineColor", "var(--color-accent)" | null>;
58
73
  readonly outlineOffset: stylex.StyleXClassNameFor<"outlineOffset", "0" | "3px">;
59
74
  }>;
60
75
  readonly focusWithin: Readonly<{
61
76
  readonly outlineWidth: stylex.StyleXClassNameFor<"outlineWidth", "0" | "2px">;
62
77
  readonly outlineStyle: stylex.StyleXClassNameFor<"outlineStyle", "none" | "solid">;
63
- readonly outlineColor: stylex.StyleXClassNameFor<"outlineColor", "light-dark(#0064E0, #2694FE)" | null>;
78
+ readonly outlineColor: stylex.StyleXClassNameFor<"outlineColor", "var(--color-accent)" | null>;
64
79
  readonly outlineOffset: stylex.StyleXClassNameFor<"outlineOffset", "0" | "3px">;
65
80
  }>;
66
81
  readonly publishFocusVisibleVars: Readonly<{
67
- readonly '--_focus-outline': stylex.StyleXClassNameFor<"--_focus-outline", "none" | `2px solid ${stylex.StyleXVar<"light-dark(#0064E0, #2694FE)">}`>;
82
+ readonly '--_focus-outline': stylex.StyleXClassNameFor<"--_focus-outline", string>;
68
83
  readonly '--_focus-outline-offset': stylex.StyleXClassNameFor<"--_focus-outline-offset", "0" | "3px">;
69
84
  }>;
70
85
  readonly focusWithinOrPublished: Readonly<{
71
- readonly outline: stylex.StyleXClassNameFor<"outline", `2px solid ${stylex.StyleXVar<"light-dark(#0064E0, #2694FE)">}` | "var(--_focus-outline, none)">;
86
+ readonly outline: stylex.StyleXClassNameFor<"outline", string>;
72
87
  readonly outlineOffset: stylex.StyleXClassNameFor<"outlineOffset", "3px" | "var(--_focus-outline-offset, 0)">;
73
88
  }>;
74
89
  }>;
@@ -1 +1 @@
1
- {"version":3,"file":"focusOutline.stylex.d.ts","sourceRoot":"","sources":["../../src/utils/focusOutline.stylex.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,KAAK,MAAM,MAAM,kBAAkB,CAAC;AAyB3C;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,mBAAmB;;;;;CAKtB,CAAC;AAEX,+EAA+E;AAC/E,eAAO,MAAM,wBAAwB;;;;;CAK3B,CAAC;AAEX,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;EAmD7B,CAAC;AAIH,KAAK,cAAc,GAAG,OAAO,CAAC;AAiB9B,eAAO,MAAM,iBAAiB;uCAdT,cAAc,EAAE;;;;;;;sCAAhB,cAAc,EAAE;;;;;;;kDAAhB,cAAc,EAAE;;;;;;;iDAAhB,cAAc,EAAE;;;;;;;CAuB3B,CAAC"}
1
+ {"version":3,"file":"focusOutline.stylex.d.ts","sourceRoot":"","sources":["../../src/utils/focusOutline.stylex.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,KAAK,MAAM,MAAM,kBAAkB,CAAC;AAS3C;;;;;;;;;GASG;AACH,eAAO,MAAM,aAAa,QAAyE,CAAC;AAgBpG;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,mBAAmB;;;;;CAKtB,CAAC;AAEX,+EAA+E;AAC/E,eAAO,MAAM,wBAAwB;;;;;CAK3B,CAAC;AAEX,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;EAmD7B,CAAC;AAIH,KAAK,cAAc,GAAG,OAAO,CAAC;AAiB9B,eAAO,MAAM,iBAAiB;uCAdT,cAAc,EAAE;;;;;;;sCAAhB,cAAc,EAAE;;;;;;;kDAAhB,cAAc,EAAE;;;;;;;iDAAhB,cAAc,EAAE;;;;;;;CAuB3B,CAAC"}
@@ -7,28 +7,41 @@
7
7
  * @position Internal utility for consistent keyboard focus outlines across core components
8
8
  *
9
9
  * Centralizes the standard Astryx focus outline, shown only for keyboard focus.
10
- * Every focusable surface drew the same 2px accent ring at 2px offset already;
11
- * writing it per component meant five identical definitions to keep in step.
10
+ * Every focusable surface drew the same 2px accent ring already; writing it per
11
+ * component meant dozens of identical definitions to keep in step, and they did
12
+ * not stay in step — offsets drifted and one ring was a border-width thick.
12
13
  *
13
- * These are utility styles, deliberately NOT a theme target. A shared
14
- * `astryx-focus-outline` class was tried and pulled: a theme can only override
15
- * the ring unconditionally through it (`generateThemeRules` mangles
16
- * `:focus-visible` into `.focus-visible` and truncates `:has(:focus-visible)`
17
- * at the paren), so the one thing such a target exists for — restyling a
18
- * STATE — is exactly what it cannot express. Making focus outlines themeable
19
- * is worth doing on top of this consolidation, once that is fixed.
14
+ * Every ring in core and lab is drawn from here, with one exception recorded in
15
+ * Switch: its condition is a component-scoped ancestor marker, which cannot be
16
+ * shared without leaking focus state between components. A component may still
17
+ * override the OFFSET (a ring that must sit inset, or clear of a field border);
18
+ * width, style and color are not restated anywhere.
19
+ *
20
+ * Every value comes from the `--focus-outline-*` tokens, which is how a theme
21
+ * restyles the ring: one override reaches every component at once. The
22
+ * `:focus-visible` condition is not themeable and stays here, so a theme can
23
+ * change what the ring looks like but cannot show it to pointer users.
20
24
  */
21
25
 
22
26
  import * as stylex from '@stylexjs/stylex';
23
27
  import "../theme/tokens.stylex.js";
24
- import { colorVars } from "../theme/tokens.stylex.js";
25
- const FOCUS_OUTLINE_WIDTH = '2px';
26
- // 3px, per Design Conventions §User Interaction States: "2px --color-accent
27
- // outline at 3px offset". Most components had drifted to 2px; Button, Calendar,
28
- // Dialog and Pagination were the ones matching the spec, so the consolidation
29
- // takes their value rather than the majority's.
30
- const FOCUS_OUTLINE_OFFSET = '3px';
31
- const FOCUS_OUTLINE_COLOR = colorVars['--color-accent'];
28
+ import { focusVars } from "../theme/tokens.stylex.js";
29
+ const FOCUS_OUTLINE_WIDTH = focusVars['--focus-outline-width'];
30
+ const FOCUS_OUTLINE_STYLE = focusVars['--focus-outline-style'];
31
+ const FOCUS_OUTLINE_COLOR = focusVars['--focus-outline-color'];
32
+ const FOCUS_OUTLINE_OFFSET = focusVars['--focus-outline-offset'];
33
+
34
+ /**
35
+ * The ring as a single `outline` value, for reading it at runtime — an
36
+ * assertion, or an element styled imperatively.
37
+ *
38
+ * NOT usable inside another file's `stylex.create`: StyleX resolves imported
39
+ * `defineVars` and nothing else, so a component whose condition
40
+ * {@link focusOutlineStyles} cannot express (Switch, whose ring keys off a
41
+ * component-scoped ancestor marker) has to compose the `focusVars` tokens
42
+ * itself.
43
+ */
44
+ export const FOCUS_OUTLINE = `${FOCUS_OUTLINE_WIDTH} ${FOCUS_OUTLINE_STYLE} ${FOCUS_OUTLINE_COLOR}`;
32
45
 
33
46
  /**
34
47
  * Written as longhands rather than the `outline` shorthand.
@@ -40,7 +53,7 @@ const FOCUS_OUTLINE_COLOR = colorVars['--color-accent'];
40
53
  */
41
54
  const focusOutlineLonghands = {
42
55
  outlineWidth: FOCUS_OUTLINE_WIDTH,
43
- outlineStyle: 'solid',
56
+ outlineStyle: FOCUS_OUTLINE_STYLE,
44
57
  outlineColor: FOCUS_OUTLINE_COLOR
45
58
  };
46
59
 
@@ -53,8 +66,8 @@ const focusOutlineLonghands = {
53
66
  * Longhands, not the `outline` shorthand, for the same reason the styles are:
54
67
  * a shorthand resets every longhand it covers, so a caller could not re-color
55
68
  * the ring without restating its width and style. Split, each part is
56
- * independently overridable — and `--color-accent` stays a var, so a theme's
57
- * accent still flows through.
69
+ * independently overridable — and every part stays a var, so a theme's
70
+ * `--focus-outline-*` overrides still flow through.
58
71
  *
59
72
  * Keys are camelCase to match `HTMLElement.style`, so this spreads straight
60
73
  * onto an element:
@@ -66,7 +79,7 @@ const focusOutlineLonghands = {
66
79
  */
67
80
  export const FOCUS_OUTLINE_PARTS = {
68
81
  outlineWidth: FOCUS_OUTLINE_WIDTH,
69
- outlineStyle: 'solid',
82
+ outlineStyle: FOCUS_OUTLINE_STYLE,
70
83
  outlineColor: FOCUS_OUTLINE_COLOR,
71
84
  outlineOffset: FOCUS_OUTLINE_OFFSET
72
85
  };
@@ -80,27 +93,27 @@ export const FOCUS_OUTLINE_PARTS_NONE = {
80
93
  };
81
94
  export const focusOutlineStyles = {
82
95
  focusVisible: {
83
- kMeerF: "x1k57tk5 x784prv",
84
- k3XXqK: "x1t137rt x9v5kkp",
85
- kjBf7l: "xzunyri",
86
- kInvED: "x1wfwxd8 xj3ae5l",
96
+ kMeerF: "x1k57tk5 x1vidyx5",
97
+ k3XXqK: "x1t137rt x1jhp3zv",
98
+ kjBf7l: "xx47ajj",
99
+ kInvED: "x1wfwxd8 x1vwwbsn",
87
100
  $$css: true
88
101
  },
89
102
  focusWithin: {
90
- kMeerF: "x1k57tk5 x1odlxkb",
91
- k3XXqK: "x1t137rt xnnj0qo",
92
- kjBf7l: "xee0hk0",
93
- kInvED: "x1wfwxd8 xscfbxq",
103
+ kMeerF: "x1k57tk5 x11j6mr8",
104
+ k3XXqK: "x1t137rt xciu248",
105
+ kjBf7l: "x1uy843r",
106
+ kInvED: "x1wfwxd8 x1jumodi",
94
107
  $$css: true
95
108
  },
96
109
  publishFocusVisibleVars: {
97
- "--_focus-outline": "x17wzz1v x1bqhfga",
98
- "--_focus-outline-offset": "xgzxwq1 x1tcr69y",
110
+ "--_focus-outline": "x17wzz1v xqih627",
111
+ "--_focus-outline-offset": "xgzxwq1 xqchwus",
99
112
  $$css: true
100
113
  },
101
114
  focusWithinOrPublished: {
102
- kI3sdo: "xaw4jrz x1irc7jg",
103
- kInvED: "x1kvmbwa xscfbxq",
115
+ kI3sdo: "xaw4jrz x16s19ga",
116
+ kInvED: "x1kvmbwa x1jumodi",
104
117
  $$css: true
105
118
  }
106
119
  };
@@ -29,4 +29,5 @@ export { parseHex, parseRgb, parseColor, formatHex, formatColor, toGLFloats, } f
29
29
  export type { RGBA } from './color';
30
30
  export { devWarn, devError, warnOnce, formatDevMessage } from './devWarning';
31
31
  export { rtlStyles } from './rtlStyles';
32
+ export { focusOutlineStyles, focusOutlineProps } from './focusOutline.stylex';
32
33
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AAEH,YAAY,EAAC,SAAS,EAAC,MAAM,S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AwB,CAAC;AACtE,OAAO,EAAC,YAAY,EAAC,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAC,YAAY,EAAC,MAAM,aAAa,CAAC;AACzC,YAAY,EAAC,SAAS,EAAE,mBAAmB,EAAC,MAAM,aAAa,CAAC;AAEhE,OAAO,EACL,QAAQ,EACR,QAAQ,EACR,UAAU,EACV,SAAS,EACT,WAAW,EACX,UAAU,GACX,MAAM,SAAS,CAAC;AACjB,YAAY,EAAC,IAAI,EAAC,MAAM,SAAS,CAAC;AAElC,OAAO,EAAC,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,gBAAgB,EAAC,MAAM,cAAc,CAAC;AAE3E,OAAO,EAAC,SAAS,EAAC,MAAM,aAAa,CAAC;AAItC,OAAO,EAAC,kBAAkB,EAAE,iBAAiB,EAAC,MAAM,uBAAuB,CAAC"}
@@ -23,4 +23,8 @@ export { isRenderable } from "./isRenderable.js";
23
23
  export { getInputARIA } from "./inputAria.js";
24
24
  export { parseHex, parseRgb, parseColor, formatHex, formatColor, toGLFloats } from "./color.js";
25
25
  export { devWarn, devError, warnOnce, formatDevMessage } from "./devWarning.js";
26
- export { rtlStyles } from "./rtlStyles.js";
26
+ export { rtlStyles } from "./rtlStyles.js";
27
+
28
+ // The shared focus ring, exported for @astryxdesign/lab — same reason
29
+ // rtlStyles is: a style that must be identical across packages, not copied.
30
+ export { focusOutlineStyles, focusOutlineProps } from "./focusOutline.stylex.js";
@@ -0,0 +1,34 @@
1
+ /**
2
+ * @file interactionModality.ts
3
+ * @input Global pointerdown/keydown events
4
+ * @output `getInteractionModality()` — how the user last interacted
5
+ * @position Internal utility; used where `:focus-visible` alone is too broad
6
+ *
7
+ * `:focus-visible` is the right selector for a focus ring and should stay the
8
+ * condition that draws one. It is not, on its own, "focused by keyboard":
9
+ * per CSS Selectors 4 a pointer-focused element that supports text entry
10
+ * matches it too, deliberately, so that a clicked text field still shows where
11
+ * typing will go. Measured in Chromium — a bare `<input>` clicked with a mouse
12
+ * matches `:focus-visible`.
13
+ *
14
+ * A component that wants a ring for keyboard focus ONLY therefore needs one bit
15
+ * `:focus-visible` cannot give it: which device moved focus. This records that,
16
+ * to be used as a gate ALONGSIDE `:focus-visible`, never as a replacement for
17
+ * it — the browser's heuristic still decides everything else, including
18
+ * `focus({focusVisible: true})`.
19
+ *
20
+ * Listeners are registered once for the document, in the capture phase so they
21
+ * run before the focus they explain, and are never removed: two passive
22
+ * listeners for the whole app, versus a pair per mounted input.
23
+ */
24
+ export type InteractionModality = 'keyboard' | 'pointer';
25
+ /**
26
+ * Start tracking, once per document. Safe to call repeatedly and on the server
27
+ * (where it does nothing).
28
+ */
29
+ export declare function trackInteractionModality(): void;
30
+ /** How the user last interacted with the page. */
31
+ export declare function getInteractionModality(): InteractionModality;
32
+ /** Test-only: restore the initial state between cases. */
33
+ export declare function __resetInteractionModalityForTest(): void;
34
+ //# sourceMappingURL=interactionModality.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"interactionModality.d.ts","sourceRoot":"","sources":["../../src/utils/interactionModality.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,MAAM,MAAM,mBAAmB,GAAG,UAAU,GAAG,SAAS,CAAC;AAoBzD;;;GAGG;AACH,wBAAgB,wBAAwB,IAAI,IAAI,CAa/C;AAED,kDAAkD;AAClD,wBAAgB,sBAAsB,IAAI,mBAAmB,CAE5D;AAED,0DAA0D;AAC1D,wBAAgB,iCAAiC,IAAI,IAAI,CAExD"}
@@ -0,0 +1,70 @@
1
+ // Copyright (c) Meta Platforms, Inc. and affiliates.
2
+
3
+ /**
4
+ * @file interactionModality.ts
5
+ * @input Global pointerdown/keydown events
6
+ * @output `getInteractionModality()` — how the user last interacted
7
+ * @position Internal utility; used where `:focus-visible` alone is too broad
8
+ *
9
+ * `:focus-visible` is the right selector for a focus ring and should stay the
10
+ * condition that draws one. It is not, on its own, "focused by keyboard":
11
+ * per CSS Selectors 4 a pointer-focused element that supports text entry
12
+ * matches it too, deliberately, so that a clicked text field still shows where
13
+ * typing will go. Measured in Chromium — a bare `<input>` clicked with a mouse
14
+ * matches `:focus-visible`.
15
+ *
16
+ * A component that wants a ring for keyboard focus ONLY therefore needs one bit
17
+ * `:focus-visible` cannot give it: which device moved focus. This records that,
18
+ * to be used as a gate ALONGSIDE `:focus-visible`, never as a replacement for
19
+ * it — the browser's heuristic still decides everything else, including
20
+ * `focus({focusVisible: true})`.
21
+ *
22
+ * Listeners are registered once for the document, in the capture phase so they
23
+ * run before the focus they explain, and are never removed: two passive
24
+ * listeners for the whole app, versus a pair per mounted input.
25
+ */
26
+
27
+ // Default to keyboard: with no interaction yet, focus arrived programmatically
28
+ // or from the browser restoring it, and showing a ring is the safe error.
29
+ let modality = 'keyboard';
30
+ let isListening = false;
31
+ function onPointerDown() {
32
+ modality = 'pointer';
33
+ }
34
+ function onKeyDown(event) {
35
+ // Modifier-only presses are not navigation — holding Shift before a click
36
+ // must not turn that click into "keyboard".
37
+ if (event.metaKey || event.altKey || event.ctrlKey) {
38
+ return;
39
+ }
40
+ modality = 'keyboard';
41
+ }
42
+
43
+ /**
44
+ * Start tracking, once per document. Safe to call repeatedly and on the server
45
+ * (where it does nothing).
46
+ */
47
+ export function trackInteractionModality() {
48
+ if (isListening || typeof document === 'undefined') {
49
+ return;
50
+ }
51
+ isListening = true;
52
+ document.addEventListener('pointerdown', onPointerDown, {
53
+ capture: true,
54
+ passive: true
55
+ });
56
+ document.addEventListener('keydown', onKeyDown, {
57
+ capture: true,
58
+ passive: true
59
+ });
60
+ }
61
+
62
+ /** How the user last interacted with the page. */
63
+ export function getInteractionModality() {
64
+ return modality;
65
+ }
66
+
67
+ /** Test-only: restore the initial state between cases. */
68
+ export function __resetInteractionModalityForTest() {
69
+ modality = 'keyboard';
70
+ }