@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
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('core-js/modules/es.object.assign.js'), require('react'), require('core-js/modules/es.array.includes.js'), require('core-js/modules/es.array.iterator.js'), require('core-js/modules/es.string.includes.js'), require('core-js/modules/web.dom-collections.iterator.js'), require('core-js/modules/es.regexp.to-string.js'), require('app-studio'), require('core-js/modules/es.symbol.description.js'), require('core-js/modules/es.parse-float.js'), require('core-js/modules/es.string.trim-end.js'), require('core-js/modules/es.parse-int.js'), require('core-js/modules/es.regexp.exec.js'), require('core-js/modules/es.string.
|
|
3
|
-
typeof define === 'function' && define.amd ? define(['exports', 'core-js/modules/es.object.assign.js', 'react', 'core-js/modules/es.array.includes.js', 'core-js/modules/es.array.iterator.js', 'core-js/modules/es.string.includes.js', 'core-js/modules/web.dom-collections.iterator.js', 'core-js/modules/es.regexp.to-string.js', 'app-studio', 'core-js/modules/es.symbol.description.js', 'core-js/modules/es.parse-float.js', 'core-js/modules/es.string.trim-end.js', 'core-js/modules/es.parse-int.js', 'core-js/modules/es.regexp.exec.js', 'core-js/modules/es.string.
|
|
4
|
-
(global = global || self, factory(global['@app-studio/web'] = {}, null, global.React, null, null, null, null, null, global.appStudio, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, global.zustand, global.reactRouterDom, null, global.contrast, null, null, null, null, null, global.
|
|
5
|
-
}(this, (function (exports, es_object_assign_js, React, es_array_includes_js, es_array_iterator_js, es_string_includes_js, web_domCollections_iterator_js, es_regexp_toString_js, appStudio, es_symbol_description_js, es_parseFloat_js, es_string_trimEnd_js, es_parseInt_js, es_regexp_exec_js,
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('core-js/modules/es.object.assign.js'), require('react'), require('core-js/modules/es.array.includes.js'), require('core-js/modules/es.array.iterator.js'), require('core-js/modules/es.string.includes.js'), require('core-js/modules/web.dom-collections.iterator.js'), require('core-js/modules/es.regexp.to-string.js'), require('app-studio'), require('core-js/modules/es.symbol.description.js'), require('core-js/modules/es.parse-float.js'), require('core-js/modules/es.string.trim-end.js'), require('core-js/modules/es.parse-int.js'), require('core-js/modules/es.regexp.exec.js'), require('core-js/modules/es.string.replace.js'), require('core-js/modules/es.string.starts-with.js'), require('core-js/modules/es.string.trim.js'), require('core-js/modules/es.array-buffer.constructor.js'), require('core-js/modules/es.array-buffer.slice.js'), require('core-js/modules/es.typed-array.uint8-array.js'), require('core-js/modules/es.typed-array.fill.js'), require('core-js/modules/es.typed-array.set.js'), require('core-js/modules/es.typed-array.sort.js'), require('core-js/modules/es.typed-array.to-locale-string.js'), require('core-js/modules/web.url.js'), require('core-js/modules/web.url.to-json.js'), require('core-js/modules/web.url-search-params.js'), require('zustand'), require('react-router-dom'), require('core-js/modules/es.string.ends-with.js'), require('contrast'), require('core-js/modules/es.promise.js'), require('core-js/modules/es.array.reduce.js'), require('core-js/modules/es.number.to-fixed.js'), require('core-js/modules/es.array.sort.js'), require('core-js/modules/es.string.pad-start.js'), require('date-fns/format'), require('core-js/modules/es.regexp.constructor.js'), require('formik'), require('src/services/api'), require('core-js/modules/es.promise.finally.js'), require('core-js/modules/es.string.match.js'), require('core-js/modules/es.string.search.js'), require('core-js/modules/es.array.flat-map.js'), require('core-js/modules/es.array.unscopables.flat-map.js')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define(['exports', 'core-js/modules/es.object.assign.js', 'react', 'core-js/modules/es.array.includes.js', 'core-js/modules/es.array.iterator.js', 'core-js/modules/es.string.includes.js', 'core-js/modules/web.dom-collections.iterator.js', 'core-js/modules/es.regexp.to-string.js', 'app-studio', 'core-js/modules/es.symbol.description.js', 'core-js/modules/es.parse-float.js', 'core-js/modules/es.string.trim-end.js', 'core-js/modules/es.parse-int.js', 'core-js/modules/es.regexp.exec.js', 'core-js/modules/es.string.replace.js', 'core-js/modules/es.string.starts-with.js', 'core-js/modules/es.string.trim.js', 'core-js/modules/es.array-buffer.constructor.js', 'core-js/modules/es.array-buffer.slice.js', 'core-js/modules/es.typed-array.uint8-array.js', 'core-js/modules/es.typed-array.fill.js', 'core-js/modules/es.typed-array.set.js', 'core-js/modules/es.typed-array.sort.js', 'core-js/modules/es.typed-array.to-locale-string.js', 'core-js/modules/web.url.js', 'core-js/modules/web.url.to-json.js', 'core-js/modules/web.url-search-params.js', 'zustand', 'react-router-dom', 'core-js/modules/es.string.ends-with.js', 'contrast', 'core-js/modules/es.promise.js', 'core-js/modules/es.array.reduce.js', 'core-js/modules/es.number.to-fixed.js', 'core-js/modules/es.array.sort.js', 'core-js/modules/es.string.pad-start.js', 'date-fns/format', 'core-js/modules/es.regexp.constructor.js', 'formik', 'src/services/api', 'core-js/modules/es.promise.finally.js', 'core-js/modules/es.string.match.js', 'core-js/modules/es.string.search.js', 'core-js/modules/es.array.flat-map.js', 'core-js/modules/es.array.unscopables.flat-map.js'], factory) :
|
|
4
|
+
(global = global || self, factory(global['@app-studio/web'] = {}, null, global.React, null, null, null, null, null, global.appStudio, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, global.zustand, global.reactRouterDom, null, global.contrast, null, null, null, null, null, global.format, null, global.formik, global.api));
|
|
5
|
+
}(this, (function (exports, es_object_assign_js, React, es_array_includes_js, es_array_iterator_js, es_string_includes_js, web_domCollections_iterator_js, es_regexp_toString_js, appStudio, es_symbol_description_js, es_parseFloat_js, es_string_trimEnd_js, es_parseInt_js, es_regexp_exec_js, es_string_replace_js, es_string_startsWith_js, es_string_trim_js, es_arrayBuffer_constructor_js, es_arrayBuffer_slice_js, es_typedArray_uint8Array_js, es_typedArray_fill_js, es_typedArray_set_js, es_typedArray_sort_js, es_typedArray_toLocaleString_js, web_url_js, web_url_toJson_js, web_urlSearchParams_js, zustand, reactRouterDom, es_string_endsWith_js, contrast, es_promise_js, es_array_reduce_js, es_number_toFixed_js, es_array_sort_js, es_string_padStart_js, format, es_regexp_constructor_js, formik, api) { 'use strict';
|
|
6
6
|
|
|
7
7
|
var React__default = 'default' in React ? React['default'] : React;
|
|
8
8
|
contrast = contrast && Object.prototype.hasOwnProperty.call(contrast, 'default') ? contrast['default'] : contrast;
|
|
@@ -154,15 +154,24 @@
|
|
|
154
154
|
var AccordionVariants = {
|
|
155
155
|
default: {
|
|
156
156
|
backgroundColor: 'transparent',
|
|
157
|
-
borderWidth: 0
|
|
157
|
+
borderWidth: 0,
|
|
158
|
+
transition: 'background-color 0.15s ease'
|
|
158
159
|
},
|
|
159
160
|
outline: {
|
|
160
161
|
borderWidth: 1,
|
|
161
162
|
borderStyle: 'solid',
|
|
162
|
-
borderColor: 'color.gray.200'
|
|
163
|
+
borderColor: 'color.gray.200',
|
|
164
|
+
transition: 'border-color 0.15s ease, background-color 0.15s ease',
|
|
165
|
+
_hover: {
|
|
166
|
+
borderColor: 'color.gray.300'
|
|
167
|
+
}
|
|
163
168
|
},
|
|
164
169
|
filled: {
|
|
165
|
-
backgroundColor: 'color.gray.50'
|
|
170
|
+
backgroundColor: 'color.gray.50',
|
|
171
|
+
transition: 'background-color 0.15s ease',
|
|
172
|
+
_hover: {
|
|
173
|
+
backgroundColor: 'color.gray.100'
|
|
174
|
+
}
|
|
166
175
|
}
|
|
167
176
|
};
|
|
168
177
|
|
|
@@ -415,6 +424,7 @@
|
|
|
415
424
|
*/
|
|
416
425
|
/**
|
|
417
426
|
* Heading sizes following typography guidelines
|
|
427
|
+
* Matching shadcn/ui typography patterns
|
|
418
428
|
*/
|
|
419
429
|
var HeadingSizes = {
|
|
420
430
|
h1: {
|
|
@@ -422,42 +432,54 @@
|
|
|
422
432
|
lineHeight: '40px',
|
|
423
433
|
fontWeight: '700',
|
|
424
434
|
letterSpacing: '-0.02em',
|
|
425
|
-
marginBottom: '24px'
|
|
435
|
+
marginBottom: '24px',
|
|
436
|
+
color: 'color.gray.900',
|
|
437
|
+
transition: 'color 0.15s ease'
|
|
426
438
|
},
|
|
427
439
|
h2: {
|
|
428
440
|
fontSize: '30px',
|
|
429
441
|
lineHeight: '36px',
|
|
430
442
|
fontWeight: '700',
|
|
431
443
|
letterSpacing: '-0.02em',
|
|
432
|
-
marginBottom: '20px'
|
|
444
|
+
marginBottom: '20px',
|
|
445
|
+
color: 'color.gray.900',
|
|
446
|
+
transition: 'color 0.15s ease'
|
|
433
447
|
},
|
|
434
448
|
h3: {
|
|
435
449
|
fontSize: '24px',
|
|
436
450
|
lineHeight: '32px',
|
|
437
451
|
fontWeight: '600',
|
|
438
452
|
letterSpacing: '-0.01em',
|
|
439
|
-
marginBottom: '16px'
|
|
453
|
+
marginBottom: '16px',
|
|
454
|
+
color: 'color.gray.900',
|
|
455
|
+
transition: 'color 0.15s ease'
|
|
440
456
|
},
|
|
441
457
|
h4: {
|
|
442
458
|
fontSize: '20px',
|
|
443
459
|
lineHeight: '28px',
|
|
444
460
|
fontWeight: '600',
|
|
445
461
|
letterSpacing: '-0.01em',
|
|
446
|
-
marginBottom: '16px'
|
|
462
|
+
marginBottom: '16px',
|
|
463
|
+
color: 'color.gray.900',
|
|
464
|
+
transition: 'color 0.15s ease'
|
|
447
465
|
},
|
|
448
466
|
h5: {
|
|
449
467
|
fontSize: '18px',
|
|
450
468
|
lineHeight: '24px',
|
|
451
469
|
fontWeight: '600',
|
|
452
470
|
letterSpacing: '-0.01em',
|
|
453
|
-
marginBottom: '12px'
|
|
471
|
+
marginBottom: '12px',
|
|
472
|
+
color: 'color.gray.900',
|
|
473
|
+
transition: 'color 0.15s ease'
|
|
454
474
|
},
|
|
455
475
|
h6: {
|
|
456
476
|
fontSize: '16px',
|
|
457
477
|
lineHeight: '24px',
|
|
458
478
|
fontWeight: '600',
|
|
459
479
|
letterSpacing: '-0.01em',
|
|
460
|
-
marginBottom: '8px'
|
|
480
|
+
marginBottom: '8px',
|
|
481
|
+
color: 'color.gray.900',
|
|
482
|
+
transition: 'color 0.15s ease'
|
|
461
483
|
}
|
|
462
484
|
};
|
|
463
485
|
/**
|
|
@@ -495,31 +517,40 @@
|
|
|
495
517
|
black: '900'
|
|
496
518
|
};
|
|
497
519
|
|
|
520
|
+
var normalizeHexColor = backgroundColor => {
|
|
521
|
+
if (!backgroundColor) {
|
|
522
|
+
return null;
|
|
523
|
+
}
|
|
524
|
+
var trimmed = backgroundColor.trim();
|
|
525
|
+
var withoutHash = trimmed.startsWith('#') ? trimmed.slice(1) : trimmed;
|
|
526
|
+
if (withoutHash.length === 3) {
|
|
527
|
+
if (!/^[0-9a-fA-F]{3}$/.test(withoutHash)) {
|
|
528
|
+
return null;
|
|
529
|
+
}
|
|
530
|
+
return "#" + withoutHash.split('').map(char => char + char).join('');
|
|
531
|
+
}
|
|
532
|
+
if (!/^[0-9a-fA-F]{6}$/.test(withoutHash)) {
|
|
533
|
+
return null;
|
|
534
|
+
}
|
|
535
|
+
return "#" + withoutHash.toLowerCase();
|
|
536
|
+
};
|
|
498
537
|
var getTextColorHex = backgroundColor => {
|
|
538
|
+
var normalized = normalizeHexColor(backgroundColor);
|
|
539
|
+
if (!normalized) {
|
|
540
|
+
return 'black';
|
|
541
|
+
}
|
|
499
542
|
// Simple luminance calculation to determine text color contrast
|
|
500
|
-
var color =
|
|
543
|
+
var color = normalized.replace('#', '');
|
|
501
544
|
var r = parseInt(color.substring(0, 2), 16);
|
|
502
545
|
var g = parseInt(color.substring(2, 4), 16);
|
|
503
546
|
var b = parseInt(color.substring(4, 6), 16);
|
|
504
547
|
var luminance = (0.299 * r + 0.587 * g + 0.114 * b) / 255;
|
|
505
548
|
return luminance > 0.4 ? 'black' : 'white';
|
|
506
549
|
};
|
|
507
|
-
var getTextColor = backgroundColor =>
|
|
508
|
-
// Use complementary color for better contrast and return as hex
|
|
509
|
-
var color = backgroundColor.replace('#', '');
|
|
510
|
-
var r = parseInt(color.substring(0, 2), 16);
|
|
511
|
-
var g = parseInt(color.substring(2, 4), 16);
|
|
512
|
-
var b = parseInt(color.substring(4, 6), 16);
|
|
513
|
-
// Calculate the complementary color
|
|
514
|
-
var complementR = (255 - r).toString(16).padStart(2, '0');
|
|
515
|
-
var complementG = (255 - g).toString(16).padStart(2, '0');
|
|
516
|
-
var complementB = (255 - b).toString(16).padStart(2, '0');
|
|
517
|
-
// Return the color in hex format
|
|
518
|
-
return getTextColorHex("#" + complementR + complementG + complementB);
|
|
519
|
-
};
|
|
550
|
+
var getTextColor = backgroundColor => getTextColorHex(backgroundColor);
|
|
520
551
|
|
|
521
552
|
var _excluded$2 = ["text", "maxLines", "views"],
|
|
522
|
-
_excluded2$1 = ["children", "heading", "maxLines", "isItalic", "isUnderlined", "isSub", "isSup", "isStriked", "weight", "size", "bgColor", "color", "views"];
|
|
553
|
+
_excluded2$1 = ["children", "heading", "maxLines", "isItalic", "isUnderlined", "isSub", "isSup", "isStriked", "weight", "size", "bgColor", "backgroundColor", "color", "views"];
|
|
523
554
|
/**
|
|
524
555
|
* Renders text content with support for subscript and superscript
|
|
525
556
|
*/
|
|
@@ -623,6 +654,7 @@
|
|
|
623
654
|
* Main Text component that renders text with various styles and states
|
|
624
655
|
*/
|
|
625
656
|
var TextView = _ref3 => {
|
|
657
|
+
var _views$container, _ref4;
|
|
626
658
|
var {
|
|
627
659
|
children,
|
|
628
660
|
heading,
|
|
@@ -635,6 +667,7 @@
|
|
|
635
667
|
weight = 'normal',
|
|
636
668
|
size = 'md',
|
|
637
669
|
bgColor,
|
|
670
|
+
backgroundColor: backgroundColorProp,
|
|
638
671
|
color,
|
|
639
672
|
views
|
|
640
673
|
} = _ref3,
|
|
@@ -649,7 +682,9 @@
|
|
|
649
682
|
var fontSize = FontSizes[size];
|
|
650
683
|
var lineHeight = LineHeights[size];
|
|
651
684
|
var fontWeight = FontWeights[weight];
|
|
652
|
-
var
|
|
685
|
+
var containerBackgroundColor = views == null || (_views$container = views.container) == null ? void 0 : _views$container.backgroundColor;
|
|
686
|
+
var effectiveBackgroundColor = (_ref4 = bgColor != null ? bgColor : backgroundColorProp) != null ? _ref4 : containerBackgroundColor;
|
|
687
|
+
var computedColor = color != null ? color : effectiveBackgroundColor ? getTextColor(effectiveBackgroundColor) : undefined;
|
|
653
688
|
return /*#__PURE__*/React__default.createElement(appStudio.Element
|
|
654
689
|
// Apply typography styles according to design guidelines
|
|
655
690
|
, Object.assign({
|
|
@@ -660,7 +695,8 @@
|
|
|
660
695
|
fontWeight: fontWeight,
|
|
661
696
|
letterSpacing: "-0.01em",
|
|
662
697
|
textDecoration: isStriked ? 'line-through' : isUnderlined ? 'underline' : 'none',
|
|
663
|
-
color: computedColor
|
|
698
|
+
color: computedColor,
|
|
699
|
+
backgroundColor: effectiveBackgroundColor
|
|
664
700
|
}, noLineBreak, headingStyles, props, views == null ? void 0 : views.container), maxLines && typeof children === 'string' ? (/*#__PURE__*/React__default.createElement(TruncateText, {
|
|
665
701
|
text: children,
|
|
666
702
|
maxLines: maxLines
|
|
@@ -3321,13 +3357,15 @@
|
|
|
3321
3357
|
fontWeight: "600" // Semi-bold
|
|
3322
3358
|
,
|
|
3323
3359
|
lineHeight: "24px",
|
|
3324
|
-
color: themes[variant].content.color
|
|
3360
|
+
color: themes[variant].content.color,
|
|
3361
|
+
bgColor: themes[variant].container.backgroundColor
|
|
3325
3362
|
}, views == null ? void 0 : views.title), title), /*#__PURE__*/React__default.createElement(Text, Object.assign({
|
|
3326
3363
|
fontSize: "14px",
|
|
3327
3364
|
fontWeight: "400" // Regular
|
|
3328
3365
|
,
|
|
3329
3366
|
lineHeight: "20px",
|
|
3330
|
-
color: themes[variant].content.color
|
|
3367
|
+
color: themes[variant].content.color,
|
|
3368
|
+
bgColor: themes[variant].container.backgroundColor
|
|
3331
3369
|
}, views == null ? void 0 : views.description), description || children)));
|
|
3332
3370
|
};
|
|
3333
3371
|
|
|
@@ -3649,14 +3687,17 @@
|
|
|
3649
3687
|
width: "100%"
|
|
3650
3688
|
}, /*#__PURE__*/React__default.createElement(Text, Object.assign({
|
|
3651
3689
|
size: "md",
|
|
3652
|
-
weight: "semiBold"
|
|
3690
|
+
weight: "semiBold",
|
|
3691
|
+
bgColor: Theme[variant].container.backgroundColor
|
|
3653
3692
|
}, views == null ? void 0 : views.title), title), subtitle && (/*#__PURE__*/React__default.createElement(Text, Object.assign({
|
|
3654
|
-
size: "sm"
|
|
3693
|
+
size: "sm",
|
|
3694
|
+
bgColor: Theme[variant].container.backgroundColor
|
|
3655
3695
|
}, views == null ? void 0 : views.subtitle), subtitle))), showAction && (/*#__PURE__*/React__default.createElement(Text, Object.assign({
|
|
3656
3696
|
marginRight: 10,
|
|
3657
3697
|
onClick: action,
|
|
3658
3698
|
padding: "6px 10px",
|
|
3659
|
-
whiteSpace: "nowrap"
|
|
3699
|
+
whiteSpace: "nowrap",
|
|
3700
|
+
bgColor: Theme[variant].container.backgroundColor
|
|
3660
3701
|
}, containerStyle, views == null ? void 0 : views.actionText), actionText)), isClosable && (/*#__PURE__*/React__default.createElement(appStudio.View, Object.assign({
|
|
3661
3702
|
position: "absolute",
|
|
3662
3703
|
zIndex: 10000,
|
|
@@ -4754,7 +4795,8 @@
|
|
|
4754
4795
|
,
|
|
4755
4796
|
textAlign: "center"
|
|
4756
4797
|
}, views == null ? void 0 : views.text, {
|
|
4757
|
-
color: combinedStyles.color
|
|
4798
|
+
color: combinedStyles.color,
|
|
4799
|
+
bgColor: combinedStyles.backgroundColor
|
|
4758
4800
|
}), content || ''));
|
|
4759
4801
|
};
|
|
4760
4802
|
|
|
@@ -4804,9 +4846,18 @@
|
|
|
4804
4846
|
} = _ref,
|
|
4805
4847
|
props = _objectWithoutPropertiesLoose(_ref, _excluded$c);
|
|
4806
4848
|
// Function to handle mouse enter/leave events to toggle hover state.
|
|
4807
|
-
var
|
|
4849
|
+
var handleMouseEnter = () => {
|
|
4808
4850
|
if (underline === 'hover') setIsHovered(true);
|
|
4809
4851
|
};
|
|
4852
|
+
var handleMouseLeave = () => {
|
|
4853
|
+
if (underline === 'hover') setIsHovered(false);
|
|
4854
|
+
};
|
|
4855
|
+
// Determine text decoration based on underline prop and hover state
|
|
4856
|
+
var getTextDecoration = () => {
|
|
4857
|
+
if (underline === 'underline') return 'underline';
|
|
4858
|
+
if (underline === 'hover' && isHovered) return 'underline';
|
|
4859
|
+
return 'none';
|
|
4860
|
+
};
|
|
4810
4861
|
return /*#__PURE__*/React__default.createElement(reactRouterDom.Link, {
|
|
4811
4862
|
to: to,
|
|
4812
4863
|
target: isExternal ? '_blank' : '_self',
|
|
@@ -4815,12 +4866,12 @@
|
|
|
4815
4866
|
color: 'inherit'
|
|
4816
4867
|
}
|
|
4817
4868
|
}, /*#__PURE__*/React__default.createElement(appStudio.Horizontal, Object.assign({
|
|
4818
|
-
onMouseEnter:
|
|
4819
|
-
onMouseLeave:
|
|
4869
|
+
onMouseEnter: handleMouseEnter,
|
|
4870
|
+
onMouseLeave: handleMouseLeave,
|
|
4820
4871
|
gap: 3,
|
|
4821
4872
|
alignItems: "center",
|
|
4822
4873
|
flexWrap: "nowrap",
|
|
4823
|
-
textDecoration:
|
|
4874
|
+
textDecoration: getTextDecoration()
|
|
4824
4875
|
}, views.text, props), children, isExternal && /*#__PURE__*/React__default.createElement(ExternalLinkIcon, {
|
|
4825
4876
|
widthHeight: IconSizes[iconSize]
|
|
4826
4877
|
})));
|
|
@@ -5150,18 +5201,16 @@
|
|
|
5150
5201
|
borderStyle: 'solid',
|
|
5151
5202
|
borderColor: 'transparent',
|
|
5152
5203
|
_hover: {
|
|
5153
|
-
|
|
5154
|
-
textDecoration: 'underline',
|
|
5155
|
-
textUnderlineOffset: '1px',
|
|
5156
|
-
textDecorationThickness: '1px'
|
|
5204
|
+
opacity: 0.9
|
|
5157
5205
|
},
|
|
5158
5206
|
_active: {
|
|
5159
|
-
|
|
5160
|
-
textDecoration: 'underline',
|
|
5161
|
-
textUnderlineOffset: '1px',
|
|
5162
|
-
textDecorationThickness: '1px'
|
|
5207
|
+
opacity: 0.95
|
|
5163
5208
|
},
|
|
5164
|
-
|
|
5209
|
+
_focusVisible: {
|
|
5210
|
+
outline: 'none',
|
|
5211
|
+
boxShadow: "0 0 0 2px rgba(255, 255, 255, 1), 0 0 0 4px " + color
|
|
5212
|
+
},
|
|
5213
|
+
transition: 'background-color 0.2s ease, opacity 0.2s ease'
|
|
5165
5214
|
},
|
|
5166
5215
|
outline: {
|
|
5167
5216
|
backgroundColor: 'transparent',
|
|
@@ -5171,21 +5220,19 @@
|
|
|
5171
5220
|
borderColor: color,
|
|
5172
5221
|
_hover: {
|
|
5173
5222
|
backgroundColor: color,
|
|
5174
|
-
color: isLight ? '
|
|
5175
|
-
|
|
5176
|
-
textDecoration: 'underline',
|
|
5177
|
-
textUnderlineOffset: '1px',
|
|
5178
|
-
textDecorationThickness: '1px'
|
|
5223
|
+
color: isLight ? 'color.black' : 'color.white',
|
|
5224
|
+
opacity: 0.9
|
|
5179
5225
|
},
|
|
5180
5226
|
_active: {
|
|
5181
5227
|
backgroundColor: color,
|
|
5182
|
-
color: isLight ? '
|
|
5183
|
-
|
|
5184
|
-
textDecoration: 'underline',
|
|
5185
|
-
textUnderlineOffset: '1px',
|
|
5186
|
-
textDecorationThickness: '1px'
|
|
5228
|
+
color: isLight ? 'color.black' : 'color.white',
|
|
5229
|
+
opacity: 0.95
|
|
5187
5230
|
},
|
|
5188
|
-
|
|
5231
|
+
_focusVisible: {
|
|
5232
|
+
outline: 'none',
|
|
5233
|
+
boxShadow: "0 0 0 2px rgba(255, 255, 255, 1), 0 0 0 4px " + color
|
|
5234
|
+
},
|
|
5235
|
+
transition: 'background-color 0.2s ease, color 0.2s ease, opacity 0.2s ease'
|
|
5189
5236
|
},
|
|
5190
5237
|
ghost: {
|
|
5191
5238
|
backgroundColor: 'transparent',
|
|
@@ -5194,39 +5241,39 @@
|
|
|
5194
5241
|
borderStyle: 'none',
|
|
5195
5242
|
borderColor: 'transparent',
|
|
5196
5243
|
_hover: {
|
|
5197
|
-
backgroundColor: color,
|
|
5198
|
-
|
|
5199
|
-
transform: 'translateY(-1px)',
|
|
5200
|
-
textDecoration: 'underline',
|
|
5201
|
-
textUnderlineOffset: '1px',
|
|
5202
|
-
textDecorationThickness: '1px'
|
|
5244
|
+
backgroundColor: isLight ? 'color.gray.100' : 'color.gray.800',
|
|
5245
|
+
opacity: 0.9
|
|
5203
5246
|
},
|
|
5204
5247
|
_active: {
|
|
5205
|
-
backgroundColor: color,
|
|
5206
|
-
|
|
5207
|
-
transform: 'translateY(0)',
|
|
5208
|
-
textDecoration: 'underline',
|
|
5209
|
-
textUnderlineOffset: '1px',
|
|
5210
|
-
textDecorationThickness: '1px'
|
|
5248
|
+
backgroundColor: isLight ? 'color.gray.200' : 'color.gray.700',
|
|
5249
|
+
opacity: 0.95
|
|
5211
5250
|
},
|
|
5212
|
-
|
|
5251
|
+
_focusVisible: {
|
|
5252
|
+
outline: 'none',
|
|
5253
|
+
boxShadow: "0 0 0 2px rgba(255, 255, 255, 1), 0 0 0 4px " + color
|
|
5254
|
+
},
|
|
5255
|
+
transition: 'background-color 0.2s ease, opacity 0.2s ease'
|
|
5213
5256
|
},
|
|
5214
5257
|
link: {
|
|
5215
5258
|
backgroundColor: 'transparent',
|
|
5216
|
-
color: isLight ? color : '
|
|
5259
|
+
color: isLight ? color : 'color.black',
|
|
5217
5260
|
borderWidth: 0,
|
|
5218
5261
|
borderStyle: 'none',
|
|
5219
5262
|
borderColor: 'transparent',
|
|
5220
5263
|
textDecoration: 'underline',
|
|
5221
|
-
textUnderlineOffset: '
|
|
5264
|
+
textUnderlineOffset: '2px',
|
|
5222
5265
|
textDecorationThickness: '1px',
|
|
5223
5266
|
_hover: {
|
|
5224
|
-
|
|
5267
|
+
opacity: 0.8
|
|
5225
5268
|
},
|
|
5226
5269
|
_active: {
|
|
5227
|
-
|
|
5270
|
+
opacity: 0.9
|
|
5228
5271
|
},
|
|
5229
|
-
|
|
5272
|
+
_focusVisible: {
|
|
5273
|
+
outline: 'none',
|
|
5274
|
+
boxShadow: "0 0 0 2px rgba(255, 255, 255, 1), 0 0 0 4px " + color
|
|
5275
|
+
},
|
|
5276
|
+
transition: 'opacity 0.2s ease'
|
|
5230
5277
|
},
|
|
5231
5278
|
borderMoving: {
|
|
5232
5279
|
position: 'relative',
|
|
@@ -5235,7 +5282,12 @@
|
|
|
5235
5282
|
color: 'white',
|
|
5236
5283
|
borderWidth: 0,
|
|
5237
5284
|
borderStyle: 'none',
|
|
5238
|
-
borderColor: 'transparent'
|
|
5285
|
+
borderColor: 'transparent',
|
|
5286
|
+
_focusVisible: {
|
|
5287
|
+
outline: 'none',
|
|
5288
|
+
boxShadow: '0 0 0 2px rgba(255, 255, 255, 1), 0 0 0 4px rgba(0, 0, 0, 0.8)'
|
|
5289
|
+
},
|
|
5290
|
+
transition: 'opacity 0.2s ease'
|
|
5239
5291
|
},
|
|
5240
5292
|
animatedStroke: {
|
|
5241
5293
|
display: 'inline-block',
|
|
@@ -5248,7 +5300,12 @@
|
|
|
5248
5300
|
backgroundColor: 'transparent',
|
|
5249
5301
|
borderWidth: 0,
|
|
5250
5302
|
borderStyle: 'none',
|
|
5251
|
-
borderColor: 'transparent'
|
|
5303
|
+
borderColor: 'transparent',
|
|
5304
|
+
_focusVisible: {
|
|
5305
|
+
outline: 'none',
|
|
5306
|
+
boxShadow: "0 0 0 2px rgba(255, 255, 255, 1), 0 0 0 4px " + color
|
|
5307
|
+
},
|
|
5308
|
+
transition: 'opacity 0.2s ease'
|
|
5252
5309
|
}
|
|
5253
5310
|
});
|
|
5254
5311
|
/**
|
|
@@ -5586,26 +5643,34 @@
|
|
|
5586
5643
|
default: {
|
|
5587
5644
|
backgroundColor: 'color.white',
|
|
5588
5645
|
border: 'none',
|
|
5589
|
-
transition: '
|
|
5646
|
+
transition: 'background-color 0.2s ease, box-shadow 0.2s ease'
|
|
5590
5647
|
},
|
|
5591
5648
|
outlined: {
|
|
5592
5649
|
backgroundColor: 'color.white',
|
|
5593
5650
|
borderWidth: '1px',
|
|
5594
5651
|
borderStyle: 'solid',
|
|
5595
5652
|
borderColor: 'color.gray.200',
|
|
5596
|
-
transition: '
|
|
5653
|
+
transition: 'border-color 0.2s ease, box-shadow 0.2s ease',
|
|
5597
5654
|
_hover: {
|
|
5598
|
-
borderColor: 'color.gray.300'
|
|
5655
|
+
borderColor: 'color.gray.300',
|
|
5656
|
+
boxShadow: '0px 1px 3px rgba(0, 0, 0, 0.05)'
|
|
5657
|
+
},
|
|
5658
|
+
_focusVisible: {
|
|
5659
|
+
outline: 'none',
|
|
5660
|
+
boxShadow: '0 0 0 2px rgba(255, 255, 255, 1), 0 0 0 4px rgba(0, 0, 0, 0.1)'
|
|
5599
5661
|
}
|
|
5600
5662
|
},
|
|
5601
5663
|
elevated: {
|
|
5602
5664
|
backgroundColor: 'color.white',
|
|
5603
|
-
boxShadow: '0px
|
|
5665
|
+
boxShadow: '0px 1px 3px rgba(0, 0, 0, 0.08), 0px 1px 2px rgba(0, 0, 0, 0.06)',
|
|
5604
5666
|
border: 'none',
|
|
5605
|
-
transition: '
|
|
5667
|
+
transition: 'box-shadow 0.2s ease',
|
|
5606
5668
|
_hover: {
|
|
5607
|
-
boxShadow: '0px 4px
|
|
5608
|
-
|
|
5669
|
+
boxShadow: '0px 4px 6px rgba(0, 0, 0, 0.08), 0px 2px 4px rgba(0, 0, 0, 0.06)'
|
|
5670
|
+
},
|
|
5671
|
+
_focusVisible: {
|
|
5672
|
+
outline: 'none',
|
|
5673
|
+
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)'
|
|
5609
5674
|
}
|
|
5610
5675
|
}
|
|
5611
5676
|
};
|
|
@@ -5621,24 +5686,44 @@
|
|
|
5621
5686
|
color: 'color.black',
|
|
5622
5687
|
borderRadius: '8px',
|
|
5623
5688
|
overflow: 'hidden',
|
|
5624
|
-
transition: 'all 0.2s ease'
|
|
5689
|
+
transition: 'all 0.2s ease',
|
|
5690
|
+
media: {
|
|
5691
|
+
mobile: {
|
|
5692
|
+
borderRadius: '4px'
|
|
5693
|
+
}
|
|
5694
|
+
}
|
|
5625
5695
|
},
|
|
5626
5696
|
header: {
|
|
5627
5697
|
padding: '16px',
|
|
5628
5698
|
borderBottomWidth: '1px',
|
|
5629
5699
|
borderBottomStyle: 'solid',
|
|
5630
5700
|
borderBottomColor: 'color.gray.200',
|
|
5631
|
-
color: 'color.black'
|
|
5701
|
+
color: 'color.black',
|
|
5702
|
+
media: {
|
|
5703
|
+
mobile: {
|
|
5704
|
+
padding: '12px'
|
|
5705
|
+
}
|
|
5706
|
+
}
|
|
5632
5707
|
},
|
|
5633
5708
|
content: {
|
|
5634
5709
|
padding: '16px',
|
|
5635
|
-
color: 'color.black'
|
|
5710
|
+
color: 'color.black',
|
|
5711
|
+
media: {
|
|
5712
|
+
mobile: {
|
|
5713
|
+
padding: '12px'
|
|
5714
|
+
}
|
|
5715
|
+
}
|
|
5636
5716
|
},
|
|
5637
5717
|
footer: {
|
|
5638
5718
|
padding: '16px',
|
|
5639
5719
|
borderTopWidth: '1px',
|
|
5640
5720
|
borderTopStyle: 'solid',
|
|
5641
|
-
borderTopColor: 'color.gray.200'
|
|
5721
|
+
borderTopColor: 'color.gray.200',
|
|
5722
|
+
media: {
|
|
5723
|
+
mobile: {
|
|
5724
|
+
padding: '12px'
|
|
5725
|
+
}
|
|
5726
|
+
}
|
|
5642
5727
|
}
|
|
5643
5728
|
};
|
|
5644
5729
|
};
|
|
@@ -6424,17 +6509,6 @@
|
|
|
6424
6509
|
var LegendTextStyles = {
|
|
6425
6510
|
fontSize: '14px'
|
|
6426
6511
|
};
|
|
6427
|
-
// Default styles for tooltip
|
|
6428
|
-
var TooltipStyles = {
|
|
6429
|
-
position: 'absolute',
|
|
6430
|
-
backgroundColor: 'color.white',
|
|
6431
|
-
padding: '8px 12px',
|
|
6432
|
-
borderRadius: '4px',
|
|
6433
|
-
boxShadow: '0 2px 5px rgba(0, 0, 0, 0.1)',
|
|
6434
|
-
fontSize: '14px',
|
|
6435
|
-
pointerEvents: 'none',
|
|
6436
|
-
zIndex: 10
|
|
6437
|
-
};
|
|
6438
6512
|
// Default styles for chart grid
|
|
6439
6513
|
var GridStyles = {
|
|
6440
6514
|
stroke: 'color.gray.200',
|
|
@@ -6527,7 +6601,7 @@
|
|
|
6527
6601
|
visible: false,
|
|
6528
6602
|
x: 0,
|
|
6529
6603
|
y: 0,
|
|
6530
|
-
content:
|
|
6604
|
+
content: null
|
|
6531
6605
|
});
|
|
6532
6606
|
// Reference to animation frame
|
|
6533
6607
|
var animationRef = React.useRef(null);
|
|
@@ -6686,7 +6760,12 @@
|
|
|
6686
6760
|
x: x,
|
|
6687
6761
|
y: y,
|
|
6688
6762
|
textAnchor: "middle"
|
|
6689
|
-
}, AxisLabelStyles, views == null ? void 0 : views.axisLabel
|
|
6763
|
+
}, AxisLabelStyles, views == null ? void 0 : views.axisLabel, {
|
|
6764
|
+
style: {
|
|
6765
|
+
textShadow: '0 1px 2px rgba(0, 0, 0, 0.2)',
|
|
6766
|
+
filter: 'drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2))'
|
|
6767
|
+
}
|
|
6768
|
+
}), label);
|
|
6690
6769
|
}), yAxisTicks.map((tick, index) => {
|
|
6691
6770
|
var y = height - padding.bottom - tick / maxValue * chartHeight;
|
|
6692
6771
|
return /*#__PURE__*/React__default.createElement(React__default.Fragment, {
|
|
@@ -6696,7 +6775,12 @@
|
|
|
6696
6775
|
y: y,
|
|
6697
6776
|
textAnchor: "end",
|
|
6698
6777
|
dominantBaseline: "middle"
|
|
6699
|
-
}, AxisLabelStyles, views == null ? void 0 : views.axisLabel
|
|
6778
|
+
}, AxisLabelStyles, views == null ? void 0 : views.axisLabel, {
|
|
6779
|
+
style: {
|
|
6780
|
+
textShadow: '0 1px 2px rgba(0, 0, 0, 0.2)',
|
|
6781
|
+
filter: 'drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2))'
|
|
6782
|
+
}
|
|
6783
|
+
}), tick.toFixed(0)), showGrid && (/*#__PURE__*/React__default.createElement("line", Object.assign({
|
|
6700
6784
|
x1: padding.left,
|
|
6701
6785
|
y1: y,
|
|
6702
6786
|
x2: width - padding.right,
|
|
@@ -6708,8 +6792,61 @@
|
|
|
6708
6792
|
var barHeight = value / maxValue * chartHeight * animationProgress;
|
|
6709
6793
|
var x = padding.left + dataIndex * groupWidth + barSpacing * (seriesIndex + 1) + barWidth * seriesIndex;
|
|
6710
6794
|
var y = height - padding.bottom - barHeight;
|
|
6795
|
+
var categoryLabel = data.labels[dataIndex];
|
|
6796
|
+
var categoryTotal = data.series.reduce((sum, currentSeries) => {
|
|
6797
|
+
var seriesValue = currentSeries.data[dataIndex];
|
|
6798
|
+
return sum + (typeof seriesValue === 'number' ? seriesValue : 0);
|
|
6799
|
+
}, 0);
|
|
6800
|
+
var sharePercentage = categoryTotal > 0 ? (value / categoryTotal * 100).toFixed(1) : null;
|
|
6801
|
+
var fillColor = series.color ? getColor(series.color) : 'black';
|
|
6711
6802
|
var handleMouseEnter = e => {
|
|
6712
|
-
var tooltipContent =
|
|
6803
|
+
var tooltipContent = /*#__PURE__*/React__default.createElement(appStudio.View, {
|
|
6804
|
+
display: "flex",
|
|
6805
|
+
flexDirection: "column",
|
|
6806
|
+
minWidth: "180px"
|
|
6807
|
+
}, /*#__PURE__*/React__default.createElement(appStudio.View, {
|
|
6808
|
+
display: "flex",
|
|
6809
|
+
justifyContent: "space-between",
|
|
6810
|
+
alignItems: "center"
|
|
6811
|
+
}, /*#__PURE__*/React__default.createElement(Text, {
|
|
6812
|
+
fontWeight: "semibold"
|
|
6813
|
+
}, series.name), /*#__PURE__*/React__default.createElement(appStudio.View, {
|
|
6814
|
+
width: "12px",
|
|
6815
|
+
height: "12px",
|
|
6816
|
+
borderRadius: "2px",
|
|
6817
|
+
backgroundColor: fillColor
|
|
6818
|
+
})), /*#__PURE__*/React__default.createElement(Text, {
|
|
6819
|
+
marginTop: "4px",
|
|
6820
|
+
color: "color.gray.500",
|
|
6821
|
+
fontSize: "12px"
|
|
6822
|
+
}, categoryLabel), /*#__PURE__*/React__default.createElement(appStudio.View, {
|
|
6823
|
+
marginTop: "8px",
|
|
6824
|
+
display: "flex",
|
|
6825
|
+
flexDirection: "column"
|
|
6826
|
+
}, /*#__PURE__*/React__default.createElement(appStudio.View, {
|
|
6827
|
+
display: "flex",
|
|
6828
|
+
justifyContent: "space-between"
|
|
6829
|
+
}, /*#__PURE__*/React__default.createElement(Text, {
|
|
6830
|
+
color: "color.gray.500"
|
|
6831
|
+
}, "Value"), /*#__PURE__*/React__default.createElement(Text, {
|
|
6832
|
+
fontWeight: "medium"
|
|
6833
|
+
}, value.toLocaleString())), sharePercentage !== null && (/*#__PURE__*/React__default.createElement(appStudio.View, {
|
|
6834
|
+
marginTop: "4px",
|
|
6835
|
+
display: "flex",
|
|
6836
|
+
justifyContent: "space-between"
|
|
6837
|
+
}, /*#__PURE__*/React__default.createElement(Text, {
|
|
6838
|
+
color: "color.gray.500"
|
|
6839
|
+
}, "Share"), /*#__PURE__*/React__default.createElement(Text, {
|
|
6840
|
+
fontWeight: "medium"
|
|
6841
|
+
}, sharePercentage + "%"))), /*#__PURE__*/React__default.createElement(appStudio.View, {
|
|
6842
|
+
marginTop: "4px",
|
|
6843
|
+
display: "flex",
|
|
6844
|
+
justifyContent: "space-between"
|
|
6845
|
+
}, /*#__PURE__*/React__default.createElement(Text, {
|
|
6846
|
+
color: "color.gray.500"
|
|
6847
|
+
}, "Category total"), /*#__PURE__*/React__default.createElement(Text, {
|
|
6848
|
+
fontWeight: "medium"
|
|
6849
|
+
}, categoryTotal.toLocaleString()))));
|
|
6713
6850
|
showTooltip(e.clientX, e.clientY, tooltipContent);
|
|
6714
6851
|
};
|
|
6715
6852
|
var handleClick = () => {
|
|
@@ -6723,7 +6860,7 @@
|
|
|
6723
6860
|
y: y,
|
|
6724
6861
|
width: barWidth,
|
|
6725
6862
|
height: barHeight,
|
|
6726
|
-
fill:
|
|
6863
|
+
fill: fillColor,
|
|
6727
6864
|
onMouseEnter: handleMouseEnter,
|
|
6728
6865
|
onMouseLeave: hideTooltip,
|
|
6729
6866
|
onClick: handleClick
|
|
@@ -6817,7 +6954,12 @@
|
|
|
6817
6954
|
x: x,
|
|
6818
6955
|
y: y,
|
|
6819
6956
|
textAnchor: "middle"
|
|
6820
|
-
}, AxisLabelStyles, views == null ? void 0 : views.axisLabel
|
|
6957
|
+
}, AxisLabelStyles, views == null ? void 0 : views.axisLabel, {
|
|
6958
|
+
style: {
|
|
6959
|
+
textShadow: '0 1px 2px rgba(0, 0, 0, 0.2)',
|
|
6960
|
+
filter: 'drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2))'
|
|
6961
|
+
}
|
|
6962
|
+
}), label);
|
|
6821
6963
|
}), yAxisTicks.map((tick, index) => {
|
|
6822
6964
|
var y = height - padding.bottom - tick / maxValue * chartHeight;
|
|
6823
6965
|
return /*#__PURE__*/React__default.createElement(React__default.Fragment, {
|
|
@@ -6827,43 +6969,114 @@
|
|
|
6827
6969
|
y: y,
|
|
6828
6970
|
textAnchor: "end",
|
|
6829
6971
|
dominantBaseline: "middle"
|
|
6830
|
-
}, AxisLabelStyles, views == null ? void 0 : views.axisLabel
|
|
6972
|
+
}, AxisLabelStyles, views == null ? void 0 : views.axisLabel, {
|
|
6973
|
+
style: {
|
|
6974
|
+
textShadow: '0 1px 2px rgba(0, 0, 0, 0.2)',
|
|
6975
|
+
filter: 'drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2))'
|
|
6976
|
+
}
|
|
6977
|
+
}), tick.toFixed(0)), showGrid && (/*#__PURE__*/React__default.createElement("line", Object.assign({
|
|
6831
6978
|
x1: padding.left,
|
|
6832
6979
|
y1: y,
|
|
6833
6980
|
x2: width - padding.right,
|
|
6834
6981
|
y2: y
|
|
6835
6982
|
}, GridStyles, views == null ? void 0 : views.grid))));
|
|
6836
|
-
}), data.series.map((series, seriesIndex) =>
|
|
6837
|
-
|
|
6838
|
-
|
|
6839
|
-
|
|
6840
|
-
|
|
6841
|
-
|
|
6842
|
-
|
|
6843
|
-
|
|
6844
|
-
|
|
6845
|
-
|
|
6846
|
-
|
|
6847
|
-
|
|
6848
|
-
|
|
6849
|
-
var
|
|
6850
|
-
|
|
6851
|
-
|
|
6852
|
-
|
|
6853
|
-
|
|
6854
|
-
|
|
6855
|
-
|
|
6856
|
-
|
|
6857
|
-
|
|
6858
|
-
|
|
6859
|
-
|
|
6860
|
-
|
|
6861
|
-
|
|
6862
|
-
|
|
6863
|
-
|
|
6864
|
-
|
|
6865
|
-
|
|
6866
|
-
|
|
6983
|
+
}), data.series.map((series, seriesIndex) => {
|
|
6984
|
+
var lineColor = series.color ? getColor(series.color) : 'black';
|
|
6985
|
+
return /*#__PURE__*/React__default.createElement(React__default.Fragment, {
|
|
6986
|
+
key: "series-" + seriesIndex
|
|
6987
|
+
}, /*#__PURE__*/React__default.createElement("path", Object.assign({
|
|
6988
|
+
d: generateAreaPath(series.data),
|
|
6989
|
+
fill: lineColor,
|
|
6990
|
+
opacity: 0.1
|
|
6991
|
+
}, views == null ? void 0 : views.area)), /*#__PURE__*/React__default.createElement("path", Object.assign({
|
|
6992
|
+
d: generatePath(series.data),
|
|
6993
|
+
stroke: lineColor
|
|
6994
|
+
}, LineStyles, views == null ? void 0 : views.line)), series.data.map((value, dataIndex) => {
|
|
6995
|
+
var x = padding.left + dataIndex / (data.labels.length - 1) * chartWidth;
|
|
6996
|
+
var y = height - padding.bottom - value / maxValue * chartHeight * animationProgress;
|
|
6997
|
+
var categoryLabel = data.labels[dataIndex];
|
|
6998
|
+
var categoryTotal = data.series.reduce((sum, currentSeries) => {
|
|
6999
|
+
var seriesValue = currentSeries.data[dataIndex];
|
|
7000
|
+
return sum + (typeof seriesValue === 'number' ? seriesValue : 0);
|
|
7001
|
+
}, 0);
|
|
7002
|
+
var sharePercentage = categoryTotal > 0 ? (value / categoryTotal * 100).toFixed(1) : null;
|
|
7003
|
+
var previousValue = dataIndex > 0 && typeof series.data[dataIndex - 1] === 'number' ? series.data[dataIndex - 1] : null;
|
|
7004
|
+
var deltaValue = typeof previousValue === 'number' ? value - previousValue : null;
|
|
7005
|
+
var formattedDelta = typeof deltaValue === 'number' ? "" + (deltaValue >= 0 ? '+' : '') + deltaValue.toLocaleString() : null;
|
|
7006
|
+
var handleMouseEnter = e => {
|
|
7007
|
+
var tooltipContent = /*#__PURE__*/React__default.createElement(appStudio.View, {
|
|
7008
|
+
display: "flex",
|
|
7009
|
+
flexDirection: "column",
|
|
7010
|
+
minWidth: "200px"
|
|
7011
|
+
}, /*#__PURE__*/React__default.createElement(appStudio.View, {
|
|
7012
|
+
display: "flex",
|
|
7013
|
+
justifyContent: "space-between",
|
|
7014
|
+
alignItems: "center"
|
|
7015
|
+
}, /*#__PURE__*/React__default.createElement(Text, {
|
|
7016
|
+
fontWeight: "semibold"
|
|
7017
|
+
}, series.name), /*#__PURE__*/React__default.createElement(appStudio.View, {
|
|
7018
|
+
width: "12px",
|
|
7019
|
+
height: "12px",
|
|
7020
|
+
borderRadius: "2px",
|
|
7021
|
+
backgroundColor: lineColor
|
|
7022
|
+
})), /*#__PURE__*/React__default.createElement(Text, {
|
|
7023
|
+
marginTop: "4px",
|
|
7024
|
+
color: "color.gray.500",
|
|
7025
|
+
fontSize: "12px"
|
|
7026
|
+
}, categoryLabel), /*#__PURE__*/React__default.createElement(appStudio.View, {
|
|
7027
|
+
marginTop: "8px",
|
|
7028
|
+
display: "flex",
|
|
7029
|
+
flexDirection: "column"
|
|
7030
|
+
}, /*#__PURE__*/React__default.createElement(appStudio.View, {
|
|
7031
|
+
display: "flex",
|
|
7032
|
+
justifyContent: "space-between"
|
|
7033
|
+
}, /*#__PURE__*/React__default.createElement(Text, {
|
|
7034
|
+
color: "color.gray.500"
|
|
7035
|
+
}, "Value"), /*#__PURE__*/React__default.createElement(Text, {
|
|
7036
|
+
fontWeight: "medium"
|
|
7037
|
+
}, value.toLocaleString())), formattedDelta !== null && (/*#__PURE__*/React__default.createElement(appStudio.View, {
|
|
7038
|
+
marginTop: "4px",
|
|
7039
|
+
display: "flex",
|
|
7040
|
+
justifyContent: "space-between"
|
|
7041
|
+
}, /*#__PURE__*/React__default.createElement(Text, {
|
|
7042
|
+
color: "color.gray.500"
|
|
7043
|
+
}, "Change"), /*#__PURE__*/React__default.createElement(Text, {
|
|
7044
|
+
fontWeight: "medium"
|
|
7045
|
+
}, formattedDelta))), sharePercentage !== null && (/*#__PURE__*/React__default.createElement(appStudio.View, {
|
|
7046
|
+
marginTop: "4px",
|
|
7047
|
+
display: "flex",
|
|
7048
|
+
justifyContent: "space-between"
|
|
7049
|
+
}, /*#__PURE__*/React__default.createElement(Text, {
|
|
7050
|
+
color: "color.gray.500"
|
|
7051
|
+
}, "Share"), /*#__PURE__*/React__default.createElement(Text, {
|
|
7052
|
+
fontWeight: "medium"
|
|
7053
|
+
}, sharePercentage + "%"))), /*#__PURE__*/React__default.createElement(appStudio.View, {
|
|
7054
|
+
marginTop: "4px",
|
|
7055
|
+
display: "flex",
|
|
7056
|
+
justifyContent: "space-between"
|
|
7057
|
+
}, /*#__PURE__*/React__default.createElement(Text, {
|
|
7058
|
+
color: "color.gray.500"
|
|
7059
|
+
}, "Category total"), /*#__PURE__*/React__default.createElement(Text, {
|
|
7060
|
+
fontWeight: "medium"
|
|
7061
|
+
}, categoryTotal.toLocaleString()))));
|
|
7062
|
+
showTooltip(e.clientX, e.clientY, tooltipContent);
|
|
7063
|
+
};
|
|
7064
|
+
var handleClick = () => {
|
|
7065
|
+
if (onPointClick) {
|
|
7066
|
+
onPointClick(series.name, dataIndex);
|
|
7067
|
+
}
|
|
7068
|
+
};
|
|
7069
|
+
return /*#__PURE__*/React__default.createElement("circle", Object.assign({
|
|
7070
|
+
key: "point-" + seriesIndex + "-" + dataIndex,
|
|
7071
|
+
cx: x,
|
|
7072
|
+
cy: y,
|
|
7073
|
+
fill: lineColor,
|
|
7074
|
+
onMouseEnter: handleMouseEnter,
|
|
7075
|
+
onMouseLeave: hideTooltip,
|
|
7076
|
+
onClick: handleClick
|
|
7077
|
+
}, PointStyles, views == null ? void 0 : views.point));
|
|
7078
|
+
}));
|
|
7079
|
+
}));
|
|
6867
7080
|
};
|
|
6868
7081
|
|
|
6869
7082
|
var PieChart = _ref => {
|
|
@@ -6970,10 +7183,75 @@
|
|
|
6970
7183
|
return /*#__PURE__*/React__default.createElement("svg", {
|
|
6971
7184
|
ref: chartRef,
|
|
6972
7185
|
width: width,
|
|
6973
|
-
height: height
|
|
6974
|
-
|
|
7186
|
+
height: height,
|
|
7187
|
+
style: {
|
|
7188
|
+
overflow: 'visible'
|
|
7189
|
+
}
|
|
7190
|
+
}, isDonut && (/*#__PURE__*/React__default.createElement("circle", {
|
|
7191
|
+
cx: centerX,
|
|
7192
|
+
cy: centerY,
|
|
7193
|
+
r: donutRadius,
|
|
7194
|
+
fill: "white",
|
|
7195
|
+
pointerEvents: "none"
|
|
7196
|
+
})), slices.map((slice, index) => {
|
|
6975
7197
|
var handleMouseEnter = e => {
|
|
6976
|
-
var
|
|
7198
|
+
var numericShare = total > 0 ? slice.value / total * 100 : 0;
|
|
7199
|
+
var remainingShare = total > 0 ? Math.max(0, 100 - numericShare) : null;
|
|
7200
|
+
var tooltipContent = /*#__PURE__*/React__default.createElement(appStudio.View, {
|
|
7201
|
+
display: "flex",
|
|
7202
|
+
flexDirection: "column",
|
|
7203
|
+
minWidth: "200px"
|
|
7204
|
+
}, /*#__PURE__*/React__default.createElement(appStudio.View, {
|
|
7205
|
+
display: "flex",
|
|
7206
|
+
justifyContent: "space-between",
|
|
7207
|
+
alignItems: "center"
|
|
7208
|
+
}, /*#__PURE__*/React__default.createElement(Text, {
|
|
7209
|
+
fontWeight: "semibold"
|
|
7210
|
+
}, slice.label), /*#__PURE__*/React__default.createElement(appStudio.View, {
|
|
7211
|
+
width: "12px",
|
|
7212
|
+
height: "12px",
|
|
7213
|
+
borderRadius: "2px",
|
|
7214
|
+
backgroundColor: slice.color
|
|
7215
|
+
})), /*#__PURE__*/React__default.createElement(Text, {
|
|
7216
|
+
marginTop: "4px",
|
|
7217
|
+
color: "color.gray.500",
|
|
7218
|
+
fontSize: "12px"
|
|
7219
|
+
}, "Slice ", slice.index + 1, " of ", dataPoints.length), /*#__PURE__*/React__default.createElement(appStudio.View, {
|
|
7220
|
+
marginTop: "8px",
|
|
7221
|
+
display: "flex",
|
|
7222
|
+
flexDirection: "column"
|
|
7223
|
+
}, /*#__PURE__*/React__default.createElement(appStudio.View, {
|
|
7224
|
+
display: "flex",
|
|
7225
|
+
justifyContent: "space-between"
|
|
7226
|
+
}, /*#__PURE__*/React__default.createElement(Text, {
|
|
7227
|
+
color: "color.gray.500"
|
|
7228
|
+
}, "Value"), /*#__PURE__*/React__default.createElement(Text, {
|
|
7229
|
+
fontWeight: "medium"
|
|
7230
|
+
}, slice.value.toLocaleString())), /*#__PURE__*/React__default.createElement(appStudio.View, {
|
|
7231
|
+
marginTop: "4px",
|
|
7232
|
+
display: "flex",
|
|
7233
|
+
justifyContent: "space-between"
|
|
7234
|
+
}, /*#__PURE__*/React__default.createElement(Text, {
|
|
7235
|
+
color: "color.gray.500"
|
|
7236
|
+
}, "Share"), /*#__PURE__*/React__default.createElement(Text, {
|
|
7237
|
+
fontWeight: "medium"
|
|
7238
|
+
}, slice.percentage)), /*#__PURE__*/React__default.createElement(appStudio.View, {
|
|
7239
|
+
marginTop: "4px",
|
|
7240
|
+
display: "flex",
|
|
7241
|
+
justifyContent: "space-between"
|
|
7242
|
+
}, /*#__PURE__*/React__default.createElement(Text, {
|
|
7243
|
+
color: "color.gray.500"
|
|
7244
|
+
}, "Total"), /*#__PURE__*/React__default.createElement(Text, {
|
|
7245
|
+
fontWeight: "medium"
|
|
7246
|
+
}, total.toLocaleString())), remainingShare !== null && (/*#__PURE__*/React__default.createElement(appStudio.View, {
|
|
7247
|
+
marginTop: "4px",
|
|
7248
|
+
display: "flex",
|
|
7249
|
+
justifyContent: "space-between"
|
|
7250
|
+
}, /*#__PURE__*/React__default.createElement(Text, {
|
|
7251
|
+
color: "color.gray.500"
|
|
7252
|
+
}, "Remaining"), /*#__PURE__*/React__default.createElement(Text, {
|
|
7253
|
+
fontWeight: "medium"
|
|
7254
|
+
}, remainingShare.toFixed(1) + "%")))));
|
|
6977
7255
|
// Use intelligent positioning based on useElementPosition relation data
|
|
6978
7256
|
var x = e.clientX;
|
|
6979
7257
|
var y = e.clientY;
|
|
@@ -7013,14 +7291,97 @@
|
|
|
7013
7291
|
dominantBaseline: "middle",
|
|
7014
7292
|
fill: "white",
|
|
7015
7293
|
fontWeight: "bold",
|
|
7016
|
-
pointerEvents: "none"
|
|
7294
|
+
pointerEvents: "none",
|
|
7295
|
+
style: {
|
|
7296
|
+
textShadow: '0 2px 4px rgba(0, 0, 0, 0.5), 0 1px 2px rgba(0, 0, 0, 0.3)',
|
|
7297
|
+
filter: 'drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5))'
|
|
7298
|
+
}
|
|
7017
7299
|
}, slice.percentage)));
|
|
7018
|
-
})
|
|
7019
|
-
|
|
7020
|
-
|
|
7021
|
-
|
|
7022
|
-
|
|
7023
|
-
|
|
7300
|
+
}));
|
|
7301
|
+
};
|
|
7302
|
+
|
|
7303
|
+
var ChartTooltip = _ref => {
|
|
7304
|
+
var {
|
|
7305
|
+
visible,
|
|
7306
|
+
x,
|
|
7307
|
+
y,
|
|
7308
|
+
content,
|
|
7309
|
+
maxDistance = 100,
|
|
7310
|
+
views
|
|
7311
|
+
} = _ref;
|
|
7312
|
+
var tooltipRef = React.useRef(null);
|
|
7313
|
+
var [position, setPosition] = React.useState({
|
|
7314
|
+
left: 0,
|
|
7315
|
+
top: 0
|
|
7316
|
+
});
|
|
7317
|
+
React.useEffect(() => {
|
|
7318
|
+
if (!visible || !tooltipRef.current) return;
|
|
7319
|
+
var tooltip = tooltipRef.current;
|
|
7320
|
+
var tooltipRect = tooltip.getBoundingClientRect();
|
|
7321
|
+
var tooltipWidth = tooltipRect.width;
|
|
7322
|
+
var tooltipHeight = tooltipRect.height;
|
|
7323
|
+
var viewportOffset = 10;
|
|
7324
|
+
var cursorOffset = 15;
|
|
7325
|
+
// Start position: top-left corner near cursor
|
|
7326
|
+
var left = x - cursorOffset;
|
|
7327
|
+
var top = y - cursorOffset;
|
|
7328
|
+
// Calculate the distance from cursor to tooltip edges
|
|
7329
|
+
var distanceX = x - left; // Distance from cursor to left edge
|
|
7330
|
+
var distanceY = y - top; // Distance from cursor to top edge
|
|
7331
|
+
// If tooltip would be too far on X axis, adjust it
|
|
7332
|
+
if (distanceX > maxDistance) {
|
|
7333
|
+
left = x - maxDistance;
|
|
7334
|
+
}
|
|
7335
|
+
// If tooltip would be too far on Y axis, adjust it
|
|
7336
|
+
if (distanceY > maxDistance) {
|
|
7337
|
+
top = y - maxDistance;
|
|
7338
|
+
}
|
|
7339
|
+
// Ensure tooltip doesn't go off the right edge of viewport
|
|
7340
|
+
if (left + tooltipWidth > window.innerWidth - viewportOffset) {
|
|
7341
|
+
left = window.innerWidth - tooltipWidth - viewportOffset;
|
|
7342
|
+
// Still respect max distance constraint
|
|
7343
|
+
if (x - left > maxDistance) {
|
|
7344
|
+
left = x - maxDistance;
|
|
7345
|
+
}
|
|
7346
|
+
}
|
|
7347
|
+
// Ensure tooltip doesn't go off the left edge of viewport
|
|
7348
|
+
if (left < viewportOffset) {
|
|
7349
|
+
left = viewportOffset;
|
|
7350
|
+
}
|
|
7351
|
+
// Ensure tooltip doesn't go off the bottom edge of viewport
|
|
7352
|
+
if (top + tooltipHeight > window.innerHeight - viewportOffset) {
|
|
7353
|
+
top = window.innerHeight - tooltipHeight - viewportOffset;
|
|
7354
|
+
// Still respect max distance constraint
|
|
7355
|
+
if (y - top > maxDistance) {
|
|
7356
|
+
top = y - maxDistance;
|
|
7357
|
+
}
|
|
7358
|
+
}
|
|
7359
|
+
// Ensure tooltip doesn't go off the top edge of viewport
|
|
7360
|
+
if (top < viewportOffset) {
|
|
7361
|
+
top = viewportOffset;
|
|
7362
|
+
}
|
|
7363
|
+
setPosition({
|
|
7364
|
+
left,
|
|
7365
|
+
top
|
|
7366
|
+
});
|
|
7367
|
+
}, [visible, x, y, maxDistance]);
|
|
7368
|
+
if (!visible) return null;
|
|
7369
|
+
return /*#__PURE__*/React__default.createElement(appStudio.View, Object.assign({
|
|
7370
|
+
ref: tooltipRef,
|
|
7371
|
+
position: "fixed",
|
|
7372
|
+
left: position.left + "px",
|
|
7373
|
+
top: position.top + "px",
|
|
7374
|
+
backgroundColor: "color.white",
|
|
7375
|
+
padding: "12px 16px",
|
|
7376
|
+
borderRadius: "8px",
|
|
7377
|
+
boxShadow: "0px 12px 24px rgba(15, 23, 42, 0.18)",
|
|
7378
|
+
border: "1px solid color.gray.200",
|
|
7379
|
+
fontSize: "14px",
|
|
7380
|
+
display: "flex",
|
|
7381
|
+
flexDirection: "column",
|
|
7382
|
+
pointerEvents: "none",
|
|
7383
|
+
zIndex: 10
|
|
7384
|
+
}, views == null ? void 0 : views.tooltip), content);
|
|
7024
7385
|
};
|
|
7025
7386
|
|
|
7026
7387
|
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"];
|
|
@@ -7151,15 +7512,6 @@
|
|
|
7151
7512
|
return null;
|
|
7152
7513
|
}
|
|
7153
7514
|
};
|
|
7154
|
-
// Render tooltip
|
|
7155
|
-
var renderTooltip = () => {
|
|
7156
|
-
if (!showTooltips || !tooltip.visible) return null;
|
|
7157
|
-
return /*#__PURE__*/React__default.createElement(appStudio.View, Object.assign({
|
|
7158
|
-
position: "fixed",
|
|
7159
|
-
left: tooltip.x + "px",
|
|
7160
|
-
top: tooltip.y - 40 + "px"
|
|
7161
|
-
}, TooltipStyles, views == null ? void 0 : views.tooltip), tooltip.content);
|
|
7162
|
-
};
|
|
7163
7515
|
// Default loading indicator
|
|
7164
7516
|
var renderLoadingIndicator = () => {
|
|
7165
7517
|
if (!isLoading) return null;
|
|
@@ -7192,7 +7544,14 @@
|
|
|
7192
7544
|
flex: 1,
|
|
7193
7545
|
width: "100%",
|
|
7194
7546
|
position: "relative"
|
|
7195
|
-
}, views == null ? void 0 : views.chart), showChartContent && renderChart(), renderLoadingIndicator(), renderErrorIndicator(), renderNoDataIndicator()), showChartContent && legendPosition === 'bottom' && renderLegend(),
|
|
7547
|
+
}, views == null ? void 0 : views.chart), showChartContent && renderChart(), renderLoadingIndicator(), renderErrorIndicator(), renderNoDataIndicator()), showChartContent && legendPosition === 'bottom' && renderLegend(), /*#__PURE__*/React__default.createElement(ChartTooltip, {
|
|
7548
|
+
visible: showTooltips && tooltip.visible,
|
|
7549
|
+
x: tooltip.x,
|
|
7550
|
+
y: tooltip.y,
|
|
7551
|
+
content: tooltip.content,
|
|
7552
|
+
maxDistance: 100,
|
|
7553
|
+
views: views
|
|
7554
|
+
}));
|
|
7196
7555
|
};
|
|
7197
7556
|
|
|
7198
7557
|
/**
|
|
@@ -7204,6 +7563,9 @@
|
|
|
7204
7563
|
};
|
|
7205
7564
|
var Chart = ChartComponent;
|
|
7206
7565
|
|
|
7566
|
+
var cloneColumns = inputColumns => inputColumns.map(column => Object.assign({}, column, {
|
|
7567
|
+
cards: [...column.cards]
|
|
7568
|
+
}));
|
|
7207
7569
|
var useKanbanBoardState = _ref => {
|
|
7208
7570
|
var {
|
|
7209
7571
|
columns: initialColumns,
|
|
@@ -7211,20 +7573,26 @@
|
|
|
7211
7573
|
} = _ref;
|
|
7212
7574
|
var [columns, setColumns] = React.useState(initialColumns);
|
|
7213
7575
|
var [draggedCardId, setDraggedCardId] = React.useState(null);
|
|
7576
|
+
var [hoveredColumnId, setHoveredColumnId] = React.useState(null);
|
|
7214
7577
|
var dragStateRef = React.useRef(null);
|
|
7578
|
+
var originalColumnsRef = React.useRef(null);
|
|
7579
|
+
var dropCommittedRef = React.useRef(false);
|
|
7580
|
+
var getRelativeDropPosition = React.useCallback(event => {
|
|
7581
|
+
var rect = event.currentTarget.getBoundingClientRect();
|
|
7582
|
+
var offset = event.clientY - rect.top;
|
|
7583
|
+
return offset < rect.height / 2 ? 'before' : 'after';
|
|
7584
|
+
}, []);
|
|
7215
7585
|
React.useEffect(() => {
|
|
7216
7586
|
setColumns(initialColumns);
|
|
7217
7587
|
}, [initialColumns]);
|
|
7218
|
-
var
|
|
7588
|
+
var applyMove = React.useCallback((targetColumnId, targetCardId, position, options) => {
|
|
7219
7589
|
var dragState = dragStateRef.current;
|
|
7220
7590
|
if (!dragState) return;
|
|
7221
7591
|
var {
|
|
7222
7592
|
columnId: sourceColumnId,
|
|
7223
7593
|
cardId
|
|
7224
7594
|
} = dragState;
|
|
7225
|
-
if (targetColumnId === sourceColumnId &&
|
|
7226
|
-
dragStateRef.current = null;
|
|
7227
|
-
setDraggedCardId(null);
|
|
7595
|
+
if (targetColumnId === sourceColumnId && targetCardId === cardId) {
|
|
7228
7596
|
return;
|
|
7229
7597
|
}
|
|
7230
7598
|
setColumns(prevColumns => {
|
|
@@ -7236,36 +7604,60 @@
|
|
|
7236
7604
|
if (!sourceColumn || !targetColumn) {
|
|
7237
7605
|
return prevColumns;
|
|
7238
7606
|
}
|
|
7239
|
-
var sourceIndex = sourceColumn.cards.findIndex(
|
|
7607
|
+
var sourceIndex = sourceColumn.cards.findIndex(cardItem => cardItem.id === cardId);
|
|
7240
7608
|
if (sourceIndex === -1) {
|
|
7241
7609
|
return prevColumns;
|
|
7242
7610
|
}
|
|
7243
7611
|
var [card] = sourceColumn.cards.splice(sourceIndex, 1);
|
|
7244
|
-
var
|
|
7612
|
+
var dropPosition = position != null ? position : 'after';
|
|
7613
|
+
var targetIndex;
|
|
7245
7614
|
if (targetCardId) {
|
|
7246
7615
|
var foundIndex = targetColumn.cards.findIndex(item => item.id === targetCardId);
|
|
7247
7616
|
if (foundIndex !== -1) {
|
|
7248
|
-
targetIndex = foundIndex;
|
|
7249
|
-
|
|
7250
|
-
|
|
7251
|
-
}
|
|
7617
|
+
targetIndex = dropPosition === 'before' ? foundIndex : foundIndex + 1;
|
|
7618
|
+
} else {
|
|
7619
|
+
targetIndex = targetColumn.cards.length;
|
|
7252
7620
|
}
|
|
7621
|
+
} else {
|
|
7622
|
+
targetIndex = dropPosition === 'before' ? 0 : targetColumn.cards.length;
|
|
7253
7623
|
}
|
|
7254
7624
|
targetColumn.cards.splice(targetIndex, 0, card);
|
|
7625
|
+
var hasChanged = workingColumns.some((column, columnIndex) => {
|
|
7626
|
+
var previousColumn = prevColumns[columnIndex];
|
|
7627
|
+
if (!previousColumn) {
|
|
7628
|
+
return true;
|
|
7629
|
+
}
|
|
7630
|
+
if (column.cards.length !== previousColumn.cards.length) {
|
|
7631
|
+
return true;
|
|
7632
|
+
}
|
|
7633
|
+
return column.cards.some((currentCard, cardIndex) => {
|
|
7634
|
+
var _previousColumn$cards;
|
|
7635
|
+
return currentCard.id !== ((_previousColumn$cards = previousColumn.cards[cardIndex]) == null ? void 0 : _previousColumn$cards.id);
|
|
7636
|
+
});
|
|
7637
|
+
});
|
|
7638
|
+
if (!hasChanged) {
|
|
7639
|
+
return prevColumns;
|
|
7640
|
+
}
|
|
7255
7641
|
var updatedColumns = workingColumns.map(column => Object.assign({}, column, {
|
|
7256
7642
|
cards: [...column.cards]
|
|
7257
7643
|
}));
|
|
7258
|
-
|
|
7644
|
+
dragStateRef.current = {
|
|
7645
|
+
columnId: targetColumnId,
|
|
7646
|
+
cardId
|
|
7647
|
+
};
|
|
7648
|
+
if (options != null && options.shouldCommit) {
|
|
7649
|
+
onChange == null || onChange(updatedColumns);
|
|
7650
|
+
}
|
|
7259
7651
|
return updatedColumns;
|
|
7260
7652
|
});
|
|
7261
|
-
dragStateRef.current = null;
|
|
7262
|
-
setDraggedCardId(null);
|
|
7263
7653
|
}, [onChange]);
|
|
7264
7654
|
var handleCardDragStart = React.useCallback((columnId, cardId, event) => {
|
|
7265
7655
|
dragStateRef.current = {
|
|
7266
7656
|
columnId,
|
|
7267
7657
|
cardId
|
|
7268
7658
|
};
|
|
7659
|
+
originalColumnsRef.current = cloneColumns(columns);
|
|
7660
|
+
dropCommittedRef.current = false;
|
|
7269
7661
|
setDraggedCardId(cardId);
|
|
7270
7662
|
if (event.dataTransfer) {
|
|
7271
7663
|
event.dataTransfer.effectAllowed = 'move';
|
|
@@ -7275,35 +7667,52 @@
|
|
|
7275
7667
|
// Ignore errors from browsers that disallow setting data
|
|
7276
7668
|
}
|
|
7277
7669
|
}
|
|
7278
|
-
}, []);
|
|
7670
|
+
}, [columns]);
|
|
7279
7671
|
var handleCardDragEnd = React.useCallback(() => {
|
|
7672
|
+
if (!dropCommittedRef.current && originalColumnsRef.current) {
|
|
7673
|
+
setColumns(cloneColumns(originalColumnsRef.current));
|
|
7674
|
+
}
|
|
7280
7675
|
dragStateRef.current = null;
|
|
7676
|
+
originalColumnsRef.current = null;
|
|
7677
|
+
dropCommittedRef.current = false;
|
|
7281
7678
|
setDraggedCardId(null);
|
|
7679
|
+
setHoveredColumnId(null);
|
|
7282
7680
|
}, []);
|
|
7283
|
-
var handleColumnDragOver = React.useCallback((
|
|
7681
|
+
var handleColumnDragOver = React.useCallback((columnId, event) => {
|
|
7284
7682
|
event.preventDefault();
|
|
7285
7683
|
if (event.dataTransfer) {
|
|
7286
7684
|
event.dataTransfer.dropEffect = 'move';
|
|
7287
7685
|
}
|
|
7288
|
-
|
|
7289
|
-
|
|
7686
|
+
setHoveredColumnId(columnId);
|
|
7687
|
+
applyMove(columnId, null, getRelativeDropPosition(event));
|
|
7688
|
+
}, [applyMove, getRelativeDropPosition]);
|
|
7689
|
+
var handleCardDragOver = React.useCallback((columnId, cardId, event) => {
|
|
7290
7690
|
event.preventDefault();
|
|
7291
7691
|
if (event.dataTransfer) {
|
|
7292
7692
|
event.dataTransfer.dropEffect = 'move';
|
|
7293
7693
|
}
|
|
7294
|
-
|
|
7694
|
+
setHoveredColumnId(columnId);
|
|
7695
|
+
applyMove(columnId, cardId, getRelativeDropPosition(event));
|
|
7696
|
+
}, [applyMove, getRelativeDropPosition]);
|
|
7295
7697
|
var handleColumnDrop = React.useCallback((columnId, event) => {
|
|
7296
7698
|
event.preventDefault();
|
|
7297
|
-
|
|
7298
|
-
|
|
7699
|
+
dropCommittedRef.current = true;
|
|
7700
|
+
applyMove(columnId, null, getRelativeDropPosition(event), {
|
|
7701
|
+
shouldCommit: true
|
|
7702
|
+
});
|
|
7703
|
+
}, [applyMove, getRelativeDropPosition]);
|
|
7299
7704
|
var handleCardDrop = React.useCallback((columnId, cardId, event) => {
|
|
7300
7705
|
event.preventDefault();
|
|
7301
7706
|
event.stopPropagation();
|
|
7302
|
-
|
|
7303
|
-
|
|
7707
|
+
dropCommittedRef.current = true;
|
|
7708
|
+
applyMove(columnId, cardId, getRelativeDropPosition(event), {
|
|
7709
|
+
shouldCommit: true
|
|
7710
|
+
});
|
|
7711
|
+
}, [applyMove, getRelativeDropPosition]);
|
|
7304
7712
|
return {
|
|
7305
7713
|
columns,
|
|
7306
7714
|
draggedCardId,
|
|
7715
|
+
hoveredColumnId,
|
|
7307
7716
|
onCardDragStart: handleCardDragStart,
|
|
7308
7717
|
onCardDragEnd: handleCardDragEnd,
|
|
7309
7718
|
onColumnDragOver: handleColumnDragOver,
|
|
@@ -7321,6 +7730,7 @@
|
|
|
7321
7730
|
renderEmptyState,
|
|
7322
7731
|
views,
|
|
7323
7732
|
draggedCardId,
|
|
7733
|
+
hoveredColumnId,
|
|
7324
7734
|
onCardDragStart,
|
|
7325
7735
|
onCardDragEnd,
|
|
7326
7736
|
onColumnDragOver,
|
|
@@ -7365,7 +7775,9 @@
|
|
|
7365
7775
|
gap: 12,
|
|
7366
7776
|
minHeight: 40,
|
|
7367
7777
|
onDragOver: event => onColumnDragOver(column.id, event),
|
|
7368
|
-
onDrop: event => onColumnDrop(column.id, event)
|
|
7778
|
+
onDrop: event => onColumnDrop(column.id, event),
|
|
7779
|
+
opacity: draggedCardId && hoveredColumnId === column.id ? 0.9 : undefined,
|
|
7780
|
+
transition: "all 0.15s ease-in-out"
|
|
7369
7781
|
}, views == null ? void 0 : views.columnBody), column.cards.length === 0 && (/*#__PURE__*/React__default.createElement(appStudio.View, Object.assign({
|
|
7370
7782
|
padding: 12,
|
|
7371
7783
|
borderWidth: "1px",
|
|
@@ -7379,20 +7791,27 @@
|
|
|
7379
7791
|
}, views == null ? void 0 : views.emptyState), renderEmptyState ? renderEmptyState(column) : (/*#__PURE__*/React__default.createElement(Text, {
|
|
7380
7792
|
size: "sm",
|
|
7381
7793
|
color: "#667085"
|
|
7382
|
-
}, "Drop cards here")))), column.cards.map(card => (/*#__PURE__*/React__default.createElement(appStudio.View,
|
|
7794
|
+
}, "Drop cards here")))), column.cards.map(card => (/*#__PURE__*/React__default.createElement(appStudio.View, {
|
|
7383
7795
|
key: card.id,
|
|
7796
|
+
position: "relative"
|
|
7797
|
+
}, /*#__PURE__*/React__default.createElement(appStudio.View, Object.assign({
|
|
7384
7798
|
draggable: true,
|
|
7385
7799
|
cursor: "grab",
|
|
7386
7800
|
backgroundColor: "#ffffff",
|
|
7387
7801
|
borderRadius: 10,
|
|
7388
7802
|
padding: "12px",
|
|
7389
7803
|
boxShadow: "0 1px 2px 0 rgba(16, 24, 40, 0.08)",
|
|
7390
|
-
opacity: draggedCardId === card.id ? 0.6 : 1,
|
|
7391
7804
|
onDragStart: event => onCardDragStart(column.id, card.id, event),
|
|
7392
7805
|
onDragEnd: onCardDragEnd,
|
|
7393
|
-
onDragOver: event =>
|
|
7394
|
-
|
|
7395
|
-
|
|
7806
|
+
onDragOver: event => {
|
|
7807
|
+
event.stopPropagation();
|
|
7808
|
+
onCardDragOver(column.id, card.id, event);
|
|
7809
|
+
},
|
|
7810
|
+
onDrop: event => {
|
|
7811
|
+
event.stopPropagation();
|
|
7812
|
+
onCardDrop(column.id, card.id, event);
|
|
7813
|
+
}
|
|
7814
|
+
}, views == null ? void 0 : views.card), renderCard ? renderCard(card, column) : renderDefaultCard(card)))))), column.footer && (/*#__PURE__*/React__default.createElement(appStudio.View, Object.assign({}, views == null ? void 0 : views.columnFooter), column.footer))))));
|
|
7396
7815
|
};
|
|
7397
7816
|
|
|
7398
7817
|
var KanbanBoardComponent = props => {
|
|
@@ -7401,734 +7820,1038 @@
|
|
|
7401
7820
|
};
|
|
7402
7821
|
var KanbanBoard = KanbanBoardComponent;
|
|
7403
7822
|
|
|
7404
|
-
|
|
7405
|
-
|
|
7406
|
-
|
|
7407
|
-
|
|
7408
|
-
|
|
7409
|
-
closeDelay = 300
|
|
7410
|
-
} = _temp === void 0 ? {} : _temp;
|
|
7411
|
-
var [isOpen, setIsOpen] = React.useState(false);
|
|
7412
|
-
var openTimerRef = React.useRef(null);
|
|
7413
|
-
var closeTimerRef = React.useRef(null);
|
|
7414
|
-
// Refs for trigger and content elements for positioning
|
|
7415
|
-
var triggerRef = React.useRef(null);
|
|
7416
|
-
var contentRef = React.useRef(null);
|
|
7417
|
-
// Unique IDs for ARIA attributes
|
|
7418
|
-
var contentId = React.useMemo(() => generateId$1('hovercard-content'), []);
|
|
7419
|
-
var triggerId = React.useMemo(() => generateId$1('hovercard-trigger'), []);
|
|
7420
|
-
var clearTimers = React.useCallback(() => {
|
|
7421
|
-
if (openTimerRef.current) {
|
|
7422
|
-
clearTimeout(openTimerRef.current);
|
|
7423
|
-
openTimerRef.current = null;
|
|
7424
|
-
}
|
|
7425
|
-
if (closeTimerRef.current) {
|
|
7426
|
-
clearTimeout(closeTimerRef.current);
|
|
7427
|
-
closeTimerRef.current = null;
|
|
7428
|
-
}
|
|
7429
|
-
}, []);
|
|
7430
|
-
var openCard = React.useCallback(() => {
|
|
7431
|
-
clearTimers(); // Clear any pending close
|
|
7432
|
-
if (!isOpen) {
|
|
7433
|
-
openTimerRef.current = setTimeout(() => {
|
|
7434
|
-
setIsOpen(true);
|
|
7435
|
-
}, openDelay);
|
|
7436
|
-
}
|
|
7437
|
-
}, [isOpen, openDelay, clearTimers]);
|
|
7438
|
-
var closeCard = React.useCallback(() => {
|
|
7439
|
-
clearTimers(); // Clear any pending open
|
|
7440
|
-
if (isOpen) {
|
|
7441
|
-
closeTimerRef.current = setTimeout(() => {
|
|
7442
|
-
setIsOpen(false);
|
|
7443
|
-
}, closeDelay);
|
|
7444
|
-
}
|
|
7445
|
-
}, [isOpen, closeDelay, clearTimers]);
|
|
7446
|
-
// Function specifically to cancel the close timer (e.g., when mouse enters content)
|
|
7447
|
-
var cancelCloseTimer = React.useCallback(() => {
|
|
7448
|
-
if (closeTimerRef.current) {
|
|
7449
|
-
clearTimeout(closeTimerRef.current);
|
|
7450
|
-
closeTimerRef.current = null;
|
|
7451
|
-
}
|
|
7452
|
-
}, []);
|
|
7453
|
-
// Cleanup timers on unmount
|
|
7454
|
-
React.useEffect(() => {
|
|
7455
|
-
return () => clearTimers();
|
|
7456
|
-
}, [clearTimers]);
|
|
7457
|
-
return {
|
|
7458
|
-
isOpen,
|
|
7459
|
-
openCard,
|
|
7460
|
-
closeCard,
|
|
7461
|
-
cancelCloseTimer,
|
|
7462
|
-
triggerRef,
|
|
7463
|
-
contentRef,
|
|
7464
|
-
contentId,
|
|
7465
|
-
triggerId
|
|
7466
|
-
};
|
|
7823
|
+
/**
|
|
7824
|
+
* Convert an ISO date string to a UTC Date object
|
|
7825
|
+
*/
|
|
7826
|
+
var dateUTC = iso => {
|
|
7827
|
+
return new Date(iso + (iso.includes('T') ? '' : 'T00:00:00Z'));
|
|
7467
7828
|
};
|
|
7468
|
-
|
|
7469
|
-
|
|
7470
|
-
|
|
7471
|
-
|
|
7472
|
-
|
|
7473
|
-
isOpen: false,
|
|
7474
|
-
openCard: () => {},
|
|
7475
|
-
closeCard: () => {},
|
|
7476
|
-
cancelCloseTimer: () => {},
|
|
7477
|
-
triggerRef: {
|
|
7478
|
-
current: null
|
|
7479
|
-
},
|
|
7480
|
-
contentRef: {
|
|
7481
|
-
current: null
|
|
7482
|
-
},
|
|
7483
|
-
contentId: '',
|
|
7484
|
-
triggerId: ''
|
|
7485
|
-
});
|
|
7486
|
-
var HoverCardProvider = _ref => {
|
|
7487
|
-
var {
|
|
7488
|
-
children,
|
|
7489
|
-
value
|
|
7490
|
-
} = _ref;
|
|
7491
|
-
return /*#__PURE__*/React__default.createElement(HoverCardContext.Provider, {
|
|
7492
|
-
value: value
|
|
7493
|
-
}, children);
|
|
7829
|
+
/**
|
|
7830
|
+
* Calculate the number of days between two ISO date strings
|
|
7831
|
+
*/
|
|
7832
|
+
var daysBetweenUTC = (a, b) => {
|
|
7833
|
+
return Math.floor((dateUTC(a).getTime() - dateUTC(b).getTime()) / 86400000);
|
|
7494
7834
|
};
|
|
7495
|
-
|
|
7496
|
-
|
|
7497
|
-
|
|
7498
|
-
|
|
7499
|
-
|
|
7500
|
-
|
|
7835
|
+
/**
|
|
7836
|
+
* Add a number of days to an ISO date string
|
|
7837
|
+
*/
|
|
7838
|
+
var addDateDays = (dateISO, days) => {
|
|
7839
|
+
var d = new Date(dateISO + 'T00:00:00Z');
|
|
7840
|
+
d.setUTCDate(d.getUTCDate() + days);
|
|
7841
|
+
return d.toISOString().slice(0, 10);
|
|
7501
7842
|
};
|
|
7502
|
-
|
|
7503
|
-
|
|
7504
|
-
|
|
7505
|
-
|
|
7506
|
-
|
|
7507
|
-
} = _ref2,
|
|
7508
|
-
props = _objectWithoutPropertiesLoose(_ref2, _excluded$i);
|
|
7509
|
-
var {
|
|
7510
|
-
openCard,
|
|
7511
|
-
closeCard,
|
|
7512
|
-
triggerRef,
|
|
7513
|
-
contentId,
|
|
7514
|
-
triggerId
|
|
7515
|
-
} = useHoverCardContext();
|
|
7516
|
-
var handleMouseEnter = () => openCard();
|
|
7517
|
-
var handleMouseLeave = () => closeCard();
|
|
7518
|
-
var handleFocus = () => openCard(); // For keyboard accessibility
|
|
7519
|
-
var handleBlur = () => closeCard(); // For keyboard accessibility
|
|
7520
|
-
var triggerProps = Object.assign({
|
|
7521
|
-
ref: triggerRef,
|
|
7522
|
-
onMouseEnter: handleMouseEnter,
|
|
7523
|
-
onMouseLeave: handleMouseLeave,
|
|
7524
|
-
onFocus: handleFocus,
|
|
7525
|
-
onBlur: handleBlur,
|
|
7526
|
-
id: triggerId,
|
|
7527
|
-
'aria-describedby': contentId
|
|
7528
|
-
}, views == null ? void 0 : views.container, props);
|
|
7529
|
-
if (asChild && /*#__PURE__*/React.isValidElement(children)) {
|
|
7530
|
-
// Clone the child element and merge props
|
|
7531
|
-
var child = React.Children.only(children);
|
|
7532
|
-
return /*#__PURE__*/React.cloneElement(child, Object.assign({}, triggerProps, child.props));
|
|
7533
|
-
}
|
|
7534
|
-
// Default: wrap children in a View
|
|
7535
|
-
return /*#__PURE__*/React__default.createElement(appStudio.View, Object.assign({
|
|
7536
|
-
position: "relative",
|
|
7537
|
-
display: "inline-block"
|
|
7538
|
-
}, triggerProps), children);
|
|
7843
|
+
/**
|
|
7844
|
+
* Get the day of the week (0-6) from an ISO date string
|
|
7845
|
+
*/
|
|
7846
|
+
var getDayOfWeek = dateISO => {
|
|
7847
|
+
return dateUTC(dateISO).getUTCDay();
|
|
7539
7848
|
};
|
|
7540
|
-
|
|
7541
|
-
|
|
7542
|
-
|
|
7543
|
-
|
|
7544
|
-
|
|
7545
|
-
align = 'center',
|
|
7546
|
-
sideOffset = 8,
|
|
7547
|
-
style: userStyle,
|
|
7548
|
-
// User provided style override
|
|
7549
|
-
backgroundColor = 'white',
|
|
7550
|
-
borderRadius = '4px',
|
|
7551
|
-
boxShadow = '0px 2px 8px rgba(0, 0, 0, 0.15)',
|
|
7552
|
-
padding = '12px',
|
|
7553
|
-
minWidth = '50px',
|
|
7554
|
-
maxWidth = '300px'
|
|
7555
|
-
} = _ref3,
|
|
7556
|
-
props = _objectWithoutPropertiesLoose(_ref3, _excluded2$6);
|
|
7557
|
-
var {
|
|
7558
|
-
isOpen,
|
|
7559
|
-
cancelCloseTimer,
|
|
7560
|
-
closeCard,
|
|
7561
|
-
contentRef,
|
|
7562
|
-
triggerRef,
|
|
7563
|
-
contentId,
|
|
7564
|
-
triggerId
|
|
7565
|
-
} = useHoverCardContext();
|
|
7566
|
-
// Use useElementPosition for intelligent positioning
|
|
7567
|
-
var {
|
|
7568
|
-
ref: positionRef,
|
|
7569
|
-
relation
|
|
7570
|
-
} = appStudio.useElementPosition({
|
|
7571
|
-
trackChanges: true,
|
|
7572
|
-
trackOnHover: true,
|
|
7573
|
-
trackOnScroll: true,
|
|
7574
|
-
trackOnResize: true
|
|
7575
|
-
});
|
|
7576
|
-
// Sync the position ref with the trigger ref for positioning calculations
|
|
7577
|
-
React.useEffect(() => {
|
|
7578
|
-
if (triggerRef != null && triggerRef.current && (positionRef == null ? void 0 : positionRef.current) !== triggerRef.current) {
|
|
7579
|
-
// Update the position tracking to use the trigger element
|
|
7580
|
-
if (positionRef) {
|
|
7581
|
-
positionRef.current = triggerRef.current;
|
|
7582
|
-
}
|
|
7583
|
-
}
|
|
7584
|
-
}, [triggerRef, positionRef, isOpen]);
|
|
7585
|
-
var handleMouseEnter = () => cancelCloseTimer(); // Keep card open if mouse enters content
|
|
7586
|
-
var handleMouseLeave = () => closeCard();
|
|
7587
|
-
if (!isOpen) {
|
|
7588
|
-
return null; // Don't render content if not open
|
|
7589
|
-
}
|
|
7590
|
-
// Create intelligent positioning styles based on useElementPosition relation data
|
|
7591
|
-
var getPositionStyles = () => {
|
|
7592
|
-
if (!relation || !(triggerRef != null && triggerRef.current)) {
|
|
7593
|
-
// Fallback positioning if relation data is not available
|
|
7594
|
-
return {
|
|
7595
|
-
position: 'absolute',
|
|
7596
|
-
top: 0,
|
|
7597
|
-
left: 0,
|
|
7598
|
-
zIndex: 1000
|
|
7599
|
-
};
|
|
7600
|
-
}
|
|
7601
|
-
var triggerRect = triggerRef.current.getBoundingClientRect();
|
|
7602
|
-
var placement = side;
|
|
7603
|
-
// Use relation data to determine optimal placement
|
|
7604
|
-
// If preferred side doesn't have enough space, use the side with more space
|
|
7605
|
-
if (side === 'bottom' && relation.space.vertical === 'top') {
|
|
7606
|
-
placement = 'top';
|
|
7607
|
-
} else if (side === 'top' && relation.space.vertical === 'bottom') {
|
|
7608
|
-
placement = 'bottom';
|
|
7609
|
-
} else if (side === 'right' && relation.space.horizontal === 'left') {
|
|
7610
|
-
placement = 'left';
|
|
7611
|
-
} else if (side === 'left' && relation.space.horizontal === 'right') {
|
|
7612
|
-
placement = 'right';
|
|
7613
|
-
}
|
|
7614
|
-
// Calculate position based on optimal placement
|
|
7615
|
-
var x = 0;
|
|
7616
|
-
var y = 0;
|
|
7617
|
-
switch (placement) {
|
|
7618
|
-
case 'bottom':
|
|
7619
|
-
x = triggerRect.left + triggerRect.width / 2;
|
|
7620
|
-
y = triggerRect.bottom + sideOffset;
|
|
7621
|
-
break;
|
|
7622
|
-
case 'top':
|
|
7623
|
-
x = triggerRect.left + triggerRect.width / 2;
|
|
7624
|
-
y = triggerRect.top - sideOffset;
|
|
7625
|
-
break;
|
|
7626
|
-
case 'right':
|
|
7627
|
-
x = triggerRect.right + sideOffset;
|
|
7628
|
-
y = triggerRect.top + triggerRect.height / 2;
|
|
7629
|
-
break;
|
|
7630
|
-
case 'left':
|
|
7631
|
-
x = triggerRect.left - sideOffset;
|
|
7632
|
-
y = triggerRect.top + triggerRect.height / 2;
|
|
7633
|
-
break;
|
|
7634
|
-
}
|
|
7635
|
-
return {
|
|
7636
|
-
position: 'fixed',
|
|
7637
|
-
left: x,
|
|
7638
|
-
top: y,
|
|
7639
|
-
zIndex: 1000,
|
|
7640
|
-
transform: getTransformOrigin(placement)
|
|
7641
|
-
};
|
|
7642
|
-
};
|
|
7643
|
-
// Helper function to set transform origin for better positioning
|
|
7644
|
-
var getTransformOrigin = placement => {
|
|
7645
|
-
switch (placement) {
|
|
7646
|
-
case 'bottom':
|
|
7647
|
-
return 'translate(-50%, 0)';
|
|
7648
|
-
case 'top':
|
|
7649
|
-
return 'translate(-50%, -100%)';
|
|
7650
|
-
case 'right':
|
|
7651
|
-
return 'translate(0, -50%)';
|
|
7652
|
-
case 'left':
|
|
7653
|
-
return 'translate(-100%, -50%)';
|
|
7654
|
-
default:
|
|
7655
|
-
return 'translate(-50%, 0)';
|
|
7656
|
-
}
|
|
7657
|
-
};
|
|
7658
|
-
var positionStyles = getPositionStyles();
|
|
7659
|
-
return /*#__PURE__*/React__default.createElement(appStudio.View, Object.assign({
|
|
7660
|
-
ref: contentRef,
|
|
7661
|
-
id: contentId,
|
|
7662
|
-
role: "tooltip" // Use tooltip role for accessibility
|
|
7663
|
-
,
|
|
7664
|
-
"aria-labelledby": triggerId,
|
|
7665
|
-
onMouseEnter: handleMouseEnter,
|
|
7666
|
-
onMouseLeave: handleMouseLeave,
|
|
7667
|
-
backgroundColor: backgroundColor,
|
|
7668
|
-
borderRadius: borderRadius,
|
|
7669
|
-
boxShadow: boxShadow,
|
|
7670
|
-
padding: padding,
|
|
7671
|
-
minWidth: minWidth,
|
|
7672
|
-
maxWidth: maxWidth,
|
|
7673
|
-
// Combine intelligent position styles with user styles
|
|
7674
|
-
style: Object.assign({}, positionStyles, userStyle)
|
|
7675
|
-
}, views == null ? void 0 : views.container, props), children);
|
|
7849
|
+
/**
|
|
7850
|
+
* Get the date number (1-31) from an ISO date string
|
|
7851
|
+
*/
|
|
7852
|
+
var getDateNumber = dateISO => {
|
|
7853
|
+
return dateUTC(dateISO).getUTCDate();
|
|
7676
7854
|
};
|
|
7677
|
-
|
|
7678
|
-
var _excluded$j = ["children", "views", "openDelay", "closeDelay"];
|
|
7679
7855
|
/**
|
|
7680
|
-
*
|
|
7681
|
-
* Supports configurable open and close delays for a smoother user experience.
|
|
7856
|
+
* Get the month (0-11) from an ISO date string
|
|
7682
7857
|
*/
|
|
7683
|
-
var
|
|
7684
|
-
|
|
7685
|
-
children,
|
|
7686
|
-
views,
|
|
7687
|
-
openDelay,
|
|
7688
|
-
closeDelay
|
|
7689
|
-
} = _ref,
|
|
7690
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$j);
|
|
7691
|
-
var hoverCardState = useHoverCardState({
|
|
7692
|
-
openDelay,
|
|
7693
|
-
closeDelay
|
|
7694
|
-
});
|
|
7695
|
-
return /*#__PURE__*/React__default.createElement(HoverCardProvider, {
|
|
7696
|
-
value: hoverCardState
|
|
7697
|
-
}, /*#__PURE__*/React__default.createElement(appStudio.View, Object.assign({
|
|
7698
|
-
position: "relative",
|
|
7699
|
-
display: "inline-block"
|
|
7700
|
-
}, views == null ? void 0 : views.container, props), children));
|
|
7858
|
+
var getMonth = dateISO => {
|
|
7859
|
+
return dateUTC(dateISO).getUTCMonth();
|
|
7701
7860
|
};
|
|
7702
|
-
|
|
7703
|
-
|
|
7704
|
-
|
|
7705
|
-
|
|
7706
|
-
|
|
7707
|
-
|
|
7708
|
-
|
|
7861
|
+
/**
|
|
7862
|
+
* Get the year from an ISO date string
|
|
7863
|
+
*/
|
|
7864
|
+
var getYear = dateISO => {
|
|
7865
|
+
return dateUTC(dateISO).getUTCFullYear();
|
|
7866
|
+
};
|
|
7867
|
+
/**
|
|
7868
|
+
* Get the first day of the month for a given date
|
|
7869
|
+
*/
|
|
7870
|
+
var getFirstDayOfMonth = dateISO => {
|
|
7871
|
+
var d = dateUTC(dateISO);
|
|
7872
|
+
return new Date(Date.UTC(d.getUTCFullYear(), d.getUTCMonth(), 1)).toISOString().slice(0, 10);
|
|
7873
|
+
};
|
|
7874
|
+
/**
|
|
7875
|
+
* Get the start date of the calendar grid (may be in previous month)
|
|
7876
|
+
*/
|
|
7877
|
+
var getCalendarStartDate = function getCalendarStartDate(monthDateISO, weekStartsOn) {
|
|
7878
|
+
if (weekStartsOn === void 0) {
|
|
7879
|
+
weekStartsOn = 0;
|
|
7880
|
+
}
|
|
7881
|
+
var firstDay = getFirstDayOfMonth(monthDateISO);
|
|
7882
|
+
var firstDayOfWeek = getDayOfWeek(firstDay);
|
|
7883
|
+
var daysToSubtract = (firstDayOfWeek - weekStartsOn + 7) % 7;
|
|
7884
|
+
return addDateDays(firstDay, -daysToSubtract);
|
|
7885
|
+
};
|
|
7886
|
+
/**
|
|
7887
|
+
* Generate array of dates for the calendar grid (42 days = 6 weeks)
|
|
7888
|
+
*/
|
|
7889
|
+
var getCalendarDates = function getCalendarDates(monthDateISO, weekStartsOn) {
|
|
7890
|
+
if (weekStartsOn === void 0) {
|
|
7891
|
+
weekStartsOn = 0;
|
|
7709
7892
|
}
|
|
7710
|
-
var
|
|
7711
|
-
|
|
7712
|
-
|
|
7893
|
+
var startDate = getCalendarStartDate(monthDateISO, weekStartsOn);
|
|
7894
|
+
var dates = [];
|
|
7895
|
+
for (var i = 0; i < 42; i++) {
|
|
7896
|
+
dates.push(addDateDays(startDate, i));
|
|
7713
7897
|
}
|
|
7714
|
-
return
|
|
7715
|
-
};
|
|
7716
|
-
|
|
7717
|
-
|
|
7718
|
-
|
|
7719
|
-
|
|
7720
|
-
return
|
|
7721
|
-
|
|
7722
|
-
|
|
7898
|
+
return dates;
|
|
7899
|
+
};
|
|
7900
|
+
/**
|
|
7901
|
+
* Get month name from date
|
|
7902
|
+
*/
|
|
7903
|
+
var getMonthName = dateISO => {
|
|
7904
|
+
return dateUTC(dateISO).toLocaleDateString('en-US', {
|
|
7905
|
+
month: 'long',
|
|
7906
|
+
timeZone: 'UTC'
|
|
7723
7907
|
});
|
|
7724
7908
|
};
|
|
7725
|
-
|
|
7726
|
-
|
|
7727
|
-
|
|
7728
|
-
|
|
7729
|
-
|
|
7730
|
-
|
|
7731
|
-
return events.filter(event => {
|
|
7732
|
-
var {
|
|
7733
|
-
startDate,
|
|
7734
|
-
endDate
|
|
7735
|
-
} = event;
|
|
7736
|
-
if (dateFns.isWithinInterval(startDate, dayInterval)) {
|
|
7737
|
-
return true;
|
|
7738
|
-
}
|
|
7739
|
-
if (dateFns.isWithinInterval(endDate, dayInterval)) {
|
|
7740
|
-
return true;
|
|
7741
|
-
}
|
|
7742
|
-
return startDate <= dayInterval.start && endDate >= dayInterval.end;
|
|
7743
|
-
}).sort((a, b) => a.startDate.getTime() - b.startDate.getTime());
|
|
7909
|
+
/**
|
|
7910
|
+
* Get the previous month date
|
|
7911
|
+
*/
|
|
7912
|
+
var getPreviousMonth = dateISO => {
|
|
7913
|
+
var d = dateUTC(dateISO);
|
|
7914
|
+
return new Date(Date.UTC(d.getUTCFullYear(), d.getUTCMonth() - 1, 1)).toISOString().slice(0, 10);
|
|
7744
7915
|
};
|
|
7745
|
-
|
|
7746
|
-
|
|
7747
|
-
|
|
7748
|
-
|
|
7749
|
-
|
|
7750
|
-
return
|
|
7916
|
+
/**
|
|
7917
|
+
* Get the next month date
|
|
7918
|
+
*/
|
|
7919
|
+
var getNextMonth = dateISO => {
|
|
7920
|
+
var d = dateUTC(dateISO);
|
|
7921
|
+
return new Date(Date.UTC(d.getUTCFullYear(), d.getUTCMonth() + 1, 1)).toISOString().slice(0, 10);
|
|
7751
7922
|
};
|
|
7752
|
-
|
|
7753
|
-
|
|
7754
|
-
|
|
7755
|
-
|
|
7756
|
-
|
|
7757
|
-
|
|
7758
|
-
|
|
7759
|
-
|
|
7760
|
-
|
|
7761
|
-
|
|
7762
|
-
|
|
7763
|
-
|
|
7764
|
-
|
|
7765
|
-
var timeRange = dateFns.format(event.startDate, 'p') + (event.endDate.getTime() !== event.startDate.getTime() ? " \u2013 " + dateFns.format(event.endDate, 'p') : '');
|
|
7766
|
-
var eventCard = /*#__PURE__*/React__default.createElement(appStudio.Vertical, Object.assign({
|
|
7767
|
-
gap: 6,
|
|
7768
|
-
padding: 12,
|
|
7769
|
-
borderRadius: 8,
|
|
7770
|
-
backgroundColor: context.isToday ? 'color.primary.50' : 'color.gray.100',
|
|
7771
|
-
borderWidth: 1,
|
|
7772
|
-
borderStyle: "solid",
|
|
7773
|
-
borderColor: context.isToday ? 'color.primary.200' : 'color.gray.200',
|
|
7774
|
-
flexShrink: 0,
|
|
7775
|
-
cursor: "pointer"
|
|
7776
|
-
}, views == null ? void 0 : views.event), /*#__PURE__*/React__default.createElement(Text, Object.assign({
|
|
7777
|
-
fontWeight: "600",
|
|
7778
|
-
fontSize: 14,
|
|
7779
|
-
maxLines: 2
|
|
7780
|
-
}, views == null ? void 0 : views.eventTitle), event.title), /*#__PURE__*/React__default.createElement(Text, Object.assign({
|
|
7781
|
-
fontSize: 12,
|
|
7782
|
-
color: "color.gray.600",
|
|
7783
|
-
maxLines: 1
|
|
7784
|
-
}, views == null ? void 0 : views.eventTime), timeRange), event.description && context.view !== 'month' && (/*#__PURE__*/React__default.createElement(Text, {
|
|
7785
|
-
fontSize: 12,
|
|
7786
|
-
color: "color.gray.700",
|
|
7787
|
-
maxLines: 2
|
|
7788
|
-
}, event.description)));
|
|
7789
|
-
return /*#__PURE__*/React__default.createElement(HoverCard, {
|
|
7790
|
-
key: key,
|
|
7791
|
-
openDelay: 100,
|
|
7792
|
-
closeDelay: 200
|
|
7793
|
-
}, /*#__PURE__*/React__default.createElement(HoverCard.Trigger, {
|
|
7794
|
-
asChild: true
|
|
7795
|
-
}, eventCard), /*#__PURE__*/React__default.createElement(HoverCard.Content, {
|
|
7796
|
-
side: "top",
|
|
7797
|
-
align: "start",
|
|
7798
|
-
maxWidth: "350px",
|
|
7799
|
-
backgroundColor: "color.white",
|
|
7800
|
-
padding: 16,
|
|
7801
|
-
boxShadow: "0px 4px 12px rgba(0, 0, 0, 0.15)"
|
|
7802
|
-
}, /*#__PURE__*/React__default.createElement(appStudio.Vertical, {
|
|
7803
|
-
gap: 12
|
|
7804
|
-
}, /*#__PURE__*/React__default.createElement(Text, {
|
|
7805
|
-
fontWeight: "700",
|
|
7806
|
-
fontSize: 16,
|
|
7807
|
-
color: "color.gray.900"
|
|
7808
|
-
}, event.title), /*#__PURE__*/React__default.createElement(appStudio.Vertical, {
|
|
7809
|
-
gap: 6
|
|
7810
|
-
}, /*#__PURE__*/React__default.createElement(appStudio.Horizontal, {
|
|
7811
|
-
gap: 8,
|
|
7812
|
-
alignItems: "center"
|
|
7813
|
-
}, /*#__PURE__*/React__default.createElement(Text, {
|
|
7814
|
-
fontSize: 12,
|
|
7815
|
-
fontWeight: "600",
|
|
7816
|
-
color: "color.gray.600"
|
|
7817
|
-
}, "\uD83D\uDCC5"), /*#__PURE__*/React__default.createElement(Text, {
|
|
7818
|
-
fontSize: 13,
|
|
7819
|
-
color: "color.gray.700"
|
|
7820
|
-
}, dateFns.format(event.startDate, 'EEEE, MMMM d, yyyy'))), /*#__PURE__*/React__default.createElement(appStudio.Horizontal, {
|
|
7821
|
-
gap: 8,
|
|
7822
|
-
alignItems: "center"
|
|
7823
|
-
}, /*#__PURE__*/React__default.createElement(Text, {
|
|
7824
|
-
fontSize: 12,
|
|
7825
|
-
fontWeight: "600",
|
|
7826
|
-
color: "color.gray.600"
|
|
7827
|
-
}, "\uD83D\uDD50"), /*#__PURE__*/React__default.createElement(Text, {
|
|
7828
|
-
fontSize: 13,
|
|
7829
|
-
color: "color.gray.700"
|
|
7830
|
-
}, timeRange))), event.description && (/*#__PURE__*/React__default.createElement(appStudio.Vertical, {
|
|
7831
|
-
gap: 4
|
|
7832
|
-
}, /*#__PURE__*/React__default.createElement(Text, {
|
|
7833
|
-
fontSize: 12,
|
|
7834
|
-
fontWeight: "600",
|
|
7835
|
-
color: "color.gray.600"
|
|
7836
|
-
}, "Description"), /*#__PURE__*/React__default.createElement(Text, {
|
|
7837
|
-
fontSize: 13,
|
|
7838
|
-
color: "color.gray.700"
|
|
7839
|
-
}, event.description))))));
|
|
7923
|
+
/**
|
|
7924
|
+
* Day names array (Sunday to Saturday)
|
|
7925
|
+
*/
|
|
7926
|
+
var DAY_NAMES = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'];
|
|
7927
|
+
/**
|
|
7928
|
+
* Get day names starting from specified day
|
|
7929
|
+
*/
|
|
7930
|
+
var getDayNames = function getDayNames(weekStartsOn) {
|
|
7931
|
+
if (weekStartsOn === void 0) {
|
|
7932
|
+
weekStartsOn = 0;
|
|
7933
|
+
}
|
|
7934
|
+
var names = [...DAY_NAMES];
|
|
7935
|
+
return [...names.slice(weekStartsOn), ...names.slice(0, weekStartsOn)];
|
|
7840
7936
|
};
|
|
7841
|
-
|
|
7842
|
-
|
|
7843
|
-
|
|
7844
|
-
|
|
7845
|
-
|
|
7846
|
-
|
|
7847
|
-
|
|
7848
|
-
|
|
7849
|
-
|
|
7850
|
-
|
|
7851
|
-
|
|
7852
|
-
|
|
7853
|
-
|
|
7854
|
-
|
|
7855
|
-
|
|
7856
|
-
|
|
7857
|
-
|
|
7858
|
-
|
|
7859
|
-
|
|
7860
|
-
|
|
7861
|
-
|
|
7862
|
-
|
|
7863
|
-
|
|
7864
|
-
|
|
7865
|
-
|
|
7866
|
-
|
|
7867
|
-
|
|
7868
|
-
|
|
7869
|
-
|
|
7870
|
-
|
|
7871
|
-
|
|
7872
|
-
}
|
|
7873
|
-
|
|
7874
|
-
|
|
7875
|
-
|
|
7876
|
-
|
|
7877
|
-
|
|
7878
|
-
|
|
7879
|
-
|
|
7880
|
-
|
|
7881
|
-
|
|
7882
|
-
|
|
7883
|
-
|
|
7884
|
-
|
|
7885
|
-
|
|
7886
|
-
|
|
7887
|
-
|
|
7888
|
-
|
|
7889
|
-
|
|
7890
|
-
|
|
7891
|
-
|
|
7892
|
-
justifyContent: "space-between",
|
|
7893
|
-
alignItems: "center",
|
|
7894
|
-
maxWidth: '100%'
|
|
7895
|
-
}, /*#__PURE__*/React__default.createElement(Text, Object.assign({
|
|
7896
|
-
fontSize: 20,
|
|
7897
|
-
fontWeight: "700"
|
|
7898
|
-
}, views == null ? void 0 : views.headerTitle), label), /*#__PURE__*/React__default.createElement(appStudio.Horizontal, Object.assign({
|
|
7899
|
-
gap: 8
|
|
7900
|
-
}, views == null ? void 0 : views.viewSwitcher), VIEW_OPTIONS.map(option => (/*#__PURE__*/React__default.createElement(Button, Object.assign({
|
|
7901
|
-
key: option.value,
|
|
7902
|
-
variant: view === option.value ? 'filled' : 'ghost',
|
|
7903
|
-
isDisabled: view === option.value,
|
|
7904
|
-
onClick: () => onViewChange(option.value)
|
|
7905
|
-
}, views == null ? void 0 : views.viewButton), option.label))))), /*#__PURE__*/React__default.createElement(appStudio.Horizontal, Object.assign({
|
|
7906
|
-
gap: 8,
|
|
7907
|
-
alignItems: "center"
|
|
7908
|
-
}, views == null ? void 0 : views.navigation), /*#__PURE__*/React__default.createElement(Button, Object.assign({
|
|
7909
|
-
variant: "ghost",
|
|
7910
|
-
onClick: onPrevious
|
|
7911
|
-
}, views == null ? void 0 : views.navigationButton), "\u2190 Previous", ' ', view === 'day' ? 'Day' : view === 'week' ? 'Week' : 'Month'), /*#__PURE__*/React__default.createElement(Button, Object.assign({
|
|
7912
|
-
variant: "ghost",
|
|
7913
|
-
onClick: onToday
|
|
7914
|
-
}, views == null ? void 0 : views.navigationButton), "Today"), /*#__PURE__*/React__default.createElement(Button, Object.assign({
|
|
7915
|
-
variant: "ghost",
|
|
7916
|
-
onClick: onNext
|
|
7917
|
-
}, views == null ? void 0 : views.navigationButton), "Next ", view === 'day' ? 'Day' : view === 'week' ? 'Week' : 'Month', " \u2192"))), view !== 'day' && /*#__PURE__*/React__default.createElement(appStudio.View, {
|
|
7918
|
-
flexShrink: 0
|
|
7919
|
-
}, weekdayRow), /*#__PURE__*/React__default.createElement(appStudio.Vertical, Object.assign({
|
|
7920
|
-
gap: 12,
|
|
7921
|
-
flex: 1,
|
|
7922
|
-
overflow: "auto"
|
|
7923
|
-
}, views == null ? void 0 : views.grid), weeks.map((week, index) => (/*#__PURE__*/React__default.createElement(appStudio.View, Object.assign({
|
|
7924
|
-
key: view + "-week-" + index,
|
|
7925
|
-
display: "grid",
|
|
7926
|
-
gridTemplateColumns: "repeat(" + week.length + ", 1fr)",
|
|
7927
|
-
gap: 12,
|
|
7928
|
-
height: view === 'month' ? '180px' : view === 'week' ? '100%' : 'auto',
|
|
7929
|
-
minHeight: view === 'week' ? '300px' : 'auto'
|
|
7930
|
-
}, views == null ? void 0 : views.weekRow), week.map(day => {
|
|
7931
|
-
var _eventsByDay$get;
|
|
7932
|
-
var dayKey = formatDayKey(day);
|
|
7933
|
-
var isToday = dateFns.isSameDay(day, today);
|
|
7934
|
-
var events = (_eventsByDay$get = eventsByDay.get(dayKey)) != null ? _eventsByDay$get : [];
|
|
7935
|
-
var context = {
|
|
7936
|
-
day,
|
|
7937
|
-
isToday,
|
|
7938
|
-
view
|
|
7939
|
-
};
|
|
7940
|
-
var shouldDim = view === 'month' && !dateFns.isSameMonth(day, currentDate);
|
|
7941
|
-
return /*#__PURE__*/React__default.createElement(appStudio.Vertical, Object.assign({
|
|
7942
|
-
key: dayKey,
|
|
7943
|
-
gap: 12,
|
|
7944
|
-
padding: 16,
|
|
7945
|
-
borderWidth: 1,
|
|
7946
|
-
borderStyle: "solid",
|
|
7947
|
-
borderColor: isToday ? 'color.primary.200' : 'color.gray.200',
|
|
7948
|
-
borderRadius: 12,
|
|
7949
|
-
backgroundColor: "color.gray.50",
|
|
7950
|
-
opacity: shouldDim ? 0.6 : 1,
|
|
7951
|
-
display: "flex",
|
|
7952
|
-
flexDirection: "column",
|
|
7953
|
-
height: "100%",
|
|
7954
|
-
minHeight: view === 'month' ? '180px' : '300px'
|
|
7955
|
-
}, views == null ? void 0 : views.dayColumn), /*#__PURE__*/React__default.createElement(appStudio.Horizontal, Object.assign({
|
|
7956
|
-
justifyContent: "space-between",
|
|
7957
|
-
alignItems: "center",
|
|
7958
|
-
flexShrink: 0
|
|
7959
|
-
}, views == null ? void 0 : views.dayHeader), /*#__PURE__*/React__default.createElement(Text, Object.assign({
|
|
7960
|
-
fontWeight: "600",
|
|
7961
|
-
fontSize: 16
|
|
7962
|
-
}, views == null ? void 0 : views.dayNumber), dateFns.format(day, 'd')), view !== 'month' && (/*#__PURE__*/React__default.createElement(Text, Object.assign({
|
|
7963
|
-
fontSize: 14,
|
|
7964
|
-
color: "color.gray.600"
|
|
7965
|
-
}, views == null ? void 0 : views.dayMeta), dateFns.format(day, 'EEEE')))), /*#__PURE__*/React__default.createElement(appStudio.Vertical, Object.assign({
|
|
7966
|
-
gap: 8,
|
|
7967
|
-
flex: 1,
|
|
7968
|
-
overflow: "auto"
|
|
7969
|
-
}, views == null ? void 0 : views.events), events.length > 0 ? events.map(event => {
|
|
7970
|
-
var _event$id;
|
|
7971
|
-
var key = formatDayKey(day) + "-" + ((_event$id = event.id) != null ? _event$id : event.title) + "-" + event.startDate.getTime();
|
|
7972
|
-
if (renderEvent) {
|
|
7973
|
-
var rendered = renderEvent(event, context);
|
|
7974
|
-
if (/*#__PURE__*/React.isValidElement(rendered)) {
|
|
7975
|
-
return /*#__PURE__*/React.cloneElement(rendered, {
|
|
7976
|
-
key
|
|
7977
|
-
});
|
|
7978
|
-
}
|
|
7979
|
-
return /*#__PURE__*/React__default.createElement(React__default.Fragment, {
|
|
7980
|
-
key: key
|
|
7981
|
-
}, rendered);
|
|
7937
|
+
/**
|
|
7938
|
+
* Layout events with proper positioning to avoid overlaps
|
|
7939
|
+
* Returns positioned events for each week
|
|
7940
|
+
*/
|
|
7941
|
+
var layoutEvents = (events, calendarDates) => {
|
|
7942
|
+
var calendarStart = calendarDates[0];
|
|
7943
|
+
// Convert events to positioned items with day indices
|
|
7944
|
+
var items = events.map(ev => {
|
|
7945
|
+
var startIdx = daysBetweenUTC(ev.start, calendarStart);
|
|
7946
|
+
var endIdx = daysBetweenUTC(ev.end, calendarStart);
|
|
7947
|
+
// Clamp to calendar boundaries (0-41 for 6 weeks)
|
|
7948
|
+
var clampedStart = Math.max(0, Math.min(41, startIdx));
|
|
7949
|
+
var clampedEnd = Math.max(0, Math.min(41, endIdx));
|
|
7950
|
+
// Skip if completely outside calendar
|
|
7951
|
+
if (endIdx < 0 || startIdx > 41) return null;
|
|
7952
|
+
var duration = clampedEnd - clampedStart + 1;
|
|
7953
|
+
var weekIndex = Math.floor(clampedStart / 7);
|
|
7954
|
+
var dayOfWeek = clampedStart % 7;
|
|
7955
|
+
return Object.assign({}, ev, {
|
|
7956
|
+
startDay: clampedStart,
|
|
7957
|
+
endDay: clampedEnd,
|
|
7958
|
+
duration: duration,
|
|
7959
|
+
row: 0,
|
|
7960
|
+
weekIndex,
|
|
7961
|
+
dayOfWeek
|
|
7962
|
+
});
|
|
7963
|
+
}).filter(item => item !== null);
|
|
7964
|
+
// Sort by start day, then by duration (longer first)
|
|
7965
|
+
items.sort((a, b) => {
|
|
7966
|
+
if (a.startDay !== b.startDay) return a.startDay - b.startDay;
|
|
7967
|
+
return b.duration - a.duration;
|
|
7968
|
+
});
|
|
7969
|
+
// Assign rows per week using greedy algorithm to prevent overlaps
|
|
7970
|
+
var rowsByWeek = Array.from({
|
|
7971
|
+
length: 6
|
|
7972
|
+
}, () => []);
|
|
7973
|
+
var rowCountByWeek = Array.from({
|
|
7974
|
+
length: 6
|
|
7975
|
+
}, () => 0);
|
|
7976
|
+
items.forEach(item => {
|
|
7977
|
+
var weekIdx = item.weekIndex;
|
|
7978
|
+
var rows = rowsByWeek[weekIdx];
|
|
7979
|
+
var placed = false;
|
|
7980
|
+
for (var i = 0; i < rows.length; i++) {
|
|
7981
|
+
var row = rows[i];
|
|
7982
|
+
var hasConflict = row.some(existing => !(item.startDay > existing.endDay || item.endDay < existing.startDay));
|
|
7983
|
+
if (!hasConflict) {
|
|
7984
|
+
row.push(item);
|
|
7985
|
+
item.row = i;
|
|
7986
|
+
placed = true;
|
|
7987
|
+
break;
|
|
7982
7988
|
}
|
|
7983
|
-
|
|
7984
|
-
|
|
7985
|
-
|
|
7986
|
-
|
|
7987
|
-
|
|
7988
|
-
|
|
7989
|
-
})
|
|
7989
|
+
}
|
|
7990
|
+
if (!placed) {
|
|
7991
|
+
item.row = rows.length;
|
|
7992
|
+
rows.push([item]);
|
|
7993
|
+
}
|
|
7994
|
+
rowCountByWeek[weekIdx] = rows.length;
|
|
7995
|
+
});
|
|
7996
|
+
return {
|
|
7997
|
+
items,
|
|
7998
|
+
rowCountByWeek
|
|
7999
|
+
};
|
|
8000
|
+
};
|
|
8001
|
+
/**
|
|
8002
|
+
* Check if a date is in the current month
|
|
8003
|
+
*/
|
|
8004
|
+
var isInMonth = (dateISO, monthDateISO) => {
|
|
8005
|
+
return getMonth(dateISO) === getMonth(monthDateISO) && getYear(dateISO) === getYear(monthDateISO);
|
|
7990
8006
|
};
|
|
7991
8007
|
|
|
7992
|
-
|
|
7993
|
-
|
|
7994
|
-
|
|
7995
|
-
|
|
7996
|
-
|
|
7997
|
-
|
|
7998
|
-
|
|
7999
|
-
|
|
8000
|
-
|
|
8001
|
-
|
|
8002
|
-
|
|
8003
|
-
|
|
8004
|
-
|
|
8005
|
-
|
|
8006
|
-
|
|
8008
|
+
/**
|
|
8009
|
+
* Event color configurations
|
|
8010
|
+
*/
|
|
8011
|
+
var EVENT_COLORS = {
|
|
8012
|
+
blue: {
|
|
8013
|
+
background: 'color.blue.50',
|
|
8014
|
+
border: 'color.blue.500',
|
|
8015
|
+
text: 'color.blue.700'
|
|
8016
|
+
},
|
|
8017
|
+
red: {
|
|
8018
|
+
background: 'color.red.50',
|
|
8019
|
+
border: 'color.red.500',
|
|
8020
|
+
text: 'color.red.700'
|
|
8021
|
+
},
|
|
8022
|
+
green: {
|
|
8023
|
+
background: 'color.green.50',
|
|
8024
|
+
border: 'color.green.500',
|
|
8025
|
+
text: 'color.green.700'
|
|
8026
|
+
},
|
|
8027
|
+
purple: {
|
|
8028
|
+
background: 'color.purple.50',
|
|
8029
|
+
border: 'color.purple.500',
|
|
8030
|
+
text: 'color.purple.700'
|
|
8031
|
+
},
|
|
8032
|
+
orange: {
|
|
8033
|
+
background: 'color.orange.50',
|
|
8034
|
+
border: 'color.orange.500',
|
|
8035
|
+
text: 'color.orange.700'
|
|
8007
8036
|
}
|
|
8008
|
-
return dateFns.format(date, 'MMMM yyyy');
|
|
8009
8037
|
};
|
|
8010
|
-
|
|
8011
|
-
|
|
8038
|
+
/**
|
|
8039
|
+
* Base styles for the calendar container
|
|
8040
|
+
*/
|
|
8041
|
+
var containerStyles = {
|
|
8042
|
+
width: '100%',
|
|
8043
|
+
maxWidth: 1200,
|
|
8044
|
+
border: '1px solid',
|
|
8045
|
+
borderColor: 'color.gray.200',
|
|
8046
|
+
borderRadius: 8,
|
|
8047
|
+
overflow: 'hidden',
|
|
8048
|
+
backgroundColor: 'color.white'
|
|
8049
|
+
};
|
|
8050
|
+
/**
|
|
8051
|
+
* Header styles (navigation bar)
|
|
8052
|
+
*/
|
|
8053
|
+
var headerStyles = {
|
|
8054
|
+
display: 'flex',
|
|
8055
|
+
alignItems: 'center',
|
|
8056
|
+
justifyContent: 'space-between',
|
|
8057
|
+
padding: 16,
|
|
8058
|
+
paddingLeft: 20,
|
|
8059
|
+
paddingRight: 20,
|
|
8060
|
+
borderBottom: '1px solid',
|
|
8061
|
+
borderColor: 'color.gray.200',
|
|
8062
|
+
backgroundColor: 'color.white'
|
|
8063
|
+
};
|
|
8064
|
+
/**
|
|
8065
|
+
* Month title styles
|
|
8066
|
+
*/
|
|
8067
|
+
var monthTitleStyles = {
|
|
8068
|
+
fontSize: 20,
|
|
8069
|
+
fontWeight: 500,
|
|
8070
|
+
color: 'color.gray.900'
|
|
8071
|
+
};
|
|
8072
|
+
/**
|
|
8073
|
+
* Month grid styles (7 columns for days)
|
|
8074
|
+
*/
|
|
8075
|
+
var monthGridStyles = {
|
|
8076
|
+
display: 'flex',
|
|
8077
|
+
flexDirection: 'column',
|
|
8078
|
+
backgroundColor: 'color.white'
|
|
8079
|
+
};
|
|
8080
|
+
/**
|
|
8081
|
+
* Weekday header row styles
|
|
8082
|
+
*/
|
|
8083
|
+
var weekdayHeaderStyles = {
|
|
8084
|
+
display: 'grid',
|
|
8085
|
+
gridTemplateColumns: 'repeat(7, 1fr)',
|
|
8086
|
+
borderBottom: '1px solid',
|
|
8087
|
+
borderColor: 'color.gray.200',
|
|
8088
|
+
backgroundColor: 'color.gray.50'
|
|
8089
|
+
};
|
|
8090
|
+
/**
|
|
8091
|
+
* Individual weekday label styles
|
|
8092
|
+
*/
|
|
8093
|
+
var weekdayLabelStyles = {
|
|
8094
|
+
padding: 8,
|
|
8095
|
+
textAlign: 'center',
|
|
8096
|
+
fontSize: 11,
|
|
8097
|
+
fontWeight: 500,
|
|
8098
|
+
color: 'color.gray.700',
|
|
8099
|
+
textTransform: 'uppercase',
|
|
8100
|
+
letterSpacing: 0.5
|
|
8101
|
+
};
|
|
8102
|
+
/**
|
|
8103
|
+
* Individual day cell styles
|
|
8104
|
+
*/
|
|
8105
|
+
var dayCellStyles = {
|
|
8106
|
+
border: '1px solid',
|
|
8107
|
+
borderColor: 'color.gray.100',
|
|
8108
|
+
minHeight: 120,
|
|
8109
|
+
padding: 4,
|
|
8110
|
+
paddingTop: 2,
|
|
8111
|
+
backgroundColor: 'color.white',
|
|
8112
|
+
position: 'relative',
|
|
8113
|
+
display: 'flex',
|
|
8114
|
+
flexDirection: 'column'
|
|
8115
|
+
};
|
|
8116
|
+
/**
|
|
8117
|
+
* Day date styles (the circular number)
|
|
8118
|
+
*/
|
|
8119
|
+
var dayDateStyles = {
|
|
8120
|
+
width: 36,
|
|
8121
|
+
height: 36,
|
|
8122
|
+
display: 'flex',
|
|
8123
|
+
alignItems: 'center',
|
|
8124
|
+
justifyContent: 'center',
|
|
8125
|
+
borderRadius: '50%',
|
|
8126
|
+
fontSize: 13,
|
|
8127
|
+
fontWeight: 400,
|
|
8128
|
+
color: 'color.gray.900',
|
|
8129
|
+
cursor: 'pointer',
|
|
8130
|
+
transition: 'all 0.2s',
|
|
8131
|
+
border: '2px solid transparent'
|
|
8132
|
+
};
|
|
8133
|
+
/**
|
|
8134
|
+
* Day cell from different month
|
|
8135
|
+
*/
|
|
8136
|
+
var otherMonthDayCellStyles = {
|
|
8137
|
+
backgroundColor: 'color.gray.50',
|
|
8138
|
+
opacity: 0.5
|
|
8139
|
+
};
|
|
8140
|
+
/**
|
|
8141
|
+
* Day number styles
|
|
8142
|
+
*/
|
|
8143
|
+
var dayNumberStyles = {
|
|
8144
|
+
fontSize: 14,
|
|
8145
|
+
fontWeight: 400,
|
|
8146
|
+
color: 'color.gray.900',
|
|
8147
|
+
marginBottom: 4,
|
|
8148
|
+
padding: 4,
|
|
8149
|
+
paddingLeft: 8,
|
|
8150
|
+
paddingRight: 8,
|
|
8151
|
+
borderRadius: 4,
|
|
8152
|
+
alignSelf: 'flex-start'
|
|
8153
|
+
};
|
|
8154
|
+
/**
|
|
8155
|
+
* Today day number styles
|
|
8156
|
+
*/
|
|
8157
|
+
var todayDayNumberStyles = {
|
|
8158
|
+
backgroundColor: 'color.blue.500',
|
|
8159
|
+
color: 'color.white',
|
|
8160
|
+
fontWeight: 500
|
|
8161
|
+
};
|
|
8162
|
+
/**
|
|
8163
|
+
* Selected day number styles
|
|
8164
|
+
*/
|
|
8165
|
+
var selectedDayNumberStyles = {
|
|
8166
|
+
backgroundColor: 'color.blue.50',
|
|
8167
|
+
color: 'color.blue.700',
|
|
8168
|
+
fontWeight: 500
|
|
8169
|
+
};
|
|
8170
|
+
/**
|
|
8171
|
+
* Events area styles (container for events in a day)
|
|
8172
|
+
*/
|
|
8173
|
+
var eventsAreaStyles = {
|
|
8174
|
+
display: 'flex',
|
|
8175
|
+
flexDirection: 'column',
|
|
8176
|
+
gap: 2,
|
|
8177
|
+
flex: 1,
|
|
8178
|
+
position: 'relative'
|
|
8179
|
+
};
|
|
8180
|
+
/**
|
|
8181
|
+
* Base event styles
|
|
8182
|
+
*/
|
|
8183
|
+
var eventStyles = {
|
|
8184
|
+
height: 20,
|
|
8185
|
+
display: 'flex',
|
|
8186
|
+
alignItems: 'center',
|
|
8187
|
+
padding: 4,
|
|
8188
|
+
paddingLeft: 6,
|
|
8189
|
+
paddingRight: 6,
|
|
8190
|
+
borderRadius: 3,
|
|
8191
|
+
borderLeft: '3px solid',
|
|
8192
|
+
fontSize: 11,
|
|
8193
|
+
fontWeight: 500,
|
|
8194
|
+
overflow: 'hidden',
|
|
8195
|
+
cursor: 'grab',
|
|
8196
|
+
transition: 'box-shadow 0.2s',
|
|
8197
|
+
userSelect: 'none',
|
|
8198
|
+
marginBottom: 2
|
|
8199
|
+
};
|
|
8200
|
+
/**
|
|
8201
|
+
* Drop target indicator styles
|
|
8202
|
+
*/
|
|
8203
|
+
var dropTargetStyles = {
|
|
8204
|
+
backgroundColor: 'rgba(26, 115, 232, 0.08)',
|
|
8205
|
+
boxShadow: 'inset 0 0 0 2px rgba(26, 115, 232, 0.3)'
|
|
8206
|
+
};
|
|
8207
|
+
/**
|
|
8208
|
+
* Button base styles
|
|
8209
|
+
*/
|
|
8210
|
+
var buttonStyles = {
|
|
8211
|
+
padding: 8,
|
|
8212
|
+
paddingLeft: 12,
|
|
8213
|
+
paddingRight: 12,
|
|
8214
|
+
borderRadius: 4,
|
|
8215
|
+
fontSize: 14,
|
|
8216
|
+
fontWeight: 500,
|
|
8217
|
+
cursor: 'pointer',
|
|
8218
|
+
border: '1px solid',
|
|
8219
|
+
borderColor: 'color.gray.300',
|
|
8220
|
+
backgroundColor: 'color.white',
|
|
8221
|
+
color: 'color.gray.700',
|
|
8222
|
+
transition: 'all 0.2s'
|
|
8223
|
+
};
|
|
8224
|
+
/**
|
|
8225
|
+
* Icon button styles
|
|
8226
|
+
*/
|
|
8227
|
+
var iconButtonStyles = {
|
|
8228
|
+
width: 36,
|
|
8229
|
+
height: 36,
|
|
8230
|
+
display: 'flex',
|
|
8231
|
+
alignItems: 'center',
|
|
8232
|
+
justifyContent: 'center',
|
|
8233
|
+
borderRadius: '50%',
|
|
8234
|
+
cursor: 'pointer',
|
|
8235
|
+
backgroundColor: 'transparent',
|
|
8236
|
+
color: 'color.gray.700',
|
|
8237
|
+
transition: 'all 0.2s',
|
|
8238
|
+
border: 'none'
|
|
8239
|
+
};
|
|
8240
|
+
|
|
8241
|
+
var ResizeHandle = _ref => {
|
|
8012
8242
|
var {
|
|
8013
|
-
|
|
8014
|
-
|
|
8243
|
+
direction,
|
|
8244
|
+
onMouseDown
|
|
8245
|
+
} = _ref;
|
|
8246
|
+
var [isHovered, setIsHovered] = React.useState(false);
|
|
8247
|
+
return /*#__PURE__*/React__default.createElement(appStudio.View, Object.assign({
|
|
8248
|
+
position: "absolute",
|
|
8249
|
+
top: 0,
|
|
8250
|
+
bottom: 0,
|
|
8251
|
+
width: 8,
|
|
8252
|
+
opacity: isHovered ? 1 : 0,
|
|
8253
|
+
transition: "opacity 0.2s",
|
|
8254
|
+
cursor: direction === 'left' ? 'w-resize' : 'e-resize',
|
|
8255
|
+
zIndex: 10,
|
|
8256
|
+
backgroundColor: isHovered ? 'rgba(0,0,0,0.1)' : 'transparent'
|
|
8257
|
+
}, direction === 'left' ? {
|
|
8258
|
+
left: 0
|
|
8259
|
+
} : {
|
|
8260
|
+
right: 0
|
|
8261
|
+
}, {
|
|
8262
|
+
onMouseDown: onMouseDown,
|
|
8263
|
+
onMouseEnter: () => setIsHovered(true),
|
|
8264
|
+
onMouseLeave: () => setIsHovered(false)
|
|
8265
|
+
}));
|
|
8266
|
+
};
|
|
8267
|
+
var MONTH_EVENT_ROW_HEIGHT = 22;
|
|
8268
|
+
var MONTH_EVENT_ROW_GAP = 4;
|
|
8269
|
+
var MONTH_EVENT_TOP_OFFSET = 32;
|
|
8270
|
+
var Calendar = _ref2 => {
|
|
8271
|
+
var {
|
|
8272
|
+
initialDate = new Date(),
|
|
8015
8273
|
initialView = 'month',
|
|
8016
|
-
|
|
8017
|
-
|
|
8018
|
-
|
|
8274
|
+
events = [],
|
|
8275
|
+
today = new Date().toISOString().slice(0, 10),
|
|
8276
|
+
onEventDrop,
|
|
8277
|
+
onEventResize,
|
|
8278
|
+
onDateClick,
|
|
8019
8279
|
onDateChange,
|
|
8020
8280
|
onViewChange,
|
|
8021
|
-
|
|
8022
|
-
|
|
8023
|
-
|
|
8024
|
-
|
|
8025
|
-
|
|
8026
|
-
|
|
8027
|
-
|
|
8028
|
-
|
|
8029
|
-
|
|
8030
|
-
|
|
8031
|
-
|
|
8032
|
-
|
|
8033
|
-
|
|
8034
|
-
|
|
8035
|
-
var
|
|
8036
|
-
|
|
8037
|
-
|
|
8038
|
-
|
|
8039
|
-
|
|
8040
|
-
|
|
8041
|
-
|
|
8042
|
-
|
|
8043
|
-
|
|
8044
|
-
|
|
8045
|
-
|
|
8046
|
-
|
|
8047
|
-
|
|
8048
|
-
|
|
8049
|
-
|
|
8050
|
-
|
|
8051
|
-
|
|
8052
|
-
|
|
8053
|
-
|
|
8054
|
-
|
|
8055
|
-
|
|
8056
|
-
|
|
8057
|
-
|
|
8058
|
-
|
|
8059
|
-
|
|
8060
|
-
|
|
8061
|
-
|
|
8062
|
-
|
|
8063
|
-
|
|
8064
|
-
|
|
8065
|
-
|
|
8066
|
-
|
|
8067
|
-
|
|
8068
|
-
|
|
8281
|
+
onEventAdd,
|
|
8282
|
+
views = {},
|
|
8283
|
+
width = '100%',
|
|
8284
|
+
maxWidth = 1200,
|
|
8285
|
+
weekStartsOn = 0
|
|
8286
|
+
} = _ref2;
|
|
8287
|
+
var {
|
|
8288
|
+
getColor
|
|
8289
|
+
} = appStudio.useTheme();
|
|
8290
|
+
var gridRef = React.useRef(null);
|
|
8291
|
+
// Convert initialDate to ISO string if it's a Date object
|
|
8292
|
+
var initialDateISO = typeof initialDate === 'string' ? initialDate : initialDate.toISOString().slice(0, 10);
|
|
8293
|
+
var [currentDate, setCurrentDate] = React.useState(initialDateISO);
|
|
8294
|
+
var [currentView, setCurrentView] = React.useState(initialView);
|
|
8295
|
+
var [selectedDate, setSelectedDate] = React.useState(null);
|
|
8296
|
+
var [localEvents, setLocalEvents] = React.useState(events);
|
|
8297
|
+
var [dropTargetDays, setDropTargetDays] = React.useState([]);
|
|
8298
|
+
var dragStateRef = React.useRef({
|
|
8299
|
+
isDragging: false,
|
|
8300
|
+
isResizing: false,
|
|
8301
|
+
resizeDirection: null,
|
|
8302
|
+
event: null,
|
|
8303
|
+
startX: 0,
|
|
8304
|
+
startDay: 0,
|
|
8305
|
+
startDuration: 0,
|
|
8306
|
+
originalStart: null,
|
|
8307
|
+
originalEnd: null
|
|
8308
|
+
});
|
|
8309
|
+
// Update local events when props change
|
|
8310
|
+
React__default.useEffect(() => {
|
|
8311
|
+
setLocalEvents(events);
|
|
8312
|
+
}, [events]);
|
|
8313
|
+
// Get the month start for current date
|
|
8314
|
+
var currentMonth = React.useMemo(() => getFirstDayOfMonth(currentDate), [currentDate]);
|
|
8315
|
+
// Generate calendar dates based on view
|
|
8316
|
+
var calendarDates = React.useMemo(() => {
|
|
8317
|
+
if (currentView === 'month') {
|
|
8318
|
+
return getCalendarDates(currentMonth, weekStartsOn);
|
|
8319
|
+
} else if (currentView === 'week') {
|
|
8320
|
+
// Get week starting from current date
|
|
8321
|
+
var dayOfWeek = getDayOfWeek(currentDate);
|
|
8322
|
+
var weekStart = addDateDays(currentDate, -((dayOfWeek - weekStartsOn + 7) % 7));
|
|
8323
|
+
var dates = [];
|
|
8324
|
+
for (var i = 0; i < 7; i++) {
|
|
8325
|
+
dates.push(addDateDays(weekStart, i));
|
|
8326
|
+
}
|
|
8327
|
+
return dates;
|
|
8328
|
+
} else {
|
|
8329
|
+
// Day view - just current date
|
|
8069
8330
|
return [currentDate];
|
|
8070
8331
|
}
|
|
8071
|
-
|
|
8072
|
-
|
|
8073
|
-
|
|
8332
|
+
}, [currentDate, currentView, currentMonth, weekStartsOn]);
|
|
8333
|
+
var monthWeeks = React.useMemo(() => {
|
|
8334
|
+
var chunks = [];
|
|
8335
|
+
for (var i = 0; i < calendarDates.length; i += 7) {
|
|
8336
|
+
chunks.push(calendarDates.slice(i, i + 7));
|
|
8337
|
+
}
|
|
8338
|
+
return chunks;
|
|
8339
|
+
}, [calendarDates]);
|
|
8340
|
+
// Layout events
|
|
8341
|
+
var {
|
|
8342
|
+
items: positionedEvents
|
|
8343
|
+
} = React.useMemo(() => layoutEvents(localEvents, calendarDates), [localEvents, calendarDates]);
|
|
8344
|
+
var monthWeeksWithEvents = React.useMemo(() => {
|
|
8345
|
+
return monthWeeks.map((dates, weekIndex) => {
|
|
8346
|
+
var weekStartIdx = weekIndex * 7;
|
|
8347
|
+
var weekEndIdx = weekStartIdx + dates.length - 1;
|
|
8348
|
+
var segments = positionedEvents.filter(event => !(event.startDay > weekEndIdx || event.endDay < weekStartIdx)).map(event => {
|
|
8349
|
+
var segmentStart = Math.max(event.startDay, weekStartIdx);
|
|
8350
|
+
var segmentEnd = Math.min(event.endDay, weekEndIdx);
|
|
8351
|
+
return Object.assign({}, event, {
|
|
8352
|
+
weekIndex,
|
|
8353
|
+
segmentStartDay: segmentStart - weekStartIdx,
|
|
8354
|
+
segmentEndDay: segmentEnd - weekStartIdx,
|
|
8355
|
+
segmentDuration: segmentEnd - segmentStart + 1,
|
|
8356
|
+
segmentRow: 0
|
|
8357
|
+
});
|
|
8074
8358
|
});
|
|
8075
|
-
|
|
8076
|
-
|
|
8077
|
-
|
|
8078
|
-
|
|
8079
|
-
|
|
8080
|
-
|
|
8081
|
-
|
|
8082
|
-
|
|
8083
|
-
|
|
8084
|
-
|
|
8085
|
-
|
|
8086
|
-
|
|
8087
|
-
|
|
8088
|
-
|
|
8089
|
-
|
|
8359
|
+
segments.sort((a, b) => {
|
|
8360
|
+
if (a.segmentStartDay !== b.segmentStartDay) {
|
|
8361
|
+
return a.segmentStartDay - b.segmentStartDay;
|
|
8362
|
+
}
|
|
8363
|
+
return b.segmentDuration - a.segmentDuration;
|
|
8364
|
+
});
|
|
8365
|
+
var rows = [];
|
|
8366
|
+
segments.forEach(segment => {
|
|
8367
|
+
var placed = false;
|
|
8368
|
+
for (var rowIdx = 0; rowIdx < rows.length; rowIdx++) {
|
|
8369
|
+
var row = rows[rowIdx];
|
|
8370
|
+
var conflict = row.some(existing => !(segment.segmentStartDay > existing.segmentEndDay || segment.segmentEndDay < existing.segmentStartDay));
|
|
8371
|
+
if (!conflict) {
|
|
8372
|
+
segment.segmentRow = rowIdx;
|
|
8373
|
+
row.push(segment);
|
|
8374
|
+
placed = true;
|
|
8375
|
+
break;
|
|
8376
|
+
}
|
|
8377
|
+
}
|
|
8378
|
+
if (!placed) {
|
|
8379
|
+
segment.segmentRow = rows.length;
|
|
8380
|
+
rows.push([segment]);
|
|
8381
|
+
}
|
|
8382
|
+
});
|
|
8383
|
+
return {
|
|
8384
|
+
weekIndex,
|
|
8385
|
+
dates,
|
|
8386
|
+
segments,
|
|
8387
|
+
rowCount: rows.length
|
|
8388
|
+
};
|
|
8090
8389
|
});
|
|
8091
|
-
}, [
|
|
8092
|
-
|
|
8093
|
-
|
|
8094
|
-
|
|
8095
|
-
|
|
8096
|
-
|
|
8097
|
-
|
|
8098
|
-
|
|
8099
|
-
|
|
8100
|
-
|
|
8101
|
-
|
|
8102
|
-
|
|
8390
|
+
}, [monthWeeks, positionedEvents]);
|
|
8391
|
+
// Get day names
|
|
8392
|
+
var dayNames = React.useMemo(() => getDayNames(weekStartsOn), [weekStartsOn]);
|
|
8393
|
+
// Handle navigation
|
|
8394
|
+
var handlePrevious = React.useCallback(() => {
|
|
8395
|
+
var newDate;
|
|
8396
|
+
if (currentView === 'month') {
|
|
8397
|
+
newDate = getPreviousMonth(currentDate);
|
|
8398
|
+
} else if (currentView === 'week') {
|
|
8399
|
+
newDate = addDateDays(currentDate, -7);
|
|
8400
|
+
} else {
|
|
8401
|
+
newDate = addDateDays(currentDate, -1);
|
|
8402
|
+
}
|
|
8403
|
+
setCurrentDate(newDate);
|
|
8404
|
+
onDateChange == null || onDateChange(new Date(newDate + 'T00:00:00Z'));
|
|
8405
|
+
}, [currentDate, currentView, onDateChange]);
|
|
8406
|
+
var handleNext = React.useCallback(() => {
|
|
8407
|
+
var newDate;
|
|
8408
|
+
if (currentView === 'month') {
|
|
8409
|
+
newDate = getNextMonth(currentDate);
|
|
8410
|
+
} else if (currentView === 'week') {
|
|
8411
|
+
newDate = addDateDays(currentDate, 7);
|
|
8412
|
+
} else {
|
|
8413
|
+
newDate = addDateDays(currentDate, 1);
|
|
8414
|
+
}
|
|
8415
|
+
setCurrentDate(newDate);
|
|
8416
|
+
onDateChange == null || onDateChange(new Date(newDate + 'T00:00:00Z'));
|
|
8417
|
+
}, [currentDate, currentView, onDateChange]);
|
|
8418
|
+
var handleToday = React.useCallback(() => {
|
|
8419
|
+
setCurrentDate(today);
|
|
8420
|
+
onDateChange == null || onDateChange(new Date(today + 'T00:00:00Z'));
|
|
8421
|
+
}, [today, onDateChange]);
|
|
8422
|
+
// Handle view change
|
|
8423
|
+
var handleViewChange = React.useCallback(view => {
|
|
8424
|
+
setCurrentView(view);
|
|
8425
|
+
onViewChange == null || onViewChange(view);
|
|
8426
|
+
}, [onViewChange]);
|
|
8427
|
+
// Handle date click
|
|
8428
|
+
var handleDateClick = React.useCallback(dateISO => {
|
|
8429
|
+
setSelectedDate(dateISO);
|
|
8430
|
+
onDateClick == null || onDateClick(dateISO);
|
|
8431
|
+
}, [onDateClick]);
|
|
8432
|
+
// Handle double-click to add event
|
|
8433
|
+
var handleDateDoubleClick = React.useCallback((dateISO, hour) => {
|
|
8434
|
+
if (onEventAdd) {
|
|
8435
|
+
var start;
|
|
8436
|
+
var end;
|
|
8437
|
+
if (hour !== undefined) {
|
|
8438
|
+
// Day view with time
|
|
8439
|
+
var hourStr = hour.toString().padStart(2, '0');
|
|
8440
|
+
start = dateISO + "T" + hourStr + ":00";
|
|
8441
|
+
end = dateISO + "T" + (hour + 1).toString().padStart(2, '0') + ":00";
|
|
8442
|
+
} else {
|
|
8443
|
+
// Month/week view
|
|
8444
|
+
start = dateISO;
|
|
8445
|
+
end = dateISO;
|
|
8446
|
+
}
|
|
8447
|
+
onEventAdd(start, end);
|
|
8448
|
+
}
|
|
8449
|
+
}, [onEventAdd]);
|
|
8450
|
+
// Handle mouse down on event (start dragging)
|
|
8451
|
+
var handleEventMouseDown = React.useCallback((e, event) => {
|
|
8452
|
+
e.preventDefault();
|
|
8453
|
+
dragStateRef.current = {
|
|
8454
|
+
isDragging: true,
|
|
8455
|
+
isResizing: false,
|
|
8456
|
+
resizeDirection: null,
|
|
8457
|
+
event,
|
|
8458
|
+
startX: e.clientX,
|
|
8459
|
+
startDay: event.startDay,
|
|
8460
|
+
startDuration: event.duration,
|
|
8461
|
+
originalStart: event.start,
|
|
8462
|
+
originalEnd: event.end
|
|
8463
|
+
};
|
|
8464
|
+
}, []);
|
|
8465
|
+
// Handle resize start
|
|
8466
|
+
var handleResizeStart = React.useCallback((e, event, direction) => {
|
|
8467
|
+
e.preventDefault();
|
|
8468
|
+
e.stopPropagation();
|
|
8469
|
+
dragStateRef.current = {
|
|
8470
|
+
isDragging: false,
|
|
8471
|
+
isResizing: true,
|
|
8472
|
+
resizeDirection: direction,
|
|
8473
|
+
event,
|
|
8474
|
+
startX: e.clientX,
|
|
8475
|
+
startDay: event.startDay,
|
|
8476
|
+
startDuration: event.duration,
|
|
8477
|
+
originalStart: event.start,
|
|
8478
|
+
originalEnd: event.end
|
|
8479
|
+
};
|
|
8480
|
+
}, []);
|
|
8481
|
+
// Handle mouse move during resize or drag
|
|
8482
|
+
var handleMouseMove = React.useCallback(e => {
|
|
8483
|
+
var dragState = dragStateRef.current;
|
|
8484
|
+
if (!dragState.event || !dragState.isDragging && !dragState.isResizing) return;
|
|
8485
|
+
if (!gridRef.current) return;
|
|
8486
|
+
var rect = gridRef.current.getBoundingClientRect();
|
|
8487
|
+
var deltaX = e.clientX - dragState.startX;
|
|
8488
|
+
// Calculate day delta based on pixel movement
|
|
8489
|
+
var daysDelta;
|
|
8490
|
+
if (currentView === 'month') {
|
|
8491
|
+
var dayWidth = rect.width / 7;
|
|
8492
|
+
daysDelta = Math.round(deltaX / dayWidth);
|
|
8493
|
+
} else if (currentView === 'week') {
|
|
8494
|
+
var _dayWidth = rect.width / 7;
|
|
8495
|
+
daysDelta = Math.round(deltaX / _dayWidth);
|
|
8496
|
+
} else {
|
|
8497
|
+
// Day view - no horizontal resize
|
|
8498
|
+
return;
|
|
8499
|
+
}
|
|
8500
|
+
if (dragState.isDragging) {
|
|
8501
|
+
// Dragging - move the event
|
|
8502
|
+
var maxDays = calendarDates.length - 1;
|
|
8503
|
+
var newStartDay = Math.max(0, Math.min(maxDays, dragState.startDay + daysDelta));
|
|
8504
|
+
var duration = dragState.event.duration;
|
|
8505
|
+
var newEndDay = Math.min(maxDays, newStartDay + duration - 1);
|
|
8506
|
+
// Update drop target indicators
|
|
8507
|
+
var targetDays = [];
|
|
8508
|
+
for (var i = newStartDay; i <= newEndDay; i++) {
|
|
8509
|
+
targetDays.push(i);
|
|
8510
|
+
}
|
|
8511
|
+
setDropTargetDays(targetDays);
|
|
8512
|
+
// Update event position immediately for smooth dragging
|
|
8513
|
+
var updatedEvents = localEvents.map(ev => ev.id === dragState.event.id ? Object.assign({}, ev, {
|
|
8514
|
+
start: addDateDays(dragState.originalStart, newStartDay - dragState.startDay),
|
|
8515
|
+
end: addDateDays(dragState.originalEnd, newStartDay - dragState.startDay)
|
|
8516
|
+
}) : ev);
|
|
8517
|
+
setLocalEvents(updatedEvents);
|
|
8518
|
+
} else if (dragState.isResizing) {
|
|
8519
|
+
// Resizing
|
|
8520
|
+
if (dragState.resizeDirection === 'right') {
|
|
8521
|
+
// Resize from right
|
|
8522
|
+
var newDuration = Math.max(1, dragState.startDuration + daysDelta);
|
|
8523
|
+
var _maxDays = calendarDates.length - 1;
|
|
8524
|
+
var _newEndDay = Math.min(_maxDays, dragState.startDay + newDuration - 1);
|
|
8525
|
+
var actualDuration = _newEndDay - dragState.startDay + 1;
|
|
8526
|
+
var _updatedEvents = localEvents.map(ev => ev.id === dragState.event.id ? Object.assign({}, ev, {
|
|
8527
|
+
end: addDateDays(dragState.originalStart, actualDuration - 1)
|
|
8528
|
+
}) : ev);
|
|
8529
|
+
setLocalEvents(_updatedEvents);
|
|
8530
|
+
} else if (dragState.resizeDirection === 'left') {
|
|
8531
|
+
// Resize from left
|
|
8532
|
+
var _newStartDay = Math.max(0, Math.min(dragState.startDay + dragState.startDuration - 1, dragState.startDay + daysDelta));
|
|
8533
|
+
var _updatedEvents2 = localEvents.map(ev => ev.id === dragState.event.id ? Object.assign({}, ev, {
|
|
8534
|
+
start: addDateDays(dragState.originalStart, _newStartDay - dragState.startDay)
|
|
8535
|
+
}) : ev);
|
|
8536
|
+
setLocalEvents(_updatedEvents2);
|
|
8537
|
+
}
|
|
8538
|
+
}
|
|
8539
|
+
}, [localEvents, calendarDates, currentView]);
|
|
8540
|
+
// Handle mouse up - finish resize/drag
|
|
8541
|
+
var handleMouseUp = React.useCallback(e => {
|
|
8542
|
+
var dragState = dragStateRef.current;
|
|
8543
|
+
if (!dragState.event || !dragState.isDragging && !dragState.isResizing) return;
|
|
8544
|
+
setDropTargetDays([]);
|
|
8545
|
+
// Find the updated event
|
|
8546
|
+
var updatedEvent = localEvents.find(ev => ev.id === dragState.event.id);
|
|
8547
|
+
if (!updatedEvent) return;
|
|
8548
|
+
// Call appropriate callback
|
|
8549
|
+
if (dragState.isDragging) {
|
|
8550
|
+
onEventDrop == null || onEventDrop(updatedEvent);
|
|
8551
|
+
} else if (dragState.isResizing) {
|
|
8552
|
+
onEventResize == null || onEventResize(updatedEvent);
|
|
8553
|
+
}
|
|
8554
|
+
// Reset drag state
|
|
8555
|
+
dragStateRef.current = {
|
|
8556
|
+
isDragging: false,
|
|
8557
|
+
isResizing: false,
|
|
8558
|
+
resizeDirection: null,
|
|
8559
|
+
event: null,
|
|
8560
|
+
startX: 0,
|
|
8561
|
+
startDay: 0,
|
|
8562
|
+
startDuration: 0,
|
|
8563
|
+
originalStart: null,
|
|
8564
|
+
originalEnd: null
|
|
8565
|
+
};
|
|
8566
|
+
}, [localEvents, onEventDrop, onEventResize]);
|
|
8567
|
+
// Set up global mouse event listeners
|
|
8568
|
+
React__default.useEffect(() => {
|
|
8569
|
+
document.addEventListener('mousemove', handleMouseMove);
|
|
8570
|
+
document.addEventListener('mouseup', handleMouseUp);
|
|
8571
|
+
return () => {
|
|
8572
|
+
document.removeEventListener('mousemove', handleMouseMove);
|
|
8573
|
+
document.removeEventListener('mouseup', handleMouseUp);
|
|
8574
|
+
};
|
|
8575
|
+
}, [handleMouseMove, handleMouseUp]);
|
|
8576
|
+
// Group events by date for rendering
|
|
8577
|
+
var eventsByDate = React.useMemo(() => {
|
|
8578
|
+
var grouped = {};
|
|
8579
|
+
calendarDates.forEach(date => {
|
|
8580
|
+
grouped[date] = [];
|
|
8103
8581
|
});
|
|
8104
|
-
|
|
8105
|
-
|
|
8106
|
-
|
|
8107
|
-
|
|
8108
|
-
|
|
8582
|
+
positionedEvents.forEach(event => {
|
|
8583
|
+
// For multi-day events, show on each day it spans
|
|
8584
|
+
var startIdx = event.startDay;
|
|
8585
|
+
var endIdx = event.endDay;
|
|
8586
|
+
for (var i = startIdx; i <= endIdx && i < calendarDates.length; i++) {
|
|
8587
|
+
var date = calendarDates[i];
|
|
8588
|
+
if (date && grouped[date]) {
|
|
8589
|
+
var isFirstDay = i === startIdx;
|
|
8590
|
+
grouped[date].push(Object.assign({}, event, {
|
|
8591
|
+
isFirstDay
|
|
8592
|
+
}));
|
|
8593
|
+
}
|
|
8594
|
+
}
|
|
8109
8595
|
});
|
|
8110
|
-
return
|
|
8111
|
-
|
|
8112
|
-
|
|
8113
|
-
},
|
|
8114
|
-
|
|
8115
|
-
|
|
8116
|
-
|
|
8117
|
-
|
|
8118
|
-
|
|
8119
|
-
|
|
8120
|
-
|
|
8121
|
-
|
|
8122
|
-
|
|
8123
|
-
|
|
8124
|
-
|
|
8125
|
-
|
|
8126
|
-
|
|
8127
|
-
|
|
8128
|
-
|
|
8129
|
-
|
|
8596
|
+
return grouped;
|
|
8597
|
+
}, [positionedEvents, calendarDates]);
|
|
8598
|
+
// Render month view
|
|
8599
|
+
var renderMonthView = () => (/*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(appStudio.View, Object.assign({}, weekdayHeaderStyles, views.weekdayHeader), dayNames.map((dayName, index) => (/*#__PURE__*/React__default.createElement(appStudio.View, Object.assign({
|
|
8600
|
+
key: index
|
|
8601
|
+
}, weekdayLabelStyles, views.weekdayLabel), dayName)))), /*#__PURE__*/React__default.createElement(appStudio.View, Object.assign({
|
|
8602
|
+
ref: gridRef
|
|
8603
|
+
}, monthGridStyles, views.monthGrid), monthWeeksWithEvents.map(week => {
|
|
8604
|
+
var weekStartIdx = week.weekIndex * 7;
|
|
8605
|
+
var weekEndIdx = weekStartIdx + week.dates.length - 1;
|
|
8606
|
+
return /*#__PURE__*/React__default.createElement(appStudio.View, {
|
|
8607
|
+
key: "week-" + week.weekIndex,
|
|
8608
|
+
position: "relative"
|
|
8609
|
+
}, /*#__PURE__*/React__default.createElement(appStudio.View, {
|
|
8610
|
+
display: "grid",
|
|
8611
|
+
gridTemplateColumns: "repeat(7, 1fr)"
|
|
8612
|
+
}, week.dates.map((dateISO, dayOffset) => {
|
|
8613
|
+
var dateNum = getDateNumber(dateISO);
|
|
8614
|
+
var isToday = dateISO === today;
|
|
8615
|
+
var isSelected = dateISO === selectedDate;
|
|
8616
|
+
var isCurrentMonth = isInMonth(dateISO, currentMonth);
|
|
8617
|
+
var dayIndex = weekStartIdx + dayOffset;
|
|
8618
|
+
var isDropTarget = dropTargetDays.includes(dayIndex);
|
|
8619
|
+
return /*#__PURE__*/React__default.createElement(appStudio.View, Object.assign({
|
|
8620
|
+
key: dateISO,
|
|
8621
|
+
"data-date": dateISO
|
|
8622
|
+
}, dayCellStyles, !isCurrentMonth && otherMonthDayCellStyles, isDropTarget && dropTargetStyles, {
|
|
8623
|
+
onClick: () => handleDateClick(dateISO),
|
|
8624
|
+
onDoubleClick: () => handleDateDoubleClick(dateISO)
|
|
8625
|
+
}, views.dayCell), /*#__PURE__*/React__default.createElement(appStudio.View, Object.assign({}, dayNumberStyles, isToday && todayDayNumberStyles, isSelected && !isToday && selectedDayNumberStyles, {
|
|
8626
|
+
style: {
|
|
8627
|
+
cursor: 'pointer'
|
|
8628
|
+
}
|
|
8629
|
+
}, views.dayNumber), dateNum));
|
|
8630
|
+
})), week.segments.length > 0 && (/*#__PURE__*/React__default.createElement(appStudio.View, {
|
|
8631
|
+
position: "absolute",
|
|
8632
|
+
left: 0,
|
|
8633
|
+
right: 0,
|
|
8634
|
+
top: MONTH_EVENT_TOP_OFFSET,
|
|
8635
|
+
pointerEvents: "none"
|
|
8636
|
+
}, week.segments.map(event => {
|
|
8637
|
+
var _dragStateRef$current, _dragStateRef$current2;
|
|
8638
|
+
var colorConfig = EVENT_COLORS[event.color || 'blue'];
|
|
8639
|
+
var dayWidth = 100 / week.dates.length;
|
|
8640
|
+
var left = event.segmentStartDay * dayWidth;
|
|
8641
|
+
var width = event.segmentDuration * dayWidth;
|
|
8642
|
+
var isDragging = dragStateRef.current.isDragging && ((_dragStateRef$current = dragStateRef.current.event) == null ? void 0 : _dragStateRef$current.id) === event.id;
|
|
8643
|
+
var isResizing = dragStateRef.current.isResizing && ((_dragStateRef$current2 = dragStateRef.current.event) == null ? void 0 : _dragStateRef$current2.id) === event.id;
|
|
8644
|
+
var showLeftHandle = event.startDay >= weekStartIdx && event.startDay <= weekEndIdx && event.segmentStartDay === event.startDay - weekStartIdx;
|
|
8645
|
+
var showRightHandle = event.endDay >= weekStartIdx && event.endDay <= weekEndIdx && event.segmentEndDay === event.endDay - weekStartIdx;
|
|
8646
|
+
return /*#__PURE__*/React__default.createElement(appStudio.View, Object.assign({
|
|
8647
|
+
key: event.id + "-" + event.weekIndex + "-" + event.segmentStartDay,
|
|
8648
|
+
position: "absolute",
|
|
8649
|
+
height: MONTH_EVENT_ROW_HEIGHT,
|
|
8650
|
+
display: "flex",
|
|
8651
|
+
alignItems: "center",
|
|
8652
|
+
paddingLeft: 8,
|
|
8653
|
+
paddingRight: 8,
|
|
8654
|
+
borderRadius: 4,
|
|
8655
|
+
backgroundColor: colorConfig.background,
|
|
8656
|
+
borderLeft: "3px solid",
|
|
8657
|
+
borderLeftColor: colorConfig.border,
|
|
8658
|
+
color: colorConfig.text,
|
|
8659
|
+
fontSize: 11,
|
|
8660
|
+
fontWeight: 500,
|
|
8661
|
+
overflow: "hidden",
|
|
8662
|
+
cursor: isDragging ? 'grabbing' : 'grab',
|
|
8663
|
+
opacity: isDragging || isResizing ? 0.7 : 1,
|
|
8664
|
+
boxShadow: isDragging || isResizing ? '0 4px 12px rgba(0,0,0,0.3)' : '0 1px 2px rgba(0,0,0,0.1)',
|
|
8665
|
+
transition: isDragging || isResizing ? 'none' : 'box-shadow 0.2s',
|
|
8666
|
+
pointerEvents: "auto",
|
|
8667
|
+
userSelect: "none",
|
|
8668
|
+
left: "calc(" + left + "% + 4px)",
|
|
8669
|
+
width: "calc(" + width + "% - 8px)",
|
|
8670
|
+
top: event.segmentRow * (MONTH_EVENT_ROW_HEIGHT + MONTH_EVENT_ROW_GAP) + "px",
|
|
8671
|
+
onMouseDown: e => handleEventMouseDown(e, event),
|
|
8672
|
+
title: event.title
|
|
8673
|
+
}, views.event), /*#__PURE__*/React__default.createElement(appStudio.View, {
|
|
8674
|
+
overflow: "hidden",
|
|
8675
|
+
textOverflow: "ellipsis",
|
|
8676
|
+
whiteSpace: "nowrap",
|
|
8677
|
+
width: "100%"
|
|
8678
|
+
}, event.title), showLeftHandle && (/*#__PURE__*/React__default.createElement(ResizeHandle, {
|
|
8679
|
+
direction: "left",
|
|
8680
|
+
onMouseDown: e => handleResizeStart(e, event, 'left')
|
|
8681
|
+
})), showRightHandle && (/*#__PURE__*/React__default.createElement(ResizeHandle, {
|
|
8682
|
+
direction: "right",
|
|
8683
|
+
onMouseDown: e => handleResizeStart(e, event, 'right')
|
|
8684
|
+
})));
|
|
8685
|
+
}))));
|
|
8686
|
+
}))));
|
|
8687
|
+
// Render week view
|
|
8688
|
+
var renderWeekView = () => (/*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(appStudio.View, Object.assign({}, weekdayHeaderStyles, views.weekdayHeader), calendarDates.map((dateISO, index) => {
|
|
8689
|
+
var dayOfWeek = getDayOfWeek(dateISO);
|
|
8690
|
+
var dateNum = getDateNumber(dateISO);
|
|
8691
|
+
var isToday = dateISO === today;
|
|
8692
|
+
return /*#__PURE__*/React__default.createElement(appStudio.View, Object.assign({
|
|
8693
|
+
key: dateISO,
|
|
8694
|
+
display: "flex",
|
|
8695
|
+
flexDirection: "column",
|
|
8696
|
+
alignItems: "center",
|
|
8697
|
+
padding: 8,
|
|
8698
|
+
gap: 4
|
|
8699
|
+
}, views.weekdayLabel), /*#__PURE__*/React__default.createElement(appStudio.View, Object.assign({}, weekdayLabelStyles), DAY_NAMES[dayOfWeek]), /*#__PURE__*/React__default.createElement(appStudio.View, Object.assign({}, dayDateStyles, isToday && todayDayNumberStyles, {
|
|
8700
|
+
fontSize: 16,
|
|
8701
|
+
fontWeight: isToday ? 500 : 400
|
|
8702
|
+
}), dateNum));
|
|
8703
|
+
})), /*#__PURE__*/React__default.createElement(appStudio.View, {
|
|
8704
|
+
ref: gridRef,
|
|
8705
|
+
display: "grid",
|
|
8706
|
+
gridTemplateColumns: "repeat(7, 1fr)",
|
|
8707
|
+
minHeight: 400
|
|
8708
|
+
}, calendarDates.map((dateISO, index) => {
|
|
8709
|
+
var isDropTarget = dropTargetDays.includes(index);
|
|
8710
|
+
var dayEvents = eventsByDate[dateISO] || [];
|
|
8711
|
+
return /*#__PURE__*/React__default.createElement(appStudio.View, Object.assign({
|
|
8712
|
+
key: dateISO,
|
|
8713
|
+
"data-date": dateISO
|
|
8714
|
+
}, dayCellStyles, isDropTarget && dropTargetStyles, {
|
|
8715
|
+
minHeight: 400,
|
|
8716
|
+
onClick: () => handleDateClick(dateISO),
|
|
8717
|
+
onDoubleClick: () => handleDateDoubleClick(dateISO)
|
|
8718
|
+
}), /*#__PURE__*/React__default.createElement(appStudio.View, Object.assign({}, eventsAreaStyles, views.eventsArea), dayEvents.map(event => {
|
|
8719
|
+
var _dragStateRef$current3, _dragStateRef$current4;
|
|
8720
|
+
var colorConfig = EVENT_COLORS[event.color || 'blue'];
|
|
8721
|
+
var isFirstDay = event.isFirstDay !== false;
|
|
8722
|
+
if (!isFirstDay) return null;
|
|
8723
|
+
var isDragging = dragStateRef.current.isDragging && ((_dragStateRef$current3 = dragStateRef.current.event) == null ? void 0 : _dragStateRef$current3.id) === event.id;
|
|
8724
|
+
var isResizing = dragStateRef.current.isResizing && ((_dragStateRef$current4 = dragStateRef.current.event) == null ? void 0 : _dragStateRef$current4.id) === event.id;
|
|
8725
|
+
return /*#__PURE__*/React__default.createElement(appStudio.View, Object.assign({
|
|
8726
|
+
key: event.id,
|
|
8727
|
+
position: "relative"
|
|
8728
|
+
}, eventStyles, {
|
|
8729
|
+
backgroundColor: colorConfig.background,
|
|
8730
|
+
borderLeftColor: colorConfig.border,
|
|
8731
|
+
color: colorConfig.text,
|
|
8732
|
+
cursor: isDragging ? 'grabbing' : 'grab',
|
|
8733
|
+
opacity: isDragging || isResizing ? 0.7 : 1,
|
|
8734
|
+
boxShadow: isDragging || isResizing ? '0 4px 12px rgba(0,0,0,0.3)' : '0 1px 2px rgba(0,0,0,0.1)',
|
|
8735
|
+
transition: isDragging || isResizing ? 'none' : 'box-shadow 0.2s',
|
|
8736
|
+
userSelect: "none",
|
|
8737
|
+
onMouseDown: e => handleEventMouseDown(e, event),
|
|
8738
|
+
title: event.title
|
|
8739
|
+
}, views.event), /*#__PURE__*/React__default.createElement(appStudio.View, {
|
|
8740
|
+
overflow: "hidden",
|
|
8741
|
+
textOverflow: "ellipsis",
|
|
8742
|
+
whiteSpace: "nowrap",
|
|
8743
|
+
width: "100%"
|
|
8744
|
+
}, event.title), /*#__PURE__*/React__default.createElement(ResizeHandle, {
|
|
8745
|
+
direction: "left",
|
|
8746
|
+
onMouseDown: e => handleResizeStart(e, event, 'left')
|
|
8747
|
+
}), /*#__PURE__*/React__default.createElement(ResizeHandle, {
|
|
8748
|
+
direction: "right",
|
|
8749
|
+
onMouseDown: e => handleResizeStart(e, event, 'right')
|
|
8750
|
+
}));
|
|
8751
|
+
})));
|
|
8752
|
+
}))));
|
|
8753
|
+
// Render day view with hourly time slots
|
|
8754
|
+
var renderDayView = () => {
|
|
8755
|
+
var hours = Array.from({
|
|
8756
|
+
length: 24
|
|
8757
|
+
}, (_, i) => i);
|
|
8758
|
+
var dateISO = currentDate;
|
|
8759
|
+
var dayEvents = eventsByDate[dateISO] || [];
|
|
8760
|
+
return /*#__PURE__*/React__default.createElement(appStudio.View, {
|
|
8761
|
+
display: "flex",
|
|
8762
|
+
flexDirection: "column",
|
|
8763
|
+
flex: 1
|
|
8764
|
+
}, hours.map(hour => {
|
|
8765
|
+
var hourStr = hour.toString().padStart(2, '0') + ":00";
|
|
8766
|
+
return /*#__PURE__*/React__default.createElement(appStudio.View, {
|
|
8767
|
+
key: hour,
|
|
8768
|
+
display: "flex",
|
|
8769
|
+
borderBottom: "1px solid",
|
|
8770
|
+
borderColor: "color.gray.200",
|
|
8771
|
+
minHeight: 60,
|
|
8772
|
+
onDoubleClick: () => handleDateDoubleClick(dateISO, hour),
|
|
8773
|
+
cursor: "pointer",
|
|
8774
|
+
_hover: {
|
|
8775
|
+
backgroundColor: 'color.gray.50'
|
|
8776
|
+
}
|
|
8777
|
+
}, /*#__PURE__*/React__default.createElement(appStudio.View, Object.assign({
|
|
8778
|
+
width: 80,
|
|
8779
|
+
padding: 8,
|
|
8780
|
+
fontSize: 12,
|
|
8781
|
+
color: "color.gray.600",
|
|
8782
|
+
borderRight: "1px solid",
|
|
8783
|
+
borderColor: "color.gray.200"
|
|
8784
|
+
}, views.timeColumn), hourStr), /*#__PURE__*/React__default.createElement(appStudio.View, Object.assign({
|
|
8785
|
+
flex: 1,
|
|
8786
|
+
padding: 8,
|
|
8787
|
+
position: "relative"
|
|
8788
|
+
}, views.timeSlot), dayEvents.filter(event => {
|
|
8789
|
+
// Simple check if event starts in this hour
|
|
8790
|
+
if (event.start.includes('T')) {
|
|
8791
|
+
var eventHour = parseInt(event.start.split('T')[1].split(':')[0]);
|
|
8792
|
+
return eventHour === hour;
|
|
8793
|
+
}
|
|
8794
|
+
return false;
|
|
8795
|
+
}).map(event => {
|
|
8796
|
+
var colorConfig = EVENT_COLORS[event.color || 'blue'];
|
|
8797
|
+
return /*#__PURE__*/React__default.createElement(appStudio.View, Object.assign({
|
|
8798
|
+
key: event.id
|
|
8799
|
+
}, eventStyles, {
|
|
8800
|
+
backgroundColor: colorConfig.background,
|
|
8801
|
+
borderLeftColor: colorConfig.border,
|
|
8802
|
+
color: colorConfig.text,
|
|
8803
|
+
marginBottom: 4
|
|
8804
|
+
}, views.event), event.title);
|
|
8805
|
+
})));
|
|
8806
|
+
}));
|
|
8807
|
+
};
|
|
8808
|
+
return /*#__PURE__*/React__default.createElement(appStudio.View, Object.assign({}, containerStyles, {
|
|
8809
|
+
width: width,
|
|
8810
|
+
maxWidth: maxWidth
|
|
8811
|
+
}, views.container), /*#__PURE__*/React__default.createElement(appStudio.Horizontal, Object.assign({}, headerStyles, views.header), /*#__PURE__*/React__default.createElement(appStudio.View, Object.assign({}, monthTitleStyles, views.monthTitle), getMonthName(currentMonth), " ", getYear(currentMonth)), /*#__PURE__*/React__default.createElement(appStudio.Horizontal, {
|
|
8812
|
+
gap: 8
|
|
8813
|
+
}, /*#__PURE__*/React__default.createElement(appStudio.Horizontal, Object.assign({
|
|
8814
|
+
gap: 4
|
|
8815
|
+
}, views.viewSwitcher), /*#__PURE__*/React__default.createElement(appStudio.View, Object.assign({}, buttonStyles, {
|
|
8816
|
+
backgroundColor: currentView === 'month' ? 'color.primary.100' : 'color.white',
|
|
8817
|
+
color: currentView === 'month' ? 'color.primary.700' : 'color.gray.700',
|
|
8818
|
+
onClick: () => handleViewChange('month'),
|
|
8819
|
+
style: {
|
|
8820
|
+
cursor: 'pointer'
|
|
8821
|
+
}
|
|
8822
|
+
}), "Month"), /*#__PURE__*/React__default.createElement(appStudio.View, Object.assign({}, buttonStyles, {
|
|
8823
|
+
backgroundColor: currentView === 'week' ? 'color.primary.100' : 'color.white',
|
|
8824
|
+
color: currentView === 'week' ? 'color.primary.700' : 'color.gray.700',
|
|
8825
|
+
onClick: () => handleViewChange('week'),
|
|
8826
|
+
style: {
|
|
8827
|
+
cursor: 'pointer'
|
|
8828
|
+
}
|
|
8829
|
+
}), "Week"), /*#__PURE__*/React__default.createElement(appStudio.View, Object.assign({}, buttonStyles, {
|
|
8830
|
+
backgroundColor: currentView === 'day' ? 'color.primary.100' : 'color.white',
|
|
8831
|
+
color: currentView === 'day' ? 'color.primary.700' : 'color.gray.700',
|
|
8832
|
+
onClick: () => handleViewChange('day'),
|
|
8833
|
+
style: {
|
|
8834
|
+
cursor: 'pointer'
|
|
8835
|
+
}
|
|
8836
|
+
}), "Day")), /*#__PURE__*/React__default.createElement(appStudio.View, Object.assign({}, buttonStyles, {
|
|
8837
|
+
onClick: handleToday,
|
|
8838
|
+
style: {
|
|
8839
|
+
cursor: 'pointer'
|
|
8840
|
+
}
|
|
8841
|
+
}, views.navButton), "Today"), /*#__PURE__*/React__default.createElement(appStudio.Horizontal, {
|
|
8842
|
+
gap: 4
|
|
8843
|
+
}, /*#__PURE__*/React__default.createElement(appStudio.View, Object.assign({}, iconButtonStyles, {
|
|
8844
|
+
onClick: handlePrevious,
|
|
8845
|
+
style: {
|
|
8846
|
+
cursor: 'pointer'
|
|
8847
|
+
}
|
|
8848
|
+
}, views.navButton), "\u2039"), /*#__PURE__*/React__default.createElement(appStudio.View, Object.assign({}, iconButtonStyles, {
|
|
8849
|
+
onClick: handleNext,
|
|
8850
|
+
style: {
|
|
8851
|
+
cursor: 'pointer'
|
|
8852
|
+
}
|
|
8853
|
+
}, views.navButton), "\u203A")))), currentView === 'month' && renderMonthView(), currentView === 'week' && renderWeekView(), currentView === 'day' && renderDayView());
|
|
8130
8854
|
};
|
|
8131
|
-
var Calendar = CalendarComponent;
|
|
8132
8855
|
|
|
8133
8856
|
/**
|
|
8134
8857
|
* Custom hook to manage cookie consent state
|
|
@@ -8260,7 +8983,7 @@
|
|
|
8260
8983
|
};
|
|
8261
8984
|
};
|
|
8262
8985
|
|
|
8263
|
-
var _excluded$
|
|
8986
|
+
var _excluded$i = ["title", "description", "acceptButtonText", "customizeButtonText", "position", "variant", "onAccept", "onCustomize", "views", "showCustomizeButton", "cookieExpiration", "themeMode"];
|
|
8264
8987
|
/**
|
|
8265
8988
|
* CookieConsent View Component
|
|
8266
8989
|
*
|
|
@@ -8281,7 +9004,7 @@
|
|
|
8281
9004
|
cookieExpiration = 365,
|
|
8282
9005
|
themeMode: propThemeMode
|
|
8283
9006
|
} = _ref,
|
|
8284
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
9007
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$i);
|
|
8285
9008
|
// Get theme context
|
|
8286
9009
|
var {
|
|
8287
9010
|
themeMode: contextThemeMode
|
|
@@ -8522,8 +9245,8 @@
|
|
|
8522
9245
|
// Note: Manual positioning logic has been replaced with intelligent positioning
|
|
8523
9246
|
// using viewport-aware algorithms in the ContextMenu component
|
|
8524
9247
|
|
|
8525
|
-
var _excluded$
|
|
8526
|
-
_excluded2$
|
|
9248
|
+
var _excluded$j = ["children", "disableNativeContextMenu", "asChild", "isDisabled", "views"],
|
|
9249
|
+
_excluded2$6 = ["items", "children", "position", "side", "align", "views", "style"],
|
|
8527
9250
|
_excluded3$5 = ["item", "children", "onSelect", "isDisabled", "views"],
|
|
8528
9251
|
_excluded4$5 = ["views"],
|
|
8529
9252
|
_excluded5$2 = ["views"],
|
|
@@ -8578,7 +9301,7 @@
|
|
|
8578
9301
|
isDisabled = false,
|
|
8579
9302
|
views
|
|
8580
9303
|
} = _ref2,
|
|
8581
|
-
props = _objectWithoutPropertiesLoose(_ref2, _excluded$
|
|
9304
|
+
props = _objectWithoutPropertiesLoose(_ref2, _excluded$j);
|
|
8582
9305
|
var {
|
|
8583
9306
|
triggerRef,
|
|
8584
9307
|
contentId,
|
|
@@ -8632,7 +9355,7 @@
|
|
|
8632
9355
|
views,
|
|
8633
9356
|
style // Capture user-provided style
|
|
8634
9357
|
} = _ref3,
|
|
8635
|
-
props = _objectWithoutPropertiesLoose(_ref3, _excluded2$
|
|
9358
|
+
props = _objectWithoutPropertiesLoose(_ref3, _excluded2$6);
|
|
8636
9359
|
var {
|
|
8637
9360
|
isOpen,
|
|
8638
9361
|
position: contextPosition,
|
|
@@ -8924,7 +9647,7 @@
|
|
|
8924
9647
|
}));
|
|
8925
9648
|
};
|
|
8926
9649
|
|
|
8927
|
-
var _excluded$
|
|
9650
|
+
var _excluded$k = ["children", "items", "size", "variant", "disableNativeContextMenu", "onOpenChange", "views"];
|
|
8928
9651
|
/**
|
|
8929
9652
|
* ContextMenu component for displaying a custom context menu on right-click.
|
|
8930
9653
|
* Supports both data-driven approach (with items prop) and compound component pattern.
|
|
@@ -8939,7 +9662,7 @@
|
|
|
8939
9662
|
onOpenChange,
|
|
8940
9663
|
views
|
|
8941
9664
|
} = _ref,
|
|
8942
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
9665
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$k);
|
|
8943
9666
|
var state = useContextMenuState({
|
|
8944
9667
|
size,
|
|
8945
9668
|
variant,
|
|
@@ -8991,15 +9714,15 @@
|
|
|
8991
9714
|
ContextMenu.Divider = ContextMenuDivider;
|
|
8992
9715
|
ContextMenu.Separator = ContextMenuSeparator; // Add the Separator component
|
|
8993
9716
|
|
|
8994
|
-
var _excluded$
|
|
8995
|
-
_excluded2$
|
|
9717
|
+
var _excluded$l = ["src", "color", "views", "themeMode"],
|
|
9718
|
+
_excluded2$7 = ["path"];
|
|
8996
9719
|
var FileSVG = _ref => {
|
|
8997
9720
|
var {
|
|
8998
9721
|
src,
|
|
8999
9722
|
color,
|
|
9000
9723
|
views
|
|
9001
9724
|
} = _ref,
|
|
9002
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
9725
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$l);
|
|
9003
9726
|
var {
|
|
9004
9727
|
getColor,
|
|
9005
9728
|
themeMode
|
|
@@ -9022,7 +9745,7 @@
|
|
|
9022
9745
|
var {
|
|
9023
9746
|
path
|
|
9024
9747
|
} = _ref2,
|
|
9025
|
-
props = _objectWithoutPropertiesLoose(_ref2, _excluded2$
|
|
9748
|
+
props = _objectWithoutPropertiesLoose(_ref2, _excluded2$7);
|
|
9026
9749
|
return /*#__PURE__*/React__default.createElement(appStudio.Image, Object.assign({
|
|
9027
9750
|
src: path
|
|
9028
9751
|
}, props));
|
|
@@ -9075,7 +9798,7 @@
|
|
|
9075
9798
|
};
|
|
9076
9799
|
};
|
|
9077
9800
|
|
|
9078
|
-
var _excluded$
|
|
9801
|
+
var _excluded$m = ["children", "views"];
|
|
9079
9802
|
var HelperText = _ref => {
|
|
9080
9803
|
var {
|
|
9081
9804
|
children,
|
|
@@ -9083,7 +9806,7 @@
|
|
|
9083
9806
|
helperText: {}
|
|
9084
9807
|
}
|
|
9085
9808
|
} = _ref,
|
|
9086
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
9809
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$m);
|
|
9087
9810
|
return /*#__PURE__*/React__default.createElement(Text
|
|
9088
9811
|
// Typography properties
|
|
9089
9812
|
, Object.assign({
|
|
@@ -9109,7 +9832,7 @@
|
|
|
9109
9832
|
}, views['helperText'], props), children);
|
|
9110
9833
|
};
|
|
9111
9834
|
|
|
9112
|
-
var _excluded$
|
|
9835
|
+
var _excluded$n = ["children", "helperText", "error", "views"];
|
|
9113
9836
|
var FieldContainer = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
|
|
9114
9837
|
var {
|
|
9115
9838
|
children,
|
|
@@ -9117,7 +9840,7 @@
|
|
|
9117
9840
|
error = false,
|
|
9118
9841
|
views
|
|
9119
9842
|
} = _ref,
|
|
9120
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
9843
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$n);
|
|
9121
9844
|
return /*#__PURE__*/React__default.createElement(appStudio.Vertical, Object.assign({
|
|
9122
9845
|
ref: ref,
|
|
9123
9846
|
// Layout properties
|
|
@@ -9153,13 +9876,23 @@
|
|
|
9153
9876
|
*/
|
|
9154
9877
|
var Shapes = {
|
|
9155
9878
|
default: {
|
|
9156
|
-
borderRadius: '8px'
|
|
9879
|
+
borderRadius: '8px',
|
|
9880
|
+
media: {
|
|
9881
|
+
mobile: {
|
|
9882
|
+
borderRadius: '6px'
|
|
9883
|
+
}
|
|
9884
|
+
}
|
|
9157
9885
|
},
|
|
9158
9886
|
sharp: {
|
|
9159
9887
|
borderRadius: 0
|
|
9160
9888
|
},
|
|
9161
9889
|
rounded: {
|
|
9162
|
-
borderRadius: '8px'
|
|
9890
|
+
borderRadius: '8px',
|
|
9891
|
+
media: {
|
|
9892
|
+
mobile: {
|
|
9893
|
+
borderRadius: '6px'
|
|
9894
|
+
}
|
|
9895
|
+
}
|
|
9163
9896
|
},
|
|
9164
9897
|
pillShaped: {
|
|
9165
9898
|
borderRadius: '9999px'
|
|
@@ -9184,13 +9917,19 @@
|
|
|
9184
9917
|
borderStyle: 'solid',
|
|
9185
9918
|
borderColor: 'color.gray.200',
|
|
9186
9919
|
backgroundColor: 'color.white',
|
|
9187
|
-
transition: '
|
|
9920
|
+
transition: 'border-color 0.2s ease, box-shadow 0.2s ease',
|
|
9188
9921
|
_hover: {
|
|
9189
9922
|
borderColor: 'color.gray.300'
|
|
9190
9923
|
},
|
|
9191
9924
|
_focus: {
|
|
9192
9925
|
borderColor: 'theme.primary',
|
|
9193
|
-
|
|
9926
|
+
outline: 'none',
|
|
9927
|
+
boxShadow: '0 0 0 2px rgba(255, 255, 255, 1), 0 0 0 4px rgba(66, 153, 225, 0.2)'
|
|
9928
|
+
},
|
|
9929
|
+
_focusVisible: {
|
|
9930
|
+
borderColor: 'theme.primary',
|
|
9931
|
+
outline: 'none',
|
|
9932
|
+
boxShadow: '0 0 0 2px rgba(255, 255, 255, 1), 0 0 0 4px rgba(66, 153, 225, 0.2)'
|
|
9194
9933
|
}
|
|
9195
9934
|
},
|
|
9196
9935
|
default: {
|
|
@@ -9200,18 +9939,29 @@
|
|
|
9200
9939
|
borderBottomColor: 'color.gray.200',
|
|
9201
9940
|
borderRadius: 0,
|
|
9202
9941
|
backgroundColor: 'color.white',
|
|
9203
|
-
transition: '
|
|
9942
|
+
transition: 'border-color 0.2s ease',
|
|
9204
9943
|
_hover: {
|
|
9205
9944
|
borderBottomColor: 'color.gray.300'
|
|
9206
9945
|
},
|
|
9207
9946
|
_focus: {
|
|
9208
|
-
borderBottomColor: 'theme.primary'
|
|
9947
|
+
borderBottomColor: 'theme.primary',
|
|
9948
|
+
outline: 'none'
|
|
9949
|
+
},
|
|
9950
|
+
_focusVisible: {
|
|
9951
|
+
borderBottomColor: 'theme.primary',
|
|
9952
|
+
outline: 'none'
|
|
9209
9953
|
}
|
|
9210
9954
|
},
|
|
9211
9955
|
none: {
|
|
9212
9956
|
border: 'none',
|
|
9213
9957
|
backgroundColor: 'transparent',
|
|
9214
|
-
transition: '
|
|
9958
|
+
transition: 'background-color 0.2s ease',
|
|
9959
|
+
_focus: {
|
|
9960
|
+
outline: 'none'
|
|
9961
|
+
},
|
|
9962
|
+
_focusVisible: {
|
|
9963
|
+
outline: 'none'
|
|
9964
|
+
}
|
|
9215
9965
|
}
|
|
9216
9966
|
};
|
|
9217
9967
|
/**
|
|
@@ -9221,7 +9971,15 @@
|
|
|
9221
9971
|
paddingTop: '16px',
|
|
9222
9972
|
paddingBottom: '8px',
|
|
9223
9973
|
paddingLeft: '16px',
|
|
9224
|
-
paddingRight: '16px'
|
|
9974
|
+
paddingRight: '16px',
|
|
9975
|
+
media: {
|
|
9976
|
+
mobile: {
|
|
9977
|
+
paddingTop: '12px',
|
|
9978
|
+
paddingBottom: '6px',
|
|
9979
|
+
paddingLeft: '12px',
|
|
9980
|
+
paddingRight: '12px'
|
|
9981
|
+
}
|
|
9982
|
+
}
|
|
9225
9983
|
};
|
|
9226
9984
|
/**
|
|
9227
9985
|
* Padding for input without label following the 4px grid system
|
|
@@ -9230,10 +9988,18 @@
|
|
|
9230
9988
|
paddingTop: '12px',
|
|
9231
9989
|
paddingBottom: '12px',
|
|
9232
9990
|
paddingLeft: '16px',
|
|
9233
|
-
paddingRight: '16px'
|
|
9991
|
+
paddingRight: '16px',
|
|
9992
|
+
media: {
|
|
9993
|
+
mobile: {
|
|
9994
|
+
paddingTop: '10px',
|
|
9995
|
+
paddingBottom: '10px',
|
|
9996
|
+
paddingLeft: '12px',
|
|
9997
|
+
paddingRight: '12px'
|
|
9998
|
+
}
|
|
9999
|
+
}
|
|
9234
10000
|
};
|
|
9235
10001
|
|
|
9236
|
-
var _excluded$
|
|
10002
|
+
var _excluded$o = ["label", "shadow", "children", "value", "size", "shape", "variant", "error", "showLabel", "isFocused", "isHovered", "isDisabled", "isReadOnly", "views"];
|
|
9237
10003
|
var FieldContent = _ref => {
|
|
9238
10004
|
var {
|
|
9239
10005
|
shadow,
|
|
@@ -9251,7 +10017,7 @@
|
|
|
9251
10017
|
pickerBox: {}
|
|
9252
10018
|
}
|
|
9253
10019
|
} = _ref,
|
|
9254
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
10020
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$o);
|
|
9255
10021
|
// Determine if the field is in an interactive state
|
|
9256
10022
|
var isInteractive = (isHovered || isFocused) && !isDisabled;
|
|
9257
10023
|
// Set the appropriate color based on state
|
|
@@ -9280,12 +10046,12 @@
|
|
|
9280
10046
|
}, showLabel ? PadddingWithLabel : PaddingWithoutLabel, shadow, Shapes[shape], InputVariants[variant], views['box'], props), children);
|
|
9281
10047
|
};
|
|
9282
10048
|
|
|
9283
|
-
var _excluded$
|
|
10049
|
+
var _excluded$p = ["children"];
|
|
9284
10050
|
var FieldIcons = _ref => {
|
|
9285
10051
|
var {
|
|
9286
10052
|
children
|
|
9287
10053
|
} = _ref,
|
|
9288
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
10054
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$p);
|
|
9289
10055
|
return /*#__PURE__*/React__default.createElement(appStudio.Center, Object.assign({
|
|
9290
10056
|
gap: 10,
|
|
9291
10057
|
right: 10,
|
|
@@ -9336,7 +10102,7 @@
|
|
|
9336
10102
|
}
|
|
9337
10103
|
};
|
|
9338
10104
|
|
|
9339
|
-
var _excluded$
|
|
10105
|
+
var _excluded$q = ["children", "heading", "isItalic", "isUnderlined", "isStriked", "weight", "size", "dropDown"];
|
|
9340
10106
|
var LabelView = _ref => {
|
|
9341
10107
|
var {
|
|
9342
10108
|
children,
|
|
@@ -9352,7 +10118,7 @@
|
|
|
9352
10118
|
size = 'sm'
|
|
9353
10119
|
// The fontSize prop for the Element is determined by the 'size' prop passed to LabelView.
|
|
9354
10120
|
} = _ref,
|
|
9355
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
10121
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$q);
|
|
9356
10122
|
// The fontStyle prop toggles between 'italic' and 'normal' based on the 'isItalic' boolean prop.
|
|
9357
10123
|
var headingStyles = heading ? HeadingSizes$1[heading] : {};
|
|
9358
10124
|
// fontWeight is derived from the Typography module, ensuring consistent font weighting across the app.
|
|
@@ -9384,7 +10150,7 @@
|
|
|
9384
10150
|
var Label = LabelComponent;
|
|
9385
10151
|
// Export the 'LabelComponent' as 'Label' to be reused throughout the project.
|
|
9386
10152
|
|
|
9387
|
-
var _excluded$
|
|
10153
|
+
var _excluded$r = ["children", "size", "error", "color", "views", "helperText"];
|
|
9388
10154
|
var FieldLabel = _ref => {
|
|
9389
10155
|
var {
|
|
9390
10156
|
children,
|
|
@@ -9395,7 +10161,7 @@
|
|
|
9395
10161
|
label: {}
|
|
9396
10162
|
}
|
|
9397
10163
|
} = _ref,
|
|
9398
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
10164
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$r);
|
|
9399
10165
|
return /*#__PURE__*/React__default.createElement(Label
|
|
9400
10166
|
// Position properties
|
|
9401
10167
|
, Object.assign({
|
|
@@ -9416,12 +10182,12 @@
|
|
|
9416
10182
|
}, views['label'], props), children);
|
|
9417
10183
|
};
|
|
9418
10184
|
|
|
9419
|
-
var _excluded$
|
|
10185
|
+
var _excluded$s = ["children"];
|
|
9420
10186
|
var FieldWrapper = _ref => {
|
|
9421
10187
|
var {
|
|
9422
10188
|
children
|
|
9423
10189
|
} = _ref,
|
|
9424
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
10190
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$s);
|
|
9425
10191
|
return /*#__PURE__*/React__default.createElement(appStudio.Vertical
|
|
9426
10192
|
// Layout properties
|
|
9427
10193
|
, Object.assign({
|
|
@@ -9454,8 +10220,8 @@
|
|
|
9454
10220
|
xl: 28
|
|
9455
10221
|
};
|
|
9456
10222
|
|
|
9457
|
-
var _excluded$
|
|
9458
|
-
_excluded2$
|
|
10223
|
+
var _excluded$t = ["isHovered", "setIsHovered", "option", "size", "callback", "style"],
|
|
10224
|
+
_excluded2$8 = ["id", "name", "value", "onChange", "isMulti", "isDisabled", "isReadOnly", "options"],
|
|
9459
10225
|
_excluded3$6 = ["option", "size", "removeOption"],
|
|
9460
10226
|
_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"];
|
|
9461
10227
|
/**
|
|
@@ -9472,7 +10238,7 @@
|
|
|
9472
10238
|
callback = () => {},
|
|
9473
10239
|
style
|
|
9474
10240
|
} = _ref,
|
|
9475
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
10241
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$t);
|
|
9476
10242
|
// Handles the click event on an option by invoking the callback with the selected option's value
|
|
9477
10243
|
var handleOptionClick = (e, option) => {
|
|
9478
10244
|
e.stopPropagation();
|
|
@@ -9580,7 +10346,7 @@
|
|
|
9580
10346
|
isReadOnly = false,
|
|
9581
10347
|
options = []
|
|
9582
10348
|
} = _ref4,
|
|
9583
|
-
props = _objectWithoutPropertiesLoose(_ref4, _excluded2$
|
|
10349
|
+
props = _objectWithoutPropertiesLoose(_ref4, _excluded2$8);
|
|
9584
10350
|
var handleChange = event => {
|
|
9585
10351
|
if (onChange) onChange(event);
|
|
9586
10352
|
};
|
|
@@ -10065,18 +10831,27 @@
|
|
|
10065
10831
|
// State-specific colors
|
|
10066
10832
|
states: {
|
|
10067
10833
|
hover: {
|
|
10068
|
-
active:
|
|
10069
|
-
|
|
10834
|
+
active: {
|
|
10835
|
+
opacity: 0.9
|
|
10836
|
+
},
|
|
10837
|
+
inactive: {
|
|
10838
|
+
backgroundColor: 'color.gray.400'
|
|
10839
|
+
}
|
|
10070
10840
|
},
|
|
10071
10841
|
focus: {
|
|
10072
|
-
active:
|
|
10073
|
-
|
|
10074
|
-
|
|
10842
|
+
active: {
|
|
10843
|
+
outline: 'none',
|
|
10844
|
+
boxShadow: '0 0 0 2px rgba(255, 255, 255, 1), 0 0 0 4px rgba(66, 153, 225, 0.3)'
|
|
10845
|
+
},
|
|
10846
|
+
inactive: {
|
|
10847
|
+
outline: 'none',
|
|
10848
|
+
boxShadow: '0 0 0 2px rgba(255, 255, 255, 1), 0 0 0 4px rgba(0, 0, 0, 0.1)'
|
|
10849
|
+
}
|
|
10075
10850
|
}
|
|
10076
10851
|
}
|
|
10077
10852
|
};
|
|
10078
10853
|
|
|
10079
|
-
var _excluded$
|
|
10854
|
+
var _excluded$u = ["id", "name", "label", "inActiveChild", "isChecked", "activeChild", "labelPosition", "shadow", "size", "value", "isHovered", "isDisabled", "isReadOnly", "on", "setOn", "onChange", "setValue", "setIsHovered", "helperText", "views"];
|
|
10080
10855
|
var SwitchContent = props => /*#__PURE__*/React__default.createElement(appStudio.Input, Object.assign({
|
|
10081
10856
|
type: "checkbox"
|
|
10082
10857
|
}, props));
|
|
@@ -10104,7 +10879,7 @@
|
|
|
10104
10879
|
label: {}
|
|
10105
10880
|
}
|
|
10106
10881
|
} = _ref,
|
|
10107
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
10882
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$u);
|
|
10108
10883
|
var handleToggle = event => {
|
|
10109
10884
|
if (!isReadOnly && !isDisabled) {
|
|
10110
10885
|
var newValue = event.target.checked;
|
|
@@ -10241,7 +11016,7 @@
|
|
|
10241
11016
|
// Export of the useTextAreaState hook for external usage.
|
|
10242
11017
|
};
|
|
10243
11018
|
|
|
10244
|
-
var _excluded$
|
|
11019
|
+
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"];
|
|
10245
11020
|
var TextAreaView = _ref => {
|
|
10246
11021
|
var {
|
|
10247
11022
|
id,
|
|
@@ -10276,7 +11051,7 @@
|
|
|
10276
11051
|
helperText: {}
|
|
10277
11052
|
}
|
|
10278
11053
|
} = _ref,
|
|
10279
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
11054
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$v);
|
|
10280
11055
|
var showLabel = !!(isFocused && label);
|
|
10281
11056
|
/**
|
|
10282
11057
|
* Styles for the textarea field
|
|
@@ -10415,7 +11190,7 @@
|
|
|
10415
11190
|
};
|
|
10416
11191
|
};
|
|
10417
11192
|
|
|
10418
|
-
var _excluded$
|
|
11193
|
+
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"];
|
|
10419
11194
|
/**
|
|
10420
11195
|
* Input component for text fields
|
|
10421
11196
|
*/
|
|
@@ -10461,7 +11236,7 @@
|
|
|
10461
11236
|
onBlur = () => {},
|
|
10462
11237
|
themeMode: elementMode
|
|
10463
11238
|
} = _ref,
|
|
10464
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
11239
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$w);
|
|
10465
11240
|
var {
|
|
10466
11241
|
getColor,
|
|
10467
11242
|
themeMode
|
|
@@ -10654,19 +11429,26 @@
|
|
|
10654
11429
|
selected: {
|
|
10655
11430
|
backgroundColor: 'theme.primary',
|
|
10656
11431
|
borderColor: 'theme.primary',
|
|
10657
|
-
|
|
11432
|
+
borderWidth: '2px',
|
|
11433
|
+
borderStyle: 'solid',
|
|
11434
|
+
color: 'color.white',
|
|
11435
|
+
transition: 'background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease'
|
|
10658
11436
|
},
|
|
10659
11437
|
unselected: {
|
|
10660
11438
|
backgroundColor: 'color.white',
|
|
10661
11439
|
borderWidth: '2px',
|
|
10662
11440
|
borderStyle: 'solid',
|
|
10663
11441
|
borderColor: 'color.gray.300',
|
|
10664
|
-
color: 'color.black'
|
|
11442
|
+
color: 'color.black',
|
|
11443
|
+
transition: 'background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease'
|
|
10665
11444
|
},
|
|
10666
11445
|
indeterminate: {
|
|
10667
11446
|
backgroundColor: 'theme.primary',
|
|
10668
11447
|
borderColor: 'theme.primary',
|
|
10669
|
-
|
|
11448
|
+
borderWidth: '2px',
|
|
11449
|
+
borderStyle: 'solid',
|
|
11450
|
+
color: 'color.white',
|
|
11451
|
+
transition: 'background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease'
|
|
10670
11452
|
}
|
|
10671
11453
|
};
|
|
10672
11454
|
/**
|
|
@@ -10675,31 +11457,47 @@
|
|
|
10675
11457
|
var StateStyles = {
|
|
10676
11458
|
hover: {
|
|
10677
11459
|
selected: {
|
|
10678
|
-
|
|
10679
|
-
borderColor: 'color.blue.600'
|
|
11460
|
+
opacity: 0.9
|
|
10680
11461
|
},
|
|
10681
11462
|
unselected: {
|
|
10682
|
-
borderColor: 'color.gray.400'
|
|
11463
|
+
borderColor: 'color.gray.400',
|
|
11464
|
+
backgroundColor: 'color.gray.50'
|
|
11465
|
+
},
|
|
11466
|
+
indeterminate: {
|
|
11467
|
+
opacity: 0.9
|
|
11468
|
+
}
|
|
11469
|
+
},
|
|
11470
|
+
focus: {
|
|
11471
|
+
selected: {
|
|
11472
|
+
outline: 'none',
|
|
11473
|
+
boxShadow: '0 0 0 2px rgba(255, 255, 255, 1), 0 0 0 4px rgba(66, 153, 225, 0.3)'
|
|
11474
|
+
},
|
|
11475
|
+
unselected: {
|
|
11476
|
+
outline: 'none',
|
|
11477
|
+
boxShadow: '0 0 0 2px rgba(255, 255, 255, 1), 0 0 0 4px rgba(66, 153, 225, 0.3)'
|
|
10683
11478
|
},
|
|
10684
11479
|
indeterminate: {
|
|
10685
|
-
|
|
10686
|
-
|
|
11480
|
+
outline: 'none',
|
|
11481
|
+
boxShadow: '0 0 0 2px rgba(255, 255, 255, 1), 0 0 0 4px rgba(66, 153, 225, 0.3)'
|
|
10687
11482
|
}
|
|
10688
11483
|
},
|
|
10689
11484
|
disabled: {
|
|
10690
11485
|
selected: {
|
|
10691
11486
|
backgroundColor: 'color.gray.300',
|
|
10692
11487
|
borderColor: 'color.gray.300',
|
|
10693
|
-
opacity: 0.
|
|
11488
|
+
opacity: 0.5,
|
|
11489
|
+
cursor: 'not-allowed'
|
|
10694
11490
|
},
|
|
10695
11491
|
unselected: {
|
|
10696
11492
|
borderColor: 'color.gray.300',
|
|
10697
|
-
opacity: 0.
|
|
11493
|
+
opacity: 0.5,
|
|
11494
|
+
cursor: 'not-allowed'
|
|
10698
11495
|
},
|
|
10699
11496
|
indeterminate: {
|
|
10700
11497
|
backgroundColor: 'color.gray.300',
|
|
10701
11498
|
borderColor: 'color.gray.300',
|
|
10702
|
-
opacity: 0.
|
|
11499
|
+
opacity: 0.5,
|
|
11500
|
+
cursor: 'not-allowed'
|
|
10703
11501
|
}
|
|
10704
11502
|
},
|
|
10705
11503
|
error: {
|
|
@@ -10717,7 +11515,7 @@
|
|
|
10717
11515
|
}
|
|
10718
11516
|
};
|
|
10719
11517
|
|
|
10720
|
-
var _excluded$
|
|
11518
|
+
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"];
|
|
10721
11519
|
var CheckboxView = _ref => {
|
|
10722
11520
|
var {
|
|
10723
11521
|
id,
|
|
@@ -10744,7 +11542,7 @@
|
|
|
10744
11542
|
},
|
|
10745
11543
|
infoText
|
|
10746
11544
|
} = _ref,
|
|
10747
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
11545
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$x);
|
|
10748
11546
|
var handleHover = () => setIsHovered(!isHovered);
|
|
10749
11547
|
var handleChange = () => {
|
|
10750
11548
|
if (!isReadOnly && !isDisabled) {
|
|
@@ -11202,7 +12000,7 @@
|
|
|
11202
12000
|
value: 'transparent'
|
|
11203
12001
|
}];
|
|
11204
12002
|
|
|
11205
|
-
var _excluded$
|
|
12003
|
+
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"];
|
|
11206
12004
|
var ColorInputView = _ref => {
|
|
11207
12005
|
var {
|
|
11208
12006
|
// Basic props
|
|
@@ -11243,7 +12041,7 @@
|
|
|
11243
12041
|
dropdownRef
|
|
11244
12042
|
// Other props
|
|
11245
12043
|
} = _ref,
|
|
11246
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
12044
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$y);
|
|
11247
12045
|
var {
|
|
11248
12046
|
getColor
|
|
11249
12047
|
} = appStudio.useTheme();
|
|
@@ -12882,11 +13680,11 @@
|
|
|
12882
13680
|
xl: 16
|
|
12883
13681
|
};
|
|
12884
13682
|
|
|
12885
|
-
var _excluded$
|
|
12886
|
-
_excluded2$
|
|
13683
|
+
var _excluded$z = ["size"],
|
|
13684
|
+
_excluded2$9 = ["size"],
|
|
12887
13685
|
_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"];
|
|
12888
13686
|
var CountryList = _ref => {
|
|
12889
|
-
var props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
13687
|
+
var props = _objectWithoutPropertiesLoose(_ref, _excluded$z);
|
|
12890
13688
|
return /*#__PURE__*/React__default.createElement(appStudio.Element, Object.assign({
|
|
12891
13689
|
as: "ul"
|
|
12892
13690
|
}, props));
|
|
@@ -12895,7 +13693,7 @@
|
|
|
12895
13693
|
type: "country"
|
|
12896
13694
|
}, props)));
|
|
12897
13695
|
var CountryItem = _ref2 => {
|
|
12898
|
-
var props = _objectWithoutPropertiesLoose(_ref2, _excluded2$
|
|
13696
|
+
var props = _objectWithoutPropertiesLoose(_ref2, _excluded2$9);
|
|
12899
13697
|
return /*#__PURE__*/React__default.createElement(appStudio.Element, Object.assign({
|
|
12900
13698
|
as: "li"
|
|
12901
13699
|
}, props));
|
|
@@ -13127,7 +13925,7 @@
|
|
|
13127
13925
|
};
|
|
13128
13926
|
};
|
|
13129
13927
|
|
|
13130
|
-
var _excluded$
|
|
13928
|
+
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"];
|
|
13131
13929
|
var DatePickerContent = props => /*#__PURE__*/React__default.createElement(appStudio.Input, Object.assign({
|
|
13132
13930
|
type: "date"
|
|
13133
13931
|
}, props));
|
|
@@ -13160,7 +13958,7 @@
|
|
|
13160
13958
|
onChange,
|
|
13161
13959
|
onChangeText
|
|
13162
13960
|
} = _ref,
|
|
13163
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
13961
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$A);
|
|
13164
13962
|
var showLabel = !!(isFocused && label);
|
|
13165
13963
|
var handleHover = () => setIsHovered(!isHovered);
|
|
13166
13964
|
var handleFocus = () => setIsFocused(true);
|
|
@@ -13247,8 +14045,8 @@
|
|
|
13247
14045
|
}, props, textFieldStates);
|
|
13248
14046
|
};
|
|
13249
14047
|
|
|
13250
|
-
var _excluded$
|
|
13251
|
-
_excluded2$
|
|
14048
|
+
var _excluded$B = ["visibleIcon", "hiddenIcon"],
|
|
14049
|
+
_excluded2$a = ["isVisible", "setIsVisible"];
|
|
13252
14050
|
var PasswordComponent = _ref => {
|
|
13253
14051
|
var {
|
|
13254
14052
|
visibleIcon = /*#__PURE__*/React__default.createElement(OpenEyeIcon, {
|
|
@@ -13258,13 +14056,13 @@
|
|
|
13258
14056
|
widthHeight: 14
|
|
13259
14057
|
})
|
|
13260
14058
|
} = _ref,
|
|
13261
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
14059
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$B);
|
|
13262
14060
|
var _usePasswordState = usePasswordState(props),
|
|
13263
14061
|
{
|
|
13264
14062
|
isVisible,
|
|
13265
14063
|
setIsVisible
|
|
13266
14064
|
} = _usePasswordState,
|
|
13267
|
-
passwordProps = _objectWithoutPropertiesLoose(_usePasswordState, _excluded2$
|
|
14065
|
+
passwordProps = _objectWithoutPropertiesLoose(_usePasswordState, _excluded2$a);
|
|
13268
14066
|
return /*#__PURE__*/React__default.createElement(TextFieldView, Object.assign({}, passwordProps, {
|
|
13269
14067
|
type: isVisible ? 'text' : 'password',
|
|
13270
14068
|
isClearable: false,
|
|
@@ -13312,7 +14110,7 @@
|
|
|
13312
14110
|
};
|
|
13313
14111
|
};
|
|
13314
14112
|
|
|
13315
|
-
var _excluded$
|
|
14113
|
+
var _excluded$C = ["placeholder", "items", "showTick", "onSelect", "searchEnabled", "left", "right", "label", "filteredItems", "setSelectedItem", "selectedItem", "highlightedIndex", "setHighlightedIndex", "searchQuery", "setSearchQuery", "setFilteredItems", "views", "isDropdownVisible", "setIsDropdownVisible"];
|
|
13316
14114
|
// Defines the functional component 'ComboBoxView' with destructured props.
|
|
13317
14115
|
var ComboBoxView = _ref => {
|
|
13318
14116
|
var {
|
|
@@ -13337,7 +14135,7 @@
|
|
|
13337
14135
|
setIsDropdownVisible
|
|
13338
14136
|
// Collects all further props not destructured explicitly.
|
|
13339
14137
|
} = _ref,
|
|
13340
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
14138
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$C);
|
|
13341
14139
|
var {
|
|
13342
14140
|
ref: triggerRef,
|
|
13343
14141
|
relation
|
|
@@ -13484,7 +14282,7 @@
|
|
|
13484
14282
|
})))))))))));
|
|
13485
14283
|
};
|
|
13486
14284
|
|
|
13487
|
-
var _excluded$
|
|
14285
|
+
var _excluded$D = ["id", "name", "items", "placeholder", "searchPlaceholder"];
|
|
13488
14286
|
// Defines the ComboBoxComponent functional component with ComboBoxProps
|
|
13489
14287
|
var ComboBoxComponent = _ref => {
|
|
13490
14288
|
var {
|
|
@@ -13500,7 +14298,7 @@
|
|
|
13500
14298
|
searchPlaceholder
|
|
13501
14299
|
// Destructures the rest of the props not explicitly defined
|
|
13502
14300
|
} = _ref,
|
|
13503
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
14301
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$D);
|
|
13504
14302
|
// Initializes ComboBox state using custom hook with items and placeholders
|
|
13505
14303
|
var state = useComboBoxState(items, placeholder, searchPlaceholder);
|
|
13506
14304
|
return (
|
|
@@ -13709,7 +14507,7 @@
|
|
|
13709
14507
|
};
|
|
13710
14508
|
};
|
|
13711
14509
|
|
|
13712
|
-
var _excluded$
|
|
14510
|
+
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"];
|
|
13713
14511
|
/**
|
|
13714
14512
|
* Individual tag chip component
|
|
13715
14513
|
*/
|
|
@@ -13825,7 +14623,7 @@
|
|
|
13825
14623
|
setIsHovered,
|
|
13826
14624
|
onClick
|
|
13827
14625
|
} = _ref2,
|
|
13828
|
-
props = _objectWithoutPropertiesLoose(_ref2, _excluded$
|
|
14626
|
+
props = _objectWithoutPropertiesLoose(_ref2, _excluded$E);
|
|
13829
14627
|
var {
|
|
13830
14628
|
getColor,
|
|
13831
14629
|
themeMode
|
|
@@ -13908,7 +14706,7 @@
|
|
|
13908
14706
|
}, views == null ? void 0 : views.placeholder), "Maximum ", maxTags, " tags reached")))), right));
|
|
13909
14707
|
};
|
|
13910
14708
|
|
|
13911
|
-
var _excluded$
|
|
14709
|
+
var _excluded$F = ["tags"];
|
|
13912
14710
|
/**
|
|
13913
14711
|
* TagInput Component
|
|
13914
14712
|
*
|
|
@@ -13920,7 +14718,7 @@
|
|
|
13920
14718
|
// Initialize state management with the custom hook
|
|
13921
14719
|
var tagInputState = useTagInputState(props);
|
|
13922
14720
|
// Separate the tags prop to avoid type conflicts
|
|
13923
|
-
var restProps = _objectWithoutPropertiesLoose(props, _excluded$
|
|
14721
|
+
var restProps = _objectWithoutPropertiesLoose(props, _excluded$F);
|
|
13924
14722
|
// Render the view component with combined props and state
|
|
13925
14723
|
return /*#__PURE__*/React__default.createElement(TagInputView, Object.assign({}, tagInputState, restProps));
|
|
13926
14724
|
};
|
|
@@ -14233,7 +15031,7 @@
|
|
|
14233
15031
|
};
|
|
14234
15032
|
};
|
|
14235
15033
|
|
|
14236
|
-
var _excluded$
|
|
15034
|
+
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"];
|
|
14237
15035
|
// Create a context for OTP input slots
|
|
14238
15036
|
var OTPInputContext = /*#__PURE__*/React.createContext({
|
|
14239
15037
|
slots: [],
|
|
@@ -14287,7 +15085,7 @@
|
|
|
14287
15085
|
onFocus = () => {}
|
|
14288
15086
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
14289
15087
|
} = _ref,
|
|
14290
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
15088
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$G);
|
|
14291
15089
|
appStudio.useTheme(); // Initialize theme context
|
|
14292
15090
|
var showLabel = !!label;
|
|
14293
15091
|
// Create context value for slots
|
|
@@ -14519,7 +15317,7 @@
|
|
|
14519
15317
|
};
|
|
14520
15318
|
var OTPInput = OTPInputComponent;
|
|
14521
15319
|
|
|
14522
|
-
var _excluded$
|
|
15320
|
+
var _excluded$H = ["children", "autoFocus", "initFocus", "onChange"];
|
|
14523
15321
|
var FocusContext = /*#__PURE__*/React.createContext({
|
|
14524
15322
|
active: false,
|
|
14525
15323
|
focusNextInput: () => {},
|
|
@@ -14535,7 +15333,7 @@
|
|
|
14535
15333
|
initFocus,
|
|
14536
15334
|
onChange = () => {}
|
|
14537
15335
|
} = _ref,
|
|
14538
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
15336
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$H);
|
|
14539
15337
|
var formik$1 = formik.useFormikContext();
|
|
14540
15338
|
React.useEffect(() => {
|
|
14541
15339
|
onChange(formik$1.values);
|
|
@@ -14583,7 +15381,7 @@
|
|
|
14583
15381
|
}, /*#__PURE__*/React__default.createElement(appStudio.Form, Object.assign({}, props), children));
|
|
14584
15382
|
};
|
|
14585
15383
|
|
|
14586
|
-
var _excluded$
|
|
15384
|
+
var _excluded$I = ["name", "type"];
|
|
14587
15385
|
var getInputTypeProps = type => {
|
|
14588
15386
|
switch (type) {
|
|
14589
15387
|
case 'email':
|
|
@@ -14622,7 +15420,7 @@
|
|
|
14622
15420
|
name,
|
|
14623
15421
|
type
|
|
14624
15422
|
} = _ref,
|
|
14625
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
15423
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$I);
|
|
14626
15424
|
var focus = useFormFocus();
|
|
14627
15425
|
var {
|
|
14628
15426
|
touched,
|
|
@@ -14666,13 +15464,13 @@
|
|
|
14666
15464
|
} : {});
|
|
14667
15465
|
};
|
|
14668
15466
|
|
|
14669
|
-
var _excluded$
|
|
15467
|
+
var _excluded$J = ["value"];
|
|
14670
15468
|
var CheckboxComponent$1 = props => {
|
|
14671
15469
|
var _useFormikInput = useFormikInput(props),
|
|
14672
15470
|
{
|
|
14673
15471
|
value
|
|
14674
15472
|
} = _useFormikInput,
|
|
14675
|
-
formProps = _objectWithoutPropertiesLoose(_useFormikInput, _excluded$
|
|
15473
|
+
formProps = _objectWithoutPropertiesLoose(_useFormikInput, _excluded$J);
|
|
14676
15474
|
formProps.isChecked = value;
|
|
14677
15475
|
var checkboxStates = useCheckboxState(props);
|
|
14678
15476
|
return /*#__PURE__*/React__default.createElement(CheckboxView, Object.assign({}, checkboxStates, formProps));
|
|
@@ -14928,7 +15726,12 @@
|
|
|
14928
15726
|
maxWidth: '100%',
|
|
14929
15727
|
borderRadius: '12px',
|
|
14930
15728
|
backgroundColor: 'color.white',
|
|
14931
|
-
transition: 'all 0.2s ease'
|
|
15729
|
+
transition: 'all 0.2s ease',
|
|
15730
|
+
media: {
|
|
15731
|
+
mobile: {
|
|
15732
|
+
borderRadius: '8px'
|
|
15733
|
+
}
|
|
15734
|
+
}
|
|
14932
15735
|
},
|
|
14933
15736
|
content: {
|
|
14934
15737
|
width: '100%',
|
|
@@ -14937,7 +15740,13 @@
|
|
|
14937
15740
|
backgroundColor: 'color.white',
|
|
14938
15741
|
borderWidth: '1px',
|
|
14939
15742
|
borderStyle: 'solid',
|
|
14940
|
-
borderColor: 'color.gray.200'
|
|
15743
|
+
borderColor: 'color.gray.200',
|
|
15744
|
+
media: {
|
|
15745
|
+
mobile: {
|
|
15746
|
+
padding: '10px',
|
|
15747
|
+
borderRadius: '8px'
|
|
15748
|
+
}
|
|
15749
|
+
}
|
|
14941
15750
|
},
|
|
14942
15751
|
textarea: {
|
|
14943
15752
|
width: '100%',
|
|
@@ -14951,7 +15760,14 @@
|
|
|
14951
15760
|
border: 'none',
|
|
14952
15761
|
outline: 'none',
|
|
14953
15762
|
resize: 'none',
|
|
14954
|
-
overflow: 'auto'
|
|
15763
|
+
overflow: 'auto',
|
|
15764
|
+
media: {
|
|
15765
|
+
mobile: {
|
|
15766
|
+
padding: '6px 10px',
|
|
15767
|
+
fontSize: '13px',
|
|
15768
|
+
minHeight: '36px'
|
|
15769
|
+
}
|
|
15770
|
+
}
|
|
14955
15771
|
},
|
|
14956
15772
|
attachments: {
|
|
14957
15773
|
display: 'flex',
|
|
@@ -14991,7 +15807,14 @@
|
|
|
14991
15807
|
borderRadius: '8px',
|
|
14992
15808
|
backgroundColor: 'theme.primary',
|
|
14993
15809
|
color: 'color.white',
|
|
14994
|
-
transition: 'all 0.2s ease'
|
|
15810
|
+
transition: 'all 0.2s ease',
|
|
15811
|
+
media: {
|
|
15812
|
+
mobile: {
|
|
15813
|
+
height: '32px',
|
|
15814
|
+
minWidth: '32px',
|
|
15815
|
+
padding: '0 10px'
|
|
15816
|
+
}
|
|
15817
|
+
}
|
|
14995
15818
|
},
|
|
14996
15819
|
fileButton: {
|
|
14997
15820
|
height: '36px',
|
|
@@ -14999,7 +15822,13 @@
|
|
|
14999
15822
|
borderRadius: '8px',
|
|
15000
15823
|
backgroundColor: 'transparent',
|
|
15001
15824
|
color: 'color.gray.500',
|
|
15002
|
-
transition: 'all 0.2s ease'
|
|
15825
|
+
transition: 'all 0.2s ease',
|
|
15826
|
+
media: {
|
|
15827
|
+
mobile: {
|
|
15828
|
+
height: '32px',
|
|
15829
|
+
padding: '0 10px'
|
|
15830
|
+
}
|
|
15831
|
+
}
|
|
15003
15832
|
},
|
|
15004
15833
|
modelSelector: {
|
|
15005
15834
|
height: '36px',
|
|
@@ -15017,66 +15846,368 @@
|
|
|
15017
15846
|
padding: '8px 0'
|
|
15018
15847
|
}
|
|
15019
15848
|
};
|
|
15020
|
-
/**
|
|
15021
|
-
* Shape styles for the ChatInput component
|
|
15022
|
-
*/
|
|
15023
|
-
var Shapes$2 = {
|
|
15024
|
-
default: {
|
|
15025
|
-
borderRadius: '8px'
|
|
15026
|
-
},
|
|
15027
|
-
sharp: {
|
|
15028
|
-
borderRadius: '0px'
|
|
15029
|
-
},
|
|
15030
|
-
rounded: {
|
|
15031
|
-
borderRadius: '8px'
|
|
15849
|
+
/**
|
|
15850
|
+
* Shape styles for the ChatInput component
|
|
15851
|
+
*/
|
|
15852
|
+
var Shapes$2 = {
|
|
15853
|
+
default: {
|
|
15854
|
+
borderRadius: '8px'
|
|
15855
|
+
},
|
|
15856
|
+
sharp: {
|
|
15857
|
+
borderRadius: '0px'
|
|
15858
|
+
},
|
|
15859
|
+
rounded: {
|
|
15860
|
+
borderRadius: '8px'
|
|
15861
|
+
}
|
|
15862
|
+
};
|
|
15863
|
+
/**
|
|
15864
|
+
* Size styles for the ChatInput component
|
|
15865
|
+
*/
|
|
15866
|
+
var Sizes$2 = {
|
|
15867
|
+
xs: {
|
|
15868
|
+
fontSize: '10px',
|
|
15869
|
+
padding: '4px 8px'
|
|
15870
|
+
},
|
|
15871
|
+
sm: {
|
|
15872
|
+
fontSize: '12px',
|
|
15873
|
+
padding: '6px 10px'
|
|
15874
|
+
},
|
|
15875
|
+
md: {
|
|
15876
|
+
fontSize: '14px',
|
|
15877
|
+
padding: '8px 12px'
|
|
15878
|
+
},
|
|
15879
|
+
lg: {
|
|
15880
|
+
fontSize: '16px',
|
|
15881
|
+
padding: '10px 14px'
|
|
15882
|
+
},
|
|
15883
|
+
xl: {
|
|
15884
|
+
fontSize: '20px',
|
|
15885
|
+
padding: '12px 16px'
|
|
15886
|
+
}
|
|
15887
|
+
};
|
|
15888
|
+
/**
|
|
15889
|
+
* Variant styles for the ChatInput component
|
|
15890
|
+
*/
|
|
15891
|
+
var Variants$1 = {
|
|
15892
|
+
default: {
|
|
15893
|
+
backgroundColor: 'color.white',
|
|
15894
|
+
borderWidth: '1px',
|
|
15895
|
+
borderStyle: 'solid',
|
|
15896
|
+
borderColor: 'color.gray.200'
|
|
15897
|
+
},
|
|
15898
|
+
outline: {
|
|
15899
|
+
backgroundColor: 'transparent',
|
|
15900
|
+
borderWidth: '1px',
|
|
15901
|
+
borderStyle: 'solid',
|
|
15902
|
+
borderColor: 'color.gray.300'
|
|
15903
|
+
},
|
|
15904
|
+
none: {
|
|
15905
|
+
backgroundColor: 'transparent',
|
|
15906
|
+
border: 'none'
|
|
15907
|
+
}
|
|
15908
|
+
};
|
|
15909
|
+
|
|
15910
|
+
// Generate a unique ID for ARIA attributes
|
|
15911
|
+
var generateId$1 = prefix => prefix + "-" + Math.random().toString(36).substring(2, 9);
|
|
15912
|
+
var useHoverCardState = function useHoverCardState(_temp) {
|
|
15913
|
+
var {
|
|
15914
|
+
openDelay = 200,
|
|
15915
|
+
closeDelay = 300
|
|
15916
|
+
} = _temp === void 0 ? {} : _temp;
|
|
15917
|
+
var [isOpen, setIsOpen] = React.useState(false);
|
|
15918
|
+
var openTimerRef = React.useRef(null);
|
|
15919
|
+
var closeTimerRef = React.useRef(null);
|
|
15920
|
+
// Refs for trigger and content elements for positioning
|
|
15921
|
+
var triggerRef = React.useRef(null);
|
|
15922
|
+
var contentRef = React.useRef(null);
|
|
15923
|
+
// Unique IDs for ARIA attributes
|
|
15924
|
+
var contentId = React.useMemo(() => generateId$1('hovercard-content'), []);
|
|
15925
|
+
var triggerId = React.useMemo(() => generateId$1('hovercard-trigger'), []);
|
|
15926
|
+
var clearTimers = React.useCallback(() => {
|
|
15927
|
+
if (openTimerRef.current) {
|
|
15928
|
+
clearTimeout(openTimerRef.current);
|
|
15929
|
+
openTimerRef.current = null;
|
|
15930
|
+
}
|
|
15931
|
+
if (closeTimerRef.current) {
|
|
15932
|
+
clearTimeout(closeTimerRef.current);
|
|
15933
|
+
closeTimerRef.current = null;
|
|
15934
|
+
}
|
|
15935
|
+
}, []);
|
|
15936
|
+
var openCard = React.useCallback(() => {
|
|
15937
|
+
clearTimers(); // Clear any pending close
|
|
15938
|
+
if (!isOpen) {
|
|
15939
|
+
openTimerRef.current = setTimeout(() => {
|
|
15940
|
+
setIsOpen(true);
|
|
15941
|
+
}, openDelay);
|
|
15942
|
+
}
|
|
15943
|
+
}, [isOpen, openDelay, clearTimers]);
|
|
15944
|
+
var closeCard = React.useCallback(() => {
|
|
15945
|
+
clearTimers(); // Clear any pending open
|
|
15946
|
+
if (isOpen) {
|
|
15947
|
+
closeTimerRef.current = setTimeout(() => {
|
|
15948
|
+
setIsOpen(false);
|
|
15949
|
+
}, closeDelay);
|
|
15950
|
+
}
|
|
15951
|
+
}, [isOpen, closeDelay, clearTimers]);
|
|
15952
|
+
// Function specifically to cancel the close timer (e.g., when mouse enters content)
|
|
15953
|
+
var cancelCloseTimer = React.useCallback(() => {
|
|
15954
|
+
if (closeTimerRef.current) {
|
|
15955
|
+
clearTimeout(closeTimerRef.current);
|
|
15956
|
+
closeTimerRef.current = null;
|
|
15957
|
+
}
|
|
15958
|
+
}, []);
|
|
15959
|
+
// Cleanup timers on unmount
|
|
15960
|
+
React.useEffect(() => {
|
|
15961
|
+
return () => clearTimers();
|
|
15962
|
+
}, [clearTimers]);
|
|
15963
|
+
return {
|
|
15964
|
+
isOpen,
|
|
15965
|
+
openCard,
|
|
15966
|
+
closeCard,
|
|
15967
|
+
cancelCloseTimer,
|
|
15968
|
+
triggerRef,
|
|
15969
|
+
contentRef,
|
|
15970
|
+
contentId,
|
|
15971
|
+
triggerId
|
|
15972
|
+
};
|
|
15973
|
+
};
|
|
15974
|
+
|
|
15975
|
+
var _excluded$K = ["children", "views", "asChild"],
|
|
15976
|
+
_excluded2$b = ["children", "views", "side", "align", "sideOffset", "style", "backgroundColor", "borderRadius", "boxShadow", "padding", "minWidth", "maxWidth"];
|
|
15977
|
+
// Create context for the HoverCard
|
|
15978
|
+
var HoverCardContext = /*#__PURE__*/React.createContext({
|
|
15979
|
+
isOpen: false,
|
|
15980
|
+
openCard: () => {},
|
|
15981
|
+
closeCard: () => {},
|
|
15982
|
+
cancelCloseTimer: () => {},
|
|
15983
|
+
triggerRef: {
|
|
15984
|
+
current: null
|
|
15985
|
+
},
|
|
15986
|
+
contentRef: {
|
|
15987
|
+
current: null
|
|
15988
|
+
},
|
|
15989
|
+
contentId: '',
|
|
15990
|
+
triggerId: ''
|
|
15991
|
+
});
|
|
15992
|
+
var HoverCardProvider = _ref => {
|
|
15993
|
+
var {
|
|
15994
|
+
children,
|
|
15995
|
+
value
|
|
15996
|
+
} = _ref;
|
|
15997
|
+
return /*#__PURE__*/React__default.createElement(HoverCardContext.Provider, {
|
|
15998
|
+
value: value
|
|
15999
|
+
}, children);
|
|
16000
|
+
};
|
|
16001
|
+
var useHoverCardContext = () => {
|
|
16002
|
+
var context = React.useContext(HoverCardContext);
|
|
16003
|
+
if (!context) {
|
|
16004
|
+
throw new Error('useHoverCardContext must be used within a HoverCardProvider');
|
|
16005
|
+
}
|
|
16006
|
+
return context;
|
|
16007
|
+
};
|
|
16008
|
+
var HoverCardTrigger = _ref2 => {
|
|
16009
|
+
var {
|
|
16010
|
+
children,
|
|
16011
|
+
views,
|
|
16012
|
+
asChild = false
|
|
16013
|
+
} = _ref2,
|
|
16014
|
+
props = _objectWithoutPropertiesLoose(_ref2, _excluded$K);
|
|
16015
|
+
var {
|
|
16016
|
+
openCard,
|
|
16017
|
+
closeCard,
|
|
16018
|
+
triggerRef,
|
|
16019
|
+
contentId,
|
|
16020
|
+
triggerId
|
|
16021
|
+
} = useHoverCardContext();
|
|
16022
|
+
var handleMouseEnter = () => openCard();
|
|
16023
|
+
var handleMouseLeave = () => closeCard();
|
|
16024
|
+
var handleFocus = () => openCard(); // For keyboard accessibility
|
|
16025
|
+
var handleBlur = () => closeCard(); // For keyboard accessibility
|
|
16026
|
+
var triggerProps = Object.assign({
|
|
16027
|
+
ref: triggerRef,
|
|
16028
|
+
onMouseEnter: handleMouseEnter,
|
|
16029
|
+
onMouseLeave: handleMouseLeave,
|
|
16030
|
+
onFocus: handleFocus,
|
|
16031
|
+
onBlur: handleBlur,
|
|
16032
|
+
id: triggerId,
|
|
16033
|
+
'aria-describedby': contentId
|
|
16034
|
+
}, views == null ? void 0 : views.container, props);
|
|
16035
|
+
if (asChild && /*#__PURE__*/React.isValidElement(children)) {
|
|
16036
|
+
// Clone the child element and merge props
|
|
16037
|
+
var child = React.Children.only(children);
|
|
16038
|
+
return /*#__PURE__*/React.cloneElement(child, Object.assign({}, triggerProps, child.props));
|
|
15032
16039
|
}
|
|
16040
|
+
// Default: wrap children in a View
|
|
16041
|
+
return /*#__PURE__*/React__default.createElement(appStudio.View, Object.assign({
|
|
16042
|
+
position: "relative",
|
|
16043
|
+
display: "inline-block"
|
|
16044
|
+
}, triggerProps), children);
|
|
15033
16045
|
};
|
|
15034
|
-
|
|
15035
|
-
|
|
15036
|
-
|
|
15037
|
-
|
|
15038
|
-
|
|
15039
|
-
|
|
15040
|
-
|
|
15041
|
-
|
|
15042
|
-
|
|
15043
|
-
|
|
15044
|
-
|
|
15045
|
-
|
|
15046
|
-
|
|
15047
|
-
|
|
15048
|
-
|
|
15049
|
-
|
|
15050
|
-
|
|
15051
|
-
|
|
15052
|
-
|
|
15053
|
-
|
|
15054
|
-
|
|
15055
|
-
|
|
15056
|
-
|
|
16046
|
+
var HoverCardContent = _ref3 => {
|
|
16047
|
+
var {
|
|
16048
|
+
children,
|
|
16049
|
+
views,
|
|
16050
|
+
side = 'bottom',
|
|
16051
|
+
align = 'center',
|
|
16052
|
+
sideOffset = 8,
|
|
16053
|
+
style: userStyle,
|
|
16054
|
+
// User provided style override
|
|
16055
|
+
backgroundColor = 'white',
|
|
16056
|
+
borderRadius = '4px',
|
|
16057
|
+
boxShadow = '0px 2px 8px rgba(0, 0, 0, 0.15)',
|
|
16058
|
+
padding = '12px',
|
|
16059
|
+
minWidth = '50px',
|
|
16060
|
+
maxWidth = '300px'
|
|
16061
|
+
} = _ref3,
|
|
16062
|
+
props = _objectWithoutPropertiesLoose(_ref3, _excluded2$b);
|
|
16063
|
+
var {
|
|
16064
|
+
isOpen,
|
|
16065
|
+
cancelCloseTimer,
|
|
16066
|
+
closeCard,
|
|
16067
|
+
contentRef,
|
|
16068
|
+
triggerRef,
|
|
16069
|
+
contentId,
|
|
16070
|
+
triggerId
|
|
16071
|
+
} = useHoverCardContext();
|
|
16072
|
+
// Use useElementPosition for intelligent positioning
|
|
16073
|
+
var {
|
|
16074
|
+
ref: positionRef,
|
|
16075
|
+
relation
|
|
16076
|
+
} = appStudio.useElementPosition({
|
|
16077
|
+
trackChanges: true,
|
|
16078
|
+
trackOnHover: true,
|
|
16079
|
+
trackOnScroll: true,
|
|
16080
|
+
trackOnResize: true
|
|
16081
|
+
});
|
|
16082
|
+
// Sync the position ref with the trigger ref for positioning calculations
|
|
16083
|
+
React.useEffect(() => {
|
|
16084
|
+
if (triggerRef != null && triggerRef.current && (positionRef == null ? void 0 : positionRef.current) !== triggerRef.current) {
|
|
16085
|
+
// Update the position tracking to use the trigger element
|
|
16086
|
+
if (positionRef) {
|
|
16087
|
+
positionRef.current = triggerRef.current;
|
|
16088
|
+
}
|
|
16089
|
+
}
|
|
16090
|
+
}, [triggerRef, positionRef, isOpen]);
|
|
16091
|
+
var handleMouseEnter = () => cancelCloseTimer(); // Keep card open if mouse enters content
|
|
16092
|
+
var handleMouseLeave = () => closeCard();
|
|
16093
|
+
if (!isOpen) {
|
|
16094
|
+
return null; // Don't render content if not open
|
|
15057
16095
|
}
|
|
16096
|
+
// Create intelligent positioning styles based on useElementPosition relation data
|
|
16097
|
+
var getPositionStyles = () => {
|
|
16098
|
+
if (!relation || !(triggerRef != null && triggerRef.current)) {
|
|
16099
|
+
// Fallback positioning if relation data is not available
|
|
16100
|
+
return {
|
|
16101
|
+
position: 'absolute',
|
|
16102
|
+
top: 0,
|
|
16103
|
+
left: 0,
|
|
16104
|
+
zIndex: 1000
|
|
16105
|
+
};
|
|
16106
|
+
}
|
|
16107
|
+
var triggerRect = triggerRef.current.getBoundingClientRect();
|
|
16108
|
+
var placement = side;
|
|
16109
|
+
// Use relation data to determine optimal placement
|
|
16110
|
+
// If preferred side doesn't have enough space, use the side with more space
|
|
16111
|
+
if (side === 'bottom' && relation.space.vertical === 'top') {
|
|
16112
|
+
placement = 'top';
|
|
16113
|
+
} else if (side === 'top' && relation.space.vertical === 'bottom') {
|
|
16114
|
+
placement = 'bottom';
|
|
16115
|
+
} else if (side === 'right' && relation.space.horizontal === 'left') {
|
|
16116
|
+
placement = 'left';
|
|
16117
|
+
} else if (side === 'left' && relation.space.horizontal === 'right') {
|
|
16118
|
+
placement = 'right';
|
|
16119
|
+
}
|
|
16120
|
+
// Calculate position based on optimal placement
|
|
16121
|
+
var x = 0;
|
|
16122
|
+
var y = 0;
|
|
16123
|
+
switch (placement) {
|
|
16124
|
+
case 'bottom':
|
|
16125
|
+
x = triggerRect.left + triggerRect.width / 2;
|
|
16126
|
+
y = triggerRect.bottom + sideOffset;
|
|
16127
|
+
break;
|
|
16128
|
+
case 'top':
|
|
16129
|
+
x = triggerRect.left + triggerRect.width / 2;
|
|
16130
|
+
y = triggerRect.top - sideOffset;
|
|
16131
|
+
break;
|
|
16132
|
+
case 'right':
|
|
16133
|
+
x = triggerRect.right + sideOffset;
|
|
16134
|
+
y = triggerRect.top + triggerRect.height / 2;
|
|
16135
|
+
break;
|
|
16136
|
+
case 'left':
|
|
16137
|
+
x = triggerRect.left - sideOffset;
|
|
16138
|
+
y = triggerRect.top + triggerRect.height / 2;
|
|
16139
|
+
break;
|
|
16140
|
+
}
|
|
16141
|
+
return {
|
|
16142
|
+
position: 'fixed',
|
|
16143
|
+
left: x,
|
|
16144
|
+
top: y,
|
|
16145
|
+
zIndex: 1000,
|
|
16146
|
+
transform: getTransformOrigin(placement)
|
|
16147
|
+
};
|
|
16148
|
+
};
|
|
16149
|
+
// Helper function to set transform origin for better positioning
|
|
16150
|
+
var getTransformOrigin = placement => {
|
|
16151
|
+
switch (placement) {
|
|
16152
|
+
case 'bottom':
|
|
16153
|
+
return 'translate(-50%, 0)';
|
|
16154
|
+
case 'top':
|
|
16155
|
+
return 'translate(-50%, -100%)';
|
|
16156
|
+
case 'right':
|
|
16157
|
+
return 'translate(0, -50%)';
|
|
16158
|
+
case 'left':
|
|
16159
|
+
return 'translate(-100%, -50%)';
|
|
16160
|
+
default:
|
|
16161
|
+
return 'translate(-50%, 0)';
|
|
16162
|
+
}
|
|
16163
|
+
};
|
|
16164
|
+
var positionStyles = getPositionStyles();
|
|
16165
|
+
return /*#__PURE__*/React__default.createElement(appStudio.View, Object.assign({
|
|
16166
|
+
ref: contentRef,
|
|
16167
|
+
id: contentId,
|
|
16168
|
+
role: "tooltip" // Use tooltip role for accessibility
|
|
16169
|
+
,
|
|
16170
|
+
"aria-labelledby": triggerId,
|
|
16171
|
+
onMouseEnter: handleMouseEnter,
|
|
16172
|
+
onMouseLeave: handleMouseLeave,
|
|
16173
|
+
backgroundColor: backgroundColor,
|
|
16174
|
+
borderRadius: borderRadius,
|
|
16175
|
+
boxShadow: boxShadow,
|
|
16176
|
+
padding: padding,
|
|
16177
|
+
minWidth: minWidth,
|
|
16178
|
+
maxWidth: maxWidth,
|
|
16179
|
+
// Combine intelligent position styles with user styles
|
|
16180
|
+
style: Object.assign({}, positionStyles, userStyle)
|
|
16181
|
+
}, views == null ? void 0 : views.container, props), children);
|
|
15058
16182
|
};
|
|
16183
|
+
|
|
16184
|
+
var _excluded$L = ["children", "views", "openDelay", "closeDelay"];
|
|
15059
16185
|
/**
|
|
15060
|
-
*
|
|
16186
|
+
* HoverCard component displays floating content when hovering over a trigger element.
|
|
16187
|
+
* Supports configurable open and close delays for a smoother user experience.
|
|
15061
16188
|
*/
|
|
15062
|
-
var
|
|
15063
|
-
|
|
15064
|
-
|
|
15065
|
-
|
|
15066
|
-
|
|
15067
|
-
|
|
15068
|
-
|
|
15069
|
-
|
|
15070
|
-
|
|
15071
|
-
|
|
15072
|
-
|
|
15073
|
-
|
|
15074
|
-
|
|
15075
|
-
|
|
15076
|
-
|
|
15077
|
-
|
|
15078
|
-
|
|
16189
|
+
var HoverCardComponent = _ref => {
|
|
16190
|
+
var {
|
|
16191
|
+
children,
|
|
16192
|
+
views,
|
|
16193
|
+
openDelay,
|
|
16194
|
+
closeDelay
|
|
16195
|
+
} = _ref,
|
|
16196
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$L);
|
|
16197
|
+
var hoverCardState = useHoverCardState({
|
|
16198
|
+
openDelay,
|
|
16199
|
+
closeDelay
|
|
16200
|
+
});
|
|
16201
|
+
return /*#__PURE__*/React__default.createElement(HoverCardProvider, {
|
|
16202
|
+
value: hoverCardState
|
|
16203
|
+
}, /*#__PURE__*/React__default.createElement(appStudio.View, Object.assign({
|
|
16204
|
+
position: "relative",
|
|
16205
|
+
display: "inline-block"
|
|
16206
|
+
}, views == null ? void 0 : views.container, props), children));
|
|
15079
16207
|
};
|
|
16208
|
+
var HoverCard = HoverCardComponent;
|
|
16209
|
+
HoverCard.Trigger = HoverCardTrigger;
|
|
16210
|
+
HoverCard.Content = HoverCardContent;
|
|
15080
16211
|
|
|
15081
16212
|
/**
|
|
15082
16213
|
* Default styles for AgentChat component
|
|
@@ -16635,13 +17766,15 @@
|
|
|
16635
17766
|
var getSlider = themeMode => {
|
|
16636
17767
|
return {
|
|
16637
17768
|
default: {
|
|
16638
|
-
backgroundColor: 'color.
|
|
17769
|
+
backgroundColor: 'color.gray.200',
|
|
17770
|
+
transition: 'background-color 0.15s ease'
|
|
16639
17771
|
},
|
|
16640
17772
|
outline: {
|
|
16641
17773
|
backgroundColor: 'transparent',
|
|
16642
17774
|
borderWidth: 1,
|
|
16643
17775
|
borderStyle: 'solid',
|
|
16644
|
-
borderColor: 'color.
|
|
17776
|
+
borderColor: 'color.gray.300',
|
|
17777
|
+
transition: 'border-color 0.15s ease'
|
|
16645
17778
|
}
|
|
16646
17779
|
};
|
|
16647
17780
|
// Add dark mode conditional styling here
|
|
@@ -17571,7 +18704,15 @@
|
|
|
17571
18704
|
height: isFullScreen ? '100%' : 'fit-content',
|
|
17572
18705
|
onClick: handleClick,
|
|
17573
18706
|
transition: "all 0.3s ease"
|
|
17574
|
-
}, shadow ? shadow : defaultShadow, ContainerShapes[shape],
|
|
18707
|
+
}, shadow ? shadow : defaultShadow, ContainerShapes[shape], {
|
|
18708
|
+
media: {
|
|
18709
|
+
mobile: {
|
|
18710
|
+
width: '90%',
|
|
18711
|
+
maxWidth: '100%',
|
|
18712
|
+
margin: '16px'
|
|
18713
|
+
}
|
|
18714
|
+
}
|
|
18715
|
+
}, props, views == null ? void 0 : views.container), children);
|
|
17575
18716
|
};
|
|
17576
18717
|
var ModalHeader = _ref3 => {
|
|
17577
18718
|
var {
|
|
@@ -17596,7 +18737,13 @@
|
|
|
17596
18737
|
paddingHorizontal: 24,
|
|
17597
18738
|
borderBottomWidth: "1px",
|
|
17598
18739
|
borderBottomStyle: "solid",
|
|
17599
|
-
borderBottomColor: "color.gray.200"
|
|
18740
|
+
borderBottomColor: "color.gray.200",
|
|
18741
|
+
media: {
|
|
18742
|
+
mobile: {
|
|
18743
|
+
paddingVertical: 12,
|
|
18744
|
+
paddingHorizontal: 16
|
|
18745
|
+
}
|
|
18746
|
+
}
|
|
17600
18747
|
}, props, views == null ? void 0 : views.header), buttonPosition === 'left' && buttonIcon, children, buttonPosition === 'right' && buttonIcon);
|
|
17601
18748
|
};
|
|
17602
18749
|
var ModalBody = _ref4 => {
|
|
@@ -17611,7 +18758,14 @@
|
|
|
17611
18758
|
fontSize: ModalTypography.body.fontSize,
|
|
17612
18759
|
fontWeight: ModalTypography.body.fontWeight,
|
|
17613
18760
|
lineHeight: ModalTypography.body.lineHeight,
|
|
17614
|
-
color: ModalTypography.body.color
|
|
18761
|
+
color: ModalTypography.body.color,
|
|
18762
|
+
media: {
|
|
18763
|
+
mobile: {
|
|
18764
|
+
paddingVertical: 12,
|
|
18765
|
+
paddingHorizontal: 16,
|
|
18766
|
+
fontSize: '14px'
|
|
18767
|
+
}
|
|
18768
|
+
}
|
|
17615
18769
|
}, props, views == null ? void 0 : views.view), children);
|
|
17616
18770
|
};
|
|
17617
18771
|
var ModalFooter = _ref5 => {
|
|
@@ -17629,7 +18783,14 @@
|
|
|
17629
18783
|
borderTopWidth: "1px",
|
|
17630
18784
|
borderTopStyle: "solid",
|
|
17631
18785
|
borderTopColor: "color.gray.200",
|
|
17632
|
-
gap: 12
|
|
18786
|
+
gap: 12,
|
|
18787
|
+
media: {
|
|
18788
|
+
mobile: {
|
|
18789
|
+
paddingVertical: 12,
|
|
18790
|
+
paddingHorizontal: 16,
|
|
18791
|
+
gap: 8
|
|
18792
|
+
}
|
|
18793
|
+
}
|
|
17633
18794
|
}, props, views == null ? void 0 : views.container), children);
|
|
17634
18795
|
};
|
|
17635
18796
|
|
|
@@ -17694,6 +18855,7 @@
|
|
|
17694
18855
|
}
|
|
17695
18856
|
var [activeItemId, setActiveItemId] = React.useState(defaultActiveItemId);
|
|
17696
18857
|
var [expandedItemIds, setExpandedItemIds] = React.useState(defaultExpandedItemIds);
|
|
18858
|
+
var triggerRefs = React.useRef({});
|
|
17697
18859
|
var toggleExpandedItem = itemId => {
|
|
17698
18860
|
setExpandedItemIds(prevExpandedItemIds => {
|
|
17699
18861
|
// Check if the item is already expanded
|
|
@@ -17715,7 +18877,8 @@
|
|
|
17715
18877
|
setActiveItemId,
|
|
17716
18878
|
expandedItemIds,
|
|
17717
18879
|
toggleExpandedItem,
|
|
17718
|
-
isItemExpanded
|
|
18880
|
+
isItemExpanded,
|
|
18881
|
+
triggerRefs
|
|
17719
18882
|
};
|
|
17720
18883
|
};
|
|
17721
18884
|
|
|
@@ -17737,17 +18900,35 @@
|
|
|
17737
18900
|
sm: {
|
|
17738
18901
|
padding: '8px 12px',
|
|
17739
18902
|
fontSize: '12px',
|
|
17740
|
-
fontWeight: '500'
|
|
18903
|
+
fontWeight: '500',
|
|
18904
|
+
media: {
|
|
18905
|
+
mobile: {
|
|
18906
|
+
padding: '6px 10px',
|
|
18907
|
+
fontSize: '11px'
|
|
18908
|
+
}
|
|
18909
|
+
}
|
|
17741
18910
|
},
|
|
17742
18911
|
md: {
|
|
17743
18912
|
padding: '12px 16px',
|
|
17744
18913
|
fontSize: '14px',
|
|
17745
|
-
fontWeight: '500'
|
|
18914
|
+
fontWeight: '500',
|
|
18915
|
+
media: {
|
|
18916
|
+
mobile: {
|
|
18917
|
+
padding: '10px 14px',
|
|
18918
|
+
fontSize: '13px'
|
|
18919
|
+
}
|
|
18920
|
+
}
|
|
17746
18921
|
},
|
|
17747
18922
|
lg: {
|
|
17748
18923
|
padding: '16px 20px',
|
|
17749
18924
|
fontSize: '16px',
|
|
17750
|
-
fontWeight: '500'
|
|
18925
|
+
fontWeight: '500',
|
|
18926
|
+
media: {
|
|
18927
|
+
mobile: {
|
|
18928
|
+
padding: '12px 16px',
|
|
18929
|
+
fontSize: '14px'
|
|
18930
|
+
}
|
|
18931
|
+
}
|
|
17751
18932
|
}
|
|
17752
18933
|
};
|
|
17753
18934
|
/**
|
|
@@ -17779,7 +18960,13 @@
|
|
|
17779
18960
|
var NavigationMenuOrientations = {
|
|
17780
18961
|
horizontal: {
|
|
17781
18962
|
flexDirection: 'row',
|
|
17782
|
-
gap: '8px'
|
|
18963
|
+
gap: '8px',
|
|
18964
|
+
media: {
|
|
18965
|
+
mobile: {
|
|
18966
|
+
flexDirection: 'column',
|
|
18967
|
+
gap: '4px'
|
|
18968
|
+
}
|
|
18969
|
+
}
|
|
17783
18970
|
},
|
|
17784
18971
|
vertical: {
|
|
17785
18972
|
flexDirection: 'column',
|
|
@@ -17818,7 +19005,10 @@
|
|
|
17818
19005
|
isItemExpanded: () => false,
|
|
17819
19006
|
orientation: 'vertical',
|
|
17820
19007
|
size: 'md',
|
|
17821
|
-
variant: 'default'
|
|
19008
|
+
variant: 'default',
|
|
19009
|
+
triggerRefs: {
|
|
19010
|
+
current: {}
|
|
19011
|
+
}
|
|
17822
19012
|
});
|
|
17823
19013
|
// Provider component for the NavigationMenu context
|
|
17824
19014
|
var NavigationMenuProvider = _ref => {
|
|
@@ -17972,16 +19162,30 @@
|
|
|
17972
19162
|
toggleExpandedItem,
|
|
17973
19163
|
isItemExpanded,
|
|
17974
19164
|
size,
|
|
17975
|
-
variant
|
|
19165
|
+
variant,
|
|
19166
|
+
triggerRefs
|
|
17976
19167
|
} = useNavigationMenuContext();
|
|
19168
|
+
var triggerRef = React.useRef(null);
|
|
17977
19169
|
var isActive = activeItemId === itemId;
|
|
17978
19170
|
var isExpanded = isItemExpanded(itemId);
|
|
19171
|
+
// Store the trigger ref in the context
|
|
19172
|
+
React.useEffect(() => {
|
|
19173
|
+
if (triggerRef.current && itemId) {
|
|
19174
|
+
triggerRefs.current[itemId] = triggerRef.current;
|
|
19175
|
+
}
|
|
19176
|
+
return () => {
|
|
19177
|
+
if (itemId) {
|
|
19178
|
+
delete triggerRefs.current[itemId];
|
|
19179
|
+
}
|
|
19180
|
+
};
|
|
19181
|
+
}, [itemId, triggerRefs]);
|
|
17979
19182
|
var handleClick = e => {
|
|
17980
19183
|
e.preventDefault();
|
|
17981
19184
|
if (disabled) return;
|
|
17982
19185
|
toggleExpandedItem(itemId);
|
|
17983
19186
|
};
|
|
17984
19187
|
return /*#__PURE__*/React__default.createElement(appStudio.View, Object.assign({
|
|
19188
|
+
ref: triggerRef,
|
|
17985
19189
|
onClick: handleClick,
|
|
17986
19190
|
cursor: disabled ? 'not-allowed' : 'pointer',
|
|
17987
19191
|
opacity: disabled ? 0.5 : 1,
|
|
@@ -18015,22 +19219,150 @@
|
|
|
18015
19219
|
} = _ref5;
|
|
18016
19220
|
var {
|
|
18017
19221
|
isItemExpanded,
|
|
18018
|
-
orientation
|
|
19222
|
+
orientation,
|
|
19223
|
+
triggerRefs
|
|
18019
19224
|
} = useNavigationMenuContext();
|
|
19225
|
+
var contentRef = React.useRef(null);
|
|
19226
|
+
var [optimalPosition, setOptimalPosition] = React.useState({
|
|
19227
|
+
x: 0,
|
|
19228
|
+
y: 0,
|
|
19229
|
+
placement: orientation === 'horizontal' ? 'bottom' : 'right'
|
|
19230
|
+
});
|
|
18020
19231
|
var isExpanded = isItemExpanded(itemId);
|
|
19232
|
+
// Calculate optimal position when the menu expands
|
|
19233
|
+
React.useEffect(() => {
|
|
19234
|
+
if (isExpanded && contentRef.current && itemId && triggerRefs.current[itemId] && orientation === 'horizontal') {
|
|
19235
|
+
var contentRect = contentRef.current.getBoundingClientRect();
|
|
19236
|
+
var triggerRect = triggerRefs.current[itemId].getBoundingClientRect();
|
|
19237
|
+
// Get content dimensions
|
|
19238
|
+
var contentWidth = Math.max(contentRect.width || 200, 200);
|
|
19239
|
+
var contentHeight = Math.max(contentRect.height || 150, 150);
|
|
19240
|
+
// Get viewport dimensions
|
|
19241
|
+
var viewportWidth = window.innerWidth;
|
|
19242
|
+
var viewportHeight = window.innerHeight;
|
|
19243
|
+
// Calculate available space on all sides from the trigger
|
|
19244
|
+
var availableSpace = {
|
|
19245
|
+
top: triggerRect.top,
|
|
19246
|
+
right: viewportWidth - triggerRect.right,
|
|
19247
|
+
bottom: viewportHeight - triggerRect.bottom,
|
|
19248
|
+
left: triggerRect.left
|
|
19249
|
+
};
|
|
19250
|
+
// Determine optimal placement based on orientation and available space
|
|
19251
|
+
var placements = orientation === 'horizontal' ? [
|
|
19252
|
+
// For horizontal navigation menu, prefer bottom placement
|
|
19253
|
+
{
|
|
19254
|
+
placement: 'bottom',
|
|
19255
|
+
space: availableSpace.bottom,
|
|
19256
|
+
fits: availableSpace.bottom >= contentHeight + 8,
|
|
19257
|
+
x: triggerRect.left,
|
|
19258
|
+
y: triggerRect.bottom + 8
|
|
19259
|
+
}, {
|
|
19260
|
+
placement: 'top',
|
|
19261
|
+
space: availableSpace.top,
|
|
19262
|
+
fits: availableSpace.top >= contentHeight + 8,
|
|
19263
|
+
x: triggerRect.left,
|
|
19264
|
+
y: triggerRect.top - contentHeight - 8
|
|
19265
|
+
}, {
|
|
19266
|
+
placement: 'right',
|
|
19267
|
+
space: availableSpace.right,
|
|
19268
|
+
fits: availableSpace.right >= contentWidth + 8,
|
|
19269
|
+
x: triggerRect.right + 8,
|
|
19270
|
+
y: triggerRect.top
|
|
19271
|
+
}, {
|
|
19272
|
+
placement: 'left',
|
|
19273
|
+
space: availableSpace.left,
|
|
19274
|
+
fits: availableSpace.left >= contentWidth + 8,
|
|
19275
|
+
x: triggerRect.left - contentWidth - 8,
|
|
19276
|
+
y: triggerRect.top
|
|
19277
|
+
}] : [
|
|
19278
|
+
// For vertical navigation menu, prefer right placement
|
|
19279
|
+
{
|
|
19280
|
+
placement: 'right',
|
|
19281
|
+
space: availableSpace.right,
|
|
19282
|
+
fits: availableSpace.right >= contentWidth + 8,
|
|
19283
|
+
x: triggerRect.right + 8,
|
|
19284
|
+
y: triggerRect.top
|
|
19285
|
+
}, {
|
|
19286
|
+
placement: 'left',
|
|
19287
|
+
space: availableSpace.left,
|
|
19288
|
+
fits: availableSpace.left >= contentWidth + 8,
|
|
19289
|
+
x: triggerRect.left - contentWidth - 8,
|
|
19290
|
+
y: triggerRect.top
|
|
19291
|
+
}, {
|
|
19292
|
+
placement: 'bottom',
|
|
19293
|
+
space: availableSpace.bottom,
|
|
19294
|
+
fits: availableSpace.bottom >= contentHeight + 8,
|
|
19295
|
+
x: triggerRect.left,
|
|
19296
|
+
y: triggerRect.bottom + 8
|
|
19297
|
+
}, {
|
|
19298
|
+
placement: 'top',
|
|
19299
|
+
space: availableSpace.top,
|
|
19300
|
+
fits: availableSpace.top >= contentHeight + 8,
|
|
19301
|
+
x: triggerRect.left,
|
|
19302
|
+
y: triggerRect.top - contentHeight - 8
|
|
19303
|
+
}];
|
|
19304
|
+
// Find the best fitting placement
|
|
19305
|
+
var fittingPlacement = placements.find(p => p.fits);
|
|
19306
|
+
if (fittingPlacement) {
|
|
19307
|
+
setOptimalPosition({
|
|
19308
|
+
x: fittingPlacement.x,
|
|
19309
|
+
y: fittingPlacement.y,
|
|
19310
|
+
placement: fittingPlacement.placement
|
|
19311
|
+
});
|
|
19312
|
+
return;
|
|
19313
|
+
}
|
|
19314
|
+
// If nothing fits, choose the placement with the most space
|
|
19315
|
+
var bestPlacement = placements.reduce((best, current) => current.space > best.space ? current : best);
|
|
19316
|
+
// Ensure the content stays within viewport bounds
|
|
19317
|
+
var finalX = bestPlacement.x;
|
|
19318
|
+
var finalY = bestPlacement.y;
|
|
19319
|
+
if (finalX + contentWidth > viewportWidth) {
|
|
19320
|
+
finalX = viewportWidth - contentWidth - 8;
|
|
19321
|
+
}
|
|
19322
|
+
if (finalX < 8) {
|
|
19323
|
+
finalX = 8;
|
|
19324
|
+
}
|
|
19325
|
+
if (finalY + contentHeight > viewportHeight) {
|
|
19326
|
+
finalY = viewportHeight - contentHeight - 8;
|
|
19327
|
+
}
|
|
19328
|
+
if (finalY < 8) {
|
|
19329
|
+
finalY = 8;
|
|
19330
|
+
}
|
|
19331
|
+
setOptimalPosition({
|
|
19332
|
+
x: finalX,
|
|
19333
|
+
y: finalY,
|
|
19334
|
+
placement: bestPlacement.placement
|
|
19335
|
+
});
|
|
19336
|
+
}
|
|
19337
|
+
}, [isExpanded, orientation, itemId, triggerRefs]);
|
|
18021
19338
|
if (!isExpanded) {
|
|
18022
19339
|
return null;
|
|
18023
19340
|
}
|
|
19341
|
+
// For vertical orientation, keep the original relative positioning
|
|
19342
|
+
if (orientation === 'vertical') {
|
|
19343
|
+
return /*#__PURE__*/React__default.createElement(appStudio.View, Object.assign({
|
|
19344
|
+
paddingLeft: 16,
|
|
19345
|
+
width: "100%",
|
|
19346
|
+
position: "relative",
|
|
19347
|
+
backgroundColor: "transparent"
|
|
19348
|
+
}, views == null ? void 0 : views.container), children);
|
|
19349
|
+
}
|
|
19350
|
+
// For horizontal orientation, use fixed positioning with intelligent placement
|
|
19351
|
+
var positionStyles = {
|
|
19352
|
+
position: 'fixed',
|
|
19353
|
+
left: optimalPosition.x,
|
|
19354
|
+
top: optimalPosition.y,
|
|
19355
|
+
zIndex: 1000
|
|
19356
|
+
};
|
|
18024
19357
|
return /*#__PURE__*/React__default.createElement(appStudio.View, Object.assign({
|
|
18025
|
-
|
|
18026
|
-
|
|
19358
|
+
ref: contentRef,
|
|
19359
|
+
role: "menu",
|
|
19360
|
+
minWidth: "200px",
|
|
19361
|
+
backgroundColor: "color.white",
|
|
19362
|
+
borderRadius: 4,
|
|
19363
|
+
boxShadow: "0px 2px 8px rgba(0, 0, 0, 0.15)",
|
|
18027
19364
|
overflow: "hidden",
|
|
18028
|
-
|
|
18029
|
-
position: orientation === 'horizontal' ? 'absolute' : 'relative',
|
|
18030
|
-
backgroundColor: orientation === 'horizontal' ? 'white' : 'transparent',
|
|
18031
|
-
boxShadow: orientation === 'horizontal' ? '0 4px 6px rgba(0, 0, 0, 0.1)' : 'none',
|
|
18032
|
-
borderRadius: orientation === 'horizontal' ? '4px' : '0',
|
|
18033
|
-
zIndex: orientation === 'horizontal' ? 10 : 1
|
|
19365
|
+
style: positionStyles
|
|
18034
19366
|
}, views == null ? void 0 : views.container), children);
|
|
18035
19367
|
};
|
|
18036
19368
|
var NavigationMenuLink = _ref6 => {
|
|
@@ -18129,7 +19461,8 @@
|
|
|
18129
19461
|
setActiveItemId,
|
|
18130
19462
|
expandedItemIds,
|
|
18131
19463
|
toggleExpandedItem,
|
|
18132
|
-
isItemExpanded
|
|
19464
|
+
isItemExpanded,
|
|
19465
|
+
triggerRefs
|
|
18133
19466
|
} = useNavigationMenuState(defaultActiveItemId, defaultExpandedItemIds);
|
|
18134
19467
|
return /*#__PURE__*/React__default.createElement(NavigationMenuProvider, {
|
|
18135
19468
|
value: {
|
|
@@ -18141,7 +19474,8 @@
|
|
|
18141
19474
|
orientation,
|
|
18142
19475
|
size,
|
|
18143
19476
|
variant,
|
|
18144
|
-
onItemActivate
|
|
19477
|
+
onItemActivate,
|
|
19478
|
+
triggerRefs
|
|
18145
19479
|
}
|
|
18146
19480
|
}, items ? (/*#__PURE__*/React__default.createElement(NavigationMenuView, Object.assign({
|
|
18147
19481
|
items: items,
|
|
@@ -18197,16 +19531,24 @@
|
|
|
18197
19531
|
*/
|
|
18198
19532
|
/**
|
|
18199
19533
|
* Default table styles following the design system
|
|
19534
|
+
* Matching shadcn/ui patterns with subtle shadows and transitions
|
|
18200
19535
|
*/
|
|
18201
19536
|
var DefaultTableStyles = {
|
|
18202
19537
|
table: {
|
|
18203
19538
|
width: '100%',
|
|
18204
19539
|
borderRadius: '8px',
|
|
18205
19540
|
overflow: 'hidden',
|
|
18206
|
-
boxShadow: '
|
|
19541
|
+
boxShadow: '0px 1px 3px rgba(0, 0, 0, 0.06), 0px 1px 2px rgba(0, 0, 0, 0.04)',
|
|
18207
19542
|
border: '1px solid',
|
|
18208
19543
|
borderColor: 'color.gray.200',
|
|
18209
|
-
transition: '
|
|
19544
|
+
transition: 'box-shadow 0.2s ease',
|
|
19545
|
+
media: {
|
|
19546
|
+
mobile: {
|
|
19547
|
+
overflowX: 'auto',
|
|
19548
|
+
display: 'block',
|
|
19549
|
+
borderRadius: '4px'
|
|
19550
|
+
}
|
|
19551
|
+
}
|
|
18210
19552
|
},
|
|
18211
19553
|
thead: {
|
|
18212
19554
|
backgroundColor: 'color.gray.50',
|
|
@@ -18218,18 +19560,35 @@
|
|
|
18218
19560
|
fontWeight: '600',
|
|
18219
19561
|
fontSize: '14px',
|
|
18220
19562
|
color: 'color.gray.700',
|
|
18221
|
-
textAlign: 'left'
|
|
19563
|
+
textAlign: 'left',
|
|
19564
|
+
media: {
|
|
19565
|
+
mobile: {
|
|
19566
|
+
padding: '8px 12px',
|
|
19567
|
+
fontSize: '12px'
|
|
19568
|
+
}
|
|
19569
|
+
}
|
|
18222
19570
|
},
|
|
18223
19571
|
td: {
|
|
18224
19572
|
padding: '12px 16px',
|
|
18225
19573
|
fontSize: '14px',
|
|
18226
19574
|
borderBottom: '1px solid',
|
|
18227
|
-
borderBottomColor: 'color.gray.100'
|
|
19575
|
+
borderBottomColor: 'color.gray.100',
|
|
19576
|
+
color: 'color.gray.900',
|
|
19577
|
+
media: {
|
|
19578
|
+
mobile: {
|
|
19579
|
+
padding: '8px 12px',
|
|
19580
|
+
fontSize: '12px'
|
|
19581
|
+
}
|
|
19582
|
+
}
|
|
18228
19583
|
},
|
|
18229
19584
|
tr: {
|
|
18230
|
-
transition: 'background-color 0.
|
|
19585
|
+
transition: 'background-color 0.15s ease',
|
|
18231
19586
|
_hover: {
|
|
18232
19587
|
backgroundColor: 'color.gray.50'
|
|
19588
|
+
},
|
|
19589
|
+
_focus: {
|
|
19590
|
+
outline: 'none',
|
|
19591
|
+
backgroundColor: 'color.gray.100'
|
|
18233
19592
|
}
|
|
18234
19593
|
},
|
|
18235
19594
|
tfoot: {
|
|
@@ -18242,7 +19601,12 @@
|
|
|
18242
19601
|
margin: '8px 0',
|
|
18243
19602
|
color: 'color.gray.600',
|
|
18244
19603
|
fontSize: '14px',
|
|
18245
|
-
fontStyle: 'italic'
|
|
19604
|
+
fontStyle: 'italic',
|
|
19605
|
+
media: {
|
|
19606
|
+
mobile: {
|
|
19607
|
+
fontSize: '12px'
|
|
19608
|
+
}
|
|
19609
|
+
}
|
|
18246
19610
|
}
|
|
18247
19611
|
};
|
|
18248
19612
|
|
|
@@ -19037,6 +20401,13 @@
|
|
|
19037
20401
|
};
|
|
19038
20402
|
var resolvedColor = resolveColorValue(highlightColor);
|
|
19039
20403
|
var resolvedSecondary = highlightSecondaryColor ? resolveColorValue(highlightSecondaryColor) : undefined;
|
|
20404
|
+
var baseHighlightProps = HighlightStyles[highlightStyle](resolvedColor, resolvedSecondary);
|
|
20405
|
+
var highlightViewProps = highlightStyle === 'background' ? Object.assign({}, baseHighlightProps, {
|
|
20406
|
+
color: undefined
|
|
20407
|
+
}) : baseHighlightProps;
|
|
20408
|
+
var highlightBackgroundOverrides = highlightStyle === 'background' ? {
|
|
20409
|
+
bgColor: resolvedColor
|
|
20410
|
+
} : {};
|
|
19040
20411
|
var {
|
|
19041
20412
|
finalDisplayedText,
|
|
19042
20413
|
activeHighlightTarget,
|
|
@@ -19105,7 +20476,7 @@
|
|
|
19105
20476
|
as: "span",
|
|
19106
20477
|
display: "inline",
|
|
19107
20478
|
animate: inView ? controlledHighlightAnimate : undefined
|
|
19108
|
-
},
|
|
20479
|
+
}, highlightViewProps, highlightBackgroundOverrides, views == null ? void 0 : views.highlight), highlightTypewriter ? (/*#__PURE__*/React__default.createElement(TypewriterEffect, {
|
|
19109
20480
|
text: part.text,
|
|
19110
20481
|
typingSpeed: Math.max(30, highlightTypewriterDuration / (part.text.length * 10)),
|
|
19111
20482
|
showCursor: true,
|
|
@@ -19129,7 +20500,7 @@
|
|
|
19129
20500
|
as: "span",
|
|
19130
20501
|
display: "inline",
|
|
19131
20502
|
animate: inView ? controlledHighlightAnimate : undefined
|
|
19132
|
-
},
|
|
20503
|
+
}, highlightViewProps, highlightBackgroundOverrides, views == null ? void 0 : views.highlight), highlightTypewriter ? (/*#__PURE__*/React__default.createElement(TypewriterEffect, {
|
|
19133
20504
|
text: text,
|
|
19134
20505
|
typingSpeed: Math.max(30, highlightTypewriterDuration / (text.length * 10)),
|
|
19135
20506
|
showCursor: true,
|
|
@@ -23470,19 +24841,43 @@
|
|
|
23470
24841
|
fontSize: '12px',
|
|
23471
24842
|
padding: '4px 8px',
|
|
23472
24843
|
minWidth: '28px',
|
|
23473
|
-
height: '28px'
|
|
24844
|
+
height: '28px',
|
|
24845
|
+
media: {
|
|
24846
|
+
mobile: {
|
|
24847
|
+
fontSize: '11px',
|
|
24848
|
+
padding: '3px 6px',
|
|
24849
|
+
minWidth: '24px',
|
|
24850
|
+
height: '24px'
|
|
24851
|
+
}
|
|
24852
|
+
}
|
|
23474
24853
|
},
|
|
23475
24854
|
md: {
|
|
23476
24855
|
fontSize: '14px',
|
|
23477
24856
|
padding: '6px 12px',
|
|
23478
24857
|
minWidth: '36px',
|
|
23479
|
-
height: '36px'
|
|
24858
|
+
height: '36px',
|
|
24859
|
+
media: {
|
|
24860
|
+
mobile: {
|
|
24861
|
+
fontSize: '12px',
|
|
24862
|
+
padding: '4px 8px',
|
|
24863
|
+
minWidth: '28px',
|
|
24864
|
+
height: '28px'
|
|
24865
|
+
}
|
|
24866
|
+
}
|
|
23480
24867
|
},
|
|
23481
24868
|
lg: {
|
|
23482
24869
|
fontSize: '16px',
|
|
23483
24870
|
padding: '8px 16px',
|
|
23484
24871
|
minWidth: '44px',
|
|
23485
|
-
height: '44px'
|
|
24872
|
+
height: '44px',
|
|
24873
|
+
media: {
|
|
24874
|
+
mobile: {
|
|
24875
|
+
fontSize: '14px',
|
|
24876
|
+
padding: '6px 12px',
|
|
24877
|
+
minWidth: '36px',
|
|
24878
|
+
height: '36px'
|
|
24879
|
+
}
|
|
24880
|
+
}
|
|
23486
24881
|
}
|
|
23487
24882
|
};
|
|
23488
24883
|
var PaginationVariants = {
|
|
@@ -23814,16 +25209,23 @@
|
|
|
23814
25209
|
};
|
|
23815
25210
|
/**
|
|
23816
25211
|
* Default styles for the Separator component
|
|
25212
|
+
* Matching shadcn/ui patterns with subtle colors
|
|
23817
25213
|
*/
|
|
23818
25214
|
var DefaultSeparatorStyles = {
|
|
23819
25215
|
container: {
|
|
23820
|
-
transition: '
|
|
25216
|
+
transition: 'opacity 0.15s ease'
|
|
25217
|
+
},
|
|
25218
|
+
line: {
|
|
25219
|
+
backgroundColor: 'color.gray.200',
|
|
25220
|
+
transition: 'background-color 0.15s ease'
|
|
23821
25221
|
},
|
|
23822
25222
|
label: {
|
|
23823
25223
|
fontSize: '14px',
|
|
23824
|
-
|
|
25224
|
+
fontWeight: '500',
|
|
25225
|
+
color: 'color.gray.600',
|
|
23825
25226
|
paddingHorizontal: '8px',
|
|
23826
|
-
|
|
25227
|
+
backgroundColor: 'color.white',
|
|
25228
|
+
transition: 'color 0.15s ease'
|
|
23827
25229
|
}
|
|
23828
25230
|
};
|
|
23829
25231
|
|
|
@@ -24128,27 +25530,17 @@
|
|
|
24128
25530
|
if (defaultExpanded === void 0) {
|
|
24129
25531
|
defaultExpanded = true;
|
|
24130
25532
|
}
|
|
25533
|
+
var {
|
|
25534
|
+
on
|
|
25535
|
+
} = appStudio.useResponsive();
|
|
25536
|
+
var isMobile = on('mobile');
|
|
24131
25537
|
var [isExpanded, setIsExpanded] = React.useState(expanded !== undefined ? expanded : defaultExpanded);
|
|
24132
|
-
var [isMobile, setIsMobile] = React.useState(breakpoint ? window.innerWidth < breakpoint : false);
|
|
24133
25538
|
// Handle controlled expanded state
|
|
24134
25539
|
React.useEffect(() => {
|
|
24135
25540
|
if (expanded !== undefined) {
|
|
24136
25541
|
setIsExpanded(expanded);
|
|
24137
25542
|
}
|
|
24138
25543
|
}, [expanded]);
|
|
24139
|
-
// Handle window resize for responsive behavior
|
|
24140
|
-
React.useEffect(() => {
|
|
24141
|
-
if (!breakpoint) return;
|
|
24142
|
-
var handleResize = () => {
|
|
24143
|
-
var newIsMobile = window.innerWidth < breakpoint;
|
|
24144
|
-
setIsMobile(newIsMobile);
|
|
24145
|
-
};
|
|
24146
|
-
window.addEventListener('resize', handleResize);
|
|
24147
|
-
handleResize(); // Initial check
|
|
24148
|
-
return () => {
|
|
24149
|
-
window.removeEventListener('resize', handleResize);
|
|
24150
|
-
};
|
|
24151
|
-
}, [breakpoint]);
|
|
24152
25544
|
var toggleExpanded = () => {
|
|
24153
25545
|
var newExpanded = !isExpanded;
|
|
24154
25546
|
setIsExpanded(newExpanded);
|
|
@@ -24511,7 +25903,7 @@
|
|
|
24511
25903
|
expand,
|
|
24512
25904
|
collapse,
|
|
24513
25905
|
isMobile
|
|
24514
|
-
} = useSidebarState(defaultExpanded, expanded, onExpandedChange
|
|
25906
|
+
} = useSidebarState(defaultExpanded, expanded, onExpandedChange);
|
|
24515
25907
|
return /*#__PURE__*/React__default.createElement(SidebarProvider, {
|
|
24516
25908
|
value: {
|
|
24517
25909
|
isExpanded,
|
|
@@ -25591,13 +26983,15 @@
|
|
|
25591
26983
|
fontWeight: "600" // Semi-bold for better readability
|
|
25592
26984
|
,
|
|
25593
26985
|
color: Theme[variant].content.color,
|
|
25594
|
-
lineHeight: "1.4"
|
|
26986
|
+
lineHeight: "1.4",
|
|
26987
|
+
bgColor: Theme[variant].container.backgroundColor
|
|
25595
26988
|
}, views == null ? void 0 : views.title), title), description && (/*#__PURE__*/React__default.createElement(Text, Object.assign({
|
|
25596
26989
|
size: "sm",
|
|
25597
26990
|
color: Theme[variant].content.color,
|
|
25598
26991
|
fontWeight: "400" // Regular weight
|
|
25599
26992
|
,
|
|
25600
|
-
lineHeight: "1.5"
|
|
26993
|
+
lineHeight: "1.5",
|
|
26994
|
+
bgColor: Theme[variant].container.backgroundColor
|
|
25601
26995
|
}, views == null ? void 0 : views.description), description)), action && actionText && (/*#__PURE__*/React__default.createElement(Text, Object.assign({
|
|
25602
26996
|
size: "sm",
|
|
25603
26997
|
fontWeight: "600" // Semi-bold for better readability
|
|
@@ -25606,6 +27000,7 @@
|
|
|
25606
27000
|
,
|
|
25607
27001
|
cursor: "pointer",
|
|
25608
27002
|
color: Theme[variant].content.color,
|
|
27003
|
+
bgColor: Theme[variant].container.backgroundColor,
|
|
25609
27004
|
onClick: e => {
|
|
25610
27005
|
e.stopPropagation();
|
|
25611
27006
|
action();
|
|
@@ -26410,19 +27805,28 @@
|
|
|
26410
27805
|
var getTooltip = themeMode => {
|
|
26411
27806
|
return {
|
|
26412
27807
|
default: {
|
|
26413
|
-
backgroundColor: 'color.gray.
|
|
26414
|
-
color: 'color.white'
|
|
27808
|
+
backgroundColor: 'color.gray.900',
|
|
27809
|
+
color: 'color.white',
|
|
27810
|
+
borderRadius: '6px',
|
|
27811
|
+
boxShadow: '0px 4px 6px rgba(0, 0, 0, 0.1), 0px 2px 4px rgba(0, 0, 0, 0.06)',
|
|
27812
|
+
transition: 'opacity 0.15s ease'
|
|
26415
27813
|
},
|
|
26416
27814
|
light: {
|
|
26417
27815
|
backgroundColor: 'color.white',
|
|
26418
27816
|
color: 'color.gray.800',
|
|
26419
27817
|
borderWidth: '1px',
|
|
26420
27818
|
borderStyle: 'solid',
|
|
26421
|
-
borderColor: 'color.gray.200'
|
|
27819
|
+
borderColor: 'color.gray.200',
|
|
27820
|
+
borderRadius: '6px',
|
|
27821
|
+
boxShadow: '0px 4px 6px rgba(0, 0, 0, 0.08), 0px 2px 4px rgba(0, 0, 0, 0.04)',
|
|
27822
|
+
transition: 'opacity 0.15s ease'
|
|
26422
27823
|
},
|
|
26423
27824
|
dark: {
|
|
26424
|
-
backgroundColor: 'color.
|
|
26425
|
-
color: 'color.white'
|
|
27825
|
+
backgroundColor: 'color.gray.950',
|
|
27826
|
+
color: 'color.white',
|
|
27827
|
+
borderRadius: '6px',
|
|
27828
|
+
boxShadow: '0px 4px 6px rgba(0, 0, 0, 0.2), 0px 2px 4px rgba(0, 0, 0, 0.12)',
|
|
27829
|
+
transition: 'opacity 0.15s ease'
|
|
26426
27830
|
}
|
|
26427
27831
|
};
|
|
26428
27832
|
// Add dark mode conditional styling here
|