karsten-design-system 1.2.74 → 1.2.75
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/dist/index.js
CHANGED
|
@@ -644,7 +644,7 @@ const variants$1 = {
|
|
|
644
644
|
green: 'text-green',
|
|
645
645
|
gray: 'text-light-700',
|
|
646
646
|
};
|
|
647
|
-
function Input({ onChange, placeholder, disabled = false, error, icon, onClickIcon, iconColor = 'green', label, mask, ...props }) {
|
|
647
|
+
function Input({ onChange, placeholder, disabled = false, error, icon, onClickIcon, iconColor = 'green', label, mask, isFloat = true, ...props }) {
|
|
648
648
|
const inputId = useId();
|
|
649
649
|
const [inputValue, setInputValue] = useState('');
|
|
650
650
|
const applyMask = (value, mask) => {
|
|
@@ -686,7 +686,7 @@ function Input({ onChange, placeholder, disabled = false, error, icon, onClickIc
|
|
|
686
686
|
? 'text-light-200'
|
|
687
687
|
: variants$1[iconColor]), onClick: onClickIcon }), jsx(InputText, { id: inputId, type: "text", placeholder: placeholder, className: clsx('focus:shadow-none text-base w-100 font-roboto border !p-2 rounded-md text-light-800 dark:bg-dark-100 dark:text-light-500', hasError
|
|
688
688
|
? 'border-redError placeholder:text-redError'
|
|
689
|
-
: 'border-light-700 focus:border-primary dark:focus:border-light-500', disabled && 'border-light-100 text-disabled', error && 'border-redError text-redError', !error && 'border-light-700 placeholder:text-light-700'), onChange: handleChange, disabled: disabled, invalid: hasError, ...props, value: inputValue })] }), jsx(FloatingLabel, { value:
|
|
689
|
+
: 'border-light-700 focus:border-primary dark:focus:border-light-500', disabled && 'border-light-100 text-disabled', error && 'border-redError text-redError', !error && 'border-light-700 placeholder:text-light-700'), onChange: handleChange, disabled: disabled, invalid: hasError, ...props, value: inputValue })] }), isFloat && (jsx(FloatingLabel, { value: inputValue, label: label || '', disabled: disabled, error: error })), hasError && jsx("span", { className: "text-redError text-xs px-2", children: error })] }));
|
|
690
690
|
}
|
|
691
691
|
|
|
692
692
|
function InputSwitch({ checked, onChange, disabled = false, error, ariaLabel = 'Switch', }) {
|
|
@@ -5105,13 +5105,13 @@ function TransferList({ allItems, associated, onChange, className, titleAvailabl
|
|
|
5105
5105
|
const getSpinner = () => {
|
|
5106
5106
|
return (jsx("div", { className: "flex justify-center items-center h-full", children: jsx(Spinner, { size: "lg" }) }));
|
|
5107
5107
|
};
|
|
5108
|
-
return (jsxs("div", { className: clsx('flex flex-col sm:flex-row gap-6 w-full h-full', className), children: [jsxs("div", { className: "flex-1 flex flex-col min-w-0 min-h-0 shadow-container rounded-md text-primary bg-light-500 dark:text-light-500 dark:bg-dark-100 dark:border dark:border-dark-500 dark:shadow-dark-400", children: [jsx("div", { className: "bg-primary rounded-t-lg w-full", children: jsx("span", { className: "block w-full font-bold text-light-500 text-sm uppercase text-center py-3", children: titleAvailable }) }), jsx("div", { className: "mt-2 px-4", children: jsx(Input, { placeholder: searchPlaceholder, value: searchAvailable, onChange: (e) => setSearchAvailable(e), "aria-label": `Filtrar por disponiveis`, maxLength: 50, disabled: isLoading }) }), jsxs("ul", { className: "overflow-auto mt-2 px-4 flex-1 min-h-0 mb-4", style: { maxHeight: '420px', minHeight: '220px' }, children: [(isLoading || loadingAvailable) && (jsx("div", { className: "flex justify-center items-center h-full", children: getSpinner() })), !(isLoading || loadingAvailable) &&
|
|
5108
|
+
return (jsxs("div", { className: clsx('flex flex-col sm:flex-row gap-6 w-full h-full', className), children: [jsxs("div", { className: "flex-1 flex flex-col min-w-0 min-h-0 shadow-container rounded-md text-primary bg-light-500 dark:text-light-500 dark:bg-dark-100 dark:border dark:border-dark-500 dark:shadow-dark-400", children: [jsx("div", { className: "bg-primary rounded-t-lg w-full", children: jsx("span", { className: "block w-full font-bold text-light-500 text-sm uppercase text-center py-3", children: titleAvailable }) }), jsx("div", { className: "mt-2 px-4", children: jsx(Input, { placeholder: searchPlaceholder, value: searchAvailable, onChange: (e) => setSearchAvailable(e), "aria-label": `Filtrar por disponiveis`, maxLength: 50, disabled: isLoading, isFloat: false }) }), jsxs("ul", { className: "overflow-auto mt-2 px-4 flex-1 min-h-0 mb-4", style: { maxHeight: '420px', minHeight: '220px' }, children: [(isLoading || loadingAvailable) && (jsx("div", { className: "flex justify-center items-center h-full", children: getSpinner() })), !(isLoading || loadingAvailable) &&
|
|
5109
5109
|
filteredAvailable.length > 0 &&
|
|
5110
5110
|
filteredAvailable?.map((item) => (jsx("li", { children: jsxs("label", { className: "flex items-center gap-2 cursor-pointer py-1 px-2 rounded hover:bg-light-300 dark:hover:bg-dark-400 min-w-0", children: [jsx("input", { type: 'checkbox', checked: selectedAvailable.includes(item.key), onChange: (e) => {
|
|
5111
5111
|
setSelectedAvailable((prev) => e.target.checked
|
|
5112
5112
|
? [...prev, item.key]
|
|
5113
5113
|
: prev.filter((k) => k !== item.key));
|
|
5114
|
-
}, className: clsx('appearance-none w-3 h-3 shrink-0 align-middle ring-1 ring-offset-2 ring-offset-light-500 ring-light-700 checked:bg-primary cursor-pointer rounded-md dark:bg-dark-100 dark:checked:bg-light-500 dark:checked:border-light-500 dark:ring-offset-dark-100 dark:ring-offset-2'), disabled: isDisabled }), jsx("span", { className: clsx('font-roboto text-primary dark:text-light-500 break-words min-w-0', isDisabled && 'text-light-700 dark:text-dark-400'), style: { wordBreak: 'break-word', minWidth: 0 }, children: item.label })] }) }, item.key)))] })] }), jsxs("div", { className: "flex flex-row justify-center items-center gap-4 md:flex-col md:justify-center md:items-center", children: [jsx(Button, { icon: "pi pi-angle-right", variant: "primary", onClick: moveToAssociated, disabled: selectedAvailable.length === 0, type: "button" }), jsx(Button, { icon: "pi pi-angle-left", variant: "primary", onClick: moveToAvailable, disabled: selectedAssociated.length === 0, type: "button" })] }), jsxs("div", { className: "flex-1 flex flex-col min-w-0 min-h-0 shadow-container rounded-md text-primary bg-light-500 dark:text-light-500 dark:bg-dark-100 dark:border dark:border-dark-500 dark:shadow-dark-400", children: [jsx("div", { className: "bg-primary rounded-t-lg w-full", children: jsx("span", { className: "block w-full font-bold text-light-500 text-sm uppercase text-center py-3", children: titleAssociated }) }), jsx("div", { className: "mt-2 px-4", children: jsx(Input, { placeholder: searchPlaceholder, value: searchAssociated, onChange: (e) => setSearchAssociated(e), "aria-label": `Filtrar por associados`, maxLength: 50, disabled: isLoading }) }), jsxs("ul", { className: "overflow-auto mt-2 px-4 flex-1 min-h-0 mb-4", style: { maxHeight: '420px', minHeight: '220px' }, children: [(isLoading || loadingAssociated) && (jsx("div", { className: "flex justify-center items-center h-full", children: getSpinner() })), !(isLoading || loadingAssociated) &&
|
|
5114
|
+
}, className: clsx('appearance-none w-3 h-3 shrink-0 align-middle ring-1 ring-offset-2 ring-offset-light-500 ring-light-700 checked:bg-primary cursor-pointer rounded-md dark:bg-dark-100 dark:checked:bg-light-500 dark:checked:border-light-500 dark:ring-offset-dark-100 dark:ring-offset-2'), disabled: isDisabled }), jsx("span", { className: clsx('font-roboto text-primary dark:text-light-500 break-words min-w-0', isDisabled && 'text-light-700 dark:text-dark-400'), style: { wordBreak: 'break-word', minWidth: 0 }, children: item.label })] }) }, item.key)))] })] }), jsxs("div", { className: "flex flex-row justify-center items-center gap-4 md:flex-col md:justify-center md:items-center", children: [jsx(Button, { icon: "pi pi-angle-right", variant: "primary", onClick: moveToAssociated, disabled: selectedAvailable.length === 0, type: "button" }), jsx(Button, { icon: "pi pi-angle-left", variant: "primary", onClick: moveToAvailable, disabled: selectedAssociated.length === 0, type: "button" })] }), jsxs("div", { className: "flex-1 flex flex-col min-w-0 min-h-0 shadow-container rounded-md text-primary bg-light-500 dark:text-light-500 dark:bg-dark-100 dark:border dark:border-dark-500 dark:shadow-dark-400", children: [jsx("div", { className: "bg-primary rounded-t-lg w-full", children: jsx("span", { className: "block w-full font-bold text-light-500 text-sm uppercase text-center py-3", children: titleAssociated }) }), jsx("div", { className: "mt-2 px-4", children: jsx(Input, { placeholder: searchPlaceholder, value: searchAssociated, onChange: (e) => setSearchAssociated(e), "aria-label": `Filtrar por associados`, maxLength: 50, disabled: isLoading, isFloat: false }) }), jsxs("ul", { className: "overflow-auto mt-2 px-4 flex-1 min-h-0 mb-4", style: { maxHeight: '420px', minHeight: '220px' }, children: [(isLoading || loadingAssociated) && (jsx("div", { className: "flex justify-center items-center h-full", children: getSpinner() })), !(isLoading || loadingAssociated) &&
|
|
5115
5115
|
filteredAssociated.length > 0 &&
|
|
5116
5116
|
filteredAssociated?.map((item) => (jsx("li", { children: jsxs("label", { className: "flex items-center gap-2 cursor-pointer py-1 px-2 rounded hover:bg-light-300 dark:hover:bg-dark-400 min-w-0", children: [jsx("input", { type: 'checkbox', checked: selectedAssociated.includes(item.key), onChange: (e) => {
|
|
5117
5117
|
setSelectedAssociated((prev) => e.target.checked
|