@knime/kds-components 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,37 @@
1
1
  # @knime/kds-components
2
2
 
3
+ ## 11.1.0
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [1cbcad8]
8
+ - @knime/kds-styles@11.1.0
9
+
10
+ ## 11.0.0
11
+
12
+ ### Major Changes
13
+
14
+ - df12b1a: - `useKdsDarkMode`: export the `KdsDarkMode` type for what it returns.
15
+ - `useKdsDarkModeController`:
16
+ - add a composable that applies the stored preference to the page and returns `preferredMode`, `isDarkPreferred`, `isLightPreferred`, `isSystemPreferred`, a writable `isDark`, `isLight`, and `lightDark`.
17
+ - export the `KdsDarkModeController` type for what it returns.
18
+
19
+ BREAKING CHANGES:
20
+
21
+ - `useKdsDarkMode`:
22
+ - make it read-only. It returns `isDark`, `isLight`, and `lightDark`, read from the `color-scheme` of `<html>`, and changes neither the page nor the stored preference.
23
+ - stop returning `preferredMode`, `isDarkPreferred`, `isLightPreferred`, and `isSystemPreferred`. To apply, set, or read the stored preference, call `useKdsDarkModeController()` instead.
24
+
25
+ ### Minor Changes
26
+
27
+ - 880698d: `KdsFileExplorer`: Remove z-index isolation for custom drag preview, which interferes with a
28
+ consumer's own z-index stack. Also allow customizing z-index value
29
+
30
+ ### Patch Changes
31
+
32
+ - Updated dependencies
33
+ - @knime/kds-styles@11.0.0
34
+
3
35
  ## 10.2.0
4
36
 
5
37
  ### Minor Changes
package/README.md CHANGED
@@ -1,27 +1,44 @@
1
1
  # @knime/kds-components
2
2
 
3
- Vue components library for the KNIME Design System.
3
+ Vue 3 components library for the KNIME Design System.
4
+
5
+ This is part of the [KNIME Design System](../../README.md).
4
6
 
5
7
  ## Installation
6
8
 
9
+ `vue` and `@vueuse/core` are peer dependencies. `@knime/kds-styles` provides
10
+ the design tokens every component styles against; it comes along as a
11
+ dependency, but install it directly too so your app can import its CSS:
12
+
7
13
  ```bash
8
- pnpm add @knime/kds-components
14
+ pnpm add @knime/kds-components @knime/kds-styles vue @vueuse/core
9
15
  ```
10
16
 
11
17
  ## Usage
12
18
 
13
- TODO: fill once better examples are available, also explain how to set up using @knime/kds-styles
19
+ Import the CSS variables once in your app entry, then use the components:
20
+
21
+ ```ts
22
+ // main.ts — required once; components render unstyled without it
23
+ import "@knime/kds-styles/kds-variables.css";
24
+ ```
14
25
 
15
26
  ```vue
16
- <script setup>
17
- import { Icon } from "@knime/kds-components";
27
+ <script setup lang="ts">
28
+ import { KdsButton, KdsIcon } from "@knime/kds-components";
18
29
  </script>
19
30
 
20
31
  <template>
21
- <Icon name="checkmark" size="large" />
32
+ <!-- Components are configured through props; slot exposure is kept minimal
33
+ on purpose so usage stays consistent across KNIME applications. -->
34
+ <KdsButton label="Confirm" leading-icon="checkmark" variant="filled" />
35
+ <KdsIcon name="checkmark" />
22
36
  </template>
23
37
  ```
24
38
 
39
+ See the [`@knime/kds-styles` README](../styles/README.md) for the other CSS
40
+ entry points (`index.css`, `fonts.css`) and for enabling dark mode.
41
+
25
42
  ## Using with Vitest, Nuxt, or Vite SSR
26
43
 
