origam 2.6.2 → 2.7.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/dist/src/assets/css/tokens/dark.css +6 -0
- package/dist/src/assets/css/tokens/light.css +3 -0
- package/dist/src/assets/scss/tokens/_dark.scss +3 -0
- package/dist/src/assets/scss/tokens/_light.scss +3 -0
- package/dist/src/components/Alert/OrigamAlert.vue +5 -0
- package/dist/src/components/Btn/OrigamBtnGroup.vue +0 -11
- package/dist/src/components/Field/OrigamField.vue +2 -2
- package/dist/src/components/Pagination/OrigamPagination.vue +7 -1
- package/dist/src/components/ThemeProvider/OrigamThemeProvider.vue +11 -1
- package/dist/src/composables/Code/code.composable.cjs +22 -1
- package/dist/src/composables/Code/code.composable.js +25 -1
- package/dist/src/consts/Theme/theme.const.cjs +2 -1
- package/dist/src/consts/Theme/theme.const.d.ts +14 -1
- package/dist/src/consts/Theme/theme.const.js +1 -0
- package/dist/src/interfaces/Btn/btn.interface.d.ts +1 -2
- package/dist/src/interfaces/Checkbox/checkbox.interface.d.ts +1 -1
- package/dist/src/interfaces/DatePicker/date-picker-header.interface.d.ts +1 -3
- package/dist/src/origam.cjs +1 -0
- package/dist/src/origam.js +2 -0
- package/dist/src/types/tokens.type.d.ts +1 -1
- package/dist/src/utils/Commons/getCurrentInstance.util.cjs +1 -1
- package/dist/src/utils/Commons/getCurrentInstance.util.js +1 -1
- package/dist/src/utils/Theme/apply-theme.util.cjs +2 -1
- package/dist/src/utils/Theme/apply-theme.util.js +2 -1
- package/package.json +22 -16
- package/LICENSE +0 -21
|
@@ -402,6 +402,7 @@
|
|
|
402
402
|
--origam-badge--error---background-color: var(--origam-color__feedback--danger---bg);
|
|
403
403
|
--origam-badge--error---color: var(--origam-color__feedback--danger---fg);
|
|
404
404
|
--origam-alert---background-color: var(--origam-color__surface---disabled);
|
|
405
|
+
--origam-alert---backdrop-filter: none;
|
|
405
406
|
--origam-alert---color: var(--origam-color__text---primary);
|
|
406
407
|
--origam-alert---border-color: rgba(0, 0, 0, 0);
|
|
407
408
|
--origam-alert---border-style: solid;
|
|
@@ -846,7 +847,9 @@
|
|
|
846
847
|
--origam-field---border-radius: var(--origam-radius---sm);
|
|
847
848
|
--origam-field---border-color: var(--origam-color__border---default);
|
|
848
849
|
--origam-field---border-width: var(--origam-border__width---thin);
|
|
850
|
+
--origam-field---border-width-outlined: var(--origam-border__width---thin);
|
|
849
851
|
--origam-field---border-opacity: 0.38;
|
|
852
|
+
--origam-field---border-opacity-outlined: 0.38;
|
|
850
853
|
--origam-field---background-color: rgba(0, 0, 0, 0);
|
|
851
854
|
--origam-field---color: var(--origam-color__text---primary);
|
|
852
855
|
--origam-field---opacity-disabled: var(--origam-opacity---50);
|
|
@@ -3154,6 +3157,7 @@
|
|
|
3154
3157
|
--origam-badge--error---background-color: var(--origam-color__feedback--danger---bg);
|
|
3155
3158
|
--origam-badge--error---color: var(--origam-color__feedback--danger---fg);
|
|
3156
3159
|
--origam-alert---background-color: var(--origam-color__surface---disabled);
|
|
3160
|
+
--origam-alert---backdrop-filter: none;
|
|
3157
3161
|
--origam-alert---color: var(--origam-color__text---primary);
|
|
3158
3162
|
--origam-alert---border-color: rgba(0, 0, 0, 0);
|
|
3159
3163
|
--origam-alert---border-style: solid;
|
|
@@ -3598,7 +3602,9 @@
|
|
|
3598
3602
|
--origam-field---border-radius: var(--origam-radius---sm);
|
|
3599
3603
|
--origam-field---border-color: var(--origam-color__border---default);
|
|
3600
3604
|
--origam-field---border-width: var(--origam-border__width---thin);
|
|
3605
|
+
--origam-field---border-width-outlined: var(--origam-border__width---thin);
|
|
3601
3606
|
--origam-field---border-opacity: 0.38;
|
|
3607
|
+
--origam-field---border-opacity-outlined: 0.38;
|
|
3602
3608
|
--origam-field---background-color: rgba(0, 0, 0, 0);
|
|
3603
3609
|
--origam-field---color: var(--origam-color__text---primary);
|
|
3604
3610
|
--origam-field---opacity-disabled: var(--origam-opacity---50);
|
|
@@ -403,6 +403,7 @@
|
|
|
403
403
|
--origam-badge--error---background-color: var(--origam-color__feedback--danger---bg);
|
|
404
404
|
--origam-badge--error---color: var(--origam-color__feedback--danger---fg);
|
|
405
405
|
--origam-alert---background-color: var(--origam-color__surface---disabled);
|
|
406
|
+
--origam-alert---backdrop-filter: none;
|
|
406
407
|
--origam-alert---color: var(--origam-color__text---primary);
|
|
407
408
|
--origam-alert---border-color: rgba(0, 0, 0, 0);
|
|
408
409
|
--origam-alert---border-style: solid;
|
|
@@ -847,7 +848,9 @@
|
|
|
847
848
|
--origam-field---border-radius: var(--origam-radius---sm);
|
|
848
849
|
--origam-field---border-color: var(--origam-color__border---default);
|
|
849
850
|
--origam-field---border-width: var(--origam-border__width---thin);
|
|
851
|
+
--origam-field---border-width-outlined: var(--origam-border__width---thin);
|
|
850
852
|
--origam-field---border-opacity: 0.38;
|
|
853
|
+
--origam-field---border-opacity-outlined: 0.38;
|
|
851
854
|
--origam-field---background-color: rgba(0, 0, 0, 0);
|
|
852
855
|
--origam-field---color: var(--origam-color__text---primary);
|
|
853
856
|
--origam-field---opacity-disabled: var(--origam-opacity---50);
|
|
@@ -402,6 +402,7 @@
|
|
|
402
402
|
--origam-badge--error---background-color: var(--origam-color__feedback--danger---bg);
|
|
403
403
|
--origam-badge--error---color: var(--origam-color__feedback--danger---fg);
|
|
404
404
|
--origam-alert---background-color: var(--origam-color__surface---disabled);
|
|
405
|
+
--origam-alert---backdrop-filter: none;
|
|
405
406
|
--origam-alert---color: var(--origam-color__text---primary);
|
|
406
407
|
--origam-alert---border-color: rgba(0, 0, 0, 0);
|
|
407
408
|
--origam-alert---border-style: solid;
|
|
@@ -846,7 +847,9 @@
|
|
|
846
847
|
--origam-field---border-radius: var(--origam-radius---sm);
|
|
847
848
|
--origam-field---border-color: var(--origam-color__border---default);
|
|
848
849
|
--origam-field---border-width: var(--origam-border__width---thin);
|
|
850
|
+
--origam-field---border-width-outlined: var(--origam-border__width---thin);
|
|
849
851
|
--origam-field---border-opacity: 0.38;
|
|
852
|
+
--origam-field---border-opacity-outlined: 0.38;
|
|
850
853
|
--origam-field---background-color: rgba(0, 0, 0, 0);
|
|
851
854
|
--origam-field---color: var(--origam-color__text---primary);
|
|
852
855
|
--origam-field---opacity-disabled: var(--origam-opacity---50);
|
|
@@ -403,6 +403,7 @@
|
|
|
403
403
|
--origam-badge--error---background-color: var(--origam-color__feedback--danger---bg);
|
|
404
404
|
--origam-badge--error---color: var(--origam-color__feedback--danger---fg);
|
|
405
405
|
--origam-alert---background-color: var(--origam-color__surface---disabled);
|
|
406
|
+
--origam-alert---backdrop-filter: none;
|
|
406
407
|
--origam-alert---color: var(--origam-color__text---primary);
|
|
407
408
|
--origam-alert---border-color: rgba(0, 0, 0, 0);
|
|
408
409
|
--origam-alert---border-style: solid;
|
|
@@ -847,7 +848,9 @@
|
|
|
847
848
|
--origam-field---border-radius: var(--origam-radius---sm);
|
|
848
849
|
--origam-field---border-color: var(--origam-color__border---default);
|
|
849
850
|
--origam-field---border-width: var(--origam-border__width---thin);
|
|
851
|
+
--origam-field---border-width-outlined: var(--origam-border__width---thin);
|
|
850
852
|
--origam-field---border-opacity: 0.38;
|
|
853
|
+
--origam-field---border-opacity-outlined: 0.38;
|
|
851
854
|
--origam-field---background-color: rgba(0, 0, 0, 0);
|
|
852
855
|
--origam-field---color: var(--origam-color__text---primary);
|
|
853
856
|
--origam-field---opacity-disabled: var(--origam-opacity---50);
|
|
@@ -309,6 +309,11 @@ defineExpose({
|
|
|
309
309
|
background-color: var(--origam-alert---background-color);
|
|
310
310
|
color: var(--origam-alert---color);
|
|
311
311
|
|
|
312
|
+
@supports (backdrop-filter: blur(8px)) or (-webkit-backdrop-filter: blur(8px)) {
|
|
313
|
+
backdrop-filter: var(--origam-alert---backdrop-filter, none);
|
|
314
|
+
-webkit-backdrop-filter: var(--origam-alert---backdrop-filter, none);
|
|
315
|
+
}
|
|
316
|
+
|
|
312
317
|
&--elevated {
|
|
313
318
|
box-shadow: var(--origam-alert---box-shadow-elevated, var(--origam-shadow---md));
|
|
314
319
|
}
|
|
@@ -251,17 +251,6 @@ defineExpose({
|
|
|
251
251
|
:root {
|
|
252
252
|
--origam-btn-group---density: 0;
|
|
253
253
|
|
|
254
|
-
/*
|
|
255
|
-
* Border-radius, border-width and border-color deliberately fall back to
|
|
256
|
-
* the matching --origam-btn---* variables so that any theme that overrides
|
|
257
|
-
* the btn tokens (radius, border) is automatically reflected on the group
|
|
258
|
-
* container — no per-theme duplication required.
|
|
259
|
-
*
|
|
260
|
-
* Token resolution chain:
|
|
261
|
-
* theme override of --origam-btn---border-radius
|
|
262
|
-
* → picked up here as --origam-btn-group---border-radius
|
|
263
|
-
* → used in .origam-btn-group { border-radius: … }
|
|
264
|
-
*/
|
|
265
254
|
--origam-btn-group---border-radius: var(--origam-btn---border-radius, 4px);
|
|
266
255
|
--origam-btn-group---border-width: var(--origam-btn---border-width, 0);
|
|
267
256
|
--origam-btn-group---border-style: var(--origam-btn---border-style, solid);
|
|
@@ -912,8 +912,8 @@ defineExpose({
|
|
|
912
912
|
}
|
|
913
913
|
|
|
914
914
|
&-outlined {
|
|
915
|
-
--origam-field---border-width: 1px;
|
|
916
|
-
--origam-field---border-opacity: .38;
|
|
915
|
+
--origam-field---border-width: var(--origam-field---border-width-outlined, 1px);
|
|
916
|
+
--origam-field---border-opacity: var(--origam-field---border-opacity-outlined, .38);
|
|
917
917
|
background: var(--origam-field---background-color, transparent);
|
|
918
918
|
|
|
919
919
|
#{$this}__outline {
|
|
@@ -178,7 +178,7 @@
|
|
|
178
178
|
import { ComponentPublicInstance, computed, nextTick, ref, shallowRef, StyleValue } from "vue";
|
|
179
179
|
import { OrigamBtn } from "../../components";
|
|
180
180
|
import { useDensity, useDisplay, useLocale, useProps, useRefs, useResizeObserver, useSize, useTypography, useVModel, useStyle } from "../../composables";
|
|
181
|
-
import { KEYBOARD_VALUES, MDI_ICONS } from "../../enums";
|
|
181
|
+
import { KEYBOARD_VALUES, MDI_ICONS, VARIANT } from "../../enums";
|
|
182
182
|
import { createRange, int } from "../../utils";
|
|
183
183
|
const props = defineProps({
|
|
184
184
|
start: { type: Number, required: false, default: 1 },
|
|
@@ -311,6 +311,12 @@ const range = computed(() => {
|
|
|
311
311
|
const sharedBtnColorProps = computed(() => {
|
|
312
312
|
const baseBg = props.bgColor || props.color;
|
|
313
313
|
return {
|
|
314
|
+
// In colored mode force `flat` so the btn actually PAINTS the
|
|
315
|
+
// pagination-driven `--origam-btn---background-color`. The theme's
|
|
316
|
+
// default `text` variant sets `background-color: transparent
|
|
317
|
+
// !important`, which would otherwise swallow the colored fill. When
|
|
318
|
+
// no color is set, leave `variant` undefined → the neutral text look.
|
|
319
|
+
variant: baseBg ? VARIANT.FLAT : void 0,
|
|
314
320
|
color: props.color,
|
|
315
321
|
bgColor: baseBg,
|
|
316
322
|
hoverColor: props.hoverColor,
|
|
@@ -10,7 +10,9 @@
|
|
|
10
10
|
</template>
|
|
11
11
|
|
|
12
12
|
<script lang="ts" setup>
|
|
13
|
-
import { computed, useAttrs } from "vue";
|
|
13
|
+
import { computed, inject, ref, useAttrs } from "vue";
|
|
14
|
+
import { provideDefaults } from "../../composables";
|
|
15
|
+
import { ORIGAM_DEFAULTS_KEY, ORIGAM_THEME_DEFAULTS_KEY } from "../../consts";
|
|
14
16
|
defineOptions({ inheritAttrs: false });
|
|
15
17
|
const props = defineProps({
|
|
16
18
|
theme: { type: [String, Object], required: false, default: "auto" },
|
|
@@ -23,6 +25,14 @@ const dataMode = computed(() => props.mode === "auto" ? void 0 : props.mode);
|
|
|
23
25
|
const themeProviderClasses = computed(() => {
|
|
24
26
|
return ["origam-theme-provider", attrs.class];
|
|
25
27
|
});
|
|
28
|
+
const resolveThemeDefaults = inject(ORIGAM_THEME_DEFAULTS_KEY, null);
|
|
29
|
+
const parentDefaults = inject(ORIGAM_DEFAULTS_KEY, ref({}));
|
|
30
|
+
const scopedDefaults = computed(() => {
|
|
31
|
+
if (props.theme === "auto" || !resolveThemeDefaults) return parentDefaults.value;
|
|
32
|
+
const mode = props.mode === "auto" ? void 0 : props.mode;
|
|
33
|
+
return resolveThemeDefaults(props.theme, mode);
|
|
34
|
+
});
|
|
35
|
+
provideDefaults(scopedDefaults, { scoped: true });
|
|
26
36
|
</script>
|
|
27
37
|
|
|
28
38
|
<style lang="scss" scoped>
|
|
@@ -9,8 +9,13 @@ var _code = require("../../consts/Code/code.const.cjs");
|
|
|
9
9
|
var _enums = require("../../enums/index.cjs");
|
|
10
10
|
let _highlighterPromise = null;
|
|
11
11
|
let _highlighterReady = false;
|
|
12
|
+
let _highlighterUnavailable = false;
|
|
13
|
+
let _unavailableWarned = false;
|
|
12
14
|
const _cache = /* @__PURE__ */new Map();
|
|
13
15
|
let _unsupportedLangWarned = /* @__PURE__ */new Set();
|
|
16
|
+
function escapeHtml(s) {
|
|
17
|
+
return s.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">");
|
|
18
|
+
}
|
|
14
19
|
function makeCacheKey(code, lang) {
|
|
15
20
|
return `${lang}::${code}`;
|
|
16
21
|
}
|
|
@@ -29,6 +34,7 @@ function lruSet(key, value) {
|
|
|
29
34
|
_cache.set(key, value);
|
|
30
35
|
}
|
|
31
36
|
async function loadHighlighter() {
|
|
37
|
+
if (_highlighterUnavailable) return null;
|
|
32
38
|
if (_highlighterPromise) return _highlighterPromise;
|
|
33
39
|
_highlighterPromise = (async () => {
|
|
34
40
|
const shiki = await Promise.resolve().then(() => require("shiki"));
|
|
@@ -39,7 +45,15 @@ async function loadHighlighter() {
|
|
|
39
45
|
_highlighterReady = true;
|
|
40
46
|
return highlighter;
|
|
41
47
|
})();
|
|
42
|
-
return _highlighterPromise
|
|
48
|
+
return _highlighterPromise.catch(err => {
|
|
49
|
+
_highlighterUnavailable = true;
|
|
50
|
+
_highlighterPromise = null;
|
|
51
|
+
if (!_unavailableWarned) {
|
|
52
|
+
_unavailableWarned = true;
|
|
53
|
+
console.warn("[origam] OrigamCode: `shiki` is not installed \u2014 rendering plain, unhighlighted code. Add `shiki` to your dependencies to enable syntax highlighting.", err);
|
|
54
|
+
}
|
|
55
|
+
return null;
|
|
56
|
+
});
|
|
43
57
|
}
|
|
44
58
|
function resolveLang(lang) {
|
|
45
59
|
if (_code.SUPPORTED_LANGS.includes(lang)) return lang;
|
|
@@ -56,6 +70,11 @@ function useCode() {
|
|
|
56
70
|
const cached = lruGet(key);
|
|
57
71
|
if (cached !== void 0) return cached;
|
|
58
72
|
const highlighter = await loadHighlighter();
|
|
73
|
+
if (!highlighter) {
|
|
74
|
+
const plain = escapeHtml(code);
|
|
75
|
+
lruSet(key, plain);
|
|
76
|
+
return plain;
|
|
77
|
+
}
|
|
59
78
|
const opts = {
|
|
60
79
|
lang: resolvedLang,
|
|
61
80
|
themes: {
|
|
@@ -97,6 +116,8 @@ function useCode() {
|
|
|
97
116
|
function resetCodeHighlighterForTesting() {
|
|
98
117
|
_highlighterPromise = null;
|
|
99
118
|
_highlighterReady = false;
|
|
119
|
+
_highlighterUnavailable = false;
|
|
120
|
+
_unavailableWarned = false;
|
|
100
121
|
_cache.clear();
|
|
101
122
|
_unsupportedLangWarned = /* @__PURE__ */new Set();
|
|
102
123
|
}
|
|
@@ -2,8 +2,13 @@ import { CODE_CACHE_MAX_ENTRIES, CODE_DARK_THEME as DARK_THEME, CODE_LIGHT_THEME
|
|
|
2
2
|
import { CODE_LANG } from "../../enums/index.js";
|
|
3
3
|
let _highlighterPromise = null;
|
|
4
4
|
let _highlighterReady = false;
|
|
5
|
+
let _highlighterUnavailable = false;
|
|
6
|
+
let _unavailableWarned = false;
|
|
5
7
|
const _cache = /* @__PURE__ */ new Map();
|
|
6
8
|
let _unsupportedLangWarned = /* @__PURE__ */ new Set();
|
|
9
|
+
function escapeHtml(s) {
|
|
10
|
+
return s.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">");
|
|
11
|
+
}
|
|
7
12
|
function makeCacheKey(code, lang) {
|
|
8
13
|
return `${lang}::${code}`;
|
|
9
14
|
}
|
|
@@ -22,6 +27,7 @@ function lruSet(key, value) {
|
|
|
22
27
|
_cache.set(key, value);
|
|
23
28
|
}
|
|
24
29
|
async function loadHighlighter() {
|
|
30
|
+
if (_highlighterUnavailable) return null;
|
|
25
31
|
if (_highlighterPromise) return _highlighterPromise;
|
|
26
32
|
_highlighterPromise = (async () => {
|
|
27
33
|
const shiki = await import(
|
|
@@ -35,7 +41,18 @@ async function loadHighlighter() {
|
|
|
35
41
|
_highlighterReady = true;
|
|
36
42
|
return highlighter;
|
|
37
43
|
})();
|
|
38
|
-
return _highlighterPromise
|
|
44
|
+
return _highlighterPromise.catch((err) => {
|
|
45
|
+
_highlighterUnavailable = true;
|
|
46
|
+
_highlighterPromise = null;
|
|
47
|
+
if (!_unavailableWarned) {
|
|
48
|
+
_unavailableWarned = true;
|
|
49
|
+
console.warn(
|
|
50
|
+
"[origam] OrigamCode: `shiki` is not installed \u2014 rendering plain, unhighlighted code. Add `shiki` to your dependencies to enable syntax highlighting.",
|
|
51
|
+
err
|
|
52
|
+
);
|
|
53
|
+
}
|
|
54
|
+
return null;
|
|
55
|
+
});
|
|
39
56
|
}
|
|
40
57
|
function resolveLang(lang) {
|
|
41
58
|
if (SUPPORTED_LANGS.includes(lang)) return lang;
|
|
@@ -54,6 +71,11 @@ export function useCode() {
|
|
|
54
71
|
const cached = lruGet(key);
|
|
55
72
|
if (cached !== void 0) return cached;
|
|
56
73
|
const highlighter = await loadHighlighter();
|
|
74
|
+
if (!highlighter) {
|
|
75
|
+
const plain = escapeHtml(code);
|
|
76
|
+
lruSet(key, plain);
|
|
77
|
+
return plain;
|
|
78
|
+
}
|
|
57
79
|
const opts = {
|
|
58
80
|
lang: resolvedLang,
|
|
59
81
|
themes: { light: LIGHT_THEME, dark: DARK_THEME },
|
|
@@ -84,6 +106,8 @@ export function useCode() {
|
|
|
84
106
|
export function resetCodeHighlighterForTesting() {
|
|
85
107
|
_highlighterPromise = null;
|
|
86
108
|
_highlighterReady = false;
|
|
109
|
+
_highlighterUnavailable = false;
|
|
110
|
+
_unavailableWarned = false;
|
|
87
111
|
_cache.clear();
|
|
88
112
|
_unsupportedLangWarned = /* @__PURE__ */ new Set();
|
|
89
113
|
}
|
|
@@ -3,11 +3,12 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.ORIGAM_THEME_STORAGE_KEY = exports.ORIGAM_THEME_LIGHT = exports.ORIGAM_THEME_DARK = exports.ORIGAM_THEME_AUTO = exports.ORIGAM_THEME_ATTR = exports.ORIGAM_THEMES_KEY = exports.ORIGAM_NUXT_DEFAULT_THEMES = exports.ORIGAM_NUXT_DEFAULT_THEME = exports.ORIGAM_NUXT_DEFAULT_PREFIX = exports.ORIGAM_NUXT_DEFAULT_MODE_COOKIE_NAME = exports.ORIGAM_NUXT_DEFAULT_MODES = exports.ORIGAM_NUXT_DEFAULT_MODE = exports.ORIGAM_NUXT_DEFAULT_COOKIE_NAME = exports.ORIGAM_NUXT_DEFAULT_COOKIE_MAX_AGE = exports.ORIGAM_MODE_STORAGE_KEY = exports.ORIGAM_MODE_LIGHT = exports.ORIGAM_MODE_DARK = exports.ORIGAM_MODE_AUTO = exports.ORIGAM_MODE_ATTR = void 0;
|
|
6
|
+
exports.ORIGAM_THEME_STORAGE_KEY = exports.ORIGAM_THEME_LIGHT = exports.ORIGAM_THEME_DEFAULTS_KEY = exports.ORIGAM_THEME_DARK = exports.ORIGAM_THEME_AUTO = exports.ORIGAM_THEME_ATTR = exports.ORIGAM_THEMES_KEY = exports.ORIGAM_NUXT_DEFAULT_THEMES = exports.ORIGAM_NUXT_DEFAULT_THEME = exports.ORIGAM_NUXT_DEFAULT_PREFIX = exports.ORIGAM_NUXT_DEFAULT_MODE_COOKIE_NAME = exports.ORIGAM_NUXT_DEFAULT_MODES = exports.ORIGAM_NUXT_DEFAULT_MODE = exports.ORIGAM_NUXT_DEFAULT_COOKIE_NAME = exports.ORIGAM_NUXT_DEFAULT_COOKIE_MAX_AGE = exports.ORIGAM_MODE_STORAGE_KEY = exports.ORIGAM_MODE_LIGHT = exports.ORIGAM_MODE_DARK = exports.ORIGAM_MODE_AUTO = exports.ORIGAM_MODE_ATTR = void 0;
|
|
7
7
|
const ORIGAM_THEME_AUTO = exports.ORIGAM_THEME_AUTO = "auto";
|
|
8
8
|
const ORIGAM_THEME_LIGHT = exports.ORIGAM_THEME_LIGHT = "light";
|
|
9
9
|
const ORIGAM_THEME_DARK = exports.ORIGAM_THEME_DARK = "dark";
|
|
10
10
|
const ORIGAM_THEMES_KEY = exports.ORIGAM_THEMES_KEY = Symbol.for("origam:themes");
|
|
11
|
+
const ORIGAM_THEME_DEFAULTS_KEY = exports.ORIGAM_THEME_DEFAULTS_KEY = Symbol.for("origam:theme-defaults");
|
|
11
12
|
const ORIGAM_THEME_STORAGE_KEY = exports.ORIGAM_THEME_STORAGE_KEY = "origam-theme";
|
|
12
13
|
const ORIGAM_THEME_ATTR = exports.ORIGAM_THEME_ATTR = "data-theme";
|
|
13
14
|
const ORIGAM_MODE_AUTO = exports.ORIGAM_MODE_AUTO = "auto";
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { InjectionKey } from 'vue';
|
|
2
|
-
import type {
|
|
2
|
+
import type { IDefault } from '../../interfaces';
|
|
3
|
+
import type { TInstalledThemes, TModeResolved } from '../../types';
|
|
3
4
|
export declare const ORIGAM_THEME_AUTO = "auto";
|
|
4
5
|
export declare const ORIGAM_THEME_LIGHT = "light";
|
|
5
6
|
export declare const ORIGAM_THEME_DARK = "dark";
|
|
@@ -8,6 +9,18 @@ export declare const ORIGAM_THEME_DARK = "dark";
|
|
|
8
9
|
* `createOrigam({ themes })`. Read it through `useInstalledThemes()`.
|
|
9
10
|
*/
|
|
10
11
|
export declare const ORIGAM_THEMES_KEY: InjectionKey<TInstalledThemes>;
|
|
12
|
+
/**
|
|
13
|
+
* App-level provide key carrying a resolver that collapses the per-component
|
|
14
|
+
* DEFAULT PROPS (`theme.components`) for a given brand×mode into a single
|
|
15
|
+
* `IDefault` (baseline `origam` ⊕ the named brand, in install order).
|
|
16
|
+
*
|
|
17
|
+
* `createOrigam` provides the closure over the full install list;
|
|
18
|
+
* `<OrigamThemeProvider theme="<brand>">` injects it to re-apply that brand's
|
|
19
|
+
* default props to its SUB-TREE (via `provideDefaults`), so props-first theming
|
|
20
|
+
* works in a scoped sub-tree exactly as it does at the document root — not just
|
|
21
|
+
* the CSS-variable re-scoping done by `data-theme`.
|
|
22
|
+
*/
|
|
23
|
+
export declare const ORIGAM_THEME_DEFAULTS_KEY: InjectionKey<(brand: string, mode?: TModeResolved) => IDefault>;
|
|
11
24
|
export declare const ORIGAM_THEME_STORAGE_KEY = "origam-theme";
|
|
12
25
|
export declare const ORIGAM_THEME_ATTR = "data-theme";
|
|
13
26
|
export declare const ORIGAM_MODE_AUTO = "auto";
|
|
@@ -2,6 +2,7 @@ export const ORIGAM_THEME_AUTO = "auto";
|
|
|
2
2
|
export const ORIGAM_THEME_LIGHT = "light";
|
|
3
3
|
export const ORIGAM_THEME_DARK = "dark";
|
|
4
4
|
export const ORIGAM_THEMES_KEY = Symbol.for("origam:themes");
|
|
5
|
+
export const ORIGAM_THEME_DEFAULTS_KEY = Symbol.for("origam:theme-defaults");
|
|
5
6
|
export const ORIGAM_THEME_STORAGE_KEY = "origam-theme";
|
|
6
7
|
export const ORIGAM_THEME_ATTR = "data-theme";
|
|
7
8
|
export const ORIGAM_MODE_AUTO = "auto";
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { IActiveState, IAdjacentEmits, IAdjacentProps, IBorderProps, IBgColorProps, IColorProps, ICommonsComponentProps, IDensityProps, IDimensionProps, IElevationProps, IGroupEmits, IGroupItemProps, IHoverProps, ILinkProps, ILoaderProps, ILocationProps, IMarginProps, IPaddingProps, IPositionProps, IRippleProps, IRoundedProps, ISizeProps, ITagProps, ITypographyProps, IVariantProps } from '../../interfaces';
|
|
2
|
-
import type { TIcon } from '../../types';
|
|
3
|
-
import type { TStatus, TStatusPosition } from '../../types';
|
|
2
|
+
import type { TIcon, TStatus, TStatusPosition } from '../../types';
|
|
4
3
|
/** Btn needs `status` / `statusIconPosition` from IStatusProps but its own
|
|
5
4
|
* `icon` prop accepts `boolean | TIcon` (boolean = icon-only mode) which is
|
|
6
5
|
* wider than `IIconProps.icon?: TIcon`. Pulling the two status props in
|
|
@@ -7,6 +7,4 @@ export interface IDatePickerHeaderProps extends ICommonsComponentProps, IColorPr
|
|
|
7
7
|
/** Emits fired by `<OrigamDatePickerHeader>` — click on the header text.
|
|
8
8
|
* `event` is optional: the handler calls `emits('click')` without forwarding
|
|
9
9
|
* the originating MouseEvent. */
|
|
10
|
-
export
|
|
11
|
-
(e: 'click', event?: MouseEvent): void;
|
|
12
|
-
}
|
|
10
|
+
export type IDatePickerHeaderEmits = (e: 'click', event?: MouseEvent) => void;
|
package/dist/src/origam.cjs
CHANGED
|
@@ -67,6 +67,7 @@ function createOrigam(origam = {}) {
|
|
|
67
67
|
app.provide(_consts.ORIGAM_GO_TO_KEY, goTo);
|
|
68
68
|
app.provide(_consts.ORIGAM_THEMES_KEY, installedThemes);
|
|
69
69
|
app.provide(_consts.ORIGAM_DEFAULTS_KEY, defaultsRef);
|
|
70
|
+
app.provide(_consts.ORIGAM_THEME_DEFAULTS_KEY, (brand, mode) => activeDefaultsFor(allThemes, brand, mode));
|
|
70
71
|
if (_consts.IN_BROWSER && options.ssr) {
|
|
71
72
|
if (app.$nuxt) {
|
|
72
73
|
app.$nuxt.hook("app:suspense:resolve", () => {
|
package/dist/src/origam.js
CHANGED
|
@@ -9,6 +9,7 @@ import {
|
|
|
9
9
|
ORIGAM_GO_TO_KEY,
|
|
10
10
|
ORIGAM_ICONS_KEY,
|
|
11
11
|
ORIGAM_LOCALE_KEY,
|
|
12
|
+
ORIGAM_THEME_DEFAULTS_KEY,
|
|
12
13
|
ORIGAM_THEMES_KEY
|
|
13
14
|
} from "./consts/index.js";
|
|
14
15
|
import * as origamDirectives from "./directives/index.js";
|
|
@@ -68,6 +69,7 @@ export function createOrigam(origam = {}) {
|
|
|
68
69
|
app.provide(ORIGAM_GO_TO_KEY, goTo);
|
|
69
70
|
app.provide(ORIGAM_THEMES_KEY, installedThemes);
|
|
70
71
|
app.provide(ORIGAM_DEFAULTS_KEY, defaultsRef);
|
|
72
|
+
app.provide(ORIGAM_THEME_DEFAULTS_KEY, (brand, mode) => activeDefaultsFor(allThemes, brand, mode));
|
|
71
73
|
if (IN_BROWSER && options.ssr) {
|
|
72
74
|
if (app.$nuxt) {
|
|
73
75
|
app.$nuxt.hook("app:suspense:resolve", () => {
|