opui-css 3.3.5 → 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 -56
- 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
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
@layer components.extended {
|
|
2
|
+
:where(details.accordion) {
|
|
3
|
+
--_actions-gap: var(--size-1);
|
|
4
|
+
--_actions-margin-block-start: var(--size-3);
|
|
5
|
+
--_actions-padding-block-end: var(--size-1);
|
|
6
|
+
--_actions-padding-inline: var(--size-3) var(--size-1);
|
|
7
|
+
--_bg-color: transparent;
|
|
8
|
+
--_border-color: transparent;
|
|
9
|
+
--_border-radius: var(--border-radius, 4px);
|
|
10
|
+
--_border-width: 0;
|
|
11
|
+
--_content-padding-block: var(--size-2) var(--size-3);
|
|
12
|
+
--_content-padding-inline: var(--_padding-inline);
|
|
13
|
+
--_margin-inline: var(--size-1);
|
|
14
|
+
--_padding-inline: initial;
|
|
15
|
+
--_shadow: none;
|
|
16
|
+
--_summary-padding-block: var(--size-3);
|
|
17
|
+
--_summary-padding-inline: var(--_padding-inline);
|
|
18
|
+
--_svg-transition: 0.2s var(--ease-1);
|
|
19
|
+
--_transition: 0.2s;
|
|
20
|
+
|
|
21
|
+
background-color: var(--_bg-color);
|
|
22
|
+
border: var(--_border-width) solid var(--_border-color);
|
|
23
|
+
border-radius: var(--_border-radius);
|
|
24
|
+
box-shadow: var(--_shadow);
|
|
25
|
+
display: block;
|
|
26
|
+
margin-inline: var(--_margin-inline);
|
|
27
|
+
transition: all var(--_transition) ease-out;
|
|
28
|
+
|
|
29
|
+
&.elevated {
|
|
30
|
+
--_bg-color: var(--surface-elevated);
|
|
31
|
+
--_margin-inline: 0;
|
|
32
|
+
--_padding-inline: var(--size-3);
|
|
33
|
+
--_shadow: var(--shadow-3);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
&.outlined {
|
|
37
|
+
--_bg-color: var(--surface-default);
|
|
38
|
+
--_border-color: var(--border-color);
|
|
39
|
+
--_border-width: 1px;
|
|
40
|
+
--_margin-inline: 0;
|
|
41
|
+
--_padding-inline: var(--size-3);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
&.tonal {
|
|
45
|
+
--_bg-color: var(--surface-tonal);
|
|
46
|
+
--_margin-inline: 0;
|
|
47
|
+
--_padding-inline: var(--size-3);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/* Accordion animation */
|
|
51
|
+
/* https://nerdy.dev/open-and-close-transitions-for-the-details-element */
|
|
52
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
53
|
+
interpolate-size: allow-keywords;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
&::details-content {
|
|
57
|
+
block-size: 0;
|
|
58
|
+
opacity: 0;
|
|
59
|
+
overflow-y: clip;
|
|
60
|
+
transition:
|
|
61
|
+
content-visibility var(--_transition) allow-discrete,
|
|
62
|
+
opacity var(--_transition),
|
|
63
|
+
block-size var(--_transition);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
&[open]::details-content {
|
|
67
|
+
block-size: auto;
|
|
68
|
+
opacity: 1;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/* Layout */
|
|
72
|
+
&>summary {
|
|
73
|
+
background-color: inherit;
|
|
74
|
+
cursor: pointer;
|
|
75
|
+
font-weight: 700;
|
|
76
|
+
padding-block: var(--_summary-padding-block);
|
|
77
|
+
padding-inline: var(--_summary-padding-inline);
|
|
78
|
+
user-select: none;
|
|
79
|
+
|
|
80
|
+
&:has(svg) {
|
|
81
|
+
align-items: center;
|
|
82
|
+
display: flex;
|
|
83
|
+
justify-content: space-between;
|
|
84
|
+
list-style: none;
|
|
85
|
+
|
|
86
|
+
&::marker,
|
|
87
|
+
&::-webkit-details-marker {
|
|
88
|
+
display: none;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
svg {
|
|
93
|
+
transition: rotate var(--_svg-transition);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
&[open]>summary svg {
|
|
98
|
+
rotate: 180deg;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
&>.content {
|
|
102
|
+
margin-block-start: 0;
|
|
103
|
+
padding-block: var(--_content-padding-block);
|
|
104
|
+
padding-inline: var(--_content-padding-inline);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
&>.actions {
|
|
108
|
+
display: flex;
|
|
109
|
+
gap: var(--_actions-gap);
|
|
110
|
+
justify-content: end;
|
|
111
|
+
margin-block-start: var(--_actions-margin-block-start);
|
|
112
|
+
padding-block-end: var(--_actions-padding-block-end);
|
|
113
|
+
padding-inline: var(--_actions-padding-inline);
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
/* Accordion group */
|
|
118
|
+
:where(.card[role="group"]:has(details.accordion)) {
|
|
119
|
+
--_group-radius: var(--border-radius);
|
|
120
|
+
--_gutter-color: var(--border-color);
|
|
121
|
+
--_item-padding-inline: var(--size-3);
|
|
122
|
+
--_item-summary-padding-inline: var(--_item-padding-inline);
|
|
123
|
+
|
|
124
|
+
display: block;
|
|
125
|
+
|
|
126
|
+
&.card {
|
|
127
|
+
&:not(.tonal, .outlined, .elevated) {
|
|
128
|
+
--_item-summary-padding-inline: 0;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
&>.content {
|
|
133
|
+
margin-block: 0;
|
|
134
|
+
padding: 0;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
&>details.accordion {
|
|
138
|
+
--_border-color: transparent;
|
|
139
|
+
--_border-width: 0;
|
|
140
|
+
--_margin-inline: 0;
|
|
141
|
+
--_padding-inline: var(--_item-padding-inline);
|
|
142
|
+
--_shadow: none;
|
|
143
|
+
--_summary-padding-inline: var(--_item-summary-padding-inline);
|
|
144
|
+
|
|
145
|
+
/* Border between accordion items */
|
|
146
|
+
&+& {
|
|
147
|
+
border-block-start: 1px solid var(--_gutter-color);
|
|
148
|
+
border-radius: 0;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
/* First item */
|
|
152
|
+
&:first-of-type {
|
|
153
|
+
border-start-end-radius: var(--_group-radius);
|
|
154
|
+
border-start-start-radius: var(--_group-radius);
|
|
155
|
+
|
|
156
|
+
summary {
|
|
157
|
+
border-start-end-radius: var(--_group-radius);
|
|
158
|
+
border-start-start-radius: var(--_group-radius);
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
/* Last item */
|
|
163
|
+
&:last-of-type {
|
|
164
|
+
border-end-end-radius: var(--_group-radius);
|
|
165
|
+
border-end-start-radius: var(--_group-radius);
|
|
166
|
+
|
|
167
|
+
summary {
|
|
168
|
+
border-end-end-radius: var(--_group-radius);
|
|
169
|
+
border-end-start-radius: var(--_group-radius);
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
@layer components.root {
|
|
2
|
+
:where(.anchor) {
|
|
3
|
+
anchor-name: --anchor;
|
|
4
|
+
anchor-scope: --anchor;
|
|
5
|
+
display: inline-block;
|
|
6
|
+
inline-size: fit-content;
|
|
7
|
+
|
|
8
|
+
/* Always-visible */
|
|
9
|
+
&>.anchor-floating:not([popover]) {
|
|
10
|
+
block-size: max-content;
|
|
11
|
+
inline-size: max-content;
|
|
12
|
+
position: absolute;
|
|
13
|
+
position-anchor: --anchor;
|
|
14
|
+
position-area: var(--anchor-position-area, start end);
|
|
15
|
+
translate: var(--_anchor-tx, 0) var(--_anchor-ty, 0);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/* Hover-triggered */
|
|
19
|
+
&>.anchor-floating[popover] {
|
|
20
|
+
inset: unset;
|
|
21
|
+
margin: 0;
|
|
22
|
+
position: absolute;
|
|
23
|
+
position-area: var(--anchor-position-area, start end);
|
|
24
|
+
translate: var(--_anchor-tx, 0) var(--_anchor-ty, 0);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -1,68 +1,65 @@
|
|
|
1
|
-
@layer components.root {
|
|
2
|
-
:where(.avatar) {
|
|
3
|
-
--_bg-color: var(--
|
|
4
|
-
--_color: var(--
|
|
5
|
-
--_width: 40px;
|
|
6
|
-
|
|
7
|
-
align-items: center;
|
|
8
|
-
|
|
9
|
-
color: var(--
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
display: inline-flex;
|
|
13
|
-
inline-size: var(--_width);
|
|
14
|
-
justify-content: center;
|
|
15
|
-
overflow: clip;
|
|
16
|
-
position: relative;
|
|
17
|
-
text-align: center;
|
|
18
|
-
text-decoration: none;
|
|
19
|
-
|
|
20
|
-
&:has(img) {
|
|
21
|
-
background-color: transparent;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
svg {
|
|
25
|
-
max-inline-size: var(--size-5);
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
img {
|
|
29
|
-
block-size: 100%;
|
|
30
|
-
inline-size: 100%;
|
|
31
|
-
inset: 0;
|
|
32
|
-
object-fit: cover;
|
|
33
|
-
position: absolute;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
&.squared {
|
|
37
|
-
border-radius: 0;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
&.rounded {
|
|
41
|
-
border-radius: var(--
|
|
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
|
-
}
|
|
1
|
+
@layer components.root {
|
|
2
|
+
:where(.avatar) {
|
|
3
|
+
--_bg-color: var(--primary);
|
|
4
|
+
--_color: var(--color-1);
|
|
5
|
+
--_width: 40px;
|
|
6
|
+
|
|
7
|
+
align-items: center;
|
|
8
|
+
aspect-ratio: 1;
|
|
9
|
+
background-color: var(--_bg-color);
|
|
10
|
+
border-radius: var(--radius-round);
|
|
11
|
+
color: var(--_color);
|
|
12
|
+
display: inline-flex;
|
|
13
|
+
inline-size: var(--_width);
|
|
14
|
+
justify-content: center;
|
|
15
|
+
overflow: clip;
|
|
16
|
+
position: relative;
|
|
17
|
+
text-align: center;
|
|
18
|
+
text-decoration: none;
|
|
19
|
+
|
|
20
|
+
&:has(img) {
|
|
21
|
+
background-color: transparent;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
svg {
|
|
25
|
+
max-inline-size: var(--size-5);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
img {
|
|
29
|
+
block-size: 100%;
|
|
30
|
+
inline-size: 100%;
|
|
31
|
+
inset: 0;
|
|
32
|
+
object-fit: cover;
|
|
33
|
+
position: absolute;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
&.squared {
|
|
37
|
+
border-radius: 0;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
&.rounded {
|
|
41
|
+
border-radius: var(--radius-2);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
&.squircle {
|
|
45
|
+
border-radius: var(--radius-3);
|
|
46
|
+
|
|
47
|
+
@supports (corner-shape: squircle) {
|
|
48
|
+
border-radius: var(--radius-round);
|
|
49
|
+
corner-shape: squircle;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
:where([role="group"]) {
|
|
55
|
+
--_margin: var(--size-3);
|
|
56
|
+
--_outline-color: var(--surface-default);
|
|
57
|
+
|
|
58
|
+
display: flex;
|
|
59
|
+
|
|
60
|
+
.avatar {
|
|
61
|
+
box-shadow: 0 0 0 2px var(--_outline-color);
|
|
62
|
+
margin-inline-end: calc(-1 * var(--_margin));
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
@layer components.extended {
|
|
2
|
+
:where(.badge) {
|
|
3
|
+
--_anchor-tx: -50%;
|
|
4
|
+
--_anchor-ty: 50%;
|
|
5
|
+
--_badge-inset: auto auto 100% 100%;
|
|
6
|
+
--_bg-color: var(--primary);
|
|
7
|
+
--_border-color: var(--primary);
|
|
8
|
+
--_dot-size: var(--size-2);
|
|
9
|
+
--_size: var(--size-4);
|
|
10
|
+
--_text-color: var(--gray-1);
|
|
11
|
+
|
|
12
|
+
display: inline-flex;
|
|
13
|
+
position: relative;
|
|
14
|
+
vertical-align: middle;
|
|
15
|
+
|
|
16
|
+
/* Floating wrapper: traditional inset-based positioning so this works
|
|
17
|
+
in browsers without position-area support (Firefox, older Safari). */
|
|
18
|
+
&>.anchor-floating:not([popover]) {
|
|
19
|
+
inset: var(--_badge-inset);
|
|
20
|
+
position-anchor: auto;
|
|
21
|
+
position-area: none;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/* Indicator */
|
|
25
|
+
&>.anchor-floating>.badge-indicator {
|
|
26
|
+
background-color: var(--_bg-color);
|
|
27
|
+
block-size: var(--_size);
|
|
28
|
+
border: 2px solid var(--_border-color);
|
|
29
|
+
border-radius: var(--radius-round);
|
|
30
|
+
color: var(--_text-color);
|
|
31
|
+
display: grid;
|
|
32
|
+
font-size: 12px;
|
|
33
|
+
font-weight: 500;
|
|
34
|
+
inline-size: max-content;
|
|
35
|
+
line-height: normal;
|
|
36
|
+
min-inline-size: var(--_size);
|
|
37
|
+
padding-inline: var(--size-1);
|
|
38
|
+
place-items: center;
|
|
39
|
+
text-align: center;
|
|
40
|
+
transition: opacity 0.2s var(--ease-out-1);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/* Colors */
|
|
44
|
+
&.critical {
|
|
45
|
+
--_bg-color: var(--critical);
|
|
46
|
+
--_border-color: var(--critical);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
&.success {
|
|
50
|
+
--_bg-color: var(--success);
|
|
51
|
+
--_border-color: var(--success);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
&.info {
|
|
55
|
+
--_bg-color: var(--info);
|
|
56
|
+
--_border-color: var(--info);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
&.warning {
|
|
60
|
+
--_bg-color: var(--warning);
|
|
61
|
+
--_border-color: var(--warning);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
&.neutral {
|
|
65
|
+
--_bg-color: var(--neutral);
|
|
66
|
+
--_border-color: var(--neutral);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/* Alignment */
|
|
70
|
+
&.start-start {
|
|
71
|
+
--_anchor-tx: 50%;
|
|
72
|
+
--_anchor-ty: 50%;
|
|
73
|
+
--_badge-inset: auto 100% 100% auto;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
&.end-start {
|
|
77
|
+
--_anchor-tx: 50%;
|
|
78
|
+
--_anchor-ty: -50%;
|
|
79
|
+
--_badge-inset: 100% 100% auto auto;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
&.end-end {
|
|
83
|
+
--_anchor-tx: -50%;
|
|
84
|
+
--_anchor-ty: -50%;
|
|
85
|
+
--_badge-inset: 100% auto auto 100%;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/* Dot */
|
|
89
|
+
&.dot {
|
|
90
|
+
--_anchor-tx: calc((var(--_dot-size) - 2px) * -1);
|
|
91
|
+
--_anchor-ty: var(--_dot-size);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
&.dot>.anchor-floating>.badge-indicator {
|
|
95
|
+
block-size: var(--_dot-size);
|
|
96
|
+
inline-size: var(--_dot-size);
|
|
97
|
+
min-inline-size: var(--_dot-size);
|
|
98
|
+
padding: 0;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/* Visibility */
|
|
102
|
+
&.invisible>.anchor-floating>.badge-indicator {
|
|
103
|
+
opacity: 0;
|
|
104
|
+
pointer-events: none;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
}
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
@layer components.extended {
|
|
2
|
+
:where([role="group"].button-group) {
|
|
3
|
+
--_border-radius: var(--button-border-radius);
|
|
4
|
+
|
|
5
|
+
border-radius: var(--_border-radius);
|
|
6
|
+
display: inline-flex;
|
|
7
|
+
min-width: max-content;
|
|
8
|
+
|
|
9
|
+
/* Button */
|
|
10
|
+
button {
|
|
11
|
+
border-radius: 0;
|
|
12
|
+
|
|
13
|
+
/* button.css > --_accent-tonal */
|
|
14
|
+
--_divider-color: light-dark(oklch(from var(--_accent-tonal) calc(l - 0.1) c h),
|
|
15
|
+
oklch(from var(--_accent-tonal) calc(l + 0.1) c h));
|
|
16
|
+
|
|
17
|
+
&.outlined {
|
|
18
|
+
--_divider-color: var(--_border-color);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
&.filled {
|
|
22
|
+
--_divider-color: currentColor;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
&:focus-visible {
|
|
26
|
+
outline-offset: -4px;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/* Color inheritance from Button Group — shared interaction model.
|
|
30
|
+
The .critical scope class in theme.css redirects --palette-source so
|
|
31
|
+
--color-6 below becomes a tint of the active color. */
|
|
32
|
+
:where(.button-group.critical,
|
|
33
|
+
.button-group.primary) & {
|
|
34
|
+
--_color-contrast: var(--gray-1);
|
|
35
|
+
--_color-tonal: var(--color-6);
|
|
36
|
+
--_accent-tonal-contrast: var(--text-primary-contrast);
|
|
37
|
+
--_default-hover-bg-color: oklch(from var(--_accent) l c h / 15%);
|
|
38
|
+
--_default-active-bg-color: oklch(from var(--_accent) l c h / 25%);
|
|
39
|
+
--_filled-hover-bg-color: oklch(from var(--_accent) calc(l - 0.1) c h);
|
|
40
|
+
--_filled-active-bg-color: oklch(from var(--_accent) calc(l - 0.15) c h);
|
|
41
|
+
--_outlined-active-bg-color: oklch(from var(--_accent) calc(l - 0.1) c h);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
:where(.button-group.critical) & {
|
|
45
|
+
--_color: var(--critical);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
:where(.button-group.primary) & {
|
|
49
|
+
--_color: var(--primary);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
:where(.button-group.small) & {
|
|
53
|
+
--_min-height: 1.875rem;
|
|
54
|
+
padding-block: 0;
|
|
55
|
+
padding-inline: 1ex;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
:where(.button-group.large) & {
|
|
59
|
+
--_min-height: 2.875rem;
|
|
60
|
+
padding-inline: 4ex;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
:where(.button-group.outlined) & {
|
|
64
|
+
--_border-color: var(--_accent);
|
|
65
|
+
--_divider-color: var(--_accent);
|
|
66
|
+
|
|
67
|
+
&:where(:not([disabled])) {
|
|
68
|
+
&:where(:not(:active):hover) {
|
|
69
|
+
--_bg-color: var(--_accent);
|
|
70
|
+
--_border-color: var(--_accent);
|
|
71
|
+
--_text-color: var(--_accent-contrast);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
&:where(:active) {
|
|
75
|
+
--_bg-color: var(--_outlined-active-bg-color);
|
|
76
|
+
--_border-color: var(--_outlined-active-bg-color);
|
|
77
|
+
--_text-color: var(--_accent-contrast);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
:where(.button-group.tonal) & {
|
|
83
|
+
--_bg-color: var(--_accent-tonal);
|
|
84
|
+
--_text-color: var(--_accent-tonal-contrast);
|
|
85
|
+
|
|
86
|
+
&:where(:not([disabled])) {
|
|
87
|
+
&:where(:not(:active):hover) {
|
|
88
|
+
--_bg-color: var(--_accent);
|
|
89
|
+
--_text-color: var(--_accent-contrast);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
&:where(:active) {
|
|
93
|
+
--_bg-color: var(--_outlined-active-bg-color);
|
|
94
|
+
--_text-color: var(--_accent-contrast);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
:where(.button-group.filled) & {
|
|
100
|
+
--_bg-color: var(--_accent);
|
|
101
|
+
--_text-color: var(--_accent-contrast);
|
|
102
|
+
--_divider-color: currentColor;
|
|
103
|
+
|
|
104
|
+
:where(.button-group.critical,
|
|
105
|
+
.button-group.primary) & {
|
|
106
|
+
--_divider-color: light-dark(oklch(from var(--_accent) calc(l - 0.1) c h),
|
|
107
|
+
oklch(from var(--_accent) calc(l + 0.1) c h));
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
&:where(:not([disabled])) {
|
|
111
|
+
&:where(:not(:active):hover) {
|
|
112
|
+
--_bg-color: var(--_filled-hover-bg-color);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
&:where(:active) {
|
|
116
|
+
--_bg-color: var(--_filled-active-bg-color);
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
&:not(.vertical) {
|
|
123
|
+
button {
|
|
124
|
+
&:first-of-type {
|
|
125
|
+
border-end-start-radius: var(--_border-radius);
|
|
126
|
+
border-start-start-radius: var(--_border-radius);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
&:last-of-type {
|
|
130
|
+
border-end-end-radius: var(--_border-radius);
|
|
131
|
+
border-start-end-radius: var(--_border-radius);
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
/* Siblings */
|
|
135
|
+
&+& {
|
|
136
|
+
border-inline-start-color: var(--_divider-color);
|
|
137
|
+
border-inline-width: 1px;
|
|
138
|
+
margin-inline-start: -1px;
|
|
139
|
+
|
|
140
|
+
&[disabled] {
|
|
141
|
+
border-inline-start-color: color-mix(in oklch, var(--_divider-color) 40%, transparent);
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
&.vertical {
|
|
148
|
+
flex-direction: column;
|
|
149
|
+
|
|
150
|
+
button {
|
|
151
|
+
padding: var(--size-2);
|
|
152
|
+
|
|
153
|
+
&:has(svg) {
|
|
154
|
+
aspect-ratio: 1;
|
|
155
|
+
padding: var(--size-1);
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
&:first-of-type {
|
|
159
|
+
border-start-start-radius: var(--_border-radius);
|
|
160
|
+
border-start-end-radius: var(--_border-radius);
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
&:last-of-type {
|
|
164
|
+
border-end-start-radius: var(--_border-radius);
|
|
165
|
+
border-end-end-radius: var(--_border-radius);
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
&+& {
|
|
169
|
+
border-block-start: 1px solid var(--_divider-color);
|
|
170
|
+
margin-block-start: -1px;
|
|
171
|
+
|
|
172
|
+
&[disabled] {
|
|
173
|
+
border-block-start-color: color-mix(in oklch, var(--_divider-color) 40%, transparent);
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
}
|