tyrell-components 1.0.0-RC12 → 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 (354) hide show
  1. package/README.md +2 -1
  2. package/css/tyrell-colors-static.css +316 -0
  3. package/css/tyrell-theme.css +1443 -0
  4. package/css/tyrell.css +127 -423
  5. package/dist/tyrell-colors-static.css +316 -0
  6. package/dist/tyrell-theme.css +1443 -0
  7. package/dist/tyrell.css +127 -423
  8. package/dist/tyrell.js +1 -1
  9. package/lib/base/ty-component.d.ts +20 -10
  10. package/lib/base/ty-component.js +21 -144
  11. package/lib/components/button.d.ts +9 -16
  12. package/lib/components/button.js +12 -37
  13. package/lib/components/calendar-month.d.ts +17 -46
  14. package/lib/components/calendar-month.js +97 -145
  15. package/lib/components/calendar-navigation.d.ts +3 -48
  16. package/lib/components/calendar-navigation.js +3 -126
  17. package/lib/components/calendar.d.ts +6 -81
  18. package/lib/components/calendar.js +24 -236
  19. package/lib/components/checkbox.d.ts +8 -74
  20. package/lib/components/checkbox.js +21 -177
  21. package/lib/components/copy.d.ts +7 -59
  22. package/lib/components/copy.js +19 -137
  23. package/lib/components/date-picker.d.ts +23 -161
  24. package/lib/components/date-picker.js +127 -588
  25. package/lib/components/file-upload.d.ts +9 -15
  26. package/lib/components/file-upload.js +19 -41
  27. package/lib/components/icon.d.ts +3 -24
  28. package/lib/components/icon.js +1 -90
  29. package/lib/components/input.d.ts +10 -109
  30. package/lib/components/input.js +24 -209
  31. package/lib/components/modal.d.ts +17 -26
  32. package/lib/components/modal.js +67 -192
  33. package/lib/components/option.d.ts +2 -20
  34. package/lib/components/option.js +1 -148
  35. package/lib/components/popup.d.ts +2 -17
  36. package/lib/components/popup.js +35 -132
  37. package/lib/components/radio.d.ts +7 -24
  38. package/lib/components/radio.js +24 -68
  39. package/lib/components/resize-observer.d.ts +3 -30
  40. package/lib/components/resize-observer.js +12 -46
  41. package/lib/components/scroll-container.d.ts +2 -12
  42. package/lib/components/scroll-container.js +3 -46
  43. package/lib/components/select.d.ts +130 -151
  44. package/lib/components/select.js +327 -516
  45. package/lib/components/selected-tags.d.ts +8 -38
  46. package/lib/components/selected-tags.js +20 -78
  47. package/lib/components/step.d.ts +1 -6
  48. package/lib/components/step.js +0 -6
  49. package/lib/components/switch.d.ts +4 -14
  50. package/lib/components/switch.js +15 -61
  51. package/lib/components/tab.d.ts +1 -6
  52. package/lib/components/tab.js +0 -7
  53. package/lib/components/tabs.d.ts +5 -63
  54. package/lib/components/tabs.js +159 -267
  55. package/lib/components/tag.d.ts +2 -36
  56. package/lib/components/tag.js +5 -105
  57. package/lib/components/textarea.d.ts +6 -86
  58. package/lib/components/textarea.js +2 -173
  59. package/lib/components/tooltip.d.ts +7 -13
  60. package/lib/components/tooltip.js +83 -180
  61. package/lib/components/wizard.d.ts +6 -54
  62. package/lib/components/wizard.js +27 -221
  63. package/lib/icons/fontawesome/brands.d.ts +0 -1
  64. package/lib/icons/fontawesome/brands.js +0 -8
  65. package/lib/icons/fontawesome/regular.d.ts +0 -1
  66. package/lib/icons/fontawesome/regular.js +0 -8
  67. package/lib/icons/fontawesome/solid.d.ts +0 -1
  68. package/lib/icons/fontawesome/solid.js +0 -8
  69. package/lib/icons/heroicons/micro.d.ts +0 -1
  70. package/lib/icons/heroicons/micro.js +0 -8
  71. package/lib/icons/heroicons/mini.d.ts +0 -1
  72. package/lib/icons/heroicons/mini.js +0 -8
  73. package/lib/icons/heroicons/outline.d.ts +0 -1
  74. package/lib/icons/heroicons/outline.js +0 -8
  75. package/lib/icons/heroicons/solid.d.ts +0 -1
  76. package/lib/icons/heroicons/solid.js +0 -8
  77. package/lib/icons/lucide.d.ts +0 -1
  78. package/lib/icons/lucide.js +0 -1872
  79. package/lib/icons/material/filled.d.ts +0 -1
  80. package/lib/icons/material/filled.js +0 -10
  81. package/lib/icons/material/outlined.d.ts +0 -1
  82. package/lib/icons/material/outlined.js +0 -10
  83. package/lib/icons/material/round.d.ts +0 -1
  84. package/lib/icons/material/round.js +0 -10
  85. package/lib/icons/material/sharp.d.ts +0 -1
  86. package/lib/icons/material/sharp.js +0 -10
  87. package/lib/icons/material/two-tone.d.ts +0 -1
  88. package/lib/icons/material/two-tone.js +0 -10
  89. package/lib/index.d.ts +2 -2
  90. package/lib/index.js +2 -21
  91. package/lib/styles/button.d.ts +19 -7
  92. package/lib/styles/button.js +180 -77
  93. package/lib/styles/calendar-month.d.ts +4 -6
  94. package/lib/styles/calendar-month.js +57 -59
  95. package/lib/styles/calendar-navigation.d.ts +2 -6
  96. package/lib/styles/calendar-navigation.js +3 -28
  97. package/lib/styles/calendar.d.ts +1 -2
  98. package/lib/styles/calendar.js +1 -14
  99. package/lib/styles/checkbox.d.ts +3 -2
  100. package/lib/styles/checkbox.js +24 -68
  101. package/lib/styles/copy.d.ts +3 -2
  102. package/lib/styles/copy.js +25 -17
  103. package/lib/styles/custom-scrollbar.d.ts +1 -2
  104. package/lib/styles/custom-scrollbar.js +5 -20
  105. package/lib/styles/date-picker.d.ts +4 -6
  106. package/lib/styles/date-picker.js +80 -130
  107. package/lib/styles/file-upload.d.ts +1 -2
  108. package/lib/styles/file-upload.js +4 -19
  109. package/lib/styles/icon.d.ts +2 -6
  110. package/lib/styles/icon.js +7 -21
  111. package/lib/styles/input.d.ts +4 -7
  112. package/lib/styles/input.js +55 -160
  113. package/lib/styles/modal.d.ts +1 -2
  114. package/lib/styles/modal.js +21 -23
  115. package/lib/styles/option.d.ts +2 -6
  116. package/lib/styles/option.js +17 -63
  117. package/lib/styles/popup.d.ts +1 -2
  118. package/lib/styles/popup.js +26 -30
  119. package/lib/styles/radio.d.ts +3 -2
  120. package/lib/styles/radio.js +21 -32
  121. package/lib/styles/resize-observer.d.ts +1 -2
  122. package/lib/styles/resize-observer.js +0 -7
  123. package/lib/styles/scroll-container.d.ts +1 -2
  124. package/lib/styles/scroll-container.js +0 -19
  125. package/lib/styles/select-base.d.ts +8 -0
  126. package/lib/styles/{multiselect.js → select-base.js} +264 -127
  127. package/lib/styles/select.d.ts +3 -4
  128. package/lib/styles/select.js +103 -43
  129. package/lib/styles/step.d.ts +1 -2
  130. package/lib/styles/step.js +0 -4
  131. package/lib/styles/switch.d.ts +3 -2
  132. package/lib/styles/switch.js +20 -23
  133. package/lib/styles/tab.d.ts +1 -2
  134. package/lib/styles/tab.js +0 -5
  135. package/lib/styles/tabs.d.ts +3 -11
  136. package/lib/styles/tabs.js +77 -45
  137. package/lib/styles/tag.d.ts +1 -5
  138. package/lib/styles/tag.js +6 -32
  139. package/lib/styles/textarea.d.ts +1 -2
  140. package/lib/styles/textarea.js +7 -50
  141. package/lib/styles/tooltip.d.ts +4 -3
  142. package/lib/styles/tooltip.js +0 -125
  143. package/lib/styles/wizard.d.ts +5 -21
  144. package/lib/styles/wizard.js +23 -91
  145. package/lib/types/common.d.ts +1 -3
  146. package/lib/types/common.js +0 -10
  147. package/lib/utils/calendar-utils.d.ts +4 -21
  148. package/lib/utils/calendar-utils.js +4 -177
  149. package/lib/utils/custom-scrollbar.d.ts +6 -20
  150. package/lib/utils/custom-scrollbar.js +1 -45
  151. package/lib/utils/flavor-sheet.d.ts +0 -1
  152. package/lib/utils/flavor-sheet.js +0 -23
  153. package/lib/utils/icon-registry.d.ts +0 -2
  154. package/lib/utils/icon-registry.js +1 -107
  155. package/lib/utils/icons.d.ts +9 -0
  156. package/lib/utils/icons.js +1 -0
  157. package/lib/utils/loader-registry.d.ts +2 -3
  158. package/lib/utils/loader-registry.js +0 -32
  159. package/lib/utils/locale.d.ts +2 -23
  160. package/lib/utils/locale.js +0 -86
  161. package/lib/utils/mobile.d.ts +0 -1
  162. package/lib/utils/mobile.js +0 -17
  163. package/lib/utils/number-format.d.ts +6 -3
  164. package/lib/utils/number-format.js +11 -67
  165. package/lib/utils/positioning.d.ts +77 -3
  166. package/lib/utils/positioning.js +67 -58
  167. package/lib/utils/property-capture.d.ts +5 -27
  168. package/lib/utils/property-capture.js +0 -108
  169. package/lib/utils/property-manager.d.ts +0 -1
  170. package/lib/utils/property-manager.js +0 -70
  171. package/lib/utils/resize-observer.d.ts +0 -1
  172. package/lib/utils/resize-observer.js +0 -36
  173. package/lib/utils/scroll-lock.d.ts +4 -11
  174. package/lib/utils/scroll-lock.js +0 -107
  175. package/lib/utils/styles.d.ts +0 -1
  176. package/lib/utils/styles.js +0 -24
  177. package/lib/version.d.ts +1 -2
  178. package/lib/version.js +1 -11
  179. package/package.json +8 -5
  180. package/css/tyrell-brand.css +0 -1015
  181. package/dist/tyrell-brand.css +0 -1015
  182. package/lib/base/ty-component.d.ts.map +0 -1
  183. package/lib/base/ty-component.js.map +0 -1
  184. package/lib/components/button.d.ts.map +0 -1
  185. package/lib/components/button.js.map +0 -1
  186. package/lib/components/calendar-month.d.ts.map +0 -1
  187. package/lib/components/calendar-month.js.map +0 -1
  188. package/lib/components/calendar-navigation.d.ts.map +0 -1
  189. package/lib/components/calendar-navigation.js.map +0 -1
  190. package/lib/components/calendar.d.ts.map +0 -1
  191. package/lib/components/calendar.js.map +0 -1
  192. package/lib/components/checkbox.d.ts.map +0 -1
  193. package/lib/components/checkbox.js.map +0 -1
  194. package/lib/components/copy.d.ts.map +0 -1
  195. package/lib/components/copy.js.map +0 -1
  196. package/lib/components/date-picker.d.ts.map +0 -1
  197. package/lib/components/date-picker.js.map +0 -1
  198. package/lib/components/file-upload.d.ts.map +0 -1
  199. package/lib/components/file-upload.js.map +0 -1
  200. package/lib/components/icon.d.ts.map +0 -1
  201. package/lib/components/icon.js.map +0 -1
  202. package/lib/components/input.d.ts.map +0 -1
  203. package/lib/components/input.js.map +0 -1
  204. package/lib/components/modal.d.ts.map +0 -1
  205. package/lib/components/modal.js.map +0 -1
  206. package/lib/components/option.d.ts.map +0 -1
  207. package/lib/components/option.js.map +0 -1
  208. package/lib/components/popup.d.ts.map +0 -1
  209. package/lib/components/popup.js.map +0 -1
  210. package/lib/components/radio.d.ts.map +0 -1
  211. package/lib/components/radio.js.map +0 -1
  212. package/lib/components/resize-observer.d.ts.map +0 -1
  213. package/lib/components/resize-observer.js.map +0 -1
  214. package/lib/components/scroll-container.d.ts.map +0 -1
  215. package/lib/components/scroll-container.js.map +0 -1
  216. package/lib/components/select.d.ts.map +0 -1
  217. package/lib/components/select.js.map +0 -1
  218. package/lib/components/selected-tags.d.ts.map +0 -1
  219. package/lib/components/selected-tags.js.map +0 -1
  220. package/lib/components/step.d.ts.map +0 -1
  221. package/lib/components/step.js.map +0 -1
  222. package/lib/components/switch.d.ts.map +0 -1
  223. package/lib/components/switch.js.map +0 -1
  224. package/lib/components/tab.d.ts.map +0 -1
  225. package/lib/components/tab.js.map +0 -1
  226. package/lib/components/tabs.d.ts.map +0 -1
  227. package/lib/components/tabs.js.map +0 -1
  228. package/lib/components/tag.d.ts.map +0 -1
  229. package/lib/components/tag.js.map +0 -1
  230. package/lib/components/textarea.d.ts.map +0 -1
  231. package/lib/components/textarea.js.map +0 -1
  232. package/lib/components/tooltip.d.ts.map +0 -1
  233. package/lib/components/tooltip.js.map +0 -1
  234. package/lib/components/wizard.d.ts.map +0 -1
  235. package/lib/components/wizard.js.map +0 -1
  236. package/lib/icons/fontawesome/brands.d.ts.map +0 -1
  237. package/lib/icons/fontawesome/brands.js.map +0 -1
  238. package/lib/icons/fontawesome/regular.d.ts.map +0 -1
  239. package/lib/icons/fontawesome/regular.js.map +0 -1
  240. package/lib/icons/fontawesome/solid.d.ts.map +0 -1
  241. package/lib/icons/fontawesome/solid.js.map +0 -1
  242. package/lib/icons/heroicons/micro.d.ts.map +0 -1
  243. package/lib/icons/heroicons/micro.js.map +0 -1
  244. package/lib/icons/heroicons/mini.d.ts.map +0 -1
  245. package/lib/icons/heroicons/mini.js.map +0 -1
  246. package/lib/icons/heroicons/outline.d.ts.map +0 -1
  247. package/lib/icons/heroicons/outline.js.map +0 -1
  248. package/lib/icons/heroicons/solid.d.ts.map +0 -1
  249. package/lib/icons/heroicons/solid.js.map +0 -1
  250. package/lib/icons/lucide.d.ts.map +0 -1
  251. package/lib/icons/lucide.js.map +0 -1
  252. package/lib/icons/material/filled.d.ts.map +0 -1
  253. package/lib/icons/material/filled.js.map +0 -1
  254. package/lib/icons/material/outlined.d.ts.map +0 -1
  255. package/lib/icons/material/outlined.js.map +0 -1
  256. package/lib/icons/material/round.d.ts.map +0 -1
  257. package/lib/icons/material/round.js.map +0 -1
  258. package/lib/icons/material/sharp.d.ts.map +0 -1
  259. package/lib/icons/material/sharp.js.map +0 -1
  260. package/lib/icons/material/two-tone.d.ts.map +0 -1
  261. package/lib/icons/material/two-tone.js.map +0 -1
  262. package/lib/index.d.ts.map +0 -1
  263. package/lib/index.js.map +0 -1
  264. package/lib/styles/button.d.ts.map +0 -1
  265. package/lib/styles/button.js.map +0 -1
  266. package/lib/styles/calendar-month.d.ts.map +0 -1
  267. package/lib/styles/calendar-month.js.map +0 -1
  268. package/lib/styles/calendar-navigation.d.ts.map +0 -1
  269. package/lib/styles/calendar-navigation.js.map +0 -1
  270. package/lib/styles/calendar.d.ts.map +0 -1
  271. package/lib/styles/calendar.js.map +0 -1
  272. package/lib/styles/checkbox.d.ts.map +0 -1
  273. package/lib/styles/checkbox.js.map +0 -1
  274. package/lib/styles/copy.d.ts.map +0 -1
  275. package/lib/styles/copy.js.map +0 -1
  276. package/lib/styles/custom-scrollbar.d.ts.map +0 -1
  277. package/lib/styles/custom-scrollbar.js.map +0 -1
  278. package/lib/styles/date-picker.d.ts.map +0 -1
  279. package/lib/styles/date-picker.js.map +0 -1
  280. package/lib/styles/file-upload.d.ts.map +0 -1
  281. package/lib/styles/file-upload.js.map +0 -1
  282. package/lib/styles/icon.d.ts.map +0 -1
  283. package/lib/styles/icon.js.map +0 -1
  284. package/lib/styles/input.d.ts.map +0 -1
  285. package/lib/styles/input.js.map +0 -1
  286. package/lib/styles/modal.d.ts.map +0 -1
  287. package/lib/styles/modal.js.map +0 -1
  288. package/lib/styles/multiselect.d.ts +0 -6
  289. package/lib/styles/multiselect.d.ts.map +0 -1
  290. package/lib/styles/multiselect.js.map +0 -1
  291. package/lib/styles/option.d.ts.map +0 -1
  292. package/lib/styles/option.js.map +0 -1
  293. package/lib/styles/popup.d.ts.map +0 -1
  294. package/lib/styles/popup.js.map +0 -1
  295. package/lib/styles/radio.d.ts.map +0 -1
  296. package/lib/styles/radio.js.map +0 -1
  297. package/lib/styles/resize-observer.d.ts.map +0 -1
  298. package/lib/styles/resize-observer.js.map +0 -1
  299. package/lib/styles/scroll-container.d.ts.map +0 -1
  300. package/lib/styles/scroll-container.js.map +0 -1
  301. package/lib/styles/select.d.ts.map +0 -1
  302. package/lib/styles/select.js.map +0 -1
  303. package/lib/styles/step.d.ts.map +0 -1
  304. package/lib/styles/step.js.map +0 -1
  305. package/lib/styles/switch.d.ts.map +0 -1
  306. package/lib/styles/switch.js.map +0 -1
  307. package/lib/styles/tab.d.ts.map +0 -1
  308. package/lib/styles/tab.js.map +0 -1
  309. package/lib/styles/tabs.d.ts.map +0 -1
  310. package/lib/styles/tabs.js.map +0 -1
  311. package/lib/styles/tag.d.ts.map +0 -1
  312. package/lib/styles/tag.js.map +0 -1
  313. package/lib/styles/textarea.d.ts.map +0 -1
  314. package/lib/styles/textarea.js.map +0 -1
  315. package/lib/styles/tooltip.d.ts.map +0 -1
  316. package/lib/styles/tooltip.js.map +0 -1
  317. package/lib/styles/wizard.d.ts.map +0 -1
  318. package/lib/styles/wizard.js.map +0 -1
  319. package/lib/types/common.d.ts.map +0 -1
  320. package/lib/types/common.js.map +0 -1
  321. package/lib/utils/calendar-utils.d.ts.map +0 -1
  322. package/lib/utils/calendar-utils.js.map +0 -1
  323. package/lib/utils/custom-scrollbar.d.ts.map +0 -1
  324. package/lib/utils/custom-scrollbar.js.map +0 -1
  325. package/lib/utils/flavor-sheet.d.ts.map +0 -1
  326. package/lib/utils/flavor-sheet.js.map +0 -1
  327. package/lib/utils/icon-registry.d.ts.map +0 -1
  328. package/lib/utils/icon-registry.js.map +0 -1
  329. package/lib/utils/loader-registry.d.ts.map +0 -1
  330. package/lib/utils/loader-registry.js.map +0 -1
  331. package/lib/utils/locale.d.ts.map +0 -1
  332. package/lib/utils/locale.js.map +0 -1
  333. package/lib/utils/mobile.d.ts.map +0 -1
  334. package/lib/utils/mobile.js.map +0 -1
  335. package/lib/utils/number-format.d.ts.map +0 -1
  336. package/lib/utils/number-format.js.map +0 -1
  337. package/lib/utils/parse-boolean.d.ts +0 -39
  338. package/lib/utils/parse-boolean.d.ts.map +0 -1
  339. package/lib/utils/parse-boolean.js +0 -58
  340. package/lib/utils/parse-boolean.js.map +0 -1
  341. package/lib/utils/positioning.d.ts.map +0 -1
  342. package/lib/utils/positioning.js.map +0 -1
  343. package/lib/utils/property-capture.d.ts.map +0 -1
  344. package/lib/utils/property-capture.js.map +0 -1
  345. package/lib/utils/property-manager.d.ts.map +0 -1
  346. package/lib/utils/property-manager.js.map +0 -1
  347. package/lib/utils/resize-observer.d.ts.map +0 -1
  348. package/lib/utils/resize-observer.js.map +0 -1
  349. package/lib/utils/scroll-lock.d.ts.map +0 -1
  350. package/lib/utils/scroll-lock.js.map +0 -1
  351. package/lib/utils/styles.d.ts.map +0 -1
  352. package/lib/utils/styles.js.map +0 -1
  353. package/lib/version.d.ts.map +0 -1
  354. package/lib/version.js.map +0 -1
