opui-css 1.2.6 → 2.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 (40) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +32 -25
  3. package/dist/op+ui.css +4195 -4195
  4. package/dist/ui.css +4197 -4197
  5. package/package.json +3 -3
  6. package/src/components/accordion.css +172 -172
  7. package/src/components/alert.css +85 -85
  8. package/src/components/avatar.css +68 -68
  9. package/src/components/badge.css +101 -101
  10. package/src/components/button-group.css +69 -69
  11. package/src/components/button.css +267 -267
  12. package/src/components/card.css +82 -82
  13. package/src/components/checkbox-radio.css +123 -123
  14. package/src/components/chip.css +135 -135
  15. package/src/components/definition-list.css +65 -65
  16. package/src/components/dialog.css +59 -59
  17. package/src/components/divider.css +7 -7
  18. package/src/components/field-group.css +83 -83
  19. package/src/components/field.css +494 -494
  20. package/src/components/icon-button.css +40 -40
  21. package/src/components/list.css +317 -317
  22. package/src/components/progress.css +83 -83
  23. package/src/components/range.css +121 -121
  24. package/src/components/rich-text.css +210 -210
  25. package/src/components/select.css +163 -163
  26. package/src/components/snackbar.css +148 -148
  27. package/src/components/spinner.css +38 -38
  28. package/src/components/switch.css +189 -189
  29. package/src/components/tab-buttons.css +120 -120
  30. package/src/components/table.css +107 -107
  31. package/src/components/text-field.css +57 -57
  32. package/src/components/textarea.css +25 -25
  33. package/src/components/toggle-button-group.css +139 -139
  34. package/src/components/tooltip.css +94 -94
  35. package/src/components/typography.css +209 -209
  36. package/src/core/normalize.css +194 -194
  37. package/src/core/theme.css +160 -160
  38. package/src/core/utils.css +60 -60
  39. package/src/main.css +13 -13
  40. /package/src/{index.css → opui.css} +0 -0
