@app-studio/web 0.3.58 → 0.3.60
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/Form/Checkbox/Checkbox/Checkbox.props.d.ts +4 -0
- package/dist/components/Form/Switch/Switch/Switch.props.d.ts +6 -10
- package/dist/web.cjs.development.js +43 -35
- 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 +43 -35
- package/dist/web.esm.js.map +1 -1
- package/package.json +1 -1
package/dist/web.esm.js
CHANGED
|
@@ -1016,7 +1016,7 @@ var IconSizes$2 = {
|
|
|
1016
1016
|
'6xl': 60
|
|
1017
1017
|
};
|
|
1018
1018
|
|
|
1019
|
-
var _excluded$e = ["id", "icon", "name", "label", "isChecked", "onChange", "onValueChange", "shadow", "size", "colorScheme", "error", "isSelected", "isHovered", "isDisabled", "isReadOnly", "isIndeterminate", "defaultIsSelected", "setIsSelected", "setIsHovered", "styles"];
|
|
1019
|
+
var _excluded$e = ["id", "icon", "name", "label", "isChecked", "onChange", "onValueChange", "shadow", "labelPosition", "size", "colorScheme", "error", "isSelected", "isHovered", "isDisabled", "isReadOnly", "isIndeterminate", "defaultIsSelected", "setIsSelected", "setIsHovered", "styles"];
|
|
1020
1020
|
var CheckboxView = function CheckboxView(_ref) {
|
|
1021
1021
|
var id = _ref.id,
|
|
1022
1022
|
icon = _ref.icon,
|
|
@@ -1026,6 +1026,8 @@ var CheckboxView = function CheckboxView(_ref) {
|
|
|
1026
1026
|
onValueChange = _ref.onValueChange,
|
|
1027
1027
|
_ref$shadow = _ref.shadow,
|
|
1028
1028
|
shadow = _ref$shadow === void 0 ? {} : _ref$shadow,
|
|
1029
|
+
_ref$labelPosition = _ref.labelPosition,
|
|
1030
|
+
labelPosition = _ref$labelPosition === void 0 ? 'right' : _ref$labelPosition,
|
|
1029
1031
|
_ref$size = _ref.size,
|
|
1030
1032
|
size = _ref$size === void 0 ? 'md' : _ref$size,
|
|
1031
1033
|
_ref$colorScheme = _ref.colorScheme,
|
|
@@ -1092,9 +1094,9 @@ var CheckboxView = function CheckboxView(_ref) {
|
|
|
1092
1094
|
onMouseEnter: handleHover,
|
|
1093
1095
|
onMouseLeave: handleHover,
|
|
1094
1096
|
size: Typography.fontSizes[size]
|
|
1095
|
-
}, checkboxStyle.container, props), React.createElement(Center, Object.assign({}, checkboxStyle.checkbox), isIndeterminate ? React.createElement(IndeterminateSvg, null) : (isChecked || isSelected) && (icon != null ? icon : React.createElement(CheckSvg, {
|
|
1097
|
+
}, checkboxStyle.container, props), labelPosition === 'left' && label && React.createElement(View$1, null, label), React.createElement(Center, Object.assign({}, checkboxStyle.checkbox), isIndeterminate ? React.createElement(IndeterminateSvg, null) : (isChecked || isSelected) && (icon != null ? icon : React.createElement(CheckSvg, {
|
|
1096
1098
|
size: IconSizes$2[size]
|
|
1097
|
-
}))), label);
|
|
1099
|
+
}))), labelPosition === 'right' && label && React.createElement(View$1, null, label));
|
|
1098
1100
|
};
|
|
1099
1101
|
|
|
1100
1102
|
var CheckboxComponent = function CheckboxComponent(props) {
|
|
@@ -4111,7 +4113,7 @@ var SliderPadding = {
|
|
|
4111
4113
|
}
|
|
4112
4114
|
};
|
|
4113
4115
|
|
|
4114
|
-
var _excluded$s = ["id", "name", "inActiveChild", "activeChild", "shadow", "size", "colorScheme", "
|
|
4116
|
+
var _excluded$s = ["id", "name", "label", "inActiveChild", "activeChild", "labelPosition", "shadow", "size", "colorScheme", "value", "isHovered", "isDisabled", "isReadOnly", "onChange", "setValue", "setIsHovered", "styles"];
|
|
4115
4117
|
var SwitchContent = function SwitchContent(props) {
|
|
4116
4118
|
return React.createElement(Input, Object.assign({
|
|
4117
4119
|
type: "checkbox"
|
|
@@ -4120,16 +4122,19 @@ var SwitchContent = function SwitchContent(props) {
|
|
|
4120
4122
|
var SwitchView = function SwitchView(_ref) {
|
|
4121
4123
|
var id = _ref.id,
|
|
4122
4124
|
name = _ref.name,
|
|
4125
|
+
label = _ref.label,
|
|
4123
4126
|
inActiveChild = _ref.inActiveChild,
|
|
4124
4127
|
activeChild = _ref.activeChild,
|
|
4128
|
+
_ref$labelPosition = _ref.labelPosition,
|
|
4129
|
+
labelPosition = _ref$labelPosition === void 0 ? 'right' : _ref$labelPosition,
|
|
4125
4130
|
_ref$shadow = _ref.shadow,
|
|
4126
4131
|
shadow = _ref$shadow === void 0 ? {} : _ref$shadow,
|
|
4127
4132
|
_ref$size = _ref.size,
|
|
4128
4133
|
size = _ref$size === void 0 ? 'sm' : _ref$size,
|
|
4129
4134
|
_ref$colorScheme = _ref.colorScheme,
|
|
4130
4135
|
colorScheme = _ref$colorScheme === void 0 ? 'theme.primary' : _ref$colorScheme,
|
|
4131
|
-
_ref$
|
|
4132
|
-
|
|
4136
|
+
_ref$value = _ref.value,
|
|
4137
|
+
value = _ref$value === void 0 ? false : _ref$value,
|
|
4133
4138
|
_ref$isHovered = _ref.isHovered,
|
|
4134
4139
|
isHovered = _ref$isHovered === void 0 ? false : _ref$isHovered,
|
|
4135
4140
|
_ref$isDisabled = _ref.isDisabled,
|
|
@@ -4137,56 +4142,63 @@ var SwitchView = function SwitchView(_ref) {
|
|
|
4137
4142
|
_ref$isReadOnly = _ref.isReadOnly,
|
|
4138
4143
|
isReadOnly = _ref$isReadOnly === void 0 ? false : _ref$isReadOnly,
|
|
4139
4144
|
onChange = _ref.onChange,
|
|
4140
|
-
|
|
4141
|
-
_ref$
|
|
4142
|
-
setOn = _ref$setOn === void 0 ? function () {} : _ref$setOn,
|
|
4145
|
+
_ref$setValue = _ref.setValue,
|
|
4146
|
+
setValue = _ref$setValue === void 0 ? function () {} : _ref$setValue,
|
|
4143
4147
|
_ref$setIsHovered = _ref.setIsHovered,
|
|
4144
4148
|
setIsHovered = _ref$setIsHovered === void 0 ? function () {} : _ref$setIsHovered,
|
|
4145
4149
|
_ref$styles = _ref.styles,
|
|
4146
4150
|
styles = _ref$styles === void 0 ? {
|
|
4147
4151
|
slider: {},
|
|
4148
|
-
circle: {}
|
|
4152
|
+
circle: {},
|
|
4153
|
+
label: {}
|
|
4149
4154
|
} : _ref$styles,
|
|
4150
4155
|
props = _objectWithoutPropertiesLoose(_ref, _excluded$s);
|
|
4151
4156
|
var handleToggle = function handleToggle(event) {
|
|
4152
4157
|
if (!isReadOnly) {
|
|
4153
|
-
|
|
4158
|
+
setValue(!value);
|
|
4154
4159
|
if (onChange) onChange(event.target.checked);
|
|
4155
4160
|
}
|
|
4156
4161
|
};
|
|
4157
4162
|
var handleHover = function handleHover() {
|
|
4158
4163
|
return setIsHovered(!isHovered);
|
|
4159
4164
|
};
|
|
4160
|
-
|
|
4165
|
+
var switchStyle = {
|
|
4166
|
+
container: _extends({
|
|
4167
|
+
gap: 10,
|
|
4168
|
+
display: 'flex',
|
|
4169
|
+
height: 'fit-content',
|
|
4170
|
+
width: 'fit-content',
|
|
4171
|
+
cursor: isDisabled ? 'not-allowed' : isReadOnly ? 'default' : 'pointer'
|
|
4172
|
+
}, styles.label)
|
|
4173
|
+
};
|
|
4174
|
+
return React.createElement(Label, Object.assign({
|
|
4161
4175
|
htmlFor: id,
|
|
4162
4176
|
onMouseEnter: handleHover,
|
|
4163
4177
|
onMouseLeave: handleHover
|
|
4164
|
-
}, React.createElement(SwitchContent, Object.assign({
|
|
4178
|
+
}, switchStyle.container, props), React.createElement(SwitchContent, Object.assign({
|
|
4165
4179
|
id: id,
|
|
4166
4180
|
name: name,
|
|
4167
4181
|
opacity: 0,
|
|
4168
4182
|
width: 0,
|
|
4169
4183
|
height: 0,
|
|
4170
|
-
checked:
|
|
4184
|
+
checked: value,
|
|
4171
4185
|
onChange: handleToggle,
|
|
4172
4186
|
disabled: isDisabled,
|
|
4173
4187
|
readOnly: isReadOnly
|
|
4174
|
-
},
|
|
4175
|
-
onValueChange: handleToggle
|
|
4176
|
-
}, props)), React.createElement(View, Object.assign({
|
|
4188
|
+
}, props)), labelPosition === 'left' && label && React.createElement(View, null, label), React.createElement(View, Object.assign({
|
|
4177
4189
|
display: "flex",
|
|
4178
4190
|
cursor: "pointer",
|
|
4179
4191
|
alignItems: "center",
|
|
4180
4192
|
borderRadius: 24,
|
|
4181
4193
|
marginBottom: 5,
|
|
4182
|
-
filter: isHovered &&
|
|
4194
|
+
filter: isHovered && value ? 'brightness(0.9)' : 'brightness(1)',
|
|
4183
4195
|
transition: "justify-content 0.3s cubic-bezier(0.4, 0, 0.2, 1)",
|
|
4184
|
-
backgroundColor: isDisabled ? 'disabled' :
|
|
4185
|
-
justifyContent: activeChild ? 'space-between' :
|
|
4186
|
-
}, shadow, SliderPadding[size], SliderSizes[size], styles['slider']), activeChild &&
|
|
4196
|
+
backgroundColor: isDisabled ? 'disabled' : value ? colorScheme : 'lightgray',
|
|
4197
|
+
justifyContent: activeChild ? 'space-between' : value ? 'flex-end' : 'flex-start'
|
|
4198
|
+
}, shadow, SliderPadding[size], SliderSizes[size], styles['slider']), activeChild && value && React.createElement(View, null, activeChild), React.createElement(View, Object.assign({
|
|
4187
4199
|
borderRadius: "50%",
|
|
4188
4200
|
backgroundColor: "white"
|
|
4189
|
-
}, KnobSizes[size], styles['circle'])), inActiveChild && !
|
|
4201
|
+
}, KnobSizes[size], styles['circle'])), inActiveChild && !value && React.createElement(View, null, inActiveChild)), labelPosition === 'right' && label && React.createElement(View, null, label));
|
|
4190
4202
|
};
|
|
4191
4203
|
|
|
4192
4204
|
var SwitchComponent = function SwitchComponent(props) {
|
|
@@ -4571,12 +4583,8 @@ var SelectComponent$1 = function SelectComponent(props) {
|
|
|
4571
4583
|
*/
|
|
4572
4584
|
var FormikSelect = SelectComponent$1;
|
|
4573
4585
|
|
|
4574
|
-
var _excluded$w = ["value"];
|
|
4575
4586
|
var SwitchComponent$1 = function SwitchComponent(props) {
|
|
4576
|
-
var
|
|
4577
|
-
value = _useFormikInput.value,
|
|
4578
|
-
formProps = _objectWithoutPropertiesLoose(_useFormikInput, _excluded$w);
|
|
4579
|
-
formProps.isChecked = value;
|
|
4587
|
+
var formProps = useFormikInput(props);
|
|
4580
4588
|
var switchStates = useSwitchState(props);
|
|
4581
4589
|
return React.createElement(SwitchView, Object.assign({}, switchStates, formProps));
|
|
4582
4590
|
};
|
|
@@ -4592,11 +4600,11 @@ var TextAreaComponent$1 = function TextAreaComponent(props) {
|
|
|
4592
4600
|
*/
|
|
4593
4601
|
var FormikTextArea = TextAreaComponent$1;
|
|
4594
4602
|
|
|
4595
|
-
var _excluded$
|
|
4603
|
+
var _excluded$w = ["value"];
|
|
4596
4604
|
var TextFieldComponent$1 = function TextFieldComponent(props) {
|
|
4597
4605
|
var formProps = useFormikInput(props);
|
|
4598
4606
|
var _useTextFieldState = useTextFieldState(props),
|
|
4599
|
-
textFieldStates = _objectWithoutPropertiesLoose(_useTextFieldState, _excluded$
|
|
4607
|
+
textFieldStates = _objectWithoutPropertiesLoose(_useTextFieldState, _excluded$w);
|
|
4600
4608
|
return React.createElement(TextFieldView, Object.assign({}, textFieldStates, formProps));
|
|
4601
4609
|
};
|
|
4602
4610
|
/**
|
|
@@ -4604,7 +4612,7 @@ var TextFieldComponent$1 = function TextFieldComponent(props) {
|
|
|
4604
4612
|
*/
|
|
4605
4613
|
var FormikTextField = TextFieldComponent$1;
|
|
4606
4614
|
|
|
4607
|
-
var _excluded$
|
|
4615
|
+
var _excluded$x = ["visibleIcon", "hiddenIcon"],
|
|
4608
4616
|
_excluded2$3 = ["isVisible", "setIsVisible"];
|
|
4609
4617
|
var PasswordComponent$1 = function PasswordComponent(_ref) {
|
|
4610
4618
|
var _ref$visibleIcon = _ref.visibleIcon,
|
|
@@ -4615,7 +4623,7 @@ var PasswordComponent$1 = function PasswordComponent(_ref) {
|
|
|
4615
4623
|
hiddenIcon = _ref$hiddenIcon === void 0 ? React.createElement(CloseEyeSvg, {
|
|
4616
4624
|
size: 14
|
|
4617
4625
|
}) : _ref$hiddenIcon,
|
|
4618
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
4626
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$x);
|
|
4619
4627
|
var formProps = useFormikInput(props);
|
|
4620
4628
|
var _usePasswordState = usePasswordState(formProps),
|
|
4621
4629
|
isVisible = _usePasswordState.isVisible,
|
|
@@ -4723,7 +4731,7 @@ var HeaderIconSizes = {
|
|
|
4723
4731
|
xl: 28
|
|
4724
4732
|
};
|
|
4725
4733
|
|
|
4726
|
-
var _excluded$
|
|
4734
|
+
var _excluded$y = ["children", "blur", "isOpen", "isClosePrevented", "onClose", "position"],
|
|
4727
4735
|
_excluded2$4 = ["children", "shadow", "isFullScreen", "shape"],
|
|
4728
4736
|
_excluded3$2 = ["children", "buttonColor", "iconSize", "buttonPosition"],
|
|
4729
4737
|
_excluded4$2 = ["children"],
|
|
@@ -4739,7 +4747,7 @@ var ModalOverlay = function ModalOverlay(_ref) {
|
|
|
4739
4747
|
onClose = _ref$onClose === void 0 ? function () {} : _ref$onClose,
|
|
4740
4748
|
_ref$position = _ref.position,
|
|
4741
4749
|
position = _ref$position === void 0 ? 'center' : _ref$position,
|
|
4742
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
4750
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$y);
|
|
4743
4751
|
var handleClick = function handleClick() {
|
|
4744
4752
|
if (!isClosePrevented) onClose();
|
|
4745
4753
|
};
|
|
@@ -4895,12 +4903,12 @@ Modal.Body = ModalBody;
|
|
|
4895
4903
|
Modal.Footer = ModalFooter;
|
|
4896
4904
|
Modal.Layout = ModalLayout;
|
|
4897
4905
|
|
|
4898
|
-
var _excluded$
|
|
4906
|
+
var _excluded$z = ["src", "color"],
|
|
4899
4907
|
_excluded2$5 = ["path"];
|
|
4900
4908
|
var FileSVG = function FileSVG(_ref) {
|
|
4901
4909
|
var src = _ref.src,
|
|
4902
4910
|
color = _ref.color,
|
|
4903
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
4911
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$z);
|
|
4904
4912
|
var _useTheme = useTheme(),
|
|
4905
4913
|
getColor = _useTheme.getColor;
|
|
4906
4914
|
var Colorprops = color ? {
|