revotech-ui-kit 0.0.0 → 0.0.1-beta-01

Sign up to get free protection for your applications and to get access to all the features.
Files changed (375) 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/dist/src/assets/icons/arrows.icon.js +20 -0
  5. package/dist/src/assets/icons/arrows.icon.js.map +1 -0
  6. package/dist/src/assets/icons/index.d.ts +3 -0
  7. package/dist/src/assets/icons/index.js +4 -0
  8. package/dist/src/assets/icons/index.js.map +1 -0
  9. package/dist/src/assets/icons/search.icon.d.ts +1 -0
  10. package/dist/src/assets/icons/search.icon.js +19 -0
  11. package/dist/src/assets/icons/search.icon.js.map +1 -0
  12. package/dist/src/assets/icons/tick.icon.d.ts +1 -0
  13. package/dist/src/assets/icons/tick.icon.js +20 -0
  14. package/dist/src/assets/icons/tick.icon.js.map +1 -0
  15. package/dist/src/components/atoms/alert/alert-description.d.ts +5 -0
  16. package/dist/src/components/atoms/alert/alert-description.js +18 -0
  17. package/dist/src/components/atoms/alert/alert-description.js.map +1 -0
  18. package/dist/src/components/atoms/alert/alert-title.d.ts +5 -0
  19. package/dist/src/components/atoms/alert/alert-title.js +20 -0
  20. package/dist/src/components/atoms/alert/alert-title.js.map +1 -0
  21. package/dist/src/components/atoms/alert/alert.atom.d.ts +15 -0
  22. package/dist/src/components/atoms/alert/alert.atom.js +55 -0
  23. package/dist/src/components/atoms/alert/alert.atom.js.map +1 -0
  24. package/dist/src/components/atoms/alert/alert.stories.d.ts +6 -0
  25. package/dist/src/components/atoms/alert/alert.stories.js +62 -0
  26. package/dist/src/components/atoms/alert/alert.stories.js.map +1 -0
  27. package/dist/src/components/atoms/alert/alert.styles.d.ts +4 -0
  28. package/dist/src/components/atoms/alert/alert.styles.js +21 -0
  29. package/dist/src/components/atoms/alert/alert.styles.js.map +1 -0
  30. package/dist/src/components/atoms/alert/alert.types.d.ts +1 -0
  31. package/dist/src/components/atoms/alert/alert.types.js +2 -0
  32. package/dist/src/components/atoms/alert/alert.types.js.map +1 -0
  33. package/dist/src/components/atoms/badge/badge.atom.d.ts +16 -0
  34. package/dist/src/components/atoms/badge/badge.atom.js +43 -0
  35. package/dist/src/components/atoms/badge/badge.atom.js.map +1 -0
  36. package/dist/src/components/atoms/badge/badge.stories.d.ts +6 -0
  37. package/dist/src/components/atoms/badge/badge.stories.js +110 -0
  38. package/dist/src/components/atoms/badge/badge.stories.js.map +1 -0
  39. package/dist/src/components/atoms/badge/badge.style.d.ts +3 -0
  40. package/dist/src/components/atoms/badge/badge.style.js +17 -0
  41. package/dist/src/components/atoms/badge/badge.style.js.map +1 -0
  42. package/dist/src/components/atoms/badge/badge.type.d.ts +1 -0
  43. package/dist/src/components/atoms/badge/badge.type.js +2 -0
  44. package/dist/src/components/atoms/badge/badge.type.js.map +1 -0
  45. package/dist/src/components/atoms/button/button.atom.d.ts +22 -0
  46. package/dist/src/components/atoms/button/button.atom.js +67 -0
  47. package/dist/src/components/atoms/button/button.atom.js.map +1 -0
  48. package/dist/src/components/atoms/button/button.stories.d.ts +6 -0
  49. package/dist/src/components/atoms/button/button.stories.js +204 -0
  50. package/dist/src/components/atoms/button/button.stories.js.map +1 -0
  51. package/dist/src/components/atoms/button/button.style.d.ts +4 -0
  52. package/dist/src/components/atoms/button/button.style.js +24 -0
  53. package/dist/src/components/atoms/button/button.style.js.map +1 -0
  54. package/{src/components/atoms/button/button.type.ts → dist/src/components/atoms/button/button.type.d.ts} +1 -8
  55. package/dist/src/components/atoms/button/button.type.js +2 -0
  56. package/dist/src/components/atoms/button/button.type.js.map +1 -0
  57. package/dist/src/components/atoms/card/card-content.d.ts +5 -0
  58. package/dist/src/components/atoms/card/card-content.js +17 -0
  59. package/dist/src/components/atoms/card/card-content.js.map +1 -0
  60. package/dist/src/components/atoms/card/card-description.d.ts +5 -0
  61. package/dist/src/components/atoms/card/card-description.js +17 -0
  62. package/dist/src/components/atoms/card/card-description.js.map +1 -0
  63. package/dist/src/components/atoms/card/card-footer.d.ts +5 -0
  64. package/dist/src/components/atoms/card/card-footer.js +17 -0
  65. package/dist/src/components/atoms/card/card-footer.js.map +1 -0
  66. package/dist/src/components/atoms/card/card-header.d.ts +5 -0
  67. package/dist/src/components/atoms/card/card-header.js +17 -0
  68. package/dist/src/components/atoms/card/card-header.js.map +1 -0
  69. package/dist/src/components/atoms/card/card-title.d.ts +5 -0
  70. package/dist/src/components/atoms/card/card-title.js +17 -0
  71. package/dist/src/components/atoms/card/card-title.js.map +1 -0
  72. package/dist/src/components/atoms/card/card.atom.d.ts +11 -0
  73. package/dist/src/components/atoms/card/card.atom.js +25 -0
  74. package/dist/src/components/atoms/card/card.atom.js.map +1 -0
  75. package/dist/src/components/atoms/card/card.stories.d.ts +6 -0
  76. package/dist/src/components/atoms/card/card.stories.js +136 -0
  77. package/dist/src/components/atoms/card/card.stories.js.map +1 -0
  78. package/dist/src/components/atoms/checkbox/checkbox.atom.d.ts +13 -0
  79. package/dist/src/components/atoms/checkbox/checkbox.atom.js +87 -0
  80. package/dist/src/components/atoms/checkbox/checkbox.atom.js.map +1 -0
  81. package/dist/src/components/atoms/checkbox/checkbox.stories.d.ts +8 -0
  82. package/dist/src/components/atoms/checkbox/checkbox.stories.js +244 -0
  83. package/dist/src/components/atoms/checkbox/checkbox.stories.js.map +1 -0
  84. package/dist/src/components/atoms/checkbox/checkbox.style.d.ts +2 -0
  85. package/dist/src/components/atoms/checkbox/checkbox.style.js +3 -0
  86. package/dist/src/components/atoms/checkbox/checkbox.style.js.map +1 -0
  87. package/dist/src/components/atoms/checkbox/checkbox.type.d.ts +21 -0
  88. package/dist/src/components/atoms/checkbox/checkbox.type.js +2 -0
  89. package/dist/src/components/atoms/checkbox/checkbox.type.js.map +1 -0
  90. package/dist/src/components/atoms/combo-box/combo-box-input.d.ts +8 -0
  91. package/dist/src/components/atoms/combo-box/combo-box-input.js +47 -0
  92. package/dist/src/components/atoms/combo-box/combo-box-input.js.map +1 -0
  93. package/dist/src/components/atoms/combo-box/combo-box-item.d.ts +12 -0
  94. package/dist/src/components/atoms/combo-box/combo-box-item.js +85 -0
  95. package/dist/src/components/atoms/combo-box/combo-box-item.js.map +1 -0
  96. package/dist/src/components/atoms/combo-box/combo-box-list.d.ts +9 -0
  97. package/dist/src/components/atoms/combo-box/combo-box-list.js +67 -0
  98. package/dist/src/components/atoms/combo-box/combo-box-list.js.map +1 -0
  99. package/dist/src/components/atoms/combo-box/combo-box.atom.d.ts +23 -0
  100. package/dist/src/components/atoms/combo-box/combo-box.atom.js +199 -0
  101. package/dist/src/components/atoms/combo-box/combo-box.atom.js.map +1 -0
  102. package/dist/src/components/atoms/combo-box/combo-box.stories.d.ts +9 -0
  103. package/dist/src/components/atoms/combo-box/combo-box.stories.js +86 -0
  104. package/dist/src/components/atoms/combo-box/combo-box.stories.js.map +1 -0
  105. package/dist/src/components/atoms/command-empty/command-empty.atom.d.ts +9 -0
  106. package/dist/src/components/atoms/command-empty/command-empty.atom.js +53 -0
  107. package/dist/src/components/atoms/command-empty/command-empty.atom.js.map +1 -0
  108. package/dist/src/components/atoms/command-group/command-group.atom.d.ts +10 -0
  109. package/dist/src/components/atoms/command-group/command-group.atom.js +70 -0
  110. package/dist/src/components/atoms/command-group/command-group.atom.js.map +1 -0
  111. package/dist/src/components/atoms/command-item/command-item.atom.d.ts +12 -0
  112. package/dist/src/components/atoms/command-item/command-item.atom.js +78 -0
  113. package/dist/src/components/atoms/command-item/command-item.atom.js.map +1 -0
  114. package/dist/src/components/atoms/command-list/command-list.atom.d.ts +6 -0
  115. package/dist/src/components/atoms/command-list/command-list.atom.js +35 -0
  116. package/dist/src/components/atoms/command-list/command-list.atom.js.map +1 -0
  117. package/dist/src/components/atoms/command-separator/command-separator.atom.d.ts +9 -0
  118. package/dist/src/components/atoms/command-separator/command-separator.atom.js +51 -0
  119. package/dist/src/components/atoms/command-separator/command-separator.atom.js.map +1 -0
  120. package/dist/src/components/atoms/dialog/dialog-close.d.ts +7 -0
  121. package/dist/src/components/atoms/dialog/dialog-close.js +46 -0
  122. package/dist/src/components/atoms/dialog/dialog-close.js.map +1 -0
  123. package/dist/src/components/atoms/dialog/dialog-content.d.ts +8 -0
  124. package/dist/src/components/atoms/dialog/dialog-content.js +72 -0
  125. package/dist/src/components/atoms/dialog/dialog-content.js.map +1 -0
  126. package/dist/src/components/atoms/dialog/dialog-footer.d.ts +5 -0
  127. package/dist/src/components/atoms/dialog/dialog-footer.js +22 -0
  128. package/dist/src/components/atoms/dialog/dialog-footer.js.map +1 -0
  129. package/dist/src/components/atoms/dialog/dialog-header.d.ts +7 -0
  130. package/dist/src/components/atoms/dialog/dialog-header.js +40 -0
  131. package/dist/src/components/atoms/dialog/dialog-header.js.map +1 -0
  132. package/dist/src/components/atoms/dialog/dialog-overly.d.ts +5 -0
  133. package/dist/src/components/atoms/dialog/dialog-overly.js +20 -0
  134. package/dist/src/components/atoms/dialog/dialog-overly.js.map +1 -0
  135. package/dist/src/components/atoms/dialog/dialog-trigger.d.ts +8 -0
  136. package/dist/src/components/atoms/dialog/dialog-trigger.js +53 -0
  137. package/dist/src/components/atoms/dialog/dialog-trigger.js.map +1 -0
  138. package/dist/src/components/atoms/dialog/dialog.atom.d.ts +8 -0
  139. package/dist/src/components/atoms/dialog/dialog.atom.js +78 -0
  140. package/dist/src/components/atoms/dialog/dialog.atom.js.map +1 -0
  141. package/dist/src/components/atoms/dialog/dialog.stories.d.ts +16 -0
  142. package/{src/components/atoms/dialog/dialog.stories.ts → dist/src/components/atoms/dialog/dialog.stories.js} +18 -16
  143. package/dist/src/components/atoms/dialog/dialog.stories.js.map +1 -0
  144. package/dist/src/components/atoms/dropdownMenu/dropdown-menu-checkbox-Item.d.ts +15 -0
  145. package/dist/src/components/atoms/dropdownMenu/dropdown-menu-checkbox-Item.js +115 -0
  146. package/dist/src/components/atoms/dropdownMenu/dropdown-menu-checkbox-Item.js.map +1 -0
  147. package/dist/src/components/atoms/dropdownMenu/dropdown-menu-content.d.ts +13 -0
  148. package/dist/src/components/atoms/dropdownMenu/dropdown-menu-content.js +80 -0
  149. package/dist/src/components/atoms/dropdownMenu/dropdown-menu-content.js.map +1 -0
  150. package/dist/src/components/atoms/dropdownMenu/dropdown-menu-group.d.ts +10 -0
  151. package/dist/src/components/atoms/dropdownMenu/dropdown-menu-group.js +70 -0
  152. package/dist/src/components/atoms/dropdownMenu/dropdown-menu-group.js.map +1 -0
  153. package/dist/src/components/atoms/dropdownMenu/dropdown-menu-item.d.ts +12 -0
  154. package/dist/src/components/atoms/dropdownMenu/dropdown-menu-item.js +78 -0
  155. package/dist/src/components/atoms/dropdownMenu/dropdown-menu-item.js.map +1 -0
  156. package/dist/src/components/atoms/dropdownMenu/dropdown-menu-radio-item.d.ts +15 -0
  157. package/dist/src/components/atoms/dropdownMenu/dropdown-menu-radio-item.js +116 -0
  158. package/dist/src/components/atoms/dropdownMenu/dropdown-menu-radio-item.js.map +1 -0
  159. package/dist/src/components/atoms/dropdownMenu/dropdown-menu-seperator.d.ts +9 -0
  160. package/dist/src/components/atoms/dropdownMenu/dropdown-menu-seperator.js +51 -0
  161. package/dist/src/components/atoms/dropdownMenu/dropdown-menu-seperator.js.map +1 -0
  162. package/dist/src/components/atoms/dropdownMenu/dropdown-menu-shortcut.d.ts +5 -0
  163. package/dist/src/components/atoms/dropdownMenu/dropdown-menu-shortcut.js +20 -0
  164. package/dist/src/components/atoms/dropdownMenu/dropdown-menu-shortcut.js.map +1 -0
  165. package/dist/src/components/atoms/dropdownMenu/dropdown-menu.atom.d.ts +14 -0
  166. package/dist/src/components/atoms/dropdownMenu/dropdown-menu.atom.js +77 -0
  167. package/dist/src/components/atoms/dropdownMenu/dropdown-menu.atom.js.map +1 -0
  168. package/dist/src/components/atoms/dropdownMenu/dropdownMenu.stories.d.ts +15 -0
  169. package/dist/src/components/atoms/dropdownMenu/dropdownMenu.stories.js +211 -0
  170. package/dist/src/components/atoms/dropdownMenu/dropdownMenu.stories.js.map +1 -0
  171. package/dist/src/components/atoms/dropdownMenu/dropdownMenu.style.d.ts +2 -0
  172. package/dist/src/components/atoms/dropdownMenu/dropdownMenu.style.js +4 -0
  173. package/dist/src/components/atoms/dropdownMenu/dropdownMenu.style.js.map +1 -0
  174. package/{src/components/atoms/index.ts → dist/src/components/atoms/index.d.ts} +3 -0
  175. package/dist/src/components/atoms/index.js +14 -0
  176. package/dist/src/components/atoms/index.js.map +1 -0
  177. package/dist/src/components/atoms/input/input.atom.d.ts +21 -0
  178. package/dist/src/components/atoms/input/input.atom.js +93 -0
  179. package/dist/src/components/atoms/input/input.atom.js.map +1 -0
  180. package/dist/src/components/atoms/input/input.stories.d.ts +8 -0
  181. package/dist/src/components/atoms/input/input.stories.js +382 -0
  182. package/dist/src/components/atoms/input/input.stories.js.map +1 -0
  183. package/dist/src/components/atoms/input/input.styles.d.ts +1 -0
  184. package/dist/src/components/atoms/input/input.styles.js +2 -0
  185. package/dist/src/components/atoms/input/input.styles.js.map +1 -0
  186. package/dist/src/components/atoms/input/input.type.d.ts +21 -0
  187. package/dist/src/components/atoms/input/input.type.js +2 -0
  188. package/dist/src/components/atoms/input/input.type.js.map +1 -0
  189. package/dist/src/components/atoms/label/label.atom.d.ts +11 -0
  190. package/dist/src/components/atoms/label/label.atom.js +67 -0
  191. package/dist/src/components/atoms/label/label.atom.js.map +1 -0
  192. package/dist/src/components/atoms/label/label.stories.d.ts +6 -0
  193. package/dist/src/components/atoms/label/label.stories.js +85 -0
  194. package/dist/src/components/atoms/label/label.stories.js.map +1 -0
  195. package/dist/src/components/atoms/label/label.style.d.ts +1 -0
  196. package/dist/src/components/atoms/label/label.style.js +3 -0
  197. package/dist/src/components/atoms/label/label.style.js.map +1 -0
  198. package/dist/src/components/atoms/popover/popover-content.d.ts +11 -0
  199. package/dist/src/components/atoms/popover/popover-content.js +62 -0
  200. package/dist/src/components/atoms/popover/popover-content.js.map +1 -0
  201. package/dist/src/components/atoms/popover/popover-trigger.d.ts +9 -0
  202. package/dist/src/components/atoms/popover/popover-trigger.js +50 -0
  203. package/dist/src/components/atoms/popover/popover-trigger.js.map +1 -0
  204. package/dist/src/components/atoms/popover/popover.atom.d.ts +8 -0
  205. package/dist/src/components/atoms/popover/popover.atom.js +40 -0
  206. package/dist/src/components/atoms/popover/popover.atom.js.map +1 -0
  207. package/dist/src/components/atoms/popover/popover.stories.d.ts +10 -0
  208. package/dist/src/components/atoms/popover/popover.stories.js +69 -0
  209. package/dist/src/components/atoms/popover/popover.stories.js.map +1 -0
  210. package/dist/src/components/atoms/popover/popover.style.d.ts +5 -0
  211. package/dist/src/components/atoms/popover/popover.style.js +21 -0
  212. package/dist/src/components/atoms/popover/popover.style.js.map +1 -0
  213. package/dist/src/components/atoms/popover/popover.types.d.ts +2 -0
  214. package/dist/src/components/atoms/popover/popover.types.js +4 -0
  215. package/dist/src/components/atoms/popover/popover.types.js.map +1 -0
  216. package/dist/src/components/atoms/toggle/defs.d.ts +27 -0
  217. package/dist/src/components/atoms/toggle/defs.js +30 -0
  218. package/dist/src/components/atoms/toggle/defs.js.map +1 -0
  219. package/dist/src/components/atoms/toggle/toggle.atom.d.ts +19 -0
  220. package/dist/src/components/atoms/toggle/toggle.atom.js +72 -0
  221. package/dist/src/components/atoms/toggle/toggle.atom.js.map +1 -0
  222. package/dist/src/components/atoms/toggle/toggle.stories.d.ts +6 -0
  223. package/dist/src/components/atoms/toggle/toggle.stories.js +189 -0
  224. package/dist/src/components/atoms/toggle/toggle.stories.js.map +1 -0
  225. package/dist/src/components/atoms/toggle/toggle.style.d.ts +4 -0
  226. package/dist/src/components/atoms/toggle/toggle.style.js +19 -0
  227. package/dist/src/components/atoms/toggle/toggle.style.js.map +1 -0
  228. package/dist/src/components/command/command.d.ts +56 -0
  229. package/dist/src/components/command/command.js +402 -0
  230. package/dist/src/components/command/command.js.map +1 -0
  231. package/dist/src/components/command/command.stories.d.ts +5 -0
  232. package/{src/components/command/command.stories.ts → dist/src/components/command/command.stories.js} +6 -7
  233. package/dist/src/components/command/command.stories.js.map +1 -0
  234. package/dist/src/components/index.js +3 -0
  235. package/dist/src/components/index.js.map +1 -0
  236. package/dist/src/components/molecules/command/command.molecules.d.ts +6 -0
  237. package/dist/src/components/molecules/command/command.molecules.js +27 -0
  238. package/dist/src/components/molecules/command/command.molecules.js.map +1 -0
  239. package/dist/src/components/molecules/command-input/command-input.atom.d.ts +10 -0
  240. package/dist/src/components/molecules/command-input/command-input.atom.js +125 -0
  241. package/dist/src/components/molecules/command-input/command-input.atom.js.map +1 -0
  242. package/dist/src/components/molecules/dropdownMenu/dropdownMenu.molecules.js +2 -0
  243. package/dist/src/components/molecules/dropdownMenu/dropdownMenu.molecules.js.map +1 -0
  244. package/dist/src/components/molecules/index.js +2 -0
  245. package/dist/src/components/molecules/index.js.map +1 -0
  246. package/dist/src/helpers/base-element.d.ts +10 -0
  247. package/dist/src/helpers/base-element.js +62 -0
  248. package/dist/src/helpers/base-element.js.map +1 -0
  249. package/{src/helpers/index.ts → dist/src/helpers/index.d.ts} +1 -0
  250. package/dist/src/helpers/index.js +4 -0
  251. package/dist/src/helpers/index.js.map +1 -0
  252. package/dist/src/helpers/mouse-conroller.helper.d.ts +14 -0
  253. package/dist/src/helpers/mouse-conroller.helper.js +33 -0
  254. package/dist/src/helpers/mouse-conroller.helper.js.map +1 -0
  255. package/dist/src/helpers/style.helpers.d.ts +2 -0
  256. package/dist/src/helpers/style.helpers.js +6 -0
  257. package/dist/src/helpers/style.helpers.js.map +1 -0
  258. package/dist/src/index.d.ts +4 -0
  259. package/dist/src/index.js +5 -0
  260. package/dist/src/index.js.map +1 -0
  261. package/dist/src/interfaces/actionable.interface.d.ts +5 -0
  262. package/dist/src/interfaces/actionable.interface.js +2 -0
  263. package/dist/src/interfaces/actionable.interface.js.map +1 -0
  264. package/dist/src/interfaces/atomic.interface.d.ts +6 -0
  265. package/dist/src/interfaces/atomic.interface.js +2 -0
  266. package/dist/src/interfaces/atomic.interface.js.map +1 -0
  267. package/{src/interfaces/changeable.interface.ts → dist/src/interfaces/changeable.interface.d.ts} +7 -14
  268. package/dist/src/interfaces/changeable.interface.js +2 -0
  269. package/dist/src/interfaces/changeable.interface.js.map +1 -0
  270. package/{src/interfaces/child-support-atomic.interface.ts → dist/src/interfaces/child-support-atomic.interface.d.ts} +4 -5
  271. package/dist/src/interfaces/child-support-atomic.interface.js +2 -0
  272. package/dist/src/interfaces/child-support-atomic.interface.js.map +1 -0
  273. package/dist/src/interfaces/index.js +7 -0
  274. package/dist/src/interfaces/index.js.map +1 -0
  275. package/dist/src/interfaces/intractable.interface.d.ts +6 -0
  276. package/dist/src/interfaces/intractable.interface.js +2 -0
  277. package/dist/src/interfaces/intractable.interface.js.map +1 -0
  278. package/{src/interfaces/variant.interface.ts → dist/src/interfaces/variant.interface.d.ts} +1 -1
  279. package/dist/src/interfaces/variant.interface.js +2 -0
  280. package/dist/src/interfaces/variant.interface.js.map +1 -0
  281. package/dist/src/lib/index.js +2 -0
  282. package/dist/src/lib/index.js.map +1 -0
  283. package/dist/src/lib/next/next.lib.js +2 -0
  284. package/dist/src/lib/next/next.lib.js.map +1 -0
  285. package/dist/src/lib/react/react.lib.d.ts +5 -0
  286. package/dist/src/lib/react/react.lib.js +16 -0
  287. package/dist/src/lib/react/react.lib.js.map +1 -0
  288. package/dist/src/lib/tw-styles.d.ts +1 -0
  289. package/{src/globals.css → dist/src/lib/tw-styles.js} +294 -144
  290. package/dist/src/lib/tw-styles.js.map +1 -0
  291. package/dist/src/styles/index.js +2 -0
  292. package/dist/src/styles/index.js.map +1 -0
  293. package/dist/src/styles/tw.styles.d.ts +1 -0
  294. package/dist/src/styles/tw.styles.js +2218 -0
  295. package/dist/src/styles/tw.styles.js.map +1 -0
  296. package/dist/src/wc-ui-app.d.ts +6 -0
  297. package/{src/wc-ui-app.ts → dist/src/wc-ui-app.js} +42 -35
  298. package/dist/src/wc-ui-app.js.map +1 -0
  299. package/dist/test/wc-ui-app.test.d.ts +0 -0
  300. package/dist/test/wc-ui-app.test.js +18 -0
  301. package/dist/test/wc-ui-app.test.js.map +1 -0
  302. package/dist/tsconfig.tsbuildinfo +1 -0
  303. package/dist/vite.config.d.ts +2 -0
  304. package/dist/vite.config.js +29 -0
  305. package/dist/vite.config.js.map +1 -0
  306. package/package.json +38 -20
  307. package/.editorconfig +0 -29
  308. package/.eslintrc +0 -10
  309. package/.storybook/main.ts +0 -17
  310. package/.storybook/preview-head.html +0 -1
  311. package/.storybook/preview.ts +0 -17
  312. package/assets/fonts/Geist/Geist-Black.otf +0 -0
  313. package/assets/fonts/Geist/Geist-Black.woff2 +0 -0
  314. package/assets/fonts/Geist/Geist-Bold.otf +0 -0
  315. package/assets/fonts/Geist/Geist-Bold.woff2 +0 -0
  316. package/assets/fonts/Geist/Geist-Light.otf +0 -0
  317. package/assets/fonts/Geist/Geist-Light.woff2 +0 -0
  318. package/assets/fonts/Geist/Geist-Medium.otf +0 -0
  319. package/assets/fonts/Geist/Geist-Medium.woff2 +0 -0
  320. package/assets/fonts/Geist/Geist-Regular.otf +0 -0
  321. package/assets/fonts/Geist/Geist-Regular.woff2 +0 -0
  322. package/assets/fonts/Geist/Geist-SemiBold.otf +0 -0
  323. package/assets/fonts/Geist/Geist-SemiBold.woff2 +0 -0
  324. package/assets/fonts/Geist/Geist-Thin.otf +0 -0
  325. package/assets/fonts/Geist/Geist-Thin.woff2 +0 -0
  326. package/assets/fonts/Geist/Geist-UltraBlack.otf +0 -0
  327. package/assets/fonts/Geist/Geist-UltraBlack.woff2 +0 -0
  328. package/assets/fonts/Geist/Geist-UltraLight.otf +0 -0
  329. package/assets/fonts/Geist/Geist-UltraLight.woff2 +0 -0
  330. package/assets/fonts/Geist/GeistVariableVF.ttf +0 -0
  331. package/assets/fonts/Geist/GeistVariableVF.woff2 +0 -0
  332. package/assets/fonts/Geist/LICENSE.TXT +0 -92
  333. package/assets/open-wc-logo.svg +0 -29
  334. package/index.html +0 -362
  335. package/rollup.config.js +0 -71
  336. package/src/components/atoms/button/button.atom.ts +0 -39
  337. package/src/components/atoms/button/button.stories.ts +0 -186
  338. package/src/components/atoms/button/button.style.ts +0 -31
  339. package/src/components/atoms/checkbox/checkbox.atom.ts +0 -62
  340. package/src/components/atoms/checkbox/checkbox.stories.ts +0 -42
  341. package/src/components/atoms/command-empty/command-empty.atom.ts +0 -44
  342. package/src/components/atoms/command-group/command-group.atom.ts +0 -60
  343. package/src/components/atoms/command-item/command-item.atom.ts +0 -74
  344. package/src/components/atoms/command-list/command-list.atom.ts +0 -37
  345. package/src/components/atoms/command-separator/command-separator.atom.ts +0 -42
  346. package/src/components/atoms/dialog/dialog.atom.ts +0 -301
  347. package/src/components/atoms/input/input.atom.ts +0 -34
  348. package/src/components/atoms/input/input.stories.ts +0 -89
  349. package/src/components/atoms/input/input.type.ts +0 -24
  350. package/src/components/atoms/label/label.atom.ts +0 -40
  351. package/src/components/atoms/label/label.stories.ts +0 -18
  352. package/src/components/atoms/label/label.style.ts +0 -5
  353. package/src/components/command/command.ts +0 -391
  354. package/src/components/molecules/command/command.molecules.ts +0 -31
  355. package/src/components/molecules/command-input/command-input.atom.ts +0 -130
  356. package/src/components/popover.ts +0 -247
  357. package/src/helpers/mouse-conroller.helper.ts +0 -42
  358. package/src/helpers/style.helpers.ts +0 -6
  359. package/src/interfaces/actionable.interface.ts +0 -6
  360. package/src/interfaces/atomic.interface.ts +0 -6
  361. package/src/interfaces/intractable.interface.ts +0 -6
  362. package/src/styles/tw.styles.ts +0 -1867
  363. package/src/tailwind-lib.css +0 -95
  364. package/tailwind.config.js +0 -81
  365. package/test/wc-ui-app.test.ts +0 -22
  366. package/tsconfig.json +0 -25
  367. package/web-dev-server.config.mjs +0 -26
  368. package/web-test-runner.config.mjs +0 -41
  369. /package/{src/components/index.ts → dist/src/components/index.d.ts} +0 -0
  370. /package/{src/lib/index.ts → dist/src/components/molecules/dropdownMenu/dropdownMenu.molecules.d.ts} +0 -0
  371. /package/{src/components/molecules/index.ts → dist/src/components/molecules/index.d.ts} +0 -0
  372. /package/{src/interfaces/index.ts → dist/src/interfaces/index.d.ts} +0 -0
  373. /package/{src/lib/next/next.lib.ts → dist/src/lib/index.d.ts} +0 -0
  374. /package/{src/lib/react/react.lib.ts → dist/src/lib/next/next.lib.d.ts} +0 -0
  375. /package/{src/styles/index.ts → dist/src/styles/index.d.ts} +0 -0
