@triptease/tt-combobox 5.4.0 → 5.4.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 (2) hide show
  1. package/custom-elements.json +392 -392
  2. package/package.json +2 -2
@@ -2,321 +2,6 @@
2
2
  "schemaVersion": "1.0.0",
3
3
  "readme": "",
4
4
  "modules": [
5
- {
6
- "kind": "javascript-module",
7
- "path": "stories/combobox.stories.ts",
8
- "declarations": [
9
- {
10
- "kind": "variable",
11
- "name": "meta",
12
- "type": {
13
- "text": "object"
14
- },
15
- "default": "{ title: 'ComboBox', component: 'tt-combobox', argTypes: { label: { control: 'text' }, id: { control: 'text' }, 'display-select-all': { control: 'boolean' }, 'select-all-placeholder': { control: 'text' }, options: { control: 'object' } }, tags: ['autodocs'] }"
16
- },
17
- {
18
- "kind": "variable",
19
- "name": "SingleSelect"
20
- },
21
- {
22
- "kind": "function",
23
- "name": "SingleSelectWithDefault",
24
- "parameters": [
25
- {
26
- "name": "{\n label = 'With default options',\n id = 'combobox-13',\n options = [\n { label: 'Option 1', value: '0' },\n { label: 'Option 2', value: '1', disabled: true },\n { label: 'Option 3', value: '2' }\n ],\n value = '0'\n }"
27
- }
28
- ]
29
- },
30
- {
31
- "kind": "variable",
32
- "name": "MultiSelect"
33
- },
34
- {
35
- "kind": "variable",
36
- "name": "MultiSelectSelectAll"
37
- },
38
- {
39
- "kind": "variable",
40
- "name": "WithStyles"
41
- },
42
- {
43
- "kind": "function",
44
- "name": "WithCustomOptionStyle",
45
- "parameters": [
46
- {
47
- "name": "{\n label = 'Test label',\n id = 'combobox-1',\n displaySelectAll = false,\n options = [\n { label: 'Option 1', value: '0' },\n { label: 'Option 2', value: '1' },\n { label: 'Option 3', value: '2' }\n ],\n multiselect = false\n }"
48
- }
49
- ]
50
- },
51
- {
52
- "kind": "function",
53
- "name": "WithIcon",
54
- "parameters": [
55
- {
56
- "name": "{\n label = 'With icon',\n id = 'combobox-1',\n displaySelectAll = false,\n options = [\n { label: 'Option 1', value: '0' },\n { label: 'Option 2', value: '1' },\n { label: 'Option 3', value: '2' }\n ],\n multiselect = false\n }"
57
- }
58
- ]
59
- },
60
- {
61
- "kind": "function",
62
- "name": "HiddenCaret",
63
- "parameters": [
64
- {
65
- "name": "{\n label = 'With hidden caret',\n id = 'combobox-1',\n displaySelectAll = false,\n options = [\n { label: 'Option 1', value: '0' },\n { label: 'Option 2', value: '1' },\n { label: 'Option 3', value: '2' }\n ],\n multiselect = false\n }"
66
- }
67
- ]
68
- },
69
- {
70
- "kind": "function",
71
- "name": "WithError",
72
- "parameters": [
73
- {
74
- "name": "{\n label = 'With error',\n id = 'combobox-1',\n displaySelectAll = false,\n options = [\n { label: 'Option 1', value: '0' },\n { label: 'Option 2', value: '1' },\n { label: 'Option 3', value: '2' }\n ],\n multiselect = false\n }"
75
- }
76
- ]
77
- },
78
- {
79
- "kind": "function",
80
- "name": "WithOptionDisabled",
81
- "parameters": [
82
- {
83
- "name": "{\n label = 'With option disabled',\n id = 'combobox-1',\n displaySelectAll = true,\n options = [\n { label: 'Option 1', value: '0' },\n { label: 'Option 2', value: '1', disabled: true },\n { label: 'Option 3', value: '2' }\n ],\n multiselect = true\n }"
84
- }
85
- ]
86
- },
87
- {
88
- "kind": "function",
89
- "name": "DisabledComboBox",
90
- "parameters": [
91
- {
92
- "name": "{\n label = 'Disabled selector',\n id = 'combobox-1',\n displaySelectAll = false,\n options = [\n { label: 'Option 1', value: '0' },\n { label: 'Option 2', value: '1' },\n { label: 'Option 3', value: '2' }\n ],\n multiselect = false\n }"
93
- }
94
- ]
95
- },
96
- {
97
- "kind": "function",
98
- "name": "InsideForm",
99
- "parameters": [
100
- {
101
- "name": "{\n label = 'Combobox submitted inside a form',\n id = 'combobox-1',\n displaySelectAll = false,\n options = [\n { label: 'Option 1', value: '0' },\n { label: 'Option 2', value: '1' },\n { label: 'Option 3', value: '2' }\n ],\n multiselect = false\n }"
102
- }
103
- ]
104
- },
105
- {
106
- "kind": "function",
107
- "name": "WithAriaLabel",
108
- "parameters": [
109
- {
110
- "name": "{\n label = 'This label is only visible for screen readers, use with caution',\n id = 'combobox-1',\n displaySelectAll = false,\n options = [\n { label: 'Option 1', value: '0' },\n { label: 'Option 2', value: '1' },\n { label: 'Option 3', value: '2' }\n ],\n multiselect = false\n }"
111
- }
112
- ]
113
- },
114
- {
115
- "kind": "function",
116
- "name": "WithRequired",
117
- "parameters": [
118
- {
119
- "name": "{\n label = 'Combobox with required attribute',\n id = 'combobox-1',\n displaySelectAll = false,\n options = [\n { label: 'Option 1', value: '0' },\n { label: 'Option 2', value: '1' },\n { label: 'Option 3', value: '2' }\n ],\n multiselect = false\n }"
120
- }
121
- ]
122
- },
123
- {
124
- "kind": "function",
125
- "name": "MultiSelectWithRequired",
126
- "parameters": [
127
- {
128
- "name": "{\n label = 'MultiSelect Combobox with required attribute',\n id = 'combobox-1',\n displaySelectAll = true,\n options = [\n { label: 'Option 1', value: '0' },\n { label: 'Option 2', value: '1' },\n { label: 'Option 3', value: '2' }\n ],\n multiselect = true\n }"
129
- }
130
- ]
131
- },
132
- {
133
- "kind": "variable",
134
- "name": "WithCustomPlaceholder"
135
- },
136
- {
137
- "kind": "variable",
138
- "name": "WithHiddenOptions",
139
- "type": {
140
- "text": "Story<ArgTypes>"
141
- }
142
- },
143
- {
144
- "kind": "variable",
145
- "name": "WithSelectAllPlaceholder"
146
- },
147
- {
148
- "kind": "function",
149
- "name": "OpenUpward",
150
- "parameters": [
151
- {
152
- "name": "{\n label = 'Combobox that opens upward',\n id = 'combobox-upward',\n displaySelectAll = false,\n options = [\n { label: 'Option 1', value: '0' },\n { label: 'Option 2', value: '1' },\n { label: 'Option 3', value: '2' },\n { label: 'Option 4', value: '3' },\n { label: 'Option 5', value: '4' }\n ],\n multiselect = false\n}"
153
- }
154
- ]
155
- }
156
- ],
157
- "exports": [
158
- {
159
- "kind": "js",
160
- "name": "default",
161
- "declaration": {
162
- "name": "meta",
163
- "module": "stories/combobox.stories.ts"
164
- }
165
- },
166
- {
167
- "kind": "js",
168
- "name": "SingleSelect",
169
- "declaration": {
170
- "name": "SingleSelect",
171
- "module": "stories/combobox.stories.ts"
172
- }
173
- },
174
- {
175
- "kind": "js",
176
- "name": "SingleSelectWithDefault",
177
- "declaration": {
178
- "name": "SingleSelectWithDefault",
179
- "module": "stories/combobox.stories.ts"
180
- }
181
- },
182
- {
183
- "kind": "js",
184
- "name": "MultiSelect",
185
- "declaration": {
186
- "name": "MultiSelect",
187
- "module": "stories/combobox.stories.ts"
188
- }
189
- },
190
- {
191
- "kind": "js",
192
- "name": "MultiSelectSelectAll",
193
- "declaration": {
194
- "name": "MultiSelectSelectAll",
195
- "module": "stories/combobox.stories.ts"
196
- }
197
- },
198
- {
199
- "kind": "js",
200
- "name": "WithStyles",
201
- "declaration": {
202
- "name": "WithStyles",
203
- "module": "stories/combobox.stories.ts"
204
- }
205
- },
206
- {
207
- "kind": "js",
208
- "name": "WithCustomOptionStyle",
209
- "declaration": {
210
- "name": "WithCustomOptionStyle",
211
- "module": "stories/combobox.stories.ts"
212
- }
213
- },
214
- {
215
- "kind": "js",
216
- "name": "WithIcon",
217
- "declaration": {
218
- "name": "WithIcon",
219
- "module": "stories/combobox.stories.ts"
220
- }
221
- },
222
- {
223
- "kind": "js",
224
- "name": "HiddenCaret",
225
- "declaration": {
226
- "name": "HiddenCaret",
227
- "module": "stories/combobox.stories.ts"
228
- }
229
- },
230
- {
231
- "kind": "js",
232
- "name": "WithError",
233
- "declaration": {
234
- "name": "WithError",
235
- "module": "stories/combobox.stories.ts"
236
- }
237
- },
238
- {
239
- "kind": "js",
240
- "name": "WithOptionDisabled",
241
- "declaration": {
242
- "name": "WithOptionDisabled",
243
- "module": "stories/combobox.stories.ts"
244
- }
245
- },
246
- {
247
- "kind": "js",
248
- "name": "DisabledComboBox",
249
- "declaration": {
250
- "name": "DisabledComboBox",
251
- "module": "stories/combobox.stories.ts"
252
- }
253
- },
254
- {
255
- "kind": "js",
256
- "name": "InsideForm",
257
- "declaration": {
258
- "name": "InsideForm",
259
- "module": "stories/combobox.stories.ts"
260
- }
261
- },
262
- {
263
- "kind": "js",
264
- "name": "WithAriaLabel",
265
- "declaration": {
266
- "name": "WithAriaLabel",
267
- "module": "stories/combobox.stories.ts"
268
- }
269
- },
270
- {
271
- "kind": "js",
272
- "name": "WithRequired",
273
- "declaration": {
274
- "name": "WithRequired",
275
- "module": "stories/combobox.stories.ts"
276
- }
277
- },
278
- {
279
- "kind": "js",
280
- "name": "MultiSelectWithRequired",
281
- "declaration": {
282
- "name": "MultiSelectWithRequired",
283
- "module": "stories/combobox.stories.ts"
284
- }
285
- },
286
- {
287
- "kind": "js",
288
- "name": "WithCustomPlaceholder",
289
- "declaration": {
290
- "name": "WithCustomPlaceholder",
291
- "module": "stories/combobox.stories.ts"
292
- }
293
- },
294
- {
295
- "kind": "js",
296
- "name": "WithHiddenOptions",
297
- "declaration": {
298
- "name": "WithHiddenOptions",
299
- "module": "stories/combobox.stories.ts"
300
- }
301
- },
302
- {
303
- "kind": "js",
304
- "name": "WithSelectAllPlaceholder",
305
- "declaration": {
306
- "name": "WithSelectAllPlaceholder",
307
- "module": "stories/combobox.stories.ts"
308
- }
309
- },
310
- {
311
- "kind": "js",
312
- "name": "OpenUpward",
313
- "declaration": {
314
- "name": "OpenUpward",
315
- "module": "stories/combobox.stories.ts"
316
- }
317
- }
318
- ]
319
- },
320
5
  {
321
6
  "kind": "javascript-module",
322
7
  "path": "src/TtCombobox.ts",
@@ -852,110 +537,425 @@
852
537
  "fieldName": "hideCaret"
853
538
  },
854
539
  {
855
- "name": "placeholder",
856
- "type": {
857
- "text": "string | undefined"
858
- },
859
- "fieldName": "placeholder"
860
- },
540
+ "name": "placeholder",
541
+ "type": {
542
+ "text": "string | undefined"
543
+ },
544
+ "fieldName": "placeholder"
545
+ },
546
+ {
547
+ "name": "select-all-placeholder",
548
+ "type": {
549
+ "text": "string | undefined"
550
+ },
551
+ "fieldName": "selectAllPlaceholder"
552
+ },
553
+ {
554
+ "name": "open-upward",
555
+ "type": {
556
+ "text": "boolean"
557
+ },
558
+ "default": "false",
559
+ "fieldName": "openUpward"
560
+ },
561
+ {
562
+ "name": "value",
563
+ "type": {
564
+ "text": "string[]"
565
+ },
566
+ "default": "[]",
567
+ "fieldName": "value"
568
+ }
569
+ ],
570
+ "superclass": {
571
+ "name": "LitElement",
572
+ "package": "lit"
573
+ },
574
+ "tagName": "tt-combobox",
575
+ "customElement": true
576
+ }
577
+ ],
578
+ "exports": [
579
+ {
580
+ "kind": "js",
581
+ "name": "TtCombobox",
582
+ "declaration": {
583
+ "name": "TtCombobox",
584
+ "module": "src/TtCombobox.ts"
585
+ }
586
+ }
587
+ ]
588
+ },
589
+ {
590
+ "kind": "javascript-module",
591
+ "path": "src/index.ts",
592
+ "declarations": [],
593
+ "exports": [
594
+ {
595
+ "kind": "js",
596
+ "name": "TtCombobox",
597
+ "declaration": {
598
+ "name": "TtCombobox",
599
+ "module": "./tt-combobox.js"
600
+ }
601
+ }
602
+ ]
603
+ },
604
+ {
605
+ "kind": "javascript-module",
606
+ "path": "src/styles.ts",
607
+ "declarations": [
608
+ {
609
+ "kind": "variable",
610
+ "name": "styles",
611
+ "default": "css` :host { display: flex; flex-direction: var(--tt-combobox-flex-direction, row); align-items: var(--tt-combobox-align-items, center); justify-content: var(--tt-combobox-justify-content, initial); align-content: var(--tt-combobox-align-content, initial); gap: var(--tt-combobox-gap, 0.5rem); font-size: var(--tt-combobox-font-size, var(--font-size-200)); color: var(--tt-combobox-color, var(--color-text-400)); } :host([disabled]) .tt-combobox-container { border-color: var(--tt-combobox-disabled-border-color, var(--color-border-200)); color: var(--tt-combobox-disabled-color, var(--color-text-200)); background-color: var(--tt-combobox-disabled-background-color, var(--color-surface-200)); pointer-events: none; } .tt-combobox-container:focus-within { outline: 5px auto Highlight; outline: 5px auto -webkit-focus-ring-color; } .tt-combobox-container:hover { background-color: var(--tt-combobox-hover-background-color, var(--color-surface-300)); } :host([invalid]) .tt-combobox-container, :host(:state(interacted):invalid) .tt-combobox-container { outline: 1px solid var(--color-alert-400, red); } .errormessage { visibility: hidden; display: flex; align-items: center; gap: var(--space-scale-0-5); color: var(--color-alert-400, red); &[data-hidden] { display: none; } } .errormessage svg path { fill: var(--color-alert-400, red); height: 20px; } .tt-combobox-container:has([role=\"combobox\"][aria-invalid=\"true\"]) ~ .errormessage { visibility: visible; } :has([role=\"combobox\"][aria-invalid=\"true\"]) ::slotted([slot=\"error\"]) { color: var(--color-alert-400, darkred); font-size: var(--font-size-100); margin: 0; font-weight: var(--font-weight-regular); line-height: 1.2; } slot[name=\"option\"]::slotted(*) { display: none; } * { box-sizing: border-box; font-family: var(--font-family-sans); cursor: inherit; } .tt-combobox-container { position: relative; max-width: var(--tt-combobox-max-width, 300px); min-width: var(--tt-combobox-min-width, 250px); display: flex; flex-direction: row; align-items: center; border-radius: var(--border-radius); border-color: var(--tt-combobox-border-color, var(--color-border-400)); border-style: solid; border-width: var(--tt-combobox-border-width, 1px); background-color: var(--tt-combobox-background-color, var(--color-surface-100)); padding: 0.5rem; gap: 0.25rem; //width: 100%; } [role=\"listbox\"] { display: none; } [role=\"combobox\"] { width: 100%; border-style: none; background-color: transparent; font-size: var(--tt-combobox-font-size, var(--font-size-200)); } .hide-caret { caret-color: transparent; } [role=\"combobox\"]::placeholder { color: var(--tt-combobox-placeholder-color, var(--color-text-300)); font-family: var(--font-family-inter); font-size: var(--tt-combobox-font-size, var(--font-size-200)); } :host([disabled]) [role=\"combobox\"]::placeholder { color: var(--tt-combobox-disabled-placeholder-color, var(--color-text-200)); } [role=\"combobox\"]:placeholder-shown { text-overflow: ellipsis; overflow: clip; } [role=\"combobox\"]:focus { outline: none; } [role=\"combobox\"] ~ button { appearance: none; padding: 0; border-width: 0; background-color: transparent; aspect-ratio: 1; } [role=\"combobox\"] ~ button svg { transition: transform 0.2s ease-in-out; color: var(--tt-combobox-dropdown-color, var(--color-text-400)); } [role=\"combobox\"][aria-expanded=\"true\"] ~ button svg { transform: rotate(180deg); } [role=\"combobox\"][aria-expanded=\"true\"] ~ [role=\"listbox\"] { display: block; width: max-content; max-width: var(--tt-combobox-list-max-width, 35ch); min-width: 100%; background-color: var(--tt-combobox-list-background-color, var(--color-surface-100, white)); border: 1px solid var(--tt-combobox-border-color, var(--color-border-300)); border-radius: var(--border-radius); box-shadow: var(--box-shadow-lg); padding: 0; position: absolute; top: var(--tt-combobox-top, calc(100% + 0.5rem)); left: var(--tt-combobox-left, 0); right: var(--tt-combobox-right, unset); bottom: var(--tt-combobox-bottom, unset); z-index: 2; margin: 0; list-style: none; max-height: var(--tt-combobox-max-height, 400px); overflow-y: auto; li { display: flex; padding: 0.5rem; box-sizing: border-box; text-align: left; text-overflow: ellipsis; text-wrap: nowrap; align-items: center; gap: 0.25rem; max-width: 100%; width: 100%; overflow-y: visible; flex: 1; input[type=\"checkbox\"] { width: var(--checkbox-size, var(--space-scale-2)); aspect-ratio: 1; flex: 0 0 auto; } span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; line-height: 1.1; } &.no-results { display: none; } &[aria-hidden=\"true\"] { visibility: hidden; display: none; } } &:not(:has([role=\"option\"]:not([data-value=\"select-all\"]))) { .no-results { display: flex; } .select-all { display: none; } } } [role=\"combobox\"][aria-expanded=\"true\"] ~ [role=\"listbox\"][data-open-upward] { top: unset; bottom: calc(100% + 0.5rem); } slot[name=\"icon\"] { display: inline-block; max-width: var(--tt-combobox-icon-size, 1rem); aspect-ratio: 1; } [role=\"option\"].select-all { border-bottom: 1px solid var(--color-border-300); } [aria-multiselectable=\"false\"] [role=\"option\"][aria-selected=\"true\"] { color: var(--tt-combobox-option-selected-color, var(--color-primary-400)); font-weight: var(--font-weight-medium); } [role=\"option\"]:is(:hover, [data-active=\"true\"]) { background-color: var(--tt-combobox-option-background-color-hover, inherit); color: var(--tt-combobox-option-color-hover, inherit); &:first-child { border-top-left-radius: var(--border-radius); border-top-right-radius: var(--border-radius); } &:last-child { border-bottom-left-radius: var(--border-radius); border-bottom-right-radius: var(--border-radius); } } [role=\"option\"]:hover { cursor: pointer; } [role=\"option\"][aria-disabled=\"true\"] { pointer-events: none; opacity: 0.5; } [role=\"listbox\"][aria-multiselectable=\"true\"] [role=\"option\"] input[type=\"checkbox\"] { accent-color: var(--color-primary-400); width: var(--checkbox-size, var(--space-scale-2)); aspect-ratio: 1; pointer-events: none; } [role=\"listbox\"][aria-multiselectable=\"true\"] [role=\"option\"][aria-disabled=\"true\"] input[type=\"checkbox\"] { pointer-events: none; } label { font-size: var(--tt-combobox-label-font-size, inherit); color: var(--tt-combobox-label-color, inherit); font-weight: var(--tt-combobox-label-font-weight, inherit); &[data-hidden] { display: none; } } `"
612
+ }
613
+ ],
614
+ "exports": [
615
+ {
616
+ "kind": "js",
617
+ "name": "styles",
618
+ "declaration": {
619
+ "name": "styles",
620
+ "module": "src/styles.ts"
621
+ }
622
+ }
623
+ ]
624
+ },
625
+ {
626
+ "kind": "javascript-module",
627
+ "path": "src/tt-combobox.ts",
628
+ "declarations": [],
629
+ "exports": [
630
+ {
631
+ "kind": "custom-element-definition",
632
+ "name": "tt-combobox",
633
+ "declaration": {
634
+ "name": "TtCombobox",
635
+ "module": "/src/TtCombobox.js"
636
+ }
637
+ },
638
+ {
639
+ "kind": "js",
640
+ "name": "TtCombobox",
641
+ "declaration": {
642
+ "name": "TtCombobox",
643
+ "module": "src/tt-combobox.ts"
644
+ }
645
+ }
646
+ ]
647
+ },
648
+ {
649
+ "kind": "javascript-module",
650
+ "path": "stories/combobox.stories.ts",
651
+ "declarations": [
652
+ {
653
+ "kind": "variable",
654
+ "name": "meta",
655
+ "type": {
656
+ "text": "object"
657
+ },
658
+ "default": "{ title: 'ComboBox', component: 'tt-combobox', argTypes: { label: { control: 'text' }, id: { control: 'text' }, 'display-select-all': { control: 'boolean' }, 'select-all-placeholder': { control: 'text' }, options: { control: 'object' } }, tags: ['autodocs'] }"
659
+ },
660
+ {
661
+ "kind": "variable",
662
+ "name": "SingleSelect"
663
+ },
664
+ {
665
+ "kind": "function",
666
+ "name": "SingleSelectWithDefault",
667
+ "parameters": [
668
+ {
669
+ "name": "{\n label = 'With default options',\n id = 'combobox-13',\n options = [\n { label: 'Option 1', value: '0' },\n { label: 'Option 2', value: '1', disabled: true },\n { label: 'Option 3', value: '2' }\n ],\n value = '0'\n }"
670
+ }
671
+ ]
672
+ },
673
+ {
674
+ "kind": "variable",
675
+ "name": "MultiSelect"
676
+ },
677
+ {
678
+ "kind": "variable",
679
+ "name": "MultiSelectSelectAll"
680
+ },
681
+ {
682
+ "kind": "variable",
683
+ "name": "WithStyles"
684
+ },
685
+ {
686
+ "kind": "function",
687
+ "name": "WithCustomOptionStyle",
688
+ "parameters": [
689
+ {
690
+ "name": "{\n label = 'Test label',\n id = 'combobox-1',\n displaySelectAll = false,\n options = [\n { label: 'Option 1', value: '0' },\n { label: 'Option 2', value: '1' },\n { label: 'Option 3', value: '2' }\n ],\n multiselect = false\n }"
691
+ }
692
+ ]
693
+ },
694
+ {
695
+ "kind": "function",
696
+ "name": "WithIcon",
697
+ "parameters": [
698
+ {
699
+ "name": "{\n label = 'With icon',\n id = 'combobox-1',\n displaySelectAll = false,\n options = [\n { label: 'Option 1', value: '0' },\n { label: 'Option 2', value: '1' },\n { label: 'Option 3', value: '2' }\n ],\n multiselect = false\n }"
700
+ }
701
+ ]
702
+ },
703
+ {
704
+ "kind": "function",
705
+ "name": "HiddenCaret",
706
+ "parameters": [
707
+ {
708
+ "name": "{\n label = 'With hidden caret',\n id = 'combobox-1',\n displaySelectAll = false,\n options = [\n { label: 'Option 1', value: '0' },\n { label: 'Option 2', value: '1' },\n { label: 'Option 3', value: '2' }\n ],\n multiselect = false\n }"
709
+ }
710
+ ]
711
+ },
712
+ {
713
+ "kind": "function",
714
+ "name": "WithError",
715
+ "parameters": [
716
+ {
717
+ "name": "{\n label = 'With error',\n id = 'combobox-1',\n displaySelectAll = false,\n options = [\n { label: 'Option 1', value: '0' },\n { label: 'Option 2', value: '1' },\n { label: 'Option 3', value: '2' }\n ],\n multiselect = false\n }"
718
+ }
719
+ ]
720
+ },
721
+ {
722
+ "kind": "function",
723
+ "name": "WithOptionDisabled",
724
+ "parameters": [
725
+ {
726
+ "name": "{\n label = 'With option disabled',\n id = 'combobox-1',\n displaySelectAll = true,\n options = [\n { label: 'Option 1', value: '0' },\n { label: 'Option 2', value: '1', disabled: true },\n { label: 'Option 3', value: '2' }\n ],\n multiselect = true\n }"
727
+ }
728
+ ]
729
+ },
730
+ {
731
+ "kind": "function",
732
+ "name": "DisabledComboBox",
733
+ "parameters": [
734
+ {
735
+ "name": "{\n label = 'Disabled selector',\n id = 'combobox-1',\n displaySelectAll = false,\n options = [\n { label: 'Option 1', value: '0' },\n { label: 'Option 2', value: '1' },\n { label: 'Option 3', value: '2' }\n ],\n multiselect = false\n }"
736
+ }
737
+ ]
738
+ },
739
+ {
740
+ "kind": "function",
741
+ "name": "InsideForm",
742
+ "parameters": [
743
+ {
744
+ "name": "{\n label = 'Combobox submitted inside a form',\n id = 'combobox-1',\n displaySelectAll = false,\n options = [\n { label: 'Option 1', value: '0' },\n { label: 'Option 2', value: '1' },\n { label: 'Option 3', value: '2' }\n ],\n multiselect = false\n }"
745
+ }
746
+ ]
747
+ },
748
+ {
749
+ "kind": "function",
750
+ "name": "WithAriaLabel",
751
+ "parameters": [
752
+ {
753
+ "name": "{\n label = 'This label is only visible for screen readers, use with caution',\n id = 'combobox-1',\n displaySelectAll = false,\n options = [\n { label: 'Option 1', value: '0' },\n { label: 'Option 2', value: '1' },\n { label: 'Option 3', value: '2' }\n ],\n multiselect = false\n }"
754
+ }
755
+ ]
756
+ },
757
+ {
758
+ "kind": "function",
759
+ "name": "WithRequired",
760
+ "parameters": [
861
761
  {
862
- "name": "select-all-placeholder",
863
- "type": {
864
- "text": "string | undefined"
865
- },
866
- "fieldName": "selectAllPlaceholder"
867
- },
762
+ "name": "{\n label = 'Combobox with required attribute',\n id = 'combobox-1',\n displaySelectAll = false,\n options = [\n { label: 'Option 1', value: '0' },\n { label: 'Option 2', value: '1' },\n { label: 'Option 3', value: '2' }\n ],\n multiselect = false\n }"
763
+ }
764
+ ]
765
+ },
766
+ {
767
+ "kind": "function",
768
+ "name": "MultiSelectWithRequired",
769
+ "parameters": [
868
770
  {
869
- "name": "open-upward",
870
- "type": {
871
- "text": "boolean"
872
- },
873
- "default": "false",
874
- "fieldName": "openUpward"
875
- },
771
+ "name": "{\n label = 'MultiSelect Combobox with required attribute',\n id = 'combobox-1',\n displaySelectAll = true,\n options = [\n { label: 'Option 1', value: '0' },\n { label: 'Option 2', value: '1' },\n { label: 'Option 3', value: '2' }\n ],\n multiselect = true\n }"
772
+ }
773
+ ]
774
+ },
775
+ {
776
+ "kind": "variable",
777
+ "name": "WithCustomPlaceholder"
778
+ },
779
+ {
780
+ "kind": "variable",
781
+ "name": "WithHiddenOptions",
782
+ "type": {
783
+ "text": "Story<ArgTypes>"
784
+ }
785
+ },
786
+ {
787
+ "kind": "variable",
788
+ "name": "WithSelectAllPlaceholder"
789
+ },
790
+ {
791
+ "kind": "function",
792
+ "name": "OpenUpward",
793
+ "parameters": [
876
794
  {
877
- "name": "value",
878
- "type": {
879
- "text": "string[]"
880
- },
881
- "default": "[]",
882
- "fieldName": "value"
795
+ "name": "{\n label = 'Combobox that opens upward',\n id = 'combobox-upward',\n displaySelectAll = false,\n options = [\n { label: 'Option 1', value: '0' },\n { label: 'Option 2', value: '1' },\n { label: 'Option 3', value: '2' },\n { label: 'Option 4', value: '3' },\n { label: 'Option 5', value: '4' }\n ],\n multiselect = false\n}"
883
796
  }
884
- ],
885
- "superclass": {
886
- "name": "LitElement",
887
- "package": "lit"
888
- },
889
- "tagName": "tt-combobox",
890
- "customElement": true
797
+ ]
891
798
  }
