@scripso-homepad/ui 0.4.8 → 0.4.9
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/{chunk-DAOLVE64.js → chunk-YSDLHEJ7.js} +204 -14
- package/dist/chunk-YSDLHEJ7.js.map +1 -0
- package/dist/index.cjs +7 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +61 -247
- package/dist/index.js.map +1 -1
- package/dist/web/index.cjs +474 -13
- package/dist/web/index.cjs.map +1 -1
- package/dist/web/index.d.cts +43 -3
- package/dist/web/index.d.ts +43 -3
- package/dist/web/index.js +245 -2
- package/dist/web/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/Button.tsx +10 -3
- package/src/components/Select.tsx +1 -1
- package/src/web/components/ConfirmModal.stories.tsx +55 -0
- package/src/web/components/ConfirmModal.tsx +116 -0
- package/src/web/components/Modal.stories.tsx +130 -0
- package/src/web/components/Modal.tsx +162 -0
- package/src/web/components/TableActionButton.tsx +6 -1
- package/src/web/index.ts +6 -0
- package/dist/chunk-DAOLVE64.js.map +0 -1
package/dist/web/index.cjs
CHANGED
|
@@ -9459,15 +9459,15 @@ var require_react_dom_development = __commonJS({
|
|
|
9459
9459
|
};
|
|
9460
9460
|
}
|
|
9461
9461
|
var warnValidStyle$1 = warnValidStyle;
|
|
9462
|
-
function createDangerousStringForStyles(
|
|
9462
|
+
function createDangerousStringForStyles(styles4) {
|
|
9463
9463
|
{
|
|
9464
9464
|
var serialized = "";
|
|
9465
9465
|
var delimiter = "";
|
|
9466
|
-
for (var styleName in
|
|
9467
|
-
if (!
|
|
9466
|
+
for (var styleName in styles4) {
|
|
9467
|
+
if (!styles4.hasOwnProperty(styleName)) {
|
|
9468
9468
|
continue;
|
|
9469
9469
|
}
|
|
9470
|
-
var styleValue =
|
|
9470
|
+
var styleValue = styles4[styleName];
|
|
9471
9471
|
if (styleValue != null) {
|
|
9472
9472
|
var isCustomProperty = styleName.indexOf("--") === 0;
|
|
9473
9473
|
serialized += delimiter + (isCustomProperty ? styleName : hyphenateStyleName(styleName)) + ":";
|
|
@@ -9478,19 +9478,19 @@ var require_react_dom_development = __commonJS({
|
|
|
9478
9478
|
return serialized || null;
|
|
9479
9479
|
}
|
|
9480
9480
|
}
|
|
9481
|
-
function setValueForStyles(node,
|
|
9481
|
+
function setValueForStyles(node, styles4) {
|
|
9482
9482
|
var style2 = node.style;
|
|
9483
|
-
for (var styleName in
|
|
9484
|
-
if (!
|
|
9483
|
+
for (var styleName in styles4) {
|
|
9484
|
+
if (!styles4.hasOwnProperty(styleName)) {
|
|
9485
9485
|
continue;
|
|
9486
9486
|
}
|
|
9487
9487
|
var isCustomProperty = styleName.indexOf("--") === 0;
|
|
9488
9488
|
{
|
|
9489
9489
|
if (!isCustomProperty) {
|
|
9490
|
-
warnValidStyle$1(styleName,
|
|
9490
|
+
warnValidStyle$1(styleName, styles4[styleName]);
|
|
9491
9491
|
}
|
|
9492
9492
|
}
|
|
9493
|
-
var styleValue = dangerousStyleValue(styleName,
|
|
9493
|
+
var styleValue = dangerousStyleValue(styleName, styles4[styleName], isCustomProperty);
|
|
9494
9494
|
if (styleName === "float") {
|
|
9495
9495
|
styleName = "cssFloat";
|
|
9496
9496
|
}
|
|
@@ -9504,9 +9504,9 @@ var require_react_dom_development = __commonJS({
|
|
|
9504
9504
|
function isValueEmpty(value) {
|
|
9505
9505
|
return value == null || typeof value === "boolean" || value === "";
|
|
9506
9506
|
}
|
|
9507
|
-
function expandShorthandMap(
|
|
9507
|
+
function expandShorthandMap(styles4) {
|
|
9508
9508
|
var expanded = {};
|
|
9509
|
-
for (var key in
|
|
9509
|
+
for (var key in styles4) {
|
|
9510
9510
|
var longhands = shorthandToLonghand[key] || [key];
|
|
9511
9511
|
for (var i = 0; i < longhands.length; i++) {
|
|
9512
9512
|
expanded[longhands[i]] = key;
|
|
@@ -28568,6 +28568,7 @@ function EyeOffIcon({
|
|
|
28568
28568
|
|
|
28569
28569
|
// src/theme/tokens.ts
|
|
28570
28570
|
var stormGray = {
|
|
28571
|
+
"0": "#fbfcfc",
|
|
28571
28572
|
"0.5": "#eceef0",
|
|
28572
28573
|
"1.5": "#c7cdd1",
|
|
28573
28574
|
"2": "#b5bcc1",
|
|
@@ -28579,15 +28580,21 @@ var navy = {
|
|
|
28579
28580
|
var rubyRed = {
|
|
28580
28581
|
"0.5": "#f7dddf",
|
|
28581
28582
|
"5": "#ae0011"};
|
|
28583
|
+
var emeraldGreen = {
|
|
28584
|
+
"5": "#279d54"};
|
|
28582
28585
|
var brand = {
|
|
28583
28586
|
slateBlue: "#182e3c",
|
|
28584
28587
|
navy: navy["5"],
|
|
28585
|
-
rubyRed: rubyRed["5"]
|
|
28588
|
+
rubyRed: rubyRed["5"],
|
|
28589
|
+
emeraldGreen: emeraldGreen["5"]
|
|
28590
|
+
};
|
|
28586
28591
|
var colors = {
|
|
28587
28592
|
// Brand colors
|
|
28588
28593
|
slateBlue: brand.slateBlue,
|
|
28589
28594
|
/** Primary brand navy — Figma Navy 5 */
|
|
28590
28595
|
navy: brand.navy,
|
|
28596
|
+
// Storm Gray — Figma scale + brand swatch
|
|
28597
|
+
stormGray0: stormGray["0"],
|
|
28591
28598
|
stormGray50: stormGray["0.5"],
|
|
28592
28599
|
stormGray150: stormGray["1.5"],
|
|
28593
28600
|
stormGray200: stormGray["2"],
|
|
@@ -28598,6 +28605,8 @@ var colors = {
|
|
|
28598
28605
|
inputError: brand.rubyRed,
|
|
28599
28606
|
inputOutlineFocus: navy["0.5"],
|
|
28600
28607
|
inputOutlineError: rubyRed["0.5"],
|
|
28608
|
+
/** @deprecated Use `emeraldGreen` */
|
|
28609
|
+
green: brand.emeraldGreen,
|
|
28601
28610
|
transparent: "transparent"
|
|
28602
28611
|
};
|
|
28603
28612
|
var radii = {
|
|
@@ -28608,7 +28617,8 @@ var fontSize = {
|
|
|
28608
28617
|
sm: 12,
|
|
28609
28618
|
md: 14};
|
|
28610
28619
|
var fontWeight = {
|
|
28611
|
-
medium: "500"
|
|
28620
|
+
medium: "500",
|
|
28621
|
+
semibold: "600"};
|
|
28612
28622
|
var fonts = {
|
|
28613
28623
|
sans: "Noto Sans Armenian"
|
|
28614
28624
|
};
|
|
@@ -28619,6 +28629,22 @@ var labelTypography = {
|
|
|
28619
28629
|
lineHeight: fontSize.sm,
|
|
28620
28630
|
letterSpacing: 0
|
|
28621
28631
|
};
|
|
28632
|
+
var buttonTypography = {
|
|
28633
|
+
lg: {
|
|
28634
|
+
fontFamily: fonts.sans,
|
|
28635
|
+
fontSize: 14,
|
|
28636
|
+
fontWeight: fontWeight.semibold,
|
|
28637
|
+
lineHeight: 19,
|
|
28638
|
+
letterSpacing: 0
|
|
28639
|
+
},
|
|
28640
|
+
sm: {
|
|
28641
|
+
fontFamily: fonts.sans,
|
|
28642
|
+
fontSize: 12,
|
|
28643
|
+
fontWeight: fontWeight.semibold,
|
|
28644
|
+
lineHeight: 16,
|
|
28645
|
+
letterSpacing: 0
|
|
28646
|
+
}
|
|
28647
|
+
};
|
|
28622
28648
|
|
|
28623
28649
|
// src/theme/input.ts
|
|
28624
28650
|
var INPUT_HEIGHT = 52;
|
|
@@ -30340,6 +30366,7 @@ var TableActionButton = react.forwardRef(
|
|
|
30340
30366
|
...props
|
|
30341
30367
|
}, ref) {
|
|
30342
30368
|
const isInlineAction = variant === "approve" || variant === "reject";
|
|
30369
|
+
const hasLabel = Boolean(children);
|
|
30343
30370
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
30344
30371
|
"button",
|
|
30345
30372
|
{
|
|
@@ -30350,6 +30377,7 @@ var TableActionButton = react.forwardRef(
|
|
|
30350
30377
|
"aria-label": ariaLabel,
|
|
30351
30378
|
className: cn(
|
|
30352
30379
|
variantClasses[variant],
|
|
30380
|
+
isInlineAction && !hasLabel && "px-2",
|
|
30353
30381
|
disabled && "cursor-not-allowed opacity-50",
|
|
30354
30382
|
className
|
|
30355
30383
|
),
|
|
@@ -30738,6 +30766,437 @@ function TableIconText({ icon, children, className }) {
|
|
|
30738
30766
|
}
|
|
30739
30767
|
);
|
|
30740
30768
|
}
|
|
30769
|
+
|
|
30770
|
+
// src/icons/arrowUpRightPath.ts
|
|
30771
|
+
var ARROW_UP_RIGHT_PATH = "M14.1667 14.1668V5.8335H5.83333M14.1667 5.8335L5.83333 14.1668";
|
|
30772
|
+
function ArrowUpRightIcon({
|
|
30773
|
+
size = 20,
|
|
30774
|
+
color = "#082640",
|
|
30775
|
+
strokeWidth = 2
|
|
30776
|
+
}) {
|
|
30777
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Svg__default.default, { width: size, height: size, viewBox: "0 0 20 20", fill: "none", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
30778
|
+
Svg.Path,
|
|
30779
|
+
{
|
|
30780
|
+
d: ARROW_UP_RIGHT_PATH,
|
|
30781
|
+
stroke: color,
|
|
30782
|
+
strokeWidth,
|
|
30783
|
+
strokeLinecap: "round",
|
|
30784
|
+
strokeLinejoin: "round"
|
|
30785
|
+
}
|
|
30786
|
+
) });
|
|
30787
|
+
}
|
|
30788
|
+
var variantConfig = {
|
|
30789
|
+
white: {
|
|
30790
|
+
backgroundColor: colors.white,
|
|
30791
|
+
textColor: colors.slateBlue,
|
|
30792
|
+
iconBadgeBackgroundColor: colors.stormGray150,
|
|
30793
|
+
iconColor: colors.navy
|
|
30794
|
+
},
|
|
30795
|
+
primary: {
|
|
30796
|
+
backgroundColor: colors.navy,
|
|
30797
|
+
textColor: colors.stormGray0,
|
|
30798
|
+
iconBadgeBackgroundColor: colors.white,
|
|
30799
|
+
iconColor: colors.navy
|
|
30800
|
+
},
|
|
30801
|
+
green: {
|
|
30802
|
+
backgroundColor: colors.green,
|
|
30803
|
+
textColor: colors.stormGray0,
|
|
30804
|
+
iconBadgeBackgroundColor: colors.white,
|
|
30805
|
+
iconColor: colors.green
|
|
30806
|
+
},
|
|
30807
|
+
gray: {
|
|
30808
|
+
backgroundColor: colors.stormGray50,
|
|
30809
|
+
textColor: colors.slateBlue,
|
|
30810
|
+
iconBadgeBackgroundColor: colors.stormGray150,
|
|
30811
|
+
iconColor: colors.navy
|
|
30812
|
+
}
|
|
30813
|
+
};
|
|
30814
|
+
var sizeConfig = {
|
|
30815
|
+
lg: {
|
|
30816
|
+
borderRadius: 16,
|
|
30817
|
+
paddingTop: 8,
|
|
30818
|
+
paddingRight: 8,
|
|
30819
|
+
paddingBottom: 8,
|
|
30820
|
+
paddingLeft: 24,
|
|
30821
|
+
paddingHorizontalCentered: 24,
|
|
30822
|
+
text: buttonTypography.lg,
|
|
30823
|
+
iconContainerSize: 36,
|
|
30824
|
+
iconContainerRadius: 12,
|
|
30825
|
+
iconContainerPadding: 8,
|
|
30826
|
+
iconSize: 20
|
|
30827
|
+
},
|
|
30828
|
+
sm: {
|
|
30829
|
+
borderRadius: 12,
|
|
30830
|
+
paddingTop: 8,
|
|
30831
|
+
paddingRight: 8,
|
|
30832
|
+
paddingBottom: 8,
|
|
30833
|
+
paddingLeft: 16,
|
|
30834
|
+
paddingHorizontalCentered: 16,
|
|
30835
|
+
text: buttonTypography.sm,
|
|
30836
|
+
iconContainerSize: 32,
|
|
30837
|
+
iconContainerRadius: 8,
|
|
30838
|
+
iconContainerPadding: 8,
|
|
30839
|
+
iconSize: 16
|
|
30840
|
+
}
|
|
30841
|
+
};
|
|
30842
|
+
function Button({
|
|
30843
|
+
title,
|
|
30844
|
+
children,
|
|
30845
|
+
onPress,
|
|
30846
|
+
disabled = false,
|
|
30847
|
+
variant = "primary",
|
|
30848
|
+
size = "lg",
|
|
30849
|
+
showIcon = false,
|
|
30850
|
+
icon,
|
|
30851
|
+
style,
|
|
30852
|
+
textStyle,
|
|
30853
|
+
className,
|
|
30854
|
+
textClassName
|
|
30855
|
+
}) {
|
|
30856
|
+
const containerRef = react.useRef(null);
|
|
30857
|
+
const textRef = react.useRef(null);
|
|
30858
|
+
const preset = variantConfig[variant];
|
|
30859
|
+
const metrics = sizeConfig[size];
|
|
30860
|
+
const label = typeof children !== "undefined" ? children : title;
|
|
30861
|
+
const hasCustomChildren = typeof children !== "undefined";
|
|
30862
|
+
const customIcon = icon != null && typeof icon !== "boolean" ? icon : void 0;
|
|
30863
|
+
const hasIcon = showIcon || icon === true || customIcon != null;
|
|
30864
|
+
const resolvedContainerClassName = [
|
|
30865
|
+
reactNative.Platform.OS === "web" ? "max-md:px-4!" : "",
|
|
30866
|
+
className
|
|
30867
|
+
].filter(Boolean).join(" ");
|
|
30868
|
+
useApplyWebClassName(containerRef, resolvedContainerClassName || void 0);
|
|
30869
|
+
useApplyWebClassName(textRef, textClassName);
|
|
30870
|
+
const iconNode = customIcon ?? /* @__PURE__ */ jsxRuntime.jsx(ArrowUpRightIcon, { size: metrics.iconSize, color: preset.iconColor });
|
|
30871
|
+
const containerStyle = [
|
|
30872
|
+
styles3.base,
|
|
30873
|
+
{
|
|
30874
|
+
borderRadius: metrics.borderRadius,
|
|
30875
|
+
backgroundColor: preset.backgroundColor,
|
|
30876
|
+
paddingTop: metrics.paddingTop,
|
|
30877
|
+
paddingBottom: metrics.paddingBottom,
|
|
30878
|
+
paddingLeft: hasIcon ? metrics.paddingLeft : metrics.paddingHorizontalCentered,
|
|
30879
|
+
paddingRight: hasIcon ? metrics.paddingRight : metrics.paddingHorizontalCentered
|
|
30880
|
+
},
|
|
30881
|
+
hasIcon ? styles3.withIcon : styles3.centered,
|
|
30882
|
+
disabled && styles3.disabled,
|
|
30883
|
+
style
|
|
30884
|
+
];
|
|
30885
|
+
const labelStyle = [
|
|
30886
|
+
styles3.label,
|
|
30887
|
+
metrics.text,
|
|
30888
|
+
{ color: preset.textColor },
|
|
30889
|
+
reactNative.Platform.OS === "android" ? styles3.labelAndroid : null,
|
|
30890
|
+
!hasIcon && styles3.labelCentered,
|
|
30891
|
+
hasIcon && styles3.labelWithIcon,
|
|
30892
|
+
textStyle
|
|
30893
|
+
];
|
|
30894
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
30895
|
+
reactNative.TouchableOpacity,
|
|
30896
|
+
{
|
|
30897
|
+
ref: containerRef,
|
|
30898
|
+
style: containerStyle,
|
|
30899
|
+
onPress,
|
|
30900
|
+
disabled,
|
|
30901
|
+
activeOpacity: 0.7,
|
|
30902
|
+
accessibilityRole: "button",
|
|
30903
|
+
accessibilityState: { disabled },
|
|
30904
|
+
children: [
|
|
30905
|
+
hasCustomChildren ? children : /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { ref: textRef, style: labelStyle, children: label }),
|
|
30906
|
+
hasIcon ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
30907
|
+
reactNative.View,
|
|
30908
|
+
{
|
|
30909
|
+
style: [
|
|
30910
|
+
styles3.iconContainer,
|
|
30911
|
+
{
|
|
30912
|
+
width: metrics.iconContainerSize,
|
|
30913
|
+
height: metrics.iconContainerSize,
|
|
30914
|
+
borderRadius: metrics.iconContainerRadius,
|
|
30915
|
+
padding: metrics.iconContainerPadding,
|
|
30916
|
+
backgroundColor: preset.iconBadgeBackgroundColor
|
|
30917
|
+
}
|
|
30918
|
+
],
|
|
30919
|
+
children: iconNode
|
|
30920
|
+
}
|
|
30921
|
+
) : null
|
|
30922
|
+
]
|
|
30923
|
+
}
|
|
30924
|
+
);
|
|
30925
|
+
}
|
|
30926
|
+
var styles3 = reactNative.StyleSheet.create({
|
|
30927
|
+
base: {
|
|
30928
|
+
flexDirection: "row",
|
|
30929
|
+
alignItems: "center",
|
|
30930
|
+
borderWidth: 0
|
|
30931
|
+
},
|
|
30932
|
+
centered: {
|
|
30933
|
+
justifyContent: "center"
|
|
30934
|
+
},
|
|
30935
|
+
withIcon: {
|
|
30936
|
+
justifyContent: "space-between"
|
|
30937
|
+
},
|
|
30938
|
+
disabled: {
|
|
30939
|
+
opacity: 0.6
|
|
30940
|
+
},
|
|
30941
|
+
label: {},
|
|
30942
|
+
labelAndroid: {
|
|
30943
|
+
includeFontPadding: false
|
|
30944
|
+
},
|
|
30945
|
+
labelCentered: {
|
|
30946
|
+
textAlign: "center"
|
|
30947
|
+
},
|
|
30948
|
+
labelWithIcon: {
|
|
30949
|
+
flex: 1,
|
|
30950
|
+
flexShrink: 1,
|
|
30951
|
+
marginRight: 8
|
|
30952
|
+
},
|
|
30953
|
+
iconContainer: {
|
|
30954
|
+
alignItems: "center",
|
|
30955
|
+
justifyContent: "center",
|
|
30956
|
+
flexShrink: 0
|
|
30957
|
+
}
|
|
30958
|
+
});
|
|
30959
|
+
var footerAlignClasses = {
|
|
30960
|
+
left: "justify-start",
|
|
30961
|
+
center: "justify-center",
|
|
30962
|
+
right: "justify-end"
|
|
30963
|
+
};
|
|
30964
|
+
function Modal({
|
|
30965
|
+
open,
|
|
30966
|
+
title,
|
|
30967
|
+
subtitle,
|
|
30968
|
+
icon,
|
|
30969
|
+
iconContainerClassName,
|
|
30970
|
+
children,
|
|
30971
|
+
cancelText,
|
|
30972
|
+
confirmText,
|
|
30973
|
+
onCancel,
|
|
30974
|
+
onConfirm,
|
|
30975
|
+
footerAlign = "right",
|
|
30976
|
+
footerLayout = "inline",
|
|
30977
|
+
cancelDisabled = false,
|
|
30978
|
+
confirmDisabled = false,
|
|
30979
|
+
closeOnBackdrop = true,
|
|
30980
|
+
containerClassName,
|
|
30981
|
+
contentClassName,
|
|
30982
|
+
buttonClassName
|
|
30983
|
+
}) {
|
|
30984
|
+
react.useEffect(() => {
|
|
30985
|
+
if (!open) {
|
|
30986
|
+
return;
|
|
30987
|
+
}
|
|
30988
|
+
const handleKeyDown = (event) => {
|
|
30989
|
+
if (event.key === "Escape") {
|
|
30990
|
+
onCancel();
|
|
30991
|
+
}
|
|
30992
|
+
};
|
|
30993
|
+
window.addEventListener("keydown", handleKeyDown);
|
|
30994
|
+
return () => {
|
|
30995
|
+
window.removeEventListener("keydown", handleKeyDown);
|
|
30996
|
+
};
|
|
30997
|
+
}, [open, onCancel]);
|
|
30998
|
+
if (!open) {
|
|
30999
|
+
return null;
|
|
31000
|
+
}
|
|
31001
|
+
const sharedButtonClassName = cn(
|
|
31002
|
+
"btn h-13 justify-center!",
|
|
31003
|
+
footerLayout === "split" && "min-w-0 flex-1",
|
|
31004
|
+
buttonClassName
|
|
31005
|
+
);
|
|
31006
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
31007
|
+
"div",
|
|
31008
|
+
{
|
|
31009
|
+
className: "fixed inset-0 z-50 flex items-center justify-center p-4 backdrop-blur-[12px] bg-storm-gray-850/40",
|
|
31010
|
+
onClick: closeOnBackdrop ? onCancel : void 0,
|
|
31011
|
+
role: "presentation",
|
|
31012
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
31013
|
+
"div",
|
|
31014
|
+
{
|
|
31015
|
+
role: "dialog",
|
|
31016
|
+
"aria-modal": "true",
|
|
31017
|
+
"aria-labelledby": "homepad-modal-title",
|
|
31018
|
+
...subtitle ? { "aria-describedby": "homepad-modal-subtitle" } : {},
|
|
31019
|
+
className: cn(
|
|
31020
|
+
"flex w-full max-w-2xl flex-col gap-6 rounded-2xl bg-white p-4 opacity-100 md:p-6",
|
|
31021
|
+
containerClassName
|
|
31022
|
+
),
|
|
31023
|
+
onClick: (event) => {
|
|
31024
|
+
event.stopPropagation();
|
|
31025
|
+
},
|
|
31026
|
+
children: [
|
|
31027
|
+
/* @__PURE__ */ jsxRuntime.jsxs("header", { className: cn("flex", icon ? "items-center gap-2.5" : void 0), children: [
|
|
31028
|
+
icon ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
31029
|
+
"div",
|
|
31030
|
+
{
|
|
31031
|
+
className: cn(
|
|
31032
|
+
"flex size-11 shrink-0 items-center justify-center rounded-lg bg-storm-gray-50 p-3 opacity-100",
|
|
31033
|
+
iconContainerClassName
|
|
31034
|
+
),
|
|
31035
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex size-5 shrink-0 items-center justify-center [&>*]:size-5 [&_svg]:size-5", children: icon })
|
|
31036
|
+
}
|
|
31037
|
+
) : null,
|
|
31038
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex min-w-0 flex-col gap-2", children: [
|
|
31039
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
31040
|
+
"h2",
|
|
31041
|
+
{
|
|
31042
|
+
id: "homepad-modal-title",
|
|
31043
|
+
className: "font-sans text-lg font-bold leading-none tracking-normal text-black",
|
|
31044
|
+
children: title
|
|
31045
|
+
}
|
|
31046
|
+
),
|
|
31047
|
+
subtitle ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
31048
|
+
"p",
|
|
31049
|
+
{
|
|
31050
|
+
id: "homepad-modal-subtitle",
|
|
31051
|
+
className: "font-sans text-xs font-normal leading-none tracking-normal text-storm-gray-400",
|
|
31052
|
+
children: subtitle
|
|
31053
|
+
}
|
|
31054
|
+
) : null
|
|
31055
|
+
] })
|
|
31056
|
+
] }),
|
|
31057
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("min-w-0", contentClassName), children }),
|
|
31058
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
31059
|
+
"footer",
|
|
31060
|
+
{
|
|
31061
|
+
className: cn(
|
|
31062
|
+
"flex gap-4",
|
|
31063
|
+
footerLayout === "split" ? "w-full" : footerAlignClasses[footerAlign]
|
|
31064
|
+
),
|
|
31065
|
+
children: [
|
|
31066
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
31067
|
+
Button,
|
|
31068
|
+
{
|
|
31069
|
+
title: cancelText,
|
|
31070
|
+
onPress: onCancel,
|
|
31071
|
+
variant: "gray",
|
|
31072
|
+
disabled: cancelDisabled,
|
|
31073
|
+
className: sharedButtonClassName,
|
|
31074
|
+
textClassName: "text-center!"
|
|
31075
|
+
}
|
|
31076
|
+
),
|
|
31077
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
31078
|
+
Button,
|
|
31079
|
+
{
|
|
31080
|
+
title: confirmText,
|
|
31081
|
+
onPress: onConfirm,
|
|
31082
|
+
variant: "primary",
|
|
31083
|
+
disabled: confirmDisabled,
|
|
31084
|
+
className: sharedButtonClassName,
|
|
31085
|
+
textClassName: "text-center!"
|
|
31086
|
+
}
|
|
31087
|
+
)
|
|
31088
|
+
]
|
|
31089
|
+
}
|
|
31090
|
+
)
|
|
31091
|
+
]
|
|
31092
|
+
}
|
|
31093
|
+
)
|
|
31094
|
+
}
|
|
31095
|
+
);
|
|
31096
|
+
}
|
|
31097
|
+
function ConfirmModal({
|
|
31098
|
+
open,
|
|
31099
|
+
title,
|
|
31100
|
+
description,
|
|
31101
|
+
cancelText,
|
|
31102
|
+
confirmText,
|
|
31103
|
+
onCancel,
|
|
31104
|
+
onConfirm,
|
|
31105
|
+
cancelDisabled = false,
|
|
31106
|
+
confirmDisabled = false,
|
|
31107
|
+
closeOnBackdrop = true,
|
|
31108
|
+
containerClassName,
|
|
31109
|
+
buttonClassName
|
|
31110
|
+
}) {
|
|
31111
|
+
react.useEffect(() => {
|
|
31112
|
+
if (!open) {
|
|
31113
|
+
return;
|
|
31114
|
+
}
|
|
31115
|
+
const handleKeyDown = (event) => {
|
|
31116
|
+
if (event.key === "Escape") {
|
|
31117
|
+
onCancel();
|
|
31118
|
+
}
|
|
31119
|
+
};
|
|
31120
|
+
window.addEventListener("keydown", handleKeyDown);
|
|
31121
|
+
return () => {
|
|
31122
|
+
window.removeEventListener("keydown", handleKeyDown);
|
|
31123
|
+
};
|
|
31124
|
+
}, [open, onCancel]);
|
|
31125
|
+
if (!open) {
|
|
31126
|
+
return null;
|
|
31127
|
+
}
|
|
31128
|
+
const sharedButtonClassName = cn("btn h-10 min-w-0 flex-1 justify-center!", buttonClassName);
|
|
31129
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
31130
|
+
"div",
|
|
31131
|
+
{
|
|
31132
|
+
className: "fixed inset-0 z-50 flex items-center justify-center p-4 backdrop-blur-md bg-storm-gray-850/40",
|
|
31133
|
+
onClick: closeOnBackdrop ? onCancel : void 0,
|
|
31134
|
+
role: "presentation",
|
|
31135
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
31136
|
+
"div",
|
|
31137
|
+
{
|
|
31138
|
+
role: "dialog",
|
|
31139
|
+
"aria-modal": "true",
|
|
31140
|
+
"aria-labelledby": "homepad-confirm-modal-title",
|
|
31141
|
+
"aria-describedby": "homepad-confirm-modal-description",
|
|
31142
|
+
className: cn(
|
|
31143
|
+
"flex w-full max-w-md flex-col gap-8 rounded-2xl bg-white p-4 opacity-100 md:p-6",
|
|
31144
|
+
containerClassName
|
|
31145
|
+
),
|
|
31146
|
+
onClick: (event) => {
|
|
31147
|
+
event.stopPropagation();
|
|
31148
|
+
},
|
|
31149
|
+
children: [
|
|
31150
|
+
/* @__PURE__ */ jsxRuntime.jsxs("header", { className: "flex flex-col gap-3 text-center", children: [
|
|
31151
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
31152
|
+
"h2",
|
|
31153
|
+
{
|
|
31154
|
+
id: "homepad-confirm-modal-title",
|
|
31155
|
+
className: "font-sans text-xl font-bold leading-6.75 tracking-normal text-black",
|
|
31156
|
+
children: title
|
|
31157
|
+
}
|
|
31158
|
+
),
|
|
31159
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
31160
|
+
"div",
|
|
31161
|
+
{
|
|
31162
|
+
id: "homepad-confirm-modal-description",
|
|
31163
|
+
className: "text-center font-sans text-sm font-normal leading-4.75 tracking-normal text-storm-gray-400",
|
|
31164
|
+
children: description
|
|
31165
|
+
}
|
|
31166
|
+
)
|
|
31167
|
+
] }),
|
|
31168
|
+
/* @__PURE__ */ jsxRuntime.jsxs("footer", { className: "flex w-full gap-4", children: [
|
|
31169
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
31170
|
+
Button,
|
|
31171
|
+
{
|
|
31172
|
+
title: cancelText,
|
|
31173
|
+
onPress: onCancel,
|
|
31174
|
+
variant: "gray",
|
|
31175
|
+
size: "sm",
|
|
31176
|
+
disabled: cancelDisabled,
|
|
31177
|
+
className: sharedButtonClassName,
|
|
31178
|
+
textClassName: "text-center!"
|
|
31179
|
+
}
|
|
31180
|
+
),
|
|
31181
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
31182
|
+
Button,
|
|
31183
|
+
{
|
|
31184
|
+
title: confirmText,
|
|
31185
|
+
onPress: onConfirm,
|
|
31186
|
+
variant: "primary",
|
|
31187
|
+
size: "sm",
|
|
31188
|
+
disabled: confirmDisabled,
|
|
31189
|
+
className: sharedButtonClassName,
|
|
31190
|
+
textClassName: "text-center!"
|
|
31191
|
+
}
|
|
31192
|
+
)
|
|
31193
|
+
] })
|
|
31194
|
+
]
|
|
31195
|
+
}
|
|
31196
|
+
)
|
|
31197
|
+
}
|
|
31198
|
+
);
|
|
31199
|
+
}
|
|
30741
31200
|
/*! Bundled license information:
|
|
30742
31201
|
|
|
30743
31202
|
scheduler/cjs/scheduler.production.min.js:
|
|
@@ -30803,9 +31262,11 @@ exports.Badge = Badge;
|
|
|
30803
31262
|
exports.BellIcon = BellIcon;
|
|
30804
31263
|
exports.BuildingIcon = BuildingIcon;
|
|
30805
31264
|
exports.BuildingSelect = BuildingSelect;
|
|
31265
|
+
exports.ConfirmModal = ConfirmModal;
|
|
30806
31266
|
exports.DEFAULT_TABLE_BODY_MIN_HEIGHT = DEFAULT_TABLE_BODY_MIN_HEIGHT;
|
|
30807
31267
|
exports.DashboardLayout = DashboardLayout;
|
|
30808
31268
|
exports.DataTable = DataTable;
|
|
31269
|
+
exports.Modal = Modal;
|
|
30809
31270
|
exports.Pagination = Pagination;
|
|
30810
31271
|
exports.Sidebar = Sidebar;
|
|
30811
31272
|
exports.SidebarMobileHeader = SidebarMobileHeader;
|