@oscarpalmer/oui 0.30.0 → 0.31.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.
@@ -2,10 +2,10 @@
2
2
 
3
3
  :where(.oui-pill, .oui-tag) {
4
4
  --oui-shadow-mixed: color-mix(
5
- in oklab,
6
- var(--oui-shadow, var(--oui-gray-6)),
7
- transparent 92.5%
8
- );
5
+ in oklab,
6
+ var(--oui-shadow, var(--oui-gray-6)),
7
+ transparent 92.5%
8
+ );
9
9
  box-shadow: inset 0 1px 0 0 transparent, 0 0 0 1px var(--oui-shadow-mixed), 0 1px 2px -0.5px var(--oui-shadow-mixed), 0 2px 4px -1px var(--oui-shadow-mixed);
10
10
  display: inline-flex;
11
11
  flex-flow: row nowrap;
@@ -1,5 +1,74 @@
1
+ @charset "UTF-8";
1
2
  /*! https://github.com/oscarpalmer/oui */
2
3
 
4
+ :where([oui-combobox-anchor]) {
5
+ --oui-background-percentage: 0%;
6
+ --oui-foreground-percentage: 0%;
7
+ --oui-outline-percentage: 100%;
8
+ --oui-outline-value: var(--oui-blue-6);
9
+ outline: 4px solid color-mix(in oklab, var(--oui-outline-value), transparent var(--oui-outline-percentage));
10
+ outline-offset: 0;
11
+ transition: 0.125s ease-in-out;
12
+ align-content: center;
13
+ background-color: color-mix(in oklab, var(--oui-background-value), transparent var(--oui-background-percentage));
14
+ border: 1px solid var(--oui-border-value, var(--oui-gray-3));
15
+ box-shadow: inset 0 2px 4px -1px var(--oui-gray-3);
16
+ color: color-mix(in oklab, var(--oui-foreground-value, inherit), transparent var(--oui-foreground-percentage));
17
+ -webkit-text-fill-color: color-mix(in oklab, var(--oui-foreground-value, inherit), transparent var(--oui-foreground-percentage));
18
+ --oui-background-value: var(--oui-absolute);
19
+ padding: 0.5em 2em 0.5em 0.75em;
20
+ border-radius: 0.25em;
21
+ background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='4'%3E%3Cpath d='M4 0h6L7 4'/%3E%3C/svg%3E");
22
+ background-position: right 0.5em center;
23
+ background-repeat: no-repeat;
24
+ background-size: 1em;
25
+ }
26
+ :where([oui-combobox-anchor]:not([disabled], [readonly], [aria-disabled=true i]):focus), :where([oui-combobox]:focus-within [oui-combobox-anchor]:not([disabled], [readonly], [aria-disabled=true i])) {
27
+ --oui-border-value: var(--oui-blue-5);
28
+ --oui-foreground-value: inherit;
29
+ --oui-outline-percentage: 75%;
30
+ --oui-outline-value: var(--oui-blue-6);
31
+ }
32
+ @media (hover: hover) {
33
+ :where(:not([disabled], [readonly], [aria-disabled=true i]) [oui-combobox-anchor]:hover) {
34
+ --oui-border-value: var(--oui-blue-4);
35
+ --oui-foreground-percentage: 0%;
36
+ --oui-foreground-value: inherit;
37
+ --oui-outline-percentage: 90%;
38
+ --oui-outline-value: var(--oui-blue-6);
39
+ }
40
+ }
41
+ :where(:is([disabled], [readonly], [aria-disabled=true i]) [oui-combobox-anchor]) {
42
+ --oui-foreground-percentage: 25%;
43
+ font-style: italic;
44
+ }
45
+ :where(:is([disabled], [readonly], [aria-disabled=true i]) [oui-combobox-anchor]:focus) {
46
+ --oui-outline-percentage: 75%;
47
+ }
48
+ :where(:is([disabled], [aria-disabled=true i]) [oui-combobox-anchor]) {
49
+ --oui-background-percentage: 50%;
50
+ }
51
+
52
+ :where([oui-combobox-content]) {
53
+ --margin-bottom: 0.5em;
54
+ --margin-left: 0.5em;
55
+ --margin-right: 0.5em;
56
+ --margin-top: 0.5em;
57
+ inset-block: var(--margin-top) var(--margin-bottom);
58
+ inset-inline: var(--margin-left) var(--margin-right);
59
+ }
60
+ :where([oui-combobox-content])[oui-position$=bottom] {
61
+ --margin-bottom: 0;
62
+ }
63
+ :where([oui-combobox-content])[oui-position$=end] {
64
+ --margin-right: 0;
65
+ }
66
+ :where([oui-combobox-content])[oui-position$=start] {
67
+ --margin-left: 0;
68
+ }
69
+ :where([oui-combobox-content])[oui-position$=top] {
70
+ --margin-top: 0;
71
+ }
3
72
  :where([oui-combobox-content]) {
4
73
  box-shadow: inset 0 1px 0 0 transparent, 0 0 0 1px rgba(0, 0, 0, 0.05), 0 1px 2px -0.5px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.05), 0 4px 8px -2px rgba(0, 0, 0, 0.05), 0 8px 16px -4px rgba(0, 0, 0, 0.05), 0 16px 32px -8px rgba(0, 0, 0, 0.05), 0 32px 64px -16px rgba(0, 0, 0, 0.05), 0 64px 128px -32px rgba(0, 0, 0, 0.05);
