opui-css 4.1.0 → 5.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 +29 -0
- package/MIGRATING.md +23 -1
- package/README.md +1 -1
- package/components/AGENTS.md +20 -19
- package/components/Accordion/Accordion.astro +3 -3
- package/components/Anchor/Anchor.astro +2 -2
- package/components/Avatar/Avatar.astro +2 -8
- package/components/Badge/Badge.astro +12 -7
- package/components/Button/Button.astro +1 -1
- package/components/ButtonGroup/ButtonGroup.astro +1 -1
- package/components/Callout/Callout.astro +3 -3
- package/components/Card/Card.astro +3 -3
- package/components/Checkbox/Checkbox.astro +6 -6
- package/components/Chip/Chip.astro +5 -5
- package/components/ClassicSelect/ClassicSelect.astro +6 -6
- package/components/DescriptionList/Description.astro +1 -1
- package/components/DescriptionList/DescriptionList.astro +2 -2
- package/components/DescriptionList/Item.astro +1 -1
- package/components/DescriptionList/Term.astro +1 -1
- package/components/Dialog/Dialog.astro +3 -3
- package/components/Divider/Divider.astro +4 -1
- package/components/Drawer/Drawer.astro +5 -5
- package/components/Drawer/DrawerFooter.astro +1 -1
- package/components/Drawer/DrawerHeader.astro +1 -1
- package/components/FieldDescription/FieldDescription.astro +1 -1
- package/components/FieldGroup/FieldGroup.astro +1 -1
- package/components/FieldLegend/FieldLegend.astro +1 -1
- package/components/FieldSet/FieldSet.astro +1 -1
- package/components/Form/Form.astro +1 -1
- package/components/IconButton/IconButton.astro +1 -1
- package/components/List/List.astro +5 -5
- package/components/ListItem/ListItem.astro +12 -12
- package/components/Progress/Progress.astro +1 -1
- package/components/Radio/Radio.astro +5 -5
- package/components/Range/Range.astro +8 -8
- package/components/Select/Select.astro +13 -13
- package/components/Switch/Switch.astro +8 -8
- package/components/Table/Table.astro +4 -1
- package/components/Tabs/Tabs.astro +1 -1
- package/components/Tabs/TabsItem.astro +1 -1
- package/components/Tabs/TabsPanel.astro +1 -1
- package/components/Tabs/TabsTab.astro +1 -1
- package/components/TextField/TextField.astro +13 -13
- package/components/Textarea/Textarea.astro +13 -13
- package/components/Toast/Toast.astro +6 -6
- package/components/ToggleButton/ToggleButton.astro +3 -3
- package/components/ToggleGroup/ToggleGroup.astro +3 -3
- package/components/Tooltip/Tooltip.astro +1 -1
- package/core/utils.css +4 -4
- package/css/components/accordion.css +11 -11
- package/css/components/anchor.css +3 -3
- package/css/components/avatar.css +5 -5
- package/css/components/badge.css +14 -14
- package/css/components/button-group.css +16 -16
- package/css/components/button.css +12 -12
- package/css/components/callout.css +9 -9
- package/css/components/card.css +12 -12
- package/css/components/checkbox.css +13 -13
- package/css/components/chip.css +5 -5
- package/css/components/description-list.css +11 -8
- package/css/components/dialog.css +3 -3
- package/css/components/divider.css +4 -4
- package/css/components/drawer.css +21 -21
- package/css/components/form.css +18 -18
- package/css/components/icon-button.css +9 -9
- package/css/components/link.css +1 -1
- package/css/components/list.css +29 -29
- package/css/components/progress.css +4 -4
- package/css/components/radio.css +10 -10
- package/css/components/range.css +31 -31
- package/css/components/select.css +4 -4
- package/css/components/spinner.css +1 -1
- package/css/components/switch.css +23 -23
- package/css/components/table.css +3 -3
- package/css/components/tabs.css +14 -8
- package/css/components/text-field.css +47 -47
- package/css/components/text-input.css +7 -7
- package/css/components/textarea.css +3 -3
- package/css/components/toast.css +12 -12
- package/css/components/toggle-button.css +6 -6
- package/css/components/toggle-group.css +10 -10
- package/css/components/tooltip.css +6 -6
- package/css/components/typography.css +30 -30
- package/css/js/toast.js +7 -7
- package/css/theme.css +8 -8
- package/dist/opui.components.css +407 -398
- package/dist/opui.components.css.map +1 -1
- package/dist/opui.css +419 -410
- package/dist/opui.css.map +1 -1
- package/package.json +1 -1
|
@@ -1,59 +1,59 @@
|
|
|
1
1
|
@layer components.root {
|
|
2
2
|
|
|
3
|
-
:where(.p) {
|
|
3
|
+
:where(.ui-p) {
|
|
4
4
|
text-wrap: pretty;
|
|
5
5
|
|
|
6
|
-
&.small {
|
|
6
|
+
&.ui-small {
|
|
7
7
|
font-size: var(--font-size-1);
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
-
&.large {
|
|
10
|
+
&.ui-large {
|
|
11
11
|
font-size: var(--font-size-3);
|
|
12
12
|
}
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
:where(.h1, .h2, .h3, .h4, .h5, .h6) {
|
|
15
|
+
:where(.ui-h1, .ui-h2, .ui-h3, .ui-h4, .ui-h5, .ui-h6) {
|
|
16
16
|
color: var(--text-primary);
|
|
17
17
|
font-weight: 700;
|
|
18
18
|
text-wrap: pretty;
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
-
:where(.h1) {
|
|
21
|
+
:where(.ui-h1) {
|
|
22
22
|
font-size: var(--font-size-h1, var(--font-size-7));
|
|
23
23
|
letter-spacing: -0.02em;
|
|
24
24
|
line-height: 1.15;
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
:where(.h2) {
|
|
27
|
+
:where(.ui-h2) {
|
|
28
28
|
font-size: var(--font-size-h2, var(--font-size-5, 2rem));
|
|
29
29
|
letter-spacing: -0.02em;
|
|
30
30
|
line-height: 1.2;
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
-
:where(.h3) {
|
|
33
|
+
:where(.ui-h3) {
|
|
34
34
|
font-size: var(--font-size-h3, var(--font-size-4, 1.5rem));
|
|
35
35
|
letter-spacing: -0.01em;
|
|
36
36
|
line-height: 1.167;
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
-
:where(.h4) {
|
|
39
|
+
:where(.ui-h4) {
|
|
40
40
|
font-size: var(--font-size-h4, var(--font-size-3, 1.25rem));
|
|
41
41
|
letter-spacing: -0.01em;
|
|
42
42
|
line-height: 1.235;
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
-
:where(.h5) {
|
|
45
|
+
:where(.ui-h5) {
|
|
46
46
|
font-size: var(--font-size-h5, var(--font-size-2, 1.1rem));
|
|
47
47
|
line-height: 1.334;
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
-
:where(.h6) {
|
|
50
|
+
:where(.ui-h6) {
|
|
51
51
|
font-size: var(--font-size-h6, var(--font-size-1, 1rem));
|
|
52
52
|
line-height: 1;
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
/** Overline */
|
|
56
|
-
:where(.overline) {
|
|
56
|
+
:where(.ui-overline) {
|
|
57
57
|
color: light-dark(oklch(from var(--text-muted) calc(l * 1.25) c h),
|
|
58
58
|
oklch(from var(--text-muted) calc(l * 0.75) c h));
|
|
59
59
|
font-size: var(--font-size-0);
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
text-transform: uppercase;
|
|
63
63
|
}
|
|
64
64
|
|
|
65
|
-
:where(.hgroup) {
|
|
65
|
+
:where(.ui-hgroup) {
|
|
66
66
|
&>p {
|
|
67
67
|
margin: 0;
|
|
68
68
|
}
|
|
@@ -94,7 +94,7 @@
|
|
|
94
94
|
}
|
|
95
95
|
|
|
96
96
|
/** Caption */
|
|
97
|
-
:where(.caption) {
|
|
97
|
+
:where(.ui-caption) {
|
|
98
98
|
color: var(--text-muted);
|
|
99
99
|
font-size: var(--font-size-0);
|
|
100
100
|
line-height: 1.6;
|
|
@@ -103,7 +103,7 @@
|
|
|
103
103
|
|
|
104
104
|
|
|
105
105
|
/* Inline text elements — class utilities (work anywhere) */
|
|
106
|
-
:where(.u, .abbr, .dfn) {
|
|
106
|
+
:where(.ui-u, .ui-abbr, .ui-dfn) {
|
|
107
107
|
text-decoration: underline;
|
|
108
108
|
text-underline-offset: 1px;
|
|
109
109
|
|
|
@@ -112,7 +112,7 @@
|
|
|
112
112
|
}
|
|
113
113
|
}
|
|
114
114
|
|
|
115
|
-
:where(.abbr, .dfn) {
|
|
115
|
+
:where(.ui-abbr, .ui-dfn) {
|
|
116
116
|
font-style: normal;
|
|
117
117
|
text-decoration: var(--color-9) underline dotted;
|
|
118
118
|
|
|
@@ -126,21 +126,21 @@
|
|
|
126
126
|
}
|
|
127
127
|
}
|
|
128
128
|
|
|
129
|
-
:where(.sup) {
|
|
129
|
+
:where(.ui-sup) {
|
|
130
130
|
font-size: 0.5em;
|
|
131
131
|
vertical-align: super;
|
|
132
132
|
}
|
|
133
133
|
|
|
134
|
-
:where(p, span).small {
|
|
134
|
+
:where(p, span).ui-small {
|
|
135
135
|
font-size: max(0.5em, var(--font-size-0, 0.75rem));
|
|
136
136
|
}
|
|
137
137
|
|
|
138
|
-
:where(.cite) {
|
|
138
|
+
:where(.ui-cite) {
|
|
139
139
|
font-style: italic;
|
|
140
140
|
}
|
|
141
141
|
|
|
142
142
|
/* Code */
|
|
143
|
-
:where(.kbd) {
|
|
143
|
+
:where(.ui-kbd) {
|
|
144
144
|
font-family: var(--font-mono);
|
|
145
145
|
background-color: var(--text-muted);
|
|
146
146
|
border-color: var(--text-muted);
|
|
@@ -151,34 +151,34 @@
|
|
|
151
151
|
word-break: break-word;
|
|
152
152
|
}
|
|
153
153
|
|
|
154
|
-
:where(.mark) {
|
|
154
|
+
:where(.ui-mark) {
|
|
155
155
|
border-radius: var(--radius-2);
|
|
156
156
|
box-decoration-break: clone;
|
|
157
157
|
padding: .1ex .3ex;
|
|
158
158
|
vertical-align: baseline;
|
|
159
159
|
}
|
|
160
160
|
|
|
161
|
-
:where(.s) {
|
|
161
|
+
:where(.ui-s) {
|
|
162
162
|
text-decoration: line-through;
|
|
163
163
|
}
|
|
164
164
|
|
|
165
|
-
:where(.sub) {
|
|
165
|
+
:where(.ui-sub) {
|
|
166
166
|
font-size: 0.75em;
|
|
167
167
|
vertical-align: sub;
|
|
168
168
|
}
|
|
169
169
|
|
|
170
|
-
:where(.del) {
|
|
170
|
+
:where(.ui-del) {
|
|
171
171
|
color: var(--color-9);
|
|
172
172
|
text-decoration: line-through;
|
|
173
173
|
}
|
|
174
174
|
|
|
175
|
-
:where(.ins) {
|
|
175
|
+
:where(.ui-ins) {
|
|
176
176
|
color: var(--color-9);
|
|
177
177
|
text-decoration: underline;
|
|
178
178
|
text-underline-offset: 1px;
|
|
179
179
|
}
|
|
180
180
|
|
|
181
|
-
:where(.var) {
|
|
181
|
+
:where(.ui-var) {
|
|
182
182
|
font-family: var(--font-mono);
|
|
183
183
|
background-color: var(--text-muted);
|
|
184
184
|
border-color: var(--text-muted);
|
|
@@ -189,12 +189,12 @@
|
|
|
189
189
|
word-break: break-word;
|
|
190
190
|
}
|
|
191
191
|
|
|
192
|
-
:where(.samp) {
|
|
192
|
+
:where(.ui-samp) {
|
|
193
193
|
font-family: var(--font-mono);
|
|
194
194
|
}
|
|
195
195
|
|
|
196
196
|
/* Blockquote */
|
|
197
|
-
:where(.blockquote) {
|
|
197
|
+
:where(.ui-blockquote) {
|
|
198
198
|
border-inline-start: var(--border-size-3) solid currentColor;
|
|
199
199
|
padding-block: var(--size-3);
|
|
200
200
|
padding-inline: var(--size-4);
|
|
@@ -214,7 +214,7 @@
|
|
|
214
214
|
}
|
|
215
215
|
|
|
216
216
|
/* Code block */
|
|
217
|
-
:where(pre.code-block) {
|
|
217
|
+
:where(pre.ui-code-block) {
|
|
218
218
|
background-color: var(--color-15);
|
|
219
219
|
border-radius: var(--border-radius);
|
|
220
220
|
color: var(--color-1);
|
|
@@ -242,7 +242,7 @@
|
|
|
242
242
|
|
|
243
243
|
/* Rich text */
|
|
244
244
|
@layer components.extended {
|
|
245
|
-
@scope (.rich-text) to (.not-rich-text) {
|
|
245
|
+
@scope (.ui-rich-text) to (.ui-not-rich-text) {
|
|
246
246
|
a {
|
|
247
247
|
color: var(--primary);
|
|
248
248
|
cursor: pointer;
|
|
@@ -375,7 +375,7 @@
|
|
|
375
375
|
}
|
|
376
376
|
|
|
377
377
|
/** Overline */
|
|
378
|
-
:is(.overline, hgroup p:first-of-type:first-child) {
|
|
378
|
+
:is(.ui-overline, hgroup p:first-of-type:first-child) {
|
|
379
379
|
color: light-dark(oklch(from var(--text-muted) calc(l * 1.25) c h),
|
|
380
380
|
oklch(from var(--text-muted) calc(l * 0.75) c h));
|
|
381
381
|
font-size: var(--font-size-0);
|
package/css/js/toast.js
CHANGED
|
@@ -8,13 +8,13 @@
|
|
|
8
8
|
* No setTimeout. No popovertargetaction. No innerHTML of user data.
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
|
-
const FALLBACK_TEMPLATE = `<div class="toast" role="alert">
|
|
12
|
-
<span class="icon" data-toast-icon></span>
|
|
13
|
-
<div class="content">
|
|
14
|
-
<div class="title" data-toast-title></div>
|
|
15
|
-
<div class="description" data-toast-description></div>
|
|
11
|
+
const FALLBACK_TEMPLATE = `<div class="ui-toast" role="alert">
|
|
12
|
+
<span class="ui-icon" data-toast-icon></span>
|
|
13
|
+
<div class="ui-content">
|
|
14
|
+
<div class="ui-title" data-toast-title></div>
|
|
15
|
+
<div class="ui-description" data-toast-description></div>
|
|
16
16
|
</div>
|
|
17
|
-
<button class="close-button" data-toast-close type="button" aria-label="Close">
|
|
17
|
+
<button class="ui-close-button" data-toast-close type="button" aria-label="Close">
|
|
18
18
|
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M18 6 6 18"/><path d="m6 6 12 12"/></svg>
|
|
19
19
|
</button>
|
|
20
20
|
</div>`
|
|
@@ -86,7 +86,7 @@ function fillSlot(root, selector, text) {
|
|
|
86
86
|
|
|
87
87
|
function wireToast(node) {
|
|
88
88
|
node.querySelector("[data-toast-close]")?.addEventListener("click", () => {
|
|
89
|
-
node.classList.add("exiting")
|
|
89
|
+
node.classList.add("ui-exiting")
|
|
90
90
|
})
|
|
91
91
|
node.addEventListener("animationend", (event) => {
|
|
92
92
|
if (event.animationName === "toast-exit") node.remove()
|
package/css/theme.css
CHANGED
|
@@ -4,11 +4,11 @@
|
|
|
4
4
|
@layer theme {
|
|
5
5
|
|
|
6
6
|
/* 1. Color scheme */
|
|
7
|
-
.light {
|
|
7
|
+
.ui-light {
|
|
8
8
|
--color-scheme: light;
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
.dark {
|
|
11
|
+
.ui-dark {
|
|
12
12
|
--color-scheme: dark;
|
|
13
13
|
}
|
|
14
14
|
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
--border-width: 1px;
|
|
65
65
|
|
|
66
66
|
/* 9. Focus ring — components consume these and may override locally
|
|
67
|
-
(e.g. .button.filled { --focus-ring-offset: 3px; }, .checkbox { --focus-ring-offset: 0; }) */
|
|
67
|
+
(e.g. .ui-button.ui-filled { --focus-ring-offset: 3px; }, .ui-checkbox { --focus-ring-offset: 0; }) */
|
|
68
68
|
--focus-ring-color: var(--primary);
|
|
69
69
|
--focus-ring-width: 2px;
|
|
70
70
|
--focus-ring-offset: 2px;
|
|
@@ -108,24 +108,24 @@
|
|
|
108
108
|
}
|
|
109
109
|
|
|
110
110
|
/* 14. Severity scope classes — re-source the palette inside these contexts.
|
|
111
|
-
Authoring `<div class="warning">` paints the entire subtree warning-orange.
|
|
111
|
+
Authoring `<div class="ui-warning">` paints the entire subtree warning-orange.
|
|
112
112
|
Non-severity tokens (--primary, --neutral) deliberately have no scope class. */
|
|
113
|
-
:where(.critical, [data-invalid], del) {
|
|
113
|
+
:where(.ui-critical, [data-invalid], del) {
|
|
114
114
|
--palette-source: oklch(0.58 0.21 var(--hue-red));
|
|
115
115
|
--palette-hue-rotate-by: 1;
|
|
116
116
|
}
|
|
117
117
|
|
|
118
|
-
:where(.info, abbr, dfn) {
|
|
118
|
+
:where(.ui-info, abbr, dfn) {
|
|
119
119
|
--palette-source: oklch(0.58 0.21 var(--hue-blue));
|
|
120
120
|
--palette-hue-rotate-by: 1;
|
|
121
121
|
}
|
|
122
122
|
|
|
123
|
-
:where(.success, ins) {
|
|
123
|
+
:where(.ui-success, ins) {
|
|
124
124
|
--palette-source: oklch(0.58 0.21 var(--hue-green));
|
|
125
125
|
--palette-hue-rotate-by: 1;
|
|
126
126
|
}
|
|
127
127
|
|
|
128
|
-
:where(.warning) {
|
|
128
|
+
:where(.ui-warning) {
|
|
129
129
|
--palette-source: oklch(0.58 0.21 var(--hue-orange));
|
|
130
130
|
--palette-hue-rotate-by: 1;
|
|
131
131
|
}
|