origam 2.45.0 → 2.46.1

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,28 @@ This project follows [Semantic Versioning](https://semver.org).
18
18
 
19
19
  ## [Unreleased]
20
20
 
21
+ ## [2.46.1] - 2026-11-26
22
+
23
+ ### Fixed — le reflet `wave` du squelette de `OrigamDataTable` reste dans la barre (#1090)
24
+
25
+ - Cause : la cellule `<td>` est l'hôte du squelette ; son `::after` (la barre) était réduit à la largeur de la colonne, pas le `::before` (le reflet, `inset: 0` + `translateX`), qui couvrait toute la cellule.
26
+ - Correctif (CSS seul, `OrigamDataTableRows.vue`) : le `::before` partage la boîte exacte de la barre et balaie par `background-position`. Sous `prefers-reduced-motion`, aucun reflet n'est peint. Spec : `data-table-skeleton-wave.spec.ts`.
27
+
28
+ ## [2.46.0] - 2026-11-26
29
+
30
+ ### Fixed — `TShikiHighlighter` accepte un highlighter `shiki/core` (#1136)
31
+
32
+ - Cause : `codeToHtml` y déclarait `themes?` et `defaultColor?: false | string` optionnels. Les paramètres d'une fonction étant contravariants, `{ themes?: … }` n'est pas assignable au `CodeOptionsMultipleThemes` de shiki (où `themes` est requis) : ni `createHighlighterCore` (`shiki/core`) ni même `createHighlighter` ne satisfaisaient le type, malgré la doc.
33
+ - Correctif : `themes` et `defaultColor: false` deviennent requis — `useCode()` les passe toujours. Un highlighter `shiki/core` s'utilise sans cast. Test de type : `packages/ds/src/types/Code/code.type-test.ts` (vérifié par `pnpm -F origam type-check`).
34
+
35
+ ### Fixed — `rounded` par coin : une valeur non reconnue passe verbatim, comme `padding*` (#1022)
36
+
37
+ - Cause : `resolveRoundedCornerValue` filtrait par `CUSTOM_BORDER_RADIUS_REGEX` puis jetait en silence ce qu'elle ne reconnaissait pas (`"0"` sans unité, rayon elliptique `"10px 4px"`), là où `resolveSpacingValue` renvoie la chaîne telle quelle. Désormais tout ce qui n'est pas un échelon, un nom de variante ou un nombre est émis verbatim ; `shaped` / `shaped-invert` restent `null`. Le navigateur écarte lui-même une valeur invalide.
38
+
39
+ ### Fixed — `useUnsupportedProp` voit désormais une prop morte posée par un thème (#1483)
40
+
41
+ - Cause : le prédicat était évalué dans un `watchEffect` créé dans `setup()`, donc avant le `beforeCreate` où le résolveur de thème (ADR-005) écrit `instance.props` ; une prop morte réglée par `theme.components` n'avertissait jamais. L'évaluation démarre maintenant en `onBeforeMount` (toujours réactive, dédoublonnage par (composant, prop) inchangé).
42
+
21
43
  ## [2.45.0] - 2026-11-25
22
44
 
23
45
  ### Changed — `OrigamDataList` ne peint plus de surface ; `text` optionnel sur DataTitle / DataText (#1128) — rupture assumée
@@ -465,9 +465,13 @@ defineExpose({ filterProps });
465
465
  // height a real one-line row has, and its `::after` is narrowed to the
466
466
  // bar the column would hold. Several rules compete for the `::after`
467
467
  // box, so they all live under the same selector and the same `inset`.
468
+ // The wave highlight (`::before`) shares that exact box (#1090): a
469
+ // `translateX` would carry it out of the bar into the cell, so inside
470
+ // the bar it sweeps by `background-position` instead.
468
471
  .origam-data-table-rows__skeleton-cell {
469
472
  block-size: calc(2 * var(--origam-table__cell---padding-block, 12px) + 1.5em);
470
473
 
474
+ &::before,
471
475
  &::after {
472
476
  inset-block: auto;
473
477
  inset-block-start: 50%;
@@ -479,12 +483,14 @@ defineExpose({ filterProps });
479
483
  border-radius: var(--origam-skeleton---border-radius-pill);
480
484
  }
481
485
 
486
+ &--end::before,
482
487
  &--end::after {
483
488
  inset-inline-start: auto;
484
489
  inset-inline-end: var(--origam-table__cell---padding-inline, 16px);
485
490
  inline-size: 40%;
486
491
  }
487
492
 
493
+ &--control::before,
488
494
  &--control::after {
489
495
  block-size: var(--origam-skeleton---circular-size);
490
496
  inline-size: var(--origam-skeleton---circular-size);
@@ -492,11 +498,32 @@ defineExpose({ filterProps });
492
498
  }
493
499
  }
494
500
 
501
+ tr:nth-child(2n) > .origam-data-table-rows__skeleton-cell--text::before,
495
502
  tr:nth-child(2n) > .origam-data-table-rows__skeleton-cell--text::after {
496
503
  inline-size: 52%;
497
504
  }
498
505
 
506
+ tr:nth-child(3n) > .origam-data-table-rows__skeleton-cell--text::before,
499
507
  tr:nth-child(3n) > .origam-data-table-rows__skeleton-cell--text::after {
500
508
  inline-size: 84%;
501
509
  }
510
+
511
+ @keyframes origam-data-table-skeleton-cell-wave {
512
+ from { background-position-x: 100%; }
513
+ to { background-position-x: -100%; }
514
+ }
515
+
516
+ // Gated: under reduced motion the shared `animation: none` stays in force
517
+ // and the highlight is not painted at all.
518
+ .origam-data-table-rows__skeleton-cell.origam--skeleton-wave::before {
519
+ transform: none;
520
+ background: none;
521
+ }
522
+
523
+ @media (prefers-reduced-motion: no-preference) {
524
+ .origam-data-table-rows__skeleton-cell.origam--skeleton-wave::before {
525
+ background: linear-gradient(105deg, transparent 35%, var(--origam-skeleton---highlight-color) 50%, transparent 65%) 100% 0 / 200% 100% no-repeat;
526
+ animation-name: origam-data-table-skeleton-cell-wave;
527
+ }
528
+ }
502
529
  </style>
@@ -35,15 +35,8 @@ import type { TRounded } from '../../types/Commons/rounded.type';
35
35
  * block-start inline-end — top-RIGHT in LTR. They are NOT the physical
36
36
  * clockwise order, and the two halves are not interchangeable.
37
37
  *
38
- * ⚠️ This example used to read `roundedTopLeft="0"`, and that form does
39
- * NOT work — measured: `{rounded:'lg', roundedTopLeft:'0'}` emits the
40
- * shorthand declaration ALONE. The bare string `"0"` is neither a utility
41
- * rung, nor a named variant, nor a match for `CUSTOM_BORDER_RADIUS_REGEX`
42
- * (which requires a unit), so `resolveRoundedCornerValue` returns `null`
43
- * and the corner is silently skipped. `0` (the NUMBER) and `"0px"` both
44
- * resolve to `0px`. In a template `roundedTopLeft="0"` is a string, which
45
- * is exactly the failing form — bind `:rounded-top-left="0"` or write
46
- * `"0px"`.
38
+ * Per-corner values that are not a rung pass verbatim (#1022), so
39
+ * `roundedTopLeft="0"` and `"10px 4px"` work like on `padding*`.
47
40
  *
48
41
  * ⚠️ The per-corner props are only reachable through the PROPS-OBJECT
49
42
  * overload. The `Ref` overload carries a single scalar — the `rounded`
@@ -63,7 +56,7 @@ import type { TRounded } from '../../types/Commons/rounded.type';
63
56
  * | `'4px 0 4px 0'` | inline 4-corner radii |
64
57
  *
65
58
  * Free-form strings are parsed by `BORDER_RADIUS_REGEX`. Anything that
66
- * doesn't match (and isn't a `var()`/`calc()`) is silently dropped.
59
+ * doesn't match (and isn't a `var()`/`calc()`) is silently dropped (shorthand only).
67
60
  * Accepted per-corner value forms are documented on
