@graupl/core 1.0.0-beta.22 → 1.0.0-beta.24

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 (273) hide show
  1. package/dist/css/base/button.css +2 -2
  2. package/dist/css/base/button.css.map +1 -1
  3. package/dist/css/base/form.css +2 -2
  4. package/dist/css/base/form.css.map +1 -1
  5. package/dist/css/base/link.css +2 -2
  6. package/dist/css/base/link.css.map +1 -1
  7. package/dist/css/base/table.css +2 -2
  8. package/dist/css/base/table.css.map +1 -1
  9. package/dist/css/base.css +2 -2
  10. package/dist/css/base.css.map +1 -1
  11. package/dist/css/component/accordion.css +2 -5
  12. package/dist/css/component/accordion.css.map +1 -1
  13. package/dist/css/component/alert.css +2 -2
  14. package/dist/css/component/alert.css.map +1 -1
  15. package/dist/css/component/badge.css +2 -2
  16. package/dist/css/component/badge.css.map +1 -1
  17. package/dist/css/component/card.css +2 -2
  18. package/dist/css/component/card.css.map +1 -1
  19. package/dist/css/component/carousel.css +2 -2
  20. package/dist/css/component/carousel.css.map +1 -1
  21. package/dist/css/component/disclosure.css +2 -2
  22. package/dist/css/component/disclosure.css.map +1 -1
  23. package/dist/css/component/input-group.css +2 -2
  24. package/dist/css/component/input-group.css.map +1 -1
  25. package/dist/css/component/list.css +2 -2
  26. package/dist/css/component/list.css.map +1 -1
  27. package/dist/css/component/menu.css +2 -2
  28. package/dist/css/component/menu.css.map +1 -1
  29. package/dist/css/component/navigation.css +2 -2
  30. package/dist/css/component/navigation.css.map +1 -1
  31. package/dist/css/component.css +2 -5
  32. package/dist/css/component.css.map +1 -1
  33. package/dist/css/graupl.css +2 -5
  34. package/dist/css/graupl.css.map +1 -1
  35. package/dist/css/init.css +2 -2
  36. package/dist/css/init.css.map +1 -1
  37. package/dist/css/layout/columns.css +2 -2
  38. package/dist/css/layout/columns.css.map +1 -1
  39. package/dist/css/layout/container.css +2 -2
  40. package/dist/css/layout/container.css.map +1 -1
  41. package/dist/css/layout/flex-columns.css +2 -2
  42. package/dist/css/layout/flex-columns.css.map +1 -1
  43. package/dist/css/layout.css +2 -5
  44. package/dist/css/layout.css.map +1 -1
  45. package/dist/css/normalize.css +2 -2
  46. package/dist/css/normalize.css.map +1 -1
  47. package/dist/css/state/focus.css +2 -2
  48. package/dist/css/state/focus.css.map +1 -1
  49. package/dist/css/state.css +2 -2
  50. package/dist/css/state.css.map +1 -1
  51. package/dist/css/theme/color.css +2 -2
  52. package/dist/css/theme/color.css.map +1 -1
  53. package/dist/css/theme/typography.css +2 -2
  54. package/dist/css/theme/typography.css.map +1 -1
  55. package/dist/css/theme.css +2 -2
  56. package/dist/css/theme.css.map +1 -1
  57. package/dist/css/utilities/alignment.css +1 -1
  58. package/dist/css/utilities/alignment.css.map +1 -1
  59. package/dist/css/utilities/background.css +2 -2
  60. package/dist/css/utilities/background.css.map +1 -1
  61. package/dist/css/utilities/border.css +2 -2
  62. package/dist/css/utilities/border.css.map +1 -1
  63. package/dist/css/utilities/color.css +2 -2
  64. package/dist/css/utilities/color.css.map +1 -1
  65. package/dist/css/utilities/container.css +1 -1
  66. package/dist/css/utilities/container.css.map +1 -1
  67. package/dist/css/utilities/display.css +2 -2
  68. package/dist/css/utilities/display.css.map +1 -1
  69. package/dist/css/utilities/flex.css +2 -2
  70. package/dist/css/utilities/flex.css.map +1 -1
  71. package/dist/css/utilities/gradient.css +2 -2
  72. package/dist/css/utilities/gradient.css.map +1 -1
  73. package/dist/css/utilities/height.css +2 -2
  74. package/dist/css/utilities/height.css.map +1 -1
  75. package/dist/css/utilities/inset.css +2 -2
  76. package/dist/css/utilities/inset.css.map +1 -1
  77. package/dist/css/utilities/justification.css +1 -1
  78. package/dist/css/utilities/justification.css.map +1 -1
  79. package/dist/css/utilities/list.css +1 -1
  80. package/dist/css/utilities/list.css.map +1 -1
  81. package/dist/css/utilities/order.css +2 -2
  82. package/dist/css/utilities/order.css.map +1 -1
  83. package/dist/css/utilities/position.css +2 -2
  84. package/dist/css/utilities/position.css.map +1 -1
  85. package/dist/css/utilities/ratio.css +2 -2
  86. package/dist/css/utilities/ratio.css.map +1 -1
  87. package/dist/css/utilities/spacing.css +2 -2
  88. package/dist/css/utilities/spacing.css.map +1 -1
  89. package/dist/css/utilities/typography.css +2 -2
  90. package/dist/css/utilities/typography.css.map +1 -1
  91. package/dist/css/utilities/visibility.css +2 -2
  92. package/dist/css/utilities/visibility.css.map +1 -1
  93. package/dist/css/utilities/visually-hidden.css +2 -2
  94. package/dist/css/utilities/visually-hidden.css.map +1 -1
  95. package/dist/css/utilities/width.css +2 -2
  96. package/dist/css/utilities/width.css.map +1 -1
  97. package/dist/css/utilities/z-index.css +1 -1
  98. package/dist/css/utilities/z-index.css.map +1 -1
  99. package/dist/css/utilities.css +2 -2
  100. package/dist/css/utilities.css.map +1 -1
  101. package/dist/js/accordion.js.map +1 -1
  102. package/dist/js/alert.js.map +1 -1
  103. package/dist/js/carousel.js.map +1 -1
  104. package/dist/js/component/accordion.cjs.js.map +1 -1
  105. package/dist/js/component/accordion.es.js.map +1 -1
  106. package/dist/js/component/accordion.iife.js.map +1 -1
  107. package/dist/js/component/alert.cjs.js.map +1 -1
  108. package/dist/js/component/alert.es.js.map +1 -1
  109. package/dist/js/component/alert.iife.js.map +1 -1
  110. package/dist/js/component/carousel.cjs.js.map +1 -1
  111. package/dist/js/component/carousel.es.js.map +1 -1
  112. package/dist/js/component/carousel.iife.js.map +1 -1
  113. package/dist/js/component/disclosure.cjs.js +2 -2
  114. package/dist/js/component/disclosure.cjs.js.map +1 -1
  115. package/dist/js/component/disclosure.es.js +2 -2
  116. package/dist/js/component/disclosure.es.js.map +1 -1
  117. package/dist/js/component/disclosure.iife.js +2 -2
  118. package/dist/js/component/disclosure.iife.js.map +1 -1
  119. package/dist/js/component/tabs.cjs.js +5 -0
  120. package/dist/js/component/tabs.cjs.js.map +1 -0
  121. package/dist/js/component/tabs.es.js +5 -0
  122. package/dist/js/component/tabs.es.js.map +1 -0
  123. package/dist/js/component/tabs.iife.js +5 -0
  124. package/dist/js/component/tabs.iife.js.map +1 -0
  125. package/dist/js/disclosure.js +2 -2
  126. package/dist/js/disclosure.js.map +1 -1
  127. package/dist/js/generator/accordion.cjs.js.map +1 -1
  128. package/dist/js/generator/accordion.es.js.map +1 -1
  129. package/dist/js/generator/accordion.iife.js.map +1 -1
  130. package/dist/js/generator/alert.cjs.js.map +1 -1
  131. package/dist/js/generator/alert.es.js.map +1 -1
  132. package/dist/js/generator/alert.iife.js.map +1 -1
  133. package/dist/js/generator/carousel.cjs.js.map +1 -1
  134. package/dist/js/generator/carousel.es.js.map +1 -1
  135. package/dist/js/generator/carousel.iife.js.map +1 -1
  136. package/dist/js/generator/disclosure.cjs.js +2 -2
  137. package/dist/js/generator/disclosure.cjs.js.map +1 -1
  138. package/dist/js/generator/disclosure.es.js +2 -2
  139. package/dist/js/generator/disclosure.es.js.map +1 -1
  140. package/dist/js/generator/disclosure.iife.js +2 -2
  141. package/dist/js/generator/disclosure.iife.js.map +1 -1
  142. package/dist/js/generator/navigation.cjs.js.map +1 -1
  143. package/dist/js/generator/navigation.es.js.map +1 -1
  144. package/dist/js/generator/navigation.iife.js.map +1 -1
  145. package/dist/js/generator/tabs.cjs.js +5 -0
  146. package/dist/js/generator/tabs.cjs.js.map +1 -0
  147. package/dist/js/generator/tabs.es.js +5 -0
  148. package/dist/js/generator/tabs.es.js.map +1 -0
  149. package/dist/js/generator/tabs.iife.js +5 -0
  150. package/dist/js/generator/tabs.iife.js.map +1 -0
  151. package/dist/js/graupl.js +5 -5
  152. package/dist/js/graupl.js.map +1 -1
  153. package/dist/js/navigation.js.map +1 -1
  154. package/dist/js/tabs.js +5 -0
  155. package/dist/js/tabs.js.map +1 -0
  156. package/package.json +4 -3
  157. package/src/js/disclosure/Disclosure.js +25 -45
  158. package/src/js/domHelpers.js +39 -22
  159. package/src/js/tabs/TabToggle.js +378 -0
  160. package/src/js/tabs/Tabs.js +1091 -0
  161. package/src/js/tabs/generator.js +32 -0
  162. package/src/js/tabs/index.js +5 -0
  163. package/src/scss/_defaults.scss +21 -88
  164. package/src/scss/_variables.scss +70 -0
  165. package/src/scss/base/button/_defaults.scss +2 -24
  166. package/src/scss/base/button/_index.scss +53 -52
  167. package/src/scss/base/button/_mixins.scss +24 -58
  168. package/src/scss/base/button/_variables.scss +139 -0
  169. package/src/scss/base/form/_defaults.scss +72 -2
  170. package/src/scss/base/form/_index.scss +196 -70
  171. package/src/scss/base/form/_variables.scss +166 -0
  172. package/src/scss/base/link/_defaults.scss +31 -0
  173. package/src/scss/base/link/_index.scss +177 -172
  174. package/src/scss/base/link/_variables.scss +215 -0
  175. package/src/scss/base/table/_defaults.scss +1 -11
  176. package/src/scss/base/table/_index.scss +126 -117
  177. package/src/scss/base/table/_variables.scss +214 -3
  178. package/src/scss/component/_index.scss +1 -0
  179. package/src/scss/component/accordion/_defaults.scss +73 -22
  180. package/src/scss/component/accordion/_index.scss +437 -62
  181. package/src/scss/component/accordion/_variables.scss +527 -101
  182. package/src/scss/component/alert/_defaults.scss +23 -32
  183. package/src/scss/component/alert/_index.scss +236 -30
  184. package/src/scss/component/alert/_variables.scss +155 -6
  185. package/src/scss/component/badge/_defaults.scss +1 -0
  186. package/src/scss/component/badge/_index.scss +25 -28
  187. package/src/scss/component/badge/_variables.scss +66 -2
  188. package/src/scss/component/card/_defaults.scss +64 -13
  189. package/src/scss/component/card/_index.scss +276 -30
  190. package/src/scss/component/card/_variables.scss +132 -0
  191. package/src/scss/component/carousel/_defaults.scss +73 -15
  192. package/src/scss/component/carousel/_index.scss +357 -41
  193. package/src/scss/component/carousel/_variables.scss +391 -0
  194. package/src/scss/component/disclosure/_index.scss +4 -4
  195. package/src/scss/component/disclosure/_variables.scss +127 -2
  196. package/src/scss/component/input-group/_defaults.scss +10 -3
  197. package/src/scss/component/input-group/_index.scss +72 -4
  198. package/src/scss/component/input-group/_variables.scss +37 -0
  199. package/src/scss/component/list/_defaults.scss +35 -2
  200. package/src/scss/component/list/_index.scss +159 -5
  201. package/src/scss/component/list/_variables.scss +152 -0
  202. package/src/scss/component/menu/_defaults.scss +49 -7
  203. package/src/scss/component/menu/_index.scss +325 -99
  204. package/src/scss/component/menu/_variables.scss +484 -1
  205. package/src/scss/component/navigation/_defaults.scss +45 -3
  206. package/src/scss/component/navigation/_index.scss +249 -98
  207. package/src/scss/component/navigation/_variables.scss +334 -5
  208. package/src/scss/component/tabs/_defaults.scss +82 -0
  209. package/src/scss/component/tabs/_index.scss +497 -0
  210. package/src/scss/component/tabs/_variables.scss +974 -0
  211. package/src/scss/layout/columns/_defaults.scss +5 -3
  212. package/src/scss/layout/columns/_index.scss +27 -21
  213. package/src/scss/layout/columns/_variables.scss +13 -0
  214. package/src/scss/layout/container/_defaults.scss +28 -11
  215. package/src/scss/layout/container/_index.scss +305 -161
  216. package/src/scss/layout/container/_variables.scss +148 -15
  217. package/src/scss/layout/flex-columns/_defaults.scss +5 -3
  218. package/src/scss/layout/flex-columns/_index.scss +28 -20
  219. package/src/scss/layout/flex-columns/_variables.scss +9 -0
  220. package/src/scss/mixins/_state.scss +37 -0
  221. package/src/scss/mixins/_theme.scss +36 -1
  222. package/src/scss/state/focus/_index.scss +17 -12
  223. package/src/scss/state/focus/_variables.scss +30 -4
  224. package/src/scss/theme/color/_defaults.scss +6 -35
  225. package/src/scss/theme/color/_index.scss +167 -1
  226. package/src/scss/theme/color/_variables.scss +155 -0
  227. package/src/scss/theme/typography/_defaults.scss +26 -19
  228. package/src/scss/theme/typography/_index.scss +176 -20
  229. package/src/scss/theme/typography/_variables.scss +186 -0
  230. package/src/scss/utilities/_template/_index.scss +0 -1
  231. package/src/scss/utilities/alignment/_defaults.scss +0 -33
  232. package/src/scss/utilities/alignment/_index.scss +24 -25
  233. package/src/scss/utilities/background/_defaults.scss +0 -77
  234. package/src/scss/utilities/background/_index.scss +32 -37
  235. package/src/scss/utilities/border/_defaults.scss +0 -33
  236. package/src/scss/utilities/border/_index.scss +25 -26
  237. package/src/scss/utilities/color/_defaults.scss +0 -19
  238. package/src/scss/utilities/color/_index.scss +22 -22
  239. package/src/scss/utilities/container/_defaults.scss +0 -11
  240. package/src/scss/utilities/container/_index.scss +20 -19
  241. package/src/scss/utilities/display/_defaults.scss +0 -11
  242. package/src/scss/utilities/display/_index.scss +20 -19
  243. package/src/scss/utilities/flex/_defaults.scss +0 -55
  244. package/src/scss/utilities/flex/_index.scss +28 -31
  245. package/src/scss/utilities/gradient/_defaults.scss +0 -28
  246. package/src/scss/utilities/gradient/_index.scss +27 -28
  247. package/src/scss/utilities/gradient/_variables.scss +15 -0
  248. package/src/scss/utilities/height/_defaults.scss +0 -8
  249. package/src/scss/utilities/height/_index.scss +22 -21
  250. package/src/scss/utilities/inset/_defaults.scss +0 -16
  251. package/src/scss/utilities/inset/_index.scss +20 -20
  252. package/src/scss/utilities/justification/_defaults.scss +0 -33
  253. package/src/scss/utilities/justification/_index.scss +24 -25
  254. package/src/scss/utilities/list/_defaults.scss +0 -22
  255. package/src/scss/utilities/list/_index.scss +22 -22
  256. package/src/scss/utilities/order/_defaults.scss +0 -8
  257. package/src/scss/utilities/order/_index.scss +20 -19
  258. package/src/scss/utilities/position/_defaults.scss +0 -11
  259. package/src/scss/utilities/position/_index.scss +20 -19
  260. package/src/scss/utilities/ratio/_defaults.scss +0 -8
  261. package/src/scss/utilities/ratio/_index.scss +22 -21
  262. package/src/scss/utilities/ratio/_variables.scss +6 -0
  263. package/src/scss/utilities/spacing/_defaults.scss +0 -11
  264. package/src/scss/utilities/spacing/_index.scss +18 -17
  265. package/src/scss/utilities/typography/_defaults.scss +0 -22
  266. package/src/scss/utilities/typography/_index.scss +27 -26
  267. package/src/scss/utilities/visibility/_defaults.scss +0 -11
  268. package/src/scss/utilities/visibility/_index.scss +19 -18
  269. package/src/scss/utilities/visually-hidden/_index.scss +19 -17
  270. package/src/scss/utilities/width/_defaults.scss +0 -8
  271. package/src/scss/utilities/width/_index.scss +21 -20
  272. package/src/scss/utilities/z-index/_defaults.scss +0 -11
  273. package/src/scss/utilities/z-index/_index.scss +19 -18