27
44
  The published JavaScript imports its CSS as a side effect (e.g.
@@ -49,18 +66,39 @@ export default defineConfig({ ssr: { noExternal: [/@knime\//] } });
49
66
  export default defineNuxtConfig({ build: { transpile: [/@knime\//] } });
50
67
  ```
51
68
 
52
- ## Available Components
69
+ ## Available components
70
+
71
+ The component set changes frequently, so the authoritative, always-current list
72
+ is the **[live Storybook](https://master--68e8c00876b55a4f55c29090.chromatic.com/)**,
73
+ which documents every component's props, events, and slots.
74
+
75
+ Everything re-exported from [`src/index.ts`](src/index.ts) is public API, grouped as:
53
76
 
54
- - **Button**: Basic button component
55
- - **Icon**: Icon component with various KNIME icons
56
- - **DataType**: DataType component rendering a data type icon inside a box
77
+ | Group | Source | Examples |
78
+ | ------------------ | ------------------------------- | --------------------------------------------------------------------- |
79
+ | **Accessories** | `src/components/accessories` | `KdsIcon`, `KdsBadge`, `KdsAvatar`, `KdsDivider`, `KdsLoadingSpinner` |
80
+ | **Buttons** | `src/components/buttons` | `KdsButton`, `KdsMenuButton`, `KdsSplitButton`, `KdsToggleButton` |
81
+ | **Feedback** | `src/components/feedback` | `KdsEmptyState`, `KdsInlineMessage`, `KdsProgressBar` |
82
+ | **Forms** | `src/components/forms` | `KdsCheckbox`, `KdsRadioButton`, `KdsToggleSwitch`, inputs/selects |
83
+ | **Lists** | `src/components/lists` | `KdsMenu`, `KdsContextMenu`, `KdsListContainer` |
84
+ | **Rich text** | `src/components/richText` | `KdsDescription` |
85
+ | **Visualizations** | `src/components/visualizations` | `KdsDonutChart` |
86
+ | **Layouts** | `src/layouts` | cards, explorer, overlays (incl. the `vKdsTooltip` directive), panels |
87
+ | **Utilities** | `src/util` | composables, e.g. `useKdsDarkMode()`, `useKdsIsTruncated()` |
88
+
89
+ To discover components from an AI agent, use the `/frontend:kds-components`
90
+ skill rather than reading the sources.
57
91
 
58
92
  ## Development
59
93
 
60
94
  ### Building
61
95
 
96
+ Run from the monorepo root (this package's build depends on `@knime/kds-styles`
97
+ and `@knime/utils` being built first):
98
+
62
99
  ```bash
63
- pnpm build
100
+ pnpm build # all packages, in dependency order
101
+ pnpm build:components # only this package
64
102
  ```
65
103
 
66
104
  ## License
package/dist/index.css CHANGED
@@ -4459,7 +4459,7 @@ td {
4459
4459
  cursor: pointer;
4460
4460
  }
4461
4461
 
4462
- .file-explorer[data-v-8ba92819] {
4462
+ .file-explorer[data-v-d13e0460] {
4463
4463
  display: flex;
4464
4464
  flex: 1 0 0%;
4465
4465
  flex-direction: column;
@@ -4468,10 +4468,10 @@ td {
4468
4468
  /* needed so that the virtualization container can size the wrapper properly */
4469
4469
  min-height: 0;
4470
4470
  }
4471
- .file-explorer-item[data-v-8ba92819] {
4472
- height: var(--v15cae343);
4471
+ .file-explorer-item[data-v-d13e0460] {
4472
+ height: var(--v2bc72e90);
4473
4473
  }
4474
- thead[data-v-8ba92819] {
4474
+ thead[data-v-d13e0460] {
4475
4475
  /* Hide table head for better readability but keeping it for a11y reasons */
4476
4476
  position: absolute;
4477
4477
 
@@ -4482,7 +4482,7 @@ thead[data-v-8ba92819] {
4482
4482
  overflow: hidden;
4483
4483
  white-space: nowrap; /* added line */
4484
4484
  }
4485
- table[data-v-8ba92819] {
4485
+ table[data-v-d13e0460] {
4486
4486
  height: 100%;
4487
4487
  overflow: hidden auto;
4488
4488
  scrollbar-gutter: stable;
@@ -4493,19 +4493,19 @@ table[data-v-8ba92819] {
4493
4493
  }
4494
4494
  table,
4495
4495
  tbody {
4496
- &[data-v-8ba92819] {
4496
+ &[data-v-d13e0460] {
4497
4497
  width: 100%;
4498
4498
  border-spacing: 0;
4499
4499
  }
4500
- &[data-v-8ba92819]:not(:has(.empty)) {
4500
+ &[data-v-d13e0460]:not(:has(.empty)) {
4501
4501
  display: block;
4502
4502
  }
4503
4503
  }
4504
4504
  table:focus {
4505
- &[data-v-8ba92819] {
4505
+ &[data-v-d13e0460] {
4506
4506
  outline: none;
4507
4507
  }
4508
- &.keyboard-focus[data-v-8ba92819] {
4508
+ &.keyboard-focus[data-v-d13e0460] {
4509
4509
  outline: 2px solid var(--kds-color-focus-outline);
4510
4510
  border-radius: var(--kds-border-radius-container-0-25x);
4511
4511
  }
@@ -4513,13 +4513,13 @@ table:focus {
4513
4513
 
4514
4514
  /*
4515
4515
  * Empty state layout. When the folder is empty there are no virtualized rows,
4516
- * so we drop the CSS-table display and lay the message out with flexbox.
4516
+ * so we drop the CSS-table display and lay the message out with flexbox.
4517
4517
  * This keeps the message at the top with a fixed top spacing, horizontally centered,
4518
4518
  * and lets the bordered box grow to contain it. The previous solution with a `height: 100%`
4519
- * CSS table instead distributed the single short row inconsistently
4519
+ * CSS table instead distributed the single short row inconsistently
4520
4520
  * (Chrome centers it, Firefox keeps it at the top).
4521
4521
  */
4522
- table[data-v-8ba92819]:has(.empty) {
4522
+ table[data-v-d13e0460]:has(.empty) {
4523
4523
  display: flex;
4524
4524
  flex-direction: column;
4525
4525
 
@@ -4527,7 +4527,7 @@ table[data-v-8ba92819]:has(.empty) {
4527
4527
  * message when the surrounding container is only as tall as its content. */
4528
4528
  min-height: var(--kds-dimension-component-height-12-5x);
4529
4529
  }
4530
- tbody[data-v-8ba92819]:has(.empty) {
4530
+ tbody[data-v-d13e0460]:has(.empty) {
4531
4531
  display: flex;
4532
4532
  flex: 1 0 0;
4533
4533
  flex-direction: column;
@@ -4535,15 +4535,15 @@ tbody[data-v-8ba92819]:has(.empty) {
4535
4535
  min-height: max-content;
4536
4536
  padding-top: var(--kds-spacing-container-4x);
4537
4537
  }
4538
- .empty[data-v-8ba92819],
4539
- .empty td[data-v-8ba92819] {
4538
+ .empty[data-v-d13e0460],
4539
+ .empty td[data-v-d13e0460] {
4540
4540
  display: block;
4541
4541
  }
4542
- .custom-preview[data-v-8ba92819] {
4542
+ .custom-preview[data-v-d13e0460] {
4543
4543
  position: fixed;
4544
4544
  top: 0;
4545
4545
  left: 0;
4546
- z-index: 9;
4546
+ z-index: var(--kds-file-explorer-custom-drag-preview-z-index, 9);
4547
4547
  width: 70px;
4548
4548
  height: 70px;
4549
4549
  pointer-events: none;
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { a as kdsPopoverRole, c as kdsPopoverTypes, i as kdsPopoverPlacements, l as _plugin_vue_export_helper_default, o as kdsPopoverRoles, r as kdsPopoverPlacement, s as kdsPopoverType, t as KdsPopover_default, u as __exportAll$1 } from "./KdsPopover-DBU9xVEK.js";
2
2
  import { a as useKdsIsTruncated, i as elementOverflowsHorizontally, n as useIcon, r as vKdsTooltip, t as KdsIcon_default } from "./KdsIcon-XR1PupNA.js";
3
3
  import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createPropsRestProxy, createSlots, createTextVNode, createVNode, defineAsyncComponent, defineComponent, effectScope, getCurrentInstance, guardReactiveProps, h, inject, isRef, mergeModels, mergeProps, nextTick, normalizeClass, normalizeProps, normalizeStyle, onBeforeUnmount, onBeforeUpdate, onMounted, onScopeDispose, onUnmounted, openBlock, provide, readonly, ref, renderList, renderSlot, resolveComponent, resolveDynamicComponent, shallowRef, toDisplayString, toRaw, toRef, toRefs, unref, useAttrs, useCssVars, useId, useModel, useSlots, useTemplateRef, vModelText, vShow, watch, watchEffect, withCtx, withDirectives, withKeys, withModifiers } from "vue";
4
- import { onClickOutside, useElementSize, useEventListener, useLocalStorage, useMousePressed, usePreferredDark, useRafFn, useResizeObserver, useTemplateRefsList, useVirtualList } from "@vueuse/core";
4
+ import { onClickOutside, useElementSize, useEventListener, useLocalStorage, useMousePressed, useMutationObserver, usePreferredDark, useRafFn, useResizeObserver, useTemplateRefsList, useVirtualList } from "@vueuse/core";
5
5
  import './index.css';//#region src/components/accessories/Avatar/enums.ts
6
6
  var kdsAvatarSize = {
7
7
  SMALL: "small",
@@ -886,6 +886,62 @@ var color$1 = {
886
886
  }
887
887
  }
888
888
  },
889
+ "neutral-opaque": {
890
+ initial: {
891
+ light: {
892
+ h: 0,
893
+ s: 0,
894
+ l: 99,
895
+ a: 1
896
+ },
897
+ dark: {
898
+ h: 0,
899
+ s: 0,
900
+ l: 22,
901
+ a: 1
902
+ },
903
+ css: {
904
+ value: "light-dark(hsl(0, 0%, 99%), hsl(0, 0%, 22%))",
905
+ variable: "var(--kds-color-background-neutral-opaque-initial)"
906
+ }
907
+ },
908
+ hover: {
909
+ light: {
910
+ h: 0,
911
+ s: 0,
912
+ l: 94.1,
913
+ a: 1
914
+ },
915
+ dark: {
916
+ h: 0,
917
+ s: 0,
918
+ l: 32.2,
919
+ a: 1
920
+ },
921
+ css: {
922
+ value: "light-dark(hsl(0, 0%, 94.1%), hsl(0, 0%, 32.2%))",
923
+ variable: "var(--kds-color-background-neutral-opaque-hover)"
924
+ }
925
+ },
926
+ active: {
927
+ light: {
928
+ h: 0,
929
+ s: 0,
930
+ l: 90.2,
931
+ a: 1
932
+ },
933
+ dark: {
934
+ h: 0,
935
+ s: 0,
936
+ l: 43,
937
+ a: 1
938
+ },
939
+ css: {
940
+ value: "light-dark(hsl(0, 0%, 90.2%), hsl(0, 0%, 43%))",
941
+ variable: "var(--kds-color-background-neutral-opaque-active)"
942
+ }
943
+ }
944
+ },
889
945
  primary: {
890
946
  initial: {
891
947
  light: {
@@ -2313,6 +2369,60 @@ var color$1 = {
2313
2369
  value: "light-dark(hsl(0 0% 10.2% / 0.74), hsl(0 0% 99% / 0.68))",
2314
2370
  variable: "var(--kds-color-border-neutral-bold-active)"
2315
2371
  }
2372
+ },
2373
+ "neutral-opaque-initial": {
2374
+ light: {
2375
+ h: 0,
2376
+ s: 0,
2377
+ l: 64,
2378
+ a: 1
2379
+ },
2380
+ dark: {
2381
+ h: 0,
2382
+ s: 0,
2383
+ l: 64,
2384
+ a: 1
2385
+ },
2386
+ css: {
2387
+ value: "hsl(0, 0%, 64%)",
2388
+ variable: "var(--kds-color-border-neutral-opaque-initial)"
2389
+ }
2390
+ },
2391
+ "neutral-opaque-hover": {
2392
+ light: {
2393
+ h: 0,
2394
+ s: 0,
2395
+ l: 43,
2396
+ a: 1
2397
+ },
2398
+ dark: {
2399
+ h: 0,
2400
+ s: 0,
2401
+ l: 72.5,
2402
+ a: 1
2403
+ },
2404
+ css: {
2405
+ value: "light-dark(hsl(0, 0%, 43%), hsl(0, 0%, 72.5%))",
2406
+ variable: "var(--kds-color-border-neutral-opaque-hover)"
2407
+ }
2408
+ },
2409
+ "neutral-opaque-active": {
2410
+ light: {
2411
+ h: 0,
2412
+ s: 0,
2413
+ l: 32.2,
2414
+ a: 1
2415
+ },
2416
+ dark: {
2417
+ h: 0,
2418
+ s: 0,
2419
+ l: 90.2,
2420
+ a: 1
2421
+ },
2422
+ css: {
2423
+ value: "light-dark(hsl(0, 0%, 32.2%), hsl(0, 0%, 90.2%))",
2424
+ variable: "var(--kds-color-border-neutral-opaque-active)"
2425
+ }
2316
2426
  }
2317
2427
  },
2318
2428
  focus: {
@@ -33762,7 +33872,7 @@ var KdsFileExplorer_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/*
33762
33872
  "renameFile"
33763
33873
  ], ["update:activeRenamedItemId"]),
33764
33874
  setup(__props, { emit: __emit }) {
33765
- useCssVars((_ctx) => ({ "v15cae343": itemHeight.value + "px" }));
33875
+ useCssVars((_ctx) => ({ "v2bc72e90": itemHeight.value + "px" }));
33766
33876
  const props = __props;
33767
33877
  /** The id of the item currently being renamed. */
33768
33878
  const activeRenamedItemId = useModel(__props, "activeRenamedItemId");
@@ -33986,15 +34096,15 @@ var KdsFileExplorer_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/*
33986
34096
  const slots = useSlots();
33987
34097
  const dynamicColumnSlotNames = computed(() => Object.keys(slots).filter((key) => key.startsWith("dynamicColumn")));
33988
34098
  return (_ctx, _cache) => {
33989
- return openBlock(), createElementBlock("div", _hoisted_1$15, [createElementVNode("table", mergeProps({
33990
- tabindex: "0",
33991
- class: ["scroll-container", { "keyboard-focus": unref(keyPressedUntilMouseClick) }],
33992
- "aria-label": "list of files in the current folder"
33993
- }, unref(containerProps), {
33994
- onFocus: handleFocusOnTable,
33995
- onKeydown: _cache[11] || (_cache[11] = (...args) => unref(handleKeyboardNavigation) && unref(handleKeyboardNavigation)(...args))
33996
- }), [
33997
- createElementVNode("tbody", null, [!__props.isRootFolder ? (openBlock(), createBlock(FileExplorerItemBack_default, {
34099
+ return openBlock(), createElementBlock("div", _hoisted_1$15, [
34100
+ createElementVNode("table", mergeProps({
34101
+ tabindex: "0",
34102
+ class: ["scroll-container", { "keyboard-focus": unref(keyPressedUntilMouseClick) }],
34103
+ "aria-label": "list of files in the current folder"
34104
+ }, unref(containerProps), {
34105
+ onFocus: handleFocusOnTable,
34106
+ onKeydown: _cache[11] || (_cache[11] = (...args) => unref(handleKeyboardNavigation) && unref(handleKeyboardNavigation)(...args))
34107
+ }), [createElementVNode("tbody", null, [!__props.isRootFolder ? (openBlock(), createBlock(FileExplorerItemBack_default, {
33998
34108
  key: 0,
33999
34109
  ref_key: "itemBack",
34000
34110
  ref: itemBack,
@@ -34011,8 +34121,7 @@ var KdsFileExplorer_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/*
34011
34121
  "class",
34012
34122
  "is-dragging",
34013
34123
  "onDragover"
34014
- ])) : createCommentVNode("", true)]),
34015
- createElementVNode("tbody", normalizeProps(guardReactiveProps(unref(wrapperProps))), [(openBlock(true), createElementBlock(Fragment, null, renderList(unref(list), ({ data: item, index }) => {
34124
+ ])) : createCommentVNode("", true)]), createElementVNode("tbody", normalizeProps(guardReactiveProps(unref(wrapperProps))), [(openBlock(true), createElementBlock(Fragment, null, renderList(unref(list), ({ data: item, index }) => {
34016
34125
  return openBlock(), createBlock(FileExplorerItem_default, {
34017
34126
  key: item.id,
34018
34127
  ref_for: true,
@@ -34092,7 +34201,7 @@ var KdsFileExplorer_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/*
34092
34201
  "onDrop",
34093
34202
  "onDblclick"
34094
34203
  ]);
34095
- }), 128)), __props.items.length === 0 ? (openBlock(), createElementBlock("tr", _hoisted_2$11, [createElementVNode("td", null, [createVNode(KdsEmptyState_default, mergeProps({ headline: __props.emptyState?.headline ?? "Folder is empty" }, __props.emptyState), null, 16, ["headline"])])])) : createCommentVNode("", true)], 16),
34204
+ }), 128)), __props.items.length === 0 ? (openBlock(), createElementBlock("tr", _hoisted_2$11, [createElementVNode("td", null, [createVNode(KdsEmptyState_default, mergeProps({ headline: __props.emptyState?.headline ?? "Folder is empty" }, __props.emptyState), null, 16, ["headline"])])])) : createCommentVNode("", true)], 16)], 16),
34096
34205
  __props.draggingAnimationMode !== "disabled" ? (openBlock(), createElementBlock("div", {
34097
34206
  key: 0,
34098
34207
  ref_key: "customPreviewContainer",
@@ -34101,32 +34210,33 @@ var KdsFileExplorer_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/*
34101
34210
  }, [renderSlot(_ctx.$slots, "customDragPreview", {}, () => [createElementVNode("div", {
34102
34211
  ref_key: "customDragPreviewPlaceholder",
34103
34212
  ref: customDragPreviewPlaceholder
34104
- }, null, 512)], true)], 512)) : createCommentVNode("", true)
34105
- ], 16), createVNode(KdsPopover_default, {
34106
- ref_key: "popover",
34107
- ref: popover,
34108
- "popover-type": "manual",
34109
- "model-value": Boolean(contextMenuAnchor.value && contextMenuItems.value.length > 0),
34110
- placement: "bottom-left",
34111
- "aria-label": "Menu",
34112
- onKeydown: _cache[14] || (_cache[14] = withKeys(withModifiers(($event) => closeContextMenu(), ["stop", "prevent"]), ["esc"])),
34113
- onFocusout: _cache[15] || (_cache[15] = ($event) => closeContextMenu())
34114
- }, {
34115
- default: withCtx(() => [createVNode(unref(KdsMenuContainer_default), {
34116
- id: "file-explorer-options-menu",
34117
- ref_key: "contextMenu",
34118
- ref: contextMenu,
34119
- ariaLabel: "File explorer context",
34120
- items: contextMenuItems.value,
34121
- "menu-max-height": __props.maxContextMenuHeight,
34122
- onItemClick: _cache[12] || (_cache[12] = ($event) => closeContextMenu()),
34123
- onContextmenu: _cache[13] || (_cache[13] = withModifiers(() => {}, ["prevent", "stop"]))
34124
- }, null, 8, ["items", "menu-max-height"])]),
34125
- _: 1
34126
- }, 8, ["model-value"])]);
34213
+ }, null, 512)], true)], 512)) : createCommentVNode("", true),
34214
+ createVNode(KdsPopover_default, {
34215
+ ref_key: "popover",
34216
+ ref: popover,
34217
+ "popover-type": "manual",
34218
+ "model-value": Boolean(contextMenuAnchor.value && contextMenuItems.value.length > 0),
34219
+ placement: "bottom-left",
34220
+ "aria-label": "Menu",
34221
+ onKeydown: _cache[14] || (_cache[14] = withKeys(withModifiers(($event) => closeContextMenu(), ["stop", "prevent"]), ["esc"])),
34222
+ onFocusout: _cache[15] || (_cache[15] = ($event) => closeContextMenu())
34223
+ }, {
34224
+ default: withCtx(() => [createVNode(unref(KdsMenuContainer_default), {
34225
+ id: "file-explorer-options-menu",
34226
+ ref_key: "contextMenu",
34227
+ ref: contextMenu,
34228
+ ariaLabel: "File explorer context",
34229
+ items: contextMenuItems.value,
34230
+ "menu-max-height": __props.maxContextMenuHeight,
34231
+ onItemClick: _cache[12] || (_cache[12] = ($event) => closeContextMenu()),
34232
+ onContextmenu: _cache[13] || (_cache[13] = withModifiers(() => {}, ["prevent", "stop"]))
34233
+ }, null, 8, ["items", "menu-max-height"])]),
34234
+ _: 1
34235
+ }, 8, ["model-value"])
34236
+ ]);
34127
34237
  };
34128
34238
  }
34129
- }), [["__scopeId", "data-v-8ba92819"]]);
34239
+ }), [["__scopeId", "data-v-d13e0460"]]);
34130
34240
  //#endregion
34131
34241
  //#region src/layouts/explorer/FileExplorer/enums.ts
34132
34242
  var kdsFileExplorerSize = {
@@ -36486,8 +36596,8 @@ var KDS_DARK_MODE_STORAGE_KEY = "KNIME_DARK_MODE";
36486
36596
  /**
36487
36597
  * Key an earlier implementation used to persist the *derived* light/dark state
36488
36598
  * alongside the preference. Nothing reads or writes it any more — see
36489
- * {@link createKdsDarkMode} — so it is cleared once to stop a stale value from
36490
- * lingering in browsers that ran that version.
36599
+ * {@link createKdsDarkModeController} — so it is cleared once to stop a stale
36600
+ * value from lingering in browsers that ran that version.
36491
36601
  */
36492
36602
  var OBSOLETE_EFFECTIVE_STORAGE_KEY = `${KDS_DARK_MODE_STORAGE_KEY}_EFFECTIVE`;
36493
36603
  var defaultMode = kdsDarkModeType.SYSTEM;
@@ -36515,8 +36625,44 @@ var clearObsoleteEffectiveMode = () => {
36515
36625
  } catch {}
36516
36626
  };
36517
36627
  /**
36628
+ * Reads the `color-scheme` of `<html>`, which the `light-dark()` color tokens
36629
+ * resolve against, so it reports what the page renders, whoever themes it: the
36630
+ * app's CSS, `useKdsDarkModeController()` or an embedder.
36631
+ */
36632
+ var createReadOnlyKdsDarkMode = () => {
36633
+ const documentElement = globalThis.document?.documentElement;
36634
+ const readColorScheme = () => documentElement ? getComputedStyle(documentElement).colorScheme : "normal";
36635
+ const colorScheme = ref(readColorScheme());
36636
+ const update = () => {
36637
+ colorScheme.value = readColorScheme();
36638
+ };
36639
+ useMutationObserver(documentElement, update, { attributeFilter: [
36640
+ "style",
36641
+ "class",
36642
+ "data-theme"
36643
+ ] });
36644
+ const systemPrefersDark = usePreferredDark();
36645
+ watch(systemPrefersDark, update);
36646
+ const isDark = computed(() => {
36647
+ const schemes = colorScheme.value.split(" ");
36648
+ return schemes.includes("dark") && (!schemes.includes("light") || systemPrefersDark.value);
36649
+ });
36650
+ const isLight = computed(() => !isDark.value);
36651
+ const lightDark = (color) => isDark.value ? color.dark : color.light;
36652
+ return {
36653
+ /** Whether the page renders dark right now. */
36654
+ isDark,
36655
+ /** Whether the page renders light right now. */
36656
+ isLight,
36657
+ /**
36658
+ * Helper function that turns a KdsColor into the correct KdsColorValue (light or dark)
36659
+ */
36660
+ lightDark
36661
+ };
36662
+ };
36663
+ /**
36518
36664
  * The user preference is the *only* persisted state; the effective light/dark
36519
- * value is derived from it and the OS preference on read.
36665
+ * value is read from the page, which the preference is applied to.
36520
36666
  *
36521
36667
  * Persisting the derived value as well (as an earlier implementation did) gave
36522
36668
  * the same fact two storage keys that could disagree. Every instance wrote the
@@ -36528,18 +36674,15 @@ var clearObsoleteEffectiveMode = () => {
36528
36674
  * feedback edge entirely: nothing writes unless the user changes the
36529
36675
  * preference.
36530
36676
  */
36531
- var createKdsDarkMode = () => {
36677
+ var createKdsDarkModeController = (page) => {
36532
36678
  const userPreference = useLocalStorage(KDS_DARK_MODE_STORAGE_KEY, defaultMode);
36533
- const systemPrefersDark = usePreferredDark();
36679
+ watch(userPreference, applyToDocument, { immediate: true });
36534
36680
  const isDark = computed({
36535
- get() {
36536
- return userPreference.value === kdsDarkModeType.SYSTEM ? systemPrefersDark.value : userPreference.value === kdsDarkModeType.DARK;
36537
- },
36681
+ get: () => page.isDark.value,
36538
36682
  set(value) {
36539
36683
  userPreference.value = value ? kdsDarkModeType.DARK : kdsDarkModeType.LIGHT;
36540
36684
  }
36541
36685
  });
36542
- watch(userPreference, applyToDocument, { immediate: true });
36543
36686
  const preferredMode = computed({
36544
36687
  get() {
36545
36688
  return userPreference.value;
@@ -36551,9 +36694,8 @@ var createKdsDarkMode = () => {
36551
36694
  const isDarkPreferred = computed(() => userPreference.value === kdsDarkModeType.DARK);
36552
36695
  const isLightPreferred = computed(() => userPreference.value === kdsDarkModeType.LIGHT);
36553
36696
  const isSystemPreferred = computed(() => userPreference.value === kdsDarkModeType.SYSTEM);
36554
- const isLight = computed(() => !isDark.value);
36555
- const lightDark = (color) => isDark.value ? color.dark : color.light;
36556
36697
  return {
36698
+ ...page,
36557
36699
  /**
36558
36700
  * The current user *preference* (`'light' | 'dark' | 'system'`) as a
36559
36701
  * writable computed — use it to read the preference or set it, e.g. via a
@@ -36567,34 +36709,36 @@ var createKdsDarkMode = () => {
36567
36709
  /** Whether the user *preference* is set to 'system'. */
36568
36710
  isSystemPreferred,
36569
36711
  /**
36570
- * Whether dark styling is effectively active right now. Unlike
36571
- * `isDarkPreferred` this resolves 'system' against the OS preference, so it
36572
- * reflects what is actually rendered. Use it for JS/canvas theming (e.g.
36573
- * charts) that cannot rely on CSS `light-dark()`. Writable: setting it
36574
- * stores an explicit `'light'`/`'dark'` preference.
36575
- */
36576
- isDark,
36577
- /**
36578
- * Whether light styling is effectively active right now (the complement of
36579
- * `isDark`). Like `isDark`, this resolves 'system' against the OS
36580
- * preference, unlike the preference-only `isLightPreferred`.
36581
- */
36582
- isLight,
36583
- /**
36584
- * Helper function that turns a KdsColor into the correct KdsColorValue (light or dark)
36712
+ * Whether the page renders dark right now. Writable: setting it stores an
36713
+ * explicit `'light'`/`'dark'` preference.
36585
36714
  */
36586
- lightDark
36715
+ isDark
36587
36716
  };
36588
36717
  };
36718
+ var sharedReadOnly;
36589
36719
  var shared;
36720
+ /**
36721
+ * Reports whether the page renders dark and changes nothing, so the app or
36722
+ * embedder that themes the page stays in charge. Use it in components that
36723
+ * theme something CSS cannot reach, such as a Monaco editor or a chart.
36724
+ */
36590
36725
  var useKdsDarkMode = () => {
36726
+ sharedReadOnly ??= effectScope(true).run(createReadOnlyKdsDarkMode);
36727
+ return sharedReadOnly;
36728
+ };
36729
+ /**
36730
+ * Applies the stored preference to the page and exposes it, e.g. for a mode
36731
+ * picker. Only the app that lets KDS own its theme calls it.
36732
+ */
36733
+ var useKdsDarkModeController = () => {
36591
36734
  if (!shared) {
36592
36735
  clearObsoleteEffectiveMode();
36593
- shared = effectScope(true).run(createKdsDarkMode);
36736
+ const page = useKdsDarkMode();
36737
+ shared = effectScope(true).run(() => createKdsDarkModeController(page));
36594
36738
  }
36595
36739
  return shared;
36596
36740
  };
36597
36741
  //#endregion
36598
- export { KdsAccordion_default as KdsAccordion, KdsAvatar_default as KdsAvatar, KdsAvatarCounter_default as KdsAvatarCounter, KdsBadge_default as KdsBadge, KdsBanner_default as KdsBanner, KdsBreadcrumb_default as KdsBreadcrumb, KdsButton_default as KdsButton, KdsCard_default as KdsCard, KdsCheckbox_default as KdsCheckbox, KdsCheckboxGroup_default as KdsCheckboxGroup, KdsClickableCard_default as KdsClickableCard, KdsColorInput_default as KdsColorInput, KdsColorSwatch_default as KdsColorSwatch, KdsContextMenu_default as KdsContextMenu, KdsDataType_default as KdsDataType, KdsDateInput_default as KdsDateInput, KdsDateTimeFormatInput_default as KdsDateTimeFormatInput, KdsDateTimeInput_default as KdsDateTimeInput, KdsDescription_default as KdsDescription, KdsDivider_default as KdsDivider, KdsDonutChart_default as KdsDonutChart, KdsDropdown_default as KdsDropdown, KdsDynamicModalProvider_default as KdsDynamicModalProvider, KdsEmptyState_default as KdsEmptyState, KdsFileExplorer_default as KdsFileExplorer, KdsFileSelector_default as KdsFileSelector, KdsIcon_default as KdsIcon, KdsInfoToggleButton_default as KdsInfoToggleButton, KdsInlineMessage_default as KdsInlineMessage, KdsIntervalInput_default as KdsIntervalInput, KdsKeyboardShortcut_default as KdsKeyboardShortcut, KdsLabel_default as KdsLabel, KdsLimitBar_default as KdsLimitBar, KdsLink_default as KdsLink, KdsLinkButton_default as KdsLinkButton, KdsLinkCard_default as KdsLinkCard, KdsListContainer_default as KdsListContainer, KdsLiveStatus_default as KdsLiveStatus, KdsLoadingSkeleton_default as KdsLoadingSkeleton, KdsLoadingSpinner_default as KdsLoadingSpinner, KdsMenu_default as KdsMenu, KdsMenuButton_default as KdsMenuButton, KdsMissingValueIcon_default as KdsMissingValueIcon, KdsModal_default as KdsModal, KdsModalLayout_default as KdsModalLayout, KdsMultiSelectButton_default as KdsMultiSelectButton, KdsMultiSelectDropdown_default as KdsMultiSelectDropdown, KdsNavItem_default as KdsNavItem, KdsNavigation_default as KdsNavigation, KdsNumberInput_default as KdsNumberInput, KdsPagination_default as KdsPagination, KdsPanel_default as KdsPanel, KdsPasswordInput_default as KdsPasswordInput, KdsPatternInput_default as KdsPatternInput, KdsPopover_default as KdsPopover, KdsPortIcon_default as KdsPortIcon, KdsPreviewList_default as KdsPreviewList, KdsProgressBar_default as KdsProgressBar, KdsProgressButton_default as KdsProgressButton, KdsRadioButton_default as KdsRadioButton, KdsRadioButtonGroup_default as KdsRadioButtonGroup, KdsResponsiveButtonGroup_default as KdsResponsiveButtonGroup, KdsSearchInput_default as KdsSearchInput, KdsSelectButton_default as KdsSelectButton, KdsSelectableCard_default as KdsSelectableCard, KdsSideDrawer_default as KdsSideDrawer, KdsSortableListBox_default as KdsSortableListBox, KdsSplitButton_default as KdsSplitButton, KdsSplitPanel_default as KdsSplitPanel, KdsSubText_default as KdsSubText, KdsTabBar_default as KdsTabBar, KdsTabPanel_default as KdsTabPanel, KdsTextHighlight_default as KdsTextHighlight, KdsTextInput_default as KdsTextInput, KdsTextarea_default as KdsTextarea, KdsTimeInput_default as KdsTimeInput, KdsToggleButton_default as KdsToggleButton, KdsToggleSwitch_default as KdsToggleSwitch, KdsTree_default as KdsTree, KdsTwinList_default as KdsTwinList, KdsUsernameInput_default as KdsUsernameInput, KdsValueSwitch_default as KdsValueSwitch, KdsVariableToggleButton_default as KdsVariableToggleButton, KdsZonedDateTimeInput_default as KdsZonedDateTimeInput, PORT_SIZE, kdsAccessorySize, kdsAccessorySizes, kdsAccessoryType, kdsAccessoryTypes, kdsActionButtonType, kdsActionButtonTypes, kdsAvatarSize, kdsAvatarSizes, kdsBadgeSize, kdsBadgeSizes, kdsBadgeVariant, kdsBadgeVariants, kdsFeedbackVariant as kdsBannerVariant, kdsFeedbackVariant as kdsInlineMessageVariant, kdsFeedbackVariants as kdsBannerVariants, kdsFeedbackVariants as kdsInlineMessageVariants, kdsButtonSize, kdsButtonSizes, kdsButtonVariant, kdsButtonVariants, kdsCardBodyVariant, kdsCardBodyVariants, kdsCardVariant, kdsCardVariants, kdsCheckboxGroupAlignment, kdsCheckboxGroupAlignments, kdsCheckboxValue, kdsCheckboxValues, kdsColorSwatchSize, kdsColorSwatchSizes, kdsColorSwatchType, kdsColorSwatchTypes, kdsDarkModeType, kdsDarkModeTypes, kdsDataTypeSize, kdsDataTypeSizes, kdsDateFormatCategories, kdsDateFormatCategory, kdsFileExplorerDraggingAnimationMode, kdsFileExplorerDraggingAnimationModes, kdsFileExplorerSize, kdsFileExplorerSizes, kdsIconName, iconNames as kdsIconNames, kdsIconSize, kdsIconSizes, kdsIntervalDirectionalities, kdsIntervalDirectionality, kdsIntervalInputFormat, kdsIntervalInputFormats, kdsKeyboardShortcutSize, kdsKeyboardShortcutSizes, kdsLimitBarThresholdVariant, kdsLimitBarThresholdVariants, kdsLinkSize, kdsLinkSizes, kdsLiveStatusSize, kdsLiveStatusSizes, kdsLiveStatusStatus, kdsLiveStatusStatuses, kdsLoadingSkeletonVariant, kdsLoadingSkeletonVariants, kdsLoadingSpinnerVariant, kdsLoadingSpinnerVariants, kdsModalClosedBy, kdsModalClosedByOptions, kdsModalHeight, kdsModalHeightSizes, kdsModalVariant, kdsModalVariants, kdsModalWidth, kdsModalWidthSizes, kdsPanelBodyOverflow, kdsPanelBodyOverflows, kdsPanelBodyVariant, kdsPanelBodyVariants, kdsPasswordInputAutocomplete, kdsPasswordInputAutocompletes, kdsPasswordInputVariant, kdsPasswordInputVariants, kdsPopoverPlacement, kdsPopoverPlacements, kdsPopoverRole, kdsPopoverRoles, kdsPopoverType, kdsPopoverTypes, kdsPortType, kdsPortTypes, kdsProgressBarSize, kdsProgressBarSizes, kdsProgressButtonState, kdsProgressButtonStates, kdsRadioButtonGroupAlignment, kdsRadioButtonGroupAlignments, kdsResponsiveButtonGroupAlignment, kdsResponsiveButtonGroupAlignments, kdsSplitPanelDirection, kdsSplitPanelDirections, kdsTabBarSize, kdsTabBarSizes, kdsTemporalType, kdsTemporalTypes, kdsTimeInputGranularities, kdsTimeInputGranularity, kdsToggleButtonVariant, kdsToggleButtonVariants, kdsToggleSwitchLabelPosition, kdsToggleSwitchLabelPositions, kdsToggleSwitchSize, kdsToggleSwitchSizes, kdsTwinListSearchMode, kdsTwinListSearchModes, kdsTypeIconName, typeIconNames as kdsTypeIconNames, kdsUsernameInputAutocomplete, kdsUsernameInputAutocompletes, kdsValueSwitchSize, kdsValueSwitchSizes, kdsValueSwitchVariant, kdsValueSwitchVariants, useKdsDarkMode, useKdsDynamicModal, useKdsIsTruncated, useKdsMultiSelection, useKdsNameValidator, vKdsTooltip };
36742
+ export { KdsAccordion_default as KdsAccordion, KdsAvatar_default as KdsAvatar, KdsAvatarCounter_default as KdsAvatarCounter, KdsBadge_default as KdsBadge, KdsBanner_default as KdsBanner, KdsBreadcrumb_default as KdsBreadcrumb, KdsButton_default as KdsButton, KdsCard_default as KdsCard, KdsCheckbox_default as KdsCheckbox, KdsCheckboxGroup_default as KdsCheckboxGroup, KdsClickableCard_default as KdsClickableCard, KdsColorInput_default as KdsColorInput, KdsColorSwatch_default as KdsColorSwatch, KdsContextMenu_default as KdsContextMenu, KdsDataType_default as KdsDataType, KdsDateInput_default as KdsDateInput, KdsDateTimeFormatInput_default as KdsDateTimeFormatInput, KdsDateTimeInput_default as KdsDateTimeInput, KdsDescription_default as KdsDescription, KdsDivider_default as KdsDivider, KdsDonutChart_default as KdsDonutChart, KdsDropdown_default as KdsDropdown, KdsDynamicModalProvider_default as KdsDynamicModalProvider, KdsEmptyState_default as KdsEmptyState, KdsFileExplorer_default as KdsFileExplorer, KdsFileSelector_default as KdsFileSelector, KdsIcon_default as KdsIcon, KdsInfoToggleButton_default as KdsInfoToggleButton, KdsInlineMessage_default as KdsInlineMessage, KdsIntervalInput_default as KdsIntervalInput, KdsKeyboardShortcut_default as KdsKeyboardShortcut, KdsLabel_default as KdsLabel, KdsLimitBar_default as KdsLimitBar, KdsLink_default as KdsLink, KdsLinkButton_default as KdsLinkButton, KdsLinkCard_default as KdsLinkCard, KdsListContainer_default as KdsListContainer, KdsLiveStatus_default as KdsLiveStatus, KdsLoadingSkeleton_default as KdsLoadingSkeleton, KdsLoadingSpinner_default as KdsLoadingSpinner, KdsMenu_default as KdsMenu, KdsMenuButton_default as KdsMenuButton, KdsMissingValueIcon_default as KdsMissingValueIcon, KdsModal_default as KdsModal, KdsModalLayout_default as KdsModalLayout, KdsMultiSelectButton_default as KdsMultiSelectButton, KdsMultiSelectDropdown_default as KdsMultiSelectDropdown, KdsNavItem_default as KdsNavItem, KdsNavigation_default as KdsNavigation, KdsNumberInput_default as KdsNumberInput, KdsPagination_default as KdsPagination, KdsPanel_default as KdsPanel, KdsPasswordInput_default as KdsPasswordInput, KdsPatternInput_default as KdsPatternInput, KdsPopover_default as KdsPopover, KdsPortIcon_default as KdsPortIcon, KdsPreviewList_default as KdsPreviewList, KdsProgressBar_default as KdsProgressBar, KdsProgressButton_default as KdsProgressButton, KdsRadioButton_default as KdsRadioButton, KdsRadioButtonGroup_default as KdsRadioButtonGroup, KdsResponsiveButtonGroup_default as KdsResponsiveButtonGroup, KdsSearchInput_default as KdsSearchInput, KdsSelectButton_default as KdsSelectButton, KdsSelectableCard_default as KdsSelectableCard, KdsSideDrawer_default as KdsSideDrawer, KdsSortableListBox_default as KdsSortableListBox, KdsSplitButton_default as KdsSplitButton, KdsSplitPanel_default as KdsSplitPanel, KdsSubText_default as KdsSubText, KdsTabBar_default as KdsTabBar, KdsTabPanel_default as KdsTabPanel, KdsTextHighlight_default as KdsTextHighlight, KdsTextInput_default as KdsTextInput, KdsTextarea_default as KdsTextarea, KdsTimeInput_default as KdsTimeInput, KdsToggleButton_default as KdsToggleButton, KdsToggleSwitch_default as KdsToggleSwitch, KdsTree_default as KdsTree, KdsTwinList_default as KdsTwinList, KdsUsernameInput_default as KdsUsernameInput, KdsValueSwitch_default as KdsValueSwitch, KdsVariableToggleButton_default as KdsVariableToggleButton, KdsZonedDateTimeInput_default as KdsZonedDateTimeInput, PORT_SIZE, kdsAccessorySize, kdsAccessorySizes, kdsAccessoryType, kdsAccessoryTypes, kdsActionButtonType, kdsActionButtonTypes, kdsAvatarSize, kdsAvatarSizes, kdsBadgeSize, kdsBadgeSizes, kdsBadgeVariant, kdsBadgeVariants, kdsFeedbackVariant as kdsBannerVariant, kdsFeedbackVariant as kdsInlineMessageVariant, kdsFeedbackVariants as kdsBannerVariants, kdsFeedbackVariants as kdsInlineMessageVariants, kdsButtonSize, kdsButtonSizes, kdsButtonVariant, kdsButtonVariants, kdsCardBodyVariant, kdsCardBodyVariants, kdsCardVariant, kdsCardVariants, kdsCheckboxGroupAlignment, kdsCheckboxGroupAlignments, kdsCheckboxValue, kdsCheckboxValues, kdsColorSwatchSize, kdsColorSwatchSizes, kdsColorSwatchType, kdsColorSwatchTypes, kdsDarkModeType, kdsDarkModeTypes, kdsDataTypeSize, kdsDataTypeSizes, kdsDateFormatCategories, kdsDateFormatCategory, kdsFileExplorerDraggingAnimationMode, kdsFileExplorerDraggingAnimationModes, kdsFileExplorerSize, kdsFileExplorerSizes, kdsIconName, iconNames as kdsIconNames, kdsIconSize, kdsIconSizes, kdsIntervalDirectionalities, kdsIntervalDirectionality, kdsIntervalInputFormat, kdsIntervalInputFormats, kdsKeyboardShortcutSize, kdsKeyboardShortcutSizes, kdsLimitBarThresholdVariant, kdsLimitBarThresholdVariants, kdsLinkSize, kdsLinkSizes, kdsLiveStatusSize, kdsLiveStatusSizes, kdsLiveStatusStatus, kdsLiveStatusStatuses, kdsLoadingSkeletonVariant, kdsLoadingSkeletonVariants, kdsLoadingSpinnerVariant, kdsLoadingSpinnerVariants, kdsModalClosedBy, kdsModalClosedByOptions, kdsModalHeight, kdsModalHeightSizes, kdsModalVariant, kdsModalVariants, kdsModalWidth, kdsModalWidthSizes, kdsPanelBodyOverflow, kdsPanelBodyOverflows, kdsPanelBodyVariant, kdsPanelBodyVariants, kdsPasswordInputAutocomplete, kdsPasswordInputAutocompletes, kdsPasswordInputVariant, kdsPasswordInputVariants, kdsPopoverPlacement, kdsPopoverPlacements, kdsPopoverRole, kdsPopoverRoles, kdsPopoverType, kdsPopoverTypes, kdsPortType, kdsPortTypes, kdsProgressBarSize, kdsProgressBarSizes, kdsProgressButtonState, kdsProgressButtonStates, kdsRadioButtonGroupAlignment, kdsRadioButtonGroupAlignments, kdsResponsiveButtonGroupAlignment, kdsResponsiveButtonGroupAlignments, kdsSplitPanelDirection, kdsSplitPanelDirections, kdsTabBarSize, kdsTabBarSizes, kdsTemporalType, kdsTemporalTypes, kdsTimeInputGranularities, kdsTimeInputGranularity, kdsToggleButtonVariant, kdsToggleButtonVariants, kdsToggleSwitchLabelPosition, kdsToggleSwitchLabelPositions, kdsToggleSwitchSize, kdsToggleSwitchSizes, kdsTwinListSearchMode, kdsTwinListSearchModes, kdsTypeIconName, typeIconNames as kdsTypeIconNames, kdsUsernameInputAutocomplete, kdsUsernameInputAutocompletes, kdsValueSwitchSize, kdsValueSwitchSizes, kdsValueSwitchVariant, kdsValueSwitchVariants, useKdsDarkMode, useKdsDarkModeController, useKdsDynamicModal, useKdsIsTruncated, useKdsMultiSelection, useKdsNameValidator, vKdsTooltip };
36599
36743
 
36600
36744
  //# sourceMappingURL=index.js.map