opui-css 2.2.3 → 2.3.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 (79) hide show
  1. package/README.md +23 -7
  2. package/dist/{op+ui.css → theme-one+op.css} +290 -143
  3. package/dist/{ui.css → theme-one.css} +168 -12
  4. package/dist/theme-two+op.css +4021 -0
  5. package/dist/theme-two.css +3975 -0
  6. package/package.json +6 -5
  7. package/src/themes/theme-one/components/table.css +100 -0
  8. package/src/{components → themes/theme-one/components}/toggle-button-group.css +1 -5
  9. package/src/themes/theme-one/components.css +37 -0
  10. package/src/{theme.css → themes/theme-one/setup.css} +1 -1
  11. package/src/themes/theme-one/theme+op.css +5 -0
  12. package/src/themes/theme-one/theme.css +13 -0
  13. package/src/themes/theme-two/components/accordion.css +172 -0
  14. package/src/themes/theme-two/components/alert.css +85 -0
  15. package/src/themes/theme-two/components/avatar.css +68 -0
  16. package/src/themes/theme-two/components/badge.css +101 -0
  17. package/src/themes/theme-two/components/button-group.css +50 -0
  18. package/src/themes/theme-two/components/button.css +217 -0
  19. package/src/themes/theme-two/components/card.css +82 -0
  20. package/src/themes/theme-two/components/checkbox-radio.css +123 -0
  21. package/src/themes/theme-two/components/chip.css +135 -0
  22. package/src/themes/theme-two/components/definition-list.css +65 -0
  23. package/src/themes/theme-two/components/dialog.css +59 -0
  24. package/src/themes/theme-two/components/divider.css +7 -0
  25. package/src/themes/theme-two/components/field-group.css +83 -0
  26. package/src/themes/theme-two/components/field.css +281 -0
  27. package/src/themes/theme-two/components/icon-button.css +40 -0
  28. package/src/themes/theme-two/components/link.css +21 -0
  29. package/src/themes/theme-two/components/list.css +317 -0
  30. package/src/themes/theme-two/components/progress.css +83 -0
  31. package/src/themes/theme-two/components/range.css +121 -0
  32. package/src/themes/theme-two/components/rich-text.css +210 -0
  33. package/src/themes/theme-two/components/select.css +162 -0
  34. package/src/themes/theme-two/components/snackbar.css +148 -0
  35. package/src/themes/theme-two/components/spinner.css +38 -0
  36. package/src/themes/theme-two/components/switch.css +189 -0
  37. package/src/themes/theme-two/components/tab-buttons.css +120 -0
  38. package/src/themes/theme-two/components/text-field.css +57 -0
  39. package/src/themes/theme-two/components/textarea.css +25 -0
  40. package/src/themes/theme-two/components/toggle-button-group.css +135 -0
  41. package/src/themes/theme-two/components/tooltip.css +94 -0
  42. package/src/themes/theme-two/components/typography.css +209 -0
  43. package/src/themes/theme-two/components.css +37 -0
  44. package/src/themes/theme-two/setup.css +158 -0
  45. package/src/themes/theme-two/theme+op.css +5 -0
  46. package/src/themes/theme-two/theme.css +13 -0
  47. package/src/core/components.css +0 -37
  48. package/src/main.css +0 -13
  49. package/src/opui.css +0 -10
  50. /package/src/{components → themes/theme-one/components}/accordion.css +0 -0
  51. /package/src/{components → themes/theme-one/components}/alert.css +0 -0
  52. /package/src/{components → themes/theme-one/components}/avatar.css +0 -0
  53. /package/src/{components → themes/theme-one/components}/badge.css +0 -0
  54. /package/src/{components → themes/theme-one/components}/button-group.css +0 -0
  55. /package/src/{components → themes/theme-one/components}/button.css +0 -0
  56. /package/src/{components → themes/theme-one/components}/card.css +0 -0
  57. /package/src/{components → themes/theme-one/components}/checkbox-radio.css +0 -0
  58. /package/src/{components → themes/theme-one/components}/chip.css +0 -0
  59. /package/src/{components → themes/theme-one/components}/definition-list.css +0 -0
  60. /package/src/{components → themes/theme-one/components}/dialog.css +0 -0
  61. /package/src/{components → themes/theme-one/components}/divider.css +0 -0
  62. /package/src/{components → themes/theme-one/components}/field-group.css +0 -0
  63. /package/src/{components → themes/theme-one/components}/field.css +0 -0
  64. /package/src/{components → themes/theme-one/components}/icon-button.css +0 -0
  65. /package/src/{components → themes/theme-one/components}/link.css +0 -0
  66. /package/src/{components → themes/theme-one/components}/list.css +0 -0
  67. /package/src/{components → themes/theme-one/components}/progress.css +0 -0
  68. /package/src/{components → themes/theme-one/components}/range.css +0 -0
  69. /package/src/{components → themes/theme-one/components}/rich-text.css +0 -0
  70. /package/src/{components → themes/theme-one/components}/select.css +0 -0
  71. /package/src/{components → themes/theme-one/components}/snackbar.css +0 -0
  72. /package/src/{components → themes/theme-one/components}/spinner.css +0 -0
  73. /package/src/{components → themes/theme-one/components}/switch.css +0 -0
  74. /package/src/{components → themes/theme-one/components}/tab-buttons.css +0 -0
  75. /package/src/{components → themes/theme-one/components}/text-field.css +0 -0
  76. /package/src/{components → themes/theme-one/components}/textarea.css +0 -0
  77. /package/src/{components → themes/theme-one/components}/tooltip.css +0 -0
  78. /package/src/{components → themes/theme-one/components}/typography.css +0 -0
  79. /package/src/{components → themes/theme-two/components}/table.css +0 -0