5
74
  width: -moz-fit-content;
@@ -10,17 +79,87 @@
10
79
  max-height: max(25vh, 32rem);
11
80
  min-width: var(--oui-combobox-width, auto);
12
81
  flex-flow: column nowrap;
82
+ border-radius: 0.25em;
13
83
  }
14
84
  :where([oui-combobox-content]):popover-open {
15
85
  display: flex !important;
16
86
  }
17
87
 
88
+ :where([oui-combobox-empty]) {
89
+ padding: 1em;
90
+ text-align: center;
91
+ font-style: italic;
92
+ }
93
+
18
94
  :where([oui-combobox-list]) {
19
95
  overflow: auto;
20
96
  }
21
97
 
22
98
  :where([oui-combobox-option]) {
99
+ padding: 0.5em 0.75em;
100
+ outline: 4px solid transparent;
101
+ outline-offset: -4px;
102
+ line-height: 1.25;
23
103
  cursor: pointer;
104
+ transition: 0.125s ease-in-out;
105
+ }
106
+ :where([oui-combobox-option][aria-selected=true i]) {
107
+ background-color: var(--oui-blue-3);
108
+ color: var(--oui-blue-9);
109
+ }
110
+ :where(oui-combobox[multiple] [oui-combobox-option][aria-selected=true i])::before {
111
+ content: "✓";
112
+ margin: 0 0.75em 0 0;
113
+ }
114
+ @media (hover: hover) {
115
+ :where(:where(oui-combobox:not([disabled], [readonly], [aria-disabled=true i]) [oui-combobox-option]):hover) {
116
+ background-color: var(--oui-blue-1);
117
+ color: var(--oui-blue-8);
118
+ }
119
+ }
120
+
121
+ :where([oui-combobox-option-active]) {
122
+ background-color: var(--oui-blue-1);
123
+ outline-color: var(--oui-blue-4);
124
+ color: var(--oui-blue-8);
125
+ }
126
+
127
+ :where([oui-combobox-selection]) {
128
+ max-height: 8rem;
129
+ display: flex;
130
+ padding: 0.5em;
131
+ margin: -0.5em -0.5em -0.5em -0.75em;
132
+ flex-flow: row wrap;
133
+ gap: 0.5em;
134
+ overflow: auto;
135
+ list-style: none;
136
+ }
137
+
138
+ :where([oui-combobox-selection-item]) {
139
+ --oui-shadow-mixed: color-mix(
140
+ in oklab,
141
+ var(--oui-shadow, var(--oui-gray-6)),
142
+ transparent 92.5%
143
+ );
144
+ box-shadow: inset 0 1px 0 0 transparent, 0 0 0 1px var(--oui-shadow-mixed), 0 1px 2px -0.5px var(--oui-shadow-mixed), 0 2px 4px -1px var(--oui-shadow-mixed);
145
+ display: inline-flex;
146
+ flex-flow: row nowrap;
147
+ gap: 0.5em;
148
+ background-color: color-mix(in oklab, var(--oui-background, var(--oui-gray-0)), transparent 25%);
149
+ color: var(--oui-foreground, var(--oui-gray-8));
150
+ line-height: 1.25;
151
+ border-radius: 3em;
152
+ padding: 0.5em 1em;
153
+ gap: 0.75em;
154
+ font-size: 0.875em;
155
+ transition: 0.125s ease-in-out;
156
+ }
157
+ @media (hover: hover) {
158
+ :where(oui-combobox:not([disabled], [readonly], [aria-disabled=true i]) [oui-combobox-selection-item]:hover) {
159
+ --oui-background: var(--oui-red-0);
160
+ --oui-foreground: var(--oui-red-8);
161
+ --oui-shadow: var(--oui-red-6);
162
+ }
24
163
  }
25
164
 
26
165
 
package/dist/css/form.css CHANGED
@@ -18,6 +18,7 @@
18
18
  outline: 4px solid color-mix(in oklab, var(--oui-outline-value), transparent var(--oui-outline-percentage));
19
19
  outline-offset: 0;
20
20
  transition: 0.125s ease-in-out;
