revotech-ui-kit 0.0.2 → 0.0.4-beta

Sign up to get free protection for your applications and to get access to all the features.
Files changed (308) hide show
  1. package/.github/workflows/deploy-storybook.yml +107 -0
  2. package/.storybook/main.ts +3 -3
  3. package/assume_role.sh +18 -0
  4. package/dist/183c6c38.js +1 -0
  5. package/dist/f28fd4b1.js +1 -0
  6. package/dist/index.ts +1 -0
  7. package/dist/public/globals.css +2215 -0
  8. package/dist/public/tailwind-lib.css +115 -0
  9. package/dist/src/assets/icons/arrows.icon.js +20 -0
  10. package/dist/src/assets/icons/arrows.icon.js.map +1 -0
  11. package/dist/src/assets/icons/index.js +4 -0
  12. package/dist/src/assets/icons/index.js.map +1 -0
  13. package/dist/src/assets/icons/search.icon.js +19 -0
  14. package/dist/src/assets/icons/search.icon.js.map +1 -0
  15. package/dist/src/assets/icons/tick.icon.js +20 -0
  16. package/dist/src/assets/icons/tick.icon.js.map +1 -0
  17. package/dist/src/components/atoms/alert/alert-description.js +18 -0
  18. package/dist/src/components/atoms/alert/alert-description.js.map +1 -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.js +55 -0
  22. package/dist/src/components/atoms/alert/alert.atom.js.map +1 -0
  23. package/dist/src/components/atoms/alert/alert.stories.js +62 -0
  24. package/dist/src/components/atoms/alert/alert.stories.js.map +1 -0
  25. package/dist/src/components/atoms/alert/alert.styles.js +21 -0
  26. package/dist/src/components/atoms/alert/alert.styles.js.map +1 -0
  27. package/dist/src/components/atoms/alert/alert.types.js +2 -0
  28. package/dist/src/components/atoms/alert/alert.types.js.map +1 -0
  29. package/dist/src/components/atoms/badge/badge.atom.js +43 -0
  30. package/dist/src/components/atoms/badge/badge.atom.js.map +1 -0
  31. package/dist/src/components/atoms/badge/badge.stories.js +110 -0
  32. package/dist/src/components/atoms/badge/badge.stories.js.map +1 -0
  33. package/dist/src/components/atoms/badge/badge.style.js +17 -0
  34. package/dist/src/components/atoms/badge/badge.style.js.map +1 -0
  35. package/dist/src/components/atoms/badge/badge.type.js +2 -0
  36. package/dist/src/components/atoms/badge/badge.type.js.map +1 -0
  37. package/dist/src/components/atoms/button/button.atom.js +67 -0
  38. package/dist/src/components/atoms/button/button.atom.js.map +1 -0
  39. package/dist/src/components/atoms/button/button.stories.js +204 -0
  40. package/dist/src/components/atoms/button/button.stories.js.map +1 -0
  41. package/dist/src/components/atoms/button/button.style.js +24 -0
  42. package/dist/src/components/atoms/button/button.style.js.map +1 -0
  43. package/dist/src/components/atoms/button/button.type.js +2 -0
  44. package/dist/src/components/atoms/button/button.type.js.map +1 -0
  45. package/dist/src/components/atoms/card/card-content.js +17 -0
  46. package/dist/src/components/atoms/card/card-content.js.map +1 -0
  47. package/dist/src/components/atoms/card/card-description.js +17 -0
  48. package/dist/src/components/atoms/card/card-description.js.map +1 -0
  49. package/dist/src/components/atoms/card/card-footer.js +17 -0
  50. package/dist/src/components/atoms/card/card-footer.js.map +1 -0
  51. package/dist/src/components/atoms/card/card-header.js +17 -0
  52. package/dist/src/components/atoms/card/card-header.js.map +1 -0
  53. package/dist/src/components/atoms/card/card-title.js +17 -0
  54. package/dist/src/components/atoms/card/card-title.js.map +1 -0
  55. package/dist/src/components/atoms/card/card.atom.js +25 -0
  56. package/dist/src/components/atoms/card/card.atom.js.map +1 -0
  57. package/dist/src/components/atoms/card/card.stories.js +136 -0
  58. package/dist/src/components/atoms/card/card.stories.js.map +1 -0
  59. package/dist/src/components/atoms/checkbox/checkbox.atom.js +87 -0
  60. package/dist/src/components/atoms/checkbox/checkbox.atom.js.map +1 -0
  61. package/dist/src/components/atoms/checkbox/checkbox.stories.js +244 -0
  62. package/dist/src/components/atoms/checkbox/checkbox.stories.js.map +1 -0
  63. package/dist/src/components/atoms/checkbox/checkbox.style.js +3 -0
  64. package/dist/src/components/atoms/checkbox/checkbox.style.js.map +1 -0
  65. package/dist/src/components/atoms/checkbox/checkbox.type.js +2 -0
  66. package/dist/src/components/atoms/checkbox/checkbox.type.js.map +1 -0
  67. package/dist/src/components/atoms/combo-box/combo-box-input.js +47 -0
  68. package/dist/src/components/atoms/combo-box/combo-box-input.js.map +1 -0
  69. package/dist/src/components/atoms/combo-box/combo-box-item.js +85 -0
  70. package/dist/src/components/atoms/combo-box/combo-box-item.js.map +1 -0
  71. package/dist/src/components/atoms/combo-box/combo-box-list.js +67 -0
  72. package/dist/src/components/atoms/combo-box/combo-box-list.js.map +1 -0
  73. package/dist/src/components/atoms/combo-box/combo-box.atom.js +199 -0
  74. package/dist/src/components/atoms/combo-box/combo-box.atom.js.map +1 -0
  75. package/dist/src/components/atoms/combo-box/combo-box.stories.js +86 -0
  76. package/dist/src/components/atoms/combo-box/combo-box.stories.js.map +1 -0
  77. package/dist/src/components/atoms/command-empty/command-empty.atom.js +54 -0
  78. package/dist/src/components/atoms/command-empty/command-empty.atom.js.map +1 -0
  79. package/dist/src/components/atoms/command-group/command-group.atom.js +71 -0
  80. package/dist/src/components/atoms/command-group/command-group.atom.js.map +1 -0
  81. package/dist/src/components/atoms/command-item/command-item.atom.js +80 -0
  82. package/dist/src/components/atoms/command-item/command-item.atom.js.map +1 -0
  83. package/dist/src/components/atoms/command-list/command-list.atom.js +36 -0
  84. package/dist/src/components/atoms/command-list/command-list.atom.js.map +1 -0
  85. package/dist/src/components/atoms/command-separator/command-separator.atom.js +52 -0
  86. package/dist/src/components/atoms/command-separator/command-separator.atom.js.map +1 -0
  87. package/dist/src/components/atoms/dialog/dialog-close.js +47 -0
  88. package/dist/src/components/atoms/dialog/dialog-close.js.map +1 -0
  89. package/dist/src/components/atoms/dialog/dialog-content.js +72 -0
  90. package/dist/src/components/atoms/dialog/dialog-content.js.map +1 -0
  91. package/dist/src/components/atoms/dialog/dialog-footer.js +22 -0
  92. package/dist/src/components/atoms/dialog/dialog-footer.js.map +1 -0
  93. package/dist/src/components/atoms/dialog/dialog-header.js +40 -0
  94. package/dist/src/components/atoms/dialog/dialog-header.js.map +1 -0
  95. package/dist/src/components/atoms/dialog/dialog-overly.js +20 -0
  96. package/dist/src/components/atoms/dialog/dialog-overly.js.map +1 -0
  97. package/dist/src/components/atoms/dialog/dialog-trigger.js +54 -0
  98. package/dist/src/components/atoms/dialog/dialog-trigger.js.map +1 -0
  99. package/dist/src/components/atoms/dialog/dialog.atom.js +79 -0
  100. package/dist/src/components/atoms/dialog/dialog.atom.js.map +1 -0
  101. package/dist/src/components/atoms/dialog/dialog.stories.js +88 -0
  102. package/dist/src/components/atoms/dialog/dialog.stories.js.map +1 -0
  103. package/dist/src/components/atoms/dropdownMenu/dropdown-menu-checkbox-Item.js +117 -0
  104. package/dist/src/components/atoms/dropdownMenu/dropdown-menu-checkbox-Item.js.map +1 -0
  105. package/dist/src/components/atoms/dropdownMenu/dropdown-menu-content.js +81 -0
  106. package/dist/src/components/atoms/dropdownMenu/dropdown-menu-content.js.map +1 -0
  107. package/dist/src/components/atoms/dropdownMenu/dropdown-menu-group.js +71 -0
  108. package/dist/src/components/atoms/dropdownMenu/dropdown-menu-group.js.map +1 -0
  109. package/dist/src/components/atoms/dropdownMenu/dropdown-menu-item.js +80 -0
  110. package/dist/src/components/atoms/dropdownMenu/dropdown-menu-item.js.map +1 -0
  111. package/dist/src/components/atoms/dropdownMenu/dropdown-menu-radio-item.js +118 -0
  112. package/dist/src/components/atoms/dropdownMenu/dropdown-menu-radio-item.js.map +1 -0
  113. package/dist/src/components/atoms/dropdownMenu/dropdown-menu-seperator.js +52 -0
  114. package/dist/src/components/atoms/dropdownMenu/dropdown-menu-seperator.js.map +1 -0
  115. package/dist/src/components/atoms/dropdownMenu/dropdown-menu-shortcut.js +20 -0
  116. package/dist/src/components/atoms/dropdownMenu/dropdown-menu-shortcut.js.map +1 -0
  117. package/dist/src/components/atoms/dropdownMenu/dropdown-menu.atom.js +79 -0
  118. package/dist/src/components/atoms/dropdownMenu/dropdown-menu.atom.js.map +1 -0
  119. package/dist/src/components/atoms/dropdownMenu/dropdownMenu.stories.js +211 -0
  120. package/dist/src/components/atoms/dropdownMenu/dropdownMenu.stories.js.map +1 -0
  121. package/dist/src/components/atoms/dropdownMenu/dropdownMenu.style.js +4 -0
  122. package/dist/src/components/atoms/dropdownMenu/dropdownMenu.style.js.map +1 -0
  123. package/dist/src/components/atoms/index.js +14 -0
  124. package/dist/src/components/atoms/index.js.map +1 -0
  125. package/dist/src/components/atoms/input/input.atom.js +93 -0
  126. package/dist/src/components/atoms/input/input.atom.js.map +1 -0
  127. package/dist/src/components/atoms/input/input.stories.js +382 -0
  128. package/dist/src/components/atoms/input/input.stories.js.map +1 -0
  129. package/dist/src/components/atoms/input/input.styles.js +2 -0
  130. package/dist/src/components/atoms/input/input.styles.js.map +1 -0
  131. package/dist/src/components/atoms/input/input.type.js +2 -0
  132. package/dist/src/components/atoms/input/input.type.js.map +1 -0
  133. package/dist/src/components/atoms/label/label.atom.js +68 -0
  134. package/dist/src/components/atoms/label/label.atom.js.map +1 -0
  135. package/dist/src/components/atoms/label/label.stories.js +85 -0
  136. package/dist/src/components/atoms/label/label.stories.js.map +1 -0
  137. package/dist/src/components/atoms/label/label.style.js +3 -0
  138. package/dist/src/components/atoms/label/label.style.js.map +1 -0
  139. package/dist/src/components/atoms/popover/popover-content.js +64 -0
  140. package/dist/src/components/atoms/popover/popover-content.js.map +1 -0
  141. package/dist/src/components/atoms/popover/popover-trigger.js +51 -0
  142. package/dist/src/components/atoms/popover/popover-trigger.js.map +1 -0
  143. package/dist/src/components/atoms/popover/popover.atom.js +40 -0
  144. package/dist/src/components/atoms/popover/popover.atom.js.map +1 -0
  145. package/dist/src/components/atoms/popover/popover.stories.js +69 -0
  146. package/dist/src/components/atoms/popover/popover.stories.js.map +1 -0
  147. package/dist/src/components/atoms/popover/popover.style.js +21 -0
  148. package/dist/src/components/atoms/popover/popover.style.js.map +1 -0
  149. package/dist/src/components/atoms/popover/popover.types.js +4 -0
  150. package/dist/src/components/atoms/popover/popover.types.js.map +1 -0
  151. package/dist/src/components/atoms/toggle/defs.js +30 -0
  152. package/dist/src/components/atoms/toggle/defs.js.map +1 -0
  153. package/dist/src/components/atoms/toggle/toggle.atom.js +72 -0
  154. package/dist/src/components/atoms/toggle/toggle.atom.js.map +1 -0
  155. package/dist/src/components/atoms/toggle/toggle.stories.js +189 -0
  156. package/dist/src/components/atoms/toggle/toggle.stories.js.map +1 -0
  157. package/dist/src/components/atoms/toggle/toggle.style.js +19 -0
  158. package/dist/src/components/atoms/toggle/toggle.style.js.map +1 -0
  159. package/dist/src/components/command/command.js +410 -0
  160. package/dist/src/components/command/command.js.map +1 -0
  161. package/dist/src/components/command/command.stories.js +153 -0
  162. package/dist/src/components/command/command.stories.js.map +1 -0
  163. package/dist/src/components/index.js +3 -0
  164. package/dist/src/components/index.js.map +1 -0
  165. package/dist/src/components/molecules/command/command.molecules.js +27 -0
  166. package/dist/src/components/molecules/command/command.molecules.js.map +1 -0
  167. package/dist/src/components/molecules/command-input/command-input.atom.js +127 -0
  168. package/dist/src/components/molecules/command-input/command-input.atom.js.map +1 -0
  169. package/dist/src/components/molecules/dropdownMenu/dropdownMenu.molecules.js +2 -0
  170. package/dist/src/components/molecules/dropdownMenu/dropdownMenu.molecules.js.map +1 -0
  171. package/dist/src/components/molecules/index.js +2 -0
  172. package/dist/src/components/molecules/index.js.map +1 -0
  173. package/dist/src/helpers/base-element.js +64 -0
  174. package/dist/src/helpers/base-element.js.map +1 -0
  175. package/dist/src/helpers/index.js +4 -0
  176. package/dist/src/helpers/index.js.map +1 -0
  177. package/dist/src/helpers/mouse-conroller.helper.js +33 -0
  178. package/dist/src/helpers/mouse-conroller.helper.js.map +1 -0
  179. package/dist/src/helpers/style.helpers.js +6 -0
  180. package/dist/src/helpers/style.helpers.js.map +1 -0
  181. package/dist/src/index.js +2 -0
  182. package/dist/src/index.js.map +1 -0
  183. package/dist/src/interfaces/actionable.interface.js +2 -0
  184. package/dist/src/interfaces/actionable.interface.js.map +1 -0
  185. package/dist/src/interfaces/atomic.interface.js +2 -0
  186. package/dist/src/interfaces/atomic.interface.js.map +1 -0
  187. package/dist/src/interfaces/changeable.interface.js +2 -0
  188. package/dist/src/interfaces/changeable.interface.js.map +1 -0
  189. package/dist/src/interfaces/child-support-atomic.interface.js +2 -0
  190. package/dist/src/interfaces/child-support-atomic.interface.js.map +1 -0
  191. package/dist/src/interfaces/index.js +7 -0
  192. package/dist/src/interfaces/index.js.map +1 -0
  193. package/dist/src/interfaces/intractable.interface.js +2 -0
  194. package/dist/src/interfaces/intractable.interface.js.map +1 -0
  195. package/dist/src/interfaces/variant.interface.js +2 -0
  196. package/dist/src/interfaces/variant.interface.js.map +1 -0
  197. package/dist/src/lib/index.js +2 -0
  198. package/dist/src/lib/index.js.map +1 -0
  199. package/dist/src/lib/next/next.lib.js +2 -0
  200. package/dist/src/lib/next/next.lib.js.map +1 -0
  201. package/dist/src/lib/react/react.lib.js +16 -0
  202. package/dist/src/lib/react/react.lib.js.map +1 -0
  203. package/dist/src/lib/tw-styles.js +1956 -0
  204. package/dist/src/lib/tw-styles.js.map +1 -0
  205. package/dist/src/styles/index.js +2 -0
  206. package/dist/src/styles/index.js.map +1 -0
  207. package/dist/src/styles/tw.styles.js +2218 -0
  208. package/dist/src/styles/tw.styles.js.map +1 -0
  209. package/dist/src/wc-ui-app.js +88 -0
  210. package/dist/src/wc-ui-app.js.map +1 -0
  211. package/dist/sw.js +2 -0
  212. package/dist/sw.js.map +1 -0
  213. package/dist/test/wc-ui-app.test.js +18 -0
  214. package/dist/test/wc-ui-app.test.js.map +1 -0
  215. package/dist/tsconfig.tsbuildinfo +1 -0
  216. package/dist/workbox-a523fd56.js +2 -0
  217. package/dist/workbox-a523fd56.js.map +1 -0
  218. package/index.html +18 -66
  219. package/package.json +42 -18
  220. package/rollup.config.js +25 -13
  221. package/src/assets/icons/arrows.icon.ts +20 -0
  222. package/src/assets/icons/index.ts +3 -0
  223. package/src/assets/icons/search.icon.ts +19 -0
  224. package/src/assets/icons/tick.icon.ts +20 -0
  225. package/src/chai-custom.d.ts +0 -0
  226. package/src/components/atoms/alert/alert-description.ts +15 -0
  227. package/src/components/atoms/alert/alert-title.ts +17 -0
  228. package/src/components/atoms/alert/alert.atom.ts +51 -0
  229. package/src/components/atoms/alert/alert.stories.ts +71 -0
  230. package/src/components/atoms/alert/alert.styles.ts +21 -0
  231. package/src/components/atoms/alert/alert.types.ts +1 -0
  232. package/src/components/atoms/badge/badge.atom.ts +40 -0
  233. package/src/components/atoms/badge/badge.stories.ts +118 -0
  234. package/src/components/atoms/badge/badge.style.ts +24 -0
  235. package/src/components/atoms/badge/badge.type.ts +7 -0
  236. package/src/components/atoms/button/button.atom.ts +22 -8
  237. package/src/components/atoms/button/button.stories.ts +177 -139
  238. package/src/components/atoms/card/card-content.ts +15 -0
  239. package/src/components/atoms/card/card-description.ts +15 -0
  240. package/src/components/atoms/card/card-footer.ts +15 -0
  241. package/src/components/atoms/card/card-header.ts +15 -0
  242. package/src/components/atoms/card/card-title.ts +15 -0
  243. package/src/components/atoms/card/card.atom.ts +31 -0
  244. package/src/components/atoms/card/card.stories.ts +149 -0
  245. package/src/components/atoms/checkbox/checkbox.atom.ts +30 -16
  246. package/src/components/atoms/checkbox/checkbox.stories.ts +292 -25
  247. package/src/components/atoms/checkbox/checkbox.style.ts +5 -0
  248. package/src/components/atoms/checkbox/checkbox.type.ts +24 -0
  249. package/src/components/atoms/combo-box/combo-box-input.ts +33 -0
  250. package/src/components/atoms/combo-box/combo-box-item.ts +59 -0
  251. package/src/components/atoms/combo-box/combo-box-list.ts +57 -0
  252. package/src/components/atoms/combo-box/combo-box.atom.ts +187 -0
  253. package/src/components/atoms/combo-box/combo-box.stories.ts +95 -0
  254. package/src/components/atoms/command-empty/command-empty.atom.ts +2 -2
  255. package/src/components/atoms/command-group/command-group.atom.ts +1 -1
  256. package/src/components/atoms/command-item/command-item.atom.ts +2 -2
  257. package/src/components/atoms/command-list/command-list.atom.ts +2 -2
  258. package/src/components/atoms/command-separator/command-separator.atom.ts +2 -2
  259. package/src/components/atoms/dialog/dialog-close.ts +50 -0
  260. package/src/components/atoms/dialog/dialog-content.ts +71 -0
  261. package/src/components/atoms/dialog/dialog-footer.ts +22 -0
  262. package/src/components/atoms/dialog/dialog-header.ts +36 -0
  263. package/src/components/atoms/dialog/dialog-overly.ts +20 -0
  264. package/src/components/atoms/dialog/dialog-trigger.ts +54 -0
  265. package/src/components/atoms/dialog/dialog.atom.ts +3 -226
  266. package/src/components/atoms/dialog/dialog.stories.ts +11 -4
  267. package/src/components/atoms/dropdownMenu/dropdown-menu-checkbox-Item.ts +106 -0
  268. package/src/components/atoms/dropdownMenu/dropdown-menu-content.ts +79 -0
  269. package/src/components/atoms/dropdownMenu/dropdown-menu-group.ts +60 -0
  270. package/src/components/atoms/dropdownMenu/dropdown-menu-item.ts +74 -0
  271. package/src/components/atoms/dropdownMenu/dropdown-menu-radio-item.ts +107 -0
  272. package/src/components/atoms/dropdownMenu/dropdown-menu-seperator.ts +44 -0
  273. package/src/components/atoms/dropdownMenu/dropdown-menu-shortcut.ts +17 -0
  274. package/src/components/atoms/dropdownMenu/dropdown-menu.atom.ts +84 -0
  275. package/src/components/atoms/dropdownMenu/dropdownMenu.stories.ts +220 -0
  276. package/src/components/atoms/dropdownMenu/dropdownMenu.style.ts +7 -0
  277. package/src/components/atoms/index.ts +3 -0
  278. package/src/components/atoms/input/input.atom.ts +64 -10
  279. package/src/components/atoms/input/input.stories.ts +426 -64
  280. package/src/components/atoms/input/input.styles.ts +2 -0
  281. package/src/components/atoms/input/input.type.ts +42 -8
  282. package/src/components/atoms/label/label.atom.ts +31 -7
  283. package/src/components/atoms/label/label.stories.ts +87 -3
  284. package/src/components/atoms/popover/popover-content.ts +58 -0
  285. package/src/components/atoms/popover/popover-trigger.ts +50 -0
  286. package/src/components/atoms/popover/popover.atom.ts +34 -0
  287. package/src/components/atoms/popover/popover.stories.ts +79 -0
  288. package/src/components/atoms/popover/popover.style.ts +25 -0
  289. package/src/components/atoms/popover/popover.types.ts +3 -0
  290. package/src/components/atoms/toggle/defs.ts +29 -0
  291. package/src/components/atoms/toggle/toggle.atom.ts +58 -0
  292. package/src/components/atoms/toggle/toggle.stories.ts +204 -0
  293. package/src/components/atoms/toggle/toggle.style.ts +22 -0
  294. package/src/components/molecules/command/command.molecules.ts +2 -2
  295. package/src/components/molecules/command-input/command-input.atom.ts +3 -3
  296. package/src/components/molecules/dropdownMenu/dropdownMenu.molecules.ts +0 -0
  297. package/src/globals.css +475 -66
  298. package/src/helpers/base-element.ts +79 -0
  299. package/src/helpers/index.ts +1 -0
  300. package/src/index.d.ts +1 -0
  301. package/src/index.ts +1 -0
  302. package/src/lib/react/react.lib.ts +18 -0
  303. package/src/lib/tw-styles.ts +1957 -0
  304. package/src/styles/tw.styles.ts +2051 -1699
  305. package/src/tailwind-lib.css +26 -6
  306. package/tailwind.config.js +174 -38
  307. package/tsconfig.json +6 -1
  308. package/src/components/popover.ts +0 -247
