@lumiastream/ui 0.2.0 → 0.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/dist/index.d.ts +212 -1
  2. package/dist/index.js +1310 -6
  3. package/package.json +13 -4
package/dist/index.js CHANGED
@@ -21,7 +21,7 @@ function styleInject(css, { insertAt } = {}) {
21
21
  }
22
22
 
23
23
  // src/tailwind.css
24
- styleInject('/*! tailwindcss v4.2.1 | MIT License | https://tailwindcss.com */\n@layer theme, base, components, utilities;\n@layer theme {\n :root,\n :host {\n --font-sans:\n ui-sans-serif,\n system-ui,\n sans-serif,\n "Apple Color Emoji",\n "Segoe UI Emoji",\n "Segoe UI Symbol",\n "Noto Color Emoji";\n --font-mono:\n ui-monospace,\n SFMono-Regular,\n Menlo,\n Monaco,\n Consolas,\n "Liberation Mono",\n "Courier New",\n monospace;\n --color-blue-500: oklch(62.3% 0.214 259.815);\n --color-gray-500: oklch(55.1% 0.027 264.364);\n --spacing: 0.25rem;\n --text-sm: 0.875rem;\n --text-sm--line-height: calc(1.25 / 0.875);\n --text-base: 1rem;\n --text-base--line-height: calc(1.5 / 1);\n --text-lg: 1.125rem;\n --text-lg--line-height: calc(1.75 / 1.125);\n --default-font-family: var(--font-sans);\n --default-mono-font-family: var(--font-mono);\n }\n}\n@layer base {\n *,\n ::after,\n ::before,\n ::backdrop,\n ::file-selector-button {\n box-sizing: border-box;\n margin: 0;\n padding: 0;\n border: 0 solid;\n }\n html,\n :host {\n line-height: 1.5;\n -webkit-text-size-adjust: 100%;\n tab-size: 4;\n font-family: var(--default-font-family, ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");\n font-feature-settings: var(--default-font-feature-settings, normal);\n font-variation-settings: var(--default-font-variation-settings, normal);\n -webkit-tap-highlight-color: transparent;\n }\n hr {\n height: 0;\n color: inherit;\n border-top-width: 1px;\n }\n abbr:where([title]) {\n -webkit-text-decoration: underline dotted;\n text-decoration: underline dotted;\n }\n h1,\n h2,\n h3,\n h4,\n h5,\n h6 {\n font-size: inherit;\n font-weight: inherit;\n }\n a {\n color: inherit;\n -webkit-text-decoration: inherit;\n text-decoration: inherit;\n }\n b,\n strong {\n font-weight: bolder;\n }\n code,\n kbd,\n samp,\n pre {\n font-family: var(--default-mono-font-family, ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);\n font-feature-settings: var(--default-mono-font-feature-settings, normal);\n font-variation-settings: var(--default-mono-font-variation-settings, normal);\n font-size: 1em;\n }\n small {\n font-size: 80%;\n }\n sub,\n sup {\n font-size: 75%;\n line-height: 0;\n position: relative;\n vertical-align: baseline;\n }\n sub {\n bottom: -0.25em;\n }\n sup {\n top: -0.5em;\n }\n table {\n text-indent: 0;\n border-color: inherit;\n border-collapse: collapse;\n }\n :-moz-focusring {\n outline: auto;\n }\n progress {\n vertical-align: baseline;\n }\n summary {\n display: list-item;\n }\n ol,\n ul,\n menu {\n list-style: none;\n }\n img,\n svg,\n video,\n canvas,\n audio,\n iframe,\n embed,\n object {\n display: block;\n vertical-align: middle;\n }\n img,\n video {\n max-width: 100%;\n height: auto;\n }\n button,\n input,\n select,\n optgroup,\n textarea,\n ::file-selector-button {\n font: inherit;\n font-feature-settings: inherit;\n font-variation-settings: inherit;\n letter-spacing: inherit;\n color: inherit;\n border-radius: 0;\n background-color: transparent;\n opacity: 1;\n }\n :where(select:is([multiple], [size])) optgroup {\n font-weight: bolder;\n }\n :where(select:is([multiple], [size])) optgroup option {\n padding-inline-start: 20px;\n }\n ::file-selector-button {\n margin-inline-end: 4px;\n }\n ::placeholder {\n opacity: 1;\n }\n @supports (not (-webkit-appearance: -apple-pay-button)) or (contain-intrinsic-size: 1px) {\n ::placeholder {\n color: currentcolor;\n @supports (color: color-mix(in lab, red, red)) {\n color: color-mix(in oklab, currentcolor 50%, transparent);\n }\n }\n }\n textarea {\n resize: vertical;\n }\n ::-webkit-search-decoration {\n -webkit-appearance: none;\n }\n ::-webkit-date-and-time-value {\n min-height: 1lh;\n text-align: inherit;\n }\n ::-webkit-datetime-edit {\n display: inline-flex;\n }\n ::-webkit-datetime-edit-fields-wrapper {\n padding: 0;\n }\n ::-webkit-datetime-edit,\n ::-webkit-datetime-edit-year-field,\n ::-webkit-datetime-edit-month-field,\n ::-webkit-datetime-edit-day-field,\n ::-webkit-datetime-edit-hour-field,\n ::-webkit-datetime-edit-minute-field,\n ::-webkit-datetime-edit-second-field,\n ::-webkit-datetime-edit-millisecond-field,\n ::-webkit-datetime-edit-meridiem-field {\n padding-block: 0;\n }\n ::-webkit-calendar-picker-indicator {\n line-height: 1;\n }\n :-moz-ui-invalid {\n box-shadow: none;\n }\n button,\n input:where([type=button], [type=reset], [type=submit]),\n ::file-selector-button {\n appearance: button;\n }\n ::-webkit-inner-spin-button,\n ::-webkit-outer-spin-button {\n height: auto;\n }\n [hidden]:where(:not([hidden=until-found])) {\n display: none !important;\n }\n}\n@layer utilities {\n .static {\n position: static;\n }\n .start {\n inset-inline-start: var(--spacing);\n }\n .end {\n inset-inline-end: var(--spacing);\n }\n .block {\n display: block;\n }\n .contents {\n display: contents;\n }\n .bg-blue-500 {\n background-color: var(--color-blue-500);\n }\n .bg-gray-500 {\n background-color: var(--color-gray-500);\n }\n .px-3 {\n padding-inline: calc(var(--spacing) * 3);\n }\n .px-4 {\n padding-inline: calc(var(--spacing) * 4);\n }\n .px-6 {\n padding-inline: calc(var(--spacing) * 6);\n }\n .py-1 {\n padding-block: calc(var(--spacing) * 1);\n }\n .py-2 {\n padding-block: calc(var(--spacing) * 2);\n }\n .py-3 {\n padding-block: calc(var(--spacing) * 3);\n }\n .text-base {\n font-size: var(--text-base);\n line-height: var(--tw-leading, var(--text-base--line-height));\n }\n .text-lg {\n font-size: var(--text-lg);\n line-height: var(--tw-leading, var(--text-lg--line-height));\n }\n .text-sm {\n font-size: var(--text-sm);\n line-height: var(--tw-leading, var(--text-sm--line-height));\n }\n}\n');
24
+ styleInject('/*! tailwindcss v4.2.1 | MIT License | https://tailwindcss.com */\n@layer properties;\n:root,\n:host {\n --color-white: #fff;\n --spacing: 0.25rem;\n --text-sm: 0.875rem;\n --text-sm--line-height: calc(1.25 / 0.875);\n --text-base: 1rem;\n --text-base--line-height: calc(1.5 / 1);\n --text-lg: 1.125rem;\n --text-lg--line-height: calc(1.75 / 1.125);\n --font-weight-medium: 500;\n --font-weight-semibold: 600;\n --radius-md: 0.375rem;\n --default-transition-duration: 150ms;\n --default-transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n}\n.visible {\n visibility: visible;\n}\n.absolute {\n position: absolute;\n}\n.relative {\n position: relative;\n}\n.static {\n position: static;\n}\n.start {\n inset-inline-start: var(--spacing);\n}\n.end {\n inset-inline-end: var(--spacing);\n}\n.mb-1 {\n margin-bottom: calc(var(--spacing) * 1);\n}\n.mb-4 {\n margin-bottom: calc(var(--spacing) * 4);\n}\n.ml-2 {\n margin-left: calc(var(--spacing) * 2);\n}\n.block {\n display: block;\n}\n.contents {\n display: contents;\n}\n.flex {\n display: flex;\n}\n.grid {\n display: grid;\n}\n.inline-flex {\n display: inline-flex;\n}\n.h-6 {\n height: calc(var(--spacing) * 6);\n}\n.h-full {\n height: 100%;\n}\n.max-h-\\[55vh\\] {\n max-height: 55vh;\n}\n.min-h-\\[50vh\\] {\n min-height: 50vh;\n}\n.min-h-screen {\n min-height: 100vh;\n}\n.w-6 {\n width: calc(var(--spacing) * 6);\n}\n.w-\\[92vw\\] {\n width: 92vw;\n}\n.w-full {\n width: 100%;\n}\n.max-w-\\[600px\\] {\n max-width: 600px;\n}\n.max-w-\\[1100px\\] {\n max-width: 1100px;\n}\n.min-w-0 {\n min-width: calc(var(--spacing) * 0);\n}\n.flex-1 {\n flex: 1;\n}\n.shrink {\n flex-shrink: 1;\n}\n.shrink-0 {\n flex-shrink: 0;\n}\n.transform {\n transform: var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);\n}\n.cursor-pointer {\n cursor: pointer;\n}\n.grid-cols-\\[minmax\\(300px\\,1\\.5fr\\)_2fr\\] {\n grid-template-columns: minmax(300px, 1.5fr) 2fr;\n}\n.flex-col {\n flex-direction: column;\n}\n.flex-nowrap {\n flex-wrap: nowrap;\n}\n.items-center {\n align-items: center;\n}\n.items-start {\n align-items: flex-start;\n}\n.justify-between {\n justify-content: space-between;\n}\n.gap-2 {\n gap: calc(var(--spacing) * 2);\n}\n.gap-8 {\n gap: calc(var(--spacing) * 8);\n}\n.overflow-auto {\n overflow: auto;\n}\n.overflow-hidden {\n overflow: hidden;\n}\n.rounded {\n border-radius: 0.25rem;\n}\n.rounded-md {\n border-radius: var(--radius-md);\n}\n.border {\n border-style: var(--tw-border-style);\n border-width: 1px;\n}\n.border-b {\n border-bottom-style: var(--tw-border-style);\n border-bottom-width: 1px;\n}\n.border-current {\n border-color: currentcolor;\n}\n.border-white\\/10 {\n border-color: color-mix(in srgb, #fff 10%, transparent);\n @supports (color: color-mix(in lab, red, red)) {\n border-color: color-mix(in oklab, var(--color-white) 10%, transparent);\n }\n}\n.border-white\\/25 {\n border-color: color-mix(in srgb, #fff 25%, transparent);\n @supports (color: color-mix(in lab, red, red)) {\n border-color: color-mix(in oklab, var(--color-white) 25%, transparent);\n }\n}\n.bg-\\[\\#1b1a28\\] {\n background-color: #1b1a28;\n}\n.bg-cover {\n background-size: cover;\n}\n.bg-center {\n background-position: center;\n}\n.bg-no-repeat {\n background-repeat: no-repeat;\n}\n.p-0 {\n padding: calc(var(--spacing) * 0);\n}\n.p-6 {\n padding: calc(var(--spacing) * 6);\n}\n.px-1 {\n padding-inline: calc(var(--spacing) * 1);\n}\n.px-3 {\n padding-inline: calc(var(--spacing) * 3);\n}\n.px-4 {\n padding-inline: calc(var(--spacing) * 4);\n}\n.px-6 {\n padding-inline: calc(var(--spacing) * 6);\n}\n.py-0 {\n padding-block: calc(var(--spacing) * 0);\n}\n.py-1 {\n padding-block: calc(var(--spacing) * 1);\n}\n.py-2 {\n padding-block: calc(var(--spacing) * 2);\n}\n.py-3 {\n padding-block: calc(var(--spacing) * 3);\n}\n.py-4 {\n padding-block: calc(var(--spacing) * 4);\n}\n.pr-4 {\n padding-right: calc(var(--spacing) * 4);\n}\n.text-base {\n font-size: var(--text-base);\n line-height: var(--tw-leading, var(--text-base--line-height));\n}\n.text-lg {\n font-size: var(--text-lg);\n line-height: var(--tw-leading, var(--text-lg--line-height));\n}\n.text-sm {\n font-size: var(--text-sm);\n line-height: var(--tw-leading, var(--text-sm--line-height));\n}\n.text-\\[10px\\] {\n font-size: 10px;\n}\n.leading-\\[1\\.25\\] {\n --tw-leading: 1.25;\n line-height: 1.25;\n}\n.leading-none {\n --tw-leading: 1;\n line-height: 1;\n}\n.font-medium {\n --tw-font-weight: var(--font-weight-medium);\n font-weight: var(--font-weight-medium);\n}\n.font-semibold {\n --tw-font-weight: var(--font-weight-semibold);\n font-weight: var(--font-weight-semibold);\n}\n.break-words {\n overflow-wrap: break-word;\n}\n.break-all {\n word-break: break-all;\n}\n.text-ellipsis {\n text-overflow: ellipsis;\n}\n.whitespace-nowrap {\n white-space: nowrap;\n}\n.text-\\[\\#f4f3ff\\] {\n color: #f4f3ff;\n}\n.text-\\[var\\(--customVariables\\,\\#69ffd2\\)\\] {\n color: var(--customVariables,#69ffd2);\n}\n.text-\\[var\\(--functionVariables\\,var\\(--semanticPurple\\,\\#b489ff\\)\\)\\] {\n color: var(--functionVariables,var(--semanticPurple,#b489ff));\n}\n.text-\\[var\\(--neutralLight1\\,\\#f4f3ff\\)\\] {\n color: var(--neutralLight1,#f4f3ff);\n}\n.text-\\[var\\(--neutralLight2\\,\\#cac9d5\\)\\] {\n color: var(--neutralLight2,#cac9d5);\n}\n.text-\\[var\\(--neutralLight3\\,\\#9392a1\\)\\] {\n color: var(--neutralLight3,#9392a1);\n}\n.text-\\[var\\(--normalVariables\\,var\\(--semanticBlue\\,\\#65b8ff\\)\\)\\] {\n color: var(--normalVariables,var(--semanticBlue,#65b8ff));\n}\n.uppercase {\n text-transform: uppercase;\n}\n.shadow-\\[0_0_0_1px_rgba\\(0\\,0\\,0\\,0\\.25\\)\\] {\n --tw-shadow: 0 0 0 1px var(--tw-shadow-color, rgba(0,0,0,0.25));\n box-shadow:\n var(--tw-inset-shadow),\n var(--tw-inset-ring-shadow),\n var(--tw-ring-offset-shadow),\n var(--tw-ring-shadow),\n var(--tw-shadow);\n}\n.shadow-\\[0_8px_18px_rgba\\(0\\,0\\,0\\,0\\.18\\)\\] {\n --tw-shadow: 0 8px 18px var(--tw-shadow-color, rgba(0,0,0,0.18));\n box-shadow:\n var(--tw-inset-shadow),\n var(--tw-inset-ring-shadow),\n var(--tw-ring-offset-shadow),\n var(--tw-ring-shadow),\n var(--tw-shadow);\n}\n.filter {\n filter: var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,);\n}\n.transition {\n transition-property:\n color,\n background-color,\n border-color,\n outline-color,\n text-decoration-color,\n fill,\n stroke,\n --tw-gradient-from,\n --tw-gradient-via,\n --tw-gradient-to,\n opacity,\n box-shadow,\n transform,\n translate,\n scale,\n rotate,\n filter,\n -webkit-backdrop-filter,\n backdrop-filter,\n display,\n content-visibility,\n overlay,\n pointer-events;\n transition-timing-function: var(--tw-ease, var(--default-transition-timing-function));\n transition-duration: var(--tw-duration, var(--default-transition-duration));\n}\n.\\[--neutralDark1\\:\\#1b1a28\\] {\n --neutralDark1: #1b1a28;\n}\n.\\[--neutralDark2\\:\\#252338\\] {\n --neutralDark2: #252338;\n}\n.\\[--neutralDark3\\:\\#312f47\\] {\n --neutralDark3: #312f47;\n}\n.\\[--neutralDark4\\:\\#46435f\\] {\n --neutralDark4: #46435f;\n}\n.\\[--neutralLight1\\:\\#f4f3ff\\] {\n --neutralLight1: #f4f3ff;\n}\n.\\[--neutralLight2\\:\\#cac9d5\\] {\n --neutralLight2: #cac9d5;\n}\n.\\[--neutralLight3\\:\\#9f9eb2\\] {\n --neutralLight3: #9f9eb2;\n}\n.\\[--primary\\:\\#ff4076\\] {\n --primary: #ff4076;\n}\n.\\[--radiusContainer\\:12px\\] {\n --radiusContainer: 12px;\n}\n.\\[--radiusContainerSm\\:10px\\] {\n --radiusContainerSm: 10px;\n}\n.\\[--secondary\\:\\#5f5dff\\] {\n --secondary: #5f5dff;\n}\n.\\[--variable-custom-color\\:var\\(--customVariables\\,\\#69ffd2\\)\\] {\n --variable-custom-color: var(--customVariables,#69ffd2);\n}\n.\\[--variable-function-color\\:var\\(--functionVariables\\,var\\(--semanticPurple\\,\\#b489ff\\)\\)\\] {\n --variable-function-color: var(--functionVariables,var(--semanticPurple,#b489ff));\n}\n.\\[--variable-normal-color\\:var\\(--normalVariables\\,var\\(--semanticBlue\\,\\#65b8ff\\)\\)\\] {\n --variable-normal-color: var(--normalVariables,var(--semanticBlue,#65b8ff));\n}\n.hover\\:brightness-110 {\n &:hover {\n @media (hover: hover) {\n --tw-brightness: brightness(110%);\n filter: var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,);\n }\n }\n}\n.focus\\:ring-2 {\n &:focus {\n --tw-ring-shadow: var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor);\n box-shadow:\n var(--tw-inset-shadow),\n var(--tw-inset-ring-shadow),\n var(--tw-ring-offset-shadow),\n var(--tw-ring-shadow),\n var(--tw-shadow);\n }\n}\n.focus\\:ring-\\[var\\(--primary\\,\\#ff4076\\)\\] {\n &:focus {\n --tw-ring-color: var(--primary,#ff4076);\n }\n}\n.focus\\:ring-offset-2 {\n &:focus {\n --tw-ring-offset-width: 2px;\n --tw-ring-offset-shadow: var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);\n }\n}\n.focus\\:ring-offset-\\[var\\(--neutralDark1\\,\\#1b1a28\\)\\] {\n &:focus {\n --tw-ring-offset-color: var(--neutralDark1,#1b1a28);\n }\n}\n.focus\\:outline-none {\n &:focus {\n --tw-outline-style: none;\n outline-style: none;\n }\n}\n.active\\:opacity-80 {\n &:active {\n opacity: 80%;\n }\n}\n.active\\:brightness-95 {\n &:active {\n --tw-brightness: brightness(95%);\n filter: var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,);\n }\n}\n.disabled\\:cursor-not-allowed {\n &:disabled {\n cursor: not-allowed;\n }\n}\n.disabled\\:opacity-50 {\n &:disabled {\n opacity: 50%;\n }\n}\n.\\[\\&_circle\\]\\:stroke-white {\n & circle {\n stroke: var(--color-white);\n }\n}\n.\\[\\&_polyline\\]\\:stroke-white {\n & polyline {\n stroke: var(--color-white);\n }\n}\n@property --tw-rotate-x { syntax: "*"; inherits: false; }\n@property --tw-rotate-y { syntax: "*"; inherits: false; }\n@property --tw-rotate-z { syntax: "*"; inherits: false; }\n@property --tw-skew-x { syntax: "*"; inherits: false; }\n@property --tw-skew-y { syntax: "*"; inherits: false; }\n@property --tw-border-style { syntax: "*"; inherits: false; initial-value: solid; }\n@property --tw-leading { syntax: "*"; inherits: false; }\n@property --tw-font-weight { syntax: "*"; inherits: false; }\n@property --tw-shadow { syntax: "*"; inherits: false; initial-value: 0 0 #0000; }\n@property --tw-shadow-color { syntax: "*"; inherits: false; }\n@property --tw-shadow-alpha { syntax: "<percentage>"; inherits: false; initial-value: 100%; }\n@property --tw-inset-shadow { syntax: "*"; inherits: false; initial-value: 0 0 #0000; }\n@property --tw-inset-shadow-color { syntax: "*"; inherits: false; }\n@property --tw-inset-shadow-alpha { syntax: "<percentage>"; inherits: false; initial-value: 100%; }\n@property --tw-ring-color { syntax: "*"; inherits: false; }\n@property --tw-ring-shadow { syntax: "*"; inherits: false; initial-value: 0 0 #0000; }\n@property --tw-inset-ring-color { syntax: "*"; inherits: false; }\n@property --tw-inset-ring-shadow { syntax: "*"; inherits: false; initial-value: 0 0 #0000; }\n@property --tw-ring-inset { syntax: "*"; inherits: false; }\n@property --tw-ring-offset-width { syntax: "<length>"; inherits: false; initial-value: 0px; }\n@property --tw-ring-offset-color { syntax: "*"; inherits: false; initial-value: #fff; }\n@property --tw-ring-offset-shadow { syntax: "*"; inherits: false; initial-value: 0 0 #0000; }\n@property --tw-blur { syntax: "*"; inherits: false; }\n@property --tw-brightness { syntax: "*"; inherits: false; }\n@property --tw-contrast { syntax: "*"; inherits: false; }\n@property --tw-grayscale { syntax: "*"; inherits: false; }\n@property --tw-hue-rotate { syntax: "*"; inherits: false; }\n@property --tw-invert { syntax: "*"; inherits: false; }\n@property --tw-opacity { syntax: "*"; inherits: false; }\n@property --tw-saturate { syntax: "*"; inherits: false; }\n@property --tw-sepia { syntax: "*"; inherits: false; }\n@property --tw-drop-shadow { syntax: "*"; inherits: false; }\n@property --tw-drop-shadow-color { syntax: "*"; inherits: false; }\n@property --tw-drop-shadow-alpha { syntax: "<percentage>"; inherits: false; initial-value: 100%; }\n@property --tw-drop-shadow-size { syntax: "*"; inherits: false; }\n@layer properties {\n @supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))) {\n *,\n ::before,\n ::after,\n ::backdrop {\n --tw-rotate-x: initial;\n --tw-rotate-y: initial;\n --tw-rotate-z: initial;\n --tw-skew-x: initial;\n --tw-skew-y: initial;\n --tw-border-style: solid;\n --tw-leading: initial;\n --tw-font-weight: initial;\n --tw-shadow: 0 0 #0000;\n --tw-shadow-color: initial;\n --tw-shadow-alpha: 100%;\n --tw-inset-shadow: 0 0 #0000;\n --tw-inset-shadow-color: initial;\n --tw-inset-shadow-alpha: 100%;\n --tw-ring-color: initial;\n --tw-ring-shadow: 0 0 #0000;\n --tw-inset-ring-color: initial;\n --tw-inset-ring-shadow: 0 0 #0000;\n --tw-ring-inset: initial;\n --tw-ring-offset-width: 0px;\n --tw-ring-offset-color: #fff;\n --tw-ring-offset-shadow: 0 0 #0000;\n --tw-blur: initial;\n --tw-brightness: initial;\n --tw-contrast: initial;\n --tw-grayscale: initial;\n --tw-hue-rotate: initial;\n --tw-invert: initial;\n --tw-opacity: initial;\n --tw-saturate: initial;\n --tw-sepia: initial;\n --tw-drop-shadow: initial;\n --tw-drop-shadow-color: initial;\n --tw-drop-shadow-alpha: 100%;\n --tw-drop-shadow-size: initial;\n }\n }\n}\n');
25
25
 