@@ -1,48 +1,19 @@
1
1
  /**
2
- * TySelectedTags Web Component
3
- *
4
- * Out-of-band chip display for a picker (ty-select / ty-multiselect / ty-dropdown).
5
- * The picker owns the value + form submission; this element just renders the
6
- * selected values as dismissible <ty-tag> chips, anywhere in the layout.
7
- *
8
- * Pairs with any element that exposes a comma-joined `value` string and emits a
9
- * bubbling `change` event. Labels/flavors are read from the picker's matching
10
- * option (`[value="..."]`), so chips stay rich without duplicating data.
11
- *
12
- * @example
13
- * ```html
14
- * <ty-select id="robots">
15
- * <ty-option value="bobo" flavor="primary">Bobo Robot</ty-option>
16
- * </ty-select>
17
- * <ty-selected-tags for="robots"></ty-selected-tags>
18
- * ```
19
- *
20
- * Custom chips via a <template> child. Placeholders {value}, {label}, {flavor}
21
- * and any {data-*} attribute of the matching option are interpolated into
22
- * attributes and text — on cloned DOM nodes, never via innerHTML (no injection).
23
- *
24
- * @example
25
- * ```html
26
- * <ty-select id="team">
27
- * <ty-option value="ivan" data-avatar="/avatars/ivan.png">Ivan</ty-option>
28
- * </ty-select>
29
- * <ty-selected-tags for="team">
30
- * <template>
31
- * <ty-tag flavor="{flavor}" dismissible>
32
- * <img slot="start" src="{data-avatar}" class="w-4 h-4 rounded-full">
33
- * {label}
34
- * </ty-tag>
35
- * </template>
36
- * </ty-selected-tags>
37
- * ```
2
+ * TySelectedOptions - out-of-band dismissible <ty-tag> chips for a picker's selection.
3
+ * Pairs with any element exposing a comma-joined `value` + bubbling `change`; labels
4
+ * and flavors are read from the picker's matching option (`[value="..."]`). Custom chips
5
+ * come from an optional <template> child, stamped onto cloned nodes (never innerHTML).
38
6
  */
