@astryxdesign/core 0.5.0-canary.f747a49 → 0.5.0-canary.fb17bfe

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 (187) hide show
  1. package/dist/AlertDialog/AlertDialog.d.ts +1 -1
  2. package/dist/AlertDialog/AlertDialog.d.ts.map +1 -1
  3. package/dist/AlertDialog/AlertDialog.js +45 -20
  4. package/dist/AspectRatio/AspectRatio.d.ts +6 -6
  5. package/dist/Button/Button.d.ts.map +1 -1
  6. package/dist/Button/Button.js +6 -2
  7. package/dist/Calendar/Calendar.js +1 -1
  8. package/dist/Calendar/styles.d.ts +5 -14
  9. package/dist/Calendar/styles.d.ts.map +1 -1
  10. package/dist/Calendar/styles.js +15 -15
  11. package/dist/Card/Card.d.ts +12 -12
  12. package/dist/Card/Card.d.ts.map +1 -1
  13. package/dist/Card/Card.js +17 -9
  14. package/dist/Card/index.d.ts +35 -1
  15. package/dist/Card/index.d.ts.map +1 -1
  16. package/dist/Card/index.js +21 -1
  17. package/dist/DateInput/NativeDateField.d.ts.map +1 -1
  18. package/dist/DateInput/NativeDateField.js +23 -6
  19. package/dist/DateInput/TouchDateField.d.ts.map +1 -1
  20. package/dist/DateInput/TouchDateField.js +44 -19
  21. package/dist/DateInput/nativeDateSegments.d.ts +22 -0
  22. package/dist/DateInput/nativeDateSegments.d.ts.map +1 -0
  23. package/dist/DateInput/nativeDateSegments.js +111 -0
  24. package/dist/Dialog/Dialog.d.ts +16 -2
  25. package/dist/Dialog/Dialog.d.ts.map +1 -1
  26. package/dist/Dialog/Dialog.js +28 -7
  27. package/dist/HoverCard/HoverCard.d.ts.map +1 -1
  28. package/dist/HoverCard/HoverCard.js +55 -3
  29. package/dist/HoverCard/useHoverCard.d.ts +4 -1
  30. package/dist/HoverCard/useHoverCard.d.ts.map +1 -1
  31. package/dist/List/List.d.ts +1 -1
  32. package/dist/List/List.d.ts.map +1 -1
  33. package/dist/List/List.js +15 -4
  34. package/dist/Markdown/Markdown.d.ts +1 -1
  35. package/dist/Markdown/Markdown.d.ts.map +1 -1
  36. package/dist/Markdown/Markdown.js +20 -7
  37. package/dist/Markdown/parser.d.ts.map +1 -1
  38. package/dist/Markdown/parser.js +5 -3
  39. package/dist/MetadataList/MetadataListItem.d.ts +1 -1
  40. package/dist/MetadataList/MetadataListItem.d.ts.map +1 -1
  41. package/dist/MetadataList/MetadataListItem.js +4 -1
  42. package/dist/MultiSelector/MultiSelector.d.ts +18 -1
  43. package/dist/MultiSelector/MultiSelector.d.ts.map +1 -1
  44. package/dist/MultiSelector/MultiSelector.js +46 -5
  45. package/dist/NavMenu/NavHeadingMenu.d.ts +1 -1
  46. package/dist/NavMenu/NavHeadingMenu.d.ts.map +1 -1
  47. package/dist/NavMenu/NavHeadingMenu.js +7 -4
  48. package/dist/NumberInput/NumberInput.d.ts +6 -1
  49. package/dist/NumberInput/NumberInput.d.ts.map +1 -1
  50. package/dist/NumberInput/NumberInput.js +54 -104
  51. package/dist/NumberInput/numberInputCommit.d.ts +34 -0
  52. package/dist/NumberInput/numberInputCommit.d.ts.map +1 -0
  53. package/dist/NumberInput/numberInputCommit.js +71 -0
  54. package/dist/NumberInput/numberParser.d.ts +64 -0
  55. package/dist/NumberInput/numberParser.d.ts.map +1 -0
  56. package/dist/NumberInput/numberParser.js +350 -0
  57. package/dist/PowerSearch/PowerSearchValueEditor.d.ts.map +1 -1
  58. package/dist/PowerSearch/PowerSearchValueEditor.js +91 -18
  59. package/dist/SelectableCard/SelectableCard.d.ts.map +1 -1
  60. package/dist/SelectableCard/SelectableCard.js +9 -0
  61. package/dist/Selector/Selector.d.ts +17 -0
  62. package/dist/Selector/Selector.d.ts.map +1 -1
  63. package/dist/Selector/Selector.js +76 -14
  64. package/dist/Slider/Slider.d.ts.map +1 -1
  65. package/dist/Slider/Slider.js +34 -2
  66. package/dist/Table/plugins/filtering/useTableFiltering.d.ts.map +1 -1
  67. package/dist/Table/plugins/filtering/useTableFiltering.js +73 -4
  68. package/dist/Timestamp/Timestamp.d.ts +1 -1
  69. package/dist/Timestamp/Timestamp.d.ts.map +1 -1
  70. package/dist/Timestamp/Timestamp.js +10 -18
  71. package/dist/Toast/ToastViewport.d.ts.map +1 -1
  72. package/dist/Toast/ToastViewport.js +27 -8
  73. package/dist/Token/Token.d.ts +1 -1
  74. package/dist/Token/Token.d.ts.map +1 -1
  75. package/dist/Token/Token.js +20 -9
  76. package/dist/Token/TokenLink.d.ts +1 -1
  77. package/dist/Token/TokenLink.d.ts.map +1 -1
  78. package/dist/Token/TokenLink.js +5 -2
  79. package/dist/TopNav/TopNavMegaMenu.d.ts +1 -1
  80. package/dist/TopNav/TopNavMegaMenu.d.ts.map +1 -1
  81. package/dist/TopNav/TopNavMegaMenu.js +29 -9
  82. package/dist/TopNav/TopNavMenu.d.ts +1 -1
  83. package/dist/TopNav/TopNavMenu.d.ts.map +1 -1
  84. package/dist/TopNav/TopNavMenu.js +19 -5
  85. package/dist/TreeList/TreeList.d.ts +1 -1
  86. package/dist/TreeList/TreeList.d.ts.map +1 -1
  87. package/dist/TreeList/TreeList.js +7 -2
  88. package/dist/Typeahead/TypeaheadItem.d.ts +1 -1
  89. package/dist/Typeahead/TypeaheadItem.d.ts.map +1 -1
  90. package/dist/Typeahead/TypeaheadItem.js +7 -2
  91. package/dist/astryx.css +10 -4
  92. package/dist/theme/Theme.d.ts.map +1 -1
  93. package/dist/theme/Theme.js +46 -10
  94. package/dist/theme/generateThemeRules.d.ts +21 -0
  95. package/dist/theme/generateThemeRules.d.ts.map +1 -1
  96. package/dist/theme/generateThemeRules.js +26 -0
  97. package/locales/en.json +127 -3
  98. package/locales/pseudo.json +93 -0
  99. package/package.json +2 -2
  100. package/src/AlertDialog/AlertDialog.doc.mjs +114 -30
  101. package/src/AlertDialog/AlertDialog.test.tsx +211 -2
  102. package/src/AlertDialog/AlertDialog.tsx +62 -20
  103. package/src/AspectRatio/AspectRatio.doc.mjs +3 -3
  104. package/src/AspectRatio/AspectRatio.tsx +6 -6
  105. package/src/Button/Button.doc.mjs +2 -1
  106. package/src/Button/Button.test.tsx +19 -4
  107. package/src/Button/Button.tsx +7 -1
  108. package/src/ButtonGroup/ButtonGroup.doc.mjs +2 -2
  109. package/src/ButtonGroup/ButtonGroup.test.tsx +13 -0
  110. package/src/Calendar/Calendar.test.tsx +51 -0
  111. package/src/Calendar/Calendar.tsx +1 -1
  112. package/src/Calendar/styles.ts +49 -31
  113. package/src/Card/Card.doc.mjs +10 -7
  114. package/src/Card/Card.test.tsx +113 -19
  115. package/src/Card/Card.tsx +67 -89
  116. package/src/Card/index.ts +36 -1
  117. package/src/DateInput/DateInput.doc.mjs +2 -2
  118. package/src/DateInput/DateInputTouch.test.tsx +85 -30
  119. package/src/DateInput/NativeDateField.test.tsx +100 -30
  120. package/src/DateInput/NativeDateField.tsx +24 -6
  121. package/src/DateInput/TouchDateField.tsx +70 -20
  122. package/src/DateInput/nativeDateSegments.ts +127 -0
  123. package/src/Dialog/Dialog.test.tsx +185 -18
  124. package/src/Dialog/Dialog.tsx +35 -11
  125. package/src/HoverCard/HoverCard.test.tsx +54 -1
  126. package/src/HoverCard/HoverCard.tsx +74 -2
  127. package/src/HoverCard/useHoverCard.tsx +4 -1
  128. package/src/Layer/useLayer.test.tsx +62 -14
  129. package/src/List/List.test.tsx +38 -0
  130. package/src/List/List.tsx +8 -1
  131. package/src/Markdown/Markdown.test.tsx +37 -0
  132. package/src/Markdown/Markdown.tsx +16 -5
  133. package/src/Markdown/parser.test.ts +33 -0
  134. package/src/Markdown/parser.ts +9 -3
  135. package/src/MetadataList/MetadataList.test.tsx +75 -2
  136. package/src/MetadataList/MetadataListItem.tsx +5 -2
  137. package/src/MultiSelector/MultiSelector.doc.mjs +22 -1
  138. package/src/MultiSelector/MultiSelector.test.tsx +171 -0
  139. package/src/MultiSelector/MultiSelector.tsx +92 -5
  140. package/src/NavMenu/NavHeadingMenu.test.tsx +30 -0
  141. package/src/NavMenu/NavHeadingMenu.tsx +7 -4
  142. package/src/NumberInput/NumberInput.doc.mjs +26 -7
  143. package/src/NumberInput/NumberInput.test.tsx +436 -8
  144. package/src/NumberInput/NumberInput.tsx +62 -114
  145. package/src/NumberInput/numberInputCommit.test.ts +72 -0
  146. package/src/NumberInput/numberInputCommit.ts +103 -0
  147. package/src/NumberInput/numberParser.docblock.test.ts +234 -0
  148. package/src/NumberInput/numberParser.test.ts +222 -0
  149. package/src/NumberInput/numberParser.ts +403 -0
  150. package/src/Pagination/Pagination.test.tsx +3 -2
  151. package/src/PowerSearch/PowerSearchEditPopover.test.tsx +87 -0
  152. package/src/PowerSearch/PowerSearchValueEditor.test.tsx +64 -0
  153. package/src/PowerSearch/PowerSearchValueEditor.tsx +109 -10
  154. package/src/SelectableCard/SelectableCard.doc.mjs +3 -0
  155. package/src/SelectableCard/SelectableCard.tsx +16 -0
  156. package/src/Selector/Selector.doc.mjs +14 -0
  157. package/src/Selector/Selector.test.tsx +266 -0
  158. package/src/Selector/Selector.tsx +128 -15
  159. package/src/Slider/Slider.test.tsx +106 -1
  160. package/src/Slider/Slider.tsx +52 -1
  161. package/src/Stepper/Step.doc.mjs +1 -1
  162. package/src/Table/TableBody.doc.mjs +2 -2
  163. package/src/Table/TableHeader.doc.mjs +1 -1
  164. package/src/Table/plugins/filtering/useTableFiltering.test.tsx +44 -6
  165. package/src/Table/plugins/filtering/useTableFiltering.tsx +100 -4
  166. package/src/Table/useTablePagination.doc.mjs +1 -1
  167. package/src/Timestamp/Timestamp.test.tsx +58 -0
  168. package/src/Timestamp/Timestamp.tsx +8 -8
  169. package/src/Toast/ToastViewport.tsx +17 -1
  170. package/src/Token/Token.test.tsx +95 -0
  171. package/src/Token/Token.tsx +15 -10
  172. package/src/Token/TokenLink.tsx +12 -3
  173. package/src/TopNav/TopNavMegaMenu.test.tsx +104 -0
  174. package/src/TopNav/TopNavMegaMenu.tsx +45 -4
  175. package/src/TopNav/TopNavMenu.test.tsx +133 -1
  176. package/src/TopNav/TopNavMenu.tsx +35 -5
  177. package/src/TreeList/TreeList.test.tsx +49 -0
  178. package/src/TreeList/TreeList.tsx +7 -2
  179. package/src/Typeahead/TypeaheadItem.test.tsx +43 -0
  180. package/src/Typeahead/TypeaheadItem.tsx +8 -1
  181. package/src/raw-import.d.ts +14 -0
  182. package/src/theme/Theme.test.tsx +104 -2
  183. package/src/theme/Theme.tsx +49 -14
  184. package/src/theme/defineTheme.test.ts +23 -0
  185. package/src/theme/derivedVarRegistry.test.ts +4 -0
  186. package/src/theme/generateThemeRules.test.ts +62 -1
  187. package/src/theme/generateThemeRules.ts +28 -0
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @file AlertDialog.tsx
3
- * @input Uses React, Dialog, Layout, Heading, Text, Button
3
+ * @input Uses React, StyleX, Dialog, Layout, Heading, Text, Button
4
4
  * @output Exports AlertDialog component, AlertDialogProps type
