@preline/textarea-auto-height 4.1.3 → 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,223 @@
1
+ # Textarea Autoheight
2
+
3
+ Automatically sets the height of the textarea.
4
+
5
+ [![npm](https://img.shields.io/badge/npm-v4.2.0-blue)](https://www.npmjs.com/package/@preline/textarea-auto-height) [![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/textarea-autoheight.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
+ - [Common Patterns](#common-patterns)
15
+ - [License](#license)
16
+
17
+ ## Overview
18
+
19
+ The Textarea Autoheight component automatically adjusts the height of a textarea element based on its content. As users type, the textarea expands or contracts to fit the text, eliminating the need for scrollbars.
20
+
21
+ **Key Features:**
22
+ - Automatic height adjustment based on content
23
+ - Smooth resizing as user types
24
+ - Configurable default height
25
+ - Programmatic control via JavaScript API
26
+ - No scrollbars needed
27
+
28
+ ## Installation
29
+
30
+ To get started, install Textarea Autoheight plugin via npm, else you can skip this step if you are already using Preline UI as a package.
31
+
32
+ ```bash
33
+ npm i @preline/textarea-auto-height
34
+ ```
35
+
36
+ ### CSS
37
+
38
+ [`@import`](https://tailwindcss.com/docs/functions-and-directives#import-directive) the plugin's CSS file into your Tailwind CSS file.
39
+
40
+ ```css
41
+ @import "tailwindcss";
42
+
43
+ /* @preline/textarea-auto-height */
44
+ @import "./node_modules/@preline/textarea-auto-height/theme.css";
45
+ ```
46
+
47
+ ### JavaScript
48
+
49
+ Include the JavaScript that powers the interactive elements near the end of your `</body>` tag:
50
+
51
+ ```html
52
+ <script src="./node_modules/@preline/textarea-auto-height/index.js"></script>
53
+ ```
54
+
55
+ ### Manual Initialization
56
+
57
+ 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.
58
+
59
+ ```html
60
+ <script type="module">
61
+ import HSTextareaAutoHeight from "@preline/textarea-auto-height/non-auto.mjs";
62
+
63
+ new HSTextareaAutoHeight(document.querySelector("#textarea"));
64
+ </script>
65
+ ```
66
+
67
+ ### Via Bundler
68
+
69
+ When using a bundler (Vite, webpack, etc.), import the plugin directly as an ES module.
70
+
71
+ `@preline/textarea-auto-height` is the auto-init entry: it scans the DOM and initializes matching elements automatically.
72
+
73
+ ```js
74
+ import "@preline/textarea-auto-height";
75
+ ```
76
+
77
+ `@preline/textarea-auto-height/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.
78
+
79
+ ```js
80
+ import HSTextareaAutoHeight from "@preline/textarea-auto-height/non-auto";
81
+
82
+ HSTextareaAutoHeight.autoInit();
83
+
84
+ // Or initialize a specific element manually
85
+ const el = document.querySelector("#textarea");
86
+ if (el) new HSTextareaAutoHeight(el);
87
+ ```
88
+
89
+ ### TypeScript
90
+
91
+ This package ships with TypeScript type definitions. No additional `@types/` package is needed.
92
+
93
+ ## Basic usage
94
+
95
+ The following example demonstrates the minimal HTML structure required for a textarea autoheight component. This is a base template without custom styling - you can apply your own CSS classes and styles as needed. The textarea automatically adjusts its height as content is entered.
96
+
97
+ ```html
98
+ <textarea data-hs-textarea-auto-height></textarea>
99
+ ```
100
+
101
+ **Structure Requirements:**
102
+ - `data-hs-textarea-auto-height`: Required on the textarea element
103
+ - Standard `<textarea>` element
104
+
105
+ **Initial State:**
106
+ - Textarea starts at default height (or configured `defaultHeight`)
107
+ - Height adjusts automatically as content is entered or removed
108
+
109
+ ## Configuration Options
110
+
111
+ ### Data Options
112
+
113
+ Data options are specified in the `data-hs-textarea-auto-height` attribute.
114
+
115
+ | Attribute | Target Element | Type | Default | Description |
116
+ | --- | --- | --- | --- | --- |
117
+ | `data-hs-textarea-auto-height` | Textarea element | - | - | If this attribute is added to the textarea, then automatic height calculation according to the content is enabled. Should be added to the textarea itself. |
118
+ | `:defaultHeight` | Inside `data-hs-textarea-auto-height` | number | `0` | Sets the default height (when no text is entered). When set to `0`, the textarea uses its natural height. |
119
+
120
+ **Example:**
121
+ ```html
122
+ <textarea data-hs-textarea-auto-height='{
123
+ "defaultHeight": 50
124
+ }'></textarea>
125
+ ```
126
+
127
+ ## JavaScript API
128
+
129
+ The `HSTextareaAutoHeight` object is available in the global `window` object after the plugin is loaded.
130
+
131
+ ### Instance Methods
132
+
133
+ These methods are called on a textarea autoheight instance.
134
+
135
+ | Method | Parameters | Return Type | Description |
136
+ | --- | --- | --- | --- |
137
+ | `destroy()` | None | `void` | Destroys the textarea autoheight instance, removes all generated markup, classes, and event listeners. Use when removing textarea autoheight from DOM. |
138
+
139
+ ### Static Methods
140
+
141
+ These methods are called directly on the `HSTextareaAutoHeight` class.
142
+
143
+ | Method | Parameters | Return Type | Description |
144
+ | --- | --- | --- | --- |
145
+ | `HSTextareaAutoHeight.getInstance(target, isInstance)` | `target`: `HTMLTextAreaElement \| string` (CSS selector)<br>`isInstance`: `boolean` (optional) | `HSTextareaAutoHeight \| { id: string \| number, element: HSTextareaAutoHeight } \| null` | Returns the textarea autoheight instance associated with the target. If `isInstance` is `true`, returns collection item object `{ id, element }` where `element` is the `HSTextareaAutoHeight` instance. If `isInstance` is `false` or omitted, returns the `HSTextareaAutoHeight` instance directly. Returns `null` if textarea autoheight instance is not found. |
146
+
147
+ ### Usage Examples
148
+
149
+ **Example 1: Destroying textarea autoheight instance**
150
+ ```javascript
151
+ const instance = HSTextareaAutoHeight.getInstance('#hs-textarea-autoheight', true);
152
+
153
+ if (instance) {
154
+ const { element } = instance;
155
+ const destroyBtn = document.querySelector('#hs-destroy-btn');
156
+
157
+ destroyBtn.addEventListener('click', () => {
158
+ element.destroy();
159
+ });
160
+ }
161
+ ```
162
+
163
+ **Example 2: Getting instance and accessing properties**
164
+ ```javascript
165
+ // Get the textarea autoheight instance
166
+ const instance = HSTextareaAutoHeight.getInstance('#hs-textarea-autoheight', true);
167
+
168
+ if (instance) {
169
+ const { element } = instance;
170
+
171
+ // Access instance properties
172
+ console.log('Default height:', element.defaultHeight);
173
+
174
+ // Clean up when removing from DOM
175
+ function removeTextareaAutoheight() {
176
+ element.destroy();
177
+ }
178
+ }
179
+ ```
180
+
181
+ **Example 3: Destroying textarea autoheight instance**
182
+ ```javascript
183
+ const instance = HSTextareaAutoHeight.getInstance('#hs-textarea-autoheight', true);
184
+
185
+ if (instance) {
186
+ const { element } = instance;
187
+ const removeBtn = document.querySelector('#hs-remove-btn');
188
+
189
+ removeBtn.addEventListener('click', () => {
190
+ // Clean up before removing from DOM
191
+ element.destroy();
192
+ // Now safe to remove the element
193
+ document.querySelector('#hs-textarea-autoheight').remove();
194
+ });
195
+ }
196
+ ```
197
+
198
+ ## Common Patterns
199
+
200
+ ### Pattern 1: Custom Default Height
201
+
202
+ Set a custom default height for the textarea.
203
+
204
+ ```html
205
+ <textarea data-hs-textarea-auto-height='{
206
+ "defaultHeight": 100
207
+ }'></textarea>
208
+ ```
209
+
210
+ ### Pattern 2: Multiple Autoheight Textareas
211
+
212
+ Apply autoheight to multiple textareas.
213
+
214
+ ```html
215
+ <textarea id="hs-comment-first" data-hs-textarea-auto-height></textarea>
216
+ <textarea id="hs-comment-second" data-hs-textarea-auto-height></textarea>
217
+ ```
218
+
219
+ ## License
220
+
221
+ Copyright (c) 2026 Preline Labs.
222
+
223
+ Licensed under the [MIT License](https://opensource.org/licenses/MIT).
package/index.js CHANGED
@@ -1,17 +1,17 @@
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 i=t();for(var n in i)("object"==typeof exports?exports:e)[n]=i[n]}}(self,(()=>(()=>{"use strict";var e={2961:(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 i=t();for(var n in i)("object"==typeof exports?exports:e)[n]=i[n]}}(self,()=>(()=>{"use strict";var e={2961(e,t){
2
2
  /*
3
3
  * HSBasePlugin
4
- * @version: 4.1.3
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
- Object.defineProperty(t,"__esModule",{value:!0});t.default=class{constructor(e,t,i){this.el=e,this.options=t,this.events=i,this.el=e,this.options=t,this.events={}}createCollection(e,t){var i,n;let o=e;if(!Array.isArray(o)&&"undefined"!=typeof window){const e=null===(i=this.constructor)||void 0===i?void 0:i.name,t="string"==typeof e&&e.startsWith("HS")?`$hs${e.slice(2)}Collection`:null;t&&(Array.isArray(window[t])||(window[t]=[]),o=window[t])}Array.isArray(o)&&o.push({id:(null===(n=null==t?void 0:t.el)||void 0===n?void 0:n.id)||o.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}}},6473:function(e,t,i){
9
+ Object.defineProperty(t,"__esModule",{value:!0});t.default=class{constructor(e,t,i){this.el=e,this.options=t,this.events=i,this.el=e,this.options=t,this.events={}}createCollection(e,t){var i,n;let o=e;if(!Array.isArray(o)&&"undefined"!=typeof window){const e=null===(i=this.constructor)||void 0===i?void 0:i.name,t="string"==typeof e&&e.startsWith("HS")?`$hs${e.slice(2)}Collection`:null;t&&(Array.isArray(window[t])||(window[t]=[]),o=window[t])}Array.isArray(o)&&o.push({id:(null===(n=null==t?void 0:t.el)||void 0===n?void 0:n.id)||o.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}}},537(e,t,i){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=n(i(6473));window.addEventListener("load",()=>{o.default.autoInit()}),"undefined"!=typeof window&&(window.HSTextareaAutoHeight=o.default)},6473(e,t,i){
10
10
  /*
11
11
  * HSTextareaAutoHeight
12
- * @version: 4.1.3
12
+ * @version: 4.2.0
13
13
  * @author: Preline Labs Ltd.
14
14
  * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html)
15
15
  * Copyright 2024 Preline Labs Ltd.
16
16
  */
17
- var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=n(i(2961));class s extends o.default{constructor(e,t){super(e,t);const i=e.getAttribute("data-hs-copy-markup"),n=i?JSON.parse(i):{},o=Object.assign(Object.assign({},n),t);this.defaultHeight=(null==o?void 0:o.defaultHeight)||0,this.init()}elementInput(){this.textareaSetHeight(3)}init(){this.createCollection(window.$hsTextareaAutoHeightCollection,this),this.setAutoHeight()}setAutoHeight(){this.isParentHidden()?this.callbackAccordingToType():this.textareaSetHeight(3),this.onElementInputListener=()=>this.elementInput(),this.el.addEventListener("input",this.onElementInputListener)}textareaSetHeight(e=0){this.el.style.height="auto",this.el.style.height=this.checkIfOneLine()&&this.defaultHeight?`${this.defaultHeight}px`:`${this.el.scrollHeight+e}px`}checkIfOneLine(){const e=this.el.clientHeight;return!(this.el.scrollHeight>e)}isParentHidden(){return this.el.closest(".hs-overlay.hidden")||this.el.closest('[role="tabpanel"].hidden')||this.el.closest(".hs-collapse.hidden")}parentType(){return this.el.closest(".hs-collapse")?"collapse":this.el.closest(".hs-overlay")?"overlay":!!this.el.closest('[role="tabpanel"]')&&"tabs"}callbackAccordingToType(){var e;if("collapse"===this.parentType()){const e=this.el.closest(".hs-collapse").id,{element:t}=window.HSCollapse.getInstance(`[data-hs-collapse="#${e}"]`,!0);t.on("beforeOpen",(()=>{if(!this.el)return!1;this.textareaSetHeight(3)}))}else if("overlay"===this.parentType()){const e=window.HSOverlay.getInstance(this.el.closest(".hs-overlay"),!0);e.element.on("open",(()=>{window.$hsTextareaAutoHeightCollection.filter((({element:t})=>t.el.closest(".hs-overlay")===e.element.el)).forEach((({element:e})=>e.textareaSetHeight(3)))}))}else{if("tabs"!==this.parentType())return!1;{const t=null===(e=this.el.closest('[role="tabpanel"]'))||void 0===e?void 0:e.id,i=document.querySelector(`[data-hs-tab="#${t}"]`).closest('[role="tablist"]'),{element:n}=window.HSTabs.getInstance(i,!0)||null;n.on("change",(e=>{const t=document.querySelectorAll(`${e.current} [data-hs-textarea-auto-height]`);if(!t.length)return!1;t.forEach((e=>{const t=window.HSTextareaAutoHeight.getInstance(e,!0)||null;t&&t.element.textareaSetHeight(3)}))}))}}}destroy(){this.el.removeEventListener("input",this.onElementInputListener),window.$hsTextareaAutoHeightCollection=window.$hsTextareaAutoHeightCollection.filter((({element:e})=>e.el!==this.el))}static getInstance(e,t){const i=window.$hsTextareaAutoHeightCollection.find((t=>t.element.el===("string"==typeof e?document.querySelector(e):e)));return i?t?i:i.element:null}static autoInit(){window.$hsTextareaAutoHeightCollection||(window.$hsTextareaAutoHeightCollection=[]),window.$hsTextareaAutoHeightCollection&&(window.$hsTextareaAutoHeightCollection=window.$hsTextareaAutoHeightCollection.filter((({element:e})=>document.contains(e.el)))),document.querySelectorAll("[data-hs-textarea-auto-height]:not(.--prevent-on-load-init)").forEach((e=>{if(!window.$hsTextareaAutoHeightCollection.find((t=>{var i;return(null===(i=null==t?void 0:t.element)||void 0===i?void 0:i.el)===e}))){const t=e.getAttribute("data-hs-textarea-auto-height"),i=t?JSON.parse(t):{};new s(e,i)}}))}}t.default=s}},t={};var i=function i(n){var o=t[n];if(void 0!==o)return o.exports;var s=t[n]={exports:{}};return e[n].call(s.exports,s,s.exports,i),s.exports}(6473);return i})()));
17
+ var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=n(i(2961));class s extends o.default{constructor(e,t){super(e,t);const i=e.getAttribute("data-hs-copy-markup"),n=i?JSON.parse(i):{},o=Object.assign(Object.assign({},n),t);this.defaultHeight=(null==o?void 0:o.defaultHeight)||0,this.init()}elementInput(){this.textareaSetHeight(3)}init(){this.createCollection(window.$hsTextareaAutoHeightCollection,this),this.setAutoHeight()}setAutoHeight(){this.isParentHidden()?this.callbackAccordingToType():this.textareaSetHeight(3),this.onElementInputListener=()=>this.elementInput(),this.el.addEventListener("input",this.onElementInputListener)}textareaSetHeight(e=0){this.el.style.height="auto",this.el.style.height=this.checkIfOneLine()&&this.defaultHeight?`${this.defaultHeight}px`:`${this.el.scrollHeight+e}px`}checkIfOneLine(){const e=this.el.clientHeight;return!(this.el.scrollHeight>e)}isParentHidden(){return this.el.closest(".hs-overlay.hidden")||this.el.closest('[role="tabpanel"].hidden')||this.el.closest(".hs-collapse.hidden")}parentType(){return this.el.closest(".hs-collapse")?"collapse":this.el.closest(".hs-overlay")?"overlay":!!this.el.closest('[role="tabpanel"]')&&"tabs"}callbackAccordingToType(){var e;if("collapse"===this.parentType()){const e=this.el.closest(".hs-collapse").id,{element:t}=window.HSCollapse.getInstance(`[data-hs-collapse="#${e}"]`,!0);t.on("beforeOpen",()=>{if(!this.el)return!1;this.textareaSetHeight(3)})}else if("overlay"===this.parentType()){const e=window.HSOverlay.getInstance(this.el.closest(".hs-overlay"),!0);e.element.on("open",()=>{window.$hsTextareaAutoHeightCollection.filter(({element:t})=>t.el.closest(".hs-overlay")===e.element.el).forEach(({element:e})=>e.textareaSetHeight(3))})}else{if("tabs"!==this.parentType())return!1;{const t=null===(e=this.el.closest('[role="tabpanel"]'))||void 0===e?void 0:e.id,i=document.querySelector(`[data-hs-tab="#${t}"]`).closest('[role="tablist"]'),{element:n}=window.HSTabs.getInstance(i,!0)||null;n.on("change",e=>{const t=document.querySelectorAll(`${e.current} [data-hs-textarea-auto-height]`);if(!t.length)return!1;t.forEach(e=>{const t=window.HSTextareaAutoHeight.getInstance(e,!0)||null;t&&t.element.textareaSetHeight(3)})})}}}destroy(){this.el.removeEventListener("input",this.onElementInputListener),window.$hsTextareaAutoHeightCollection=window.$hsTextareaAutoHeightCollection.filter(({element:e})=>e.el!==this.el)}static getInstance(e,t){const i=window.$hsTextareaAutoHeightCollection.find(t=>t.element.el===("string"==typeof e?document.querySelector(e):e));return i?t?i:i.element:null}static autoInit(){window.$hsTextareaAutoHeightCollection||(window.$hsTextareaAutoHeightCollection=[]),window.$hsTextareaAutoHeightCollection&&(window.$hsTextareaAutoHeightCollection=window.$hsTextareaAutoHeightCollection.filter(({element:e})=>document.contains(e.el))),document.querySelectorAll("[data-hs-textarea-auto-height]:not(.--prevent-on-load-init)").forEach(e=>{if(!window.$hsTextareaAutoHeightCollection.find(t=>{var i;return(null===(i=null==t?void 0:t.element)||void 0===i?void 0:i.el)===e})){const t=e.getAttribute("data-hs-textarea-auto-height"),i=t?JSON.parse(t):{};new s(e,i)}})}}t.default=s}},t={};var i=function i(n){var o=t[n];if(void 0!==o)return o.exports;var s=t[n]={exports:{}};return e[n].call(s.exports,s,s.exports,i),s.exports}(537);return i})());
package/index.mjs CHANGED
@@ -1,16 +1,16 @@
1
- var e={615:(e,t,i)=>{i.d(t,{A:()=>n});
1
+ var e={7615(e,t,i){i.d(t,{A:()=>n});
2
2
  /*
3
3
  * HSBasePlugin
4
- * @version: 4.1.3
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 n{constructor(e,t,i){this.el=e,this.options=t,this.events=i,this.el=e,this.options=t,this.events={}}createCollection(e,t){var i,n;let o=e;if(!Array.isArray(o)&&"undefined"!=typeof window){const e=null===(i=this.constructor)||void 0===i?void 0:i.name,t="string"==typeof e&&e.startsWith("HS")?`$hs${e.slice(2)}Collection`:null;t&&(Array.isArray(window[t])||(window[t]=[]),o=window[t])}Array.isArray(o)&&o.push({id:(null===(n=null==t?void 0:t.el)||void 0===n?void 0:n.id)||o.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}}}},t={};function i(n){var o=t[n];if(void 0!==o)return o.exports;var s=t[n]={exports:{}};return e[n](s,s.exports,i),s.exports}i.d=(e,t)=>{for(var n in t)i.o(t,n)&&!i.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var n={};i.d(n,{A:()=>l});var o=i(615);
9
+ class n{constructor(e,t,i){this.el=e,this.options=t,this.events=i,this.el=e,this.options=t,this.events={}}createCollection(e,t){var i,n;let o=e;if(!Array.isArray(o)&&"undefined"!=typeof window){const e=null===(i=this.constructor)||void 0===i?void 0:i.name,t="string"==typeof e&&e.startsWith("HS")?`$hs${e.slice(2)}Collection`:null;t&&(Array.isArray(window[t])||(window[t]=[]),o=window[t])}Array.isArray(o)&&o.push({id:(null===(n=null==t?void 0:t.el)||void 0===n?void 0:n.id)||o.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}}},6955(e,t,i){i.d(t,{A:()=>s});var n=i(7615);
10
10
  /*
11
11
  * HSTextareaAutoHeight
12
- * @version: 4.1.3
12
+ * @version: 4.2.0
13
13
  * @author: Preline Labs Ltd.
14
14
  * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html)
15
15
  * Copyright 2024 Preline Labs Ltd.
16
- */class s extends o.A{constructor(e,t){super(e,t);const i=e.getAttribute("data-hs-copy-markup"),n=i?JSON.parse(i):{},o=Object.assign(Object.assign({},n),t);this.defaultHeight=(null==o?void 0:o.defaultHeight)||0,this.init()}elementInput(){this.textareaSetHeight(3)}init(){this.createCollection(window.$hsTextareaAutoHeightCollection,this),this.setAutoHeight()}setAutoHeight(){this.isParentHidden()?this.callbackAccordingToType():this.textareaSetHeight(3),this.onElementInputListener=()=>this.elementInput(),this.el.addEventListener("input",this.onElementInputListener)}textareaSetHeight(e=0){this.el.style.height="auto",this.el.style.height=this.checkIfOneLine()&&this.defaultHeight?`${this.defaultHeight}px`:`${this.el.scrollHeight+e}px`}checkIfOneLine(){const e=this.el.clientHeight;return!(this.el.scrollHeight>e)}isParentHidden(){return this.el.closest(".hs-overlay.hidden")||this.el.closest('[role="tabpanel"].hidden')||this.el.closest(".hs-collapse.hidden")}parentType(){return this.el.closest(".hs-collapse")?"collapse":this.el.closest(".hs-overlay")?"overlay":!!this.el.closest('[role="tabpanel"]')&&"tabs"}callbackAccordingToType(){var e;if("collapse"===this.parentType()){const e=this.el.closest(".hs-collapse").id,{element:t}=window.HSCollapse.getInstance(`[data-hs-collapse="#${e}"]`,!0);t.on("beforeOpen",(()=>{if(!this.el)return!1;this.textareaSetHeight(3)}))}else if("overlay"===this.parentType()){const e=window.HSOverlay.getInstance(this.el.closest(".hs-overlay"),!0);e.element.on("open",(()=>{window.$hsTextareaAutoHeightCollection.filter((({element:t})=>t.el.closest(".hs-overlay")===e.element.el)).forEach((({element:e})=>e.textareaSetHeight(3)))}))}else{if("tabs"!==this.parentType())return!1;{const t=null===(e=this.el.closest('[role="tabpanel"]'))||void 0===e?void 0:e.id,i=document.querySelector(`[data-hs-tab="#${t}"]`).closest('[role="tablist"]'),{element:n}=window.HSTabs.getInstance(i,!0)||null;n.on("change",(e=>{const t=document.querySelectorAll(`${e.current} [data-hs-textarea-auto-height]`);if(!t.length)return!1;t.forEach((e=>{const t=window.HSTextareaAutoHeight.getInstance(e,!0)||null;t&&t.element.textareaSetHeight(3)}))}))}}}destroy(){this.el.removeEventListener("input",this.onElementInputListener),window.$hsTextareaAutoHeightCollection=window.$hsTextareaAutoHeightCollection.filter((({element:e})=>e.el!==this.el))}static getInstance(e,t){const i=window.$hsTextareaAutoHeightCollection.find((t=>t.element.el===("string"==typeof e?document.querySelector(e):e)));return i?t?i:i.element:null}static autoInit(){window.$hsTextareaAutoHeightCollection||(window.$hsTextareaAutoHeightCollection=[]),window.$hsTextareaAutoHeightCollection&&(window.$hsTextareaAutoHeightCollection=window.$hsTextareaAutoHeightCollection.filter((({element:e})=>document.contains(e.el)))),document.querySelectorAll("[data-hs-textarea-auto-height]:not(.--prevent-on-load-init)").forEach((e=>{if(!window.$hsTextareaAutoHeightCollection.find((t=>{var i;return(null===(i=null==t?void 0:t.element)||void 0===i?void 0:i.el)===e}))){const t=e.getAttribute("data-hs-textarea-auto-height"),i=t?JSON.parse(t):{};new s(e,i)}}))}}const l=s;var a=n.A;export{a as default};
16
+ */class o extends n.A{constructor(e,t){super(e,t);const i=e.getAttribute("data-hs-copy-markup"),n=i?JSON.parse(i):{},o=Object.assign(Object.assign({},n),t);this.defaultHeight=(null==o?void 0:o.defaultHeight)||0,this.init()}elementInput(){this.textareaSetHeight(3)}init(){this.createCollection(window.$hsTextareaAutoHeightCollection,this),this.setAutoHeight()}setAutoHeight(){this.isParentHidden()?this.callbackAccordingToType():this.textareaSetHeight(3),this.onElementInputListener=()=>this.elementInput(),this.el.addEventListener("input",this.onElementInputListener)}textareaSetHeight(e=0){this.el.style.height="auto",this.el.style.height=this.checkIfOneLine()&&this.defaultHeight?`${this.defaultHeight}px`:`${this.el.scrollHeight+e}px`}checkIfOneLine(){const e=this.el.clientHeight;return!(this.el.scrollHeight>e)}isParentHidden(){return this.el.closest(".hs-overlay.hidden")||this.el.closest('[role="tabpanel"].hidden')||this.el.closest(".hs-collapse.hidden")}parentType(){return this.el.closest(".hs-collapse")?"collapse":this.el.closest(".hs-overlay")?"overlay":!!this.el.closest('[role="tabpanel"]')&&"tabs"}callbackAccordingToType(){var e;if("collapse"===this.parentType()){const e=this.el.closest(".hs-collapse").id,{element:t}=window.HSCollapse.getInstance(`[data-hs-collapse="#${e}"]`,!0);t.on("beforeOpen",()=>{if(!this.el)return!1;this.textareaSetHeight(3)})}else if("overlay"===this.parentType()){const e=window.HSOverlay.getInstance(this.el.closest(".hs-overlay"),!0);e.element.on("open",()=>{window.$hsTextareaAutoHeightCollection.filter(({element:t})=>t.el.closest(".hs-overlay")===e.element.el).forEach(({element:e})=>e.textareaSetHeight(3))})}else{if("tabs"!==this.parentType())return!1;{const t=null===(e=this.el.closest('[role="tabpanel"]'))||void 0===e?void 0:e.id,i=document.querySelector(`[data-hs-tab="#${t}"]`).closest('[role="tablist"]'),{element:n}=window.HSTabs.getInstance(i,!0)||null;n.on("change",e=>{const t=document.querySelectorAll(`${e.current} [data-hs-textarea-auto-height]`);if(!t.length)return!1;t.forEach(e=>{const t=window.HSTextareaAutoHeight.getInstance(e,!0)||null;t&&t.element.textareaSetHeight(3)})})}}}destroy(){this.el.removeEventListener("input",this.onElementInputListener),window.$hsTextareaAutoHeightCollection=window.$hsTextareaAutoHeightCollection.filter(({element:e})=>e.el!==this.el)}static getInstance(e,t){const i=window.$hsTextareaAutoHeightCollection.find(t=>t.element.el===("string"==typeof e?document.querySelector(e):e));return i?t?i:i.element:null}static autoInit(){window.$hsTextareaAutoHeightCollection||(window.$hsTextareaAutoHeightCollection=[]),window.$hsTextareaAutoHeightCollection&&(window.$hsTextareaAutoHeightCollection=window.$hsTextareaAutoHeightCollection.filter(({element:e})=>document.contains(e.el))),document.querySelectorAll("[data-hs-textarea-auto-height]:not(.--prevent-on-load-init)").forEach(e=>{if(!window.$hsTextareaAutoHeightCollection.find(t=>{var i;return(null===(i=null==t?void 0:t.element)||void 0===i?void 0:i.el)===e})){const t=e.getAttribute("data-hs-textarea-auto-height"),i=t?JSON.parse(t):{};new o(e,i)}})}}const s=o}},t={};function i(n){var o=t[n];if(void 0!==o)return o.exports;var s=t[n]={exports:{}};return e[n](s,s.exports,i),s.exports}i.d=(e,t)=>{for(var n in t)i.o(t,n)&&!i.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var n=i(6955);window.addEventListener("load",()=>{n.A.autoInit()}),"undefined"!=typeof window&&(window.HSTextareaAutoHeight=n.A);
package/non-auto.js ADDED
@@ -0,0 +1,17 @@
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 i=t();for(var n in i)("object"==typeof exports?exports:e)[n]=i[n]}}(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,i){this.el=e,this.options=t,this.events=i,this.el=e,this.options=t,this.events={}}createCollection(e,t){var i,n;let o=e;if(!Array.isArray(o)&&"undefined"!=typeof window){const e=null===(i=this.constructor)||void 0===i?void 0:i.name,t="string"==typeof e&&e.startsWith("HS")?`$hs${e.slice(2)}Collection`:null;t&&(Array.isArray(window[t])||(window[t]=[]),o=window[t])}Array.isArray(o)&&o.push({id:(null===(n=null==t?void 0:t.el)||void 0===n?void 0:n.id)||o.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}}},6473(e,t,i){
10
+ /*
11
+ * HSTextareaAutoHeight
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 n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=n(i(2961));class s extends o.default{constructor(e,t){super(e,t);const i=e.getAttribute("data-hs-copy-markup"),n=i?JSON.parse(i):{},o=Object.assign(Object.assign({},n),t);this.defaultHeight=(null==o?void 0:o.defaultHeight)||0,this.init()}elementInput(){this.textareaSetHeight(3)}init(){this.createCollection(window.$hsTextareaAutoHeightCollection,this),this.setAutoHeight()}setAutoHeight(){this.isParentHidden()?this.callbackAccordingToType():this.textareaSetHeight(3),this.onElementInputListener=()=>this.elementInput(),this.el.addEventListener("input",this.onElementInputListener)}textareaSetHeight(e=0){this.el.style.height="auto",this.el.style.height=this.checkIfOneLine()&&this.defaultHeight?`${this.defaultHeight}px`:`${this.el.scrollHeight+e}px`}checkIfOneLine(){const e=this.el.clientHeight;return!(this.el.scrollHeight>e)}isParentHidden(){return this.el.closest(".hs-overlay.hidden")||this.el.closest('[role="tabpanel"].hidden')||this.el.closest(".hs-collapse.hidden")}parentType(){return this.el.closest(".hs-collapse")?"collapse":this.el.closest(".hs-overlay")?"overlay":!!this.el.closest('[role="tabpanel"]')&&"tabs"}callbackAccordingToType(){var e;if("collapse"===this.parentType()){const e=this.el.closest(".hs-collapse").id,{element:t}=window.HSCollapse.getInstance(`[data-hs-collapse="#${e}"]`,!0);t.on("beforeOpen",()=>{if(!this.el)return!1;this.textareaSetHeight(3)})}else if("overlay"===this.parentType()){const e=window.HSOverlay.getInstance(this.el.closest(".hs-overlay"),!0);e.element.on("open",()=>{window.$hsTextareaAutoHeightCollection.filter(({element:t})=>t.el.closest(".hs-overlay")===e.element.el).forEach(({element:e})=>e.textareaSetHeight(3))})}else{if("tabs"!==this.parentType())return!1;{const t=null===(e=this.el.closest('[role="tabpanel"]'))||void 0===e?void 0:e.id,i=document.querySelector(`[data-hs-tab="#${t}"]`).closest('[role="tablist"]'),{element:n}=window.HSTabs.getInstance(i,!0)||null;n.on("change",e=>{const t=document.querySelectorAll(`${e.current} [data-hs-textarea-auto-height]`);if(!t.length)return!1;t.forEach(e=>{const t=window.HSTextareaAutoHeight.getInstance(e,!0)||null;t&&t.element.textareaSetHeight(3)})})}}}destroy(){this.el.removeEventListener("input",this.onElementInputListener),window.$hsTextareaAutoHeightCollection=window.$hsTextareaAutoHeightCollection.filter(({element:e})=>e.el!==this.el)}static getInstance(e,t){const i=window.$hsTextareaAutoHeightCollection.find(t=>t.element.el===("string"==typeof e?document.querySelector(e):e));return i?t?i:i.element:null}static autoInit(){window.$hsTextareaAutoHeightCollection||(window.$hsTextareaAutoHeightCollection=[]),window.$hsTextareaAutoHeightCollection&&(window.$hsTextareaAutoHeightCollection=window.$hsTextareaAutoHeightCollection.filter(({element:e})=>document.contains(e.el))),document.querySelectorAll("[data-hs-textarea-auto-height]:not(.--prevent-on-load-init)").forEach(e=>{if(!window.$hsTextareaAutoHeightCollection.find(t=>{var i;return(null===(i=null==t?void 0:t.element)||void 0===i?void 0:i.el)===e})){const t=e.getAttribute("data-hs-textarea-auto-height"),i=t?JSON.parse(t):{};new s(e,i)}})}}t.default=s}},t={};var i=function i(n){var o=t[n];if(void 0!==o)return o.exports;var s=t[n]={exports:{}};return e[n].call(s.exports,s,s.exports,i),s.exports}(6473);return i})());
package/non-auto.mjs ADDED
@@ -0,0 +1,16 @@
1
+ var e={7615(e,t,i){i.d(t,{A:()=>n});
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 n{constructor(e,t,i){this.el=e,this.options=t,this.events=i,this.el=e,this.options=t,this.events={}}createCollection(e,t){var i,n;let o=e;if(!Array.isArray(o)&&"undefined"!=typeof window){const e=null===(i=this.constructor)||void 0===i?void 0:i.name,t="string"==typeof e&&e.startsWith("HS")?`$hs${e.slice(2)}Collection`:null;t&&(Array.isArray(window[t])||(window[t]=[]),o=window[t])}Array.isArray(o)&&o.push({id:(null===(n=null==t?void 0:t.el)||void 0===n?void 0:n.id)||o.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}}}},t={};function i(n){var o=t[n];if(void 0!==o)return o.exports;var s=t[n]={exports:{}};return e[n](s,s.exports,i),s.exports}i.d=(e,t)=>{for(var n in t)i.o(t,n)&&!i.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var n={};i.d(n,{A:()=>l});var o=i(7615);
10
+ /*
11
+ * HSTextareaAutoHeight
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
+ */class s extends o.A{constructor(e,t){super(e,t);const i=e.getAttribute("data-hs-copy-markup"),n=i?JSON.parse(i):{},o=Object.assign(Object.assign({},n),t);this.defaultHeight=(null==o?void 0:o.defaultHeight)||0,this.init()}elementInput(){this.textareaSetHeight(3)}init(){this.createCollection(window.$hsTextareaAutoHeightCollection,this),this.setAutoHeight()}setAutoHeight(){this.isParentHidden()?this.callbackAccordingToType():this.textareaSetHeight(3),this.onElementInputListener=()=>this.elementInput(),this.el.addEventListener("input",this.onElementInputListener)}textareaSetHeight(e=0){this.el.style.height="auto",this.el.style.height=this.checkIfOneLine()&&this.defaultHeight?`${this.defaultHeight}px`:`${this.el.scrollHeight+e}px`}checkIfOneLine(){const e=this.el.clientHeight;return!(this.el.scrollHeight>e)}isParentHidden(){return this.el.closest(".hs-overlay.hidden")||this.el.closest('[role="tabpanel"].hidden')||this.el.closest(".hs-collapse.hidden")}parentType(){return this.el.closest(".hs-collapse")?"collapse":this.el.closest(".hs-overlay")?"overlay":!!this.el.closest('[role="tabpanel"]')&&"tabs"}callbackAccordingToType(){var e;if("collapse"===this.parentType()){const e=this.el.closest(".hs-collapse").id,{element:t}=window.HSCollapse.getInstance(`[data-hs-collapse="#${e}"]`,!0);t.on("beforeOpen",()=>{if(!this.el)return!1;this.textareaSetHeight(3)})}else if("overlay"===this.parentType()){const e=window.HSOverlay.getInstance(this.el.closest(".hs-overlay"),!0);e.element.on("open",()=>{window.$hsTextareaAutoHeightCollection.filter(({element:t})=>t.el.closest(".hs-overlay")===e.element.el).forEach(({element:e})=>e.textareaSetHeight(3))})}else{if("tabs"!==this.parentType())return!1;{const t=null===(e=this.el.closest('[role="tabpanel"]'))||void 0===e?void 0:e.id,i=document.querySelector(`[data-hs-tab="#${t}"]`).closest('[role="tablist"]'),{element:n}=window.HSTabs.getInstance(i,!0)||null;n.on("change",e=>{const t=document.querySelectorAll(`${e.current} [data-hs-textarea-auto-height]`);if(!t.length)return!1;t.forEach(e=>{const t=window.HSTextareaAutoHeight.getInstance(e,!0)||null;t&&t.element.textareaSetHeight(3)})})}}}destroy(){this.el.removeEventListener("input",this.onElementInputListener),window.$hsTextareaAutoHeightCollection=window.$hsTextareaAutoHeightCollection.filter(({element:e})=>e.el!==this.el)}static getInstance(e,t){const i=window.$hsTextareaAutoHeightCollection.find(t=>t.element.el===("string"==typeof e?document.querySelector(e):e));return i?t?i:i.element:null}static autoInit(){window.$hsTextareaAutoHeightCollection||(window.$hsTextareaAutoHeightCollection=[]),window.$hsTextareaAutoHeightCollection&&(window.$hsTextareaAutoHeightCollection=window.$hsTextareaAutoHeightCollection.filter(({element:e})=>document.contains(e.el))),document.querySelectorAll("[data-hs-textarea-auto-height]:not(.--prevent-on-load-init)").forEach(e=>{if(!window.$hsTextareaAutoHeightCollection.find(t=>{var i;return(null===(i=null==t?void 0:t.element)||void 0===i?void 0:i.el)===e})){const t=e.getAttribute("data-hs-textarea-auto-height"),i=t?JSON.parse(t):{};new s(e,i)}})}}const l=s,a=n.A;export{a as default};
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@preline/textarea-auto-height",
3
- "version": "4.1.3",
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/textarea-auto-height.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", "textarea auto height"],
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
+ }