@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.
Files changed (43) hide show
  1. package/dist/components/Form/Password/Password/Password.state.d.ts +1 -1
  2. package/dist/components/HoverCard/HoverCard/HoverCard.props.d.ts +65 -0
  3. package/dist/components/HoverCard/HoverCard/HoverCard.state.d.ts +5 -0
  4. package/dist/components/HoverCard/HoverCard/HoverCard.style.d.ts +3 -0
  5. package/dist/components/HoverCard/HoverCard/HoverCard.type.d.ts +6 -0
  6. package/dist/components/HoverCard/HoverCard/HoverCard.view.d.ts +10 -0
  7. package/dist/components/HoverCard/HoverCard.d.ts +2 -0
  8. package/dist/components/HoverCard/examples/default.d.ts +2 -0
  9. package/dist/components/HoverCard/examples/index.d.ts +1 -0
  10. package/dist/components/Slider/Slider/Slider.props.d.ts +112 -0
  11. package/dist/components/Slider/Slider/Slider.state.d.ts +14 -0
  12. package/dist/components/Slider/Slider/Slider.style.d.ts +11 -0
  13. package/dist/components/Slider/Slider/Slider.type.d.ts +18 -0
  14. package/dist/components/Slider/Slider/Slider.view.d.ts +3 -0
  15. package/dist/components/Slider/Slider.d.ts +6 -0
  16. package/dist/components/Slider/SliderDemo.d.ts +3 -0
  17. package/dist/components/Slider/examples/controlled.d.ts +2 -0
  18. package/dist/components/Slider/examples/custom.d.ts +2 -0
  19. package/dist/components/Slider/examples/default.d.ts +2 -0
  20. package/dist/components/Slider/examples/disabled.d.ts +2 -0
  21. package/dist/components/Slider/examples/range.d.ts +2 -0
  22. package/dist/components/Slider/examples/shapes.d.ts +2 -0
  23. package/dist/components/Slider/examples/sizes.d.ts +2 -0
  24. package/dist/components/Slider/examples/stepValues.d.ts +3 -0
  25. package/dist/components/Slider/examples/tooltip.d.ts +2 -0
  26. package/dist/components/Slider/examples/variants.d.ts +2 -0
  27. package/dist/components/Slider/examples/vertical.d.ts +2 -0
  28. package/dist/components/Slider/index.d.ts +1 -0
  29. package/dist/components/Table/Table.d.ts +8 -8
  30. package/dist/components/index.d.ts +3 -0
  31. package/dist/pages/hoverCard.page.d.ts +3 -0
  32. package/dist/pages/slider.page.d.ts +3 -0
  33. package/dist/web.cjs.development.js +714 -13
  34. package/dist/web.cjs.development.js.map +1 -1
  35. package/dist/web.cjs.production.min.js +1 -1
  36. package/dist/web.cjs.production.min.js.map +1 -1
  37. package/dist/web.esm.js +713 -14
  38. package/dist/web.esm.js.map +1 -1
  39. package/dist/web.umd.development.js +717 -17
  40. package/dist/web.umd.development.js.map +1 -1
  41. package/dist/web.umd.production.min.js +1 -1
  42. package/dist/web.umd.production.min.js.map +1 -1
  43. package/package.json +1 -1
@@ -18,6 +18,7 @@ require('core-js/modules/es.string.includes.js');
18
18
  require('core-js/modules/es.string.starts-with.js');
19
19
  var format = _interopDefault(require('date-fns/format'));
20
20
  var formik = require('formik');
21
+ require('core-js/modules/es.number.to-fixed.js');
21
22
  require('core-js/modules/web.url.js');
22
23
  require('core-js/modules/web.url.to-json.js');
23
24
  require('core-js/modules/web.url-search-params.js');
@@ -723,7 +724,7 @@ var ThreadsIcon = _ref15 => {
723
724
  d: "M0 0h24v24H0z",
724
725
  fill: "none"
725
726
  }), /*#__PURE__*/React__default.createElement("path", {
726
- 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"
727
+ 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"
727
728
  })));
728
729
  };
729
730
  // Example Refactored Icon: MinusIcon without undefined 'padding' prop
@@ -1409,7 +1410,9 @@ var LockIcon = _ref42 => {
1409
1410
  viewBox: "0 0 24 24",
1410
1411
  "aria-hidden": "false",
1411
1412
  focusable: "false"
1412
- }, getSvgProps(filled, color, strokeWidth)), /*#__PURE__*/React__default.createElement("rect", {
1413
+ }, getSvgProps(filled, color, strokeWidth)), filled ? (/*#__PURE__*/React__default.createElement("path", {
1414
+ 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"
1415
+ })) : (/*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("rect", {
1413
1416
  x: "3",
1414
1417
  y: "11",
1415
1418
  width: "18",
@@ -1418,7 +1421,11 @@ var LockIcon = _ref42 => {
1418
1421
  ry: "2"
1419
1422
  }), /*#__PURE__*/React__default.createElement("path", {
1420
1423
  d: "M7 11V7a5 5 0 0 1 10 0v4"
1421
- })));
1424
+ }), /*#__PURE__*/React__default.createElement("circle", {
1425
+ cx: "12",
1426
+ cy: "16",
1427
+ r: "1.5"
1428
+ })))));
1422
1429
  };