39
- export declare class TySelectedTags extends HTMLElement {
7
+ export declare class TySelectedOptions extends HTMLElement {
40
8
  static get observedAttributes(): string[];
41
9
  private _picker;
42
10
  private _onChange;
43
11
  private _childObserver;
44
12
  private _pickerObserver;
45
13
  private _lastTemplate;
14
+ private _restoreDisplay;
15
+ private _onPickerOpen;
16
+ private _onPickerClose;
46
17
  connectedCallback(): void;
47
18
  disconnectedCallback(): void;
48
19
  attributeChangedCallback(): void;
@@ -77,4 +48,3 @@ export declare class TySelectedTags extends HTMLElement {
77
48
  /** Remove a value from the picker; picker re-emits change → chips re-render. */
78
49
  private deselect;
79
50
  }
80
- //# sourceMappingURL=selected-tags.d.ts.map
@@ -1,50 +1,10 @@
1
- /**
2
- * TySelectedTags Web Component
3
- *
4
- * Out-of-band chip display for a picker (ty-select / ty-multiselect / ty-dropdown).
5
- * The picker owns the value + form submission; this element just renders the
6
- * selected values as dismissible <ty-tag> chips, anywhere in the layout.
7
- *
8
- * Pairs with any element that exposes a comma-joined `value` string and emits a
9
- * bubbling `change` event. Labels/flavors are read from the picker's matching
10
- * option (`[value="..."]`), so chips stay rich without duplicating data.
11
- *
12
- * @example
13
- * ```html
14
- * <ty-select id="robots">
15
- * <ty-option value="bobo" flavor="primary">Bobo Robot</ty-option>
16
- * </ty-select>
17
- * <ty-selected-tags for="robots"></ty-selected-tags>
18
- * ```
19
- *
20
- * Custom chips via a <template> child. Placeholders {value}, {label}, {flavor}
21
- * and any {data-*} attribute of the matching option are interpolated into
22
- * attributes and text — on cloned DOM nodes, never via innerHTML (no injection).
23
- *
24
- * @example
25
- * ```html
26
- * <ty-select id="team">
27
- * <ty-option value="ivan" data-avatar="/avatars/ivan.png">Ivan</ty-option>
28
- * </ty-select>
29
- * <ty-selected-tags for="team">
30
- * <template>
31
- * <ty-tag flavor="{flavor}" dismissible>
32
- * <img slot="start" src="{data-avatar}" class="w-4 h-4 rounded-full">
33
- * {label}
34
- * </ty-tag>
35
- * </template>
36
- * </ty-selected-tags>
37
- * ```
38
- */
39
- /** Split a comma-joined picker value into clean values. */
40
1
  function parseValues(raw) {
41
2
  return raw.split(',').map(s => s.trim()).filter(Boolean);
42
3
  }
43
- /** Replace {key} placeholders from ctx; unknown keys are left as-is. */
44
4
  function interpolate(text, ctx) {
45
5
  return text.replace(/\{([\w-]+)\}/g, (match, key) => ctx[key] ?? match);
46
6
  }
47
- export class TySelectedTags extends HTMLElement {
7
+ export class TySelectedOptions extends HTMLElement {
48
8
  constructor() {
49
9
  super(...arguments);
50
10
  this._picker = null;
@@ -52,20 +12,23 @@ export class TySelectedTags extends HTMLElement {
52
12
  this._childObserver = null;
53
13
  this._pickerObserver = null;
54
14
  this._lastTemplate = null;
15
+ this._restoreDisplay = 'contents';
16
+ this._onPickerOpen = () => {
17
+ this._restoreDisplay = this.style.display || 'contents';
18
+ this.style.display = 'none';
19
+ };
20
+ this._onPickerClose = () => {
21
+ this.style.display = this._restoreDisplay;
22
+ };
55
23
  }
56
24
  static get observedAttributes() {
57
25
  return ['for'];
58
26
  }
59
27
  connectedCallback() {
60
- // Chips participate directly in the parent layout (flex gap, wrap, etc.)
61
28
  if (!this.style.display)
62
29
  this.style.display = 'contents';
63
30
  this.bind();
64
31
  this.renderChips();
65
- // During HTML parsing we connect BEFORE our <template> child is parsed —
66
- // re-render when it arrives so server-rendered pages get templated chips.
67
- // renderChips re-appends the SAME template node, so its own mutations
68
- // don't change template() identity → no re-render loop.
69
32
  this._childObserver = new MutationObserver(() => {
70
33
  const template = this.template();
71
34
  if (template !== this._lastTemplate) {
@@ -85,7 +48,6 @@ export class TySelectedTags extends HTMLElement {
85
48
  this.bind();
86
49
  this.renderChips();
87
50
  }
88
- /** Resolve the picker: `for` id, else the previous element sibling. */
89
51
  resolvePicker() {
90
52
  const id = this.getAttribute('for');
91
53
  const el = id
@@ -100,9 +62,8 @@ export class TySelectedTags extends HTMLElement {
100
62
  this.unbind();
101
63
  this._picker = next;
102
64
  this._picker?.addEventListener('change', this._onChange);
103
- // The picker stamps `selected` onto its options ASYNC after connect
104
- // (rAF init) and on external option swaps — neither fires `change`.
105
- // Watch the picker's subtree so initial values render as chips too.
65
+ this._picker?.addEventListener('open', this._onPickerOpen);
66
+ this._picker?.addEventListener('close', this._onPickerClose);
106
67
  if (this._picker) {
107
68
  this._pickerObserver = new MutationObserver(() => this.renderChips());
108
69
  this._pickerObserver.observe(this._picker, {
@@ -115,26 +76,23 @@ export class TySelectedTags extends HTMLElement {
115
76
  }
116
77
  unbind() {
117
78
  this._picker?.removeEventListener('change', this._onChange);
79
+ this._picker?.removeEventListener('open', this._onPickerOpen);
80
+ this._picker?.removeEventListener('close', this._onPickerClose);
118
81
  this._pickerObserver?.disconnect();
119
82
  this._pickerObserver = null;
120
83
  this._picker = null;
84
+ this.style.display = this._restoreDisplay;
121
85
  }
122
86
  values() {
123
87
  return parseValues(this._picker?.value ?? '');
124
88
  }
125
- /** The optional chip template (direct child only). */
126
89
  template() {
127
90
  return this.querySelector(':scope > template');
128
91
  }
129
- /**
130
- * Interpolation context for a value: value, label, flavor plus every
131
- * data-* attribute of the picker's matching option.
132
- */
133
92
  context(value) {
134
93
  const opt = this._picker?.querySelector(`[value="${CSS.escape(value)}"]`);
135
94
  const ctx = {
136
95
  value,
137
- // label attribute wins (native <option label> semantics)
138
96
  label: opt?.getAttribute('label') || opt?.textContent?.trim() || value,
139
97
  flavor: opt?.getAttribute('flavor') ?? '',
140
98
  };
@@ -146,24 +104,13 @@ export class TySelectedTags extends HTMLElement {
146
104
  }
147
105
  return ctx;
148
106
  }
149
- /**
150
- * The template's blueprint fragment. HTML-parsed templates carry children in
151
- * .content; framework-rendered ones (DOM-created by React/Replicant/etc.)
152
- * carry them as regular childNodes — support both.
153
- */
154
107
  templateSource(template) {
155
- if (template.content.firstElementChild)
108
+ if (template.content.hasChildNodes())
156
109
  return template.content;
157
110
  const frag = document.createDocumentFragment();
158
111
  template.childNodes.forEach(n => frag.appendChild(n.cloneNode(true)));
159
112
  return frag;
160
113
  }
161
- /**
162
- * Stamp the template for one value: clone, interpolate placeholders in
163
- * attributes and text nodes, wire dismiss. Attribute values that were a
164
- * single unresolved placeholder are removed (e.g. flavor="{flavor}" with
165
- * no flavor on the option).
166
- */
167
114
  stampTemplate(template, value) {
168
115
  const ctx = this.context(value);
169
116
  const clone = this.templateSource(template).cloneNode(true);
@@ -180,8 +127,6 @@ export class TySelectedTags extends HTMLElement {
180
127
  if (!attr.value.includes('{'))
181
128
  continue;
182
129
  const resolved = interpolate(attr.value, ctx);
183
- // Single-placeholder attribute that is empty OR unresolved → drop it
184
- // (e.g. flavor="{flavor}" with no flavor, name="{data-icon}" with no data-icon)
185
130
  if (/^\{[\w-]+\}$/.test(attr.value) && (resolved === '' || resolved === attr.value)) {
186
131
  el.removeAttribute(attr.name);
187
132
  }
@@ -191,7 +136,6 @@ export class TySelectedTags extends HTMLElement {
191
136
  }
192
137
  }
193
138
  }
194
- // Dismiss anywhere inside the stamped chip deselects this value
195
139
  for (const el of Array.from(clone.children)) {
196
140
  el.addEventListener('dismiss', (e) => {
197
141
  e.stopPropagation();
@@ -200,7 +144,6 @@ export class TySelectedTags extends HTMLElement {
200
144
  }
201
145
  return clone;
202
146
  }
203
- /** Default chip when no template is provided. */
204
147
  defaultChip(value) {
205
148
  const ctx = this.context(value);
206
149
  const tag = document.createElement('ty-tag');
@@ -220,7 +163,6 @@ export class TySelectedTags extends HTMLElement {
220
163
  return;
221
164
  }
222
165
  const frag = document.createDocumentFragment();
223
- // Template survives re-renders - it is part of our light DOM
224
166
  if (template)
225
167
  frag.appendChild(template);
226
168
  for (const value of this.values()) {
@@ -228,23 +170,23 @@ export class TySelectedTags extends HTMLElement {
228
170
  }
229
171
  this.replaceChildren(frag);
230
172
  }
231
- /** Remove a value from the picker; picker re-emits change → chips re-render. */
232
173
  deselect(value) {
233
174
  if (!this._picker)
234
175
  return;
235
176
  const picker = this._picker;
236
177
  if (typeof picker.deselectValue === 'function') {
237
- // ty-select path — fires a proper change event (chips re-render via listener)
238
178
  picker.deselectValue(value);
239
179
  }
240
180
  else {
241
- // Generic picker fallback — value setters usually don't emit change
242
181
  picker.value = this.values().filter(v => v !== value).join(',');
243
182
  this.renderChips();
244
183
  }
245
184
  }
246
185
  }
186
+ if (!customElements.get('ty-selected-options')) {
187
+ customElements.define('ty-selected-options', TySelectedOptions);
188
+ }
247
189
  if (!customElements.get('ty-selected-tags')) {
248
- customElements.define('ty-selected-tags', TySelectedTags);
190
+ customElements.define('ty-selected-tags', class TySelectedTags extends TySelectedOptions {
191
+ });
249
192
  }
250
- //# sourceMappingURL=selected-tags.js.map
@@ -1,8 +1,4 @@
1
- /**
2
- * Step Component
3
- *
4
- * Individual wizard step panel with custom scrollbar via CustomScrollbar utility.
5
- */
1
+ /** Individual wizard step panel with custom scrollbar via CustomScrollbar utility. */
6
2
  export type StepStatus = 'completed' | 'active' | 'pending' | 'error';
7
3
  export interface StepAttributes {
8
4
  id: string | null;
@@ -23,4 +19,3 @@ export declare class TyStep extends HTMLElement {
23
19
  private _destroyScrollbar;
24
20
  resetScroll(): void;
25
21
  }
26
- //# sourceMappingURL=step.d.ts.map
@@ -1,8 +1,3 @@
1
- /**
2
- * Step Component
3
- *
4
- * Individual wizard step panel with custom scrollbar via CustomScrollbar utility.
5
- */
6
1
  import { ensureStyles } from '../utils/styles.js';
7
2
  import { stepStyles } from '../styles/step.js';
8
3
  import { CustomScrollbar, isCustomScrollbarEnabled } from '../utils/custom-scrollbar.js';
@@ -72,4 +67,3 @@ export class TyStep extends HTMLElement {
72
67
  if (!customElements.get('ty-step')) {
73
68
  customElements.define('ty-step', TyStep);
74
69
  }
75
- //# sourceMappingURL=step.js.map
@@ -4,16 +4,6 @@
4
4
  * "Just the toggle" primitive — renders only the track + thumb visual.
5
5
  * Label, required asterisk, and error display are the consumer's
6
6
  * responsibility — wrap in a `<label>` for click delegation.
7
- *
8
- * - Boolean checked state, role="switch" ARIA
9
- * - Form-associated, keyboard accessibility
10
- * - Sizes (xs, sm, md, lg, xl) and semantic flavors
11
- *
12
- * @example
13
- * <label>
14
- * <ty-switch name="notifications" checked></ty-switch>
15
- * Email notifications
16
- * </label>
17
7
  */
18
8
  import type { Flavor, Size } from "../types/common.js";
19
9
  import { TyComponent } from "../base/ty-component.js";
@@ -71,10 +61,9 @@ export declare class TySwitch extends TyComponent<SwitchState> implements TySwit
71
61
  type: "string";
72
62
  visual: boolean;
73
63
  default: string;
74
- validate: (v: any) => boolean;
75
- coerce: (v: any) => any;
76
64
  };
77
65
  };
66
+ private _customFlavorSheet;
78
67
  private _listenersSetup;
79
68
  private _clickHandler;
80
69
  private _keydownHandler;
@@ -83,7 +72,9 @@ export declare class TySwitch extends TyComponent<SwitchState> implements TySwit
83
72
  constructor();
84
73
  protected onConnect(): void;
85
74
  protected onDisconnect(): void;
86
- protected onPropertiesChanged(_changes: PropertyChange[]): void;
75
+ protected onPropertiesChanged(changes: PropertyChange[]): void;
76
+ /** Custom (non-built-in) flavors — see utils/flavor-sheet.ts. */
77
+ private _syncCustomFlavor;
87
78
  protected getFormValue(): FormDataEntryValue | null;
88
79
  private buildClassList;
89
80
  private handleSwitchClick;
@@ -110,4 +101,3 @@ export declare class TySwitch extends TyComponent<SwitchState> implements TySwit
110
101
  get form(): HTMLFormElement | null;
111
102
  }
112
103
  export {};
113
- //# sourceMappingURL=switch.d.ts.map
@@ -1,26 +1,11 @@
1
- /**
2
- * TySwitch Web Component
3
- *
4
- * "Just the toggle" primitive — renders only the track + thumb visual.
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, role="switch" ARIA
9
- * - Form-associated, keyboard accessibility
10
- * - Sizes (xs, sm, md, lg, xl) and semantic flavors
11
- *
12
- * @example
13
- * <label>
14
- * <ty-switch name="notifications" checked></ty-switch>
15
- * Email notifications
16
- * </label>
17
- */
18
1
  import { TyComponent } from "../base/ty-component.js";
19
2
  import { ensureStyles } from "../utils/styles.js";
20
- import { switchStyles } from "../styles/switch.js";
3
+ import { syncCustomFlavorSheet } from "../utils/flavor-sheet.js";
4
+ import { switchStyles, switchCustomFlavorCss } from "../styles/switch.js";
21
5
  export class TySwitch extends TyComponent {
22
6
  constructor() {
23
7
  super();
8
+ this._customFlavorSheet = null;
24
9
  this._listenersSetup = false;
25
10
  this._clickHandler = null;
26
11
  this._keydownHandler = null;
@@ -30,19 +15,25 @@ export class TySwitch extends TyComponent {
30
15
  ensureStyles(shadow, { css: switchStyles, id: "ty-switch" });
31
16
  }
32
17
  onConnect() {
33
- // Re-arm listeners on RE-connect (base skips render() when already
34
- // rendered; onDisconnect removed them). No-op on first connect.
35
18
  this.setupEventListeners();
19
+ this._syncCustomFlavor();
36
20
  }
37
21
  onDisconnect() {
38
22
  this.removeEventListeners();
39
23
  }
40
- onPropertiesChanged(_changes) { }
24
+ onPropertiesChanged(changes) {
25
+ if (changes.some((c) => c.name === "flavor")) {
26
+ this._syncCustomFlavor();
27
+ }
28
+ }
29
+ _syncCustomFlavor() {
30
+ this._customFlavorSheet = syncCustomFlavorSheet(this.shadowRoot, this._customFlavorSheet, this.flavor, ({ base }) => switchCustomFlavorCss(base));
31
+ }
41
32
  getFormValue() {
42
33
  return this.checked ? this.value : null;
43
34
  }
44
35
  buildClassList() {
45
- const classes = [this.size, this.flavor];
36
+ const classes = [this.size];
46
37
  if (this.disabled)
47
38
  classes.push("disabled");
48
39
  if (this.required)
@@ -52,6 +43,8 @@ export class TySwitch extends TyComponent {
52
43
  handleSwitchClick(e) {
53
44
  if (this.disabled)
54
45
  return;
46
+ if (this.isDuplicateActivationClick())
47
+ return;
55
48
  const newValue = !this.checked;
56
49
  this.checked = newValue;
57
50
  setTimeout(() => {
@@ -77,8 +70,6 @@ export class TySwitch extends TyComponent {
77
70
  removeEventListeners() {
78
71
  if (!this._listenersSetup)
79
72
  return;
80
- // Click lives on the HOST (label delegation + full-element trigger) —
81
- // remove it before the shadow-container guard below.
82
73
  if (this._clickHandler) {
83
74
  this.removeEventListener("click", this._clickHandler);
84
75
  this._clickHandler = null;
@@ -116,8 +107,6 @@ export class TySwitch extends TyComponent {
116
107
  this._keydownHandler = (e) => this.handleSwitchKeydown(e);
117
108
  this._focusHandler = () => el.classList.add("focused");
118
109
  this._blurHandler = () => el.classList.remove("focused");
119
- // Click on the HOST: whole element is a trigger and a wrapping <label>
120
- // delegates (the synthetic click lands on the host, not the shadow).
121
110
  this.addEventListener("click", this._clickHandler);
122
111
  el.addEventListener("keydown", this._keydownHandler);
123
112
  el.addEventListener("focus", this._focusHandler);
@@ -151,15 +140,10 @@ export class TySwitch extends TyComponent {
151
140
  switchEl.setAttribute("aria-disabled", this.disabled ? "true" : "false");
152
141
  switchEl.setAttribute("aria-required", this.required ? "true" : "false");
153
142
  }
154
- // (Re)attach listeners — onDisconnect removes them, so a reconnected
155
- // element needs them again even though the container already exists.
156
143
  this.setupEventListeners();
157
- // a11y: mirror the wrapping <label> name onto the role="switch" element.
158
144
  this.applyLabelName(switchEl);
159
- // Reflect constraint validation to the owning <form> (required was cosmetic).
160
145
  this.updateValidity();
161
146
  }
162
- /** required + unchecked => valueMissing; otherwise valid. */
163
147
  updateValidity() {
164
148
  const anchor = this.shadowRoot?.querySelector(".switch-container");
165
149
  if (this.disabled) {
@@ -173,9 +157,6 @@ export class TySwitch extends TyComponent {
173
157
  this._internals.setValidity({});
174
158
  }
175
159
  }
176
- // ============================================================================
177
- // PROPERTY ACCESSORS
178
- // ============================================================================
179
160
  get checked() { return this.getProperty("checked"); }
180
161
  set checked(value) { this.setProperty("checked", value); }
181
162
  get value() { return this.getProperty("value"); }
@@ -236,35 +217,8 @@ TySwitch.properties = {
236
217
  type: "string",
237
218
  visual: true,
238
219
  default: "primary",
239
- validate: (v) => {
240
- const valid = [
241
- "primary",
242
- "secondary",
243
- "success",
244
- "danger",
245
- "warning",
246
- "neutral",
247
- ];
248
- return valid.includes(v);
249
- },
250
- coerce: (v) => {
251
- const valid = [
252
- "primary",
253
- "secondary",
254
- "success",
255
- "danger",
256
- "warning",
257
- "neutral",
258
- ];
259
- if (!valid.includes(v)) {
260
- console.warn(`[ty-switch] Invalid flavor '${v}'. Using 'primary'.`);
261
- return "primary";
262
- }
263
- return v;
264
- },
265
220
  },
266
221
  };
267
222
  if (!customElements.get("ty-switch")) {
268
223
  customElements.define("ty-switch", TySwitch);
269
224
  }
270
- //# sourceMappingURL=switch.js.map
@@ -1,8 +1,4 @@
1
- /**
2
- * Tab Component
3
- *
4
- * Individual tab panel with custom scrollbar via CustomScrollbar utility.
5
- */
1
+ /** Individual tab panel with custom scrollbar via CustomScrollbar utility. */
6
2
  export interface TabAttributes {
7
3
  id: string | null;
8
4
  label: string | null;
@@ -20,4 +16,3 @@ export declare class TyTab extends HTMLElement {
20
16
  private _destroyScrollbar;
21
17
  resetScroll(): void;
22
18
  }
23
- //# sourceMappingURL=tab.d.ts.map
@@ -1,8 +1,3 @@
1
- /**
2
- * Tab Component
3
- *
4
- * Individual tab panel with custom scrollbar via CustomScrollbar utility.
5
- */
6
1
  import { ensureStyles } from '../utils/styles.js';
7
2
  import { tabStyles } from '../styles/tab.js';
8
3
  import { CustomScrollbar, isCustomScrollbarEnabled } from '../utils/custom-scrollbar.js';
@@ -54,7 +49,6 @@ export class TyTab extends HTMLElement {
54
49
  return;
55
50
  panel.classList.add('ty-custom-scroll');
56
51
  this._scrollbar = new CustomScrollbar(panel, { vertical: true });
57
- // Append track to wrapper (outside the scroll area, so it stays fixed)
58
52
  if (this._scrollbar.trackY) {
59
53
  wrapper.appendChild(this._scrollbar.trackY);
60
54
  }
@@ -73,4 +67,3 @@ export class TyTab extends HTMLElement {
73
67
  if (!customElements.get('ty-tab')) {
74
68
  customElements.define('ty-tab', TyTab);
75
69
  }
76
- //# sourceMappingURL=tab.js.map
@@ -1,65 +1,7 @@
1
1
  /**
2
- * Tabs Component
3
- *
4
- * A carousel-based tabs component with smooth animations and fixed container dimensions.
5
- * Features horizontal sliding transitions, smart positioning marker, and independent panel scrolling.
6
- *
7
- * Features:
8
- * - Carousel animation with smooth sliding transitions
9
- * - Fixed dimensions prevent layout shift between tabs
10
- * - Animated marker that follows active tab button
11
- * - Rich label support via slots (icons, badges, custom content)
12
- * - Custom marker slot for complete active tab styling control
13
- * - Independent panel scrolling with scroll position reset
14
- * - ResizeObserver for responsive percentage widths
15
- * - Smart rendering - only updates DOM when necessary
16
- * - Accessibility with ARIA roles and attributes
17
- * - Top/bottom placement for tab buttons
18
- *
19
- * @example
20
- * <!-- Basic tabs with text labels -->
21
- * <ty-tabs width="800px" height="600px" active="general">
22
- * <ty-tab id="general" label="General Settings">
23
- * <div class="p-6">General content...</div>
24
- * </ty-tab>
25
- * <ty-tab id="advanced" label="Advanced Settings">
26
- * <div class="p-6">Advanced content...</div>
27
- * </ty-tab>
28
- * </ty-tabs>
29
- *
30
- * @example
31
- * <!-- Rich labels with icons and badges -->
32
- * <ty-tabs width="800px" height="600px">
33
- * <!-- Rich label as direct child -->
34
- * <span slot="label-profile" class="flex items-center gap-2">
35
- * <ty-icon name="user" size="sm"></ty-icon>
36
- * Profile
37
- * </span>
38
- *
39
- * <span slot="label-notifications" class="flex items-center gap-2">
40
- * <ty-icon name="bell" size="sm"></ty-icon>
41
- * Notifications
42
- * <span class="ty-bg-danger ty-text-danger++ px-2 py-0.5 rounded-full text-xs">5</span>
43
- * </span>
44
- *
45
- * <!-- Tab panels -->
46
- * <ty-tab id="profile">...</ty-tab>
47
- * <ty-tab id="notifications">...</ty-tab>
48
- * </ty-tabs>
49
- *
50
- * @example
51
- * <!-- Custom marker styling -->
52
- * <ty-tabs width="100%" height="400px">
53
- * <!-- Gradient marker slot -->
54
- * <div slot="marker" style="
55
- * background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
56
- * border-radius: 0.5rem;
57
- * box-shadow: 0 2px 8px rgba(0,0,0,0.15);
58
- * "></div>
59
- *
60
- * <ty-tab id="tab1" label="Dashboard">...</ty-tab>
61
- * <ty-tab id="tab2" label="Analytics">...</ty-tab>
62
- * </ty-tabs>
2
+ * Tabs Component — carousel-based tabs with sliding transitions, an animated
3
+ * active marker, and fixed container dimensions. Expects `ty-tab` children;
4
+ * rich labels come from `slot="label-{tab-id}"` children of `ty-tabs` itself.
63
5
  */
64
6
  /**
65
7
  * Tabs container attributes configuration
@@ -83,11 +25,11 @@ export interface TabChangeDetail {
83
25
  * TyTabs Web Component
84
26
  */
85
27
  export declare class TyTabs extends HTMLElement {
86
- /** Observed attributes */
87
28
  static get observedAttributes(): string[];
88
29
  constructor();
30
+ private _childObserver;
31
+ private _childRenderQueued;
89
32
  connectedCallback(): void;
90
33
  disconnectedCallback(): void;
91
34
  attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void;
92
35
  }
93
- //# sourceMappingURL=tabs.d.ts.map