21
+ align-content: center;
21
22
  background-color: color-mix(in oklab, var(--oui-background-value), transparent var(--oui-background-percentage));
22
23
  border: 1px solid var(--oui-border-value, var(--oui-gray-3));
23
24
  box-shadow: inset 0 2px 4px -1px var(--oui-gray-3);
@@ -94,6 +95,7 @@
94
95
  outline: 4px solid color-mix(in oklab, var(--oui-outline-value), transparent var(--oui-outline-percentage));
95
96
  outline-offset: 0;
96
97
  transition: 0.125s ease-in-out;
98
+ align-content: center;
97
99
  background-color: color-mix(in oklab, var(--oui-background-value), transparent var(--oui-background-percentage));
98
100
  border: 1px solid var(--oui-border-value, var(--oui-gray-3));
99
101
  box-shadow: inset 0 2px 4px -1px var(--oui-gray-3);
@@ -114,6 +116,7 @@
114
116
  outline: 4px solid color-mix(in oklab, var(--oui-outline-value), transparent var(--oui-outline-percentage));
115
117
  outline-offset: 0;
116
118
  transition: 0.125s ease-in-out;
119
+ align-content: center;
117
120
  background-color: color-mix(in oklab, var(--oui-background-value), transparent var(--oui-background-percentage));
118
121
  border: 1px solid var(--oui-border-value, var(--oui-gray-3));
119
122
  box-shadow: inset 0 2px 4px -1px var(--oui-gray-3);
@@ -133,6 +136,7 @@
133
136
  outline: 4px solid color-mix(in oklab, var(--oui-outline-value), transparent var(--oui-outline-percentage));
134
137
  outline-offset: 0;
135
138
  transition: 0.125s ease-in-out;
139
+ align-content: center;
136
140
  background-color: color-mix(in oklab, var(--oui-background-value), transparent var(--oui-background-percentage));
137
141
  border: 1px solid var(--oui-border-value, var(--oui-gray-3));
138
142
  box-shadow: inset 0 2px 4px -1px var(--oui-gray-3);
@@ -424,57 +428,57 @@
424
428
  --oui-outline-value: var(--oui-blue-6);
425
429
  }
426
430
  }
