tyrell-components 1.0.0-RC13 → 1.0.0-RC14

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 (355) hide show
  1. package/README.md +1 -1
  2. package/css/tyrell-theme.css +167 -178
  3. package/css/tyrell.css +19 -0
  4. package/dist/tyrell-theme.css +167 -178
  5. package/dist/tyrell.css +19 -0
  6. package/dist/tyrell.js +1 -1
  7. package/lib/base/ty-component.d.ts +20 -10
  8. package/lib/base/ty-component.js +21 -144
  9. package/lib/components/button.d.ts +2 -16
  10. package/lib/components/button.js +0 -36
  11. package/lib/components/calendar-month.d.ts +2 -48
  12. package/lib/components/calendar-month.js +4 -166
  13. package/lib/components/calendar-navigation.d.ts +3 -48
  14. package/lib/components/calendar-navigation.js +3 -126
  15. package/lib/components/calendar.d.ts +3 -80
  16. package/lib/components/calendar.js +8 -230
  17. package/lib/components/checkbox.d.ts +4 -71
  18. package/lib/components/checkbox.js +7 -151
  19. package/lib/components/copy.d.ts +3 -56
  20. package/lib/components/copy.js +1 -120
  21. package/lib/components/date-picker.d.ts +13 -162
  22. package/lib/components/date-picker.js +41 -592
  23. package/lib/components/file-upload.d.ts +9 -15
  24. package/lib/components/file-upload.js +19 -41
  25. package/lib/components/icon.d.ts +3 -24
  26. package/lib/components/icon.js +1 -90
  27. package/lib/components/input.d.ts +7 -107
  28. package/lib/components/input.js +5 -193
  29. package/lib/components/modal.d.ts +17 -26
  30. package/lib/components/modal.js +57 -201
  31. package/lib/components/option.d.ts +2 -9
  32. package/lib/components/option.js +0 -48
  33. package/lib/components/popup.d.ts +2 -17
  34. package/lib/components/popup.js +8 -139
  35. package/lib/components/radio.d.ts +3 -23
  36. package/lib/components/radio.js +10 -65
  37. package/lib/components/resize-observer.d.ts +3 -30
  38. package/lib/components/resize-observer.js +12 -46
  39. package/lib/components/scroll-container.d.ts +2 -12
  40. package/lib/components/scroll-container.js +3 -46
  41. package/lib/components/select.d.ts +22 -153
  42. package/lib/components/select.js +33 -590
  43. package/lib/components/selected-tags.d.ts +4 -47
  44. package/lib/components/selected-tags.js +1 -95
  45. package/lib/components/step.d.ts +1 -6
  46. package/lib/components/step.js +0 -6
  47. package/lib/components/switch.d.ts +0 -11
  48. package/lib/components/switch.js +2 -36
  49. package/lib/components/tab.d.ts +1 -6
  50. package/lib/components/tab.js +0 -7
  51. package/lib/components/tabs.d.ts +5 -63
  52. package/lib/components/tabs.js +20 -283
  53. package/lib/components/tag.d.ts +2 -36
  54. package/lib/components/tag.js +5 -105
  55. package/lib/components/textarea.d.ts +6 -86
  56. package/lib/components/textarea.js +2 -173
  57. package/lib/components/tooltip.d.ts +3 -11
  58. package/lib/components/tooltip.js +24 -160
  59. package/lib/components/wizard.d.ts +6 -54
  60. package/lib/components/wizard.js +15 -228
  61. package/lib/icons/fontawesome/brands.d.ts +0 -1
  62. package/lib/icons/fontawesome/brands.js +0 -8
  63. package/lib/icons/fontawesome/regular.d.ts +0 -1
  64. package/lib/icons/fontawesome/regular.js +0 -8
  65. package/lib/icons/fontawesome/solid.d.ts +0 -1
  66. package/lib/icons/fontawesome/solid.js +0 -8
  67. package/lib/icons/heroicons/micro.d.ts +0 -1
  68. package/lib/icons/heroicons/micro.js +0 -8
  69. package/lib/icons/heroicons/mini.d.ts +0 -1
  70. package/lib/icons/heroicons/mini.js +0 -8
  71. package/lib/icons/heroicons/outline.d.ts +0 -1
  72. package/lib/icons/heroicons/outline.js +0 -8
  73. package/lib/icons/heroicons/solid.d.ts +0 -1
  74. package/lib/icons/heroicons/solid.js +0 -8
  75. package/lib/icons/lucide.d.ts +0 -1
  76. package/lib/icons/lucide.js +0 -1872
  77. package/lib/icons/material/filled.d.ts +0 -1
  78. package/lib/icons/material/filled.js +0 -10
  79. package/lib/icons/material/outlined.d.ts +0 -1
  80. package/lib/icons/material/outlined.js +0 -10
  81. package/lib/icons/material/round.d.ts +0 -1
  82. package/lib/icons/material/round.js +0 -10
  83. package/lib/icons/material/sharp.d.ts +0 -1
  84. package/lib/icons/material/sharp.js +0 -10
  85. package/lib/icons/material/two-tone.d.ts +0 -1
  86. package/lib/icons/material/two-tone.js +0 -10
  87. package/lib/index.d.ts +0 -1
  88. package/lib/index.js +0 -20
  89. package/lib/styles/button.d.ts +2 -20
  90. package/lib/styles/button.js +22 -122
  91. package/lib/styles/calendar-month.d.ts +1 -5
  92. package/lib/styles/calendar-month.js +4 -61
  93. package/lib/styles/calendar-navigation.d.ts +2 -6
  94. package/lib/styles/calendar-navigation.js +2 -27
  95. package/lib/styles/calendar.d.ts +1 -2
  96. package/lib/styles/calendar.js +1 -14
  97. package/lib/styles/checkbox.d.ts +0 -1
  98. package/lib/styles/checkbox.js +1 -23
  99. package/lib/styles/copy.d.ts +0 -1
  100. package/lib/styles/copy.js +2 -17
  101. package/lib/styles/custom-scrollbar.d.ts +1 -2
  102. package/lib/styles/custom-scrollbar.js +3 -18
  103. package/lib/styles/date-picker.d.ts +1 -5
  104. package/lib/styles/date-picker.js +35 -39
  105. package/lib/styles/file-upload.d.ts +1 -2
  106. package/lib/styles/file-upload.js +1 -16
  107. package/lib/styles/icon.d.ts +2 -6
  108. package/lib/styles/icon.js +7 -21
  109. package/lib/styles/input.d.ts +1 -6
  110. package/lib/styles/input.js +5 -54
  111. package/lib/styles/modal.d.ts +1 -2
  112. package/lib/styles/modal.js +21 -23
  113. package/lib/styles/option.d.ts +2 -6
  114. package/lib/styles/option.js +17 -12
  115. package/lib/styles/popup.d.ts +1 -2
  116. package/lib/styles/popup.js +26 -30
  117. package/lib/styles/radio.d.ts +0 -1
  118. package/lib/styles/radio.js +2 -16
  119. package/lib/styles/resize-observer.d.ts +1 -2
  120. package/lib/styles/resize-observer.js +0 -7
  121. package/lib/styles/scroll-container.d.ts +1 -2
  122. package/lib/styles/scroll-container.js +0 -19
  123. package/lib/styles/select-base.d.ts +0 -1
  124. package/lib/styles/select-base.js +68 -79
  125. package/lib/styles/select.d.ts +1 -2
  126. package/lib/styles/select.js +7 -15
  127. package/lib/styles/step.d.ts +1 -2
  128. package/lib/styles/step.js +0 -4
  129. package/lib/styles/switch.d.ts +0 -1
  130. package/lib/styles/switch.js +2 -20
  131. package/lib/styles/tab.d.ts +1 -2
  132. package/lib/styles/tab.js +0 -5
  133. package/lib/styles/tabs.d.ts +3 -11
  134. package/lib/styles/tabs.js +10 -48
  135. package/lib/styles/tag.d.ts +1 -5
  136. package/lib/styles/tag.js +2 -31
  137. package/lib/styles/textarea.d.ts +1 -2
  138. package/lib/styles/textarea.js +2 -45
  139. package/lib/styles/tooltip.d.ts +0 -1
  140. package/lib/styles/tooltip.js +0 -10
  141. package/lib/styles/wizard.d.ts +5 -21
  142. package/lib/styles/wizard.js +8 -88
  143. package/lib/types/common.d.ts +0 -2
  144. package/lib/types/common.js +0 -12
  145. package/lib/utils/calendar-utils.d.ts +4 -21
  146. package/lib/utils/calendar-utils.js +4 -177
  147. package/lib/utils/custom-scrollbar.d.ts +6 -20
  148. package/lib/utils/custom-scrollbar.js +1 -45
  149. package/lib/utils/flavor-sheet.d.ts +0 -1
  150. package/lib/utils/flavor-sheet.js +0 -23
  151. package/lib/utils/icon-registry.d.ts +0 -2
  152. package/lib/utils/icon-registry.js +1 -107
  153. package/lib/utils/icons.d.ts +0 -1
  154. package/lib/utils/icons.js +0 -9
  155. package/lib/utils/loader-registry.d.ts +0 -1
  156. package/lib/utils/loader-registry.js +0 -32
  157. package/lib/utils/locale.d.ts +2 -23
  158. package/lib/utils/locale.js +0 -86
  159. package/lib/utils/mobile.d.ts +0 -1
  160. package/lib/utils/mobile.js +0 -17
  161. package/lib/utils/number-format.d.ts +6 -3
  162. package/lib/utils/number-format.js +11 -67
  163. package/lib/utils/positioning.d.ts +50 -7
  164. package/lib/utils/positioning.js +52 -62
  165. package/lib/utils/property-capture.d.ts +5 -27
  166. package/lib/utils/property-capture.js +0 -108
  167. package/lib/utils/property-manager.d.ts +0 -1
  168. package/lib/utils/property-manager.js +0 -70
  169. package/lib/utils/resize-observer.d.ts +0 -1
  170. package/lib/utils/resize-observer.js +0 -36
  171. package/lib/utils/scroll-lock.d.ts +4 -11
  172. package/lib/utils/scroll-lock.js +0 -107
  173. package/lib/utils/styles.d.ts +0 -1
  174. package/lib/utils/styles.js +0 -24
  175. package/lib/version.d.ts +1 -2
  176. package/lib/version.js +1 -11
  177. package/package.json +2 -2
  178. package/lib/base/ty-component.d.ts.map +0 -1
  179. package/lib/base/ty-component.js.map +0 -1
  180. package/lib/components/button.d.ts.map +0 -1
  181. package/lib/components/button.js.map +0 -1
  182. package/lib/components/calendar-month.d.ts.map +0 -1
  183. package/lib/components/calendar-month.js.map +0 -1
  184. package/lib/components/calendar-navigation.d.ts.map +0 -1
  185. package/lib/components/calendar-navigation.js.map +0 -1
  186. package/lib/components/calendar.d.ts.map +0 -1
  187. package/lib/components/calendar.js.map +0 -1
  188. package/lib/components/checkbox.d.ts.map +0 -1
  189. package/lib/components/checkbox.js.map +0 -1
  190. package/lib/components/copy.d.ts.map +0 -1
  191. package/lib/components/copy.js.map +0 -1
  192. package/lib/components/date-picker.d.ts.map +0 -1
  193. package/lib/components/date-picker.js.map +0 -1
  194. package/lib/components/file-upload.d.ts.map +0 -1
  195. package/lib/components/file-upload.js.map +0 -1
  196. package/lib/components/icon.d.ts.map +0 -1
  197. package/lib/components/icon.js.map +0 -1
  198. package/lib/components/input.d.ts.map +0 -1
  199. package/lib/components/input.js.map +0 -1
  200. package/lib/components/modal.d.ts.map +0 -1
  201. package/lib/components/modal.js.map +0 -1
  202. package/lib/components/option.d.ts.map +0 -1
  203. package/lib/components/option.js.map +0 -1
  204. package/lib/components/popup.d.ts.map +0 -1
  205. package/lib/components/popup.js.map +0 -1
  206. package/lib/components/radio.d.ts.map +0 -1
  207. package/lib/components/radio.js.map +0 -1
  208. package/lib/components/resize-observer.d.ts.map +0 -1
  209. package/lib/components/resize-observer.js.map +0 -1
  210. package/lib/components/scroll-container.d.ts.map +0 -1
  211. package/lib/components/scroll-container.js.map +0 -1
  212. package/lib/components/select.d.ts.map +0 -1
  213. package/lib/components/select.js.map +0 -1
  214. package/lib/components/selected-tags.d.ts.map +0 -1
  215. package/lib/components/selected-tags.js.map +0 -1
  216. package/lib/components/step.d.ts.map +0 -1
  217. package/lib/components/step.js.map +0 -1
  218. package/lib/components/switch.d.ts.map +0 -1
  219. package/lib/components/switch.js.map +0 -1
  220. package/lib/components/tab.d.ts.map +0 -1
  221. package/lib/components/tab.js.map +0 -1
  222. package/lib/components/tabs.d.ts.map +0 -1
  223. package/lib/components/tabs.js.map +0 -1
  224. package/lib/components/tag.d.ts.map +0 -1
  225. package/lib/components/tag.js.map +0 -1
  226. package/lib/components/textarea.d.ts.map +0 -1
  227. package/lib/components/textarea.js.map +0 -1
  228. package/lib/components/tooltip.d.ts.map +0 -1
  229. package/lib/components/tooltip.js.map +0 -1
  230. package/lib/components/wizard.d.ts.map +0 -1
  231. package/lib/components/wizard.js.map +0 -1
  232. package/lib/icons/fontawesome/brands.d.ts.map +0 -1
  233. package/lib/icons/fontawesome/brands.js.map +0 -1
  234. package/lib/icons/fontawesome/regular.d.ts.map +0 -1
  235. package/lib/icons/fontawesome/regular.js.map +0 -1
  236. package/lib/icons/fontawesome/solid.d.ts.map +0 -1
  237. package/lib/icons/fontawesome/solid.js.map +0 -1
  238. package/lib/icons/heroicons/micro.d.ts.map +0 -1
  239. package/lib/icons/heroicons/micro.js.map +0 -1
  240. package/lib/icons/heroicons/mini.d.ts.map +0 -1
  241. package/lib/icons/heroicons/mini.js.map +0 -1
  242. package/lib/icons/heroicons/outline.d.ts.map +0 -1
  243. package/lib/icons/heroicons/outline.js.map +0 -1
  244. package/lib/icons/heroicons/solid.d.ts.map +0 -1
  245. package/lib/icons/heroicons/solid.js.map +0 -1
  246. package/lib/icons/lucide.d.ts.map +0 -1
  247. package/lib/icons/lucide.js.map +0 -1
  248. package/lib/icons/material/filled.d.ts.map +0 -1
  249. package/lib/icons/material/filled.js.map +0 -1
  250. package/lib/icons/material/outlined.d.ts.map +0 -1
  251. package/lib/icons/material/outlined.js.map +0 -1
  252. package/lib/icons/material/round.d.ts.map +0 -1
  253. package/lib/icons/material/round.js.map +0 -1
  254. package/lib/icons/material/sharp.d.ts.map +0 -1
  255. package/lib/icons/material/sharp.js.map +0 -1
  256. package/lib/icons/material/two-tone.d.ts.map +0 -1
  257. package/lib/icons/material/two-tone.js.map +0 -1
  258. package/lib/index.d.ts.map +0 -1
  259. package/lib/index.js.map +0 -1
  260. package/lib/styles/button.d.ts.map +0 -1
  261. package/lib/styles/button.js.map +0 -1
  262. package/lib/styles/calendar-month.d.ts.map +0 -1
  263. package/lib/styles/calendar-month.js.map +0 -1
  264. package/lib/styles/calendar-navigation.d.ts.map +0 -1
  265. package/lib/styles/calendar-navigation.js.map +0 -1
  266. package/lib/styles/calendar.d.ts.map +0 -1
  267. package/lib/styles/calendar.js.map +0 -1
  268. package/lib/styles/checkbox.d.ts.map +0 -1
  269. package/lib/styles/checkbox.js.map +0 -1
  270. package/lib/styles/copy.d.ts.map +0 -1
  271. package/lib/styles/copy.js.map +0 -1
  272. package/lib/styles/custom-scrollbar.d.ts.map +0 -1
  273. package/lib/styles/custom-scrollbar.js.map +0 -1
  274. package/lib/styles/date-picker.d.ts.map +0 -1
  275. package/lib/styles/date-picker.js.map +0 -1
  276. package/lib/styles/file-upload.d.ts.map +0 -1
  277. package/lib/styles/file-upload.js.map +0 -1
  278. package/lib/styles/icon.d.ts.map +0 -1
  279. package/lib/styles/icon.js.map +0 -1
  280. package/lib/styles/input.d.ts.map +0 -1
  281. package/lib/styles/input.js.map +0 -1
  282. package/lib/styles/modal.d.ts.map +0 -1
  283. package/lib/styles/modal.js.map +0 -1
  284. package/lib/styles/multiselect.d.ts +0 -8
  285. package/lib/styles/multiselect.d.ts.map +0 -1
  286. package/lib/styles/multiselect.js +0 -849
  287. package/lib/styles/multiselect.js.map +0 -1
  288. package/lib/styles/option.d.ts.map +0 -1
  289. package/lib/styles/option.js.map +0 -1
  290. package/lib/styles/popup.d.ts.map +0 -1
  291. package/lib/styles/popup.js.map +0 -1
  292. package/lib/styles/radio.d.ts.map +0 -1
  293. package/lib/styles/radio.js.map +0 -1
  294. package/lib/styles/resize-observer.d.ts.map +0 -1
  295. package/lib/styles/resize-observer.js.map +0 -1
  296. package/lib/styles/scroll-container.d.ts.map +0 -1
  297. package/lib/styles/scroll-container.js.map +0 -1
  298. package/lib/styles/select-base.d.ts.map +0 -1
  299. package/lib/styles/select-base.js.map +0 -1
  300. package/lib/styles/select.d.ts.map +0 -1
  301. package/lib/styles/select.js.map +0 -1
  302. package/lib/styles/step.d.ts.map +0 -1
  303. package/lib/styles/step.js.map +0 -1
  304. package/lib/styles/switch.d.ts.map +0 -1
  305. package/lib/styles/switch.js.map +0 -1
  306. package/lib/styles/tab.d.ts.map +0 -1
  307. package/lib/styles/tab.js.map +0 -1
  308. package/lib/styles/tabs.d.ts.map +0 -1
  309. package/lib/styles/tabs.js.map +0 -1
  310. package/lib/styles/tag.d.ts.map +0 -1
  311. package/lib/styles/tag.js.map +0 -1
  312. package/lib/styles/textarea.d.ts.map +0 -1
  313. package/lib/styles/textarea.js.map +0 -1
  314. package/lib/styles/tooltip.d.ts.map +0 -1
  315. package/lib/styles/tooltip.js.map +0 -1
  316. package/lib/styles/wizard.d.ts.map +0 -1
  317. package/lib/styles/wizard.js.map +0 -1
  318. package/lib/types/common.d.ts.map +0 -1
  319. package/lib/types/common.js.map +0 -1
  320. package/lib/utils/calendar-utils.d.ts.map +0 -1
  321. package/lib/utils/calendar-utils.js.map +0 -1
  322. package/lib/utils/custom-scrollbar.d.ts.map +0 -1
  323. package/lib/utils/custom-scrollbar.js.map +0 -1
  324. package/lib/utils/flavor-sheet.d.ts.map +0 -1
  325. package/lib/utils/flavor-sheet.js.map +0 -1
  326. package/lib/utils/icon-registry.d.ts.map +0 -1
  327. package/lib/utils/icon-registry.js.map +0 -1
  328. package/lib/utils/icons.d.ts.map +0 -1
  329. package/lib/utils/icons.js.map +0 -1
  330. package/lib/utils/loader-registry.d.ts.map +0 -1
  331. package/lib/utils/loader-registry.js.map +0 -1
  332. package/lib/utils/locale.d.ts.map +0 -1
  333. package/lib/utils/locale.js.map +0 -1
  334. package/lib/utils/mobile.d.ts.map +0 -1
  335. package/lib/utils/mobile.js.map +0 -1
  336. package/lib/utils/number-format.d.ts.map +0 -1
  337. package/lib/utils/number-format.js.map +0 -1
  338. package/lib/utils/parse-boolean.d.ts +0 -39
  339. package/lib/utils/parse-boolean.d.ts.map +0 -1
  340. package/lib/utils/parse-boolean.js +0 -58
  341. package/lib/utils/parse-boolean.js.map +0 -1
  342. package/lib/utils/positioning.d.ts.map +0 -1
  343. package/lib/utils/positioning.js.map +0 -1
  344. package/lib/utils/property-capture.d.ts.map +0 -1
  345. package/lib/utils/property-capture.js.map +0 -1
  346. package/lib/utils/property-manager.d.ts.map +0 -1
  347. package/lib/utils/property-manager.js.map +0 -1
  348. package/lib/utils/resize-observer.d.ts.map +0 -1
  349. package/lib/utils/resize-observer.js.map +0 -1
  350. package/lib/utils/scroll-lock.d.ts.map +0 -1
  351. package/lib/utils/scroll-lock.js.map +0 -1
  352. package/lib/utils/styles.d.ts.map +0 -1
  353. package/lib/utils/styles.js.map +0 -1
  354. package/lib/version.d.ts.map +0 -1
  355. package/lib/version.js.map +0 -1
