@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
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('core-js/modules/es.symbol.description.js'), require('react'), require('core-js/modules/es.object.assign.js'), require('app-studio'), require('core-js/modules/es.array.iterator.js'), require('core-js/modules/es.parse-float.js'), require('core-js/modules/web.dom-collections.iterator.js'), require('core-js/modules/es.array.includes.js'), require('react-router-dom'), require('core-js/modules/es.string.includes.js'), require('core-js/modules/es.string.starts-with.js'), require('date-fns/format'), require('formik'), require('core-js/modules/web.url.js'), require('core-js/modules/web.url.to-json.js'), require('core-js/modules/web.url-search-params.js'), require('zustand'), require('src/components/Layout')) :
|
|
3
|
-
typeof define === 'function' && define.amd ? define(['exports', 'core-js/modules/es.symbol.description.js', 'react', 'core-js/modules/es.object.assign.js', 'app-studio', 'core-js/modules/es.array.iterator.js', 'core-js/modules/es.parse-float.js', 'core-js/modules/web.dom-collections.iterator.js', 'core-js/modules/es.array.includes.js', 'react-router-dom', 'core-js/modules/es.string.includes.js', 'core-js/modules/es.string.starts-with.js', 'date-fns/format', 'formik', 'core-js/modules/web.url.js', 'core-js/modules/web.url.to-json.js', 'core-js/modules/web.url-search-params.js', 'zustand', 'src/components/Layout'], factory) :
|
|
4
|
-
(global = global || self, factory(global['@app-studio/web'] = {}, null, global.React, null, global.appStudio, null, null, null, null, global.reactRouterDom, null, null, global.format, global.formik, null, null, null, global.zustand, global.Layout));
|
|
5
|
-
}(this, (function (exports, es_symbol_description_js, React, es_object_assign_js, appStudio, es_array_iterator_js, es_parseFloat_js, web_domCollections_iterator_js, es_array_includes_js, reactRouterDom, es_string_includes_js, es_string_startsWith_js, format, formik, web_url_js, web_url_toJson_js, web_urlSearchParams_js, zustand, Layout) { 'use strict';
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('core-js/modules/es.symbol.description.js'), require('react'), require('core-js/modules/es.object.assign.js'), require('app-studio'), require('core-js/modules/es.array.iterator.js'), require('core-js/modules/es.parse-float.js'), require('core-js/modules/web.dom-collections.iterator.js'), require('core-js/modules/es.array.includes.js'), require('react-router-dom'), require('core-js/modules/es.string.includes.js'), require('core-js/modules/es.string.starts-with.js'), require('date-fns/format'), require('formik'), require('core-js/modules/es.number.to-fixed.js'), require('core-js/modules/web.url.js'), require('core-js/modules/web.url.to-json.js'), require('core-js/modules/web.url-search-params.js'), require('zustand'), require('src/components/Layout')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define(['exports', 'core-js/modules/es.symbol.description.js', 'react', 'core-js/modules/es.object.assign.js', 'app-studio', 'core-js/modules/es.array.iterator.js', 'core-js/modules/es.parse-float.js', 'core-js/modules/web.dom-collections.iterator.js', 'core-js/modules/es.array.includes.js', 'react-router-dom', 'core-js/modules/es.string.includes.js', 'core-js/modules/es.string.starts-with.js', 'date-fns/format', 'formik', 'core-js/modules/es.number.to-fixed.js', 'core-js/modules/web.url.js', 'core-js/modules/web.url.to-json.js', 'core-js/modules/web.url-search-params.js', 'zustand', 'src/components/Layout'], factory) :
|
|
4
|
+
(global = global || self, factory(global['@app-studio/web'] = {}, null, global.React, null, global.appStudio, null, null, null, null, global.reactRouterDom, null, null, global.format, global.formik, null, null, null, null, global.zustand, global.Layout));
|
|
5
|
+
}(this, (function (exports, es_symbol_description_js, React, es_object_assign_js, appStudio, es_array_iterator_js, es_parseFloat_js, web_domCollections_iterator_js, es_array_includes_js, reactRouterDom, es_string_includes_js, es_string_startsWith_js, format, formik, es_number_toFixed_js, web_url_js, web_url_toJson_js, web_urlSearchParams_js, zustand, Layout) { 'use strict';
|
|
6
6
|
|
|
7
7
|
var React__default = 'default' in React ? React['default'] : React;
|
|
8
8
|
format = format && Object.prototype.hasOwnProperty.call(format, 'default') ? format['default'] : format;
|
|
@@ -706,7 +706,7 @@
|
|
|
706
706
|
d: "M0 0h24v24H0z",
|
|
707
707
|
fill: "none"
|
|
708
708
|
}), /*#__PURE__*/React__default.createElement("path", {
|
|
709
|
-
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
|
|
709
|
+
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"
|
|
710
710
|
})));
|
|
711
711
|
};
|
|
712
712
|
// Example Refactored Icon: MinusIcon without undefined 'padding' prop
|
|
@@ -1392,7 +1392,9 @@
|
|
|
1392
1392
|
viewBox: "0 0 24 24",
|
|
1393
1393
|
"aria-hidden": "false",
|
|
1394
1394
|
focusable: "false"
|
|
1395
|
-
}, getSvgProps(filled, color, strokeWidth)), /*#__PURE__*/React__default.createElement("
|
|
1395
|
+
}, getSvgProps(filled, color, strokeWidth)), filled ? (/*#__PURE__*/React__default.createElement("path", {
|
|
1396
|
+
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"
|
|
1397
|
+
})) : (/*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("rect", {
|
|
1396
1398
|
x: "3",
|
|
1397
1399
|
y: "11",
|
|
1398
1400
|
width: "18",
|
|
@@ -1401,7 +1403,11 @@
|
|
|
1401
1403
|
ry: "2"
|
|
1402
1404
|
}), /*#__PURE__*/React__default.createElement("path", {
|
|
1403
1405
|
d: "M7 11V7a5 5 0 0 1 10 0v4"
|
|
1404
|
-
})
|
|
1406
|
+
}), /*#__PURE__*/React__default.createElement("circle", {
|
|
1407
|
+
cx: "12",
|
|
1408
|
+
cy: "16",
|
|
1409
|
+
r: "1.5"
|
|
1410
|
+
})))));
|
|
1405
1411
|
};
|
|
1406
1412
|
var MicrophoneIcon = _ref43 => {
|
|
1407
1413
|
var {
|
|
@@ -1671,7 +1677,9 @@
|
|
|
1671
1677
|
viewBox: "0 0 24 24",
|
|
1672
1678
|
"aria-hidden": "false",
|
|
1673
1679
|
focusable: "false"
|
|
1674
|
-
}, getSvgProps(filled, color, strokeWidth)), /*#__PURE__*/React__default.createElement("
|
|
1680
|
+
}, getSvgProps(filled, color, strokeWidth)), filled ? (/*#__PURE__*/React__default.createElement("path", {
|
|
1681
|
+
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"
|
|
1682
|
+
})) : (/*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("rect", {
|
|
1675
1683
|
x: "3",
|
|
1676
1684
|
y: "11",
|
|
1677
1685
|
width: "18",
|
|
@@ -1680,7 +1688,11 @@
|
|
|
1680
1688
|
ry: "2"
|
|
1681
1689
|
}), /*#__PURE__*/React__default.createElement("path", {
|
|
1682
1690
|
d: "M7 11V7a5 5 0 0 1 9.9-1"
|
|
1683
|
-
})
|
|
1691
|
+
}), /*#__PURE__*/React__default.createElement("circle", {
|
|
1692
|
+
cx: "12",
|
|
1693
|
+
cy: "16",
|
|
1694
|
+
r: "1.5"
|
|
1695
|
+
})))));
|
|
1684
1696
|
};
|
|
1685
1697
|
var WifiIcon = _ref56 => {
|
|
1686
1698
|
var {
|
|
@@ -3113,6 +3125,7 @@
|
|
|
3113
3125
|
return /*#__PURE__*/React__default.createElement(appStudio.Element, Object.assign({
|
|
3114
3126
|
gap: 8,
|
|
3115
3127
|
as: "button",
|
|
3128
|
+
type: "button",
|
|
3116
3129
|
border: "none",
|
|
3117
3130
|
color: "color.white",
|
|
3118
3131
|
display: "flex",
|
|
@@ -6973,6 +6986,540 @@
|
|
|
6973
6986
|
*/
|
|
6974
6987
|
var FormikComboBox = ComboBoxComponent$1;
|
|
6975
6988
|
|
|
6989
|
+
// Clamp value between min and max
|
|
6990
|
+
var clamp = (value, min, max) => Math.min(Math.max(value, min), max);
|
|
6991
|
+
// Calculate value based on position, track dimensions, min, max, step
|
|
6992
|
+
var calculateValue = (position, trackRect, min, max, step, orientation, stepValues) => {
|
|
6993
|
+
var range = max - min;
|
|
6994
|
+
var percentage;
|
|
6995
|
+
if (orientation === 'horizontal') {
|
|
6996
|
+
var trackLength = trackRect.width;
|
|
6997
|
+
var relativePosition = position - trackRect.left;
|
|
6998
|
+
percentage = clamp(relativePosition / trackLength, 0, 1);
|
|
6999
|
+
} else {
|
|
7000
|
+
// Vertical: top is max, bottom is min (reversed from the provided code)
|
|
7001
|
+
var _trackLength = trackRect.height;
|
|
7002
|
+
var _relativePosition = trackRect.bottom - position; // Y position relative to track bottom
|
|
7003
|
+
percentage = clamp(_relativePosition / _trackLength, 0, 1);
|
|
7004
|
+
}
|
|
7005
|
+
// If stepValues are provided, find the closest value in the array
|
|
7006
|
+
if (stepValues && stepValues.length > 0) {
|
|
7007
|
+
var rawValue = min + percentage * range;
|
|
7008
|
+
// Find the closest value in stepValues
|
|
7009
|
+
var closestValue = stepValues[0];
|
|
7010
|
+
var minDistance = Math.abs(rawValue - closestValue);
|
|
7011
|
+
for (var i = 1; i < stepValues.length; i++) {
|
|
7012
|
+
var distance = Math.abs(rawValue - stepValues[i]);
|
|
7013
|
+
if (distance < minDistance) {
|
|
7014
|
+
minDistance = distance;
|
|
7015
|
+
closestValue = stepValues[i];
|
|
7016
|
+
}
|
|
7017
|
+
}
|
|
7018
|
+
return closestValue;
|
|
7019
|
+
} else {
|
|
7020
|
+
// Use regular step logic
|
|
7021
|
+
var _rawValue = min + percentage * range;
|
|
7022
|
+
var steppedValue = Math.round(_rawValue / step) * step;
|
|
7023
|
+
// Final clamp to ensure step rounding doesn't exceed bounds
|
|
7024
|
+
return clamp(steppedValue, min, max);
|
|
7025
|
+
}
|
|
7026
|
+
};
|
|
7027
|
+
var useSliderState = _ref => {
|
|
7028
|
+
var _ref2;
|
|
7029
|
+
var {
|
|
7030
|
+
min = 0,
|
|
7031
|
+
max = 100,
|
|
7032
|
+
step = 1,
|
|
7033
|
+
value: controlledValue = 0,
|
|
7034
|
+
defaultValue,
|
|
7035
|
+
onChange,
|
|
7036
|
+
onDrag,
|
|
7037
|
+
orientation = 'horizontal',
|
|
7038
|
+
isDisabled = false,
|
|
7039
|
+
stepValues
|
|
7040
|
+
} = _ref;
|
|
7041
|
+
var initialValue = clamp((_ref2 = controlledValue != null ? controlledValue : defaultValue) != null ? _ref2 : min, min, max);
|
|
7042
|
+
var [internalValue, setInternalValue] = React.useState(initialValue);
|
|
7043
|
+
var [isDragging, setIsDragging] = React.useState(false);
|
|
7044
|
+
var [isHovered, setIsHovered] = React.useState(false);
|
|
7045
|
+
var trackRef = React.useRef(null);
|
|
7046
|
+
var thumbRef = React.useRef(null);
|
|
7047
|
+
var isControlled = controlledValue !== undefined;
|
|
7048
|
+
var currentValue = isControlled ? controlledValue : internalValue;
|
|
7049
|
+
// Update internal state if controlled value changes
|
|
7050
|
+
React.useEffect(() => {
|
|
7051
|
+
if (isControlled) {
|
|
7052
|
+
setInternalValue(clamp(controlledValue, min, max));
|
|
7053
|
+
}
|
|
7054
|
+
}, [controlledValue, isControlled, min, max]);
|
|
7055
|
+
var updateValue = React.useCallback(newValue => {
|
|
7056
|
+
var clampedValue = clamp(newValue, min, max);
|
|
7057
|
+
if (!isControlled) {
|
|
7058
|
+
setInternalValue(clampedValue);
|
|
7059
|
+
}
|
|
7060
|
+
if (onChange && clampedValue !== currentValue) {
|
|
7061
|
+
onChange(clampedValue);
|
|
7062
|
+
}
|
|
7063
|
+
if (isDragging && onDrag) {
|
|
7064
|
+
onDrag(clampedValue);
|
|
7065
|
+
}
|
|
7066
|
+
}, [isControlled, min, max, onChange, currentValue, isDragging, onDrag]);
|
|
7067
|
+
var handleInteraction = React.useCallback(event => {
|
|
7068
|
+
if (isDisabled || !trackRef.current) return;
|
|
7069
|
+
var trackRect = trackRef.current.getBoundingClientRect();
|
|
7070
|
+
var position;
|
|
7071
|
+
if ('touches' in event) {
|
|
7072
|
+
position = orientation === 'horizontal' ? event.touches[0].clientX : event.touches[0].clientY;
|
|
7073
|
+
} else {
|
|
7074
|
+
position = orientation === 'horizontal' ? event.clientX : event.clientY;
|
|
7075
|
+
}
|
|
7076
|
+
var newValue = calculateValue(position, trackRect, min, max, step, orientation, stepValues);
|
|
7077
|
+
updateValue(newValue);
|
|
7078
|
+
}, [min, max, step, orientation, updateValue, isDisabled, stepValues]);
|
|
7079
|
+
var handleMouseDown = React.useCallback(event => {
|
|
7080
|
+
if (isDisabled) return;
|
|
7081
|
+
event.preventDefault(); // Prevent text selection during drag
|
|
7082
|
+
setIsDragging(true);
|
|
7083
|
+
handleInteraction(event); // Update value immediately on click/touch
|
|
7084
|
+
var handleMouseMove = moveEvent => {
|
|
7085
|
+
handleInteraction(moveEvent);
|
|
7086
|
+
};
|
|
7087
|
+
var handleMouseUp = () => {
|
|
7088
|
+
setIsDragging(false);
|
|
7089
|
+
document.removeEventListener('mousemove', handleMouseMove);
|
|
7090
|
+
document.removeEventListener('mouseup', handleMouseUp);
|
|
7091
|
+
document.removeEventListener('touchmove', handleMouseMove);
|
|
7092
|
+
document.removeEventListener('touchend', handleMouseUp);
|
|
7093
|
+
};
|
|
7094
|
+
document.addEventListener('mousemove', handleMouseMove);
|
|
7095
|
+
document.addEventListener('mouseup', handleMouseUp);
|
|
7096
|
+
document.addEventListener('touchmove', handleMouseMove);
|
|
7097
|
+
document.addEventListener('touchend', handleMouseUp);
|
|
7098
|
+
}, [handleInteraction, isDisabled]);
|
|
7099
|
+
// Allow clicking directly on the track
|
|
7100
|
+
var handleTrackMouseDown = React.useCallback(event => {
|
|
7101
|
+
// Prevent triggering if click is on the thumb itself
|
|
7102
|
+
if (thumbRef.current && thumbRef.current.contains(event.target)) {
|
|
7103
|
+
return;
|
|
7104
|
+
}
|
|
7105
|
+
handleMouseDown(event);
|
|
7106
|
+
}, [handleMouseDown]);
|
|
7107
|
+
var handleKeyDown = React.useCallback(event => {
|
|
7108
|
+
if (isDisabled) return;
|
|
7109
|
+
var newValue = currentValue;
|
|
7110
|
+
switch (event.key) {
|
|
7111
|
+
case 'ArrowLeft':
|
|
7112
|
+
case 'ArrowDown':
|
|
7113
|
+
newValue = currentValue - step;
|
|
7114
|
+
break;
|
|
7115
|
+
case 'ArrowRight':
|
|
7116
|
+
case 'ArrowUp':
|
|
7117
|
+
newValue = currentValue + step;
|
|
7118
|
+
break;
|
|
7119
|
+
case 'Home':
|
|
7120
|
+
newValue = min;
|
|
7121
|
+
break;
|
|
7122
|
+
case 'End':
|
|
7123
|
+
newValue = max;
|
|
7124
|
+
break;
|
|
7125
|
+
default:
|
|
7126
|
+
return;
|
|
7127
|
+
// Exit if key is not handled
|
|
7128
|
+
}
|
|
7129
|
+
event.preventDefault(); // Prevent page scroll
|
|
7130
|
+
updateValue(newValue);
|
|
7131
|
+
}, [currentValue, min, max, step, updateValue, isDisabled]);
|
|
7132
|
+
var range = max - min;
|
|
7133
|
+
var thumbPositionPercent = range === 0 ? 0 : (currentValue - min) / range * 100;
|
|
7134
|
+
return {
|
|
7135
|
+
currentValue,
|
|
7136
|
+
isDragging,
|
|
7137
|
+
isHovered,
|
|
7138
|
+
setIsHovered,
|
|
7139
|
+
trackRef,
|
|
7140
|
+
thumbRef,
|
|
7141
|
+
handleThumbMouseDown: handleMouseDown,
|
|
7142
|
+
handleTrackMouseDown,
|
|
7143
|
+
handleKeyDown,
|
|
7144
|
+
thumbPositionPercent
|
|
7145
|
+
};
|
|
7146
|
+
};
|
|
7147
|
+
|
|
7148
|
+
var SliderSizes$1 = {
|
|
7149
|
+
xs: {
|
|
7150
|
+
height: 4,
|
|
7151
|
+
width: '100%'
|
|
7152
|
+
},
|
|
7153
|
+
sm: {
|
|
7154
|
+
height: 6,
|
|
7155
|
+
width: '100%'
|
|
7156
|
+
},
|
|
7157
|
+
md: {
|
|
7158
|
+
height: 8,
|
|
7159
|
+
width: '100%'
|
|
7160
|
+
},
|
|
7161
|
+
lg: {
|
|
7162
|
+
height: 10,
|
|
7163
|
+
width: '100%'
|
|
7164
|
+
},
|
|
7165
|
+
xl: {
|
|
7166
|
+
height: 12,
|
|
7167
|
+
width: '100%'
|
|
7168
|
+
}
|
|
7169
|
+
};
|
|
7170
|
+
var ThumbSizes = {
|
|
7171
|
+
xs: {
|
|
7172
|
+
width: 12,
|
|
7173
|
+
height: 12
|
|
7174
|
+
},
|
|
7175
|
+
sm: {
|
|
7176
|
+
width: 16,
|
|
7177
|
+
height: 16
|
|
7178
|
+
},
|
|
7179
|
+
md: {
|
|
7180
|
+
width: 20,
|
|
7181
|
+
height: 20
|
|
7182
|
+
},
|
|
7183
|
+
lg: {
|
|
7184
|
+
width: 24,
|
|
7185
|
+
height: 24
|
|
7186
|
+
},
|
|
7187
|
+
xl: {
|
|
7188
|
+
width: 28,
|
|
7189
|
+
height: 28
|
|
7190
|
+
}
|
|
7191
|
+
};
|
|
7192
|
+
var SliderShapes = {
|
|
7193
|
+
sharp: 0,
|
|
7194
|
+
rounded: 4,
|
|
7195
|
+
pillShaped: 24
|
|
7196
|
+
};
|
|
7197
|
+
var SliderVariants = {
|
|
7198
|
+
default: {
|
|
7199
|
+
backgroundColor: 'color.blueGray.200'
|
|
7200
|
+
},
|
|
7201
|
+
outline: {
|
|
7202
|
+
backgroundColor: 'transparent',
|
|
7203
|
+
borderWidth: 1,
|
|
7204
|
+
borderStyle: 'solid',
|
|
7205
|
+
borderColor: 'color.blueGray.300'
|
|
7206
|
+
}
|
|
7207
|
+
};
|
|
7208
|
+
// Maps Size enum to track height/width and thumb size for the new implementation
|
|
7209
|
+
var EnhancedSliderSizes = {
|
|
7210
|
+
xs: {
|
|
7211
|
+
trackCrossAxisSize: 4,
|
|
7212
|
+
thumbSize: 12
|
|
7213
|
+
},
|
|
7214
|
+
sm: {
|
|
7215
|
+
trackCrossAxisSize: 6,
|
|
7216
|
+
thumbSize: 16
|
|
7217
|
+
},
|
|
7218
|
+
md: {
|
|
7219
|
+
trackCrossAxisSize: 8,
|
|
7220
|
+
thumbSize: 20
|
|
7221
|
+
},
|
|
7222
|
+
lg: {
|
|
7223
|
+
trackCrossAxisSize: 10,
|
|
7224
|
+
thumbSize: 24
|
|
7225
|
+
},
|
|
7226
|
+
xl: {
|
|
7227
|
+
trackCrossAxisSize: 12,
|
|
7228
|
+
thumbSize: 28
|
|
7229
|
+
}
|
|
7230
|
+
};
|
|
7231
|
+
// Basic styles for horizontal and vertical orientation
|
|
7232
|
+
var OrientationStyles = {
|
|
7233
|
+
horizontal: {
|
|
7234
|
+
width: '100%',
|
|
7235
|
+
minWidth: '120px',
|
|
7236
|
+
height: 'auto',
|
|
7237
|
+
flexDirection: 'row',
|
|
7238
|
+
paddingVertical: 8
|
|
7239
|
+
},
|
|
7240
|
+
vertical: {
|
|
7241
|
+
height: '100%',
|
|
7242
|
+
minHeight: '120px',
|
|
7243
|
+
width: 'auto',
|
|
7244
|
+
flexDirection: 'column-reverse',
|
|
7245
|
+
paddingHorizontal: 8
|
|
7246
|
+
}
|
|
7247
|
+
};
|
|
7248
|
+
|
|
7249
|
+
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"];
|
|
7250
|
+
var SliderView = _ref => {
|
|
7251
|
+
var _views$tooltip, _views$tooltip2;
|
|
7252
|
+
var {
|
|
7253
|
+
min = 0,
|
|
7254
|
+
max = 100,
|
|
7255
|
+
step = 1,
|
|
7256
|
+
currentValue,
|
|
7257
|
+
stepValues,
|
|
7258
|
+
shape = 'rounded',
|
|
7259
|
+
size = 'md',
|
|
7260
|
+
variant = 'default',
|
|
7261
|
+
orientation = 'horizontal',
|
|
7262
|
+
isDisabled = false,
|
|
7263
|
+
showValue = false,
|
|
7264
|
+
showTooltip = false,
|
|
7265
|
+
colorScheme = 'theme.primary',
|
|
7266
|
+
label,
|
|
7267
|
+
helperText,
|
|
7268
|
+
themeMode: elementMode,
|
|
7269
|
+
shadow = {},
|
|
7270
|
+
isDragging,
|
|
7271
|
+
isHovered,
|
|
7272
|
+
setIsHovered,
|
|
7273
|
+
trackRef,
|
|
7274
|
+
thumbRef,
|
|
7275
|
+
handleThumbMouseDown,
|
|
7276
|
+
handleTrackMouseDown,
|
|
7277
|
+
handleKeyDown,
|
|
7278
|
+
thumbPositionPercent,
|
|
7279
|
+
ariaLabel = 'Slider',
|
|
7280
|
+
views = {
|
|
7281
|
+
container: {},
|
|
7282
|
+
track: {},
|
|
7283
|
+
progress: {},
|
|
7284
|
+
filledTrack: {},
|
|
7285
|
+
thumb: {},
|
|
7286
|
+
label: {},
|
|
7287
|
+
valueLabel: {},
|
|
7288
|
+
stepMarks: {},
|
|
7289
|
+
tooltip: {}
|
|
7290
|
+
}
|
|
7291
|
+
} = _ref,
|
|
7292
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$y);
|
|
7293
|
+
var {
|
|
7294
|
+
getColor,
|
|
7295
|
+
themeMode
|
|
7296
|
+
} = appStudio.useTheme();
|
|
7297
|
+
var themeColor = getColor(colorScheme, elementMode || themeMode);
|
|
7298
|
+
var disabledColor = getColor('theme.disabled', elementMode || themeMode);
|
|
7299
|
+
var trackColor = getColor(SliderVariants[variant].backgroundColor, elementMode || themeMode);
|
|
7300
|
+
var isVertical = orientation === 'vertical';
|
|
7301
|
+
var {
|
|
7302
|
+
trackCrossAxisSize,
|
|
7303
|
+
thumbSize
|
|
7304
|
+
} = EnhancedSliderSizes[size] || {
|
|
7305
|
+
trackCrossAxisSize: SliderSizes$1[size].height,
|
|
7306
|
+
thumbSize: ThumbSizes[size].width || 16
|
|
7307
|
+
};
|
|
7308
|
+
// For backward compatibility with the old implementation
|
|
7309
|
+
var legacyView = /*#__PURE__*/React__default.createElement(Vertical, Object.assign({
|
|
7310
|
+
width: "100%",
|
|
7311
|
+
gap: 8
|
|
7312
|
+
}, views.container, props), label && (/*#__PURE__*/React__default.createElement(Horizontal, {
|
|
7313
|
+
justifyContent: "space-between",
|
|
7314
|
+
alignItems: "center"
|
|
7315
|
+
}, /*#__PURE__*/React__default.createElement(appStudio.Text, Object.assign({
|
|
7316
|
+
fontSize: 14,
|
|
7317
|
+
fontWeight: 500
|
|
7318
|
+
}, views.label), label), showValue && (/*#__PURE__*/React__default.createElement(appStudio.Text, Object.assign({
|
|
7319
|
+
fontSize: 14,
|
|
7320
|
+
color: "color.blueGray.500"
|
|
7321
|
+
}, views.valueLabel), currentValue)))), /*#__PURE__*/React__default.createElement(appStudio.View, Object.assign({
|
|
7322
|
+
ref: trackRef,
|
|
7323
|
+
position: "relative",
|
|
7324
|
+
cursor: isDisabled ? 'not-allowed' : 'pointer',
|
|
7325
|
+
opacity: isDisabled ? 0.6 : 1,
|
|
7326
|
+
onMouseDown: handleTrackMouseDown,
|
|
7327
|
+
onMouseEnter: () => setIsHovered(true),
|
|
7328
|
+
onMouseLeave: () => setIsHovered(false)
|
|
7329
|
+
}, SliderSizes$1[size], {
|
|
7330
|
+
borderRadius: SliderShapes[shape],
|
|
7331
|
+
backgroundColor: trackColor
|
|
7332
|
+
}, SliderVariants[variant], shadow, views.track), stepValues && stepValues.length > 0 && (/*#__PURE__*/React__default.createElement(React__default.Fragment, null, stepValues.map(stepValue => {
|
|
7333
|
+
var stepPercentage = (stepValue - min) / (max - min) * 100;
|
|
7334
|
+
return /*#__PURE__*/React__default.createElement(appStudio.View, Object.assign({
|
|
7335
|
+
key: stepValue,
|
|
7336
|
+
position: "absolute",
|
|
7337
|
+
top: "50%",
|
|
7338
|
+
left: stepPercentage + "%",
|
|
7339
|
+
transform: "translate(-50%, -50%)",
|
|
7340
|
+
width: 4,
|
|
7341
|
+
height: 4,
|
|
7342
|
+
borderRadius: "50%",
|
|
7343
|
+
backgroundColor: isDisabled ? disabledColor : themeColor,
|
|
7344
|
+
zIndex: 1
|
|
7345
|
+
}, views.stepMarks));
|
|
7346
|
+
}))), /*#__PURE__*/React__default.createElement(appStudio.View, Object.assign({
|
|
7347
|
+
position: "absolute",
|
|
7348
|
+
top: 0,
|
|
7349
|
+
left: 0,
|
|
7350
|
+
height: "100%",
|
|
7351
|
+
width: thumbPositionPercent + "%",
|
|
7352
|
+
backgroundColor: isDisabled ? disabledColor : themeColor,
|
|
7353
|
+
borderRadius: SliderShapes[shape],
|
|
7354
|
+
transition: "width 0.1s ease-in-out"
|
|
7355
|
+
}, views.progress, views.filledTrack)), /*#__PURE__*/React__default.createElement(appStudio.View, Object.assign({
|
|
7356
|
+
ref: thumbRef,
|
|
7357
|
+
role: "slider",
|
|
7358
|
+
tabIndex: isDisabled ? -1 : 0,
|
|
7359
|
+
"aria-valuemin": min,
|
|
7360
|
+
"aria-valuemax": max,
|
|
7361
|
+
"aria-valuenow": currentValue,
|
|
7362
|
+
"aria-orientation": orientation,
|
|
7363
|
+
"aria-disabled": isDisabled,
|
|
7364
|
+
"aria-label": ariaLabel,
|
|
7365
|
+
position: "absolute",
|
|
7366
|
+
top: "50%",
|
|
7367
|
+
left: thumbPositionPercent + "%",
|
|
7368
|
+
borderRadius: "50%",
|
|
7369
|
+
backgroundColor: "white",
|
|
7370
|
+
boxShadow: "0 2px 4px rgba(0, 0, 0, 0.2)",
|
|
7371
|
+
border: "2px solid " + (isDisabled ? disabledColor : themeColor),
|
|
7372
|
+
transition: isDragging ? 'none' : 'transform 0.1s ease-in-out',
|
|
7373
|
+
transform: isHovered ? 'translate(-50%, -50%) scale(1.1)' : 'translate(-50%, -50%)',
|
|
7374
|
+
zIndex: 2,
|
|
7375
|
+
onMouseDown: handleThumbMouseDown,
|
|
7376
|
+
onTouchStart: handleThumbMouseDown,
|
|
7377
|
+
onKeyDown: handleKeyDown
|
|
7378
|
+
}, ThumbSizes[size], views.thumb), showTooltip && (isHovered || isDragging) && (/*#__PURE__*/React__default.createElement(appStudio.View, Object.assign({
|
|
7379
|
+
position: "absolute",
|
|
7380
|
+
bottom: "100%",
|
|
7381
|
+
left: "50%",
|
|
7382
|
+
transform: "translateX(-50%)",
|
|
7383
|
+
marginBottom: 8,
|
|
7384
|
+
padding: "4px 8px",
|
|
7385
|
+
backgroundColor: "color.black",
|
|
7386
|
+
color: "color.white",
|
|
7387
|
+
borderRadius: 4,
|
|
7388
|
+
fontSize: 12,
|
|
7389
|
+
whiteSpace: "nowrap",
|
|
7390
|
+
zIndex: 3
|
|
7391
|
+
}, views.tooltip), /*#__PURE__*/React__default.createElement(appStudio.Text, 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__default.createElement(HelperText, null, helperText));
|
|
7392
|
+
// Enhanced view with vertical support and other features
|
|
7393
|
+
var enhancedView = /*#__PURE__*/React__default.createElement(Center
|
|
7394
|
+
// Use Center to easily manage orientation layout
|
|
7395
|
+
, Object.assign({}, OrientationStyles[orientation], {
|
|
7396
|
+
position: "relative" // Needed for absolute positioning of thumb/tooltip
|
|
7397
|
+
,
|
|
7398
|
+
onMouseEnter: () => !isDisabled && setIsHovered(true),
|
|
7399
|
+
onMouseLeave: () => !isDisabled && setIsHovered(false)
|
|
7400
|
+
}, props, views == null ? void 0 : views.container), label && (/*#__PURE__*/React__default.createElement(Horizontal, {
|
|
7401
|
+
justifyContent: "space-between",
|
|
7402
|
+
alignItems: "center",
|
|
7403
|
+
marginBottom: 8,
|
|
7404
|
+
width: "100%"
|
|
7405
|
+
}, /*#__PURE__*/React__default.createElement(appStudio.Text, Object.assign({
|
|
7406
|
+
fontSize: 14,
|
|
7407
|
+
fontWeight: 500
|
|
7408
|
+
}, views.label), label), showValue && (/*#__PURE__*/React__default.createElement(appStudio.Text, Object.assign({
|
|
7409
|
+
fontSize: 14,
|
|
7410
|
+
color: "color.blueGray.500"
|
|
7411
|
+
}, views.valueLabel), currentValue)))), /*#__PURE__*/React__default.createElement(appStudio.View, Object.assign({
|
|
7412
|
+
ref: trackRef,
|
|
7413
|
+
position: "relative",
|
|
7414
|
+
borderRadius: trackCrossAxisSize / 2,
|
|
7415
|
+
backgroundColor: isDisabled ? disabledColor : trackColor,
|
|
7416
|
+
cursor: isDisabled ? 'not-allowed' : 'pointer',
|
|
7417
|
+
width: isVertical ? trackCrossAxisSize + "px" : '100%',
|
|
7418
|
+
height: isVertical ? '100%' : trackCrossAxisSize + "px",
|
|
7419
|
+
onMouseDown: handleTrackMouseDown,
|
|
7420
|
+
onTouchStart: handleTrackMouseDown
|
|
7421
|
+
}, views == null ? void 0 : views.track), stepValues && stepValues.length > 0 && (/*#__PURE__*/React__default.createElement(React__default.Fragment, null, stepValues.map(stepValue => {
|
|
7422
|
+
var stepPercentage = (stepValue - min) / (max - min) * 100;
|
|
7423
|
+
return /*#__PURE__*/React__default.createElement(appStudio.View, Object.assign({
|
|
7424
|
+
key: stepValue,
|
|
7425
|
+
position: "absolute",
|
|
7426
|
+
width: 4,
|
|
7427
|
+
height: 4,
|
|
7428
|
+
borderRadius: "50%",
|
|
7429
|
+
backgroundColor: isDisabled ? disabledColor : themeColor,
|
|
7430
|
+
zIndex: 1
|
|
7431
|
+
}, isVertical ? {
|
|
7432
|
+
bottom: stepPercentage + "%",
|
|
7433
|
+
left: '50%',
|
|
7434
|
+
transform: 'translate(-50%, 50%)'
|
|
7435
|
+
} : {
|
|
7436
|
+
left: stepPercentage + "%",
|
|
7437
|
+
top: '50%',
|
|
7438
|
+
transform: 'translate(-50%, -50%)'
|
|
7439
|
+
}, views.stepMarks));
|
|
7440
|
+
}))), /*#__PURE__*/React__default.createElement(appStudio.View, Object.assign({
|
|
7441
|
+
position: "absolute",
|
|
7442
|
+
borderRadius: trackCrossAxisSize / 2,
|
|
7443
|
+
backgroundColor: isDisabled ? disabledColor : themeColor
|
|
7444
|
+
}, isVertical ? {
|
|
7445
|
+
bottom: 0,
|
|
7446
|
+
left: 0,
|
|
7447
|
+
width: '100%',
|
|
7448
|
+
height: thumbPositionPercent + "%"
|
|
7449
|
+
} : {
|
|
7450
|
+
top: 0,
|
|
7451
|
+
left: 0,
|
|
7452
|
+
height: '100%',
|
|
7453
|
+
width: thumbPositionPercent + "%"
|
|
7454
|
+
}, views == null ? void 0 : views.filledTrack, views == null ? void 0 : views.progress)), /*#__PURE__*/React__default.createElement(appStudio.View, Object.assign({
|
|
7455
|
+
ref: thumbRef,
|
|
7456
|
+
role: "slider",
|
|
7457
|
+
tabIndex: isDisabled ? -1 : 0,
|
|
7458
|
+
"aria-valuemin": min,
|
|
7459
|
+
"aria-valuemax": max,
|
|
7460
|
+
"aria-valuenow": currentValue,
|
|
7461
|
+
"aria-orientation": orientation,
|
|
7462
|
+
"aria-disabled": isDisabled,
|
|
7463
|
+
"aria-label": ariaLabel,
|
|
7464
|
+
position: "absolute",
|
|
7465
|
+
width: thumbSize + "px",
|
|
7466
|
+
height: thumbSize + "px",
|
|
7467
|
+
borderRadius: "50%",
|
|
7468
|
+
backgroundColor: isDisabled ? disabledColor : themeColor,
|
|
7469
|
+
border: "2px solid " + getColor('color.white'),
|
|
7470
|
+
boxShadow: "0 1px 3px rgba(0, 0, 0, 0.2)",
|
|
7471
|
+
cursor: isDisabled ? 'not-allowed' : 'grab',
|
|
7472
|
+
transform: isVertical ? 'translateX(-50%)' : 'translateY(-50%)',
|
|
7473
|
+
zIndex: 2,
|
|
7474
|
+
transition: isDragging ? 'none' : 'left 0.1s, bottom 0.1s'
|
|
7475
|
+
}, isVertical ? {
|
|
7476
|
+
left: '50%',
|
|
7477
|
+
bottom: thumbPositionPercent + "%"
|
|
7478
|
+
} : {
|
|
7479
|
+
top: '50%',
|
|
7480
|
+
left: thumbPositionPercent + "%"
|
|
7481
|
+
}, {
|
|
7482
|
+
onMouseDown: handleThumbMouseDown,
|
|
7483
|
+
onTouchStart: handleThumbMouseDown,
|
|
7484
|
+
onKeyDown: handleKeyDown
|
|
7485
|
+
}, views == null ? void 0 : views.thumb), showTooltip && (isHovered || isDragging) && (/*#__PURE__*/React__default.createElement(appStudio.View, Object.assign({
|
|
7486
|
+
position: "absolute",
|
|
7487
|
+
padding: "4px 8px",
|
|
7488
|
+
backgroundColor: getColor('color.black'),
|
|
7489
|
+
color: getColor('color.white'),
|
|
7490
|
+
borderRadius: "4px",
|
|
7491
|
+
fontSize: "12px",
|
|
7492
|
+
whiteSpace: "nowrap",
|
|
7493
|
+
zIndex: 3
|
|
7494
|
+
}, isVertical ? {
|
|
7495
|
+
left: '100%',
|
|
7496
|
+
marginLeft: '8px',
|
|
7497
|
+
bottom: '0',
|
|
7498
|
+
transform: 'translateY(50%)'
|
|
7499
|
+
} : {
|
|
7500
|
+
bottom: '100%',
|
|
7501
|
+
left: '50%',
|
|
7502
|
+
marginBottom: '8px',
|
|
7503
|
+
transform: 'translateX(-50%)'
|
|
7504
|
+
}, views == null ? void 0 : views.tooltip), /*#__PURE__*/React__default.createElement(appStudio.Text, 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__default.createElement(HelperText, {
|
|
7505
|
+
marginTop: 8
|
|
7506
|
+
}, helperText));
|
|
7507
|
+
// Use the enhanced view if orientation is vertical or showTooltip is true
|
|
7508
|
+
// Otherwise use the legacy view for backward compatibility
|
|
7509
|
+
return isVertical || showTooltip ? enhancedView : legacyView;
|
|
7510
|
+
};
|
|
7511
|
+
|
|
7512
|
+
var SliderComponent = props => {
|
|
7513
|
+
// Get state and handlers from the custom hook
|
|
7514
|
+
var sliderState = useSliderState(props);
|
|
7515
|
+
// Render the view component, passing down props and state
|
|
7516
|
+
return /*#__PURE__*/React__default.createElement(SliderView, Object.assign({}, props, sliderState));
|
|
7517
|
+
};
|
|
7518
|
+
/**
|
|
7519
|
+
* Slider allows users to select a value from a range by moving a handle.
|
|
7520
|
+
*/
|
|
7521
|
+
var Slider = SliderComponent;
|
|
7522
|
+
|
|
6976
7523
|
// Create your store with the initial state and actions.
|
|
6977
7524
|
var useMessageStore = /*#__PURE__*/zustand.create(set => ({
|
|
6978
7525
|
// initial state
|
|
@@ -7505,7 +8052,7 @@
|
|
|
7505
8052
|
}, views == null ? void 0 : views.view)));
|
|
7506
8053
|
};
|
|
7507
8054
|
|
|
7508
|
-
var _excluded$
|
|
8055
|
+
var _excluded$z = ["accept", "icon", "text", "maxSize", "onFileSelect", "validateFile", "isLoading", "progress"];
|
|
7509
8056
|
var Uploader = _ref => {
|
|
7510
8057
|
var {
|
|
7511
8058
|
accept = '*/*',
|
|
@@ -7517,7 +8064,7 @@
|
|
|
7517
8064
|
isLoading = false,
|
|
7518
8065
|
progress = 0
|
|
7519
8066
|
} = _ref,
|
|
7520
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
8067
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$z);
|
|
7521
8068
|
var {
|
|
7522
8069
|
previewUrl,
|
|
7523
8070
|
thumbnailUrl,
|
|
@@ -7654,7 +8201,7 @@
|
|
|
7654
8201
|
xl: 28
|
|
7655
8202
|
};
|
|
7656
8203
|
|
|
7657
|
-
var _excluded$
|
|
8204
|
+
var _excluded$A = ["children", "blur", "isOpen", "isClosePrevented", "onClose", "position", "views"],
|
|
7658
8205
|
_excluded2$7 = ["children", "shadow", "isFullScreen", "shape", "views"],
|
|
7659
8206
|
_excluded3$4 = ["children", "buttonColor", "iconSize", "buttonPosition", "views"],
|
|
7660
8207
|
_excluded4$3 = ["children", "views"],
|
|
@@ -7669,7 +8216,7 @@
|
|
|
7669
8216
|
position = 'center',
|
|
7670
8217
|
views
|
|
7671
8218
|
} = _ref,
|
|
7672
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
8219
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$A);
|
|
7673
8220
|
var handleClick = () => {
|
|
7674
8221
|
if (!isClosePrevented) onClose();
|
|
7675
8222
|
};
|
|
@@ -8148,7 +8695,7 @@
|
|
|
8148
8695
|
};
|
|
8149
8696
|
};
|
|
8150
8697
|
|
|
8151
|
-
var _excluded$
|
|
8698
|
+
var _excluded$B = ["children", "shape", "variant", "isHovered", "setIsHovered", "isDisabled", "isToggle", "setIsToggled", "onToggle", "views"];
|
|
8152
8699
|
var ToggleView = _ref => {
|
|
8153
8700
|
var {
|
|
8154
8701
|
children,
|
|
@@ -8162,7 +8709,7 @@
|
|
|
8162
8709
|
onToggle,
|
|
8163
8710
|
views
|
|
8164
8711
|
} = _ref,
|
|
8165
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
8712
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$B);
|
|
8166
8713
|
var toggleColor = !isDisabled ? 'color.trueGray.400' : 'theme.disabled';
|
|
8167
8714
|
var isActive = !!(isToggle || isHovered);
|
|
8168
8715
|
var toggleVariants = {
|
|
@@ -8205,7 +8752,7 @@
|
|
|
8205
8752
|
}, toggleVariants[variant], props, views == null ? void 0 : views.container), children);
|
|
8206
8753
|
};
|
|
8207
8754
|
|
|
8208
|
-
var _excluded$
|
|
8755
|
+
var _excluded$C = ["children", "shape", "variant", "isDisabled", "isToggled", "onToggle"];
|
|
8209
8756
|
// Destructuring properties from ToggleProps to be used within the ToggleComponent.
|
|
8210
8757
|
var ToggleComponent = _ref => {
|
|
8211
8758
|
var {
|
|
@@ -8217,7 +8764,7 @@
|
|
|
8217
8764
|
isToggled = false,
|
|
8218
8765
|
onToggle
|
|
8219
8766
|
} = _ref,
|
|
8220
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
8767
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$C);
|
|
8221
8768
|
// Initializing toggle state and set state functions using the custom hook useToggleState.
|
|
8222
8769
|
var {
|
|
8223
8770
|
isHovered,
|
|
@@ -8457,6 +9004,157 @@
|
|
|
8457
9004
|
};
|
|
8458
9005
|
var DragAndDrop = DragAndDropComponent;
|
|
8459
9006
|
|
|
9007
|
+
var useHoverCardState = () => {
|
|
9008
|
+
var [isOpen, setIsOpen] = React.useState(false);
|
|
9009
|
+
return {
|
|
9010
|
+
isOpen,
|
|
9011
|
+
setIsOpen
|
|
9012
|
+
};
|
|
9013
|
+
};
|
|
9014
|
+
|
|
9015
|
+
var ContentPositions = {
|
|
9016
|
+
top: align => Object.assign({
|
|
9017
|
+
position: 'absolute',
|
|
9018
|
+
bottom: '100%',
|
|
9019
|
+
marginBottom: '8px'
|
|
9020
|
+
}, align === 'start' && {
|
|
9021
|
+
left: 0
|
|
9022
|
+
}, align === 'center' && {
|
|
9023
|
+
left: '50%',
|
|
9024
|
+
transform: 'translateX(-50%)'
|
|
9025
|
+
}, align === 'end' && {
|
|
9026
|
+
right: 0
|
|
9027
|
+
}),
|
|
9028
|
+
right: align => Object.assign({
|
|
9029
|
+
position: 'absolute',
|
|
9030
|
+
left: '100%',
|
|
9031
|
+
marginLeft: '8px'
|
|
9032
|
+
}, align === 'start' && {
|
|
9033
|
+
top: 0
|
|
9034
|
+
}, align === 'center' && {
|
|
9035
|
+
top: '50%',
|
|
9036
|
+
transform: 'translateY(-50%)'
|
|
9037
|
+
}, align === 'end' && {
|
|
9038
|
+
bottom: 0
|
|
9039
|
+
}),
|
|
9040
|
+
bottom: align => Object.assign({
|
|
9041
|
+
position: 'absolute',
|
|
9042
|
+
top: '100%',
|
|
9043
|
+
marginTop: '8px'
|
|
9044
|
+
}, align === 'start' && {
|
|
9045
|
+
left: 0
|
|
9046
|
+
}, align === 'center' && {
|
|
9047
|
+
left: '50%',
|
|
9048
|
+
transform: 'translateX(-50%)'
|
|
9049
|
+
}, align === 'end' && {
|
|
9050
|
+
right: 0
|
|
9051
|
+
}),
|
|
9052
|
+
left: align => Object.assign({
|
|
9053
|
+
position: 'absolute',
|
|
9054
|
+
right: '100%',
|
|
9055
|
+
marginRight: '8px'
|
|
9056
|
+
}, align === 'start' && {
|
|
9057
|
+
top: 0
|
|
9058
|
+
}, align === 'center' && {
|
|
9059
|
+
top: '50%',
|
|
9060
|
+
transform: 'translateY(-50%)'
|
|
9061
|
+
}, align === 'end' && {
|
|
9062
|
+
bottom: 0
|
|
9063
|
+
})
|
|
9064
|
+
};
|
|
9065
|
+
|
|
9066
|
+
var _excluded$D = ["children", "views"],
|
|
9067
|
+
_excluded2$8 = ["children", "views", "side", "align"];
|
|
9068
|
+
// Create context for the HoverCard
|
|
9069
|
+
var HoverCardContext = /*#__PURE__*/React.createContext({
|
|
9070
|
+
isOpen: false,
|
|
9071
|
+
setIsOpen: () => {}
|
|
9072
|
+
});
|
|
9073
|
+
var HoverCardProvider = _ref => {
|
|
9074
|
+
var {
|
|
9075
|
+
children,
|
|
9076
|
+
value
|
|
9077
|
+
} = _ref;
|
|
9078
|
+
return /*#__PURE__*/React__default.createElement(HoverCardContext.Provider, {
|
|
9079
|
+
value: value
|
|
9080
|
+
}, children);
|
|
9081
|
+
};
|
|
9082
|
+
var useHoverCardContext = () => {
|
|
9083
|
+
var context = React.useContext(HoverCardContext);
|
|
9084
|
+
if (!context) {
|
|
9085
|
+
throw new Error('useHoverCardContext must be used within a HoverCardProvider');
|
|
9086
|
+
}
|
|
9087
|
+
return context;
|
|
9088
|
+
};
|
|
9089
|
+
var HoverCardTrigger = _ref2 => {
|
|
9090
|
+
var {
|
|
9091
|
+
children,
|
|
9092
|
+
views
|
|
9093
|
+
} = _ref2,
|
|
9094
|
+
props = _objectWithoutPropertiesLoose(_ref2, _excluded$D);
|
|
9095
|
+
var {
|
|
9096
|
+
setIsOpen
|
|
9097
|
+
} = useHoverCardContext();
|
|
9098
|
+
return /*#__PURE__*/React__default.createElement(appStudio.View, Object.assign({
|
|
9099
|
+
position: "relative",
|
|
9100
|
+
display: "inline-block",
|
|
9101
|
+
onMouseEnter: () => setIsOpen(true),
|
|
9102
|
+
onMouseLeave: () => setIsOpen(false)
|
|
9103
|
+
}, views == null ? void 0 : views.container, props), children);
|
|
9104
|
+
};
|
|
9105
|
+
var HoverCardContent = _ref3 => {
|
|
9106
|
+
var {
|
|
9107
|
+
children,
|
|
9108
|
+
views,
|
|
9109
|
+
side = 'bottom',
|
|
9110
|
+
align = 'center'
|
|
9111
|
+
} = _ref3,
|
|
9112
|
+
props = _objectWithoutPropertiesLoose(_ref3, _excluded2$8);
|
|
9113
|
+
var {
|
|
9114
|
+
isOpen
|
|
9115
|
+
} = useHoverCardContext();
|
|
9116
|
+
if (!isOpen) {
|
|
9117
|
+
return null;
|
|
9118
|
+
}
|
|
9119
|
+
return /*#__PURE__*/React__default.createElement(appStudio.View, Object.assign({
|
|
9120
|
+
backgroundColor: "white",
|
|
9121
|
+
borderRadius: "4px",
|
|
9122
|
+
boxShadow: "0px 2px 8px rgba(0, 0, 0, 0.15)",
|
|
9123
|
+
padding: "12px",
|
|
9124
|
+
minWidth: "200px",
|
|
9125
|
+
maxWidth: "300px",
|
|
9126
|
+
zIndex: 1000
|
|
9127
|
+
}, ContentPositions[side](align), views == null ? void 0 : views.container, props), children);
|
|
9128
|
+
};
|
|
9129
|
+
|
|
9130
|
+
var _excluded$E = ["children", "views"];
|
|
9131
|
+
/**
|
|
9132
|
+
* HoverCard component displays floating content when hovering over a trigger element.
|
|
9133
|
+
*/
|
|
9134
|
+
var HoverCardComponent = _ref => {
|
|
9135
|
+
var {
|
|
9136
|
+
children,
|
|
9137
|
+
views
|
|
9138
|
+
} = _ref,
|
|
9139
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$E);
|
|
9140
|
+
var {
|
|
9141
|
+
isOpen,
|
|
9142
|
+
setIsOpen
|
|
9143
|
+
} = useHoverCardState();
|
|
9144
|
+
return /*#__PURE__*/React__default.createElement(HoverCardProvider, {
|
|
9145
|
+
value: {
|
|
9146
|
+
isOpen,
|
|
9147
|
+
setIsOpen
|
|
9148
|
+
}
|
|
9149
|
+
}, /*#__PURE__*/React__default.createElement(appStudio.View, Object.assign({
|
|
9150
|
+
position: "relative",
|
|
9151
|
+
display: "inline-block"
|
|
9152
|
+
}, views == null ? void 0 : views.container, props), children));
|
|
9153
|
+
};
|
|
9154
|
+
var HoverCard = HoverCardComponent;
|
|
9155
|
+
HoverCard.Trigger = HoverCardTrigger;
|
|
9156
|
+
HoverCard.Content = HoverCardContent;
|
|
9157
|
+
|
|
8460
9158
|
exports.Alert = Alert;
|
|
8461
9159
|
exports.ArrowIcon = ArrowIcon;
|
|
8462
9160
|
exports.AspectRatio = AspectRatio;
|
|
@@ -8510,6 +9208,7 @@
|
|
|
8510
9208
|
exports.HomeIcon = HomeIcon;
|
|
8511
9209
|
exports.Horizontal = Horizontal;
|
|
8512
9210
|
exports.HorizontalBase = HorizontalBase;
|
|
9211
|
+
exports.HoverCard = HoverCard;
|
|
8513
9212
|
exports.Icon = Icon;
|
|
8514
9213
|
exports.ImageIcon = ImageIcon;
|
|
8515
9214
|
exports.InfoIcon = InfoIcon;
|
|
@@ -8548,6 +9247,7 @@
|
|
|
8548
9247
|
exports.SettingsIcon = SettingsIcon;
|
|
8549
9248
|
exports.ShapeIcon = ShapeIcon;
|
|
8550
9249
|
exports.ShareIcon = ShareIcon;
|
|
9250
|
+
exports.Slider = Slider;
|
|
8551
9251
|
exports.SliderIcon = SliderIcon;
|
|
8552
9252
|
exports.SliderVerticalIcon = SliderVerticalIcon;
|
|
8553
9253
|
exports.SpinnerIcon = SpinnerIcon;
|