@@ -1,317 +1,317 @@
1
- @layer components.extended {
2
- /*
3
- Lists meant to be used stand-alone or as part of Select elements
4
-
5
- Intended use-case:
6
- - ul.list > li
7
- - .select > .list > option
8
- */
9
- :where(.list) {
10
- --_bg-color: light-dark(var(--gray-1), var(--gray-15));
11
-
12
- background-color: var(--_bg-color);
13
- list-style: none;
14
- padding: var(--size-2) 0;
15
-
16
- @media (pointer: coarse) {
17
- &,
18
- * {
19
- user-select: none;
20
- }
21
- }
22
-
23
- /* Borders on all list items */
24
- &.bordered {
25
- :where(li + li, option + option) {
26
- margin-block-start: var(--size-3);
27
- &::before {
28
- block-size: 1px;
29
- border-block-start: 1px solid var(--border-color);
30
- content: "";
31
- display: block;
32
- inline-size: 100%;
33
- inset: calc(-1 * var(--size-2)) 0 auto 0;
34
- position: absolute;
35
- visibility: visible; /* override select > option:before style */
36
- }
37
- }
38
- }
39
-
40
- /* Dense - less gaps and spacing */
41
- &.dense {
42
- :where(li, option) {
43
- gap: var(--size-2);
44
- min-block-size: var(--size-7);
45
- padding: var(--size-1) var(--size-2);
46
-
47
- &.border-top {
48
- margin-block-start: var(--size-2);
49
- &::before {
50
- inset: calc(-1 * var(--size-1)) 0 auto 0;
51
- }
52
- }
53
-
54
- /* Clickable list item */
55
- &:has(> a, > button, > label) {
56
- min-block-size: auto;
57
- padding: 0;
58
- }
59
-
60
- & > :where(a, button, label) {
61
- gap: var(--size-2);
62
- min-block-size: var(--size-7);
63
- padding: var(--size-1) var(--size-2);
64
- }
65
-
66
- /* Checkbox / Radio */
67
- & > label {
68
- .end {
69
- padding-inline-end: 0.125rem;
70
- }
71
- }
72
-
73
- /* Leading and trailing content */
74
- .start,
75
- .end {
76
- .avatar {
77
- max-inline-size: var(--size-6);
78
- }
79
-
80
- .icon-button,
81
- svg {
82
- max-inline-size: var(--size-4);
83
- }
84
-
85
- .checkbox,
86
- .radio {
87
- max-inline-size: var(--size-3);
88
- }
89
- }
90
- }
91
- }
92
-
93
- /* Gutterless */
94
- &.gutterless {
95
- :where(li, option) {
96
- padding-inline: 0;
97
-
98
- & > :where(a, button, label) {
99
- padding-inline: 0;
100
- }
101
- }
102
- }
103
-
104
- /* List item */
105
- :where(li, option, [role="group"] > label) {
106
- align-items: center;
107
- background: var(--_bg-color) var(--ripple, none);
108
- display: flex;
109
- font-size: var(--font-size-sm);
110
- gap: var(--size-3);
111
- isolation: isolate;
112
- min-block-size: 40px;
113
- padding: var(--size-2) var(--size-3);
114
- position: relative;
115
-
116
- &::before {
117
- display: none; /* removing checkmark from option */
118
- }
119
-
120
- * {
121
- font-size: inherit;
122
- }
123
-
124
- /* Clickable list item */
125
- &:has(> a, > button, > label) {
126
- background: transparent;
127
- display: block;
128
- min-block-size: auto;
129
- padding: 0;
130
- }
131
-
132
- /* Select option */
133
- &:where(option) {
134
- align-items: center;
135
- background-color: var(--_bg-color);
136
- color: inherit;
137
- cursor: pointer;
138
- display: flex;
139
- gap: var(--size-3);
140
- inline-size: 100%;
141
- margin: 0;
142
- min-block-size: 40px;
143
- padding: var(--size-2) var(--size-3);
144
- text-align: start;
145
- text-decoration: none;
146
- z-index: 0;
147
-
148
- &:hover {
149
- background-color: light-dark(var(--gray-2), var(--gray-14));
150
- }
151
-
152
- &:checked {
153
- background-color: oklch(from var(--primary) l c h / 30%);
154
- }
155
- }
156
-
157
- & > a,
158
- & > button,
159
- & > label {
160
- align-items: center;
161
- background: var(--_bg-color) var(--ripple, none);
162
- color: inherit;
163
- cursor: pointer;
164
- display: flex;
165
- gap: var(--size-3);
166
- inline-size: 100%;
167
- margin: 0;
168
- min-block-size: 40px;
169
- outline-offset: -3px;
170
- padding: var(--size-2) var(--size-3);
171
- text-align: start;
172
- text-decoration: none;
173
- z-index: 0;
174
-
175
- /*** Ripple effect */
176
- background-position: center;
177
- transition: background var(--button-ripple-duration);
178
- &:where(:not(:active):hover) {
179
- --ripple: radial-gradient(circle, transparent 1%, var(--_bg-color) 1%)
180
- center/15000%;
181
- }
182
-
183
- &:where(:hover:active) {
184
- background-size: var(--button-ripple-size);
185
- transition: background 0s;
186
- }
187
-
188
- &:hover {
189
- background-color: light-dark(var(--gray-2), var(--gray-14));
190
- }
191
-
192
- /*** Remove ripple effect when trailing button is clicked */
193
- &:has(.end:hover) {
194
- &:where(:not(:active):hover) {
195
- --ripple: none;
196
- }
197
- }
198
- }
199
-
200
- /* Checkbox / Radio / Switch */
201
- & > label {
202
- .end {
203
- padding-inline-end: var(--size-1);
204
- }
205
-
206
- &:where(.checkbox, .radio) {
207
- inline-size: 100%;
208
- }
209
-
210
- &.switch {
211
- --_dot-size: 0.75rem;
212
- --_track-height: var(--size-4);
213
- --_track-width: 2.5rem;
214
- }
215
- }
216
-
217
- /* Video */
218
- &:has(video) {
219
- padding: 0.75rem var(--size-3) 0.75rem 0;
220
- }
221
-
222
- /* Border between list items */
223
- &.border-top {
224
- margin-block-start: var(--size-3);
225
- &::before {
226
- block-size: 1px;
227
- border-block-start: 1px solid var(--border-color);
228
- content: "";
229
- display: block;
230
- inline-size: 100%;
231
- inset: calc(-1 * var(--size-2)) 0 auto 0;
232
- position: absolute;
233
- }
234
- }
235
-
236
- /* Text */
237
- .text {
238
- flex: 1;
239
- line-height: 1.6;
240
-
241
- :where(h1, h2, h3, h4, h5, h6, p, span) {
242
- color: inherit;
243
- font-weight: 400;
244
- }
245
-
246
- p + p {
247
- font-size: var(--font-size-xs);
248
- }
249
- }
250
-
251
- /* Leading content */
252
- .start {
253
- align-self: center;
254
- align-items: center;
255
- display: grid;
256
- z-index: 1;
257
-
258
- &:has(svg) {
259
- max-inline-size: var(--size-5);
260
- }
261
-
262
- svg {
263
- padding-block-start: 0.125rem;
264
- }
265
-
266
- img {
267
- aspect-ratio: 1;
268
- inline-size: 56px;
269
- object-fit: cover;
270
- }
271
-
272
- video {
273
- aspect-ratio: 16/9;
274
- block-size: 64px;
275
- object-fit: cover;
276
- }
277
- }
278
-
279
- /* Trailing content */
280
- .end {
281
- align-items: center;
282
- display: flex;
283
- font-size: var(--font-size-xs);
284
- text-align: end;
285
- z-index: 1;
286
-
287
- &:not(:has(a, button, input)) {
288
- pointer-events: none;
289
- }
290
-
291
- kbd {
292
- background-color: transparent;
293
- border: 0;
294
- color: inherit;
295
- opacity: 0.6;
296
- }
297
-
298
- svg {
299
- max-inline-size: var(--size-5);
300
- inline-size: 100%;
301
- }
302
- }
303
-
304
- /* Inset */
305
- &.inset {
306
- .text {
307
- padding-inline-start: calc(var(--size-5) + var(--size-3));
308
- }
309
-
310
- /* Safety measure so it won't look bad if there for some reason should exist a leading element inside. */
311
- .start {
312
- display: none;
313
- }
314
- }
315
- }
316
- }
317
- }
1
+ @layer components.extended {
2
+ /*
3
+ Lists meant to be used stand-alone or as part of Select elements
4
+
5
+ Intended use-case:
6
+ - ul.list > li
7
+ - .select > .list > option
8
+ */
9
+ :where(.list) {
10
+ --_bg-color: light-dark(var(--gray-1), var(--gray-15));
11
+
12
+ background-color: var(--_bg-color);
13
+ list-style: none;
14
+ padding: var(--size-2) 0;
15
+
16
+ @media (pointer: coarse) {
17
+ &,
18
+ * {
19
+ user-select: none;
20
+ }
21
+ }
22
+
23
+ /* Borders on all list items */
24
+ &.bordered {
25
+ :where(li + li, option + option) {
26
+ margin-block-start: var(--size-3);
27
+ &::before {
28
+ block-size: 1px;
29
+ border-block-start: 1px solid var(--border-color);
30
+ content: "";
31
+ display: block;
32
+ inline-size: 100%;
33
+ inset: calc(-1 * var(--size-2)) 0 auto 0;
34
+ position: absolute;
35
+ visibility: visible; /* override select > option:before style */
36
+ }
37
+ }
38
+ }
39
+
40
+ /* Dense - less gaps and spacing */
41
+ &.dense {
42
+ :where(li, option) {
43
+ gap: var(--size-2);
44
+ min-block-size: var(--size-7);
45
+ padding: var(--size-1) var(--size-2);
46
+
47
+ &.border-top {
48
+ margin-block-start: var(--size-2);
49
+ &::before {
50
+ inset: calc(-1 * var(--size-1)) 0 auto 0;
51
+ }
52
+ }
53
+
54
+ /* Clickable list item */
55
+ &:has(> a, > button, > label) {
56
+ min-block-size: auto;
57
+ padding: 0;
58
+ }
59
+
60
+ & > :where(a, button, label) {
61
+ gap: var(--size-2);
62
+ min-block-size: var(--size-7);
63
+ padding: var(--size-1) var(--size-2);
64
+ }
65
+
66
+ /* Checkbox / Radio */
67
+ & > label {
68
+ .end {
69
+ padding-inline-end: 0.125rem;
70
+ }
71
+ }
72
+
73
+ /* Leading and trailing content */
74
+ .start,
75
+ .end {
76
+ .avatar {
77
+ max-inline-size: var(--size-6);
78
+ }
79
+
80
+ .icon-button,
81
+ svg {
82
+ max-inline-size: var(--size-4);
83
+ }
84
+
85
+ .checkbox,
86
+ .radio {
87
+ max-inline-size: var(--size-3);
88
+ }
89
+ }
90
+ }
91
+ }
92
+
93
+ /* Gutterless */
94
+ &.gutterless {
95
+ :where(li, option) {
96
+ padding-inline: 0;
97
+
98
+ & > :where(a, button, label) {
99
+ padding-inline: 0;
100
+ }
101
+ }
102
+ }
103
+
104
+ /* List item */
105
+ :where(li, option, [role="group"] > label) {
106
+ align-items: center;
107
+ background: var(--_bg-color) var(--ripple, none);
108
+ display: flex;
109
+ font-size: var(--font-size-sm);
110
+ gap: var(--size-3);
111
+ isolation: isolate;
112
+ min-block-size: 40px;
113
+ padding: var(--size-2) var(--size-3);
114
+ position: relative;
115
+
116
+ &::before {
117
+ display: none; /* removing checkmark from option */
118
+ }
119
+
120
+ * {
121
+ font-size: inherit;
122
+ }
123
+
124
+ /* Clickable list item */
125
+ &:has(> a, > button, > label) {
126
+ background: transparent;
127
+ display: block;
128
+ min-block-size: auto;
129
+ padding: 0;
130
+ }
131
+
132
+ /* Select option */
133
+ &:where(option) {
134
+ align-items: center;
135
+ background-color: var(--_bg-color);
136
+ color: inherit;
137
+ cursor: pointer;
138
+ display: flex;
139
+ gap: var(--size-3);
140
+ inline-size: 100%;
141
+ margin: 0;
142
+ min-block-size: 40px;
143
+ padding: var(--size-2) var(--size-3);
144
+ text-align: start;
145
+ text-decoration: none;
146
+ z-index: 0;
147
+
148
+ &:hover {
149
+ background-color: light-dark(var(--gray-2), var(--gray-14));
150
+ }
151
+
152
+ &:checked {
153
+ background-color: oklch(from var(--primary) l c h / 30%);
154
+ }
155
+ }
156
+
157
+ & > a,
158
+ & > button,
159
+ & > label {
160
+ align-items: center;
161
+ background: var(--_bg-color) var(--ripple, none);
162
+ color: inherit;
163
+ cursor: pointer;
164
+ display: flex;
165
+ gap: var(--size-3);
166
+ inline-size: 100%;
167
+ margin: 0;
168
+ min-block-size: 40px;
169
+ outline-offset: -3px;
170
+ padding: var(--size-2) var(--size-3);
171
+ text-align: start;
172
+ text-decoration: none;
173
+ z-index: 0;
174
+
175
+ /*** Ripple effect */
176
+ background-position: center;
177
+ transition: background var(--button-ripple-duration);
178
+ &:where(:not(:active):hover) {
179
+ --ripple: radial-gradient(circle, transparent 1%, var(--_bg-color) 1%)
180
+ center/15000%;
181
+ }
182
+
183
+ &:where(:hover:active) {
184
+ background-size: var(--button-ripple-size);
185
+ transition: background 0s;
186
+ }
187
+
188
+ &:hover {
189
+ background-color: light-dark(var(--gray-2), var(--gray-14));
190
+ }
191
+
192
+ /*** Remove ripple effect when trailing button is clicked */
193
+ &:has(.end:hover) {
194
+ &:where(:not(:active):hover) {
195
+ --ripple: none;
196
+ }
197
+ }
198
+ }
199
+
200
+ /* Checkbox / Radio / Switch */
201
+ & > label {
202
+ .end {
203
+ padding-inline-end: var(--size-1);
204
+ }
205
+
206
+ &:where(.checkbox, .radio) {
207
+ inline-size: 100%;
208
+ }
209
+
210
+ &.switch {
211
+ --_dot-size: 0.75rem;
212
+ --_track-height: var(--size-4);
213
+ --_track-width: 2.5rem;
214
+ }
215
+ }
216
+
217
+ /* Video */
218
+ &:has(video) {
219
+ padding: 0.75rem var(--size-3) 0.75rem 0;
220
+ }
221
+
222
+ /* Border between list items */
223
+ &.border-top {
224
+ margin-block-start: var(--size-3);
225
+ &::before {
226
+ block-size: 1px;
227
+ border-block-start: 1px solid var(--border-color);
228
+ content: "";
229
+ display: block;
230
+ inline-size: 100%;
231
+ inset: calc(-1 * var(--size-2)) 0 auto 0;
232
+ position: absolute;
233
+ }
234
+ }
235
+
236
+ /* Text */
237
+ .text {
238
+ flex: 1;
239
+ line-height: 1.6;
240
+
241
+ :where(h1, h2, h3, h4, h5, h6, p, span) {
242
+ color: inherit;
243
+ font-weight: 400;
244
+ }
245
+
246
+ p + p {
247
+ font-size: var(--font-size-xs);
248
+ }
249
+ }
250
+
251
+ /* Leading content */
252
+ .start {
253
+ align-self: center;
254
+ align-items: center;
255
+ display: grid;
256
+ z-index: 1;
257
+
258
+ &:has(svg) {
259
+ max-inline-size: var(--size-5);
260
+ }
261
+
262
+ svg {
263
+ padding-block-start: 0.125rem;
264
+ }
265
+
266
+ img {
267
+ aspect-ratio: 1;
268
+ inline-size: 56px;
269
+ object-fit: cover;
270
+ }
271
+
272
+ video {
273
+ aspect-ratio: 16/9;
274
+ block-size: 64px;
275
+ object-fit: cover;
276
+ }
277
+ }
278
+
279
+ /* Trailing content */
280
+ .end {
281
+ align-items: center;
282
+ display: flex;
283
+ font-size: var(--font-size-xs);
284
+ text-align: end;
285
+ z-index: 1;
286
+
287
+ &:not(:has(a, button, input)) {
288
+ pointer-events: none;
289
+ }
290
+
291
+ kbd {
292
+ background-color: transparent;
293
+ border: 0;
294
+ color: inherit;
295
+ opacity: 0.6;
296
+ }
297
+
298
+ svg {
299
+ max-inline-size: var(--size-5);
300
+ inline-size: 100%;
301
+ }
302
+ }
303
+
304
+ /* Inset */
305
+ &.inset {
306
+ .text {
307
+ padding-inline-start: calc(var(--size-5) + var(--size-3));
308
+ }
309
+
310
+ /* Safety measure so it won't look bad if there for some reason should exist a leading element inside. */
311
+ .start {
312
+ display: none;
313
+ }
314
+ }
315
+ }
316
+ }
317
+ }