al-design-system 1.5.0 → 1.6.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/README.md +4 -3
- package/README.pt-BR.md +4 -3
- package/dist/al.css +267 -2
- package/dist/components/stepper.css +264 -0
- package/dist/foundation.css +1 -1
- package/dist/tokens.json +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -10,7 +10,7 @@ An open-source design system, from Figma to code. Plain CSS, a little vanilla Ja
|
|
|
10
10
|
|
|
11
11
|
## What it is
|
|
12
12
|
|
|
13
|
-
- **Foundation +
|
|
13
|
+
- **Foundation + 29 components**, designed in Figma and coded from the same tokens.
|
|
14
14
|
- **Light and dark themes** built in. It follows the operating system by default, and you can force one.
|
|
15
15
|
- **Accessibility is checked by the build.** Every rendered combination (variant × state × theme) is measured for contrast against the background it actually sits on, and each component's markup contract is verified. If something fails, the build stops.
|
|
16
16
|
- **Nothing is typed by hand.** Tokens, CSS variables, `tokens.json` and the documentation tables are all generated from one source.
|
|
@@ -43,6 +43,7 @@ An open-source design system, from Figma to code. Plain CSS, a little vanilla Ja
|
|
|
43
43
|
| Navigation | Sidebar | ✓ | [guidelines](src/components/sidebar/guidelines.md) |
|
|
44
44
|
| | Breadcrumb | ✓ | [guidelines](src/components/breadcrumb/guidelines.md) |
|
|
45
45
|
| | Pagination | | [guidelines](src/components/pagination/guidelines.md) |
|
|
46
|
+
| | Stepper | | [guidelines](src/components/stepper/guidelines.md) |
|
|
46
47
|
| Feedback | Tooltip | ✓ | [guidelines](src/components/tooltip/guidelines.md) |
|
|
47
48
|
| | Toast | ✓ | [guidelines](src/components/toast/guidelines.md) |
|
|
48
49
|
| | Alert | ✓ | [guidelines](src/components/alert/guidelines.md) |
|
|
@@ -59,7 +60,7 @@ npm install al-design-system
|
|
|
59
60
|
Or straight from a CDN, pinned to a version:
|
|
60
61
|
|
|
61
62
|
```html
|
|
62
|
-
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/al-design-system@1.
|
|
63
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/al-design-system@1.6.0/dist/al.css">
|
|
63
64
|
```
|
|
64
65
|
|
|
65
66
|
Each [GitHub Release](https://github.com/guilhermedworakowski/al-design-system/releases) also carries the `dist/` folder as a zip.
|
|
@@ -68,7 +69,7 @@ Each [GitHub Release](https://github.com/guilhermedworakowski/al-design-system/r
|
|
|
68
69
|
|
|
69
70
|
| File | What it is |
|
|
70
71
|
|---|---|
|
|
71
|
-
| `al.css` | Foundation + all
|
|
72
|
+
| `al.css` | Foundation + all 29 components, in one file |
|
|
72
73
|
| `foundation.css` | Only the Foundation: color, typography, spacing, radius, icon size, elevation, focus ring and motion |
|
|
73
74
|
| `components/<name>.css` | One component (its tokens + its CSS) |
|
|
74
75
|
| `components/<name>.js` | The behavior, for the 11 components that have a script |
|
package/README.pt-BR.md
CHANGED
|
@@ -10,7 +10,7 @@ Design system open source, do Figma ao código. CSS puro, um pouco de JavaScript
|
|
|
10
10
|
|
|
11
11
|
## O que é
|
|
12
12
|
|
|
13
|
-
- **Foundation +
|
|
13
|
+
- **Foundation + 29 componentes**, desenhados no Figma e codados a partir dos mesmos tokens.
|
|
14
14
|
- **Temas claro e escuro** já incluídos. Por padrão segue o sistema operacional, e dá para forçar um.
|
|
15
15
|
- **A acessibilidade é conferida no build.** Cada combinação renderizada (variante × estado × tema) tem o contraste medido contra o fundo onde ela realmente aparece, e o contrato de marcação de cada componente é verificado. Se algo reprova, o build para.
|
|
16
16
|
- **Nada é digitado à mão.** Tokens, variáveis CSS, `tokens.json` e as tabelas da documentação saem todos de uma fonte só.
|
|
@@ -43,6 +43,7 @@ Design system open source, do Figma ao código. CSS puro, um pouco de JavaScript
|
|
|
43
43
|
| Navegação | Sidebar | ✓ | [diretrizes](src/components/sidebar/guidelines.md) |
|
|
44
44
|
| | Breadcrumb | ✓ | [diretrizes](src/components/breadcrumb/guidelines.md) |
|
|
45
45
|
| | Pagination | | [diretrizes](src/components/pagination/guidelines.md) |
|
|
46
|
+
| | Stepper | | [diretrizes](src/components/stepper/guidelines.md) |
|
|
46
47
|
| Feedback | Tooltip | ✓ | [diretrizes](src/components/tooltip/guidelines.md) |
|
|
47
48
|
| | Toast | ✓ | [diretrizes](src/components/toast/guidelines.md) |
|
|
48
49
|
| | Alert | ✓ | [diretrizes](src/components/alert/guidelines.md) |
|
|
@@ -59,7 +60,7 @@ npm install al-design-system
|
|
|
59
60
|
Ou direto de uma CDN, fixado numa versão:
|
|
60
61
|
|
|
61
62
|
```html
|
|
62
|
-
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/al-design-system@1.
|
|
63
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/al-design-system@1.6.0/dist/al.css">
|
|
63
64
|
```
|
|
64
65
|
|
|
65
66
|
Cada [Release no GitHub](https://github.com/guilhermedworakowski/al-design-system/releases) também traz a pasta `dist/` num zip.
|
|
@@ -68,7 +69,7 @@ Cada [Release no GitHub](https://github.com/guilhermedworakowski/al-design-syste
|
|
|
68
69
|
|
|
69
70
|
| Arquivo | O que é |
|
|
70
71
|
|---|---|
|
|
71
|
-
| `al.css` | Foundation + os
|
|
72
|
+
| `al.css` | Foundation + os 29 componentes, num arquivo só |
|
|
72
73
|
| `foundation.css` | Só a Foundation: cor, tipografia, espaçamento, radius, tamanho de ícone, elevação, anel de foco e motion |
|
|
73
74
|
| `components/<nome>.css` | Um componente (os tokens + o CSS dele) |
|
|
74
75
|
| `components/<nome>.js` | O comportamento, para os 11 componentes que têm script |
|
package/dist/al.css
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
/* AL Design System 1.
|
|
1
|
+
/* AL Design System 1.6.0 - Foundation + 29 components.
|
|
2
2
|
* MIT. https://github.com/guilhermedworakowski/al-design-system
|
|
3
3
|
*/
|
|
4
4
|
/* AL Design System - Foundation
|
|
5
|
-
* v1.
|
|
5
|
+
* v1.6.0 - MIT
|
|
6
6
|
* GENERATED by src/foundation/css.py. Do not edit by hand: run the script.
|
|
7
7
|
*/
|
|
8
8
|
|
|
@@ -7844,3 +7844,268 @@
|
|
|
7844
7844
|
transition: none;
|
|
7845
7845
|
}
|
|
7846
7846
|
}
|
|
7847
|
+
|
|
7848
|
+
/* AL Design System - Stepper tokens
|
|
7849
|
+
* GENERATED by src/components/stepper/tokens.py. Do not edit by hand.
|
|
7850
|
+
*
|
|
7851
|
+
* Every color is a semantic the theme switches on :root.
|
|
7852
|
+
*/
|
|
7853
|
+
|
|
7854
|
+
:root {
|
|
7855
|
+
/* color */
|
|
7856
|
+
--al-stepper-label: var(--al-text-primary);
|
|
7857
|
+
--al-stepper-label-upcoming: var(--al-text-secondary);
|
|
7858
|
+
--al-stepper-description: var(--al-text-secondary);
|
|
7859
|
+
--al-stepper-completed-bg: var(--al-bg-brand-subtle);
|
|
7860
|
+
--al-stepper-completed-border: var(--al-border-brand);
|
|
7861
|
+
--al-stepper-completed-icon: var(--al-text-brand);
|
|
7862
|
+
--al-stepper-current-bg: var(--al-bg-brand);
|
|
7863
|
+
--al-stepper-current-number: var(--al-text-on-brand);
|
|
7864
|
+
--al-stepper-upcoming-bg: var(--al-bg-surface);
|
|
7865
|
+
--al-stepper-upcoming-border: var(--al-border-strong);
|
|
7866
|
+
--al-stepper-upcoming-number: var(--al-text-secondary);
|
|
7867
|
+
--al-stepper-connector: var(--al-border-default);
|
|
7868
|
+
--al-stepper-connector-done: var(--al-border-brand);
|
|
7869
|
+
|
|
7870
|
+
/* geometry */
|
|
7871
|
+
--al-stepper-indicator-size: var(--al-space-32);
|
|
7872
|
+
--al-stepper-indicator-radius: var(--al-radius-full);
|
|
7873
|
+
--al-stepper-indicator-border-width: var(--al-border-width-1);
|
|
7874
|
+
--al-stepper-icon-size: var(--al-icon-size-16);
|
|
7875
|
+
--al-stepper-connector-thickness: var(--al-border-width-1);
|
|
7876
|
+
--al-stepper-text-gap: var(--al-space-2);
|
|
7877
|
+
--al-stepper-horizontal-gap: var(--al-space-8);
|
|
7878
|
+
--al-stepper-horizontal-text-padding: var(--al-space-8);
|
|
7879
|
+
--al-stepper-vertical-gap: var(--al-space-12);
|
|
7880
|
+
--al-stepper-vertical-rail-gap: var(--al-space-4);
|
|
7881
|
+
--al-stepper-vertical-step-gap: var(--al-space-24);
|
|
7882
|
+
|
|
7883
|
+
/* type - title and number like label-md, description like body-sm */
|
|
7884
|
+
--al-stepper-font-size: var(--al-font-size-sm);
|
|
7885
|
+
--al-stepper-line-height: var(--al-line-height-sm);
|
|
7886
|
+
--al-stepper-font-weight: var(--al-font-weight-medium);
|
|
7887
|
+
--al-stepper-description-font-size: var(--al-font-size-sm);
|
|
7888
|
+
--al-stepper-description-line-height: var(--al-line-height-sm);
|
|
7889
|
+
--al-stepper-description-font-weight: var(--al-font-weight-regular);
|
|
7890
|
+
}
|
|
7891
|
+
|
|
7892
|
+
/* AL Design System - Stepper
|
|
7893
|
+
*
|
|
7894
|
+
* Depends on: al-foundation.css, al-stepper-tokens.css, al-icon-tokens.css + icon.css
|
|
7895
|
+
*
|
|
7896
|
+
* .al-stepper Horizontal - title under the circle, one line
|
|
7897
|
+
* .al-stepper--vertical Vertical - rail on the left, text on the right
|
|
7898
|
+
*
|
|
7899
|
+
* Markup (usage rules 17-19): an <ol> inside <nav aria-label="Progress">.
|
|
7900
|
+
* Status is a class on the step; the current one also carries
|
|
7901
|
+
* aria-current="step", and that attribute is what styles it, so the look can
|
|
7902
|
+
* never disagree with what is announced. Each step spells its status out in
|
|
7903
|
+
* hidden text - the check and the color say nothing to a screen reader.
|
|
7904
|
+
*
|
|
7905
|
+
* <nav aria-label="Progress">
|
|
7906
|
+
* <ol class="al-stepper">
|
|
7907
|
+
* <li class="al-stepper__step al-stepper__step--completed">
|
|
7908
|
+
* <span class="al-stepper__indicator">
|
|
7909
|
+
* <svg class="al-icon" viewBox="0 0 24 24" aria-hidden="true" focusable="false">…check…</svg>
|
|
7910
|
+
* </span>
|
|
7911
|
+
* <span class="al-stepper__text">
|
|
7912
|
+
* <span class="al-stepper__label">Account</span>
|
|
7913
|
+
* <span class="al-stepper__status">completed</span>
|
|
7914
|
+
* <span class="al-stepper__description">Optional description</span>
|
|
7915
|
+
* </span>
|
|
7916
|
+
* </li>
|
|
7917
|
+
* <li class="al-stepper__step" aria-current="step">
|
|
7918
|
+
* <span class="al-stepper__indicator" aria-hidden="true">2</span> …
|
|
7919
|
+
* </li>
|
|
7920
|
+
* <li class="al-stepper__step"> … upcoming … </li>
|
|
7921
|
+
* </ol>
|
|
7922
|
+
* </nav>
|
|
7923
|
+
*
|
|
7924
|
+
* NOT CLICKABLE (rule 24): no hover, no focus, no link. Moving between steps
|
|
7925
|
+
* is the form's Back / Continue.
|
|
7926
|
+
*
|
|
7927
|
+
* ONE CONTINUOUS LINE (rule 15): each horizontal step draws half a line on
|
|
7928
|
+
* each side of its circle (::before / ::after) and the steps touch, so the
|
|
7929
|
+
* halves join. The line before a step is brand when the step is completed or
|
|
7930
|
+
* current; the line after, only when completed. The outer halves stay
|
|
7931
|
+
* unpainted - they keep the circle centered over the title.
|
|
7932
|
+
*
|
|
7933
|
+
* THE BORDER IS ALWAYS THERE: the current step paints it in its own fill, so
|
|
7934
|
+
* the circle never changes size between states.
|
|
7935
|
+
*
|
|
7936
|
+
* NO TOKEN, ON PURPOSE: the vertical text drops by (circle - line) / 2 so the
|
|
7937
|
+
* title's first line centers on the circle.
|
|
7938
|
+
*/
|
|
7939
|
+
|
|
7940
|
+
.al-stepper {
|
|
7941
|
+
display: flex;
|
|
7942
|
+
margin: 0;
|
|
7943
|
+
padding: 0;
|
|
7944
|
+
list-style: none;
|
|
7945
|
+
font-family: var(--al-font-sans);
|
|
7946
|
+
}
|
|
7947
|
+
|
|
7948
|
+
/* ---------------------------------------------------------- horizontal */
|
|
7949
|
+
.al-stepper__step {
|
|
7950
|
+
display: grid;
|
|
7951
|
+
flex: 1 1 0;
|
|
7952
|
+
grid-template-columns: 1fr var(--al-stepper-indicator-size) 1fr;
|
|
7953
|
+
align-items: center;
|
|
7954
|
+
align-content: start;
|
|
7955
|
+
row-gap: var(--al-stepper-horizontal-gap);
|
|
7956
|
+
min-inline-size: 0;
|
|
7957
|
+
}
|
|
7958
|
+
|
|
7959
|
+
.al-stepper__step::before,
|
|
7960
|
+
.al-stepper__step::after {
|
|
7961
|
+
content: '';
|
|
7962
|
+
grid-row: 1;
|
|
7963
|
+
block-size: var(--al-stepper-connector-thickness);
|
|
7964
|
+
background-color: var(--al-stepper-connector);
|
|
7965
|
+
}
|
|
7966
|
+
|
|
7967
|
+
.al-stepper__step::before { grid-column: 1; }
|
|
7968
|
+
.al-stepper__step::after { grid-column: 3; }
|
|
7969
|
+
|
|
7970
|
+
.al-stepper__step--completed::before,
|
|
7971
|
+
.al-stepper__step--completed::after,
|
|
7972
|
+
.al-stepper__step[aria-current='step']::before {
|
|
7973
|
+
background-color: var(--al-stepper-connector-done);
|
|
7974
|
+
}
|
|
7975
|
+
|
|
7976
|
+
.al-stepper__step:first-child::before,
|
|
7977
|
+
.al-stepper__step:last-child::after {
|
|
7978
|
+
background-color: transparent;
|
|
7979
|
+
}
|
|
7980
|
+
|
|
7981
|
+
.al-stepper__indicator {
|
|
7982
|
+
grid-row: 1;
|
|
7983
|
+
grid-column: 2;
|
|
7984
|
+
}
|
|
7985
|
+
|
|
7986
|
+
.al-stepper__text {
|
|
7987
|
+
grid-row: 2;
|
|
7988
|
+
grid-column: 1 / -1;
|
|
7989
|
+
padding-inline: var(--al-stepper-horizontal-text-padding);
|
|
7990
|
+
text-align: center;
|
|
7991
|
+
}
|
|
7992
|
+
|
|
7993
|
+
/* ------------------------------------------------------------ vertical */
|
|
7994
|
+
.al-stepper--vertical {
|
|
7995
|
+
flex-direction: column;
|
|
7996
|
+
}
|
|
7997
|
+
|
|
7998
|
+
.al-stepper--vertical .al-stepper__step {
|
|
7999
|
+
flex: none;
|
|
8000
|
+
grid-template-columns: var(--al-stepper-indicator-size) 1fr;
|
|
8001
|
+
grid-template-rows: auto 1fr;
|
|
8002
|
+
align-items: start;
|
|
8003
|
+
column-gap: var(--al-stepper-vertical-gap);
|
|
8004
|
+
row-gap: 0;
|
|
8005
|
+
}
|
|
8006
|
+
|
|
8007
|
+
.al-stepper--vertical .al-stepper__step::before {
|
|
8008
|
+
display: none;
|
|
8009
|
+
}
|
|
8010
|
+
|
|
8011
|
+
.al-stepper--vertical .al-stepper__step::after {
|
|
8012
|
+
grid-row: 2;
|
|
8013
|
+
grid-column: 1;
|
|
8014
|
+
justify-self: center;
|
|
8015
|
+
align-self: stretch;
|
|
8016
|
+
inline-size: var(--al-stepper-connector-thickness);
|
|
8017
|
+
block-size: auto;
|
|
8018
|
+
margin-block: var(--al-stepper-vertical-rail-gap);
|
|
8019
|
+
}
|
|
8020
|
+
|
|
8021
|
+
.al-stepper--vertical .al-stepper__step:last-child::after {
|
|
8022
|
+
display: none;
|
|
8023
|
+
}
|
|
8024
|
+
|
|
8025
|
+
.al-stepper--vertical .al-stepper__indicator {
|
|
8026
|
+
grid-column: 1;
|
|
8027
|
+
}
|
|
8028
|
+
|
|
8029
|
+
.al-stepper--vertical .al-stepper__text {
|
|
8030
|
+
grid-row: 1 / span 2;
|
|
8031
|
+
grid-column: 2;
|
|
8032
|
+
padding-block: calc((var(--al-stepper-indicator-size) - var(--al-stepper-line-height)) / 2)
|
|
8033
|
+
var(--al-stepper-vertical-step-gap);
|
|
8034
|
+
padding-inline: 0;
|
|
8035
|
+
text-align: start;
|
|
8036
|
+
}
|
|
8037
|
+
|
|
8038
|
+
.al-stepper--vertical .al-stepper__step:last-child .al-stepper__text {
|
|
8039
|
+
padding-block-end: 0;
|
|
8040
|
+
}
|
|
8041
|
+
|
|
8042
|
+
/* ----------------------------------------------------------- indicator */
|
|
8043
|
+
.al-stepper__indicator {
|
|
8044
|
+
display: inline-flex;
|
|
8045
|
+
align-items: center;
|
|
8046
|
+
justify-content: center;
|
|
8047
|
+
box-sizing: border-box;
|
|
8048
|
+
inline-size: var(--al-stepper-indicator-size);
|
|
8049
|
+
block-size: var(--al-stepper-indicator-size);
|
|
8050
|
+
border: var(--al-stepper-indicator-border-width) solid var(--al-stepper-upcoming-border);
|
|
8051
|
+
border-radius: var(--al-stepper-indicator-radius);
|
|
8052
|
+
background-color: var(--al-stepper-upcoming-bg);
|
|
8053
|
+
color: var(--al-stepper-upcoming-number);
|
|
8054
|
+
font-size: var(--al-stepper-font-size);
|
|
8055
|
+
line-height: var(--al-stepper-line-height);
|
|
8056
|
+
font-weight: var(--al-stepper-font-weight);
|
|
8057
|
+
font-variant-numeric: tabular-nums;
|
|
8058
|
+
}
|
|
8059
|
+
|
|
8060
|
+
.al-stepper__indicator .al-icon {
|
|
8061
|
+
--al-icon-box: var(--al-stepper-icon-size);
|
|
8062
|
+
}
|
|
8063
|
+
|
|
8064
|
+
.al-stepper__step--completed .al-stepper__indicator {
|
|
8065
|
+
border-color: var(--al-stepper-completed-border);
|
|
8066
|
+
background-color: var(--al-stepper-completed-bg);
|
|
8067
|
+
color: var(--al-stepper-completed-icon);
|
|
8068
|
+
}
|
|
8069
|
+
|
|
8070
|
+
.al-stepper__step[aria-current='step'] .al-stepper__indicator {
|
|
8071
|
+
border-color: var(--al-stepper-current-bg);
|
|
8072
|
+
background-color: var(--al-stepper-current-bg);
|
|
8073
|
+
color: var(--al-stepper-current-number);
|
|
8074
|
+
}
|
|
8075
|
+
|
|
8076
|
+
/* ---------------------------------------------------------------- text */
|
|
8077
|
+
.al-stepper__text {
|
|
8078
|
+
display: flex;
|
|
8079
|
+
flex-direction: column;
|
|
8080
|
+
gap: var(--al-stepper-text-gap);
|
|
8081
|
+
}
|
|
8082
|
+
|
|
8083
|
+
.al-stepper__label {
|
|
8084
|
+
font-size: var(--al-stepper-font-size);
|
|
8085
|
+
line-height: var(--al-stepper-line-height);
|
|
8086
|
+
font-weight: var(--al-stepper-font-weight);
|
|
8087
|
+
color: var(--al-stepper-label-upcoming);
|
|
8088
|
+
}
|
|
8089
|
+
|
|
8090
|
+
.al-stepper__step--completed .al-stepper__label,
|
|
8091
|
+
.al-stepper__step[aria-current='step'] .al-stepper__label {
|
|
8092
|
+
color: var(--al-stepper-label);
|
|
8093
|
+
}
|
|
8094
|
+
|
|
8095
|
+
.al-stepper__description {
|
|
8096
|
+
font-size: var(--al-stepper-description-font-size);
|
|
8097
|
+
line-height: var(--al-stepper-description-line-height);
|
|
8098
|
+
font-weight: var(--al-stepper-description-font-weight);
|
|
8099
|
+
color: var(--al-stepper-description);
|
|
8100
|
+
}
|
|
8101
|
+
|
|
8102
|
+
/* Read, never seen (rule 19). One border-width is the 1px box the pattern
|
|
8103
|
+
needs; clip-path hides it. */
|
|
8104
|
+
.al-stepper__status {
|
|
8105
|
+
position: absolute;
|
|
8106
|
+
inline-size: var(--al-border-width-1);
|
|
8107
|
+
block-size: var(--al-border-width-1);
|
|
8108
|
+
overflow: hidden;
|
|
8109
|
+
clip-path: inset(50%);
|
|
8110
|
+
white-space: nowrap;
|
|
8111
|
+
}
|
|
@@ -0,0 +1,264 @@
|
|
|
1
|
+
/* AL Design System - Stepper tokens
|
|
2
|
+
* GENERATED by src/components/stepper/tokens.py. Do not edit by hand.
|
|
3
|
+
*
|
|
4
|
+
* Every color is a semantic the theme switches on :root.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
:root {
|
|
8
|
+
/* color */
|
|
9
|
+
--al-stepper-label: var(--al-text-primary);
|
|
10
|
+
--al-stepper-label-upcoming: var(--al-text-secondary);
|
|
11
|
+
--al-stepper-description: var(--al-text-secondary);
|
|
12
|
+
--al-stepper-completed-bg: var(--al-bg-brand-subtle);
|
|
13
|
+
--al-stepper-completed-border: var(--al-border-brand);
|
|
14
|
+
--al-stepper-completed-icon: var(--al-text-brand);
|
|
15
|
+
--al-stepper-current-bg: var(--al-bg-brand);
|
|
16
|
+
--al-stepper-current-number: var(--al-text-on-brand);
|
|
17
|
+
--al-stepper-upcoming-bg: var(--al-bg-surface);
|
|
18
|
+
--al-stepper-upcoming-border: var(--al-border-strong);
|
|
19
|
+
--al-stepper-upcoming-number: var(--al-text-secondary);
|
|
20
|
+
--al-stepper-connector: var(--al-border-default);
|
|
21
|
+
--al-stepper-connector-done: var(--al-border-brand);
|
|
22
|
+
|
|
23
|
+
/* geometry */
|
|
24
|
+
--al-stepper-indicator-size: var(--al-space-32);
|
|
25
|
+
--al-stepper-indicator-radius: var(--al-radius-full);
|
|
26
|
+
--al-stepper-indicator-border-width: var(--al-border-width-1);
|
|
27
|
+
--al-stepper-icon-size: var(--al-icon-size-16);
|
|
28
|
+
--al-stepper-connector-thickness: var(--al-border-width-1);
|
|
29
|
+
--al-stepper-text-gap: var(--al-space-2);
|
|
30
|
+
--al-stepper-horizontal-gap: var(--al-space-8);
|
|
31
|
+
--al-stepper-horizontal-text-padding: var(--al-space-8);
|
|
32
|
+
--al-stepper-vertical-gap: var(--al-space-12);
|
|
33
|
+
--al-stepper-vertical-rail-gap: var(--al-space-4);
|
|
34
|
+
--al-stepper-vertical-step-gap: var(--al-space-24);
|
|
35
|
+
|
|
36
|
+
/* type - title and number like label-md, description like body-sm */
|
|
37
|
+
--al-stepper-font-size: var(--al-font-size-sm);
|
|
38
|
+
--al-stepper-line-height: var(--al-line-height-sm);
|
|
39
|
+
--al-stepper-font-weight: var(--al-font-weight-medium);
|
|
40
|
+
--al-stepper-description-font-size: var(--al-font-size-sm);
|
|
41
|
+
--al-stepper-description-line-height: var(--al-line-height-sm);
|
|
42
|
+
--al-stepper-description-font-weight: var(--al-font-weight-regular);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/* AL Design System - Stepper
|
|
46
|
+
*
|
|
47
|
+
* Depends on: al-foundation.css, al-stepper-tokens.css, al-icon-tokens.css + icon.css
|
|
48
|
+
*
|
|
49
|
+
* .al-stepper Horizontal - title under the circle, one line
|
|
50
|
+
* .al-stepper--vertical Vertical - rail on the left, text on the right
|
|
51
|
+
*
|
|
52
|
+
* Markup (usage rules 17-19): an <ol> inside <nav aria-label="Progress">.
|
|
53
|
+
* Status is a class on the step; the current one also carries
|
|
54
|
+
* aria-current="step", and that attribute is what styles it, so the look can
|
|
55
|
+
* never disagree with what is announced. Each step spells its status out in
|
|
56
|
+
* hidden text - the check and the color say nothing to a screen reader.
|
|
57
|
+
*
|
|
58
|
+
* <nav aria-label="Progress">
|
|
59
|
+
* <ol class="al-stepper">
|
|
60
|
+
* <li class="al-stepper__step al-stepper__step--completed">
|
|
61
|
+
* <span class="al-stepper__indicator">
|
|
62
|
+
* <svg class="al-icon" viewBox="0 0 24 24" aria-hidden="true" focusable="false">…check…</svg>
|
|
63
|
+
* </span>
|
|
64
|
+
* <span class="al-stepper__text">
|
|
65
|
+
* <span class="al-stepper__label">Account</span>
|
|
66
|
+
* <span class="al-stepper__status">completed</span>
|
|
67
|
+
* <span class="al-stepper__description">Optional description</span>
|
|
68
|
+
* </span>
|
|
69
|
+
* </li>
|
|
70
|
+
* <li class="al-stepper__step" aria-current="step">
|
|
71
|
+
* <span class="al-stepper__indicator" aria-hidden="true">2</span> …
|
|
72
|
+
* </li>
|
|
73
|
+
* <li class="al-stepper__step"> … upcoming … </li>
|
|
74
|
+
* </ol>
|
|
75
|
+
* </nav>
|
|
76
|
+
*
|
|
77
|
+
* NOT CLICKABLE (rule 24): no hover, no focus, no link. Moving between steps
|
|
78
|
+
* is the form's Back / Continue.
|
|
79
|
+
*
|
|
80
|
+
* ONE CONTINUOUS LINE (rule 15): each horizontal step draws half a line on
|
|
81
|
+
* each side of its circle (::before / ::after) and the steps touch, so the
|
|
82
|
+
* halves join. The line before a step is brand when the step is completed or
|
|
83
|
+
* current; the line after, only when completed. The outer halves stay
|
|
84
|
+
* unpainted - they keep the circle centered over the title.
|
|
85
|
+
*
|
|
86
|
+
* THE BORDER IS ALWAYS THERE: the current step paints it in its own fill, so
|
|
87
|
+
* the circle never changes size between states.
|
|
88
|
+
*
|
|
89
|
+
* NO TOKEN, ON PURPOSE: the vertical text drops by (circle - line) / 2 so the
|
|
90
|
+
* title's first line centers on the circle.
|
|
91
|
+
*/
|
|
92
|
+
|
|
93
|
+
.al-stepper {
|
|
94
|
+
display: flex;
|
|
95
|
+
margin: 0;
|
|
96
|
+
padding: 0;
|
|
97
|
+
list-style: none;
|
|
98
|
+
font-family: var(--al-font-sans);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/* ---------------------------------------------------------- horizontal */
|
|
102
|
+
.al-stepper__step {
|
|
103
|
+
display: grid;
|
|
104
|
+
flex: 1 1 0;
|
|
105
|
+
grid-template-columns: 1fr var(--al-stepper-indicator-size) 1fr;
|
|
106
|
+
align-items: center;
|
|
107
|
+
align-content: start;
|
|
108
|
+
row-gap: var(--al-stepper-horizontal-gap);
|
|
109
|
+
min-inline-size: 0;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
.al-stepper__step::before,
|
|
113
|
+
.al-stepper__step::after {
|
|
114
|
+
content: '';
|
|
115
|
+
grid-row: 1;
|
|
116
|
+
block-size: var(--al-stepper-connector-thickness);
|
|
117
|
+
background-color: var(--al-stepper-connector);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
.al-stepper__step::before { grid-column: 1; }
|
|
121
|
+
.al-stepper__step::after { grid-column: 3; }
|
|
122
|
+
|
|
123
|
+
.al-stepper__step--completed::before,
|
|
124
|
+
.al-stepper__step--completed::after,
|
|
125
|
+
.al-stepper__step[aria-current='step']::before {
|
|
126
|
+
background-color: var(--al-stepper-connector-done);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
.al-stepper__step:first-child::before,
|
|
130
|
+
.al-stepper__step:last-child::after {
|
|
131
|
+
background-color: transparent;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
.al-stepper__indicator {
|
|
135
|
+
grid-row: 1;
|
|
136
|
+
grid-column: 2;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
.al-stepper__text {
|
|
140
|
+
grid-row: 2;
|
|
141
|
+
grid-column: 1 / -1;
|
|
142
|
+
padding-inline: var(--al-stepper-horizontal-text-padding);
|
|
143
|
+
text-align: center;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
/* ------------------------------------------------------------ vertical */
|
|
147
|
+
.al-stepper--vertical {
|
|
148
|
+
flex-direction: column;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
.al-stepper--vertical .al-stepper__step {
|
|
152
|
+
flex: none;
|
|
153
|
+
grid-template-columns: var(--al-stepper-indicator-size) 1fr;
|
|
154
|
+
grid-template-rows: auto 1fr;
|
|
155
|
+
align-items: start;
|
|
156
|
+
column-gap: var(--al-stepper-vertical-gap);
|
|
157
|
+
row-gap: 0;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
.al-stepper--vertical .al-stepper__step::before {
|
|
161
|
+
display: none;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
.al-stepper--vertical .al-stepper__step::after {
|
|
165
|
+
grid-row: 2;
|
|
166
|
+
grid-column: 1;
|
|
167
|
+
justify-self: center;
|
|
168
|
+
align-self: stretch;
|
|
169
|
+
inline-size: var(--al-stepper-connector-thickness);
|
|
170
|
+
block-size: auto;
|
|
171
|
+
margin-block: var(--al-stepper-vertical-rail-gap);
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
.al-stepper--vertical .al-stepper__step:last-child::after {
|
|
175
|
+
display: none;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
.al-stepper--vertical .al-stepper__indicator {
|
|
179
|
+
grid-column: 1;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
.al-stepper--vertical .al-stepper__text {
|
|
183
|
+
grid-row: 1 / span 2;
|
|
184
|
+
grid-column: 2;
|
|
185
|
+
padding-block: calc((var(--al-stepper-indicator-size) - var(--al-stepper-line-height)) / 2)
|
|
186
|
+
var(--al-stepper-vertical-step-gap);
|
|
187
|
+
padding-inline: 0;
|
|
188
|
+
text-align: start;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
.al-stepper--vertical .al-stepper__step:last-child .al-stepper__text {
|
|
192
|
+
padding-block-end: 0;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
/* ----------------------------------------------------------- indicator */
|
|
196
|
+
.al-stepper__indicator {
|
|
197
|
+
display: inline-flex;
|
|
198
|
+
align-items: center;
|
|
199
|
+
justify-content: center;
|
|
200
|
+
box-sizing: border-box;
|
|
201
|
+
inline-size: var(--al-stepper-indicator-size);
|
|
202
|
+
block-size: var(--al-stepper-indicator-size);
|
|
203
|
+
border: var(--al-stepper-indicator-border-width) solid var(--al-stepper-upcoming-border);
|
|
204
|
+
border-radius: var(--al-stepper-indicator-radius);
|
|
205
|
+
background-color: var(--al-stepper-upcoming-bg);
|
|
206
|
+
color: var(--al-stepper-upcoming-number);
|
|
207
|
+
font-size: var(--al-stepper-font-size);
|
|
208
|
+
line-height: var(--al-stepper-line-height);
|
|
209
|
+
font-weight: var(--al-stepper-font-weight);
|
|
210
|
+
font-variant-numeric: tabular-nums;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
.al-stepper__indicator .al-icon {
|
|
214
|
+
--al-icon-box: var(--al-stepper-icon-size);
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
.al-stepper__step--completed .al-stepper__indicator {
|
|
218
|
+
border-color: var(--al-stepper-completed-border);
|
|
219
|
+
background-color: var(--al-stepper-completed-bg);
|
|
220
|
+
color: var(--al-stepper-completed-icon);
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
.al-stepper__step[aria-current='step'] .al-stepper__indicator {
|
|
224
|
+
border-color: var(--al-stepper-current-bg);
|
|
225
|
+
background-color: var(--al-stepper-current-bg);
|
|
226
|
+
color: var(--al-stepper-current-number);
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
/* ---------------------------------------------------------------- text */
|
|
230
|
+
.al-stepper__text {
|
|
231
|
+
display: flex;
|
|
232
|
+
flex-direction: column;
|
|
233
|
+
gap: var(--al-stepper-text-gap);
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
.al-stepper__label {
|
|
237
|
+
font-size: var(--al-stepper-font-size);
|
|
238
|
+
line-height: var(--al-stepper-line-height);
|
|
239
|
+
font-weight: var(--al-stepper-font-weight);
|
|
240
|
+
color: var(--al-stepper-label-upcoming);
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
.al-stepper__step--completed .al-stepper__label,
|
|
244
|
+
.al-stepper__step[aria-current='step'] .al-stepper__label {
|
|
245
|
+
color: var(--al-stepper-label);
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
.al-stepper__description {
|
|
249
|
+
font-size: var(--al-stepper-description-font-size);
|
|
250
|
+
line-height: var(--al-stepper-description-line-height);
|
|
251
|
+
font-weight: var(--al-stepper-description-font-weight);
|
|
252
|
+
color: var(--al-stepper-description);
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
/* Read, never seen (rule 19). One border-width is the 1px box the pattern
|
|
256
|
+
needs; clip-path hides it. */
|
|
257
|
+
.al-stepper__status {
|
|
258
|
+
position: absolute;
|
|
259
|
+
inline-size: var(--al-border-width-1);
|
|
260
|
+
block-size: var(--al-border-width-1);
|
|
261
|
+
overflow: hidden;
|
|
262
|
+
clip-path: inset(50%);
|
|
263
|
+
white-space: nowrap;
|
|
264
|
+
}
|
package/dist/foundation.css
CHANGED
package/dist/tokens.json
CHANGED