@natachah/vanilla-frontend 0.4.1 → 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 (281) 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.js → vanilla-frontend-doc.js} +30 -33
  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/components/_badge.scss +2 -1
  226. package/scss/components/_dropdown.scss +2 -2
  227. package/scss/components/_group.scss +8 -4
  228. package/scss/components/_popover.scss +74 -0
  229. package/scss/components/index.scss +1 -0
  230. package/scss/vanilla-frontend-doc.scss +46 -1
  231. package/scss/vanilla-frontend-sandbox.scss +34 -0
  232. package/vite.config.js +30 -0
  233. package/docs/index.html +0 -36
  234. package/docs/main-demo.js +0 -2
  235. package/docs/main.js +0 -34
  236. package/docs/pages/base/layout.html +0 -131
  237. package/docs/pages/base/media.html +0 -142
  238. package/docs/pages/base/reset.html +0 -53
  239. package/docs/pages/base/typography.html +0 -334
  240. package/docs/pages/components/button.html +0 -202
  241. package/docs/pages/components/dialog.html +0 -336
  242. package/docs/pages/components/disclosure.html +0 -174
  243. package/docs/pages/components/form.html +0 -427
  244. package/docs/pages/components/loading.html +0 -58
  245. package/docs/pages/components/progress.html +0 -47
  246. package/docs/pages/components/table.html +0 -168
  247. package/docs/pages/customs/badge.html +0 -150
  248. package/docs/pages/customs/breadcrumb.html +0 -67
  249. package/docs/pages/customs/card.html +0 -185
  250. package/docs/pages/customs/drawer.html +0 -149
  251. package/docs/pages/customs/dropdown.html +0 -270
  252. package/docs/pages/customs/grid.html +0 -185
  253. package/docs/pages/customs/list.html +0 -112
  254. package/docs/pages/customs/slider.html +0 -273
  255. package/docs/pages/javascript/autofill.html +0 -170
  256. package/docs/pages/javascript/checkall.html +0 -59
  257. package/docs/pages/javascript/comfort.html +0 -146
  258. package/docs/pages/javascript/consent.html +0 -112
  259. package/docs/pages/javascript/cookie.html +0 -81
  260. package/docs/pages/javascript/form.html +0 -199
  261. package/docs/pages/javascript/scroll.html +0 -209
  262. package/docs/pages/javascript/sortable.html +0 -167
  263. package/docs/pages/javascript/tabpanel.html +0 -89
  264. package/docs/pages/javascript/toggle.html +0 -193
  265. package/docs/pages/javascript/trap.html +0 -89
  266. package/docs/pages/javascript/tree.html +0 -256
  267. package/docs/pages/quick-start/conventions.html +0 -112
  268. package/docs/pages/quick-start/customization.html +0 -187
  269. package/docs/pages/quick-start/installation.html +0 -97
  270. package/docs/pages/quick-start/mixins.html +0 -214
  271. package/docs/src/js/demo.js +0 -110
  272. package/docs/src/js/doc-code.js +0 -102
  273. package/docs/src/js/doc-demo.js +0 -14
  274. package/docs/src/js/doc-layout.js +0 -117
  275. package/docs/src/scss/demo.scss +0 -77
  276. package/docs/src/scss/layout.scss +0 -83
  277. package/docs/src/scss/style.scss +0 -278
  278. package/docs/vite.config.mjs +0 -23
  279. package/esbuild.mjs +0 -25
  280. package/natachah-vanilla-frontend-0.4.1.tgz +0 -0
  281. package/vitest.config.js +0 -8
@@ -4,7 +4,7 @@
4
4
  /// ------------------------------------------------------------------
5
5
  /// Create the dropdown component
6
6
  ///
7
- /// @example <div class="dropdown"><button aria-controls="myDropdown" aria-expanded="false" aria-pressed="false">Button</button><ul id="myDropdown" hidden>...</ul></div>
7
+ /// @example <div class="dropdown-js"><button aria-controls="myDropdown" aria-expanded="false" aria-pressed="false">Button</button><ul id="myDropdown" hidden>...</ul></div>
8
8
  ///
9
9
  /// @require {mixin} as-item
10
10
  /// @require {mixin} as-list