5
5
  * @position Core implementation; consumed by index.ts, tested by AlertDialog.test.tsx
6
6
  *
@@ -1 +1 @@
1
- {"version":3,"file":"AlertDialog.d.ts","sourceRoot":"","sources":["../../src/AlertDialog/AlertDialog.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAA2B,MAAM,OAAO,CAAC;AAQhD,OAAO,EAAS,KAAK,aAAa,EAAC,MAAM,WAAW,CAAC;AACrD,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAK5C,MAAM,WAAW,gBAAiB,SAAQ,SAAS,CAAC,iBAAiB,CAAC;IACpE,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;IACnC;;OAEG;IACH,MAAM,EAAE,OAAO,CAAC;IAEhB;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;;OAGG;IACH,YAAY,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,OAAO,CAAC;IAE3C;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,WAAW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IAE3C;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;IAEpB;;;;OAIG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;IAEpB;;;OAGG;IACH,aAAa,CAAC,EAAE,aAAa,CAAC;IAE9B;;OAEG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAE1B;;;OAGG;IACH,QAAQ,EAAE,MAAM,OAAO,CAAC;IAExB;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CACzB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,WAAW,CAAC,EAC1B,GAAG,EACH,MAAM,EACN,QAAQ,EACR,YAAY,EACZ,KAAK,EACL,WAAW,EACX,WAAW,EAAE,oBAAoB,EACjC,WAAW,EACX,aAA6B,EAC7B,eAAe,EACf,QAAQ,EACR,KAAW,EACX,MAAM,EACN,SAAS,EACT,KAAK,EACL,aAAa,EAAE,MAAM,EACrB,GAAG,IAAI,EACR,EAAE,gBAAgB,qBA8FlB;yBAhHe,WAAW"}
@@ -4,7 +4,7 @@
4
4
 
5
5
  /**
6
6
  * @file AlertDialog.tsx
7
- * @input Uses React, Dialog, Layout, Heading, Text, Button
7
+ * @input Uses React, StyleX, Dialog, Layout, Heading, Text, Button
8
8
  * @output Exports AlertDialog component, AlertDialogProps type
9
9
  * @position Core implementation; consumed by index.ts, tested by AlertDialog.test.tsx
10
10
  *
@@ -16,18 +16,32 @@
16
16
  * - /packages/cli/assets/templates/blocks/components/AlertDialog/ (showcase blocks)
17
17
  */
18
18
  import React, { useId, useCallback } from 'react';
19
+ import * as stylex from '@stylexjs/stylex';
19
20
  import { Dialog } from "../Dialog/index.js";
20
21
  import { Layout } from "../Layout/Layout.js";
21
22
  import { LayoutContent } from "../Layout/LayoutContent.js";
22
23
  import { LayoutFooter } from "../Layout/LayoutFooter.js";
23
- import { HStack } from "../Stack/index.js";
24
+ import { Stack } from "../Stack/index.js";
24
25
  import { Heading } from "../Heading/Heading.js";
25
26
  import { Text } from "../Text/Text.js";
26
27
  import { Button } from "../Button/index.js";
27
28
  import { mergeProps } from "../utils/index.js";
28
29
  import { themeProps } from "../utils/themeProps.js";
29
30
  import { useTranslator } from "../i18n/index.js";
31
+ import { useMediaQuery } from "../hooks/index.js";
30
32
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
33
+ const SMALL_SCREEN_QUERY = '(max-width: 640px)';
34
+ const styles = {
35
+ action: {
36
+ ks0D6T: "x193iq5w",
37
+ k7Eaqz: "xeuugli",
38
+ $$css: true
39
+ },
40
+ stackedAction: {
41
+ kzqmXN: "xh8yej3",
42
+ $$css: true
43
+ }
44
+ };
31
45
  /**
32
46
  * A confirmation dialog for destructive or irreversible actions.
33
47
  *
@@ -77,9 +91,33 @@ export function AlertDialog({
77
91
  const cancelLabel = cancelLabelFromProps ?? t('@astryx.alertDialog.cancel');
78
92
  const titleId = useId();
79
93
  const descriptionId = useId();
94
+ // Width stays delegated to Dialog: this query exists only so AlertDialog can
95
+ // keep narrow visual, DOM, and tab order aligned for its destructive/cancel
96
+ // semantics without coupling action order to pointer or hover capability.
97
+ const isSmallScreen = useMediaQuery(SMALL_SCREEN_QUERY);
80
98
  const handleCancel = useCallback(() => {
81
99
  onOpenChange(false);
82
100
  }, [onOpenChange]);
101
+ const buttonActionStyle = [styles.action, isSmallScreen && styles.stackedAction];
102
+ const cancelButton = /*#__PURE__*/_jsx(Button, {
103
+ variant: "ghost",
104
+ label: cancelLabel,
105
+ onClick: handleCancel,
106
+ xstyle: buttonActionStyle
107
+ // Dialog focuses [data-autofocus] itself after showModal(), because
108
+ // React's autoFocus runs during commit while the dialog is invisible.
109
+ // Cancel is least destructive, so it remains the autofocus target even
110
+ // when small-screen visual order places the destructive action above it.
111
+ ,
112
+ "data-autofocus": true
113
+ }, "cancel");
114
+ const actionButton = /*#__PURE__*/_jsx(Button, {
115
+ variant: actionVariant,
116
+ label: actionLabel,
117
+ onClick: onAction,
118
+ isLoading: isActionLoading,
119
+ xstyle: buttonActionStyle
120
+ }, "action");
83
121
  return /*#__PURE__*/_jsx(Dialog, {
84
122
  ...rest,
85
123
  ref: ref,
@@ -117,25 +155,12 @@ export function AlertDialog({
117
155
  })]
118
156
  }),
