agnosticui-core 2.0.0-alpha.2 → 2.0.0-alpha.21

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 (249) hide show
  1. package/README.md +67 -33
  2. package/dist/{VueButton.vue_vue_type_script_setup_true_lang-Bq8IPXqd.js → VueButton.vue_vue_type_script_setup_true_lang-D1jGatE9.js} +17 -15
  3. package/dist/{VueButtonFx.vue_vue_type_script_setup_true_lang-BUudF-lg.js → VueButtonFx.vue_vue_type_script_setup_true_lang-BRrt6Nxs.js} +1 -0
  4. package/dist/{VueCheckbox.vue_vue_type_script_setup_true_lang-DERDRO2P.js → VueCheckbox.vue_vue_type_script_setup_true_lang-VtQfJ-6f.js} +9 -10
  5. package/dist/{VueCombobox.vue_vue_type_script_setup_true_lang-C7gDMrYJ.js → VueCombobox.vue_vue_type_script_setup_true_lang-BSTZGX2X.js} +15 -13
  6. package/dist/VueIcon.vue_vue_type_script_setup_true_lang-C2Sky3bU.js +22 -0
  7. package/dist/{VueImage.vue_vue_type_script_setup_true_lang-CUwbK3NF.js → VueImage.vue_vue_type_script_setup_true_lang-SddK93SB.js} +23 -17
  8. package/dist/{VueInput.vue_vue_type_script_setup_true_lang-Dsxo7DuX.js → VueInput.vue_vue_type_script_setup_true_lang-wYdAqg-i.js} +19 -19
  9. package/dist/{VueMenu.vue_vue_type_script_setup_true_lang-bnn7ochj.js → VueMenu.vue_vue_type_script_setup_true_lang-BXc7397e.js} +5 -4
  10. package/dist/{VueRadio.vue_vue_type_script_setup_true_lang-DxNhH12d.js → VueRadio.vue_vue_type_script_setup_true_lang-C7Z-sWpa.js} +10 -12
  11. package/dist/{VueRating.vue_vue_type_script_setup_true_lang-CICncp71.js → VueRating.vue_vue_type_script_setup_true_lang-Bm2nRrqr.js} +11 -9
  12. package/dist/VueSelectionButton.vue_vue_type_script_setup_true_lang-DJN-Uk6n.js +24 -0
  13. package/dist/VueSelectionButtonGroup.vue_vue_type_script_setup_true_lang-DwYrIMVO.js +46 -0
  14. package/dist/VueSelectionCard.vue_vue_type_script_setup_true_lang-DJiyPsXH.js +24 -0
  15. package/dist/VueSelectionCardGroup.vue_vue_type_script_setup_true_lang-D5CycLY5.js +40 -0
  16. package/dist/{VueToggle.vue_vue_type_script_setup_true_lang-BxrvAsse.js → VueToggle.vue_vue_type_script_setup_true_lang-DLPCBOqZ.js} +18 -16
  17. package/dist/components/Alert/core/_Alert.d.ts.map +1 -1
  18. package/dist/components/Alert/core/_Alert.js +38 -19
  19. package/dist/components/Button/core/_Button.d.ts +5 -0
  20. package/dist/components/Button/core/_Button.d.ts.map +1 -1
  21. package/dist/components/Button/core/_Button.js +147 -65
  22. package/dist/components/Button/vue/VueButton.js +1 -1
  23. package/dist/components/Button/vue/VueButton.vue.d.ts +3 -0
  24. package/dist/components/Button/vue/VueButton.vue.d.ts.map +1 -1
  25. package/dist/components/Button/vue/index.js +1 -1
  26. package/dist/components/ButtonFx/vue/VueButtonFx.js +1 -1
  27. package/dist/components/ButtonFx/vue/index.js +1 -1
  28. package/dist/components/Card/core/_Card.d.ts +9 -1
  29. package/dist/components/Card/core/_Card.d.ts.map +1 -1
  30. package/dist/components/Card/core/_Card.js +83 -29
  31. package/dist/components/Card/vue/VueCard.js +29 -16
  32. package/dist/components/Card/vue/VueCard.vue.d.ts +25 -5
  33. package/dist/components/Card/vue/VueCard.vue.d.ts.map +1 -1
  34. package/dist/components/Checkbox/core/_Checkbox.d.ts +37 -11
  35. package/dist/components/Checkbox/core/_Checkbox.d.ts.map +1 -1
  36. package/dist/components/Checkbox/core/_Checkbox.js +73 -42
  37. package/dist/components/Checkbox/vue/VueCheckbox.js +1 -1
  38. package/dist/components/Checkbox/vue/VueCheckbox.vue.d.ts +3 -3
  39. package/dist/components/Checkbox/vue/VueCheckbox.vue.d.ts.map +1 -1
  40. package/dist/components/Checkbox/vue/index.js +1 -1
  41. package/dist/components/Combobox/core/_Combobox.d.ts +24 -1
  42. package/dist/components/Combobox/core/_Combobox.d.ts.map +1 -1
  43. package/dist/components/Combobox/core/_Combobox.js +141 -92
  44. package/dist/components/Combobox/vue/VueCombobox.js +1 -1
  45. package/dist/components/Combobox/vue/index.js +1 -1
  46. package/dist/components/Fieldset/vue/VueFieldset.vue.d.ts +1 -1
  47. package/dist/components/Icon/vue/VueIcon.js +1 -1
  48. package/dist/components/Icon/vue/VueIcon.vue.d.ts.map +1 -1
  49. package/dist/components/Icon/vue/index.js +1 -1
  50. package/dist/components/Image/vue/VueImage.js +1 -1
  51. package/dist/components/Image/vue/VueImage.vue.d.ts.map +1 -1
  52. package/dist/components/Image/vue/index.js +1 -1
  53. package/dist/components/Input/core/_Input.d.ts +21 -2
  54. package/dist/components/Input/core/_Input.d.ts.map +1 -1
  55. package/dist/components/Input/core/_Input.js +71 -35
  56. package/dist/components/Input/vue/VueInput.js +1 -1
  57. package/dist/components/Input/vue/VueInput.vue.d.ts.map +1 -1
  58. package/dist/components/Input/vue/index.js +1 -1
  59. package/dist/components/Link/core/_Link.d.ts.map +1 -1
  60. package/dist/components/Link/core/_Link.js +1 -0
  61. package/dist/components/Link/vue/VueLink.js +6 -5
  62. package/dist/components/Link/vue/VueLink.vue.d.ts.map +1 -1
  63. package/dist/components/Menu/vue/VueMenu.js +1 -1
  64. package/dist/components/Menu/vue/index.js +1 -1
  65. package/dist/components/Pagination/core/_Pagination.d.ts +0 -1
  66. package/dist/components/Pagination/core/_Pagination.d.ts.map +1 -1
  67. package/dist/components/Pagination/core/_Pagination.js +6 -9
  68. package/dist/components/Radio/core/_Radio.d.ts +55 -10
  69. package/dist/components/Radio/core/_Radio.d.ts.map +1 -1
  70. package/dist/components/Radio/core/_Radio.js +165 -116
  71. package/dist/components/Radio/vue/VueRadio.js +1 -1
  72. package/dist/components/Radio/vue/VueRadio.vue.d.ts.map +1 -1
  73. package/dist/components/Radio/vue/index.js +1 -1
  74. package/dist/components/Rating/core/_Rating.d.ts +23 -2
  75. package/dist/components/Rating/core/_Rating.d.ts.map +1 -1
  76. package/dist/components/Rating/core/_Rating.js +97 -64
  77. package/dist/components/Rating/vue/VueRating.js +1 -1
  78. package/dist/components/Rating/vue/VueRating.vue.d.ts +2 -0
  79. package/dist/components/Rating/vue/VueRating.vue.d.ts.map +1 -1
  80. package/dist/components/Rating/vue/index.js +1 -1
  81. package/dist/components/Select/core/_Select.d.ts +20 -2
  82. package/dist/components/Select/core/_Select.d.ts.map +1 -1
  83. package/dist/components/Select/core/_Select.js +99 -69
  84. package/dist/components/SelectionButton/core/SelectionButton.d.ts +9 -0
  85. package/dist/components/SelectionButton/core/SelectionButton.d.ts.map +1 -0
  86. package/dist/components/SelectionButton/core/SelectionButton.js +5 -0
  87. package/dist/components/SelectionButton/core/_SelectionButton.d.ts +47 -0
  88. package/dist/components/SelectionButton/core/_SelectionButton.d.ts.map +1 -0
  89. package/dist/components/SelectionButton/core/_SelectionButton.js +474 -0
  90. package/dist/components/SelectionButton/react/ReactSelectionButton.d.ts +9 -0
  91. package/dist/components/SelectionButton/react/ReactSelectionButton.d.ts.map +1 -0
  92. package/dist/components/SelectionButton/react/ReactSelectionButton.js +12 -0
  93. package/dist/components/SelectionButton/react/index.d.ts +3 -0
  94. package/dist/components/SelectionButton/react/index.d.ts.map +1 -0
  95. package/dist/components/SelectionButton/react/index.js +4 -0
  96. package/dist/components/SelectionButton/vue/VueSelectionButton.js +4 -0
  97. package/dist/components/SelectionButton/vue/VueSelectionButton.vue.d.ts +55 -0
  98. package/dist/components/SelectionButton/vue/VueSelectionButton.vue.d.ts.map +1 -0
  99. package/dist/components/SelectionButton/vue/index.d.ts +6 -0
  100. package/dist/components/SelectionButton/vue/index.d.ts.map +1 -0
  101. package/dist/components/SelectionButton/vue/index.js +4 -0
  102. package/dist/components/SelectionButtonGroup/core/SelectionButtonGroup.d.ts +9 -0
  103. package/dist/components/SelectionButtonGroup/core/SelectionButtonGroup.d.ts.map +1 -0
  104. package/dist/components/SelectionButtonGroup/core/SelectionButtonGroup.js +5 -0
  105. package/dist/components/SelectionButtonGroup/core/_SelectionButtonGroup.d.ts +87 -0
  106. package/dist/components/SelectionButtonGroup/core/_SelectionButtonGroup.d.ts.map +1 -0
  107. package/dist/components/SelectionButtonGroup/core/_SelectionButtonGroup.js +235 -0
  108. package/dist/components/SelectionButtonGroup/react/ReactSelectionButtonGroup.d.ts +13 -0
  109. package/dist/components/SelectionButtonGroup/react/ReactSelectionButtonGroup.d.ts.map +1 -0
  110. package/dist/components/SelectionButtonGroup/react/ReactSelectionButtonGroup.js +15 -0
  111. package/dist/components/SelectionButtonGroup/react/index.d.ts +3 -0
  112. package/dist/components/SelectionButtonGroup/react/index.d.ts.map +1 -0
  113. package/dist/components/SelectionButtonGroup/react/index.js +4 -0
  114. package/dist/components/SelectionButtonGroup/vue/VueSelectionButtonGroup.js +4 -0
  115. package/dist/components/SelectionButtonGroup/vue/VueSelectionButtonGroup.vue.d.ts +101 -0
  116. package/dist/components/SelectionButtonGroup/vue/VueSelectionButtonGroup.vue.d.ts.map +1 -0
  117. package/dist/components/SelectionButtonGroup/vue/index.d.ts +6 -0
  118. package/dist/components/SelectionButtonGroup/vue/index.d.ts.map +1 -0
  119. package/dist/components/SelectionButtonGroup/vue/index.js +4 -0
  120. package/dist/components/SelectionCard/core/SelectionCard.d.ts +9 -0
  121. package/dist/components/SelectionCard/core/SelectionCard.d.ts.map +1 -0
  122. package/dist/components/SelectionCard/core/SelectionCard.js +5 -0
  123. package/dist/components/SelectionCard/core/_SelectionCard.d.ts +39 -0
  124. package/dist/components/SelectionCard/core/_SelectionCard.d.ts.map +1 -0
  125. package/dist/components/SelectionCard/core/_SelectionCard.js +318 -0
  126. package/dist/components/SelectionCard/react/ReactSelectionCard.d.ts +9 -0
  127. package/dist/components/SelectionCard/react/ReactSelectionCard.d.ts.map +1 -0
  128. package/dist/components/SelectionCard/react/ReactSelectionCard.js +12 -0
  129. package/dist/components/SelectionCard/react/index.d.ts +3 -0
  130. package/dist/components/SelectionCard/react/index.d.ts.map +1 -0
  131. package/dist/components/SelectionCard/react/index.js +4 -0
  132. package/dist/components/SelectionCard/vue/VueSelectionCard.js +4 -0
  133. package/dist/components/SelectionCard/vue/VueSelectionCard.vue.d.ts +55 -0
  134. package/dist/components/SelectionCard/vue/VueSelectionCard.vue.d.ts.map +1 -0
  135. package/dist/components/SelectionCard/vue/index.d.ts +6 -0
  136. package/dist/components/SelectionCard/vue/index.d.ts.map +1 -0
  137. package/dist/components/SelectionCard/vue/index.js +4 -0
  138. package/dist/components/SelectionCardGroup/core/SelectionCardGroup.d.ts +9 -0
  139. package/dist/components/SelectionCardGroup/core/SelectionCardGroup.d.ts.map +1 -0
  140. package/dist/components/SelectionCardGroup/core/SelectionCardGroup.js +5 -0
  141. package/dist/components/SelectionCardGroup/core/_SelectionCardGroup.d.ts +69 -0
  142. package/dist/components/SelectionCardGroup/core/_SelectionCardGroup.d.ts.map +1 -0
  143. package/dist/components/SelectionCardGroup/core/_SelectionCardGroup.js +220 -0
  144. package/dist/components/SelectionCardGroup/react/ReactSelectionCardGroup.d.ts +13 -0
  145. package/dist/components/SelectionCardGroup/react/ReactSelectionCardGroup.d.ts.map +1 -0
  146. package/dist/components/SelectionCardGroup/react/ReactSelectionCardGroup.js +15 -0
  147. package/dist/components/SelectionCardGroup/react/index.d.ts +3 -0
  148. package/dist/components/SelectionCardGroup/react/index.d.ts.map +1 -0
  149. package/dist/components/SelectionCardGroup/react/index.js +4 -0
  150. package/dist/components/SelectionCardGroup/vue/VueSelectionCardGroup.js +4 -0
  151. package/dist/components/SelectionCardGroup/vue/VueSelectionCardGroup.vue.d.ts +86 -0
  152. package/dist/components/SelectionCardGroup/vue/VueSelectionCardGroup.vue.d.ts.map +1 -0
  153. package/dist/components/SelectionCardGroup/vue/index.d.ts +6 -0
  154. package/dist/components/SelectionCardGroup/vue/index.d.ts.map +1 -0
  155. package/dist/components/SelectionCardGroup/vue/index.js +4 -0
  156. package/dist/components/Slider/core/_Slider.d.ts +10 -16
  157. package/dist/components/Slider/core/_Slider.d.ts.map +1 -1
  158. package/dist/components/Slider/core/_Slider.js +28 -39
  159. package/dist/components/Timeline/core/_Timeline.d.ts.map +1 -1
  160. package/dist/components/Timeline/core/_Timeline.js +8 -3
  161. package/dist/components/Timeline/react/ReactTimeline.d.ts +23 -9
  162. package/dist/components/Timeline/react/ReactTimeline.d.ts.map +1 -1
  163. package/dist/components/Timeline/react/ReactTimeline.js +18 -14
  164. package/dist/components/Toggle/core/_Toggle.d.ts +36 -6
  165. package/dist/components/Toggle/core/_Toggle.d.ts.map +1 -1
  166. package/dist/components/Toggle/core/_Toggle.js +117 -77
  167. package/dist/components/Toggle/vue/VueToggle.js +1 -1
  168. package/dist/components/Toggle/vue/VueToggle.vue.d.ts.map +1 -1
  169. package/dist/components/Toggle/vue/index.js +1 -1
  170. package/dist/shared/face-mixin.d.ts +82 -0
  171. package/dist/shared/face-mixin.d.ts.map +1 -0
  172. package/dist/shared/face-mixin.js +86 -0
  173. package/dist/shared/form-control-styles.js +1 -1
  174. package/dist/styles/ag-tokens-dark.css +4 -0
  175. package/dist/styles/ag-tokens.css +18 -13
  176. package/dist/test-setup.js +340 -255
  177. package/package.json +51 -13
  178. package/src/components/Alert/core/_Alert.ts +21 -2
  179. package/src/components/Button/core/_Button.ts +111 -21
  180. package/src/components/Button/vue/VueButton.vue +2 -0
  181. package/src/components/Card/core/_Card.ts +70 -3
  182. package/src/components/Card/vue/VueCard.vue +19 -3
  183. package/src/components/Checkbox/core/_Checkbox.ts +78 -18
  184. package/src/components/Checkbox/vue/VueCheckbox.vue +0 -6
  185. package/src/components/Combobox/core/_Combobox.ts +84 -2
  186. package/src/components/Combobox/vue/VueCombobox.vue +1 -0
  187. package/src/components/Drawer/v1/dialog--drawer-bottom.hbs +48 -0
  188. package/src/components/Drawer/v1/dialog--drawer-end.hbs +48 -0
  189. package/src/components/Drawer/v1/dialog--drawer-start.hbs +48 -0
  190. package/src/components/Drawer/v1/dialog--drawer-top.hbs +48 -0
  191. package/src/components/Drawer/v1/dialog-demo.css +13 -0
  192. package/src/components/Drawer/v1/dialog.config.yml +5 -0
  193. package/src/components/Drawer/v1/dialog.css +99 -0
  194. package/src/components/Drawer/v1/dialog.hbs +48 -0
  195. package/src/components/Drawer/v1/drawer-animations.css +52 -0
  196. package/src/components/Drawer/v1/drawer.css +50 -0
  197. package/src/components/Icon/vue/VueIcon.vue +2 -5
  198. package/src/components/Image/vue/VueImage.vue +17 -13
  199. package/src/components/Input/core/_Input.ts +58 -3
  200. package/src/components/Input/vue/VueInput.vue +2 -6
  201. package/src/components/Link/core/_Link.ts +1 -0
  202. package/src/components/Link/vue/VueLink.vue +1 -0
  203. package/src/components/Pagination/core/_Pagination.ts +10 -18
  204. package/src/components/Radio/core/_Radio.ts +131 -41
  205. package/src/components/Radio/vue/VueRadio.vue +1 -5
  206. package/src/components/Rating/core/_Rating.ts +62 -5
  207. package/src/components/Rating/vue/VueRating.vue +3 -0
  208. package/src/components/Select/core/_Select.ts +55 -6
  209. package/src/components/SelectionButton/core/SelectionButton.ts +13 -0
  210. package/src/components/SelectionButton/core/_SelectionButton.ts +551 -0
  211. package/src/components/SelectionButton/react/ReactSelectionButton.tsx +16 -0
  212. package/src/components/SelectionButton/react/index.ts +4 -0
  213. package/src/components/SelectionButton/vue/VueSelectionButton.vue +33 -0
  214. package/src/components/SelectionButton/vue/index.ts +5 -0
  215. package/src/components/SelectionButtonGroup/core/SelectionButtonGroup.ts +13 -0
  216. package/src/components/SelectionButtonGroup/core/_SelectionButtonGroup.ts +423 -0
  217. package/src/components/SelectionButtonGroup/react/ReactSelectionButtonGroup.tsx +29 -0
  218. package/src/components/SelectionButtonGroup/react/index.ts +9 -0
  219. package/src/components/SelectionButtonGroup/vue/VueSelectionButtonGroup.vue +89 -0
  220. package/src/components/SelectionButtonGroup/vue/index.ts +5 -0
  221. package/src/components/SelectionCard/core/SelectionCard.ts +13 -0
  222. package/src/components/SelectionCard/core/_SelectionCard.ts +384 -0
  223. package/src/components/SelectionCard/react/ReactSelectionCard.tsx +16 -0
  224. package/src/components/SelectionCard/react/index.ts +4 -0
  225. package/src/components/SelectionCard/vue/VueSelectionCard.vue +33 -0
  226. package/src/components/SelectionCard/vue/index.ts +5 -0
  227. package/src/components/SelectionCardGroup/core/SelectionCardGroup.ts +13 -0
  228. package/src/components/SelectionCardGroup/core/_SelectionCardGroup.ts +396 -0
  229. package/src/components/SelectionCardGroup/react/ReactSelectionCardGroup.tsx +29 -0
  230. package/src/components/SelectionCardGroup/react/index.ts +9 -0
  231. package/src/components/SelectionCardGroup/vue/VueSelectionCardGroup.vue +71 -0
  232. package/src/components/SelectionCardGroup/vue/index.ts +5 -0
  233. package/src/components/Slider/core/_Slider.ts +28 -28
  234. package/src/components/Timeline/core/_Timeline.ts +5 -0
  235. package/src/components/Timeline/react/ReactTimeline.tsx +47 -24
  236. package/src/components/Toggle/core/_Toggle.ts +83 -9
  237. package/src/components/Toggle/vue/VueToggle.vue +2 -0
  238. package/src/shared/face-mixin.ts +233 -0
  239. package/src/shared/form-control-styles.ts +1 -1
  240. package/src/styles/ag-tokens-dark.css +4 -0
  241. package/src/styles/ag-tokens.css +18 -13
  242. package/RTL_IMPLEMENTATION_PLAN.md +0 -295
  243. package/dist/VueIcon.vue_vue_type_script_setup_true_lang-kC-nzMyu.js +0 -25
  244. package/dist/components/Input/core/_Input.BACKUP.d.ts +0 -114
  245. package/dist/components/Input/core/_Input.BACKUP.d.ts.map +0 -1
  246. package/dist/components/Input/core/_Input.BACKUP.js +0 -511
  247. package/dist/global.d.js +0 -1
  248. package/src/components/Input/core/_Input.BACKUP.ts +0 -710
  249. package/src/global.d.ts +0 -43
