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,14 +1,9 @@
1
1
  /**
2
- * TyTag Web Component
3
- * PORTED FROM: clj/ty/components/tag.cljs
4
- * Tag component with slots and semantic flavors
2
+ * TyTag Web Component — tag/chip with slots and semantic flavors.
5
3
  */
6
4
  import type { Flavor, Size, TyTagElement } from "../types/common.js";
7
5
  import { TyComponent } from "../base/ty-component.js";
8
6
  import type { PropertyChange } from "../utils/property-manager.js";
9
- /**
10
- * Component internal state (for typing TyComponent)
11
- */
12
7
  interface TagState {
13
8
  flavor: Flavor;
14
9
  size: Size;
@@ -82,11 +77,7 @@ export declare class TyTag extends TyComponent<TagState> implements TyTagElement
82
77
  private _cleanup;
83
78
  private _customFlavorSheet;
84
79
  constructor();
85
- /**
86
- * Called when component connects to DOM
87
- * TyComponent already handled pre-connection property capture
88
- * TyComponent will call render() automatically after this hook
89
- */
80
+ /** TyComponent calls render() automatically after this hook. */
90
81
  protected onConnect(): void;
91
82
  /**
92
83
  * Custom (non-built-in) flavors: generate the same --tag-* wiring the
@@ -95,41 +86,17 @@ export declare class TyTag extends TyComponent<TagState> implements TyTagElement
95
86
  * for why this is an adopted sheet and how page-level overrides survive.
96
87
  */
97
88
  private _syncCustomFlavor;
98
- /**
99
- * Called when component disconnects from DOM
100
- */
101
89
  protected onDisconnect(): void;
102
90
  /**
103
91
  * Handle property changes - called BEFORE render
104
92
  */
105
93
  protected onPropertiesChanged(changes: PropertyChange[]): void;
106
- /**
107
- * Handle tag click events
108
- */
109
94
  private handleClick;
110
- /**
111
- * Handle tag dismiss events
112
- */
113
95
  private handleDismiss;
114
- /**
115
- * Handle keyboard interactions
116
- */
117
96
  private handleKeydown;
118
- /**
119
- * Dispatch custom tag events
120
- */
121
97
  private dispatchTagEvent;
122
- /**
123
- * Clean up existing event listeners
124
- */
125
98
  private cleanupEventListeners;
126
- /**
127
- * Setup event listeners for tag interactions
128
- */
129
99
  private setupEventListeners;
130
- /**
131
- * Render the tag component
132
- */
133
100
  protected render(): void;
134
101
  get flavor(): Flavor;
135
102
  set flavor(value: Flavor);
@@ -149,4 +116,3 @@ export declare class TyTag extends TyComponent<TagState> implements TyTagElement
149
116
  set disabled(value: boolean);
150
117
  }
151
118
  export {};
152
- //# sourceMappingURL=tag.d.ts.map
@@ -1,41 +1,12 @@
1
- /**
2
- * TyTag Web Component
3
- * PORTED FROM: clj/ty/components/tag.cljs
4
- * Tag component with slots and semantic flavors
5
- */
6
1
  import { syncCustomFlavorSheet } from "../utils/flavor-sheet.js";
7
2
  import { TyComponent } from "../base/ty-component.js";
8
3
  import { ensureStyles } from "../utils/styles.js";
9
4
  import { tagStyles } from "../styles/tag.js";
