@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
package/dist/web.esm.js
CHANGED
|
@@ -5,14 +5,15 @@ import 'core-js/modules/es.array.iterator.js';
|
|
|
5
5
|
import 'core-js/modules/es.string.includes.js';
|
|
6
6
|
import 'core-js/modules/web.dom-collections.iterator.js';
|
|
7
7
|
import 'core-js/modules/es.regexp.to-string.js';
|
|
8
|
-
import { View, Horizontal, Vertical, Element, Text as Text$1, Center, useTheme, Image, useHover, useElementPosition, Typography, Input, Form, Button as Button$1, useInView } from 'app-studio';
|
|
8
|
+
import { View, Horizontal, Vertical, Element, Text as Text$1, Center, useTheme, Image, useHover, useElementPosition, Typography, Input, Form, Button as Button$1, useInView, useResponsive } from 'app-studio';
|
|
9
9
|
import 'core-js/modules/es.symbol.description.js';
|
|
10
10
|
import 'core-js/modules/es.parse-float.js';
|
|
11
11
|
import 'core-js/modules/es.string.trim-end.js';
|
|
12
12
|
import 'core-js/modules/es.parse-int.js';
|
|
13
13
|
import 'core-js/modules/es.regexp.exec.js';
|
|
14
|
-
import 'core-js/modules/es.string.pad-start.js';
|
|
15
14
|
import 'core-js/modules/es.string.replace.js';
|
|
15
|
+
import 'core-js/modules/es.string.starts-with.js';
|
|
16
|
+
import 'core-js/modules/es.string.trim.js';
|
|
16
17
|
import 'core-js/modules/es.array-buffer.constructor.js';
|
|
17
18
|
import 'core-js/modules/es.array-buffer.slice.js';
|
|
18
19
|
import 'core-js/modules/es.typed-array.uint8-array.js';
|
|
@@ -20,7 +21,6 @@ import 'core-js/modules/es.typed-array.fill.js';
|
|
|
20
21
|
import 'core-js/modules/es.typed-array.set.js';
|
|
21
22
|
import 'core-js/modules/es.typed-array.sort.js';
|
|
22
23
|
import 'core-js/modules/es.typed-array.to-locale-string.js';
|
|
23
|
-
import 'core-js/modules/es.string.starts-with.js';
|
|
24
24
|
import 'core-js/modules/web.url.js';
|
|
25
25
|
import 'core-js/modules/web.url.to-json.js';
|
|
26
26
|
import 'core-js/modules/web.url-search-params.js';
|
|
@@ -31,12 +31,9 @@ import contrast from 'contrast';
|
|
|
31
31
|
import 'core-js/modules/es.promise.js';
|
|
32
32
|
import 'core-js/modules/es.array.reduce.js';
|
|
33
33
|
import 'core-js/modules/es.number.to-fixed.js';
|
|
34
|
-
import 'core-js/modules/es.array.flat.js';
|
|
35
|
-
import 'core-js/modules/es.array.unscopables.flat.js';
|
|
36
|
-
import { format, isWithinInterval, startOfDay, endOfDay, isSameDay, isSameMonth, startOfWeek, addDays, startOfMonth, endOfMonth, endOfWeek, eachDayOfInterval, subMonths, subWeeks, subDays, addMonths, addWeeks } from 'date-fns';
|
|
37
34
|
import 'core-js/modules/es.array.sort.js';
|
|
38
|
-
import
|
|
39
|
-
import '
|
|
35
|
+
import 'core-js/modules/es.string.pad-start.js';
|
|
36
|
+
import format from 'date-fns/format';
|
|
40
37
|
import 'core-js/modules/es.regexp.constructor.js';
|
|
41
38
|
import { useFormikContext, getIn } from 'formik';
|
|
42
39
|
import { UploadService } from 'src/services/api';
|
|
@@ -192,15 +189,24 @@ var AccordionShapes = {
|
|
|
192
189
|
var AccordionVariants = {
|
|
193
190
|
default: {
|
|
194
191
|
backgroundColor: 'transparent',
|
|
195
|
-
borderWidth: 0
|
|
192
|
+
borderWidth: 0,
|
|
193
|
+
transition: 'background-color 0.15s ease'
|
|
196
194
|
},
|
|
197
195
|
outline: {
|
|
198
196
|
borderWidth: 1,
|
|
199
197
|
borderStyle: 'solid',
|
|
200
|
-
borderColor: 'color.gray.200'
|
|
198
|
+
borderColor: 'color.gray.200',
|
|
199
|
+
transition: 'border-color 0.15s ease, background-color 0.15s ease',
|
|
200
|
+
_hover: {
|
|
201
|
+
borderColor: 'color.gray.300'
|
|
202
|
+
}
|
|
201
203
|
},
|
|
202
204
|
filled: {
|
|
203
|
-
backgroundColor: 'color.gray.50'
|
|
205
|
+
backgroundColor: 'color.gray.50',
|
|
206
|
+
transition: 'background-color 0.15s ease',
|
|
207
|
+
_hover: {
|
|
208
|
+
backgroundColor: 'color.gray.100'
|
|
209
|
+
}
|
|
204
210
|
}
|
|
205
211
|
};
|
|
206
212
|
|
|
@@ -453,6 +459,7 @@ Accordion.Content = AccordionContent;
|
|
|
453
459
|
*/
|
|
454
460
|
/**
|
|
455
461
|
* Heading sizes following typography guidelines
|
|
462
|
+
* Matching shadcn/ui typography patterns
|
|
456
463
|
*/
|
|
457
464
|
var HeadingSizes = {
|
|
458
465
|
h1: {
|
|
@@ -460,42 +467,54 @@ var HeadingSizes = {
|
|
|
460
467
|
lineHeight: '40px',
|
|
461
468
|
fontWeight: '700',
|
|
462
469
|
letterSpacing: '-0.02em',
|
|
463
|
-
marginBottom: '24px'
|
|
470
|
+
marginBottom: '24px',
|
|
471
|
+
color: 'color.gray.900',
|
|
472
|
+
transition: 'color 0.15s ease'
|
|
464
473
|
},
|
|
465
474
|
h2: {
|
|
466
475
|
fontSize: '30px',
|
|
467
476
|
lineHeight: '36px',
|
|
468
477
|
fontWeight: '700',
|
|
469
478
|
letterSpacing: '-0.02em',
|
|
470
|
-
marginBottom: '20px'
|
|
479
|
+
marginBottom: '20px',
|
|
480
|
+
color: 'color.gray.900',
|
|
481
|
+
transition: 'color 0.15s ease'
|
|
471
482
|
},
|
|
472
483
|
h3: {
|
|
473
484
|
fontSize: '24px',
|
|
474
485
|
lineHeight: '32px',
|
|
475
486
|
fontWeight: '600',
|
|
476
487
|
letterSpacing: '-0.01em',
|
|
477
|
-
marginBottom: '16px'
|
|
488
|
+
marginBottom: '16px',
|
|
489
|
+
color: 'color.gray.900',
|
|
490
|
+
transition: 'color 0.15s ease'
|
|
478
491
|
},
|
|
479
492
|
h4: {
|
|
480
493
|
fontSize: '20px',
|
|
481
494
|
lineHeight: '28px',
|
|
482
495
|
fontWeight: '600',
|
|
483
496
|
letterSpacing: '-0.01em',
|
|
484
|
-
marginBottom: '16px'
|
|
497
|
+
marginBottom: '16px',
|
|
498
|
+
color: 'color.gray.900',
|
|
499
|
+
transition: 'color 0.15s ease'
|
|
485
500
|
},
|
|
486
501
|
h5: {
|
|
487
502
|
fontSize: '18px',
|
|
488
503
|
lineHeight: '24px',
|
|
489
504
|
fontWeight: '600',
|
|
490
505
|
letterSpacing: '-0.01em',
|
|
491
|
-
marginBottom: '12px'
|
|
506
|
+
marginBottom: '12px',
|
|
507
|
+
color: 'color.gray.900',
|
|
508
|
+
transition: 'color 0.15s ease'
|
|
492
509
|
},
|
|
493
510
|
h6: {
|
|
494
511
|
fontSize: '16px',
|
|
495
512
|
lineHeight: '24px',
|
|
496
513
|
fontWeight: '600',
|
|
497
514
|
letterSpacing: '-0.01em',
|
|
498
|
-
marginBottom: '8px'
|
|
515
|
+
marginBottom: '8px',
|
|
516
|
+
color: 'color.gray.900',
|
|
517
|
+
transition: 'color 0.15s ease'
|
|
499
518
|
}
|
|
500
519
|
};
|
|
501
520
|
/**
|
|
@@ -533,31 +552,40 @@ var FontWeights = {
|
|
|
533
552
|
black: '900'
|
|
534
553
|
};
|
|
535
554
|
|
|
555
|
+
var normalizeHexColor = backgroundColor => {
|
|
556
|
+
if (!backgroundColor) {
|
|
557
|
+
return null;
|
|
558
|
+
}
|
|
559
|
+
var trimmed = backgroundColor.trim();
|
|
560
|
+
var withoutHash = trimmed.startsWith('#') ? trimmed.slice(1) : trimmed;
|
|
561
|
+
if (withoutHash.length === 3) {
|
|
562
|
+
if (!/^[0-9a-fA-F]{3}$/.test(withoutHash)) {
|
|
563
|
+
return null;
|
|
564
|
+
}
|
|
565
|
+
return "#" + withoutHash.split('').map(char => char + char).join('');
|
|
566
|
+
}
|
|
567
|
+
if (!/^[0-9a-fA-F]{6}$/.test(withoutHash)) {
|
|
568
|
+
return null;
|
|
569
|
+
}
|
|
570
|
+
return "#" + withoutHash.toLowerCase();
|
|
571
|
+
};
|
|
536
572
|
var getTextColorHex = backgroundColor => {
|
|
573
|
+
var normalized = normalizeHexColor(backgroundColor);
|
|
574
|
+
if (!normalized) {
|
|
575
|
+
return 'black';
|
|
576
|
+
}
|
|
537
577
|
// Simple luminance calculation to determine text color contrast
|
|
538
|
-
var color =
|
|
578
|
+
var color = normalized.replace('#', '');
|
|
539
579
|
var r = parseInt(color.substring(0, 2), 16);
|
|
540
580
|
var g = parseInt(color.substring(2, 4), 16);
|
|
541
581
|
var b = parseInt(color.substring(4, 6), 16);
|
|
542
582
|
var luminance = (0.299 * r + 0.587 * g + 0.114 * b) / 255;
|
|
543
583
|
return luminance > 0.4 ? 'black' : 'white';
|
|
544
584
|
};
|
|
545
|
-
var getTextColor = backgroundColor =>
|
|
546
|
-
// Use complementary color for better contrast and return as hex
|
|
547
|
-
var color = backgroundColor.replace('#', '');
|
|
548
|
-
var r = parseInt(color.substring(0, 2), 16);
|
|
549
|
-
var g = parseInt(color.substring(2, 4), 16);
|
|
550
|
-
var b = parseInt(color.substring(4, 6), 16);
|
|
551
|
-
// Calculate the complementary color
|
|
552
|
-
var complementR = (255 - r).toString(16).padStart(2, '0');
|
|
553
|
-
var complementG = (255 - g).toString(16).padStart(2, '0');
|
|
554
|
-
var complementB = (255 - b).toString(16).padStart(2, '0');
|
|
555
|
-
// Return the color in hex format
|
|
556
|
-
return getTextColorHex("#" + complementR + complementG + complementB);
|
|
557
|
-
};
|
|
585
|
+
var getTextColor = backgroundColor => getTextColorHex(backgroundColor);
|
|
558
586
|
|
|
559
587
|
var _excluded$2 = ["text", "maxLines", "views"],
|
|
560
|
-
_excluded2$1 = ["children", "heading", "maxLines", "isItalic", "isUnderlined", "isSub", "isSup", "isStriked", "weight", "size", "bgColor", "color", "views"];
|
|
588
|
+
_excluded2$1 = ["children", "heading", "maxLines", "isItalic", "isUnderlined", "isSub", "isSup", "isStriked", "weight", "size", "bgColor", "backgroundColor", "color", "views"];
|
|
561
589
|
/**
|
|
562
590
|
* Renders text content with support for subscript and superscript
|
|
563
591
|
*/
|
|
@@ -661,6 +689,7 @@ var TruncateText = _ref2 => {
|
|
|
661
689
|
* Main Text component that renders text with various styles and states
|
|
662
690
|
*/
|
|
663
691
|
var TextView = _ref3 => {
|
|
692
|
+
var _views$container, _ref4;
|
|
664
693
|
var {
|
|
665
694
|
children,
|
|
666
695
|
heading,
|
|
@@ -673,6 +702,7 @@ var TextView = _ref3 => {
|
|
|
673
702
|
weight = 'normal',
|
|
674
703
|
size = 'md',
|
|
675
704
|
bgColor,
|
|
705
|
+
backgroundColor: backgroundColorProp,
|
|
676
706
|
color,
|
|
677
707
|
views
|
|
678
708
|
} = _ref3,
|
|
@@ -687,7 +717,9 @@ var TextView = _ref3 => {
|
|
|
687
717
|
var fontSize = FontSizes[size];
|
|
688
718
|
var lineHeight = LineHeights[size];
|
|
689
719
|
var fontWeight = FontWeights[weight];
|
|
690
|
-
var
|
|
720
|
+
var containerBackgroundColor = views == null || (_views$container = views.container) == null ? void 0 : _views$container.backgroundColor;
|
|
721
|
+
var effectiveBackgroundColor = (_ref4 = bgColor != null ? bgColor : backgroundColorProp) != null ? _ref4 : containerBackgroundColor;
|
|
722
|
+
var computedColor = color != null ? color : effectiveBackgroundColor ? getTextColor(effectiveBackgroundColor) : undefined;
|
|
691
723
|
return /*#__PURE__*/React.createElement(Element
|
|
692
724
|
// Apply typography styles according to design guidelines
|
|
693
725
|
, Object.assign({
|
|
@@ -698,7 +730,8 @@ var TextView = _ref3 => {
|
|
|
698
730
|
fontWeight: fontWeight,
|
|
699
731
|
letterSpacing: "-0.01em",
|
|
700
732
|
textDecoration: isStriked ? 'line-through' : isUnderlined ? 'underline' : 'none',
|
|
701
|
-
color: computedColor
|
|
733
|
+
color: computedColor,
|
|
734
|
+
backgroundColor: effectiveBackgroundColor
|
|
702
735
|
}, noLineBreak, headingStyles, props, views == null ? void 0 : views.container), maxLines && typeof children === 'string' ? (/*#__PURE__*/React.createElement(TruncateText, {
|
|
703
736
|
text: children,
|
|
704
737
|
maxLines: maxLines
|
|
@@ -3359,13 +3392,15 @@ var AlertView = _ref => {
|
|
|
3359
3392
|
fontWeight: "600" // Semi-bold
|
|
3360
3393
|
,
|
|
3361
3394
|
lineHeight: "24px",
|
|
3362
|
-
color: themes[variant].content.color
|
|
3395
|
+
color: themes[variant].content.color,
|
|
3396
|
+
bgColor: themes[variant].container.backgroundColor
|
|
3363
3397
|
}, views == null ? void 0 : views.title), title), /*#__PURE__*/React.createElement(Text, Object.assign({
|
|
3364
3398
|
fontSize: "14px",
|
|
3365
3399
|
fontWeight: "400" // Regular
|
|
3366
3400
|
,
|
|
3367
3401
|
lineHeight: "20px",
|
|
3368
|
-
color: themes[variant].content.color
|
|
3402
|
+
color: themes[variant].content.color,
|
|
3403
|
+
bgColor: themes[variant].container.backgroundColor
|
|
3369
3404
|
}, views == null ? void 0 : views.description), description || children)));
|
|
3370
3405
|
};
|
|
3371
3406
|
|
|
@@ -3687,14 +3722,17 @@ var MessageView = _ref => {
|
|
|
3687
3722
|
width: "100%"
|
|
3688
3723
|
}, /*#__PURE__*/React.createElement(Text, Object.assign({
|
|
3689
3724
|
size: "md",
|
|
3690
|
-
weight: "semiBold"
|
|
3725
|
+
weight: "semiBold",
|
|
3726
|
+
bgColor: Theme[variant].container.backgroundColor
|
|
3691
3727
|
}, views == null ? void 0 : views.title), title), subtitle && (/*#__PURE__*/React.createElement(Text, Object.assign({
|
|
3692
|
-
size: "sm"
|
|
3728
|
+
size: "sm",
|
|
3729
|
+
bgColor: Theme[variant].container.backgroundColor
|
|
3693
3730
|
}, views == null ? void 0 : views.subtitle), subtitle))), showAction && (/*#__PURE__*/React.createElement(Text, Object.assign({
|
|
3694
3731
|
marginRight: 10,
|
|
3695
3732
|
onClick: action,
|
|
3696
3733
|
padding: "6px 10px",
|
|
3697
|
-
whiteSpace: "nowrap"
|
|
3734
|
+
whiteSpace: "nowrap",
|
|
3735
|
+
bgColor: Theme[variant].container.backgroundColor
|
|
3698
3736
|
}, containerStyle, views == null ? void 0 : views.actionText), actionText)), isClosable && (/*#__PURE__*/React.createElement(View, Object.assign({
|
|
3699
3737
|
position: "absolute",
|
|
3700
3738
|
zIndex: 10000,
|
|
@@ -4792,7 +4830,8 @@ var BadgeView = _ref => {
|
|
|
4792
4830
|
,
|
|
4793
4831
|
textAlign: "center"
|
|
4794
4832
|
}, views == null ? void 0 : views.text, {
|
|
4795
|
-
color: combinedStyles.color
|
|
4833
|
+
color: combinedStyles.color,
|
|
4834
|
+
bgColor: combinedStyles.backgroundColor
|
|
4796
4835
|
}), content || ''));
|
|
4797
4836
|
};
|
|
4798
4837
|
|
|
@@ -4842,9 +4881,18 @@ var LinkView = _ref => {
|
|
|
4842
4881
|
} = _ref,
|
|
4843
4882
|
props = _objectWithoutPropertiesLoose(_ref, _excluded$c);
|
|
4844
4883
|
// Function to handle mouse enter/leave events to toggle hover state.
|
|
4845
|
-
var
|
|
4884
|
+
var handleMouseEnter = () => {
|
|
4846
4885
|
if (underline === 'hover') setIsHovered(true);
|
|
4847
4886
|
};
|
|
4887
|
+
var handleMouseLeave = () => {
|
|
4888
|
+
if (underline === 'hover') setIsHovered(false);
|
|
4889
|
+
};
|
|
4890
|
+
// Determine text decoration based on underline prop and hover state
|
|
4891
|
+
var getTextDecoration = () => {
|
|
4892
|
+
if (underline === 'underline') return 'underline';
|
|
4893
|
+
if (underline === 'hover' && isHovered) return 'underline';
|
|
4894
|
+
return 'none';
|
|
4895
|
+
};
|
|
4848
4896
|
return /*#__PURE__*/React.createElement(Link$1, {
|
|
4849
4897
|
to: to,
|
|
4850
4898
|
target: isExternal ? '_blank' : '_self',
|
|
@@ -4853,12 +4901,12 @@ var LinkView = _ref => {
|
|
|
4853
4901
|
color: 'inherit'
|
|
4854
4902
|
}
|
|
4855
4903
|
}, /*#__PURE__*/React.createElement(Horizontal, Object.assign({
|
|
4856
|
-
onMouseEnter:
|
|
4857
|
-
onMouseLeave:
|
|
4904
|
+
onMouseEnter: handleMouseEnter,
|
|
4905
|
+
onMouseLeave: handleMouseLeave,
|
|
4858
4906
|
gap: 3,
|
|
4859
4907
|
alignItems: "center",
|
|
4860
4908
|
flexWrap: "nowrap",
|
|
4861
|
-
textDecoration:
|
|
4909
|
+
textDecoration: getTextDecoration()
|
|
4862
4910
|
}, views.text, props), children, isExternal && /*#__PURE__*/React.createElement(ExternalLinkIcon, {
|
|
4863
4911
|
widthHeight: IconSizes[iconSize]
|
|
4864
4912
|
})));
|
|
@@ -5188,18 +5236,16 @@ var getButtonVariants = (color, isLight) => ({
|
|
|
5188
5236
|
borderStyle: 'solid',
|
|
5189
5237
|
borderColor: 'transparent',
|
|
5190
5238
|
_hover: {
|
|
5191
|
-
|
|
5192
|
-
textDecoration: 'underline',
|
|
5193
|
-
textUnderlineOffset: '1px',
|
|
5194
|
-
textDecorationThickness: '1px'
|
|
5239
|
+
opacity: 0.9
|
|
5195
5240
|
},
|
|
5196
5241
|
_active: {
|
|
5197
|
-
|
|
5198
|
-
textDecoration: 'underline',
|
|
5199
|
-
textUnderlineOffset: '1px',
|
|
5200
|
-
textDecorationThickness: '1px'
|
|
5242
|
+
opacity: 0.95
|
|
5201
5243
|
},
|
|
5202
|
-
|
|
5244
|
+
_focusVisible: {
|
|
5245
|
+
outline: 'none',
|
|
5246
|
+
boxShadow: "0 0 0 2px rgba(255, 255, 255, 1), 0 0 0 4px " + color
|
|
5247
|
+
},
|
|
5248
|
+
transition: 'background-color 0.2s ease, opacity 0.2s ease'
|
|
5203
5249
|
},
|
|
5204
5250
|
outline: {
|
|
5205
5251
|
backgroundColor: 'transparent',
|
|
@@ -5209,21 +5255,19 @@ var getButtonVariants = (color, isLight) => ({
|
|
|
5209
5255
|
borderColor: color,
|
|
5210
5256
|
_hover: {
|
|
5211
5257
|
backgroundColor: color,
|
|
5212
|
-
color: isLight ? '
|
|
5213
|
-
|
|
5214
|
-
textDecoration: 'underline',
|
|
5215
|
-
textUnderlineOffset: '1px',
|
|
5216
|
-
textDecorationThickness: '1px'
|
|
5258
|
+
color: isLight ? 'color.black' : 'color.white',
|
|
5259
|
+
opacity: 0.9
|
|
5217
5260
|
},
|
|
5218
5261
|
_active: {
|
|
5219
5262
|
backgroundColor: color,
|
|
5220
|
-
color: isLight ? '
|
|
5221
|
-
|
|
5222
|
-
textDecoration: 'underline',
|
|
5223
|
-
textUnderlineOffset: '1px',
|
|
5224
|
-
textDecorationThickness: '1px'
|
|
5263
|
+
color: isLight ? 'color.black' : 'color.white',
|
|
5264
|
+
opacity: 0.95
|
|
5225
5265
|
},
|
|
5226
|
-
|
|
5266
|
+
_focusVisible: {
|
|
5267
|
+
outline: 'none',
|
|
5268
|
+
boxShadow: "0 0 0 2px rgba(255, 255, 255, 1), 0 0 0 4px " + color
|
|
5269
|
+
},
|
|
5270
|
+
transition: 'background-color 0.2s ease, color 0.2s ease, opacity 0.2s ease'
|
|
5227
5271
|
},
|
|
5228
5272
|
ghost: {
|
|
5229
5273
|
backgroundColor: 'transparent',
|
|
@@ -5232,39 +5276,39 @@ var getButtonVariants = (color, isLight) => ({
|
|
|
5232
5276
|
borderStyle: 'none',
|
|
5233
5277
|
borderColor: 'transparent',
|
|
5234
5278
|
_hover: {
|
|
5235
|
-
backgroundColor: color,
|
|
5236
|
-
|
|
5237
|
-
transform: 'translateY(-1px)',
|
|
5238
|
-
textDecoration: 'underline',
|
|
5239
|
-
textUnderlineOffset: '1px',
|
|
5240
|
-
textDecorationThickness: '1px'
|
|
5279
|
+
backgroundColor: isLight ? 'color.gray.100' : 'color.gray.800',
|
|
5280
|
+
opacity: 0.9
|
|
5241
5281
|
},
|
|
5242
5282
|
_active: {
|
|
5243
|
-
backgroundColor: color,
|
|
5244
|
-
|
|
5245
|
-
transform: 'translateY(0)',
|
|
5246
|
-
textDecoration: 'underline',
|
|
5247
|
-
textUnderlineOffset: '1px',
|
|
5248
|
-
textDecorationThickness: '1px'
|
|
5283
|
+
backgroundColor: isLight ? 'color.gray.200' : 'color.gray.700',
|
|
5284
|
+
opacity: 0.95
|
|
5249
5285
|
},
|
|
5250
|
-
|
|
5286
|
+
_focusVisible: {
|
|
5287
|
+
outline: 'none',
|
|
5288
|
+
boxShadow: "0 0 0 2px rgba(255, 255, 255, 1), 0 0 0 4px " + color
|
|
5289
|
+
},
|
|
5290
|
+
transition: 'background-color 0.2s ease, opacity 0.2s ease'
|
|
5251
5291
|
},
|
|
5252
5292
|
link: {
|
|
5253
5293
|
backgroundColor: 'transparent',
|
|
5254
|
-
color: isLight ? color : '
|
|
5294
|
+
color: isLight ? color : 'color.black',
|
|
5255
5295
|
borderWidth: 0,
|
|
5256
5296
|
borderStyle: 'none',
|
|
5257
5297
|
borderColor: 'transparent',
|
|
5258
5298
|
textDecoration: 'underline',
|
|
5259
|
-
textUnderlineOffset: '
|
|
5299
|
+
textUnderlineOffset: '2px',
|
|
5260
5300
|
textDecorationThickness: '1px',
|
|
5261
5301
|
_hover: {
|
|
5262
|
-
|
|
5302
|
+
opacity: 0.8
|
|
5263
5303
|
},
|
|
5264
5304
|
_active: {
|
|
5265
|
-
|
|
5305
|
+
opacity: 0.9
|
|
5266
5306
|
},
|
|
5267
|
-
|
|
5307
|
+
_focusVisible: {
|
|
5308
|
+
outline: 'none',
|
|
5309
|
+
boxShadow: "0 0 0 2px rgba(255, 255, 255, 1), 0 0 0 4px " + color
|
|
5310
|
+
},
|
|
5311
|
+
transition: 'opacity 0.2s ease'
|
|
5268
5312
|
},
|
|
5269
5313
|
borderMoving: {
|
|
5270
5314
|
position: 'relative',
|
|
@@ -5273,7 +5317,12 @@ var getButtonVariants = (color, isLight) => ({
|
|
|
5273
5317
|
color: 'white',
|
|
5274
5318
|
borderWidth: 0,
|
|
5275
5319
|
borderStyle: 'none',
|
|
5276
|
-
borderColor: 'transparent'
|
|
5320
|
+
borderColor: 'transparent',
|
|
5321
|
+
_focusVisible: {
|
|
5322
|
+
outline: 'none',
|
|
5323
|
+
boxShadow: '0 0 0 2px rgba(255, 255, 255, 1), 0 0 0 4px rgba(0, 0, 0, 0.8)'
|
|
5324
|
+
},
|
|
5325
|
+
transition: 'opacity 0.2s ease'
|
|
5277
5326
|
},
|
|
5278
5327
|
animatedStroke: {
|
|
5279
5328
|
display: 'inline-block',
|
|
@@ -5286,7 +5335,12 @@ var getButtonVariants = (color, isLight) => ({
|
|
|
5286
5335
|
backgroundColor: 'transparent',
|
|
5287
5336
|
borderWidth: 0,
|
|
5288
5337
|
borderStyle: 'none',
|
|
5289
|
-
borderColor: 'transparent'
|
|
5338
|
+
borderColor: 'transparent',
|
|
5339
|
+
_focusVisible: {
|
|
5340
|
+
outline: 'none',
|
|
5341
|
+
boxShadow: "0 0 0 2px rgba(255, 255, 255, 1), 0 0 0 4px " + color
|
|
5342
|
+
},
|
|
5343
|
+
transition: 'opacity 0.2s ease'
|
|
5290
5344
|
}
|
|
5291
5345
|
});
|
|
5292
5346
|
/**
|
|
@@ -5624,26 +5678,34 @@ var getCardVariants = themeMode => {
|
|
|
5624
5678
|
default: {
|
|
5625
5679
|
backgroundColor: 'color.white',
|
|
5626
5680
|
border: 'none',
|
|
5627
|
-
transition: '
|
|
5681
|
+
transition: 'background-color 0.2s ease, box-shadow 0.2s ease'
|
|
5628
5682
|
},
|
|
5629
5683
|
outlined: {
|
|
5630
5684
|
backgroundColor: 'color.white',
|
|
5631
5685
|
borderWidth: '1px',
|
|
5632
5686
|
borderStyle: 'solid',
|
|
5633
5687
|
borderColor: 'color.gray.200',
|
|
5634
|
-
transition: '
|
|
5688
|
+
transition: 'border-color 0.2s ease, box-shadow 0.2s ease',
|
|
5635
5689
|
_hover: {
|
|
5636
|
-
borderColor: 'color.gray.300'
|
|
5690
|
+
borderColor: 'color.gray.300',
|
|
5691
|
+
boxShadow: '0px 1px 3px rgba(0, 0, 0, 0.05)'
|
|
5692
|
+
},
|
|
5693
|
+
_focusVisible: {
|
|
5694
|
+
outline: 'none',
|
|
5695
|
+
boxShadow: '0 0 0 2px rgba(255, 255, 255, 1), 0 0 0 4px rgba(0, 0, 0, 0.1)'
|
|
5637
5696
|
}
|
|
5638
5697
|
},
|
|
5639
5698
|
elevated: {
|
|
5640
5699
|
backgroundColor: 'color.white',
|
|
5641
|
-
boxShadow: '0px
|
|
5700
|
+
boxShadow: '0px 1px 3px rgba(0, 0, 0, 0.08), 0px 1px 2px rgba(0, 0, 0, 0.06)',
|
|
5642
5701
|
border: 'none',
|
|
5643
|
-
transition: '
|
|
5702
|
+
transition: 'box-shadow 0.2s ease',
|
|
5644
5703
|
_hover: {
|
|
5645
|
-
boxShadow: '0px 4px
|
|
5646
|
-
|
|
5704
|
+
boxShadow: '0px 4px 6px rgba(0, 0, 0, 0.08), 0px 2px 4px rgba(0, 0, 0, 0.06)'
|
|
5705
|
+
},
|
|
5706
|
+
_focusVisible: {
|
|
5707
|
+
outline: 'none',
|
|
5708
|
+
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)'
|
|
5647
5709
|
}
|
|
5648
5710
|
}
|
|
5649
5711
|
};
|
|
@@ -5659,24 +5721,44 @@ var getDefaultCardStyles = theme => {
|
|
|
5659
5721
|
color: 'color.black',
|
|
5660
5722
|
borderRadius: '8px',
|
|
5661
5723
|
overflow: 'hidden',
|
|
5662
|
-
transition: 'all 0.2s ease'
|
|
5724
|
+
transition: 'all 0.2s ease',
|
|
5725
|
+
media: {
|
|
5726
|
+
mobile: {
|
|
5727
|
+
borderRadius: '4px'
|
|
5728
|
+
}
|
|
5729
|
+
}
|
|
5663
5730
|
},
|
|
5664
5731
|
header: {
|
|
5665
5732
|
padding: '16px',
|
|
5666
5733
|
borderBottomWidth: '1px',
|
|
5667
5734
|
borderBottomStyle: 'solid',
|
|
5668
5735
|
borderBottomColor: 'color.gray.200',
|
|
5669
|
-
color: 'color.black'
|
|
5736
|
+
color: 'color.black',
|
|
5737
|
+
media: {
|
|
5738
|
+
mobile: {
|
|
5739
|
+
padding: '12px'
|
|
5740
|
+
}
|
|
5741
|
+
}
|
|
5670
5742
|
},
|
|
5671
5743
|
content: {
|
|
5672
5744
|
padding: '16px',
|
|
5673
|
-
color: 'color.black'
|
|
5745
|
+
color: 'color.black',
|
|
5746
|
+
media: {
|
|
5747
|
+
mobile: {
|
|
5748
|
+
padding: '12px'
|
|
5749
|
+
}
|
|
5750
|
+
}
|
|
5674
5751
|
},
|
|
5675
5752
|
footer: {
|
|
5676
5753
|
padding: '16px',
|
|
5677
5754
|
borderTopWidth: '1px',
|
|
5678
5755
|
borderTopStyle: 'solid',
|
|
5679
|
-
borderTopColor: 'color.gray.200'
|
|
5756
|
+
borderTopColor: 'color.gray.200',
|
|
5757
|
+
media: {
|
|
5758
|
+
mobile: {
|
|
5759
|
+
padding: '12px'
|
|
5760
|
+
}
|
|
5761
|
+
}
|
|
5680
5762
|
}
|
|
5681
5763
|
};
|
|
5682
5764
|
};
|
|
@@ -6462,17 +6544,6 @@ var LegendColorStyles = {
|
|
|
6462
6544
|
var LegendTextStyles = {
|
|
6463
6545
|
fontSize: '14px'
|
|
6464
6546
|
};
|
|
6465
|
-
// Default styles for tooltip
|
|
6466
|
-
var TooltipStyles = {
|
|
6467
|
-
position: 'absolute',
|
|
6468
|
-
backgroundColor: 'color.white',
|
|
6469
|
-
padding: '8px 12px',
|
|
6470
|
-
borderRadius: '4px',
|
|
6471
|
-
boxShadow: '0 2px 5px rgba(0, 0, 0, 0.1)',
|
|
6472
|
-
fontSize: '14px',
|
|
6473
|
-
pointerEvents: 'none',
|
|
6474
|
-
zIndex: 10
|
|
6475
|
-
};
|
|
6476
6547
|
// Default styles for chart grid
|
|
6477
6548
|
var GridStyles = {
|
|
6478
6549
|
stroke: 'color.gray.200',
|
|
@@ -6565,7 +6636,7 @@ var useChartState = _ref => {
|
|
|
6565
6636
|
visible: false,
|
|
6566
6637
|
x: 0,
|
|
6567
6638
|
y: 0,
|
|
6568
|
-
content:
|
|
6639
|
+
content: null
|
|
6569
6640
|
});
|
|
6570
6641
|
// Reference to animation frame
|
|
6571
6642
|
var animationRef = useRef(null);
|
|
@@ -6724,7 +6795,12 @@ var BarChart = _ref => {
|
|
|
6724
6795
|
x: x,
|
|
6725
6796
|
y: y,
|
|
6726
6797
|
textAnchor: "middle"
|
|
6727
|
-
}, AxisLabelStyles, views == null ? void 0 : views.axisLabel
|
|
6798
|
+
}, AxisLabelStyles, views == null ? void 0 : views.axisLabel, {
|
|
6799
|
+
style: {
|
|
6800
|
+
textShadow: '0 1px 2px rgba(0, 0, 0, 0.2)',
|
|
6801
|
+
filter: 'drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2))'
|
|
6802
|
+
}
|
|
6803
|
+
}), label);
|
|
6728
6804
|
}), yAxisTicks.map((tick, index) => {
|
|
6729
6805
|
var y = height - padding.bottom - tick / maxValue * chartHeight;
|
|
6730
6806
|
return /*#__PURE__*/React.createElement(React.Fragment, {
|
|
@@ -6734,7 +6810,12 @@ var BarChart = _ref => {
|
|
|
6734
6810
|
y: y,
|
|
6735
6811
|
textAnchor: "end",
|
|
6736
6812
|
dominantBaseline: "middle"
|
|
6737
|
-
}, AxisLabelStyles, views == null ? void 0 : views.axisLabel
|
|
6813
|
+
}, AxisLabelStyles, views == null ? void 0 : views.axisLabel, {
|
|
6814
|
+
style: {
|
|
6815
|
+
textShadow: '0 1px 2px rgba(0, 0, 0, 0.2)',
|
|
6816
|
+
filter: 'drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2))'
|
|
6817
|
+
}
|
|
6818
|
+
}), tick.toFixed(0)), showGrid && (/*#__PURE__*/React.createElement("line", Object.assign({
|
|
6738
6819
|
x1: padding.left,
|
|
6739
6820
|
y1: y,
|
|
6740
6821
|
x2: width - padding.right,
|
|
@@ -6746,8 +6827,61 @@ var BarChart = _ref => {
|
|
|
6746
6827
|
var barHeight = value / maxValue * chartHeight * animationProgress;
|
|
6747
6828
|
var x = padding.left + dataIndex * groupWidth + barSpacing * (seriesIndex + 1) + barWidth * seriesIndex;
|
|
6748
6829
|
var y = height - padding.bottom - barHeight;
|
|
6830
|
+
var categoryLabel = data.labels[dataIndex];
|
|
6831
|
+
var categoryTotal = data.series.reduce((sum, currentSeries) => {
|
|
6832
|
+
var seriesValue = currentSeries.data[dataIndex];
|
|
6833
|
+
return sum + (typeof seriesValue === 'number' ? seriesValue : 0);
|
|
6834
|
+
}, 0);
|
|
6835
|
+
var sharePercentage = categoryTotal > 0 ? (value / categoryTotal * 100).toFixed(1) : null;
|
|
6836
|
+
var fillColor = series.color ? getColor(series.color) : 'black';
|
|
6749
6837
|
var handleMouseEnter = e => {
|
|
6750
|
-
var tooltipContent =
|
|
6838
|
+
var tooltipContent = /*#__PURE__*/React.createElement(View, {
|
|
6839
|
+
display: "flex",
|
|
6840
|
+
flexDirection: "column",
|
|
6841
|
+
minWidth: "180px"
|
|
6842
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
6843
|
+
display: "flex",
|
|
6844
|
+
justifyContent: "space-between",
|
|
6845
|
+
alignItems: "center"
|
|
6846
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
6847
|
+
fontWeight: "semibold"
|
|
6848
|
+
}, series.name), /*#__PURE__*/React.createElement(View, {
|
|
6849
|
+
width: "12px",
|
|
6850
|
+
height: "12px",
|
|
6851
|
+
borderRadius: "2px",
|
|
6852
|
+
backgroundColor: fillColor
|
|
6853
|
+
})), /*#__PURE__*/React.createElement(Text, {
|
|
6854
|
+
marginTop: "4px",
|
|
6855
|
+
color: "color.gray.500",
|
|
6856
|
+
fontSize: "12px"
|
|
6857
|
+
}, categoryLabel), /*#__PURE__*/React.createElement(View, {
|
|
6858
|
+
marginTop: "8px",
|
|
6859
|
+
display: "flex",
|
|
6860
|
+
flexDirection: "column"
|
|
6861
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
6862
|
+
display: "flex",
|
|
6863
|
+
justifyContent: "space-between"
|
|
6864
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
6865
|
+
color: "color.gray.500"
|
|
6866
|
+
}, "Value"), /*#__PURE__*/React.createElement(Text, {
|
|
6867
|
+
fontWeight: "medium"
|
|
6868
|
+
}, value.toLocaleString())), sharePercentage !== null && (/*#__PURE__*/React.createElement(View, {
|
|
6869
|
+
marginTop: "4px",
|
|
6870
|
+
display: "flex",
|
|
6871
|
+
justifyContent: "space-between"
|
|
6872
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
6873
|
+
color: "color.gray.500"
|
|
6874
|
+
}, "Share"), /*#__PURE__*/React.createElement(Text, {
|
|
6875
|
+
fontWeight: "medium"
|
|
6876
|
+
}, sharePercentage + "%"))), /*#__PURE__*/React.createElement(View, {
|
|
6877
|
+
marginTop: "4px",
|
|
6878
|
+
display: "flex",
|
|
6879
|
+
justifyContent: "space-between"
|
|
6880
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
6881
|
+
color: "color.gray.500"
|
|
6882
|
+
}, "Category total"), /*#__PURE__*/React.createElement(Text, {
|
|
6883
|
+
fontWeight: "medium"
|
|
6884
|
+
}, categoryTotal.toLocaleString()))));
|
|
6751
6885
|
showTooltip(e.clientX, e.clientY, tooltipContent);
|
|
6752
6886
|
};
|
|
6753
6887
|
var handleClick = () => {
|
|
@@ -6761,7 +6895,7 @@ var BarChart = _ref => {
|
|
|
6761
6895
|
y: y,
|
|
6762
6896
|
width: barWidth,
|
|
6763
6897
|
height: barHeight,
|
|
6764
|
-
fill:
|
|
6898
|
+
fill: fillColor,
|
|
6765
6899
|
onMouseEnter: handleMouseEnter,
|
|
6766
6900
|
onMouseLeave: hideTooltip,
|
|
6767
6901
|
onClick: handleClick
|
|
@@ -6855,7 +6989,12 @@ var LineChart = _ref => {
|
|
|
6855
6989
|
x: x,
|
|
6856
6990
|
y: y,
|
|
6857
6991
|
textAnchor: "middle"
|
|
6858
|
-
}, AxisLabelStyles, views == null ? void 0 : views.axisLabel
|
|
6992
|
+
}, AxisLabelStyles, views == null ? void 0 : views.axisLabel, {
|
|
6993
|
+
style: {
|
|
6994
|
+
textShadow: '0 1px 2px rgba(0, 0, 0, 0.2)',
|
|
6995
|
+
filter: 'drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2))'
|
|
6996
|
+
}
|
|
6997
|
+
}), label);
|
|
6859
6998
|
}), yAxisTicks.map((tick, index) => {
|
|
6860
6999
|
var y = height - padding.bottom - tick / maxValue * chartHeight;
|
|
6861
7000
|
return /*#__PURE__*/React.createElement(React.Fragment, {
|
|
@@ -6865,43 +7004,114 @@ var LineChart = _ref => {
|
|
|
6865
7004
|
y: y,
|
|
6866
7005
|
textAnchor: "end",
|
|
6867
7006
|
dominantBaseline: "middle"
|
|
6868
|
-
}, AxisLabelStyles, views == null ? void 0 : views.axisLabel
|
|
7007
|
+
}, AxisLabelStyles, views == null ? void 0 : views.axisLabel, {
|
|
7008
|
+
style: {
|
|
7009
|
+
textShadow: '0 1px 2px rgba(0, 0, 0, 0.2)',
|
|
7010
|
+
filter: 'drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2))'
|
|
7011
|
+
}
|
|
7012
|
+
}), tick.toFixed(0)), showGrid && (/*#__PURE__*/React.createElement("line", Object.assign({
|
|
6869
7013
|
x1: padding.left,
|
|
6870
7014
|
y1: y,
|
|
6871
7015
|
x2: width - padding.right,
|
|
6872
7016
|
y2: y
|
|
6873
7017
|
}, GridStyles, views == null ? void 0 : views.grid))));
|
|
6874
|
-
}), data.series.map((series, seriesIndex) =>
|
|
6875
|
-
|
|
6876
|
-
|
|
6877
|
-
|
|
6878
|
-
|
|
6879
|
-
|
|
6880
|
-
|
|
6881
|
-
|
|
6882
|
-
|
|
6883
|
-
|
|
6884
|
-
|
|
6885
|
-
|
|
6886
|
-
|
|
6887
|
-
var
|
|
6888
|
-
|
|
6889
|
-
|
|
6890
|
-
|
|
6891
|
-
|
|
6892
|
-
|
|
6893
|
-
|
|
6894
|
-
|
|
6895
|
-
|
|
6896
|
-
|
|
6897
|
-
|
|
6898
|
-
|
|
6899
|
-
|
|
6900
|
-
|
|
6901
|
-
|
|
6902
|
-
|
|
6903
|
-
|
|
6904
|
-
|
|
7018
|
+
}), data.series.map((series, seriesIndex) => {
|
|
7019
|
+
var lineColor = series.color ? getColor(series.color) : 'black';
|
|
7020
|
+
return /*#__PURE__*/React.createElement(React.Fragment, {
|
|
7021
|
+
key: "series-" + seriesIndex
|
|
7022
|
+
}, /*#__PURE__*/React.createElement("path", Object.assign({
|
|
7023
|
+
d: generateAreaPath(series.data),
|
|
7024
|
+
fill: lineColor,
|
|
7025
|
+
opacity: 0.1
|
|
7026
|
+
}, views == null ? void 0 : views.area)), /*#__PURE__*/React.createElement("path", Object.assign({
|
|
7027
|
+
d: generatePath(series.data),
|
|
7028
|
+
stroke: lineColor
|
|
7029
|
+
}, LineStyles, views == null ? void 0 : views.line)), series.data.map((value, dataIndex) => {
|
|
7030
|
+
var x = padding.left + dataIndex / (data.labels.length - 1) * chartWidth;
|
|
7031
|
+
var y = height - padding.bottom - value / maxValue * chartHeight * animationProgress;
|
|
7032
|
+
var categoryLabel = data.labels[dataIndex];
|
|
7033
|
+
var categoryTotal = data.series.reduce((sum, currentSeries) => {
|
|
7034
|
+
var seriesValue = currentSeries.data[dataIndex];
|
|
7035
|
+
return sum + (typeof seriesValue === 'number' ? seriesValue : 0);
|
|
7036
|
+
}, 0);
|
|
7037
|
+
var sharePercentage = categoryTotal > 0 ? (value / categoryTotal * 100).toFixed(1) : null;
|
|
7038
|
+
var previousValue = dataIndex > 0 && typeof series.data[dataIndex - 1] === 'number' ? series.data[dataIndex - 1] : null;
|
|
7039
|
+
var deltaValue = typeof previousValue === 'number' ? value - previousValue : null;
|
|
7040
|
+
var formattedDelta = typeof deltaValue === 'number' ? "" + (deltaValue >= 0 ? '+' : '') + deltaValue.toLocaleString() : null;
|
|
7041
|
+
var handleMouseEnter = e => {
|
|
7042
|
+
var tooltipContent = /*#__PURE__*/React.createElement(View, {
|
|
7043
|
+
display: "flex",
|
|
7044
|
+
flexDirection: "column",
|
|
7045
|
+
minWidth: "200px"
|
|
7046
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
7047
|
+
display: "flex",
|
|
7048
|
+
justifyContent: "space-between",
|
|
7049
|
+
alignItems: "center"
|
|
7050
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
7051
|
+
fontWeight: "semibold"
|
|
7052
|
+
}, series.name), /*#__PURE__*/React.createElement(View, {
|
|
7053
|
+
width: "12px",
|
|
7054
|
+
height: "12px",
|
|
7055
|
+
borderRadius: "2px",
|
|
7056
|
+
backgroundColor: lineColor
|
|
7057
|
+
})), /*#__PURE__*/React.createElement(Text, {
|
|
7058
|
+
marginTop: "4px",
|
|
7059
|
+
color: "color.gray.500",
|
|
7060
|
+
fontSize: "12px"
|
|
7061
|
+
}, categoryLabel), /*#__PURE__*/React.createElement(View, {
|
|
7062
|
+
marginTop: "8px",
|
|
7063
|
+
display: "flex",
|
|
7064
|
+
flexDirection: "column"
|
|
7065
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
7066
|
+
display: "flex",
|
|
7067
|
+
justifyContent: "space-between"
|
|
7068
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
7069
|
+
color: "color.gray.500"
|
|
7070
|
+
}, "Value"), /*#__PURE__*/React.createElement(Text, {
|
|
7071
|
+
fontWeight: "medium"
|
|
7072
|
+
}, value.toLocaleString())), formattedDelta !== null && (/*#__PURE__*/React.createElement(View, {
|
|
7073
|
+
marginTop: "4px",
|
|
7074
|
+
display: "flex",
|
|
7075
|
+
justifyContent: "space-between"
|
|
7076
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
7077
|
+
color: "color.gray.500"
|
|
7078
|
+
}, "Change"), /*#__PURE__*/React.createElement(Text, {
|
|
7079
|
+
fontWeight: "medium"
|
|
7080
|
+
}, formattedDelta))), sharePercentage !== null && (/*#__PURE__*/React.createElement(View, {
|
|
7081
|
+
marginTop: "4px",
|
|
7082
|
+
display: "flex",
|
|
7083
|
+
justifyContent: "space-between"
|
|
7084
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
7085
|
+
color: "color.gray.500"
|
|
7086
|
+
}, "Share"), /*#__PURE__*/React.createElement(Text, {
|
|
7087
|
+
fontWeight: "medium"
|
|
7088
|
+
}, sharePercentage + "%"))), /*#__PURE__*/React.createElement(View, {
|
|
7089
|
+
marginTop: "4px",
|
|
7090
|
+
display: "flex",
|
|
7091
|
+
justifyContent: "space-between"
|
|
7092
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
7093
|
+
color: "color.gray.500"
|
|
7094
|
+
}, "Category total"), /*#__PURE__*/React.createElement(Text, {
|
|
7095
|
+
fontWeight: "medium"
|
|
7096
|
+
}, categoryTotal.toLocaleString()))));
|
|
7097
|
+
showTooltip(e.clientX, e.clientY, tooltipContent);
|
|
7098
|
+
};
|
|
7099
|
+
var handleClick = () => {
|
|
7100
|
+
if (onPointClick) {
|
|
7101
|
+
onPointClick(series.name, dataIndex);
|
|
7102
|
+
}
|
|
7103
|
+
};
|
|
7104
|
+
return /*#__PURE__*/React.createElement("circle", Object.assign({
|
|
7105
|
+
key: "point-" + seriesIndex + "-" + dataIndex,
|
|
7106
|
+
cx: x,
|
|
7107
|
+
cy: y,
|
|
7108
|
+
fill: lineColor,
|
|
7109
|
+
onMouseEnter: handleMouseEnter,
|
|
7110
|
+
onMouseLeave: hideTooltip,
|
|
7111
|
+
onClick: handleClick
|
|
7112
|
+
}, PointStyles, views == null ? void 0 : views.point));
|
|
7113
|
+
}));
|
|
7114
|
+
}));
|
|
6905
7115
|
};
|
|
6906
7116
|
|
|
6907
7117
|
var PieChart = _ref => {
|
|
@@ -7008,10 +7218,75 @@ var PieChart = _ref => {
|
|
|
7008
7218
|
return /*#__PURE__*/React.createElement("svg", {
|
|
7009
7219
|
ref: chartRef,
|
|
7010
7220
|
width: width,
|
|
7011
|
-
height: height
|
|
7012
|
-
|
|
7221
|
+
height: height,
|
|
7222
|
+
style: {
|
|
7223
|
+
overflow: 'visible'
|
|
7224
|
+
}
|
|
7225
|
+
}, isDonut && (/*#__PURE__*/React.createElement("circle", {
|
|
7226
|
+
cx: centerX,
|
|
7227
|
+
cy: centerY,
|
|
7228
|
+
r: donutRadius,
|
|
7229
|
+
fill: "white",
|
|
7230
|
+
pointerEvents: "none"
|
|
7231
|
+
})), slices.map((slice, index) => {
|
|
7013
7232
|
var handleMouseEnter = e => {
|
|
7014
|
-
var
|
|
7233
|
+
var numericShare = total > 0 ? slice.value / total * 100 : 0;
|
|
7234
|
+
var remainingShare = total > 0 ? Math.max(0, 100 - numericShare) : null;
|
|
7235
|
+
var tooltipContent = /*#__PURE__*/React.createElement(View, {
|
|
7236
|
+
display: "flex",
|
|
7237
|
+
flexDirection: "column",
|
|
7238
|
+
minWidth: "200px"
|
|
7239
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
7240
|
+
display: "flex",
|
|
7241
|
+
justifyContent: "space-between",
|
|
7242
|
+
alignItems: "center"
|
|
7243
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
7244
|
+
fontWeight: "semibold"
|
|
7245
|
+
}, slice.label), /*#__PURE__*/React.createElement(View, {
|
|
7246
|
+
width: "12px",
|
|
7247
|
+
height: "12px",
|
|
7248
|
+
borderRadius: "2px",
|
|
7249
|
+
backgroundColor: slice.color
|
|
7250
|
+
})), /*#__PURE__*/React.createElement(Text, {
|
|
7251
|
+
marginTop: "4px",
|
|
7252
|
+
color: "color.gray.500",
|
|
7253
|
+
fontSize: "12px"
|
|
7254
|
+
}, "Slice ", slice.index + 1, " of ", dataPoints.length), /*#__PURE__*/React.createElement(View, {
|
|
7255
|
+
marginTop: "8px",
|
|
7256
|
+
display: "flex",
|
|
7257
|
+
flexDirection: "column"
|
|
7258
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
7259
|
+
display: "flex",
|
|
7260
|
+
justifyContent: "space-between"
|
|
7261
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
7262
|
+
color: "color.gray.500"
|
|
7263
|
+
}, "Value"), /*#__PURE__*/React.createElement(Text, {
|
|
7264
|
+
fontWeight: "medium"
|
|
7265
|
+
}, slice.value.toLocaleString())), /*#__PURE__*/React.createElement(View, {
|
|
7266
|
+
marginTop: "4px",
|
|
7267
|
+
display: "flex",
|
|
7268
|
+
justifyContent: "space-between"
|
|
7269
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
7270
|
+
color: "color.gray.500"
|
|
7271
|
+
}, "Share"), /*#__PURE__*/React.createElement(Text, {
|
|
7272
|
+
fontWeight: "medium"
|
|
7273
|
+
}, slice.percentage)), /*#__PURE__*/React.createElement(View, {
|
|
7274
|
+
marginTop: "4px",
|
|
7275
|
+
display: "flex",
|
|
7276
|
+
justifyContent: "space-between"
|
|
7277
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
7278
|
+
color: "color.gray.500"
|
|
7279
|
+
}, "Total"), /*#__PURE__*/React.createElement(Text, {
|
|
7280
|
+
fontWeight: "medium"
|
|
7281
|
+
}, total.toLocaleString())), remainingShare !== null && (/*#__PURE__*/React.createElement(View, {
|
|
7282
|
+
marginTop: "4px",
|
|
7283
|
+
display: "flex",
|
|
7284
|
+
justifyContent: "space-between"
|
|
7285
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
7286
|
+
color: "color.gray.500"
|
|
7287
|
+
}, "Remaining"), /*#__PURE__*/React.createElement(Text, {
|
|
7288
|
+
fontWeight: "medium"
|
|
7289
|
+
}, remainingShare.toFixed(1) + "%")))));
|
|
7015
7290
|
// Use intelligent positioning based on useElementPosition relation data
|
|
7016
7291
|
var x = e.clientX;
|
|
7017
7292
|
var y = e.clientY;
|
|
@@ -7051,14 +7326,97 @@ var PieChart = _ref => {
|
|
|
7051
7326
|
dominantBaseline: "middle",
|
|
7052
7327
|
fill: "white",
|
|
7053
7328
|
fontWeight: "bold",
|
|
7054
|
-
pointerEvents: "none"
|
|
7329
|
+
pointerEvents: "none",
|
|
7330
|
+
style: {
|
|
7331
|
+
textShadow: '0 2px 4px rgba(0, 0, 0, 0.5), 0 1px 2px rgba(0, 0, 0, 0.3)',
|
|
7332
|
+
filter: 'drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5))'
|
|
7333
|
+
}
|
|
7055
7334
|
}, slice.percentage)));
|
|
7056
|
-
})
|
|
7057
|
-
|
|
7058
|
-
|
|
7059
|
-
|
|
7060
|
-
|
|
7061
|
-
|
|
7335
|
+
}));
|
|
7336
|
+
};
|
|
7337
|
+
|
|
7338
|
+
var ChartTooltip = _ref => {
|
|
7339
|
+
var {
|
|
7340
|
+
visible,
|
|
7341
|
+
x,
|
|
7342
|
+
y,
|
|
7343
|
+
content,
|
|
7344
|
+
maxDistance = 100,
|
|
7345
|
+
views
|
|
7346
|
+
} = _ref;
|
|
7347
|
+
var tooltipRef = useRef(null);
|
|
7348
|
+
var [position, setPosition] = useState({
|
|
7349
|
+
left: 0,
|
|
7350
|
+
top: 0
|
|
7351
|
+
});
|
|
7352
|
+
useEffect(() => {
|
|
7353
|
+
if (!visible || !tooltipRef.current) return;
|
|
7354
|
+
var tooltip = tooltipRef.current;
|
|
7355
|
+
var tooltipRect = tooltip.getBoundingClientRect();
|
|
7356
|
+
var tooltipWidth = tooltipRect.width;
|
|
7357
|
+
var tooltipHeight = tooltipRect.height;
|
|
7358
|
+
var viewportOffset = 10;
|
|
7359
|
+
var cursorOffset = 15;
|
|
7360
|
+
// Start position: top-left corner near cursor
|
|
7361
|
+
var left = x - cursorOffset;
|
|
7362
|
+
var top = y - cursorOffset;
|
|
7363
|
+
// Calculate the distance from cursor to tooltip edges
|
|
7364
|
+
var distanceX = x - left; // Distance from cursor to left edge
|
|
7365
|
+
var distanceY = y - top; // Distance from cursor to top edge
|
|
7366
|
+
// If tooltip would be too far on X axis, adjust it
|
|
7367
|
+
if (distanceX > maxDistance) {
|
|
7368
|
+
left = x - maxDistance;
|
|
7369
|
+
}
|
|
7370
|
+
// If tooltip would be too far on Y axis, adjust it
|
|
7371
|
+
if (distanceY > maxDistance) {
|
|
7372
|
+
top = y - maxDistance;
|
|
7373
|
+
}
|
|
7374
|
+
// Ensure tooltip doesn't go off the right edge of viewport
|
|
7375
|
+
if (left + tooltipWidth > window.innerWidth - viewportOffset) {
|
|
7376
|
+
left = window.innerWidth - tooltipWidth - viewportOffset;
|
|
7377
|
+
// Still respect max distance constraint
|
|
7378
|
+
if (x - left > maxDistance) {
|
|
7379
|
+
left = x - maxDistance;
|
|
7380
|
+
}
|
|
7381
|
+
}
|
|
7382
|
+
// Ensure tooltip doesn't go off the left edge of viewport
|
|
7383
|
+
if (left < viewportOffset) {
|
|
7384
|
+
left = viewportOffset;
|
|
7385
|
+
}
|
|
7386
|
+
// Ensure tooltip doesn't go off the bottom edge of viewport
|
|
7387
|
+
if (top + tooltipHeight > window.innerHeight - viewportOffset) {
|
|
7388
|
+
top = window.innerHeight - tooltipHeight - viewportOffset;
|
|
7389
|
+
// Still respect max distance constraint
|
|
7390
|
+
if (y - top > maxDistance) {
|
|
7391
|
+
top = y - maxDistance;
|
|
7392
|
+
}
|
|
7393
|
+
}
|
|
7394
|
+
// Ensure tooltip doesn't go off the top edge of viewport
|
|
7395
|
+
if (top < viewportOffset) {
|
|
7396
|
+
top = viewportOffset;
|
|
7397
|
+
}
|
|
7398
|
+
setPosition({
|
|
7399
|
+
left,
|
|
7400
|
+
top
|
|
7401
|
+
});
|
|
7402
|
+
}, [visible, x, y, maxDistance]);
|
|
7403
|
+
if (!visible) return null;
|
|
7404
|
+
return /*#__PURE__*/React.createElement(View, Object.assign({
|
|
7405
|
+
ref: tooltipRef,
|
|
7406
|
+
position: "fixed",
|
|
7407
|
+
left: position.left + "px",
|
|
7408
|
+
top: position.top + "px",
|
|
7409
|
+
backgroundColor: "color.white",
|
|
7410
|
+
padding: "12px 16px",
|
|
7411
|
+
borderRadius: "8px",
|
|
7412
|
+
boxShadow: "0px 12px 24px rgba(15, 23, 42, 0.18)",
|
|
7413
|
+
border: "1px solid color.gray.200",
|
|
7414
|
+
fontSize: "14px",
|
|
7415
|
+
display: "flex",
|
|
7416
|
+
flexDirection: "column",
|
|
7417
|
+
pointerEvents: "none",
|
|
7418
|
+
zIndex: 10
|
|
7419
|
+
}, views == null ? void 0 : views.tooltip), content);
|
|
7062
7420
|
};
|
|
7063
7421
|
|
|
7064
7422
|
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"];
|
|
@@ -7189,15 +7547,6 @@ var ChartView = _ref => {
|
|
|
7189
7547
|
return null;
|
|
7190
7548
|
}
|
|
7191
7549
|
};
|
|
7192
|
-
// Render tooltip
|
|
7193
|
-
var renderTooltip = () => {
|
|
7194
|
-
if (!showTooltips || !tooltip.visible) return null;
|
|
7195
|
-
return /*#__PURE__*/React.createElement(View, Object.assign({
|
|
7196
|
-
position: "fixed",
|
|
7197
|
-
left: tooltip.x + "px",
|
|
7198
|
-
top: tooltip.y - 40 + "px"
|
|
7199
|
-
}, TooltipStyles, views == null ? void 0 : views.tooltip), tooltip.content);
|
|
7200
|
-
};
|
|
7201
7550
|
// Default loading indicator
|
|
7202
7551
|
var renderLoadingIndicator = () => {
|
|
7203
7552
|
if (!isLoading) return null;
|
|
@@ -7230,7 +7579,14 @@ var ChartView = _ref => {
|
|
|
7230
7579
|
flex: 1,
|
|
7231
7580
|
width: "100%",
|
|
7232
7581
|
position: "relative"
|
|
7233
|
-
}, views == null ? void 0 : views.chart), showChartContent && renderChart(), renderLoadingIndicator(), renderErrorIndicator(), renderNoDataIndicator()), showChartContent && legendPosition === 'bottom' && renderLegend(),
|
|
7582
|
+
}, views == null ? void 0 : views.chart), showChartContent && renderChart(), renderLoadingIndicator(), renderErrorIndicator(), renderNoDataIndicator()), showChartContent && legendPosition === 'bottom' && renderLegend(), /*#__PURE__*/React.createElement(ChartTooltip, {
|
|
7583
|
+
visible: showTooltips && tooltip.visible,
|
|
7584
|
+
x: tooltip.x,
|
|
7585
|
+
y: tooltip.y,
|
|
7586
|
+
content: tooltip.content,
|
|
7587
|
+
maxDistance: 100,
|
|
7588
|
+
views: views
|
|
7589
|
+
}));
|
|
7234
7590
|
};
|
|
7235
7591
|
|
|
7236
7592
|
/**
|
|
@@ -7242,6 +7598,9 @@ var ChartComponent = props => {
|
|
|
7242
7598
|
};
|
|
7243
7599
|
var Chart = ChartComponent;
|
|
7244
7600
|
|
|
7601
|
+
var cloneColumns = inputColumns => inputColumns.map(column => Object.assign({}, column, {
|
|
7602
|
+
cards: [...column.cards]
|
|
7603
|
+
}));
|
|
7245
7604
|
var useKanbanBoardState = _ref => {
|
|
7246
7605
|
var {
|
|
7247
7606
|
columns: initialColumns,
|
|
@@ -7249,20 +7608,26 @@ var useKanbanBoardState = _ref => {
|
|
|
7249
7608
|
} = _ref;
|
|
7250
7609
|
var [columns, setColumns] = useState(initialColumns);
|
|
7251
7610
|
var [draggedCardId, setDraggedCardId] = useState(null);
|
|
7611
|
+
var [hoveredColumnId, setHoveredColumnId] = useState(null);
|
|
7252
7612
|
var dragStateRef = useRef(null);
|
|
7613
|
+
var originalColumnsRef = useRef(null);
|
|
7614
|
+
var dropCommittedRef = useRef(false);
|
|
7615
|
+
var getRelativeDropPosition = useCallback(event => {
|
|
7616
|
+
var rect = event.currentTarget.getBoundingClientRect();
|
|
7617
|
+
var offset = event.clientY - rect.top;
|
|
7618
|
+
return offset < rect.height / 2 ? 'before' : 'after';
|
|
7619
|
+
}, []);
|
|
7253
7620
|
useEffect(() => {
|
|
7254
7621
|
setColumns(initialColumns);
|
|
7255
7622
|
}, [initialColumns]);
|
|
7256
|
-
var
|
|
7623
|
+
var applyMove = useCallback((targetColumnId, targetCardId, position, options) => {
|
|
7257
7624
|
var dragState = dragStateRef.current;
|
|
7258
7625
|
if (!dragState) return;
|
|
7259
7626
|
var {
|
|
7260
7627
|
columnId: sourceColumnId,
|
|
7261
7628
|
cardId
|
|
7262
7629
|
} = dragState;
|
|
7263
|
-
if (targetColumnId === sourceColumnId &&
|
|
7264
|
-
dragStateRef.current = null;
|
|
7265
|
-
setDraggedCardId(null);
|
|
7630
|
+
if (targetColumnId === sourceColumnId && targetCardId === cardId) {
|
|
7266
7631
|
return;
|
|
7267
7632
|
}
|
|
7268
7633
|
setColumns(prevColumns => {
|
|
@@ -7274,36 +7639,60 @@ var useKanbanBoardState = _ref => {
|
|
|
7274
7639
|
if (!sourceColumn || !targetColumn) {
|
|
7275
7640
|
return prevColumns;
|
|
7276
7641
|
}
|
|
7277
|
-
var sourceIndex = sourceColumn.cards.findIndex(
|
|
7642
|
+
var sourceIndex = sourceColumn.cards.findIndex(cardItem => cardItem.id === cardId);
|
|
7278
7643
|
if (sourceIndex === -1) {
|
|
7279
7644
|
return prevColumns;
|
|
7280
7645
|
}
|
|
7281
7646
|
var [card] = sourceColumn.cards.splice(sourceIndex, 1);
|
|
7282
|
-
var
|
|
7647
|
+
var dropPosition = position != null ? position : 'after';
|
|
7648
|
+
var targetIndex;
|
|
7283
7649
|
if (targetCardId) {
|
|
7284
7650
|
var foundIndex = targetColumn.cards.findIndex(item => item.id === targetCardId);
|
|
7285
7651
|
if (foundIndex !== -1) {
|
|
7286
|
-
targetIndex = foundIndex;
|
|
7287
|
-
|
|
7288
|
-
|
|
7289
|
-
}
|
|
7652
|
+
targetIndex = dropPosition === 'before' ? foundIndex : foundIndex + 1;
|
|
7653
|
+
} else {
|
|
7654
|
+
targetIndex = targetColumn.cards.length;
|
|
7290
7655
|
}
|
|
7656
|
+
} else {
|
|
7657
|
+
targetIndex = dropPosition === 'before' ? 0 : targetColumn.cards.length;
|
|
7291
7658
|
}
|
|
7292
7659
|
targetColumn.cards.splice(targetIndex, 0, card);
|
|
7660
|
+
var hasChanged = workingColumns.some((column, columnIndex) => {
|
|
7661
|
+
var previousColumn = prevColumns[columnIndex];
|
|
7662
|
+
if (!previousColumn) {
|
|
7663
|
+
return true;
|
|
7664
|
+
}
|
|
7665
|
+
if (column.cards.length !== previousColumn.cards.length) {
|
|
7666
|
+
return true;
|
|
7667
|
+
}
|
|
7668
|
+
return column.cards.some((currentCard, cardIndex) => {
|
|
7669
|
+
var _previousColumn$cards;
|
|
7670
|
+
return currentCard.id !== ((_previousColumn$cards = previousColumn.cards[cardIndex]) == null ? void 0 : _previousColumn$cards.id);
|
|
7671
|
+
});
|
|
7672
|
+
});
|
|
7673
|
+
if (!hasChanged) {
|
|
7674
|
+
return prevColumns;
|
|
7675
|
+
}
|
|
7293
7676
|
var updatedColumns = workingColumns.map(column => Object.assign({}, column, {
|
|
7294
7677
|
cards: [...column.cards]
|
|
7295
7678
|
}));
|
|
7296
|
-
|
|
7679
|
+
dragStateRef.current = {
|
|
7680
|
+
columnId: targetColumnId,
|
|
7681
|
+
cardId
|
|
7682
|
+
};
|
|
7683
|
+
if (options != null && options.shouldCommit) {
|
|
7684
|
+
onChange == null || onChange(updatedColumns);
|
|
7685
|
+
}
|
|
7297
7686
|
return updatedColumns;
|
|
7298
7687
|
});
|
|
7299
|
-
dragStateRef.current = null;
|
|
7300
|
-
setDraggedCardId(null);
|
|
7301
7688
|
}, [onChange]);
|
|
7302
7689
|
var handleCardDragStart = useCallback((columnId, cardId, event) => {
|
|
7303
7690
|
dragStateRef.current = {
|
|
7304
7691
|
columnId,
|
|
7305
7692
|
cardId
|
|
7306
7693
|
};
|
|
7694
|
+
originalColumnsRef.current = cloneColumns(columns);
|
|
7695
|
+
dropCommittedRef.current = false;
|
|
7307
7696
|
setDraggedCardId(cardId);
|
|
7308
7697
|
if (event.dataTransfer) {
|
|
7309
7698
|
event.dataTransfer.effectAllowed = 'move';
|
|
@@ -7313,35 +7702,52 @@ var useKanbanBoardState = _ref => {
|
|
|
7313
7702
|
// Ignore errors from browsers that disallow setting data
|
|
7314
7703
|
}
|
|
7315
7704
|
}
|
|
7316
|
-
}, []);
|
|
7705
|
+
}, [columns]);
|
|
7317
7706
|
var handleCardDragEnd = useCallback(() => {
|
|
7707
|
+
if (!dropCommittedRef.current && originalColumnsRef.current) {
|
|
7708
|
+
setColumns(cloneColumns(originalColumnsRef.current));
|
|
7709
|
+
}
|
|
7318
7710
|
dragStateRef.current = null;
|
|
7711
|
+
originalColumnsRef.current = null;
|
|
7712
|
+
dropCommittedRef.current = false;
|
|
7319
7713
|
setDraggedCardId(null);
|
|
7714
|
+
setHoveredColumnId(null);
|
|
7320
7715
|
}, []);
|
|
7321
|
-
var handleColumnDragOver = useCallback((
|
|
7716
|
+
var handleColumnDragOver = useCallback((columnId, event) => {
|
|
7322
7717
|
event.preventDefault();
|
|
7323
7718
|
if (event.dataTransfer) {
|
|
7324
7719
|
event.dataTransfer.dropEffect = 'move';
|
|
7325
7720
|
}
|
|
7326
|
-
|
|
7327
|
-
|
|
7721
|
+
setHoveredColumnId(columnId);
|
|
7722
|
+
applyMove(columnId, null, getRelativeDropPosition(event));
|
|
7723
|
+
}, [applyMove, getRelativeDropPosition]);
|
|
7724
|
+
var handleCardDragOver = useCallback((columnId, cardId, event) => {
|
|
7328
7725
|
event.preventDefault();
|
|
7329
7726
|
if (event.dataTransfer) {
|
|
7330
7727
|
event.dataTransfer.dropEffect = 'move';
|
|
7331
7728
|
}
|
|
7332
|
-
|
|
7729
|
+
setHoveredColumnId(columnId);
|
|
7730
|
+
applyMove(columnId, cardId, getRelativeDropPosition(event));
|
|
7731
|
+
}, [applyMove, getRelativeDropPosition]);
|
|
7333
7732
|
var handleColumnDrop = useCallback((columnId, event) => {
|
|
7334
7733
|
event.preventDefault();
|
|
7335
|
-
|
|
7336
|
-
|
|
7734
|
+
dropCommittedRef.current = true;
|
|
7735
|
+
applyMove(columnId, null, getRelativeDropPosition(event), {
|
|
7736
|
+
shouldCommit: true
|
|
7737
|
+
});
|
|
7738
|
+
}, [applyMove, getRelativeDropPosition]);
|
|
7337
7739
|
var handleCardDrop = useCallback((columnId, cardId, event) => {
|
|
7338
7740
|
event.preventDefault();
|
|
7339
7741
|
event.stopPropagation();
|
|
7340
|
-
|
|
7341
|
-
|
|
7742
|
+
dropCommittedRef.current = true;
|
|
7743
|
+
applyMove(columnId, cardId, getRelativeDropPosition(event), {
|
|
7744
|
+
shouldCommit: true
|
|
7745
|
+
});
|
|
7746
|
+
}, [applyMove, getRelativeDropPosition]);
|
|
7342
7747
|
return {
|
|
7343
7748
|
columns,
|
|
7344
7749
|
draggedCardId,
|
|
7750
|
+
hoveredColumnId,
|
|
7345
7751
|
onCardDragStart: handleCardDragStart,
|
|
7346
7752
|
onCardDragEnd: handleCardDragEnd,
|
|
7347
7753
|
onColumnDragOver: handleColumnDragOver,
|
|
@@ -7359,6 +7765,7 @@ var KanbanBoardView = _ref => {
|
|
|
7359
7765
|
renderEmptyState,
|
|
7360
7766
|
views,
|
|
7361
7767
|
draggedCardId,
|
|
7768
|
+
hoveredColumnId,
|
|
7362
7769
|
onCardDragStart,
|
|
7363
7770
|
onCardDragEnd,
|
|
7364
7771
|
onColumnDragOver,
|
|
@@ -7403,7 +7810,9 @@ var KanbanBoardView = _ref => {
|
|
|
7403
7810
|
gap: 12,
|
|
7404
7811
|
minHeight: 40,
|
|
7405
7812
|
onDragOver: event => onColumnDragOver(column.id, event),
|
|
7406
|
-
onDrop: event => onColumnDrop(column.id, event)
|
|
7813
|
+
onDrop: event => onColumnDrop(column.id, event),
|
|
7814
|
+
opacity: draggedCardId && hoveredColumnId === column.id ? 0.9 : undefined,
|
|
7815
|
+
transition: "all 0.15s ease-in-out"
|
|
7407
7816
|
}, views == null ? void 0 : views.columnBody), column.cards.length === 0 && (/*#__PURE__*/React.createElement(View, Object.assign({
|
|
7408
7817
|
padding: 12,
|
|
7409
7818
|
borderWidth: "1px",
|
|
@@ -7417,20 +7826,27 @@ var KanbanBoardView = _ref => {
|
|
|
7417
7826
|
}, views == null ? void 0 : views.emptyState), renderEmptyState ? renderEmptyState(column) : (/*#__PURE__*/React.createElement(Text, {
|
|
7418
7827
|
size: "sm",
|
|
7419
7828
|
color: "#667085"
|
|
7420
|
-
}, "Drop cards here")))), column.cards.map(card => (/*#__PURE__*/React.createElement(View,
|
|
7829
|
+
}, "Drop cards here")))), column.cards.map(card => (/*#__PURE__*/React.createElement(View, {
|
|
7421
7830
|
key: card.id,
|
|
7831
|
+
position: "relative"
|
|
7832
|
+
}, /*#__PURE__*/React.createElement(View, Object.assign({
|
|
7422
7833
|
draggable: true,
|
|
7423
7834
|
cursor: "grab",
|
|
7424
7835
|
backgroundColor: "#ffffff",
|
|
7425
7836
|
borderRadius: 10,
|
|
7426
7837
|
padding: "12px",
|
|
7427
7838
|
boxShadow: "0 1px 2px 0 rgba(16, 24, 40, 0.08)",
|
|
7428
|
-
opacity: draggedCardId === card.id ? 0.6 : 1,
|
|
7429
7839
|
onDragStart: event => onCardDragStart(column.id, card.id, event),
|
|
7430
7840
|
onDragEnd: onCardDragEnd,
|
|
7431
|
-
onDragOver: event =>
|
|
7432
|
-
|
|
7433
|
-
|
|
7841
|
+
onDragOver: event => {
|
|
7842
|
+
event.stopPropagation();
|
|
7843
|
+
onCardDragOver(column.id, card.id, event);
|
|
7844
|
+
},
|
|
7845
|
+
onDrop: event => {
|
|
7846
|
+
event.stopPropagation();
|
|
7847
|
+
onCardDrop(column.id, card.id, event);
|
|
7848
|
+
}
|
|
7849
|
+
}, views == null ? void 0 : views.card), renderCard ? renderCard(card, column) : renderDefaultCard(card)))))), column.footer && (/*#__PURE__*/React.createElement(View, Object.assign({}, views == null ? void 0 : views.columnFooter), column.footer))))));
|
|
7434
7850
|
};
|
|
7435
7851
|
|
|
7436
7852
|
var KanbanBoardComponent = props => {
|
|
@@ -7439,734 +7855,1038 @@ var KanbanBoardComponent = props => {
|
|
|
7439
7855
|
};
|
|
7440
7856
|
var KanbanBoard = KanbanBoardComponent;
|
|
7441
7857
|
|
|
7442
|
-
|
|
7443
|
-
|
|
7444
|
-
|
|
7445
|
-
|
|
7446
|
-
|
|
7447
|
-
closeDelay = 300
|
|
7448
|
-
} = _temp === void 0 ? {} : _temp;
|
|
7449
|
-
var [isOpen, setIsOpen] = useState(false);
|
|
7450
|
-
var openTimerRef = useRef(null);
|
|
7451
|
-
var closeTimerRef = useRef(null);
|
|
7452
|
-
// Refs for trigger and content elements for positioning
|
|
7453
|
-
var triggerRef = useRef(null);
|
|
7454
|
-
var contentRef = useRef(null);
|
|
7455
|
-
// Unique IDs for ARIA attributes
|
|
7456
|
-
var contentId = useMemo(() => generateId$1('hovercard-content'), []);
|
|
7457
|
-
var triggerId = useMemo(() => generateId$1('hovercard-trigger'), []);
|
|
7458
|
-
var clearTimers = useCallback(() => {
|
|
7459
|
-
if (openTimerRef.current) {
|
|
7460
|
-
clearTimeout(openTimerRef.current);
|
|
7461
|
-
openTimerRef.current = null;
|
|
7462
|
-
}
|
|
7463
|
-
if (closeTimerRef.current) {
|
|
7464
|
-
clearTimeout(closeTimerRef.current);
|
|
7465
|
-
closeTimerRef.current = null;
|
|
7466
|
-
}
|
|
7467
|
-
}, []);
|
|
7468
|
-
var openCard = useCallback(() => {
|
|
7469
|
-
clearTimers(); // Clear any pending close
|
|
7470
|
-
if (!isOpen) {
|
|
7471
|
-
openTimerRef.current = setTimeout(() => {
|
|
7472
|
-
setIsOpen(true);
|
|
7473
|
-
}, openDelay);
|
|
7474
|
-
}
|
|
7475
|
-
}, [isOpen, openDelay, clearTimers]);
|
|
7476
|
-
var closeCard = useCallback(() => {
|
|
7477
|
-
clearTimers(); // Clear any pending open
|
|
7478
|
-
if (isOpen) {
|
|
7479
|
-
closeTimerRef.current = setTimeout(() => {
|
|
7480
|
-
setIsOpen(false);
|
|
7481
|
-
}, closeDelay);
|
|
7482
|
-
}
|
|
7483
|
-
}, [isOpen, closeDelay, clearTimers]);
|
|
7484
|
-
// Function specifically to cancel the close timer (e.g., when mouse enters content)
|
|
7485
|
-
var cancelCloseTimer = useCallback(() => {
|
|
7486
|
-
if (closeTimerRef.current) {
|
|
7487
|
-
clearTimeout(closeTimerRef.current);
|
|
7488
|
-
closeTimerRef.current = null;
|
|
7489
|
-
}
|
|
7490
|
-
}, []);
|
|
7491
|
-
// Cleanup timers on unmount
|
|
7492
|
-
useEffect(() => {
|
|
7493
|
-
return () => clearTimers();
|
|
7494
|
-
}, [clearTimers]);
|
|
7495
|
-
return {
|
|
7496
|
-
isOpen,
|
|
7497
|
-
openCard,
|
|
7498
|
-
closeCard,
|
|
7499
|
-
cancelCloseTimer,
|
|
7500
|
-
triggerRef,
|
|
7501
|
-
contentRef,
|
|
7502
|
-
contentId,
|
|
7503
|
-
triggerId
|
|
7504
|
-
};
|
|
7858
|
+
/**
|
|
7859
|
+
* Convert an ISO date string to a UTC Date object
|
|
7860
|
+
*/
|
|
7861
|
+
var dateUTC = iso => {
|
|
7862
|
+
return new Date(iso + (iso.includes('T') ? '' : 'T00:00:00Z'));
|
|
7505
7863
|
};
|
|
7506
|
-
|
|
7507
|
-
|
|
7508
|
-
|
|
7509
|
-
|
|
7510
|
-
|
|
7511
|
-
isOpen: false,
|
|
7512
|
-
openCard: () => {},
|
|
7513
|
-
closeCard: () => {},
|
|
7514
|
-
cancelCloseTimer: () => {},
|
|
7515
|
-
triggerRef: {
|
|
7516
|
-
current: null
|
|
7517
|
-
},
|
|
7518
|
-
contentRef: {
|
|
7519
|
-
current: null
|
|
7520
|
-
},
|
|
7521
|
-
contentId: '',
|
|
7522
|
-
triggerId: ''
|
|
7523
|
-
});
|
|
7524
|
-
var HoverCardProvider = _ref => {
|
|
7525
|
-
var {
|
|
7526
|
-
children,
|
|
7527
|
-
value
|
|
7528
|
-
} = _ref;
|
|
7529
|
-
return /*#__PURE__*/React.createElement(HoverCardContext.Provider, {
|
|
7530
|
-
value: value
|
|
7531
|
-
}, children);
|
|
7864
|
+
/**
|
|
7865
|
+
* Calculate the number of days between two ISO date strings
|
|
7866
|
+
*/
|
|
7867
|
+
var daysBetweenUTC = (a, b) => {
|
|
7868
|
+
return Math.floor((dateUTC(a).getTime() - dateUTC(b).getTime()) / 86400000);
|
|
7532
7869
|
};
|
|
7533
|
-
|
|
7534
|
-
|
|
7535
|
-
|
|
7536
|
-
|
|
7537
|
-
|
|
7538
|
-
|
|
7870
|
+
/**
|
|
7871
|
+
* Add a number of days to an ISO date string
|
|
7872
|
+
*/
|
|
7873
|
+
var addDateDays = (dateISO, days) => {
|
|
7874
|
+
var d = new Date(dateISO + 'T00:00:00Z');
|
|
7875
|
+
d.setUTCDate(d.getUTCDate() + days);
|
|
7876
|
+
return d.toISOString().slice(0, 10);
|
|
7539
7877
|
};
|
|
7540
|
-
|
|
7541
|
-
|
|
7542
|
-
|
|
7543
|
-
|
|
7544
|
-
|
|
7545
|
-
} = _ref2,
|
|
7546
|
-
props = _objectWithoutPropertiesLoose(_ref2, _excluded$i);
|
|
7547
|
-
var {
|
|
7548
|
-
openCard,
|
|
7549
|
-
closeCard,
|
|
7550
|
-
triggerRef,
|
|
7551
|
-
contentId,
|
|
7552
|
-
triggerId
|
|
7553
|
-
} = useHoverCardContext();
|
|
7554
|
-
var handleMouseEnter = () => openCard();
|
|
7555
|
-
var handleMouseLeave = () => closeCard();
|
|
7556
|
-
var handleFocus = () => openCard(); // For keyboard accessibility
|
|
7557
|
-
var handleBlur = () => closeCard(); // For keyboard accessibility
|
|
7558
|
-
var triggerProps = Object.assign({
|
|
7559
|
-
ref: triggerRef,
|
|
7560
|
-
onMouseEnter: handleMouseEnter,
|
|
7561
|
-
onMouseLeave: handleMouseLeave,
|
|
7562
|
-
onFocus: handleFocus,
|
|
7563
|
-
onBlur: handleBlur,
|
|
7564
|
-
id: triggerId,
|
|
7565
|
-
'aria-describedby': contentId
|
|
7566
|
-
}, views == null ? void 0 : views.container, props);
|
|
7567
|
-
if (asChild && /*#__PURE__*/isValidElement(children)) {
|
|
7568
|
-
// Clone the child element and merge props
|
|
7569
|
-
var child = Children.only(children);
|
|
7570
|
-
return /*#__PURE__*/cloneElement(child, Object.assign({}, triggerProps, child.props));
|
|
7571
|
-
}
|
|
7572
|
-
// Default: wrap children in a View
|
|
7573
|
-
return /*#__PURE__*/React.createElement(View, Object.assign({
|
|
7574
|
-
position: "relative",
|
|
7575
|
-
display: "inline-block"
|
|
7576
|
-
}, triggerProps), children);
|
|
7878
|
+
/**
|
|
7879
|
+
* Get the day of the week (0-6) from an ISO date string
|
|
7880
|
+
*/
|
|
7881
|
+
var getDayOfWeek = dateISO => {
|
|
7882
|
+
return dateUTC(dateISO).getUTCDay();
|
|
7577
7883
|
};
|
|
7578
|
-
|
|
7579
|
-
|
|
7580
|
-
|
|
7581
|
-
|
|
7582
|
-
|
|
7583
|
-
align = 'center',
|
|
7584
|
-
sideOffset = 8,
|
|
7585
|
-
style: userStyle,
|
|
7586
|
-
// User provided style override
|
|
7587
|
-
backgroundColor = 'white',
|
|
7588
|
-
borderRadius = '4px',
|
|
7589
|
-
boxShadow = '0px 2px 8px rgba(0, 0, 0, 0.15)',
|
|
7590
|
-
padding = '12px',
|
|
7591
|
-
minWidth = '50px',
|
|
7592
|
-
maxWidth = '300px'
|
|
7593
|
-
} = _ref3,
|
|
7594
|
-
props = _objectWithoutPropertiesLoose(_ref3, _excluded2$6);
|
|
7595
|
-
var {
|
|
7596
|
-
isOpen,
|
|
7597
|
-
cancelCloseTimer,
|
|
7598
|
-
closeCard,
|
|
7599
|
-
contentRef,
|
|
7600
|
-
triggerRef,
|
|
7601
|
-
contentId,
|
|
7602
|
-
triggerId
|
|
7603
|
-
} = useHoverCardContext();
|
|
7604
|
-
// Use useElementPosition for intelligent positioning
|
|
7605
|
-
var {
|
|
7606
|
-
ref: positionRef,
|
|
7607
|
-
relation
|
|
7608
|
-
} = useElementPosition({
|
|
7609
|
-
trackChanges: true,
|
|
7610
|
-
trackOnHover: true,
|
|
7611
|
-
trackOnScroll: true,
|
|
7612
|
-
trackOnResize: true
|
|
7613
|
-
});
|
|
7614
|
-
// Sync the position ref with the trigger ref for positioning calculations
|
|
7615
|
-
useEffect(() => {
|
|
7616
|
-
if (triggerRef != null && triggerRef.current && (positionRef == null ? void 0 : positionRef.current) !== triggerRef.current) {
|
|
7617
|
-
// Update the position tracking to use the trigger element
|
|
7618
|
-
if (positionRef) {
|
|
7619
|
-
positionRef.current = triggerRef.current;
|
|
7620
|
-
}
|
|
7621
|
-
}
|
|
7622
|
-
}, [triggerRef, positionRef, isOpen]);
|
|
7623
|
-
var handleMouseEnter = () => cancelCloseTimer(); // Keep card open if mouse enters content
|
|
7624
|
-
var handleMouseLeave = () => closeCard();
|
|
7625
|
-
if (!isOpen) {
|
|
7626
|
-
return null; // Don't render content if not open
|
|
7627
|
-
}
|
|
7628
|
-
// Create intelligent positioning styles based on useElementPosition relation data
|
|
7629
|
-
var getPositionStyles = () => {
|
|
7630
|
-
if (!relation || !(triggerRef != null && triggerRef.current)) {
|
|
7631
|
-
// Fallback positioning if relation data is not available
|
|
7632
|
-
return {
|
|
7633
|
-
position: 'absolute',
|
|
7634
|
-
top: 0,
|
|
7635
|
-
left: 0,
|
|
7636
|
-
zIndex: 1000
|
|
7637
|
-
};
|
|
7638
|
-
}
|
|
7639
|
-
var triggerRect = triggerRef.current.getBoundingClientRect();
|
|
7640
|
-
var placement = side;
|
|
7641
|
-
// Use relation data to determine optimal placement
|
|
7642
|
-
// If preferred side doesn't have enough space, use the side with more space
|
|
7643
|
-
if (side === 'bottom' && relation.space.vertical === 'top') {
|
|
7644
|
-
placement = 'top';
|
|
7645
|
-
} else if (side === 'top' && relation.space.vertical === 'bottom') {
|
|
7646
|
-
placement = 'bottom';
|
|
7647
|
-
} else if (side === 'right' && relation.space.horizontal === 'left') {
|
|
7648
|
-
placement = 'left';
|
|
7649
|
-
} else if (side === 'left' && relation.space.horizontal === 'right') {
|
|
7650
|
-
placement = 'right';
|
|
7651
|
-
}
|
|
7652
|
-
// Calculate position based on optimal placement
|
|
7653
|
-
var x = 0;
|
|
7654
|
-
var y = 0;
|
|
7655
|
-
switch (placement) {
|
|
7656
|
-
case 'bottom':
|
|
7657
|
-
x = triggerRect.left + triggerRect.width / 2;
|
|
7658
|
-
y = triggerRect.bottom + sideOffset;
|
|
7659
|
-
break;
|
|
7660
|
-
case 'top':
|
|
7661
|
-
x = triggerRect.left + triggerRect.width / 2;
|
|
7662
|
-
y = triggerRect.top - sideOffset;
|
|
7663
|
-
break;
|
|
7664
|
-
case 'right':
|
|
7665
|
-
x = triggerRect.right + sideOffset;
|
|
7666
|
-
y = triggerRect.top + triggerRect.height / 2;
|
|
7667
|
-
break;
|
|
7668
|
-
case 'left':
|
|
7669
|
-
x = triggerRect.left - sideOffset;
|
|
7670
|
-
y = triggerRect.top + triggerRect.height / 2;
|
|
7671
|
-
break;
|
|
7672
|
-
}
|
|
7673
|
-
return {
|
|
7674
|
-
position: 'fixed',
|
|
7675
|
-
left: x,
|
|
7676
|
-
top: y,
|
|
7677
|
-
zIndex: 1000,
|
|
7678
|
-
transform: getTransformOrigin(placement)
|
|
7679
|
-
};
|
|
7680
|
-
};
|
|
7681
|
-
// Helper function to set transform origin for better positioning
|
|
7682
|
-
var getTransformOrigin = placement => {
|
|
7683
|
-
switch (placement) {
|
|
7684
|
-
case 'bottom':
|
|
7685
|
-
return 'translate(-50%, 0)';
|
|
7686
|
-
case 'top':
|
|
7687
|
-
return 'translate(-50%, -100%)';
|
|
7688
|
-
case 'right':
|
|
7689
|
-
return 'translate(0, -50%)';
|
|
7690
|
-
case 'left':
|
|
7691
|
-
return 'translate(-100%, -50%)';
|
|
7692
|
-
default:
|
|
7693
|
-
return 'translate(-50%, 0)';
|
|
7694
|
-
}
|
|
7695
|
-
};
|
|
7696
|
-
var positionStyles = getPositionStyles();
|
|
7697
|
-
return /*#__PURE__*/React.createElement(View, Object.assign({
|
|
7698
|
-
ref: contentRef,
|
|
7699
|
-
id: contentId,
|
|
7700
|
-
role: "tooltip" // Use tooltip role for accessibility
|
|
7701
|
-
,
|
|
7702
|
-
"aria-labelledby": triggerId,
|
|
7703
|
-
onMouseEnter: handleMouseEnter,
|
|
7704
|
-
onMouseLeave: handleMouseLeave,
|
|
7705
|
-
backgroundColor: backgroundColor,
|
|
7706
|
-
borderRadius: borderRadius,
|
|
7707
|
-
boxShadow: boxShadow,
|
|
7708
|
-
padding: padding,
|
|
7709
|
-
minWidth: minWidth,
|
|
7710
|
-
maxWidth: maxWidth,
|
|
7711
|
-
// Combine intelligent position styles with user styles
|
|
7712
|
-
style: Object.assign({}, positionStyles, userStyle)
|
|
7713
|
-
}, views == null ? void 0 : views.container, props), children);
|
|
7884
|
+
/**
|
|
7885
|
+
* Get the date number (1-31) from an ISO date string
|
|
7886
|
+
*/
|
|
7887
|
+
var getDateNumber = dateISO => {
|
|
7888
|
+
return dateUTC(dateISO).getUTCDate();
|
|
7714
7889
|
};
|
|
7715
|
-
|
|
7716
|
-
var _excluded$j = ["children", "views", "openDelay", "closeDelay"];
|
|
7717
7890
|
/**
|
|
7718
|
-
*
|
|
7719
|
-
* Supports configurable open and close delays for a smoother user experience.
|
|
7891
|
+
* Get the month (0-11) from an ISO date string
|
|
7720
7892
|
*/
|
|
7721
|
-
var
|
|
7722
|
-
|
|
7723
|
-
children,
|
|
7724
|
-
views,
|
|
7725
|
-
openDelay,
|
|
7726
|
-
closeDelay
|
|
7727
|
-
} = _ref,
|
|
7728
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$j);
|
|
7729
|
-
var hoverCardState = useHoverCardState({
|
|
7730
|
-
openDelay,
|
|
7731
|
-
closeDelay
|
|
7732
|
-
});
|
|
7733
|
-
return /*#__PURE__*/React.createElement(HoverCardProvider, {
|
|
7734
|
-
value: hoverCardState
|
|
7735
|
-
}, /*#__PURE__*/React.createElement(View, Object.assign({
|
|
7736
|
-
position: "relative",
|
|
7737
|
-
display: "inline-block"
|
|
7738
|
-
}, views == null ? void 0 : views.container, props), children));
|
|
7893
|
+
var getMonth = dateISO => {
|
|
7894
|
+
return dateUTC(dateISO).getUTCMonth();
|
|
7739
7895
|
};
|
|
7740
|
-
|
|
7741
|
-
|
|
7742
|
-
|
|
7743
|
-
|
|
7744
|
-
|
|
7745
|
-
|
|
7746
|
-
|
|
7896
|
+
/**
|
|
7897
|
+
* Get the year from an ISO date string
|
|
7898
|
+
*/
|
|
7899
|
+
var getYear = dateISO => {
|
|
7900
|
+
return dateUTC(dateISO).getUTCFullYear();
|
|
7901
|
+
};
|
|
7902
|
+
/**
|
|
7903
|
+
* Get the first day of the month for a given date
|
|
7904
|
+
*/
|
|
7905
|
+
var getFirstDayOfMonth = dateISO => {
|
|
7906
|
+
var d = dateUTC(dateISO);
|
|
7907
|
+
return new Date(Date.UTC(d.getUTCFullYear(), d.getUTCMonth(), 1)).toISOString().slice(0, 10);
|
|
7908
|
+
};
|
|
7909
|
+
/**
|
|
7910
|
+
* Get the start date of the calendar grid (may be in previous month)
|
|
7911
|
+
*/
|
|
7912
|
+
var getCalendarStartDate = function getCalendarStartDate(monthDateISO, weekStartsOn) {
|
|
7913
|
+
if (weekStartsOn === void 0) {
|
|
7914
|
+
weekStartsOn = 0;
|
|
7747
7915
|
}
|
|
7748
|
-
var
|
|
7749
|
-
|
|
7750
|
-
|
|
7916
|
+
var firstDay = getFirstDayOfMonth(monthDateISO);
|
|
7917
|
+
var firstDayOfWeek = getDayOfWeek(firstDay);
|
|
7918
|
+
var daysToSubtract = (firstDayOfWeek - weekStartsOn + 7) % 7;
|
|
7919
|
+
return addDateDays(firstDay, -daysToSubtract);
|
|
7920
|
+
};
|
|
7921
|
+
/**
|
|
7922
|
+
* Generate array of dates for the calendar grid (42 days = 6 weeks)
|
|
7923
|
+
*/
|
|
7924
|
+
var getCalendarDates = function getCalendarDates(monthDateISO, weekStartsOn) {
|
|
7925
|
+
if (weekStartsOn === void 0) {
|
|
7926
|
+
weekStartsOn = 0;
|
|
7927
|
+
}
|
|
7928
|
+
var startDate = getCalendarStartDate(monthDateISO, weekStartsOn);
|
|
7929
|
+
var dates = [];
|
|
7930
|
+
for (var i = 0; i < 42; i++) {
|
|
7931
|
+
dates.push(addDateDays(startDate, i));
|
|
7751
7932
|
}
|
|
7752
|
-
return
|
|
7753
|
-
};
|
|
7754
|
-
|
|
7755
|
-
|
|
7756
|
-
|
|
7757
|
-
|
|
7758
|
-
return
|
|
7759
|
-
|
|
7760
|
-
|
|
7933
|
+
return dates;
|
|
7934
|
+
};
|
|
7935
|
+
/**
|
|
7936
|
+
* Get month name from date
|
|
7937
|
+
*/
|
|
7938
|
+
var getMonthName = dateISO => {
|
|
7939
|
+
return dateUTC(dateISO).toLocaleDateString('en-US', {
|
|
7940
|
+
month: 'long',
|
|
7941
|
+
timeZone: 'UTC'
|
|
7761
7942
|
});
|
|
7762
7943
|
};
|
|
7763
|
-
|
|
7764
|
-
|
|
7765
|
-
|
|
7766
|
-
|
|
7767
|
-
|
|
7768
|
-
|
|
7769
|
-
return events.filter(event => {
|
|
7770
|
-
var {
|
|
7771
|
-
startDate,
|
|
7772
|
-
endDate
|
|
7773
|
-
} = event;
|
|
7774
|
-
if (isWithinInterval(startDate, dayInterval)) {
|
|
7775
|
-
return true;
|
|
7776
|
-
}
|
|
7777
|
-
if (isWithinInterval(endDate, dayInterval)) {
|
|
7778
|
-
return true;
|
|
7779
|
-
}
|
|
7780
|
-
return startDate <= dayInterval.start && endDate >= dayInterval.end;
|
|
7781
|
-
}).sort((a, b) => a.startDate.getTime() - b.startDate.getTime());
|
|
7944
|
+
/**
|
|
7945
|
+
* Get the previous month date
|
|
7946
|
+
*/
|
|
7947
|
+
var getPreviousMonth = dateISO => {
|
|
7948
|
+
var d = dateUTC(dateISO);
|
|
7949
|
+
return new Date(Date.UTC(d.getUTCFullYear(), d.getUTCMonth() - 1, 1)).toISOString().slice(0, 10);
|
|
7782
7950
|
};
|
|
7783
|
-
|
|
7784
|
-
|
|
7785
|
-
|
|
7786
|
-
|
|
7787
|
-
|
|
7788
|
-
return
|
|
7951
|
+
/**
|
|
7952
|
+
* Get the next month date
|
|
7953
|
+
*/
|
|
7954
|
+
var getNextMonth = 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
|
-
|
|
7796
|
-
|
|
7797
|
-
|
|
7798
|
-
|
|
7799
|
-
|
|
7800
|
-
}
|
|
7801
|
-
var
|
|
7802
|
-
|
|
7803
|
-
var timeRange = format(event.startDate, 'p') + (event.endDate.getTime() !== event.startDate.getTime() ? " \u2013 " + format(event.endDate, 'p') : '');
|
|
7804
|
-
var eventCard = /*#__PURE__*/React.createElement(Vertical, Object.assign({
|
|
7805
|
-
gap: 6,
|
|
7806
|
-
padding: 12,
|
|
7807
|
-
borderRadius: 8,
|
|
7808
|
-
backgroundColor: context.isToday ? 'color.primary.50' : 'color.gray.100',
|
|
7809
|
-
borderWidth: 1,
|
|
7810
|
-
borderStyle: "solid",
|
|
7811
|
-
borderColor: context.isToday ? 'color.primary.200' : 'color.gray.200',
|
|
7812
|
-
flexShrink: 0,
|
|
7813
|
-
cursor: "pointer"
|
|
7814
|
-
}, views == null ? void 0 : views.event), /*#__PURE__*/React.createElement(Text, Object.assign({
|
|
7815
|
-
fontWeight: "600",
|
|
7816
|
-
fontSize: 14,
|
|
7817
|
-
maxLines: 2
|
|
7818
|
-
}, views == null ? void 0 : views.eventTitle), event.title), /*#__PURE__*/React.createElement(Text, Object.assign({
|
|
7819
|
-
fontSize: 12,
|
|
7820
|
-
color: "color.gray.600",
|
|
7821
|
-
maxLines: 1
|
|
7822
|
-
}, views == null ? void 0 : views.eventTime), timeRange), event.description && context.view !== 'month' && (/*#__PURE__*/React.createElement(Text, {
|
|
7823
|
-
fontSize: 12,
|
|
7824
|
-
color: "color.gray.700",
|
|
7825
|
-
maxLines: 2
|
|
7826
|
-
}, event.description)));
|
|
7827
|
-
return /*#__PURE__*/React.createElement(HoverCard, {
|
|
7828
|
-
key: key,
|
|
7829
|
-
openDelay: 100,
|
|
7830
|
-
closeDelay: 200
|
|
7831
|
-
}, /*#__PURE__*/React.createElement(HoverCard.Trigger, {
|
|
7832
|
-
asChild: true
|
|
7833
|
-
}, eventCard), /*#__PURE__*/React.createElement(HoverCard.Content, {
|
|
7834
|
-
side: "top",
|
|
7835
|
-
align: "start",
|
|
7836
|
-
maxWidth: "350px",
|
|
7837
|
-
backgroundColor: "color.white",
|
|
7838
|
-
padding: 16,
|
|
7839
|
-
boxShadow: "0px 4px 12px rgba(0, 0, 0, 0.15)"
|
|
7840
|
-
}, /*#__PURE__*/React.createElement(Vertical, {
|
|
7841
|
-
gap: 12
|
|
7842
|
-
}, /*#__PURE__*/React.createElement(Text, {
|
|
7843
|
-
fontWeight: "700",
|
|
7844
|
-
fontSize: 16,
|
|
7845
|
-
color: "color.gray.900"
|
|
7846
|
-
}, event.title), /*#__PURE__*/React.createElement(Vertical, {
|
|
7847
|
-
gap: 6
|
|
7848
|
-
}, /*#__PURE__*/React.createElement(Horizontal, {
|
|
7849
|
-
gap: 8,
|
|
7850
|
-
alignItems: "center"
|
|
7851
|
-
}, /*#__PURE__*/React.createElement(Text, {
|
|
7852
|
-
fontSize: 12,
|
|
7853
|
-
fontWeight: "600",
|
|
7854
|
-
color: "color.gray.600"
|
|
7855
|
-
}, "\uD83D\uDCC5"), /*#__PURE__*/React.createElement(Text, {
|
|
7856
|
-
fontSize: 13,
|
|
7857
|
-
color: "color.gray.700"
|
|
7858
|
-
}, format(event.startDate, 'EEEE, MMMM d, yyyy'))), /*#__PURE__*/React.createElement(Horizontal, {
|
|
7859
|
-
gap: 8,
|
|
7860
|
-
alignItems: "center"
|
|
7861
|
-
}, /*#__PURE__*/React.createElement(Text, {
|
|
7862
|
-
fontSize: 12,
|
|
7863
|
-
fontWeight: "600",
|
|
7864
|
-
color: "color.gray.600"
|
|
7865
|
-
}, "\uD83D\uDD50"), /*#__PURE__*/React.createElement(Text, {
|
|
7866
|
-
fontSize: 13,
|
|
7867
|
-
color: "color.gray.700"
|
|
7868
|
-
}, timeRange))), event.description && (/*#__PURE__*/React.createElement(Vertical, {
|
|
7869
|
-
gap: 4
|
|
7870
|
-
}, /*#__PURE__*/React.createElement(Text, {
|
|
7871
|
-
fontSize: 12,
|
|
7872
|
-
fontWeight: "600",
|
|
7873
|
-
color: "color.gray.600"
|
|
7874
|
-
}, "Description"), /*#__PURE__*/React.createElement(Text, {
|
|
7875
|
-
fontSize: 13,
|
|
7876
|
-
color: "color.gray.700"
|
|
7877
|
-
}, event.description))))));
|
|
7958
|
+
/**
|
|
7959
|
+
* Day names array (Sunday to Saturday)
|
|
7960
|
+
*/
|
|
7961
|
+
var DAY_NAMES = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'];
|
|
7962
|
+
/**
|
|
7963
|
+
* Get day names starting from specified day
|
|
7964
|
+
*/
|
|
7965
|
+
var getDayNames = function getDayNames(weekStartsOn) {
|
|
7966
|
+
if (weekStartsOn === void 0) {
|
|
7967
|
+
weekStartsOn = 0;
|
|
7968
|
+
}
|
|
7969
|
+
var names = [...DAY_NAMES];
|
|
7970
|
+
return [...names.slice(weekStartsOn), ...names.slice(0, weekStartsOn)];
|
|
7878
7971
|
};
|
|
7879
|
-
|
|
7880
|
-
|
|
7881
|
-
|
|
7882
|
-
|
|
7883
|
-
|
|
7884
|
-
|
|
7885
|
-
|
|
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
|
-
justifyContent: "space-between",
|
|
7931
|
-
alignItems: "center",
|
|
7932
|
-
maxWidth: '100%'
|
|
7933
|
-
}, /*#__PURE__*/React.createElement(Text, Object.assign({
|
|
7934
|
-
fontSize: 20,
|
|
7935
|
-
fontWeight: "700"
|
|
7936
|
-
}, views == null ? void 0 : views.headerTitle), label), /*#__PURE__*/React.createElement(Horizontal, Object.assign({
|
|
7937
|
-
gap: 8
|
|
7938
|
-
}, views == null ? void 0 : views.viewSwitcher), VIEW_OPTIONS.map(option => (/*#__PURE__*/React.createElement(Button, Object.assign({
|
|
7939
|
-
key: option.value,
|
|
7940
|
-
variant: view === option.value ? 'filled' : 'ghost',
|
|
7941
|
-
isDisabled: view === option.value,
|
|
7942
|
-
onClick: () => onViewChange(option.value)
|
|
7943
|
-
}, views == null ? void 0 : views.viewButton), option.label))))), /*#__PURE__*/React.createElement(Horizontal, Object.assign({
|
|
7944
|
-
gap: 8,
|
|
7945
|
-
alignItems: "center"
|
|
7946
|
-
}, views == null ? void 0 : views.navigation), /*#__PURE__*/React.createElement(Button, Object.assign({
|
|
7947
|
-
variant: "ghost",
|
|
7948
|
-
onClick: onPrevious
|
|
7949
|
-
}, views == null ? void 0 : views.navigationButton), "\u2190 Previous", ' ', view === 'day' ? 'Day' : view === 'week' ? 'Week' : 'Month'), /*#__PURE__*/React.createElement(Button, Object.assign({
|
|
7950
|
-
variant: "ghost",
|
|
7951
|
-
onClick: onToday
|
|
7952
|
-
}, views == null ? void 0 : views.navigationButton), "Today"), /*#__PURE__*/React.createElement(Button, Object.assign({
|
|
7953
|
-
variant: "ghost",
|
|
7954
|
-
onClick: onNext
|
|
7955
|
-
}, views == null ? void 0 : views.navigationButton), "Next ", view === 'day' ? 'Day' : view === 'week' ? 'Week' : 'Month', " \u2192"))), view !== 'day' && /*#__PURE__*/React.createElement(View, {
|
|
7956
|
-
flexShrink: 0
|
|
7957
|
-
}, weekdayRow), /*#__PURE__*/React.createElement(Vertical, Object.assign({
|
|
7958
|
-
gap: 12,
|
|
7959
|
-
flex: 1,
|
|
7960
|
-
overflow: "auto"
|
|
7961
|
-
}, views == null ? void 0 : views.grid), weeks.map((week, index) => (/*#__PURE__*/React.createElement(View, Object.assign({
|
|
7962
|
-
key: view + "-week-" + index,
|
|
7963
|
-
display: "grid",
|
|
7964
|
-
gridTemplateColumns: "repeat(" + week.length + ", 1fr)",
|
|
7965
|
-
gap: 12,
|
|
7966
|
-
height: view === 'month' ? '180px' : view === 'week' ? '100%' : 'auto',
|
|
7967
|
-
minHeight: view === 'week' ? '300px' : 'auto'
|
|
7968
|
-
}, views == null ? void 0 : views.weekRow), week.map(day => {
|
|
7969
|
-
var _eventsByDay$get;
|
|
7970
|
-
var dayKey = formatDayKey(day);
|
|
7971
|
-
var isToday = isSameDay(day, today);
|
|
7972
|
-
var events = (_eventsByDay$get = eventsByDay.get(dayKey)) != null ? _eventsByDay$get : [];
|
|
7973
|
-
var context = {
|
|
7974
|
-
day,
|
|
7975
|
-
isToday,
|
|
7976
|
-
view
|
|
7977
|
-
};
|
|
7978
|
-
var shouldDim = view === 'month' && !isSameMonth(day, currentDate);
|
|
7979
|
-
return /*#__PURE__*/React.createElement(Vertical, Object.assign({
|
|
7980
|
-
key: dayKey,
|
|
7981
|
-
gap: 12,
|
|
7982
|
-
padding: 16,
|
|
7983
|
-
borderWidth: 1,
|
|
7984
|
-
borderStyle: "solid",
|
|
7985
|
-
borderColor: isToday ? 'color.primary.200' : 'color.gray.200',
|
|
7986
|
-
borderRadius: 12,
|
|
7987
|
-
backgroundColor: "color.gray.50",
|
|
7988
|
-
opacity: shouldDim ? 0.6 : 1,
|
|
7989
|
-
display: "flex",
|
|
7990
|
-
flexDirection: "column",
|
|
7991
|
-
height: "100%",
|
|
7992
|
-
minHeight: view === 'month' ? '180px' : '300px'
|
|
7993
|
-
}, views == null ? void 0 : views.dayColumn), /*#__PURE__*/React.createElement(Horizontal, Object.assign({
|
|
7994
|
-
justifyContent: "space-between",
|
|
7995
|
-
alignItems: "center",
|
|
7996
|
-
flexShrink: 0
|
|
7997
|
-
}, views == null ? void 0 : views.dayHeader), /*#__PURE__*/React.createElement(Text, Object.assign({
|
|
7998
|
-
fontWeight: "600",
|
|
7999
|
-
fontSize: 16
|
|
8000
|
-
}, views == null ? void 0 : views.dayNumber), format(day, 'd')), view !== 'month' && (/*#__PURE__*/React.createElement(Text, Object.assign({
|
|
8001
|
-
fontSize: 14,
|
|
8002
|
-
color: "color.gray.600"
|
|
8003
|
-
}, views == null ? void 0 : views.dayMeta), format(day, 'EEEE')))), /*#__PURE__*/React.createElement(Vertical, Object.assign({
|
|
8004
|
-
gap: 8,
|
|
8005
|
-
flex: 1,
|
|
8006
|
-
overflow: "auto"
|
|
8007
|
-
}, views == null ? void 0 : views.events), events.length > 0 ? events.map(event => {
|
|
8008
|
-
var _event$id;
|
|
8009
|
-
var key = formatDayKey(day) + "-" + ((_event$id = event.id) != null ? _event$id : event.title) + "-" + event.startDate.getTime();
|
|
8010
|
-
if (renderEvent) {
|
|
8011
|
-
var rendered = renderEvent(event, context);
|
|
8012
|
-
if (/*#__PURE__*/isValidElement(rendered)) {
|
|
8013
|
-
return /*#__PURE__*/cloneElement(rendered, {
|
|
8014
|
-
key
|
|
8015
|
-
});
|
|
8016
|
-
}
|
|
8017
|
-
return /*#__PURE__*/React.createElement(React.Fragment, {
|
|
8018
|
-
key: key
|
|
8019
|
-
}, rendered);
|
|
7972
|
+
/**
|
|
7973
|
+
* Layout events with proper positioning to avoid overlaps
|
|
7974
|
+
* Returns positioned events for each week
|
|
7975
|
+
*/
|
|
7976
|
+
var layoutEvents = (events, calendarDates) => {
|
|
7977
|
+
var calendarStart = calendarDates[0];
|
|
7978
|
+
// Convert events to positioned items with day indices
|
|
7979
|
+
var items = events.map(ev => {
|
|
7980
|
+
var startIdx = daysBetweenUTC(ev.start, calendarStart);
|
|
7981
|
+
var endIdx = daysBetweenUTC(ev.end, calendarStart);
|
|
7982
|
+
// Clamp to calendar boundaries (0-41 for 6 weeks)
|
|
7983
|
+
var clampedStart = Math.max(0, Math.min(41, startIdx));
|
|
7984
|
+
var clampedEnd = Math.max(0, Math.min(41, endIdx));
|
|
7985
|
+
// Skip if completely outside calendar
|
|
7986
|
+
if (endIdx < 0 || startIdx > 41) return null;
|
|
7987
|
+
var duration = clampedEnd - clampedStart + 1;
|
|
7988
|
+
var weekIndex = Math.floor(clampedStart / 7);
|
|
7989
|
+
var dayOfWeek = clampedStart % 7;
|
|
7990
|
+
return Object.assign({}, ev, {
|
|
7991
|
+
startDay: clampedStart,
|
|
7992
|
+
endDay: clampedEnd,
|
|
7993
|
+
duration: duration,
|
|
7994
|
+
row: 0,
|
|
7995
|
+
weekIndex,
|
|
7996
|
+
dayOfWeek
|
|
7997
|
+
});
|
|
7998
|
+
}).filter(item => item !== null);
|
|
7999
|
+
// Sort by start day, then by duration (longer first)
|
|
8000
|
+
items.sort((a, b) => {
|
|
8001
|
+
if (a.startDay !== b.startDay) return a.startDay - b.startDay;
|
|
8002
|
+
return b.duration - a.duration;
|
|
8003
|
+
});
|
|
8004
|
+
// Assign rows per week using greedy algorithm to prevent overlaps
|
|
8005
|
+
var rowsByWeek = Array.from({
|
|
8006
|
+
length: 6
|
|
8007
|
+
}, () => []);
|
|
8008
|
+
var rowCountByWeek = Array.from({
|
|
8009
|
+
length: 6
|
|
8010
|
+
}, () => 0);
|
|
8011
|
+
items.forEach(item => {
|
|
8012
|
+
var weekIdx = item.weekIndex;
|
|
8013
|
+
var rows = rowsByWeek[weekIdx];
|
|
8014
|
+
var placed = false;
|
|
8015
|
+
for (var i = 0; i < rows.length; i++) {
|
|
8016
|
+
var row = rows[i];
|
|
8017
|
+
var hasConflict = row.some(existing => !(item.startDay > existing.endDay || item.endDay < existing.startDay));
|
|
8018
|
+
if (!hasConflict) {
|
|
8019
|
+
row.push(item);
|
|
8020
|
+
item.row = i;
|
|
8021
|
+
placed = true;
|
|
8022
|
+
break;
|
|
8020
8023
|
}
|
|
8021
|
-
|
|
8022
|
-
|
|
8023
|
-
|
|
8024
|
-
|
|
8025
|
-
|
|
8026
|
-
|
|
8027
|
-
})
|
|
8024
|
+
}
|
|
8025
|
+
if (!placed) {
|
|
8026
|
+
item.row = rows.length;
|
|
8027
|
+
rows.push([item]);
|
|
8028
|
+
}
|
|
8029
|
+
rowCountByWeek[weekIdx] = rows.length;
|
|
8030
|
+
});
|
|
8031
|
+
return {
|
|
8032
|
+
items,
|
|
8033
|
+
rowCountByWeek
|
|
8034
|
+
};
|
|
8035
|
+
};
|
|
8036
|
+
/**
|
|
8037
|
+
* Check if a date is in the current month
|
|
8038
|
+
*/
|
|
8039
|
+
var isInMonth = (dateISO, monthDateISO) => {
|
|
8040
|
+
return getMonth(dateISO) === getMonth(monthDateISO) && getYear(dateISO) === getYear(monthDateISO);
|
|
8028
8041
|
};
|
|
8029
8042
|
|
|
8030
|
-
|
|
8031
|
-
|
|
8032
|
-
|
|
8033
|
-
|
|
8034
|
-
|
|
8035
|
-
|
|
8036
|
-
|
|
8037
|
-
|
|
8038
|
-
|
|
8039
|
-
|
|
8040
|
-
|
|
8041
|
-
|
|
8042
|
-
|
|
8043
|
-
|
|
8044
|
-
|
|
8043
|
+
/**
|
|
8044
|
+
* Event color configurations
|
|
8045
|
+
*/
|
|
8046
|
+
var EVENT_COLORS = {
|
|
8047
|
+
blue: {
|
|
8048
|
+
background: 'color.blue.50',
|
|
8049
|
+
border: 'color.blue.500',
|
|
8050
|
+
text: 'color.blue.700'
|
|
8051
|
+
},
|
|
8052
|
+
red: {
|
|
8053
|
+
background: 'color.red.50',
|
|
8054
|
+
border: 'color.red.500',
|
|
8055
|
+
text: 'color.red.700'
|
|
8056
|
+
},
|
|
8057
|
+
green: {
|
|
8058
|
+
background: 'color.green.50',
|
|
8059
|
+
border: 'color.green.500',
|
|
8060
|
+
text: 'color.green.700'
|
|
8061
|
+
},
|
|
8062
|
+
purple: {
|
|
8063
|
+
background: 'color.purple.50',
|
|
8064
|
+
border: 'color.purple.500',
|
|
8065
|
+
text: 'color.purple.700'
|
|
8066
|
+
},
|
|
8067
|
+
orange: {
|
|
8068
|
+
background: 'color.orange.50',
|
|
8069
|
+
border: 'color.orange.500',
|
|
8070
|
+
text: 'color.orange.700'
|
|
8045
8071
|
}
|
|
8046
|
-
return format(date, 'MMMM yyyy');
|
|
8047
8072
|
};
|
|
8048
|
-
|
|
8049
|
-
|
|
8073
|
+
/**
|
|
8074
|
+
* Base styles for the calendar container
|
|
8075
|
+
*/
|
|
8076
|
+
var containerStyles = {
|
|
8077
|
+
width: '100%',
|
|
8078
|
+
maxWidth: 1200,
|
|
8079
|
+
border: '1px solid',
|
|
8080
|
+
borderColor: 'color.gray.200',
|
|
8081
|
+
borderRadius: 8,
|
|
8082
|
+
overflow: 'hidden',
|
|
8083
|
+
backgroundColor: 'color.white'
|
|
8084
|
+
};
|
|
8085
|
+
/**
|
|
8086
|
+
* Header styles (navigation bar)
|
|
8087
|
+
*/
|
|
8088
|
+
var headerStyles = {
|
|
8089
|
+
display: 'flex',
|
|
8090
|
+
alignItems: 'center',
|
|
8091
|
+
justifyContent: 'space-between',
|
|
8092
|
+
padding: 16,
|
|
8093
|
+
paddingLeft: 20,
|
|
8094
|
+
paddingRight: 20,
|
|
8095
|
+
borderBottom: '1px solid',
|
|
8096
|
+
borderColor: 'color.gray.200',
|
|
8097
|
+
backgroundColor: 'color.white'
|
|
8098
|
+
};
|
|
8099
|
+
/**
|
|
8100
|
+
* Month title styles
|
|
8101
|
+
*/
|
|
8102
|
+
var monthTitleStyles = {
|
|
8103
|
+
fontSize: 20,
|
|
8104
|
+
fontWeight: 500,
|
|
8105
|
+
color: 'color.gray.900'
|
|
8106
|
+
};
|
|
8107
|
+
/**
|
|
8108
|
+
* Month grid styles (7 columns for days)
|
|
8109
|
+
*/
|
|
8110
|
+
var monthGridStyles = {
|
|
8111
|
+
display: 'flex',
|
|
8112
|
+
flexDirection: 'column',
|
|
8113
|
+
backgroundColor: 'color.white'
|
|
8114
|
+
};
|
|
8115
|
+
/**
|
|
8116
|
+
* Weekday header row styles
|
|
8117
|
+
*/
|
|
8118
|
+
var weekdayHeaderStyles = {
|
|
8119
|
+
display: 'grid',
|
|
8120
|
+
gridTemplateColumns: 'repeat(7, 1fr)',
|
|
8121
|
+
borderBottom: '1px solid',
|
|
8122
|
+
borderColor: 'color.gray.200',
|
|
8123
|
+
backgroundColor: 'color.gray.50'
|
|
8124
|
+
};
|
|
8125
|
+
/**
|
|
8126
|
+
* Individual weekday label styles
|
|
8127
|
+
*/
|
|
8128
|
+
var weekdayLabelStyles = {
|
|
8129
|
+
padding: 8,
|
|
8130
|
+
textAlign: 'center',
|
|
8131
|
+
fontSize: 11,
|
|
8132
|
+
fontWeight: 500,
|
|
8133
|
+
color: 'color.gray.700',
|
|
8134
|
+
textTransform: 'uppercase',
|
|
8135
|
+
letterSpacing: 0.5
|
|
8136
|
+
};
|
|
8137
|
+
/**
|
|
8138
|
+
* Individual day cell styles
|
|
8139
|
+
*/
|
|
8140
|
+
var dayCellStyles = {
|
|
8141
|
+
border: '1px solid',
|
|
8142
|
+
borderColor: 'color.gray.100',
|
|
8143
|
+
minHeight: 120,
|
|
8144
|
+
padding: 4,
|
|
8145
|
+
paddingTop: 2,
|
|
8146
|
+
backgroundColor: 'color.white',
|
|
8147
|
+
position: 'relative',
|
|
8148
|
+
display: 'flex',
|
|
8149
|
+
flexDirection: 'column'
|
|
8150
|
+
};
|
|
8151
|
+
/**
|
|
8152
|
+
* Day date styles (the circular number)
|
|
8153
|
+
*/
|
|
8154
|
+
var dayDateStyles = {
|
|
8155
|
+
width: 36,
|
|
8156
|
+
height: 36,
|
|
8157
|
+
display: 'flex',
|
|
8158
|
+
alignItems: 'center',
|
|
8159
|
+
justifyContent: 'center',
|
|
8160
|
+
borderRadius: '50%',
|
|
8161
|
+
fontSize: 13,
|
|
8162
|
+
fontWeight: 400,
|
|
8163
|
+
color: 'color.gray.900',
|
|
8164
|
+
cursor: 'pointer',
|
|
8165
|
+
transition: 'all 0.2s',
|
|
8166
|
+
border: '2px solid transparent'
|
|
8167
|
+
};
|
|
8168
|
+
/**
|
|
8169
|
+
* Day cell from different month
|
|
8170
|
+
*/
|
|
8171
|
+
var otherMonthDayCellStyles = {
|
|
8172
|
+
backgroundColor: 'color.gray.50',
|
|
8173
|
+
opacity: 0.5
|
|
8174
|
+
};
|
|
8175
|
+
/**
|
|
8176
|
+
* Day number styles
|
|
8177
|
+
*/
|
|
8178
|
+
var dayNumberStyles = {
|
|
8179
|
+
fontSize: 14,
|
|
8180
|
+
fontWeight: 400,
|
|
8181
|
+
color: 'color.gray.900',
|
|
8182
|
+
marginBottom: 4,
|
|
8183
|
+
padding: 4,
|
|
8184
|
+
paddingLeft: 8,
|
|
8185
|
+
paddingRight: 8,
|
|
8186
|
+
borderRadius: 4,
|
|
8187
|
+
alignSelf: 'flex-start'
|
|
8188
|
+
};
|
|
8189
|
+
/**
|
|
8190
|
+
* Today day number styles
|
|
8191
|
+
*/
|
|
8192
|
+
var todayDayNumberStyles = {
|
|
8193
|
+
backgroundColor: 'color.blue.500',
|
|
8194
|
+
color: 'color.white',
|
|
8195
|
+
fontWeight: 500
|
|
8196
|
+
};
|
|
8197
|
+
/**
|
|
8198
|
+
* Selected day number styles
|
|
8199
|
+
*/
|
|
8200
|
+
var selectedDayNumberStyles = {
|
|
8201
|
+
backgroundColor: 'color.blue.50',
|
|
8202
|
+
color: 'color.blue.700',
|
|
8203
|
+
fontWeight: 500
|
|
8204
|
+
};
|
|
8205
|
+
/**
|
|
8206
|
+
* Events area styles (container for events in a day)
|
|
8207
|
+
*/
|
|
8208
|
+
var eventsAreaStyles = {
|
|
8209
|
+
display: 'flex',
|
|
8210
|
+
flexDirection: 'column',
|
|
8211
|
+
gap: 2,
|
|
8212
|
+
flex: 1,
|
|
8213
|
+
position: 'relative'
|
|
8214
|
+
};
|
|
8215
|
+
/**
|
|
8216
|
+
* Base event styles
|
|
8217
|
+
*/
|
|
8218
|
+
var eventStyles = {
|
|
8219
|
+
height: 20,
|
|
8220
|
+
display: 'flex',
|
|
8221
|
+
alignItems: 'center',
|
|
8222
|
+
padding: 4,
|
|
8223
|
+
paddingLeft: 6,
|
|
8224
|
+
paddingRight: 6,
|
|
8225
|
+
borderRadius: 3,
|
|
8226
|
+
borderLeft: '3px solid',
|
|
8227
|
+
fontSize: 11,
|
|
8228
|
+
fontWeight: 500,
|
|
8229
|
+
overflow: 'hidden',
|
|
8230
|
+
cursor: 'grab',
|
|
8231
|
+
transition: 'box-shadow 0.2s',
|
|
8232
|
+
userSelect: 'none',
|
|
8233
|
+
marginBottom: 2
|
|
8234
|
+
};
|
|
8235
|
+
/**
|
|
8236
|
+
* Drop target indicator styles
|
|
8237
|
+
*/
|
|
8238
|
+
var dropTargetStyles = {
|
|
8239
|
+
backgroundColor: 'rgba(26, 115, 232, 0.08)',
|
|
8240
|
+
boxShadow: 'inset 0 0 0 2px rgba(26, 115, 232, 0.3)'
|
|
8241
|
+
};
|
|
8242
|
+
/**
|
|
8243
|
+
* Button base styles
|
|
8244
|
+
*/
|
|
8245
|
+
var buttonStyles = {
|
|
8246
|
+
padding: 8,
|
|
8247
|
+
paddingLeft: 12,
|
|
8248
|
+
paddingRight: 12,
|
|
8249
|
+
borderRadius: 4,
|
|
8250
|
+
fontSize: 14,
|
|
8251
|
+
fontWeight: 500,
|
|
8252
|
+
cursor: 'pointer',
|
|
8253
|
+
border: '1px solid',
|
|
8254
|
+
borderColor: 'color.gray.300',
|
|
8255
|
+
backgroundColor: 'color.white',
|
|
8256
|
+
color: 'color.gray.700',
|
|
8257
|
+
transition: 'all 0.2s'
|
|
8258
|
+
};
|
|
8259
|
+
/**
|
|
8260
|
+
* Icon button styles
|
|
8261
|
+
*/
|
|
8262
|
+
var iconButtonStyles = {
|
|
8263
|
+
width: 36,
|
|
8264
|
+
height: 36,
|
|
8265
|
+
display: 'flex',
|
|
8266
|
+
alignItems: 'center',
|
|
8267
|
+
justifyContent: 'center',
|
|
8268
|
+
borderRadius: '50%',
|
|
8269
|
+
cursor: 'pointer',
|
|
8270
|
+
backgroundColor: 'transparent',
|
|
8271
|
+
color: 'color.gray.700',
|
|
8272
|
+
transition: 'all 0.2s',
|
|
8273
|
+
border: 'none'
|
|
8274
|
+
};
|
|
8275
|
+
|
|
8276
|
+
var ResizeHandle = _ref => {
|
|
8050
8277
|
var {
|
|
8051
|
-
|
|
8052
|
-
|
|
8278
|
+
direction,
|
|
8279
|
+
onMouseDown
|
|
8280
|
+
} = _ref;
|
|
8281
|
+
var [isHovered, setIsHovered] = useState(false);
|
|
8282
|
+
return /*#__PURE__*/React.createElement(View, Object.assign({
|
|
8283
|
+
position: "absolute",
|
|
8284
|
+
top: 0,
|
|
8285
|
+
bottom: 0,
|
|
8286
|
+
width: 8,
|
|
8287
|
+
opacity: isHovered ? 1 : 0,
|
|
8288
|
+
transition: "opacity 0.2s",
|
|
8289
|
+
cursor: direction === 'left' ? 'w-resize' : 'e-resize',
|
|
8290
|
+
zIndex: 10,
|
|
8291
|
+
backgroundColor: isHovered ? 'rgba(0,0,0,0.1)' : 'transparent'
|
|
8292
|
+
}, direction === 'left' ? {
|
|
8293
|
+
left: 0
|
|
8294
|
+
} : {
|
|
8295
|
+
right: 0
|
|
8296
|
+
}, {
|
|
8297
|
+
onMouseDown: onMouseDown,
|
|
8298
|
+
onMouseEnter: () => setIsHovered(true),
|
|
8299
|
+
onMouseLeave: () => setIsHovered(false)
|
|
8300
|
+
}));
|
|
8301
|
+
};
|
|
8302
|
+
var MONTH_EVENT_ROW_HEIGHT = 22;
|
|
8303
|
+
var MONTH_EVENT_ROW_GAP = 4;
|
|
8304
|
+
var MONTH_EVENT_TOP_OFFSET = 32;
|
|
8305
|
+
var Calendar = _ref2 => {
|
|
8306
|
+
var {
|
|
8307
|
+
initialDate = new Date(),
|
|
8053
8308
|
initialView = 'month',
|
|
8054
|
-
|
|
8055
|
-
|
|
8056
|
-
|
|
8309
|
+
events = [],
|
|
8310
|
+
today = new Date().toISOString().slice(0, 10),
|
|
8311
|
+
onEventDrop,
|
|
8312
|
+
onEventResize,
|
|
8313
|
+
onDateClick,
|
|
8057
8314
|
onDateChange,
|
|
8058
8315
|
onViewChange,
|
|
8059
|
-
|
|
8060
|
-
|
|
8061
|
-
|
|
8062
|
-
|
|
8063
|
-
|
|
8064
|
-
|
|
8065
|
-
|
|
8066
|
-
|
|
8067
|
-
|
|
8068
|
-
|
|
8069
|
-
|
|
8070
|
-
|
|
8071
|
-
|
|
8072
|
-
|
|
8073
|
-
var
|
|
8074
|
-
|
|
8075
|
-
|
|
8076
|
-
|
|
8077
|
-
|
|
8078
|
-
|
|
8079
|
-
|
|
8080
|
-
|
|
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
|
-
|
|
8316
|
+
onEventAdd,
|
|
8317
|
+
views = {},
|
|
8318
|
+
width = '100%',
|
|
8319
|
+
maxWidth = 1200,
|
|
8320
|
+
weekStartsOn = 0
|
|
8321
|
+
} = _ref2;
|
|
8322
|
+
var {
|
|
8323
|
+
getColor
|
|
8324
|
+
} = useTheme();
|
|
8325
|
+
var gridRef = useRef(null);
|
|
8326
|
+
// Convert initialDate to ISO string if it's a Date object
|
|
8327
|
+
var initialDateISO = typeof initialDate === 'string' ? initialDate : initialDate.toISOString().slice(0, 10);
|
|
8328
|
+
var [currentDate, setCurrentDate] = useState(initialDateISO);
|
|
8329
|
+
var [currentView, setCurrentView] = useState(initialView);
|
|
8330
|
+
var [selectedDate, setSelectedDate] = useState(null);
|
|
8331
|
+
var [localEvents, setLocalEvents] = useState(events);
|
|
8332
|
+
var [dropTargetDays, setDropTargetDays] = useState([]);
|
|
8333
|
+
var dragStateRef = useRef({
|
|
8334
|
+
isDragging: false,
|
|
8335
|
+
isResizing: false,
|
|
8336
|
+
resizeDirection: null,
|
|
8337
|
+
event: null,
|
|
8338
|
+
startX: 0,
|
|
8339
|
+
startDay: 0,
|
|
8340
|
+
startDuration: 0,
|
|
8341
|
+
originalStart: null,
|
|
8342
|
+
originalEnd: null
|
|
8343
|
+
});
|
|
8344
|
+
// Update local events when props change
|
|
8345
|
+
React.useEffect(() => {
|
|
8346
|
+
setLocalEvents(events);
|
|
8347
|
+
}, [events]);
|
|
8348
|
+
// Get the month start for current date
|
|
8349
|
+
var currentMonth = useMemo(() => getFirstDayOfMonth(currentDate), [currentDate]);
|
|
8350
|
+
// Generate calendar dates based on view
|
|
8351
|
+
var calendarDates = useMemo(() => {
|
|
8352
|
+
if (currentView === 'month') {
|
|
8353
|
+
return getCalendarDates(currentMonth, weekStartsOn);
|
|
8354
|
+
} else if (currentView === 'week') {
|
|
8355
|
+
// Get week starting from current date
|
|
8356
|
+
var dayOfWeek = getDayOfWeek(currentDate);
|
|
8357
|
+
var weekStart = addDateDays(currentDate, -((dayOfWeek - weekStartsOn + 7) % 7));
|
|
8358
|
+
var dates = [];
|
|
8359
|
+
for (var i = 0; i < 7; i++) {
|
|
8360
|
+
dates.push(addDateDays(weekStart, i));
|
|
8361
|
+
}
|
|
8362
|
+
return dates;
|
|
8363
|
+
} else {
|
|
8364
|
+
// Day view - just current date
|
|
8107
8365
|
return [currentDate];
|
|
8108
8366
|
}
|
|
8109
|
-
|
|
8110
|
-
|
|
8111
|
-
|
|
8367
|
+
}, [currentDate, currentView, currentMonth, weekStartsOn]);
|
|
8368
|
+
var monthWeeks = useMemo(() => {
|
|
8369
|
+
var chunks = [];
|
|
8370
|
+
for (var i = 0; i < calendarDates.length; i += 7) {
|
|
8371
|
+
chunks.push(calendarDates.slice(i, i + 7));
|
|
8372
|
+
}
|
|
8373
|
+
return chunks;
|
|
8374
|
+
}, [calendarDates]);
|
|
8375
|
+
// Layout events
|
|
8376
|
+
var {
|
|
8377
|
+
items: positionedEvents
|
|
8378
|
+
} = useMemo(() => layoutEvents(localEvents, calendarDates), [localEvents, calendarDates]);
|
|
8379
|
+
var monthWeeksWithEvents = useMemo(() => {
|
|
8380
|
+
return monthWeeks.map((dates, weekIndex) => {
|
|
8381
|
+
var weekStartIdx = weekIndex * 7;
|
|
8382
|
+
var weekEndIdx = weekStartIdx + dates.length - 1;
|
|
8383
|
+
var segments = positionedEvents.filter(event => !(event.startDay > weekEndIdx || event.endDay < weekStartIdx)).map(event => {
|
|
8384
|
+
var segmentStart = Math.max(event.startDay, weekStartIdx);
|
|
8385
|
+
var segmentEnd = Math.min(event.endDay, weekEndIdx);
|
|
8386
|
+
return Object.assign({}, event, {
|
|
8387
|
+
weekIndex,
|
|
8388
|
+
segmentStartDay: segmentStart - weekStartIdx,
|
|
8389
|
+
segmentEndDay: segmentEnd - weekStartIdx,
|
|
8390
|
+
segmentDuration: segmentEnd - segmentStart + 1,
|
|
8391
|
+
segmentRow: 0
|
|
8392
|
+
});
|
|
8112
8393
|
});
|
|
8113
|
-
|
|
8114
|
-
|
|
8115
|
-
|
|
8116
|
-
|
|
8117
|
-
|
|
8118
|
-
|
|
8119
|
-
|
|
8120
|
-
|
|
8121
|
-
|
|
8122
|
-
|
|
8123
|
-
|
|
8124
|
-
|
|
8125
|
-
|
|
8126
|
-
|
|
8127
|
-
|
|
8394
|
+
segments.sort((a, b) => {
|
|
8395
|
+
if (a.segmentStartDay !== b.segmentStartDay) {
|
|
8396
|
+
return a.segmentStartDay - b.segmentStartDay;
|
|
8397
|
+
}
|
|
8398
|
+
return b.segmentDuration - a.segmentDuration;
|
|
8399
|
+
});
|
|
8400
|
+
var rows = [];
|
|
8401
|
+
segments.forEach(segment => {
|
|
8402
|
+
var placed = false;
|
|
8403
|
+
for (var rowIdx = 0; rowIdx < rows.length; rowIdx++) {
|
|
8404
|
+
var row = rows[rowIdx];
|
|
8405
|
+
var conflict = row.some(existing => !(segment.segmentStartDay > existing.segmentEndDay || segment.segmentEndDay < existing.segmentStartDay));
|
|
8406
|
+
if (!conflict) {
|
|
8407
|
+
segment.segmentRow = rowIdx;
|
|
8408
|
+
row.push(segment);
|
|
8409
|
+
placed = true;
|
|
8410
|
+
break;
|
|
8411
|
+
}
|
|
8412
|
+
}
|
|
8413
|
+
if (!placed) {
|
|
8414
|
+
segment.segmentRow = rows.length;
|
|
8415
|
+
rows.push([segment]);
|
|
8416
|
+
}
|
|
8417
|
+
});
|
|
8418
|
+
return {
|
|
8419
|
+
weekIndex,
|
|
8420
|
+
dates,
|
|
8421
|
+
segments,
|
|
8422
|
+
rowCount: rows.length
|
|
8423
|
+
};
|
|
8128
8424
|
});
|
|
8129
|
-
}, [
|
|
8130
|
-
|
|
8131
|
-
|
|
8132
|
-
|
|
8133
|
-
|
|
8134
|
-
|
|
8135
|
-
|
|
8136
|
-
|
|
8137
|
-
|
|
8138
|
-
|
|
8139
|
-
|
|
8140
|
-
|
|
8425
|
+
}, [monthWeeks, positionedEvents]);
|
|
8426
|
+
// Get day names
|
|
8427
|
+
var dayNames = useMemo(() => getDayNames(weekStartsOn), [weekStartsOn]);
|
|
8428
|
+
// Handle navigation
|
|
8429
|
+
var handlePrevious = useCallback(() => {
|
|
8430
|
+
var newDate;
|
|
8431
|
+
if (currentView === 'month') {
|
|
8432
|
+
newDate = getPreviousMonth(currentDate);
|
|
8433
|
+
} else if (currentView === 'week') {
|
|
8434
|
+
newDate = addDateDays(currentDate, -7);
|
|
8435
|
+
} else {
|
|
8436
|
+
newDate = addDateDays(currentDate, -1);
|
|
8437
|
+
}
|
|
8438
|
+
setCurrentDate(newDate);
|
|
8439
|
+
onDateChange == null || onDateChange(new Date(newDate + 'T00:00:00Z'));
|
|
8440
|
+
}, [currentDate, currentView, onDateChange]);
|
|
8441
|
+
var handleNext = useCallback(() => {
|
|
8442
|
+
var newDate;
|
|
8443
|
+
if (currentView === 'month') {
|
|
8444
|
+
newDate = getNextMonth(currentDate);
|
|
8445
|
+
} else if (currentView === 'week') {
|
|
8446
|
+
newDate = addDateDays(currentDate, 7);
|
|
8447
|
+
} else {
|
|
8448
|
+
newDate = addDateDays(currentDate, 1);
|
|
8449
|
+
}
|
|
8450
|
+
setCurrentDate(newDate);
|
|
8451
|
+
onDateChange == null || onDateChange(new Date(newDate + 'T00:00:00Z'));
|
|
8452
|
+
}, [currentDate, currentView, onDateChange]);
|
|
8453
|
+
var handleToday = useCallback(() => {
|
|
8454
|
+
setCurrentDate(today);
|
|
8455
|
+
onDateChange == null || onDateChange(new Date(today + 'T00:00:00Z'));
|
|
8456
|
+
}, [today, onDateChange]);
|
|
8457
|
+
// Handle view change
|
|
8458
|
+
var handleViewChange = useCallback(view => {
|
|
8459
|
+
setCurrentView(view);
|
|
8460
|
+
onViewChange == null || onViewChange(view);
|
|
8461
|
+
}, [onViewChange]);
|
|
8462
|
+
// Handle date click
|
|
8463
|
+
var handleDateClick = useCallback(dateISO => {
|
|
8464
|
+
setSelectedDate(dateISO);
|
|
8465
|
+
onDateClick == null || onDateClick(dateISO);
|
|
8466
|
+
}, [onDateClick]);
|
|
8467
|
+
// Handle double-click to add event
|
|
8468
|
+
var handleDateDoubleClick = useCallback((dateISO, hour) => {
|
|
8469
|
+
if (onEventAdd) {
|
|
8470
|
+
var start;
|
|
8471
|
+
var end;
|
|
8472
|
+
if (hour !== undefined) {
|
|
8473
|
+
// Day view with time
|
|
8474
|
+
var hourStr = hour.toString().padStart(2, '0');
|
|
8475
|
+
start = dateISO + "T" + hourStr + ":00";
|
|
8476
|
+
end = dateISO + "T" + (hour + 1).toString().padStart(2, '0') + ":00";
|
|
8477
|
+
} else {
|
|
8478
|
+
// Month/week view
|
|
8479
|
+
start = dateISO;
|
|
8480
|
+
end = dateISO;
|
|
8481
|
+
}
|
|
8482
|
+
onEventAdd(start, end);
|
|
8483
|
+
}
|
|
8484
|
+
}, [onEventAdd]);
|
|
8485
|
+
// Handle mouse down on event (start dragging)
|
|
8486
|
+
var handleEventMouseDown = useCallback((e, event) => {
|
|
8487
|
+
e.preventDefault();
|
|
8488
|
+
dragStateRef.current = {
|
|
8489
|
+
isDragging: true,
|
|
8490
|
+
isResizing: false,
|
|
8491
|
+
resizeDirection: null,
|
|
8492
|
+
event,
|
|
8493
|
+
startX: e.clientX,
|
|
8494
|
+
startDay: event.startDay,
|
|
8495
|
+
startDuration: event.duration,
|
|
8496
|
+
originalStart: event.start,
|
|
8497
|
+
originalEnd: event.end
|
|
8498
|
+
};
|
|
8499
|
+
}, []);
|
|
8500
|
+
// Handle resize start
|
|
8501
|
+
var handleResizeStart = useCallback((e, event, direction) => {
|
|
8502
|
+
e.preventDefault();
|
|
8503
|
+
e.stopPropagation();
|
|
8504
|
+
dragStateRef.current = {
|
|
8505
|
+
isDragging: false,
|
|
8506
|
+
isResizing: true,
|
|
8507
|
+
resizeDirection: direction,
|
|
8508
|
+
event,
|
|
8509
|
+
startX: e.clientX,
|
|
8510
|
+
startDay: event.startDay,
|
|
8511
|
+
startDuration: event.duration,
|
|
8512
|
+
originalStart: event.start,
|
|
8513
|
+
originalEnd: event.end
|
|
8514
|
+
};
|
|
8515
|
+
}, []);
|
|
8516
|
+
// Handle mouse move during resize or drag
|
|
8517
|
+
var handleMouseMove = useCallback(e => {
|
|
8518
|
+
var dragState = dragStateRef.current;
|
|
8519
|
+
if (!dragState.event || !dragState.isDragging && !dragState.isResizing) return;
|
|
8520
|
+
if (!gridRef.current) return;
|
|
8521
|
+
var rect = gridRef.current.getBoundingClientRect();
|
|
8522
|
+
var deltaX = e.clientX - dragState.startX;
|
|
8523
|
+
// Calculate day delta based on pixel movement
|
|
8524
|
+
var daysDelta;
|
|
8525
|
+
if (currentView === 'month') {
|
|
8526
|
+
var dayWidth = rect.width / 7;
|
|
8527
|
+
daysDelta = Math.round(deltaX / dayWidth);
|
|
8528
|
+
} else if (currentView === 'week') {
|
|
8529
|
+
var _dayWidth = rect.width / 7;
|
|
8530
|
+
daysDelta = Math.round(deltaX / _dayWidth);
|
|
8531
|
+
} else {
|
|
8532
|
+
// Day view - no horizontal resize
|
|
8533
|
+
return;
|
|
8534
|
+
}
|
|
8535
|
+
if (dragState.isDragging) {
|
|
8536
|
+
// Dragging - move the event
|
|
8537
|
+
var maxDays = calendarDates.length - 1;
|
|
8538
|
+
var newStartDay = Math.max(0, Math.min(maxDays, dragState.startDay + daysDelta));
|
|
8539
|
+
var duration = dragState.event.duration;
|
|
8540
|
+
var newEndDay = Math.min(maxDays, newStartDay + duration - 1);
|
|
8541
|
+
// Update drop target indicators
|
|
8542
|
+
var targetDays = [];
|
|
8543
|
+
for (var i = newStartDay; i <= newEndDay; i++) {
|
|
8544
|
+
targetDays.push(i);
|
|
8545
|
+
}
|
|
8546
|
+
setDropTargetDays(targetDays);
|
|
8547
|
+
// Update event position immediately for smooth dragging
|
|
8548
|
+
var updatedEvents = localEvents.map(ev => ev.id === dragState.event.id ? Object.assign({}, ev, {
|
|
8549
|
+
start: addDateDays(dragState.originalStart, newStartDay - dragState.startDay),
|
|
8550
|
+
end: addDateDays(dragState.originalEnd, newStartDay - dragState.startDay)
|
|
8551
|
+
}) : ev);
|
|
8552
|
+
setLocalEvents(updatedEvents);
|
|
8553
|
+
} else if (dragState.isResizing) {
|
|
8554
|
+
// Resizing
|
|
8555
|
+
if (dragState.resizeDirection === 'right') {
|
|
8556
|
+
// Resize from right
|
|
8557
|
+
var newDuration = Math.max(1, dragState.startDuration + daysDelta);
|
|
8558
|
+
var _maxDays = calendarDates.length - 1;
|
|
8559
|
+
var _newEndDay = Math.min(_maxDays, dragState.startDay + newDuration - 1);
|
|
8560
|
+
var actualDuration = _newEndDay - dragState.startDay + 1;
|
|
8561
|
+
var _updatedEvents = localEvents.map(ev => ev.id === dragState.event.id ? Object.assign({}, ev, {
|
|
8562
|
+
end: addDateDays(dragState.originalStart, actualDuration - 1)
|
|
8563
|
+
}) : ev);
|
|
8564
|
+
setLocalEvents(_updatedEvents);
|
|
8565
|
+
} else if (dragState.resizeDirection === 'left') {
|
|
8566
|
+
// Resize from left
|
|
8567
|
+
var _newStartDay = Math.max(0, Math.min(dragState.startDay + dragState.startDuration - 1, dragState.startDay + daysDelta));
|
|
8568
|
+
var _updatedEvents2 = localEvents.map(ev => ev.id === dragState.event.id ? Object.assign({}, ev, {
|
|
8569
|
+
start: addDateDays(dragState.originalStart, _newStartDay - dragState.startDay)
|
|
8570
|
+
}) : ev);
|
|
8571
|
+
setLocalEvents(_updatedEvents2);
|
|
8572
|
+
}
|
|
8573
|
+
}
|
|
8574
|
+
}, [localEvents, calendarDates, currentView]);
|
|
8575
|
+
// Handle mouse up - finish resize/drag
|
|
8576
|
+
var handleMouseUp = useCallback(e => {
|
|
8577
|
+
var dragState = dragStateRef.current;
|
|
8578
|
+
if (!dragState.event || !dragState.isDragging && !dragState.isResizing) return;
|
|
8579
|
+
setDropTargetDays([]);
|
|
8580
|
+
// Find the updated event
|
|
8581
|
+
var updatedEvent = localEvents.find(ev => ev.id === dragState.event.id);
|
|
8582
|
+
if (!updatedEvent) return;
|
|
8583
|
+
// Call appropriate callback
|
|
8584
|
+
if (dragState.isDragging) {
|
|
8585
|
+
onEventDrop == null || onEventDrop(updatedEvent);
|
|
8586
|
+
} else if (dragState.isResizing) {
|
|
8587
|
+
onEventResize == null || onEventResize(updatedEvent);
|
|
8588
|
+
}
|
|
8589
|
+
// Reset drag state
|
|
8590
|
+
dragStateRef.current = {
|
|
8591
|
+
isDragging: false,
|
|
8592
|
+
isResizing: false,
|
|
8593
|
+
resizeDirection: null,
|
|
8594
|
+
event: null,
|
|
8595
|
+
startX: 0,
|
|
8596
|
+
startDay: 0,
|
|
8597
|
+
startDuration: 0,
|
|
8598
|
+
originalStart: null,
|
|
8599
|
+
originalEnd: null
|
|
8600
|
+
};
|
|
8601
|
+
}, [localEvents, onEventDrop, onEventResize]);
|
|
8602
|
+
// Set up global mouse event listeners
|
|
8603
|
+
React.useEffect(() => {
|
|
8604
|
+
document.addEventListener('mousemove', handleMouseMove);
|
|
8605
|
+
document.addEventListener('mouseup', handleMouseUp);
|
|
8606
|
+
return () => {
|
|
8607
|
+
document.removeEventListener('mousemove', handleMouseMove);
|
|
8608
|
+
document.removeEventListener('mouseup', handleMouseUp);
|
|
8609
|
+
};
|
|
8610
|
+
}, [handleMouseMove, handleMouseUp]);
|
|
8611
|
+
// Group events by date for rendering
|
|
8612
|
+
var eventsByDate = useMemo(() => {
|
|
8613
|
+
var grouped = {};
|
|
8614
|
+
calendarDates.forEach(date => {
|
|
8615
|
+
grouped[date] = [];
|
|
8141
8616
|
});
|
|
8142
|
-
|
|
8143
|
-
|
|
8144
|
-
|
|
8145
|
-
|
|
8146
|
-
|
|
8617
|
+
positionedEvents.forEach(event => {
|
|
8618
|
+
// For multi-day events, show on each day it spans
|
|
8619
|
+
var startIdx = event.startDay;
|
|
8620
|
+
var endIdx = event.endDay;
|
|
8621
|
+
for (var i = startIdx; i <= endIdx && i < calendarDates.length; i++) {
|
|
8622
|
+
var date = calendarDates[i];
|
|
8623
|
+
if (date && grouped[date]) {
|
|
8624
|
+
var isFirstDay = i === startIdx;
|
|
8625
|
+
grouped[date].push(Object.assign({}, event, {
|
|
8626
|
+
isFirstDay
|
|
8627
|
+
}));
|
|
8628
|
+
}
|
|
8629
|
+
}
|
|
8147
8630
|
});
|
|
8148
|
-
return
|
|
8149
|
-
|
|
8150
|
-
|
|
8151
|
-
},
|
|
8152
|
-
|
|
8153
|
-
|
|
8154
|
-
|
|
8155
|
-
|
|
8156
|
-
|
|
8157
|
-
|
|
8158
|
-
|
|
8159
|
-
|
|
8160
|
-
|
|
8161
|
-
|
|
8162
|
-
|
|
8163
|
-
|
|
8164
|
-
|
|
8165
|
-
|
|
8166
|
-
|
|
8167
|
-
|
|
8631
|
+
return grouped;
|
|
8632
|
+
}, [positionedEvents, calendarDates]);
|
|
8633
|
+
// Render month view
|
|
8634
|
+
var renderMonthView = () => (/*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(View, Object.assign({}, weekdayHeaderStyles, views.weekdayHeader), dayNames.map((dayName, index) => (/*#__PURE__*/React.createElement(View, Object.assign({
|
|
8635
|
+
key: index
|
|
8636
|
+
}, weekdayLabelStyles, views.weekdayLabel), dayName)))), /*#__PURE__*/React.createElement(View, Object.assign({
|
|
8637
|
+
ref: gridRef
|
|
8638
|
+
}, monthGridStyles, views.monthGrid), monthWeeksWithEvents.map(week => {
|
|
8639
|
+
var weekStartIdx = week.weekIndex * 7;
|
|
8640
|
+
var weekEndIdx = weekStartIdx + week.dates.length - 1;
|
|
8641
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
8642
|
+
key: "week-" + week.weekIndex,
|
|
8643
|
+
position: "relative"
|
|
8644
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
8645
|
+
display: "grid",
|
|
8646
|
+
gridTemplateColumns: "repeat(7, 1fr)"
|
|
8647
|
+
}, week.dates.map((dateISO, dayOffset) => {
|
|
8648
|
+
var dateNum = getDateNumber(dateISO);
|
|
8649
|
+
var isToday = dateISO === today;
|
|
8650
|
+
var isSelected = dateISO === selectedDate;
|
|
8651
|
+
var isCurrentMonth = isInMonth(dateISO, currentMonth);
|
|
8652
|
+
var dayIndex = weekStartIdx + dayOffset;
|
|
8653
|
+
var isDropTarget = dropTargetDays.includes(dayIndex);
|
|
8654
|
+
return /*#__PURE__*/React.createElement(View, Object.assign({
|
|
8655
|
+
key: dateISO,
|
|
8656
|
+
"data-date": dateISO
|
|
8657
|
+
}, dayCellStyles, !isCurrentMonth && otherMonthDayCellStyles, isDropTarget && dropTargetStyles, {
|
|
8658
|
+
onClick: () => handleDateClick(dateISO),
|
|
8659
|
+
onDoubleClick: () => handleDateDoubleClick(dateISO)
|
|
8660
|
+
}, views.dayCell), /*#__PURE__*/React.createElement(View, Object.assign({}, dayNumberStyles, isToday && todayDayNumberStyles, isSelected && !isToday && selectedDayNumberStyles, {
|
|
8661
|
+
style: {
|
|
8662
|
+
cursor: 'pointer'
|
|
8663
|
+
}
|
|
8664
|
+
}, views.dayNumber), dateNum));
|
|
8665
|
+
})), week.segments.length > 0 && (/*#__PURE__*/React.createElement(View, {
|
|
8666
|
+
position: "absolute",
|
|
8667
|
+
left: 0,
|
|
8668
|
+
right: 0,
|
|
8669
|
+
top: MONTH_EVENT_TOP_OFFSET,
|
|
8670
|
+
pointerEvents: "none"
|
|
8671
|
+
}, week.segments.map(event => {
|
|
8672
|
+
var _dragStateRef$current, _dragStateRef$current2;
|
|
8673
|
+
var colorConfig = EVENT_COLORS[event.color || 'blue'];
|
|
8674
|
+
var dayWidth = 100 / week.dates.length;
|
|
8675
|
+
var left = event.segmentStartDay * dayWidth;
|
|
8676
|
+
var width = event.segmentDuration * dayWidth;
|
|
8677
|
+
var isDragging = dragStateRef.current.isDragging && ((_dragStateRef$current = dragStateRef.current.event) == null ? void 0 : _dragStateRef$current.id) === event.id;
|
|
8678
|
+
var isResizing = dragStateRef.current.isResizing && ((_dragStateRef$current2 = dragStateRef.current.event) == null ? void 0 : _dragStateRef$current2.id) === event.id;
|
|
8679
|
+
var showLeftHandle = event.startDay >= weekStartIdx && event.startDay <= weekEndIdx && event.segmentStartDay === event.startDay - weekStartIdx;
|
|
8680
|
+
var showRightHandle = event.endDay >= weekStartIdx && event.endDay <= weekEndIdx && event.segmentEndDay === event.endDay - weekStartIdx;
|
|
8681
|
+
return /*#__PURE__*/React.createElement(View, Object.assign({
|
|
8682
|
+
key: event.id + "-" + event.weekIndex + "-" + event.segmentStartDay,
|
|
8683
|
+
position: "absolute",
|
|
8684
|
+
height: MONTH_EVENT_ROW_HEIGHT,
|
|
8685
|
+
display: "flex",
|
|
8686
|
+
alignItems: "center",
|
|
8687
|
+
paddingLeft: 8,
|
|
8688
|
+
paddingRight: 8,
|
|
8689
|
+
borderRadius: 4,
|
|
8690
|
+
backgroundColor: colorConfig.background,
|
|
8691
|
+
borderLeft: "3px solid",
|
|
8692
|
+
borderLeftColor: colorConfig.border,
|
|
8693
|
+
color: colorConfig.text,
|
|
8694
|
+
fontSize: 11,
|
|
8695
|
+
fontWeight: 500,
|
|
8696
|
+
overflow: "hidden",
|
|
8697
|
+
cursor: isDragging ? 'grabbing' : 'grab',
|
|
8698
|
+
opacity: isDragging || isResizing ? 0.7 : 1,
|
|
8699
|
+
boxShadow: isDragging || isResizing ? '0 4px 12px rgba(0,0,0,0.3)' : '0 1px 2px rgba(0,0,0,0.1)',
|
|
8700
|
+
transition: isDragging || isResizing ? 'none' : 'box-shadow 0.2s',
|
|
8701
|
+
pointerEvents: "auto",
|
|
8702
|
+
userSelect: "none",
|
|
8703
|
+
left: "calc(" + left + "% + 4px)",
|
|
8704
|
+
width: "calc(" + width + "% - 8px)",
|
|
8705
|
+
top: event.segmentRow * (MONTH_EVENT_ROW_HEIGHT + MONTH_EVENT_ROW_GAP) + "px",
|
|
8706
|
+
onMouseDown: e => handleEventMouseDown(e, event),
|
|
8707
|
+
title: event.title
|
|
8708
|
+
}, views.event), /*#__PURE__*/React.createElement(View, {
|
|
8709
|
+
overflow: "hidden",
|
|
8710
|
+
textOverflow: "ellipsis",
|
|
8711
|
+
whiteSpace: "nowrap",
|
|
8712
|
+
width: "100%"
|
|
8713
|
+
}, event.title), showLeftHandle && (/*#__PURE__*/React.createElement(ResizeHandle, {
|
|
8714
|
+
direction: "left",
|
|
8715
|
+
onMouseDown: e => handleResizeStart(e, event, 'left')
|
|
8716
|
+
})), showRightHandle && (/*#__PURE__*/React.createElement(ResizeHandle, {
|
|
8717
|
+
direction: "right",
|
|
8718
|
+
onMouseDown: e => handleResizeStart(e, event, 'right')
|
|
8719
|
+
})));
|
|
8720
|
+
}))));
|
|
8721
|
+
}))));
|
|
8722
|
+
// Render week view
|
|
8723
|
+
var renderWeekView = () => (/*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(View, Object.assign({}, weekdayHeaderStyles, views.weekdayHeader), calendarDates.map((dateISO, index) => {
|
|
8724
|
+
var dayOfWeek = getDayOfWeek(dateISO);
|
|
8725
|
+
var dateNum = getDateNumber(dateISO);
|
|
8726
|
+
var isToday = dateISO === today;
|
|
8727
|
+
return /*#__PURE__*/React.createElement(View, Object.assign({
|
|
8728
|
+
key: dateISO,
|
|
8729
|
+
display: "flex",
|
|
8730
|
+
flexDirection: "column",
|
|
8731
|
+
alignItems: "center",
|
|
8732
|
+
padding: 8,
|
|
8733
|
+
gap: 4
|
|
8734
|
+
}, views.weekdayLabel), /*#__PURE__*/React.createElement(View, Object.assign({}, weekdayLabelStyles), DAY_NAMES[dayOfWeek]), /*#__PURE__*/React.createElement(View, Object.assign({}, dayDateStyles, isToday && todayDayNumberStyles, {
|
|
8735
|
+
fontSize: 16,
|
|
8736
|
+
fontWeight: isToday ? 500 : 400
|
|
8737
|
+
}), dateNum));
|
|
8738
|
+
})), /*#__PURE__*/React.createElement(View, {
|
|
8739
|
+
ref: gridRef,
|
|
8740
|
+
display: "grid",
|
|
8741
|
+
gridTemplateColumns: "repeat(7, 1fr)",
|
|
8742
|
+
minHeight: 400
|
|
8743
|
+
}, calendarDates.map((dateISO, index) => {
|
|
8744
|
+
var isDropTarget = dropTargetDays.includes(index);
|
|
8745
|
+
var dayEvents = eventsByDate[dateISO] || [];
|
|
8746
|
+
return /*#__PURE__*/React.createElement(View, Object.assign({
|
|
8747
|
+
key: dateISO,
|
|
8748
|
+
"data-date": dateISO
|
|
8749
|
+
}, dayCellStyles, isDropTarget && dropTargetStyles, {
|
|
8750
|
+
minHeight: 400,
|
|
8751
|
+
onClick: () => handleDateClick(dateISO),
|
|
8752
|
+
onDoubleClick: () => handleDateDoubleClick(dateISO)
|
|
8753
|
+
}), /*#__PURE__*/React.createElement(View, Object.assign({}, eventsAreaStyles, views.eventsArea), dayEvents.map(event => {
|
|
8754
|
+
var _dragStateRef$current3, _dragStateRef$current4;
|
|
8755
|
+
var colorConfig = EVENT_COLORS[event.color || 'blue'];
|
|
8756
|
+
var isFirstDay = event.isFirstDay !== false;
|
|
8757
|
+
if (!isFirstDay) return null;
|
|
8758
|
+
var isDragging = dragStateRef.current.isDragging && ((_dragStateRef$current3 = dragStateRef.current.event) == null ? void 0 : _dragStateRef$current3.id) === event.id;
|
|
8759
|
+
var isResizing = dragStateRef.current.isResizing && ((_dragStateRef$current4 = dragStateRef.current.event) == null ? void 0 : _dragStateRef$current4.id) === event.id;
|
|
8760
|
+
return /*#__PURE__*/React.createElement(View, Object.assign({
|
|
8761
|
+
key: event.id,
|
|
8762
|
+
position: "relative"
|
|
8763
|
+
}, eventStyles, {
|
|
8764
|
+
backgroundColor: colorConfig.background,
|
|
8765
|
+
borderLeftColor: colorConfig.border,
|
|
8766
|
+
color: colorConfig.text,
|
|
8767
|
+
cursor: isDragging ? 'grabbing' : 'grab',
|
|
8768
|
+
opacity: isDragging || isResizing ? 0.7 : 1,
|
|
8769
|
+
boxShadow: isDragging || isResizing ? '0 4px 12px rgba(0,0,0,0.3)' : '0 1px 2px rgba(0,0,0,0.1)',
|
|
8770
|
+
transition: isDragging || isResizing ? 'none' : 'box-shadow 0.2s',
|
|
8771
|
+
userSelect: "none",
|
|
8772
|
+
onMouseDown: e => handleEventMouseDown(e, event),
|
|
8773
|
+
title: event.title
|
|
8774
|
+
}, views.event), /*#__PURE__*/React.createElement(View, {
|
|
8775
|
+
overflow: "hidden",
|
|
8776
|
+
textOverflow: "ellipsis",
|
|
8777
|
+
whiteSpace: "nowrap",
|
|
8778
|
+
width: "100%"
|
|
8779
|
+
}, event.title), /*#__PURE__*/React.createElement(ResizeHandle, {
|
|
8780
|
+
direction: "left",
|
|
8781
|
+
onMouseDown: e => handleResizeStart(e, event, 'left')
|
|
8782
|
+
}), /*#__PURE__*/React.createElement(ResizeHandle, {
|
|
8783
|
+
direction: "right",
|
|
8784
|
+
onMouseDown: e => handleResizeStart(e, event, 'right')
|
|
8785
|
+
}));
|
|
8786
|
+
})));
|
|
8787
|
+
}))));
|
|
8788
|
+
// Render day view with hourly time slots
|
|
8789
|
+
var renderDayView = () => {
|
|
8790
|
+
var hours = Array.from({
|
|
8791
|
+
length: 24
|
|
8792
|
+
}, (_, i) => i);
|
|
8793
|
+
var dateISO = currentDate;
|
|
8794
|
+
var dayEvents = eventsByDate[dateISO] || [];
|
|
8795
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
8796
|
+
display: "flex",
|
|
8797
|
+
flexDirection: "column",
|
|
8798
|
+
flex: 1
|
|
8799
|
+
}, hours.map(hour => {
|
|
8800
|
+
var hourStr = hour.toString().padStart(2, '0') + ":00";
|
|
8801
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
8802
|
+
key: hour,
|
|
8803
|
+
display: "flex",
|
|
8804
|
+
borderBottom: "1px solid",
|
|
8805
|
+
borderColor: "color.gray.200",
|
|
8806
|
+
minHeight: 60,
|
|
8807
|
+
onDoubleClick: () => handleDateDoubleClick(dateISO, hour),
|
|
8808
|
+
cursor: "pointer",
|
|
8809
|
+
_hover: {
|
|
8810
|
+
backgroundColor: 'color.gray.50'
|
|
8811
|
+
}
|
|
8812
|
+
}, /*#__PURE__*/React.createElement(View, Object.assign({
|
|
8813
|
+
width: 80,
|
|
8814
|
+
padding: 8,
|
|
8815
|
+
fontSize: 12,
|
|
8816
|
+
color: "color.gray.600",
|
|
8817
|
+
borderRight: "1px solid",
|
|
8818
|
+
borderColor: "color.gray.200"
|
|
8819
|
+
}, views.timeColumn), hourStr), /*#__PURE__*/React.createElement(View, Object.assign({
|
|
8820
|
+
flex: 1,
|
|
8821
|
+
padding: 8,
|
|
8822
|
+
position: "relative"
|
|
8823
|
+
}, views.timeSlot), dayEvents.filter(event => {
|
|
8824
|
+
// Simple check if event starts in this hour
|
|
8825
|
+
if (event.start.includes('T')) {
|
|
8826
|
+
var eventHour = parseInt(event.start.split('T')[1].split(':')[0]);
|
|
8827
|
+
return eventHour === hour;
|
|
8828
|
+
}
|
|
8829
|
+
return false;
|
|
8830
|
+
}).map(event => {
|
|
8831
|
+
var colorConfig = EVENT_COLORS[event.color || 'blue'];
|
|
8832
|
+
return /*#__PURE__*/React.createElement(View, Object.assign({
|
|
8833
|
+
key: event.id
|
|
8834
|
+
}, eventStyles, {
|
|
8835
|
+
backgroundColor: colorConfig.background,
|
|
8836
|
+
borderLeftColor: colorConfig.border,
|
|
8837
|
+
color: colorConfig.text,
|
|
8838
|
+
marginBottom: 4
|
|
8839
|
+
}, views.event), event.title);
|
|
8840
|
+
})));
|
|
8841
|
+
}));
|
|
8842
|
+
};
|
|
8843
|
+
return /*#__PURE__*/React.createElement(View, Object.assign({}, containerStyles, {
|
|
8844
|
+
width: width,
|
|
8845
|
+
maxWidth: maxWidth
|
|
8846
|
+
}, views.container), /*#__PURE__*/React.createElement(Horizontal, Object.assign({}, headerStyles, views.header), /*#__PURE__*/React.createElement(View, Object.assign({}, monthTitleStyles, views.monthTitle), getMonthName(currentMonth), " ", getYear(currentMonth)), /*#__PURE__*/React.createElement(Horizontal, {
|
|
8847
|
+
gap: 8
|
|
8848
|
+
}, /*#__PURE__*/React.createElement(Horizontal, Object.assign({
|
|
8849
|
+
gap: 4
|
|
8850
|
+
}, views.viewSwitcher), /*#__PURE__*/React.createElement(View, Object.assign({}, buttonStyles, {
|
|
8851
|
+
backgroundColor: currentView === 'month' ? 'color.primary.100' : 'color.white',
|
|
8852
|
+
color: currentView === 'month' ? 'color.primary.700' : 'color.gray.700',
|
|
8853
|
+
onClick: () => handleViewChange('month'),
|
|
8854
|
+
style: {
|
|
8855
|
+
cursor: 'pointer'
|
|
8856
|
+
}
|
|
8857
|
+
}), "Month"), /*#__PURE__*/React.createElement(View, Object.assign({}, buttonStyles, {
|
|
8858
|
+
backgroundColor: currentView === 'week' ? 'color.primary.100' : 'color.white',
|
|
8859
|
+
color: currentView === 'week' ? 'color.primary.700' : 'color.gray.700',
|
|
8860
|
+
onClick: () => handleViewChange('week'),
|
|
8861
|
+
style: {
|
|
8862
|
+
cursor: 'pointer'
|
|
8863
|
+
}
|
|
8864
|
+
}), "Week"), /*#__PURE__*/React.createElement(View, Object.assign({}, buttonStyles, {
|
|
8865
|
+
backgroundColor: currentView === 'day' ? 'color.primary.100' : 'color.white',
|
|
8866
|
+
color: currentView === 'day' ? 'color.primary.700' : 'color.gray.700',
|
|
8867
|
+
onClick: () => handleViewChange('day'),
|
|
8868
|
+
style: {
|
|
8869
|
+
cursor: 'pointer'
|
|
8870
|
+
}
|
|
8871
|
+
}), "Day")), /*#__PURE__*/React.createElement(View, Object.assign({}, buttonStyles, {
|
|
8872
|
+
onClick: handleToday,
|
|
8873
|
+
style: {
|
|
8874
|
+
cursor: 'pointer'
|
|
8875
|
+
}
|
|
8876
|
+
}, views.navButton), "Today"), /*#__PURE__*/React.createElement(Horizontal, {
|
|
8877
|
+
gap: 4
|
|
8878
|
+
}, /*#__PURE__*/React.createElement(View, Object.assign({}, iconButtonStyles, {
|
|
8879
|
+
onClick: handlePrevious,
|
|
8880
|
+
style: {
|
|
8881
|
+
cursor: 'pointer'
|
|
8882
|
+
}
|
|
8883
|
+
}, views.navButton), "\u2039"), /*#__PURE__*/React.createElement(View, Object.assign({}, iconButtonStyles, {
|
|
8884
|
+
onClick: handleNext,
|
|
8885
|
+
style: {
|
|
8886
|
+
cursor: 'pointer'
|
|
8887
|
+
}
|
|
8888
|
+
}, views.navButton), "\u203A")))), currentView === 'month' && renderMonthView(), currentView === 'week' && renderWeekView(), currentView === 'day' && renderDayView());
|
|
8168
8889
|
};
|
|
8169
|
-
var Calendar = CalendarComponent;
|
|
8170
8890
|
|
|
8171
8891
|
/**
|
|
8172
8892
|
* Custom hook to manage cookie consent state
|
|
@@ -8298,7 +9018,7 @@ var getThemes$1 = themeMode => {
|
|
|
8298
9018
|
};
|
|
8299
9019
|
};
|
|
8300
9020
|
|
|
8301
|
-
var _excluded$
|
|
9021
|
+
var _excluded$i = ["title", "description", "acceptButtonText", "customizeButtonText", "position", "variant", "onAccept", "onCustomize", "views", "showCustomizeButton", "cookieExpiration", "themeMode"];
|
|
8302
9022
|
/**
|
|
8303
9023
|
* CookieConsent View Component
|
|
8304
9024
|
*
|
|
@@ -8319,7 +9039,7 @@ var CookieConsentView = _ref => {
|
|
|
8319
9039
|
cookieExpiration = 365,
|
|
8320
9040
|
themeMode: propThemeMode
|
|
8321
9041
|
} = _ref,
|
|
8322
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
9042
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$i);
|
|
8323
9043
|
// Get theme context
|
|
8324
9044
|
var {
|
|
8325
9045
|
themeMode: contextThemeMode
|
|
@@ -8560,8 +9280,8 @@ var ContextMenuItemStates = {
|
|
|
8560
9280
|
// Note: Manual positioning logic has been replaced with intelligent positioning
|
|
8561
9281
|
// using viewport-aware algorithms in the ContextMenu component
|
|
8562
9282
|
|
|
8563
|
-
var _excluded$
|
|
8564
|
-
_excluded2$
|
|
9283
|
+
var _excluded$j = ["children", "disableNativeContextMenu", "asChild", "isDisabled", "views"],
|
|
9284
|
+
_excluded2$6 = ["items", "children", "position", "side", "align", "views", "style"],
|
|
8565
9285
|
_excluded3$5 = ["item", "children", "onSelect", "isDisabled", "views"],
|
|
8566
9286
|
_excluded4$5 = ["views"],
|
|
8567
9287
|
_excluded5$2 = ["views"],
|
|
@@ -8616,7 +9336,7 @@ var ContextMenuTrigger = _ref2 => {
|
|
|
8616
9336
|
isDisabled = false,
|
|
8617
9337
|
views
|
|
8618
9338
|
} = _ref2,
|
|
8619
|
-
props = _objectWithoutPropertiesLoose(_ref2, _excluded$
|
|
9339
|
+
props = _objectWithoutPropertiesLoose(_ref2, _excluded$j);
|
|
8620
9340
|
var {
|
|
8621
9341
|
triggerRef,
|
|
8622
9342
|
contentId,
|
|
@@ -8670,7 +9390,7 @@ var ContextMenuContent = _ref3 => {
|
|
|
8670
9390
|
views,
|
|
8671
9391
|
style // Capture user-provided style
|
|
8672
9392
|
} = _ref3,
|
|
8673
|
-
props = _objectWithoutPropertiesLoose(_ref3, _excluded2$
|
|
9393
|
+
props = _objectWithoutPropertiesLoose(_ref3, _excluded2$6);
|
|
8674
9394
|
var {
|
|
8675
9395
|
isOpen,
|
|
8676
9396
|
position: contextPosition,
|
|
@@ -8962,7 +9682,7 @@ var ContextMenuView = _ref7 => {
|
|
|
8962
9682
|
}));
|
|
8963
9683
|
};
|
|
8964
9684
|
|
|
8965
|
-
var _excluded$
|
|
9685
|
+
var _excluded$k = ["children", "items", "size", "variant", "disableNativeContextMenu", "onOpenChange", "views"];
|
|
8966
9686
|
/**
|
|
8967
9687
|
* ContextMenu component for displaying a custom context menu on right-click.
|
|
8968
9688
|
* Supports both data-driven approach (with items prop) and compound component pattern.
|
|
@@ -8977,7 +9697,7 @@ var ContextMenuComponent = _ref => {
|
|
|
8977
9697
|
onOpenChange,
|
|
8978
9698
|
views
|
|
8979
9699
|
} = _ref,
|
|
8980
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
9700
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$k);
|
|
8981
9701
|
var state = useContextMenuState({
|
|
8982
9702
|
size,
|
|
8983
9703
|
variant,
|
|
@@ -9029,15 +9749,15 @@ ContextMenu.Item = ContextMenuItem;
|
|
|
9029
9749
|
ContextMenu.Divider = ContextMenuDivider;
|
|
9030
9750
|
ContextMenu.Separator = ContextMenuSeparator; // Add the Separator component
|
|
9031
9751
|
|
|
9032
|
-
var _excluded$
|
|
9033
|
-
_excluded2$
|
|
9752
|
+
var _excluded$l = ["src", "color", "views", "themeMode"],
|
|
9753
|
+
_excluded2$7 = ["path"];
|
|
9034
9754
|
var FileSVG = _ref => {
|
|
9035
9755
|
var {
|
|
9036
9756
|
src,
|
|
9037
9757
|
color,
|
|
9038
9758
|
views
|
|
9039
9759
|
} = _ref,
|
|
9040
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
9760
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$l);
|
|
9041
9761
|
var {
|
|
9042
9762
|
getColor,
|
|
9043
9763
|
themeMode
|
|
@@ -9060,7 +9780,7 @@ var FileImage = _ref2 => {
|
|
|
9060
9780
|
var {
|
|
9061
9781
|
path
|
|
9062
9782
|
} = _ref2,
|
|
9063
|
-
props = _objectWithoutPropertiesLoose(_ref2, _excluded2$
|
|
9783
|
+
props = _objectWithoutPropertiesLoose(_ref2, _excluded2$7);
|
|
9064
9784
|
return /*#__PURE__*/React.createElement(Image, Object.assign({
|
|
9065
9785
|
src: path
|
|
9066
9786
|
}, props));
|
|
@@ -9113,7 +9833,7 @@ var useItemState = () => {
|
|
|
9113
9833
|
};
|
|
9114
9834
|
};
|
|
9115
9835
|
|
|
9116
|
-
var _excluded$
|
|
9836
|
+
var _excluded$m = ["children", "views"];
|
|
9117
9837
|
var HelperText = _ref => {
|
|
9118
9838
|
var {
|
|
9119
9839
|
children,
|
|
@@ -9121,7 +9841,7 @@ var HelperText = _ref => {
|
|
|
9121
9841
|
helperText: {}
|
|
9122
9842
|
}
|
|
9123
9843
|
} = _ref,
|
|
9124
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
9844
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$m);
|
|
9125
9845
|
return /*#__PURE__*/React.createElement(Text
|
|
9126
9846
|
// Typography properties
|
|
9127
9847
|
, Object.assign({
|
|
@@ -9147,7 +9867,7 @@ var HelperText = _ref => {
|
|
|
9147
9867
|
}, views['helperText'], props), children);
|
|
9148
9868
|
};
|
|
9149
9869
|
|
|
9150
|
-
var _excluded$
|
|
9870
|
+
var _excluded$n = ["children", "helperText", "error", "views"];
|
|
9151
9871
|
var FieldContainer = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
9152
9872
|
var {
|
|
9153
9873
|
children,
|
|
@@ -9155,7 +9875,7 @@ var FieldContainer = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
|
9155
9875
|
error = false,
|
|
9156
9876
|
views
|
|
9157
9877
|
} = _ref,
|
|
9158
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
9878
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$n);
|
|
9159
9879
|
return /*#__PURE__*/React.createElement(Vertical, Object.assign({
|
|
9160
9880
|
ref: ref,
|
|
9161
9881
|
// Layout properties
|
|
@@ -9191,13 +9911,23 @@ FieldContainer.displayName = 'FieldContainer';
|
|
|
9191
9911
|
*/
|
|
9192
9912
|
var Shapes = {
|
|
9193
9913
|
default: {
|
|
9194
|
-
borderRadius: '8px'
|
|
9914
|
+
borderRadius: '8px',
|
|
9915
|
+
media: {
|
|
9916
|
+
mobile: {
|
|
9917
|
+
borderRadius: '6px'
|
|
9918
|
+
}
|
|
9919
|
+
}
|
|
9195
9920
|
},
|
|
9196
9921
|
sharp: {
|
|
9197
9922
|
borderRadius: 0
|
|
9198
9923
|
},
|
|
9199
9924
|
rounded: {
|
|
9200
|
-
borderRadius: '8px'
|
|
9925
|
+
borderRadius: '8px',
|
|
9926
|
+
media: {
|
|
9927
|
+
mobile: {
|
|
9928
|
+
borderRadius: '6px'
|
|
9929
|
+
}
|
|
9930
|
+
}
|
|
9201
9931
|
},
|
|
9202
9932
|
pillShaped: {
|
|
9203
9933
|
borderRadius: '9999px'
|
|
@@ -9222,13 +9952,19 @@ var InputVariants = {
|
|
|
9222
9952
|
borderStyle: 'solid',
|
|
9223
9953
|
borderColor: 'color.gray.200',
|
|
9224
9954
|
backgroundColor: 'color.white',
|
|
9225
|
-
transition: '
|
|
9955
|
+
transition: 'border-color 0.2s ease, box-shadow 0.2s ease',
|
|
9226
9956
|
_hover: {
|
|
9227
9957
|
borderColor: 'color.gray.300'
|
|
9228
9958
|
},
|
|
9229
9959
|
_focus: {
|
|
9230
9960
|
borderColor: 'theme.primary',
|
|
9231
|
-
|
|
9961
|
+
outline: 'none',
|
|
9962
|
+
boxShadow: '0 0 0 2px rgba(255, 255, 255, 1), 0 0 0 4px rgba(66, 153, 225, 0.2)'
|
|
9963
|
+
},
|
|
9964
|
+
_focusVisible: {
|
|
9965
|
+
borderColor: 'theme.primary',
|
|
9966
|
+
outline: 'none',
|
|
9967
|
+
boxShadow: '0 0 0 2px rgba(255, 255, 255, 1), 0 0 0 4px rgba(66, 153, 225, 0.2)'
|
|
9232
9968
|
}
|
|
9233
9969
|
},
|
|
9234
9970
|
default: {
|
|
@@ -9238,18 +9974,29 @@ var InputVariants = {
|
|
|
9238
9974
|
borderBottomColor: 'color.gray.200',
|
|
9239
9975
|
borderRadius: 0,
|
|
9240
9976
|
backgroundColor: 'color.white',
|
|
9241
|
-
transition: '
|
|
9977
|
+
transition: 'border-color 0.2s ease',
|
|
9242
9978
|
_hover: {
|
|
9243
9979
|
borderBottomColor: 'color.gray.300'
|
|
9244
9980
|
},
|
|
9245
9981
|
_focus: {
|
|
9246
|
-
borderBottomColor: 'theme.primary'
|
|
9982
|
+
borderBottomColor: 'theme.primary',
|
|
9983
|
+
outline: 'none'
|
|
9984
|
+
},
|
|
9985
|
+
_focusVisible: {
|
|
9986
|
+
borderBottomColor: 'theme.primary',
|
|
9987
|
+
outline: 'none'
|
|
9247
9988
|
}
|
|
9248
9989
|
},
|
|
9249
9990
|
none: {
|
|
9250
9991
|
border: 'none',
|
|
9251
9992
|
backgroundColor: 'transparent',
|
|
9252
|
-
transition: '
|
|
9993
|
+
transition: 'background-color 0.2s ease',
|
|
9994
|
+
_focus: {
|
|
9995
|
+
outline: 'none'
|
|
9996
|
+
},
|
|
9997
|
+
_focusVisible: {
|
|
9998
|
+
outline: 'none'
|
|
9999
|
+
}
|
|
9253
10000
|
}
|
|
9254
10001
|
};
|
|
9255
10002
|
/**
|
|
@@ -9259,7 +10006,15 @@ var PadddingWithLabel = {
|
|
|
9259
10006
|
paddingTop: '16px',
|
|
9260
10007
|
paddingBottom: '8px',
|
|
9261
10008
|
paddingLeft: '16px',
|
|
9262
|
-
paddingRight: '16px'
|
|
10009
|
+
paddingRight: '16px',
|
|
10010
|
+
media: {
|
|
10011
|
+
mobile: {
|
|
10012
|
+
paddingTop: '12px',
|
|
10013
|
+
paddingBottom: '6px',
|
|
10014
|
+
paddingLeft: '12px',
|
|
10015
|
+
paddingRight: '12px'
|
|
10016
|
+
}
|
|
10017
|
+
}
|
|
9263
10018
|
};
|
|
9264
10019
|
/**
|
|
9265
10020
|
* Padding for input without label following the 4px grid system
|
|
@@ -9268,10 +10023,18 @@ var PaddingWithoutLabel = {
|
|
|
9268
10023
|
paddingTop: '12px',
|
|
9269
10024
|
paddingBottom: '12px',
|
|
9270
10025
|
paddingLeft: '16px',
|
|
9271
|
-
paddingRight: '16px'
|
|
10026
|
+
paddingRight: '16px',
|
|
10027
|
+
media: {
|
|
10028
|
+
mobile: {
|
|
10029
|
+
paddingTop: '10px',
|
|
10030
|
+
paddingBottom: '10px',
|
|
10031
|
+
paddingLeft: '12px',
|
|
10032
|
+
paddingRight: '12px'
|
|
10033
|
+
}
|
|
10034
|
+
}
|
|
9272
10035
|
};
|
|
9273
10036
|
|
|
9274
|
-
var _excluded$
|
|
10037
|
+
var _excluded$o = ["label", "shadow", "children", "value", "size", "shape", "variant", "error", "showLabel", "isFocused", "isHovered", "isDisabled", "isReadOnly", "views"];
|
|
9275
10038
|
var FieldContent = _ref => {
|
|
9276
10039
|
var {
|
|
9277
10040
|
shadow,
|
|
@@ -9289,7 +10052,7 @@ var FieldContent = _ref => {
|
|
|
9289
10052
|
pickerBox: {}
|
|
9290
10053
|
}
|
|
9291
10054
|
} = _ref,
|
|
9292
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
10055
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$o);
|
|
9293
10056
|
// Determine if the field is in an interactive state
|
|
9294
10057
|
var isInteractive = (isHovered || isFocused) && !isDisabled;
|
|
9295
10058
|
// Set the appropriate color based on state
|
|
@@ -9318,12 +10081,12 @@ var FieldContent = _ref => {
|
|
|
9318
10081
|
}, showLabel ? PadddingWithLabel : PaddingWithoutLabel, shadow, Shapes[shape], InputVariants[variant], views['box'], props), children);
|
|
9319
10082
|
};
|
|
9320
10083
|
|
|
9321
|
-
var _excluded$
|
|
10084
|
+
var _excluded$p = ["children"];
|
|
9322
10085
|
var FieldIcons = _ref => {
|
|
9323
10086
|
var {
|
|
9324
10087
|
children
|
|
9325
10088
|
} = _ref,
|
|
9326
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
10089
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$p);
|
|
9327
10090
|
return /*#__PURE__*/React.createElement(Center, Object.assign({
|
|
9328
10091
|
gap: 10,
|
|
9329
10092
|
right: 10,
|
|
@@ -9374,7 +10137,7 @@ var HeadingSizes$1 = {
|
|
|
9374
10137
|
}
|
|
9375
10138
|
};
|
|
9376
10139
|
|
|
9377
|
-
var _excluded$
|
|
10140
|
+
var _excluded$q = ["children", "heading", "isItalic", "isUnderlined", "isStriked", "weight", "size", "dropDown"];
|
|
9378
10141
|
var LabelView = _ref => {
|
|
9379
10142
|
var {
|
|
9380
10143
|
children,
|
|
@@ -9390,7 +10153,7 @@ var LabelView = _ref => {
|
|
|
9390
10153
|
size = 'sm'
|
|
9391
10154
|
// The fontSize prop for the Element is determined by the 'size' prop passed to LabelView.
|
|
9392
10155
|
} = _ref,
|
|
9393
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
10156
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$q);
|
|
9394
10157
|
// The fontStyle prop toggles between 'italic' and 'normal' based on the 'isItalic' boolean prop.
|
|
9395
10158
|
var headingStyles = heading ? HeadingSizes$1[heading] : {};
|
|
9396
10159
|
// fontWeight is derived from the Typography module, ensuring consistent font weighting across the app.
|
|
@@ -9422,7 +10185,7 @@ React.createElement(LabelView, Object.assign({}, props))
|
|
|
9422
10185
|
var Label = LabelComponent;
|
|
9423
10186
|
// Export the 'LabelComponent' as 'Label' to be reused throughout the project.
|
|
9424
10187
|
|
|
9425
|
-
var _excluded$
|
|
10188
|
+
var _excluded$r = ["children", "size", "error", "color", "views", "helperText"];
|
|
9426
10189
|
var FieldLabel = _ref => {
|
|
9427
10190
|
var {
|
|
9428
10191
|
children,
|
|
@@ -9433,7 +10196,7 @@ var FieldLabel = _ref => {
|
|
|
9433
10196
|
label: {}
|
|
9434
10197
|
}
|
|
9435
10198
|
} = _ref,
|
|
9436
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
10199
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$r);
|
|
9437
10200
|
return /*#__PURE__*/React.createElement(Label
|
|
9438
10201
|
// Position properties
|
|
9439
10202
|
, Object.assign({
|
|
@@ -9454,12 +10217,12 @@ var FieldLabel = _ref => {
|
|
|
9454
10217
|
}, views['label'], props), children);
|
|
9455
10218
|
};
|
|
9456
10219
|
|
|
9457
|
-
var _excluded$
|
|
10220
|
+
var _excluded$s = ["children"];
|
|
9458
10221
|
var FieldWrapper = _ref => {
|
|
9459
10222
|
var {
|
|
9460
10223
|
children
|
|
9461
10224
|
} = _ref,
|
|
9462
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
10225
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$s);
|
|
9463
10226
|
return /*#__PURE__*/React.createElement(Vertical
|
|
9464
10227
|
// Layout properties
|
|
9465
10228
|
, Object.assign({
|
|
@@ -9492,8 +10255,8 @@ var IconSizes$2 = {
|
|
|
9492
10255
|
xl: 28
|
|
9493
10256
|
};
|
|
9494
10257
|
|
|
9495
|
-
var _excluded$
|
|
9496
|
-
_excluded2$
|
|
10258
|
+
var _excluded$t = ["isHovered", "setIsHovered", "option", "size", "callback", "style"],
|
|
10259
|
+
_excluded2$8 = ["id", "name", "value", "onChange", "isMulti", "isDisabled", "isReadOnly", "options"],
|
|
9497
10260
|
_excluded3$6 = ["option", "size", "removeOption"],
|
|
9498
10261
|
_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"];
|
|
9499
10262
|
/**
|
|
@@ -9510,7 +10273,7 @@ var Item = _ref => {
|
|
|
9510
10273
|
callback = () => {},
|
|
9511
10274
|
style
|
|
9512
10275
|
} = _ref,
|
|
9513
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
10276
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$t);
|
|
9514
10277
|
// Handles the click event on an option by invoking the callback with the selected option's value
|
|
9515
10278
|
var handleOptionClick = (e, option) => {
|
|
9516
10279
|
e.stopPropagation();
|
|
@@ -9618,7 +10381,7 @@ var HiddenSelect = _ref4 => {
|
|
|
9618
10381
|
isReadOnly = false,
|
|
9619
10382
|
options = []
|
|
9620
10383
|
} = _ref4,
|
|
9621
|
-
props = _objectWithoutPropertiesLoose(_ref4, _excluded2$
|
|
10384
|
+
props = _objectWithoutPropertiesLoose(_ref4, _excluded2$8);
|
|
9622
10385
|
var handleChange = event => {
|
|
9623
10386
|
if (onChange) onChange(event);
|
|
9624
10387
|
};
|
|
@@ -10103,18 +10866,27 @@ var ColorSchemes = {
|
|
|
10103
10866
|
// State-specific colors
|
|
10104
10867
|
states: {
|
|
10105
10868
|
hover: {
|
|
10106
|
-
active:
|
|
10107
|
-
|
|
10869
|
+
active: {
|
|
10870
|
+
opacity: 0.9
|
|
10871
|
+
},
|
|
10872
|
+
inactive: {
|
|
10873
|
+
backgroundColor: 'color.gray.400'
|
|
10874
|
+
}
|
|
10108
10875
|
},
|
|
10109
10876
|
focus: {
|
|
10110
|
-
active:
|
|
10111
|
-
|
|
10112
|
-
|
|
10877
|
+
active: {
|
|
10878
|
+
outline: 'none',
|
|
10879
|
+
boxShadow: '0 0 0 2px rgba(255, 255, 255, 1), 0 0 0 4px rgba(66, 153, 225, 0.3)'
|
|
10880
|
+
},
|
|
10881
|
+
inactive: {
|
|
10882
|
+
outline: 'none',
|
|
10883
|
+
boxShadow: '0 0 0 2px rgba(255, 255, 255, 1), 0 0 0 4px rgba(0, 0, 0, 0.1)'
|
|
10884
|
+
}
|
|
10113
10885
|
}
|
|
10114
10886
|
}
|
|
10115
10887
|
};
|
|
10116
10888
|
|
|
10117
|
-
var _excluded$
|
|
10889
|
+
var _excluded$u = ["id", "name", "label", "inActiveChild", "isChecked", "activeChild", "labelPosition", "shadow", "size", "value", "isHovered", "isDisabled", "isReadOnly", "on", "setOn", "onChange", "setValue", "setIsHovered", "helperText", "views"];
|
|
10118
10890
|
var SwitchContent = props => /*#__PURE__*/React.createElement(Input, Object.assign({
|
|
10119
10891
|
type: "checkbox"
|
|
10120
10892
|
}, props));
|
|
@@ -10142,7 +10914,7 @@ var SwitchView = _ref => {
|
|
|
10142
10914
|
label: {}
|
|
10143
10915
|
}
|
|
10144
10916
|
} = _ref,
|
|
10145
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
10917
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$u);
|
|
10146
10918
|
var handleToggle = event => {
|
|
10147
10919
|
if (!isReadOnly && !isDisabled) {
|
|
10148
10920
|
var newValue = event.target.checked;
|
|
@@ -10279,7 +11051,7 @@ var useTextAreaState = _ref => {
|
|
|
10279
11051
|
// Export of the useTextAreaState hook for external usage.
|
|
10280
11052
|
};
|
|
10281
11053
|
|
|
10282
|
-
var _excluded$
|
|
11054
|
+
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"];
|
|
10283
11055
|
var TextAreaView = _ref => {
|
|
10284
11056
|
var {
|
|
10285
11057
|
id,
|
|
@@ -10314,7 +11086,7 @@ var TextAreaView = _ref => {
|
|
|
10314
11086
|
helperText: {}
|
|
10315
11087
|
}
|
|
10316
11088
|
} = _ref,
|
|
10317
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
11089
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$v);
|
|
10318
11090
|
var showLabel = !!(isFocused && label);
|
|
10319
11091
|
/**
|
|
10320
11092
|
* Styles for the textarea field
|
|
@@ -10453,7 +11225,7 @@ var useTextFieldState = _ref => {
|
|
|
10453
11225
|
};
|
|
10454
11226
|
};
|
|
10455
11227
|
|
|
10456
|
-
var _excluded$
|
|
11228
|
+
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"];
|
|
10457
11229
|
/**
|
|
10458
11230
|
* Input component for text fields
|
|
10459
11231
|
*/
|
|
@@ -10499,7 +11271,7 @@ var TextFieldView = _ref => {
|
|
|
10499
11271
|
onBlur = () => {},
|
|
10500
11272
|
themeMode: elementMode
|
|
10501
11273
|
} = _ref,
|
|
10502
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
11274
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$w);
|
|
10503
11275
|
var {
|
|
10504
11276
|
getColor,
|
|
10505
11277
|
themeMode
|
|
@@ -10692,19 +11464,26 @@ var VariantStyles = {
|
|
|
10692
11464
|
selected: {
|
|
10693
11465
|
backgroundColor: 'theme.primary',
|
|
10694
11466
|
borderColor: 'theme.primary',
|
|
10695
|
-
|
|
11467
|
+
borderWidth: '2px',
|
|
11468
|
+
borderStyle: 'solid',
|
|
11469
|
+
color: 'color.white',
|
|
11470
|
+
transition: 'background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease'
|
|
10696
11471
|
},
|
|
10697
11472
|
unselected: {
|
|
10698
11473
|
backgroundColor: 'color.white',
|
|
10699
11474
|
borderWidth: '2px',
|
|
10700
11475
|
borderStyle: 'solid',
|
|
10701
11476
|
borderColor: 'color.gray.300',
|
|
10702
|
-
color: 'color.black'
|
|
11477
|
+
color: 'color.black',
|
|
11478
|
+
transition: 'background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease'
|
|
10703
11479
|
},
|
|
10704
11480
|
indeterminate: {
|
|
10705
11481
|
backgroundColor: 'theme.primary',
|
|
10706
11482
|
borderColor: 'theme.primary',
|
|
10707
|
-
|
|
11483
|
+
borderWidth: '2px',
|
|
11484
|
+
borderStyle: 'solid',
|
|
11485
|
+
color: 'color.white',
|
|
11486
|
+
transition: 'background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease'
|
|
10708
11487
|
}
|
|
10709
11488
|
};
|
|
10710
11489
|
/**
|
|
@@ -10713,31 +11492,47 @@ var VariantStyles = {
|
|
|
10713
11492
|
var StateStyles = {
|
|
10714
11493
|
hover: {
|
|
10715
11494
|
selected: {
|
|
10716
|
-
|
|
10717
|
-
borderColor: 'color.blue.600'
|
|
11495
|
+
opacity: 0.9
|
|
10718
11496
|
},
|
|
10719
11497
|
unselected: {
|
|
10720
|
-
borderColor: 'color.gray.400'
|
|
11498
|
+
borderColor: 'color.gray.400',
|
|
11499
|
+
backgroundColor: 'color.gray.50'
|
|
11500
|
+
},
|
|
11501
|
+
indeterminate: {
|
|
11502
|
+
opacity: 0.9
|
|
11503
|
+
}
|
|
11504
|
+
},
|
|
11505
|
+
focus: {
|
|
11506
|
+
selected: {
|
|
11507
|
+
outline: 'none',
|
|
11508
|
+
boxShadow: '0 0 0 2px rgba(255, 255, 255, 1), 0 0 0 4px rgba(66, 153, 225, 0.3)'
|
|
11509
|
+
},
|
|
11510
|
+
unselected: {
|
|
11511
|
+
outline: 'none',
|
|
11512
|
+
boxShadow: '0 0 0 2px rgba(255, 255, 255, 1), 0 0 0 4px rgba(66, 153, 225, 0.3)'
|
|
10721
11513
|
},
|
|
10722
11514
|
indeterminate: {
|
|
10723
|
-
|
|
10724
|
-
|
|
11515
|
+
outline: 'none',
|
|
11516
|
+
boxShadow: '0 0 0 2px rgba(255, 255, 255, 1), 0 0 0 4px rgba(66, 153, 225, 0.3)'
|
|
10725
11517
|
}
|
|
10726
11518
|
},
|
|
10727
11519
|
disabled: {
|
|
10728
11520
|
selected: {
|
|
10729
11521
|
backgroundColor: 'color.gray.300',
|
|
10730
11522
|
borderColor: 'color.gray.300',
|
|
10731
|
-
opacity: 0.
|
|
11523
|
+
opacity: 0.5,
|
|
11524
|
+
cursor: 'not-allowed'
|
|
10732
11525
|
},
|
|
10733
11526
|
unselected: {
|
|
10734
11527
|
borderColor: 'color.gray.300',
|
|
10735
|
-
opacity: 0.
|
|
11528
|
+
opacity: 0.5,
|
|
11529
|
+
cursor: 'not-allowed'
|
|
10736
11530
|
},
|
|
10737
11531
|
indeterminate: {
|
|
10738
11532
|
backgroundColor: 'color.gray.300',
|
|
10739
11533
|
borderColor: 'color.gray.300',
|
|
10740
|
-
opacity: 0.
|
|
11534
|
+
opacity: 0.5,
|
|
11535
|
+
cursor: 'not-allowed'
|
|
10741
11536
|
}
|
|
10742
11537
|
},
|
|
10743
11538
|
error: {
|
|
@@ -10755,7 +11550,7 @@ var StateStyles = {
|
|
|
10755
11550
|
}
|
|
10756
11551
|
};
|
|
10757
11552
|
|
|
10758
|
-
var _excluded$
|
|
11553
|
+
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"];
|
|
10759
11554
|
var CheckboxView = _ref => {
|
|
10760
11555
|
var {
|
|
10761
11556
|
id,
|
|
@@ -10782,7 +11577,7 @@ var CheckboxView = _ref => {
|
|
|
10782
11577
|
},
|
|
10783
11578
|
infoText
|
|
10784
11579
|
} = _ref,
|
|
10785
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
11580
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$x);
|
|
10786
11581
|
var handleHover = () => setIsHovered(!isHovered);
|
|
10787
11582
|
var handleChange = () => {
|
|
10788
11583
|
if (!isReadOnly && !isDisabled) {
|
|
@@ -11240,7 +12035,7 @@ var DefaultColorPalette = [
|
|
|
11240
12035
|
value: 'transparent'
|
|
11241
12036
|
}];
|
|
11242
12037
|
|
|
11243
|
-
var _excluded$
|
|
12038
|
+
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"];
|
|
11244
12039
|
var ColorInputView = _ref => {
|
|
11245
12040
|
var {
|
|
11246
12041
|
// Basic props
|
|
@@ -11281,7 +12076,7 @@ var ColorInputView = _ref => {
|
|
|
11281
12076
|
dropdownRef
|
|
11282
12077
|
// Other props
|
|
11283
12078
|
} = _ref,
|
|
11284
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
12079
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$y);
|
|
11285
12080
|
var {
|
|
11286
12081
|
getColor
|
|
11287
12082
|
} = useTheme();
|
|
@@ -12920,11 +13715,11 @@ var IconSizes$4 = {
|
|
|
12920
13715
|
xl: 16
|
|
12921
13716
|
};
|
|
12922
13717
|
|
|
12923
|
-
var _excluded$
|
|
12924
|
-
_excluded2$
|
|
13718
|
+
var _excluded$z = ["size"],
|
|
13719
|
+
_excluded2$9 = ["size"],
|
|
12925
13720
|
_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"];
|
|
12926
13721
|
var CountryList = _ref => {
|
|
12927
|
-
var props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
13722
|
+
var props = _objectWithoutPropertiesLoose(_ref, _excluded$z);
|
|
12928
13723
|
return /*#__PURE__*/React.createElement(Element, Object.assign({
|
|
12929
13724
|
as: "ul"
|
|
12930
13725
|
}, props));
|
|
@@ -12933,7 +13728,7 @@ var CountrySelector = props => (/*#__PURE__*/React.createElement(Input, Object.a
|
|
|
12933
13728
|
type: "country"
|
|
12934
13729
|
}, props)));
|
|
12935
13730
|
var CountryItem = _ref2 => {
|
|
12936
|
-
var props = _objectWithoutPropertiesLoose(_ref2, _excluded2$
|
|
13731
|
+
var props = _objectWithoutPropertiesLoose(_ref2, _excluded2$9);
|
|
12937
13732
|
return /*#__PURE__*/React.createElement(Element, Object.assign({
|
|
12938
13733
|
as: "li"
|
|
12939
13734
|
}, props));
|
|
@@ -13154,7 +13949,7 @@ var CountryPicker = CountryPickerComponent;
|
|
|
13154
13949
|
var useDatePickerState = () => {
|
|
13155
13950
|
var [isHovered, setIsHovered] = React.useState(false);
|
|
13156
13951
|
var [isFocused, setIsFocused] = React.useState(false);
|
|
13157
|
-
var [date, setDate] = React.useState(format
|
|
13952
|
+
var [date, setDate] = React.useState(format(new Date(), 'yyyy-MM-dd'));
|
|
13158
13953
|
return {
|
|
13159
13954
|
date,
|
|
13160
13955
|
setDate,
|
|
@@ -13165,7 +13960,7 @@ var useDatePickerState = () => {
|
|
|
13165
13960
|
};
|
|
13166
13961
|
};
|
|
13167
13962
|
|
|
13168
|
-
var _excluded$
|
|
13963
|
+
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"];
|
|
13169
13964
|
var DatePickerContent = props => /*#__PURE__*/React.createElement(Input, Object.assign({
|
|
13170
13965
|
type: "date"
|
|
13171
13966
|
}, props));
|
|
@@ -13198,7 +13993,7 @@ var DatePickerView = _ref => {
|
|
|
13198
13993
|
onChange,
|
|
13199
13994
|
onChangeText
|
|
13200
13995
|
} = _ref,
|
|
13201
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
13996
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$A);
|
|
13202
13997
|
var showLabel = !!(isFocused && label);
|
|
13203
13998
|
var handleHover = () => setIsHovered(!isHovered);
|
|
13204
13999
|
var handleFocus = () => setIsFocused(true);
|
|
@@ -13285,8 +14080,8 @@ var usePasswordState = props => {
|
|
|
13285
14080
|
}, props, textFieldStates);
|
|
13286
14081
|
};
|
|
13287
14082
|
|
|
13288
|
-
var _excluded$
|
|
13289
|
-
_excluded2$
|
|
14083
|
+
var _excluded$B = ["visibleIcon", "hiddenIcon"],
|
|
14084
|
+
_excluded2$a = ["isVisible", "setIsVisible"];
|
|
13290
14085
|
var PasswordComponent = _ref => {
|
|
13291
14086
|
var {
|
|
13292
14087
|
visibleIcon = /*#__PURE__*/React.createElement(OpenEyeIcon, {
|
|
@@ -13296,13 +14091,13 @@ var PasswordComponent = _ref => {
|
|
|
13296
14091
|
widthHeight: 14
|
|
13297
14092
|
})
|
|
13298
14093
|
} = _ref,
|
|
13299
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
14094
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$B);
|
|
13300
14095
|
var _usePasswordState = usePasswordState(props),
|
|
13301
14096
|
{
|
|
13302
14097
|
isVisible,
|
|
13303
14098
|
setIsVisible
|
|
13304
14099
|
} = _usePasswordState,
|
|
13305
|
-
passwordProps = _objectWithoutPropertiesLoose(_usePasswordState, _excluded2$
|
|
14100
|
+
passwordProps = _objectWithoutPropertiesLoose(_usePasswordState, _excluded2$a);
|
|
13306
14101
|
return /*#__PURE__*/React.createElement(TextFieldView, Object.assign({}, passwordProps, {
|
|
13307
14102
|
type: isVisible ? 'text' : 'password',
|
|
13308
14103
|
isClearable: false,
|
|
@@ -13350,7 +14145,7 @@ var useComboBoxState = (items, placeholder, searchPlaceholder) => {
|
|
|
13350
14145
|
};
|
|
13351
14146
|
};
|
|
13352
14147
|
|
|
13353
|
-
var _excluded$
|
|
14148
|
+
var _excluded$C = ["placeholder", "items", "showTick", "onSelect", "searchEnabled", "left", "right", "label", "filteredItems", "setSelectedItem", "selectedItem", "highlightedIndex", "setHighlightedIndex", "searchQuery", "setSearchQuery", "setFilteredItems", "views", "isDropdownVisible", "setIsDropdownVisible"];
|
|
13354
14149
|
// Defines the functional component 'ComboBoxView' with destructured props.
|
|
13355
14150
|
var ComboBoxView = _ref => {
|
|
13356
14151
|
var {
|
|
@@ -13375,7 +14170,7 @@ var ComboBoxView = _ref => {
|
|
|
13375
14170
|
setIsDropdownVisible
|
|
13376
14171
|
// Collects all further props not destructured explicitly.
|
|
13377
14172
|
} = _ref,
|
|
13378
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
14173
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$C);
|
|
13379
14174
|
var {
|
|
13380
14175
|
ref: triggerRef,
|
|
13381
14176
|
relation
|
|
@@ -13522,7 +14317,7 @@ var ComboBoxView = _ref => {
|
|
|
13522
14317
|
})))))))))));
|
|
13523
14318
|
};
|
|
13524
14319
|
|
|
13525
|
-
var _excluded$
|
|
14320
|
+
var _excluded$D = ["id", "name", "items", "placeholder", "searchPlaceholder"];
|
|
13526
14321
|
// Defines the ComboBoxComponent functional component with ComboBoxProps
|
|
13527
14322
|
var ComboBoxComponent = _ref => {
|
|
13528
14323
|
var {
|
|
@@ -13538,7 +14333,7 @@ var ComboBoxComponent = _ref => {
|
|
|
13538
14333
|
searchPlaceholder
|
|
13539
14334
|
// Destructures the rest of the props not explicitly defined
|
|
13540
14335
|
} = _ref,
|
|
13541
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
14336
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$D);
|
|
13542
14337
|
// Initializes ComboBox state using custom hook with items and placeholders
|
|
13543
14338
|
var state = useComboBoxState(items, placeholder, searchPlaceholder);
|
|
13544
14339
|
return (
|
|
@@ -13747,7 +14542,7 @@ var useTagInputState = props => {
|
|
|
13747
14542
|
};
|
|
13748
14543
|
};
|
|
13749
14544
|
|
|
13750
|
-
var _excluded$
|
|
14545
|
+
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"];
|
|
13751
14546
|
/**
|
|
13752
14547
|
* Individual tag chip component
|
|
13753
14548
|
*/
|
|
@@ -13863,7 +14658,7 @@ var TagInputView = _ref2 => {
|
|
|
13863
14658
|
setIsHovered,
|
|
13864
14659
|
onClick
|
|
13865
14660
|
} = _ref2,
|
|
13866
|
-
props = _objectWithoutPropertiesLoose(_ref2, _excluded$
|
|
14661
|
+
props = _objectWithoutPropertiesLoose(_ref2, _excluded$E);
|
|
13867
14662
|
var {
|
|
13868
14663
|
getColor,
|
|
13869
14664
|
themeMode
|
|
@@ -13946,7 +14741,7 @@ var TagInputView = _ref2 => {
|
|
|
13946
14741
|
}, views == null ? void 0 : views.placeholder), "Maximum ", maxTags, " tags reached")))), right));
|
|
13947
14742
|
};
|
|
13948
14743
|
|
|
13949
|
-
var _excluded$
|
|
14744
|
+
var _excluded$F = ["tags"];
|
|
13950
14745
|
/**
|
|
13951
14746
|
* TagInput Component
|
|
13952
14747
|
*
|
|
@@ -13958,7 +14753,7 @@ var TagInputComponent = props => {
|
|
|
13958
14753
|
// Initialize state management with the custom hook
|
|
13959
14754
|
var tagInputState = useTagInputState(props);
|
|
13960
14755
|
// Separate the tags prop to avoid type conflicts
|
|
13961
|
-
var restProps = _objectWithoutPropertiesLoose(props, _excluded$
|
|
14756
|
+
var restProps = _objectWithoutPropertiesLoose(props, _excluded$F);
|
|
13962
14757
|
// Render the view component with combined props and state
|
|
13963
14758
|
return /*#__PURE__*/React.createElement(TagInputView, Object.assign({}, tagInputState, restProps));
|
|
13964
14759
|
};
|
|
@@ -14271,7 +15066,7 @@ var useOTPInputState = _ref => {
|
|
|
14271
15066
|
};
|
|
14272
15067
|
};
|
|
14273
15068
|
|
|
14274
|
-
var _excluded$
|
|
15069
|
+
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"];
|
|
14275
15070
|
// Create a context for OTP input slots
|
|
14276
15071
|
var OTPInputContext = /*#__PURE__*/createContext({
|
|
14277
15072
|
slots: [],
|
|
@@ -14325,7 +15120,7 @@ var OTPInputView = _ref => {
|
|
|
14325
15120
|
onFocus = () => {}
|
|
14326
15121
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
14327
15122
|
} = _ref,
|
|
14328
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
15123
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$G);
|
|
14329
15124
|
useTheme(); // Initialize theme context
|
|
14330
15125
|
var showLabel = !!label;
|
|
14331
15126
|
// Create context value for slots
|
|
@@ -14557,7 +15352,7 @@ var OTPInputComponent = props => {
|
|
|
14557
15352
|
};
|
|
14558
15353
|
var OTPInput = OTPInputComponent;
|
|
14559
15354
|
|
|
14560
|
-
var _excluded$
|
|
15355
|
+
var _excluded$H = ["children", "autoFocus", "initFocus", "onChange"];
|
|
14561
15356
|
var FocusContext = /*#__PURE__*/createContext({
|
|
14562
15357
|
active: false,
|
|
14563
15358
|
focusNextInput: () => {},
|
|
@@ -14573,7 +15368,7 @@ var FormikForm = _ref => {
|
|
|
14573
15368
|
initFocus,
|
|
14574
15369
|
onChange = () => {}
|
|
14575
15370
|
} = _ref,
|
|
14576
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
15371
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$H);
|
|
14577
15372
|
var formik = useFormikContext();
|
|
14578
15373
|
useEffect(() => {
|
|
14579
15374
|
onChange(formik.values);
|
|
@@ -14621,7 +15416,7 @@ var FormikForm = _ref => {
|
|
|
14621
15416
|
}, /*#__PURE__*/React.createElement(Form, Object.assign({}, props), children));
|
|
14622
15417
|
};
|
|
14623
15418
|
|
|
14624
|
-
var _excluded$
|
|
15419
|
+
var _excluded$I = ["name", "type"];
|
|
14625
15420
|
var getInputTypeProps = type => {
|
|
14626
15421
|
switch (type) {
|
|
14627
15422
|
case 'email':
|
|
@@ -14660,7 +15455,7 @@ var useFormikInput = _ref => {
|
|
|
14660
15455
|
name,
|
|
14661
15456
|
type
|
|
14662
15457
|
} = _ref,
|
|
14663
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
15458
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$I);
|
|
14664
15459
|
var focus = useFormFocus();
|
|
14665
15460
|
var {
|
|
14666
15461
|
touched,
|
|
@@ -14704,13 +15499,13 @@ var useFormikInput = _ref => {
|
|
|
14704
15499
|
} : {});
|
|
14705
15500
|
};
|
|
14706
15501
|
|
|
14707
|
-
var _excluded$
|
|
15502
|
+
var _excluded$J = ["value"];
|
|
14708
15503
|
var CheckboxComponent$1 = props => {
|
|
14709
15504
|
var _useFormikInput = useFormikInput(props),
|
|
14710
15505
|
{
|
|
14711
15506
|
value
|
|
14712
15507
|
} = _useFormikInput,
|
|
14713
|
-
formProps = _objectWithoutPropertiesLoose(_useFormikInput, _excluded$
|
|
15508
|
+
formProps = _objectWithoutPropertiesLoose(_useFormikInput, _excluded$J);
|
|
14714
15509
|
formProps.isChecked = value;
|
|
14715
15510
|
var checkboxStates = useCheckboxState(props);
|
|
14716
15511
|
return /*#__PURE__*/React.createElement(CheckboxView, Object.assign({}, checkboxStates, formProps));
|
|
@@ -14966,7 +15761,12 @@ var DefaultChatInputStyles = {
|
|
|
14966
15761
|
maxWidth: '100%',
|
|
14967
15762
|
borderRadius: '12px',
|
|
14968
15763
|
backgroundColor: 'color.white',
|
|
14969
|
-
transition: 'all 0.2s ease'
|
|
15764
|
+
transition: 'all 0.2s ease',
|
|
15765
|
+
media: {
|
|
15766
|
+
mobile: {
|
|
15767
|
+
borderRadius: '8px'
|
|
15768
|
+
}
|
|
15769
|
+
}
|
|
14970
15770
|
},
|
|
14971
15771
|
content: {
|
|
14972
15772
|
width: '100%',
|
|
@@ -14975,7 +15775,13 @@ var DefaultChatInputStyles = {
|
|
|
14975
15775
|
backgroundColor: 'color.white',
|
|
14976
15776
|
borderWidth: '1px',
|
|
14977
15777
|
borderStyle: 'solid',
|
|
14978
|
-
borderColor: 'color.gray.200'
|
|
15778
|
+
borderColor: 'color.gray.200',
|
|
15779
|
+
media: {
|
|
15780
|
+
mobile: {
|
|
15781
|
+
padding: '10px',
|
|
15782
|
+
borderRadius: '8px'
|
|
15783
|
+
}
|
|
15784
|
+
}
|
|
14979
15785
|
},
|
|
14980
15786
|
textarea: {
|
|
14981
15787
|
width: '100%',
|
|
@@ -14989,7 +15795,14 @@ var DefaultChatInputStyles = {
|
|
|
14989
15795
|
border: 'none',
|
|
14990
15796
|
outline: 'none',
|
|
14991
15797
|
resize: 'none',
|
|
14992
|
-
overflow: 'auto'
|
|
15798
|
+
overflow: 'auto',
|
|
15799
|
+
media: {
|
|
15800
|
+
mobile: {
|
|
15801
|
+
padding: '6px 10px',
|
|
15802
|
+
fontSize: '13px',
|
|
15803
|
+
minHeight: '36px'
|
|
15804
|
+
}
|
|
15805
|
+
}
|
|
14993
15806
|
},
|
|
14994
15807
|
attachments: {
|
|
14995
15808
|
display: 'flex',
|
|
@@ -15029,7 +15842,14 @@ var DefaultChatInputStyles = {
|
|
|
15029
15842
|
borderRadius: '8px',
|
|
15030
15843
|
backgroundColor: 'theme.primary',
|
|
15031
15844
|
color: 'color.white',
|
|
15032
|
-
transition: 'all 0.2s ease'
|
|
15845
|
+
transition: 'all 0.2s ease',
|
|
15846
|
+
media: {
|
|
15847
|
+
mobile: {
|
|
15848
|
+
height: '32px',
|
|
15849
|
+
minWidth: '32px',
|
|
15850
|
+
padding: '0 10px'
|
|
15851
|
+
}
|
|
15852
|
+
}
|
|
15033
15853
|
},
|
|
15034
15854
|
fileButton: {
|
|
15035
15855
|
height: '36px',
|
|
@@ -15037,7 +15857,13 @@ var DefaultChatInputStyles = {
|
|
|
15037
15857
|
borderRadius: '8px',
|
|
15038
15858
|
backgroundColor: 'transparent',
|
|
15039
15859
|
color: 'color.gray.500',
|
|
15040
|
-
transition: 'all 0.2s ease'
|
|
15860
|
+
transition: 'all 0.2s ease',
|
|
15861
|
+
media: {
|
|
15862
|
+
mobile: {
|
|
15863
|
+
height: '32px',
|
|
15864
|
+
padding: '0 10px'
|
|
15865
|
+
}
|
|
15866
|
+
}
|
|
15041
15867
|
},
|
|
15042
15868
|
modelSelector: {
|
|
15043
15869
|
height: '36px',
|
|
@@ -15055,66 +15881,368 @@ var DefaultChatInputStyles = {
|
|
|
15055
15881
|
padding: '8px 0'
|
|
15056
15882
|
}
|
|
15057
15883
|
};
|
|
15058
|
-
/**
|
|
15059
|
-
* Shape styles for the ChatInput component
|
|
15060
|
-
*/
|
|
15061
|
-
var Shapes$2 = {
|
|
15062
|
-
default: {
|
|
15063
|
-
borderRadius: '8px'
|
|
15064
|
-
},
|
|
15065
|
-
sharp: {
|
|
15066
|
-
borderRadius: '0px'
|
|
15067
|
-
},
|
|
15068
|
-
rounded: {
|
|
15069
|
-
borderRadius: '8px'
|
|
15884
|
+
/**
|
|
15885
|
+
* Shape styles for the ChatInput component
|
|
15886
|
+
*/
|
|
15887
|
+
var Shapes$2 = {
|
|
15888
|
+
default: {
|
|
15889
|
+
borderRadius: '8px'
|
|
15890
|
+
},
|
|
15891
|
+
sharp: {
|
|
15892
|
+
borderRadius: '0px'
|
|
15893
|
+
},
|
|
15894
|
+
rounded: {
|
|
15895
|
+
borderRadius: '8px'
|
|
15896
|
+
}
|
|
15897
|
+
};
|
|
15898
|
+
/**
|
|
15899
|
+
* Size styles for the ChatInput component
|
|
15900
|
+
*/
|
|
15901
|
+
var Sizes$2 = {
|
|
15902
|
+
xs: {
|
|
15903
|
+
fontSize: '10px',
|
|
15904
|
+
padding: '4px 8px'
|
|
15905
|
+
},
|
|
15906
|
+
sm: {
|
|
15907
|
+
fontSize: '12px',
|
|
15908
|
+
padding: '6px 10px'
|
|
15909
|
+
},
|
|
15910
|
+
md: {
|
|
15911
|
+
fontSize: '14px',
|
|
15912
|
+
padding: '8px 12px'
|
|
15913
|
+
},
|
|
15914
|
+
lg: {
|
|
15915
|
+
fontSize: '16px',
|
|
15916
|
+
padding: '10px 14px'
|
|
15917
|
+
},
|
|
15918
|
+
xl: {
|
|
15919
|
+
fontSize: '20px',
|
|
15920
|
+
padding: '12px 16px'
|
|
15921
|
+
}
|
|
15922
|
+
};
|
|
15923
|
+
/**
|
|
15924
|
+
* Variant styles for the ChatInput component
|
|
15925
|
+
*/
|
|
15926
|
+
var Variants$1 = {
|
|
15927
|
+
default: {
|
|
15928
|
+
backgroundColor: 'color.white',
|
|
15929
|
+
borderWidth: '1px',
|
|
15930
|
+
borderStyle: 'solid',
|
|
15931
|
+
borderColor: 'color.gray.200'
|
|
15932
|
+
},
|
|
15933
|
+
outline: {
|
|
15934
|
+
backgroundColor: 'transparent',
|
|
15935
|
+
borderWidth: '1px',
|
|
15936
|
+
borderStyle: 'solid',
|
|
15937
|
+
borderColor: 'color.gray.300'
|
|
15938
|
+
},
|
|
15939
|
+
none: {
|
|
15940
|
+
backgroundColor: 'transparent',
|
|
15941
|
+
border: 'none'
|
|
15942
|
+
}
|
|
15943
|
+
};
|
|
15944
|
+
|
|
15945
|
+
// Generate a unique ID for ARIA attributes
|
|
15946
|
+
var generateId$1 = prefix => prefix + "-" + Math.random().toString(36).substring(2, 9);
|
|
15947
|
+
var useHoverCardState = function useHoverCardState(_temp) {
|
|
15948
|
+
var {
|
|
15949
|
+
openDelay = 200,
|
|
15950
|
+
closeDelay = 300
|
|
15951
|
+
} = _temp === void 0 ? {} : _temp;
|
|
15952
|
+
var [isOpen, setIsOpen] = useState(false);
|
|
15953
|
+
var openTimerRef = useRef(null);
|
|
15954
|
+
var closeTimerRef = useRef(null);
|
|
15955
|
+
// Refs for trigger and content elements for positioning
|
|
15956
|
+
var triggerRef = useRef(null);
|
|
15957
|
+
var contentRef = useRef(null);
|
|
15958
|
+
// Unique IDs for ARIA attributes
|
|
15959
|
+
var contentId = useMemo(() => generateId$1('hovercard-content'), []);
|
|
15960
|
+
var triggerId = useMemo(() => generateId$1('hovercard-trigger'), []);
|
|
15961
|
+
var clearTimers = useCallback(() => {
|
|
15962
|
+
if (openTimerRef.current) {
|
|
15963
|
+
clearTimeout(openTimerRef.current);
|
|
15964
|
+
openTimerRef.current = null;
|
|
15965
|
+
}
|
|
15966
|
+
if (closeTimerRef.current) {
|
|
15967
|
+
clearTimeout(closeTimerRef.current);
|
|
15968
|
+
closeTimerRef.current = null;
|
|
15969
|
+
}
|
|
15970
|
+
}, []);
|
|
15971
|
+
var openCard = useCallback(() => {
|
|
15972
|
+
clearTimers(); // Clear any pending close
|
|
15973
|
+
if (!isOpen) {
|
|
15974
|
+
openTimerRef.current = setTimeout(() => {
|
|
15975
|
+
setIsOpen(true);
|
|
15976
|
+
}, openDelay);
|
|
15977
|
+
}
|
|
15978
|
+
}, [isOpen, openDelay, clearTimers]);
|
|
15979
|
+
var closeCard = useCallback(() => {
|
|
15980
|
+
clearTimers(); // Clear any pending open
|
|
15981
|
+
if (isOpen) {
|
|
15982
|
+
closeTimerRef.current = setTimeout(() => {
|
|
15983
|
+
setIsOpen(false);
|
|
15984
|
+
}, closeDelay);
|
|
15985
|
+
}
|
|
15986
|
+
}, [isOpen, closeDelay, clearTimers]);
|
|
15987
|
+
// Function specifically to cancel the close timer (e.g., when mouse enters content)
|
|
15988
|
+
var cancelCloseTimer = useCallback(() => {
|
|
15989
|
+
if (closeTimerRef.current) {
|
|
15990
|
+
clearTimeout(closeTimerRef.current);
|
|
15991
|
+
closeTimerRef.current = null;
|
|
15992
|
+
}
|
|
15993
|
+
}, []);
|
|
15994
|
+
// Cleanup timers on unmount
|
|
15995
|
+
useEffect(() => {
|
|
15996
|
+
return () => clearTimers();
|
|
15997
|
+
}, [clearTimers]);
|
|
15998
|
+
return {
|
|
15999
|
+
isOpen,
|
|
16000
|
+
openCard,
|
|
16001
|
+
closeCard,
|
|
16002
|
+
cancelCloseTimer,
|
|
16003
|
+
triggerRef,
|
|
16004
|
+
contentRef,
|
|
16005
|
+
contentId,
|
|
16006
|
+
triggerId
|
|
16007
|
+
};
|
|
16008
|
+
};
|
|
16009
|
+
|
|
16010
|
+
var _excluded$K = ["children", "views", "asChild"],
|
|
16011
|
+
_excluded2$b = ["children", "views", "side", "align", "sideOffset", "style", "backgroundColor", "borderRadius", "boxShadow", "padding", "minWidth", "maxWidth"];
|
|
16012
|
+
// Create context for the HoverCard
|
|
16013
|
+
var HoverCardContext = /*#__PURE__*/createContext({
|
|
16014
|
+
isOpen: false,
|
|
16015
|
+
openCard: () => {},
|
|
16016
|
+
closeCard: () => {},
|
|
16017
|
+
cancelCloseTimer: () => {},
|
|
16018
|
+
triggerRef: {
|
|
16019
|
+
current: null
|
|
16020
|
+
},
|
|
16021
|
+
contentRef: {
|
|
16022
|
+
current: null
|
|
16023
|
+
},
|
|
16024
|
+
contentId: '',
|
|
16025
|
+
triggerId: ''
|
|
16026
|
+
});
|
|
16027
|
+
var HoverCardProvider = _ref => {
|
|
16028
|
+
var {
|
|
16029
|
+
children,
|
|
16030
|
+
value
|
|
16031
|
+
} = _ref;
|
|
16032
|
+
return /*#__PURE__*/React.createElement(HoverCardContext.Provider, {
|
|
16033
|
+
value: value
|
|
16034
|
+
}, children);
|
|
16035
|
+
};
|
|
16036
|
+
var useHoverCardContext = () => {
|
|
16037
|
+
var context = useContext(HoverCardContext);
|
|
16038
|
+
if (!context) {
|
|
16039
|
+
throw new Error('useHoverCardContext must be used within a HoverCardProvider');
|
|
16040
|
+
}
|
|
16041
|
+
return context;
|
|
16042
|
+
};
|
|
16043
|
+
var HoverCardTrigger = _ref2 => {
|
|
16044
|
+
var {
|
|
16045
|
+
children,
|
|
16046
|
+
views,
|
|
16047
|
+
asChild = false
|
|
16048
|
+
} = _ref2,
|
|
16049
|
+
props = _objectWithoutPropertiesLoose(_ref2, _excluded$K);
|
|
16050
|
+
var {
|
|
16051
|
+
openCard,
|
|
16052
|
+
closeCard,
|
|
16053
|
+
triggerRef,
|
|
16054
|
+
contentId,
|
|
16055
|
+
triggerId
|
|
16056
|
+
} = useHoverCardContext();
|
|
16057
|
+
var handleMouseEnter = () => openCard();
|
|
16058
|
+
var handleMouseLeave = () => closeCard();
|
|
16059
|
+
var handleFocus = () => openCard(); // For keyboard accessibility
|
|
16060
|
+
var handleBlur = () => closeCard(); // For keyboard accessibility
|
|
16061
|
+
var triggerProps = Object.assign({
|
|
16062
|
+
ref: triggerRef,
|
|
16063
|
+
onMouseEnter: handleMouseEnter,
|
|
16064
|
+
onMouseLeave: handleMouseLeave,
|
|
16065
|
+
onFocus: handleFocus,
|
|
16066
|
+
onBlur: handleBlur,
|
|
16067
|
+
id: triggerId,
|
|
16068
|
+
'aria-describedby': contentId
|
|
16069
|
+
}, views == null ? void 0 : views.container, props);
|
|
16070
|
+
if (asChild && /*#__PURE__*/isValidElement(children)) {
|
|
16071
|
+
// Clone the child element and merge props
|
|
16072
|
+
var child = Children.only(children);
|
|
16073
|
+
return /*#__PURE__*/cloneElement(child, Object.assign({}, triggerProps, child.props));
|
|
15070
16074
|
}
|
|
16075
|
+
// Default: wrap children in a View
|
|
16076
|
+
return /*#__PURE__*/React.createElement(View, Object.assign({
|
|
16077
|
+
position: "relative",
|
|
16078
|
+
display: "inline-block"
|
|
16079
|
+
}, triggerProps), children);
|
|
15071
16080
|
};
|
|
15072
|
-
|
|
15073
|
-
|
|
15074
|
-
|
|
15075
|
-
|
|
15076
|
-
|
|
15077
|
-
|
|
15078
|
-
|
|
15079
|
-
|
|
15080
|
-
|
|
15081
|
-
|
|
15082
|
-
|
|
15083
|
-
|
|
15084
|
-
|
|
15085
|
-
|
|
15086
|
-
|
|
15087
|
-
|
|
15088
|
-
|
|
15089
|
-
|
|
15090
|
-
|
|
15091
|
-
|
|
15092
|
-
|
|
15093
|
-
|
|
15094
|
-
|
|
16081
|
+
var HoverCardContent = _ref3 => {
|
|
16082
|
+
var {
|
|
16083
|
+
children,
|
|
16084
|
+
views,
|
|
16085
|
+
side = 'bottom',
|
|
16086
|
+
align = 'center',
|
|
16087
|
+
sideOffset = 8,
|
|
16088
|
+
style: userStyle,
|
|
16089
|
+
// User provided style override
|
|
16090
|
+
backgroundColor = 'white',
|
|
16091
|
+
borderRadius = '4px',
|
|
16092
|
+
boxShadow = '0px 2px 8px rgba(0, 0, 0, 0.15)',
|
|
16093
|
+
padding = '12px',
|
|
16094
|
+
minWidth = '50px',
|
|
16095
|
+
maxWidth = '300px'
|
|
16096
|
+
} = _ref3,
|
|
16097
|
+
props = _objectWithoutPropertiesLoose(_ref3, _excluded2$b);
|
|
16098
|
+
var {
|
|
16099
|
+
isOpen,
|
|
16100
|
+
cancelCloseTimer,
|
|
16101
|
+
closeCard,
|
|
16102
|
+
contentRef,
|
|
16103
|
+
triggerRef,
|
|
16104
|
+
contentId,
|
|
16105
|
+
triggerId
|
|
16106
|
+
} = useHoverCardContext();
|
|
16107
|
+
// Use useElementPosition for intelligent positioning
|
|
16108
|
+
var {
|
|
16109
|
+
ref: positionRef,
|
|
16110
|
+
relation
|
|
16111
|
+
} = useElementPosition({
|
|
16112
|
+
trackChanges: true,
|
|
16113
|
+
trackOnHover: true,
|
|
16114
|
+
trackOnScroll: true,
|
|
16115
|
+
trackOnResize: true
|
|
16116
|
+
});
|
|
16117
|
+
// Sync the position ref with the trigger ref for positioning calculations
|
|
16118
|
+
useEffect(() => {
|
|
16119
|
+
if (triggerRef != null && triggerRef.current && (positionRef == null ? void 0 : positionRef.current) !== triggerRef.current) {
|
|
16120
|
+
// Update the position tracking to use the trigger element
|
|
16121
|
+
if (positionRef) {
|
|
16122
|
+
positionRef.current = triggerRef.current;
|
|
16123
|
+
}
|
|
16124
|
+
}
|
|
16125
|
+
}, [triggerRef, positionRef, isOpen]);
|
|
16126
|
+
var handleMouseEnter = () => cancelCloseTimer(); // Keep card open if mouse enters content
|
|
16127
|
+
var handleMouseLeave = () => closeCard();
|
|
16128
|
+
if (!isOpen) {
|
|
16129
|
+
return null; // Don't render content if not open
|
|
15095
16130
|
}
|
|
16131
|
+
// Create intelligent positioning styles based on useElementPosition relation data
|
|
16132
|
+
var getPositionStyles = () => {
|
|
16133
|
+
if (!relation || !(triggerRef != null && triggerRef.current)) {
|
|
16134
|
+
// Fallback positioning if relation data is not available
|
|
16135
|
+
return {
|
|
16136
|
+
position: 'absolute',
|
|
16137
|
+
top: 0,
|
|
16138
|
+
left: 0,
|
|
16139
|
+
zIndex: 1000
|
|
16140
|
+
};
|
|
16141
|
+
}
|
|
16142
|
+
var triggerRect = triggerRef.current.getBoundingClientRect();
|
|
16143
|
+
var placement = side;
|
|
16144
|
+
// Use relation data to determine optimal placement
|
|
16145
|
+
// If preferred side doesn't have enough space, use the side with more space
|
|
16146
|
+
if (side === 'bottom' && relation.space.vertical === 'top') {
|
|
16147
|
+
placement = 'top';
|
|
16148
|
+
} else if (side === 'top' && relation.space.vertical === 'bottom') {
|
|
16149
|
+
placement = 'bottom';
|
|
16150
|
+
} else if (side === 'right' && relation.space.horizontal === 'left') {
|
|
16151
|
+
placement = 'left';
|
|
16152
|
+
} else if (side === 'left' && relation.space.horizontal === 'right') {
|
|
16153
|
+
placement = 'right';
|
|
16154
|
+
}
|
|
16155
|
+
// Calculate position based on optimal placement
|
|
16156
|
+
var x = 0;
|
|
16157
|
+
var y = 0;
|
|
16158
|
+
switch (placement) {
|
|
16159
|
+
case 'bottom':
|
|
16160
|
+
x = triggerRect.left + triggerRect.width / 2;
|
|
16161
|
+
y = triggerRect.bottom + sideOffset;
|
|
16162
|
+
break;
|
|
16163
|
+
case 'top':
|
|
16164
|
+
x = triggerRect.left + triggerRect.width / 2;
|
|
16165
|
+
y = triggerRect.top - sideOffset;
|
|
16166
|
+
break;
|
|
16167
|
+
case 'right':
|
|
16168
|
+
x = triggerRect.right + sideOffset;
|
|
16169
|
+
y = triggerRect.top + triggerRect.height / 2;
|
|
16170
|
+
break;
|
|
16171
|
+
case 'left':
|
|
16172
|
+
x = triggerRect.left - sideOffset;
|
|
16173
|
+
y = triggerRect.top + triggerRect.height / 2;
|
|
16174
|
+
break;
|
|
16175
|
+
}
|
|
16176
|
+
return {
|
|
16177
|
+
position: 'fixed',
|
|
16178
|
+
left: x,
|
|
16179
|
+
top: y,
|
|
16180
|
+
zIndex: 1000,
|
|
16181
|
+
transform: getTransformOrigin(placement)
|
|
16182
|
+
};
|
|
16183
|
+
};
|
|
16184
|
+
// Helper function to set transform origin for better positioning
|
|
16185
|
+
var getTransformOrigin = placement => {
|
|
16186
|
+
switch (placement) {
|
|
16187
|
+
case 'bottom':
|
|
16188
|
+
return 'translate(-50%, 0)';
|
|
16189
|
+
case 'top':
|
|
16190
|
+
return 'translate(-50%, -100%)';
|
|
16191
|
+
case 'right':
|
|
16192
|
+
return 'translate(0, -50%)';
|
|
16193
|
+
case 'left':
|
|
16194
|
+
return 'translate(-100%, -50%)';
|
|
16195
|
+
default:
|
|
16196
|
+
return 'translate(-50%, 0)';
|
|
16197
|
+
}
|
|
16198
|
+
};
|
|
16199
|
+
var positionStyles = getPositionStyles();
|
|
16200
|
+
return /*#__PURE__*/React.createElement(View, Object.assign({
|
|
16201
|
+
ref: contentRef,
|
|
16202
|
+
id: contentId,
|
|
16203
|
+
role: "tooltip" // Use tooltip role for accessibility
|
|
16204
|
+
,
|
|
16205
|
+
"aria-labelledby": triggerId,
|
|
16206
|
+
onMouseEnter: handleMouseEnter,
|
|
16207
|
+
onMouseLeave: handleMouseLeave,
|
|
16208
|
+
backgroundColor: backgroundColor,
|
|
16209
|
+
borderRadius: borderRadius,
|
|
16210
|
+
boxShadow: boxShadow,
|
|
16211
|
+
padding: padding,
|
|
16212
|
+
minWidth: minWidth,
|
|
16213
|
+
maxWidth: maxWidth,
|
|
16214
|
+
// Combine intelligent position styles with user styles
|
|
16215
|
+
style: Object.assign({}, positionStyles, userStyle)
|
|
16216
|
+
}, views == null ? void 0 : views.container, props), children);
|
|
15096
16217
|
};
|
|
16218
|
+
|
|
16219
|
+
var _excluded$L = ["children", "views", "openDelay", "closeDelay"];
|
|
15097
16220
|
/**
|
|
15098
|
-
*
|
|
16221
|
+
* HoverCard component displays floating content when hovering over a trigger element.
|
|
16222
|
+
* Supports configurable open and close delays for a smoother user experience.
|
|
15099
16223
|
*/
|
|
15100
|
-
var
|
|
15101
|
-
|
|
15102
|
-
|
|
15103
|
-
|
|
15104
|
-
|
|
15105
|
-
|
|
15106
|
-
|
|
15107
|
-
|
|
15108
|
-
|
|
15109
|
-
|
|
15110
|
-
|
|
15111
|
-
|
|
15112
|
-
|
|
15113
|
-
|
|
15114
|
-
|
|
15115
|
-
|
|
15116
|
-
|
|
16224
|
+
var HoverCardComponent = _ref => {
|
|
16225
|
+
var {
|
|
16226
|
+
children,
|
|
16227
|
+
views,
|
|
16228
|
+
openDelay,
|
|
16229
|
+
closeDelay
|
|
16230
|
+
} = _ref,
|
|
16231
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$L);
|
|
16232
|
+
var hoverCardState = useHoverCardState({
|
|
16233
|
+
openDelay,
|
|
16234
|
+
closeDelay
|
|
16235
|
+
});
|
|
16236
|
+
return /*#__PURE__*/React.createElement(HoverCardProvider, {
|
|
16237
|
+
value: hoverCardState
|
|
16238
|
+
}, /*#__PURE__*/React.createElement(View, Object.assign({
|
|
16239
|
+
position: "relative",
|
|
16240
|
+
display: "inline-block"
|
|
16241
|
+
}, views == null ? void 0 : views.container, props), children));
|
|
15117
16242
|
};
|
|
16243
|
+
var HoverCard = HoverCardComponent;
|
|
16244
|
+
HoverCard.Trigger = HoverCardTrigger;
|
|
16245
|
+
HoverCard.Content = HoverCardContent;
|
|
15118
16246
|
|
|
15119
16247
|
/**
|
|
15120
16248
|
* Default styles for AgentChat component
|
|
@@ -16673,13 +17801,15 @@ var SliderShapes = {
|
|
|
16673
17801
|
var getSlider = themeMode => {
|
|
16674
17802
|
return {
|
|
16675
17803
|
default: {
|
|
16676
|
-
backgroundColor: 'color.
|
|
17804
|
+
backgroundColor: 'color.gray.200',
|
|
17805
|
+
transition: 'background-color 0.15s ease'
|
|
16677
17806
|
},
|
|
16678
17807
|
outline: {
|
|
16679
17808
|
backgroundColor: 'transparent',
|
|
16680
17809
|
borderWidth: 1,
|
|
16681
17810
|
borderStyle: 'solid',
|
|
16682
|
-
borderColor: 'color.
|
|
17811
|
+
borderColor: 'color.gray.300',
|
|
17812
|
+
transition: 'border-color 0.15s ease'
|
|
16683
17813
|
}
|
|
16684
17814
|
};
|
|
16685
17815
|
// Add dark mode conditional styling here
|
|
@@ -17609,7 +18739,15 @@ var ModalContainer = _ref2 => {
|
|
|
17609
18739
|
height: isFullScreen ? '100%' : 'fit-content',
|
|
17610
18740
|
onClick: handleClick,
|
|
17611
18741
|
transition: "all 0.3s ease"
|
|
17612
|
-
}, shadow ? shadow : defaultShadow, ContainerShapes[shape],
|
|
18742
|
+
}, shadow ? shadow : defaultShadow, ContainerShapes[shape], {
|
|
18743
|
+
media: {
|
|
18744
|
+
mobile: {
|
|
18745
|
+
width: '90%',
|
|
18746
|
+
maxWidth: '100%',
|
|
18747
|
+
margin: '16px'
|
|
18748
|
+
}
|
|
18749
|
+
}
|
|
18750
|
+
}, props, views == null ? void 0 : views.container), children);
|
|
17613
18751
|
};
|
|
17614
18752
|
var ModalHeader = _ref3 => {
|
|
17615
18753
|
var {
|
|
@@ -17634,7 +18772,13 @@ var ModalHeader = _ref3 => {
|
|
|
17634
18772
|
paddingHorizontal: 24,
|
|
17635
18773
|
borderBottomWidth: "1px",
|
|
17636
18774
|
borderBottomStyle: "solid",
|
|
17637
|
-
borderBottomColor: "color.gray.200"
|
|
18775
|
+
borderBottomColor: "color.gray.200",
|
|
18776
|
+
media: {
|
|
18777
|
+
mobile: {
|
|
18778
|
+
paddingVertical: 12,
|
|
18779
|
+
paddingHorizontal: 16
|
|
18780
|
+
}
|
|
18781
|
+
}
|
|
17638
18782
|
}, props, views == null ? void 0 : views.header), buttonPosition === 'left' && buttonIcon, children, buttonPosition === 'right' && buttonIcon);
|
|
17639
18783
|
};
|
|
17640
18784
|
var ModalBody = _ref4 => {
|
|
@@ -17649,7 +18793,14 @@ var ModalBody = _ref4 => {
|
|
|
17649
18793
|
fontSize: ModalTypography.body.fontSize,
|
|
17650
18794
|
fontWeight: ModalTypography.body.fontWeight,
|
|
17651
18795
|
lineHeight: ModalTypography.body.lineHeight,
|
|
17652
|
-
color: ModalTypography.body.color
|
|
18796
|
+
color: ModalTypography.body.color,
|
|
18797
|
+
media: {
|
|
18798
|
+
mobile: {
|
|
18799
|
+
paddingVertical: 12,
|
|
18800
|
+
paddingHorizontal: 16,
|
|
18801
|
+
fontSize: '14px'
|
|
18802
|
+
}
|
|
18803
|
+
}
|
|
17653
18804
|
}, props, views == null ? void 0 : views.view), children);
|
|
17654
18805
|
};
|
|
17655
18806
|
var ModalFooter = _ref5 => {
|
|
@@ -17667,7 +18818,14 @@ var ModalFooter = _ref5 => {
|
|
|
17667
18818
|
borderTopWidth: "1px",
|
|
17668
18819
|
borderTopStyle: "solid",
|
|
17669
18820
|
borderTopColor: "color.gray.200",
|
|
17670
|
-
gap: 12
|
|
18821
|
+
gap: 12,
|
|
18822
|
+
media: {
|
|
18823
|
+
mobile: {
|
|
18824
|
+
paddingVertical: 12,
|
|
18825
|
+
paddingHorizontal: 16,
|
|
18826
|
+
gap: 8
|
|
18827
|
+
}
|
|
18828
|
+
}
|
|
17671
18829
|
}, props, views == null ? void 0 : views.container), children);
|
|
17672
18830
|
};
|
|
17673
18831
|
|
|
@@ -17732,6 +18890,7 @@ var useNavigationMenuState = function useNavigationMenuState(defaultActiveItemId
|
|
|
17732
18890
|
}
|
|
17733
18891
|
var [activeItemId, setActiveItemId] = useState(defaultActiveItemId);
|
|
17734
18892
|
var [expandedItemIds, setExpandedItemIds] = useState(defaultExpandedItemIds);
|
|
18893
|
+
var triggerRefs = useRef({});
|
|
17735
18894
|
var toggleExpandedItem = itemId => {
|
|
17736
18895
|
setExpandedItemIds(prevExpandedItemIds => {
|
|
17737
18896
|
// Check if the item is already expanded
|
|
@@ -17753,7 +18912,8 @@ var useNavigationMenuState = function useNavigationMenuState(defaultActiveItemId
|
|
|
17753
18912
|
setActiveItemId,
|
|
17754
18913
|
expandedItemIds,
|
|
17755
18914
|
toggleExpandedItem,
|
|
17756
|
-
isItemExpanded
|
|
18915
|
+
isItemExpanded,
|
|
18916
|
+
triggerRefs
|
|
17757
18917
|
};
|
|
17758
18918
|
};
|
|
17759
18919
|
|
|
@@ -17775,17 +18935,35 @@ var NavigationMenuSizes = {
|
|
|
17775
18935
|
sm: {
|
|
17776
18936
|
padding: '8px 12px',
|
|
17777
18937
|
fontSize: '12px',
|
|
17778
|
-
fontWeight: '500'
|
|
18938
|
+
fontWeight: '500',
|
|
18939
|
+
media: {
|
|
18940
|
+
mobile: {
|
|
18941
|
+
padding: '6px 10px',
|
|
18942
|
+
fontSize: '11px'
|
|
18943
|
+
}
|
|
18944
|
+
}
|
|
17779
18945
|
},
|
|
17780
18946
|
md: {
|
|
17781
18947
|
padding: '12px 16px',
|
|
17782
18948
|
fontSize: '14px',
|
|
17783
|
-
fontWeight: '500'
|
|
18949
|
+
fontWeight: '500',
|
|
18950
|
+
media: {
|
|
18951
|
+
mobile: {
|
|
18952
|
+
padding: '10px 14px',
|
|
18953
|
+
fontSize: '13px'
|
|
18954
|
+
}
|
|
18955
|
+
}
|
|
17784
18956
|
},
|
|
17785
18957
|
lg: {
|
|
17786
18958
|
padding: '16px 20px',
|
|
17787
18959
|
fontSize: '16px',
|
|
17788
|
-
fontWeight: '500'
|
|
18960
|
+
fontWeight: '500',
|
|
18961
|
+
media: {
|
|
18962
|
+
mobile: {
|
|
18963
|
+
padding: '12px 16px',
|
|
18964
|
+
fontSize: '14px'
|
|
18965
|
+
}
|
|
18966
|
+
}
|
|
17789
18967
|
}
|
|
17790
18968
|
};
|
|
17791
18969
|
/**
|
|
@@ -17817,7 +18995,13 @@ var NavigationMenuVariants = {
|
|
|
17817
18995
|
var NavigationMenuOrientations = {
|
|
17818
18996
|
horizontal: {
|
|
17819
18997
|
flexDirection: 'row',
|
|
17820
|
-
gap: '8px'
|
|
18998
|
+
gap: '8px',
|
|
18999
|
+
media: {
|
|
19000
|
+
mobile: {
|
|
19001
|
+
flexDirection: 'column',
|
|
19002
|
+
gap: '4px'
|
|
19003
|
+
}
|
|
19004
|
+
}
|
|
17821
19005
|
},
|
|
17822
19006
|
vertical: {
|
|
17823
19007
|
flexDirection: 'column',
|
|
@@ -17856,7 +19040,10 @@ var NavigationMenuContext = /*#__PURE__*/createContext({
|
|
|
17856
19040
|
isItemExpanded: () => false,
|
|
17857
19041
|
orientation: 'vertical',
|
|
17858
19042
|
size: 'md',
|
|
17859
|
-
variant: 'default'
|
|
19043
|
+
variant: 'default',
|
|
19044
|
+
triggerRefs: {
|
|
19045
|
+
current: {}
|
|
19046
|
+
}
|
|
17860
19047
|
});
|
|
17861
19048
|
// Provider component for the NavigationMenu context
|
|
17862
19049
|
var NavigationMenuProvider = _ref => {
|
|
@@ -18010,16 +19197,30 @@ var NavigationMenuTrigger = _ref4 => {
|
|
|
18010
19197
|
toggleExpandedItem,
|
|
18011
19198
|
isItemExpanded,
|
|
18012
19199
|
size,
|
|
18013
|
-
variant
|
|
19200
|
+
variant,
|
|
19201
|
+
triggerRefs
|
|
18014
19202
|
} = useNavigationMenuContext();
|
|
19203
|
+
var triggerRef = useRef(null);
|
|
18015
19204
|
var isActive = activeItemId === itemId;
|
|
18016
19205
|
var isExpanded = isItemExpanded(itemId);
|
|
19206
|
+
// Store the trigger ref in the context
|
|
19207
|
+
useEffect(() => {
|
|
19208
|
+
if (triggerRef.current && itemId) {
|
|
19209
|
+
triggerRefs.current[itemId] = triggerRef.current;
|
|
19210
|
+
}
|
|
19211
|
+
return () => {
|
|
19212
|
+
if (itemId) {
|
|
19213
|
+
delete triggerRefs.current[itemId];
|
|
19214
|
+
}
|
|
19215
|
+
};
|
|
19216
|
+
}, [itemId, triggerRefs]);
|
|
18017
19217
|
var handleClick = e => {
|
|
18018
19218
|
e.preventDefault();
|
|
18019
19219
|
if (disabled) return;
|
|
18020
19220
|
toggleExpandedItem(itemId);
|
|
18021
19221
|
};
|
|
18022
19222
|
return /*#__PURE__*/React.createElement(View, Object.assign({
|
|
19223
|
+
ref: triggerRef,
|
|
18023
19224
|
onClick: handleClick,
|
|
18024
19225
|
cursor: disabled ? 'not-allowed' : 'pointer',
|
|
18025
19226
|
opacity: disabled ? 0.5 : 1,
|
|
@@ -18053,22 +19254,150 @@ var NavigationMenuContent = _ref5 => {
|
|
|
18053
19254
|
} = _ref5;
|
|
18054
19255
|
var {
|
|
18055
19256
|
isItemExpanded,
|
|
18056
|
-
orientation
|
|
19257
|
+
orientation,
|
|
19258
|
+
triggerRefs
|
|
18057
19259
|
} = useNavigationMenuContext();
|
|
19260
|
+
var contentRef = useRef(null);
|
|
19261
|
+
var [optimalPosition, setOptimalPosition] = useState({
|
|
19262
|
+
x: 0,
|
|
19263
|
+
y: 0,
|
|
19264
|
+
placement: orientation === 'horizontal' ? 'bottom' : 'right'
|
|
19265
|
+
});
|
|
18058
19266
|
var isExpanded = isItemExpanded(itemId);
|
|
19267
|
+
// Calculate optimal position when the menu expands
|
|
19268
|
+
useEffect(() => {
|
|
19269
|
+
if (isExpanded && contentRef.current && itemId && triggerRefs.current[itemId] && orientation === 'horizontal') {
|
|
19270
|
+
var contentRect = contentRef.current.getBoundingClientRect();
|
|
19271
|
+
var triggerRect = triggerRefs.current[itemId].getBoundingClientRect();
|
|
19272
|
+
// Get content dimensions
|
|
19273
|
+
var contentWidth = Math.max(contentRect.width || 200, 200);
|
|
19274
|
+
var contentHeight = Math.max(contentRect.height || 150, 150);
|
|
19275
|
+
// Get viewport dimensions
|
|
19276
|
+
var viewportWidth = window.innerWidth;
|
|
19277
|
+
var viewportHeight = window.innerHeight;
|
|
19278
|
+
// Calculate available space on all sides from the trigger
|
|
19279
|
+
var availableSpace = {
|
|
19280
|
+
top: triggerRect.top,
|
|
19281
|
+
right: viewportWidth - triggerRect.right,
|
|
19282
|
+
bottom: viewportHeight - triggerRect.bottom,
|
|
19283
|
+
left: triggerRect.left
|
|
19284
|
+
};
|
|
19285
|
+
// Determine optimal placement based on orientation and available space
|
|
19286
|
+
var placements = orientation === 'horizontal' ? [
|
|
19287
|
+
// For horizontal navigation menu, prefer bottom placement
|
|
19288
|
+
{
|
|
19289
|
+
placement: 'bottom',
|
|
19290
|
+
space: availableSpace.bottom,
|
|
19291
|
+
fits: availableSpace.bottom >= contentHeight + 8,
|
|
19292
|
+
x: triggerRect.left,
|
|
19293
|
+
y: triggerRect.bottom + 8
|
|
19294
|
+
}, {
|
|
19295
|
+
placement: 'top',
|
|
19296
|
+
space: availableSpace.top,
|
|
19297
|
+
fits: availableSpace.top >= contentHeight + 8,
|
|
19298
|
+
x: triggerRect.left,
|
|
19299
|
+
y: triggerRect.top - contentHeight - 8
|
|
19300
|
+
}, {
|
|
19301
|
+
placement: 'right',
|
|
19302
|
+
space: availableSpace.right,
|
|
19303
|
+
fits: availableSpace.right >= contentWidth + 8,
|
|
19304
|
+
x: triggerRect.right + 8,
|
|
19305
|
+
y: triggerRect.top
|
|
19306
|
+
}, {
|
|
19307
|
+
placement: 'left',
|
|
19308
|
+
space: availableSpace.left,
|
|
19309
|
+
fits: availableSpace.left >= contentWidth + 8,
|
|
19310
|
+
x: triggerRect.left - contentWidth - 8,
|
|
19311
|
+
y: triggerRect.top
|
|
19312
|
+
}] : [
|
|
19313
|
+
// For vertical navigation menu, prefer right placement
|
|
19314
|
+
{
|
|
19315
|
+
placement: 'right',
|
|
19316
|
+
space: availableSpace.right,
|
|
19317
|
+
fits: availableSpace.right >= contentWidth + 8,
|
|
19318
|
+
x: triggerRect.right + 8,
|
|
19319
|
+
y: triggerRect.top
|
|
19320
|
+
}, {
|
|
19321
|
+
placement: 'left',
|
|
19322
|
+
space: availableSpace.left,
|
|
19323
|
+
fits: availableSpace.left >= contentWidth + 8,
|
|
19324
|
+
x: triggerRect.left - contentWidth - 8,
|
|
19325
|
+
y: triggerRect.top
|
|
19326
|
+
}, {
|
|
19327
|
+
placement: 'bottom',
|
|
19328
|
+
space: availableSpace.bottom,
|
|
19329
|
+
fits: availableSpace.bottom >= contentHeight + 8,
|
|
19330
|
+
x: triggerRect.left,
|
|
19331
|
+
y: triggerRect.bottom + 8
|
|
19332
|
+
}, {
|
|
19333
|
+
placement: 'top',
|
|
19334
|
+
space: availableSpace.top,
|
|
19335
|
+
fits: availableSpace.top >= contentHeight + 8,
|
|
19336
|
+
x: triggerRect.left,
|
|
19337
|
+
y: triggerRect.top - contentHeight - 8
|
|
19338
|
+
}];
|
|
19339
|
+
// Find the best fitting placement
|
|
19340
|
+
var fittingPlacement = placements.find(p => p.fits);
|
|
19341
|
+
if (fittingPlacement) {
|
|
19342
|
+
setOptimalPosition({
|
|
19343
|
+
x: fittingPlacement.x,
|
|
19344
|
+
y: fittingPlacement.y,
|
|
19345
|
+
placement: fittingPlacement.placement
|
|
19346
|
+
});
|
|
19347
|
+
return;
|
|
19348
|
+
}
|
|
19349
|
+
// If nothing fits, choose the placement with the most space
|
|
19350
|
+
var bestPlacement = placements.reduce((best, current) => current.space > best.space ? current : best);
|
|
19351
|
+
// Ensure the content stays within viewport bounds
|
|
19352
|
+
var finalX = bestPlacement.x;
|
|
19353
|
+
var finalY = bestPlacement.y;
|
|
19354
|
+
if (finalX + contentWidth > viewportWidth) {
|
|
19355
|
+
finalX = viewportWidth - contentWidth - 8;
|
|
19356
|
+
}
|
|
19357
|
+
if (finalX < 8) {
|
|
19358
|
+
finalX = 8;
|
|
19359
|
+
}
|
|
19360
|
+
if (finalY + contentHeight > viewportHeight) {
|
|
19361
|
+
finalY = viewportHeight - contentHeight - 8;
|
|
19362
|
+
}
|
|
19363
|
+
if (finalY < 8) {
|
|
19364
|
+
finalY = 8;
|
|
19365
|
+
}
|
|
19366
|
+
setOptimalPosition({
|
|
19367
|
+
x: finalX,
|
|
19368
|
+
y: finalY,
|
|
19369
|
+
placement: bestPlacement.placement
|
|
19370
|
+
});
|
|
19371
|
+
}
|
|
19372
|
+
}, [isExpanded, orientation, itemId, triggerRefs]);
|
|
18059
19373
|
if (!isExpanded) {
|
|
18060
19374
|
return null;
|
|
18061
19375
|
}
|
|
19376
|
+
// For vertical orientation, keep the original relative positioning
|
|
19377
|
+
if (orientation === 'vertical') {
|
|
19378
|
+
return /*#__PURE__*/React.createElement(View, Object.assign({
|
|
19379
|
+
paddingLeft: 16,
|
|
19380
|
+
width: "100%",
|
|
19381
|
+
position: "relative",
|
|
19382
|
+
backgroundColor: "transparent"
|
|
19383
|
+
}, views == null ? void 0 : views.container), children);
|
|
19384
|
+
}
|
|
19385
|
+
// For horizontal orientation, use fixed positioning with intelligent placement
|
|
19386
|
+
var positionStyles = {
|
|
19387
|
+
position: 'fixed',
|
|
19388
|
+
left: optimalPosition.x,
|
|
19389
|
+
top: optimalPosition.y,
|
|
19390
|
+
zIndex: 1000
|
|
19391
|
+
};
|
|
18062
19392
|
return /*#__PURE__*/React.createElement(View, Object.assign({
|
|
18063
|
-
|
|
18064
|
-
|
|
19393
|
+
ref: contentRef,
|
|
19394
|
+
role: "menu",
|
|
19395
|
+
minWidth: "200px",
|
|
19396
|
+
backgroundColor: "color.white",
|
|
19397
|
+
borderRadius: 4,
|
|
19398
|
+
boxShadow: "0px 2px 8px rgba(0, 0, 0, 0.15)",
|
|
18065
19399
|
overflow: "hidden",
|
|
18066
|
-
|
|
18067
|
-
position: orientation === 'horizontal' ? 'absolute' : 'relative',
|
|
18068
|
-
backgroundColor: orientation === 'horizontal' ? 'white' : 'transparent',
|
|
18069
|
-
boxShadow: orientation === 'horizontal' ? '0 4px 6px rgba(0, 0, 0, 0.1)' : 'none',
|
|
18070
|
-
borderRadius: orientation === 'horizontal' ? '4px' : '0',
|
|
18071
|
-
zIndex: orientation === 'horizontal' ? 10 : 1
|
|
19400
|
+
style: positionStyles
|
|
18072
19401
|
}, views == null ? void 0 : views.container), children);
|
|
18073
19402
|
};
|
|
18074
19403
|
var NavigationMenuLink = _ref6 => {
|
|
@@ -18167,7 +19496,8 @@ var NavigationMenuComponent = _ref => {
|
|
|
18167
19496
|
setActiveItemId,
|
|
18168
19497
|
expandedItemIds,
|
|
18169
19498
|
toggleExpandedItem,
|
|
18170
|
-
isItemExpanded
|
|
19499
|
+
isItemExpanded,
|
|
19500
|
+
triggerRefs
|
|
18171
19501
|
} = useNavigationMenuState(defaultActiveItemId, defaultExpandedItemIds);
|
|
18172
19502
|
return /*#__PURE__*/React.createElement(NavigationMenuProvider, {
|
|
18173
19503
|
value: {
|
|
@@ -18179,7 +19509,8 @@ var NavigationMenuComponent = _ref => {
|
|
|
18179
19509
|
orientation,
|
|
18180
19510
|
size,
|
|
18181
19511
|
variant,
|
|
18182
|
-
onItemActivate
|
|
19512
|
+
onItemActivate,
|
|
19513
|
+
triggerRefs
|
|
18183
19514
|
}
|
|
18184
19515
|
}, items ? (/*#__PURE__*/React.createElement(NavigationMenuView, Object.assign({
|
|
18185
19516
|
items: items,
|
|
@@ -18235,16 +19566,24 @@ var useTableContext = () => useContext(TableContext);
|
|
|
18235
19566
|
*/
|
|
18236
19567
|
/**
|
|
18237
19568
|
* Default table styles following the design system
|
|
19569
|
+
* Matching shadcn/ui patterns with subtle shadows and transitions
|
|
18238
19570
|
*/
|
|
18239
19571
|
var DefaultTableStyles = {
|
|
18240
19572
|
table: {
|
|
18241
19573
|
width: '100%',
|
|
18242
19574
|
borderRadius: '8px',
|
|
18243
19575
|
overflow: 'hidden',
|
|
18244
|
-
boxShadow: '
|
|
19576
|
+
boxShadow: '0px 1px 3px rgba(0, 0, 0, 0.06), 0px 1px 2px rgba(0, 0, 0, 0.04)',
|
|
18245
19577
|
border: '1px solid',
|
|
18246
19578
|
borderColor: 'color.gray.200',
|
|
18247
|
-
transition: '
|
|
19579
|
+
transition: 'box-shadow 0.2s ease',
|
|
19580
|
+
media: {
|
|
19581
|
+
mobile: {
|
|
19582
|
+
overflowX: 'auto',
|
|
19583
|
+
display: 'block',
|
|
19584
|
+
borderRadius: '4px'
|
|
19585
|
+
}
|
|
19586
|
+
}
|
|
18248
19587
|
},
|
|
18249
19588
|
thead: {
|
|
18250
19589
|
backgroundColor: 'color.gray.50',
|
|
@@ -18256,18 +19595,35 @@ var DefaultTableStyles = {
|
|
|
18256
19595
|
fontWeight: '600',
|
|
18257
19596
|
fontSize: '14px',
|
|
18258
19597
|
color: 'color.gray.700',
|
|
18259
|
-
textAlign: 'left'
|
|
19598
|
+
textAlign: 'left',
|
|
19599
|
+
media: {
|
|
19600
|
+
mobile: {
|
|
19601
|
+
padding: '8px 12px',
|
|
19602
|
+
fontSize: '12px'
|
|
19603
|
+
}
|
|
19604
|
+
}
|
|
18260
19605
|
},
|
|
18261
19606
|
td: {
|
|
18262
19607
|
padding: '12px 16px',
|
|
18263
19608
|
fontSize: '14px',
|
|
18264
19609
|
borderBottom: '1px solid',
|
|
18265
|
-
borderBottomColor: 'color.gray.100'
|
|
19610
|
+
borderBottomColor: 'color.gray.100',
|
|
19611
|
+
color: 'color.gray.900',
|
|
19612
|
+
media: {
|
|
19613
|
+
mobile: {
|
|
19614
|
+
padding: '8px 12px',
|
|
19615
|
+
fontSize: '12px'
|
|
19616
|
+
}
|
|
19617
|
+
}
|
|
18266
19618
|
},
|
|
18267
19619
|
tr: {
|
|
18268
|
-
transition: 'background-color 0.
|
|
19620
|
+
transition: 'background-color 0.15s ease',
|
|
18269
19621
|
_hover: {
|
|
18270
19622
|
backgroundColor: 'color.gray.50'
|
|
19623
|
+
},
|
|
19624
|
+
_focus: {
|
|
19625
|
+
outline: 'none',
|
|
19626
|
+
backgroundColor: 'color.gray.100'
|
|
18271
19627
|
}
|
|
18272
19628
|
},
|
|
18273
19629
|
tfoot: {
|
|
@@ -18280,7 +19636,12 @@ var DefaultTableStyles = {
|
|
|
18280
19636
|
margin: '8px 0',
|
|
18281
19637
|
color: 'color.gray.600',
|
|
18282
19638
|
fontSize: '14px',
|
|
18283
|
-
fontStyle: 'italic'
|
|
19639
|
+
fontStyle: 'italic',
|
|
19640
|
+
media: {
|
|
19641
|
+
mobile: {
|
|
19642
|
+
fontSize: '12px'
|
|
19643
|
+
}
|
|
19644
|
+
}
|
|
18284
19645
|
}
|
|
18285
19646
|
};
|
|
18286
19647
|
|
|
@@ -19075,6 +20436,13 @@ var TitleView = _ref => {
|
|
|
19075
20436
|
};
|
|
19076
20437
|
var resolvedColor = resolveColorValue(highlightColor);
|
|
19077
20438
|
var resolvedSecondary = highlightSecondaryColor ? resolveColorValue(highlightSecondaryColor) : undefined;
|
|
20439
|
+
var baseHighlightProps = HighlightStyles[highlightStyle](resolvedColor, resolvedSecondary);
|
|
20440
|
+
var highlightViewProps = highlightStyle === 'background' ? Object.assign({}, baseHighlightProps, {
|
|
20441
|
+
color: undefined
|
|
20442
|
+
}) : baseHighlightProps;
|
|
20443
|
+
var highlightBackgroundOverrides = highlightStyle === 'background' ? {
|
|
20444
|
+
bgColor: resolvedColor
|
|
20445
|
+
} : {};
|
|
19078
20446
|
var {
|
|
19079
20447
|
finalDisplayedText,
|
|
19080
20448
|
activeHighlightTarget,
|
|
@@ -19143,7 +20511,7 @@ var TitleView = _ref => {
|
|
|
19143
20511
|
as: "span",
|
|
19144
20512
|
display: "inline",
|
|
19145
20513
|
animate: inView ? controlledHighlightAnimate : undefined
|
|
19146
|
-
},
|
|
20514
|
+
}, highlightViewProps, highlightBackgroundOverrides, views == null ? void 0 : views.highlight), highlightTypewriter ? (/*#__PURE__*/React.createElement(TypewriterEffect, {
|
|
19147
20515
|
text: part.text,
|
|
19148
20516
|
typingSpeed: Math.max(30, highlightTypewriterDuration / (part.text.length * 10)),
|
|
19149
20517
|
showCursor: true,
|
|
@@ -19167,7 +20535,7 @@ var TitleView = _ref => {
|
|
|
19167
20535
|
as: "span",
|
|
19168
20536
|
display: "inline",
|
|
19169
20537
|
animate: inView ? controlledHighlightAnimate : undefined
|
|
19170
|
-
},
|
|
20538
|
+
}, highlightViewProps, highlightBackgroundOverrides, views == null ? void 0 : views.highlight), highlightTypewriter ? (/*#__PURE__*/React.createElement(TypewriterEffect, {
|
|
19171
20539
|
text: text,
|
|
19172
20540
|
typingSpeed: Math.max(30, highlightTypewriterDuration / (text.length * 10)),
|
|
19173
20541
|
showCursor: true,
|
|
@@ -23508,19 +24876,43 @@ var PaginationSizes = {
|
|
|
23508
24876
|
fontSize: '12px',
|
|
23509
24877
|
padding: '4px 8px',
|
|
23510
24878
|
minWidth: '28px',
|
|
23511
|
-
height: '28px'
|
|
24879
|
+
height: '28px',
|
|
24880
|
+
media: {
|
|
24881
|
+
mobile: {
|
|
24882
|
+
fontSize: '11px',
|
|
24883
|
+
padding: '3px 6px',
|
|
24884
|
+
minWidth: '24px',
|
|
24885
|
+
height: '24px'
|
|
24886
|
+
}
|
|
24887
|
+
}
|
|
23512
24888
|
},
|
|
23513
24889
|
md: {
|
|
23514
24890
|
fontSize: '14px',
|
|
23515
24891
|
padding: '6px 12px',
|
|
23516
24892
|
minWidth: '36px',
|
|
23517
|
-
height: '36px'
|
|
24893
|
+
height: '36px',
|
|
24894
|
+
media: {
|
|
24895
|
+
mobile: {
|
|
24896
|
+
fontSize: '12px',
|
|
24897
|
+
padding: '4px 8px',
|
|
24898
|
+
minWidth: '28px',
|
|
24899
|
+
height: '28px'
|
|
24900
|
+
}
|
|
24901
|
+
}
|
|
23518
24902
|
},
|
|
23519
24903
|
lg: {
|
|
23520
24904
|
fontSize: '16px',
|
|
23521
24905
|
padding: '8px 16px',
|
|
23522
24906
|
minWidth: '44px',
|
|
23523
|
-
height: '44px'
|
|
24907
|
+
height: '44px',
|
|
24908
|
+
media: {
|
|
24909
|
+
mobile: {
|
|
24910
|
+
fontSize: '14px',
|
|
24911
|
+
padding: '6px 12px',
|
|
24912
|
+
minWidth: '36px',
|
|
24913
|
+
height: '36px'
|
|
24914
|
+
}
|
|
24915
|
+
}
|
|
23524
24916
|
}
|
|
23525
24917
|
};
|
|
23526
24918
|
var PaginationVariants = {
|
|
@@ -23852,16 +25244,23 @@ var SeparatorThicknesses = {
|
|
|
23852
25244
|
};
|
|
23853
25245
|
/**
|
|
23854
25246
|
* Default styles for the Separator component
|
|
25247
|
+
* Matching shadcn/ui patterns with subtle colors
|
|
23855
25248
|
*/
|
|
23856
25249
|
var DefaultSeparatorStyles = {
|
|
23857
25250
|
container: {
|
|
23858
|
-
transition: '
|
|
25251
|
+
transition: 'opacity 0.15s ease'
|
|
25252
|
+
},
|
|
25253
|
+
line: {
|
|
25254
|
+
backgroundColor: 'color.gray.200',
|
|
25255
|
+
transition: 'background-color 0.15s ease'
|
|
23859
25256
|
},
|
|
23860
25257
|
label: {
|
|
23861
25258
|
fontSize: '14px',
|
|
23862
|
-
|
|
25259
|
+
fontWeight: '500',
|
|
25260
|
+
color: 'color.gray.600',
|
|
23863
25261
|
paddingHorizontal: '8px',
|
|
23864
|
-
|
|
25262
|
+
backgroundColor: 'color.white',
|
|
25263
|
+
transition: 'color 0.15s ease'
|
|
23865
25264
|
}
|
|
23866
25265
|
};
|
|
23867
25266
|
|
|
@@ -24166,27 +25565,17 @@ var useSidebarState = function useSidebarState(defaultExpanded, expanded, onExpa
|
|
|
24166
25565
|
if (defaultExpanded === void 0) {
|
|
24167
25566
|
defaultExpanded = true;
|
|
24168
25567
|
}
|
|
25568
|
+
var {
|
|
25569
|
+
on
|
|
25570
|
+
} = useResponsive();
|
|
25571
|
+
var isMobile = on('mobile');
|
|
24169
25572
|
var [isExpanded, setIsExpanded] = useState(expanded !== undefined ? expanded : defaultExpanded);
|
|
24170
|
-
var [isMobile, setIsMobile] = useState(breakpoint ? window.innerWidth < breakpoint : false);
|
|
24171
25573
|
// Handle controlled expanded state
|
|
24172
25574
|
useEffect(() => {
|
|
24173
25575
|
if (expanded !== undefined) {
|
|
24174
25576
|
setIsExpanded(expanded);
|
|
24175
25577
|
}
|
|
24176
25578
|
}, [expanded]);
|
|
24177
|
-
// Handle window resize for responsive behavior
|
|
24178
|
-
useEffect(() => {
|
|
24179
|
-
if (!breakpoint) return;
|
|
24180
|
-
var handleResize = () => {
|
|
24181
|
-
var newIsMobile = window.innerWidth < breakpoint;
|
|
24182
|
-
setIsMobile(newIsMobile);
|
|
24183
|
-
};
|
|
24184
|
-
window.addEventListener('resize', handleResize);
|
|
24185
|
-
handleResize(); // Initial check
|
|
24186
|
-
return () => {
|
|
24187
|
-
window.removeEventListener('resize', handleResize);
|
|
24188
|
-
};
|
|
24189
|
-
}, [breakpoint]);
|
|
24190
25579
|
var toggleExpanded = () => {
|
|
24191
25580
|
var newExpanded = !isExpanded;
|
|
24192
25581
|
setIsExpanded(newExpanded);
|
|
@@ -24549,7 +25938,7 @@ var SidebarComponent = _ref => {
|
|
|
24549
25938
|
expand,
|
|
24550
25939
|
collapse,
|
|
24551
25940
|
isMobile
|
|
24552
|
-
} = useSidebarState(defaultExpanded, expanded, onExpandedChange
|
|
25941
|
+
} = useSidebarState(defaultExpanded, expanded, onExpandedChange);
|
|
24553
25942
|
return /*#__PURE__*/React.createElement(SidebarProvider, {
|
|
24554
25943
|
value: {
|
|
24555
25944
|
isExpanded,
|
|
@@ -25629,13 +27018,15 @@ var ToastView = _ref => {
|
|
|
25629
27018
|
fontWeight: "600" // Semi-bold for better readability
|
|
25630
27019
|
,
|
|
25631
27020
|
color: Theme[variant].content.color,
|
|
25632
|
-
lineHeight: "1.4"
|
|
27021
|
+
lineHeight: "1.4",
|
|
27022
|
+
bgColor: Theme[variant].container.backgroundColor
|
|
25633
27023
|
}, views == null ? void 0 : views.title), title), description && (/*#__PURE__*/React.createElement(Text, Object.assign({
|
|
25634
27024
|
size: "sm",
|
|
25635
27025
|
color: Theme[variant].content.color,
|
|
25636
27026
|
fontWeight: "400" // Regular weight
|
|
25637
27027
|
,
|
|
25638
|
-
lineHeight: "1.5"
|
|
27028
|
+
lineHeight: "1.5",
|
|
27029
|
+
bgColor: Theme[variant].container.backgroundColor
|
|
25639
27030
|
}, views == null ? void 0 : views.description), description)), action && actionText && (/*#__PURE__*/React.createElement(Text, Object.assign({
|
|
25640
27031
|
size: "sm",
|
|
25641
27032
|
fontWeight: "600" // Semi-bold for better readability
|
|
@@ -25644,6 +27035,7 @@ var ToastView = _ref => {
|
|
|
25644
27035
|
,
|
|
25645
27036
|
cursor: "pointer",
|
|
25646
27037
|
color: Theme[variant].content.color,
|
|
27038
|
+
bgColor: Theme[variant].container.backgroundColor,
|
|
25647
27039
|
onClick: e => {
|
|
25648
27040
|
e.stopPropagation();
|
|
25649
27041
|
action();
|
|
@@ -26448,19 +27840,28 @@ var TooltipSizes = {
|
|
|
26448
27840
|
var getTooltip = themeMode => {
|
|
26449
27841
|
return {
|
|
26450
27842
|
default: {
|
|
26451
|
-
backgroundColor: 'color.gray.
|
|
26452
|
-
color: 'color.white'
|
|
27843
|
+
backgroundColor: 'color.gray.900',
|
|
27844
|
+
color: 'color.white',
|
|
27845
|
+
borderRadius: '6px',
|
|
27846
|
+
boxShadow: '0px 4px 6px rgba(0, 0, 0, 0.1), 0px 2px 4px rgba(0, 0, 0, 0.06)',
|
|
27847
|
+
transition: 'opacity 0.15s ease'
|
|
26453
27848
|
},
|
|
26454
27849
|
light: {
|
|
26455
27850
|
backgroundColor: 'color.white',
|
|
26456
27851
|
color: 'color.gray.800',
|
|
26457
27852
|
borderWidth: '1px',
|
|
26458
27853
|
borderStyle: 'solid',
|
|
26459
|
-
borderColor: 'color.gray.200'
|
|
27854
|
+
borderColor: 'color.gray.200',
|
|
27855
|
+
borderRadius: '6px',
|
|
27856
|
+
boxShadow: '0px 4px 6px rgba(0, 0, 0, 0.08), 0px 2px 4px rgba(0, 0, 0, 0.04)',
|
|
27857
|
+
transition: 'opacity 0.15s ease'
|
|
26460
27858
|
},
|
|
26461
27859
|
dark: {
|
|
26462
|
-
backgroundColor: 'color.
|
|
26463
|
-
color: 'color.white'
|
|
27860
|
+
backgroundColor: 'color.gray.950',
|
|
27861
|
+
color: 'color.white',
|
|
27862
|
+
borderRadius: '6px',
|
|
27863
|
+
boxShadow: '0px 4px 6px rgba(0, 0, 0, 0.2), 0px 2px 4px rgba(0, 0, 0, 0.12)',
|
|
27864
|
+
transition: 'opacity 0.15s ease'
|
|
26464
27865
|
}
|
|
26465
27866
|
};
|
|
26466
27867
|
// Add dark mode conditional styling here
|