68
61
  * `resolveRoundedCornerValue`.
69
62
  ********************************************************/
@@ -7,9 +7,11 @@ exports.useUnsupportedProp = useUnsupportedProp;
7
7
  var _vue = require("vue");
8
8
  var _color = require("../../utils/Commons/color.util.cjs");
9
9
  function useUnsupportedProp(component, prop, reason, isPassed) {
10
- (0, _vue.watchEffect)(() => {
11
- if (isPassed()) {
12
- (0, _color.warnUnsupportedProp)(component, prop, reason);
13
- }
10
+ (0, _vue.onBeforeMount)(() => {
11
+ (0, _vue.watchEffect)(() => {
12
+ if (isPassed()) {
13
+ (0, _color.warnUnsupportedProp)(component, prop, reason);
14
+ }
15
+ });
14
16
  });
15
17
  }
@@ -25,5 +25,10 @@
25
25
  * Effet de bord utile : lire la prop dans le predicat la rend CONSOMMEE au
26
26
  * sens du garde `unconsumed-props`. La surface cesse donc d'etre comptee
27
27
  * morte, ce qui est exact — elle est desormais surveillee, pas ignoree.
28
+ *
29
+ * @description
30
+ * #1483 — l'evaluation attend `onBeforeMount` : setup() s'execute AVANT le
31
+ * `beforeCreate` ou le resolveur de theme (ADR-005) ecrit `instance.props`,
32
+ * donc une valeur posee par `theme.components` n'y serait jamais vue.
28
33
  ********************************************************/
29
34
  export declare function useUnsupportedProp(component: string, prop: string, reason: string, isPassed: () => boolean): void;
@@ -1,9 +1,11 @@
1
- import { watchEffect } from "vue";
1
+ import { onBeforeMount, watchEffect } from "vue";
2
2
  import { warnUnsupportedProp } from "../../utils/Commons/color.util.js";
3
3
  export function useUnsupportedProp(component, prop, reason, isPassed) {
4
- watchEffect(() => {
5
- if (isPassed()) {
6
- warnUnsupportedProp(component, prop, reason);
7
- }
4
+ onBeforeMount(() => {
5
+ watchEffect(() => {
6
+ if (isPassed()) {
7
+ warnUnsupportedProp(component, prop, reason);
8
+ }
9
+ });
8
10
  });
9
11
  }
@@ -25,15 +25,20 @@ export type TCodeTheme = `${CODE_THEME}`;
25
25
  * requirement for every consumer, including those who never install it.
26
26
  * Declaring the one method we use keeps the dynamic-import fallback
27
27
  * path type-safe with zero dependency on the package being present.
28
+ *
29
+ * `themes` and `defaultColor` are REQUIRED on purpose (#1136): `useCode()`
30
+ * always passes both, and an optional `themes?` is not assignable to shiki's
31
+ * `CodeOptionsMultipleThemes` (parameters are contravariant), which rejected
32
+ * every real highlighter — `createHighlighter` and `createHighlighterCore`.
28
33
  */
29
34
  export type TShikiHighlighter = {
30
35
  codeToHtml: (code: string, opts: {
31
36
  lang: string;
32
- themes?: {
37
+ themes: {
33
38
  light: string;
34
39
  dark: string;
35
40
  };
36
- defaultColor?: false | string;
41
+ defaultColor: false;
37
42
  }) => string;
38
43
  };
39
44
  /*********************************************************
@@ -30,6 +30,5 @@ function resolveRoundedCornerValue(value) {
30
30
  if (_rounded.PREDEFINED_ROUNDED.includes(trimmed)) {
31
31
  return _spacing.NAMED_RADIUS_TOKEN[trimmed] ?? null;
32
32
  }
33
- if (_rounded.CUSTOM_BORDER_RADIUS_REGEX.test(trimmed)) return trimmed;
34
- return null;
33
+ return trimmed;
35
34
  }
@@ -44,7 +44,7 @@ export declare function resolveSpacingValue(value: boolean | number | string | n
44
44
  * | `8` (number) | `"8px"` |
45
45
  * | `"md"` (utility rung) | `"var(--origam-radius---md, 8px)"` |
46
46
  * | `"large"` (named variant) | `"var(--origam-radius---xl, 16px)"` |
47
- * | `"8px"` / `"var(…)"` / `"calc(…)"` | verbatim |
47
+ * | anything else (`"8px"`, `"0"`, `"10px 4px"`, `"var(…)"`, `"calc(…)"`) | verbatim |
48
48
  * | `"shaped"` / `"shaped-invert"` | `null` — corner-asymmetric, owned by component SCSS |
49
49
  * | `true` / `false` / `""` / nullish | `null` |
50
50
  *
@@ -1,4 +1,4 @@
1
- import { CUSTOM_BORDER_RADIUS_REGEX, PREDEFINED_ROUNDED } from "../../consts/Commons/rounded.const.js";
1
+ import { PREDEFINED_ROUNDED } from "../../consts/Commons/rounded.const.js";
2
2
  import { NAMED_RADIUS_TOKEN, SPACING_SCALE_STEPS, UTILITY_RADIUS_FALLBACK } from "../../consts/Commons/spacing.const.js";
3
3
  import { convertToUnit } from "./commons.util.js";
4
4
  const SCALE_STEP_REGEX = /^\d+$/;
@@ -23,6 +23,5 @@ export function resolveRoundedCornerValue(value) {
23
23
  if (PREDEFINED_ROUNDED.includes(trimmed)) {
24
24
  return NAMED_RADIUS_TOKEN[trimmed] ?? null;
25
25
  }
26
- if (CUSTOM_BORDER_RADIUS_REGEX.test(trimmed)) return trimmed;
27
- return null;
26
+ return trimmed;
28
27
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "origam",
3
- "version": "2.45.0",
3
+ "version": "2.46.1",
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": [