@kubex/zinc 0.0.2 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (604) hide show
  1. package/.editorconfig +18 -0
  2. package/.eslintignore +8 -0
  3. package/.eslintrc.cjs +208 -0
  4. package/.github/workflows/eleventy_build.yml +42 -0
  5. package/.github/workflows/js_build_and_deploy.yaml +62 -0
  6. package/custom-elements-manifest.config.js +230 -0
  7. package/custom-elements.json +24227 -0
  8. package/docs/_includes/component.njk +340 -0
  9. package/docs/_includes/default.njk +137 -0
  10. package/docs/_includes/sidebar.njk +24 -0
  11. package/docs/_utilities/active-links.cjs +41 -0
  12. package/docs/_utilities/anchor-headings.cjs +74 -0
  13. package/docs/_utilities/cem.cjs +89 -0
  14. package/docs/_utilities/code-previews.cjs +98 -0
  15. package/docs/_utilities/copy-code-buttons.cjs +26 -0
  16. package/docs/_utilities/external-links.cjs +53 -0
  17. package/docs/_utilities/highlight-code.cjs +74 -0
  18. package/docs/_utilities/markdown.cjs +74 -0
  19. package/docs/_utilities/prettier.cjs +26 -0
  20. package/docs/_utilities/replacer.cjs +24 -0
  21. package/docs/_utilities/scrolling-tables.cjs +23 -0
  22. package/docs/_utilities/strings.cjs +16 -0
  23. package/docs/_utilities/table-of-contents.cjs +48 -0
  24. package/docs/_utilities/typography.cjs +24 -0
  25. package/docs/assets/icons.json +57989 -0
  26. package/docs/assets/images/chrome.png +0 -0
  27. package/docs/assets/images/edge.png +0 -0
  28. package/docs/assets/images/firefox.png +0 -0
  29. package/docs/assets/images/opera.png +0 -0
  30. package/docs/assets/images/safari.png +0 -0
  31. package/docs/assets/images/watermark.svg +1 -0
  32. package/docs/assets/rip.js +78 -0
  33. package/docs/assets/scripts/code-previews.js +250 -0
  34. package/docs/assets/scripts/docs.js +374 -0
  35. package/docs/assets/scripts/search.js +441 -0
  36. package/docs/assets/scripts/turbo.js +29 -0
  37. package/docs/assets/styles/code-previews.css +169 -0
  38. package/docs/assets/styles/docs.css +1168 -0
  39. package/docs/assets/styles/search.css +347 -0
  40. package/docs/eleventy.config.cjs +262 -0
  41. package/docs/pages/components/absolute-container.md +35 -0
  42. package/docs/pages/components/action-bar.md +58 -0
  43. package/docs/pages/components/alert.md +45 -0
  44. package/docs/pages/components/bulk-actions.md +26 -0
  45. package/docs/pages/components/button-group.md +78 -0
  46. package/docs/pages/components/button-menu.md +127 -0
  47. package/docs/pages/components/button.md +80 -0
  48. package/docs/pages/components/chart.md +27 -0
  49. package/docs/pages/components/checkbox-group.md +196 -0
  50. package/docs/pages/components/checkbox.md +157 -0
  51. package/docs/pages/components/chip.md +61 -0
  52. package/docs/pages/components/collapsible.md +52 -0
  53. package/docs/pages/components/cols.md +66 -0
  54. package/docs/pages/components/confirm.md +52 -0
  55. package/docs/pages/components/content-block.md +108 -0
  56. package/docs/pages/components/copy-button.md +22 -0
  57. package/docs/pages/components/data-select.md +54 -0
  58. package/docs/pages/components/data-table-filter.md +23 -0
  59. package/docs/pages/components/data-table-sort.md +20 -0
  60. package/docs/pages/components/data-table.md +74 -0
  61. package/docs/pages/components/datepicker.md +25 -0
  62. package/docs/pages/components/defined-label.md +26 -0
  63. package/docs/pages/components/dialog.md +145 -0
  64. package/docs/pages/components/dropdown.md +22 -0
  65. package/docs/pages/components/editor.md +26 -0
  66. package/docs/pages/components/empty-state.md +51 -0
  67. package/docs/pages/components/expanding-action.md +55 -0
  68. package/docs/pages/components/file.md +45 -0
  69. package/docs/pages/components/form-group.md +22 -0
  70. package/docs/pages/components/header.md +103 -0
  71. package/docs/pages/components/icon.md +322 -0
  72. package/docs/pages/components/inline-edit.md +41 -0
  73. package/docs/pages/components/input.md +261 -0
  74. package/docs/pages/components/item.md +78 -0
  75. package/docs/pages/components/linked-select.md +41 -0
  76. package/docs/pages/components/menu-item.md +22 -0
  77. package/docs/pages/components/menu.md +36 -0
  78. package/docs/pages/components/navbar.md +57 -0
  79. package/docs/pages/components/note.md +55 -0
  80. package/docs/pages/components/option.md +22 -0
  81. package/docs/pages/components/order-table.md +22 -0
  82. package/docs/pages/components/page-nav.md +23 -0
  83. package/docs/pages/components/pagination.md +22 -0
  84. package/docs/pages/components/pane.md +22 -0
  85. package/docs/pages/components/panel.md +124 -0
  86. package/docs/pages/components/popup.md +22 -0
  87. package/docs/pages/components/progress-bar.md +22 -0
  88. package/docs/pages/components/progress-tile.md +22 -0
  89. package/docs/pages/components/query-builder.md +148 -0
  90. package/docs/pages/components/radio-group.md +129 -0
  91. package/docs/pages/components/radio.md +20 -0
  92. package/docs/pages/components/rating.md +28 -0
  93. package/docs/pages/components/scroll-container.md +22 -0
  94. package/docs/pages/components/select.md +452 -0
  95. package/docs/pages/components/sidebar.md +28 -0
  96. package/docs/pages/components/simple-chart.md +23 -0
  97. package/docs/pages/components/skeleton.md +70 -0
  98. package/docs/pages/components/slideout.md +23 -0
  99. package/docs/pages/components/sp.md +87 -0
  100. package/docs/pages/components/split-button.md +32 -0
  101. package/docs/pages/components/split-pane.md +22 -0
  102. package/docs/pages/components/stat.md +24 -0
  103. package/docs/pages/components/status-indicator.md +13 -0
  104. package/docs/pages/components/stepper.md +20 -0
  105. package/docs/pages/components/style.md +106 -0
  106. package/docs/pages/components/table.md +22 -0
  107. package/docs/pages/components/tabs.md +57 -0
  108. package/docs/pages/components/textarea.md +120 -0
  109. package/docs/pages/components/tile-property.md +29 -0
  110. package/docs/pages/components/tile.md +51 -0
  111. package/docs/pages/components/timer.md +22 -0
  112. package/docs/pages/components/toggle.md +22 -0
  113. package/docs/pages/components/tooltip.md +242 -0
  114. package/docs/pages/components/vertical-stepper.md +22 -0
  115. package/docs/pages/components/well.md +13 -0
  116. package/docs/pages/getting-started/example-layout.md +143 -0
  117. package/docs/pages/getting-started/example-page.md +83 -0
  118. package/docs/pages/getting-started/form-controls.md +552 -0
  119. package/docs/pages/getting-started/form-examples.md +122 -0
  120. package/docs/pages/getting-started/table-examples.md +43 -0
  121. package/docs/pages/index.md +32 -0
  122. package/index.html +22 -0
  123. package/package.json +111 -11
  124. package/scripts/build.js +381 -0
  125. package/scripts/generator/generator.js +102 -0
  126. package/scripts/generator/index.js +17 -0
  127. package/scripts/generator/preprocess.js +20 -0
  128. package/scripts/generator/resolver.js +86 -0
  129. package/scripts/generator/tailwind.config.js +14 -0
  130. package/scripts/make-metadata.js +10 -0
  131. package/scripts/make-themes.js +27 -0
  132. package/scripts/plop/plopfile.js +63 -0
  133. package/scripts/plop/templates/component.hbs +43 -0
  134. package/scripts/plop/templates/define.hbs +12 -0
  135. package/scripts/plop/templates/docs.hbs +20 -0
  136. package/scripts/plop/templates/style.hbs +5 -0
  137. package/scripts/plop/templates/test.hbs +10 -0
  138. package/scss/_global-components.scss +4 -0
  139. package/scss/_global-spacing.scss +96 -0
  140. package/scss/_root.scss +202 -0
  141. package/scss/boot.scss +29 -0
  142. package/scss/mixins/_helper-mixins.scss +24 -0
  143. package/scss/mixins/_spacing-mixins.scss +84 -0
  144. package/scss/mixins/index.scss +2 -0
  145. package/scss/shared/_base.scss +138 -0
  146. package/scss/shared/_button.scss +27 -0
  147. package/scss/shared/_form-elements.scss +162 -0
  148. package/scss/shared/_opacity.scss +27 -0
  149. package/scss/shared/_reset.scss +288 -0
  150. package/scss/shared/_table.scss +73 -0
  151. package/scss/shared/divide.scss +41 -0
  152. package/scss/shared/index.scss +12 -0
  153. package/scss/shared/layout.scss +290 -0
  154. package/scss/shared/nav.scss +71 -0
  155. package/scss/themes/_dark.scss +277 -0
  156. package/scss/themes/_index.scss +3 -0
  157. package/scss/themes/_light.scss +540 -0
  158. package/scss/themes/_utility.scss +44 -0
  159. package/scss/variables/_spacing.scss +35 -0
  160. package/scss/variables/index.scss +1 -0
  161. package/src/components/absolute-container/absolute-container.component.ts +62 -0
  162. package/src/components/absolute-container/absolute-container.test.ts +10 -0
  163. package/src/components/absolute-container/index.ts +12 -0
  164. package/src/components/action-bar/action-bar.component.ts +41 -0
  165. package/src/components/action-bar/action-bar.scss +33 -0
  166. package/src/components/action-bar/action-bar.test.ts +10 -0
  167. package/src/components/action-bar/index.ts +12 -0
  168. package/src/components/alert/alert.component.ts +71 -0
  169. package/src/components/alert/alert.scss +170 -0
  170. package/src/components/alert/alert.test.ts +10 -0
  171. package/src/components/alert/index.ts +12 -0
  172. package/src/components/bulk-actions/bulk-actions.component.ts +229 -0
  173. package/src/components/bulk-actions/bulk-actions.scss +56 -0
  174. package/src/components/bulk-actions/bulk-actions.test.ts +10 -0
  175. package/src/components/bulk-actions/index.ts +12 -0
  176. package/src/components/button/button.component.ts +242 -0
  177. package/src/components/button/button.scss +346 -0
  178. package/src/components/button/button.test.ts +32 -0
  179. package/src/components/button/index.ts +12 -0
  180. package/src/components/button-group/button-group.component.ts +74 -0
  181. package/src/components/button-group/button-group.scss +39 -0
  182. package/src/components/button-group/button-group.test.ts +10 -0
  183. package/src/components/button-group/index.ts +12 -0
  184. package/src/components/button-menu/button-menu.component.ts +353 -0
  185. package/src/components/button-menu/button-menu.scss +41 -0
  186. package/src/components/button-menu/button-menu.test.ts +10 -0
  187. package/src/components/button-menu/index.ts +12 -0
  188. package/src/components/chart/chart.component.ts +206 -0
  189. package/src/components/chart/chart.scss +11 -0
  190. package/src/components/chart/chart.test.ts +10 -0
  191. package/src/components/chart/index.ts +12 -0
  192. package/src/components/checkbox/checkbox.component.ts +326 -0
  193. package/src/components/checkbox/checkbox.scss +202 -0
  194. package/src/components/checkbox/checkbox.test.ts +10 -0
  195. package/src/components/checkbox/index.ts +12 -0
  196. package/src/components/checkbox-group/checkbox-group.component.ts +351 -0
  197. package/src/components/checkbox-group/checkbox-group.scss +60 -0
  198. package/src/components/checkbox-group/checkbox-group.test.ts +10 -0
  199. package/src/components/checkbox-group/index.ts +12 -0
  200. package/src/components/chip/chip.component.ts +70 -0
  201. package/src/components/chip/chip.scss +101 -0
  202. package/src/components/chip/chip.test.ts +10 -0
  203. package/src/components/chip/index.ts +12 -0
  204. package/src/components/collapsible/collapsible.component.ts +86 -0
  205. package/src/components/collapsible/collapsible.scss +100 -0
  206. package/src/components/collapsible/collapsible.test.ts +10 -0
  207. package/src/components/collapsible/index.ts +12 -0
  208. package/src/components/cols/cols.component.ts +76 -0
  209. package/src/components/cols/cols.scss +99 -0
  210. package/src/components/cols/cols.test.ts +10 -0
  211. package/src/components/cols/index.ts +12 -0
  212. package/src/components/confirm/confirm.component.ts +181 -0
  213. package/src/components/confirm/confirm.scss +44 -0
  214. package/src/components/confirm/confirm.test.ts +10 -0
  215. package/src/components/confirm/index.ts +12 -0
  216. package/src/components/content-block/content-block.component.ts +225 -0
  217. package/src/components/content-block/content-block.scss +64 -0
  218. package/src/components/content-block/content-block.test.ts +10 -0
  219. package/src/components/content-block/index.ts +12 -0
  220. package/src/components/copy-button/copy-button.component.ts +163 -0
  221. package/src/components/copy-button/copy-button.scss +47 -0
  222. package/src/components/copy-button/copy-button.test.ts +10 -0
  223. package/src/components/copy-button/index.ts +12 -0
  224. package/src/components/data-select/data-select.component.ts +219 -0
  225. package/src/components/data-select/data-select.scss +43 -0
  226. package/src/components/data-select/data-select.test.ts +10 -0
  227. package/src/components/data-select/index.ts +12 -0
  228. package/src/components/data-select/providers/color-data-provider.ts +16 -0
  229. package/src/components/data-select/providers/country-code-data-provider.ts +517 -0
  230. package/src/components/data-select/providers/country-data-provider.ts +527 -0
  231. package/src/components/data-select/providers/currency-data-provider.ts +328 -0
  232. package/src/components/data-select/providers/provider.ts +32 -0
  233. package/src/components/data-table/data-table.component.ts +1093 -0
  234. package/src/components/data-table/data-table.scss +330 -0
  235. package/src/components/data-table/data-table.test.ts +10 -0
  236. package/src/components/data-table/index.ts +12 -0
  237. package/src/components/data-table-filter/data-table-filter.component.ts +126 -0
  238. package/src/components/data-table-filter/data-table-filter.scss +22 -0
  239. package/src/components/data-table-filter/data-table-filter.test.ts +10 -0
  240. package/src/components/data-table-filter/index.ts +12 -0
  241. package/src/components/data-table-sort/data-table-sort.component.ts +56 -0
  242. package/src/components/data-table-sort/data-table-sort.scss +37 -0
  243. package/src/components/data-table-sort/data-table-sort.test.ts +10 -0
  244. package/src/components/data-table-sort/index.ts +12 -0
  245. package/src/components/datepicker/datepicker.component.ts +315 -0
  246. package/src/components/datepicker/datepicker.scss +237 -0
  247. package/src/components/datepicker/datepicker.test.ts +10 -0
  248. package/src/components/datepicker/index.ts +12 -0
  249. package/src/components/defined-label/defined-label.component.ts +241 -0
  250. package/src/components/defined-label/defined-label.scss +43 -0
  251. package/src/components/defined-label/defined-label.test.ts +10 -0
  252. package/src/components/defined-label/index.ts +12 -0
  253. package/src/components/dialog/dialog.component.ts +237 -0
  254. package/src/components/dialog/dialog.scss +197 -0
  255. package/src/components/dialog/dialog.test.ts +10 -0
  256. package/src/components/dialog/index.ts +12 -0
  257. package/src/components/dropdown/dropdown.component.ts +380 -0
  258. package/src/components/dropdown/dropdown.scss +9 -0
  259. package/src/components/dropdown/dropdown.test.ts +10 -0
  260. package/src/components/dropdown/index.ts +12 -0
  261. package/src/components/editor/editor.component.ts +423 -0
  262. package/src/components/editor/editor.scss +131 -0
  263. package/src/components/editor/editor.test.ts +10 -0
  264. package/src/components/editor/index.ts +12 -0
  265. package/src/components/editor/modules/attachment-module.ts +195 -0
  266. package/src/components/editor/modules/dialog-module/dialog-module.component.ts +289 -0
  267. package/src/components/editor/modules/dialog-module/dialog-module.scss +115 -0
  268. package/src/components/editor/modules/dialog-module/dialog-module.ts +99 -0
  269. package/src/components/editor/modules/drag-drop-module.ts +125 -0
  270. package/src/components/editor/modules/events/zn-command-select.ts +7 -0
  271. package/src/components/editor/modules/events/zn-editor-update.ts +7 -0
  272. package/src/components/editor/modules/events/zn-show-canned-response-dialog.ts +15 -0
  273. package/src/components/editor/modules/image-resize-module/image-resize-module.ts +157 -0
  274. package/src/components/editor/modules/menu-module/menu-module.component.ts +149 -0
  275. package/src/components/editor/modules/menu-module/menu-module.scss +17 -0
  276. package/src/components/editor/modules/menu-module/menu-module.ts +203 -0
  277. package/src/components/editor/modules/time-tracking-module.ts +35 -0
  278. package/src/components/empty-state/empty-state.component.ts +63 -0
  279. package/src/components/empty-state/empty-state.scss +91 -0
  280. package/src/components/empty-state/empty-state.test.ts +10 -0
  281. package/src/components/empty-state/index.ts +12 -0
  282. package/src/components/expanding-action/expanding-action.component.ts +312 -0
  283. package/src/components/expanding-action/expanding-action.scss +87 -0
  284. package/src/components/expanding-action/expanding-action.test.ts +10 -0
  285. package/src/components/expanding-action/index.ts +12 -0
  286. package/src/components/file/file.component.ts +619 -0
  287. package/src/components/file/file.scss +200 -0
  288. package/src/components/file/file.test.ts +10 -0
  289. package/src/components/file/index.ts +12 -0
  290. package/src/components/form-group/form-group.component.ts +93 -0
  291. package/src/components/form-group/form-group.scss +84 -0
  292. package/src/components/form-group/form-group.test.ts +10 -0
  293. package/src/components/form-group/index.ts +12 -0
  294. package/src/components/header/header.component.ts +186 -0
  295. package/src/components/header/header.scss +244 -0
  296. package/src/components/header/header.test.ts +10 -0
  297. package/src/components/header/index.ts +12 -0
  298. package/src/components/hover-container/hover-container.component.ts +214 -0
  299. package/src/components/hover-container/hover-container.scss +59 -0
  300. package/src/components/hover-container/hover-container.ts +10 -0
  301. package/src/components/hover-container/index.ts +12 -0
  302. package/src/components/icon/icon.component.ts +251 -0
  303. package/src/components/icon/icon.scss +186 -0
  304. package/src/components/icon/icon.test.ts +10 -0
  305. package/src/components/icon/index.ts +13 -0
  306. package/src/components/icon/lni.scss +2492 -0
  307. package/src/components/inline-edit/index.ts +12 -0
  308. package/src/components/inline-edit/inline-edit.component.ts +289 -0
  309. package/src/components/inline-edit/inline-edit.scss +139 -0
  310. package/src/components/inline-edit/inline-edit.test.ts +10 -0
  311. package/src/components/input/index.ts +12 -0
  312. package/src/components/input/input.component.ts +614 -0
  313. package/src/components/input/input.scss +355 -0
  314. package/src/components/input/input.test.ts +10 -0
  315. package/src/components/item/index.ts +12 -0
  316. package/src/components/item/item.component.ts +102 -0
  317. package/src/components/item/item.scss +161 -0
  318. package/src/components/item/item.test.ts +10 -0
  319. package/src/components/linked-select/index.ts +12 -0
  320. package/src/components/linked-select/linked-select.component.ts +156 -0
  321. package/src/components/linked-select/linked-select.scss +9 -0
  322. package/src/components/linked-select/linked-select.test.ts +17 -0
  323. package/src/components/menu/index.ts +12 -0
  324. package/src/components/menu/menu.component.ts +243 -0
  325. package/src/components/menu/menu.scss +14 -0
  326. package/src/components/menu/menu.test.ts +10 -0
  327. package/src/components/menu-item/index.ts +12 -0
  328. package/src/components/menu-item/menu-item.component.ts +220 -0
  329. package/src/components/menu-item/menu-item.scss +157 -0
  330. package/src/components/menu-item/menu-item.test.ts +10 -0
  331. package/src/components/menu-item/submenu-controller.ts +291 -0
  332. package/src/components/navbar/index.ts +12 -0
  333. package/src/components/navbar/navbar.component.ts +240 -0
  334. package/src/components/navbar/navbar.scss +411 -0
  335. package/src/components/navbar/navbar.test.ts +10 -0
  336. package/src/components/note/index.ts +12 -0
  337. package/src/components/note/note.component.ts +60 -0
  338. package/src/components/note/note.scss +69 -0
  339. package/src/components/note/note.test.ts +10 -0
  340. package/src/components/option/index.ts +12 -0
  341. package/src/components/option/option.component.ts +152 -0
  342. package/src/components/option/option.scss +88 -0
  343. package/src/components/option/option.test.ts +10 -0
  344. package/src/components/order-table/index.ts +12 -0
  345. package/src/components/order-table/order-table.component.ts +323 -0
  346. package/src/components/order-table/order-table.scss +154 -0
  347. package/src/components/order-table/order-table.test.ts +10 -0
  348. package/src/components/page-nav/index.ts +12 -0
  349. package/src/components/page-nav/page-nav.component.ts +117 -0
  350. package/src/components/page-nav/page-nav.scss +155 -0
  351. package/src/components/page-nav/page-nav.test.ts +10 -0
  352. package/src/components/pagination/index.ts +12 -0
  353. package/src/components/pagination/pagination.component.ts +91 -0
  354. package/src/components/pagination/pagination.scss +76 -0
  355. package/src/components/pagination/pagination.test.ts +10 -0
  356. package/src/components/pane/index.ts +12 -0
  357. package/src/components/pane/pane.component.ts +52 -0
  358. package/src/components/pane/pane.scss +45 -0
  359. package/src/components/pane/pane.test.ts +10 -0
  360. package/src/components/panel/index.ts +12 -0
  361. package/src/components/panel/panel.component.ts +100 -0
  362. package/src/components/panel/panel.scss +129 -0
  363. package/src/components/panel/panel.test.ts +10 -0
  364. package/src/components/popup/index.ts +12 -0
  365. package/src/components/popup/popup.component.ts +543 -0
  366. package/src/components/popup/popup.scss +59 -0
  367. package/src/components/popup/popup.test.ts +10 -0
  368. package/src/components/progress-bar/index.ts +12 -0
  369. package/src/components/progress-bar/progress-bar.component.ts +80 -0
  370. package/src/components/progress-bar/progress-bar.scss +46 -0
  371. package/src/components/progress-bar/progress-bar.test.ts +10 -0
  372. package/src/components/progress-tile/index.ts +12 -0
  373. package/src/components/progress-tile/progress-tile.component.ts +127 -0
  374. package/src/components/progress-tile/progress-tile.scss +116 -0
  375. package/src/components/progress-tile/progress-tile.test.ts +10 -0
  376. package/src/components/query-builder/index.ts +12 -0
  377. package/src/components/query-builder/query-builder.component.ts +544 -0
  378. package/src/components/query-builder/query-builder.scss +53 -0
  379. package/src/components/query-builder/query-builder.test.ts +10 -0
  380. package/src/components/radio/index.ts +12 -0
  381. package/src/components/radio/radio.component.ts +305 -0
  382. package/src/components/radio/radio.scss +197 -0
  383. package/src/components/radio/radio.test.ts +10 -0
  384. package/src/components/radio-group/index.ts +12 -0
  385. package/src/components/radio-group/radio-group.component.ts +362 -0
  386. package/src/components/radio-group/radio-group.scss +60 -0
  387. package/src/components/radio-group/radio-group.test.ts +10 -0
  388. package/src/components/rating/index.ts +12 -0
  389. package/src/components/rating/rating.component.ts +235 -0
  390. package/src/components/rating/rating.scss +82 -0
  391. package/src/components/rating/rating.test.ts +10 -0
  392. package/src/components/scroll-container/index.ts +12 -0
  393. package/src/components/scroll-container/scroll-container.component.ts +41 -0
  394. package/src/components/scroll-container/scroll-container.scss +17 -0
  395. package/src/components/scroll-container/scroll-container.test.ts +10 -0
  396. package/src/components/select/index.ts +12 -0
  397. package/src/components/select/select.component.ts +984 -0
  398. package/src/components/select/select.scss +325 -0
  399. package/src/components/select/select.test.ts +10 -0
  400. package/src/components/sidebar/index.ts +12 -0
  401. package/src/components/sidebar/sidebar.component.ts +98 -0
  402. package/src/components/sidebar/sidebar.scss +294 -0
  403. package/src/components/sidebar/sidebar.test.ts +10 -0
  404. package/src/components/simple-chart/index.ts +12 -0
  405. package/src/components/simple-chart/simple-chart.component.ts +204 -0
  406. package/src/components/simple-chart/simple-chart.scss +9 -0
  407. package/src/components/simple-chart/simple-chart.test.ts +10 -0
  408. package/src/components/skeleton/index.ts +12 -0
  409. package/src/components/skeleton/skeleton.component.ts +34 -0
  410. package/src/components/skeleton/skeleton.scss +39 -0
  411. package/src/components/skeleton/skeleton.test.ts +10 -0
  412. package/src/components/slideout/index.ts +12 -0
  413. package/src/components/slideout/slideout.component.ts +223 -0
  414. package/src/components/slideout/slideout.scss +96 -0
  415. package/src/components/slideout/slideout.test.ts +10 -0
  416. package/src/components/sp/index.ts +12 -0
  417. package/src/components/sp/sp.component.ts +86 -0
  418. package/src/components/sp/sp.scss +88 -0
  419. package/src/components/sp/sp.test.ts +10 -0
  420. package/src/components/split-button/index.ts +12 -0
  421. package/src/components/split-button/split-button.component.ts +154 -0
  422. package/src/components/split-button/split-button.scss +9 -0
  423. package/src/components/split-button/split-button.test.ts +10 -0
  424. package/src/components/split-pane/index.ts +12 -0
  425. package/src/components/split-pane/split-pane.component.ts +195 -0
  426. package/src/components/split-pane/split-pane.scss +303 -0
  427. package/src/components/split-pane/split-pane.test.ts +10 -0
  428. package/src/components/stat/index.ts +12 -0
  429. package/src/components/stat/stat.component.ts +117 -0
  430. package/src/components/stat/stat.scss +92 -0
  431. package/src/components/stat/stat.test.ts +10 -0
  432. package/src/components/status-indicator/index.ts +12 -0
  433. package/src/components/status-indicator/status-indicator.component.ts +31 -0
  434. package/src/components/status-indicator/status-indicator.scss +32 -0
  435. package/src/components/status-indicator/status-indicator.test.ts +10 -0
  436. package/src/components/stepper/index.ts +12 -0
  437. package/src/components/stepper/stepper.component.ts +80 -0
  438. package/src/components/stepper/stepper.scss +88 -0
  439. package/src/components/stepper/stepper.test.ts +10 -0
  440. package/src/components/style/index.ts +12 -0
  441. package/src/components/style/style.component.ts +150 -0
  442. package/src/components/style/style.scss +1 -0
  443. package/src/components/style/style.test.ts +10 -0
  444. package/src/components/table/index.ts +12 -0
  445. package/src/components/table/table.component.ts +297 -0
  446. package/src/components/table/table.scss +209 -0
  447. package/src/components/table/table.test.ts +10 -0
  448. package/src/components/tabs/index.ts +12 -0
  449. package/src/components/tabs/tabs.component.ts +496 -0
  450. package/src/components/tabs/tabs.scss +147 -0
  451. package/src/components/tabs/tabs.test.ts +10 -0
  452. package/src/components/textarea/index.ts +12 -0
  453. package/src/components/textarea/textarea.component.ts +417 -0
  454. package/src/components/textarea/textarea.scss +152 -0
  455. package/src/components/textarea/textarea.test.ts +10 -0
  456. package/src/components/tile/index.ts +12 -0
  457. package/src/components/tile/tile.component.ts +105 -0
  458. package/src/components/tile/tile.scss +144 -0
  459. package/src/components/tile/tile.test.ts +10 -0
  460. package/src/components/tile-property/index.ts +12 -0
  461. package/src/components/tile-property/tile-property.component.ts +43 -0
  462. package/src/components/tile-property/tile-property.scss +43 -0
  463. package/src/components/tile-property/tile-property.test.ts +10 -0
  464. package/src/components/timer/index.ts +12 -0
  465. package/src/components/timer/timer.component.ts +88 -0
  466. package/src/components/timer/timer.scss +40 -0
  467. package/src/components/timer/timer.test.ts +10 -0
  468. package/src/components/toggle/index.ts +12 -0
  469. package/src/components/toggle/toggle.component.ts +203 -0
  470. package/src/components/toggle/toggle.scss +93 -0
  471. package/src/components/toggle/toggle.test.ts +10 -0
  472. package/src/components/tooltip/index.ts +12 -0
  473. package/src/components/tooltip/tooltip.component.ts +215 -0
  474. package/src/components/tooltip/tooltip.scss +43 -0
  475. package/src/components/tooltip/tooltip.test.ts +10 -0
  476. package/src/components/vertical-stepper/index.ts +12 -0
  477. package/src/components/vertical-stepper/vertical-stepper.component.ts +53 -0
  478. package/src/components/vertical-stepper/vertical-stepper.scss +84 -0
  479. package/src/components/vertical-stepper/vertical-stepper.test.ts +10 -0
  480. package/src/components/well/index.ts +12 -0
  481. package/src/components/well/well.component.ts +43 -0
  482. package/src/components/well/well.scss +19 -0
  483. package/src/components/well/well.test.ts +10 -0
  484. package/src/declaration.d.ts +39 -0
  485. package/src/events/events.ts +7 -0
  486. package/src/events/zn-after-collapse.ts +7 -0
  487. package/src/events/zn-after-expand.ts +7 -0
  488. package/src/events/zn-after-hide.ts +7 -0
  489. package/src/events/zn-after-show.ts +7 -0
  490. package/src/events/zn-blur.ts +7 -0
  491. package/src/events/zn-cancel.ts +7 -0
  492. package/src/events/zn-change.ts +7 -0
  493. package/src/events/zn-clear.ts +7 -0
  494. package/src/events/zn-close.ts +7 -0
  495. package/src/events/zn-collapse.ts +7 -0
  496. package/src/events/zn-copy.ts +7 -0
  497. package/src/events/zn-element-added.ts +7 -0
  498. package/src/events/zn-error.ts +7 -0
  499. package/src/events/zn-expand.ts +7 -0
  500. package/src/events/zn-filter-change.ts +7 -0
  501. package/src/events/zn-finish.ts +7 -0
  502. package/src/events/zn-focus.ts +7 -0
  503. package/src/events/zn-hide.ts +7 -0
  504. package/src/events/zn-hover.ts +10 -0
  505. package/src/events/zn-initial-focus.ts +7 -0
  506. package/src/events/zn-input.ts +7 -0
  507. package/src/events/zn-invalid.ts +7 -0
  508. package/src/events/zn-load.ts +7 -0
  509. package/src/events/zn-menu-ready.ts +9 -0
  510. package/src/events/zn-menu-select.ts +9 -0
  511. package/src/events/zn-open.ts +7 -0
  512. package/src/events/zn-remove.ts +7 -0
  513. package/src/events/zn-request-close.ts +7 -0
  514. package/src/events/zn-select.ts +9 -0
  515. package/src/events/zn-show.ts +7 -0
  516. package/src/events/zn-sort-change.ts +7 -0
  517. package/src/events/zn-submit.ts +7 -0
  518. package/src/form-control.scss +123 -0
  519. package/src/internal/animate.ts +64 -0
  520. package/src/internal/default-value.ts +49 -0
  521. package/src/internal/event.ts +75 -0
  522. package/src/internal/form.ts +527 -0
  523. package/src/internal/offset.ts +13 -0
  524. package/src/internal/scroll.ts +69 -0
  525. package/src/internal/slot.ts +110 -0
  526. package/src/internal/storage.ts +70 -0
  527. package/src/internal/tabbable.ts +198 -0
  528. package/src/internal/theme.ts +54 -0
  529. package/src/internal/watch.ts +63 -0
  530. package/src/internal/zinc-element.ts +113 -0
  531. package/src/translations/en.ts +30 -0
  532. package/src/utilities/animation-registry.ts +74 -0
  533. package/src/utilities/base-path.ts +46 -0
  534. package/src/utilities/lit-to-html.ts +7 -0
  535. package/src/utilities/localize.ts +37 -0
  536. package/src/utilities/md5.ts +216 -0
  537. package/src/utilities/on.ts +29 -0
  538. package/src/utilities/query.ts +36 -0
  539. package/src/wc.scss +33 -0
  540. package/src/zinc-autoloader.ts +58 -0
  541. package/src/zinc.ts +83 -0
  542. package/tsconfig.json +41 -0
  543. package/tsconfig.prod.json +12 -0
  544. package/vscode.html-custom-data.json +2804 -0
  545. package/web-test-runner.config.js +50 -0
  546. package/web-types.json +6420 -0
  547. package/zn.d.ts +6318 -0
  548. package/zn.min.css +1 -0
  549. package/zn.min.js +3701 -0
  550. package/.idea/.name +0 -1
  551. package/.idea/fusion.iml +0 -9
  552. package/.idea/modules.xml +0 -8
  553. package/.idea/php.xml +0 -4
  554. package/.idea/vcs.xml +0 -6
  555. package/.idea/watcherTasks.xml +0 -25
  556. package/components/Blank/demo/demo.html +0 -11
  557. package/components/Blank/dist/zn-blank.js +0 -39
  558. package/components/Blank/go/component.go +0 -18
  559. package/components/Blank/go/go.mod +0 -3
  560. package/components/Blank/package.json +0 -33
  561. package/components/Blank/php/composer.json +0 -25
  562. package/components/Blank/php/src/Blank.php +0 -15
  563. package/components/Blank/rollup.config.js +0 -32
  564. package/components/Blank/scss/Styles.scss +0 -6
  565. package/components/Blank/ts/Component.ts +0 -15
  566. package/components/Blank/tsconfig.json +0 -7
  567. package/components/Icon/demo/demo.html +0 -90
  568. package/components/Icon/dist/zn-icon.js +0 -55
  569. package/components/Icon/go/component.go +0 -56
  570. package/components/Icon/go/go.mod +0 -3
  571. package/components/Icon/package.json +0 -33
  572. package/components/Icon/php/composer.json +0 -26
  573. package/components/Icon/php/src/Icon.php +0 -38
  574. package/components/Icon/php/src/Library.php +0 -17
  575. package/components/Icon/php/src/Size.php +0 -42
  576. package/components/Icon/roadmap.md +0 -7
  577. package/components/Icon/rollup.config.js +0 -32
  578. package/components/Icon/scss/Styles.scss +0 -65
  579. package/components/Icon/ts/Component.ts +0 -108
  580. package/components/Icon/ts/md5.ts +0 -215
  581. package/components/Icon/tsconfig.json +0 -7
  582. package/components/MaxWidth/demo/demo.html +0 -11
  583. package/components/MaxWidth/dist/zn-max-width.js +0 -51
  584. package/components/MaxWidth/go/component.go +0 -24
  585. package/components/MaxWidth/go/go.mod +0 -3
  586. package/components/MaxWidth/package.json +0 -33
  587. package/components/MaxWidth/php/composer.json +0 -25
  588. package/components/MaxWidth/php/src/MaxWidth.php +0 -32
  589. package/components/MaxWidth/rollup.config.js +0 -32
  590. package/components/MaxWidth/scss/Styles.scss +0 -13
  591. package/components/MaxWidth/ts/Component.ts +0 -27
  592. package/components/MaxWidth/tsconfig.json +0 -7
  593. package/components/roadmap.md +0 -4
  594. package/layout/components/Columns/demo/demo.html +0 -16
  595. package/layout/components/Columns/ts/Component.ts +0 -59
  596. package/layout/demo/index.html +0 -24
  597. package/layout/dist/zn-layout.js +0 -87
  598. package/layout/package.json +0 -38
  599. package/layout/rollup.config.js +0 -38
  600. package/layout/scss/layout.scss +0 -24
  601. package/layout/tailwind.config.js +0 -42
  602. package/layout/ts/import.ts +0 -2
  603. package/layout/tsconfig.json +0 -7
  604. /package/{layout/components/Columns/scss/Styles.scss → src/internal/zinc-element.test.ts} +0 -0
