opui-css 2.0.0 → 2.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.
Files changed (41) hide show
  1. package/LICENSE +21 -21
  2. package/dist/op+ui.css +4185 -4185
  3. package/dist/ui.css +4261 -4261
  4. package/package.json +1 -1
  5. package/src/components/accordion.css +172 -172
  6. package/src/components/alert.css +85 -85
  7. package/src/components/avatar.css +68 -68
  8. package/src/components/badge.css +101 -101
  9. package/src/components/button-group.css +69 -69
  10. package/src/components/button.css +267 -267
  11. package/src/components/card.css +82 -82
  12. package/src/components/checkbox-radio.css +123 -123
  13. package/src/components/chip.css +135 -135
  14. package/src/components/definition-list.css +65 -65
  15. package/src/components/dialog.css +59 -59
  16. package/src/components/divider.css +7 -7
  17. package/src/components/field-group.css +83 -83
  18. package/src/components/field.css +494 -494
  19. package/src/components/icon-button.css +40 -40
  20. package/src/components/link.css +21 -21
  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/components.css +37 -37
  37. package/src/core/normalize.css +194 -194
  38. package/src/core/theme.css +160 -160
  39. package/src/core/utils.css +60 -60
  40. package/src/main.css +13 -13
  41. package/src/opui.css +13 -13
