opui-css 5.0.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 -276
- package/LICENSE +21 -21
- package/MIGRATING.md +127 -127
- package/README.md +87 -87
- package/astro/index.ts +46 -46
- package/components/AGENTS.md +248 -248
- package/components/Accordion/Accordion.astro +42 -42
- package/components/Anchor/Anchor.astro +51 -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 +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 -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 +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 -80
- 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 -83
- 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 -5154
- package/dist/opui.components.css.map +1 -1
- package/dist/opui.css +5668 -5663
- 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,139 +1,139 @@
|
|
|
1
|
-
@layer components.root {
|
|
2
|
-
:where(.ui-icon-button) {
|
|
3
|
-
--_color: light-dark(var(--color-16), var(--color-1));
|
|
4
|
-
--_color-contrast: light-dark(var(--color-1), var(--color-16));
|
|
5
|
-
--_color-tonal: var(--surface-tonal);
|
|
6
|
-
|
|
7
|
-
--_accent: var(--_color);
|
|
8
|
-
--_accent-contrast: var(--_color-contrast);
|
|
9
|
-
--_accent-tonal: var(--_color-tonal);
|
|
10
|
-
--_accent-tonal-contrast: var(--_color);
|
|
11
|
-
--_default-hover-bg-color: light-dark(oklch(from var(--_accent) l 0.01 h / 10%),
|
|
12
|
-
oklch(from var(--_accent) l 0.01 h / 20%));
|
|
13
|
-
--_default-active-bg-color: light-dark(oklch(from var(--_accent) l 0.06 h / 20%),
|
|
14
|
-
oklch(from var(--_accent) l 0.06 h / 30%));
|
|
15
|
-
--_filled-hover-bg-color: light-dark(oklch(from var(--_accent) calc(l + 0.2) c h),
|
|
16
|
-
oklch(from var(--_accent) calc(l - 0.1) c h));
|
|
17
|
-
--_filled-active-bg-color: light-dark(oklch(from var(--_accent) calc(l + 0.3) c h),
|
|
18
|
-
oklch(from var(--_accent) calc(l - 0.15) c h));
|
|
19
|
-
--_outlined-active-bg-color: var(--_filled-active-bg-color);
|
|
20
|
-
|
|
21
|
-
--_bg-color: transparent;
|
|
22
|
-
--_border-color: transparent;
|
|
23
|
-
--_border-width: var(--border-size-1);
|
|
24
|
-
--_text-color: inherit;
|
|
25
|
-
|
|
26
|
-
align-items: center;
|
|
27
|
-
aspect-ratio: 1;
|
|
28
|
-
background-color: var(--_bg-color);
|
|
29
|
-
block-size: var(--size-6);
|
|
30
|
-
border: var(--_border-width) solid var(--_border-color);
|
|
31
|
-
border-radius: var(--radius-round);
|
|
32
|
-
color: var(--_text-color);
|
|
33
|
-
display: inline-flex;
|
|
34
|
-
inline-size: var(--size-6);
|
|
35
|
-
justify-content: center;
|
|
36
|
-
padding: 0;
|
|
37
|
-
transform-style: preserve-3d;
|
|
38
|
-
transition: background-color .1s ease, color .1s ease,
|
|
39
|
-
border-color .1s ease, box-shadow .1s ease;
|
|
40
|
-
|
|
41
|
-
&:where([disabled]) {
|
|
42
|
-
--_text-color: light-dark(rgb(0, 0, 0/0.3), rgb(255, 255, 255/0.26));
|
|
43
|
-
cursor: not-allowed;
|
|
44
|
-
opacity: 0.64;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
svg {
|
|
48
|
-
block-size: auto;
|
|
49
|
-
inline-size: auto;
|
|
50
|
-
max-block-size: var(--size-5);
|
|
51
|
-
max-inline-size: var(--size-5);
|
|
52
|
-
pointer-events: none;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
/* Ripple effect, utils.css */
|
|
56
|
-
&::before {
|
|
57
|
-
--highlight-size: 130%;
|
|
58
|
-
background-color: transparent;
|
|
59
|
-
|
|
60
|
-
@media (prefers-reduced-motion: no-preference) {
|
|
61
|
-
transition: transform 0.2s ease, background-color .1s ease;
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
/* Colors — shared interaction model for critical and primary.
|
|
66
|
-
Each color modifier below only swaps --_color; the tonal surface,
|
|
67
|
-
contrast text, and hover/active strategy are identical.
|
|
68
|
-
The .critical scope class in theme.css redirects --palette-source so
|
|
69
|
-
--color-6 below becomes a tint of the active color. */
|
|
70
|
-
&.ui-critical,
|
|
71
|
-
&.ui-primary {
|
|
72
|
-
--_color-contrast: var(--gray-1);
|
|
73
|
-
--_color-tonal: var(--color-6);
|
|
74
|
-
--_accent-tonal-contrast: var(--text-primary-contrast);
|
|
75
|
-
|
|
76
|
-
--_default-hover-bg-color: oklch(from var(--_accent) l c h / 15%);
|
|
77
|
-
--_default-active-bg-color: oklch(from var(--_accent) l c h / 25%);
|
|
78
|
-
|
|
79
|
-
--_filled-hover-bg-color: oklch(from var(--_accent) calc(l - 0.1) c h);
|
|
80
|
-
--_filled-active-bg-color: oklch(from var(--_accent) calc(l - 0.15) c h);
|
|
81
|
-
|
|
82
|
-
--_outlined-active-bg-color: oklch(from var(--_accent) calc(l - 0.1) c h);
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
&.ui-critical {
|
|
86
|
-
--_color: var(--critical);
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
&.ui-primary {
|
|
90
|
-
--_color: var(--primary);
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
/* Element states */
|
|
94
|
-
&:where(:not([disabled])) {
|
|
95
|
-
&:where(:not(:active):hover) {
|
|
96
|
-
&::before {
|
|
97
|
-
background-color: var(--_interaction-hover-color, var(--_default-hover-bg-color));
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
&:where(:hover:active),
|
|
102
|
-
&[aria-current="page"] {
|
|
103
|
-
&::before {
|
|
104
|
-
background-color: var(--_interaction-active-color, var(--_default-active-bg-color));
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
/* Size */
|
|
110
|
-
&.ui-small {
|
|
111
|
-
block-size: var(--size-4);
|
|
112
|
-
inline-size: var(--size-4);
|
|
113
|
-
|
|
114
|
-
svg {
|
|
115
|
-
max-block-size: var(--size-4);
|
|
116
|
-
max-inline-size: var(--size-4);
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
/* Variants */
|
|
121
|
-
&.ui-outlined {
|
|
122
|
-
--_bg-color: transparent;
|
|
123
|
-
--_border-color: var(--_accent);
|
|
124
|
-
--_text-color: var(--_accent);
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
&.ui-tonal {
|
|
128
|
-
--_bg-color: var(--_accent-tonal);
|
|
129
|
-
--_text-color: var(--_accent-tonal-contrast);
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
&.ui-filled {
|
|
133
|
-
--_bg-color: var(--_accent);
|
|
134
|
-
--_interaction-active-color: var(--_filled-active-bg-color);
|
|
135
|
-
--_interaction-hover-color: var(--_filled-hover-bg-color);
|
|
136
|
-
--_text-color: var(--_accent-contrast);
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
}
|
|
1
|
+
@layer components.root {
|
|
2
|
+
:where(.ui-icon-button) {
|
|
3
|
+
--_color: light-dark(var(--color-16), var(--color-1));
|
|
4
|
+
--_color-contrast: light-dark(var(--color-1), var(--color-16));
|
|
5
|
+
--_color-tonal: var(--surface-tonal);
|
|
6
|
+
|
|
7
|
+
--_accent: var(--_color);
|
|
8
|
+
--_accent-contrast: var(--_color-contrast);
|
|
9
|
+
--_accent-tonal: var(--_color-tonal);
|
|
10
|
+
--_accent-tonal-contrast: var(--_color);
|
|
11
|
+
--_default-hover-bg-color: light-dark(oklch(from var(--_accent) l 0.01 h / 10%),
|
|
12
|
+
oklch(from var(--_accent) l 0.01 h / 20%));
|
|
13
|
+
--_default-active-bg-color: light-dark(oklch(from var(--_accent) l 0.06 h / 20%),
|
|
14
|
+
oklch(from var(--_accent) l 0.06 h / 30%));
|
|
15
|
+
--_filled-hover-bg-color: light-dark(oklch(from var(--_accent) calc(l + 0.2) c h),
|
|
16
|
+
oklch(from var(--_accent) calc(l - 0.1) c h));
|
|
17
|
+
--_filled-active-bg-color: light-dark(oklch(from var(--_accent) calc(l + 0.3) c h),
|
|
18
|
+
oklch(from var(--_accent) calc(l - 0.15) c h));
|
|
19
|
+
--_outlined-active-bg-color: var(--_filled-active-bg-color);
|
|
20
|
+
|
|
21
|
+
--_bg-color: transparent;
|
|
22
|
+
--_border-color: transparent;
|
|
23
|
+
--_border-width: var(--border-size-1);
|
|
24
|
+
--_text-color: inherit;
|
|
25
|
+
|
|
26
|
+
align-items: center;
|
|
27
|
+
aspect-ratio: 1;
|
|
28
|
+
background-color: var(--_bg-color);
|
|
29
|
+
block-size: var(--size-6);
|
|
30
|
+
border: var(--_border-width) solid var(--_border-color);
|
|
31
|
+
border-radius: var(--radius-round);
|
|
32
|
+
color: var(--_text-color);
|
|
33
|
+
display: inline-flex;
|
|
34
|
+
inline-size: var(--size-6);
|
|
35
|
+
justify-content: center;
|
|
36
|
+
padding: 0;
|
|
37
|
+
transform-style: preserve-3d;
|
|
38
|
+
transition: background-color .1s ease, color .1s ease,
|
|
39
|
+
border-color .1s ease, box-shadow .1s ease;
|
|
40
|
+
|
|
41
|
+
&:where([disabled]) {
|
|
42
|
+
--_text-color: light-dark(rgb(0, 0, 0/0.3), rgb(255, 255, 255/0.26));
|
|
43
|
+
cursor: not-allowed;
|
|
44
|
+
opacity: 0.64;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
svg {
|
|
48
|
+
block-size: auto;
|
|
49
|
+
inline-size: auto;
|
|
50
|
+
max-block-size: var(--size-5);
|
|
51
|
+
max-inline-size: var(--size-5);
|
|
52
|
+
pointer-events: none;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/* Ripple effect, utils.css */
|
|
56
|
+
&::before {
|
|
57
|
+
--highlight-size: 130%;
|
|
58
|
+
background-color: transparent;
|
|
59
|
+
|
|
60
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
61
|
+
transition: transform 0.2s ease, background-color .1s ease;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/* Colors — shared interaction model for critical and primary.
|
|
66
|
+
Each color modifier below only swaps --_color; the tonal surface,
|
|
67
|
+
contrast text, and hover/active strategy are identical.
|
|
68
|
+
The .critical scope class in theme.css redirects --palette-source so
|
|
69
|
+
--color-6 below becomes a tint of the active color. */
|
|
70
|
+
&.ui-critical,
|
|
71
|
+
&.ui-primary {
|
|
72
|
+
--_color-contrast: var(--gray-1);
|
|
73
|
+
--_color-tonal: var(--color-6);
|
|
74
|
+
--_accent-tonal-contrast: var(--text-primary-contrast);
|
|
75
|
+
|
|
76
|
+
--_default-hover-bg-color: oklch(from var(--_accent) l c h / 15%);
|
|
77
|
+
--_default-active-bg-color: oklch(from var(--_accent) l c h / 25%);
|
|
78
|
+
|
|
79
|
+
--_filled-hover-bg-color: oklch(from var(--_accent) calc(l - 0.1) c h);
|
|
80
|
+
--_filled-active-bg-color: oklch(from var(--_accent) calc(l - 0.15) c h);
|
|
81
|
+
|
|
82
|
+
--_outlined-active-bg-color: oklch(from var(--_accent) calc(l - 0.1) c h);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
&.ui-critical {
|
|
86
|
+
--_color: var(--critical);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
&.ui-primary {
|
|
90
|
+
--_color: var(--primary);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/* Element states */
|
|
94
|
+
&:where(:not([disabled])) {
|
|
95
|
+
&:where(:not(:active):hover) {
|
|
96
|
+
&::before {
|
|
97
|
+
background-color: var(--_interaction-hover-color, var(--_default-hover-bg-color));
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
&:where(:hover:active),
|
|
102
|
+
&[aria-current="page"] {
|
|
103
|
+
&::before {
|
|
104
|
+
background-color: var(--_interaction-active-color, var(--_default-active-bg-color));
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/* Size */
|
|
110
|
+
&.ui-small {
|
|
111
|
+
block-size: var(--size-4);
|
|
112
|
+
inline-size: var(--size-4);
|
|
113
|
+
|
|
114
|
+
svg {
|
|
115
|
+
max-block-size: var(--size-4);
|
|
116
|
+
max-inline-size: var(--size-4);
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
/* Variants */
|
|
121
|
+
&.ui-outlined {
|
|
122
|
+
--_bg-color: transparent;
|
|
123
|
+
--_border-color: var(--_accent);
|
|
124
|
+
--_text-color: var(--_accent);
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
&.ui-tonal {
|
|
128
|
+
--_bg-color: var(--_accent-tonal);
|
|
129
|
+
--_text-color: var(--_accent-tonal-contrast);
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
&.ui-filled {
|
|
133
|
+
--_bg-color: var(--_accent);
|
|
134
|
+
--_interaction-active-color: var(--_filled-active-bg-color);
|
|
135
|
+
--_interaction-hover-color: var(--_filled-hover-bg-color);
|
|
136
|
+
--_text-color: var(--_accent-contrast);
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
}
|
package/css/components/link.css
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
@layer components.root {
|
|
2
|
-
:where(.ui-link) {
|
|
3
|
-
color: var(--primary);
|
|
4
|
-
cursor: pointer;
|
|
5
|
-
font-weight: 700;
|
|
6
|
-
text-decoration: underline;
|
|
7
|
-
text-decoration-color: var(--primary);
|
|
8
|
-
text-underline-offset: 2px;
|
|
9
|
-
|
|
10
|
-
&[href] {
|
|
11
|
-
&:hover,
|
|
12
|
-
&:focus-visible {
|
|
13
|
-
color: var(--primary-light);
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
@supports (-moz-appearance: none) {
|
|
18
|
-
text-underline-offset: 2px;
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
}
|
|
1
|
+
@layer components.root {
|
|
2
|
+
:where(.ui-link) {
|
|
3
|
+
color: var(--primary);
|
|
4
|
+
cursor: pointer;
|
|
5
|
+
font-weight: 700;
|
|
6
|
+
text-decoration: underline;
|
|
7
|
+
text-decoration-color: var(--primary);
|
|
8
|
+
text-underline-offset: 2px;
|
|
9
|
+
|
|
10
|
+
&[href] {
|
|
11
|
+
&:hover,
|
|
12
|
+
&:focus-visible {
|
|
13
|
+
color: var(--primary-light);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
@supports (-moz-appearance: none) {
|
|
18
|
+
text-underline-offset: 2px;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|