@@ -1,5 +1,5 @@
1
1
  @font-face {
2
- font-family: "GeistSans";
2
+ font-family: 'GeistSans';
3
3
  src: url('assets/fonts/Geist/Geist-Regular.woff2') format('woff2');
4
4
  }
5
5
 
@@ -7,8 +7,6 @@
7
7
  @tailwind components;
8
8
  @tailwind utilities;
9
9
 
10
-
11
-
12
10
  @layer base {
13
11
  :root {
14
12
  --background: 0 0% 100%;
@@ -31,6 +29,18 @@
31
29
  --input: 240 5.9% 90%;
32
30
  --ring: 240 5.9% 10%;
33
31
  --radius: 0.5rem;
32
+ --green-100: #d4f8e8;
33
+ --green-200: #bbf7d0;
34
+ --green-800: #166534;
35
+ --red-100: #fddddd;
36
+ --red-200: #fecaca;
37
+ --red-800: #991b1b;
38
+ --yellow-100: #fef4d9;
39
+ --yellow-200: #fef08a;
40
+ --yellow-800: #854d0e;
41
+ --blue-100: #dbeafe;
42
+ --blue-200: #bfdbfe;
43
+ --blue-800: #1e40af;
34
44
  }
35
45
 
36
46
  .dark {
@@ -53,10 +63,21 @@
53
63
  --border: 240 3.7% 15.9%;
54
64
  --input: 240 3.7% 15.9%;
55
65
  --ring: 240 4.9% 83.9%;
66
+ --green-100: #d4f8e8;
67
+ --green-200: #bbf7d0;
68
+ --green-800: #166534;
69
+ --red-100: #fddddd;
70
+ --red-200: #fecaca;
71
+ --red-800: #991b1b;
72
+ --yellow-100: #fef4d9;
73
+ --yellow-200: #fef08a;
74
+ --yellow-800: #854d0e;
75
+ --blue-100: #dbeafe;
76
+ --blue-200: #bfdbfe;
77
+ --blue-800: #1e40af;
56
78
  }
57
79
  }
