@lumiastream/ui 0.2.8-alpha.2 → 0.2.8-alpha.22
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 +14 -5
- package/dist/LSButton.d.ts +32 -0
- package/dist/LSButton.js +80 -0
- package/dist/LSCheckbox.d.ts +21 -0
- package/dist/LSCheckbox.js +113 -0
- package/dist/LSColorPicker.d.ts +19 -0
- package/dist/LSColorPicker.js +316 -0
- package/dist/LSDatePicker.d.ts +15 -0
- package/dist/LSDatePicker.js +198 -0
- package/dist/LSFontPicker.d.ts +17 -0
- package/dist/LSFontPicker.js +179 -0
- package/dist/LSInput.d.ts +32 -0
- package/dist/LSInput.js +159 -0
- package/dist/LSMultiSelect.d.ts +16 -0
- package/dist/LSMultiSelect.js +274 -0
- package/dist/LSRadio.d.ts +17 -0
- package/dist/LSRadio.js +52 -0
- package/dist/LSSelect.d.ts +12 -0
- package/dist/LSSelect.js +140 -0
- package/dist/LSSliderInput.d.ts +39 -0
- package/dist/LSSliderInput.js +342 -0
- package/dist/LSTextField.d.ts +9 -0
- package/dist/LSTextField.js +63 -0
- package/dist/LSVariableInputField.d.ts +96 -0
- package/dist/LSVariableInputField.js +1402 -0
- package/dist/components.d.ts +22 -0
- package/dist/components.js +2317 -0
- package/dist/index.d.ts +26 -860
- package/dist/index.js +2208 -1029
- package/dist/se-import.d.ts +421 -0
- package/dist/se-import.js +7323 -0
- package/dist/utils/chatMedia.d.ts +106 -0
- package/dist/utils/chatMedia.js +611 -0
- package/dist/utils.d.ts +111 -0
- package/dist/utils.js +830 -0
- package/package.json +92 -18
|
@@ -0,0 +1,316 @@
|
|
|
1
|
+
// #style-inject:#style-inject
|
|
2
|
+
function styleInject(css, { insertAt } = {}) {
|
|
3
|
+
if (!css || typeof document === "undefined") return;
|
|
4
|
+
const head = document.head || document.getElementsByTagName("head")[0];
|
|
5
|
+
const style = document.createElement("style");
|
|
6
|
+
style.type = "text/css";
|
|
7
|
+
if (insertAt === "top") {
|
|
8
|
+
if (head.firstChild) {
|
|
9
|
+
head.insertBefore(style, head.firstChild);
|
|
10
|
+
} else {
|
|
11
|
+
head.appendChild(style);
|
|
12
|
+
}
|
|
13
|
+
} else {
|
|
14
|
+
head.appendChild(style);
|
|
15
|
+
}
|
|
16
|
+
if (style.styleSheet) {
|
|
17
|
+
style.styleSheet.cssText = css;
|
|
18
|
+
} else {
|
|
19
|
+
style.appendChild(document.createTextNode(css));
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
// src/lumia-ui.css
|
|
24
|
+
styleInject(".ls-color-picker,\n.ls-color-picker *,\n.mui-multi-select,\n.mui-multi-select *,\n.ls-multi-select-value,\n.ls-multi-select-value *,\n.ls-variable-picker,\n.ls-variable-picker *,\n.ls-variable-token,\n.ls-variable-token *,\n.ls-font-picker,\n.ls-font-picker *,\n.mui-ls-input,\n.mui-ls-input * {\n box-sizing: border-box;\n}\n.ls-color-picker button,\n.mui-multi-select button {\n font: inherit;\n letter-spacing: inherit;\n color: inherit;\n margin: 0;\n}\n.ls-color-picker__preview {\n appearance: none;\n -webkit-appearance: none;\n background-color: transparent;\n background-image: none;\n cursor: pointer;\n text-transform: uppercase;\n user-select: none;\n}\n.mui-ls-button.Mui-disabled {\n color: var(--neutralLight2, var(--white2, #cac9d5));\n opacity: 0.45;\n background-color: var(--separator, #0a0821);\n cursor: not-allowed;\n}\n.mui-ls-button {\n border-radius: var(--radius, 1rem);\n padding: 0.375rem 1.5rem;\n text-transform: uppercase;\n}\n.mui-ls-button.MuiButton-sizeSmall {\n padding: 0.25rem 1rem;\n}\n.mui-ls-button.MuiButton-sizeLarge {\n padding: 0.625rem 2rem;\n}\n.mui-ls-button--extended {\n padding-inline: 3rem;\n}\n.mui-ls-button.MuiButton-containedPrimary,\n.mui-ls-button.Mui-disabled.MuiButton-containedPrimary {\n background: var(--primary, #ff4076);\n color: var(--alwayswhite, #fff) !important;\n}\n.mui-ls-button.MuiButton-containedSecondary {\n background-color: var(--secondary, #535395);\n color: var(--alwayswhite, #fff) !important;\n}\n.mui-ls-button.Mui-disabled.MuiButton-containedSecondary {\n background-color: var(--secondary, #535395);\n color: var(--neutralLight2, var(--white2, #cac9d5));\n opacity: 0.4;\n}\n.mui-ls-button.MuiButton-outlinedPrimary {\n color: var(--primary, #ff4076);\n border-color: var(--primary, #ff4076);\n}\n.mui-ls-button.MuiButton-outlinedPrimary:hover {\n border-color: var(--primary, #ff4076);\n background-color: color-mix(in srgb, var(--primary, #ff4076) 12%, transparent);\n}\n.mui-ls-button.MuiButton-outlinedSecondary {\n color: var(--neutralLight1, var(--white, #fff));\n border-color: var(--secondary, #535395);\n}\n.mui-ls-button.MuiButton-outlinedSecondary.Mui-disabled {\n color: var(--neutralLight2, var(--white2, #cac9d5));\n border-color: var(--neutralDark4, var(--cardborder, #393853));\n background-color: var(--transwhite, rgba(255, 255, 255, 0.05));\n opacity: 0.5;\n}\n.mui-ls-button.MuiButton-outlinedSecondary:hover {\n border-color: var(--secondary, #535395);\n background-color: var(--transwhite, rgba(255, 255, 255, 0.05));\n}\n.mui-ls-button.MuiButton-containedError {\n color: var(--alwayswhite, #fff) !important;\n}\n.mui-ls-button.MuiButton-outlinedError {\n color: var(--error, #fd5454);\n border-color: var(--error, #fd5454);\n}\n.mui-ls-button.MuiButton-outlinedError:hover {\n border-color: var(--error, #fd5454);\n background-color: color-mix(in srgb, var(--error, #fd5454) 12%, transparent);\n}\n.mui-ls-button--neutral.mui-ls-button--contained {\n background-color: var(--neutralDark4, var(--cardborder, #393853));\n color: var(--neutralLight1, var(--white, #fff)) !important;\n}\n.mui-ls-button--neutral.mui-ls-button--contained:hover {\n background-color: color-mix(in srgb, var(--neutralDark4, var(--cardborder, #393853)) 82%, var(--neutralLight1, #fff));\n}\n.mui-ls-button--neutral.mui-ls-button--outlined {\n color: var(--neutralLight1, var(--white, #fff));\n border-color: var(--neutralDark4, var(--cardborder, #393853));\n background-color: transparent;\n}\n.mui-ls-button--neutral.mui-ls-button--outlined:hover {\n border-color: var(--neutralLight3, var(--grey, #9392a1));\n background-color: var(--transwhite, rgba(255, 255, 255, 0.05));\n}\n.mui-ls-button--neutral.mui-ls-button--text {\n color: var(--neutralLight1, var(--white, #fff));\n}\n.mui-ls-button--neutral.mui-ls-button--text:hover {\n background-color: var(--transwhite, rgba(255, 255, 255, 0.05));\n}\n.mui-ls-button svg {\n max-height: 24px;\n max-width: 24px;\n}\n.mui-ls-input,\n.ls-font-picker,\n.ls-color-picker__input {\n width: 100%;\n}\n.mui-ls-input,\n.mui-ls-select-form-control,\n.mui-multi-select,\n.ls-font-picker,\n.mui-ls-slider-input-root {\n --ls-control-height: 55px;\n}\n.mui-ls-input .MuiOutlinedInput-root,\n.mui-ls-input .MuiInputBase-root,\n.mui-ls-input .MuiOutlinedInput-notchedOutline,\n.mui-ls-select.MuiOutlinedInput-root,\n.mui-ls-select .MuiOutlinedInput-notchedOutline,\n.mui-multi-select .mui-ls-select.MuiOutlinedInput-root,\n.mui-multi-select .mui-ls-select .MuiOutlinedInput-notchedOutline,\n.ls-font-picker .MuiOutlinedInput-root,\n.ls-font-picker .MuiInputBase-root,\n.ls-font-picker .MuiOutlinedInput-notchedOutline,\n.ls-color-picker__input .MuiOutlinedInput-root,\n.ls-color-picker__input .MuiInputBase-root,\n.ls-color-picker__input .MuiOutlinedInput-notchedOutline {\n border-radius: var(--radius) !important;\n}\n.mui-ls-input .MuiInputBase-root,\n.mui-ls-select.MuiInputBase-root,\n.mui-multi-select .mui-ls-select.MuiInputBase-root,\n.ls-font-picker .MuiInputBase-root {\n min-height: var(--ls-control-height);\n}\n.mui-ls-input.small .MuiInputBase-root {\n min-height: 25px;\n}\n.mui-ls-input.medium .MuiInputBase-root {\n min-height: 35px;\n}\n.mui-ls-input.noMinHeight .MuiInputBase-root {\n min-height: unset;\n}\n.mui-ls-date-picker input[type=datetime-local]::-webkit-calendar-picker-indicator {\n cursor: pointer;\n opacity: 0.9;\n filter: invert(1);\n}\n.mui-ls-select .MuiSelect-select,\n.mui-multi-select .MuiSelect-select {\n display: flex;\n min-height: calc(var(--ls-control-height) - 2px);\n align-items: center;\n box-sizing: border-box;\n border-radius: var(--radius);\n}\n.mui-multi-select .MuiSelect-select {\n min-width: 0;\n}\n.MuiSvgIcon-root svg {\n color: var(--neutralLight1, var(--white, #fff)) !important;\n}\n.mui-ls-input .MuiSvgIcon-root svg path {\n fill: currentcolor;\n stroke: currentcolor;\n}\n.mui-ls-input .Mui-focused .MuiOutlinedInput-notchedOutline,\n.mui-ls-input .MuiOutlinedInput-root.Mui-focused .MuiOutlinedInput-notchedOutline {\n border-color: var(--primary, #ff4076) !important;\n}\n.ls-variable-autocomplete-popper .MuiAutocomplete-paper,\n.ls-variable-autocomplete-paper {\n border: 1px solid var(--neutralDark4, var(--cardborder, #393853)) !important;\n border-radius: var(--radius, 1rem) !important;\n background: var(--neutralDark2, var(--cardbackground, #211f45)) !important;\n color: var(--neutralLight1, var(--white, #fff)) !important;\n box-shadow: 0 16px 32px rgba(0, 0, 0, 0.32) !important;\n overflow: hidden !important;\n}\n.ls-variable-autocomplete-popper .MuiAutocomplete-listbox,\n.ls-variable-autocomplete-listbox {\n padding: 0.25rem 0 !important;\n background: var(--neutralDark2, var(--cardbackground, #211f45)) !important;\n color: var(--neutralLight1, var(--white, #fff)) !important;\n}\n.ls-variable-autocomplete-popper .MuiAutocomplete-option,\n.ls-variable-autocomplete-listbox .MuiAutocomplete-option {\n display: flex !important;\n min-height: 44px !important;\n align-items: center !important;\n padding: 0.625rem 1rem !important;\n color: var(--neutralLight1, var(--white, #fff)) !important;\n font-size: 1rem !important;\n line-height: 1.35 !important;\n cursor: pointer !important;\n transition: background-color 120ms ease, color 120ms ease !important;\n}\n.ls-variable-autocomplete-popper .MuiAutocomplete-option > *,\n.ls-variable-autocomplete-listbox .MuiAutocomplete-option > * {\n min-width: 0;\n}\n.ls-variable-autocomplete-popper .MuiAutocomplete-option:hover,\n.ls-variable-autocomplete-popper .MuiAutocomplete-option.Mui-focused,\n.ls-variable-autocomplete-popper .MuiAutocomplete-option[data-focus=true],\n.ls-variable-autocomplete-popper .MuiAutocomplete-option[aria-selected=true],\n.ls-variable-autocomplete-listbox .MuiAutocomplete-option:hover,\n.ls-variable-autocomplete-listbox .MuiAutocomplete-option.Mui-focused,\n.ls-variable-autocomplete-listbox .MuiAutocomplete-option[data-focus=true],\n.ls-variable-autocomplete-listbox .MuiAutocomplete-option[aria-selected=true] {\n background: var( --cardHover, var(--transwhite, rgba(255, 255, 255, 0.05)) ) !important;\n color: var(--neutralLight1, var(--white, #fff)) !important;\n}\n.ls-variable-option {\n gap: 0.75rem;\n}\n.ls-variable-option__thumb {\n width: 40px;\n height: 40px;\n flex: 0 0 40px;\n border-radius: var(--radius, 1rem);\n object-fit: cover;\n}\n.ls-variable-option__thumb--placeholder {\n background: var(--neutralDark4, var(--cardborder, #393853));\n}\n.ls-variable-option__body {\n min-width: 0;\n}\n.ls-variable-option__label {\n color: var(--neutralLight1, var(--white, #fff));\n font-weight: 500;\n line-height: 1.25;\n}\n.ls-variable-option__helper {\n margin-top: 0.125rem;\n color: var(--neutralLight3, var(--grey, #9392a1));\n font-size: 0.875rem;\n line-height: 1.25;\n}\n.ls-variable-autocomplete-popup-indicator,\n.ls-variable-autocomplete-popup-indicator.MuiIconButton-root,\n.ls-variable-autocomplete-popup-indicator svg {\n color: var(--neutralLight1, var(--white, #fff)) !important;\n}\n.ls-variable-autocomplete-popup-indicator svg path {\n fill: currentcolor !important;\n stroke: currentcolor !important;\n}\n.ls-variable-input-adornment,\n.ls-variable-input-adornment.MuiInputAdornment-root {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n height: 24px;\n width: 24px;\n min-width: 24px;\n margin-left: 0.35rem;\n border-radius: var(--radius, 1rem);\n background: var(--primary, #ff4076) !important;\n color: var(--alwayswhite, var(--white, #fff)) !important;\n font-weight: 800;\n line-height: 1;\n letter-spacing: 0;\n cursor: pointer;\n user-select: none;\n}\n.ls-variable-input-adornment svg,\n.ls-variable-input-adornment path {\n color: currentcolor !important;\n fill: currentcolor !important;\n stroke: currentcolor !important;\n}\n.ls-variable-input-adornment:hover,\n.ls-variable-input-adornment.MuiInputAdornment-root:hover {\n filter: brightness(1.08);\n}\n.ls-variable-input-adornment:active,\n.ls-variable-input-adornment.MuiInputAdornment-root:active {\n filter: brightness(0.96);\n}\n.mui-ls-slider-input-root {\n width: 100%;\n}\n.mui-ls-slider-input-fieldset {\n position: relative;\n min-width: 0;\n width: 100%;\n min-height: var(--ls-control-height);\n margin: 0;\n border: 2px solid var(--neutralDark4, var(--cardborder, #393853));\n border-radius: var(--radius, 1rem);\n padding: 0 0.875rem 0.5rem 0.875rem;\n background: transparent;\n color: var(--neutralLight1, var(--white, #fff));\n}\n.mui-ls-slider-input-fieldset:hover {\n border-color: var(--primary, #ff4076);\n}\n.mui-ls-slider-input-legend {\n display: block;\n width: auto;\n max-width: calc(100% - 1rem);\n margin: 0;\n padding: 0 0.25rem;\n color: var(--neutralLight1, var(--white, #fff));\n font-size: 0.875rem;\n line-height: 1.1;\n white-space: nowrap;\n}\n.mui-ls-slider-input-row {\n display: flex;\n min-width: 0;\n min-height: calc(var(--ls-control-height) - 14px);\n align-items: center;\n gap: 1rem;\n}\n.mui-ls-slider-input-row--slider {\n flex-wrap: nowrap;\n}\n.mui-ls-slider-input-row--input {\n justify-content: stretch;\n}\n.mui-ls-slider-input-value.mui-ls-input {\n margin: 0;\n}\n.mui-ls-slider-input-value.mui-ls-input .MuiFormControl-root,\n.mui-ls-slider-input-value.mui-ls-input .MuiTextField-root {\n margin: 0;\n}\n.mui-ls-slider-input-value.mui-ls-input .MuiInputBase-root {\n min-height: 36px;\n}\n.mui-ls-slider-input-value.mui-ls-input .MuiOutlinedInput-notchedOutline {\n border-color: var(--neutralDark4, var(--cardborder, #393853));\n}\n.mui-ls-slider-input-helper {\n display: block;\n margin-top: 0.25rem;\n color: var(--neutralLight3, var(--grey, #9392a1));\n font-size: 0.75rem;\n line-height: 1.25;\n}\n.ls-multi-select-value {\n display: flex;\n width: 100%;\n min-width: 0;\n flex-wrap: nowrap;\n align-items: center;\n justify-content: space-between;\n gap: 0.5rem;\n overflow: hidden;\n white-space: nowrap;\n}\n.ls-multi-select-value__label {\n min-width: 0;\n flex: 1 1 0%;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n.ls-multi-select-value__count {\n flex-shrink: 0;\n white-space: nowrap;\n}\n.ls-color-picker__preview {\n position: relative;\n display: inline-block;\n width: 1.5rem;\n height: 1.5rem;\n flex-shrink: 0;\n padding: 0;\n border: 1px solid color-mix(in srgb, #fff 25%, transparent);\n border-radius: var(--radius, 1rem);\n background-size: cover;\n background-position: center;\n background-repeat: no-repeat;\n box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.25);\n color: transparent;\n line-height: 0;\n}\n.ls-color-picker__preview:disabled {\n cursor: not-allowed;\n opacity: 0.5;\n}\n.ls-color-picker__preview:focus {\n outline: none;\n}\n.ls-color-picker__preview:focus-visible {\n box-shadow:\n 0 0 0 2px var(--primary, #ff4076),\n 0 0 0 4px var(--neutralDark1, #1b1a28),\n 0 0 0 1px rgba(0, 0, 0, 0.25);\n}\n.ls-color-picker__gradient circle,\n.ls-color-picker__gradient polyline {\n stroke: #fff;\n}\n.ls-variable-picker {\n --variable-custom-color: var(--customVariables, #69ffd2);\n --variable-function-color: var( --functionVariables, var(--semanticPurple, #b489ff) );\n --variable-normal-color: var(--normalVariables, var(--semanticBlue, #65b8ff));\n display: flex;\n width: 92vw;\n max-width: 1100px;\n min-height: 50vh;\n max-height: 55vh;\n flex-direction: column;\n overflow: hidden;\n padding: 1rem;\n}\n.ls-variable-picker__field {\n margin: 0 0 0.75rem;\n border: 1px solid color-mix(in srgb, var(--primary, #ff4076) 42%, var(--neutralDark4, #393853));\n border-radius: var(--radius, 1rem);\n padding: 0.5rem;\n}\n.ls-variable-picker__legend {\n padding-inline: 0.375rem;\n color: var(--primary, #ff4076);\n font-size: 0.75rem;\n font-weight: 700;\n}\n.ls-variable-picker__intro {\n margin-bottom: 1rem;\n color: var(--neutralLight2, #cac9d5);\n}\n.ls-variable-picker__header,\n.ls-variable-picker__row {\n display: grid;\n grid-template-columns: minmax(300px, 1.5fr) 1fr 1fr;\n gap: 2rem;\n}\n.ls-variable-picker__header {\n margin-bottom: 0.25rem;\n padding-inline: 0.25rem;\n padding-right: 1.7rem;\n color: var(--neutralLight3, #9392a1);\n}\n.ls-variable-picker__list {\n height: 100%;\n overflow: auto;\n padding-right: 1rem;\n}\n.ls-variable-picker__row {\n cursor: pointer;\n align-items: start;\n border-bottom: 1px solid color-mix(in srgb, var(--neutralDark4, #393853) 70%, transparent);\n padding: 1rem 0.25rem;\n}\n.ls-variable-picker__row--no-border {\n border-bottom: 0;\n}\n.ls-variable-picker__token-cell {\n display: flex;\n min-width: 0;\n align-items: center;\n gap: 0.375rem;\n}\n.ls-variable-picker__expand-toggle,\n.ls-variable-picker__expand-spacer {\n width: 24px;\n height: 24px;\n flex: 0 0 24px;\n}\n.ls-variable-picker__expand-toggle {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n border: 1px solid color-mix(in srgb, var(--neutralDark4, #393853) 75%, transparent);\n border-radius: var(--radius, 1rem);\n padding: 0;\n background: var(--neutralDark3, var(--containerbackground, #1f1f3a));\n color: var(--neutralLight2, #cac9d5);\n transition:\n background-color 140ms ease,\n border-color 140ms ease,\n color 140ms ease,\n transform 140ms ease;\n}\n.ls-variable-picker__expand-toggle:hover {\n border-color: var(--primary, #ff4076);\n background: color-mix(in srgb, var(--primary, #ff4076) 16%, var(--neutralDark3, #1f1f3a));\n color: var(--neutralLight1, #fff);\n}\n.ls-variable-picker__expand-toggle svg {\n transform: rotate(-90deg);\n transition: transform 140ms ease;\n}\n.ls-variable-picker__expand-toggle--expanded svg {\n transform: rotate(0deg);\n}\n.ls-variable-picker__row:active {\n opacity: 0.8;\n}\n.ls-variable-picker__description {\n max-width: 600px;\n overflow-wrap: break-word;\n line-height: 1.25;\n word-break: break-all;\n}\n.ls-variable-picker__value {\n min-width: 0;\n}\n.ls-variable-picker__value-input {\n width: 100%;\n min-width: 0;\n cursor: text;\n overflow: hidden;\n border: 0;\n background: transparent;\n color: var(--neutralLight1, var(--white, #fff));\n caret-color: transparent;\n font: inherit;\n font-size: 1rem;\n line-height: 1.25;\n outline: 0;\n padding: 0;\n text-overflow: ellipsis;\n}\n.ls-variable-picker__value-input:focus {\n outline: 0;\n}\n.ls-variable-picker__value-input::selection {\n background: color-mix(in srgb, var(--primary, #ff4076) 45%, transparent);\n color: var(--alwayswhite, var(--white, #fff));\n}\n.ls-variable-token {\n display: flex;\n min-width: 0;\n align-items: center;\n}\n.ls-variable-token--custom {\n color: var(--customVariables, #69ffd2);\n}\n.ls-variable-token--function {\n color: var(--functionVariables, var(--semanticPurple, #b489ff));\n}\n.ls-variable-token--system {\n color: var(--normalVariables, var(--semanticBlue, #65b8ff));\n}\n.ls-variable-token__name {\n min-width: 0;\n word-break: break-all;\n}\n.ls-variable-token__badge {\n display: inline-flex;\n margin-left: 0.5rem;\n flex-shrink: 0;\n align-items: center;\n border: 1px solid currentcolor;\n border-radius: var(--radius, 1rem);\n padding-inline: 0.25rem;\n padding-block: 0;\n font-size: 10px;\n font-weight: 600;\n line-height: 1;\n text-transform: uppercase;\n}\n");
|
|
25
|
+
|
|
26
|
+
// src/components/LSColorPicker/LSColorPicker.tsx
|
|
27
|
+
import { useEffect, useRef, useState } from "react";
|
|
28
|
+
import GradientColorPicker from "react-best-gradient-color-picker";
|
|
29
|
+
|
|
30
|
+
// src/components/LSInput/LSInput.tsx
|
|
31
|
+
import FormControl from "@mui/material/FormControl";
|
|
32
|
+
import InputAdornment from "@mui/material/InputAdornment";
|
|
33
|
+
import TextField from "@mui/material/TextField";
|
|
34
|
+
import classNames from "classnames";
|
|
35
|
+
import { forwardRef } from "react";
|
|
36
|
+
import { jsx } from "react/jsx-runtime";
|
|
37
|
+
var LSInput = forwardRef(
|
|
38
|
+
(props, ref) => {
|
|
39
|
+
const hasExplicitValue = Object.prototype.hasOwnProperty.call(props, "value");
|
|
40
|
+
const {
|
|
41
|
+
startAdornment,
|
|
42
|
+
endAdornment,
|
|
43
|
+
inputBeforeText,
|
|
44
|
+
inputAfterText,
|
|
45
|
+
maxWidth,
|
|
46
|
+
className = "",
|
|
47
|
+
InputProps: inputPropsProp,
|
|
48
|
+
InputLabelProps: inputLabelPropsProp,
|
|
49
|
+
inputProps: htmlInputPropsProp,
|
|
50
|
+
slotProps: slotPropsProp,
|
|
51
|
+
onChange,
|
|
52
|
+
onChangeStart,
|
|
53
|
+
onChangeEnd,
|
|
54
|
+
type,
|
|
55
|
+
value,
|
|
56
|
+
helperText,
|
|
57
|
+
error,
|
|
58
|
+
style,
|
|
59
|
+
centerText,
|
|
60
|
+
$noMinHeight,
|
|
61
|
+
bypasscolor,
|
|
62
|
+
textColor,
|
|
63
|
+
fullWidth = true,
|
|
64
|
+
...rest
|
|
65
|
+
} = props;
|
|
66
|
+
const isNumberInput = type === "number";
|
|
67
|
+
const labelIdFallback = typeof rest.label === "string" ? rest.label : void 0;
|
|
68
|
+
const normalizedValue = isNumberInput && (value === void 0 || value === null) ? "" : value;
|
|
69
|
+
const handleChange = (event) => {
|
|
70
|
+
const rawValue = event.target.value;
|
|
71
|
+
let sanitizedValue = rawValue;
|
|
72
|
+
if (isNumberInput) {
|
|
73
|
+
if (rawValue === "") {
|
|
74
|
+
sanitizedValue = void 0;
|
|
75
|
+
} else {
|
|
76
|
+
const numericValue = Number(rawValue);
|
|
77
|
+
sanitizedValue = Number.isNaN(numericValue) ? void 0 : numericValue;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
onChangeStart?.(event, sanitizedValue);
|
|
81
|
+
onChange?.(event, sanitizedValue);
|
|
82
|
+
onChangeEnd?.(event, sanitizedValue);
|
|
83
|
+
};
|
|
84
|
+
const resolvedStartAdornment = inputPropsProp?.startAdornment ?? (startAdornment ? /* @__PURE__ */ jsx(InputAdornment, { position: "start", children: startAdornment }) : inputBeforeText ? /* @__PURE__ */ jsx(InputAdornment, { position: "start", children: /* @__PURE__ */ jsx("span", { className: "mui-ls-input-affix", children: inputBeforeText }) }) : void 0);
|
|
85
|
+
const resolvedEndAdornment = inputPropsProp?.endAdornment ?? (endAdornment ? /* @__PURE__ */ jsx(InputAdornment, { position: "end", children: endAdornment }) : inputAfterText ? /* @__PURE__ */ jsx(InputAdornment, { position: "end", children: /* @__PURE__ */ jsx("span", { className: "mui-ls-input-affix", children: inputAfterText }) }) : void 0);
|
|
86
|
+
const inputSlotProps = {
|
|
87
|
+
...inputPropsProp,
|
|
88
|
+
startAdornment: resolvedStartAdornment,
|
|
89
|
+
endAdornment: resolvedEndAdornment,
|
|
90
|
+
readOnly: rest.readOnly ?? inputPropsProp?.readOnly,
|
|
91
|
+
sx: {
|
|
92
|
+
...inputPropsProp?.sx ?? {},
|
|
93
|
+
"& input, & textarea": {
|
|
94
|
+
textAlign: centerText ? "center" : void 0,
|
|
95
|
+
color: textColor ?? void 0
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
};
|
|
99
|
+
const inputLabelProps = {
|
|
100
|
+
shrink: true,
|
|
101
|
+
...inputLabelPropsProp
|
|
102
|
+
};
|
|
103
|
+
const helperContent = helperText ?? (typeof error === "string" ? error : "");
|
|
104
|
+
const hasError = typeof error === "string" ? true : Boolean(error);
|
|
105
|
+
const resolvedMaxWidth = maxWidth ?? style?.maxWidth;
|
|
106
|
+
const valueProps = hasExplicitValue ? { value: normalizedValue } : {};
|
|
107
|
+
const slotProps = {
|
|
108
|
+
...slotPropsProp ?? {},
|
|
109
|
+
input: {
|
|
110
|
+
...slotPropsProp?.input ?? {},
|
|
111
|
+
...inputSlotProps,
|
|
112
|
+
sx: {
|
|
113
|
+
...slotPropsProp?.input?.sx ?? {},
|
|
114
|
+
...inputSlotProps.sx
|
|
115
|
+
}
|
|
116
|
+
},
|
|
117
|
+
inputLabel: {
|
|
118
|
+
...slotPropsProp?.inputLabel ?? {},
|
|
119
|
+
...inputLabelProps
|
|
120
|
+
},
|
|
121
|
+
htmlInput: {
|
|
122
|
+
...slotPropsProp?.htmlInput ?? {},
|
|
123
|
+
...htmlInputPropsProp ?? {}
|
|
124
|
+
}
|
|
125
|
+
};
|
|
126
|
+
const TextFieldComponent = TextField;
|
|
127
|
+
return /* @__PURE__ */ jsx(
|
|
128
|
+
FormControl,
|
|
129
|
+
{
|
|
130
|
+
variant: "outlined",
|
|
131
|
+
className: classNames("mui-ls-input", className, {
|
|
132
|
+
noMinHeight: $noMinHeight,
|
|
133
|
+
bypassMuiColor: bypasscolor || bypasscolor === "default"
|
|
134
|
+
}),
|
|
135
|
+
style: { ...style, maxWidth: resolvedMaxWidth, width: fullWidth ? "100%" : style?.width },
|
|
136
|
+
children: /* @__PURE__ */ jsx(
|
|
137
|
+
TextFieldComponent,
|
|
138
|
+
{
|
|
139
|
+
...rest,
|
|
140
|
+
...valueProps,
|
|
141
|
+
type,
|
|
142
|
+
id: rest.id ?? rest.name ?? labelIdFallback,
|
|
143
|
+
label: rest.label,
|
|
144
|
+
size: rest.size,
|
|
145
|
+
margin: "dense",
|
|
146
|
+
variant: "outlined",
|
|
147
|
+
color: bypasscolor === "default" || bypasscolor === "inherit" ? "primary" : bypasscolor,
|
|
148
|
+
fullWidth,
|
|
149
|
+
onChange: handleChange,
|
|
150
|
+
slotProps,
|
|
151
|
+
inputRef: ref,
|
|
152
|
+
helperText: helperContent,
|
|
153
|
+
error: hasError
|
|
154
|
+
}
|
|
155
|
+
)
|
|
156
|
+
}
|
|
157
|
+
);
|
|
158
|
+
}
|
|
159
|
+
);
|
|
160
|
+
LSInput.displayName = "LSInput";
|
|
161
|
+
|
|
162
|
+
// src/components/LSColorPicker/LSColorPicker.tsx
|
|
163
|
+
import { jsx as jsx2, jsxs } from "react/jsx-runtime";
|
|
164
|
+
var DEFAULT_COLOR = "#ff4076";
|
|
165
|
+
var LSColorPicker = ({ value = DEFAULT_COLOR, onChange, onBlur, className, name, label, helperText, placeholder, hideGradientControls = false, usePopup = false, disabled = false }) => {
|
|
166
|
+
const isPopupMode = usePopup === true;
|
|
167
|
+
const [open, setOpen] = useState(false);
|
|
168
|
+
const containerRef = useRef(null);
|
|
169
|
+
const [pickerWidth, setPickerWidth] = useState(320);
|
|
170
|
+
const showPicker = open;
|
|
171
|
+
const pickerHeight = 220;
|
|
172
|
+
const inlinePickerHeight = hideGradientControls ? pickerHeight + 84 : pickerHeight + 150;
|
|
173
|
+
const pickerContainerStyle = isPopupMode ? {
|
|
174
|
+
position: "absolute",
|
|
175
|
+
right: 0,
|
|
176
|
+
top: "calc(100% + 0.5rem)",
|
|
177
|
+
zIndex: 1e3,
|
|
178
|
+
borderRadius: "1rem",
|
|
179
|
+
background: "var(--neutralDark1)",
|
|
180
|
+
padding: "0.5rem",
|
|
181
|
+
boxShadow: "0 8px 24px rgba(0, 0, 0, 0.4)"
|
|
182
|
+
} : {
|
|
183
|
+
position: "static",
|
|
184
|
+
display: "block",
|
|
185
|
+
width: "100%",
|
|
186
|
+
height: inlinePickerHeight,
|
|
187
|
+
minHeight: inlinePickerHeight,
|
|
188
|
+
marginTop: "0.5rem",
|
|
189
|
+
borderRadius: "1rem",
|
|
190
|
+
background: "var(--neutralDark1)",
|
|
191
|
+
padding: "0.5rem",
|
|
192
|
+
boxSizing: "border-box",
|
|
193
|
+
overflow: "visible"
|
|
194
|
+
};
|
|
195
|
+
useEffect(() => {
|
|
196
|
+
const node = containerRef.current;
|
|
197
|
+
if (!node) return void 0;
|
|
198
|
+
const updateWidth = () => {
|
|
199
|
+
const nextWidth = Math.max(node.clientWidth - 16, 220);
|
|
200
|
+
setPickerWidth(nextWidth);
|
|
201
|
+
};
|
|
202
|
+
updateWidth();
|
|
203
|
+
const observer = new ResizeObserver(() => {
|
|
204
|
+
updateWidth();
|
|
205
|
+
});
|
|
206
|
+
observer.observe(node);
|
|
207
|
+
return () => observer.disconnect();
|
|
208
|
+
}, []);
|
|
209
|
+
useEffect(() => {
|
|
210
|
+
if (!open) return void 0;
|
|
211
|
+
const handleClickOutside = (e) => {
|
|
212
|
+
if (containerRef.current && !containerRef.current.contains(e.target)) {
|
|
213
|
+
setOpen(false);
|
|
214
|
+
}
|
|
215
|
+
};
|
|
216
|
+
document.addEventListener("mousedown", handleClickOutside);
|
|
217
|
+
return () => document.removeEventListener("mousedown", handleClickOutside);
|
|
218
|
+
}, [open]);
|
|
219
|
+
const handleInputChange = (e) => {
|
|
220
|
+
onChange(e.target.value);
|
|
221
|
+
};
|
|
222
|
+
const toggleOpen = () => {
|
|
223
|
+
if (disabled) return;
|
|
224
|
+
setOpen((nextOpen) => !nextOpen);
|
|
225
|
+
};
|
|
226
|
+
return /* @__PURE__ */ jsxs(
|
|
227
|
+
"div",
|
|
228
|
+
{
|
|
229
|
+
ref: containerRef,
|
|
230
|
+
className: ["ls-color-picker", className].filter(Boolean).join(" "),
|
|
231
|
+
style: {
|
|
232
|
+
position: "relative",
|
|
233
|
+
display: "flex",
|
|
234
|
+
width: "100%",
|
|
235
|
+
flexDirection: "column",
|
|
236
|
+
overflow: "visible"
|
|
237
|
+
},
|
|
238
|
+
children: [
|
|
239
|
+
/* @__PURE__ */ jsx2(
|
|
240
|
+
LSInput,
|
|
241
|
+
{
|
|
242
|
+
className: "ls-color-picker__input",
|
|
243
|
+
name,
|
|
244
|
+
label,
|
|
245
|
+
helperText,
|
|
246
|
+
value,
|
|
247
|
+
onChange: handleInputChange,
|
|
248
|
+
onBlur,
|
|
249
|
+
placeholder,
|
|
250
|
+
disabled,
|
|
251
|
+
endAdornment: /* @__PURE__ */ jsx2(
|
|
252
|
+
"button",
|
|
253
|
+
{
|
|
254
|
+
type: "button",
|
|
255
|
+
className: "ls-color-picker__preview",
|
|
256
|
+
style: { background: value },
|
|
257
|
+
onClick: toggleOpen,
|
|
258
|
+
"aria-label": isPopupMode ? "Open color picker" : "Color preview",
|
|
259
|
+
disabled
|
|
260
|
+
}
|
|
261
|
+
)
|
|
262
|
+
}
|
|
263
|
+
),
|
|
264
|
+
showPicker && /* @__PURE__ */ jsx2(
|
|
265
|
+
"div",
|
|
266
|
+
{
|
|
267
|
+
className: isPopupMode ? "ls-color-picker__picker ls-color-picker__picker--popup" : "ls-color-picker__picker ls-color-picker__picker--inline",
|
|
268
|
+
style: pickerContainerStyle,
|
|
269
|
+
children: /* @__PURE__ */ jsx2(
|
|
270
|
+
GradientColorPicker,
|
|
271
|
+
{
|
|
272
|
+
hidePresets: true,
|
|
273
|
+
hideColorGuide: true,
|
|
274
|
+
hideAdvancedSliders: true,
|
|
275
|
+
hideInputs: true,
|
|
276
|
+
hideInputType: true,
|
|
277
|
+
hideEyeDrop: false,
|
|
278
|
+
hideGradientControls,
|
|
279
|
+
hideColorTypeBtns: hideGradientControls,
|
|
280
|
+
width: pickerWidth,
|
|
281
|
+
height: pickerHeight,
|
|
282
|
+
className: "ls-color-picker__gradient",
|
|
283
|
+
value,
|
|
284
|
+
onChange,
|
|
285
|
+
style: {
|
|
286
|
+
body: { background: "transparent", color: "var(--neutralLight1, #fff)" },
|
|
287
|
+
rbgcpControlBtn: {
|
|
288
|
+
background: "var(--neutralDark4)",
|
|
289
|
+
color: "var(--neutralLight1, #fff)",
|
|
290
|
+
boxShadow: "none"
|
|
291
|
+
},
|
|
292
|
+
rbgcpControlBtnSelected: {
|
|
293
|
+
background: "var(--primary)",
|
|
294
|
+
color: "var(--neutralLight1)",
|
|
295
|
+
boxShadow: "0 6px 14px rgba(255, 64, 118, 0.28)"
|
|
296
|
+
},
|
|
297
|
+
rbgcpControlBtnWrapper: {
|
|
298
|
+
background: "var(--neutralDark4)",
|
|
299
|
+
color: "var(--neutralLight1, #fff)"
|
|
300
|
+
},
|
|
301
|
+
rbgcpControlIconBtn: {
|
|
302
|
+
background: "transparent",
|
|
303
|
+
color: "var(--neutralLight1, #fff)"
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
)
|
|
308
|
+
}
|
|
309
|
+
)
|
|
310
|
+
]
|
|
311
|
+
}
|
|
312
|
+
);
|
|
313
|
+
};
|
|
314
|
+
export {
|
|
315
|
+
LSColorPicker
|
|
316
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { LSInputProps } from './LSInput.js';
|
|
3
|
+
import '@mui/material/TextField';
|
|
4
|
+
|
|
5
|
+
type ProtoExntends<T, U> = U & Omit<T, keyof U>;
|
|
6
|
+
interface LSDatePickerPropsChild {
|
|
7
|
+
value?: string;
|
|
8
|
+
onChange?: (event: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>, value: string) => void;
|
|
9
|
+
onChangeStart?: (event: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>, value: string) => void;
|
|
10
|
+
onChangeEnd?: (event: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>, value: string) => void;
|
|
11
|
+
}
|
|
12
|
+
type LSDatePickerProps = ProtoExntends<Omit<LSInputProps, 'type'>, LSDatePickerPropsChild>;
|
|
13
|
+
declare const LSDatePicker: React.ForwardRefExoticComponent<Omit<LSDatePickerProps, "ref"> & React.RefAttributes<HTMLInputElement>>;
|
|
14
|
+
|
|
15
|
+
export { LSDatePicker, type LSDatePickerProps };
|
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
// #style-inject:#style-inject
|
|
2
|
+
function styleInject(css, { insertAt } = {}) {
|
|
3
|
+
if (!css || typeof document === "undefined") return;
|
|
4
|
+
const head = document.head || document.getElementsByTagName("head")[0];
|
|
5
|
+
const style = document.createElement("style");
|
|
6
|
+
style.type = "text/css";
|
|
7
|
+
if (insertAt === "top") {
|
|
8
|
+
if (head.firstChild) {
|
|
9
|
+
head.insertBefore(style, head.firstChild);
|
|
10
|
+
} else {
|
|
11
|
+
head.appendChild(style);
|
|
12
|
+
}
|
|
13
|
+
} else {
|
|
14
|
+
head.appendChild(style);
|
|
15
|
+
}
|
|
16
|
+
if (style.styleSheet) {
|
|
17
|
+
style.styleSheet.cssText = css;
|
|
18
|
+
} else {
|
|
19
|
+
style.appendChild(document.createTextNode(css));
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
// src/lumia-ui.css
|
|
24
|
+
styleInject(".ls-color-picker,\n.ls-color-picker *,\n.mui-multi-select,\n.mui-multi-select *,\n.ls-multi-select-value,\n.ls-multi-select-value *,\n.ls-variable-picker,\n.ls-variable-picker *,\n.ls-variable-token,\n.ls-variable-token *,\n.ls-font-picker,\n.ls-font-picker *,\n.mui-ls-input,\n.mui-ls-input * {\n box-sizing: border-box;\n}\n.ls-color-picker button,\n.mui-multi-select button {\n font: inherit;\n letter-spacing: inherit;\n color: inherit;\n margin: 0;\n}\n.ls-color-picker__preview {\n appearance: none;\n -webkit-appearance: none;\n background-color: transparent;\n background-image: none;\n cursor: pointer;\n text-transform: uppercase;\n user-select: none;\n}\n.mui-ls-button.Mui-disabled {\n color: var(--neutralLight2, var(--white2, #cac9d5));\n opacity: 0.45;\n background-color: var(--separator, #0a0821);\n cursor: not-allowed;\n}\n.mui-ls-button {\n border-radius: var(--radius, 1rem);\n padding: 0.375rem 1.5rem;\n text-transform: uppercase;\n}\n.mui-ls-button.MuiButton-sizeSmall {\n padding: 0.25rem 1rem;\n}\n.mui-ls-button.MuiButton-sizeLarge {\n padding: 0.625rem 2rem;\n}\n.mui-ls-button--extended {\n padding-inline: 3rem;\n}\n.mui-ls-button.MuiButton-containedPrimary,\n.mui-ls-button.Mui-disabled.MuiButton-containedPrimary {\n background: var(--primary, #ff4076);\n color: var(--alwayswhite, #fff) !important;\n}\n.mui-ls-button.MuiButton-containedSecondary {\n background-color: var(--secondary, #535395);\n color: var(--alwayswhite, #fff) !important;\n}\n.mui-ls-button.Mui-disabled.MuiButton-containedSecondary {\n background-color: var(--secondary, #535395);\n color: var(--neutralLight2, var(--white2, #cac9d5));\n opacity: 0.4;\n}\n.mui-ls-button.MuiButton-outlinedPrimary {\n color: var(--primary, #ff4076);\n border-color: var(--primary, #ff4076);\n}\n.mui-ls-button.MuiButton-outlinedPrimary:hover {\n border-color: var(--primary, #ff4076);\n background-color: color-mix(in srgb, var(--primary, #ff4076) 12%, transparent);\n}\n.mui-ls-button.MuiButton-outlinedSecondary {\n color: var(--neutralLight1, var(--white, #fff));\n border-color: var(--secondary, #535395);\n}\n.mui-ls-button.MuiButton-outlinedSecondary.Mui-disabled {\n color: var(--neutralLight2, var(--white2, #cac9d5));\n border-color: var(--neutralDark4, var(--cardborder, #393853));\n background-color: var(--transwhite, rgba(255, 255, 255, 0.05));\n opacity: 0.5;\n}\n.mui-ls-button.MuiButton-outlinedSecondary:hover {\n border-color: var(--secondary, #535395);\n background-color: var(--transwhite, rgba(255, 255, 255, 0.05));\n}\n.mui-ls-button.MuiButton-containedError {\n color: var(--alwayswhite, #fff) !important;\n}\n.mui-ls-button.MuiButton-outlinedError {\n color: var(--error, #fd5454);\n border-color: var(--error, #fd5454);\n}\n.mui-ls-button.MuiButton-outlinedError:hover {\n border-color: var(--error, #fd5454);\n background-color: color-mix(in srgb, var(--error, #fd5454) 12%, transparent);\n}\n.mui-ls-button--neutral.mui-ls-button--contained {\n background-color: var(--neutralDark4, var(--cardborder, #393853));\n color: var(--neutralLight1, var(--white, #fff)) !important;\n}\n.mui-ls-button--neutral.mui-ls-button--contained:hover {\n background-color: color-mix(in srgb, var(--neutralDark4, var(--cardborder, #393853)) 82%, var(--neutralLight1, #fff));\n}\n.mui-ls-button--neutral.mui-ls-button--outlined {\n color: var(--neutralLight1, var(--white, #fff));\n border-color: var(--neutralDark4, var(--cardborder, #393853));\n background-color: transparent;\n}\n.mui-ls-button--neutral.mui-ls-button--outlined:hover {\n border-color: var(--neutralLight3, var(--grey, #9392a1));\n background-color: var(--transwhite, rgba(255, 255, 255, 0.05));\n}\n.mui-ls-button--neutral.mui-ls-button--text {\n color: var(--neutralLight1, var(--white, #fff));\n}\n.mui-ls-button--neutral.mui-ls-button--text:hover {\n background-color: var(--transwhite, rgba(255, 255, 255, 0.05));\n}\n.mui-ls-button svg {\n max-height: 24px;\n max-width: 24px;\n}\n.mui-ls-input,\n.ls-font-picker,\n.ls-color-picker__input {\n width: 100%;\n}\n.mui-ls-input,\n.mui-ls-select-form-control,\n.mui-multi-select,\n.ls-font-picker,\n.mui-ls-slider-input-root {\n --ls-control-height: 55px;\n}\n.mui-ls-input .MuiOutlinedInput-root,\n.mui-ls-input .MuiInputBase-root,\n.mui-ls-input .MuiOutlinedInput-notchedOutline,\n.mui-ls-select.MuiOutlinedInput-root,\n.mui-ls-select .MuiOutlinedInput-notchedOutline,\n.mui-multi-select .mui-ls-select.MuiOutlinedInput-root,\n.mui-multi-select .mui-ls-select .MuiOutlinedInput-notchedOutline,\n.ls-font-picker .MuiOutlinedInput-root,\n.ls-font-picker .MuiInputBase-root,\n.ls-font-picker .MuiOutlinedInput-notchedOutline,\n.ls-color-picker__input .MuiOutlinedInput-root,\n.ls-color-picker__input .MuiInputBase-root,\n.ls-color-picker__input .MuiOutlinedInput-notchedOutline {\n border-radius: var(--radius) !important;\n}\n.mui-ls-input .MuiInputBase-root,\n.mui-ls-select.MuiInputBase-root,\n.mui-multi-select .mui-ls-select.MuiInputBase-root,\n.ls-font-picker .MuiInputBase-root {\n min-height: var(--ls-control-height);\n}\n.mui-ls-input.small .MuiInputBase-root {\n min-height: 25px;\n}\n.mui-ls-input.medium .MuiInputBase-root {\n min-height: 35px;\n}\n.mui-ls-input.noMinHeight .MuiInputBase-root {\n min-height: unset;\n}\n.mui-ls-date-picker input[type=datetime-local]::-webkit-calendar-picker-indicator {\n cursor: pointer;\n opacity: 0.9;\n filter: invert(1);\n}\n.mui-ls-select .MuiSelect-select,\n.mui-multi-select .MuiSelect-select {\n display: flex;\n min-height: calc(var(--ls-control-height) - 2px);\n align-items: center;\n box-sizing: border-box;\n border-radius: var(--radius);\n}\n.mui-multi-select .MuiSelect-select {\n min-width: 0;\n}\n.MuiSvgIcon-root svg {\n color: var(--neutralLight1, var(--white, #fff)) !important;\n}\n.mui-ls-input .MuiSvgIcon-root svg path {\n fill: currentcolor;\n stroke: currentcolor;\n}\n.mui-ls-input .Mui-focused .MuiOutlinedInput-notchedOutline,\n.mui-ls-input .MuiOutlinedInput-root.Mui-focused .MuiOutlinedInput-notchedOutline {\n border-color: var(--primary, #ff4076) !important;\n}\n.ls-variable-autocomplete-popper .MuiAutocomplete-paper,\n.ls-variable-autocomplete-paper {\n border: 1px solid var(--neutralDark4, var(--cardborder, #393853)) !important;\n border-radius: var(--radius, 1rem) !important;\n background: var(--neutralDark2, var(--cardbackground, #211f45)) !important;\n color: var(--neutralLight1, var(--white, #fff)) !important;\n box-shadow: 0 16px 32px rgba(0, 0, 0, 0.32) !important;\n overflow: hidden !important;\n}\n.ls-variable-autocomplete-popper .MuiAutocomplete-listbox,\n.ls-variable-autocomplete-listbox {\n padding: 0.25rem 0 !important;\n background: var(--neutralDark2, var(--cardbackground, #211f45)) !important;\n color: var(--neutralLight1, var(--white, #fff)) !important;\n}\n.ls-variable-autocomplete-popper .MuiAutocomplete-option,\n.ls-variable-autocomplete-listbox .MuiAutocomplete-option {\n display: flex !important;\n min-height: 44px !important;\n align-items: center !important;\n padding: 0.625rem 1rem !important;\n color: var(--neutralLight1, var(--white, #fff)) !important;\n font-size: 1rem !important;\n line-height: 1.35 !important;\n cursor: pointer !important;\n transition: background-color 120ms ease, color 120ms ease !important;\n}\n.ls-variable-autocomplete-popper .MuiAutocomplete-option > *,\n.ls-variable-autocomplete-listbox .MuiAutocomplete-option > * {\n min-width: 0;\n}\n.ls-variable-autocomplete-popper .MuiAutocomplete-option:hover,\n.ls-variable-autocomplete-popper .MuiAutocomplete-option.Mui-focused,\n.ls-variable-autocomplete-popper .MuiAutocomplete-option[data-focus=true],\n.ls-variable-autocomplete-popper .MuiAutocomplete-option[aria-selected=true],\n.ls-variable-autocomplete-listbox .MuiAutocomplete-option:hover,\n.ls-variable-autocomplete-listbox .MuiAutocomplete-option.Mui-focused,\n.ls-variable-autocomplete-listbox .MuiAutocomplete-option[data-focus=true],\n.ls-variable-autocomplete-listbox .MuiAutocomplete-option[aria-selected=true] {\n background: var( --cardHover, var(--transwhite, rgba(255, 255, 255, 0.05)) ) !important;\n color: var(--neutralLight1, var(--white, #fff)) !important;\n}\n.ls-variable-option {\n gap: 0.75rem;\n}\n.ls-variable-option__thumb {\n width: 40px;\n height: 40px;\n flex: 0 0 40px;\n border-radius: var(--radius, 1rem);\n object-fit: cover;\n}\n.ls-variable-option__thumb--placeholder {\n background: var(--neutralDark4, var(--cardborder, #393853));\n}\n.ls-variable-option__body {\n min-width: 0;\n}\n.ls-variable-option__label {\n color: var(--neutralLight1, var(--white, #fff));\n font-weight: 500;\n line-height: 1.25;\n}\n.ls-variable-option__helper {\n margin-top: 0.125rem;\n color: var(--neutralLight3, var(--grey, #9392a1));\n font-size: 0.875rem;\n line-height: 1.25;\n}\n.ls-variable-autocomplete-popup-indicator,\n.ls-variable-autocomplete-popup-indicator.MuiIconButton-root,\n.ls-variable-autocomplete-popup-indicator svg {\n color: var(--neutralLight1, var(--white, #fff)) !important;\n}\n.ls-variable-autocomplete-popup-indicator svg path {\n fill: currentcolor !important;\n stroke: currentcolor !important;\n}\n.ls-variable-input-adornment,\n.ls-variable-input-adornment.MuiInputAdornment-root {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n height: 24px;\n width: 24px;\n min-width: 24px;\n margin-left: 0.35rem;\n border-radius: var(--radius, 1rem);\n background: var(--primary, #ff4076) !important;\n color: var(--alwayswhite, var(--white, #fff)) !important;\n font-weight: 800;\n line-height: 1;\n letter-spacing: 0;\n cursor: pointer;\n user-select: none;\n}\n.ls-variable-input-adornment svg,\n.ls-variable-input-adornment path {\n color: currentcolor !important;\n fill: currentcolor !important;\n stroke: currentcolor !important;\n}\n.ls-variable-input-adornment:hover,\n.ls-variable-input-adornment.MuiInputAdornment-root:hover {\n filter: brightness(1.08);\n}\n.ls-variable-input-adornment:active,\n.ls-variable-input-adornment.MuiInputAdornment-root:active {\n filter: brightness(0.96);\n}\n.mui-ls-slider-input-root {\n width: 100%;\n}\n.mui-ls-slider-input-fieldset {\n position: relative;\n min-width: 0;\n width: 100%;\n min-height: var(--ls-control-height);\n margin: 0;\n border: 2px solid var(--neutralDark4, var(--cardborder, #393853));\n border-radius: var(--radius, 1rem);\n padding: 0 0.875rem 0.5rem 0.875rem;\n background: transparent;\n color: var(--neutralLight1, var(--white, #fff));\n}\n.mui-ls-slider-input-fieldset:hover {\n border-color: var(--primary, #ff4076);\n}\n.mui-ls-slider-input-legend {\n display: block;\n width: auto;\n max-width: calc(100% - 1rem);\n margin: 0;\n padding: 0 0.25rem;\n color: var(--neutralLight1, var(--white, #fff));\n font-size: 0.875rem;\n line-height: 1.1;\n white-space: nowrap;\n}\n.mui-ls-slider-input-row {\n display: flex;\n min-width: 0;\n min-height: calc(var(--ls-control-height) - 14px);\n align-items: center;\n gap: 1rem;\n}\n.mui-ls-slider-input-row--slider {\n flex-wrap: nowrap;\n}\n.mui-ls-slider-input-row--input {\n justify-content: stretch;\n}\n.mui-ls-slider-input-value.mui-ls-input {\n margin: 0;\n}\n.mui-ls-slider-input-value.mui-ls-input .MuiFormControl-root,\n.mui-ls-slider-input-value.mui-ls-input .MuiTextField-root {\n margin: 0;\n}\n.mui-ls-slider-input-value.mui-ls-input .MuiInputBase-root {\n min-height: 36px;\n}\n.mui-ls-slider-input-value.mui-ls-input .MuiOutlinedInput-notchedOutline {\n border-color: var(--neutralDark4, var(--cardborder, #393853));\n}\n.mui-ls-slider-input-helper {\n display: block;\n margin-top: 0.25rem;\n color: var(--neutralLight3, var(--grey, #9392a1));\n font-size: 0.75rem;\n line-height: 1.25;\n}\n.ls-multi-select-value {\n display: flex;\n width: 100%;\n min-width: 0;\n flex-wrap: nowrap;\n align-items: center;\n justify-content: space-between;\n gap: 0.5rem;\n overflow: hidden;\n white-space: nowrap;\n}\n.ls-multi-select-value__label {\n min-width: 0;\n flex: 1 1 0%;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n.ls-multi-select-value__count {\n flex-shrink: 0;\n white-space: nowrap;\n}\n.ls-color-picker__preview {\n position: relative;\n display: inline-block;\n width: 1.5rem;\n height: 1.5rem;\n flex-shrink: 0;\n padding: 0;\n border: 1px solid color-mix(in srgb, #fff 25%, transparent);\n border-radius: var(--radius, 1rem);\n background-size: cover;\n background-position: center;\n background-repeat: no-repeat;\n box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.25);\n color: transparent;\n line-height: 0;\n}\n.ls-color-picker__preview:disabled {\n cursor: not-allowed;\n opacity: 0.5;\n}\n.ls-color-picker__preview:focus {\n outline: none;\n}\n.ls-color-picker__preview:focus-visible {\n box-shadow:\n 0 0 0 2px var(--primary, #ff4076),\n 0 0 0 4px var(--neutralDark1, #1b1a28),\n 0 0 0 1px rgba(0, 0, 0, 0.25);\n}\n.ls-color-picker__gradient circle,\n.ls-color-picker__gradient polyline {\n stroke: #fff;\n}\n.ls-variable-picker {\n --variable-custom-color: var(--customVariables, #69ffd2);\n --variable-function-color: var( --functionVariables, var(--semanticPurple, #b489ff) );\n --variable-normal-color: var(--normalVariables, var(--semanticBlue, #65b8ff));\n display: flex;\n width: 92vw;\n max-width: 1100px;\n min-height: 50vh;\n max-height: 55vh;\n flex-direction: column;\n overflow: hidden;\n padding: 1rem;\n}\n.ls-variable-picker__field {\n margin: 0 0 0.75rem;\n border: 1px solid color-mix(in srgb, var(--primary, #ff4076) 42%, var(--neutralDark4, #393853));\n border-radius: var(--radius, 1rem);\n padding: 0.5rem;\n}\n.ls-variable-picker__legend {\n padding-inline: 0.375rem;\n color: var(--primary, #ff4076);\n font-size: 0.75rem;\n font-weight: 700;\n}\n.ls-variable-picker__intro {\n margin-bottom: 1rem;\n color: var(--neutralLight2, #cac9d5);\n}\n.ls-variable-picker__header,\n.ls-variable-picker__row {\n display: grid;\n grid-template-columns: minmax(300px, 1.5fr) 1fr 1fr;\n gap: 2rem;\n}\n.ls-variable-picker__header {\n margin-bottom: 0.25rem;\n padding-inline: 0.25rem;\n padding-right: 1.7rem;\n color: var(--neutralLight3, #9392a1);\n}\n.ls-variable-picker__list {\n height: 100%;\n overflow: auto;\n padding-right: 1rem;\n}\n.ls-variable-picker__row {\n cursor: pointer;\n align-items: start;\n border-bottom: 1px solid color-mix(in srgb, var(--neutralDark4, #393853) 70%, transparent);\n padding: 1rem 0.25rem;\n}\n.ls-variable-picker__row--no-border {\n border-bottom: 0;\n}\n.ls-variable-picker__token-cell {\n display: flex;\n min-width: 0;\n align-items: center;\n gap: 0.375rem;\n}\n.ls-variable-picker__expand-toggle,\n.ls-variable-picker__expand-spacer {\n width: 24px;\n height: 24px;\n flex: 0 0 24px;\n}\n.ls-variable-picker__expand-toggle {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n border: 1px solid color-mix(in srgb, var(--neutralDark4, #393853) 75%, transparent);\n border-radius: var(--radius, 1rem);\n padding: 0;\n background: var(--neutralDark3, var(--containerbackground, #1f1f3a));\n color: var(--neutralLight2, #cac9d5);\n transition:\n background-color 140ms ease,\n border-color 140ms ease,\n color 140ms ease,\n transform 140ms ease;\n}\n.ls-variable-picker__expand-toggle:hover {\n border-color: var(--primary, #ff4076);\n background: color-mix(in srgb, var(--primary, #ff4076) 16%, var(--neutralDark3, #1f1f3a));\n color: var(--neutralLight1, #fff);\n}\n.ls-variable-picker__expand-toggle svg {\n transform: rotate(-90deg);\n transition: transform 140ms ease;\n}\n.ls-variable-picker__expand-toggle--expanded svg {\n transform: rotate(0deg);\n}\n.ls-variable-picker__row:active {\n opacity: 0.8;\n}\n.ls-variable-picker__description {\n max-width: 600px;\n overflow-wrap: break-word;\n line-height: 1.25;\n word-break: break-all;\n}\n.ls-variable-picker__value {\n min-width: 0;\n}\n.ls-variable-picker__value-input {\n width: 100%;\n min-width: 0;\n cursor: text;\n overflow: hidden;\n border: 0;\n background: transparent;\n color: var(--neutralLight1, var(--white, #fff));\n caret-color: transparent;\n font: inherit;\n font-size: 1rem;\n line-height: 1.25;\n outline: 0;\n padding: 0;\n text-overflow: ellipsis;\n}\n.ls-variable-picker__value-input:focus {\n outline: 0;\n}\n.ls-variable-picker__value-input::selection {\n background: color-mix(in srgb, var(--primary, #ff4076) 45%, transparent);\n color: var(--alwayswhite, var(--white, #fff));\n}\n.ls-variable-token {\n display: flex;\n min-width: 0;\n align-items: center;\n}\n.ls-variable-token--custom {\n color: var(--customVariables, #69ffd2);\n}\n.ls-variable-token--function {\n color: var(--functionVariables, var(--semanticPurple, #b489ff));\n}\n.ls-variable-token--system {\n color: var(--normalVariables, var(--semanticBlue, #65b8ff));\n}\n.ls-variable-token__name {\n min-width: 0;\n word-break: break-all;\n}\n.ls-variable-token__badge {\n display: inline-flex;\n margin-left: 0.5rem;\n flex-shrink: 0;\n align-items: center;\n border: 1px solid currentcolor;\n border-radius: var(--radius, 1rem);\n padding-inline: 0.25rem;\n padding-block: 0;\n font-size: 10px;\n font-weight: 600;\n line-height: 1;\n text-transform: uppercase;\n}\n");
|
|
25
|
+
|
|
26
|
+
// src/components/LSDatePicker/LSDatePicker.tsx
|
|
27
|
+
import { forwardRef as forwardRef2 } from "react";
|
|
28
|
+
|
|
29
|
+
// src/components/LSInput/LSInput.tsx
|
|
30
|
+
import FormControl from "@mui/material/FormControl";
|
|
31
|
+
import InputAdornment from "@mui/material/InputAdornment";
|
|
32
|
+
import TextField from "@mui/material/TextField";
|
|
33
|
+
import classNames from "classnames";
|
|
34
|
+
import { forwardRef } from "react";
|
|
35
|
+
import { jsx } from "react/jsx-runtime";
|
|
36
|
+
var LSInput = forwardRef(
|
|
37
|
+
(props, ref) => {
|
|
38
|
+
const hasExplicitValue = Object.prototype.hasOwnProperty.call(props, "value");
|
|
39
|
+
const {
|
|
40
|
+
startAdornment,
|
|
41
|
+
endAdornment,
|
|
42
|
+
inputBeforeText,
|
|
43
|
+
inputAfterText,
|
|
44
|
+
maxWidth,
|
|
45
|
+
className = "",
|
|
46
|
+
InputProps: inputPropsProp,
|
|
47
|
+
InputLabelProps: inputLabelPropsProp,
|
|
48
|
+
inputProps: htmlInputPropsProp,
|
|
49
|
+
slotProps: slotPropsProp,
|
|
50
|
+
onChange,
|
|
51
|
+
onChangeStart,
|
|
52
|
+
onChangeEnd,
|
|
53
|
+
type,
|
|
54
|
+
value,
|
|
55
|
+
helperText,
|
|
56
|
+
error,
|
|
57
|
+
style,
|
|
58
|
+
centerText,
|
|
59
|
+
$noMinHeight,
|
|
60
|
+
bypasscolor,
|
|
61
|
+
textColor,
|
|
62
|
+
fullWidth = true,
|
|
63
|
+
...rest
|
|
64
|
+
} = props;
|
|
65
|
+
const isNumberInput = type === "number";
|
|
66
|
+
const labelIdFallback = typeof rest.label === "string" ? rest.label : void 0;
|
|
67
|
+
const normalizedValue = isNumberInput && (value === void 0 || value === null) ? "" : value;
|
|
68
|
+
const handleChange = (event) => {
|
|
69
|
+
const rawValue = event.target.value;
|
|
70
|
+
let sanitizedValue = rawValue;
|
|
71
|
+
if (isNumberInput) {
|
|
72
|
+
if (rawValue === "") {
|
|
73
|
+
sanitizedValue = void 0;
|
|
74
|
+
} else {
|
|
75
|
+
const numericValue = Number(rawValue);
|
|
76
|
+
sanitizedValue = Number.isNaN(numericValue) ? void 0 : numericValue;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
onChangeStart?.(event, sanitizedValue);
|
|
80
|
+
onChange?.(event, sanitizedValue);
|
|
81
|
+
onChangeEnd?.(event, sanitizedValue);
|
|
82
|
+
};
|
|
83
|
+
const resolvedStartAdornment = inputPropsProp?.startAdornment ?? (startAdornment ? /* @__PURE__ */ jsx(InputAdornment, { position: "start", children: startAdornment }) : inputBeforeText ? /* @__PURE__ */ jsx(InputAdornment, { position: "start", children: /* @__PURE__ */ jsx("span", { className: "mui-ls-input-affix", children: inputBeforeText }) }) : void 0);
|
|
84
|
+
const resolvedEndAdornment = inputPropsProp?.endAdornment ?? (endAdornment ? /* @__PURE__ */ jsx(InputAdornment, { position: "end", children: endAdornment }) : inputAfterText ? /* @__PURE__ */ jsx(InputAdornment, { position: "end", children: /* @__PURE__ */ jsx("span", { className: "mui-ls-input-affix", children: inputAfterText }) }) : void 0);
|
|
85
|
+
const inputSlotProps = {
|
|
86
|
+
...inputPropsProp,
|
|
87
|
+
startAdornment: resolvedStartAdornment,
|
|
88
|
+
endAdornment: resolvedEndAdornment,
|
|
89
|
+
readOnly: rest.readOnly ?? inputPropsProp?.readOnly,
|
|
90
|
+
sx: {
|
|
91
|
+
...inputPropsProp?.sx ?? {},
|
|
92
|
+
"& input, & textarea": {
|
|
93
|
+
textAlign: centerText ? "center" : void 0,
|
|
94
|
+
color: textColor ?? void 0
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
};
|
|
98
|
+
const inputLabelProps = {
|
|
99
|
+
shrink: true,
|
|
100
|
+
...inputLabelPropsProp
|
|
101
|
+
};
|
|
102
|
+
const helperContent = helperText ?? (typeof error === "string" ? error : "");
|
|
103
|
+
const hasError = typeof error === "string" ? true : Boolean(error);
|
|
104
|
+
const resolvedMaxWidth = maxWidth ?? style?.maxWidth;
|
|
105
|
+
const valueProps = hasExplicitValue ? { value: normalizedValue } : {};
|
|
106
|
+
const slotProps = {
|
|
107
|
+
...slotPropsProp ?? {},
|
|
108
|
+
input: {
|
|
109
|
+
...slotPropsProp?.input ?? {},
|
|
110
|
+
...inputSlotProps,
|
|
111
|
+
sx: {
|
|
112
|
+
...slotPropsProp?.input?.sx ?? {},
|
|
113
|
+
...inputSlotProps.sx
|
|
114
|
+
}
|
|
115
|
+
},
|
|
116
|
+
inputLabel: {
|
|
117
|
+
...slotPropsProp?.inputLabel ?? {},
|
|
118
|
+
...inputLabelProps
|
|
119
|
+
},
|
|
120
|
+
htmlInput: {
|
|
121
|
+
...slotPropsProp?.htmlInput ?? {},
|
|
122
|
+
...htmlInputPropsProp ?? {}
|
|
123
|
+
}
|
|
124
|
+
};
|
|
125
|
+
const TextFieldComponent = TextField;
|
|
126
|
+
return /* @__PURE__ */ jsx(
|
|
127
|
+
FormControl,
|
|
128
|
+
{
|
|
129
|
+
variant: "outlined",
|
|
130
|
+
className: classNames("mui-ls-input", className, {
|
|
131
|
+
noMinHeight: $noMinHeight,
|
|
132
|
+
bypassMuiColor: bypasscolor || bypasscolor === "default"
|
|
133
|
+
}),
|
|
134
|
+
style: { ...style, maxWidth: resolvedMaxWidth, width: fullWidth ? "100%" : style?.width },
|
|
135
|
+
children: /* @__PURE__ */ jsx(
|
|
136
|
+
TextFieldComponent,
|
|
137
|
+
{
|
|
138
|
+
...rest,
|
|
139
|
+
...valueProps,
|
|
140
|
+
type,
|
|
141
|
+
id: rest.id ?? rest.name ?? labelIdFallback,
|
|
142
|
+
label: rest.label,
|
|
143
|
+
size: rest.size,
|
|
144
|
+
margin: "dense",
|
|
145
|
+
variant: "outlined",
|
|
146
|
+
color: bypasscolor === "default" || bypasscolor === "inherit" ? "primary" : bypasscolor,
|
|
147
|
+
fullWidth,
|
|
148
|
+
onChange: handleChange,
|
|
149
|
+
slotProps,
|
|
150
|
+
inputRef: ref,
|
|
151
|
+
helperText: helperContent,
|
|
152
|
+
error: hasError
|
|
153
|
+
}
|
|
154
|
+
)
|
|
155
|
+
}
|
|
156
|
+
);
|
|
157
|
+
}
|
|
158
|
+
);
|
|
159
|
+
LSInput.displayName = "LSInput";
|
|
160
|
+
|
|
161
|
+
// src/components/LSDatePicker/LSDatePicker.tsx
|
|
162
|
+
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
163
|
+
var toDateTimeLocalValue = (value) => {
|
|
164
|
+
if (!value) return "";
|
|
165
|
+
const date = new Date(value);
|
|
166
|
+
if (Number.isNaN(date.getTime())) return "";
|
|
167
|
+
const offsetMs = date.getTimezoneOffset() * 60 * 1e3;
|
|
168
|
+
return new Date(date.getTime() - offsetMs).toISOString().slice(0, 16);
|
|
169
|
+
};
|
|
170
|
+
var fromDateTimeLocalValue = (value) => {
|
|
171
|
+
if (!value) return "";
|
|
172
|
+
return new Date(value).toISOString();
|
|
173
|
+
};
|
|
174
|
+
var LSDatePicker = forwardRef2(
|
|
175
|
+
({ value, onChange, onChangeStart, onChangeEnd, className, ...rest }, ref) => {
|
|
176
|
+
const handleChange = (event) => {
|
|
177
|
+
const nextValue = fromDateTimeLocalValue(event.target.value);
|
|
178
|
+
onChangeStart?.(event, nextValue);
|
|
179
|
+
onChange?.(event, nextValue);
|
|
180
|
+
onChangeEnd?.(event, nextValue);
|
|
181
|
+
};
|
|
182
|
+
return /* @__PURE__ */ jsx2(
|
|
183
|
+
LSInput,
|
|
184
|
+
{
|
|
185
|
+
...rest,
|
|
186
|
+
ref,
|
|
187
|
+
className: ["mui-ls-date-picker", className].filter(Boolean).join(" "),
|
|
188
|
+
type: "datetime-local",
|
|
189
|
+
value: toDateTimeLocalValue(value),
|
|
190
|
+
onChange: handleChange
|
|
191
|
+
}
|
|
192
|
+
);
|
|
193
|
+
}
|
|
194
|
+
);
|
|
195
|
+
LSDatePicker.displayName = "LSDatePicker";
|
|
196
|
+
export {
|
|
197
|
+
LSDatePicker
|
|
198
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
interface FontPickerProps {
|
|
4
|
+
value: string;
|
|
5
|
+
onChange: (value: string) => void;
|
|
6
|
+
fonts?: string[];
|
|
7
|
+
localFonts?: string[];
|
|
8
|
+
onLoadFonts?: (fonts: string[]) => void;
|
|
9
|
+
defaultValue?: string;
|
|
10
|
+
placeholder?: string;
|
|
11
|
+
isAlertManager?: boolean;
|
|
12
|
+
label?: React.ReactNode;
|
|
13
|
+
helperText?: React.ReactNode;
|
|
14
|
+
}
|
|
15
|
+
declare const LSFontPicker: React.NamedExoticComponent<FontPickerProps>;
|
|
16
|
+
|
|
17
|
+
export { LSFontPicker };
|