26
26
  // src/components/LSButton/LSButton.tsx
27
27
  import { jsx } from "react/jsx-runtime";
@@ -32,23 +32,1314 @@ var LSButton = ({
32
32
  label,
33
33
  ...props
34
34
  }) => {
35
- const mode = primary ? "bg-blue-500" : "bg-gray-500";
35
+ const background = backgroundColor ?? (primary ? "var(--primary, #ff4076)" : "var(--neutralDark4, #46435f)");
36
36
  return /* @__PURE__ */ jsx(
37
37
  "button",
38
38
  {
39
39
  type: "button",
40
40
  className: [
41
- "bg-blue-500",
42
- size === "small" ? "px-3 py-1 text-sm" : size === "large" ? "px-6 py-3 text-lg" : "px-4 py-2 text-base",
43
- mode,
44
- backgroundColor ? `bg-[${backgroundColor}]` : ""
41
+ "rounded-md border border-white/10 font-medium text-[var(--neutralLight1,#f4f3ff)] shadow-[0_8px_18px_rgba(0,0,0,0.18)] transition hover:brightness-110 focus:outline-none focus:ring-2 focus:ring-[var(--primary,#ff4076)] focus:ring-offset-2 focus:ring-offset-[var(--neutralDark1,#1b1a28)] active:brightness-95",
42
+ size === "small" ? "px-3 py-1 text-sm" : size === "large" ? "px-6 py-3 text-lg" : "px-4 py-2 text-base"
45
43
  ].join(" "),
44
+ style: { background },
46
45
  ...props,
47
46
  children: label
48
47
  }
49
48
  );
50
49
  };