58
80
 
59
-
60
81
  @layer base {
61
82
  * {
62
83
  @apply border-border;
@@ -73,7 +94,6 @@
73
94
  margin-top: 6px;
74
95
  margin-block-start: 6px;
75
96
  } */
76
-
77
97
  }
78
98
 
79
99
  @layer utilities {
@@ -92,4 +112,4 @@
92
112
  .container {
93
113
  @apply px-4;
94
114
  }
95
- }
115
+ }
@@ -1,81 +1,217 @@
1
1
  /* eslint-disable global-require */
2
- const { fontFamily } = require("tailwindcss/defaultTheme")
3
-
2
+ const { fontFamily } = require('tailwindcss/defaultTheme');
4
3
 
5
4
  /** @type {import('tailwindcss').Config} */
6
5
  module.exports = {
7
- darkMode: ["class"],
8
- content: ["src/**/*.{ts,tsx}", "index.html"],
6
+ darkMode: ['class'],
7
+ content: ['src/**/*.{ts,tsx}', 'index.html'],
9
8
  theme: {
10
9
  container: {
11
10
  center: true,
12
- padding: "2rem",
11
+ padding: '2rem',
13
12
  screens: {
14
- "2xl": "1400px",
13
+ '2xl': '1400px',
15
14
  },
16
15
  },
17
16
  extend: {
17
+ transform: {
18
+ translateY: [
19
+ '0',
20
+ '0.25rem',
21
+ '0.5rem',
22
+ '0.75rem',
23
+ '1rem',
24
+ '1.25rem',
25
+ '1.5rem',
26
+ '2rem',
27
+ ],
28
+ translateX: [
29
+ '0',
30
+ '0.25rem',
31
+ '0.5rem',
32
+ '0.75rem',
33
+ '1rem',
34
+ '1.25rem',
35
+ '1.5rem',
36
+ '2rem',
37
+ ],
38
+ },
39
+ spacing: {
40
+ 1: '0.25rem',
41
+ 2: '0.5rem',
42
+ 3: '0.75rem',
43
+ 4: '1rem',
44
+ 5: '1.25rem',
45
+ 6: '1.5rem',
46
+ 8: '2rem',
47
+ 10: '2.5rem',
48
+ 12: '3rem',
49
+ 14: '3.5rem',
50
+ 16: '4rem',
51
+ 20: '5rem',
52
+ 24: '6rem',
53
+ 28: '7rem',
54
+ 32: '8rem',
55
+ 36: '9rem',
56
+ 40: '10rem',
57
+ 44: '11rem',
58
+ 48: '12rem',
59
+ 52: '13rem',
60
+ 56: '14rem',
61
+ 60: '15rem',
62
+ 64: '16rem',
63
+ 72: '18rem',
64
+ 80: '20rem',
65
+ 96: '24rem',
66
+ 112: '28rem',
67
+ 128: '32rem',
68
+ },
69
+ padding: {
70
+ 0: '0',
71
+ '1/2': '0.125rem',
72
+ 1: '0.25rem',
73
+ 2: '0.5rem',
74
+ 3: '0.75rem',
75
+ 4: '1rem',
76
+ 5: '1.25rem',
77
+ 6: '1.5rem',
78
+ 8: '2rem',
79
+ 10: '2.5rem',
80
+ 12: '3rem',
81
+ 14: '3.5rem',
82
+ 16: '4rem',
83
+ 20: '5rem',
84
+ 24: '6rem',
85
+ 28: '7rem',
86
+ 32: '8rem',
87
+ 36: '9rem',
88
+ 40: '10rem',
89
+ 44: '11rem',
90
+ 48: '12rem',
91
+ 52: '13rem',
92
+ 56: '14rem',
93
+ 60: '15rem',
94
+ 64: '16rem',
95
+ 72: '18rem',
96
+ 80: '20rem',
97
+ 96: '24rem',
98
+ 112: '28rem',
99
+ 128: '32rem',
100
+ },
101
+ margin: {
102
+ 0: '0',
103
+ '1/2': '0.125rem',
104
+ 1: '0.25rem',
105
+ 2: '0.5rem',
106
+ 3: '0.75rem',
107
+ 4: '1rem',
108
+ 5: '1.25rem',
109
+ 6: '1.5rem',
110
+ 8: '2rem',
111
+ 10: '2.5rem',
112
+ 12: '3rem',
113
+ 14: '3.5rem',
114
+ 16: '4rem',
115
+ 20: '5rem',
116
+ 24: '6rem',
117
+ 28: '7rem',
118
+ 32: '8rem',
119
+ 36: '9rem',
120
+ 40: '10rem',
121
+ 44: '11rem',
122
+ 48: '12rem',
123
+ 52: '13rem',
124
+ 56: '14rem',
125
+ 60: '15rem',
126
+ 64: '16rem',
127
+ 72: '18rem',
128
+ 80: '20rem',
129
+ 96: '24rem',
130
+ 112: '28rem',
131
+ 128: '32rem',
132
+ },
18
133
  colors: {
19
- border: "hsl(var(--border))",
20
- input: "hsl(var(--input))",
21
- ring: "hsl(var(--ring))",
22
- background: "hsl(var(--background))",
23
- foreground: "hsl(var(--foreground))",
134
+ green: {
135
+ 100: 'var(--green-100)',
136
+ 200: 'var(--green-200)',
137
+ 800: 'var(--green-800)',
138
+ },
139
+ red: {
140
+ 100: 'var(--red-100)',
141
+ 200: 'var(--red-200)',
142
+ 800: 'var(--red-800)',
143
+ },
144
+ yellow: {
145
+ 100: 'var(--yellow-100)',
146
+ 200: 'var(--yellow-200)',
147
+ 800: 'var(--yellow-800)',
148
+ },
149
+ blue: {
150
+ 100: 'var(--blue-100)',
151
+ 200: 'var(--blue-200)',
152
+ 800: 'var(--blue-800)',
153
+ },
154
+ border: 'hsl(var(--border))',
155
+ input: 'hsl(var(--input))',
156
+ ring: 'hsl(var(--ring))',
157
+ background: 'hsl(var(--background))',
158
+ foreground: 'hsl(var(--foreground))',
24
159
  primary: {
25
- DEFAULT: "hsl(var(--primary))",
26
- foreground: "hsl(var(--primary-foreground))",
160
+ DEFAULT: 'hsl(var(--primary))',
161
+ foreground: 'hsl(var(--primary-foreground))',
27
162
  },
28
163
  secondary: {
29
- DEFAULT: "hsl(var(--secondary))",
30
- foreground: "hsl(var(--secondary-foreground))",
164
+ DEFAULT: 'hsl(var(--secondary))',
165
+ foreground: 'hsl(var(--secondary-foreground))',
31
166
  },
32
167
  destructive: {
33
- DEFAULT: "hsl(var(--destructive))",
34
- foreground: "hsl(var(--destructive-foreground))",
168
+ DEFAULT: 'hsl(var(--destructive))',
169
+ foreground: 'hsl(var(--destructive-foreground))',
35
170
  },
36
171
  muted: {
37
- DEFAULT: "hsl(var(--muted))",
38
- foreground: "hsl(var(--muted-foreground))",
172
+ DEFAULT: 'hsl(var(--muted))',
173
+ foreground: 'hsl(var(--muted-foreground))',
39
174
  },
40
175
  accent: {
41
- DEFAULT: "hsl(var(--accent))",
42
- foreground: "hsl(var(--accent-foreground))",
176
+ DEFAULT: 'hsl(var(--accent))',
177
+ foreground: 'hsl(var(--accent-foreground))',
43
178
  },
44
179
  popover: {
45
- DEFAULT: "hsl(var(--popover))",
46
- foreground: "hsl(var(--popover-foreground))",
180
+ DEFAULT: 'hsl(var(--popover))',
181
+ foreground: 'hsl(var(--popover-foreground))',
47
182
  },
48
183
  card: {
49
- DEFAULT: "hsl(var(--card))",
50
- foreground: "hsl(var(--card-foreground))",
184
+ DEFAULT: 'hsl(var(--card))',
185
+ foreground: 'hsl(var(--card-foreground))',
51
186
  },
52
187
  },
53
188
  borderRadius: {
54
189
  lg: `var(--radius)`,
55
190
  md: `calc(var(--radius) - 2px)`,
56
- sm: "calc(var(--radius) - 4px)",
191
+ sm: 'calc(var(--radius) - 4px)',
192
+ full: '9999px',
57
193
  },
58
194
  fontFamily: {
59
- sans: ["var(--font-sans)", ...fontFamily.sans],
60
- geist: ["GeistSans", ...fontFamily.sans],
195
+ sans: ['var(--font-sans)', ...fontFamily.sans],
196
+ geist: ['GeistSans', ...fontFamily.sans],
61
197
  // serif: ["var(--font-serif)", ...fontFamily.serif],
62
198
  // mono: ["var(--font-mono)", ...fontFamily.mono],
63
199
  },
64
200
  keyframes: {
65
- "accordion-down": {
66
- from: { height: "0" },
67
- to: { height: "var(--radix-accordion-content-height)" },
201
+ 'accordion-down': {
202
+ from: { height: '0' },
203
+ to: { height: 'var(--radix-accordion-content-height)' },
68
204
  },
69
- "accordion-up": {
70
- from: { height: "var(--radix-accordion-content-height)" },
71
- to: { height: "0" },
205
+ 'accordion-up': {
206
+ from: { height: 'var(--radix-accordion-content-height)' },
207
+ to: { height: '0' },
72
208
  },
73
209
  },
74
210
  animation: {
75
- "accordion-down": "accordion-down 0.2s ease-out",
76
- "accordion-up": "accordion-up 0.2s ease-out",
211
+ 'accordion-down': 'accordion-down 0.2s ease-out',
212
+ 'accordion-up': 'accordion-up 0.2s ease-out',
77
213
  },
78
214
  },
79
215
  },
80
- plugins: [require("tailwindcss-animate")],
81
- }
216
+ plugins: [require('tailwindcss-animate')],
217
+ };
package/tsconfig.json CHANGED
@@ -5,6 +5,8 @@
5
5
  "moduleResolution": "node",
6
6
  "noEmitOnError": true,
7
7
  "lib": ["es2017", "dom"],
8
+ "skipLibCheck": true,
9
+ "types": ["jest"],
8
10
  "strict": true,
9
11
  "allowArbitraryExtensions": false,
10
12
  "esModuleInterop": false,
@@ -21,5 +23,8 @@
21
23
  "@/*": ["./src/*"]
22
24
  }
