opui-css 3.3.4 → 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.
Files changed (174) hide show
  1. package/CHANGELOG.md +235 -0
  2. package/LICENSE +21 -21
  3. package/MIGRATING.md +105 -0
  4. package/README.md +66 -29
  5. package/astro/index.ts +46 -0
  6. package/components/AGENTS.md +247 -0
  7. package/components/Accordion/Accordion.astro +42 -0
  8. package/components/Anchor/Anchor.astro +51 -0
  9. package/components/Avatar/Avatar.astro +44 -0
  10. package/components/Badge/Badge.astro +54 -0
  11. package/components/Button/Button.astro +45 -0
  12. package/components/ButtonGroup/ButtonGroup.astro +29 -0
  13. package/components/Callout/Callout.astro +75 -0
  14. package/components/Card/Card.astro +38 -0
  15. package/components/Checkbox/Checkbox.astro +76 -0
  16. package/components/Checkbox/CheckboxInput.astro +32 -0
  17. package/components/Chip/Chip.astro +37 -0
  18. package/components/ClassicSelect/ClassicSelect.astro +83 -0
  19. package/components/DescriptionList/Description.astro +12 -0
  20. package/components/DescriptionList/DescriptionList.astro +22 -0
  21. package/components/DescriptionList/Item.astro +12 -0
  22. package/components/DescriptionList/Term.astro +12 -0
  23. package/components/DescriptionList/index.ts +12 -0
  24. package/components/Dialog/Dialog.astro +43 -0
  25. package/components/Divider/Divider.astro +14 -0
  26. package/components/Drawer/Drawer.astro +49 -0
  27. package/components/Drawer/DrawerFooter.astro +14 -0
  28. package/components/Drawer/DrawerHeader.astro +31 -0
  29. package/components/FieldDescription/FieldDescription.astro +13 -0
  30. package/components/FieldGroup/FieldGroup.astro +31 -0
  31. package/components/FieldLegend/FieldLegend.astro +15 -0
  32. package/components/FieldSet/FieldSet.astro +15 -0
  33. package/components/Form/Form.astro +15 -0
  34. package/components/IconButton/IconButton.astro +26 -0
  35. package/components/List/List.astro +36 -0
  36. package/components/ListItem/ListItem.astro +118 -0
  37. package/components/Progress/Progress.astro +40 -0
  38. package/components/Radio/Radio.astro +70 -0
  39. package/components/Radio/RadioInput.astro +24 -0
  40. package/components/Range/Range.astro +136 -0
  41. package/components/Select/Select.astro +106 -0
  42. package/components/Switch/Switch.astro +101 -0
  43. package/components/Switch/SwitchInput.astro +25 -0
  44. package/components/Table/Body.astro +13 -0
  45. package/components/Table/Cell.astro +13 -0
  46. package/components/Table/Column.astro +15 -0
  47. package/components/Table/ColumnGroup.astro +13 -0
  48. package/components/Table/Head.astro +13 -0
  49. package/components/Table/HeaderCell.astro +13 -0
  50. package/components/Table/Row.astro +13 -0
  51. package/components/Table/Table.astro +15 -0
  52. package/components/Table/index.ts +20 -0
  53. package/components/Tabs/Tabs.astro +28 -0
  54. package/components/Tabs/TabsItem.astro +47 -0
  55. package/components/Tabs/TabsPanel.astro +21 -0
  56. package/components/Tabs/TabsTab.astro +19 -0
  57. package/components/Tabs/index.ts +14 -0
  58. package/components/TextField/TextField.astro +128 -0
  59. package/components/Textarea/Textarea.astro +106 -0
  60. package/components/Toast/Toast.astro +42 -0
  61. package/components/ToggleButton/ToggleButton.astro +53 -0
  62. package/components/ToggleGroup/ToggleGroup.astro +49 -0
  63. package/components/Tooltip/Tooltip.astro +30 -0
  64. package/{src/core → core}/normalize.css +194 -196
  65. package/core/palette.css +59 -0
  66. package/{src/core → core}/utils.css +71 -60
  67. package/css/components/accordion.css +174 -0
  68. package/css/components/anchor.css +27 -0
  69. package/{src/themes/theme-two → css}/components/avatar.css +65 -68
  70. package/css/components/badge.css +107 -0
  71. package/css/components/button-group.css +179 -0
  72. package/css/components/button.css +215 -0
  73. package/css/components/callout.css +109 -0
  74. package/css/components/card.css +117 -0
  75. package/css/components/checkbox.css +205 -0
  76. package/{src/themes/theme-one → css}/components/chip.css +87 -135
  77. package/{src/themes/theme-two/components/definition-list.css → css/components/description-list.css} +77 -68
  78. package/{src/themes/theme-two → css}/components/dialog.css +68 -59
  79. package/css/components/divider.css +20 -0
  80. package/css/components/drawer.css +171 -0
  81. package/css/components/form.css +146 -0
  82. package/css/components/icon-button.css +139 -0
  83. package/{src/themes/theme-two → css}/components/link.css +21 -21
  84. package/{src/themes/theme-two → css}/components/list.css +345 -318
  85. package/{src/themes/theme-one → css}/components/progress.css +97 -83
  86. package/css/components/radio.css +172 -0
  87. package/css/components/range.css +337 -0
  88. package/{src/themes/theme-two → css}/components/select.css +169 -162
  89. package/{src/themes/theme-two → css}/components/spinner.css +37 -38
  90. package/{src/themes/theme-two → css}/components/switch.css +268 -225
  91. package/css/components/table.css +179 -0
  92. package/css/components/tabs.css +77 -0
  93. package/css/components/text-field.css +450 -0
  94. package/css/components/text-input.css +53 -0
  95. package/{src/themes/theme-two → css}/components/textarea.css +24 -25
  96. package/css/components/toast.css +161 -0
  97. package/css/components/toggle-button.css +87 -0
  98. package/css/components/toggle-group.css +56 -0
  99. package/css/components/tooltip.css +67 -0
  100. package/css/components/typography.css +585 -0
  101. package/{src/themes/theme-two → css}/components.css +41 -37
  102. package/{src/themes/theme-two → css}/imports.css +16 -16
  103. package/css/js/checkbox.js +21 -0
  104. package/css/js/toast.js +94 -0
  105. package/css/theme.css +132 -0
  106. package/dist/op.css +1001 -32
  107. package/dist/op.css.map +1 -0
  108. package/dist/opui.components.css +5135 -0
  109. package/dist/opui.components.css.map +1 -0
  110. package/dist/opui.css +6604 -0
  111. package/dist/opui.css.map +1 -0
  112. package/env.d.ts +14 -0
  113. package/open-props.css +9 -0
  114. package/package.json +64 -55
  115. package/dist/theme-one/components.css +0 -3869
  116. package/dist/theme-one/theme-one.css +0 -4424
  117. package/dist/theme-two/components.css +0 -3591
  118. package/dist/theme-two/theme-two.css +0 -4141
  119. package/src/open-props.css +0 -10
  120. package/src/themes/theme-one/components/accordion.css +0 -172
  121. package/src/themes/theme-one/components/alert.css +0 -85
  122. package/src/themes/theme-one/components/avatar.css +0 -68
  123. package/src/themes/theme-one/components/badge.css +0 -101
  124. package/src/themes/theme-one/components/button-group.css +0 -69
  125. package/src/themes/theme-one/components/button.css +0 -281
  126. package/src/themes/theme-one/components/card.css +0 -82
  127. package/src/themes/theme-one/components/checkbox-radio.css +0 -123
  128. package/src/themes/theme-one/components/definition-list.css +0 -68
  129. package/src/themes/theme-one/components/dialog.css +0 -59
  130. package/src/themes/theme-one/components/divider.css +0 -7
  131. package/src/themes/theme-one/components/field-group.css +0 -83
  132. package/src/themes/theme-one/components/field.css +0 -494
  133. package/src/themes/theme-one/components/icon-button.css +0 -40
  134. package/src/themes/theme-one/components/link.css +0 -21
  135. package/src/themes/theme-one/components/list.css +0 -318
  136. package/src/themes/theme-one/components/range.css +0 -121
  137. package/src/themes/theme-one/components/rich-text.css +0 -210
  138. package/src/themes/theme-one/components/select.css +0 -163
  139. package/src/themes/theme-one/components/snackbar.css +0 -148
  140. package/src/themes/theme-one/components/spinner.css +0 -38
  141. package/src/themes/theme-one/components/switch.css +0 -225
  142. package/src/themes/theme-one/components/tab-buttons.css +0 -120
  143. package/src/themes/theme-one/components/table.css +0 -92
  144. package/src/themes/theme-one/components/text-field.css +0 -57
  145. package/src/themes/theme-one/components/textarea.css +0 -25
  146. package/src/themes/theme-one/components/toggle-button-group.css +0 -135
  147. package/src/themes/theme-one/components/tooltip.css +0 -94
  148. package/src/themes/theme-one/components/typography.css +0 -209
  149. package/src/themes/theme-one/components.css +0 -37
  150. package/src/themes/theme-one/imports.css +0 -16
  151. package/src/themes/theme-one/theme.css +0 -163
  152. package/src/themes/theme-two/components/accordion.css +0 -172
  153. package/src/themes/theme-two/components/alert.css +0 -85
  154. package/src/themes/theme-two/components/badge.css +0 -101
  155. package/src/themes/theme-two/components/button-group.css +0 -50
  156. package/src/themes/theme-two/components/button.css +0 -229
  157. package/src/themes/theme-two/components/card.css +0 -82
  158. package/src/themes/theme-two/components/checkbox-radio.css +0 -123
  159. package/src/themes/theme-two/components/chip.css +0 -135
  160. package/src/themes/theme-two/components/divider.css +0 -7
  161. package/src/themes/theme-two/components/field-group.css +0 -83
  162. package/src/themes/theme-two/components/field.css +0 -281
  163. package/src/themes/theme-two/components/icon-button.css +0 -40
  164. package/src/themes/theme-two/components/progress.css +0 -83
  165. package/src/themes/theme-two/components/range.css +0 -121
  166. package/src/themes/theme-two/components/rich-text.css +0 -210
  167. package/src/themes/theme-two/components/snackbar.css +0 -148
  168. package/src/themes/theme-two/components/tab-buttons.css +0 -120
  169. package/src/themes/theme-two/components/table.css +0 -99
  170. package/src/themes/theme-two/components/text-field.css +0 -57
  171. package/src/themes/theme-two/components/toggle-button-group.css +0 -135
  172. package/src/themes/theme-two/components/tooltip.css +0 -94
  173. package/src/themes/theme-two/components/typography.css +0 -209
  174. package/src/themes/theme-two/theme.css +0 -158
