vanilla-smart-select 1.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.
@@ -0,0 +1,316 @@
1
+ /**
2
+ * Vanilla-Smart-Select Styles
3
+ * Complete styles with core structure and default theme
4
+ */
5
+
6
+ /* ===== CORE STYLES ===== */
7
+ /* Container */
8
+ .vs-container {
9
+ position: relative;
10
+ box-sizing: border-box;
11
+ display: inline-block;
12
+ }
13
+
14
+ .vs-container *,
15
+ .vs-container *::before,
16
+ .vs-container *::after {
17
+ box-sizing: border-box;
18
+ }
19
+
20
+ /* Selection container */
21
+ .vs-selection {
22
+ display: block;
23
+ cursor: pointer;
24
+ user-select: none;
25
+ position: relative;
26
+ }
27
+
28
+ .vs-container--disabled .vs-selection {
29
+ cursor: not-allowed;
30
+ opacity: 0.6;
31
+ }
32
+
33
+ /* Dropdown */
34
+ .vs-dropdown {
35
+ position: fixed;
36
+ z-index: 9999;
37
+ overflow: hidden;
38
+ display: none;
39
+ }
40
+
41
+ .vs-dropdown--open {
42
+ display: block;
43
+ }
44
+
45
+ /* Results container */
46
+ .vs-results {
47
+ overflow-y: auto;
48
+ max-height: 300px;
49
+ }
50
+
51
+ /* Result items */
52
+ .vs-result {
53
+ cursor: pointer;
54
+ user-select: none;
55
+ }
56
+
57
+ .vs-result--disabled {
58
+ cursor: not-allowed;
59
+ opacity: 0.5;
60
+ }
61
+
62
+ /* Search box */
63
+ .vs-search {
64
+ width: 100%;
65
+ box-sizing: border-box;
66
+ }
67
+
68
+ /* Screen reader only (accessibility) */
69
+ .vs-sr-only {
70
+ width: 1px;
71
+ height: 1px;
72
+ padding: 0;
73
+ margin: -1px;
74
+ overflow: hidden;
75
+ clip: rect(0, 0, 0, 0);
76
+ white-space: nowrap;
77
+ border-width: 0;
78
+ }
79
+
80
+ /* Loading state */
81
+ .vs-results--loading {
82
+ text-align: center;
83
+ padding: 10px;
84
+ }
85
+
86
+ /* No results */
87
+ .vs-results--no-results {
88
+ text-align: center;
89
+ padding: 10px;
90
+ }
91
+
92
+ /* Focus states */
93
+ .vs-selection:focus {
94
+ outline: none;
95
+ }
96
+
97
+ /* Multiple select */
98
+ .vs-selection--multiple {
99
+ min-height: 36px;
100
+ }
101
+
102
+ .vs-selection__choices {
103
+ display: flex;
104
+ flex-wrap: wrap;
105
+ gap: 4px;
106
+ list-style: none;
107
+ margin: 0;
108
+ padding: 0;
109
+ }
110
+
111
+ .vs-selection__choice {
112
+ display: inline-flex;
113
+ align-items: center;
114
+ gap: 4px;
115
+ }
116
+
117
+ .vs-selection__choice__remove {
118
+ cursor: pointer;
119
+ display: inline-flex;
120
+ align-items: center;
121
+ justify-content: center;
122
+ }
123
+
124
+ /* ===== DEFAULT THEME ===== */
125
+ /* Container */
126
+ .vs-container--default {
127
+ font-size: 14px;
128
+ font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
129
+ line-height: 1.5;
130
+ }
131
+
132
+ /* Selection */
133
+ .vs-container--default .vs-selection {
134
+ border: 1px solid #ddd;
135
+ border-radius: 4px;
136
+ padding: 8px 12px;
137
+ background: #fff;
138
+ min-height: 38px;
139
+ transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
140
+ display: flex;
141
+ align-items: center;
142
+ gap: 4px;
143
+ }
144
+
145
+ .vs-container--default .vs-selection:hover {
146
+ border-color: #aaa;
147
+ }
148
+
149
+ .vs-container--default .vs-selection:focus,
150
+ .vs-container--default .vs-selection:focus-within {
151
+ border-color: #007bff;
152
+ box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
153
+ outline: none;
154
+ }
155
+
156
+ /* Disabled state */
157
+ .vs-container--default.vs-container--disabled .vs-selection {
158
+ background-color: #f5f5f5;
159
+ border-color: #ddd;
160
+ }
161
+
162
+ /* Dropdown */
163
+ .vs-dropdown.vs-container--default {
164
+ position: fixed;
165
+ border: 1px solid #ddd;
166
+ border-radius: 4px;
167
+ background: #fff;
168
+ box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
169
+ margin-top: 4px;
170
+ }
171
+
172
+ /* Search */
173
+ .vs-dropdown.vs-container--default .vs-search {
174
+ border: none;
175
+ border-bottom: 1px solid #eee;
176
+ padding: 8px 12px;
177
+ font-size: 14px;
178
+ }
179
+
180
+ .vs-dropdown.vs-container--default .vs-search:focus {
181
+ outline: none;
182
+ border-bottom-color: #007bff;
183
+ }
184
+
185
+ /* Results */
186
+ .vs-dropdown.vs-container--default .vs-result {
187
+ padding: 8px 12px;
188
+ transition: background-color 0.15s ease;
189
+ }
190
+
191
+ .vs-dropdown.vs-container--default .vs-result:hover {
192
+ background: #f5f5f5;
193
+ color: #333;
194
+ }
195
+
196
+ .vs-dropdown.vs-container--default .vs-result[aria-selected="true"] {
197
+ background: #e9ecef;
198
+ }
199
+
200
+ .vs-dropdown.vs-container--default .vs-result--highlighted {
201
+ background: #007bff;
202
+ color: #fff;
203
+ }
204
+
205
+ .vs-dropdown.vs-container--default .vs-result--disabled {
206
+ color: #999;
207
+ background: transparent;
208
+ }
209
+
210
+ /* Multi-select choices/tags */
211
+ .vs-container--default .vs-selection__choice {
212
+ background: #e9ecef;
213
+ border-radius: 3px;
214
+ padding: 4px 8px;
215
+ font-size: 13px;
216
+ color: #333;
217
+ }
218
+
219
+ .vs-container--default .vs-selection__choice__remove {
220
+ color: #666;
221
+ font-weight: bold;
222
+ font-size: 16px;
223
+ line-height: 1;
224
+ padding: 0 4px;
225
+ }
226
+
227
+ .vs-container--default .vs-selection__choice__remove:hover {
228
+ color: #c00;
229
+ }
230
+
231
+ /* Placeholder */
232
+ .vs-container--default .vs-selection__placeholder {
233
+ color: #999;
234
+ font-style: italic;
235
+ user-select: none;
236
+ }
237
+
238
+ /* Clear button */
239
+ .vs-container--default .vs-selection__clear {
240
+ display: inline-flex;
241
+ align-items: center;
242
+ justify-content: center;
243
+ margin-left: 8px;
244
+ padding: 0 4px;
245
+ cursor: pointer;
246
+ color: #999;
247
+ font-size: 20px;
248
+ line-height: 1;
249
+ font-weight: normal;
250
+ user-select: none;
251
+ transition: color 0.15s ease;
252
+ flex-shrink: 0;
253
+ }
254
+
255
+ .vs-container--default .vs-selection__clear:hover {
256
+ color: #c00;
257
+ }
258
+
259
+ .vs-container--default .vs-selection__clear:focus {
260
+ outline: 2px solid #007bff;
261
+ outline-offset: 2px;
262
+ }
263
+
264
+ /* Rendered text with proper overflow */
265
+ .vs-container--default .vs-selection__rendered {
266
+ flex: 1;
267
+ overflow: hidden;
268
+ text-overflow: ellipsis;
269
+ white-space: nowrap;
270
+ min-width: 0;
271
+ }
272
+
273
+ /* Group labels */
274
+ .vs-dropdown.vs-container--default .vs-result--group {
275
+ font-weight: bold;
276
+ padding: 8px 12px;
277
+ color: #666;
278
+ background: #f9f9f9;
279
+ }
280
+
281
+ .vs-dropdown.vs-container--default .vs-result--group-child {
282
+ padding-left: 24px;
283
+ }
284
+
285
+ /* Loading and messages */
286
+ .vs-dropdown.vs-container--default .vs-results--loading,
287
+ .vs-dropdown.vs-container--default .vs-results--no-results {
288
+ color: #999;
289
+ font-style: italic;
290
+ }
291
+
292
+ /* Selection limit message */
293
+ .vs-container--default .vs-results__limit-message {
294
+ padding: 8px 12px;
295
+ background: #fff3cd;
296
+ color: #856404;
297
+ border: 1px solid #ffc107;
298
+ border-radius: 4px;
299
+ margin: 8px;
300
+ font-size: 13px;
301
+ text-align: center;
302
+ animation: vs-fade-in 0.2s ease-in;
303
+ }
304
+
305
+ @keyframes vs-fade-in {
306
+ from {
307
+ opacity: 0;
308
+ transform: translateY(-4px);
309
+ }
310
+ to {
311
+ opacity: 1;
312
+ transform: translateY(0);
313
+ }
314
+ }
315
+
316
+ /*# sourceMappingURL=vanilla-smart-select.css.map */
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["vanilla-smart-select.css"],"names":[],"mappings":"AAAA;;;EAGE;;AAEF,4BAA4B;AAC5B,cAAc;AACd;EACE,kBAAkB;EAClB,sBAAsB;E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AEE,WAAW;EACX,kBAAkB;AACpB;;AAEA,4BAA4B;AAC5B;EACE,iBAAiB;EACjB,mBAAmB;EACnB,cAAc;EACd,yBAAyB;EACzB,kBAAkB;EAClB,WAAW;EACX,eAAe;EACf,kBAAkB;EAClB,kCAAkC;AACpC;;AAEA;EACE;IACE,UAAU;IACV,2BAA2B;EAC7B;EACA;IACE,UAAU;IACV,wBAAwB;EAC1B;AACF","file":"vanilla-smart-select.css","sourcesContent":["/**\n * Vanilla-Smart-Select Styles\n * Complete styles with core structure and default theme\n */\n\n/* ===== CORE STYLES ===== */\n/* Container */\n.vs-container {\n position: relative;\n box-sizing: border-box;\n display: inline-block;\n}\n\n.vs-container *,\n.vs-container *::before,\n.vs-container *::after {\n box-sizing: border-box;\n}\n\n/* Selection container */\n.vs-selection {\n display: block;\n cursor: pointer;\n user-select: none;\n position: relative;\n}\n\n.vs-container--disabled .vs-selection {\n cursor: not-allowed;\n opacity: 0.6;\n}\n\n/* Dropdown */\n.vs-dropdown {\n position: fixed;\n z-index: 9999;\n overflow: hidden;\n display: none;\n}\n\n.vs-dropdown--open {\n display: block;\n}\n\n/* Results container */\n.vs-results {\n overflow-y: auto;\n max-height: 300px;\n}\n\n/* Result items */\n.vs-result {\n cursor: pointer;\n user-select: none;\n}\n\n.vs-result--disabled {\n cursor: not-allowed;\n opacity: 0.5;\n}\n\n/* Search box */\n.vs-search {\n width: 100%;\n box-sizing: border-box;\n}\n\n/* Screen reader only (accessibility) */\n.vs-sr-only {\n width: 1px;\n height: 1px;\n padding: 0;\n margin: -1px;\n overflow: hidden;\n clip: rect(0, 0, 0, 0);\n white-space: nowrap;\n border-width: 0;\n}\n\n/* Loading state */\n.vs-results--loading {\n text-align: center;\n padding: 10px;\n}\n\n/* No results */\n.vs-results--no-results {\n text-align: center;\n padding: 10px;\n}\n\n/* Focus states */\n.vs-selection:focus {\n outline: none;\n}\n\n/* Multiple select */\n.vs-selection--multiple {\n min-height: 36px;\n}\n\n.vs-selection__choices {\n display: flex;\n flex-wrap: wrap;\n gap: 4px;\n list-style: none;\n margin: 0;\n padding: 0;\n}\n\n.vs-selection__choice {\n display: inline-flex;\n align-items: center;\n gap: 4px;\n}\n\n.vs-selection__choice__remove {\n cursor: pointer;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n}\n\n/* ===== DEFAULT THEME ===== */\n/* Container */\n.vs-container--default {\n font-size: 14px;\n font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, \"Helvetica Neue\", Arial, sans-serif;\n line-height: 1.5;\n}\n\n/* Selection */\n.vs-container--default .vs-selection {\n border: 1px solid #ddd;\n border-radius: 4px;\n padding: 8px 12px;\n background: #fff;\n min-height: 38px;\n transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;\n display: flex;\n align-items: center;\n gap: 4px;\n}\n\n.vs-container--default .vs-selection:hover {\n border-color: #aaa;\n}\n\n.vs-container--default .vs-selection:focus,\n.vs-container--default .vs-selection:focus-within {\n border-color: #007bff;\n box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);\n outline: none;\n}\n\n/* Disabled state */\n.vs-container--default.vs-container--disabled .vs-selection {\n background-color: #f5f5f5;\n border-color: #ddd;\n}\n\n/* Dropdown */\n.vs-dropdown.vs-container--default {\n position: fixed;\n border: 1px solid #ddd;\n border-radius: 4px;\n background: #fff;\n box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);\n margin-top: 4px;\n}\n\n/* Search */\n.vs-dropdown.vs-container--default .vs-search {\n border: none;\n border-bottom: 1px solid #eee;\n padding: 8px 12px;\n font-size: 14px;\n}\n\n.vs-dropdown.vs-container--default .vs-search:focus {\n outline: none;\n border-bottom-color: #007bff;\n}\n\n/* Results */\n.vs-dropdown.vs-container--default .vs-result {\n padding: 8px 12px;\n transition: background-color 0.15s ease;\n}\n\n.vs-dropdown.vs-container--default .vs-result:hover {\n background: #f5f5f5;\n color: #333;\n}\n\n.vs-dropdown.vs-container--default .vs-result[aria-selected=\"true\"] {\n background: #e9ecef;\n}\n\n.vs-dropdown.vs-container--default .vs-result--highlighted {\n background: #007bff;\n color: #fff;\n}\n\n.vs-dropdown.vs-container--default .vs-result--disabled {\n color: #999;\n background: transparent;\n}\n\n/* Multi-select choices/tags */\n.vs-container--default .vs-selection__choice {\n background: #e9ecef;\n border-radius: 3px;\n padding: 4px 8px;\n font-size: 13px;\n color: #333;\n}\n\n.vs-container--default .vs-selection__choice__remove {\n color: #666;\n font-weight: bold;\n font-size: 16px;\n line-height: 1;\n padding: 0 4px;\n}\n\n.vs-container--default .vs-selection__choice__remove:hover {\n color: #c00;\n}\n\n/* Placeholder */\n.vs-container--default .vs-selection__placeholder {\n color: #999;\n font-style: italic;\n user-select: none;\n}\n\n/* Clear button */\n.vs-container--default .vs-selection__clear {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n margin-left: 8px;\n padding: 0 4px;\n cursor: pointer;\n color: #999;\n font-size: 20px;\n line-height: 1;\n font-weight: normal;\n user-select: none;\n transition: color 0.15s ease;\n flex-shrink: 0;\n}\n\n.vs-container--default .vs-selection__clear:hover {\n color: #c00;\n}\n\n.vs-container--default .vs-selection__clear:focus {\n outline: 2px solid #007bff;\n outline-offset: 2px;\n}\n\n/* Rendered text with proper overflow */\n.vs-container--default .vs-selection__rendered {\n flex: 1;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n min-width: 0;\n}\n\n/* Group labels */\n.vs-dropdown.vs-container--default .vs-result--group {\n font-weight: bold;\n padding: 8px 12px;\n color: #666;\n background: #f9f9f9;\n}\n\n.vs-dropdown.vs-container--default .vs-result--group-child {\n padding-left: 24px;\n}\n\n/* Loading and messages */\n.vs-dropdown.vs-container--default .vs-results--loading,\n.vs-dropdown.vs-container--default .vs-results--no-results {\n color: #999;\n font-style: italic;\n}\n\n/* Selection limit message */\n.vs-container--default .vs-results__limit-message {\n padding: 8px 12px;\n background: #fff3cd;\n color: #856404;\n border: 1px solid #ffc107;\n border-radius: 4px;\n margin: 8px;\n font-size: 13px;\n text-align: center;\n animation: vs-fade-in 0.2s ease-in;\n}\n\n@keyframes vs-fade-in {\n from {\n opacity: 0;\n transform: translateY(-4px);\n }\n to {\n opacity: 1;\n transform: translateY(0);\n }\n}\n"]}