@@ -1,19 +1,7 @@
1
1
  /**
2
- * TyCheckbox Web Component
3
- *
4
- * "Just the box" primitive — renders only the checkbox visual + state.
5
- * Label, required asterisk, and error display are the consumer's
6
- * responsibility — wrap in a `<label>` for click delegation.
7
- *
8
- * - Boolean checked state, form-associated
9
- * - Keyboard accessibility (Space/Enter)
10
- * - Sizes (xs, sm, md, lg, xl) and semantic flavors
11
- *
12
- * @example
13
- * <label>
14
- * <ty-checkbox name="terms" required></ty-checkbox>
15
- * I agree to the <a href="/terms">terms</a>
16
- * </label>
2
+ * TyCheckbox Web Component — "just the box" primitive: renders only the
3
+ * checkbox visual + state. Label, required asterisk and error display are the
4
+ * consumer's responsibility — wrap in a `<label>` for click delegation.
17
5
  */
18
6
  import type { Flavor, Size } from "../types/common.js";
19
7
  import { TyComponent } from "../base/ty-component.js";
@@ -41,42 +29,6 @@ export interface TyCheckboxElement extends HTMLElement {
41
29
  }
42
30
  /**
43
31
  * Ty Checkbox Component
44
- *
45
- * @example
46
- * ```html
47
- * <!-- Basic checkbox -->
48
- * <ty-checkbox>Subscribe to newsletter</ty-checkbox>
49
- *
50
- * <!-- Pre-checked with custom value -->
51
- * <ty-checkbox
52
- * checked
53
- * value="accepted"
54
- * required>
55
- * Accept terms
56
- * </ty-checkbox>
57
- *
58
- * <!-- With error state -->
59
- * <ty-checkbox
60
- * required
61
- * error="You must agree to continue"
62
- * flavor="danger">
63
- * Agree to terms
64
- * </ty-checkbox>
65
- *
66
- * <!-- Different sizes -->
67
- * <ty-checkbox size="sm">Small</ty-checkbox>
68
- * <ty-checkbox size="lg">Large</ty-checkbox>
69
- *
70
- * <!-- Semantic flavors -->
71
- * <ty-checkbox flavor="primary" checked>Primary</ty-checkbox>
72
- * <ty-checkbox flavor="success" checked>Success</ty-checkbox>
73
- *
74
- * <!-- Rich content (with icon) -->
75
- * <ty-checkbox checked>
76
- * <ty-icon name="star"></ty-icon>
77
- * Premium feature
78
- * </ty-checkbox>
79
- * ```
80
32
  */