427
- :where(.oui-input[disabled], .oui-input[readonly], .oui-input[aria-disabled=true i]) {
431
+ :where(.oui-input:is([disabled], [readonly], [aria-disabled=true i])) {
428
432
  --oui-foreground-percentage: 25%;
429
433
  font-style: italic;
430
434
  }
431
- :where(.oui-input[disabled], .oui-input[readonly], .oui-input[aria-disabled=true i])::file-selector-button {
435
+ :where(.oui-input:is([disabled], [readonly], [aria-disabled=true i]))::file-selector-button {
432
436
  --oui-background-value: var(--oui-gray-1);
433
437
  cursor: default;
434
438
  }
435
- :where(.oui-input[disabled], .oui-input[readonly], .oui-input[aria-disabled=true i])::-moz-range-thumb {
439
+ :where(.oui-input:is([disabled], [readonly], [aria-disabled=true i]))::-moz-range-thumb {
436
440
  --oui-background-value: var(--oui-gray-2);
437
441
  cursor: default;
438
442
  }
439
- :where(.oui-input[disabled], .oui-input[readonly], .oui-input[aria-disabled=true i])::-ms-thumb {
443
+ :where(.oui-input:is([disabled], [readonly], [aria-disabled=true i]))::-ms-thumb {
440
444
  --oui-background-value: var(--oui-gray-2);
441
445
  cursor: default;
442
446
  }
443
- :where(.oui-input[disabled], .oui-input[readonly], .oui-input[aria-disabled=true i])::-webkit-slider-thumb {
447
+ :where(.oui-input:is([disabled], [readonly], [aria-disabled=true i]))::-webkit-slider-thumb {
444
448
  --oui-background-value: var(--oui-gray-2);
445
449
  cursor: default;
446
450
  }
447
451
  :where(.oui-input:is([disabled], [readonly], [aria-disabled=true i]):focus) {
448
452
  --oui-outline-percentage: 75%;
449
453
  }
450
- :where(.oui-input[disabled], .oui-input[aria-disabled=true i]) {
454
+ :where(.oui-input:is([disabled], [aria-disabled=true i])) {
451
455
  --oui-background-percentage: 50%;
452
456
  }
453
- :where(.oui-input[disabled], .oui-input[aria-disabled=true i])::-moz-range-thumb {
457
+ :where(.oui-input:is([disabled], [aria-disabled=true i]))::-moz-range-thumb {
454
458
  --oui-background-value: var(--oui-gray-1);
455
459
  cursor: default;
456
460
  }
457
- :where(.oui-input[disabled], .oui-input[aria-disabled=true i])::-ms-thumb {
461
+ :where(.oui-input:is([disabled], [aria-disabled=true i]))::-ms-thumb {
458
462
  --oui-background-value: var(--oui-gray-1);
459
463
  cursor: default;
460
464
  }
461
- :where(.oui-input[disabled], .oui-input[aria-disabled=true i])::-webkit-slider-thumb {
465
+ :where(.oui-input:is([disabled], [aria-disabled=true i]))::-webkit-slider-thumb {
462
466
  --oui-background-value: var(--oui-gray-1);
463
467
  cursor: default;
464
468
  }
465
- :where(.oui-input[disabled], .oui-input[aria-disabled=true i])::-moz-range-track {
469
+ :where(.oui-input:is([disabled], [aria-disabled=true i]))::-moz-range-track {
466
470
  --oui-background-percentage: 50%;
467
471
  --oui-background-value: var(--oui-gray-0);
468
472
  }
469
- :where(.oui-input[disabled], .oui-input[aria-disabled=true i])::-ms-track {
473
+ :where(.oui-input:is([disabled], [aria-disabled=true i]))::-ms-track {
470
474
  --oui-background-percentage: 50%;
471
475
  --oui-background-value: var(--oui-gray-0);
472
476
  }
473
- :where(.oui-input[disabled], .oui-input[aria-disabled=true i])::-webkit-slider-runnable-track {
477
+ :where(.oui-input:is([disabled], [aria-disabled=true i]))::-webkit-slider-runnable-track {
474
478
  --oui-background-percentage: 50%;
475
479
  --oui-background-value: var(--oui-gray-0);
476
480
  }
477
- :where(.oui-input[disabled], .oui-input[aria-disabled=true i])::-webkit-calendar-picker-indicator {
481
+ :where(.oui-input:is([disabled], [aria-disabled=true i]))::-webkit-calendar-picker-indicator {
478
482
  opacity: 0.5;
479
483
  }
480
484
 
@@ -523,7 +527,7 @@
523
527
  transition: 0.125s ease-in-out;
524
528
  }
525
529
  @media (hover: hover) {
526
- :where(:where(.oui-label)[for]:hover) {
530
+ :where(.oui-label[for]:hover) {
527
531
  color: var(--oui-blue-8);
528
532
  }
529
533
  }
@@ -8,18 +8,82 @@ declare class OuiComboboxElement extends HTMLElement {
8
8
  #private;
9
9
  static formAssociated: boolean;
10
10
  static observedAttributes: string[];
11
+ /**
12
+ * Is the combobox disabled?
13
+ */
11
14
  get disabled(): boolean;
15
+ /**
16
+ * Should the combobox be disabled?
17
+ */
12
18
  set disabled(value: boolean);
19
+ /**
20
+ * Maximum number of selected options
21
+ */
22
+ get max(): number | undefined;
23
+ /**
24
+ * Set the maximum number of selected options
25
+ */
26
+ set max(value: number);
27
+ /**
28
+ * Minimum number of selected options
29
+ */
30
+ get min(): number | undefined;
31
+ /**
32
+ * Set the minimum number of selected options
33
+ */
34
+ set min(value: number);
35
+ /**
36
+ * Does the combobox allow multiple values?
37
+ */
13
38
  get multiple(): boolean;
39
+ /**
40
+ * Name of the combobox
41
+ */
14
42
  get name(): string;
15
- set name(value: string);
43
+ /**
44
+ * Is the combobox readonly?
45
+ */
46
+ get readonly(): boolean;
47
+ /**
48
+ * Should the combobox be readonly?
49
+ */
50
+ set readonly(value: boolean);
51
+ /**
52
+ * Is the combobox required?
53
+ */
16
54
  get required(): boolean;
55
+ /**
56
+ * Should the combobox be required?
57
+ */
17
58
  set required(value: boolean);
59
+ /**
60
+ * Selected options
61
+ */
62
+ get selected(): HTMLElement[];
63
+ /**
64
+ * Type of combobox
65
+ */
18
66
  get type(): OuiComboboxType;
67
+ /**
68
+ * Current value
69
+ */
19
70
  get value(): string;
71
+ /**
72
+ * Set the value
73
+ */
20
74
  set value(value: unknown);
75
+ /**
76
+ * Current values
77
+ */
78
+ get values(): string[];
79
+ /**
80
+ * Set the values
81
+ */
82
+ set values(value: unknown[]);
21
83
  constructor();
22
84
  attributeChangedCallback(name: string, _: string | null, value: string | null): void;
85
+ clear(): void;
86
+ formResetCallback(): void;
23
87
  }
24
88
  type OuiComboboxType = 'autocomplete' | 'select';
25
89
  declare const TAGNAME = "oui-combobox";