@preline/pin-input 4.1.2 → 4.2.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/README.md ADDED
@@ -0,0 +1,313 @@
1
+ # PIN Input
2
+
3
+ A PIN Input plugin that allows to fill in data for inputs.
4
+
5
+ [![npm](https://img.shields.io/badge/npm-v4.2.0-blue)](https://www.npmjs.com/package/@preline/pin-input) [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT) [![Demo](https://img.shields.io/badge/demo-online-brightgreen)](https://preline.co/plugins/pin-input.html)
6
+
7
+ ## Contents
8
+
9
+ - [Overview](#overview)
10
+ - [Installation](#installation)
11
+ - [Basic usage](#basic-usage)
12
+ - [Configuration Options](#configuration-options)
13
+ - [JavaScript API](#javascript-api)
14
+ - [Events](#events)
15
+ - [Common Patterns](#common-patterns)
16
+ - [License](#license)
17
+
18
+ ## Overview
19
+
20
+ The PIN Input component provides a multi-field input interface for entering PIN codes, verification codes, or similar numeric/alphanumeric sequences. It automatically moves focus between fields and supports paste operations.
21
+
22
+ **Key Features:**
23
+ - Multiple input fields for PIN entry
24
+ - Automatic focus management
25
+ - Paste support for bulk entry
26
+ - Character validation via regex
27
+ - Programmatic control via JavaScript API
28
+ - Event system for completion tracking
29
+ - Accessibility support
30
+
31
+ ## Installation
32
+
33
+ To get started, install PIN Input plugin via npm, else you can skip this step if you are already using Preline UI as a package.
34
+
35
+ ```bash
36
+ npm i @preline/pin-input
37
+ ```
38
+
39
+ ### CSS
40
+
41
+ Use [`@source`](https://tailwindcss.com/docs/functions-and-directives#source-directive) to register the plugin's JavaScript path for Tailwind CSS scanning, then [`@import`](https://tailwindcss.com/docs/functions-and-directives#import-directive) the plugin's CSS files into your Tailwind CSS file.
42
+
43
+ ```css
44
+ @import "tailwindcss";
45
+
46
+ /* @preline/pin-input */
47
+ @source "../node_modules/@preline/pin-input/*.js";
48
+ @import "./node_modules/@preline/pin-input/variants.css";
49
+ @import "./node_modules/@preline/pin-input/theme.css";
50
+ ```
51
+
52
+ ### JavaScript
53
+
54
+ Include the JavaScript that powers the interactive elements near the end of your `</body>` tag:
55
+
56
+ ```html
57
+ <script src="./node_modules/@preline/pin-input/index.js"></script>
58
+ ```
59
+
60
+ ### Manual Initialization
61
+
62
+ Use the `non-auto` entry if you need manual initialization. In this mode, automatic initialization on page load is not included, so the component should be initialized explicitly.
63
+
64
+ ```html
65
+ <script type="module">
66
+ import HSPinInput from "@preline/pin-input/non-auto.mjs";
67
+
68
+ new HSPinInput(document.querySelector("#pin-input"));
69
+ </script>
70
+ ```
71
+
72
+ ### Via Bundler
73
+
74
+ When using a bundler (Vite, webpack, etc.), import the plugin directly as an ES module.
75
+
76
+ `@preline/pin-input` is the auto-init entry: it scans the DOM and initializes matching elements automatically.
77
+
78
+ ```js
79
+ import "@preline/pin-input";
80
+ ```
81
+
82
+ `@preline/pin-input/non-auto` is the manual entry: use it when you want explicit control over when initialization happens, either via `autoInit()` or by creating a specific instance yourself.
83
+
84
+ ```js
85
+ import HSPinInput from "@preline/pin-input/non-auto";
86
+
87
+ HSPinInput.autoInit();
88
+
89
+ // Or initialize a specific element manually
90
+ const el = document.querySelector("#pin-input");
91
+ if (el) new HSPinInput(el);
92
+ ```
93
+
94
+ ### TypeScript
95
+
96
+ This package ships with TypeScript type definitions. No additional `@types/` package is needed.
97
+
98
+ ## Basic usage
99
+
100
+ The following example demonstrates the minimal HTML structure required for a PIN input component. This is a base template without custom styling - you can apply your own CSS classes and styles as needed. The component consists of multiple input fields that automatically advance focus.
101
+
102
+ ```html
103
+ <div data-hs-pin-input>
104
+ <input type="text" data-hs-pin-input-item>
105
+ <input type="text" data-hs-pin-input-item>
106
+ <input type="text" data-hs-pin-input-item>
107
+ <input type="text" data-hs-pin-input-item>
108
+ </div>
109
+ ```
110
+
111
+ **Structure Requirements:**
112
+ - `data-hs-pin-input`: Required on the container element
113
+ - `data-hs-pin-input-item`: Required on each input field
114
+ - All input fields should be direct children of the container
115
+
116
+ **Initial State:**
117
+ - Input fields are empty by default
118
+ - Focus starts on the first input field (if `autofocus` class is used)
119
+
120
+ ## Configuration Options
121
+
122
+ ### Data Options
123
+
124
+ Data options are specified in the `data-hs-pin-input` attribute.
125
+
126
+ | Attribute | Target Element | Type | Default | Description |
127
+ | --- | --- | --- | --- | --- |
128
+ | `data-hs-pin-input` | Container | - | - | Activate a Pin Input by specifying on an element. Should be added to the container. |
129
+ | `:availableCharsRE` | Inside `data-hs-pin-input` | RegExp (string) | `"^[a-zA-Z0-9]+$"` | Regular expression string for available characters. Only characters matching this regex will be accepted. |
130
+ | `data-hs-pin-input-item` | Input element | - | - | Determines which element inside the initialized container will be responsible for entering data. Should be added to the input. |
131
+
132
+ **Example:**
133
+ ```html
134
+ <div data-hs-pin-input='{
135
+ "availableCharsRE": "^[0-9]+$"
136
+ }'>
137
+ <!-- Input fields -->
138
+ </div>
139
+ ```
140
+
141
+ ### CSS Classes (Modifiers)
142
+
143
+ CSS class modifiers use Tailwind-style syntax with `--` prefix to control PIN input behavior.
144
+
145
+ | Class | Required On | Purpose |
146
+ | --- | --- | --- |
147
+ | `autofocus` | One of the input fields | If one of the fields has this class, it will be focused when the page loads. |
148
+
149
+ ### Tailwind Modifiers
150
+
151
+ | Name | Description |
152
+ | --- | --- |
153
+ | `hs-pin-input-active:*` | The class is added to the input when the PIN has been set up (all fields are filled). |
154
+
155
+ ## JavaScript API
156
+
157
+ The `HSPinInput` object is available in the global `window` object after the plugin is loaded.
158
+
159
+ ### Instance Methods
160
+
161
+ These methods are called on a PIN input instance.
162
+
163
+ | Method | Parameters | Return Type | Description |
164
+ | --- | --- | --- | --- |
165
+ | `destroy()` | None | `void` | Destroys the PIN input instance, removes all generated markup, classes, and event listeners. Use when removing PIN input from DOM. |
166
+
167
+ ### Static Methods
168
+
169
+ These methods are called directly on the `HSPinInput` class.
170
+
171
+ | Method | Parameters | Return Type | Description |
172
+ | --- | --- | --- | --- |
173
+ | `HSPinInput.getInstance(target, isInstance)` | `target`: `HTMLElement \| string` (CSS selector)<br>`isInstance`: `boolean` (optional) | `HSPinInput \| { id: string \| number, element: HSPinInput } \| null` | Returns the PIN input instance associated with the target. If `isInstance` is `true`, returns collection item object `{ id, element }` where `element` is the `HSPinInput` instance. If `isInstance` is `false` or omitted, returns the `HSPinInput` instance directly. Returns `null` if PIN input instance is not found. |
174
+
175
+ ### Usage Examples
176
+
177
+ **Example 1: Destroying PIN input instance**
178
+ ```javascript
179
+ const instance = HSPinInput.getInstance('#hs-pin-input', true);
180
+
181
+ if (instance) {
182
+ const { element } = instance;
183
+ const destroyBtn = document.querySelector('#hs-destroy-btn');
184
+
185
+ destroyBtn.addEventListener('click', () => {
186
+ element.destroy();
187
+ });
188
+ }
189
+ ```
190
+
191
+ **Example 2: Getting instance and accessing properties**
192
+ ```javascript
193
+ // Get the PIN input instance
194
+ const instance = HSPinInput.getInstance('#hs-pin-input', true);
195
+
196
+ if (instance) {
197
+ const { element } = instance;
198
+
199
+ // Access instance properties
200
+ console.log('Current value:', element.currentValue);
201
+ console.log('Items:', element.items);
202
+
203
+ // Clean up when removing from DOM
204
+ function removePinInput() {
205
+ element.destroy();
206
+ }
207
+ }
208
+ ```
209
+
210
+ **Example 3: Destroying PIN input instance**
211
+ ```javascript
212
+ const instance = HSPinInput.getInstance('#hs-pin-input', true);
213
+
214
+ if (instance) {
215
+ const { element } = instance;
216
+ const removeBtn = document.querySelector('#hs-remove-btn');
217
+
218
+ removeBtn.addEventListener('click', () => {
219
+ // Clean up before removing from DOM
220
+ element.destroy();
221
+ // Now safe to remove the element
222
+ document.querySelector('#hs-pin-input').remove();
223
+ });
224
+ }
225
+ ```
226
+
227
+ ## Events
228
+
229
+ PIN input instances emit events that can be listened to for completion tracking and custom behavior.
230
+
231
+ | Event Name | When Fired | Callback Parameter | Description |
232
+ | --- | --- | --- | --- |
233
+ | `on:completed` | When the PIN has been set up (all fields filled) | `{ currentValue: string }` | Fires when all input fields have been filled. Returns an object with the `currentValue` containing the complete PIN string. |
234
+
235
+ ### Event Usage Example
236
+
237
+ ```javascript
238
+ // Get PIN input instance
239
+ const instance = HSPinInput.getInstance('#hs-pin-input', true);
240
+
241
+ if (instance) {
242
+ const { element } = instance;
243
+
244
+ // Listen to completed event
245
+ element.on('completed', ({ currentValue }) => {
246
+ console.log('PIN completed:', currentValue);
247
+ // Perform actions after PIN is completed
248
+ // e.g., validate PIN, submit form, proceed to next step
249
+ });
250
+ }
251
+ ```
252
+
253
+ ## Common Patterns
254
+
255
+ ### Pattern 1: Numeric PIN Only
256
+
257
+ Restrict input to numbers only.
258
+
259
+ ```html
260
+ <div data-hs-pin-input='{
261
+ "availableCharsRE": "^[0-9]+$"
262
+ }'>
263
+ <input type="text" data-hs-pin-input-item>
264
+ <input type="text" data-hs-pin-input-item>
265
+ <input type="text" data-hs-pin-input-item>
266
+ <input type="text" data-hs-pin-input-item>
267
+ </div>
268
+ ```
269
+
270
+ ### Pattern 2: Auto-focus First Field
271
+
272
+ Automatically focus the first field on page load.
273
+
274
+ ```html
275
+ <div data-hs-pin-input>
276
+ <input type="text" data-hs-pin-input-item class="autofocus">
277
+ <input type="text" data-hs-pin-input-item>
278
+ <input type="text" data-hs-pin-input-item>
279
+ <input type="text" data-hs-pin-input-item>
280
+ </div>
281
+ ```
282
+
283
+ ### Pattern 3: Handling Completion
284
+
285
+ Handle PIN completion with event listener.
286
+
287
+ ```html
288
+ <div id="hs-pin-input-first" data-hs-pin-input>
289
+ <input type="text" data-hs-pin-input-item>
290
+ <input type="text" data-hs-pin-input-item>
291
+ <input type="text" data-hs-pin-input-item>
292
+ <input type="text" data-hs-pin-input-item>
293
+ </div>
294
+
295
+ <script>
296
+ const instance = HSPinInput.getInstance('#hs-pin-input-first', true);
297
+
298
+ if (instance) {
299
+ const { element } = instance;
300
+
301
+ element.on('completed', ({ currentValue }) => {
302
+ console.log('PIN entered:', currentValue);
303
+ // Validate or submit the PIN
304
+ });
305
+ }
306
+ </script>
307
+ ```
308
+
309
+ ## License
310
+
311
+ Copyright (c) 2026 Preline Labs.
312
+
313
+ Licensed under the [MIT License](https://opensource.org/licenses/MIT).
package/index.js CHANGED
@@ -1,24 +1,24 @@
1
- !function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var n=t();for(var i in n)("object"==typeof exports?exports:e)[i]=n[i]}}(self,(()=>(()=>{"use strict";var e={292:function(e,t){
1
+ !function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var n=t();for(var i in n)("object"==typeof exports?exports:e)[i]=n[i]}}(self,()=>(()=>{"use strict";var e={2961(e,t){
2
2
  /*
3
- * @version: 4.1.2
3
+ * HSBasePlugin
4
+ * @version: 4.2.0
4
5
  * @author: Preline Labs Ltd.
5
6
  * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html)
6
7
  * Copyright 2024 Preline Labs Ltd.
7
8
  */
8
- Object.defineProperty(t,"__esModule",{value:!0}),t.stringToBoolean=t.menuSearchHistory=t.isScrollable=t.isParentOrElementHidden=t.isJson=t.isIpadOS=t.isIOS=t.isFormElement=t.isFocused=t.isEnoughSpace=t.isDirectChild=t.htmlToElement=t.getZIndex=t.getHighestZIndex=t.getClassPropertyAlt=t.getClassProperty=t.dispatch=t.debounce=t.classToClassList=t.afterTransition=void 0;t.stringToBoolean=e=>"true"===e;t.getClassProperty=(e,t,n="")=>(window.getComputedStyle(e).getPropertyValue(t)||n).replace(" ","");t.getClassPropertyAlt=(e,t,n="")=>{let i="";return e.classList.forEach((e=>{e.includes(t)&&(i=e)})),i.match(/:(.*)]/)?i.match(/:(.*)]/)[1]:n};const n=e=>window.getComputedStyle(e).getPropertyValue("z-index");t.getZIndex=n;t.getHighestZIndex=e=>{let t=Number.NEGATIVE_INFINITY;return e.forEach((e=>{let i=n(e);"auto"!==i&&(i=parseInt(i,10),i>t&&(t=i))})),t};t.isDirectChild=(e,t)=>{const n=e.children;for(let e=0;e<n.length;e++)if(n[e]===t)return!0;return!1};t.isEnoughSpace=(e,t,n="auto",i=10,s=null)=>{const o=t.getBoundingClientRect(),l=s?s.getBoundingClientRect():null,r=window.innerHeight,u=l?o.top-l.top:o.top,a=(s?l.bottom:r)-o.bottom,c=e.clientHeight+i;return"bottom"===n?a>=c:"top"===n?u>=c:u>=c||a>=c};t.isFocused=e=>document.activeElement===e;t.isFormElement=e=>e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement||e instanceof HTMLSelectElement;t.isIOS=()=>!!/iPad|iPhone|iPod/.test(navigator.platform)||navigator.maxTouchPoints&&navigator.maxTouchPoints>2&&/MacIntel/.test(navigator.platform);t.isIpadOS=()=>navigator.maxTouchPoints&&navigator.maxTouchPoints>2&&/MacIntel/.test(navigator.platform);t.isJson=e=>{if("string"!=typeof e)return!1;const t=e.trim()[0],n=e.trim().slice(-1);if("{"===t&&"}"===n||"["===t&&"]"===n)try{return JSON.parse(e),!0}catch(e){return!1}return!1};const i=e=>{if(!e)return!1;return"none"===window.getComputedStyle(e).display||i(e.parentElement)};t.isParentOrElementHidden=i;t.isScrollable=e=>{const t=window.getComputedStyle(e),n=t.overflowY,i=t.overflowX,s=("scroll"===n||"auto"===n)&&e.scrollHeight>e.clientHeight,o=("scroll"===i||"auto"===i)&&e.scrollWidth>e.clientWidth;return s||o};t.debounce=(e,t=200)=>{let n;return(...i)=>{clearTimeout(n),n=setTimeout((()=>{e.apply(this,i)}),t)}};t.dispatch=(e,t,n=null)=>{const i=new CustomEvent(e,{detail:{payload:n},bubbles:!0,cancelable:!0,composed:!1});t.dispatchEvent(i)};t.afterTransition=(e,t)=>{const n=()=>{t(),e.removeEventListener("transitionend",n,!0)},i=window.getComputedStyle(e),s=i.getPropertyValue("transition-duration");"none"!==i.getPropertyValue("transition-property")&&parseFloat(s)>0?e.addEventListener("transitionend",n,!0):t()};t.htmlToElement=e=>{const t=document.createElement("template");return e=e.trim(),t.innerHTML=e,t.content.firstChild};t.classToClassList=(e,t,n=" ",i="add")=>{e.split(n).forEach((e=>{e.trim()&&("add"===i?t.classList.add(e):t.classList.remove(e))}))};const s={historyIndex:-1,addHistory(e){this.historyIndex=e},existsInHistory(e){return e>this.historyIndex},clearHistory(){this.historyIndex=-1}};t.menuSearchHistory=s},2961:(e,t)=>{
9
+ Object.defineProperty(t,"__esModule",{value:!0});t.default=class{constructor(e,t,n){this.el=e,this.options=t,this.events=n,this.el=e,this.options=t,this.events={}}createCollection(e,t){var n,i;let s=e;if(!Array.isArray(s)&&"undefined"!=typeof window){const e=null===(n=this.constructor)||void 0===n?void 0:n.name,t="string"==typeof e&&e.startsWith("HS")?`$hs${e.slice(2)}Collection`:null;t&&(Array.isArray(window[t])||(window[t]=[]),s=window[t])}Array.isArray(s)&&s.push({id:(null===(i=null==t?void 0:t.el)||void 0===i?void 0:i.id)||s.length+1,element:t})}fireEvent(e,t=null){if(this.events.hasOwnProperty(e))return this.events[e](t)}on(e,t){this.events[e]=t}}},4229(e,t,n){var i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const s=i(n(4061));window.addEventListener("load",()=>{s.default.autoInit()}),"undefined"!=typeof window&&(window.HSPinInput=s.default)},4061(e,t,n){
9
10
  /*
10
- * HSBasePlugin
11
- * @version: 4.1.2
11
+ * HSPinInput
12
+ * @version: 4.2.0
12
13
  * @author: Preline Labs Ltd.
13
14
  * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html)
14
15
  * Copyright 2024 Preline Labs Ltd.
15
16
  */
16
- Object.defineProperty(t,"__esModule",{value:!0});t.default=class{constructor(e,t,n){this.el=e,this.options=t,this.events=n,this.el=e,this.options=t,this.events={}}createCollection(e,t){var n,i;let s=e;if(!Array.isArray(s)&&"undefined"!=typeof window){const e=null===(n=this.constructor)||void 0===n?void 0:n.name,t="string"==typeof e&&e.startsWith("HS")?`$hs${e.slice(2)}Collection`:null;t&&(Array.isArray(window[t])||(window[t]=[]),s=window[t])}Array.isArray(s)&&s.push({id:(null===(i=null==t?void 0:t.el)||void 0===i?void 0:i.id)||s.length+1,element:t})}fireEvent(e,t=null){if(this.events.hasOwnProperty(e))return this.events[e](t)}on(e,t){this.events[e]=t}}},4061:function(e,t,n){
17
+ var i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const s=n(292),o=i(n(2961));class l extends o.default{elementInput(e,t){this.onInput(e,t)}elementPaste(e){this.onPaste(e)}elementKeydown(e,t){this.onKeydown(e,t)}elementFocusin(e){this.onFocusIn(e)}elementFocusout(e){this.onFocusOut(e)}constructor(e,t){super(e,t);const n=e.getAttribute("data-hs-pin-input"),i=n?JSON.parse(n):{},s=Object.assign(Object.assign({},i),t);this.items=this.el.querySelectorAll("[data-hs-pin-input-item]"),this.currentItem=null,this.currentValue=new Array(this.items.length).fill(""),this.placeholders=[],this.availableCharsRE=new RegExp((null==s?void 0:s.availableCharsRE)||"^[a-zA-Z0-9]+$"),this.onElementInputListener=[],this.onElementPasteListener=[],this.onElementKeydownListener=[],this.onElementFocusinListener=[],this.onElementFocusoutListener=[],this.init()}init(){this.createCollection(window.$hsPinInputCollection,this),this.items.length&&this.build()}build(){this.buildInputItems()}buildInputItems(){this.items.forEach((e,t)=>{this.placeholders.push(e.getAttribute("placeholder")||""),e.hasAttribute("autofocus")&&this.onFocusIn(t),this.onElementInputListener.push({el:e,fn:e=>this.elementInput(e,t)}),this.onElementPasteListener.push({el:e,fn:e=>this.elementPaste(e)}),this.onElementKeydownListener.push({el:e,fn:e=>this.elementKeydown(e,t)}),this.onElementFocusinListener.push({el:e,fn:()=>this.elementFocusin(t)}),this.onElementFocusoutListener.push({el:e,fn:()=>this.elementFocusout(t)}),e.addEventListener("input",this.onElementInputListener.find(t=>t.el===e).fn),e.addEventListener("paste",this.onElementPasteListener.find(t=>t.el===e).fn),e.addEventListener("keydown",this.onElementKeydownListener.find(t=>t.el===e).fn),e.addEventListener("focusin",this.onElementFocusinListener.find(t=>t.el===e).fn),e.addEventListener("focusout",this.onElementFocusoutListener.find(t=>t.el===e).fn)})}checkIfNumber(e){return e.match(this.availableCharsRE)}autoFillAll(e){Array.from(e).forEach((e,t)=>{if(!(null==this?void 0:this.items[t]))return!1;this.items[t].value=e,this.items[t].dispatchEvent(new Event("input",{bubbles:!0}))})}setCurrentValue(){this.currentValue=Array.from(this.items).map(e=>e.value)}toggleCompleted(){this.currentValue.includes("")?this.el.classList.remove("active"):this.el.classList.add("active")}onInput(e,t){const n=e.target.value;if(this.currentItem=e.target,this.currentItem.value="",this.currentItem.value=n[n.length-1],!this.checkIfNumber(this.currentItem.value))return this.currentItem.value=this.currentValue[t]||"",!1;if(this.setCurrentValue(),this.currentItem.value){if(t<this.items.length-1&&this.items[t+1].focus(),!this.currentValue.includes("")){const e={currentValue:this.currentValue};this.fireEvent("completed",e),(0,s.dispatch)("completed.hs.pinInput",this.el,e)}this.toggleCompleted()}else t>0&&this.items[t-1].focus()}onKeydown(e,t){"Backspace"===e.key&&t>0&&(""===this.items[t].value?(this.items[t-1].value="",this.items[t-1].focus()):this.items[t].value=""),this.setCurrentValue(),this.toggleCompleted()}onFocusIn(e){this.items[e].setAttribute("placeholder","")}onFocusOut(e){this.items[e].setAttribute("placeholder",this.placeholders[e])}onPaste(e){e.preventDefault(),this.items.forEach(t=>{document.activeElement===t&&this.autoFillAll(e.clipboardData.getData("text"))})}destroy(){this.el.classList.remove("active"),this.items.length&&this.items.forEach(e=>{e.removeEventListener("input",this.onElementInputListener.find(t=>t.el===e).fn),e.removeEventListener("paste",this.onElementPasteListener.find(t=>t.el===e).fn),e.removeEventListener("keydown",this.onElementKeydownListener.find(t=>t.el===e).fn),e.removeEventListener("focusin",this.onElementFocusinListener.find(t=>t.el===e).fn),e.removeEventListener("focusout",this.onElementFocusoutListener.find(t=>t.el===e).fn)}),this.items=null,this.currentItem=null,this.currentValue=null,window.$hsPinInputCollection=window.$hsPinInputCollection.filter(({element:e})=>e.el!==this.el)}static getInstance(e,t){const n=window.$hsPinInputCollection.find(t=>t.element.el===("string"==typeof e?document.querySelector(e):e));return n?t?n:n.element:null}static autoInit(){window.$hsPinInputCollection||(window.$hsPinInputCollection=[]),window.$hsPinInputCollection&&(window.$hsPinInputCollection=window.$hsPinInputCollection.filter(({element:e})=>document.contains(e.el))),document.querySelectorAll("[data-hs-pin-input]:not(.--prevent-on-load-init)").forEach(e=>{window.$hsPinInputCollection.find(t=>{var n;return(null===(n=null==t?void 0:t.element)||void 0===n?void 0:n.el)===e})||new l(e)})}}t.default=l},292(e,t){
17
18
  /*
18
- * HSPinInput
19
- * @version: 4.1.2
19
+ * @version: 4.2.0
20
20
  * @author: Preline Labs Ltd.
21
21
  * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html)
22
22
  * Copyright 2024 Preline Labs Ltd.
23
23
  */
24
- var i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const s=n(292),o=i(n(2961));class l extends o.default{elementInput(e,t){this.onInput(e,t)}elementPaste(e){this.onPaste(e)}elementKeydown(e,t){this.onKeydown(e,t)}elementFocusin(e){this.onFocusIn(e)}elementFocusout(e){this.onFocusOut(e)}constructor(e,t){super(e,t);const n=e.getAttribute("data-hs-pin-input"),i=n?JSON.parse(n):{},s=Object.assign(Object.assign({},i),t);this.items=this.el.querySelectorAll("[data-hs-pin-input-item]"),this.currentItem=null,this.currentValue=new Array(this.items.length).fill(""),this.placeholders=[],this.availableCharsRE=new RegExp((null==s?void 0:s.availableCharsRE)||"^[a-zA-Z0-9]+$"),this.onElementInputListener=[],this.onElementPasteListener=[],this.onElementKeydownListener=[],this.onElementFocusinListener=[],this.onElementFocusoutListener=[],this.init()}init(){this.createCollection(window.$hsPinInputCollection,this),this.items.length&&this.build()}build(){this.buildInputItems()}buildInputItems(){this.items.forEach(((e,t)=>{this.placeholders.push(e.getAttribute("placeholder")||""),e.hasAttribute("autofocus")&&this.onFocusIn(t),this.onElementInputListener.push({el:e,fn:e=>this.elementInput(e,t)}),this.onElementPasteListener.push({el:e,fn:e=>this.elementPaste(e)}),this.onElementKeydownListener.push({el:e,fn:e=>this.elementKeydown(e,t)}),this.onElementFocusinListener.push({el:e,fn:()=>this.elementFocusin(t)}),this.onElementFocusoutListener.push({el:e,fn:()=>this.elementFocusout(t)}),e.addEventListener("input",this.onElementInputListener.find((t=>t.el===e)).fn),e.addEventListener("paste",this.onElementPasteListener.find((t=>t.el===e)).fn),e.addEventListener("keydown",this.onElementKeydownListener.find((t=>t.el===e)).fn),e.addEventListener("focusin",this.onElementFocusinListener.find((t=>t.el===e)).fn),e.addEventListener("focusout",this.onElementFocusoutListener.find((t=>t.el===e)).fn)}))}checkIfNumber(e){return e.match(this.availableCharsRE)}autoFillAll(e){Array.from(e).forEach(((e,t)=>{if(!(null==this?void 0:this.items[t]))return!1;this.items[t].value=e,this.items[t].dispatchEvent(new Event("input",{bubbles:!0}))}))}setCurrentValue(){this.currentValue=Array.from(this.items).map((e=>e.value))}toggleCompleted(){this.currentValue.includes("")?this.el.classList.remove("active"):this.el.classList.add("active")}onInput(e,t){const n=e.target.value;if(this.currentItem=e.target,this.currentItem.value="",this.currentItem.value=n[n.length-1],!this.checkIfNumber(this.currentItem.value))return this.currentItem.value=this.currentValue[t]||"",!1;if(this.setCurrentValue(),this.currentItem.value){if(t<this.items.length-1&&this.items[t+1].focus(),!this.currentValue.includes("")){const e={currentValue:this.currentValue};this.fireEvent("completed",e),(0,s.dispatch)("completed.hs.pinInput",this.el,e)}this.toggleCompleted()}else t>0&&this.items[t-1].focus()}onKeydown(e,t){"Backspace"===e.key&&t>0&&(""===this.items[t].value?(this.items[t-1].value="",this.items[t-1].focus()):this.items[t].value=""),this.setCurrentValue(),this.toggleCompleted()}onFocusIn(e){this.items[e].setAttribute("placeholder","")}onFocusOut(e){this.items[e].setAttribute("placeholder",this.placeholders[e])}onPaste(e){e.preventDefault(),this.items.forEach((t=>{document.activeElement===t&&this.autoFillAll(e.clipboardData.getData("text"))}))}destroy(){this.el.classList.remove("active"),this.items.length&&this.items.forEach((e=>{e.removeEventListener("input",this.onElementInputListener.find((t=>t.el===e)).fn),e.removeEventListener("paste",this.onElementPasteListener.find((t=>t.el===e)).fn),e.removeEventListener("keydown",this.onElementKeydownListener.find((t=>t.el===e)).fn),e.removeEventListener("focusin",this.onElementFocusinListener.find((t=>t.el===e)).fn),e.removeEventListener("focusout",this.onElementFocusoutListener.find((t=>t.el===e)).fn)})),this.items=null,this.currentItem=null,this.currentValue=null,window.$hsPinInputCollection=window.$hsPinInputCollection.filter((({element:e})=>e.el!==this.el))}static getInstance(e,t){const n=window.$hsPinInputCollection.find((t=>t.element.el===("string"==typeof e?document.querySelector(e):e)));return n?t?n:n.element:null}static autoInit(){window.$hsPinInputCollection||(window.$hsPinInputCollection=[]),window.$hsPinInputCollection&&(window.$hsPinInputCollection=window.$hsPinInputCollection.filter((({element:e})=>document.contains(e.el)))),document.querySelectorAll("[data-hs-pin-input]:not(.--prevent-on-load-init)").forEach((e=>{window.$hsPinInputCollection.find((t=>{var n;return(null===(n=null==t?void 0:t.element)||void 0===n?void 0:n.el)===e}))||new l(e)}))}}t.default=l}},t={};var n=function n(i){var s=t[i];if(void 0!==s)return s.exports;var o=t[i]={exports:{}};return e[i].call(o.exports,o,o.exports,n),o.exports}(4061);return n})()));
24
+ Object.defineProperty(t,"__esModule",{value:!0}),t.stringToBoolean=t.menuSearchHistory=t.isScrollable=t.isParentOrElementHidden=t.isJson=t.isIpadOS=t.isIOS=t.isFormElement=t.isFocused=t.isEnoughSpace=t.isDirectChild=t.htmlToElement=t.getZIndex=t.getHighestZIndex=t.getClassPropertyAlt=t.getClassProperty=t.dispatch=t.debounce=t.classToClassList=t.afterTransition=void 0;t.stringToBoolean=e=>"true"===e;t.getClassProperty=(e,t,n="")=>(window.getComputedStyle(e).getPropertyValue(t)||n).replace(" ","");t.getClassPropertyAlt=(e,t,n="")=>{let i="";return e.classList.forEach(e=>{e.includes(t)&&(i=e)}),i.match(/:(.*)]/)?i.match(/:(.*)]/)[1]:n};const n=e=>window.getComputedStyle(e).getPropertyValue("z-index");t.getZIndex=n;t.getHighestZIndex=e=>{let t=Number.NEGATIVE_INFINITY;return e.forEach(e=>{let i=n(e);"auto"!==i&&(i=parseInt(i,10),i>t&&(t=i))}),t};t.isDirectChild=(e,t)=>{const n=e.children;for(let e=0;e<n.length;e++)if(n[e]===t)return!0;return!1};t.isEnoughSpace=(e,t,n="auto",i=10,s=null)=>{const o=t.getBoundingClientRect(),l=s?s.getBoundingClientRect():null,r=window.innerHeight,u=l?o.top-l.top:o.top,a=(s?l.bottom:r)-o.bottom,c=e.clientHeight+i;return"bottom"===n?a>=c:"top"===n?u>=c:u>=c||a>=c};t.isFocused=e=>document.activeElement===e;t.isFormElement=e=>e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement||e instanceof HTMLSelectElement;t.isIOS=()=>!!/iPad|iPhone|iPod/.test(navigator.platform)||navigator.maxTouchPoints&&navigator.maxTouchPoints>2&&/MacIntel/.test(navigator.platform);t.isIpadOS=()=>navigator.maxTouchPoints&&navigator.maxTouchPoints>2&&/MacIntel/.test(navigator.platform);t.isJson=e=>{if("string"!=typeof e)return!1;const t=e.trim()[0],n=e.trim().slice(-1);if("{"===t&&"}"===n||"["===t&&"]"===n)try{return JSON.parse(e),!0}catch(e){return!1}return!1};const i=e=>{if(!e)return!1;return"none"===window.getComputedStyle(e).display||i(e.parentElement)};t.isParentOrElementHidden=i;t.isScrollable=e=>{const t=window.getComputedStyle(e),n=t.overflowY,i=t.overflowX,s=("scroll"===n||"auto"===n)&&e.scrollHeight>e.clientHeight,o=("scroll"===i||"auto"===i)&&e.scrollWidth>e.clientWidth;return s||o};t.debounce=(e,t=200)=>{let n;return(...i)=>{clearTimeout(n),n=setTimeout(()=>{e.apply(this,i)},t)}};t.dispatch=(e,t,n=null)=>{const i=new CustomEvent(e,{detail:{payload:n},bubbles:!0,cancelable:!0,composed:!1});t.dispatchEvent(i)};t.afterTransition=(e,t)=>{const n=()=>{t(),e.removeEventListener("transitionend",n,!0)},i=window.getComputedStyle(e),s=i.getPropertyValue("transition-duration");"none"!==i.getPropertyValue("transition-property")&&parseFloat(s)>0?e.addEventListener("transitionend",n,!0):t()};t.htmlToElement=e=>{const t=document.createElement("template");return e=e.trim(),t.innerHTML=e,t.content.firstChild};t.classToClassList=(e,t,n=" ",i="add")=>{e.split(n).forEach(e=>{e.trim()&&("add"===i?t.classList.add(e):t.classList.remove(e))})};const s={historyIndex:-1,addHistory(e){this.historyIndex=e},existsInHistory(e){return e>this.historyIndex},clearHistory(){this.historyIndex=-1}};t.menuSearchHistory=s}},t={};var n=function n(i){var s=t[i];if(void 0!==s)return s.exports;var o=t[i]={exports:{}};return e[i].call(o.exports,o,o.exports,n),o.exports}(4229);return n})());
package/index.mjs CHANGED
@@ -1,24 +1,24 @@
1
- var e={615:(e,t,n)=>{n.d(t,{A:()=>i});
1
+ var e={7615(e,t,n){n.d(t,{A:()=>i});
2
2
  /*
3
3
  * HSBasePlugin
4
- * @version: 4.1.2
4
+ * @version: 4.2.0
5
5
  * @author: Preline Labs Ltd.
6
6
  * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html)
7
7
  * Copyright 2024 Preline Labs Ltd.
8
8
  */
9
- class i{constructor(e,t,n){this.el=e,this.options=t,this.events=n,this.el=e,this.options=t,this.events={}}createCollection(e,t){var n,i;let s=e;if(!Array.isArray(s)&&"undefined"!=typeof window){const e=null===(n=this.constructor)||void 0===n?void 0:n.name,t="string"==typeof e&&e.startsWith("HS")?`$hs${e.slice(2)}Collection`:null;t&&(Array.isArray(window[t])||(window[t]=[]),s=window[t])}Array.isArray(s)&&s.push({id:(null===(i=null==t?void 0:t.el)||void 0===i?void 0:i.id)||s.length+1,element:t})}fireEvent(e,t=null){if(this.events.hasOwnProperty(e))return this.events[e](t)}on(e,t){this.events[e]=t}}},926:(e,t,n)=>{n.d(t,{JD:()=>i});
9
+ class i{constructor(e,t,n){this.el=e,this.options=t,this.events=n,this.el=e,this.options=t,this.events={}}createCollection(e,t){var n,i;let s=e;if(!Array.isArray(s)&&"undefined"!=typeof window){const e=null===(n=this.constructor)||void 0===n?void 0:n.name,t="string"==typeof e&&e.startsWith("HS")?`$hs${e.slice(2)}Collection`:null;t&&(Array.isArray(window[t])||(window[t]=[]),s=window[t])}Array.isArray(s)&&s.push({id:(null===(i=null==t?void 0:t.el)||void 0===i?void 0:i.id)||s.length+1,element:t})}fireEvent(e,t=null){if(this.events.hasOwnProperty(e))return this.events[e](t)}on(e,t){this.events[e]=t}}},1159(e,t,n){n.d(t,{A:()=>o});var i=n(1926),s=n(7615);
10
10
  /*
11
- * @version: 4.1.2
11
+ * HSPinInput
12
+ * @version: 4.2.0
12
13
  * @author: Preline Labs Ltd.
13
14
  * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html)
14
15
  * Copyright 2024 Preline Labs Ltd.
15
16
  */
16
- const i=(e,t,n=null)=>{const i=new CustomEvent(e,{detail:{payload:n},bubbles:!0,cancelable:!0,composed:!1});t.dispatchEvent(i)}}},t={};function n(i){var s=t[i];if(void 0!==s)return s.exports;var l=t[i]={exports:{}};return e[i](l,l.exports,n),l.exports}n.d=(e,t)=>{for(var i in t)n.o(t,i)&&!n.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var i={};n.d(i,{A:()=>r});var s=n(926),l=n(615);
17
+ class l extends s.A{elementInput(e,t){this.onInput(e,t)}elementPaste(e){this.onPaste(e)}elementKeydown(e,t){this.onKeydown(e,t)}elementFocusin(e){this.onFocusIn(e)}elementFocusout(e){this.onFocusOut(e)}constructor(e,t){super(e,t);const n=e.getAttribute("data-hs-pin-input"),i=n?JSON.parse(n):{},s=Object.assign(Object.assign({},i),t);this.items=this.el.querySelectorAll("[data-hs-pin-input-item]"),this.currentItem=null,this.currentValue=new Array(this.items.length).fill(""),this.placeholders=[],this.availableCharsRE=new RegExp((null==s?void 0:s.availableCharsRE)||"^[a-zA-Z0-9]+$"),this.onElementInputListener=[],this.onElementPasteListener=[],this.onElementKeydownListener=[],this.onElementFocusinListener=[],this.onElementFocusoutListener=[],this.init()}init(){this.createCollection(window.$hsPinInputCollection,this),this.items.length&&this.build()}build(){this.buildInputItems()}buildInputItems(){this.items.forEach((e,t)=>{this.placeholders.push(e.getAttribute("placeholder")||""),e.hasAttribute("autofocus")&&this.onFocusIn(t),this.onElementInputListener.push({el:e,fn:e=>this.elementInput(e,t)}),this.onElementPasteListener.push({el:e,fn:e=>this.elementPaste(e)}),this.onElementKeydownListener.push({el:e,fn:e=>this.elementKeydown(e,t)}),this.onElementFocusinListener.push({el:e,fn:()=>this.elementFocusin(t)}),this.onElementFocusoutListener.push({el:e,fn:()=>this.elementFocusout(t)}),e.addEventListener("input",this.onElementInputListener.find(t=>t.el===e).fn),e.addEventListener("paste",this.onElementPasteListener.find(t=>t.el===e).fn),e.addEventListener("keydown",this.onElementKeydownListener.find(t=>t.el===e).fn),e.addEventListener("focusin",this.onElementFocusinListener.find(t=>t.el===e).fn),e.addEventListener("focusout",this.onElementFocusoutListener.find(t=>t.el===e).fn)})}checkIfNumber(e){return e.match(this.availableCharsRE)}autoFillAll(e){Array.from(e).forEach((e,t)=>{if(!(null==this?void 0:this.items[t]))return!1;this.items[t].value=e,this.items[t].dispatchEvent(new Event("input",{bubbles:!0}))})}setCurrentValue(){this.currentValue=Array.from(this.items).map(e=>e.value)}toggleCompleted(){this.currentValue.includes("")?this.el.classList.remove("active"):this.el.classList.add("active")}onInput(e,t){const n=e.target.value;if(this.currentItem=e.target,this.currentItem.value="",this.currentItem.value=n[n.length-1],!this.checkIfNumber(this.currentItem.value))return this.currentItem.value=this.currentValue[t]||"",!1;if(this.setCurrentValue(),this.currentItem.value){if(t<this.items.length-1&&this.items[t+1].focus(),!this.currentValue.includes("")){const e={currentValue:this.currentValue};this.fireEvent("completed",e),(0,i.JD)("completed.hs.pinInput",this.el,e)}this.toggleCompleted()}else t>0&&this.items[t-1].focus()}onKeydown(e,t){"Backspace"===e.key&&t>0&&(""===this.items[t].value?(this.items[t-1].value="",this.items[t-1].focus()):this.items[t].value=""),this.setCurrentValue(),this.toggleCompleted()}onFocusIn(e){this.items[e].setAttribute("placeholder","")}onFocusOut(e){this.items[e].setAttribute("placeholder",this.placeholders[e])}onPaste(e){e.preventDefault(),this.items.forEach(t=>{document.activeElement===t&&this.autoFillAll(e.clipboardData.getData("text"))})}destroy(){this.el.classList.remove("active"),this.items.length&&this.items.forEach(e=>{e.removeEventListener("input",this.onElementInputListener.find(t=>t.el===e).fn),e.removeEventListener("paste",this.onElementPasteListener.find(t=>t.el===e).fn),e.removeEventListener("keydown",this.onElementKeydownListener.find(t=>t.el===e).fn),e.removeEventListener("focusin",this.onElementFocusinListener.find(t=>t.el===e).fn),e.removeEventListener("focusout",this.onElementFocusoutListener.find(t=>t.el===e).fn)}),this.items=null,this.currentItem=null,this.currentValue=null,window.$hsPinInputCollection=window.$hsPinInputCollection.filter(({element:e})=>e.el!==this.el)}static getInstance(e,t){const n=window.$hsPinInputCollection.find(t=>t.element.el===("string"==typeof e?document.querySelector(e):e));return n?t?n:n.element:null}static autoInit(){window.$hsPinInputCollection||(window.$hsPinInputCollection=[]),window.$hsPinInputCollection&&(window.$hsPinInputCollection=window.$hsPinInputCollection.filter(({element:e})=>document.contains(e.el))),document.querySelectorAll("[data-hs-pin-input]:not(.--prevent-on-load-init)").forEach(e=>{window.$hsPinInputCollection.find(t=>{var n;return(null===(n=null==t?void 0:t.element)||void 0===n?void 0:n.el)===e})||new l(e)})}}const o=l},1926(e,t,n){n.d(t,{JD:()=>i});
17
18
  /*
18
- * HSPinInput
19
- * @version: 4.1.2
19
+ * @version: 4.2.0
20
20
  * @author: Preline Labs Ltd.
21
21
  * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html)
22
22
  * Copyright 2024 Preline Labs Ltd.
23
23
  */
24
- class o extends l.A{elementInput(e,t){this.onInput(e,t)}elementPaste(e){this.onPaste(e)}elementKeydown(e,t){this.onKeydown(e,t)}elementFocusin(e){this.onFocusIn(e)}elementFocusout(e){this.onFocusOut(e)}constructor(e,t){super(e,t);const n=e.getAttribute("data-hs-pin-input"),i=n?JSON.parse(n):{},s=Object.assign(Object.assign({},i),t);this.items=this.el.querySelectorAll("[data-hs-pin-input-item]"),this.currentItem=null,this.currentValue=new Array(this.items.length).fill(""),this.placeholders=[],this.availableCharsRE=new RegExp((null==s?void 0:s.availableCharsRE)||"^[a-zA-Z0-9]+$"),this.onElementInputListener=[],this.onElementPasteListener=[],this.onElementKeydownListener=[],this.onElementFocusinListener=[],this.onElementFocusoutListener=[],this.init()}init(){this.createCollection(window.$hsPinInputCollection,this),this.items.length&&this.build()}build(){this.buildInputItems()}buildInputItems(){this.items.forEach(((e,t)=>{this.placeholders.push(e.getAttribute("placeholder")||""),e.hasAttribute("autofocus")&&this.onFocusIn(t),this.onElementInputListener.push({el:e,fn:e=>this.elementInput(e,t)}),this.onElementPasteListener.push({el:e,fn:e=>this.elementPaste(e)}),this.onElementKeydownListener.push({el:e,fn:e=>this.elementKeydown(e,t)}),this.onElementFocusinListener.push({el:e,fn:()=>this.elementFocusin(t)}),this.onElementFocusoutListener.push({el:e,fn:()=>this.elementFocusout(t)}),e.addEventListener("input",this.onElementInputListener.find((t=>t.el===e)).fn),e.addEventListener("paste",this.onElementPasteListener.find((t=>t.el===e)).fn),e.addEventListener("keydown",this.onElementKeydownListener.find((t=>t.el===e)).fn),e.addEventListener("focusin",this.onElementFocusinListener.find((t=>t.el===e)).fn),e.addEventListener("focusout",this.onElementFocusoutListener.find((t=>t.el===e)).fn)}))}checkIfNumber(e){return e.match(this.availableCharsRE)}autoFillAll(e){Array.from(e).forEach(((e,t)=>{if(!(null==this?void 0:this.items[t]))return!1;this.items[t].value=e,this.items[t].dispatchEvent(new Event("input",{bubbles:!0}))}))}setCurrentValue(){this.currentValue=Array.from(this.items).map((e=>e.value))}toggleCompleted(){this.currentValue.includes("")?this.el.classList.remove("active"):this.el.classList.add("active")}onInput(e,t){const n=e.target.value;if(this.currentItem=e.target,this.currentItem.value="",this.currentItem.value=n[n.length-1],!this.checkIfNumber(this.currentItem.value))return this.currentItem.value=this.currentValue[t]||"",!1;if(this.setCurrentValue(),this.currentItem.value){if(t<this.items.length-1&&this.items[t+1].focus(),!this.currentValue.includes("")){const e={currentValue:this.currentValue};this.fireEvent("completed",e),(0,s.JD)("completed.hs.pinInput",this.el,e)}this.toggleCompleted()}else t>0&&this.items[t-1].focus()}onKeydown(e,t){"Backspace"===e.key&&t>0&&(""===this.items[t].value?(this.items[t-1].value="",this.items[t-1].focus()):this.items[t].value=""),this.setCurrentValue(),this.toggleCompleted()}onFocusIn(e){this.items[e].setAttribute("placeholder","")}onFocusOut(e){this.items[e].setAttribute("placeholder",this.placeholders[e])}onPaste(e){e.preventDefault(),this.items.forEach((t=>{document.activeElement===t&&this.autoFillAll(e.clipboardData.getData("text"))}))}destroy(){this.el.classList.remove("active"),this.items.length&&this.items.forEach((e=>{e.removeEventListener("input",this.onElementInputListener.find((t=>t.el===e)).fn),e.removeEventListener("paste",this.onElementPasteListener.find((t=>t.el===e)).fn),e.removeEventListener("keydown",this.onElementKeydownListener.find((t=>t.el===e)).fn),e.removeEventListener("focusin",this.onElementFocusinListener.find((t=>t.el===e)).fn),e.removeEventListener("focusout",this.onElementFocusoutListener.find((t=>t.el===e)).fn)})),this.items=null,this.currentItem=null,this.currentValue=null,window.$hsPinInputCollection=window.$hsPinInputCollection.filter((({element:e})=>e.el!==this.el))}static getInstance(e,t){const n=window.$hsPinInputCollection.find((t=>t.element.el===("string"==typeof e?document.querySelector(e):e)));return n?t?n:n.element:null}static autoInit(){window.$hsPinInputCollection||(window.$hsPinInputCollection=[]),window.$hsPinInputCollection&&(window.$hsPinInputCollection=window.$hsPinInputCollection.filter((({element:e})=>document.contains(e.el)))),document.querySelectorAll("[data-hs-pin-input]:not(.--prevent-on-load-init)").forEach((e=>{window.$hsPinInputCollection.find((t=>{var n;return(null===(n=null==t?void 0:t.element)||void 0===n?void 0:n.el)===e}))||new o(e)}))}}const r=o;var u=i.A;export{u as default};
24
+ const i=(e,t,n=null)=>{const i=new CustomEvent(e,{detail:{payload:n},bubbles:!0,cancelable:!0,composed:!1});t.dispatchEvent(i)}}},t={};function n(i){var s=t[i];if(void 0!==s)return s.exports;var l=t[i]={exports:{}};return e[i](l,l.exports,n),l.exports}n.d=(e,t)=>{for(var i in t)n.o(t,i)&&!n.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var i=n(1159);window.addEventListener("load",()=>{i.A.autoInit()}),"undefined"!=typeof window&&(window.HSPinInput=i.A);
package/non-auto.js ADDED
@@ -0,0 +1,24 @@
1
+ !function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var n=t();for(var i in n)("object"==typeof exports?exports:e)[i]=n[i]}}(self,()=>(()=>{"use strict";var e={2961(e,t){
2
+ /*
3
+ * HSBasePlugin
4
+ * @version: 4.2.0
5
+ * @author: Preline Labs Ltd.
6
+ * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html)
7
+ * Copyright 2024 Preline Labs Ltd.
8
+ */
9
+ Object.defineProperty(t,"__esModule",{value:!0});t.default=class{constructor(e,t,n){this.el=e,this.options=t,this.events=n,this.el=e,this.options=t,this.events={}}createCollection(e,t){var n,i;let s=e;if(!Array.isArray(s)&&"undefined"!=typeof window){const e=null===(n=this.constructor)||void 0===n?void 0:n.name,t="string"==typeof e&&e.startsWith("HS")?`$hs${e.slice(2)}Collection`:null;t&&(Array.isArray(window[t])||(window[t]=[]),s=window[t])}Array.isArray(s)&&s.push({id:(null===(i=null==t?void 0:t.el)||void 0===i?void 0:i.id)||s.length+1,element:t})}fireEvent(e,t=null){if(this.events.hasOwnProperty(e))return this.events[e](t)}on(e,t){this.events[e]=t}}},4061(e,t,n){
10
+ /*
11
+ * HSPinInput
12
+ * @version: 4.2.0
13
+ * @author: Preline Labs Ltd.
14
+ * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html)
15
+ * Copyright 2024 Preline Labs Ltd.
16
+ */
17
+ var i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const s=n(292),o=i(n(2961));class l extends o.default{elementInput(e,t){this.onInput(e,t)}elementPaste(e){this.onPaste(e)}elementKeydown(e,t){this.onKeydown(e,t)}elementFocusin(e){this.onFocusIn(e)}elementFocusout(e){this.onFocusOut(e)}constructor(e,t){super(e,t);const n=e.getAttribute("data-hs-pin-input"),i=n?JSON.parse(n):{},s=Object.assign(Object.assign({},i),t);this.items=this.el.querySelectorAll("[data-hs-pin-input-item]"),this.currentItem=null,this.currentValue=new Array(this.items.length).fill(""),this.placeholders=[],this.availableCharsRE=new RegExp((null==s?void 0:s.availableCharsRE)||"^[a-zA-Z0-9]+$"),this.onElementInputListener=[],this.onElementPasteListener=[],this.onElementKeydownListener=[],this.onElementFocusinListener=[],this.onElementFocusoutListener=[],this.init()}init(){this.createCollection(window.$hsPinInputCollection,this),this.items.length&&this.build()}build(){this.buildInputItems()}buildInputItems(){this.items.forEach((e,t)=>{this.placeholders.push(e.getAttribute("placeholder")||""),e.hasAttribute("autofocus")&&this.onFocusIn(t),this.onElementInputListener.push({el:e,fn:e=>this.elementInput(e,t)}),this.onElementPasteListener.push({el:e,fn:e=>this.elementPaste(e)}),this.onElementKeydownListener.push({el:e,fn:e=>this.elementKeydown(e,t)}),this.onElementFocusinListener.push({el:e,fn:()=>this.elementFocusin(t)}),this.onElementFocusoutListener.push({el:e,fn:()=>this.elementFocusout(t)}),e.addEventListener("input",this.onElementInputListener.find(t=>t.el===e).fn),e.addEventListener("paste",this.onElementPasteListener.find(t=>t.el===e).fn),e.addEventListener("keydown",this.onElementKeydownListener.find(t=>t.el===e).fn),e.addEventListener("focusin",this.onElementFocusinListener.find(t=>t.el===e).fn),e.addEventListener("focusout",this.onElementFocusoutListener.find(t=>t.el===e).fn)})}checkIfNumber(e){return e.match(this.availableCharsRE)}autoFillAll(e){Array.from(e).forEach((e,t)=>{if(!(null==this?void 0:this.items[t]))return!1;this.items[t].value=e,this.items[t].dispatchEvent(new Event("input",{bubbles:!0}))})}setCurrentValue(){this.currentValue=Array.from(this.items).map(e=>e.value)}toggleCompleted(){this.currentValue.includes("")?this.el.classList.remove("active"):this.el.classList.add("active")}onInput(e,t){const n=e.target.value;if(this.currentItem=e.target,this.currentItem.value="",this.currentItem.value=n[n.length-1],!this.checkIfNumber(this.currentItem.value))return this.currentItem.value=this.currentValue[t]||"",!1;if(this.setCurrentValue(),this.currentItem.value){if(t<this.items.length-1&&this.items[t+1].focus(),!this.currentValue.includes("")){const e={currentValue:this.currentValue};this.fireEvent("completed",e),(0,s.dispatch)("completed.hs.pinInput",this.el,e)}this.toggleCompleted()}else t>0&&this.items[t-1].focus()}onKeydown(e,t){"Backspace"===e.key&&t>0&&(""===this.items[t].value?(this.items[t-1].value="",this.items[t-1].focus()):this.items[t].value=""),this.setCurrentValue(),this.toggleCompleted()}onFocusIn(e){this.items[e].setAttribute("placeholder","")}onFocusOut(e){this.items[e].setAttribute("placeholder",this.placeholders[e])}onPaste(e){e.preventDefault(),this.items.forEach(t=>{document.activeElement===t&&this.autoFillAll(e.clipboardData.getData("text"))})}destroy(){this.el.classList.remove("active"),this.items.length&&this.items.forEach(e=>{e.removeEventListener("input",this.onElementInputListener.find(t=>t.el===e).fn),e.removeEventListener("paste",this.onElementPasteListener.find(t=>t.el===e).fn),e.removeEventListener("keydown",this.onElementKeydownListener.find(t=>t.el===e).fn),e.removeEventListener("focusin",this.onElementFocusinListener.find(t=>t.el===e).fn),e.removeEventListener("focusout",this.onElementFocusoutListener.find(t=>t.el===e).fn)}),this.items=null,this.currentItem=null,this.currentValue=null,window.$hsPinInputCollection=window.$hsPinInputCollection.filter(({element:e})=>e.el!==this.el)}static getInstance(e,t){const n=window.$hsPinInputCollection.find(t=>t.element.el===("string"==typeof e?document.querySelector(e):e));return n?t?n:n.element:null}static autoInit(){window.$hsPinInputCollection||(window.$hsPinInputCollection=[]),window.$hsPinInputCollection&&(window.$hsPinInputCollection=window.$hsPinInputCollection.filter(({element:e})=>document.contains(e.el))),document.querySelectorAll("[data-hs-pin-input]:not(.--prevent-on-load-init)").forEach(e=>{window.$hsPinInputCollection.find(t=>{var n;return(null===(n=null==t?void 0:t.element)||void 0===n?void 0:n.el)===e})||new l(e)})}}t.default=l},292(e,t){
18
+ /*
19
+ * @version: 4.2.0
20
+ * @author: Preline Labs Ltd.
21
+ * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html)
22
+ * Copyright 2024 Preline Labs Ltd.
23
+ */
24
+ Object.defineProperty(t,"__esModule",{value:!0}),t.stringToBoolean=t.menuSearchHistory=t.isScrollable=t.isParentOrElementHidden=t.isJson=t.isIpadOS=t.isIOS=t.isFormElement=t.isFocused=t.isEnoughSpace=t.isDirectChild=t.htmlToElement=t.getZIndex=t.getHighestZIndex=t.getClassPropertyAlt=t.getClassProperty=t.dispatch=t.debounce=t.classToClassList=t.afterTransition=void 0;t.stringToBoolean=e=>"true"===e;t.getClassProperty=(e,t,n="")=>(window.getComputedStyle(e).getPropertyValue(t)||n).replace(" ","");t.getClassPropertyAlt=(e,t,n="")=>{let i="";return e.classList.forEach(e=>{e.includes(t)&&(i=e)}),i.match(/:(.*)]/)?i.match(/:(.*)]/)[1]:n};const n=e=>window.getComputedStyle(e).getPropertyValue("z-index");t.getZIndex=n;t.getHighestZIndex=e=>{let t=Number.NEGATIVE_INFINITY;return e.forEach(e=>{let i=n(e);"auto"!==i&&(i=parseInt(i,10),i>t&&(t=i))}),t};t.isDirectChild=(e,t)=>{const n=e.children;for(let e=0;e<n.length;e++)if(n[e]===t)return!0;return!1};t.isEnoughSpace=(e,t,n="auto",i=10,s=null)=>{const o=t.getBoundingClientRect(),l=s?s.getBoundingClientRect():null,r=window.innerHeight,u=l?o.top-l.top:o.top,a=(s?l.bottom:r)-o.bottom,c=e.clientHeight+i;return"bottom"===n?a>=c:"top"===n?u>=c:u>=c||a>=c};t.isFocused=e=>document.activeElement===e;t.isFormElement=e=>e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement||e instanceof HTMLSelectElement;t.isIOS=()=>!!/iPad|iPhone|iPod/.test(navigator.platform)||navigator.maxTouchPoints&&navigator.maxTouchPoints>2&&/MacIntel/.test(navigator.platform);t.isIpadOS=()=>navigator.maxTouchPoints&&navigator.maxTouchPoints>2&&/MacIntel/.test(navigator.platform);t.isJson=e=>{if("string"!=typeof e)return!1;const t=e.trim()[0],n=e.trim().slice(-1);if("{"===t&&"}"===n||"["===t&&"]"===n)try{return JSON.parse(e),!0}catch(e){return!1}return!1};const i=e=>{if(!e)return!1;return"none"===window.getComputedStyle(e).display||i(e.parentElement)};t.isParentOrElementHidden=i;t.isScrollable=e=>{const t=window.getComputedStyle(e),n=t.overflowY,i=t.overflowX,s=("scroll"===n||"auto"===n)&&e.scrollHeight>e.clientHeight,o=("scroll"===i||"auto"===i)&&e.scrollWidth>e.clientWidth;return s||o};t.debounce=(e,t=200)=>{let n;return(...i)=>{clearTimeout(n),n=setTimeout(()=>{e.apply(this,i)},t)}};t.dispatch=(e,t,n=null)=>{const i=new CustomEvent(e,{detail:{payload:n},bubbles:!0,cancelable:!0,composed:!1});t.dispatchEvent(i)};t.afterTransition=(e,t)=>{const n=()=>{t(),e.removeEventListener("transitionend",n,!0)},i=window.getComputedStyle(e),s=i.getPropertyValue("transition-duration");"none"!==i.getPropertyValue("transition-property")&&parseFloat(s)>0?e.addEventListener("transitionend",n,!0):t()};t.htmlToElement=e=>{const t=document.createElement("template");return e=e.trim(),t.innerHTML=e,t.content.firstChild};t.classToClassList=(e,t,n=" ",i="add")=>{e.split(n).forEach(e=>{e.trim()&&("add"===i?t.classList.add(e):t.classList.remove(e))})};const s={historyIndex:-1,addHistory(e){this.historyIndex=e},existsInHistory(e){return e>this.historyIndex},clearHistory(){this.historyIndex=-1}};t.menuSearchHistory=s}},t={};var n=function n(i){var s=t[i];if(void 0!==s)return s.exports;var o=t[i]={exports:{}};return e[i].call(o.exports,o,o.exports,n),o.exports}(4061);return n})());
package/non-auto.mjs ADDED
@@ -0,0 +1,24 @@
1
+ var e={7615(e,t,n){n.d(t,{A:()=>i});
2
+ /*
3
+ * HSBasePlugin
4
+ * @version: 4.2.0
5
+ * @author: Preline Labs Ltd.
6
+ * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html)
7
+ * Copyright 2024 Preline Labs Ltd.
8
+ */
9
+ class i{constructor(e,t,n){this.el=e,this.options=t,this.events=n,this.el=e,this.options=t,this.events={}}createCollection(e,t){var n,i;let s=e;if(!Array.isArray(s)&&"undefined"!=typeof window){const e=null===(n=this.constructor)||void 0===n?void 0:n.name,t="string"==typeof e&&e.startsWith("HS")?`$hs${e.slice(2)}Collection`:null;t&&(Array.isArray(window[t])||(window[t]=[]),s=window[t])}Array.isArray(s)&&s.push({id:(null===(i=null==t?void 0:t.el)||void 0===i?void 0:i.id)||s.length+1,element:t})}fireEvent(e,t=null){if(this.events.hasOwnProperty(e))return this.events[e](t)}on(e,t){this.events[e]=t}}},1926(e,t,n){n.d(t,{JD:()=>i});
10
+ /*
11
+ * @version: 4.2.0
12
+ * @author: Preline Labs Ltd.
13
+ * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html)
14
+ * Copyright 2024 Preline Labs Ltd.
15
+ */
16
+ const i=(e,t,n=null)=>{const i=new CustomEvent(e,{detail:{payload:n},bubbles:!0,cancelable:!0,composed:!1});t.dispatchEvent(i)}}},t={};function n(i){var s=t[i];if(void 0!==s)return s.exports;var l=t[i]={exports:{}};return e[i](l,l.exports,n),l.exports}n.d=(e,t)=>{for(var i in t)n.o(t,i)&&!n.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var i={};n.d(i,{A:()=>r});var s=n(1926),l=n(7615);
17
+ /*
18
+ * HSPinInput
19
+ * @version: 4.2.0
20
+ * @author: Preline Labs Ltd.
21
+ * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html)
22
+ * Copyright 2024 Preline Labs Ltd.
23
+ */
24
+ class o extends l.A{elementInput(e,t){this.onInput(e,t)}elementPaste(e){this.onPaste(e)}elementKeydown(e,t){this.onKeydown(e,t)}elementFocusin(e){this.onFocusIn(e)}elementFocusout(e){this.onFocusOut(e)}constructor(e,t){super(e,t);const n=e.getAttribute("data-hs-pin-input"),i=n?JSON.parse(n):{},s=Object.assign(Object.assign({},i),t);this.items=this.el.querySelectorAll("[data-hs-pin-input-item]"),this.currentItem=null,this.currentValue=new Array(this.items.length).fill(""),this.placeholders=[],this.availableCharsRE=new RegExp((null==s?void 0:s.availableCharsRE)||"^[a-zA-Z0-9]+$"),this.onElementInputListener=[],this.onElementPasteListener=[],this.onElementKeydownListener=[],this.onElementFocusinListener=[],this.onElementFocusoutListener=[],this.init()}init(){this.createCollection(window.$hsPinInputCollection,this),this.items.length&&this.build()}build(){this.buildInputItems()}buildInputItems(){this.items.forEach((e,t)=>{this.placeholders.push(e.getAttribute("placeholder")||""),e.hasAttribute("autofocus")&&this.onFocusIn(t),this.onElementInputListener.push({el:e,fn:e=>this.elementInput(e,t)}),this.onElementPasteListener.push({el:e,fn:e=>this.elementPaste(e)}),this.onElementKeydownListener.push({el:e,fn:e=>this.elementKeydown(e,t)}),this.onElementFocusinListener.push({el:e,fn:()=>this.elementFocusin(t)}),this.onElementFocusoutListener.push({el:e,fn:()=>this.elementFocusout(t)}),e.addEventListener("input",this.onElementInputListener.find(t=>t.el===e).fn),e.addEventListener("paste",this.onElementPasteListener.find(t=>t.el===e).fn),e.addEventListener("keydown",this.onElementKeydownListener.find(t=>t.el===e).fn),e.addEventListener("focusin",this.onElementFocusinListener.find(t=>t.el===e).fn),e.addEventListener("focusout",this.onElementFocusoutListener.find(t=>t.el===e).fn)})}checkIfNumber(e){return e.match(this.availableCharsRE)}autoFillAll(e){Array.from(e).forEach((e,t)=>{if(!(null==this?void 0:this.items[t]))return!1;this.items[t].value=e,this.items[t].dispatchEvent(new Event("input",{bubbles:!0}))})}setCurrentValue(){this.currentValue=Array.from(this.items).map(e=>e.value)}toggleCompleted(){this.currentValue.includes("")?this.el.classList.remove("active"):this.el.classList.add("active")}onInput(e,t){const n=e.target.value;if(this.currentItem=e.target,this.currentItem.value="",this.currentItem.value=n[n.length-1],!this.checkIfNumber(this.currentItem.value))return this.currentItem.value=this.currentValue[t]||"",!1;if(this.setCurrentValue(),this.currentItem.value){if(t<this.items.length-1&&this.items[t+1].focus(),!this.currentValue.includes("")){const e={currentValue:this.currentValue};this.fireEvent("completed",e),(0,s.JD)("completed.hs.pinInput",this.el,e)}this.toggleCompleted()}else t>0&&this.items[t-1].focus()}onKeydown(e,t){"Backspace"===e.key&&t>0&&(""===this.items[t].value?(this.items[t-1].value="",this.items[t-1].focus()):this.items[t].value=""),this.setCurrentValue(),this.toggleCompleted()}onFocusIn(e){this.items[e].setAttribute("placeholder","")}onFocusOut(e){this.items[e].setAttribute("placeholder",this.placeholders[e])}onPaste(e){e.preventDefault(),this.items.forEach(t=>{document.activeElement===t&&this.autoFillAll(e.clipboardData.getData("text"))})}destroy(){this.el.classList.remove("active"),this.items.length&&this.items.forEach(e=>{e.removeEventListener("input",this.onElementInputListener.find(t=>t.el===e).fn),e.removeEventListener("paste",this.onElementPasteListener.find(t=>t.el===e).fn),e.removeEventListener("keydown",this.onElementKeydownListener.find(t=>t.el===e).fn),e.removeEventListener("focusin",this.onElementFocusinListener.find(t=>t.el===e).fn),e.removeEventListener("focusout",this.onElementFocusoutListener.find(t=>t.el===e).fn)}),this.items=null,this.currentItem=null,this.currentValue=null,window.$hsPinInputCollection=window.$hsPinInputCollection.filter(({element:e})=>e.el!==this.el)}static getInstance(e,t){const n=window.$hsPinInputCollection.find(t=>t.element.el===("string"==typeof e?document.querySelector(e):e));return n?t?n:n.element:null}static autoInit(){window.$hsPinInputCollection||(window.$hsPinInputCollection=[]),window.$hsPinInputCollection&&(window.$hsPinInputCollection=window.$hsPinInputCollection.filter(({element:e})=>document.contains(e.el))),document.querySelectorAll("[data-hs-pin-input]:not(.--prevent-on-load-init)").forEach(e=>{window.$hsPinInputCollection.find(t=>{var n;return(null===(n=null==t?void 0:t.element)||void 0===n?void 0:n.el)===e})||new o(e)})}}const r=o,u=i.A;export{u as default};
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@preline/pin-input",
3
- "version": "4.1.2",
3
+ "version": "4.2.0",
4
4
  "description": "Preline UI is an open-source set of prebuilt UI components based on the utility-first Tailwind CSS framework.",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
7
7
  "repository": "https://github.com/htmlstreamofficial/preline.git",
8
- "homepage": "https://preline.co/plugins.html",
9
- "keywords": ["preline", "html", "css", "next", "nuxt", "vue", "react", "angular", "javascript", "typescript", "tailwind", "tailwind components", "tailwind elements", "tailwind library", "tailwind sections", "tailwind css", "tailwind ui", "tailwind css react", "tailwind css vue", "tailwind css angular", "tailwind css laravel", "tailwindcss plugin", "tailwindcss plugins", "accordion"],
8
+ "homepage": "https://preline.co/plugins/pin-input.html",
9
+ "keywords": ["preline", "html", "css", "next", "nuxt", "vue", "react", "angular", "javascript", "typescript", "tailwind", "tailwind components", "tailwind elements", "tailwind library", "tailwind sections", "tailwind css", "tailwind ui", "tailwind css react", "tailwind css vue", "tailwind css angular", "tailwind css laravel", "tailwindcss plugin", "tailwindcss plugins", "pin input"],
10
10
  "author": "Preline Labs Ltd.",
11
11
  "license": "Licensed under MIT and Preline UI Fair Use License",
12
12
  "publishConfig": {
package/theme.css ADDED
@@ -0,0 +1,725 @@
1
+ /* ------------------------------ */
2
+ /* ---------- Default ----------- */
3
+ /* ------------------------------ */
4
+
5
+ @layer base {
6
+ * {
7
+ @apply border-border;
8
+ }
9
+ }
10
+
11
+ @theme {
12
+ --radius-full: calc(infinity * 1px);
13
+
14
+ --font-custom-default: var(--font-sans);
15
+ --font-custom-serif: "Domine", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, Noto Sans, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol, Noto Color Emoji;
16
+ --font-custom-mono: "Kode Mono", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, Noto Sans, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol, Noto Color Emoji;
17
+ }
18
+
19
+ @theme inline {
20
+ --color-preline-khaki-50: oklch(98% 0.002 67.8);
21
+ --color-preline-khaki-100: oklch(95.5% 0.004 91.4);
22
+ --color-preline-khaki-200: oklch(89.7% 0.008 91.5);
23
+ --color-preline-khaki-300: oklch(82.7% 0.014 88.7);
24
+ --color-preline-khaki-400: oklch(73% 0.024 87.2);
25
+ --color-preline-khaki-500: oklch(62.5% 0.031 88.8);
26
+ --color-preline-khaki-600: oklch(52.8% 0.031 91);
27
+ --color-preline-khaki-700: oklch(41.4% 0.027 89.9);
28
+ --color-preline-khaki-800: oklch(34.6% 0.023 89.5);
29
+ --color-preline-khaki-900: oklch(30.6% 0.018 88.8);
30
+ --color-preline-khaki-950: oklch(20.1% 0.023 91.7);
31
+
32
+ --color-preline-mauve-50: oklch(98.1% 0.002 345.2);
33
+ --color-preline-mauve-100: oklch(95.6% 0.006 334);
34
+ --color-preline-mauve-200: oklch(89.7% 0.013 337.5);
35
+ --color-preline-mauve-300: oklch(82.4% 0.022 339.7);
36
+ --color-preline-mauve-400: oklch(71.7% 0.038 340.7);
37
+ --color-preline-mauve-500: oklch(55.9% 0.045 341);
38
+ --color-preline-mauve-600: oklch(51.1% 0.047 342.2);
39
+ --color-preline-mauve-700: oklch(45.5% 0.04 342.1);
40
+ --color-preline-mauve-800: oklch(36.4% 0.034 342.3);
41
+ --color-preline-mauve-900: oklch(32.3% 0.029 340.9);
42
+ --color-preline-mauve-950: oklch(21.9% 0.034 341.1);
43
+
44
+ --color-preline-avocado-50: oklch(92.8% 0.012 120);
45
+ --color-preline-avocado-100: oklch(88.6% 0.02 120);
46
+ --color-preline-avocado-200: oklch(80.4% 0.035 120);
47
+ --color-preline-avocado-300: oklch(72.4% 0.055 120);
48
+ --color-preline-avocado-400: oklch(64.6% 0.075 120);
49
+ --color-preline-avocado-500: oklch(57% 0.085 120);
50
+ --color-preline-avocado-600: oklch(49.6% 0.08 120);
51
+ --color-preline-avocado-700: oklch(42.4% 0.07 120);
52
+ --color-preline-avocado-800: oklch(35.4% 0.055 120);
53
+ --color-preline-avocado-900: oklch(28.6% 0.04 120);
54
+ --color-preline-avocado-950: oklch(25.3% 0.03 120);
55
+
56
+ --color-preline-avocado-soft-50: oklch(98% 0.002 120);
57
+ --color-preline-avocado-soft-100: oklch(95.5% 0.004 120);
58
+ --color-preline-avocado-soft-200: oklch(89.7% 0.008 120);
59
+ --color-preline-avocado-soft-300: oklch(82.7% 0.012 120);
60
+ --color-preline-avocado-soft-400: oklch(73% 0.018 120);
61
+ --color-preline-avocado-soft-500: oklch(62.5% 0.02 120);
62
+ --color-preline-avocado-soft-600: oklch(52.8% 0.016 120);
63
+ --color-preline-avocado-soft-700: oklch(41.4% 0.012 120);
64
+ --color-preline-avocado-soft-800: oklch(26.9% 0.006 120);
65
+ --color-preline-avocado-soft-900: oklch(20.5% 0.004 120);
66
+ --color-preline-avocado-soft-950: oklch(14.1% 0.002 120);
67
+
68
+ --color-background: var(--background);
69
+ --color-background-1: var(--background-1);
70
+ --color-background-2: var(--background-2);
71
+ --color-plain: var(--background-plain);
72
+ --color-foreground: var(--foreground);
73
+ --color-foreground-inverse: var(--foreground-inverse);
74
+
75
+ --color-inverse: var(--inverse);
76
+
77
+ --color-border: var(--border);
78
+ --color-line-inverse: var(--border-line-inverse);
79
+ --color-line-1: var(--border-line-1);
80
+ --color-line-2: var(--border-line-2);
81
+ --color-line-3: var(--border-line-3);
82
+ --color-line-4: var(--border-line-4);
83
+ --color-line-5: var(--border-line-5);
84
+ --color-line-6: var(--border-line-6);
85
+ --color-line-7: var(--border-line-7);
86
+ --color-line-8: var(--border-line-8);
87
+
88
+ --color-primary-50: var(--primary-50);
89
+ --color-primary-100: var(--primary-100);
90
+ --color-primary-200: var(--primary-200);
91
+ --color-primary-300: var(--primary-300);
92
+ --color-primary-400: var(--primary-400);
93
+ --color-primary-500: var(--primary-500);
94
+ --color-primary-600: var(--primary-600);
95
+ --color-primary-700: var(--primary-700);
96
+ --color-primary-800: var(--primary-800);
97
+ --color-primary-900: var(--primary-900);
98
+ --color-primary-950: var(--primary-950);
99
+
100
+ --color-primary: var(--primary);
101
+ --color-primary-line: var(--primary-line);
102
+ --color-primary-foreground: var(--primary-foreground);
103
+ --color-primary-hover: var(--primary-hover);
104
+ --color-primary-focus: var(--primary-focus);
105
+ --color-primary-active: var(--primary-active);
106
+ --color-primary-checked: var(--primary-checked);
107
+
108
+ --color-secondary: var(--secondary);
109
+ --color-secondary-line: var(--secondary-line);
110
+ --color-secondary-foreground: var(--secondary-foreground);
111
+ --color-secondary-hover: var(--secondary-hover);
112
+ --color-secondary-focus: var(--secondary-focus);
113
+ --color-secondary-active: var(--secondary-active);
114
+
115
+ --color-layer: var(--layer);
116
+ --color-layer-line: var(--layer-line);
117
+ --color-layer-foreground: var(--layer-foreground);
118
+ --color-layer-hover: var(--layer-hover);
119
+ --color-layer-focus: var(--layer-focus);
120
+ --color-layer-active: var(--layer-active);
121
+
122
+ --color-surface: var(--surface);
123
+ --color-surface-1: var(--surface-1);
124
+ --color-surface-2: var(--surface-2);
125
+ --color-surface-3: var(--surface-3);
126
+ --color-surface-4: var(--surface-4);
127
+ --color-surface-5: var(--surface-5);
128
+ --color-surface-line: var(--surface-line);
129
+ --color-surface-foreground: var(--surface-foreground);
130
+ --color-surface-hover: var(--surface-hover);
131
+ --color-surface-focus: var(--surface-focus);
132
+ --color-surface-active: var(--surface-active);
133
+
134
+ --color-muted: var(--muted);
135
+ --color-muted-foreground: var(--muted-foreground);
136
+ --color-muted-foreground-1: var(--muted-foreground-1);
137
+ --color-muted-foreground-2: var(--muted-foreground-2);
138
+ --color-muted-hover: var(--muted-hover);
139
+ --color-muted-focus: var(--muted-focus);
140
+ --color-muted-active: var(--muted-active);
141
+
142
+ --color-destructive: var(--destructive);
143
+ --color-destructive-foreground: var(--destructive-foreground);
144
+ --color-destructive-hover: var(--destructive-hover);
145
+ --color-destructive-focus: var(--destructive-focus);
146
+
147
+ --color-navbar: var(--navbar);
148
+ --color-navbar-line: var(--navbar-line);
149
+ --color-navbar-divider: var(--navbar-divider);
150
+ --color-navbar-nav-foreground: var(--navbar-nav-foreground);
151
+ --color-navbar-nav-hover: var(--navbar-nav-hover);
152
+ --color-navbar-nav-focus: var(--navbar-nav-focus);
153
+ --color-navbar-nav-active: var(--navbar-nav-active);
154
+ --color-navbar-nav-list-divider: var(--navbar-nav-list-divider);
155
+ --color-navbar-inverse: var(--navbar-inverse);
156
+
157
+ --color-navbar-1: var(--navbar-1);
158
+ --color-navbar-1-line: var(--navbar-1-line);
159
+ --color-navbar-1-divider: var(--navbar-1-divider);
160
+ --color-navbar-1-nav-foreground: var(--navbar-1-nav-foreground);
161
+ --color-navbar-1-nav-hover: var(--navbar-1-nav-hover);
162
+ --color-navbar-1-nav-focus: var(--navbar-1-nav-focus);
163
+ --color-navbar-1-nav-active: var(--navbar-1-nav-active);
164
+ --color-navbar-1-nav-list-divider: var(--navbar-1-nav-list-divider);
165
+
166
+ --color-navbar-2: var(--navbar-2);
167
+ --color-navbar-2-line: var(--navbar-2-line);
168
+ --color-navbar-2-divider: var(--navbar-2-divider);
169
+ --color-navbar-2-nav-foreground: var(--navbar-2-nav-foreground);
170
+ --color-navbar-2-nav-hover: var(--navbar-2-nav-hover);
171
+ --color-navbar-2-nav-focus: var(--navbar-2-nav-focus);
172
+ --color-navbar-2-nav-active: var(--navbar-2-nav-active);
173
+ --color-navbar-2-nav-list-divider: var(--navbar-2-nav-list-divider);
174
+
175
+ --color-sidebar: var(--sidebar);
176
+ --color-sidebar-line: var(--sidebar-line);
177
+ --color-sidebar-divider: var(--sidebar-divider);
178
+ --color-sidebar-nav-foreground: var(--sidebar-nav-foreground);
179
+ --color-sidebar-nav-hover: var(--sidebar-nav-hover);
180
+ --color-sidebar-nav-focus: var(--sidebar-nav-focus);
181
+ --color-sidebar-nav-active: var(--sidebar-nav-active);
182
+ --color-sidebar-nav-list-divider: var(--sidebar-nav-list-divider);
183
+ --color-sidebar-inverse: var(--sidebar-inverse);
184
+
185
+ --color-sidebar-1: var(--sidebar-1);
186
+ --color-sidebar-1-line: var(--sidebar-1-line);
187
+ --color-sidebar-1-divider: var(--sidebar-1-divider);
188
+ --color-sidebar-1-nav-foreground: var(--sidebar-1-nav-foreground);
189
+ --color-sidebar-1-nav-hover: var(--sidebar-1-nav-hover);
190
+ --color-sidebar-1-nav-focus: var(--sidebar-1-nav-focus);
191
+ --color-sidebar-1-nav-active: var(--sidebar-1-nav-active);
192
+ --color-sidebar-1-nav-list-divider: var(--sidebar-1-nav-list-divider);
193
+
194
+ --color-sidebar-2: var(--sidebar-2);
195
+ --color-sidebar-2-line: var(--sidebar-2-line);
196
+ --color-sidebar-2-divider: var(--sidebar-2-divider);
197
+ --color-sidebar-2-nav-foreground: var(--sidebar-2-nav-foreground);
198
+ --color-sidebar-2-nav-hover: var(--sidebar-2-nav-hover);
199
+ --color-sidebar-2-nav-focus: var(--sidebar-2-nav-focus);
200
+ --color-sidebar-2-nav-active: var(--sidebar-2-nav-active);
201
+ --color-sidebar-2-nav-list-divider: var(--sidebar-2-nav-list-divider);
202
+
203
+ --color-card: var(--card);
204
+ --color-card-line: var(--card-line);
205
+ --color-card-divider: var(--card-divider);
206
+ --color-card-header: var(--card-header);
207
+ --color-card-footer: var(--card-footer);
208
+ --color-card-inverse: var(--card-inverse);
209
+
210
+ --color-dropdown: var(--dropdown);
211
+ --color-dropdown-1: var(--dropdown-1);
212
+ --color-dropdown-line: var(--dropdown-line);
213
+ --color-dropdown-divider: var(--dropdown-divider);
214
+ --color-dropdown-header: var(--dropdown-header);
215
+ --color-dropdown-footer: var(--dropdown-footer);
216
+ --color-dropdown-item-foreground: var(--dropdown-item-foreground);
217
+ --color-dropdown-item-hover: var(--dropdown-item-hover);
218
+ --color-dropdown-item-focus: var(--dropdown-item-focus);
219
+ --color-dropdown-item-active: var(--dropdown-item-active);
220
+ --color-dropdown-inverse: var(--dropdown-inverse);
221
+
222
+ --color-select: var(--select);
223
+ --color-select-1: var(--select-1);
224
+ --color-select-line: var(--select-line);
225
+ --color-select-item-foreground: var(--select-item-foreground);
226
+ --color-select-item-hover: var(--select-item-hover);
227
+ --color-select-item-focus: var(--select-item-focus);
228
+ --color-select-item-active: var(--select-item-active);
229
+ --color-select-inverse: var(--select-inverse);
230
+
231
+ --color-overlay: var(--overlay);
232
+ --color-overlay-line: var(--overlay-line);
233
+ --color-overlay-divider: var(--overlay-divider);
234
+ --color-overlay-header: var(--overlay-header);
235
+ --color-overlay-footer: var(--overlay-footer);
236
+ --color-overlay-inverse: var(--overlay-inverse);
237
+
238
+ --color-popover: var(--popover);
239
+ --color-popover-line: var(--popover-line);
240
+
241
+ --color-tooltip: var(--tooltip);
242
+ --color-tooltip-line: var(--tooltip-line);
243
+ --color-tooltip-foreground: var(--tooltip-foreground);
244
+
245
+ --color-table-line: var(--table-line);
246
+
247
+ --color-switch: var(--switch);
248
+
249
+ --color-footer: var(--footer);
250
+ --color-footer-line: var(--footer-line);
251
+ --color-footer-inverse: var(--footer-inverse);
252
+
253
+ --color-scrollbar-track: var(--scrollbar-track);
254
+ --color-scrollbar-thumb: var(--scrollbar-thumb);
255
+ --color-scrollbar-track-inverse: var(--scrollbar-track-inverse);
256
+ --color-scrollbar-thumb-inverse: var(--scrollbar-thumb-inverse);
257
+
258
+ --color-chart-primary: var(--chart-primary);
259
+ --color-chart-1: var(--chart-1);
260
+ --color-chart-2: var(--chart-2);
261
+ --color-chart-3: var(--chart-3);
262
+ --color-chart-4: var(--chart-4);
263
+ --color-chart-5: var(--chart-5);
264
+ --color-chart-6: var(--chart-6);
265
+ --color-chart-7: var(--chart-7);
266
+ --color-chart-8: var(--chart-8);
267
+ --color-chart-9: var(--chart-9);
268
+ --color-chart-10: var(--chart-10);
269
+ }
270
+
271
+ :root {
272
+ --background: var(--color-white);
273
+ --background-1: var(--color-gray-50);
274
+ --background-2: var(--color-gray-100);
275
+ --background-plain: var(--color-white);
276
+ --foreground: var(--color-gray-800);
277
+ --foreground-inverse: var(--color-white);
278
+
279
+ --inverse: var(--color-gray-800);
280
+
281
+ --border: var(--color-gray-200);
282
+ --border-line-inverse: var(--color-white);
283
+ --border-line-1: var(--color-gray-100);
284
+ --border-line-2: var(--color-gray-200);
285
+ --border-line-3: var(--color-gray-300);
286
+ --border-line-4: var(--color-gray-400);
287
+ --border-line-5: var(--color-gray-500);
288
+ --border-line-6: var(--color-gray-600);
289
+ --border-line-7: var(--color-gray-700);
290
+ --border-line-8: var(--color-gray-800);
291
+
292
+ --primary-50: var(--color-blue-50);
293
+ --primary-100: var(--color-blue-100);
294
+ --primary-200: var(--color-blue-200);
295
+ --primary-300: var(--color-blue-300);
296
+ --primary-400: var(--color-blue-400);
297
+ --primary-500: var(--color-blue-500);
298
+ --primary-600: var(--color-blue-600);
299
+ --primary-700: var(--color-blue-700);
300
+ --primary-800: var(--color-blue-800);
301
+ --primary-900: var(--color-blue-900);
302
+ --primary-950: var(--color-blue-950);
303
+
304
+ --primary: var(--color-primary-600);
305
+ --primary-line: transparent;
306
+ --primary-foreground: var(--color-white);
307
+ --primary-hover: var(--color-primary-700);
308
+ --primary-focus: var(--color-primary-700);
309
+ --primary-active: var(--color-primary-700);
310
+ --primary-checked: var(--color-primary-600);
311
+
312
+ --secondary: var(--color-gray-900);
313
+ --secondary-line: transparent;
314
+ --secondary-foreground: var(--color-white);
315
+ --secondary-hover: var(--color-gray-800);
316
+ --secondary-focus: var(--color-gray-800);
317
+ --secondary-active: var(--color-gray-800);
318
+
319
+ --layer: var(--color-white);
320
+ --layer-line: var(--color-gray-200);
321
+ --layer-foreground: var(--color-gray-800);
322
+ --layer-hover: var(--color-gray-50);
323
+ --layer-focus: var(--color-gray-50);
324
+ --layer-active: var(--color-gray-50);
325
+
326
+ --surface: var(--color-gray-100);
327
+ --surface-1: var(--color-gray-200);
328
+ --surface-2: var(--color-gray-300);
329
+ --surface-3: var(--color-gray-400);
330
+ --surface-4: var(--color-gray-500);
331
+ --surface-5: var(--color-gray-600);
332
+ --surface-line: transparent;
333
+ --surface-foreground: var(--color-gray-800);
334
+ --surface-hover: var(--color-gray-200);
335
+ --surface-focus: var(--color-gray-200);
336
+ --surface-active: var(--color-gray-200);
337
+
338
+ --muted: var(--color-gray-50);
339
+ --muted-foreground: var(--color-gray-400);
340
+ --muted-foreground-1: var(--color-gray-500);
341
+ --muted-foreground-2: var(--color-gray-600);
342
+ --muted-hover: var(--color-gray-100);
343
+ --muted-focus: var(--color-gray-100);
344
+ --muted-active: var(--color-gray-100);
345
+
346
+ --destructive: var(--color-red-500);
347
+ --destructive-foreground: var(--color-white);
348
+ --destructive-hover: var(--color-red-600);
349
+ --destructive-focus: var(--color-red-600);
350
+
351
+ --navbar: var(--color-white);
352
+ --navbar-line: var(--color-gray-200);
353
+ --navbar-divider: var(--color-gray-200);
354
+ --navbar-nav-foreground: var(--color-gray-800);
355
+ --navbar-nav-hover: var(--color-gray-100);
356
+ --navbar-nav-focus: var(--color-gray-100);
357
+ --navbar-nav-active: var(--color-gray-100);
358
+ --navbar-nav-list-divider: var(--color-gray-200);
359
+ --navbar-inverse: var(--color-primary-950);
360
+
361
+ --navbar-1: var(--color-gray-50);
362
+ --navbar-1-line: var(--color-gray-200);
363
+ --navbar-1-divider: var(--color-gray-200);
364
+ --navbar-1-nav-foreground: var(--color-gray-800);
365
+ --navbar-1-nav-hover: var(--color-gray-200);
366
+ --navbar-1-nav-focus: var(--color-gray-200);
367
+ --navbar-1-nav-active: var(--color-gray-200);
368
+ --navbar-1-nav-list-divider: var(--color-gray-200);
369
+
370
+ --navbar-2: var(--color-gray-100);
371
+ --navbar-2-line: transparent;
372
+ --navbar-2-divider: var(--color-gray-300);
373
+ --navbar-2-nav-foreground: var(--color-gray-800);
374
+ --navbar-2-nav-hover: var(--color-gray-200);
375
+ --navbar-2-nav-focus: var(--color-gray-200);
376
+ --navbar-2-nav-active: var(--color-gray-200);
377
+ --navbar-2-nav-list-divider: var(--color-gray-200);
378
+
379
+ --sidebar: var(--color-white);
380
+ --sidebar-line: var(--color-gray-200);
381
+ --sidebar-divider: var(--color-gray-200);
382
+ --sidebar-nav-foreground: var(--color-gray-800);
383
+ --sidebar-nav-hover: var(--color-gray-100);
384
+ --sidebar-nav-focus: var(--color-gray-100);
385
+ --sidebar-nav-active: var(--color-gray-100);
386
+ --sidebar-nav-list-divider: var(--color-gray-200);
387
+ --sidebar-inverse: var(--color-primary-950);
388
+
389
+ --sidebar-1: var(--color-gray-50);
390
+ --sidebar-1-line: var(--color-gray-200);
391
+ --sidebar-1-divider: var(--color-gray-200);
392
+ --sidebar-1-nav-foreground: var(--color-gray-800);
393
+ --sidebar-1-nav-hover: var(--color-gray-200);
394
+ --sidebar-1-nav-focus: var(--color-gray-200);
395
+ --sidebar-1-nav-active: var(--color-gray-200);
396
+ --sidebar-1-nav-list-divider: var(--color-gray-200);
397
+
398
+ --sidebar-2: var(--color-gray-100);
399
+ --sidebar-2-line: transparent;
400
+ --sidebar-2-divider: var(--color-gray-200);
401
+ --sidebar-2-nav-foreground: var(--color-gray-800);
402
+ --sidebar-2-nav-hover: var(--color-gray-200);
403
+ --sidebar-2-nav-focus: var(--color-gray-200);
404
+ --sidebar-2-nav-active: var(--color-gray-200);
405
+ --sidebar-2-nav-list-divider: var(--color-gray-200);
406
+
407
+ --card: var(--color-white);
408
+ --card-line: var(--color-gray-200);
409
+ --card-divider: var(--color-gray-200);
410
+ --card-header: var(--color-gray-200);
411
+ --card-footer: var(--color-gray-200);
412
+ --card-inverse: var(--color-gray-900);
413
+
414
+ --dropdown: var(--color-white);
415
+ --dropdown-1: var(--color-white);
416
+ --dropdown-line: transparent;
417
+ --dropdown-divider: var(--color-gray-200);
418
+ --dropdown-header: var(--color-gray-200);
419
+ --dropdown-footer: var(--color-gray-200);
420
+ --dropdown-item-foreground: var(--color-gray-800);
421
+ --dropdown-item-hover: var(--color-gray-100);
422
+ --dropdown-item-focus: var(--color-gray-100);
423
+ --dropdown-item-active: var(--color-gray-100);
424
+ --dropdown-inverse: var(--color-gray-900);
425
+
426
+ --select: var(--color-white);
427
+ --select-1: var(--color-white);
428
+ --select-line: transparent;
429
+ --select-item-foreground: var(--color-gray-800);
430
+ --select-item-hover: var(--color-gray-100);
431
+ --select-item-focus: var(--color-gray-100);
432
+ --select-item-active: var(--color-gray-100);
433
+ --select-inverse: var(--color-gray-900);
434
+
435
+ --overlay: var(--color-white);
436
+ --overlay-line: transparent;
437
+ --overlay-divider: var(--color-gray-200);
438
+ --overlay-header: var(--color-gray-200);
439
+ --overlay-footer: var(--color-gray-200);
440
+ --overlay-inverse: var(--color-gray-900);
441
+
442
+ --popover: var(--color-white);
443
+ --popover-line: var(--color-gray-100);
444
+
445
+ --tooltip: var(--color-gray-900);
446
+ --tooltip-line: transparent;
447
+ --tooltip-foreground: var(--color-white);
448
+
449
+ --table-line: var(--color-gray-200);
450
+
451
+ --switch: var(--color-white);
452
+
453
+ --footer: var(--color-white);
454
+ --footer-line: var(--color-gray-200);
455
+ --footer-inverse: var(--color-gray-900);
456
+
457
+ --scrollbar-track: var(--color-gray-100);
458
+ --scrollbar-thumb: var(--color-gray-300);
459
+ --scrollbar-track-inverse: transparent;
460
+ --scrollbar-thumb-inverse: var(--color-white);
461
+
462
+ --chart-colors-background: var(--color-white);
463
+ --chart-colors-background-inverse: var(--color-neutral-800);
464
+ --chart-colors-foreground: var(--color-gray-800);
465
+ --chart-colors-foreground-inverse: var(--color-white);
466
+ --chart-primary: var(--color-primary-600);
467
+ --chart-colors-primary: var(--color-primary-600);
468
+ --chart-colors-primary-inverse: var(--color-primary-500);
469
+ --chart-colors-primary-hex: var(--color-primary-600);
470
+ --chart-colors-primary-hex-inverse: var(--color-primary-500);
471
+ --chart-colors-chart-inverse: var(--color-white);
472
+ --chart-1: var(--color-primary-50);
473
+ --chart-colors-chart-1: var(--color-primary-50);
474
+ --chart-colors-chart-1-inverse: var(--color-primary-50);
475
+ --chart-colors-chart-1-hex: var(--color-primary-50);
476
+ --chart-colors-chart-1-hex-inverse: var(--color-primary-50);
477
+ --chart-2: var(--color-primary-200);
478
+ --chart-colors-chart-2: var(--color-primary-200);
479
+ --chart-colors-chart-2-inverse: var(--color-primary-200);
480
+ --chart-colors-chart-2-hex: var(--color-primary-200);
481
+ --chart-colors-chart-2-hex-inverse: var(--color-primary-200);
482
+ --chart-3: var(--color-primary-400);
483
+ --chart-colors-chart-3: var(--color-primary-400);
484
+ --chart-colors-chart-3-inverse: var(--color-primary-400);
485
+ --chart-colors-chart-3-hex: var(--color-primary-400);
486
+ --chart-colors-chart-3-hex-inverse: var(--color-primary-400);
487
+ --chart-4: var(--color-primary-800);
488
+ --chart-colors-chart-4: var(--color-primary-800);
489
+ --chart-colors-chart-4-inverse: var(--color-primary-800);
490
+ --chart-colors-chart-4-hex: var(--color-primary-800);
491
+ --chart-colors-chart-4-hex-inverse: var(--color-primary-800);
492
+ --chart-5: var(--color-purple-600);
493
+ --chart-colors-chart-5: var(--color-purple-600);
494
+ --chart-colors-chart-5-inverse: var(--color-purple-500);
495
+ --chart-colors-chart-5-hex: var(--color-purple-600);
496
+ --chart-colors-chart-5-hex-inverse: var(--color-purple-500);
497
+ --chart-6: var(--color-cyan-400);
498
+ --chart-colors-chart-6: var(--color-cyan-400);
499
+ --chart-colors-chart-6-inverse: var(--color-cyan-400);
500
+ --chart-colors-chart-6-hex: var(--color-cyan-400);
501
+ --chart-colors-chart-6-hex-inverse: var(--color-cyan-400);
502
+ --chart-7: var(--color-orange-500);
503
+ --chart-colors-chart-7: var(--color-orange-500);
504
+ --chart-colors-chart-7-inverse: var(--color-orange-500);
505
+ --chart-colors-chart-7-hex: var(--color-orange-500);
506
+ --chart-colors-chart-7-hex-inverse: var(--color-orange-500);
507
+ --chart-8: var(--color-gray-100);
508
+ --chart-colors-chart-8: var(--color-gray-100);
509
+ --chart-colors-chart-8-inverse: var(--color-neutral-700);
510
+ --chart-colors-chart-8-hex: var(--color-gray-100);
511
+ --chart-colors-chart-8-hex-inverse: var(--color-neutral-700);
512
+ --chart-9: var(--color-gray-200);
513
+ --chart-colors-chart-9: var(--color-gray-200);
514
+ --chart-colors-chart-9-inverse: var(--color-neutral-500);
515
+ --chart-colors-chart-9-hex: var(--color-gray-200);
516
+ --chart-colors-chart-9-hex-inverse: var(--color-neutral-500);
517
+ --chart-10: var(--color-gray-300);
518
+ --chart-colors-chart-10: var(--color-gray-300);
519
+ --chart-colors-chart-10-inverse: var(--color-neutral-700);
520
+ --chart-colors-chart-10-hex: var(--color-gray-300);
521
+ --chart-colors-chart-10-hex-inverse: var(--color-neutral-700);
522
+ --chart-colors-candlestick-upward: var(--color-primary-600);
523
+ --chart-colors-candlestick-upward-inverse: var(--color-primary-500);
524
+ --chart-colors-candlestick-downward: var(--color-primary-600);
525
+ --chart-colors-candlestick-downward-inverse: var(--color-primary-500);
526
+ --chart-colors-labels: var(--color-gray-400);
527
+ --chart-colors-labels-inverse: var(--color-neutral-400);
528
+ --chart-colors-xaxis-labels: var(--color-gray-400);
529
+ --chart-colors-xaxis-labels-inverse: var(--color-neutral-400);
530
+ --chart-colors-yaxis-labels: var(--color-gray-400);
531
+ --chart-colors-yaxis-labels-inverse: var(--color-neutral-400);
532
+ --chart-colors-grid-border: var(--color-gray-200);
533
+ --chart-colors-grid-border-inverse: var(--color-neutral-700);
534
+ --chart-colors-bar-ranges: var(--color-gray-200);
535
+ --chart-colors-bar-ranges-inverse: var(--color-white);
536
+
537
+ --map-colors-primary: var(--color-primary-600);
538
+ --map-colors-primary-inverse: var(--color-primary-500);
539
+ --map-colors-default: var(--color-gray-300);
540
+ --map-colors-default-inverse: var(--color-neutral-600);
541
+ --map-colors-highlight: var(--color-primary-300);
542
+ --map-colors-highlight-inverse: var(--color-primary-300);
543
+ --map-colors-border: var(--color-gray-100);
544
+ --map-colors-border-inverse: var(--color-neutral-800);
545
+ }
546
+
547
+ .dark {
548
+ --background: var(--color-neutral-800);
549
+ --background-1: var(--color-neutral-900);
550
+ --background-2: var(--color-neutral-900);
551
+ --foreground: var(--color-neutral-200);
552
+
553
+ --inverse: var(--color-neutral-950);
554
+
555
+ --border: var(--color-neutral-700);
556
+ --border-line-1: var(--color-neutral-800);
557
+ --border-line-2: var(--color-neutral-700);
558
+ --border-line-3: var(--color-neutral-600);
559
+ --border-line-4: var(--color-neutral-500);
560
+ --border-line-5: var(--color-neutral-400);
561
+ --border-line-6: var(--color-neutral-300);
562
+ --border-line-7: var(--color-neutral-200);
563
+ --border-line-8: var(--color-neutral-100);
564
+
565
+ --primary: var(--color-primary-500);
566
+ --primary-line: transparent;
567
+ --primary-foreground: var(--color-white);
568
+ --primary-hover: var(--color-primary-600);
569
+ --primary-focus: var(--color-primary-600);
570
+ --primary-active: var(--color-primary-600);
571
+ --primary-checked: var(--color-primary-500);
572
+
573
+ --secondary: var(--color-white);
574
+ --secondary-line: transparent;
575
+ --secondary-foreground: var(--color-neutral-800);
576
+ --secondary-hover: var(--color-neutral-100);
577
+ --secondary-focus: var(--color-neutral-100);
578
+ --secondary-active: var(--color-neutral-100);
579
+
580
+ --layer: var(--color-neutral-800);
581
+ --layer-line: var(--color-neutral-700);
582
+ --layer-foreground: var(--color-white);
583
+ --layer-hover: var(--color-neutral-700);
584
+ --layer-focus: var(--color-neutral-700);
585
+ --layer-active: var(--color-neutral-700);
586
+
587
+ --surface: var(--color-neutral-700);
588
+ --surface-1: var(--color-neutral-600);
589
+ --surface-2: var(--color-neutral-500);
590
+ --surface-3: var(--color-neutral-600);
591
+ --surface-4: var(--color-neutral-500);
592
+ --surface-5: var(--color-neutral-400);
593
+ --surface-line: transparent;
594
+ --surface-foreground: var(--color-neutral-200);
595
+ --surface-hover: var(--color-neutral-600);
596
+ --surface-focus: var(--color-neutral-600);
597
+ --surface-active: var(--color-neutral-600);
598
+
599
+ --muted: var(--color-neutral-800);
600
+ --muted-foreground: var(--color-neutral-500);
601
+ --muted-foreground-1: var(--color-neutral-400);
602
+ --muted-foreground-2: var(--color-neutral-300);
603
+ --muted-hover: var(--color-neutral-700);
604
+ --muted-focus: var(--color-neutral-700);
605
+ --muted-active: var(--color-neutral-700);
606
+
607
+ --destructive: var(--color-red-500);
608
+ --destructive-foreground: var(--color-white);
609
+ --destructive-hover: var(--color-red-600);
610
+ --destructive-focus: var(--color-red-600);
611
+
612
+ --navbar: var(--color-neutral-800);
613
+ --navbar-line: var(--color-neutral-700);
614
+ --navbar-divider: var(--color-neutral-700);
615
+ --navbar-nav-foreground: var(--color-neutral-200);
616
+ --navbar-nav-hover: var(--color-neutral-700);
617
+ --navbar-nav-focus: var(--color-neutral-700);
618
+ --navbar-nav-active: var(--color-neutral-700);
619
+ --navbar-nav-list-divider: var(--color-neutral-700);
620
+ --navbar-inverse: var(--color-neutral-950);
621
+
622
+ --navbar-1: var(--color-neutral-900);
623
+ --navbar-1-line: var(--color-neutral-700);
624
+ --navbar-1-divider: var(--color-neutral-700);
625
+ --navbar-1-nav-foreground: var(--color-neutral-200);
626
+ --navbar-1-nav-hover: var(--color-neutral-700);
627
+ --navbar-1-nav-focus: var(--color-neutral-700);
628
+ --navbar-1-nav-active: var(--color-neutral-700);
629
+ --navbar-1-nav-list-divider: var(--color-neutral-700);
630
+
631
+ --navbar-2: var(--color-neutral-900);
632
+ --navbar-2-line: transparent;
633
+ --navbar-2-divider: var(--color-neutral-700);
634
+ --navbar-2-nav-foreground: var(--color-neutral-200);
635
+ --navbar-2-nav-hover: var(--color-neutral-800);
636
+ --navbar-2-nav-focus: var(--color-neutral-800);
637
+ --navbar-2-nav-active: var(--color-neutral-800);
638
+ --navbar-2-nav-list-divider: var(--color-neutral-800);
639
+
640
+ --sidebar: var(--color-neutral-800);
641
+ --sidebar-line: var(--color-neutral-700);
642
+ --sidebar-divider: var(--color-neutral-700);
643
+ --sidebar-nav-foreground: var(--color-neutral-200);
644
+ --sidebar-nav-hover: var(--color-neutral-700);
645
+ --sidebar-nav-focus: var(--color-neutral-700);
646
+ --sidebar-nav-active: var(--color-neutral-700);
647
+ --sidebar-nav-list-divider: var(--color-neutral-700);
648
+ --sidebar-inverse: var(--color-neutral-950);
649
+
650
+ --sidebar-1: var(--color-neutral-900);
651
+ --sidebar-1-line: var(--color-neutral-700);
652
+ --sidebar-1-divider: var(--color-neutral-700);
653
+ --sidebar-1-nav-foreground: var(--color-neutral-200);
654
+ --sidebar-1-nav-hover: var(--color-neutral-700);
655
+ --sidebar-1-nav-focus: var(--color-neutral-700);
656
+ --sidebar-1-nav-active: var(--color-neutral-700);
657
+ --sidebar-1-nav-list-divider: var(--color-neutral-700);
658
+
659
+ --sidebar-2: var(--color-neutral-900);
660
+ --sidebar-2-line: transparent;
661
+ --sidebar-2-divider: var(--color-neutral-800);
662
+ --sidebar-2-nav-foreground: var(--color-neutral-200);
663
+ --sidebar-2-nav-hover: var(--color-neutral-800);
664
+ --sidebar-2-nav-focus: var(--color-neutral-800);
665
+ --sidebar-2-nav-active: var(--color-neutral-800);
666
+ --sidebar-2-nav-list-divider: var(--color-neutral-800);
667
+
668
+ --card: var(--color-neutral-800);
669
+ --card-line: var(--color-neutral-700);
670
+ --card-divider: var(--color-neutral-700);
671
+ --card-header: var(--color-neutral-700);
672
+ --card-footer: var(--color-neutral-700);
673
+ --card-inverse: var(--color-neutral-900);
674
+
675
+ --dropdown: var(--color-neutral-900);
676
+ --dropdown-1: var(--color-neutral-950);
677
+ --dropdown-line: transparent;
678
+ --dropdown-divider: var(--color-neutral-800);
679
+ --dropdown-header: var(--color-neutral-700);
680
+ --dropdown-footer: var(--color-neutral-700);
681
+ --dropdown-item-foreground: var(--color-neutral-200);
682
+ --dropdown-item-hover: var(--color-neutral-800);
683
+ --dropdown-item-focus: var(--color-neutral-800);
684
+ --dropdown-item-active: var(--color-neutral-800);
685
+ --dropdown-inverse: var(--color-neutral-900);
686
+
687
+ --select: var(--color-neutral-900);
688
+ --select-1: var(--color-neutral-950);
689
+ --select-line: transparent;
690
+ --select-item-foreground: var(--color-neutral-200);
691
+ --select-item-hover: var(--color-neutral-800);
692
+ --select-item-focus: var(--color-neutral-800);
693
+ --select-item-active: var(--color-neutral-800);
694
+ --select-inverse: var(--color-neutral-900);
695
+
696
+ --overlay: var(--color-neutral-800);
697
+ --overlay-line: transparent;
698
+ --overlay-divider: var(--color-neutral-700);
699
+ --overlay-header: var(--color-neutral-700);
700
+ --overlay-footer: var(--color-neutral-700);
701
+ --overlay-inverse: var(--color-neutral-900);
702
+
703
+ --popover: var(--color-neutral-900);
704
+ --popover-line: var(--color-neutral-700);
705
+
706
+ --tooltip: var(--color-white);
707
+ --tooltip-line: transparent;
708
+ --tooltip-foreground: var(--color-neutral-800);
709
+
710
+ --table-line: var(--color-neutral-700);
711
+
712
+ --footer: var(--color-neutral-800);
713
+ --footer-line: var(--color-neutral-700);
714
+ --footer-inverse: var(--color-neutral-900);
715
+
716
+ --scrollbar-track: var(--color-neutral-700);
717
+ --scrollbar-thumb: var(--color-neutral-500);
718
+ --scrollbar-track-inverse: var(--color-neutral-500);
719
+ --scrollbar-thumb-inverse: var(--color-neutral-700);
720
+
721
+ --chart-primary: var(--color-primary-500);
722
+ --chart-8: var(--color-neutral-700);
723
+ --chart-9: var(--color-neutral-500);
724
+ --chart-10: var(--color-neutral-700);
725
+ }