@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
package/dist/web.esm.js
CHANGED
|
@@ -463,20 +463,20 @@ var HeadingSizes = {
|
|
|
463
463
|
* Font sizes following typography guidelines
|
|
464
464
|
*/
|
|
465
465
|
var FontSizes = {
|
|
466
|
-
xs: '
|
|
467
|
-
sm: '
|
|
468
|
-
md: '
|
|
469
|
-
lg: '
|
|
466
|
+
xs: '10px',
|
|
467
|
+
sm: '12px',
|
|
468
|
+
md: '14px',
|
|
469
|
+
lg: '16px',
|
|
470
470
|
xl: '20px'
|
|
471
471
|
};
|
|
472
472
|
/**
|
|
473
473
|
* Line heights following typography guidelines
|
|
474
474
|
*/
|
|
475
475
|
var LineHeights = {
|
|
476
|
-
xs: '
|
|
477
|
-
sm: '
|
|
478
|
-
md: '
|
|
479
|
-
lg: '
|
|
476
|
+
xs: '14px',
|
|
477
|
+
sm: '16px',
|
|
478
|
+
md: '20px',
|
|
479
|
+
lg: '22px',
|
|
480
480
|
xl: '28px'
|
|
481
481
|
};
|
|
482
482
|
/**
|
|
@@ -3258,7 +3258,7 @@ var BadgeSizes = {
|
|
|
3258
3258
|
height: '32px',
|
|
3259
3259
|
padding: '0 12px',
|
|
3260
3260
|
// Typography
|
|
3261
|
-
fontSize: '
|
|
3261
|
+
fontSize: '16px',
|
|
3262
3262
|
fontWeight: '500',
|
|
3263
3263
|
lineHeight: '32px'
|
|
3264
3264
|
},
|
|
@@ -3268,7 +3268,7 @@ var BadgeSizes = {
|
|
|
3268
3268
|
height: '36px',
|
|
3269
3269
|
padding: '0 14px',
|
|
3270
3270
|
// Typography
|
|
3271
|
-
fontSize: '
|
|
3271
|
+
fontSize: '20px',
|
|
3272
3272
|
fontWeight: '500',
|
|
3273
3273
|
lineHeight: '36px'
|
|
3274
3274
|
}
|
|
@@ -3679,70 +3679,60 @@ var Loader = LoaderComponent;
|
|
|
3679
3679
|
*/
|
|
3680
3680
|
/**
|
|
3681
3681
|
* Button sizes following the 4px grid system
|
|
3682
|
-
*/
|
|
3683
|
-
var ButtonSizes = {
|
|
3682
|
+
*/var ButtonSizes = {
|
|
3684
3683
|
xs: {
|
|
3685
|
-
|
|
3684
|
+
minHeight: 3 * 4,
|
|
3685
|
+
paddingTop: 1,
|
|
3686
|
+
paddingBottom: 1,
|
|
3687
|
+
paddingLeft: 2,
|
|
3688
|
+
paddingRight: 2,
|
|
3689
|
+
fontSize: 10,
|
|
3690
|
+
fontWeight: '500',
|
|
3691
|
+
lineHeight: 14,
|
|
3692
|
+
letterSpacing: '-0.01em'
|
|
3693
|
+
},
|
|
3694
|
+
sm: {
|
|
3686
3695
|
minHeight: 4 * 4,
|
|
3687
|
-
paddingTop:
|
|
3688
|
-
paddingBottom:
|
|
3689
|
-
paddingLeft:
|
|
3690
|
-
paddingRight:
|
|
3691
|
-
// Typography
|
|
3696
|
+
paddingTop: 4,
|
|
3697
|
+
paddingBottom: 4,
|
|
3698
|
+
paddingLeft: 8,
|
|
3699
|
+
paddingRight: 8,
|
|
3692
3700
|
fontSize: 12,
|
|
3693
3701
|
fontWeight: '500',
|
|
3694
|
-
lineHeight:
|
|
3702
|
+
lineHeight: 16,
|
|
3695
3703
|
letterSpacing: '-0.01em'
|
|
3696
3704
|
},
|
|
3697
|
-
|
|
3698
|
-
// Height: 32px (8 × 4px)
|
|
3705
|
+
md: {
|
|
3699
3706
|
minHeight: 6 * 4,
|
|
3700
3707
|
paddingTop: 6,
|
|
3701
3708
|
paddingBottom: 6,
|
|
3702
3709
|
paddingLeft: 12,
|
|
3703
3710
|
paddingRight: 12,
|
|
3704
|
-
|
|
3705
|
-
fontSize: 12,
|
|
3711
|
+
fontSize: 14,
|
|
3706
3712
|
fontWeight: '500',
|
|
3707
|
-
lineHeight:
|
|
3713
|
+
lineHeight: 18,
|
|
3708
3714
|
letterSpacing: '-0.01em'
|
|
3709
3715
|
},
|
|
3710
|
-
|
|
3711
|
-
// Height: 40px (10 × 4px) - standard height for interactive elements
|
|
3716
|
+
lg: {
|
|
3712
3717
|
minHeight: 8 * 4,
|
|
3713
3718
|
paddingTop: 8,
|
|
3714
3719
|
paddingBottom: 8,
|
|
3715
3720
|
paddingLeft: 16,
|
|
3716
3721
|
paddingRight: 16,
|
|
3717
|
-
// Typography
|
|
3718
3722
|
fontSize: 16,
|
|
3719
3723
|
fontWeight: '500',
|
|
3720
|
-
lineHeight:
|
|
3724
|
+
lineHeight: 18,
|
|
3721
3725
|
letterSpacing: '-0.01em'
|
|
3722
3726
|
},
|
|
3723
|
-
|
|
3727
|
+
xl: {
|
|
3724
3728
|
minHeight: 10 * 4,
|
|
3725
3729
|
paddingTop: 10,
|
|
3726
3730
|
paddingBottom: 10,
|
|
3727
3731
|
paddingLeft: 20,
|
|
3728
3732
|
paddingRight: 20,
|
|
3729
|
-
|
|
3730
|
-
fontSize: 16,
|
|
3731
|
-
fontWeight: '500',
|
|
3732
|
-
lineHeight: 20,
|
|
3733
|
-
letterSpacing: '-0.01em'
|
|
3734
|
-
},
|
|
3735
|
-
xl: {
|
|
3736
|
-
// Height: 60px (15 × 4px)
|
|
3737
|
-
minHeight: 12 * 4,
|
|
3738
|
-
paddingTop: 12,
|
|
3739
|
-
paddingBottom: 12,
|
|
3740
|
-
paddingLeft: 24,
|
|
3741
|
-
paddingRight: 24,
|
|
3742
|
-
// Typography
|
|
3743
|
-
fontSize: 18,
|
|
3733
|
+
fontSize: 20,
|
|
3744
3734
|
fontWeight: '500',
|
|
3745
|
-
lineHeight:
|
|
3735
|
+
lineHeight: 22,
|
|
3746
3736
|
letterSpacing: '-0.01em'
|
|
3747
3737
|
}
|
|
3748
3738
|
};
|
|
@@ -6493,13 +6483,12 @@ var useSelectState = _ref => {
|
|
|
6493
6483
|
var {
|
|
6494
6484
|
placeholder,
|
|
6495
6485
|
isMulti,
|
|
6496
|
-
options
|
|
6486
|
+
options,
|
|
6487
|
+
id = "select-" + Math.random().toString(36).substr(2, 9)
|
|
6497
6488
|
} = _ref;
|
|
6498
6489
|
// 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
|
|
6499
6490
|
var defaultValue = placeholder ? isMulti ? [] : '' // If there's a placeholder, set default to empty array for multi-select or empty string for single select
|
|
6500
|
-
: Array.isArray(options) && options.length > 0 ? options[0].value : ''; // If no placeholder, use the first option value if available, otherwise
|
|
6501
|
-
// State hook for managing visibility of the Select dropdown, initially set to hidden
|
|
6502
|
-
var [hide, setHide] = React.useState(true);
|
|
6491
|
+
: 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
|
|
6503
6492
|
// State hook for tracking mouse hover status over the Select component
|
|
6504
6493
|
var [isHovered, setIsHovered] = React.useState(false);
|
|
6505
6494
|
// State hook for tracking focus status of the Select input field
|
|
@@ -6508,8 +6497,11 @@ var useSelectState = _ref => {
|
|
|
6508
6497
|
var [value, setValue] = React.useState(defaultValue);
|
|
6509
6498
|
// State hook for keeping track of the currently highlighted index in the options list
|
|
6510
6499
|
var [highlightedIndex, setHighlightedIndex] = React.useState(0);
|
|
6500
|
+
// State hook for managing visibility of the Select dropdown, initially set to hidden
|
|
6501
|
+
var [hide, setHide] = React.useState(true);
|
|
6511
6502
|
// Returns an object containing all stateful values and their associated setters to manage the Select component's state
|
|
6512
6503
|
return {
|
|
6504
|
+
id,
|
|
6513
6505
|
value,
|
|
6514
6506
|
setValue,
|
|
6515
6507
|
hide,
|
|
@@ -6724,7 +6716,7 @@ var FieldContent = _ref => {
|
|
|
6724
6716
|
flexWrap: "nowrap",
|
|
6725
6717
|
alignItems: "center",
|
|
6726
6718
|
justifyContent: "space-between",
|
|
6727
|
-
marginBottom:
|
|
6719
|
+
marginBottom: 2,
|
|
6728
6720
|
// Visual properties
|
|
6729
6721
|
borderStyle: "solid",
|
|
6730
6722
|
borderColor: color,
|
|
@@ -6746,10 +6738,9 @@ var FieldIcons = _ref => {
|
|
|
6746
6738
|
props = _objectWithoutPropertiesLoose(_ref, _excluded$l);
|
|
6747
6739
|
return /*#__PURE__*/React.createElement(Center, Object.assign({
|
|
6748
6740
|
gap: 10,
|
|
6749
|
-
right:
|
|
6741
|
+
right: 10,
|
|
6750
6742
|
zIndex: 500,
|
|
6751
|
-
flexWrap: "nowrap"
|
|
6752
|
-
position: "absolute"
|
|
6743
|
+
flexWrap: "nowrap"
|
|
6753
6744
|
}, props), children);
|
|
6754
6745
|
};
|
|
6755
6746
|
|
|
@@ -6933,20 +6924,27 @@ var Item = _ref => {
|
|
|
6933
6924
|
} = _ref,
|
|
6934
6925
|
props = _objectWithoutPropertiesLoose(_ref, _excluded$p);
|
|
6935
6926
|
// Handles the click event on an option by invoking the callback with the selected option's value
|
|
6936
|
-
var handleOptionClick = option =>
|
|
6927
|
+
var handleOptionClick = (e, option) => {
|
|
6928
|
+
e.stopPropagation();
|
|
6929
|
+
e.preventDefault();
|
|
6930
|
+
if (typeof callback === 'function') {
|
|
6931
|
+
callback(option);
|
|
6932
|
+
}
|
|
6933
|
+
};
|
|
6937
6934
|
// Toggles the hover state on the item
|
|
6938
6935
|
var handleHover = () => setIsHovered(!isHovered);
|
|
6939
6936
|
return /*#__PURE__*/React.createElement(Element, Object.assign({
|
|
6940
6937
|
as: "li",
|
|
6941
6938
|
// Layout properties
|
|
6942
6939
|
margin: 0,
|
|
6943
|
-
paddingVertical:
|
|
6944
|
-
paddingHorizontal:
|
|
6940
|
+
paddingVertical: 8,
|
|
6941
|
+
paddingHorizontal: 8,
|
|
6945
6942
|
listStyleType: "none",
|
|
6943
|
+
cursor: "pointer",
|
|
6946
6944
|
// Event handlers
|
|
6947
6945
|
onMouseEnter: handleHover,
|
|
6948
6946
|
onMouseLeave: handleHover,
|
|
6949
|
-
onClick:
|
|
6947
|
+
onClick: e => handleOptionClick(e, option.value),
|
|
6950
6948
|
// Visual properties
|
|
6951
6949
|
backgroundColor: isHovered ? 'color.gray.100' : 'transparent',
|
|
6952
6950
|
borderRadius: "4px" // Subtle rounded corners for items
|
|
@@ -6992,7 +6990,7 @@ var SelectBox = _ref2 => {
|
|
|
6992
6990
|
width: '95%',
|
|
6993
6991
|
height: '100%',
|
|
6994
6992
|
border: 'none',
|
|
6995
|
-
paddingVertical:
|
|
6993
|
+
paddingVertical: 4,
|
|
6996
6994
|
paddingHorizontal: 0,
|
|
6997
6995
|
// Typography properties
|
|
6998
6996
|
fontSize: Typography.fontSizes[size],
|
|
@@ -7072,34 +7070,16 @@ var DropDown = _ref5 => {
|
|
|
7072
7070
|
} = _ref5;
|
|
7073
7071
|
var itemStates = useItemState();
|
|
7074
7072
|
var handleCallback = option => callback(option);
|
|
7075
|
-
// Shadow styles for the dropdown
|
|
7076
|
-
var shadow = {
|
|
7077
|
-
boxShadow: '0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)'
|
|
7078
|
-
};
|
|
7073
|
+
// Shadow styles for the dropdown - now applied directly in the Element
|
|
7079
7074
|
return /*#__PURE__*/React.createElement(Element, Object.assign({
|
|
7080
7075
|
as: "ul",
|
|
7081
7076
|
role: "dropdown",
|
|
7082
|
-
top: "100%",
|
|
7083
7077
|
width: "100%",
|
|
7084
7078
|
display: "flex",
|
|
7085
7079
|
flexDirection: "column",
|
|
7086
|
-
position: "absolute",
|
|
7087
|
-
marginTop: 8,
|
|
7088
|
-
marginLeft: 0,
|
|
7089
|
-
marginRight: 0,
|
|
7090
|
-
marginBottom: 0,
|
|
7091
|
-
padding: 0,
|
|
7092
|
-
maxHeight: "240px" // 60 × 4px grid
|
|
7093
|
-
,
|
|
7094
|
-
overflowY: "auto",
|
|
7095
|
-
zIndex: 1000,
|
|
7096
7080
|
backgroundColor: "color.white",
|
|
7097
|
-
borderRadius: "8px" // Consistent with design system (rounded-md)
|
|
7098
|
-
,
|
|
7099
|
-
borderWidth: "1px",
|
|
7100
|
-
borderStyle: "solid",
|
|
7101
|
-
borderColor: "color.gray.200",
|
|
7102
7081
|
transition: "all 0.2s ease",
|
|
7082
|
+
margin: 0,
|
|
7103
7083
|
style: {
|
|
7104
7084
|
scrollbarWidth: 'thin',
|
|
7105
7085
|
scrollbarColor: 'rgba(0, 0, 0, 0.2) transparent',
|
|
@@ -7114,7 +7094,7 @@ var DropDown = _ref5 => {
|
|
|
7114
7094
|
borderRadius: '4px'
|
|
7115
7095
|
}
|
|
7116
7096
|
}
|
|
7117
|
-
},
|
|
7097
|
+
}, views == null ? void 0 : views.dropDown), options && options.length > 0 && options.map((option, index) => (/*#__PURE__*/React.createElement(Item, Object.assign({
|
|
7118
7098
|
key: option.value,
|
|
7119
7099
|
size: size,
|
|
7120
7100
|
style: views['text'],
|
|
@@ -7197,23 +7177,57 @@ var SelectView = _ref7 => {
|
|
|
7197
7177
|
highlightedIndex
|
|
7198
7178
|
} = _ref7,
|
|
7199
7179
|
props = _objectWithoutPropertiesLoose(_ref7, _excluded4$6);
|
|
7180
|
+
// close when *any* other select opens
|
|
7181
|
+
React.useEffect(() => {
|
|
7182
|
+
var handleCloseAll = () => setHide(true);
|
|
7183
|
+
document.addEventListener('closeAllSelects', handleCloseAll);
|
|
7184
|
+
return () => document.removeEventListener('closeAllSelects', handleCloseAll);
|
|
7185
|
+
}, [setHide]);
|
|
7186
|
+
// Add a global click handler to close the dropdown when clicking outside
|
|
7187
|
+
React.useEffect(() => {
|
|
7188
|
+
var handleGlobalClick = e => {
|
|
7189
|
+
var target = e.target;
|
|
7190
|
+
// Only close if clicking outside of this specific select component
|
|
7191
|
+
if (!target.closest("#" + id) && !hide) {
|
|
7192
|
+
setHide(true);
|
|
7193
|
+
}
|
|
7194
|
+
};
|
|
7195
|
+
document.addEventListener('click', handleGlobalClick);
|
|
7196
|
+
return () => {
|
|
7197
|
+
document.removeEventListener('click', handleGlobalClick);
|
|
7198
|
+
};
|
|
7199
|
+
}, [id, hide, setHide]);
|
|
7200
7200
|
var showLabel = !!(isFocused && label);
|
|
7201
7201
|
var handleHover = () => setIsHovered(!isHovered);
|
|
7202
7202
|
var handleFocus = () => setIsFocused(true);
|
|
7203
7203
|
var handleClick = event => {
|
|
7204
|
+
// tell all other selects to close
|
|
7205
|
+
document.dispatchEvent(new Event('closeAllSelects'));
|
|
7204
7206
|
if (event && event.stopPropagation) event.stopPropagation();
|
|
7205
|
-
|
|
7206
|
-
|
|
7207
|
+
// Toggle dropdown visibility
|
|
7208
|
+
var newHideState = !hide;
|
|
7209
|
+
setHide(newHideState);
|
|
7210
|
+
setIsFocused(!newHideState); // Set focus state based on dropdown visibility
|
|
7207
7211
|
};
|
|
7208
7212
|
var handleCallback = useCallback(option => {
|
|
7209
|
-
|
|
7213
|
+
// Close dropdown after selection
|
|
7214
|
+
setHide(true);
|
|
7215
|
+
// Tell all other selects to close
|
|
7216
|
+
document.dispatchEvent(new Event('closeAllSelects'));
|
|
7217
|
+
// Update value based on multi-select or single-select mode
|
|
7210
7218
|
if (isMulti && Array.isArray(value)) {
|
|
7211
|
-
!value.includes(option)
|
|
7219
|
+
if (!value.includes(option)) {
|
|
7220
|
+
var newValue = [...value, option];
|
|
7221
|
+
setValue(newValue);
|
|
7222
|
+
if (onChange) onChange(option);
|
|
7223
|
+
}
|
|
7212
7224
|
} else {
|
|
7213
7225
|
setValue(option);
|
|
7226
|
+
if (onChange) onChange(option);
|
|
7214
7227
|
}
|
|
7215
|
-
|
|
7216
|
-
|
|
7228
|
+
// Set focus to indicate selection
|
|
7229
|
+
setIsFocused(true);
|
|
7230
|
+
}, [isMulti, value, setHide, setValue, onChange, setIsFocused]);
|
|
7217
7231
|
var handleRemoveOption = valueOption => {
|
|
7218
7232
|
if (Array.isArray(value) && value.includes(valueOption)) {
|
|
7219
7233
|
var newValue = value.filter(option => option !== valueOption);
|
|
@@ -7221,11 +7235,24 @@ var SelectView = _ref7 => {
|
|
|
7221
7235
|
}
|
|
7222
7236
|
};
|
|
7223
7237
|
return /*#__PURE__*/React.createElement(FieldContainer, {
|
|
7238
|
+
style: {
|
|
7239
|
+
position: 'relative',
|
|
7240
|
+
width: '100%',
|
|
7241
|
+
display: 'inline-block'
|
|
7242
|
+
},
|
|
7243
|
+
id: id,
|
|
7224
7244
|
role: "SelectBox",
|
|
7225
7245
|
helperText: helperText,
|
|
7226
7246
|
error: error,
|
|
7227
7247
|
views: views,
|
|
7228
|
-
onClick:
|
|
7248
|
+
onClick: e => {
|
|
7249
|
+
// Stop propagation to prevent clicks from bubbling up
|
|
7250
|
+
e.stopPropagation();
|
|
7251
|
+
// Only handle click if not disabled or readonly
|
|
7252
|
+
if (!(isDisabled || isReadOnly)) {
|
|
7253
|
+
handleClick(e);
|
|
7254
|
+
}
|
|
7255
|
+
}
|
|
7229
7256
|
}, /*#__PURE__*/React.createElement(FieldContent, {
|
|
7230
7257
|
label: label,
|
|
7231
7258
|
size: size,
|
|
@@ -7275,39 +7302,78 @@ var SelectView = _ref7 => {
|
|
|
7275
7302
|
orientation: "up",
|
|
7276
7303
|
widthHeight: IconSizes$2[size],
|
|
7277
7304
|
style: views.icon
|
|
7278
|
-
})))))), !hide && (/*#__PURE__*/React.createElement(
|
|
7305
|
+
})))))), !hide && options.length > 0 && (/*#__PURE__*/React.createElement(Element, {
|
|
7306
|
+
onClick: e => e.stopPropagation(),
|
|
7307
|
+
style: {
|
|
7308
|
+
position: 'absolute',
|
|
7309
|
+
top: 'calc(100% + 4px)',
|
|
7310
|
+
left: 0,
|
|
7311
|
+
right: 0,
|
|
7312
|
+
zIndex: 1000
|
|
7313
|
+
}
|
|
7314
|
+
}, /*#__PURE__*/React.createElement(DropDown, {
|
|
7279
7315
|
size: size,
|
|
7280
|
-
views: views,
|
|
7316
|
+
views: Object.assign({}, views, {
|
|
7317
|
+
dropDown: {
|
|
7318
|
+
borderRadius: '6px',
|
|
7319
|
+
border: '1px solid color.gray.200',
|
|
7320
|
+
boxShadow: '0 8px 16px rgba(0,0,0,0.1)',
|
|
7321
|
+
padding: '8px',
|
|
7322
|
+
maxHeight: '240px',
|
|
7323
|
+
overflowY: 'auto'
|
|
7324
|
+
}
|
|
7325
|
+
}),
|
|
7281
7326
|
options: options,
|
|
7282
7327
|
callback: handleCallback,
|
|
7283
7328
|
highlightedIndex: highlightedIndex,
|
|
7284
7329
|
setHighlightedIndex: setHighlightedIndex
|
|
7285
|
-
})));
|
|
7330
|
+
}))));
|
|
7286
7331
|
};
|
|
7287
7332
|
|
|
7288
7333
|
// Defines a functional component named 'SelectComponent', which is expected to receive 'SelectProps' as properties.
|
|
7289
7334
|
var SelectComponent = props => {
|
|
7335
|
+
// Ensure options is always an array
|
|
7336
|
+
var safeProps = Object.assign({}, props, {
|
|
7337
|
+
options: props.options || []
|
|
7338
|
+
});
|
|
7290
7339
|
// Invokes the 'useSelectState' hook with props to obtain stateful logic for the Select component.
|
|
7291
|
-
var selectStates = useSelectState(
|
|
7340
|
+
var selectStates = useSelectState(safeProps);
|
|
7292
7341
|
// Renders the 'SelectView' component, passing along any states controlled by 'useSelectState' and all properties passed to 'SelectComponent'.
|
|
7293
|
-
return /*#__PURE__*/React.createElement(SelectView, Object.assign({}, selectStates,
|
|
7342
|
+
return /*#__PURE__*/React.createElement(SelectView, Object.assign({}, selectStates, safeProps, {
|
|
7343
|
+
onClick: e => {
|
|
7344
|
+
// Stop propagation to prevent the global click handler from closing other dropdowns
|
|
7345
|
+
e.stopPropagation();
|
|
7346
|
+
if (props.onClick) props.onClick(e);
|
|
7347
|
+
}
|
|
7348
|
+
}));
|
|
7294
7349
|
};
|
|
7295
7350
|
// Exports 'SelectComponent' as 'Select', making it available for import in other parts of the application.
|
|
7296
7351
|
var Select = SelectComponent;
|
|
7297
7352
|
|
|
7298
|
-
// This file defines a custom hook for managing the state of a Switch component.
|
|
7353
|
+
// This file defines a custom hook for managing the state of a Switch component.
|
|
7354
|
+
// It allows tracking whether the switch is hovered, and its on/off state based on 'isDisabled' and 'isChecked' properties.
|
|
7299
7355
|
var useSwitchState = _ref => {
|
|
7300
7356
|
var {
|
|
7301
7357
|
isDisabled,
|
|
7302
7358
|
isChecked
|
|
7303
7359
|
} = _ref;
|
|
7304
7360
|
var [isHovered, setIsHovered] = React.useState(false);
|
|
7305
|
-
var [on, setOn] = React.useState(
|
|
7361
|
+
var [on, setOn] = React.useState(isChecked || false);
|
|
7362
|
+
var [value, setValue] = React.useState(isChecked || false);
|
|
7363
|
+
// Update the value when isChecked changes
|
|
7364
|
+
useEffect(() => {
|
|
7365
|
+
if (isChecked !== undefined) {
|
|
7366
|
+
setOn(isChecked);
|
|
7367
|
+
setValue(isChecked);
|
|
7368
|
+
}
|
|
7369
|
+
}, [isChecked]);
|
|
7306
7370
|
return {
|
|
7307
7371
|
isHovered,
|
|
7308
7372
|
setIsHovered,
|
|
7309
7373
|
on,
|
|
7310
|
-
setOn
|
|
7374
|
+
setOn,
|
|
7375
|
+
value,
|
|
7376
|
+
setValue
|
|
7311
7377
|
};
|
|
7312
7378
|
};
|
|
7313
7379
|
|
|
@@ -7323,68 +7389,68 @@ var useSwitchState = _ref => {
|
|
|
7323
7389
|
*/
|
|
7324
7390
|
/**
|
|
7325
7391
|
* Knob (circle) sizes for the Switch component
|
|
7326
|
-
* Following the 4px grid system
|
|
7392
|
+
* Following the 4px grid system - dimensions réduites
|
|
7327
7393
|
*/
|
|
7328
7394
|
var KnobSizes = {
|
|
7329
7395
|
xs: {
|
|
7396
|
+
height: '8px',
|
|
7397
|
+
width: '8px'
|
|
7398
|
+
},
|
|
7399
|
+
sm: {
|
|
7330
7400
|
height: '12px',
|
|
7331
7401
|
width: '12px'
|
|
7332
7402
|
},
|
|
7333
|
-
|
|
7403
|
+
md: {
|
|
7334
7404
|
height: '16px',
|
|
7335
7405
|
width: '16px'
|
|
7336
7406
|
},
|
|
7337
|
-
|
|
7407
|
+
lg: {
|
|
7338
7408
|
height: '20px',
|
|
7339
7409
|
width: '20px'
|
|
7340
7410
|
},
|
|
7341
|
-
|
|
7411
|
+
xl: {
|
|
7342
7412
|
height: '24px',
|
|
7343
7413
|
width: '24px'
|
|
7344
|
-
},
|
|
7345
|
-
xl: {
|
|
7346
|
-
height: '28px',
|
|
7347
|
-
width: '28px'
|
|
7348
7414
|
}
|
|
7349
7415
|
};
|
|
7350
7416
|
/**
|
|
7351
7417
|
* Slider (track) sizes for the Switch component
|
|
7352
|
-
* Following the 4px grid system
|
|
7418
|
+
* Following the 4px grid system - dimensions réduites
|
|
7353
7419
|
*/
|
|
7354
7420
|
var SliderSizes = {
|
|
7355
7421
|
xs: {
|
|
7356
|
-
height: '
|
|
7357
|
-
width: '
|
|
7422
|
+
height: '16px',
|
|
7423
|
+
width: '36px'
|
|
7358
7424
|
},
|
|
7359
7425
|
sm: {
|
|
7360
|
-
height: '
|
|
7361
|
-
width: '
|
|
7426
|
+
height: '20px',
|
|
7427
|
+
width: '44px'
|
|
7362
7428
|
},
|
|
7363
7429
|
md: {
|
|
7364
|
-
height: '
|
|
7365
|
-
width: '
|
|
7430
|
+
height: '24px',
|
|
7431
|
+
width: '52px'
|
|
7366
7432
|
},
|
|
7367
7433
|
lg: {
|
|
7368
|
-
height: '
|
|
7369
|
-
width: '
|
|
7434
|
+
height: '28px',
|
|
7435
|
+
width: '60px'
|
|
7370
7436
|
},
|
|
7371
7437
|
xl: {
|
|
7372
|
-
height: '
|
|
7373
|
-
width: '
|
|
7438
|
+
height: '32px',
|
|
7439
|
+
width: '68px'
|
|
7374
7440
|
}
|
|
7375
7441
|
};
|
|
7376
7442
|
/**
|
|
7377
|
-
* Padding for the Switch slider
|
|
7443
|
+
* Padding for the Switch slider - ajusté pour les nouvelles dimensions
|
|
7378
7444
|
* Following the 4px grid system
|
|
7379
7445
|
*/
|
|
7380
7446
|
var SliderPadding = {
|
|
7381
7447
|
xs: {
|
|
7382
7448
|
paddingVertical: 4,
|
|
7383
|
-
paddingHorizontal:
|
|
7449
|
+
paddingHorizontal: 2
|
|
7384
7450
|
},
|
|
7385
7451
|
sm: {
|
|
7386
7452
|
paddingVertical: 4,
|
|
7387
|
-
paddingHorizontal:
|
|
7453
|
+
paddingHorizontal: 2
|
|
7388
7454
|
},
|
|
7389
7455
|
md: {
|
|
7390
7456
|
paddingVertical: 4,
|
|
@@ -7442,7 +7508,6 @@ var SwitchView = _ref => {
|
|
|
7442
7508
|
isHovered = false,
|
|
7443
7509
|
isDisabled = false,
|
|
7444
7510
|
isReadOnly = false,
|
|
7445
|
-
on,
|
|
7446
7511
|
setOn,
|
|
7447
7512
|
onChange,
|
|
7448
7513
|
setValue = () => {},
|
|
@@ -7455,10 +7520,11 @@ var SwitchView = _ref => {
|
|
|
7455
7520
|
} = _ref,
|
|
7456
7521
|
props = _objectWithoutPropertiesLoose(_ref, _excluded$q);
|
|
7457
7522
|
var handleToggle = event => {
|
|
7458
|
-
if (!isReadOnly) {
|
|
7459
|
-
|
|
7460
|
-
|
|
7461
|
-
|
|
7523
|
+
if (!isReadOnly && !isDisabled) {
|
|
7524
|
+
var newValue = event.target.checked;
|
|
7525
|
+
setValue(newValue);
|
|
7526
|
+
setOn(newValue);
|
|
7527
|
+
if (onChange) onChange(newValue);
|
|
7462
7528
|
}
|
|
7463
7529
|
};
|
|
7464
7530
|
var handleHover = () => setIsHovered(!isHovered);
|
|
@@ -7506,27 +7572,39 @@ var SwitchView = _ref => {
|
|
|
7506
7572
|
// Layout properties
|
|
7507
7573
|
display: "flex",
|
|
7508
7574
|
alignItems: "center",
|
|
7509
|
-
justifyContent: activeChild ? 'space-between' :
|
|
7575
|
+
justifyContent: value ? activeChild ? 'space-between' : 'flex-end' : inActiveChild ? 'space-between' : 'flex-start',
|
|
7510
7576
|
marginBottom: 4,
|
|
7511
7577
|
// Visual properties
|
|
7512
7578
|
borderRadius: "9999px" // Full rounded for pill shape
|
|
7513
7579
|
,
|
|
7514
7580
|
backgroundColor: isDisabled ? ColorSchemes.default.disabled : value ? isHovered ? ColorSchemes.states.hover.active : ColorSchemes.default.active : isHovered ? ColorSchemes.states.hover.inactive : ColorSchemes.default.inactive,
|
|
7581
|
+
overflow: "hidden",
|
|
7515
7582
|
// State properties
|
|
7516
7583
|
cursor: "pointer",
|
|
7517
7584
|
// Animation
|
|
7518
7585
|
transition: "all 0.3s cubic-bezier(0.4, 0, 0.2, 1)"
|
|
7519
7586
|
}, shadow, SliderPadding[size], SliderSizes[size], views['slider']), activeChild && value && (/*#__PURE__*/React.createElement(View, {
|
|
7520
7587
|
marginLeft: 8,
|
|
7521
|
-
|
|
7588
|
+
marginRight: 4,
|
|
7589
|
+
transition: "all 0.3s ease",
|
|
7590
|
+
display: "flex",
|
|
7591
|
+
alignItems: "center",
|
|
7592
|
+
justifyContent: "center",
|
|
7593
|
+
height: "100%"
|
|
7522
7594
|
}, activeChild)), /*#__PURE__*/React.createElement(View, Object.assign({
|
|
7523
7595
|
borderRadius: "50%",
|
|
7524
7596
|
backgroundColor: ColorSchemes.default.knob,
|
|
7525
7597
|
boxShadow: "0 1px 2px rgba(0, 0, 0, 0.1)",
|
|
7526
|
-
transition: "all 0.3s cubic-bezier(0.4, 0, 0.2, 1)"
|
|
7598
|
+
transition: "all 0.3s cubic-bezier(0.4, 0, 0.2, 1)",
|
|
7599
|
+
zIndex: 1
|
|
7527
7600
|
}, KnobSizes[size], views['circle'])), inActiveChild && !value && (/*#__PURE__*/React.createElement(View, {
|
|
7528
7601
|
marginRight: 8,
|
|
7529
|
-
|
|
7602
|
+
marginLeft: 4,
|
|
7603
|
+
transition: "all 0.3s ease",
|
|
7604
|
+
display: "flex",
|
|
7605
|
+
alignItems: "center",
|
|
7606
|
+
justifyContent: "center",
|
|
7607
|
+
height: "100%"
|
|
7530
7608
|
}, inActiveChild))), labelPosition === 'right' && label && (/*#__PURE__*/React.createElement(Text, {
|
|
7531
7609
|
fontWeight: "500" // Medium weight for better readability
|
|
7532
7610
|
,
|
|
@@ -7812,7 +7890,7 @@ var TextFieldView = _ref => {
|
|
|
7812
7890
|
var fieldStyles = Object.assign({
|
|
7813
7891
|
// Layout properties
|
|
7814
7892
|
margin: 0,
|
|
7815
|
-
paddingVertical:
|
|
7893
|
+
paddingVertical: 4,
|
|
7816
7894
|
paddingHorizontal: 0,
|
|
7817
7895
|
width: '100%',
|
|
7818
7896
|
height: '100%',
|
|
@@ -7952,24 +8030,24 @@ var useCheckboxState = _ref => {
|
|
|
7952
8030
|
*/
|
|
7953
8031
|
var Sizes = {
|
|
7954
8032
|
xs: {
|
|
8033
|
+
height: '12px',
|
|
8034
|
+
width: '12px'
|
|
8035
|
+
},
|
|
8036
|
+
sm: {
|
|
7955
8037
|
height: '16px',
|
|
7956
8038
|
width: '16px'
|
|
7957
8039
|
},
|
|
7958
|
-
|
|
8040
|
+
md: {
|
|
7959
8041
|
height: '20px',
|
|
7960
8042
|
width: '20px'
|
|
7961
8043
|
},
|
|
7962
|
-
|
|
8044
|
+
lg: {
|
|
7963
8045
|
height: '24px',
|
|
7964
8046
|
width: '24px'
|
|
7965
8047
|
},
|
|
7966
|
-
|
|
8048
|
+
xl: {
|
|
7967
8049
|
height: '28px',
|
|
7968
8050
|
width: '28px'
|
|
7969
|
-
},
|
|
7970
|
-
xl: {
|
|
7971
|
-
height: '32px',
|
|
7972
|
-
width: '32px'
|
|
7973
8051
|
}
|
|
7974
8052
|
};
|
|
7975
8053
|
/**
|
|
@@ -10207,7 +10285,7 @@ var ComboBoxView = _ref => {
|
|
|
10207
10285
|
hint: placeholder,
|
|
10208
10286
|
isClearable: false,
|
|
10209
10287
|
left: /*#__PURE__*/React.createElement(SearchIcon, {
|
|
10210
|
-
widthHeight:
|
|
10288
|
+
widthHeight: 16
|
|
10211
10289
|
}),
|
|
10212
10290
|
views: {
|
|
10213
10291
|
container: Object.assign({
|
|
@@ -12768,17 +12846,17 @@ var useNavigationMenuState = function useNavigationMenuState(defaultActiveItemId
|
|
|
12768
12846
|
var NavigationMenuSizes = {
|
|
12769
12847
|
sm: {
|
|
12770
12848
|
padding: '8px 12px',
|
|
12771
|
-
fontSize: '
|
|
12849
|
+
fontSize: '12px',
|
|
12772
12850
|
fontWeight: '500'
|
|
12773
12851
|
},
|
|
12774
12852
|
md: {
|
|
12775
12853
|
padding: '12px 16px',
|
|
12776
|
-
fontSize: '
|
|
12854
|
+
fontSize: '14px',
|
|
12777
12855
|
fontWeight: '500'
|
|
12778
12856
|
},
|
|
12779
12857
|
lg: {
|
|
12780
12858
|
padding: '16px 20px',
|
|
12781
|
-
fontSize: '
|
|
12859
|
+
fontSize: '16px',
|
|
12782
12860
|
fontWeight: '500'
|
|
12783
12861
|
}
|
|
12784
12862
|
};
|
|
@@ -13726,8 +13804,8 @@ var HighlightStyles = {
|
|
|
13726
13804
|
}),
|
|
13727
13805
|
gradient: (color, secondaryColor) => ({
|
|
13728
13806
|
background: "linear-gradient(135deg, " + color + ", " + (secondaryColor || color) + ")",
|
|
13729
|
-
backgroundClip: 'text',
|
|
13730
|
-
webkitBackgroundClip: 'text',
|
|
13807
|
+
backgroundClip: 'text !important',
|
|
13808
|
+
webkitBackgroundClip: 'text !important',
|
|
13731
13809
|
color: 'transparent',
|
|
13732
13810
|
webkitTextFillColor: 'transparent',
|
|
13733
13811
|
display: 'inline-block',
|