@app-studio/web 0.8.93 → 0.8.94
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/Button/Button/Button.style.d.ts +1 -2
- package/dist/components/Form/Select/Select/Select.state.d.ts +2 -1
- package/dist/components/Form/Switch/Switch/Switch.props.d.ts +2 -1
- package/dist/components/Form/Switch/Switch/Switch.state.d.ts +4 -2
- package/dist/components/Form/Switch/Switch/Switch.style.d.ts +3 -3
- package/dist/utils/index.d.ts +7 -0
- package/dist/utils/typography.d.ts +29 -0
- package/dist/web.cjs.development.js +217 -139
- 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 +217 -139
- package/dist/web.esm.js.map +1 -1
- package/dist/web.umd.development.js +217 -139
- 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 +1 -1
|
@@ -439,20 +439,20 @@
|
|
|
439
439
|
* Font sizes following typography guidelines
|
|
440
440
|
*/
|
|
441
441
|
var FontSizes = {
|
|
442
|
-
xs: '
|
|
443
|
-
sm: '
|
|
444
|
-
md: '
|
|
445
|
-
lg: '
|
|
442
|
+
xs: '10px',
|
|
443
|
+
sm: '12px',
|
|
444
|
+
md: '14px',
|
|
445
|
+
lg: '16px',
|
|
446
446
|
xl: '20px'
|
|
447
447
|
};
|
|
448
448
|
/**
|
|
449
449
|
* Line heights following typography guidelines
|
|
450
450
|
*/
|
|
451
451
|
var LineHeights = {
|
|
452
|
-
xs: '
|
|
453
|
-
sm: '
|
|
454
|
-
md: '
|
|
455
|
-
lg: '
|
|
452
|
+
xs: '14px',
|
|
453
|
+
sm: '16px',
|
|
454
|
+
md: '20px',
|
|
455
|
+
lg: '22px',
|
|
456
456
|
xl: '28px'
|
|
457
457
|
};
|
|
458
458
|
/**
|
|
@@ -3234,7 +3234,7 @@
|
|
|
3234
3234
|
height: '32px',
|
|
3235
3235
|
padding: '0 12px',
|
|
3236
3236
|
// Typography
|
|
3237
|
-
fontSize: '
|
|
3237
|
+
fontSize: '16px',
|
|
3238
3238
|
fontWeight: '500',
|
|
3239
3239
|
lineHeight: '32px'
|
|
3240
3240
|
},
|
|
@@ -3244,7 +3244,7 @@
|
|
|
3244
3244
|
height: '36px',
|
|
3245
3245
|
padding: '0 14px',
|
|
3246
3246
|
// Typography
|
|
3247
|
-
fontSize: '
|
|
3247
|
+
fontSize: '20px',
|
|
3248
3248
|
fontWeight: '500',
|
|
3249
3249
|
lineHeight: '36px'
|
|
3250
3250
|
}
|
|
@@ -3655,70 +3655,60 @@
|
|
|
3655
3655
|
*/
|
|
3656
3656
|
/**
|
|
3657
3657
|
* Button sizes following the 4px grid system
|
|
3658
|
-
*/
|
|
3659
|
-
var ButtonSizes = {
|
|
3658
|
+
*/var ButtonSizes = {
|
|
3660
3659
|
xs: {
|
|
3661
|
-
|
|
3660
|
+
minHeight: 3 * 4,
|
|
3661
|
+
paddingTop: 1,
|
|
3662
|
+
paddingBottom: 1,
|
|
3663
|
+
paddingLeft: 2,
|
|
3664
|
+
paddingRight: 2,
|
|
3665
|
+
fontSize: 10,
|
|
3666
|
+
fontWeight: '500',
|
|
3667
|
+
lineHeight: 14,
|
|
3668
|
+
letterSpacing: '-0.01em'
|
|
3669
|
+
},
|
|
3670
|
+
sm: {
|
|
3662
3671
|
minHeight: 4 * 4,
|
|
3663
|
-
paddingTop:
|
|
3664
|
-
paddingBottom:
|
|
3665
|
-
paddingLeft:
|
|
3666
|
-
paddingRight:
|
|
3667
|
-
// Typography
|
|
3672
|
+
paddingTop: 4,
|
|
3673
|
+
paddingBottom: 4,
|
|
3674
|
+
paddingLeft: 8,
|
|
3675
|
+
paddingRight: 8,
|
|
3668
3676
|
fontSize: 12,
|
|
3669
3677
|
fontWeight: '500',
|
|
3670
|
-
lineHeight:
|
|
3678
|
+
lineHeight: 16,
|
|
3671
3679
|
letterSpacing: '-0.01em'
|
|
3672
3680
|
},
|
|
3673
|
-
|
|
3674
|
-
// Height: 32px (8 × 4px)
|
|
3681
|
+
md: {
|
|
3675
3682
|
minHeight: 6 * 4,
|
|
3676
3683
|
paddingTop: 6,
|
|
3677
3684
|
paddingBottom: 6,
|
|
3678
3685
|
paddingLeft: 12,
|
|
3679
3686
|
paddingRight: 12,
|
|
3680
|
-
|
|
3681
|
-
fontSize: 12,
|
|
3687
|
+
fontSize: 14,
|
|
3682
3688
|
fontWeight: '500',
|
|
3683
|
-
lineHeight:
|
|
3689
|
+
lineHeight: 18,
|
|
3684
3690
|
letterSpacing: '-0.01em'
|
|
3685
3691
|
},
|
|
3686
|
-
|
|
3687
|
-
// Height: 40px (10 × 4px) - standard height for interactive elements
|
|
3692
|
+
lg: {
|
|
3688
3693
|
minHeight: 8 * 4,
|
|
3689
3694
|
paddingTop: 8,
|
|
3690
3695
|
paddingBottom: 8,
|
|
3691
3696
|
paddingLeft: 16,
|
|
3692
3697
|
paddingRight: 16,
|
|
3693
|
-
// Typography
|
|
3694
3698
|
fontSize: 16,
|
|
3695
3699
|
fontWeight: '500',
|
|
3696
|
-
lineHeight:
|
|
3700
|
+
lineHeight: 18,
|
|
3697
3701
|
letterSpacing: '-0.01em'
|
|
3698
3702
|
},
|
|
3699
|
-
|
|
3703
|
+
xl: {
|
|
3700
3704
|
minHeight: 10 * 4,
|
|
3701
3705
|
paddingTop: 10,
|
|
3702
3706
|
paddingBottom: 10,
|
|
3703
3707
|
paddingLeft: 20,
|
|
3704
3708
|
paddingRight: 20,
|
|
3705
|
-
|
|
3706
|
-
fontSize: 16,
|
|
3707
|
-
fontWeight: '500',
|
|
3708
|
-
lineHeight: 20,
|
|
3709
|
-
letterSpacing: '-0.01em'
|
|
3710
|
-
},
|
|
3711
|
-
xl: {
|
|
3712
|
-
// Height: 60px (15 × 4px)
|
|
3713
|
-
minHeight: 12 * 4,
|
|
3714
|
-
paddingTop: 12,
|
|
3715
|
-
paddingBottom: 12,
|
|
3716
|
-
paddingLeft: 24,
|
|
3717
|
-
paddingRight: 24,
|
|
3718
|
-
// Typography
|
|
3719
|
-
fontSize: 18,
|
|
3709
|
+
fontSize: 20,
|
|
3720
3710
|
fontWeight: '500',
|
|
3721
|
-
lineHeight:
|
|
3711
|
+
lineHeight: 22,
|
|
3722
3712
|
letterSpacing: '-0.01em'
|
|
3723
3713
|
}
|
|
3724
3714
|
};
|
|
@@ -6469,13 +6459,12 @@
|
|
|
6469
6459
|
var {
|
|
6470
6460
|
placeholder,
|
|
6471
6461
|
isMulti,
|
|
6472
|
-
options
|
|
6462
|
+
options,
|
|
6463
|
+
id = "select-" + Math.random().toString(36).substr(2, 9)
|
|
6473
6464
|
} = _ref;
|
|
6474
6465
|
// Determines the default value based on the 'placeholder' and 'isMulti' props, setting to an empty array for multi-select or an empty string/single default option
|
|
6475
6466
|
var defaultValue = placeholder ? isMulti ? [] : '' // If there's a placeholder, set default to empty array for multi-select or empty string for single select
|
|
6476
|
-
: Array.isArray(options) && options.length > 0 ? options[0].value : ''; // If no placeholder, use the first option value if available, otherwise
|
|
6477
|
-
// State hook for managing visibility of the Select dropdown, initially set to hidden
|
|
6478
|
-
var [hide, setHide] = React__default.useState(true);
|
|
6467
|
+
: Array.isArray(options) && options.length > 0 ? options[0].value : isMulti ? [] : ''; // If no placeholder, use the first option value if available, otherwise empty array for multi-select or empty string for single select
|
|
6479
6468
|
// State hook for tracking mouse hover status over the Select component
|
|
6480
6469
|
var [isHovered, setIsHovered] = React__default.useState(false);
|
|
6481
6470
|
// State hook for tracking focus status of the Select input field
|
|
@@ -6484,8 +6473,11 @@
|
|
|
6484
6473
|
var [value, setValue] = React__default.useState(defaultValue);
|
|
6485
6474
|
// State hook for keeping track of the currently highlighted index in the options list
|
|
6486
6475
|
var [highlightedIndex, setHighlightedIndex] = React__default.useState(0);
|
|
6476
|
+
// State hook for managing visibility of the Select dropdown, initially set to hidden
|
|
6477
|
+
var [hide, setHide] = React__default.useState(true);
|
|
6487
6478
|
// Returns an object containing all stateful values and their associated setters to manage the Select component's state
|
|
6488
6479
|
return {
|
|
6480
|
+
id,
|
|
6489
6481
|
value,
|
|
6490
6482
|
setValue,
|
|
6491
6483
|
hide,
|
|
@@ -6700,7 +6692,7 @@
|
|
|
6700
6692
|
flexWrap: "nowrap",
|
|
6701
6693
|
alignItems: "center",
|
|
6702
6694
|
justifyContent: "space-between",
|
|
6703
|
-
marginBottom:
|
|
6695
|
+
marginBottom: 2,
|
|
6704
6696
|
// Visual properties
|
|
6705
6697
|
borderStyle: "solid",
|
|
6706
6698
|
borderColor: color,
|
|
@@ -6722,10 +6714,9 @@
|
|
|
6722
6714
|
props = _objectWithoutPropertiesLoose(_ref, _excluded$l);
|
|
6723
6715
|
return /*#__PURE__*/React__default.createElement(appStudio.Center, Object.assign({
|
|
6724
6716
|
gap: 10,
|
|
6725
|
-
right:
|
|
6717
|
+
right: 10,
|
|
6726
6718
|
zIndex: 500,
|
|
6727
|
-
flexWrap: "nowrap"
|
|
6728
|
-
position: "absolute"
|
|
6719
|
+
flexWrap: "nowrap"
|
|
6729
6720
|
}, props), children);
|
|
6730
6721
|
};
|
|
6731
6722
|
|
|
@@ -6909,20 +6900,27 @@
|
|
|
6909
6900
|
} = _ref,
|
|
6910
6901
|
props = _objectWithoutPropertiesLoose(_ref, _excluded$p);
|
|
6911
6902
|
// Handles the click event on an option by invoking the callback with the selected option's value
|
|
6912
|
-
var handleOptionClick = option =>
|
|
6903
|
+
var handleOptionClick = (e, option) => {
|
|
6904
|
+
e.stopPropagation();
|
|
6905
|
+
e.preventDefault();
|
|
6906
|
+
if (typeof callback === 'function') {
|
|
6907
|
+
callback(option);
|
|
6908
|
+
}
|
|
6909
|
+
};
|
|
6913
6910
|
// Toggles the hover state on the item
|
|
6914
6911
|
var handleHover = () => setIsHovered(!isHovered);
|
|
6915
6912
|
return /*#__PURE__*/React__default.createElement(appStudio.Element, Object.assign({
|
|
6916
6913
|
as: "li",
|
|
6917
6914
|
// Layout properties
|
|
6918
6915
|
margin: 0,
|
|
6919
|
-
paddingVertical:
|
|
6920
|
-
paddingHorizontal:
|
|
6916
|
+
paddingVertical: 8,
|
|
6917
|
+
paddingHorizontal: 8,
|
|
6921
6918
|
listStyleType: "none",
|
|
6919
|
+
cursor: "pointer",
|
|
6922
6920
|
// Event handlers
|
|
6923
6921
|
onMouseEnter: handleHover,
|
|
6924
6922
|
onMouseLeave: handleHover,
|
|
6925
|
-
onClick:
|
|
6923
|
+
onClick: e => handleOptionClick(e, option.value),
|
|
6926
6924
|
// Visual properties
|
|
6927
6925
|
backgroundColor: isHovered ? 'color.gray.100' : 'transparent',
|
|
6928
6926
|
borderRadius: "4px" // Subtle rounded corners for items
|
|
@@ -6968,7 +6966,7 @@
|
|
|
6968
6966
|
width: '95%',
|
|
6969
6967
|
height: '100%',
|
|
6970
6968
|
border: 'none',
|
|
6971
|
-
paddingVertical:
|
|
6969
|
+
paddingVertical: 4,
|
|
6972
6970
|
paddingHorizontal: 0,
|
|
6973
6971
|
// Typography properties
|
|
6974
6972
|
fontSize: appStudio.Typography.fontSizes[size],
|
|
@@ -7048,34 +7046,16 @@
|
|
|
7048
7046
|
} = _ref5;
|
|
7049
7047
|
var itemStates = useItemState();
|
|
7050
7048
|
var handleCallback = option => callback(option);
|
|
7051
|
-
// Shadow styles for the dropdown
|
|
7052
|
-
var shadow = {
|
|
7053
|
-
boxShadow: '0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)'
|
|
7054
|
-
};
|
|
7049
|
+
// Shadow styles for the dropdown - now applied directly in the Element
|
|
7055
7050
|
return /*#__PURE__*/React__default.createElement(appStudio.Element, Object.assign({
|
|
7056
7051
|
as: "ul",
|
|
7057
7052
|
role: "dropdown",
|
|
7058
|
-
top: "100%",
|
|
7059
7053
|
width: "100%",
|
|
7060
7054
|
display: "flex",
|
|
7061
7055
|
flexDirection: "column",
|
|
7062
|
-
position: "absolute",
|
|
7063
|
-
marginTop: 8,
|
|
7064
|
-
marginLeft: 0,
|
|
7065
|
-
marginRight: 0,
|
|
7066
|
-
marginBottom: 0,
|
|
7067
|
-
padding: 0,
|
|
7068
|
-
maxHeight: "240px" // 60 × 4px grid
|
|
7069
|
-
,
|
|
7070
|
-
overflowY: "auto",
|
|
7071
|
-
zIndex: 1000,
|
|
7072
7056
|
backgroundColor: "color.white",
|
|
7073
|
-
borderRadius: "8px" // Consistent with design system (rounded-md)
|
|
7074
|
-
,
|
|
7075
|
-
borderWidth: "1px",
|
|
7076
|
-
borderStyle: "solid",
|
|
7077
|
-
borderColor: "color.gray.200",
|
|
7078
7057
|
transition: "all 0.2s ease",
|
|
7058
|
+
margin: 0,
|
|
7079
7059
|
style: {
|
|
7080
7060
|
scrollbarWidth: 'thin',
|
|
7081
7061
|
scrollbarColor: 'rgba(0, 0, 0, 0.2) transparent',
|
|
@@ -7090,7 +7070,7 @@
|
|
|
7090
7070
|
borderRadius: '4px'
|
|
7091
7071
|
}
|
|
7092
7072
|
}
|
|
7093
|
-
},
|
|
7073
|
+
}, views == null ? void 0 : views.dropDown), options && options.length > 0 && options.map((option, index) => (/*#__PURE__*/React__default.createElement(Item, Object.assign({
|
|
7094
7074
|
key: option.value,
|
|
7095
7075
|
size: size,
|
|
7096
7076
|
style: views['text'],
|
|
@@ -7173,23 +7153,57 @@
|
|
|
7173
7153
|
highlightedIndex
|
|
7174
7154
|
} = _ref7,
|
|
7175
7155
|
props = _objectWithoutPropertiesLoose(_ref7, _excluded4$6);
|
|
7156
|
+
// close when *any* other select opens
|
|
7157
|
+
React__default.useEffect(() => {
|
|
7158
|
+
var handleCloseAll = () => setHide(true);
|
|
7159
|
+
document.addEventListener('closeAllSelects', handleCloseAll);
|
|
7160
|
+
return () => document.removeEventListener('closeAllSelects', handleCloseAll);
|
|
7161
|
+
}, [setHide]);
|
|
7162
|
+
// Add a global click handler to close the dropdown when clicking outside
|
|
7163
|
+
React__default.useEffect(() => {
|
|
7164
|
+
var handleGlobalClick = e => {
|
|
7165
|
+
var target = e.target;
|
|
7166
|
+
// Only close if clicking outside of this specific select component
|
|
7167
|
+
if (!target.closest("#" + id) && !hide) {
|
|
7168
|
+
setHide(true);
|
|
7169
|
+
}
|
|
7170
|
+
};
|
|
7171
|
+
document.addEventListener('click', handleGlobalClick);
|
|
7172
|
+
return () => {
|
|
7173
|
+
document.removeEventListener('click', handleGlobalClick);
|
|
7174
|
+
};
|
|
7175
|
+
}, [id, hide, setHide]);
|
|
7176
7176
|
var showLabel = !!(isFocused && label);
|
|
7177
7177
|
var handleHover = () => setIsHovered(!isHovered);
|
|
7178
7178
|
var handleFocus = () => setIsFocused(true);
|
|
7179
7179
|
var handleClick = event => {
|
|
7180
|
+
// tell all other selects to close
|
|
7181
|
+
document.dispatchEvent(new Event('closeAllSelects'));
|
|
7180
7182
|
if (event && event.stopPropagation) event.stopPropagation();
|
|
7181
|
-
|
|
7182
|
-
|
|
7183
|
+
// Toggle dropdown visibility
|
|
7184
|
+
var newHideState = !hide;
|
|
7185
|
+
setHide(newHideState);
|
|
7186
|
+
setIsFocused(!newHideState); // Set focus state based on dropdown visibility
|
|
7183
7187
|
};
|
|
7184
7188
|
var handleCallback = React.useCallback(option => {
|
|
7185
|
-
|
|
7189
|
+
// Close dropdown after selection
|
|
7190
|
+
setHide(true);
|
|
7191
|
+
// Tell all other selects to close
|
|
7192
|
+
document.dispatchEvent(new Event('closeAllSelects'));
|
|
7193
|
+
// Update value based on multi-select or single-select mode
|
|
7186
7194
|
if (isMulti && Array.isArray(value)) {
|
|
7187
|
-
!value.includes(option)
|
|
7195
|
+
if (!value.includes(option)) {
|
|
7196
|
+
var newValue = [...value, option];
|
|
7197
|
+
setValue(newValue);
|
|
7198
|
+
if (onChange) onChange(option);
|
|
7199
|
+
}
|
|
7188
7200
|
} else {
|
|
7189
7201
|
setValue(option);
|
|
7202
|
+
if (onChange) onChange(option);
|
|
7190
7203
|
}
|
|
7191
|
-
|
|
7192
|
-
|
|
7204
|
+
// Set focus to indicate selection
|
|
7205
|
+
setIsFocused(true);
|
|
7206
|
+
}, [isMulti, value, setHide, setValue, onChange, setIsFocused]);
|
|
7193
7207
|
var handleRemoveOption = valueOption => {
|
|
7194
7208
|
if (Array.isArray(value) && value.includes(valueOption)) {
|
|
7195
7209
|
var newValue = value.filter(option => option !== valueOption);
|
|
@@ -7197,11 +7211,24 @@
|
|
|
7197
7211
|
}
|
|
7198
7212
|
};
|
|
7199
7213
|
return /*#__PURE__*/React__default.createElement(FieldContainer, {
|
|
7214
|
+
style: {
|
|
7215
|
+
position: 'relative',
|
|
7216
|
+
width: '100%',
|
|
7217
|
+
display: 'inline-block'
|
|
7218
|
+
},
|
|
7219
|
+
id: id,
|
|
7200
7220
|
role: "SelectBox",
|
|
7201
7221
|
helperText: helperText,
|
|
7202
7222
|
error: error,
|
|
7203
7223
|
views: views,
|
|
7204
|
-
onClick:
|
|
7224
|
+
onClick: e => {
|
|
7225
|
+
// Stop propagation to prevent clicks from bubbling up
|
|
7226
|
+
e.stopPropagation();
|
|
7227
|
+
// Only handle click if not disabled or readonly
|
|
7228
|
+
if (!(isDisabled || isReadOnly)) {
|
|
7229
|
+
handleClick(e);
|
|
7230
|
+
}
|
|
7231
|
+
}
|
|
7205
7232
|
}, /*#__PURE__*/React__default.createElement(FieldContent, {
|
|
7206
7233
|
label: label,
|
|
7207
7234
|
size: size,
|
|
@@ -7251,39 +7278,78 @@
|
|
|
7251
7278
|
orientation: "up",
|
|
7252
7279
|
widthHeight: IconSizes$2[size],
|
|
7253
7280
|
style: views.icon
|
|
7254
|
-
})))))), !hide && (/*#__PURE__*/React__default.createElement(
|
|
7281
|
+
})))))), !hide && options.length > 0 && (/*#__PURE__*/React__default.createElement(appStudio.Element, {
|
|
7282
|
+
onClick: e => e.stopPropagation(),
|
|
7283
|
+
style: {
|
|
7284
|
+
position: 'absolute',
|
|
7285
|
+
top: 'calc(100% + 4px)',
|
|
7286
|
+
left: 0,
|
|
7287
|
+
right: 0,
|
|
7288
|
+
zIndex: 1000
|
|
7289
|
+
}
|
|
7290
|
+
}, /*#__PURE__*/React__default.createElement(DropDown, {
|
|
7255
7291
|
size: size,
|
|
7256
|
-
views: views,
|
|
7292
|
+
views: Object.assign({}, views, {
|
|
7293
|
+
dropDown: {
|
|
7294
|
+
borderRadius: '6px',
|
|
7295
|
+
border: '1px solid color.gray.200',
|
|
7296
|
+
boxShadow: '0 8px 16px rgba(0,0,0,0.1)',
|
|
7297
|
+
padding: '8px',
|
|
7298
|
+
maxHeight: '240px',
|
|
7299
|
+
overflowY: 'auto'
|
|
7300
|
+
}
|
|
7301
|
+
}),
|
|
7257
7302
|
options: options,
|
|
7258
7303
|
callback: handleCallback,
|
|
7259
7304
|
highlightedIndex: highlightedIndex,
|
|
7260
7305
|
setHighlightedIndex: setHighlightedIndex
|
|
7261
|
-
})));
|
|
7306
|
+
}))));
|
|
7262
7307
|
};
|
|
7263
7308
|
|
|
7264
7309
|
// Defines a functional component named 'SelectComponent', which is expected to receive 'SelectProps' as properties.
|
|
7265
7310
|
var SelectComponent = props => {
|
|
7311
|
+
// Ensure options is always an array
|
|
7312
|
+
var safeProps = Object.assign({}, props, {
|
|
7313
|
+
options: props.options || []
|
|
7314
|
+
});
|
|
7266
7315
|
// Invokes the 'useSelectState' hook with props to obtain stateful logic for the Select component.
|
|
7267
|
-
var selectStates = useSelectState(
|
|
7316
|
+
var selectStates = useSelectState(safeProps);
|
|
7268
7317
|
// Renders the 'SelectView' component, passing along any states controlled by 'useSelectState' and all properties passed to 'SelectComponent'.
|
|
7269
|
-
return /*#__PURE__*/React__default.createElement(SelectView, Object.assign({}, selectStates,
|
|
7318
|
+
return /*#__PURE__*/React__default.createElement(SelectView, Object.assign({}, selectStates, safeProps, {
|
|
7319
|
+
onClick: e => {
|
|
7320
|
+
// Stop propagation to prevent the global click handler from closing other dropdowns
|
|
7321
|
+
e.stopPropagation();
|
|
7322
|
+
if (props.onClick) props.onClick(e);
|
|
7323
|
+
}
|
|
7324
|
+
}));
|
|
7270
7325
|
};
|
|
7271
7326
|
// Exports 'SelectComponent' as 'Select', making it available for import in other parts of the application.
|
|
7272
7327
|
var Select = SelectComponent;
|
|
7273
7328
|
|
|
7274
|
-
// This file defines a custom hook for managing the state of a Switch component.
|
|
7329
|
+
// This file defines a custom hook for managing the state of a Switch component.
|
|
7330
|
+
// It allows tracking whether the switch is hovered, and its on/off state based on 'isDisabled' and 'isChecked' properties.
|
|
7275
7331
|
var useSwitchState = _ref => {
|
|
7276
7332
|
var {
|
|
7277
7333
|
isDisabled,
|
|
7278
7334
|
isChecked
|
|
7279
7335
|
} = _ref;
|
|
7280
7336
|
var [isHovered, setIsHovered] = React__default.useState(false);
|
|
7281
|
-
var [on, setOn] = React__default.useState(
|
|
7337
|
+
var [on, setOn] = React__default.useState(isChecked || false);
|
|
7338
|
+
var [value, setValue] = React__default.useState(isChecked || false);
|
|
7339
|
+
// Update the value when isChecked changes
|
|
7340
|
+
React.useEffect(() => {
|
|
7341
|
+
if (isChecked !== undefined) {
|
|
7342
|
+
setOn(isChecked);
|
|
7343
|
+
setValue(isChecked);
|
|
7344
|
+
}
|
|
7345
|
+
}, [isChecked]);
|
|
7282
7346
|
return {
|
|
7283
7347
|
isHovered,
|
|
7284
7348
|
setIsHovered,
|
|
7285
7349
|
on,
|
|
7286
|
-
setOn
|
|
7350
|
+
setOn,
|
|
7351
|
+
value,
|
|
7352
|
+
setValue
|
|
7287
7353
|
};
|
|
7288
7354
|
};
|
|
7289
7355
|
|
|
@@ -7299,68 +7365,68 @@
|
|
|
7299
7365
|
*/
|
|
7300
7366
|
/**
|
|
7301
7367
|
* Knob (circle) sizes for the Switch component
|
|
7302
|
-
* Following the 4px grid system
|
|
7368
|
+
* Following the 4px grid system - dimensions réduites
|
|
7303
7369
|
*/
|
|
7304
7370
|
var KnobSizes = {
|
|
7305
7371
|
xs: {
|
|
7372
|
+
height: '8px',
|
|
7373
|
+
width: '8px'
|
|
7374
|
+
},
|
|
7375
|
+
sm: {
|
|
7306
7376
|
height: '12px',
|
|
7307
7377
|
width: '12px'
|
|
7308
7378
|
},
|
|
7309
|
-
|
|
7379
|
+
md: {
|
|
7310
7380
|
height: '16px',
|
|
7311
7381
|
width: '16px'
|
|
7312
7382
|
},
|
|
7313
|
-
|
|
7383
|
+
lg: {
|
|
7314
7384
|
height: '20px',
|
|
7315
7385
|
width: '20px'
|
|
7316
7386
|
},
|
|
7317
|
-
|
|
7387
|
+
xl: {
|
|
7318
7388
|
height: '24px',
|
|
7319
7389
|
width: '24px'
|
|
7320
|
-
},
|
|
7321
|
-
xl: {
|
|
7322
|
-
height: '28px',
|
|
7323
|
-
width: '28px'
|
|
7324
7390
|
}
|
|
7325
7391
|
};
|
|
7326
7392
|
/**
|
|
7327
7393
|
* Slider (track) sizes for the Switch component
|
|
7328
|
-
* Following the 4px grid system
|
|
7394
|
+
* Following the 4px grid system - dimensions réduites
|
|
7329
7395
|
*/
|
|
7330
7396
|
var SliderSizes = {
|
|
7331
7397
|
xs: {
|
|
7332
|
-
height: '
|
|
7333
|
-
width: '
|
|
7398
|
+
height: '16px',
|
|
7399
|
+
width: '36px'
|
|
7334
7400
|
},
|
|
7335
7401
|
sm: {
|
|
7336
|
-
height: '
|
|
7337
|
-
width: '
|
|
7402
|
+
height: '20px',
|
|
7403
|
+
width: '44px'
|
|
7338
7404
|
},
|
|
7339
7405
|
md: {
|
|
7340
|
-
height: '
|
|
7341
|
-
width: '
|
|
7406
|
+
height: '24px',
|
|
7407
|
+
width: '52px'
|
|
7342
7408
|
},
|
|
7343
7409
|
lg: {
|
|
7344
|
-
height: '
|
|
7345
|
-
width: '
|
|
7410
|
+
height: '28px',
|
|
7411
|
+
width: '60px'
|
|
7346
7412
|
},
|
|
7347
7413
|
xl: {
|
|
7348
|
-
height: '
|
|
7349
|
-
width: '
|
|
7414
|
+
height: '32px',
|
|
7415
|
+
width: '68px'
|
|
7350
7416
|
}
|
|
7351
7417
|
};
|
|
7352
7418
|
/**
|
|
7353
|
-
* Padding for the Switch slider
|
|
7419
|
+
* Padding for the Switch slider - ajusté pour les nouvelles dimensions
|
|
7354
7420
|
* Following the 4px grid system
|
|
7355
7421
|
*/
|
|
7356
7422
|
var SliderPadding = {
|
|
7357
7423
|
xs: {
|
|
7358
7424
|
paddingVertical: 4,
|
|
7359
|
-
paddingHorizontal:
|
|
7425
|
+
paddingHorizontal: 2
|
|
7360
7426
|
},
|
|
7361
7427
|
sm: {
|
|
7362
7428
|
paddingVertical: 4,
|
|
7363
|
-
paddingHorizontal:
|
|
7429
|
+
paddingHorizontal: 2
|
|
7364
7430
|
},
|
|
7365
7431
|
md: {
|
|
7366
7432
|
paddingVertical: 4,
|
|
@@ -7418,7 +7484,6 @@
|
|
|
7418
7484
|
isHovered = false,
|
|
7419
7485
|
isDisabled = false,
|
|
7420
7486
|
isReadOnly = false,
|
|
7421
|
-
on,
|
|
7422
7487
|
setOn,
|
|
7423
7488
|
onChange,
|
|
7424
7489
|
setValue = () => {},
|
|
@@ -7431,10 +7496,11 @@
|
|
|
7431
7496
|
} = _ref,
|
|
7432
7497
|
props = _objectWithoutPropertiesLoose(_ref, _excluded$q);
|
|
7433
7498
|
var handleToggle = event => {
|
|
7434
|
-
if (!isReadOnly) {
|
|
7435
|
-
|
|
7436
|
-
|
|
7437
|
-
|
|
7499
|
+
if (!isReadOnly && !isDisabled) {
|
|
7500
|
+
var newValue = event.target.checked;
|
|
7501
|
+
setValue(newValue);
|
|
7502
|
+
setOn(newValue);
|
|
7503
|
+
if (onChange) onChange(newValue);
|
|
7438
7504
|
}
|
|
7439
7505
|
};
|
|
7440
7506
|
var handleHover = () => setIsHovered(!isHovered);
|
|
@@ -7482,27 +7548,39 @@
|
|
|
7482
7548
|
// Layout properties
|
|
7483
7549
|
display: "flex",
|
|
7484
7550
|
alignItems: "center",
|
|
7485
|
-
justifyContent: activeChild ? 'space-between' :
|
|
7551
|
+
justifyContent: value ? activeChild ? 'space-between' : 'flex-end' : inActiveChild ? 'space-between' : 'flex-start',
|
|
7486
7552
|
marginBottom: 4,
|
|
7487
7553
|
// Visual properties
|
|
7488
7554
|
borderRadius: "9999px" // Full rounded for pill shape
|
|
7489
7555
|
,
|
|
7490
7556
|
backgroundColor: isDisabled ? ColorSchemes.default.disabled : value ? isHovered ? ColorSchemes.states.hover.active : ColorSchemes.default.active : isHovered ? ColorSchemes.states.hover.inactive : ColorSchemes.default.inactive,
|
|
7557
|
+
overflow: "hidden",
|
|
7491
7558
|
// State properties
|
|
7492
7559
|
cursor: "pointer",
|
|
7493
7560
|
// Animation
|
|
7494
7561
|
transition: "all 0.3s cubic-bezier(0.4, 0, 0.2, 1)"
|
|
7495
7562
|
}, shadow, SliderPadding[size], SliderSizes[size], views['slider']), activeChild && value && (/*#__PURE__*/React__default.createElement(appStudio.View, {
|
|
7496
7563
|
marginLeft: 8,
|
|
7497
|
-
|
|
7564
|
+
marginRight: 4,
|
|
7565
|
+
transition: "all 0.3s ease",
|
|
7566
|
+
display: "flex",
|
|
7567
|
+
alignItems: "center",
|
|
7568
|
+
justifyContent: "center",
|
|
7569
|
+
height: "100%"
|
|
7498
7570
|
}, activeChild)), /*#__PURE__*/React__default.createElement(appStudio.View, Object.assign({
|
|
7499
7571
|
borderRadius: "50%",
|
|
7500
7572
|
backgroundColor: ColorSchemes.default.knob,
|
|
7501
7573
|
boxShadow: "0 1px 2px rgba(0, 0, 0, 0.1)",
|
|
7502
|
-
transition: "all 0.3s cubic-bezier(0.4, 0, 0.2, 1)"
|
|
7574
|
+
transition: "all 0.3s cubic-bezier(0.4, 0, 0.2, 1)",
|
|
7575
|
+
zIndex: 1
|
|
7503
7576
|
}, KnobSizes[size], views['circle'])), inActiveChild && !value && (/*#__PURE__*/React__default.createElement(appStudio.View, {
|
|
7504
7577
|
marginRight: 8,
|
|
7505
|
-
|
|
7578
|
+
marginLeft: 4,
|
|
7579
|
+
transition: "all 0.3s ease",
|
|
7580
|
+
display: "flex",
|
|
7581
|
+
alignItems: "center",
|
|
7582
|
+
justifyContent: "center",
|
|
7583
|
+
height: "100%"
|
|
7506
7584
|
}, inActiveChild))), labelPosition === 'right' && label && (/*#__PURE__*/React__default.createElement(Text, {
|
|
7507
7585
|
fontWeight: "500" // Medium weight for better readability
|
|
7508
7586
|
,
|
|
@@ -7788,7 +7866,7 @@
|
|
|
7788
7866
|
var fieldStyles = Object.assign({
|
|
7789
7867
|
// Layout properties
|
|
7790
7868
|
margin: 0,
|
|
7791
|
-
paddingVertical:
|
|
7869
|
+
paddingVertical: 4,
|
|
7792
7870
|
paddingHorizontal: 0,
|
|
7793
7871
|
width: '100%',
|
|
7794
7872
|
height: '100%',
|
|
@@ -7928,24 +8006,24 @@
|
|
|
7928
8006
|
*/
|
|
7929
8007
|
var Sizes = {
|
|
7930
8008
|
xs: {
|
|
8009
|
+
height: '12px',
|
|
8010
|
+
width: '12px'
|
|
8011
|
+
},
|
|
8012
|
+
sm: {
|
|
7931
8013
|
height: '16px',
|
|
7932
8014
|
width: '16px'
|
|
7933
8015
|
},
|
|
7934
|
-
|
|
8016
|
+
md: {
|
|
7935
8017
|
height: '20px',
|
|
7936
8018
|
width: '20px'
|
|
7937
8019
|
},
|
|
7938
|
-
|
|
8020
|
+
lg: {
|
|
7939
8021
|
height: '24px',
|
|
7940
8022
|
width: '24px'
|
|
7941
8023
|
},
|
|
7942
|
-
|
|
8024
|
+
xl: {
|
|
7943
8025
|
height: '28px',
|
|
7944
8026
|
width: '28px'
|
|
7945
|
-
},
|
|
7946
|
-
xl: {
|
|
7947
|
-
height: '32px',
|
|
7948
|
-
width: '32px'
|
|
7949
8027
|
}
|
|
7950
8028
|
};
|
|
7951
8029
|
/**
|
|
@@ -10183,7 +10261,7 @@
|
|
|
10183
10261
|
hint: placeholder,
|
|
10184
10262
|
isClearable: false,
|
|
10185
10263
|
left: /*#__PURE__*/React__default.createElement(SearchIcon, {
|
|
10186
|
-
widthHeight:
|
|
10264
|
+
widthHeight: 16
|
|
10187
10265
|
}),
|
|
10188
10266
|
views: {
|
|
10189
10267
|
container: Object.assign({
|
|
@@ -12744,17 +12822,17 @@
|
|
|
12744
12822
|
var NavigationMenuSizes = {
|
|
12745
12823
|
sm: {
|
|
12746
12824
|
padding: '8px 12px',
|
|
12747
|
-
fontSize: '
|
|
12825
|
+
fontSize: '12px',
|
|
12748
12826
|
fontWeight: '500'
|
|
12749
12827
|
},
|
|
12750
12828
|
md: {
|
|
12751
12829
|
padding: '12px 16px',
|
|
12752
|
-
fontSize: '
|
|
12830
|
+
fontSize: '14px',
|
|
12753
12831
|
fontWeight: '500'
|
|
12754
12832
|
},
|
|
12755
12833
|
lg: {
|
|
12756
12834
|
padding: '16px 20px',
|
|
12757
|
-
fontSize: '
|
|
12835
|
+
fontSize: '16px',
|
|
12758
12836
|
fontWeight: '500'
|
|
12759
12837
|
}
|
|
12760
12838
|
};
|
|
@@ -13702,8 +13780,8 @@
|
|
|
13702
13780
|
}),
|
|
13703
13781
|
gradient: (color, secondaryColor) => ({
|
|
13704
13782
|
background: "linear-gradient(135deg, " + color + ", " + (secondaryColor || color) + ")",
|
|
13705
|
-
backgroundClip: 'text',
|
|
13706
|
-
webkitBackgroundClip: 'text',
|
|
13783
|
+
backgroundClip: 'text !important',
|
|
13784
|
+
webkitBackgroundClip: 'text !important',
|
|
13707
13785
|
color: 'transparent',
|
|
13708
13786
|
webkitTextFillColor: 'transparent',
|
|
13709
13787
|
display: 'inline-block',
|