revotech-ui-kit 0.0.6-beta → 0.0.10

Sign up to get free protection for your applications and to get access to all the features.
Files changed (428) hide show
  1. package/dist/revotech-ui-kit.cjs +2293 -0
  2. package/dist/revotech-ui-kit.js +5608 -0
  3. package/dist/src/assets/icons/arrows.icon.d.ts +1 -0
  4. package/{src/assets/icons/arrows.icon.ts → dist/src/assets/icons/arrows.icon.js} +2 -2
  5. package/dist/src/assets/icons/arrows.icon.js.map +1 -0
  6. package/dist/src/assets/icons/index.js +4 -0
  7. package/dist/src/assets/icons/index.js.map +1 -0
  8. package/dist/src/assets/icons/search.icon.d.ts +1 -0
  9. package/{src/assets/icons/search.icon.ts → dist/src/assets/icons/search.icon.js} +2 -2
  10. package/dist/src/assets/icons/search.icon.js.map +1 -0
  11. package/dist/src/assets/icons/tick.icon.d.ts +1 -0
  12. package/{src/assets/icons/tick.icon.ts → dist/src/assets/icons/tick.icon.js} +2 -2
  13. package/dist/src/assets/icons/tick.icon.js.map +1 -0
  14. package/dist/src/components/atoms/alert/alert-description.d.ts +5 -0
  15. package/dist/src/components/atoms/alert/alert-description.js +18 -0
  16. package/dist/src/components/atoms/alert/alert-description.js.map +1 -0
  17. package/dist/src/components/atoms/alert/alert-title.d.ts +5 -0
  18. package/dist/src/components/atoms/alert/alert-title.js +20 -0
  19. package/dist/src/components/atoms/alert/alert-title.js.map +1 -0
  20. package/dist/src/components/atoms/alert/alert.atom.d.ts +15 -0
  21. package/{src/components/atoms/alert/alert.atom.ts → dist/src/components/atoms/alert/alert.atom.js} +33 -33
  22. package/dist/src/components/atoms/alert/alert.atom.js.map +1 -0
  23. package/dist/src/components/atoms/alert/alert.stories.d.ts +6 -0
  24. package/dist/src/components/atoms/alert/alert.stories.js +62 -0
  25. package/dist/src/components/atoms/alert/alert.stories.js.map +1 -0
  26. package/dist/src/components/atoms/alert/alert.styles.d.ts +4 -0
  27. package/dist/src/components/atoms/alert/alert.styles.js +21 -0
  28. package/dist/src/components/atoms/alert/alert.styles.js.map +1 -0
  29. package/dist/src/components/atoms/alert/alert.types.js +2 -0
  30. package/dist/src/components/atoms/alert/alert.types.js.map +1 -0
  31. package/dist/src/components/atoms/badge/badge.atom.d.ts +16 -0
  32. package/dist/src/components/atoms/badge/badge.atom.js +43 -0
  33. package/dist/src/components/atoms/badge/badge.atom.js.map +1 -0
  34. package/dist/src/components/atoms/badge/badge.stories.d.ts +6 -0
  35. package/dist/src/components/atoms/badge/badge.stories.js +110 -0
  36. package/dist/src/components/atoms/badge/badge.stories.js.map +1 -0
  37. package/dist/src/components/atoms/badge/badge.style.d.ts +3 -0
  38. package/dist/src/components/atoms/badge/badge.style.js +17 -0
  39. package/dist/src/components/atoms/badge/badge.style.js.map +1 -0
  40. package/dist/src/components/atoms/badge/badge.type.d.ts +1 -0
  41. package/dist/src/components/atoms/badge/badge.type.js +2 -0
  42. package/dist/src/components/atoms/badge/badge.type.js.map +1 -0
  43. package/dist/src/components/atoms/button/button.atom.d.ts +22 -0
  44. package/dist/src/components/atoms/button/button.atom.js +67 -0
  45. package/dist/src/components/atoms/button/button.atom.js.map +1 -0
  46. package/dist/src/components/atoms/button/button.stories.d.ts +6 -0
  47. package/dist/src/components/atoms/button/button.stories.js +204 -0
  48. package/dist/src/components/atoms/button/button.stories.js.map +1 -0
  49. package/dist/src/components/atoms/button/button.style.d.ts +4 -0
  50. package/dist/src/components/atoms/button/button.style.js +24 -0
  51. package/dist/src/components/atoms/button/button.style.js.map +1 -0
  52. package/{src/components/atoms/button/button.type.ts → dist/src/components/atoms/button/button.type.d.ts} +1 -8
  53. package/dist/src/components/atoms/button/button.type.js +2 -0
  54. package/dist/src/components/atoms/button/button.type.js.map +1 -0
  55. package/dist/src/components/atoms/card/card-content.d.ts +5 -0
  56. package/dist/src/components/atoms/card/card-content.js +17 -0
  57. package/dist/src/components/atoms/card/card-content.js.map +1 -0
  58. package/dist/src/components/atoms/card/card-description.d.ts +5 -0
  59. package/dist/src/components/atoms/card/card-description.js +17 -0
  60. package/dist/src/components/atoms/card/card-description.js.map +1 -0
  61. package/dist/src/components/atoms/card/card-footer.d.ts +5 -0
  62. package/dist/src/components/atoms/card/card-footer.js +17 -0
  63. package/dist/src/components/atoms/card/card-footer.js.map +1 -0
  64. package/dist/src/components/atoms/card/card-header.d.ts +5 -0
  65. package/dist/src/components/atoms/card/card-header.js +17 -0
  66. package/dist/src/components/atoms/card/card-header.js.map +1 -0
  67. package/dist/src/components/atoms/card/card-title.d.ts +5 -0
  68. package/dist/src/components/atoms/card/card-title.js +17 -0
  69. package/dist/src/components/atoms/card/card-title.js.map +1 -0
  70. package/dist/src/components/atoms/card/card.atom.d.ts +11 -0
  71. package/{src/components/atoms/card/card.atom.ts → dist/src/components/atoms/card/card.atom.js} +11 -17
  72. package/dist/src/components/atoms/card/card.atom.js.map +1 -0
  73. package/dist/src/components/atoms/card/card.stories.d.ts +6 -0
  74. package/{src/components/atoms/card/card.stories.ts → dist/src/components/atoms/card/card.stories.js} +42 -55
  75. package/dist/src/components/atoms/card/card.stories.js.map +1 -0
  76. package/dist/src/components/atoms/checkbox/checkbox.atom.d.ts +13 -0
  77. package/dist/src/components/atoms/checkbox/checkbox.atom.js +87 -0
  78. package/dist/src/components/atoms/checkbox/checkbox.atom.js.map +1 -0
  79. package/dist/src/components/atoms/checkbox/checkbox.stories.d.ts +8 -0
  80. package/dist/src/components/atoms/checkbox/checkbox.stories.js +244 -0
  81. package/dist/src/components/atoms/checkbox/checkbox.stories.js.map +1 -0
  82. package/dist/src/components/atoms/checkbox/checkbox.style.d.ts +2 -0
  83. package/dist/src/components/atoms/checkbox/checkbox.style.js +3 -0
  84. package/dist/src/components/atoms/checkbox/checkbox.style.js.map +1 -0
  85. package/dist/src/components/atoms/checkbox/checkbox.type.d.ts +21 -0
  86. package/dist/src/components/atoms/checkbox/checkbox.type.js +2 -0
  87. package/dist/src/components/atoms/checkbox/checkbox.type.js.map +1 -0
  88. package/dist/src/components/atoms/combo-box/combo-box-input.d.ts +8 -0
  89. package/dist/src/components/atoms/combo-box/combo-box-input.js +47 -0
  90. package/dist/src/components/atoms/combo-box/combo-box-input.js.map +1 -0
  91. package/dist/src/components/atoms/combo-box/combo-box-item.d.ts +12 -0
  92. package/{src/components/atoms/combo-box/combo-box-item.ts → dist/src/components/atoms/combo-box/combo-box-item.js} +44 -18
  93. package/dist/src/components/atoms/combo-box/combo-box-item.js.map +1 -0
  94. package/dist/src/components/atoms/combo-box/combo-box-list.d.ts +9 -0
  95. package/{src/components/atoms/combo-box/combo-box-list.ts → dist/src/components/atoms/combo-box/combo-box-list.js} +37 -27
  96. package/dist/src/components/atoms/combo-box/combo-box-list.js.map +1 -0
  97. package/dist/src/components/atoms/combo-box/combo-box.atom.d.ts +23 -0
  98. package/dist/src/components/atoms/combo-box/combo-box.atom.js +199 -0
  99. package/dist/src/components/atoms/combo-box/combo-box.atom.js.map +1 -0
  100. package/dist/src/components/atoms/combo-box/combo-box.stories.d.ts +9 -0
  101. package/dist/src/components/atoms/combo-box/combo-box.stories.js +86 -0
  102. package/dist/src/components/atoms/combo-box/combo-box.stories.js.map +1 -0
  103. package/dist/src/components/atoms/command-empty/command-empty.atom.d.ts +9 -0
  104. package/dist/src/components/atoms/command-empty/command-empty.atom.js +53 -0
  105. package/dist/src/components/atoms/command-empty/command-empty.atom.js.map +1 -0
  106. package/dist/src/components/atoms/command-group/command-group.atom.d.ts +10 -0
  107. package/dist/src/components/atoms/command-group/command-group.atom.js +70 -0
  108. package/dist/src/components/atoms/command-group/command-group.atom.js.map +1 -0
  109. package/dist/src/components/atoms/command-item/command-item.atom.d.ts +12 -0
  110. package/dist/src/components/atoms/command-item/command-item.atom.js +78 -0
  111. package/dist/src/components/atoms/command-item/command-item.atom.js.map +1 -0
  112. package/dist/src/components/atoms/command-list/command-list.atom.d.ts +6 -0
  113. package/dist/src/components/atoms/command-list/command-list.atom.js +35 -0
  114. package/dist/src/components/atoms/command-list/command-list.atom.js.map +1 -0
  115. package/dist/src/components/atoms/command-separator/command-separator.atom.d.ts +9 -0
  116. package/dist/src/components/atoms/command-separator/command-separator.atom.js +51 -0
  117. package/dist/src/components/atoms/command-separator/command-separator.atom.js.map +1 -0
  118. package/dist/src/components/atoms/dialog/dialog-close.d.ts +7 -0
  119. package/dist/src/components/atoms/dialog/dialog-close.js +46 -0
  120. package/dist/src/components/atoms/dialog/dialog-close.js.map +1 -0
  121. package/dist/src/components/atoms/dialog/dialog-content.d.ts +8 -0
  122. package/dist/src/components/atoms/dialog/dialog-content.js +72 -0
  123. package/dist/src/components/atoms/dialog/dialog-content.js.map +1 -0
  124. package/dist/src/components/atoms/dialog/dialog-footer.d.ts +5 -0
  125. package/dist/src/components/atoms/dialog/dialog-footer.js +22 -0
  126. package/dist/src/components/atoms/dialog/dialog-footer.js.map +1 -0
  127. package/dist/src/components/atoms/dialog/dialog-header.d.ts +7 -0
  128. package/dist/src/components/atoms/dialog/dialog-header.js +40 -0
  129. package/dist/src/components/atoms/dialog/dialog-header.js.map +1 -0
  130. package/dist/src/components/atoms/dialog/dialog-overly.d.ts +5 -0
  131. package/dist/src/components/atoms/dialog/dialog-overly.js +20 -0
  132. package/dist/src/components/atoms/dialog/dialog-overly.js.map +1 -0
  133. package/dist/src/components/atoms/dialog/dialog-trigger.d.ts +8 -0
  134. package/dist/src/components/atoms/dialog/dialog-trigger.js +53 -0
  135. package/dist/src/components/atoms/dialog/dialog-trigger.js.map +1 -0
  136. package/dist/src/components/atoms/dialog/dialog.atom.d.ts +8 -0
  137. package/dist/src/components/atoms/dialog/dialog.atom.js +78 -0
  138. package/dist/src/components/atoms/dialog/dialog.atom.js.map +1 -0
  139. package/dist/src/components/atoms/dialog/dialog.stories.d.ts +16 -0
  140. package/{src/components/atoms/dialog/dialog.stories.ts → dist/src/components/atoms/dialog/dialog.stories.js} +7 -12
  141. package/dist/src/components/atoms/dialog/dialog.stories.js.map +1 -0
  142. package/dist/src/components/atoms/dropdownMenu/dropdown-menu-checkbox-Item.d.ts +15 -0
  143. package/dist/src/components/atoms/dropdownMenu/dropdown-menu-checkbox-Item.js +115 -0
  144. package/dist/src/components/atoms/dropdownMenu/dropdown-menu-checkbox-Item.js.map +1 -0
  145. package/dist/src/components/atoms/dropdownMenu/dropdown-menu-content.d.ts +13 -0
  146. package/dist/src/components/atoms/dropdownMenu/dropdown-menu-content.js +80 -0
  147. package/dist/src/components/atoms/dropdownMenu/dropdown-menu-content.js.map +1 -0
  148. package/dist/src/components/atoms/dropdownMenu/dropdown-menu-group.d.ts +10 -0
  149. package/dist/src/components/atoms/dropdownMenu/dropdown-menu-group.js +70 -0
  150. package/dist/src/components/atoms/dropdownMenu/dropdown-menu-group.js.map +1 -0
  151. package/dist/src/components/atoms/dropdownMenu/dropdown-menu-item.d.ts +12 -0
  152. package/dist/src/components/atoms/dropdownMenu/dropdown-menu-item.js +78 -0
  153. package/dist/src/components/atoms/dropdownMenu/dropdown-menu-item.js.map +1 -0
  154. package/dist/src/components/atoms/dropdownMenu/dropdown-menu-radio-item.d.ts +15 -0
  155. package/dist/src/components/atoms/dropdownMenu/dropdown-menu-radio-item.js +116 -0
  156. package/dist/src/components/atoms/dropdownMenu/dropdown-menu-radio-item.js.map +1 -0
  157. package/dist/src/components/atoms/dropdownMenu/dropdown-menu-seperator.d.ts +9 -0
  158. package/dist/src/components/atoms/dropdownMenu/dropdown-menu-seperator.js +51 -0
  159. package/dist/src/components/atoms/dropdownMenu/dropdown-menu-seperator.js.map +1 -0
  160. package/dist/src/components/atoms/dropdownMenu/dropdown-menu-shortcut.d.ts +5 -0
  161. package/dist/src/components/atoms/dropdownMenu/dropdown-menu-shortcut.js +20 -0
  162. package/dist/src/components/atoms/dropdownMenu/dropdown-menu-shortcut.js.map +1 -0
  163. package/dist/src/components/atoms/dropdownMenu/dropdown-menu.atom.d.ts +14 -0
  164. package/dist/src/components/atoms/dropdownMenu/dropdown-menu.atom.js +77 -0
  165. package/dist/src/components/atoms/dropdownMenu/dropdown-menu.atom.js.map +1 -0
  166. package/dist/src/components/atoms/dropdownMenu/dropdownMenu.stories.d.ts +15 -0
  167. package/{src/components/atoms/dropdownMenu/dropdownMenu.stories.ts → dist/src/components/atoms/dropdownMenu/dropdownMenu.stories.js} +7 -16
  168. package/dist/src/components/atoms/dropdownMenu/dropdownMenu.stories.js.map +1 -0
  169. package/dist/src/components/atoms/dropdownMenu/dropdownMenu.style.d.ts +2 -0
  170. package/dist/src/components/atoms/dropdownMenu/dropdownMenu.style.js +4 -0
  171. package/dist/src/components/atoms/dropdownMenu/dropdownMenu.style.js.map +1 -0
  172. package/dist/src/components/atoms/index.js +14 -0
  173. package/dist/src/components/atoms/index.js.map +1 -0
  174. package/dist/src/components/atoms/input/input.atom.d.ts +21 -0
  175. package/dist/src/components/atoms/input/input.atom.js +93 -0
  176. package/dist/src/components/atoms/input/input.atom.js.map +1 -0
  177. package/dist/src/components/atoms/input/input.stories.d.ts +8 -0
  178. package/dist/src/components/atoms/input/input.stories.js +382 -0
  179. package/dist/src/components/atoms/input/input.stories.js.map +1 -0
  180. package/dist/src/components/atoms/input/input.styles.d.ts +1 -0
  181. package/dist/src/components/atoms/input/input.styles.js +2 -0
  182. package/dist/src/components/atoms/input/input.styles.js.map +1 -0
  183. package/dist/src/components/atoms/input/input.type.d.ts +21 -0
  184. package/dist/src/components/atoms/input/input.type.js +2 -0
  185. package/dist/src/components/atoms/input/input.type.js.map +1 -0
  186. package/dist/src/components/atoms/label/label.atom.d.ts +11 -0
  187. package/dist/src/components/atoms/label/label.atom.js +67 -0
  188. package/dist/src/components/atoms/label/label.atom.js.map +1 -0
  189. package/dist/src/components/atoms/label/label.stories.d.ts +6 -0
  190. package/dist/src/components/atoms/label/label.stories.js +85 -0
  191. package/dist/src/components/atoms/label/label.stories.js.map +1 -0
  192. package/dist/src/components/atoms/label/label.style.d.ts +1 -0
  193. package/dist/src/components/atoms/label/label.style.js +3 -0
  194. package/dist/src/components/atoms/label/label.style.js.map +1 -0
  195. package/dist/src/components/atoms/popover/popover-content.d.ts +11 -0
  196. package/dist/src/components/atoms/popover/popover-content.js +62 -0
  197. package/dist/src/components/atoms/popover/popover-content.js.map +1 -0
  198. package/dist/src/components/atoms/popover/popover-trigger.d.ts +9 -0
  199. package/dist/src/components/atoms/popover/popover-trigger.js +50 -0
  200. package/dist/src/components/atoms/popover/popover-trigger.js.map +1 -0
  201. package/dist/src/components/atoms/popover/popover.atom.d.ts +8 -0
  202. package/dist/src/components/atoms/popover/popover.atom.js +40 -0
  203. package/dist/src/components/atoms/popover/popover.atom.js.map +1 -0
  204. package/dist/src/components/atoms/popover/popover.stories.d.ts +10 -0
  205. package/dist/src/components/atoms/popover/popover.stories.js +69 -0
  206. package/dist/src/components/atoms/popover/popover.stories.js.map +1 -0
  207. package/dist/src/components/atoms/popover/popover.style.d.ts +5 -0
  208. package/dist/src/components/atoms/popover/popover.style.js +21 -0
  209. package/dist/src/components/atoms/popover/popover.style.js.map +1 -0
  210. package/dist/src/components/atoms/popover/popover.types.d.ts +2 -0
  211. package/{src/components/atoms/popover/popover.types.ts → dist/src/components/atoms/popover/popover.types.js} +1 -0
  212. package/dist/src/components/atoms/popover/popover.types.js.map +1 -0
  213. package/dist/src/components/atoms/toggle/defs.d.ts +27 -0
  214. package/dist/src/components/atoms/toggle/defs.js +30 -0
  215. package/dist/src/components/atoms/toggle/defs.js.map +1 -0
  216. package/dist/src/components/atoms/toggle/toggle.atom.d.ts +19 -0
  217. package/dist/src/components/atoms/toggle/toggle.atom.js +72 -0
  218. package/dist/src/components/atoms/toggle/toggle.atom.js.map +1 -0
  219. package/dist/src/components/atoms/toggle/toggle.stories.d.ts +6 -0
  220. package/dist/src/components/atoms/toggle/toggle.stories.js +189 -0
  221. package/dist/src/components/atoms/toggle/toggle.stories.js.map +1 -0
  222. package/dist/src/components/atoms/toggle/toggle.style.d.ts +4 -0
  223. package/dist/src/components/atoms/toggle/toggle.style.js +19 -0
  224. package/dist/src/components/atoms/toggle/toggle.style.js.map +1 -0
  225. package/dist/src/components/command/command.d.ts +56 -0
  226. package/dist/src/components/command/command.js +402 -0
  227. package/dist/src/components/command/command.js.map +1 -0
  228. package/dist/src/components/command/command.stories.d.ts +5 -0
  229. package/{src/components/command/command.stories.ts → dist/src/components/command/command.stories.js} +6 -7
  230. package/dist/src/components/command/command.stories.js.map +1 -0
  231. package/dist/src/components/index.js +3 -0
  232. package/dist/src/components/index.js.map +1 -0
  233. package/dist/src/components/molecules/command/command.molecules.d.ts +6 -0
  234. package/dist/src/components/molecules/command/command.molecules.js +27 -0
  235. package/dist/src/components/molecules/command/command.molecules.js.map +1 -0
  236. package/dist/src/components/molecules/command-input/command-input.atom.d.ts +10 -0
  237. package/dist/src/components/molecules/command-input/command-input.atom.js +125 -0
  238. package/dist/src/components/molecules/command-input/command-input.atom.js.map +1 -0
  239. package/dist/src/components/molecules/dropdownMenu/dropdownMenu.molecules.js +2 -0
  240. package/dist/src/components/molecules/dropdownMenu/dropdownMenu.molecules.js.map +1 -0
  241. package/dist/src/components/molecules/index.js +2 -0
  242. package/dist/src/components/molecules/index.js.map +1 -0
  243. package/dist/src/helpers/base-element.d.ts +10 -0
  244. package/dist/src/helpers/base-element.js +62 -0
  245. package/dist/src/helpers/base-element.js.map +1 -0
  246. package/dist/src/helpers/index.js +4 -0
  247. package/dist/src/helpers/index.js.map +1 -0
  248. package/dist/src/helpers/mouse-conroller.helper.d.ts +14 -0
  249. package/dist/src/helpers/mouse-conroller.helper.js +33 -0
  250. package/dist/src/helpers/mouse-conroller.helper.js.map +1 -0
  251. package/dist/src/helpers/style.helpers.d.ts +2 -0
  252. package/dist/src/helpers/style.helpers.js +6 -0
  253. package/dist/src/helpers/style.helpers.js.map +1 -0
  254. package/dist/src/index.d.ts +4 -0
  255. package/dist/src/index.js +5 -0
  256. package/dist/src/index.js.map +1 -0
  257. package/dist/src/interfaces/actionable.interface.d.ts +5 -0
  258. package/dist/src/interfaces/actionable.interface.js +2 -0
  259. package/dist/src/interfaces/actionable.interface.js.map +1 -0
  260. package/dist/src/interfaces/atomic.interface.d.ts +6 -0
  261. package/dist/src/interfaces/atomic.interface.js +2 -0
  262. package/dist/src/interfaces/atomic.interface.js.map +1 -0
  263. package/{src/interfaces/changeable.interface.ts → dist/src/interfaces/changeable.interface.d.ts} +7 -14
  264. package/dist/src/interfaces/changeable.interface.js +2 -0
  265. package/dist/src/interfaces/changeable.interface.js.map +1 -0
  266. package/{src/interfaces/child-support-atomic.interface.ts → dist/src/interfaces/child-support-atomic.interface.d.ts} +4 -5
  267. package/dist/src/interfaces/child-support-atomic.interface.js +2 -0
  268. package/dist/src/interfaces/child-support-atomic.interface.js.map +1 -0
  269. package/dist/src/interfaces/index.js +7 -0
  270. package/dist/src/interfaces/index.js.map +1 -0
  271. package/dist/src/interfaces/intractable.interface.d.ts +6 -0
  272. package/dist/src/interfaces/intractable.interface.js +2 -0
  273. package/dist/src/interfaces/intractable.interface.js.map +1 -0
  274. package/{src/interfaces/variant.interface.ts → dist/src/interfaces/variant.interface.d.ts} +1 -1
  275. package/dist/src/interfaces/variant.interface.js +2 -0
  276. package/dist/src/interfaces/variant.interface.js.map +1 -0
  277. package/dist/src/lib/index.js +2 -0
  278. package/dist/src/lib/index.js.map +1 -0
  279. package/dist/src/lib/next/next.lib.js +2 -0
  280. package/dist/src/lib/next/next.lib.js.map +1 -0
  281. package/dist/src/lib/react/react.lib.d.ts +5 -0
  282. package/{src/lib/react/react.lib.ts → dist/src/lib/react/react.lib.js} +7 -9
  283. package/dist/src/lib/react/react.lib.js.map +1 -0
  284. package/dist/src/lib/tw-styles.d.ts +1 -0
  285. package/{src/lib/tw-styles.ts → dist/src/lib/tw-styles.js} +4 -5
  286. package/dist/src/lib/tw-styles.js.map +1 -0
  287. package/dist/src/styles/index.js +2 -0
  288. package/dist/src/styles/index.js.map +1 -0
  289. package/dist/src/styles/tw.styles.d.ts +1 -0
  290. package/{src/styles/tw.styles.ts → dist/src/styles/tw.styles.js} +4 -5
  291. package/dist/src/styles/tw.styles.js.map +1 -0
  292. package/dist/src/wc-ui-app.d.ts +6 -0
  293. package/{src/wc-ui-app.ts → dist/src/wc-ui-app.js} +42 -35
  294. package/dist/src/wc-ui-app.js.map +1 -0
  295. package/dist/test/wc-ui-app.test.js +18 -0
  296. package/dist/test/wc-ui-app.test.js.map +1 -0
  297. package/dist/tsconfig.tsbuildinfo +1 -0
  298. package/dist/vite.config.d.ts +2 -0
  299. package/dist/vite.config.js +29 -0
  300. package/dist/vite.config.js.map +1 -0
  301. package/package.json +14 -21
  302. package/.editorconfig +0 -29
  303. package/.eslintrc +0 -10
  304. package/.github/workflows/deploy-storybook.yml +0 -107
  305. package/.storybook/main.ts +0 -17
  306. package/.storybook/preview-head.html +0 -1
  307. package/.storybook/preview.ts +0 -17
  308. package/assets/fonts/Geist/Geist-Black.otf +0 -0
  309. package/assets/fonts/Geist/Geist-Black.woff2 +0 -0
  310. package/assets/fonts/Geist/Geist-Bold.otf +0 -0
  311. package/assets/fonts/Geist/Geist-Bold.woff2 +0 -0
  312. package/assets/fonts/Geist/Geist-Light.otf +0 -0
  313. package/assets/fonts/Geist/Geist-Light.woff2 +0 -0
  314. package/assets/fonts/Geist/Geist-Medium.otf +0 -0
  315. package/assets/fonts/Geist/Geist-Medium.woff2 +0 -0
  316. package/assets/fonts/Geist/Geist-Regular.otf +0 -0
  317. package/assets/fonts/Geist/Geist-Regular.woff2 +0 -0
  318. package/assets/fonts/Geist/Geist-SemiBold.otf +0 -0
  319. package/assets/fonts/Geist/Geist-SemiBold.woff2 +0 -0
  320. package/assets/fonts/Geist/Geist-Thin.otf +0 -0
  321. package/assets/fonts/Geist/Geist-Thin.woff2 +0 -0
  322. package/assets/fonts/Geist/Geist-UltraBlack.otf +0 -0
  323. package/assets/fonts/Geist/Geist-UltraBlack.woff2 +0 -0
  324. package/assets/fonts/Geist/Geist-UltraLight.otf +0 -0
  325. package/assets/fonts/Geist/Geist-UltraLight.woff2 +0 -0
  326. package/assets/fonts/Geist/GeistVariableVF.ttf +0 -0
  327. package/assets/fonts/Geist/GeistVariableVF.woff2 +0 -0
  328. package/assets/fonts/Geist/LICENSE.TXT +0 -92
  329. package/assets/open-wc-logo.svg +0 -29
  330. package/assume_role.sh +0 -18
  331. package/dist/f28fd4b1.js +0 -1
  332. package/dist/index.ts +0 -1
  333. package/dist/sw.js +0 -2
  334. package/dist/sw.js.map +0 -1
  335. package/dist/workbox-a523fd56.js +0 -2
  336. package/dist/workbox-a523fd56.js.map +0 -1
  337. package/index.html +0 -314
  338. package/rollup.config.js +0 -83
  339. package/src/components/atoms/alert/alert-description.ts +0 -15
  340. package/src/components/atoms/alert/alert-title.ts +0 -17
  341. package/src/components/atoms/alert/alert.stories.ts +0 -71
  342. package/src/components/atoms/alert/alert.styles.ts +0 -21
  343. package/src/components/atoms/badge/badge.atom.ts +0 -40
  344. package/src/components/atoms/badge/badge.stories.ts +0 -118
  345. package/src/components/atoms/badge/badge.style.ts +0 -24
  346. package/src/components/atoms/badge/badge.type.ts +0 -7
  347. package/src/components/atoms/button/button.atom.ts +0 -59
  348. package/src/components/atoms/button/button.stories.ts +0 -224
  349. package/src/components/atoms/button/button.style.ts +0 -31
  350. package/src/components/atoms/card/card-content.ts +0 -15
  351. package/src/components/atoms/card/card-description.ts +0 -15
  352. package/src/components/atoms/card/card-footer.ts +0 -15
  353. package/src/components/atoms/card/card-header.ts +0 -15
  354. package/src/components/atoms/card/card-title.ts +0 -15
  355. package/src/components/atoms/checkbox/checkbox.atom.ts +0 -76
  356. package/src/components/atoms/checkbox/checkbox.stories.ts +0 -309
  357. package/src/components/atoms/checkbox/checkbox.style.ts +0 -5
  358. package/src/components/atoms/checkbox/checkbox.type.ts +0 -24
  359. package/src/components/atoms/combo-box/combo-box-input.ts +0 -33
  360. package/src/components/atoms/combo-box/combo-box.atom.ts +0 -187
  361. package/src/components/atoms/combo-box/combo-box.stories.ts +0 -95
  362. package/src/components/atoms/command-empty/command-empty.atom.ts +0 -44
  363. package/src/components/atoms/command-group/command-group.atom.ts +0 -60
  364. package/src/components/atoms/command-item/command-item.atom.ts +0 -74
  365. package/src/components/atoms/command-list/command-list.atom.ts +0 -37
  366. package/src/components/atoms/command-separator/command-separator.atom.ts +0 -42
  367. package/src/components/atoms/dialog/dialog-close.ts +0 -50
  368. package/src/components/atoms/dialog/dialog-content.ts +0 -71
  369. package/src/components/atoms/dialog/dialog-footer.ts +0 -22
  370. package/src/components/atoms/dialog/dialog-header.ts +0 -36
  371. package/src/components/atoms/dialog/dialog-overly.ts +0 -20
  372. package/src/components/atoms/dialog/dialog-trigger.ts +0 -54
  373. package/src/components/atoms/dialog/dialog.atom.ts +0 -78
  374. package/src/components/atoms/dropdownMenu/dropdown-menu-checkbox-Item.ts +0 -106
  375. package/src/components/atoms/dropdownMenu/dropdown-menu-content.ts +0 -79
  376. package/src/components/atoms/dropdownMenu/dropdown-menu-group.ts +0 -60
  377. package/src/components/atoms/dropdownMenu/dropdown-menu-item.ts +0 -74
  378. package/src/components/atoms/dropdownMenu/dropdown-menu-radio-item.ts +0 -107
  379. package/src/components/atoms/dropdownMenu/dropdown-menu-seperator.ts +0 -44
  380. package/src/components/atoms/dropdownMenu/dropdown-menu-shortcut.ts +0 -17
  381. package/src/components/atoms/dropdownMenu/dropdown-menu.atom.ts +0 -84
  382. package/src/components/atoms/dropdownMenu/dropdownMenu.style.ts +0 -7
  383. package/src/components/atoms/input/input.atom.ts +0 -88
  384. package/src/components/atoms/input/input.stories.ts +0 -451
  385. package/src/components/atoms/input/input.styles.ts +0 -2
  386. package/src/components/atoms/input/input.type.ts +0 -58
  387. package/src/components/atoms/label/label.atom.ts +0 -64
  388. package/src/components/atoms/label/label.stories.ts +0 -102
  389. package/src/components/atoms/label/label.style.ts +0 -5
  390. package/src/components/atoms/popover/popover-content.ts +0 -58
  391. package/src/components/atoms/popover/popover-trigger.ts +0 -50
  392. package/src/components/atoms/popover/popover.atom.ts +0 -34
  393. package/src/components/atoms/popover/popover.stories.ts +0 -79
  394. package/src/components/atoms/popover/popover.style.ts +0 -25
  395. package/src/components/atoms/toggle/defs.ts +0 -29
  396. package/src/components/atoms/toggle/toggle.atom.ts +0 -58
  397. package/src/components/atoms/toggle/toggle.stories.ts +0 -204
  398. package/src/components/atoms/toggle/toggle.style.ts +0 -22
  399. package/src/components/command/command.ts +0 -391
  400. package/src/components/molecules/command/command.molecules.ts +0 -31
  401. package/src/components/molecules/command-input/command-input.atom.ts +0 -130
  402. package/src/globals.css +0 -2215
  403. package/src/helpers/base-element.ts +0 -79
  404. package/src/helpers/mouse-conroller.helper.ts +0 -42
  405. package/src/helpers/style.helpers.ts +0 -6
  406. package/src/index.d.ts +0 -1
  407. package/src/index.ts +0 -1
  408. package/src/interfaces/actionable.interface.ts +0 -6
  409. package/src/interfaces/atomic.interface.ts +0 -6
  410. package/src/interfaces/intractable.interface.ts +0 -6
  411. package/src/tailwind-lib.css +0 -115
  412. package/tailwind.config.js +0 -217
  413. package/test/wc-ui-app.test.ts +0 -22
  414. package/tsconfig.json +0 -30
  415. package/web-dev-server.config.mjs +0 -26
  416. package/web-test-runner.config.mjs +0 -41
  417. /package/{src/assets/icons/index.ts → dist/src/assets/icons/index.d.ts} +0 -0
  418. /package/{src/components/atoms/alert/alert.types.ts → dist/src/components/atoms/alert/alert.types.d.ts} +0 -0
  419. /package/{src/components/atoms/index.ts → dist/src/components/atoms/index.d.ts} +0 -0
  420. /package/{src/components/index.ts → dist/src/components/index.d.ts} +0 -0
  421. /package/{src/chai-custom.d.ts → dist/src/components/molecules/dropdownMenu/dropdownMenu.molecules.d.ts} +0 -0
  422. /package/{src/components/molecules/index.ts → dist/src/components/molecules/index.d.ts} +0 -0
  423. /package/{src/helpers/index.ts → dist/src/helpers/index.d.ts} +0 -0
  424. /package/{src/interfaces/index.ts → dist/src/interfaces/index.d.ts} +0 -0
  425. /package/{src/components/molecules/dropdownMenu/dropdownMenu.molecules.ts → dist/src/lib/index.d.ts} +0 -0
  426. /package/{src/lib/index.ts → dist/src/lib/next/next.lib.d.ts} +0 -0
  427. /package/{src/styles/index.ts → dist/src/styles/index.d.ts} +0 -0
  428. /package/{src/lib/next/next.lib.ts → dist/test/wc-ui-app.test.d.ts} +0 -0