119
157
  footer: /*#__PURE__*/_jsx(LayoutFooter, {
120
- children: /*#__PURE__*/_jsxs(HStack, {
158
+ children: /*#__PURE__*/_jsx(Stack, {
159
+ direction: isSmallScreen ? 'vertical' : 'horizontal',
121
160
  gap: 2,
122
- hAlign: "end",
123
- children: [/*#__PURE__*/_jsx(Button, {
124
- variant: "ghost",
125
- label: cancelLabel,
126
- onClick: handleCancel
127
- // Dialog focuses [data-autofocus] itself after showModal(),
128
- // because React's autoFocus runs during commit while the
129
- // dialog is still invisible. Cancel is the least destructive
130
- // choice, so it is the one that should be preselected.
131
- ,
132
- "data-autofocus": true
133
- }), /*#__PURE__*/_jsx(Button, {
134
- variant: actionVariant,
135
- label: actionLabel,
136
- onClick: onAction,
137
- isLoading: isActionLoading
138
- })]
161
+ hAlign: isSmallScreen ? 'stretch' : 'end',
162
+ wrap: isSmallScreen ? 'nowrap' : 'wrap',
163
+ children: isSmallScreen ? [actionButton, cancelButton] : [cancelButton, actionButton]
139
164
  })
140
165
  })
141
166
  })
