@knime/kds-styles 10.2.0 → 11.1.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # @knime/kds-styles
2
2
 
3
+ ## 11.1.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 1cbcad8: Add the opaque `--kds-color-background-neutral-opaque-*` and `--kds-color-border-neutral-opaque-*` color tokens (`initial`, `hover`, and `active`) for clickable elements that sit on top of other content, e.g. on the canvas.
8
+
9
+ ## 11.0.0
10
+
3
11
  ## 10.2.0
4
12
 
5
13
  ### Minor Changes
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # ![Image](https://www.knime.com/sites/default/files/knime_logo_github_40x40_4layers.png) KNIME® Design Tokens
2
2
 
3
- This package contains the design tokens used across the KNIME Design System. The design tokens are stored in a standard W3C JSON format and are transformed into CSS and JavaScript variables using Style Dictionary.
3
+ This package contains the design tokens used across the KNIME Design System, together with the icons, fonts and base CSS. The design tokens are stored in a standard W3C JSON format (in `src/tokens/`) and are transformed into CSS variables and TypeScript constants using Style Dictionary.
4
4
 
5
5
  ## Design Tokens Format
6
6
 
@@ -10,7 +10,7 @@ The design tokens are stored in a standard W3C JSON format. For more information
10
10
 
11
11
  ### Style Dictionary
12
12
 
13
- [Style Dictionary][style-dictionary] is utilized to transform the token definitions into CSS and JavaScript variables. Style Dictionary allows for the definition and transformation of design tokens into various formats.
13
+ [Style Dictionary][style-dictionary] is utilized to transform the token definitions into CSS variables and TypeScript constants. Style Dictionary allows for the definition and transformation of design tokens into various formats.
14
14
 
15
15
  ### Tokens Studio Plugin
16
16
 
@@ -39,10 +39,10 @@ The design system uses the Roboto, Roboto Condensed and Roboto Mono fonts for ty
39
39
  To use the design tokens and basic CSS you can simply import the following into a central CSS of your project:
40
40
 
41
41
  - `@import "@knime/kds-styles/kds-variables.css";`: Imports all built design tokens as CSS variables, including the colors in light and dark mode
42
- - `@import "@knime/kds-styles/fonts.css"`: Import CSS font definitions for Roboto and Roboto Mono
43
- - `@import "@knime/kds-styles/fonts-workflows.css"`: Import CSS font definitions for Roboto Condensed which is only used in the context of workflow editing
42
+ - `@import "@knime/kds-styles/kds-properties.css";`: The same tokens declared as typed `@property` rules (syntax + initial value), which makes them type-checked and animatable. Optional and independent of `index.css`.
43
+ - `@import "@knime/kds-styles/fonts.css"`: Import the CSS font definitions. The file is generated from the font tokens, so it covers every family the tokens reference — Roboto, Roboto Mono, and Roboto Condensed (the latter is only used in the context of workflow editing)
44
44
 
45
- - `@import "@knime/kds-styles/index.css"`: Bundles all previous imports and adds basic core style rules, e.g. uses modern-normalize for browser reset. **Important:** Use only for new projects, or if conversion is already at a point where core styles can be replaced.
45
+ - `@import "@knime/kds-styles/index.css"`: Bundles `fonts.css`, modern-normalize (browser reset), `kds-variables.css`, and basic core style rules. **Important:** Use only for new projects, or if conversion is already at a point where core styles can be replaced.
46
46
 
47
47
  ### Enabling Dark Mode
48
48
 
