origam 2.18.20 → 2.19.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/CHANGELOG.md +125 -0
- package/dist/src/assets/css/main.css +1 -1
- package/dist/src/assets/css/tokens/dark.css +0 -6
- package/dist/src/assets/css/tokens/light.css +0 -3
- package/dist/src/assets/scss/tokens/_dark.scss +0 -6
- package/dist/src/assets/scss/tokens/_light.scss +0 -3
- package/dist/src/components/Blockquote/OrigamBlockquote.vue +2 -1
- package/dist/src/components/Kbd/OrigamKbd.vue +23 -41
- package/dist/src/components/TextMask/OrigamTextMask.vue +2 -1
- package/dist/src/components/Title/OrigamTitle.vue +2 -1
- package/dist/src/composables/Commons/typography.composable.cjs +7 -0
- package/dist/src/composables/Commons/typography.composable.d.ts +6 -1
- package/dist/src/composables/Commons/typography.composable.js +9 -0
- package/dist/src/consts/Commons/border.const.cjs +4 -1
- package/dist/src/consts/Commons/border.const.d.ts +0 -18
- package/dist/src/consts/Commons/border.const.js +7 -2
- package/dist/src/consts/Commons/variant-preset.const.cjs +4 -1
- package/dist/src/consts/Commons/variant-preset.const.d.ts +22 -13
- package/dist/src/consts/Commons/variant-preset.const.js +4 -1
- package/dist/src/consts/Kbd/kbd.const.cjs +22 -0
- package/dist/src/consts/Kbd/kbd.const.d.ts +102 -0
- package/dist/src/consts/Kbd/kbd.const.js +16 -0
- package/dist/src/consts/index.cjs +11 -0
- package/dist/src/consts/index.d.ts +1 -0
- package/dist/src/consts/index.js +1 -0
- package/dist/src/interfaces/Commons/typography.interface.d.ts +47 -3
- package/dist/src/interfaces/Kbd/kbd.interface.d.ts +2 -1
- package/dist/src/types/tokens.type.d.ts +1 -1
- package/package.json +1 -1
|
@@ -2506,11 +2506,8 @@
|
|
|
2506
2506
|
--origam-kbd---font-size-lg: var(--origam-font__size---lg);
|
|
2507
2507
|
--origam-kbd---font-size-xl: var(--origam-font__size---xl);
|
|
2508
2508
|
--origam-kbd__filled---background-color: var(--origam-color__surface---raised);
|
|
2509
|
-
--origam-kbd__filled---border-width: var(--origam-border__width---thin);
|
|
2510
2509
|
--origam-kbd--outlined---background-color: rgba(0, 0, 0, 0);
|
|
2511
|
-
--origam-kbd--outlined---border-width: var(--origam-border__width---thin);
|
|
2512
2510
|
--origam-kbd__tonal---background-color: var(--origam-color__surface---sunken);
|
|
2513
|
-
--origam-kbd__tonal---border-width: var(--origam-border__width---0);
|
|
2514
2511
|
--origam-kbd__separator---color: var(--origam-color__text---secondary);
|
|
2515
2512
|
--origam-stepper---background-color: var(--origam-color__surface---default);
|
|
2516
2513
|
--origam-stepper---color: var(--origam-color__text---primary);
|
|
@@ -5526,11 +5523,8 @@
|
|
|
5526
5523
|
--origam-kbd---font-size-lg: var(--origam-font__size---lg);
|
|
5527
5524
|
--origam-kbd---font-size-xl: var(--origam-font__size---xl);
|
|
5528
5525
|
--origam-kbd__filled---background-color: var(--origam-color__surface---raised);
|
|
5529
|
-
--origam-kbd__filled---border-width: var(--origam-border__width---thin);
|
|
5530
5526
|
--origam-kbd--outlined---background-color: rgba(0, 0, 0, 0);
|
|
5531
|
-
--origam-kbd--outlined---border-width: var(--origam-border__width---thin);
|
|
5532
5527
|
--origam-kbd__tonal---background-color: var(--origam-color__surface---sunken);
|
|
5533
|
-
--origam-kbd__tonal---border-width: var(--origam-border__width---0);
|
|
5534
5528
|
--origam-kbd__separator---color: var(--origam-color__text---secondary);
|
|
5535
5529
|
--origam-stepper---background-color: var(--origam-color__surface---default);
|
|
5536
5530
|
--origam-stepper---color: var(--origam-color__text---primary);
|
|
@@ -2422,11 +2422,8 @@
|
|
|
2422
2422
|
--origam-kbd---font-size-lg: var(--origam-font__size---lg);
|
|
2423
2423
|
--origam-kbd---font-size-xl: var(--origam-font__size---xl);
|
|
2424
2424
|
--origam-kbd__filled---background-color: var(--origam-color__surface---raised);
|
|
2425
|
-
--origam-kbd__filled---border-width: var(--origam-border__width---thin);
|
|
2426
2425
|
--origam-kbd--outlined---background-color: rgba(0, 0, 0, 0);
|
|
2427
|
-
--origam-kbd--outlined---border-width: var(--origam-border__width---thin);
|
|
2428
2426
|
--origam-kbd__tonal---background-color: var(--origam-color__surface---sunken);
|
|
2429
|
-
--origam-kbd__tonal---border-width: var(--origam-border__width---0);
|
|
2430
2427
|
--origam-kbd__separator---color: var(--origam-color__text---secondary);
|
|
2431
2428
|
--origam-stepper---background-color: var(--origam-color__surface---default);
|
|
2432
2429
|
--origam-stepper---color: var(--origam-color__text---primary);
|
|
@@ -2506,11 +2506,8 @@
|
|
|
2506
2506
|
--origam-kbd---font-size-lg: var(--origam-font__size---lg);
|
|
2507
2507
|
--origam-kbd---font-size-xl: var(--origam-font__size---xl);
|
|
2508
2508
|
--origam-kbd__filled---background-color: var(--origam-color__surface---raised);
|
|
2509
|
-
--origam-kbd__filled---border-width: var(--origam-border__width---thin);
|
|
2510
2509
|
--origam-kbd--outlined---background-color: rgba(0, 0, 0, 0);
|
|
2511
|
-
--origam-kbd--outlined---border-width: var(--origam-border__width---thin);
|
|
2512
2510
|
--origam-kbd__tonal---background-color: var(--origam-color__surface---sunken);
|
|
2513
|
-
--origam-kbd__tonal---border-width: var(--origam-border__width---0);
|
|
2514
2511
|
--origam-kbd__separator---color: var(--origam-color__text---secondary);
|
|
2515
2512
|
--origam-stepper---background-color: var(--origam-color__surface---default);
|
|
2516
2513
|
--origam-stepper---color: var(--origam-color__text---primary);
|
|
@@ -5526,11 +5523,8 @@
|
|
|
5526
5523
|
--origam-kbd---font-size-lg: var(--origam-font__size---lg);
|
|
5527
5524
|
--origam-kbd---font-size-xl: var(--origam-font__size---xl);
|
|
5528
5525
|
--origam-kbd__filled---background-color: var(--origam-color__surface---raised);
|
|
5529
|
-
--origam-kbd__filled---border-width: var(--origam-border__width---thin);
|
|
5530
5526
|
--origam-kbd--outlined---background-color: rgba(0, 0, 0, 0);
|
|
5531
|
-
--origam-kbd--outlined---border-width: var(--origam-border__width---thin);
|
|
5532
5527
|
--origam-kbd__tonal---background-color: var(--origam-color__surface---sunken);
|
|
5533
|
-
--origam-kbd__tonal---border-width: var(--origam-border__width---0);
|
|
5534
5528
|
--origam-kbd__separator---color: var(--origam-color__text---secondary);
|
|
5535
5529
|
--origam-stepper---background-color: var(--origam-color__surface---default);
|
|
5536
5530
|
--origam-stepper---color: var(--origam-color__text---primary);
|
|
@@ -2422,11 +2422,8 @@
|
|
|
2422
2422
|
--origam-kbd---font-size-lg: var(--origam-font__size---lg);
|
|
2423
2423
|
--origam-kbd---font-size-xl: var(--origam-font__size---xl);
|
|
2424
2424
|
--origam-kbd__filled---background-color: var(--origam-color__surface---raised);
|
|
2425
|
-
--origam-kbd__filled---border-width: var(--origam-border__width---thin);
|
|
2426
2425
|
--origam-kbd--outlined---background-color: rgba(0, 0, 0, 0);
|
|
2427
|
-
--origam-kbd--outlined---border-width: var(--origam-border__width---thin);
|
|
2428
2426
|
--origam-kbd__tonal---background-color: var(--origam-color__surface---sunken);
|
|
2429
|
-
--origam-kbd__tonal---border-width: var(--origam-border__width---0);
|
|
2430
2427
|
--origam-kbd__separator---color: var(--origam-color__text---secondary);
|
|
2431
2428
|
--origam-stepper---background-color: var(--origam-color__surface---default);
|
|
2432
2429
|
--origam-stepper---color: var(--origam-color__text---primary);
|
|
@@ -113,7 +113,8 @@ const props = defineProps({
|
|
|
113
113
|
fontSize: { type: null, required: false },
|
|
114
114
|
fontWeight: { type: null, required: false },
|
|
115
115
|
lineHeight: { type: null, required: false },
|
|
116
|
-
letterSpacing: { type: null, required: false }
|
|
116
|
+
letterSpacing: { type: null, required: false },
|
|
117
|
+
fontStyle: { type: String, required: false }
|
|
117
118
|
});
|
|
118
119
|
defineEmits([]);
|
|
119
120
|
defineSlots();
|
|
@@ -9,14 +9,17 @@
|
|
|
9
9
|
<slot/>
|
|
10
10
|
</template>
|
|
11
11
|
|
|
12
|
-
<template v-else-if="
|
|
12
|
+
<template v-else-if="hasCombination">
|
|
13
13
|
<template
|
|
14
14
|
v-for="(key, index) in combination"
|
|
15
15
|
:key="index"
|
|
16
16
|
>
|
|
17
|
-
<kbd
|
|
17
|
+
<kbd
|
|
18
|
+
class="origam-kbd__key"
|
|
19
|
+
:style="surfaceStyles"
|
|
20
|
+
>{{ key }}</kbd>
|
|
18
21
|
<span
|
|
19
|
-
v-if="index <
|
|
22
|
+
v-if="index < lastKeyIndex"
|
|
20
23
|
class="origam-kbd__separator"
|
|
21
24
|
aria-hidden="true"
|
|
22
25
|
>{{ separator }}</span>
|
|
@@ -31,6 +34,7 @@
|
|
|
31
34
|
import vContrast from "../../directives/Contrast/contrast.directive";
|
|
32
35
|
import { useBorder } from "../../composables/Commons/border.composable";
|
|
33
36
|
import { useBothColor } from "../../composables/Commons/bothColor.composable";
|
|
37
|
+
import { useElevation } from "../../composables/Commons/elevation.composable";
|
|
34
38
|
import { useProps } from "../../composables/Commons/props.composable";
|
|
35
39
|
import { useRounded } from "../../composables/Commons/rounded.composable";
|
|
36
40
|
import { useSize } from "../../composables/Commons/size.composable";
|
|
@@ -61,6 +65,7 @@ const props = defineProps({
|
|
|
61
65
|
borderRightColor: { type: [String, Object, Boolean, null], required: false, skipCheck: true },
|
|
62
66
|
borderBottomColor: { type: [String, Object, Boolean, null], required: false, skipCheck: true },
|
|
63
67
|
borderLeftColor: { type: [String, Object, Boolean, null], required: false, skipCheck: true },
|
|
68
|
+
elevation: { type: [Number, String], required: false },
|
|
64
69
|
rounded: { type: [Boolean, Number, String, null], required: false, skipCheck: true },
|
|
65
70
|
roundedTopRight: { type: [Boolean, Number, String], required: false },
|
|
66
71
|
roundedTopLeft: { type: [Boolean, Number, String], required: false },
|
|
@@ -76,19 +81,30 @@ defineSlots();
|
|
|
76
81
|
const { sizeClasses, sizeStyles } = useSize(props);
|
|
77
82
|
const { roundedClasses, roundedStyles } = useRounded(props);
|
|
78
83
|
const { borderClasses, borderStyles } = useBorder(props);
|
|
84
|
+
const { elevationClasses, elevationStyles } = useElevation(props);
|
|
79
85
|
const { typographyStyles } = useTypography(props, "kbd");
|
|
80
86
|
const { colorClasses, colorStyles } = useBothColor(toRef(props, "bgColor"), toRef(props, "color"));
|
|
87
|
+
const hasCombination = computed(() => !!props.combination && props.combination.length > 0);
|
|
88
|
+
const lastKeyIndex = computed(() => (props.combination?.length ?? 0) - 1);
|
|
89
|
+
const surfaceStyles = computed(() => {
|
|
90
|
+
return [
|
|
91
|
+
borderStyles.value,
|
|
92
|
+
colorStyles.value,
|
|
93
|
+
elevationStyles.value
|
|
94
|
+
];
|
|
95
|
+
});
|
|
81
96
|
const kbdClasses = computed(() => {
|
|
82
97
|
return [
|
|
83
98
|
"origam-kbd",
|
|
84
99
|
{
|
|
85
100
|
[`origam-kbd--variant-${props.variant}`]: props.variant,
|
|
86
|
-
"origam-kbd--combination":
|
|
101
|
+
"origam-kbd--combination": hasCombination.value
|
|
87
102
|
},
|
|
88
103
|
colorClasses.value,
|
|
89
104
|
sizeClasses.value,
|
|
90
105
|
roundedClasses.value,
|
|
91
106
|
borderClasses.value,
|
|
107
|
+
elevationClasses.value,
|
|
92
108
|
props.class
|
|
93
109
|
];
|
|
94
110
|
});
|
|
@@ -96,8 +112,7 @@ const kbdStyles = computed(() => {
|
|
|
96
112
|
return [
|
|
97
113
|
sizeStyles.value,
|
|
98
114
|
roundedStyles.value,
|
|
99
|
-
|
|
100
|
-
colorStyles.value,
|
|
115
|
+
hasCombination.value ? [] : surfaceStyles.value,
|
|
101
116
|
typographyStyles.value,
|
|
102
117
|
props.style
|
|
103
118
|
];
|
|
@@ -159,8 +174,9 @@ defineExpose({
|
|
|
159
174
|
|
|
160
175
|
padding-block: 0;
|
|
161
176
|
padding-inline: 0;
|
|
162
|
-
|
|
177
|
+
border-width: 0;
|
|
163
178
|
background-color: transparent;
|
|
179
|
+
border-color: transparent;
|
|
164
180
|
box-shadow: none;
|
|
165
181
|
min-width: 0;
|
|
166
182
|
}
|
|
@@ -169,40 +185,6 @@ defineExpose({
|
|
|
169
185
|
@include key-surface;
|
|
170
186
|
}
|
|
171
187
|
|
|
172
|
-
&--variant-outlined,
|
|
173
|
-
&--variant-outlined &__key {
|
|
174
|
-
--origam-kbd---background-color: var(--origam-kbd--outlined---background-color, var(--origam-color__surface---raised, #fff));
|
|
175
|
-
--origam-kbd---border-width: var(--origam-kbd--outlined---border-width, 1px);
|
|
176
|
-
--origam-kbd---box-shadow: 0 1px 0 0 color-mix(in srgb, currentColor 12%, transparent),
|
|
177
|
-
inset 0 1px 0 0 color-mix(in srgb, white 50%, transparent);
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
&--variant-filled,
|
|
181
|
-
&--variant-filled &__key {
|
|
182
|
-
--origam-kbd---background-color: var(--origam-kbd__filled---background-color, var(--origam-color__surface---overlay, #f5f5f5));
|
|
183
|
-
--origam-kbd---border-color: var(--origam-color__border---subtle, #d4d4d4);
|
|
184
|
-
--origam-kbd---border-width: var(--origam-kbd__filled---border-width, 1px);
|
|
185
|
-
--origam-kbd---box-shadow: 0 1px 2px 0 color-mix(in srgb, currentColor 18%, transparent),
|
|
186
|
-
inset 0 1px 0 0 color-mix(in srgb, white 60%, transparent);
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
&--variant-tonal,
|
|
190
|
-
&--variant-tonal &__key {
|
|
191
|
-
--origam-kbd---background-color: var(--origam-kbd__tonal---background-color, color-mix(in srgb, currentColor 8%, transparent));
|
|
192
|
-
--origam-kbd---border-color: transparent;
|
|
193
|
-
--origam-kbd---border-width: var(--origam-kbd__tonal---border-width, 0px);
|
|
194
|
-
--origam-kbd---box-shadow: none;
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
&--combination#{&}--variant-outlined,
|
|
198
|
-
&--combination#{&}--variant-filled,
|
|
199
|
-
&--combination#{&}--variant-tonal {
|
|
200
|
-
background-color: transparent;
|
|
201
|
-
border-color: transparent;
|
|
202
|
-
--origam-kbd---border-width: 0;
|
|
203
|
-
box-shadow: none;
|
|
204
|
-
}
|
|
205
|
-
|
|
206
188
|
&--size-x-small { font-size: var(--origam-kbd---font-size, var(--origam-kbd---font-size-xs, 0.625rem)); }
|
|
207
189
|
&--size-small { font-size: var(--origam-kbd---font-size, var(--origam-kbd---font-size-sm, 0.75rem)); }
|
|
208
190
|
&--size-default { font-size: var(--origam-kbd---font-size, var(--origam-kbd---font-size-md, 0.875rem)); }
|
|
@@ -33,7 +33,8 @@ const props = defineProps({
|
|
|
33
33
|
fontSize: { type: null, required: false },
|
|
34
34
|
fontWeight: { type: null, required: false },
|
|
35
35
|
lineHeight: { type: null, required: false },
|
|
36
|
-
letterSpacing: { type: null, required: false }
|
|
36
|
+
letterSpacing: { type: null, required: false },
|
|
37
|
+
fontStyle: { type: String, required: false }
|
|
37
38
|
});
|
|
38
39
|
defineEmits([]);
|
|
39
40
|
defineSlots();
|
|
@@ -66,7 +66,8 @@ const props = defineProps({
|
|
|
66
66
|
fontSize: { type: null, required: false },
|
|
67
67
|
fontWeight: { type: null, required: false },
|
|
68
68
|
lineHeight: { type: null, required: false },
|
|
69
|
-
letterSpacing: { type: null, required: false }
|
|
69
|
+
letterSpacing: { type: null, required: false },
|
|
70
|
+
fontStyle: { type: String, required: false }
|
|
70
71
|
});
|
|
71
72
|
const { filterProps } = useProps(props);
|
|
72
73
|
defineEmits([]);
|
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.useTypography = useTypography;
|
|
7
7
|
var _vue = require("vue");
|
|
8
8
|
const TYPOGRAPHY_TOKEN_MAP = [["fontFamily", "font-family", "font__family"], ["fontSize", "font-size", "font__size"], ["fontWeight", "font-weight", "font__weight"], ["lineHeight", "line-height", "font__lineHeight"], ["letterSpacing", "letter-spacing", "font__letterSpacing"]];
|
|
9
|
+
const TYPOGRAPHY_PASSTHROUGH_MAP = [["fontStyle", "font-style"]];
|
|
9
10
|
function useTypography(props, varPrefix) {
|
|
10
11
|
const typographyStyles = (0, _vue.computed)(() => {
|
|
11
12
|
const styles = {};
|
|
@@ -15,6 +16,12 @@ function useTypography(props, varPrefix) {
|
|
|
15
16
|
styles[`--origam-${varPrefix}---${cssProp}`] = `var(--origam-${tokenGroup}---${value})`;
|
|
16
17
|
}
|
|
17
18
|
}
|
|
19
|
+
for (const [propKey, cssProp] of TYPOGRAPHY_PASSTHROUGH_MAP) {
|
|
20
|
+
const value = props[propKey];
|
|
21
|
+
if (value) {
|
|
22
|
+
styles[`--origam-${varPrefix}---${cssProp}`] = String(value);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
18
25
|
return Object.keys(styles).length ? styles : null;
|
|
19
26
|
});
|
|
20
27
|
return {
|
|
@@ -4,13 +4,18 @@ import type { ITypographyProps } from '../../interfaces/Commons/typography.inter
|
|
|
4
4
|
*
|
|
5
5
|
* @description
|
|
6
6
|
* Volet typographique de `useMargin`/`useBorder`/`useColor` : pour
|
|
7
|
-
* chacune des cinq `ITypographyProps` (`fontFamily`, `fontSize`,
|
|
7
|
+
* chacune des cinq `ITypographyProps` de TOKEN (`fontFamily`, `fontSize`,
|
|
8
8
|
* `fontWeight`, `lineHeight`, `letterSpacing`) que le consommateur a
|
|
9
9
|
* fixee, emet une custom property inline `--origam-{varPrefix}---{prop}`
|
|
10
10
|
* qui repointe vers le token primitif correspondant. Une prop non fixee
|
|
11
11
|
* n'emet rien — le theme/la variante du composant garde la main.
|
|
12
12
|
*
|
|
13
13
|
* @description
|
|
14
|
+
* La sixieme, `fontStyle`, passe par un canal PASSTHROUGH : sa valeur est
|
|
15
|
+
* un mot-cle CSS rendu verbatim, sans enveloppe `var()`. Voir
|
|
16
|
+
* `TYPOGRAPHY_PASSTHROUGH_MAP` pour le pourquoi.
|
|
17
|
+
*
|
|
18
|
+
* @description
|
|
14
19
|
* INLINE UNIQUEMENT (pas de classe utilitaire — `origam-utilities.css`
|
|
15
20
|
* n'a pas de famille `.origam--font-*`), et `typographyStyles` est un
|
|
16
21
|
* objet PLAT `{ '--var': valeur }` (jamais un tableau) : `useStyle()`
|
|
@@ -6,6 +6,9 @@ const TYPOGRAPHY_TOKEN_MAP = [
|
|
|
6
6
|
["lineHeight", "line-height", "font__lineHeight"],
|
|
7
7
|
["letterSpacing", "letter-spacing", "font__letterSpacing"]
|
|
8
8
|
];
|
|
9
|
+
const TYPOGRAPHY_PASSTHROUGH_MAP = [
|
|
10
|
+
["fontStyle", "font-style"]
|
|
11
|
+
];
|
|
9
12
|
export function useTypography(props, varPrefix) {
|
|
10
13
|
const typographyStyles = computed(() => {
|
|
11
14
|
const styles = {};
|
|
@@ -15,6 +18,12 @@ export function useTypography(props, varPrefix) {
|
|
|
15
18
|
styles[`--origam-${varPrefix}---${cssProp}`] = `var(--origam-${tokenGroup}---${value})`;
|
|
16
19
|
}
|
|
17
20
|
}
|
|
21
|
+
for (const [propKey, cssProp] of TYPOGRAPHY_PASSTHROUGH_MAP) {
|
|
22
|
+
const value = props[propKey];
|
|
23
|
+
if (value) {
|
|
24
|
+
styles[`--origam-${varPrefix}---${cssProp}`] = String(value);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
18
27
|
return Object.keys(styles).length ? styles : null;
|
|
19
28
|
});
|
|
20
29
|
return { typographyStyles };
|
|
@@ -5,7 +5,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.BORDER_REGEX = exports.BORDER_PROP_KEYS = exports.BORDER_POSITION_MAP = exports.BORDER_LOGICAL_AXIS_MAP = exports.BORDER_KEYWORD_WIDTH = void 0;
|
|
7
7
|
var _enums = require("../../enums/index.cjs");
|
|
8
|
-
const
|
|
8
|
+
const BORDER_STYLE_ALTERNATION = Object.values(_enums.BORDER_STYLE).join("|");
|
|
9
|
+
const BORDER_LENGTH_UNITS = "(?:px|pt|PC|in|cm|mm|em|rem|%|ex|ch|fr)?";
|
|
10
|
+
const BORDER_COLOR_GROUP = "(?<color>(?: ?(?:(?:(?:#)(?:[a-f0-9]{3}|[a-f0-9]{6}))|(?:var\\(--[^)]+\\))|(?:(?:rgb|hsl|rgba)a?\\(.*\\))|(?:[A-Za-z]+))){0,4})";
|
|
11
|
+
const BORDER_REGEX = exports.BORDER_REGEX = new RegExp(`^(?<width>(?: ?var\\(--[^)]+\\)(?= +(?:${BORDER_STYLE_ALTERNATION}))| ?(?:[0-9]+)${BORDER_LENGTH_UNITS}){0,4}) {0,1}(?<style>(?:(?: ?(?:${BORDER_STYLE_ALTERNATION}))+){0,4}) ?` + BORDER_COLOR_GROUP + "$");
|
|
9
12
|
const BORDER_POSITION_MAP = exports.BORDER_POSITION_MAP = [{
|
|
10
13
|
side: _enums.BLOCK.TOP,
|
|
11
14
|
widthProp: "borderTop",
|
|
@@ -1,23 +1,5 @@
|
|
|
1
1
|
import { BLOCK, INLINE } from '../../enums';
|
|
2
2
|
import type { TBorderLogicalAxis, TBorderWidthKeyword } from '../../types/Commons/border.type';
|
|
3
|
-
/**
|
|
4
|
-
* Parse a free-form `border` value into width / style / color groups.
|
|
5
|
-
*
|
|
6
|
-
* Accepted color forms (in alternation order — `var()` MUST come before
|
|
7
|
-
* the bare `[A-Za-z]+` branch, otherwise `var` would be eaten as a word
|
|
8
|
-
* before the parenthesis group has a chance to match):
|
|
9
|
-
*
|
|
10
|
-
* • Hex literal — `#abc` / `#aabbcc`
|
|
11
|
-
* • CSS function — `rgb(…)` / `rgba(…)` / `hsl(…)` / `hsla(…)`
|
|
12
|
-
* • CSS custom prop — `var(--origam-color__action--primary---bg)` (with optional
|
|
13
|
-
* fallback: `var(--x, fallback)`)
|
|
14
|
-
* • Named keyword — `red`, `currentColor`, `transparent`, etc.
|
|
15
|
-
*
|
|
16
|
-
* The user reported that DS-token references (`var(--…)`) silently
|
|
17
|
-
* dropped through this regex and were never emitted as `border-color`,
|
|
18
|
-
* while raw hex / named colors worked. Adding the `var()` alternative
|
|
19
|
-
* fixes the design-token path.
|
|
20
|
-
*/
|
|
21
3
|
export declare const BORDER_REGEX: RegExp;
|
|
22
4
|
/**
|
|
23
5
|
* Physical-side lookup driving the per-side border wiring (issue #215).
|
|
@@ -1,5 +1,10 @@
|
|
|
1
|
-
import { BLOCK, BORDER_LOGICAL_AXIS, INLINE } from "../../enums/index.js";
|
|
2
|
-
|
|
1
|
+
import { BLOCK, BORDER_LOGICAL_AXIS, BORDER_STYLE, INLINE } from "../../enums/index.js";
|
|
2
|
+
const BORDER_STYLE_ALTERNATION = Object.values(BORDER_STYLE).join("|");
|
|
3
|
+
const BORDER_LENGTH_UNITS = "(?:px|pt|PC|in|cm|mm|em|rem|%|ex|ch|fr)?";
|
|
4
|
+
const BORDER_COLOR_GROUP = "(?<color>(?: ?(?:(?:(?:#)(?:[a-f0-9]{3}|[a-f0-9]{6}))|(?:var\\(--[^)]+\\))|(?:(?:rgb|hsl|rgba)a?\\(.*\\))|(?:[A-Za-z]+))){0,4})";
|
|
5
|
+
export const BORDER_REGEX = new RegExp(
|
|
6
|
+
`^(?<width>(?: ?var\\(--[^)]+\\)(?= +(?:${BORDER_STYLE_ALTERNATION}))| ?(?:[0-9]+)${BORDER_LENGTH_UNITS}){0,4}) {0,1}(?<style>(?:(?: ?(?:${BORDER_STYLE_ALTERNATION}))+){0,4}) ?` + BORDER_COLOR_GROUP + "$"
|
|
7
|
+
);
|
|
3
8
|
export const BORDER_POSITION_MAP = [
|
|
4
9
|
{ side: BLOCK.TOP, widthProp: "borderTop", colorProp: "borderTopColor" },
|
|
5
10
|
{ side: INLINE.RIGHT, widthProp: "borderRight", colorProp: "borderRightColor" },
|
|
@@ -4,5 +4,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.VARIANT_PROP_KEY = exports.VARIANT_PRESETS = void 0;
|
|
7
|
+
var _kbd = require("../Kbd/kbd.const.cjs");
|
|
7
8
|
const VARIANT_PROP_KEY = exports.VARIANT_PROP_KEY = "variant";
|
|
8
|
-
const VARIANT_PRESETS = exports.VARIANT_PRESETS = {
|
|
9
|
+
const VARIANT_PRESETS = exports.VARIANT_PRESETS = {
|
|
10
|
+
"origam-kbd": _kbd.KBD_VARIANT_PRESETS
|
|
11
|
+
};
|
|
@@ -25,20 +25,23 @@ export declare const VARIANT_PROP_KEY = "variant";
|
|
|
25
25
|
* constitue pas.
|
|
26
26
|
*
|
|
27
27
|
* @description
|
|
28
|
-
* ⛔
|
|
28
|
+
* ⛔ UN SEUL COMPOSANT CONVERTI A CE JOUR — `OrigamKbd`, lot 2. Le lot 1
|
|
29
29
|
* d'ADR-005 livre le MECANISME (type partage, rang dans le resolveur,
|
|
30
|
-
* canal `theme.variants`) et aucune conversion
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
* @description
|
|
35
|
-
* - `OrigamKbd` —
|
|
36
|
-
* `key-surface` consomme sur la racine ET sur les
|
|
37
|
-
* (`&--variant-outlined &__key`).
|
|
38
|
-
*
|
|
39
|
-
*
|
|
40
|
-
*
|
|
41
|
-
*
|
|
30
|
+
* canal `theme.variants`) et aucune conversion : chaque composant arrive
|
|
31
|
+
* avec son propre lot, parce qu'aucun ne se convertit mecaniquement.
|
|
32
|
+
* Mesure a l'appui (2026-09-30), la taxonomie « famille A » de D5 est
|
|
33
|
+
* optimiste sur trois des quatre composants qu'elle liste :
|
|
34
|
+
* @description
|
|
35
|
+
* - `OrigamKbd` — FAIT (lot 2). Ses regles de variant posaient des
|
|
36
|
+
* PROPRIETES CUSTOM que `key-surface` consomme sur la racine ET sur les
|
|
37
|
+
* descendants `__key` (`&--variant-outlined &__key`). Resolu en rendant
|
|
38
|
+
* explicite ce que la CSS supposait : la surface peinte est la RACINE en
|
|
39
|
+
* forme simple et chaque `__key` en forme combinaison — les deux ne
|
|
40
|
+
* coexistent jamais — donc le composant lie les declarations de surface
|
|
41
|
+
* a cet element-la, et a lui seul. Le second point, la declaration de
|
|
42
|
+
* `key-surface` a (0,2,0) contre une classe utilitaire a (0,1,0), tombe
|
|
43
|
+
* de lui-meme : un preset porte une chaine `var(…)`, qu'`isCssColor`
|
|
44
|
+
* route vers le canal INLINE, lequel passe devant la regle scopee.
|
|
42
45
|
* - `OrigamBtnGroup` — recopie `--origam-btn-group---border-width` dans
|
|
43
46
|
* une propriete custom qui alimente un `calc()` de rayon interieur.
|
|
44
47
|
* Inexprimable en prop de racine.
|
|
@@ -56,5 +59,11 @@ export declare const VARIANT_PROP_KEY = "variant";
|
|
|
56
59
|
* theme de marque ne touche un seul token `origam-kbd` (verifie, zero
|
|
57
60
|
* occurrence sur les 8 themes), donc le zero-changement y est prouvable en
|
|
58
61
|
* isolation. `OrigamBtn` vient au lot 4.
|
|
62
|
+
*
|
|
63
|
+
* @description
|
|
64
|
+
* La mesure d'acceptation se rejoue :
|
|
65
|
+
* `pnpm -F @origam/tests audit:kbd-preset -- --json <fichier>`, puis
|
|
66
|
+
* `-- --compare <avant> <apres>`. Elle monte le composant sous les 8
|
|
67
|
+
* identites x 2 modes et lit chaque surface peinte, `__key` compris.
|
|
59
68
|
********************************************************/
|
|
60
69
|
export declare const VARIANT_PRESETS: TVariantPresetRegistry;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.KBD_VARIANT_PRESETS = void 0;
|
|
7
|
+
const KBD_VARIANT_PRESETS = exports.KBD_VARIANT_PRESETS = {
|
|
8
|
+
outlined: {
|
|
9
|
+
bgColor: "var(--origam-kbd--outlined---background-color, var(--origam-color__surface---raised, #fff))",
|
|
10
|
+
elevation: "0 1px 0 0 color-mix(in srgb, currentColor 12%, transparent), inset 0 1px 0 0 color-mix(in srgb, white 50%, transparent)"
|
|
11
|
+
},
|
|
12
|
+
filled: {
|
|
13
|
+
bgColor: "var(--origam-kbd__filled---background-color, var(--origam-color__surface---overlay, #f5f5f5))",
|
|
14
|
+
elevation: "0 1px 2px 0 color-mix(in srgb, currentColor 18%, transparent), inset 0 1px 0 0 color-mix(in srgb, white 60%, transparent)"
|
|
15
|
+
},
|
|
16
|
+
tonal: {
|
|
17
|
+
bgColor: "var(--origam-kbd__tonal---background-color, color-mix(in srgb, currentColor 8%, transparent))",
|
|
18
|
+
border: "none",
|
|
19
|
+
borderColor: "transparent",
|
|
20
|
+
elevation: "none"
|
|
21
|
+
}
|
|
22
|
+
};
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import type { IKbdProps } from '../../interfaces/Kbd/kbd.interface';
|
|
2
|
+
import type { TVariantPresets } from '../../types/Commons/variant-preset.type';
|
|
3
|
+
import type { TKbdVariant } from '../../types/Kbd/kbd.type';
|
|
4
|
+
/*********************************************************
|
|
5
|
+
* KBD_VARIANT_PRESETS
|
|
6
|
+
*
|
|
7
|
+
* @description
|
|
8
|
+
* ADR-005 D1 — le premier composant converti. Un variant de Kbd n'est plus
|
|
9
|
+
* un bloc SCSS : c'est ce sac de props, resolu au rang le plus faible de la
|
|
10
|
+
* chaine (prop du site d'appel > defaut de theme > PRESET > `withDefaults`).
|
|
11
|
+
*
|
|
12
|
+
* @description
|
|
13
|
+
* ⛔ CHAQUE VALEUR PORTE LA CHAINE `var()` QUE LA REGLE PORTAIT, jamais sa
|
|
14
|
+
* traduction en echelon semantique. Ecrire `elevation: 'xs'` au lieu de la
|
|
15
|
+
* chaine litterale reviendrait a emettre `var(--origam-shadow---xs)` et a
|
|
16
|
+
* JETER le canal `--origam-kbd--{variant}---*` par lequel une marque
|
|
17
|
+
* rehabille ses touches. Aucun des 8 themes ne touche un token
|
|
18
|
+
* `origam-kbd` aujourd'hui — c'est meme la raison pour laquelle Kbd est le
|
|
19
|
+
* pilote, le zero-changement y etant prouvable en isolation — mais le
|
|
20
|
+
* canal doit survivre a la conversion, sinon la regle ne tiendra pas sur
|
|
21
|
+
* `OrigamBtn`, dont les 8 marques redeclarent bel et bien
|
|
22
|
+
* `box-shadow-elevated`, `border-width-outlined` et `background-color-tonal`.
|
|
23
|
+
*
|
|
24
|
+
* @description
|
|
25
|
+
* ⛔ ET C'EST AUSSI CE QUI REGLE LA CASCADE. `key-surface` peint depuis une
|
|
26
|
+
* regle scopee a (0,2,0), qu'une classe utilitaire a (0,1,0) ne peut pas
|
|
27
|
+
* battre. Une valeur TOKENISEE (`bgColor: 'primary'`) partirait sur le
|
|
28
|
+
* canal classe et perdrait donc en silence. Une chaine `var(…)` est routee
|
|
29
|
+
* par `isCssColor` vers le canal « valeur custom », c'est-a-dire la
|
|
30
|
+
* declaration INLINE, qui passe devant la regle scopee. La contrainte de
|
|
31
|
+
* fidelite et la contrainte de cascade demandent la meme chose.
|
|
32
|
+
*
|
|
33
|
+
* @description
|
|
34
|
+
* Les replis de chaque chaine sont conserves tels quels. Ils sont
|
|
35
|
+
* aujourd'hui INATTEIGNABLES — `light.css` et `dark.css` declarent les six
|
|
36
|
+
* tokens de variant, et une propriete custom declaree sur `:root` herite
|
|
37
|
+
* partout, donc le second argument d'un `var()` n'est jamais atteint. Ils
|
|
38
|
+
* restent parce qu'ils sont la valeur de secours si une feuille cessait de
|
|
39
|
+
* declarer le token, et parce que le garde `ts-token-refs` exige un repli
|
|
40
|
+
* des qu'un nom ne peut pas etre borne statiquement.
|
|
41
|
+
*
|
|
42
|
+
* @description
|
|
43
|
+
* ⛔ CE QUE LA TABLE NE POSE PAS EST AUSSI IMPORTANT QUE CE QU'ELLE POSE.
|
|
44
|
+
* `outlined` ne pose aucune couleur de bordure, et `filled` non plus, alors
|
|
45
|
+
* que leurs regles en posaient une. Les deux valeurs etaient IDENTIQUES au
|
|
46
|
+
* defaut de `key-surface` — la regle de `filled` reposait
|
|
47
|
+
* `var(--origam-color__border---subtle)`, que le token
|
|
48
|
+
* `--origam-kbd---border-color` porte deja. Les inscrire ici ne serait pas
|
|
49
|
+
* neutre : un preset emet une declaration INLINE, qui passe devant le
|
|
50
|
+
* token, donc une marque redeclarant `--origam-kbd---border-color`
|
|
51
|
+
* cesserait d'atteindre ces deux variants. La table confisquerait le canal
|
|
52
|
+
* qu'elle est censee servir.
|
|
53
|
+
*
|
|
54
|
+
* @description
|
|
55
|
+
* ⛔ AUCUNE LARGEUR DE BORDURE N'EST POSEE ICI, ET LA RAISON PORTANTE EST
|
|
56
|
+
* QUE LES TROIS TOKENS DE VARIANT NE PORTAIENT AUCUNE VALEUR PROPRE :
|
|
57
|
+
* `--origam-kbd--outlined---border-width` et `__filled---border-width`
|
|
58
|
+
* valent tous deux `var(--origam-border__width---thin)`, c'est-a-dire
|
|
59
|
+
* exactement le defaut de `key-surface`, et `__tonal---border-width` vaut
|
|
60
|
+
* `var(--origam-border__width---0)`, c'est-a-dire exactement ce que le
|
|
61
|
+
* mot-cle `border: 'none'` emet via `BORDER_KEYWORD_WIDTH`. Une indirection
|
|
62
|
+
* sans valeur distincte : les trois sont donc supprimes des feuilles, ce que
|
|
63
|
+
* `token-var-channels` prescrit lui-meme pour un token que plus rien ne lit.
|
|
64
|
+
*
|
|
65
|
+
* @description
|
|
66
|
+
* ⚠️ CE PARAGRAPHE A ETE CORRIGE, et l'ecart vaut d'etre connu. Il affirmait
|
|
67
|
+
* qu'« aucune largeur ne passe par une chaine `var()` » parce que le groupe
|
|
68
|
+
* `width` de `BORDER_REGEX` n'acceptait que chiffres + unite tandis que son
|
|
69
|
+
* groupe `color` acceptait `var(--…)` — un `border="var(--…)"` matchait donc
|
|
70
|
+
* comme COULEUR. Cette moitie est CORRIGEE sur `develop` depuis `cb3c68955`
|
|
71
|
+
* (lot 5) : le groupe `width` accepte desormais un `var()`, a condition
|
|
72
|
+
* qu'un mot-cle de style le suive.
|
|
73
|
+
*
|
|
74
|
+
* @description
|
|
75
|
+
* Ce qui RESTE vrai, et qui suffit a la decision : `IBorderProps` n'expose
|
|
76
|
+
* toujours pas de `borderWidth` autonome, et une largeur `var()` CONTENANT
|
|
77
|
+
* UNE ESPACE — ce qu'est n'importe quelle chaine a repli, `var(--x, 0px)` —
|
|
78
|
+
* ne voyage QUE par une prop par cote ou d'axe. La prop globale `border`
|
|
79
|
+
* fait un `split(' ')` pour distribuer ses 1/2/4 valeurs et coupe donc la
|
|
80
|
+
* chaine en fragments invalides ; voir l'en-tete de `BORDER_REGEX` et les
|
|
81
|
+
* trois tests « path » de `border.util.spec.ts`. Un preset qui reintroduirait
|
|
82
|
+
* une largeur tokenisee devrait viser `borderLeft` / `borderBlock` / …,
|
|
83
|
+
* jamais `border`.
|
|
84
|
+
*
|
|
85
|
+
* @description
|
|
86
|
+
* Ajouter `borderWidth` a `IBorderProps` a par ailleurs ete tente et REJETE
|
|
87
|
+
* sur la mesure, independamment de la regex : 24 composants declarent
|
|
88
|
+
* `IBorderProps` sans consommer ses props autonomes, et le garde
|
|
89
|
+
* `unconsumed-props` — qui ne peut que retrecir — passait de 0 a 24
|
|
90
|
+
* nouvelles violations.
|
|
91
|
+
*
|
|
92
|
+
* @description
|
|
93
|
+
* ⚠️ `tonal` portait `box-shadow: none`, le MOT-CLE. `elevation: 'none'`
|
|
94
|
+
* emet `var(--origam-shadow---none)`, que `primitive.css` declare
|
|
95
|
+
* `0px 0px 0px 0px rgba(0,0,0,0)`. Le style calcule change donc de `none` a
|
|
96
|
+
* cette quadruple valeur — une ombre d'etendue nulle et d'alpha nul, qui ne
|
|
97
|
+
* peut peindre aucun pixel. C'est le SEUL ecart de valeur calculee du lot
|
|
98
|
+
* sur le chemin « variant nu », et il est mesure et rapporte comme tel
|
|
99
|
+
* plutot que dissimule : le canal `elevation` n'a aucun moyen d'emettre le
|
|
100
|
+
* mot-cle, `isOrigamRung` interceptant `'none'` avant tout le reste.
|
|
101
|
+
********************************************************/
|
|
102
|
+
export declare const KBD_VARIANT_PRESETS: TVariantPresets<TKbdVariant, IKbdProps>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export const KBD_VARIANT_PRESETS = {
|
|
2
|
+
outlined: {
|
|
3
|
+
bgColor: "var(--origam-kbd--outlined---background-color, var(--origam-color__surface---raised, #fff))",
|
|
4
|
+
elevation: "0 1px 0 0 color-mix(in srgb, currentColor 12%, transparent), inset 0 1px 0 0 color-mix(in srgb, white 50%, transparent)"
|
|
5
|
+
},
|
|
6
|
+
filled: {
|
|
7
|
+
bgColor: "var(--origam-kbd__filled---background-color, var(--origam-color__surface---overlay, #f5f5f5))",
|
|
8
|
+
elevation: "0 1px 2px 0 color-mix(in srgb, currentColor 18%, transparent), inset 0 1px 0 0 color-mix(in srgb, white 60%, transparent)"
|
|
9
|
+
},
|
|
10
|
+
tonal: {
|
|
11
|
+
bgColor: "var(--origam-kbd__tonal---background-color, color-mix(in srgb, currentColor 8%, transparent))",
|
|
12
|
+
border: "none",
|
|
13
|
+
borderColor: "transparent",
|
|
14
|
+
elevation: "none"
|
|
15
|
+
}
|
|
16
|
+
};
|
|
@@ -520,6 +520,17 @@ Object.keys(_itemGroup).forEach(function (key) {
|
|
|
520
520
|
}
|
|
521
521
|
});
|
|
522
522
|
});
|
|
523
|
+
var _kbd = require("./Kbd/kbd.const.cjs");
|
|
524
|
+
Object.keys(_kbd).forEach(function (key) {
|
|
525
|
+
if (key === "default" || key === "__esModule") return;
|
|
526
|
+
if (key in exports && exports[key] === _kbd[key]) return;
|
|
527
|
+
Object.defineProperty(exports, key, {
|
|
528
|
+
enumerable: true,
|
|
529
|
+
get: function () {
|
|
530
|
+
return _kbd[key];
|
|
531
|
+
}
|
|
532
|
+
});
|
|
533
|
+
});
|
|
523
534
|
var _list = require("./List/list.const.cjs");
|
|
524
535
|
Object.keys(_list).forEach(function (key) {
|
|
525
536
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -45,6 +45,7 @@ export * from './Menu/menu.const';
|
|
|
45
45
|
export * from './Commons/mdi.const';
|
|
46
46
|
export * from './Btn/btn-toggle.const';
|
|
47
47
|
export * from './ItemGroup/item-group.const';
|
|
48
|
+
export * from './Kbd/kbd.const';
|
|
48
49
|
export * from './List/list.const';
|
|
49
50
|
export * from './Progress/progress.const';
|
|
50
51
|
export * from './Parallax/parallax.const';
|
package/dist/src/consts/index.js
CHANGED
|
@@ -45,6 +45,7 @@ export * from "./Menu/menu.const.js";
|
|
|
45
45
|
export * from "./Commons/mdi.const.js";
|
|
46
46
|
export * from "./Btn/btn-toggle.const.js";
|
|
47
47
|
export * from "./ItemGroup/item-group.const.js";
|
|
48
|
+
export * from "./Kbd/kbd.const.js";
|
|
48
49
|
export * from "./List/list.const.js";
|
|
49
50
|
export * from "./Progress/progress.const.js";
|
|
50
51
|
export * from "./Parallax/parallax.const.js";
|