opui-css 5.0.0 → 5.1.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 +317 -276
- package/LICENSE +21 -21
- package/MIGRATING.md +138 -127
- package/README.md +87 -87
- package/astro/index.ts +46 -46
- package/components/AGENTS.md +248 -248
- package/components/Accordion/Accordion.astro +52 -42
- package/components/Anchor/Anchor.astro +55 -51
- package/components/Avatar/Avatar.astro +38 -38
- package/components/Badge/Badge.astro +59 -59
- package/components/Button/Button.astro +45 -45
- package/components/ButtonGroup/ButtonGroup.astro +36 -29
- package/components/Callout/Callout.astro +75 -75
- package/components/Card/Card.astro +38 -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 +43 -41
- package/components/Divider/Divider.astro +17 -17
- 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 -18
- 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 +200 -194
- package/core/palette.css +110 -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 +193 -179
- package/css/components/button.css +227 -215
- package/css/components/callout.css +112 -109
- package/css/components/card.css +115 -117
- package/css/components/checkbox.css +211 -205
- package/css/components/chip.css +92 -87
- package/css/components/description-list.css +81 -80
- package/css/components/dialog.css +69 -68
- package/css/components/divider.css +20 -20
- package/css/components/drawer.css +171 -171
- package/css/components/form.css +147 -146
- package/css/components/icon-button.css +158 -139
- package/css/components/link.css +21 -21
- package/css/components/list.css +343 -345
- package/css/components/progress.css +103 -97
- package/css/components/radio.css +170 -172
- package/css/components/range.css +342 -337
- package/css/components/select.css +172 -169
- package/css/components/spinner.css +38 -37
- package/css/components/switch.css +271 -268
- package/css/components/table.css +173 -179
- package/css/components/tabs.css +84 -83
- package/css/components/text-field.css +449 -450
- package/css/components/text-input.css +68 -64
- package/css/components/textarea.css +26 -24
- package/css/components/toast.css +160 -161
- package/css/components/toggle-button.css +91 -87
- package/css/components/toggle-group.css +56 -56
- package/css/components/tooltip.css +70 -67
- package/css/components/typography.css +585 -585
- package/css/components.css +41 -41
- package/css/imports.css +17 -16
- package/css/js/checkbox.js +21 -21
- package/css/js/toast.js +94 -94
- package/css/theme.css +133 -132
- package/dist/op.css +4 -66
- package/dist/op.css.map +1 -1
- package/dist/opui.components.css +5234 -5154
- package/dist/opui.components.css.map +1 -1
- package/dist/opui.css +5798 -5663
- package/dist/opui.css.map +1 -1
- package/env.d.ts +14 -14
- package/open-props.css +8 -9
- package/package.json +81 -81
|
@@ -1,109 +1,112 @@
|
|
|
1
|
-
@layer components.root {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
}
|
|
1
|
+
@layer components.root {
|
|
2
|
+
:where(.ui-callout) {
|
|
3
|
+
--_bg-color: var(--surface-tonal);
|
|
4
|
+
--_border-color: var(--surface-tonal);
|
|
5
|
+
--_color: var(--text-primary);
|
|
6
|
+
--_icon-color: currentColor;
|
|
7
|
+
--_link-hover-color: var(--primary);
|
|
8
|
+
--_padding: var(--size-3);
|
|
9
|
+
--_border-radius: var(--border-radius);
|
|
10
|
+
--_gap: var(--size-3);
|
|
11
|
+
--_content-gap: var(--size-2);
|
|
12
|
+
--_font-size: var(--font-size-05);
|
|
13
|
+
--_title-font-size: var(--font-size-1);
|
|
14
|
+
--_icon-size: var(--size-4);
|
|
15
|
+
--_surface-bg: var(--surface-default);
|
|
16
|
+
|
|
17
|
+
--_outlined-bg-color: var(--surface-default);
|
|
18
|
+
--_outlined-border-color: var(--border-color);
|
|
19
|
+
--_outlined-color: var(--text-primary);
|
|
20
|
+
--_outlined-icon-color: currentColor;
|
|
21
|
+
|
|
22
|
+
background-color: var(--_bg-color, var(--_surface-bg));
|
|
23
|
+
border: 1px solid var(--_border-color, var(--border-color));
|
|
24
|
+
border-radius: var(--_border-radius);
|
|
25
|
+
color: var(--_color);
|
|
26
|
+
isolation: isolate;
|
|
27
|
+
padding: var(--_padding);
|
|
28
|
+
position: relative;
|
|
29
|
+
|
|
30
|
+
&.ui-critical,
|
|
31
|
+
&.ui-info,
|
|
32
|
+
&.ui-neutral,
|
|
33
|
+
&.ui-success,
|
|
34
|
+
&.ui-warning {
|
|
35
|
+
--_bg-color: light-dark(
|
|
36
|
+
oklch(from var(--color-2) l c h / 20%),
|
|
37
|
+
oklch(from var(--color-6) l c h / 5%)
|
|
38
|
+
);
|
|
39
|
+
--_border-color: light-dark(var(--color-5), var(--color-11));
|
|
40
|
+
--_color: light-dark(var(--color-16), var(--color-1));
|
|
41
|
+
--_icon-color: var(--color-9);
|
|
42
|
+
|
|
43
|
+
--_outlined-bg-color: var(--surface-default);
|
|
44
|
+
--_outlined-border-color: var(--color-9);
|
|
45
|
+
--_outlined-color: light-dark(var(--color-15), var(--color-1));
|
|
46
|
+
--_outlined-icon-color: var(--color-9);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
&.ui-outlined {
|
|
50
|
+
--_bg-color: var(--_outlined-bg-color);
|
|
51
|
+
--_border-color: var(--_outlined-border-color);
|
|
52
|
+
--_color: var(--_outlined-color);
|
|
53
|
+
--_icon-color: var(--_outlined-icon-color);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
&::before {
|
|
57
|
+
background-color: var(--_bg-color);
|
|
58
|
+
border-radius: inherit;
|
|
59
|
+
content: "";
|
|
60
|
+
inset: 0;
|
|
61
|
+
pointer-events: none;
|
|
62
|
+
position: absolute;
|
|
63
|
+
z-index: -1;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
& > .ui-content {
|
|
67
|
+
display: grid;
|
|
68
|
+
font-size: var(--_font-size);
|
|
69
|
+
gap: var(--_content-gap);
|
|
70
|
+
|
|
71
|
+
h1,
|
|
72
|
+
h2,
|
|
73
|
+
h3,
|
|
74
|
+
h4,
|
|
75
|
+
h5,
|
|
76
|
+
h6 {
|
|
77
|
+
color: inherit;
|
|
78
|
+
font-size: var(--_title-font-size);
|
|
79
|
+
font-weight: 600;
|
|
80
|
+
|
|
81
|
+
* {
|
|
82
|
+
font-size: inherit;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/* Links
|
|
88
|
+
* Can't make sure contrast will be acceptable (yet) so we use the current text color instead.
|
|
89
|
+
*/
|
|
90
|
+
&:not(.ui-outlined) {
|
|
91
|
+
a[href] {
|
|
92
|
+
color: inherit;
|
|
93
|
+
|
|
94
|
+
&:hover {
|
|
95
|
+
color: var(--_link-hover-color);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/* Icon */
|
|
101
|
+
&:has(svg) {
|
|
102
|
+
display: grid;
|
|
103
|
+
gap: var(--_gap);
|
|
104
|
+
grid-template-columns: var(--_icon-size) 1fr;
|
|
105
|
+
|
|
106
|
+
svg {
|
|
107
|
+
margin-block-start: 0.15rem;
|
|
108
|
+
stroke: var(--_icon-color);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
}
|
package/css/components/card.css
CHANGED
|
@@ -1,117 +1,115 @@
|
|
|
1
|
-
@layer components.root {
|
|
2
|
-
:where(.ui-card) {
|
|
3
|
-
--_bg-tonal: var(--surface-tonal);
|
|
4
|
-
--_bg-elevated: var(--surface-elevated);
|
|
5
|
-
--_bg-surface: var(--surface-default);
|
|
6
|
-
--_border-color: var(--border-color);
|
|
7
|
-
--_card-bg-color: var(--_bg-surface);
|
|
8
|
-
--_card-border-color: transparent;
|
|
9
|
-
--_card-border-width: 0;
|
|
10
|
-
|
|
11
|
-
--_card-shadow: none;
|
|
12
|
-
--_shadow-light: var(--shadow-3);
|
|
13
|
-
--_shadow-dark: var(--shadow-4);
|
|
14
|
-
--_shadow-elevated: var(--_shadow-light);
|
|
15
|
-
|
|
16
|
-
@container style(--color-scheme: dark) {
|
|
17
|
-
--_shadow-elevated: var(--_shadow-dark);
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
background-color: var(--_card-bg-color);
|
|
21
|
-
border-color: var(--_card-border-color);
|
|
22
|
-
border-radius: var(--border-radius);
|
|
23
|
-
border-style: solid;
|
|
24
|
-
border-width: var(--_card-border-width);
|
|
25
|
-
box-shadow: var(--_card-shadow);
|
|
26
|
-
display: flex;
|
|
27
|
-
flex-direction: column;
|
|
28
|
-
gap: var(--size-3);
|
|
29
|
-
overflow: hidden;
|
|
30
|
-
padding-inline: 0;
|
|
31
|
-
position: relative;
|
|
32
|
-
|
|
33
|
-
/* Variants */
|
|
34
|
-
&.ui-text {
|
|
35
|
-
--_card-bg-color: transparent;
|
|
36
|
-
--_card-border-color: transparent;
|
|
37
|
-
--_card-border-width: 0;
|
|
38
|
-
--_card-shadow: none;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
&.ui-tonal {
|
|
42
|
-
--_card-bg-color: var(--_bg-tonal);
|
|
43
|
-
--_card-border-width: 1px;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
&.ui-elevated {
|
|
47
|
-
--_card-bg-color: var(--_bg-elevated);
|
|
48
|
-
--_card-shadow: var(--_shadow-elevated);
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
&.ui-outlined {
|
|
52
|
-
--_card-bg-color: var(--_bg-surface);
|
|
53
|
-
--_card-border-color: var(--_border-color);
|
|
54
|
-
--_card-border-width: 1px;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
padding-inline: var(--size-3);
|
|
59
|
-
|
|
60
|
-
&:last-child {
|
|
61
|
-
padding-block-end: var(--size-3);
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
/* Header */
|
|
66
|
-
|
|
67
|
-
padding-block: var(--size-3) 0;
|
|
68
|
-
|
|
69
|
-
/* Top paragraph */
|
|
70
|
-
|
|
71
|
-
line-height: 1.3;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
:where(h1, h2, h3, h4, h5, h6):last-child {
|
|
75
|
-
margin-block-end: 0;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
/* Bottom paragraph */
|
|
79
|
-
|
|
80
|
-
font-size: var(--font-size-1);
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
/* Content */
|
|
85
|
-
|
|
86
|
-
padding-block: var(--size-3) var(--size-4);
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
/* Actions */
|
|
90
|
-
|
|
91
|
-
display: flex;
|
|
92
|
-
gap: var(--size-2);
|
|
93
|
-
margin-block: var(--size-2) 0;
|
|
94
|
-
padding-block-end: var(--size-2);
|
|
95
|
-
padding-inline: var(--size-3);
|
|
96
|
-
|
|
97
|
-
&:has(.ui-button:first-child[class="ui-button"]) {
|
|
98
|
-
padding-inline: var(--size-1) var(--size-3);
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
&:has(.ui-button:not([class="ui-button"])) {
|
|
102
|
-
padding-block-end: var(--size-2);
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
/* Alignment */
|
|
106
|
-
&.ui-align-end {
|
|
107
|
-
justify-content: end;
|
|
108
|
-
|
|
109
|
-
&:has(.ui-button:first-child[class="ui-button"]) {
|
|
110
|
-
padding-inline: var(--size-3) var(--size-1);
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
}
|
|
117
|
-
}
|
|
1
|
+
@layer components.root {
|
|
2
|
+
:where(.ui-card) {
|
|
3
|
+
--_bg-tonal: var(--surface-tonal);
|
|
4
|
+
--_bg-elevated: var(--surface-elevated);
|
|
5
|
+
--_bg-surface: var(--surface-default);
|
|
6
|
+
--_border-color: var(--border-color);
|
|
7
|
+
--_card-bg-color: var(--_bg-surface);
|
|
8
|
+
--_card-border-color: transparent;
|
|
9
|
+
--_card-border-width: 0;
|
|
10
|
+
|
|
11
|
+
--_card-shadow: none;
|
|
12
|
+
--_shadow-light: var(--shadow-3);
|
|
13
|
+
--_shadow-dark: var(--shadow-4);
|
|
14
|
+
--_shadow-elevated: var(--_shadow-light);
|
|
15
|
+
|
|
16
|
+
@container style(--color-scheme: dark) {
|
|
17
|
+
--_shadow-elevated: var(--_shadow-dark);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
background-color: var(--_card-bg-color);
|
|
21
|
+
border-color: var(--_card-border-color);
|
|
22
|
+
border-radius: var(--border-radius);
|
|
23
|
+
border-style: solid;
|
|
24
|
+
border-width: var(--_card-border-width);
|
|
25
|
+
box-shadow: var(--_card-shadow);
|
|
26
|
+
display: flex;
|
|
27
|
+
flex-direction: column;
|
|
28
|
+
gap: var(--size-3);
|
|
29
|
+
overflow: hidden;
|
|
30
|
+
padding-inline: 0;
|
|
31
|
+
position: relative;
|
|
32
|
+
|
|
33
|
+
/* Variants */
|
|
34
|
+
&.ui-text {
|
|
35
|
+
--_card-bg-color: transparent;
|
|
36
|
+
--_card-border-color: transparent;
|
|
37
|
+
--_card-border-width: 0;
|
|
38
|
+
--_card-shadow: none;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
&.ui-tonal {
|
|
42
|
+
--_card-bg-color: var(--_bg-tonal);
|
|
43
|
+
--_card-border-width: 1px;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
&.ui-elevated {
|
|
47
|
+
--_card-bg-color: var(--_bg-elevated);
|
|
48
|
+
--_card-shadow: var(--_shadow-elevated);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
&.ui-outlined {
|
|
52
|
+
--_card-bg-color: var(--_bg-surface);
|
|
53
|
+
--_card-border-color: var(--_border-color);
|
|
54
|
+
--_card-border-width: 1px;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
& > :where(hgroup, .ui-content) {
|
|
58
|
+
padding-inline: var(--size-3);
|
|
59
|
+
|
|
60
|
+
&:last-child {
|
|
61
|
+
padding-block-end: var(--size-3);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/* Header */
|
|
66
|
+
& > hgroup {
|
|
67
|
+
padding-block: var(--size-3) 0;
|
|
68
|
+
|
|
69
|
+
/* Top paragraph */
|
|
70
|
+
& > p:first-of-type:first-child {
|
|
71
|
+
line-height: 1.3;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
:where(h1, h2, h3, h4, h5, h6):last-child {
|
|
75
|
+
margin-block-end: 0;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/* Bottom paragraph */
|
|
79
|
+
& > p:last-of-type:last-child:not(:first-child) {
|
|
80
|
+
font-size: var(--font-size-1);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/* Content */
|
|
85
|
+
& > .ui-content:where(:only-child, :first-child) {
|
|
86
|
+
padding-block: var(--size-3) var(--size-4);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/* Actions */
|
|
90
|
+
& > .ui-actions {
|
|
91
|
+
display: flex;
|
|
92
|
+
gap: var(--size-2);
|
|
93
|
+
margin-block: var(--size-2) 0;
|
|
94
|
+
padding-block-end: var(--size-2);
|
|
95
|
+
padding-inline: var(--size-3);
|
|
96
|
+
|
|
97
|
+
&:has(.ui-button:first-child[class="ui-button"]) {
|
|
98
|
+
padding-inline: var(--size-1) var(--size-3);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
&:has(.ui-button:not([class="ui-button"])) {
|
|
102
|
+
padding-block-end: var(--size-2);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
/* Alignment */
|
|
106
|
+
&.ui-align-end {
|
|
107
|
+
justify-content: end;
|
|
108
|
+
|
|
109
|
+
&:has(.ui-button:first-child[class="ui-button"]) {
|
|
110
|
+
padding-inline: var(--size-3) var(--size-1);
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
}
|