@@ -44,14 +44,14 @@ export interface AspectRatioProps extends BaseProps<HTMLDivElement> {
44
44
  * `astryx-base` cascade layer, and unlayered CSS wins over layered
45
45
  * rules regardless of specificity.
46
46
  *
47
+ * A responsive ratio is set in CSS, not on the component. For example, a 3:1
48
+ * hero can become 3:2 when its container narrows by targeting the element's
49
+ * class from a container query:
50
+ * `@container gallery (max-width: 720px) { .gallery-hero { aspect-ratio: 3 / 2; } }`.
51
+ *
47
52
  * @example
48
53
  * ```
49
- * // 3:1 hero that becomes 3:2 when its container stacks
50
- * <AspectRatio ratio={3 / 1} className="gallery-hero">…</AspectRatio>
51
- *
52
- * // CSS: @container gallery (max-width: 720px) {
53
- * // .gallery-hero { aspect-ratio: 3 / 2; }
54
- * // }
54
+ * <AspectRatio ratio={3 / 1} className="gallery-hero">...</AspectRatio>
55
55
  * ```
56
56
  */
57
57
  ratio: number;
@@ -1 +1 @@
1
- {"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../src/Button/Button.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAwB,KAAK,SAAS,EAAC,MAAM,OAAO,CAAC;AAC5D,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAC5C,OAAO,KAAK,EAAC,SAAS,EAAE,SAAS,EAAC,MAAM,gBAAgB,CAAC;AACzD,OAAO,KAAK,MAAM,MAAM,kBAAkB,CAAC;AAwB3C,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,eAAe,CAAC;AAIrD,OAAO,KAAK,EAAC,gBAAgB,EAAC,MAAM,SAAS,CAAC;AA0G9C,QAAA,MAAM,UAAU;;;;;;;;;;EAUd,CAAC;AAkFH;;;GAGG;AACH,MAAM,MAAM,aAAa,GAAG,MAAM,gBAAgB,CAAC;AAEnD;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG,MAAM,OAAO,UAAU,CAAC;AAEjD,MAAM,WAAW,WAAY,SAAQ,SAAS,CAAC,iBAAiB,CAAC;IAC/D,wCAAwC;IACxC,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;IACnC,oDAAoD;IACpD,IAAI,CAAC,EAAE,QAAQ,GAAG,QAAQ,GAAG,OAAO,CAAC;IACrC,+CAA+C;IAC/C,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,gDAAgD;IAChD,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,aAAa,CAAC,MAAM,CAAC,CAAC;IAChD,uDAAuD;IACvD,IAAI,CAAC,EAAE,MAAM,CAA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EACL,OAAqB,EACrB,IAAI,EAAE,QAAQ,EACd,IAAe,EACf,UAAkB,EAClB,SAAiB,EACjB,eAAuB,EACvB,WAAW,EACX,IAAI,EACJ,UAAkB,EAClB,KAAK,EACL,SAAkB,EAClB,QAAQ,EACR,UAAU,EACV,OAAO,EACP,IAAI,EACJ,EAAE,EACF,MAAM,EACN,GAAG,EACH,MAAM,EACN,SAAS,EACT,KAAK,EACL,GAAG,EACH,GAAG,KAAK,EACT,EAAE,WAAW,GAAG,SAAS,CAmPzB;yBA5Qe,MAAM"}
@@ -445,9 +445,13 @@ export function Button({
445
445
  // for every variant, and `destructive` re-colors just the ring to match
446
446
  // its own surface. Ordering is the mechanism — StyleX is last-wins.
447
447
  variants[variant], xstyle);
448
- const sharedMergedProps = mergeProps(themeProps('button', {
448
+ const sharedMergedProps = mergeProps(
449
+ // Inside a group the group owns the surface's elevation, so the button
450
+ // reflects the tier it actually paints rather than the prop it was handed.
451
+ themeProps('button', {
449
452
  variant,
450
- size
453
+ size,
454
+ elevation: buttonGroup ? 'none' : elevation
451
455
  }), sharedStylexProps, className, style);
452
456
  const buttonContent = /*#__PURE__*/_jsxs(_Fragment, {
453
457
  children: [isLoadingState && /*#__PURE__*/_jsx("span", {
@@ -261,7 +261,7 @@ export function Calendar({
261
261
  if (plainDateIsEqual(date, startPd)) {
262
262
  setRangeSelectionStart(null);
263
263
  announce(t('@astryx.calendar.rangeClearedAnnounce', {
264
- date: plainDateFormat(date, DATE_FORMAT_WITH_WEEKDAY)
264
+ date: plainDateFormat(date, DATE_FORMAT_WITH_WEEKDAY, locale)
265
265
  }));
266
266
  return;
267
267
  }
@@ -33,19 +33,9 @@ export declare const calendarStyles: Readonly<{
33
33
  }>;
34
34
  readonly monthsContainer: Readonly<{
35
35
  readonly display: stylex.StyleXClassNameFor<"display", "flex">;
36
+ readonly flexWrap: stylex.StyleXClassNameFor<"flexWrap", "wrap">;
36
37
  readonly gap: stylex.StyleXClassNameFor<"gap", "16px">;
37
38
  }>;
38
- readonly srOnly: Readonly<{
39
- readonly position: stylex.StyleXClassNameFor<"position", "absolute">;
40
- readonly width: stylex.StyleXClassNameFor<"width", "1px">;
41
- readonly height: stylex.StyleXClassNameFor<"height", "1px">;
42
- readonly padding: stylex.StyleXClassNameFor<"padding", 0>;
43
- readonly margin: stylex.StyleXClassNameFor<"margin", "-1px">;
44
- readonly overflow: stylex.StyleXClassNameFor<"overflow", "hidden">;
45
- readonly clip: stylex.StyleXClassNameFor<"clip", "rect(0, 0, 0, 0)">;
46
- readonly whiteSpace: stylex.StyleXClassNameFor<"whiteSpace", "nowrap">;
47
- readonly borderWidth: stylex.StyleXClassNameFor<"borderWidth", 0>;
48
- }>;
49
39
  readonly navIcon: Readonly<{
50
40
  readonly display: stylex.StyleXClassNameFor<"display", "inline-flex">;
51
41
  }>;
@@ -154,7 +144,7 @@ export declare const dayCellStyles: Readonly<{
154
144
  readonly display: stylex.StyleXClassNameFor<"display", "flex">;
155
145
  readonly alignItems: stylex.StyleXClassNameFor<"alignItems", "center">;
156
146
  readonly justifyContent: stylex.StyleXClassNameFor<"justifyContent", "center">;
157
- readonly borderRadius: stylex.StyleXClassNameFor<"borderRadius", "50%">;
147
+ readonly borderRadius: stylex.StyleXClassNameFor<"borderRadius", "9999px">;
158
148
  readonly borderWidth: stylex.StyleXClassNameFor<"borderWidth", 0>;
159
149
  readonly borderStyle: stylex.StyleXClassNameFor<"borderStyle", "none">;
160
150
  readonly cursor: stylex.StyleXClassNameFor<"cursor", "default" | "pointer">;
@@ -209,8 +199,9 @@ export declare const dayCellTheme: Readonly<{
209
199
  readonly boxShadow: stylex.StyleXClassNameFor<"boxShadow", `inset 0 0 0 1px ${stylex.StyleXVar<"light-dark(#0A1317, #DFE2E5)">}`>;
210
200
  }>;
211
201
  readonly daySelected: Readonly<{
212
- readonly backgroundColor: stylex.StyleXClassNameFor<"backgroundColor", "light-dark(#0064E0, #2694FE)">;
213
- readonly color: stylex.StyleXClassNameFor<"color", "light-dark(#FFFFFF, #FFFFFF)">;
202
+ readonly forcedColorAdjust: stylex.StyleXClassNameFor<"forcedColorAdjust", "none">;
203
+ readonly backgroundColor: stylex.StyleXClassNameFor<"backgroundColor", "light-dark(#0064E0, #2694FE)" | "Highlight">;
204
+ readonly color: stylex.StyleXClassNameFor<"color", "light-dark(#FFFFFF, #FFFFFF)" | "HighlightText">;
214
205
  readonly backgroundImage: stylex.StyleXClassNameFor<"backgroundImage", {
215
206
  readonly '@media (hover: hover)': `linear-gradient(${stylex.StyleXVar<"light-dark(#0536590C, #FFFFFF0C)">}, ${stylex.StyleXVar<"light-dark(#0536590C, #FFFFFF0C)">})`;
216
207
  } | null>;
@@ -1 +1 @@
1
- {"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../src/Calendar/styles.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,MAAM,MAAM,kBAAkB,CAAC;AAgB3C,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA2CzB,CAAC;AAMH,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAuC1B,CAAC;AAMH,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA+GxB,CAAC;AAMH,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA4DvB,CAAC"}
1
+ {"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../src/Calendar/styles.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,MAAM,MAAM,kBAAkB,CAAC;AAgB3C,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAoCzB,CAAC;AAMH,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAuC1B,CAAC;AAiBH,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA+GxB,CAAC;AAMH,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA0EvB,CAAC"}
@@ -46,21 +46,10 @@ export const calendarStyles = {
46
46
  },
47
47
  monthsContainer: {
48
48
  k1xSpc: "x78zum5",
49
+ kwnvtZ: "x1a02dak",
49
50
  kOIVth: "x18g69wz",
50
51
  $$css: true
51
52
  },
52
- srOnly: {
53
- kVAEAm: "x10l6tqk",
54
- kzqmXN: "x1i1rx1s",
55
- kZKoxP: "xjm9jq1",
56
- kmVPX3: "x1717udv",
57
- kogj98: "xkdpibf",
58
- kVQacm: "xb3r6kr",
59
- kMcinP: "xzpqnlu",
60
- khDVqt: "xuxw1ft",
61
- kMzoRj: "xc342km",
62
- $$css: true
63
- },
64
53
  navIcon: {
65
54
  k1xSpc: "x3nfvp2",
66
55
  $$css: true
@@ -122,6 +111,16 @@ export const monthGridStyles = {
122
111
  // Day Cell Styles - Structural (layout, sizing, positioning)
123
112
  // =============================================================================
124
113
 
114
+ // Half the gap between the day button and its cell — (--size-element-md minus
115
+ // --size-element-sm) / 2 — so the band's rounded caps line up with the button
116
+ // and the button's ::before bleeds out to meet its neighbour's. Deliberately a
117
+ // literal and NOT a spacing token: this is a layout value derived from the two
118
+ // size tokens, and pinning it to --spacing-0-5 desynchronises it from them
119
+ // (matcha sets that step to 3px, which overlaps adjacent days' hit targets by
120
+ // 2px). Deriving it with calc() from the size tokens would be better still and
121
+ // would close butter's 4px dead gap; that needs its own measured change.
122
+ const BAND_INSET = '2px';
123
+ const HIT_BLEED = '-2px';
125
124
  export const dayCellStyles = {
126
125
  cell: {
127
126
  kVAEAm: "x1n2onr6",
@@ -198,7 +197,7 @@ export const dayCellStyles = {
198
197
  k1xSpc: "x78zum5",
199
198
  kGNEyG: "x6s0dn4",
200
199
  kjj79g: "xl56j7k",
201
- kaIpWk: "x16rqkct",
200
+ kaIpWk: "xjspbzw",
202
201
  kMzoRj: "xc342km",
203
202
  ksu8eU: "xng3xce",
204
203
  kkrTdU: "x1ypdohk x16khyan",
@@ -269,8 +268,9 @@ export const dayCellTheme = {
269
268
  $$css: true
270
269
  },
271
270
  daySelected: {
272
- kWkggS: "x1ewilqj",
273
- kMwMTN: "x17wrial",
271
+ kAXs8y: "x1kzknox",
272
+ kWkggS: "x1ewilqj x1jzqe4",
273
+ kMwMTN: "x17wrial x1k5gbb1",
274
274
  kKwaWg: "xmvprkv",
275
275
  $$css: true
276
276
  },
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @file Card.tsx
3
3
  * @input Uses container utility, StyleX
4
- * @output Exports Card component and CardProps
4
+ * @output Exports Card component, CardProps, CardVariant types
5
5
  * @position Core card container component
6
6
  *
7
7
  * SYNC: When modified, update these files to stay in sync:
@@ -13,8 +13,11 @@
13
13
  import type { ReactNode } from 'react';
14
14
  import type { Elevation, SizeValue, SpacingStep } from '../utils/types';
15
15
  import type { BaseProps } from '../BaseProps';
16
+ import type { CardVariantMap } from './index';
16
17
  /**
17
- * Background color variant for Card.
18
+ * Background color variant for Card, derived from CardVariantMap.
19
+ * Extensible via module augmentation of CardVariantMap.
20
+ *
18
21
  * - `default`: standard card background with visible border
19
22
  * - `transparent`: no background, no visible border — for grouping content without visual weight
20
23
  * - `muted`: subtle muted background for de-emphasised cards
@@ -26,18 +29,10 @@ import type { BaseProps } from '../BaseProps';
26
29
  * keeping content geometry faithful to the spacing scale and identical to the
27
30
  * borderless variants. Themes can override borderWidth/borderColor.
28
31
  */
29
- export type CardVariant = 'default' | 'transparent' | 'muted' | 'blue' | 'cyan' | 'gray' | 'green' | 'orange' | 'pink' | 'purple' | 'red' | 'teal' | 'yellow';
32
+ export type CardVariant = keyof CardVariantMap;
30
33
  export type { SizeValue } from '../utils/types';
31
34
  export interface CardProps extends BaseProps<HTMLDivElement> {
32
35
  ref?: React.Ref<HTMLDivElement>;
33
- /**
34
- * CSS class name(s) appended to the root element.
35
- */
36
- className?: string;
37
- /**
38
- * Inline styles to apply to the root element.
39
- */
40
- style?: React.CSSProperties;
41
36
  /**
42
37
  * Width of the card.
43
38
  * Numbers are treated as pixels, strings are used as-is.
@@ -66,7 +61,12 @@ export interface CardProps extends BaseProps<HTMLDivElement> {
66
61
  /**
67
62
  * Internal padding of the card using the spacing scale.
68
63
  * Accepts numeric spacing steps: 0, 0.5, 1, 1.5, 2, 3, 4, 5, 6, 8, 10.
69
- * @default 4 (16px)
64
+ *
65
+ * Omit it and the card takes the theme's card padding rather than a step, so
66
+ * passing a step is a decision to override the theme, not a way to restate
67
+ * the default.
68
+ *
69
+ * @default the theme's card padding (spacing step 4 with no theme)
70
70
  */
71
71
  padding?: SpacingStep;
72
72
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"Card.d.ts","sourceRoot":"","sources":["../../src/Card/Card.tsx"],"names":[],"mappings":"AAEA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,OAAO,CAAC;AAiBrC,OAAO,KAAK,EAAC,SAAS,EAAE,SAAS,EAAE,WAAW,EAAC,MAAM,gBAAgB,CAAC;AAEtE,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAO5C;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,WAAW,GACnB,SAAS,GACT,aAAa,GACb,OAAO,GACP,MAAM,GACN,MAAM,GACN,MAAM,GACN,OAAO,GACP,QAAQ,GACR,MAAM,GACN,QAAQ,GACR,KAAK,GACL,MAAM,GACN,QAAQ,CAAC;AA2Gb,YAAY,EAAC,SAAS,EAAC,MAAM,gBAAgB,CAAC;AAE9C,MAAM,WAAW,SAAU,SAAQ,SAAS,CAAC,cAAc,CAAC;IAC1D,GAAG,CAA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MAAM,WAAW,GAAG,MAAM,cAAc,CAAC;AAgH/C,YAAY,EAAC,SAAS,EAAC,MAAM,gBAAgB,CAAC;AAE9C,MAAM,WAAW,SAAU,SAAQ,SAAS,CAAC,cAAc,CAAC;IAC1D,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;IAChC;;;OAGG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC;IAElB;;;OAGG;IACH,MAAM,CAAC,EAAE,SAAS,CAAC;IAEnB;;;OAGG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;IAErB;;;OAGG;IACH,SAAS,CAAC,EAAE,SAAS,CAAC;IAEtB;;;OAGG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;IAErB;;;;;;;;;OASG;IACH,OAAO,CAAC,EAAE,WAAW,CAAC;IAEtB;;;;;;;OAOG;IACH,OAAO,CAAC,EAAE,WAAW,CAAC;IAEtB;;;;OAIG;IACH,SAAS,CAAC,EAAE,SAAS,CAAC;CACvB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,wBAAgB,IAAI,CAAC,EACnB,KAAK,EACL,MAAM,EACN,QAAQ,EACR,SAAS,EACT,QAAQ,EACR,OAAO,EACP,OAAmB,EACnB,SAAkB,EAClB,MAAM,EACN,SAAS,EACT,KAAK,EACL,GAAG,EACH,GAAG,KAAK,EACT,EAAE,SAAS,+BAkDX;yBAhEe,IAAI"}
package/dist/Card/Card.js CHANGED
@@ -3,7 +3,7 @@
3
3
  /**
4
4
  * @file Card.tsx
5
5
  * @input Uses container utility, StyleX
6
- * @output Exports Card component and CardProps
6
+ * @output Exports Card component, CardProps, CardVariant types
7
7
  * @position Core card container component
8
8
  *
9
9
  * SYNC: When modified, update these files to stay in sync:
@@ -17,7 +17,7 @@ import * as stylex from '@stylexjs/stylex';
17
17
  import "../theme/tokens.stylex.js";
18
18
  import { borderVars, colorVars, radiusVars, shadowVars } from "../theme/tokens.stylex.js";
19
19
  import { container } from "../Layout/container.stylex.js";
20
- import { paddingStyles, containerPaddingInlineVarStyles, containerPaddingBlockStartVarStyles, containerPaddingBlockEndVarStyles, spacingStepToToken } from "../Layout/padding.stylex.js";
20
+ import { spacingStepToToken } from "../Layout/padding.stylex.js";
21
21
  import { mergeProps } from "../utils/index.js";
22
22
  import { themeProps } from "../utils/themeProps.js";
23
23
 
@@ -26,7 +26,9 @@ import { themeProps } from "../utils/themeProps.js";
26
26
  // =============================================================================
27
27
 
28
28
  /**
29
- * Background color variant for Card.
29
+ * Background color variant for Card, derived from CardVariantMap.
30
+ * Extensible via module augmentation of CardVariantMap.
31
+ *
30
32
  * - `default`: standard card background with visible border
31
33
  * - `transparent`: no background, no visible border — for grouping content without visual weight
32
34
  * - `muted`: subtle muted background for de-emphasised cards
@@ -67,7 +69,10 @@ const styles = {
67
69
  }
68
70
  };
69
71
 
70
- // Background variant styles — each maps to a design token
72
+ // Background variant styles — each maps to a design token. Typed as PARTIAL
73
+ // over CardVariant: a theme can add a variant, and the record deliberately has
74
+ // no entry for it, so the lookup is undefined, StyleX drops it, and the card
75
+ // takes base styles for the theme rule to paint over.
71
76
  const variantStyles = {
72
77
  default: {
73
78
  kWkggS: "x1de1mus",
@@ -216,20 +221,23 @@ export function Card({
216
221
 
217
222
  // When no explicit padding prop, use theme default (set via container tokens)
218
223
  const useThemeDefault = padding == null;
219
- const effectivePadding = padding ?? 4;
220
- const paddingToken = spacingStepToToken[effectivePadding];
224
+ const paddingToken = useThemeDefault ? undefined : spacingStepToToken[padding];
221
225
  return /*#__PURE__*/_jsx("div", {
222
226
  ref: ref,
223
227
  ...mergeProps(themeProps('card', {
224
- variant
225
- }), stylex.props(styles.card, variantStyles[variant], elevationStyles[elevation], hasFixedHeight && styles.scrollable, dynamicStyles.sizing(width ?? null, height ?? null, maxWidth ?? null, minHeight ?? null), ...container(useThemeDefault ? {
228
+ variant,
229
+ elevation
230
+ }), stylex.props(styles.card,
231
+ // A theme's own variant is not a key here: the lookup is undefined,
232
+ // StyleX drops it, and the theme rule paints over base styles.
233
+ variantStyles[variant], elevationStyles[elevation], hasFixedHeight && styles.scrollable, dynamicStyles.sizing(width ?? null, height ?? null, maxWidth ?? null, minHeight ?? null), ...container(paddingToken == null ? {
226
234
  useThemeDefault: 'card'
227
235
  } : {
228
236
  paddingInnerX: paddingToken,
229
237
  paddingInnerY: paddingToken,
230
238
  paddingOuterX: paddingToken,
231
239
  paddingOuterY: paddingToken
232
- }), !useThemeDefault && effectivePadding !== 4 && paddingStyles[effectivePadding], !useThemeDefault && effectivePadding !== 4 && containerPaddingInlineVarStyles[effectivePadding], !useThemeDefault && effectivePadding !== 4 && containerPaddingBlockStartVarStyles[effectivePadding], !useThemeDefault && effectivePadding !== 4 && containerPaddingBlockEndVarStyles[effectivePadding],
240
+ }),
233
241
  // Applied after the container padding so the border-inset calc wins;
234
242
  // it reads the --container-padding-* vars set above.
235
243
  variant === 'default' && styles.withBorder, xstyle), className, style),
@@ -1,11 +1,45 @@
1
1
  /**
2
2
  * @file index.ts
3
3
  * @input Imports Card component
4
- * @output Exports Card component and types
4
+ * @output Exports Card, CardProps, CardVariant, CardVariantMap
5
5
  * @position Entry point for @astryxdesign/core/Card module
6
6
  *
7
7
  * SYNC: When modified, update /packages/core/src/Card/Card.doc.mjs
8
8
  */
9
+ /**
10
+ * Extensible variant map for Card.
11
+ *
12
+ * Theme packages can add custom variants via TypeScript module augmentation:
13
+ * @example
14
+ * ```
15
+ * declare module '@astryxdesign/core/Card' {
16
+ * interface CardVariantMap {
17
+ * 'brand': true;
18
+ * }
19
+ * }
20
+ * ```
21
+ *
22
+ * Pair the theme rule's `backgroundColor` with `--selectable-card-ring-color`.
23
+ * SelectableCard rings an added variant in that var, defaulting to the accent —
24
+ * no token the component could pick is guaranteed to contrast with a fill it
25
+ * cannot know, so the theme that supplied the fill picks the ring, in the same
26
+ * rule.
27
+ */
28
+ export interface CardVariantMap {
29
+ default: true;
30
+ transparent: true;
31
+ muted: true;
32
+ blue: true;
33
+ cyan: true;
34
+ gray: true;
35
+ green: true;
36
+ orange: true;
37
+ pink: true;
38
+ purple: true;
39
+ red: true;
40
+ teal: true;
41
+ yellow: true;
42
+ }
9
43
  export { Card } from './Card';
10
44
  export type { CardProps, CardVariant, SizeValue } from './Card';
11
45
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/Card/index.ts"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AAEH,OAAO,EAAC,IAAI,EAAC,MAAM,QAAQ,CAAC;AAC5B,YAAY,EAAC,SAAS,EAAE,WAAW,EAAE,SAAS,EAAC,MAAM,QAAQ,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/Card/index.ts"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AAEH;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,IAAI,CAAC;IACd,WAAW,EAAE,IAAI,CAAC;IAClB,KAAK,EAAE,IAAI,CAAC;IACZ,IAAI,EAAE,IAAI,CAAC;IACX,IAAI,EAAE,IAAI,CAAC;IACX,IAAI,EAAE,IAAI,CAAC;IACX,KAAK,EAAE,IAAI,CAAC;IACZ,MAAM,EAAE,IAAI,CAAC;IACb,IAAI,EAAE,IAAI,CAAC;IACX,MAAM,EAAE,IAAI,CAAC;IACb,GAAG,EAAE,IAAI,CAAC;IACV,IAAI,EAAE,IAAI,CAAC;IACX,MAAM,EAAE,IAAI,CAAC;CACd;AAED,OAAO,EAAC,IAAI,EAAC,MAAM,QAAQ,CAAC;AAC5B,YAAY,EAAC,SAAS,EAAE,WAAW,EAAE,SAAS,EAAC,MAAM,QAAQ,CAAC"}
@@ -3,10 +3,30 @@
3
3
  /**
4
4
  * @file index.ts
5
5
  * @input Imports Card component
6
- * @output Exports Card component and types
6
+ * @output Exports Card, CardProps, CardVariant, CardVariantMap
7
7
  * @position Entry point for @astryxdesign/core/Card module
8
8
  *
9
9
  * SYNC: When modified, update /packages/core/src/Card/Card.doc.mjs
10
10
  */
11
11
 
12
+ /**
13
+ * Extensible variant map for Card.
14
+ *
15
+ * Theme packages can add custom variants via TypeScript module augmentation:
16
+ * @example
17
+ * ```
18
+ * declare module '@astryxdesign/core/Card' {
19
+ * interface CardVariantMap {
20
+ * 'brand': true;
21
+ * }
22
+ * }
23
+ * ```
24
+ *
25
+ * Pair the theme rule's `backgroundColor` with `--selectable-card-ring-color`.
26
+ * SelectableCard rings an added variant in that var, defaulting to the accent —
27
+ * no token the component could pick is guaranteed to contrast with a fill it
28
+ * cannot know, so the theme that supplied the fill picks the ring, in the same
29
+ * rule.
30
+ */
31
+
12
32
  export { Card } from "./Card.js";
@@ -1 +1 @@
1
- {"version":3,"file":"NativeDateField.d.ts","sourceRoot":"","sources":["../../src/DateInput/NativeDateField.tsx"],"names":[],"mappings":"AA8BA,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,aAAa,CAAC;AAwLhD;;;GAGG;AACH,wBAAgB,eAAe,CAAC,EAC9B,KAAK,EACL,aAAqB,EACrB,WAAW,EACX,UAAkB,EAClB,UAAkB,EAClB,UAAkB,EAClB,eAAe,EACf,KAAK,EACL,QAAQ,EACR,SAAiB,EACjB,GAAG,EACH,GAAG,EACH,eAAe,EACf,WAAW,EAAE,oBAAoB,EACjC,IAAI,EAAE,QAAQ,EACd,MAAM,EACN,aAA0B,EAC1B,YAAY,EACZ,QAAgB,EAGhB,cAAc,EAAE,eAAe,EAC/B,YAAY,EAAE,aAAa,EAC3B,MAAoB,EACpB,KAAK,EACL,MAAM,EACN,SAAS,EACT,KAAK,EACL,GAAG,EACH,GAAG,IAAI,EACR,EAAE,cAAc,+BAmXhB;yBAlZe,eAAe"}
1
+ {"version":3,"file":"NativeDateField.d.ts","sourceRoot":"","sources":["../../src/DateInput/NativeDateField.tsx"],"names":[],"mappings":"AA+BA,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,aAAa,CAAC;AA0LhD;;;GAGG;AACH,wBAAgB,eAAe,CAAC,EAC9B,KAAK,EACL,aAAqB,EACrB,WAAW,EACX,UAAkB,EAClB,UAAkB,EAClB,UAAkB,EAClB,eAAe,EACf,KAAK,EACL,QAAQ,EACR,SAAiB,EACjB,GAAG,EACH,GAAG,EACH,eAAe,EACf,WAAW,EAAE,oBAAoB,EACjC,IAAI,EAAE,QAAQ,EACd,MAAM,EACN,aAA0B,EAC1B,YAAY,EACZ,QAAgB,EAGhB,cAAc,EAAE,eAAe,EAC/B,YAAY,EAAE,aAAa,EAC3B,MAAoB,EACpB,KAAK,EACL,MAAM,EACN,SAAS,EACT,KAAK,EACL,GAAG,EACH,GAAG,IAAI,EACR,EAAE,cAAc,+BAkYhB;yBAjae,eAAe"}
@@ -4,7 +4,7 @@
4
4
 
5
5
  /**
6
6
  * @file NativeDateField.tsx
7
- * @input Uses React, Field, Icon, InputClearButton, Spinner, useCalendarConstraints
7
+ * @input Uses React, Field, Icon, InputClearButton, Spinner, useCalendarConstraints, hasEditableDateSegments
8
8
  * @output Exports NativeDateField — the OS-picker touch surface
9
9
  * @position One of DateInput's three surfaces. `DateInput` picks the pointer
10
10
  * field on a mouse and, on touch, either `TouchDateField` (the default) or
@@ -22,13 +22,16 @@
22
22
  * SYNC: When modified, update these files to stay in sync:
23
23
  * - /packages/core/src/DateInput/DateInput.tsx (the `nativePicker` prop)
24
24
  * - /packages/core/src/DateInput/DateInput.doc.mjs (prop table)
25
- * - /packages/core/src/DateInput/DateInputNative.test.tsx (tests)
25
+ * - /packages/core/src/DateInput/nativeDateSegments.ts (the engine probe)
26
+ * - /packages/core/src/DateInput/NativeDateField.test.tsx (tests)
26
27
  */
27
28
  import { useCallback, useEffect, useId, useRef, useState } from 'react';
28
29
  import * as stylex from '@stylexjs/stylex';
29
30
  import { useCalendarConstraints } from "../Calendar/index.js";
31
+ import { hasEditableDateSegments } from "./nativeDateSegments.js";
30
32
  import { Field, InputClearButton, inputStatusBorderStyles, inputStatusFocusWithinStyles, inputStatusHoverShadowStyles, inputWrapperStyles } from "../Field/index.js";
31
33
  import { useInputStatusIcon, useMergedRefs } from "../hooks/index.js";
34
+ import { useMediaQuery } from "../hooks/useMediaQuery.js";
32
35
  import { useResolvedRequired } from "../hooks/useResolvedRequired.js";
33
36
  import { Icon } from "../Icon/index.js";
34
37
  import { useLocale, useTranslator } from "../i18n/index.js";
@@ -129,6 +132,8 @@ export function NativeDateField({
129
132
  });
130
133
  const placeholder = placeholderFromProps ?? t('@astryx.dateInput.placeholder');
131
134
  const size = useSize(sizeProp, 'md');
135
+ // Only breaks a tie the engine probe cannot: see ./nativeDateSegments.
136
+ const isTouchPointer = useMediaQuery('(pointer: coarse)');
132
137
  const id = useId();
133
138
  const inputLabelID = useId();
134
139
  const descriptionID = useId();
@@ -173,6 +178,10 @@ export function NativeDateField({
173
178
  // Whether the control has focus — which, on a touch device, means its
174
179
  // picker is open.
175
180
  const [isFocused, setIsFocused] = useState(false);
181
+ // Whether the engine draws this control as editable segments rather than a
182
+ // picker-only run. Latched on focus rather than read during render: the
183
+ // probe touches the DOM, and unfocused the answer changes nothing.
184
+ const [isSegmentEditable, setIsSegmentEditable] = useState(false);
176
185
  // The raw value the control last reported and we acted on, so the same edit
177
186
  // arriving through both commit paths only fires one change.
178
187
  const lastCommitRef = useRef(null);
@@ -192,10 +201,14 @@ export function NativeDateField({
192
201
  const formatValue = useCallback(iso => typeof format === 'function' ? format(iso) : formatSharedDate(plainDateFromISO(iso), format, locale), [format, locale]);
193
202
 
194
203
  // This field paints the closed control's text itself, which is what keeps
195
- // `format` and `placeholder` applying: the OS picker has no segments to
196
- // edit, so our text holds even while the picker is open, and tracks it live.
204
+ // `format` and `placeholder` applying: a picker-only control has no
205
+ // segments to edit, so our text holds even while the picker is open, and
206
+ // tracks it live. An editable control is the opposite case — its text IS
207
+ // the edit surface, and it reports no `value` until every segment is
208
+ // filled, so the overlay has nothing to paint mid-edit — so step aside for
209
+ // as long as it has focus. See ./nativeDateSegments.
197
210
  const overlayText = nativeValue ? formatValue(nativeValue) : placeholder;
198
- const showsOverlay = !!overlayText;
211
+ const showsOverlay = !!overlayText && !(isFocused && isSegmentEditable);
199
212
  const commitValue = useCallback(newValue => {
200
213
  if (isEffectivelyDisabled) {
201
214
  return;
@@ -286,6 +299,10 @@ export function NativeDateField({
286
299
  input.value = nativeValue;
287
300
  }
288
301
  }, [isFocused, nativeValue]);
302
+ const handleFocus = useCallback(() => {
303
+ setIsSegmentEditable(hasEditableDateSegments(isTouchPointer));
304
+ setIsFocused(true);
305
+ }, [isTouchPointer]);
289
306
  const handleBlur = useCallback(() => {
290
307
  const domValue = inputRef.current?.value;
291
308
  setIsFocused(false);
@@ -368,7 +385,7 @@ export function NativeDateField({
368
385
  ,
369
386
  defaultValue: initialValueRef.current ?? '',
370
387
  onChange: handleChange,
371
- onFocus: () => setIsFocused(true),
388
+ onFocus: handleFocus,
372
389
  onBlur: handleBlur,
373
390
  min: min,
374
391
  max: max,
@@ -1 +1 @@
1
- {"version":3,"file":"TouchDateField.d.ts","sourceRoot":"","sources":["../../src/DateInput/TouchDateField.tsx"],"names":[],"mappings":"AA4DA,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,aAAa,CAAC;AAgchD;;;GAGG;AACH,wBAAgB,cAAc,CAAC,EAC7B,KAAK,EACL,aAAqB,EACrB,WAAW,EACX,UAAkB,EAClB,UAAkB,EAClB,UAAkB,EAClB,eAAe,EACf,KAAK,EACL,QAAQ,EACR,YAAY,EACZ,SAAiB,EACjB,GAAG,EACH,GAAG,EACH,eAAe,EACf,WAAW,EAAE,oBAAoB,EACjC,IAAI,EAAE,QAAQ,EACd,MAAM,EACN,aAA0B,EAC1B,YAAY,EACZ,QAAgB,EAIhB,cAAc,EAAE,eAAe,EAC/B,YAAY,EAAE,gBAAoB,EAClC,MAAoB,EACpB,KAAK,EACL,MAAM,EACN,SAAS,EACT,KAAK,EACL,GAAG,EACH,GAAG,IAAI,EACR,EAAE,cAAc,+BAqsBhB;yBAtuBe,cAAc"}
1
+ {"version":3,"file":"TouchDateField.d.ts","sourceRoot":"","sources":["../../src/DateInput/TouchDateField.tsx"],"names":[],"mappings":"AAgEA,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,aAAa,CAAC;AAgehD;;;GAGG;AACH,wBAAgB,cAAc,CAAC,EAC7B,KAAK,EACL,aAAqB,EACrB,WAAW,EACX,UAAkB,EAClB,UAAkB,EAClB,UAAkB,EAClB,eAAe,EACf,KAAK,EACL,QAAQ,EACR,YAAY,EACZ,SAAiB,EACjB,GAAG,EACH,GAAG,EACH,eAAe,EACf,WAAW,EAAE,oBAAoB,EACjC,IAAI,EAAE,QAAQ,EACd,MAAM,EACN,aAA0B,EAC1B,YAAY,EACZ,QAAgB,EAIhB,cAAc,EAAE,eAAe,EAC/B,YAAY,EAAE,gBAAoB,EAClC,MAAoB,EACpB,KAAK,EACL,MAAM,EACN,SAAS,EACT,KAAK,EACL,GAAG,EACH,GAAG,IAAI,EACR,EAAE,cAAc,+BAmtBhB;yBApvBe,cAAc"}