@natachah/vanilla-frontend 0.4.0 → 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 (283) hide show
  1. package/.gitlab-ci.yml +22 -13
  2. package/LICENSE.md +1 -1
  3. package/docs/.vitepress/config.mts +101 -0
  4. package/docs/base/layout.md +77 -0
  5. package/docs/base/media.md +146 -0
  6. package/docs/base/reset.md +33 -0
  7. package/docs/base/typography.md +296 -0
  8. package/docs/classes/badge.md +146 -0
  9. package/docs/classes/breadcrumb.md +54 -0
  10. package/docs/classes/card.md +171 -0
  11. package/docs/classes/dropdown.md +180 -0
  12. package/docs/classes/grid.md +230 -0
  13. package/docs/classes/list.md +90 -0
  14. package/docs/components/button.md +254 -0
  15. package/docs/components/dialog.md +223 -0
  16. package/docs/components/disclosure.md +169 -0
  17. package/docs/components/form.md +514 -0
  18. package/docs/components/loading.md +53 -0
  19. package/docs/components/popover.md +270 -0
  20. package/docs/components/progress.md +33 -0
  21. package/docs/components/table.md +175 -0
  22. package/docs/index.md +27 -0
  23. package/docs/javascript/autofill.md +155 -0
  24. package/docs/javascript/check.md +53 -0
  25. package/docs/javascript/comfort.md +125 -0
  26. package/docs/javascript/consent.md +89 -0
  27. package/docs/javascript/cookie.md +33 -0
  28. package/docs/javascript/drawer.md +99 -0
  29. package/docs/javascript/form.md +130 -0
  30. package/docs/javascript/scroll.md +104 -0
  31. package/docs/javascript/slider.md +130 -0
  32. package/docs/javascript/sortable.md +127 -0
  33. package/docs/javascript/tabpanel.md +72 -0
  34. package/docs/javascript/toggle.md +182 -0
  35. package/docs/javascript/trap.md +33 -0
  36. package/docs/javascript/tree.md +220 -0
  37. package/docs/prologue/conventions.md +92 -0
  38. package/docs/prologue/release.md +44 -0
  39. package/docs/prologue/upgrade.md +21 -0
  40. package/docs/{pages/demo/layout.html → public/demo/demo.html} +1 -2
  41. package/docs/start/customization.md +184 -0
  42. package/docs/start/install.md +80 -0
  43. package/docs/start/mixin.md +203 -0
  44. package/docs/vuejs/ComponentPreview.vue +99 -0
  45. package/js/_slider.js +17 -1
  46. package/js/vanilla-frontend-doc.js +105 -0
  47. package/natachah-vanilla-frontend-1.0.0.tgz +0 -0
  48. package/package.json +11 -14
  49. package/public/404.html +22 -0
  50. package/public/assets/app.DsgDPRSA.js +1 -0
  51. package/public/assets/base_layout.md.CTGv6rTn.js +13 -0
  52. package/public/assets/base_layout.md.CTGv6rTn.lean.js +1 -0
  53. package/public/assets/base_media.md.CcuDUcF-.js +24 -0
  54. package/public/assets/base_media.md.CcuDUcF-.lean.js +1 -0
  55. package/public/assets/base_reset.md.DqIdqFRJ.js +3 -0
  56. package/public/assets/base_reset.md.DqIdqFRJ.lean.js +1 -0
  57. package/public/assets/base_typography.md.DV-ikqGZ.js +87 -0
  58. package/public/assets/base_typography.md.DV-ikqGZ.lean.js +1 -0
  59. package/public/assets/chunks/ComponentPreview.BW2s4ay5.js +27 -0
  60. package/public/assets/chunks/framework.CaiDwmc7.js +4 -0
  61. package/public/assets/chunks/theme.DL_11MHV.js +1 -0
  62. package/public/assets/classes_badge.md.BCGzPr6f.js +24 -0
  63. package/public/assets/classes_badge.md.BCGzPr6f.lean.js +1 -0
  64. package/public/assets/classes_breadcrumb.md.vU6jlo36.js +15 -0
  65. package/public/assets/classes_breadcrumb.md.vU6jlo36.lean.js +1 -0
  66. package/public/assets/classes_card.md.BZEh2l_B.js +41 -0
  67. package/public/assets/classes_card.md.BZEh2l_B.lean.js +1 -0
  68. package/public/assets/classes_dropdown.md.BLVw_xQY.js +70 -0
  69. package/public/assets/classes_dropdown.md.BLVw_xQY.lean.js +1 -0
  70. package/public/assets/classes_grid.md.47v-Ybqe.js +45 -0
  71. package/public/assets/classes_grid.md.47v-Ybqe.lean.js +1 -0
  72. package/public/assets/classes_list.md.BW9PWZV1.js +36 -0
  73. package/public/assets/classes_list.md.BW9PWZV1.lean.js +1 -0
  74. package/public/assets/components_button.md.vx3HzdpN.js +45 -0
  75. package/public/assets/components_button.md.vx3HzdpN.lean.js +1 -0
  76. package/public/assets/components_dialog.md.C-0gJGus.js +76 -0
  77. package/public/assets/components_dialog.md.C-0gJGus.lean.js +1 -0
  78. package/public/assets/components_disclosure.md.DeSRu9_P.js +53 -0
  79. package/public/assets/components_disclosure.md.DeSRu9_P.lean.js +1 -0
  80. package/public/assets/components_form.md.Be8d5WFv.js +122 -0
  81. package/public/assets/components_form.md.Be8d5WFv.lean.js +1 -0
  82. package/public/assets/components_loading.md.CKDG7z5x.js +4 -0
  83. package/public/assets/components_loading.md.CKDG7z5x.lean.js +1 -0
  84. package/public/assets/components_popover.md.CwgNttNc.js +102 -0
  85. package/public/assets/components_popover.md.CwgNttNc.lean.js +1 -0
  86. package/public/assets/components_progress.md.CNC7rJiC.js +6 -0
  87. package/public/assets/components_progress.md.CNC7rJiC.lean.js +1 -0
  88. package/public/assets/components_table.md.LyBkIDkF.js +75 -0
  89. package/public/assets/components_table.md.LyBkIDkF.lean.js +1 -0
  90. package/public/assets/index.md.CJiHmjB7.js +1 -0
  91. package/public/assets/index.md.CJiHmjB7.lean.js +1 -0
  92. package/public/assets/inter-italic-cyrillic-ext.r48I6akx.woff2 +0 -0
  93. package/public/assets/inter-italic-cyrillic.By2_1cv3.woff2 +0 -0
  94. package/public/assets/inter-italic-greek-ext.1u6EdAuj.woff2 +0 -0
  95. package/public/assets/inter-italic-greek.DJ8dCoTZ.woff2 +0 -0
  96. package/public/assets/inter-italic-latin-ext.CN1xVJS-.woff2 +0 -0
  97. package/public/assets/inter-italic-latin.C2AdPX0b.woff2 +0 -0
  98. package/public/assets/inter-italic-vietnamese.BSbpV94h.woff2 +0 -0
  99. package/public/assets/inter-roman-cyrillic-ext.BBPuwvHQ.woff2 +0 -0
  100. package/public/assets/inter-roman-cyrillic.C5lxZ8CY.woff2 +0 -0
  101. package/public/assets/inter-roman-greek-ext.CqjqNYQ-.woff2 +0 -0
  102. package/public/assets/inter-roman-greek.BBVDIX6e.woff2 +0 -0
  103. package/public/assets/inter-roman-latin-ext.4ZJIpNVo.woff2 +0 -0
  104. package/public/assets/inter-roman-latin.Di8DUHzh.woff2 +0 -0
  105. package/public/assets/inter-roman-vietnamese.BjW4sHH5.woff2 +0 -0
  106. package/public/assets/javascript_autofill.md.BewVUo4H.js +49 -0
  107. package/public/assets/javascript_autofill.md.BewVUo4H.lean.js +1 -0
  108. package/public/assets/javascript_check.md.B6ajE66i.js +13 -0
  109. package/public/assets/javascript_check.md.B6ajE66i.lean.js +1 -0
  110. package/public/assets/javascript_comfort.md.BRci3j7V.js +20 -0
  111. package/public/assets/javascript_comfort.md.BRci3j7V.lean.js +1 -0
  112. package/public/assets/javascript_consent.md.Bjv8ZDS6.js +29 -0
  113. package/public/assets/javascript_consent.md.Bjv8ZDS6.lean.js +1 -0
  114. package/public/assets/javascript_cookie.md.Dlhyk4Ha.js +2 -0
  115. package/public/assets/javascript_cookie.md.Dlhyk4Ha.lean.js +1 -0
  116. package/public/assets/javascript_drawer.md.BCJX3fL-.js +32 -0
  117. package/public/assets/javascript_drawer.md.BCJX3fL-.lean.js +1 -0
  118. package/public/assets/javascript_form.md.Cwf_gxLI.js +40 -0
  119. package/public/assets/javascript_form.md.Cwf_gxLI.lean.js +2 -0
  120. package/public/assets/javascript_scroll.md.BrJijWbF.js +30 -0
  121. package/public/assets/javascript_scroll.md.BrJijWbF.lean.js +1 -0
  122. package/public/assets/javascript_slider.md.DDO8wC4u.js +27 -0
  123. package/public/assets/javascript_slider.md.DDO8wC4u.lean.js +1 -0
  124. package/public/assets/javascript_sortable.md.BKyem7yw.js +35 -0
  125. package/public/assets/javascript_sortable.md.BKyem7yw.lean.js +1 -0
  126. package/public/assets/javascript_tabpanel.md.D9M-_xE0.js +19 -0
  127. package/public/assets/javascript_tabpanel.md.D9M-_xE0.lean.js +1 -0
  128. package/public/assets/javascript_toggle.md.C8582WNC.js +46 -0
  129. package/public/assets/javascript_toggle.md.C8582WNC.lean.js +1 -0
  130. package/public/assets/javascript_trap.md.Bc59YUng.js +2 -0
  131. package/public/assets/javascript_trap.md.Bc59YUng.lean.js +1 -0
  132. package/public/assets/javascript_tree.md.uc1UUsFV.js +72 -0
  133. package/public/assets/javascript_tree.md.uc1UUsFV.lean.js +1 -0
  134. package/public/assets/prologue_conventions.md.D8nVwlRS.js +34 -0
  135. package/public/assets/prologue_conventions.md.D8nVwlRS.lean.js +1 -0
  136. package/public/assets/prologue_release.md.CG6nuFnt.js +1 -0
  137. package/public/assets/prologue_release.md.CG6nuFnt.lean.js +1 -0
  138. package/public/assets/prologue_upgrade.md.CFxokaBG.js +1 -0
  139. package/public/assets/prologue_upgrade.md.CFxokaBG.lean.js +1 -0
  140. package/public/assets/start_customization.md.t-ze_NoQ.js +141 -0
  141. package/public/assets/start_customization.md.t-ze_NoQ.lean.js +1 -0
  142. package/public/assets/start_install.md.OluH7l11.js +46 -0
  143. package/public/assets/start_install.md.OluH7l11.lean.js +1 -0
  144. package/public/assets/start_mixin.md.D76cLRSX.js +85 -0
  145. package/public/assets/start_mixin.md.D76cLRSX.lean.js +1 -0
  146. package/public/assets/style.zIeGMibA.css +1 -0
  147. package/public/base/layout.html +37 -0
  148. package/public/base/media.html +179 -0
  149. package/public/base/reset.html +27 -0
  150. package/public/base/typography.html +320 -0
  151. package/public/bundles/vanilla-frontend-doc.css +1 -0
  152. package/public/bundles/vanilla-frontend-doc.js +1 -0
  153. package/public/bundles/vanilla-frontend.css +1 -0
  154. package/public/classes/badge.html +205 -0
  155. package/public/classes/breadcrumb.html +66 -0
  156. package/public/classes/card.html +222 -0
  157. package/public/classes/dropdown.html +147 -0
  158. package/public/classes/grid.html +278 -0
  159. package/public/classes/list.html +113 -0
  160. package/public/components/button.html +304 -0
  161. package/public/components/dialog.html +205 -0
  162. package/public/components/disclosure.html +130 -0
  163. package/public/components/form.html +589 -0
  164. package/public/components/loading.html +107 -0
  165. package/public/components/popover.html +257 -0
  166. package/public/components/progress.html +57 -0
  167. package/public/components/table.html +152 -0
  168. package/public/demo/demo.html +84 -0
  169. package/public/hashmap.json +1 -0
  170. package/public/index.html +25 -0
  171. package/public/javascript/autofill.html +152 -0
  172. package/public/javascript/check.html +64 -0
  173. package/public/javascript/comfort.html +123 -0
  174. package/public/javascript/consent.html +80 -0
  175. package/public/javascript/cookie.html +26 -0
  176. package/public/javascript/drawer.html +83 -0
  177. package/public/javascript/form.html +117 -0
  178. package/public/javascript/scroll.html +81 -0
  179. package/public/javascript/slider.html +78 -0
  180. package/public/javascript/sortable.html +112 -0
  181. package/public/javascript/tabpanel.html +70 -0
  182. package/public/javascript/toggle.html +201 -0
  183. package/public/javascript/trap.html +26 -0
  184. package/public/javascript/tree.html +175 -0
  185. package/public/prologue/conventions.html +58 -0
  186. package/public/prologue/release.html +25 -0
  187. package/public/prologue/upgrade.html +25 -0
  188. package/public/start/customization.html +165 -0
  189. package/public/start/install.html +70 -0
  190. package/public/start/mixin.html +109 -0
  191. package/public/vp-icons.css +0 -0
  192. package/sandbox/index.html +27 -0
  193. package/sandbox/js/sandbox-header.js +57 -0
  194. package/sandbox/js/sandbox-test.js +91 -0
  195. package/sandbox/pages/base/layout.html +80 -0
  196. package/sandbox/pages/base/media.html +52 -0
  197. package/sandbox/pages/base/typography.html +132 -0
  198. package/sandbox/pages/components/button.html +70 -0
  199. package/sandbox/pages/components/dialog.html +72 -0
  200. package/sandbox/pages/components/disclosure.html +77 -0
  201. package/sandbox/pages/components/form.html +164 -0
  202. package/sandbox/pages/components/loading.html +32 -0
  203. package/sandbox/pages/components/popover.html +119 -0
  204. package/sandbox/pages/components/progress.html +28 -0
  205. package/sandbox/pages/components/table.html +80 -0
  206. package/sandbox/pages/customs/badge.html +59 -0
  207. package/sandbox/pages/customs/breadcrumb.html +34 -0
  208. package/sandbox/pages/customs/card.html +71 -0
  209. package/sandbox/pages/customs/dropdown.html +70 -0
  210. package/sandbox/pages/customs/grid.html +109 -0
  211. package/sandbox/pages/customs/list.html +43 -0
  212. package/sandbox/pages/javascript/autofill.html +39 -0
  213. package/sandbox/pages/javascript/checkall.html +37 -0
  214. package/sandbox/pages/javascript/comfort.html +41 -0
  215. package/sandbox/pages/javascript/consent.html +45 -0
  216. package/sandbox/pages/javascript/form.html +50 -0
  217. package/sandbox/pages/javascript/scroll.html +44 -0
  218. package/sandbox/pages/javascript/slider.html +44 -0
  219. package/sandbox/pages/javascript/sortable.html +56 -0
  220. package/sandbox/pages/javascript/tabpanel.html +39 -0
  221. package/sandbox/pages/javascript/toggle.html +72 -0
  222. package/sandbox/pages/javascript/tree.html +96 -0
  223. package/sandbox/sandbox.js +26 -0
  224. package/sandbox/scss/sandbox-header.scss +93 -0
  225. package/scss/base/_reset.scss +2 -0
  226. package/scss/components/_badge.scss +2 -1
  227. package/scss/components/_dropdown.scss +2 -2
  228. package/scss/components/_group.scss +8 -4
  229. package/scss/components/_popover.scss +74 -0
  230. package/scss/components/index.scss +1 -0
  231. package/scss/themes/_root.scss +3 -0
  232. package/scss/vanilla-frontend-doc.scss +46 -1
  233. package/scss/vanilla-frontend-sandbox.scss +34 -0
  234. package/vite.config.js +30 -0
  235. package/docs/index.html +0 -36
  236. package/docs/main-demo.js +0 -2
  237. package/docs/main.js +0 -34
  238. package/docs/pages/base/layout.html +0 -131
  239. package/docs/pages/base/media.html +0 -142
  240. package/docs/pages/base/reset.html +0 -53
  241. package/docs/pages/base/typography.html +0 -334
  242. package/docs/pages/components/button.html +0 -202
  243. package/docs/pages/components/dialog.html +0 -336
  244. package/docs/pages/components/disclosure.html +0 -174
  245. package/docs/pages/components/form.html +0 -427
  246. package/docs/pages/components/loading.html +0 -58
  247. package/docs/pages/components/progress.html +0 -47
  248. package/docs/pages/components/table.html +0 -168
  249. package/docs/pages/customs/badge.html +0 -150
  250. package/docs/pages/customs/breadcrumb.html +0 -67
  251. package/docs/pages/customs/card.html +0 -185
  252. package/docs/pages/customs/drawer.html +0 -149
  253. package/docs/pages/customs/dropdown.html +0 -270
  254. package/docs/pages/customs/grid.html +0 -185
  255. package/docs/pages/customs/list.html +0 -112
  256. package/docs/pages/customs/slider.html +0 -273
  257. package/docs/pages/javascript/autofill.html +0 -170
  258. package/docs/pages/javascript/checkall.html +0 -59
  259. package/docs/pages/javascript/comfort.html +0 -146
  260. package/docs/pages/javascript/consent.html +0 -112
  261. package/docs/pages/javascript/cookie.html +0 -81
  262. package/docs/pages/javascript/form.html +0 -199
  263. package/docs/pages/javascript/scroll.html +0 -209
  264. package/docs/pages/javascript/sortable.html +0 -167
  265. package/docs/pages/javascript/tabpanel.html +0 -89
  266. package/docs/pages/javascript/toggle.html +0 -193
  267. package/docs/pages/javascript/trap.html +0 -89
  268. package/docs/pages/javascript/tree.html +0 -256
  269. package/docs/pages/quick-start/conventions.html +0 -112
  270. package/docs/pages/quick-start/customization.html +0 -184
  271. package/docs/pages/quick-start/installation.html +0 -97
  272. package/docs/pages/quick-start/mixins.html +0 -214
  273. package/docs/src/js/demo.js +0 -110
  274. package/docs/src/js/doc-code.js +0 -102
  275. package/docs/src/js/doc-demo.js +0 -14
  276. package/docs/src/js/doc-layout.js +0 -117
  277. package/docs/src/scss/demo.scss +0 -77
  278. package/docs/src/scss/layout.scss +0 -83
  279. package/docs/src/scss/style.scss +0 -278
  280. package/docs/vite.config.mjs +0 -23
  281. package/esbuild.mjs +0 -25
  282. package/natachah-vanilla-frontend-0.4.0.tgz +0 -0
  283. package/vitest.config.js +0 -8
