origam 2.37.18 → 2.37.20
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 +26 -0
- package/dist/src/assets/css/main.css +1 -1
- package/dist/src/assets/css/tokens/dark.css +2 -0
- package/dist/src/assets/css/tokens/light.css +1 -0
- package/dist/src/assets/scss/tokens/_dark.scss +2 -0
- package/dist/src/assets/scss/tokens/_light.scss +1 -0
- package/dist/src/components/Btn/OrigamBtn.vue +13 -11
- package/dist/src/components/Tabs/OrigamTab.vue +13 -1
- package/dist/src/components/Tabs/OrigamTabs.vue +2 -1
- package/dist/src/consts/Tabs/tabs.const.cjs +2 -1
- package/dist/src/consts/Tabs/tabs.const.d.ts +8 -0
- package/dist/src/consts/Tabs/tabs.const.js +1 -0
- package/dist/src/interfaces/Tabs/tab.interface.d.ts +2 -1
- package/dist/src/types/tokens.type.d.ts +1 -1
- package/package.json +1 -1
|
@@ -342,6 +342,7 @@
|
|
|
342
342
|
--origam-btn---box-shadow-tonal-active: var(--origam-shadow---xs);
|
|
343
343
|
--origam-btn---border-width-outlined: var(--origam-border__width---thin);
|
|
344
344
|
--origam-btn---border-width-ghost: var(--origam-border__width---thin);
|
|
345
|
+
--origam-btn---border-compensation: 0px;
|
|
345
346
|
--origam-btn---backdrop-filter-ghost: blur(8px);
|
|
346
347
|
--origam-btn---transition-duration: var(--origam-motion__duration---slow);
|
|
347
348
|
--origam-btn---transition-easing: var(--origam-motion__easing---standard);
|
|
@@ -3368,6 +3369,7 @@
|
|
|
3368
3369
|
--origam-btn---box-shadow-tonal-active: var(--origam-shadow---xs);
|
|
3369
3370
|
--origam-btn---border-width-outlined: var(--origam-border__width---thin);
|
|
3370
3371
|
--origam-btn---border-width-ghost: var(--origam-border__width---thin);
|
|
3372
|
+
--origam-btn---border-compensation: 0px;
|
|
3371
3373
|
--origam-btn---backdrop-filter-ghost: blur(8px);
|
|
3372
3374
|
--origam-btn---transition-duration: var(--origam-motion__duration---slow);
|
|
3373
3375
|
--origam-btn---transition-easing: var(--origam-motion__easing---standard);
|
|
@@ -242,6 +242,7 @@
|
|
|
242
242
|
--origam-btn---box-shadow-tonal-active: var(--origam-shadow---xs);
|
|
243
243
|
--origam-btn---border-width-outlined: var(--origam-border__width---thin);
|
|
244
244
|
--origam-btn---border-width-ghost: var(--origam-border__width---thin);
|
|
245
|
+
--origam-btn---border-compensation: 0px;
|
|
245
246
|
--origam-btn---backdrop-filter-ghost: blur(8px);
|
|
246
247
|
--origam-btn---transition-duration: var(--origam-motion__duration---slow);
|
|
247
248
|
--origam-btn---transition-easing: var(--origam-motion__easing---standard);
|
|
@@ -342,6 +342,7 @@
|
|
|
342
342
|
--origam-btn---box-shadow-tonal-active: var(--origam-shadow---xs);
|
|
343
343
|
--origam-btn---border-width-outlined: var(--origam-border__width---thin);
|
|
344
344
|
--origam-btn---border-width-ghost: var(--origam-border__width---thin);
|
|
345
|
+
--origam-btn---border-compensation: 0px;
|
|
345
346
|
--origam-btn---backdrop-filter-ghost: blur(8px);
|
|
346
347
|
--origam-btn---transition-duration: var(--origam-motion__duration---slow);
|
|
347
348
|
--origam-btn---transition-easing: var(--origam-motion__easing---standard);
|
|
@@ -3368,6 +3369,7 @@
|
|
|
3368
3369
|
--origam-btn---box-shadow-tonal-active: var(--origam-shadow---xs);
|
|
3369
3370
|
--origam-btn---border-width-outlined: var(--origam-border__width---thin);
|
|
3370
3371
|
--origam-btn---border-width-ghost: var(--origam-border__width---thin);
|
|
3372
|
+
--origam-btn---border-compensation: 0px;
|
|
3371
3373
|
--origam-btn---backdrop-filter-ghost: blur(8px);
|
|
3372
3374
|
--origam-btn---transition-duration: var(--origam-motion__duration---slow);
|
|
3373
3375
|
--origam-btn---transition-easing: var(--origam-motion__easing---standard);
|
|
@@ -242,6 +242,7 @@
|
|
|
242
242
|
--origam-btn---box-shadow-tonal-active: var(--origam-shadow---xs);
|
|
243
243
|
--origam-btn---border-width-outlined: var(--origam-border__width---thin);
|
|
244
244
|
--origam-btn---border-width-ghost: var(--origam-border__width---thin);
|
|
245
|
+
--origam-btn---border-compensation: 0px;
|
|
245
246
|
--origam-btn---backdrop-filter-ghost: blur(8px);
|
|
246
247
|
--origam-btn---transition-duration: var(--origam-motion__duration---slow);
|
|
247
248
|
--origam-btn---transition-easing: var(--origam-motion__easing---standard);
|
|
@@ -497,7 +497,7 @@ defineExpose({
|
|
|
497
497
|
// plus que `padding-inline`, sans quoi leur shorthand `padding: 0 …`
|
|
498
498
|
// remettrait ce bloc a zero.
|
|
499
499
|
padding-block: var(--origam-btn---padding-block, 0);
|
|
500
|
-
padding-inline: calc(16px + var(--origam-btn---density-padding-x, 0px));
|
|
500
|
+
padding-inline: calc(16px + var(--origam-btn---density-padding-x, 0px) - var(--origam-btn---border-compensation, 0px));
|
|
501
501
|
|
|
502
502
|
width: var(--origam-btn---width, auto);
|
|
503
503
|
min-width: calc(var(--origam-btn---min-width, 64px) + var(--origam-btn---density, 0px));
|
|
@@ -592,7 +592,7 @@ defineExpose({
|
|
|
592
592
|
--origam-btn---height: var(--origam-btn---height-xs, 20px);
|
|
593
593
|
--origam-btn---font-size: 0.625rem;
|
|
594
594
|
--origam-btn---min-width: 36px;
|
|
595
|
-
padding-inline: calc(var(--origam-btn---padding-xs, 8px) + var(--origam-btn---density-padding-x, 0px));
|
|
595
|
+
padding-inline: calc(var(--origam-btn---padding-xs, 8px) + var(--origam-btn---density-padding-x, 0px) - var(--origam-btn---border-compensation, 0px));
|
|
596
596
|
|
|
597
597
|
:deep(.origam-icon) {
|
|
598
598
|
--origam-btn---font-size: 16px;
|
|
@@ -603,7 +603,7 @@ defineExpose({
|
|
|
603
603
|
--origam-btn---height: var(--origam-btn---height-sm, 28px);
|
|
604
604
|
--origam-btn---font-size: 0.75rem;
|
|
605
605
|
--origam-btn---min-width: 50px;
|
|
606
|
-
padding-inline: calc(var(--origam-btn---padding-sm, 12px) + var(--origam-btn---density-padding-x, 0px));
|
|
606
|
+
padding-inline: calc(var(--origam-btn---padding-sm, 12px) + var(--origam-btn---density-padding-x, 0px) - var(--origam-btn---border-compensation, 0px));
|
|
607
607
|
|
|
608
608
|
:deep(.origam-icon) {
|
|
609
609
|
--origam-btn---font-size: 20px;
|
|
@@ -611,7 +611,7 @@ defineExpose({
|
|
|
611
611
|
}
|
|
612
612
|
|
|
613
613
|
&--size-default {
|
|
614
|
-
padding-inline: calc(var(--origam-btn---padding-md, 16px) + var(--origam-btn---density-padding-x, 0px));
|
|
614
|
+
padding-inline: calc(var(--origam-btn---padding-md, 16px) + var(--origam-btn---density-padding-x, 0px) - var(--origam-btn---border-compensation, 0px));
|
|
615
615
|
|
|
616
616
|
:deep(.origam-icon) {
|
|
617
617
|
--origam-btn---font-size: 24px;
|
|
@@ -622,7 +622,7 @@ defineExpose({
|
|
|
622
622
|
--origam-btn---height: var(--origam-btn---height-lg, 44px);
|
|
623
623
|
--origam-btn---font-size: 1rem;
|
|
624
624
|
--origam-btn---min-width: 78px;
|
|
625
|
-
padding-inline: calc(var(--origam-btn---padding-lg, 20px) + var(--origam-btn---density-padding-x, 0px));
|
|
625
|
+
padding-inline: calc(var(--origam-btn---padding-lg, 20px) + var(--origam-btn---density-padding-x, 0px) - var(--origam-btn---border-compensation, 0px));
|
|
626
626
|
|
|
627
627
|
:deep(.origam-icon) {
|
|
628
628
|
--origam-btn---font-size: 28px;
|
|
@@ -633,7 +633,7 @@ defineExpose({
|
|
|
633
633
|
--origam-btn---height: var(--origam-btn---height-xl, 52px);
|
|
634
634
|
--origam-btn---font-size: 1.125rem;
|
|
635
635
|
--origam-btn---min-width: 92px;
|
|
636
|
-
padding-inline: calc(var(--origam-btn---padding-xl, 24px) + var(--origam-btn---density-padding-x, 0px));
|
|
636
|
+
padding-inline: calc(var(--origam-btn---padding-xl, 24px) + var(--origam-btn---density-padding-x, 0px) - var(--origam-btn---border-compensation, 0px));
|
|
637
637
|
|
|
638
638
|
:deep(.origam-icon) {
|
|
639
639
|
--origam-btn---font-size: 32px;
|
|
@@ -834,6 +834,7 @@ defineExpose({
|
|
|
834
834
|
}
|
|
835
835
|
|
|
836
836
|
&--variant-outlined {
|
|
837
|
+
--origam-btn---border-compensation: var(--origam-btn---border-width-outlined, var(--origam-border__width---thin));
|
|
837
838
|
background-color: transparent !important;
|
|
838
839
|
border-width: var(--origam-btn---border-width-outlined, var(--origam-border__width---thin));
|
|
839
840
|
border-style: solid;
|
|
@@ -903,6 +904,7 @@ defineExpose({
|
|
|
903
904
|
// survol : changement de rendu, pas correction. Ils restent dormants —
|
|
904
905
|
// meme arbitrage.
|
|
905
906
|
&--variant-ghost {
|
|
907
|
+
--origam-btn---border-compensation: var(--origam-btn---border-width-ghost, var(--origam-border__width---thin));
|
|
906
908
|
background-color: var(
|
|
907
909
|
--origam-btn---background-color-ghost,
|
|
908
910
|
color-mix(in srgb, currentColor 12%, transparent)
|
|
@@ -1065,35 +1067,35 @@ defineExpose({
|
|
|
1065
1067
|
--origam-btn---height: 56px;
|
|
1066
1068
|
font-size: 0.625rem;
|
|
1067
1069
|
min-width: 56px;
|
|
1068
|
-
padding-inline: calc(12px + var(--origam-btn---density-padding-x, 0px));
|
|
1070
|
+
padding-inline: calc(12px + var(--origam-btn---density-padding-x, 0px) - var(--origam-btn---border-compensation, 0px));
|
|
1069
1071
|
}
|
|
1070
1072
|
|
|
1071
1073
|
&#{$this}--size-small {
|
|
1072
1074
|
--origam-btn---height: 64px;
|
|
1073
1075
|
font-size: 0.75rem;
|
|
1074
1076
|
min-width: 64px;
|
|
1075
|
-
padding-inline: calc(14px + var(--origam-btn---density-padding-x, 0px));
|
|
1077
|
+
padding-inline: calc(14px + var(--origam-btn---density-padding-x, 0px) - var(--origam-btn---border-compensation, 0px));
|
|
1076
1078
|
}
|
|
1077
1079
|
|
|
1078
1080
|
&#{$this}--size-default {
|
|
1079
1081
|
--origam-btn---height: 72px;
|
|
1080
1082
|
font-size: 0.875rem;
|
|
1081
1083
|
min-width: 72px;
|
|
1082
|
-
padding-inline: calc(16px + var(--origam-btn---density-padding-x, 0px));
|
|
1084
|
+
padding-inline: calc(16px + var(--origam-btn---density-padding-x, 0px) - var(--origam-btn---border-compensation, 0px));
|
|
1083
1085
|
}
|
|
1084
1086
|
|
|
1085
1087
|
&#{$this}--size-large {
|
|
1086
1088
|
--origam-btn---height: 80px;
|
|
1087
1089
|
font-size: 1rem;
|
|
1088
1090
|
min-width: 80px;
|
|
1089
|
-
padding-inline: calc(18px + var(--origam-btn---density-padding-x, 0px));
|
|
1091
|
+
padding-inline: calc(18px + var(--origam-btn---density-padding-x, 0px) - var(--origam-btn---border-compensation, 0px));
|
|
1090
1092
|
}
|
|
1091
1093
|
|
|
1092
1094
|
&#{$this}--size-x-large {
|
|
1093
1095
|
--origam-btn---height: 88px;
|
|
1094
1096
|
font-size: 1.125rem;
|
|
1095
1097
|
min-width: 88px;
|
|
1096
|
-
padding-inline: calc(20px + var(--origam-btn---density-padding-x, 0px));
|
|
1098
|
+
padding-inline: calc(20px + var(--origam-btn---density-padding-x, 0px) - var(--origam-btn---border-compensation, 0px));
|
|
1097
1099
|
}
|
|
1098
1100
|
|
|
1099
1101
|
&#{$this}--density-comfortable {
|
|
@@ -74,8 +74,9 @@ import { useProps } from "../../composables/Commons/props.composable";
|
|
|
74
74
|
import { useStyle } from "../../composables/Commons/style.composable";
|
|
75
75
|
import { useTypography } from "../../composables/Commons/typography.composable";
|
|
76
76
|
import vContrast from "../../directives/Contrast/contrast.directive";
|
|
77
|
+
import { intentBgExpr, intentFgExpr, isIntent } from "../../utils/Commons/color.util";
|
|
77
78
|
import { getUid } from "../../utils/Commons/getCurrentInstance.util";
|
|
78
|
-
import { ORIGAM_TABS_KEY, ORIGAM_TAB_PANELS_LINK_KEY } from "../../consts/Tabs/tabs.const";
|
|
79
|
+
import { ORIGAM_TABS_COLOR_KEY, ORIGAM_TABS_KEY, ORIGAM_TAB_PANELS_LINK_KEY } from "../../consts/Tabs/tabs.const";
|
|
79
80
|
const props = defineProps({
|
|
80
81
|
tag: { type: String, required: false, default: "button" },
|
|
81
82
|
text: { type: String, required: false, default: "" },
|
|
@@ -87,6 +88,7 @@ const props = defineProps({
|
|
|
87
88
|
value: { type: null, required: false, default: void 0 },
|
|
88
89
|
disabled: { type: Boolean, required: false },
|
|
89
90
|
selectedClass: { type: String, required: false },
|
|
91
|
+
color: { type: [String, Object, Boolean, null], required: false, skipCheck: true },
|
|
90
92
|
fontSize: { type: null, required: false },
|
|
91
93
|
fontWeight: { type: null, required: false },
|
|
92
94
|
letterSpacing: { type: null, required: false },
|
|
@@ -144,9 +146,19 @@ const handleClick = (event) => {
|
|
|
144
146
|
};
|
|
145
147
|
const hasIndicator = computed(() => props.variant === "underline");
|
|
146
148
|
const { typographyStyles } = useTypography(props, "tabs__item");
|
|
149
|
+
const tabsColor = inject(ORIGAM_TABS_COLOR_KEY, void 0);
|
|
150
|
+
const pillsIntent = computed(() => {
|
|
151
|
+
const color = props.color || tabsColor?.value;
|
|
152
|
+
return typeof color === "string" && isIntent(color) ? color : void 0;
|
|
153
|
+
});
|
|
154
|
+
const pillsColorStyles = computed(() => pillsIntent.value ? {
|
|
155
|
+
"--origam-tabs__item--pills--active---background-color": intentBgExpr(pillsIntent.value, "default"),
|
|
156
|
+
"--origam-tabs__item--pills--active---color": intentFgExpr(pillsIntent.value, "default")
|
|
157
|
+
} : void 0);
|
|
147
158
|
const tabStyles = computed(() => {
|
|
148
159
|
return [
|
|
149
160
|
typographyStyles.value,
|
|
161
|
+
pillsColorStyles.value,
|
|
150
162
|
props.style
|
|
151
163
|
];
|
|
152
164
|
});
|
|
@@ -29,7 +29,7 @@ import { usePassedProps } from "../../composables/Commons/passedProps.composable
|
|
|
29
29
|
import { useProps } from "../../composables/Commons/props.composable";
|
|
30
30
|
import { useRounded } from "../../composables/Commons/rounded.composable";
|
|
31
31
|
import { useStyle } from "../../composables/Commons/style.composable";
|
|
32
|
-
import { ORIGAM_TABS_KEY, ORIGAM_TAB_PANELS_KEY, ORIGAM_TAB_PANELS_LINK_KEY } from "../../consts/Tabs/tabs.const";
|
|
32
|
+
import { ORIGAM_TABS_COLOR_KEY, ORIGAM_TABS_KEY, ORIGAM_TAB_PANELS_KEY, ORIGAM_TAB_PANELS_LINK_KEY } from "../../consts/Tabs/tabs.const";
|
|
33
33
|
import { omitUndefined } from "../../utils/Commons/commons.util";
|
|
34
34
|
import { DENSITY } from "../../enums/Commons/density.enum";
|
|
35
35
|
import { DIRECTION } from "../../enums/Commons/direction.enum";
|
|
@@ -86,6 +86,7 @@ const slotDefaults = computed(() => ({
|
|
|
86
86
|
fixed: wasPropPassed("fixed") ? props.fixed : void 0
|
|
87
87
|
})
|
|
88
88
|
}));
|
|
89
|
+
provide(ORIGAM_TABS_COLOR_KEY, toRef(props, "color"));
|
|
89
90
|
const ariaOrientation = computed(() => props.direction === DIRECTION.VERTICAL ? "vertical" : "horizontal");
|
|
90
91
|
const focusTab = (id2) => {
|
|
91
92
|
if (!rootRef.value) return;
|
|
@@ -3,8 +3,9 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.ORIGAM_TAB_PANELS_LINK_KEY = exports.ORIGAM_TAB_PANELS_KEY = exports.ORIGAM_TAB_PANELS_CTX_KEY = exports.ORIGAM_TABS_LINK_KEY = exports.ORIGAM_TABS_KEY = void 0;
|
|
6
|
+
exports.ORIGAM_TAB_PANELS_LINK_KEY = exports.ORIGAM_TAB_PANELS_KEY = exports.ORIGAM_TAB_PANELS_CTX_KEY = exports.ORIGAM_TABS_LINK_KEY = exports.ORIGAM_TABS_KEY = exports.ORIGAM_TABS_COLOR_KEY = void 0;
|
|
7
7
|
const ORIGAM_TABS_KEY = exports.ORIGAM_TABS_KEY = /* @__PURE__ */Symbol.for("origam:tabs");
|
|
8
|
+
const ORIGAM_TABS_COLOR_KEY = exports.ORIGAM_TABS_COLOR_KEY = /* @__PURE__ */Symbol.for("origam:tabs-color");
|
|
8
9
|
const ORIGAM_TAB_PANELS_KEY = exports.ORIGAM_TAB_PANELS_KEY = /* @__PURE__ */Symbol.for("origam:tab-panels");
|
|
9
10
|
const ORIGAM_TAB_PANELS_CTX_KEY = exports.ORIGAM_TAB_PANELS_CTX_KEY = /* @__PURE__ */Symbol.for("origam:tab-panels-ctx");
|
|
10
11
|
const ORIGAM_TAB_PANELS_LINK_KEY = exports.ORIGAM_TAB_PANELS_LINK_KEY = /* @__PURE__ */Symbol.for("origam:tab-panels-link");
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { InjectionKey, Ref } from 'vue';
|
|
2
|
+
import type { TColor } from '../../types/Commons/color.type';
|
|
2
3
|
import type { IGroupProvide } from '../../interfaces/Commons/group.interface';
|
|
3
4
|
import type { ITabPanelsProvide } from '../../interfaces/Tabs/tab-panels.interface';
|
|
4
5
|
/**
|
|
@@ -9,6 +10,13 @@ import type { ITabPanelsProvide } from '../../interfaces/Tabs/tab-panels.interfa
|
|
|
9
10
|
* its items with the outer group.
|
|
10
11
|
*/
|
|
11
12
|
export declare const ORIGAM_TABS_KEY: InjectionKey<IGroupProvide>;
|
|
13
|
+
/*********************************************************
|
|
14
|
+
* ORIGAM_TABS_COLOR_KEY (#1253)
|
|
15
|
+
*
|
|
16
|
+
* @description
|
|
17
|
+
* `<OrigamTabs>` `color`, provided reactively so each `<OrigamTab>` can paint its pills active surface without a forwarded default.
|
|
18
|
+
********************************************************/
|
|
19
|
+
export declare const ORIGAM_TABS_COLOR_KEY: InjectionKey<Ref<TColor | undefined>>;
|
|
12
20
|
/**
|
|
13
21
|
* Injection key shared by `<OrigamTabPanels>` (provider) and
|
|
14
22
|
* `<OrigamTabPanel>` (consumer). The panels group is kept distinct
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export const ORIGAM_TABS_KEY = /* @__PURE__ */ Symbol.for("origam:tabs");
|
|
2
|
+
export const ORIGAM_TABS_COLOR_KEY = /* @__PURE__ */ Symbol.for("origam:tabs-color");
|
|
2
3
|
export const ORIGAM_TAB_PANELS_KEY = /* @__PURE__ */ Symbol.for("origam:tab-panels");
|
|
3
4
|
export const ORIGAM_TAB_PANELS_CTX_KEY = /* @__PURE__ */ Symbol.for("origam:tab-panels-ctx");
|
|
4
5
|
export const ORIGAM_TAB_PANELS_LINK_KEY = /* @__PURE__ */ Symbol.for("origam:tab-panels-link");
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { IAdjacentProps } from '../Commons/adjacent.interface';
|
|
2
|
+
import type { IColorProps } from '../Commons/color.interface';
|
|
2
3
|
import type { ICommonsComponentProps, ITagProps } from '../Commons/commons.interface';
|
|
3
4
|
import type { IGroupEmits, IGroupItemProps } from '../Commons/group.interface';
|
|
4
5
|
import type { ITypographyProps } from '../Commons/typography.interface';
|
|
@@ -25,7 +26,7 @@ import type { TTabVariant } from '../../types/Tabs/tab.type';
|
|
|
25
26
|
* `lineHeight` is intentionally excluded — the SCSS hard-codes `line-height: 1`
|
|
26
27
|
* with no CSS-var hook.
|
|
27
28
|
*/
|
|
28
|
-
export interface ITabProps extends ICommonsComponentProps, ITagProps, IGroupItemProps, Pick<ITypographyProps, 'fontSize' | 'fontWeight' | 'letterSpacing'>, IAdjacentProps {
|
|
29
|
+
export interface ITabProps extends ICommonsComponentProps, ITagProps, IGroupItemProps, IColorProps, Pick<ITypographyProps, 'fontSize' | 'fontWeight' | 'letterSpacing'>, IAdjacentProps {
|
|
29
30
|
tag?: string;
|
|
30
31
|
/** Text label — used when the `default` slot is not provided. */
|
|
31
32
|
text?: string;
|