@app-studio/web 0.3.7 → 0.3.12
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/GlobalStyle.d.ts +2 -1
- package/dist/assets/svg/index.d.ts +2 -0
- package/dist/components/File/File.d.ts +8 -0
- package/dist/components/Form/Checkbox/Checkbox/Checkbox.state.d.ts +1 -1
- package/dist/components/Form/Form.d.ts +17 -0
- package/dist/components/Form/FormField.d.ts +10 -0
- package/dist/components/Form/Select/Select/Select.state.d.ts +1 -1
- package/dist/components/Form/TextArea/TextArea/TextArea.state.d.ts +1 -1
- package/dist/components/Form/TextField/TextField/TextField.props.d.ts +1 -1
- package/dist/components/Form/TextField/TextField/TextField.state.d.ts +1 -1
- package/dist/components/Layout/View/View.d.ts +7 -1
- package/dist/components/Message/Examples/CloseButtonMessage.d.ts +2 -0
- package/dist/components/Message/Examples/DefaultMessage.d.ts +2 -0
- package/dist/components/Message/Examples/VariantMessage.d.ts +2 -0
- package/dist/components/Message/Examples/index.d.ts +3 -0
- package/dist/components/Message/Message/Message.layout.d.ts +3 -0
- package/dist/components/Message/Message/Message.props.d.ts +115 -0
- package/dist/components/Message/Message/Message.store.d.ts +10 -0
- package/dist/components/Message/Message/Message.style.d.ts +5 -0
- package/dist/components/Message/Message/Message.view.d.ts +19 -0
- package/dist/components/Message/Message.d.ts +2 -0
- package/dist/components/Modal/Modal/Modal.layout.d.ts +3 -0
- package/dist/components/Modal/Modal/Modal.props.d.ts +9 -0
- package/dist/components/Modal/Modal/Modal.store.d.ts +11 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/pages/message.page.d.ts +3 -0
- package/dist/utils/form.d.ts +10 -0
- package/dist/web.cjs.development.js +144 -60
- 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 +130 -49
- package/dist/web.esm.js.map +1 -1
- package/package.json +7 -6
package/dist/web.esm.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import React, { useState, useRef, useEffect, useMemo, useCallback } from 'react';
|
|
2
|
-
import { View, Element, Typography, useTheme, Input } from 'app-studio';
|
|
3
|
-
export { View } from 'app-studio';
|
|
1
|
+
import React, { useState, useRef, useEffect, useMemo, useCallback, Fragment } from 'react';
|
|
2
|
+
import { View as View$1, Element, Typography, useTheme, Input, Image } from 'app-studio';
|
|
4
3
|
import { Link as Link$1 } from 'react-router-dom';
|
|
5
4
|
import format from 'date-fns/format';
|
|
6
5
|
import { create } from 'zustand';
|
|
@@ -52,6 +51,34 @@ var useLinkState = function useLinkState() {
|
|
|
52
51
|
};
|
|
53
52
|
};
|
|
54
53
|
|
|
54
|
+
var Top = function Top(props) {
|
|
55
|
+
return React.createElement(View$1, Object.assign({
|
|
56
|
+
marginBottom: "auto"
|
|
57
|
+
}, props));
|
|
58
|
+
};
|
|
59
|
+
var Bottom = function Bottom(props) {
|
|
60
|
+
return React.createElement(View$1, Object.assign({
|
|
61
|
+
marginTop: "auto"
|
|
62
|
+
}, props));
|
|
63
|
+
};
|
|
64
|
+
var Left = function Left(props) {
|
|
65
|
+
return React.createElement(View$1, Object.assign({
|
|
66
|
+
marginRight: "auto"
|
|
67
|
+
}, props));
|
|
68
|
+
};
|
|
69
|
+
var Right = function Right(props) {
|
|
70
|
+
return React.createElement(View$1, Object.assign({
|
|
71
|
+
marginLeft: "auto"
|
|
72
|
+
}, props));
|
|
73
|
+
};
|
|
74
|
+
var Inline = function Inline(props) {
|
|
75
|
+
return React.createElement(View$1, Object.assign({
|
|
76
|
+
display: 'inline-flex',
|
|
77
|
+
wordBreak: "break-word"
|
|
78
|
+
}, props));
|
|
79
|
+
};
|
|
80
|
+
var View = View$1;
|
|
81
|
+
|
|
55
82
|
var _excluded = ["children", "wrap", "justify", "isReversed"];
|
|
56
83
|
var HorizontalView = function HorizontalView(_ref) {
|
|
57
84
|
var children = _ref.children,
|
|
@@ -2306,7 +2333,7 @@ var VerticalView = function VerticalView(_ref) {
|
|
|
2306
2333
|
_ref$isReversed = _ref.isReversed,
|
|
2307
2334
|
isReversed = _ref$isReversed === void 0 ? false : _ref$isReversed,
|
|
2308
2335
|
props = _objectWithoutPropertiesLoose(_ref, _excluded$c);
|
|
2309
|
-
return React.createElement(View, Object.assign({
|
|
2336
|
+
return React.createElement(View$1, Object.assign({
|
|
2310
2337
|
display: "flex",
|
|
2311
2338
|
flexWrap: wrap,
|
|
2312
2339
|
flexDirection: isReversed ? 'column-reverse' : 'column',
|
|
@@ -2442,21 +2469,19 @@ var TextComponent = function TextComponent(props) {
|
|
|
2442
2469
|
*/
|
|
2443
2470
|
var Text = TextComponent;
|
|
2444
2471
|
|
|
2445
|
-
var _excluded$e = ["children", "styles"
|
|
2472
|
+
var _excluded$e = ["children", "styles"];
|
|
2446
2473
|
var HelperText = function HelperText(_ref) {
|
|
2447
2474
|
var children = _ref.children,
|
|
2448
2475
|
_ref$styles = _ref.styles,
|
|
2449
2476
|
styles = _ref$styles === void 0 ? {
|
|
2450
2477
|
helperText: {}
|
|
2451
2478
|
} : _ref$styles,
|
|
2452
|
-
_ref$error = _ref.error,
|
|
2453
|
-
error = _ref$error === void 0 ? false : _ref$error,
|
|
2454
2479
|
props = _objectWithoutPropertiesLoose(_ref, _excluded$e);
|
|
2455
2480
|
return React.createElement(Text, Object.assign({
|
|
2456
2481
|
size: "xs",
|
|
2457
2482
|
marginVertical: 0,
|
|
2458
2483
|
marginHorizontal: 0,
|
|
2459
|
-
color:
|
|
2484
|
+
color: 'theme.text.dark'
|
|
2460
2485
|
}, styles['helperText'], props), children);
|
|
2461
2486
|
};
|
|
2462
2487
|
|
|
@@ -2471,9 +2496,12 @@ var FieldContainer = function FieldContainer(_ref) {
|
|
|
2471
2496
|
return React.createElement(Vertical, Object.assign({
|
|
2472
2497
|
gap: 5,
|
|
2473
2498
|
position: "relative"
|
|
2474
|
-
}, props), children, helperText && React.createElement(HelperText, Object.assign({
|
|
2475
|
-
|
|
2476
|
-
|
|
2499
|
+
}, props), children, !error && helperText && React.createElement(HelperText, Object.assign({}, styles), helperText), error && React.createElement(Text, {
|
|
2500
|
+
size: "xs",
|
|
2501
|
+
marginVertical: 0,
|
|
2502
|
+
marginHorizontal: 0,
|
|
2503
|
+
color: 'theme.error'
|
|
2504
|
+
}, error));
|
|
2477
2505
|
};
|
|
2478
2506
|
|
|
2479
2507
|
var Shapes = {
|
|
@@ -2564,7 +2592,7 @@ var FieldContent = function FieldContent(_ref) {
|
|
|
2564
2592
|
borderStyle: "solid",
|
|
2565
2593
|
alignItems: "center",
|
|
2566
2594
|
borderColor: color,
|
|
2567
|
-
backgroundColor: "trueGray.50",
|
|
2595
|
+
backgroundColor: "color.trueGray.50",
|
|
2568
2596
|
transition: "padding 0.2s ease",
|
|
2569
2597
|
justifyContent: "space-between",
|
|
2570
2598
|
fontSize: Typography.fontSizes[size],
|
|
@@ -2989,7 +3017,7 @@ var DatePickerView = function DatePickerView(_ref) {
|
|
|
2989
3017
|
},
|
|
2990
3018
|
fontSize: Typography.fontSizes[size],
|
|
2991
3019
|
backgroundColor: 'transparent',
|
|
2992
|
-
color: isDisabled ? 'trueGray.600' : 'blueGray.700',
|
|
3020
|
+
color: isDisabled ? 'color.trueGray.600' : 'color.blueGray.700',
|
|
2993
3021
|
cursor: isDisabled ? 'not-allowed' : isReadOnly ? 'auto' : 'pointer'
|
|
2994
3022
|
}, styles['field']);
|
|
2995
3023
|
return React.createElement(FieldContainer, {
|
|
@@ -3397,7 +3425,7 @@ var SelectBox = function SelectBox(_ref2) {
|
|
|
3397
3425
|
paddingHorizontal: 0,
|
|
3398
3426
|
fontSize: Typography.fontSizes[size],
|
|
3399
3427
|
backgroundColor: 'transparent',
|
|
3400
|
-
color: isDisabled ? 'trueGray.600' : 'blueGray.700',
|
|
3428
|
+
color: isDisabled ? 'color.trueGray.600' : 'color.blueGray.700',
|
|
3401
3429
|
cursor: isDisabled ? 'not-allowed' : 'auto'
|
|
3402
3430
|
}, styles['field'], styles['text']);
|
|
3403
3431
|
return React.createElement(Text, Object.assign({}, fieldStyles), (selected === '' || selected && selected.length === 0) && !!placeholder ? placeholder : React.createElement(React.Fragment, null, typeof selected === 'string' ? selected : selected && selected.length > 0 && React.createElement(Horizontal, {
|
|
@@ -3515,7 +3543,7 @@ var MultiSelect = function MultiSelect(_ref5) {
|
|
|
3515
3543
|
borderRadius: 4,
|
|
3516
3544
|
alignItems: "center",
|
|
3517
3545
|
fontSize: Typography.fontSizes[size],
|
|
3518
|
-
backgroundColor: "trueGray.300",
|
|
3546
|
+
backgroundColor: "color.trueGray.300",
|
|
3519
3547
|
onClick: function onClick(event) {
|
|
3520
3548
|
return event.stopPropagation();
|
|
3521
3549
|
}
|
|
@@ -4012,7 +4040,7 @@ var TextAreaView = function TextAreaView(_ref) {
|
|
|
4012
4040
|
},
|
|
4013
4041
|
fontSize: Typography.fontSizes[size],
|
|
4014
4042
|
backgroundColor: 'transparent',
|
|
4015
|
-
color: isDisabled ? 'trueGray.600' : 'blueGray.700',
|
|
4043
|
+
color: isDisabled ? 'color.trueGray.600' : 'color.blueGray.700',
|
|
4016
4044
|
cursor: isDisabled ? 'not-allowed' : 'auto'
|
|
4017
4045
|
}, styles['field']);
|
|
4018
4046
|
var handleHover = function handleHover() {
|
|
@@ -4297,31 +4325,43 @@ var Loader = LoaderComponent;
|
|
|
4297
4325
|
|
|
4298
4326
|
var useModalStore = /*#__PURE__*/create(function (set) {
|
|
4299
4327
|
return {
|
|
4300
|
-
|
|
4301
|
-
|
|
4302
|
-
|
|
4303
|
-
return set(function (state) {
|
|
4304
|
-
return {
|
|
4305
|
-
isOpen: !state.isOpen
|
|
4306
|
-
};
|
|
4307
|
-
});
|
|
4328
|
+
modal: false,
|
|
4329
|
+
modalProps: {
|
|
4330
|
+
isVisible: false
|
|
4308
4331
|
},
|
|
4309
|
-
|
|
4310
|
-
|
|
4311
|
-
|
|
4312
|
-
|
|
4313
|
-
|
|
4332
|
+
overlayProps: {},
|
|
4333
|
+
show: function show(modal, modalProps, overlayProps) {
|
|
4334
|
+
if (modalProps === void 0) {
|
|
4335
|
+
modalProps = {};
|
|
4336
|
+
}
|
|
4337
|
+
if (overlayProps === void 0) {
|
|
4338
|
+
overlayProps = {};
|
|
4339
|
+
}
|
|
4340
|
+
if (modal) {
|
|
4341
|
+
modalProps.isVisible = true;
|
|
4342
|
+
}
|
|
4343
|
+
set(function (state) {
|
|
4344
|
+
return _extends({}, state, {
|
|
4345
|
+
modal: modal,
|
|
4346
|
+
modalProps: modalProps,
|
|
4347
|
+
overlayProps: overlayProps
|
|
4348
|
+
});
|
|
4314
4349
|
});
|
|
4315
4350
|
},
|
|
4316
|
-
|
|
4317
|
-
|
|
4318
|
-
return {
|
|
4319
|
-
|
|
4320
|
-
|
|
4351
|
+
hide: function hide() {
|
|
4352
|
+
set(function (state) {
|
|
4353
|
+
return _extends({}, state, {
|
|
4354
|
+
modalProps: {
|
|
4355
|
+
isVisible: false
|
|
4356
|
+
}
|
|
4357
|
+
});
|
|
4321
4358
|
});
|
|
4322
4359
|
}
|
|
4323
4360
|
};
|
|
4324
4361
|
});
|
|
4362
|
+
var hideModal = function hideModal() {
|
|
4363
|
+
useModalStore.getState().hide();
|
|
4364
|
+
};
|
|
4325
4365
|
|
|
4326
4366
|
var ContainerShapes = {
|
|
4327
4367
|
sharp: {
|
|
@@ -4376,17 +4416,6 @@ var ModalOverlay = function ModalOverlay(_ref) {
|
|
|
4376
4416
|
_ref$position = _ref.position,
|
|
4377
4417
|
position = _ref$position === void 0 ? 'center' : _ref$position,
|
|
4378
4418
|
props = _objectWithoutPropertiesLoose(_ref, _excluded$s);
|
|
4379
|
-
var setOpen = useModalStore(function (state) {
|
|
4380
|
-
return state.setOpen;
|
|
4381
|
-
});
|
|
4382
|
-
var setOnClose = useModalStore(function (state) {
|
|
4383
|
-
return state.setOnClose;
|
|
4384
|
-
});
|
|
4385
|
-
useEffect(function () {
|
|
4386
|
-
setOnClose(onClose);
|
|
4387
|
-
if (isOpen) setOpen();
|
|
4388
|
-
});
|
|
4389
|
-
if (!isOpen) return null;
|
|
4390
4419
|
var handleClick = function handleClick() {
|
|
4391
4420
|
if (!isClosePrevented) onClose();
|
|
4392
4421
|
};
|
|
@@ -4454,9 +4483,7 @@ var ModalHeader = function ModalHeader(_ref3) {
|
|
|
4454
4483
|
_ref3$buttonPosition = _ref3.buttonPosition,
|
|
4455
4484
|
buttonPosition = _ref3$buttonPosition === void 0 ? 'right' : _ref3$buttonPosition,
|
|
4456
4485
|
props = _objectWithoutPropertiesLoose(_ref3, _excluded3$2);
|
|
4457
|
-
var onClose =
|
|
4458
|
-
return state.onClose;
|
|
4459
|
-
});
|
|
4486
|
+
var onClose = props.onClose ? props.onClose : hideModal;
|
|
4460
4487
|
var buttonIcon = React.createElement(Button, {
|
|
4461
4488
|
onClick: onClose,
|
|
4462
4489
|
colorScheme: "transparent",
|
|
@@ -4503,6 +4530,33 @@ var ModalFooter = function ModalFooter(_ref5) {
|
|
|
4503
4530
|
}, props), children);
|
|
4504
4531
|
};
|
|
4505
4532
|
|
|
4533
|
+
var ModalLayout = function ModalLayout(_ref) {
|
|
4534
|
+
var modals = _ref.modals;
|
|
4535
|
+
var modalStore = useModalStore(function (_ref2) {
|
|
4536
|
+
var modal = _ref2.modal,
|
|
4537
|
+
modalProps = _ref2.modalProps,
|
|
4538
|
+
overlayProps = _ref2.overlayProps;
|
|
4539
|
+
return {
|
|
4540
|
+
modal: modal,
|
|
4541
|
+
modalProps: modalProps,
|
|
4542
|
+
overlayProps: overlayProps
|
|
4543
|
+
};
|
|
4544
|
+
});
|
|
4545
|
+
if (typeof modalStore.modal === 'boolean') {
|
|
4546
|
+
return null;
|
|
4547
|
+
}
|
|
4548
|
+
var Modal = modals[modalStore.modal];
|
|
4549
|
+
if (!Modal) {
|
|
4550
|
+
console.error(modalStore.modal + " modal doesn't exist");
|
|
4551
|
+
return null;
|
|
4552
|
+
}
|
|
4553
|
+
return React.createElement(Fragment, null, React.createElement(ModalOverlay, Object.assign({
|
|
4554
|
+
isOpen: modalStore.modalProps.isVisible,
|
|
4555
|
+
onClose: hideModal,
|
|
4556
|
+
blur: 10
|
|
4557
|
+
}, modalStore.overlayProps), Modal !== undefined && React.createElement(Modal, Object.assign({}, modalStore.modalProps))));
|
|
4558
|
+
};
|
|
4559
|
+
|
|
4506
4560
|
/**
|
|
4507
4561
|
* It is a custom content overlay that appears on top of the main screen.
|
|
4508
4562
|
*/
|
|
@@ -4516,6 +4570,33 @@ Modal.Container = ModalContainer;
|
|
|
4516
4570
|
Modal.Header = ModalHeader;
|
|
4517
4571
|
Modal.Body = ModalBody;
|
|
4518
4572
|
Modal.Footer = ModalFooter;
|
|
4573
|
+
Modal.Layout = ModalLayout;
|
|
4574
|
+
|
|
4575
|
+
var _excluded$t = ["src", "color"],
|
|
4576
|
+
_excluded2$3 = ["path"];
|
|
4577
|
+
var FileSVG = function FileSVG(_ref) {
|
|
4578
|
+
var src = _ref.src,
|
|
4579
|
+
color = _ref.color,
|
|
4580
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$t);
|
|
4581
|
+
var _useTheme = useTheme(),
|
|
4582
|
+
getColor = _useTheme.getColor;
|
|
4583
|
+
var Colorprops = color ? {
|
|
4584
|
+
fill: getColor(color),
|
|
4585
|
+
stroke: getColor(color)
|
|
4586
|
+
} : {};
|
|
4587
|
+
return React.createElement(Center, Object.assign({}, props), React.createElement(Image, Object.assign({}, Colorprops, {
|
|
4588
|
+
content: 'url("' + src + '")',
|
|
4589
|
+
width: "100%",
|
|
4590
|
+
height: "100%"
|
|
4591
|
+
})));
|
|
4592
|
+
};
|
|
4593
|
+
var FileImage = function FileImage(_ref2) {
|
|
4594
|
+
var path = _ref2.path,
|
|
4595
|
+
props = _objectWithoutPropertiesLoose(_ref2, _excluded2$3);
|
|
4596
|
+
return React.createElement(Image, Object.assign({
|
|
4597
|
+
src: path
|
|
4598
|
+
}, props));
|
|
4599
|
+
};
|
|
4519
4600
|
|
|
4520
|
-
export { Button, Center, Checkbox, CountryPicker, DatePicker, Horizontal, Link, Loader, Modal, Password, Select, Switch, Text, TextArea, TextField, Vertical };
|
|
4601
|
+
export { Bottom, Button, Center, Checkbox, CountryPicker, DatePicker, FileImage, FileSVG, Horizontal, Inline, Left, Link, Loader, Modal, Password, Right, Select, Switch, Text, TextArea, TextField, Top, Vertical, View };
|
|
4521
4602
|
//# sourceMappingURL=web.esm.js.map
|