@@ -60,7 +60,7 @@ An app that cannot import `index.css` yet — e.g. it still needs the `@knime/st
60
60
 
61
61
  Do so deliberately if the app is only partially migrated: legacy `--knime-*` properties are hard-coded light and ignore `light-dark()`, so those parts stay light, and `color-scheme` also switches browser chrome (scrollbars, form controls, canvas background).
62
62
 
63
- For an explicit user override, call `useKdsDarkMode()` from `@knime/kds-components`. It writes `color-scheme` inline on `<html>`, winning over the rule above. It needs a DOM, so in a server-rendered app call it from client-only code and leave the `system` default to CSS.
63
+ For an explicit user override, call `useKdsDarkModeController()` from `@knime/kds-components`. It writes `color-scheme` inline on `<html>`, winning over the rule above. It needs a DOM, so in a server-rendered app call it from client-only code and leave the `system` default to CSS.
64
64
 
65
65
  ### Design Tokens in JavaScript/TypeScript
66
66
 
@@ -81,10 +81,18 @@ font.base.display.small.css.value; // "700 20px/normal Roboto, sans-serif"
81
81
 
82
82
  The exports mirror the token JSON structure (without the `kds` root): one constant per top-level token group plus the value types (`KdsColor`, `KdsDimension`, `KdsTypography`, ...). Dimensional values are `{ value, unit }` objects, color values are always `{ light, dark }` pairs of HSL component objects (equivalent to the CSS color `hsl(<h> <s>% <l>% / <a>)`), and composite tokens (border, elevation, typography) remain structured objects. Every token additionally carries its CSS representation in `css`: the exact value from the emitted CSS custom properties (`css.value`, including `light-dark()` for colors and complete shorthands for composite tokens) and the custom property reference (`css.variable`). The internal `core` primitives are intentionally not emitted — their values are already inlined into the semantic tokens, which are the only ones consumers should use.
83
83
 
84
+ ## Icons
85
+
86
+ The SVG icons are shipped as `@knime/kds-styles/img/icons/<name>` and `@knime/kds-styles/img/type-icons/<name>` (data type icons). `@knime/kds-styles/img/icons/def` and `@knime/kds-styles/img/type-icons/def` export the lists of available names. In Vue apps, prefer `KdsIcon` and `KdsDataType` from `@knime/kds-components`.
87
+
84
88
  ## Important Scripts
85
89
 
86
90
  Here are some of the most important scripts defined in the [`package.json`](package.json):
87
91
 
92
+ - **Build**: Builds everything (tokens, icons, CSS and fonts) into `dist/`
93
+ ```
94
+ pnpm build
95
+ ```
88
96
  - **Build Design Tokens**: Builds the design tokens. The resulting files will be written in `dist/tokens/`
89
97
  ```
90
98
  pnpm build:tokens
@@ -4,8 +4,8 @@
4
4
  /*
5
5
  * Follow the device preference. The color tokens resolve via `light-dark()`,
6
6
  * so this needs no JavaScript and applies on the first paint.
7
- * `useKdsDarkMode()` overrides it with an inline style for an explicit
8
- * light/dark preference.
7
+ * `useKdsDarkModeController()` overrides it with an inline style for an
8
+ * explicit light/dark preference.
9
9
  */
10
10
  color-scheme: light dark;
11
11
  }
@@ -1262,6 +1262,24 @@ syntax: "<color>";
1262
1262
  initial-value: light-dark(hsl(0 0% 59.859% / 0.4), hsl(0, 0%, 72.5%));
1263
1263
  }
1264
1264
 
1265
+ @property --kds-color-background-neutral-opaque-initial {
1266
+ syntax: "<color>";
1267
+ inherits: true;
1268
+ initial-value: light-dark(hsl(0, 0%, 99%), hsl(0, 0%, 22%));
1269
+ }
1270
+
1271
+ @property --kds-color-background-neutral-opaque-hover {
1272
+ syntax: "<color>";
1273
+ inherits: true;
1274
+ initial-value: light-dark(hsl(0, 0%, 94.1%), hsl(0, 0%, 32.2%));
1275
+ }
1276
+
1277
+ @property --kds-color-background-neutral-opaque-active {
1278
+ syntax: "<color>";
1279
+ inherits: true;
1280
+ initial-value: light-dark(hsl(0, 0%, 90.2%), hsl(0, 0%, 43%));
1281
+ }
1282
+
1265
1283
  @property --kds-color-background-primary-initial {
1266
1284
  syntax: "<color>";
1267
1285
  inherits: true;
@@ -1730,6 +1748,24 @@ syntax: "<color>";
1730
1748
  initial-value: light-dark(hsl(0 0% 10.2% / 0.74), hsl(0 0% 99% / 0.68));
1731
1749
  }
1732
1750
 