81
33
  export declare class TyCheckbox extends TyComponent<CheckboxState> implements TyCheckboxElement {
82
34
  static formAssociated: boolean;
@@ -131,16 +83,10 @@ export declare class TyCheckbox extends TyComponent<CheckboxState> implements Ty
131
83
  private _focusHandler;
132
84
  private _blurHandler;
133
85
  constructor();
134
- /**
135
- * Called when component connects to DOM
136
- * TyComponent already handled pre-connection property capture
137
- */
86
+ /** TyComponent already handled pre-connection property capture. */
138
87
  protected onConnect(): void;
139
88
  /** Custom (non-built-in) flavors — see utils/flavor-sheet.ts. */
140
89
  private _syncCustomFlavor;
141
- /**
142
- * Called when component disconnects from DOM
143
- */
144
90
  protected onDisconnect(): void;
145
91
  /**
146
92
  * Handle property changes - called BEFORE render
@@ -150,21 +96,9 @@ export declare class TyCheckbox extends TyComponent<CheckboxState> implements Ty
150
96
  * Override form value to return value when checked, null when unchecked
151
97
  */
152
98
  protected getFormValue(): FormDataEntryValue | null;
153
- /**
154
- * Build CSS class list for checkbox container
155
- */
156
99
  private buildClassList;
157
- /**
158
- * Handle checkbox click event - standards compliant approach
159
- */
160
100
  private handleCheckboxClick;
161
- /**
162
- * Handle checkbox keyboard events - space/enter to toggle
163
- */
164
101
  private handleCheckboxKeydown;
165
- /**
166
- * Remove event listeners for cleanup
167
- */
168
102
  private removeEventListeners;
169
103
  /**
170
104
  * Setup event listeners for checkbox functionality
@@ -197,4 +131,3 @@ export declare class TyCheckbox extends TyComponent<CheckboxState> implements Ty
197
131
  get form(): HTMLFormElement | null;
198
132
  }
199
133
  export {};
200
- //# sourceMappingURL=checkbox.d.ts.map
@@ -1,136 +1,39 @@
1
- /**
2
- * TyCheckbox Web Component
3
- *
4
- * "Just the box" primitive — renders only the checkbox visual + state.
5
- * Label, required asterisk, and error display are the consumer's
6
- * responsibility — wrap in a `<label>` for click delegation.
7
- *
8
- * - Boolean checked state, form-associated
9
- * - Keyboard accessibility (Space/Enter)
10
- * - Sizes (xs, sm, md, lg, xl) and semantic flavors
11
- *
12
- * @example
13
- * <label>
14
- * <ty-checkbox name="terms" required></ty-checkbox>
15
- * I agree to the <a href="/terms">terms</a>
16
- * </label>
17
- */
18
1
  import { TyComponent } from "../base/ty-component.js";
19
2
  import { ensureStyles } from "../utils/styles.js";
20
3
  import { syncCustomFlavorSheet } from "../utils/flavor-sheet.js";
21
4
  import { checkboxStyles, checkboxCustomFlavorCss } from "../styles/checkbox.js";
22
- /**
23
- * Checkmark icon (Lucide `check`, same glyph as ty-option's selected check;
24
- * stroke-width 3 for presence at 16px — it replaces a heavy fill glyph).
25
- * Same glyph for checked and unchecked — checked shows it at full color,
26
- * unchecked at faint color (see styles).
27
- */
28
5
  const CHECK_ICON = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"><path d="M20 6 9 17l-5-5"/></svg>`;
29
- /**
30
- * Dash icon (Lucide `minus`) — shown while indeterminate.
31
- */
32
6
  const DASH_ICON = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"><path d="M5 12h14"/></svg>`;
33
- /**
34
- * Ty Checkbox Component
35
- *
36
- * @example
37
- * ```html
38
- * <!-- Basic checkbox -->
39
- * <ty-checkbox>Subscribe to newsletter</ty-checkbox>
40
- *
41
- * <!-- Pre-checked with custom value -->
42
- * <ty-checkbox
43
- * checked
44
- * value="accepted"
45
- * required>
46
- * Accept terms
47
- * </ty-checkbox>
48
- *
49
- * <!-- With error state -->
50
- * <ty-checkbox
51
- * required
52
- * error="You must agree to continue"
53
- * flavor="danger">
54
- * Agree to terms
55
- * </ty-checkbox>
56
- *
57
- * <!-- Different sizes -->
58
- * <ty-checkbox size="sm">Small</ty-checkbox>
59
- * <ty-checkbox size="lg">Large</ty-checkbox>
60
- *
61
- * <!-- Semantic flavors -->
62
- * <ty-checkbox flavor="primary" checked>Primary</ty-checkbox>
63
- * <ty-checkbox flavor="success" checked>Success</ty-checkbox>
64
- *
65
- * <!-- Rich content (with icon) -->
66
- * <ty-checkbox checked>
67
- * <ty-icon name="star"></ty-icon>
68
- * Premium feature
69
- * </ty-checkbox>
70
- * ```
71
- */
72
7
  export class TyCheckbox extends TyComponent {
73
8
  constructor() {
74
- super(); // TyComponent handles attachInternals() and attachShadow()
75
- // ============================================================================
76
- // INTERNAL STATE - Not managed by PropertyManager
77
- // NOTE: _internals provided by TyComponent base class
78
- // ============================================================================
9
+ super();
79
10
  this._customFlavorSheet = null;
80
11
  this._listenersSetup = false;
81
- // Store references to handlers for cleanup
82
12
  this._clickHandler = null;
83
13
  this._keydownHandler = null;
84
14
  this._focusHandler = null;
85
15
  this._blurHandler = null;
86
- // Apply styles to shadow root
87
16
  const shadow = this.shadowRoot;
88
17
  ensureStyles(shadow, { css: checkboxStyles, id: "ty-checkbox" });
89
18
  }
90
- // observedAttributes auto-generated by TyComponent from properties config
91
- // ============================================================================
92
- // TYCOMPONENT LIFECYCLE HOOKS
93
- // ============================================================================
94
- /**
95
- * Called when component connects to DOM
96
- * TyComponent already handled pre-connection property capture
97
- */
98
19
  onConnect() {
99
- // Re-arm listeners on RE-connect: the base class skips render() when
100
- // already rendered, and onDisconnect removed the listeners. No-ops on
101
- // first connect (no container yet — render() attaches them).
102
20
  this.setupEventListeners();
103
21
  this._syncCustomFlavor();
104
22
  }
105
- /** Custom (non-built-in) flavors — see utils/flavor-sheet.ts. */
106
23
  _syncCustomFlavor() {
107
24
  this._customFlavorSheet = syncCustomFlavorSheet(this.shadowRoot, this._customFlavorSheet, this.flavor, ({ base }) => checkboxCustomFlavorCss(base));
108
25
  }
109
- /**
110
- * Called when component disconnects from DOM
111
- */
112
26
  onDisconnect() {
113
- // Clean up event listeners when component is removed from DOM
114
27
  this.removeEventListeners();
115
28
  }
116
- /**
117
- * Handle property changes - called BEFORE render
118
- */
119
29
  onPropertiesChanged(changes) {
120
30
  if (changes.some((c) => c.name === "flavor")) {
121
31
  this._syncCustomFlavor();
122
32
  }
123
33
  }
124
- /**
125
- * Override form value to return value when checked, null when unchecked
126
- */
127
34
  getFormValue() {
128
35
  return this.checked ? this.value : null;
129
36
  }
130
- // Removed old attributeChangedCallback, initializeCheckboxState, validateFlavor - handled by TyComponent
131
- /**
132
- * Build CSS class list for checkbox container
133
- */
134
37
  buildClassList() {
135
38
  const classes = [this.size];
136
39
  if (this.disabled)
@@ -139,18 +42,15 @@ export class TyCheckbox extends TyComponent {
139
42
  classes.push("required");
140
43
  return classes.join(" ");
141
44
  }
142
- /**
143
- * Handle checkbox click event - standards compliant approach
144
- */
145
45
  handleCheckboxClick(e) {
146
46
  if (this.disabled)
147
47
  return;
148
- // Native semantics: clicking an indeterminate checkbox resolves to checked
48
+ if (this.isDuplicateActivationClick())
49
+ return;
149
50
  const newValue = this.indeterminate ? true : !this.checked;
150
51
  if (this.indeterminate)
151
52
  this.indeterminate = false;
152
- this.checked = newValue; // Uses setProperty which handles everything
153
- // Emit custom events after property update
53
+ this.checked = newValue;
154
54
  setTimeout(() => {
155
55
  const eventDetail = {
156
56
  value: newValue,
@@ -170,26 +70,18 @@ export class TyCheckbox extends TyComponent {
170
70
  }));
171
71
  }, 0);
172
72
  }
173
- /**
174
- * Handle checkbox keyboard events - space/enter to toggle
175
- */
176
73
  handleCheckboxKeydown(e) {
177
74
  if (this.disabled)
178
75
  return;
179
76
  if (["Space", " ", "Enter"].includes(e.key)) {
180
- e.preventDefault(); // Prevent default for keyboard to avoid page scroll
77
+ e.preventDefault();
181
78
  e.stopPropagation();
182
79
  this.handleCheckboxClick(e);
183
80
  }
184
81
  }
185
- /**
186
- * Remove event listeners for cleanup
187
- */
188
82
  removeEventListeners() {
189
83
  if (!this._listenersSetup)
190
84
  return;
191
- // Click lives on the HOST (label delegation + full-element trigger) —
192
- // remove it before the shadow-container guard below.
193
85
  if (this._clickHandler) {
194
86
  this.removeEventListener("click", this._clickHandler);
195
87
  this._clickHandler = null;
@@ -216,10 +108,6 @@ export class TyCheckbox extends TyComponent {
216
108
  }
217
109
  this._listenersSetup = false;
218
110
  }
219
- /**
220
- * Setup event listeners for checkbox functionality
221
- * IMPORTANT: Only called ONCE, not on every render
222
- */
223
111
  setupEventListeners() {
224
112
  if (this._listenersSetup)
225
113
  return;
@@ -227,7 +115,6 @@ export class TyCheckbox extends TyComponent {
227
115
  const checkboxEl = shadow.querySelector(".checkbox-container");
228
116
  if (!checkboxEl)
229
117
  return;
230
- // Create and store handler references for cleanup
231
118
  this._clickHandler = (e) => {
232
119
  this.handleCheckboxClick(e);
233
120
  };
@@ -240,19 +127,12 @@ export class TyCheckbox extends TyComponent {
240
127
  this._blurHandler = () => {
241
128
  checkboxEl.classList.remove("focused");
242
129
  };
243
- // Click on the HOST: makes the whole element a trigger and lets a wrapping
244
- // <label> delegate (the synthetic click lands on the host, not the shadow).
245
- // Keyboard/focus stay on the focusable container.
246
130
  this.addEventListener("click", this._clickHandler);
247
131
  checkboxEl.addEventListener("keydown", this._keydownHandler);
248
132
  checkboxEl.addEventListener("focus", this._focusHandler);
249
133
  checkboxEl.addEventListener("blur", this._blurHandler);
250
134
  this._listenersSetup = true;
251
135
  }
252
- /**
253
- * Render the checkbox — just the box visual.
254
- * Label, required asterisk, and error UI are the consumer's responsibility.
255
- */
256
136
  render() {
257
137
  const shadow = this.shadowRoot;
258
138
  let checkboxEl = shadow.querySelector(".checkbox-container");
@@ -278,21 +158,12 @@ export class TyCheckbox extends TyComponent {
278
158
  checkboxEl.setAttribute("aria-disabled", String(this.disabled));
279
159
  checkboxEl.setAttribute("aria-required", String(this.required));
280
160
  }
281
- // Dash while indeterminate, tick otherwise (tick's color/opacity carries
282
- // the checked/unchecked distinction via CSS).
283
161
  const icon = checkboxEl.querySelector(".checkbox-icon");
284
162
  icon.innerHTML = this.indeterminate ? DASH_ICON : CHECK_ICON;
285
- // (Re)attach listeners — onDisconnect removes them, so a reconnected
286
- // element needs them again even though the container already exists.
287
163
  this.setupEventListeners();
288
- // a11y: role="checkbox" lives on this inner element, but the associated
289
- // <label> names the (form-associated) host. Mirror that name onto the role
290
- // element so it has an accessible name.
291
164
  this.applyLabelName(checkboxEl);
292
- // Reflect constraint validation to the owning <form> (required was cosmetic).
293
165
  this.updateValidity();
294
166
  }
295
- /** required + unchecked => valueMissing; otherwise valid. */
296
167
  updateValidity() {
297
168
  const anchor = this.shadowRoot?.querySelector(".checkbox-container");
298
169
  if (this.disabled) {
@@ -306,9 +177,6 @@ export class TyCheckbox extends TyComponent {
306
177
  this._internals.setValidity({});
307
178
  }
308
179
  }
309
- // ============================================================================
310
- // PROPERTY ACCESSORS - Simple wrappers (no logic!)
311
- // ============================================================================
312
180
  get checked() {
313
181
  return this.getProperty("checked");
314
182
  }
@@ -362,26 +230,19 @@ export class TyCheckbox extends TyComponent {
362
230
  }
363
231
  }
364
232
  TyCheckbox.formAssociated = true;
365
- // ============================================================================
366
- // PROPERTY CONFIGURATION - Declarative property lifecycle
367
- // ============================================================================
368
233
  TyCheckbox.properties = {
369
- // Core boolean state
370
234
  checked: {
371
235
  type: "boolean",
372
236
  visual: true,
373
- formValue: true, // Triggers form value update
374
- emitChange: true, // Emits 'prop:change' event
237
+ formValue: true,
238
+ emitChange: true,
375
239
  default: false,
376
240
  },
377
- // Visual/ARIA "mixed" state (native semantics: no form-value effect,
378
- // clicking resolves to checked)
379
241
  indeterminate: {
380
242
  type: "boolean",
381
243
  visual: true,
382
244
  default: false,
383
245
  },
384
- // Form submission value (when checked)
385
246
  value: {
386
247
  type: "string",
387
248
  default: "on",
@@ -413,17 +274,12 @@ TyCheckbox.properties = {
413
274
  return v;
414
275
  },
415
276
  },
416
- // Any string is accepted: built-ins get static CSS, other identifiers
417
- // become custom flavors (see _syncCustomFlavor), garbage degrades to
418
- // the default look.
419
277
  flavor: {
420
278
  type: "string",
421
279
  visual: true,
422
280
  default: "neutral",
423
281
  },
424
282
  };
425
- // Register the custom element
426
283
  if (!customElements.get("ty-checkbox")) {
427
284
  customElements.define("ty-checkbox", TyCheckbox);
428
285
  }
429
- //# sourceMappingURL=checkbox.js.map
@@ -1,16 +1,6 @@
1
1
  /**
2
- * TyCopy Web Component
3
- *
4
- * Read-only field with copy-to-clipboard functionality
5
- * Perfect for API keys, tokens, URLs, code snippets, etc.
6
- *
7
- * Features:
8
- * - Read-only display (not an input)
9
- * - Copy icon on the right
10
- * - Icon animation on copy (copy → check → copy)
11
- * - Same styling as ty-input for consistency
12
- * - Label support
13
- * - Size and flavor variants
2
+ * TyCopy Web Component — read-only field with copy-to-clipboard, styled like
3
+ * ty-input. For API keys, tokens, URLs, code snippets, etc.
14
4
  */
15
5
  import type { Flavor, Size } from '../types/common.js';
16
6
  import { TyComponent } from '../base/ty-component.js';
@@ -45,30 +35,6 @@ export interface TyCopyElement extends HTMLElement {
45
35
  }
46
36
  /**
47
37
  * Ty Copy Field Component
48
- *
49
- * @example
50
- * ```html
51
- * <!-- Basic copy field -->
52
- * <ty-copy
53
- * label="API Key"
54
- * value="sk_live_1234567890abcdef">
55
- * </ty-copy>
56
- *
57
- * <!-- Code format -->
58
- * <ty-copy
59
- * label="Install Command"
60
- * value="npm install tyrell-components"
61
- * format="code">
62
- * </ty-copy>
63
- *
64
- * <!-- Different sizes -->
65
- * <ty-copy size="sm" value="Small field"></ty-copy>
66
- * <ty-copy size="lg" value="Large field"></ty-copy>
67
- *
68
- * <!-- Semantic flavors -->
69
- * <ty-copy flavor="primary" value="Primary"></ty-copy>
70
- * <ty-copy flavor="success" value="Success"></ty-copy>
71
- * ```
72
38
  */
73
39
  export declare class TyCopy extends TyComponent<CopyState> implements TyCopyElement {
74
40
  static formAssociated: boolean;
@@ -127,28 +93,16 @@ export declare class TyCopy extends TyComponent<CopyState> implements TyCopyElem
127
93
  private _showingSuccess;
128
94
  private _customFlavorSheet;
129
95
  constructor();
130
- /**
131
- * Called when component connects to DOM
132
- * TyComponent already handled pre-connection property capture
133
- */
96
+ /** TyComponent already handled pre-connection property capture. */
134
97
  protected onConnect(): void;
135
98
  /** Custom (non-built-in) flavors — see utils/flavor-sheet.ts. */
136
99
  private _syncCustomFlavor;
137
- /**
138
- * Called when component disconnects from DOM
139
- */
140
100
  protected onDisconnect(): void;
141
101
  /**
142
102
  * Handle property changes - called BEFORE render
143
103
  */
144
104
  protected onPropertiesChanged(changes: PropertyChange[]): void;
145
- /**
146
- * Build CSS class list
147
- */
148
105
  private buildClassList;
149
- /**
150
- * Copy value to clipboard
151
- */
152
106
  private copyToClipboard;
153
107
  /**
154
108
  * Show copy success animation
@@ -160,13 +114,7 @@ export declare class TyCopy extends TyComponent<CopyState> implements TyCopyElem
160
114
  * Swaps copy icon → red X icon → copy icon
161
115
  */
162
116
  private showCopyError;
163
- /**
164
- * Setup event listeners
165
- */
166
117
  private setupEventListeners;
167
- /**
168
- * Render the component
169
- */
170
118
  protected render(): void;
171
119
  get value(): string;
172
120
  set value(val: string);
@@ -188,4 +136,3 @@ export declare class TyCopy extends TyComponent<CopyState> implements TyCopyElem
188
136
  set required(value: boolean);
189
137
  }
190
138
  export {};
191
- //# sourceMappingURL=copy.d.ts.map