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
@@ -0,0 +1,551 @@
1
+ /**
2
+ * AgnosticUI v2 SelectionButton - Core Implementation
3
+ *
4
+ * A button-styled selection control that can function as either a radio or checkbox.
5
+ * Must be used within an ag-selection-button-group.
6
+ *
7
+ * @element ag-selection-button
8
+ * @slot - Default slot for button text/content
9
+ * @csspart container - The outer clickable label
10
+ * @csspart control - The hidden input element
11
+ * @csspart indicator - The selection indicator (inline, end side)
12
+ * @csspart content - The slotted content wrapper
13
+ */
14
+
15
+ import { LitElement, html, css, nothing } from 'lit';
16
+ import { property } from 'lit/decorators.js';
17
+
18
+ export type SelectionButtonTheme = 'success' | 'info' | 'error' | 'warning' | 'monochrome' | '';
19
+ export type SelectionButtonSize = 'sm' | 'md' | 'lg';
20
+ export type SelectionButtonShape = '' | 'rounded' | 'capsule';
21
+
22
+ export interface SelectionButtonProps {
23
+ /** Unique value for this button (required) */
24
+ value: string;
25
+ /** Accessible label for this button (required) */
26
+ label: string;
27
+ /** Whether this button is selected */
28
+ checked?: boolean;
29
+ /** Whether this button is disabled */
30
+ disabled?: boolean;
31
+ }
32
+
33
+ // Internal props set by parent group
34
+ interface SelectionButtonInternalProps {
35
+ /** Input type (set by parent group) */
36
+ _type?: 'radio' | 'checkbox';
37
+ /** Input name (set by parent group) */
38
+ _name?: string;
39
+ /** Theme (set by parent group) */
40
+ _theme?: SelectionButtonTheme;
41
+ /** Size (set by parent group) */
42
+ _size?: SelectionButtonSize;
43
+ /** Shape (set by parent group) */
44
+ _shape?: SelectionButtonShape;
45
+ }
46
+
47
+ export class AgSelectionButton extends LitElement implements SelectionButtonProps, SelectionButtonInternalProps {
48
+ static override styles = css`
49
+ :host {
50
+ display: inline-flex;
51
+ }
52
+
53
+ .selection-button {
54
+ position: relative;
55
+ display: inline-flex;
56
+ align-items: center;
57
+ justify-content: center;
58
+ gap: var(--ag-space-2);
59
+ margin: 0;
60
+ font: inherit;
61
+ cursor: pointer;
62
+ transition:
63
+ background-color var(--ag-motion-fast) var(--ag-fx-ease-ease-out),
64
+ border-color var(--ag-motion-fast) var(--ag-fx-ease-ease-out),
65
+ color var(--ag-motion-fast) var(--ag-fx-ease-ease-out);
66
+ }
67
+
68
+ /* ========================================
69
+ SIZE VARIANTS
70
+ ======================================== */
71
+
72
+ /* Small */
73
+ .selection-button--sm {
74
+ height: var(--ag-space-9);
75
+ min-height: var(--ag-space-9);
76
+ font-size: var(--ag-font-size-xs);
77
+ padding-inline: calc(var(--ag-space-3) + var(--ag-space-3));
78
+ --_indicator-size: 0.75rem;
79
+ --_indicator-offset: var(--ag-space-1);
80
+ }
81
+
82
+ /* Medium (default) */
83
+ .selection-button--md {
84
+ height: var(--ag-space-10);
85
+ min-height: var(--ag-space-10);
86
+ font-size: var(--ag-font-size-sm);
87
+ padding-inline: calc(var(--ag-space-4) + var(--ag-space-4));
88
+ --_indicator-size: 0.875rem;
89
+ --_indicator-offset: var(--ag-space-1);
90
+ }
91
+
92
+ /* Large */
93
+ .selection-button--lg {
94
+ height: var(--ag-space-12);
95
+ min-height: var(--ag-space-12);
96
+ font-size: var(--ag-font-size-base);
97
+ padding-inline: calc(var(--ag-space-5) + var(--ag-space-5));
98
+ --_indicator-size: 1rem;
99
+ --_indicator-offset: var(--ag-space-1);
100
+ }
101
+
102
+ /* ========================================
103
+ SHAPE VARIANTS
104
+ ======================================== */
105
+
106
+ .selection-button--shape-default {
107
+ border-radius: 0;
108
+ }
109
+
110
+ .selection-button--shape-rounded {
111
+ border-radius: var(--ag-radius-md);
112
+ }
113
+
114
+ .selection-button--shape-capsule {
115
+ border-radius: var(--ag-radius-full);
116
+ /* 0.375rem is between --ag-space-1 (0.25rem) and --ag-space-2 (0.5rem) */
117
+ --_indicator-offset: 0.375rem;
118
+ }
119
+
120
+ /* ========================================
121
+ THEME VARIANTS - UNCHECKED STATE
122
+ Border/text uses theme color, transparent background
123
+ ======================================== */
124
+
125
+ /* Default (primary) - unchecked */
126
+ .selection-button--default {
127
+ background: transparent;
128
+ border: 1px solid var(--ag-primary);
129
+ color: var(--ag-primary-text);
130
+ --_indicator-bg: var(--ag-primary);
131
+ }
132
+
133
+ /* Success - unchecked */
134
+ .selection-button--success {
135
+ background: transparent;
136
+ border: 1px solid var(--ag-success);
137
+ color: var(--ag-success-text);
138
+ --_indicator-bg: var(--ag-success);
139
+ }
140
+
141
+ /* Info - unchecked */
142
+ .selection-button--info {
143
+ background: transparent;
144
+ border: 1px solid var(--ag-info);
145
+ color: var(--ag-info-text);
146
+ --_indicator-bg: var(--ag-info);
147
+ }
148
+
149
+ /* Warning - unchecked */
150
+ .selection-button--warning {
151
+ background: transparent;
152
+ border: 1px solid var(--ag-warning);
153
+ color: var(--ag-warning-text);
154
+ --_indicator-bg: var(--ag-warning);
155
+ }
156
+
157
+ /* Error - unchecked */
158
+ .selection-button--error {
159
+ background: transparent;
160
+ border: 1px solid var(--ag-danger);
161
+ color: var(--ag-danger-text);
162
+ --_indicator-bg: var(--ag-danger);
163
+ }
164
+
165
+ /* Monochrome - unchecked */
166
+ .selection-button--monochrome {
167
+ background: transparent;
168
+ border: 1px solid var(--ag-text-primary);
169
+ color: var(--ag-text-primary);
170
+ --_indicator-bg: var(--ag-text-primary);
171
+ }
172
+
173
+ /* ========================================
174
+ THEME VARIANTS - CHECKED STATE
175
+ Filled background with white text
176
+ ======================================== */
177
+
178
+ /* Default (primary) - checked */
179
+ .selection-button--default.selection-button--checked {
180
+ background: var(--ag-primary);
181
+ border-color: var(--ag-primary);
182
+ color: var(--ag-white);
183
+ }
184
+
185
+ /* Success - checked */
186
+ .selection-button--success.selection-button--checked {
187
+ background: var(--ag-success);
188
+ border-color: var(--ag-success);
189
+ color: var(--ag-white);
190
+ }
191
+
192
+ /* Info - checked */
193
+ .selection-button--info.selection-button--checked {
194
+ background: var(--ag-info);
195
+ border-color: var(--ag-info);
196
+ color: var(--ag-white);
197
+ }
198
+
199
+ /* Warning - checked */
200
+ .selection-button--warning.selection-button--checked {
201
+ background: var(--ag-warning);
202
+ border-color: var(--ag-warning);
203
+ color: var(--ag-neutral-900);
204
+ }
205
+
206
+ /* Error - checked */
207
+ .selection-button--error.selection-button--checked {
208
+ background: var(--ag-danger);
209
+ border-color: var(--ag-danger);
210
+ color: var(--ag-white);
211
+ }
212
+
213
+ /* Monochrome - checked */
214
+ .selection-button--monochrome.selection-button--checked {
215
+ background: var(--ag-background-primary-inverted);
216
+ border-color: var(--ag-background-primary-inverted);
217
+ color: var(--ag-text-primary-inverted);
218
+ }
219
+
220
+ /* ========================================
221
+ HOVER STATES
222
+ ======================================== */
223
+
224
+ /* Default - unchecked hover (fill with theme color) */
225
+ .selection-button--default:hover:not(.selection-button--disabled):not(.selection-button--checked) {
226
+ background: var(--ag-primary);
227
+ color: var(--ag-white);
228
+ }
229
+
230
+ /* Default - checked hover (darker shade) */
231
+ .selection-button--default.selection-button--checked:hover:not(.selection-button--disabled) {
232
+ background: var(--ag-primary-dark);
233
+ border-color: var(--ag-primary-dark);
234
+ }
235
+
236
+ /* Success - unchecked hover */
237
+ .selection-button--success:hover:not(.selection-button--disabled):not(.selection-button--checked) {
238
+ background: var(--ag-success);
239
+ color: var(--ag-white);
240
+ }
241
+
242
+ /* Success - checked hover */
243
+ .selection-button--success.selection-button--checked:hover:not(.selection-button--disabled) {
244
+ background: var(--ag-success-dark);
245
+ border-color: var(--ag-success-dark);
246
+ }
247
+
248
+ /* Info - unchecked hover */
249
+ .selection-button--info:hover:not(.selection-button--disabled):not(.selection-button--checked) {
250
+ background: var(--ag-info);
251
+ color: var(--ag-white);
252
+ }
253
+
254
+ /* Info - checked hover */
255
+ .selection-button--info.selection-button--checked:hover:not(.selection-button--disabled) {
256
+ background: var(--ag-info-dark);
257
+ border-color: var(--ag-info-dark);
258
+ }
259
+
260
+ /* Warning - unchecked hover */
261
+ .selection-button--warning:hover:not(.selection-button--disabled):not(.selection-button--checked) {
262
+ background: var(--ag-warning);
263
+ color: var(--ag-neutral-900);
264
+ }
265
+
266
+ /* Warning - checked hover */
267
+ .selection-button--warning.selection-button--checked:hover:not(.selection-button--disabled) {
268
+ background: var(--ag-warning-dark);
269
+ border-color: var(--ag-warning-dark);
270
+ }
271
+
272
+ /* Error - unchecked hover */
273
+ .selection-button--error:hover:not(.selection-button--disabled):not(.selection-button--checked) {
274
+ background: var(--ag-danger);
275
+ color: var(--ag-white);
276
+ }
277
+
278
+ /* Error - checked hover */
279
+ .selection-button--error.selection-button--checked:hover:not(.selection-button--disabled) {
280
+ background: var(--ag-danger-dark);
281
+ border-color: var(--ag-danger-dark);
282
+ }
283
+
284
+ /* Monochrome - unchecked hover */
285
+ .selection-button--monochrome:hover:not(.selection-button--disabled):not(.selection-button--checked) {
286
+ background: var(--ag-background-primary-inverted);
287
+ color: var(--ag-text-primary-inverted);
288
+ }
289
+
290
+ /* Monochrome - checked hover */
291
+ .selection-button--monochrome.selection-button--checked:hover:not(.selection-button--disabled) {
292
+ background: var(--ag-background-secondary-inverted);
293
+ border-color: var(--ag-background-secondary-inverted);
294
+ }
295
+
296
+ /* ========================================
297
+ FOCUS STATE
298
+ ======================================== */
299
+
300
+ .selection-button:focus-within:not(.selection-button--disabled) {
301
+ outline: var(--ag-focus-width) solid var(--ag-focus-ring-color, rgba(var(--ag-focus), 0.5));
302
+ outline-offset: var(--ag-focus-offset);
303
+ }
304
+
305
+ /* ========================================
306
+ DISABLED STATE
307
+ ======================================== */
308
+
309
+ .selection-button--disabled {
310
+ cursor: not-allowed;
311
+ opacity: 0.6;
312
+ }
313
+
314
+ /* ========================================
315
+ HIDDEN INPUT (screen reader accessible)
316
+ ======================================== */
317
+
318
+ .selection-button__input {
319
+ position: absolute;
320
+ width: 1px;
321
+ height: 1px;
322
+ padding: 0;
323
+ margin: -1px;
324
+ overflow: hidden;
325
+ clip: rect(0, 0, 0, 0);
326
+ white-space: nowrap;
327
+ border: 0;
328
+ }
329
+
330
+ /* ========================================
331
+ INDICATOR (corner badge, top-right)
332
+ ======================================== */
333
+
334
+ .selection-button__indicator {
335
+ position: absolute;
336
+ top: var(--_indicator-offset);
337
+ inset-inline-end: var(--_indicator-offset);
338
+ display: flex;
339
+ align-items: center;
340
+ justify-content: center;
341
+ width: var(--_indicator-size);
342
+ height: var(--_indicator-size);
343
+ opacity: 0;
344
+ transform: scale(0.6);
345
+ transition:
346
+ opacity var(--ag-motion-fast) ease-in-out,
347
+ transform var(--ag-motion-fast) var(--ag-fx-ease-ease-out);
348
+ }
349
+
350
+ .selection-button--checked .selection-button__indicator {
351
+ opacity: 1;
352
+ transform: scale(1);
353
+ }
354
+
355
+ .selection-button__indicator-svg {
356
+ width: 100%;
357
+ height: 100%;
358
+ }
359
+
360
+ /* Content wrapper */
361
+ .selection-button__content {
362
+ display: inline-flex;
363
+ align-items: center;
364
+ }
365
+
366
+ /* Visually hidden label for screen readers */
367
+ .selection-button__label-sr {
368
+ position: absolute !important;
369
+ width: 1px !important;
370
+ height: 1px !important;
371
+ padding: 0 !important;
372
+ margin: -1px !important;
373
+ overflow: hidden !important;
374
+ clip: rect(0, 0, 0, 0) !important;
375
+ white-space: nowrap !important;
376
+ border: 0 !important;
377
+ }
378
+
379
+ /* ========================================
380
+ REDUCED MOTION
381
+ ======================================== */
382
+
383
+ @media (prefers-reduced-motion: reduce) {
384
+ .selection-button,
385
+ .selection-button__indicator {
386
+ transition: none;
387
+ }
388
+ }
389
+
390
+ /* ========================================
391
+ HIGH CONTRAST MODE
392
+ ======================================== */
393
+
394
+ @media (forced-colors: active) {
395
+ .selection-button--checked {
396
+ outline: 2px solid CanvasText;
397
+ }
398
+ .selection-button__indicator-svg circle {
399
+ fill: CanvasText;
400
+ }
401
+ .selection-button__indicator-svg path,
402
+ .selection-button__indicator-svg circle:last-child {
403
+ stroke: Canvas;
404
+ fill: Canvas;
405
+ }
406
+ }
407
+ `;
408
+
409
+ @property({ type: String, reflect: true })
410
+ declare value: string;
411
+
412
+ @property({ type: String })
413
+ declare label: string;
414
+
415
+ @property({ type: Boolean, reflect: true })
416
+ declare checked: boolean;
417
+
418
+ @property({ type: Boolean, reflect: true })
419
+ declare disabled: boolean;
420
+
421
+ // Internal props set by parent group
422
+ @property({ type: String, attribute: false })
423
+ declare _type: 'radio' | 'checkbox';
424
+
425
+ @property({ type: String, attribute: false })
426
+ declare _name: string;
427
+
428
+ @property({ type: String, attribute: false })
429
+ declare _theme: SelectionButtonTheme;
430
+
431
+ @property({ type: String, attribute: false })
432
+ declare _size: SelectionButtonSize;
433
+
434
+ @property({ type: String, attribute: false })
435
+ declare _shape: SelectionButtonShape;
436
+
437
+ constructor() {
438
+ super();
439
+ this.value = '';
440
+ this.label = '';
441
+ this.checked = false;
442
+ this.disabled = false;
443
+ this._type = 'radio';
444
+ this._name = '';
445
+ this._theme = '';
446
+ this._size = 'md';
447
+ this._shape = '';
448
+ }
449
+
450
+ override focus() {
451
+ const label = this.shadowRoot?.querySelector('.selection-button') as HTMLElement | null;
452
+ label?.focus();
453
+ }
454
+
455
+ private _handleClick(e: Event) {
456
+ // Prevent label from forwarding click to input (we handle selection ourselves)
457
+ e.preventDefault();
458
+
459
+ if (this.disabled) {
460
+ return;
461
+ }
462
+
463
+ // For radio, always select; for checkbox, toggle
464
+ const newChecked = this._type === 'radio' ? true : !this.checked;
465
+
466
+ // Dispatch event to parent group
467
+ this.dispatchEvent(new CustomEvent('selection-button-change', {
468
+ detail: {
469
+ value: this.value,
470
+ checked: newChecked,
471
+ },
472
+ bubbles: true,
473
+ composed: true,
474
+ }));
475
+ }
476
+
477
+ private _handleKeyDown(e: KeyboardEvent) {
478
+ if (this.disabled) return;
479
+
480
+ // Space or Enter to select/toggle
481
+ if (e.key === ' ' || e.key === 'Enter') {
482
+ e.preventDefault();
483
+ this._handleClick(e);
484
+ }
485
+ }
486
+
487
+ private _renderIndicator() {
488
+ if (this._type === 'checkbox') {
489
+ // Circle with checkmark for checkbox
490
+ return html`
491
+ <svg class="selection-button__indicator-svg" viewBox="0 0 20 20" aria-hidden="true">
492
+ <circle cx="10" cy="10" r="10" fill="currentColor" />
493
+ <path d="M6 10l3 3 5-6" stroke="var(--ag-selection-button-indicator-check, var(--_indicator-bg))"
494
+ stroke-width="1.67" stroke-linecap="round" stroke-linejoin="round" fill="none" />
495
+ </svg>
496
+ `;
497
+ }
498
+ // Circle with dot for radio
499
+ return html`
500
+ <svg class="selection-button__indicator-svg" viewBox="0 0 20 20" aria-hidden="true">
501
+ <circle cx="10" cy="10" r="10" fill="currentColor" />
502
+ <circle cx="10" cy="10" r="4" fill="var(--ag-selection-button-indicator-dot, var(--_indicator-bg))" />
503
+ </svg>
504
+ `;
505
+ }
506
+
507
+ override render() {
508
+ // Map empty theme to 'default' for CSS class
509
+ const themeClass = this._theme || 'default';
510
+ const sizeClass = this._size || 'md';
511
+ const shapeClass = this._shape || 'default';
512
+
513
+ const containerClasses = [
514
+ 'selection-button',
515
+ `selection-button--${themeClass}`,
516
+ `selection-button--${sizeClass}`,
517
+ `selection-button--shape-${shapeClass}`,
518
+ this.checked ? 'selection-button--checked' : '',
519
+ this.disabled ? 'selection-button--disabled' : '',
520
+ ].filter(Boolean).join(' ');
521
+
522
+ return html`
523
+ <label
524
+ class="${containerClasses}"
525
+ part="ag-selection-button-container"
526
+ tabindex="${this.disabled ? -1 : 0}"
527
+ @click="${this._handleClick}"
528
+ @keydown="${this._handleKeyDown}"
529
+ >
530
+ <input
531
+ type="${this._type}"
532
+ class="selection-button__input"
533
+ part="ag-selection-button-control"
534
+ name="${this._name || nothing}"
535
+ value="${this.value}"
536
+ .checked="${this.checked}"
537
+ ?disabled="${this.disabled}"
538
+ aria-checked="${this.checked ? 'true' : 'false'}"
539
+ tabindex="-1"
540
+ />
541
+ <span class="selection-button__label-sr">${this.label}</span>
542
+ <span class="selection-button__content" part="ag-selection-button-content">
543
+ <slot></slot>
544
+ </span>
545
+ <span class="selection-button__indicator" part="ag-selection-button-indicator" aria-hidden="true">
546
+ ${this._renderIndicator()}
547
+ </span>
548
+ </label>
549
+ `;
550
+ }
551
+ }
@@ -0,0 +1,16 @@
1
+ import * as React from 'react';
2
+ import { createComponent } from '@lit/react';
3
+ import { AgSelectionButton, type SelectionButtonProps } from '../core/SelectionButton';
4
+
5
+ export interface ReactSelectionButtonProps extends SelectionButtonProps {
6
+ children?: React.ReactNode;
7
+ className?: string;
8
+ }
9
+
10
+ export const ReactSelectionButton = createComponent({
11
+ tagName: 'ag-selection-button',
12
+ elementClass: AgSelectionButton,
13
+ react: React,
14
+ });
15
+
16
+ export type { SelectionButtonProps } from '../core/SelectionButton';
@@ -0,0 +1,4 @@
1
+ export { ReactSelectionButton, type ReactSelectionButtonProps } from './ReactSelectionButton';
2
+
3
+ // Re-export types from core for convenience
4
+ export type { SelectionButtonProps } from '../core/SelectionButton';
@@ -0,0 +1,33 @@
1
+ <template>
2
+ <ag-selection-button
3
+ :value="value"
4
+ :label="label"
5
+ .checked="checked"
6
+ .disabled="disabled"
7
+ v-bind="$attrs"
8
+ >
9
+ <slot />
10
+ </ag-selection-button>
11
+ </template>
12
+
13
+ <script setup lang="ts">
14
+ import '../core/SelectionButton';
15
+
16
+ export interface VueSelectionButtonProps {
17
+ /** Unique value for this button (required) */
18
+ value: string;
19
+ /** Accessible label for this button (required) */
20
+ label: string;
21
+ /** Whether this button is selected */
22
+ checked?: boolean;
23
+ /** Whether this button is disabled */
24
+ disabled?: boolean;
25
+ }
26
+
27
+ withDefaults(defineProps<VueSelectionButtonProps>(), {
28
+ value: '',
29
+ label: '',
30
+ checked: false,
31
+ disabled: false,
32
+ });
33
+ </script>
@@ -0,0 +1,5 @@
1
+ import VueSelectionButton from './VueSelectionButton.vue';
2
+ import type { SelectionButtonProps as VueSelectionButtonProps } from '../core/_SelectionButton';
3
+
4
+ export { VueSelectionButton };
5
+ export type { VueSelectionButtonProps };
@@ -0,0 +1,13 @@
1
+ import { AgSelectionButtonGroup } from './_SelectionButtonGroup.js';
2
+
3
+ if (!customElements.get('ag-selection-button-group')) {
4
+ customElements.define('ag-selection-button-group', AgSelectionButtonGroup);
5
+ }
6
+
7
+ declare global {
8
+ interface HTMLElementTagNameMap {
9
+ 'ag-selection-button-group': AgSelectionButtonGroup;
10
+ }
11
+ }
12
+
13
+ export * from './_SelectionButtonGroup.js';