@iris-ui-kit/vue 0.2.20 → 0.2.21
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/dist/admin.cjs +23 -2
- package/dist/admin.cjs.map +1 -1
- package/dist/admin.js +3 -3
- package/dist/{chunk-I6D5VXQK.js → chunk-3V46HGRC.js} +4 -3
- package/dist/chunk-3V46HGRC.js.map +1 -0
- package/dist/{chunk-MMQKSFME.js → chunk-4WQOZ2OV.js} +6 -4
- package/dist/chunk-4WQOZ2OV.js.map +1 -0
- package/dist/{chunk-QLUIKEMJ.js → chunk-ENKE2BPC.js} +3 -3
- package/dist/{chunk-QLUIKEMJ.js.map → chunk-ENKE2BPC.js.map} +1 -1
- package/dist/{chunk-W2JVHGFR.js → chunk-MO7AAXA6.js} +33 -13
- package/dist/chunk-MO7AAXA6.js.map +1 -0
- package/dist/{chunk-H7HVVPYR.js → chunk-UPC4GN3F.js} +8 -2
- package/dist/chunk-UPC4GN3F.js.map +1 -0
- package/dist/{chunk-72PZMU6R.js → chunk-ZTPIXL7Q.js} +21 -3
- package/dist/chunk-ZTPIXL7Q.js.map +1 -0
- package/dist/index.cjs +81 -13
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +31 -10
- package/dist/index.js.map +1 -1
- package/dist/layouts.cjs +2 -1
- package/dist/layouts.cjs.map +1 -1
- package/dist/layouts.js +1 -1
- package/dist/provider.cjs +53 -9
- package/dist/provider.cjs.map +1 -1
- package/dist/provider.js +3 -3
- package/dist/skeletons.cjs +2 -1
- package/dist/skeletons.cjs.map +1 -1
- package/dist/skeletons.js +2 -2
- package/dist/skins.cjs +6 -0
- package/dist/skins.cjs.map +1 -1
- package/dist/skins.js +1 -1
- package/dist/theme.cjs +19 -1
- package/dist/theme.cjs.map +1 -1
- package/dist/theme.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-72PZMU6R.js.map +0 -1
- package/dist/chunk-H7HVVPYR.js.map +0 -1
- package/dist/chunk-I6D5VXQK.js.map +0 -1
- package/dist/chunk-MMQKSFME.js.map +0 -1
- package/dist/chunk-W2JVHGFR.js.map +0 -1
|
@@ -27,7 +27,7 @@ var ThemeProvider = defineComponent({
|
|
|
27
27
|
},
|
|
28
28
|
setup(props, { slots }) {
|
|
29
29
|
const current = ref(props.store.store.getState());
|
|
30
|
-
|
|
30
|
+
let unsubscribe = props.store.store.subscribe((next) => {
|
|
31
31
|
current.value = next;
|
|
32
32
|
});
|
|
33
33
|
let applied = null;
|
|
@@ -49,6 +49,24 @@ var ThemeProvider = defineComponent({
|
|
|
49
49
|
watch(current, () => {
|
|
50
50
|
if (applied) applyCurrent();
|
|
51
51
|
});
|
|
52
|
+
watch(
|
|
53
|
+
() => props.store,
|
|
54
|
+
(nextStore) => {
|
|
55
|
+
unsubscribe();
|
|
56
|
+
unsubscribe = nextStore.store.subscribe((next) => {
|
|
57
|
+
current.value = next;
|
|
58
|
+
});
|
|
59
|
+
current.value = nextStore.store.getState();
|
|
60
|
+
if (applied) applyCurrent();
|
|
61
|
+
}
|
|
62
|
+
);
|
|
63
|
+
watch(
|
|
64
|
+
() => props.target,
|
|
65
|
+
() => {
|
|
66
|
+
if (applied) applyCurrent();
|
|
67
|
+
if (dirApplied) applyDir();
|
|
68
|
+
}
|
|
69
|
+
);
|
|
52
70
|
watch(
|
|
53
71
|
() => props.dir,
|
|
54
72
|
() => {
|
|
@@ -95,5 +113,5 @@ function useColorScheme() {
|
|
|
95
113
|
}
|
|
96
114
|
|
|
97
115
|
export { IrisThemeKey, ThemeProvider, useColorScheme, useDirection, useTheme, useThemeContext };
|
|
98
|
-
//# sourceMappingURL=chunk-
|
|
99
|
-
//# sourceMappingURL=chunk-
|
|
116
|
+
//# sourceMappingURL=chunk-ZTPIXL7Q.js.map
|
|
117
|
+
//# sourceMappingURL=chunk-ZTPIXL7Q.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/theme/ThemeProvider.ts","../src/theme/useTheme.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ide,\n ref,\n watch,\n type ComputedRef,\n type InjectionKey,\n type PropType,\n type Ref,\n} from 'vue'\nimport {\n applyDirection,\n applyTheme,\n injectGlobalStyles,\n type ApplyDirectionResult,\n type ApplyThemeResult,\n type Direction,\n type ThemeStore,\n} from '@iris-ui-kit/theme'\nimport type { IrisTheme } from '@iris-ui-kit/tokens'\n\nexport interface IrisThemeContext {\n store: ThemeStore\n current: Ref<IrisTheme>\n dir: ComputedRef<Direction>\n}\n\nexport const IrisThemeKey: InjectionKey<IrisThemeContext> = Symbol('IrisTheme')\n\n/**\n * Renderless provider that:\n * 1. exposes the theme store to descendants via `provide`,\n * 2. applies the current theme to a target element on mount and on change,\n * 3. reverts the inline custom properties on unmount.\n *\n * `target` defaults to `document.documentElement`. Pass an element ref to\n * scope a theme to a subtree.\n */\nexport const ThemeProvider = defineComponent({\n name: 'IrisThemeProvider',\n props: {\n store: {\n type: Object as PropType<ThemeStore>,\n required: true,\n },\n target: {\n type: Object as PropType<HTMLElement | null>,\n default: null,\n },\n /** Writing direction; sets `dir` on the target for RTL. Default `'ltr'`. */\n dir: {\n type: String as PropType<Direction>,\n default: 'ltr',\n },\n /** CSP nonce for injected inline stylesheets. */\n cspNonce: {\n type: String,\n default: undefined,\n },\n },\n setup(props, { slots }) {\n const current = ref(props.store.store.getState()) as Ref<IrisTheme>\n let unsubscribe = props.store.store.subscribe((next) => {\n current.value = next\n })\n\n let applied: ApplyThemeResult | null = null\n let dirApplied: ApplyDirectionResult | null = null\n\n const targetEl = () => props.target ?? document.documentElement\n\n const applyCurrent = () => {\n applied?.revert()\n applied = applyTheme(current.value, targetEl())\n }\n\n const applyDir = () => {\n dirApplied?.revert()\n dirApplied = applyDirection(props.dir, targetEl())\n }\n\n onMounted(() => {\n injectGlobalStyles(props.cspNonce)\n applyCurrent()\n applyDir()\n })\n\n watch(current, () => {\n if (applied) applyCurrent()\n })\n\n watch(\n () => props.store,\n (nextStore) => {\n unsubscribe()\n unsubscribe = nextStore.store.subscribe((next) => {\n current.value = next\n })\n current.value = nextStore.store.getState()\n if (applied) applyCurrent()\n },\n )\n\n watch(\n () => props.target,\n () => {\n if (applied) applyCurrent()\n if (dirApplied) applyDir()\n },\n )\n\n watch(\n () => props.dir,\n () => {\n if (dirApplied) applyDir()\n },\n )\n\n onBeforeUnmount(() => {\n unsubscribe()\n applied?.revert()\n applied = null\n dirApplied?.revert()\n dirApplied = null\n })\n\n provide(IrisThemeKey, { store: props.store, current, dir: computed(() => props.dir) })\n\n return () => slots.default?.()\n },\n})\n\nexport function useThemeContext(): IrisThemeContext {\n const ctx = inject(IrisThemeKey)\n if (!ctx) {\n throw new Error('[iris-ui] useTheme(): no <ThemeProvider> ancestor found')\n }\n return ctx\n}\n\n/**\n * Current writing direction (`'ltr'` / `'rtl'`) from the nearest\n * `<ThemeProvider>`, or a static `'ltr'` ref when there is none.\n */\nexport function useDirection(): ComputedRef<Direction> {\n const ctx = inject(IrisThemeKey, null)\n return ctx ? ctx.dir : computed(() => 'ltr' as Direction)\n}\n","import { computed, type ComputedRef } from 'vue'\nimport type { IrisTheme } from '@iris-ui-kit/tokens'\nimport { useThemeContext } from './ThemeProvider'\n\nexport interface UseThemeReturn {\n /** Reactive ref to the active theme. */\n theme: ComputedRef<IrisTheme>\n /** Switch by name or by passing a theme directly. */\n setTheme: (target: string | IrisTheme) => void\n /** Map of all themes registered with the store. */\n availableThemes: Record<string, IrisTheme>\n}\n\n/**\n * Read and write the current theme from anywhere inside a <ThemeProvider>.\n *\n * @example\n * const { theme, setTheme } = useTheme()\n * theme.value.colors['iris.primary']\n * setTheme('dark')\n */\nexport function useTheme(): UseThemeReturn {\n const ctx = useThemeContext()\n return {\n theme: computed(() => ctx.current.value),\n setTheme: ctx.store.setTheme,\n availableThemes: ctx.store.availableThemes,\n }\n}\n","import { onBeforeUnmount, ref, type Ref } from 'vue'\nimport { getColorScheme, watchColorScheme, type ColorScheme } from '@iris-ui-kit/theme'\n\n/**\n * Reactive system color scheme (`'light'` / `'dark'`) from\n * `prefers-color-scheme`. SSR-safe (reports `'light'` until matchMedia is\n * available). Wire it to a theme store to auto-follow the system:\n *\n * ```ts\n * const scheme = useColorScheme()\n * watch(scheme, (s) => store.setTheme(s === 'dark' ? 'dark' : 'light'), { immediate: true })\n * ```\n */\nexport function useColorScheme(): Ref<ColorScheme> {\n const scheme = ref<ColorScheme>(getColorScheme())\n const stop = watchColorScheme((s) => {\n scheme.value = s\n })\n onBeforeUnmount(stop)\n return scheme\n}\n"]}
|
package/dist/index.cjs
CHANGED
|
@@ -80,7 +80,7 @@ var ThemeProvider = vue.defineComponent({
|
|
|
80
80
|
},
|
|
81
81
|
setup(props, { slots }) {
|
|
82
82
|
const current = vue.ref(props.store.store.getState());
|
|
83
|
-
|
|
83
|
+
let unsubscribe = props.store.store.subscribe((next) => {
|
|
84
84
|
current.value = next;
|
|
85
85
|
});
|
|
86
86
|
let applied = null;
|
|
@@ -102,6 +102,24 @@ var ThemeProvider = vue.defineComponent({
|
|
|
102
102
|
vue.watch(current, () => {
|
|
103
103
|
if (applied) applyCurrent();
|
|
104
104
|
});
|
|
105
|
+
vue.watch(
|
|
106
|
+
() => props.store,
|
|
107
|
+
(nextStore) => {
|
|
108
|
+
unsubscribe();
|
|
109
|
+
unsubscribe = nextStore.store.subscribe((next) => {
|
|
110
|
+
current.value = next;
|
|
111
|
+
});
|
|
112
|
+
current.value = nextStore.store.getState();
|
|
113
|
+
if (applied) applyCurrent();
|
|
114
|
+
}
|
|
115
|
+
);
|
|
116
|
+
vue.watch(
|
|
117
|
+
() => props.target,
|
|
118
|
+
() => {
|
|
119
|
+
if (applied) applyCurrent();
|
|
120
|
+
if (dirApplied) applyDir();
|
|
121
|
+
}
|
|
122
|
+
);
|
|
105
123
|
vue.watch(
|
|
106
124
|
() => props.dir,
|
|
107
125
|
() => {
|
|
@@ -172,6 +190,12 @@ var SkinProvider = vue.defineComponent({
|
|
|
172
190
|
vue.watch(current, () => {
|
|
173
191
|
if (applied) apply();
|
|
174
192
|
});
|
|
193
|
+
vue.watch(
|
|
194
|
+
() => props.target,
|
|
195
|
+
() => {
|
|
196
|
+
if (applied) apply();
|
|
197
|
+
}
|
|
198
|
+
);
|
|
175
199
|
vue.onBeforeUnmount(() => {
|
|
176
200
|
unsubscribe();
|
|
177
201
|
applied?.revert();
|
|
@@ -641,7 +665,8 @@ var IrisSidebarLayout = vue.defineComponent({
|
|
|
641
665
|
() => props.collapsed,
|
|
642
666
|
(value) => {
|
|
643
667
|
if (value !== void 0) internalCollapsed.value = value;
|
|
644
|
-
}
|
|
668
|
+
},
|
|
669
|
+
{ immediate: true }
|
|
645
670
|
);
|
|
646
671
|
const setCollapsed = (value) => {
|
|
647
672
|
if (!isControlled.value) internalCollapsed.value = value;
|
|
@@ -2459,6 +2484,8 @@ var IrisAdminTabs = vue.defineComponent({
|
|
|
2459
2484
|
onClick: (e) => {
|
|
2460
2485
|
e.stopPropagation();
|
|
2461
2486
|
close(tab.key);
|
|
2487
|
+
const root = e.currentTarget.closest('[role="tablist"]');
|
|
2488
|
+
void vue.nextTick(() => focusTab(root, props.nav.getState().activeKey));
|
|
2462
2489
|
}
|
|
2463
2490
|
},
|
|
2464
2491
|
[vue.h(IrisIcon, { name: "x", size: 12 })]
|
|
@@ -3042,25 +3069,45 @@ var IrisProvider = vue.defineComponent({
|
|
|
3042
3069
|
target: { type: Object, default: null }
|
|
3043
3070
|
},
|
|
3044
3071
|
setup(props, { slots }) {
|
|
3045
|
-
const collected = core.runPlugins(props.plugins ?? []);
|
|
3072
|
+
const collected = vue.shallowRef(core.runPlugins(props.plugins ?? []));
|
|
3073
|
+
const ctx = vue.shallowReactive({
|
|
3074
|
+
stores: collected.value.stores,
|
|
3075
|
+
installed: new Set((props.plugins ?? []).map((p) => p.name))
|
|
3076
|
+
});
|
|
3077
|
+
vue.provide(PluginStoreContextKey, ctx);
|
|
3046
3078
|
let applied = null;
|
|
3079
|
+
let mounted = false;
|
|
3047
3080
|
vue.onMounted(() => {
|
|
3081
|
+
mounted = true;
|
|
3048
3082
|
if (typeof document === "undefined") return;
|
|
3049
3083
|
const el = props.target ?? document.documentElement;
|
|
3050
|
-
applied = theme.applyCssVars(Object.entries(collected.tokens), el);
|
|
3084
|
+
applied = theme.applyCssVars(Object.entries(collected.value.tokens), el);
|
|
3051
3085
|
});
|
|
3086
|
+
vue.watch(
|
|
3087
|
+
() => props.plugins,
|
|
3088
|
+
(next) => {
|
|
3089
|
+
const prev = collected.value;
|
|
3090
|
+
const nextCollected = core.runPlugins(next ?? []);
|
|
3091
|
+
applied?.revert();
|
|
3092
|
+
applied = null;
|
|
3093
|
+
prev.teardown();
|
|
3094
|
+
collected.value = nextCollected;
|
|
3095
|
+
ctx.stores = nextCollected.stores;
|
|
3096
|
+
ctx.installed = new Set((next ?? []).map((p) => p.name));
|
|
3097
|
+
if (mounted && typeof document !== "undefined") {
|
|
3098
|
+
const el = props.target ?? document.documentElement;
|
|
3099
|
+
applied = theme.applyCssVars(Object.entries(nextCollected.tokens), el);
|
|
3100
|
+
}
|
|
3101
|
+
}
|
|
3102
|
+
);
|
|
3052
3103
|
vue.onBeforeUnmount(() => {
|
|
3053
3104
|
applied?.revert();
|
|
3054
3105
|
applied = null;
|
|
3055
|
-
collected.teardown();
|
|
3056
|
-
});
|
|
3057
|
-
vue.provide(PluginStoreContextKey, {
|
|
3058
|
-
stores: collected.stores,
|
|
3059
|
-
installed: new Set((props.plugins ?? []).map((p) => p.name))
|
|
3106
|
+
collected.value.teardown();
|
|
3060
3107
|
});
|
|
3061
3108
|
return () => {
|
|
3062
3109
|
const locale = props.locale ?? DEFAULT_LOCALE;
|
|
3063
|
-
const messages = { ...collected.messages[locale], ...props.messages ?? {} };
|
|
3110
|
+
const messages = { ...collected.value.messages[locale], ...props.messages ?? {} };
|
|
3064
3111
|
let tree = vue.h(
|
|
3065
3112
|
IrisI18nProvider,
|
|
3066
3113
|
{ locale: props.locale, messages },
|
|
@@ -6255,6 +6302,7 @@ var IrisList = vue.defineComponent({
|
|
|
6255
6302
|
isEnabled
|
|
6256
6303
|
});
|
|
6257
6304
|
const activeIndex = vue.ref(nav.index);
|
|
6305
|
+
const hoveredIndex = vue.ref(-1);
|
|
6258
6306
|
vue.watch(
|
|
6259
6307
|
() => props.items,
|
|
6260
6308
|
() => {
|
|
@@ -6337,7 +6385,7 @@ var IrisList = vue.defineComponent({
|
|
|
6337
6385
|
cursor: item.disabled ? "not-allowed" : "pointer",
|
|
6338
6386
|
opacity: item.disabled ? "0.5" : "1",
|
|
6339
6387
|
fontSize: "14px",
|
|
6340
|
-
background: selected ? "var(--iris-primary)" : active ? "var(--iris-surface-hover)" : "transparent",
|
|
6388
|
+
background: selected ? "var(--iris-primary)" : hoveredIndex.value === index ? "var(--iris-surface-hover)" : active ? "var(--iris-surface-hover)" : "transparent",
|
|
6341
6389
|
color: selected ? "var(--iris-primary-foreground)" : "var(--iris-foreground)",
|
|
6342
6390
|
outline: "none"
|
|
6343
6391
|
};
|
|
@@ -6360,6 +6408,12 @@ var IrisList = vue.defineComponent({
|
|
|
6360
6408
|
"data-state": selected ? "selected" : active ? "active" : "idle",
|
|
6361
6409
|
onClick: item.disabled ? void 0 : onClick,
|
|
6362
6410
|
onFocus,
|
|
6411
|
+
onMouseEnter: () => {
|
|
6412
|
+
hoveredIndex.value = index;
|
|
6413
|
+
},
|
|
6414
|
+
onMouseLeave: () => {
|
|
6415
|
+
if (hoveredIndex.value === index) hoveredIndex.value = -1;
|
|
6416
|
+
},
|
|
6363
6417
|
style: baseStyle
|
|
6364
6418
|
},
|
|
6365
6419
|
slotContent ?? item.label ?? String(item.value)
|
|
@@ -13497,6 +13551,7 @@ var IrisTreeSelect = vue.defineComponent({
|
|
|
13497
13551
|
const { t } = useI18n();
|
|
13498
13552
|
const open = vue.ref(false);
|
|
13499
13553
|
const focused = vue.ref(false);
|
|
13554
|
+
const hoveredValue = vue.ref(null);
|
|
13500
13555
|
const expanded = vue.ref(new Set(props.defaultExpanded));
|
|
13501
13556
|
let rootEl = null;
|
|
13502
13557
|
const selectNode = (node) => {
|
|
@@ -13534,6 +13589,12 @@ var IrisTreeSelect = vue.defineComponent({
|
|
|
13534
13589
|
vue.h(
|
|
13535
13590
|
"div",
|
|
13536
13591
|
{
|
|
13592
|
+
onMouseenter: () => {
|
|
13593
|
+
hoveredValue.value = node.value;
|
|
13594
|
+
},
|
|
13595
|
+
onMouseleave: () => {
|
|
13596
|
+
if (hoveredValue.value === node.value) hoveredValue.value = null;
|
|
13597
|
+
},
|
|
13537
13598
|
style: {
|
|
13538
13599
|
display: "flex",
|
|
13539
13600
|
alignItems: "center",
|
|
@@ -13542,7 +13603,7 @@ var IrisTreeSelect = vue.defineComponent({
|
|
|
13542
13603
|
paddingInlineEnd: "6px",
|
|
13543
13604
|
paddingBlock: "4px",
|
|
13544
13605
|
borderRadius: "var(--iris-radius-sm, 4px)",
|
|
13545
|
-
background: isSelected ? "var(--iris-surface-hover, rgba(99,102,241,0.1))" : "transparent"
|
|
13606
|
+
background: isSelected || hoveredValue.value === node.value ? "var(--iris-surface-hover, rgba(99,102,241,0.1))" : "transparent"
|
|
13546
13607
|
}
|
|
13547
13608
|
},
|
|
13548
13609
|
[
|
|
@@ -13950,6 +14011,7 @@ var IrisCascader = vue.defineComponent({
|
|
|
13950
14011
|
const open = vue.ref(false);
|
|
13951
14012
|
const focused = vue.ref(false);
|
|
13952
14013
|
const activePath = vue.ref([...props.modelValue]);
|
|
14014
|
+
const hoveredValue = vue.ref(null);
|
|
13953
14015
|
let rootEl = null;
|
|
13954
14016
|
const toggleOpen = () => {
|
|
13955
14017
|
if (props.disabled) return;
|
|
@@ -14103,6 +14165,12 @@ var IrisCascader = vue.defineComponent({
|
|
|
14103
14165
|
"data-iris-cascader-option": "",
|
|
14104
14166
|
"data-value": node.value,
|
|
14105
14167
|
onClick: () => selectOption(ci, node),
|
|
14168
|
+
onMouseenter: () => {
|
|
14169
|
+
hoveredValue.value = node.value;
|
|
14170
|
+
},
|
|
14171
|
+
onMouseleave: () => {
|
|
14172
|
+
if (hoveredValue.value === node.value) hoveredValue.value = null;
|
|
14173
|
+
},
|
|
14106
14174
|
style: {
|
|
14107
14175
|
display: "flex",
|
|
14108
14176
|
alignItems: "center",
|
|
@@ -14113,7 +14181,7 @@ var IrisCascader = vue.defineComponent({
|
|
|
14113
14181
|
borderRadius: "var(--iris-radius-sm, 4px)",
|
|
14114
14182
|
cursor: node.disabled ? "not-allowed" : "pointer",
|
|
14115
14183
|
color: node.disabled ? "var(--iris-muted)" : "var(--iris-foreground)",
|
|
14116
|
-
background: isActive ? "var(--iris-surface-hover, rgba(99,102,241,0.1))" : "transparent"
|
|
14184
|
+
background: isActive || hoveredValue.value === node.value ? "var(--iris-surface-hover, rgba(99,102,241,0.1))" : "transparent"
|
|
14117
14185
|
}
|
|
14118
14186
|
},
|
|
14119
14187
|
[
|