@@ -24,7 +24,7 @@ $customDropdown: (
24
24
  // Change default properties
25
25
  $customDropdownProperties: map.merge(default.$item-properties, $customDropdown);
26
26
 
27
- .dropdown {
27
+ .dropdown-js {
28
28
 
29
29
  position: relative;
30
30
  display: inline-block;
@@ -26,13 +26,15 @@
26
26
 
27
27
  // Remove extra border
28
28
  & + *,
29
- & + :is(.dropdown) > [aria-controls] {
29
+ & + :is(.dropdown-js) > [aria-controls],
30
+ & + :is(.dropdown) > [popovertarget] {
30
31
  border-left: none !important;
31
32
  }
32
33
 
33
34
  // Remove extra radius
34
35
  &:not(:first-child, :last-child),
35
- &:not(:first-child, :last-child):is(.dropdown) > [aria-controls] {
36
+ &:not(:first-child, :last-child):is(.dropdown-js) > [aria-controls],
37
+ &:not(:first-child, :last-child):is(.dropdown) > [popovertarget] {
36
38
  border-radius: 0;
37
39
  }
38
40
 
@@ -40,14 +42,16 @@
40
42
 
41
43
  // Remove radius right on first child
42
44
  &:first-child,
43
- &:first-child:is(.dropdown) > [aria-controls] {
45
+ &:first-child:is(.dropdown-js) > [aria-controls],
46
+ &:first-child:is(.dropdown) > [popovertarget] {
44
47
  border-start-end-radius: 0;
45
48
  border-end-end-radius: 0;
46
49
  }
47
50
 
48
51
  // Remove radius left on last child
49
52
  &:last-child,
50
- &:last-child:is(.dropdown) > [aria-controls] {
53
+ &:last-child:is(.dropdown-js) > [aria-controls],
54
+ &:last-child:is(.dropdown) > [popovertarget] {
51
55
  border-start-start-radius: 0;
52
56
  border-end-start-radius: 0;
53
57
  }
@@ -0,0 +1,74 @@
1
+ ////
2
+ /// ------------------------------------------------------------------
3
+ /// Popover
4
+ /// ------------------------------------------------------------------
5
+ /// Create the popover component
6
+ ///
7
+ /// @example <div>
8
+ ///
9
+ /// @require {mixin} as-item
10
+ /// @require {mixin} as-list
11
+ /// @group components
12
+ /// @author Natacha Herth
13
+ ///
14
+ ////
15
+
16
+ @use "sass:map";
17
+ @use "../abstracts/default";
18
+ @use "../abstracts/mixins" as *;
19
+
20
+ $colors: (
21
+ ) !default;
22
+
23
+ $customPopover: (
24
+ background: var(--color-body)
25
+ );
26
+
27
+ $customPopoverProperties: map.merge(default.$item-properties, $customPopover);
28
+
29
+ [popovertarget] {
30
+ anchor-name: --popover-anchor;
31
+ }
32
+
33
+ [popover] {
34
+ position: absolute;
35
+ position-anchor: --popover-anchor;
36
+ position-area: var(--popover-area);
37
+ inset: var(--popover-inset, anchor(bottom) auto auto anchor(start));
38
+
39
+ // Define as an item
40
+ @include as-item('popover', (), $customPopoverProperties);
41
+ }
42
+
43
+ .popover,
44
+ .dropdown {
45
+ anchor-scope: --popover-anchor;
46
+ }
47
+
48
+ .popover [popover] {
49
+ // Define the color variations
50
+ @include with-color-variations('popover', (), $colors);
51
+ }
52
+
53
+ .dropdown {
54
+
55
+ // Animate the SVG
56
+ @media screen and (prefers-reduced-motion: no-preference) {
57
+ [popovertarget] > svg {
58
+ transition: var(--dropdown-transition, all .25s ease-in-out);
59
+ }
60
+ }
61
+
62
+ // On open
63
+ &:has(:popover-open) {
64
+ [popovertarget] > svg {
65
+ transform: var(--dropdown-svg-transform, rotate(-180deg));
66
+ }
67
+ }
68
+
69
+ // Make as list
70
+ [popover] {
71
+ @include as-list('dropdown', ('focus', 'hover', 'active', 'disabled'), $customPopoverProperties);
72
+ }
73
+
74
+ }
@@ -11,6 +11,7 @@
11
11
  @forward "./group";
12
12
  @forward "./list";
13
13
  @forward "./loading";
14
+ @forward "./popover";
14
15
  @forward "./progress";
15
16
  @forward "./slider";
16
17
  @forward "./table";
@@ -7,6 +7,7 @@
7
7
  /// @author Natacha Herth
8
8
  ///
9
9
 
10
+ @use './abstracts/mixins' as *;
10
11
 
11
12
  // Themes
12
13
  @use "./themes/root";
@@ -27,8 +28,52 @@
27
28
  @use "./components/dropdown";
28
29
  @use "./components/form";
29
30
  @use "./components/grid";
31
+ @use "./components/group";
30
32
  @use "./components/list";
31
33
  @use "./components/loading";
34
+ @use "./components/popover" with ($colors: ('primary'));
32
35
  @use "./components/progress";
33
36
  @use "./components/table";
34
- @use "./components/slider";
37
+ @use "./components/slider";
38
+
39
+ // Create a container
40
+ .as-container {
41
+ container-type: inline-size;
42
+ min-height: 300px;
43
+ overflow: hidden;
44
+ }
45
+
46
+ // Demo for responsive table
47
+ @container (max-width:500px) {
48
+ #responsiveTable {
49
+ @include as-responsive-table()
50
+ }
51
+ }
52
+
53
+ // Demo Drawer
54
+ #drawer {
55
+ --drawer-position: 0 0 0 auto
56
+ }
57
+
58
+ // Demo Grid
59
+ .grid,
60
+ .flex-grid {
61
+ &:not(.demo-inline) > * {
62
+ background-color: #eee;
63
+ text-align: center;
64
+ padding-block: 1rem;
65
+ }
66
+
67
+ &.demo-inline {
68
+ --grid-columns: 3
69
+ }
70
+
71
+ }
72
+
73
+ #flexGridDemoOffset {
74
+ @include flex-grid-offset-column()
75
+ }
76
+
77
+ #flexGridDemoWider {
78
+ @include flex-grid-wider-column()
79
+ }
@@ -0,0 +1,34 @@
1
+ ////
2
+ /// ------------------------------------------------------------------
3
+ /// Main
4
+ /// ------------------------------------------------------------------
5
+ /// This is the main scss generated
6
+ ///
7
+ /// @author Natacha Herth
8
+ ///
9
+
10
+
11
+ // Themes
12
+ @use "./themes/root";
13
+
14
+ // Base
15
+ @use "./base";
16
+
17
+ // Components
18
+ @use "./components/badge" with ($colors: ('primary'), $outline: true);
19
+ @use "./components/breadcrumb";
20
+ @use "./components/button" with ($colors: ('primary'), $outline: true);
21
+ @use "./components/card" with ($colors: ('primary'), $outline: true);
22
+ @use "./components/dialog";
23
+ @use "./components/disclosure";
24
+ @use "./components/drawer";
25
+ @use "./components/dropdown";
26
+ @use "./components/form";
27
+ @use "./components/grid";
28
+ @use "./components/group";
29
+ @use "./components/list";
30
+ @use "./components/loading";
31
+ @use "./components/popover" with ($colors: ('primary'));
32
+ @use "./components/progress";
33
+ @use "./components/table";
34
+ @use "./components/slider";
package/vite.config.js ADDED
@@ -0,0 +1,30 @@
1
+ import { defineConfig } from 'vite'
2
+ import autoprefixer from 'autoprefixer'
3
+
4
+ export default defineConfig({
5
+ css: {
6
+ postcss: {
7
+ plugins: [autoprefixer],
8
+ },
9
+ },
10
+ build: {
11
+ outDir: 'docs/public/bundles',
12
+ emptyOutDir: true,
13
+ minify: 'esbuild',
14
+ rollupOptions: {
15
+ input: {
16
+ 'js': 'js/vanilla-frontend-doc.js',
17
+ 'vanilla-frontend': 'scss/vanilla-frontend.scss',
18
+ 'vanilla-frontend-doc': 'scss/vanilla-frontend-doc.scss',
19
+ },
20
+ output: {
21
+ entryFileNames: 'vanilla-frontend-doc.js',
22
+ assetFileNames: '[name][extname]',
23
+ },
24
+ },
25
+ },
26
+ test: {
27
+ environment: 'happy-dom',
28
+ globals: true,
29
+ }
30
+ })
package/docs/index.html DELETED
@@ -1,36 +0,0 @@
1
- <!doctype html>
2
- <html lang="en">
3
-
4
- <head>
5
- <meta charset="UTF-8" />
6
- <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
- <title>Documentations: Components ></title>
8
- </head>
9
-
10
- <body data-preload>
11
-
12
- <doc-layout>
13
-
14
- <h1>A simple <span style="color: var(--color-primary)">Vanilla Frontend</span> framework</h1>
15
-
16
- <p>Here let me explain a little more about my framework and how to use it :-)</p>
17
-
18
- <h2>Why a new framework</h2>
19
-
20
- <p>A lot or framework are too heavy or too minimal, and more important a lot of them don't prioritize semantic HTML.</p>
21
-
22
- <p>I wanted to be able to quickly start a new project with a clean design and a minimal override for customization.</p>
23
-
24
- <blockquote>
25
- <p>And must important to keep it accessible and Vanilla !</p>
26
- </blockquote>
27
-
28
- <p>As a visual imparaired person, I know how much it can be difficult to find a good website with good semantic and/or with the ability to change some basic styling as the font size.</p>
29
-
30
-
31
- </doc-layout>
32
-
33
- <script type="module" src="/main.js"></script>
34
- </body>
35
-
36
- </html>
package/docs/main-demo.js DELETED
@@ -1,2 +0,0 @@
1
- // Import main css
2
- import './../scss/vanilla-frontend.scss'
package/docs/main.js DELETED
@@ -1,34 +0,0 @@
1
- // Import main css
2
- import './../scss/vanilla-frontend-doc.scss'
3
-
4
- // HERE go the code
5
- import './src/js/doc-layout.js'
6
- import './src/js/doc-demo.js'
7
- import './src/js/doc-code.js'
8
- import './src/js/demo.js'
9
-
10
- import './src/scss/layout.scss'
11
- import './src/scss/style.scss'
12
- import './src/scss/demo.scss'
13
-
14
- // Prevent first animation
15
- setTimeout(() => { document.body.removeAttribute('data-preload') }, 10)
16
-
17
- // Set the current navigation
18
- const current = window.location.pathname
19
-
20
- if (current.startsWith('/pages/')) document.querySelectorAll(`#sidebar a[href*="${current}"]`).forEach(elem => {
21
- elem.setAttribute('aria-current', 'page')
22
- })
23
-
24
- // My awsome sidebar !!!
25
- import Drawer from './../js/_drawer.js'
26
- const sidebar = document.getElementById('sidebar')
27
- if (sidebar) new Drawer(sidebar, {
28
- cookie: 'demo-confort'
29
- })
30
-
31
- // Code group
32
- import Tabpanel from './../js/_tabpanel.js'
33
- const tabpanels = document.querySelectorAll('.code-group')
34
- if (tabpanels) tabpanels.forEach(tabpanel => new Tabpanel(tabpanel))
@@ -1,131 +0,0 @@
1
- <!doctype html>
2
- <html lang="en">
3
-
4
- <head>
5
- <meta charset="UTF-8" />
6
- <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
- <title>Documentations: Layout > Container</title>
8
- </head>
9
-
10
- <body data-preload>
11
- <doc-layout>
12
-
13
- <h1>Layout</h1>
14
-
15
- <p>The framework uses a CSS grid to create the default page layout on the body. It features default CSS variables that you can customize, such as the maximum content width, which is set at <b>1280px</b>. Since it uses a grid, it includes gaps and columns.</p>
16
-
17
- <p>Also, the grid template as two content zone available as <code>full</code> and <code>content</code> that you can use as you wish.</p>
18
-
19
- <p>But as every website can be different, these value can be changed !</p>
20
-
21
- <p><a href="/pages/demo/layout.html">Check the demo page !</a></p>
22
-
23
- <table>
24
- <caption>
25
- <h2>Device Breakpoint Viewport</h2>
26
- </caption>
27
- <thead>
28
- <tr>
29
- <th>Device</th>
30
- <th>Breakpoint</th>
31
- <th>Columns</th>
32
- <th>Vieport</th>
33
- </tr>
34
- </thead>
35
- <tbody>
36
- <tr>
37
- <td>Mobile</td>
38
- <td>
39
- &lt; 720
40
- </td>
41
- <td>1</td>
42
- <td>100%</td>
43
- </tr>
44
- <tr>
45
- <td>Tablet</td>
46
- <td>&lt; 1024px</td>
47
- <td>6</td>
48
- <td>100%</td>
49
- </tr>
50
- <tr>
51
- <td>Laptop</td>
52
- <td>&lt; 1440px</td>
53
- <td>12</td>
54
- <td>1280px</td>
55
- </tr>
56
- <tr>
57
- <td>Desktop</td>
58
- <td>&gt; 1440px</td>
59
- <td>12</td>
60
- <td>1280px</td>
61
- </tr>
62
- </tbody>
63
- </table>
64
-
65
- <div class="code-group">
66
- <div role="tablist">
67
- <button role="tab" aria-controls="html">HTML</button>
68
- <button role="tab" aria-controls="scss">SCSS</button>
69
- <button role="tab" aria-controls="css">CSS</button>
70
- </div>
71
- <doc-code id="html" data-type="html" role="tabpanel">
72
- <!--
73
- <body data-preload>
74
- <header></header>
75
- <main></main>
76
- <footer></footer>
77
- </body>
78
- -->
79
- </doc-code>
80
- <doc-code id="scss" data-type="scss" role="tabpanel">
81
- @use '@natachah/vanilla-frontend/scss/base/layout';
82
- </doc-code>
83
- <doc-code id="css" data-type="css" role="tabpanel">
84
- --layout-width
85
- --layout-gap-block
86
- --layout-gap-inline
87
- --layout-columns
88
- --subgrid-gap-block
89
- --subgrid-gap-inline
90
- </doc-code>
91
- </div>
92
-
93
- <blockquote class="info">
94
- <p>The <code>--subgrid-gap-*</code> are used for the direct child as header, main and footer. It set by default the gap block at 0 and take the layout inline gap.</p>
95
- </blockquote>
96
-
97
- <h2>Container</h2>
98
-
99
- <p>The default layout include a <code>.container</code> and a <code>.container-full</code>.</p>
100
-
101
- <p>The classic container is centered into the page layout and the full container take the full length of the page.<br>It's perfect if you need to set a background color to a section.</p>
102
-
103
- <doc-code id="html" data-type="html" role="tabpanel">
104
- <section class="container"></section>
105
- <section class="container-full"></section>
106
- </doc-code>
107
-
108
- <h2>Subgrid</h2>
109
-
110
- <p>You can re-use the layout grid into a container with the class <code>.subgrid</code>. Then you can use the <code>grid-column</code> CSS property to manage the space.</p>
111
-
112
- <div class="code-group">
113
- <div role="tablist">
114
- <button role="tab" aria-controls="html">HTML</button>
115
- <button role="tab" aria-controls="css">CSS</button>
116
- </div>
117
- <doc-code id="html" data-type="html" role="tabpanel">
118
- <section class="container subgrid"></section>
119
- <section class="container-full subgrid"></section>
120
- </doc-code>
121
- <doc-code id="css" data-type="css" role="tabpanel">
122
- --subgrid-gap-block
123
- --subgrid-gap-inline
124
- </doc-code>
125
- </div>
126
-
127
- </doc-layout>
128
- <script type="module" src="/main.js"></script>
129
- </body>
130
-
131
- </html>
@@ -1,142 +0,0 @@
1
- <!doctype html>
2
- <html lang="en">
3
-
4
- <head>
5
- <meta charset="UTF-8" />
6
- <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
- <title>Documentations: Base ></title>
8
- </head>
9
-
10
- <body data-preload>
11
- <doc-layout>
12
-
13
- <h1>Media</h1>
14
- <p>A website can have multiple media as images, videos and/or audios.</p>
15
- <h2>Image</h2>
16
- <p>The image is using the native <code>&lt;img&gt;</code> tag with the attributes <code>srcset</code>, <code>alt</code> and <code>title</code>.</p>
17
- <doc-demo>
18
- <img src="https://picsum.photos/400/330" srcset="https://picsum.photos/800/660 2x" alt="A random image from lorem picsum" title="This is my picture">
19
- </doc-demo>
20
-
21
- <div class="code-group">
22
- <div role="tablist">
23
- <button role="tab" aria-controls="html">HTML</button>
24
- <button role="tab" aria-controls="scss">SCSS</button>
25
- <button role="tab" aria-controls="css">CSS</button>
26
- </div>
27
- <doc-code id="html" data-type="html" role="tabpanel">
28
- <img src="https://picsum.photos/400/330" srcset="https://picsum.photos/800/660 2x" alt="A random image from lorem picsum" title="This is my picture">
29
- </doc-code>
30
- <doc-code id="scss" data-type="scss" role="tabpanel">
31
- @use '@natachah/vanilla-frontend/scss/base/media';
32
- </doc-code>
33
- <doc-code id="css" data-type="css" role="tabpanel">
34
- --image-width
35
- --image-height
36
- --image-fit
37
- --image-position
38
- --image-ratio
39
- </doc-code>
40
- </div>
41
-
42
- <h3>Picture</h3>
43
- <p>For responsive and best practice, it's better to use the <code>&lt;picture&gt;</code> tag with inside the <code>&lt;source&gt;</code> and <code>&lt;img&gt;</code> tags.</p>
44
- <doc-demo>
45
- <picture>
46
- <source media="(max-width:576px)" srcset="https://fakeimg.pl/200x200/?text=mobile, https://fakeimg.pl/400x400/?text=mobile+retina 2x">
47
- <source media="(max-width:768px)" srcset="https://fakeimg.pl/200x200/?text=tablet, https://fakeimg.pl/400x400/?text=tablet+retina 2x">
48
- <source media="(max-width:992px)" srcset="https://fakeimg.pl/200x200/?text=laptop, https://fakeimg.pl/400x400/?text=laptop+retina 2x">
49
- <img src="https://fakeimg.pl/200x200/?text=desktop" srcset="https://fakeimg.pl/400x400/?text=desktop+retina 2x" alt="A random image from lorem picsum" title="This is my picture">
50
- </picture>
51
- </doc-demo>
52
- <doc-code>
53
- <picture>
54
- <source media="(max-width:576px)" srcset="https://fakeimg.pl/200x200/?text=mobile, https://fakeimg.pl/400x400/?text=mobile+retina 2x">
55
- <source media="(max-width:768px)" srcset="https://fakeimg.pl/200x200/?text=tablet, https://fakeimg.pl/400x400/?text=tablet+retina 2x">
56
- <source media="(max-width:992px)" srcset="https://fakeimg.pl/200x200/?text=laptop, https://fakeimg.pl/400x400/?text=laptop+retina 2x">
57
- <img src="https://fakeimg.pl/200x200/?text=desktop" srcset="https://fakeimg.pl/400x400/?text=desktop+retina 2x" alt="A random image from lorem picsum" title="This is my picture">
58
- </picture>
59
- </doc-code>
60
-
61
- <h3>Figure</h3>
62
- <p>You also can use <code>&lt;figure&gt;</code> and <code>&lt;figcaption&gt;</code> tags, to display an <code>&lt;img&gt;</code> with a nice caption.</p>
63
- <doc-demo>
64
- <figure>
65
- <img src="https://picsum.photos/id/320/400/330" srcset="https://picsum.photos/id/320/800/660 2x" alt="My random image from lorem picsum">
66
- <figcaption>My image from lorem picsum</figcaption>
67
- </figure>
68
- </doc-demo>
69
- <div class="code-group">
70
- <div role="tablist">
71
- <button role="tab" aria-controls="html">HTML</button>
72
- <button role="tab" aria-controls="css">CSS</button>
73
- </div>
74
- <doc-code id="html" data-type="html" role="tabpanel">
75
- <figure>
76
- <img src="https://picsum.photos/id/320/400/330" srcset="https://picsum.photos/id/320/800/660 2x" alt="My random image from lorem picsum">
77
- <figcaption>My image from lorem picsum</figcaption>
78
- </figure>
79
- </doc-code>
80
- <doc-code id="css" data-type="css" role="tabpanel">
81
- --caption-color
82
- --caption-font-size
83
- --caption-margin-block
84
- --caption-margin-inline
85
- </doc-code>
86
- </div>
87
-
88
- <h2>Video</h2>
89
- <p>Use the default <code>&lt;video&gt;</code> and <code>&lt;source&gt;</code> tags.</p>
90
- <p>By default the video take 100% width and have a ratio of 16:9.</p>
91
- <doc-demo>
92
- <video width="320" height="240" controls>
93
- <source src="..." type="video/mp4">
94
- </video>
95
- </doc-demo>
96
- <div class="code-group">
97
- <div role="tablist">
98
- <button role="tab" aria-controls="html">HTML</button>
99
- <button role="tab" aria-controls="css">CSS</button>
100
- </div>
101
- <doc-code id="html" data-type="html" role="tabpanel">
102
- <video width="320" height="240" controls>
103
- <source src="http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4" type="video/mp4">
104
- </video>
105
- </doc-code>
106
- <doc-code id="css" data-type="css" role="tabpanel">
107
- --video-width
108
- --video-height
109
- --video-fit
110
- --video-position
111
- --video-ratio
112
- </doc-code>
113
- </div>
114
-
115
- <h2>Audio</h2>
116
- <p>Use the default <code>&lt;audio&gt;</code> and <code>&lt;source&gt;</code> tags.</p>
117
- <p>By default the audio take 100% width.</p>
118
- <doc-demo>
119
- <audio controls>
120
- <source src="http://codeskulptor-demos.commondatastorage.googleapis.com/GalaxyInvaders/theme_01.mp3" type="audio/mpeg">
121
- </audio>
122
- </doc-demo>
123
- <div class="code-group">
124
- <div role="tablist">
125
- <button role="tab" aria-controls="html">HTML</button>
126
- <button role="tab" aria-controls="css">CSS</button>
127
- </div>
128
- <doc-code id="html" data-type="html" role="tabpanel">
129
- <audio controls>
130
- <source src="http://localhost:5173/public/audio.mp3" type="audio/mpeg">
131
- </audio>
132
- </doc-code>
133
- <doc-code id="css" data-type="css" role="tabpanel">
134
- --audio-width
135
- </doc-code>
136
- </div>
137
-
138
- </doc-layout>
139
- <script type="module" src="/main.js"></script>
140
- </body>
141
-
142
- </html>
@@ -1,53 +0,0 @@
1
- <!doctype html>
2
- <html lang="en">
3
-
4
- <head>
5
- <meta charset="UTF-8" />
6
- <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
- <title>Documentations: Base > Reset</title>
8
- </head>
9
-
10
- <body data-preload>
11
- <doc-layout>
12
-
13
- <h1>Reset</h1>
14
-
15
- <p>The framework include a simple <b>reboot</b> to makes browsers render all elements more consistently and in line with modern standards.</p>
16
-
17
- <ul>
18
- <li>Unset all default style <em>(except display)</em> </li>
19
- <li>Change box-sizing to <code>border-box</code> on all element</li>
20
- <li>Render media as block with a default 100% width</li>
21
- <li>Change the <code>overflow-wrap</code> for text</li>
22
- <li>Set default size and align for <code>&lt;svg&gt;</code></li>
23
- <li>Set <code>&lt;table&gt;</code>default width</li>
24
- <li>Set default cursor for <code>draggable</code></li>
25
- <li>Set default cursor and animation for <code>tree</code></li>
26
- <li>Enable <code>scroll-behavior</code> if <code>prefers-reduced-motion</code> is not set</li>
27
- <li>Set default <code>body</code> setting + <code>inert</code> mode for <code>&lt;dialog&gt;</code></li>
28
- <li>Set functionalities on <code>body</code> for <code>inert</code> and <code>data-preload</code> attributes </li>
29
- </ul>
30
-
31
- <p>To use it, import this file:</p>
32
-
33
- <doc-code data-type="scss">
34
- @use '@natachah/vanilla-frontend/scss/base/reset';
35
- </doc-code>
36
-
37
- <h2>Preload</h2>
38
-
39
- <p>If you need to disabled the CSS animation on first load of the page add the data attribute <code>data-preload</code> on the <code>&lt;body&gt;</code>.</p>
40
-
41
- <p>And then add this script taht will remove the attribute after a timeout:</p>
42
-
43
- <doc-code data-type="js">
44
- setTimeout(() => {
45
- document.body.removeAttribute('data-preload')
46
- }, 10)
47
- </doc-code>
48
-
49
- </doc-layout>
50
- <script type="module" src="/main.js"></script>
51
- </body>
52
-
53
- </html>