origam 2.37.11 → 2.37.13
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 +22 -0
- package/dist/src/assets/css/main.css +1 -1
- package/dist/src/assets/css/tokens/dark.css +4 -0
- package/dist/src/assets/css/tokens/light.css +2 -0
- package/dist/src/assets/scss/tokens/_dark.scss +4 -0
- package/dist/src/assets/scss/tokens/_light.scss +2 -0
- package/dist/src/components/List/OrigamListItem.vue +2 -2
- package/dist/src/interfaces/Commons/nuxt-module.interface.d.ts +12 -0
- package/dist/src/nuxt/module.cjs +4 -2
- package/dist/src/nuxt/module.js +4 -2
- package/dist/src/nuxt/plugin.client.cjs +3 -1
- package/dist/src/nuxt/plugin.client.js +2 -1
- package/dist/src/nuxt/plugin.server.cjs +3 -1
- package/dist/src/nuxt/plugin.server.js +2 -1
- package/dist/src/types/Icon/icon.type.d.ts +10 -0
- package/dist/src/types/tokens.type.d.ts +1 -1
- package/dist/src/utils/Commons/nuxt-icons.util.cjs +11 -0
- package/dist/src/utils/Commons/nuxt-icons.util.d.ts +11 -0
- package/dist/src/utils/Commons/nuxt-icons.util.js +3 -0
- package/dist/src/utils/index.cjs +11 -0
- package/dist/src/utils/index.d.ts +1 -0
- package/dist/src/utils/index.js +1 -0
- package/package.json +1 -1
|
@@ -1891,6 +1891,8 @@
|
|
|
1891
1891
|
--origam-list-item---pointer-events: none;
|
|
1892
1892
|
--origam-list-item---user-select: none;
|
|
1893
1893
|
--origam-list-item---opacity: var(--origam-opacity---60);
|
|
1894
|
+
--origam-list-item---overlay-opacity-active: 0.12;
|
|
1895
|
+
--origam-list-item---overlay-opacity-active-hover: 0.16;
|
|
1894
1896
|
--origam-list-item---cursor: pointer;
|
|
1895
1897
|
--origam-list__item---overlay-opacity: var(--origam-opacity---0);
|
|
1896
1898
|
--origam-list__item---overlay-background-color: currentColor;
|
|
@@ -4913,6 +4915,8 @@
|
|
|
4913
4915
|
--origam-list-item---pointer-events: none;
|
|
4914
4916
|
--origam-list-item---user-select: none;
|
|
4915
4917
|
--origam-list-item---opacity: var(--origam-opacity---60);
|
|
4918
|
+
--origam-list-item---overlay-opacity-active: 0.12;
|
|
4919
|
+
--origam-list-item---overlay-opacity-active-hover: 0.16;
|
|
4916
4920
|
--origam-list-item---cursor: pointer;
|
|
4917
4921
|
--origam-list__item---overlay-opacity: var(--origam-opacity---0);
|
|
4918
4922
|
--origam-list__item---overlay-background-color: currentColor;
|
|
@@ -1793,6 +1793,8 @@
|
|
|
1793
1793
|
--origam-list-item---pointer-events: none;
|
|
1794
1794
|
--origam-list-item---user-select: none;
|
|
1795
1795
|
--origam-list-item---opacity: var(--origam-opacity---60);
|
|
1796
|
+
--origam-list-item---overlay-opacity-active: 0.12;
|
|
1797
|
+
--origam-list-item---overlay-opacity-active-hover: 0.16;
|
|
1796
1798
|
--origam-list-item---cursor: pointer;
|
|
1797
1799
|
--origam-list__item---overlay-opacity: var(--origam-opacity---0);
|
|
1798
1800
|
--origam-list__item---overlay-background-color: currentColor;
|
|
@@ -1891,6 +1891,8 @@
|
|
|
1891
1891
|
--origam-list-item---pointer-events: none;
|
|
1892
1892
|
--origam-list-item---user-select: none;
|
|
1893
1893
|
--origam-list-item---opacity: var(--origam-opacity---60);
|
|
1894
|
+
--origam-list-item---overlay-opacity-active: 0.12;
|
|
1895
|
+
--origam-list-item---overlay-opacity-active-hover: 0.16;
|
|
1894
1896
|
--origam-list-item---cursor: pointer;
|
|
1895
1897
|
--origam-list__item---overlay-opacity: var(--origam-opacity---0);
|
|
1896
1898
|
--origam-list__item---overlay-background-color: currentColor;
|
|
@@ -4913,6 +4915,8 @@
|
|
|
4913
4915
|
--origam-list-item---pointer-events: none;
|
|
4914
4916
|
--origam-list-item---user-select: none;
|
|
4915
4917
|
--origam-list-item---opacity: var(--origam-opacity---60);
|
|
4918
|
+
--origam-list-item---overlay-opacity-active: 0.12;
|
|
4919
|
+
--origam-list-item---overlay-opacity-active-hover: 0.16;
|
|
4916
4920
|
--origam-list-item---cursor: pointer;
|
|
4917
4921
|
--origam-list__item---overlay-opacity: var(--origam-opacity---0);
|
|
4918
4922
|
--origam-list__item---overlay-background-color: currentColor;
|
|
@@ -1793,6 +1793,8 @@
|
|
|
1793
1793
|
--origam-list-item---pointer-events: none;
|
|
1794
1794
|
--origam-list-item---user-select: none;
|
|
1795
1795
|
--origam-list-item---opacity: var(--origam-opacity---60);
|
|
1796
|
+
--origam-list-item---overlay-opacity-active: 0.12;
|
|
1797
|
+
--origam-list-item---overlay-opacity-active-hover: 0.16;
|
|
1796
1798
|
--origam-list-item---cursor: pointer;
|
|
1797
1799
|
--origam-list__item---overlay-opacity: var(--origam-opacity---0);
|
|
1798
1800
|
--origam-list__item---overlay-background-color: currentColor;
|
|
@@ -693,13 +693,13 @@ defineExpose({
|
|
|
693
693
|
&--active,
|
|
694
694
|
[aria-haspopup=menu][aria-expanded=true] {
|
|
695
695
|
> #{$this}__overlay {
|
|
696
|
-
--origam-list-item__overlay---opacity:
|
|
696
|
+
--origam-list-item__overlay---opacity: var(--origam-list-item---overlay-opacity-active, 0.12);
|
|
697
697
|
}
|
|
698
698
|
|
|
699
699
|
&:hover,
|
|
700
700
|
&:focus-visible {
|
|
701
701
|
> #{$this}__overlay {
|
|
702
|
-
--origam-list-item__overlay---opacity:
|
|
702
|
+
--origam-list-item__overlay---opacity: var(--origam-list-item---overlay-opacity-active-hover, 0.16);
|
|
703
703
|
}
|
|
704
704
|
}
|
|
705
705
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { ILocaleOptions } from './locale.interface';
|
|
2
2
|
import type { IOrigamTheme } from './theme.interface';
|
|
3
|
+
import type { TNuxtIconOptions } from '../../types/Icon/icon.type';
|
|
3
4
|
import type { TMode, TTheme } from '../../types/Commons/theme.type';
|
|
4
5
|
/**
|
|
5
6
|
* Options passed by a consumer in `nuxt.config.ts` under the `origam` key.
|
|
@@ -41,6 +42,16 @@ export interface IOrigamNuxtModuleOptions {
|
|
|
41
42
|
* origam: { locale: { locale: 'ja', fallbackLocale: 'en', messages: { ja } } }
|
|
42
43
|
********************************************************/
|
|
43
44
|
locale?: ILocaleOptions;
|
|
45
|
+
/*********************************************************
|
|
46
|
+
* icons
|
|
47
|
+
*
|
|
48
|
+
* @description
|
|
49
|
+
* `defaultSet` and `aliases` of `createOrigam({ icons })`, forwarded by BOTH plugins. Serialisable subset only (it travels through `runtimeConfig`): aliases are strings or path arrays, never components. `sets` (render functions) is NOT relayed — keep a manual plugin for custom icon sets.
|
|
50
|
+
*
|
|
51
|
+
* @example
|
|
52
|
+
* origam: { icons: { aliases: { info: 'mdi-information-outline' } } }
|
|
53
|
+
********************************************************/
|
|
54
|
+
icons?: TNuxtIconOptions;
|
|
44
55
|
/**
|
|
45
56
|
* Theme (brand) applied when no cookie is set. Use `'auto'` to render no
|
|
46
57
|
* `data-theme` attribute (the default brand).
|
|
@@ -127,6 +138,7 @@ export interface IOrigamNuxtRuntimeConfig {
|
|
|
127
138
|
modeCookieName: string;
|
|
128
139
|
cookieMaxAge: number;
|
|
129
140
|
locale?: ILocaleOptions;
|
|
141
|
+
icons?: TNuxtIconOptions;
|
|
130
142
|
}
|
|
131
143
|
/*********************************************************
|
|
132
144
|
* IOrigamNuxtProvide
|
package/dist/src/nuxt/module.cjs
CHANGED
|
@@ -24,7 +24,8 @@ const DEFAULTS = {
|
|
|
24
24
|
autoImport: true,
|
|
25
25
|
includeUtilities: true,
|
|
26
26
|
prefix: "Origam",
|
|
27
|
-
locale: {}
|
|
27
|
+
locale: {},
|
|
28
|
+
icons: {}
|
|
28
29
|
};
|
|
29
30
|
const SCALAR_DEFAULTS = {
|
|
30
31
|
defaultTheme: DEFAULTS.defaultTheme,
|
|
@@ -141,7 +142,8 @@ const origamNuxtModule = (0, _kit.defineNuxtModule)({
|
|
|
141
142
|
cookieName,
|
|
142
143
|
modeCookieName,
|
|
143
144
|
cookieMaxAge,
|
|
144
|
-
locale: options.locale
|
|
145
|
+
locale: options.locale,
|
|
146
|
+
icons: options.icons
|
|
145
147
|
};
|
|
146
148
|
}
|
|
147
149
|
});
|
package/dist/src/nuxt/module.js
CHANGED
|
@@ -23,7 +23,8 @@ const DEFAULTS = {
|
|
|
23
23
|
autoImport: true,
|
|
24
24
|
includeUtilities: true,
|
|
25
25
|
prefix: "Origam",
|
|
26
|
-
locale: {}
|
|
26
|
+
locale: {},
|
|
27
|
+
icons: {}
|
|
27
28
|
};
|
|
28
29
|
const SCALAR_DEFAULTS = {
|
|
29
30
|
defaultTheme: DEFAULTS.defaultTheme,
|
|
@@ -137,7 +138,8 @@ const origamNuxtModule = defineNuxtModule({
|
|
|
137
138
|
cookieName,
|
|
138
139
|
modeCookieName,
|
|
139
140
|
cookieMaxAge,
|
|
140
|
-
locale: options.locale
|
|
141
|
+
locale: options.locale,
|
|
142
|
+
icons: options.icons
|
|
141
143
|
};
|
|
142
144
|
}
|
|
143
145
|
});
|
|
@@ -7,6 +7,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
var _vue = require("vue");
|
|
8
8
|
var _theme = require("../composables/Commons/theme.composable.cjs");
|
|
9
9
|
var _origam = require("../origam.cjs");
|
|
10
|
+
var _nuxtIcons = require("../utils/Commons/nuxt-icons.util.cjs");
|
|
10
11
|
var _nuxtLocale = require("../utils/Commons/nuxt-locale.util.cjs");
|
|
11
12
|
var _applyTheme = require("../utils/Commons/apply-theme.util.cjs");
|
|
12
13
|
var _app = require("#app");
|
|
@@ -33,7 +34,8 @@ module.exports = (0, _app.defineNuxtPlugin)({
|
|
|
33
34
|
const origam = (0, _origam.createOrigam)({
|
|
34
35
|
themes,
|
|
35
36
|
ssr: true,
|
|
36
|
-
...(0, _nuxtLocale.nuxtLocaleOptions)(config)
|
|
37
|
+
...(0, _nuxtLocale.nuxtLocaleOptions)(config),
|
|
38
|
+
...(0, _nuxtIcons.nuxtIconsOptions)(config)
|
|
37
39
|
});
|
|
38
40
|
nuxtApp.vueApp.use(origam);
|
|
39
41
|
const themeApi = (0, _theme.useTheme)();
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ref, watch } from "vue";
|
|
2
2
|
import { useTheme } from "../composables/Commons/theme.composable.js";
|
|
3
3
|
import { createOrigam } from "../origam.js";
|
|
4
|
+
import { nuxtIconsOptions } from "../utils/Commons/nuxt-icons.util.js";
|
|
4
5
|
import { nuxtLocaleOptions } from "../utils/Commons/nuxt-locale.util.js";
|
|
5
6
|
import { isModePinned } from "../utils/Commons/apply-theme.util.js";
|
|
6
7
|
import { defineNuxtPlugin, useCookie, useRuntimeConfig } from "#app";
|
|
@@ -24,7 +25,7 @@ export default defineNuxtPlugin({
|
|
|
24
25
|
const initialTheme = themeFromDom ?? themeCookie.value ?? config.defaultTheme;
|
|
25
26
|
const initialMode = modeCookie.value ?? config.defaultMode;
|
|
26
27
|
const themes = config.themes ?? [];
|
|
27
|
-
const origam = createOrigam({ themes, ssr: true, ...nuxtLocaleOptions(config) });
|
|
28
|
+
const origam = createOrigam({ themes, ssr: true, ...nuxtLocaleOptions(config), ...nuxtIconsOptions(config) });
|
|
28
29
|
nuxtApp.vueApp.use(origam);
|
|
29
30
|
const themeApi = useTheme();
|
|
30
31
|
themeApi.setTheme(initialTheme);
|
|
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
|
|
7
7
|
var _origam = require("../origam.cjs");
|
|
8
|
+
var _nuxtIcons = require("../utils/Commons/nuxt-icons.util.cjs");
|
|
8
9
|
var _nuxtLocale = require("../utils/Commons/nuxt-locale.util.cjs");
|
|
9
10
|
var _applyTheme = require("../utils/Commons/apply-theme.util.cjs");
|
|
10
11
|
var _ssrStyles = require("../utils/Commons/ssr-styles.util.cjs");
|
|
@@ -69,7 +70,8 @@ module.exports = (0, _app.defineNuxtPlugin)({
|
|
|
69
70
|
const origam = (0, _origam.createOrigam)({
|
|
70
71
|
themes,
|
|
71
72
|
ssr: true,
|
|
72
|
-
...(0, _nuxtLocale.nuxtLocaleOptions)(config)
|
|
73
|
+
...(0, _nuxtLocale.nuxtLocaleOptions)(config),
|
|
74
|
+
...(0, _nuxtIcons.nuxtIconsOptions)(config)
|
|
73
75
|
});
|
|
74
76
|
origam._defaultsRef.value = origam._activeDefaultsFor(resolvedTheme === _theme.ORIGAM_THEME_AUTO ? "" : resolvedTheme, resolvedMode);
|
|
75
77
|
nuxtApp.vueApp.use(origam);
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { createOrigam } from "../origam.js";
|
|
2
|
+
import { nuxtIconsOptions } from "../utils/Commons/nuxt-icons.util.js";
|
|
2
3
|
import { nuxtLocaleOptions } from "../utils/Commons/nuxt-locale.util.js";
|
|
3
4
|
import { isModePinned, themeToCss, themeToUnpinnedCss } from "../utils/Commons/apply-theme.util.js";
|
|
4
5
|
import { getSsrStyles } from "../utils/Commons/ssr-styles.util.js";
|
|
@@ -60,7 +61,7 @@ export default defineNuxtPlugin({
|
|
|
60
61
|
htmlAttrs,
|
|
61
62
|
style: ssrThemeCss ? [{ id: "origam-theme-ssr", key: "origam-theme-ssr", innerHTML: ssrThemeCss }] : []
|
|
62
63
|
});
|
|
63
|
-
const origam = createOrigam({ themes, ssr: true, ...nuxtLocaleOptions(config) });
|
|
64
|
+
const origam = createOrigam({ themes, ssr: true, ...nuxtLocaleOptions(config), ...nuxtIconsOptions(config) });
|
|
64
65
|
origam._defaultsRef.value = origam._activeDefaultsFor(
|
|
65
66
|
resolvedTheme === ORIGAM_THEME_AUTO ? "" : resolvedTheme,
|
|
66
67
|
resolvedMode
|
|
@@ -7,6 +7,16 @@ export type TIconOptions = {
|
|
|
7
7
|
aliases?: Partial<IIconAliases>;
|
|
8
8
|
sets?: Record<string, IIconSet>;
|
|
9
9
|
};
|
|
10
|
+
/*********************************************************
|
|
11
|
+
* TNuxtIconOptions
|
|
12
|
+
*
|
|
13
|
+
* @description
|
|
14
|
+
* The part of `TIconOptions` that survives `runtimeConfig` (JSON): `sets` (render functions) and component aliases are left out.
|
|
15
|
+
********************************************************/
|
|
16
|
+
export type TNuxtIconOptions = {
|
|
17
|
+
defaultSet?: string;
|
|
18
|
+
aliases?: Record<string, Exclude<TIcon, Component>>;
|
|
19
|
+
};
|
|
10
20
|
export type TIconInstance = {
|
|
11
21
|
component: TIconComponent;
|
|
12
22
|
icon?: TIcon;
|