@app-studio/web 0.9.33 → 0.9.35
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/Accordion/Accordion/Accordion.style.d.ts +8 -0
- package/dist/components/Calendar/Calendar/Calendar.props.d.ts +57 -53
- package/dist/components/Calendar/Calendar/Calendar.style.d.ts +107 -0
- package/dist/components/Calendar/Calendar/Calendar.utils.d.ts +89 -8
- package/dist/components/Calendar/Calendar/Calendar.view.d.ts +2 -19
- package/dist/components/Calendar/Calendar.d.ts +1 -3
- package/dist/components/Chart/Chart/BarChart.d.ts +1 -1
- package/dist/components/Chart/Chart/Chart.state.d.ts +3 -3
- package/dist/components/Chart/Chart/ChartTooltip.d.ts +14 -0
- package/dist/components/Chart/Chart/LineChart.d.ts +1 -1
- package/dist/components/Chart/Chart/PieChart.d.ts +1 -1
- package/dist/components/ChatInput/ChatInput/ChatInput.style.d.ts +31 -0
- package/dist/components/Form/Checkbox/Checkbox/Checkbox.style.d.ts +20 -4
- package/dist/components/Form/Select/Select/Select.style.d.ts +4 -0
- package/dist/components/Form/Switch/Switch/Switch.style.d.ts +25 -5
- package/dist/components/Input/Input.style.d.ts +16 -0
- package/dist/components/KanbanBoard/KanbanBoard/KanbanBoard.props.d.ts +1 -0
- package/dist/components/KanbanBoard/KanbanBoard/KanbanBoard.state.d.ts +3 -2
- package/dist/components/Link/Link/Link.style.d.ts +5 -0
- package/dist/components/Modal/Modal/Modal.style.d.ts +9 -0
- package/dist/components/NavigationMenu/NavigationMenu/NavigationMenu.state.d.ts +1 -0
- package/dist/components/NavigationMenu/NavigationMenu/NavigationMenu.type.d.ts +1 -0
- package/dist/components/Separator/Separator/Separator.style.d.ts +7 -0
- package/dist/components/Slider/Slider/Slider.style.d.ts +12 -0
- package/dist/components/Table/Table/Table.style.d.ts +1 -0
- package/dist/components/Text/Text/Text.props.d.ts +4 -0
- package/dist/components/Text/Text/Text.style.d.ts +1 -0
- package/dist/components/Toast/Toast/Toast.style.d.ts +5 -0
- package/dist/web.cjs.development.js +2497 -1096
- 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 +2500 -1099
- package/dist/web.esm.js.map +1 -1
- package/dist/web.umd.development.js +2498 -1094
- 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/docs/components/Calendar.mdx +22 -110
- package/docs/components/KanbanBoard.mdx +156 -0
- package/package.json +1 -1
|
@@ -18,8 +18,9 @@ require('core-js/modules/es.parse-float.js');
|
|
|
18
18
|
require('core-js/modules/es.string.trim-end.js');
|
|
19
19
|
require('core-js/modules/es.parse-int.js');
|
|
20
20
|
require('core-js/modules/es.regexp.exec.js');
|
|
21
|
-
require('core-js/modules/es.string.pad-start.js');
|
|
22
21
|
require('core-js/modules/es.string.replace.js');
|
|
22
|
+
require('core-js/modules/es.string.starts-with.js');
|
|
23
|
+
require('core-js/modules/es.string.trim.js');
|
|
23
24
|
require('core-js/modules/es.array-buffer.constructor.js');
|
|
24
25
|
require('core-js/modules/es.array-buffer.slice.js');
|
|
25
26
|
require('core-js/modules/es.typed-array.uint8-array.js');
|
|
@@ -27,7 +28,6 @@ require('core-js/modules/es.typed-array.fill.js');
|
|
|
27
28
|
require('core-js/modules/es.typed-array.set.js');
|
|
28
29
|
require('core-js/modules/es.typed-array.sort.js');
|
|
29
30
|
require('core-js/modules/es.typed-array.to-locale-string.js');
|
|
30
|
-
require('core-js/modules/es.string.starts-with.js');
|
|
31
31
|
require('core-js/modules/web.url.js');
|
|
32
32
|
require('core-js/modules/web.url.to-json.js');
|
|
33
33
|
require('core-js/modules/web.url-search-params.js');
|
|
@@ -38,12 +38,9 @@ var contrast = _interopDefault(require('contrast'));
|
|
|
38
38
|
require('core-js/modules/es.promise.js');
|
|
39
39
|
require('core-js/modules/es.array.reduce.js');
|
|
40
40
|
require('core-js/modules/es.number.to-fixed.js');
|
|
41
|
-
require('core-js/modules/es.array.flat.js');
|
|
42
|
-
require('core-js/modules/es.array.unscopables.flat.js');
|
|
43
|
-
var dateFns = require('date-fns');
|
|
44
41
|
require('core-js/modules/es.array.sort.js');
|
|
42
|
+
require('core-js/modules/es.string.pad-start.js');
|
|
45
43
|
var format = _interopDefault(require('date-fns/format'));
|
|
46
|
-
require('core-js/modules/es.string.trim.js');
|
|
47
44
|
require('core-js/modules/es.regexp.constructor.js');
|
|
48
45
|
var formik = require('formik');
|
|
49
46
|
var api = require('src/services/api');
|
|
@@ -199,15 +196,24 @@ var AccordionShapes = {
|
|
|
199
196
|
var AccordionVariants = {
|
|
200
197
|
default: {
|
|
201
198
|
backgroundColor: 'transparent',
|
|
202
|
-
borderWidth: 0
|
|
199
|
+
borderWidth: 0,
|
|
200
|
+
transition: 'background-color 0.15s ease'
|
|
203
201
|
},
|
|
204
202
|
outline: {
|
|
205
203
|
borderWidth: 1,
|
|
206
204
|
borderStyle: 'solid',
|
|
207
|
-
borderColor: 'color.gray.200'
|
|
205
|
+
borderColor: 'color.gray.200',
|
|
206
|
+
transition: 'border-color 0.15s ease, background-color 0.15s ease',
|
|
207
|
+
_hover: {
|
|
208
|
+
borderColor: 'color.gray.300'
|
|
209
|
+
}
|
|
208
210
|
},
|
|
209
211
|
filled: {
|
|
210
|
-
backgroundColor: 'color.gray.50'
|
|
212
|
+
backgroundColor: 'color.gray.50',
|
|
213
|
+
transition: 'background-color 0.15s ease',
|
|
214
|
+
_hover: {
|
|
215
|
+
backgroundColor: 'color.gray.100'
|
|
216
|
+
}
|
|
211
217
|
}
|
|
212
218
|
};
|
|
213
219
|
|
|
@@ -460,6 +466,7 @@ Accordion.Content = AccordionContent;
|
|
|
460
466
|
*/
|
|
461
467
|
/**
|
|
462
468
|
* Heading sizes following typography guidelines
|
|
469
|
+
* Matching shadcn/ui typography patterns
|
|
463
470
|
*/
|
|
464
471
|
var HeadingSizes = {
|
|
465
472
|
h1: {
|
|
@@ -467,42 +474,54 @@ var HeadingSizes = {
|
|
|
467
474
|
lineHeight: '40px',
|
|
468
475
|
fontWeight: '700',
|
|
469
476
|
letterSpacing: '-0.02em',
|
|
470
|
-
marginBottom: '24px'
|
|
477
|
+
marginBottom: '24px',
|
|
478
|
+
color: 'color.gray.900',
|
|
479
|
+
transition: 'color 0.15s ease'
|
|
471
480
|
},
|
|
472
481
|
h2: {
|
|
473
482
|
fontSize: '30px',
|
|
474
483
|
lineHeight: '36px',
|
|
475
484
|
fontWeight: '700',
|
|
476
485
|
letterSpacing: '-0.02em',
|
|
477
|
-
marginBottom: '20px'
|
|
486
|
+
marginBottom: '20px',
|
|
487
|
+
color: 'color.gray.900',
|
|
488
|
+
transition: 'color 0.15s ease'
|
|
478
489
|
},
|
|
479
490
|
h3: {
|
|
480
491
|
fontSize: '24px',
|
|
481
492
|
lineHeight: '32px',
|
|
482
493
|
fontWeight: '600',
|
|
483
494
|
letterSpacing: '-0.01em',
|
|
484
|
-
marginBottom: '16px'
|
|
495
|
+
marginBottom: '16px',
|
|
496
|
+
color: 'color.gray.900',
|
|
497
|
+
transition: 'color 0.15s ease'
|
|
485
498
|
},
|
|
486
499
|
h4: {
|
|
487
500
|
fontSize: '20px',
|
|
488
501
|
lineHeight: '28px',
|
|
489
502
|
fontWeight: '600',
|
|
490
503
|
letterSpacing: '-0.01em',
|
|
491
|
-
marginBottom: '16px'
|
|
504
|
+
marginBottom: '16px',
|
|
505
|
+
color: 'color.gray.900',
|
|
506
|
+
transition: 'color 0.15s ease'
|
|
492
507
|
},
|
|
493
508
|
h5: {
|
|
494
509
|
fontSize: '18px',
|
|
495
510
|
lineHeight: '24px',
|
|
496
511
|
fontWeight: '600',
|
|
497
512
|
letterSpacing: '-0.01em',
|
|
498
|
-
marginBottom: '12px'
|
|
513
|
+
marginBottom: '12px',
|
|
514
|
+
color: 'color.gray.900',
|
|
515
|
+
transition: 'color 0.15s ease'
|
|
499
516
|
},
|
|
500
517
|
h6: {
|
|
501
518
|
fontSize: '16px',
|
|
502
519
|
lineHeight: '24px',
|
|
503
520
|
fontWeight: '600',
|
|
504
521
|
letterSpacing: '-0.01em',
|
|
505
|
-
marginBottom: '8px'
|
|
522
|
+
marginBottom: '8px',
|
|
523
|
+
color: 'color.gray.900',
|
|
524
|
+
transition: 'color 0.15s ease'
|
|
506
525
|
}
|
|
507
526
|
};
|
|
508
527
|
/**
|
|
@@ -540,31 +559,40 @@ var FontWeights = {
|
|
|
540
559
|
black: '900'
|
|
541
560
|
};
|
|
542
561
|
|
|
562
|
+
var normalizeHexColor = backgroundColor => {
|
|
563
|
+
if (!backgroundColor) {
|
|
564
|
+
return null;
|
|
565
|
+
}
|
|
566
|
+
var trimmed = backgroundColor.trim();
|
|
567
|
+
var withoutHash = trimmed.startsWith('#') ? trimmed.slice(1) : trimmed;
|
|
568
|
+
if (withoutHash.length === 3) {
|
|
569
|
+
if (!/^[0-9a-fA-F]{3}$/.test(withoutHash)) {
|
|
570
|
+
return null;
|
|
571
|
+
}
|
|
572
|
+
return "#" + withoutHash.split('').map(char => char + char).join('');
|
|
573
|
+
}
|
|
574
|
+
if (!/^[0-9a-fA-F]{6}$/.test(withoutHash)) {
|
|
575
|
+
return null;
|
|
576
|
+
}
|
|
577
|
+
return "#" + withoutHash.toLowerCase();
|
|
578
|
+
};
|
|
543
579
|
var getTextColorHex = backgroundColor => {
|
|
580
|
+
var normalized = normalizeHexColor(backgroundColor);
|
|
581
|
+
if (!normalized) {
|
|
582
|
+
return 'black';
|
|
583
|
+
}
|
|
544
584
|
// Simple luminance calculation to determine text color contrast
|
|
545
|
-
var color =
|
|
585
|
+
var color = normalized.replace('#', '');
|
|
546
586
|
var r = parseInt(color.substring(0, 2), 16);
|
|
547
587
|
var g = parseInt(color.substring(2, 4), 16);
|
|
548
588
|
var b = parseInt(color.substring(4, 6), 16);
|
|
549
589
|
var luminance = (0.299 * r + 0.587 * g + 0.114 * b) / 255;
|
|
550
590
|
return luminance > 0.4 ? 'black' : 'white';
|
|
551
591
|
};
|
|
552
|
-
var getTextColor = backgroundColor =>
|
|
553
|
-
// Use complementary color for better contrast and return as hex
|
|
554
|
-
var color = backgroundColor.replace('#', '');
|
|
555
|
-
var r = parseInt(color.substring(0, 2), 16);
|
|
556
|
-
var g = parseInt(color.substring(2, 4), 16);
|
|
557
|
-
var b = parseInt(color.substring(4, 6), 16);
|
|
558
|
-
// Calculate the complementary color
|
|
559
|
-
var complementR = (255 - r).toString(16).padStart(2, '0');
|
|
560
|
-
var complementG = (255 - g).toString(16).padStart(2, '0');
|
|
561
|
-
var complementB = (255 - b).toString(16).padStart(2, '0');
|
|
562
|
-
// Return the color in hex format
|
|
563
|
-
return getTextColorHex("#" + complementR + complementG + complementB);
|
|
564
|
-
};
|
|
592
|
+
var getTextColor = backgroundColor => getTextColorHex(backgroundColor);
|
|
565
593
|
|
|
566
594
|
var _excluded$2 = ["text", "maxLines", "views"],
|
|
567
|
-
_excluded2$1 = ["children", "heading", "maxLines", "isItalic", "isUnderlined", "isSub", "isSup", "isStriked", "weight", "size", "bgColor", "color", "views"];
|
|
595
|
+
_excluded2$1 = ["children", "heading", "maxLines", "isItalic", "isUnderlined", "isSub", "isSup", "isStriked", "weight", "size", "bgColor", "backgroundColor", "color", "views"];
|
|
568
596
|
/**
|
|
569
597
|
* Renders text content with support for subscript and superscript
|
|
570
598
|
*/
|
|
@@ -668,6 +696,7 @@ var TruncateText = _ref2 => {
|
|
|
668
696
|
* Main Text component that renders text with various styles and states
|
|
669
697
|
*/
|
|
670
698
|
var TextView = _ref3 => {
|
|
699
|
+
var _views$container, _ref4;
|
|
671
700
|
var {
|
|
672
701
|
children,
|
|
673
702
|
heading,
|
|
@@ -680,6 +709,7 @@ var TextView = _ref3 => {
|
|
|
680
709
|
weight = 'normal',
|
|
681
710
|
size = 'md',
|
|
682
711
|
bgColor,
|
|
712
|
+
backgroundColor: backgroundColorProp,
|
|
683
713
|
color,
|
|
684
714
|
views
|
|
685
715
|
} = _ref3,
|
|
@@ -694,7 +724,9 @@ var TextView = _ref3 => {
|
|
|
694
724
|
var fontSize = FontSizes[size];
|
|
695
725
|
var lineHeight = LineHeights[size];
|
|
696
726
|
var fontWeight = FontWeights[weight];
|
|
697
|
-
var
|
|
727
|
+
var containerBackgroundColor = views == null || (_views$container = views.container) == null ? void 0 : _views$container.backgroundColor;
|
|
728
|
+
var effectiveBackgroundColor = (_ref4 = bgColor != null ? bgColor : backgroundColorProp) != null ? _ref4 : containerBackgroundColor;
|
|
729
|
+
var computedColor = color != null ? color : effectiveBackgroundColor ? getTextColor(effectiveBackgroundColor) : undefined;
|
|
698
730
|
return /*#__PURE__*/React__default.createElement(appStudio.Element
|
|
699
731
|
// Apply typography styles according to design guidelines
|
|
700
732
|
, Object.assign({
|
|
@@ -705,7 +737,8 @@ var TextView = _ref3 => {
|
|
|
705
737
|
fontWeight: fontWeight,
|
|
706
738
|
letterSpacing: "-0.01em",
|
|
707
739
|
textDecoration: isStriked ? 'line-through' : isUnderlined ? 'underline' : 'none',
|
|
708
|
-
color: computedColor
|
|
740
|
+
color: computedColor,
|
|
741
|
+
backgroundColor: effectiveBackgroundColor
|
|
709
742
|
}, noLineBreak, headingStyles, props, views == null ? void 0 : views.container), maxLines && typeof children === 'string' ? (/*#__PURE__*/React__default.createElement(TruncateText, {
|
|
710
743
|
text: children,
|
|
711
744
|
maxLines: maxLines
|
|
@@ -3366,13 +3399,15 @@ var AlertView = _ref => {
|
|
|
3366
3399
|
fontWeight: "600" // Semi-bold
|
|
3367
3400
|
,
|
|
3368
3401
|
lineHeight: "24px",
|
|
3369
|
-
color: themes[variant].content.color
|
|
3402
|
+
color: themes[variant].content.color,
|
|
3403
|
+
bgColor: themes[variant].container.backgroundColor
|
|
3370
3404
|
}, views == null ? void 0 : views.title), title), /*#__PURE__*/React__default.createElement(Text, Object.assign({
|
|
3371
3405
|
fontSize: "14px",
|
|
3372
3406
|
fontWeight: "400" // Regular
|
|
3373
3407
|
,
|
|
3374
3408
|
lineHeight: "20px",
|
|
3375
|
-
color: themes[variant].content.color
|
|
3409
|
+
color: themes[variant].content.color,
|
|
3410
|
+
bgColor: themes[variant].container.backgroundColor
|
|
3376
3411
|
}, views == null ? void 0 : views.description), description || children)));
|
|
3377
3412
|
};
|
|
3378
3413
|
|
|
@@ -3694,14 +3729,17 @@ var MessageView = _ref => {
|
|
|
3694
3729
|
width: "100%"
|
|
3695
3730
|
}, /*#__PURE__*/React__default.createElement(Text, Object.assign({
|
|
3696
3731
|
size: "md",
|
|
3697
|
-
weight: "semiBold"
|
|
3732
|
+
weight: "semiBold",
|
|
3733
|
+
bgColor: Theme[variant].container.backgroundColor
|
|
3698
3734
|
}, views == null ? void 0 : views.title), title), subtitle && (/*#__PURE__*/React__default.createElement(Text, Object.assign({
|
|
3699
|
-
size: "sm"
|
|
3735
|
+
size: "sm",
|
|
3736
|
+
bgColor: Theme[variant].container.backgroundColor
|
|
3700
3737
|
}, views == null ? void 0 : views.subtitle), subtitle))), showAction && (/*#__PURE__*/React__default.createElement(Text, Object.assign({
|
|
3701
3738
|
marginRight: 10,
|
|
3702
3739
|
onClick: action,
|
|
3703
3740
|
padding: "6px 10px",
|
|
3704
|
-
whiteSpace: "nowrap"
|
|
3741
|
+
whiteSpace: "nowrap",
|
|
3742
|
+
bgColor: Theme[variant].container.backgroundColor
|
|
3705
3743
|
}, containerStyle, views == null ? void 0 : views.actionText), actionText)), isClosable && (/*#__PURE__*/React__default.createElement(appStudio.View, Object.assign({
|
|
3706
3744
|
position: "absolute",
|
|
3707
3745
|
zIndex: 10000,
|
|
@@ -4799,7 +4837,8 @@ var BadgeView = _ref => {
|
|
|
4799
4837
|
,
|
|
4800
4838
|
textAlign: "center"
|
|
4801
4839
|
}, views == null ? void 0 : views.text, {
|
|
4802
|
-
color: combinedStyles.color
|
|
4840
|
+
color: combinedStyles.color,
|
|
4841
|
+
bgColor: combinedStyles.backgroundColor
|
|
4803
4842
|
}), content || ''));
|
|
4804
4843
|
};
|
|
4805
4844
|
|
|
@@ -4849,9 +4888,18 @@ var LinkView = _ref => {
|
|
|
4849
4888
|
} = _ref,
|
|
4850
4889
|
props = _objectWithoutPropertiesLoose(_ref, _excluded$c);
|
|
4851
4890
|
// Function to handle mouse enter/leave events to toggle hover state.
|
|
4852
|
-
var
|
|
4891
|
+
var handleMouseEnter = () => {
|
|
4853
4892
|
if (underline === 'hover') setIsHovered(true);
|
|
4854
4893
|
};
|
|
4894
|
+
var handleMouseLeave = () => {
|
|
4895
|
+
if (underline === 'hover') setIsHovered(false);
|
|
4896
|
+
};
|
|
4897
|
+
// Determine text decoration based on underline prop and hover state
|
|
4898
|
+
var getTextDecoration = () => {
|
|
4899
|
+
if (underline === 'underline') return 'underline';
|
|
4900
|
+
if (underline === 'hover' && isHovered) return 'underline';
|
|
4901
|
+
return 'none';
|
|
4902
|
+
};
|
|
4855
4903
|
return /*#__PURE__*/React__default.createElement(reactRouterDom.Link, {
|
|
4856
4904
|
to: to,
|
|
4857
4905
|
target: isExternal ? '_blank' : '_self',
|
|
@@ -4860,12 +4908,12 @@ var LinkView = _ref => {
|
|
|
4860
4908
|
color: 'inherit'
|
|
4861
4909
|
}
|
|
4862
4910
|
}, /*#__PURE__*/React__default.createElement(appStudio.Horizontal, Object.assign({
|
|
4863
|
-
onMouseEnter:
|
|
4864
|
-
onMouseLeave:
|
|
4911
|
+
onMouseEnter: handleMouseEnter,
|
|
4912
|
+
onMouseLeave: handleMouseLeave,
|
|
4865
4913
|
gap: 3,
|
|
4866
4914
|
alignItems: "center",
|
|
4867
4915
|
flexWrap: "nowrap",
|
|
4868
|
-
textDecoration:
|
|
4916
|
+
textDecoration: getTextDecoration()
|
|
4869
4917
|
}, views.text, props), children, isExternal && /*#__PURE__*/React__default.createElement(ExternalLinkIcon, {
|
|
4870
4918
|
widthHeight: IconSizes[iconSize]
|
|
4871
4919
|
})));
|
|
@@ -5195,18 +5243,16 @@ var getButtonVariants = (color, isLight) => ({
|
|
|
5195
5243
|
borderStyle: 'solid',
|
|
5196
5244
|
borderColor: 'transparent',
|
|
5197
5245
|
_hover: {
|
|
5198
|
-
|
|
5199
|
-
textDecoration: 'underline',
|
|
5200
|
-
textUnderlineOffset: '1px',
|
|
5201
|
-
textDecorationThickness: '1px'
|
|
5246
|
+
opacity: 0.9
|
|
5202
5247
|
},
|
|
5203
5248
|
_active: {
|
|
5204
|
-
|
|
5205
|
-
textDecoration: 'underline',
|
|
5206
|
-
textUnderlineOffset: '1px',
|
|
5207
|
-
textDecorationThickness: '1px'
|
|
5249
|
+
opacity: 0.95
|
|
5208
5250
|
},
|
|
5209
|
-
|
|
5251
|
+
_focusVisible: {
|
|
5252
|
+
outline: 'none',
|
|
5253
|
+
boxShadow: "0 0 0 2px rgba(255, 255, 255, 1), 0 0 0 4px " + color
|
|
5254
|
+
},
|
|
5255
|
+
transition: 'background-color 0.2s ease, opacity 0.2s ease'
|
|
5210
5256
|
},
|
|
5211
5257
|
outline: {
|
|
5212
5258
|
backgroundColor: 'transparent',
|
|
@@ -5216,21 +5262,19 @@ var getButtonVariants = (color, isLight) => ({
|
|
|
5216
5262
|
borderColor: color,
|
|
5217
5263
|
_hover: {
|
|
5218
5264
|
backgroundColor: color,
|
|
5219
|
-
color: isLight ? '
|
|
5220
|
-
|
|
5221
|
-
textDecoration: 'underline',
|
|
5222
|
-
textUnderlineOffset: '1px',
|
|
5223
|
-
textDecorationThickness: '1px'
|
|
5265
|
+
color: isLight ? 'color.black' : 'color.white',
|
|
5266
|
+
opacity: 0.9
|
|
5224
5267
|
},
|
|
5225
5268
|
_active: {
|
|
5226
5269
|
backgroundColor: color,
|
|
5227
|
-
color: isLight ? '
|
|
5228
|
-
|
|
5229
|
-
textDecoration: 'underline',
|
|
5230
|
-
textUnderlineOffset: '1px',
|
|
5231
|
-
textDecorationThickness: '1px'
|
|
5270
|
+
color: isLight ? 'color.black' : 'color.white',
|
|
5271
|
+
opacity: 0.95
|
|
5232
5272
|
},
|
|
5233
|
-
|
|
5273
|
+
_focusVisible: {
|
|
5274
|
+
outline: 'none',
|
|
5275
|
+
boxShadow: "0 0 0 2px rgba(255, 255, 255, 1), 0 0 0 4px " + color
|
|
5276
|
+
},
|
|
5277
|
+
transition: 'background-color 0.2s ease, color 0.2s ease, opacity 0.2s ease'
|
|
5234
5278
|
},
|
|
5235
5279
|
ghost: {
|
|
5236
5280
|
backgroundColor: 'transparent',
|
|
@@ -5239,39 +5283,39 @@ var getButtonVariants = (color, isLight) => ({
|
|
|
5239
5283
|
borderStyle: 'none',
|
|
5240
5284
|
borderColor: 'transparent',
|
|
5241
5285
|
_hover: {
|
|
5242
|
-
backgroundColor: color,
|
|
5243
|
-
|
|
5244
|
-
transform: 'translateY(-1px)',
|
|
5245
|
-
textDecoration: 'underline',
|
|
5246
|
-
textUnderlineOffset: '1px',
|
|
5247
|
-
textDecorationThickness: '1px'
|
|
5286
|
+
backgroundColor: isLight ? 'color.gray.100' : 'color.gray.800',
|
|
5287
|
+
opacity: 0.9
|
|
5248
5288
|
},
|
|
5249
5289
|
_active: {
|
|
5250
|
-
backgroundColor: color,
|
|
5251
|
-
|
|
5252
|
-
transform: 'translateY(0)',
|
|
5253
|
-
textDecoration: 'underline',
|
|
5254
|
-
textUnderlineOffset: '1px',
|
|
5255
|
-
textDecorationThickness: '1px'
|
|
5290
|
+
backgroundColor: isLight ? 'color.gray.200' : 'color.gray.700',
|
|
5291
|
+
opacity: 0.95
|
|
5256
5292
|
},
|
|
5257
|
-
|
|
5293
|
+
_focusVisible: {
|
|
5294
|
+
outline: 'none',
|
|
5295
|
+
boxShadow: "0 0 0 2px rgba(255, 255, 255, 1), 0 0 0 4px " + color
|
|
5296
|
+
},
|
|
5297
|
+
transition: 'background-color 0.2s ease, opacity 0.2s ease'
|
|
5258
5298
|
},
|
|
5259
5299
|
link: {
|
|
5260
5300
|
backgroundColor: 'transparent',
|
|
5261
|
-
color: isLight ? color : '
|
|
5301
|
+
color: isLight ? color : 'color.black',
|
|
5262
5302
|
borderWidth: 0,
|
|
5263
5303
|
borderStyle: 'none',
|
|
5264
5304
|
borderColor: 'transparent',
|
|
5265
5305
|
textDecoration: 'underline',
|
|
5266
|
-
textUnderlineOffset: '
|
|
5306
|
+
textUnderlineOffset: '2px',
|
|
5267
5307
|
textDecorationThickness: '1px',
|
|
5268
5308
|
_hover: {
|
|
5269
|
-
|
|
5309
|
+
opacity: 0.8
|
|
5270
5310
|
},
|
|
5271
5311
|
_active: {
|
|
5272
|
-
|
|
5312
|
+
opacity: 0.9
|
|
5273
5313
|
},
|
|
5274
|
-
|
|
5314
|
+
_focusVisible: {
|
|
5315
|
+
outline: 'none',
|
|
5316
|
+
boxShadow: "0 0 0 2px rgba(255, 255, 255, 1), 0 0 0 4px " + color
|
|
5317
|
+
},
|
|
5318
|
+
transition: 'opacity 0.2s ease'
|
|
5275
5319
|
},
|
|
5276
5320
|
borderMoving: {
|
|
5277
5321
|
position: 'relative',
|
|
@@ -5280,7 +5324,12 @@ var getButtonVariants = (color, isLight) => ({
|
|
|
5280
5324
|
color: 'white',
|
|
5281
5325
|
borderWidth: 0,
|
|
5282
5326
|
borderStyle: 'none',
|
|
5283
|
-
borderColor: 'transparent'
|
|
5327
|
+
borderColor: 'transparent',
|
|
5328
|
+
_focusVisible: {
|
|
5329
|
+
outline: 'none',
|
|
5330
|
+
boxShadow: '0 0 0 2px rgba(255, 255, 255, 1), 0 0 0 4px rgba(0, 0, 0, 0.8)'
|
|
5331
|
+
},
|
|
5332
|
+
transition: 'opacity 0.2s ease'
|
|
5284
5333
|
},
|
|
5285
5334
|
animatedStroke: {
|
|
5286
5335
|
display: 'inline-block',
|
|
@@ -5293,7 +5342,12 @@ var getButtonVariants = (color, isLight) => ({
|
|
|
5293
5342
|
backgroundColor: 'transparent',
|
|
5294
5343
|
borderWidth: 0,
|
|
5295
5344
|
borderStyle: 'none',
|
|
5296
|
-
borderColor: 'transparent'
|
|
5345
|
+
borderColor: 'transparent',
|
|
5346
|
+
_focusVisible: {
|
|
5347
|
+
outline: 'none',
|
|
5348
|
+
boxShadow: "0 0 0 2px rgba(255, 255, 255, 1), 0 0 0 4px " + color
|
|
5349
|
+
},
|
|
5350
|
+
transition: 'opacity 0.2s ease'
|
|
5297
5351
|
}
|
|
5298
5352
|
});
|
|
5299
5353
|
/**
|
|
@@ -5631,26 +5685,34 @@ var getCardVariants = themeMode => {
|
|
|
5631
5685
|
default: {
|
|
5632
5686
|
backgroundColor: 'color.white',
|
|
5633
5687
|
border: 'none',
|
|
5634
|
-
transition: '
|
|
5688
|
+
transition: 'background-color 0.2s ease, box-shadow 0.2s ease'
|
|
5635
5689
|
},
|
|
5636
5690
|
outlined: {
|
|
5637
5691
|
backgroundColor: 'color.white',
|
|
5638
5692
|
borderWidth: '1px',
|
|
5639
5693
|
borderStyle: 'solid',
|
|
5640
5694
|
borderColor: 'color.gray.200',
|
|
5641
|
-
transition: '
|
|
5695
|
+
transition: 'border-color 0.2s ease, box-shadow 0.2s ease',
|
|
5642
5696
|
_hover: {
|
|
5643
|
-
borderColor: 'color.gray.300'
|
|
5697
|
+
borderColor: 'color.gray.300',
|
|
5698
|
+
boxShadow: '0px 1px 3px rgba(0, 0, 0, 0.05)'
|
|
5699
|
+
},
|
|
5700
|
+
_focusVisible: {
|
|
5701
|
+
outline: 'none',
|
|
5702
|
+
boxShadow: '0 0 0 2px rgba(255, 255, 255, 1), 0 0 0 4px rgba(0, 0, 0, 0.1)'
|
|
5644
5703
|
}
|
|
5645
5704
|
},
|
|
5646
5705
|
elevated: {
|
|
5647
5706
|
backgroundColor: 'color.white',
|
|
5648
|
-
boxShadow: '0px
|
|
5707
|
+
boxShadow: '0px 1px 3px rgba(0, 0, 0, 0.08), 0px 1px 2px rgba(0, 0, 0, 0.06)',
|
|
5649
5708
|
border: 'none',
|
|
5650
|
-
transition: '
|
|
5709
|
+
transition: 'box-shadow 0.2s ease',
|
|
5651
5710
|
_hover: {
|
|
5652
|
-
boxShadow: '0px 4px
|
|
5653
|
-
|
|
5711
|
+
boxShadow: '0px 4px 6px rgba(0, 0, 0, 0.08), 0px 2px 4px rgba(0, 0, 0, 0.06)'
|
|
5712
|
+
},
|
|
5713
|
+
_focusVisible: {
|
|
5714
|
+
outline: 'none',
|
|
5715
|
+
boxShadow: '0 0 0 2px rgba(255, 255, 255, 1), 0 0 0 4px rgba(0, 0, 0, 0.1), 0px 4px 6px rgba(0, 0, 0, 0.08)'
|
|
5654
5716
|
}
|
|
5655
5717
|
}
|
|
5656
5718
|
};
|
|
@@ -5666,24 +5728,44 @@ var getDefaultCardStyles = theme => {
|
|
|
5666
5728
|
color: 'color.black',
|
|
5667
5729
|
borderRadius: '8px',
|
|
5668
5730
|
overflow: 'hidden',
|
|
5669
|
-
transition: 'all 0.2s ease'
|
|
5731
|
+
transition: 'all 0.2s ease',
|
|
5732
|
+
media: {
|
|
5733
|
+
mobile: {
|
|
5734
|
+
borderRadius: '4px'
|
|
5735
|
+
}
|
|
5736
|
+
}
|
|
5670
5737
|
},
|
|
5671
5738
|
header: {
|
|
5672
5739
|
padding: '16px',
|
|
5673
5740
|
borderBottomWidth: '1px',
|
|
5674
5741
|
borderBottomStyle: 'solid',
|
|
5675
5742
|
borderBottomColor: 'color.gray.200',
|
|
5676
|
-
color: 'color.black'
|
|
5743
|
+
color: 'color.black',
|
|
5744
|
+
media: {
|
|
5745
|
+
mobile: {
|
|
5746
|
+
padding: '12px'
|
|
5747
|
+
}
|
|
5748
|
+
}
|
|
5677
5749
|
},
|
|
5678
5750
|
content: {
|
|
5679
5751
|
padding: '16px',
|
|
5680
|
-
color: 'color.black'
|
|
5752
|
+
color: 'color.black',
|
|
5753
|
+
media: {
|
|
5754
|
+
mobile: {
|
|
5755
|
+
padding: '12px'
|
|
5756
|
+
}
|
|
5757
|
+
}
|
|
5681
5758
|
},
|
|
5682
5759
|
footer: {
|
|
5683
5760
|
padding: '16px',
|
|
5684
5761
|
borderTopWidth: '1px',
|
|
5685
5762
|
borderTopStyle: 'solid',
|
|
5686
|
-
borderTopColor: 'color.gray.200'
|
|
5763
|
+
borderTopColor: 'color.gray.200',
|
|
5764
|
+
media: {
|
|
5765
|
+
mobile: {
|
|
5766
|
+
padding: '12px'
|
|
5767
|
+
}
|
|
5768
|
+
}
|
|
5687
5769
|
}
|
|
5688
5770
|
};
|
|
5689
5771
|
};
|
|
@@ -6469,17 +6551,6 @@ var LegendColorStyles = {
|
|
|
6469
6551
|
var LegendTextStyles = {
|
|
6470
6552
|
fontSize: '14px'
|
|
6471
6553
|
};
|
|
6472
|
-
// Default styles for tooltip
|
|
6473
|
-
var TooltipStyles = {
|
|
6474
|
-
position: 'absolute',
|
|
6475
|
-
backgroundColor: 'color.white',
|
|
6476
|
-
padding: '8px 12px',
|
|
6477
|
-
borderRadius: '4px',
|
|
6478
|
-
boxShadow: '0 2px 5px rgba(0, 0, 0, 0.1)',
|
|
6479
|
-
fontSize: '14px',
|
|
6480
|
-
pointerEvents: 'none',
|
|
6481
|
-
zIndex: 10
|
|
6482
|
-
};
|
|
6483
6554
|
// Default styles for chart grid
|
|
6484
6555
|
var GridStyles = {
|
|
6485
6556
|
stroke: 'color.gray.200',
|
|
@@ -6572,7 +6643,7 @@ var useChartState = _ref => {
|
|
|
6572
6643
|
visible: false,
|
|
6573
6644
|
x: 0,
|
|
6574
6645
|
y: 0,
|
|
6575
|
-
content:
|
|
6646
|
+
content: null
|
|
6576
6647
|
});
|
|
6577
6648
|
// Reference to animation frame
|
|
6578
6649
|
var animationRef = React.useRef(null);
|
|
@@ -6731,7 +6802,12 @@ var BarChart = _ref => {
|
|
|
6731
6802
|
x: x,
|
|
6732
6803
|
y: y,
|
|
6733
6804
|
textAnchor: "middle"
|
|
6734
|
-
}, AxisLabelStyles, views == null ? void 0 : views.axisLabel
|
|
6805
|
+
}, AxisLabelStyles, views == null ? void 0 : views.axisLabel, {
|
|
6806
|
+
style: {
|
|
6807
|
+
textShadow: '0 1px 2px rgba(0, 0, 0, 0.2)',
|
|
6808
|
+
filter: 'drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2))'
|
|
6809
|
+
}
|
|
6810
|
+
}), label);
|
|
6735
6811
|
}), yAxisTicks.map((tick, index) => {
|
|
6736
6812
|
var y = height - padding.bottom - tick / maxValue * chartHeight;
|
|
6737
6813
|
return /*#__PURE__*/React__default.createElement(React__default.Fragment, {
|
|
@@ -6741,7 +6817,12 @@ var BarChart = _ref => {
|
|
|
6741
6817
|
y: y,
|
|
6742
6818
|
textAnchor: "end",
|
|
6743
6819
|
dominantBaseline: "middle"
|
|
6744
|
-
}, AxisLabelStyles, views == null ? void 0 : views.axisLabel
|
|
6820
|
+
}, AxisLabelStyles, views == null ? void 0 : views.axisLabel, {
|
|
6821
|
+
style: {
|
|
6822
|
+
textShadow: '0 1px 2px rgba(0, 0, 0, 0.2)',
|
|
6823
|
+
filter: 'drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2))'
|
|
6824
|
+
}
|
|
6825
|
+
}), tick.toFixed(0)), showGrid && (/*#__PURE__*/React__default.createElement("line", Object.assign({
|
|
6745
6826
|
x1: padding.left,
|
|
6746
6827
|
y1: y,
|
|
6747
6828
|
x2: width - padding.right,
|
|
@@ -6753,8 +6834,61 @@ var BarChart = _ref => {
|
|
|
6753
6834
|
var barHeight = value / maxValue * chartHeight * animationProgress;
|
|
6754
6835
|
var x = padding.left + dataIndex * groupWidth + barSpacing * (seriesIndex + 1) + barWidth * seriesIndex;
|
|
6755
6836
|
var y = height - padding.bottom - barHeight;
|
|
6837
|
+
var categoryLabel = data.labels[dataIndex];
|
|
6838
|
+
var categoryTotal = data.series.reduce((sum, currentSeries) => {
|
|
6839
|
+
var seriesValue = currentSeries.data[dataIndex];
|
|
6840
|
+
return sum + (typeof seriesValue === 'number' ? seriesValue : 0);
|
|
6841
|
+
}, 0);
|
|
6842
|
+
var sharePercentage = categoryTotal > 0 ? (value / categoryTotal * 100).toFixed(1) : null;
|
|
6843
|
+
var fillColor = series.color ? getColor(series.color) : 'black';
|
|
6756
6844
|
var handleMouseEnter = e => {
|
|
6757
|
-
var tooltipContent =
|
|
6845
|
+
var tooltipContent = /*#__PURE__*/React__default.createElement(appStudio.View, {
|
|
6846
|
+
display: "flex",
|
|
6847
|
+
flexDirection: "column",
|
|
6848
|
+
minWidth: "180px"
|
|
6849
|
+
}, /*#__PURE__*/React__default.createElement(appStudio.View, {
|
|
6850
|
+
display: "flex",
|
|
6851
|
+
justifyContent: "space-between",
|
|
6852
|
+
alignItems: "center"
|
|
6853
|
+
}, /*#__PURE__*/React__default.createElement(Text, {
|
|
6854
|
+
fontWeight: "semibold"
|
|
6855
|
+
}, series.name), /*#__PURE__*/React__default.createElement(appStudio.View, {
|
|
6856
|
+
width: "12px",
|
|
6857
|
+
height: "12px",
|
|
6858
|
+
borderRadius: "2px",
|
|
6859
|
+
backgroundColor: fillColor
|
|
6860
|
+
})), /*#__PURE__*/React__default.createElement(Text, {
|
|
6861
|
+
marginTop: "4px",
|
|
6862
|
+
color: "color.gray.500",
|
|
6863
|
+
fontSize: "12px"
|
|
6864
|
+
}, categoryLabel), /*#__PURE__*/React__default.createElement(appStudio.View, {
|
|
6865
|
+
marginTop: "8px",
|
|
6866
|
+
display: "flex",
|
|
6867
|
+
flexDirection: "column"
|
|
6868
|
+
}, /*#__PURE__*/React__default.createElement(appStudio.View, {
|
|
6869
|
+
display: "flex",
|
|
6870
|
+
justifyContent: "space-between"
|
|
6871
|
+
}, /*#__PURE__*/React__default.createElement(Text, {
|
|
6872
|
+
color: "color.gray.500"
|
|
6873
|
+
}, "Value"), /*#__PURE__*/React__default.createElement(Text, {
|
|
6874
|
+
fontWeight: "medium"
|
|
6875
|
+
}, value.toLocaleString())), sharePercentage !== null && (/*#__PURE__*/React__default.createElement(appStudio.View, {
|
|
6876
|
+
marginTop: "4px",
|
|
6877
|
+
display: "flex",
|
|
6878
|
+
justifyContent: "space-between"
|
|
6879
|
+
}, /*#__PURE__*/React__default.createElement(Text, {
|
|
6880
|
+
color: "color.gray.500"
|
|
6881
|
+
}, "Share"), /*#__PURE__*/React__default.createElement(Text, {
|
|
6882
|
+
fontWeight: "medium"
|
|
6883
|
+
}, sharePercentage + "%"))), /*#__PURE__*/React__default.createElement(appStudio.View, {
|
|
6884
|
+
marginTop: "4px",
|
|
6885
|
+
display: "flex",
|
|
6886
|
+
justifyContent: "space-between"
|
|
6887
|
+
}, /*#__PURE__*/React__default.createElement(Text, {
|
|
6888
|
+
color: "color.gray.500"
|
|
6889
|
+
}, "Category total"), /*#__PURE__*/React__default.createElement(Text, {
|
|
6890
|
+
fontWeight: "medium"
|
|
6891
|
+
}, categoryTotal.toLocaleString()))));
|
|
6758
6892
|
showTooltip(e.clientX, e.clientY, tooltipContent);
|
|
6759
6893
|
};
|
|
6760
6894
|
var handleClick = () => {
|
|
@@ -6768,7 +6902,7 @@ var BarChart = _ref => {
|
|
|
6768
6902
|
y: y,
|
|
6769
6903
|
width: barWidth,
|
|
6770
6904
|
height: barHeight,
|
|
6771
|
-
fill:
|
|
6905
|
+
fill: fillColor,
|
|
6772
6906
|
onMouseEnter: handleMouseEnter,
|
|
6773
6907
|
onMouseLeave: hideTooltip,
|
|
6774
6908
|
onClick: handleClick
|
|
@@ -6862,7 +6996,12 @@ var LineChart = _ref => {
|
|
|
6862
6996
|
x: x,
|
|
6863
6997
|
y: y,
|
|
6864
6998
|
textAnchor: "middle"
|
|
6865
|
-
}, AxisLabelStyles, views == null ? void 0 : views.axisLabel
|
|
6999
|
+
}, AxisLabelStyles, views == null ? void 0 : views.axisLabel, {
|
|
7000
|
+
style: {
|
|
7001
|
+
textShadow: '0 1px 2px rgba(0, 0, 0, 0.2)',
|
|
7002
|
+
filter: 'drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2))'
|
|
7003
|
+
}
|
|
7004
|
+
}), label);
|
|
6866
7005
|
}), yAxisTicks.map((tick, index) => {
|
|
6867
7006
|
var y = height - padding.bottom - tick / maxValue * chartHeight;
|
|
6868
7007
|
return /*#__PURE__*/React__default.createElement(React__default.Fragment, {
|
|
@@ -6872,43 +7011,114 @@ var LineChart = _ref => {
|
|
|
6872
7011
|
y: y,
|
|
6873
7012
|
textAnchor: "end",
|
|
6874
7013
|
dominantBaseline: "middle"
|
|
6875
|
-
}, AxisLabelStyles, views == null ? void 0 : views.axisLabel
|
|
7014
|
+
}, AxisLabelStyles, views == null ? void 0 : views.axisLabel, {
|
|
7015
|
+
style: {
|
|
7016
|
+
textShadow: '0 1px 2px rgba(0, 0, 0, 0.2)',
|
|
7017
|
+
filter: 'drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2))'
|
|
7018
|
+
}
|
|
7019
|
+
}), tick.toFixed(0)), showGrid && (/*#__PURE__*/React__default.createElement("line", Object.assign({
|
|
6876
7020
|
x1: padding.left,
|
|
6877
7021
|
y1: y,
|
|
6878
7022
|
x2: width - padding.right,
|
|
6879
7023
|
y2: y
|
|
6880
7024
|
}, GridStyles, views == null ? void 0 : views.grid))));
|
|
6881
|
-
}), data.series.map((series, seriesIndex) =>
|
|
6882
|
-
|
|
6883
|
-
|
|
6884
|
-
|
|
6885
|
-
|
|
6886
|
-
|
|
6887
|
-
|
|
6888
|
-
|
|
6889
|
-
|
|
6890
|
-
|
|
6891
|
-
|
|
6892
|
-
|
|
6893
|
-
|
|
6894
|
-
var
|
|
6895
|
-
|
|
6896
|
-
|
|
6897
|
-
|
|
6898
|
-
|
|
6899
|
-
|
|
6900
|
-
|
|
6901
|
-
|
|
6902
|
-
|
|
6903
|
-
|
|
6904
|
-
|
|
6905
|
-
|
|
6906
|
-
|
|
6907
|
-
|
|
6908
|
-
|
|
6909
|
-
|
|
6910
|
-
|
|
6911
|
-
|
|
7025
|
+
}), data.series.map((series, seriesIndex) => {
|
|
7026
|
+
var lineColor = series.color ? getColor(series.color) : 'black';
|
|
7027
|
+
return /*#__PURE__*/React__default.createElement(React__default.Fragment, {
|
|
7028
|
+
key: "series-" + seriesIndex
|
|
7029
|
+
}, /*#__PURE__*/React__default.createElement("path", Object.assign({
|
|
7030
|
+
d: generateAreaPath(series.data),
|
|
7031
|
+
fill: lineColor,
|
|
7032
|
+
opacity: 0.1
|
|
7033
|
+
}, views == null ? void 0 : views.area)), /*#__PURE__*/React__default.createElement("path", Object.assign({
|
|
7034
|
+
d: generatePath(series.data),
|
|
7035
|
+
stroke: lineColor
|
|
7036
|
+
}, LineStyles, views == null ? void 0 : views.line)), series.data.map((value, dataIndex) => {
|
|
7037
|
+
var x = padding.left + dataIndex / (data.labels.length - 1) * chartWidth;
|
|
7038
|
+
var y = height - padding.bottom - value / maxValue * chartHeight * animationProgress;
|
|
7039
|
+
var categoryLabel = data.labels[dataIndex];
|
|
7040
|
+
var categoryTotal = data.series.reduce((sum, currentSeries) => {
|
|
7041
|
+
var seriesValue = currentSeries.data[dataIndex];
|
|
7042
|
+
return sum + (typeof seriesValue === 'number' ? seriesValue : 0);
|
|
7043
|
+
}, 0);
|
|
7044
|
+
var sharePercentage = categoryTotal > 0 ? (value / categoryTotal * 100).toFixed(1) : null;
|
|
7045
|
+
var previousValue = dataIndex > 0 && typeof series.data[dataIndex - 1] === 'number' ? series.data[dataIndex - 1] : null;
|
|
7046
|
+
var deltaValue = typeof previousValue === 'number' ? value - previousValue : null;
|
|
7047
|
+
var formattedDelta = typeof deltaValue === 'number' ? "" + (deltaValue >= 0 ? '+' : '') + deltaValue.toLocaleString() : null;
|
|
7048
|
+
var handleMouseEnter = e => {
|
|
7049
|
+
var tooltipContent = /*#__PURE__*/React__default.createElement(appStudio.View, {
|
|
7050
|
+
display: "flex",
|
|
7051
|
+
flexDirection: "column",
|
|
7052
|
+
minWidth: "200px"
|
|
7053
|
+
}, /*#__PURE__*/React__default.createElement(appStudio.View, {
|
|
7054
|
+
display: "flex",
|
|
7055
|
+
justifyContent: "space-between",
|
|
7056
|
+
alignItems: "center"
|
|
7057
|
+
}, /*#__PURE__*/React__default.createElement(Text, {
|
|
7058
|
+
fontWeight: "semibold"
|
|
7059
|
+
}, series.name), /*#__PURE__*/React__default.createElement(appStudio.View, {
|
|
7060
|
+
width: "12px",
|
|
7061
|
+
height: "12px",
|
|
7062
|
+
borderRadius: "2px",
|
|
7063
|
+
backgroundColor: lineColor
|
|
7064
|
+
})), /*#__PURE__*/React__default.createElement(Text, {
|
|
7065
|
+
marginTop: "4px",
|
|
7066
|
+
color: "color.gray.500",
|
|
7067
|
+
fontSize: "12px"
|
|
7068
|
+
}, categoryLabel), /*#__PURE__*/React__default.createElement(appStudio.View, {
|
|
7069
|
+
marginTop: "8px",
|
|
7070
|
+
display: "flex",
|
|
7071
|
+
flexDirection: "column"
|
|
7072
|
+
}, /*#__PURE__*/React__default.createElement(appStudio.View, {
|
|
7073
|
+
display: "flex",
|
|
7074
|
+
justifyContent: "space-between"
|
|
7075
|
+
}, /*#__PURE__*/React__default.createElement(Text, {
|
|
7076
|
+
color: "color.gray.500"
|
|
7077
|
+
}, "Value"), /*#__PURE__*/React__default.createElement(Text, {
|
|
7078
|
+
fontWeight: "medium"
|
|
7079
|
+
}, value.toLocaleString())), formattedDelta !== null && (/*#__PURE__*/React__default.createElement(appStudio.View, {
|
|
7080
|
+
marginTop: "4px",
|
|
7081
|
+
display: "flex",
|
|
7082
|
+
justifyContent: "space-between"
|
|
7083
|
+
}, /*#__PURE__*/React__default.createElement(Text, {
|
|
7084
|
+
color: "color.gray.500"
|
|
7085
|
+
}, "Change"), /*#__PURE__*/React__default.createElement(Text, {
|
|
7086
|
+
fontWeight: "medium"
|
|
7087
|
+
}, formattedDelta))), sharePercentage !== null && (/*#__PURE__*/React__default.createElement(appStudio.View, {
|
|
7088
|
+
marginTop: "4px",
|
|
7089
|
+
display: "flex",
|
|
7090
|
+
justifyContent: "space-between"
|
|
7091
|
+
}, /*#__PURE__*/React__default.createElement(Text, {
|
|
7092
|
+
color: "color.gray.500"
|
|
7093
|
+
}, "Share"), /*#__PURE__*/React__default.createElement(Text, {
|
|
7094
|
+
fontWeight: "medium"
|
|
7095
|
+
}, sharePercentage + "%"))), /*#__PURE__*/React__default.createElement(appStudio.View, {
|
|
7096
|
+
marginTop: "4px",
|
|
7097
|
+
display: "flex",
|
|
7098
|
+
justifyContent: "space-between"
|
|
7099
|
+
}, /*#__PURE__*/React__default.createElement(Text, {
|
|
7100
|
+
color: "color.gray.500"
|
|
7101
|
+
}, "Category total"), /*#__PURE__*/React__default.createElement(Text, {
|
|
7102
|
+
fontWeight: "medium"
|
|
7103
|
+
}, categoryTotal.toLocaleString()))));
|
|
7104
|
+
showTooltip(e.clientX, e.clientY, tooltipContent);
|
|
7105
|
+
};
|
|
7106
|
+
var handleClick = () => {
|
|
7107
|
+
if (onPointClick) {
|
|
7108
|
+
onPointClick(series.name, dataIndex);
|
|
7109
|
+
}
|
|
7110
|
+
};
|
|
7111
|
+
return /*#__PURE__*/React__default.createElement("circle", Object.assign({
|
|
7112
|
+
key: "point-" + seriesIndex + "-" + dataIndex,
|
|
7113
|
+
cx: x,
|
|
7114
|
+
cy: y,
|
|
7115
|
+
fill: lineColor,
|
|
7116
|
+
onMouseEnter: handleMouseEnter,
|
|
7117
|
+
onMouseLeave: hideTooltip,
|
|
7118
|
+
onClick: handleClick
|
|
7119
|
+
}, PointStyles, views == null ? void 0 : views.point));
|
|
7120
|
+
}));
|
|
7121
|
+
}));
|
|
6912
7122
|
};
|
|
6913
7123
|
|
|
6914
7124
|
var PieChart = _ref => {
|
|
@@ -7015,10 +7225,75 @@ var PieChart = _ref => {
|
|
|
7015
7225
|
return /*#__PURE__*/React__default.createElement("svg", {
|
|
7016
7226
|
ref: chartRef,
|
|
7017
7227
|
width: width,
|
|
7018
|
-
height: height
|
|
7019
|
-
|
|
7228
|
+
height: height,
|
|
7229
|
+
style: {
|
|
7230
|
+
overflow: 'visible'
|
|
7231
|
+
}
|
|
7232
|
+
}, isDonut && (/*#__PURE__*/React__default.createElement("circle", {
|
|
7233
|
+
cx: centerX,
|
|
7234
|
+
cy: centerY,
|
|
7235
|
+
r: donutRadius,
|
|
7236
|
+
fill: "white",
|
|
7237
|
+
pointerEvents: "none"
|
|
7238
|
+
})), slices.map((slice, index) => {
|
|
7020
7239
|
var handleMouseEnter = e => {
|
|
7021
|
-
var
|
|
7240
|
+
var numericShare = total > 0 ? slice.value / total * 100 : 0;
|
|
7241
|
+
var remainingShare = total > 0 ? Math.max(0, 100 - numericShare) : null;
|
|
7242
|
+
var tooltipContent = /*#__PURE__*/React__default.createElement(appStudio.View, {
|
|
7243
|
+
display: "flex",
|
|
7244
|
+
flexDirection: "column",
|
|
7245
|
+
minWidth: "200px"
|
|
7246
|
+
}, /*#__PURE__*/React__default.createElement(appStudio.View, {
|
|
7247
|
+
display: "flex",
|
|
7248
|
+
justifyContent: "space-between",
|
|
7249
|
+
alignItems: "center"
|
|
7250
|
+
}, /*#__PURE__*/React__default.createElement(Text, {
|
|
7251
|
+
fontWeight: "semibold"
|
|
7252
|
+
}, slice.label), /*#__PURE__*/React__default.createElement(appStudio.View, {
|
|
7253
|
+
width: "12px",
|
|
7254
|
+
height: "12px",
|
|
7255
|
+
borderRadius: "2px",
|
|
7256
|
+
backgroundColor: slice.color
|
|
7257
|
+
})), /*#__PURE__*/React__default.createElement(Text, {
|
|
7258
|
+
marginTop: "4px",
|
|
7259
|
+
color: "color.gray.500",
|
|
7260
|
+
fontSize: "12px"
|
|
7261
|
+
}, "Slice ", slice.index + 1, " of ", dataPoints.length), /*#__PURE__*/React__default.createElement(appStudio.View, {
|
|
7262
|
+
marginTop: "8px",
|
|
7263
|
+
display: "flex",
|
|
7264
|
+
flexDirection: "column"
|
|
7265
|
+
}, /*#__PURE__*/React__default.createElement(appStudio.View, {
|
|
7266
|
+
display: "flex",
|
|
7267
|
+
justifyContent: "space-between"
|
|
7268
|
+
}, /*#__PURE__*/React__default.createElement(Text, {
|
|
7269
|
+
color: "color.gray.500"
|
|
7270
|
+
}, "Value"), /*#__PURE__*/React__default.createElement(Text, {
|
|
7271
|
+
fontWeight: "medium"
|
|
7272
|
+
}, slice.value.toLocaleString())), /*#__PURE__*/React__default.createElement(appStudio.View, {
|
|
7273
|
+
marginTop: "4px",
|
|
7274
|
+
display: "flex",
|
|
7275
|
+
justifyContent: "space-between"
|
|
7276
|
+
}, /*#__PURE__*/React__default.createElement(Text, {
|
|
7277
|
+
color: "color.gray.500"
|
|
7278
|
+
}, "Share"), /*#__PURE__*/React__default.createElement(Text, {
|
|
7279
|
+
fontWeight: "medium"
|
|
7280
|
+
}, slice.percentage)), /*#__PURE__*/React__default.createElement(appStudio.View, {
|
|
7281
|
+
marginTop: "4px",
|
|
7282
|
+
display: "flex",
|
|
7283
|
+
justifyContent: "space-between"
|
|
7284
|
+
}, /*#__PURE__*/React__default.createElement(Text, {
|
|
7285
|
+
color: "color.gray.500"
|
|
7286
|
+
}, "Total"), /*#__PURE__*/React__default.createElement(Text, {
|
|
7287
|
+
fontWeight: "medium"
|
|
7288
|
+
}, total.toLocaleString())), remainingShare !== null && (/*#__PURE__*/React__default.createElement(appStudio.View, {
|
|
7289
|
+
marginTop: "4px",
|
|
7290
|
+
display: "flex",
|
|
7291
|
+
justifyContent: "space-between"
|
|
7292
|
+
}, /*#__PURE__*/React__default.createElement(Text, {
|
|
7293
|
+
color: "color.gray.500"
|
|
7294
|
+
}, "Remaining"), /*#__PURE__*/React__default.createElement(Text, {
|
|
7295
|
+
fontWeight: "medium"
|
|
7296
|
+
}, remainingShare.toFixed(1) + "%")))));
|
|
7022
7297
|
// Use intelligent positioning based on useElementPosition relation data
|
|
7023
7298
|
var x = e.clientX;
|
|
7024
7299
|
var y = e.clientY;
|
|
@@ -7058,14 +7333,97 @@ var PieChart = _ref => {
|
|
|
7058
7333
|
dominantBaseline: "middle",
|
|
7059
7334
|
fill: "white",
|
|
7060
7335
|
fontWeight: "bold",
|
|
7061
|
-
pointerEvents: "none"
|
|
7336
|
+
pointerEvents: "none",
|
|
7337
|
+
style: {
|
|
7338
|
+
textShadow: '0 2px 4px rgba(0, 0, 0, 0.5), 0 1px 2px rgba(0, 0, 0, 0.3)',
|
|
7339
|
+
filter: 'drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5))'
|
|
7340
|
+
}
|
|
7062
7341
|
}, slice.percentage)));
|
|
7063
|
-
})
|
|
7064
|
-
|
|
7065
|
-
|
|
7066
|
-
|
|
7067
|
-
|
|
7068
|
-
|
|
7342
|
+
}));
|
|
7343
|
+
};
|
|
7344
|
+
|
|
7345
|
+
var ChartTooltip = _ref => {
|
|
7346
|
+
var {
|
|
7347
|
+
visible,
|
|
7348
|
+
x,
|
|
7349
|
+
y,
|
|
7350
|
+
content,
|
|
7351
|
+
maxDistance = 100,
|
|
7352
|
+
views
|
|
7353
|
+
} = _ref;
|
|
7354
|
+
var tooltipRef = React.useRef(null);
|
|
7355
|
+
var [position, setPosition] = React.useState({
|
|
7356
|
+
left: 0,
|
|
7357
|
+
top: 0
|
|
7358
|
+
});
|
|
7359
|
+
React.useEffect(() => {
|
|
7360
|
+
if (!visible || !tooltipRef.current) return;
|
|
7361
|
+
var tooltip = tooltipRef.current;
|
|
7362
|
+
var tooltipRect = tooltip.getBoundingClientRect();
|
|
7363
|
+
var tooltipWidth = tooltipRect.width;
|
|
7364
|
+
var tooltipHeight = tooltipRect.height;
|
|
7365
|
+
var viewportOffset = 10;
|
|
7366
|
+
var cursorOffset = 15;
|
|
7367
|
+
// Start position: top-left corner near cursor
|
|
7368
|
+
var left = x - cursorOffset;
|
|
7369
|
+
var top = y - cursorOffset;
|
|
7370
|
+
// Calculate the distance from cursor to tooltip edges
|
|
7371
|
+
var distanceX = x - left; // Distance from cursor to left edge
|
|
7372
|
+
var distanceY = y - top; // Distance from cursor to top edge
|
|
7373
|
+
// If tooltip would be too far on X axis, adjust it
|
|
7374
|
+
if (distanceX > maxDistance) {
|
|
7375
|
+
left = x - maxDistance;
|
|
7376
|
+
}
|
|
7377
|
+
// If tooltip would be too far on Y axis, adjust it
|
|
7378
|
+
if (distanceY > maxDistance) {
|
|
7379
|
+
top = y - maxDistance;
|
|
7380
|
+
}
|
|
7381
|
+
// Ensure tooltip doesn't go off the right edge of viewport
|
|
7382
|
+
if (left + tooltipWidth > window.innerWidth - viewportOffset) {
|
|
7383
|
+
left = window.innerWidth - tooltipWidth - viewportOffset;
|
|
7384
|
+
// Still respect max distance constraint
|
|
7385
|
+
if (x - left > maxDistance) {
|
|
7386
|
+
left = x - maxDistance;
|
|
7387
|
+
}
|
|
7388
|
+
}
|
|
7389
|
+
// Ensure tooltip doesn't go off the left edge of viewport
|
|
7390
|
+
if (left < viewportOffset) {
|
|
7391
|
+
left = viewportOffset;
|
|
7392
|
+
}
|
|
7393
|
+
// Ensure tooltip doesn't go off the bottom edge of viewport
|
|
7394
|
+
if (top + tooltipHeight > window.innerHeight - viewportOffset) {
|
|
7395
|
+
top = window.innerHeight - tooltipHeight - viewportOffset;
|
|
7396
|
+
// Still respect max distance constraint
|
|
7397
|
+
if (y - top > maxDistance) {
|
|
7398
|
+
top = y - maxDistance;
|
|
7399
|
+
}
|
|
7400
|
+
}
|
|
7401
|
+
// Ensure tooltip doesn't go off the top edge of viewport
|
|
7402
|
+
if (top < viewportOffset) {
|
|
7403
|
+
top = viewportOffset;
|
|
7404
|
+
}
|
|
7405
|
+
setPosition({
|
|
7406
|
+
left,
|
|
7407
|
+
top
|
|
7408
|
+
});
|
|
7409
|
+
}, [visible, x, y, maxDistance]);
|
|
7410
|
+
if (!visible) return null;
|
|
7411
|
+
return /*#__PURE__*/React__default.createElement(appStudio.View, Object.assign({
|
|
7412
|
+
ref: tooltipRef,
|
|
7413
|
+
position: "fixed",
|
|
7414
|
+
left: position.left + "px",
|
|
7415
|
+
top: position.top + "px",
|
|
7416
|
+
backgroundColor: "color.white",
|
|
7417
|
+
padding: "12px 16px",
|
|
7418
|
+
borderRadius: "8px",
|
|
7419
|
+
boxShadow: "0px 12px 24px rgba(15, 23, 42, 0.18)",
|
|
7420
|
+
border: "1px solid color.gray.200",
|
|
7421
|
+
fontSize: "14px",
|
|
7422
|
+
display: "flex",
|
|
7423
|
+
flexDirection: "column",
|
|
7424
|
+
pointerEvents: "none",
|
|
7425
|
+
zIndex: 10
|
|
7426
|
+
}, views == null ? void 0 : views.tooltip), content);
|
|
7069
7427
|
};
|
|
7070
7428
|
|
|
7071
7429
|
var _excluded$h = ["type", "data", "dataPoints", "title", "showLegend", "legendPosition", "showGrid", "showTooltips", "animated", "animationDuration", "responsive", "aspectRatio", "width", "height", "views", "onDataPointClick", "onSeriesClick", "isLoading", "error", "noData", "loadingIndicator", "errorIndicator", "noDataIndicator", "aria-label", "themeMode"];
|
|
@@ -7196,15 +7554,6 @@ var ChartView = _ref => {
|
|
|
7196
7554
|
return null;
|
|
7197
7555
|
}
|
|
7198
7556
|
};
|
|
7199
|
-
// Render tooltip
|
|
7200
|
-
var renderTooltip = () => {
|
|
7201
|
-
if (!showTooltips || !tooltip.visible) return null;
|
|
7202
|
-
return /*#__PURE__*/React__default.createElement(appStudio.View, Object.assign({
|
|
7203
|
-
position: "fixed",
|
|
7204
|
-
left: tooltip.x + "px",
|
|
7205
|
-
top: tooltip.y - 40 + "px"
|
|
7206
|
-
}, TooltipStyles, views == null ? void 0 : views.tooltip), tooltip.content);
|
|
7207
|
-
};
|
|
7208
7557
|
// Default loading indicator
|
|
7209
7558
|
var renderLoadingIndicator = () => {
|
|
7210
7559
|
if (!isLoading) return null;
|
|
@@ -7237,7 +7586,14 @@ var ChartView = _ref => {
|
|
|
7237
7586
|
flex: 1,
|
|
7238
7587
|
width: "100%",
|
|
7239
7588
|
position: "relative"
|
|
7240
|
-
}, views == null ? void 0 : views.chart), showChartContent && renderChart(), renderLoadingIndicator(), renderErrorIndicator(), renderNoDataIndicator()), showChartContent && legendPosition === 'bottom' && renderLegend(),
|
|
7589
|
+
}, views == null ? void 0 : views.chart), showChartContent && renderChart(), renderLoadingIndicator(), renderErrorIndicator(), renderNoDataIndicator()), showChartContent && legendPosition === 'bottom' && renderLegend(), /*#__PURE__*/React__default.createElement(ChartTooltip, {
|
|
7590
|
+
visible: showTooltips && tooltip.visible,
|
|
7591
|
+
x: tooltip.x,
|
|
7592
|
+
y: tooltip.y,
|
|
7593
|
+
content: tooltip.content,
|
|
7594
|
+
maxDistance: 100,
|
|
7595
|
+
views: views
|
|
7596
|
+
}));
|
|
7241
7597
|
};
|
|
7242
7598
|
|
|
7243
7599
|
/**
|
|
@@ -7249,6 +7605,9 @@ var ChartComponent = props => {
|
|
|
7249
7605
|
};
|
|
7250
7606
|
var Chart = ChartComponent;
|
|
7251
7607
|
|
|
7608
|
+
var cloneColumns = inputColumns => inputColumns.map(column => Object.assign({}, column, {
|
|
7609
|
+
cards: [...column.cards]
|
|
7610
|
+
}));
|
|
7252
7611
|
var useKanbanBoardState = _ref => {
|
|
7253
7612
|
var {
|
|
7254
7613
|
columns: initialColumns,
|
|
@@ -7256,20 +7615,26 @@ var useKanbanBoardState = _ref => {
|
|
|
7256
7615
|
} = _ref;
|
|
7257
7616
|
var [columns, setColumns] = React.useState(initialColumns);
|
|
7258
7617
|
var [draggedCardId, setDraggedCardId] = React.useState(null);
|
|
7618
|
+
var [hoveredColumnId, setHoveredColumnId] = React.useState(null);
|
|
7259
7619
|
var dragStateRef = React.useRef(null);
|
|
7620
|
+
var originalColumnsRef = React.useRef(null);
|
|
7621
|
+
var dropCommittedRef = React.useRef(false);
|
|
7622
|
+
var getRelativeDropPosition = React.useCallback(event => {
|
|
7623
|
+
var rect = event.currentTarget.getBoundingClientRect();
|
|
7624
|
+
var offset = event.clientY - rect.top;
|
|
7625
|
+
return offset < rect.height / 2 ? 'before' : 'after';
|
|
7626
|
+
}, []);
|
|
7260
7627
|
React.useEffect(() => {
|
|
7261
7628
|
setColumns(initialColumns);
|
|
7262
7629
|
}, [initialColumns]);
|
|
7263
|
-
var
|
|
7630
|
+
var applyMove = React.useCallback((targetColumnId, targetCardId, position, options) => {
|
|
7264
7631
|
var dragState = dragStateRef.current;
|
|
7265
7632
|
if (!dragState) return;
|
|
7266
7633
|
var {
|
|
7267
7634
|
columnId: sourceColumnId,
|
|
7268
7635
|
cardId
|
|
7269
7636
|
} = dragState;
|
|
7270
|
-
if (targetColumnId === sourceColumnId &&
|
|
7271
|
-
dragStateRef.current = null;
|
|
7272
|
-
setDraggedCardId(null);
|
|
7637
|
+
if (targetColumnId === sourceColumnId && targetCardId === cardId) {
|
|
7273
7638
|
return;
|
|
7274
7639
|
}
|
|
7275
7640
|
setColumns(prevColumns => {
|
|
@@ -7281,36 +7646,60 @@ var useKanbanBoardState = _ref => {
|
|
|
7281
7646
|
if (!sourceColumn || !targetColumn) {
|
|
7282
7647
|
return prevColumns;
|
|
7283
7648
|
}
|
|
7284
|
-
var sourceIndex = sourceColumn.cards.findIndex(
|
|
7649
|
+
var sourceIndex = sourceColumn.cards.findIndex(cardItem => cardItem.id === cardId);
|
|
7285
7650
|
if (sourceIndex === -1) {
|
|
7286
7651
|
return prevColumns;
|
|
7287
7652
|
}
|
|
7288
7653
|
var [card] = sourceColumn.cards.splice(sourceIndex, 1);
|
|
7289
|
-
var
|
|
7654
|
+
var dropPosition = position != null ? position : 'after';
|
|
7655
|
+
var targetIndex;
|
|
7290
7656
|
if (targetCardId) {
|
|
7291
7657
|
var foundIndex = targetColumn.cards.findIndex(item => item.id === targetCardId);
|
|
7292
7658
|
if (foundIndex !== -1) {
|
|
7293
|
-
targetIndex = foundIndex;
|
|
7294
|
-
|
|
7295
|
-
|
|
7296
|
-
}
|
|
7659
|
+
targetIndex = dropPosition === 'before' ? foundIndex : foundIndex + 1;
|
|
7660
|
+
} else {
|
|
7661
|
+
targetIndex = targetColumn.cards.length;
|
|
7297
7662
|
}
|
|
7663
|
+
} else {
|
|
7664
|
+
targetIndex = dropPosition === 'before' ? 0 : targetColumn.cards.length;
|
|
7298
7665
|
}
|
|
7299
7666
|
targetColumn.cards.splice(targetIndex, 0, card);
|
|
7667
|
+
var hasChanged = workingColumns.some((column, columnIndex) => {
|
|
7668
|
+
var previousColumn = prevColumns[columnIndex];
|
|
7669
|
+
if (!previousColumn) {
|
|
7670
|
+
return true;
|
|
7671
|
+
}
|
|
7672
|
+
if (column.cards.length !== previousColumn.cards.length) {
|
|
7673
|
+
return true;
|
|
7674
|
+
}
|
|
7675
|
+
return column.cards.some((currentCard, cardIndex) => {
|
|
7676
|
+
var _previousColumn$cards;
|
|
7677
|
+
return currentCard.id !== ((_previousColumn$cards = previousColumn.cards[cardIndex]) == null ? void 0 : _previousColumn$cards.id);
|
|
7678
|
+
});
|
|
7679
|
+
});
|
|
7680
|
+
if (!hasChanged) {
|
|
7681
|
+
return prevColumns;
|
|
7682
|
+
}
|
|
7300
7683
|
var updatedColumns = workingColumns.map(column => Object.assign({}, column, {
|
|
7301
7684
|
cards: [...column.cards]
|
|
7302
7685
|
}));
|
|
7303
|
-
|
|
7686
|
+
dragStateRef.current = {
|
|
7687
|
+
columnId: targetColumnId,
|
|
7688
|
+
cardId
|
|
7689
|
+
};
|
|
7690
|
+
if (options != null && options.shouldCommit) {
|
|
7691
|
+
onChange == null || onChange(updatedColumns);
|
|
7692
|
+
}
|
|
7304
7693
|
return updatedColumns;
|
|
7305
7694
|
});
|
|
7306
|
-
dragStateRef.current = null;
|
|
7307
|
-
setDraggedCardId(null);
|
|
7308
7695
|
}, [onChange]);
|
|
7309
7696
|
var handleCardDragStart = React.useCallback((columnId, cardId, event) => {
|
|
7310
7697
|
dragStateRef.current = {
|
|
7311
7698
|
columnId,
|
|
7312
7699
|
cardId
|
|
7313
7700
|
};
|
|
7701
|
+
originalColumnsRef.current = cloneColumns(columns);
|
|
7702
|
+
dropCommittedRef.current = false;
|
|
7314
7703
|
setDraggedCardId(cardId);
|
|
7315
7704
|
if (event.dataTransfer) {
|
|
7316
7705
|
event.dataTransfer.effectAllowed = 'move';
|
|
@@ -7320,35 +7709,52 @@ var useKanbanBoardState = _ref => {
|
|
|
7320
7709
|
// Ignore errors from browsers that disallow setting data
|
|
7321
7710
|
}
|
|
7322
7711
|
}
|
|
7323
|
-
}, []);
|
|
7712
|
+
}, [columns]);
|
|
7324
7713
|
var handleCardDragEnd = React.useCallback(() => {
|
|
7714
|
+
if (!dropCommittedRef.current && originalColumnsRef.current) {
|
|
7715
|
+
setColumns(cloneColumns(originalColumnsRef.current));
|
|
7716
|
+
}
|
|
7325
7717
|
dragStateRef.current = null;
|
|
7718
|
+
originalColumnsRef.current = null;
|
|
7719
|
+
dropCommittedRef.current = false;
|
|
7326
7720
|
setDraggedCardId(null);
|
|
7721
|
+
setHoveredColumnId(null);
|
|
7327
7722
|
}, []);
|
|
7328
|
-
var handleColumnDragOver = React.useCallback((
|
|
7723
|
+
var handleColumnDragOver = React.useCallback((columnId, event) => {
|
|
7329
7724
|
event.preventDefault();
|
|
7330
7725
|
if (event.dataTransfer) {
|
|
7331
7726
|
event.dataTransfer.dropEffect = 'move';
|
|
7332
7727
|
}
|
|
7333
|
-
|
|
7334
|
-
|
|
7728
|
+
setHoveredColumnId(columnId);
|
|
7729
|
+
applyMove(columnId, null, getRelativeDropPosition(event));
|
|
7730
|
+
}, [applyMove, getRelativeDropPosition]);
|
|
7731
|
+
var handleCardDragOver = React.useCallback((columnId, cardId, event) => {
|
|
7335
7732
|
event.preventDefault();
|
|
7336
7733
|
if (event.dataTransfer) {
|
|
7337
7734
|
event.dataTransfer.dropEffect = 'move';
|
|
7338
7735
|
}
|
|
7339
|
-
|
|
7736
|
+
setHoveredColumnId(columnId);
|
|
7737
|
+
applyMove(columnId, cardId, getRelativeDropPosition(event));
|
|
7738
|
+
}, [applyMove, getRelativeDropPosition]);
|
|
7340
7739
|
var handleColumnDrop = React.useCallback((columnId, event) => {
|
|
7341
7740
|
event.preventDefault();
|
|
7342
|
-
|
|
7343
|
-
|
|
7741
|
+
dropCommittedRef.current = true;
|
|
7742
|
+
applyMove(columnId, null, getRelativeDropPosition(event), {
|
|
7743
|
+
shouldCommit: true
|
|
7744
|
+
});
|
|
7745
|
+
}, [applyMove, getRelativeDropPosition]);
|
|
7344
7746
|
var handleCardDrop = React.useCallback((columnId, cardId, event) => {
|
|
7345
7747
|
event.preventDefault();
|
|
7346
7748
|
event.stopPropagation();
|
|
7347
|
-
|
|
7348
|
-
|
|
7749
|
+
dropCommittedRef.current = true;
|
|
7750
|
+
applyMove(columnId, cardId, getRelativeDropPosition(event), {
|
|
7751
|
+
shouldCommit: true
|
|
7752
|
+
});
|
|
7753
|
+
}, [applyMove, getRelativeDropPosition]);
|
|
7349
7754
|
return {
|
|
7350
7755
|
columns,
|
|
7351
7756
|
draggedCardId,
|
|
7757
|
+
hoveredColumnId,
|
|
7352
7758
|
onCardDragStart: handleCardDragStart,
|
|
7353
7759
|
onCardDragEnd: handleCardDragEnd,
|
|
7354
7760
|
onColumnDragOver: handleColumnDragOver,
|
|
@@ -7366,6 +7772,7 @@ var KanbanBoardView = _ref => {
|
|
|
7366
7772
|
renderEmptyState,
|
|
7367
7773
|
views,
|
|
7368
7774
|
draggedCardId,
|
|
7775
|
+
hoveredColumnId,
|
|
7369
7776
|
onCardDragStart,
|
|
7370
7777
|
onCardDragEnd,
|
|
7371
7778
|
onColumnDragOver,
|
|
@@ -7410,7 +7817,9 @@ var KanbanBoardView = _ref => {
|
|
|
7410
7817
|
gap: 12,
|
|
7411
7818
|
minHeight: 40,
|
|
7412
7819
|
onDragOver: event => onColumnDragOver(column.id, event),
|
|
7413
|
-
onDrop: event => onColumnDrop(column.id, event)
|
|
7820
|
+
onDrop: event => onColumnDrop(column.id, event),
|
|
7821
|
+
opacity: draggedCardId && hoveredColumnId === column.id ? 0.9 : undefined,
|
|
7822
|
+
transition: "all 0.15s ease-in-out"
|
|
7414
7823
|
}, views == null ? void 0 : views.columnBody), column.cards.length === 0 && (/*#__PURE__*/React__default.createElement(appStudio.View, Object.assign({
|
|
7415
7824
|
padding: 12,
|
|
7416
7825
|
borderWidth: "1px",
|
|
@@ -7424,20 +7833,27 @@ var KanbanBoardView = _ref => {
|
|
|
7424
7833
|
}, views == null ? void 0 : views.emptyState), renderEmptyState ? renderEmptyState(column) : (/*#__PURE__*/React__default.createElement(Text, {
|
|
7425
7834
|
size: "sm",
|
|
7426
7835
|
color: "#667085"
|
|
7427
|
-
}, "Drop cards here")))), column.cards.map(card => (/*#__PURE__*/React__default.createElement(appStudio.View,
|
|
7836
|
+
}, "Drop cards here")))), column.cards.map(card => (/*#__PURE__*/React__default.createElement(appStudio.View, {
|
|
7428
7837
|
key: card.id,
|
|
7838
|
+
position: "relative"
|
|
7839
|
+
}, /*#__PURE__*/React__default.createElement(appStudio.View, Object.assign({
|
|
7429
7840
|
draggable: true,
|
|
7430
7841
|
cursor: "grab",
|
|
7431
7842
|
backgroundColor: "#ffffff",
|
|
7432
7843
|
borderRadius: 10,
|
|
7433
7844
|
padding: "12px",
|
|
7434
7845
|
boxShadow: "0 1px 2px 0 rgba(16, 24, 40, 0.08)",
|
|
7435
|
-
opacity: draggedCardId === card.id ? 0.6 : 1,
|
|
7436
7846
|
onDragStart: event => onCardDragStart(column.id, card.id, event),
|
|
7437
7847
|
onDragEnd: onCardDragEnd,
|
|
7438
|
-
onDragOver: event =>
|
|
7439
|
-
|
|
7440
|
-
|
|
7848
|
+
onDragOver: event => {
|
|
7849
|
+
event.stopPropagation();
|
|
7850
|
+
onCardDragOver(column.id, card.id, event);
|
|
7851
|
+
},
|
|
7852
|
+
onDrop: event => {
|
|
7853
|
+
event.stopPropagation();
|
|
7854
|
+
onCardDrop(column.id, card.id, event);
|
|
7855
|
+
}
|
|
7856
|
+
}, views == null ? void 0 : views.card), renderCard ? renderCard(card, column) : renderDefaultCard(card)))))), column.footer && (/*#__PURE__*/React__default.createElement(appStudio.View, Object.assign({}, views == null ? void 0 : views.columnFooter), column.footer))))));
|
|
7441
7857
|
};
|
|
7442
7858
|
|
|
7443
7859
|
var KanbanBoardComponent = props => {
|
|
@@ -7446,734 +7862,1038 @@ var KanbanBoardComponent = props => {
|
|
|
7446
7862
|
};
|
|
7447
7863
|
var KanbanBoard = KanbanBoardComponent;
|
|
7448
7864
|
|
|
7449
|
-
|
|
7450
|
-
|
|
7451
|
-
|
|
7452
|
-
|
|
7453
|
-
|
|
7454
|
-
closeDelay = 300
|
|
7455
|
-
} = _temp === void 0 ? {} : _temp;
|
|
7456
|
-
var [isOpen, setIsOpen] = React.useState(false);
|
|
7457
|
-
var openTimerRef = React.useRef(null);
|
|
7458
|
-
var closeTimerRef = React.useRef(null);
|
|
7459
|
-
// Refs for trigger and content elements for positioning
|
|
7460
|
-
var triggerRef = React.useRef(null);
|
|
7461
|
-
var contentRef = React.useRef(null);
|
|
7462
|
-
// Unique IDs for ARIA attributes
|
|
7463
|
-
var contentId = React.useMemo(() => generateId$1('hovercard-content'), []);
|
|
7464
|
-
var triggerId = React.useMemo(() => generateId$1('hovercard-trigger'), []);
|
|
7465
|
-
var clearTimers = React.useCallback(() => {
|
|
7466
|
-
if (openTimerRef.current) {
|
|
7467
|
-
clearTimeout(openTimerRef.current);
|
|
7468
|
-
openTimerRef.current = null;
|
|
7469
|
-
}
|
|
7470
|
-
if (closeTimerRef.current) {
|
|
7471
|
-
clearTimeout(closeTimerRef.current);
|
|
7472
|
-
closeTimerRef.current = null;
|
|
7473
|
-
}
|
|
7474
|
-
}, []);
|
|
7475
|
-
var openCard = React.useCallback(() => {
|
|
7476
|
-
clearTimers(); // Clear any pending close
|
|
7477
|
-
if (!isOpen) {
|
|
7478
|
-
openTimerRef.current = setTimeout(() => {
|
|
7479
|
-
setIsOpen(true);
|
|
7480
|
-
}, openDelay);
|
|
7481
|
-
}
|
|
7482
|
-
}, [isOpen, openDelay, clearTimers]);
|
|
7483
|
-
var closeCard = React.useCallback(() => {
|
|
7484
|
-
clearTimers(); // Clear any pending open
|
|
7485
|
-
if (isOpen) {
|
|
7486
|
-
closeTimerRef.current = setTimeout(() => {
|
|
7487
|
-
setIsOpen(false);
|
|
7488
|
-
}, closeDelay);
|
|
7489
|
-
}
|
|
7490
|
-
}, [isOpen, closeDelay, clearTimers]);
|
|
7491
|
-
// Function specifically to cancel the close timer (e.g., when mouse enters content)
|
|
7492
|
-
var cancelCloseTimer = React.useCallback(() => {
|
|
7493
|
-
if (closeTimerRef.current) {
|
|
7494
|
-
clearTimeout(closeTimerRef.current);
|
|
7495
|
-
closeTimerRef.current = null;
|
|
7496
|
-
}
|
|
7497
|
-
}, []);
|
|
7498
|
-
// Cleanup timers on unmount
|
|
7499
|
-
React.useEffect(() => {
|
|
7500
|
-
return () => clearTimers();
|
|
7501
|
-
}, [clearTimers]);
|
|
7502
|
-
return {
|
|
7503
|
-
isOpen,
|
|
7504
|
-
openCard,
|
|
7505
|
-
closeCard,
|
|
7506
|
-
cancelCloseTimer,
|
|
7507
|
-
triggerRef,
|
|
7508
|
-
contentRef,
|
|
7509
|
-
contentId,
|
|
7510
|
-
triggerId
|
|
7511
|
-
};
|
|
7865
|
+
/**
|
|
7866
|
+
* Convert an ISO date string to a UTC Date object
|
|
7867
|
+
*/
|
|
7868
|
+
var dateUTC = iso => {
|
|
7869
|
+
return new Date(iso + (iso.includes('T') ? '' : 'T00:00:00Z'));
|
|
7512
7870
|
};
|
|
7513
|
-
|
|
7514
|
-
|
|
7515
|
-
|
|
7516
|
-
|
|
7517
|
-
|
|
7518
|
-
isOpen: false,
|
|
7519
|
-
openCard: () => {},
|
|
7520
|
-
closeCard: () => {},
|
|
7521
|
-
cancelCloseTimer: () => {},
|
|
7522
|
-
triggerRef: {
|
|
7523
|
-
current: null
|
|
7524
|
-
},
|
|
7525
|
-
contentRef: {
|
|
7526
|
-
current: null
|
|
7527
|
-
},
|
|
7528
|
-
contentId: '',
|
|
7529
|
-
triggerId: ''
|
|
7530
|
-
});
|
|
7531
|
-
var HoverCardProvider = _ref => {
|
|
7532
|
-
var {
|
|
7533
|
-
children,
|
|
7534
|
-
value
|
|
7535
|
-
} = _ref;
|
|
7536
|
-
return /*#__PURE__*/React__default.createElement(HoverCardContext.Provider, {
|
|
7537
|
-
value: value
|
|
7538
|
-
}, children);
|
|
7871
|
+
/**
|
|
7872
|
+
* Calculate the number of days between two ISO date strings
|
|
7873
|
+
*/
|
|
7874
|
+
var daysBetweenUTC = (a, b) => {
|
|
7875
|
+
return Math.floor((dateUTC(a).getTime() - dateUTC(b).getTime()) / 86400000);
|
|
7539
7876
|
};
|
|
7540
|
-
|
|
7541
|
-
|
|
7542
|
-
|
|
7543
|
-
|
|
7544
|
-
|
|
7545
|
-
|
|
7877
|
+
/**
|
|
7878
|
+
* Add a number of days to an ISO date string
|
|
7879
|
+
*/
|
|
7880
|
+
var addDateDays = (dateISO, days) => {
|
|
7881
|
+
var d = new Date(dateISO + 'T00:00:00Z');
|
|
7882
|
+
d.setUTCDate(d.getUTCDate() + days);
|
|
7883
|
+
return d.toISOString().slice(0, 10);
|
|
7546
7884
|
};
|
|
7547
|
-
|
|
7548
|
-
|
|
7549
|
-
|
|
7550
|
-
|
|
7551
|
-
|
|
7552
|
-
} = _ref2,
|
|
7553
|
-
props = _objectWithoutPropertiesLoose(_ref2, _excluded$i);
|
|
7554
|
-
var {
|
|
7555
|
-
openCard,
|
|
7556
|
-
closeCard,
|
|
7557
|
-
triggerRef,
|
|
7558
|
-
contentId,
|
|
7559
|
-
triggerId
|
|
7560
|
-
} = useHoverCardContext();
|
|
7561
|
-
var handleMouseEnter = () => openCard();
|
|
7562
|
-
var handleMouseLeave = () => closeCard();
|
|
7563
|
-
var handleFocus = () => openCard(); // For keyboard accessibility
|
|
7564
|
-
var handleBlur = () => closeCard(); // For keyboard accessibility
|
|
7565
|
-
var triggerProps = Object.assign({
|
|
7566
|
-
ref: triggerRef,
|
|
7567
|
-
onMouseEnter: handleMouseEnter,
|
|
7568
|
-
onMouseLeave: handleMouseLeave,
|
|
7569
|
-
onFocus: handleFocus,
|
|
7570
|
-
onBlur: handleBlur,
|
|
7571
|
-
id: triggerId,
|
|
7572
|
-
'aria-describedby': contentId
|
|
7573
|
-
}, views == null ? void 0 : views.container, props);
|
|
7574
|
-
if (asChild && /*#__PURE__*/React.isValidElement(children)) {
|
|
7575
|
-
// Clone the child element and merge props
|
|
7576
|
-
var child = React.Children.only(children);
|
|
7577
|
-
return /*#__PURE__*/React.cloneElement(child, Object.assign({}, triggerProps, child.props));
|
|
7578
|
-
}
|
|
7579
|
-
// Default: wrap children in a View
|
|
7580
|
-
return /*#__PURE__*/React__default.createElement(appStudio.View, Object.assign({
|
|
7581
|
-
position: "relative",
|
|
7582
|
-
display: "inline-block"
|
|
7583
|
-
}, triggerProps), children);
|
|
7885
|
+
/**
|
|
7886
|
+
* Get the day of the week (0-6) from an ISO date string
|
|
7887
|
+
*/
|
|
7888
|
+
var getDayOfWeek = dateISO => {
|
|
7889
|
+
return dateUTC(dateISO).getUTCDay();
|
|
7584
7890
|
};
|
|
7585
|
-
|
|
7586
|
-
|
|
7587
|
-
|
|
7588
|
-
|
|
7589
|
-
|
|
7590
|
-
align = 'center',
|
|
7591
|
-
sideOffset = 8,
|
|
7592
|
-
style: userStyle,
|
|
7593
|
-
// User provided style override
|
|
7594
|
-
backgroundColor = 'white',
|
|
7595
|
-
borderRadius = '4px',
|
|
7596
|
-
boxShadow = '0px 2px 8px rgba(0, 0, 0, 0.15)',
|
|
7597
|
-
padding = '12px',
|
|
7598
|
-
minWidth = '50px',
|
|
7599
|
-
maxWidth = '300px'
|
|
7600
|
-
} = _ref3,
|
|
7601
|
-
props = _objectWithoutPropertiesLoose(_ref3, _excluded2$6);
|
|
7602
|
-
var {
|
|
7603
|
-
isOpen,
|
|
7604
|
-
cancelCloseTimer,
|
|
7605
|
-
closeCard,
|
|
7606
|
-
contentRef,
|
|
7607
|
-
triggerRef,
|
|
7608
|
-
contentId,
|
|
7609
|
-
triggerId
|
|
7610
|
-
} = useHoverCardContext();
|
|
7611
|
-
// Use useElementPosition for intelligent positioning
|
|
7612
|
-
var {
|
|
7613
|
-
ref: positionRef,
|
|
7614
|
-
relation
|
|
7615
|
-
} = appStudio.useElementPosition({
|
|
7616
|
-
trackChanges: true,
|
|
7617
|
-
trackOnHover: true,
|
|
7618
|
-
trackOnScroll: true,
|
|
7619
|
-
trackOnResize: true
|
|
7620
|
-
});
|
|
7621
|
-
// Sync the position ref with the trigger ref for positioning calculations
|
|
7622
|
-
React.useEffect(() => {
|
|
7623
|
-
if (triggerRef != null && triggerRef.current && (positionRef == null ? void 0 : positionRef.current) !== triggerRef.current) {
|
|
7624
|
-
// Update the position tracking to use the trigger element
|
|
7625
|
-
if (positionRef) {
|
|
7626
|
-
positionRef.current = triggerRef.current;
|
|
7627
|
-
}
|
|
7628
|
-
}
|
|
7629
|
-
}, [triggerRef, positionRef, isOpen]);
|
|
7630
|
-
var handleMouseEnter = () => cancelCloseTimer(); // Keep card open if mouse enters content
|
|
7631
|
-
var handleMouseLeave = () => closeCard();
|
|
7632
|
-
if (!isOpen) {
|
|
7633
|
-
return null; // Don't render content if not open
|
|
7634
|
-
}
|
|
7635
|
-
// Create intelligent positioning styles based on useElementPosition relation data
|
|
7636
|
-
var getPositionStyles = () => {
|
|
7637
|
-
if (!relation || !(triggerRef != null && triggerRef.current)) {
|
|
7638
|
-
// Fallback positioning if relation data is not available
|
|
7639
|
-
return {
|
|
7640
|
-
position: 'absolute',
|
|
7641
|
-
top: 0,
|
|
7642
|
-
left: 0,
|
|
7643
|
-
zIndex: 1000
|
|
7644
|
-
};
|
|
7645
|
-
}
|
|
7646
|
-
var triggerRect = triggerRef.current.getBoundingClientRect();
|
|
7647
|
-
var placement = side;
|
|
7648
|
-
// Use relation data to determine optimal placement
|
|
7649
|
-
// If preferred side doesn't have enough space, use the side with more space
|
|
7650
|
-
if (side === 'bottom' && relation.space.vertical === 'top') {
|
|
7651
|
-
placement = 'top';
|
|
7652
|
-
} else if (side === 'top' && relation.space.vertical === 'bottom') {
|
|
7653
|
-
placement = 'bottom';
|
|
7654
|
-
} else if (side === 'right' && relation.space.horizontal === 'left') {
|
|
7655
|
-
placement = 'left';
|
|
7656
|
-
} else if (side === 'left' && relation.space.horizontal === 'right') {
|
|
7657
|
-
placement = 'right';
|
|
7658
|
-
}
|
|
7659
|
-
// Calculate position based on optimal placement
|
|
7660
|
-
var x = 0;
|
|
7661
|
-
var y = 0;
|
|
7662
|
-
switch (placement) {
|
|
7663
|
-
case 'bottom':
|
|
7664
|
-
x = triggerRect.left + triggerRect.width / 2;
|
|
7665
|
-
y = triggerRect.bottom + sideOffset;
|
|
7666
|
-
break;
|
|
7667
|
-
case 'top':
|
|
7668
|
-
x = triggerRect.left + triggerRect.width / 2;
|
|
7669
|
-
y = triggerRect.top - sideOffset;
|
|
7670
|
-
break;
|
|
7671
|
-
case 'right':
|
|
7672
|
-
x = triggerRect.right + sideOffset;
|
|
7673
|
-
y = triggerRect.top + triggerRect.height / 2;
|
|
7674
|
-
break;
|
|
7675
|
-
case 'left':
|
|
7676
|
-
x = triggerRect.left - sideOffset;
|
|
7677
|
-
y = triggerRect.top + triggerRect.height / 2;
|
|
7678
|
-
break;
|
|
7679
|
-
}
|
|
7680
|
-
return {
|
|
7681
|
-
position: 'fixed',
|
|
7682
|
-
left: x,
|
|
7683
|
-
top: y,
|
|
7684
|
-
zIndex: 1000,
|
|
7685
|
-
transform: getTransformOrigin(placement)
|
|
7686
|
-
};
|
|
7687
|
-
};
|
|
7688
|
-
// Helper function to set transform origin for better positioning
|
|
7689
|
-
var getTransformOrigin = placement => {
|
|
7690
|
-
switch (placement) {
|
|
7691
|
-
case 'bottom':
|
|
7692
|
-
return 'translate(-50%, 0)';
|
|
7693
|
-
case 'top':
|
|
7694
|
-
return 'translate(-50%, -100%)';
|
|
7695
|
-
case 'right':
|
|
7696
|
-
return 'translate(0, -50%)';
|
|
7697
|
-
case 'left':
|
|
7698
|
-
return 'translate(-100%, -50%)';
|
|
7699
|
-
default:
|
|
7700
|
-
return 'translate(-50%, 0)';
|
|
7701
|
-
}
|
|
7702
|
-
};
|
|
7703
|
-
var positionStyles = getPositionStyles();
|
|
7704
|
-
return /*#__PURE__*/React__default.createElement(appStudio.View, Object.assign({
|
|
7705
|
-
ref: contentRef,
|
|
7706
|
-
id: contentId,
|
|
7707
|
-
role: "tooltip" // Use tooltip role for accessibility
|
|
7708
|
-
,
|
|
7709
|
-
"aria-labelledby": triggerId,
|
|
7710
|
-
onMouseEnter: handleMouseEnter,
|
|
7711
|
-
onMouseLeave: handleMouseLeave,
|
|
7712
|
-
backgroundColor: backgroundColor,
|
|
7713
|
-
borderRadius: borderRadius,
|
|
7714
|
-
boxShadow: boxShadow,
|
|
7715
|
-
padding: padding,
|
|
7716
|
-
minWidth: minWidth,
|
|
7717
|
-
maxWidth: maxWidth,
|
|
7718
|
-
// Combine intelligent position styles with user styles
|
|
7719
|
-
style: Object.assign({}, positionStyles, userStyle)
|
|
7720
|
-
}, views == null ? void 0 : views.container, props), children);
|
|
7891
|
+
/**
|
|
7892
|
+
* Get the date number (1-31) from an ISO date string
|
|
7893
|
+
*/
|
|
7894
|
+
var getDateNumber = dateISO => {
|
|
7895
|
+
return dateUTC(dateISO).getUTCDate();
|
|
7721
7896
|
};
|
|
7722
|
-
|
|
7723
|
-
var _excluded$j = ["children", "views", "openDelay", "closeDelay"];
|
|
7724
7897
|
/**
|
|
7725
|
-
*
|
|
7726
|
-
* Supports configurable open and close delays for a smoother user experience.
|
|
7898
|
+
* Get the month (0-11) from an ISO date string
|
|
7727
7899
|
*/
|
|
7728
|
-
var
|
|
7729
|
-
|
|
7730
|
-
children,
|
|
7731
|
-
views,
|
|
7732
|
-
openDelay,
|
|
7733
|
-
closeDelay
|
|
7734
|
-
} = _ref,
|
|
7735
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$j);
|
|
7736
|
-
var hoverCardState = useHoverCardState({
|
|
7737
|
-
openDelay,
|
|
7738
|
-
closeDelay
|
|
7739
|
-
});
|
|
7740
|
-
return /*#__PURE__*/React__default.createElement(HoverCardProvider, {
|
|
7741
|
-
value: hoverCardState
|
|
7742
|
-
}, /*#__PURE__*/React__default.createElement(appStudio.View, Object.assign({
|
|
7743
|
-
position: "relative",
|
|
7744
|
-
display: "inline-block"
|
|
7745
|
-
}, views == null ? void 0 : views.container, props), children));
|
|
7900
|
+
var getMonth = dateISO => {
|
|
7901
|
+
return dateUTC(dateISO).getUTCMonth();
|
|
7746
7902
|
};
|
|
7747
|
-
|
|
7748
|
-
|
|
7749
|
-
|
|
7750
|
-
|
|
7751
|
-
|
|
7752
|
-
|
|
7753
|
-
|
|
7903
|
+
/**
|
|
7904
|
+
* Get the year from an ISO date string
|
|
7905
|
+
*/
|
|
7906
|
+
var getYear = dateISO => {
|
|
7907
|
+
return dateUTC(dateISO).getUTCFullYear();
|
|
7908
|
+
};
|
|
7909
|
+
/**
|
|
7910
|
+
* Get the first day of the month for a given date
|
|
7911
|
+
*/
|
|
7912
|
+
var getFirstDayOfMonth = dateISO => {
|
|
7913
|
+
var d = dateUTC(dateISO);
|
|
7914
|
+
return new Date(Date.UTC(d.getUTCFullYear(), d.getUTCMonth(), 1)).toISOString().slice(0, 10);
|
|
7915
|
+
};
|
|
7916
|
+
/**
|
|
7917
|
+
* Get the start date of the calendar grid (may be in previous month)
|
|
7918
|
+
*/
|
|
7919
|
+
var getCalendarStartDate = function getCalendarStartDate(monthDateISO, weekStartsOn) {
|
|
7920
|
+
if (weekStartsOn === void 0) {
|
|
7921
|
+
weekStartsOn = 0;
|
|
7754
7922
|
}
|
|
7755
|
-
var
|
|
7756
|
-
|
|
7757
|
-
|
|
7923
|
+
var firstDay = getFirstDayOfMonth(monthDateISO);
|
|
7924
|
+
var firstDayOfWeek = getDayOfWeek(firstDay);
|
|
7925
|
+
var daysToSubtract = (firstDayOfWeek - weekStartsOn + 7) % 7;
|
|
7926
|
+
return addDateDays(firstDay, -daysToSubtract);
|
|
7927
|
+
};
|
|
7928
|
+
/**
|
|
7929
|
+
* Generate array of dates for the calendar grid (42 days = 6 weeks)
|
|
7930
|
+
*/
|
|
7931
|
+
var getCalendarDates = function getCalendarDates(monthDateISO, weekStartsOn) {
|
|
7932
|
+
if (weekStartsOn === void 0) {
|
|
7933
|
+
weekStartsOn = 0;
|
|
7934
|
+
}
|
|
7935
|
+
var startDate = getCalendarStartDate(monthDateISO, weekStartsOn);
|
|
7936
|
+
var dates = [];
|
|
7937
|
+
for (var i = 0; i < 42; i++) {
|
|
7938
|
+
dates.push(addDateDays(startDate, i));
|
|
7758
7939
|
}
|
|
7759
|
-
return
|
|
7760
|
-
};
|
|
7761
|
-
|
|
7762
|
-
|
|
7763
|
-
|
|
7764
|
-
|
|
7765
|
-
return
|
|
7766
|
-
|
|
7767
|
-
|
|
7940
|
+
return dates;
|
|
7941
|
+
};
|
|
7942
|
+
/**
|
|
7943
|
+
* Get month name from date
|
|
7944
|
+
*/
|
|
7945
|
+
var getMonthName = dateISO => {
|
|
7946
|
+
return dateUTC(dateISO).toLocaleDateString('en-US', {
|
|
7947
|
+
month: 'long',
|
|
7948
|
+
timeZone: 'UTC'
|
|
7768
7949
|
});
|
|
7769
7950
|
};
|
|
7770
|
-
|
|
7771
|
-
|
|
7772
|
-
|
|
7773
|
-
|
|
7774
|
-
|
|
7775
|
-
|
|
7776
|
-
return events.filter(event => {
|
|
7777
|
-
var {
|
|
7778
|
-
startDate,
|
|
7779
|
-
endDate
|
|
7780
|
-
} = event;
|
|
7781
|
-
if (dateFns.isWithinInterval(startDate, dayInterval)) {
|
|
7782
|
-
return true;
|
|
7783
|
-
}
|
|
7784
|
-
if (dateFns.isWithinInterval(endDate, dayInterval)) {
|
|
7785
|
-
return true;
|
|
7786
|
-
}
|
|
7787
|
-
return startDate <= dayInterval.start && endDate >= dayInterval.end;
|
|
7788
|
-
}).sort((a, b) => a.startDate.getTime() - b.startDate.getTime());
|
|
7951
|
+
/**
|
|
7952
|
+
* Get the previous month date
|
|
7953
|
+
*/
|
|
7954
|
+
var getPreviousMonth = dateISO => {
|
|
7955
|
+
var d = dateUTC(dateISO);
|
|
7956
|
+
return new Date(Date.UTC(d.getUTCFullYear(), d.getUTCMonth() - 1, 1)).toISOString().slice(0, 10);
|
|
7789
7957
|
};
|
|
7790
|
-
|
|
7791
|
-
|
|
7792
|
-
|
|
7793
|
-
|
|
7794
|
-
|
|
7795
|
-
return
|
|
7958
|
+
/**
|
|
7959
|
+
* Get the next month date
|
|
7960
|
+
*/
|
|
7961
|
+
var getNextMonth = dateISO => {
|
|
7962
|
+
var d = dateUTC(dateISO);
|
|
7963
|
+
return new Date(Date.UTC(d.getUTCFullYear(), d.getUTCMonth() + 1, 1)).toISOString().slice(0, 10);
|
|
7796
7964
|
};
|
|
7797
|
-
|
|
7798
|
-
|
|
7799
|
-
|
|
7800
|
-
|
|
7801
|
-
|
|
7802
|
-
|
|
7803
|
-
|
|
7804
|
-
|
|
7805
|
-
|
|
7806
|
-
|
|
7807
|
-
}
|
|
7808
|
-
var
|
|
7809
|
-
|
|
7810
|
-
var timeRange = dateFns.format(event.startDate, 'p') + (event.endDate.getTime() !== event.startDate.getTime() ? " \u2013 " + dateFns.format(event.endDate, 'p') : '');
|
|
7811
|
-
var eventCard = /*#__PURE__*/React__default.createElement(appStudio.Vertical, Object.assign({
|
|
7812
|
-
gap: 6,
|
|
7813
|
-
padding: 12,
|
|
7814
|
-
borderRadius: 8,
|
|
7815
|
-
backgroundColor: context.isToday ? 'color.primary.50' : 'color.gray.100',
|
|
7816
|
-
borderWidth: 1,
|
|
7817
|
-
borderStyle: "solid",
|
|
7818
|
-
borderColor: context.isToday ? 'color.primary.200' : 'color.gray.200',
|
|
7819
|
-
flexShrink: 0,
|
|
7820
|
-
cursor: "pointer"
|
|
7821
|
-
}, views == null ? void 0 : views.event), /*#__PURE__*/React__default.createElement(Text, Object.assign({
|
|
7822
|
-
fontWeight: "600",
|
|
7823
|
-
fontSize: 14,
|
|
7824
|
-
maxLines: 2
|
|
7825
|
-
}, views == null ? void 0 : views.eventTitle), event.title), /*#__PURE__*/React__default.createElement(Text, Object.assign({
|
|
7826
|
-
fontSize: 12,
|
|
7827
|
-
color: "color.gray.600",
|
|
7828
|
-
maxLines: 1
|
|
7829
|
-
}, views == null ? void 0 : views.eventTime), timeRange), event.description && context.view !== 'month' && (/*#__PURE__*/React__default.createElement(Text, {
|
|
7830
|
-
fontSize: 12,
|
|
7831
|
-
color: "color.gray.700",
|
|
7832
|
-
maxLines: 2
|
|
7833
|
-
}, event.description)));
|
|
7834
|
-
return /*#__PURE__*/React__default.createElement(HoverCard, {
|
|
7835
|
-
key: key,
|
|
7836
|
-
openDelay: 100,
|
|
7837
|
-
closeDelay: 200
|
|
7838
|
-
}, /*#__PURE__*/React__default.createElement(HoverCard.Trigger, {
|
|
7839
|
-
asChild: true
|
|
7840
|
-
}, eventCard), /*#__PURE__*/React__default.createElement(HoverCard.Content, {
|
|
7841
|
-
side: "top",
|
|
7842
|
-
align: "start",
|
|
7843
|
-
maxWidth: "350px",
|
|
7844
|
-
backgroundColor: "color.white",
|
|
7845
|
-
padding: 16,
|
|
7846
|
-
boxShadow: "0px 4px 12px rgba(0, 0, 0, 0.15)"
|
|
7847
|
-
}, /*#__PURE__*/React__default.createElement(appStudio.Vertical, {
|
|
7848
|
-
gap: 12
|
|
7849
|
-
}, /*#__PURE__*/React__default.createElement(Text, {
|
|
7850
|
-
fontWeight: "700",
|
|
7851
|
-
fontSize: 16,
|
|
7852
|
-
color: "color.gray.900"
|
|
7853
|
-
}, event.title), /*#__PURE__*/React__default.createElement(appStudio.Vertical, {
|
|
7854
|
-
gap: 6
|
|
7855
|
-
}, /*#__PURE__*/React__default.createElement(appStudio.Horizontal, {
|
|
7856
|
-
gap: 8,
|
|
7857
|
-
alignItems: "center"
|
|
7858
|
-
}, /*#__PURE__*/React__default.createElement(Text, {
|
|
7859
|
-
fontSize: 12,
|
|
7860
|
-
fontWeight: "600",
|
|
7861
|
-
color: "color.gray.600"
|
|
7862
|
-
}, "\uD83D\uDCC5"), /*#__PURE__*/React__default.createElement(Text, {
|
|
7863
|
-
fontSize: 13,
|
|
7864
|
-
color: "color.gray.700"
|
|
7865
|
-
}, dateFns.format(event.startDate, 'EEEE, MMMM d, yyyy'))), /*#__PURE__*/React__default.createElement(appStudio.Horizontal, {
|
|
7866
|
-
gap: 8,
|
|
7867
|
-
alignItems: "center"
|
|
7868
|
-
}, /*#__PURE__*/React__default.createElement(Text, {
|
|
7869
|
-
fontSize: 12,
|
|
7870
|
-
fontWeight: "600",
|
|
7871
|
-
color: "color.gray.600"
|
|
7872
|
-
}, "\uD83D\uDD50"), /*#__PURE__*/React__default.createElement(Text, {
|
|
7873
|
-
fontSize: 13,
|
|
7874
|
-
color: "color.gray.700"
|
|
7875
|
-
}, timeRange))), event.description && (/*#__PURE__*/React__default.createElement(appStudio.Vertical, {
|
|
7876
|
-
gap: 4
|
|
7877
|
-
}, /*#__PURE__*/React__default.createElement(Text, {
|
|
7878
|
-
fontSize: 12,
|
|
7879
|
-
fontWeight: "600",
|
|
7880
|
-
color: "color.gray.600"
|
|
7881
|
-
}, "Description"), /*#__PURE__*/React__default.createElement(Text, {
|
|
7882
|
-
fontSize: 13,
|
|
7883
|
-
color: "color.gray.700"
|
|
7884
|
-
}, event.description))))));
|
|
7965
|
+
/**
|
|
7966
|
+
* Day names array (Sunday to Saturday)
|
|
7967
|
+
*/
|
|
7968
|
+
var DAY_NAMES = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'];
|
|
7969
|
+
/**
|
|
7970
|
+
* Get day names starting from specified day
|
|
7971
|
+
*/
|
|
7972
|
+
var getDayNames = function getDayNames(weekStartsOn) {
|
|
7973
|
+
if (weekStartsOn === void 0) {
|
|
7974
|
+
weekStartsOn = 0;
|
|
7975
|
+
}
|
|
7976
|
+
var names = [...DAY_NAMES];
|
|
7977
|
+
return [...names.slice(weekStartsOn), ...names.slice(0, weekStartsOn)];
|
|
7885
7978
|
};
|
|
7886
|
-
|
|
7887
|
-
|
|
7888
|
-
|
|
7889
|
-
|
|
7890
|
-
|
|
7891
|
-
|
|
7892
|
-
|
|
7893
|
-
|
|
7894
|
-
|
|
7895
|
-
|
|
7896
|
-
|
|
7897
|
-
|
|
7898
|
-
|
|
7899
|
-
|
|
7900
|
-
|
|
7901
|
-
|
|
7902
|
-
|
|
7903
|
-
|
|
7904
|
-
|
|
7905
|
-
|
|
7906
|
-
|
|
7907
|
-
|
|
7908
|
-
|
|
7909
|
-
|
|
7910
|
-
|
|
7911
|
-
|
|
7912
|
-
|
|
7913
|
-
|
|
7914
|
-
|
|
7915
|
-
|
|
7916
|
-
|
|
7917
|
-
}
|
|
7918
|
-
|
|
7919
|
-
|
|
7920
|
-
|
|
7921
|
-
|
|
7922
|
-
|
|
7923
|
-
|
|
7924
|
-
|
|
7925
|
-
|
|
7926
|
-
|
|
7927
|
-
|
|
7928
|
-
|
|
7929
|
-
|
|
7930
|
-
|
|
7931
|
-
|
|
7932
|
-
|
|
7933
|
-
|
|
7934
|
-
|
|
7935
|
-
|
|
7936
|
-
|
|
7937
|
-
justifyContent: "space-between",
|
|
7938
|
-
alignItems: "center",
|
|
7939
|
-
maxWidth: '100%'
|
|
7940
|
-
}, /*#__PURE__*/React__default.createElement(Text, Object.assign({
|
|
7941
|
-
fontSize: 20,
|
|
7942
|
-
fontWeight: "700"
|
|
7943
|
-
}, views == null ? void 0 : views.headerTitle), label), /*#__PURE__*/React__default.createElement(appStudio.Horizontal, Object.assign({
|
|
7944
|
-
gap: 8
|
|
7945
|
-
}, views == null ? void 0 : views.viewSwitcher), VIEW_OPTIONS.map(option => (/*#__PURE__*/React__default.createElement(Button, Object.assign({
|
|
7946
|
-
key: option.value,
|
|
7947
|
-
variant: view === option.value ? 'filled' : 'ghost',
|
|
7948
|
-
isDisabled: view === option.value,
|
|
7949
|
-
onClick: () => onViewChange(option.value)
|
|
7950
|
-
}, views == null ? void 0 : views.viewButton), option.label))))), /*#__PURE__*/React__default.createElement(appStudio.Horizontal, Object.assign({
|
|
7951
|
-
gap: 8,
|
|
7952
|
-
alignItems: "center"
|
|
7953
|
-
}, views == null ? void 0 : views.navigation), /*#__PURE__*/React__default.createElement(Button, Object.assign({
|
|
7954
|
-
variant: "ghost",
|
|
7955
|
-
onClick: onPrevious
|
|
7956
|
-
}, views == null ? void 0 : views.navigationButton), "\u2190 Previous", ' ', view === 'day' ? 'Day' : view === 'week' ? 'Week' : 'Month'), /*#__PURE__*/React__default.createElement(Button, Object.assign({
|
|
7957
|
-
variant: "ghost",
|
|
7958
|
-
onClick: onToday
|
|
7959
|
-
}, views == null ? void 0 : views.navigationButton), "Today"), /*#__PURE__*/React__default.createElement(Button, Object.assign({
|
|
7960
|
-
variant: "ghost",
|
|
7961
|
-
onClick: onNext
|
|
7962
|
-
}, views == null ? void 0 : views.navigationButton), "Next ", view === 'day' ? 'Day' : view === 'week' ? 'Week' : 'Month', " \u2192"))), view !== 'day' && /*#__PURE__*/React__default.createElement(appStudio.View, {
|
|
7963
|
-
flexShrink: 0
|
|
7964
|
-
}, weekdayRow), /*#__PURE__*/React__default.createElement(appStudio.Vertical, Object.assign({
|
|
7965
|
-
gap: 12,
|
|
7966
|
-
flex: 1,
|
|
7967
|
-
overflow: "auto"
|
|
7968
|
-
}, views == null ? void 0 : views.grid), weeks.map((week, index) => (/*#__PURE__*/React__default.createElement(appStudio.View, Object.assign({
|
|
7969
|
-
key: view + "-week-" + index,
|
|
7970
|
-
display: "grid",
|
|
7971
|
-
gridTemplateColumns: "repeat(" + week.length + ", 1fr)",
|
|
7972
|
-
gap: 12,
|
|
7973
|
-
height: view === 'month' ? '180px' : view === 'week' ? '100%' : 'auto',
|
|
7974
|
-
minHeight: view === 'week' ? '300px' : 'auto'
|
|
7975
|
-
}, views == null ? void 0 : views.weekRow), week.map(day => {
|
|
7976
|
-
var _eventsByDay$get;
|
|
7977
|
-
var dayKey = formatDayKey(day);
|
|
7978
|
-
var isToday = dateFns.isSameDay(day, today);
|
|
7979
|
-
var events = (_eventsByDay$get = eventsByDay.get(dayKey)) != null ? _eventsByDay$get : [];
|
|
7980
|
-
var context = {
|
|
7981
|
-
day,
|
|
7982
|
-
isToday,
|
|
7983
|
-
view
|
|
7984
|
-
};
|
|
7985
|
-
var shouldDim = view === 'month' && !dateFns.isSameMonth(day, currentDate);
|
|
7986
|
-
return /*#__PURE__*/React__default.createElement(appStudio.Vertical, Object.assign({
|
|
7987
|
-
key: dayKey,
|
|
7988
|
-
gap: 12,
|
|
7989
|
-
padding: 16,
|
|
7990
|
-
borderWidth: 1,
|
|
7991
|
-
borderStyle: "solid",
|
|
7992
|
-
borderColor: isToday ? 'color.primary.200' : 'color.gray.200',
|
|
7993
|
-
borderRadius: 12,
|
|
7994
|
-
backgroundColor: "color.gray.50",
|
|
7995
|
-
opacity: shouldDim ? 0.6 : 1,
|
|
7996
|
-
display: "flex",
|
|
7997
|
-
flexDirection: "column",
|
|
7998
|
-
height: "100%",
|
|
7999
|
-
minHeight: view === 'month' ? '180px' : '300px'
|
|
8000
|
-
}, views == null ? void 0 : views.dayColumn), /*#__PURE__*/React__default.createElement(appStudio.Horizontal, Object.assign({
|
|
8001
|
-
justifyContent: "space-between",
|
|
8002
|
-
alignItems: "center",
|
|
8003
|
-
flexShrink: 0
|
|
8004
|
-
}, views == null ? void 0 : views.dayHeader), /*#__PURE__*/React__default.createElement(Text, Object.assign({
|
|
8005
|
-
fontWeight: "600",
|
|
8006
|
-
fontSize: 16
|
|
8007
|
-
}, views == null ? void 0 : views.dayNumber), dateFns.format(day, 'd')), view !== 'month' && (/*#__PURE__*/React__default.createElement(Text, Object.assign({
|
|
8008
|
-
fontSize: 14,
|
|
8009
|
-
color: "color.gray.600"
|
|
8010
|
-
}, views == null ? void 0 : views.dayMeta), dateFns.format(day, 'EEEE')))), /*#__PURE__*/React__default.createElement(appStudio.Vertical, Object.assign({
|
|
8011
|
-
gap: 8,
|
|
8012
|
-
flex: 1,
|
|
8013
|
-
overflow: "auto"
|
|
8014
|
-
}, views == null ? void 0 : views.events), events.length > 0 ? events.map(event => {
|
|
8015
|
-
var _event$id;
|
|
8016
|
-
var key = formatDayKey(day) + "-" + ((_event$id = event.id) != null ? _event$id : event.title) + "-" + event.startDate.getTime();
|
|
8017
|
-
if (renderEvent) {
|
|
8018
|
-
var rendered = renderEvent(event, context);
|
|
8019
|
-
if (/*#__PURE__*/React.isValidElement(rendered)) {
|
|
8020
|
-
return /*#__PURE__*/React.cloneElement(rendered, {
|
|
8021
|
-
key
|
|
8022
|
-
});
|
|
8023
|
-
}
|
|
8024
|
-
return /*#__PURE__*/React__default.createElement(React__default.Fragment, {
|
|
8025
|
-
key: key
|
|
8026
|
-
}, rendered);
|
|
7979
|
+
/**
|
|
7980
|
+
* Layout events with proper positioning to avoid overlaps
|
|
7981
|
+
* Returns positioned events for each week
|
|
7982
|
+
*/
|
|
7983
|
+
var layoutEvents = (events, calendarDates) => {
|
|
7984
|
+
var calendarStart = calendarDates[0];
|
|
7985
|
+
// Convert events to positioned items with day indices
|
|
7986
|
+
var items = events.map(ev => {
|
|
7987
|
+
var startIdx = daysBetweenUTC(ev.start, calendarStart);
|
|
7988
|
+
var endIdx = daysBetweenUTC(ev.end, calendarStart);
|
|
7989
|
+
// Clamp to calendar boundaries (0-41 for 6 weeks)
|
|
7990
|
+
var clampedStart = Math.max(0, Math.min(41, startIdx));
|
|
7991
|
+
var clampedEnd = Math.max(0, Math.min(41, endIdx));
|
|
7992
|
+
// Skip if completely outside calendar
|
|
7993
|
+
if (endIdx < 0 || startIdx > 41) return null;
|
|
7994
|
+
var duration = clampedEnd - clampedStart + 1;
|
|
7995
|
+
var weekIndex = Math.floor(clampedStart / 7);
|
|
7996
|
+
var dayOfWeek = clampedStart % 7;
|
|
7997
|
+
return Object.assign({}, ev, {
|
|
7998
|
+
startDay: clampedStart,
|
|
7999
|
+
endDay: clampedEnd,
|
|
8000
|
+
duration: duration,
|
|
8001
|
+
row: 0,
|
|
8002
|
+
weekIndex,
|
|
8003
|
+
dayOfWeek
|
|
8004
|
+
});
|
|
8005
|
+
}).filter(item => item !== null);
|
|
8006
|
+
// Sort by start day, then by duration (longer first)
|
|
8007
|
+
items.sort((a, b) => {
|
|
8008
|
+
if (a.startDay !== b.startDay) return a.startDay - b.startDay;
|
|
8009
|
+
return b.duration - a.duration;
|
|
8010
|
+
});
|
|
8011
|
+
// Assign rows per week using greedy algorithm to prevent overlaps
|
|
8012
|
+
var rowsByWeek = Array.from({
|
|
8013
|
+
length: 6
|
|
8014
|
+
}, () => []);
|
|
8015
|
+
var rowCountByWeek = Array.from({
|
|
8016
|
+
length: 6
|
|
8017
|
+
}, () => 0);
|
|
8018
|
+
items.forEach(item => {
|
|
8019
|
+
var weekIdx = item.weekIndex;
|
|
8020
|
+
var rows = rowsByWeek[weekIdx];
|
|
8021
|
+
var placed = false;
|
|
8022
|
+
for (var i = 0; i < rows.length; i++) {
|
|
8023
|
+
var row = rows[i];
|
|
8024
|
+
var hasConflict = row.some(existing => !(item.startDay > existing.endDay || item.endDay < existing.startDay));
|
|
8025
|
+
if (!hasConflict) {
|
|
8026
|
+
row.push(item);
|
|
8027
|
+
item.row = i;
|
|
8028
|
+
placed = true;
|
|
8029
|
+
break;
|
|
8027
8030
|
}
|
|
8028
|
-
|
|
8029
|
-
|
|
8030
|
-
|
|
8031
|
-
|
|
8032
|
-
|
|
8033
|
-
|
|
8034
|
-
})
|
|
8031
|
+
}
|
|
8032
|
+
if (!placed) {
|
|
8033
|
+
item.row = rows.length;
|
|
8034
|
+
rows.push([item]);
|
|
8035
|
+
}
|
|
8036
|
+
rowCountByWeek[weekIdx] = rows.length;
|
|
8037
|
+
});
|
|
8038
|
+
return {
|
|
8039
|
+
items,
|
|
8040
|
+
rowCountByWeek
|
|
8041
|
+
};
|
|
8042
|
+
};
|
|
8043
|
+
/**
|
|
8044
|
+
* Check if a date is in the current month
|
|
8045
|
+
*/
|
|
8046
|
+
var isInMonth = (dateISO, monthDateISO) => {
|
|
8047
|
+
return getMonth(dateISO) === getMonth(monthDateISO) && getYear(dateISO) === getYear(monthDateISO);
|
|
8035
8048
|
};
|
|
8036
8049
|
|
|
8037
|
-
|
|
8038
|
-
|
|
8039
|
-
|
|
8040
|
-
|
|
8041
|
-
|
|
8042
|
-
|
|
8043
|
-
|
|
8044
|
-
|
|
8045
|
-
|
|
8046
|
-
|
|
8047
|
-
|
|
8048
|
-
|
|
8049
|
-
|
|
8050
|
-
|
|
8051
|
-
|
|
8050
|
+
/**
|
|
8051
|
+
* Event color configurations
|
|
8052
|
+
*/
|
|
8053
|
+
var EVENT_COLORS = {
|
|
8054
|
+
blue: {
|
|
8055
|
+
background: 'color.blue.50',
|
|
8056
|
+
border: 'color.blue.500',
|
|
8057
|
+
text: 'color.blue.700'
|
|
8058
|
+
},
|
|
8059
|
+
red: {
|
|
8060
|
+
background: 'color.red.50',
|
|
8061
|
+
border: 'color.red.500',
|
|
8062
|
+
text: 'color.red.700'
|
|
8063
|
+
},
|
|
8064
|
+
green: {
|
|
8065
|
+
background: 'color.green.50',
|
|
8066
|
+
border: 'color.green.500',
|
|
8067
|
+
text: 'color.green.700'
|
|
8068
|
+
},
|
|
8069
|
+
purple: {
|
|
8070
|
+
background: 'color.purple.50',
|
|
8071
|
+
border: 'color.purple.500',
|
|
8072
|
+
text: 'color.purple.700'
|
|
8073
|
+
},
|
|
8074
|
+
orange: {
|
|
8075
|
+
background: 'color.orange.50',
|
|
8076
|
+
border: 'color.orange.500',
|
|
8077
|
+
text: 'color.orange.700'
|
|
8052
8078
|
}
|
|
8053
|
-
return dateFns.format(date, 'MMMM yyyy');
|
|
8054
8079
|
};
|
|
8055
|
-
|
|
8056
|
-
|
|
8080
|
+
/**
|
|
8081
|
+
* Base styles for the calendar container
|
|
8082
|
+
*/
|
|
8083
|
+
var containerStyles = {
|
|
8084
|
+
width: '100%',
|
|
8085
|
+
maxWidth: 1200,
|
|
8086
|
+
border: '1px solid',
|
|
8087
|
+
borderColor: 'color.gray.200',
|
|
8088
|
+
borderRadius: 8,
|
|
8089
|
+
overflow: 'hidden',
|
|
8090
|
+
backgroundColor: 'color.white'
|
|
8091
|
+
};
|
|
8092
|
+
/**
|
|
8093
|
+
* Header styles (navigation bar)
|
|
8094
|
+
*/
|
|
8095
|
+
var headerStyles = {
|
|
8096
|
+
display: 'flex',
|
|
8097
|
+
alignItems: 'center',
|
|
8098
|
+
justifyContent: 'space-between',
|
|
8099
|
+
padding: 16,
|
|
8100
|
+
paddingLeft: 20,
|
|
8101
|
+
paddingRight: 20,
|
|
8102
|
+
borderBottom: '1px solid',
|
|
8103
|
+
borderColor: 'color.gray.200',
|
|
8104
|
+
backgroundColor: 'color.white'
|
|
8105
|
+
};
|
|
8106
|
+
/**
|
|
8107
|
+
* Month title styles
|
|
8108
|
+
*/
|
|
8109
|
+
var monthTitleStyles = {
|
|
8110
|
+
fontSize: 20,
|
|
8111
|
+
fontWeight: 500,
|
|
8112
|
+
color: 'color.gray.900'
|
|
8113
|
+
};
|
|
8114
|
+
/**
|
|
8115
|
+
* Month grid styles (7 columns for days)
|
|
8116
|
+
*/
|
|
8117
|
+
var monthGridStyles = {
|
|
8118
|
+
display: 'flex',
|
|
8119
|
+
flexDirection: 'column',
|
|
8120
|
+
backgroundColor: 'color.white'
|
|
8121
|
+
};
|
|
8122
|
+
/**
|
|
8123
|
+
* Weekday header row styles
|
|
8124
|
+
*/
|
|
8125
|
+
var weekdayHeaderStyles = {
|
|
8126
|
+
display: 'grid',
|
|
8127
|
+
gridTemplateColumns: 'repeat(7, 1fr)',
|
|
8128
|
+
borderBottom: '1px solid',
|
|
8129
|
+
borderColor: 'color.gray.200',
|
|
8130
|
+
backgroundColor: 'color.gray.50'
|
|
8131
|
+
};
|
|
8132
|
+
/**
|
|
8133
|
+
* Individual weekday label styles
|
|
8134
|
+
*/
|
|
8135
|
+
var weekdayLabelStyles = {
|
|
8136
|
+
padding: 8,
|
|
8137
|
+
textAlign: 'center',
|
|
8138
|
+
fontSize: 11,
|
|
8139
|
+
fontWeight: 500,
|
|
8140
|
+
color: 'color.gray.700',
|
|
8141
|
+
textTransform: 'uppercase',
|
|
8142
|
+
letterSpacing: 0.5
|
|
8143
|
+
};
|
|
8144
|
+
/**
|
|
8145
|
+
* Individual day cell styles
|
|
8146
|
+
*/
|
|
8147
|
+
var dayCellStyles = {
|
|
8148
|
+
border: '1px solid',
|
|
8149
|
+
borderColor: 'color.gray.100',
|
|
8150
|
+
minHeight: 120,
|
|
8151
|
+
padding: 4,
|
|
8152
|
+
paddingTop: 2,
|
|
8153
|
+
backgroundColor: 'color.white',
|
|
8154
|
+
position: 'relative',
|
|
8155
|
+
display: 'flex',
|
|
8156
|
+
flexDirection: 'column'
|
|
8157
|
+
};
|
|
8158
|
+
/**
|
|
8159
|
+
* Day date styles (the circular number)
|
|
8160
|
+
*/
|
|
8161
|
+
var dayDateStyles = {
|
|
8162
|
+
width: 36,
|
|
8163
|
+
height: 36,
|
|
8164
|
+
display: 'flex',
|
|
8165
|
+
alignItems: 'center',
|
|
8166
|
+
justifyContent: 'center',
|
|
8167
|
+
borderRadius: '50%',
|
|
8168
|
+
fontSize: 13,
|
|
8169
|
+
fontWeight: 400,
|
|
8170
|
+
color: 'color.gray.900',
|
|
8171
|
+
cursor: 'pointer',
|
|
8172
|
+
transition: 'all 0.2s',
|
|
8173
|
+
border: '2px solid transparent'
|
|
8174
|
+
};
|
|
8175
|
+
/**
|
|
8176
|
+
* Day cell from different month
|
|
8177
|
+
*/
|
|
8178
|
+
var otherMonthDayCellStyles = {
|
|
8179
|
+
backgroundColor: 'color.gray.50',
|
|
8180
|
+
opacity: 0.5
|
|
8181
|
+
};
|
|
8182
|
+
/**
|
|
8183
|
+
* Day number styles
|
|
8184
|
+
*/
|
|
8185
|
+
var dayNumberStyles = {
|
|
8186
|
+
fontSize: 14,
|
|
8187
|
+
fontWeight: 400,
|
|
8188
|
+
color: 'color.gray.900',
|
|
8189
|
+
marginBottom: 4,
|
|
8190
|
+
padding: 4,
|
|
8191
|
+
paddingLeft: 8,
|
|
8192
|
+
paddingRight: 8,
|
|
8193
|
+
borderRadius: 4,
|
|
8194
|
+
alignSelf: 'flex-start'
|
|
8195
|
+
};
|
|
8196
|
+
/**
|
|
8197
|
+
* Today day number styles
|
|
8198
|
+
*/
|
|
8199
|
+
var todayDayNumberStyles = {
|
|
8200
|
+
backgroundColor: 'color.blue.500',
|
|
8201
|
+
color: 'color.white',
|
|
8202
|
+
fontWeight: 500
|
|
8203
|
+
};
|
|
8204
|
+
/**
|
|
8205
|
+
* Selected day number styles
|
|
8206
|
+
*/
|
|
8207
|
+
var selectedDayNumberStyles = {
|
|
8208
|
+
backgroundColor: 'color.blue.50',
|
|
8209
|
+
color: 'color.blue.700',
|
|
8210
|
+
fontWeight: 500
|
|
8211
|
+
};
|
|
8212
|
+
/**
|
|
8213
|
+
* Events area styles (container for events in a day)
|
|
8214
|
+
*/
|
|
8215
|
+
var eventsAreaStyles = {
|
|
8216
|
+
display: 'flex',
|
|
8217
|
+
flexDirection: 'column',
|
|
8218
|
+
gap: 2,
|
|
8219
|
+
flex: 1,
|
|
8220
|
+
position: 'relative'
|
|
8221
|
+
};
|
|
8222
|
+
/**
|
|
8223
|
+
* Base event styles
|
|
8224
|
+
*/
|
|
8225
|
+
var eventStyles = {
|
|
8226
|
+
height: 20,
|
|
8227
|
+
display: 'flex',
|
|
8228
|
+
alignItems: 'center',
|
|
8229
|
+
padding: 4,
|
|
8230
|
+
paddingLeft: 6,
|
|
8231
|
+
paddingRight: 6,
|
|
8232
|
+
borderRadius: 3,
|
|
8233
|
+
borderLeft: '3px solid',
|
|
8234
|
+
fontSize: 11,
|
|
8235
|
+
fontWeight: 500,
|
|
8236
|
+
overflow: 'hidden',
|
|
8237
|
+
cursor: 'grab',
|
|
8238
|
+
transition: 'box-shadow 0.2s',
|
|
8239
|
+
userSelect: 'none',
|
|
8240
|
+
marginBottom: 2
|
|
8241
|
+
};
|
|
8242
|
+
/**
|
|
8243
|
+
* Drop target indicator styles
|
|
8244
|
+
*/
|
|
8245
|
+
var dropTargetStyles = {
|
|
8246
|
+
backgroundColor: 'rgba(26, 115, 232, 0.08)',
|
|
8247
|
+
boxShadow: 'inset 0 0 0 2px rgba(26, 115, 232, 0.3)'
|
|
8248
|
+
};
|
|
8249
|
+
/**
|
|
8250
|
+
* Button base styles
|
|
8251
|
+
*/
|
|
8252
|
+
var buttonStyles = {
|
|
8253
|
+
padding: 8,
|
|
8254
|
+
paddingLeft: 12,
|
|
8255
|
+
paddingRight: 12,
|
|
8256
|
+
borderRadius: 4,
|
|
8257
|
+
fontSize: 14,
|
|
8258
|
+
fontWeight: 500,
|
|
8259
|
+
cursor: 'pointer',
|
|
8260
|
+
border: '1px solid',
|
|
8261
|
+
borderColor: 'color.gray.300',
|
|
8262
|
+
backgroundColor: 'color.white',
|
|
8263
|
+
color: 'color.gray.700',
|
|
8264
|
+
transition: 'all 0.2s'
|
|
8265
|
+
};
|
|
8266
|
+
/**
|
|
8267
|
+
* Icon button styles
|
|
8268
|
+
*/
|
|
8269
|
+
var iconButtonStyles = {
|
|
8270
|
+
width: 36,
|
|
8271
|
+
height: 36,
|
|
8272
|
+
display: 'flex',
|
|
8273
|
+
alignItems: 'center',
|
|
8274
|
+
justifyContent: 'center',
|
|
8275
|
+
borderRadius: '50%',
|
|
8276
|
+
cursor: 'pointer',
|
|
8277
|
+
backgroundColor: 'transparent',
|
|
8278
|
+
color: 'color.gray.700',
|
|
8279
|
+
transition: 'all 0.2s',
|
|
8280
|
+
border: 'none'
|
|
8281
|
+
};
|
|
8282
|
+
|
|
8283
|
+
var ResizeHandle = _ref => {
|
|
8057
8284
|
var {
|
|
8058
|
-
|
|
8059
|
-
|
|
8285
|
+
direction,
|
|
8286
|
+
onMouseDown
|
|
8287
|
+
} = _ref;
|
|
8288
|
+
var [isHovered, setIsHovered] = React.useState(false);
|
|
8289
|
+
return /*#__PURE__*/React__default.createElement(appStudio.View, Object.assign({
|
|
8290
|
+
position: "absolute",
|
|
8291
|
+
top: 0,
|
|
8292
|
+
bottom: 0,
|
|
8293
|
+
width: 8,
|
|
8294
|
+
opacity: isHovered ? 1 : 0,
|
|
8295
|
+
transition: "opacity 0.2s",
|
|
8296
|
+
cursor: direction === 'left' ? 'w-resize' : 'e-resize',
|
|
8297
|
+
zIndex: 10,
|
|
8298
|
+
backgroundColor: isHovered ? 'rgba(0,0,0,0.1)' : 'transparent'
|
|
8299
|
+
}, direction === 'left' ? {
|
|
8300
|
+
left: 0
|
|
8301
|
+
} : {
|
|
8302
|
+
right: 0
|
|
8303
|
+
}, {
|
|
8304
|
+
onMouseDown: onMouseDown,
|
|
8305
|
+
onMouseEnter: () => setIsHovered(true),
|
|
8306
|
+
onMouseLeave: () => setIsHovered(false)
|
|
8307
|
+
}));
|
|
8308
|
+
};
|
|
8309
|
+
var MONTH_EVENT_ROW_HEIGHT = 22;
|
|
8310
|
+
var MONTH_EVENT_ROW_GAP = 4;
|
|
8311
|
+
var MONTH_EVENT_TOP_OFFSET = 32;
|
|
8312
|
+
var Calendar = _ref2 => {
|
|
8313
|
+
var {
|
|
8314
|
+
initialDate = new Date(),
|
|
8060
8315
|
initialView = 'month',
|
|
8061
|
-
|
|
8062
|
-
|
|
8063
|
-
|
|
8316
|
+
events = [],
|
|
8317
|
+
today = new Date().toISOString().slice(0, 10),
|
|
8318
|
+
onEventDrop,
|
|
8319
|
+
onEventResize,
|
|
8320
|
+
onDateClick,
|
|
8064
8321
|
onDateChange,
|
|
8065
8322
|
onViewChange,
|
|
8066
|
-
|
|
8067
|
-
|
|
8068
|
-
|
|
8069
|
-
|
|
8070
|
-
|
|
8071
|
-
|
|
8072
|
-
|
|
8073
|
-
|
|
8074
|
-
|
|
8075
|
-
|
|
8076
|
-
|
|
8077
|
-
|
|
8078
|
-
|
|
8079
|
-
|
|
8080
|
-
var
|
|
8081
|
-
|
|
8082
|
-
|
|
8083
|
-
|
|
8084
|
-
|
|
8085
|
-
|
|
8086
|
-
|
|
8087
|
-
|
|
8088
|
-
|
|
8089
|
-
|
|
8090
|
-
|
|
8091
|
-
|
|
8092
|
-
|
|
8093
|
-
|
|
8094
|
-
|
|
8095
|
-
|
|
8096
|
-
|
|
8097
|
-
|
|
8098
|
-
|
|
8099
|
-
|
|
8100
|
-
|
|
8101
|
-
|
|
8102
|
-
|
|
8103
|
-
|
|
8104
|
-
|
|
8105
|
-
|
|
8106
|
-
|
|
8107
|
-
|
|
8108
|
-
|
|
8109
|
-
|
|
8110
|
-
|
|
8111
|
-
|
|
8112
|
-
|
|
8113
|
-
|
|
8323
|
+
onEventAdd,
|
|
8324
|
+
views = {},
|
|
8325
|
+
width = '100%',
|
|
8326
|
+
maxWidth = 1200,
|
|
8327
|
+
weekStartsOn = 0
|
|
8328
|
+
} = _ref2;
|
|
8329
|
+
var {
|
|
8330
|
+
getColor
|
|
8331
|
+
} = appStudio.useTheme();
|
|
8332
|
+
var gridRef = React.useRef(null);
|
|
8333
|
+
// Convert initialDate to ISO string if it's a Date object
|
|
8334
|
+
var initialDateISO = typeof initialDate === 'string' ? initialDate : initialDate.toISOString().slice(0, 10);
|
|
8335
|
+
var [currentDate, setCurrentDate] = React.useState(initialDateISO);
|
|
8336
|
+
var [currentView, setCurrentView] = React.useState(initialView);
|
|
8337
|
+
var [selectedDate, setSelectedDate] = React.useState(null);
|
|
8338
|
+
var [localEvents, setLocalEvents] = React.useState(events);
|
|
8339
|
+
var [dropTargetDays, setDropTargetDays] = React.useState([]);
|
|
8340
|
+
var dragStateRef = React.useRef({
|
|
8341
|
+
isDragging: false,
|
|
8342
|
+
isResizing: false,
|
|
8343
|
+
resizeDirection: null,
|
|
8344
|
+
event: null,
|
|
8345
|
+
startX: 0,
|
|
8346
|
+
startDay: 0,
|
|
8347
|
+
startDuration: 0,
|
|
8348
|
+
originalStart: null,
|
|
8349
|
+
originalEnd: null
|
|
8350
|
+
});
|
|
8351
|
+
// Update local events when props change
|
|
8352
|
+
React__default.useEffect(() => {
|
|
8353
|
+
setLocalEvents(events);
|
|
8354
|
+
}, [events]);
|
|
8355
|
+
// Get the month start for current date
|
|
8356
|
+
var currentMonth = React.useMemo(() => getFirstDayOfMonth(currentDate), [currentDate]);
|
|
8357
|
+
// Generate calendar dates based on view
|
|
8358
|
+
var calendarDates = React.useMemo(() => {
|
|
8359
|
+
if (currentView === 'month') {
|
|
8360
|
+
return getCalendarDates(currentMonth, weekStartsOn);
|
|
8361
|
+
} else if (currentView === 'week') {
|
|
8362
|
+
// Get week starting from current date
|
|
8363
|
+
var dayOfWeek = getDayOfWeek(currentDate);
|
|
8364
|
+
var weekStart = addDateDays(currentDate, -((dayOfWeek - weekStartsOn + 7) % 7));
|
|
8365
|
+
var dates = [];
|
|
8366
|
+
for (var i = 0; i < 7; i++) {
|
|
8367
|
+
dates.push(addDateDays(weekStart, i));
|
|
8368
|
+
}
|
|
8369
|
+
return dates;
|
|
8370
|
+
} else {
|
|
8371
|
+
// Day view - just current date
|
|
8114
8372
|
return [currentDate];
|
|
8115
8373
|
}
|
|
8116
|
-
|
|
8117
|
-
|
|
8118
|
-
|
|
8374
|
+
}, [currentDate, currentView, currentMonth, weekStartsOn]);
|
|
8375
|
+
var monthWeeks = React.useMemo(() => {
|
|
8376
|
+
var chunks = [];
|
|
8377
|
+
for (var i = 0; i < calendarDates.length; i += 7) {
|
|
8378
|
+
chunks.push(calendarDates.slice(i, i + 7));
|
|
8379
|
+
}
|
|
8380
|
+
return chunks;
|
|
8381
|
+
}, [calendarDates]);
|
|
8382
|
+
// Layout events
|
|
8383
|
+
var {
|
|
8384
|
+
items: positionedEvents
|
|
8385
|
+
} = React.useMemo(() => layoutEvents(localEvents, calendarDates), [localEvents, calendarDates]);
|
|
8386
|
+
var monthWeeksWithEvents = React.useMemo(() => {
|
|
8387
|
+
return monthWeeks.map((dates, weekIndex) => {
|
|
8388
|
+
var weekStartIdx = weekIndex * 7;
|
|
8389
|
+
var weekEndIdx = weekStartIdx + dates.length - 1;
|
|
8390
|
+
var segments = positionedEvents.filter(event => !(event.startDay > weekEndIdx || event.endDay < weekStartIdx)).map(event => {
|
|
8391
|
+
var segmentStart = Math.max(event.startDay, weekStartIdx);
|
|
8392
|
+
var segmentEnd = Math.min(event.endDay, weekEndIdx);
|
|
8393
|
+
return Object.assign({}, event, {
|
|
8394
|
+
weekIndex,
|
|
8395
|
+
segmentStartDay: segmentStart - weekStartIdx,
|
|
8396
|
+
segmentEndDay: segmentEnd - weekStartIdx,
|
|
8397
|
+
segmentDuration: segmentEnd - segmentStart + 1,
|
|
8398
|
+
segmentRow: 0
|
|
8399
|
+
});
|
|
8119
8400
|
});
|
|
8120
|
-
|
|
8121
|
-
|
|
8122
|
-
|
|
8123
|
-
|
|
8124
|
-
|
|
8125
|
-
|
|
8126
|
-
|
|
8127
|
-
|
|
8128
|
-
|
|
8129
|
-
|
|
8130
|
-
|
|
8131
|
-
|
|
8132
|
-
|
|
8133
|
-
|
|
8134
|
-
|
|
8401
|
+
segments.sort((a, b) => {
|
|
8402
|
+
if (a.segmentStartDay !== b.segmentStartDay) {
|
|
8403
|
+
return a.segmentStartDay - b.segmentStartDay;
|
|
8404
|
+
}
|
|
8405
|
+
return b.segmentDuration - a.segmentDuration;
|
|
8406
|
+
});
|
|
8407
|
+
var rows = [];
|
|
8408
|
+
segments.forEach(segment => {
|
|
8409
|
+
var placed = false;
|
|
8410
|
+
for (var rowIdx = 0; rowIdx < rows.length; rowIdx++) {
|
|
8411
|
+
var row = rows[rowIdx];
|
|
8412
|
+
var conflict = row.some(existing => !(segment.segmentStartDay > existing.segmentEndDay || segment.segmentEndDay < existing.segmentStartDay));
|
|
8413
|
+
if (!conflict) {
|
|
8414
|
+
segment.segmentRow = rowIdx;
|
|
8415
|
+
row.push(segment);
|
|
8416
|
+
placed = true;
|
|
8417
|
+
break;
|
|
8418
|
+
}
|
|
8419
|
+
}
|
|
8420
|
+
if (!placed) {
|
|
8421
|
+
segment.segmentRow = rows.length;
|
|
8422
|
+
rows.push([segment]);
|
|
8423
|
+
}
|
|
8424
|
+
});
|
|
8425
|
+
return {
|
|
8426
|
+
weekIndex,
|
|
8427
|
+
dates,
|
|
8428
|
+
segments,
|
|
8429
|
+
rowCount: rows.length
|
|
8430
|
+
};
|
|
8135
8431
|
});
|
|
8136
|
-
}, [
|
|
8137
|
-
|
|
8138
|
-
|
|
8139
|
-
|
|
8140
|
-
|
|
8141
|
-
|
|
8142
|
-
|
|
8143
|
-
|
|
8144
|
-
|
|
8145
|
-
|
|
8146
|
-
|
|
8147
|
-
|
|
8432
|
+
}, [monthWeeks, positionedEvents]);
|
|
8433
|
+
// Get day names
|
|
8434
|
+
var dayNames = React.useMemo(() => getDayNames(weekStartsOn), [weekStartsOn]);
|
|
8435
|
+
// Handle navigation
|
|
8436
|
+
var handlePrevious = React.useCallback(() => {
|
|
8437
|
+
var newDate;
|
|
8438
|
+
if (currentView === 'month') {
|
|
8439
|
+
newDate = getPreviousMonth(currentDate);
|
|
8440
|
+
} else if (currentView === 'week') {
|
|
8441
|
+
newDate = addDateDays(currentDate, -7);
|
|
8442
|
+
} else {
|
|
8443
|
+
newDate = addDateDays(currentDate, -1);
|
|
8444
|
+
}
|
|
8445
|
+
setCurrentDate(newDate);
|
|
8446
|
+
onDateChange == null || onDateChange(new Date(newDate + 'T00:00:00Z'));
|
|
8447
|
+
}, [currentDate, currentView, onDateChange]);
|
|
8448
|
+
var handleNext = React.useCallback(() => {
|
|
8449
|
+
var newDate;
|
|
8450
|
+
if (currentView === 'month') {
|
|
8451
|
+
newDate = getNextMonth(currentDate);
|
|
8452
|
+
} else if (currentView === 'week') {
|
|
8453
|
+
newDate = addDateDays(currentDate, 7);
|
|
8454
|
+
} else {
|
|
8455
|
+
newDate = addDateDays(currentDate, 1);
|
|
8456
|
+
}
|
|
8457
|
+
setCurrentDate(newDate);
|
|
8458
|
+
onDateChange == null || onDateChange(new Date(newDate + 'T00:00:00Z'));
|
|
8459
|
+
}, [currentDate, currentView, onDateChange]);
|
|
8460
|
+
var handleToday = React.useCallback(() => {
|
|
8461
|
+
setCurrentDate(today);
|
|
8462
|
+
onDateChange == null || onDateChange(new Date(today + 'T00:00:00Z'));
|
|
8463
|
+
}, [today, onDateChange]);
|
|
8464
|
+
// Handle view change
|
|
8465
|
+
var handleViewChange = React.useCallback(view => {
|
|
8466
|
+
setCurrentView(view);
|
|
8467
|
+
onViewChange == null || onViewChange(view);
|
|
8468
|
+
}, [onViewChange]);
|
|
8469
|
+
// Handle date click
|
|
8470
|
+
var handleDateClick = React.useCallback(dateISO => {
|
|
8471
|
+
setSelectedDate(dateISO);
|
|
8472
|
+
onDateClick == null || onDateClick(dateISO);
|
|
8473
|
+
}, [onDateClick]);
|
|
8474
|
+
// Handle double-click to add event
|
|
8475
|
+
var handleDateDoubleClick = React.useCallback((dateISO, hour) => {
|
|
8476
|
+
if (onEventAdd) {
|
|
8477
|
+
var start;
|
|
8478
|
+
var end;
|
|
8479
|
+
if (hour !== undefined) {
|
|
8480
|
+
// Day view with time
|
|
8481
|
+
var hourStr = hour.toString().padStart(2, '0');
|
|
8482
|
+
start = dateISO + "T" + hourStr + ":00";
|
|
8483
|
+
end = dateISO + "T" + (hour + 1).toString().padStart(2, '0') + ":00";
|
|
8484
|
+
} else {
|
|
8485
|
+
// Month/week view
|
|
8486
|
+
start = dateISO;
|
|
8487
|
+
end = dateISO;
|
|
8488
|
+
}
|
|
8489
|
+
onEventAdd(start, end);
|
|
8490
|
+
}
|
|
8491
|
+
}, [onEventAdd]);
|
|
8492
|
+
// Handle mouse down on event (start dragging)
|
|
8493
|
+
var handleEventMouseDown = React.useCallback((e, event) => {
|
|
8494
|
+
e.preventDefault();
|
|
8495
|
+
dragStateRef.current = {
|
|
8496
|
+
isDragging: true,
|
|
8497
|
+
isResizing: false,
|
|
8498
|
+
resizeDirection: null,
|
|
8499
|
+
event,
|
|
8500
|
+
startX: e.clientX,
|
|
8501
|
+
startDay: event.startDay,
|
|
8502
|
+
startDuration: event.duration,
|
|
8503
|
+
originalStart: event.start,
|
|
8504
|
+
originalEnd: event.end
|
|
8505
|
+
};
|
|
8506
|
+
}, []);
|
|
8507
|
+
// Handle resize start
|
|
8508
|
+
var handleResizeStart = React.useCallback((e, event, direction) => {
|
|
8509
|
+
e.preventDefault();
|
|
8510
|
+
e.stopPropagation();
|
|
8511
|
+
dragStateRef.current = {
|
|
8512
|
+
isDragging: false,
|
|
8513
|
+
isResizing: true,
|
|
8514
|
+
resizeDirection: direction,
|
|
8515
|
+
event,
|
|
8516
|
+
startX: e.clientX,
|
|
8517
|
+
startDay: event.startDay,
|
|
8518
|
+
startDuration: event.duration,
|
|
8519
|
+
originalStart: event.start,
|
|
8520
|
+
originalEnd: event.end
|
|
8521
|
+
};
|
|
8522
|
+
}, []);
|
|
8523
|
+
// Handle mouse move during resize or drag
|
|
8524
|
+
var handleMouseMove = React.useCallback(e => {
|
|
8525
|
+
var dragState = dragStateRef.current;
|
|
8526
|
+
if (!dragState.event || !dragState.isDragging && !dragState.isResizing) return;
|
|
8527
|
+
if (!gridRef.current) return;
|
|
8528
|
+
var rect = gridRef.current.getBoundingClientRect();
|
|
8529
|
+
var deltaX = e.clientX - dragState.startX;
|
|
8530
|
+
// Calculate day delta based on pixel movement
|
|
8531
|
+
var daysDelta;
|
|
8532
|
+
if (currentView === 'month') {
|
|
8533
|
+
var dayWidth = rect.width / 7;
|
|
8534
|
+
daysDelta = Math.round(deltaX / dayWidth);
|
|
8535
|
+
} else if (currentView === 'week') {
|
|
8536
|
+
var _dayWidth = rect.width / 7;
|
|
8537
|
+
daysDelta = Math.round(deltaX / _dayWidth);
|
|
8538
|
+
} else {
|
|
8539
|
+
// Day view - no horizontal resize
|
|
8540
|
+
return;
|
|
8541
|
+
}
|
|
8542
|
+
if (dragState.isDragging) {
|
|
8543
|
+
// Dragging - move the event
|
|
8544
|
+
var maxDays = calendarDates.length - 1;
|
|
8545
|
+
var newStartDay = Math.max(0, Math.min(maxDays, dragState.startDay + daysDelta));
|
|
8546
|
+
var duration = dragState.event.duration;
|
|
8547
|
+
var newEndDay = Math.min(maxDays, newStartDay + duration - 1);
|
|
8548
|
+
// Update drop target indicators
|
|
8549
|
+
var targetDays = [];
|
|
8550
|
+
for (var i = newStartDay; i <= newEndDay; i++) {
|
|
8551
|
+
targetDays.push(i);
|
|
8552
|
+
}
|
|
8553
|
+
setDropTargetDays(targetDays);
|
|
8554
|
+
// Update event position immediately for smooth dragging
|
|
8555
|
+
var updatedEvents = localEvents.map(ev => ev.id === dragState.event.id ? Object.assign({}, ev, {
|
|
8556
|
+
start: addDateDays(dragState.originalStart, newStartDay - dragState.startDay),
|
|
8557
|
+
end: addDateDays(dragState.originalEnd, newStartDay - dragState.startDay)
|
|
8558
|
+
}) : ev);
|
|
8559
|
+
setLocalEvents(updatedEvents);
|
|
8560
|
+
} else if (dragState.isResizing) {
|
|
8561
|
+
// Resizing
|
|
8562
|
+
if (dragState.resizeDirection === 'right') {
|
|
8563
|
+
// Resize from right
|
|
8564
|
+
var newDuration = Math.max(1, dragState.startDuration + daysDelta);
|
|
8565
|
+
var _maxDays = calendarDates.length - 1;
|
|
8566
|
+
var _newEndDay = Math.min(_maxDays, dragState.startDay + newDuration - 1);
|
|
8567
|
+
var actualDuration = _newEndDay - dragState.startDay + 1;
|
|
8568
|
+
var _updatedEvents = localEvents.map(ev => ev.id === dragState.event.id ? Object.assign({}, ev, {
|
|
8569
|
+
end: addDateDays(dragState.originalStart, actualDuration - 1)
|
|
8570
|
+
}) : ev);
|
|
8571
|
+
setLocalEvents(_updatedEvents);
|
|
8572
|
+
} else if (dragState.resizeDirection === 'left') {
|
|
8573
|
+
// Resize from left
|
|
8574
|
+
var _newStartDay = Math.max(0, Math.min(dragState.startDay + dragState.startDuration - 1, dragState.startDay + daysDelta));
|
|
8575
|
+
var _updatedEvents2 = localEvents.map(ev => ev.id === dragState.event.id ? Object.assign({}, ev, {
|
|
8576
|
+
start: addDateDays(dragState.originalStart, _newStartDay - dragState.startDay)
|
|
8577
|
+
}) : ev);
|
|
8578
|
+
setLocalEvents(_updatedEvents2);
|
|
8579
|
+
}
|
|
8580
|
+
}
|
|
8581
|
+
}, [localEvents, calendarDates, currentView]);
|
|
8582
|
+
// Handle mouse up - finish resize/drag
|
|
8583
|
+
var handleMouseUp = React.useCallback(e => {
|
|
8584
|
+
var dragState = dragStateRef.current;
|
|
8585
|
+
if (!dragState.event || !dragState.isDragging && !dragState.isResizing) return;
|
|
8586
|
+
setDropTargetDays([]);
|
|
8587
|
+
// Find the updated event
|
|
8588
|
+
var updatedEvent = localEvents.find(ev => ev.id === dragState.event.id);
|
|
8589
|
+
if (!updatedEvent) return;
|
|
8590
|
+
// Call appropriate callback
|
|
8591
|
+
if (dragState.isDragging) {
|
|
8592
|
+
onEventDrop == null || onEventDrop(updatedEvent);
|
|
8593
|
+
} else if (dragState.isResizing) {
|
|
8594
|
+
onEventResize == null || onEventResize(updatedEvent);
|
|
8595
|
+
}
|
|
8596
|
+
// Reset drag state
|
|
8597
|
+
dragStateRef.current = {
|
|
8598
|
+
isDragging: false,
|
|
8599
|
+
isResizing: false,
|
|
8600
|
+
resizeDirection: null,
|
|
8601
|
+
event: null,
|
|
8602
|
+
startX: 0,
|
|
8603
|
+
startDay: 0,
|
|
8604
|
+
startDuration: 0,
|
|
8605
|
+
originalStart: null,
|
|
8606
|
+
originalEnd: null
|
|
8607
|
+
};
|
|
8608
|
+
}, [localEvents, onEventDrop, onEventResize]);
|
|
8609
|
+
// Set up global mouse event listeners
|
|
8610
|
+
React__default.useEffect(() => {
|
|
8611
|
+
document.addEventListener('mousemove', handleMouseMove);
|
|
8612
|
+
document.addEventListener('mouseup', handleMouseUp);
|
|
8613
|
+
return () => {
|
|
8614
|
+
document.removeEventListener('mousemove', handleMouseMove);
|
|
8615
|
+
document.removeEventListener('mouseup', handleMouseUp);
|
|
8616
|
+
};
|
|
8617
|
+
}, [handleMouseMove, handleMouseUp]);
|
|
8618
|
+
// Group events by date for rendering
|
|
8619
|
+
var eventsByDate = React.useMemo(() => {
|
|
8620
|
+
var grouped = {};
|
|
8621
|
+
calendarDates.forEach(date => {
|
|
8622
|
+
grouped[date] = [];
|
|
8148
8623
|
});
|
|
8149
|
-
|
|
8150
|
-
|
|
8151
|
-
|
|
8152
|
-
|
|
8153
|
-
|
|
8624
|
+
positionedEvents.forEach(event => {
|
|
8625
|
+
// For multi-day events, show on each day it spans
|
|
8626
|
+
var startIdx = event.startDay;
|
|
8627
|
+
var endIdx = event.endDay;
|
|
8628
|
+
for (var i = startIdx; i <= endIdx && i < calendarDates.length; i++) {
|
|
8629
|
+
var date = calendarDates[i];
|
|
8630
|
+
if (date && grouped[date]) {
|
|
8631
|
+
var isFirstDay = i === startIdx;
|
|
8632
|
+
grouped[date].push(Object.assign({}, event, {
|
|
8633
|
+
isFirstDay
|
|
8634
|
+
}));
|
|
8635
|
+
}
|
|
8636
|
+
}
|
|
8154
8637
|
});
|
|
8155
|
-
return
|
|
8156
|
-
|
|
8157
|
-
|
|
8158
|
-
},
|
|
8159
|
-
|
|
8160
|
-
|
|
8161
|
-
|
|
8162
|
-
|
|
8163
|
-
|
|
8164
|
-
|
|
8165
|
-
|
|
8166
|
-
|
|
8167
|
-
|
|
8168
|
-
|
|
8169
|
-
|
|
8170
|
-
|
|
8171
|
-
|
|
8172
|
-
|
|
8173
|
-
|
|
8174
|
-
|
|
8638
|
+
return grouped;
|
|
8639
|
+
}, [positionedEvents, calendarDates]);
|
|
8640
|
+
// Render month view
|
|
8641
|
+
var renderMonthView = () => (/*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(appStudio.View, Object.assign({}, weekdayHeaderStyles, views.weekdayHeader), dayNames.map((dayName, index) => (/*#__PURE__*/React__default.createElement(appStudio.View, Object.assign({
|
|
8642
|
+
key: index
|
|
8643
|
+
}, weekdayLabelStyles, views.weekdayLabel), dayName)))), /*#__PURE__*/React__default.createElement(appStudio.View, Object.assign({
|
|
8644
|
+
ref: gridRef
|
|
8645
|
+
}, monthGridStyles, views.monthGrid), monthWeeksWithEvents.map(week => {
|
|
8646
|
+
var weekStartIdx = week.weekIndex * 7;
|
|
8647
|
+
var weekEndIdx = weekStartIdx + week.dates.length - 1;
|
|
8648
|
+
return /*#__PURE__*/React__default.createElement(appStudio.View, {
|
|
8649
|
+
key: "week-" + week.weekIndex,
|
|
8650
|
+
position: "relative"
|
|
8651
|
+
}, /*#__PURE__*/React__default.createElement(appStudio.View, {
|
|
8652
|
+
display: "grid",
|
|
8653
|
+
gridTemplateColumns: "repeat(7, 1fr)"
|
|
8654
|
+
}, week.dates.map((dateISO, dayOffset) => {
|
|
8655
|
+
var dateNum = getDateNumber(dateISO);
|
|
8656
|
+
var isToday = dateISO === today;
|
|
8657
|
+
var isSelected = dateISO === selectedDate;
|
|
8658
|
+
var isCurrentMonth = isInMonth(dateISO, currentMonth);
|
|
8659
|
+
var dayIndex = weekStartIdx + dayOffset;
|
|
8660
|
+
var isDropTarget = dropTargetDays.includes(dayIndex);
|
|
8661
|
+
return /*#__PURE__*/React__default.createElement(appStudio.View, Object.assign({
|
|
8662
|
+
key: dateISO,
|
|
8663
|
+
"data-date": dateISO
|
|
8664
|
+
}, dayCellStyles, !isCurrentMonth && otherMonthDayCellStyles, isDropTarget && dropTargetStyles, {
|
|
8665
|
+
onClick: () => handleDateClick(dateISO),
|
|
8666
|
+
onDoubleClick: () => handleDateDoubleClick(dateISO)
|
|
8667
|
+
}, views.dayCell), /*#__PURE__*/React__default.createElement(appStudio.View, Object.assign({}, dayNumberStyles, isToday && todayDayNumberStyles, isSelected && !isToday && selectedDayNumberStyles, {
|
|
8668
|
+
style: {
|
|
8669
|
+
cursor: 'pointer'
|
|
8670
|
+
}
|
|
8671
|
+
}, views.dayNumber), dateNum));
|
|
8672
|
+
})), week.segments.length > 0 && (/*#__PURE__*/React__default.createElement(appStudio.View, {
|
|
8673
|
+
position: "absolute",
|
|
8674
|
+
left: 0,
|
|
8675
|
+
right: 0,
|
|
8676
|
+
top: MONTH_EVENT_TOP_OFFSET,
|
|
8677
|
+
pointerEvents: "none"
|
|
8678
|
+
}, week.segments.map(event => {
|
|
8679
|
+
var _dragStateRef$current, _dragStateRef$current2;
|
|
8680
|
+
var colorConfig = EVENT_COLORS[event.color || 'blue'];
|
|
8681
|
+
var dayWidth = 100 / week.dates.length;
|
|
8682
|
+
var left = event.segmentStartDay * dayWidth;
|
|
8683
|
+
var width = event.segmentDuration * dayWidth;
|
|
8684
|
+
var isDragging = dragStateRef.current.isDragging && ((_dragStateRef$current = dragStateRef.current.event) == null ? void 0 : _dragStateRef$current.id) === event.id;
|
|
8685
|
+
var isResizing = dragStateRef.current.isResizing && ((_dragStateRef$current2 = dragStateRef.current.event) == null ? void 0 : _dragStateRef$current2.id) === event.id;
|
|
8686
|
+
var showLeftHandle = event.startDay >= weekStartIdx && event.startDay <= weekEndIdx && event.segmentStartDay === event.startDay - weekStartIdx;
|
|
8687
|
+
var showRightHandle = event.endDay >= weekStartIdx && event.endDay <= weekEndIdx && event.segmentEndDay === event.endDay - weekStartIdx;
|
|
8688
|
+
return /*#__PURE__*/React__default.createElement(appStudio.View, Object.assign({
|
|
8689
|
+
key: event.id + "-" + event.weekIndex + "-" + event.segmentStartDay,
|
|
8690
|
+
position: "absolute",
|
|
8691
|
+
height: MONTH_EVENT_ROW_HEIGHT,
|
|
8692
|
+
display: "flex",
|
|
8693
|
+
alignItems: "center",
|
|
8694
|
+
paddingLeft: 8,
|
|
8695
|
+
paddingRight: 8,
|
|
8696
|
+
borderRadius: 4,
|
|
8697
|
+
backgroundColor: colorConfig.background,
|
|
8698
|
+
borderLeft: "3px solid",
|
|
8699
|
+
borderLeftColor: colorConfig.border,
|
|
8700
|
+
color: colorConfig.text,
|
|
8701
|
+
fontSize: 11,
|
|
8702
|
+
fontWeight: 500,
|
|
8703
|
+
overflow: "hidden",
|
|
8704
|
+
cursor: isDragging ? 'grabbing' : 'grab',
|
|
8705
|
+
opacity: isDragging || isResizing ? 0.7 : 1,
|
|
8706
|
+
boxShadow: isDragging || isResizing ? '0 4px 12px rgba(0,0,0,0.3)' : '0 1px 2px rgba(0,0,0,0.1)',
|
|
8707
|
+
transition: isDragging || isResizing ? 'none' : 'box-shadow 0.2s',
|
|
8708
|
+
pointerEvents: "auto",
|
|
8709
|
+
userSelect: "none",
|
|
8710
|
+
left: "calc(" + left + "% + 4px)",
|
|
8711
|
+
width: "calc(" + width + "% - 8px)",
|
|
8712
|
+
top: event.segmentRow * (MONTH_EVENT_ROW_HEIGHT + MONTH_EVENT_ROW_GAP) + "px",
|
|
8713
|
+
onMouseDown: e => handleEventMouseDown(e, event),
|
|
8714
|
+
title: event.title
|
|
8715
|
+
}, views.event), /*#__PURE__*/React__default.createElement(appStudio.View, {
|
|
8716
|
+
overflow: "hidden",
|
|
8717
|
+
textOverflow: "ellipsis",
|
|
8718
|
+
whiteSpace: "nowrap",
|
|
8719
|
+
width: "100%"
|
|
8720
|
+
}, event.title), showLeftHandle && (/*#__PURE__*/React__default.createElement(ResizeHandle, {
|
|
8721
|
+
direction: "left",
|
|
8722
|
+
onMouseDown: e => handleResizeStart(e, event, 'left')
|
|
8723
|
+
})), showRightHandle && (/*#__PURE__*/React__default.createElement(ResizeHandle, {
|
|
8724
|
+
direction: "right",
|
|
8725
|
+
onMouseDown: e => handleResizeStart(e, event, 'right')
|
|
8726
|
+
})));
|
|
8727
|
+
}))));
|
|
8728
|
+
}))));
|
|
8729
|
+
// Render week view
|
|
8730
|
+
var renderWeekView = () => (/*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(appStudio.View, Object.assign({}, weekdayHeaderStyles, views.weekdayHeader), calendarDates.map((dateISO, index) => {
|
|
8731
|
+
var dayOfWeek = getDayOfWeek(dateISO);
|
|
8732
|
+
var dateNum = getDateNumber(dateISO);
|
|
8733
|
+
var isToday = dateISO === today;
|
|
8734
|
+
return /*#__PURE__*/React__default.createElement(appStudio.View, Object.assign({
|
|
8735
|
+
key: dateISO,
|
|
8736
|
+
display: "flex",
|
|
8737
|
+
flexDirection: "column",
|
|
8738
|
+
alignItems: "center",
|
|
8739
|
+
padding: 8,
|
|
8740
|
+
gap: 4
|
|
8741
|
+
}, views.weekdayLabel), /*#__PURE__*/React__default.createElement(appStudio.View, Object.assign({}, weekdayLabelStyles), DAY_NAMES[dayOfWeek]), /*#__PURE__*/React__default.createElement(appStudio.View, Object.assign({}, dayDateStyles, isToday && todayDayNumberStyles, {
|
|
8742
|
+
fontSize: 16,
|
|
8743
|
+
fontWeight: isToday ? 500 : 400
|
|
8744
|
+
}), dateNum));
|
|
8745
|
+
})), /*#__PURE__*/React__default.createElement(appStudio.View, {
|
|
8746
|
+
ref: gridRef,
|
|
8747
|
+
display: "grid",
|
|
8748
|
+
gridTemplateColumns: "repeat(7, 1fr)",
|
|
8749
|
+
minHeight: 400
|
|
8750
|
+
}, calendarDates.map((dateISO, index) => {
|
|
8751
|
+
var isDropTarget = dropTargetDays.includes(index);
|
|
8752
|
+
var dayEvents = eventsByDate[dateISO] || [];
|
|
8753
|
+
return /*#__PURE__*/React__default.createElement(appStudio.View, Object.assign({
|
|
8754
|
+
key: dateISO,
|
|
8755
|
+
"data-date": dateISO
|
|
8756
|
+
}, dayCellStyles, isDropTarget && dropTargetStyles, {
|
|
8757
|
+
minHeight: 400,
|
|
8758
|
+
onClick: () => handleDateClick(dateISO),
|
|
8759
|
+
onDoubleClick: () => handleDateDoubleClick(dateISO)
|
|
8760
|
+
}), /*#__PURE__*/React__default.createElement(appStudio.View, Object.assign({}, eventsAreaStyles, views.eventsArea), dayEvents.map(event => {
|
|
8761
|
+
var _dragStateRef$current3, _dragStateRef$current4;
|
|
8762
|
+
var colorConfig = EVENT_COLORS[event.color || 'blue'];
|
|
8763
|
+
var isFirstDay = event.isFirstDay !== false;
|
|
8764
|
+
if (!isFirstDay) return null;
|
|
8765
|
+
var isDragging = dragStateRef.current.isDragging && ((_dragStateRef$current3 = dragStateRef.current.event) == null ? void 0 : _dragStateRef$current3.id) === event.id;
|
|
8766
|
+
var isResizing = dragStateRef.current.isResizing && ((_dragStateRef$current4 = dragStateRef.current.event) == null ? void 0 : _dragStateRef$current4.id) === event.id;
|
|
8767
|
+
return /*#__PURE__*/React__default.createElement(appStudio.View, Object.assign({
|
|
8768
|
+
key: event.id,
|
|
8769
|
+
position: "relative"
|
|
8770
|
+
}, eventStyles, {
|
|
8771
|
+
backgroundColor: colorConfig.background,
|
|
8772
|
+
borderLeftColor: colorConfig.border,
|
|
8773
|
+
color: colorConfig.text,
|
|
8774
|
+
cursor: isDragging ? 'grabbing' : 'grab',
|
|
8775
|
+
opacity: isDragging || isResizing ? 0.7 : 1,
|
|
8776
|
+
boxShadow: isDragging || isResizing ? '0 4px 12px rgba(0,0,0,0.3)' : '0 1px 2px rgba(0,0,0,0.1)',
|
|
8777
|
+
transition: isDragging || isResizing ? 'none' : 'box-shadow 0.2s',
|
|
8778
|
+
userSelect: "none",
|
|
8779
|
+
onMouseDown: e => handleEventMouseDown(e, event),
|
|
8780
|
+
title: event.title
|
|
8781
|
+
}, views.event), /*#__PURE__*/React__default.createElement(appStudio.View, {
|
|
8782
|
+
overflow: "hidden",
|
|
8783
|
+
textOverflow: "ellipsis",
|
|
8784
|
+
whiteSpace: "nowrap",
|
|
8785
|
+
width: "100%"
|
|
8786
|
+
}, event.title), /*#__PURE__*/React__default.createElement(ResizeHandle, {
|
|
8787
|
+
direction: "left",
|
|
8788
|
+
onMouseDown: e => handleResizeStart(e, event, 'left')
|
|
8789
|
+
}), /*#__PURE__*/React__default.createElement(ResizeHandle, {
|
|
8790
|
+
direction: "right",
|
|
8791
|
+
onMouseDown: e => handleResizeStart(e, event, 'right')
|
|
8792
|
+
}));
|
|
8793
|
+
})));
|
|
8794
|
+
}))));
|
|
8795
|
+
// Render day view with hourly time slots
|
|
8796
|
+
var renderDayView = () => {
|
|
8797
|
+
var hours = Array.from({
|
|
8798
|
+
length: 24
|
|
8799
|
+
}, (_, i) => i);
|
|
8800
|
+
var dateISO = currentDate;
|
|
8801
|
+
var dayEvents = eventsByDate[dateISO] || [];
|
|
8802
|
+
return /*#__PURE__*/React__default.createElement(appStudio.View, {
|
|
8803
|
+
display: "flex",
|
|
8804
|
+
flexDirection: "column",
|
|
8805
|
+
flex: 1
|
|
8806
|
+
}, hours.map(hour => {
|
|
8807
|
+
var hourStr = hour.toString().padStart(2, '0') + ":00";
|
|
8808
|
+
return /*#__PURE__*/React__default.createElement(appStudio.View, {
|
|
8809
|
+
key: hour,
|
|
8810
|
+
display: "flex",
|
|
8811
|
+
borderBottom: "1px solid",
|
|
8812
|
+
borderColor: "color.gray.200",
|
|
8813
|
+
minHeight: 60,
|
|
8814
|
+
onDoubleClick: () => handleDateDoubleClick(dateISO, hour),
|
|
8815
|
+
cursor: "pointer",
|
|
8816
|
+
_hover: {
|
|
8817
|
+
backgroundColor: 'color.gray.50'
|
|
8818
|
+
}
|
|
8819
|
+
}, /*#__PURE__*/React__default.createElement(appStudio.View, Object.assign({
|
|
8820
|
+
width: 80,
|
|
8821
|
+
padding: 8,
|
|
8822
|
+
fontSize: 12,
|
|
8823
|
+
color: "color.gray.600",
|
|
8824
|
+
borderRight: "1px solid",
|
|
8825
|
+
borderColor: "color.gray.200"
|
|
8826
|
+
}, views.timeColumn), hourStr), /*#__PURE__*/React__default.createElement(appStudio.View, Object.assign({
|
|
8827
|
+
flex: 1,
|
|
8828
|
+
padding: 8,
|
|
8829
|
+
position: "relative"
|
|
8830
|
+
}, views.timeSlot), dayEvents.filter(event => {
|
|
8831
|
+
// Simple check if event starts in this hour
|
|
8832
|
+
if (event.start.includes('T')) {
|
|
8833
|
+
var eventHour = parseInt(event.start.split('T')[1].split(':')[0]);
|
|
8834
|
+
return eventHour === hour;
|
|
8835
|
+
}
|
|
8836
|
+
return false;
|
|
8837
|
+
}).map(event => {
|
|
8838
|
+
var colorConfig = EVENT_COLORS[event.color || 'blue'];
|
|
8839
|
+
return /*#__PURE__*/React__default.createElement(appStudio.View, Object.assign({
|
|
8840
|
+
key: event.id
|
|
8841
|
+
}, eventStyles, {
|
|
8842
|
+
backgroundColor: colorConfig.background,
|
|
8843
|
+
borderLeftColor: colorConfig.border,
|
|
8844
|
+
color: colorConfig.text,
|
|
8845
|
+
marginBottom: 4
|
|
8846
|
+
}, views.event), event.title);
|
|
8847
|
+
})));
|
|
8848
|
+
}));
|
|
8849
|
+
};
|
|
8850
|
+
return /*#__PURE__*/React__default.createElement(appStudio.View, Object.assign({}, containerStyles, {
|
|
8851
|
+
width: width,
|
|
8852
|
+
maxWidth: maxWidth
|
|
8853
|
+
}, views.container), /*#__PURE__*/React__default.createElement(appStudio.Horizontal, Object.assign({}, headerStyles, views.header), /*#__PURE__*/React__default.createElement(appStudio.View, Object.assign({}, monthTitleStyles, views.monthTitle), getMonthName(currentMonth), " ", getYear(currentMonth)), /*#__PURE__*/React__default.createElement(appStudio.Horizontal, {
|
|
8854
|
+
gap: 8
|
|
8855
|
+
}, /*#__PURE__*/React__default.createElement(appStudio.Horizontal, Object.assign({
|
|
8856
|
+
gap: 4
|
|
8857
|
+
}, views.viewSwitcher), /*#__PURE__*/React__default.createElement(appStudio.View, Object.assign({}, buttonStyles, {
|
|
8858
|
+
backgroundColor: currentView === 'month' ? 'color.primary.100' : 'color.white',
|
|
8859
|
+
color: currentView === 'month' ? 'color.primary.700' : 'color.gray.700',
|
|
8860
|
+
onClick: () => handleViewChange('month'),
|
|
8861
|
+
style: {
|
|
8862
|
+
cursor: 'pointer'
|
|
8863
|
+
}
|
|
8864
|
+
}), "Month"), /*#__PURE__*/React__default.createElement(appStudio.View, Object.assign({}, buttonStyles, {
|
|
8865
|
+
backgroundColor: currentView === 'week' ? 'color.primary.100' : 'color.white',
|
|
8866
|
+
color: currentView === 'week' ? 'color.primary.700' : 'color.gray.700',
|
|
8867
|
+
onClick: () => handleViewChange('week'),
|
|
8868
|
+
style: {
|
|
8869
|
+
cursor: 'pointer'
|
|
8870
|
+
}
|
|
8871
|
+
}), "Week"), /*#__PURE__*/React__default.createElement(appStudio.View, Object.assign({}, buttonStyles, {
|
|
8872
|
+
backgroundColor: currentView === 'day' ? 'color.primary.100' : 'color.white',
|
|
8873
|
+
color: currentView === 'day' ? 'color.primary.700' : 'color.gray.700',
|
|
8874
|
+
onClick: () => handleViewChange('day'),
|
|
8875
|
+
style: {
|
|
8876
|
+
cursor: 'pointer'
|
|
8877
|
+
}
|
|
8878
|
+
}), "Day")), /*#__PURE__*/React__default.createElement(appStudio.View, Object.assign({}, buttonStyles, {
|
|
8879
|
+
onClick: handleToday,
|
|
8880
|
+
style: {
|
|
8881
|
+
cursor: 'pointer'
|
|
8882
|
+
}
|
|
8883
|
+
}, views.navButton), "Today"), /*#__PURE__*/React__default.createElement(appStudio.Horizontal, {
|
|
8884
|
+
gap: 4
|
|
8885
|
+
}, /*#__PURE__*/React__default.createElement(appStudio.View, Object.assign({}, iconButtonStyles, {
|
|
8886
|
+
onClick: handlePrevious,
|
|
8887
|
+
style: {
|
|
8888
|
+
cursor: 'pointer'
|
|
8889
|
+
}
|
|
8890
|
+
}, views.navButton), "\u2039"), /*#__PURE__*/React__default.createElement(appStudio.View, Object.assign({}, iconButtonStyles, {
|
|
8891
|
+
onClick: handleNext,
|
|
8892
|
+
style: {
|
|
8893
|
+
cursor: 'pointer'
|
|
8894
|
+
}
|
|
8895
|
+
}, views.navButton), "\u203A")))), currentView === 'month' && renderMonthView(), currentView === 'week' && renderWeekView(), currentView === 'day' && renderDayView());
|
|
8175
8896
|
};
|
|
8176
|
-
var Calendar = CalendarComponent;
|
|
8177
8897
|
|
|
8178
8898
|
/**
|
|
8179
8899
|
* Custom hook to manage cookie consent state
|
|
@@ -8305,7 +9025,7 @@ var getThemes$1 = themeMode => {
|
|
|
8305
9025
|
};
|
|
8306
9026
|
};
|
|
8307
9027
|
|
|
8308
|
-
var _excluded$
|
|
9028
|
+
var _excluded$i = ["title", "description", "acceptButtonText", "customizeButtonText", "position", "variant", "onAccept", "onCustomize", "views", "showCustomizeButton", "cookieExpiration", "themeMode"];
|
|
8309
9029
|
/**
|
|
8310
9030
|
* CookieConsent View Component
|
|
8311
9031
|
*
|
|
@@ -8326,7 +9046,7 @@ var CookieConsentView = _ref => {
|
|
|
8326
9046
|
cookieExpiration = 365,
|
|
8327
9047
|
themeMode: propThemeMode
|
|
8328
9048
|
} = _ref,
|
|
8329
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
9049
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$i);
|
|
8330
9050
|
// Get theme context
|
|
8331
9051
|
var {
|
|
8332
9052
|
themeMode: contextThemeMode
|
|
@@ -8567,8 +9287,8 @@ var ContextMenuItemStates = {
|
|
|
8567
9287
|
// Note: Manual positioning logic has been replaced with intelligent positioning
|
|
8568
9288
|
// using viewport-aware algorithms in the ContextMenu component
|
|
8569
9289
|
|
|
8570
|
-
var _excluded$
|
|
8571
|
-
_excluded2$
|
|
9290
|
+
var _excluded$j = ["children", "disableNativeContextMenu", "asChild", "isDisabled", "views"],
|
|
9291
|
+
_excluded2$6 = ["items", "children", "position", "side", "align", "views", "style"],
|
|
8572
9292
|
_excluded3$5 = ["item", "children", "onSelect", "isDisabled", "views"],
|
|
8573
9293
|
_excluded4$5 = ["views"],
|
|
8574
9294
|
_excluded5$2 = ["views"],
|
|
@@ -8623,7 +9343,7 @@ var ContextMenuTrigger = _ref2 => {
|
|
|
8623
9343
|
isDisabled = false,
|
|
8624
9344
|
views
|
|
8625
9345
|
} = _ref2,
|
|
8626
|
-
props = _objectWithoutPropertiesLoose(_ref2, _excluded$
|
|
9346
|
+
props = _objectWithoutPropertiesLoose(_ref2, _excluded$j);
|
|
8627
9347
|
var {
|
|
8628
9348
|
triggerRef,
|
|
8629
9349
|
contentId,
|
|
@@ -8677,7 +9397,7 @@ var ContextMenuContent = _ref3 => {
|
|
|
8677
9397
|
views,
|
|
8678
9398
|
style // Capture user-provided style
|
|
8679
9399
|
} = _ref3,
|
|
8680
|
-
props = _objectWithoutPropertiesLoose(_ref3, _excluded2$
|
|
9400
|
+
props = _objectWithoutPropertiesLoose(_ref3, _excluded2$6);
|
|
8681
9401
|
var {
|
|
8682
9402
|
isOpen,
|
|
8683
9403
|
position: contextPosition,
|
|
@@ -8969,7 +9689,7 @@ var ContextMenuView = _ref7 => {
|
|
|
8969
9689
|
}));
|
|
8970
9690
|
};
|
|
8971
9691
|
|
|
8972
|
-
var _excluded$
|
|
9692
|
+
var _excluded$k = ["children", "items", "size", "variant", "disableNativeContextMenu", "onOpenChange", "views"];
|
|
8973
9693
|
/**
|
|
8974
9694
|
* ContextMenu component for displaying a custom context menu on right-click.
|
|
8975
9695
|
* Supports both data-driven approach (with items prop) and compound component pattern.
|
|
@@ -8984,7 +9704,7 @@ var ContextMenuComponent = _ref => {
|
|
|
8984
9704
|
onOpenChange,
|
|
8985
9705
|
views
|
|
8986
9706
|
} = _ref,
|
|
8987
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
9707
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$k);
|
|
8988
9708
|
var state = useContextMenuState({
|
|
8989
9709
|
size,
|
|
8990
9710
|
variant,
|
|
@@ -9036,15 +9756,15 @@ ContextMenu.Item = ContextMenuItem;
|
|
|
9036
9756
|
ContextMenu.Divider = ContextMenuDivider;
|
|
9037
9757
|
ContextMenu.Separator = ContextMenuSeparator; // Add the Separator component
|
|
9038
9758
|
|
|
9039
|
-
var _excluded$
|
|
9040
|
-
_excluded2$
|
|
9759
|
+
var _excluded$l = ["src", "color", "views", "themeMode"],
|
|
9760
|
+
_excluded2$7 = ["path"];
|
|
9041
9761
|
var FileSVG = _ref => {
|
|
9042
9762
|
var {
|
|
9043
9763
|
src,
|
|
9044
9764
|
color,
|
|
9045
9765
|
views
|
|
9046
9766
|
} = _ref,
|
|
9047
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
9767
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$l);
|
|
9048
9768
|
var {
|
|
9049
9769
|
getColor,
|
|
9050
9770
|
themeMode
|
|
@@ -9067,7 +9787,7 @@ var FileImage = _ref2 => {
|
|
|
9067
9787
|
var {
|
|
9068
9788
|
path
|
|
9069
9789
|
} = _ref2,
|
|
9070
|
-
props = _objectWithoutPropertiesLoose(_ref2, _excluded2$
|
|
9790
|
+
props = _objectWithoutPropertiesLoose(_ref2, _excluded2$7);
|
|
9071
9791
|
return /*#__PURE__*/React__default.createElement(appStudio.Image, Object.assign({
|
|
9072
9792
|
src: path
|
|
9073
9793
|
}, props));
|
|
@@ -9120,7 +9840,7 @@ var useItemState = () => {
|
|
|
9120
9840
|
};
|
|
9121
9841
|
};
|
|
9122
9842
|
|
|
9123
|
-
var _excluded$
|
|
9843
|
+
var _excluded$m = ["children", "views"];
|
|
9124
9844
|
var HelperText = _ref => {
|
|
9125
9845
|
var {
|
|
9126
9846
|
children,
|
|
@@ -9128,7 +9848,7 @@ var HelperText = _ref => {
|
|
|
9128
9848
|
helperText: {}
|
|
9129
9849
|
}
|
|
9130
9850
|
} = _ref,
|
|
9131
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
9851
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$m);
|
|
9132
9852
|
return /*#__PURE__*/React__default.createElement(Text
|
|
9133
9853
|
// Typography properties
|
|
9134
9854
|
, Object.assign({
|
|
@@ -9154,7 +9874,7 @@ var HelperText = _ref => {
|
|
|
9154
9874
|
}, views['helperText'], props), children);
|
|
9155
9875
|
};
|
|
9156
9876
|
|
|
9157
|
-
var _excluded$
|
|
9877
|
+
var _excluded$n = ["children", "helperText", "error", "views"];
|
|
9158
9878
|
var FieldContainer = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
|
|
9159
9879
|
var {
|
|
9160
9880
|
children,
|
|
@@ -9162,7 +9882,7 @@ var FieldContainer = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
|
|
|
9162
9882
|
error = false,
|
|
9163
9883
|
views
|
|
9164
9884
|
} = _ref,
|
|
9165
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
9885
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$n);
|
|
9166
9886
|
return /*#__PURE__*/React__default.createElement(appStudio.Vertical, Object.assign({
|
|
9167
9887
|
ref: ref,
|
|
9168
9888
|
// Layout properties
|
|
@@ -9198,13 +9918,23 @@ FieldContainer.displayName = 'FieldContainer';
|
|
|
9198
9918
|
*/
|
|
9199
9919
|
var Shapes = {
|
|
9200
9920
|
default: {
|
|
9201
|
-
borderRadius: '8px'
|
|
9921
|
+
borderRadius: '8px',
|
|
9922
|
+
media: {
|
|
9923
|
+
mobile: {
|
|
9924
|
+
borderRadius: '6px'
|
|
9925
|
+
}
|
|
9926
|
+
}
|
|
9202
9927
|
},
|
|
9203
9928
|
sharp: {
|
|
9204
9929
|
borderRadius: 0
|
|
9205
9930
|
},
|
|
9206
9931
|
rounded: {
|
|
9207
|
-
borderRadius: '8px'
|
|
9932
|
+
borderRadius: '8px',
|
|
9933
|
+
media: {
|
|
9934
|
+
mobile: {
|
|
9935
|
+
borderRadius: '6px'
|
|
9936
|
+
}
|
|
9937
|
+
}
|
|
9208
9938
|
},
|
|
9209
9939
|
pillShaped: {
|
|
9210
9940
|
borderRadius: '9999px'
|
|
@@ -9229,13 +9959,19 @@ var InputVariants = {
|
|
|
9229
9959
|
borderStyle: 'solid',
|
|
9230
9960
|
borderColor: 'color.gray.200',
|
|
9231
9961
|
backgroundColor: 'color.white',
|
|
9232
|
-
transition: '
|
|
9962
|
+
transition: 'border-color 0.2s ease, box-shadow 0.2s ease',
|
|
9233
9963
|
_hover: {
|
|
9234
9964
|
borderColor: 'color.gray.300'
|
|
9235
9965
|
},
|
|
9236
9966
|
_focus: {
|
|
9237
9967
|
borderColor: 'theme.primary',
|
|
9238
|
-
|
|
9968
|
+
outline: 'none',
|
|
9969
|
+
boxShadow: '0 0 0 2px rgba(255, 255, 255, 1), 0 0 0 4px rgba(66, 153, 225, 0.2)'
|
|
9970
|
+
},
|
|
9971
|
+
_focusVisible: {
|
|
9972
|
+
borderColor: 'theme.primary',
|
|
9973
|
+
outline: 'none',
|
|
9974
|
+
boxShadow: '0 0 0 2px rgba(255, 255, 255, 1), 0 0 0 4px rgba(66, 153, 225, 0.2)'
|
|
9239
9975
|
}
|
|
9240
9976
|
},
|
|
9241
9977
|
default: {
|
|
@@ -9245,18 +9981,29 @@ var InputVariants = {
|
|
|
9245
9981
|
borderBottomColor: 'color.gray.200',
|
|
9246
9982
|
borderRadius: 0,
|
|
9247
9983
|
backgroundColor: 'color.white',
|
|
9248
|
-
transition: '
|
|
9984
|
+
transition: 'border-color 0.2s ease',
|
|
9249
9985
|
_hover: {
|
|
9250
9986
|
borderBottomColor: 'color.gray.300'
|
|
9251
9987
|
},
|
|
9252
9988
|
_focus: {
|
|
9253
|
-
borderBottomColor: 'theme.primary'
|
|
9989
|
+
borderBottomColor: 'theme.primary',
|
|
9990
|
+
outline: 'none'
|
|
9991
|
+
},
|
|
9992
|
+
_focusVisible: {
|
|
9993
|
+
borderBottomColor: 'theme.primary',
|
|
9994
|
+
outline: 'none'
|
|
9254
9995
|
}
|
|
9255
9996
|
},
|
|
9256
9997
|
none: {
|
|
9257
9998
|
border: 'none',
|
|
9258
9999
|
backgroundColor: 'transparent',
|
|
9259
|
-
transition: '
|
|
10000
|
+
transition: 'background-color 0.2s ease',
|
|
10001
|
+
_focus: {
|
|
10002
|
+
outline: 'none'
|
|
10003
|
+
},
|
|
10004
|
+
_focusVisible: {
|
|
10005
|
+
outline: 'none'
|
|
10006
|
+
}
|
|
9260
10007
|
}
|
|
9261
10008
|
};
|
|
9262
10009
|
/**
|
|
@@ -9266,7 +10013,15 @@ var PadddingWithLabel = {
|
|
|
9266
10013
|
paddingTop: '16px',
|
|
9267
10014
|
paddingBottom: '8px',
|
|
9268
10015
|
paddingLeft: '16px',
|
|
9269
|
-
paddingRight: '16px'
|
|
10016
|
+
paddingRight: '16px',
|
|
10017
|
+
media: {
|
|
10018
|
+
mobile: {
|
|
10019
|
+
paddingTop: '12px',
|
|
10020
|
+
paddingBottom: '6px',
|
|
10021
|
+
paddingLeft: '12px',
|
|
10022
|
+
paddingRight: '12px'
|
|
10023
|
+
}
|
|
10024
|
+
}
|
|
9270
10025
|
};
|
|
9271
10026
|
/**
|
|
9272
10027
|
* Padding for input without label following the 4px grid system
|
|
@@ -9275,10 +10030,18 @@ var PaddingWithoutLabel = {
|
|
|
9275
10030
|
paddingTop: '12px',
|
|
9276
10031
|
paddingBottom: '12px',
|
|
9277
10032
|
paddingLeft: '16px',
|
|
9278
|
-
paddingRight: '16px'
|
|
10033
|
+
paddingRight: '16px',
|
|
10034
|
+
media: {
|
|
10035
|
+
mobile: {
|
|
10036
|
+
paddingTop: '10px',
|
|
10037
|
+
paddingBottom: '10px',
|
|
10038
|
+
paddingLeft: '12px',
|
|
10039
|
+
paddingRight: '12px'
|
|
10040
|
+
}
|
|
10041
|
+
}
|
|
9279
10042
|
};
|
|
9280
10043
|
|
|
9281
|
-
var _excluded$
|
|
10044
|
+
var _excluded$o = ["label", "shadow", "children", "value", "size", "shape", "variant", "error", "showLabel", "isFocused", "isHovered", "isDisabled", "isReadOnly", "views"];
|
|
9282
10045
|
var FieldContent = _ref => {
|
|
9283
10046
|
var {
|
|
9284
10047
|
shadow,
|
|
@@ -9296,7 +10059,7 @@ var FieldContent = _ref => {
|
|
|
9296
10059
|
pickerBox: {}
|
|
9297
10060
|
}
|
|
9298
10061
|
} = _ref,
|
|
9299
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
10062
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$o);
|
|
9300
10063
|
// Determine if the field is in an interactive state
|
|
9301
10064
|
var isInteractive = (isHovered || isFocused) && !isDisabled;
|
|
9302
10065
|
// Set the appropriate color based on state
|
|
@@ -9325,12 +10088,12 @@ var FieldContent = _ref => {
|
|
|
9325
10088
|
}, showLabel ? PadddingWithLabel : PaddingWithoutLabel, shadow, Shapes[shape], InputVariants[variant], views['box'], props), children);
|
|
9326
10089
|
};
|
|
9327
10090
|
|
|
9328
|
-
var _excluded$
|
|
10091
|
+
var _excluded$p = ["children"];
|
|
9329
10092
|
var FieldIcons = _ref => {
|
|
9330
10093
|
var {
|
|
9331
10094
|
children
|
|
9332
10095
|
} = _ref,
|
|
9333
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
10096
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$p);
|
|
9334
10097
|
return /*#__PURE__*/React__default.createElement(appStudio.Center, Object.assign({
|
|
9335
10098
|
gap: 10,
|
|
9336
10099
|
right: 10,
|
|
@@ -9381,7 +10144,7 @@ var HeadingSizes$1 = {
|
|
|
9381
10144
|
}
|
|
9382
10145
|
};
|
|
9383
10146
|
|
|
9384
|
-
var _excluded$
|
|
10147
|
+
var _excluded$q = ["children", "heading", "isItalic", "isUnderlined", "isStriked", "weight", "size", "dropDown"];
|
|
9385
10148
|
var LabelView = _ref => {
|
|
9386
10149
|
var {
|
|
9387
10150
|
children,
|
|
@@ -9397,7 +10160,7 @@ var LabelView = _ref => {
|
|
|
9397
10160
|
size = 'sm'
|
|
9398
10161
|
// The fontSize prop for the Element is determined by the 'size' prop passed to LabelView.
|
|
9399
10162
|
} = _ref,
|
|
9400
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
10163
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$q);
|
|
9401
10164
|
// The fontStyle prop toggles between 'italic' and 'normal' based on the 'isItalic' boolean prop.
|
|
9402
10165
|
var headingStyles = heading ? HeadingSizes$1[heading] : {};
|
|
9403
10166
|
// fontWeight is derived from the Typography module, ensuring consistent font weighting across the app.
|
|
@@ -9429,7 +10192,7 @@ React__default.createElement(LabelView, Object.assign({}, props))
|
|
|
9429
10192
|
var Label = LabelComponent;
|
|
9430
10193
|
// Export the 'LabelComponent' as 'Label' to be reused throughout the project.
|
|
9431
10194
|
|
|
9432
|
-
var _excluded$
|
|
10195
|
+
var _excluded$r = ["children", "size", "error", "color", "views", "helperText"];
|
|
9433
10196
|
var FieldLabel = _ref => {
|
|
9434
10197
|
var {
|
|
9435
10198
|
children,
|
|
@@ -9440,7 +10203,7 @@ var FieldLabel = _ref => {
|
|
|
9440
10203
|
label: {}
|
|
9441
10204
|
}
|
|
9442
10205
|
} = _ref,
|
|
9443
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
10206
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$r);
|
|
9444
10207
|
return /*#__PURE__*/React__default.createElement(Label
|
|
9445
10208
|
// Position properties
|
|
9446
10209
|
, Object.assign({
|
|
@@ -9461,12 +10224,12 @@ var FieldLabel = _ref => {
|
|
|
9461
10224
|
}, views['label'], props), children);
|
|
9462
10225
|
};
|
|
9463
10226
|
|
|
9464
|
-
var _excluded$
|
|
10227
|
+
var _excluded$s = ["children"];
|
|
9465
10228
|
var FieldWrapper = _ref => {
|
|
9466
10229
|
var {
|
|
9467
10230
|
children
|
|
9468
10231
|
} = _ref,
|
|
9469
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
10232
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$s);
|
|
9470
10233
|
return /*#__PURE__*/React__default.createElement(appStudio.Vertical
|
|
9471
10234
|
// Layout properties
|
|
9472
10235
|
, Object.assign({
|
|
@@ -9499,8 +10262,8 @@ var IconSizes$2 = {
|
|
|
9499
10262
|
xl: 28
|
|
9500
10263
|
};
|
|
9501
10264
|
|
|
9502
|
-
var _excluded$
|
|
9503
|
-
_excluded2$
|
|
10265
|
+
var _excluded$t = ["isHovered", "setIsHovered", "option", "size", "callback", "style"],
|
|
10266
|
+
_excluded2$8 = ["id", "name", "value", "onChange", "isMulti", "isDisabled", "isReadOnly", "options"],
|
|
9504
10267
|
_excluded3$6 = ["option", "size", "removeOption"],
|
|
9505
10268
|
_excluded4$6 = ["id", "name", "label", "value", "placeholder", "helperText", "hide", "error", "isMulti", "isFocused", "isHovered", "isDisabled", "isReadOnly", "options", "shadow", "size", "shape", "variant", "views", "onChange", "setHide", "setValue", "setIsHovered", "setIsFocused", "setHighlightedIndex", "highlightedIndex"];
|
|
9506
10269
|
/**
|
|
@@ -9517,7 +10280,7 @@ var Item = _ref => {
|
|
|
9517
10280
|
callback = () => {},
|
|
9518
10281
|
style
|
|
9519
10282
|
} = _ref,
|
|
9520
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
10283
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$t);
|
|
9521
10284
|
// Handles the click event on an option by invoking the callback with the selected option's value
|
|
9522
10285
|
var handleOptionClick = (e, option) => {
|
|
9523
10286
|
e.stopPropagation();
|
|
@@ -9625,7 +10388,7 @@ var HiddenSelect = _ref4 => {
|
|
|
9625
10388
|
isReadOnly = false,
|
|
9626
10389
|
options = []
|
|
9627
10390
|
} = _ref4,
|
|
9628
|
-
props = _objectWithoutPropertiesLoose(_ref4, _excluded2$
|
|
10391
|
+
props = _objectWithoutPropertiesLoose(_ref4, _excluded2$8);
|
|
9629
10392
|
var handleChange = event => {
|
|
9630
10393
|
if (onChange) onChange(event);
|
|
9631
10394
|
};
|
|
@@ -10110,18 +10873,27 @@ var ColorSchemes = {
|
|
|
10110
10873
|
// State-specific colors
|
|
10111
10874
|
states: {
|
|
10112
10875
|
hover: {
|
|
10113
|
-
active:
|
|
10114
|
-
|
|
10876
|
+
active: {
|
|
10877
|
+
opacity: 0.9
|
|
10878
|
+
},
|
|
10879
|
+
inactive: {
|
|
10880
|
+
backgroundColor: 'color.gray.400'
|
|
10881
|
+
}
|
|
10115
10882
|
},
|
|
10116
10883
|
focus: {
|
|
10117
|
-
active:
|
|
10118
|
-
|
|
10119
|
-
|
|
10884
|
+
active: {
|
|
10885
|
+
outline: 'none',
|
|
10886
|
+
boxShadow: '0 0 0 2px rgba(255, 255, 255, 1), 0 0 0 4px rgba(66, 153, 225, 0.3)'
|
|
10887
|
+
},
|
|
10888
|
+
inactive: {
|
|
10889
|
+
outline: 'none',
|
|
10890
|
+
boxShadow: '0 0 0 2px rgba(255, 255, 255, 1), 0 0 0 4px rgba(0, 0, 0, 0.1)'
|
|
10891
|
+
}
|
|
10120
10892
|
}
|
|
10121
10893
|
}
|
|
10122
10894
|
};
|
|
10123
10895
|
|
|
10124
|
-
var _excluded$
|
|
10896
|
+
var _excluded$u = ["id", "name", "label", "inActiveChild", "isChecked", "activeChild", "labelPosition", "shadow", "size", "value", "isHovered", "isDisabled", "isReadOnly", "on", "setOn", "onChange", "setValue", "setIsHovered", "helperText", "views"];
|
|
10125
10897
|
var SwitchContent = props => /*#__PURE__*/React__default.createElement(appStudio.Input, Object.assign({
|
|
10126
10898
|
type: "checkbox"
|
|
10127
10899
|
}, props));
|
|
@@ -10149,7 +10921,7 @@ var SwitchView = _ref => {
|
|
|
10149
10921
|
label: {}
|
|
10150
10922
|
}
|
|
10151
10923
|
} = _ref,
|
|
10152
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
10924
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$u);
|
|
10153
10925
|
var handleToggle = event => {
|
|
10154
10926
|
if (!isReadOnly && !isDisabled) {
|
|
10155
10927
|
var newValue = event.target.checked;
|
|
@@ -10286,7 +11058,7 @@ var useTextAreaState = _ref => {
|
|
|
10286
11058
|
// Export of the useTextAreaState hook for external usage.
|
|
10287
11059
|
};
|
|
10288
11060
|
|
|
10289
|
-
var _excluded$
|
|
11061
|
+
var _excluded$v = ["id", "name", "hint", "error", "value", "label", "shadow", "helperText", "placeholder", "size", "shape", "variant", "isHovered", "isFocused", "isEditable", "isReadOnly", "isDisabled", "isAutoFocus", "isMultiline", "maxRows", "maxCols", "onBlur", "onChange", "onFocus", "setHint", "setValue", "setIsFocused", "setIsHovered", "views"];
|
|
10290
11062
|
var TextAreaView = _ref => {
|
|
10291
11063
|
var {
|
|
10292
11064
|
id,
|
|
@@ -10321,7 +11093,7 @@ var TextAreaView = _ref => {
|
|
|
10321
11093
|
helperText: {}
|
|
10322
11094
|
}
|
|
10323
11095
|
} = _ref,
|
|
10324
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
11096
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$v);
|
|
10325
11097
|
var showLabel = !!(isFocused && label);
|
|
10326
11098
|
/**
|
|
10327
11099
|
* Styles for the textarea field
|
|
@@ -10460,7 +11232,7 @@ var useTextFieldState = _ref => {
|
|
|
10460
11232
|
};
|
|
10461
11233
|
};
|
|
10462
11234
|
|
|
10463
|
-
var _excluded$
|
|
11235
|
+
var _excluded$w = ["id", "name", "label", "hint", "value", "onChange", "left", "right", "helperText", "placeholder", "onChangeText", "shadow", "views", "size", "shape", "variant", "error", "isFocused", "isHovered", "isDisabled", "isReadOnly", "isClearable", "isAutoFocus", "setHint", "setIsFocused", "setIsHovered", "setValue", "onClick", "onFocus", "onBlur", "themeMode"];
|
|
10464
11236
|
/**
|
|
10465
11237
|
* Input component for text fields
|
|
10466
11238
|
*/
|
|
@@ -10506,7 +11278,7 @@ var TextFieldView = _ref => {
|
|
|
10506
11278
|
onBlur = () => {},
|
|
10507
11279
|
themeMode: elementMode
|
|
10508
11280
|
} = _ref,
|
|
10509
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
11281
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$w);
|
|
10510
11282
|
var {
|
|
10511
11283
|
getColor,
|
|
10512
11284
|
themeMode
|
|
@@ -10699,19 +11471,26 @@ var VariantStyles = {
|
|
|
10699
11471
|
selected: {
|
|
10700
11472
|
backgroundColor: 'theme.primary',
|
|
10701
11473
|
borderColor: 'theme.primary',
|
|
10702
|
-
|
|
11474
|
+
borderWidth: '2px',
|
|
11475
|
+
borderStyle: 'solid',
|
|
11476
|
+
color: 'color.white',
|
|
11477
|
+
transition: 'background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease'
|
|
10703
11478
|
},
|
|
10704
11479
|
unselected: {
|
|
10705
11480
|
backgroundColor: 'color.white',
|
|
10706
11481
|
borderWidth: '2px',
|
|
10707
11482
|
borderStyle: 'solid',
|
|
10708
11483
|
borderColor: 'color.gray.300',
|
|
10709
|
-
color: 'color.black'
|
|
11484
|
+
color: 'color.black',
|
|
11485
|
+
transition: 'background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease'
|
|
10710
11486
|
},
|
|
10711
11487
|
indeterminate: {
|
|
10712
11488
|
backgroundColor: 'theme.primary',
|
|
10713
11489
|
borderColor: 'theme.primary',
|
|
10714
|
-
|
|
11490
|
+
borderWidth: '2px',
|
|
11491
|
+
borderStyle: 'solid',
|
|
11492
|
+
color: 'color.white',
|
|
11493
|
+
transition: 'background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease'
|
|
10715
11494
|
}
|
|
10716
11495
|
};
|
|
10717
11496
|
/**
|
|
@@ -10720,31 +11499,47 @@ var VariantStyles = {
|
|
|
10720
11499
|
var StateStyles = {
|
|
10721
11500
|
hover: {
|
|
10722
11501
|
selected: {
|
|
10723
|
-
|
|
10724
|
-
borderColor: 'color.blue.600'
|
|
11502
|
+
opacity: 0.9
|
|
10725
11503
|
},
|
|
10726
11504
|
unselected: {
|
|
10727
|
-
borderColor: 'color.gray.400'
|
|
11505
|
+
borderColor: 'color.gray.400',
|
|
11506
|
+
backgroundColor: 'color.gray.50'
|
|
11507
|
+
},
|
|
11508
|
+
indeterminate: {
|
|
11509
|
+
opacity: 0.9
|
|
11510
|
+
}
|
|
11511
|
+
},
|
|
11512
|
+
focus: {
|
|
11513
|
+
selected: {
|
|
11514
|
+
outline: 'none',
|
|
11515
|
+
boxShadow: '0 0 0 2px rgba(255, 255, 255, 1), 0 0 0 4px rgba(66, 153, 225, 0.3)'
|
|
11516
|
+
},
|
|
11517
|
+
unselected: {
|
|
11518
|
+
outline: 'none',
|
|
11519
|
+
boxShadow: '0 0 0 2px rgba(255, 255, 255, 1), 0 0 0 4px rgba(66, 153, 225, 0.3)'
|
|
10728
11520
|
},
|
|
10729
11521
|
indeterminate: {
|
|
10730
|
-
|
|
10731
|
-
|
|
11522
|
+
outline: 'none',
|
|
11523
|
+
boxShadow: '0 0 0 2px rgba(255, 255, 255, 1), 0 0 0 4px rgba(66, 153, 225, 0.3)'
|
|
10732
11524
|
}
|
|
10733
11525
|
},
|
|
10734
11526
|
disabled: {
|
|
10735
11527
|
selected: {
|
|
10736
11528
|
backgroundColor: 'color.gray.300',
|
|
10737
11529
|
borderColor: 'color.gray.300',
|
|
10738
|
-
opacity: 0.
|
|
11530
|
+
opacity: 0.5,
|
|
11531
|
+
cursor: 'not-allowed'
|
|
10739
11532
|
},
|
|
10740
11533
|
unselected: {
|
|
10741
11534
|
borderColor: 'color.gray.300',
|
|
10742
|
-
opacity: 0.
|
|
11535
|
+
opacity: 0.5,
|
|
11536
|
+
cursor: 'not-allowed'
|
|
10743
11537
|
},
|
|
10744
11538
|
indeterminate: {
|
|
10745
11539
|
backgroundColor: 'color.gray.300',
|
|
10746
11540
|
borderColor: 'color.gray.300',
|
|
10747
|
-
opacity: 0.
|
|
11541
|
+
opacity: 0.5,
|
|
11542
|
+
cursor: 'not-allowed'
|
|
10748
11543
|
}
|
|
10749
11544
|
},
|
|
10750
11545
|
error: {
|
|
@@ -10762,7 +11557,7 @@ var StateStyles = {
|
|
|
10762
11557
|
}
|
|
10763
11558
|
};
|
|
10764
11559
|
|
|
10765
|
-
var _excluded$
|
|
11560
|
+
var _excluded$x = ["id", "icon", "name", "label", "isChecked", "onChange", "onValueChange", "shadow", "labelPosition", "size", "error", "isSelected", "isHovered", "isDisabled", "isReadOnly", "isIndeterminate", "defaultIsSelected", "setIsSelected", "setIsHovered", "views", "infoText", "helperText"];
|
|
10766
11561
|
var CheckboxView = _ref => {
|
|
10767
11562
|
var {
|
|
10768
11563
|
id,
|
|
@@ -10789,7 +11584,7 @@ var CheckboxView = _ref => {
|
|
|
10789
11584
|
},
|
|
10790
11585
|
infoText
|
|
10791
11586
|
} = _ref,
|
|
10792
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
11587
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$x);
|
|
10793
11588
|
var handleHover = () => setIsHovered(!isHovered);
|
|
10794
11589
|
var handleChange = () => {
|
|
10795
11590
|
if (!isReadOnly && !isDisabled) {
|
|
@@ -11247,7 +12042,7 @@ var DefaultColorPalette = [
|
|
|
11247
12042
|
value: 'transparent'
|
|
11248
12043
|
}];
|
|
11249
12044
|
|
|
11250
|
-
var _excluded$
|
|
12045
|
+
var _excluded$y = ["id", "name", "label", "placeholder", "helperText", "views", "size", "shape", "variant", "shadow", "error", "isDisabled", "isReadOnly", "isFocused", "isHovered", "predefinedColors", "showCustomInput", "showRecentColors", "isOpen", "selectedColor", "recentColors", "customColor", "handleToggle", "handleColorSelect", "handleCustomColorChange", "handleCustomColorSubmit", "setIsFocused", "setIsHovered", "triggerRef", "dropdownRef"];
|
|
11251
12046
|
var ColorInputView = _ref => {
|
|
11252
12047
|
var {
|
|
11253
12048
|
// Basic props
|
|
@@ -11288,7 +12083,7 @@ var ColorInputView = _ref => {
|
|
|
11288
12083
|
dropdownRef
|
|
11289
12084
|
// Other props
|
|
11290
12085
|
} = _ref,
|
|
11291
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
12086
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$y);
|
|
11292
12087
|
var {
|
|
11293
12088
|
getColor
|
|
11294
12089
|
} = appStudio.useTheme();
|
|
@@ -12927,11 +13722,11 @@ var IconSizes$4 = {
|
|
|
12927
13722
|
xl: 16
|
|
12928
13723
|
};
|
|
12929
13724
|
|
|
12930
|
-
var _excluded$
|
|
12931
|
-
_excluded2$
|
|
13725
|
+
var _excluded$z = ["size"],
|
|
13726
|
+
_excluded2$9 = ["size"],
|
|
12932
13727
|
_excluded3$7 = ["id", "name", "label", "value", "placeholder", "helperText", "hide", "error", "isHovered", "isFocused", "isAutoFocus", "isDisabled", "isReadOnly", "shadow", "newOptions", "size", "variant", "shape", "onChange", "onBlur", "setHide", "setNewOptions", "setIsHovered", "setIsFocused", "setValue", "views", "themeMode"];
|
|
12933
13728
|
var CountryList = _ref => {
|
|
12934
|
-
var props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
13729
|
+
var props = _objectWithoutPropertiesLoose(_ref, _excluded$z);
|
|
12935
13730
|
return /*#__PURE__*/React__default.createElement(appStudio.Element, Object.assign({
|
|
12936
13731
|
as: "ul"
|
|
12937
13732
|
}, props));
|
|
@@ -12940,7 +13735,7 @@ var CountrySelector = props => (/*#__PURE__*/React__default.createElement(appStu
|
|
|
12940
13735
|
type: "country"
|
|
12941
13736
|
}, props)));
|
|
12942
13737
|
var CountryItem = _ref2 => {
|
|
12943
|
-
var props = _objectWithoutPropertiesLoose(_ref2, _excluded2$
|
|
13738
|
+
var props = _objectWithoutPropertiesLoose(_ref2, _excluded2$9);
|
|
12944
13739
|
return /*#__PURE__*/React__default.createElement(appStudio.Element, Object.assign({
|
|
12945
13740
|
as: "li"
|
|
12946
13741
|
}, props));
|
|
@@ -13172,7 +13967,7 @@ var useDatePickerState = () => {
|
|
|
13172
13967
|
};
|
|
13173
13968
|
};
|
|
13174
13969
|
|
|
13175
|
-
var _excluded$
|
|
13970
|
+
var _excluded$A = ["id", "icon", "name", "label", "date", "children", "helperText", "shadow", "size", "variant", "shape", "views", "error", "isHovered", "isFocused", "isDisabled", "isReadOnly", "setDate", "setIsFocused", "setIsHovered", "onChange", "onChangeText"];
|
|
13176
13971
|
var DatePickerContent = props => /*#__PURE__*/React__default.createElement(appStudio.Input, Object.assign({
|
|
13177
13972
|
type: "date"
|
|
13178
13973
|
}, props));
|
|
@@ -13205,7 +14000,7 @@ var DatePickerView = _ref => {
|
|
|
13205
14000
|
onChange,
|
|
13206
14001
|
onChangeText
|
|
13207
14002
|
} = _ref,
|
|
13208
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
14003
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$A);
|
|
13209
14004
|
var showLabel = !!(isFocused && label);
|
|
13210
14005
|
var handleHover = () => setIsHovered(!isHovered);
|
|
13211
14006
|
var handleFocus = () => setIsFocused(true);
|
|
@@ -13292,8 +14087,8 @@ var usePasswordState = props => {
|
|
|
13292
14087
|
}, props, textFieldStates);
|
|
13293
14088
|
};
|
|
13294
14089
|
|
|
13295
|
-
var _excluded$
|
|
13296
|
-
_excluded2$
|
|
14090
|
+
var _excluded$B = ["visibleIcon", "hiddenIcon"],
|
|
14091
|
+
_excluded2$a = ["isVisible", "setIsVisible"];
|
|
13297
14092
|
var PasswordComponent = _ref => {
|
|
13298
14093
|
var {
|
|
13299
14094
|
visibleIcon = /*#__PURE__*/React__default.createElement(OpenEyeIcon, {
|
|
@@ -13303,13 +14098,13 @@ var PasswordComponent = _ref => {
|
|
|
13303
14098
|
widthHeight: 14
|
|
13304
14099
|
})
|
|
13305
14100
|
} = _ref,
|
|
13306
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
14101
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$B);
|
|
13307
14102
|
var _usePasswordState = usePasswordState(props),
|
|
13308
14103
|
{
|
|
13309
14104
|
isVisible,
|
|
13310
14105
|
setIsVisible
|
|
13311
14106
|
} = _usePasswordState,
|
|
13312
|
-
passwordProps = _objectWithoutPropertiesLoose(_usePasswordState, _excluded2$
|
|
14107
|
+
passwordProps = _objectWithoutPropertiesLoose(_usePasswordState, _excluded2$a);
|
|
13313
14108
|
return /*#__PURE__*/React__default.createElement(TextFieldView, Object.assign({}, passwordProps, {
|
|
13314
14109
|
type: isVisible ? 'text' : 'password',
|
|
13315
14110
|
isClearable: false,
|
|
@@ -13357,7 +14152,7 @@ var useComboBoxState = (items, placeholder, searchPlaceholder) => {
|
|
|
13357
14152
|
};
|
|
13358
14153
|
};
|
|
13359
14154
|
|
|
13360
|
-
var _excluded$
|
|
14155
|
+
var _excluded$C = ["placeholder", "items", "showTick", "onSelect", "searchEnabled", "left", "right", "label", "filteredItems", "setSelectedItem", "selectedItem", "highlightedIndex", "setHighlightedIndex", "searchQuery", "setSearchQuery", "setFilteredItems", "views", "isDropdownVisible", "setIsDropdownVisible"];
|
|
13361
14156
|
// Defines the functional component 'ComboBoxView' with destructured props.
|
|
13362
14157
|
var ComboBoxView = _ref => {
|
|
13363
14158
|
var {
|
|
@@ -13382,7 +14177,7 @@ var ComboBoxView = _ref => {
|
|
|
13382
14177
|
setIsDropdownVisible
|
|
13383
14178
|
// Collects all further props not destructured explicitly.
|
|
13384
14179
|
} = _ref,
|
|
13385
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
14180
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$C);
|
|
13386
14181
|
var {
|
|
13387
14182
|
ref: triggerRef,
|
|
13388
14183
|
relation
|
|
@@ -13529,7 +14324,7 @@ var ComboBoxView = _ref => {
|
|
|
13529
14324
|
})))))))))));
|
|
13530
14325
|
};
|
|
13531
14326
|
|
|
13532
|
-
var _excluded$
|
|
14327
|
+
var _excluded$D = ["id", "name", "items", "placeholder", "searchPlaceholder"];
|
|
13533
14328
|
// Defines the ComboBoxComponent functional component with ComboBoxProps
|
|
13534
14329
|
var ComboBoxComponent = _ref => {
|
|
13535
14330
|
var {
|
|
@@ -13545,7 +14340,7 @@ var ComboBoxComponent = _ref => {
|
|
|
13545
14340
|
searchPlaceholder
|
|
13546
14341
|
// Destructures the rest of the props not explicitly defined
|
|
13547
14342
|
} = _ref,
|
|
13548
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
14343
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$D);
|
|
13549
14344
|
// Initializes ComboBox state using custom hook with items and placeholders
|
|
13550
14345
|
var state = useComboBoxState(items, placeholder, searchPlaceholder);
|
|
13551
14346
|
return (
|
|
@@ -13754,7 +14549,7 @@ var useTagInputState = props => {
|
|
|
13754
14549
|
};
|
|
13755
14550
|
};
|
|
13756
14551
|
|
|
13757
|
-
var _excluded$
|
|
14552
|
+
var _excluded$E = ["id", "name", "label", "placeholder", "helperText", "error", "inputValue", "tags", "left", "right", "shadow", "views", "size", "shape", "variant", "isDisabled", "isReadOnly", "isAutoFocus", "isRemovable", "isFocused", "isHovered", "maxTags", "handleInputChange", "handleKeyDown", "handleFocus", "handleBlur", "removeTag", "setIsHovered", "onClick"];
|
|
13758
14553
|
/**
|
|
13759
14554
|
* Individual tag chip component
|
|
13760
14555
|
*/
|
|
@@ -13870,7 +14665,7 @@ var TagInputView = _ref2 => {
|
|
|
13870
14665
|
setIsHovered,
|
|
13871
14666
|
onClick
|
|
13872
14667
|
} = _ref2,
|
|
13873
|
-
props = _objectWithoutPropertiesLoose(_ref2, _excluded$
|
|
14668
|
+
props = _objectWithoutPropertiesLoose(_ref2, _excluded$E);
|
|
13874
14669
|
var {
|
|
13875
14670
|
getColor,
|
|
13876
14671
|
themeMode
|
|
@@ -13953,7 +14748,7 @@ var TagInputView = _ref2 => {
|
|
|
13953
14748
|
}, views == null ? void 0 : views.placeholder), "Maximum ", maxTags, " tags reached")))), right));
|
|
13954
14749
|
};
|
|
13955
14750
|
|
|
13956
|
-
var _excluded$
|
|
14751
|
+
var _excluded$F = ["tags"];
|
|
13957
14752
|
/**
|
|
13958
14753
|
* TagInput Component
|
|
13959
14754
|
*
|
|
@@ -13965,7 +14760,7 @@ var TagInputComponent = props => {
|
|
|
13965
14760
|
// Initialize state management with the custom hook
|
|
13966
14761
|
var tagInputState = useTagInputState(props);
|
|
13967
14762
|
// Separate the tags prop to avoid type conflicts
|
|
13968
|
-
var restProps = _objectWithoutPropertiesLoose(props, _excluded$
|
|
14763
|
+
var restProps = _objectWithoutPropertiesLoose(props, _excluded$F);
|
|
13969
14764
|
// Render the view component with combined props and state
|
|
13970
14765
|
return /*#__PURE__*/React__default.createElement(TagInputView, Object.assign({}, tagInputState, restProps));
|
|
13971
14766
|
};
|
|
@@ -14278,7 +15073,7 @@ var useOTPInputState = _ref => {
|
|
|
14278
15073
|
};
|
|
14279
15074
|
};
|
|
14280
15075
|
|
|
14281
|
-
var _excluded$
|
|
15076
|
+
var _excluded$G = ["id", "name", "label", "value", "length", "onChange", "onChangeText", "onComplete", "helperText", "placeholder", "shadow", "views", "size", "shape", "variant", "gap", "type", "error", "isFocused", "isHovered", "isDisabled", "isReadOnly", "isAutoFocus", "setValue", "setIsFocused", "setIsHovered", "inputRef", "containerRef", "mirrorSelectionStart", "mirrorSelectionEnd", "setMirrorSelectionStart", "setMirrorSelectionEnd", "handlePaste", "handleChange", "handleFocus", "handleBlur", "handleKeyDown", "handleKeyPress", "secureTextEntry", "isFirstColumn", "stepValues", "setInputRef", "onBlur", "onClick", "onFocus"];
|
|
14282
15077
|
// Create a context for OTP input slots
|
|
14283
15078
|
var OTPInputContext = /*#__PURE__*/React.createContext({
|
|
14284
15079
|
slots: [],
|
|
@@ -14332,7 +15127,7 @@ var OTPInputView = _ref => {
|
|
|
14332
15127
|
onFocus = () => {}
|
|
14333
15128
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
14334
15129
|
} = _ref,
|
|
14335
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
15130
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$G);
|
|
14336
15131
|
appStudio.useTheme(); // Initialize theme context
|
|
14337
15132
|
var showLabel = !!label;
|
|
14338
15133
|
// Create context value for slots
|
|
@@ -14564,7 +15359,7 @@ var OTPInputComponent = props => {
|
|
|
14564
15359
|
};
|
|
14565
15360
|
var OTPInput = OTPInputComponent;
|
|
14566
15361
|
|
|
14567
|
-
var _excluded$
|
|
15362
|
+
var _excluded$H = ["children", "autoFocus", "initFocus", "onChange"];
|
|
14568
15363
|
var FocusContext = /*#__PURE__*/React.createContext({
|
|
14569
15364
|
active: false,
|
|
14570
15365
|
focusNextInput: () => {},
|
|
@@ -14580,7 +15375,7 @@ var FormikForm = _ref => {
|
|
|
14580
15375
|
initFocus,
|
|
14581
15376
|
onChange = () => {}
|
|
14582
15377
|
} = _ref,
|
|
14583
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
15378
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$H);
|
|
14584
15379
|
var formik$1 = formik.useFormikContext();
|
|
14585
15380
|
React.useEffect(() => {
|
|
14586
15381
|
onChange(formik$1.values);
|
|
@@ -14628,7 +15423,7 @@ var FormikForm = _ref => {
|
|
|
14628
15423
|
}, /*#__PURE__*/React__default.createElement(appStudio.Form, Object.assign({}, props), children));
|
|
14629
15424
|
};
|
|
14630
15425
|
|
|
14631
|
-
var _excluded$
|
|
15426
|
+
var _excluded$I = ["name", "type"];
|
|
14632
15427
|
var getInputTypeProps = type => {
|
|
14633
15428
|
switch (type) {
|
|
14634
15429
|
case 'email':
|
|
@@ -14667,7 +15462,7 @@ var useFormikInput = _ref => {
|
|
|
14667
15462
|
name,
|
|
14668
15463
|
type
|
|
14669
15464
|
} = _ref,
|
|
14670
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
15465
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$I);
|
|
14671
15466
|
var focus = useFormFocus();
|
|
14672
15467
|
var {
|
|
14673
15468
|
touched,
|
|
@@ -14711,13 +15506,13 @@ var useFormikInput = _ref => {
|
|
|
14711
15506
|
} : {});
|
|
14712
15507
|
};
|
|
14713
15508
|
|
|
14714
|
-
var _excluded$
|
|
15509
|
+
var _excluded$J = ["value"];
|
|
14715
15510
|
var CheckboxComponent$1 = props => {
|
|
14716
15511
|
var _useFormikInput = useFormikInput(props),
|
|
14717
15512
|
{
|
|
14718
15513
|
value
|
|
14719
15514
|
} = _useFormikInput,
|
|
14720
|
-
formProps = _objectWithoutPropertiesLoose(_useFormikInput, _excluded$
|
|
15515
|
+
formProps = _objectWithoutPropertiesLoose(_useFormikInput, _excluded$J);
|
|
14721
15516
|
formProps.isChecked = value;
|
|
14722
15517
|
var checkboxStates = useCheckboxState(props);
|
|
14723
15518
|
return /*#__PURE__*/React__default.createElement(CheckboxView, Object.assign({}, checkboxStates, formProps));
|
|
@@ -14973,7 +15768,12 @@ var DefaultChatInputStyles = {
|
|
|
14973
15768
|
maxWidth: '100%',
|
|
14974
15769
|
borderRadius: '12px',
|
|
14975
15770
|
backgroundColor: 'color.white',
|
|
14976
|
-
transition: 'all 0.2s ease'
|
|
15771
|
+
transition: 'all 0.2s ease',
|
|
15772
|
+
media: {
|
|
15773
|
+
mobile: {
|
|
15774
|
+
borderRadius: '8px'
|
|
15775
|
+
}
|
|
15776
|
+
}
|
|
14977
15777
|
},
|
|
14978
15778
|
content: {
|
|
14979
15779
|
width: '100%',
|
|
@@ -14982,7 +15782,13 @@ var DefaultChatInputStyles = {
|
|
|
14982
15782
|
backgroundColor: 'color.white',
|
|
14983
15783
|
borderWidth: '1px',
|
|
14984
15784
|
borderStyle: 'solid',
|
|
14985
|
-
borderColor: 'color.gray.200'
|
|
15785
|
+
borderColor: 'color.gray.200',
|
|
15786
|
+
media: {
|
|
15787
|
+
mobile: {
|
|
15788
|
+
padding: '10px',
|
|
15789
|
+
borderRadius: '8px'
|
|
15790
|
+
}
|
|
15791
|
+
}
|
|
14986
15792
|
},
|
|
14987
15793
|
textarea: {
|
|
14988
15794
|
width: '100%',
|
|
@@ -14996,7 +15802,14 @@ var DefaultChatInputStyles = {
|
|
|
14996
15802
|
border: 'none',
|
|
14997
15803
|
outline: 'none',
|
|
14998
15804
|
resize: 'none',
|
|
14999
|
-
overflow: 'auto'
|
|
15805
|
+
overflow: 'auto',
|
|
15806
|
+
media: {
|
|
15807
|
+
mobile: {
|
|
15808
|
+
padding: '6px 10px',
|
|
15809
|
+
fontSize: '13px',
|
|
15810
|
+
minHeight: '36px'
|
|
15811
|
+
}
|
|
15812
|
+
}
|
|
15000
15813
|
},
|
|
15001
15814
|
attachments: {
|
|
15002
15815
|
display: 'flex',
|
|
@@ -15036,7 +15849,14 @@ var DefaultChatInputStyles = {
|
|
|
15036
15849
|
borderRadius: '8px',
|
|
15037
15850
|
backgroundColor: 'theme.primary',
|
|
15038
15851
|
color: 'color.white',
|
|
15039
|
-
transition: 'all 0.2s ease'
|
|
15852
|
+
transition: 'all 0.2s ease',
|
|
15853
|
+
media: {
|
|
15854
|
+
mobile: {
|
|
15855
|
+
height: '32px',
|
|
15856
|
+
minWidth: '32px',
|
|
15857
|
+
padding: '0 10px'
|
|
15858
|
+
}
|
|
15859
|
+
}
|
|
15040
15860
|
},
|
|
15041
15861
|
fileButton: {
|
|
15042
15862
|
height: '36px',
|
|
@@ -15044,7 +15864,13 @@ var DefaultChatInputStyles = {
|
|
|
15044
15864
|
borderRadius: '8px',
|
|
15045
15865
|
backgroundColor: 'transparent',
|
|
15046
15866
|
color: 'color.gray.500',
|
|
15047
|
-
transition: 'all 0.2s ease'
|
|
15867
|
+
transition: 'all 0.2s ease',
|
|
15868
|
+
media: {
|
|
15869
|
+
mobile: {
|
|
15870
|
+
height: '32px',
|
|
15871
|
+
padding: '0 10px'
|
|
15872
|
+
}
|
|
15873
|
+
}
|
|
15048
15874
|
},
|
|
15049
15875
|
modelSelector: {
|
|
15050
15876
|
height: '36px',
|
|
@@ -15062,66 +15888,368 @@ var DefaultChatInputStyles = {
|
|
|
15062
15888
|
padding: '8px 0'
|
|
15063
15889
|
}
|
|
15064
15890
|
};
|
|
15065
|
-
/**
|
|
15066
|
-
* Shape styles for the ChatInput component
|
|
15067
|
-
*/
|
|
15068
|
-
var Shapes$2 = {
|
|
15069
|
-
default: {
|
|
15070
|
-
borderRadius: '8px'
|
|
15071
|
-
},
|
|
15072
|
-
sharp: {
|
|
15073
|
-
borderRadius: '0px'
|
|
15074
|
-
},
|
|
15075
|
-
rounded: {
|
|
15076
|
-
borderRadius: '8px'
|
|
15891
|
+
/**
|
|
15892
|
+
* Shape styles for the ChatInput component
|
|
15893
|
+
*/
|
|
15894
|
+
var Shapes$2 = {
|
|
15895
|
+
default: {
|
|
15896
|
+
borderRadius: '8px'
|
|
15897
|
+
},
|
|
15898
|
+
sharp: {
|
|
15899
|
+
borderRadius: '0px'
|
|
15900
|
+
},
|
|
15901
|
+
rounded: {
|
|
15902
|
+
borderRadius: '8px'
|
|
15903
|
+
}
|
|
15904
|
+
};
|
|
15905
|
+
/**
|
|
15906
|
+
* Size styles for the ChatInput component
|
|
15907
|
+
*/
|
|
15908
|
+
var Sizes$2 = {
|
|
15909
|
+
xs: {
|
|
15910
|
+
fontSize: '10px',
|
|
15911
|
+
padding: '4px 8px'
|
|
15912
|
+
},
|
|
15913
|
+
sm: {
|
|
15914
|
+
fontSize: '12px',
|
|
15915
|
+
padding: '6px 10px'
|
|
15916
|
+
},
|
|
15917
|
+
md: {
|
|
15918
|
+
fontSize: '14px',
|
|
15919
|
+
padding: '8px 12px'
|
|
15920
|
+
},
|
|
15921
|
+
lg: {
|
|
15922
|
+
fontSize: '16px',
|
|
15923
|
+
padding: '10px 14px'
|
|
15924
|
+
},
|
|
15925
|
+
xl: {
|
|
15926
|
+
fontSize: '20px',
|
|
15927
|
+
padding: '12px 16px'
|
|
15928
|
+
}
|
|
15929
|
+
};
|
|
15930
|
+
/**
|
|
15931
|
+
* Variant styles for the ChatInput component
|
|
15932
|
+
*/
|
|
15933
|
+
var Variants$1 = {
|
|
15934
|
+
default: {
|
|
15935
|
+
backgroundColor: 'color.white',
|
|
15936
|
+
borderWidth: '1px',
|
|
15937
|
+
borderStyle: 'solid',
|
|
15938
|
+
borderColor: 'color.gray.200'
|
|
15939
|
+
},
|
|
15940
|
+
outline: {
|
|
15941
|
+
backgroundColor: 'transparent',
|
|
15942
|
+
borderWidth: '1px',
|
|
15943
|
+
borderStyle: 'solid',
|
|
15944
|
+
borderColor: 'color.gray.300'
|
|
15945
|
+
},
|
|
15946
|
+
none: {
|
|
15947
|
+
backgroundColor: 'transparent',
|
|
15948
|
+
border: 'none'
|
|
15949
|
+
}
|
|
15950
|
+
};
|
|
15951
|
+
|
|
15952
|
+
// Generate a unique ID for ARIA attributes
|
|
15953
|
+
var generateId$1 = prefix => prefix + "-" + Math.random().toString(36).substring(2, 9);
|
|
15954
|
+
var useHoverCardState = function useHoverCardState(_temp) {
|
|
15955
|
+
var {
|
|
15956
|
+
openDelay = 200,
|
|
15957
|
+
closeDelay = 300
|
|
15958
|
+
} = _temp === void 0 ? {} : _temp;
|
|
15959
|
+
var [isOpen, setIsOpen] = React.useState(false);
|
|
15960
|
+
var openTimerRef = React.useRef(null);
|
|
15961
|
+
var closeTimerRef = React.useRef(null);
|
|
15962
|
+
// Refs for trigger and content elements for positioning
|
|
15963
|
+
var triggerRef = React.useRef(null);
|
|
15964
|
+
var contentRef = React.useRef(null);
|
|
15965
|
+
// Unique IDs for ARIA attributes
|
|
15966
|
+
var contentId = React.useMemo(() => generateId$1('hovercard-content'), []);
|
|
15967
|
+
var triggerId = React.useMemo(() => generateId$1('hovercard-trigger'), []);
|
|
15968
|
+
var clearTimers = React.useCallback(() => {
|
|
15969
|
+
if (openTimerRef.current) {
|
|
15970
|
+
clearTimeout(openTimerRef.current);
|
|
15971
|
+
openTimerRef.current = null;
|
|
15972
|
+
}
|
|
15973
|
+
if (closeTimerRef.current) {
|
|
15974
|
+
clearTimeout(closeTimerRef.current);
|
|
15975
|
+
closeTimerRef.current = null;
|
|
15976
|
+
}
|
|
15977
|
+
}, []);
|
|
15978
|
+
var openCard = React.useCallback(() => {
|
|
15979
|
+
clearTimers(); // Clear any pending close
|
|
15980
|
+
if (!isOpen) {
|
|
15981
|
+
openTimerRef.current = setTimeout(() => {
|
|
15982
|
+
setIsOpen(true);
|
|
15983
|
+
}, openDelay);
|
|
15984
|
+
}
|
|
15985
|
+
}, [isOpen, openDelay, clearTimers]);
|
|
15986
|
+
var closeCard = React.useCallback(() => {
|
|
15987
|
+
clearTimers(); // Clear any pending open
|
|
15988
|
+
if (isOpen) {
|
|
15989
|
+
closeTimerRef.current = setTimeout(() => {
|
|
15990
|
+
setIsOpen(false);
|
|
15991
|
+
}, closeDelay);
|
|
15992
|
+
}
|
|
15993
|
+
}, [isOpen, closeDelay, clearTimers]);
|
|
15994
|
+
// Function specifically to cancel the close timer (e.g., when mouse enters content)
|
|
15995
|
+
var cancelCloseTimer = React.useCallback(() => {
|
|
15996
|
+
if (closeTimerRef.current) {
|
|
15997
|
+
clearTimeout(closeTimerRef.current);
|
|
15998
|
+
closeTimerRef.current = null;
|
|
15999
|
+
}
|
|
16000
|
+
}, []);
|
|
16001
|
+
// Cleanup timers on unmount
|
|
16002
|
+
React.useEffect(() => {
|
|
16003
|
+
return () => clearTimers();
|
|
16004
|
+
}, [clearTimers]);
|
|
16005
|
+
return {
|
|
16006
|
+
isOpen,
|
|
16007
|
+
openCard,
|
|
16008
|
+
closeCard,
|
|
16009
|
+
cancelCloseTimer,
|
|
16010
|
+
triggerRef,
|
|
16011
|
+
contentRef,
|
|
16012
|
+
contentId,
|
|
16013
|
+
triggerId
|
|
16014
|
+
};
|
|
16015
|
+
};
|
|
16016
|
+
|
|
16017
|
+
var _excluded$K = ["children", "views", "asChild"],
|
|
16018
|
+
_excluded2$b = ["children", "views", "side", "align", "sideOffset", "style", "backgroundColor", "borderRadius", "boxShadow", "padding", "minWidth", "maxWidth"];
|
|
16019
|
+
// Create context for the HoverCard
|
|
16020
|
+
var HoverCardContext = /*#__PURE__*/React.createContext({
|
|
16021
|
+
isOpen: false,
|
|
16022
|
+
openCard: () => {},
|
|
16023
|
+
closeCard: () => {},
|
|
16024
|
+
cancelCloseTimer: () => {},
|
|
16025
|
+
triggerRef: {
|
|
16026
|
+
current: null
|
|
16027
|
+
},
|
|
16028
|
+
contentRef: {
|
|
16029
|
+
current: null
|
|
16030
|
+
},
|
|
16031
|
+
contentId: '',
|
|
16032
|
+
triggerId: ''
|
|
16033
|
+
});
|
|
16034
|
+
var HoverCardProvider = _ref => {
|
|
16035
|
+
var {
|
|
16036
|
+
children,
|
|
16037
|
+
value
|
|
16038
|
+
} = _ref;
|
|
16039
|
+
return /*#__PURE__*/React__default.createElement(HoverCardContext.Provider, {
|
|
16040
|
+
value: value
|
|
16041
|
+
}, children);
|
|
16042
|
+
};
|
|
16043
|
+
var useHoverCardContext = () => {
|
|
16044
|
+
var context = React.useContext(HoverCardContext);
|
|
16045
|
+
if (!context) {
|
|
16046
|
+
throw new Error('useHoverCardContext must be used within a HoverCardProvider');
|
|
16047
|
+
}
|
|
16048
|
+
return context;
|
|
16049
|
+
};
|
|
16050
|
+
var HoverCardTrigger = _ref2 => {
|
|
16051
|
+
var {
|
|
16052
|
+
children,
|
|
16053
|
+
views,
|
|
16054
|
+
asChild = false
|
|
16055
|
+
} = _ref2,
|
|
16056
|
+
props = _objectWithoutPropertiesLoose(_ref2, _excluded$K);
|
|
16057
|
+
var {
|
|
16058
|
+
openCard,
|
|
16059
|
+
closeCard,
|
|
16060
|
+
triggerRef,
|
|
16061
|
+
contentId,
|
|
16062
|
+
triggerId
|
|
16063
|
+
} = useHoverCardContext();
|
|
16064
|
+
var handleMouseEnter = () => openCard();
|
|
16065
|
+
var handleMouseLeave = () => closeCard();
|
|
16066
|
+
var handleFocus = () => openCard(); // For keyboard accessibility
|
|
16067
|
+
var handleBlur = () => closeCard(); // For keyboard accessibility
|
|
16068
|
+
var triggerProps = Object.assign({
|
|
16069
|
+
ref: triggerRef,
|
|
16070
|
+
onMouseEnter: handleMouseEnter,
|
|
16071
|
+
onMouseLeave: handleMouseLeave,
|
|
16072
|
+
onFocus: handleFocus,
|
|
16073
|
+
onBlur: handleBlur,
|
|
16074
|
+
id: triggerId,
|
|
16075
|
+
'aria-describedby': contentId
|
|
16076
|
+
}, views == null ? void 0 : views.container, props);
|
|
16077
|
+
if (asChild && /*#__PURE__*/React.isValidElement(children)) {
|
|
16078
|
+
// Clone the child element and merge props
|
|
16079
|
+
var child = React.Children.only(children);
|
|
16080
|
+
return /*#__PURE__*/React.cloneElement(child, Object.assign({}, triggerProps, child.props));
|
|
15077
16081
|
}
|
|
16082
|
+
// Default: wrap children in a View
|
|
16083
|
+
return /*#__PURE__*/React__default.createElement(appStudio.View, Object.assign({
|
|
16084
|
+
position: "relative",
|
|
16085
|
+
display: "inline-block"
|
|
16086
|
+
}, triggerProps), children);
|
|
15078
16087
|
};
|
|
15079
|
-
|
|
15080
|
-
|
|
15081
|
-
|
|
15082
|
-
|
|
15083
|
-
|
|
15084
|
-
|
|
15085
|
-
|
|
15086
|
-
|
|
15087
|
-
|
|
15088
|
-
|
|
15089
|
-
|
|
15090
|
-
|
|
15091
|
-
|
|
15092
|
-
|
|
15093
|
-
|
|
15094
|
-
|
|
15095
|
-
|
|
15096
|
-
|
|
15097
|
-
|
|
15098
|
-
|
|
15099
|
-
|
|
15100
|
-
|
|
15101
|
-
|
|
16088
|
+
var HoverCardContent = _ref3 => {
|
|
16089
|
+
var {
|
|
16090
|
+
children,
|
|
16091
|
+
views,
|
|
16092
|
+
side = 'bottom',
|
|
16093
|
+
align = 'center',
|
|
16094
|
+
sideOffset = 8,
|
|
16095
|
+
style: userStyle,
|
|
16096
|
+
// User provided style override
|
|
16097
|
+
backgroundColor = 'white',
|
|
16098
|
+
borderRadius = '4px',
|
|
16099
|
+
boxShadow = '0px 2px 8px rgba(0, 0, 0, 0.15)',
|
|
16100
|
+
padding = '12px',
|
|
16101
|
+
minWidth = '50px',
|
|
16102
|
+
maxWidth = '300px'
|
|
16103
|
+
} = _ref3,
|
|
16104
|
+
props = _objectWithoutPropertiesLoose(_ref3, _excluded2$b);
|
|
16105
|
+
var {
|
|
16106
|
+
isOpen,
|
|
16107
|
+
cancelCloseTimer,
|
|
16108
|
+
closeCard,
|
|
16109
|
+
contentRef,
|
|
16110
|
+
triggerRef,
|
|
16111
|
+
contentId,
|
|
16112
|
+
triggerId
|
|
16113
|
+
} = useHoverCardContext();
|
|
16114
|
+
// Use useElementPosition for intelligent positioning
|
|
16115
|
+
var {
|
|
16116
|
+
ref: positionRef,
|
|
16117
|
+
relation
|
|
16118
|
+
} = appStudio.useElementPosition({
|
|
16119
|
+
trackChanges: true,
|
|
16120
|
+
trackOnHover: true,
|
|
16121
|
+
trackOnScroll: true,
|
|
16122
|
+
trackOnResize: true
|
|
16123
|
+
});
|
|
16124
|
+
// Sync the position ref with the trigger ref for positioning calculations
|
|
16125
|
+
React.useEffect(() => {
|
|
16126
|
+
if (triggerRef != null && triggerRef.current && (positionRef == null ? void 0 : positionRef.current) !== triggerRef.current) {
|
|
16127
|
+
// Update the position tracking to use the trigger element
|
|
16128
|
+
if (positionRef) {
|
|
16129
|
+
positionRef.current = triggerRef.current;
|
|
16130
|
+
}
|
|
16131
|
+
}
|
|
16132
|
+
}, [triggerRef, positionRef, isOpen]);
|
|
16133
|
+
var handleMouseEnter = () => cancelCloseTimer(); // Keep card open if mouse enters content
|
|
16134
|
+
var handleMouseLeave = () => closeCard();
|
|
16135
|
+
if (!isOpen) {
|
|
16136
|
+
return null; // Don't render content if not open
|
|
15102
16137
|
}
|
|
16138
|
+
// Create intelligent positioning styles based on useElementPosition relation data
|
|
16139
|
+
var getPositionStyles = () => {
|
|
16140
|
+
if (!relation || !(triggerRef != null && triggerRef.current)) {
|
|
16141
|
+
// Fallback positioning if relation data is not available
|
|
16142
|
+
return {
|
|
16143
|
+
position: 'absolute',
|
|
16144
|
+
top: 0,
|
|
16145
|
+
left: 0,
|
|
16146
|
+
zIndex: 1000
|
|
16147
|
+
};
|
|
16148
|
+
}
|
|
16149
|
+
var triggerRect = triggerRef.current.getBoundingClientRect();
|
|
16150
|
+
var placement = side;
|
|
16151
|
+
// Use relation data to determine optimal placement
|
|
16152
|
+
// If preferred side doesn't have enough space, use the side with more space
|
|
16153
|
+
if (side === 'bottom' && relation.space.vertical === 'top') {
|
|
16154
|
+
placement = 'top';
|
|
16155
|
+
} else if (side === 'top' && relation.space.vertical === 'bottom') {
|
|
16156
|
+
placement = 'bottom';
|
|
16157
|
+
} else if (side === 'right' && relation.space.horizontal === 'left') {
|
|
16158
|
+
placement = 'left';
|
|
16159
|
+
} else if (side === 'left' && relation.space.horizontal === 'right') {
|
|
16160
|
+
placement = 'right';
|
|
16161
|
+
}
|
|
16162
|
+
// Calculate position based on optimal placement
|
|
16163
|
+
var x = 0;
|
|
16164
|
+
var y = 0;
|
|
16165
|
+
switch (placement) {
|
|
16166
|
+
case 'bottom':
|
|
16167
|
+
x = triggerRect.left + triggerRect.width / 2;
|
|
16168
|
+
y = triggerRect.bottom + sideOffset;
|
|
16169
|
+
break;
|
|
16170
|
+
case 'top':
|
|
16171
|
+
x = triggerRect.left + triggerRect.width / 2;
|
|
16172
|
+
y = triggerRect.top - sideOffset;
|
|
16173
|
+
break;
|
|
16174
|
+
case 'right':
|
|
16175
|
+
x = triggerRect.right + sideOffset;
|
|
16176
|
+
y = triggerRect.top + triggerRect.height / 2;
|
|
16177
|
+
break;
|
|
16178
|
+
case 'left':
|
|
16179
|
+
x = triggerRect.left - sideOffset;
|
|
16180
|
+
y = triggerRect.top + triggerRect.height / 2;
|
|
16181
|
+
break;
|
|
16182
|
+
}
|
|
16183
|
+
return {
|
|
16184
|
+
position: 'fixed',
|
|
16185
|
+
left: x,
|
|
16186
|
+
top: y,
|
|
16187
|
+
zIndex: 1000,
|
|
16188
|
+
transform: getTransformOrigin(placement)
|
|
16189
|
+
};
|
|
16190
|
+
};
|
|
16191
|
+
// Helper function to set transform origin for better positioning
|
|
16192
|
+
var getTransformOrigin = placement => {
|
|
16193
|
+
switch (placement) {
|
|
16194
|
+
case 'bottom':
|
|
16195
|
+
return 'translate(-50%, 0)';
|
|
16196
|
+
case 'top':
|
|
16197
|
+
return 'translate(-50%, -100%)';
|
|
16198
|
+
case 'right':
|
|
16199
|
+
return 'translate(0, -50%)';
|
|
16200
|
+
case 'left':
|
|
16201
|
+
return 'translate(-100%, -50%)';
|
|
16202
|
+
default:
|
|
16203
|
+
return 'translate(-50%, 0)';
|
|
16204
|
+
}
|
|
16205
|
+
};
|
|
16206
|
+
var positionStyles = getPositionStyles();
|
|
16207
|
+
return /*#__PURE__*/React__default.createElement(appStudio.View, Object.assign({
|
|
16208
|
+
ref: contentRef,
|
|
16209
|
+
id: contentId,
|
|
16210
|
+
role: "tooltip" // Use tooltip role for accessibility
|
|
16211
|
+
,
|
|
16212
|
+
"aria-labelledby": triggerId,
|
|
16213
|
+
onMouseEnter: handleMouseEnter,
|
|
16214
|
+
onMouseLeave: handleMouseLeave,
|
|
16215
|
+
backgroundColor: backgroundColor,
|
|
16216
|
+
borderRadius: borderRadius,
|
|
16217
|
+
boxShadow: boxShadow,
|
|
16218
|
+
padding: padding,
|
|
16219
|
+
minWidth: minWidth,
|
|
16220
|
+
maxWidth: maxWidth,
|
|
16221
|
+
// Combine intelligent position styles with user styles
|
|
16222
|
+
style: Object.assign({}, positionStyles, userStyle)
|
|
16223
|
+
}, views == null ? void 0 : views.container, props), children);
|
|
15103
16224
|
};
|
|
16225
|
+
|
|
16226
|
+
var _excluded$L = ["children", "views", "openDelay", "closeDelay"];
|
|
15104
16227
|
/**
|
|
15105
|
-
*
|
|
16228
|
+
* HoverCard component displays floating content when hovering over a trigger element.
|
|
16229
|
+
* Supports configurable open and close delays for a smoother user experience.
|
|
15106
16230
|
*/
|
|
15107
|
-
var
|
|
15108
|
-
|
|
15109
|
-
|
|
15110
|
-
|
|
15111
|
-
|
|
15112
|
-
|
|
15113
|
-
|
|
15114
|
-
|
|
15115
|
-
|
|
15116
|
-
|
|
15117
|
-
|
|
15118
|
-
|
|
15119
|
-
|
|
15120
|
-
|
|
15121
|
-
|
|
15122
|
-
|
|
15123
|
-
|
|
16231
|
+
var HoverCardComponent = _ref => {
|
|
16232
|
+
var {
|
|
16233
|
+
children,
|
|
16234
|
+
views,
|
|
16235
|
+
openDelay,
|
|
16236
|
+
closeDelay
|
|
16237
|
+
} = _ref,
|
|
16238
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$L);
|
|
16239
|
+
var hoverCardState = useHoverCardState({
|
|
16240
|
+
openDelay,
|
|
16241
|
+
closeDelay
|
|
16242
|
+
});
|
|
16243
|
+
return /*#__PURE__*/React__default.createElement(HoverCardProvider, {
|
|
16244
|
+
value: hoverCardState
|
|
16245
|
+
}, /*#__PURE__*/React__default.createElement(appStudio.View, Object.assign({
|
|
16246
|
+
position: "relative",
|
|
16247
|
+
display: "inline-block"
|
|
16248
|
+
}, views == null ? void 0 : views.container, props), children));
|
|
15124
16249
|
};
|
|
16250
|
+
var HoverCard = HoverCardComponent;
|
|
16251
|
+
HoverCard.Trigger = HoverCardTrigger;
|
|
16252
|
+
HoverCard.Content = HoverCardContent;
|
|
15125
16253
|
|
|
15126
16254
|
/**
|
|
15127
16255
|
* Default styles for AgentChat component
|
|
@@ -16680,13 +17808,15 @@ var SliderShapes = {
|
|
|
16680
17808
|
var getSlider = themeMode => {
|
|
16681
17809
|
return {
|
|
16682
17810
|
default: {
|
|
16683
|
-
backgroundColor: 'color.
|
|
17811
|
+
backgroundColor: 'color.gray.200',
|
|
17812
|
+
transition: 'background-color 0.15s ease'
|
|
16684
17813
|
},
|
|
16685
17814
|
outline: {
|
|
16686
17815
|
backgroundColor: 'transparent',
|
|
16687
17816
|
borderWidth: 1,
|
|
16688
17817
|
borderStyle: 'solid',
|
|
16689
|
-
borderColor: 'color.
|
|
17818
|
+
borderColor: 'color.gray.300',
|
|
17819
|
+
transition: 'border-color 0.15s ease'
|
|
16690
17820
|
}
|
|
16691
17821
|
};
|
|
16692
17822
|
// Add dark mode conditional styling here
|
|
@@ -17616,7 +18746,15 @@ var ModalContainer = _ref2 => {
|
|
|
17616
18746
|
height: isFullScreen ? '100%' : 'fit-content',
|
|
17617
18747
|
onClick: handleClick,
|
|
17618
18748
|
transition: "all 0.3s ease"
|
|
17619
|
-
}, shadow ? shadow : defaultShadow, ContainerShapes[shape],
|
|
18749
|
+
}, shadow ? shadow : defaultShadow, ContainerShapes[shape], {
|
|
18750
|
+
media: {
|
|
18751
|
+
mobile: {
|
|
18752
|
+
width: '90%',
|
|
18753
|
+
maxWidth: '100%',
|
|
18754
|
+
margin: '16px'
|
|
18755
|
+
}
|
|
18756
|
+
}
|
|
18757
|
+
}, props, views == null ? void 0 : views.container), children);
|
|
17620
18758
|
};
|
|
17621
18759
|
var ModalHeader = _ref3 => {
|
|
17622
18760
|
var {
|
|
@@ -17641,7 +18779,13 @@ var ModalHeader = _ref3 => {
|
|
|
17641
18779
|
paddingHorizontal: 24,
|
|
17642
18780
|
borderBottomWidth: "1px",
|
|
17643
18781
|
borderBottomStyle: "solid",
|
|
17644
|
-
borderBottomColor: "color.gray.200"
|
|
18782
|
+
borderBottomColor: "color.gray.200",
|
|
18783
|
+
media: {
|
|
18784
|
+
mobile: {
|
|
18785
|
+
paddingVertical: 12,
|
|
18786
|
+
paddingHorizontal: 16
|
|
18787
|
+
}
|
|
18788
|
+
}
|
|
17645
18789
|
}, props, views == null ? void 0 : views.header), buttonPosition === 'left' && buttonIcon, children, buttonPosition === 'right' && buttonIcon);
|
|
17646
18790
|
};
|
|
17647
18791
|
var ModalBody = _ref4 => {
|
|
@@ -17656,7 +18800,14 @@ var ModalBody = _ref4 => {
|
|
|
17656
18800
|
fontSize: ModalTypography.body.fontSize,
|
|
17657
18801
|
fontWeight: ModalTypography.body.fontWeight,
|
|
17658
18802
|
lineHeight: ModalTypography.body.lineHeight,
|
|
17659
|
-
color: ModalTypography.body.color
|
|
18803
|
+
color: ModalTypography.body.color,
|
|
18804
|
+
media: {
|
|
18805
|
+
mobile: {
|
|
18806
|
+
paddingVertical: 12,
|
|
18807
|
+
paddingHorizontal: 16,
|
|
18808
|
+
fontSize: '14px'
|
|
18809
|
+
}
|
|
18810
|
+
}
|
|
17660
18811
|
}, props, views == null ? void 0 : views.view), children);
|
|
17661
18812
|
};
|
|
17662
18813
|
var ModalFooter = _ref5 => {
|
|
@@ -17674,7 +18825,14 @@ var ModalFooter = _ref5 => {
|
|
|
17674
18825
|
borderTopWidth: "1px",
|
|
17675
18826
|
borderTopStyle: "solid",
|
|
17676
18827
|
borderTopColor: "color.gray.200",
|
|
17677
|
-
gap: 12
|
|
18828
|
+
gap: 12,
|
|
18829
|
+
media: {
|
|
18830
|
+
mobile: {
|
|
18831
|
+
paddingVertical: 12,
|
|
18832
|
+
paddingHorizontal: 16,
|
|
18833
|
+
gap: 8
|
|
18834
|
+
}
|
|
18835
|
+
}
|
|
17678
18836
|
}, props, views == null ? void 0 : views.container), children);
|
|
17679
18837
|
};
|
|
17680
18838
|
|
|
@@ -17739,6 +18897,7 @@ var useNavigationMenuState = function useNavigationMenuState(defaultActiveItemId
|
|
|
17739
18897
|
}
|
|
17740
18898
|
var [activeItemId, setActiveItemId] = React.useState(defaultActiveItemId);
|
|
17741
18899
|
var [expandedItemIds, setExpandedItemIds] = React.useState(defaultExpandedItemIds);
|
|
18900
|
+
var triggerRefs = React.useRef({});
|
|
17742
18901
|
var toggleExpandedItem = itemId => {
|
|
17743
18902
|
setExpandedItemIds(prevExpandedItemIds => {
|
|
17744
18903
|
// Check if the item is already expanded
|
|
@@ -17760,7 +18919,8 @@ var useNavigationMenuState = function useNavigationMenuState(defaultActiveItemId
|
|
|
17760
18919
|
setActiveItemId,
|
|
17761
18920
|
expandedItemIds,
|
|
17762
18921
|
toggleExpandedItem,
|
|
17763
|
-
isItemExpanded
|
|
18922
|
+
isItemExpanded,
|
|
18923
|
+
triggerRefs
|
|
17764
18924
|
};
|
|
17765
18925
|
};
|
|
17766
18926
|
|
|
@@ -17782,17 +18942,35 @@ var NavigationMenuSizes = {
|
|
|
17782
18942
|
sm: {
|
|
17783
18943
|
padding: '8px 12px',
|
|
17784
18944
|
fontSize: '12px',
|
|
17785
|
-
fontWeight: '500'
|
|
18945
|
+
fontWeight: '500',
|
|
18946
|
+
media: {
|
|
18947
|
+
mobile: {
|
|
18948
|
+
padding: '6px 10px',
|
|
18949
|
+
fontSize: '11px'
|
|
18950
|
+
}
|
|
18951
|
+
}
|
|
17786
18952
|
},
|
|
17787
18953
|
md: {
|
|
17788
18954
|
padding: '12px 16px',
|
|
17789
18955
|
fontSize: '14px',
|
|
17790
|
-
fontWeight: '500'
|
|
18956
|
+
fontWeight: '500',
|
|
18957
|
+
media: {
|
|
18958
|
+
mobile: {
|
|
18959
|
+
padding: '10px 14px',
|
|
18960
|
+
fontSize: '13px'
|
|
18961
|
+
}
|
|
18962
|
+
}
|
|
17791
18963
|
},
|
|
17792
18964
|
lg: {
|
|
17793
18965
|
padding: '16px 20px',
|
|
17794
18966
|
fontSize: '16px',
|
|
17795
|
-
fontWeight: '500'
|
|
18967
|
+
fontWeight: '500',
|
|
18968
|
+
media: {
|
|
18969
|
+
mobile: {
|
|
18970
|
+
padding: '12px 16px',
|
|
18971
|
+
fontSize: '14px'
|
|
18972
|
+
}
|
|
18973
|
+
}
|
|
17796
18974
|
}
|
|
17797
18975
|
};
|
|
17798
18976
|
/**
|
|
@@ -17824,7 +19002,13 @@ var NavigationMenuVariants = {
|
|
|
17824
19002
|
var NavigationMenuOrientations = {
|
|
17825
19003
|
horizontal: {
|
|
17826
19004
|
flexDirection: 'row',
|
|
17827
|
-
gap: '8px'
|
|
19005
|
+
gap: '8px',
|
|
19006
|
+
media: {
|
|
19007
|
+
mobile: {
|
|
19008
|
+
flexDirection: 'column',
|
|
19009
|
+
gap: '4px'
|
|
19010
|
+
}
|
|
19011
|
+
}
|
|
17828
19012
|
},
|
|
17829
19013
|
vertical: {
|
|
17830
19014
|
flexDirection: 'column',
|
|
@@ -17863,7 +19047,10 @@ var NavigationMenuContext = /*#__PURE__*/React.createContext({
|
|
|
17863
19047
|
isItemExpanded: () => false,
|
|
17864
19048
|
orientation: 'vertical',
|
|
17865
19049
|
size: 'md',
|
|
17866
|
-
variant: 'default'
|
|
19050
|
+
variant: 'default',
|
|
19051
|
+
triggerRefs: {
|
|
19052
|
+
current: {}
|
|
19053
|
+
}
|
|
17867
19054
|
});
|
|
17868
19055
|
// Provider component for the NavigationMenu context
|
|
17869
19056
|
var NavigationMenuProvider = _ref => {
|
|
@@ -18017,16 +19204,30 @@ var NavigationMenuTrigger = _ref4 => {
|
|
|
18017
19204
|
toggleExpandedItem,
|
|
18018
19205
|
isItemExpanded,
|
|
18019
19206
|
size,
|
|
18020
|
-
variant
|
|
19207
|
+
variant,
|
|
19208
|
+
triggerRefs
|
|
18021
19209
|
} = useNavigationMenuContext();
|
|
19210
|
+
var triggerRef = React.useRef(null);
|
|
18022
19211
|
var isActive = activeItemId === itemId;
|
|
18023
19212
|
var isExpanded = isItemExpanded(itemId);
|
|
19213
|
+
// Store the trigger ref in the context
|
|
19214
|
+
React.useEffect(() => {
|
|
19215
|
+
if (triggerRef.current && itemId) {
|
|
19216
|
+
triggerRefs.current[itemId] = triggerRef.current;
|
|
19217
|
+
}
|
|
19218
|
+
return () => {
|
|
19219
|
+
if (itemId) {
|
|
19220
|
+
delete triggerRefs.current[itemId];
|
|
19221
|
+
}
|
|
19222
|
+
};
|
|
19223
|
+
}, [itemId, triggerRefs]);
|
|
18024
19224
|
var handleClick = e => {
|
|
18025
19225
|
e.preventDefault();
|
|
18026
19226
|
if (disabled) return;
|
|
18027
19227
|
toggleExpandedItem(itemId);
|
|
18028
19228
|
};
|
|
18029
19229
|
return /*#__PURE__*/React__default.createElement(appStudio.View, Object.assign({
|
|
19230
|
+
ref: triggerRef,
|
|
18030
19231
|
onClick: handleClick,
|
|
18031
19232
|
cursor: disabled ? 'not-allowed' : 'pointer',
|
|
18032
19233
|
opacity: disabled ? 0.5 : 1,
|
|
@@ -18060,22 +19261,150 @@ var NavigationMenuContent = _ref5 => {
|
|
|
18060
19261
|
} = _ref5;
|
|
18061
19262
|
var {
|
|
18062
19263
|
isItemExpanded,
|
|
18063
|
-
orientation
|
|
19264
|
+
orientation,
|
|
19265
|
+
triggerRefs
|
|
18064
19266
|
} = useNavigationMenuContext();
|
|
19267
|
+
var contentRef = React.useRef(null);
|
|
19268
|
+
var [optimalPosition, setOptimalPosition] = React.useState({
|
|
19269
|
+
x: 0,
|
|
19270
|
+
y: 0,
|
|
19271
|
+
placement: orientation === 'horizontal' ? 'bottom' : 'right'
|
|
19272
|
+
});
|
|
18065
19273
|
var isExpanded = isItemExpanded(itemId);
|
|
19274
|
+
// Calculate optimal position when the menu expands
|
|
19275
|
+
React.useEffect(() => {
|
|
19276
|
+
if (isExpanded && contentRef.current && itemId && triggerRefs.current[itemId] && orientation === 'horizontal') {
|
|
19277
|
+
var contentRect = contentRef.current.getBoundingClientRect();
|
|
19278
|
+
var triggerRect = triggerRefs.current[itemId].getBoundingClientRect();
|
|
19279
|
+
// Get content dimensions
|
|
19280
|
+
var contentWidth = Math.max(contentRect.width || 200, 200);
|
|
19281
|
+
var contentHeight = Math.max(contentRect.height || 150, 150);
|
|
19282
|
+
// Get viewport dimensions
|
|
19283
|
+
var viewportWidth = window.innerWidth;
|
|
19284
|
+
var viewportHeight = window.innerHeight;
|
|
19285
|
+
// Calculate available space on all sides from the trigger
|
|
19286
|
+
var availableSpace = {
|
|
19287
|
+
top: triggerRect.top,
|
|
19288
|
+
right: viewportWidth - triggerRect.right,
|
|
19289
|
+
bottom: viewportHeight - triggerRect.bottom,
|
|
19290
|
+
left: triggerRect.left
|
|
19291
|
+
};
|
|
19292
|
+
// Determine optimal placement based on orientation and available space
|
|
19293
|
+
var placements = orientation === 'horizontal' ? [
|
|
19294
|
+
// For horizontal navigation menu, prefer bottom placement
|
|
19295
|
+
{
|
|
19296
|
+
placement: 'bottom',
|
|
19297
|
+
space: availableSpace.bottom,
|
|
19298
|
+
fits: availableSpace.bottom >= contentHeight + 8,
|
|
19299
|
+
x: triggerRect.left,
|
|
19300
|
+
y: triggerRect.bottom + 8
|
|
19301
|
+
}, {
|
|
19302
|
+
placement: 'top',
|
|
19303
|
+
space: availableSpace.top,
|
|
19304
|
+
fits: availableSpace.top >= contentHeight + 8,
|
|
19305
|
+
x: triggerRect.left,
|
|
19306
|
+
y: triggerRect.top - contentHeight - 8
|
|
19307
|
+
}, {
|
|
19308
|
+
placement: 'right',
|
|
19309
|
+
space: availableSpace.right,
|
|
19310
|
+
fits: availableSpace.right >= contentWidth + 8,
|
|
19311
|
+
x: triggerRect.right + 8,
|
|
19312
|
+
y: triggerRect.top
|
|
19313
|
+
}, {
|
|
19314
|
+
placement: 'left',
|
|
19315
|
+
space: availableSpace.left,
|
|
19316
|
+
fits: availableSpace.left >= contentWidth + 8,
|
|
19317
|
+
x: triggerRect.left - contentWidth - 8,
|
|
19318
|
+
y: triggerRect.top
|
|
19319
|
+
}] : [
|
|
19320
|
+
// For vertical navigation menu, prefer right placement
|
|
19321
|
+
{
|
|
19322
|
+
placement: 'right',
|
|
19323
|
+
space: availableSpace.right,
|
|
19324
|
+
fits: availableSpace.right >= contentWidth + 8,
|
|
19325
|
+
x: triggerRect.right + 8,
|
|
19326
|
+
y: triggerRect.top
|
|
19327
|
+
}, {
|
|
19328
|
+
placement: 'left',
|
|
19329
|
+
space: availableSpace.left,
|
|
19330
|
+
fits: availableSpace.left >= contentWidth + 8,
|
|
19331
|
+
x: triggerRect.left - contentWidth - 8,
|
|
19332
|
+
y: triggerRect.top
|
|
19333
|
+
}, {
|
|
19334
|
+
placement: 'bottom',
|
|
19335
|
+
space: availableSpace.bottom,
|
|
19336
|
+
fits: availableSpace.bottom >= contentHeight + 8,
|
|
19337
|
+
x: triggerRect.left,
|
|
19338
|
+
y: triggerRect.bottom + 8
|
|
19339
|
+
}, {
|
|
19340
|
+
placement: 'top',
|
|
19341
|
+
space: availableSpace.top,
|
|
19342
|
+
fits: availableSpace.top >= contentHeight + 8,
|
|
19343
|
+
x: triggerRect.left,
|
|
19344
|
+
y: triggerRect.top - contentHeight - 8
|
|
19345
|
+
}];
|
|
19346
|
+
// Find the best fitting placement
|
|
19347
|
+
var fittingPlacement = placements.find(p => p.fits);
|
|
19348
|
+
if (fittingPlacement) {
|
|
19349
|
+
setOptimalPosition({
|
|
19350
|
+
x: fittingPlacement.x,
|
|
19351
|
+
y: fittingPlacement.y,
|
|
19352
|
+
placement: fittingPlacement.placement
|
|
19353
|
+
});
|
|
19354
|
+
return;
|
|
19355
|
+
}
|
|
19356
|
+
// If nothing fits, choose the placement with the most space
|
|
19357
|
+
var bestPlacement = placements.reduce((best, current) => current.space > best.space ? current : best);
|
|
19358
|
+
// Ensure the content stays within viewport bounds
|
|
19359
|
+
var finalX = bestPlacement.x;
|
|
19360
|
+
var finalY = bestPlacement.y;
|
|
19361
|
+
if (finalX + contentWidth > viewportWidth) {
|
|
19362
|
+
finalX = viewportWidth - contentWidth - 8;
|
|
19363
|
+
}
|
|
19364
|
+
if (finalX < 8) {
|
|
19365
|
+
finalX = 8;
|
|
19366
|
+
}
|
|
19367
|
+
if (finalY + contentHeight > viewportHeight) {
|
|
19368
|
+
finalY = viewportHeight - contentHeight - 8;
|
|
19369
|
+
}
|
|
19370
|
+
if (finalY < 8) {
|
|
19371
|
+
finalY = 8;
|
|
19372
|
+
}
|
|
19373
|
+
setOptimalPosition({
|
|
19374
|
+
x: finalX,
|
|
19375
|
+
y: finalY,
|
|
19376
|
+
placement: bestPlacement.placement
|
|
19377
|
+
});
|
|
19378
|
+
}
|
|
19379
|
+
}, [isExpanded, orientation, itemId, triggerRefs]);
|
|
18066
19380
|
if (!isExpanded) {
|
|
18067
19381
|
return null;
|
|
18068
19382
|
}
|
|
19383
|
+
// For vertical orientation, keep the original relative positioning
|
|
19384
|
+
if (orientation === 'vertical') {
|
|
19385
|
+
return /*#__PURE__*/React__default.createElement(appStudio.View, Object.assign({
|
|
19386
|
+
paddingLeft: 16,
|
|
19387
|
+
width: "100%",
|
|
19388
|
+
position: "relative",
|
|
19389
|
+
backgroundColor: "transparent"
|
|
19390
|
+
}, views == null ? void 0 : views.container), children);
|
|
19391
|
+
}
|
|
19392
|
+
// For horizontal orientation, use fixed positioning with intelligent placement
|
|
19393
|
+
var positionStyles = {
|
|
19394
|
+
position: 'fixed',
|
|
19395
|
+
left: optimalPosition.x,
|
|
19396
|
+
top: optimalPosition.y,
|
|
19397
|
+
zIndex: 1000
|
|
19398
|
+
};
|
|
18069
19399
|
return /*#__PURE__*/React__default.createElement(appStudio.View, Object.assign({
|
|
18070
|
-
|
|
18071
|
-
|
|
19400
|
+
ref: contentRef,
|
|
19401
|
+
role: "menu",
|
|
19402
|
+
minWidth: "200px",
|
|
19403
|
+
backgroundColor: "color.white",
|
|
19404
|
+
borderRadius: 4,
|
|
19405
|
+
boxShadow: "0px 2px 8px rgba(0, 0, 0, 0.15)",
|
|
18072
19406
|
overflow: "hidden",
|
|
18073
|
-
|
|
18074
|
-
position: orientation === 'horizontal' ? 'absolute' : 'relative',
|
|
18075
|
-
backgroundColor: orientation === 'horizontal' ? 'white' : 'transparent',
|
|
18076
|
-
boxShadow: orientation === 'horizontal' ? '0 4px 6px rgba(0, 0, 0, 0.1)' : 'none',
|
|
18077
|
-
borderRadius: orientation === 'horizontal' ? '4px' : '0',
|
|
18078
|
-
zIndex: orientation === 'horizontal' ? 10 : 1
|
|
19407
|
+
style: positionStyles
|
|
18079
19408
|
}, views == null ? void 0 : views.container), children);
|
|
18080
19409
|
};
|
|
18081
19410
|
var NavigationMenuLink = _ref6 => {
|
|
@@ -18174,7 +19503,8 @@ var NavigationMenuComponent = _ref => {
|
|
|
18174
19503
|
setActiveItemId,
|
|
18175
19504
|
expandedItemIds,
|
|
18176
19505
|
toggleExpandedItem,
|
|
18177
|
-
isItemExpanded
|
|
19506
|
+
isItemExpanded,
|
|
19507
|
+
triggerRefs
|
|
18178
19508
|
} = useNavigationMenuState(defaultActiveItemId, defaultExpandedItemIds);
|
|
18179
19509
|
return /*#__PURE__*/React__default.createElement(NavigationMenuProvider, {
|
|
18180
19510
|
value: {
|
|
@@ -18186,7 +19516,8 @@ var NavigationMenuComponent = _ref => {
|
|
|
18186
19516
|
orientation,
|
|
18187
19517
|
size,
|
|
18188
19518
|
variant,
|
|
18189
|
-
onItemActivate
|
|
19519
|
+
onItemActivate,
|
|
19520
|
+
triggerRefs
|
|
18190
19521
|
}
|
|
18191
19522
|
}, items ? (/*#__PURE__*/React__default.createElement(NavigationMenuView, Object.assign({
|
|
18192
19523
|
items: items,
|
|
@@ -18242,16 +19573,24 @@ var useTableContext = () => React.useContext(TableContext);
|
|
|
18242
19573
|
*/
|
|
18243
19574
|
/**
|
|
18244
19575
|
* Default table styles following the design system
|
|
19576
|
+
* Matching shadcn/ui patterns with subtle shadows and transitions
|
|
18245
19577
|
*/
|
|
18246
19578
|
var DefaultTableStyles = {
|
|
18247
19579
|
table: {
|
|
18248
19580
|
width: '100%',
|
|
18249
19581
|
borderRadius: '8px',
|
|
18250
19582
|
overflow: 'hidden',
|
|
18251
|
-
boxShadow: '
|
|
19583
|
+
boxShadow: '0px 1px 3px rgba(0, 0, 0, 0.06), 0px 1px 2px rgba(0, 0, 0, 0.04)',
|
|
18252
19584
|
border: '1px solid',
|
|
18253
19585
|
borderColor: 'color.gray.200',
|
|
18254
|
-
transition: '
|
|
19586
|
+
transition: 'box-shadow 0.2s ease',
|
|
19587
|
+
media: {
|
|
19588
|
+
mobile: {
|
|
19589
|
+
overflowX: 'auto',
|
|
19590
|
+
display: 'block',
|
|
19591
|
+
borderRadius: '4px'
|
|
19592
|
+
}
|
|
19593
|
+
}
|
|
18255
19594
|
},
|
|
18256
19595
|
thead: {
|
|
18257
19596
|
backgroundColor: 'color.gray.50',
|
|
@@ -18263,18 +19602,35 @@ var DefaultTableStyles = {
|
|
|
18263
19602
|
fontWeight: '600',
|
|
18264
19603
|
fontSize: '14px',
|
|
18265
19604
|
color: 'color.gray.700',
|
|
18266
|
-
textAlign: 'left'
|
|
19605
|
+
textAlign: 'left',
|
|
19606
|
+
media: {
|
|
19607
|
+
mobile: {
|
|
19608
|
+
padding: '8px 12px',
|
|
19609
|
+
fontSize: '12px'
|
|
19610
|
+
}
|
|
19611
|
+
}
|
|
18267
19612
|
},
|
|
18268
19613
|
td: {
|
|
18269
19614
|
padding: '12px 16px',
|
|
18270
19615
|
fontSize: '14px',
|
|
18271
19616
|
borderBottom: '1px solid',
|
|
18272
|
-
borderBottomColor: 'color.gray.100'
|
|
19617
|
+
borderBottomColor: 'color.gray.100',
|
|
19618
|
+
color: 'color.gray.900',
|
|
19619
|
+
media: {
|
|
19620
|
+
mobile: {
|
|
19621
|
+
padding: '8px 12px',
|
|
19622
|
+
fontSize: '12px'
|
|
19623
|
+
}
|
|
19624
|
+
}
|
|
18273
19625
|
},
|
|
18274
19626
|
tr: {
|
|
18275
|
-
transition: 'background-color 0.
|
|
19627
|
+
transition: 'background-color 0.15s ease',
|
|
18276
19628
|
_hover: {
|
|
18277
19629
|
backgroundColor: 'color.gray.50'
|
|
19630
|
+
},
|
|
19631
|
+
_focus: {
|
|
19632
|
+
outline: 'none',
|
|
19633
|
+
backgroundColor: 'color.gray.100'
|
|
18278
19634
|
}
|
|
18279
19635
|
},
|
|
18280
19636
|
tfoot: {
|
|
@@ -18287,7 +19643,12 @@ var DefaultTableStyles = {
|
|
|
18287
19643
|
margin: '8px 0',
|
|
18288
19644
|
color: 'color.gray.600',
|
|
18289
19645
|
fontSize: '14px',
|
|
18290
|
-
fontStyle: 'italic'
|
|
19646
|
+
fontStyle: 'italic',
|
|
19647
|
+
media: {
|
|
19648
|
+
mobile: {
|
|
19649
|
+
fontSize: '12px'
|
|
19650
|
+
}
|
|
19651
|
+
}
|
|
18291
19652
|
}
|
|
18292
19653
|
};
|
|
18293
19654
|
|
|
@@ -19082,6 +20443,13 @@ var TitleView = _ref => {
|
|
|
19082
20443
|
};
|
|
19083
20444
|
var resolvedColor = resolveColorValue(highlightColor);
|
|
19084
20445
|
var resolvedSecondary = highlightSecondaryColor ? resolveColorValue(highlightSecondaryColor) : undefined;
|
|
20446
|
+
var baseHighlightProps = HighlightStyles[highlightStyle](resolvedColor, resolvedSecondary);
|
|
20447
|
+
var highlightViewProps = highlightStyle === 'background' ? Object.assign({}, baseHighlightProps, {
|
|
20448
|
+
color: undefined
|
|
20449
|
+
}) : baseHighlightProps;
|
|
20450
|
+
var highlightBackgroundOverrides = highlightStyle === 'background' ? {
|
|
20451
|
+
bgColor: resolvedColor
|
|
20452
|
+
} : {};
|
|
19085
20453
|
var {
|
|
19086
20454
|
finalDisplayedText,
|
|
19087
20455
|
activeHighlightTarget,
|
|
@@ -19150,7 +20518,7 @@ var TitleView = _ref => {
|
|
|
19150
20518
|
as: "span",
|
|
19151
20519
|
display: "inline",
|
|
19152
20520
|
animate: inView ? controlledHighlightAnimate : undefined
|
|
19153
|
-
},
|
|
20521
|
+
}, highlightViewProps, highlightBackgroundOverrides, views == null ? void 0 : views.highlight), highlightTypewriter ? (/*#__PURE__*/React__default.createElement(TypewriterEffect, {
|
|
19154
20522
|
text: part.text,
|
|
19155
20523
|
typingSpeed: Math.max(30, highlightTypewriterDuration / (part.text.length * 10)),
|
|
19156
20524
|
showCursor: true,
|
|
@@ -19174,7 +20542,7 @@ var TitleView = _ref => {
|
|
|
19174
20542
|
as: "span",
|
|
19175
20543
|
display: "inline",
|
|
19176
20544
|
animate: inView ? controlledHighlightAnimate : undefined
|
|
19177
|
-
},
|
|
20545
|
+
}, highlightViewProps, highlightBackgroundOverrides, views == null ? void 0 : views.highlight), highlightTypewriter ? (/*#__PURE__*/React__default.createElement(TypewriterEffect, {
|
|
19178
20546
|
text: text,
|
|
19179
20547
|
typingSpeed: Math.max(30, highlightTypewriterDuration / (text.length * 10)),
|
|
19180
20548
|
showCursor: true,
|
|
@@ -23515,19 +24883,43 @@ var PaginationSizes = {
|
|
|
23515
24883
|
fontSize: '12px',
|
|
23516
24884
|
padding: '4px 8px',
|
|
23517
24885
|
minWidth: '28px',
|
|
23518
|
-
height: '28px'
|
|
24886
|
+
height: '28px',
|
|
24887
|
+
media: {
|
|
24888
|
+
mobile: {
|
|
24889
|
+
fontSize: '11px',
|
|
24890
|
+
padding: '3px 6px',
|
|
24891
|
+
minWidth: '24px',
|
|
24892
|
+
height: '24px'
|
|
24893
|
+
}
|
|
24894
|
+
}
|
|
23519
24895
|
},
|
|
23520
24896
|
md: {
|
|
23521
24897
|
fontSize: '14px',
|
|
23522
24898
|
padding: '6px 12px',
|
|
23523
24899
|
minWidth: '36px',
|
|
23524
|
-
height: '36px'
|
|
24900
|
+
height: '36px',
|
|
24901
|
+
media: {
|
|
24902
|
+
mobile: {
|
|
24903
|
+
fontSize: '12px',
|
|
24904
|
+
padding: '4px 8px',
|
|
24905
|
+
minWidth: '28px',
|
|
24906
|
+
height: '28px'
|
|
24907
|
+
}
|
|
24908
|
+
}
|
|
23525
24909
|
},
|
|
23526
24910
|
lg: {
|
|
23527
24911
|
fontSize: '16px',
|
|
23528
24912
|
padding: '8px 16px',
|
|
23529
24913
|
minWidth: '44px',
|
|
23530
|
-
height: '44px'
|
|
24914
|
+
height: '44px',
|
|
24915
|
+
media: {
|
|
24916
|
+
mobile: {
|
|
24917
|
+
fontSize: '14px',
|
|
24918
|
+
padding: '6px 12px',
|
|
24919
|
+
minWidth: '36px',
|
|
24920
|
+
height: '36px'
|
|
24921
|
+
}
|
|
24922
|
+
}
|
|
23531
24923
|
}
|
|
23532
24924
|
};
|
|
23533
24925
|
var PaginationVariants = {
|
|
@@ -23859,16 +25251,23 @@ var SeparatorThicknesses = {
|
|
|
23859
25251
|
};
|
|
23860
25252
|
/**
|
|
23861
25253
|
* Default styles for the Separator component
|
|
25254
|
+
* Matching shadcn/ui patterns with subtle colors
|
|
23862
25255
|
*/
|
|
23863
25256
|
var DefaultSeparatorStyles = {
|
|
23864
25257
|
container: {
|
|
23865
|
-
transition: '
|
|
25258
|
+
transition: 'opacity 0.15s ease'
|
|
25259
|
+
},
|
|
25260
|
+
line: {
|
|
25261
|
+
backgroundColor: 'color.gray.200',
|
|
25262
|
+
transition: 'background-color 0.15s ease'
|
|
23866
25263
|
},
|
|
23867
25264
|
label: {
|
|
23868
25265
|
fontSize: '14px',
|
|
23869
|
-
|
|
25266
|
+
fontWeight: '500',
|
|
25267
|
+
color: 'color.gray.600',
|
|
23870
25268
|
paddingHorizontal: '8px',
|
|
23871
|
-
|
|
25269
|
+
backgroundColor: 'color.white',
|
|
25270
|
+
transition: 'color 0.15s ease'
|
|
23872
25271
|
}
|
|
23873
25272
|
};
|
|
23874
25273
|
|
|
@@ -24173,27 +25572,17 @@ var useSidebarState = function useSidebarState(defaultExpanded, expanded, onExpa
|
|
|
24173
25572
|
if (defaultExpanded === void 0) {
|
|
24174
25573
|
defaultExpanded = true;
|
|
24175
25574
|
}
|
|
25575
|
+
var {
|
|
25576
|
+
on
|
|
25577
|
+
} = appStudio.useResponsive();
|
|
25578
|
+
var isMobile = on('mobile');
|
|
24176
25579
|
var [isExpanded, setIsExpanded] = React.useState(expanded !== undefined ? expanded : defaultExpanded);
|
|
24177
|
-
var [isMobile, setIsMobile] = React.useState(breakpoint ? window.innerWidth < breakpoint : false);
|
|
24178
25580
|
// Handle controlled expanded state
|
|
24179
25581
|
React.useEffect(() => {
|
|
24180
25582
|
if (expanded !== undefined) {
|
|
24181
25583
|
setIsExpanded(expanded);
|
|
24182
25584
|
}
|
|
24183
25585
|
}, [expanded]);
|
|
24184
|
-
// Handle window resize for responsive behavior
|
|
24185
|
-
React.useEffect(() => {
|
|
24186
|
-
if (!breakpoint) return;
|
|
24187
|
-
var handleResize = () => {
|
|
24188
|
-
var newIsMobile = window.innerWidth < breakpoint;
|
|
24189
|
-
setIsMobile(newIsMobile);
|
|
24190
|
-
};
|
|
24191
|
-
window.addEventListener('resize', handleResize);
|
|
24192
|
-
handleResize(); // Initial check
|
|
24193
|
-
return () => {
|
|
24194
|
-
window.removeEventListener('resize', handleResize);
|
|
24195
|
-
};
|
|
24196
|
-
}, [breakpoint]);
|
|
24197
25586
|
var toggleExpanded = () => {
|
|
24198
25587
|
var newExpanded = !isExpanded;
|
|
24199
25588
|
setIsExpanded(newExpanded);
|
|
@@ -24556,7 +25945,7 @@ var SidebarComponent = _ref => {
|
|
|
24556
25945
|
expand,
|
|
24557
25946
|
collapse,
|
|
24558
25947
|
isMobile
|
|
24559
|
-
} = useSidebarState(defaultExpanded, expanded, onExpandedChange
|
|
25948
|
+
} = useSidebarState(defaultExpanded, expanded, onExpandedChange);
|
|
24560
25949
|
return /*#__PURE__*/React__default.createElement(SidebarProvider, {
|
|
24561
25950
|
value: {
|
|
24562
25951
|
isExpanded,
|
|
@@ -25636,13 +27025,15 @@ var ToastView = _ref => {
|
|
|
25636
27025
|
fontWeight: "600" // Semi-bold for better readability
|
|
25637
27026
|
,
|
|
25638
27027
|
color: Theme[variant].content.color,
|
|
25639
|
-
lineHeight: "1.4"
|
|
27028
|
+
lineHeight: "1.4",
|
|
27029
|
+
bgColor: Theme[variant].container.backgroundColor
|
|
25640
27030
|
}, views == null ? void 0 : views.title), title), description && (/*#__PURE__*/React__default.createElement(Text, Object.assign({
|
|
25641
27031
|
size: "sm",
|
|
25642
27032
|
color: Theme[variant].content.color,
|
|
25643
27033
|
fontWeight: "400" // Regular weight
|
|
25644
27034
|
,
|
|
25645
|
-
lineHeight: "1.5"
|
|
27035
|
+
lineHeight: "1.5",
|
|
27036
|
+
bgColor: Theme[variant].container.backgroundColor
|
|
25646
27037
|
}, views == null ? void 0 : views.description), description)), action && actionText && (/*#__PURE__*/React__default.createElement(Text, Object.assign({
|
|
25647
27038
|
size: "sm",
|
|
25648
27039
|
fontWeight: "600" // Semi-bold for better readability
|
|
@@ -25651,6 +27042,7 @@ var ToastView = _ref => {
|
|
|
25651
27042
|
,
|
|
25652
27043
|
cursor: "pointer",
|
|
25653
27044
|
color: Theme[variant].content.color,
|
|
27045
|
+
bgColor: Theme[variant].container.backgroundColor,
|
|
25654
27046
|
onClick: e => {
|
|
25655
27047
|
e.stopPropagation();
|
|
25656
27048
|
action();
|
|
@@ -26455,19 +27847,28 @@ var TooltipSizes = {
|
|
|
26455
27847
|
var getTooltip = themeMode => {
|
|
26456
27848
|
return {
|
|
26457
27849
|
default: {
|
|
26458
|
-
backgroundColor: 'color.gray.
|
|
26459
|
-
color: 'color.white'
|
|
27850
|
+
backgroundColor: 'color.gray.900',
|
|
27851
|
+
color: 'color.white',
|
|
27852
|
+
borderRadius: '6px',
|
|
27853
|
+
boxShadow: '0px 4px 6px rgba(0, 0, 0, 0.1), 0px 2px 4px rgba(0, 0, 0, 0.06)',
|
|
27854
|
+
transition: 'opacity 0.15s ease'
|
|
26460
27855
|
},
|
|
26461
27856
|
light: {
|
|
26462
27857
|
backgroundColor: 'color.white',
|
|
26463
27858
|
color: 'color.gray.800',
|
|
26464
27859
|
borderWidth: '1px',
|
|
26465
27860
|
borderStyle: 'solid',
|
|
26466
|
-
borderColor: 'color.gray.200'
|
|
27861
|
+
borderColor: 'color.gray.200',
|
|
27862
|
+
borderRadius: '6px',
|
|
27863
|
+
boxShadow: '0px 4px 6px rgba(0, 0, 0, 0.08), 0px 2px 4px rgba(0, 0, 0, 0.04)',
|
|
27864
|
+
transition: 'opacity 0.15s ease'
|
|
26467
27865
|
},
|
|
26468
27866
|
dark: {
|
|
26469
|
-
backgroundColor: 'color.
|
|
26470
|
-
color: 'color.white'
|
|
27867
|
+
backgroundColor: 'color.gray.950',
|
|
27868
|
+
color: 'color.white',
|
|
27869
|
+
borderRadius: '6px',
|
|
27870
|
+
boxShadow: '0px 4px 6px rgba(0, 0, 0, 0.2), 0px 2px 4px rgba(0, 0, 0, 0.12)',
|
|
27871
|
+
transition: 'opacity 0.15s ease'
|
|
26471
27872
|
}
|
|
26472
27873
|
};
|
|
26473
27874
|
// Add dark mode conditional styling here
|