@4sh/ui-kit 0.13.0 → 0.15.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/fesm2022/4sh-ui-kit-actions-ui-button-split.mjs +2 -2
- package/fesm2022/4sh-ui-kit-actions-ui-button-split.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-actions-ui-button.mjs +26 -2
- package/fesm2022/4sh-ui-kit-actions-ui-button.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-actions-ui-link.mjs +8 -2
- package/fesm2022/4sh-ui-kit-actions-ui-link.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-actions-ui-speed-dial.mjs +2 -2
- package/fesm2022/4sh-ui-kit-actions-ui-speed-dial.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-base-ui-image.mjs +18 -4
- package/fesm2022/4sh-ui-kit-base-ui-image.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-autocomplete.mjs +2 -2
- package/fesm2022/4sh-ui-kit-forms-ui-autocomplete.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-checkbox.mjs +2 -2
- package/fesm2022/4sh-ui-kit-forms-ui-checkbox.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-datepicker.mjs +2 -2
- package/fesm2022/4sh-ui-kit-forms-ui-datepicker.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-editor.mjs +2 -2
- package/fesm2022/4sh-ui-kit-forms-ui-editor.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-field.mjs +2 -2
- package/fesm2022/4sh-ui-kit-forms-ui-field.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-file-upload.mjs +11 -4
- package/fesm2022/4sh-ui-kit-forms-ui-file-upload.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-input-date.mjs +4 -2
- package/fesm2022/4sh-ui-kit-forms-ui-input-date.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-input-group.mjs +2 -2
- package/fesm2022/4sh-ui-kit-forms-ui-input-group.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-input-number.mjs +2 -2
- package/fesm2022/4sh-ui-kit-forms-ui-input-number.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-input-otp.mjs +2 -2
- package/fesm2022/4sh-ui-kit-forms-ui-input-otp.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-input-tags.mjs +2 -2
- package/fesm2022/4sh-ui-kit-forms-ui-input-tags.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-input.mjs +2 -2
- package/fesm2022/4sh-ui-kit-forms-ui-input.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-knob.mjs +2 -2
- package/fesm2022/4sh-ui-kit-forms-ui-knob.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-nudger.mjs +2 -2
- package/fesm2022/4sh-ui-kit-forms-ui-nudger.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-radio.mjs +2 -2
- package/fesm2022/4sh-ui-kit-forms-ui-radio.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-rating.mjs +2 -2
- package/fesm2022/4sh-ui-kit-forms-ui-rating.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-segment-control.mjs +2 -2
- package/fesm2022/4sh-ui-kit-forms-ui-segment-control.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-select.mjs +2 -2
- package/fesm2022/4sh-ui-kit-forms-ui-select.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-slider.mjs +2 -2
- package/fesm2022/4sh-ui-kit-forms-ui-slider.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-swatch-picker.mjs +2 -2
- package/fesm2022/4sh-ui-kit-forms-ui-swatch-picker.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-toggle-block.mjs +2 -2
- package/fesm2022/4sh-ui-kit-forms-ui-toggle-block.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-toggle-button.mjs +2 -2
- package/fesm2022/4sh-ui-kit-forms-ui-toggle-button.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-toggle.mjs +2 -2
- package/fesm2022/4sh-ui-kit-forms-ui-toggle.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-informative-ui-accordion.mjs +2 -2
- package/fesm2022/4sh-ui-kit-informative-ui-accordion.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-informative-ui-alert.mjs +2 -2
- package/fesm2022/4sh-ui-kit-informative-ui-alert.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-informative-ui-badge.mjs +6 -0
- package/fesm2022/4sh-ui-kit-informative-ui-badge.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-informative-ui-chip.mjs +2 -2
- package/fesm2022/4sh-ui-kit-informative-ui-chip.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-informative-ui-progress-bar.mjs +2 -2
- package/fesm2022/4sh-ui-kit-informative-ui-progress-bar.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-informative-ui-toast.mjs +2 -2
- package/fesm2022/4sh-ui-kit-informative-ui-toast.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-informative-ui-tooltip.mjs +2 -2
- package/fesm2022/4sh-ui-kit-informative-ui-tooltip.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-layout-ui-bottom-sheet.mjs +2 -2
- package/fesm2022/4sh-ui-kit-layout-ui-bottom-sheet.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-layout-ui-drawer.mjs +2 -2
- package/fesm2022/4sh-ui-kit-layout-ui-drawer.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-layout-ui-modal.mjs +2 -2
- package/fesm2022/4sh-ui-kit-layout-ui-modal.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-navigation-ui-bottom-tab-bar.mjs +4 -4
- package/fesm2022/4sh-ui-kit-navigation-ui-bottom-tab-bar.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-navigation-ui-breadcrumb.mjs +2 -2
- package/fesm2022/4sh-ui-kit-navigation-ui-breadcrumb.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-navigation-ui-menu.mjs +2 -2
- package/fesm2022/4sh-ui-kit-navigation-ui-menu.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-navigation-ui-sidebar.mjs +4 -4
- package/fesm2022/4sh-ui-kit-navigation-ui-sidebar.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-navigation-ui-stepper.mjs +103 -12
- package/fesm2022/4sh-ui-kit-navigation-ui-stepper.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-navigation-ui-tabs.mjs +6 -6
- package/fesm2022/4sh-ui-kit-navigation-ui-tabs.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-table-ui-paginator.mjs +5 -2
- package/fesm2022/4sh-ui-kit-table-ui-paginator.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-table-ui-table.mjs +2 -2
- package/fesm2022/4sh-ui-kit-table-ui-table.mjs.map +1 -1
- package/mcp/data/component-api.json +11710 -0
- package/mcp/data/text-search-docs.json +92 -72
- package/mcp/data/ui-config.json +6772 -26
- package/mcp/index.js +24 -2
- package/mcp/package.json +1 -1
- package/package.json +1 -1
- package/styles/base/_motion.scss +16 -16
- package/styles/component-vars.scss +7 -5
- package/styles/generated/_tokens-motion.scss +54 -0
- package/styles/generated/_tokens-transitions.scss +4 -4
- package/styles/generated/_tokens.scss +1 -0
- package/styles/settings/_ui-config.scss +23 -6
- package/styles/utils/_mixins.scss +28 -5
- package/styles/utils/_motion.scss +3 -3
- package/styles.css +1 -1
- package/types/4sh-ui-kit-actions-ui-button.d.ts +24 -0
- package/types/4sh-ui-kit-actions-ui-link.d.ts +6 -0
- package/types/4sh-ui-kit-base-ui-image.d.ts +14 -0
- package/types/4sh-ui-kit-forms-ui-file-upload.d.ts +7 -0
- package/types/4sh-ui-kit-forms-ui-input-date.d.ts +2 -0
- package/types/4sh-ui-kit-informative-ui-badge.d.ts +6 -0
- package/types/4sh-ui-kit-navigation-ui-stepper.d.ts +42 -3
- package/types/4sh-ui-kit-table-ui-paginator.d.ts +3 -0
package/mcp/index.js
CHANGED
|
@@ -31299,6 +31299,13 @@ var uiConfigCache;
|
|
|
31299
31299
|
function loadSearchDocs() {
|
|
31300
31300
|
return searchDocsCache ??= readJson("text-search-docs.json");
|
|
31301
31301
|
}
|
|
31302
|
+
var componentApiCache;
|
|
31303
|
+
function loadComponentApi() {
|
|
31304
|
+
return componentApiCache ??= readJson("component-api.json");
|
|
31305
|
+
}
|
|
31306
|
+
function getEntryApi(docSource) {
|
|
31307
|
+
return loadComponentApi().entries[docSource.slice(0, docSource.lastIndexOf("/"))];
|
|
31308
|
+
}
|
|
31302
31309
|
function loadUiConfig() {
|
|
31303
31310
|
return uiConfigCache ??= readJson("ui-config.json");
|
|
31304
31311
|
}
|
|
@@ -31312,6 +31319,10 @@ function listComponentNames() {
|
|
|
31312
31319
|
}
|
|
31313
31320
|
return [...names].sort();
|
|
31314
31321
|
}
|
|
31322
|
+
function getComponentHooks(name) {
|
|
31323
|
+
const status = loadUiConfig().hookStatus ?? {};
|
|
31324
|
+
return Object.entries(status).filter(([, s]) => s.entryPoint.endsWith(`/${name}`)).map(([hook, { entryPoint: _entryPoint, ...rest }]) => ({ name: hook, ...rest }));
|
|
31325
|
+
}
|
|
31315
31326
|
function getComponentSections(name) {
|
|
31316
31327
|
const { docs } = loadSearchDocs();
|
|
31317
31328
|
return docs.filter((doc) => doc.source.startsWith("projects/ui-kit/") && doc.name === name);
|
|
@@ -31332,7 +31343,8 @@ function listComponents() {
|
|
|
31332
31343
|
}
|
|
31333
31344
|
|
|
31334
31345
|
// projects/ui-kit-mcp/src/tools/get-component-doc.ts
|
|
31335
|
-
var GET_COMPONENT_DOC_DESCRIPTION = "Retourne la doc compl\xE8te d'un composant `ui-*` :
|
|
31346
|
+
var GET_COMPONENT_DOC_DESCRIPTION = "Retourne la doc compl\xE8te d'un composant `ui-*` : `api`, lue dans ses sources (sous-chemin d'import, puis par classe export\xE9e son s\xE9lecteur et ses inputs et outputs : type, valeurs admises, requis, d\xE9faut, description), puis les sections de sa page Storybook (theming, tailles, \xE9tats, exemples). Le champ `theming.hooks` dit, pour chaque hook `--ui-*`, s\u2019il peut aller dans un th\xE8me global (`themable`) et sinon pourquoi. C'est la source de v\xE9rit\xE9 : pr\xE9f\xE9rer cet outil \xE0 la lecture des fichiers sources (`.ts`/`.html`/`.scss`) pour conna\xEEtre l'API d'un composant.";
|
|
31347
|
+
var THEMING_NOTE = "Un hook `themable` se pose o\xF9 l\u2019on veut, `:root` compris : il figure dans `component-vars.scss`, le th\xE8me global du kit. Les autres ne vont pas dans un th\xE8me global, `exclusion` et `reason` disent pourquoi. Un hook `perVariant` a un d\xE9faut par variante rendue (`defaults`) : pos\xE9 sur `:root`, il donnerait la m\xEAme valeur \xE0 toutes. Il se pose sur l\u2019\xE9l\xE9ment ou sur une zone.";
|
|
31336
31348
|
function getComponentDoc(name) {
|
|
31337
31349
|
const sections = getComponentSections(name);
|
|
31338
31350
|
if (sections.length === 0) {
|
|
@@ -31359,12 +31371,22 @@ function getComponentDoc(name) {
|
|
|
31359
31371
|
section: s.section ?? "Overview",
|
|
31360
31372
|
text: s.text
|
|
31361
31373
|
}));
|
|
31374
|
+
const hooks = getComponentHooks(name);
|
|
31375
|
+
const api = getEntryApi(sections[0].source);
|
|
31362
31376
|
return {
|
|
31363
31377
|
content: [
|
|
31364
31378
|
{
|
|
31365
31379
|
type: "text",
|
|
31366
31380
|
text: JSON.stringify(
|
|
31367
|
-
{
|
|
31381
|
+
{
|
|
31382
|
+
name,
|
|
31383
|
+
title: sections[0].title,
|
|
31384
|
+
source: sections[0].source,
|
|
31385
|
+
...api ? { api } : {},
|
|
31386
|
+
sections: bySection,
|
|
31387
|
+
// Absent d'un manifeste antérieur à `hookStatus` : rien à affirmer.
|
|
31388
|
+
...hooks.length ? { theming: { note: THEMING_NOTE, hooks } } : {}
|
|
31389
|
+
},
|
|
31368
31390
|
null,
|
|
31369
31391
|
2
|
|
31370
31392
|
)
|
package/mcp/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@4sh/ui-kit-mcp",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.15.0",
|
|
4
4
|
"description": "MCP server exposing the @4sh/ui-kit design system (components, props, tokens, doc) to AI coding agents. Not published on its own: bundled at build time into @4sh/ui-kit (library mode) and @4sh/ui-kit-schematics (starter mode) — see scripts/mcp-bundle.build.mjs.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"engines": {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@4sh/ui-kit",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.15.0",
|
|
4
4
|
"description": "Headless Angular components from the 4SH Design System: signals + Angular CDK, styled exclusively through design tokens. Ships a companion MCP server exposing the kit catalog and doc to AI coding agents.",
|
|
5
5
|
"homepage": "https://4sh.github.io/starter-angular/?path=/docs/introduction--docs",
|
|
6
6
|
"repository": {
|
package/styles/base/_motion.scss
CHANGED
|
@@ -8,7 +8,8 @@
|
|
|
8
8
|
// Timing/easing/offset resolve from the `--ui-motion-*` custom properties
|
|
9
9
|
// (per-instance override) with the motion tokens as defaults, so a single
|
|
10
10
|
// element can be re-timed without new CSS. Globally opt out with
|
|
11
|
-
// `data-motion="off"` on <html
|
|
11
|
+
// `data-motion="off"` on <html>; the user's reduced-motion preference turns every
|
|
12
|
+
// preset into a short fade (see the end of this file).
|
|
12
13
|
//
|
|
13
14
|
// Class contract :
|
|
14
15
|
// .ui-motion-<preset>-enter → appear
|
|
@@ -19,21 +20,23 @@
|
|
|
19
20
|
@use 'sass:list';
|
|
20
21
|
@use 'utils';
|
|
21
22
|
|
|
22
|
-
// Resolved runtime values (override via the custom property, else
|
|
23
|
-
|
|
23
|
+
// Resolved runtime values (override via the custom property, else the `overlay-in`
|
|
24
|
+
// / `overlay-out` recipes). `--ui-motion-duration` retimes both directions at once.
|
|
25
|
+
$_duration-enter: var(--ui-motion-duration, #{utils.$motion-overlay-in-duration});
|
|
26
|
+
$_duration-leave: var(--ui-motion-duration, #{utils.$motion-overlay-out-duration});
|
|
24
27
|
$_delay: var(--ui-motion-delay, 0ms);
|
|
25
|
-
$_ease-enter: var(--ui-motion-easing-enter, #{utils.$motion-easing
|
|
26
|
-
$_ease-leave: var(--ui-motion-easing-leave, #{utils.$motion-easing
|
|
28
|
+
$_ease-enter: var(--ui-motion-easing-enter, #{utils.$motion-overlay-in-easing});
|
|
29
|
+
$_ease-leave: var(--ui-motion-easing-leave, #{utils.$motion-overlay-out-easing});
|
|
27
30
|
$_distance: var(--ui-motion-distance, #{utils.$motion-distance});
|
|
28
31
|
$_scale: var(--ui-motion-scale, #{utils.$motion-scale});
|
|
29
32
|
|
|
30
33
|
$_presets: fade, slide-up, slide-down, slide-left, slide-right, zoom, collapse;
|
|
31
34
|
|
|
32
35
|
@mixin _enter($name) {
|
|
33
|
-
animation: $name $_duration $_ease-enter $_delay both;
|
|
36
|
+
animation: $name $_duration-enter $_ease-enter $_delay both;
|
|
34
37
|
}
|
|
35
38
|
@mixin _leave($name) {
|
|
36
|
-
animation: $name $_duration $_ease-leave $_delay both;
|
|
39
|
+
animation: $name $_duration-leave $_ease-leave $_delay both;
|
|
37
40
|
}
|
|
38
41
|
|
|
39
42
|
// --- Enter/leave class pairs -----------------------------------------
|
|
@@ -120,17 +123,14 @@ $_presets: fade, slide-up, slide-down, slide-left, slide-right, zoom, collapse;
|
|
|
120
123
|
to { opacity: 0; grid-template-rows: 0fr; }
|
|
121
124
|
}
|
|
122
125
|
|
|
123
|
-
// ---
|
|
124
|
-
//
|
|
125
|
-
//
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
animation-duration: 0.01ms !important;
|
|
129
|
-
}
|
|
130
|
-
}
|
|
126
|
+
// --- Reduced motion ----------------------------------------------------
|
|
127
|
+
// No rule here: the OS reduced-motion setting switches the `motion` tokens to their
|
|
128
|
+
// `Reduced` mode (generated/_tokens-motion.scss). The slide distance drops to 0 and
|
|
129
|
+
// the zoom scale to 1, the recipes shorten: every preset becomes a short fade, so the
|
|
130
|
+
// change of state is still seen, without the movement.
|
|
131
131
|
|
|
132
132
|
// Explicit kit-wide kill-switch (`<html data-motion="off">`): neutralise all
|
|
133
|
-
// animations AND transitions
|
|
133
|
+
// animations AND transitions.
|
|
134
134
|
:root[data-motion='off'] {
|
|
135
135
|
&,
|
|
136
136
|
*,
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
// design token instead — it follows brand, light/dark and viewport.
|
|
12
12
|
//
|
|
13
13
|
// Generated by `pnpm docs:config`, values read from the compiled CSS — do not
|
|
14
|
-
// edit here. 1375 variables;
|
|
14
|
+
// edit here. 1375 variables; 130 more exist whose value depends on the
|
|
15
15
|
// rendered variant, listed in each component’s “Theming” section in Storybook.
|
|
16
16
|
// =====================================================================
|
|
17
17
|
|
|
@@ -34,6 +34,7 @@
|
|
|
34
34
|
--ui-button-padding-x-small: var(--units-md);
|
|
35
35
|
// Bordures & rayons
|
|
36
36
|
--ui-button-focus-ring-width: var(--ui-focus-ring-width, var(--units-2xs));
|
|
37
|
+
--ui-button-radius-default: var(--radius-sm);
|
|
37
38
|
--ui-button-radius-rounded: var(--radius-full);
|
|
38
39
|
--ui-button-stroke-width: var(--ui-control-stroke-width, var(--stroke-default));
|
|
39
40
|
// Typographie
|
|
@@ -75,7 +76,7 @@
|
|
|
75
76
|
// Couleurs
|
|
76
77
|
--ui-speed-dial-mask-background: var(--primitives-black-50);
|
|
77
78
|
// Motion
|
|
78
|
-
--ui-speed-dial-item-delay: var(--transition-fast);
|
|
79
|
+
--ui-speed-dial-item-delay: var(--motion-stagger-delay, var(--transition-fast));
|
|
79
80
|
// Divers
|
|
80
81
|
--ui-speed-dial-z-index: 10;
|
|
81
82
|
|
|
@@ -1689,6 +1690,10 @@
|
|
|
1689
1690
|
--ui-stepper-rail-surface: var(--global-border-default);
|
|
1690
1691
|
--ui-stepper-rail-surface-completed: var(--navigation-high-stroke-default);
|
|
1691
1692
|
|
|
1693
|
+
// ── ui-step-list ──
|
|
1694
|
+
// Dimensions
|
|
1695
|
+
--ui-stepper-step-min-width: 7.5rem;
|
|
1696
|
+
|
|
1692
1697
|
// ── ui-step-panel ──
|
|
1693
1698
|
// Typographie
|
|
1694
1699
|
--ui-stepper-panel-font-family: var(--fontfamily-base);
|
|
@@ -1779,9 +1784,6 @@
|
|
|
1779
1784
|
--ui-form-field-spinner-color-hover: var(--form-high-content-hover);
|
|
1780
1785
|
--ui-form-field-spinner-stroke: var(--form-high-stroke-default);
|
|
1781
1786
|
--ui-form-field-spinner-surface-hover: var(--form-high-surface-hover);
|
|
1782
|
-
// Motion
|
|
1783
|
-
--ui-control-transition-duration: var(--transition-default);
|
|
1784
|
-
--ui-control-transition-easing: var(--transition-easeinout);
|
|
1785
1787
|
// Divers
|
|
1786
1788
|
--ui-overlay-panel-shadow: var(--shadow-default-md);
|
|
1787
1789
|
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/* Generated by Style Dictionary : do not edit (run the `tokens:build` script, config in tokens.config.json). */
|
|
2
|
+
|
|
3
|
+
:root {
|
|
4
|
+
--motion-hover-duration: var(--transition-default);
|
|
5
|
+
--motion-hover-easing: var(--transition-easeinout);
|
|
6
|
+
--motion-toggle-duration: var(--transition-default);
|
|
7
|
+
--motion-toggle-easing: var(--transition-easeinout);
|
|
8
|
+
--motion-disclosure-in-duration: var(--transition-default);
|
|
9
|
+
--motion-disclosure-in-easing: var(--transition-easeout);
|
|
10
|
+
--motion-disclosure-out-duration: var(--transition-default);
|
|
11
|
+
--motion-disclosure-out-easing: var(--transition-easein);
|
|
12
|
+
--motion-overlay-in-duration: var(--transition-default);
|
|
13
|
+
--motion-overlay-in-easing: var(--transition-easeout);
|
|
14
|
+
--motion-overlay-out-duration: var(--transition-default);
|
|
15
|
+
--motion-overlay-out-easing: var(--transition-easein);
|
|
16
|
+
--motion-dialog-in-duration: var(--transition-default);
|
|
17
|
+
--motion-dialog-in-easing: var(--transition-easeout);
|
|
18
|
+
--motion-dialog-out-duration: var(--transition-default);
|
|
19
|
+
--motion-dialog-out-easing: var(--transition-easein);
|
|
20
|
+
--motion-notify-in-duration: var(--transition-default);
|
|
21
|
+
--motion-notify-in-easing: var(--transition-easeout);
|
|
22
|
+
--motion-notify-out-duration: var(--transition-default);
|
|
23
|
+
--motion-notify-out-easing: var(--transition-easein);
|
|
24
|
+
--motion-stagger-delay: var(--transition-fast);
|
|
25
|
+
--motion-slide-distance: 8px;
|
|
26
|
+
--motion-zoom-scale: 0.96;
|
|
27
|
+
}
|
|
28
|
+
@media (prefers-reduced-motion: reduce) {
|
|
29
|
+
:root {
|
|
30
|
+
--motion-hover-duration: var(--transition-default);
|
|
31
|
+
--motion-hover-easing: var(--transition-easeinout);
|
|
32
|
+
--motion-toggle-duration: var(--transition-fast);
|
|
33
|
+
--motion-toggle-easing: var(--transition-easeinout);
|
|
34
|
+
--motion-disclosure-in-duration: var(--transition-fast);
|
|
35
|
+
--motion-disclosure-in-easing: var(--transition-easeout);
|
|
36
|
+
--motion-disclosure-out-duration: var(--transition-fast);
|
|
37
|
+
--motion-disclosure-out-easing: var(--transition-easein);
|
|
38
|
+
--motion-overlay-in-duration: var(--transition-fast);
|
|
39
|
+
--motion-overlay-in-easing: var(--transition-easeout);
|
|
40
|
+
--motion-overlay-out-duration: var(--transition-fast);
|
|
41
|
+
--motion-overlay-out-easing: var(--transition-easein);
|
|
42
|
+
--motion-dialog-in-duration: var(--transition-fast);
|
|
43
|
+
--motion-dialog-in-easing: var(--transition-easeout);
|
|
44
|
+
--motion-dialog-out-duration: var(--transition-fast);
|
|
45
|
+
--motion-dialog-out-easing: var(--transition-easein);
|
|
46
|
+
--motion-notify-in-duration: var(--transition-fast);
|
|
47
|
+
--motion-notify-in-easing: var(--transition-easeout);
|
|
48
|
+
--motion-notify-out-duration: var(--transition-fast);
|
|
49
|
+
--motion-notify-out-easing: var(--transition-easein);
|
|
50
|
+
--motion-stagger-delay: 0ms;
|
|
51
|
+
--motion-slide-distance: 0px;
|
|
52
|
+
--motion-zoom-scale: 1;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
--transition-fast: 80ms;
|
|
5
5
|
--transition-default: 180ms;
|
|
6
6
|
--transition-slow: 280ms;
|
|
7
|
-
--transition-easein:
|
|
8
|
-
--transition-easeout:
|
|
9
|
-
--transition-easeinout:
|
|
10
|
-
--transition-linear:
|
|
7
|
+
--transition-easein: cubic-bezier(0.42, 0, 1, 1);
|
|
8
|
+
--transition-easeout: cubic-bezier(0, 0, 0.58, 1);
|
|
9
|
+
--transition-easeinout: cubic-bezier(0.42, 0, 0.58, 1);
|
|
10
|
+
--transition-linear: cubic-bezier(0, 0, 1, 1);
|
|
11
11
|
}
|
|
@@ -21,22 +21,39 @@
|
|
|
21
21
|
$focus-ring-width: var(--ui-focus-ring-width, var(--units-2xs)); /// Épaisseur de l'anneau de focus, pour tout le kit.
|
|
22
22
|
|
|
23
23
|
$control-stroke-width: var(--ui-control-stroke-width, var(--stroke-default)); /// Épaisseur de bordure des contrôles.
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
// --- Global : motion recipes ------------------------------------------
|
|
25
|
+
// One recipe per usage (collection `motion`), each an alias of a `--transition-*`
|
|
26
|
+
// primitive. The fallback is the primitive the kit read before the recipes: a project
|
|
27
|
+
// whose tokens predate the collection keeps its timing.
|
|
28
|
+
$motion-hover-duration: var(--motion-hover-duration, var(--transition-default)); /// Durée d'un changement d'apparence : couleur, opacité, ombre.
|
|
29
|
+
$motion-hover-easing: var(--motion-hover-easing, var(--transition-easeinout)); /// Courbe d'un changement d'apparence.
|
|
30
|
+
$motion-toggle-duration: var(--motion-toggle-duration, var(--transition-default)); /// Durée d'un déplacement entre deux états : pouce, indicateur, chevron, repli.
|
|
31
|
+
$motion-toggle-easing: var(--motion-toggle-easing, var(--transition-easeinout)); /// Courbe d'un déplacement entre deux états.
|
|
32
|
+
$motion-overlay-in-duration: var(--motion-overlay-in-duration, var(--transition-default)); /// Durée d'apparition des préréglages `ui-motion-*`.
|
|
33
|
+
$motion-overlay-in-easing: var(--motion-overlay-in-easing, var(--transition-easeout)); /// Courbe d'apparition des préréglages (décélérée).
|
|
34
|
+
$motion-overlay-out-duration: var(--motion-overlay-out-duration, var(--transition-default)); /// Durée de disparition des préréglages `ui-motion-*`.
|
|
35
|
+
$motion-overlay-out-easing: var(--motion-overlay-out-easing, var(--transition-easein)); /// Courbe de disparition des préréglages (accélérée).
|
|
36
|
+
|
|
37
|
+
$control-transition-duration: var(--ui-control-transition-duration, #{$motion-hover-duration}); /// Durée des changements d'apparence des contrôles.
|
|
38
|
+
$control-transition-easing: var(--ui-control-transition-easing, #{$motion-hover-easing}); /// Courbe des changements d'apparence des contrôles.
|
|
39
|
+
$control-motion-duration: var(--ui-control-transition-duration, #{$motion-toggle-duration}); /// Durée des déplacements des contrôles (même hook : une surcharge vaut pour les deux).
|
|
40
|
+
$control-motion-easing: var(--ui-control-transition-easing, #{$motion-toggle-easing}); /// Courbe des déplacements des contrôles.
|
|
26
41
|
|
|
27
42
|
// --- Global : motion --------------------------------------------------
|
|
28
43
|
// Shared timing for the motion system (enter/leave presets + transitions).
|
|
29
44
|
// Not hooked here: the `--ui-motion-*` custom properties already expose duration,
|
|
30
|
-
// easing, delay, distance and scale per instance (see utils/_motion.scss)
|
|
31
|
-
//
|
|
45
|
+
// easing, delay, distance and scale per instance (see utils/_motion.scss). The kit
|
|
46
|
+
// reads the recipes above; the primitives below stay for code that picks a duration
|
|
47
|
+
// or a curve itself.
|
|
32
48
|
$motion-duration-fast: var(--transition-fast); /// Durée « micro-feedback ».
|
|
33
49
|
$motion-duration-base: var(--transition-default); /// Durée par défaut (apparition, disparition, collapse).
|
|
34
50
|
$motion-duration-slow: var(--transition-slow); /// Durée « grande surface ».
|
|
35
51
|
$motion-easing-standard: var(--transition-easeinout); /// Courbe symétrique (bascules).
|
|
36
52
|
$motion-easing-enter: var(--transition-easeout); /// Courbe décélérée (apparition).
|
|
37
53
|
$motion-easing-leave: var(--transition-easein); /// Courbe accélérée (disparition).
|
|
38
|
-
$motion-distance: 0.5rem;
|
|
39
|
-
$motion-scale: 0.96;
|
|
54
|
+
$motion-distance: var(--motion-slide-distance, 0.5rem); /// Distance du glissement des presets `slide`.
|
|
55
|
+
$motion-scale: var(--motion-zoom-scale, 0.96); /// Échelle de départ / d’arrivée des presets `zoom`.
|
|
56
|
+
$motion-stagger-delay: var(--motion-stagger-delay, var(--transition-fast)); /// Décalage entre deux éléments qui apparaissent l'un après l'autre.
|
|
40
57
|
|
|
41
58
|
// --- Global : ripple ---------------------------------------------------
|
|
42
59
|
// Appearance of the press wave (base/_ripple.scss). Not hooked here: the
|
|
@@ -5,16 +5,39 @@
|
|
|
5
5
|
@use 'sass:list';
|
|
6
6
|
@use '../settings/ui-config';
|
|
7
7
|
|
|
8
|
+
/// Properties that move something: they take the `toggle` recipe, every other one
|
|
9
|
+
/// (colour, opacity, shadow) the `hover` recipe.
|
|
10
|
+
$_moving-properties: (
|
|
11
|
+
transform,
|
|
12
|
+
translate,
|
|
13
|
+
rotate,
|
|
14
|
+
scale,
|
|
15
|
+
top,
|
|
16
|
+
right,
|
|
17
|
+
bottom,
|
|
18
|
+
left,
|
|
19
|
+
inset,
|
|
20
|
+
width,
|
|
21
|
+
height,
|
|
22
|
+
inline-size,
|
|
23
|
+
block-size
|
|
24
|
+
);
|
|
25
|
+
|
|
8
26
|
/// Transition recipe (duration/easing from ui-config) for the given properties.
|
|
27
|
+
/// A property that moves something (transform, top, width…) follows the `toggle`
|
|
28
|
+
/// recipe, an appearance change (colour, opacity…) the `hover` one: the thumb of a
|
|
29
|
+
/// toggle and its colour can then be timed apart, from the tokens alone.
|
|
9
30
|
/// e.g. @include utils.control-transition(background-color, border-color);
|
|
10
31
|
@mixin control-transition($properties...) {
|
|
11
32
|
$transitions: ();
|
|
12
33
|
@each $property in $properties {
|
|
13
|
-
$
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
34
|
+
$duration: ui-config.$control-transition-duration;
|
|
35
|
+
$easing: ui-config.$control-transition-easing;
|
|
36
|
+
@if list.index($_moving-properties, $property) {
|
|
37
|
+
$duration: ui-config.$control-motion-duration;
|
|
38
|
+
$easing: ui-config.$control-motion-easing;
|
|
39
|
+
}
|
|
40
|
+
$transitions: list.append($transitions, $property $duration $easing, comma);
|
|
18
41
|
}
|
|
19
42
|
transition: $transitions;
|
|
20
43
|
}
|
|
@@ -17,15 +17,15 @@
|
|
|
17
17
|
|
|
18
18
|
/// Transition recipe timed by the motion system.
|
|
19
19
|
/// Duration/easing/delay resolve from `--ui-motion-*` (per-instance override)
|
|
20
|
-
/// falling back to the
|
|
20
|
+
/// falling back to the `toggle` recipe: an element that switches between two states.
|
|
21
21
|
/// e.g. @include utils.motion-transition(opacity, translate);
|
|
22
22
|
@mixin motion-transition($properties...) {
|
|
23
23
|
$transitions: ();
|
|
24
24
|
@each $property in $properties {
|
|
25
25
|
$transitions: list.append(
|
|
26
26
|
$transitions,
|
|
27
|
-
$property var(--ui-motion-duration, #{ui-config.$motion-duration
|
|
28
|
-
var(--ui-motion-easing, #{ui-config.$motion-easing
|
|
27
|
+
$property var(--ui-motion-duration, #{ui-config.$motion-toggle-duration})
|
|
28
|
+
var(--ui-motion-easing, #{ui-config.$motion-toggle-easing})
|
|
29
29
|
var(--ui-motion-delay, 0ms),
|
|
30
30
|
comma
|
|
31
31
|
);
|