@app-studio/web 0.9.34 → 0.9.36
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/Calendar/Calendar/Calendar.style.d.ts +4 -0
- package/dist/components/OKR/OKR/OKR.props.d.ts +72 -0
- package/dist/components/OKR/OKR/OKR.style.d.ts +19 -0
- package/dist/components/OKR/OKR/OKR.view.d.ts +4 -0
- package/dist/components/OKR/OKR.d.ts +4 -0
- package/dist/components/index.d.ts +4 -3
- package/dist/pages/okr.page.d.ts +3 -0
- package/dist/web.cjs.development.js +595 -760
- 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 +595 -760
- package/dist/web.esm.js.map +1 -1
- package/dist/web.umd.development.js +598 -762
- 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/README.md +2 -1
- package/docs/components/Calendar.mdx +22 -110
- package/docs/components/Flow.mdx +1 -0
- package/docs/components/KanbanBoard.mdx +156 -0
- package/docs/components/OKR.mdx +475 -0
- package/docs/components/Title.mdx +1 -0
- package/docs/components/Tree.mdx +1 -0
- package/docs/components.md +178 -0
- package/package.json +1 -1
- package/dist/components/CalendarWeek/CalendarWeek/CalendarWeek.props.d.ts +0 -51
- package/dist/components/CalendarWeek/CalendarWeek/CalendarWeek.style.d.ts +0 -90
- package/dist/components/CalendarWeek/CalendarWeek/CalendarWeek.utils.d.ts +0 -51
- package/dist/components/CalendarWeek/CalendarWeek/CalendarWeek.view.d.ts +0 -3
- package/dist/components/CalendarWeek/CalendarWeek.d.ts +0 -1
- package/docs/api-reference/README.md +0 -103
- package/docs/api-reference/data-display/flow.md +0 -220
- package/docs/api-reference/data-display/tree.md +0 -210
- package/docs/api-reference/form/chat-input.md +0 -206
- package/docs/api-reference/utility/button.md +0 -145
- package/docs/api-reference/utility/title.md +0 -301
package/dist/web.esm.js
CHANGED
|
@@ -31,9 +31,8 @@ import contrast from 'contrast';
|
|
|
31
31
|
import 'core-js/modules/es.promise.js';
|
|
32
32
|
import 'core-js/modules/es.array.reduce.js';
|
|
33
33
|
import 'core-js/modules/es.number.to-fixed.js';
|
|
34
|
-
import 'core-js/modules/es.string.pad-start.js';
|
|
35
34
|
import 'core-js/modules/es.array.sort.js';
|
|
36
|
-
import
|
|
35
|
+
import 'core-js/modules/es.string.pad-start.js';
|
|
37
36
|
import format from 'date-fns/format';
|
|
38
37
|
import 'core-js/modules/es.regexp.constructor.js';
|
|
39
38
|
import { useFormikContext, getIn } from 'formik';
|
|
@@ -7837,7 +7836,6 @@ var KanbanBoardView = _ref => {
|
|
|
7837
7836
|
borderRadius: 10,
|
|
7838
7837
|
padding: "12px",
|
|
7839
7838
|
boxShadow: "0 1px 2px 0 rgba(16, 24, 40, 0.08)",
|
|
7840
|
-
opacity: draggedCardId === card.id ? 0.6 : 1,
|
|
7841
7839
|
onDragStart: event => onCardDragStart(column.id, card.id, event),
|
|
7842
7840
|
onDragEnd: onCardDragEnd,
|
|
7843
7841
|
onDragOver: event => {
|
|
@@ -8110,8 +8108,8 @@ var monthTitleStyles = {
|
|
|
8110
8108
|
* Month grid styles (7 columns for days)
|
|
8111
8109
|
*/
|
|
8112
8110
|
var monthGridStyles = {
|
|
8113
|
-
display: '
|
|
8114
|
-
|
|
8111
|
+
display: 'flex',
|
|
8112
|
+
flexDirection: 'column',
|
|
8115
8113
|
backgroundColor: 'color.white'
|
|
8116
8114
|
};
|
|
8117
8115
|
/**
|
|
@@ -8141,15 +8139,32 @@ var weekdayLabelStyles = {
|
|
|
8141
8139
|
*/
|
|
8142
8140
|
var dayCellStyles = {
|
|
8143
8141
|
border: '1px solid',
|
|
8144
|
-
borderColor: 'color.gray.
|
|
8145
|
-
minHeight:
|
|
8146
|
-
padding:
|
|
8147
|
-
paddingTop:
|
|
8142
|
+
borderColor: 'color.gray.100',
|
|
8143
|
+
minHeight: 120,
|
|
8144
|
+
padding: 4,
|
|
8145
|
+
paddingTop: 2,
|
|
8148
8146
|
backgroundColor: 'color.white',
|
|
8149
8147
|
position: 'relative',
|
|
8150
8148
|
display: 'flex',
|
|
8151
8149
|
flexDirection: 'column'
|
|
8152
8150
|
};
|
|
8151
|
+
/**
|
|
8152
|
+
* Day date styles (the circular number)
|
|
8153
|
+
*/
|
|
8154
|
+
var dayDateStyles = {
|
|
8155
|
+
width: 36,
|
|
8156
|
+
height: 36,
|
|
8157
|
+
display: 'flex',
|
|
8158
|
+
alignItems: 'center',
|
|
8159
|
+
justifyContent: 'center',
|
|
8160
|
+
borderRadius: '50%',
|
|
8161
|
+
fontSize: 13,
|
|
8162
|
+
fontWeight: 400,
|
|
8163
|
+
color: 'color.gray.900',
|
|
8164
|
+
cursor: 'pointer',
|
|
8165
|
+
transition: 'all 0.2s',
|
|
8166
|
+
border: '2px solid transparent'
|
|
8167
|
+
};
|
|
8153
8168
|
/**
|
|
8154
8169
|
* Day cell from different month
|
|
8155
8170
|
*/
|
|
@@ -8284,6 +8299,9 @@ var ResizeHandle = _ref => {
|
|
|
8284
8299
|
onMouseLeave: () => setIsHovered(false)
|
|
8285
8300
|
}));
|
|
8286
8301
|
};
|
|
8302
|
+
var MONTH_EVENT_ROW_HEIGHT = 22;
|
|
8303
|
+
var MONTH_EVENT_ROW_GAP = 4;
|
|
8304
|
+
var MONTH_EVENT_TOP_OFFSET = 32;
|
|
8287
8305
|
var Calendar = _ref2 => {
|
|
8288
8306
|
var {
|
|
8289
8307
|
initialDate = new Date(),
|
|
@@ -8347,10 +8365,64 @@ var Calendar = _ref2 => {
|
|
|
8347
8365
|
return [currentDate];
|
|
8348
8366
|
}
|
|
8349
8367
|
}, [currentDate, currentView, currentMonth, weekStartsOn]);
|
|
8368
|
+
var monthWeeks = useMemo(() => {
|
|
8369
|
+
var chunks = [];
|
|
8370
|
+
for (var i = 0; i < calendarDates.length; i += 7) {
|
|
8371
|
+
chunks.push(calendarDates.slice(i, i + 7));
|
|
8372
|
+
}
|
|
8373
|
+
return chunks;
|
|
8374
|
+
}, [calendarDates]);
|
|
8350
8375
|
// Layout events
|
|
8351
8376
|
var {
|
|
8352
8377
|
items: positionedEvents
|
|
8353
8378
|
} = useMemo(() => layoutEvents(localEvents, calendarDates), [localEvents, calendarDates]);
|
|
8379
|
+
var monthWeeksWithEvents = useMemo(() => {
|
|
8380
|
+
return monthWeeks.map((dates, weekIndex) => {
|
|
8381
|
+
var weekStartIdx = weekIndex * 7;
|
|
8382
|
+
var weekEndIdx = weekStartIdx + dates.length - 1;
|
|
8383
|
+
var segments = positionedEvents.filter(event => !(event.startDay > weekEndIdx || event.endDay < weekStartIdx)).map(event => {
|
|
8384
|
+
var segmentStart = Math.max(event.startDay, weekStartIdx);
|
|
8385
|
+
var segmentEnd = Math.min(event.endDay, weekEndIdx);
|
|
8386
|
+
return Object.assign({}, event, {
|
|
8387
|
+
weekIndex,
|
|
8388
|
+
segmentStartDay: segmentStart - weekStartIdx,
|
|
8389
|
+
segmentEndDay: segmentEnd - weekStartIdx,
|
|
8390
|
+
segmentDuration: segmentEnd - segmentStart + 1,
|
|
8391
|
+
segmentRow: 0
|
|
8392
|
+
});
|
|
8393
|
+
});
|
|
8394
|
+
segments.sort((a, b) => {
|
|
8395
|
+
if (a.segmentStartDay !== b.segmentStartDay) {
|
|
8396
|
+
return a.segmentStartDay - b.segmentStartDay;
|
|
8397
|
+
}
|
|
8398
|
+
return b.segmentDuration - a.segmentDuration;
|
|
8399
|
+
});
|
|
8400
|
+
var rows = [];
|
|
8401
|
+
segments.forEach(segment => {
|
|
8402
|
+
var placed = false;
|
|
8403
|
+
for (var rowIdx = 0; rowIdx < rows.length; rowIdx++) {
|
|
8404
|
+
var row = rows[rowIdx];
|
|
8405
|
+
var conflict = row.some(existing => !(segment.segmentStartDay > existing.segmentEndDay || segment.segmentEndDay < existing.segmentStartDay));
|
|
8406
|
+
if (!conflict) {
|
|
8407
|
+
segment.segmentRow = rowIdx;
|
|
8408
|
+
row.push(segment);
|
|
8409
|
+
placed = true;
|
|
8410
|
+
break;
|
|
8411
|
+
}
|
|
8412
|
+
}
|
|
8413
|
+
if (!placed) {
|
|
8414
|
+
segment.segmentRow = rows.length;
|
|
8415
|
+
rows.push([segment]);
|
|
8416
|
+
}
|
|
8417
|
+
});
|
|
8418
|
+
return {
|
|
8419
|
+
weekIndex,
|
|
8420
|
+
dates,
|
|
8421
|
+
segments,
|
|
8422
|
+
rowCount: rows.length
|
|
8423
|
+
};
|
|
8424
|
+
});
|
|
8425
|
+
}, [monthWeeks, positionedEvents]);
|
|
8354
8426
|
// Get day names
|
|
8355
8427
|
var dayNames = useMemo(() => getDayNames(weekStartsOn), [weekStartsOn]);
|
|
8356
8428
|
// Handle navigation
|
|
@@ -8410,10 +8482,9 @@ var Calendar = _ref2 => {
|
|
|
8410
8482
|
onEventAdd(start, end);
|
|
8411
8483
|
}
|
|
8412
8484
|
}, [onEventAdd]);
|
|
8413
|
-
// Handle event
|
|
8414
|
-
var
|
|
8415
|
-
e.
|
|
8416
|
-
e.dataTransfer.setData('eventId', event.id);
|
|
8485
|
+
// Handle mouse down on event (start dragging)
|
|
8486
|
+
var handleEventMouseDown = useCallback((e, event) => {
|
|
8487
|
+
e.preventDefault();
|
|
8417
8488
|
dragStateRef.current = {
|
|
8418
8489
|
isDragging: true,
|
|
8419
8490
|
isResizing: false,
|
|
@@ -8426,52 +8497,7 @@ var Calendar = _ref2 => {
|
|
|
8426
8497
|
originalEnd: event.end
|
|
8427
8498
|
};
|
|
8428
8499
|
}, []);
|
|
8429
|
-
// Handle
|
|
8430
|
-
var handleDragOver = useCallback((e, dayIndex) => {
|
|
8431
|
-
e.preventDefault();
|
|
8432
|
-
e.dataTransfer.dropEffect = 'move';
|
|
8433
|
-
setDropTargetDays([dayIndex]);
|
|
8434
|
-
}, []);
|
|
8435
|
-
// Handle drag leave
|
|
8436
|
-
var handleDragLeave = useCallback(() => {
|
|
8437
|
-
setDropTargetDays([]);
|
|
8438
|
-
}, []);
|
|
8439
|
-
// Handle drop on day cell
|
|
8440
|
-
var handleDrop = useCallback((e, dayIndex) => {
|
|
8441
|
-
e.preventDefault();
|
|
8442
|
-
setDropTargetDays([]);
|
|
8443
|
-
var dragState = dragStateRef.current;
|
|
8444
|
-
if (!dragState.event || !dragState.originalStart || !dragState.originalEnd) return;
|
|
8445
|
-
// Calculate date difference
|
|
8446
|
-
var targetDate = calendarDates[dayIndex];
|
|
8447
|
-
if (!targetDate) return;
|
|
8448
|
-
var daysDiff = daysBetweenUTC(targetDate, dragState.originalStart.slice(0, 10));
|
|
8449
|
-
// Update event dates
|
|
8450
|
-
var newStart = addDateDays(dragState.originalStart.slice(0, 10), daysDiff);
|
|
8451
|
-
var newEnd = addDateDays(dragState.originalEnd.slice(0, 10), daysDiff);
|
|
8452
|
-
var updatedEvent = Object.assign({}, dragState.event, {
|
|
8453
|
-
start: newStart,
|
|
8454
|
-
end: newEnd
|
|
8455
|
-
});
|
|
8456
|
-
// Update local events
|
|
8457
|
-
var updatedEvents = localEvents.map(ev => ev.id === dragState.event.id ? updatedEvent : ev);
|
|
8458
|
-
setLocalEvents(updatedEvents);
|
|
8459
|
-
// Call callback
|
|
8460
|
-
onEventDrop == null || onEventDrop(updatedEvent);
|
|
8461
|
-
// Reset drag state
|
|
8462
|
-
dragStateRef.current = {
|
|
8463
|
-
isDragging: false,
|
|
8464
|
-
isResizing: false,
|
|
8465
|
-
resizeDirection: null,
|
|
8466
|
-
event: null,
|
|
8467
|
-
startX: 0,
|
|
8468
|
-
startDay: 0,
|
|
8469
|
-
startDuration: 0,
|
|
8470
|
-
originalStart: null,
|
|
8471
|
-
originalEnd: null
|
|
8472
|
-
};
|
|
8473
|
-
}, [localEvents, calendarDates, onEventDrop]);
|
|
8474
|
-
// Handle resize start (FIXED - using pixel-based approach like CalendarWeek)
|
|
8500
|
+
// Handle resize start
|
|
8475
8501
|
var handleResizeStart = useCallback((e, event, direction) => {
|
|
8476
8502
|
e.preventDefault();
|
|
8477
8503
|
e.stopPropagation();
|
|
@@ -8487,7 +8513,7 @@ var Calendar = _ref2 => {
|
|
|
8487
8513
|
originalEnd: event.end
|
|
8488
8514
|
};
|
|
8489
8515
|
}, []);
|
|
8490
|
-
// Handle mouse move during resize
|
|
8516
|
+
// Handle mouse move during resize or drag
|
|
8491
8517
|
var handleMouseMove = useCallback(e => {
|
|
8492
8518
|
var dragState = dragStateRef.current;
|
|
8493
8519
|
if (!dragState.event || !dragState.isDragging && !dragState.isResizing) return;
|
|
@@ -8609,54 +8635,89 @@ var Calendar = _ref2 => {
|
|
|
8609
8635
|
key: index
|
|
8610
8636
|
}, weekdayLabelStyles, views.weekdayLabel), dayName)))), /*#__PURE__*/React.createElement(View, Object.assign({
|
|
8611
8637
|
ref: gridRef
|
|
8612
|
-
}, monthGridStyles, views.monthGrid),
|
|
8613
|
-
var
|
|
8614
|
-
var
|
|
8615
|
-
|
|
8616
|
-
|
|
8617
|
-
|
|
8618
|
-
|
|
8619
|
-
|
|
8620
|
-
|
|
8621
|
-
|
|
8622
|
-
|
|
8623
|
-
|
|
8624
|
-
|
|
8625
|
-
|
|
8626
|
-
|
|
8627
|
-
|
|
8628
|
-
|
|
8629
|
-
|
|
8630
|
-
|
|
8631
|
-
}
|
|
8632
|
-
|
|
8638
|
+
}, monthGridStyles, views.monthGrid), monthWeeksWithEvents.map(week => {
|
|
8639
|
+
var weekStartIdx = week.weekIndex * 7;
|
|
8640
|
+
var weekEndIdx = weekStartIdx + week.dates.length - 1;
|
|
8641
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
8642
|
+
key: "week-" + week.weekIndex,
|
|
8643
|
+
position: "relative"
|
|
8644
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
8645
|
+
display: "grid",
|
|
8646
|
+
gridTemplateColumns: "repeat(7, 1fr)"
|
|
8647
|
+
}, week.dates.map((dateISO, dayOffset) => {
|
|
8648
|
+
var dateNum = getDateNumber(dateISO);
|
|
8649
|
+
var isToday = dateISO === today;
|
|
8650
|
+
var isSelected = dateISO === selectedDate;
|
|
8651
|
+
var isCurrentMonth = isInMonth(dateISO, currentMonth);
|
|
8652
|
+
var dayIndex = weekStartIdx + dayOffset;
|
|
8653
|
+
var isDropTarget = dropTargetDays.includes(dayIndex);
|
|
8654
|
+
return /*#__PURE__*/React.createElement(View, Object.assign({
|
|
8655
|
+
key: dateISO,
|
|
8656
|
+
"data-date": dateISO
|
|
8657
|
+
}, dayCellStyles, !isCurrentMonth && otherMonthDayCellStyles, isDropTarget && dropTargetStyles, {
|
|
8658
|
+
onClick: () => handleDateClick(dateISO),
|
|
8659
|
+
onDoubleClick: () => handleDateDoubleClick(dateISO)
|
|
8660
|
+
}, views.dayCell), /*#__PURE__*/React.createElement(View, Object.assign({}, dayNumberStyles, isToday && todayDayNumberStyles, isSelected && !isToday && selectedDayNumberStyles, {
|
|
8661
|
+
style: {
|
|
8662
|
+
cursor: 'pointer'
|
|
8663
|
+
}
|
|
8664
|
+
}, views.dayNumber), dateNum));
|
|
8665
|
+
})), week.segments.length > 0 && (/*#__PURE__*/React.createElement(View, {
|
|
8666
|
+
position: "absolute",
|
|
8667
|
+
left: 0,
|
|
8668
|
+
right: 0,
|
|
8669
|
+
top: MONTH_EVENT_TOP_OFFSET,
|
|
8670
|
+
pointerEvents: "none"
|
|
8671
|
+
}, week.segments.map(event => {
|
|
8672
|
+
var _dragStateRef$current, _dragStateRef$current2;
|
|
8633
8673
|
var colorConfig = EVENT_COLORS[event.color || 'blue'];
|
|
8634
|
-
var
|
|
8635
|
-
var
|
|
8636
|
-
|
|
8674
|
+
var dayWidth = 100 / week.dates.length;
|
|
8675
|
+
var left = event.segmentStartDay * dayWidth;
|
|
8676
|
+
var width = event.segmentDuration * dayWidth;
|
|
8677
|
+
var isDragging = dragStateRef.current.isDragging && ((_dragStateRef$current = dragStateRef.current.event) == null ? void 0 : _dragStateRef$current.id) === event.id;
|
|
8678
|
+
var isResizing = dragStateRef.current.isResizing && ((_dragStateRef$current2 = dragStateRef.current.event) == null ? void 0 : _dragStateRef$current2.id) === event.id;
|
|
8679
|
+
var showLeftHandle = event.startDay >= weekStartIdx && event.startDay <= weekEndIdx && event.segmentStartDay === event.startDay - weekStartIdx;
|
|
8680
|
+
var showRightHandle = event.endDay >= weekStartIdx && event.endDay <= weekEndIdx && event.segmentEndDay === event.endDay - weekStartIdx;
|
|
8637
8681
|
return /*#__PURE__*/React.createElement(View, Object.assign({
|
|
8638
|
-
key: event.id,
|
|
8639
|
-
position: "
|
|
8640
|
-
|
|
8682
|
+
key: event.id + "-" + event.weekIndex + "-" + event.segmentStartDay,
|
|
8683
|
+
position: "absolute",
|
|
8684
|
+
height: MONTH_EVENT_ROW_HEIGHT,
|
|
8685
|
+
display: "flex",
|
|
8686
|
+
alignItems: "center",
|
|
8687
|
+
paddingLeft: 8,
|
|
8688
|
+
paddingRight: 8,
|
|
8689
|
+
borderRadius: 4,
|
|
8641
8690
|
backgroundColor: colorConfig.background,
|
|
8691
|
+
borderLeft: "3px solid",
|
|
8642
8692
|
borderLeftColor: colorConfig.border,
|
|
8643
8693
|
color: colorConfig.text,
|
|
8644
|
-
|
|
8645
|
-
|
|
8646
|
-
|
|
8694
|
+
fontSize: 11,
|
|
8695
|
+
fontWeight: 500,
|
|
8696
|
+
overflow: "hidden",
|
|
8697
|
+
cursor: isDragging ? 'grabbing' : 'grab',
|
|
8698
|
+
opacity: isDragging || isResizing ? 0.7 : 1,
|
|
8699
|
+
boxShadow: isDragging || isResizing ? '0 4px 12px rgba(0,0,0,0.3)' : '0 1px 2px rgba(0,0,0,0.1)',
|
|
8700
|
+
transition: isDragging || isResizing ? 'none' : 'box-shadow 0.2s',
|
|
8701
|
+
pointerEvents: "auto",
|
|
8702
|
+
userSelect: "none",
|
|
8703
|
+
left: "calc(" + left + "% + 4px)",
|
|
8704
|
+
width: "calc(" + width + "% - 8px)",
|
|
8705
|
+
top: event.segmentRow * (MONTH_EVENT_ROW_HEIGHT + MONTH_EVENT_ROW_GAP) + "px",
|
|
8706
|
+
onMouseDown: e => handleEventMouseDown(e, event),
|
|
8707
|
+
title: event.title
|
|
8647
8708
|
}, views.event), /*#__PURE__*/React.createElement(View, {
|
|
8648
8709
|
overflow: "hidden",
|
|
8649
8710
|
textOverflow: "ellipsis",
|
|
8650
8711
|
whiteSpace: "nowrap",
|
|
8651
8712
|
width: "100%"
|
|
8652
|
-
}, event.title,
|
|
8713
|
+
}, event.title), showLeftHandle && (/*#__PURE__*/React.createElement(ResizeHandle, {
|
|
8653
8714
|
direction: "left",
|
|
8654
8715
|
onMouseDown: e => handleResizeStart(e, event, 'left')
|
|
8655
|
-
}), /*#__PURE__*/React.createElement(ResizeHandle, {
|
|
8716
|
+
})), showRightHandle && (/*#__PURE__*/React.createElement(ResizeHandle, {
|
|
8656
8717
|
direction: "right",
|
|
8657
8718
|
onMouseDown: e => handleResizeStart(e, event, 'right')
|
|
8658
|
-
}));
|
|
8659
|
-
})));
|
|
8719
|
+
})));
|
|
8720
|
+
}))));
|
|
8660
8721
|
}))));
|
|
8661
8722
|
// Render week view
|
|
8662
8723
|
var renderWeekView = () => (/*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(View, Object.assign({}, weekdayHeaderStyles, views.weekdayHeader), calendarDates.map((dateISO, index) => {
|
|
@@ -8670,7 +8731,7 @@ var Calendar = _ref2 => {
|
|
|
8670
8731
|
alignItems: "center",
|
|
8671
8732
|
padding: 8,
|
|
8672
8733
|
gap: 4
|
|
8673
|
-
}, views.weekdayLabel), /*#__PURE__*/React.createElement(View, Object.assign({}, weekdayLabelStyles), DAY_NAMES[dayOfWeek]), /*#__PURE__*/React.createElement(View, Object.assign({}, dayDateStyles
|
|
8734
|
+
}, views.weekdayLabel), /*#__PURE__*/React.createElement(View, Object.assign({}, weekdayLabelStyles), DAY_NAMES[dayOfWeek]), /*#__PURE__*/React.createElement(View, Object.assign({}, dayDateStyles, isToday && todayDayNumberStyles, {
|
|
8674
8735
|
fontSize: 16,
|
|
8675
8736
|
fontWeight: isToday ? 500 : 400
|
|
8676
8737
|
}), dateNum));
|
|
@@ -8688,14 +8749,14 @@ var Calendar = _ref2 => {
|
|
|
8688
8749
|
}, dayCellStyles, isDropTarget && dropTargetStyles, {
|
|
8689
8750
|
minHeight: 400,
|
|
8690
8751
|
onClick: () => handleDateClick(dateISO),
|
|
8691
|
-
onDoubleClick: () => handleDateDoubleClick(dateISO)
|
|
8692
|
-
onDragOver: e => handleDragOver(e, index),
|
|
8693
|
-
onDragLeave: handleDragLeave,
|
|
8694
|
-
onDrop: e => handleDrop(e, index)
|
|
8752
|
+
onDoubleClick: () => handleDateDoubleClick(dateISO)
|
|
8695
8753
|
}), /*#__PURE__*/React.createElement(View, Object.assign({}, eventsAreaStyles, views.eventsArea), dayEvents.map(event => {
|
|
8754
|
+
var _dragStateRef$current3, _dragStateRef$current4;
|
|
8696
8755
|
var colorConfig = EVENT_COLORS[event.color || 'blue'];
|
|
8697
8756
|
var isFirstDay = event.isFirstDay !== false;
|
|
8698
8757
|
if (!isFirstDay) return null;
|
|
8758
|
+
var isDragging = dragStateRef.current.isDragging && ((_dragStateRef$current3 = dragStateRef.current.event) == null ? void 0 : _dragStateRef$current3.id) === event.id;
|
|
8759
|
+
var isResizing = dragStateRef.current.isResizing && ((_dragStateRef$current4 = dragStateRef.current.event) == null ? void 0 : _dragStateRef$current4.id) === event.id;
|
|
8699
8760
|
return /*#__PURE__*/React.createElement(View, Object.assign({
|
|
8700
8761
|
key: event.id,
|
|
8701
8762
|
position: "relative"
|
|
@@ -8703,8 +8764,12 @@ var Calendar = _ref2 => {
|
|
|
8703
8764
|
backgroundColor: colorConfig.background,
|
|
8704
8765
|
borderLeftColor: colorConfig.border,
|
|
8705
8766
|
color: colorConfig.text,
|
|
8706
|
-
|
|
8707
|
-
|
|
8767
|
+
cursor: isDragging ? 'grabbing' : 'grab',
|
|
8768
|
+
opacity: isDragging || isResizing ? 0.7 : 1,
|
|
8769
|
+
boxShadow: isDragging || isResizing ? '0 4px 12px rgba(0,0,0,0.3)' : '0 1px 2px rgba(0,0,0,0.1)',
|
|
8770
|
+
transition: isDragging || isResizing ? 'none' : 'box-shadow 0.2s',
|
|
8771
|
+
userSelect: "none",
|
|
8772
|
+
onMouseDown: e => handleEventMouseDown(e, event),
|
|
8708
8773
|
title: event.title
|
|
8709
8774
|
}, views.event), /*#__PURE__*/React.createElement(View, {
|
|
8710
8775
|
overflow: "hidden",
|
|
@@ -8823,509 +8888,6 @@ var Calendar = _ref2 => {
|
|
|
8823
8888
|
}, views.navButton), "\u203A")))), currentView === 'month' && renderMonthView(), currentView === 'week' && renderWeekView(), currentView === 'day' && renderDayView());
|
|
8824
8889
|
};
|
|
8825
8890
|
|
|
8826
|
-
/**
|
|
8827
|
-
* Convert an ISO date string to a UTC Date object
|
|
8828
|
-
*/
|
|
8829
|
-
var dateUTC$1 = iso => {
|
|
8830
|
-
return new Date(iso + (iso.includes('T') ? '' : 'T00:00:00Z'));
|
|
8831
|
-
};
|
|
8832
|
-
/**
|
|
8833
|
-
* Calculate the number of days between two ISO date strings
|
|
8834
|
-
*/
|
|
8835
|
-
var daysBetweenUTC$1 = (a, b) => {
|
|
8836
|
-
return Math.floor((dateUTC$1(a).getTime() - dateUTC$1(b).getTime()) / 86400000);
|
|
8837
|
-
};
|
|
8838
|
-
/**
|
|
8839
|
-
* Add a number of days to an ISO date string
|
|
8840
|
-
*/
|
|
8841
|
-
var addDateDays$1 = (dateISO, days) => {
|
|
8842
|
-
var d = new Date(dateISO + 'T00:00:00Z');
|
|
8843
|
-
d.setUTCDate(d.getUTCDate() + days);
|
|
8844
|
-
return d.toISOString().slice(0, 10);
|
|
8845
|
-
};
|
|
8846
|
-
/**
|
|
8847
|
-
* Get the day of the week (0-6) from an ISO date string
|
|
8848
|
-
*/
|
|
8849
|
-
var getDayOfWeek$1 = dateISO => {
|
|
8850
|
-
return dateUTC$1(dateISO).getUTCDay();
|
|
8851
|
-
};
|
|
8852
|
-
/**
|
|
8853
|
-
* Get the date number (1-31) from an ISO date string
|
|
8854
|
-
*/
|
|
8855
|
-
var getDateNumber$1 = dateISO => {
|
|
8856
|
-
return dateUTC$1(dateISO).getUTCDate();
|
|
8857
|
-
};
|
|
8858
|
-
/**
|
|
8859
|
-
* Layout events with proper positioning to avoid overlaps
|
|
8860
|
-
* Returns positioned events and the total number of rows needed
|
|
8861
|
-
*/
|
|
8862
|
-
var layoutEvents$1 = (events, weekStart) => {
|
|
8863
|
-
// Convert events to positioned items with day indices
|
|
8864
|
-
var items = events.map(ev => {
|
|
8865
|
-
var startIdx = daysBetweenUTC$1(ev.start, weekStart);
|
|
8866
|
-
var endIdx = daysBetweenUTC$1(ev.end, weekStart);
|
|
8867
|
-
// Clamp to week boundaries
|
|
8868
|
-
var clampedStart = Math.max(0, Math.min(6, startIdx));
|
|
8869
|
-
var clampedEnd = Math.max(0, Math.min(6, endIdx));
|
|
8870
|
-
// Skip if completely outside week
|
|
8871
|
-
if (endIdx < 0 || startIdx > 6) return null;
|
|
8872
|
-
var duration = clampedEnd - clampedStart + 1;
|
|
8873
|
-
return Object.assign({}, ev, {
|
|
8874
|
-
startDay: clampedStart,
|
|
8875
|
-
endDay: clampedEnd,
|
|
8876
|
-
duration: duration,
|
|
8877
|
-
row: 0
|
|
8878
|
-
});
|
|
8879
|
-
}).filter(item => item !== null);
|
|
8880
|
-
// Sort by start day, then by duration (longer first)
|
|
8881
|
-
items.sort((a, b) => {
|
|
8882
|
-
if (a.startDay !== b.startDay) return a.startDay - b.startDay;
|
|
8883
|
-
return b.duration - a.duration;
|
|
8884
|
-
});
|
|
8885
|
-
// Assign rows using greedy algorithm to prevent overlaps
|
|
8886
|
-
var rows = [];
|
|
8887
|
-
items.forEach(item => {
|
|
8888
|
-
var placed = false;
|
|
8889
|
-
for (var i = 0; i < rows.length; i++) {
|
|
8890
|
-
var row = rows[i];
|
|
8891
|
-
var hasConflict = row.some(existing => !(item.startDay > existing.endDay || item.endDay < existing.startDay));
|
|
8892
|
-
if (!hasConflict) {
|
|
8893
|
-
row.push(item);
|
|
8894
|
-
item.row = i;
|
|
8895
|
-
placed = true;
|
|
8896
|
-
break;
|
|
8897
|
-
}
|
|
8898
|
-
}
|
|
8899
|
-
if (!placed) {
|
|
8900
|
-
item.row = rows.length;
|
|
8901
|
-
rows.push([item]);
|
|
8902
|
-
}
|
|
8903
|
-
});
|
|
8904
|
-
return {
|
|
8905
|
-
items,
|
|
8906
|
-
rowCount: rows.length
|
|
8907
|
-
};
|
|
8908
|
-
};
|
|
8909
|
-
/**
|
|
8910
|
-
* Day names array (Sunday to Saturday)
|
|
8911
|
-
*/
|
|
8912
|
-
var DAY_NAMES$1 = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'];
|
|
8913
|
-
/**
|
|
8914
|
-
* Get the date ISO string for a specific day in the week
|
|
8915
|
-
*/
|
|
8916
|
-
var getDateForDay = (weekStart, dayIndex) => {
|
|
8917
|
-
return addDateDays$1(weekStart, dayIndex);
|
|
8918
|
-
};
|
|
8919
|
-
|
|
8920
|
-
/**
|
|
8921
|
-
* Event color configurations
|
|
8922
|
-
*/
|
|
8923
|
-
var EVENT_COLORS$1 = {
|
|
8924
|
-
blue: {
|
|
8925
|
-
background: 'color.blue.50',
|
|
8926
|
-
border: 'color.blue.500',
|
|
8927
|
-
text: 'color.blue.700'
|
|
8928
|
-
},
|
|
8929
|
-
red: {
|
|
8930
|
-
background: 'color.red.50',
|
|
8931
|
-
border: 'color.red.500',
|
|
8932
|
-
text: 'color.red.700'
|
|
8933
|
-
},
|
|
8934
|
-
green: {
|
|
8935
|
-
background: 'color.green.50',
|
|
8936
|
-
border: 'color.green.500',
|
|
8937
|
-
text: 'color.green.700'
|
|
8938
|
-
},
|
|
8939
|
-
purple: {
|
|
8940
|
-
background: 'color.purple.50',
|
|
8941
|
-
border: 'color.purple.500',
|
|
8942
|
-
text: 'color.purple.700'
|
|
8943
|
-
},
|
|
8944
|
-
orange: {
|
|
8945
|
-
background: 'color.orange.50',
|
|
8946
|
-
border: 'color.orange.500',
|
|
8947
|
-
text: 'color.orange.700'
|
|
8948
|
-
}
|
|
8949
|
-
};
|
|
8950
|
-
/**
|
|
8951
|
-
* Base styles for the calendar container
|
|
8952
|
-
*/
|
|
8953
|
-
var containerStyles$1 = {
|
|
8954
|
-
width: '100%',
|
|
8955
|
-
maxWidth: 1200,
|
|
8956
|
-
border: '1px solid',
|
|
8957
|
-
borderColor: 'color.gray.200',
|
|
8958
|
-
borderRadius: 8,
|
|
8959
|
-
overflow: 'hidden',
|
|
8960
|
-
backgroundColor: 'color.white'
|
|
8961
|
-
};
|
|
8962
|
-
/**
|
|
8963
|
-
* Individual day column styles
|
|
8964
|
-
*/
|
|
8965
|
-
var dayColumnStyles = {
|
|
8966
|
-
borderRight: '1px solid',
|
|
8967
|
-
borderColor: 'color.gray.200',
|
|
8968
|
-
display: 'flex',
|
|
8969
|
-
flexDirection: 'column',
|
|
8970
|
-
minHeight: 160,
|
|
8971
|
-
backgroundColor: 'color.white',
|
|
8972
|
-
position: 'relative'
|
|
8973
|
-
};
|
|
8974
|
-
/**
|
|
8975
|
-
* Day header styles
|
|
8976
|
-
*/
|
|
8977
|
-
var dayHeaderStyles = {
|
|
8978
|
-
padding: 8,
|
|
8979
|
-
borderBottom: '1px solid',
|
|
8980
|
-
borderColor: 'color.gray.200',
|
|
8981
|
-
backgroundColor: 'color.gray.50',
|
|
8982
|
-
minHeight: 60,
|
|
8983
|
-
display: 'flex',
|
|
8984
|
-
flexDirection: 'column',
|
|
8985
|
-
alignItems: 'center',
|
|
8986
|
-
justifyContent: 'center',
|
|
8987
|
-
gap: 4
|
|
8988
|
-
};
|
|
8989
|
-
/**
|
|
8990
|
-
* Day name styles (e.g., "Mon", "Tue")
|
|
8991
|
-
*/
|
|
8992
|
-
var dayNameStyles = {
|
|
8993
|
-
fontSize: 11,
|
|
8994
|
-
fontWeight: 500,
|
|
8995
|
-
color: 'color.gray.700',
|
|
8996
|
-
textTransform: 'uppercase',
|
|
8997
|
-
letterSpacing: 0.5
|
|
8998
|
-
};
|
|
8999
|
-
/**
|
|
9000
|
-
* Day date styles (the circular number)
|
|
9001
|
-
*/
|
|
9002
|
-
var dayDateStyles = {
|
|
9003
|
-
width: 36,
|
|
9004
|
-
height: 36,
|
|
9005
|
-
display: 'flex',
|
|
9006
|
-
alignItems: 'center',
|
|
9007
|
-
justifyContent: 'center',
|
|
9008
|
-
borderRadius: '50%',
|
|
9009
|
-
fontSize: 13,
|
|
9010
|
-
fontWeight: 400,
|
|
9011
|
-
color: 'color.gray.900',
|
|
9012
|
-
cursor: 'pointer',
|
|
9013
|
-
transition: 'all 0.2s',
|
|
9014
|
-
border: '2px solid transparent'
|
|
9015
|
-
};
|
|
9016
|
-
/**
|
|
9017
|
-
* Today date styles
|
|
9018
|
-
*/
|
|
9019
|
-
var todayDateStyles = {
|
|
9020
|
-
backgroundColor: 'color.blue.500',
|
|
9021
|
-
color: 'color.white',
|
|
9022
|
-
fontWeight: 500
|
|
9023
|
-
};
|
|
9024
|
-
/**
|
|
9025
|
-
* Selected date styles
|
|
9026
|
-
*/
|
|
9027
|
-
var selectedDateStyles = {
|
|
9028
|
-
borderColor: 'color.blue.500'
|
|
9029
|
-
};
|
|
9030
|
-
/**
|
|
9031
|
-
* Events area styles
|
|
9032
|
-
*/
|
|
9033
|
-
var eventsAreaStyles$1 = {
|
|
9034
|
-
padding: 8,
|
|
9035
|
-
paddingLeft: 6,
|
|
9036
|
-
paddingRight: 6,
|
|
9037
|
-
flex: 1,
|
|
9038
|
-
position: 'relative'
|
|
9039
|
-
};
|
|
9040
|
-
/**
|
|
9041
|
-
* Drop target indicator styles
|
|
9042
|
-
*/
|
|
9043
|
-
var dropTargetStyles$1 = {
|
|
9044
|
-
backgroundColor: 'rgba(26, 115, 232, 0.05)'
|
|
9045
|
-
};
|
|
9046
|
-
/**
|
|
9047
|
-
* Calculate event position styles
|
|
9048
|
-
*/
|
|
9049
|
-
var getEventPositionStyles = (startDay, duration, row) => {
|
|
9050
|
-
var dayWidth = 100 / 7;
|
|
9051
|
-
var left = startDay * dayWidth;
|
|
9052
|
-
var width = duration * dayWidth;
|
|
9053
|
-
return {
|
|
9054
|
-
left: "calc(" + left + "% + 6px)",
|
|
9055
|
-
width: "calc(" + width + "% - 12px)",
|
|
9056
|
-
top: 8 + row * 26 + "px"
|
|
9057
|
-
};
|
|
9058
|
-
};
|
|
9059
|
-
|
|
9060
|
-
var ResizeHandle$1 = _ref => {
|
|
9061
|
-
var {
|
|
9062
|
-
direction,
|
|
9063
|
-
onMouseDown
|
|
9064
|
-
} = _ref;
|
|
9065
|
-
var [isHovered, setIsHovered] = useState(false);
|
|
9066
|
-
return /*#__PURE__*/React.createElement(View, Object.assign({
|
|
9067
|
-
position: "absolute",
|
|
9068
|
-
top: 0,
|
|
9069
|
-
bottom: 0,
|
|
9070
|
-
width: 8,
|
|
9071
|
-
opacity: isHovered ? 1 : 0,
|
|
9072
|
-
transition: "opacity 0.2s",
|
|
9073
|
-
cursor: direction === 'left' ? 'w-resize' : 'e-resize',
|
|
9074
|
-
zIndex: 10,
|
|
9075
|
-
backgroundColor: isHovered ? 'rgba(0,0,0,0.1)' : 'transparent'
|
|
9076
|
-
}, direction === 'left' ? {
|
|
9077
|
-
left: 0
|
|
9078
|
-
} : {
|
|
9079
|
-
right: 0
|
|
9080
|
-
}, {
|
|
9081
|
-
onMouseDown: onMouseDown,
|
|
9082
|
-
onMouseEnter: () => setIsHovered(true),
|
|
9083
|
-
onMouseLeave: () => setIsHovered(false)
|
|
9084
|
-
}));
|
|
9085
|
-
};
|
|
9086
|
-
var CalendarWeek = _ref2 => {
|
|
9087
|
-
var {
|
|
9088
|
-
startDate,
|
|
9089
|
-
events = [],
|
|
9090
|
-
today = new Date().toISOString().slice(0, 10),
|
|
9091
|
-
onEventDrop,
|
|
9092
|
-
onEventResize,
|
|
9093
|
-
onDateClick,
|
|
9094
|
-
views = {},
|
|
9095
|
-
width = '100%',
|
|
9096
|
-
maxWidth = 1200
|
|
9097
|
-
} = _ref2;
|
|
9098
|
-
var {
|
|
9099
|
-
getColor
|
|
9100
|
-
} = useTheme();
|
|
9101
|
-
var weekGridRef = useRef(null);
|
|
9102
|
-
var [selectedDate, setSelectedDate] = useState(null);
|
|
9103
|
-
var [localEvents, setLocalEvents] = useState(events);
|
|
9104
|
-
var [dropTargetDays, setDropTargetDays] = useState([]);
|
|
9105
|
-
var dragStateRef = useRef({
|
|
9106
|
-
isDragging: false,
|
|
9107
|
-
isResizing: false,
|
|
9108
|
-
resizeDirection: null,
|
|
9109
|
-
event: null,
|
|
9110
|
-
startX: 0,
|
|
9111
|
-
startDay: 0,
|
|
9112
|
-
startDuration: 0,
|
|
9113
|
-
originalStart: null,
|
|
9114
|
-
originalEnd: null
|
|
9115
|
-
});
|
|
9116
|
-
// Update local events when props change
|
|
9117
|
-
React.useEffect(() => {
|
|
9118
|
-
setLocalEvents(events);
|
|
9119
|
-
}, [events]);
|
|
9120
|
-
// Layout events
|
|
9121
|
-
var {
|
|
9122
|
-
items: positionedEvents
|
|
9123
|
-
} = useMemo(() => layoutEvents$1(localEvents, startDate), [localEvents, startDate]);
|
|
9124
|
-
// Get day index from mouse X position
|
|
9125
|
-
var getDayFromMouseX = useCallback(clientX => {
|
|
9126
|
-
if (!weekGridRef.current) return 0;
|
|
9127
|
-
var rect = weekGridRef.current.getBoundingClientRect();
|
|
9128
|
-
var relativeX = clientX - rect.left;
|
|
9129
|
-
var dayWidth = rect.width / 7;
|
|
9130
|
-
return Math.max(0, Math.min(6, Math.floor(relativeX / dayWidth)));
|
|
9131
|
-
}, []);
|
|
9132
|
-
// Handle date click
|
|
9133
|
-
var handleDateClick = useCallback(dateISO => {
|
|
9134
|
-
setSelectedDate(dateISO);
|
|
9135
|
-
onDateClick == null || onDateClick(dateISO);
|
|
9136
|
-
}, [onDateClick]);
|
|
9137
|
-
// Handle mouse down on event (start dragging)
|
|
9138
|
-
var handleEventMouseDown = useCallback((e, event) => {
|
|
9139
|
-
e.preventDefault();
|
|
9140
|
-
dragStateRef.current = {
|
|
9141
|
-
isDragging: true,
|
|
9142
|
-
isResizing: false,
|
|
9143
|
-
resizeDirection: null,
|
|
9144
|
-
event,
|
|
9145
|
-
startX: e.clientX,
|
|
9146
|
-
startDay: event.startDay,
|
|
9147
|
-
startDuration: event.duration,
|
|
9148
|
-
originalStart: event.start,
|
|
9149
|
-
originalEnd: event.end
|
|
9150
|
-
};
|
|
9151
|
-
}, []);
|
|
9152
|
-
// Handle mouse down on resize handle
|
|
9153
|
-
var handleResizeMouseDown = useCallback((e, event, direction) => {
|
|
9154
|
-
e.preventDefault();
|
|
9155
|
-
e.stopPropagation();
|
|
9156
|
-
dragStateRef.current = {
|
|
9157
|
-
isDragging: false,
|
|
9158
|
-
isResizing: true,
|
|
9159
|
-
resizeDirection: direction,
|
|
9160
|
-
event,
|
|
9161
|
-
startX: e.clientX,
|
|
9162
|
-
startDay: event.startDay,
|
|
9163
|
-
startDuration: event.duration,
|
|
9164
|
-
originalStart: event.start,
|
|
9165
|
-
originalEnd: event.end
|
|
9166
|
-
};
|
|
9167
|
-
}, []);
|
|
9168
|
-
// Handle mouse move (dragging or resizing)
|
|
9169
|
-
var handleMouseMove = useCallback(e => {
|
|
9170
|
-
var dragState = dragStateRef.current;
|
|
9171
|
-
if (!dragState.event || !dragState.isDragging && !dragState.isResizing) return;
|
|
9172
|
-
if (!weekGridRef.current) return;
|
|
9173
|
-
var rect = weekGridRef.current.getBoundingClientRect();
|
|
9174
|
-
var dayWidth = rect.width / 7;
|
|
9175
|
-
var deltaX = e.clientX - dragState.startX;
|
|
9176
|
-
var daysDelta = Math.round(deltaX / dayWidth);
|
|
9177
|
-
if (dragState.isDragging) {
|
|
9178
|
-
// Calculate new position
|
|
9179
|
-
var newStartDay = Math.max(0, Math.min(6, dragState.startDay + daysDelta));
|
|
9180
|
-
var duration = dragState.event.duration;
|
|
9181
|
-
var newEndDay = Math.min(6, newStartDay + duration - 1);
|
|
9182
|
-
// Update drop target indicators
|
|
9183
|
-
var targetDays = [];
|
|
9184
|
-
for (var i = newStartDay; i <= newEndDay; i++) {
|
|
9185
|
-
targetDays.push(i);
|
|
9186
|
-
}
|
|
9187
|
-
setDropTargetDays(targetDays);
|
|
9188
|
-
// Update event position immediately for smooth dragging
|
|
9189
|
-
var updatedEvents = localEvents.map(ev => ev.id === dragState.event.id ? Object.assign({}, ev, {
|
|
9190
|
-
start: addDateDays$1(dragState.originalStart, newStartDay - dragState.startDay),
|
|
9191
|
-
end: addDateDays$1(dragState.originalEnd, newStartDay - dragState.startDay)
|
|
9192
|
-
}) : ev);
|
|
9193
|
-
setLocalEvents(updatedEvents);
|
|
9194
|
-
} else if (dragState.isResizing) {
|
|
9195
|
-
// Handle resizing
|
|
9196
|
-
if (dragState.resizeDirection === 'right') {
|
|
9197
|
-
var newDuration = Math.max(1, dragState.startDuration + daysDelta);
|
|
9198
|
-
var _newEndDay = Math.min(6, dragState.startDay + newDuration - 1);
|
|
9199
|
-
var actualDuration = _newEndDay - dragState.startDay + 1;
|
|
9200
|
-
var _updatedEvents = localEvents.map(ev => ev.id === dragState.event.id ? Object.assign({}, ev, {
|
|
9201
|
-
end: addDateDays$1(dragState.originalStart, actualDuration - 1)
|
|
9202
|
-
}) : ev);
|
|
9203
|
-
setLocalEvents(_updatedEvents);
|
|
9204
|
-
} else if (dragState.resizeDirection === 'left') {
|
|
9205
|
-
var _newStartDay = Math.max(0, Math.min(dragState.startDay + dragState.startDuration - 1, dragState.startDay + daysDelta));
|
|
9206
|
-
var _updatedEvents2 = localEvents.map(ev => ev.id === dragState.event.id ? Object.assign({}, ev, {
|
|
9207
|
-
start: addDateDays$1(dragState.originalStart, _newStartDay - dragState.startDay)
|
|
9208
|
-
}) : ev);
|
|
9209
|
-
setLocalEvents(_updatedEvents2);
|
|
9210
|
-
}
|
|
9211
|
-
}
|
|
9212
|
-
}, [localEvents]);
|
|
9213
|
-
// Handle mouse up (finish dragging or resizing)
|
|
9214
|
-
var handleMouseUp = useCallback(e => {
|
|
9215
|
-
var dragState = dragStateRef.current;
|
|
9216
|
-
if (!dragState.event || !dragState.isDragging && !dragState.isResizing) return;
|
|
9217
|
-
setDropTargetDays([]);
|
|
9218
|
-
// Find the updated event
|
|
9219
|
-
var updatedEvent = localEvents.find(ev => ev.id === dragState.event.id);
|
|
9220
|
-
if (!updatedEvent) return;
|
|
9221
|
-
// Call appropriate callback
|
|
9222
|
-
if (dragState.isDragging) {
|
|
9223
|
-
onEventDrop == null || onEventDrop(updatedEvent);
|
|
9224
|
-
} else if (dragState.isResizing) {
|
|
9225
|
-
onEventResize == null || onEventResize(updatedEvent);
|
|
9226
|
-
}
|
|
9227
|
-
// Reset drag state
|
|
9228
|
-
dragStateRef.current = {
|
|
9229
|
-
isDragging: false,
|
|
9230
|
-
isResizing: false,
|
|
9231
|
-
resizeDirection: null,
|
|
9232
|
-
event: null,
|
|
9233
|
-
startX: 0,
|
|
9234
|
-
startDay: 0,
|
|
9235
|
-
startDuration: 0,
|
|
9236
|
-
originalStart: null,
|
|
9237
|
-
originalEnd: null
|
|
9238
|
-
};
|
|
9239
|
-
}, [localEvents, onEventDrop, onEventResize]);
|
|
9240
|
-
// Set up global mouse event listeners
|
|
9241
|
-
React.useEffect(() => {
|
|
9242
|
-
document.addEventListener('mousemove', handleMouseMove);
|
|
9243
|
-
document.addEventListener('mouseup', handleMouseUp);
|
|
9244
|
-
return () => {
|
|
9245
|
-
document.removeEventListener('mousemove', handleMouseMove);
|
|
9246
|
-
document.removeEventListener('mouseup', handleMouseUp);
|
|
9247
|
-
};
|
|
9248
|
-
}, [handleMouseMove, handleMouseUp]);
|
|
9249
|
-
return /*#__PURE__*/React.createElement(View, Object.assign({}, containerStyles$1, {
|
|
9250
|
-
width: width,
|
|
9251
|
-
maxWidth: maxWidth
|
|
9252
|
-
}, views.container), /*#__PURE__*/React.createElement(View, Object.assign({
|
|
9253
|
-
ref: weekGridRef,
|
|
9254
|
-
display: "grid",
|
|
9255
|
-
gridTemplateColumns: "repeat(7, 1fr)",
|
|
9256
|
-
position: "relative",
|
|
9257
|
-
width: "100%"
|
|
9258
|
-
}, views.weekGrid), Array.from({
|
|
9259
|
-
length: 7
|
|
9260
|
-
}).map((_, dayIdx) => {
|
|
9261
|
-
var dateISO = getDateForDay(startDate, dayIdx);
|
|
9262
|
-
var dayOfWeek = getDayOfWeek$1(dateISO);
|
|
9263
|
-
var dateNum = getDateNumber$1(dateISO);
|
|
9264
|
-
var isToday = dateISO === today;
|
|
9265
|
-
var isSelected = dateISO === selectedDate;
|
|
9266
|
-
var isDropTarget = dropTargetDays.includes(dayIdx);
|
|
9267
|
-
return /*#__PURE__*/React.createElement(View, Object.assign({
|
|
9268
|
-
key: dayIdx
|
|
9269
|
-
}, dayColumnStyles, isDropTarget && dropTargetStyles$1, {
|
|
9270
|
-
borderRight: dayIdx === 6 ? 'none' : '1px solid'
|
|
9271
|
-
}, views.dayColumn), /*#__PURE__*/React.createElement(View, Object.assign({}, dayHeaderStyles, views.dayHeader), /*#__PURE__*/React.createElement(View, Object.assign({}, dayNameStyles, views.dayName), DAY_NAMES$1[dayOfWeek]), /*#__PURE__*/React.createElement(View, Object.assign({}, dayDateStyles, isToday && todayDateStyles, isSelected && !isToday && selectedDateStyles, {
|
|
9272
|
-
onClick: () => handleDateClick(dateISO)
|
|
9273
|
-
}, views.dayDate), dateNum)), /*#__PURE__*/React.createElement(View, Object.assign({}, eventsAreaStyles$1, views.eventsArea)));
|
|
9274
|
-
}), /*#__PURE__*/React.createElement(View, {
|
|
9275
|
-
position: "absolute",
|
|
9276
|
-
top: 60,
|
|
9277
|
-
left: 0,
|
|
9278
|
-
right: 0,
|
|
9279
|
-
bottom: 0,
|
|
9280
|
-
pointerEvents: "none"
|
|
9281
|
-
}, positionedEvents.map(event => {
|
|
9282
|
-
var _dragStateRef$current, _dragStateRef$current2;
|
|
9283
|
-
var colorConfig = EVENT_COLORS$1[event.color || 'blue'];
|
|
9284
|
-
var positionStyles = getEventPositionStyles(event.startDay, event.duration, event.row);
|
|
9285
|
-
var isDragging = dragStateRef.current.isDragging && ((_dragStateRef$current = dragStateRef.current.event) == null ? void 0 : _dragStateRef$current.id) === event.id;
|
|
9286
|
-
var isResizing = dragStateRef.current.isResizing && ((_dragStateRef$current2 = dragStateRef.current.event) == null ? void 0 : _dragStateRef$current2.id) === event.id;
|
|
9287
|
-
return /*#__PURE__*/React.createElement(View, Object.assign({
|
|
9288
|
-
key: event.id,
|
|
9289
|
-
position: "absolute",
|
|
9290
|
-
height: 22,
|
|
9291
|
-
display: "flex",
|
|
9292
|
-
alignItems: "center",
|
|
9293
|
-
padding: 8,
|
|
9294
|
-
paddingLeft: 8,
|
|
9295
|
-
paddingRight: 8,
|
|
9296
|
-
borderRadius: 4,
|
|
9297
|
-
backgroundColor: colorConfig.background,
|
|
9298
|
-
borderLeft: "3px solid",
|
|
9299
|
-
borderLeftColor: colorConfig.border,
|
|
9300
|
-
color: colorConfig.text,
|
|
9301
|
-
fontSize: 12,
|
|
9302
|
-
fontWeight: 500,
|
|
9303
|
-
overflow: "hidden",
|
|
9304
|
-
cursor: isDragging ? 'grabbing' : 'grab',
|
|
9305
|
-
opacity: isDragging || isResizing ? 0.7 : 1,
|
|
9306
|
-
boxShadow: isDragging || isResizing ? '0 4px 12px rgba(0,0,0,0.3)' : '0 1px 2px rgba(0,0,0,0.1)',
|
|
9307
|
-
transition: isDragging || isResizing ? 'none' : 'box-shadow 0.2s',
|
|
9308
|
-
pointerEvents: "auto",
|
|
9309
|
-
userSelect: "none",
|
|
9310
|
-
left: positionStyles.left,
|
|
9311
|
-
width: positionStyles.width,
|
|
9312
|
-
top: positionStyles.top,
|
|
9313
|
-
onMouseDown: e => handleEventMouseDown(e, event)
|
|
9314
|
-
}, views.event), /*#__PURE__*/React.createElement(View, {
|
|
9315
|
-
overflow: "hidden",
|
|
9316
|
-
textOverflow: "ellipsis",
|
|
9317
|
-
whiteSpace: "nowrap",
|
|
9318
|
-
width: "100%"
|
|
9319
|
-
}, event.title), /*#__PURE__*/React.createElement(ResizeHandle$1, {
|
|
9320
|
-
direction: "left",
|
|
9321
|
-
onMouseDown: e => handleResizeMouseDown(e, event, 'left')
|
|
9322
|
-
}), /*#__PURE__*/React.createElement(ResizeHandle$1, {
|
|
9323
|
-
direction: "right",
|
|
9324
|
-
onMouseDown: e => handleResizeMouseDown(e, event, 'right')
|
|
9325
|
-
}));
|
|
9326
|
-
}))));
|
|
9327
|
-
};
|
|
9328
|
-
|
|
9329
8891
|
/**
|
|
9330
8892
|
* Custom hook to manage cookie consent state
|
|
9331
8893
|
* @param cookieExpiration Number of days until the cookie expires
|
|
@@ -19966,6 +19528,404 @@ NavigationMenu.Trigger = NavigationMenuTrigger;
|
|
|
19966
19528
|
NavigationMenu.Content = NavigationMenuContent;
|
|
19967
19529
|
NavigationMenu.Link = NavigationMenuLink;
|
|
19968
19530
|
|
|
19531
|
+
var _excluded$X = ["value", "max", "color", "backgroundColor", "height", "radius", "views", "themeMode"];
|
|
19532
|
+
var ProgressBarView = _ref => {
|
|
19533
|
+
var {
|
|
19534
|
+
value = 0,
|
|
19535
|
+
max = 100,
|
|
19536
|
+
color = 'theme.primary',
|
|
19537
|
+
backgroundColor = 'color.gray.200',
|
|
19538
|
+
height = 8,
|
|
19539
|
+
radius = 4,
|
|
19540
|
+
views,
|
|
19541
|
+
themeMode: elementMode
|
|
19542
|
+
} = _ref,
|
|
19543
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$X);
|
|
19544
|
+
var {
|
|
19545
|
+
getColor,
|
|
19546
|
+
themeMode
|
|
19547
|
+
} = useTheme();
|
|
19548
|
+
var currentMode = elementMode ? elementMode : themeMode;
|
|
19549
|
+
var percentage = Math.min(100, Math.max(0, value / max * 100));
|
|
19550
|
+
var trackColor = getColor(backgroundColor, {
|
|
19551
|
+
themeMode: currentMode
|
|
19552
|
+
});
|
|
19553
|
+
var barColor = getColor(color, {
|
|
19554
|
+
themeMode: currentMode
|
|
19555
|
+
});
|
|
19556
|
+
return /*#__PURE__*/React.createElement(View, Object.assign({
|
|
19557
|
+
role: "progressbar",
|
|
19558
|
+
"aria-valuenow": value,
|
|
19559
|
+
"aria-valuemin": 0,
|
|
19560
|
+
"aria-valuemax": max,
|
|
19561
|
+
width: "100%",
|
|
19562
|
+
height: height,
|
|
19563
|
+
backgroundColor: trackColor,
|
|
19564
|
+
borderRadius: radius,
|
|
19565
|
+
overflow: "hidden"
|
|
19566
|
+
}, views == null ? void 0 : views.container, props), /*#__PURE__*/React.createElement(View, Object.assign({
|
|
19567
|
+
width: percentage + "%",
|
|
19568
|
+
height: "100%",
|
|
19569
|
+
backgroundColor: barColor,
|
|
19570
|
+
borderRadius: radius
|
|
19571
|
+
}, views == null ? void 0 : views.bar)));
|
|
19572
|
+
};
|
|
19573
|
+
|
|
19574
|
+
/**
|
|
19575
|
+
* ProgressBar component displays completion status of a task or process.
|
|
19576
|
+
*/
|
|
19577
|
+
var ProgressBarComponent = props => (/*#__PURE__*/React.createElement(ProgressBarView, Object.assign({}, props)));
|
|
19578
|
+
var ProgressBar = ProgressBarComponent;
|
|
19579
|
+
|
|
19580
|
+
var getThemes$2 = themeMode => {
|
|
19581
|
+
return {
|
|
19582
|
+
default: {
|
|
19583
|
+
indicator: {
|
|
19584
|
+
backgroundColor: 'color.gray.400'
|
|
19585
|
+
},
|
|
19586
|
+
label: {
|
|
19587
|
+
color: 'color.gray.700'
|
|
19588
|
+
}
|
|
19589
|
+
},
|
|
19590
|
+
info: {
|
|
19591
|
+
indicator: {
|
|
19592
|
+
backgroundColor: 'color.blue.500'
|
|
19593
|
+
},
|
|
19594
|
+
label: {
|
|
19595
|
+
color: 'color.blue.700'
|
|
19596
|
+
}
|
|
19597
|
+
},
|
|
19598
|
+
success: {
|
|
19599
|
+
indicator: {
|
|
19600
|
+
backgroundColor: 'color.green.500'
|
|
19601
|
+
},
|
|
19602
|
+
label: {
|
|
19603
|
+
color: 'color.green.700'
|
|
19604
|
+
}
|
|
19605
|
+
},
|
|
19606
|
+
warning: {
|
|
19607
|
+
indicator: {
|
|
19608
|
+
backgroundColor: 'color.orange.500'
|
|
19609
|
+
},
|
|
19610
|
+
label: {
|
|
19611
|
+
color: 'color.orange.700'
|
|
19612
|
+
}
|
|
19613
|
+
},
|
|
19614
|
+
error: {
|
|
19615
|
+
indicator: {
|
|
19616
|
+
backgroundColor: 'color.red.500'
|
|
19617
|
+
},
|
|
19618
|
+
label: {
|
|
19619
|
+
color: 'color.red.700'
|
|
19620
|
+
}
|
|
19621
|
+
}
|
|
19622
|
+
};
|
|
19623
|
+
};
|
|
19624
|
+
|
|
19625
|
+
var _excluded$Y = ["label", "status", "views", "themeMode"];
|
|
19626
|
+
var StatusIndicatorView = _ref => {
|
|
19627
|
+
var {
|
|
19628
|
+
label,
|
|
19629
|
+
status = 'default',
|
|
19630
|
+
views,
|
|
19631
|
+
themeMode: elementMode
|
|
19632
|
+
} = _ref,
|
|
19633
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$Y);
|
|
19634
|
+
var {
|
|
19635
|
+
themeMode
|
|
19636
|
+
} = useTheme();
|
|
19637
|
+
var themes = getThemes$2();
|
|
19638
|
+
return /*#__PURE__*/React.createElement(Horizontal, Object.assign({
|
|
19639
|
+
alignItems: "center",
|
|
19640
|
+
gap: 8,
|
|
19641
|
+
role: "status-indicator"
|
|
19642
|
+
}, views == null ? void 0 : views.container, props), /*#__PURE__*/React.createElement(View, Object.assign({
|
|
19643
|
+
role: "status-dot",
|
|
19644
|
+
width: "8px",
|
|
19645
|
+
height: "8px",
|
|
19646
|
+
borderRadius: "50%"
|
|
19647
|
+
}, themes[status].indicator, views == null ? void 0 : views.indicator)), label && (/*#__PURE__*/React.createElement(Text, Object.assign({
|
|
19648
|
+
role: "status-label",
|
|
19649
|
+
fontSize: "14px",
|
|
19650
|
+
lineHeight: "20px"
|
|
19651
|
+
}, themes[status].label, views == null ? void 0 : views.label), label)));
|
|
19652
|
+
};
|
|
19653
|
+
|
|
19654
|
+
var StatusIndicator = props => (/*#__PURE__*/React.createElement(StatusIndicatorView, Object.assign({}, props)));
|
|
19655
|
+
|
|
19656
|
+
var getOKRTheme = mode => {
|
|
19657
|
+
var isDark = mode === 'dark';
|
|
19658
|
+
return {
|
|
19659
|
+
container: {
|
|
19660
|
+
width: '100%',
|
|
19661
|
+
gap: 16
|
|
19662
|
+
},
|
|
19663
|
+
objectiveCard: {
|
|
19664
|
+
backgroundColor: isDark ? 'rgba(15, 23, 42, 0.6)' : 'color.white',
|
|
19665
|
+
borderColor: isDark ? 'rgba(148, 163, 184, 0.24)' : 'color.gray.200',
|
|
19666
|
+
borderWidth: '1px',
|
|
19667
|
+
borderStyle: 'solid',
|
|
19668
|
+
borderRadius: 16,
|
|
19669
|
+
padding: 24,
|
|
19670
|
+
gap: 20
|
|
19671
|
+
},
|
|
19672
|
+
tag: {
|
|
19673
|
+
display: 'inline-flex',
|
|
19674
|
+
alignItems: 'center',
|
|
19675
|
+
padding: '4px 10px',
|
|
19676
|
+
borderRadius: 999,
|
|
19677
|
+
backgroundColor: isDark ? 'rgba(148, 163, 184, 0.16)' : 'color.gray.100'
|
|
19678
|
+
},
|
|
19679
|
+
keyResultItem: {
|
|
19680
|
+
padding: 16,
|
|
19681
|
+
borderRadius: 12,
|
|
19682
|
+
borderWidth: '1px',
|
|
19683
|
+
borderStyle: 'solid',
|
|
19684
|
+
borderColor: isDark ? 'rgba(148, 163, 184, 0.18)' : 'color.gray.200',
|
|
19685
|
+
backgroundColor: isDark ? 'rgba(15, 23, 42, 0.35)' : 'color.gray.50',
|
|
19686
|
+
gap: 12
|
|
19687
|
+
},
|
|
19688
|
+
divider: {
|
|
19689
|
+
height: 1,
|
|
19690
|
+
backgroundColor: isDark ? 'rgba(148, 163, 184, 0.24)' : 'color.gray.200',
|
|
19691
|
+
width: '100%'
|
|
19692
|
+
}
|
|
19693
|
+
};
|
|
19694
|
+
};
|
|
19695
|
+
var STATUS_METADATA = {
|
|
19696
|
+
notStarted: {
|
|
19697
|
+
indicator: 'info',
|
|
19698
|
+
label: 'Not started'
|
|
19699
|
+
},
|
|
19700
|
+
onTrack: {
|
|
19701
|
+
indicator: 'success',
|
|
19702
|
+
label: 'On track'
|
|
19703
|
+
},
|
|
19704
|
+
atRisk: {
|
|
19705
|
+
indicator: 'warning',
|
|
19706
|
+
label: 'At risk'
|
|
19707
|
+
},
|
|
19708
|
+
offTrack: {
|
|
19709
|
+
indicator: 'error',
|
|
19710
|
+
label: 'Off track'
|
|
19711
|
+
},
|
|
19712
|
+
achieved: {
|
|
19713
|
+
indicator: 'success',
|
|
19714
|
+
label: 'Achieved'
|
|
19715
|
+
}
|
|
19716
|
+
};
|
|
19717
|
+
var deriveStatusFromProgress = progress => {
|
|
19718
|
+
if (progress >= 100) {
|
|
19719
|
+
return 'achieved';
|
|
19720
|
+
}
|
|
19721
|
+
if (progress >= 70) {
|
|
19722
|
+
return 'onTrack';
|
|
19723
|
+
}
|
|
19724
|
+
if (progress >= 40) {
|
|
19725
|
+
return 'atRisk';
|
|
19726
|
+
}
|
|
19727
|
+
if (progress > 0) {
|
|
19728
|
+
return 'offTrack';
|
|
19729
|
+
}
|
|
19730
|
+
return 'notStarted';
|
|
19731
|
+
};
|
|
19732
|
+
var clampProgress = value => {
|
|
19733
|
+
if (typeof value !== 'number' || Number.isNaN(value)) {
|
|
19734
|
+
return 0;
|
|
19735
|
+
}
|
|
19736
|
+
return Math.max(0, Math.min(100, Math.round(value)));
|
|
19737
|
+
};
|
|
19738
|
+
|
|
19739
|
+
var formatPercentage = value => value + "%";
|
|
19740
|
+
var formatConfidence = confidence => {
|
|
19741
|
+
if (!confidence) {
|
|
19742
|
+
return undefined;
|
|
19743
|
+
}
|
|
19744
|
+
return confidence.charAt(0).toUpperCase() + confidence.slice(1);
|
|
19745
|
+
};
|
|
19746
|
+
var getObjectiveProgress = objective => {
|
|
19747
|
+
if (typeof objective.progress === 'number') {
|
|
19748
|
+
return clampProgress(objective.progress);
|
|
19749
|
+
}
|
|
19750
|
+
if (!objective.keyResults.length) {
|
|
19751
|
+
return 0;
|
|
19752
|
+
}
|
|
19753
|
+
var total = objective.keyResults.reduce((acc, keyResult) => {
|
|
19754
|
+
var _keyResult$progress;
|
|
19755
|
+
return acc + ((_keyResult$progress = keyResult.progress) != null ? _keyResult$progress : 0);
|
|
19756
|
+
}, 0);
|
|
19757
|
+
return clampProgress(total / objective.keyResults.length);
|
|
19758
|
+
};
|
|
19759
|
+
var renderStatusIndicator = (status, themeMode, views) => {
|
|
19760
|
+
var metadata = STATUS_METADATA[status];
|
|
19761
|
+
return /*#__PURE__*/React.createElement(StatusIndicator, {
|
|
19762
|
+
themeMode: themeMode,
|
|
19763
|
+
status: metadata.indicator,
|
|
19764
|
+
label: metadata.label,
|
|
19765
|
+
views: views
|
|
19766
|
+
});
|
|
19767
|
+
};
|
|
19768
|
+
var OKRView = _ref => {
|
|
19769
|
+
var {
|
|
19770
|
+
objectives,
|
|
19771
|
+
themeMode: elementMode,
|
|
19772
|
+
views,
|
|
19773
|
+
onKeyResultClick,
|
|
19774
|
+
renderObjectiveFooter,
|
|
19775
|
+
renderKeyResultFooter
|
|
19776
|
+
} = _ref;
|
|
19777
|
+
var {
|
|
19778
|
+
themeMode
|
|
19779
|
+
} = useTheme();
|
|
19780
|
+
var currentMode = elementMode || themeMode || 'light';
|
|
19781
|
+
var theme = getOKRTheme(currentMode);
|
|
19782
|
+
var secondaryTextColor = currentMode === 'dark' ? 'color.gray.200' : 'color.gray.600';
|
|
19783
|
+
var subtleTextColor = currentMode === 'dark' ? 'color.gray.300' : 'color.gray.500';
|
|
19784
|
+
var tagTextColor = currentMode === 'dark' ? 'color.gray.100' : 'color.gray.700';
|
|
19785
|
+
return /*#__PURE__*/React.createElement(Vertical, Object.assign({}, theme.container, views == null ? void 0 : views.container), objectives.map(objective => {
|
|
19786
|
+
var _objective$status, _objective$tags, _views$objectiveProgr, _views$objectiveProgr2, _views$objectiveProgr3, _views$objectiveProgr4;
|
|
19787
|
+
var objectiveProgress = getObjectiveProgress(objective);
|
|
19788
|
+
var objectiveStatus = (_objective$status = objective.status) != null ? _objective$status : deriveStatusFromProgress(objectiveProgress);
|
|
19789
|
+
var objectiveFooter = renderObjectiveFooter == null ? void 0 : renderObjectiveFooter(objective);
|
|
19790
|
+
return /*#__PURE__*/React.createElement(Vertical, Object.assign({
|
|
19791
|
+
key: objective.id
|
|
19792
|
+
}, theme.objectiveCard, views == null ? void 0 : views.objectiveCard), /*#__PURE__*/React.createElement(Horizontal, Object.assign({
|
|
19793
|
+
justifyContent: "space-between",
|
|
19794
|
+
alignItems: "flex-start",
|
|
19795
|
+
flexWrap: "wrap",
|
|
19796
|
+
gap: 16
|
|
19797
|
+
}, views == null ? void 0 : views.objectiveHeader), /*#__PURE__*/React.createElement(Vertical, {
|
|
19798
|
+
gap: 10,
|
|
19799
|
+
minWidth: 240
|
|
19800
|
+
}, /*#__PURE__*/React.createElement(Text, Object.assign({
|
|
19801
|
+
size: "lg",
|
|
19802
|
+
weight: "semiBold"
|
|
19803
|
+
}, views == null ? void 0 : views.objectiveTitle), objective.title), objective.description && (/*#__PURE__*/React.createElement(Text, Object.assign({
|
|
19804
|
+
size: "sm",
|
|
19805
|
+
color: secondaryTextColor
|
|
19806
|
+
}, views == null ? void 0 : views.objectiveDescription), objective.description)), (_objective$tags = objective.tags) != null && _objective$tags.length ? (/*#__PURE__*/React.createElement(Horizontal, Object.assign({
|
|
19807
|
+
gap: 8,
|
|
19808
|
+
flexWrap: "wrap"
|
|
19809
|
+
}, views == null ? void 0 : views.objectiveTags), objective.tags.map(tag => (/*#__PURE__*/React.createElement(View, Object.assign({
|
|
19810
|
+
key: tag
|
|
19811
|
+
}, theme.tag, views == null ? void 0 : views.tag), /*#__PURE__*/React.createElement(Text, Object.assign({
|
|
19812
|
+
size: "xs",
|
|
19813
|
+
weight: "medium",
|
|
19814
|
+
color: tagTextColor
|
|
19815
|
+
}, views == null ? void 0 : views.tagText), tag)))))) : null), /*#__PURE__*/React.createElement(Vertical, Object.assign({
|
|
19816
|
+
gap: 8,
|
|
19817
|
+
alignItems: "flex-end",
|
|
19818
|
+
minWidth: 160
|
|
19819
|
+
}, views == null ? void 0 : views.objectiveMeta), objective.owner && (/*#__PURE__*/React.createElement(Text, Object.assign({
|
|
19820
|
+
size: "sm",
|
|
19821
|
+
color: secondaryTextColor
|
|
19822
|
+
}, views == null ? void 0 : views.objectiveOwner), "Owner: ", objective.owner)), objective.timeframe && (/*#__PURE__*/React.createElement(Text, Object.assign({
|
|
19823
|
+
size: "sm",
|
|
19824
|
+
color: subtleTextColor
|
|
19825
|
+
}, views == null ? void 0 : views.objectiveTimeframe), objective.timeframe)), renderStatusIndicator(objectiveStatus, currentMode, views == null ? void 0 : views.objectiveStatus))), /*#__PURE__*/React.createElement(Vertical, Object.assign({
|
|
19826
|
+
gap: 8
|
|
19827
|
+
}, views == null ? void 0 : views.objectiveProgressSection), /*#__PURE__*/React.createElement(Horizontal, {
|
|
19828
|
+
justifyContent: "space-between",
|
|
19829
|
+
alignItems: "center"
|
|
19830
|
+
}, /*#__PURE__*/React.createElement(Text, Object.assign({
|
|
19831
|
+
size: "sm",
|
|
19832
|
+
color: secondaryTextColor
|
|
19833
|
+
}, views == null ? void 0 : views.objectiveProgressLabel), "Progress"), /*#__PURE__*/React.createElement(Text, Object.assign({
|
|
19834
|
+
size: "sm",
|
|
19835
|
+
weight: "semiBold"
|
|
19836
|
+
}, views == null ? void 0 : views.objectiveProgressValue), formatPercentage(objectiveProgress))), /*#__PURE__*/React.createElement(ProgressBar, {
|
|
19837
|
+
value: objectiveProgress,
|
|
19838
|
+
max: 100,
|
|
19839
|
+
views: {
|
|
19840
|
+
container: Object.assign({
|
|
19841
|
+
width: '100%'
|
|
19842
|
+
}, (_views$objectiveProgr = views == null || (_views$objectiveProgr2 = views.objectiveProgressBar) == null ? void 0 : _views$objectiveProgr2.container) != null ? _views$objectiveProgr : {}),
|
|
19843
|
+
bar: Object.assign({}, (_views$objectiveProgr3 = views == null || (_views$objectiveProgr4 = views.objectiveProgressBar) == null ? void 0 : _views$objectiveProgr4.bar) != null ? _views$objectiveProgr3 : {})
|
|
19844
|
+
}
|
|
19845
|
+
})), /*#__PURE__*/React.createElement(Vertical, Object.assign({
|
|
19846
|
+
gap: 16
|
|
19847
|
+
}, views == null ? void 0 : views.keyResultList), objective.keyResults.map((keyResult, index) => {
|
|
19848
|
+
var _keyResult$status, _keyResult$tags, _views$keyResultProgr, _views$keyResultProgr2, _views$keyResultProgr3, _views$keyResultProgr4;
|
|
19849
|
+
var progress = clampProgress(keyResult.progress);
|
|
19850
|
+
var keyResultStatus = (_keyResult$status = keyResult.status) != null ? _keyResult$status : deriveStatusFromProgress(progress);
|
|
19851
|
+
var keyResultFooter = renderKeyResultFooter == null ? void 0 : renderKeyResultFooter(keyResult, objective);
|
|
19852
|
+
var showDivider = index < objective.keyResults.length - 1;
|
|
19853
|
+
return /*#__PURE__*/React.createElement(Vertical, {
|
|
19854
|
+
key: keyResult.id,
|
|
19855
|
+
gap: 12
|
|
19856
|
+
}, /*#__PURE__*/React.createElement(Vertical, Object.assign({
|
|
19857
|
+
role: onKeyResultClick ? 'button' : undefined,
|
|
19858
|
+
cursor: onKeyResultClick ? 'pointer' : undefined,
|
|
19859
|
+
onClick: onKeyResultClick ? () => onKeyResultClick(keyResult, objective) : undefined
|
|
19860
|
+
}, theme.keyResultItem, views == null ? void 0 : views.keyResultItem), /*#__PURE__*/React.createElement(Horizontal, Object.assign({
|
|
19861
|
+
justifyContent: "space-between",
|
|
19862
|
+
alignItems: "flex-start",
|
|
19863
|
+
flexWrap: "wrap",
|
|
19864
|
+
gap: 16
|
|
19865
|
+
}, views == null ? void 0 : views.keyResultHeader), /*#__PURE__*/React.createElement(Vertical, {
|
|
19866
|
+
gap: 8,
|
|
19867
|
+
minWidth: 220
|
|
19868
|
+
}, /*#__PURE__*/React.createElement(Text, Object.assign({
|
|
19869
|
+
size: "md",
|
|
19870
|
+
weight: "medium"
|
|
19871
|
+
}, views == null ? void 0 : views.keyResultTitle), keyResult.title), keyResult.description && (/*#__PURE__*/React.createElement(Text, Object.assign({
|
|
19872
|
+
size: "sm",
|
|
19873
|
+
color: secondaryTextColor
|
|
19874
|
+
}, views == null ? void 0 : views.keyResultDescription), keyResult.description)), (keyResult.metric || keyResult.target || keyResult.current || keyResult.confidence || keyResult.lastUpdated) && (/*#__PURE__*/React.createElement(Horizontal, Object.assign({
|
|
19875
|
+
gap: 12,
|
|
19876
|
+
flexWrap: "wrap"
|
|
19877
|
+
}, views == null ? void 0 : views.keyResultMeta), keyResult.metric && (/*#__PURE__*/React.createElement(Text, {
|
|
19878
|
+
size: "xs",
|
|
19879
|
+
color: secondaryTextColor
|
|
19880
|
+
}, "Metric: ", keyResult.metric)), keyResult.current && (/*#__PURE__*/React.createElement(Text, {
|
|
19881
|
+
size: "xs",
|
|
19882
|
+
color: secondaryTextColor
|
|
19883
|
+
}, "Current: ", keyResult.current)), keyResult.target && (/*#__PURE__*/React.createElement(Text, {
|
|
19884
|
+
size: "xs",
|
|
19885
|
+
color: secondaryTextColor
|
|
19886
|
+
}, "Target: ", keyResult.target)), keyResult.confidence && (/*#__PURE__*/React.createElement(Text, {
|
|
19887
|
+
size: "xs",
|
|
19888
|
+
color: secondaryTextColor
|
|
19889
|
+
}, "Confidence:", ' ', formatConfidence(keyResult.confidence))), keyResult.lastUpdated && (/*#__PURE__*/React.createElement(Text, {
|
|
19890
|
+
size: "xs",
|
|
19891
|
+
color: subtleTextColor
|
|
19892
|
+
}, "Updated: ", keyResult.lastUpdated)))), (_keyResult$tags = keyResult.tags) != null && _keyResult$tags.length ? (/*#__PURE__*/React.createElement(Horizontal, Object.assign({
|
|
19893
|
+
gap: 8,
|
|
19894
|
+
flexWrap: "wrap"
|
|
19895
|
+
}, views == null ? void 0 : views.keyResultTags), keyResult.tags.map(tag => (/*#__PURE__*/React.createElement(View, Object.assign({
|
|
19896
|
+
key: tag
|
|
19897
|
+
}, theme.tag, views == null ? void 0 : views.keyResultTag), /*#__PURE__*/React.createElement(Text, Object.assign({
|
|
19898
|
+
size: "xs",
|
|
19899
|
+
weight: "medium",
|
|
19900
|
+
color: tagTextColor
|
|
19901
|
+
}, views == null ? void 0 : views.keyResultTagText), tag)))))) : null), /*#__PURE__*/React.createElement(Vertical, {
|
|
19902
|
+
gap: 8,
|
|
19903
|
+
alignItems: "flex-end"
|
|
19904
|
+
}, keyResult.owner && (/*#__PURE__*/React.createElement(Text, Object.assign({
|
|
19905
|
+
size: "xs",
|
|
19906
|
+
color: secondaryTextColor
|
|
19907
|
+
}, views == null ? void 0 : views.keyResultOwner), "Owner: ", keyResult.owner)), renderStatusIndicator(keyResultStatus, currentMode, views == null ? void 0 : views.keyResultStatus))), /*#__PURE__*/React.createElement(Horizontal, Object.assign({
|
|
19908
|
+
alignItems: "center",
|
|
19909
|
+
gap: 12
|
|
19910
|
+
}, views == null ? void 0 : views.keyResultProgressSection), /*#__PURE__*/React.createElement(ProgressBar, {
|
|
19911
|
+
value: progress,
|
|
19912
|
+
max: 100,
|
|
19913
|
+
views: {
|
|
19914
|
+
container: Object.assign({
|
|
19915
|
+
width: '100%'
|
|
19916
|
+
}, (_views$keyResultProgr = views == null || (_views$keyResultProgr2 = views.keyResultProgressBar) == null ? void 0 : _views$keyResultProgr2.container) != null ? _views$keyResultProgr : {}),
|
|
19917
|
+
bar: Object.assign({}, (_views$keyResultProgr3 = views == null || (_views$keyResultProgr4 = views.keyResultProgressBar) == null ? void 0 : _views$keyResultProgr4.bar) != null ? _views$keyResultProgr3 : {})
|
|
19918
|
+
}
|
|
19919
|
+
}), /*#__PURE__*/React.createElement(Text, Object.assign({
|
|
19920
|
+
size: "xs",
|
|
19921
|
+
weight: "semiBold"
|
|
19922
|
+
}, views == null ? void 0 : views.keyResultProgressValue), formatPercentage(progress))), keyResultFooter ? (/*#__PURE__*/React.createElement(View, Object.assign({}, views == null ? void 0 : views.footer), keyResultFooter)) : null), showDivider ? /*#__PURE__*/React.createElement(View, Object.assign({}, theme.divider)) : null);
|
|
19923
|
+
})), objectiveFooter ? (/*#__PURE__*/React.createElement(View, Object.assign({}, views == null ? void 0 : views.footer), objectiveFooter)) : null);
|
|
19924
|
+
}));
|
|
19925
|
+
};
|
|
19926
|
+
|
|
19927
|
+
var OKR = props => /*#__PURE__*/React.createElement(OKRView, Object.assign({}, props));
|
|
19928
|
+
|
|
19969
19929
|
var defaultStyles = {};
|
|
19970
19930
|
// Create a context that includes both styles and the onClick function
|
|
19971
19931
|
var TableContext = /*#__PURE__*/createContext({
|
|
@@ -20748,7 +20708,7 @@ var HighlightStyles = {
|
|
|
20748
20708
|
})
|
|
20749
20709
|
};
|
|
20750
20710
|
|
|
20751
|
-
var _excluded$
|
|
20711
|
+
var _excluded$Z = ["text", "typingSpeed", "pauseTime", "onComplete", "showCursor", "cursorColor", "textStyle", "as"];
|
|
20752
20712
|
/**
|
|
20753
20713
|
* A component that creates a typewriter effect for text
|
|
20754
20714
|
*/
|
|
@@ -20762,7 +20722,7 @@ var TypewriterEffect = _ref => {
|
|
|
20762
20722
|
cursorColor = 'currentColor',
|
|
20763
20723
|
textStyle
|
|
20764
20724
|
} = _ref,
|
|
20765
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
20725
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$Z);
|
|
20766
20726
|
// Convert text to array if it's a string
|
|
20767
20727
|
var textArray = Array.isArray(text) ? text : [text];
|
|
20768
20728
|
// State for the currently displayed text
|
|
@@ -20829,7 +20789,7 @@ var TypewriterEffect = _ref => {
|
|
|
20829
20789
|
}))))));
|
|
20830
20790
|
};
|
|
20831
20791
|
|
|
20832
|
-
var _excluded$
|
|
20792
|
+
var _excluded$_ = ["children", "highlightText", "highlightStyle", "highlightColor", "highlightSecondaryColor", "size", "responsive", "centered", "views", "highlightAnimate", "animate", "animationLoop", "highlightAnimationLoop", "highlightTypewriter", "highlightTypewriterDuration"];
|
|
20833
20793
|
function escapeRegExp(string) {
|
|
20834
20794
|
return string.replace(/[.*+?^${}()|[\\]\\/g, '\\$&');
|
|
20835
20795
|
}
|
|
@@ -20851,7 +20811,7 @@ var TitleView = _ref => {
|
|
|
20851
20811
|
highlightTypewriter: propHighlightTypewriter = false,
|
|
20852
20812
|
highlightTypewriterDuration = 3000
|
|
20853
20813
|
} = _ref,
|
|
20854
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
20814
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$_);
|
|
20855
20815
|
var {
|
|
20856
20816
|
ref,
|
|
20857
20817
|
inView
|
|
@@ -21126,7 +21086,7 @@ var getToggleVariants = (color, isLight) => ({
|
|
|
21126
21086
|
}
|
|
21127
21087
|
});
|
|
21128
21088
|
|
|
21129
|
-
var _excluded
|
|
21089
|
+
var _excluded$$ = ["children", "shape", "variant", "isHovered", "setIsHovered", "isDisabled", "isToggle", "setIsToggled", "onToggle", "views", "backgroundColor", "color", "themeMode"];
|
|
21130
21090
|
var ToggleView = _ref => {
|
|
21131
21091
|
var _ref2;
|
|
21132
21092
|
var {
|
|
@@ -21146,7 +21106,7 @@ var ToggleView = _ref => {
|
|
|
21146
21106
|
// 2nd candidate for main color
|
|
21147
21107
|
themeMode: elementMode
|
|
21148
21108
|
} = _ref,
|
|
21149
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded
|
|
21109
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$$);
|
|
21150
21110
|
/* theme helpers */
|
|
21151
21111
|
var {
|
|
21152
21112
|
getColor,
|
|
@@ -21190,7 +21150,7 @@ var ToggleView = _ref => {
|
|
|
21190
21150
|
}, props, views == null ? void 0 : views.container), children);
|
|
21191
21151
|
};
|
|
21192
21152
|
|
|
21193
|
-
var _excluded$
|
|
21153
|
+
var _excluded$10 = ["children", "shape", "variant", "isDisabled", "isToggled", "onToggle"];
|
|
21194
21154
|
// Destructuring properties from ToggleProps to be used within the ToggleComponent.
|
|
21195
21155
|
var ToggleComponent = _ref => {
|
|
21196
21156
|
var {
|
|
@@ -21202,7 +21162,7 @@ var ToggleComponent = _ref => {
|
|
|
21202
21162
|
isToggled = false,
|
|
21203
21163
|
onToggle
|
|
21204
21164
|
} = _ref,
|
|
21205
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
21165
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$10);
|
|
21206
21166
|
// Initializing toggle state and set state functions using the custom hook useToggleState.
|
|
21207
21167
|
var {
|
|
21208
21168
|
isHovered,
|
|
@@ -21537,7 +21497,7 @@ var DropdownMenuItemStates = {
|
|
|
21537
21497
|
}
|
|
21538
21498
|
};
|
|
21539
21499
|
|
|
21540
|
-
var _excluded
|
|
21500
|
+
var _excluded$11 = ["children", "views"],
|
|
21541
21501
|
_excluded2$f = ["items", "side", "align", "views"],
|
|
21542
21502
|
_excluded3$9 = ["item", "views"],
|
|
21543
21503
|
_excluded4$8 = ["views"],
|
|
@@ -21578,7 +21538,7 @@ var DropdownMenuTrigger = _ref2 => {
|
|
|
21578
21538
|
children,
|
|
21579
21539
|
views
|
|
21580
21540
|
} = _ref2,
|
|
21581
|
-
props = _objectWithoutPropertiesLoose(_ref2, _excluded
|
|
21541
|
+
props = _objectWithoutPropertiesLoose(_ref2, _excluded$11);
|
|
21582
21542
|
var {
|
|
21583
21543
|
isOpen,
|
|
21584
21544
|
setIsOpen,
|
|
@@ -21831,7 +21791,7 @@ var DropdownMenuView = _ref6 => {
|
|
|
21831
21791
|
}));
|
|
21832
21792
|
};
|
|
21833
21793
|
|
|
21834
|
-
var _excluded$
|
|
21794
|
+
var _excluded$12 = ["trigger", "items", "size", "variant", "side", "align", "defaultOpen", "views"];
|
|
21835
21795
|
/**
|
|
21836
21796
|
* DropdownMenu component for displaying a menu when clicking on a trigger element.
|
|
21837
21797
|
*/
|
|
@@ -21846,7 +21806,7 @@ var DropdownMenuComponent = _ref => {
|
|
|
21846
21806
|
defaultOpen = false,
|
|
21847
21807
|
views
|
|
21848
21808
|
} = _ref,
|
|
21849
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
21809
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$12);
|
|
21850
21810
|
var {
|
|
21851
21811
|
isOpen,
|
|
21852
21812
|
setIsOpen,
|
|
@@ -22260,7 +22220,7 @@ var DefaultColorPalette$1 = [
|
|
|
22260
22220
|
category: 'neutral'
|
|
22261
22221
|
}];
|
|
22262
22222
|
|
|
22263
|
-
var _excluded$
|
|
22223
|
+
var _excluded$13 = ["id", "name", "label", "placeholder", "helperText", "views", "size", "shape", "variant", "error", "isDisabled", "isReadOnly", "predefinedColors", "showCustomInput", "showRecentColors", "isOpen", "selectedColor", "recentColors", "customColor", "handleToggle", "handleColorSelect", "handleCustomColorChange", "handleCustomColorSubmit", "triggerRef", "dropdownRef"];
|
|
22264
22224
|
var ColorPickerView = _ref => {
|
|
22265
22225
|
var {
|
|
22266
22226
|
// Basic props
|
|
@@ -22295,7 +22255,7 @@ var ColorPickerView = _ref => {
|
|
|
22295
22255
|
dropdownRef
|
|
22296
22256
|
// Other props
|
|
22297
22257
|
} = _ref,
|
|
22298
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
22258
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$13);
|
|
22299
22259
|
var {
|
|
22300
22260
|
getColor
|
|
22301
22261
|
} = useTheme();
|
|
@@ -24625,7 +24585,7 @@ var useEmojiPickerState = props => {
|
|
|
24625
24585
|
};
|
|
24626
24586
|
};
|
|
24627
24587
|
|
|
24628
|
-
var _excluded$
|
|
24588
|
+
var _excluded$14 = ["id", "name", "label", "placeholder", "helperText", "views", "size", "shape", "variant", "error", "isDisabled", "isReadOnly", "showSearch", "showCategories", "showRecentEmojis", "enabledCategories", "isOpen", "selectedEmoji", "recentEmojis", "searchQuery", "activeCategory", "filteredEmojis", "handleToggle", "handleEmojiSelect", "handleSearchChange", "handleCategoryChange", "triggerRef", "dropdownRef"];
|
|
24629
24589
|
var EmojiPickerView = _ref => {
|
|
24630
24590
|
var {
|
|
24631
24591
|
// Basic props
|
|
@@ -24663,7 +24623,7 @@ var EmojiPickerView = _ref => {
|
|
|
24663
24623
|
dropdownRef
|
|
24664
24624
|
// Other props
|
|
24665
24625
|
} = _ref,
|
|
24666
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
24626
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$14);
|
|
24667
24627
|
var {
|
|
24668
24628
|
getColor
|
|
24669
24629
|
} = useTheme();
|
|
@@ -24852,7 +24812,7 @@ var MenubarItemStates = {
|
|
|
24852
24812
|
}
|
|
24853
24813
|
};
|
|
24854
24814
|
|
|
24855
|
-
var _excluded$
|
|
24815
|
+
var _excluded$15 = ["children", "orientation", "size", "variant", "views"];
|
|
24856
24816
|
// Create context for the Menubar
|
|
24857
24817
|
var MenubarContext = /*#__PURE__*/createContext({
|
|
24858
24818
|
activeMenuId: null,
|
|
@@ -24889,7 +24849,7 @@ var MenubarRoot = _ref2 => {
|
|
|
24889
24849
|
variant = 'default',
|
|
24890
24850
|
views
|
|
24891
24851
|
} = _ref2,
|
|
24892
|
-
props = _objectWithoutPropertiesLoose(_ref2, _excluded$
|
|
24852
|
+
props = _objectWithoutPropertiesLoose(_ref2, _excluded$15);
|
|
24893
24853
|
var Container = orientation === 'horizontal' ? Horizontal : Vertical;
|
|
24894
24854
|
return /*#__PURE__*/React.createElement(Container, Object.assign({
|
|
24895
24855
|
role: "menubar",
|
|
@@ -25209,7 +25169,7 @@ var MenubarView = _ref8 => {
|
|
|
25209
25169
|
})))))));
|
|
25210
25170
|
};
|
|
25211
25171
|
|
|
25212
|
-
var _excluded$
|
|
25172
|
+
var _excluded$16 = ["items", "orientation", "size", "variant", "defaultActiveMenuId", "defaultOpenMenuId", "views"];
|
|
25213
25173
|
/**
|
|
25214
25174
|
* Menubar component for creating horizontal or vertical menu bars with dropdown menus.
|
|
25215
25175
|
*/
|
|
@@ -25223,7 +25183,7 @@ var MenubarComponent = _ref => {
|
|
|
25223
25183
|
defaultOpenMenuId = null,
|
|
25224
25184
|
views
|
|
25225
25185
|
} = _ref,
|
|
25226
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
25186
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$16);
|
|
25227
25187
|
var {
|
|
25228
25188
|
activeMenuId,
|
|
25229
25189
|
setActiveMenuId,
|
|
@@ -25405,7 +25365,7 @@ var DisabledButtonStyles = {
|
|
|
25405
25365
|
}
|
|
25406
25366
|
};
|
|
25407
25367
|
|
|
25408
|
-
var _excluded$
|
|
25368
|
+
var _excluded$17 = ["currentPage", "totalPages", "onPageChange", "pageSize", "pageSizeOptions", "onPageSizeChange", "showPageSizeSelector", "showPageInfo", "maxPageButtons", "showFirstLastButtons", "size", "variant", "shape", "visiblePageNumbers", "views"];
|
|
25409
25369
|
var PaginationView = _ref => {
|
|
25410
25370
|
var {
|
|
25411
25371
|
currentPage,
|
|
@@ -25436,7 +25396,7 @@ var PaginationView = _ref => {
|
|
|
25436
25396
|
visiblePageNumbers,
|
|
25437
25397
|
views
|
|
25438
25398
|
} = _ref,
|
|
25439
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
25399
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$17);
|
|
25440
25400
|
var handlePageChange = page => {
|
|
25441
25401
|
if (page < 1 || page > totalPages || page === currentPage) {
|
|
25442
25402
|
return;
|
|
@@ -25555,7 +25515,7 @@ var PaginationView = _ref => {
|
|
|
25555
25515
|
}, option.label))))));
|
|
25556
25516
|
};
|
|
25557
25517
|
|
|
25558
|
-
var _excluded$
|
|
25518
|
+
var _excluded$18 = ["currentPage", "totalPages", "onPageChange", "pageSize", "pageSizeOptions", "onPageSizeChange", "showPageSizeSelector", "showPageInfo", "maxPageButtons", "showFirstLastButtons", "size", "variant", "shape", "views"];
|
|
25559
25519
|
/**
|
|
25560
25520
|
* Pagination component for navigating through pages of content.
|
|
25561
25521
|
*/
|
|
@@ -25576,7 +25536,7 @@ var PaginationComponent = _ref => {
|
|
|
25576
25536
|
shape = 'rounded',
|
|
25577
25537
|
views
|
|
25578
25538
|
} = _ref,
|
|
25579
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
25539
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$18);
|
|
25580
25540
|
var {
|
|
25581
25541
|
visiblePageNumbers
|
|
25582
25542
|
} = usePaginationState(currentPage, totalPages, maxPageButtons);
|
|
@@ -25600,55 +25560,6 @@ var PaginationComponent = _ref => {
|
|
|
25600
25560
|
};
|
|
25601
25561
|
var Pagination = PaginationComponent;
|
|
25602
25562
|
|
|
25603
|
-
var _excluded$17 = ["value", "max", "color", "backgroundColor", "height", "radius", "views", "themeMode"];
|
|
25604
|
-
var ProgressBarView = _ref => {
|
|
25605
|
-
var {
|
|
25606
|
-
value = 0,
|
|
25607
|
-
max = 100,
|
|
25608
|
-
color = 'theme.primary',
|
|
25609
|
-
backgroundColor = 'color.gray.200',
|
|
25610
|
-
height = 8,
|
|
25611
|
-
radius = 4,
|
|
25612
|
-
views,
|
|
25613
|
-
themeMode: elementMode
|
|
25614
|
-
} = _ref,
|
|
25615
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$17);
|
|
25616
|
-
var {
|
|
25617
|
-
getColor,
|
|
25618
|
-
themeMode
|
|
25619
|
-
} = useTheme();
|
|
25620
|
-
var currentMode = elementMode ? elementMode : themeMode;
|
|
25621
|
-
var percentage = Math.min(100, Math.max(0, value / max * 100));
|
|
25622
|
-
var trackColor = getColor(backgroundColor, {
|
|
25623
|
-
themeMode: currentMode
|
|
25624
|
-
});
|
|
25625
|
-
var barColor = getColor(color, {
|
|
25626
|
-
themeMode: currentMode
|
|
25627
|
-
});
|
|
25628
|
-
return /*#__PURE__*/React.createElement(View, Object.assign({
|
|
25629
|
-
role: "progressbar",
|
|
25630
|
-
"aria-valuenow": value,
|
|
25631
|
-
"aria-valuemin": 0,
|
|
25632
|
-
"aria-valuemax": max,
|
|
25633
|
-
width: "100%",
|
|
25634
|
-
height: height,
|
|
25635
|
-
backgroundColor: trackColor,
|
|
25636
|
-
borderRadius: radius,
|
|
25637
|
-
overflow: "hidden"
|
|
25638
|
-
}, views == null ? void 0 : views.container, props), /*#__PURE__*/React.createElement(View, Object.assign({
|
|
25639
|
-
width: percentage + "%",
|
|
25640
|
-
height: "100%",
|
|
25641
|
-
backgroundColor: barColor,
|
|
25642
|
-
borderRadius: radius
|
|
25643
|
-
}, views == null ? void 0 : views.bar)));
|
|
25644
|
-
};
|
|
25645
|
-
|
|
25646
|
-
/**
|
|
25647
|
-
* ProgressBar component displays completion status of a task or process.
|
|
25648
|
-
*/
|
|
25649
|
-
var ProgressBarComponent = props => (/*#__PURE__*/React.createElement(ProgressBarView, Object.assign({}, props)));
|
|
25650
|
-
var ProgressBar = ProgressBarComponent;
|
|
25651
|
-
|
|
25652
25563
|
/**
|
|
25653
25564
|
* Separator Styles
|
|
25654
25565
|
*
|
|
@@ -25702,7 +25613,7 @@ var DefaultSeparatorStyles = {
|
|
|
25702
25613
|
}
|
|
25703
25614
|
};
|
|
25704
25615
|
|
|
25705
|
-
var _excluded$
|
|
25616
|
+
var _excluded$19 = ["orientation", "variant", "thickness", "color", "spacing", "label", "decorative", "views", "themeMode"];
|
|
25706
25617
|
var SeparatorView = _ref => {
|
|
25707
25618
|
var {
|
|
25708
25619
|
orientation = 'horizontal',
|
|
@@ -25714,7 +25625,7 @@ var SeparatorView = _ref => {
|
|
|
25714
25625
|
decorative = false,
|
|
25715
25626
|
views
|
|
25716
25627
|
} = _ref,
|
|
25717
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
25628
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$19);
|
|
25718
25629
|
// Access theme if needed for future enhancements
|
|
25719
25630
|
var {
|
|
25720
25631
|
themeMode
|
|
@@ -25782,7 +25693,7 @@ var SeparatorComponent = props => {
|
|
|
25782
25693
|
var Separator = SeparatorComponent;
|
|
25783
25694
|
var Divider = SeparatorComponent;
|
|
25784
25695
|
|
|
25785
|
-
var _excluded$
|
|
25696
|
+
var _excluded$1a = ["isSupported", "isSharing", "onShare", "label", "children", "icon", "size", "isDisabled", "isLoading", "iconPosition", "disableWhenUnsupported"];
|
|
25786
25697
|
var ICON_SIZE_MAP = {
|
|
25787
25698
|
xs: 12,
|
|
25788
25699
|
sm: 14,
|
|
@@ -25805,7 +25716,7 @@ var ShareButtonView = _ref => {
|
|
|
25805
25716
|
iconPosition,
|
|
25806
25717
|
disableWhenUnsupported = true
|
|
25807
25718
|
} = _ref,
|
|
25808
|
-
rest = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
25719
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded$1a);
|
|
25809
25720
|
var resolvedSize = size != null ? size : 'md';
|
|
25810
25721
|
var resolvedIcon = icon != null ? icon : (/*#__PURE__*/React.createElement(ShareIcon, {
|
|
25811
25722
|
widthHeight: ICON_SIZE_MAP[resolvedSize],
|
|
@@ -25907,14 +25818,14 @@ var useShareButton = props => {
|
|
|
25907
25818
|
};
|
|
25908
25819
|
};
|
|
25909
25820
|
|
|
25910
|
-
var _excluded$
|
|
25821
|
+
var _excluded$1b = ["shareData", "onShareStart", "onShareSuccess", "onShareCancel", "onShareError", "onUnsupported", "onClick"];
|
|
25911
25822
|
var ShareButtonComponent = props => {
|
|
25912
25823
|
var {
|
|
25913
25824
|
isSupported,
|
|
25914
25825
|
isSharing,
|
|
25915
25826
|
handleShare
|
|
25916
25827
|
} = useShareButton(props);
|
|
25917
|
-
var viewProps = _objectWithoutPropertiesLoose(props, _excluded$
|
|
25828
|
+
var viewProps = _objectWithoutPropertiesLoose(props, _excluded$1b);
|
|
25918
25829
|
return /*#__PURE__*/React.createElement(ShareButtonView, Object.assign({}, viewProps, {
|
|
25919
25830
|
isSupported: isSupported,
|
|
25920
25831
|
isSharing: isSharing,
|
|
@@ -25923,82 +25834,6 @@ var ShareButtonComponent = props => {
|
|
|
25923
25834
|
};
|
|
25924
25835
|
var ShareButton = ShareButtonComponent;
|
|
25925
25836
|
|
|
25926
|
-
var getThemes$2 = themeMode => {
|
|
25927
|
-
return {
|
|
25928
|
-
default: {
|
|
25929
|
-
indicator: {
|
|
25930
|
-
backgroundColor: 'color.gray.400'
|
|
25931
|
-
},
|
|
25932
|
-
label: {
|
|
25933
|
-
color: 'color.gray.700'
|
|
25934
|
-
}
|
|
25935
|
-
},
|
|
25936
|
-
info: {
|
|
25937
|
-
indicator: {
|
|
25938
|
-
backgroundColor: 'color.blue.500'
|
|
25939
|
-
},
|
|
25940
|
-
label: {
|
|
25941
|
-
color: 'color.blue.700'
|
|
25942
|
-
}
|
|
25943
|
-
},
|
|
25944
|
-
success: {
|
|
25945
|
-
indicator: {
|
|
25946
|
-
backgroundColor: 'color.green.500'
|
|
25947
|
-
},
|
|
25948
|
-
label: {
|
|
25949
|
-
color: 'color.green.700'
|
|
25950
|
-
}
|
|
25951
|
-
},
|
|
25952
|
-
warning: {
|
|
25953
|
-
indicator: {
|
|
25954
|
-
backgroundColor: 'color.orange.500'
|
|
25955
|
-
},
|
|
25956
|
-
label: {
|
|
25957
|
-
color: 'color.orange.700'
|
|
25958
|
-
}
|
|
25959
|
-
},
|
|
25960
|
-
error: {
|
|
25961
|
-
indicator: {
|
|
25962
|
-
backgroundColor: 'color.red.500'
|
|
25963
|
-
},
|
|
25964
|
-
label: {
|
|
25965
|
-
color: 'color.red.700'
|
|
25966
|
-
}
|
|
25967
|
-
}
|
|
25968
|
-
};
|
|
25969
|
-
};
|
|
25970
|
-
|
|
25971
|
-
var _excluded$1b = ["label", "status", "views", "themeMode"];
|
|
25972
|
-
var StatusIndicatorView = _ref => {
|
|
25973
|
-
var {
|
|
25974
|
-
label,
|
|
25975
|
-
status = 'default',
|
|
25976
|
-
views,
|
|
25977
|
-
themeMode: elementMode
|
|
25978
|
-
} = _ref,
|
|
25979
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$1b);
|
|
25980
|
-
var {
|
|
25981
|
-
themeMode
|
|
25982
|
-
} = useTheme();
|
|
25983
|
-
var themes = getThemes$2();
|
|
25984
|
-
return /*#__PURE__*/React.createElement(Horizontal, Object.assign({
|
|
25985
|
-
alignItems: "center",
|
|
25986
|
-
gap: 8,
|
|
25987
|
-
role: "status-indicator"
|
|
25988
|
-
}, views == null ? void 0 : views.container, props), /*#__PURE__*/React.createElement(View, Object.assign({
|
|
25989
|
-
role: "status-dot",
|
|
25990
|
-
width: "8px",
|
|
25991
|
-
height: "8px",
|
|
25992
|
-
borderRadius: "50%"
|
|
25993
|
-
}, themes[status].indicator, views == null ? void 0 : views.indicator)), label && (/*#__PURE__*/React.createElement(Text, Object.assign({
|
|
25994
|
-
role: "status-label",
|
|
25995
|
-
fontSize: "14px",
|
|
25996
|
-
lineHeight: "20px"
|
|
25997
|
-
}, themes[status].label, views == null ? void 0 : views.label), label)));
|
|
25998
|
-
};
|
|
25999
|
-
|
|
26000
|
-
var StatusIndicator = props => (/*#__PURE__*/React.createElement(StatusIndicatorView, Object.assign({}, props)));
|
|
26001
|
-
|
|
26002
25837
|
var useSidebarState = function useSidebarState(defaultExpanded, expanded, onExpandedChange, breakpoint) {
|
|
26003
25838
|
if (defaultExpanded === void 0) {
|
|
26004
25839
|
defaultExpanded = true;
|
|
@@ -37631,5 +37466,5 @@ var AgentEval = props => {
|
|
|
37631
37466
|
return /*#__PURE__*/React.createElement(AgentEvalView, Object.assign({}, props, evalState));
|
|
37632
37467
|
};
|
|
37633
37468
|
|
|
37634
|
-
export { Accordion, AgentChat, AgentEval, AgentSession, AgentTrace, Alert, ArrowIcon, AspectRatio, AttachmentIcon, AttachmentPreview, AudioIcon, AudioInput, AudioWaveform, Avatar, Background, Badge, BatteryIcon, BluetoothIcon, BoldArrowIcon, BookmarkIcon, Button, Calendar, CalendarIcon,
|
|
37469
|
+
export { Accordion, AgentChat, AgentEval, AgentSession, AgentTrace, Alert, ArrowIcon, AspectRatio, AttachmentIcon, AttachmentPreview, AudioIcon, AudioInput, AudioWaveform, Avatar, Background, Badge, BatteryIcon, BluetoothIcon, BoldArrowIcon, BookmarkIcon, Button, Calendar, CalendarIcon, CameraIcon, Card, Carousel, Chart, ChartIcon, ChatInput, CheckIcon, Checkbox, ChevronIcon, ClockIcon, CloseEyeIcon, CloseIcon, CloudIcon, ColorInput, ColorPicker, ComboBox, Command, ContextMenu, CookieConsent, CopyIcon, CountryPicker, CropIcon, DatePicker, DeleteIcon, Divider, DocumentIcon, DownloadIcon, DragAndDrop, DragAndDropComponent, DragHandleIcon, DragHandleLinesIcon, DropdownMenu, DustBinIcon, EditIcon, EmojiPicker, ErrorIcon, ExternalLinkIcon, FacebookIcon, FileIcon, FileImage, FileSVG, FilterIcon, Flow, FolderIcon, FormikChatInput, FormikCheckbox, FormikColorInput, FormikComboBox, FormikCountryPicker, FormikDatePicker, FormikForm, FormikOTPInput, FormikPassword, FormikSelect, FormikSlider, FormikSwitch, FormikTagInput, FormikTextArea, FormikTextField, FormikUploader, GiftIcon, HeartIcon, HelpIcon, HomeIcon, HoverCard, Icon, ImageIcon, InfoIcon, InstagramIcon, KanbanBoard, LikeIcon, Link, LinkedinIcon, Loader, LoadingSpinnerIcon, LocationIcon, LockIcon, LogoutIcon, MagicWandIcon, MediaPreview, MenuIcon, Menubar, MessageLayout, MessageView, MicrophoneIcon, MinusIcon, Modal, MoonIcon, NavigationMenu, NotificationIcon, OKR, OTPInput, OpenEyeIcon, Pagination, PanelIcon, Password, PauseIcon, PlayIcon, PlusIcon, PowerOffIcon, PrintIcon, ProfileIcon, ProgressBar, RefreshIcon, Resizable, RotateIcon, SaveIcon, SearchIcon, Select, SendIcon, Separator, SettingsIcon, ShapeIcon, ShareButton, ShareIcon, ShieldIcon, Sidebar, Slider, SliderIcon, SpinnerIcon, StarIcon, StatusIndicator, StopIcon, SuccessIcon, Switch, Table, Tabs, TagInput, Text, TextArea, TextField, TextIcon, ThreadsIcon, TickIcon, Title, Toast, Toggle, ToggleGroup, Tooltip, TrashIcon, Tree, TwitchIcon, TwitterIcon, UnLikeIcon, UnlockIcon, UploadIcon, Uploader, UserIcon, VideoIcon, WarningIcon, WifiIcon, XIcon, YoutubeIcon, ZoomInIcon, ZoomOutIcon, hideMessage, hideModal, showMessage, showModal, showToast, useMessageStore, useModalStore, useToast$1 as useToast };
|
|
37635
37470
|
//# sourceMappingURL=web.esm.js.map
|