@@ -1,34 +1,57 @@
1
- // v2/lib/src/components/Timeline/react/Timeline.tsx
2
- import React from "react";
3
- import { createComponent } from "@lit/react";
4
- import {
5
- AgTimeline as AgTimelineWC,
6
- AgTimelineItem as AgTimelineItemWC,
7
- } from "../core/Timeline.js";
8
- import type { AgTimelineProps, AgTimelineItemProps } from "../core/Timeline.js";
1
+ // v2/lib/src/components/Timeline/react/ReactTimeline.tsx
2
+ import React from 'react';
3
+ import { createComponent } from '@lit/react';
4
+ import { AgTimeline as AgTimelineWC, AgTimelineItem as AgTimelineItemWC } from '../core/Timeline.js';
5
+
6
+ // Extend React JSX IntrinsicElements to include custom timeline elements
7
+ declare module 'react/jsx-runtime' {
8
+ namespace JSX {
9
+ interface IntrinsicElements {
10
+ 'ag-timeline-item': React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
11
+ }
12
+ }
13
+ }
14
+
15
+ // Define the props for the Timeline component
16
+ export interface ReactTimelineProps {
17
+ orientation?: 'horizontal' | 'vertical';
18
+ variant?: 'primary' | 'success' | 'warning' | 'danger' | 'monochrome' | '';
19
+ compact?: boolean;
20
+ ariaLabel?: string;
21
+ responsive?: boolean;
22
+ children?: React.ReactNode;
23
+ }
9
24
 