@@ -0,0 +1,93 @@
1
+ import { __decorate } from "tslib";
2
+ /* eslint-disable lit/no-value-attribute */
3
+ import { html, css } from 'lit';
4
+ import { property, customElement } from 'lit/decorators.js';
5
+ import { cn } from '../../../helpers';
6
+ import { TWStyles } from '../../../styles';
7
+ import { inputStyles } from './input.styles';
8
+ import { BaseElement } from '../../../helpers';
9
+ import { spread } from '@open-wc/lit-helpers';
10
+ let Input = class Input extends BaseElement {
11
+ constructor() {
12
+ super();
13
+ this.disabled = false;
14
+ this.type = 'text';
15
+ this.placeholder = '';
16
+ this.defaultValue = '';
17
+ // Make value a reactive property
18
+ this.value = '';
19
+ this.attachShadow({ mode: 'open' });
20
+ // Initialize value with defaultValue if provided
21
+ this.value = this.value || this.defaultValue;
22
+ }
23
+ firstUpdated(_changedProperties) {
24
+ const variables = ['--input-border-radius', '--input-padding'];
25
+ this.applyCustomClass(variables, 'input', 'input-base');
26
+ // Reflect the initial value (if defaultValue was provided)
27
+ if (this.type !== 'file' && this.defaultValue) {
28
+ this.value = this.defaultValue;
29
+ }
30
+ }
31
+ handleInputChange(event) {
32
+ const inputElement = event.target;
33
+ if (inputElement.type === 'file') {
34
+ // Handle file input separately
35
+ this.value = inputElement.files ? inputElement.files[0].name : '';
36
+ }
37
+ else {
38
+ this.value = inputElement.value;
39
+ }
40
+ }
41
+ getAttributesToExclude() {
42
+ return ['disabled', 'type', 'placeholder', 'value', 'data-testid'];
43
+ }
44
+ render() {
45
+ const attributes = this.getFilteredAttributes();
46
+ console.log('attributes', this.className);
47
+ return html `
48
+ <input
49
+ type="${this.type}"
50
+ placeholder="${this.placeholder}"
51
+ ?disabled=${this.disabled}
52
+ class="${cn(inputStyles, this.className)}"
53
+ .value=${this.type !== 'file' ? this.value : ''}
54
+ @change="${this.handleInputChange}"
55
+ ${spread(attributes)}
56
+ />
57
+ `;
58
+ }
59
+ };
60
+ Input.styles = [
61
+ css `
62
+ :root {
63
+ --input-border-radius: inherit;
64
+ --input-padding: inherit;
65
+ }
66
+ .input-base {
67
+ border-radius: var(--input-border-radius) !important;
68
+ padding-top: var(--input-padding) !important;
69
+ padding-bottom: var(--input-padding) !important;
70
+ }
71
+ `,
72
+ TWStyles,
73
+ ];
74
+ __decorate([
75
+ property({ type: Boolean })
76
+ ], Input.prototype, "disabled", void 0);
77
+ __decorate([
78
+ property({ type: String })
79
+ ], Input.prototype, "type", void 0);
80
+ __decorate([
81
+ property({ type: String })
82
+ ], Input.prototype, "placeholder", void 0);
83
+ __decorate([
84
+ property({ type: String })
85
+ ], Input.prototype, "defaultValue", void 0);
86
+ __decorate([
87
+ property({ type: String })
88
+ ], Input.prototype, "value", void 0);
89
+ Input = __decorate([
90
+ customElement('rtg-input')
91
+ ], Input);
92
+ export { Input };
93
+ //# sourceMappingURL=input.atom.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"input.atom.js","sourceRoot":"","sources":["../../../../../src/components/atoms/input/input.atom.ts"],"names":[],"mappings":";AAAA,2CAA2C;AAC3C,OAAO,EAAc,IAAI,EAAE,GAAG,EAAkB,MAAM,KAAK,CAAC;AAC5D,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAC;AACtC,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAE3C,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAGvC,IAAM,KAAK,GAAX,MAAM,KAAM,SAAQ,WAAW;IACpC;QACE,KAAK,EAAE,CAAC;QAOmB,aAAQ,GAAG,KAAK,CAAC;QAElB,SAAI,GAAc,MAAM,CAAC;QAEzB,gBAAW,GAAG,EAAE,CAAC;QAEjB,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QAC1C,OAAO,IAAI,CAAA;;gBAEC,IAAI,CAAC,IAAI;uBACF,IAAI,CAAC,WAAW;oBACnB,IAAI,CAAC,QAAQ;iBAChB,EAAE,CAAC,WAAW,EAAE,IAAI,CAAC,SAAS,CAAC;iBAC/B,IAAI,CAAC,IAAI,KAAK,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE;mBACpC,IAAI,CAAC,iBAAiB;UAC/B,MAAM,CAAC,UAAU,CAAC;;KAEvB,CAAC;IACJ,CAAC;;AAvDM,YAAM,GAAG;IACd,GAAG,CAAA;;;;;;;;;;KAUF;IACD,QAAQ;CACT,AAbY,CAaX;AAxB2B;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;uCAAkB;AAElB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;mCAA0B;AAEzB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;0CAAkB;AAEjB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;2CAAmB;AAGlB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;oCAAY;AAlB5B,KAAK;IADjB,aAAa,CAAC,WAAW,CAAC;GACd,KAAK,CA4EjB","sourcesContent":["/* eslint-disable lit/no-value-attribute */\nimport { LitElement, html, css, PropertyValues } from 'lit';\nimport { property, customElement } from 'lit/decorators.js';\nimport { cn } from '../../../helpers';\nimport { TWStyles } from '../../../styles';\nimport { InputType } from './input.type';\nimport { inputStyles } from './input.styles';\nimport { BaseElement } from '../../../helpers';\nimport { spread } from '@open-wc/lit-helpers';\n\n@customElement('rtg-input')\nexport class Input extends BaseElement {\n constructor() {\n super();\n this.attachShadow({ mode: 'open' });\n\n // Initialize value with defaultValue if provided\n this.value = this.value || this.defaultValue;\n }\n\n @property({ type: Boolean }) disabled = false;\n\n @property({ type: String }) type: InputType = 'text';\n\n @property({ type: String }) placeholder = '';\n\n @property({ type: String }) defaultValue = '';\n\n // Make value a reactive property\n @property({ type: String }) value = '';\n\n static styles = [\n css`\n :root {\n --input-border-radius: inherit;\n --input-padding: inherit;\n }\n .input-base {\n border-radius: var(--input-border-radius) !important;\n padding-top: var(--input-padding) !important;\n padding-bottom: var(--input-padding) !important;\n }\n `,\n TWStyles,\n ];\n\n protected firstUpdated(_changedProperties: PropertyValues): void {\n const variables = ['--input-border-radius', '--input-padding'];\n\n this.applyCustomClass(variables, 'input', 'input-base');\n\n // Reflect the initial value (if defaultValue was provided)\n if (this.type !== 'file' && this.defaultValue) {\n this.value = this.defaultValue;\n }\n }\n\n handleInputChange(event: Event) {\n const inputElement = event.target as HTMLInputElement;\n\n if (inputElement.type === 'file') {\n // Handle file input separately\n this.value = inputElement.files ? inputElement.files[0].name : '';\n } else {\n this.value = inputElement.value;\n }\n }\n\n protected getAttributesToExclude(): string[] {\n return ['disabled', 'type', 'placeholder', 'value', 'data-testid'];\n }\n\n render() {\n const attributes = this.getFilteredAttributes();\n console.log('attributes', this.className);\n return html`\n <input\n type=\"${this.type}\"\n placeholder=\"${this.placeholder}\"\n ?disabled=${this.disabled}\n class=\"${cn(inputStyles, this.className)}\"\n .value=${this.type !== 'file' ? this.value : ''}\n @change=\"${this.handleInputChange}\"\n ${spread(attributes)}\n />\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'rtg-input': Input;\n }\n}\n"]}
@@ -0,0 +1,8 @@
1
+ import { Meta, StoryFn } from '@storybook/web-components';
2
+ import './input.atom';
3
+ import '../label/label.atom';
4
+ import '../button/button.atom';
5
+ declare const _default: Meta;
6
+ export default _default;
7
+ export declare const Input: StoryFn;
8
+ export declare const SpecificInput: StoryFn;
@@ -0,0 +1,382 @@
1
+ import { html } from 'lit';
2
+ import './input.atom';
3
+ import '../label/label.atom';
4
+ import '../button/button.atom';
5
+ import { expect, within, waitFor, fn, userEvent } from '@storybook/test';
6
+ const validInputTypes = [
7
+ 'hidden',
8
+ 'text',
9
+ 'search',
10
+ 'tel',
11
+ 'url',
12
+ 'email',
13
+ 'password',
14
+ ];
15
+ const validInputSpeceficTypes = [
16
+ 'hidden',
17
+ 'date',
18
+ 'month',
19
+ 'week',
20
+ 'time',
21
+ 'datetime-local',
22
+ 'number',
23
+ 'range',
24
+ 'color',
25
+ 'file',
26
+ ];
27
+ export default {
28
+ component: 'components/input',
29
+ tags: ['autodocs'],
30
+ };
31
+ const testInputBehavior = async (args, canvasElement, mockHandler) => {
32
+ const canvas = within(canvasElement);
33
+ const input = await waitFor(() => canvas.getByTestId('input-id'));
34
+ if (input.shadowRoot) {
35
+ const innerInput = input.shadowRoot.querySelector('[data-testchild="children-id"]');
36
+ if (args.type !== 'file') {
37
+ if (innerInput instanceof HTMLInputElement) {
38
+ innerInput.value = args.defaultValue;
39
+ }
40
+ expect(innerInput).toHaveAttribute('placeholder', args.placeholder);
41
+ }
42
+ // 1. Test: Input should have the correct `disabled` state based on args
43
+ if (args.disabled) {
44
+ expect(innerInput).toBeDisabled();
45
+ }
46
+ else {
47
+ expect(innerInput).not.toBeDisabled();
48
+ }
49
+ // 2. Test: `type` should be a valid InputType
50
+ expect(validInputTypes).toContain(args.type);
51
+ // 3. Test: Input should have correct type attribute
52
+ expect(innerInput).toHaveAttribute('type', args.type);
53
+ // 4. Test: Label should have correct `for` attribute linking to the input
54
+ if (args.label) {
55
+ const label = await waitFor(() => canvas.getByTestId('label-id'));
56
+ expect(label).toBeInTheDocument();
57
+ }
58
+ // 5. Button should handle click events when not disabled
59
+ if (args.ButtonLabel) {
60
+ const button = await waitFor(() => canvas.getByTestId('button-id'));
61
+ expect(button).toBeInTheDocument();
62
+ const innerButton = button.querySelector('[data-testid="children-id"]');
63
+ if (!args.disabledButton && innerButton) {
64
+ await userEvent.click(innerButton);
65
+ if (mockHandler) {
66
+ expect(mockHandler).toHaveBeenCalled();
67
+ }
68
+ }
69
+ }
70
+ // 6. Test: Button should not handle click events when disabled
71
+ if (args.disabledButton) {
72
+ expect(mockHandler).not.toHaveBeenCalled();
73
+ }
74
+ }
75
+ };
76
+ const testInputSpecificBehavior = async (args, canvasElement, mockHandler) => {
77
+ const canvas = within(canvasElement);
78
+ const input = await waitFor(() => canvas.getByTestId('input-id'));
79
+ if (input.shadowRoot) {
80
+ const innerInput = input.shadowRoot.querySelector('[data-testchild="children-id"]');
81
+ // 1. Test: Input should have the correct `disabled` state based on args
82
+ if (args.disabled) {
83
+ expect(innerInput).toBeDisabled();
84
+ }
85
+ else {
86
+ expect(innerInput).not.toBeDisabled();
87
+ }
88
+ // 2. Test: `type` should be a valid InputType
89
+ expect(validInputSpeceficTypes).toContain(args.type);
90
+ // 3. Test: Input should have correct type attribute
91
+ expect(innerInput).toHaveAttribute('type', args.type);
92
+ // 4. Test: Label should have correct `for` attribute linking to the input
93
+ if (args.label) {
94
+ const label = await waitFor(() => canvas.getByTestId('label-id'));
95
+ expect(label).toBeInTheDocument();
96
+ }
97
+ // 5. Button should handle click events when not disabled
98
+ if (args.ButtonLabel) {
99
+ const button = await waitFor(() => canvas.getByTestId('button-id'));
100
+ expect(button).toBeInTheDocument();
101
+ const innerButton = button.querySelector('[data-testid="children-id"]');
102
+ if (!args.disabledButton && innerButton) {
103
+ await userEvent.click(innerButton);
104
+ if (mockHandler) {
105
+ expect(mockHandler).toHaveBeenCalled();
106
+ }
107
+ }
108
+ }
109
+ // 6. Test: Button should not handle click events when disabled
110
+ if (args.disabledButton) {
111
+ expect(mockHandler).not.toHaveBeenCalled();
112
+ }
113
+ }
114
+ };
115
+ const mockOnClickHandler = fn(event => {
116
+ alert('Hello!');
117
+ });
118
+ const Template = ({ label, ButtonLabel, id, type, placeholder, disabled, disabledButton, defaultValue, }) => {
119
+ const inputValue = type !== 'file' ? defaultValue : '';
120
+ if (ButtonLabel && !label) {
121
+ return html `
122
+ <div style="display:flex">
123
+ <rtg-input
124
+ data-testid="input-id"
125
+ data-testchild="children-id"
126
+ id=${id}
127
+ type=${type}
128
+ placeholder=${placeholder}
129
+ ?disabled=${disabled}
130
+ .value=${inputValue}
131
+ style="min-width:50%"
132
+ ></rtg-input>
133
+ <rtg-button
134
+ data-testid="button-id"
135
+ style="margin-inline-start:4px"
136
+ size="default"
137
+ ?disabled=${disabledButton}
138
+ .click=${mockOnClickHandler}
139
+ >${ButtonLabel}</rtg-button
140
+ >
141
+ </div>
142
+ `;
143
+ }
144
+ else if (label && !ButtonLabel) {
145
+ return html `
146
+ <div>
147
+ <rtg-label data-testid="label-id" for="picture">${label}</rtg-label>
148
+ <rtg-input
149
+ data-testid="input-id"
150
+ data-testchild="children-id"
151
+ type=${type}
152
+ ?disabled=${disabled}
153
+ placeholder=${placeholder}
154
+ .value=${inputValue}
155
+ style="min-width:50%"
156
+ ></rtg-input>
157
+ </div>
158
+ `;
159
+ }
160
+ else if (label && ButtonLabel) {
161
+ return html `
162
+ <div style="display: flex; flex-direction: column;">
163
+ <rtg-label data-testid="label-id" for="picture">${label}</rtg-label>
164
+ <div style="display:flex">
165
+ <rtg-input
166
+ data-testid="input-id"
167
+ data-testchild="children-id"
168
+ id=${id}
169
+ type=${type}
170
+ placeholder=${placeholder}
171
+ ?disabled=${disabled}
172
+ .value=${inputValue}
173
+ style="min-width:50%"
174
+ ></rtg-input>
175
+ <rtg-button
176
+ data-testid="button-id"
177
+ style="margin-inline-start:4px"
178
+ size="default"
179
+ ?disabled=${disabledButton}
180
+ .click=${mockOnClickHandler}
181
+ >${ButtonLabel}</rtg-button
182
+ >
183
+ </div>
184
+ </div>
185
+ `;
186
+ }
187
+ else {
188
+ return html `
189
+ <rtg-input
190
+ data-testid="input-id"
191
+ data-testchild="children-id"
192
+ type=${type}
193
+ ?disabled=${disabled}
194
+ placeholder=${placeholder}
195
+ .value=${inputValue}
196
+ style="min-width:50%"
197
+ ></rtg-input>
198
+ `;
199
+ }
200
+ };
201
+ const TemplateSpecific = ({ label, ButtonLabel, id, type, value, disabled, disabledButton, }) => {
202
+ if (ButtonLabel && !label) {
203
+ return html `
204
+ <div style="display:flex">
205
+ <rtg-input
206
+ data-testid="input-id"
207
+ data-testchild="children-id"
208
+ id=${id}
209
+ type=${type}
210
+ ?disabled=${disabled}
211
+ .value=${value}
212
+ style="min-width:50%"
213
+ ></rtg-input>
214
+ <rtg-button
215
+ data-testid="button-id"
216
+ style="margin-inline-start:4px"
217
+ size="default"
218
+ ?disabled=${disabledButton}
219
+ .click=${mockOnClickHandler}
220
+ >${ButtonLabel}</rtg-button
221
+ >
222
+ </div>
223
+ `;
224
+ }
225
+ else if (label && !ButtonLabel) {
226
+ return html `
227
+ <div>
228
+ <rtg-label data-testid="label-id" for="picture">${label}</rtg-label>
229
+ <rtg-input
230
+ data-testid="input-id"
231
+ data-testchild="children-id"
232
+ type=${type}
233
+ ?disabled=${disabled}
234
+ .value=${value}
235
+ style="min-width:50%"
236
+ ></rtg-input>
237
+ </div>
238
+ `;
239
+ }
240
+ else if (label && ButtonLabel) {
241
+ return html `
242
+ <div style="display: flex; flex-direction: column;">
243
+ <rtg-label data-testid="label-id" for="picture">${label}</rtg-label>
244
+ <div style="display:flex">
245
+ <rtg-input
246
+ data-testid="input-id"
247
+ data-testchild="children-id"
248
+ id=${id}
249
+ type=${type}
250
+ ?disabled=${disabled}
251
+ .value=${value}
252
+ style="min-width:50%"
253
+ ></rtg-input>
254
+ <rtg-button
255
+ data-testid="button-id"
256
+ style="margin-inline-start:4px"
257
+ size="default"
258
+ ?disabled=${disabledButton}
259
+ .click=${mockOnClickHandler}
260
+ >${ButtonLabel}</rtg-button
261
+ >
262
+ </div>
263
+ </div>
264
+ `;
265
+ }
266
+ else {
267
+ return html `
268
+ <rtg-input
269
+ data-testid="input-id"
270
+ data-testchild="children-id"
271
+ type=${type}
272
+ ?disabled=${disabled}
273
+ .value=${value}
274
+ style="min-width:50%"
275
+ ></rtg-input>
276
+ `;
277
+ }
278
+ };
279
+ export const Input = Template.bind({});
280
+ Input.args = {
281
+ disabled: false,
282
+ type: 'text',
283
+ placeholder: 'Enter text',
284
+ defaultValue: '',
285
+ label: '',
286
+ ButtonLabel: 'Subscribe',
287
+ disabledButton: false,
288
+ id: '',
289
+ };
290
+ Input.parameters = {
291
+ docs: {
292
+ source: {
293
+ transform: (code) => {
294
+ // Handling boolean attributes: if true, render without value, if false, omit the attribute
295
+ const updatedCode = code
296
+ .replace(/disabled=""/g, 'disabled=true')
297
+ .replace(/disabled="false"/g, '');
298
+ return updatedCode;
299
+ },
300
+ },
301
+ },
302
+ };
303
+ Input.argTypes = {
304
+ disabled: {
305
+ control: 'boolean',
306
+ description: 'Determines whether the input is disabled (unclickable).',
307
+ table: {
308
+ defaultValue: { summary: 'false' },
309
+ },
310
+ },
311
+ disabledButton: {
312
+ control: 'boolean',
313
+ description: 'Indicates whether the button should be disabled, preventing user interaction.',
314
+ table: {
315
+ defaultValue: { summary: 'false' },
316
+ },
317
+ },
318
+ type: {
319
+ control: { type: 'select' },
320
+ description: 'Specifies the type of the input, such as text, email, password, etc.',
321
+ options: validInputTypes,
322
+ },
323
+ placeholder: {
324
+ control: 'text',
325
+ description: 'Provides a short hint that describes the expected value of the input.',
326
+ if: { arg: 'type', neq: 'file' },
327
+ },
328
+ defaultValue: {
329
+ control: 'text',
330
+ description: 'Sets the initial value of the input field.',
331
+ if: { arg: 'type', neq: 'file' },
332
+ },
333
+ label: {
334
+ control: 'text',
335
+ description: 'Defines the label text for the input field.',
336
+ },
337
+ ButtonLabel: {
338
+ control: 'text',
339
+ description: 'Defines the label text for the associated button.',
340
+ },
341
+ id: {
342
+ control: 'text',
343
+ description: 'Unique identifier for the input element.',
344
+ },
345
+ };
346
+ Input.play = async ({ args, canvasElement }) => {
347
+ try {
348
+ await testInputBehavior(args, canvasElement, mockOnClickHandler);
349
+ }
350
+ catch (error) {
351
+ console.error('An error occurred during the play function:', error);
352
+ }
353
+ };
354
+ export const SpecificInput = TemplateSpecific.bind({});
355
+ SpecificInput.args = {
356
+ disabled: false,
357
+ type: 'file',
358
+ label: '',
359
+ ButtonLabel: 'Subscribe',
360
+ disabledButton: false,
361
+ id: '',
362
+ };
363
+ SpecificInput.argTypes = {
364
+ disabled: { control: 'boolean' },
365
+ disabledButton: { control: 'boolean' },
366
+ type: {
367
+ control: { type: 'select' },
368
+ options: validInputSpeceficTypes,
369
+ },
370
+ label: { control: 'text' },
371
+ ButtonLabel: { control: 'text' },
372
+ id: { control: 'text' },
373
+ };
374
+ SpecificInput.play = async ({ args, canvasElement }) => {
375
+ try {
376
+ await testInputSpecificBehavior(args, canvasElement, mockOnClickHandler);
377
+ }
378
+ catch (error) {
379
+ console.error('An error occurred during the play function:', error);
380
+ }
381
+ };
382
+ //# sourceMappingURL=input.stories.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"input.stories.js","sourceRoot":"","sources":["../../../../../src/components/atoms/input/input.stories.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAE3B,OAAO,cAAc,CAAC;AACtB,OAAO,qBAAqB,CAAC;AAC7B,OAAO,uBAAuB,CAAC;AAO/B,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,EAAE,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAEzE,MAAM,eAAe,GAAsB;IACzC,QAAQ;IACR,MAAM;IACN,QAAQ;IACR,KAAK;IACL,KAAK;IACL,OAAO;IACP,UAAU;CACX,CAAC;AAEF,MAAM,uBAAuB,GAAwB;IACnD,QAAQ;IACR,MAAM;IACN,OAAO;IACP,MAAM;IACN,MAAM;IACN,gBAAgB;IAChB,QAAQ;IACR,OAAO;IACP,OAAO;IACP,MAAM;CACP,CAAC;AAEF,eAAe;IACb,SAAS,EAAE,kBAAkB;IAC7B,IAAI,EAAE,CAAC,UAAU,CAAC;CACX,CAAC;AAEV,MAAM,iBAAiB,GAAG,KAAK,EAC7B,IAAe,EACf,aAA0B,EAC1B,WAAgB,EAChB,EAAE;IACF,MAAM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C,CAAC;AAEF,MAAM,CAAC,MAAM,aAAa,GAAG,gBAAgB,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AAEvD,aAAa,CAAC,IAAI,GAAG;IACnB,QAAQ,EAAE,KAAK;IACf,IAAI,EAAE,MAAM;IACZ,KAAK,EAAE,EAAE;IACT,WAAW,EAAE,WAAW;IACxB,cAAc,EAAE,KAAK;IACrB,EAAE,EAAE,EAAE;CACP,CAAC;AAEF,aAAa,CAAC,QAAQ,GAAG;IACvB,QAAQ,EAAE,EAAE,OAAO,EAAE,SAAS,EAAE;IAChC,cAAc,EAAE,EAAE,OAAO,EAAE,SAAS,EAAE;IACtC,IAAI,EAAE;QACJ,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;QAC3B,OAAO,EAAE,uBAAuB;KACjC;IACD,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE;IAC1B,WAAW,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE;IAChC,EAAE,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE;CACxB,CAAC;AAEF,aAAa,CAAC,IAAI,GAAG,KAAK,EAAE,EAAE,IAAI,EAAE,aAAa,EAAE,EAAE,EAAE;IACrD,IAAI,CAAC;QACH,MAAM,yBAAyB,CAC7B,IAAyB,EACzB,aAAa,EACb,kBAAkB,CACnB,CAAC;IACJ,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,KAAK,CAAC,6CAA6C,EAAE,KAAK,CAAC,CAAC;IACtE,CAAC;AACH,CAAC,CAAC","sourcesContent":["import { html } from 'lit';\nimport { Meta, StoryFn } from '@storybook/web-components';\nimport './input.atom';\nimport '../label/label.atom';\nimport '../button/button.atom';\nimport {\n InputNormalType,\n InputArgs,\n InputSpecificType,\n InputSpecificArgs,\n} from './input.type';\nimport { expect, within, waitFor, fn, userEvent } from '@storybook/test';\n\nconst validInputTypes: InputNormalType[] = [\n 'hidden',\n 'text',\n 'search',\n 'tel',\n 'url',\n 'email',\n 'password',\n];\n\nconst validInputSpeceficTypes: InputSpecificType[] = [\n 'hidden',\n 'date',\n 'month',\n 'week',\n 'time',\n 'datetime-local',\n 'number',\n 'range',\n 'color',\n 'file',\n];\n\nexport default {\n component: 'components/input',\n tags: ['autodocs'],\n} as Meta;\n\nconst testInputBehavior = async (\n args: InputArgs,\n canvasElement: HTMLElement,\n mockHandler: any\n) => {\n const canvas = within(canvasElement);\n const input = await waitFor(() => canvas.getByTestId('input-id'));\n\n if (input.shadowRoot) {\n const innerInput = input.shadowRoot.querySelector(\n '[data-testchild=\"children-id\"]'\n );\n\n if (args.type !== 'file') {\n if (innerInput instanceof HTMLInputElement) {\n innerInput.value = args.defaultValue;\n }\n expect(innerInput).toHaveAttribute('placeholder', args.placeholder);\n }\n\n // 1. Test: Input should have the correct `disabled` state based on args\n if (args.disabled) {\n expect(innerInput).toBeDisabled();\n } else {\n expect(innerInput).not.toBeDisabled();\n }\n\n // 2. Test: `type` should be a valid InputType\n expect(validInputTypes).toContain(args.type);\n\n // 3. Test: Input should have correct type attribute\n expect(innerInput).toHaveAttribute('type', args.type);\n\n // 4. Test: Label should have correct `for` attribute linking to the input\n if (args.label) {\n const label = await waitFor(() => canvas.getByTestId('label-id'));\n expect(label).toBeInTheDocument();\n }\n\n // 5. Button should handle click events when not disabled\n if (args.ButtonLabel) {\n const button = await waitFor(() => canvas.getByTestId('button-id'));\n expect(button).toBeInTheDocument();\n const innerButton = button.querySelector('[data-testid=\"children-id\"]');\n if (!args.disabledButton && innerButton) {\n await userEvent.click(innerButton);\n if (mockHandler) {\n expect(mockHandler).toHaveBeenCalled();\n }\n }\n }\n\n // 6. Test: Button should not handle click events when disabled\n if (args.disabledButton) {\n expect(mockHandler).not.toHaveBeenCalled();\n }\n }\n};\n\nconst testInputSpecificBehavior = async (\n args: InputSpecificArgs,\n canvasElement: HTMLElement,\n mockHandler: any\n) => {\n const canvas = within(canvasElement);\n const input = await waitFor(() => canvas.getByTestId('input-id'));\n\n if (input.shadowRoot) {\n const innerInput = input.shadowRoot.querySelector(\n '[data-testchild=\"children-id\"]'\n );\n\n // 1. Test: Input should have the correct `disabled` state based on args\n if (args.disabled) {\n expect(innerInput).toBeDisabled();\n } else {\n expect(innerInput).not.toBeDisabled();\n }\n\n // 2. Test: `type` should be a valid InputType\n expect(validInputSpeceficTypes).toContain(args.type);\n\n // 3. Test: Input should have correct type attribute\n expect(innerInput).toHaveAttribute('type', args.type);\n\n // 4. Test: Label should have correct `for` attribute linking to the input\n if (args.label) {\n const label = await waitFor(() => canvas.getByTestId('label-id'));\n expect(label).toBeInTheDocument();\n }\n\n // 5. Button should handle click events when not disabled\n if (args.ButtonLabel) {\n const button = await waitFor(() => canvas.getByTestId('button-id'));\n expect(button).toBeInTheDocument();\n const innerButton = button.querySelector('[data-testid=\"children-id\"]');\n if (!args.disabledButton && innerButton) {\n await userEvent.click(innerButton);\n if (mockHandler) {\n expect(mockHandler).toHaveBeenCalled();\n }\n }\n }\n\n // 6. Test: Button should not handle click events when disabled\n if (args.disabledButton) {\n expect(mockHandler).not.toHaveBeenCalled();\n }\n }\n};\n\nconst mockOnClickHandler = fn(event => {\n alert('Hello!');\n});\n\nconst Template: StoryFn = ({\n label,\n ButtonLabel,\n id,\n type,\n placeholder,\n disabled,\n disabledButton,\n defaultValue,\n}) => {\n const inputValue = type !== 'file' ? defaultValue : '';\n if (ButtonLabel && !label) {\n return html`\n <div style=\"display:flex\">\n <rtg-input\n data-testid=\"input-id\"\n data-testchild=\"children-id\"\n id=${id}\n type=${type}\n placeholder=${placeholder}\n ?disabled=${disabled}\n .value=${inputValue}\n style=\"min-width:50%\"\n ></rtg-input>\n <rtg-button\n data-testid=\"button-id\"\n style=\"margin-inline-start:4px\"\n size=\"default\"\n ?disabled=${disabledButton}\n .click=${mockOnClickHandler}\n >${ButtonLabel}</rtg-button\n >\n </div>\n `;\n } else if (label && !ButtonLabel) {\n return html`\n <div>\n <rtg-label data-testid=\"label-id\" for=\"picture\">${label}</rtg-label>\n <rtg-input\n data-testid=\"input-id\"\n data-testchild=\"children-id\"\n type=${type}\n ?disabled=${disabled}\n placeholder=${placeholder}\n .value=${inputValue}\n style=\"min-width:50%\"\n ></rtg-input>\n </div>\n `;\n } else if (label && ButtonLabel) {\n return html`\n <div style=\"display: flex; flex-direction: column;\">\n <rtg-label data-testid=\"label-id\" for=\"picture\">${label}</rtg-label>\n <div style=\"display:flex\">\n <rtg-input\n data-testid=\"input-id\"\n data-testchild=\"children-id\"\n id=${id}\n type=${type}\n placeholder=${placeholder}\n ?disabled=${disabled}\n .value=${inputValue}\n style=\"min-width:50%\"\n ></rtg-input>\n <rtg-button\n data-testid=\"button-id\"\n style=\"margin-inline-start:4px\"\n size=\"default\"\n ?disabled=${disabledButton}\n .click=${mockOnClickHandler}\n >${ButtonLabel}</rtg-button\n >\n </div>\n </div>\n `;\n } else {\n return html`\n <rtg-input\n data-testid=\"input-id\"\n data-testchild=\"children-id\"\n type=${type}\n ?disabled=${disabled}\n placeholder=${placeholder}\n .value=${inputValue}\n style=\"min-width:50%\"\n ></rtg-input>\n `;\n }\n};\n\nconst TemplateSpecific: StoryFn = ({\n label,\n ButtonLabel,\n id,\n type,\n value,\n disabled,\n disabledButton,\n}) => {\n if (ButtonLabel && !label) {\n return html`\n <div style=\"display:flex\">\n <rtg-input\n data-testid=\"input-id\"\n data-testchild=\"children-id\"\n id=${id}\n type=${type}\n ?disabled=${disabled}\n .value=${value}\n style=\"min-width:50%\"\n ></rtg-input>\n <rtg-button\n data-testid=\"button-id\"\n style=\"margin-inline-start:4px\"\n size=\"default\"\n ?disabled=${disabledButton}\n .click=${mockOnClickHandler}\n >${ButtonLabel}</rtg-button\n >\n </div>\n `;\n } else if (label && !ButtonLabel) {\n return html`\n <div>\n <rtg-label data-testid=\"label-id\" for=\"picture\">${label}</rtg-label>\n <rtg-input\n data-testid=\"input-id\"\n data-testchild=\"children-id\"\n type=${type}\n ?disabled=${disabled}\n .value=${value}\n style=\"min-width:50%\"\n ></rtg-input>\n </div>\n `;\n } else if (label && ButtonLabel) {\n return html`\n <div style=\"display: flex; flex-direction: column;\">\n <rtg-label data-testid=\"label-id\" for=\"picture\">${label}</rtg-label>\n <div style=\"display:flex\">\n <rtg-input\n data-testid=\"input-id\"\n data-testchild=\"children-id\"\n id=${id}\n type=${type}\n ?disabled=${disabled}\n .value=${value}\n style=\"min-width:50%\"\n ></rtg-input>\n <rtg-button\n data-testid=\"button-id\"\n style=\"margin-inline-start:4px\"\n size=\"default\"\n ?disabled=${disabledButton}\n .click=${mockOnClickHandler}\n >${ButtonLabel}</rtg-button\n >\n </div>\n </div>\n `;\n } else {\n return html`\n <rtg-input\n data-testid=\"input-id\"\n data-testchild=\"children-id\"\n type=${type}\n ?disabled=${disabled}\n .value=${value}\n style=\"min-width:50%\"\n ></rtg-input>\n `;\n }\n};\n\nexport const Input = Template.bind({});\n\nInput.args = {\n disabled: false,\n type: 'text',\n placeholder: 'Enter text',\n defaultValue: '',\n label: '',\n ButtonLabel: 'Subscribe',\n disabledButton: false,\n id: '',\n};\n\nInput.parameters = {\n docs: {\n source: {\n transform: (code: string) => {\n // Handling boolean attributes: if true, render without value, if false, omit the attribute\n const updatedCode = code\n .replace(/disabled=\"\"/g, 'disabled=true')\n .replace(/disabled=\"false\"/g, '');\n\n return updatedCode;\n },\n },\n },\n};\n\nInput.argTypes = {\n disabled: {\n control: 'boolean',\n description: 'Determines whether the input is disabled (unclickable).',\n table: {\n defaultValue: { summary: 'false' },\n },\n },\n disabledButton: {\n control: 'boolean',\n description:\n 'Indicates whether the button should be disabled, preventing user interaction.',\n table: {\n defaultValue: { summary: 'false' },\n },\n },\n type: {\n control: { type: 'select' },\n description:\n 'Specifies the type of the input, such as text, email, password, etc.',\n options: validInputTypes,\n },\n placeholder: {\n control: 'text',\n description:\n 'Provides a short hint that describes the expected value of the input.',\n if: { arg: 'type', neq: 'file' },\n },\n defaultValue: {\n control: 'text',\n description: 'Sets the initial value of the input field.',\n if: { arg: 'type', neq: 'file' },\n },\n label: {\n control: 'text',\n description: 'Defines the label text for the input field.',\n },\n ButtonLabel: {\n control: 'text',\n description: 'Defines the label text for the associated button.',\n },\n id: {\n control: 'text',\n description: 'Unique identifier for the input element.',\n },\n};\n\nInput.play = async ({ args, canvasElement }) => {\n try {\n await testInputBehavior(\n args as InputArgs,\n canvasElement,\n mockOnClickHandler\n );\n } catch (error) {\n console.error('An error occurred during the play function:', error);\n }\n};\n\nexport const SpecificInput = TemplateSpecific.bind({});\n\nSpecificInput.args = {\n disabled: false,\n type: 'file',\n label: '',\n ButtonLabel: 'Subscribe',\n disabledButton: false,\n id: '',\n};\n\nSpecificInput.argTypes = {\n disabled: { control: 'boolean' },\n disabledButton: { control: 'boolean' },\n type: {\n control: { type: 'select' },\n options: validInputSpeceficTypes,\n },\n label: { control: 'text' },\n ButtonLabel: { control: 'text' },\n id: { control: 'text' },\n};\n\nSpecificInput.play = async ({ args, canvasElement }) => {\n try {\n await testInputSpecificBehavior(\n args as InputSpecificArgs,\n canvasElement,\n mockOnClickHandler\n );\n } catch (error) {\n console.error('An error occurred during the play function:', error);\n }\n};\n"]}
@@ -0,0 +1 @@
1
+ export declare const inputStyles = "flex h-8 w-full rounded-sm border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:opacity-50 input-base";
@@ -0,0 +1,2 @@
1
+ export const inputStyles = 'flex h-8 w-full rounded-sm border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:opacity-50 input-base';
2
+ //# sourceMappingURL=input.styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"input.styles.js","sourceRoot":"","sources":["../../../../../src/components/atoms/input/input.styles.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,WAAW,GACtB,sTAAsT,CAAC","sourcesContent":["export const inputStyles =\n 'flex h-8 w-full rounded-sm border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:opacity-50 input-base';\n"]}
@@ -0,0 +1,21 @@
1
+ export type InputType = 'hidden' | 'text' | 'search' | 'tel' | 'url' | 'email' | 'password' | 'date' | 'month' | 'week' | 'time' | 'datetime-local' | 'number' | 'range' | 'color' | 'file';
2
+ export type InputNormalType = 'hidden' | 'text' | 'search' | 'tel' | 'url' | 'email' | 'password';
3
+ export type InputSpecificType = 'hidden' | 'date' | 'month' | 'week' | 'time' | 'datetime-local' | 'number' | 'range' | 'color' | 'file';
4
+ export type InputArgs = {
5
+ disabled: boolean;
6
+ disabledButton: boolean;
7
+ type: InputType;
8
+ placeholder: string;
9
+ label: string;
10
+ defaultValue: string;
11
+ ButtonLabel: string;
12
+ id: string;
13
+ };
14
+ export type InputSpecificArgs = {
15
+ disabled: boolean;
16
+ disabledButton: boolean;
17
+ type: InputSpecificType;
18
+ label: string;
19
+ ButtonLabel: string;
20
+ id: string;
21
+ };
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=input.type.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"input.type.js","sourceRoot":"","sources":["../../../../../src/components/atoms/input/input.type.ts"],"names":[],"mappings":"","sourcesContent":["export type InputType =\n | 'hidden'\n | 'text'\n | 'search'\n | 'tel'\n | 'url'\n | 'email'\n | 'password'\n | 'date'\n | 'month'\n | 'week'\n | 'time'\n | 'datetime-local'\n | 'number'\n | 'range'\n | 'color'\n | 'file';\n\nexport type InputNormalType =\n | 'hidden'\n | 'text'\n | 'search'\n | 'tel'\n | 'url'\n | 'email'\n | 'password';\n\nexport type InputSpecificType =\n | 'hidden'\n | 'date'\n | 'month'\n | 'week'\n | 'time'\n | 'datetime-local'\n | 'number'\n | 'range'\n | 'color'\n | 'file';\n\nexport type InputArgs = {\n disabled: boolean;\n disabledButton: boolean;\n type: InputType;\n placeholder: string;\n label: string;\n defaultValue: string;\n ButtonLabel: string;\n id: string;\n};\n\nexport type InputSpecificArgs = {\n disabled: boolean;\n disabledButton: boolean;\n type: InputSpecificType;\n label: string;\n ButtonLabel: string;\n id: string;\n};\n"]}
@@ -0,0 +1,11 @@
1
+ import { PropertyValues } from 'lit';
2
+ import { BaseElement } from '../../../helpers';
3
+ export declare class Label extends BaseElement {
4
+ static labelVariants: (props?: import("class-variance-authority/dist/types").ClassProp | undefined) => string;
5
+ for: string;
6
+ static styles: import("lit").CSSResult[];
7
+ protected firstUpdated(_changedProperties: PropertyValues): void;
8
+ private _onClick;
9
+ protected getAttributesToExclude(): string[];
10
+ render(): import("lit-html").TemplateResult<1>;
11
+ }
@@ -0,0 +1,67 @@
1
+ var Label_1;
2
+ import { __decorate } from "tslib";
3
+ import { html, css } from 'lit';
4
+ import { property, customElement } from 'lit/decorators.js';
5
+ import { BaseElement, cn } from '../../../helpers';
6
+ import { TWStyles } from '../../../styles';
7
+ import { labelStyle } from './label.style';
8
+ import { spread } from '@open-wc/lit-helpers';
9
+ let Label = Label_1 = class Label extends BaseElement {
10
+ constructor() {
11
+ super(...arguments);
12
+ this.for = '';
13
+ }
14
+ firstUpdated(_changedProperties) {
15
+ const variables = ['--label-text-color,--label-padding'];
16
+ this.applyCustomClass(variables, 'label', 'label-base');
17
+ }
18
+ _onClick(e) {
19
+ if (e.defaultPrevented)
20
+ return;
21
+ const target = this.shadowRoot?.getElementById(this.for);
22
+ if (target) {
23
+ target.click();
24
+ }
25
+ }
26
+ getAttributesToExclude() {
27
+ return ['for', 'data-testid'];
28
+ }
29
+ render() {
30
+ const attributes = this.getFilteredAttributes();
31
+ return html `
32
+ <label
33
+ for="${this.for}"
34
+ @click="${this._onClick}"
35
+ @keydown="${this._onClick}"
36
+ class="${cn(Label_1.labelVariants({
37
+ className: this.className,
38
+ }))}"
39
+ ${spread(attributes)}
40
+ >
41
+ <slot></slot>
42
+ </label>
43
+ `;
44
+ }
45
+ };
46
+ Label.labelVariants = labelStyle;
47
+ Label.styles = [
48
+ css `
49
+ :root {
50
+ --label-text-color: inherit;
51
+ --label-padding: inherit;
52
+ }
53
+ .label-base {
54
+ color: var(--label-text-color) !important;
55
+ padding: var(--label-padding) !important;
56
+ }
57
+ `,
58
+ TWStyles,
59
+ ];
60
+ __decorate([
61
+ property({ type: String })
62
+ ], Label.prototype, "for", void 0);
63
+ Label = Label_1 = __decorate([
64
+ customElement('rtg-label')
65
+ ], Label);
66
+ export { Label };
67
+ //# sourceMappingURL=label.atom.js.map