@@ -0,0 +1,220 @@
1
+ <script setup>
2
+ import ComponentPreview from '../vuejs/ComponentPreview.vue'
3
+ </script>
4
+
5
+ # Tree <Badge type="warning" text="JS" />
6
+
7
+ ```js
8
+ import Tree from "@natachah/vanilla-frontend/js/_tree"
9
+ ```
10
+
11
+ ::: warning
12
+ The `role=tree` and `role=treeGrid` are not accessible !
13
+ :::
14
+
15
+ ## Syntax
16
+
17
+ The tree component make you able to make a tree view by adding the `role="tree"` attribute on a `<ul>` or `<ol>` tag.
18
+
19
+ The `<li>` must have a `role="treeitem"`, and if nested the `aria-expanded` and `aria-owns` attributes.
20
+
21
+ <ComponentPreview height="200px">
22
+ <ul class="demo-tree">
23
+ <li>1: Lorem, ipsum</li>
24
+ <li>
25
+ <button role="link" aria-controls="treelist" aria-expanded="false">
26
+ 1: Inventore, perspiciatis (Open)
27
+ </button>
28
+ <ul id="treelist" tabindex="0" hidden>
29
+ <li>2: Lorem</li>
30
+ <li>
31
+ <button role="link" aria-controls="subtreelist" aria-expanded="false">
32
+ 2: Adipisci (Open)
33
+ </button>
34
+ <ul id="subtreelist" tabindex="0" hidden>
35
+ <li>3: Lorem</li>
36
+ <li>3: Adipisci</li>
37
+ <li>3: Facilis</li>
38
+ </ul>
39
+ </li>
40
+ <li>1: Facilis</li>
41
+ </ul>
42
+ </li>
43
+ <li>1: Dolor, quis</li>
44
+ </ul>
45
+ </ComponentPreview>
46
+
47
+ ::: code-group
48
+
49
+ ```html
50
+ <ul class="demo-tree">
51
+ <li>1: Lorem, ipsum</li>
52
+ <li>
53
+ <button role="link" aria-controls="treelist" aria-expanded="false">
54
+ 1: Inventore, perspiciatis (Open)
55
+ </button>
56
+ <ul id="treelist" tabindex="0" hidden>
57
+ <li>2: Lorem</li>
58
+ <li>
59
+ <button role="link" aria-controls="subtreelist" aria-expanded="false">
60
+ 2: Adipisci (Open)
61
+ </button>
62
+ <ul id="subtreelist" tabindex="0" hidden>
63
+ <li>3: Lorem</li>
64
+ <li>3: Adipisci</li>
65
+ <li>3: Facilis</li>
66
+ </ul>
67
+ </li>
68
+ <li>1: Facilis</li>
69
+ </ul>
70
+ </li>
71
+ <li>1: Dolor, quis</li>
72
+ </ul>
73
+ ```
74
+
75
+ ```js
76
+ import Tree from "@natachah/vanilla-frontend/js/_tree"
77
+ const trees = document.querySelectorAll('.demo-tree')
78
+ if (trees) trees.forEach(tree => new Tree(tree))
79
+ ```
80
+
81
+ :::
82
+
83
+ ::: warning
84
+ Into a `<li>` you must add a `<button>` to toggle the children, otherwise it will toggle if you click on any child.
85
+ :::
86
+
87
+ ## Options
88
+
89
+ ### Table
90
+
91
+ This can also be implemented on a `<table>` but it required the `role="treegrid"` attribute.
92
+
93
+ <ComponentPreview height="200px">
94
+ <table id="treeGrid" class="demo-tree" role="treegrid">
95
+ <tbody>
96
+ <tr aria-level="1">
97
+ <td>1: Lorem, ipsum</td>
98
+ </tr>
99
+ <tr aria-level="1" aria-expanded="false" aria-controls="row1 row2 row3">
100
+ <td>1: Cum, dolorum (open me)</td>
101
+ </tr>
102
+ <tr id="row1" aria-level="2" tabindex="0" hidden>
103
+ <td>2: Lorem</td>
104
+ </tr>
105
+ <tr id="row2" aria-level="2" aria-expanded="false" aria-controls="row2-1 row2-2" hidden>
106
+ <td>2: Quo (open me)</td>
107
+ </tr>
108
+ <tr id="row2-1" aria-level="3" tabindex="0" hidden>
109
+ <td>2.1: Quo</td>
110
+ </tr>
111
+ <tr id="row2-2" aria-level="3" hidden>
112
+ <td>2.2: Quo</td>
113
+ </tr>
114
+ <tr id="row3" aria-level="2" hidden>
115
+ <td>2: Odio</td>
116
+ </tr>
117
+ <tr aria-level="1">
118
+ <td>1: Perspiciatis, tenetur</td>
119
+ </tr>
120
+ </tbody>
121
+ </table>
122
+ </ComponentPreview>
123
+
124
+ ```html
125
+ <table id="treeGrid" class="demo-tree" role="treegrid">
126
+ <tbody>
127
+ <tr aria-level="1">
128
+ <td>1: Lorem, ipsum</td>
129
+ </tr>
130
+ <tr aria-level="1" aria-expanded="false" aria-controls="row1 row2 row3">
131
+ <td>1: Cum, dolorum (open me)</td>
132
+ </tr>
133
+ <tr id="row1" aria-level="2" tabindex="0" hidden>
134
+ <td>2: Lorem</td>
135
+ </tr>
136
+ <tr id="row2" aria-level="2" aria-expanded="false" aria-controls="row2-1 row2-2" hidden>
137
+ <td>2: Quo (open me)</td>
138
+ </tr>
139
+ <tr id="row2-1" aria-level="3" tabindex="0" hidden>
140
+ <td>2.1: Quo</td>
141
+ </tr>
142
+ <tr id="row2-2" aria-level="3" hidden>
143
+ <td>2.2: Quo</td>
144
+ </tr>
145
+ <tr id="row3" aria-level="2" hidden>
146
+ <td>2: Odio</td>
147
+ </tr>
148
+ <tr aria-level="1">
149
+ <td>1: Perspiciatis, tenetur</td>
150
+ </tr>
151
+ </tbody>
152
+ </table>
153
+ ```
154
+
155
+ ### Handles
156
+
157
+ You can decide which part of the item toggle the open/close method with the `data-handle="tree"` attribute
158
+
159
+ <ComponentPreview height="200px">
160
+ <table class="demo-tree">
161
+ <tbody>
162
+ <tr aria-level="1" aria-expanded="false" aria-controls="rowExpandable">
163
+ <td>
164
+ <span data-handle="tree">
165
+ (open me)
166
+ </span>
167
+ </td>
168
+ <td>1: Cum, dolorum</td>
169
+ </tr>
170
+ <tr id="rowExpandable" aria-level="2" tabindex="0" hidden>
171
+ <td></td>
172
+ <td>1.1: Lorem</td>
173
+ </tr>
174
+ </tbody>
175
+ </table>
176
+ </ComponentPreview>
177
+
178
+
179
+ ```html
180
+ <table class="demo-tree">
181
+ <tbody>
182
+ <tr aria-level="1" aria-expanded="false" aria-controls="rowExpandable">
183
+ <td>
184
+ <span data-handle="tree">
185
+ (open me)
186
+ </span>
187
+ </td>
188
+ <td>1: Cum, dolorum</td>
189
+ </tr>
190
+ <tr id="rowExpandable" aria-level="2" tabindex="0" hidden>
191
+ <td></td>
192
+ <td>1.1: Lorem</td>
193
+ </tr>
194
+ </tbody>
195
+ </table>
196
+ ```
197
+
198
+ If there is an `<svg>` as handle, the default style will provide an animation.
199
+
200
+
201
+ ## Javascript
202
+
203
+ | Method | Description |
204
+ | --- | --- |
205
+ | resetEvents() | This method will reset the items and events |
206
+
207
+ ### Events
208
+
209
+ | Event name | Description | Value |
210
+ |---|---|---|
211
+ | tree:changed | This event is fired when an item is toggled | isOpen as a boolean |
212
+
213
+ ```js
214
+ const myTree = document.getElementById('myTree')
215
+
216
+ myTree.addEventListener('tree:changed', (e) => {
217
+ const isOpen = e.detail.isOpen
218
+ ...
219
+ })
220
+ ```
@@ -0,0 +1,92 @@
1
+ # Naming conventions
2
+
3
+ Because all project should have some little rules...
4
+
5
+ ## Almost classless
6
+
7
+ The framework try to be classless as much as possible, this are the exeptions:
8
+
9
+ - .accordion
10
+ - .badge
11
+ - .breadcrumb
12
+ - .card
13
+ - .container
14
+ - .container-full
15
+ - .drawer
16
+ - .drawer-button
17
+ - .dropdown
18
+ - .grid
19
+ - .flex-grid
20
+ - .slider
21
+ - .subgrid
22
+ - .group
23
+ - .list
24
+
25
+ And for variations:
26
+
27
+ - .outline
28
+ - .COLORNAME (e.g.: .primary)
29
+
30
+ ::: warning
31
+ For good practice avoid as much it's possible classes !
32
+ :::
33
+
34
+ ## HTML, CSS and SCSS
35
+
36
+ - The custom properties and variable must be kebab-case
37
+ - Private properties start with an underscore
38
+ - The classes must be kebab-case
39
+ - The IDs must be camelCase
40
+ - Use comment like in [SassDoc](http://sassdoc.com/)
41
+
42
+ ```scss
43
+ :root {
44
+ --global-property: red;
45
+ }
46
+
47
+ .my-class {
48
+ background-color: var(--global-property)
49
+ }
50
+
51
+ #myId {
52
+ --_private-property: green;
53
+ background-color: var(--_private-property);
54
+ }
55
+
56
+ /// Description of the mixin
57
+ ///
58
+ /// @example something(red) // color: red
59
+ /// @link http://sassdoc.com/annotations/
60
+ /// @require {mixin} something
61
+ /// @param {name} $name - The description
62
+ /// @access public
63
+ ///
64
+ @mixin something($name){
65
+ color: $name
66
+ }
67
+ ```
68
+
69
+ ::: warning
70
+ Limit the number of **custom properties defined**, using too many of them can impact performance. Avoid unnecessary complexity.
71
+ :::
72
+
73
+ ## Javascript
74
+
75
+ - The variable and method name must be camelCase
76
+ - Use comment like in [JSDoc](https://jsdoc.app/)
77
+ - Use single quote
78
+ - Avoid semicolon
79
+
80
+ ```js
81
+ /**
82
+ * Explaination of the method
83
+ *
84
+ * @param {number} length - The length of the rectangle
85
+ * @param {number} width - The width of the rectangle
86
+ * @returns {number} - The area of the rectangle
87
+ */
88
+ function calculate(length, width) {
89
+ const myVariable = 'nothing'
90
+ return length * height
91
+ }
92
+ ```
@@ -0,0 +1,44 @@
1
+ # Release note
2
+
3
+ ## Versioning Scheme
4
+
5
+ The package use a three-part numbering system (e.g., 1.2.3) to track updates. This helps the developers to understand the scope of changes at a glance.
6
+
7
+ ### The "Patch" Release (0.0.X)
8
+
9
+ The third digit is reserved for small fixes.
10
+
11
+ - **Purpose:** Bug fixes, security patches, or minor text corrections.
12
+ - **Impact:** These updates do not change how the site functions and are safe to deploy immediately.
13
+ - **Example:** Moving from 1.0.1 to 1.0.2.
14
+
15
+ ### The "Minor" Release (0.X.0)
16
+
17
+ The second digit represents medium-sized updates.
18
+
19
+ - **Purpose:** Adding new features or making significant modifications to existing ones.
20
+ - **Impact:** These introduce new functionality but remain backward-compatible (they should not "break" the existing setup !).
21
+ - **Example:** Moving from 1.1.0 to 1.2.0.
22
+
23
+ ### The "Major" Release (X.0.0)
24
+
25
+ The first digit indicates major structural changes.
26
+
27
+ - **Purpose:** Complete redesigns, total code refactoring, or breaking changes that alter how the system works fundamentally.
28
+ - **Impact:** These are significant milestones and often require thorough testing before deployment.
29
+ - **Example:** Moving from 1.0.0 to 2.0.0.
30
+
31
+ ## GIT branches
32
+
33
+ The package supports the current version and one previous version. Here the branches naming convention:
34
+
35
+ - **main:** Is the latest version DEV branch
36
+ - **production:** Is the latest version PROD branch
37
+ - **support/vx.x.x :** Is the legacy version PROD branches per MAJOR+MINOR release
38
+ - **hotfix/vx.x.x :** Is the legacy version DEV branches for PATCH release only
39
+
40
+ ## Support Policy
41
+
42
+ The current version of the package is construct with SCSS and vanilla JS !
43
+
44
+ Make sure you can use some of the new HTML/CSS/JS into the browser !
@@ -0,0 +1,21 @@
1
+ # Upgrade Guide
2
+
3
+ ## 0.4.0 to 1.0.0
4
+
5
+ These update includes some changes as:
6
+
7
+ - [Doc](#doc)
8
+ - [Popover](#popover)
9
+ - [Slider](#slider)
10
+
11
+ ### Doc
12
+
13
+ The most important change is the Documentation ! Now it is in Vitepress, and you have access to. a Sandbox via `npm run sandbox` to play with the code and test it.
14
+
15
+ ### Popover
16
+
17
+ There is the new Popover component, and it will replace the current Dropdown. But be carefull because not all browser support it yet :-)
18
+
19
+ ### Slider
20
+
21
+ The slider has the ability to have a play and a pause button for more accessibility.
@@ -5,7 +5,7 @@
5
5
  <meta charset="UTF-8" />
6
6
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
7
  <title>Documentations: Layout > Demo</title>
8
-
8
+ <link rel="stylesheet" href="/bundles/vanilla-frontend.css">
9
9
  <style>
10
10
  #content {
11
11
  --subgrid-gap-block: 1rem;
@@ -34,7 +34,6 @@
34
34
 
35
35
  @media (min-width: 1440px) {}
36
36
  </style>
37
-
38
37
  </head>
39
38
 
40
39
  <body data-preload>
@@ -0,0 +1,184 @@
1
+ # Customization
2
+
3
+ The framework make you able to customize almost everything. But keep in mind that most of the work will be to create you own components per website !
4
+
5
+ ## CSS custom properties
6
+
7
+ There is a bunch of default CSS custom properties, and (almost) each component have their own properties if needed.
8
+
9
+ ### Root
10
+
11
+ In the `:root` set the default CSS properties that are global to all your website.
12
+
13
+ You also can split in multiple files, e.g.: `root.scss` and `color.scss`..
14
+
15
+ You can use the default file `@natachah/vanilla-frontend/scss/themes/_root.scss`, or copy this code in your own file:
16
+
17
+ ```scss
18
+ ////
19
+ /// ------------------------------------------------------------------
20
+ /// Root
21
+ /// ------------------------------------------------------------------
22
+ /// Regroup all the default CSS custom properties
23
+ ///
24
+ /// @group themes
25
+ /// @author Natacha Herth
26
+ ///
27
+ ////
28
+
29
+ :root {
30
+
31
+ // Typography
32
+ --font-size: 16px;
33
+ --line-height: 1.5;
34
+ --font-family: Arial;
35
+ --font-weight: normal;
36
+ --font-weight-light: 300;
37
+ --font-weight-medium: 500;
38
+ --font-weight-bold: 600;
39
+
40
+ --font-size-h1: 2.25em; // 36px
41
+ --font-size-h2: 2.00em; // 32px
42
+ --font-size-h3: 1.75em; // 28px
43
+ --font-size-h4: 1.50em; // 24px
44
+ --font-size-h5: 1.25em; // 20px
45
+ --font-size-h6: 1.125em; // 18px
46
+ --font-size-large: 1.25em;
47
+ --font-size-medium: 1.125em;
48
+ --font-size-small: .875em;
49
+
50
+ --word-spacing: normal;
51
+ --letter-spacing: normal;
52
+
53
+ // Anchor
54
+ --decoration: none;
55
+
56
+ // Layouts
57
+ --padding-inline: .75em;
58
+ --padding-block: .5em;
59
+
60
+ // Border
61
+ --border-size: 1px;
62
+ --border-style: solid;
63
+ --border-radius: .25rem;
64
+
65
+ // Outline (:focus)
66
+ --outline-size: 3px;
67
+ --outline-style: solid;
68
+ --outline-offset: 0;
69
+ // --outline-color: var(--color-primary);
70
+
71
+ // Backdrop
72
+ --backdrop-color: rgba(0, 0, 0, .5);
73
+
74
+ // Hover (color-mix)
75
+ --hover-color: black;
76
+ --hover-percent: 5%;
77
+
78
+ // Active (color-mix)
79
+ --active-color: black;
80
+ --active-percent: 10%;
81
+
82
+ // Focus (color-mix)
83
+ --focus-color: currentColor;
84
+ --focus-percent: 50%;
85
+
86
+ // Disabled
87
+ --disabled-opacity: 50%;
88
+
89
+ // Colors
90
+ --color-body: white;
91
+ --color-font: black;
92
+ --color-primary: #B790E5;
93
+ --color-error: #DC3030;
94
+ --color-success: #008A00;
95
+ --color-warning: #FFA500;
96
+
97
+ // Contrasts
98
+ --color-warning-contrast: black;
99
+
100
+ // Form
101
+ --form-border-color: currentColor;
102
+ --form-active-background: color-mix(in srgb, var(--form-background, transparent), var(--active-color, currentColor) 40%);
103
+
104
+ // Icons
105
+ --icon-external: url('data: image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" ><path fill-rule="evenodd" d="M8.636 3.5a.5.5 0 0 0-.5-.5H1.5A1.5 1.5 0 0 0 0 4.5v10A1.5 1.5 0 0 0 1.5 16h10a1.5 1.5 0 0 0 1.5-1.5V7.864a.5.5 0 0 0-1 0V14.5a.5.5 0 0 1-.5.5h-10a.5.5 0 0 1-.5-.5v-10a.5.5 0 0 1 .5-.5h6.636a.5.5 0 0 0 .5-.5" /><path fill-rule="evenodd" d="M16 .5a.5.5 0 0 0-.5-.5h-5a.5.5 0 0 0 0 1h3.793L6.146 9.146a.5.5 0 1 0 .708.708L15 1.707V5.5a.5.5 0 0 0 1 0z" /></svg>');
106
+ --icon-date: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="black" viewBox="0 0 16 16"><path d="M3.5 0a.5.5 0 0 1 .5.5V1h8V.5a.5.5 0 0 1 1 0V1h1a2 2 0 0 1 2 2v11a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V3a2 2 0 0 1 2-2h1V.5a.5.5 0 0 1 .5-.5zM1 4v10a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V4H1z"/></svg>');
107
+ --icon-time: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" viewBox="0 0 16 16"><path d="M8 3.5a.5.5 0 0 0-1 0V9a.5.5 0 0 0 .252.434l3.5 2a.5.5 0 0 0 .496-.868L8 8.71V3.5z"/><path d="M8 16A8 8 0 1 0 8 0a8 8 0 0 0 0 16zm7-8A7 7 0 1 1 1 8a7 7 0 0 1 14 0z"/></svg>');
108
+ --icon-file: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" viewBox="0 0 16 16"><path d="M.5 9.9a.5.5 0 0 1 .5.5v2.5a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-2.5a.5.5 0 0 1 1 0v2.5a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2v-2.5a.5.5 0 0 1 .5-.5z"/><path d="M7.646 1.146a.5.5 0 0 1 .708 0l3 3a.5.5 0 0 1-.708.708L8.5 2.707V11.5a.5.5 0 0 1-1 0V2.707L5.354 4.854a.5.5 0 1 1-.708-.708l3-3z"/></svg>');
109
+ --icon-select: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" viewBox="0 0 16 16"><path fill-rule="evenodd" d="M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z"/></svg>');
110
+ --icon-radio: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="white" viewBox="0 0 16 16"><circle cx="8" cy="8" r="8"/></svg>');
111
+ --icon-check: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="white" viewBox="0 0 16 16"><path d="M10.97 4.97a.75.75 0 0 1 1.07 1.05l-3.99 4.99a.75.75 0 0 1-1.08.02L4.324 8.384a.75.75 0 1 1 1.06-1.06l2.094 2.093 3.473-4.425a.267.267 0 0 1 .02-.022z"/></svg>');
112
+ --icon-switch: var(--icon-radio);
113
+
114
+ // Layout
115
+ --layout-width: 1280px;
116
+ --layout-gap-block: 1rem;
117
+ --layout-gap-inline: 1rem;
118
+ --layout-columns: 1;
119
+
120
+ @media (min-width: 720px) {
121
+ --layout-columns: 6;
122
+ --layout-gap-block: 1rem;
123
+ --layout-gap-inline: 1rem;
124
+ }
125
+
126
+ @media (min-width: 1024px) {
127
+ --layout-columns: 12;
128
+ --layout-gap-block: 2rem;
129
+ --layout-gap-inline: 2rem;
130
+ }
131
+
132
+ @media (min-width: 1440px) {
133
+ --layout-columns: 12;
134
+ --layout-gap-block: 4rem;
135
+ --layout-gap-inline: 2rem;
136
+ }
137
+
138
+ }
139
+ ```
140
+
141
+ ### Themes
142
+
143
+ You can define some CSS properties per theme with the attribute `[data-theme=MYTHEME]`:
144
+
145
+ ```scss
146
+ // This is the light theme (or if there is none)
147
+ html[data-theme=light],
148
+ html:not([data-theme]) {
149
+ --color-body: white;
150
+ --color-font: black;
151
+ }
152
+
153
+ // This is for the dark theme
154
+ html[data-theme=dark] {
155
+ --color-body: black;
156
+ --color-font: white;
157
+ }
158
+
159
+ // This is for the dark theme
160
+ html[data-theme=my-custom-theme] {
161
+ --color-body: white;
162
+ --color-font: orange;
163
+ }
164
+ ```
165
+
166
+ ::: tip
167
+ In best practive it will be better to have a file per theme.
168
+ :::
169
+
170
+ ### SCSS options
171
+
172
+ You can set custom settings with `@use "@natachah/vanilla-frontend/scss/components/..." with ( ... );`.
173
+ These custom values will override the default variables.
174
+
175
+ There is also a `$default-item-properties` to define the default properties to use for items *(see mixins)*
176
+
177
+ There is 4 components that use this syntax, and that you can pass the `$colors` and if there is the `$outline` style enable:
178
+
179
+ ```scss
180
+ @use "./components/badge" with ($colors: ('primary'), $outline: true);
181
+ @use "./components/button" with ($colors: ('primary'), $outline: true);
182
+ @use "./components/card" with ($colors: ('primary'), $outline: true);
183
+ @use "./components/popover" with ($colors: ('primary'));
184
+ ```
@@ -0,0 +1,80 @@
1
+ # Installation
2
+
3
+ ## NPM
4
+
5
+ Install the latest package via NPM
6
+
7
+ ```ssh
8
+ npm i @natachah/vanilla-frontend
9
+ ```
10
+
11
+ ## SCSS
12
+
13
+ You can import the global SCSS file:
14
+
15
+ ```scss
16
+ @use '@natachah/vanilla-frontend/scss/vanilla-frontend.scss';
17
+ ```
18
+
19
+ Or better, include **only the files that you need**, here the template with all files:
20
+
21
+ ```scss
22
+ // Should be overide by your own files
23
+ @use '@natachah/vanilla-frontend/scss/themes/_root';
24
+
25
+ // If you need to use the mixin
26
+ @use '@natachah/vanilla-frontend/scss/abstracts/_mixins';
27
+
28
+ // Base files (reset, typography and media)
29
+ @use "@natachah/vanilla-frontend/scss/base";
30
+
31
+ // Components files (or: @use "@natachah/vanilla-frontend/scss/components";)
32
+ @use '@natachah/vanilla-frontend/scss/components/_badge';
33
+ @use '@natachah/vanilla-frontend/scss/components/_breadcrumb';
34
+ @use '@natachah/vanilla-frontend/scss/components/_button';
35
+ @use '@natachah/vanilla-frontend/scss/components/_card';
36
+ @use '@natachah/vanilla-frontend/scss/components/_dialog';
37
+ @use '@natachah/vanilla-frontend/scss/components/_disclosure';
38
+ @use '@natachah/vanilla-frontend/scss/components/_drawer';
39
+ @use '@natachah/vanilla-frontend/scss/components/_dropdown';
40
+ @use '@natachah/vanilla-frontend/scss/components/_form';
41
+ @use '@natachah/vanilla-frontend/scss/components/_grid';
42
+ @use '@natachah/vanilla-frontend/scss/components/_group';
43
+ @use '@natachah/vanilla-frontend/scss/components/_list';
44
+ @use '@natachah/vanilla-frontend/scss/components/_loading';
45
+ @use '@natachah/vanilla-frontend/scss/components/_progress';
46
+ @use '@natachah/vanilla-frontend/scss/components/_slider';
47
+ @use '@natachah/vanilla-frontend/scss/components/_table';
48
+ ```
49
+
50
+ ::: tip
51
+ There is no required files, but it's recommanded to have at least the base/* and the themes/root
52
+ :::
53
+
54
+ ## Javascript
55
+
56
+ Import the Javascript files that you need, here the template:
57
+
58
+ ```js
59
+ // If you need to create some component, you can use this
60
+ import BaseComponent from "@natachah/vanilla-frontend/js/utilities/_base-component"
61
+ import ErrorMessage from "@natachah/vanilla-frontend/js/utilities/_error"
62
+ import Cookie from "@natachah/vanilla-frontend/js/utilities/_cookie"
63
+
64
+ // Here the helpers
65
+ import FormHelper from "@natachah/vanilla-frontend/js/utilities/_form-helper"
66
+
67
+ // Here the components
68
+ import Autofill from "@natachah/vanilla-frontend/js/_autofill"
69
+ import CheckAll from "@natachah/vanilla-frontend/js/_check-all"
70
+ import Comfort from "@natachah/vanilla-frontend/js/_comfort"
71
+ import Consent from "@natachah/vanilla-frontend/js/_consent"
72
+ import Dialog from "@natachah/vanilla-frontend/js/_dialog"
73
+ import Dropdown from "@natachah/vanilla-frontend/js/_dropdown"
74
+ import Drawer from "@natachah/vanilla-frontend/js/_drawer"
75
+ import Scroll from "@natachah/vanilla-frontend/js/_scroll"
76
+ import Slider from "@natachah/vanilla-frontend/js/_slider"
77
+ import Sortable from "@natachah/vanilla-frontend/js/_sortable"
78
+ import Toggle from "@natachah/vanilla-frontend/js/_toggle"
79
+ import Tree from "@natachah/vanilla-frontend/js/_tree"
80
+ ```