10
- /**
11
- * Ty Tag Component
12
- *
13
- * @example
14
- * ```html
15
- * <ty-tag flavor="primary">Primary Tag</ty-tag>
16
- * <ty-tag flavor="success" dismissible>Success Tag</ty-tag>
17
- * <ty-tag flavor="danger" clickable>Clickable Tag</ty-tag>
18
- * <ty-tag value="tag-1" selected>Selected Tag</ty-tag>
19
- * ```
20
- */
21
5
  export class TyTag extends TyComponent {
22
6
  constructor() {
23
- super(); // TyComponent handles attachInternals() and attachShadow()
24
- // ============================================================================
25
- // INTERNAL STATE
26
- // ============================================================================
27
- // Event listener cleanup function
7
+ super();
28
8
  this._cleanup = null;
29
- // Adopted sheet holding generated rules for a custom (non-built-in) flavor.
30
- // Must be an adopted sheet, not a <style> element — render() replaces
31
- // shadowRoot.innerHTML, which would destroy an injected element.
32
9
  this._customFlavorSheet = null;
33
- // ============================================================================
34
- // EVENT HANDLERS (arrow functions for stable references)
35
- // ============================================================================
36
- /**
37
- * Handle tag click events
38
- */
39
10
  this.handleClick = (event) => {
40
11
  if (this.clickable && !this.disabled) {
41
12
  event.preventDefault();
@@ -44,9 +15,6 @@ export class TyTag extends TyComponent {
44
15
  this.dispatchTagEvent("pointerdown", { target: this });
45
16
  }
46
17
  };
47
- /**
48
- * Handle tag dismiss events
49
- */
50
18
  this.handleDismiss = (event) => {
51
19
  if (this.dismissible && !this.disabled) {
52
20
  event.preventDefault();
@@ -54,26 +22,21 @@ export class TyTag extends TyComponent {
54
22
  this.dispatchTagEvent("dismiss", { target: this });
55
23
  }
56
24
  };
57
- /**
58
- * Handle keyboard interactions
59
- */
60
25
  this.handleKeydown = (event) => {
61
26
  const keyboardEvent = event;
62
27
  if (this.disabled)
63
28
  return;
64
29
  const keyCode = keyboardEvent.keyCode;
65
30
  switch (keyCode) {
66
- // ENTER or SPACE - trigger click if clickable
67
- case 13: // Enter
68
- case 32: // Space
31
+ case 13:
32
+ case 32:
69
33
  if (this.clickable) {
70
34
  keyboardEvent.preventDefault();
71
35
  this.dispatchTagEvent("click", { target: this });
72
36
  }
73
37
  break;
74
- // DELETE or BACKSPACE - trigger dismiss if dismissible
75
- case 8: // Backspace
76
- case 46: // Delete
38
+ case 8:
39
+ case 46:
77
40
  if (this.dismissible) {
78
41
  keyboardEvent.preventDefault();
79
42
  this.dispatchTagEvent("dismiss", { target: this });
@@ -81,32 +44,14 @@ export class TyTag extends TyComponent {
81
44
  break;
82
45
  }
83
46
  };
84
- // Apply styles to shadow root
85
47
  ensureStyles(this.shadowRoot, { css: tagStyles, id: "ty-tag" });
86
48
  }
87
- // observedAttributes auto-generated by TyComponent from properties config
88
- // ============================================================================
89
- // TYCOMPONENT LIFECYCLE HOOKS
90
- // ============================================================================
91
- /**
92
- * Called when component connects to DOM
93
- * TyComponent already handled pre-connection property capture
94
- * TyComponent will call render() automatically after this hook
95
- */
96
49
  onConnect() {
97
50
  this._syncCustomFlavor();
98
- // Setup event listeners after initial render happens
99
- // Use queueMicrotask to ensure render() has been called by TyComponent
100
51
  queueMicrotask(() => {
101
52
  this.setupEventListeners();
102
53
  });
103
54
  }
104
- /**
105
- * Custom (non-built-in) flavors: generate the same --tag-* wiring the
106
- * built-in flavors get, pointed at the user's design tokens
107
- * (--ty-bg-X / --ty-color-X / --ty-border-X). See utils/flavor-sheet.ts
108
- * for why this is an adopted sheet and how page-level overrides survive.
109
- */
110
55
  _syncCustomFlavor() {
111
56
  this._customFlavorSheet = syncCustomFlavorSheet(this.shadowRoot, this._customFlavorSheet, this.flavor, ({ flavor, base, shade }) => {
112
57
  const bg = shade === "+" ? `--ty-bg-${base}-bold`
@@ -127,26 +72,14 @@ export class TyTag extends TyComponent {
127
72
  }`;
128
73
  });
129
74
  }
130
- /**
131
- * Called when component disconnects from DOM
132
- */
133
75
  onDisconnect() {
134
76
  this.cleanupEventListeners();
135
77
  }
136
- /**
137
- * Handle property changes - called BEFORE render
138
- */
139
78
  onPropertiesChanged(changes) {
140
79
  if (changes.some((c) => c.name === "flavor")) {
141
80
  this._syncCustomFlavor();
142
81
  }
143
82
  }
144
- // ============================================================================
145
- // EVENT HELPERS
146
- // ============================================================================
147
- /**
148
- * Dispatch custom tag events
149
- */
150
83
  dispatchTagEvent(eventType, detail) {
151
84
  this.dispatchEvent(new CustomEvent(eventType, {
152
85
  detail,
@@ -155,34 +88,24 @@ export class TyTag extends TyComponent {
155
88
  cancelable: true,
156
89
  }));
157
90
  }
158
- /**
159
- * Clean up existing event listeners
160
- */
161
91
  cleanupEventListeners() {
162
92
  if (this._cleanup) {
163
93
  this._cleanup();
164
94
  this._cleanup = null;
165
95
  }
166
96
  }
167
- /**
168
- * Setup event listeners for tag interactions
169
- */
170
97
  setupEventListeners() {
171
- // Clean up any existing listeners first
172
98
  this.cleanupEventListeners();
173
99
  const shadow = this.shadowRoot;
174
100
  const container = shadow.querySelector(".tag-container");
175
101
  const dismissBtn = shadow.querySelector(".tag-dismiss");
176
102
  if (!container)
177
103
  return;
178
- // Click handler for main tag
179
104
  container.addEventListener("click", this.handleClick);
180
105
  container.addEventListener("keydown", this.handleKeydown);
181
- // Dismiss button handler
182
106
  if (dismissBtn) {
183
107
  dismissBtn.addEventListener("click", this.handleDismiss);
184
108
  }
185
- // Store cleanup function
186
109
  this._cleanup = () => {
187
110
  container.removeEventListener("click", this.handleClick);
188
111
  container.removeEventListener("keydown", this.handleKeydown);
@@ -191,19 +114,11 @@ export class TyTag extends TyComponent {
191
114
  }
192
115
  };
193
116
  }
194
- // ============================================================================
195
- // RENDER
196
- // ============================================================================
197
- /**
198
- * Render the tag component
199
- */
200
117
  render() {
201
118
  const shadow = this.shadowRoot;
202
- // Build the tag container
203
119
  const tabindex = this.clickable ? ' tabindex="0"' : "";
204
120
  const ariaDisabled = this.disabled ? ' aria-disabled="true"' : "";
205
121
  const dataValue = this.value ? ` data-value="${this.value}"` : "";
206
- // Build dismiss button SVG
207
122
  const dismissButton = this.dismissible
208
123
  ? `
209
124
  <button class="tag-dismiss" type="button" aria-label="Remove tag">
@@ -227,14 +142,10 @@ export class TyTag extends TyComponent {
227
142
  </div>
228
143
  </div>
229
144
  `;
230
- // Re-setup event listeners after innerHTML replace (destroys old elements)
231
145
  if (this._connected) {
232
146
  this.setupEventListeners();
233
147
  }
234
148
  }
235
- // ============================================================================
236
- // PROPERTY ACCESSORS - Simple wrappers (no logic!)
237
- // ============================================================================
238
149
  get flavor() {
239
150
  return this.getProperty("flavor");
240
151
  }
@@ -285,20 +196,11 @@ export class TyTag extends TyComponent {
285
196
  }
286
197
  }
287
198
  TyTag.formAssociated = true;
288
- // ============================================================================
289
- // PROPERTY CONFIGURATION - Declarative property lifecycle
290
- // ============================================================================
291
199
  TyTag.properties = {
292
200
  flavor: {
293
201
  type: "string",
294
202
  visual: true,
295
203
  default: "neutral",
296
- // Built-in: primary | success | danger | warning | neutral.
297
- // Append `+` for stronger or `-` for softer shade (e.g. "primary+",
298
- // "danger-"). Any other string is a custom flavor: if you define the
299
- // design tokens (--ty-bg-X, --ty-color-X, --ty-border-X) it just works
300
- // (see _syncCustomFlavor), and ty-tag[flavor="X"] { --tag-bg: ...; }
301
- // rules in the page still override.
302
204
  },
303
205
  size: {
304
206
  type: "string",
@@ -345,8 +247,6 @@ TyTag.properties = {
345
247
  default: false,
346
248
  },
347
249
  };
348
- // Register the custom element
349
250
  if (!customElements.get("ty-tag")) {
350
251
  customElements.define("ty-tag", TyTag);
351
252
  }
352
- //# sourceMappingURL=tag.js.map
@@ -1,48 +1,13 @@
1
1
  /**
2
- * ty-textarea - Enhanced textarea component with auto-resize functionality
3
- *
4
- * Features:
5
- * - Auto-resize based on content
6
- * - Form-associated custom element
7
- * - Min/max height constraints
8
- * - Size variants (xs, sm, md, lg, xl)
9
- * - Validation states (error, required)
10
- * - Manual resize control options
11
- * - Accessibility support
12
- *
13
- * @example
14
- * ```html
15
- * <!-- Basic usage -->
16
- * <ty-textarea label="Description" placeholder="Enter details..."></ty-textarea>
17
- *
18
- * <!-- With validation -->
19
- * <ty-textarea
20
- * label="Bio"
21
- * required
22
- * error="Bio is required"
23
- * size="lg">
24
- * </ty-textarea>
25
- *
26
- * <!-- With height constraints -->
27
- * <ty-textarea
28
- * min-height="100px"
29
- * max-height="300px"
30
- * placeholder="Auto-resizing textarea">
31
- * </ty-textarea>
32
- *
33
- * <!-- Manual resize control -->
34
- * <ty-textarea resize="vertical"></ty-textarea>
35
- * ```
2
+ * ty-textarea — form-associated textarea that auto-resizes to its content,
3
+ * within optional min-height/max-height constraints.
36
4
  *
37
5
  * @fires {CustomEvent<{value: string, originalEvent: Event}>} input - Emitted on input
38
6
  * @fires {CustomEvent<{value: string, originalEvent: Event}>} change - Emitted on change
39
7
  */
40
8
  import { TyComponent } from '../base/ty-component.js';
41
9
  import type { PropertyChange } from '../utils/property-manager.js';
42
- /**
43
- * Component internal state (for typing TyComponent)
44
- * Actual state stored as private fields
45
- */
10
+ /** For typing TyComponent only — actual state lives in private fields. */
46
11
  interface TextareaState {
47
12
  value: string;
48
13
  isFocused: boolean;
@@ -145,23 +110,10 @@ export declare class TyTextarea extends TyComponent<TextareaState> implements Ty
145
110
  private _scrollbar;
146
111
  private _isFocused;
147
112
  constructor();
148
- /**
149
- * Called when component connects to DOM
150
- * TyComponent already handled pre-connection property capture
151
- */
152
113
  protected onConnect(): void;
153
- /**
154
- * Called when component disconnects from DOM
155
- */
156
114
  protected onDisconnect(): void;
157
- /**
158
- * Handle property changes - called BEFORE render
159
- * This replaces the old attributeChangedCallback logic
160
- */
115
+ /** Called BEFORE render. Visual property changes re-render automatically. */
161
116
  protected onPropertiesChanged(changes: PropertyChange[]): void;
162
- /**
163
- * Override form value to return current value
164
- */
165
117
  protected getFormValue(): FormDataEntryValue | null;
166
118
  get value(): string;
167
119
  set value(v: string);
@@ -189,51 +141,20 @@ export declare class TyTextarea extends TyComponent<TextareaState> implements Ty
189
141
  set minHeight(v: string);
190
142
  get maxHeight(): string;
191
143
  set maxHeight(v: string);
192
- /**
193
- * Extract font-related CSS properties from element
194
- */
195
144
  private getFontStyle;
196
- /**
197
- * Extract spacing-related CSS properties from element
198
- */
199
145
  private getSpacingStyle;
200
- /**
201
- * Setup the hidden dummy element for height measurement
202
- */
146
+ /** Hidden dummy element used to measure the content height. */
203
147
  private setupDummyElement;
204
- /**
205
- * Resize textarea based on dummy element content with min/max height constraints
206
- */
148
+ /** Resize the textarea to the dummy's measured height, within min/max. */
207
149
  private resizeTextarea;
208
150
  private _setupScrollbar;
209
151
  private _destroyScrollbar;
210
- /**
211
- * Emit custom input and change events
212
- */
213
152
  private emitValueEvents;
214
- /**
215
- * Handle textarea input event
216
- */
217
153
  private handleInputEvent;
218
- /**
219
- * Handle textarea focus event
220
- */
221
154
  private handleFocusEvent;
222
- /**
223
- * Handle textarea blur event
224
- */
225
155
  private handleBlurEvent;
226
- /**
227
- * Build class list for textarea element
228
- */
229
156
  private buildClassList;
230
- /**
231
- * Apply min/max height constraints to textarea element
232
- */
233
157
  private applyHeightConstraints;
234
- /**
235
- * Setup event listeners for textarea
236
- */
237
158
  private setupTextareaEvents;
238
159
  protected render(): void;
239
160
  /** required + empty => valueMissing; otherwise valid. Disabled fields are
@@ -241,4 +162,3 @@ export declare class TyTextarea extends TyComponent<TextareaState> implements Ty
241
162
  private updateValidity;
242
163
  }
243
164
  export {};
244
- //# sourceMappingURL=textarea.d.ts.map