1423
1430
  var MicrophoneIcon = _ref43 => {
1424
1431
  var {
@@ -1688,7 +1695,9 @@ var UnlockIcon = _ref55 => {
1688
1695
  viewBox: "0 0 24 24",
1689
1696
  "aria-hidden": "false",
1690
1697
  focusable: "false"
1691
- }, getSvgProps(filled, color, strokeWidth)), /*#__PURE__*/React__default.createElement("rect", {
1698
+ }, getSvgProps(filled, color, strokeWidth)), filled ? (/*#__PURE__*/React__default.createElement("path", {
1699
+ 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"
1700
+ })) : (/*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("rect", {
1692
1701
  x: "3",
1693
1702
  y: "11",
1694
1703
  width: "18",
@@ -1697,7 +1706,11 @@ var UnlockIcon = _ref55 => {
1697
1706
  ry: "2"
1698
1707
  }), /*#__PURE__*/React__default.createElement("path", {
1699
1708
  d: "M7 11V7a5 5 0 0 1 9.9-1"
1700
- })));
1709
+ }), /*#__PURE__*/React__default.createElement("circle", {
1710
+ cx: "12",
1711
+ cy: "16",
1712
+ r: "1.5"
1713
+ })))));
1701
1714
  };
1702
1715
  var WifiIcon = _ref56 => {
1703
1716
  var {
@@ -3130,6 +3143,7 @@ var ButtonView = _ref => {
3130
3143
  return /*#__PURE__*/React__default.createElement(appStudio.Element, Object.assign({
3131
3144
  gap: 8,
3132
3145
  as: "button",
3146
+ type: "button",
3133
3147
  border: "none",
3134
3148
  color: "color.white",
3135
3149
  display: "flex",
@@ -6990,6 +7004,540 @@ var ComboBoxComponent$1 = _ref => {
6990
7004
  */
6991
7005
  var FormikComboBox = ComboBoxComponent$1;
6992
7006
 
7007
+ // Clamp value between min and max
7008
+ var clamp = (value, min, max) => Math.min(Math.max(value, min), max);
7009
+ // Calculate value based on position, track dimensions, min, max, step
7010
+ var calculateValue = (position, trackRect, min, max, step, orientation, stepValues) => {
7011
+ var range = max - min;
7012
+ var percentage;
7013
+ if (orientation === 'horizontal') {
7014
+ var trackLength = trackRect.width;
7015
+ var relativePosition = position - trackRect.left;
7016
+ percentage = clamp(relativePosition / trackLength, 0, 1);
7017
+ } else {
7018
+ // Vertical: top is max, bottom is min (reversed from the provided code)
7019
+ var _trackLength = trackRect.height;
7020
+ var _relativePosition = trackRect.bottom - position; // Y position relative to track bottom
7021
+ percentage = clamp(_relativePosition / _trackLength, 0, 1);
7022
+ }
7023
+ // If stepValues are provided, find the closest value in the array
7024
+ if (stepValues && stepValues.length > 0) {
7025
+ var rawValue = min + percentage * range;
7026
+ // Find the closest value in stepValues
7027
+ var closestValue = stepValues[0];
7028
+ var minDistance = Math.abs(rawValue - closestValue);
7029
+ for (var i = 1; i < stepValues.length; i++) {
7030
+ var distance = Math.abs(rawValue - stepValues[i]);
7031
+ if (distance < minDistance) {
7032
+ minDistance = distance;
7033
+ closestValue = stepValues[i];
7034
+ }
7035
+ }
7036
+ return closestValue;
7037
+ } else {
7038
+ // Use regular step logic
7039
+ var _rawValue = min + percentage * range;
7040
+ var steppedValue = Math.round(_rawValue / step) * step;
7041
+ // Final clamp to ensure step rounding doesn't exceed bounds
7042
+ return clamp(steppedValue, min, max);
7043
+ }
7044
+ };
7045
+ var useSliderState = _ref => {
7046
+ var _ref2;
7047
+ var {
7048
+ min = 0,
7049
+ max = 100,
7050
+ step = 1,
7051
+ value: controlledValue = 0,
7052
+ defaultValue,
7053
+ onChange,
7054
+ onDrag,
7055
+ orientation = 'horizontal',
7056
+ isDisabled = false,
7057
+ stepValues
7058
+ } = _ref;
7059
+ var initialValue = clamp((_ref2 = controlledValue != null ? controlledValue : defaultValue) != null ? _ref2 : min, min, max);
7060
+ var [internalValue, setInternalValue] = React.useState(initialValue);
7061
+ var [isDragging, setIsDragging] = React.useState(false);
7062
+ var [isHovered, setIsHovered] = React.useState(false);
7063
+ var trackRef = React.useRef(null);
7064
+ var thumbRef = React.useRef(null);
7065
+ var isControlled = controlledValue !== undefined;
7066
+ var currentValue = isControlled ? controlledValue : internalValue;
7067
+ // Update internal state if controlled value changes
7068
+ React.useEffect(() => {
7069
+ if (isControlled) {
7070
+ setInternalValue(clamp(controlledValue, min, max));
7071
+ }
7072
+ }, [controlledValue, isControlled, min, max]);
7073
+ var updateValue = React.useCallback(newValue => {
7074
+ var clampedValue = clamp(newValue, min, max);
7075
+ if (!isControlled) {
7076
+ setInternalValue(clampedValue);
7077
+ }
7078
+ if (onChange && clampedValue !== currentValue) {
7079
+ onChange(clampedValue);
7080
+ }
7081
+ if (isDragging && onDrag) {
7082
+ onDrag(clampedValue);
7083
+ }
7084
+ }, [isControlled, min, max, onChange, currentValue, isDragging, onDrag]);
7085
+ var handleInteraction = React.useCallback(event => {
7086
+ if (isDisabled || !trackRef.current) return;
7087
+ var trackRect = trackRef.current.getBoundingClientRect();
7088
+ var position;
7089
+ if ('touches' in event) {
7090
+ position = orientation === 'horizontal' ? event.touches[0].clientX : event.touches[0].clientY;
7091
+ } else {
7092
+ position = orientation === 'horizontal' ? event.clientX : event.clientY;
7093
+ }
7094
+ var newValue = calculateValue(position, trackRect, min, max, step, orientation, stepValues);
7095
+ updateValue(newValue);
7096
+ }, [min, max, step, orientation, updateValue, isDisabled, stepValues]);
7097
+ var handleMouseDown = React.useCallback(event => {
7098
+ if (isDisabled) return;
7099
+ event.preventDefault(); // Prevent text selection during drag
7100
+ setIsDragging(true);
7101
+ handleInteraction(event); // Update value immediately on click/touch
7102
+ var handleMouseMove = moveEvent => {
7103
+ handleInteraction(moveEvent);
7104
+ };
7105
+ var handleMouseUp = () => {
7106
+ setIsDragging(false);
7107
+ document.removeEventListener('mousemove', handleMouseMove);
7108
+ document.removeEventListener('mouseup', handleMouseUp);
7109
+ document.removeEventListener('touchmove', handleMouseMove);
7110
+ document.removeEventListener('touchend', handleMouseUp);
7111
+ };
7112
+ document.addEventListener('mousemove', handleMouseMove);
7113
+ document.addEventListener('mouseup', handleMouseUp);
7114
+ document.addEventListener('touchmove', handleMouseMove);
7115
+ document.addEventListener('touchend', handleMouseUp);
7116
+ }, [handleInteraction, isDisabled]);
7117
+ // Allow clicking directly on the track
7118
+ var handleTrackMouseDown = React.useCallback(event => {
7119
+ // Prevent triggering if click is on the thumb itself
7120
+ if (thumbRef.current && thumbRef.current.contains(event.target)) {
7121
+ return;
7122
+ }
7123
+ handleMouseDown(event);
7124
+ }, [handleMouseDown]);
7125
+ var handleKeyDown = React.useCallback(event => {
7126
+ if (isDisabled) return;
7127
+ var newValue = currentValue;
7128
+ switch (event.key) {
7129
+ case 'ArrowLeft':
7130
+ case 'ArrowDown':
7131
+ newValue = currentValue - step;
7132
+ break;
7133
+ case 'ArrowRight':
7134
+ case 'ArrowUp':
7135
+ newValue = currentValue + step;
7136
+ break;
7137
+ case 'Home':
7138
+ newValue = min;
7139
+ break;
7140
+ case 'End':
7141
+ newValue = max;
7142
+ break;
7143
+ default:
7144
+ return;
7145
+ // Exit if key is not handled
7146
+ }
7147
+ event.preventDefault(); // Prevent page scroll
7148
+ updateValue(newValue);
7149
+ }, [currentValue, min, max, step, updateValue, isDisabled]);
7150
+ var range = max - min;
7151
+ var thumbPositionPercent = range === 0 ? 0 : (currentValue - min) / range * 100;
7152
+ return {
7153
+ currentValue,
7154
+ isDragging,
7155
+ isHovered,
7156
+ setIsHovered,
7157
+ trackRef,
7158
+ thumbRef,
7159
+ handleThumbMouseDown: handleMouseDown,
7160
+ handleTrackMouseDown,
7161
+ handleKeyDown,
7162
+ thumbPositionPercent
7163
+ };
7164
+ };
7165
+
7166
+ var SliderSizes$1 = {
7167
+ xs: {
7168
+ height: 4,
7169
+ width: '100%'
7170
+ },
7171
+ sm: {
7172
+ height: 6,
7173
+ width: '100%'
7174
+ },
7175
+ md: {
7176
+ height: 8,
7177
+ width: '100%'
7178
+ },
7179
+ lg: {
7180
+ height: 10,
7181
+ width: '100%'
7182
+ },
7183
+ xl: {
7184
+ height: 12,
7185
+ width: '100%'
7186
+ }
7187
+ };
7188
+ var ThumbSizes = {
7189
+ xs: {
7190
+ width: 12,
7191
+ height: 12
7192
+ },
7193
+ sm: {
7194
+ width: 16,
7195
+ height: 16
7196
+ },
7197
+ md: {
7198
+ width: 20,
7199
+ height: 20
7200
+ },
7201
+ lg: {
7202
+ width: 24,
7203
+ height: 24
7204
+ },
7205
+ xl: {
7206
+ width: 28,
7207
+ height: 28
7208
+ }
7209
+ };
7210
+ var SliderShapes = {
7211
+ sharp: 0,
7212
+ rounded: 4,
7213
+ pillShaped: 24
7214
+ };
7215
+ var SliderVariants = {
7216
+ default: {
7217
+ backgroundColor: 'color.blueGray.200'
7218
+ },
7219
+ outline: {
7220
+ backgroundColor: 'transparent',
7221
+ borderWidth: 1,
7222
+ borderStyle: 'solid',
7223
+ borderColor: 'color.blueGray.300'
7224
+ }
7225
+ };
7226
+ // Maps Size enum to track height/width and thumb size for the new implementation
7227
+ var EnhancedSliderSizes = {
7228
+ xs: {
7229
+ trackCrossAxisSize: 4,
7230
+ thumbSize: 12
7231
+ },
7232
+ sm: {
7233
+ trackCrossAxisSize: 6,
7234
+ thumbSize: 16
7235
+ },
7236
+ md: {
7237
+ trackCrossAxisSize: 8,
7238
+ thumbSize: 20
7239
+ },
7240
+ lg: {
7241
+ trackCrossAxisSize: 10,
7242
+ thumbSize: 24
7243
+ },
7244
+ xl: {
7245
+ trackCrossAxisSize: 12,
7246
+ thumbSize: 28
7247
+ }
7248
+ };
7249
+ // Basic styles for horizontal and vertical orientation
7250
+ var OrientationStyles = {
7251
+ horizontal: {
7252
+ width: '100%',
7253
+ minWidth: '120px',
7254
+ height: 'auto',
7255
+ flexDirection: 'row',
7256
+ paddingVertical: 8
7257
+ },
7258
+ vertical: {
7259
+ height: '100%',
7260
+ minHeight: '120px',
7261
+ width: 'auto',
7262
+ flexDirection: 'column-reverse',
7263
+ paddingHorizontal: 8
7264
+ }
7265
+ };
7266
+
7267
+ 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"];
7268
+ var SliderView = _ref => {
7269
+ var _views$tooltip, _views$tooltip2;
7270
+ var {
7271
+ min = 0,
7272
+ max = 100,
7273
+ step = 1,
7274
+ currentValue,
7275
+ stepValues,
7276
+ shape = 'rounded',
7277
+ size = 'md',
7278
+ variant = 'default',
7279
+ orientation = 'horizontal',
7280
+ isDisabled = false,
7281
+ showValue = false,
7282
+ showTooltip = false,
7283
+ colorScheme = 'theme.primary',
7284
+ label,
7285
+ helperText,
7286
+ themeMode: elementMode,
7287
+ shadow = {},
7288
+ isDragging,
7289
+ isHovered,
7290
+ setIsHovered,
7291
+ trackRef,
7292
+ thumbRef,
7293
+ handleThumbMouseDown,
7294
+ handleTrackMouseDown,
7295
+ handleKeyDown,
7296
+ thumbPositionPercent,
7297
+ ariaLabel = 'Slider',
7298
+ views = {
7299
+ container: {},
7300
+ track: {},
7301
+ progress: {},
7302
+ filledTrack: {},
7303
+ thumb: {},
7304
+ label: {},
7305
+ valueLabel: {},
7306
+ stepMarks: {},
7307
+ tooltip: {}
7308
+ }
7309
+ } = _ref,
7310
+ props = _objectWithoutPropertiesLoose(_ref, _excluded$y);
7311
+ var {
7312
+ getColor,
7313
+ themeMode
7314
+ } = appStudio.useTheme();
7315
+ var themeColor = getColor(colorScheme, elementMode || themeMode);
7316
+ var disabledColor = getColor('theme.disabled', elementMode || themeMode);
7317
+ var trackColor = getColor(SliderVariants[variant].backgroundColor, elementMode || themeMode);
7318
+ var isVertical = orientation === 'vertical';
7319
+ var {
7320
+ trackCrossAxisSize,
7321
+ thumbSize
7322
+ } = EnhancedSliderSizes[size] || {
7323
+ trackCrossAxisSize: SliderSizes$1[size].height,
7324
+ thumbSize: ThumbSizes[size].width || 16
7325
+ };
7326
+ // For backward compatibility with the old implementation
7327
+ var legacyView = /*#__PURE__*/React__default.createElement(Vertical, Object.assign({
7328
+ width: "100%",
7329
+ gap: 8
7330
+ }, views.container, props), label && (/*#__PURE__*/React__default.createElement(Horizontal, {
7331
+ justifyContent: "space-between",
7332
+ alignItems: "center"
7333
+ }, /*#__PURE__*/React__default.createElement(appStudio.Text, Object.assign({
7334
+ fontSize: 14,
7335
+ fontWeight: 500
7336
+ }, views.label), label), showValue && (/*#__PURE__*/React__default.createElement(appStudio.Text, Object.assign({
7337
+ fontSize: 14,
7338
+ color: "color.blueGray.500"
7339
+ }, views.valueLabel), currentValue)))), /*#__PURE__*/React__default.createElement(appStudio.View, Object.assign({
7340
+ ref: trackRef,
7341
+ position: "relative",
7342
+ cursor: isDisabled ? 'not-allowed' : 'pointer',
7343
+ opacity: isDisabled ? 0.6 : 1,
7344
+ onMouseDown: handleTrackMouseDown,
7345
+ onMouseEnter: () => setIsHovered(true),
7346
+ onMouseLeave: () => setIsHovered(false)
7347
+ }, SliderSizes$1[size], {
7348
+ borderRadius: SliderShapes[shape],
7349
+ backgroundColor: trackColor
7350
+ }, SliderVariants[variant], shadow, views.track), stepValues && stepValues.length > 0 && (/*#__PURE__*/React__default.createElement(React__default.Fragment, null, stepValues.map(stepValue => {
7351
+ var stepPercentage = (stepValue - min) / (max - min) * 100;
7352
+ return /*#__PURE__*/React__default.createElement(appStudio.View, Object.assign({
7353
+ key: stepValue,
7354
+ position: "absolute",
7355
+ top: "50%",
7356
+ left: stepPercentage + "%",
7357
+ transform: "translate(-50%, -50%)",
7358
+ width: 4,
7359
+ height: 4,
7360
+ borderRadius: "50%",
7361
+ backgroundColor: isDisabled ? disabledColor : themeColor,
7362
+ zIndex: 1
7363
+ }, views.stepMarks));
7364
+ }))), /*#__PURE__*/React__default.createElement(appStudio.View, Object.assign({
7365
+ position: "absolute",
7366
+ top: 0,
7367
+ left: 0,
7368
+ height: "100%",
7369
+ width: thumbPositionPercent + "%",
7370
+ backgroundColor: isDisabled ? disabledColor : themeColor,
7371
+ borderRadius: SliderShapes[shape],
7372
+ transition: "width 0.1s ease-in-out"
7373
+ }, views.progress, views.filledTrack)), /*#__PURE__*/React__default.createElement(appStudio.View, Object.assign({
7374
+ ref: thumbRef,
7375
+ role: "slider",
7376
+ tabIndex: isDisabled ? -1 : 0,
7377
+ "aria-valuemin": min,
7378
+ "aria-valuemax": max,
7379
+ "aria-valuenow": currentValue,
7380
+ "aria-orientation": orientation,
7381
+ "aria-disabled": isDisabled,
7382
+ "aria-label": ariaLabel,
7383
+ position: "absolute",
7384
+ top: "50%",
7385
+ left: thumbPositionPercent + "%",
7386
+ borderRadius: "50%",
7387
+ backgroundColor: "white",
7388
+ boxShadow: "0 2px 4px rgba(0, 0, 0, 0.2)",
7389
+ border: "2px solid " + (isDisabled ? disabledColor : themeColor),
7390
+ transition: isDragging ? 'none' : 'transform 0.1s ease-in-out',
7391
+ transform: isHovered ? 'translate(-50%, -50%) scale(1.1)' : 'translate(-50%, -50%)',
7392
+ zIndex: 2,
7393
+ onMouseDown: handleThumbMouseDown,
7394
+ onTouchStart: handleThumbMouseDown,
7395
+ onKeyDown: handleKeyDown
7396
+ }, ThumbSizes[size], views.thumb), showTooltip && (isHovered || isDragging) && (/*#__PURE__*/React__default.createElement(appStudio.View, Object.assign({
7397
+ position: "absolute",
7398
+ bottom: "100%",
7399
+ left: "50%",
7400
+ transform: "translateX(-50%)",
7401
+ marginBottom: 8,
7402
+ padding: "4px 8px",
7403
+ backgroundColor: "color.black",
7404
+ color: "color.white",
7405
+ borderRadius: 4,
7406
+ fontSize: 12,
7407
+ whiteSpace: "nowrap",
7408
+ zIndex: 3
7409
+ }, 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));
7410
+ // Enhanced view with vertical support and other features
7411
+ var enhancedView = /*#__PURE__*/React__default.createElement(Center
7412
+ // Use Center to easily manage orientation layout
7413
+ , Object.assign({}, OrientationStyles[orientation], {
7414
+ position: "relative" // Needed for absolute positioning of thumb/tooltip
7415
+ ,
7416
+ onMouseEnter: () => !isDisabled && setIsHovered(true),
7417
+ onMouseLeave: () => !isDisabled && setIsHovered(false)
7418
+ }, props, views == null ? void 0 : views.container), label && (/*#__PURE__*/React__default.createElement(Horizontal, {
7419
+ justifyContent: "space-between",
7420
+ alignItems: "center",
7421
+ marginBottom: 8,
7422
+ width: "100%"
7423
+ }, /*#__PURE__*/React__default.createElement(appStudio.Text, Object.assign({
7424
+ fontSize: 14,
7425
+ fontWeight: 500
7426
+ }, views.label), label), showValue && (/*#__PURE__*/React__default.createElement(appStudio.Text, Object.assign({
7427
+ fontSize: 14,
7428
+ color: "color.blueGray.500"
7429
+ }, views.valueLabel), currentValue)))), /*#__PURE__*/React__default.createElement(appStudio.View, Object.assign({
7430
+ ref: trackRef,
7431
+ position: "relative",
7432
+ borderRadius: trackCrossAxisSize / 2,
7433
+ backgroundColor: isDisabled ? disabledColor : trackColor,
7434
+ cursor: isDisabled ? 'not-allowed' : 'pointer',
7435
+ width: isVertical ? trackCrossAxisSize + "px" : '100%',
7436
+ height: isVertical ? '100%' : trackCrossAxisSize + "px",
7437
+ onMouseDown: handleTrackMouseDown,
7438
+ onTouchStart: handleTrackMouseDown
7439
+ }, views == null ? void 0 : views.track), stepValues && stepValues.length > 0 && (/*#__PURE__*/React__default.createElement(React__default.Fragment, null, stepValues.map(stepValue => {
7440
+ var stepPercentage = (stepValue - min) / (max - min) * 100;
7441
+ return /*#__PURE__*/React__default.createElement(appStudio.View, Object.assign({
7442
+ key: stepValue,
7443
+ position: "absolute",
7444
+ width: 4,
7445
+ height: 4,
7446
+ borderRadius: "50%",
7447
+ backgroundColor: isDisabled ? disabledColor : themeColor,
7448
+ zIndex: 1
7449
+ }, isVertical ? {
7450
+ bottom: stepPercentage + "%",
7451
+ left: '50%',
7452
+ transform: 'translate(-50%, 50%)'
7453
+ } : {
7454
+ left: stepPercentage + "%",
7455
+ top: '50%',
7456
+ transform: 'translate(-50%, -50%)'
7457
+ }, views.stepMarks));
7458
+ }))), /*#__PURE__*/React__default.createElement(appStudio.View, Object.assign({
7459
+ position: "absolute",
7460
+ borderRadius: trackCrossAxisSize / 2,
7461
+ backgroundColor: isDisabled ? disabledColor : themeColor
7462
+ }, isVertical ? {
7463
+ bottom: 0,
7464
+ left: 0,
7465
+ width: '100%',
7466
+ height: thumbPositionPercent + "%"
7467
+ } : {
7468
+ top: 0,
7469
+ left: 0,
7470
+ height: '100%',
7471
+ width: thumbPositionPercent + "%"
7472
+ }, views == null ? void 0 : views.filledTrack, views == null ? void 0 : views.progress)), /*#__PURE__*/React__default.createElement(appStudio.View, Object.assign({
7473
+ ref: thumbRef,
7474
+ role: "slider",
7475
+ tabIndex: isDisabled ? -1 : 0,
7476
+ "aria-valuemin": min,
7477
+ "aria-valuemax": max,
7478
+ "aria-valuenow": currentValue,
7479
+ "aria-orientation": orientation,
7480
+ "aria-disabled": isDisabled,
7481
+ "aria-label": ariaLabel,
7482
+ position: "absolute",
7483
+ width: thumbSize + "px",
7484
+ height: thumbSize + "px",
7485
+ borderRadius: "50%",
7486
+ backgroundColor: isDisabled ? disabledColor : themeColor,
7487
+ border: "2px solid " + getColor('color.white'),
7488
+ boxShadow: "0 1px 3px rgba(0, 0, 0, 0.2)",
7489
+ cursor: isDisabled ? 'not-allowed' : 'grab',
7490
+ transform: isVertical ? 'translateX(-50%)' : 'translateY(-50%)',
7491
+ zIndex: 2,
7492
+ transition: isDragging ? 'none' : 'left 0.1s, bottom 0.1s'
7493
+ }, isVertical ? {
7494
+ left: '50%',
7495
+ bottom: thumbPositionPercent + "%"
7496
+ } : {
7497
+ top: '50%',
7498
+ left: thumbPositionPercent + "%"
7499
+ }, {
7500
+ onMouseDown: handleThumbMouseDown,
7501
+ onTouchStart: handleThumbMouseDown,
7502
+ onKeyDown: handleKeyDown
7503
+ }, views == null ? void 0 : views.thumb), showTooltip && (isHovered || isDragging) && (/*#__PURE__*/React__default.createElement(appStudio.View, Object.assign({
7504
+ position: "absolute",
7505
+ padding: "4px 8px",
7506
+ backgroundColor: getColor('color.black'),
7507
+ color: getColor('color.white'),
7508
+ borderRadius: "4px",
7509
+ fontSize: "12px",
7510
+ whiteSpace: "nowrap",
7511
+ zIndex: 3
7512
+ }, isVertical ? {
7513
+ left: '100%',
7514
+ marginLeft: '8px',
7515
+ bottom: '0',
7516
+ transform: 'translateY(50%)'
7517
+ } : {
7518
+ bottom: '100%',
7519
+ left: '50%',
7520
+ marginBottom: '8px',
7521
+ transform: 'translateX(-50%)'
7522
+ }, 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, {
7523
+ marginTop: 8
7524
+ }, helperText));
7525
+ // Use the enhanced view if orientation is vertical or showTooltip is true
7526
+ // Otherwise use the legacy view for backward compatibility
7527
+ return isVertical || showTooltip ? enhancedView : legacyView;
7528
+ };
7529
+
7530
+ var SliderComponent = props => {
7531
+ // Get state and handlers from the custom hook
7532
+ var sliderState = useSliderState(props);
7533
+ // Render the view component, passing down props and state
7534
+ return /*#__PURE__*/React__default.createElement(SliderView, Object.assign({}, props, sliderState));
7535
+ };
7536
+ /**
7537
+ * Slider allows users to select a value from a range by moving a handle.
7538
+ */
7539
+ var Slider = SliderComponent;
7540
+
6993
7541
  // Create your store with the initial state and actions.
6994
7542
  var useMessageStore = /*#__PURE__*/zustand.create(set => ({
6995
7543
  // initial state
@@ -7522,7 +8070,7 @@ var UploadView = _ref => {
7522
8070
  }, views == null ? void 0 : views.view)));
7523
8071
  };
7524
8072
 
7525
- var _excluded$y = ["accept", "icon", "text", "maxSize", "onFileSelect", "validateFile", "isLoading", "progress"];
8073
+ var _excluded$z = ["accept", "icon", "text", "maxSize", "onFileSelect", "validateFile", "isLoading", "progress"];
7526
8074
  var Uploader = _ref => {
7527
8075
  var {
7528
8076
  accept = '*/*',
@@ -7534,7 +8082,7 @@ var Uploader = _ref => {
7534
8082
  isLoading = false,
7535
8083
  progress = 0
7536
8084
  } = _ref,
7537
- props = _objectWithoutPropertiesLoose(_ref, _excluded$y);
8085
+ props = _objectWithoutPropertiesLoose(_ref, _excluded$z);
7538
8086
  var {
7539
8087
  previewUrl,
7540
8088
  thumbnailUrl,
@@ -7671,7 +8219,7 @@ var HeaderIconSizes = {
7671
8219
  xl: 28
7672
8220
  };
7673
8221
 
7674
- var _excluded$z = ["children", "blur", "isOpen", "isClosePrevented", "onClose", "position", "views"],
8222
+ var _excluded$A = ["children", "blur", "isOpen", "isClosePrevented", "onClose", "position", "views"],
7675
8223
  _excluded2$7 = ["children", "shadow", "isFullScreen", "shape", "views"],
7676
8224
  _excluded3$4 = ["children", "buttonColor", "iconSize", "buttonPosition", "views"],
7677
8225
  _excluded4$3 = ["children", "views"],
@@ -7686,7 +8234,7 @@ var ModalOverlay = _ref => {
7686
8234
  position = 'center',
7687
8235
  views
7688
8236
  } = _ref,
7689
- props = _objectWithoutPropertiesLoose(_ref, _excluded$z);
8237
+ props = _objectWithoutPropertiesLoose(_ref, _excluded$A);
7690
8238
  var handleClick = () => {
7691
8239
  if (!isClosePrevented) onClose();
7692
8240
  };
@@ -8165,7 +8713,7 @@ var useToggleState = defaultToggled => {
8165
8713
  };
8166
8714
  };
8167
8715
 
8168
- var _excluded$A = ["children", "shape", "variant", "isHovered", "setIsHovered", "isDisabled", "isToggle", "setIsToggled", "onToggle", "views"];
8716
+ var _excluded$B = ["children", "shape", "variant", "isHovered", "setIsHovered", "isDisabled", "isToggle", "setIsToggled", "onToggle", "views"];
8169
8717
  var ToggleView = _ref => {
8170
8718
  var {
8171
8719
  children,
@@ -8179,7 +8727,7 @@ var ToggleView = _ref => {
8179
8727
  onToggle,
8180
8728
  views
8181
8729
  } = _ref,
8182
- props = _objectWithoutPropertiesLoose(_ref, _excluded$A);
8730
+ props = _objectWithoutPropertiesLoose(_ref, _excluded$B);
8183
8731
  var toggleColor = !isDisabled ? 'color.trueGray.400' : 'theme.disabled';
8184
8732
  var isActive = !!(isToggle || isHovered);
8185
8733
  var toggleVariants = {
@@ -8222,7 +8770,7 @@ var ToggleView = _ref => {
8222
8770
  }, toggleVariants[variant], props, views == null ? void 0 : views.container), children);
8223
8771
  };
8224
8772
 
8225
- var _excluded$B = ["children", "shape", "variant", "isDisabled", "isToggled", "onToggle"];
8773
+ var _excluded$C = ["children", "shape", "variant", "isDisabled", "isToggled", "onToggle"];
8226
8774
  // Destructuring properties from ToggleProps to be used within the ToggleComponent.
8227
8775
  var ToggleComponent = _ref => {
8228
8776
  var {
@@ -8234,7 +8782,7 @@ var ToggleComponent = _ref => {
8234
8782
  isToggled = false,
8235
8783
  onToggle
8236
8784
  } = _ref,
8237
- props = _objectWithoutPropertiesLoose(_ref, _excluded$B);
8785
+ props = _objectWithoutPropertiesLoose(_ref, _excluded$C);
8238
8786
  // Initializing toggle state and set state functions using the custom hook useToggleState.
8239
8787
  var {
8240
8788
  isHovered,
@@ -8474,6 +9022,157 @@ var DragAndDropComponent = props => {
8474
9022
  };
8475
9023
  var DragAndDrop = DragAndDropComponent;
8476
9024
 
9025
+ var useHoverCardState = () => {
9026
+ var [isOpen, setIsOpen] = React.useState(false);
9027
+ return {
9028
+ isOpen,
9029
+ setIsOpen
9030
+ };
9031
+ };
9032
+
9033
+ var ContentPositions = {
9034
+ top: align => Object.assign({
9035
+ position: 'absolute',
9036
+ bottom: '100%',
9037
+ marginBottom: '8px'
9038
+ }, align === 'start' && {
9039
+ left: 0
9040
+ }, align === 'center' && {
9041
+ left: '50%',
9042
+ transform: 'translateX(-50%)'
9043
+ }, align === 'end' && {
9044
+ right: 0
9045
+ }),
9046
+ right: align => Object.assign({
9047
+ position: 'absolute',
9048
+ left: '100%',
9049
+ marginLeft: '8px'
9050
+ }, align === 'start' && {
9051
+ top: 0
9052
+ }, align === 'center' && {
9053
+ top: '50%',
9054
+ transform: 'translateY(-50%)'
9055
+ }, align === 'end' && {
9056
+ bottom: 0
9057
+ }),
9058
+ bottom: align => Object.assign({
9059
+ position: 'absolute',
9060
+ top: '100%',
9061
+ marginTop: '8px'
9062
+ }, align === 'start' && {
9063
+ left: 0
9064
+ }, align === 'center' && {
9065
+ left: '50%',
9066
+ transform: 'translateX(-50%)'
9067
+ }, align === 'end' && {
9068
+ right: 0
9069
+ }),
9070
+ left: align => Object.assign({
9071
+ position: 'absolute',
9072
+ right: '100%',
9073
+ marginRight: '8px'
9074
+ }, align === 'start' && {
9075
+ top: 0
9076
+ }, align === 'center' && {
9077
+ top: '50%',
9078
+ transform: 'translateY(-50%)'
9079
+ }, align === 'end' && {
9080
+ bottom: 0
9081
+ })
9082
+ };
9083
+
9084
+ var _excluded$D = ["children", "views"],
9085
+ _excluded2$8 = ["children", "views", "side", "align"];
9086
+ // Create context for the HoverCard
9087
+ var HoverCardContext = /*#__PURE__*/React.createContext({
9088
+ isOpen: false,
9089
+ setIsOpen: () => {}
9090
+ });
9091
+ var HoverCardProvider = _ref => {
9092
+ var {
9093
+ children,
9094
+ value
9095
+ } = _ref;
9096
+ return /*#__PURE__*/React__default.createElement(HoverCardContext.Provider, {
9097
+ value: value
9098
+ }, children);
9099
+ };
9100
+ var useHoverCardContext = () => {
9101
+ var context = React.useContext(HoverCardContext);
9102
+ if (!context) {
9103
+ throw new Error('useHoverCardContext must be used within a HoverCardProvider');
9104
+ }
9105
+ return context;
9106
+ };
9107
+ var HoverCardTrigger = _ref2 => {
9108
+ var {
9109
+ children,
9110
+ views
9111
+ } = _ref2,
9112
+ props = _objectWithoutPropertiesLoose(_ref2, _excluded$D);
9113
+ var {
9114
+ setIsOpen
9115
+ } = useHoverCardContext();
9116
+ return /*#__PURE__*/React__default.createElement(appStudio.View, Object.assign({
9117
+ position: "relative",
9118
+ display: "inline-block",
9119
+ onMouseEnter: () => setIsOpen(true),
9120
+ onMouseLeave: () => setIsOpen(false)
9121
+ }, views == null ? void 0 : views.container, props), children);
9122
+ };
9123
+ var HoverCardContent = _ref3 => {
9124
+ var {
9125
+ children,
9126
+ views,
9127
+ side = 'bottom',
9128
+ align = 'center'
9129
+ } = _ref3,
9130
+ props = _objectWithoutPropertiesLoose(_ref3, _excluded2$8);
9131
+ var {
9132
+ isOpen
9133
+ } = useHoverCardContext();
9134
+ if (!isOpen) {
9135
+ return null;
9136
+ }
9137
+ return /*#__PURE__*/React__default.createElement(appStudio.View, Object.assign({
9138
+ backgroundColor: "white",
9139
+ borderRadius: "4px",
9140
+ boxShadow: "0px 2px 8px rgba(0, 0, 0, 0.15)",
9141
+ padding: "12px",
9142
+ minWidth: "200px",
9143
+ maxWidth: "300px",
9144
+ zIndex: 1000
9145
+ }, ContentPositions[side](align), views == null ? void 0 : views.container, props), children);
9146
+ };
9147
+
9148
+ var _excluded$E = ["children", "views"];
9149
+ /**
9150
+ * HoverCard component displays floating content when hovering over a trigger element.
9151
+ */
9152
+ var HoverCardComponent = _ref => {
9153
+ var {
9154
+ children,
9155
+ views
9156
+ } = _ref,
9157
+ props = _objectWithoutPropertiesLoose(_ref, _excluded$E);
9158
+ var {
9159
+ isOpen,
9160
+ setIsOpen
9161
+ } = useHoverCardState();
9162
+ return /*#__PURE__*/React__default.createElement(HoverCardProvider, {
9163
+ value: {
9164
+ isOpen,
9165
+ setIsOpen
9166
+ }
9167
+ }, /*#__PURE__*/React__default.createElement(appStudio.View, Object.assign({
9168
+ position: "relative",
9169
+ display: "inline-block"
9170
+ }, views == null ? void 0 : views.container, props), children));
9171
+ };
9172
+ var HoverCard = HoverCardComponent;
9173
+ HoverCard.Trigger = HoverCardTrigger;
9174
+ HoverCard.Content = HoverCardContent;
9175
+
8477
9176
  exports.Alert = Alert;
8478
9177
  exports.ArrowIcon = ArrowIcon;
8479
9178
  exports.AspectRatio = AspectRatio;
@@ -8527,6 +9226,7 @@ exports.HeartIcon = HeartIcon;
8527
9226
  exports.HomeIcon = HomeIcon;
8528
9227
  exports.Horizontal = Horizontal;
8529
9228
  exports.HorizontalBase = HorizontalBase;
9229
+ exports.HoverCard = HoverCard;
8530
9230
  exports.Icon = Icon;
8531
9231
  exports.ImageIcon = ImageIcon;
8532
9232
  exports.InfoIcon = InfoIcon;
@@ -8565,6 +9265,7 @@ exports.Select = Select;
8565
9265
  exports.SettingsIcon = SettingsIcon;
8566
9266
  exports.ShapeIcon = ShapeIcon;
8567
9267
  exports.ShareIcon = ShareIcon;
9268
+ exports.Slider = Slider;
8568
9269
  exports.SliderIcon = SliderIcon;
8569
9270
  exports.SliderVerticalIcon = SliderVerticalIcon;
8570
9271
  exports.SpinnerIcon = SpinnerIcon;