@digiko-npm/designsystem 0.7.2 → 0.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/designsystem.css +8334 -4728
- package/dist/designsystem.min.css +2 -2
- package/package.json +18 -3
- package/src/components/accordion.css +129 -128
- package/src/components/alert.css +137 -134
- package/src/components/avatar.css +77 -77
- package/src/components/badge.css +52 -52
- package/src/components/bottom-nav.css +71 -71
- package/src/components/bottom-sheet.css +146 -0
- package/src/components/breadcrumb.css +61 -61
- package/src/components/button.css +162 -154
- package/src/components/card.css +94 -72
- package/src/components/chip.css +38 -38
- package/src/components/collapsible.css +96 -100
- package/src/components/color-picker.css +82 -0
- package/src/components/combobox.css +418 -0
- package/src/components/command.css +141 -140
- package/src/components/copy-button.css +106 -0
- package/src/components/datepicker.css +257 -251
- package/src/components/description-list.css +89 -87
- package/src/components/divider.css +45 -45
- package/src/components/drawer.css +185 -174
- package/src/components/drop-zone.css +85 -84
- package/src/components/dropdown.css +148 -140
- package/src/components/empty-state.css +50 -50
- package/src/components/field.css +35 -0
- package/src/components/gallery.css +257 -0
- package/src/components/icon-btn.css +2 -1
- package/src/components/index.css +14 -3
- package/src/components/input.css +205 -146
- package/src/components/kbd.css +10 -10
- package/src/components/modal.css +92 -90
- package/src/components/nav.css +140 -138
- package/src/components/number-input.css +163 -0
- package/src/components/pagination.css +153 -139
- package/src/components/pin-input.css +136 -0
- package/src/components/popover.css +72 -72
- package/src/components/progress.css +128 -129
- package/src/components/result.css +53 -57
- package/src/components/scroll-area.css +73 -0
- package/src/components/search.css +10 -4
- package/src/components/segmented-control.css +93 -0
- package/src/components/skeleton.css +58 -58
- package/src/components/slider.css +102 -100
- package/src/components/sortable.css +44 -45
- package/src/components/spinner.css +27 -27
- package/src/components/star-rating.css +121 -0
- package/src/components/stat-card.css +38 -25
- package/src/components/table.css +288 -3
- package/src/components/tabs.css +121 -121
- package/src/components/tag.css +124 -124
- package/src/components/timeline.css +99 -99
- package/src/components/toast.css +37 -38
- package/src/components/toggle.css +88 -88
- package/src/components/toolbar.css +137 -121
- package/src/components/tooltip.css +150 -150
- package/src/components/truncated-text.css +75 -0
- package/src/tokens/tokens.json +413 -0
|
@@ -8,79 +8,79 @@
|
|
|
8
8
|
background-color: var(--ds-color-bg-muted);
|
|
9
9
|
border-radius: var(--ds-radius-md);
|
|
10
10
|
animation: ds-skeleton-pulse var(--ds-duration-slower) var(--ds-ease-default) infinite;
|
|
11
|
-
}
|
|
12
11
|
|
|
13
|
-
/* --- Text variants --- */
|
|
12
|
+
/* --- Text variants --- */
|
|
14
13
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
}
|
|
14
|
+
&--text {
|
|
15
|
+
height: 1rem;
|
|
16
|
+
width: 100%;
|
|
17
|
+
border-radius: var(--ds-radius-sm);
|
|
18
|
+
margin-block-end: var(--ds-space-2);
|
|
19
|
+
}
|
|
21
20
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
}
|
|
21
|
+
&--text-sm {
|
|
22
|
+
height: 0.75rem;
|
|
23
|
+
width: 100%;
|
|
24
|
+
border-radius: var(--ds-radius-sm);
|
|
25
|
+
margin-block-end: var(--ds-space-2);
|
|
26
|
+
}
|
|
28
27
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
}
|
|
28
|
+
&--text-lg {
|
|
29
|
+
height: 1.5rem;
|
|
30
|
+
width: 100%;
|
|
31
|
+
border-radius: var(--ds-radius-sm);
|
|
32
|
+
margin-block-end: var(--ds-space-2);
|
|
33
|
+
}
|
|
35
34
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
}
|
|
35
|
+
&--heading {
|
|
36
|
+
height: 2rem;
|
|
37
|
+
width: 60%;
|
|
38
|
+
border-radius: var(--ds-radius-md);
|
|
39
|
+
margin-block-end: var(--ds-space-3);
|
|
40
|
+
}
|
|
42
41
|
|
|
43
|
-
/* --- Shape variants --- */
|
|
42
|
+
/* --- Shape variants --- */
|
|
44
43
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
}
|
|
44
|
+
&--circle,
|
|
45
|
+
&--avatar {
|
|
46
|
+
width: 2.5rem;
|
|
47
|
+
height: 2.5rem;
|
|
48
|
+
border-radius: var(--ds-radius-full);
|
|
49
|
+
}
|
|
51
50
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
}
|
|
51
|
+
&--card {
|
|
52
|
+
height: 12rem;
|
|
53
|
+
width: 100%;
|
|
54
|
+
border-radius: var(--ds-radius-xl);
|
|
55
|
+
}
|
|
57
56
|
|
|
58
|
-
/* --- UI element variants --- */
|
|
57
|
+
/* --- UI element variants --- */
|
|
59
58
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
}
|
|
59
|
+
&--btn {
|
|
60
|
+
height: 2.25rem;
|
|
61
|
+
width: 6rem;
|
|
62
|
+
border-radius: var(--ds-radius-lg);
|
|
63
|
+
}
|
|
65
64
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
}
|
|
65
|
+
&--input {
|
|
66
|
+
height: 2.5rem;
|
|
67
|
+
width: 100%;
|
|
68
|
+
border-radius: var(--ds-radius-lg);
|
|
69
|
+
}
|
|
71
70
|
|
|
72
|
-
/* --- Width modifiers --- */
|
|
71
|
+
/* --- Width modifiers --- */
|
|
73
72
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
}
|
|
73
|
+
&--w-1\/2 {
|
|
74
|
+
width: 50%;
|
|
75
|
+
}
|
|
77
76
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
}
|
|
77
|
+
&--w-3\/4 {
|
|
78
|
+
width: 75%;
|
|
79
|
+
}
|
|
81
80
|
|
|
82
|
-
|
|
83
|
-
|
|
81
|
+
&--w-1\/3 {
|
|
82
|
+
width: 33%;
|
|
83
|
+
}
|
|
84
84
|
}
|
|
85
85
|
|
|
86
86
|
/* --- Pulse animation --- */
|
|
@@ -27,105 +27,107 @@
|
|
|
27
27
|
.ds-slider {
|
|
28
28
|
width: 100%;
|
|
29
29
|
position: relative;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
.ds-slider input[type="range"] {
|
|
33
|
-
-webkit-appearance: none;
|
|
34
|
-
-moz-appearance: none;
|
|
35
|
-
appearance: none;
|
|
36
|
-
width: 100%;
|
|
37
|
-
height: 0.375rem;
|
|
38
|
-
background-color: var(--ds-color-bg-muted);
|
|
39
|
-
border-radius: var(--ds-radius-full);
|
|
40
|
-
outline: none;
|
|
41
|
-
cursor: pointer;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
/* Webkit thumb */
|
|
45
|
-
.ds-slider input[type="range"]::-webkit-slider-thumb {
|
|
46
|
-
-webkit-appearance: none;
|
|
47
|
-
appearance: none;
|
|
48
|
-
width: 1.5rem; /* WCAG 2.5.8: minimum 24px target */
|
|
49
|
-
height: 1.5rem;
|
|
50
|
-
border-radius: var(--ds-radius-full);
|
|
51
|
-
background-color: var(--ds-color-inverted);
|
|
52
|
-
border: 2px solid var(--ds-color-surface);
|
|
53
|
-
box-shadow: var(--ds-shadow-sm);
|
|
54
|
-
cursor: pointer;
|
|
55
|
-
transition: transform var(--ds-duration-fast) var(--ds-ease);
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
/* Firefox thumb */
|
|
59
|
-
.ds-slider input[type="range"]::-moz-range-thumb {
|
|
60
|
-
width: 1.5rem; /* WCAG 2.5.8: minimum 24px target */
|
|
61
|
-
height: 1.5rem;
|
|
62
|
-
border-radius: var(--ds-radius-full);
|
|
63
|
-
background-color: var(--ds-color-inverted);
|
|
64
|
-
border: 2px solid var(--ds-color-surface);
|
|
65
|
-
box-shadow: var(--ds-shadow-sm);
|
|
66
|
-
cursor: pointer;
|
|
67
|
-
transition: transform var(--ds-duration-fast) var(--ds-ease);
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
/* Hover: scale up thumb */
|
|
71
|
-
.ds-slider input[type="range"]:hover::-webkit-slider-thumb {
|
|
72
|
-
transform: scale(1.1);
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
.ds-slider input[type="range"]:hover::-moz-range-thumb {
|
|
76
|
-
transform: scale(1.1);
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
/* Focus ring */
|
|
80
|
-
.ds-slider input[type="range"]:focus-visible::-webkit-slider-thumb {
|
|
81
|
-
outline: var(--ds-ring-width) solid var(--ds-ring-color);
|
|
82
|
-
outline-offset: 0;
|
|
83
|
-
scroll-margin-block: var(--ds-space-16, 4rem);
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
.ds-slider input[type="range"]:focus-visible::-moz-range-thumb {
|
|
87
|
-
outline: var(--ds-ring-width) solid var(--ds-ring-color);
|
|
88
|
-
outline-offset: 0;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
/* Labels row */
|
|
92
|
-
.ds-slider__labels {
|
|
93
|
-
display: flex;
|
|
94
|
-
justify-content: space-between;
|
|
95
|
-
font-size: var(--ds-text-xs);
|
|
96
|
-
color: var(--ds-color-text-tertiary);
|
|
97
|
-
margin-block-start: var(--ds-space-1);
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
/* Current value display */
|
|
101
|
-
.ds-slider__value {
|
|
102
|
-
font-size: var(--ds-text-sm);
|
|
103
|
-
font-weight: var(--ds-weight-medium);
|
|
104
|
-
color: var(--ds-color-text);
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
/* Size: small */
|
|
108
|
-
.ds-slider--sm input[type="range"] {
|
|
109
|
-
height: 0.25rem;
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
.ds-slider--sm input[type="range"]::-webkit-slider-thumb {
|
|
113
|
-
width: 1rem;
|
|
114
|
-
height: 1rem;
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
.ds-slider--sm input[type="range"]::-moz-range-thumb {
|
|
118
|
-
width: 1rem;
|
|
119
|
-
height: 1rem;
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
/* Disabled state */
|
|
123
|
-
.ds-slider--disabled {
|
|
124
|
-
opacity: var(--ds-opacity-disabled);
|
|
125
|
-
cursor: not-allowed;
|
|
126
|
-
}
|
|
127
30
|
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
31
|
+
& input[type="range"] {
|
|
32
|
+
-webkit-appearance: none;
|
|
33
|
+
-moz-appearance: none;
|
|
34
|
+
appearance: none;
|
|
35
|
+
width: 100%;
|
|
36
|
+
height: 0.375rem;
|
|
37
|
+
background-color: var(--ds-color-bg-muted);
|
|
38
|
+
border-radius: var(--ds-radius-full);
|
|
39
|
+
outline: none;
|
|
40
|
+
cursor: pointer;
|
|
41
|
+
|
|
42
|
+
/* Webkit thumb */
|
|
43
|
+
&::-webkit-slider-thumb {
|
|
44
|
+
-webkit-appearance: none;
|
|
45
|
+
appearance: none;
|
|
46
|
+
width: 1.5rem; /* WCAG 2.5.8: minimum 24px target */
|
|
47
|
+
height: 1.5rem;
|
|
48
|
+
border-radius: var(--ds-radius-full);
|
|
49
|
+
background-color: var(--ds-color-inverted);
|
|
50
|
+
border: 2px solid var(--ds-color-surface);
|
|
51
|
+
box-shadow: var(--ds-shadow-sm);
|
|
52
|
+
cursor: pointer;
|
|
53
|
+
transition: transform var(--ds-duration-fast) var(--ds-ease);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/* Firefox thumb */
|
|
57
|
+
&::-moz-range-thumb {
|
|
58
|
+
width: 1.5rem; /* WCAG 2.5.8: minimum 24px target */
|
|
59
|
+
height: 1.5rem;
|
|
60
|
+
border-radius: var(--ds-radius-full);
|
|
61
|
+
background-color: var(--ds-color-inverted);
|
|
62
|
+
border: 2px solid var(--ds-color-surface);
|
|
63
|
+
box-shadow: var(--ds-shadow-sm);
|
|
64
|
+
cursor: pointer;
|
|
65
|
+
transition: transform var(--ds-duration-fast) var(--ds-ease);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/* Hover: scale up thumb */
|
|
69
|
+
&:hover::-webkit-slider-thumb {
|
|
70
|
+
transform: scale(1.1);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
&:hover::-moz-range-thumb {
|
|
74
|
+
transform: scale(1.1);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/* Focus ring */
|
|
78
|
+
&:focus-visible::-webkit-slider-thumb {
|
|
79
|
+
outline: var(--ds-ring-width) solid var(--ds-ring-color);
|
|
80
|
+
outline-offset: 0;
|
|
81
|
+
scroll-margin-block: var(--ds-space-16, 4rem);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
&:focus-visible::-moz-range-thumb {
|
|
85
|
+
outline: var(--ds-ring-width) solid var(--ds-ring-color);
|
|
86
|
+
outline-offset: 0;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/* Labels row */
|
|
91
|
+
&__labels {
|
|
92
|
+
display: flex;
|
|
93
|
+
justify-content: space-between;
|
|
94
|
+
font-size: var(--ds-text-xs);
|
|
95
|
+
color: var(--ds-color-text-tertiary);
|
|
96
|
+
margin-block-start: var(--ds-space-1);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
/* Current value display */
|
|
100
|
+
&__value {
|
|
101
|
+
font-size: var(--ds-text-sm);
|
|
102
|
+
font-weight: var(--ds-weight-medium);
|
|
103
|
+
color: var(--ds-color-text);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/* Size: small */
|
|
107
|
+
&--sm {
|
|
108
|
+
& input[type="range"] {
|
|
109
|
+
height: 0.25rem;
|
|
110
|
+
|
|
111
|
+
&::-webkit-slider-thumb {
|
|
112
|
+
width: 1rem;
|
|
113
|
+
height: 1rem;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
&::-moz-range-thumb {
|
|
117
|
+
width: 1rem;
|
|
118
|
+
height: 1rem;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
/* Disabled state */
|
|
124
|
+
&--disabled {
|
|
125
|
+
opacity: var(--ds-opacity-disabled);
|
|
126
|
+
cursor: not-allowed;
|
|
127
|
+
|
|
128
|
+
& input[type="range"] {
|
|
129
|
+
cursor: not-allowed;
|
|
130
|
+
pointer-events: none;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
131
133
|
}
|
|
@@ -11,58 +11,57 @@
|
|
|
11
11
|
- Keyboard: handle should support ArrowUp/Down + Enter to move items
|
|
12
12
|
========================================================================== */
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
.ds-sortable__handle {
|
|
16
|
-
display: flex;
|
|
17
|
-
align-items: center;
|
|
18
|
-
justify-content: center;
|
|
19
|
-
min-width: 1.5rem; /* WCAG 2.5.8: minimum 24px target */
|
|
20
|
-
min-height: 1.5rem;
|
|
21
|
-
padding: var(--ds-space-1);
|
|
22
|
-
color: var(--ds-color-text-tertiary);
|
|
23
|
-
cursor: grab;
|
|
24
|
-
border-radius: var(--ds-radius-sm);
|
|
25
|
-
opacity: 0;
|
|
26
|
-
transition:
|
|
27
|
-
opacity var(--ds-duration-fast) var(--ds-ease-default),
|
|
28
|
-
color var(--ds-duration-fast) var(--ds-ease-default);
|
|
29
|
-
}
|
|
14
|
+
.ds-sortable {
|
|
30
15
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
16
|
+
/* --- Dragging state: applied to the row being dragged --- */
|
|
17
|
+
&--dragging {
|
|
18
|
+
opacity: 0.5;
|
|
19
|
+
background-color: var(--ds-color-surface);
|
|
20
|
+
}
|
|
34
21
|
|
|
35
|
-
/*
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
opacity: 1;
|
|
40
|
-
}
|
|
22
|
+
/* --- Drop target: applied to the row being hovered over --- */
|
|
23
|
+
&--over {
|
|
24
|
+
box-shadow: inset 0 -2px 0 var(--ds-color-interactive);
|
|
25
|
+
}
|
|
41
26
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
27
|
+
/* --- Grip handle: visible on row hover, grab cursor --- */
|
|
28
|
+
&__handle {
|
|
29
|
+
display: flex;
|
|
30
|
+
align-items: center;
|
|
31
|
+
justify-content: center;
|
|
32
|
+
min-width: 1.5rem; /* WCAG 2.5.8: minimum 24px target */
|
|
33
|
+
min-height: 1.5rem;
|
|
34
|
+
padding: var(--ds-space-1);
|
|
35
|
+
color: var(--ds-color-text-tertiary);
|
|
36
|
+
cursor: grab;
|
|
37
|
+
border-radius: var(--ds-radius-sm);
|
|
38
|
+
opacity: 0;
|
|
39
|
+
transition:
|
|
40
|
+
opacity var(--ds-duration-fast) var(--ds-ease-default),
|
|
41
|
+
color var(--ds-duration-fast) var(--ds-ease-default);
|
|
48
42
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
}
|
|
43
|
+
&:active {
|
|
44
|
+
cursor: grabbing;
|
|
45
|
+
}
|
|
53
46
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
47
|
+
&:focus-visible {
|
|
48
|
+
opacity: 1;
|
|
49
|
+
outline: none;
|
|
50
|
+
box-shadow: 0 0 0 var(--ds-ring-width) var(--ds-ring-color);
|
|
51
|
+
border-radius: var(--ds-radius-sm);
|
|
52
|
+
scroll-margin-block: var(--ds-space-16, 4rem);
|
|
53
|
+
}
|
|
59
54
|
|
|
60
|
-
/* ---
|
|
61
|
-
|
|
62
|
-
|
|
55
|
+
/* --- Always-visible handle variant --- */
|
|
56
|
+
&--visible {
|
|
57
|
+
opacity: 1;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
63
60
|
}
|
|
64
61
|
|
|
65
|
-
/*
|
|
66
|
-
.ds-sortable__handle
|
|
62
|
+
/* Show handle on row hover */
|
|
63
|
+
tr:hover .ds-sortable__handle,
|
|
64
|
+
.ds-sortable-row:hover .ds-sortable__handle {
|
|
67
65
|
opacity: 1;
|
|
66
|
+
color: var(--ds-color-text-secondary);
|
|
68
67
|
}
|
|
@@ -26,35 +26,35 @@
|
|
|
26
26
|
border-top-color: var(--ds-color-interactive);
|
|
27
27
|
border-radius: var(--ds-radius-full);
|
|
28
28
|
animation: ds-spin 0.8s linear infinite;
|
|
29
|
+
|
|
30
|
+
/* Sizes */
|
|
31
|
+
&--sm {
|
|
32
|
+
width: 1rem;
|
|
33
|
+
height: 1rem;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
&--md {
|
|
37
|
+
width: 1.25rem;
|
|
38
|
+
height: 1.25rem;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
&--lg {
|
|
42
|
+
width: 2rem;
|
|
43
|
+
height: 2rem;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/* Color variants */
|
|
47
|
+
&--muted {
|
|
48
|
+
border-color: var(--ds-color-inverted);
|
|
49
|
+
border-top-color: transparent;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
&--light {
|
|
53
|
+
border-color: var(--ds-color-on-inverted);
|
|
54
|
+
border-top-color: transparent;
|
|
55
|
+
}
|
|
29
56
|
}
|
|
30
57
|
|
|
31
58
|
@keyframes ds-spin {
|
|
32
59
|
to { transform: rotate(360deg); }
|
|
33
60
|
}
|
|
34
|
-
|
|
35
|
-
/* Sizes */
|
|
36
|
-
.ds-spinner--sm {
|
|
37
|
-
width: 1rem;
|
|
38
|
-
height: 1rem;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
.ds-spinner--md {
|
|
42
|
-
width: 1.25rem;
|
|
43
|
-
height: 1.25rem;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
.ds-spinner--lg {
|
|
47
|
-
width: 2rem;
|
|
48
|
-
height: 2rem;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
/* Color variants */
|
|
52
|
-
.ds-spinner--muted {
|
|
53
|
-
border-color: var(--ds-color-inverted);
|
|
54
|
-
border-top-color: transparent;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
.ds-spinner--light {
|
|
58
|
-
border-color: var(--ds-color-on-inverted);
|
|
59
|
-
border-top-color: transparent;
|
|
60
|
-
}
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
/* ==========================================================================
|
|
2
|
+
Component: Star Rating
|
|
3
|
+
Display or input star ratings. CSS-only styling with SVG/icon stars.
|
|
4
|
+
|
|
5
|
+
ARIA requirements (consumer responsibility):
|
|
6
|
+
- Display: aria-label="Rating: 4 out of 5"
|
|
7
|
+
- Input: role="radiogroup", aria-label="Rate this item"
|
|
8
|
+
- Each star input: role="radio", aria-checked="true|false", aria-label="[N] stars"
|
|
9
|
+
- Keyboard: ArrowLeft/Right to change rating
|
|
10
|
+
|
|
11
|
+
Usage (display):
|
|
12
|
+
<div class="ds-star-rating" aria-label="Rating: 4 out of 5">
|
|
13
|
+
<span class="ds-star-rating__star ds-star-rating__star--filled">★</span>
|
|
14
|
+
<span class="ds-star-rating__star ds-star-rating__star--filled">★</span>
|
|
15
|
+
<span class="ds-star-rating__star ds-star-rating__star--filled">★</span>
|
|
16
|
+
<span class="ds-star-rating__star ds-star-rating__star--filled">★</span>
|
|
17
|
+
<span class="ds-star-rating__star">★</span>
|
|
18
|
+
</div>
|
|
19
|
+
|
|
20
|
+
Usage (input):
|
|
21
|
+
<div class="ds-star-rating ds-star-rating--interactive" role="radiogroup">
|
|
22
|
+
<button class="ds-star-rating__star ds-star-rating__star--filled" role="radio">★</button>
|
|
23
|
+
...
|
|
24
|
+
</div>
|
|
25
|
+
|
|
26
|
+
Modifiers:
|
|
27
|
+
.ds-star-rating--interactive — Hoverable stars for input
|
|
28
|
+
.ds-star-rating--sm — Smaller stars
|
|
29
|
+
.ds-star-rating--lg — Larger stars
|
|
30
|
+
========================================================================== */
|
|
31
|
+
|
|
32
|
+
.ds-star-rating {
|
|
33
|
+
display: inline-flex;
|
|
34
|
+
align-items: center;
|
|
35
|
+
gap: var(--ds-space-0-5);
|
|
36
|
+
|
|
37
|
+
&__star {
|
|
38
|
+
display: inline-flex;
|
|
39
|
+
align-items: center;
|
|
40
|
+
justify-content: center;
|
|
41
|
+
width: 1.5rem;
|
|
42
|
+
height: 1.5rem;
|
|
43
|
+
color: var(--ds-color-border);
|
|
44
|
+
font-size: var(--ds-text-lg);
|
|
45
|
+
line-height: 1;
|
|
46
|
+
border: none;
|
|
47
|
+
background: transparent;
|
|
48
|
+
padding: 0;
|
|
49
|
+
transition: color var(--ds-duration-fast) var(--ds-ease-default);
|
|
50
|
+
|
|
51
|
+
&--filled {
|
|
52
|
+
color: var(--ds-color-warning);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
&--half {
|
|
56
|
+
position: relative;
|
|
57
|
+
color: var(--ds-color-border);
|
|
58
|
+
|
|
59
|
+
&::before {
|
|
60
|
+
content: "★";
|
|
61
|
+
position: absolute;
|
|
62
|
+
inset-inline-start: 0;
|
|
63
|
+
width: 50%;
|
|
64
|
+
overflow: hidden;
|
|
65
|
+
color: var(--ds-color-warning);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/* --- Interactive (input mode) --- */
|
|
71
|
+
&--interactive &__star {
|
|
72
|
+
cursor: pointer;
|
|
73
|
+
|
|
74
|
+
&:hover {
|
|
75
|
+
color: var(--ds-color-warning);
|
|
76
|
+
transform: scale(1.15);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
&:focus-visible {
|
|
80
|
+
outline: none;
|
|
81
|
+
box-shadow: 0 0 0 var(--ds-ring-width) var(--ds-ring-color);
|
|
82
|
+
border-radius: var(--ds-radius-sm);
|
|
83
|
+
scroll-margin-block: var(--ds-space-16, 4rem);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/* --- Small --- */
|
|
88
|
+
&--sm &__star {
|
|
89
|
+
width: 1rem;
|
|
90
|
+
height: 1rem;
|
|
91
|
+
font-size: var(--ds-text-sm);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
&--sm {
|
|
95
|
+
gap: 0;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/* --- Large --- */
|
|
99
|
+
&--lg &__star {
|
|
100
|
+
width: 2rem;
|
|
101
|
+
height: 2rem;
|
|
102
|
+
font-size: var(--ds-text-2xl);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
&--lg {
|
|
106
|
+
gap: var(--ds-space-1);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/* --- Value text --- */
|
|
110
|
+
&__value {
|
|
111
|
+
margin-inline-start: var(--ds-space-1-5);
|
|
112
|
+
font-size: var(--ds-text-sm);
|
|
113
|
+
font-weight: var(--ds-weight-medium);
|
|
114
|
+
color: var(--ds-color-text);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
&__count {
|
|
118
|
+
font-size: var(--ds-text-xs);
|
|
119
|
+
color: var(--ds-color-text-tertiary);
|
|
120
|
+
}
|
|
121
|
+
}
|