origam 2.37.18 → 2.37.19

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
@@ -18,6 +18,21 @@ This project follows [Semantic Versioning](https://semver.org).
18
18
 
19
19
  ## [Unreleased]
20
20
 
21
+ ## [2.37.19] - 2026-10-28
22
+
23
+ ### Fixed — `OrigamTabs` variante `pills` : la prop `color` colore l'onglet actif (#1253)
24
+
25
+ L'onglet actif d'un `OrigamTabs` `variant="pills"` restait figé sur `action.primary`, quelle que soit la `color` passée. La cause : `OrigamTab` ne déclarait aucune prop `color`. Le transfert en props aurait de plus violé l'invariant « un parent ne transmet pas une prop que le consommateur n'a pas passée ».
26
+
27
+ - `ITabProps` étend `IColorProps`.
28
+ - `OrigamTabs` fournit sa `color` par `provide` (clé `ORIGAM_TABS_COLOR_KEY`, `consts/Tabs/tabs.const.ts`). `OrigamTab` la lit de façon réactive et pose les jetons existants `--origam-tabs__item--pills--active---background-color` / `---color` pour une intention. Sans `color`, le rendu ne change pas. Aucune prop n'est injectée sur les onglets.
29
+ - Quand `color` est passée, elle l'emporte sur ces mêmes jetons posés par un thème (la prop prime). Seules les intentions sont prises en charge.
30
+ - Vérifié :
31
+ - e2e `tabs.spec.ts` : pills avec base / success / danger donne 3 fonds actifs distincts, alors que les 3 valaient `rgb(124,58,237)` avant le correctif ;
32
+ - TU `tabs-pills-color.spec.ts` : la couleur est suivie aussi quand `color` passe d'`undefined` à une valeur ;
33
+ - `forwarded-defaults.spec.ts` est inchangé et vert ;
34
+ - le ratchet vue-tsc marketing tient son plancher (PR #1272).
35
+
21
36
  ## [2.37.18] - 2026-10-28
22
37
 
23
38
  ### Fixed — champs : la couleur et l'opacité du placeholder sont réglables par jeton (#1266)
@@ -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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "origam",
3
- "version": "2.37.18",
3
+ "version": "2.37.19",
4
4
  "type": "module",
5
5
  "description": "origam — a Vue 3 design system with multi-theme design tokens, CSS-first components and TypeScript types.",
6
6
  "keywords": [