@app-studio/web 0.8.40 → 0.8.42
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/components/Modal/Modal/Modal.layout.d.ts +1 -1
- package/dist/components/Modal/Modal/Modal.store.d.ts +10 -7
- package/dist/web.cjs.development.js +51 -49
- package/dist/web.cjs.development.js.map +1 -1
- package/dist/web.cjs.production.min.js +1 -1
- package/dist/web.cjs.production.min.js.map +1 -1
- package/dist/web.esm.js +51 -49
- package/dist/web.esm.js.map +1 -1
- package/dist/web.umd.development.js +51 -49
- package/dist/web.umd.development.js.map +1 -1
- package/dist/web.umd.production.min.js +1 -1
- package/dist/web.umd.production.min.js.map +1 -1
- package/package.json +4 -4
|
@@ -2390,7 +2390,7 @@
|
|
|
2390
2390
|
ariaLabel,
|
|
2391
2391
|
// Initializes default values for the ButtonProps object; useful for defining states like isAuto, isFilled, etc.
|
|
2392
2392
|
externalHref,
|
|
2393
|
-
isAuto,
|
|
2393
|
+
isAuto = false,
|
|
2394
2394
|
// Determines if button should be active based on isDisabled and isLoading properties.
|
|
2395
2395
|
isFilled = false,
|
|
2396
2396
|
// Prepares default properties for the native button element based on isActive state.
|
|
@@ -2468,7 +2468,8 @@
|
|
|
2468
2468
|
var buttonSizeStyles = ButtonSizes[size];
|
|
2469
2469
|
var buttonVariant = ButtonVariants[variant];
|
|
2470
2470
|
var scaleWidth = {
|
|
2471
|
-
|
|
2471
|
+
width: isAuto === true ? 'fit-content' : isFilled ? '100%' : buttonSizeStyles.width,
|
|
2472
|
+
minWidth: isAuto === true ? 'fit-content' : isFilled ? '100%' : buttonSizeStyles.width
|
|
2472
2473
|
};
|
|
2473
2474
|
var changePadding = isIconRounded ? IconSizes$1[size] : ButtonSizes[size];
|
|
2474
2475
|
var content = /*#__PURE__*/React__default.createElement(Horizontal, {
|
|
@@ -6616,46 +6617,51 @@
|
|
|
6616
6617
|
};
|
|
6617
6618
|
|
|
6618
6619
|
var useModalStore = /*#__PURE__*/zustand.create(set => ({
|
|
6619
|
-
|
|
6620
|
-
|
|
6621
|
-
isVisible: false
|
|
6622
|
-
},
|
|
6623
|
-
overlayProps: {},
|
|
6624
|
-
show: function show(modal, modalProps, overlayProps) {
|
|
6620
|
+
modals: [],
|
|
6621
|
+
show: function show(name, modalProps, overlayProps) {
|
|
6625
6622
|
if (modalProps === void 0) {
|
|
6626
6623
|
modalProps = {};
|
|
6627
6624
|
}
|
|
6628
6625
|
if (overlayProps === void 0) {
|
|
6629
6626
|
overlayProps = {};
|
|
6630
6627
|
}
|
|
6631
|
-
|
|
6632
|
-
|
|
6633
|
-
|
|
6634
|
-
|
|
6635
|
-
|
|
6636
|
-
|
|
6637
|
-
|
|
6628
|
+
set(state => ({
|
|
6629
|
+
modals: [...state.modals, {
|
|
6630
|
+
name,
|
|
6631
|
+
props: Object.assign({}, modalProps, {
|
|
6632
|
+
isVisible: true
|
|
6633
|
+
}),
|
|
6634
|
+
overlayProps
|
|
6635
|
+
}]
|
|
6638
6636
|
}));
|
|
6639
6637
|
},
|
|
6640
|
-
hide:
|
|
6641
|
-
set(state =>
|
|
6642
|
-
|
|
6643
|
-
|
|
6644
|
-
|
|
6645
|
-
|
|
6638
|
+
hide: name => {
|
|
6639
|
+
set(state => {
|
|
6640
|
+
if (!name) {
|
|
6641
|
+
// Hide all modals
|
|
6642
|
+
return {
|
|
6643
|
+
modals: []
|
|
6644
|
+
};
|
|
6645
|
+
}
|
|
6646
|
+
// Hide specific modal by name
|
|
6647
|
+
return {
|
|
6648
|
+
modals: state.modals.filter(modal => modal.name !== name)
|
|
6649
|
+
};
|
|
6650
|
+
});
|
|
6646
6651
|
}
|
|
6647
6652
|
}));
|
|
6648
|
-
var showModal = function showModal(
|
|
6653
|
+
var showModal = function showModal(name, modalProps, overlayProps) {
|
|
6649
6654
|
if (modalProps === void 0) {
|
|
6650
6655
|
modalProps = {};
|
|
6651
6656
|
}
|
|
6652
6657
|
if (overlayProps === void 0) {
|
|
6653
6658
|
overlayProps = {};
|
|
6654
6659
|
}
|
|
6655
|
-
useModalStore.getState().show(
|
|
6660
|
+
useModalStore.getState().show(name, modalProps, overlayProps);
|
|
6656
6661
|
};
|
|
6657
|
-
var hideModal =
|
|
6658
|
-
|
|
6662
|
+
var hideModal = name => {
|
|
6663
|
+
console.log('hideModal', name);
|
|
6664
|
+
useModalStore.getState().hide(typeof name === 'string' ? name : undefined);
|
|
6659
6665
|
};
|
|
6660
6666
|
|
|
6661
6667
|
var ContainerShapes = {
|
|
@@ -6825,33 +6831,29 @@
|
|
|
6825
6831
|
|
|
6826
6832
|
var ModalLayout = _ref => {
|
|
6827
6833
|
var {
|
|
6828
|
-
modals
|
|
6834
|
+
modals: availableModals
|
|
6829
6835
|
} = _ref;
|
|
6830
|
-
var
|
|
6831
|
-
|
|
6832
|
-
modal,
|
|
6833
|
-
modalProps,
|
|
6834
|
-
overlayProps
|
|
6835
|
-
} = _ref2;
|
|
6836
|
-
return {
|
|
6837
|
-
modal,
|
|
6838
|
-
modalProps,
|
|
6839
|
-
overlayProps
|
|
6840
|
-
};
|
|
6841
|
-
});
|
|
6842
|
-
if (typeof modalStore.modal === 'boolean') {
|
|
6843
|
-
return null;
|
|
6844
|
-
}
|
|
6845
|
-
var Modal = modals[modalStore.modal];
|
|
6846
|
-
if (!Modal) {
|
|
6847
|
-
console.error(modalStore.modal + " modal doesn't exist");
|
|
6836
|
+
var activeModals = useModalStore(state => state.modals);
|
|
6837
|
+
if (activeModals.length === 0) {
|
|
6848
6838
|
return null;
|
|
6849
6839
|
}
|
|
6850
|
-
return /*#__PURE__*/React__default.createElement(React.Fragment, null,
|
|
6851
|
-
|
|
6852
|
-
|
|
6853
|
-
|
|
6854
|
-
|
|
6840
|
+
return /*#__PURE__*/React__default.createElement(React.Fragment, null, activeModals.map((modal, index) => {
|
|
6841
|
+
var ModalComponent = availableModals[modal.name];
|
|
6842
|
+
if (!ModalComponent) {
|
|
6843
|
+
console.error(modal.name + " modal doesn't exist");
|
|
6844
|
+
return null;
|
|
6845
|
+
}
|
|
6846
|
+
return /*#__PURE__*/React__default.createElement(ModalOverlay, Object.assign({
|
|
6847
|
+
key: index,
|
|
6848
|
+
isOpen: modal.props.isVisible,
|
|
6849
|
+
onClose: () => hideModal(modal.name),
|
|
6850
|
+
blur: 5
|
|
6851
|
+
}, modal.overlayProps, {
|
|
6852
|
+
style: {
|
|
6853
|
+
zIndex: 1000 + index
|
|
6854
|
+
}
|
|
6855
|
+
}), /*#__PURE__*/React__default.createElement(ModalComponent, Object.assign({}, modal.props)));
|
|
6856
|
+
}));
|
|
6855
6857
|
};
|
|
6856
6858
|
|
|
6857
6859
|
/**
|