@graupl/graupl 1.0.0-beta.2 → 1.0.0-beta.21

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 (408) hide show
  1. package/README.md +9 -0
  2. package/dist/css/base/button.css +1 -1
  3. package/dist/css/base/button.css.map +1 -1
  4. package/dist/css/base/form.css +1 -1
  5. package/dist/css/base/form.css.map +1 -1
  6. package/dist/css/base/link.css +1 -1
  7. package/dist/css/base/link.css.map +1 -1
  8. package/dist/css/base/table.css +1 -1
  9. package/dist/css/base/table.css.map +1 -1
  10. package/dist/css/base.css +1 -1
  11. package/dist/css/base.css.map +1 -1
  12. package/dist/css/component/accordion.css +4 -1
  13. package/dist/css/component/accordion.css.map +1 -1
  14. package/dist/css/component/alert.css +1 -1
  15. package/dist/css/component/alert.css.map +1 -1
  16. package/dist/css/component/badge.css +2 -0
  17. package/dist/css/component/badge.css.map +1 -0
  18. package/dist/css/component/card.css +1 -1
  19. package/dist/css/component/card.css.map +1 -1
  20. package/dist/css/component/carousel.css +1 -1
  21. package/dist/css/component/carousel.css.map +1 -1
  22. package/dist/css/component/disclosure.css +2 -0
  23. package/dist/css/component/disclosure.css.map +1 -0
  24. package/dist/css/component/input-group.css.map +1 -1
  25. package/dist/css/component/list.css +1 -1
  26. package/dist/css/component/list.css.map +1 -1
  27. package/dist/css/component/menu.css +1 -1
  28. package/dist/css/component/menu.css.map +1 -1
  29. package/dist/css/component/navigation.css +1 -1
  30. package/dist/css/component/navigation.css.map +1 -1
  31. package/dist/css/component.css +4 -1
  32. package/dist/css/component.css.map +1 -1
  33. package/dist/css/graupl.css +4 -1
  34. package/dist/css/graupl.css.map +1 -1
  35. package/dist/css/init.css.map +1 -1
  36. package/dist/css/layout/columns.css +1 -1
  37. package/dist/css/layout/columns.css.map +1 -1
  38. package/dist/css/layout/container.css +1 -1
  39. package/dist/css/layout/container.css.map +1 -1
  40. package/dist/css/layout/flex-columns.css +1 -1
  41. package/dist/css/layout/flex-columns.css.map +1 -1
  42. package/dist/css/layout.css +4 -1
  43. package/dist/css/layout.css.map +1 -1
  44. package/dist/css/normalize.css.map +1 -1
  45. package/dist/css/state/focus.css +1 -1
  46. package/dist/css/state/focus.css.map +1 -1
  47. package/dist/css/state.css +1 -1
  48. package/dist/css/state.css.map +1 -1
  49. package/dist/css/theme/color.css +1 -1
  50. package/dist/css/theme/color.css.map +1 -1
  51. package/dist/css/theme/typography.css +1 -1
  52. package/dist/css/theme/typography.css.map +1 -1
  53. package/dist/css/theme.css +1 -1
  54. package/dist/css/theme.css.map +1 -1
  55. package/dist/css/utilities/alignment.css.map +1 -1
  56. package/dist/css/utilities/background.css +2 -0
  57. package/dist/css/utilities/background.css.map +1 -0
  58. package/dist/css/utilities/border.css +1 -1
  59. package/dist/css/utilities/border.css.map +1 -1
  60. package/dist/css/utilities/color.css +1 -1
  61. package/dist/css/utilities/color.css.map +1 -1
  62. package/dist/css/utilities/container.css +2 -0
  63. package/dist/css/utilities/container.css.map +1 -0
  64. package/dist/css/utilities/display.css +1 -1
  65. package/dist/css/utilities/display.css.map +1 -1
  66. package/dist/css/utilities/flex.css.map +1 -1
  67. package/dist/css/utilities/gradient.css +2 -0
  68. package/dist/css/utilities/gradient.css.map +1 -0
  69. package/dist/css/utilities/height.css +1 -1
  70. package/dist/css/utilities/height.css.map +1 -1
  71. package/dist/css/utilities/inset.css.map +1 -1
  72. package/dist/css/utilities/justification.css.map +1 -1
  73. package/dist/css/utilities/list.css.map +1 -1
  74. package/dist/css/utilities/order.css.map +1 -1
  75. package/dist/css/utilities/position.css +2 -0
  76. package/dist/css/utilities/position.css.map +1 -0
  77. package/dist/css/utilities/ratio.css +1 -1
  78. package/dist/css/utilities/ratio.css.map +1 -1
  79. package/dist/css/utilities/spacing.css +1 -1
  80. package/dist/css/utilities/spacing.css.map +1 -1
  81. package/dist/css/utilities/typography.css +1 -1
  82. package/dist/css/utilities/typography.css.map +1 -1
  83. package/dist/css/utilities/visibility.css +1 -1
  84. package/dist/css/utilities/visibility.css.map +1 -1
  85. package/dist/css/utilities/visually-hidden.css +2 -0
  86. package/dist/css/utilities/visually-hidden.css.map +1 -0
  87. package/dist/css/utilities/width.css +1 -1
  88. package/dist/css/utilities/width.css.map +1 -1
  89. package/dist/css/utilities/z-index.css +2 -0
  90. package/dist/css/utilities/z-index.css.map +1 -0
  91. package/dist/css/utilities.css +1 -1
  92. package/dist/css/utilities.css.map +1 -1
  93. package/dist/js/accordion.js +5 -0
  94. package/dist/js/accordion.js.map +1 -0
  95. package/dist/js/alert.js +5 -0
  96. package/dist/js/alert.js.map +1 -0
  97. package/dist/js/carousel.js +5 -0
  98. package/dist/js/carousel.js.map +1 -0
  99. package/dist/js/component/accordion.cjs.js +4 -2
  100. package/dist/js/component/accordion.cjs.js.map +1 -0
  101. package/dist/js/component/accordion.es.js +5 -0
  102. package/dist/js/component/accordion.es.js.map +1 -0
  103. package/dist/js/component/accordion.iife.js +4 -2
  104. package/dist/js/component/accordion.iife.js.map +1 -0
  105. package/dist/js/component/alert.cjs.js +4 -2
  106. package/dist/js/component/alert.cjs.js.map +1 -0
  107. package/dist/js/component/alert.es.js +5 -0
  108. package/dist/js/component/alert.es.js.map +1 -0
  109. package/dist/js/component/alert.iife.js +4 -2
  110. package/dist/js/component/alert.iife.js.map +1 -0
  111. package/dist/js/component/carousel.cjs.js +4 -2
  112. package/dist/js/component/carousel.cjs.js.map +1 -0
  113. package/dist/js/component/carousel.es.js +5 -0
  114. package/dist/js/component/carousel.es.js.map +1 -0
  115. package/dist/js/component/carousel.iife.js +4 -2
  116. package/dist/js/component/carousel.iife.js.map +1 -0
  117. package/dist/js/component/disclosure.cjs.js +5 -0
  118. package/dist/js/component/disclosure.cjs.js.map +1 -0
  119. package/dist/js/component/disclosure.es.js +5 -0
  120. package/dist/js/component/disclosure.es.js.map +1 -0
  121. package/dist/js/component/disclosure.iife.js +5 -0
  122. package/dist/js/component/disclosure.iife.js.map +1 -0
  123. package/dist/js/generator/accordion.cjs.js +5 -0
  124. package/dist/js/generator/accordion.cjs.js.map +1 -0
  125. package/dist/js/generator/accordion.es.js +5 -0
  126. package/dist/js/generator/accordion.es.js.map +1 -0
  127. package/dist/js/generator/accordion.iife.js +5 -0
  128. package/dist/js/generator/accordion.iife.js.map +1 -0
  129. package/dist/js/generator/alert.cjs.js +5 -0
  130. package/dist/js/generator/alert.cjs.js.map +1 -0
  131. package/dist/js/generator/alert.es.js +5 -0
  132. package/dist/js/generator/alert.es.js.map +1 -0
  133. package/dist/js/generator/alert.iife.js +5 -0
  134. package/dist/js/generator/alert.iife.js.map +1 -0
  135. package/dist/js/generator/carousel.cjs.js +5 -0
  136. package/dist/js/generator/carousel.cjs.js.map +1 -0
  137. package/dist/js/generator/carousel.es.js +5 -0
  138. package/dist/js/generator/carousel.es.js.map +1 -0
  139. package/dist/js/generator/carousel.iife.js +5 -0
  140. package/dist/js/generator/carousel.iife.js.map +1 -0
  141. package/dist/js/generator/disclosure.cjs.js +5 -0
  142. package/dist/js/generator/disclosure.cjs.js.map +1 -0
  143. package/dist/js/generator/disclosure.es.js +5 -0
  144. package/dist/js/generator/disclosure.es.js.map +1 -0
  145. package/dist/js/generator/disclosure.iife.js +5 -0
  146. package/dist/js/generator/disclosure.iife.js.map +1 -0
  147. package/dist/js/generator/navigation.cjs.js +3 -0
  148. package/dist/js/generator/navigation.cjs.js.map +1 -0
  149. package/dist/js/generator/navigation.es.js +3 -0
  150. package/dist/js/generator/navigation.es.js.map +1 -0
  151. package/dist/js/generator/navigation.iife.js +3 -0
  152. package/dist/js/generator/navigation.iife.js.map +1 -0
  153. package/dist/js/graupl.js +11 -0
  154. package/dist/js/graupl.js.map +1 -0
  155. package/dist/js/navigation.js +3 -0
  156. package/dist/js/navigation.js.map +1 -0
  157. package/package.json +49 -41
  158. package/scss/base/button.scss +1 -1
  159. package/scss/base/form.scss +1 -1
  160. package/scss/base/link.scss +1 -1
  161. package/scss/base/table.scss +1 -1
  162. package/scss/base.scss +1 -1
  163. package/scss/component/accordion.scss +1 -1
  164. package/scss/component/alert.scss +1 -1
  165. package/scss/component/badge.scss +3 -0
  166. package/scss/component/card.scss +1 -1
  167. package/scss/component/carousel.scss +1 -1
  168. package/scss/component/disclosure.scss +3 -0
  169. package/scss/component/input-group.scss +1 -1
  170. package/scss/component/list.scss +1 -1
  171. package/scss/component/menu.scss +1 -1
  172. package/scss/component/navigation.scss +1 -1
  173. package/scss/component.scss +1 -1
  174. package/scss/graupl.scss +1 -1
  175. package/scss/init.scss +1 -1
  176. package/scss/layout/columns.scss +1 -1
  177. package/scss/layout/container.scss +1 -1
  178. package/scss/layout/flex-columns.scss +1 -1
  179. package/scss/layout.scss +1 -1
  180. package/scss/normalize.scss +1 -1
  181. package/scss/state/focus.scss +1 -1
  182. package/scss/state.scss +1 -1
  183. package/scss/theme/color.scss +1 -1
  184. package/scss/theme/typography.scss +1 -1
  185. package/scss/theme.scss +1 -1
  186. package/scss/utilities/alignment.scss +1 -1
  187. package/scss/utilities/background.scss +3 -0
  188. package/scss/utilities/border.scss +1 -1
  189. package/scss/utilities/color.scss +1 -1
  190. package/scss/utilities/container.scss +3 -0
  191. package/scss/utilities/display.scss +1 -1
  192. package/scss/utilities/flex.scss +1 -1
  193. package/scss/utilities/gradient.scss +3 -0
  194. package/scss/utilities/height.scss +1 -1
  195. package/scss/utilities/inset.scss +1 -1
  196. package/scss/utilities/justification.scss +1 -1
  197. package/scss/utilities/list.scss +1 -1
  198. package/scss/utilities/order.scss +1 -1
  199. package/scss/utilities/position.scss +3 -0
  200. package/scss/utilities/ratio.scss +1 -1
  201. package/scss/utilities/spacing.scss +1 -1
  202. package/scss/utilities/typography.scss +1 -1
  203. package/scss/utilities/visibility.scss +1 -1
  204. package/scss/utilities/visually-hidden.scss +3 -0
  205. package/scss/utilities/width.scss +1 -1
  206. package/scss/utilities/z-index.scss +3 -0
  207. package/scss/utilities.scss +1 -1
  208. package/.browserslistrc +0 -3
  209. package/.czrc +0 -3
  210. package/.editorconfig +0 -13
  211. package/.github/CODE_OF_CONDUCT.md +0 -73
  212. package/.github/COMMIT_CONVENTION.md +0 -17
  213. package/.github/CONTRIBUTING.md +0 -86
  214. package/.github/ISSUE_TEMPLATE/bug_report.md +0 -30
  215. package/.github/ISSUE_TEMPLATE/documentation.md +0 -20
  216. package/.github/ISSUE_TEMPLATE/feature_request.md +0 -20
  217. package/.github/SECURITY.md +0 -26
  218. package/.github/dependabot.yml +0 -17
  219. package/.github/pull_request_template.md +0 -5
  220. package/.github/workflows/codeql-analysis.yml +0 -71
  221. package/.github/workflows/docs.yml +0 -59
  222. package/.github/workflows/test.yml +0 -27
  223. package/.husky/commit-msg +0 -3
  224. package/.husky/pre-commit +0 -4
  225. package/.prettierignore +0 -12
  226. package/.stylelintignore +0 -9
  227. package/.versionrc.cjs +0 -61
  228. package/CHANGELOG.md +0 -392
  229. package/build.js +0 -7
  230. package/commitlint.config.js +0 -5
  231. package/dist/css/utilities/postion.css +0 -2
  232. package/dist/css/utilities/postion.css.map +0 -1
  233. package/dist/js/component/accordion.esm.js +0 -1289
  234. package/dist/js/component/alert.esm.js +0 -529
  235. package/dist/js/component/carousel.esm.js +0 -1110
  236. package/dist/js/graupl.cjs.js +0 -5
  237. package/dist/js/graupl.esm.js +0 -1462
  238. package/dist/js/graupl.iife.js +0 -5
  239. package/docs/.vitepress/config.js +0 -78
  240. package/docs/.vitepress/theme/custom.scss +0 -35
  241. package/docs/.vitepress/theme/index.js +0 -4
  242. package/docs/compiling-graupl.md +0 -56
  243. package/docs/components/alert.md +0 -130
  244. package/docs/components/button.md +0 -84
  245. package/docs/components/card.md +0 -369
  246. package/docs/components/index.md +0 -1
  247. package/docs/components/inputgroup.md +0 -159
  248. package/docs/components/menu.md +0 -326
  249. package/docs/components/navigation.md +0 -158
  250. package/docs/content.md +0 -237
  251. package/docs/defaults.md +0 -121
  252. package/docs/forms.md +0 -79
  253. package/docs/functions.md +0 -9
  254. package/docs/getting-started.md +0 -1
  255. package/docs/index.md +0 -1
  256. package/docs/introduction.md +0 -25
  257. package/docs/layout.md +0 -200
  258. package/docs/mixins.md +0 -47
  259. package/docs/state.md +0 -67
  260. package/docs/theme.md +0 -258
  261. package/docs/utilities.md +0 -357
  262. package/eslint.config.js +0 -74
  263. package/index.html +0 -923
  264. package/index.js +0 -12
  265. package/lint-staged.config.js +0 -6
  266. package/postcss.config.cjs +0 -12
  267. package/prettier.config.js +0 -16
  268. package/scss/utilities/postion.scss +0 -3
  269. package/src/js/accordion/Accordion.js +0 -1163
  270. package/src/js/accordion/AccordionItem.js +0 -496
  271. package/src/js/accordion/index.js +0 -10
  272. package/src/js/alert/Alert.js +0 -581
  273. package/src/js/alert/index.js +0 -11
  274. package/src/js/carousel/Carousel.js +0 -1427
  275. package/src/js/carousel/index.js +0 -10
  276. package/src/js/domHelpers.js +0 -37
  277. package/src/js/eventHandlers.js +0 -39
  278. package/src/js/navigation/index.js +0 -36
  279. package/src/js/storage.js +0 -106
  280. package/src/js/validate.js +0 -225
  281. package/src/scss/_defaults.scss +0 -145
  282. package/src/scss/_index.scss +0 -15
  283. package/src/scss/_init.scss +0 -3
  284. package/src/scss/_normalize.scss +0 -197
  285. package/src/scss/_variables.scss +0 -53
  286. package/src/scss/base/_index.scss +0 -6
  287. package/src/scss/base/button/_defaults.scss +0 -60
  288. package/src/scss/base/button/_index.scss +0 -107
  289. package/src/scss/base/button/_mixins.scss +0 -166
  290. package/src/scss/base/button/_variables.scss +0 -176
  291. package/src/scss/base/form/_defaults.scss +0 -17
  292. package/src/scss/base/form/_index.scss +0 -93
  293. package/src/scss/base/form/_variables.scss +0 -153
  294. package/src/scss/base/link/_defaults.scss +0 -50
  295. package/src/scss/base/link/_index.scss +0 -134
  296. package/src/scss/base/link/_variables.scss +0 -262
  297. package/src/scss/base/table/_defaults.scss +0 -53
  298. package/src/scss/base/table/_index.scss +0 -121
  299. package/src/scss/base/table/_variables.scss +0 -135
  300. package/src/scss/component/_index.scss +0 -10
  301. package/src/scss/component/accordion/_defaults.scss +0 -40
  302. package/src/scss/component/accordion/_index.scss +0 -180
  303. package/src/scss/component/accordion/_variables.scss +0 -316
  304. package/src/scss/component/alert/_defaults.scss +0 -49
  305. package/src/scss/component/alert/_index.scss +0 -118
  306. package/src/scss/component/alert/_variables.scss +0 -170
  307. package/src/scss/component/card/_defaults.scss +0 -32
  308. package/src/scss/component/card/_index.scss +0 -178
  309. package/src/scss/component/card/_variables.scss +0 -186
  310. package/src/scss/component/carousel/_defaults.scss +0 -43
  311. package/src/scss/component/carousel/_index.scss +0 -188
  312. package/src/scss/component/carousel/_variables.scss +0 -104
  313. package/src/scss/component/input-group/_defaults.scss +0 -30
  314. package/src/scss/component/input-group/_index.scss +0 -47
  315. package/src/scss/component/input-group/_variables.scss +0 -66
  316. package/src/scss/component/list/_defaults.scss +0 -15
  317. package/src/scss/component/list/_index.scss +0 -50
  318. package/src/scss/component/list/_variables.scss +0 -176
  319. package/src/scss/component/menu/_defaults.scss +0 -66
  320. package/src/scss/component/menu/_index.scss +0 -305
  321. package/src/scss/component/menu/_variables.scss +0 -500
  322. package/src/scss/component/navigation/_defaults.scss +0 -29
  323. package/src/scss/component/navigation/_index.scss +0 -189
  324. package/src/scss/component/navigation/_variables.scss +0 -237
  325. package/src/scss/functions/_important.scss +0 -13
  326. package/src/scss/functions/_screen.scss +0 -38
  327. package/src/scss/functions/_theme.scss +0 -39
  328. package/src/scss/functions/_utility.scss +0 -28
  329. package/src/scss/layout/_index.scss +0 -5
  330. package/src/scss/layout/columns/_defaults.scss +0 -19
  331. package/src/scss/layout/columns/_index.scss +0 -58
  332. package/src/scss/layout/columns/_variables.scss +0 -51
  333. package/src/scss/layout/container/_defaults.scss +0 -17
  334. package/src/scss/layout/container/_index.scss +0 -41
  335. package/src/scss/layout/container/_variables.scss +0 -50
  336. package/src/scss/layout/flex-columns/_defaults.scss +0 -18
  337. package/src/scss/layout/flex-columns/_index.scss +0 -80
  338. package/src/scss/layout/flex-columns/_variables.scss +0 -26
  339. package/src/scss/mixins/_animation.scss +0 -15
  340. package/src/scss/mixins/_layer.scss +0 -16
  341. package/src/scss/mixins/_screen.scss +0 -77
  342. package/src/scss/mixins/_state.scss +0 -18
  343. package/src/scss/mixins/_theme.scss +0 -15
  344. package/src/scss/mixins/_utility.scss +0 -132
  345. package/src/scss/mixins/_visually-hidden.scss +0 -20
  346. package/src/scss/state/_index.scss +0 -3
  347. package/src/scss/state/focus/_defaults.scss +0 -10
  348. package/src/scss/state/focus/_index.scss +0 -13
  349. package/src/scss/state/focus/_mixins.scss +0 -15
  350. package/src/scss/state/focus/_variables.scss +0 -44
  351. package/src/scss/theme/_index.scss +0 -4
  352. package/src/scss/theme/color/_defaults.scss +0 -143
  353. package/src/scss/theme/color/_index.scss +0 -42
  354. package/src/scss/theme/color/_variables.scss +0 -129
  355. package/src/scss/theme/typography/_defaults.scss +0 -54
  356. package/src/scss/theme/typography/_index.scss +0 -111
  357. package/src/scss/theme/typography/_variables.scss +0 -231
  358. package/src/scss/utilities/_index.scss +0 -18
  359. package/src/scss/utilities/alignment/_defaults.scss +0 -64
  360. package/src/scss/utilities/alignment/_index.scss +0 -168
  361. package/src/scss/utilities/alignment/_variables.scss +0 -6
  362. package/src/scss/utilities/border/_defaults.scss +0 -61
  363. package/src/scss/utilities/border/_index.scss +0 -269
  364. package/src/scss/utilities/border/_variables.scss +0 -6
  365. package/src/scss/utilities/color/_defaults.scss +0 -37
  366. package/src/scss/utilities/color/_index.scss +0 -202
  367. package/src/scss/utilities/color/_variables.scss +0 -6
  368. package/src/scss/utilities/display/_defaults.scss +0 -36
  369. package/src/scss/utilities/display/_index.scss +0 -134
  370. package/src/scss/utilities/display/_variables.scss +0 -6
  371. package/src/scss/utilities/flex/_defaults.scss +0 -87
  372. package/src/scss/utilities/flex/_index.scss +0 -255
  373. package/src/scss/utilities/flex/_variables.scss +0 -6
  374. package/src/scss/utilities/height/_defaults.scss +0 -43
  375. package/src/scss/utilities/height/_index.scss +0 -236
  376. package/src/scss/utilities/height/_variables.scss +0 -6
  377. package/src/scss/utilities/inset/_defaults.scss +0 -43
  378. package/src/scss/utilities/inset/_index.scss +0 -90
  379. package/src/scss/utilities/inset/_variables.scss +0 -6
  380. package/src/scss/utilities/justification/_defaults.scss +0 -61
  381. package/src/scss/utilities/justification/_index.scss +0 -168
  382. package/src/scss/utilities/justification/_variables.scss +0 -6
  383. package/src/scss/utilities/list/_defaults.scss +0 -41
  384. package/src/scss/utilities/list/_index.scss +0 -125
  385. package/src/scss/utilities/list/_variables.scss +0 -6
  386. package/src/scss/utilities/order/_defaults.scss +0 -24
  387. package/src/scss/utilities/order/_index.scss +0 -111
  388. package/src/scss/utilities/order/_variables.scss +0 -6
  389. package/src/scss/utilities/position/_defaults.scss +0 -28
  390. package/src/scss/utilities/position/_index.scss +0 -82
  391. package/src/scss/utilities/position/_variables.scss +0 -6
  392. package/src/scss/utilities/ratio/_defaults.scss +0 -30
  393. package/src/scss/utilities/ratio/_index.scss +0 -91
  394. package/src/scss/utilities/ratio/_variables.scss +0 -9
  395. package/src/scss/utilities/spacing/_defaults.scss +0 -51
  396. package/src/scss/utilities/spacing/_index.scss +0 -382
  397. package/src/scss/utilities/spacing/_variables.scss +0 -6
  398. package/src/scss/utilities/typography/_defaults.scss +0 -46
  399. package/src/scss/utilities/typography/_index.scss +0 -658
  400. package/src/scss/utilities/typography/_variables.scss +0 -6
  401. package/src/scss/utilities/visibility/_defaults.scss +0 -27
  402. package/src/scss/utilities/visibility/_index.scss +0 -82
  403. package/src/scss/utilities/visibility/_variables.scss +0 -6
  404. package/src/scss/utilities/width/_defaults.scss +0 -43
  405. package/src/scss/utilities/width/_index.scss +0 -236
  406. package/src/scss/utilities/width/_variables.scss +0 -6
  407. package/stylelint.config.js +0 -22
  408. package/vite.config.js +0 -57
