@navikt/ds-css 7.7.0 → 7.8.1

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 (214) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/config/bundle.darkside.ts +270 -0
  3. package/config/tests/bundle.test.ts +46 -0
  4. package/darkside/baseline/{utilities.darkside.css → baseline.darkside.css} +9 -0
  5. package/darkside/baseline/tokens.darkside.css +1 -0
  6. package/darkside/button.darkside.css +1 -1
  7. package/darkside/copybutton.darkside.css +1 -1
  8. package/darkside/dropdown.darkside.css +1 -1
  9. package/darkside/form/combobox.darkside.css +1 -22
  10. package/darkside/form/fieldset.darkside.css +1 -1
  11. package/darkside/form/form.darkside.css +2 -2
  12. package/darkside/form/radio-checkbox.darkside.css +1 -1
  13. package/darkside/form/search.darkside.css +6 -2
  14. package/darkside/form/switch.darkside.css +1 -1
  15. package/darkside/guide-panel.darkside.css +78 -60
  16. package/darkside/index.css +9 -11
  17. package/darkside/link.darkside.css +2 -2
  18. package/darkside/table.darkside.css +52 -97
  19. package/darkside/tag.darkside.css +85 -147
  20. package/darkside/timeline.darkside.css +118 -211
  21. package/darkside/tooltip.darkside.css +82 -57
  22. package/darkside/typography.darkside.css +0 -12
  23. package/dist/component/form.css +2 -21
  24. package/dist/component/form.min.css +1 -1
  25. package/dist/component/link.css +1 -1
  26. package/dist/component/link.min.css +1 -1
  27. package/dist/component/table.css +1 -1
  28. package/dist/component/table.min.css +1 -1
  29. package/dist/component/tag.css +12 -6
  30. package/dist/component/tag.min.css +1 -1
  31. package/dist/components.css +17 -990
  32. package/dist/components.min.css +2 -4
  33. package/dist/darkside/component/accordion.css +174 -0
  34. package/dist/darkside/component/accordion.min.css +1 -0
  35. package/dist/darkside/component/actionmenu.css +182 -0
  36. package/dist/darkside/component/actionmenu.min.css +1 -0
  37. package/dist/darkside/component/alert.css +105 -0
  38. package/dist/darkside/component/alert.min.css +1 -0
  39. package/dist/darkside/component/button.css +271 -0
  40. package/dist/darkside/component/button.min.css +1 -0
  41. package/dist/darkside/component/chat.css +103 -0
  42. package/dist/darkside/component/chat.min.css +1 -0
  43. package/dist/darkside/component/chips.css +176 -0
  44. package/dist/darkside/component/chips.min.css +1 -0
  45. package/dist/darkside/component/copybutton.css +176 -0
  46. package/dist/darkside/component/copybutton.min.css +1 -0
  47. package/dist/darkside/component/date.css +262 -0
  48. package/dist/darkside/component/date.min.css +1 -0
  49. package/dist/darkside/component/dropdown.css +92 -0
  50. package/dist/darkside/component/dropdown.min.css +1 -0
  51. package/dist/darkside/component/expansioncard.css +167 -0
  52. package/dist/darkside/component/expansioncard.min.css +1 -0
  53. package/dist/darkside/component/form.css +1871 -0
  54. package/dist/darkside/component/form.min.css +1 -0
  55. package/dist/darkside/component/guidepanel.css +113 -0
  56. package/dist/darkside/component/guidepanel.min.css +1 -0
  57. package/dist/darkside/component/helptext.css +53 -0
  58. package/dist/darkside/component/helptext.min.css +1 -0
  59. package/dist/darkside/component/internalheader.css +100 -0
  60. package/dist/darkside/component/internalheader.min.css +1 -0
  61. package/dist/darkside/component/link.css +60 -0
  62. package/dist/darkside/component/link.min.css +1 -0
  63. package/dist/darkside/component/linkpanel.css +48 -0
  64. package/dist/darkside/component/linkpanel.min.css +1 -0
  65. package/dist/darkside/component/list.css +88 -0
  66. package/dist/darkside/component/list.min.css +1 -0
  67. package/dist/darkside/component/loader.css +119 -0
  68. package/dist/darkside/component/loader.min.css +1 -0
  69. package/dist/darkside/component/modal.css +175 -0
  70. package/dist/darkside/component/modal.min.css +1 -0
  71. package/dist/darkside/component/pagination.css +43 -0
  72. package/dist/darkside/component/pagination.min.css +1 -0
  73. package/dist/darkside/component/panel.css +12 -0
  74. package/dist/darkside/component/panel.min.css +1 -0
  75. package/dist/darkside/component/popover.css +18 -0
  76. package/dist/darkside/component/popover.min.css +1 -0
  77. package/dist/darkside/component/primitives.css +1291 -0
  78. package/dist/darkside/component/primitives.min.css +1 -0
  79. package/dist/darkside/component/progressbar.css +106 -0
  80. package/dist/darkside/component/progressbar.min.css +1 -0
  81. package/dist/darkside/component/readmore.css +95 -0
  82. package/dist/darkside/component/readmore.min.css +1 -0
  83. package/dist/darkside/component/skeleton.css +66 -0
  84. package/dist/darkside/component/skeleton.min.css +1 -0
  85. package/dist/darkside/component/stepper.css +234 -0
  86. package/dist/darkside/component/stepper.min.css +1 -0
  87. package/dist/darkside/component/table.css +225 -0
  88. package/dist/darkside/component/table.min.css +1 -0
  89. package/dist/darkside/component/tabs.css +138 -0
  90. package/dist/darkside/component/tabs.min.css +1 -0
  91. package/dist/darkside/component/tag.css +128 -0
  92. package/dist/darkside/component/tag.min.css +1 -0
  93. package/dist/darkside/component/theme.css +17 -0
  94. package/dist/darkside/component/theme.min.css +1 -0
  95. package/dist/darkside/component/timeline.css +338 -0
  96. package/dist/darkside/component/timeline.min.css +1 -0
  97. package/dist/darkside/component/togglegroup.css +105 -0
  98. package/dist/darkside/component/togglegroup.min.css +1 -0
  99. package/dist/darkside/component/tooltip.css +108 -0
  100. package/dist/darkside/component/tooltip.min.css +1 -0
  101. package/dist/darkside/component/typography.css +242 -0
  102. package/dist/darkside/component/typography.min.css +1 -0
  103. package/dist/darkside/components.css +7471 -0
  104. package/dist/darkside/components.min.css +1 -0
  105. package/dist/darkside/global/baseline.css +47 -0
  106. package/dist/darkside/global/baseline.min.css +1 -0
  107. package/dist/darkside/global/fonts.css +109 -0
  108. package/dist/darkside/global/fonts.min.css +1 -0
  109. package/dist/darkside/global/print.css +52 -0
  110. package/dist/darkside/global/print.min.css +1 -0
  111. package/dist/darkside/global/reset.css +93 -0
  112. package/dist/darkside/global/reset.min.css +1 -0
  113. package/dist/darkside/global/tokens.css +895 -0
  114. package/dist/darkside/global/tokens.min.css +1 -0
  115. package/dist/darkside/index.css +8670 -0
  116. package/dist/darkside/index.min.css +1 -0
  117. package/dist/darkside/version/7.8.1/component/accordion.css +174 -0
  118. package/dist/darkside/version/7.8.1/component/accordion.min.css +1 -0
  119. package/dist/darkside/version/7.8.1/component/actionmenu.css +182 -0
  120. package/dist/darkside/version/7.8.1/component/actionmenu.min.css +1 -0
  121. package/dist/darkside/version/7.8.1/component/alert.css +105 -0
  122. package/dist/darkside/version/7.8.1/component/alert.min.css +1 -0
  123. package/dist/darkside/version/7.8.1/component/button.css +271 -0
  124. package/dist/darkside/version/7.8.1/component/button.min.css +1 -0
  125. package/dist/darkside/version/7.8.1/component/chat.css +103 -0
  126. package/dist/darkside/version/7.8.1/component/chat.min.css +1 -0
  127. package/dist/darkside/version/7.8.1/component/chips.css +176 -0
  128. package/dist/darkside/version/7.8.1/component/chips.min.css +1 -0
  129. package/dist/darkside/version/7.8.1/component/copybutton.css +176 -0
  130. package/dist/darkside/version/7.8.1/component/copybutton.min.css +1 -0
  131. package/dist/darkside/version/7.8.1/component/date.css +262 -0
  132. package/dist/darkside/version/7.8.1/component/date.min.css +1 -0
  133. package/dist/darkside/version/7.8.1/component/dropdown.css +92 -0
  134. package/dist/darkside/version/7.8.1/component/dropdown.min.css +1 -0
  135. package/dist/darkside/version/7.8.1/component/expansioncard.css +167 -0
  136. package/dist/darkside/version/7.8.1/component/expansioncard.min.css +1 -0
  137. package/dist/darkside/version/7.8.1/component/form.css +1871 -0
  138. package/dist/darkside/version/7.8.1/component/form.min.css +1 -0
  139. package/dist/darkside/version/7.8.1/component/guidepanel.css +113 -0
  140. package/dist/darkside/version/7.8.1/component/guidepanel.min.css +1 -0
  141. package/dist/darkside/version/7.8.1/component/helptext.css +53 -0
  142. package/dist/darkside/version/7.8.1/component/helptext.min.css +1 -0
  143. package/dist/darkside/version/7.8.1/component/internalheader.css +100 -0
  144. package/dist/darkside/version/7.8.1/component/internalheader.min.css +1 -0
  145. package/dist/darkside/version/7.8.1/component/link.css +60 -0
  146. package/dist/darkside/version/7.8.1/component/link.min.css +1 -0
  147. package/dist/darkside/version/7.8.1/component/linkpanel.css +48 -0
  148. package/dist/darkside/version/7.8.1/component/linkpanel.min.css +1 -0
  149. package/dist/darkside/version/7.8.1/component/list.css +88 -0
  150. package/dist/darkside/version/7.8.1/component/list.min.css +1 -0
  151. package/dist/darkside/version/7.8.1/component/loader.css +119 -0
  152. package/dist/darkside/version/7.8.1/component/loader.min.css +1 -0
  153. package/dist/darkside/version/7.8.1/component/modal.css +175 -0
  154. package/dist/darkside/version/7.8.1/component/modal.min.css +1 -0
  155. package/dist/darkside/version/7.8.1/component/pagination.css +43 -0
  156. package/dist/darkside/version/7.8.1/component/pagination.min.css +1 -0
  157. package/dist/darkside/version/7.8.1/component/panel.css +12 -0
  158. package/dist/darkside/version/7.8.1/component/panel.min.css +1 -0
  159. package/dist/darkside/version/7.8.1/component/popover.css +18 -0
  160. package/dist/darkside/version/7.8.1/component/popover.min.css +1 -0
  161. package/dist/darkside/version/7.8.1/component/primitives.css +1291 -0
  162. package/dist/darkside/version/7.8.1/component/primitives.min.css +1 -0
  163. package/dist/darkside/version/7.8.1/component/progressbar.css +106 -0
  164. package/dist/darkside/version/7.8.1/component/progressbar.min.css +1 -0
  165. package/dist/darkside/version/7.8.1/component/readmore.css +95 -0
  166. package/dist/darkside/version/7.8.1/component/readmore.min.css +1 -0
  167. package/dist/darkside/version/7.8.1/component/skeleton.css +66 -0
  168. package/dist/darkside/version/7.8.1/component/skeleton.min.css +1 -0
  169. package/dist/darkside/version/7.8.1/component/stepper.css +234 -0
  170. package/dist/darkside/version/7.8.1/component/stepper.min.css +1 -0
  171. package/dist/darkside/version/7.8.1/component/table.css +225 -0
  172. package/dist/darkside/version/7.8.1/component/table.min.css +1 -0
  173. package/dist/darkside/version/7.8.1/component/tabs.css +138 -0
  174. package/dist/darkside/version/7.8.1/component/tabs.min.css +1 -0
  175. package/dist/darkside/version/7.8.1/component/tag.css +128 -0
  176. package/dist/darkside/version/7.8.1/component/tag.min.css +1 -0
  177. package/dist/darkside/version/7.8.1/component/theme.css +17 -0
  178. package/dist/darkside/version/7.8.1/component/theme.min.css +1 -0
  179. package/dist/darkside/version/7.8.1/component/timeline.css +338 -0
  180. package/dist/darkside/version/7.8.1/component/timeline.min.css +1 -0
  181. package/dist/darkside/version/7.8.1/component/togglegroup.css +105 -0
  182. package/dist/darkside/version/7.8.1/component/togglegroup.min.css +1 -0
  183. package/dist/darkside/version/7.8.1/component/tooltip.css +108 -0
  184. package/dist/darkside/version/7.8.1/component/tooltip.min.css +1 -0
  185. package/dist/darkside/version/7.8.1/component/typography.css +242 -0
  186. package/dist/darkside/version/7.8.1/component/typography.min.css +1 -0
  187. package/dist/darkside/version/7.8.1/components.css +7471 -0
  188. package/dist/darkside/version/7.8.1/components.min.css +1 -0
  189. package/dist/darkside/version/7.8.1/global/baseline.css +47 -0
  190. package/dist/darkside/version/7.8.1/global/baseline.min.css +1 -0
  191. package/dist/darkside/version/7.8.1/global/fonts.css +109 -0
  192. package/dist/darkside/version/7.8.1/global/fonts.min.css +1 -0
  193. package/dist/darkside/version/7.8.1/global/print.css +52 -0
  194. package/dist/darkside/version/7.8.1/global/print.min.css +1 -0
  195. package/dist/darkside/version/7.8.1/global/reset.css +93 -0
  196. package/dist/darkside/version/7.8.1/global/reset.min.css +1 -0
  197. package/dist/darkside/version/7.8.1/global/tokens.css +895 -0
  198. package/dist/darkside/version/7.8.1/global/tokens.min.css +1 -0
  199. package/dist/darkside/version/7.8.1/index.css +8670 -0
  200. package/dist/darkside/version/7.8.1/index.min.css +1 -0
  201. package/dist/global/tokens.css +1 -1
  202. package/dist/global/tokens.min.css +1 -1
  203. package/dist/index.css +17 -31
  204. package/dist/index.min.css +2 -2
  205. package/form/combobox.css +2 -22
  206. package/link.css +1 -1
  207. package/package.json +23 -9
  208. package/table.css +1 -1
  209. package/tag.css +12 -6
  210. package/tokens.json +0 -3
  211. package/darkside/index copy.css +0 -37
  212. package/dist/component/index.css +0 -10123
  213. package/dist/component/index.min.css +0 -9
  214. /package/darkside/{baseline/theme.darkside.css → theme.darkside.css} +0 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,23 @@
