@pk-design/react-tailwind 1.1.7 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/react-tailwind.cjs.js +68 -62
- package/dist/react-tailwind.cjs.js.map +1 -1
- package/dist/react-tailwind.css +1 -1
- package/dist/react-tailwind.css.map +1 -1
- package/dist/react-tailwind.es.js +68 -62
- package/dist/react-tailwind.es.js.map +1 -1
- package/dist/types/components/Tabs/Tabs.types.d.ts +28 -22
- package/dist/types/index.d.ts +1 -0
- package/package.json +1 -1
|
@@ -161,19 +161,19 @@ TextContent.displayName = 'TextContent';
|
|
|
161
161
|
*/
|
|
162
162
|
const THEMED_BTN_CLASS = {
|
|
163
163
|
primary: {
|
|
164
|
-
default: 'text-white bg-
|
|
165
|
-
outlined: 'text-
|
|
166
|
-
plain: 'text-
|
|
164
|
+
default: 'text-white bg-[var(--ui-primary)] hover:bg-[var(--ui-primary-hover)] focus:outline-[var(--ui-primary-ring)] disabled:bg-[var(--ui-primary-disabled)]',
|
|
165
|
+
outlined: 'text-[var(--ui-primary-text)] hover:text-white border border-[var(--ui-primary)] hover:bg-[var(--ui-primary)] focus:outline-[var(--ui-primary-ring)] disabled:text-[var(--ui-primary-disabled)] disabled:border-[var(--ui-primary-disabled)]',
|
|
166
|
+
plain: 'text-[var(--ui-primary-text)] hover:bg-black/5 dark:hover:bg-gray-700 focus:outline-[var(--ui-primary-ring)] disabled:text-[var(--ui-primary-disabled)]',
|
|
167
167
|
},
|
|
168
168
|
danger: {
|
|
169
|
-
default: 'text-white bg-
|
|
170
|
-
outlined: 'text-
|
|
171
|
-
plain: 'text-
|
|
169
|
+
default: 'text-white bg-[var(--ui-danger)] hover:bg-[var(--ui-danger-hover)] focus:outline-[var(--ui-danger-ring)] disabled:bg-[var(--ui-danger-disabled)]',
|
|
170
|
+
outlined: 'text-[var(--ui-danger-text)] hover:text-white border border-[var(--ui-danger)] hover:bg-[var(--ui-danger)] focus:outline-[var(--ui-danger-ring)] disabled:text-[var(--ui-danger-disabled)] disabled:border-[var(--ui-danger-disabled)]',
|
|
171
|
+
plain: 'text-[var(--ui-danger-text)] hover:bg-black/5 dark:hover:bg-gray-700 focus:outline-[var(--ui-danger-ring)] disabled:text-[var(--ui-danger-disabled)]',
|
|
172
172
|
},
|
|
173
173
|
secondary: {
|
|
174
|
-
default: 'text-gray-700 bg-white border border-gray-300 hover:bg-gray-100 dark:bg-gray-800 dark:text-white dark:border-gray-600 dark:hover:bg-gray-700 dark:hover:border-gray-600 focus:outline-
|
|
175
|
-
outlined: 'text-gray-700 hover:text-white border border-gray-500 hover:bg-gray-700 dark:border-gray-500 dark:text-gray-200 dark:hover:text-white dark:hover:bg-gray-600 focus:outline-
|
|
176
|
-
plain: 'text-gray-700 hover:bg-black/5 dark:text-gray-200 dark:hover:bg-gray-700 focus:outline-
|
|
174
|
+
default: 'text-gray-700 bg-white border border-gray-300 hover:bg-gray-100 dark:bg-gray-800 dark:text-white dark:border-gray-600 dark:hover:bg-gray-700 dark:hover:border-gray-600 focus:outline-[var(--ui-focus-ring)] disabled:bg-gray-200 dark:disabled:bg-gray-700',
|
|
175
|
+
outlined: 'text-gray-700 hover:text-white border border-gray-500 hover:bg-gray-700 dark:border-gray-500 dark:text-gray-200 dark:hover:text-white dark:hover:bg-gray-600 focus:outline-[var(--ui-focus-ring)] disabled:text-gray-400 disabled:border-gray-400',
|
|
176
|
+
plain: 'text-gray-700 hover:bg-black/5 dark:text-gray-200 dark:hover:bg-gray-700 focus:outline-[var(--ui-focus-ring)] disabled:text-gray-400',
|
|
177
177
|
},
|
|
178
178
|
};
|
|
179
179
|
/**
|
|
@@ -236,10 +236,10 @@ const AlertTypeIconMap = {
|
|
|
236
236
|
info: SvgInfo,
|
|
237
237
|
};
|
|
238
238
|
const TypeClassMap = {
|
|
239
|
-
success: 'bg-
|
|
240
|
-
danger: 'bg-
|
|
241
|
-
warning: 'bg-
|
|
242
|
-
info: 'bg-
|
|
239
|
+
success: 'bg-[var(--ui-success-light)] ring-[var(--ui-success-ring-subtle)] text-[var(--ui-success-text)]',
|
|
240
|
+
danger: 'bg-[var(--ui-danger-light)] ring-[var(--ui-danger-ring-subtle)] text-[var(--ui-danger-text)]',
|
|
241
|
+
warning: 'bg-[var(--ui-warning-light)] ring-[var(--ui-warning-ring-subtle)] text-[var(--ui-warning-text)]',
|
|
242
|
+
info: 'bg-[var(--ui-info-light)] ring-[var(--ui-info-ring-subtle)] text-[var(--ui-info-text)]',
|
|
243
243
|
};
|
|
244
244
|
const Alert = (props) => {
|
|
245
245
|
const { type = 'info', className = '', message, children, removable = false, onRemove = () => { }, ...restProps } = props;
|
|
@@ -249,11 +249,11 @@ const Alert = (props) => {
|
|
|
249
249
|
Alert.displayName = 'Alert';
|
|
250
250
|
|
|
251
251
|
const ThemeClassMap = {
|
|
252
|
-
success: 'bg-
|
|
253
|
-
danger: 'bg-
|
|
254
|
-
warning: 'bg-
|
|
255
|
-
info: 'bg-
|
|
256
|
-
secondary: 'bg-gray-50 dark:bg-gray-
|
|
252
|
+
success: 'bg-[var(--ui-success-light)] text-[var(--ui-success-text)] ring-[var(--ui-success-ring-subtle)]',
|
|
253
|
+
danger: 'bg-[var(--ui-danger-light)] text-[var(--ui-danger-text)] ring-[var(--ui-danger-ring-subtle)]',
|
|
254
|
+
warning: 'bg-[var(--ui-warning-light)] text-[var(--ui-warning-text)] ring-[var(--ui-warning-ring-subtle)]',
|
|
255
|
+
info: 'bg-[var(--ui-info-light)] text-[var(--ui-info-text)] ring-[var(--ui-info-ring-subtle)]',
|
|
256
|
+
secondary: 'bg-gray-50 dark:bg-gray-700 text-gray-700 dark:text-gray-200 ring-[var(--ui-secondary-ring-subtle)]',
|
|
257
257
|
};
|
|
258
258
|
const Badge = React.forwardRef((props, ref) => {
|
|
259
259
|
const { theme = 'info', className = '', children, removable = false, rounded = false, onRemove = () => { }, ...restProps } = props;
|
|
@@ -395,7 +395,7 @@ const Checkbox = React.forwardRef((props, ref) => {
|
|
|
395
395
|
...rest } = props;
|
|
396
396
|
const generatedId = React.useId();
|
|
397
397
|
const checkboxId = (_a = id !== null && id !== void 0 ? id : name) !== null && _a !== void 0 ? _a : generatedId;
|
|
398
|
-
return (jsxRuntime.jsxs("div", { className: buildClassName(wrapperClass), children: [jsxRuntime.jsxs("div", { className: buildClassName('flex items-center', containerClass), children: [jsxRuntime.jsxs("label", { htmlFor: checkboxId, className: buildClassName('inline-flex items-center relative select-none', disabled ? 'cursor-not-allowed opacity-70' : 'cursor-pointer'), children: [jsxRuntime.jsx("input", { ref: ref, ...rest, id: checkboxId, name: name, type: "checkbox", disabled: disabled, "aria-checked": rest.checked, className: buildClassName('peer size-4.5 cursor-pointer transition-all appearance-none rounded', 'border focus:ring-2 focus:ring-offset-2', 'checked:bg-
|
|
398
|
+
return (jsxRuntime.jsxs("div", { className: buildClassName(wrapperClass), children: [jsxRuntime.jsxs("div", { className: buildClassName('flex items-center', containerClass), children: [jsxRuntime.jsxs("label", { htmlFor: checkboxId, className: buildClassName('inline-flex items-center relative select-none', disabled ? 'cursor-not-allowed opacity-70' : 'cursor-pointer'), children: [jsxRuntime.jsx("input", { ref: ref, ...rest, id: checkboxId, name: name, type: "checkbox", disabled: disabled, "aria-checked": rest.checked, className: buildClassName('peer size-4.5 cursor-pointer transition-all appearance-none rounded', 'border focus:ring-2 focus:ring-offset-2', 'checked:bg-[var(--ui-primary)] checked:border-[var(--ui-primary)]', 'focus:ring-[var(--ui-focus-ring)] dark:focus:ring-offset-gray-900', disabled
|
|
399
399
|
? 'border-gray-200 dark:border-gray-700 bg-gray-100 dark:bg-gray-800 pointer-events-none'
|
|
400
400
|
: 'bg-white dark:bg-gray-700 border-gray-300 dark:border-gray-600 hover:border-gray-400 dark:hover:border-gray-500 hover:shadow-md', className) }), jsxRuntime.jsx("span", { className: "absolute text-white opacity-0 peer-checked:opacity-100 \n top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2", children: jsxRuntime.jsx("svg", { xmlns: "http://www.w3.org/2000/svg", className: "h-3.25 w-3.25", viewBox: "0 0 20 20", fill: "currentColor", stroke: "currentColor", strokeWidth: "1", children: jsxRuntime.jsx("path", { fillRule: "evenodd", d: "M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z", clipRule: "evenodd" }) }) })] }), label && (jsxRuntime.jsx(Label, { htmlFor: checkboxId, className: buildClassName(disabled
|
|
401
401
|
? 'cursor-not-allowed text-gray-400 dark:text-gray-500'
|
|
@@ -867,8 +867,8 @@ function buildInputClass(className, { isFocusWithin = false, disabled = false }
|
|
|
867
867
|
return buildClassName('transition-all', 'block w-full rounded-lg bg-white px-3.5 py-2 text-base sm:text-sm/6', 'text-gray-900 outline outline-1 -outline-offset-1', 'outline-gray-300 dark:outline-gray-600', 'invalid:group-[.has-error]:outline-red-500', disabled
|
|
868
868
|
? 'pointer-events-none bg-gray-100 dark:bg-gray-800 dark:text-gray-600 dark:placeholder-gray-600 placeholder-gray-400 outline-gray-200 dark:outline-gray-700'
|
|
869
869
|
: 'bg-white dark:bg-gray-700 dark:text-white outline-gray-300 dark:outline-gray-600 dark:placeholder-gray-400 placeholder-gray-400', isFocusWithin
|
|
870
|
-
? 'focus-within:outline-
|
|
871
|
-
: 'focus:outline-
|
|
870
|
+
? 'focus-within:outline-[var(--ui-focus-ring)] focus-within:outline-2 focus-within:-outline-offset-2'
|
|
871
|
+
: 'focus:outline-[var(--ui-focus-ring)] focus:outline-2 focus:-outline-offset-2', className);
|
|
872
872
|
}
|
|
873
873
|
const Input = React.forwardRef((props, ref) => {
|
|
874
874
|
const { name, id = name, type, label, labelHint, className, labelClass, labelWrapperClass, containerClass, error, showErrorMessage = true, rightGroup, leftGroup, ...inputProps } = props;
|
|
@@ -894,9 +894,9 @@ const Radio = React.forwardRef((props, ref) => {
|
|
|
894
894
|
...rest } = props;
|
|
895
895
|
const generatedId = React.useId();
|
|
896
896
|
const radioId = (_a = id !== null && id !== void 0 ? id : name) !== null && _a !== void 0 ? _a : generatedId;
|
|
897
|
-
return (jsxRuntime.jsxs("div", { className: buildClassName(wrapperClass), children: [jsxRuntime.jsxs("div", { className: buildClassName('flex items-center gap-2', containerClass), children: [jsxRuntime.jsx("div", { className: "grid place-items-center", children: jsxRuntime.jsx("input", { ref: ref, ...rest, id: radioId, name: name, type: "radio", disabled: disabled, "aria-checked": rest.checked, className: buildClassName('peer transition-all col-start-1 row-start-1 appearance-none shrink-0 size-4.5 rounded-full', 'border focus:ring-2 focus:ring-offset-2', 'checked:border-5 checked:bg-white', 'focus:ring-
|
|
897
|
+
return (jsxRuntime.jsxs("div", { className: buildClassName(wrapperClass), children: [jsxRuntime.jsxs("div", { className: buildClassName('flex items-center gap-2', containerClass), children: [jsxRuntime.jsx("div", { className: "grid place-items-center", children: jsxRuntime.jsx("input", { ref: ref, ...rest, id: radioId, name: name, type: "radio", disabled: disabled, "aria-checked": rest.checked, className: buildClassName('peer transition-all col-start-1 row-start-1 appearance-none shrink-0 size-4.5 rounded-full', 'border focus:ring-2 focus:ring-offset-2', 'checked:border-5 checked:bg-white', 'focus:ring-[var(--ui-focus-ring)] dark:focus:ring-offset-gray-800', disabled
|
|
898
898
|
? 'border-gray-200 dark:border-gray-700 bg-gray-100 dark:bg-gray-800 pointer-events-none'
|
|
899
|
-
: buildClassName('bg-white dark:bg-gray-700 border-gray-300 dark:border-gray-600 hover:border-gray-400 dark:hover:border-gray-500', 'checked:border-
|
|
899
|
+
: buildClassName('bg-white dark:bg-gray-700 border-gray-300 dark:border-gray-600 hover:border-gray-400 dark:hover:border-gray-500', 'checked:border-[var(--ui-primary)] checked:hover:border-[var(--ui-primary)]'), className) }) }), label && (jsxRuntime.jsx(Label, { htmlFor: radioId, className: buildClassName(disabled
|
|
900
900
|
? 'cursor-not-allowed text-gray-400 dark:text-gray-500'
|
|
901
901
|
: 'cursor-pointer text-gray-600 dark:text-gray-300', labelClass), children: label }))] }), error && (jsxRuntime.jsx("div", { className: "mt-1", children: jsxRuntime.jsx(TextContent, { error: true, small: true, children: error }) }))] }));
|
|
902
902
|
});
|
|
@@ -1302,35 +1302,48 @@ const SelectBox = React.forwardRef((props, forwardedRef) => {
|
|
|
1302
1302
|
}, "data-testid": "combobox-input" }), jsxRuntime.jsx(react.ComboboxButton, { className: "group absolute inset-y-0 right-0 px-2.5", "data-testid": "combobox-button", children: jsxRuntime.jsx(SvgChevronDown, { className: chevronIconClass }) })] })) : (jsxRuntime.jsxs("div", { className: "relative", ref: forwardedRef, children: [jsxRuntime.jsx(react.ComboboxInput, { "aria-label": name, displayValue: (option) => (option ? getDisplayValue(option) : null), autoComplete: "off", placeholder: placeholder, onChange: (event) => setQuery(event.target.value), className: inputClass, disabled: disabled, id: id, readOnly: !searchable, ref: inputRef, "data-testid": "combobox-input" }), allowClear && !isEmpty(selected) && (jsxRuntime.jsx(Button, { size: "xs", iconOnly: true, "aria-label": "Clear selection", theme: "secondary", variant: "plain", className: "group absolute inset-y-0 right-8 h-6 top-2", onClick: () => handleOnChangeInternal(multiple ? [] : null), disabled: disabled, "data-testid": "combobox-clear-button", noOutlineOnFocus: true, children: jsxRuntime.jsx(SvgX, { className: "size-4 stroke-gray-500" }) })), jsxRuntime.jsx(react.ComboboxButton, { className: "group absolute inset-y-0 right-0 px-2.5", "data-testid": "combobox-button", children: jsxRuntime.jsx(SvgChevronDown, { className: chevronIconClass }) })] })), jsxRuntime.jsx(react.ComboboxOptions, { anchor: { to: 'bottom', gap: 5 }, as: "div", className: buildClassName('w-[var(--input-width)] rounded-lg border border-gray-200 dark:border-white/5 bg-white dark:bg-gray-800 p-1 [--anchor-gap:var(--spacing-1)]', '[--anchor-max-height:20rem]', 'origin-top border transition duration-200 ease-[cubic-bezier(0.4, 0.0, 0.2, 1)] data-[closed]:translate-y-[-15%] data-[closed]:opacity-0', dropdownContainerClass), transition: true, "data-testid": "combobox-options", children: optionsLoading ? (jsxRuntime.jsx("div", { "data-testid": "options-loading", className: "flex items-center justify-center py-2 px-3 select-none", children: jsxRuntime.jsx(Loader, { size: "sm" }) })) : shouldShowTypeToSearch ? (jsxRuntime.jsx("div", { className: "flex items-center justify-between py-2 px-3 select-none", children: "Type to search..." })) : (jsxRuntime.jsxs("div", { children: [filteredOptions.map((option) => (jsxRuntime.jsx(react.ComboboxOption, { disabled: option.disabled, value: option, className: "group rounded-lg py-1.5 px-3 select-none data-[focus]:bg-black/3 dark:data-[focus]:bg-white/10 data-disabled:opacity-50 cursor-pointer data-disabled:pointer-events-none", children: jsxRuntime.jsxs("div", { className: "flex items-center justify-between gap-2 dark:text-white group-data-[selected]:text-blue-600", children: [jsxRuntime.jsx("span", { className: "text-sm/6", children: getDisplayValue(option) }), jsxRuntime.jsx(SvgCheck, { className: "invisible size-5 dark:stroke-gray-300 group-data-[selected]:visible" })] }) }, getValue(option)))), filteredOptions.length === 0 && query && !optionsLoading && (jsxRuntime.jsxs("div", { "data-testid": "no-result-found", className: "flex items-center gap-2 py-1.5 px-3 select-none text-gray-500 dark:text-gray-400", children: ["No results found for ", jsxRuntime.jsx("span", { className: "font-semibold", children: query })] })), allowAdd && (jsxRuntime.jsx(react.ComboboxOption, { value: query, className: "group rounded-lg py-1.5 px-3 cursor-pointer text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-700", onClick: () => void handleAddAndSelect(query), children: jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [jsxRuntime.jsx(SvgCirclePlus, { className: "size-4.5" }), jsxRuntime.jsxs(TextContent, { children: [addNewText, " \"", query, "\""] })] }) }))] })) })] }), showErrorMessage && error && (jsxRuntime.jsx("div", { className: "mt-1", children: jsxRuntime.jsx(TextContent, { error: true, small: true, children: error }) }))] }));
|
|
1303
1303
|
});
|
|
1304
1304
|
|
|
1305
|
-
const Tabs = ({ tabs, defaultIndex = 0, variant = 'underline', className = '', listClass = '',
|
|
1306
|
-
|
|
1305
|
+
const Tabs = ({ tabs, defaultIndex = 0, selectedIndex, onChange, variant = 'underline', orientation = 'horizontal', stretch = false, className = '', listClass = '', panelsClass = '', }) => {
|
|
1306
|
+
const isVertical = orientation === 'vertical';
|
|
1307
|
+
return (jsxRuntime.jsxs(react.TabGroup, { defaultIndex: defaultIndex, selectedIndex: selectedIndex, onChange: onChange, vertical: isVertical, className: buildClassName(isVertical && 'flex gap-4', stretch && !isVertical && 'w-full', className), children: [jsxRuntime.jsx(react.TabList, { className: buildClassName(isVertical ? 'flex flex-col gap-1' : 'flex gap-2', stretch && !isVertical && 'w-full', listClass), children: tabs.map((tab, idx) => {
|
|
1308
|
+
var _a;
|
|
1309
|
+
return (jsxRuntime.jsx(react.Tab, { disabled: tab.disabled, as: React.Fragment, children: ({ selected }) => (jsxRuntime.jsxs("button", { disabled: tab.disabled, className: buildTabClass({
|
|
1310
|
+
selected,
|
|
1311
|
+
variant,
|
|
1312
|
+
stretch,
|
|
1313
|
+
isVertical,
|
|
1314
|
+
tabClass: tab.tabClass,
|
|
1315
|
+
}), children: [tab.icon && jsxRuntime.jsx("span", { className: "inline-flex shrink-0", children: tab.icon }), tab.label] })) }, (_a = tab.id) !== null && _a !== void 0 ? _a : idx));
|
|
1316
|
+
}) }), jsxRuntime.jsx(react.TabPanels, { className: buildClassName(isVertical ? 'flex-1' : 'mt-3', panelsClass), children: tabs.map((tab, idx) => {
|
|
1317
|
+
var _a;
|
|
1318
|
+
return (jsxRuntime.jsx(react.TabPanel, { className: tab.panelClass !== undefined
|
|
1319
|
+
? tab.panelClass
|
|
1320
|
+
: 'rounded-lg bg-white dark:bg-gray-800 p-4 shadow-sm', children: tab.content }, (_a = tab.id) !== null && _a !== void 0 ? _a : idx));
|
|
1321
|
+
}) })] }));
|
|
1307
1322
|
};
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
function buildTabClass({ selected, variant, }) {
|
|
1323
|
+
function buildTabClass({ selected, variant, stretch, isVertical, tabClass, }) {
|
|
1324
|
+
const base = buildClassName('inline-flex items-center gap-1.5 text-sm font-medium transition focus-visible:outline-none', 'disabled:opacity-40 disabled:cursor-not-allowed disabled:pointer-events-none', stretch && !isVertical && 'flex-1 justify-center');
|
|
1325
|
+
let variantClass;
|
|
1312
1326
|
switch (variant) {
|
|
1313
|
-
/**
|
|
1314
|
-
* UNDERLINE (Default)
|
|
1315
|
-
*/
|
|
1316
1327
|
case 'underline':
|
|
1317
|
-
|
|
1318
|
-
'
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1328
|
+
variantClass = isVertical
|
|
1329
|
+
? buildClassName('px-3 py-2 w-full text-left border-l-2', selected
|
|
1330
|
+
? 'border-[var(--ui-primary)] text-gray-900 dark:text-white'
|
|
1331
|
+
: 'border-transparent text-gray-600 dark:text-gray-300 hover:text-gray-900 dark:hover:text-white hover:border-gray-300 dark:hover:border-gray-600')
|
|
1332
|
+
: buildClassName('px-3 py-1.5 relative text-gray-600 dark:text-gray-300 hover:text-gray-900 dark:hover:text-white', selected &&
|
|
1333
|
+
'text-gray-900 dark:text-white after:absolute after:z-10 after:left-0 after:right-0 after:-bottom-1 after:h-0.5 after:bg-[var(--ui-primary)]');
|
|
1334
|
+
break;
|
|
1322
1335
|
case 'segmented':
|
|
1323
|
-
|
|
1324
|
-
? 'bg-
|
|
1336
|
+
variantClass = buildClassName('px-3 py-1.5 rounded-lg', selected
|
|
1337
|
+
? 'bg-[var(--ui-primary)] text-white'
|
|
1325
1338
|
: 'text-gray-600 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-700');
|
|
1326
|
-
|
|
1327
|
-
* SOLID
|
|
1328
|
-
*/
|
|
1339
|
+
break;
|
|
1329
1340
|
case 'solid':
|
|
1330
|
-
|
|
1341
|
+
variantClass = buildClassName('px-3 py-1.5 rounded-md', selected
|
|
1331
1342
|
? 'bg-gray-900 dark:bg-gray-700 text-white'
|
|
1332
1343
|
: 'bg-gray-200 dark:bg-gray-800 text-gray-700 dark:text-gray-300 hover:bg-gray-300 dark:hover:bg-gray-700');
|
|
1344
|
+
break;
|
|
1333
1345
|
}
|
|
1346
|
+
return buildClassName(base, variantClass, tabClass);
|
|
1334
1347
|
}
|
|
1335
1348
|
|
|
1336
1349
|
const Textarea = React.forwardRef((props, ref) => {
|
|
@@ -1345,29 +1358,22 @@ const Textarea = React.forwardRef((props, ref) => {
|
|
|
1345
1358
|
* Icons for each toast type
|
|
1346
1359
|
*/
|
|
1347
1360
|
const iconMap = {
|
|
1348
|
-
success: jsxRuntime.jsx(SvgCircleCheck, { className: "size-5 text-
|
|
1349
|
-
error: jsxRuntime.jsx(SvgCircleAlert, { className: "size-5 text-
|
|
1350
|
-
info: jsxRuntime.jsx(SvgInfo, { className: "size-5 text-
|
|
1351
|
-
warning: jsxRuntime.jsx(SvgTriangleAlert, { className: "size-5 text-
|
|
1361
|
+
success: jsxRuntime.jsx(SvgCircleCheck, { className: "size-5 text-[var(--ui-success)]" }),
|
|
1362
|
+
error: jsxRuntime.jsx(SvgCircleAlert, { className: "size-5 text-[var(--ui-danger)]" }),
|
|
1363
|
+
info: jsxRuntime.jsx(SvgInfo, { className: "size-5 text-[var(--ui-info)]" }),
|
|
1364
|
+
warning: jsxRuntime.jsx(SvgTriangleAlert, { className: "size-5 text-[var(--ui-warning)]" }),
|
|
1352
1365
|
};
|
|
1353
|
-
/**
|
|
1354
|
-
* Subtle icon + text color adjustments
|
|
1355
|
-
*/
|
|
1356
1366
|
const textColorMap = {
|
|
1357
|
-
success: 'text-
|
|
1358
|
-
error: 'text-
|
|
1359
|
-
info: 'text-
|
|
1360
|
-
warning: 'text-
|
|
1367
|
+
success: 'text-[var(--ui-success-text)]',
|
|
1368
|
+
error: 'text-[var(--ui-danger-text)]',
|
|
1369
|
+
info: 'text-[var(--ui-info-text)]',
|
|
1370
|
+
warning: 'text-[var(--ui-warning-text)]',
|
|
1361
1371
|
};
|
|
1362
|
-
/**
|
|
1363
|
-
* Pleasant colored *top border only*
|
|
1364
|
-
* No background color — soft neutral surface
|
|
1365
|
-
*/
|
|
1366
1372
|
const borderStyle = {
|
|
1367
|
-
success: 'border-t-4 border-
|
|
1368
|
-
error: 'border-t-4 border-
|
|
1369
|
-
info: 'border-t-4 border-
|
|
1370
|
-
warning: 'border-t-4 border-
|
|
1373
|
+
success: 'border-t-4 border-[var(--ui-success)]',
|
|
1374
|
+
error: 'border-t-4 border-[var(--ui-danger)]',
|
|
1375
|
+
info: 'border-t-4 border-[var(--ui-info)]',
|
|
1376
|
+
warning: 'border-t-4 border-[var(--ui-warning)]',
|
|
1371
1377
|
};
|
|
1372
1378
|
const Toast = ({ message, type, onClose, className, id, isTop = true, }) => {
|
|
1373
1379
|
const enterFrom = isTop ? 'opacity-0 -translate-y-3 scale-95' : 'opacity-0 translate-y-3 scale-95';
|