@referralgps/selectra 1.0.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.
- package/LICENSE +203 -0
- package/README.md +346 -0
- package/dist/selectra.css +1 -0
- package/dist/selectra.es.js +1318 -0
- package/dist/selectra.es.js.map +1 -0
- package/dist/selectra.iife.js +32 -0
- package/dist/selectra.iife.js.map +1 -0
- package/dist/selectra.umd.js +32 -0
- package/dist/selectra.umd.js.map +1 -0
- package/package.json +64 -0
- package/src-alpine/README.md +346 -0
- package/src-alpine/index.d.ts +217 -0
- package/src-alpine/index.js +70 -0
- package/src-alpine/plugins/index.js +219 -0
- package/src-alpine/selectize.js +1022 -0
- package/src-alpine/sifter.js +270 -0
- package/src-alpine/styles/selectra.css +277 -0
- package/src-alpine/utils.js +181 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
+
|
|
181
|
+
To apply the Apache License to your work, attach the following
|
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
+
replaced with your own identifying information. (Don't include
|
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
+
comment syntax for the file format. We also recommend that a
|
|
186
|
+
file or class name and description of purpose be included on the
|
|
187
|
+
same "printed page" as the copyright notice for easier
|
|
188
|
+
identification within third-party archives.
|
|
189
|
+
|
|
190
|
+
Copyright 2013–2015 Brian Reavis & Contributors
|
|
191
|
+
Copyright 2020 Ris Adams & Contributors
|
|
192
|
+
|
|
193
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
194
|
+
you may not use this file except in compliance with the License.
|
|
195
|
+
You may obtain a copy of the License at
|
|
196
|
+
|
|
197
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
198
|
+
|
|
199
|
+
Unless required by applicable law or agreed to in writing, software
|
|
200
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
201
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
202
|
+
See the License for the specific language governing permissions and
|
|
203
|
+
limitations under the License.
|
package/README.md
ADDED
|
@@ -0,0 +1,346 @@
|
|
|
1
|
+
# Selectra
|
|
2
|
+
|
|
3
|
+
> A powerful, extensible `<select>` UI control — rebuilt with **Alpine.js** and **Tailwind CSS**.
|
|
4
|
+
|
|
5
|
+
Selectra is a modern rewrite of [Selectize.js](https://github.com/selectize/selectize.js), designed for tagging, contact lists, country selectors, and autocomplete. It drops the jQuery dependency entirely in favor of Alpine.js reactivity and Tailwind CSS styling.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Why Selectra?
|
|
10
|
+
|
|
11
|
+
| | Selectize.js (legacy) | **Selectra** |
|
|
12
|
+
|---|---|---|
|
|
13
|
+
| **UI Framework** | jQuery | Alpine.js |
|
|
14
|
+
| **Styling** | LESS / SCSS + Bootstrap themes | Tailwind CSS utilities |
|
|
15
|
+
| **Build Tool** | Gulp | Vite |
|
|
16
|
+
| **Tests** | Karma + Mocha | Vitest |
|
|
17
|
+
| **Bundle (JS)** | ~88 KB min | ~25 KB min |
|
|
18
|
+
| **CSS** | Multiple theme files | Single 21 KB utility file |
|
|
19
|
+
| **jQuery Required** | Yes | No |
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
## Features
|
|
24
|
+
|
|
25
|
+
- **Single & Multi Select** — auto-detected from `maxItems` or explicit `mode`
|
|
26
|
+
- **Tagging / Create** — create new options on the fly with validation
|
|
27
|
+
- **Fuzzy Search** — built-in Sifter engine with diacritics support
|
|
28
|
+
- **Remote Loading** — fetch options from API with debounced requests
|
|
29
|
+
- **Option Groups** — grouped options with sticky headers
|
|
30
|
+
- **Keyboard Navigation** — arrows, enter, escape, tab, backspace, ctrl+A
|
|
31
|
+
- **Copy / Paste** — split pasted text into multiple items via delimiter
|
|
32
|
+
- **Custom Rendering** — templates for options, items, create prompt, no-results, loading
|
|
33
|
+
- **Plugin System** — 9 built-in plugins, easy to create custom ones
|
|
34
|
+
- **Accessible** — focus management, label association, keyboard-first
|
|
35
|
+
- **RTL Support** — auto-detected from CSS `direction`
|
|
36
|
+
- **Tailwind CSS** — fully styled with utilities, trivially customizable
|
|
37
|
+
- **Lightweight** — ~25 KB gzipped JS, zero runtime dependencies beyond Alpine.js
|
|
38
|
+
|
|
39
|
+
---
|
|
40
|
+
|
|
41
|
+
## Installation
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
npm install selectra alpinejs
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
### CDN
|
|
48
|
+
|
|
49
|
+
```html
|
|
50
|
+
<script src="https://cdn.jsdelivr.net/npm/alpinejs@3/dist/cdn.min.js" defer></script>
|
|
51
|
+
<script src="https://cdn.jsdelivr.net/npm/selectra/dist/selectra.iife.js"></script>
|
|
52
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/selectra/dist/selectra.css">
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
---
|
|
56
|
+
|
|
57
|
+
## Quick Start
|
|
58
|
+
|
|
59
|
+
### 1. Register the Plugin
|
|
60
|
+
|
|
61
|
+
```js
|
|
62
|
+
import Alpine from 'alpinejs';
|
|
63
|
+
import Selectra from 'selectra';
|
|
64
|
+
import 'selectra/css';
|
|
65
|
+
|
|
66
|
+
Alpine.plugin(Selectra);
|
|
67
|
+
Alpine.start();
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
### 2. Use in HTML
|
|
71
|
+
|
|
72
|
+
#### Single Select
|
|
73
|
+
|
|
74
|
+
```html
|
|
75
|
+
<div x-data="selectra({
|
|
76
|
+
mode: 'single',
|
|
77
|
+
placeholder: 'Select a country...',
|
|
78
|
+
options: [
|
|
79
|
+
{ value: 'us', text: 'United States' },
|
|
80
|
+
{ value: 'ca', text: 'Canada' },
|
|
81
|
+
{ value: 'mx', text: 'Mexico' },
|
|
82
|
+
]
|
|
83
|
+
})" class="relative max-w-md">
|
|
84
|
+
|
|
85
|
+
<!-- Control -->
|
|
86
|
+
<div @click="focus()"
|
|
87
|
+
:class="{ 'ring-2 ring-blue-500/20 border-blue-500': isFocused }"
|
|
88
|
+
class="relative flex items-center w-full min-h-[42px] px-3 py-1.5 bg-white border border-gray-300 rounded-lg cursor-pointer hover:border-gray-400">
|
|
89
|
+
|
|
90
|
+
<span x-show="items.length && !isFocused" x-text="currentValueText" class="truncate text-gray-900"></span>
|
|
91
|
+
|
|
92
|
+
<input x-ref="searchInput" x-model="query"
|
|
93
|
+
@input="onInput()" @focus="focus()" @blur.debounce.150ms="blur()"
|
|
94
|
+
@keydown="onKeyDown($event)"
|
|
95
|
+
:placeholder="placeholderText"
|
|
96
|
+
x-show="isFocused || !items.length"
|
|
97
|
+
class="flex-1 min-w-0 bg-transparent outline-none border-none p-0 text-gray-900 placeholder-gray-400">
|
|
98
|
+
|
|
99
|
+
<svg :class="{'rotate-180': isOpen}" class="w-4 h-4 text-gray-400 ml-2 transition-transform"
|
|
100
|
+
fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
|
|
101
|
+
<path stroke-linecap="round" stroke-linejoin="round" d="M19 9l-7 7-7-7" />
|
|
102
|
+
</svg>
|
|
103
|
+
</div>
|
|
104
|
+
|
|
105
|
+
<!-- Dropdown -->
|
|
106
|
+
<div x-show="isOpen" x-ref="dropdown"
|
|
107
|
+
x-transition class="absolute z-50 w-full mt-1 bg-white border border-gray-200 rounded-lg shadow-lg overflow-hidden">
|
|
108
|
+
<div class="max-h-60 overflow-y-auto py-1">
|
|
109
|
+
<template x-for="(option, index) in filteredOptions" :key="optionKey(option)">
|
|
110
|
+
<div @click="selectOption(option)" @mouseenter="activeIndex = index"
|
|
111
|
+
:class="{ 'bg-blue-500 text-white': activeIndex === index }"
|
|
112
|
+
class="px-3 py-2 cursor-pointer"
|
|
113
|
+
x-html="renderOption(option)">
|
|
114
|
+
</div>
|
|
115
|
+
</template>
|
|
116
|
+
</div>
|
|
117
|
+
</div>
|
|
118
|
+
</div>
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
#### Multi Select with Tags
|
|
122
|
+
|
|
123
|
+
```html
|
|
124
|
+
<div x-data="selectra({
|
|
125
|
+
mode: 'multi',
|
|
126
|
+
placeholder: 'Select languages...',
|
|
127
|
+
create: true,
|
|
128
|
+
options: [
|
|
129
|
+
{ value: 'js', text: 'JavaScript' },
|
|
130
|
+
{ value: 'py', text: 'Python' },
|
|
131
|
+
{ value: 'go', text: 'Go' },
|
|
132
|
+
]
|
|
133
|
+
})" class="relative max-w-md">
|
|
134
|
+
|
|
135
|
+
<div @click="focus()"
|
|
136
|
+
:class="{ 'ring-2 ring-blue-500/20 border-blue-500': isFocused }"
|
|
137
|
+
class="relative flex flex-wrap items-center gap-1 w-full min-h-[42px] px-2 py-1.5 bg-white border border-gray-300 rounded-lg cursor-text hover:border-gray-400">
|
|
138
|
+
|
|
139
|
+
<template x-for="val in items" :key="val">
|
|
140
|
+
<span class="inline-flex items-center gap-1 px-2 py-0.5 rounded-md bg-blue-50 text-blue-700 border border-blue-200 text-sm">
|
|
141
|
+
<span x-text="options[val]?.text || val"></span>
|
|
142
|
+
<button @click.stop="removeItem(val)" class="w-4 h-4 rounded-full text-blue-400 hover:text-blue-600">×</button>
|
|
143
|
+
</span>
|
|
144
|
+
</template>
|
|
145
|
+
|
|
146
|
+
<input x-ref="searchInput" x-model="query"
|
|
147
|
+
@input="onInput()" @focus="focus()" @blur.debounce.150ms="blur()"
|
|
148
|
+
@keydown="onKeyDown($event)" @paste="onPaste($event)"
|
|
149
|
+
:placeholder="items.length ? '' : placeholderText"
|
|
150
|
+
class="flex-1 min-w-[60px] bg-transparent outline-none border-none p-0 text-sm">
|
|
151
|
+
</div>
|
|
152
|
+
|
|
153
|
+
<div x-show="isOpen" x-ref="dropdown" x-transition
|
|
154
|
+
class="absolute z-50 w-full mt-1 bg-white border border-gray-200 rounded-lg shadow-lg overflow-hidden">
|
|
155
|
+
<div class="max-h-60 overflow-y-auto py-1">
|
|
156
|
+
<template x-for="(option, index) in filteredOptions" :key="optionKey(option)">
|
|
157
|
+
<div @click="selectOption(option)" @mouseenter="activeIndex = index"
|
|
158
|
+
:class="{ 'bg-blue-500 text-white': activeIndex === index }"
|
|
159
|
+
class="px-3 py-2 cursor-pointer" x-html="renderOption(option)">
|
|
160
|
+
</div>
|
|
161
|
+
</template>
|
|
162
|
+
<div x-show="canCreate" @click="createItem()"
|
|
163
|
+
class="px-3 py-2 cursor-pointer text-gray-500 border-t border-gray-100"
|
|
164
|
+
x-html="renderOptionCreate()">
|
|
165
|
+
</div>
|
|
166
|
+
</div>
|
|
167
|
+
</div>
|
|
168
|
+
</div>
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
## Configuration
|
|
172
|
+
|
|
173
|
+
| Option | Type | Default | Description |
|
|
174
|
+
|--------|------|---------|-------------|
|
|
175
|
+
| `mode` | `'single' \| 'multi'` | auto | Selection mode |
|
|
176
|
+
| `options` | `Array` | `[]` | Available options |
|
|
177
|
+
| `items` | `Array` | `[]` | Pre-selected values |
|
|
178
|
+
| `maxItems` | `number \| null` | `null` | Max selectable items |
|
|
179
|
+
| `maxOptions` | `number` | `1000` | Max dropdown options |
|
|
180
|
+
| `create` | `boolean \| function` | `false` | Allow creating new options |
|
|
181
|
+
| `createOnBlur` | `boolean` | `false` | Create item when field loses focus |
|
|
182
|
+
| `createFilter` | `RegExp \| function` | `null` | Filter for creatable values |
|
|
183
|
+
| `placeholder` | `string` | `''` | Placeholder text |
|
|
184
|
+
| `valueField` | `string` | `'value'` | Property for option value |
|
|
185
|
+
| `labelField` | `string` | `'text'` | Property for display label |
|
|
186
|
+
| `searchField` | `string[]` | `['text']` | Fields to search |
|
|
187
|
+
| `searchConjunction` | `'and' \| 'or'` | `'and'` | Multi-term search logic |
|
|
188
|
+
| `sortField` | `string \| Array` | `'$order'` | Sort field(s) |
|
|
189
|
+
| `highlight` | `boolean` | `true` | Highlight matches |
|
|
190
|
+
| `openOnFocus` | `boolean` | `true` | Open dropdown on focus |
|
|
191
|
+
| `selectOnTab` | `boolean` | `true` | Tab selects active option |
|
|
192
|
+
| `closeAfterSelect` | `boolean` | `false` | Close dropdown after selection |
|
|
193
|
+
| `hideSelected` | `boolean \| null` | auto | Hide selected from dropdown |
|
|
194
|
+
| `delimiter` | `string` | `','` | Value separator |
|
|
195
|
+
| `splitOn` | `RegExp \| string` | `null` | Regex for splitting pasted values |
|
|
196
|
+
| `diacritics` | `boolean` | `true` | International character support |
|
|
197
|
+
| `normalize` | `boolean` | `true` | NFD normalize search queries |
|
|
198
|
+
| `preload` | `boolean \| 'focus'` | `false` | Preload options |
|
|
199
|
+
| `load` | `function \| null` | `null` | Remote data loader |
|
|
200
|
+
| `loadThrottle` | `number` | `300` | Load debounce delay (ms) |
|
|
201
|
+
| `plugins` | `Array` | `[]` | Plugins to activate |
|
|
202
|
+
|
|
203
|
+
### Custom Rendering
|
|
204
|
+
|
|
205
|
+
```js
|
|
206
|
+
selectra({
|
|
207
|
+
render: {
|
|
208
|
+
option: (data, escape) => `<div class="flex items-center gap-2">
|
|
209
|
+
<img src="${data.avatar}" class="w-6 h-6 rounded-full">
|
|
210
|
+
<span>${escape(data.text)}</span>
|
|
211
|
+
</div>`,
|
|
212
|
+
item: (data, escape) => escape(data.text),
|
|
213
|
+
optionCreate: (data, escape) => `Add "${escape(data.input)}"`,
|
|
214
|
+
noResults: () => 'Nothing found',
|
|
215
|
+
loading: () => 'Searching...',
|
|
216
|
+
}
|
|
217
|
+
})
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
### Remote Loading
|
|
221
|
+
|
|
222
|
+
```js
|
|
223
|
+
selectra({
|
|
224
|
+
load: (query, callback) => {
|
|
225
|
+
fetch(`/api/search?q=${encodeURIComponent(query)}`)
|
|
226
|
+
.then(res => res.json())
|
|
227
|
+
.then(data => callback(data.results))
|
|
228
|
+
.catch(() => callback([]));
|
|
229
|
+
},
|
|
230
|
+
loadThrottle: 300,
|
|
231
|
+
})
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
## API Methods
|
|
235
|
+
|
|
236
|
+
| Method | Description |
|
|
237
|
+
|--------|-------------|
|
|
238
|
+
| `addOption(data)` | Add one or more options |
|
|
239
|
+
| `updateOption(value, data)` | Update an existing option |
|
|
240
|
+
| `removeOption(value)` | Remove an option |
|
|
241
|
+
| `clearOptions()` | Remove all options (keeps selected) |
|
|
242
|
+
| `getOption(value)` | Get option data by value |
|
|
243
|
+
| `addItem(value)` | Select an item |
|
|
244
|
+
| `removeItem(value)` | Deselect an item |
|
|
245
|
+
| `clear()` | Clear all selections |
|
|
246
|
+
| `getValue()` | Get current value(s) |
|
|
247
|
+
| `setValue(value)` | Set selected value(s) |
|
|
248
|
+
| `createItem(input?)` | Create new item from input |
|
|
249
|
+
| `open()` | Open dropdown |
|
|
250
|
+
| `close()` | Close dropdown |
|
|
251
|
+
| `focus()` | Focus the control |
|
|
252
|
+
| `blur()` | Remove focus |
|
|
253
|
+
| `lock()` / `unlock()` | Temporarily disable input |
|
|
254
|
+
| `disable()` / `enable()` | Disable/enable control |
|
|
255
|
+
| `setMaxItems(max)` | Update max items limit |
|
|
256
|
+
|
|
257
|
+
## Events
|
|
258
|
+
|
|
259
|
+
Events are dispatched as custom DOM events on the wrapper element:
|
|
260
|
+
|
|
261
|
+
```js
|
|
262
|
+
el.addEventListener('selectra:change', (e) => {
|
|
263
|
+
console.log('Value changed:', e.detail);
|
|
264
|
+
});
|
|
265
|
+
```
|
|
266
|
+
|
|
267
|
+
| Event | Detail |
|
|
268
|
+
|-------|--------|
|
|
269
|
+
| `selectra:change` | `[value]` |
|
|
270
|
+
| `selectra:itemadd` | `[value, data]` |
|
|
271
|
+
| `selectra:itemremove` | `[value]` |
|
|
272
|
+
| `selectra:clear` | `[]` |
|
|
273
|
+
| `selectra:optionadd` | `[value, data]` |
|
|
274
|
+
| `selectra:optionremove` | `[value]` |
|
|
275
|
+
| `selectra:dropdownopen` | `[]` |
|
|
276
|
+
| `selectra:dropdownclose` | `[]` |
|
|
277
|
+
| `selectra:type` | `[query]` |
|
|
278
|
+
| `selectra:focus` | `[]` |
|
|
279
|
+
| `selectra:blur` | `[]` |
|
|
280
|
+
| `selectra:initialize` | `[]` |
|
|
281
|
+
|
|
282
|
+
## Plugins
|
|
283
|
+
|
|
284
|
+
### Built-in Plugins
|
|
285
|
+
|
|
286
|
+
Activate plugins via the `plugins` config option:
|
|
287
|
+
|
|
288
|
+
```js
|
|
289
|
+
selectra({
|
|
290
|
+
plugins: ['remove_button', 'clear_button', { name: 'tag_limit', options: { tagLimit: 3 } }]
|
|
291
|
+
})
|
|
292
|
+
```
|
|
293
|
+
|
|
294
|
+
| Plugin | Description |
|
|
295
|
+
|--------|-------------|
|
|
296
|
+
| `remove_button` | Add × button to each selected tag |
|
|
297
|
+
| `clear_button` | Add a clear-all button to the control |
|
|
298
|
+
| `restore_on_backspace` | Restore deleted item text to input |
|
|
299
|
+
| `dropdown_header` | Add a header to the dropdown |
|
|
300
|
+
| `tag_limit` | Limit visible tags with "+N" badge |
|
|
301
|
+
| `auto_select_on_type` | Auto-select first match on blur |
|
|
302
|
+
| `select_on_focus` | Put current value into search on focus |
|
|
303
|
+
| `read_only` | Make component read-only |
|
|
304
|
+
| `auto_position` | Smart dropdown positioning (above/below) |
|
|
305
|
+
|
|
306
|
+
### Custom Plugins
|
|
307
|
+
|
|
308
|
+
```js
|
|
309
|
+
import { registerPlugin } from 'selectra';
|
|
310
|
+
|
|
311
|
+
registerPlugin('my_plugin', function(options) {
|
|
312
|
+
// `this` is the selectra component instance
|
|
313
|
+
console.log('Plugin initialized with', options);
|
|
314
|
+
|
|
315
|
+
// Override methods
|
|
316
|
+
const originalOpen = this.open.bind(this);
|
|
317
|
+
this.open = () => {
|
|
318
|
+
console.log('Opening dropdown');
|
|
319
|
+
originalOpen();
|
|
320
|
+
};
|
|
321
|
+
});
|
|
322
|
+
```
|
|
323
|
+
|
|
324
|
+
## Building
|
|
325
|
+
|
|
326
|
+
```bash
|
|
327
|
+
npm install
|
|
328
|
+
npm run build # Build dist/
|
|
329
|
+
npm run dev # Dev server with HMR
|
|
330
|
+
npm run test # Run tests
|
|
331
|
+
```
|
|
332
|
+
|
|
333
|
+
## Migration from jQuery Version
|
|
334
|
+
|
|
335
|
+
| jQuery Selectize | Selectra |
|
|
336
|
+
|-----------------|---------------------|
|
|
337
|
+
| `$('select').selectize({...})` | `x-data="selectra({...})"` |
|
|
338
|
+
| `instance.addItem(val)` | Direct method call in Alpine scope |
|
|
339
|
+
| `$.fn.selectize` plugin | `Alpine.plugin(Selectra)` |
|
|
340
|
+
| jQuery events | Custom DOM events |
|
|
341
|
+
| LESS/SCSS themes | Tailwind CSS utilities |
|
|
342
|
+
| Bootstrap themes | Use Tailwind directly |
|
|
343
|
+
|
|
344
|
+
## License
|
|
345
|
+
|
|
346
|
+
Apache-2.0
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}.selectra-option.is-active .highlight{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.highlight{font-weight:600;color:inherit}.pointer-events-none{pointer-events:none}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.top-0{top:0}.z-50{z-index:50}.mx-auto{margin-left:auto;margin-right:auto}.mb-1{margin-bottom:.25rem}.mb-12{margin-bottom:3rem}.mb-2{margin-bottom:.5rem}.mb-4{margin-bottom:1rem}.ml-1{margin-left:.25rem}.ml-2{margin-left:.5rem}.mt-1{margin-top:.25rem}.mt-16{margin-top:4rem}.block{display:block}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.hidden{display:none}.h-3{height:.75rem}.h-4{height:1rem}.max-h-60{max-height:15rem}.min-h-\[42px\]{min-height:42px}.min-h-screen{min-height:100vh}.w-3{width:.75rem}.w-4{width:1rem}.w-full{width:100%}.min-w-0{min-width:0px}.min-w-\[60px\]{min-width:60px}.max-w-4xl{max-width:56rem}.max-w-md{max-width:28rem}.flex-1{flex:1 1 0%}.flex-shrink-0{flex-shrink:0}.-translate-y-1{--tw-translate-y: -.25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-y-0{--tw-translate-y: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rotate-180{--tw-rotate: 180deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes spin{to{transform:rotate(360deg)}}.animate-spin{animation:spin 1s linear infinite}.cursor-pointer{cursor:pointer}.cursor-text{cursor:text}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.justify-center{justify-content:center}.gap-1{gap:.25rem}.gap-2{gap:.5rem}.overflow-hidden{overflow:hidden}.overflow-y-auto{overflow-y:auto}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:.5rem}.rounded-md{border-radius:.375rem}.border{border-width:1px}.border-2{border-width:2px}.border-b{border-bottom-width:1px}.border-t{border-top-width:1px}.border-none{border-style:none}.border-amber-200{--tw-border-opacity: 1;border-color:rgb(253 230 138 / var(--tw-border-opacity, 1))}.border-blue-200{--tw-border-opacity: 1;border-color:rgb(191 219 254 / var(--tw-border-opacity, 1))}.border-blue-500{--tw-border-opacity: 1;border-color:rgb(59 130 246 / var(--tw-border-opacity, 1))}.border-emerald-200{--tw-border-opacity: 1;border-color:rgb(167 243 208 / var(--tw-border-opacity, 1))}.border-gray-100{--tw-border-opacity: 1;border-color:rgb(243 244 246 / var(--tw-border-opacity, 1))}.border-gray-200{--tw-border-opacity: 1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1))}.border-gray-300{--tw-border-opacity: 1;border-color:rgb(209 213 219 / var(--tw-border-opacity, 1))}.border-violet-200{--tw-border-opacity: 1;border-color:rgb(221 214 254 / var(--tw-border-opacity, 1))}.border-t-blue-500{--tw-border-opacity: 1;border-top-color:rgb(59 130 246 / var(--tw-border-opacity, 1))}.bg-amber-50{--tw-bg-opacity: 1;background-color:rgb(255 251 235 / var(--tw-bg-opacity, 1))}.bg-blue-50{--tw-bg-opacity: 1;background-color:rgb(239 246 255 / var(--tw-bg-opacity, 1))}.bg-blue-500{--tw-bg-opacity: 1;background-color:rgb(59 130 246 / var(--tw-bg-opacity, 1))}.bg-emerald-50{--tw-bg-opacity: 1;background-color:rgb(236 253 245 / var(--tw-bg-opacity, 1))}.bg-gray-50{--tw-bg-opacity: 1;background-color:rgb(249 250 251 / var(--tw-bg-opacity, 1))}.bg-transparent{background-color:transparent}.bg-violet-50{--tw-bg-opacity: 1;background-color:rgb(245 243 255 / var(--tw-bg-opacity, 1))}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.p-0{padding:0}.px-2{padding-left:.5rem;padding-right:.5rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.py-0\.5{padding-top:.125rem;padding-bottom:.125rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-1\.5{padding-top:.375rem;padding-bottom:.375rem}.py-12{padding-top:3rem;padding-bottom:3rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.pt-8{padding-top:2rem}.text-center{text-align:center}.text-3xl{font-size:1.875rem;line-height:2.25rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-semibold{font-weight:600}.uppercase{text-transform:uppercase}.tracking-wider{letter-spacing:.05em}.text-amber-400{--tw-text-opacity: 1;color:rgb(251 191 36 / var(--tw-text-opacity, 1))}.text-amber-700{--tw-text-opacity: 1;color:rgb(180 83 9 / var(--tw-text-opacity, 1))}.text-blue-400{--tw-text-opacity: 1;color:rgb(96 165 250 / var(--tw-text-opacity, 1))}.text-blue-700{--tw-text-opacity: 1;color:rgb(29 78 216 / var(--tw-text-opacity, 1))}.text-emerald-400{--tw-text-opacity: 1;color:rgb(52 211 153 / var(--tw-text-opacity, 1))}.text-emerald-700{--tw-text-opacity: 1;color:rgb(4 120 87 / var(--tw-text-opacity, 1))}.text-gray-400{--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.text-gray-500{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.text-gray-700{--tw-text-opacity: 1;color:rgb(55 65 81 / var(--tw-text-opacity, 1))}.text-gray-800{--tw-text-opacity: 1;color:rgb(31 41 55 / var(--tw-text-opacity, 1))}.text-gray-900{--tw-text-opacity: 1;color:rgb(17 24 39 / var(--tw-text-opacity, 1))}.text-inherit{color:inherit}.text-violet-400{--tw-text-opacity: 1;color:rgb(167 139 250 / var(--tw-text-opacity, 1))}.text-violet-700{--tw-text-opacity: 1;color:rgb(109 40 217 / var(--tw-text-opacity, 1))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.underline{text-decoration-line:underline}.decoration-blue-300{text-decoration-color:#93c5fd}.placeholder-gray-400::-moz-placeholder{--tw-placeholder-opacity: 1;color:rgb(156 163 175 / var(--tw-placeholder-opacity, 1))}.placeholder-gray-400::placeholder{--tw-placeholder-opacity: 1;color:rgb(156 163 175 / var(--tw-placeholder-opacity, 1))}.opacity-0{opacity:0}.opacity-100{opacity:1}.opacity-50{opacity:.5}.shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.outline-none{outline:2px solid transparent;outline-offset:2px}.ring-2{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-blue-500\/20{--tw-ring-color: rgb(59 130 246 / .2)}.blur{--tw-blur: blur(8px);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-100{transition-duration:.1s}.duration-150{transition-duration:.15s}.duration-200{transition-duration:.2s}.duration-75{transition-duration:75ms}.ease-in{transition-timing-function:cubic-bezier(.4,0,1,1)}.ease-out{transition-timing-function:cubic-bezier(0,0,.2,1)}@keyframes fade-in{0%{opacity:0;transform:scale(.95)}to{opacity:1;transform:scale(1)}}@keyframes dropdown-in{0%{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:translateY(0)}}.animate-fade-in{animation:fade-in .15s ease-out}.animate-dropdown-in{animation:dropdown-in .15s ease-out}.selectra-dropdown-content::-webkit-scrollbar{width:6px}.selectra-dropdown-content::-webkit-scrollbar-track{background:transparent}.selectra-dropdown-content::-webkit-scrollbar-thumb{border-radius:9999px;--tw-bg-opacity: 1;background-color:rgb(229 231 235 / var(--tw-bg-opacity, 1))}.selectra-dropdown-content::-webkit-scrollbar-thumb:hover{--tw-bg-opacity: 1;background-color:rgb(209 213 219 / var(--tw-bg-opacity, 1))}.hover\:border-gray-400:hover{--tw-border-opacity: 1;border-color:rgb(156 163 175 / var(--tw-border-opacity, 1))}.hover\:bg-amber-100:hover{--tw-bg-opacity: 1;background-color:rgb(254 243 199 / var(--tw-bg-opacity, 1))}.hover\:bg-blue-100:hover{--tw-bg-opacity: 1;background-color:rgb(219 234 254 / var(--tw-bg-opacity, 1))}.hover\:bg-emerald-100:hover{--tw-bg-opacity: 1;background-color:rgb(209 250 229 / var(--tw-bg-opacity, 1))}.hover\:bg-violet-100:hover{--tw-bg-opacity: 1;background-color:rgb(237 233 254 / var(--tw-bg-opacity, 1))}.hover\:text-amber-600:hover{--tw-text-opacity: 1;color:rgb(217 119 6 / var(--tw-text-opacity, 1))}.hover\:text-blue-600:hover{--tw-text-opacity: 1;color:rgb(37 99 235 / var(--tw-text-opacity, 1))}.hover\:text-emerald-600:hover{--tw-text-opacity: 1;color:rgb(5 150 105 / var(--tw-text-opacity, 1))}.hover\:text-violet-600:hover{--tw-text-opacity: 1;color:rgb(124 58 237 / var(--tw-text-opacity, 1))}
|