@@ -0,0 +1,74 @@
1
+ export interface ElementAnimation {
2
+ keyframes: Keyframe[];
3
+ rtlKeyframes?: Keyframe[];
4
+ options?: KeyframeAnimationOptions;
5
+ }
6
+
7
+ export interface ElementAnimationMap {
8
+ [animationName: string]: ElementAnimation;
9
+ }
10
+
11
+ export interface GetAnimationOptions {
12
+ /**
13
+ * The component's directionality. When set to "rtl", `rtlKeyframes` will be preferred over `keyframes` where
14
+ * available using getAnimation().
15
+ */
16
+ dir: string;
17
+ }
18
+
19
+ const defaultAnimationRegistry = new Map<string, ElementAnimation>();
20
+ const customAnimationRegistry = new WeakMap<Element, ElementAnimationMap>();
21
+
22
+ function ensureAnimation(animation: ElementAnimation | null) {
23
+ return animation ?? { keyframes: [], options: { duration: 0 } };
24
+ }
25
+
26
+ //
27
+ // Given an ElementAnimation, this function returns a new ElementAnimation where the keyframes property reflects either
28
+ // keyframes or rtlKeyframes depending on the specified directionality.
29
+ //
30
+ function getLogicalAnimation(animation: ElementAnimation, dir: string) {
31
+ if (dir.toLowerCase() === 'rtl') {
32
+ return {
33
+ keyframes: animation.rtlKeyframes || animation.keyframes,
34
+ options: animation.options
35
+ };
36
+ }
37
+
38
+ return animation;
39
+ }
40
+
41
+ /**
42
+ * Sets a default animation. Components should use the `name.animation` for primary animations and `name.part.animation`
43
+ * for secondary animations, e.g. `dialog.show` and `dialog.overlay.show`. For modifiers, use `drawer.showTop`.
44
+ */
45
+ export function setDefaultAnimation(animationName: string, animation: ElementAnimation | null) {
46
+ defaultAnimationRegistry.set(animationName, ensureAnimation(animation));
47
+ }
48
+
49
+ /** Sets a custom animation for the specified element. */
50
+ export function setAnimation(el: Element, animationName: string, animation: ElementAnimation | null) {
51
+ customAnimationRegistry.set(el, { ...customAnimationRegistry.get(el), [animationName]: ensureAnimation(animation) });
52
+ }
53
+
54
+ /** Gets an element's animation. Falls back to the default if no animation is found. */
55
+ export function getAnimation(el: Element, animationName: string, options: GetAnimationOptions) {
56
+ const customAnimation = customAnimationRegistry.get(el);
57
+
58
+ // Check for a custom animation
59
+ if (customAnimation?.[animationName]) {
60
+ return getLogicalAnimation(customAnimation[animationName], options.dir);
61
+ }
62
+
63
+ // Check for a default animation
64
+ const defaultAnimation = defaultAnimationRegistry.get(animationName);
65
+ if (defaultAnimation) {
66
+ return getLogicalAnimation(defaultAnimation, options.dir);
67
+ }
68
+
69
+ // Fall back to an empty animation
70
+ return {
71
+ keyframes: [],
72
+ options: { duration: 0 }
73
+ };
74
+ }
@@ -0,0 +1,46 @@
1
+ let basePath = "";
2
+
3
+ /** Sets the library's base path to the specified directory */
4
+ export function setBasePath(path: string) {
5
+ basePath = path;
6
+ }
7
+
8
+ /**
9
+ * Gets the library's base path.
10
+ *
11
+ * The base path is used to load assets such as icons and images, so it needs to be set for components to work properly.
12
+ * By default, this script will look for a script ending in zinc.js or zinc-autoloader.js and set the base path
13
+ * to the directory that contains that file. To override this behavior, you can add the data-zinc attribute to any
14
+ * script on the page (it probably makes the most sense to attach it to the Zinc script, but it could also be on a
15
+ * bundle). The value can be a local folder, or it can point to a CORS-enabled endpoint such as a CDN.
16
+ *
17
+ * <script src="bundle.js" data-zinc="/custom/base/path"></script>
18
+ *
19
+ * Alternatively, you can set the base path manually using the exported setBasePath() function.
20
+ *
21
+ * @param subpath - An optional path to append to the base path.
22
+ */
23
+ export function getBasePath(subpath = "") {
24
+ if (!basePath) {
25
+ const scripts = [...document.getElementsByTagName("script")] as HTMLScriptElement[];
26
+ const configScript = scripts.find(script => script.hasAttribute("data-zinc"));
27
+
28
+ if (configScript) {
29
+ // USe the data-zinc attribute
30
+ setBasePath(configScript.getAttribute("data-zinc")!);
31
+ } else {
32
+ const fallbackScript = scripts.find(s => {
33
+ return /zn(\.min)?.js($|\?)/.test(s.src) || /zinc-autoloader(\.min)?.js($|\?)/.test(s.src);
34
+ })
35
+ let path = "";
36
+
37
+ if (fallbackScript) {
38
+ path = fallbackScript.getAttribute("src")!;
39
+ }
40
+
41
+ setBasePath(path.split('/').slice(0, -1).join('/'));
42
+ }
43
+ }
44
+
45
+ return basePath.replace(/\/$/, '') + (subpath ? `/${subpath.replace(/^\//, '')}` : ``);
46
+ }
@@ -0,0 +1,7 @@
1
+ import {render, type TemplateResult} from "lit";
2
+
3
+ export function litToHTML<T extends HTMLElement>(templateResult: TemplateResult): T | null {
4
+ const fragment = document.createDocumentFragment();
5
+ render(templateResult, fragment)
6
+ return fragment.firstElementChild as T;
7
+ }
@@ -0,0 +1,37 @@
1
+ import {LocalizeController as DefaultLocalizationController, registerTranslation} from '@shoelace-style/localize';
2
+ import type {Translation as DefaultTranslation} from '@shoelace-style/localize';
3
+
4
+ // Register English as the default/fallback language
5
+ import en from '../translations/en.js';
6
+
7
+ // Extend the controller and apply our own translation interface for better typings
8
+ export class LocalizeController extends DefaultLocalizationController<Translation> {
9
+ // Technically '../translations/en.js' is supposed to work via side-effects. However, by some mystery sometimes the
10
+ // translations don't get bundled as expected resulting in `no translation found` errors.
11
+ // This is basically some extra assurance that our translations get registered prior to our localizer connecting in a component
12
+ // and we don't rely on implicit import ordering.
13
+ static {
14
+ registerTranslation(en);
15
+ }
16
+ }
17
+
18
+ // Export functions from the localize lib so we have one central place to import them from
19
+ export {registerTranslation} from '@shoelace-style/localize';
20
+
21
+ export interface Translation extends DefaultTranslation {
22
+ $code: string; // e.g. en, fr
23
+ $name: string; // e.g. English, French
24
+ $dir: 'ltr' | 'rtl';
25
+
26
+ onChange: string;
27
+ hidePassword: string;
28
+ showPassword: string;
29
+ clearEntry: string;
30
+ numOptionsSelected: (num: number) => string;
31
+ fileButtonText: string;
32
+ fileButtonTextMultiple: string;
33
+ folderButtonText: string;
34
+ folderDragDrop: string;
35
+ fileDragDrop: string;
36
+ numFilesSelected: (num: number) => string;
37
+ }
@@ -0,0 +1,216 @@
1
+ /* eslint-disable */
2
+ export function md5(string: string): string {
3
+
4
+ function RotateLeft(lValue: number, iShiftBits: number) {
5
+ return (lValue << iShiftBits) | (lValue >>> (32 - iShiftBits));
6
+ }
7
+
8
+ function AddUnsigned(lX: number, lY: number) {
9
+ let lX4, lY4, lX8, lY8, lResult;
10
+ lX8 = (lX & 0x80000000);
11
+ lY8 = (lY & 0x80000000);
12
+ lX4 = (lX & 0x40000000);
13
+ lY4 = (lY & 0x40000000);
14
+ lResult = (lX & 0x3FFFFFFF) + (lY & 0x3FFFFFFF);
15
+ if (lX4 && lY4) {
16
+ return (lResult ^ 0x80000000 ^ lX8 ^ lY8);
17
+ }
18
+ if (lX4 || lY4) {
19
+ if (lResult && 0x40000000) {
20
+ return (lResult ^ 0xC0000000 ^ lX8 ^ lY8);
21
+ } else {
22
+ return (lResult ^ 0x40000000 ^ lX8 ^ lY8);
23
+ }
24
+ } else {
25
+ return (lResult ^ lX8 ^ lY8);
26
+ }
27
+ }
28
+
29
+ function F(x: number, y: number, z: number) {
30
+ return (x & y) | ((~x) & z);
31
+ }
32
+
33
+ function G(x: number, y: number, z: number) {
34
+ return (x & z) | (y & (~z));
35
+ }
36
+
37
+ function H(x: number, y: number, z: number) {
38
+ return (x ^ y ^ z);
39
+ }
40
+
41
+ function I(x: number, y: number, z: number) {
42
+ return (y ^ (x | (~z)));
43
+ }
44
+
45
+ function FF(a: number, b: number, c: number, d: number, x: number, s: number, ac: number) {
46
+ a = AddUnsigned(a, AddUnsigned(AddUnsigned(F(b, c, d), x), ac));
47
+ return AddUnsigned(RotateLeft(a, s), b);
48
+ }
49
+
50
+ function GG(a: number, b: number, c: number, d: number, x: number, s: number, ac: number) {
51
+ a = AddUnsigned(a, AddUnsigned(AddUnsigned(G(b, c, d), x), ac));
52
+ return AddUnsigned(RotateLeft(a, s), b);
53
+ }
54
+
55
+ function HH(a: number, b: number, c: number, d: number, x: number, s: number, ac: number) {
56
+ a = AddUnsigned(a, AddUnsigned(AddUnsigned(H(b, c, d), x), ac));
57
+ return AddUnsigned(RotateLeft(a, s), b);
58
+ }
59
+
60
+ function II(a: number, b: number, c: number, d: number, x: number, s: number, ac: number) {
61
+ a = AddUnsigned(a, AddUnsigned(AddUnsigned(I(b, c, d), x), ac));
62
+ return AddUnsigned(RotateLeft(a, s), b);
63
+ }
64
+
65
+ function ConvertToWordArray(string: string) {
66
+ var lWordCount;
67
+ var lMessageLength = string.length;
68
+ var lNumberOfWords_temp1 = lMessageLength + 8;
69
+ var lNumberOfWords_temp2 = (lNumberOfWords_temp1 - (lNumberOfWords_temp1 % 64)) / 64;
70
+ var lNumberOfWords = (lNumberOfWords_temp2 + 1) * 16;
71
+ var lWordArray = Array(lNumberOfWords - 1);
72
+ var lBytePosition = 0;
73
+ var lByteCount = 0;
74
+ while (lByteCount < lMessageLength) {
75
+ lWordCount = (lByteCount - (lByteCount % 4)) / 4;
76
+ lBytePosition = (lByteCount % 4) * 8;
77
+ lWordArray[lWordCount] = (lWordArray[lWordCount] | (string.charCodeAt(lByteCount) << lBytePosition));
78
+ lByteCount++;
79
+ }
80
+ lWordCount = (lByteCount - (lByteCount % 4)) / 4;
81
+ lBytePosition = (lByteCount % 4) * 8;
82
+ lWordArray[lWordCount] = lWordArray[lWordCount] | (0x80 << lBytePosition);
83
+ lWordArray[lNumberOfWords - 2] = lMessageLength << 3;
84
+ lWordArray[lNumberOfWords - 1] = lMessageLength >>> 29;
85
+ return lWordArray;
86
+ }
87
+
88
+ function WordToHex(lValue: number) {
89
+ var WordToHexValue = "", WordToHexValue_temp = "", lByte, lCount;
90
+ for (lCount = 0; lCount <= 3; lCount++) {
91
+ lByte = (lValue >>> (lCount * 8)) & 255;
92
+ WordToHexValue_temp = "0" + lByte.toString(16);
93
+ WordToHexValue = WordToHexValue + WordToHexValue_temp.substr(WordToHexValue_temp.length - 2, 2);
94
+ }
95
+ return WordToHexValue;
96
+ }
97
+
98
+ function Utf8Encode(string: string) {
99
+ string = string.replace(/\r\n/g, "\n");
100
+ let utftext = "";
101
+
102
+ for (let n = 0; n < string.length; n++) {
103
+
104
+ const c = string.charCodeAt(n);
105
+
106
+ if (c < 128) {
107
+ utftext += String.fromCharCode(c);
108
+ } else if ((c > 127) && (c < 2048)) {
109
+ utftext += String.fromCharCode((c >> 6) | 192);
110
+ utftext += String.fromCharCode((c & 63) | 128);
111
+ } else {
112
+ utftext += String.fromCharCode((c >> 12) | 224);
113
+ utftext += String.fromCharCode(((c >> 6) & 63) | 128);
114
+ utftext += String.fromCharCode((c & 63) | 128);
115
+ }
116
+
117
+ }
118
+
119
+ return utftext;
120
+ }
121
+
122
+ let x: any[];
123
+ let k, AA, BB, CC, DD, a, b, c, d;
124
+ const S11 = 7, S12 = 12, S13 = 17, S14 = 22;
125
+ const S21 = 5, S22 = 9, S23 = 14, S24 = 20;
126
+ const S31 = 4, S32 = 11, S33 = 16, S34 = 23;
127
+ const S41 = 6, S42 = 10, S43 = 15, S44 = 21;
128
+
129
+ string = Utf8Encode(string);
130
+
131
+ x = ConvertToWordArray(string);
132
+
133
+ a = 0x67452301;
134
+ b = 0xEFCDAB89;
135
+ c = 0x98BADCFE;
136
+ d = 0x10325476;
137
+
138
+ for (k = 0; k < x.length; k += 16) {
139
+ AA = a;
140
+ BB = b;
141
+ CC = c;
142
+ DD = d;
143
+ a = FF(a, b, c, d, x[k + 0], S11, 0xD76AA478);
144
+ d = FF(d, a, b, c, x[k + 1], S12, 0xE8C7B756);
145
+ c = FF(c, d, a, b, x[k + 2], S13, 0x242070DB);
146
+ b = FF(b, c, d, a, x[k + 3], S14, 0xC1BDCEEE);
147
+ a = FF(a, b, c, d, x[k + 4], S11, 0xF57C0FAF);
148
+ d = FF(d, a, b, c, x[k + 5], S12, 0x4787C62A);
149
+ c = FF(c, d, a, b, x[k + 6], S13, 0xA8304613);
150
+ b = FF(b, c, d, a, x[k + 7], S14, 0xFD469501);
151
+ a = FF(a, b, c, d, x[k + 8], S11, 0x698098D8);
152
+ d = FF(d, a, b, c, x[k + 9], S12, 0x8B44F7AF);
153
+ c = FF(c, d, a, b, x[k + 10], S13, 0xFFFF5BB1);
154
+ b = FF(b, c, d, a, x[k + 11], S14, 0x895CD7BE);
155
+ a = FF(a, b, c, d, x[k + 12], S11, 0x6B901122);
156
+ d = FF(d, a, b, c, x[k + 13], S12, 0xFD987193);
157
+ c = FF(c, d, a, b, x[k + 14], S13, 0xA679438E);
158
+ b = FF(b, c, d, a, x[k + 15], S14, 0x49B40821);
159
+ a = GG(a, b, c, d, x[k + 1], S21, 0xF61E2562);
160
+ d = GG(d, a, b, c, x[k + 6], S22, 0xC040B340);
161
+ c = GG(c, d, a, b, x[k + 11], S23, 0x265E5A51);
162
+ b = GG(b, c, d, a, x[k + 0], S24, 0xE9B6C7AA);
163
+ a = GG(a, b, c, d, x[k + 5], S21, 0xD62F105D);
164
+ d = GG(d, a, b, c, x[k + 10], S22, 0x2441453);
165
+ c = GG(c, d, a, b, x[k + 15], S23, 0xD8A1E681);
166
+ b = GG(b, c, d, a, x[k + 4], S24, 0xE7D3FBC8);
167
+ a = GG(a, b, c, d, x[k + 9], S21, 0x21E1CDE6);
168
+ d = GG(d, a, b, c, x[k + 14], S22, 0xC33707D6);
169
+ c = GG(c, d, a, b, x[k + 3], S23, 0xF4D50D87);
170
+ b = GG(b, c, d, a, x[k + 8], S24, 0x455A14ED);
171
+ a = GG(a, b, c, d, x[k + 13], S21, 0xA9E3E905);
172
+ d = GG(d, a, b, c, x[k + 2], S22, 0xFCEFA3F8);
173
+ c = GG(c, d, a, b, x[k + 7], S23, 0x676F02D9);
174
+ b = GG(b, c, d, a, x[k + 12], S24, 0x8D2A4C8A);
175
+ a = HH(a, b, c, d, x[k + 5], S31, 0xFFFA3942);
176
+ d = HH(d, a, b, c, x[k + 8], S32, 0x8771F681);
177
+ c = HH(c, d, a, b, x[k + 11], S33, 0x6D9D6122);
178
+ b = HH(b, c, d, a, x[k + 14], S34, 0xFDE5380C);
179
+ a = HH(a, b, c, d, x[k + 1], S31, 0xA4BEEA44);
180
+ d = HH(d, a, b, c, x[k + 4], S32, 0x4BDECFA9);
181
+ c = HH(c, d, a, b, x[k + 7], S33, 0xF6BB4B60);
182
+ b = HH(b, c, d, a, x[k + 10], S34, 0xBEBFBC70);
183
+ a = HH(a, b, c, d, x[k + 13], S31, 0x289B7EC6);
184
+ d = HH(d, a, b, c, x[k + 0], S32, 0xEAA127FA);
185
+ c = HH(c, d, a, b, x[k + 3], S33, 0xD4EF3085);
186
+ b = HH(b, c, d, a, x[k + 6], S34, 0x4881D05);
187
+ a = HH(a, b, c, d, x[k + 9], S31, 0xD9D4D039);
188
+ d = HH(d, a, b, c, x[k + 12], S32, 0xE6DB99E5);
189
+ c = HH(c, d, a, b, x[k + 15], S33, 0x1FA27CF8);
190
+ b = HH(b, c, d, a, x[k + 2], S34, 0xC4AC5665);
191
+ a = II(a, b, c, d, x[k + 0], S41, 0xF4292244);
192
+ d = II(d, a, b, c, x[k + 7], S42, 0x432AFF97);
193
+ c = II(c, d, a, b, x[k + 14], S43, 0xAB9423A7);
194
+ b = II(b, c, d, a, x[k + 5], S44, 0xFC93A039);
195
+ a = II(a, b, c, d, x[k + 12], S41, 0x655B59C3);
196
+ d = II(d, a, b, c, x[k + 3], S42, 0x8F0CCC92);
197
+ c = II(c, d, a, b, x[k + 10], S43, 0xFFEFF47D);
198
+ b = II(b, c, d, a, x[k + 1], S44, 0x85845DD1);
199
+ a = II(a, b, c, d, x[k + 8], S41, 0x6FA87E4F);
200
+ d = II(d, a, b, c, x[k + 15], S42, 0xFE2CE6E0);
201
+ c = II(c, d, a, b, x[k + 6], S43, 0xA3014314);
202
+ b = II(b, c, d, a, x[k + 13], S44, 0x4E0811A1);
203
+ a = II(a, b, c, d, x[k + 4], S41, 0xF7537E82);
204
+ d = II(d, a, b, c, x[k + 11], S42, 0xBD3AF235);
205
+ c = II(c, d, a, b, x[k + 2], S43, 0x2AD7D2BB);
206
+ b = II(b, c, d, a, x[k + 9], S44, 0xEB86D391);
207
+ a = AddUnsigned(a, AA);
208
+ b = AddUnsigned(b, BB);
209
+ c = AddUnsigned(c, CC);
210
+ d = AddUnsigned(d, DD);
211
+ }
212
+
213
+ var temp = WordToHex(a) + WordToHex(b) + WordToHex(c) + WordToHex(d);
214
+
215
+ return temp.toLowerCase();
216
+ }
@@ -0,0 +1,29 @@
1
+ type OnEvent = Event & { selectedTarget: EventTarget; path: EventTarget[] };
2
+
3
+ interface OnEventListener {
4
+ (evt: OnEvent): void;
5
+ }
6
+
7
+ export function on(delegate: EventTarget, eventName: string, targetSelector: string, callback: OnEventListener) {
8
+ function _fn(e: OnEvent) {
9
+ const path = e.path || (e.composedPath?.());
10
+ let t: Element | null = (path?.[0] || e.target) as Element;
11
+ do {
12
+ if (!targetSelector || (t.matches && t.matches(targetSelector))) {
13
+ e.selectedTarget = t;
14
+ return callback(e);
15
+ }
16
+
17
+ // stop traversing up the dom once we reach the delegate
18
+ if (delegate === t) {
19
+ break;
20
+ }
21
+ }
22
+ while ((t = t.parentElement));
23
+
24
+ return false;
25
+ }
26
+
27
+ delegate.addEventListener(eventName, _fn);
28
+ return () => delegate.removeEventListener(eventName, _fn);
29
+ }
@@ -0,0 +1,36 @@
1
+ export function deepQuerySelectorAll(selector: string, element: Element, stopSelector: string): Element[] {
2
+ const arr: Element[] = [];
3
+
4
+ const traverser = (node: Element, sub: boolean) => {
5
+ // 1. decline all nodes that are not elements
6
+ if (node.nodeType !== Node.ELEMENT_NODE || (sub && stopSelector && node.matches(stopSelector))) {
7
+ return;
8
+ }
9
+
10
+ // 2. add the node to the array, if it matches the selector
11
+ if (node.matches(selector)) {
12
+ arr.push(node);
13
+ }
14
+
15
+ // 3. loop through the children
16
+ const children = node.children;
17
+ if (children.length) {
18
+ for (const child of children) {
19
+ traverser(child, true);
20
+ }
21
+ }
22
+
23
+ // 4. check for shadow DOM, and loop through it's children
24
+ const shadowRoot = node.shadowRoot;
25
+ if (shadowRoot) {
26
+ const shadowChildren = shadowRoot.children;
27
+ for (const shadowChild of shadowChildren) {
28
+ traverser(shadowChild, true);
29
+ }
30
+ }
31
+ };
32
+
33
+ traverser(element, false);
34
+
35
+ return arr;
36
+ }
package/src/wc.scss ADDED
@@ -0,0 +1,33 @@
1
+ //@use "../scss/shared/reset";
2
+ //@use "../scss/shared/base";
3
+
4
+ //@use "../scss/shared/layout";
5
+ //@use "../scss/global-spacing";
6
+
7
+ @forward "../scss/variables";
8
+ @forward "../scss/mixins";
9
+
10
+
11
+ :host {
12
+ text-rendering: optimizeLegibility;
13
+ -webkit-font-smoothing: antialiased;
14
+ -moz-osx-font-smoothing: grayscale;
15
+
16
+ *, *::before, *::after {
17
+ box-sizing: border-box;
18
+ border-width: 0;
19
+ border-style: solid;
20
+ border-color: rgb(var(--zn-border-color));
21
+ }
22
+ }
23
+
24
+ [hidden] {
25
+ display: none !important;
26
+ }
27
+
28
+ .width-container {
29
+ height: 100%;
30
+ width: 100%;
31
+ max-width: var(--zn-container);
32
+ margin: 0 auto;
33
+ }
@@ -0,0 +1,58 @@
1
+ import {getBasePath} from "./utilities/base-path";
2
+
3
+ const observer = new MutationObserver((mutations) => {
4
+ for (const {addedNodes} of mutations) {
5
+ for (const node of addedNodes) {
6
+ if (node.nodeType === Node.ELEMENT_NODE) {
7
+ discover(node as Element);
8
+ }
9
+ }
10
+ }
11
+ });
12
+
13
+ /**
14
+ * Checks a node for undefined elements and attempts to register them
15
+ */
16
+ export async function discover(root: Element | ShadowRoot) {
17
+ const rootTagName = root instanceof Element ? root.tagName.toLowerCase() : '';
18
+ const rootIsZincElement = rootTagName?.startsWith('zn-');
19
+ const tags = [...root.querySelectorAll(':not(:defined)')]
20
+ .map(el => el.tagName.toLowerCase())
21
+ .filter(tag => tag.startsWith('zn-'));
22
+
23
+ // If the root element is an undefined Zinc component, add it to the list
24
+ if (rootIsZincElement && !customElements.get(rootTagName)) {
25
+ tags.push(rootTagName);
26
+ }
27
+
28
+ // Make the list unique
29
+ const tagsToRegister = [...new Set(tags)];
30
+
31
+ await Promise.allSettled(tagsToRegister.map(tagName => register(tagName)));
32
+ }
33
+
34
+ /**
35
+ * Registers an element by tag name.
36
+ */
37
+ function register(tagName: string): Promise<void> {
38
+ // If the element is already defined, there's nothing more to do
39
+ if (customElements.get(tagName)) {
40
+ return Promise.resolve();
41
+ }
42
+
43
+ const tagWithoutPrefix = tagName.replace(/^zn-/i, '');
44
+ const path = getBasePath(`components/${tagWithoutPrefix}/${tagWithoutPrefix}.js`);
45
+
46
+ // Register it
47
+ return new Promise((resolve, reject) => {
48
+ // @ts-expect-error Dynamic imports are only supported when the --module flag is set to es2020, es2022, esnext,
49
+ // commonjs, amd, system, umd, node16, or nodenext
50
+ import(path).then(() => resolve()).catch(() => reject(new Error(`Unable to autoload <${tagName}> from ${path}`)));
51
+ });
52
+ }
53
+
54
+ // Initial discovery
55
+ discover(document.body);
56
+
57
+ // Listen for new undefined elements
58
+ observer.observe(document.documentElement, {subtree: true, childList: true});
package/src/zinc.ts ADDED
@@ -0,0 +1,83 @@
1
+ // Components
2
+ export {default as Button} from './components/button';
3
+ export {default as Icon} from './components/icon';
4
+ export {default as AbsoluteContainer} from './components/absolute-container';
5
+ export {default as Tooltip} from './components/tooltip';
6
+ export {default as Popup} from './components/popup';
7
+ export {default as Collapsible} from './components/collapsible';
8
+ export {default as Alert} from './components/alert';
9
+ export {default as ButtonGroup} from './components/button-group';
10
+ export {default as Chip} from './components/chip';
11
+ export {default as Well} from './components/well';
12
+ export {default as CopyButton} from './components/copy-button';
13
+ export {default as DataTable} from './components/data-table';
14
+ export {default as Cols} from './components/cols';
15
+ export {default as Confirm} from './components/confirm';
16
+ export {default as Dialog} from './components/dialog';
17
+ export {default as Dropdown} from './components/dropdown';
18
+ export {default as Menu} from './components/menu';
19
+ export {default as MenuItem} from './components/menu-item';
20
+ export {default as DefinedLabel} from './components/defined-label';
21
+ export {default as EmptyState} from './components/empty-state';
22
+ export {default as Note} from './components/note';
23
+ export {default as Tile} from './components/tile';
24
+ export {default as TileProperty} from './components/tile-property';
25
+ export {default as Chart} from './components/chart';
26
+ export {default as SimpleChart} from './components/simple-chart';
27
+ export {default as Header} from './components/header';
28
+ export {default as Navbar} from './components/navbar';
29
+ export {default as InlineEdit} from './components/inline-edit';
30
+ export {default as Pagination} from './components/pagination';
31
+ export {default as VerticalStepper} from './components/vertical-stepper';
32
+ export {default as Timer} from './components/timer';
33
+ export {default as Tabs} from './components/tabs';
34
+ export {default as Panel} from './components/panel';
35
+ export {default as Table} from './components/table';
36
+ export {default as Pane} from './components/pane';
37
+ export {default as SplitPane} from './components/split-pane';
38
+ export {default as Sidebar} from './components/sidebar';
39
+ export {default as Sp} from './components/sp';
40
+ export {default as Stepper} from './components/stepper';
41
+ export {default as Stat} from './components/stat';
42
+ export {default as ScrollContainer} from './components/scroll-container';
43
+ export {default as QueryBuilder} from './components/query-builder';
44
+ export {default as ProgressTile} from './components/progress-tile';
45
+ export {default as ProgressBar} from './components/progress-bar';
46
+ export {default as OrderTable} from './components/order-table';
47
+ export {default as BulkActions} from './components/bulk-actions';
48
+ export {default as Editor} from './components/editor';
49
+ export {default as Toggle} from './components/toggle';
50
+ export {default as Input} from './components/input';
51
+ export {default as Select} from './components/select';
52
+ export {default as Option} from './components/option';
53
+ export {default as Textarea} from './components/textarea';
54
+ export {default as Checkbox} from './components/checkbox';
55
+ export {default as Datepicker} from './components/datepicker';
56
+ export {default as FormGroup} from './components/form-group';
57
+ export {default as LinkedSelect} from './components/linked-select';
58
+ export {default as Radio} from './components/radio';
59
+ export {default as Rating} from './components/rating';
60
+ export {default as RadioGroup} from './components/radio-group';
61
+ export {default as File} from './components/file';
62
+ export {default as CheckboxGroup} from './components/checkbox-group';
63
+ export {default as Item} from './components/item';
64
+ export {default as DataSelect} from './components/data-select';
65
+ export {default as ButtonMenu} from './components/button-menu';
66
+ export {default as HoverContainer} from './components/hover-container';
67
+ export {default as Slideout} from './components/slideout';
68
+ export {default as DataTableFilter} from './components/data-table-filter';
69
+ export {default as DataTableSort} from './components/data-table-sort';
70
+ export {default as ActionBar} from './components/action-bar';
71
+ export {default as ExpandingAction} from './components/expanding-action';
72
+ export {default as PageNav} from './components/page-nav';
73
+ export {default as StatusIndicator} from './components/status-indicator';
74
+ export {default as SplitButton} from './components/split-button';
75
+ export {default as Skeleton} from './components/skeleton';
76
+ export {default as Style} from './components/style';
77
+ export {default as ContentBlock} from './components/content-block';
78
+ /* plop:component */
79
+
80
+ // Utilities
81
+
82
+ // Events
83
+ export * from './events/events';
package/tsconfig.json ADDED
@@ -0,0 +1,41 @@
1
+ /* This is the "dev" TS Config which includes typechecking for test. This is used by ESLint to provide TypeScript errors for test files */
2
+ {
3
+ "compilerOptions": {
4
+ /* Visit https://aka.ms/tsconfig.json to read more about this file */
5
+ "target": "es2017",
6
+ "moduleResolution": "node",
7
+ "lib": [
8
+ "dom",
9
+ "dom.Iterable",
10
+ "ESNext"
11
+ ],
12
+ "emitDeclarationOnly": true,
13
+ "declaration": true,
14
+ "rootDir": ".",
15
+ "strict": true,
16
+ "strictPropertyInitialization": false,
17
+ "strictFunctionTypes": false,
18
+ "noImplicitThis": false,
19
+ "noUnusedLocals": true,
20
+ "noUnusedParameters": true,
21
+ "noImplicitReturns": true,
22
+ "noFallthroughCasesInSwitch": true,
23
+ "esModuleInterop": true,
24
+ "experimentalDecorators": true,
25
+ /* See https://lit.dev/docs/components/properties/#avoiding-issues-with-class-fields */
26
+ "useDefineForClassFields": false,
27
+ "removeComments": false,
28
+ "skipLibCheck": true,
29
+ "forceConsistentCasingInFileNames": true,
30
+ "useUnknownInCatchVariables": true,
31
+ "isolatedModules": false,
32
+ "verbatimModuleSyntax": false,
33
+ "types": [
34
+ "mocha",
35
+ "user-agent-data-types"
36
+ ]
37
+ },
38
+ "include": [
39
+ "src"
40
+ ]
41
+ }
@@ -0,0 +1,12 @@
1
+ {
2
+ "extends": "./tsconfig",
3
+ "compilerOptions": {
4
+ "rootDir": "./src"
5
+ },
6
+ "include": [
7
+ "src"
8
+ ],
9
+ "exclude": [
10
+ "src/**/*.test.ts"
11
+ ]
12
+ }