23
25
  },
24
- "include": ["**/*.ts", "tailwind.config.js"]
26
+ "include": ["**/*.ts", "tailwind.config.js",
27
+ "node_modules/@types/chai",
28
+ "node_modules/@types/mocha",
29
+ "node_modules/@types/jest"]
25
30
  }
@@ -1,247 +0,0 @@
1
- /* eslint-disable no-use-before-define */
2
- import {
3
- LitElement,
4
- html,
5
- css,
6
- nothing,
7
- PropertyValues,
8
- PropertyValueMap,
9
- ReactiveControllerHost,
10
- } from 'lit';
11
- import { customElement, property } from 'lit/decorators.js';
12
- import { cn } from '@/helpers';
13
- import { TWStyles } from '@/styles';
14
-
15
- const STATE_OPEN = 'open';
16
- const STATE_CLOSED = 'closed';
17
-
18
- class PopoverController {
19
- private host: ReactiveControllerHost;
20
-
21
- pos = { x: 0, y: 0 };
22
-
23
- _onMouseMove = ({ clientX, clientY }: MouseEvent) => {
24
- this.pos = { x: clientX, y: clientY };
25
- this.host.requestUpdate();
26
- };
27
-
28
- _onClick = (e: MouseEvent) => {
29
- console.log(`click: ${e.target}`);
30
- console.log(`pos: ${this.pos.x}`);
31
- if (e.y < 100) {
32
- const popover = (this.host as PopoverContent)?._popover;
33
- if (popover && popover.state === STATE_OPEN) {
34
- popover.state = STATE_CLOSED;
35
- }
36
- }
37
- // this.host.requestUpdate();
38
- };
39
-
40
- _onScroll = (e: Event) => {
41
- console.log(`scroll: ${e.target}`);
42
- console.log(`pos: ${this.pos.y}`);
43
- console.log(`pos: ${window.scrollY} ${window.innerHeight}`);
44
- this.host.requestUpdate();
45
- };
46
-
47
- _onResize = (e: UIEvent) => {
48
- console.log(`resize: ${e.target}`);
49
- console.log(`pos: ${window.innerWidth} ${window.innerHeight}`);
50
- this.host.requestUpdate();
51
- };
52
-
53
- constructor(host: ReactiveControllerHost) {
54
- this.host = host;
55
- host.addController(this);
56
- }
57
-
58
- hostConnected() {
59
- window.addEventListener('mousemove', this._onMouseMove);
60
- window.addEventListener('click', this._onClick);
61
- window.addEventListener('scroll', this._onScroll);
62
- window.addEventListener('resize', this._onResize);
63
- }
64
-
65
- hostDisconnected() {
66
- window.removeEventListener('mousemove', this._onMouseMove);
67
- window.removeEventListener('click', this._onClick);
68
- window.removeEventListener('scroll', this._onScroll);
69
- window.removeEventListener('resize', this._onResize);
70
- }
71
- }
72
-
73
- @customElement('rtg-popover')
74
- export class Popover extends LitElement {
75
- static styles = [css``, TWStyles];
76
-
77
- @property({ attribute: 'data-state', type: String }) state = STATE_CLOSED;
78
-
79
- @property({ type: String }) align = 'center';
80
-
81
- @property({ type: Number }) sideOffset = 0;
82
-
83
- get _content(): PopoverContent | null {
84
- const slot = this.shadowRoot?.querySelector('slot');
85
- const children = slot?.assignedElements();
86
- if (children) {
87
- for (let index = 0; index < children.length; index++) {
88
- if (children[index] instanceof PopoverContent) {
89
- return children[index] as PopoverContent;
90
- }
91
- }
92
- }
93
-
94
- return null;
95
- }
96
-
97
- get _trigger(): PopoverTrigger | null {
98
- const slot = this.shadowRoot?.querySelector('slot');
99
- const children = slot?.assignedElements();
100
- if (children) {
101
- for (let index = 0; index < children.length; index++) {
102
- if (children[index] instanceof PopoverTrigger) {
103
- return children[index] as PopoverTrigger;
104
- }
105
- }
106
- }
107
-
108
- return null;
109
- }
110
-
111
- protected updated(_changedProperties: PropertyValues): void {
112
- super.updated(_changedProperties);
113
- const content = this._content;
114
- if (content) {
115
- content.dataset.state = this.state;
116
- }
117
- }
118
-
119
- render() {
120
- return html`
121
- <div rtgpop-root>
122
- <slot></slot>
123
- </div>
124
- `;
125
- }
126
- }
127
-
128
- @customElement('rtg-popover-content')
129
- export class PopoverContent extends LitElement {
130
- static styles = [css``, TWStyles];
131
-
132
- @property({ attribute: 'data-state', type: String }) state = STATE_CLOSED;
133
-
134
- @property({ attribute: 'data-side', type: String }) side = 'bottom';
135
-
136
- private controller = new PopoverController(this);
137
-
138
- public get _popover(): Popover | null {
139
- let parent = this.parentElement;
140
-
141
- while (parent) {
142
- if (parent instanceof Popover) {
143
- return parent;
144
- }
145
- parent = parent.parentElement;
146
- }
147
- return parent;
148
- }
149
-
150
- public get _box(): DOMRect {
151
- return this.firstElementChild!.getBoundingClientRect();
152
- }
153
-
154
- public get _triggerBox(): DOMRect {
155
- return this._popover!._trigger!.getBoundingClientRect();
156
- }
157
-
158
- private handleCloseButtonClick = () => {
159
- const popover = this._popover;
160
- if (popover) {
161
- popover.dataset.state = STATE_CLOSED;
162
- }
163
- };
164
-
165
- render() {
166
- let top = 0;
167
- const box = this._box;
168
- const triggerBox = this._triggerBox;
169
- if (this.side === 'bottom') {
170
- top = triggerBox.top + triggerBox.height;
171
- if (top + box.height > window.innerHeight) {
172
- top = triggerBox.top - box.height;
173
- }
174
- }
175
-
176
- if (this.side === 'top') {
177
- top = triggerBox.top - box.height;
178
- if (top < 0) {
179
- top = triggerBox.top + triggerBox.height;
180
- }
181
- }
182
-
183
- return html`${this.state === STATE_OPEN
184
- ? html`
185
- <div
186
- style="position: fixed; left: 0px; top: 0px; transform: translate(638px, ${top}px); min-width: max-content; --radix-popper-transform-origin: 50% 0px; z-index: 50; --radix-popper-available-width: ${window.innerWidth}px; --radix-popper-available-height: ${window.innerHeight}px; --radix-popper-anchor-width: 127.046875px; --radix-popper-anchor-height: 36px;"
187
- >
188
- <div
189
- class="${cn(
190
- 'z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2',
191
- this.className
192
- )}"
193
- rtgpop-content
194
- >
195
- <slot></slot>
196
- </div>
197
- </div>
198
- `
199
- : nothing}`;
200
- }
201
- }
202
-
203
- @customElement('rtg-popover-trigger')
204
- export class PopoverTrigger extends LitElement {
205
- static styles = [css``, TWStyles];
206
-
207
- private get _popover(): Popover | null {
208
- let parent = this.parentElement;
209
-
210
- while (parent) {
211
- if (parent instanceof Popover) {
212
- return parent;
213
- }
214
- parent = parent.parentElement;
215
- }
216
- return parent;
217
- }
218
-
219
- protected firstUpdated(
220
- _changedProperties: PropertyValueMap<any> | Map<PropertyKey, unknown>
221
- ): void {
222
- super.firstUpdated(_changedProperties);
223
- const slot = this.shadowRoot?.querySelector('slot');
224
- const children = slot?.assignedElements();
225
- if (children && children.length > 0) {
226
- const button = children[0];
227
-
228
- button.addEventListener('click', () => {
229
- const popover = this._popover;
230
- if (popover) {
231
- popover._content!.dataset.side = 'top';
232
- popover.dataset.state = STATE_OPEN;
233
- popover.dataset.state = STATE_CLOSED;
234
- popover.dataset.state = STATE_OPEN;
235
- }
236
- });
237
- }
238
- }
239
-
240
- render() {
241
- return html`
242
- <div>
243
- <slot></slot>
244
- </div>
245
- `;
246
- }
247
- }