@@ -1,10 +0,0 @@
1
- import Carousel from "./Carousel.js";
2
-
3
- document.addEventListener("DOMContentLoaded", () => {
4
- document.querySelectorAll(".carousel").forEach((carouselElement) => {
5
- new Carousel({
6
- carouselElement,
7
- initialize: true,
8
- });
9
- });
10
- });
@@ -1,37 +0,0 @@
1
- /**
2
- * Add a class or array of classes to an element.
3
- *
4
- * @param {string|string[]} className - The class or classes to add.
5
- * @param {HTMLElement} element - The element to add the class to.
6
- */
7
- export function addClass(className, element) {
8
- // Gracefully handle empty strings or arrays.
9
- if (className === "" || className.length === 0) {
10
- return;
11
- }
12
-
13
- if (typeof className === "string") {
14
- element.classList.add(className);
15
- } else {
16
- element.classList.add(...className);
17
- }
18
- }
19
-
20
- /**
21
- * Remove a class or array of classes from an element.
22
- *
23
- * @param {string|string[]} className - The class or classes to remove.
24
- * @param {HTMLElement} element - The element to remove the class from.
25
- */
26
- export function removeClass(className, element) {
27
- // Gracefully handle empty strings or arrays.
28
- if (className === "" || className.length === 0) {
29
- return;
30
- }
31
-
32
- if (typeof className === "string") {
33
- element.classList.remove(className);
34
- } else {
35
- element.classList.remove(...className);
36
- }
37
- }
@@ -1,39 +0,0 @@
1
- /**
2
- * Retrieves the pressed key from an event.
3
- *
4
- * @param {KeyboardEvent} event - The keyboard event.
5
- * @return {string} - The name of the key or an empty string.
6
- */
7
- export function keyPress(event) {
8
- try {
9
- // Use event.key or event.keyCode to support older browsers.
10
- const key = event.key || event.keyCode;
11
- const keys = {
12
- Enter: key === "Enter" || key === 13,
13
- Space: key === " " || key === "Spacebar" || key === 32,
14
- Escape: key === "Escape" || key === "Esc" || key === 27,
15
- ArrowUp: key === "ArrowUp" || key === "Up" || key === 38,
16
- ArrowRight: key === "ArrowRight" || key === "Right" || key === 39,
17
- ArrowDown: key === "ArrowDown" || key === "Down" || key === 40,
18
- ArrowLeft: key === "ArrowLeft" || key === "Left" || key === 37,
19
- Home: key === "Home" || key === 36,
20
- End: key === "End" || key === 35,
21
- Tab: key === "Tab" || key === 9,
22
- };
23
-
24
- return Object.keys(keys).find((key) => keys[key] === true) || "";
25
- } catch {
26
- // Return an empty string if something goes wrong.
27
- return "";
28
- }
29
- }
30
-
31
- /**
32
- * Stops an event from taking action.
33
- *
34
- * @param {Event} event - The event.
35
- */
36
- export function preventEvent(event) {
37
- event.preventDefault();
38
- event.stopPropagation();
39
- }
@@ -1,36 +0,0 @@
1
- import storage from "../storage.js";
2
-
3
- document.addEventListener("DOMContentLoaded", function () {
4
- const navs = document.querySelectorAll(".navigation");
5
-
6
- navs.forEach((nav) => {
7
- const MenuConstructor = nav.dataset.grauplMenuType || DisclosureMenu;
8
-
9
- if (window[MenuConstructor] === undefined) {
10
- console.warn(
11
- `Graupl navigation requires accessible-menu's ${MenuConstructor}. Please make sure to include it on this page.`
12
- );
13
-
14
- return;
15
- }
16
-
17
- const menuOptions =
18
- JSON.parse(nav.dataset.grauplMenuOptions.replace(/'/g, '"')) || {};
19
- const menuElement = nav.querySelector(".menu");
20
- const controllerElement = nav.querySelector(".navigation-toggle") || null;
21
- const containerElement = controllerElement ? nav : null;
22
- const menu = new window[MenuConstructor]({
23
- menuElement,
24
- menuItemSelector: ".menu-item",
25
- menuLinkSelector: ".menu-link",
26
- submenuItemSelector: ".submenu-item",
27
- submenuToggleSelector: ".submenu-toggle",
28
- controllerElement,
29
- containerElement,
30
- ...menuOptions,
31
- });
32
-
33
- storage.initializeStorage("menus");
34
- storage.pushToStorage("menus", menu.dom.menu.id, menu);
35
- });
36
- });
package/src/js/storage.js DELETED
@@ -1,106 +0,0 @@
1
- /**
2
- * @file
3
- * Provides a system to get and store Graupl data in the browser.
4
- */
5
-
6
- import { isValidType } from "./validate.js";
7
-
8
- /**
9
- * Initializes the storage system.
10
- *
11
- * @param {?string} [type = null] - The type of storage to initialize.
12
- */
13
- export function initializeStorage(type = null) {
14
- window.Graupl = window.Graupl || {};
15
-
16
- if (isValidType("string", { type })) {
17
- window.Graupl[type] = window.Graupl[type] || {};
18
- }
19
- }
20
-
21
- /**
22
- * Get the storage object.
23
- *
24
- * @param {?string} type - The type of storage to get.
25
- * @return {object} - The storage object.
26
- */
27
- export function getStorage(type = null) {
28
- if (isValidType("string", { type })) {
29
- return window.Graupl[type];
30
- }
31
-
32
- return window.Graupl;
33
- }
34
-
35
- /**
36
- * Set the storage object of a given type.
37
- *
38
- * @param {string} type - The type of storage to set.
39
- * @param {object} data - The data to set.
40
- */
41
- export function setStorage(type, data = {}) {
42
- if (isValidType("string", { type }) && isValidType("object", { data })) {
43
- window.Graupl[type] = data;
44
- }
45
- }
46
-
47
- /**
48
- * Clear the storage object of a given type.
49
- *
50
- * @param {string} type - The type of storage to clear.
51
- */
52
- export function clearStorage(type) {
53
- if (isValidType("string", { type })) {
54
- window.Graupl[type] = {};
55
- }
56
- }
57
-
58
- /**
59
- * Push a value to the storage object.
60
- *
61
- * @param {string} type - The type of storage to push to.
62
- * @param {string} key - The key to use for the value.
63
- * @param {*} value - The value to store.
64
- */
65
- export function pushToStorage(type, key, value) {
66
- if (isValidType("string", { type, key })) {
67
- window.Graupl[type][key] = value;
68
- }
69
- }
70
-
71
- /**
72
- * Get a value from the storage object.
73
- *
74
- * @param {string }type - The type of storage to get from.
75
- * @param {string }key - The key to get the value from.
76
- * @return {*} - The value from the storage object.
77
- */
78
- export function getFromStorage(type, key) {
79
- if (isValidType("string", { type, key })) {
80
- return window.Graupl[type][key];
81
- }
82
-
83
- return null;
84
- }
85
-
86
- /**
87
- * Remove a value from the storage object.
88
- *
89
- * @param {string} type - The type of storage to remove from.
90
- * @param {string} key - The key to remove the value from.
91
- */
92
- export function removeFromStorage(type, key) {
93
- if (isValidType("string", { type, key })) {
94
- delete window.Graupl[type][key];
95
- }
96
- }
97
-
98
- export default {
99
- initializeStorage,
100
- getStorage,
101
- setStorage,
102
- clearStorage,
103
- pushToStorage,
104
- getFromStorage,
105
- removeFromStorage,
106
- };
@@ -1,225 +0,0 @@
1
- /**
2
- * Check to see if the provided elements have a specific contructor.
3
- *
4
- * The values must be provided inside of an object
5
- * so the variable name can be retrieved in case of errors.
6
- *
7
- * This is essentially just a wrapper function around checking instanceof with
8
- * more descriptive error message to help debugging.
9
- *
10
- * Will return `{ status: true }` if the check is successful.
11
- *
12
- * @param {object} contructor - The constructor to check for.
13
- * @param {object} elements - The element(s) to check.
14
- * @return {Object<boolean, string>} - The result of the check.
15
- */
16
- export function isValidInstance(contructor, elements) {
17
- try {
18
- if (typeof elements !== "object") {
19
- const elementsType = typeof elements;
20
-
21
- throw new TypeError(
22
- `Elements given to isValidInstance() must be inside of an object. "${elementsType}" given.`
23
- );
24
- }
25
-
26
- for (const key in elements) {
27
- if (!(elements[key] instanceof contructor)) {
28
- const elementType = typeof elements[key];
29
- throw new TypeError(
30
- `${key} must be an instance of ${contructor.name}. "${elementType}" given.`
31
- );
32
- }
33
- }
34
-
35
- return {
36
- status: true,
37
- error: null,
38
- };
39
- } catch (error) {
40
- return {
41
- status: false,
42
- error,
43
- };
44
- }
45
- }
46
-
47
- /**
48
- * Check to see if the provided values are of a specific type.
49
- *
50
- * The values must be provided inside of an object
51
- * so the variable name can be retrieved in case of errors.
52
- *
53
- * This is essentially just a wrapper function around checking typeof with
54
- * more descriptive error message to help debugging.
55
- *
56
- * Will return `{ status: true }` if the check is successful.
57
- *
58
- * @param {string} type - The type to check for.
59
- * @param {object} values - The value(s) to check.
60
- * @return {Object<boolean, string>} - The result of the check.
61
- */
62
- export function isValidType(type, values) {
63
- try {
64
- if (typeof values !== "object") {
65
- const valuesType = typeof values;
66
-
67
- throw new TypeError(
68
- `Values given to isValidType() must be inside of an object. "${valuesType}" given.`
69
- );
70
- }
71
-
72
- for (const key in values) {
73
- const valueType = typeof values[key];
74
-
75
- if (valueType !== type) {
76
- throw new TypeError(`${key} must be a ${type}. "${valueType}" given.`);
77
- }
78
- }
79
-
80
- return {
81
- status: true,
82
- error: null,
83
- };
84
- } catch (error) {
85
- return {
86
- status: false,
87
- error,
88
- };
89
- }
90
- }
91
-
92
- /**
93
- * Checks to see if the provided values are valid query selectors.
94
- *
95
- * The values must be provided inside of an object
96
- * so the variable name can be retrieved in case of errors.
97
- *
98
- * Will return `{ status: true }` if the check is successful.
99
- *
100
- * @param {Object<string>} values - The value(s) to check.
101
- * @return {Object<boolean, string>} - The result of the check.
102
- */
103
- export function isQuerySelector(values) {
104
- try {
105
- if (typeof values !== "object") {
106
- const type = typeof values;
107
-
108
- throw new TypeError(
109
- `Values given to isQuerySelector() must be inside of an object. "${type}" given.`
110
- );
111
- }
112
-
113
- for (const key in values) {
114
- try {
115
- if (values[key] === null) {
116
- throw new Error();
117
- }
118
-
119
- document.querySelector(values[key]);
120
- } catch {
121
- throw new TypeError(
122
- `${key} must be a valid query selector. "${values[key]}" given.`
123
- );
124
- }
125
- }
126
-
127
- return {
128
- status: true,
129
- error: null,
130
- };
131
- } catch (error) {
132
- return {
133
- status: false,
134
- error,
135
- };
136
- }
137
- }
138
-
139
- /**
140
- * Checks to see if the provided value is either a string or an array of strings.
141
- *
142
- * The values must be provided inside of an object
143
- * so the variable name can be retrieved in case of errors.
144
- *
145
- * Will return `{ status: true }` if the check is successful.
146
- *
147
- * @param {Object<string, string[]>} values - The value(s) to check.
148
- * @return {Object<boolean, string>} - The result of the check.
149
- */
150
- export function isValidClassList(values) {
151
- try {
152
- if (typeof values !== "object" || Array.isArray(values)) {
153
- const type = typeof values;
154
-
155
- throw new TypeError(
156
- `Values given to isValidClassList() must be inside of an object. "${type}" given.`
157
- );
158
- }
159
-
160
- for (const key in values) {
161
- const type = typeof values[key];
162
-
163
- if (type !== "string") {
164
- if (Array.isArray(values[key])) {
165
- values[key].forEach((value) => {
166
- if (typeof value !== "string") {
167
- throw new TypeError(
168
- `${key} must be a string or an array of strings. An array containing non-strings given.`
169
- );
170
- }
171
- });
172
- } else {
173
- throw new TypeError(
174
- `${key} must be a string or an array of strings. "${type}" given.`
175
- );
176
- }
177
- } else {
178
- const obj = {};
179
- obj[key] = values[key];
180
-
181
- isQuerySelector(obj);
182
- }
183
- }
184
-
185
- return {
186
- status: true,
187
- error: null,
188
- };
189
- } catch (error) {
190
- return {
191
- status: false,
192
- error,
193
- };
194
- }
195
- }
196
-
197
- /**
198
- * Checks to see if the provided elements are using a specific tag.
199
- *
200
- * The elements must be provided inside of an object
201
- * so the variable name can be retrieved in case of errors.
202
- *
203
- * Will return `true` if the check is successful.
204
- *
205
- * @param {string} tagName - The name of the tag.
206
- * @param {Object<HTMLElement>} elements - The element(s) to check.
207
- * @return {boolean} - The result of the check.
208
- */
209
- export function isTag(tagName, elements) {
210
- if (
211
- isValidType("string", { tagName }).status &&
212
- isValidInstance(HTMLElement, elements).status
213
- ) {
214
- const tag = tagName.toLowerCase();
215
- let check = true;
216
-
217
- for (const key in elements) {
218
- if (elements[key].tagName.toLowerCase() !== tag) check = false;
219
- }
220
-
221
- return check;
222
- } else {
223
- return false;
224
- }
225
- }
@@ -1,145 +0,0 @@
1
- // @graupl/graupl default values.
2
- //
3
- // Generally, these should not be used directly when styling components unless a static value is needed.
4
- // They are mainly used to provide class selectors, fallbacks for custom properties, or loop values.
5
- //
6
- // They should not be used to define direct property values (i.e. font-size, color, etc.).
7
- // Those should be defined as custom properties in the `_variables.scss` file.
8
-
9
- @use "sass:map";
10
-
11
- // Prefix for custom properties and other naming conventions.
12
- $id: "graupl" !default;
13
- $prefix: "#{$id}-" !default;
14
-
15
- // Settings.
16
- $use-important: true !default;
17
- $screen-aware-utilities: true !default;
18
- $theme-aware-utilities: true !default;
19
- $state-aware-utilities: true !default;
20
- $use-layers: true !default;
21
-
22
- // Layout properties.
23
- $content-max-width: 96ch !default;
24
-
25
- // Screen sizes.
26
- $base-screen-sizes: (
27
- xs: 0,
28
- sm: 48ch,
29
- md: 72ch,
30
- lg: 108ch,
31
- xl: 156ch,
32
- );
33
- $custom-screen-sizes: () !default;
34
- $screen-sizes: map.merge($base-screen-sizes, $custom-screen-sizes);
35
- $base-screen-size-triggers: (
36
- navigation-collapse: (
37
- mixin: "down",
38
- args: (
39
- "sm",
40
- ),
41
- ),
42
- navigation-expand: (
43
- mixin: "up",
44
- args: (
45
- "md",
46
- ),
47
- ),
48
- force-vertical-card: (
49
- mixin: "down",
50
- args: (
51
- "sm",
52
- ),
53
- ),
54
- force-single-column: (
55
- mixin: "down",
56
- args: (
57
- "xs",
58
- ),
59
- ),
60
- );
61
- $custom-screen-size-triggers: () !default;
62
- $screen-size-triggers: map.merge(
63
- $base-screen-size-triggers,
64
- $custom-screen-size-triggers
65
- );
66
-
67
- // Spacing properties.
68
- $spacer: 1rem !default;
69
- $base-spacer-multipliers: (
70
- 0: 0,
71
- 1: 0.125,
72
- 2: 0.25,
73
- 3: 0.5,
74
- 4: 0.75,
75
- 5: 1,
76
- 6: 1.5,
77
- 7: 2,
78
- 8: 3,
79
- 9: 5,
80
- 10: 10,
81
- );
82
- $custom-spacer-multipliers: () !default;
83
- $spacer-multipliers: map.merge(
84
- $base-spacer-multipliers,
85
- $custom-spacer-multipliers
86
- );
87
-
88
- // Size properties.
89
- $interactive-min-width: 44px !default;
90
- $interactive-min-height: 44px !default;
91
-
92
- // Border properties.
93
- $border-radius: 0.125rem !default;
94
- $border-width: 0.125rem !default;
95
- $border-style: solid !default;
96
-
97
- // Transition properties.
98
- $transition-duration-base: 100 !default;
99
- $transition-timing-function: ease !default;
100
- $base-transition-durations: (
101
- fast: #{$transition-duration-base * 1.5}ms,
102
- default: #{$transition-duration-base * 2.5}ms,
103
- slow: #{$transition-duration-base * 3}ms,
104
- );
105
- $custom-transition-durations: () !default;
106
- $transition-durations: map.merge(
107
- $base-transition-durations,
108
- $custom-transition-durations
109
- );
110
-
111
- // State selectors.
112
- $base-state-selectors: (
113
- visited: (
114
- ".visited",
115
- ":visited",
116
- ),
117
- focus: (
118
- ".focus",
119
- ":focus-visible",
120
- ),
121
- hover: (
122
- ".hover",
123
- ":hover",
124
- ),
125
- active: (
126
- ".active",
127
- ":active",
128
- ),
129
- disabled: (
130
- ".disabled",
131
- ":disabled",
132
- "[disabled]",
133
- "[aria-disabled=true]",
134
- ),
135
- );
136
- $custom-state-selectors: () !default;
137
- $state-selectors: map.merge($base-state-selectors, $custom-state-selectors);
138
-
139
- // Utility properties.
140
- $utility-selector-prefix: "." !default;
141
-
142
- // Utility modifier separators.
143
- $utility-screen-aware-separator: "\\:" !default;
144
- $utility-theme-aware-separator: "\\:" !default;
145
- $utility-state-aware-separator: "\\:" !default;
@@ -1,15 +0,0 @@
1
- // @graupl/graupl styles.
2
-
3
- // Forward the layer initialization.
4
- @forward "init";
5
-
6
- // Forward normalize.
7
- @forward "normalize";
8
-
9
- // Forward all layers.
10
- @forward "base";
11
- @forward "layout";
12
- @forward "component";
13
- @forward "state";
14
- @forward "theme";
15
- @forward "utilities";
@@ -1,3 +0,0 @@
1
- // @graupl/graupl layer initialization styles.
2
-
3
- @layer graupl.normalize, graupl.base, graupl.layout, graupl.component, graupl.theme, graupl.utilities, graupl.state;