@app-studio/web 0.8.71 → 0.8.73
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/Password/Password/Password.state.d.ts +1 -1
- package/dist/components/HoverCard/HoverCard/HoverCard.props.d.ts +65 -0
- package/dist/components/HoverCard/HoverCard/HoverCard.state.d.ts +5 -0
- package/dist/components/HoverCard/HoverCard/HoverCard.style.d.ts +3 -0
- package/dist/components/HoverCard/HoverCard/HoverCard.type.d.ts +6 -0
- package/dist/components/HoverCard/HoverCard/HoverCard.view.d.ts +10 -0
- package/dist/components/HoverCard/HoverCard.d.ts +2 -0
- package/dist/components/HoverCard/examples/default.d.ts +2 -0
- package/dist/components/HoverCard/examples/index.d.ts +1 -0
- package/dist/components/Slider/Slider/Slider.props.d.ts +112 -0
- package/dist/components/Slider/Slider/Slider.state.d.ts +14 -0
- package/dist/components/Slider/Slider/Slider.style.d.ts +11 -0
- package/dist/components/Slider/Slider/Slider.type.d.ts +18 -0
- package/dist/components/Slider/Slider/Slider.view.d.ts +3 -0
- package/dist/components/Slider/Slider.d.ts +6 -0
- package/dist/components/Slider/SliderDemo.d.ts +3 -0
- package/dist/components/Slider/examples/controlled.d.ts +2 -0
- package/dist/components/Slider/examples/custom.d.ts +2 -0
- package/dist/components/Slider/examples/default.d.ts +2 -0
- package/dist/components/Slider/examples/disabled.d.ts +2 -0
- package/dist/components/Slider/examples/range.d.ts +2 -0
- package/dist/components/Slider/examples/shapes.d.ts +2 -0
- package/dist/components/Slider/examples/sizes.d.ts +2 -0
- package/dist/components/Slider/examples/stepValues.d.ts +3 -0
- package/dist/components/Slider/examples/tooltip.d.ts +2 -0
- package/dist/components/Slider/examples/variants.d.ts +2 -0
- package/dist/components/Slider/examples/vertical.d.ts +2 -0
- package/dist/components/Slider/index.d.ts +1 -0
- package/dist/components/Table/Table.d.ts +8 -8
- package/dist/components/index.d.ts +3 -0
- package/dist/pages/hoverCard.page.d.ts +3 -0
- package/dist/pages/slider.page.d.ts +3 -0
- package/dist/web.cjs.development.js +714 -13
- 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 +713 -14
- package/dist/web.esm.js.map +1 -1
- package/dist/web.umd.development.js +717 -17
- 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
|
@@ -11,6 +11,7 @@ import 'core-js/modules/es.string.includes.js';
|
|
|
11
11
|
import 'core-js/modules/es.string.starts-with.js';
|
|
12
12
|
import format from 'date-fns/format';
|
|
13
13
|
import { useFormikContext, getIn } from 'formik';
|
|
14
|
+
import 'core-js/modules/es.number.to-fixed.js';
|
|
14
15
|
import 'core-js/modules/web.url.js';
|
|
15
16
|
import 'core-js/modules/web.url.to-json.js';
|
|
16
17
|
import 'core-js/modules/web.url-search-params.js';
|
|
@@ -716,7 +717,7 @@ var ThreadsIcon = _ref15 => {
|
|
|
716
717
|
d: "M0 0h24v24H0z",
|
|
717
718
|
fill: "none"
|
|
718
719
|
}), /*#__PURE__*/React.createElement("path", {
|
|
719
|
-
d: "M19 7.5c-1.333 -3 -3.667 -4.5 -7 -4.5c-5 0 -8 2.5 -8 9s3.5 9 8 9s7 -3 7\n -5s-1 -5 -7 -5c-2.5 0 -3 1.25 -3 2.5c0 1.5 1 2.5 2.5 2.5c2.5 0 3.5 -1.5
|
|
720
|
+
d: "M19 7.5c-1.333 -3 -3.667 -4.5 -7 -4.5c-5 0 -8 2.5 -8 9s3.5 9 8 9s7 -3 7\n -5s-1 -5 -7 -5c-2.5 0 -3 1.25 -3 2.5c0 1.5 1 2.5 2.5 2.5c2.5 0 3.5 -1.5\n 3.5 -5s-2 -4 -3 -4s-1.833 .333 -2.5 1"
|
|
720
721
|
})));
|
|
721
722
|
};
|
|
722
723
|
// Example Refactored Icon: MinusIcon without undefined 'padding' prop
|
|
@@ -1402,7 +1403,9 @@ var LockIcon = _ref42 => {
|
|
|
1402
1403
|
viewBox: "0 0 24 24",
|
|
1403
1404
|
"aria-hidden": "false",
|
|
1404
1405
|
focusable: "false"
|
|
1405
|
-
}, getSvgProps(filled, color, strokeWidth)), /*#__PURE__*/React.createElement("
|
|
1406
|
+
}, getSvgProps(filled, color, strokeWidth)), filled ? (/*#__PURE__*/React.createElement("path", {
|
|
1407
|
+
d: "M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2zm-6 9c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2zm3.1-9H8.9V6c0-1.71 1.39-3.1 3.1-3.1 1.71 0 3.1 1.39 3.1 3.1v2z"
|
|
1408
|
+
})) : (/*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("rect", {
|
|
1406
1409
|
x: "3",
|
|
1407
1410
|
y: "11",
|
|
1408
1411
|
width: "18",
|
|
@@ -1411,7 +1414,11 @@ var LockIcon = _ref42 => {
|
|
|
1411
1414
|
ry: "2"
|
|
1412
1415
|
}), /*#__PURE__*/React.createElement("path", {
|
|
1413
1416
|
d: "M7 11V7a5 5 0 0 1 10 0v4"
|
|
1414
|
-
})
|
|
1417
|
+
}), /*#__PURE__*/React.createElement("circle", {
|
|
1418
|
+
cx: "12",
|
|
1419
|
+
cy: "16",
|
|
1420
|
+
r: "1.5"
|
|
1421
|
+
})))));
|
|
1415
1422
|
};
|
|
1416
1423
|
var MicrophoneIcon = _ref43 => {
|
|
1417
1424
|
var {
|
|
@@ -1681,7 +1688,9 @@ var UnlockIcon = _ref55 => {
|
|
|
1681
1688
|
viewBox: "0 0 24 24",
|
|
1682
1689
|
"aria-hidden": "false",
|
|
1683
1690
|
focusable: "false"
|
|
1684
|
-
}, getSvgProps(filled, color, strokeWidth)), /*#__PURE__*/React.createElement("
|
|
1691
|
+
}, getSvgProps(filled, color, strokeWidth)), filled ? (/*#__PURE__*/React.createElement("path", {
|
|
1692
|
+
d: "M12 17c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm6-9h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6h1.9c0-1.71 1.39-3.1 3.1-3.1 1.71 0 3.1 1.39 3.1 3.1v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2z"
|
|
1693
|
+
})) : (/*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("rect", {
|
|
1685
1694
|
x: "3",
|
|
1686
1695
|
y: "11",
|
|
1687
1696
|
width: "18",
|
|
@@ -1690,7 +1699,11 @@ var UnlockIcon = _ref55 => {
|
|
|
1690
1699
|
ry: "2"
|
|
1691
1700
|
}), /*#__PURE__*/React.createElement("path", {
|
|
1692
1701
|
d: "M7 11V7a5 5 0 0 1 9.9-1"
|
|
1693
|
-
})
|
|
1702
|
+
}), /*#__PURE__*/React.createElement("circle", {
|
|
1703
|
+
cx: "12",
|
|
1704
|
+
cy: "16",
|
|
1705
|
+
r: "1.5"
|
|
1706
|
+
})))));
|
|
1694
1707
|
};
|
|
1695
1708
|
var WifiIcon = _ref56 => {
|
|
1696
1709
|
var {
|
|
@@ -3123,6 +3136,7 @@ var ButtonView = _ref => {
|
|
|
3123
3136
|
return /*#__PURE__*/React.createElement(Element, Object.assign({
|
|
3124
3137
|
gap: 8,
|
|
3125
3138
|
as: "button",
|
|
3139
|
+
type: "button",
|
|
3126
3140
|
border: "none",
|
|
3127
3141
|
color: "color.white",
|
|
3128
3142
|
display: "flex",
|
|
@@ -6983,6 +6997,540 @@ var ComboBoxComponent$1 = _ref => {
|
|
|
6983
6997
|
*/
|
|
6984
6998
|
var FormikComboBox = ComboBoxComponent$1;
|
|
6985
6999
|
|
|
7000
|
+
// Clamp value between min and max
|
|
7001
|
+
var clamp = (value, min, max) => Math.min(Math.max(value, min), max);
|
|
7002
|
+
// Calculate value based on position, track dimensions, min, max, step
|
|
7003
|
+
var calculateValue = (position, trackRect, min, max, step, orientation, stepValues) => {
|
|
7004
|
+
var range = max - min;
|
|
7005
|
+
var percentage;
|
|
7006
|
+
if (orientation === 'horizontal') {
|
|
7007
|
+
var trackLength = trackRect.width;
|
|
7008
|
+
var relativePosition = position - trackRect.left;
|
|
7009
|
+
percentage = clamp(relativePosition / trackLength, 0, 1);
|
|
7010
|
+
} else {
|
|
7011
|
+
// Vertical: top is max, bottom is min (reversed from the provided code)
|
|
7012
|
+
var _trackLength = trackRect.height;
|
|
7013
|
+
var _relativePosition = trackRect.bottom - position; // Y position relative to track bottom
|
|
7014
|
+
percentage = clamp(_relativePosition / _trackLength, 0, 1);
|
|
7015
|
+
}
|
|
7016
|
+
// If stepValues are provided, find the closest value in the array
|
|
7017
|
+
if (stepValues && stepValues.length > 0) {
|
|
7018
|
+
var rawValue = min + percentage * range;
|
|
7019
|
+
// Find the closest value in stepValues
|
|
7020
|
+
var closestValue = stepValues[0];
|
|
7021
|
+
var minDistance = Math.abs(rawValue - closestValue);
|
|
7022
|
+
for (var i = 1; i < stepValues.length; i++) {
|
|
7023
|
+
var distance = Math.abs(rawValue - stepValues[i]);
|
|
7024
|
+
if (distance < minDistance) {
|
|
7025
|
+
minDistance = distance;
|
|
7026
|
+
closestValue = stepValues[i];
|
|
7027
|
+
}
|
|
7028
|
+
}
|
|
7029
|
+
return closestValue;
|
|
7030
|
+
} else {
|
|
7031
|
+
// Use regular step logic
|
|
7032
|
+
var _rawValue = min + percentage * range;
|
|
7033
|
+
var steppedValue = Math.round(_rawValue / step) * step;
|
|
7034
|
+
// Final clamp to ensure step rounding doesn't exceed bounds
|
|
7035
|
+
return clamp(steppedValue, min, max);
|
|
7036
|
+
}
|
|
7037
|
+
};
|
|
7038
|
+
var useSliderState = _ref => {
|
|
7039
|
+
var _ref2;
|
|
7040
|
+
var {
|
|
7041
|
+
min = 0,
|
|
7042
|
+
max = 100,
|
|
7043
|
+
step = 1,
|
|
7044
|
+
value: controlledValue = 0,
|
|
7045
|
+
defaultValue,
|
|
7046
|
+
onChange,
|
|
7047
|
+
onDrag,
|
|
7048
|
+
orientation = 'horizontal',
|
|
7049
|
+
isDisabled = false,
|
|
7050
|
+
stepValues
|
|
7051
|
+
} = _ref;
|
|
7052
|
+
var initialValue = clamp((_ref2 = controlledValue != null ? controlledValue : defaultValue) != null ? _ref2 : min, min, max);
|
|
7053
|
+
var [internalValue, setInternalValue] = useState(initialValue);
|
|
7054
|
+
var [isDragging, setIsDragging] = useState(false);
|
|
7055
|
+
var [isHovered, setIsHovered] = useState(false);
|
|
7056
|
+
var trackRef = useRef(null);
|
|
7057
|
+
var thumbRef = useRef(null);
|
|
7058
|
+
var isControlled = controlledValue !== undefined;
|
|
7059
|
+
var currentValue = isControlled ? controlledValue : internalValue;
|
|
7060
|
+
// Update internal state if controlled value changes
|
|
7061
|
+
useEffect(() => {
|
|
7062
|
+
if (isControlled) {
|
|
7063
|
+
setInternalValue(clamp(controlledValue, min, max));
|
|
7064
|
+
}
|
|
7065
|
+
}, [controlledValue, isControlled, min, max]);
|
|
7066
|
+
var updateValue = useCallback(newValue => {
|
|
7067
|
+
var clampedValue = clamp(newValue, min, max);
|
|
7068
|
+
if (!isControlled) {
|
|
7069
|
+
setInternalValue(clampedValue);
|
|
7070
|
+
}
|
|
7071
|
+
if (onChange && clampedValue !== currentValue) {
|
|
7072
|
+
onChange(clampedValue);
|
|
7073
|
+
}
|
|
7074
|
+
if (isDragging && onDrag) {
|
|
7075
|
+
onDrag(clampedValue);
|
|
7076
|
+
}
|
|
7077
|
+
}, [isControlled, min, max, onChange, currentValue, isDragging, onDrag]);
|
|
7078
|
+
var handleInteraction = useCallback(event => {
|
|
7079
|
+
if (isDisabled || !trackRef.current) return;
|
|
7080
|
+
var trackRect = trackRef.current.getBoundingClientRect();
|
|
7081
|
+
var position;
|
|
7082
|
+
if ('touches' in event) {
|
|
7083
|
+
position = orientation === 'horizontal' ? event.touches[0].clientX : event.touches[0].clientY;
|
|
7084
|
+
} else {
|
|
7085
|
+
position = orientation === 'horizontal' ? event.clientX : event.clientY;
|
|
7086
|
+
}
|
|
7087
|
+
var newValue = calculateValue(position, trackRect, min, max, step, orientation, stepValues);
|
|
7088
|
+
updateValue(newValue);
|
|
7089
|
+
}, [min, max, step, orientation, updateValue, isDisabled, stepValues]);
|
|
7090
|
+
var handleMouseDown = useCallback(event => {
|
|
7091
|
+
if (isDisabled) return;
|
|
7092
|
+
event.preventDefault(); // Prevent text selection during drag
|
|
7093
|
+
setIsDragging(true);
|
|
7094
|
+
handleInteraction(event); // Update value immediately on click/touch
|
|
7095
|
+
var handleMouseMove = moveEvent => {
|
|
7096
|
+
handleInteraction(moveEvent);
|
|
7097
|
+
};
|
|
7098
|
+
var handleMouseUp = () => {
|
|
7099
|
+
setIsDragging(false);
|
|
7100
|
+
document.removeEventListener('mousemove', handleMouseMove);
|
|
7101
|
+
document.removeEventListener('mouseup', handleMouseUp);
|
|
7102
|
+
document.removeEventListener('touchmove', handleMouseMove);
|
|
7103
|
+
document.removeEventListener('touchend', handleMouseUp);
|
|
7104
|
+
};
|
|
7105
|
+
document.addEventListener('mousemove', handleMouseMove);
|
|
7106
|
+
document.addEventListener('mouseup', handleMouseUp);
|
|
7107
|
+
document.addEventListener('touchmove', handleMouseMove);
|
|
7108
|
+
document.addEventListener('touchend', handleMouseUp);
|
|
7109
|
+
}, [handleInteraction, isDisabled]);
|
|
7110
|
+
// Allow clicking directly on the track
|
|
7111
|
+
var handleTrackMouseDown = useCallback(event => {
|
|
7112
|
+
// Prevent triggering if click is on the thumb itself
|
|
7113
|
+
if (thumbRef.current && thumbRef.current.contains(event.target)) {
|
|
7114
|
+
return;
|
|
7115
|
+
}
|
|
7116
|
+
handleMouseDown(event);
|
|
7117
|
+
}, [handleMouseDown]);
|
|
7118
|
+
var handleKeyDown = useCallback(event => {
|
|
7119
|
+
if (isDisabled) return;
|
|
7120
|
+
var newValue = currentValue;
|
|
7121
|
+
switch (event.key) {
|
|
7122
|
+
case 'ArrowLeft':
|
|
7123
|
+
case 'ArrowDown':
|
|
7124
|
+
newValue = currentValue - step;
|
|
7125
|
+
break;
|
|
7126
|
+
case 'ArrowRight':
|
|
7127
|
+
case 'ArrowUp':
|
|
7128
|
+
newValue = currentValue + step;
|
|
7129
|
+
break;
|
|
7130
|
+
case 'Home':
|
|
7131
|
+
newValue = min;
|
|
7132
|
+
break;
|
|
7133
|
+
case 'End':
|
|
7134
|
+
newValue = max;
|
|
7135
|
+
break;
|
|
7136
|
+
default:
|
|
7137
|
+
return;
|
|
7138
|
+
// Exit if key is not handled
|
|
7139
|
+
}
|
|
7140
|
+
event.preventDefault(); // Prevent page scroll
|
|
7141
|
+
updateValue(newValue);
|
|
7142
|
+
}, [currentValue, min, max, step, updateValue, isDisabled]);
|
|
7143
|
+
var range = max - min;
|
|
7144
|
+
var thumbPositionPercent = range === 0 ? 0 : (currentValue - min) / range * 100;
|
|
7145
|
+
return {
|
|
7146
|
+
currentValue,
|
|
7147
|
+
isDragging,
|
|
7148
|
+
isHovered,
|
|
7149
|
+
setIsHovered,
|
|
7150
|
+
trackRef,
|
|
7151
|
+
thumbRef,
|
|
7152
|
+
handleThumbMouseDown: handleMouseDown,
|
|
7153
|
+
handleTrackMouseDown,
|
|
7154
|
+
handleKeyDown,
|
|
7155
|
+
thumbPositionPercent
|
|
7156
|
+
};
|
|
7157
|
+
};
|
|
7158
|
+
|
|
7159
|
+
var SliderSizes$1 = {
|
|
7160
|
+
xs: {
|
|
7161
|
+
height: 4,
|
|
7162
|
+
width: '100%'
|
|
7163
|
+
},
|
|
7164
|
+
sm: {
|
|
7165
|
+
height: 6,
|
|
7166
|
+
width: '100%'
|
|
7167
|
+
},
|
|
7168
|
+
md: {
|
|
7169
|
+
height: 8,
|
|
7170
|
+
width: '100%'
|
|
7171
|
+
},
|
|
7172
|
+
lg: {
|
|
7173
|
+
height: 10,
|
|
7174
|
+
width: '100%'
|
|
7175
|
+
},
|
|
7176
|
+
xl: {
|
|
7177
|
+
height: 12,
|
|
7178
|
+
width: '100%'
|
|
7179
|
+
}
|
|
7180
|
+
};
|
|
7181
|
+
var ThumbSizes = {
|
|
7182
|
+
xs: {
|
|
7183
|
+
width: 12,
|
|
7184
|
+
height: 12
|
|
7185
|
+
},
|
|
7186
|
+
sm: {
|
|
7187
|
+
width: 16,
|
|
7188
|
+
height: 16
|
|
7189
|
+
},
|
|
7190
|
+
md: {
|
|
7191
|
+
width: 20,
|
|
7192
|
+
height: 20
|
|
7193
|
+
},
|
|
7194
|
+
lg: {
|
|
7195
|
+
width: 24,
|
|
7196
|
+
height: 24
|
|
7197
|
+
},
|
|
7198
|
+
xl: {
|
|
7199
|
+
width: 28,
|
|
7200
|
+
height: 28
|
|
7201
|
+
}
|
|
7202
|
+
};
|
|
7203
|
+
var SliderShapes = {
|
|
7204
|
+
sharp: 0,
|
|
7205
|
+
rounded: 4,
|
|
7206
|
+
pillShaped: 24
|
|
7207
|
+
};
|
|
7208
|
+
var SliderVariants = {
|
|
7209
|
+
default: {
|
|
7210
|
+
backgroundColor: 'color.blueGray.200'
|
|
7211
|
+
},
|
|
7212
|
+
outline: {
|
|
7213
|
+
backgroundColor: 'transparent',
|
|
7214
|
+
borderWidth: 1,
|
|
7215
|
+
borderStyle: 'solid',
|
|
7216
|
+
borderColor: 'color.blueGray.300'
|
|
7217
|
+
}
|
|
7218
|
+
};
|
|
7219
|
+
// Maps Size enum to track height/width and thumb size for the new implementation
|
|
7220
|
+
var EnhancedSliderSizes = {
|
|
7221
|
+
xs: {
|
|
7222
|
+
trackCrossAxisSize: 4,
|
|
7223
|
+
thumbSize: 12
|
|
7224
|
+
},
|
|
7225
|
+
sm: {
|
|
7226
|
+
trackCrossAxisSize: 6,
|
|
7227
|
+
thumbSize: 16
|
|
7228
|
+
},
|
|
7229
|
+
md: {
|
|
7230
|
+
trackCrossAxisSize: 8,
|
|
7231
|
+
thumbSize: 20
|
|
7232
|
+
},
|
|
7233
|
+
lg: {
|
|
7234
|
+
trackCrossAxisSize: 10,
|
|
7235
|
+
thumbSize: 24
|
|
7236
|
+
},
|
|
7237
|
+
xl: {
|
|
7238
|
+
trackCrossAxisSize: 12,
|
|
7239
|
+
thumbSize: 28
|
|
7240
|
+
}
|
|
7241
|
+
};
|
|
7242
|
+
// Basic styles for horizontal and vertical orientation
|
|
7243
|
+
var OrientationStyles = {
|
|
7244
|
+
horizontal: {
|
|
7245
|
+
width: '100%',
|
|
7246
|
+
minWidth: '120px',
|
|
7247
|
+
height: 'auto',
|
|
7248
|
+
flexDirection: 'row',
|
|
7249
|
+
paddingVertical: 8
|
|
7250
|
+
},
|
|
7251
|
+
vertical: {
|
|
7252
|
+
height: '100%',
|
|
7253
|
+
minHeight: '120px',
|
|
7254
|
+
width: 'auto',
|
|
7255
|
+
flexDirection: 'column-reverse',
|
|
7256
|
+
paddingHorizontal: 8
|
|
7257
|
+
}
|
|
7258
|
+
};
|
|
7259
|
+
|
|
7260
|
+
var _excluded$y = ["min", "max", "step", "currentValue", "stepValues", "shape", "size", "variant", "orientation", "isDisabled", "showValue", "showTooltip", "colorScheme", "label", "helperText", "themeMode", "shadow", "isDragging", "isHovered", "setIsHovered", "trackRef", "thumbRef", "handleThumbMouseDown", "handleTrackMouseDown", "handleKeyDown", "thumbPositionPercent", "ariaLabel", "views"];
|
|
7261
|
+
var SliderView = _ref => {
|
|
7262
|
+
var _views$tooltip, _views$tooltip2;
|
|
7263
|
+
var {
|
|
7264
|
+
min = 0,
|
|
7265
|
+
max = 100,
|
|
7266
|
+
step = 1,
|
|
7267
|
+
currentValue,
|
|
7268
|
+
stepValues,
|
|
7269
|
+
shape = 'rounded',
|
|
7270
|
+
size = 'md',
|
|
7271
|
+
variant = 'default',
|
|
7272
|
+
orientation = 'horizontal',
|
|
7273
|
+
isDisabled = false,
|
|
7274
|
+
showValue = false,
|
|
7275
|
+
showTooltip = false,
|
|
7276
|
+
colorScheme = 'theme.primary',
|
|
7277
|
+
label,
|
|
7278
|
+
helperText,
|
|
7279
|
+
themeMode: elementMode,
|
|
7280
|
+
shadow = {},
|
|
7281
|
+
isDragging,
|
|
7282
|
+
isHovered,
|
|
7283
|
+
setIsHovered,
|
|
7284
|
+
trackRef,
|
|
7285
|
+
thumbRef,
|
|
7286
|
+
handleThumbMouseDown,
|
|
7287
|
+
handleTrackMouseDown,
|
|
7288
|
+
handleKeyDown,
|
|
7289
|
+
thumbPositionPercent,
|
|
7290
|
+
ariaLabel = 'Slider',
|
|
7291
|
+
views = {
|
|
7292
|
+
container: {},
|
|
7293
|
+
track: {},
|
|
7294
|
+
progress: {},
|
|
7295
|
+
filledTrack: {},
|
|
7296
|
+
thumb: {},
|
|
7297
|
+
label: {},
|
|
7298
|
+
valueLabel: {},
|
|
7299
|
+
stepMarks: {},
|
|
7300
|
+
tooltip: {}
|
|
7301
|
+
}
|
|
7302
|
+
} = _ref,
|
|
7303
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$y);
|
|
7304
|
+
var {
|
|
7305
|
+
getColor,
|
|
7306
|
+
themeMode
|
|
7307
|
+
} = useTheme();
|
|
7308
|
+
var themeColor = getColor(colorScheme, elementMode || themeMode);
|
|
7309
|
+
var disabledColor = getColor('theme.disabled', elementMode || themeMode);
|
|
7310
|
+
var trackColor = getColor(SliderVariants[variant].backgroundColor, elementMode || themeMode);
|
|
7311
|
+
var isVertical = orientation === 'vertical';
|
|
7312
|
+
var {
|
|
7313
|
+
trackCrossAxisSize,
|
|
7314
|
+
thumbSize
|
|
7315
|
+
} = EnhancedSliderSizes[size] || {
|
|
7316
|
+
trackCrossAxisSize: SliderSizes$1[size].height,
|
|
7317
|
+
thumbSize: ThumbSizes[size].width || 16
|
|
7318
|
+
};
|
|
7319
|
+
// For backward compatibility with the old implementation
|
|
7320
|
+
var legacyView = /*#__PURE__*/React.createElement(Vertical, Object.assign({
|
|
7321
|
+
width: "100%",
|
|
7322
|
+
gap: 8
|
|
7323
|
+
}, views.container, props), label && (/*#__PURE__*/React.createElement(Horizontal, {
|
|
7324
|
+
justifyContent: "space-between",
|
|
7325
|
+
alignItems: "center"
|
|
7326
|
+
}, /*#__PURE__*/React.createElement(Text$1, Object.assign({
|
|
7327
|
+
fontSize: 14,
|
|
7328
|
+
fontWeight: 500
|
|
7329
|
+
}, views.label), label), showValue && (/*#__PURE__*/React.createElement(Text$1, Object.assign({
|
|
7330
|
+
fontSize: 14,
|
|
7331
|
+
color: "color.blueGray.500"
|
|
7332
|
+
}, views.valueLabel), currentValue)))), /*#__PURE__*/React.createElement(View$1, Object.assign({
|
|
7333
|
+
ref: trackRef,
|
|
7334
|
+
position: "relative",
|
|
7335
|
+
cursor: isDisabled ? 'not-allowed' : 'pointer',
|
|
7336
|
+
opacity: isDisabled ? 0.6 : 1,
|
|
7337
|
+
onMouseDown: handleTrackMouseDown,
|
|
7338
|
+
onMouseEnter: () => setIsHovered(true),
|
|
7339
|
+
onMouseLeave: () => setIsHovered(false)
|
|
7340
|
+
}, SliderSizes$1[size], {
|
|
7341
|
+
borderRadius: SliderShapes[shape],
|
|
7342
|
+
backgroundColor: trackColor
|
|
7343
|
+
}, SliderVariants[variant], shadow, views.track), stepValues && stepValues.length > 0 && (/*#__PURE__*/React.createElement(React.Fragment, null, stepValues.map(stepValue => {
|
|
7344
|
+
var stepPercentage = (stepValue - min) / (max - min) * 100;
|
|
7345
|
+
return /*#__PURE__*/React.createElement(View$1, Object.assign({
|
|
7346
|
+
key: stepValue,
|
|
7347
|
+
position: "absolute",
|
|
7348
|
+
top: "50%",
|
|
7349
|
+
left: stepPercentage + "%",
|
|
7350
|
+
transform: "translate(-50%, -50%)",
|
|
7351
|
+
width: 4,
|
|
7352
|
+
height: 4,
|
|
7353
|
+
borderRadius: "50%",
|
|
7354
|
+
backgroundColor: isDisabled ? disabledColor : themeColor,
|
|
7355
|
+
zIndex: 1
|
|
7356
|
+
}, views.stepMarks));
|
|
7357
|
+
}))), /*#__PURE__*/React.createElement(View$1, Object.assign({
|
|
7358
|
+
position: "absolute",
|
|
7359
|
+
top: 0,
|
|
7360
|
+
left: 0,
|
|
7361
|
+
height: "100%",
|
|
7362
|
+
width: thumbPositionPercent + "%",
|
|
7363
|
+
backgroundColor: isDisabled ? disabledColor : themeColor,
|
|
7364
|
+
borderRadius: SliderShapes[shape],
|
|
7365
|
+
transition: "width 0.1s ease-in-out"
|
|
7366
|
+
}, views.progress, views.filledTrack)), /*#__PURE__*/React.createElement(View$1, Object.assign({
|
|
7367
|
+
ref: thumbRef,
|
|
7368
|
+
role: "slider",
|
|
7369
|
+
tabIndex: isDisabled ? -1 : 0,
|
|
7370
|
+
"aria-valuemin": min,
|
|
7371
|
+
"aria-valuemax": max,
|
|
7372
|
+
"aria-valuenow": currentValue,
|
|
7373
|
+
"aria-orientation": orientation,
|
|
7374
|
+
"aria-disabled": isDisabled,
|
|
7375
|
+
"aria-label": ariaLabel,
|
|
7376
|
+
position: "absolute",
|
|
7377
|
+
top: "50%",
|
|
7378
|
+
left: thumbPositionPercent + "%",
|
|
7379
|
+
borderRadius: "50%",
|
|
7380
|
+
backgroundColor: "white",
|
|
7381
|
+
boxShadow: "0 2px 4px rgba(0, 0, 0, 0.2)",
|
|
7382
|
+
border: "2px solid " + (isDisabled ? disabledColor : themeColor),
|
|
7383
|
+
transition: isDragging ? 'none' : 'transform 0.1s ease-in-out',
|
|
7384
|
+
transform: isHovered ? 'translate(-50%, -50%) scale(1.1)' : 'translate(-50%, -50%)',
|
|
7385
|
+
zIndex: 2,
|
|
7386
|
+
onMouseDown: handleThumbMouseDown,
|
|
7387
|
+
onTouchStart: handleThumbMouseDown,
|
|
7388
|
+
onKeyDown: handleKeyDown
|
|
7389
|
+
}, ThumbSizes[size], views.thumb), showTooltip && (isHovered || isDragging) && (/*#__PURE__*/React.createElement(View$1, Object.assign({
|
|
7390
|
+
position: "absolute",
|
|
7391
|
+
bottom: "100%",
|
|
7392
|
+
left: "50%",
|
|
7393
|
+
transform: "translateX(-50%)",
|
|
7394
|
+
marginBottom: 8,
|
|
7395
|
+
padding: "4px 8px",
|
|
7396
|
+
backgroundColor: "color.black",
|
|
7397
|
+
color: "color.white",
|
|
7398
|
+
borderRadius: 4,
|
|
7399
|
+
fontSize: 12,
|
|
7400
|
+
whiteSpace: "nowrap",
|
|
7401
|
+
zIndex: 3
|
|
7402
|
+
}, views.tooltip), /*#__PURE__*/React.createElement(Text$1, Object.assign({}, (_views$tooltip = views.tooltip) == null ? void 0 : _views$tooltip.text), currentValue == null ? void 0 : currentValue.toFixed(step < 1 ? 1 : 0)))))), helperText && /*#__PURE__*/React.createElement(HelperText, null, helperText));
|
|
7403
|
+
// Enhanced view with vertical support and other features
|
|
7404
|
+
var enhancedView = /*#__PURE__*/React.createElement(Center
|
|
7405
|
+
// Use Center to easily manage orientation layout
|
|
7406
|
+
, Object.assign({}, OrientationStyles[orientation], {
|
|
7407
|
+
position: "relative" // Needed for absolute positioning of thumb/tooltip
|
|
7408
|
+
,
|
|
7409
|
+
onMouseEnter: () => !isDisabled && setIsHovered(true),
|
|
7410
|
+
onMouseLeave: () => !isDisabled && setIsHovered(false)
|
|
7411
|
+
}, props, views == null ? void 0 : views.container), label && (/*#__PURE__*/React.createElement(Horizontal, {
|
|
7412
|
+
justifyContent: "space-between",
|
|
7413
|
+
alignItems: "center",
|
|
7414
|
+
marginBottom: 8,
|
|
7415
|
+
width: "100%"
|
|
7416
|
+
}, /*#__PURE__*/React.createElement(Text$1, Object.assign({
|
|
7417
|
+
fontSize: 14,
|
|
7418
|
+
fontWeight: 500
|
|
7419
|
+
}, views.label), label), showValue && (/*#__PURE__*/React.createElement(Text$1, Object.assign({
|
|
7420
|
+
fontSize: 14,
|
|
7421
|
+
color: "color.blueGray.500"
|
|
7422
|
+
}, views.valueLabel), currentValue)))), /*#__PURE__*/React.createElement(View$1, Object.assign({
|
|
7423
|
+
ref: trackRef,
|
|
7424
|
+
position: "relative",
|
|
7425
|
+
borderRadius: trackCrossAxisSize / 2,
|
|
7426
|
+
backgroundColor: isDisabled ? disabledColor : trackColor,
|
|
7427
|
+
cursor: isDisabled ? 'not-allowed' : 'pointer',
|
|
7428
|
+
width: isVertical ? trackCrossAxisSize + "px" : '100%',
|
|
7429
|
+
height: isVertical ? '100%' : trackCrossAxisSize + "px",
|
|
7430
|
+
onMouseDown: handleTrackMouseDown,
|
|
7431
|
+
onTouchStart: handleTrackMouseDown
|
|
7432
|
+
}, views == null ? void 0 : views.track), stepValues && stepValues.length > 0 && (/*#__PURE__*/React.createElement(React.Fragment, null, stepValues.map(stepValue => {
|
|
7433
|
+
var stepPercentage = (stepValue - min) / (max - min) * 100;
|
|
7434
|
+
return /*#__PURE__*/React.createElement(View$1, Object.assign({
|
|
7435
|
+
key: stepValue,
|
|
7436
|
+
position: "absolute",
|
|
7437
|
+
width: 4,
|
|
7438
|
+
height: 4,
|
|
7439
|
+
borderRadius: "50%",
|
|
7440
|
+
backgroundColor: isDisabled ? disabledColor : themeColor,
|
|
7441
|
+
zIndex: 1
|
|
7442
|
+
}, isVertical ? {
|
|
7443
|
+
bottom: stepPercentage + "%",
|
|
7444
|
+
left: '50%',
|
|
7445
|
+
transform: 'translate(-50%, 50%)'
|
|
7446
|
+
} : {
|
|
7447
|
+
left: stepPercentage + "%",
|
|
7448
|
+
top: '50%',
|
|
7449
|
+
transform: 'translate(-50%, -50%)'
|
|
7450
|
+
}, views.stepMarks));
|
|
7451
|
+
}))), /*#__PURE__*/React.createElement(View$1, Object.assign({
|
|
7452
|
+
position: "absolute",
|
|
7453
|
+
borderRadius: trackCrossAxisSize / 2,
|
|
7454
|
+
backgroundColor: isDisabled ? disabledColor : themeColor
|
|
7455
|
+
}, isVertical ? {
|
|
7456
|
+
bottom: 0,
|
|
7457
|
+
left: 0,
|
|
7458
|
+
width: '100%',
|
|
7459
|
+
height: thumbPositionPercent + "%"
|
|
7460
|
+
} : {
|
|
7461
|
+
top: 0,
|
|
7462
|
+
left: 0,
|
|
7463
|
+
height: '100%',
|
|
7464
|
+
width: thumbPositionPercent + "%"
|
|
7465
|
+
}, views == null ? void 0 : views.filledTrack, views == null ? void 0 : views.progress)), /*#__PURE__*/React.createElement(View$1, Object.assign({
|
|
7466
|
+
ref: thumbRef,
|
|
7467
|
+
role: "slider",
|
|
7468
|
+
tabIndex: isDisabled ? -1 : 0,
|
|
7469
|
+
"aria-valuemin": min,
|
|
7470
|
+
"aria-valuemax": max,
|
|
7471
|
+
"aria-valuenow": currentValue,
|
|
7472
|
+
"aria-orientation": orientation,
|
|
7473
|
+
"aria-disabled": isDisabled,
|
|
7474
|
+
"aria-label": ariaLabel,
|
|
7475
|
+
position: "absolute",
|
|
7476
|
+
width: thumbSize + "px",
|
|
7477
|
+
height: thumbSize + "px",
|
|
7478
|
+
borderRadius: "50%",
|
|
7479
|
+
backgroundColor: isDisabled ? disabledColor : themeColor,
|
|
7480
|
+
border: "2px solid " + getColor('color.white'),
|
|
7481
|
+
boxShadow: "0 1px 3px rgba(0, 0, 0, 0.2)",
|
|
7482
|
+
cursor: isDisabled ? 'not-allowed' : 'grab',
|
|
7483
|
+
transform: isVertical ? 'translateX(-50%)' : 'translateY(-50%)',
|
|
7484
|
+
zIndex: 2,
|
|
7485
|
+
transition: isDragging ? 'none' : 'left 0.1s, bottom 0.1s'
|
|
7486
|
+
}, isVertical ? {
|
|
7487
|
+
left: '50%',
|
|
7488
|
+
bottom: thumbPositionPercent + "%"
|
|
7489
|
+
} : {
|
|
7490
|
+
top: '50%',
|
|
7491
|
+
left: thumbPositionPercent + "%"
|
|
7492
|
+
}, {
|
|
7493
|
+
onMouseDown: handleThumbMouseDown,
|
|
7494
|
+
onTouchStart: handleThumbMouseDown,
|
|
7495
|
+
onKeyDown: handleKeyDown
|
|
7496
|
+
}, views == null ? void 0 : views.thumb), showTooltip && (isHovered || isDragging) && (/*#__PURE__*/React.createElement(View$1, Object.assign({
|
|
7497
|
+
position: "absolute",
|
|
7498
|
+
padding: "4px 8px",
|
|
7499
|
+
backgroundColor: getColor('color.black'),
|
|
7500
|
+
color: getColor('color.white'),
|
|
7501
|
+
borderRadius: "4px",
|
|
7502
|
+
fontSize: "12px",
|
|
7503
|
+
whiteSpace: "nowrap",
|
|
7504
|
+
zIndex: 3
|
|
7505
|
+
}, isVertical ? {
|
|
7506
|
+
left: '100%',
|
|
7507
|
+
marginLeft: '8px',
|
|
7508
|
+
bottom: '0',
|
|
7509
|
+
transform: 'translateY(50%)'
|
|
7510
|
+
} : {
|
|
7511
|
+
bottom: '100%',
|
|
7512
|
+
left: '50%',
|
|
7513
|
+
marginBottom: '8px',
|
|
7514
|
+
transform: 'translateX(-50%)'
|
|
7515
|
+
}, views == null ? void 0 : views.tooltip), /*#__PURE__*/React.createElement(Text$1, Object.assign({}, views == null || (_views$tooltip2 = views.tooltip) == null ? void 0 : _views$tooltip2.text), currentValue == null ? void 0 : currentValue.toFixed(step < 1 ? 1 : 0)))))), helperText && /*#__PURE__*/React.createElement(HelperText, {
|
|
7516
|
+
marginTop: 8
|
|
7517
|
+
}, helperText));
|
|
7518
|
+
// Use the enhanced view if orientation is vertical or showTooltip is true
|
|
7519
|
+
// Otherwise use the legacy view for backward compatibility
|
|
7520
|
+
return isVertical || showTooltip ? enhancedView : legacyView;
|
|
7521
|
+
};
|
|
7522
|
+
|
|
7523
|
+
var SliderComponent = props => {
|
|
7524
|
+
// Get state and handlers from the custom hook
|
|
7525
|
+
var sliderState = useSliderState(props);
|
|
7526
|
+
// Render the view component, passing down props and state
|
|
7527
|
+
return /*#__PURE__*/React.createElement(SliderView, Object.assign({}, props, sliderState));
|
|
7528
|
+
};
|
|
7529
|
+
/**
|
|
7530
|
+
* Slider allows users to select a value from a range by moving a handle.
|
|
7531
|
+
*/
|
|
7532
|
+
var Slider = SliderComponent;
|
|
7533
|
+
|
|
6986
7534
|
// Create your store with the initial state and actions.
|
|
6987
7535
|
var useMessageStore = /*#__PURE__*/create(set => ({
|
|
6988
7536
|
// initial state
|
|
@@ -7515,7 +8063,7 @@ var UploadView = _ref => {
|
|
|
7515
8063
|
}, views == null ? void 0 : views.view)));
|
|
7516
8064
|
};
|
|
7517
8065
|
|
|
7518
|
-
var _excluded$
|
|
8066
|
+
var _excluded$z = ["accept", "icon", "text", "maxSize", "onFileSelect", "validateFile", "isLoading", "progress"];
|
|
7519
8067
|
var Uploader = _ref => {
|
|
7520
8068
|
var {
|
|
7521
8069
|
accept = '*/*',
|
|
@@ -7527,7 +8075,7 @@ var Uploader = _ref => {
|
|
|
7527
8075
|
isLoading = false,
|
|
7528
8076
|
progress = 0
|
|
7529
8077
|
} = _ref,
|
|
7530
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
8078
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$z);
|
|
7531
8079
|
var {
|
|
7532
8080
|
previewUrl,
|
|
7533
8081
|
thumbnailUrl,
|
|
@@ -7664,7 +8212,7 @@ var HeaderIconSizes = {
|
|
|
7664
8212
|
xl: 28
|
|
7665
8213
|
};
|
|
7666
8214
|
|
|
7667
|
-
var _excluded$
|
|
8215
|
+
var _excluded$A = ["children", "blur", "isOpen", "isClosePrevented", "onClose", "position", "views"],
|
|
7668
8216
|
_excluded2$7 = ["children", "shadow", "isFullScreen", "shape", "views"],
|
|
7669
8217
|
_excluded3$4 = ["children", "buttonColor", "iconSize", "buttonPosition", "views"],
|
|
7670
8218
|
_excluded4$3 = ["children", "views"],
|
|
@@ -7679,7 +8227,7 @@ var ModalOverlay = _ref => {
|
|
|
7679
8227
|
position = 'center',
|
|
7680
8228
|
views
|
|
7681
8229
|
} = _ref,
|
|
7682
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
8230
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$A);
|
|
7683
8231
|
var handleClick = () => {
|
|
7684
8232
|
if (!isClosePrevented) onClose();
|
|
7685
8233
|
};
|
|
@@ -8158,7 +8706,7 @@ var useToggleState = defaultToggled => {
|
|
|
8158
8706
|
};
|
|
8159
8707
|
};
|
|
8160
8708
|
|
|
8161
|
-
var _excluded$
|
|
8709
|
+
var _excluded$B = ["children", "shape", "variant", "isHovered", "setIsHovered", "isDisabled", "isToggle", "setIsToggled", "onToggle", "views"];
|
|
8162
8710
|
var ToggleView = _ref => {
|
|
8163
8711
|
var {
|
|
8164
8712
|
children,
|
|
@@ -8172,7 +8720,7 @@ var ToggleView = _ref => {
|
|
|
8172
8720
|
onToggle,
|
|
8173
8721
|
views
|
|
8174
8722
|
} = _ref,
|
|
8175
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
8723
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$B);
|
|
8176
8724
|
var toggleColor = !isDisabled ? 'color.trueGray.400' : 'theme.disabled';
|
|
8177
8725
|
var isActive = !!(isToggle || isHovered);
|
|
8178
8726
|
var toggleVariants = {
|
|
@@ -8215,7 +8763,7 @@ var ToggleView = _ref => {
|
|
|
8215
8763
|
}, toggleVariants[variant], props, views == null ? void 0 : views.container), children);
|
|
8216
8764
|
};
|
|
8217
8765
|
|
|
8218
|
-
var _excluded$
|
|
8766
|
+
var _excluded$C = ["children", "shape", "variant", "isDisabled", "isToggled", "onToggle"];
|
|
8219
8767
|
// Destructuring properties from ToggleProps to be used within the ToggleComponent.
|
|
8220
8768
|
var ToggleComponent = _ref => {
|
|
8221
8769
|
var {
|
|
@@ -8227,7 +8775,7 @@ var ToggleComponent = _ref => {
|
|
|
8227
8775
|
isToggled = false,
|
|
8228
8776
|
onToggle
|
|
8229
8777
|
} = _ref,
|
|
8230
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
8778
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$C);
|
|
8231
8779
|
// Initializing toggle state and set state functions using the custom hook useToggleState.
|
|
8232
8780
|
var {
|
|
8233
8781
|
isHovered,
|
|
@@ -8467,5 +9015,156 @@ var DragAndDropComponent = props => {
|
|
|
8467
9015
|
};
|
|
8468
9016
|
var DragAndDrop = DragAndDropComponent;
|
|
8469
9017
|
|
|
8470
|
-
|
|
9018
|
+
var useHoverCardState = () => {
|
|
9019
|
+
var [isOpen, setIsOpen] = useState(false);
|
|
9020
|
+
return {
|
|
9021
|
+
isOpen,
|
|
9022
|
+
setIsOpen
|
|
9023
|
+
};
|
|
9024
|
+
};
|
|
9025
|
+
|
|
9026
|
+
var ContentPositions = {
|
|
9027
|
+
top: align => Object.assign({
|
|
9028
|
+
position: 'absolute',
|
|
9029
|
+
bottom: '100%',
|
|
9030
|
+
marginBottom: '8px'
|
|
9031
|
+
}, align === 'start' && {
|
|
9032
|
+
left: 0
|
|
9033
|
+
}, align === 'center' && {
|
|
9034
|
+
left: '50%',
|
|
9035
|
+
transform: 'translateX(-50%)'
|
|
9036
|
+
}, align === 'end' && {
|
|
9037
|
+
right: 0
|
|
9038
|
+
}),
|
|
9039
|
+
right: align => Object.assign({
|
|
9040
|
+
position: 'absolute',
|
|
9041
|
+
left: '100%',
|
|
9042
|
+
marginLeft: '8px'
|
|
9043
|
+
}, align === 'start' && {
|
|
9044
|
+
top: 0
|
|
9045
|
+
}, align === 'center' && {
|
|
9046
|
+
top: '50%',
|
|
9047
|
+
transform: 'translateY(-50%)'
|
|
9048
|
+
}, align === 'end' && {
|
|
9049
|
+
bottom: 0
|
|
9050
|
+
}),
|
|
9051
|
+
bottom: align => Object.assign({
|
|
9052
|
+
position: 'absolute',
|
|
9053
|
+
top: '100%',
|
|
9054
|
+
marginTop: '8px'
|
|
9055
|
+
}, align === 'start' && {
|
|
9056
|
+
left: 0
|
|
9057
|
+
}, align === 'center' && {
|
|
9058
|
+
left: '50%',
|
|
9059
|
+
transform: 'translateX(-50%)'
|
|
9060
|
+
}, align === 'end' && {
|
|
9061
|
+
right: 0
|
|
9062
|
+
}),
|
|
9063
|
+
left: align => Object.assign({
|
|
9064
|
+
position: 'absolute',
|
|
9065
|
+
right: '100%',
|
|
9066
|
+
marginRight: '8px'
|
|
9067
|
+
}, align === 'start' && {
|
|
9068
|
+
top: 0
|
|
9069
|
+
}, align === 'center' && {
|
|
9070
|
+
top: '50%',
|
|
9071
|
+
transform: 'translateY(-50%)'
|
|
9072
|
+
}, align === 'end' && {
|
|
9073
|
+
bottom: 0
|
|
9074
|
+
})
|
|
9075
|
+
};
|
|
9076
|
+
|
|
9077
|
+
var _excluded$D = ["children", "views"],
|
|
9078
|
+
_excluded2$8 = ["children", "views", "side", "align"];
|
|
9079
|
+
// Create context for the HoverCard
|
|
9080
|
+
var HoverCardContext = /*#__PURE__*/createContext({
|
|
9081
|
+
isOpen: false,
|
|
9082
|
+
setIsOpen: () => {}
|
|
9083
|
+
});
|
|
9084
|
+
var HoverCardProvider = _ref => {
|
|
9085
|
+
var {
|
|
9086
|
+
children,
|
|
9087
|
+
value
|
|
9088
|
+
} = _ref;
|
|
9089
|
+
return /*#__PURE__*/React.createElement(HoverCardContext.Provider, {
|
|
9090
|
+
value: value
|
|
9091
|
+
}, children);
|
|
9092
|
+
};
|
|
9093
|
+
var useHoverCardContext = () => {
|
|
9094
|
+
var context = useContext(HoverCardContext);
|
|
9095
|
+
if (!context) {
|
|
9096
|
+
throw new Error('useHoverCardContext must be used within a HoverCardProvider');
|
|
9097
|
+
}
|
|
9098
|
+
return context;
|
|
9099
|
+
};
|
|
9100
|
+
var HoverCardTrigger = _ref2 => {
|
|
9101
|
+
var {
|
|
9102
|
+
children,
|
|
9103
|
+
views
|
|
9104
|
+
} = _ref2,
|
|
9105
|
+
props = _objectWithoutPropertiesLoose(_ref2, _excluded$D);
|
|
9106
|
+
var {
|
|
9107
|
+
setIsOpen
|
|
9108
|
+
} = useHoverCardContext();
|
|
9109
|
+
return /*#__PURE__*/React.createElement(View$1, Object.assign({
|
|
9110
|
+
position: "relative",
|
|
9111
|
+
display: "inline-block",
|
|
9112
|
+
onMouseEnter: () => setIsOpen(true),
|
|
9113
|
+
onMouseLeave: () => setIsOpen(false)
|
|
9114
|
+
}, views == null ? void 0 : views.container, props), children);
|
|
9115
|
+
};
|
|
9116
|
+
var HoverCardContent = _ref3 => {
|
|
9117
|
+
var {
|
|
9118
|
+
children,
|
|
9119
|
+
views,
|
|
9120
|
+
side = 'bottom',
|
|
9121
|
+
align = 'center'
|
|
9122
|
+
} = _ref3,
|
|
9123
|
+
props = _objectWithoutPropertiesLoose(_ref3, _excluded2$8);
|
|
9124
|
+
var {
|
|
9125
|
+
isOpen
|
|
9126
|
+
} = useHoverCardContext();
|
|
9127
|
+
if (!isOpen) {
|
|
9128
|
+
return null;
|
|
9129
|
+
}
|
|
9130
|
+
return /*#__PURE__*/React.createElement(View$1, Object.assign({
|
|
9131
|
+
backgroundColor: "white",
|
|
9132
|
+
borderRadius: "4px",
|
|
9133
|
+
boxShadow: "0px 2px 8px rgba(0, 0, 0, 0.15)",
|
|
9134
|
+
padding: "12px",
|
|
9135
|
+
minWidth: "200px",
|
|
9136
|
+
maxWidth: "300px",
|
|
9137
|
+
zIndex: 1000
|
|
9138
|
+
}, ContentPositions[side](align), views == null ? void 0 : views.container, props), children);
|
|
9139
|
+
};
|
|
9140
|
+
|
|
9141
|
+
var _excluded$E = ["children", "views"];
|
|
9142
|
+
/**
|
|
9143
|
+
* HoverCard component displays floating content when hovering over a trigger element.
|
|
9144
|
+
*/
|
|
9145
|
+
var HoverCardComponent = _ref => {
|
|
9146
|
+
var {
|
|
9147
|
+
children,
|
|
9148
|
+
views
|
|
9149
|
+
} = _ref,
|
|
9150
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$E);
|
|
9151
|
+
var {
|
|
9152
|
+
isOpen,
|
|
9153
|
+
setIsOpen
|
|
9154
|
+
} = useHoverCardState();
|
|
9155
|
+
return /*#__PURE__*/React.createElement(HoverCardProvider, {
|
|
9156
|
+
value: {
|
|
9157
|
+
isOpen,
|
|
9158
|
+
setIsOpen
|
|
9159
|
+
}
|
|
9160
|
+
}, /*#__PURE__*/React.createElement(View$1, Object.assign({
|
|
9161
|
+
position: "relative",
|
|
9162
|
+
display: "inline-block"
|
|
9163
|
+
}, views == null ? void 0 : views.container, props), children));
|
|
9164
|
+
};
|
|
9165
|
+
var HoverCard = HoverCardComponent;
|
|
9166
|
+
HoverCard.Trigger = HoverCardTrigger;
|
|
9167
|
+
HoverCard.Content = HoverCardContent;
|
|
9168
|
+
|
|
9169
|
+
export { Alert, ArrowIcon, AspectRatio, Avatar, Badge, BatteryIcon, BluetoothIcon, BoldArrowIcon, BookmarkIcon, Bottom, Button, CalendarIcon, CameraIcon, Center, CenterBase, Checkbox, ChevronIcon, ClockIcon, CloseEyeIcon, CloseIcon, CloudIcon, ComboBox, CopyIcon, CountryPicker, CropIcon, DatePicker, DownloadIcon, DragAndDrop, DragAndDropComponent, DragHandleIcon, DustBinIcon, EditIcon, ErrorIcon, ExternalLinkIcon, FacebookIcon, FileIcon, FileImage, FileSVG, FilterIcon, FormikCheckbox, FormikComboBox, FormikCountryPicker, FormikDatePicker, FormikForm, FormikPassword, FormikSelect, FormikSwitch, FormikTextArea, FormikTextField, HeartIcon, HomeIcon, Horizontal, HorizontalBase, HoverCard, Icon, ImageIcon, InfoIcon, Inline, InstagramIcon, Left, LikeIcon, Link, LinkedinIcon, Loader, LocationIcon, LockIcon, MagicWandIcon, MenuIcon, MessageLayout, MessageView, MicrophoneIcon, MinusIcon, Modal, MoonIcon, NotificationIcon, OpenEyeIcon, PanelIcon, Password, PauseIcon, PlayIcon, PlusIcon, PrintIcon, ProfileIcon, RefreshIcon, Right, RotateIcon, SaveIcon, SearchIcon, Select, SettingsIcon, ShapeIcon, ShareIcon, Slider, SliderIcon, SliderVerticalIcon, SpinnerIcon, StarIcon, SuccessIcon, Switch, Table, Tabs, Text, TextArea, TextField, TextIcon, ThreadsIcon, TickIcon, Toggle, ToggleGroup, Top, TwitchIcon, TwitterIcon, UnLikeIcon, UnlockIcon, UploadIcon, Uploader, Vertical, VerticalBase, VideoIcon, View, WarningIcon, WifiIcon, XIcon, YoutubeIcon, ZoomInIcon, ZoomOutIcon, hideMessage, hideModal, showMessage, showModal, useMessageStore, useModalStore };
|
|
8471
9170
|
//# sourceMappingURL=web.esm.js.map
|