51
50
 
51
+ // src/components/LSInput/LSInput.tsx
52
+ import FormControl from "@mui/material/FormControl";
53
+ import InputAdornment from "@mui/material/InputAdornment";
54
+ import TextField from "@mui/material/TextField";
55
+ import classNames from "classnames";
56
+ import { forwardRef } from "react";
57
+ import { jsx as jsx2 } from "react/jsx-runtime";
58
+ var LSInput = forwardRef(
59
+ (props, ref) => {
60
+ const hasExplicitValue = Object.prototype.hasOwnProperty.call(props, "value");
61
+ const {
62
+ startAdornment,
63
+ endAdornment,
64
+ inputBeforeText,
65
+ inputAfterText,
66
+ maxWidth,
67
+ className = "",
68
+ InputProps: inputPropsProp,
69
+ InputLabelProps: inputLabelPropsProp,
70
+ inputProps: htmlInputPropsProp,
71
+ slotProps: slotPropsProp,
72
+ onChange,
73
+ onChangeStart,
74
+ onChangeEnd,
75
+ type,
76
+ value,
77
+ helperText,
78
+ error,
79
+ style,
80
+ centerText,
81
+ $noMinHeight,
82
+ bypasscolor,
83
+ textColor,
84
+ fullWidth = true,
85
+ ...rest
86
+ } = props;
87
+ const isNumberInput = type === "number";
88
+ const labelIdFallback = typeof rest.label === "string" ? rest.label : void 0;
89
+ const normalizedValue = isNumberInput && (value === void 0 || value === null) ? "" : value;
90
+ const handleChange = (event) => {
91
+ const rawValue = event.target.value;
92
+ let sanitizedValue = rawValue;
93
+ if (isNumberInput) {
94
+ if (rawValue === "") {
95
+ sanitizedValue = void 0;
96
+ } else {
97
+ const numericValue = Number(rawValue);
98
+ sanitizedValue = Number.isNaN(numericValue) ? void 0 : numericValue;
99
+ }
100
+ }
101
+ onChangeStart?.(event, sanitizedValue);
102
+ onChange?.(event, sanitizedValue);
103
+ onChangeEnd?.(event, sanitizedValue);
104
+ };
105
+ const resolvedStartAdornment = inputPropsProp?.startAdornment ?? (startAdornment ? /* @__PURE__ */ jsx2(InputAdornment, { position: "start", children: startAdornment }) : inputBeforeText ? /* @__PURE__ */ jsx2(InputAdornment, { position: "start", children: /* @__PURE__ */ jsx2("span", { className: "mui-ls-input-affix", children: inputBeforeText }) }) : void 0);
106
+ const resolvedEndAdornment = inputPropsProp?.endAdornment ?? (endAdornment ? /* @__PURE__ */ jsx2(InputAdornment, { position: "end", children: endAdornment }) : inputAfterText ? /* @__PURE__ */ jsx2(InputAdornment, { position: "end", children: /* @__PURE__ */ jsx2("span", { className: "mui-ls-input-affix", children: inputAfterText }) }) : void 0);
107
+ const inputSlotProps = {
108
+ ...inputPropsProp,
109
+ startAdornment: resolvedStartAdornment,
110
+ endAdornment: resolvedEndAdornment,
111
+ readOnly: rest.readOnly ?? inputPropsProp?.readOnly,
112
+ sx: {
113
+ ...inputPropsProp?.sx ?? {},
114
+ "& input, & textarea": {
115
+ textAlign: centerText ? "center" : void 0,
116
+ color: textColor ?? void 0
117
+ }
118
+ }
119
+ };
120
+ const inputLabelProps = {
121
+ shrink: true,
122
+ ...inputLabelPropsProp
123
+ };
124
+ const helperContent = helperText ?? (typeof error === "string" ? error : "");
125
+ const hasError = typeof error === "string" ? true : Boolean(error);
126
+ const resolvedMaxWidth = maxWidth ?? style?.maxWidth;
127
+ const valueProps = hasExplicitValue ? { value: normalizedValue } : {};
128
+ const slotProps = {
129
+ ...slotPropsProp ?? {},
130
+ input: {
131
+ ...slotPropsProp?.input ?? {},
132
+ ...inputSlotProps,
133
+ sx: {
134
+ ...slotPropsProp?.input?.sx ?? {},
135
+ ...inputSlotProps.sx
136
+ }
137
+ },
138
+ inputLabel: {
139
+ ...slotPropsProp?.inputLabel ?? {},
140
+ ...inputLabelProps
141
+ },
142
+ htmlInput: {
143
+ ...slotPropsProp?.htmlInput ?? {},
144
+ ...htmlInputPropsProp ?? {}
145
+ }
146
+ };
147
+ const TextFieldComponent = TextField;
148
+ return /* @__PURE__ */ jsx2(
149
+ FormControl,
150
+ {
151
+ variant: "outlined",
152
+ className: classNames("mui-ls-input w-full", className, {
153
+ noMinHeight: $noMinHeight,
154
+ bypassMuiColor: bypasscolor || bypasscolor === "default"
155
+ }),
156
+ style: { ...style, maxWidth: resolvedMaxWidth, width: fullWidth ? "100%" : style?.width },
157
+ children: /* @__PURE__ */ jsx2(
158
+ TextFieldComponent,
159
+ {
160
+ ...rest,
161
+ ...valueProps,
162
+ type,
163
+ id: rest.id ?? rest.name ?? labelIdFallback,
164
+ label: rest.label,
165
+ size: rest.size,
166
+ margin: "dense",
167
+ variant: "outlined",
168
+ color: bypasscolor === "default" || bypasscolor === "inherit" ? "primary" : bypasscolor,
169
+ fullWidth,
170
+ onChange: handleChange,
171
+ slotProps,
172
+ inputRef: ref,
173
+ helperText: helperContent,
174
+ error: hasError
175
+ }
176
+ )
177
+ }
178
+ );
179
+ }
180
+ );
181
+ LSInput.displayName = "LSInput";
182
+
183
+ // src/components/LSSliderInput/LSSliderInput.tsx
184
+ import Slider from "@mui/material/Slider";
185
+ import classNames2 from "classnames";
186
+ import { useCallback, useEffect, useMemo, useState } from "react";
187
+ import { jsx as jsx3, jsxs } from "react/jsx-runtime";
188
+ var LSSliderInput = ({
189
+ name,
190
+ value,
191
+ defaultValue,
192
+ isFloat,
193
+ isMiliseconds,
194
+ isFloatMiliseconds,
195
+ label,
196
+ inline,
197
+ hasInfo,
198
+ infoOpen,
199
+ infoClose,
200
+ max = Number.MAX_SAFE_INTEGER,
201
+ min = 0,
202
+ step = 1,
203
+ type = "number",
204
+ inputAfterText,
205
+ onChange,
206
+ inputProps = {},
207
+ helperText,
208
+ fullWidth = false,
209
+ hideInput = false,
210
+ hideSlider = false,
211
+ valueLabelFormat,
212
+ ...rest
213
+ }) => {
214
+ const isValueFloat = Boolean(isFloat || isFloatMiliseconds || isMiliseconds);
215
+ const actualToDisplay = useCallback(
216
+ (input) => {
217
+ if (input === void 0 || input === null) {
218
+ return input;
219
+ }
220
+ const numericValue = Number(input);
221
+ if (Number.isNaN(numericValue)) {
222
+ return 0;
223
+ }
224
+ if (!isValueFloat) {
225
+ return numericValue;
226
+ }
227
+ const divisor = isFloatMiliseconds ? 1e3 : 1;
228
+ return Number((numericValue / divisor).toFixed(1));
229
+ },
230
+ [isFloatMiliseconds, isValueFloat]
231
+ );
232
+ const displayStep = useMemo(() => actualToDisplay(step), [actualToDisplay, step]);
233
+ const resolvedDefaultValue = defaultValue ?? 0;
234
+ const [displayValue, setDisplayValue] = useState(() => actualToDisplay(defaultValue ?? value ?? resolvedDefaultValue));
235
+ const displayMaximum = useMemo(() => actualToDisplay(max), [actualToDisplay, max]);
236
+ const displayMinimum = useMemo(() => actualToDisplay(min), [actualToDisplay, min]);
237
+ const sliderValue = typeof displayValue === "number" ? Math.min(displayMaximum, Math.max(displayMinimum, displayValue)) : displayMinimum;
238
+ const stepPrecision = useMemo(() => {
239
+ const stepString = String(displayStep);
240
+ const decimalIndex = stepString.indexOf(".");
241
+ return decimalIndex === -1 ? 0 : stepString.length - decimalIndex - 1;
242
+ }, [displayStep]);
243
+ useEffect(() => {
244
+ if (typeof value === "number" && Number.isNaN(value) === false) {
245
+ setDisplayValue(actualToDisplay(value));
246
+ }
247
+ }, [actualToDisplay, value]);
248
+ const normalizeDisplayValue = useCallback(
249
+ (input) => {
250
+ const bounded = Math.min(displayMaximum, Math.max(displayMinimum, input));
251
+ if (!Number.isFinite(displayStep) || displayStep <= 0) {
252
+ return bounded;
253
+ }
254
+ const snapped = Math.round((bounded - displayMinimum) / displayStep) * displayStep + displayMinimum;
255
+ return Number(snapped.toFixed(stepPrecision));
256
+ },
257
+ [displayMaximum, displayMinimum, displayStep, stepPrecision]
258
+ );
259
+ const handleInputChange = useCallback(
260
+ ({ target: { value: inputValue } }) => {
261
+ setDisplayValue(inputValue ?? "");
262
+ if (inputValue === "" || inputValue === null) {
263
+ if (typeof onChange === "function") {
264
+ onChange(void 0);
265
+ }
266
+ return;
267
+ }
268
+ const numericValue = Number(inputValue);
269
+ if (Number.isNaN(numericValue)) {
270
+ return;
271
+ }
272
+ const normalizedDisplayValue = normalizeDisplayValue(numericValue);
273
+ const updatedValue = isFloatMiliseconds ? normalizedDisplayValue * 1e3 : normalizedDisplayValue;
274
+ const upperBound = typeof max === "number" ? max : Number.MAX_SAFE_INTEGER;
275
+ const lowerBound = typeof min === "number" ? min : 0;
276
+ const isValid = updatedValue >= lowerBound && updatedValue <= upperBound;
277
+ if (isValid && typeof onChange === "function") {
278
+ onChange(updatedValue);
279
+ }
280
+ },
281
+ [isFloatMiliseconds, max, min, normalizeDisplayValue, onChange]
282
+ );
283
+ const handleSliderChange = useCallback(
284
+ (_, sliderInputValue) => {
285
+ const numericValue = typeof sliderInputValue === "number" ? sliderInputValue : sliderInputValue[0];
286
+ const normalizedDisplayValue = normalizeDisplayValue(numericValue);
287
+ setDisplayValue(normalizedDisplayValue);
288
+ const nextValue = isFloatMiliseconds ? normalizedDisplayValue * 1e3 : normalizedDisplayValue;
289
+ onChange?.(nextValue);
290
+ },
291
+ [isFloatMiliseconds, normalizeDisplayValue, onChange]
292
+ );
293
+ const controlsRow = /* @__PURE__ */ jsxs(
294
+ "div",
295
+ {
296
+ className: classNames2("mui-ls-slider-input-row", {
297
+ "mui-ls-slider-input-row--slider": !hideSlider,
298
+ "mui-ls-slider-input-row--input": hideInput
299
+ }),
300
+ children: [
301
+ !hideSlider && /* @__PURE__ */ jsx3(
302
+ Slider,
303
+ {
304
+ value: sliderValue,
305
+ onChange: handleSliderChange,
306
+ onBlur: rest.onBlur,
307
+ color: "primary",
308
+ valueLabelDisplay: "auto",
309
+ valueLabelFormat: (v) => valueLabelFormat?.(v) ?? `${v}${inputAfterText ?? ""}`,
310
+ min: displayMinimum,
311
+ max: displayMaximum,
312
+ step: displayStep,
313
+ sx: { flex: 1, minWidth: 0 }
314
+ }
315
+ ),
316
+ !hideInput && /* @__PURE__ */ jsx3(
317
+ LSInput,
318
+ {
319
+ ...rest,
320
+ ...inputProps,
321
+ type,
322
+ name,
323
+ onChange: (_event, nextValue) => handleInputChange({ target: { value: nextValue ?? "" } }),
324
+ value: displayValue ?? "",
325
+ inputAfterText,
326
+ InputProps: {
327
+ ...inputProps?.InputProps ?? {},
328
+ name,
329
+ type: "number",
330
+ value: displayValue,
331
+ min: displayMinimum,
332
+ max: displayMaximum,
333
+ step: displayStep,
334
+ inputMode: stepPrecision > 0 ? "decimal" : "numeric"
335
+ },
336
+ fullWidth: hideSlider ? fullWidth : false,
337
+ $noMinHeight: !fullWidth,
338
+ className: hideSlider ? inputProps?.className : `${inputProps?.className ?? ""} small noMinHeight`.trim(),
339
+ style: hideSlider ? inputProps?.style : { width: 96, maxWidth: 96, flexShrink: 0 },
340
+ ...!hideSlider ? { size: "small" } : {}
341
+ }
342
+ )
343
+ ]
344
+ }
345
+ );
346
+ return /* @__PURE__ */ jsxs("div", { className: classNames2("mui-ls-slider-input-root", { "mui-ls-slider-input-root--fullWidth": fullWidth }), children: [
347
+ /* @__PURE__ */ jsxs(
348
+ "fieldset",
349
+ {
350
+ className: classNames2("mui-ls-slider-input-fieldset", {
351
+ "mui-ls-slider-input-fieldset--fullWidth": fullWidth
352
+ }),
353
+ children: [
354
+ label && /* @__PURE__ */ jsx3("legend", { className: "mui-ls-slider-input-legend", children: label }),
355
+ controlsRow
356
+ ]
357
+ }
358
+ ),
359
+ helperText && /* @__PURE__ */ jsx3("small", { className: "mui-ls-slider-input-helper", children: helperText })
360
+ ] });
361
+ };
362
+ LSSliderInput.displayName = "LSSliderInput";
363
+
364
+ // src/components/LSSelect/LSSelect.tsx
365
+ import FormControl2 from "@mui/material/FormControl";
366
+ import InputLabel from "@mui/material/InputLabel";
367
+ import Select from "@mui/material/Select";
368
+ import { jsx as jsx4, jsxs as jsxs2 } from "react/jsx-runtime";
369
+ var LSSelect = ({ className = "", style, ...props }) => {
370
+ const { placeholder, displayEmpty: displayEmptyProp, renderValue: renderValueProp, variant: _variant, MenuProps, ...rest } = props;
371
+ const labelKey = props.name ?? (typeof props.label === "string" ? props.label : void 0);
372
+ const labelId = props.label && labelKey ? `label_${labelKey}` : void 0;
373
+ const placeholderText = typeof placeholder === "string" ? placeholder : "";
374
+ const displayEmpty = displayEmptyProp ?? !!placeholderText;
375
+ const value = rest.multiple === true ? Array.isArray(rest.value) ? rest.value : rest.value === void 0 || rest.value === null || rest.value === "" ? [] : [rest.value] : rest.value ?? "";
376
+ const renderValue = renderValueProp ?? (placeholderText ? (selected) => {
377
+ if (selected === "" || Array.isArray(selected) && selected.length === 0) {
378
+ return /* @__PURE__ */ jsx4("span", { style: { color: "var(--neutralLight3)" }, children: placeholderText });
379
+ }
380
+ return Array.isArray(selected) ? selected.join(", ") : selected;
381
+ } : void 0);
382
+ const mergedMenuProps = {
383
+ ...MenuProps ?? {},
384
+ slotProps: {
385
+ ...MenuProps?.slotProps ?? {},
386
+ paper: {
387
+ ...MenuProps?.slotProps?.paper ?? {},
388
+ sx: {
389
+ background: "var(--neutralDark2) !important",
390
+ backgroundColor: "var(--neutralDark2)",
391
+ color: "var(--neutralLight1)",
392
+ border: "1px solid var(--neutralDark4)",
393
+ boxShadow: "0 16px 32px rgba(0, 0, 0, 0.32)",
394
+ ...MenuProps?.slotProps?.paper?.sx
395
+ }
396
+ },
397
+ list: {
398
+ ...MenuProps?.slotProps?.list ?? {},
399
+ sx: {
400
+ backgroundColor: "var(--neutralDark2)",
401
+ color: "var(--neutralLight1)",
402
+ ...MenuProps?.slotProps?.list?.sx
403
+ }
404
+ }
405
+ },
406
+ PaperProps: {
407
+ ...MenuProps?.PaperProps ?? {},
408
+ sx: {
409
+ background: "var(--neutralDark2) !important",
410
+ backgroundColor: "var(--neutralDark2)",
411
+ color: "var(--neutralLight1)",
412
+ border: "1px solid var(--neutralDark4)",
413
+ boxShadow: "0 16px 32px rgba(0, 0, 0, 0.32)",
414
+ "& .MuiList-root": {
415
+ backgroundColor: "var(--neutralDark2)"
416
+ },
417
+ "& .MuiListSubheader-root": {
418
+ backgroundColor: "var(--neutralDark1)",
419
+ color: "var(--neutralLight2)"
420
+ },
421
+ "& .MuiMenuItem-root": {
422
+ color: "var(--neutralLight1)"
423
+ },
424
+ ...MenuProps?.PaperProps?.sx
425
+ }
426
+ }
427
+ };
428
+ return /* @__PURE__ */ jsxs2(FormControl2, { variant: "outlined", className: `${className} mui-ls-select-form-control`, sx: { marginBottom: ".3rem", marginTop: ".5rem", minWidth: "100px", width: "100%" }, size: rest.size, style, children: [
429
+ props.label && /* @__PURE__ */ jsx4(InputLabel, { shrink: true, id: labelId, children: props.label }),
430
+ /* @__PURE__ */ jsx4(
431
+ Select,
432
+ {
433
+ MenuProps: mergedMenuProps,
434
+ className: "mui-ls-select",
435
+ variant: "outlined",
436
+ labelId,
437
+ label: props.label,
438
+ displayEmpty,
439
+ renderValue,
440
+ ...rest,
441
+ value,
442
+ children: props.children
443
+ }
444
+ )
445
+ ] });
446
+ };
447
+ LSSelect.displayName = "LSSelect";
448
+
449
+ // src/components/LSCheckbox/LSCheckbox.tsx
450
+ import Checkbox from "@mui/material/Checkbox";
451
+ import FormControlLabel from "@mui/material/FormControlLabel";
452
+ import { forwardRef as forwardRef2 } from "react";
453
+ import { useController, useFormContext } from "react-hook-form";
454
+ import classNames3 from "classnames";
455
+ import { jsx as jsx5 } from "react/jsx-runtime";
456
+ var LSCheckbox = forwardRef2(({ className = "", checked, inputRef, slotProps, ...props }, ref) => {
457
+ const CheckboxComponent = Checkbox;
458
+ return /* @__PURE__ */ jsx5(
459
+ CheckboxComponent,
460
+ {
461
+ ...props,
462
+ checked,
463
+ className: classNames3("ls-checkbox", className, { "Mui-disabled": props.disabled }),
464
+ ref,
465
+ slotProps: {
466
+ ...slotProps ?? {},
467
+ input: {
468
+ ...slotProps?.input ?? {},
469
+ ref: inputRef ?? slotProps?.input?.ref
470
+ }
471
+ }
472
+ }
473
+ );
474
+ });
475
+ LSCheckbox.displayName = "LSCheckbox";
476
+ function LSCheckboxField({
477
+ name,
478
+ label,
479
+ control,
480
+ className = "",
481
+ disabled,
482
+ labelPlacement = "end",
483
+ checkboxProps
484
+ }) {
485
+ const formContext = useFormContext();
486
+ const resolvedControl = control ?? formContext.control;
487
+ const { field } = useController({ name, control: resolvedControl });
488
+ return /* @__PURE__ */ jsx5(
489
+ FormControlLabel,
490
+ {
491
+ className: classNames3("ls-checkbox-row", className),
492
+ labelPlacement,
493
+ disabled,
494
+ control: /* @__PURE__ */ jsx5(
495
+ LSCheckbox,
496
+ {
497
+ ...checkboxProps,
498
+ name: field.name,
499
+ checked: Boolean(field.value),
500
+ onBlur: field.onBlur,
501
+ onChange: (_event, checked) => field.onChange(checked),
502
+ inputRef: field.ref,
503
+ disabled: disabled ?? checkboxProps?.disabled
504
+ }
505
+ ),
506
+ label
507
+ }
508
+ );
509
+ }
510
+
511
+ // src/components/LSColorPicker/LSColorPicker.tsx
512
+ import { useEffect as useEffect2, useRef, useState as useState2 } from "react";
513
+ import GradientColorPicker from "react-best-gradient-color-picker";
514
+ import { jsx as jsx6, jsxs as jsxs3 } from "react/jsx-runtime";
515
+ var DEFAULT_COLOR = "#ff4076";
516
+ var LSColorPicker = ({ value = DEFAULT_COLOR, onChange, onBlur, className, name, label, helperText, placeholder, hideGradientControls = false, usePopup = false, disabled = false }) => {
517
+ const isPopupMode = usePopup === true;
518
+ const [open, setOpen] = useState2(false);
519
+ const containerRef = useRef(null);
520
+ const [pickerWidth, setPickerWidth] = useState2(320);
521
+ const showPicker = open;
522
+ const pickerHeight = 220;
523
+ const inlinePickerHeight = hideGradientControls ? pickerHeight + 84 : pickerHeight + 150;
524
+ const pickerContainerStyle = isPopupMode ? {
525
+ position: "absolute",
526
+ right: 0,
527
+ top: "calc(100% + 0.5rem)",
528
+ zIndex: 1e3,
529
+ borderRadius: "0.5rem",
530
+ background: "var(--neutralDark1)",
531
+ padding: "0.5rem",
532
+ boxShadow: "0 8px 24px rgba(0, 0, 0, 0.4)"
533
+ } : {
534
+ position: "static",
535
+ display: "block",
536
+ width: "100%",
537
+ height: inlinePickerHeight,
538
+ minHeight: inlinePickerHeight,
539
+ marginTop: "0.5rem",
540
+ borderRadius: "0.5rem",
541
+ background: "var(--neutralDark1)",
542
+ padding: "0.5rem",
543
+ boxSizing: "border-box",
544
+ overflow: "visible"
545
+ };
546
+ useEffect2(() => {
547
+ const node = containerRef.current;
548
+ if (!node) return void 0;
549
+ const updateWidth = () => {
550
+ const nextWidth = Math.max(node.clientWidth - 16, 220);
551
+ setPickerWidth(nextWidth);
552
+ };
553
+ updateWidth();
554
+ const observer = new ResizeObserver(() => {
555
+ updateWidth();
556
+ });
557
+ observer.observe(node);
558
+ return () => observer.disconnect();
559
+ }, []);
560
+ useEffect2(() => {
561
+ if (!open) return void 0;
562
+ const handleClickOutside = (e) => {
563
+ if (containerRef.current && !containerRef.current.contains(e.target)) {
564
+ setOpen(false);
565
+ }
566
+ };
567
+ document.addEventListener("mousedown", handleClickOutside);
568
+ return () => document.removeEventListener("mousedown", handleClickOutside);
569
+ }, [open]);
570
+ const handleInputChange = (e) => {
571
+ onChange(e.target.value);
572
+ };
573
+ const toggleOpen = () => {
574
+ if (disabled) return;
575
+ setOpen((nextOpen) => !nextOpen);
576
+ };
577
+ return /* @__PURE__ */ jsxs3(
578
+ "div",
579
+ {
580
+ ref: containerRef,
581
+ className: ["ls-color-picker", className].filter(Boolean).join(" "),
582
+ style: {
583
+ position: "relative",
584
+ display: "flex",
585
+ width: "100%",
586
+ flexDirection: "column",
587
+ overflow: "visible"
588
+ },
589
+ children: [
590
+ /* @__PURE__ */ jsx6(
591
+ LSInput,
592
+ {
593
+ className: "w-full",
594
+ name,
595
+ label,
596
+ helperText,
597
+ value,
598
+ onChange: handleInputChange,
599
+ onBlur,
600
+ placeholder,
601
+ disabled,
602
+ endAdornment: /* @__PURE__ */ jsx6(
603
+ "button",
604
+ {
605
+ type: "button",
606
+ className: "relative h-6 w-6 shrink-0 rounded-md border border-white/25 bg-cover bg-center bg-no-repeat p-0 shadow-[0_0_0_1px_rgba(0,0,0,0.25)] disabled:cursor-not-allowed disabled:opacity-50",
607
+ style: { background: value },
608
+ onClick: toggleOpen,
609
+ "aria-label": isPopupMode ? "Open color picker" : "Color preview",
610
+ disabled
611
+ }
612
+ )
613
+ }
614
+ ),
615
+ showPicker && /* @__PURE__ */ jsx6(
616
+ "div",
617
+ {
618
+ className: isPopupMode ? "ls-color-picker__picker ls-color-picker__picker--popup" : "ls-color-picker__picker ls-color-picker__picker--inline",
619
+ style: pickerContainerStyle,
620
+ children: /* @__PURE__ */ jsx6(
621
+ GradientColorPicker,
622
+ {
623
+ hidePresets: true,
624
+ hideColorGuide: true,
625
+ hideAdvancedSliders: true,
626
+ hideInputs: true,
627
+ hideInputType: true,
628
+ hideEyeDrop: false,
629
+ hideGradientControls,
630
+ hideColorTypeBtns: hideGradientControls,
631
+ width: pickerWidth,
632
+ height: pickerHeight,
633
+ className: "[&_circle]:stroke-white [&_polyline]:stroke-white",
634
+ value,
635
+ onChange,
636
+ style: {
637
+ body: { background: "transparent", color: "var(--neutralLight1, #fff)" },
638
+ rbgcpControlBtn: {
639
+ background: "var(--neutralDark4)",
640
+ color: "var(--neutralLight1, #fff)",
641
+ boxShadow: "none"
642
+ },
643
+ rbgcpControlBtnSelected: {
644
+ background: "var(--primary)",
645
+ color: "var(--neutralLight1)",
646
+ boxShadow: "0 6px 14px rgba(255, 64, 118, 0.28)"
647
+ },
648
+ rbgcpControlBtnWrapper: {
649
+ background: "var(--neutralDark4)",
650
+ color: "var(--neutralLight1, #fff)"
651
+ },
652
+ rbgcpControlIconBtn: {
653
+ background: "transparent",
654
+ color: "var(--neutralLight1, #fff)"
655
+ }
656
+ }
657
+ }
658
+ )
659
+ }
660
+ )
661
+ ]
662
+ }
663
+ );
664
+ };
665
+
666
+ // src/components/LSFontPicker/LSFontPicker.tsx
667
+ import { KeyboardArrowDown } from "@mui/icons-material";
668
+ import Autocomplete from "@mui/material/Autocomplete";
669
+ import TextField2 from "@mui/material/TextField";
670
+ import { memo, startTransition, useEffect as useEffect3, useMemo as useMemo2, useRef as useRef2, useState as useState3 } from "react";
671
+ import { jsx as jsx7 } from "react/jsx-runtime";
672
+ var LSFontPicker = memo(function LSFontPicker2({ value, onChange, fonts = [], localFonts = [], onLoadFonts, defaultValue = "Roboto", placeholder = "Select a font", isAlertManager = false, label, helperText }) {
673
+ const AutocompleteComponent = Autocomplete;
674
+ const TextFieldComponent = TextField2;
675
+ const [inputValue, setInputValue] = useState3(value ?? defaultValue);
676
+ const onLoadFontsRef = useRef2(onLoadFonts);
677
+ const onChangeRef = useRef2(onChange);
678
+ const combinedFonts = useMemo2(() => Array.from(/* @__PURE__ */ new Set([...localFonts, ...fonts])).sort(), [fonts, localFonts]);
679
+ const currentValue = value ?? defaultValue;
680
+ useEffect3(() => {
681
+ onLoadFontsRef.current = onLoadFonts;
682
+ onChangeRef.current = onChange;
683
+ }, [onLoadFonts, onChange]);
684
+ useEffect3(() => {
685
+ setInputValue(currentValue);
686
+ }, [currentValue]);
687
+ useEffect3(() => {
688
+ if (!currentValue || isAlertManager) return;
689
+ startTransition(() => {
690
+ onLoadFontsRef.current?.([currentValue]);
691
+ });
692
+ }, [currentValue, isAlertManager]);
693
+ const handleValueChange = (nextValue) => {
694
+ setInputValue(nextValue);
695
+ onChangeRef.current(nextValue);
696
+ if (!nextValue || isAlertManager) return;
697
+ startTransition(() => {
698
+ onLoadFontsRef.current?.([nextValue]);
699
+ });
700
+ };
701
+ return /* @__PURE__ */ jsx7("div", { className: "w-full", children: /* @__PURE__ */ jsx7(
702
+ AutocompleteComponent,
703
+ {
704
+ freeSolo: true,
705
+ disableClearable: true,
706
+ openOnFocus: true,
707
+ forcePopupIcon: true,
708
+ options: combinedFonts,
709
+ value: currentValue,
710
+ inputValue,
711
+ popupIcon: /* @__PURE__ */ jsx7(KeyboardArrowDown, {}),
712
+ isOptionEqualToValue: (option, selectedValue) => option === selectedValue,
713
+ onChange: (_event, newValue) => {
714
+ handleValueChange(typeof newValue === "string" ? newValue : `${newValue ?? ""}`);
715
+ },
716
+ onInputChange: (_event, newInputValue, reason) => {
717
+ if (reason === "input" || reason === "clear") {
718
+ handleValueChange(newInputValue);
719
+ }
720
+ },
721
+ slotProps: {
722
+ popper: {
723
+ sx: { zIndex: 1400 }
724
+ },
725
+ paper: {
726
+ sx: {
727
+ background: "var(--neutralDark3)",
728
+ border: "1px solid var(--neutralDark4)",
729
+ borderRadius: "var(--radiusContainerSm)",
730
+ boxShadow: "0 4px 12px rgba(0, 0, 0, 0.3)",
731
+ color: "var(--neutralLight1)",
732
+ marginTop: "4px"
733
+ }
734
+ },
735
+ popupIndicator: {
736
+ sx: {
737
+ color: "var(--neutralLight2)",
738
+ "&.MuiAutocomplete-popupIndicatorOpen": {
739
+ transform: "rotate(180deg)"
740
+ }
741
+ }
742
+ }
743
+ },
744
+ ListboxProps: {
745
+ sx: {
746
+ maxHeight: 300,
747
+ padding: 0
748
+ }
749
+ },
750
+ noOptionsText: "No fonts found",
751
+ renderOption: (props, option) => {
752
+ const { key, ...optionProps } = props;
753
+ return /* @__PURE__ */ jsx7(
754
+ "li",
755
+ {
756
+ ...optionProps,
757
+ style: {
758
+ ...optionProps.style ?? {},
759
+ fontFamily: `${option}, Arial, sans-serif`,
760
+ color: "var(--neutralLight1)",
761
+ borderBottom: "1px solid rgba(255, 255, 255, 0.05)",
762
+ padding: "0.75rem 1.25rem",
763
+ transition: "background-color 0.1s ease"
764
+ },
765
+ children: option
766
+ },
767
+ key
768
+ );
769
+ },
770
+ renderInput: (params) => /* @__PURE__ */ jsx7(
771
+ TextFieldComponent,
772
+ {
773
+ ...params,
774
+ label,
775
+ helperText,
776
+ placeholder,
777
+ fullWidth: true,
778
+ className: "mui-ls-input noMinHeight w-full",
779
+ variant: "outlined",
780
+ sx: {
781
+ "& .MuiOutlinedInput-root": {
782
+ paddingRight: "0.5rem"
783
+ }
784
+ },
785
+ InputLabelProps: {
786
+ shrink: true,
787
+ ...params.InputLabelProps ?? {}
788
+ }
789
+ }
790
+ )
791
+ }
792
+ ) });
793
+ });
794
+
795
+ // src/components/LSMultiSelect/LSMultiSelect.tsx
796
+ import { MenuItem } from "@mui/material";
797
+ import { jsx as jsx8, jsxs as jsxs4 } from "react/jsx-runtime";
798
+ var LSMultiSelect = ({ options, placeholder = "Select...", value, onChange, label }) => {
799
+ const handleChange = (event) => {
800
+ const {
801
+ target: { value: value2 }
802
+ } = event;
803
+ onChange(typeof value2 === "string" ? value2.split(",") : value2);
804
+ };
805
+ return /* @__PURE__ */ jsx8(
806
+ LSSelect,
807
+ {
808
+ multiple: true,
809
+ label,
810
+ fullWidth: true,
811
+ className: "mui-multi-select",
812
+ value: value ?? [],
813
+ onChange: handleChange,
814
+ displayEmpty: true,
815
+ renderValue: (selected) => /* @__PURE__ */ jsxs4("div", { className: "flex w-full min-w-0 flex-nowrap items-center justify-between gap-2 overflow-hidden whitespace-nowrap", children: [
816
+ /* @__PURE__ */ jsx8("div", { className: "min-w-0 flex-1 overflow-hidden text-ellipsis whitespace-nowrap", children: selected.length > 0 ? selected.map((val) => options.find((opt) => opt.value === val)?.label ?? val).join(", ") : placeholder }),
817
+ /* @__PURE__ */ jsx8("div", { className: "shrink-0 whitespace-nowrap", children: `(${selected.length})` })
818
+ ] }),
819
+ MenuProps: {
820
+ slotProps: {
821
+ paper: {
822
+ sx: {
823
+ background: "var(--neutralDark2) !important",
824
+ backgroundColor: "var(--neutralDark2)",
825
+ color: "var(--neutralLight1)",
826
+ border: "1px solid var(--neutralDark4)",
827
+ boxShadow: "0 16px 32px rgba(0, 0, 0, 0.32)",
828
+ backdropFilter: "none",
829
+ opacity: 1,
830
+ maxHeight: "280px !important"
831
+ }
832
+ },
833
+ list: {
834
+ sx: {
835
+ backgroundColor: "var(--neutralDark2)",
836
+ color: "var(--neutralLight1)"
837
+ }
838
+ }
839
+ },
840
+ PaperProps: {
841
+ sx: {
842
+ background: "var(--neutralDark2) !important",
843
+ backgroundColor: "var(--neutralDark2)",
844
+ color: "var(--neutralLight1)",
845
+ backdropFilter: "none",
846
+ opacity: 1,
847
+ maxHeight: "280px !important",
848
+ border: "1px solid var(--neutralDark4)",
849
+ "& .MuiList-root": {
850
+ backgroundColor: "var(--neutralDark2)"
851
+ }
852
+ }
853
+ }
854
+ },
855
+ children: options.map((option) => /* @__PURE__ */ jsxs4(
856
+ MenuItem,
857
+ {
858
+ value: option.value,
859
+ sx: {
860
+ display: "flex",
861
+ alignItems: "center",
862
+ gap: "0.4rem",
863
+ color: "var(--neutralLight1)",
864
+ "&.Mui-selected, &.Mui-selected:hover": {
865
+ background: "rgba(255, 64, 118, 0.12)"
866
+ },
867
+ "&:hover": {
868
+ background: "rgba(255, 255, 255, 0.06)"
869
+ }
870
+ },
871
+ children: [
872
+ /* @__PURE__ */ jsx8(LSCheckbox, { checked: (value ?? []).includes(option.value), tabIndex: -1, disableRipple: true }),
873
+ /* @__PURE__ */ jsx8("span", { children: option.label })
874
+ ]
875
+ },
876
+ option.value
877
+ ))
878
+ }
879
+ );
880
+ };
881
+
882
+ // src/components/LSRadio/LSRadio.tsx
883
+ import FormControlLabel2 from "@mui/material/FormControlLabel";
884
+ import Radio from "@mui/material/Radio";
885
+ import RadioGroup from "@mui/material/RadioGroup";
886
+ import classNames4 from "classnames";
887
+ import { jsx as jsx9 } from "react/jsx-runtime";
888
+ var LSRadio = ({ className = "", ...props }) => {
889
+ return /* @__PURE__ */ jsx9(Radio, { ...props, className: classNames4("ls-radio", className) });
890
+ };
891
+ var LSRadioGroup = ({ selections, className = "", optionClassName = "", row, ...props }) => {
892
+ return /* @__PURE__ */ jsx9(RadioGroup, { ...props, row, className: classNames4("ls-radio-group", className, { row }), children: selections.map((selection) => /* @__PURE__ */ jsx9(
893
+ FormControlLabel2,
894
+ {
895
+ className: classNames4("ls-radio-row", optionClassName),
896
+ value: selection.value,
897
+ disabled: selection.disabled,
898
+ control: /* @__PURE__ */ jsx9(LSRadio, {}),
899
+ label: selection.label
900
+ },
901
+ selection.value
902
+ )) });
903
+ };
904
+ LSRadioGroup.displayName = "LSRadioGroup";
905
+
906
+ // src/components/LSTextField/LSTextField.tsx
907
+ import TextField3 from "@mui/material/TextField";
908
+ import { forwardRef as forwardRef3 } from "react";
909
+ import { jsx as jsx10 } from "react/jsx-runtime";
910
+ var LSTextField = forwardRef3((props, ref) => {
911
+ const { InputLabelProps, InputProps, slotProps, ...rest } = props;
912
+ return /* @__PURE__ */ jsx10(
913
+ TextField3,
914
+ {
915
+ ...rest,
916
+ variant: "outlined",
917
+ slotProps: {
918
+ ...slotProps ?? {},
919
+ input: {
920
+ ...slotProps?.input ?? {},
921
+ ...InputProps ?? {},
922
+ sx: {
923
+ ...slotProps?.input?.sx ?? {},
924
+ ...InputProps?.sx ?? {}
925
+ }
926
+ },
927
+ inputLabel: {
928
+ ...slotProps?.inputLabel ?? {},
929
+ shrink: true,
930
+ ...InputLabelProps ?? {}
931
+ }
932
+ },
933
+ ref
934
+ }
935
+ );
936
+ });
937
+ LSTextField.displayName = "LSTextField";
938
+
939
+ // src/components/LSVariableInputField/LSVariableInputField.tsx
940
+ import Autocomplete2, { createFilterOptions } from "@mui/material/Autocomplete";
941
+ import InputAdornment2 from "@mui/material/InputAdornment";
942
+ import Search from "@mui/icons-material/Search";
943
+ import Popover from "@mui/material/Popover";
944
+ import { createContext, forwardRef as forwardRef4, useCallback as useCallback2, useContext, useEffect as useEffect4, useMemo as useMemo3, useRef as useRef3, useState as useState4 } from "react";
945
+ import { Fragment, jsx as jsx11, jsxs as jsxs5 } from "react/jsx-runtime";
946
+ var LSVariableInputContext = createContext({});
947
+ var LSVariableInputProvider = ({ children, value }) => {
948
+ return /* @__PURE__ */ jsx11(LSVariableInputContext.Provider, { value, children });
949
+ };
950
+ var DEFAULT_FUNCTION_VARIABLES = [
951
+ "sum_variables",
952
+ "offset_count",
953
+ "read_file",
954
+ "read_url",
955
+ "selection",
956
+ "random",
957
+ "random_input",
958
+ "get_commands",
959
+ "get_all_commands",
960
+ "convert_color_to_hex",
961
+ "get_latest_file_from_folder",
962
+ "get_random_file_from_folder",
963
+ "screenshot",
964
+ "overlay_screenshot",
965
+ "obs_screenshot",
966
+ "obs_replay",
967
+ "obs_vertical_replay",
968
+ "get_queue_count",
969
+ "lumia_uptime",
970
+ "twitch_uptime",
971
+ "youtube_uptime",
972
+ "facebook_uptime",
973
+ "twitch_followage",
974
+ "twitch_next_ad",
975
+ "twitch_get_avatar",
976
+ "get_var_from_msg",
977
+ "get_user_loyalty_points",
978
+ "translate",
979
+ "ai_prompt",
980
+ "viewer_profile_summary"
981
+ ];
982
+ var filter = createFilterOptions();
983
+ var isNully = (value) => value === null || value === void 0;
984
+ var defaultTranslate = (key, fallback, options) => {
985
+ if (fallback && fallback !== "-") return fallback;
986
+ if (key === "overlay-variables.variables-description") return "Use variables that will automatically be replaced before sending out the text";
987
+ if (key === "overlay-variables.variable") return "Variable";
988
+ if (key === "overlay-variables.description") return "Description";
989
+ if (key === "assets.search") return "Search";
990
+ if (key === "variables.functionvariables") return "Function variables";
991
+ if (key.startsWith("variables.")) {
992
+ const variableName = key.replace("variables.", "");
993
+ const example = options?.example;
994
+ return example === void 0 || example === null ? variableName : String(example);
995
+ }
996
+ return fallback ?? key;
997
+ };
998
+ var normalizeAllowedDefinitions = (allowedVariables) => {
999
+ if (!Array.isArray(allowedVariables)) return [];
1000
+ const unique = /* @__PURE__ */ new Set();
1001
+ const definitions = [];
1002
+ allowedVariables.forEach((variable) => {
1003
+ let variableName = "";
1004
+ let description;
1005
+ if (typeof variable === "string") {
1006
+ variableName = variable.trim();
1007
+ } else if (variable && typeof variable === "object") {
1008
+ const typedVariable = variable;
1009
+ const candidateName = [typedVariable.name, typedVariable.key, typedVariable.variable].find((value) => typeof value === "string");
1010
+ variableName = typeof candidateName === "string" ? candidateName.trim() : "";
1011
+ description = typeof typedVariable.description === "string" ? typedVariable.description.trim() : void 0;
1012
+ }
1013
+ if (!variableName || unique.has(variableName)) return;
1014
+ unique.add(variableName);
1015
+ definitions.push({ name: variableName, description });
1016
+ });
1017
+ return definitions;
1018
+ };
1019
+ var LSVariableInputField = forwardRef4((props, ref) => {
1020
+ const context = useContext(LSVariableInputContext);
1021
+ const {
1022
+ name,
1023
+ label,
1024
+ type,
1025
+ isAutoComplete,
1026
+ autoCompleteOptions,
1027
+ renderOption,
1028
+ hideVariables,
1029
+ allowedVariables,
1030
+ disabled,
1031
+ autoFocus,
1032
+ inputProps = {},
1033
+ multiline,
1034
+ rows,
1035
+ maxRows,
1036
+ value,
1037
+ placeholder,
1038
+ variant,
1039
+ ListboxComponent,
1040
+ onScrollListBox,
1041
+ onHighlightChange,
1042
+ onPopupClose,
1043
+ onPopupOpen,
1044
+ afterFilter,
1045
+ onChange,
1046
+ systemVariables: systemVariablesProp,
1047
+ functionVariables: functionVariablesProp,
1048
+ translate,
1049
+ onVariableTranslationsNeeded
1050
+ } = props;
1051
+ const t = translate ?? context.translate ?? defaultTranslate;
1052
+ const systemVariables = systemVariablesProp ?? context.systemVariables ?? {};
1053
+ const functionVariables = useMemo3(() => functionVariablesProp ?? context.functionVariables ?? DEFAULT_FUNCTION_VARIABLES, [context.functionVariables, functionVariablesProp]);
1054
+ const requestTranslations = onVariableTranslationsNeeded ?? context.onVariableTranslationsNeeded;
1055
+ const containerRef = useRef3(null);
1056
+ const variableId = useRef3(`variable-input-${name ?? "field"}`);
1057
+ const [showVariables, setShowVariables] = useState4(false);
1058
+ const [searchQuery, setSearchQuery] = useState4("");
1059
+ const functionVariableSet = useMemo3(() => new Set(functionVariables), [functionVariables]);
1060
+ const allowedVariableDefinitions = useMemo3(() => normalizeAllowedDefinitions(allowedVariables), [allowedVariables]);
1061
+ const allowedVariableDefinitionLookup = useMemo3(() => {
1062
+ const lookup = /* @__PURE__ */ new Map();
1063
+ allowedVariableDefinitions.forEach((definition) => lookup.set(definition.name, definition));
1064
+ return lookup;
1065
+ }, [allowedVariableDefinitions]);
1066
+ const allowedVariableNames = useMemo3(() => allowedVariableDefinitions.map((definition) => definition.name), [allowedVariableDefinitions]);
1067
+ const [filteredAllowedVariables, setFilteredAllowedVariables] = useState4(allowedVariableNames);
1068
+ const [filteredSystemVariables, setFilteredSystemVariables] = useState4([]);
1069
+ useEffect4(() => {
1070
+ requestTranslations?.();
1071
+ }, [requestTranslations]);
1072
+ const getVariableVisualType = useCallback2(
1073
+ (variableName) => {
1074
+ if (functionVariableSet.has(variableName)) return "func";
1075
+ return !isNully(systemVariables?.[variableName]) ? "system" : "custom";
1076
+ },
1077
+ [functionVariableSet, systemVariables]
1078
+ );
1079
+ const getVariableTypeSortRank = (variableType) => {
1080
+ if (variableType === "custom") return 0;
1081
+ if (variableType === "func") return 1;
1082
+ return 2;
1083
+ };
1084
+ const orderByType = useCallback2(
1085
+ (variableNames) => {
1086
+ const grouped = { custom: [], func: [], system: [] };
1087
+ variableNames.forEach((variableName) => {
1088
+ grouped[getVariableVisualType(variableName)].push(variableName);
1089
+ });
1090
+ return [...grouped.custom, ...grouped.func, ...grouped.system];
1091
+ },
1092
+ [getVariableVisualType]
1093
+ );
1094
+ const sortByTypeThenName = useCallback2(
1095
+ (variableNames) => [...variableNames].sort((a, b) => {
1096
+ const typeDiff = getVariableTypeSortRank(getVariableVisualType(a)) - getVariableTypeSortRank(getVariableVisualType(b));
1097
+ return typeDiff !== 0 ? typeDiff : a.localeCompare(b);
1098
+ }),
1099
+ [getVariableVisualType]
1100
+ );
1101
+ const getAllowedVariableDescription = useCallback2(
1102
+ (variableName) => {
1103
+ const fromDefinitions = allowedVariableDefinitionLookup.get(variableName)?.description;
1104
+ if (fromDefinitions) return fromDefinitions;
1105
+ const translationKey = `variables.${variableName}`;
1106
+ const translated = t(translationKey, variableName);
1107
+ return translated && translated !== translationKey ? translated : variableName;
1108
+ },
1109
+ [allowedVariableDefinitionLookup, t]
1110
+ );
1111
+ const filterBasedOnQuery = useCallback2(() => {
1112
+ const query = (searchQuery ?? "").toLowerCase().replace("{{", "").replace("}}", "").trim();
1113
+ if (allowedVariableNames.length > 0) {
1114
+ if (!query) {
1115
+ setFilteredAllowedVariables(orderByType(allowedVariableNames));
1116
+ } else {
1117
+ const nameMatches = [];
1118
+ const descMatches = [];
1119
+ allowedVariableNames.forEach((variable) => {
1120
+ const nameLower = variable?.toLowerCase();
1121
+ const descLower = getAllowedVariableDescription(variable)?.toLowerCase();
1122
+ if (nameLower?.includes(query)) nameMatches.push(variable);
1123
+ else if (descLower?.includes(query)) descMatches.push(variable);
1124
+ });
1125
+ setFilteredAllowedVariables([...sortByTypeThenName(nameMatches), ...sortByTypeThenName(descMatches)]);
1126
+ }
1127
+ } else {
1128
+ setFilteredAllowedVariables([]);
1129
+ }
1130
+ const systemKeys = Object.keys(systemVariables ?? {}).filter((variableKey) => !isNully(systemVariables?.[variableKey]));
1131
+ const allowedVariableSet = new Set(allowedVariableNames);
1132
+ const candidates = [...functionVariables, ...systemKeys].filter((variableKey, idx, list) => list.indexOf(variableKey) === idx && !allowedVariableSet.has(variableKey));
1133
+ if (!query) {
1134
+ setFilteredSystemVariables(orderByType(candidates));
1135
+ } else {
1136
+ const nameMatches = [];
1137
+ const descMatches = [];
1138
+ candidates.forEach((key) => {
1139
+ const nameLower = key?.toLowerCase();
1140
+ const descStr = t(`variables.${key}`, "-", {
1141
+ example: systemVariables[key],
1142
+ interpolation: { escapeValue: false, prefix: "{{{", suffix: "}}}" }
1143
+ });
1144
+ const descLower = descStr?.toLowerCase();
1145
+ if (nameLower?.includes(query)) nameMatches.push(key);
1146
+ else if (descLower?.includes(query)) descMatches.push(key);
1147
+ });
1148
+ setFilteredSystemVariables([...sortByTypeThenName(nameMatches), ...sortByTypeThenName(descMatches)]);
1149
+ }
1150
+ }, [allowedVariableNames, functionVariables, getAllowedVariableDescription, orderByType, searchQuery, sortByTypeThenName, systemVariables, t]);
1151
+ useEffect4(() => {
1152
+ filterBasedOnQuery();
1153
+ }, [filterBasedOnQuery]);
1154
+ const clickedVariableIcon = () => {
1155
+ if (!hideVariables) setShowVariables((current) => !current);
1156
+ };
1157
+ const appendValue = (newValue) => {
1158
+ const currentValue = Array.isArray(value) ? value.join("") : value;
1159
+ onChange?.(currentValue ? `${currentValue}${newValue}` : newValue);
1160
+ };
1161
+ const insertVariable = (variable) => {
1162
+ appendValue(`{{${variable}}}`);
1163
+ };
1164
+ const getVariableColorClass = (variableType, isSuggested = false) => {
1165
+ if (isSuggested && variableType !== "func") return "text-[var(--customVariables,#69ffd2)]";
1166
+ if (variableType === "func") return "text-[var(--functionVariables,var(--semanticPurple,#b489ff))]";
1167
+ if (variableType === "system") return "text-[var(--normalVariables,var(--semanticBlue,#65b8ff))]";
1168
+ return "text-[var(--customVariables,#69ffd2)]";
1169
+ };
1170
+ const renderVariableToken = (variableName, variableType, isSuggested = false) => /* @__PURE__ */ jsxs5("div", { className: `flex min-w-0 items-center ${getVariableColorClass(variableType, isSuggested)}`, children: [
1171
+ /* @__PURE__ */ jsx11("span", { className: "min-w-0 break-all", children: `{{${variableName}}}` }),
1172
+ variableType === "func" && /* @__PURE__ */ jsx11("span", { className: "ml-2 inline-flex shrink-0 items-center rounded border border-current px-1 py-0 text-[10px] font-semibold uppercase leading-none", title: t("variables.functionvariables", "Function variables"), children: "fx" })
1173
+ ] });
1174
+ const handleFilterOptions = (options, params) => {
1175
+ const filtered = filter(options, params);
1176
+ afterFilter?.(filtered);
1177
+ return filtered;
1178
+ };
1179
+ const textField = (params = {}) => /* @__PURE__ */ jsx11(
1180
+ VariableInputTextField,
1181
+ {
1182
+ params,
1183
+ id: variableId.current,
1184
+ containerRef,
1185
+ name,
1186
+ label,
1187
+ type,
1188
+ variant,
1189
+ disabled,
1190
+ autoFocus,
1191
+ multiline,
1192
+ placeholder,
1193
+ rows,
1194
+ maxRows,
1195
+ value,
1196
+ onChange,
1197
+ clickedVariableIcon,
1198
+ inputProps,
1199
+ ref
1200
+ }
1201
+ );
1202
+ return /* @__PURE__ */ jsxs5(Fragment, { children: [
1203
+ /* @__PURE__ */ jsx11(
1204
+ Popover,
1205
+ {
1206
+ anchorEl: containerRef.current,
1207
+ anchorOrigin: { vertical: "bottom", horizontal: "right" },
1208
+ transformOrigin: { vertical: "top", horizontal: "right" },
1209
+ open: !hideVariables && showVariables,
1210
+ onClose: clickedVariableIcon,
1211
+ slotProps: {
1212
+ paper: {
1213
+ sx: {
1214
+ color: "var(--neutralLight2, #cac9d5)",
1215
+ backgroundColor: "var(--neutralDark1, #171628)",
1216
+ padding: 1,
1217
+ border: "1px solid var(--neutralDark4, #393853)"
1218
+ }
1219
+ }
1220
+ },
1221
+ children: /* @__PURE__ */ jsxs5("div", { className: "flex max-h-[55vh] min-h-[50vh] w-[92vw] max-w-[1100px] flex-col overflow-hidden [--variable-custom-color:var(--customVariables,#69ffd2)] [--variable-function-color:var(--functionVariables,var(--semanticPurple,#b489ff))] [--variable-normal-color:var(--normalVariables,var(--semanticBlue,#65b8ff))]", children: [
1222
+ /* @__PURE__ */ jsxs5("div", { className: "mb-4 text-[var(--neutralLight2,#cac9d5)]", children: [
1223
+ /* @__PURE__ */ jsx11("div", { children: t("overlay-variables.variables-description", "Use variables that will automatically be replaced before sending out the text") }),
1224
+ /* @__PURE__ */ jsx11(
1225
+ LSInput,
1226
+ {
1227
+ autoFocus: true,
1228
+ startAdornment: /* @__PURE__ */ jsx11(Search, { style: { width: 18, height: 18 } }),
1229
+ placeholder: t("assets.search", "Search"),
1230
+ value: searchQuery,
1231
+ onChange: (e) => setSearchQuery(e.target.value),
1232
+ type: "text",
1233
+ style: { padding: "1rem 0 0" }
1234
+ }
1235
+ )
1236
+ ] }),
1237
+ /* @__PURE__ */ jsxs5("div", { className: "mb-1 grid grid-cols-[minmax(300px,1.5fr)_2fr] gap-8 px-1 text-[var(--neutralLight3,#9392a1)]", children: [
1238
+ /* @__PURE__ */ jsx11("div", { children: t("overlay-variables.variable", "Variable") }),
1239
+ /* @__PURE__ */ jsx11("div", { children: t("overlay-variables.description", "Description") })
1240
+ ] }),
1241
+ /* @__PURE__ */ jsxs5("div", { className: "h-full overflow-auto pr-4", children: [
1242
+ allowedVariableNames.length > 0 && filteredAllowedVariables?.map((variableName) => /* @__PURE__ */ jsxs5("div", { className: "grid cursor-pointer grid-cols-[minmax(300px,1.5fr)_2fr] items-start gap-8 border-b border-white/10 px-1 py-4 active:opacity-80", onClick: () => insertVariable(variableName), children: [
1243
+ renderVariableToken(variableName, getVariableVisualType(variableName), true),
1244
+ /* @__PURE__ */ jsx11("div", { className: "max-w-[600px] break-words leading-[1.25]", children: getAllowedVariableDescription(variableName) })
1245
+ ] }, variableName)),
1246
+ filteredSystemVariables?.map((variableKey) => /* @__PURE__ */ jsxs5("div", { className: "grid cursor-pointer grid-cols-[minmax(300px,1.5fr)_2fr] items-start gap-8 border-b border-white/10 px-1 py-4 active:opacity-80", onClick: () => insertVariable(variableKey), children: [
1247
+ renderVariableToken(variableKey, getVariableVisualType(variableKey)),
1248
+ /* @__PURE__ */ jsx11("div", { className: "max-w-[600px] break-words leading-[1.25]", children: t(`variables.${variableKey}`, "-", { example: systemVariables?.[variableKey], interpolation: { escapeValue: false, prefix: "{{{", suffix: "}}}" } }) })
1249
+ ] }, variableKey))
1250
+ ] })
1251
+ ] })
1252
+ }
1253
+ ),
1254
+ isAutoComplete ? /* @__PURE__ */ jsx11(
1255
+ Autocomplete2,
1256
+ {
1257
+ disableClearable: true,
1258
+ freeSolo: true,
1259
+ includeInputInList: true,
1260
+ onChange: (_e, nextValue) => onChange?.(nextValue?.value ?? nextValue),
1261
+ onInputChange: (_e, nextValue) => onChange?.(nextValue),
1262
+ options: autoCompleteOptions ?? [],
1263
+ value,
1264
+ renderOption,
1265
+ getOptionLabel: (option) => typeof option === "string" ? option : option.label,
1266
+ filterOptions: handleFilterOptions,
1267
+ slots: { listbox: ListboxComponent },
1268
+ slotProps: { listbox: { onScroll: onScrollListBox } },
1269
+ onHighlightChange,
1270
+ onOpen: onPopupOpen,
1271
+ onClose: onPopupClose,
1272
+ renderInput: (params) => textField(params)
1273
+ }
1274
+ ) : textField()
1275
+ ] });
1276
+ });
1277
+ LSVariableInputField.displayName = "LSVariableInputField";
1278
+ var VariableInputTextField = forwardRef4(
1279
+ ({ id, name, label, type, variant, disabled, autoFocus, multiline, placeholder, rows, maxRows, value, onChange, inputProps, clickedVariableIcon, params = {}, containerRef }, ref) => {
1280
+ return /* @__PURE__ */ jsx11(
1281
+ LSTextField,
1282
+ {
1283
+ id,
1284
+ name,
1285
+ label,
1286
+ type,
1287
+ color: "secondary",
1288
+ variant,
1289
+ disabled,
1290
+ autoFocus,
1291
+ multiline,
1292
+ placeholder,
1293
+ rows,
1294
+ maxRows,
1295
+ value,
1296
+ fullWidth: true,
1297
+ className: `mui-ls-input noMinHeight ${params?.className ?? ""} ${inputProps?.className ?? ""}`.trim(),
1298
+ onChange: (e) => onChange?.(e.target.value),
1299
+ ...inputProps,
1300
+ ...params,
1301
+ InputProps: {
1302
+ ...params?.InputProps ?? {},
1303
+ ...inputProps?.InputProps ?? {},
1304
+ endAdornment: /* @__PURE__ */ jsxs5(Fragment, { children: [
1305
+ params?.slotProps?.input?.endAdornment ?? params?.InputProps?.endAdornment ?? null,
1306
+ /* @__PURE__ */ jsx11(
1307
+ InputAdornment2,
1308
+ {
1309
+ position: "end",
1310
+ onClick: clickedVariableIcon,
1311
+ ref: containerRef,
1312
+ className: "cursor-pointer",
1313
+ sx: {
1314
+ cursor: "pointer",
1315
+ background: "var(--primary)",
1316
+ borderRadius: "50%",
1317
+ display: "flex",
1318
+ alignItems: "center",
1319
+ justifyContent: "center",
1320
+ padding: "4px",
1321
+ minWidth: "22px",
1322
+ minHeight: "22px",
1323
+ width: "22px",
1324
+ height: "22px",
1325
+ color: "var(--neutralDark1)",
1326
+ "& *": {
1327
+ cursor: "pointer",
1328
+ color: "var(--neutralDark1)"
1329
+ }
1330
+ },
1331
+ children: "{}"
1332
+ }
1333
+ )
1334
+ ] })
1335
+ },
1336
+ ref
1337
+ }
1338
+ );
1339
+ }
1340
+ );
1341
+ VariableInputTextField.displayName = "VariableInputTextField";
1342
+
52
1343
  // src/utils/variableCompletionOptions.ts
53
1344
  function variableCompletionOptions(context, variables) {
54
1345
  const before = context.state.sliceDoc(0, context.pos);
@@ -864,6 +2155,19 @@ var resolveChatterProfileUrlWithResolvers = async ({
864
2155
  };
865
2156
  export {
866
2157
  LSButton,
2158
+ LSCheckbox,
2159
+ LSCheckboxField,
2160
+ LSColorPicker,
2161
+ LSFontPicker,
2162
+ LSInput,
2163
+ LSMultiSelect,
2164
+ LSRadio,
2165
+ LSRadioGroup,
2166
+ LSSelect,
2167
+ LSSliderInput,
2168
+ LSTextField,
2169
+ LSVariableInputField,
2170
+ LSVariableInputProvider,
867
2171
  MEDIA_PREVIEW_USER_LEVEL_VALUES,
868
2172
  buildChatMessageContent,
869
2173
  codeMirrorlinterOptions,