origam 2.37.20 → 2.37.21
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 +13 -0
- package/dist/src/components/List/OrigamList.vue +5 -1
- package/dist/src/components/List/OrigamListItem.vue +19 -1
- package/dist/src/components/List/OrigamListItemWrapper.vue +15 -0
- package/dist/src/consts/Commons/commons.const.cjs +3 -2
- package/dist/src/consts/Commons/commons.const.d.ts +11 -0
- package/dist/src/consts/Commons/commons.const.js +3 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -18,6 +18,19 @@ This project follows [Semantic Versioning](https://semver.org).
|
|
|
18
18
|
|
|
19
19
|
## [Unreleased]
|
|
20
20
|
|
|
21
|
+
## [2.37.21] - 2026-10-29
|
|
22
|
+
|
|
23
|
+
### Fixed — `OrigamListItem` : un élément-lien garde son rôle de lien (#1249)
|
|
24
|
+
|
|
25
|
+
Dans une liste, `OrigamListItem` posait le rôle publié par la liste (`listitem`) sur sa racine, quelle que soit la balise rendue. Un élément rendu en `<a href>` recevait donc `role="listitem"` et perdait son rôle implicite `link`.
|
|
26
|
+
|
|
27
|
+
- En mode liste, un élément-lien rend désormais `<div role="listitem"><a …></a></div>` (arbitrage du propriétaire). Le `<a>` reste la ligne visuelle : il garde les classes, les styles, le ripple, le tabindex, les handlers, l'état actif et les `$attrs`. Seul le rôle passe au conteneur. Hors lien (`option`, `@click` seul, `disabled`), le DOM reste plat, sans changement.
|
|
28
|
+
- Le conteneur est un composant **interne** non exporté, `components/List/OrigamListItemWrapper.vue`. C'est une fonction de rendu, seul moyen de renvoyer l'enfant sans racine ajoutée, et c'est une dérogation à `<script setup>` validée.
|
|
29
|
+
- Nouvelle liste unique `INTERNAL_COMPONENTS` (`consts/Commons/commons.const.ts`). Le catalogue du playground, la sync de la doc marketing, le test de couverture du catalogue et les gardes qui énumèrent les composants l'utilisent pour exclure les composants internes.
|
|
30
|
+
- Vérifié :
|
|
31
|
+
- TU `OrigamList.roles.spec.ts` : rôle du `<a>`, liste `list` avec N `listitem`, axe-core sans violation. 3 rouges sur le parent, 20/20 après.
|
|
32
|
+
- Les e2e de liste, menu, select et drawer sont verts. La garde `variant-pins` ne relève aucun désaccord (PR #1273).
|
|
33
|
+
|
|
21
34
|
## [2.37.20] - 2026-10-28
|
|
22
35
|
|
|
23
36
|
### Fixed — `OrigamBtn` outlined et ghost : le filet ne s'ajoute plus à la largeur (#1261)
|
|
@@ -480,7 +480,11 @@ defineExpose({
|
|
|
480
480
|
// matche jamais : le premier essai a rendu un ecart de 0px, identique
|
|
481
481
|
// a l'etat d'avant. `:deep()` pose l'attribut sur l'ANCETRE, qui lui
|
|
482
482
|
// le porte.
|
|
483
|
-
|
|
483
|
+
// #1249 — a link row sits in `.origam-list-item-wrapper`, so adjacency is read on the wrapper too.
|
|
484
|
+
:deep(.origam-list-item + .origam-list-item),
|
|
485
|
+
:deep(.origam-list-item-wrapper + .origam-list-item-wrapper > .origam-list-item),
|
|
486
|
+
:deep(.origam-list-item-wrapper + .origam-list-item),
|
|
487
|
+
:deep(.origam-list-item + .origam-list-item-wrapper > .origam-list-item) {
|
|
484
488
|
margin-block-start: var(--origam-list--nav---item-gap, 2px);
|
|
485
489
|
}
|
|
486
490
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
+
<origam-list-item-wrapper :role="wrapperRole">
|
|
2
3
|
<component
|
|
3
4
|
:is="link.tag.value"
|
|
4
5
|
:id="styleId"
|
|
@@ -7,9 +8,10 @@
|
|
|
7
8
|
:aria-selected="ariaSelected"
|
|
8
9
|
:class="listItemClasses"
|
|
9
10
|
:href="link.href.value"
|
|
10
|
-
:role="
|
|
11
|
+
:role="anchorRole"
|
|
11
12
|
:style="listItemStyles"
|
|
12
13
|
:tabindex="listItemTabIndex"
|
|
14
|
+
v-bind="$attrs"
|
|
13
15
|
@click="handleClick"
|
|
14
16
|
@keydown="handleKeyDown"
|
|
15
17
|
>
|
|
@@ -115,12 +117,14 @@
|
|
|
115
117
|
</div>
|
|
116
118
|
</slot>
|
|
117
119
|
</component>
|
|
120
|
+
</origam-list-item-wrapper>
|
|
118
121
|
</template>
|
|
119
122
|
|
|
120
123
|
<script lang="ts" setup>
|
|
121
124
|
import { computed, onBeforeMount, StyleValue, toRef, useAttrs, useSlots, watch } from "vue";
|
|
122
125
|
import OrigamAvatar from "../Avatar/OrigamAvatar.vue";
|
|
123
126
|
import OrigamIcon from "../Icon/OrigamIcon.vue";
|
|
127
|
+
import OrigamListItemWrapper from "./OrigamListItemWrapper.vue";
|
|
124
128
|
import { useAccessibleCommand } from "../../composables/Commons/accessibleCommand.composable";
|
|
125
129
|
import { useAdjacent } from "../../composables/Commons/adjacent.composable";
|
|
126
130
|
import { useBothColor } from "../../composables/Commons/bothColor.composable";
|
|
@@ -139,6 +143,7 @@ import vRipple from "../../directives/Ripple/ripple.directive";
|
|
|
139
143
|
import { KEYBOARD_VALUES } from "../../enums/Commons/hotkey.enum";
|
|
140
144
|
import { LIST_ITEM_ROLE } from "../../enums/List/list-item.enum";
|
|
141
145
|
const attrs = useAttrs();
|
|
146
|
+
defineOptions({ inheritAttrs: false });
|
|
142
147
|
const props = defineProps({
|
|
143
148
|
active: { type: Boolean, required: false },
|
|
144
149
|
activeClass: { type: String, required: false },
|
|
@@ -302,6 +307,15 @@ const isActive = computed(() => {
|
|
|
302
307
|
const itemRole = computed(() => {
|
|
303
308
|
return list && !isGroupActivator ? list.itemRole.value : void 0;
|
|
304
309
|
});
|
|
310
|
+
const isListitemLink = computed(() => {
|
|
311
|
+
return link.isLink.value && itemRole.value === LIST_ITEM_ROLE.LISTITEM;
|
|
312
|
+
});
|
|
313
|
+
const wrapperRole = computed(() => {
|
|
314
|
+
return isListitemLink.value ? itemRole.value : void 0;
|
|
315
|
+
});
|
|
316
|
+
const anchorRole = computed(() => {
|
|
317
|
+
return isListitemLink.value ? void 0 : itemRole.value;
|
|
318
|
+
});
|
|
305
319
|
const isOption = computed(() => {
|
|
306
320
|
return itemRole.value === LIST_ITEM_ROLE.OPTION;
|
|
307
321
|
});
|
|
@@ -666,6 +680,10 @@ defineExpose({
|
|
|
666
680
|
--origam-list-item---margin-block-end: 4px;
|
|
667
681
|
}
|
|
668
682
|
|
|
683
|
+
.origam-list-item-wrapper:not(:only-child) > & {
|
|
684
|
+
--origam-list-item---margin-block-end: 4px;
|
|
685
|
+
}
|
|
686
|
+
|
|
669
687
|
#{$this}__title {
|
|
670
688
|
--origam-list-item__title---font-size: 0.8125rem;
|
|
671
689
|
--origam-list-item__title---font-weight: 500;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import { defineComponent, h } from "vue";
|
|
3
|
+
export default defineComponent({
|
|
4
|
+
name: "OrigamListItemWrapper",
|
|
5
|
+
props: {
|
|
6
|
+
role: { type: String, default: void 0 }
|
|
7
|
+
},
|
|
8
|
+
setup(props, { slots }) {
|
|
9
|
+
return () => {
|
|
10
|
+
const child = slots.default?.();
|
|
11
|
+
return props.role ? h("div", { role: props.role, class: "origam-list-item-wrapper" }, child) : child?.[0];
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
</script>
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.SUPPORTS_TOUCH = exports.SUPPORTS_INTERSECTION = exports.SUPPORTS_EYE_DROPPER = exports.REDUCED_MOTION_QUERY = exports.REDUCED_MOTION_ANIMATION_DURATION = exports.ON_REGEX = exports.NAME_ATTR_TAGS = exports.IN_BROWSER = exports.HORIZON = exports.HISTORY = exports.EVENT_PROP = exports.DEFAULT_DOCUMENT = void 0;
|
|
6
|
+
exports.SUPPORTS_TOUCH = exports.SUPPORTS_INTERSECTION = exports.SUPPORTS_EYE_DROPPER = exports.REDUCED_MOTION_QUERY = exports.REDUCED_MOTION_ANIMATION_DURATION = exports.ON_REGEX = exports.NAME_ATTR_TAGS = exports.IN_BROWSER = exports.INTERNAL_COMPONENTS = exports.HORIZON = exports.HISTORY = exports.EVENT_PROP = exports.DEFAULT_DOCUMENT = void 0;
|
|
7
7
|
const IN_BROWSER = exports.IN_BROWSER = typeof window !== "undefined" && typeof document !== "undefined";
|
|
8
8
|
const DEFAULT_DOCUMENT = exports.DEFAULT_DOCUMENT = IN_BROWSER ? window.document : void 0;
|
|
9
9
|
const EVENT_PROP = () => [Function, Array];
|
|
@@ -16,4 +16,5 @@ const SUPPORTS_TOUCH = exports.SUPPORTS_TOUCH = IN_BROWSER && ("ontouchstart" in
|
|
|
16
16
|
const SUPPORTS_EYE_DROPPER = exports.SUPPORTS_EYE_DROPPER = IN_BROWSER && "EyeDropper" in window;
|
|
17
17
|
const REDUCED_MOTION_QUERY = exports.REDUCED_MOTION_QUERY = "(prefers-reduced-motion: reduce)";
|
|
18
18
|
const REDUCED_MOTION_ANIMATION_DURATION = exports.REDUCED_MOTION_ANIMATION_DURATION = 0.01;
|
|
19
|
-
const NAME_ATTR_TAGS = exports.NAME_ATTR_TAGS = /* @__PURE__ */new Set(["button", "fieldset", "form", "input", "output", "select", "textarea"]);
|
|
19
|
+
const NAME_ATTR_TAGS = exports.NAME_ATTR_TAGS = /* @__PURE__ */new Set(["button", "fieldset", "form", "input", "output", "select", "textarea"]);
|
|
20
|
+
const INTERNAL_COMPONENTS = exports.INTERNAL_COMPONENTS = ["OrigamListItemWrapper"];
|
|
@@ -47,3 +47,14 @@ export declare const REDUCED_MOTION_ANIMATION_DURATION = 0.01;
|
|
|
47
47
|
* on this set rather than emitting `name` unconditionally.
|
|
48
48
|
********************************************************/
|
|
49
49
|
export declare const NAME_ATTR_TAGS: ReadonlySet<string>;
|
|
50
|
+
/*********************************************************
|
|
51
|
+
* INTERNAL_COMPONENTS (#1249)
|
|
52
|
+
*
|
|
53
|
+
* @description
|
|
54
|
+
* Components that exist as `.vue` files but are NOT part of the public catalogue: never exported,
|
|
55
|
+
* never documented, never in the playground. The ONE list read by every tool that enumerates
|
|
56
|
+
* `components/**\/*.vue` as the public surface (guards, doc sync extractor, playground catalogue).
|
|
57
|
+
* `scripts/guards/lib/components.mjs` reads this array literal as text: keep it a plain array of
|
|
58
|
+
* string literals.
|
|
59
|
+
********************************************************/
|
|
60
|
+
export declare const INTERNAL_COMPONENTS: readonly ["OrigamListItemWrapper"];
|