892
799
  ],
893
800
  "exports": [
894
801
  {
895
802
  "kind": "js",
896
- "name": "TtCombobox",
803
+ "name": "default",
897
804
  "declaration": {
898
- "name": "TtCombobox",
899
- "module": "src/TtCombobox.ts"
805
+ "name": "meta",
806
+ "module": "stories/combobox.stories.ts"
900
807
  }
901
- }
902
- ]
903
- },
904
- {
905
- "kind": "javascript-module",
906
- "path": "src/index.ts",
907
- "declarations": [],
908
- "exports": [
808
+ },
909
809
  {
910
810
  "kind": "js",
911
- "name": "TtCombobox",
811
+ "name": "SingleSelect",
912
812
  "declaration": {
913
- "name": "TtCombobox",
914
- "module": "./tt-combobox.js"
813
+ "name": "SingleSelect",
814
+ "module": "stories/combobox.stories.ts"
915
815
  }
916
- }
917
- ]
918
- },
919
- {
920
- "kind": "javascript-module",
921
- "path": "src/styles.ts",
922
- "declarations": [
816
+ },
923
817
  {
924
- "kind": "variable",
925
- "name": "styles",
926
- "default": "css` :host { display: flex; flex-direction: var(--tt-combobox-flex-direction, row); align-items: var(--tt-combobox-align-items, center); justify-content: var(--tt-combobox-justify-content, initial); align-content: var(--tt-combobox-align-content, initial); gap: var(--tt-combobox-gap, 0.5rem); font-size: var(--tt-combobox-font-size, var(--font-size-200)); color: var(--tt-combobox-color, var(--color-text-400)); } :host([disabled]) .tt-combobox-container { border-color: var(--tt-combobox-disabled-border-color, var(--color-border-200)); color: var(--tt-combobox-disabled-color, var(--color-text-200)); background-color: var(--tt-combobox-disabled-background-color, var(--color-surface-200)); pointer-events: none; } .tt-combobox-container:focus-within { outline: 5px auto Highlight; outline: 5px auto -webkit-focus-ring-color; } .tt-combobox-container:hover { background-color: var(--tt-combobox-hover-background-color, var(--color-surface-300)); } :host([invalid]) .tt-combobox-container, :host(:state(interacted):invalid) .tt-combobox-container { outline: 1px solid var(--color-alert-400, red); } .errormessage { visibility: hidden; display: flex; align-items: center; gap: var(--space-scale-0-5); color: var(--color-alert-400, red); &[data-hidden] { display: none; } } .errormessage svg path { fill: var(--color-alert-400, red); height: 20px; } .tt-combobox-container:has([role=\"combobox\"][aria-invalid=\"true\"]) ~ .errormessage { visibility: visible; } :has([role=\"combobox\"][aria-invalid=\"true\"]) ::slotted([slot=\"error\"]) { color: var(--color-alert-400, darkred); font-size: var(--font-size-100); margin: 0; font-weight: var(--font-weight-regular); line-height: 1.2; } slot[name=\"option\"]::slotted(*) { display: none; } * { box-sizing: border-box; font-family: var(--font-family-sans); cursor: inherit; } .tt-combobox-container { position: relative; max-width: var(--tt-combobox-max-width, 300px); min-width: var(--tt-combobox-min-width, 250px); display: flex; flex-direction: row; align-items: center; border-radius: var(--border-radius); border-color: var(--tt-combobox-border-color, var(--color-border-400)); border-style: solid; border-width: var(--tt-combobox-border-width, 1px); background-color: var(--tt-combobox-background-color, var(--color-surface-100)); padding: 0.5rem; gap: 0.25rem; //width: 100%; } [role=\"listbox\"] { display: none; } [role=\"combobox\"] { width: 100%; border-style: none; background-color: transparent; font-size: var(--tt-combobox-font-size, var(--font-size-200)); } .hide-caret { caret-color: transparent; } [role=\"combobox\"]::placeholder { color: var(--tt-combobox-placeholder-color, var(--color-text-300)); font-family: var(--font-family-inter); font-size: var(--tt-combobox-font-size, var(--font-size-200)); } :host([disabled]) [role=\"combobox\"]::placeholder { color: var(--tt-combobox-disabled-placeholder-color, var(--color-text-200)); } [role=\"combobox\"]:placeholder-shown { text-overflow: ellipsis; overflow: clip; } [role=\"combobox\"]:focus { outline: none; } [role=\"combobox\"] ~ button { appearance: none; padding: 0; border-width: 0; background-color: transparent; aspect-ratio: 1; } [role=\"combobox\"] ~ button svg { transition: transform 0.2s ease-in-out; color: var(--tt-combobox-dropdown-color, var(--color-text-400)); } [role=\"combobox\"][aria-expanded=\"true\"] ~ button svg { transform: rotate(180deg); } [role=\"combobox\"][aria-expanded=\"true\"] ~ [role=\"listbox\"] { display: block; width: max-content; max-width: var(--tt-combobox-list-max-width, 35ch); min-width: 100%; background-color: var(--tt-combobox-list-background-color, var(--color-surface-100, white)); border: 1px solid var(--tt-combobox-border-color, var(--color-border-300)); border-radius: var(--border-radius); box-shadow: var(--box-shadow-lg); padding: 0; position: absolute; top: var(--tt-combobox-top, calc(100% + 0.5rem)); left: var(--tt-combobox-left, 0); right: var(--tt-combobox-right, unset); bottom: var(--tt-combobox-bottom, unset); z-index: 2; margin: 0; list-style: none; max-height: var(--tt-combobox-max-height, 400px); overflow-y: auto; li { display: flex; padding: 0.5rem; box-sizing: border-box; text-align: left; text-overflow: ellipsis; text-wrap: nowrap; align-items: center; gap: 0.25rem; max-width: 100%; width: 100%; overflow-y: visible; flex: 1; input[type=\"checkbox\"] { width: var(--checkbox-size, var(--space-scale-2)); aspect-ratio: 1; flex: 0 0 auto; } span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; line-height: 1.1; } &.no-results { display: none; } &[aria-hidden=\"true\"] { visibility: hidden; display: none; } } &:not(:has([role=\"option\"]:not([data-value=\"select-all\"]))) { .no-results { display: flex; } .select-all { display: none; } } } [role=\"combobox\"][aria-expanded=\"true\"] ~ [role=\"listbox\"][data-open-upward] { top: unset; bottom: calc(100% + 0.5rem); } slot[name=\"icon\"] { display: inline-block; max-width: var(--tt-combobox-icon-size, 1rem); aspect-ratio: 1; } [role=\"option\"].select-all { border-bottom: 1px solid var(--color-border-300); } [aria-multiselectable=\"false\"] [role=\"option\"][aria-selected=\"true\"] { color: var(--tt-combobox-option-selected-color, var(--color-primary-400)); font-weight: var(--font-weight-medium); } [role=\"option\"]:is(:hover, [data-active=\"true\"]) { background-color: var(--tt-combobox-option-background-color-hover, inherit); color: var(--tt-combobox-option-color-hover, inherit); &:first-child { border-top-left-radius: var(--border-radius); border-top-right-radius: var(--border-radius); } &:last-child { border-bottom-left-radius: var(--border-radius); border-bottom-right-radius: var(--border-radius); } } [role=\"option\"]:hover { cursor: pointer; } [role=\"option\"][aria-disabled=\"true\"] { pointer-events: none; opacity: 0.5; } [role=\"listbox\"][aria-multiselectable=\"true\"] [role=\"option\"] input[type=\"checkbox\"] { accent-color: var(--color-primary-400); width: var(--checkbox-size, var(--space-scale-2)); aspect-ratio: 1; pointer-events: none; } [role=\"listbox\"][aria-multiselectable=\"true\"] [role=\"option\"][aria-disabled=\"true\"] input[type=\"checkbox\"] { pointer-events: none; } label { font-size: var(--tt-combobox-label-font-size, inherit); color: var(--tt-combobox-label-color, inherit); font-weight: var(--tt-combobox-label-font-weight, inherit); &[data-hidden] { display: none; } } `"
927
- }
928
- ],
929
- "exports": [
818
+ "kind": "js",
819
+ "name": "SingleSelectWithDefault",
820
+ "declaration": {
821
+ "name": "SingleSelectWithDefault",
822
+ "module": "stories/combobox.stories.ts"
823
+ }
824
+ },
930
825
  {
931
826
  "kind": "js",
932
- "name": "styles",
827
+ "name": "MultiSelect",
933
828
  "declaration": {
934
- "name": "styles",
935
- "module": "src/styles.ts"
829
+ "name": "MultiSelect",
830
+ "module": "stories/combobox.stories.ts"
936
831
  }
937
- }
938
- ]
939
- },
940
- {
941
- "kind": "javascript-module",
942
- "path": "src/tt-combobox.ts",
943
- "declarations": [],
944
- "exports": [
832
+ },
945
833
  {
946
- "kind": "custom-element-definition",
947
- "name": "tt-combobox",
834
+ "kind": "js",
835
+ "name": "MultiSelectSelectAll",
948
836
  "declaration": {
949
- "name": "TtCombobox",
950
- "module": "/src/TtCombobox.js"
837
+ "name": "MultiSelectSelectAll",
838
+ "module": "stories/combobox.stories.ts"
951
839
  }
952
840
  },
953
841
  {
954
842
  "kind": "js",
955
- "name": "TtCombobox",
843
+ "name": "WithStyles",
956
844
  "declaration": {
957
- "name": "TtCombobox",
958
- "module": "src/tt-combobox.ts"
845
+ "name": "WithStyles",
846
+ "module": "stories/combobox.stories.ts"
847
+ }
848
+ },
849
+ {
850
+ "kind": "js",
851
+ "name": "WithCustomOptionStyle",
852
+ "declaration": {
853
+ "name": "WithCustomOptionStyle",
854
+ "module": "stories/combobox.stories.ts"
855
+ }
856
+ },
857
+ {
858
+ "kind": "js",
859
+ "name": "WithIcon",
860
+ "declaration": {
861
+ "name": "WithIcon",
862
+ "module": "stories/combobox.stories.ts"
863
+ }
864
+ },
865
+ {
866
+ "kind": "js",
867
+ "name": "HiddenCaret",
868
+ "declaration": {
869
+ "name": "HiddenCaret",
870
+ "module": "stories/combobox.stories.ts"
871
+ }
872
+ },
873
+ {
874
+ "kind": "js",
875
+ "name": "WithError",
876
+ "declaration": {
877
+ "name": "WithError",
878
+ "module": "stories/combobox.stories.ts"
879
+ }
880
+ },
881
+ {
882
+ "kind": "js",
883
+ "name": "WithOptionDisabled",
884
+ "declaration": {
885
+ "name": "WithOptionDisabled",
886
+ "module": "stories/combobox.stories.ts"
887
+ }
888
+ },
889
+ {
890
+ "kind": "js",
891
+ "name": "DisabledComboBox",
892
+ "declaration": {
893
+ "name": "DisabledComboBox",
894
+ "module": "stories/combobox.stories.ts"
895
+ }
896
+ },
897
+ {
898
+ "kind": "js",
899
+ "name": "InsideForm",
900
+ "declaration": {
901
+ "name": "InsideForm",
902
+ "module": "stories/combobox.stories.ts"
903
+ }
904
+ },
905
+ {
906
+ "kind": "js",
907
+ "name": "WithAriaLabel",
908
+ "declaration": {
909
+ "name": "WithAriaLabel",
910
+ "module": "stories/combobox.stories.ts"
911
+ }
912
+ },
913
+ {
914
+ "kind": "js",
915
+ "name": "WithRequired",
916
+ "declaration": {
917
+ "name": "WithRequired",
918
+ "module": "stories/combobox.stories.ts"
919
+ }
920
+ },
921
+ {
922
+ "kind": "js",
923
+ "name": "MultiSelectWithRequired",
924
+ "declaration": {
925
+ "name": "MultiSelectWithRequired",
926
+ "module": "stories/combobox.stories.ts"
927
+ }
928
+ },
929
+ {
930
+ "kind": "js",
931
+ "name": "WithCustomPlaceholder",
932
+ "declaration": {
933
+ "name": "WithCustomPlaceholder",
934
+ "module": "stories/combobox.stories.ts"
935
+ }
936
+ },
937
+ {
938
+ "kind": "js",
939
+ "name": "WithHiddenOptions",
940
+ "declaration": {
941
+ "name": "WithHiddenOptions",
942
+ "module": "stories/combobox.stories.ts"
943
+ }
944
+ },
945
+ {
946
+ "kind": "js",
947
+ "name": "WithSelectAllPlaceholder",
948
+ "declaration": {
949
+ "name": "WithSelectAllPlaceholder",
950
+ "module": "stories/combobox.stories.ts"
951
+ }
952
+ },
953
+ {
954
+ "kind": "js",
955
+ "name": "OpenUpward",
956
+ "declaration": {
957
+ "name": "OpenUpward",
958
+ "module": "stories/combobox.stories.ts"
959
959
  }
960
960
  }
961
961
  ]
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "description": "Webcomponent tt-combobox following open-wc recommendations",
4
4
  "license": "MIT",
5
5
  "author": "@triptease",
6
- "version": "5.4.0",
6
+ "version": "5.4.1",
7
7
  "type": "module",
8
8
  "main": "dist/src/index.js",
9
9
  "module": "dist/src/index.js",
@@ -27,7 +27,7 @@
27
27
  "test:watch": "tsc && concurrently -k -r \"tsc --watch --preserveWatchOutput\" \"wtr --watch\""
28
28
  },
29
29
  "dependencies": {
30
- "@triptease/icons": "^1.0.2",
30
+ "@triptease/icons": "^1.2.1",
31
31
  "lit": "^3.1.4"
32
32
  },
33
33
  "devDependencies": {