opui-css 4.1.0 → 5.0.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/CHANGELOG.md +282 -247
- package/LICENSE +21 -21
- package/MIGRATING.md +127 -105
- package/README.md +87 -87
- package/astro/index.ts +46 -46
- package/components/AGENTS.md +248 -247
- package/components/Accordion/Accordion.astro +42 -42
- package/components/Anchor/Anchor.astro +51 -51
- package/components/Avatar/Avatar.astro +38 -44
- package/components/Badge/Badge.astro +59 -54
- package/components/Button/Button.astro +45 -45
- package/components/ButtonGroup/ButtonGroup.astro +29 -29
- package/components/Callout/Callout.astro +75 -75
- package/components/Card/Card.astro +36 -36
- package/components/Checkbox/Checkbox.astro +76 -76
- package/components/Checkbox/CheckboxInput.astro +32 -32
- package/components/Chip/Chip.astro +37 -37
- package/components/ClassicSelect/ClassicSelect.astro +83 -83
- package/components/DescriptionList/Description.astro +12 -12
- package/components/DescriptionList/DescriptionList.astro +22 -22
- package/components/DescriptionList/Item.astro +12 -12
- package/components/DescriptionList/Term.astro +12 -12
- package/components/DescriptionList/index.ts +12 -12
- package/components/Dialog/Dialog.astro +41 -41
- package/components/Divider/Divider.astro +17 -14
- package/components/Drawer/Drawer.astro +49 -49
- package/components/Drawer/DrawerFooter.astro +14 -14
- package/components/Drawer/DrawerHeader.astro +31 -31
- package/components/FieldDescription/FieldDescription.astro +13 -13
- package/components/FieldGroup/FieldGroup.astro +31 -31
- package/components/FieldLegend/FieldLegend.astro +15 -15
- package/components/FieldSet/FieldSet.astro +15 -15
- package/components/Form/Form.astro +15 -15
- package/components/IconButton/IconButton.astro +26 -26
- package/components/List/List.astro +36 -36
- package/components/ListItem/ListItem.astro +118 -118
- package/components/Progress/Progress.astro +41 -40
- package/components/Radio/Radio.astro +70 -70
- package/components/Radio/RadioInput.astro +24 -24
- package/components/Range/Range.astro +136 -136
- package/components/Select/Select.astro +106 -106
- package/components/Switch/Switch.astro +101 -101
- package/components/Switch/SwitchInput.astro +25 -25
- package/components/Table/Body.astro +13 -13
- package/components/Table/Cell.astro +13 -13
- package/components/Table/Column.astro +15 -15
- package/components/Table/ColumnGroup.astro +13 -13
- package/components/Table/Head.astro +13 -13
- package/components/Table/HeaderCell.astro +13 -13
- package/components/Table/Row.astro +13 -13
- package/components/Table/Table.astro +18 -15
- package/components/Table/index.ts +20 -20
- package/components/Tabs/Tabs.astro +28 -28
- package/components/Tabs/TabsItem.astro +47 -47
- package/components/Tabs/TabsPanel.astro +21 -21
- package/components/Tabs/TabsTab.astro +19 -19
- package/components/Tabs/index.ts +14 -14
- package/components/TextField/TextField.astro +128 -128
- package/components/Textarea/Textarea.astro +106 -106
- package/components/Toast/Toast.astro +42 -42
- package/components/ToggleButton/ToggleButton.astro +53 -53
- package/components/ToggleGroup/ToggleGroup.astro +49 -49
- package/components/Tooltip/Tooltip.astro +30 -30
- package/core/normalize.css +194 -194
- package/core/palette.css +59 -59
- package/core/utils.css +71 -71
- package/css/components/accordion.css +174 -174
- package/css/components/anchor.css +27 -27
- package/css/components/avatar.css +65 -65
- package/css/components/badge.css +107 -107
- package/css/components/button-group.css +179 -179
- package/css/components/button.css +215 -215
- package/css/components/callout.css +109 -109
- package/css/components/card.css +117 -117
- package/css/components/checkbox.css +205 -205
- package/css/components/chip.css +87 -87
- package/css/components/description-list.css +80 -77
- package/css/components/dialog.css +68 -68
- package/css/components/divider.css +20 -20
- package/css/components/drawer.css +171 -171
- package/css/components/form.css +146 -146
- package/css/components/icon-button.css +139 -139
- package/css/components/link.css +21 -21
- package/css/components/list.css +345 -345
- package/css/components/progress.css +102 -97
- package/css/components/radio.css +172 -172
- package/css/components/range.css +337 -337
- package/css/components/select.css +169 -169
- package/css/components/spinner.css +37 -37
- package/css/components/switch.css +268 -268
- package/css/components/table.css +179 -179
- package/css/components/tabs.css +83 -77
- package/css/components/text-field.css +450 -450
- package/css/components/text-input.css +64 -64
- package/css/components/textarea.css +24 -24
- package/css/components/toast.css +161 -161
- package/css/components/toggle-button.css +87 -87
- package/css/components/toggle-group.css +56 -56
- package/css/components/tooltip.css +67 -67
- package/css/components/typography.css +585 -585
- package/css/components.css +41 -41
- package/css/imports.css +16 -16
- package/css/js/checkbox.js +21 -21
- package/css/js/toast.js +94 -94
- package/css/theme.css +132 -132
- package/dist/op.css +65 -65
- package/dist/op.css.map +1 -1
- package/dist/opui.components.css +5159 -5145
- package/dist/opui.components.css.map +1 -1
- package/dist/opui.css +5668 -5654
- package/dist/opui.css.map +1 -1
- package/env.d.ts +14 -14
- package/open-props.css +9 -9
- package/package.json +81 -81
|
@@ -1,171 +1,171 @@
|
|
|
1
|
-
@layer components.root {
|
|
2
|
-
:where(dialog.drawer) {
|
|
3
|
-
--_backdrop-bg-color: transparent;
|
|
4
|
-
--_backdrop-blur: blur(2px);
|
|
5
|
-
--_bg-color: var(--surface-default);
|
|
6
|
-
--_block-size: min(80vb, 650px);
|
|
7
|
-
--_border-color: var(--border-color);
|
|
8
|
-
--_border-width: var(--border-width);
|
|
9
|
-
--_color: var(--text-primary);
|
|
10
|
-
--_content-padding: var(--size-4);
|
|
11
|
-
--_footer-gap: var(--size-3);
|
|
12
|
-
--_footer-padding: var(--size-3);
|
|
13
|
-
--_header-font-size: var(--font-size-3);
|
|
14
|
-
--_header-padding: var(--size-3);
|
|
15
|
-
--_inline-size: min(375px, 100vi);
|
|
16
|
-
--_shadow: var(--shadow-2);
|
|
17
|
-
--_transition-duration: 0.2s;
|
|
18
|
-
--_transition-timing: var(--ease-out-3);
|
|
19
|
-
|
|
20
|
-
background-color: var(--_bg-color);
|
|
21
|
-
border: none;
|
|
22
|
-
box-shadow: var(--_shadow);
|
|
23
|
-
color: var(--_color);
|
|
24
|
-
display: flex;
|
|
25
|
-
flex-direction: column;
|
|
26
|
-
margin: 0;
|
|
27
|
-
max-inline-size: 100%;
|
|
28
|
-
padding: 0;
|
|
29
|
-
position: fixed;
|
|
30
|
-
transition:
|
|
31
|
-
display var(--_transition-duration) allow-discrete,
|
|
32
|
-
overlay var(--_transition-duration) allow-discrete,
|
|
33
|
-
translate var(--_transition-duration) var(--_transition-timing);
|
|
34
|
-
z-index: 1000;
|
|
35
|
-
|
|
36
|
-
&::backdrop {
|
|
37
|
-
backdrop-filter: var(--_backdrop-blur);
|
|
38
|
-
background-color: var(--_backdrop-bg-color);
|
|
39
|
-
opacity: 0;
|
|
40
|
-
transition:
|
|
41
|
-
display var(--_transition-duration) allow-discrete,
|
|
42
|
-
overlay var(--_transition-duration) allow-discrete,
|
|
43
|
-
opacity var(--_transition-duration) var(--_transition-timing);
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
&.backdrop-transparent {
|
|
47
|
-
--_backdrop-blur: none;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
.header {
|
|
51
|
-
align-items: center;
|
|
52
|
-
border-block-end: var(--_border-width) solid var(--_border-color);
|
|
53
|
-
display: flex;
|
|
54
|
-
padding: var(--_header-padding);
|
|
55
|
-
|
|
56
|
-
:where(h1, h2, h3, h4, h5, h6) {
|
|
57
|
-
font-size: var(--_header-font-size);
|
|
58
|
-
margin: 0;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
:where(.icon-button) {
|
|
62
|
-
margin-inline-start: auto;
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
.content {
|
|
67
|
-
flex: 1;
|
|
68
|
-
overflow-y: auto;
|
|
69
|
-
padding: var(--_content-padding);
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
.footer {
|
|
73
|
-
border-block-start: var(--_border-width) solid var(--_border-color);
|
|
74
|
-
display: flex;
|
|
75
|
-
gap: var(--_footer-gap);
|
|
76
|
-
justify-content: end;
|
|
77
|
-
padding: var(--_footer-padding);
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
&.inline-start,
|
|
81
|
-
&.inline-end {
|
|
82
|
-
block-size: 100dvb;
|
|
83
|
-
inline-size: var(--_inline-size);
|
|
84
|
-
inset-block: 0;
|
|
85
|
-
max-block-size: 100%;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
&.inline-start {
|
|
89
|
-
border-inline-end: var(--_border-width) solid var(--_border-color);
|
|
90
|
-
inset-inline-end: auto;
|
|
91
|
-
inset-inline-start: 0;
|
|
92
|
-
translate: -100% 0;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
&.inline-end {
|
|
96
|
-
border-inline-start: var(--_border-width) solid var(--_border-color);
|
|
97
|
-
inset-inline-end: 0;
|
|
98
|
-
inset-inline-start: auto;
|
|
99
|
-
translate: 100% 0;
|
|
100
|
-
|
|
101
|
-
.footer {
|
|
102
|
-
justify-content: start;
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
&.block-start,
|
|
107
|
-
&.block-end {
|
|
108
|
-
block-size: var(--_block-size);
|
|
109
|
-
inline-size: 100dvi;
|
|
110
|
-
inset-inline: 0;
|
|
111
|
-
max-block-size: 80dvb;
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
&.block-start {
|
|
115
|
-
border-block-end: var(--_border-width) solid var(--_border-color);
|
|
116
|
-
inset-block-end: auto;
|
|
117
|
-
inset-block-start: 0;
|
|
118
|
-
translate: 0 -100%;
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
&.block-end {
|
|
122
|
-
border-block-start: var(--_border-width) solid var(--_border-color);
|
|
123
|
-
inset-block-end: 0;
|
|
124
|
-
inset-block-start: auto;
|
|
125
|
-
translate: 0 100%;
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
&[open] {
|
|
129
|
-
translate: 0 0;
|
|
130
|
-
|
|
131
|
-
&::backdrop {
|
|
132
|
-
opacity: 1;
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
@starting-style {
|
|
136
|
-
&::backdrop {
|
|
137
|
-
opacity: 0;
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
&.inline-start {
|
|
141
|
-
translate: -100% 0;
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
&.inline-end {
|
|
145
|
-
translate: 100% 0;
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
&.block-start {
|
|
149
|
-
translate: 0 -100%;
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
&.block-end {
|
|
153
|
-
translate: 0 100%;
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
/* Scroll-lock is provided by the shared `.scroll-lock` utility in core/utils.css.
|
|
160
|
-
This carve-out re-enables page scrolling when a transparent-backdrop drawer is
|
|
161
|
-
open on wide viewports (where the drawer doesn't visually cover the page). */
|
|
162
|
-
html:has(dialog.drawer.scroll-lock[open].backdrop-transparent) {
|
|
163
|
-
overflow: unset;
|
|
164
|
-
overscroll-behavior: auto;
|
|
165
|
-
|
|
166
|
-
@media (width < 500px) {
|
|
167
|
-
overflow: clip;
|
|
168
|
-
overscroll-behavior: contain;
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
}
|
|
1
|
+
@layer components.root {
|
|
2
|
+
:where(dialog.ui-drawer) {
|
|
3
|
+
--_backdrop-bg-color: transparent;
|
|
4
|
+
--_backdrop-blur: blur(2px);
|
|
5
|
+
--_bg-color: var(--surface-default);
|
|
6
|
+
--_block-size: min(80vb, 650px);
|
|
7
|
+
--_border-color: var(--border-color);
|
|
8
|
+
--_border-width: var(--border-width);
|
|
9
|
+
--_color: var(--text-primary);
|
|
10
|
+
--_content-padding: var(--size-4);
|
|
11
|
+
--_footer-gap: var(--size-3);
|
|
12
|
+
--_footer-padding: var(--size-3);
|
|
13
|
+
--_header-font-size: var(--font-size-3);
|
|
14
|
+
--_header-padding: var(--size-3);
|
|
15
|
+
--_inline-size: min(375px, 100vi);
|
|
16
|
+
--_shadow: var(--shadow-2);
|
|
17
|
+
--_transition-duration: 0.2s;
|
|
18
|
+
--_transition-timing: var(--ease-out-3);
|
|
19
|
+
|
|
20
|
+
background-color: var(--_bg-color);
|
|
21
|
+
border: none;
|
|
22
|
+
box-shadow: var(--_shadow);
|
|
23
|
+
color: var(--_color);
|
|
24
|
+
display: flex;
|
|
25
|
+
flex-direction: column;
|
|
26
|
+
margin: 0;
|
|
27
|
+
max-inline-size: 100%;
|
|
28
|
+
padding: 0;
|
|
29
|
+
position: fixed;
|
|
30
|
+
transition:
|
|
31
|
+
display var(--_transition-duration) allow-discrete,
|
|
32
|
+
overlay var(--_transition-duration) allow-discrete,
|
|
33
|
+
translate var(--_transition-duration) var(--_transition-timing);
|
|
34
|
+
z-index: 1000;
|
|
35
|
+
|
|
36
|
+
&::backdrop {
|
|
37
|
+
backdrop-filter: var(--_backdrop-blur);
|
|
38
|
+
background-color: var(--_backdrop-bg-color);
|
|
39
|
+
opacity: 0;
|
|
40
|
+
transition:
|
|
41
|
+
display var(--_transition-duration) allow-discrete,
|
|
42
|
+
overlay var(--_transition-duration) allow-discrete,
|
|
43
|
+
opacity var(--_transition-duration) var(--_transition-timing);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
&.ui-backdrop-transparent {
|
|
47
|
+
--_backdrop-blur: none;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.ui-header {
|
|
51
|
+
align-items: center;
|
|
52
|
+
border-block-end: var(--_border-width) solid var(--_border-color);
|
|
53
|
+
display: flex;
|
|
54
|
+
padding: var(--_header-padding);
|
|
55
|
+
|
|
56
|
+
:where(h1, h2, h3, h4, h5, h6) {
|
|
57
|
+
font-size: var(--_header-font-size);
|
|
58
|
+
margin: 0;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
:where(.ui-icon-button) {
|
|
62
|
+
margin-inline-start: auto;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.ui-content {
|
|
67
|
+
flex: 1;
|
|
68
|
+
overflow-y: auto;
|
|
69
|
+
padding: var(--_content-padding);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.ui-footer {
|
|
73
|
+
border-block-start: var(--_border-width) solid var(--_border-color);
|
|
74
|
+
display: flex;
|
|
75
|
+
gap: var(--_footer-gap);
|
|
76
|
+
justify-content: end;
|
|
77
|
+
padding: var(--_footer-padding);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
&.ui-inline-start,
|
|
81
|
+
&.ui-inline-end {
|
|
82
|
+
block-size: 100dvb;
|
|
83
|
+
inline-size: var(--_inline-size);
|
|
84
|
+
inset-block: 0;
|
|
85
|
+
max-block-size: 100%;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
&.ui-inline-start {
|
|
89
|
+
border-inline-end: var(--_border-width) solid var(--_border-color);
|
|
90
|
+
inset-inline-end: auto;
|
|
91
|
+
inset-inline-start: 0;
|
|
92
|
+
translate: -100% 0;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
&.ui-inline-end {
|
|
96
|
+
border-inline-start: var(--_border-width) solid var(--_border-color);
|
|
97
|
+
inset-inline-end: 0;
|
|
98
|
+
inset-inline-start: auto;
|
|
99
|
+
translate: 100% 0;
|
|
100
|
+
|
|
101
|
+
.ui-footer {
|
|
102
|
+
justify-content: start;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
&.ui-block-start,
|
|
107
|
+
&.ui-block-end {
|
|
108
|
+
block-size: var(--_block-size);
|
|
109
|
+
inline-size: 100dvi;
|
|
110
|
+
inset-inline: 0;
|
|
111
|
+
max-block-size: 80dvb;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
&.ui-block-start {
|
|
115
|
+
border-block-end: var(--_border-width) solid var(--_border-color);
|
|
116
|
+
inset-block-end: auto;
|
|
117
|
+
inset-block-start: 0;
|
|
118
|
+
translate: 0 -100%;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
&.ui-block-end {
|
|
122
|
+
border-block-start: var(--_border-width) solid var(--_border-color);
|
|
123
|
+
inset-block-end: 0;
|
|
124
|
+
inset-block-start: auto;
|
|
125
|
+
translate: 0 100%;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
&[open] {
|
|
129
|
+
translate: 0 0;
|
|
130
|
+
|
|
131
|
+
&::backdrop {
|
|
132
|
+
opacity: 1;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
@starting-style {
|
|
136
|
+
&::backdrop {
|
|
137
|
+
opacity: 0;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
&.ui-inline-start {
|
|
141
|
+
translate: -100% 0;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
&.ui-inline-end {
|
|
145
|
+
translate: 100% 0;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
&.ui-block-start {
|
|
149
|
+
translate: 0 -100%;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
&.ui-block-end {
|
|
153
|
+
translate: 0 100%;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
/* Scroll-lock is provided by the shared `.ui-scroll-lock` utility in core/utils.css.
|
|
160
|
+
This carve-out re-enables page scrolling when a transparent-backdrop drawer is
|
|
161
|
+
open on wide viewports (where the drawer doesn't visually cover the page). */
|
|
162
|
+
html:has(dialog.ui-drawer.ui-scroll-lock[open].ui-backdrop-transparent) {
|
|
163
|
+
overflow: unset;
|
|
164
|
+
overscroll-behavior: auto;
|
|
165
|
+
|
|
166
|
+
@media (width < 500px) {
|
|
167
|
+
overflow: clip;
|
|
168
|
+
overscroll-behavior: contain;
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
}
|
package/css/components/form.css
CHANGED
|
@@ -1,146 +1,146 @@
|
|
|
1
|
-
@layer components.extended {
|
|
2
|
-
|
|
3
|
-
/* Form */
|
|
4
|
-
:where(.form) {
|
|
5
|
-
display: grid;
|
|
6
|
-
gap: var(--size-8);
|
|
7
|
-
|
|
8
|
-
hr {
|
|
9
|
-
margin-block: 0;
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
/* Fieldset */
|
|
14
|
-
:where(.fieldset) {
|
|
15
|
-
all: unset;
|
|
16
|
-
border: 0;
|
|
17
|
-
border-radius: 0;
|
|
18
|
-
display: grid;
|
|
19
|
-
gap: var(--size-1);
|
|
20
|
-
margin: 0;
|
|
21
|
-
min-inline-size: 0;
|
|
22
|
-
padding: 0;
|
|
23
|
-
|
|
24
|
-
/* Legend */
|
|
25
|
-
:where(legend, .legend) {
|
|
26
|
-
all: unset;
|
|
27
|
-
color: var(--text-primary);
|
|
28
|
-
font-weight: 600;
|
|
29
|
-
margin-block-end: var(--size-3);
|
|
30
|
-
padding: 0;
|
|
31
|
-
|
|
32
|
-
&:has(+ :where(.field-description)) {
|
|
33
|
-
margin-block-end: 0;
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
/* Field description / supporting text */
|
|
38
|
-
:where(.field-description) {
|
|
39
|
-
color: var(--text-muted);
|
|
40
|
-
font-size: var(--font-size-05);
|
|
41
|
-
line-height: var(--font-lineheight-3);
|
|
42
|
-
|
|
43
|
-
&:has(+ *) {
|
|
44
|
-
margin-block-end: var(--size-3);
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
/* End text */
|
|
49
|
-
:where(.end-text) {
|
|
50
|
-
color: var(--text-muted);
|
|
51
|
-
font-size: var(--font-size-0);
|
|
52
|
-
line-height: var(--font-lineheight-3);
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
&:has(.text-field.row) {
|
|
56
|
-
row-gap: var(--size-7);
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
/* Disabled */
|
|
60
|
-
&[disabled] {
|
|
61
|
-
opacity: 0.64;
|
|
62
|
-
user-select: none;
|
|
63
|
-
|
|
64
|
-
input,
|
|
65
|
-
label,
|
|
66
|
-
.label {
|
|
67
|
-
cursor: not-allowed;
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
/* Error / validation */
|
|
72
|
-
&[data-invalid] {
|
|
73
|
-
:where(.end-text) {
|
|
74
|
-
color: var(--primary);
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
:where(.checkbox, .radio, .switch) {
|
|
78
|
-
--palette-source: oklch(0.58 0.21 var(--hue-red));
|
|
79
|
-
|
|
80
|
-
:where(.end-text) {
|
|
81
|
-
color: var(--primary);
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
:where(.switch) {
|
|
86
|
-
input {
|
|
87
|
-
border-radius: var(--radius-round);
|
|
88
|
-
outline: 2px solid var(--primary);
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
/* Required */
|
|
94
|
-
&:has(:invalid) {
|
|
95
|
-
:where(legend, .legend) {
|
|
96
|
-
padding-inline-end: 1ex;
|
|
97
|
-
position: relative;
|
|
98
|
-
|
|
99
|
-
&::after {
|
|
100
|
-
color: var(--red);
|
|
101
|
-
content: "*";
|
|
102
|
-
inset: 0 -0.25ex auto auto;
|
|
103
|
-
position: absolute;
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
/* Field group */
|
|
110
|
-
:where(.field-group) {
|
|
111
|
-
display: flex;
|
|
112
|
-
flex-direction: column;
|
|
113
|
-
gap: var(--size-4);
|
|
114
|
-
|
|
115
|
-
/* If it only has checkboxes, radios, or switches */
|
|
116
|
-
&:has(> :where(.checkbox, .radio, .switch)):not(:has(> :not(.checkbox, .radio, .switch))) {
|
|
117
|
-
gap: var(--size-2);
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
/* If it only has buttons */
|
|
121
|
-
&:has(.button):not(:has(*:not(.button))) {
|
|
122
|
-
align-items: center;
|
|
123
|
-
flex-direction: row;
|
|
124
|
-
gap: var(--size-2);
|
|
125
|
-
|
|
126
|
-
/* If it's not preceeded by an hr */
|
|
127
|
-
&:not(hr + &) {
|
|
128
|
-
margin-block-start: var(--size-4);
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
&+& {
|
|
133
|
-
margin-block-start: var(--size-5);
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
/* Directions */
|
|
137
|
-
&.row {
|
|
138
|
-
flex-direction: row;
|
|
139
|
-
flex-wrap: wrap;
|
|
140
|
-
|
|
141
|
-
&:has(> :where(.checkbox, .radio, .switch)) {
|
|
142
|
-
gap: var(--size-4);
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
}
|
|
1
|
+
@layer components.extended {
|
|
2
|
+
|
|
3
|
+
/* Form */
|
|
4
|
+
:where(.ui-form) {
|
|
5
|
+
display: grid;
|
|
6
|
+
gap: var(--size-8);
|
|
7
|
+
|
|
8
|
+
hr {
|
|
9
|
+
margin-block: 0;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/* Fieldset */
|
|
14
|
+
:where(.ui-fieldset) {
|
|
15
|
+
all: unset;
|
|
16
|
+
border: 0;
|
|
17
|
+
border-radius: 0;
|
|
18
|
+
display: grid;
|
|
19
|
+
gap: var(--size-1);
|
|
20
|
+
margin: 0;
|
|
21
|
+
min-inline-size: 0;
|
|
22
|
+
padding: 0;
|
|
23
|
+
|
|
24
|
+
/* Legend */
|
|
25
|
+
:where(legend, .ui-legend) {
|
|
26
|
+
all: unset;
|
|
27
|
+
color: var(--text-primary);
|
|
28
|
+
font-weight: 600;
|
|
29
|
+
margin-block-end: var(--size-3);
|
|
30
|
+
padding: 0;
|
|
31
|
+
|
|
32
|
+
&:has(+ :where(.ui-field-description)) {
|
|
33
|
+
margin-block-end: 0;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/* Field description / supporting text */
|
|
38
|
+
:where(.ui-field-description) {
|
|
39
|
+
color: var(--text-muted);
|
|
40
|
+
font-size: var(--font-size-05);
|
|
41
|
+
line-height: var(--font-lineheight-3);
|
|
42
|
+
|
|
43
|
+
&:has(+ *) {
|
|
44
|
+
margin-block-end: var(--size-3);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/* End text */
|
|
49
|
+
:where(.ui-end-text) {
|
|
50
|
+
color: var(--text-muted);
|
|
51
|
+
font-size: var(--font-size-0);
|
|
52
|
+
line-height: var(--font-lineheight-3);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
&:has(.ui-text-field.ui-row) {
|
|
56
|
+
row-gap: var(--size-7);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/* Disabled */
|
|
60
|
+
&[disabled] {
|
|
61
|
+
opacity: 0.64;
|
|
62
|
+
user-select: none;
|
|
63
|
+
|
|
64
|
+
input,
|
|
65
|
+
label,
|
|
66
|
+
.ui-label {
|
|
67
|
+
cursor: not-allowed;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/* Error / validation */
|
|
72
|
+
&[data-invalid] {
|
|
73
|
+
:where(.ui-end-text) {
|
|
74
|
+
color: var(--primary);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
:where(.ui-checkbox, .ui-radio, .ui-switch) {
|
|
78
|
+
--palette-source: oklch(0.58 0.21 var(--hue-red));
|
|
79
|
+
|
|
80
|
+
:where(.ui-end-text) {
|
|
81
|
+
color: var(--primary);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
:where(.ui-switch) {
|
|
86
|
+
input {
|
|
87
|
+
border-radius: var(--radius-round);
|
|
88
|
+
outline: 2px solid var(--primary);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/* Required */
|
|
94
|
+
&:has(:invalid) {
|
|
95
|
+
:where(legend, .ui-legend) {
|
|
96
|
+
padding-inline-end: 1ex;
|
|
97
|
+
position: relative;
|
|
98
|
+
|
|
99
|
+
&::after {
|
|
100
|
+
color: var(--red);
|
|
101
|
+
content: "*";
|
|
102
|
+
inset: 0 -0.25ex auto auto;
|
|
103
|
+
position: absolute;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/* Field group */
|
|
110
|
+
:where(.ui-field-group) {
|
|
111
|
+
display: flex;
|
|
112
|
+
flex-direction: column;
|
|
113
|
+
gap: var(--size-4);
|
|
114
|
+
|
|
115
|
+
/* If it only has checkboxes, radios, or switches */
|
|
116
|
+
&:has(> :where(.ui-checkbox, .ui-radio, .ui-switch)):not(:has(> :not(.ui-checkbox, .ui-radio, .ui-switch))) {
|
|
117
|
+
gap: var(--size-2);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
/* If it only has buttons */
|
|
121
|
+
&:has(.ui-button):not(:has(*:not(.ui-button))) {
|
|
122
|
+
align-items: center;
|
|
123
|
+
flex-direction: row;
|
|
124
|
+
gap: var(--size-2);
|
|
125
|
+
|
|
126
|
+
/* If it's not preceeded by an hr */
|
|
127
|
+
&:not(hr + &) {
|
|
128
|
+
margin-block-start: var(--size-4);
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
&+& {
|
|
133
|
+
margin-block-start: var(--size-5);
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
/* Directions */
|
|
137
|
+
&.ui-row {
|
|
138
|
+
flex-direction: row;
|
|
139
|
+
flex-wrap: wrap;
|
|
140
|
+
|
|
141
|
+
&:has(> :where(.ui-checkbox, .ui-radio, .ui-switch)) {
|
|
142
|
+
gap: var(--size-4);
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
}
|