@lindle/linoardo 1.0.42 → 1.0.44
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/{ExpansionPanelItem-CEhDj2Uw.d.cts → ExpansionPanelItem-B9srsYMI.d.cts} +0 -1
- package/dist/{ExpansionPanelItem-C4-2nlhq.d.ts → ExpansionPanelItem-DYcbxZnv.d.ts} +0 -1
- package/dist/chunk-F3PI7A6V.js +200 -0
- package/dist/chunk-F3PI7A6V.js.map +1 -0
- package/dist/chunk-FJNKMRYQ.js +85 -0
- package/dist/chunk-FJNKMRYQ.js.map +1 -0
- package/dist/{chunk-KRYWWWXR.js → chunk-RG5FCFLX.js} +25 -52
- package/dist/chunk-RG5FCFLX.js.map +1 -0
- package/dist/expansion-panel/item.cjs +22 -49
- package/dist/expansion-panel/item.cjs.map +1 -1
- package/dist/expansion-panel/item.d.cts +1 -1
- package/dist/expansion-panel/item.d.ts +1 -1
- package/dist/expansion-panel/item.js +1 -1
- package/dist/expansion-panel.cjs +37 -109
- package/dist/expansion-panel.cjs.map +1 -1
- package/dist/expansion-panel.d.cts +8 -5
- package/dist/expansion-panel.d.ts +8 -5
- package/dist/expansion-panel.js +2 -2
- package/dist/index.cjs +276 -216
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +23 -3
- package/dist/index.d.ts +23 -3
- package/dist/index.js +123 -13
- package/dist/index.js.map +1 -1
- package/dist/select.cjs +128 -105
- package/dist/select.cjs.map +1 -1
- package/dist/select.d.cts +1 -0
- package/dist/select.d.ts +1 -0
- package/dist/select.js +1 -1
- package/dist/styles.css +72 -11
- package/package.json +3 -2
- package/dist/chunk-HBF4S2KY.js +0 -131
- package/dist/chunk-HBF4S2KY.js.map +0 -1
- package/dist/chunk-KRYWWWXR.js.map +0 -1
- package/dist/chunk-LULQOD2K.js +0 -177
- package/dist/chunk-LULQOD2K.js.map +0 -1
package/dist/expansion-panel.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { ExpansionPanel_default as default } from './chunk-
|
|
2
|
-
export { ExpansionPanelItem_default as ExpansionPanelItem } from './chunk-
|
|
1
|
+
export { ExpansionPanel_default as default } from './chunk-FJNKMRYQ.js';
|
|
2
|
+
export { ExpansionPanelItem_default as ExpansionPanelItem } from './chunk-RG5FCFLX.js';
|
|
3
3
|
//# sourceMappingURL=expansion-panel.js.map
|
|
4
4
|
//# sourceMappingURL=expansion-panel.js.map
|
package/dist/index.cjs
CHANGED
|
@@ -1091,31 +1091,17 @@ var ExpansionPanelItemInner = (props) => {
|
|
|
1091
1091
|
__expansionPanelContext,
|
|
1092
1092
|
...rest
|
|
1093
1093
|
} = props;
|
|
1094
|
-
const [standaloneExpanded, setStandaloneExpanded] = React4.useState(false);
|
|
1095
|
-
const generatedValueRef = React4.useRef(null);
|
|
1096
|
-
if (generatedValueRef.current === null) {
|
|
1097
|
-
generatedValueRef.current = generateId("expansion-panel-value");
|
|
1098
|
-
}
|
|
1099
|
-
const generatedValue = generatedValueRef.current;
|
|
1100
|
-
const headerIdRef = React4.useRef(null);
|
|
1101
|
-
if (!headerIdRef.current) {
|
|
1102
|
-
headerIdRef.current = generateId("expansion-panel-header");
|
|
1103
|
-
}
|
|
1104
|
-
const headerId = headerIdRef.current;
|
|
1105
|
-
const contentIdRef = React4.useRef(null);
|
|
1106
|
-
if (!contentIdRef.current) {
|
|
1107
|
-
contentIdRef.current = generateId("expansion-panel-content");
|
|
1108
|
-
}
|
|
1109
|
-
const contentId = contentIdRef.current;
|
|
1110
1094
|
const context = __expansionPanelContext ?? null;
|
|
1111
|
-
const
|
|
1095
|
+
const safeValue = typeof value === "string" || typeof value === "number" ? String(value) : null;
|
|
1096
|
+
const idBase = safeValue ?? generateId("expansion-panel");
|
|
1097
|
+
const inputId = `expansion-panel-toggle-${idBase}`;
|
|
1112
1098
|
const density = context?.density ?? "default";
|
|
1113
1099
|
const color = colorOverride ?? context?.color ?? "primary";
|
|
1114
1100
|
const divider = context?.divider ?? true;
|
|
1115
1101
|
const variant = context?.variant ?? "elevated";
|
|
1116
1102
|
const rounded = context?.rounded ?? "lg";
|
|
1117
1103
|
const accent = accentClasses2[color] ?? accentClasses2.primary;
|
|
1118
|
-
const isExpanded =
|
|
1104
|
+
const isExpanded = value !== null && value !== void 0 ? context?.expandedValues.includes(value) ?? false : false;
|
|
1119
1105
|
const rootSurface = divider ? "bg-transparent border-0 shadow-none" : itemVariantClasses[variant];
|
|
1120
1106
|
const shapeClass = divider ? void 0 : roundedClasses[rounded] ?? roundedClasses.lg;
|
|
1121
1107
|
const densityPadding = densityClasses2[density] ?? densityClasses2.default;
|
|
@@ -1133,30 +1119,19 @@ var ExpansionPanelItemInner = (props) => {
|
|
|
1133
1119
|
}
|
|
1134
1120
|
);
|
|
1135
1121
|
const hasContent = Boolean(children ?? text);
|
|
1136
|
-
const contentAnimationClass = isExpanded ? "pb-5 opacity-100" : "pb-0 opacity-0";
|
|
1137
1122
|
const toggleIconNode = hideToggleIcon ? null : isExpanded && collapseIcon ? collapseIcon : expandIcon ?? defaultToggleIcon;
|
|
1138
1123
|
const shouldRotateDefaultIcon = !expandIcon && !collapseIcon && !hideToggleIcon;
|
|
1139
1124
|
const toggleWrapperClass = tailwindMerge.twMerge(
|
|
1140
|
-
"ml-3 flex h-6 w-6 items-center justify-center text-gray-500 transition-transform duration-200",
|
|
1125
|
+
"expansion-panel-item__icon ml-3 flex h-6 w-6 items-center justify-center text-gray-500 transition-transform duration-200",
|
|
1141
1126
|
shouldRotateDefaultIcon && isExpanded ? "rotate-180" : void 0
|
|
1142
1127
|
);
|
|
1143
|
-
const handleToggle = () => {
|
|
1144
|
-
if (disabled) {
|
|
1145
|
-
return;
|
|
1146
|
-
}
|
|
1147
|
-
if (context) {
|
|
1148
|
-
context.toggle(panelValue, disabled);
|
|
1149
|
-
return;
|
|
1150
|
-
}
|
|
1151
|
-
setStandaloneExpanded((prev) => !prev);
|
|
1152
|
-
};
|
|
1153
1128
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1154
1129
|
"div",
|
|
1155
1130
|
{
|
|
1156
1131
|
...rest,
|
|
1157
1132
|
ref: forwardedRef,
|
|
1158
1133
|
className: tailwindMerge.twMerge(
|
|
1159
|
-
"expansion-panel-item flex flex-col overflow-hidden transition-colors duration-200",
|
|
1134
|
+
"expansion-panel-item group flex flex-col overflow-hidden transition-colors duration-200",
|
|
1160
1135
|
rootSurface,
|
|
1161
1136
|
shapeClass,
|
|
1162
1137
|
className
|
|
@@ -1164,22 +1139,28 @@ var ExpansionPanelItemInner = (props) => {
|
|
|
1164
1139
|
"data-state": isExpanded ? "open" : "closed",
|
|
1165
1140
|
"data-disabled": disabled || void 0,
|
|
1166
1141
|
children: [
|
|
1142
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1143
|
+
"input",
|
|
1144
|
+
{
|
|
1145
|
+
id: inputId,
|
|
1146
|
+
type: "checkbox",
|
|
1147
|
+
className: "expansion-panel-item__toggle",
|
|
1148
|
+
defaultChecked: isExpanded,
|
|
1149
|
+
disabled
|
|
1150
|
+
}
|
|
1151
|
+
),
|
|
1167
1152
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
1168
|
-
"
|
|
1153
|
+
"label",
|
|
1169
1154
|
{
|
|
1170
|
-
|
|
1171
|
-
id: headerId,
|
|
1172
|
-
onClick: handleToggle,
|
|
1173
|
-
disabled,
|
|
1174
|
-
"aria-expanded": isExpanded,
|
|
1175
|
-
"aria-controls": hasContent ? contentId : void 0,
|
|
1155
|
+
htmlFor: inputId,
|
|
1176
1156
|
className: tailwindMerge.twMerge(
|
|
1177
|
-
"flex w-full items-center gap-4 px-4 text-left
|
|
1157
|
+
"expansion-panel-item__header flex w-full list-none items-center gap-4 px-4 text-left",
|
|
1178
1158
|
densityPadding,
|
|
1179
1159
|
disabledClass,
|
|
1180
1160
|
isExpanded ? accent.bg : void 0,
|
|
1181
1161
|
headerClassName
|
|
1182
1162
|
),
|
|
1163
|
+
"aria-disabled": disabled || void 0,
|
|
1183
1164
|
"data-state": isExpanded ? "open" : "closed",
|
|
1184
1165
|
children: [
|
|
1185
1166
|
prepend && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex h-10 w-10 items-center justify-center text-gray-500", children: prepend }),
|
|
@@ -1195,22 +1176,14 @@ var ExpansionPanelItemInner = (props) => {
|
|
|
1195
1176
|
hasContent && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1196
1177
|
"div",
|
|
1197
1178
|
{
|
|
1198
|
-
className: "
|
|
1199
|
-
style: { gridTemplateRows: isExpanded ? "1fr" : "0fr" },
|
|
1200
|
-
"aria-hidden": isExpanded ? void 0 : true,
|
|
1179
|
+
className: "expansion-panel-item__content overflow-hidden border-t border-gray-100",
|
|
1201
1180
|
"data-state": isExpanded ? "open" : "closed",
|
|
1202
1181
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1203
1182
|
"div",
|
|
1204
1183
|
{
|
|
1205
|
-
id: contentId,
|
|
1206
|
-
role: "region",
|
|
1207
|
-
"aria-labelledby": headerId,
|
|
1208
|
-
"data-state": isExpanded ? "open" : "closed",
|
|
1209
1184
|
className: tailwindMerge.twMerge(
|
|
1210
|
-
"min-h-0 px-4 pt-0 text-sm text-gray-600
|
|
1185
|
+
"expansion-panel-item__body min-h-0 px-4 pt-0 text-sm text-gray-600",
|
|
1211
1186
|
activeBorderClass,
|
|
1212
|
-
contentAnimationClass,
|
|
1213
|
-
isExpanded ? "pointer-events-auto" : "pointer-events-none",
|
|
1214
1187
|
contentClassName
|
|
1215
1188
|
),
|
|
1216
1189
|
children: children ?? text
|
|
@@ -1250,7 +1223,6 @@ var normalizeValues = (value, allowMultiple) => {
|
|
|
1250
1223
|
}
|
|
1251
1224
|
return normalized.length ? [normalized[0]] : [];
|
|
1252
1225
|
};
|
|
1253
|
-
var clampValues = (values, allowMultiple) => allowMultiple ? uniqueValues(values) : values.length ? [values[0]] : [];
|
|
1254
1226
|
var ExpansionPanelInner = (props, forwardedRef) => {
|
|
1255
1227
|
const {
|
|
1256
1228
|
variant = "elevated",
|
|
@@ -1267,64 +1239,16 @@ var ExpansionPanelInner = (props, forwardedRef) => {
|
|
|
1267
1239
|
...rest
|
|
1268
1240
|
} = props;
|
|
1269
1241
|
const allowMultiple = multiple ?? false;
|
|
1270
|
-
const
|
|
1271
|
-
const
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
setInternalValues((prev) => clampValues(prev, allowMultiple));
|
|
1281
|
-
}
|
|
1282
|
-
prevAllowMultipleRef.current = allowMultiple;
|
|
1283
|
-
prevIsControlledRef.current = isControlled;
|
|
1284
|
-
}, [allowMultiple, isControlled]);
|
|
1285
|
-
const handleValueChange = React4.useCallback(
|
|
1286
|
-
(next) => {
|
|
1287
|
-
if (!isControlled) {
|
|
1288
|
-
setInternalValues(next);
|
|
1289
|
-
}
|
|
1290
|
-
if (onChange) {
|
|
1291
|
-
if (allowMultiple) {
|
|
1292
|
-
onChange(next);
|
|
1293
|
-
} else {
|
|
1294
|
-
onChange(next[0] ?? null);
|
|
1295
|
-
}
|
|
1296
|
-
}
|
|
1297
|
-
},
|
|
1298
|
-
[allowMultiple, isControlled, onChange]
|
|
1299
|
-
);
|
|
1300
|
-
const handleToggle = React4.useCallback(
|
|
1301
|
-
(panelValue, disabled) => {
|
|
1302
|
-
if (disabled) {
|
|
1303
|
-
return;
|
|
1304
|
-
}
|
|
1305
|
-
const expandedValues2 = isControlled ? normalizeValues(value, allowMultiple) : internalValues;
|
|
1306
|
-
const isActive = expandedValues2.includes(panelValue);
|
|
1307
|
-
const next = allowMultiple ? isActive ? expandedValues2.filter((v) => v !== panelValue) : [...expandedValues2, panelValue] : isActive ? [] : [panelValue];
|
|
1308
|
-
handleValueChange(next);
|
|
1309
|
-
},
|
|
1310
|
-
[allowMultiple, handleValueChange, internalValues, isControlled, value]
|
|
1311
|
-
);
|
|
1312
|
-
const expandedValues = React4.useMemo(
|
|
1313
|
-
() => isControlled ? normalizeValues(value, allowMultiple) : internalValues,
|
|
1314
|
-
[allowMultiple, internalValues, isControlled, value]
|
|
1315
|
-
);
|
|
1316
|
-
const providerValue = React4.useMemo(
|
|
1317
|
-
() => ({
|
|
1318
|
-
expandedValues,
|
|
1319
|
-
toggle: handleToggle,
|
|
1320
|
-
density,
|
|
1321
|
-
color,
|
|
1322
|
-
divider,
|
|
1323
|
-
rounded,
|
|
1324
|
-
variant
|
|
1325
|
-
}),
|
|
1326
|
-
[color, density, divider, expandedValues, handleToggle, rounded, variant]
|
|
1327
|
-
);
|
|
1242
|
+
const resolvedValue = value !== void 0 ? value : defaultValue;
|
|
1243
|
+
const expandedValues = normalizeValues(resolvedValue, allowMultiple);
|
|
1244
|
+
const providerValue = {
|
|
1245
|
+
expandedValues,
|
|
1246
|
+
density,
|
|
1247
|
+
color,
|
|
1248
|
+
divider,
|
|
1249
|
+
rounded,
|
|
1250
|
+
variant
|
|
1251
|
+
};
|
|
1328
1252
|
const variantClass = divider ? variantContainerClasses[variant] : "bg-transparent border border-transparent shadow-none";
|
|
1329
1253
|
const shapeClass = roundedClasses2[rounded] ?? roundedClasses2.lg;
|
|
1330
1254
|
const layoutClass = divider ? "divide-y divide-gray-100 overflow-hidden" : "gap-4";
|
|
@@ -1345,7 +1269,10 @@ var ExpansionPanelInner = (props, forwardedRef) => {
|
|
|
1345
1269
|
}
|
|
1346
1270
|
);
|
|
1347
1271
|
};
|
|
1348
|
-
var
|
|
1272
|
+
var ExpansionPanelBase = React4.forwardRef(ExpansionPanelInner);
|
|
1273
|
+
var ExpansionPanel = Object.assign(ExpansionPanelBase, {
|
|
1274
|
+
Item: ExpansionPanelItem_default
|
|
1275
|
+
});
|
|
1349
1276
|
ExpansionPanel.displayName = "ExpansionPanel";
|
|
1350
1277
|
var ExpansionPanel_default = ExpansionPanel;
|
|
1351
1278
|
var containerBaseClasses = "fixed inset-0 z-[70] flex items-center justify-center p-4 sm:p-8 data-[state=closed]:pointer-events-none";
|
|
@@ -1473,10 +1400,119 @@ var Dialog = React4__namespace.forwardRef((props, forwardedRef) => {
|
|
|
1473
1400
|
});
|
|
1474
1401
|
Dialog.displayName = "Dialog";
|
|
1475
1402
|
var Dialog_default = Dialog;
|
|
1403
|
+
var overlayBaseClasses3 = "fixed inset-0 z-[55] bg-gray-900/55 backdrop-blur-[2px] transition-opacity duration-200 data-[state=closed]:opacity-0 data-[state=open]:opacity-100";
|
|
1404
|
+
var temporaryContainerBaseClasses = "fixed inset-y-0 z-[60] flex max-w-full transition-transform duration-200";
|
|
1405
|
+
var staticContainerBaseClasses = "relative flex h-full max-w-full";
|
|
1406
|
+
var drawerBaseClasses = "flex h-full w-full flex-col bg-white text-gray-900 shadow-xl shadow-black/10 ring-1 ring-black/5 focus-visible:outline-none dark:bg-gray-900 dark:text-gray-100 dark:ring-white/10";
|
|
1407
|
+
var resolveSizeValue2 = (value) => {
|
|
1408
|
+
if (value === void 0) {
|
|
1409
|
+
return void 0;
|
|
1410
|
+
}
|
|
1411
|
+
return typeof value === "number" ? `${value}px` : value;
|
|
1412
|
+
};
|
|
1413
|
+
var Drawer = React4__namespace.forwardRef((props, ref) => {
|
|
1414
|
+
const {
|
|
1415
|
+
location = "left",
|
|
1416
|
+
floating = false,
|
|
1417
|
+
temporary = false,
|
|
1418
|
+
open,
|
|
1419
|
+
keepMounted = false,
|
|
1420
|
+
scrim = true,
|
|
1421
|
+
width = "18rem",
|
|
1422
|
+
onClose,
|
|
1423
|
+
containerClassName,
|
|
1424
|
+
overlayClassName,
|
|
1425
|
+
overlayProps,
|
|
1426
|
+
portal = true,
|
|
1427
|
+
portalContainer,
|
|
1428
|
+
className,
|
|
1429
|
+
style,
|
|
1430
|
+
role,
|
|
1431
|
+
...rest
|
|
1432
|
+
} = props;
|
|
1433
|
+
const isOpen = open ?? !temporary;
|
|
1434
|
+
const state = isOpen ? "open" : "closed";
|
|
1435
|
+
const shouldRender = keepMounted || isOpen || temporary;
|
|
1436
|
+
const resolvedPortalContainer = portalContainer ?? (typeof document !== "undefined" ? document.body : null);
|
|
1437
|
+
const resolvedStyle = { ...style };
|
|
1438
|
+
if (resolvedStyle.width === void 0) {
|
|
1439
|
+
resolvedStyle.width = resolveSizeValue2(width);
|
|
1440
|
+
}
|
|
1441
|
+
const locationClass = location === "right" ? "right-0" : "left-0";
|
|
1442
|
+
const translateClass = isOpen ? "translate-x-0" : location === "right" ? "translate-x-full" : "-translate-x-full";
|
|
1443
|
+
const floatingClasses = floating ? "rounded-2xl shadow-2xl shadow-black/20 ring-1 ring-black/10 dark:ring-white/10" : void 0;
|
|
1444
|
+
const borderClasses = !floating && !temporary ? location === "right" ? "border-l border-gray-200 dark:border-gray-800" : "border-r border-gray-200 dark:border-gray-800" : void 0;
|
|
1445
|
+
const {
|
|
1446
|
+
className: overlayExtraClassName,
|
|
1447
|
+
onClick: overlayOnClick,
|
|
1448
|
+
...restOverlayProps
|
|
1449
|
+
} = overlayProps ?? {};
|
|
1450
|
+
const overlayNode = temporary && scrim && shouldRender ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
1451
|
+
"div",
|
|
1452
|
+
{
|
|
1453
|
+
...restOverlayProps,
|
|
1454
|
+
className: tailwindMerge.twMerge(
|
|
1455
|
+
overlayBaseClasses3,
|
|
1456
|
+
isOpen ? "pointer-events-auto opacity-100" : "pointer-events-none opacity-0",
|
|
1457
|
+
overlayClassName,
|
|
1458
|
+
overlayExtraClassName
|
|
1459
|
+
),
|
|
1460
|
+
onClick: (event) => {
|
|
1461
|
+
overlayOnClick?.(event);
|
|
1462
|
+
if (!event.defaultPrevented) {
|
|
1463
|
+
onClose?.();
|
|
1464
|
+
}
|
|
1465
|
+
},
|
|
1466
|
+
"data-state": state,
|
|
1467
|
+
"aria-hidden": true
|
|
1468
|
+
}
|
|
1469
|
+
) : null;
|
|
1470
|
+
const drawerNode = shouldRender ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
1471
|
+
"div",
|
|
1472
|
+
{
|
|
1473
|
+
className: tailwindMerge.twMerge(
|
|
1474
|
+
temporary ? temporaryContainerBaseClasses : staticContainerBaseClasses,
|
|
1475
|
+
temporary ? locationClass : void 0,
|
|
1476
|
+
temporary ? translateClass : void 0,
|
|
1477
|
+
temporary && !isOpen ? "pointer-events-none" : void 0,
|
|
1478
|
+
temporary && floating ? "p-4" : void 0,
|
|
1479
|
+
!temporary && location === "right" ? "ml-auto" : void 0,
|
|
1480
|
+
containerClassName
|
|
1481
|
+
),
|
|
1482
|
+
"data-state": state,
|
|
1483
|
+
"aria-hidden": temporary ? !isOpen : void 0,
|
|
1484
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1485
|
+
"div",
|
|
1486
|
+
{
|
|
1487
|
+
...rest,
|
|
1488
|
+
ref,
|
|
1489
|
+
role: role ?? "navigation",
|
|
1490
|
+
className: tailwindMerge.twMerge(drawerBaseClasses, floatingClasses, borderClasses, className),
|
|
1491
|
+
style: resolvedStyle,
|
|
1492
|
+
"data-state": state,
|
|
1493
|
+
children: props.children
|
|
1494
|
+
}
|
|
1495
|
+
)
|
|
1496
|
+
}
|
|
1497
|
+
) : null;
|
|
1498
|
+
const outputNode = temporary && portal && resolvedPortalContainer && drawerNode ? reactDom.createPortal(
|
|
1499
|
+
/* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
1500
|
+
overlayNode,
|
|
1501
|
+
drawerNode
|
|
1502
|
+
] }),
|
|
1503
|
+
resolvedPortalContainer
|
|
1504
|
+
) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
1505
|
+
overlayNode,
|
|
1506
|
+
drawerNode
|
|
1507
|
+
] });
|
|
1508
|
+
return outputNode;
|
|
1509
|
+
});
|
|
1510
|
+
Drawer.displayName = "Drawer";
|
|
1511
|
+
var Drawer_default = Drawer;
|
|
1476
1512
|
var tooltipBaseClasses = "absolute z-[60] max-w-xs rounded-lg border border-white/10 bg-gray-900 px-3 py-2 text-xs font-medium text-white shadow-lg shadow-black/30 ring-1 ring-black/40 transition-all duration-150";
|
|
1477
1513
|
var wrapperBaseClasses = "relative inline-flex max-w-full align-middle";
|
|
1478
1514
|
var arrowBaseClasses = "pointer-events-none absolute h-2 w-2 rotate-45 border border-white/10 bg-gray-900 shadow-lg shadow-black/20";
|
|
1479
|
-
var
|
|
1515
|
+
var resolveSizeValue3 = (value) => {
|
|
1480
1516
|
if (value === void 0) {
|
|
1481
1517
|
return void 0;
|
|
1482
1518
|
}
|
|
@@ -1534,7 +1570,7 @@ var ToolTip = React4__namespace.forwardRef((props, forwardedRef) => {
|
|
|
1534
1570
|
const shouldRenderTooltip = hasRenderableContent && (shouldEnableTriggers || keepMounted);
|
|
1535
1571
|
const resolvedStyle = { ...style };
|
|
1536
1572
|
if (resolvedStyle.maxWidth === void 0) {
|
|
1537
|
-
resolvedStyle.maxWidth =
|
|
1573
|
+
resolvedStyle.maxWidth = resolveSizeValue3(maxWidth);
|
|
1538
1574
|
}
|
|
1539
1575
|
const baseVisibility = persistent ? "opacity-100 scale-100" : "opacity-0 scale-95";
|
|
1540
1576
|
const hoverClasses = !persistent && showOnHover ? " group-hover/tooltip:opacity-100 group-hover/tooltip:scale-100" : "";
|
|
@@ -3391,118 +3427,141 @@ var resolveIconClassName5 = (icon) => {
|
|
|
3391
3427
|
const classes = [...baseClasses, normalizedName];
|
|
3392
3428
|
return Array.from(new Set(classes)).join(" ");
|
|
3393
3429
|
};
|
|
3394
|
-
var Select = React4__namespace.default.forwardRef(
|
|
3395
|
-
|
|
3396
|
-
|
|
3397
|
-
|
|
3398
|
-
|
|
3399
|
-
|
|
3400
|
-
|
|
3401
|
-
|
|
3402
|
-
|
|
3403
|
-
|
|
3404
|
-
|
|
3405
|
-
|
|
3406
|
-
|
|
3407
|
-
|
|
3408
|
-
|
|
3409
|
-
|
|
3410
|
-
|
|
3411
|
-
|
|
3412
|
-
|
|
3413
|
-
|
|
3414
|
-
|
|
3415
|
-
|
|
3416
|
-
|
|
3417
|
-
|
|
3418
|
-
|
|
3419
|
-
|
|
3420
|
-
|
|
3421
|
-
|
|
3422
|
-
|
|
3423
|
-
|
|
3424
|
-
|
|
3425
|
-
|
|
3426
|
-
|
|
3427
|
-
|
|
3428
|
-
|
|
3429
|
-
|
|
3430
|
-
|
|
3431
|
-
|
|
3432
|
-
|
|
3433
|
-
|
|
3430
|
+
var Select = React4__namespace.default.forwardRef(
|
|
3431
|
+
({
|
|
3432
|
+
options,
|
|
3433
|
+
label,
|
|
3434
|
+
placeholder,
|
|
3435
|
+
variant = "outline",
|
|
3436
|
+
size = "medium",
|
|
3437
|
+
className,
|
|
3438
|
+
wrapperClassName,
|
|
3439
|
+
id,
|
|
3440
|
+
name,
|
|
3441
|
+
multiple,
|
|
3442
|
+
value,
|
|
3443
|
+
defaultValue,
|
|
3444
|
+
error,
|
|
3445
|
+
helperText,
|
|
3446
|
+
disabled,
|
|
3447
|
+
required,
|
|
3448
|
+
onChange,
|
|
3449
|
+
onBlur,
|
|
3450
|
+
onFocus,
|
|
3451
|
+
...props
|
|
3452
|
+
}, ref) => {
|
|
3453
|
+
const selectId = id || name || generateString();
|
|
3454
|
+
const inputName = name || selectId;
|
|
3455
|
+
const variantClass = variantClasses4[variant] ?? variantClasses4.outline;
|
|
3456
|
+
const sizeConfig = sizeClasses3[size] ?? sizeClasses3.medium;
|
|
3457
|
+
const sizeClass = `${sizeConfig.padding} ${sizeConfig.text}`;
|
|
3458
|
+
const normalizedOptions = options.map(normalizeOption);
|
|
3459
|
+
const selectedValueList = value !== void 0 ? (Array.isArray(value) ? value : [value]).map(String) : defaultValue !== void 0 ? (Array.isArray(defaultValue) ? defaultValue : [defaultValue]).map(String) : [];
|
|
3460
|
+
const selectedLabels = normalizedOptions.filter((option) => selectedValueList.includes(String(option.value))).map((option) => option.label);
|
|
3461
|
+
const hasSelection = selectedLabels.length > 0;
|
|
3462
|
+
const summaryText = hasSelection ? multiple ? selectedLabels.join(", ") : selectedLabels[0] : placeholder || "\xA0";
|
|
3463
|
+
const handleOptionChange = (event) => {
|
|
3464
|
+
onChange?.(event);
|
|
3465
|
+
if (multiple) return;
|
|
3466
|
+
const detailsEl = event.currentTarget.closest("details");
|
|
3467
|
+
detailsEl?.removeAttribute("open");
|
|
3468
|
+
};
|
|
3469
|
+
const handleDetailsBlur = (event) => {
|
|
3470
|
+
const nextFocus = event.relatedTarget;
|
|
3471
|
+
if (nextFocus && event.currentTarget.contains(nextFocus)) return;
|
|
3472
|
+
event.currentTarget.removeAttribute("open");
|
|
3473
|
+
};
|
|
3474
|
+
const handleDetailsFocus = (event) => {
|
|
3475
|
+
if (normalizedOptions.length === 0) {
|
|
3476
|
+
onFocus?.(event);
|
|
3477
|
+
}
|
|
3478
|
+
};
|
|
3479
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: tailwindMerge.twMerge("flex flex-col gap-1", wrapperClassName), children: [
|
|
3480
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative", children: [
|
|
3434
3481
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
3435
|
-
"
|
|
3482
|
+
"details",
|
|
3436
3483
|
{
|
|
3437
|
-
className:
|
|
3438
|
-
|
|
3439
|
-
|
|
3440
|
-
|
|
3441
|
-
|
|
3442
|
-
error && "border-red-500 focus-visible:border-red-500 focus-visible:ring-red-500",
|
|
3443
|
-
disabled && "pointer-events-none opacity-50 cursor-not-allowed",
|
|
3444
|
-
className
|
|
3445
|
-
),
|
|
3446
|
-
style: { minHeight: "2.75rem" },
|
|
3447
|
-
onClick: (e) => disabled && e.preventDefault(),
|
|
3484
|
+
className: "group w-full",
|
|
3485
|
+
...props,
|
|
3486
|
+
onBlur: onBlur ? void 0 : handleDetailsBlur,
|
|
3487
|
+
onFocus: onFocus ? handleDetailsFocus : void 0,
|
|
3488
|
+
open: void 0,
|
|
3448
3489
|
children: [
|
|
3449
|
-
/* @__PURE__ */ jsxRuntime.
|
|
3450
|
-
|
|
3490
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
3491
|
+
"summary",
|
|
3492
|
+
{
|
|
3493
|
+
className: tailwindMerge.twMerge(
|
|
3494
|
+
baseClass2,
|
|
3495
|
+
variantClass,
|
|
3496
|
+
sizeClass,
|
|
3497
|
+
"list-none cursor-pointer flex items-center justify-between pr-10 relative [&::-webkit-details-marker]:hidden",
|
|
3498
|
+
error && "border-red-500 focus-visible:border-red-500 focus-visible:ring-red-500",
|
|
3499
|
+
disabled && "pointer-events-none opacity-50 cursor-not-allowed",
|
|
3500
|
+
className
|
|
3501
|
+
),
|
|
3502
|
+
style: { minHeight: "2.75rem" },
|
|
3503
|
+
onClick: (e) => disabled && e.preventDefault(),
|
|
3504
|
+
children: [
|
|
3505
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: tailwindMerge.twMerge("truncate", !hasSelection && "text-gray-500 dark:text-gray-400"), children: summaryText }),
|
|
3506
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "pointer-events-none absolute inset-y-0 right-3 flex items-center text-gray-500 dark:text-gray-300", children: /* @__PURE__ */ jsxRuntime.jsx("i", { className: "mdi mdi-chevron-down text-base leading-none transition-transform duration-200 group-open:rotate-180", "aria-hidden": true }) })
|
|
3507
|
+
]
|
|
3508
|
+
}
|
|
3509
|
+
),
|
|
3510
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute z-50 mt-1 max-h-60 w-full overflow-auto rounded-lg border border-gray-200 bg-white py-1 shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none dark:bg-slate-800 dark:border-slate-700", children: normalizedOptions.map((option, index) => {
|
|
3511
|
+
const optionValueStr = String(option.value);
|
|
3512
|
+
const isSelected = Array.isArray(value) ? value.map(String).includes(optionValueStr) : String(value) === optionValueStr;
|
|
3513
|
+
const isDefaultSelected = Array.isArray(defaultValue) ? defaultValue.map(String).includes(optionValueStr) : String(defaultValue) === optionValueStr;
|
|
3514
|
+
const iconClassName = resolveIconClassName5(option.icon);
|
|
3515
|
+
const inputId = `${selectId}-${toIdSafe(optionValueStr)}-${index}`;
|
|
3516
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3517
|
+
"label",
|
|
3518
|
+
{
|
|
3519
|
+
htmlFor: inputId,
|
|
3520
|
+
className: tailwindMerge.twMerge(
|
|
3521
|
+
"relative flex cursor-pointer select-none items-center gap-2 px-4 py-2 text-sm text-gray-900 hover:bg-gray-50 dark:text-gray-100 dark:hover:bg-slate-700",
|
|
3522
|
+
option.disabled && "cursor-not-allowed opacity-50"
|
|
3523
|
+
),
|
|
3524
|
+
children: [
|
|
3525
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3526
|
+
"input",
|
|
3527
|
+
{
|
|
3528
|
+
type: multiple ? "checkbox" : "radio",
|
|
3529
|
+
id: inputId,
|
|
3530
|
+
name: inputName,
|
|
3531
|
+
value: option.value,
|
|
3532
|
+
disabled: option.disabled || disabled,
|
|
3533
|
+
checked: value !== void 0 ? isSelected : void 0,
|
|
3534
|
+
defaultChecked: defaultValue !== void 0 ? isDefaultSelected : void 0,
|
|
3535
|
+
onChange: handleOptionChange,
|
|
3536
|
+
onBlur,
|
|
3537
|
+
ref,
|
|
3538
|
+
required: required && !multiple,
|
|
3539
|
+
className: "peer sr-only"
|
|
3540
|
+
}
|
|
3541
|
+
),
|
|
3542
|
+
iconClassName && /* @__PURE__ */ jsxRuntime.jsx("i", { className: tailwindMerge.twMerge(iconClassName, "text-lg text-gray-500 peer-checked:text-primary dark:text-gray-400") }),
|
|
3543
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex-1 truncate peer-checked:font-medium peer-checked:text-primary", children: option.label }),
|
|
3544
|
+
/* @__PURE__ */ jsxRuntime.jsx("i", { className: "mdi mdi-check invisible ml-auto text-primary peer-checked:visible" })
|
|
3545
|
+
]
|
|
3546
|
+
},
|
|
3547
|
+
`${optionValueStr}-${index}`
|
|
3548
|
+
);
|
|
3549
|
+
}) })
|
|
3451
3550
|
]
|
|
3452
3551
|
}
|
|
3453
3552
|
),
|
|
3454
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3455
|
-
|
|
3456
|
-
|
|
3457
|
-
|
|
3458
|
-
|
|
3459
|
-
|
|
3460
|
-
|
|
3461
|
-
"label",
|
|
3462
|
-
{
|
|
3463
|
-
htmlFor: inputId,
|
|
3464
|
-
className: tailwindMerge.twMerge(
|
|
3465
|
-
"relative flex cursor-pointer select-none items-center gap-2 px-4 py-2 text-sm text-gray-900 hover:bg-gray-50 dark:text-gray-100 dark:hover:bg-slate-700",
|
|
3466
|
-
option.disabled && "cursor-not-allowed opacity-50"
|
|
3467
|
-
),
|
|
3468
|
-
children: [
|
|
3469
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3470
|
-
"input",
|
|
3471
|
-
{
|
|
3472
|
-
type: multiple ? "checkbox" : "radio",
|
|
3473
|
-
id: inputId,
|
|
3474
|
-
name: inputName,
|
|
3475
|
-
value: option.value,
|
|
3476
|
-
disabled: option.disabled || disabled,
|
|
3477
|
-
checked: value !== void 0 ? isSelected : void 0,
|
|
3478
|
-
defaultChecked: defaultValue !== void 0 ? isDefaultSelected : void 0,
|
|
3479
|
-
onChange: handleOptionChange,
|
|
3480
|
-
onBlur,
|
|
3481
|
-
ref,
|
|
3482
|
-
required: required && !multiple,
|
|
3483
|
-
className: "peer sr-only"
|
|
3484
|
-
}
|
|
3485
|
-
),
|
|
3486
|
-
iconClassName && /* @__PURE__ */ jsxRuntime.jsx("i", { className: tailwindMerge.twMerge(iconClassName, "text-lg text-gray-500 peer-checked:text-primary dark:text-gray-400") }),
|
|
3487
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex-1 truncate peer-checked:font-medium peer-checked:text-primary", children: option.label }),
|
|
3488
|
-
/* @__PURE__ */ jsxRuntime.jsx("i", { className: "mdi mdi-check invisible ml-auto text-primary peer-checked:visible" })
|
|
3489
|
-
]
|
|
3490
|
-
},
|
|
3491
|
-
`${optionValueStr}-${index}`
|
|
3492
|
-
);
|
|
3493
|
-
}) })
|
|
3553
|
+
label && /* @__PURE__ */ jsxRuntime.jsx(
|
|
3554
|
+
"label",
|
|
3555
|
+
{
|
|
3556
|
+
className: tailwindMerge.twMerge("absolute left-3 -top-1.5 text-xs bg-white px-1 text-gray-500 transition-all dark:bg-slate-900 dark:text-gray-400"),
|
|
3557
|
+
children: label
|
|
3558
|
+
}
|
|
3559
|
+
)
|
|
3494
3560
|
] }),
|
|
3495
|
-
|
|
3496
|
-
|
|
3497
|
-
|
|
3498
|
-
|
|
3499
|
-
children: label
|
|
3500
|
-
}
|
|
3501
|
-
)
|
|
3502
|
-
] }),
|
|
3503
|
-
helperText && /* @__PURE__ */ jsxRuntime.jsx("p", { className: tailwindMerge.twMerge("mt-1 text-xs text-gray-500", error && "text-red-500"), children: helperText })
|
|
3504
|
-
] });
|
|
3505
|
-
});
|
|
3561
|
+
helperText && /* @__PURE__ */ jsxRuntime.jsx("p", { className: tailwindMerge.twMerge("mt-1 text-xs text-gray-500", error && "text-red-500"), children: helperText })
|
|
3562
|
+
] });
|
|
3563
|
+
}
|
|
3564
|
+
);
|
|
3506
3565
|
Select.displayName = "Select";
|
|
3507
3566
|
var Select_default = Select;
|
|
3508
3567
|
var paletteValues = {
|
|
@@ -4638,6 +4697,7 @@ exports.Button = Button_default;
|
|
|
4638
4697
|
exports.Card = Card_default;
|
|
4639
4698
|
exports.Chip = Chip_default;
|
|
4640
4699
|
exports.Dialog = Dialog_default;
|
|
4700
|
+
exports.Drawer = Drawer_default;
|
|
4641
4701
|
exports.ExpansionPanel = ExpansionPanel_default;
|
|
4642
4702
|
exports.ExpansionPanelItem = ExpansionPanelItem_default;
|
|
4643
4703
|
exports.Hero = Hero_default;
|