luna-components-library 1.1.38 → 1.1.40
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/luna-components-library.js +125 -101
- package/dist/luna-components-library.js.map +1 -1
- package/dist/src/components/Accordion.d.ts +8 -3
- package/dist/src/components/Anchor.d.ts +3 -3
- package/dist/src/components/Button.d.ts +5 -5
- package/dist/src/components/DataTable.d.ts +25 -3
- package/dist/src/components/DropDown.d.ts +16 -5
- package/dist/src/components/Input.d.ts +5 -5
- package/dist/src/components/MultiSelect.d.ts +27 -4
- package/dist/src/components/Popconfirm.d.ts +19 -3
- package/dist/src/components/QRCode.d.ts +10 -3
- package/dist/src/components/Toast.d.ts +18 -3
- package/dist/src/styles.d.ts +5 -4
- package/dist/src/types.d.ts +1 -10
- package/package.json +1 -1
|
@@ -111,15 +111,7 @@ var commonStyles = {
|
|
|
111
111
|
padding: "1rem",
|
|
112
112
|
display: "flex",
|
|
113
113
|
alignItems: "center",
|
|
114
|
-
justifyContent: "space-between"
|
|
115
|
-
backgroundColor: colors.bgHeader,
|
|
116
|
-
border: "none",
|
|
117
|
-
cursor: "pointer",
|
|
118
|
-
textAlign: "left",
|
|
119
|
-
fontSize: fontSizes.sm,
|
|
120
|
-
fontWeight: fontWeights.semibold,
|
|
121
|
-
color: colors.text,
|
|
122
|
-
outline: "none"
|
|
114
|
+
justifyContent: "space-between"
|
|
123
115
|
},
|
|
124
116
|
chevron: {
|
|
125
117
|
fontSize: fontSizes.xs,
|
|
@@ -200,15 +192,11 @@ var commonStyles = {
|
|
|
200
192
|
},
|
|
201
193
|
buttonBase: {
|
|
202
194
|
display: "inline-flex",
|
|
203
|
-
alignItems: "center",
|
|
204
|
-
justifyContent: "center",
|
|
205
195
|
fontWeight: fontWeights.medium,
|
|
206
196
|
borderRadius: radii.md,
|
|
207
|
-
|
|
208
|
-
cursor: "pointer",
|
|
209
|
-
outline: "none",
|
|
210
|
-
border: "1px solid transparent"
|
|
197
|
+
hover: { backgroundColor: colors.bgHover }
|
|
211
198
|
},
|
|
199
|
+
anchorBase: {},
|
|
212
200
|
inputWrapper: {
|
|
213
201
|
position: "relative",
|
|
214
202
|
display: "inline-block",
|
|
@@ -296,7 +284,8 @@ var dataTableStyles = (styles) => ({
|
|
|
296
284
|
},
|
|
297
285
|
searchContainer: {
|
|
298
286
|
padding: "1rem",
|
|
299
|
-
borderBottom: `1px solid ${colors.border}
|
|
287
|
+
borderBottom: `1px solid ${colors.border}`,
|
|
288
|
+
...styles?.searchContainer
|
|
300
289
|
},
|
|
301
290
|
table: {
|
|
302
291
|
width: "100%",
|
|
@@ -324,12 +313,25 @@ var dataTableStyles = (styles) => ({
|
|
|
324
313
|
},
|
|
325
314
|
tr: (clickable) => ({
|
|
326
315
|
transition: transitions.bg,
|
|
327
|
-
cursor: clickable ? "pointer" : "default"
|
|
316
|
+
cursor: clickable ? "pointer" : "default",
|
|
317
|
+
...styles?.tr
|
|
328
318
|
}),
|
|
329
|
-
pagination: {
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
319
|
+
pagination: {
|
|
320
|
+
...commonStyles.pagination,
|
|
321
|
+
...styles?.pagination
|
|
322
|
+
},
|
|
323
|
+
icon: {
|
|
324
|
+
...commonStyles.icon,
|
|
325
|
+
...styles?.icon
|
|
326
|
+
},
|
|
327
|
+
filterMenu: {
|
|
328
|
+
...commonStyles.filterMenu,
|
|
329
|
+
...styles?.filterMenu
|
|
330
|
+
},
|
|
331
|
+
filterOption: (active) => ({
|
|
332
|
+
...commonStyles.filterOption(active),
|
|
333
|
+
...styles?.filterOption
|
|
334
|
+
})
|
|
333
335
|
});
|
|
334
336
|
var dropDownStyles = (styles, disabled, isOpen, hoverIndex, value) => ({
|
|
335
337
|
container: {
|
|
@@ -374,7 +376,8 @@ var dropDownStyles = (styles, disabled, isOpen, hoverIndex, value) => ({
|
|
|
374
376
|
arrow: {
|
|
375
377
|
...commonStyles.chevron,
|
|
376
378
|
marginLeft: "0.5rem",
|
|
377
|
-
transform: isOpen ? "rotate(180deg)" : "rotate(0deg)"
|
|
379
|
+
transform: isOpen ? "rotate(180deg)" : "rotate(0deg)",
|
|
380
|
+
...styles?.arrow
|
|
378
381
|
}
|
|
379
382
|
});
|
|
380
383
|
var variantStyles = {
|
|
@@ -423,27 +426,15 @@ var variantStyles = {
|
|
|
423
426
|
textDecoration: "underline"
|
|
424
427
|
}
|
|
425
428
|
};
|
|
426
|
-
var variantClasses = {
|
|
427
|
-
primary: "bg-blue-600 text-white hover:bg-blue-700",
|
|
428
|
-
secondary: "bg-gray-600 text-white hover:bg-gray-700",
|
|
429
|
-
outline: "border border-gray-300 text-gray-700 hover:bg-gray-50",
|
|
430
|
-
success: "bg-green-600 text-white hover:bg-green-700",
|
|
431
|
-
danger: "bg-red-600 text-white hover:bg-red-700",
|
|
432
|
-
warning: "bg-yellow-500 text-white hover:bg-yellow-600",
|
|
433
|
-
info: "bg-cyan-600 text-white hover:bg-cyan-700",
|
|
434
|
-
dark: "bg-gray-900 text-white hover:bg-gray-800",
|
|
435
|
-
light: "bg-gray-100 text-gray-900 hover:bg-gray-200",
|
|
436
|
-
link: "text-blue-600 hover:text-blue-800 hover:underline"
|
|
437
|
-
};
|
|
438
429
|
var inputStyles = (styles, extraStyle, inputSize, readOnly, disabled) => ({
|
|
439
430
|
container: {
|
|
440
431
|
...commonStyles.inputWrapper,
|
|
441
|
-
|
|
432
|
+
styles,
|
|
442
433
|
...extraStyle
|
|
443
434
|
},
|
|
444
435
|
label: {
|
|
445
436
|
...commonStyles.inputLabel,
|
|
446
|
-
|
|
437
|
+
styles
|
|
447
438
|
},
|
|
448
439
|
input: {
|
|
449
440
|
...commonStyles.inputField,
|
|
@@ -452,7 +443,7 @@ var inputStyles = (styles, extraStyle, inputSize, readOnly, disabled) => ({
|
|
|
452
443
|
backgroundColor: readOnly ? colors.borderLight : colors.white,
|
|
453
444
|
cursor: disabled ? "not-allowed" : readOnly ? "default" : "text",
|
|
454
445
|
opacity: disabled ? .5 : 1,
|
|
455
|
-
|
|
446
|
+
styles
|
|
456
447
|
},
|
|
457
448
|
variants: {
|
|
458
449
|
none: {},
|
|
@@ -483,14 +474,14 @@ var multiSelectStyles = (styles, disabled, isOpen) => ({
|
|
|
483
474
|
container: {
|
|
484
475
|
position: "relative",
|
|
485
476
|
width: "100%",
|
|
486
|
-
|
|
477
|
+
styles
|
|
487
478
|
},
|
|
488
479
|
trigger: {
|
|
489
480
|
...commonStyles.trigger,
|
|
490
481
|
minHeight: "2.5rem",
|
|
491
482
|
cursor: disabled ? "not-allowed" : "pointer",
|
|
492
483
|
opacity: disabled ? .6 : 1,
|
|
493
|
-
|
|
484
|
+
styles
|
|
494
485
|
},
|
|
495
486
|
chevron: {
|
|
496
487
|
...commonStyles.chevron,
|
|
@@ -499,7 +490,7 @@ var multiSelectStyles = (styles, disabled, isOpen) => ({
|
|
|
499
490
|
panel: {
|
|
500
491
|
...commonStyles.panel,
|
|
501
492
|
display: isOpen ? "block" : "none",
|
|
502
|
-
|
|
493
|
+
styles
|
|
503
494
|
},
|
|
504
495
|
header: {
|
|
505
496
|
...commonStyles.header,
|
|
@@ -507,7 +498,7 @@ var multiSelectStyles = (styles, disabled, isOpen) => ({
|
|
|
507
498
|
borderBottom: `1px solid ${colors.borderLight}`,
|
|
508
499
|
flexDirection: "column",
|
|
509
500
|
gap: "0.5rem",
|
|
510
|
-
|
|
501
|
+
styles
|
|
511
502
|
},
|
|
512
503
|
selectAllWrapper: {
|
|
513
504
|
display: "flex",
|
|
@@ -520,12 +511,12 @@ var multiSelectStyles = (styles, disabled, isOpen) => ({
|
|
|
520
511
|
list: { ...commonStyles.list },
|
|
521
512
|
item: (isSelected, isDisabled) => ({
|
|
522
513
|
...commonStyles.item(isSelected, isDisabled),
|
|
523
|
-
|
|
514
|
+
styles
|
|
524
515
|
}),
|
|
525
516
|
checkbox: { ...commonStyles.checkbox },
|
|
526
517
|
chip: {
|
|
527
518
|
...commonStyles.chip,
|
|
528
|
-
|
|
519
|
+
styles
|
|
529
520
|
},
|
|
530
521
|
chipIcon: {
|
|
531
522
|
cursor: "pointer",
|
|
@@ -580,13 +571,15 @@ var popconfirmStyles = (styles, show, position) => ({
|
|
|
580
571
|
display: "flex",
|
|
581
572
|
alignItems: "flex-start",
|
|
582
573
|
gap: "0.5rem",
|
|
583
|
-
marginBottom: "0.5rem"
|
|
574
|
+
marginBottom: "0.5rem",
|
|
575
|
+
...styles?.titleWrapper
|
|
584
576
|
},
|
|
585
577
|
icon: {
|
|
586
578
|
color: "#eab308",
|
|
587
579
|
fontSize: "1rem",
|
|
588
580
|
fontWeight: "bold",
|
|
589
|
-
marginTop: "1px"
|
|
581
|
+
marginTop: "1px",
|
|
582
|
+
...styles?.icon
|
|
590
583
|
},
|
|
591
584
|
title: {
|
|
592
585
|
fontSize: fontSizes.sm,
|
|
@@ -604,7 +597,8 @@ var popconfirmStyles = (styles, show, position) => ({
|
|
|
604
597
|
actions: {
|
|
605
598
|
display: "flex",
|
|
606
599
|
justifyContent: "flex-end",
|
|
607
|
-
gap: "0.5rem"
|
|
600
|
+
gap: "0.5rem",
|
|
601
|
+
...styles?.actions
|
|
608
602
|
}
|
|
609
603
|
});
|
|
610
604
|
var preloaderStyles = (zIndex, backgroundColor, size, borderWidth, styles) => ({
|
|
@@ -722,7 +716,8 @@ var qrCodeStyles = (styles, bordered, cleanBgColor, size, isLoading) => ({
|
|
|
722
716
|
backgroundColor: colors.bgSkeleton,
|
|
723
717
|
borderRadius: radii.sm,
|
|
724
718
|
display: isLoading ? "block" : "none",
|
|
725
|
-
animation: "pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite"
|
|
719
|
+
animation: "pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite",
|
|
720
|
+
...styles?.skeleton
|
|
726
721
|
}
|
|
727
722
|
});
|
|
728
723
|
var spinnerAnimationStyles = `
|
|
@@ -861,7 +856,8 @@ var toastStyles = (styles, severity, position, isExiting, visible) => {
|
|
|
861
856
|
color: config.text,
|
|
862
857
|
fontSize: fontSizes.sm,
|
|
863
858
|
fontWeight: fontWeights.bold,
|
|
864
|
-
flexShrink: 0
|
|
859
|
+
flexShrink: 0,
|
|
860
|
+
...styles?.iconWrapper
|
|
865
861
|
},
|
|
866
862
|
content: {
|
|
867
863
|
flex: 1,
|
|
@@ -895,7 +891,8 @@ var toastStyles = (styles, severity, position, isExiting, visible) => {
|
|
|
895
891
|
display: "flex",
|
|
896
892
|
alignItems: "center",
|
|
897
893
|
justifyContent: "center",
|
|
898
|
-
flexShrink: 0
|
|
894
|
+
flexShrink: 0,
|
|
895
|
+
...styles?.closeButton
|
|
899
896
|
}
|
|
900
897
|
};
|
|
901
898
|
};
|
|
@@ -1013,34 +1010,27 @@ var modalSizeClasses = {
|
|
|
1013
1010
|
var modalOverlayClasses = (show, animation, className) => `fixed inset-0 z-60 flex items-center justify-center ${show ? "opacity-100 pointer-events-auto" : "opacity-0 pointer-events-none"} ${animation ? "transition-opacity duration-300" : ""} ${className}`.trim();
|
|
1014
1011
|
var modalDialogClasses = (size, centered, dialogClassName) => `relative w-full ${modalSizeClasses[size]} mx-auto ${centered ? "flex items-center justify-center min-h-screen" : "mt-8"} ${dialogClassName}`.trim();
|
|
1015
1012
|
var anchorBaseStyles = (variant, isHovered, size) => ({
|
|
1016
|
-
...commonStyles.
|
|
1017
|
-
gap: "0",
|
|
1018
|
-
cursor: "pointer",
|
|
1013
|
+
...commonStyles.anchorBase,
|
|
1019
1014
|
textDecoration: variant === "none" ? isHovered ? "underline" : "none" : "none",
|
|
1020
|
-
border: variant === "none" ? "none" : "1px solid transparent",
|
|
1021
1015
|
...variant !== "none" ? sizeStyles[size] : {},
|
|
1022
|
-
display: variant === "none" ? "inline" : "inline-flex",
|
|
1023
1016
|
borderRadius: variant === "none" ? "0" : radii.md
|
|
1024
1017
|
});
|
|
1025
1018
|
var accordionStyles = (isActive, styles) => ({
|
|
1026
1019
|
container: {
|
|
1027
1020
|
...commonStyles.container,
|
|
1028
1021
|
overflow: "hidden",
|
|
1029
|
-
marginBottom: "0.5rem"
|
|
1030
|
-
...styles?.container
|
|
1022
|
+
marginBottom: "0.5rem"
|
|
1031
1023
|
},
|
|
1032
1024
|
header: {
|
|
1033
1025
|
...commonStyles.header,
|
|
1034
|
-
transition: transitions.bgSlow
|
|
1035
|
-
...styles?.header
|
|
1026
|
+
transition: transitions.bgSlow
|
|
1036
1027
|
},
|
|
1037
1028
|
content: {
|
|
1038
1029
|
maxHeight: isActive ? "1000px" : "0",
|
|
1039
1030
|
opacity: isActive ? 1 : 0,
|
|
1040
1031
|
overflow: "hidden",
|
|
1041
1032
|
transition: transitions.normal,
|
|
1042
|
-
borderTop: isActive ? `1px solid ${colors.border}` : "none"
|
|
1043
|
-
...styles?.content
|
|
1033
|
+
borderTop: isActive ? `1px solid ${colors.border}` : "none"
|
|
1044
1034
|
},
|
|
1045
1035
|
innerContent: {
|
|
1046
1036
|
padding: "1rem",
|
|
@@ -1049,27 +1039,48 @@ var accordionStyles = (isActive, styles) => ({
|
|
|
1049
1039
|
},
|
|
1050
1040
|
arrow: {
|
|
1051
1041
|
...commonStyles.chevron,
|
|
1052
|
-
transform: isActive ? "rotate(180deg)" : "rotate(0deg)"
|
|
1053
|
-
...styles?.arrow
|
|
1042
|
+
transform: isActive ? "rotate(180deg)" : "rotate(0deg)"
|
|
1054
1043
|
}
|
|
1055
1044
|
});
|
|
1056
|
-
var
|
|
1045
|
+
var standardVariantStyles = (isHovered) => ({
|
|
1057
1046
|
none: { color: colors.primary },
|
|
1058
1047
|
primary: {
|
|
1059
1048
|
backgroundColor: isHovered ? "#1d4ed8" : "#2563eb",
|
|
1060
|
-
color: "
|
|
1061
|
-
border: "1px solid transparent"
|
|
1049
|
+
color: isHovered ? "black" : "white"
|
|
1062
1050
|
},
|
|
1063
1051
|
secondary: {
|
|
1064
|
-
backgroundColor: isHovered ? "#
|
|
1065
|
-
color: "
|
|
1066
|
-
border: "1px solid transparent"
|
|
1052
|
+
backgroundColor: isHovered ? "#6d737c" : "#4b5563",
|
|
1053
|
+
color: isHovered ? "black" : "white"
|
|
1067
1054
|
},
|
|
1068
1055
|
outline: {
|
|
1069
|
-
backgroundColor: isHovered ? "
|
|
1070
|
-
color: "
|
|
1071
|
-
|
|
1072
|
-
|
|
1056
|
+
backgroundColor: isHovered ? "lightgray" : "white",
|
|
1057
|
+
color: isHovered ? "white" : "black"
|
|
1058
|
+
},
|
|
1059
|
+
danger: {
|
|
1060
|
+
backgroundColor: isHovered ? "#b91c1c" : "#dc2626",
|
|
1061
|
+
color: isHovered ? "black" : "white"
|
|
1062
|
+
},
|
|
1063
|
+
success: {
|
|
1064
|
+
backgroundColor: isHovered ? "#15803d" : "#16a34a",
|
|
1065
|
+
color: isHovered ? "black" : "white"
|
|
1066
|
+
},
|
|
1067
|
+
warning: {
|
|
1068
|
+
backgroundColor: isHovered ? "#d97706" : "#f59e0b",
|
|
1069
|
+
color: isHovered ? "black" : "white"
|
|
1070
|
+
},
|
|
1071
|
+
info: {
|
|
1072
|
+
backgroundColor: isHovered ? "#0891b2" : "#0ea5e9",
|
|
1073
|
+
color: isHovered ? "black" : "white"
|
|
1074
|
+
},
|
|
1075
|
+
dark: {
|
|
1076
|
+
backgroundColor: isHovered ? "#1f2937" : "#111827",
|
|
1077
|
+
color: isHovered ? "black" : "white"
|
|
1078
|
+
},
|
|
1079
|
+
light: {
|
|
1080
|
+
backgroundColor: isHovered ? "#f3f4f6" : "#f9fafb",
|
|
1081
|
+
color: isHovered ? "black" : "white"
|
|
1082
|
+
},
|
|
1083
|
+
link: { color: isHovered ? colors.primary : colors.text }
|
|
1073
1084
|
});
|
|
1074
1085
|
//#endregion
|
|
1075
1086
|
//#region node_modules/react/cjs/react-jsx-runtime.production.js
|
|
@@ -1111,27 +1122,39 @@ var import_jsx_runtime = (/* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1111
1122
|
module.exports = require_react_jsx_runtime_production();
|
|
1112
1123
|
})))();
|
|
1113
1124
|
var Button = ({ children, variant = "primary", size = "sm", onClick, disabled = false, classNames = {}, styles = {}, className = "", style: extraStyle = {}, ...props }) => {
|
|
1114
|
-
const
|
|
1125
|
+
const [isHovered, setIsHovered] = useState(false);
|
|
1126
|
+
const finalClassNames = {
|
|
1127
|
+
container: "",
|
|
1128
|
+
button: "",
|
|
1129
|
+
variant: "",
|
|
1130
|
+
size: "",
|
|
1131
|
+
...classNames
|
|
1132
|
+
};
|
|
1133
|
+
const baseButtonStyle = {
|
|
1115
1134
|
...commonStyles.buttonBase,
|
|
1116
1135
|
cursor: disabled ? "not-allowed" : "pointer",
|
|
1117
1136
|
opacity: disabled ? .5 : 1,
|
|
1118
|
-
...sizeStyles[size]
|
|
1119
|
-
|
|
1120
|
-
|
|
1137
|
+
...sizeStyles[size]
|
|
1138
|
+
};
|
|
1139
|
+
const uiStyles = { variants: standardVariantStyles(isHovered) };
|
|
1140
|
+
const finalButtonStyle = {
|
|
1141
|
+
...baseButtonStyle,
|
|
1142
|
+
...uiStyles.variants[variant],
|
|
1121
1143
|
...extraStyle
|
|
1122
1144
|
};
|
|
1123
1145
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", {
|
|
1124
1146
|
className: [
|
|
1125
|
-
|
|
1126
|
-
variantClasses[variant],
|
|
1147
|
+
finalClassNames.container,
|
|
1127
1148
|
sizeClasses[size],
|
|
1128
|
-
|
|
1149
|
+
finalClassNames.button,
|
|
1129
1150
|
"luna-button",
|
|
1130
1151
|
className
|
|
1131
1152
|
].filter(Boolean).join(" ").trim(),
|
|
1132
1153
|
onClick,
|
|
1133
1154
|
disabled,
|
|
1134
1155
|
style: finalButtonStyle,
|
|
1156
|
+
onMouseEnter: () => setIsHovered(true),
|
|
1157
|
+
onMouseLeave: () => setIsHovered(false),
|
|
1135
1158
|
...props,
|
|
1136
1159
|
children
|
|
1137
1160
|
});
|
|
@@ -1162,7 +1185,7 @@ var Anchor = ({ children, variant = "none", size = "md", href = "https://andreyc
|
|
|
1162
1185
|
const combinedClassName = `luna-anchor ${className}`.trim();
|
|
1163
1186
|
const uiStyles = {
|
|
1164
1187
|
base: anchorBaseStyles(variant, isHovered, size),
|
|
1165
|
-
variants:
|
|
1188
|
+
variants: standardVariantStyles(isHovered)
|
|
1166
1189
|
};
|
|
1167
1190
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("a", {
|
|
1168
1191
|
href,
|
|
@@ -1197,6 +1220,7 @@ var Accordion = ({ title, children, defaultActive = false, active: externalActiv
|
|
|
1197
1220
|
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("button", {
|
|
1198
1221
|
type: "button",
|
|
1199
1222
|
style: uiStyles.header,
|
|
1223
|
+
className: "accordion-button",
|
|
1200
1224
|
onClick: handleToggle,
|
|
1201
1225
|
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: title }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
|
|
1202
1226
|
style: uiStyles.arrow,
|
|
@@ -1204,6 +1228,7 @@ var Accordion = ({ title, children, defaultActive = false, active: externalActiv
|
|
|
1204
1228
|
})]
|
|
1205
1229
|
}), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
1206
1230
|
style: uiStyles.content,
|
|
1231
|
+
className: "accordion-content",
|
|
1207
1232
|
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
1208
1233
|
style: uiStyles.innerContent,
|
|
1209
1234
|
children
|
|
@@ -1331,13 +1356,13 @@ var Spinner = ({ className = "", size = "md", type = "circle", color = "#2563eb"
|
|
|
1331
1356
|
};
|
|
1332
1357
|
//#endregion
|
|
1333
1358
|
//#region src/components/DropDown.tsx
|
|
1334
|
-
var DropDown = ({ options, value, onChange, placeholder = "Select an option", toggle,
|
|
1359
|
+
var DropDown = ({ options, value, onChange, placeholder = "Select an option", toggle, className, styles, disabled = false }) => {
|
|
1335
1360
|
const finalClassNames = {
|
|
1336
1361
|
container: "luna-dropdown",
|
|
1337
1362
|
trigger: "luna-dropdown-trigger",
|
|
1338
1363
|
panel: "luna-dropdown-panel",
|
|
1339
1364
|
option: "luna-dropdown-option",
|
|
1340
|
-
|
|
1365
|
+
className
|
|
1341
1366
|
};
|
|
1342
1367
|
const [isOpen, setIsOpen] = useState(false);
|
|
1343
1368
|
const [hoverIndex, setHoverIndex] = useState(null);
|
|
@@ -1694,13 +1719,13 @@ var Modal = ({ show, onHide, size = "md", centered = false, backdrop = true, bac
|
|
|
1694
1719
|
};
|
|
1695
1720
|
//#endregion
|
|
1696
1721
|
//#region src/components/Input.tsx
|
|
1697
|
-
var Input = ({ children, variant = "none", type = "text", inputSize = "md", placeholder, value: controlledValue, onChange, onFocus, onBlur, disabled = false, required = false, readOnly = false, id, name, mask, maskChar = "_", useCurrency = false, currency = "USD", locale = "en-US", minFractionDigits = 0, maxFractionDigits = 2, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledby, classNames
|
|
1722
|
+
var Input = ({ children, variant = "none", type = "text", inputSize = "md", placeholder, value: controlledValue, onChange, onFocus, onBlur, disabled = false, required = false, readOnly = false, id, name, mask, maskChar = "_", useCurrency = false, currency = "USD", locale = "en-US", minFractionDigits = 0, maxFractionDigits = 2, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledby, classNames, styles, className: extraClassName = "", style: extraStyle = {}, ...props }) => {
|
|
1698
1723
|
const inputId = id || name;
|
|
1699
1724
|
const finalClassNames = {
|
|
1700
1725
|
container: "luna-input",
|
|
1701
1726
|
input: "luna-input-field",
|
|
1702
1727
|
label: "luna-input-label",
|
|
1703
|
-
|
|
1728
|
+
classNames
|
|
1704
1729
|
};
|
|
1705
1730
|
const [internalValue, setInternalValue] = useState(controlledValue || "");
|
|
1706
1731
|
useEffect(() => {
|
|
@@ -1806,7 +1831,7 @@ var Input = ({ children, variant = "none", type = "text", inputSize = "md", plac
|
|
|
1806
1831
|
};
|
|
1807
1832
|
//#endregion
|
|
1808
1833
|
//#region src/components/DataTable.tsx
|
|
1809
|
-
var DataTable = ({ columns, data, pagination = false, pageSize = 10, selectable = false, onSelectionChange, onRowClick, onRowDoubleClick, searchable = false, texts = {}, classNames
|
|
1834
|
+
var DataTable = ({ columns, data, pagination = false, pageSize = 10, selectable = false, onSelectionChange, onRowClick, onRowDoubleClick, searchable = false, texts = {}, classNames, styles, className }) => {
|
|
1810
1835
|
const finalClassNames = {
|
|
1811
1836
|
container: "luna-datatable",
|
|
1812
1837
|
table: "luna-datatable-table",
|
|
@@ -1817,7 +1842,7 @@ var DataTable = ({ columns, data, pagination = false, pageSize = 10, selectable
|
|
|
1817
1842
|
td: "luna-datatable-td",
|
|
1818
1843
|
pagination: "luna-datatable-pagination",
|
|
1819
1844
|
searchContainer: "luna-datatable-search",
|
|
1820
|
-
|
|
1845
|
+
classNames
|
|
1821
1846
|
};
|
|
1822
1847
|
const [currentPage, setCurrentPage] = useState(1);
|
|
1823
1848
|
const [sortConfig, setSortConfig] = useState(null);
|
|
@@ -1979,7 +2004,6 @@ var DataTable = ({ columns, data, pagination = false, pageSize = 10, selectable
|
|
|
1979
2004
|
})
|
|
1980
2005
|
}, col.key))] })
|
|
1981
2006
|
}), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("tbody", {
|
|
1982
|
-
style: styles.tbody,
|
|
1983
2007
|
className: finalClassNames.tbody,
|
|
1984
2008
|
children: paginatedData.length > 0 ? paginatedData.map((row, idx) => {
|
|
1985
2009
|
const rowId = row.id || row._id || JSON.stringify(row);
|
|
@@ -2073,7 +2097,7 @@ var DataTable = ({ columns, data, pagination = false, pageSize = 10, selectable
|
|
|
2073
2097
|
};
|
|
2074
2098
|
//#endregion
|
|
2075
2099
|
//#region src/components/Toast.tsx
|
|
2076
|
-
var Toast = ({ visible, severity = "info", summary, detail, life, onClose, position = "top-right", classNames
|
|
2100
|
+
var Toast = ({ visible, severity = "info", summary, detail, life, onClose, position = "top-right", classNames, styles, className }) => {
|
|
2077
2101
|
const finalClassNames = {
|
|
2078
2102
|
container: "luna-toast",
|
|
2079
2103
|
content: "luna-toast-content",
|
|
@@ -2081,7 +2105,7 @@ var Toast = ({ visible, severity = "info", summary, detail, life, onClose, posit
|
|
|
2081
2105
|
summary: "luna-toast-summary",
|
|
2082
2106
|
detail: "luna-toast-detail",
|
|
2083
2107
|
closeButton: "luna-toast-close",
|
|
2084
|
-
|
|
2108
|
+
classNames
|
|
2085
2109
|
};
|
|
2086
2110
|
const [isExiting, setIsExiting] = useState(false);
|
|
2087
2111
|
useEffect(() => {
|
|
@@ -2104,19 +2128,19 @@ var Toast = ({ visible, severity = "info", summary, detail, life, onClose, posit
|
|
|
2104
2128
|
const uiStyles = toastStyles(styles, severity, position, isExiting, visible);
|
|
2105
2129
|
const config = toastSeverityConfig[severity || "info"];
|
|
2106
2130
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
2107
|
-
className: `${finalClassNames
|
|
2131
|
+
className: `${finalClassNames?.container} ${className || ""}`.trim(),
|
|
2108
2132
|
style: uiStyles.container,
|
|
2109
2133
|
children: [
|
|
2110
2134
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
2111
|
-
className: finalClassNames
|
|
2135
|
+
className: finalClassNames?.icon,
|
|
2112
2136
|
style: uiStyles.iconWrapper,
|
|
2113
2137
|
children: config.icon
|
|
2114
2138
|
}),
|
|
2115
2139
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
2116
|
-
className: finalClassNames
|
|
2140
|
+
className: finalClassNames?.content,
|
|
2117
2141
|
style: uiStyles.content,
|
|
2118
2142
|
children: [summary && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
|
|
2119
|
-
className: finalClassNames
|
|
2143
|
+
className: finalClassNames?.summary,
|
|
2120
2144
|
style: uiStyles.summary,
|
|
2121
2145
|
children: summary
|
|
2122
2146
|
}), detail && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
@@ -2138,7 +2162,7 @@ var Toast = ({ visible, severity = "info", summary, detail, life, onClose, posit
|
|
|
2138
2162
|
};
|
|
2139
2163
|
//#endregion
|
|
2140
2164
|
//#region src/components/MultiSelect.tsx
|
|
2141
|
-
var MultiSelect = ({ options, value = [], onChange, id, placeholder = "Select Items", display = "comma", filter = true, filterPlaceholder = "Search...", selectAll = true, maxSelectedLabels = 3, classNames
|
|
2165
|
+
var MultiSelect = ({ options, value = [], onChange, id, placeholder = "Select Items", display = "comma", filter = true, filterPlaceholder = "Search...", selectAll = true, maxSelectedLabels = 3, classNames, styles, disabled = false }) => {
|
|
2142
2166
|
const finalClassNames = {
|
|
2143
2167
|
container: "luna-multiselect",
|
|
2144
2168
|
trigger: "luna-multiselect-trigger",
|
|
@@ -2146,7 +2170,7 @@ var MultiSelect = ({ options, value = [], onChange, id, placeholder = "Select It
|
|
|
2146
2170
|
header: "luna-multiselect-header",
|
|
2147
2171
|
item: "luna-multiselect-item",
|
|
2148
2172
|
chip: "luna-multiselect-chip",
|
|
2149
|
-
|
|
2173
|
+
classNames
|
|
2150
2174
|
};
|
|
2151
2175
|
const [isOpen, setIsOpen] = useState(false);
|
|
2152
2176
|
const [filterText, setFilterText] = useState("");
|
|
@@ -2202,7 +2226,7 @@ var MultiSelect = ({ options, value = [], onChange, id, placeholder = "Select It
|
|
|
2202
2226
|
const uiStyles = multiSelectStyles(styles, disabled, isOpen);
|
|
2203
2227
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
2204
2228
|
ref: containerRef,
|
|
2205
|
-
className: `${finalClassNames.container} ${
|
|
2229
|
+
className: `${finalClassNames.container} ${classNames || ""}`.trim(),
|
|
2206
2230
|
style: uiStyles.container,
|
|
2207
2231
|
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
2208
2232
|
className: finalClassNames.trigger,
|
|
@@ -2240,7 +2264,7 @@ var MultiSelect = ({ options, value = [], onChange, id, placeholder = "Select It
|
|
|
2240
2264
|
placeholder: filterPlaceholder,
|
|
2241
2265
|
value: filterText,
|
|
2242
2266
|
onChange: setFilterText,
|
|
2243
|
-
|
|
2267
|
+
className: "w-full"
|
|
2244
2268
|
})]
|
|
2245
2269
|
}), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
2246
2270
|
style: uiStyles.list,
|
|
@@ -2275,7 +2299,7 @@ var MultiSelect = ({ options, value = [], onChange, id, placeholder = "Select It
|
|
|
2275
2299
|
};
|
|
2276
2300
|
//#endregion
|
|
2277
2301
|
//#region src/components/Popconfirm.tsx
|
|
2278
|
-
var Popconfirm = ({ title, description, onConfirm, onCancel, okText = "Yes", cancelText = "No", position = "top", children, classNames
|
|
2302
|
+
var Popconfirm = ({ title, description, onConfirm, onCancel, okText = "Yes", cancelText = "No", position = "top", children, classNames, styles, disabled = false, className = "" }) => {
|
|
2279
2303
|
const finalClassNames = {
|
|
2280
2304
|
container: "luna-popconfirm",
|
|
2281
2305
|
popover: "luna-popconfirm-popover",
|
|
@@ -2284,7 +2308,7 @@ var Popconfirm = ({ title, description, onConfirm, onCancel, okText = "Yes", can
|
|
|
2284
2308
|
actions: "luna-popconfirm-actions",
|
|
2285
2309
|
okButton: "luna-popconfirm-ok",
|
|
2286
2310
|
cancelButton: "luna-popconfirm-cancel",
|
|
2287
|
-
|
|
2311
|
+
classNames
|
|
2288
2312
|
};
|
|
2289
2313
|
const [show, setShow] = useState(false);
|
|
2290
2314
|
const containerRef = useRef(null);
|
|
@@ -2358,11 +2382,11 @@ var Popconfirm = ({ title, description, onConfirm, onCancel, okText = "Yes", can
|
|
|
2358
2382
|
};
|
|
2359
2383
|
//#endregion
|
|
2360
2384
|
//#region src/components/QRCode.tsx
|
|
2361
|
-
var QRCode = ({ value, size = 160, color = "000000", bgColor = "ffffff", bordered = true, classNames
|
|
2385
|
+
var QRCode = ({ value, size = 160, color = "000000", bgColor = "ffffff", bordered = true, classNames, styles, errorCorrectionLevel = "M", className }) => {
|
|
2362
2386
|
const finalClassNames = {
|
|
2363
2387
|
container: "luna-qrcode",
|
|
2364
2388
|
image: "luna-qrcode-image",
|
|
2365
|
-
|
|
2389
|
+
classNames
|
|
2366
2390
|
};
|
|
2367
2391
|
const [isLoading, setIsLoading] = useState(true);
|
|
2368
2392
|
const cleanColor = color.startsWith("#") ? color.slice(1) : color;
|