@@ -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,uBAA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AE,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
@@ -0,0 +1 @@
1
+ {"version":3,"file":"label.atom.js","sourceRoot":"","sources":["../../../../../src/components/atoms/label/label.atom.ts"],"names":[],"mappings":";;AAAA,OAAO,EAAc,IAAI,EAAE,GAAG,EAAkB,MAAM,KAAK,CAAC;AAC5D,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAAE,WAAW,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAGvC,IAAM,KAAK,aAAX,MAAM,KAAM,SAAQ,WAAW;IAA/B;;QAGuB,QAAG,GAAG,EAAE,CAAC;IAoDvC,CAAC;IApCW,YAAY,CAAC,kBAAkC;QACvD,MAAM,SAAS,GAAG,CAAC,oCAAoC,CAAC,CAAC;QACzD,IAAI,CAAC,gBAAgB,CAAC,SAAS,EAAE,OAAO,EAAE,YAAY,CAAC,CAAC;IAC1D,CAAC;IAEO,QAAQ,CAAC,CAAQ;QACvB,IAAI,CAAC,CAAC,gBAAgB;YAAE,OAAO;QAC/B,MAAM,MAAM,GAAG,IAAI,CAAC,UAAU,EAAE,cAAc,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACzD,IAAI,MAAM,EAAE,CAAC;YACX,MAAM,CAAC,KAAK,EAAE,CAAC;QACjB,CAAC;IACH,CAAC;IAES,sBAAsB;QAC9B,OAAO,CAAC,KAAK,EAAE,aAAa,CAAC,CAAC;IAChC,CAAC;IAED,MAAM;QACJ,MAAM,UAAU,GAAG,IAAI,CAAC,qBAAqB,EAAE,CAAC;QAEhD,OAAO,IAAI,CAAA;;eAEA,IAAI,CAAC,GAAG;kBACL,IAAI,CAAC,QAAQ;oBACX,IAAI,CAAC,QAAQ;iBAChB,EAAE,CACT,OAAK,CAAC,aAAa,CAAC;YAClB,SAAS,EAAE,IAAI,CAAC,SAAS;SAC1B,CAAC,CACH;UACC,MAAM,CAAC,UAAU,CAAC;;;;KAIvB,CAAC;IACJ,CAAC;;AArDM,mBAAa,GAAG,UAAU,AAAb,CAAc;AAI3B,YAAM,GAAG;IACd,GAAG,CAAA;;;;;;;;;KASF;IACD,QAAQ;CACT,AAZY,CAYX;AAd0B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;kCAAU;AAH1B,KAAK;IADjB,aAAa,CAAC,WAAW,CAAC;GACd,KAAK,CAuDjB","sourcesContent":["import { LitElement, html, css, PropertyValues } from 'lit';\nimport { property, customElement } from 'lit/decorators.js';\nimport { BaseElement, cn } from '../../../helpers';\nimport { TWStyles } from '../../../styles';\nimport { labelStyle } from './label.style';\nimport { spread } from '@open-wc/lit-helpers';\n\n@customElement('rtg-label')\nexport class Label extends BaseElement {\n static labelVariants = labelStyle;\n\n @property({ type: String }) for = '';\n\n static styles = [\n css`\n :root {\n --label-text-color: inherit;\n --label-padding: inherit;\n }\n .label-base {\n color: var(--label-text-color) !important;\n padding: var(--label-padding) !important;\n }\n `,\n TWStyles,\n ];\n\n protected firstUpdated(_changedProperties: PropertyValues): void {\n const variables = ['--label-text-color,--label-padding'];\n this.applyCustomClass(variables, 'label', 'label-base');\n }\n\n private _onClick(e: Event) {\n if (e.defaultPrevented) return;\n const target = this.shadowRoot?.getElementById(this.for);\n if (target) {\n target.click();\n }\n }\n\n protected getAttributesToExclude(): string[] {\n return ['for', 'data-testid'];\n }\n\n render() {\n const attributes = this.getFilteredAttributes();\n\n return html`\n <label\n for=\"${this.for}\"\n @click=\"${this._onClick}\"\n @keydown=\"${this._onClick}\"\n class=\"${cn(\n Label.labelVariants({\n className: this.className,\n })\n )}\"\n ${spread(attributes)}\n >\n <slot></slot>\n </label>\n `;\n }\n}\n"]}
@@ -0,0 +1,6 @@
1
+ import { Meta, StoryFn } from '@storybook/web-components';
2
+ import './label.atom';
3
+ declare const _default: Meta;
4
+ export default _default;
5
+ export declare const Default: StoryFn;
6
+ export declare const HtmlFor: StoryFn;
@@ -0,0 +1,85 @@
1
+ import { html } from 'lit';
2
+ import './label.atom';
3
+ import { expect, within, fn, waitFor, userEvent } from '@storybook/test';
4
+ import { Label } from './label.atom';
5
+ // Label Test Behavior
6
+ const testLabelBehavior = async (args, canvasElement, mockHandler) => {
7
+ const canvas = within(canvasElement);
8
+ const label = await waitFor(() => canvas.getByTestId('label-id'));
9
+ if (label.shadowRoot) {
10
+ const innerLabel = label.shadowRoot.querySelector('label') || '';
11
+ // 1. Test: Label should have correct "for" attribute
12
+ expect(label).toHaveAttribute('for', args.for);
13
+ // 2. Test: Label should apply correct variant classes
14
+ const expectedClasses = Label.labelVariants({
15
+ className: '',
16
+ });
17
+ expect(innerLabel).toHaveClass(expectedClasses);
18
+ // 3. Test: Label should trigger associated input's click when clicked
19
+ if (!args.disabled) {
20
+ const targetInput = document.createElement('input');
21
+ targetInput.id = args.for;
22
+ label.shadowRoot.appendChild(targetInput);
23
+ targetInput.click = fn(); // Mock click behavior for test
24
+ await userEvent.click(innerLabel);
25
+ expect(targetInput.click).toHaveBeenCalled();
26
+ label.shadowRoot.removeChild(targetInput); // Clean up
27
+ }
28
+ // 4. Test: Ensure that label doesn't trigger input click when default is prevented
29
+ const event = new Event('click', { cancelable: true });
30
+ label.dispatchEvent(event);
31
+ if (!event.defaultPrevented) {
32
+ await userEvent.click(innerLabel);
33
+ expect(mockHandler).not.toHaveBeenCalled(); // should not trigger if default prevented
34
+ }
35
+ }
36
+ };
37
+ export default {
38
+ title: 'components/atoms/label',
39
+ tags: ['autodocs'],
40
+ argTypes: {
41
+ label: {
42
+ type: 'string',
43
+ description: 'The text to display on the label.',
44
+ table: {
45
+ defaultValue: { summary: '' },
46
+ },
47
+ },
48
+ for: {
49
+ type: 'string',
50
+ description: "The text that the label is describing. This is typically the ID of the input element it's labeling.",
51
+ table: {
52
+ defaultValue: { summary: '' },
53
+ },
54
+ },
55
+ },
56
+ };
57
+ const Template = (args) => html ` <rtg-label
58
+ data-testchild="children-id"
59
+ data-testid="label-id"
60
+ for=${args.for}
61
+ >${args.label}</rtg-label
62
+ >`;
63
+ const HtmlForTemplate = (args) => html ` <rtg-label
64
+ data-testchild="children-id"
65
+ data-testid="label-id"
66
+ for=${args.for}
67
+ >
68
+ ${args.label}
69
+ <input type="text" id=${args.for} />
70
+ </rtg-label>`;
71
+ export const Default = Template.bind({});
72
+ export const HtmlFor = HtmlForTemplate.bind({});
73
+ Default.args = {
74
+ for: 'id',
75
+ label: 'Email address',
76
+ };
77
+ HtmlFor.args = {
78
+ for: 'id',
79
+ label: 'Email address',
80
+ };
81
+ Default.play = async ({ args, canvasElement }) => {
82
+ const mockHandler = fn();
83
+ await testLabelBehavior(args, canvasElement, mockHandler);
84
+ };
85
+ //# sourceMappingURL=label.stories.js.map