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,162 @@
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-inline: var(--size-2) var(--size-7);
121
+
122
+ &::after {
123
+ inset-inline-end: var(--size-2);
124
+ }
125
+ }
126
+ }
127
+
128
+ /*
129
+ * Non-experimental Select
130
+ *
131
+ * 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`.
132
+ */
133
+ &:not(:has(button)) {
134
+ select {
135
+ appearance: none;
136
+ }
137
+
138
+ /* Arrow */
139
+ &::after {
140
+ align-self: center;
141
+ block-size: 0;
142
+ border-block-start: 5px solid;
143
+ border-inline: 5px solid transparent;
144
+ content: "";
145
+ display: inline-block;
146
+ flex-shrink: 0;
147
+ grid-column: 1/-1;
148
+ grid-row: 2;
149
+ inline-size: 0;
150
+ inset-inline-end: var(--size-3);
151
+ justify-self: end;
152
+ pointer-events: none;
153
+ position: relative;
154
+ }
155
+ }
156
+ }
157
+
158
+ select:has(button),
159
+ ::picker(select) {
160
+ appearance: base-select;
161
+ }
162
+ }
@@ -0,0 +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
+ }
@@ -0,0 +1,38 @@
1
+ @layer components.root {
2
+ [aria-busy="true"]:not(
3
+ input,
4
+ select,
5
+ textarea,
6
+ html,
7
+ progress,
8
+ [aria-describedby]
9
+ ) {
10
+ position: relative;
11
+
12
+ &::before {
13
+ animation: spin 0.7s linear infinite;
14
+ border-color: transparent currentColor currentColor;
15
+ border-radius: 50%;
16
+ border-style: solid;
17
+ border-width: 3px;
18
+ content: "";
19
+ display: inline-block;
20
+ block-size: 1em;
21
+ opacity: 0.5;
22
+ vertical-align: -0.14em;
23
+ inline-size: 1em;
24
+ }
25
+
26
+ &:not(button.button):not(:empty) {
27
+ &::before {
28
+ margin-inline-end: 0.5em;
29
+ }
30
+ }
31
+ }
32
+
33
+ @keyframes spin {
34
+ to {
35
+ transform: rotate(1turn);
36
+ }
37
+ }
38
+ }
@@ -0,0 +1,189 @@
1
+ @layer components.root {
2
+ :where(.switch) {
3
+ --_accent-color: var(--primary);
4
+ --_accent-contrast: var(--primary-contrast);
5
+
6
+ --_dot-bg-color: light-dark(var(--gray-11), var(--gray-14));
7
+ --_dot-inset: var(--size-1) auto auto var(--size-1);
8
+ --_dot-outline-size: 0;
9
+ --_dot-size: var(--size-3);
10
+
11
+ --_track-bg-color: light-dark(var(--gray-3), var(--gray-8));
12
+ --_track-height: var(--size-5);
13
+ --_track-width: var(--size-8);
14
+ --_transition-tf: var(--ease-4);
15
+ --_transition-time: 0.2s;
16
+
17
+ align-items: center;
18
+ color: var(--text-color-1);
19
+ display: inline-grid;
20
+ gap: 0 var(--size-2);
21
+ grid-auto-columns: auto;
22
+ grid-auto-flow: column;
23
+ inline-size: fit-content;
24
+
25
+ input[type="checkbox"][role="switch"] {
26
+ appearance: none;
27
+ block-size: var(--_track-height);
28
+ cursor: pointer;
29
+ inline-size: var(--_track-width);
30
+ margin: 0;
31
+ position: relative;
32
+
33
+ /* Track */
34
+ &::before {
35
+ background-color: var(--_track-bg-color);
36
+ block-size: var(--_track-height);
37
+ border: 1px solid var(--_dot-bg-color);
38
+ border-radius: 100vmax;
39
+ content: "";
40
+ inline-size: var(--_track-width);
41
+ inset: 0;
42
+ position: absolute;
43
+ }
44
+
45
+ &:focus-visible {
46
+ outline-offset: 2px;
47
+ outline: 2px solid currentColor;
48
+ }
49
+
50
+ /* Dot */
51
+ &::after {
52
+ background-color: var(--_dot-bg-color);
53
+ block-size: var(--_dot-size);
54
+ border-radius: 100vmax;
55
+ content: "";
56
+ inline-size: var(--_dot-size);
57
+ inset: var(--_dot-inset);
58
+ outline-offset: -1px;
59
+ outline: var(--_dot-outline-size) solid var(--_dot-bg-color);
60
+ position: absolute;
61
+ }
62
+
63
+ /* Checked */
64
+ &:checked {
65
+ &::before {
66
+ background-color: var(--_accent-color);
67
+ border-color: var(--_accent-color);
68
+ transition: background-color var(--_transition-time)
69
+ var(--_transition-tf),
70
+ border-color var(--_transition-time) var(--_transition-tf);
71
+ }
72
+
73
+ /* Dot */
74
+ &::after {
75
+ --_dot-bg-color: var(--_accent-contrast);
76
+ --_dot-outline-size: calc(var(--size-1) - 1px);
77
+
78
+ inset-inline-start: calc(
79
+ var(--_track-width) - var(--_dot-size) - var(--size-1)
80
+ );
81
+ }
82
+ }
83
+
84
+ /* Animation */
85
+ @media (prefers-reduced-motion: no-preference) {
86
+ /* Track */
87
+ &::before {
88
+ transition: background-color var(--_transition-time)
89
+ var(--_transition-tf),
90
+ border-color var(--_transition-time) var(--_transition-tf);
91
+ }
92
+
93
+ /* Dot */
94
+ &::after {
95
+ transition: all var(--_transition-time) var(--_transition-tf);
96
+ }
97
+
98
+ &:active:after {
99
+ --_dot-outline-size: calc(var(--size-1) + 1px);
100
+ }
101
+
102
+ &:checked {
103
+ &:active:after {
104
+ --_dot-outline-size: calc(var(--size-1) + 1px);
105
+ }
106
+ }
107
+ }
108
+ }
109
+
110
+ /* Required dot */
111
+ &:has([required]:not(:checked)) {
112
+ .label:after {
113
+ color: var(--red);
114
+ content: "*";
115
+ inset: 0 -0.25ex auto auto;
116
+ position: absolute;
117
+ }
118
+ }
119
+
120
+ /* Disabled */
121
+ &:has([disabled]) {
122
+ cursor: not-allowed;
123
+ opacity: 0.64;
124
+ user-select: none;
125
+
126
+ input {
127
+ cursor: not-allowed;
128
+ }
129
+ }
130
+
131
+ /* Label */
132
+ .label {
133
+ grid-column: 2;
134
+ grid-row: 1;
135
+ min-width: 0;
136
+ padding-inline: 0 1ex;
137
+ position: relative;
138
+ user-select: none;
139
+ }
140
+
141
+ /* Supporting text */
142
+ .supporting-text {
143
+ color: var(--text-color-2);
144
+ font-size: var(--font-size-xs);
145
+ grid-column: 2;
146
+ grid-row: 2;
147
+ line-height: 1.5;
148
+ z-index: 1;
149
+ }
150
+
151
+ /* Size */
152
+ &.small {
153
+ --_dot-size: 0.75rem;
154
+ --_track-height: var(--size-4);
155
+ --_track-width: 2.5rem;
156
+ }
157
+
158
+ /* Stacked layout */
159
+ &.stack {
160
+ justify-items: center;
161
+ grid-auto-columns: unset;
162
+
163
+ .label {
164
+ grid-column: 1/-1;
165
+ grid-row: 2;
166
+ margin-block-start: var(--size-1);
167
+ padding-inline: 1ex;
168
+ }
169
+
170
+ .supporting-text {
171
+ grid-column: 1/-1;
172
+ grid-row: 3;
173
+ }
174
+ }
175
+
176
+ /* Validation */
177
+ &.error {
178
+ input {
179
+ outline: 2px solid var(--color-9);
180
+ border-radius: var(--radius-round);
181
+ }
182
+
183
+ .label,
184
+ .supporting-text {
185
+ color: var(--color-9);
186
+ }
187
+ }
188
+ }
189
+ }
@@ -0,0 +1,120 @@
1
+ @layer components.root {
2
+ :where(nav.tabs) {
3
+ --_bg-color: transparent;
4
+
5
+ & > [role="tablist"] {
6
+ button {
7
+ outline-color: transparent;
8
+ outline-offset: -4px;
9
+
10
+ &[aria-selected="true"] {
11
+ &:focus-visible {
12
+ outline: 2px solid var(--text-color-1);
13
+ }
14
+ }
15
+ }
16
+ }
17
+
18
+ /* Underlined */
19
+ &.underlined {
20
+ /* Tab list */
21
+ & > [role="tablist"] {
22
+ border-bottom: 1px solid var(--border-color);
23
+
24
+ button {
25
+ --_ripple-color: light-dark(
26
+ color-mix(in oklch, var(--gray-2) 80%, var(--color-8)),
27
+ color-mix(in oklch, var(--gray-13) 80%, var(--color-8))
28
+ );
29
+
30
+ background: var(--_bg-color) var(--ripple, none);
31
+ font-weight: 500;
32
+ line-height: var(--font-lineheight-4);
33
+ padding: var(--size-2) var(--size-3);
34
+
35
+ &:focus-visible {
36
+ border-radius: 0;
37
+ }
38
+
39
+ &[aria-selected="true"] {
40
+ border-block-end: 2px solid var(--primary);
41
+ color: var(--primary);
42
+ }
43
+
44
+ @media (prefers-reduced-motion: no-preference) {
45
+ transition: background-color 0.2s var(--ease-out-3),
46
+ border-color 0.2s var(--ease-out-3), color 0.2s var(--ease-out-3),
47
+ outline-offset 0.05s var(--ease-1);
48
+
49
+ /*** Ripple effect */
50
+ background-position: center;
51
+ transition: background var(--button-ripple-duration);
52
+ &:where(:not(:active):hover) {
53
+ --ripple: radial-gradient(
54
+ circle,
55
+ transparent 1%,
56
+ var(--_ripple-color) 1%
57
+ )
58
+ center/15000%;
59
+ }
60
+
61
+ &:where(:hover:active) {
62
+ background-size: var(--button-ripple-size);
63
+ transition: background 0s;
64
+ }
65
+
66
+ &:hover {
67
+ background-color: light-dark(
68
+ oklch(from var(--primary) calc(l * 0.75) none h / 5%),
69
+ oklch(from var(--primary) calc(l * 1.25) none h / 5%)
70
+ );
71
+ }
72
+ }
73
+ }
74
+ }
75
+ }
76
+
77
+ /* Filled */
78
+ &.filled {
79
+ --_bg-color: var(--surface-default);
80
+ --_radius: var(--border-radius);
81
+ --_selected-bg: var(--surface-filled);
82
+
83
+ & > [role="tablist"] {
84
+ background-color: var(--_bg-color);
85
+ border: var(--border-width) solid var(--border-color);
86
+ border-radius: var(--_radius);
87
+ overflow: hidden;
88
+ padding: 0.792ex;
89
+ width: fit-content;
90
+
91
+ button {
92
+ background-color: var(--_bg-color);
93
+ border-radius: var(--_radius);
94
+ line-height: var(--font-lineheight-4);
95
+ padding-inline: var(--size-3);
96
+
97
+ &:hover {
98
+ background-color: oklch(from var(--_bg-color) calc(l * 1.25) c h);
99
+ }
100
+
101
+ &[aria-selected="true"] {
102
+ background-color: var(--_selected-bg);
103
+
104
+ &:hover {
105
+ background-color: oklch(
106
+ from var(--_selected-bg) calc(l * 1.25) c h
107
+ );
108
+ }
109
+ }
110
+
111
+ @media (prefers-reduced-motion: no-preference) {
112
+ transition: background-color 0.2s var(--ease-out-3),
113
+ border-color 0.2s var(--ease-out-3), color 0.2s var(--ease-out-3),
114
+ outline-offset 0.05s var(--ease-1);
115
+ }
116
+ }
117
+ }
118
+ }
119
+ }
120
+ }
@@ -0,0 +1,57 @@
1
+ @layer components.extended {
2
+ :where(
3
+ .field:has(
4
+ :where(
5
+ input[type="date"],
6
+ input[type="datetime-local"],
7
+ input[type="email"],
8
+ input[type="month"],
9
+ input[type="number"],
10
+ input[type="password"],
11
+ input[type="search"],
12
+ input[type="tel"],
13
+ input[type="text"],
14
+ input[type="time"],
15
+ input[type="url"],
16
+ input[type="week"]
17
+ )
18
+ )
19
+ ) {
20
+ /* Sizes */
21
+ &.small {
22
+ input {
23
+ padding-inline: var(--size-2);
24
+ }
25
+ }
26
+ }
27
+
28
+ /* Autosuggest */
29
+ :where(.field:has(input[list])) {
30
+ /* Hide native arrow */
31
+ input::-webkit-calendar-picker-indicator {
32
+ opacity: 0;
33
+ position: absolute;
34
+ cursor: pointer;
35
+ pointer-events: none;
36
+ }
37
+ }
38
+ :where(
39
+ .field:has(input[list]:placeholder-shown),
40
+ .field:has(input[list]):where(:focus-within, :hover)
41
+ ) {
42
+ /* Arrow */
43
+ &::after {
44
+ block-size: 0;
45
+ border-block-start: 5px solid;
46
+ border-inline: 5px solid transparent;
47
+ content: "";
48
+ display: inline-block;
49
+ flex-shrink: 0;
50
+ inline-size: 0;
51
+ inset: 50% var(--size-3) auto auto;
52
+ pointer-events: none;
53
+ position: absolute;
54
+ translate: 0 -50%;
55
+ }
56
+ }
57
+ }