10
25
  // Create React wrapper for Timeline
11
26
  export const ReactTimeline = createComponent({
12
- tagName: "ag-timeline",
27
+ tagName: 'ag-timeline',
13
28
  elementClass: AgTimelineWC,
14
29
  react: React,
15
- events: {
16
- onSlotChange: "slotchange",
17
- },
18
- });
19
-
20
- // Create React wrapper for TimelineItem
21
- export const ReactTimelineItem = createComponent({
22
- tagName: "ag-timeline-item",
23
- elementClass: AgTimelineItemWC,
24
- react: React,
25
30
  });
26
31
 
27
- // Export types with better names for React context
28
- export type ReactTimelineProps = AgTimelineProps & {
32
+ // Define the props for the TimelineItem component
33
+ export interface ReactTimelineItemProps {
34
+ start?: React.ReactNode;
35
+ marker?: React.ReactNode;
36
+ end?: React.ReactNode;
29
37
  children?: React.ReactNode;
30
- };
38
+ }
31
39
 
32
- export type ReactTimelineItemProps = AgTimelineItemProps & {
33
- children?: React.ReactNode;
40
+ // Custom TimelineItem to handle slots as props
41
+ export const ReactTimelineItem: React.FC<ReactTimelineItemProps> = ({ start, marker, end, children }) => {
42
+ return (
43
+ <ag-timeline-item>
44
+ {start && <div slot="ag-start">{start}</div>}
45
+ {marker && <div slot="ag-marker">{marker}</div>}
46
+ {end && <div slot="ag-end">{end}</div>}
47
+ {children}
48
+ </ag-timeline-item>
49
+ );
34
50
  };
51
+
52
+ // Original TimelineItem wrapper (if needed for other purposes)
53
+ export const ReactTimelineItemWC = createComponent({
54
+ tagName: 'ag-timeline-item',
55
+ elementClass: AgTimelineItemWC,
56
+ react: React,
57
+ });
@@ -34,6 +34,7 @@ import {
34
34
  type LabelPosition,
35
35
  } from '../../../shared/form-control-utils';
36
36
  import { formControlStyles } from '../../../shared/form-control-styles';
37
+ import { FaceMixin, type ValidationMessages } from '../../../shared/face-mixin';
37
38
 
38
39
  // Event types
39
40
  export interface ToggleChangeEventDetail {
@@ -60,6 +61,7 @@ export interface ToggleProps {
60
61
  helpText?: string;
61
62
  name?: string;
62
63
  value?: string;
64
+ validationMessages?: ValidationMessages;
63
65
  // Event callbacks
64
66
  onClick?: (event: MouseEvent) => void;
65
67
  onToggleChange?: (event: ToggleChangeEvent) => void;
@@ -80,7 +82,7 @@ export interface ToggleProps {
80
82
  * - Size variants with consistent proportions
81
83
  * - Form integration support
82
84
  */
83
- export class AgToggle extends LitElement implements ToggleProps {
85
+ export class AgToggle extends FaceMixin(LitElement) implements ToggleProps {
84
86
  static styles = [
85
87
  formControlStyles,
86
88
  css`
@@ -331,13 +333,7 @@ export class AgToggle extends LitElement implements ToggleProps {
331
333
  declare helpText: string;
332
334
 
333
335
  /**
334
- * Form integration - name attribute
335
- */
336
- @property({ type: String })
337
- declare name: string;
338
-
339
- /**
340
- * Form integration - value when checked
336
+ * Form integration - value submitted when checked (defaults to 'on' like native checkbox)
341
337
  */
342
338
  @property({ type: String })
343
339
  declare value: string;
@@ -348,6 +344,12 @@ export class AgToggle extends LitElement implements ToggleProps {
348
344
  @property({ attribute: false })
349
345
  declare onClick?: (event: MouseEvent) => void;
350
346
 
347
+ /**
348
+ * Consumer-supplied validation messages (overrides built-in English fallbacks)
349
+ */
350
+ @property({ attribute: false })
351
+ declare validationMessages: ValidationMessages | undefined;
352
+
351
353
  /**
352
354
  * Toggle change event callback
353
355
  */
@@ -377,11 +379,78 @@ export class AgToggle extends LitElement implements ToggleProps {
377
379
  this.invalid = false;
378
380
  this.errorMessage = '';
379
381
  this.helpText = '';
380
- this.name = '';
381
382
  this.value = '';
383
+ this.validationMessages = undefined;
384
+ }
385
+
386
+ // ─── FACE ─────────────────────────────────────────────────────────────────
387
+
388
+ /**
389
+ * FACE lifecycle: called when the parent form is reset.
390
+ * Restores checked to false and clears form value and validity.
391
+ */
392
+ override formResetCallback(): void {
393
+ this.checked = false;
394
+ this._internals.setFormValue(null);
395
+ this._internals.setValidity({});
396
+ this._syncStates();
397
+ }
398
+
399
+ /**
400
+ * Sync validity state to ElementInternals.
401
+ * Toggle has no inner <input> to delegate to, so required validation
402
+ * is implemented directly: unchecked + required = valueMissing.
403
+ */
404
+ private _syncValidity(): void {
405
+ if (this.required && !this.checked) {
406
+ this._internals.setValidity(
407
+ { valueMissing: true },
408
+ this.validationMessages?.valueMissing ?? 'Please check this field.'
409
+ );
410
+ } else {
411
+ this._internals.setValidity({});
412
+ }
413
+ }
414
+
415
+ /**
416
+ * Sync CustomStateSet states so :state() pseudo-classes work from external CSS.
417
+ *
418
+ * Must be called AFTER _syncValidity() so that :state(invalid) reads the
419
+ * freshly-updated _internals.validity.valid value.
420
+ *
421
+ * Exposed states:
422
+ * :state(checked) — toggle is on
423
+ * :state(disabled) — toggle is disabled
424
+ * :state(readonly) — toggle is read-only
425
+ * :state(required) — toggle is required
426
+ * :state(invalid) — FACE constraint validation is failing
427
+ */
428
+ private _syncStates(): void {
429
+ this._setState('checked', this.checked);
430
+ this._setState('disabled', this.disabled);
431
+ this._setState('readonly', this.readonly);
432
+ this._setState('required', this.required);
433
+ this._setState('invalid', !this._internals.validity.valid);
434
+ }
435
+
436
+ // ─── End FACE ─────────────────────────────────────────────────────────────
437
+
438
+ override updated(changedProperties: Map<string, unknown>) {
439
+ super.updated(changedProperties);
440
+ // FACE: sync states when disabled or readonly change programmatically.
441
+ // checked, required, and invalid are already handled via _performToggle
442
+ // and firstUpdated, but these two can change without going through toggle.
443
+ if (changedProperties.has('disabled') || changedProperties.has('readonly')) {
444
+ this._syncStates();
445
+ }
382
446
  }
383
447
 
384
448
  protected firstUpdated() {
449
+ // FACE: set initial form value and sync validity after first render
450
+ this._internals.setFormValue(this.checked ? (this.value || 'on') : null);
451
+ this._syncValidity();
452
+ this._syncStates();
453
+
385
454
  // Developer experience: warn about missing label
386
455
  if (!this.label && !this.noLabel) {
387
456
  // eslint-disable-next-line no-console
@@ -439,6 +508,11 @@ export class AgToggle extends LitElement implements ToggleProps {
439
508
 
440
509
  this.checked = !this.checked;
441
510
 
511
+ // FACE: sync form value and validity on every toggle
512
+ this._internals.setFormValue(this.checked ? (this.value || 'on') : null);
513
+ this._syncValidity();
514
+ this._syncStates();
515
+
442
516
  // Dispatch custom event with form integration details
443
517
  const toggleChangeEvent = new CustomEvent<ToggleChangeEventDetail>('toggle-change', {
444
518
  detail: {
@@ -16,6 +16,7 @@
16
16
  :helpText="helpText"
17
17
  :name="name"
18
18
  :value="value"
19
+ .validationMessages="validationMessages"
19
20
  @click="handleClick"
20
21
  @toggle-change="handleToggleChange"
21
22
  v-bind="$attrs"
@@ -29,6 +30,7 @@ import type {
29
30
  ToggleChangeEvent,
30
31
  ToggleChangeEventDetail,
31
32
  } from "../core/Toggle";
33
+ import type { ValidationMessages } from "../../../shared/face-mixin";
32
34
  import "../core/Toggle"; // Registers the ag-toggle web component
33
35
 
34
36
  // Define props interface (omit function props since wrapper uses emits)
@@ -0,0 +1,233 @@
1
+ /**
2
+ * FaceMixin — Form Associated Custom Element (FACE) shared behaviors
3
+ *
4
+ * Adds the common FACE API surface to any LitElement subclass so that
5
+ * AgInput, AgCheckbox, AgSelect, AgRadio, etc. don't repeat this boilerplate.
6
+ *
7
+ * What every FACE component shares (lives here):
8
+ * - `static formAssociated = true`
9
+ * - `protected _internals` (ElementInternals handle)
10
+ * - `name` property
11
+ * - `get form/validity/validationMessage/willValidate`
12
+ * - `checkValidity()` / `reportValidity()`
13
+ * - `formDisabledCallback()` — syncs disabled from parent <fieldset disabled>
14
+ * - No-op `formResetCallback()` — subclasses override for component-specific reset
15
+ *
16
+ * What stays in each component (NOT here):
17
+ * - `formResetCallback()` implementation — each component knows its own default state
18
+ * - `setFormValue()` calls — component decides when/what to submit
19
+ * - `setValidity()` calls — component drives its own constraint validation
20
+ *
21
+ * Usage:
22
+ * import { FaceMixin } from '../../../shared/face-mixin.js';
23
+ * export class AgInput extends FaceMixin(LitElement) { ... }
24
+ */
25
+
26
+ import { LitElement } from 'lit';
27
+ import { property } from 'lit/decorators.js';
28
+
29
+ // Standard Lit mixin type helper
30
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
31
+ type Constructor<T = {}> = new (...args: any[]) => T;
32
+
33
+ /**
34
+ * Consumer-supplied validation messages for constraint validation.
35
+ * Each key maps to the corresponding ValidityState flag.
36
+ * Provided values override the built-in English fallback strings.
37
+ */
38
+ export interface ValidationMessages {
39
+ valueMissing?: string;
40
+ typeMismatch?: string;
41
+ patternMismatch?: string;
42
+ tooLong?: string;
43
+ tooShort?: string;
44
+ rangeUnderflow?: string;
45
+ rangeOverflow?: string;
46
+ stepMismatch?: string;
47
+ badInput?: string;
48
+ customError?: string;
49
+ }
50
+
51
+ /**
52
+ * Sync the validity state of an inner <input> or <textarea> to ElementInternals.
53
+ *
54
+ * This is the recommended delegation strategy: let the native input run its own
55
+ * constraint validation (required, minlength, type="email", pattern, etc.) and
56
+ * then mirror the result into ElementInternals so the host custom element's
57
+ * validity reflects the inner element.
58
+ *
59
+ * Call this on every `input` and `change` event, and once after `firstUpdated`.
60
+ *
61
+ * @param internals - The ElementInternals handle from attachInternals()
62
+ * @param inputEl - The inner native input, textarea, or select element
63
+ */
64
+ export function syncInnerInputValidity(
65
+ internals: ElementInternals,
66
+ inputEl: HTMLInputElement | HTMLTextAreaElement | HTMLSelectElement | null | undefined
67
+ ): void {
68
+ if (!inputEl) return;
69
+
70
+ if (!inputEl.validity.valid) {
71
+ internals.setValidity(inputEl.validity, inputEl.validationMessage, inputEl);
72
+ } else {
73
+ internals.setValidity({});
74
+ }
75
+ }
76
+
77
+ /**
78
+ * Type-level declaration of everything FaceMixin adds to a class.
79
+ *
80
+ * Using `declare class` (rather than `interface`) is the Lit-recommended approach
81
+ * for mixins that include protected members — it avoids TS4094 "anonymous class
82
+ * type may not be private or protected" errors in declaration emit.
83
+ *
84
+ * Import this type when you need to declare a FACE-capable component in type position.
85
+ */
86
+ export declare class FaceMixinInterface {
87
+ /** Registers this element as form-associated with the browser */
88
+ static readonly formAssociated: boolean;
89
+ /** ElementInternals handle — subclasses use this to call setFormValue/setValidity */
90
+ protected _internals: ElementInternals;
91
+ /** The name under which this control's value is submitted with the parent form */
92
+ name: string;
93
+ /** The parent <form> element, or null */
94
+ readonly form: HTMLFormElement | null;
95
+ /** Current ValidityState, updated via _internals.setValidity() */
96
+ readonly validity: ValidityState;
97
+ /** Browser-generated or custom validation message */
98
+ readonly validationMessage: string;
99
+ /** Whether this element participates in constraint validation */
100
+ readonly willValidate: boolean;
101
+ /** Silent validity check; fires 'invalid' event if invalid */
102
+ checkValidity(): boolean;
103
+ /** Validity check with browser tooltip if invalid */
104
+ reportValidity(): boolean;
105
+ /** FACE lifecycle — called when a fieldset disabled ancestor changes */
106
+ formDisabledCallback(disabled: boolean): void;
107
+ /** FACE lifecycle — called on form reset; subclasses should override */
108
+ formResetCallback(): void;
109
+ /**
110
+ * Toggle a custom state in ElementInternals.states (CustomStateSet).
111
+ * Enables :state() pseudo-class targeting from external CSS.
112
+ * Guards against environments where states is unavailable.
113
+ */
114
+ protected _setState(state: string, active: boolean): void;
115
+ }
116
+
117
+ /**
118
+ * FaceMixin
119
+ *
120
+ * Compose onto any LitElement subclass to get full FACE boilerplate.
121
+ * Subclasses MUST override `formResetCallback()` to restore their own default state.
122
+ */
123
+ export const FaceMixin = <T extends Constructor<LitElement>>(superClass: T) => {
124
+ class FaceElement extends superClass {
125
+ /**
126
+ * Registers the element as form-associated with the browser.
127
+ * This is what enables ElementInternals and the form lifecycle callbacks.
128
+ */
129
+ static readonly formAssociated = true;
130
+
131
+ /**
132
+ * ElementInternals handle.
133
+ * Protected so subclasses can call setFormValue(), setValidity(), etc.
134
+ * Must be initialized in constructor before any other use.
135
+ */
136
+ protected _internals!: ElementInternals;
137
+
138
+ /**
139
+ * The name under which this control's value is submitted with the parent form.
140
+ * Mirrors the standard `name` attribute on native form controls.
141
+ * Reflected so it works in plain HTML: <ag-input name="email">
142
+ */
143
+ @property({ type: String, reflect: true })
144
+ name = '';
145
+
146
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
147
+ constructor(...args: any[]) {
148
+ super(...args);
149
+ // attachInternals() must be called in the constructor, before any other lifecycle
150
+ this._internals = this.attachInternals();
151
+ }
152
+
153
+ /** The parent <form> element, or null if not inside a form. */
154
+ get form(): HTMLFormElement | null {
155
+ return this._internals.form;
156
+ }
157
+
158
+ /** The current ValidityState, updated via this._internals.setValidity(). */
159
+ get validity(): ValidityState {
160
+ return this._internals.validity;
161
+ }
162
+
163
+ /** The browser-generated or custom validation message. */
164
+ get validationMessage(): string {
165
+ return this._internals.validationMessage;
166
+ }
167
+
168
+ /** Whether this element will participate in constraint validation. */
169
+ get willValidate(): boolean {
170
+ return this._internals.willValidate;
171
+ }
172
+
173
+ /** Checks validity silently; fires a cancellable 'invalid' event if invalid. */
174
+ checkValidity(): boolean {
175
+ return this._internals.checkValidity();
176
+ }
177
+
178
+ /** Checks validity and shows the browser validation tooltip if invalid. */
179
+ reportValidity(): boolean {
180
+ return this._internals.reportValidity();
181
+ }
182
+
183
+ /**
184
+ * FACE lifecycle: called when a <fieldset disabled> ancestor is toggled.
185
+ * Syncs the component's own `disabled` property so it renders correctly.
186
+ *
187
+ * Note: this only fires for inherited disabled state (via fieldset), not
188
+ * for the element's own `disabled` attribute — both paths must be handled.
189
+ */
190
+ formDisabledCallback(disabled: boolean): void {
191
+ // `disabled` is declared on each subclass via @property; cast to access it
192
+ (this as unknown as { disabled: boolean }).disabled = disabled;
193
+ }
194
+
195
+ /**
196
+ * FACE lifecycle: called when the parent form is reset.
197
+ * Default is a no-op. Subclasses MUST override to restore their default state
198
+ * and call this._internals.setFormValue('') / setValidity({}).
199
+ */
200
+ formResetCallback(): void {
201
+ // no-op default — override in subclass
202
+ }
203
+
204
+ /**
205
+ * Toggle a custom state in ElementInternals.states (CustomStateSet).
206
+ *
207
+ * Exposes internal states as CSS :state() pseudo-classes targetable from
208
+ * outside the shadow root — e.g. ag-toggle:state(checked), ag-radio:state(invalid).
209
+ *
210
+ * Always call this AFTER _syncValidity() so that :state(invalid) reads
211
+ * the freshly-updated _internals.validity.valid value.
212
+ *
213
+ * Feature-guarded: _internals.states requires Chrome 90+, Firefox 126+,
214
+ * Safari 17.4+. The guard is here so call sites don't repeat it.
215
+ *
216
+ * @param state State name, e.g. 'checked', 'disabled', 'invalid'
217
+ * @param active True to add the state, false to remove it
218
+ */
219
+ protected _setState(state: string, active: boolean): void {
220
+ if (!this._internals.states) return;
221
+ if (active) {
222
+ this._internals.states.add(state);
223
+ } else {
224
+ this._internals.states.delete(state);
225
+ }
226
+ }
227
+ }
228
+
229
+ // Cast to FaceMixinInterface & T to avoid TS4094 errors in declaration emit
230
+ // caused by the anonymous class having protected members. The declare class above
231
+ // describes the same shape TypeScript-safely.
232
+ return FaceElement as unknown as Constructor<FaceMixinInterface> & T;
233
+ };
@@ -11,7 +11,7 @@ export const formControlStyles = css`
11
11
  /* Label - Default (top position) */
12
12
  .ag-form-control__label {
13
13
  display: block;
14
- font-size: var(--ag-font-size-base);
14
+ font-size: var(--ag-font-size-sm);
15
15
  font-weight: 600;
16
16
  color: var(--ag-text-primary);
17
17
  line-height: var(--ag-line-height-base);
@@ -96,6 +96,10 @@
96
96
  --ag-warning-text: #f2cc60;
97
97
  --ag-danger-background: #490202;
98
98
  --ag-danger-text: #ffc1ba;
99
+ --ag-primary-fg: #ffffff;
100
+ --ag-success-fg: #ffffff;
101
+ --ag-warning-fg: #0D1117;
102
+ --ag-danger-fg: #ffffff;
99
103
  --ag-border: #3D444D;
100
104
  --ag-border-subtle: #656C76;
101
105
  --ag-primary: #1158c7;
@@ -151,23 +151,27 @@
151
151
  --ag-background-primary-inverted: #1f2328;
152
152
  --ag-background-secondary: #f3f4f6;
153
153
  --ag-background-secondary-inverted: #111827;
154
- --ag-background-tertiary: #e5e7eb;
155
- --ag-background-disabled: #f3f4f6;
156
- --ag-primary-background: #ddf4ff;
157
- --ag-primary-text: #0550ae;
158
- --ag-success-background: #dafbe1;
159
- --ag-success-text: #116329;
160
- --ag-info-background: #f3f4f6;
161
- --ag-info-text: #4b5563;
162
- --ag-warning-background: #fff8c5;
163
- --ag-warning-text: #7d4e00;
164
- --ag-danger-background: #ffebe9;
165
- --ag-danger-text: #a40e26;
154
+ --ag-background-tertiary: #e5e7eb; /** Used by: Button default bg; also secondary button hover bg */
155
+ --ag-background-disabled: #f3f4f6; /** Used by: Button, Input, Checkbox, Radio, Select disabled states */
156
+ --ag-primary-background: #ddf4ff; /** Used by: Alert primary variant bg, Button faint variant bg */
157
+ --ag-primary-text: #0550ae; /** Used by: Alert primary text, Button bordered/outlined text + border */
158
+ --ag-success-background: #dafbe1; /** Used by: Alert success variant bg, Badge success variant bg */
159
+ --ag-success-text: #116329; /** Used by: Alert success variant text, Badge success variant text */
160
+ --ag-info-background: #f3f4f6; /** Used by: Alert info variant bg, Badge info variant bg */
161
+ --ag-info-text: #4b5563; /** Used by: Alert info variant text, Badge info variant text */
162
+ --ag-warning-background: #fff8c5; /** Used by: Alert warning variant bg, Badge warning variant bg */
163
+ --ag-warning-text: #7d4e00; /** Used by: Alert warning variant text, Badge warning variant text */
164
+ --ag-danger-background: #ffebe9; /** Used by: Alert danger variant bg, Badge danger variant bg */
165
+ --ag-danger-text: #a40e26; /** Used by: Alert danger variant text, Badge danger variant text */
166
+ --ag-primary-fg: #ffffff;
167
+ --ag-success-fg: #ffffff;
168
+ --ag-warning-fg: #111827;
169
+ --ag-danger-fg: #ffffff;
166
170
  --ag-border: #e5e7eb;
167
171
  --ag-border-subtle: #d1d5db;
168
172
  --ag-primary: #0550ae;
169
173
  --ag-primary-rgb: 5, 80, 174;
170
- --ag-primary-border: #d1d5db;
174
+ --ag-primary-border: #d1d5db; /** Used by: Button bordered variant border */
171
175
  --ag-primary-dark: #0a3069;
172
176
  --ag-secondary: #6b7280;
173
177
  --ag-secondary-dark: #4b5563;
@@ -190,4 +194,5 @@
190
194
  --ag-rating-filled-success: #238636;
191
195
  --ag-rating-filled-warning: #9a6700;
192
196
  --ag-rating-filled-danger: #cf222e;
197
+ --ag-rating-filled-secondary: #6b7280;
193
198
  }