@@ -0,0 +1,83 @@
1
+ @layer components.extended {
2
+ /* Common styling for checkbox, radio and switch groups */
3
+ :where(fieldset.field-group) {
4
+ border: 0;
5
+ border-radius: 0;
6
+ gap: 0;
7
+ padding: 0;
8
+ z-index: 1;
9
+
10
+ legend {
11
+ color: var(--text-color-2);
12
+ padding: 0 1ex 0 0;
13
+ }
14
+
15
+ /* Disabled */
16
+ &[disabled] {
17
+ cursor: not-allowed;
18
+ opacity: 0.64;
19
+ user-select: none;
20
+
21
+ input {
22
+ cursor: not-allowed;
23
+ }
24
+ }
25
+
26
+ /* Validation */
27
+ &.error {
28
+ legend,
29
+ .supporting-text {
30
+ color: var(--color-9);
31
+ }
32
+ }
33
+
34
+ /* Required */
35
+ &:has([required]) {
36
+ &:not(:has(input:where([type="radio"], [type="checkbox"]):checked)) {
37
+ legend {
38
+ position: relative;
39
+
40
+ &::after {
41
+ color: var(--red);
42
+ content: "*";
43
+ inset: 0 -0.25ex auto auto;
44
+ position: absolute;
45
+ }
46
+ }
47
+ }
48
+ }
49
+ :where(.radio, .checkbox, .switch) .label:after {
50
+ display: none;
51
+ }
52
+
53
+ /* Supporting text */
54
+ .supporting-text {
55
+ color: var(--text-color-2);
56
+ font-size: var(--font-size-xs);
57
+ line-height: 1.5;
58
+ z-index: 1;
59
+ }
60
+
61
+ /* Fields */
62
+ .fields {
63
+ display: flex;
64
+ flex-direction: column;
65
+ gap: var(--size-2);
66
+
67
+ * ~ & {
68
+ padding: var(--size-2) 0;
69
+ }
70
+ }
71
+
72
+ :last-child {
73
+ padding-block-end: 0;
74
+ }
75
+
76
+ /* Directions */
77
+ &.row {
78
+ .fields {
79
+ flex-direction: row;
80
+ }
81
+ }
82
+ }
83
+ }
@@ -0,0 +1,281 @@
1
+ @layer components.extended {
2
+ /*
3
+ - Common styling for input, textarea and select
4
+ - Form related styles such as: label, supporting text, error handling
5
+ */
6
+ :where(.field) {
7
+ --_accent-color: var(--primary);
8
+ --_bg-color: var(--surface-default);
9
+ --_border-color: var(--field-border-color);
10
+ --_field-padding-block: 0.75rem;
11
+ --_field-padding-inline: var(--size-2);
12
+ --_filled-border-color: var(--text-color-1);
13
+ --_height: var(--field-size);
14
+ --_label-color: var(--text-color-2);
15
+ --_supporting-text-color: var(--text-color-2);
16
+
17
+ display: grid;
18
+ position: relative;
19
+
20
+ /* Input/Select base */
21
+ :where(& input, & textarea, & select) {
22
+ background-color: var(--_bg-color);
23
+ block-size: var(--_height);
24
+ border-radius: var(--field-border-radius);
25
+ border: var(--field-border-width) solid var(--_border-color);
26
+ color: var(--text-color-1);
27
+ font-family: var(--font-sans);
28
+ font-size: var(--font-size-1);
29
+ grid-column: 1/-1;
30
+ grid-row: 2;
31
+ inline-size: 100%;
32
+ line-height: var(--font-lineheight-1);
33
+ min-inline-size: 0;
34
+ padding: var(--_field-padding-block) var(--_field-padding-inline);
35
+
36
+ @media (prefers-reduced-motion: no-preference) {
37
+ transition: border-color 0.2s cubic-bezier(0.4, 0, 0.2, 1),
38
+ padding-block 0.2s var(--ease-3);
39
+ }
40
+ }
41
+
42
+ /* Required/Invalid */
43
+ &:has(
44
+ :not(:placeholder-shown):invalid,
45
+ :where(
46
+ :placeholder-shown,
47
+ option[value=""]:not(:checked),
48
+ option:checked:not([value=""])
49
+ ):required
50
+ ) {
51
+ .label:after {
52
+ color: var(--red);
53
+ content: "*";
54
+ margin: -0.25em auto auto 0.25em;
55
+ }
56
+ }
57
+
58
+ /* File */
59
+ &:has(input[type="file"]) {
60
+ cursor: pointer;
61
+
62
+ input {
63
+ align-self: flex-start;
64
+ block-size: var(--_height);
65
+ box-shadow: none;
66
+ color: var(--text-color-1);
67
+ cursor: inherit;
68
+ max-inline-size: 100%;
69
+ padding: 0;
70
+ transition: font-size 0.2s var(--ease-3);
71
+
72
+ &::-webkit-file-upload-button,
73
+ &::file-selector-button {
74
+ background-color: var(--surface-tonal);
75
+ border: none;
76
+ block-size: calc(100% - var(--size-2) * 2);
77
+ border-radius: var(--field-border-radius);
78
+ cursor: pointer;
79
+ margin-inline-end: 1ex;
80
+ margin-block-start: var(--size-2);
81
+ margin-inline-start: var(--size-2);
82
+ }
83
+ }
84
+
85
+ /* Variants */
86
+ &.filled {
87
+ input {
88
+ &::-webkit-file-upload-button,
89
+ &::file-selector-button {
90
+ background-color: var(--surface-default);
91
+ block-size: calc(100% - var(--size-2) * 2);
92
+ border-radius: var(--field-border-radius);
93
+ cursor: pointer;
94
+ margin-block-start: var(--size-2);
95
+ }
96
+ }
97
+ }
98
+
99
+ /* Sizes */
100
+ &.small {
101
+ input {
102
+ font-size: var(--font-size-sm);
103
+ &::-webkit-file-upload-button,
104
+ &::file-selector-button {
105
+ block-size: calc(100% - var(--size-2));
106
+ margin-block-start: var(--size-1);
107
+ }
108
+ }
109
+ }
110
+ }
111
+
112
+ /* Autosuggest */
113
+ &:has(input[list]) {
114
+ .label {
115
+ /* Make sure chevron is visible */
116
+ inline-size: calc(100% - var(--size-6));
117
+ }
118
+ }
119
+
120
+ /* Select */
121
+ &:has(select) {
122
+ .label {
123
+ /* Make sure chevron is visible */
124
+ inline-size: calc(100% - var(--size-6));
125
+ }
126
+ }
127
+
128
+ /* Experimental Select */
129
+ &:has(select button) {
130
+ select {
131
+ padding: 0;
132
+
133
+ button {
134
+ outline: 0;
135
+ padding: var(--_field-padding-block) var(--size-8)
136
+ var(--_field-padding-block) var(--_field-padding-inline);
137
+ }
138
+ }
139
+ }
140
+
141
+ /* Non-experimental Select */
142
+ &:has(select):not(:has(button)) {
143
+ select {
144
+ padding: var(--_field-padding-block) var(--size-8)
145
+ var(--_field-padding-block) var(--_field-padding-inline);
146
+ }
147
+ }
148
+
149
+ /* Input - color */
150
+ &:has(input[type="color"]) {
151
+ input {
152
+ appearance: none;
153
+ background: none;
154
+ block-size: var(--_height);
155
+ inline-size: var(--_height);
156
+ overflow: hidden;
157
+ padding: 0;
158
+
159
+ &::-webkit-color-swatch {
160
+ border: none;
161
+ }
162
+
163
+ &::-webkit-color-swatch-wrapper {
164
+ padding: 0;
165
+ }
166
+ }
167
+ }
168
+
169
+ /* Element states */
170
+ &:hover {
171
+ &:not(.error) {
172
+ :where(input, textarea, select) {
173
+ --_border-color: var(--text-color-1);
174
+ }
175
+ }
176
+ }
177
+
178
+ &:focus-within {
179
+ & input,
180
+ & textarea,
181
+ & select {
182
+ border-color: var(--_accent-color);
183
+ outline-offset: -2px;
184
+ outline: 2px solid var(--_accent-color);
185
+ }
186
+ }
187
+
188
+ /* Label */
189
+ .label {
190
+ font-size: var(--font-size-sm);
191
+ grid-column: 1/-1;
192
+ grid-row: 1;
193
+ }
194
+
195
+ /* Supporting text */
196
+ .supporting-text {
197
+ color: var(--_supporting-text-color);
198
+ font-size: var(--font-size-xs);
199
+ grid-column: 1/-1;
200
+ grid-row: 3;
201
+ line-height: 1.5;
202
+ }
203
+
204
+ /* Auto-fit */
205
+ &.auto-fit {
206
+ inline-size: auto;
207
+
208
+ :where(& input, & textarea) {
209
+ field-sizing: content;
210
+ inline-size: auto;
211
+ }
212
+ }
213
+
214
+ /* Validation */
215
+ &.error {
216
+ --_accent-color: var(--color-9);
217
+ --_border-color: var(--color-9);
218
+ --_filled-border-color: var(--color-9);
219
+ --_label-color: var(--color-9);
220
+ --_supporting-text-color: var(--color-9);
221
+ }
222
+
223
+ /*
224
+ * Variant: Filled
225
+ */
226
+ &.filled {
227
+ --_bg-color: var(--surface-tonal);
228
+
229
+ &:not(:has([disabled], :has(input[type="color"]))) {
230
+ /* Hover */
231
+ &:hover {
232
+ --_bg-color: light-dark(
233
+ oklch(from var(--surface-tonal) calc(l * 0.93) c h),
234
+ oklch(from var(--surface-tonal) calc(l * 1.1) c h)
235
+ );
236
+ }
237
+ }
238
+ }
239
+
240
+ /* Disabled */
241
+ &:where(:has([disabled])) {
242
+ &::before {
243
+ display: none;
244
+ }
245
+ :where(input, textarea, select) {
246
+ cursor: not-allowed;
247
+ opacity: 0.7;
248
+
249
+ * {
250
+ pointer-events: none;
251
+ }
252
+ }
253
+ }
254
+
255
+ /* Read-only */
256
+ &:where(:has([readonly])) {
257
+ &::before {
258
+ display: none;
259
+ }
260
+ :where(input, textarea, select) {
261
+ cursor: not-allowed;
262
+
263
+ * {
264
+ pointer-events: none;
265
+ }
266
+ }
267
+ }
268
+
269
+ /* Sizes */
270
+ &.small {
271
+ --_field-padding-block: var(--size-2);
272
+ --_height: var(--field-size-small);
273
+
274
+ &:has(input[type="color"]) {
275
+ .label {
276
+ line-height: 1.5;
277
+ }
278
+ }
279
+ }
280
+ }
281
+ }
@@ -0,0 +1,40 @@
1
+ @layer components.root {
2
+ :where(.icon-button) {
3
+ --_text-color: inherit;
4
+
5
+ align-items: center;
6
+ aspect-ratio: 1;
7
+ background-color: transparent;
8
+ border: 0;
9
+ border-radius: var(--radius-round);
10
+ display: inline-flex;
11
+ inline-size: var(--size-6);
12
+ justify-content: center;
13
+ padding: 0;
14
+ transform-style: preserve-3d;
15
+
16
+ &:where([disabled]) {
17
+ color: light-dark(rgb(0, 0, 0/0.3), rgb(255, 255, 255/0.26));
18
+ cursor: not-allowed;
19
+ opacity: 0.64;
20
+ }
21
+
22
+ svg {
23
+ max-inline-size: var(--size-5);
24
+ pointer-events: none;
25
+ }
26
+
27
+ /* Ripple effect, utils.css */
28
+ &::before {
29
+ --highlight-size: 130%;
30
+ }
31
+
32
+ /* Size */
33
+ &.small {
34
+ inline-size: var(--size-4);
35
+ svg {
36
+ max-inline-size: var(--size-4);
37
+ }
38
+ }
39
+ }
40
+ }
@@ -0,0 +1,21 @@
1
+ @layer components.root {
2
+ :where(.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
+ }