@@ -0,0 +1,32 @@
1
+ import Tabs from "./Tabs.js";
2
+ import once from "@drupal/once";
3
+
4
+ /**
5
+ * Generates Tabs elements.
6
+ *
7
+ * @param {object} [options = {}] - Options for generating the tabs.
8
+ * @param {object} [options.options = {}] - Options to pass to the Tabs constructor.
9
+ * @param {HTMLElement} [options.context = document] - The element to base the selector off of.
10
+ * @param {string} [options.selector = .tabs] - The query selector for the tabs elements in the DOM.
11
+ */
12
+ const generate = ({
13
+ options = {},
14
+ context = document,
15
+ selector = ".tabs",
16
+ } = {}) => {
17
+ once("graupl-tabs-generator", selector, context).forEach((tabsElement) => {
18
+ const tabsOptions = tabsElement.dataset.grauplTabsOptions
19
+ ? JSON.parse(tabsElement.dataset.grauplTabsOptions.replace(/'/g, '"')) ||
20
+ {}
21
+ : {};
22
+
23
+ new Tabs({
24
+ tabsElement,
25
+ initialize: true,
26
+ ...options,
27
+ ...tabsOptions,
28
+ });
29
+ });
30
+ };
31
+
32
+ export default generate;
@@ -0,0 +1,5 @@
1
+ import generate from "./generator.js";
2
+
3
+ document.addEventListener("DOMContentLoaded", () => {
4
+ generate();
5
+ });
@@ -26,7 +26,9 @@ $screen-aware-utilities: true !default;
26
26
  $theme-aware-utilities: true !default;
27
27
  $state-aware-utilities: true !default;
28
28
  $container-aware-utilities: false !default;
29
+ $themeable-components: true !default;
29
30
  $use-layers: true !default;
31
+ $show-warnings: true !default;
30
32
 
31
33
  // Layout properties.
32
34
  $content-max-width: 96ch !default;
@@ -34,21 +36,15 @@ $content-max-width: 96ch !default;
34
36
  // Screen sizes.
35
37
  $-screen-sizes: (
36
38
  xs: 0,
37
- sm: 48ch,
38
- md: 72ch,
39
- lg: 108ch,
40
- xl: 156ch,
39
+ sm: 576px,
40
+ md: 768px,
41
+ lg: 1024px,
42
+ xl: 1280px,
43
+ hd: 1500px,
44
+ qhd: 1921px,
45
+ uhd: 2561px,
41
46
  );
42
- $custom-screen-sizes: () !default;
43
47
  $screen-sizes: () !default;
44
-
45
- // @todo remove this once $custom-screen-sizes is removed
46
- @if $custom-screen-sizes != () {
47
- @warn "`$custom-screen-sizes` is deprecated and will be removed in a future release of Graupl. Use `$screen-sizes` instead.";
48
-
49
- $screen-sizes: map.merge($screen-sizes, $custom-screen-sizes);
50
- }
51
-
52
48
  $screen-sizes: map.merge($-screen-sizes, $screen-sizes);
53
49
  $-screen-size-triggers: (
54
50
  navigation-collapse: (
@@ -82,48 +78,15 @@ $-screen-size-triggers: (
82
78
  ),
83
79
  ),
84
80
  );
85
- $custom-screen-size-triggers: () !default;
86
81
  $screen-size-triggers: () !default;
87
-
88
- // @todo remove this once $custom-screen-size-triggers is removed
89
- @if $custom-screen-size-triggers != () {
90
- @warn "`$custom-screen-size-triggers` is deprecated and will be removed in a future release of Graupl. Use `$screen-size-triggers` instead.";
91
-
92
- $screen-size-triggers: map.merge(
93
- $screen-size-triggers,
94
- $custom-screen-size-triggers
95
- );
96
- }
97
-
98
82
  $screen-size-triggers: map.merge($-screen-size-triggers, $screen-size-triggers);
99
83
 
100
84
  // Container sizes.
101
85
  $-container-sizes: $screen-sizes;
102
- $custom-container-sizes: () !default;
103
86
  $container-sizes: () !default;
104
-
105
- // @todo remove this once $custom-container-sizes is removed
106
- @if $custom-container-sizes != () {
107
- @warn "`$custom-container-sizes` is deprecated and will be removed in a future release of Graupl. Use `$container-sizes` instead.";
108
-
109
- $container-sizes: map.merge($container-sizes, $custom-container-sizes);
110
- }
111
-
112
87
  $container-sizes: map.merge($-container-sizes, $container-sizes);
113
88
  $-container-size-triggers: $screen-size-triggers;
114
- $custom-container-size-triggers: () !default;
115
89
  $container-size-triggers: () !default;
116
-
117
- // @todo remove this once $custom-container-size-triggers is removed
118
- @if $custom-container-size-triggers != () {
119
- @warn "`$custom-container-size-triggers` is deprecated and will be removed in a future release of Graupl. Use `$container-size-triggers` instead.";
120
-
121
- $container-size-triggers: map.merge(
122
- $container-size-triggers,
123
- $custom-container-size-triggers
124
- );
125
- }
126
-
127
90
  $container-size-triggers: map.merge(
128
91
  $-container-size-triggers,
129
92
  $container-size-triggers
@@ -144,19 +107,7 @@ $-spacer-multipliers: (
144
107
  9: 5,
145
108
  10: 10,
146
109
  );
147
- $custom-spacer-multipliers: () !default;
148
110
  $spacer-multipliers: () !default;
149
-
150
- // @todo remove this once $custom-spacer-multipliers is removed
151
- @if $custom-spacer-multipliers != () {
152
- @warn "`$custom-spacer-multipliers` is deprecated and will be removed in a future release of Graupl. Use `$spacer-multipliers` instead.";
153
-
154
- $spacer-multipliers: map.merge(
155
- $spacer-multipliers,
156
- $custom-spacer-multipliers
157
- );
158
- }
159
-
160
111
  $spacer-multipliers: map.merge($-spacer-multipliers, $spacer-multipliers);
161
112
 
162
113
  // Size properties.
@@ -176,19 +127,7 @@ $-transition-durations: (
176
127
  default: #{$transition-duration-base * 2.5}ms,
177
128
  slow: #{$transition-duration-base * 3}ms,
178
129
  );
179
- $custom-transition-durations: () !default;
180
130
  $transition-durations: () !default;
181
-
182
- // @todo remove this once $custom-transition-durations is removed
183
- @if $custom-transition-durations != () {
184
- @warn "`$custom-transition-durations` is deprecated and will be removed in a future release of Graupl. Use `$transition-durations` instead.";
185
-
186
- $transition-durations: map.merge(
187
- $transition-durations,
188
- $custom-transition-durations
189
- );
190
- }
191
-
192
131
  $transition-durations: map.merge($-transition-durations, $transition-durations);
193
132
 
194
133
  // Selector properties.
@@ -226,6 +165,12 @@ $-state-selectors: (
226
165
  "[disabled]",
227
166
  "[aria-disabled=true]",
228
167
  ),
168
+ selected: (
169
+ "[aria-selected=true]",
170
+ ),
171
+ current: (
172
+ "[aria-current=true]",
173
+ ),
229
174
  );
230
175
  $-state-class-selectors: (
231
176
  visited: (
@@ -243,6 +188,12 @@ $-state-class-selectors: (
243
188
  disabled: (
244
189
  "#{$state-selector-base}disabled",
245
190
  ),
191
+ selected: (
192
+ "#{$state-selector-base}selected",
193
+ ),
194
+ current: (
195
+ "#{$state-selector-base}current",
196
+ ),
246
197
  );
247
198
 
248
199
  // Merge the state class selectors with the state selectors.
@@ -256,26 +207,8 @@ $-state-class-selectors: (
256
207
  }
257
208
  }
258
209
 
259
- $custom-state-selectors: () !default;
260
210
  $state-selectors: () !default;
261
211
 
262
- // @todo remove this once $custom-state-selectors is removed
263
- @if $custom-state-selectors != () {
264
- @warn "`$custom-state-selectors` is deprecated and will be removed in a future release of Graupl. Use `$state-selectors` instead.";
265
-
266
- @each $state, $selectors in $custom-state-selectors {
267
- @if map.has-key($state-selectors, $state) {
268
- $state-selectors: map.set(
269
- $state-selectors,
270
- $state,
271
- list.join(map.get($state-selectors, $state), $selectors)
272
- );
273
- } @else {
274
- $state-selectors: map.set($state-selectors, $state, $selectors);
275
- }
276
- }
277
- }
278
-
279
212
  @each $state, $selectors in $-state-selectors {
280
213
  @if map.has-key($state-selectors, $state) {
281
214
  $state-selectors: map.set(
@@ -2,21 +2,60 @@
2
2
  //
3
3
  // These values are to be used to directly style components and provide a
4
4
  // cleaner way to reference custom properties.
5
+ //
6
+ // Custom property defaults:
7
+ // | Custom property | Default |
8
+ // | ------------------------------------ | ---------------------------------- |
9
+ // | --graupl-content-max-width | 96ch |
10
+ // | --graupl-spacer | 1rem |
11
+ // | --graupl-spacer-0 | calc(0 * var(--graupl-spacer)) |
12
+ // | --graupl-spacer-1 | calc(0.125 * var(--graupl-spacer)) |
13
+ // | --graupl-spacer-2 | calc(0.25 * var(--graupl-spacer)) |
14
+ // | --graupl-spacer-3 | calc(0.5 * var(--graupl-spacer)) |
15
+ // | --graupl-spacer-4 | calc(0.75 * var(--graupl-spacer)) |
16
+ // | --graupl-spacer-5 | calc(1 * var(--graupl-spacer)) |
17
+ // | --graupl-spacer-6 | calc(1.5 * var(--graupl-spacer)) |
18
+ // | --graupl-spacer-7 | calc(2 * var(--graupl-spacer)) |
19
+ // | --graupl-spacer-8 | calc(3 * var(--graupl-spacer)) |
20
+ // | --graupl-spacer-9 | calc(5 * var(--graupl-spacer)) |
21
+ // | --graupl-spacer-10 | calc(10 * var(--graupl-spacer)) |
22
+ // | --graupl-border-radius | 0.125rem |
23
+ // | --graupl-border-top-left-radius | var(--graupl-border-radius) |
24
+ // | --graupl-border-top-right-radius | var(--graupl-border-radius) |
25
+ // | --graupl-border-bottom-right-radius | var(--graupl-border-radius) |
26
+ // | --graupl-border-bottom-left-radius | var(--graupl-border-radius) |
27
+ // | --graupl-border-width | 0.125rem |
28
+ // | --graupl-border-top-width | var(--graupl-border-width) |
29
+ // | --graupl-border-right-width | var(--graupl-border-width) |
30
+ // | --graupl-border-bottom-width | var(--graupl-border-width) |
31
+ // | --graupl-border-left-width | var(--graupl-border-width) |
32
+ // | --graupl-border-style | solid |
33
+ // | --graupl-border-top-style | var(--graupl-border-style) |
34
+ // | --graupl-border-right-style | var(--graupl-border-style) |
35
+ // | --graupl-border-bottom-style | var(--graupl-border-style) |
36
+ // | --graupl-border-left-style | var(--graupl-border-style) |
37
+ // | --graupl-transition-duration-fast | 150ms |
38
+ // | --graupl-transition-duration-default | 250ms |
39
+ // | --graupl-transition-duration-slow | 300ms |
40
+ // | --graupl-transition-timing-function | ease |
5
41
 
6
42
  @use "defaults";
7
43
  @use "sass:map";
8
44
 
9
45
  // Layout properties.
46
+ // --graupl-content-max-width
10
47
  $content-max-width: var(
11
48
  --#{defaults.$prefix}content-max-width,
12
49
  defaults.$content-max-width
13
50
  );
14
51
 
15
52
  // Spacing properties.
53
+ // --graupl-spacer
16
54
  $spacer: var(--#{defaults.$prefix}spacer, defaults.$spacer);
17
55
  $spacers: ();
18
56
 
19
57
  @each $key, $value in defaults.$spacer-multipliers {
58
+ // --graupl-spacer-0, --graupl-spacer-1, --graupl-spacer-2, --graupl-spacer-3, --graupl-spacer-4, --graupl-spacer-5, --graupl-spacer-6, --graupl-spacer-7, --graupl-spacer-8, --graupl-spacer-9, --graupl-spacer-10
20
59
  $space: var(
21
60
  --#{defaults.$prefix}spacer-#{$key},
22
61
  calc(#{$value} * #{$spacer})
@@ -25,50 +64,79 @@ $spacers: ();
25
64
  }
26
65
 
27
66
  // Border properties.
67
+ // --graupl-border-radius
28
68
  $border-radius: var(
29
69
  --#{defaults.$prefix}border-radius,
30
70
  defaults.$border-radius
31
71
  );
72
+
73
+ // --graupl-border-top-left-radius
32
74
  $border-top-left-radius: var(
33
75
  --#{defaults.$prefix}border-top-left-radius,
34
76
  #{$border-radius}
35
77
  );
78
+
79
+ // --graupl-border-top-right-radius
36
80
  $border-top-right-radius: var(
37
81
  --#{defaults.$prefix}border-top-right-radius,
38
82
  #{$border-radius}
39
83
  );
84
+
85
+ // --graupl-border-bottom-right-radius
40
86
  $border-bottom-right-radius: var(
41
87
  --#{defaults.$prefix}border-bottom-right-radius,
42
88
  #{$border-radius}
43
89
  );
90
+
91
+ // --graupl-border-bottom-left-radius
44
92
  $border-bottom-left-radius: var(
45
93
  --#{defaults.$prefix}border-bottom-left-radius,
46
94
  #{$border-radius}
47
95
  );
96
+
97
+ // --graupl-border-width
48
98
  $border-width: var(--#{defaults.$prefix}border-width, defaults.$border-width);
99
+
100
+ // --graupl-border-top-width
49
101
  $border-top-width: var(--#{defaults.$prefix}border-top-width, #{$border-width});
102
+
103
+ // --graupl-border-right-width
50
104
  $border-right-width: var(
51
105
  --#{defaults.$prefix}border-right-width,
52
106
  #{$border-width}
53
107
  );
108
+
109
+ // --graupl-border-bottom-width
54
110
  $border-bottom-width: var(
55
111
  --#{defaults.$prefix}border-bottom-width,
56
112
  #{$border-width}
57
113
  );
114
+
115
+ // --graupl-border-left-width
58
116
  $border-left-width: var(
59
117
  --#{defaults.$prefix}border-left-width,
60
118
  #{$border-width}
61
119
  );
120
+
121
+ // --graupl-border-style
62
122
  $border-style: var(--#{defaults.$prefix}border-style, defaults.$border-style);
123
+
124
+ // --graupl-border-top-style
63
125
  $border-top-style: var(--#{defaults.$prefix}border-top-style, #{$border-style});
126
+
127
+ // --graupl-border-right-style
64
128
  $border-right-style: var(
65
129
  --#{defaults.$prefix}border-right-style,
66
130
  #{$border-style}
67
131
  );
132
+
133
+ // --graupl-border-bottom-style
68
134
  $border-bottom-style: var(
69
135
  --#{defaults.$prefix}border-bottom-style,
70
136
  #{$border-style}
71
137
  );
138
+
139
+ // --graupl-border-left-style
72
140
  $border-left-style: var(
73
141
  --#{defaults.$prefix}border-left-style,
74
142
  #{$border-style}
@@ -89,6 +157,8 @@ $transition-durations: (
89
157
  map.get(defaults.$transition-durations, slow)
90
158
  ),
91
159
  );
160
+
161
+ // --graupl-transition-timing-function
92
162
  $transition-timing-function: var(
93
163
  --#{defaults.$prefix}transition-timing-function,
94
164
  defaults.$transition-timing-function
@@ -14,6 +14,7 @@
14
14
  $selector-base: root-defaults.$component-selector-base !default;
15
15
  $modifier-selector-base: root-defaults.$modifier-selector-base !default;
16
16
  $generate-base-theme-map: root-defaults.$generate-base-theme-maps !default;
17
+ $themeable: true !default;
17
18
  $button-selector-base: $selector-base !default;
18
19
  $button-selector: "button" !default;
19
20
  $button-link-selector-base: $modifier-selector-base !default;
@@ -31,8 +32,7 @@ $button-disabled-transform: $button-initial-transform !default;
31
32
  // themed button bases.
32
33
  //
33
34
  // e.g.
34
- // Primary buttons will use primary--900 as the text colour, primary--100 as the background
35
- // and primary--900 as the border colour.
35
+ // Primary buttons will use primary--900 as the text colour and primary--700 as the border colour.
36
36
  //
37
37
  // Secondary/tertiary buttons will use the same shade for their respective colours.
38
38
  $-button-theme-mappings: (
@@ -44,30 +44,8 @@ $-button-theme-mappings: (
44
44
  disabled-color: 200,
45
45
  disabled-border-color: 200,
46
46
  );
47
- $custom-button-state-theme-map: () !default;
48
- $button-state-theme-map: () !default;
49
47
  $button-theme-mappings: () !default;
50
48
 
51
- // @todo remove this once $custom-button-state-theme-map is removed
52
- @if $custom-button-state-theme-map != () {
53
- @warn "`$custom-button-state-theme-map` is deprecated and will be removed in a future release of Graupl. Use `$button-theme-mappings` instead.";
54
-
55
- $button-theme-mappings: map.merge(
56
- $button-theme-mappings,
57
- $custom-button-state-theme-map
58
- );
59
- }
60
-
61
- // @todo remove the once $button-state-theme-map is removed
62
- @if $button-state-theme-map != () {
63
- @warn "`$button-state-theme-map` is deprecated and will be removed in a future release of Graupl. Use `$button-theme-mappings` instead.";
64
-
65
- $button-theme-mappings: map.merge(
66
- $button-theme-mappings,
67
- $button-state-theme-map
68
- );
69
- }
70
-
71
49
  // Merge the custom button state theme map with the default one.
72
50
  @if $generate-base-theme-map {
73
51
  $button-theme-mappings: map.merge(
@@ -12,62 +12,63 @@
12
12
  // - `.link`: A component modifier to make the button component look like a link component.
13
13
  //
14
14
  // The following custom properties can be used to customize the button component:
15
- // | Property | Description | Default Value |
16
- // | --- | --- | --- |
17
- // | `--graupl-button-min-width` | The minimum width of the button component. | `var(--graupl-interactive-min-width)` |
18
- // | `--graupl-button-min-height` | The minimum height of the button component. | `var(--graupl-interactive-min-height)` |
19
- // | `--graupl-button-padding-x` | The horizontal padding of the button component. | `var(--graupl-spacer-5)` |
20
- // | `--graupl-button-padding-y` | The vertical padding of the button component. | `var(--graupl-spacer-3)` |
21
- // | `--graupl-button-padding` | The padding of the button component (combines x and y padding). | `var(--graupl-button-padding-x) var(--graupl-button-padding-y)` |
22
- // | `--graupl-button-font-size` | The font size of the button component. | `var(--graupl-font-size-base)` |
23
- // | `--graupl-button-transition` | The transition of the button component. | `background var(--graupl-transition-duration-fast), color var(--graupl-transition-duration-fast), transform var(--graupl-transition-duration-fast)` |
24
- // | `--graupl-button-transition-reduced-motion` | The transition of the button component when reduced motion is enabled. | `background var(--graupl-transition-duration-none), color var(--graupl-transition-duration-none)` |
25
- // | `--graupl-button-transform` | The transform of the button component. | `0` |
26
- // | `--graupl-button-visited-transform` | The transform of a visited button component. | `var(--graupl-button-transform)` |
27
- // | `--graupl-button-focus-transform` | The transform of a focused button component. | `var(--graupl-button-transform)` |
28
- // | `--graupl-button-hover-transform` | The transform of a hovered button component. | `var(--graupl-button-transform)` |
29
- // | `--graupl-button-active-transform` | The transform of an active button component. | `scale(0.95)` |
30
- // | `--graupl-button-disabled-transform` | The transform of a disabled button component. | `0` |
31
- // | `--graupl-button-background` | The background colour of the button component. | `var(--graupl-background)` |
32
- // | `--graupl-button-visited-background` | The background colour of a visited button component. | `var(--graupl-button-background)` |
33
- // | `--graupl-button-focus-background` | The background colour of a focused button component. | `var(--graupl-button-background)` |
34
- // | `--graupl-button-hover-background` | The background colour of a hovered button component. | `var(--graupl-color)` |
35
- // | `--graupl-button-active-background` | The background colour of an active button component. | `var(--graupl-button-hover-background)` |
36
- // | `--graupl-button-disabled-background` | The background colour of a disabled button component. | `var(--graupl-background)` |
37
- // | `--graupl-button-color` | The text colour of the button component. | `var(--graupl-color)` |
38
- // | `--graupl-button-visited-color` | The text colour of a visited button component. | `var(--graupl-button-color)` |
39
- // | `--graupl-button-focus-color` | The text colour of a focused button component. | `var(--graupl-button-color)` |
40
- // | `--graupl-button-hover-color` | The text colour of a hovered button component. | `var(--graupl-background)` |
41
- // | `--graupl-button-active-color` | The text colour of an active button component. | `var(--graupl-button-hover-color)` |
42
- // | `--graupl-button-disabled-color` | The text colour of a disabled button component. | `var(--graupl-theme-active--primary--200)` |
43
- // | `--graupl-button-border-top-width` | The top border width of the button component. | `var(--graupl-border-top-width)` |
44
- // | `--graupl-button-border-right-width` | The right border width of the button component. | `var(--graupl-border-right-width)` |
45
- // | `--graupl-button-border-bottom-width` | The bottom border width of the button component. | `var(--graupl-border-bottom-width)` |
46
- // | `--graupl-button-border-left-width` | The left border width of the button component. | `var(--graupl-border-left-width)` |
47
- // | `--graupl-button-border-width` | The border width of the button component (combines top, right, bottom, and left widths). | `var(--graupl-button-border-top-width) var(--graupl-button-border-right-width) var(--graupl-button-border-bottom-width) var(--graupl-button-border-left-width)` |
48
- // | `--graupl-button-border-top-style` | The top border style of the button component. | `var(--graupl-border-top-style)` |
49
- // | `--graupl-button-border-right-style` | The right border style of the button component. | `var(--graupl-border-right-style)` |
50
- // | `--graupl-button-border-bottom-style` | The bottom border style of the button component. | `var(--graupl-border-bottom-style)` |
51
- // | `--graupl-button-border-left-style` | The left border style of the button component. | `var(--graupl-border-left-style)` |
52
- // | `--graupl-button-border-style` | The border style of the button component (combines top, right, bottom, and left styles). | `var(--graupl-button-border-top-style) var(--graupl-button-border-right-style) var(--graupl-button-border-bottom-style) var(--graupl-button-border-left-style)` |
53
- // | `--graupl-button-border-top-left-radius` | The top left border radius of the button component. | `var(--graupl-border-top-left-radius)` |
54
- // | `--graupl-button-border-top-right-radius` | The top right border radius of the button component. | `var(--graupl-border-top-right-radius)` |
55
- // | `--graupl-button-border-bottom-right-radius` | The bottom right border radius of the button component. | `var(--graupl-border-bottom-right-radius)` |
56
- // | `--graupl-button-border-bottom-left-radius` | The bottom left border radius of the button component. | `var(--graupl-border-bottom-left-radius)` |
57
- // | `--graupl-button-border-radius` | The border radius of the button component (combines top-left, top-right, bottom-right, and bottom-left radii). | `var(--graupl-button-border-top-left-radius) var(--graupl-button-border-top-right-radius) var(--graupl-button-border-bottom-right-radius) var(--graupl-button-border-bottom-left-radius)` |
58
- // | `--graupl-button-border-color` | The border colour of the button component. | `var(--graupl-border-color)` |
59
- // | `--graupl-button-visited-border-color` | The border colour of a visited button component. | `var(--graupl-button-border-color)` |
60
- // | `--graupl-button-focus-border-color` | The border colour of a focused button component. | `var(--graupl-button-border-color)` |
61
- // | `--graupl-button-hover-border-color` | The border colour of a hovered button component. | `var(--graupl-border-color)` |
62
- // | `--graupl-button-active-border-color` | The border colour of an active button component. | `var(--graupl-button-hover-border-color)` |
63
- // | `--graupl-button-disabled-border-color` | The border colour of a disabled button component. | `var(--graupl-theme-active--primary--200)` |
15
+ // | Property | Description | Default Value |
16
+ // | --- | --- | --- |
17
+ // | `--graupl-button-min-width` | The minimum width of the button component. | `var(--graupl-interactive-min-width)` |
18
+ // | `--graupl-button-min-height` | The minimum height of the button component. | `var(--graupl-interactive-min-height)` |
19
+ // | `--graupl-button-padding-x` | The horizontal padding of the button component. | `var(--graupl-spacer-5)` |
20
+ // | `--graupl-button-padding-y` | The vertical padding of the button component. | `var(--graupl-spacer-3)` |
21
+ // | `--graupl-button-padding` | The padding of the button component (combines x and y padding). | `var(--graupl-button-padding-y) var(--graupl-button-padding-x)` |
22
+ // | `--graupl-button-font-size` | The font size of the button component. | `var(--graupl-font-size-base)` |
23
+ // | `--graupl-button-transition` | The transition of the button component. | `background var(--graupl-transition-duration-fast) var(--graupl-transition-timing-function), color var(--graupl-transition-duration-fast) var(--graupl-transition-timing-function), transform var(--graupl-transition-duration-fast) var(--graupl-transition-timing-function)` |
24
+ // | `--graupl-button-transition-reduced-motion` | The transition of the button component when reduced motion is enabled. | `background var(--graupl-transition-duration-none) var(--graupl-transition-timing-function), color var(--graupl-transition-duration-none) var(--graupl-transition-timing-function)` |
25
+ // | `--graupl-button-transform` | The transform of the button component. | `none` |
26
+ // | `--graupl-button-visited-transform` | The transform of a visited button component. | `var(--graupl-button-transform)` |
27
+ // | `--graupl-button-focus-transform` | The transform of a focused button component. | `var(--graupl-button-transform)` |
28
+ // | `--graupl-button-hover-transform` | The transform of a hovered button component. | `var(--graupl-button-transform)` |
29
+ // | `--graupl-button-active-transform` | The transform of an active button component. | `scale(0.95)` |
30
+ // | `--graupl-button-disabled-transform` | The transform of a disabled button component. | `none` |
31
+ // | `--graupl-button-background` | The background colour of the button component. | `var(--graupl-background)` |
32
+ // | `--graupl-button-visited-background` | The background colour of a visited button component. | `var(--graupl-button-background)` |
33
+ // | `--graupl-button-focus-background` | The background colour of a focused button component. | `var(--graupl-button-background)` |
34
+ // | `--graupl-button-hover-background` | The background colour of a hovered button component. | `var(--graupl-color)` |
35
+ // | `--graupl-button-active-background` | The background colour of an active button component. | `var(--graupl-button-hover-background)` |
36
+ // | `--graupl-button-disabled-background` | The background colour of a disabled button component. | `var(--graupl-background)` |
37
+ // | `--graupl-button-color` | The text colour of the button component. | `var(--graupl-color)` |
38
+ // | `--graupl-button-visited-color` | The text colour of a visited button component. | `var(--graupl-button-color)` |
39
+ // | `--graupl-button-focus-color` | The text colour of a focused button component. | `var(--graupl-button-color)` |
40
+ // | `--graupl-button-hover-color` | The text colour of a hovered button component. | `var(--graupl-background)` |
41
+ // | `--graupl-button-active-color` | The text colour of an active button component. | `var(--graupl-button-hover-color)` |
42
+ // | `--graupl-button-disabled-color` | The text colour of a disabled button component. | `var(--graupl-theme-active--primary--200)` |
43
+ // | `--graupl-button-border-top-width` | The top border width of the button component. | `var(--graupl-border-top-width)` |
44
+ // | `--graupl-button-border-right-width` | The right border width of the button component. | `var(--graupl-border-right-width)` |
45
+ // | `--graupl-button-border-bottom-width` | The bottom border width of the button component. | `var(--graupl-border-bottom-width)` |
46
+ // | `--graupl-button-border-left-width` | The left border width of the button component. | `var(--graupl-border-left-width)` |
47
+ // | `--graupl-button-border-width` | The border width of the button component (combines top, right, bottom, and left widths). | `var(--graupl-button-border-top-width) var(--graupl-button-border-right-width) var(--graupl-button-border-bottom-width) var(--graupl-button-border-left-width)` |
48
+ // | `--graupl-button-border-top-style` | The top border style of the button component. | `var(--graupl-border-top-style)` |
49
+ // | `--graupl-button-border-right-style` | The right border style of the button component. | `var(--graupl-border-right-style)` |
50
+ // | `--graupl-button-border-bottom-style` | The bottom border style of the button component. | `var(--graupl-border-bottom-style)` |
51
+ // | `--graupl-button-border-left-style` | The left border style of the button component. | `var(--graupl-border-left-style)` |
52
+ // | `--graupl-button-border-style` | The border style of the button component (combines top, right, bottom, and left styles). | `var(--graupl-button-border-top-style) var(--graupl-button-border-right-style) var(--graupl-button-border-bottom-style) var(--graupl-button-border-left-style)` |
53
+ // | `--graupl-button-border-top-left-radius` | The top left border radius of the button component. | `var(--graupl-border-top-left-radius)` |
54
+ // | `--graupl-button-border-top-right-radius` | The top right border radius of the button component. | `var(--graupl-border-top-right-radius)` |
55
+ // | `--graupl-button-border-bottom-right-radius` | The bottom right border radius of the button component. | `var(--graupl-border-bottom-right-radius)` |
56
+ // | `--graupl-button-border-bottom-left-radius` | The bottom left border radius of the button component. | `var(--graupl-border-bottom-left-radius)` |
57
+ // | `--graupl-button-border-radius` | The border radius of the button component (combines top-left, top-right, bottom-right, and bottom-left radii). | `var(--graupl-button-border-top-left-radius) var(--graupl-button-border-top-right-radius) var(--graupl-button-border-bottom-right-radius) var(--graupl-button-border-bottom-left-radius)` |
58
+ // | `--graupl-button-border-color` | The border colour of the button component. | `var(--graupl-border-color)` |
59
+ // | `--graupl-button-visited-border-color` | The border colour of a visited button component. | `var(--graupl-button-border-color)` |
60
+ // | `--graupl-button-focus-border-color` | The border colour of a focused button component. | `var(--graupl-button-border-color)` |
61
+ // | `--graupl-button-hover-border-color` | The border colour of a hovered button component. | `var(--graupl-border-color)` |
62
+ // | `--graupl-button-active-border-color` | The border colour of an active button component. | `var(--graupl-button-hover-border-color)` |
63
+ // | `--graupl-button-disabled-border-color` | The border colour of a disabled button component. | `var(--graupl-theme-active--primary--200)` |
64
64
  //
65
65
  // The following sass variables can be used to customize the generation of the button component:
66
- // | Variable | Description | Default Value |
67
- // | --- | --- | --- |
66
+ // | Variable | Description | Default Value |
67
+ // | --- | --- | --- |
68
68
  // | `$selector-base` | The selector base for the component. | `.` |
69
69
  // | `$modifier-selector-base` | The selector base for component modifiers. | `.` |
70
70
  // | `$generate-base-theme-map` | A flag to generate the base theme maps for button variants. | `true` |
71
+ // | `$themeable` | A flag that determines whether theme modifiers are generated. | `true` |
71
72
  // | `$button-selector-base` | The selector base for the button component. | `$selector-base` |
72
73
  // | `$button-selector` | The button component selector. | `button` |
73
74
  // | `$button-link-selector-base` | The selector base for the button link component modifier. | `$modifier-selector-base` |
@@ -80,7 +81,7 @@
80
81
  // | `$button-theme-mappings` | A map of properties and color shades used generate all button variants. | `()` |
81
82
  // | `$button-theme-map` | A map of all properties, colors, and color shades used to generate all button variants. | `()` |
82
83
  //
83
- // Using `$button-theme-mappings`
84
+ // ## Using `$button-theme-mappings`
84
85
  //
85
86
  // `$button-theme-mappings` is a 1-level map of properties and shade values.
86
87
  //