@@ -1,163 +1,163 @@
1
- @layer components.extended {
2
- :where(.field > select) {
3
- position: relative;
4
-
5
- /* Default arrow */
6
- &::picker-icon {
7
- block-size: 0;
8
- border-block-start: 5px solid;
9
- border-inline: 5px solid transparent;
10
- color: currentColor;
11
- content: "";
12
- inline-size: 0;
13
- inset: 50% var(--size-3) auto auto;
14
- pointer-events: none;
15
- position: absolute;
16
- translate: 0 -50%;
17
- }
18
-
19
- &:open {
20
- &::picker-icon {
21
- rotate: 180deg;
22
- }
23
- }
24
-
25
- /* Select popover */
26
- &::picker(select) {
27
- /* Animation on-stage styles */
28
- border: 0;
29
- box-shadow: var(--shadow-2);
30
- opacity: 1;
31
- padding: 0;
32
- scale: 1;
33
-
34
- /* Animation starting styles */
35
- @starting-style {
36
- opacity: 0;
37
- transform: scale(0.9);
38
- }
39
-
40
- @media (prefers-reduced-motion: no-preference) {
41
- transition: display 0.2s allow-discrete, opacity 0.2s var(--ease-3),
42
- overlay 0.2s allow-discrete, scale 0.2s var(--ease-3);
43
- }
44
- }
45
-
46
- /* Animation off-stage styles */
47
- &:not(:open)::picker(select) {
48
- opacity: 0;
49
- scale: 0.9;
50
- }
51
-
52
- button {
53
- background-color: transparent;
54
- display: flex;
55
- inline-size: 100%;
56
- margin: 0;
57
- position: relative;
58
-
59
- selectedcontent {
60
- overflow: hidden;
61
- text-overflow: ellipsis;
62
- white-space: nowrap;
63
- }
64
- }
65
-
66
- .list {
67
- /* Groups */
68
- [role="group"] {
69
- label {
70
- background-color: light-dark(var(--gray-3), var(--gray-13));
71
- color: light-dark(
72
- oklch(from var(--text-color-1) calc(l * 0.75) c h),
73
- oklch(from var(--text-color-1) calc(l * 1.25) c h)
74
- );
75
- font-weight: 500;
76
- overflow: hidden;
77
- padding-inline: var(--size-2);
78
- text-overflow: ellipsis;
79
- white-space: nowrap;
80
- }
81
-
82
- &:not(:first-child),
83
- option:first-of-type {
84
- margin-block-start: var(--size-2);
85
- }
86
-
87
- option:last-of-type,
88
- &:last-child {
89
- option:last-of-type {
90
- margin-block-end: 0;
91
- }
92
- }
93
- }
94
-
95
- /* Option */
96
- option {
97
- /* Checkmark */
98
- /* TODO - checkmark should be the final version of the checkmark API. Follow the development of this and remove redundant psuedo stuff. */
99
- &::check {
100
- display: none;
101
- }
102
- &::checkmark {
103
- display: none;
104
- }
105
- &::before {
106
- display: none;
107
- }
108
-
109
- &:focus-visible {
110
- outline-offset: -1px;
111
- }
112
- }
113
- }
114
- }
115
-
116
- :where(.field:has(> select)) {
117
- /* Size */
118
- &.small {
119
- button {
120
- padding-block: var(--size-1);
121
- padding-inline: var(--size-2) var(--size-7);
122
-
123
- &::after {
124
- inset-inline-end: var(--size-2);
125
- }
126
- }
127
- }
128
-
129
- /*
130
- * Non-experimental Select
131
- *
132
- * Hack to get the arrow working. Pseudo elements aren't allowed on the `<select>` element, so need to add it on the `.field` class instead. Noting this down if an `:after` element would be needed on a `.field`.
133
- */
134
- &:not(:has(button)) {
135
- select {
136
- appearance: none;
137
- }
138
-
139
- /* Arrow */
140
- &::after {
141
- align-self: center;
142
- block-size: 0;
143
- border-block-start: 5px solid;
144
- border-inline: 5px solid transparent;
145
- content: "";
146
- display: inline-block;
147
- flex-shrink: 0;
148
- grid-column: 1/-1;
149
- grid-row: 1;
150
- inline-size: 0;
151
- inset-inline-end: var(--size-3);
152
- justify-self: end;
153
- pointer-events: none;
154
- position: relative;
155
- }
156
- }
157
- }
158
-
159
- select:has(button),
160
- ::picker(select) {
161
- appearance: base-select;
162
- }
163
- }
1
+ @layer components.extended {
2
+ :where(.field > select) {
3
+ position: relative;
4
+
5
+ /* Default arrow */
6
+ &::picker-icon {
7
+ block-size: 0;
8
+ border-block-start: 5px solid;
9
+ border-inline: 5px solid transparent;
10
+ color: currentColor;
11
+ content: "";
12
+ inline-size: 0;
13
+ inset: 50% var(--size-3) auto auto;
14
+ pointer-events: none;
15
+ position: absolute;
16
+ translate: 0 -50%;
17
+ }
18
+
19
+ &:open {
20
+ &::picker-icon {
21
+ rotate: 180deg;
22
+ }
23
+ }
24
+
25
+ /* Select popover */
26
+ &::picker(select) {
27
+ /* Animation on-stage styles */
28
+ border: 0;
29
+ box-shadow: var(--shadow-2);
30
+ opacity: 1;
31
+ padding: 0;
32
+ scale: 1;
33
+
34
+ /* Animation starting styles */
35
+ @starting-style {
36
+ opacity: 0;
37
+ transform: scale(0.9);
38
+ }
39
+
40
+ @media (prefers-reduced-motion: no-preference) {
41
+ transition: display 0.2s allow-discrete, opacity 0.2s var(--ease-3),
42
+ overlay 0.2s allow-discrete, scale 0.2s var(--ease-3);
43
+ }
44
+ }
45
+
46
+ /* Animation off-stage styles */
47
+ &:not(:open)::picker(select) {
48
+ opacity: 0;
49
+ scale: 0.9;
50
+ }
51
+
52
+ button {
53
+ background-color: transparent;
54
+ display: flex;
55
+ inline-size: 100%;
56
+ margin: 0;
57
+ position: relative;
58
+
59
+ selectedcontent {
60
+ overflow: hidden;
61
+ text-overflow: ellipsis;
62
+ white-space: nowrap;
63
+ }
64
+ }
65
+
66
+ .list {
67
+ /* Groups */
68
+ [role="group"] {
69
+ label {
70
+ background-color: light-dark(var(--gray-3), var(--gray-13));
71
+ color: light-dark(
72
+ oklch(from var(--text-color-1) calc(l * 0.75) c h),
73
+ oklch(from var(--text-color-1) calc(l * 1.25) c h)
74
+ );
75
+ font-weight: 500;
76
+ overflow: hidden;
77
+ padding-inline: var(--size-2);
78
+ text-overflow: ellipsis;
79
+ white-space: nowrap;
80
+ }
81
+
82
+ &:not(:first-child),
83
+ option:first-of-type {
84
+ margin-block-start: var(--size-2);
85
+ }
86
+
87
+ option:last-of-type,
88
+ &:last-child {
89
+ option:last-of-type {
90
+ margin-block-end: 0;
91
+ }
92
+ }
93
+ }
94
+
95
+ /* Option */
96
+ option {
97
+ /* Checkmark */
98
+ /* TODO - checkmark should be the final version of the checkmark API. Follow the development of this and remove redundant psuedo stuff. */
99
+ &::check {
100
+ display: none;
101
+ }
102
+ &::checkmark {
103
+ display: none;
104
+ }
105
+ &::before {
106
+ display: none;
107
+ }
108
+
109
+ &:focus-visible {
110
+ outline-offset: -1px;
111
+ }
112
+ }
113
+ }
114
+ }
115
+
116
+ :where(.field:has(> select)) {
117
+ /* Size */
118
+ &.small {
119
+ button {
120
+ padding-block: var(--size-1);
121
+ padding-inline: var(--size-2) var(--size-7);
122
+
123
+ &::after {
124
+ inset-inline-end: var(--size-2);
125
+ }
126
+ }
127
+ }
128
+
129
+ /*
130
+ * Non-experimental Select
131
+ *
132
+ * Hack to get the arrow working. Pseudo elements aren't allowed on the `<select>` element, so need to add it on the `.field` class instead. Noting this down if an `:after` element would be needed on a `.field`.
133
+ */
134
+ &:not(:has(button)) {
135
+ select {
136
+ appearance: none;
137
+ }
138
+
139
+ /* Arrow */
140
+ &::after {
141
+ align-self: center;
142
+ block-size: 0;
143
+ border-block-start: 5px solid;
144
+ border-inline: 5px solid transparent;
145
+ content: "";
146
+ display: inline-block;
147
+ flex-shrink: 0;
148
+ grid-column: 1/-1;
149
+ grid-row: 1;
150
+ inline-size: 0;
151
+ inset-inline-end: var(--size-3);
152
+ justify-self: end;
153
+ pointer-events: none;
154
+ position: relative;
155
+ }
156
+ }
157
+ }
158
+
159
+ select:has(button),
160
+ ::picker(select) {
161
+ appearance: base-select;
162
+ }
163
+ }
@@ -1,148 +1,148 @@
1
- @layer components.extended {
2
- :where(.snackbar) {
3
- align-items: center;
4
- /* Inverse surface-filled */
5
- background-color: light-dark(var(--gray-15), var(--gray-2));
6
- border-radius: var(--border-radius);
7
- box-shadow: var(--shadow-2);
8
- color: var(--text-color-1-contrast);
9
- display: flex;
10
- font-size: var(--font-size-sm);
11
- gap: var(--size-3);
12
- inset-block: auto var(--size-3);
13
- inset-inline: var(--size-3) auto;
14
- justify-content: space-between;
15
- min-inline-size: min(100%, 37ch);
16
- padding: var(--size-2) var(--size-3);
17
- position: fixed;
18
- inline-size: calc(100% - var(--size-6, 1.75rem));
19
- z-index: 100;
20
-
21
- &::backdrop {
22
- display: none;
23
- }
24
-
25
- * {
26
- word-break: break-word;
27
- }
28
-
29
- /* Global positioning (in relation to the window) */
30
- /*** Default (end-start) */
31
- inset-block: auto var(--size-3);
32
- inset-inline: 50% 0;
33
- translate: -50% 0;
34
-
35
- &.start-start,
36
- &.start-center,
37
- &.start-end {
38
- inset-block: var(--size-3) auto;
39
- }
40
-
41
- /* TODO use @custom-media instead? */
42
- @container (width > 480px) {
43
- /* Default (end-start) */
44
- inset-block: auto var(--size-7, 2rem);
45
- inset-inline: var(--size-7, 2rem) auto;
46
- translate: revert;
47
- inline-size: fit-content;
48
-
49
- &.end-start,
50
- &.end-end,
51
- &.start-start,
52
- &.start-end {
53
- translate: revert;
54
- }
55
-
56
- &.start-start {
57
- inset-block: var(--size-7, 2rem) auto;
58
- inset-inline: var(--size-7, 2rem) auto;
59
- }
60
- &.start-center {
61
- inset-block: var(--size-7, 2rem) auto;
62
- inset-inline: 50% 0;
63
- translate: -50% 0;
64
- }
65
- &.start-end {
66
- inset-block: var(--size-7, 2rem) auto;
67
- inset-inline: auto var(--size-7, 2rem);
68
- }
69
- &.end-start {
70
- inset-block-end: var(--size-7, 2rem);
71
- inset-inline: var(--size-7, 2rem) auto;
72
- }
73
- &.end-center {
74
- inset-block: auto var(--size-7, 2rem);
75
- inset-inline: 50% 0;
76
- translate: -50% 0;
77
- }
78
- &.end-end {
79
- inset-block: auto var(--size-7, 2rem);
80
- inset-inline: auto var(--size-7, 2rem);
81
- }
82
- }
83
-
84
- /* Absolute positioning */
85
- &.absolute {
86
- position: absolute;
87
- }
88
-
89
- /* Actions */
90
- .actions {
91
- align-items: center;
92
- display: flex;
93
- flex-shrink: 0;
94
- gap: var(--size-3);
95
- padding-inline: 0;
96
-
97
- button {
98
- /* Inverse hover and active backgrounds */
99
- &:where(:not([disabled])) {
100
- &:where(:not(:active):hover) {
101
- --_bg-color: light-dark(
102
- color-mix(in oklch, white 40%, black),
103
- color-mix(in oklch, white 85%, black)
104
- );
105
- }
106
-
107
- &:where(:hover:active) {
108
- --_bg-color: light-dark(
109
- color-mix(in oklch, white 45%, black),
110
- color-mix(in oklch, white 80%, black)
111
- );
112
- }
113
- }
114
- }
115
-
116
- button:not(:has(svg)) {
117
- border-radius: var(--border-radius);
118
- font-size: inherit;
119
- max-block-size: var(--size-6, 1.5rem);
120
- padding: 1ex;
121
- }
122
-
123
- button:has(svg) {
124
- color: inherit;
125
- max-inline-size: var(--size-6, 1.75rem);
126
- margin: var(--size-00);
127
- padding: var(--size-1);
128
- }
129
- }
130
-
131
- /* Animations */
132
- opacity: 0;
133
- transition: display 0.075s allow-discrete, overlay 0.075s allow-discrete,
134
- opacity 0.075s var(--ease-out-1);
135
-
136
- &:popover-open,
137
- &:popover-open::backdrop,
138
- &.visible {
139
- opacity: 1;
140
- transition: display 0.25s allow-discrete, overlay 0.25s allow-discrete,
141
- opacity 0.25s var(--ease-out-1);
142
-
143
- @starting-style {
144
- opacity: 0;
145
- }
146
- }
147
- }
148
- }
1
+ @layer components.extended {
2
+ :where(.snackbar) {
3
+ align-items: center;
4
+ /* Inverse surface-filled */
5
+ background-color: light-dark(var(--gray-15), var(--gray-2));
6
+ border-radius: var(--border-radius);
7
+ box-shadow: var(--shadow-2);
8
+ color: var(--text-color-1-contrast);
9
+ display: flex;
10
+ font-size: var(--font-size-sm);
11
+ gap: var(--size-3);
12
+ inset-block: auto var(--size-3);
13
+ inset-inline: var(--size-3) auto;
14
+ justify-content: space-between;
15
+ min-inline-size: min(100%, 37ch);
16
+ padding: var(--size-2) var(--size-3);
17
+ position: fixed;
18
+ inline-size: calc(100% - var(--size-6, 1.75rem));
19
+ z-index: 100;
20
+
21
+ &::backdrop {
22
+ display: none;
23
+ }
24
+
25
+ * {
26
+ word-break: break-word;
27
+ }
28
+
29
+ /* Global positioning (in relation to the window) */
30
+ /*** Default (end-start) */
31
+ inset-block: auto var(--size-3);
32
+ inset-inline: 50% 0;
33
+ translate: -50% 0;
34
+
35
+ &.start-start,
36
+ &.start-center,
37
+ &.start-end {
38
+ inset-block: var(--size-3) auto;
39
+ }
40
+
41
+ /* TODO use @custom-media instead? */
42
+ @container (width > 480px) {
43
+ /* Default (end-start) */
44
+ inset-block: auto var(--size-7, 2rem);
45
+ inset-inline: var(--size-7, 2rem) auto;
46
+ translate: revert;
47
+ inline-size: fit-content;
48
+
49
+ &.end-start,
50
+ &.end-end,
51
+ &.start-start,
52
+ &.start-end {
53
+ translate: revert;
54
+ }
55
+
56
+ &.start-start {
57
+ inset-block: var(--size-7, 2rem) auto;
58
+ inset-inline: var(--size-7, 2rem) auto;
59
+ }
60
+ &.start-center {
61
+ inset-block: var(--size-7, 2rem) auto;
62
+ inset-inline: 50% 0;
63
+ translate: -50% 0;
64
+ }
65
+ &.start-end {
66
+ inset-block: var(--size-7, 2rem) auto;
67
+ inset-inline: auto var(--size-7, 2rem);
68
+ }
69
+ &.end-start {
70
+ inset-block-end: var(--size-7, 2rem);
71
+ inset-inline: var(--size-7, 2rem) auto;
72
+ }
73
+ &.end-center {
74
+ inset-block: auto var(--size-7, 2rem);
75
+ inset-inline: 50% 0;
76
+ translate: -50% 0;
77
+ }
78
+ &.end-end {
79
+ inset-block: auto var(--size-7, 2rem);
80
+ inset-inline: auto var(--size-7, 2rem);
81
+ }
82
+ }
83
+
84
+ /* Absolute positioning */
85
+ &.absolute {
86
+ position: absolute;
87
+ }
88
+
89
+ /* Actions */
90
+ .actions {
91
+ align-items: center;
92
+ display: flex;
93
+ flex-shrink: 0;
94
+ gap: var(--size-3);
95
+ padding-inline: 0;
96
+
97
+ button {
98
+ /* Inverse hover and active backgrounds */
99
+ &:where(:not([disabled])) {
100
+ &:where(:not(:active):hover) {
101
+ --_bg-color: light-dark(
102
+ color-mix(in oklch, white 40%, black),
103
+ color-mix(in oklch, white 85%, black)
104
+ );
105
+ }
106
+
107
+ &:where(:hover:active) {
108
+ --_bg-color: light-dark(
109
+ color-mix(in oklch, white 45%, black),
110
+ color-mix(in oklch, white 80%, black)
111
+ );
112
+ }
113
+ }
114
+ }
115
+
116
+ button:not(:has(svg)) {
117
+ border-radius: var(--border-radius);
118
+ font-size: inherit;
119
+ max-block-size: var(--size-6, 1.5rem);
120
+ padding: 1ex;
121
+ }
122
+
123
+ button:has(svg) {
124
+ color: inherit;
125
+ max-inline-size: var(--size-6, 1.75rem);
126
+ margin: var(--size-00);
127
+ padding: var(--size-1);
128
+ }
129
+ }
130
+
131
+ /* Animations */
132
+ opacity: 0;
133
+ transition: display 0.075s allow-discrete, overlay 0.075s allow-discrete,
134
+ opacity 0.075s var(--ease-out-1);
135
+
136
+ &:popover-open,
137
+ &:popover-open::backdrop,
138
+ &.visible {
139
+ opacity: 1;
140
+ transition: display 0.25s allow-discrete, overlay 0.25s allow-discrete,
141
+ opacity 0.25s var(--ease-out-1);
142
+
143
+ @starting-style {
144
+ opacity: 0;
145
+ }
146
+ }
147
+ }
148
+ }