1
1
  # @navikt/ds-css
2
2
 
3
+ ## 7.8.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Alert: Link-components used within Alert variant='inline' now preserves default coloring ([#3461](https://github.com/navikt/aksel/pull/3461))
8
+
9
+ - Table: :fire: Removed cursor 'pointer' when 'ExpandableRow' is disabled. ([#3462](https://github.com/navikt/aksel/pull/3462))
10
+
11
+ ## 7.8.0
12
+
13
+ ### Minor Changes
14
+
15
+ - Combobox: Removed clear button, removed tokens staring with `--ac-combobox-clear`, deprecated props `clearButton`/`clearButtonLabel`. ([#3433](https://github.com/navikt/aksel/pull/3433))
16
+
17
+ ### Patch Changes
18
+
19
+ - CSS: Resolved regression where the complete stylesheet was included in scoped 'components.css' file. ([#3427](https://github.com/navikt/aksel/pull/3427))
20
+
3
21
  ## 7.7.0
4
22
 
5
23
  ## 7.6.0
@@ -0,0 +1,270 @@
1
+ import browserslist from "browserslist";
2
+ import CleanCss from "clean-css";
3
+ import fastglob from "fast-glob";
4
+ import fs from "fs";
5
+ import { Features, browserslistToTargets, bundleAsync } from "lightningcss";
6
+ import path from "path";
7
+ import {
8
+ StyleMappings,
9
+ componentsCss,
10
+ formCss,
11
+ primitivesCss,
12
+ } from "../config/_mappings";
13
+ import packageJSON from "../package.json";
14
+
15
+ bundleDarkside();
16
+
17
+ async function bundleDarkside() {
18
+ const buildDir = path.join(__dirname, "..", "dist/darkside");
19
+ const darksideDir = path.join(__dirname, "..", "darkside");
20
+
21
+ /* Make sure every dir is created to make node happy */
22
+ [buildDir, `${buildDir}/global`, `${buildDir}/component`].forEach((dir) => {
23
+ if (!fs.existsSync(dir)) {
24
+ fs.mkdirSync(dir, { recursive: true });
25
+ }
26
+ });
27
+
28
+ /**
29
+ * Bundles the ./index.css file with LightningCSS.
30
+ * @param rootParser: Custom parsers that allows for editing the index.css file before bundling it. This allows removing unwanted CSS from being bundled.
31
+ * @returns Parsed CSS file output. Must be valid CSS.
32
+ */
33
+ async function bundleCSS(rootParser?: (rootFile: string) => string) {
34
+ const { code } = await bundleAsync({
35
+ filename: `${darksideDir}/index.css`,
36
+ minify: false,
37
+ include:
38
+ Features.Nesting | Features.MediaRangeSyntax | Features.HexAlphaColors,
39
+
40
+ drafts: {
41
+ customMedia: false,
42
+ },
43
+ targets: browserslistToTargets(
44
+ browserslist(">= 0.5% in NO, safari >= 15.4, iOS >= 15.4, not dead"),
45
+ ),
46
+ resolver: {
47
+ read(filePath) {
48
+ const file = fs.readFileSync(filePath, "utf8");
49
+ if (filePath === `${darksideDir}/index.css` && rootParser) {
50
+ return rootParser(file);
51
+ }
52
+
53
+ return file;
54
+ },
55
+ },
56
+ });
57
+
58
+ let codeString = code.toString();
59
+
60
+ /**
61
+ * LightningCSS adds these tokens to the bundle that we want removed:
62
+ * --lightningcss-light: initial;
63
+ * --lightningcss-dark: ;
64
+ */
65
+ codeString = codeString
66
+ .split("\n")
67
+ .filter((line) => !line.includes("--lightningcss-"))
68
+ .join("\n");
69
+
70
+ return codeString;
71
+ }
72
+
73
+ /**
74
+ * Writes the CSS file to the build directory. Includes a minified version with the .min.css suffix.
75
+ * @param file: CSS file content
76
+ * @param filePath: Path to the file in the build directory
77
+ */
78
+ function writeFile({ file, filePath }: { file: string; filePath: string }) {
79
+ fs.writeFileSync(`${buildDir}/${filePath}`, file);
80
+
81
+ /**
82
+ * We use CleanCss package here since we only want it to optimize filesize, not transform any CSS like LightningCSS minifier does.
83
+ * This is because we want to keep the CSS as close to the original as possible.
84
+ * Since CleanCSS is not part of the PostCSS ecosystem, we use it in replacement for cssnano.
85
+ */
86
+ const minifiedCss = new CleanCss({}).minify(file);
87
+
88
+ if (minifiedCss.errors.length > 0) {
89
+ throw new Error(
90
+ `Errors found when minifying for ${filePath} CSS. Stopped bundling\n${minifiedCss.errors}`,
91
+ );
92
+ }
93
+
94
+ fs.writeFileSync(
95
+ `${buildDir}/${filePath.replace(".css", ".min.css")}`,
96
+ minifiedCss.styles,
97
+ );
98
+ }
99
+
100
+ /* ----------------------------- index.css build ---------------------------- */
101
+ await bundleCSS().then((file) => {
102
+ writeFile({
103
+ file,
104
+ filePath: "index.css",
105
+ });
106
+ });
107
+
108
+ /* --------------------------- component.css build -------------------------- */
109
+ function rootComponentsParser(rootString: string) {
110
+ let parsed = rootString
111
+ .split("\n")
112
+ .filter((line) => {
113
+ /* We assume that all components is added under the layer components or layout */
114
+ return (
115
+ line.endsWith("layer(aksel.components);") ||
116
+ line.endsWith("layer(aksel.layout);")
117
+ );
118
+ })
119
+ .join("\n");
120
+
121
+ /* If one imports this file standalone, we would like to make sure the layering order is included. */
122
+ const layerDefinition = rootString
123
+ .split("\n")
124
+ .find((line) => line.startsWith("@layer"));
125
+
126
+ if (!layerDefinition) {
127
+ throw new Error(
128
+ "No layer definition found in index.css. Stopped bundling",
129
+ );
130
+ }
131
+
132
+ parsed = layerDefinition + "\n" + parsed;
133
+
134
+ return parsed;
135
+ }
136
+
137
+ await bundleCSS(rootComponentsParser).then((file) => {
138
+ writeFile({
139
+ file,
140
+ filePath: componentsCss,
141
+ });
142
+ });
143
+
144
+ /* ------------------------------ /global build ----------------------------- */
145
+ for (const style of StyleMappings.baseline) {
146
+ // eslint-disable-next-line no-inner-declarations
147
+ function parser(input: string) {
148
+ return input
149
+ .split("\n")
150
+ .filter((line) => line.startsWith("@import"))
151
+ .filter((line) =>
152
+ line.replace(".darkside.css", ".css").includes(style.main),
153
+ )
154
+ .join("\n");
155
+ }
156
+
157
+ await bundleCSS(parser).then((file) => {
158
+ writeFile({
159
+ file,
160
+ filePath: `global/${style.main}`,
161
+ });
162
+ });
163
+ }
164
+
165
+ /* ------------------------------ form build ----------------------------- */
166
+ function rootFormParser(input: string) {
167
+ return input
168
+ .split("\n")
169
+ .filter((line) => line.startsWith("@import"))
170
+ .filter((line) => line.includes("form/index.css"))
171
+ .join("\n");
172
+ }
173
+
174
+ await bundleCSS(rootFormParser).then((file) => {
175
+ writeFile({
176
+ file,
177
+ filePath: `component/${formCss}`,
178
+ });
179
+ });
180
+
181
+ /* ------------------------------ Primitives build ----------------------------- */
182
+ function rootPrimitivesParser(input: string) {
183
+ return input
184
+ .split("\n")
185
+ .filter((line) => line.startsWith("@import"))
186
+ .filter((line) => line.includes("primitives/index.css"))
187
+ .join("\n");
188
+ }
189
+
190
+ await bundleCSS(rootPrimitivesParser).then((file) => {
191
+ writeFile({
192
+ file,
193
+ filePath: `component/${primitivesCss}`,
194
+ });
195
+ });
196
+
197
+ /* ---------------------------- /component build ---------------------------- */
198
+
199
+ function componentFiles(): string[] {
200
+ const indexFile = fs.readFileSync(`${darksideDir}/index.css`, "utf8");
201
+
202
+ /* Since forms and primitives is under the same layers, but diffferent files we filter them out to avoid duplicates */
203
+ const formLine = rootFormParser(indexFile);
204
+ const primitivesLine = rootPrimitivesParser(indexFile);
205
+
206
+ return indexFile
207
+ .split("\n")
208
+ .filter((line) => line.startsWith("@import"))
209
+ .filter((line) => !formLine.includes(line))
210
+ .filter((line) => !primitivesLine.includes(line))
211
+ .filter((line) => line.endsWith("layer(aksel.components);"));
212
+ }
213
+
214
+ for (const componentLine of componentFiles()) {
215
+ // eslint-disable-next-line no-inner-declarations
216
+ function parser(input: string) {
217
+ return input
218
+ .split("\n")
219
+ .filter((line) => line === componentLine)
220
+ .join("\n");
221
+ }
222
+
223
+ await bundleCSS(parser).then((file) => {
224
+ const componentName = componentLine
225
+ /* Matches everything between " */
226
+ .match(/".*"/gm)?.[0]
227
+ /* Replaces every " with nothing */
228
+ .replace(/"/gm, "")
229
+ /* Removes start of import-string */
230
+ .replace("./", "")
231
+ .replace(".darkside.css", ".css");
232
+
233
+ if (!componentName) {
234
+ throw new Error(
235
+ `Could not find component name for line: ${componentLine}`,
236
+ );
237
+ }
238
+
239
+ const sanitizedName = componentName
240
+ /*
241
+ * https://regex101.com/r/MAj58n/1
242
+ * Removes every - and space
243
+ */
244
+ .replace(/[\s-]/g, "")
245
+ .replace(".css", "")
246
+ .toLowerCase();
247
+
248
+ writeFile({
249
+ file,
250
+ filePath: `component/${sanitizedName}.css`,
251
+ });
252
+ });
253
+ }
254
+
255
+ const version = packageJSON.version;
256
+
257
+ const files = fastglob.sync("**/*.css", {
258
+ cwd: buildDir,
259
+ ignore: ["**/version/**"],
260
+ });
261
+
262
+ for (const file of files) {
263
+ const css = fs.readFileSync(`${buildDir}/${file}`, "utf-8");
264
+
265
+ const filename = `${buildDir}/version/${version}/${file}`;
266
+ fs.mkdirSync(path.dirname(filename), { recursive: true });
267
+
268
+ fs.writeFileSync(filename, css);
269
+ }
270
+ }
@@ -0,0 +1,46 @@
1
+ import fastglob from "fast-glob";
2
+ import path from "path";
3
+ import { describe, expect, test } from "vitest";
4
+
5
+ /**
6
+ * Darkside config might have some new files added. We can skip these when checking for equality.
7
+ */
8
+ const newFiles = ["theme"];
9
+
10
+ describe("Check that old and new (darkside) bundle matches", () => {
11
+ test("Darkside includes the same files as old bundle", () => {
12
+ const oldBundleDir = path.join(__dirname, "../../dist");
13
+ const darksideDir = path.join(__dirname, "../../dist/darkside");
14
+
15
+ const oldFiles = fastglob.sync("**/*.css", {
16
+ cwd: oldBundleDir,
17
+ ignore: ["**/version/**", "**/darkside/**"],
18
+ });
19
+
20
+ const darksideFiles = fastglob.sync("**/*.css", {
21
+ cwd: darksideDir,
22
+ ignore: ["**/version/**"],
23
+ });
24
+
25
+ expect(oldFiles.length).toBeGreaterThan(0);
26
+ expect(darksideFiles.length).toBeGreaterThan(0);
27
+
28
+ // Compare file names
29
+ oldFiles.forEach((file) => {
30
+ expect(darksideFiles).toContain(file);
31
+ });
32
+
33
+ darksideFiles.forEach((file) => {
34
+ if (newFiles.find((newFile) => file.includes(newFile))) {
35
+ return;
36
+ }
37
+ expect(oldFiles).toContain(file);
38
+ });
39
+
40
+ /**
41
+ * Check that darkside has the same amount of files as old bundle
42
+ * (minus the new files * 2 since .min.css is also included)
43
+ */
44
+ expect(darksideFiles.length - newFiles.length * 2).toBe(oldFiles.length);
45
+ });
46
+ });
@@ -1,3 +1,12 @@
1
+ /* ------------------------- Global typo-definitions ------------------------ */
2
+ body,
3
+ :host {
4
+ font-family: var(--ax-font-family, "Source Sans 3", "Source Sans Pro", Arial, sans-serif);
5
+ line-height: 1.333;
6
+ font-size: 1.125rem;
7
+ }
8
+
9
+ /* ---------------------------- Inline utilities ---------------------------- */
1
10
  [hidden] {
2
11
  display: none !important;
3
12
  }
@@ -0,0 +1 @@
1
+ @import "../../../tokens/dist/darkside/tokens.css";
@@ -260,7 +260,7 @@
260
260
  }
261
261
 
262
262
  .navds-button:not(.navds-button--loading):where(:disabled, .navds-button--disabled) {
263
- opacity: 0.3;
263
+ opacity: var(--ax-opacity-disabled);
264
264
  }
265
265
 
266
266
  /* Loader overrides */
@@ -31,7 +31,7 @@
31
31
 
32
32
  &:disabled {
33
33
  cursor: not-allowed;
34
- opacity: 0.3;
34
+ opacity: var(--ax-opacity-disabled);
35
35
  }
36
36
 
37
37
  &:disabled:hover {
@@ -74,7 +74,7 @@
74
74
 
75
75
  .navds-dropdown__item:disabled {
76
76
  color: var(--ac-dropdown-item-text, var(--a-text-action));
77
- opacity: 0.3;
77
+ opacity: var(--ax-opacity-disabled);
78
78
  background: transparent;
79
79
  cursor: not-allowed;
80
80
  }
@@ -28,7 +28,7 @@
28
28
  }
29
29
 
30
30
  .navds-combobox--disabled {
31
- opacity: 0.3;
31
+ opacity: var(--ax-opacity-disabled);
32
32
 
33
33
  & .navds-combobox__wrapper {
34
34
  & *:hover {
@@ -69,7 +69,6 @@
69
69
  }
70
70
  }
71
71
 
72
- .navds-combobox__button-clear svg,
73
72
  .navds-combobox__button-toggle-list svg,
74
73
  .navds-combobox__list svg {
75
74
  width: var(--__axc-combobox-icon-size);
@@ -203,19 +202,6 @@
203
202
  }
204
203
  }
205
204
 
206
- .navds-combobox__button-clear {
207
- border-radius: var(--ax-border-radius-medium);
208
- color: var(--ax-text-subtle);
209
- display: flex;
210
- justify-content: center;
211
- align-items: center;
212
- cursor: pointer;
213
- background: none;
214
- border: none;
215
- font-size: 1rem;
216
- padding: 0;
217
- }
218
-
219
205
  .navds-combobox__input::-webkit-search-cancel-button {
220
206
  display: none;
221
207
  }
@@ -231,10 +217,7 @@
231
217
  border: none;
232
218
  font-size: 1rem;
233
219
  padding: 0;
234
- }
235
220
 
236
- .navds-combobox__button-clear,
237
- .navds-combobox__button-toggle-list {
238
221
  &:hover {
239
222
  color: var(--ax-text-accent);
240
223
 
@@ -405,10 +388,6 @@
405
388
  }
406
389
 
407
390
  @media (forced-colors: active) {
408
- .navds-combobox__button-clear:hover {
409
- color: highlight;
410
- }
411
-
412
391
  .navds-combobox__wrapper-inner:has(.navds-combobox__input:focus-visible) {
413
392
  outline-color: highlight;
414
393
  }
@@ -32,7 +32,7 @@
32
32
 
33
33
  .navds-fieldset:disabled > .navds-fieldset__legend,
34
34
  .navds-fieldset:disabled > .navds-fieldset__description {
35
- opacity: 0.3;
35
+ opacity: var(--ax-opacity-disabled);
36
36
  }
37
37
 
38
38
  @media (forced-colors: active) {
@@ -23,7 +23,7 @@
23
23
  }
24
24
 
25
25
  .navds-form-field--disabled {
26
- opacity: 0.3;
26
+ opacity: var(--ax-opacity-disabled);
27
27
  cursor: not-allowed;
28
28
  }
29
29
 
@@ -41,7 +41,7 @@
41
41
 
42
42
  .navds-form-field__readonly-icon {
43
43
  margin-top: var(--ax-spacing-05);
44
- margin-right: var(--ax-spacing-2);
44
+ margin-right: var(--ax-spacing-1);
45
45
  flex-shrink: 0;
46
46
  align-self: flex-start;
47
47
  }
@@ -172,7 +172,7 @@
172
172
 
173
173
  .navds-checkbox--disabled,
174
174
  .navds-radio--disabled {
175
- opacity: 0.3;
175
+ opacity: var(--ax-opacity-disabled);
176
176
  }
177
177
 
178
178
  .navds-checkbox--disabled > .navds-checkbox__input,
@@ -81,7 +81,7 @@
81
81
  font-size: 1.5rem;
82
82
 
83
83
  .navds-search--disabled & {
84
- opacity: 0.3;
84
+ opacity: var(--ax-opacity-disabled);
85
85
  }
86
86
  }
87
87
 
@@ -105,6 +105,10 @@
105
105
  --__axc-button-border-width: 1px;
106
106
  --__axc-button-border-color: var(--ax-border-default);
107
107
 
108
+ &:not(:hover, :active) {
109
+ background-color: var(--ax-bg-input);
110
+ }
111
+
108
112
  &:hover:not(:disabled) {
109
113
  --__axc-button-border-color: var(--ax-border-accent-strong);
110
114
  }
@@ -144,7 +148,7 @@
144
148
  /* We can't re-use disabled-state for form-fields since opacity multiplies on search-button */
145
149
  .navds-search--disabled {
146
150
  .navds-search__input {
147
- opacity: 0.3;
151
+ opacity: var(--ax-opacity-disabled);
148
152
  cursor: not-allowed;
149
153
  }
150
154
  }
@@ -169,7 +169,7 @@
169
169
  }
170
170
 
171
171
  .navds-switch--disabled:not(.navds-switch--loading) {
172
- opacity: 0.3;
172
+ opacity: var(--ax-opacity-disabled);
173
173
  }
174
174
 
175
175
  .navds-switch__input:disabled,