1751
+ @property --kds-color-border-neutral-opaque-initial {
1752
+ syntax: "<color>";
1753
+ inherits: true;
1754
+ initial-value: hsl(0, 0%, 64%);
1755
+ }
1756
+
1757
+ @property --kds-color-border-neutral-opaque-hover {
1758
+ syntax: "<color>";
1759
+ inherits: true;
1760
+ initial-value: light-dark(hsl(0, 0%, 43%), hsl(0, 0%, 72.5%));
1761
+ }
1762
+
1763
+ @property --kds-color-border-neutral-opaque-active {
1764
+ syntax: "<color>";
1765
+ inherits: true;
1766
+ initial-value: light-dark(hsl(0, 0%, 32.2%), hsl(0, 0%, 90.2%));
1767
+ }
1768
+
1733
1769
  @property --kds-color-focus-outline {
1734
1770
  syntax: "<color>";
1735
1771
  inherits: true;
@@ -213,6 +213,9 @@
213
213
  --kds-color-background-neutral-bold-initial: light-dark(hsl(0 0% 72.5% / 0.4), hsl(0, 0%, 32.2%));
214
214
  --kds-color-background-neutral-bold-hover: light-dark(hsl(210 0% 62.977% / 0.4), hsl(0, 0%, 48.2%));
215
215
  --kds-color-background-neutral-bold-active: light-dark(hsl(0 0% 59.859% / 0.4), hsl(0, 0%, 72.5%));
216
+ --kds-color-background-neutral-opaque-initial: light-dark(hsl(0, 0%, 99%), hsl(0, 0%, 22%));
217
+ --kds-color-background-neutral-opaque-hover: light-dark(hsl(0, 0%, 94.1%), hsl(0, 0%, 32.2%));
218
+ --kds-color-background-neutral-opaque-active: light-dark(hsl(0, 0%, 90.2%), hsl(0, 0%, 43%));
216
219
  --kds-color-background-primary-initial: light-dark(hsl(168, 46.7%, 85.3%), hsl(169.8, 30.6%, 66.1%));
217
220
  --kds-color-background-primary-hover: light-dark(hsl(167.99 27.818% 77.703%), hsl(169.6 30.517% 68.835%));
218
221
  --kds-color-background-primary-active: light-dark(hsl(167.97 18.664% 70.242%), hsl(168.98 30.352% 78.334%));
@@ -291,6 +294,9 @@
291
294
  --kds-color-border-neutral-bold-initial: light-dark(hsl(0 0% 10.2% / 0.4), hsl(0 0% 99% / 0.4));
292
295
  --kds-color-border-neutral-bold-hover: light-dark(hsl(0 0% 10.2% / 0.64), hsl(0 0% 99% / 0.58));
293
296
  --kds-color-border-neutral-bold-active: light-dark(hsl(0 0% 10.2% / 0.74), hsl(0 0% 99% / 0.68));
297
+ --kds-color-border-neutral-opaque-initial: hsl(0, 0%, 64%);
298
+ --kds-color-border-neutral-opaque-hover: light-dark(hsl(0, 0%, 43%), hsl(0, 0%, 72.5%));
299
+ --kds-color-border-neutral-opaque-active: light-dark(hsl(0, 0%, 32.2%), hsl(0, 0%, 90.2%));
294
300
  --kds-color-focus-outline: light-dark(hsl(209.4, 57.3%, 49.6%), hsl(213.6, 91.6%, 76.7%));
295
301
  --kds-color-focus-background: light-dark(hsl(215.7 100% 91.8% / 0.4), hsl(209.4 49.5% 20.2% / 0.5));
296
302
  --kds-color-blanket-default: hsl(0 0% 11.4% / 0.8);
@@ -53,6 +53,20 @@ export type KdsColorTokens = {
53
53
  */
54
54
  readonly active: KdsColor;
55
55
  };
56
+ readonly "neutral-opaque": {
57
+ /**
58
+ * Opaque neutral background for clickable elements that sit on top of other content, e.g. on the canvas. Counterpart to the semi-transparent background.neutral.
59
+ */
60
+ readonly initial: KdsColor;
61
+ /**
62
+ * Opaque neutral background on hover for clickable elements that sit on top of other content. Counterpart to the semi-transparent background.neutral.hover.
63
+ */
64
+ readonly hover: KdsColor;
65
+ /**
66
+ * Opaque neutral background when pressed for clickable elements that sit on top of other content. Counterpart to the semi-transparent background.neutral.active.
67
+ */
68
+ readonly active: KdsColor;
69
+ };
56
70
  readonly primary: {
57
71
  /**
58
72
  * Light-teal background for primary actions or highlights.
@@ -391,6 +405,18 @@ export type KdsColorTokens = {
391
405
  * Neutral border for ResizeHandler on active. [Used as reference token only for the ResizeHandler composite tokens]
392
406
  */
393
407
  readonly "neutral-bold-active": KdsColor;
408
+ /**
409
+ * Opaque neutral border for components that sit on top of other content, e.g. on the canvas. Counterpart to the semi-transparent border.neutral.
410
+ */
411
+ readonly "neutral-opaque-initial": KdsColor;
412
+ /**
413
+ * Opaque neutral border on hover for components that sit on top of other content. Counterpart to the semi-transparent border.neutral-bold-hover.
414
+ */
415
+ readonly "neutral-opaque-hover": KdsColor;
416
+ /**
417
+ * Opaque neutral border when pressed for components that sit on top of other content. Counterpart to the semi-transparent border.neutral-bold-active.
418
+ */
419
+ readonly "neutral-opaque-active": KdsColor;
394
420
  };
395
421
  readonly focus: {
396
422
  /**
@@ -92,6 +92,32 @@ export const color = {
92
92
  },
93
93
  },
94
94
  },
95
+ "neutral-opaque": {
96
+ initial: {
97
+ light: { h: 0, s: 0, l: 99, a: 1 },
98
+ dark: { h: 0, s: 0, l: 22, a: 1 },
99
+ css: {
100
+ value: "light-dark(hsl(0, 0%, 99%), hsl(0, 0%, 22%))",
101
+ variable: "var(--kds-color-background-neutral-opaque-initial)",
102
+ },
103
+ },
104
+ hover: {
105
+ light: { h: 0, s: 0, l: 94.1, a: 1 },
106
+ dark: { h: 0, s: 0, l: 32.2, a: 1 },
107
+ css: {
108
+ value: "light-dark(hsl(0, 0%, 94.1%), hsl(0, 0%, 32.2%))",
109
+ variable: "var(--kds-color-background-neutral-opaque-hover)",
110
+ },
111
+ },
112
+ active: {
113
+ light: { h: 0, s: 0, l: 90.2, a: 1 },
114
+ dark: { h: 0, s: 0, l: 43, a: 1 },
115
+ css: {
116
+ value: "light-dark(hsl(0, 0%, 90.2%), hsl(0, 0%, 43%))",
117
+ variable: "var(--kds-color-background-neutral-opaque-active)",
118
+ },
119
+ },
120
+ },
95
121
  primary: {
96
122
  initial: {
97
123
  light: { h: 168, s: 46.7, l: 85.3, a: 1 },
@@ -742,6 +768,30 @@ export const color = {
742
768
  variable: "var(--kds-color-border-neutral-bold-active)",
743
769
  },
744
770
  },
771
+ "neutral-opaque-initial": {
772
+ light: { h: 0, s: 0, l: 64, a: 1 },
773
+ dark: { h: 0, s: 0, l: 64, a: 1 },
774
+ css: {
775
+ value: "hsl(0, 0%, 64%)",
776
+ variable: "var(--kds-color-border-neutral-opaque-initial)",
777
+ },
778
+ },
779
+ "neutral-opaque-hover": {
780
+ light: { h: 0, s: 0, l: 43, a: 1 },
781
+ dark: { h: 0, s: 0, l: 72.5, a: 1 },
782
+ css: {
783
+ value: "light-dark(hsl(0, 0%, 43%), hsl(0, 0%, 72.5%))",
784
+ variable: "var(--kds-color-border-neutral-opaque-hover)",
785
+ },
786
+ },
787
+ "neutral-opaque-active": {
788
+ light: { h: 0, s: 0, l: 32.2, a: 1 },
789
+ dark: { h: 0, s: 0, l: 90.2, a: 1 },
790
+ css: {
791
+ value: "light-dark(hsl(0, 0%, 32.2%), hsl(0, 0%, 90.2%))",
792
+ variable: "var(--kds-color-border-neutral-opaque-active)",
793
+ },
794
+ },
745
795
  },
746
796
  focus: {
747
797
  outline: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@knime/kds-styles",
3
- "version": "10.2.0",
3
+ "version": "11.1.0",
4
4
  "description": "Package containing the design tokens and icons for the KNIME Design System",
5
5
  "repository": {
6
6
  "type": "git",