opui-css 3.3.4 → 4.0.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 +235 -0
- package/LICENSE +21 -21
- package/MIGRATING.md +105 -0
- package/README.md +66 -29
- package/astro/index.ts +46 -0
- package/components/AGENTS.md +247 -0
- package/components/Accordion/Accordion.astro +42 -0
- package/components/Anchor/Anchor.astro +51 -0
- package/components/Avatar/Avatar.astro +44 -0
- package/components/Badge/Badge.astro +54 -0
- package/components/Button/Button.astro +45 -0
- package/components/ButtonGroup/ButtonGroup.astro +29 -0
- package/components/Callout/Callout.astro +75 -0
- package/components/Card/Card.astro +38 -0
- package/components/Checkbox/Checkbox.astro +76 -0
- package/components/Checkbox/CheckboxInput.astro +32 -0
- package/components/Chip/Chip.astro +37 -0
- package/components/ClassicSelect/ClassicSelect.astro +83 -0
- package/components/DescriptionList/Description.astro +12 -0
- package/components/DescriptionList/DescriptionList.astro +22 -0
- package/components/DescriptionList/Item.astro +12 -0
- package/components/DescriptionList/Term.astro +12 -0
- package/components/DescriptionList/index.ts +12 -0
- package/components/Dialog/Dialog.astro +43 -0
- package/components/Divider/Divider.astro +14 -0
- package/components/Drawer/Drawer.astro +49 -0
- package/components/Drawer/DrawerFooter.astro +14 -0
- package/components/Drawer/DrawerHeader.astro +31 -0
- package/components/FieldDescription/FieldDescription.astro +13 -0
- package/components/FieldGroup/FieldGroup.astro +31 -0
- package/components/FieldLegend/FieldLegend.astro +15 -0
- package/components/FieldSet/FieldSet.astro +15 -0
- package/components/Form/Form.astro +15 -0
- package/components/IconButton/IconButton.astro +26 -0
- package/components/List/List.astro +36 -0
- package/components/ListItem/ListItem.astro +118 -0
- package/components/Progress/Progress.astro +40 -0
- package/components/Radio/Radio.astro +70 -0
- package/components/Radio/RadioInput.astro +24 -0
- package/components/Range/Range.astro +136 -0
- package/components/Select/Select.astro +106 -0
- package/components/Switch/Switch.astro +101 -0
- package/components/Switch/SwitchInput.astro +25 -0
- package/components/Table/Body.astro +13 -0
- package/components/Table/Cell.astro +13 -0
- package/components/Table/Column.astro +15 -0
- package/components/Table/ColumnGroup.astro +13 -0
- package/components/Table/Head.astro +13 -0
- package/components/Table/HeaderCell.astro +13 -0
- package/components/Table/Row.astro +13 -0
- package/components/Table/Table.astro +15 -0
- package/components/Table/index.ts +20 -0
- package/components/Tabs/Tabs.astro +28 -0
- package/components/Tabs/TabsItem.astro +47 -0
- package/components/Tabs/TabsPanel.astro +21 -0
- package/components/Tabs/TabsTab.astro +19 -0
- package/components/Tabs/index.ts +14 -0
- package/components/TextField/TextField.astro +128 -0
- package/components/Textarea/Textarea.astro +106 -0
- package/components/Toast/Toast.astro +42 -0
- package/components/ToggleButton/ToggleButton.astro +53 -0
- package/components/ToggleGroup/ToggleGroup.astro +49 -0
- package/components/Tooltip/Tooltip.astro +30 -0
- package/{src/core → core}/normalize.css +194 -196
- package/core/palette.css +59 -0
- package/{src/core → core}/utils.css +71 -60
- package/css/components/accordion.css +174 -0
- package/css/components/anchor.css +27 -0
- package/{src/themes/theme-two → css}/components/avatar.css +65 -68
- package/css/components/badge.css +107 -0
- package/css/components/button-group.css +179 -0
- package/css/components/button.css +215 -0
- package/css/components/callout.css +109 -0
- package/css/components/card.css +117 -0
- package/css/components/checkbox.css +205 -0
- package/{src/themes/theme-one → css}/components/chip.css +87 -135
- package/{src/themes/theme-two/components/definition-list.css → css/components/description-list.css} +77 -68
- package/{src/themes/theme-two → css}/components/dialog.css +68 -59
- package/css/components/divider.css +20 -0
- package/css/components/drawer.css +171 -0
- package/css/components/form.css +146 -0
- package/css/components/icon-button.css +139 -0
- package/{src/themes/theme-two → css}/components/link.css +21 -21
- package/{src/themes/theme-two → css}/components/list.css +345 -318
- package/{src/themes/theme-one → css}/components/progress.css +97 -83
- package/css/components/radio.css +172 -0
- package/css/components/range.css +337 -0
- package/{src/themes/theme-two → css}/components/select.css +169 -162
- package/{src/themes/theme-two → css}/components/spinner.css +37 -38
- package/{src/themes/theme-two → css}/components/switch.css +268 -225
- package/css/components/table.css +179 -0
- package/css/components/tabs.css +77 -0
- package/css/components/text-field.css +450 -0
- package/css/components/text-input.css +53 -0
- package/{src/themes/theme-two → css}/components/textarea.css +24 -25
- package/css/components/toast.css +161 -0
- package/css/components/toggle-button.css +87 -0
- package/css/components/toggle-group.css +56 -0
- package/css/components/tooltip.css +67 -0
- package/css/components/typography.css +585 -0
- package/{src/themes/theme-two → css}/components.css +41 -37
- package/{src/themes/theme-two → css}/imports.css +16 -16
- package/css/js/checkbox.js +21 -0
- package/css/js/toast.js +94 -0
- package/css/theme.css +132 -0
- package/dist/op.css +1001 -32
- package/dist/op.css.map +1 -0
- package/dist/opui.components.css +5135 -0
- package/dist/opui.components.css.map +1 -0
- package/dist/opui.css +6604 -0
- package/dist/opui.css.map +1 -0
- package/env.d.ts +14 -0
- package/open-props.css +9 -0
- package/package.json +64 -55
- package/dist/theme-one/components.css +0 -3869
- package/dist/theme-one/theme-one.css +0 -4424
- package/dist/theme-two/components.css +0 -3591
- package/dist/theme-two/theme-two.css +0 -4141
- package/src/open-props.css +0 -10
- package/src/themes/theme-one/components/accordion.css +0 -172
- package/src/themes/theme-one/components/alert.css +0 -85
- package/src/themes/theme-one/components/avatar.css +0 -68
- package/src/themes/theme-one/components/badge.css +0 -101
- package/src/themes/theme-one/components/button-group.css +0 -69
- package/src/themes/theme-one/components/button.css +0 -281
- package/src/themes/theme-one/components/card.css +0 -82
- package/src/themes/theme-one/components/checkbox-radio.css +0 -123
- package/src/themes/theme-one/components/definition-list.css +0 -68
- package/src/themes/theme-one/components/dialog.css +0 -59
- package/src/themes/theme-one/components/divider.css +0 -7
- package/src/themes/theme-one/components/field-group.css +0 -83
- package/src/themes/theme-one/components/field.css +0 -494
- package/src/themes/theme-one/components/icon-button.css +0 -40
- package/src/themes/theme-one/components/link.css +0 -21
- package/src/themes/theme-one/components/list.css +0 -318
- package/src/themes/theme-one/components/range.css +0 -121
- package/src/themes/theme-one/components/rich-text.css +0 -210
- package/src/themes/theme-one/components/select.css +0 -163
- package/src/themes/theme-one/components/snackbar.css +0 -148
- package/src/themes/theme-one/components/spinner.css +0 -38
- package/src/themes/theme-one/components/switch.css +0 -225
- package/src/themes/theme-one/components/tab-buttons.css +0 -120
- package/src/themes/theme-one/components/table.css +0 -92
- package/src/themes/theme-one/components/text-field.css +0 -57
- package/src/themes/theme-one/components/textarea.css +0 -25
- package/src/themes/theme-one/components/toggle-button-group.css +0 -135
- package/src/themes/theme-one/components/tooltip.css +0 -94
- package/src/themes/theme-one/components/typography.css +0 -209
- package/src/themes/theme-one/components.css +0 -37
- package/src/themes/theme-one/imports.css +0 -16
- package/src/themes/theme-one/theme.css +0 -163
- package/src/themes/theme-two/components/accordion.css +0 -172
- package/src/themes/theme-two/components/alert.css +0 -85
- package/src/themes/theme-two/components/badge.css +0 -101
- package/src/themes/theme-two/components/button-group.css +0 -50
- package/src/themes/theme-two/components/button.css +0 -229
- package/src/themes/theme-two/components/card.css +0 -82
- package/src/themes/theme-two/components/checkbox-radio.css +0 -123
- package/src/themes/theme-two/components/chip.css +0 -135
- package/src/themes/theme-two/components/divider.css +0 -7
- package/src/themes/theme-two/components/field-group.css +0 -83
- package/src/themes/theme-two/components/field.css +0 -281
- package/src/themes/theme-two/components/icon-button.css +0 -40
- package/src/themes/theme-two/components/progress.css +0 -83
- package/src/themes/theme-two/components/range.css +0 -121
- package/src/themes/theme-two/components/rich-text.css +0 -210
- package/src/themes/theme-two/components/snackbar.css +0 -148
- package/src/themes/theme-two/components/tab-buttons.css +0 -120
- package/src/themes/theme-two/components/table.css +0 -99
- package/src/themes/theme-two/components/text-field.css +0 -57
- package/src/themes/theme-two/components/toggle-button-group.css +0 -135
- package/src/themes/theme-two/components/tooltip.css +0 -94
- package/src/themes/theme-two/components/typography.css +0 -209
- package/src/themes/theme-two/theme.css +0 -158
|
@@ -1,225 +1,268 @@
|
|
|
1
|
-
@layer components.root {
|
|
2
|
-
:where(.switch) {
|
|
3
|
-
--_accent-color: var(--primary);
|
|
4
|
-
--_accent-contrast: var(--primary-contrast);
|
|
5
|
-
|
|
6
|
-
--_dot-bg-color: light-dark(var(--gray-11), var(--gray-14));
|
|
7
|
-
--_dot-inset: var(--size-1) auto auto var(--size-1);
|
|
8
|
-
--_dot-outline-size: 0;
|
|
9
|
-
--_dot-size: var(--size-3);
|
|
10
|
-
|
|
11
|
-
--_track-bg-color: light-dark(var(--gray-3), var(--gray-8));
|
|
12
|
-
--_track-height: var(--size-5);
|
|
13
|
-
--_track-width: var(--size-8);
|
|
14
|
-
--_transition-tf: var(--ease-4);
|
|
15
|
-
--_transition-time: 0.2s;
|
|
16
|
-
|
|
17
|
-
align-items: center;
|
|
18
|
-
color: var(--text-
|
|
19
|
-
display: inline-grid;
|
|
20
|
-
gap: 0 var(--size-2);
|
|
21
|
-
grid-auto-columns: auto;
|
|
22
|
-
grid-auto-flow: column;
|
|
23
|
-
inline-size: fit-content;
|
|
24
|
-
|
|
25
|
-
input[type="checkbox"][role="switch"] {
|
|
26
|
-
appearance: none;
|
|
27
|
-
block-size: var(--_track-height);
|
|
28
|
-
cursor: pointer;
|
|
29
|
-
inline-size: var(--_track-width);
|
|
30
|
-
margin: 0;
|
|
31
|
-
position: relative;
|
|
32
|
-
|
|
33
|
-
/* Track */
|
|
34
|
-
&::before {
|
|
35
|
-
background-color: var(--_track-bg-color);
|
|
36
|
-
block-size: var(--_track-height);
|
|
37
|
-
border: 1px solid var(--_dot-bg-color);
|
|
38
|
-
border-radius:
|
|
39
|
-
content: "";
|
|
40
|
-
inline-size: var(--_track-width);
|
|
41
|
-
inset: 0;
|
|
42
|
-
position: absolute;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
&:focus-visible {
|
|
46
|
-
|
|
47
|
-
outline:
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
outline: var(--_dot-outline-size) solid var(--_dot-bg-color);
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
--_dot-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
/* Track */
|
|
87
|
-
&::before {
|
|
88
|
-
transition:
|
|
89
|
-
background-color var(--_transition-time) var(--_transition-tf),
|
|
90
|
-
border-color var(--_transition-time) var(--_transition-tf);
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
/* Dot */
|
|
94
|
-
&::after {
|
|
95
|
-
transition: all var(--_transition-time) var(--_transition-tf);
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
&:active:after {
|
|
99
|
-
--_dot-outline-size: calc(var(--size-1) + 1px);
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
&:checked {
|
|
103
|
-
&:active:after {
|
|
104
|
-
--_dot-outline-size: calc(var(--size-1) + 1px);
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
/* Icons */
|
|
111
|
-
&:has(.icon-checked, .icon-unchecked) {
|
|
112
|
-
[role="switch"] {
|
|
113
|
-
grid-column: 1 / -1;
|
|
114
|
-
grid-row: 1;
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
&:has([role="switch"]:checked) {
|
|
118
|
-
.icon-unchecked {
|
|
119
|
-
display: none;
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
.
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
1
|
+
@layer components.root {
|
|
2
|
+
:where(.switch) {
|
|
3
|
+
--_accent-color: var(--primary);
|
|
4
|
+
--_accent-contrast: var(--primary-contrast);
|
|
5
|
+
|
|
6
|
+
--_dot-bg-color: light-dark(var(--gray-11), var(--gray-14));
|
|
7
|
+
--_dot-inset: var(--size-1) auto auto var(--size-1);
|
|
8
|
+
--_dot-outline-size: 0;
|
|
9
|
+
--_dot-size: var(--size-3);
|
|
10
|
+
|
|
11
|
+
--_track-bg-color: light-dark(var(--gray-3), var(--gray-8));
|
|
12
|
+
--_track-height: var(--size-5);
|
|
13
|
+
--_track-width: var(--size-8);
|
|
14
|
+
--_transition-tf: var(--ease-4);
|
|
15
|
+
--_transition-time: 0.2s;
|
|
16
|
+
|
|
17
|
+
align-items: center;
|
|
18
|
+
color: var(--text-primary);
|
|
19
|
+
display: inline-grid;
|
|
20
|
+
gap: 0 var(--size-2);
|
|
21
|
+
grid-auto-columns: auto;
|
|
22
|
+
grid-auto-flow: column;
|
|
23
|
+
inline-size: fit-content;
|
|
24
|
+
|
|
25
|
+
:where(input[type="checkbox"][role="switch"]) {
|
|
26
|
+
appearance: none;
|
|
27
|
+
block-size: var(--_track-height);
|
|
28
|
+
cursor: pointer;
|
|
29
|
+
inline-size: var(--_track-width);
|
|
30
|
+
margin: 0;
|
|
31
|
+
position: relative;
|
|
32
|
+
|
|
33
|
+
/* Track */
|
|
34
|
+
&::before {
|
|
35
|
+
background-color: var(--_track-bg-color);
|
|
36
|
+
block-size: var(--_track-height);
|
|
37
|
+
border: 1px solid var(--_dot-bg-color);
|
|
38
|
+
border-radius: var(--radius-round);
|
|
39
|
+
content: "";
|
|
40
|
+
inline-size: var(--_track-width);
|
|
41
|
+
inset: 0;
|
|
42
|
+
position: absolute;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
&:focus-visible {
|
|
46
|
+
--focus-ring-color: currentColor;
|
|
47
|
+
outline: var(--focus-ring-width) var(--focus-ring-style) var(--focus-ring-color);
|
|
48
|
+
outline-offset: var(--focus-ring-offset);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/* Dot */
|
|
52
|
+
&::after {
|
|
53
|
+
background-color: var(--_dot-bg-color);
|
|
54
|
+
block-size: var(--_dot-size);
|
|
55
|
+
border-radius: var(--radius-round);
|
|
56
|
+
content: "";
|
|
57
|
+
inline-size: var(--_dot-size);
|
|
58
|
+
inset: var(--_dot-inset);
|
|
59
|
+
outline: var(--_dot-outline-size) solid var(--_dot-bg-color);
|
|
60
|
+
outline-offset: -1px;
|
|
61
|
+
position: absolute;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/* Checked */
|
|
65
|
+
&:checked {
|
|
66
|
+
&::before {
|
|
67
|
+
background-color: var(--_accent-color);
|
|
68
|
+
border-color: var(--_accent-color);
|
|
69
|
+
transition:
|
|
70
|
+
background-color var(--_transition-time) var(--_transition-tf),
|
|
71
|
+
border-color var(--_transition-time) var(--_transition-tf);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/* Dot */
|
|
75
|
+
&::after {
|
|
76
|
+
--_dot-bg-color: var(--_accent-contrast);
|
|
77
|
+
--_dot-outline-size: calc(var(--size-1) - 1px);
|
|
78
|
+
|
|
79
|
+
inset-inline-start: calc(var(--_track-width) - var(--_dot-size) - var(--size-1));
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/* Animation */
|
|
84
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
85
|
+
|
|
86
|
+
/* Track */
|
|
87
|
+
&::before {
|
|
88
|
+
transition:
|
|
89
|
+
background-color var(--_transition-time) var(--_transition-tf),
|
|
90
|
+
border-color var(--_transition-time) var(--_transition-tf);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/* Dot */
|
|
94
|
+
&::after {
|
|
95
|
+
transition: all var(--_transition-time) var(--_transition-tf);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
&:active:after {
|
|
99
|
+
--_dot-outline-size: calc(var(--size-1) + 1px);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
&:checked {
|
|
103
|
+
&:active:after {
|
|
104
|
+
--_dot-outline-size: calc(var(--size-1) + 1px);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
/* Icons */
|
|
111
|
+
&:has(.icon-checked, .icon-unchecked) {
|
|
112
|
+
[role="switch"] {
|
|
113
|
+
grid-column: 1 / -1;
|
|
114
|
+
grid-row: 1;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
&:has([role="switch"]:checked) {
|
|
118
|
+
.icon-unchecked {
|
|
119
|
+
display: none;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
.icon-checked {
|
|
123
|
+
display: block;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
.icon-checked {
|
|
128
|
+
display: none;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
.icon-unchecked,
|
|
132
|
+
.icon-checked {
|
|
133
|
+
grid-column: 1;
|
|
134
|
+
grid-row: 1;
|
|
135
|
+
pointer-events: none;
|
|
136
|
+
z-index: 1;
|
|
137
|
+
|
|
138
|
+
svg {
|
|
139
|
+
display: block;
|
|
140
|
+
inline-size: var(--_dot-size);
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
.icon-unchecked {
|
|
145
|
+
margin-inline-start: calc(var(--_track-width) - var(--_dot-size) - var(--size-1));
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
.icon-checked {
|
|
149
|
+
margin-inline-start: var(--size-1);
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
/* Required dot */
|
|
154
|
+
&:has(:invalid) {
|
|
155
|
+
.label:after {
|
|
156
|
+
color: var(--red);
|
|
157
|
+
content: "*";
|
|
158
|
+
inset: 0 -0.25ex auto auto;
|
|
159
|
+
position: absolute;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
/* Disabled */
|
|
164
|
+
&:has([disabled]) {
|
|
165
|
+
cursor: not-allowed;
|
|
166
|
+
opacity: 0.64;
|
|
167
|
+
user-select: none;
|
|
168
|
+
|
|
169
|
+
input {
|
|
170
|
+
cursor: not-allowed;
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
/* Label */
|
|
175
|
+
.label {
|
|
176
|
+
color: var(--text-primary);
|
|
177
|
+
font-size: var(--font-size-05);
|
|
178
|
+
grid-column: 2;
|
|
179
|
+
grid-row: 1;
|
|
180
|
+
min-width: 0;
|
|
181
|
+
padding-inline: 0 1ex;
|
|
182
|
+
position: relative;
|
|
183
|
+
user-select: none;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
/* End text */
|
|
187
|
+
:where(.end-text) {
|
|
188
|
+
color: var(--text-muted);
|
|
189
|
+
font-size: var(--font-size-0);
|
|
190
|
+
grid-column: 2;
|
|
191
|
+
grid-row: 2;
|
|
192
|
+
line-height: 1.5;
|
|
193
|
+
z-index: 1;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
/* Size */
|
|
197
|
+
&.small {
|
|
198
|
+
--_dot-size: 0.75rem;
|
|
199
|
+
--_track-height: var(--size-4);
|
|
200
|
+
--_track-width: 2.5rem;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
/* Spread layout */
|
|
204
|
+
&.spread {
|
|
205
|
+
align-items: center;
|
|
206
|
+
column-gap: var(--size-4);
|
|
207
|
+
grid-auto-flow: unset;
|
|
208
|
+
grid-template-columns: 1fr auto;
|
|
209
|
+
inline-size: 100%;
|
|
210
|
+
|
|
211
|
+
.label {
|
|
212
|
+
font-weight: 600;
|
|
213
|
+
grid-column: 1;
|
|
214
|
+
grid-row: 1;
|
|
215
|
+
inline-size: fit-content;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
input[role="switch"] {
|
|
219
|
+
grid-column: 2;
|
|
220
|
+
grid-row: 1;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
&:has(.icon-checked, .icon-unchecked) {
|
|
224
|
+
|
|
225
|
+
input[role="switch"],
|
|
226
|
+
.icon-checked,
|
|
227
|
+
.icon-unchecked {
|
|
228
|
+
grid-column: 2;
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
:where(.end-text) {
|
|
233
|
+
grid-column: 1;
|
|
234
|
+
grid-row: 2;
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
/* Stacked layout */
|
|
239
|
+
&.stack {
|
|
240
|
+
grid-auto-columns: unset;
|
|
241
|
+
justify-items: center;
|
|
242
|
+
|
|
243
|
+
.label {
|
|
244
|
+
grid-column: 1/-1;
|
|
245
|
+
grid-row: 2;
|
|
246
|
+
margin-block-start: var(--size-1);
|
|
247
|
+
padding-inline: 1ex;
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
.end-text {
|
|
251
|
+
grid-column: 1/-1;
|
|
252
|
+
grid-row: 3;
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
/* Validation */
|
|
257
|
+
&[data-invalid] {
|
|
258
|
+
input {
|
|
259
|
+
border-radius: var(--radius-round);
|
|
260
|
+
outline: 2px solid var(--color-9);
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
.end-text {
|
|
264
|
+
color: var(--color-9);
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
}
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
@layer components.root {
|
|
2
|
+
:where(table) {
|
|
3
|
+
--_table-border-radius: var(--border-radius);
|
|
4
|
+
|
|
5
|
+
border-collapse: separate;
|
|
6
|
+
border-spacing: 0;
|
|
7
|
+
border: 1px solid var(--border-color);
|
|
8
|
+
border-radius: var(--_table-border-radius);
|
|
9
|
+
overflow: hidden;
|
|
10
|
+
inline-size: 100%;
|
|
11
|
+
margin: var(--size-3) 0;
|
|
12
|
+
position: relative;
|
|
13
|
+
|
|
14
|
+
/* Rows */
|
|
15
|
+
tr {
|
|
16
|
+
&:hover {
|
|
17
|
+
background-color: oklch(from var(--surface-filled) l c h / 75%);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/* Cells */
|
|
22
|
+
th,
|
|
23
|
+
td {
|
|
24
|
+
background-color: var(--surface-default);
|
|
25
|
+
border-inline-end: var(--border-width) solid var(--border-color);
|
|
26
|
+
border-block-end: var(--border-width) solid var(--border-color);
|
|
27
|
+
padding: var(--size-1) var(--size-2);
|
|
28
|
+
|
|
29
|
+
&:last-child {
|
|
30
|
+
border-inline-end: none;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/* Remove bottom border only on the last row of the table */
|
|
35
|
+
&>*:last-child tr:last-child {
|
|
36
|
+
|
|
37
|
+
th,
|
|
38
|
+
td {
|
|
39
|
+
border-block-end: none;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
th {
|
|
44
|
+
background-color: var(--surface-filled);
|
|
45
|
+
color: var(--text-primary);
|
|
46
|
+
font-size: var(--font-size-05);
|
|
47
|
+
font-weight: 600;
|
|
48
|
+
text-align: start;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
td {
|
|
52
|
+
font-size: var(--font-size-05);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/* Round corner cells */
|
|
56
|
+
&>thead:first-of-type tr:first-child {
|
|
57
|
+
th:first-child {
|
|
58
|
+
border-start-start-radius: var(--_table-border-radius);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
th:last-child {
|
|
62
|
+
border-start-end-radius: var(--_table-border-radius);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/* Logic for tables without thead */
|
|
67
|
+
&>tbody:first-of-type:not(thead ~ tbody) tr:first-child {
|
|
68
|
+
td:first-child {
|
|
69
|
+
border-start-start-radius: var(--_table-border-radius);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
td:last-child {
|
|
73
|
+
border-start-end-radius: var(--_table-border-radius);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/* Logic for bottom corners (whether in tbody or tfoot) */
|
|
78
|
+
&>*:last-child tr:last-child {
|
|
79
|
+
:where(th, td):first-child {
|
|
80
|
+
border-end-start-radius: var(--_table-border-radius);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
:where(th, td):last-child {
|
|
84
|
+
border-end-end-radius: var(--_table-border-radius);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/* Footer */
|
|
89
|
+
tfoot {
|
|
90
|
+
tr td {
|
|
91
|
+
background-color: var(--surface-filled);
|
|
92
|
+
padding-block: var(--size-2);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
td {
|
|
96
|
+
color: var(--text-primary);
|
|
97
|
+
font-weight: 600;
|
|
98
|
+
border-top: var(--border-width) solid var(--border-color);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/* Caption */
|
|
103
|
+
caption {
|
|
104
|
+
caption-side: bottom;
|
|
105
|
+
color: var(--text-muted);
|
|
106
|
+
font-size: var(--font-size-05);
|
|
107
|
+
margin-inline-start: var(--size-2);
|
|
108
|
+
padding: var(--size-2) 0;
|
|
109
|
+
text-align: start;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
/* Header */
|
|
113
|
+
thead {
|
|
114
|
+
z-index: 1;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
/* Remove bottom border of the row above the footer to stay single-line */
|
|
118
|
+
tbody:has(+ tfoot) tr:last-child td {
|
|
119
|
+
border-block-end: none;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
/* Column group */
|
|
123
|
+
colgroup col {
|
|
124
|
+
border: none;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
@container (width < 60ch) {
|
|
128
|
+
|
|
129
|
+
th,
|
|
130
|
+
td {
|
|
131
|
+
padding: var(--size-1) 0.875rem;
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
/* Spacious */
|
|
136
|
+
&.spacious {
|
|
137
|
+
|
|
138
|
+
th,
|
|
139
|
+
td {
|
|
140
|
+
padding: var(--size-3);
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
caption {
|
|
144
|
+
margin-inline-start: var(--size-3);
|
|
145
|
+
padding: var(--size-2) 0;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
@container (width < 60ch) {
|
|
149
|
+
|
|
150
|
+
th,
|
|
151
|
+
td {
|
|
152
|
+
padding: var(--size-3);
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
/* Dense */
|
|
158
|
+
&.dense {
|
|
159
|
+
|
|
160
|
+
th,
|
|
161
|
+
td {
|
|
162
|
+
padding: var(--size-1);
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
caption {
|
|
166
|
+
margin-inline-start: var(--size-1);
|
|
167
|
+
padding: var(--size-1) 0;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
@container (width < 60ch) {
|
|
171
|
+
|
|
172
|
+
th,
|
|
173
|
+
td {
|
|
174
|
+
padding: var(--size-1);
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
}
|