@@ -1,163 +0,0 @@
1
- /*
2
- theme one theme setup
3
- */
4
- @layer theme {
5
- .light {
6
- --color-scheme: light;
7
- }
8
- .dark {
9
- --color-scheme: dark;
10
- }
11
-
12
- :where(html) {
13
- color-scheme: var(--color-scheme, light dark);
14
-
15
- --palette-hue: var(--oklch-teal);
16
- --palette-hue-rotate-by: 5;
17
- --palette-chroma: 0.89;
18
-
19
- /* Primary */
20
- --primary: var(--color-8);
21
- --primary-light: oklch(from var(--primary) calc(l * 1.25) c h);
22
- --primary-dark: oklch(from var(--primary) calc(l * 0.75) c h);
23
- --primary-contrast: var(--gray-1);
24
-
25
- /* Text */
26
- --text-color-1: light-dark(var(--gray-15), var(--gray-1));
27
- --text-color-1-contrast: light-dark(var(--gray-2), var(--gray-15));
28
- --text-color-2: light-dark(var(--gray-13), var(--gray-4));
29
- --text-color-2-contrast: light-dark(var(--gray-4), var(--gray-13));
30
-
31
- /* Surface */
32
- --surface-default: light-dark(var(--gray-1), var(--gray-13));
33
- --surface-filled: light-dark(var(--gray-3), var(--gray-15));
34
- --surface-tonal: light-dark(var(--gray-3), var(--gray-12));
35
- --surface-elevated: light-dark(var(--gray-1), var(--gray-12));
36
-
37
- /* Shadows */
38
- --shadow-color: light-dark(220 3% 15%, 220 40% 2%);
39
- --shadow-strength: light-dark(1%, 10%);
40
- --inner-shadow-highlight: light-dark(
41
- inset 0 -0.5px 0 0 #fff,
42
- inset 0 0.5px 0 0 #0001,
43
- inset 0 -0.5px 0 0 #fff1,
44
- inset 0 0.5px 0 0 #0007
45
- );
46
-
47
- /* Typography */
48
- --font-size-h1: var(--font-size-fluid-3, 3.5rem);
49
- --font-size-h2: var(--font-size-fluid-2, 2rem);
50
- --font-size-h3: var(--font-size-fluid-1, 1.5rem);
51
- --font-size-h4: var(--font-size-3, 1.25rem);
52
- --font-size-h5: var(--font-size-2, 1.1rem);
53
- --font-size-h6: var(--font-size-fluid-0, 1rem);
54
- --font-size-lg: var(--font-size-3, 1.25rem);
55
- --font-size-md: var(--font-size-fluid-0, 1rem);
56
- --font-size-sm: 0.875rem;
57
- --font-size-xs: var(--font-size-0, 0.75rem);
58
-
59
- /* Borders */
60
- --border-color: light-dark(var(--gray-4), var(--gray-12));
61
- --border-radius: var(--size-1);
62
- --border-width: 1px;
63
-
64
- /* Input Field */
65
- --field-border-color: var(--border-color);
66
- --field-border-radius: var(--size-1);
67
- --field-border-width: 1px;
68
- --field-size: 2.3lh;
69
- --field-size-small: 1.9lh;
70
-
71
- /* Button */
72
- --button-border-radius: var(--radius-round);
73
- /* Ripple effect */
74
- @media (prefers-reduced-motion: no-preference) {
75
- --button-ripple-size: 100%;
76
- --button-ripple-duration: 0.5s;
77
- }
78
- }
79
-
80
- /* Highlight colors */
81
- :where(.red, .error, del) {
82
- --palette-hue: var(--oklch-red, 25);
83
- --palette-chroma: 1;
84
- --palette-hue-rotate-by: 1;
85
- }
86
- :where(.blue, .ok, abbr, dfn) {
87
- --palette-hue: var(--oklch-blue, 210);
88
- --palette-chroma: 1;
89
- --palette-hue-rotate-by: 1;
90
- }
91
- :where(.green, .good, ins) {
92
- --palette-hue: var(--oklch-green, 145);
93
- --palette-chroma: 1;
94
- --palette-hue-rotate-by: 1;
95
- }
96
- :where(.orange, .warning) {
97
- --palette-hue: var(--oklch-orange, 75);
98
- --palette-chroma: 1;
99
- --palette-hue-rotate-by: 1;
100
- }
101
-
102
- :where(html) {
103
- --red: oklch(from var(--color-9) l 0.2 25);
104
- --blue: oklch(from var(--color-9) l 0.2 210);
105
- --green: oklch(from var(--color-9) l 0.2 145);
106
- --orange: oklch(from var(--color-7) l 0.2 75);
107
- }
108
-
109
- /* Gray palette */
110
- :where(html) {
111
- --gray-chroma: 0.01;
112
- --gray-lightness: 255;
113
-
114
- --gray-1: oklch(
115
- from var(--color-1) l var(--gray-chroma) var(--gray-lightness)
116
- );
117
- --gray-2: oklch(
118
- from var(--color-2) l var(--gray-chroma) var(--gray-lightness)
119
- );
120
- --gray-3: oklch(
121
- from var(--color-3) l var(--gray-chroma) var(--gray-lightness)
122
- );
123
- --gray-4: oklch(
124
- from var(--color-4) l var(--gray-chroma) var(--gray-lightness)
125
- );
126
- --gray-5: oklch(
127
- from var(--color-5) l var(--gray-chroma) var(--gray-lightness)
128
- );
129
- --gray-6: oklch(
130
- from var(--color-6) l var(--gray-chroma) var(--gray-lightness)
131
- );
132
- --gray-7: oklch(
133
- from var(--color-7) l var(--gray-chroma) var(--gray-lightness)
134
- );
135
- --gray-8: oklch(
136
- from var(--color-8) l var(--gray-chroma) var(--gray-lightness)
137
- );
138
- --gray-9: oklch(
139
- from var(--color-9) l var(--gray-chroma) var(--gray-lightness)
140
- );
141
- --gray-10: oklch(
142
- from var(--color-10) l var(--gray-chroma) var(--gray-lightness)
143
- );
144
- --gray-11: oklch(
145
- from var(--color-11) l var(--gray-chroma) var(--gray-lightness)
146
- );
147
- --gray-12: oklch(
148
- from var(--color-12) l var(--gray-chroma) var(--gray-lightness)
149
- );
150
- --gray-13: oklch(
151
- from var(--color-13) l var(--gray-chroma) var(--gray-lightness)
152
- );
153
- --gray-14: oklch(
154
- from var(--color-14) l var(--gray-chroma) var(--gray-lightness)
155
- );
156
- --gray-15: oklch(
157
- from var(--color-15) l var(--gray-chroma) var(--gray-lightness)
158
- );
159
- --gray-16: oklch(
160
- from var(--color-16) l var(--gray-chroma) var(--gray-lightness)
161
- );
162
- }
163
- }
@@ -1,172 +0,0 @@
1
- @layer components.extended {
2
- :where(details) {
3
- --_accordion-transition-time: 0.2s;
4
- --_bg-color: transparent;
5
- --_margin-inline: var(--size-1);
6
- --_shadow: none;
7
-
8
- background-color: var(--_bg-color);
9
- box-shadow: var(--_shadow);
10
- border-radius: var(--border-radius, 4px);
11
- display: block;
12
- margin-inline: var(--_margin-inline);
13
- transition: all var(--_accordion-transition-time) ease-out;
14
-
15
- /* Accordion animation */
16
- /* https://nerdy.dev/open-and-close-transitions-for-the-details-element */
17
- @media (prefers-reduced-motion: no-preference) {
18
- interpolate-size: allow-keywords;
19
- }
20
-
21
- &::details-content {
22
- block-size: 0;
23
- opacity: 0;
24
- overflow-y: clip;
25
- transition:
26
- content-visibility var(--_accordion-transition-time) allow-discrete,
27
- opacity var(--_accordion-transition-time),
28
- block-size var(--_accordion-transition-time);
29
- }
30
-
31
- &[open]::details-content {
32
- block-size: auto;
33
- opacity: 1;
34
- }
35
- /***/
36
-
37
- & > summary {
38
- background-color: inherit;
39
- cursor: pointer;
40
- font-weight: 700;
41
- padding-block: var(--size-3);
42
- user-select: none;
43
- }
44
-
45
- /* Custom arrow */
46
- /* summary {
47
- align-items: center;
48
- background-color: inherit;
49
- cursor: pointer;
50
- display: flex;
51
- justify-content: space-between;
52
- list-style: none;
53
- padding-block: var(--size-3);
54
- user-select: none;
55
-
56
- &::marker,
57
- &::-webkit-details-marker {
58
- display: none;
59
- }
60
-
61
- svg {
62
- transition: rotate 0.2s ease-out;
63
- }
64
- }
65
-
66
- &[open] > summary svg {
67
- rotate: 180deg;
68
- } */
69
-
70
- & > .content {
71
- margin-block-start: 0;
72
- padding-block: var(--size-2) var(--size-3);
73
- }
74
-
75
- & > .actions {
76
- display: flex;
77
- gap: var(--size-1);
78
- justify-content: end;
79
- margin-block-start: var(--size-3);
80
- padding-block-end: var(--size-1);
81
- padding-inline: var(--size-3) var(--size-1);
82
- }
83
-
84
- /* Variants */
85
- &.card,
86
- &.text {
87
- --_bg-color: transparent;
88
- --_margin-inline: var(--size-1);
89
- }
90
-
91
- &.elevated {
92
- --_bg-color: var(--surface-elevated);
93
- --_margin-inline: 0;
94
- --_shadow: var(--shadow-2);
95
- }
96
-
97
- &.outlined {
98
- --_bg-color: var(--surface-default);
99
- --_margin-inline: 0;
100
- border: 1px solid var(--border-color);
101
- }
102
-
103
- &.tonal {
104
- --_bg-color: var(--surface-tonal);
105
- --_margin-inline: 0;
106
- }
107
-
108
- &:where(.elevated, .outlined, .tonal) > * {
109
- padding-inline: var(--size-3);
110
- }
111
- }
112
-
113
- /* Accordion group */
114
- :where(.card:has(details)) {
115
- --_gutter-color: var(--border-color);
116
-
117
- display: block;
118
-
119
- & > .content {
120
- margin-block: 0;
121
- padding: 0;
122
- }
123
-
124
- &.card,
125
- &.text {
126
- &:not(.tonal, .outlined, .elevated) {
127
- summary {
128
- padding-inline: 0;
129
- }
130
- }
131
- }
132
-
133
- & > details {
134
- --_margin-inline: 0;
135
-
136
- border: 0;
137
- box-shadow: none;
138
-
139
- & > * {
140
- padding-inline: var(--size-3);
141
- }
142
-
143
- /* Border between accordion items */
144
- & + & {
145
- summary {
146
- border-radius: 0;
147
- border-block-start: 1px solid var(--_gutter-color);
148
- }
149
- }
150
-
151
- /* First item */
152
- &:first-of-type {
153
- border-start-start-radius: var(--border-radius, 0.25rem);
154
- border-start-end-radius: var(--border-radius, 0.25rem);
155
- summary {
156
- border-start-start-radius: var(--border-radius, 0.25rem);
157
- border-start-end-radius: var(--border-radius, 0.25rem);
158
- }
159
- }
160
-
161
- /* Last item */
162
- &:last-of-type {
163
- border-end-start-radius: var(--border-radius, 0.25rem);
164
- border-end-end-radius: var(--border-radius, 0.25rem);
165
- summary {
166
- border-end-start-radius: var(--border-radius, 0.25rem);
167
- border-end-end-radius: var(--border-radius, 0.25rem);
168
- }
169
- }
170
- }
171
- }
172
- }
@@ -1,85 +0,0 @@
1
- @layer components.extended {
2
- :where(.alert) {
3
- --_bg-color: var(--surface-tonal);
4
- --_border-color: var(--surface-tonal);
5
- --_color: var(--text-color-1);
6
-
7
- &.outlined {
8
- --_bg-color: var(--surface-default);
9
- --_border-color: var(--border-color);
10
- --_color: var(--text-color-1);
11
- }
12
-
13
- background-color: var(--_bg-color);
14
- border: 1px solid var(--_border-color);
15
- border-radius: var(--border-radius);
16
- color: var(--_color);
17
- padding: var(--size-3);
18
-
19
- & > .content {
20
- display: grid;
21
- gap: var(--size-2);
22
- font-size: var(--font-size-sm);
23
-
24
- h1,
25
- h2,
26
- h3,
27
- h4,
28
- h5,
29
- h6 {
30
- color: inherit;
31
- font-size: var(--font-size-md);
32
- font-weight: 600;
33
-
34
- * {
35
- font-size: inherit;
36
- }
37
- }
38
- }
39
-
40
- /* Colors */
41
- &.error,
42
- &.ok,
43
- &.warning {
44
- --_bg-color: var(--color-4);
45
- --_border-color: var(--color-9);
46
- --_color: var(--color-15);
47
-
48
- &.outlined {
49
- --_bg-color: var(--surface-default);
50
- --_border-color: var(--color-9);
51
- --_color: light-dark(var(--color-15), var(--color-1));
52
- }
53
-
54
- svg {
55
- margin-block-start: 0.15rem;
56
- stroke: var(--color-9);
57
- }
58
- }
59
-
60
- /* Links
61
- * Can't make sure contrast will be acceptable (yet) so we use the current text color instead.
62
- */
63
- &:not(.outlined) {
64
- a[href] {
65
- color: inherit;
66
-
67
- &:hover {
68
- color: var(--primary);
69
- }
70
- }
71
- }
72
-
73
- /* Icon */
74
- &:has(svg) {
75
- display: grid;
76
- gap: var(--size-3);
77
- grid-template-columns: var(--size-4) 1fr;
78
-
79
- svg {
80
- margin-block-start: 0.15rem;
81
- stroke: currentColor;
82
- }
83
- }
84
- }
85
- }
@@ -1,101 +0,0 @@
1
- @layer components.root {
2
- :where(.badge) {
3
- --_bg-color: var(--primary);
4
- --_border-color: var(--primary);
5
- --_color: var(--gray-1);
6
- --_inset-offset: 16px;
7
- --_inset: auto auto calc(100% - var(--_inset-offset))
8
- calc(100% - var(--_inset-offset));
9
- --_translate: 0;
10
-
11
- display: inline-flex;
12
- position: relative;
13
-
14
- &::after {
15
- background-color: var(--_bg-color);
16
- border: 2px solid var(--_border-color);
17
- border-radius: 100vmax;
18
- color: var(--_color);
19
- content: attr(aria-label);
20
- font-size: 12px;
21
- font-weight: 500;
22
- block-size: var(--size-4);
23
- line-height: normal;
24
- min-inline-size: var(--size-4, 1.125rem);
25
- padding-inline: var(--size-1);
26
- inset: var(--_inset);
27
- position: absolute;
28
- text-align: center;
29
- translate: var(--_translate);
30
- transition: opacity 0.2s var(--ease-out-1);
31
- inline-size: max-content;
32
- }
33
-
34
- /* Alignment */
35
- &.start-start {
36
- --_inset: auto calc(100% - var(--_inset-offset))
37
- calc(100% - var(--_inset-offset)) auto;
38
- }
39
- &.start-end {
40
- --_inset: auto auto calc(100% - var(--_inset-offset))
41
- calc(100% - var(--_inset-offset));
42
- }
43
- &.end-start {
44
- --_inset: calc(100% - var(--_inset-offset))
45
- calc(100% - var(--_inset-offset)) auto auto;
46
- }
47
- &.end-end {
48
- --_inset: calc(100% - var(--_inset-offset)) auto auto
49
- calc(100% - var(--_inset-offset));
50
- }
51
-
52
- /* Dot */
53
- &.dot {
54
- --_inset: 0 -1px auto auto;
55
- &::after {
56
- content: "";
57
- min-inline-size: var(--size-2);
58
- block-size: var(--size-2);
59
- inline-size: var(--size-2);
60
- padding: 0;
61
- }
62
- }
63
-
64
- /* Visibility */
65
- &.invisible {
66
- &::after {
67
- opacity: 0;
68
- pointer-events: none;
69
- }
70
- }
71
-
72
- /* Colors */
73
- &.error,
74
- &.good,
75
- &.ok,
76
- &.warning {
77
- --_bg-color: var(--color-8);
78
- --_border-color: var(--color-8);
79
- }
80
- }
81
-
82
- [dir="rtl"] {
83
- :where(.badge) {
84
- --_inset: auto calc(100% - 16px) calc(100% - 16px) auto;
85
-
86
- /* Alignment */
87
- &.start-start {
88
- --_inset: auto auto calc(100% - 16px) calc(100% - 16px);
89
- }
90
- &.start-end {
91
- --_inset: auto calc(100% - 16px) calc(100% - 16px) auto;
92
- }
93
- &.end-start {
94
- --_inset: calc(100% - 16px) auto auto calc(100% - 16px);
95
- }
96
- &.end-end {
97
- --_inset: calc(100% - 16px) calc(100% - 16px) auto auto;
98
- }
99
- }
100
- }
101
- }
@@ -1,50 +0,0 @@
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
- border-radius: 0;
11
-
12
- svg {
13
- max-inline-size: 0.7lh;
14
- }
15
-
16
- &:focus-visible {
17
- outline-offset: -4px;
18
- }
19
-
20
- & + & {
21
- border-inline-width: 1px;
22
- margin-inline-start: -1px;
23
- }
24
-
25
- &:first-of-type {
26
- border-bottom-left-radius: var(--_border-radius);
27
- border-top-left-radius: var(--_border-radius);
28
- }
29
- &:last-of-type {
30
- border-bottom-right-radius: var(--_border-radius);
31
- border-top-right-radius: var(--_border-radius);
32
- }
33
-
34
- /* Variants */
35
- &:where(.tonal, .filled) {
36
- & + button {
37
- border-inline-start-color: var(--color-7);
38
- }
39
-
40
- & + &[disabled] {
41
- border-inline-start-color: color-mix(
42
- in oklch,
43
- var(--border-color) 90%,
44
- white
45
- );
46
- }
47
- }
48
- }
49
- }
50
- }