@x-plat/design-system 0.8.3 → 0.9.0
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/AutoResizeTextArea/index.cjs +140 -4
- package/dist/components/AutoResizeTextArea/index.css +38 -0
- package/dist/components/AutoResizeTextArea/index.d.cts +3 -0
- package/dist/components/AutoResizeTextArea/index.d.ts +3 -0
- package/dist/components/AutoResizeTextArea/index.js +140 -4
- package/dist/components/ChatInput/index.cjs +150 -9
- package/dist/components/ChatInput/index.css +38 -0
- package/dist/components/ChatInput/index.d.cts +3 -0
- package/dist/components/ChatInput/index.d.ts +3 -0
- package/dist/components/ChatInput/index.js +151 -10
- package/dist/components/CheckBox/index.cjs +132 -5
- package/dist/components/CheckBox/index.css +38 -0
- package/dist/components/CheckBox/index.d.cts +3 -0
- package/dist/components/CheckBox/index.d.ts +3 -0
- package/dist/components/CheckBox/index.js +132 -5
- package/dist/components/DatePicker/index.cjs +72 -59
- package/dist/components/DatePicker/index.css +38 -31
- package/dist/components/DatePicker/index.js +38 -25
- package/dist/components/FieldMessage/index.cjs +183 -0
- package/dist/components/FieldMessage/index.css +37 -0
- package/dist/components/FieldMessage/index.d.cts +37 -0
- package/dist/components/FieldMessage/index.d.ts +37 -0
- package/dist/components/FieldMessage/index.js +154 -0
- package/dist/components/FileUpload/index.cjs +135 -8
- package/dist/components/FileUpload/index.css +38 -0
- package/dist/components/FileUpload/index.d.cts +3 -0
- package/dist/components/FileUpload/index.d.ts +3 -0
- package/dist/components/FileUpload/index.js +135 -8
- package/dist/components/ImageSelector/index.cjs +153 -11
- package/dist/components/ImageSelector/index.css +38 -0
- package/dist/components/ImageSelector/index.d.cts +3 -0
- package/dist/components/ImageSelector/index.d.ts +3 -0
- package/dist/components/ImageSelector/index.js +153 -11
- package/dist/components/Input/index.cjs +38 -25
- package/dist/components/Input/index.css +38 -31
- package/dist/components/Input/index.d.cts +3 -8
- package/dist/components/Input/index.d.ts +3 -8
- package/dist/components/Input/index.js +36 -23
- package/dist/components/Radio/index.cjs +152 -8
- package/dist/components/Radio/index.css +38 -0
- package/dist/components/Radio/index.d.cts +3 -0
- package/dist/components/Radio/index.d.ts +3 -0
- package/dist/components/Radio/index.js +152 -8
- package/dist/components/Select/index.cjs +139 -13
- package/dist/components/Select/index.css +38 -0
- package/dist/components/Select/index.d.cts +3 -0
- package/dist/components/Select/index.d.ts +3 -0
- package/dist/components/Select/index.js +139 -13
- package/dist/components/Switch/index.cjs +140 -4
- package/dist/components/Switch/index.css +38 -0
- package/dist/components/Switch/index.d.cts +3 -0
- package/dist/components/Switch/index.d.ts +3 -0
- package/dist/components/Switch/index.js +140 -4
- package/dist/components/TextArea/index.cjs +138 -2
- package/dist/components/TextArea/index.css +38 -0
- package/dist/components/TextArea/index.d.cts +3 -0
- package/dist/components/TextArea/index.d.ts +3 -0
- package/dist/components/TextArea/index.js +138 -2
- package/dist/components/index.cjs +439 -385
- package/dist/components/index.css +38 -31
- package/dist/components/index.d.cts +2 -0
- package/dist/components/index.d.ts +2 -0
- package/dist/components/index.js +222 -171
- package/dist/index.cjs +444 -390
- package/dist/index.css +38 -31
- package/dist/index.d.cts +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +224 -173
- package/dist/validation-Dqo1zqhT.d.cts +13 -0
- package/dist/validation-Dqo1zqhT.d.ts +13 -0
- package/guidelines/components/form.md +26 -0
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -165,6 +165,8 @@ __export(index_exports, {
|
|
|
165
165
|
FacebookIcon: () => FacebookIcon_default,
|
|
166
166
|
FastForwardIcon: () => FastForwardIcon_default,
|
|
167
167
|
FeatherIcon: () => FeatherIcon_default,
|
|
168
|
+
Field: () => Field,
|
|
169
|
+
FieldMessage: () => FieldMessage_default,
|
|
168
170
|
FigmaIcon: () => FigmaIcon_default,
|
|
169
171
|
FileIcon: () => FileIcon_default,
|
|
170
172
|
FileMinusIcon: () => FileMinusIcon_default,
|
|
@@ -393,6 +395,7 @@ __export(index_exports, {
|
|
|
393
395
|
breakpoints: () => breakpoints,
|
|
394
396
|
cssVar: () => import_tokens_core2.cssVar,
|
|
395
397
|
gridColumns: () => gridColumns,
|
|
398
|
+
hasError: () => hasError,
|
|
396
399
|
isInRange: () => isInRange,
|
|
397
400
|
isSameDay: () => isSameDay,
|
|
398
401
|
semantic: () => import_tokens_core.semantic,
|
|
@@ -5999,11 +6002,49 @@ var Alert_default = Alert;
|
|
|
5999
6002
|
|
|
6000
6003
|
// src/components/AutoResizeTextArea/AutoResizeTextArea.tsx
|
|
6001
6004
|
var import_react2 = __toESM(require("react"), 1);
|
|
6005
|
+
|
|
6006
|
+
// src/components/FieldMessage/FieldMessage.tsx
|
|
6002
6007
|
var import_jsx_runtime297 = require("react/jsx-runtime");
|
|
6008
|
+
var ICON = {
|
|
6009
|
+
default: /* @__PURE__ */ (0, import_jsx_runtime297.jsx)(InfoIcon_default, {}),
|
|
6010
|
+
success: /* @__PURE__ */ (0, import_jsx_runtime297.jsx)(SuccessIcon_default, {}),
|
|
6011
|
+
warning: /* @__PURE__ */ (0, import_jsx_runtime297.jsx)(InfoIcon_default, {}),
|
|
6012
|
+
error: /* @__PURE__ */ (0, import_jsx_runtime297.jsx)(ErrorIcon_default, {})
|
|
6013
|
+
};
|
|
6014
|
+
var FieldMessage = (props) => {
|
|
6015
|
+
const { validations } = props;
|
|
6016
|
+
if (!validations || validations.length === 0) return null;
|
|
6017
|
+
return /* @__PURE__ */ (0, import_jsx_runtime297.jsx)("div", { className: "lib-xplat-field-message-wrap", children: validations.map((v, idx) => /* @__PURE__ */ (0, import_jsx_runtime297.jsxs)(
|
|
6018
|
+
"div",
|
|
6019
|
+
{
|
|
6020
|
+
className: clsx_default("lib-xplat-field-message", v.status),
|
|
6021
|
+
children: [
|
|
6022
|
+
/* @__PURE__ */ (0, import_jsx_runtime297.jsx)("div", { className: "icon", children: ICON[v.status] }),
|
|
6023
|
+
/* @__PURE__ */ (0, import_jsx_runtime297.jsx)("span", { children: v.message })
|
|
6024
|
+
]
|
|
6025
|
+
},
|
|
6026
|
+
`${v.message}_${idx}`
|
|
6027
|
+
)) });
|
|
6028
|
+
};
|
|
6029
|
+
FieldMessage.displayName = "FieldMessage";
|
|
6030
|
+
var FieldMessage_default = FieldMessage;
|
|
6031
|
+
var Field = (props) => {
|
|
6032
|
+
const { validations, children } = props;
|
|
6033
|
+
if (!validations || validations.length === 0) return /* @__PURE__ */ (0, import_jsx_runtime297.jsx)(import_jsx_runtime297.Fragment, { children });
|
|
6034
|
+
return /* @__PURE__ */ (0, import_jsx_runtime297.jsxs)("div", { className: "lib-xplat-field", children: [
|
|
6035
|
+
children,
|
|
6036
|
+
/* @__PURE__ */ (0, import_jsx_runtime297.jsx)(FieldMessage, { validations })
|
|
6037
|
+
] });
|
|
6038
|
+
};
|
|
6039
|
+
Field.displayName = "Field";
|
|
6040
|
+
var hasError = (validations) => !!validations?.some((v) => v.status === "error");
|
|
6041
|
+
|
|
6042
|
+
// src/components/AutoResizeTextArea/AutoResizeTextArea.tsx
|
|
6043
|
+
var import_jsx_runtime298 = require("react/jsx-runtime");
|
|
6003
6044
|
var MAX_HEIGHT = 400;
|
|
6004
6045
|
var AutoResizeTextArea = import_react2.default.forwardRef(
|
|
6005
6046
|
(props, ref) => {
|
|
6006
|
-
const { value, className, onChange, disabled, bare = false, ...textareaProps } = props;
|
|
6047
|
+
const { value, className, onChange, disabled, bare = false, validations, ...textareaProps } = props;
|
|
6007
6048
|
const localRef = import_react2.default.useRef(null);
|
|
6008
6049
|
const setRefs = (el) => {
|
|
6009
6050
|
localRef.current = el;
|
|
@@ -6031,9 +6072,10 @@ var AutoResizeTextArea = import_react2.default.forwardRef(
|
|
|
6031
6072
|
updateHeight();
|
|
6032
6073
|
}, [value]);
|
|
6033
6074
|
if (bare) {
|
|
6034
|
-
return /* @__PURE__ */ (0,
|
|
6075
|
+
return /* @__PURE__ */ (0, import_jsx_runtime298.jsx)(
|
|
6035
6076
|
"textarea",
|
|
6036
6077
|
{
|
|
6078
|
+
"aria-invalid": hasError(validations) || void 0,
|
|
6037
6079
|
...textareaProps,
|
|
6038
6080
|
ref: setRefs,
|
|
6039
6081
|
className,
|
|
@@ -6043,9 +6085,10 @@ var AutoResizeTextArea = import_react2.default.forwardRef(
|
|
|
6043
6085
|
}
|
|
6044
6086
|
);
|
|
6045
6087
|
}
|
|
6046
|
-
|
|
6088
|
+
const control = /* @__PURE__ */ (0, import_jsx_runtime298.jsx)("div", { className: clsx_default("lib-xplat-auto-resize-textarea-wrapper", className), children: /* @__PURE__ */ (0, import_jsx_runtime298.jsx)("div", { className: clsx_default("lib-xplat-auto-resize-textarea", disabled && "disabled"), children: /* @__PURE__ */ (0, import_jsx_runtime298.jsx)(
|
|
6047
6089
|
"textarea",
|
|
6048
6090
|
{
|
|
6091
|
+
"aria-invalid": hasError(validations) || void 0,
|
|
6049
6092
|
...textareaProps,
|
|
6050
6093
|
ref: setRefs,
|
|
6051
6094
|
disabled,
|
|
@@ -6053,13 +6096,14 @@ var AutoResizeTextArea = import_react2.default.forwardRef(
|
|
|
6053
6096
|
onChange: handleChange
|
|
6054
6097
|
}
|
|
6055
6098
|
) }) });
|
|
6099
|
+
return /* @__PURE__ */ (0, import_jsx_runtime298.jsx)(Field, { validations, children: control });
|
|
6056
6100
|
}
|
|
6057
6101
|
);
|
|
6058
6102
|
AutoResizeTextArea.displayName = "AutoResizeTextArea";
|
|
6059
6103
|
var AutoResizeTextArea_default = AutoResizeTextArea;
|
|
6060
6104
|
|
|
6061
6105
|
// src/components/Avatar/Avatar.tsx
|
|
6062
|
-
var
|
|
6106
|
+
var import_jsx_runtime299 = require("react/jsx-runtime");
|
|
6063
6107
|
var CATEGORICAL_COUNT = 8;
|
|
6064
6108
|
var getColorIndex = (name) => {
|
|
6065
6109
|
if (!name) return 1;
|
|
@@ -6076,36 +6120,36 @@ var Avatar = (props) => {
|
|
|
6076
6120
|
const fullInitials = name ? name.split(" ").map((s) => s[0]).join("").slice(0, 2).toUpperCase() : "";
|
|
6077
6121
|
const initials = size === "sm" ? fullInitials.slice(0, 1) : fullInitials;
|
|
6078
6122
|
const catIndex = getColorIndex(name || "");
|
|
6079
|
-
return /* @__PURE__ */ (0,
|
|
6123
|
+
return /* @__PURE__ */ (0, import_jsx_runtime299.jsx)("div", { className: clsx_default("lib-xplat-avatar", size), children: src ? /* @__PURE__ */ (0, import_jsx_runtime299.jsx)("img", { src, alt: alt || name || "avatar" }) : /* @__PURE__ */ (0, import_jsx_runtime299.jsx)("div", { className: clsx_default("fallback", `cat-${catIndex}`), children: initials || /* @__PURE__ */ (0, import_jsx_runtime299.jsx)("svg", { viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime299.jsx)("path", { d: "M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z" }) }) }) });
|
|
6080
6124
|
};
|
|
6081
6125
|
Avatar.displayName = "Avatar";
|
|
6082
6126
|
var Avatar_default = Avatar;
|
|
6083
6127
|
|
|
6084
6128
|
// src/components/Box/Box.tsx
|
|
6085
|
-
var
|
|
6129
|
+
var import_jsx_runtime300 = require("react/jsx-runtime");
|
|
6086
6130
|
var Box = ({
|
|
6087
6131
|
children,
|
|
6088
6132
|
title,
|
|
6089
6133
|
variant = "outlined",
|
|
6090
6134
|
padding = "md"
|
|
6091
6135
|
}) => {
|
|
6092
|
-
return /* @__PURE__ */ (0,
|
|
6093
|
-
title && /* @__PURE__ */ (0,
|
|
6094
|
-
/* @__PURE__ */ (0,
|
|
6136
|
+
return /* @__PURE__ */ (0, import_jsx_runtime300.jsxs)("div", { className: clsx_default("lib-xplat-box", variant, `pad-${padding}`), children: [
|
|
6137
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime300.jsx)("div", { className: "box-title", children: title }),
|
|
6138
|
+
/* @__PURE__ */ (0, import_jsx_runtime300.jsx)("div", { className: "box-content", children })
|
|
6095
6139
|
] });
|
|
6096
6140
|
};
|
|
6097
6141
|
Box.displayName = "Box";
|
|
6098
6142
|
var Box_default = Box;
|
|
6099
6143
|
|
|
6100
6144
|
// src/components/Breadcrumb/Breadcrumb.tsx
|
|
6101
|
-
var
|
|
6145
|
+
var import_jsx_runtime301 = require("react/jsx-runtime");
|
|
6102
6146
|
var Breadcrumb = (props) => {
|
|
6103
6147
|
const { items, separator = "/" } = props;
|
|
6104
|
-
return /* @__PURE__ */ (0,
|
|
6148
|
+
return /* @__PURE__ */ (0, import_jsx_runtime301.jsx)("nav", { className: "lib-xplat-breadcrumb", "aria-label": "\uACBD\uB85C", children: /* @__PURE__ */ (0, import_jsx_runtime301.jsx)("ol", { children: items.map((item, index) => {
|
|
6105
6149
|
const isLast = index === items.length - 1;
|
|
6106
|
-
return /* @__PURE__ */ (0,
|
|
6107
|
-
isLast ? /* @__PURE__ */ (0,
|
|
6108
|
-
!isLast && /* @__PURE__ */ (0,
|
|
6150
|
+
return /* @__PURE__ */ (0, import_jsx_runtime301.jsxs)("li", { children: [
|
|
6151
|
+
isLast ? /* @__PURE__ */ (0, import_jsx_runtime301.jsx)("span", { className: "current", "aria-current": "page", children: item.label }) : item.href ? /* @__PURE__ */ (0, import_jsx_runtime301.jsx)("a", { href: item.href, className: "link", children: item.label }) : /* @__PURE__ */ (0, import_jsx_runtime301.jsx)("button", { className: "link", onClick: item.onClick, children: item.label }),
|
|
6152
|
+
!isLast && /* @__PURE__ */ (0, import_jsx_runtime301.jsx)("span", { className: "separator", children: separator })
|
|
6109
6153
|
] }, index);
|
|
6110
6154
|
}) }) });
|
|
6111
6155
|
};
|
|
@@ -6113,7 +6157,7 @@ Breadcrumb.displayName = "Breadcrumb";
|
|
|
6113
6157
|
var Breadcrumb_default = Breadcrumb;
|
|
6114
6158
|
|
|
6115
6159
|
// src/components/Button/Button.tsx
|
|
6116
|
-
var
|
|
6160
|
+
var import_jsx_runtime302 = require("react/jsx-runtime");
|
|
6117
6161
|
var Button = (props) => {
|
|
6118
6162
|
const {
|
|
6119
6163
|
children,
|
|
@@ -6122,7 +6166,7 @@ var Button = (props) => {
|
|
|
6122
6166
|
disabled,
|
|
6123
6167
|
...rest
|
|
6124
6168
|
} = props;
|
|
6125
|
-
return /* @__PURE__ */ (0,
|
|
6169
|
+
return /* @__PURE__ */ (0, import_jsx_runtime302.jsx)(
|
|
6126
6170
|
"button",
|
|
6127
6171
|
{
|
|
6128
6172
|
className: clsx_default("lib-xplat-button", type, size),
|
|
@@ -6239,7 +6283,7 @@ var MONTH_LABELS = {
|
|
|
6239
6283
|
};
|
|
6240
6284
|
|
|
6241
6285
|
// src/components/Calendar/Calendar.tsx
|
|
6242
|
-
var
|
|
6286
|
+
var import_jsx_runtime303 = require("react/jsx-runtime");
|
|
6243
6287
|
var DayCell = import_react4.default.memo(
|
|
6244
6288
|
({
|
|
6245
6289
|
day,
|
|
@@ -6251,7 +6295,7 @@ var DayCell = import_react4.default.memo(
|
|
|
6251
6295
|
onEventClick
|
|
6252
6296
|
}) => {
|
|
6253
6297
|
if (renderDay) {
|
|
6254
|
-
return /* @__PURE__ */ (0,
|
|
6298
|
+
return /* @__PURE__ */ (0, import_jsx_runtime303.jsx)(
|
|
6255
6299
|
"div",
|
|
6256
6300
|
{
|
|
6257
6301
|
className: clsx_default(
|
|
@@ -6268,7 +6312,7 @@ var DayCell = import_react4.default.memo(
|
|
|
6268
6312
|
}
|
|
6269
6313
|
);
|
|
6270
6314
|
}
|
|
6271
|
-
return /* @__PURE__ */ (0,
|
|
6315
|
+
return /* @__PURE__ */ (0, import_jsx_runtime303.jsxs)(
|
|
6272
6316
|
"div",
|
|
6273
6317
|
{
|
|
6274
6318
|
className: clsx_default(
|
|
@@ -6284,9 +6328,9 @@ var DayCell = import_react4.default.memo(
|
|
|
6284
6328
|
if (!disabled && day.isCurrentMonth) onSelect?.(day.date);
|
|
6285
6329
|
},
|
|
6286
6330
|
children: [
|
|
6287
|
-
/* @__PURE__ */ (0,
|
|
6288
|
-
dayEvents.length > 0 && /* @__PURE__ */ (0,
|
|
6289
|
-
dayEvents.slice(0, 3).map((event, ei) => /* @__PURE__ */ (0,
|
|
6331
|
+
/* @__PURE__ */ (0, import_jsx_runtime303.jsx)("span", { className: "calendar-day-number", children: day.day }),
|
|
6332
|
+
dayEvents.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime303.jsxs)("div", { className: "calendar-day-events", children: [
|
|
6333
|
+
dayEvents.slice(0, 3).map((event, ei) => /* @__PURE__ */ (0, import_jsx_runtime303.jsx)(
|
|
6290
6334
|
"span",
|
|
6291
6335
|
{
|
|
6292
6336
|
className: "calendar-event-dot",
|
|
@@ -6299,7 +6343,7 @@ var DayCell = import_react4.default.memo(
|
|
|
6299
6343
|
},
|
|
6300
6344
|
ei
|
|
6301
6345
|
)),
|
|
6302
|
-
dayEvents.length > 3 && /* @__PURE__ */ (0,
|
|
6346
|
+
dayEvents.length > 3 && /* @__PURE__ */ (0, import_jsx_runtime303.jsxs)("span", { className: "calendar-event-more", children: [
|
|
6303
6347
|
"+",
|
|
6304
6348
|
dayEvents.length - 3
|
|
6305
6349
|
] })
|
|
@@ -6420,21 +6464,21 @@ var Calendar = (props) => {
|
|
|
6420
6464
|
const weekdays = WEEKDAY_LABELS[locale];
|
|
6421
6465
|
const monthLabels = MONTH_LABELS[locale];
|
|
6422
6466
|
const titleText = pickerMode === "days" ? locale === "ko" ? `${year}\uB144 ${monthLabels[month]}` : `${monthLabels[month]} ${year}` : pickerMode === "months" ? `${year}` : `${yearRangeStart} - ${yearRangeStart + 11}`;
|
|
6423
|
-
return /* @__PURE__ */ (0,
|
|
6467
|
+
return /* @__PURE__ */ (0, import_jsx_runtime303.jsxs)(
|
|
6424
6468
|
"div",
|
|
6425
6469
|
{
|
|
6426
6470
|
className: "lib-xplat-calendar",
|
|
6427
6471
|
style: selectedColor ? { "--calendar-selected-color": `var(--${selectedColor})` } : void 0,
|
|
6428
6472
|
children: [
|
|
6429
|
-
/* @__PURE__ */ (0,
|
|
6430
|
-
/* @__PURE__ */ (0,
|
|
6431
|
-
/* @__PURE__ */ (0,
|
|
6432
|
-
/* @__PURE__ */ (0,
|
|
6433
|
-
showToday && /* @__PURE__ */ (0,
|
|
6473
|
+
/* @__PURE__ */ (0, import_jsx_runtime303.jsxs)("div", { className: "calendar-header", children: [
|
|
6474
|
+
/* @__PURE__ */ (0, import_jsx_runtime303.jsx)("button", { className: "calendar-nav", onClick: handlePrev, "aria-label": "\uC774\uC804", children: /* @__PURE__ */ (0, import_jsx_runtime303.jsx)(ChevronLeftIcon_default, {}) }),
|
|
6475
|
+
/* @__PURE__ */ (0, import_jsx_runtime303.jsx)("button", { className: "calendar-title", onClick: handleTitleClick, type: "button", children: titleText }),
|
|
6476
|
+
/* @__PURE__ */ (0, import_jsx_runtime303.jsx)("button", { className: "calendar-nav", onClick: handleNext, "aria-label": "\uB2E4\uC74C", children: /* @__PURE__ */ (0, import_jsx_runtime303.jsx)(ChevronRightIcon_default, {}) }),
|
|
6477
|
+
showToday && /* @__PURE__ */ (0, import_jsx_runtime303.jsx)("button", { className: "calendar-today-btn", onClick: handleToday, children: locale === "ko" ? "\uC624\uB298" : "Today" })
|
|
6434
6478
|
] }),
|
|
6435
|
-
pickerMode === "years" && /* @__PURE__ */ (0,
|
|
6479
|
+
pickerMode === "years" && /* @__PURE__ */ (0, import_jsx_runtime303.jsx)("div", { className: "calendar-picker-grid", children: Array.from({ length: 12 }, (_, i) => {
|
|
6436
6480
|
const y = yearRangeStart + i;
|
|
6437
|
-
return /* @__PURE__ */ (0,
|
|
6481
|
+
return /* @__PURE__ */ (0, import_jsx_runtime303.jsx)(
|
|
6438
6482
|
"button",
|
|
6439
6483
|
{
|
|
6440
6484
|
type: "button",
|
|
@@ -6445,7 +6489,7 @@ var Calendar = (props) => {
|
|
|
6445
6489
|
y
|
|
6446
6490
|
);
|
|
6447
6491
|
}) }),
|
|
6448
|
-
pickerMode === "months" && /* @__PURE__ */ (0,
|
|
6492
|
+
pickerMode === "months" && /* @__PURE__ */ (0, import_jsx_runtime303.jsx)("div", { className: "calendar-picker-grid", children: monthLabels.map((label, i) => /* @__PURE__ */ (0, import_jsx_runtime303.jsx)(
|
|
6449
6493
|
"button",
|
|
6450
6494
|
{
|
|
6451
6495
|
type: "button",
|
|
@@ -6455,8 +6499,8 @@ var Calendar = (props) => {
|
|
|
6455
6499
|
},
|
|
6456
6500
|
i
|
|
6457
6501
|
)) }),
|
|
6458
|
-
pickerMode === "days" && /* @__PURE__ */ (0,
|
|
6459
|
-
/* @__PURE__ */ (0,
|
|
6502
|
+
pickerMode === "days" && /* @__PURE__ */ (0, import_jsx_runtime303.jsxs)(import_jsx_runtime303.Fragment, { children: [
|
|
6503
|
+
/* @__PURE__ */ (0, import_jsx_runtime303.jsx)("div", { className: "calendar-weekdays", children: weekdays.map((label, i) => /* @__PURE__ */ (0, import_jsx_runtime303.jsx)(
|
|
6460
6504
|
"div",
|
|
6461
6505
|
{
|
|
6462
6506
|
className: clsx_default(
|
|
@@ -6468,12 +6512,12 @@ var Calendar = (props) => {
|
|
|
6468
6512
|
},
|
|
6469
6513
|
label
|
|
6470
6514
|
)) }),
|
|
6471
|
-
/* @__PURE__ */ (0,
|
|
6515
|
+
/* @__PURE__ */ (0, import_jsx_runtime303.jsx)("div", { className: "calendar-grid", children: days.map((day, idx) => {
|
|
6472
6516
|
const dayEvents = getEventsForDay(day.date);
|
|
6473
6517
|
const t = day.date.getTime();
|
|
6474
6518
|
const disabled = t < minTime || t > maxTime;
|
|
6475
6519
|
const isSelected = selectedDate ? isSameDay(day.date, selectedDate) : false;
|
|
6476
|
-
return /* @__PURE__ */ (0,
|
|
6520
|
+
return /* @__PURE__ */ (0, import_jsx_runtime303.jsx)(
|
|
6477
6521
|
DayCell,
|
|
6478
6522
|
{
|
|
6479
6523
|
day,
|
|
@@ -6499,10 +6543,10 @@ var Calendar_default = Calendar;
|
|
|
6499
6543
|
var import_react5 = __toESM(require("react"), 1);
|
|
6500
6544
|
|
|
6501
6545
|
// src/components/CardTab/CardTabPanel.tsx
|
|
6502
|
-
var
|
|
6546
|
+
var import_jsx_runtime304 = require("react/jsx-runtime");
|
|
6503
6547
|
var CardTabPanel = (props) => {
|
|
6504
6548
|
const { children, columns = 3 } = props;
|
|
6505
|
-
return /* @__PURE__ */ (0,
|
|
6549
|
+
return /* @__PURE__ */ (0, import_jsx_runtime304.jsx)(
|
|
6506
6550
|
"div",
|
|
6507
6551
|
{
|
|
6508
6552
|
className: "card-tab-panel",
|
|
@@ -6515,7 +6559,7 @@ CardTabPanel.displayName = "CardTab.Panel";
|
|
|
6515
6559
|
var CardTabPanel_default = CardTabPanel;
|
|
6516
6560
|
|
|
6517
6561
|
// src/components/CardTab/CardTab.tsx
|
|
6518
|
-
var
|
|
6562
|
+
var import_jsx_runtime305 = require("react/jsx-runtime");
|
|
6519
6563
|
var CardTabRoot = (props) => {
|
|
6520
6564
|
const {
|
|
6521
6565
|
tabs,
|
|
@@ -6539,10 +6583,10 @@ var CardTabRoot = (props) => {
|
|
|
6539
6583
|
const activePanel = panels.find(
|
|
6540
6584
|
(panel) => panel.props.value === activeValue
|
|
6541
6585
|
);
|
|
6542
|
-
return /* @__PURE__ */ (0,
|
|
6543
|
-
/* @__PURE__ */ (0,
|
|
6586
|
+
return /* @__PURE__ */ (0, import_jsx_runtime305.jsxs)("div", { className: clsx_default("lib-xplat-card-tab", size), children: [
|
|
6587
|
+
/* @__PURE__ */ (0, import_jsx_runtime305.jsx)("div", { className: "card-tab-bar", children: tabs.map((tab) => {
|
|
6544
6588
|
const isActive2 = tab.value === activeValue;
|
|
6545
|
-
return /* @__PURE__ */ (0,
|
|
6589
|
+
return /* @__PURE__ */ (0, import_jsx_runtime305.jsx)(
|
|
6546
6590
|
"button",
|
|
6547
6591
|
{
|
|
6548
6592
|
className: clsx_default("card-tab-trigger", isActive2 && "active"),
|
|
@@ -6554,7 +6598,7 @@ var CardTabRoot = (props) => {
|
|
|
6554
6598
|
tab.value
|
|
6555
6599
|
);
|
|
6556
6600
|
}) }),
|
|
6557
|
-
/* @__PURE__ */ (0,
|
|
6601
|
+
/* @__PURE__ */ (0, import_jsx_runtime305.jsx)("div", { className: "card-tab-body", children: activePanel })
|
|
6558
6602
|
] });
|
|
6559
6603
|
};
|
|
6560
6604
|
CardTabRoot.displayName = "CardTab";
|
|
@@ -6565,7 +6609,7 @@ var CardTab_default = CardTab;
|
|
|
6565
6609
|
|
|
6566
6610
|
// src/components/Chart/Chart.tsx
|
|
6567
6611
|
var import_react6 = __toESM(require("react"), 1);
|
|
6568
|
-
var
|
|
6612
|
+
var import_jsx_runtime306 = require("react/jsx-runtime");
|
|
6569
6613
|
var CATEGORICAL_COUNT2 = 8;
|
|
6570
6614
|
var LINE_BAR_PALETTES = Array.from({ length: CATEGORICAL_COUNT2 }, (_, i) => {
|
|
6571
6615
|
const n = i + 1;
|
|
@@ -6708,12 +6752,12 @@ var formatTick = (value, maxVal) => {
|
|
|
6708
6752
|
const fixed = value.toFixed(decimals);
|
|
6709
6753
|
return decimals === 0 ? Number(fixed).toLocaleString("en-US") : fixed;
|
|
6710
6754
|
};
|
|
6711
|
-
var GridLines = import_react6.default.memo(({ width, height, chartH, maxVal }) => /* @__PURE__ */ (0,
|
|
6755
|
+
var GridLines = import_react6.default.memo(({ width, height, chartH, maxVal }) => /* @__PURE__ */ (0, import_jsx_runtime306.jsx)(import_jsx_runtime306.Fragment, { children: [0, 0.25, 0.5, 0.75, 1].map((ratio) => {
|
|
6712
6756
|
const y = PADDING.top + (1 - ratio) * chartH;
|
|
6713
6757
|
const val = formatTick(maxVal * ratio, maxVal);
|
|
6714
|
-
return /* @__PURE__ */ (0,
|
|
6715
|
-
/* @__PURE__ */ (0,
|
|
6716
|
-
/* @__PURE__ */ (0,
|
|
6758
|
+
return /* @__PURE__ */ (0, import_jsx_runtime306.jsxs)("g", { children: [
|
|
6759
|
+
/* @__PURE__ */ (0, import_jsx_runtime306.jsx)("line", { x1: PADDING.left, y1: y, x2: width - PADDING.right, y2: y, className: "chart-grid" }),
|
|
6760
|
+
/* @__PURE__ */ (0, import_jsx_runtime306.jsx)("text", { x: PADDING.left - 8, y: y + 4, className: "chart-axis-label", textAnchor: "end", children: val })
|
|
6717
6761
|
] }, ratio);
|
|
6718
6762
|
}) }));
|
|
6719
6763
|
GridLines.displayName = "GridLines";
|
|
@@ -6725,10 +6769,10 @@ var getLabelStep = (count, chartW) => {
|
|
|
6725
6769
|
};
|
|
6726
6770
|
var AxisLabels = import_react6.default.memo(({ labels, count, chartW, height }) => {
|
|
6727
6771
|
const step = getLabelStep(count, chartW);
|
|
6728
|
-
return /* @__PURE__ */ (0,
|
|
6772
|
+
return /* @__PURE__ */ (0, import_jsx_runtime306.jsx)(import_jsx_runtime306.Fragment, { children: labels.map((label, i) => {
|
|
6729
6773
|
if (i % step !== 0) return null;
|
|
6730
6774
|
const x = PADDING.left + i / (count - 1 || 1) * chartW;
|
|
6731
|
-
return /* @__PURE__ */ (0,
|
|
6775
|
+
return /* @__PURE__ */ (0, import_jsx_runtime306.jsx)("text", { x, y: height - 8, className: "chart-axis-label", textAnchor: "middle", children: label }, i);
|
|
6732
6776
|
}) });
|
|
6733
6777
|
});
|
|
6734
6778
|
AxisLabels.displayName = "AxisLabels";
|
|
@@ -6804,7 +6848,7 @@ var LineChart = import_react6.default.memo(({ data, labels, width, height, anima
|
|
|
6804
6848
|
}, [animate, width]);
|
|
6805
6849
|
const activeX = activeIndex !== null ? seriesPoints[0]?.[activeIndex]?.x ?? null : null;
|
|
6806
6850
|
const lineClipId = "line-area-clip";
|
|
6807
|
-
return /* @__PURE__ */ (0,
|
|
6851
|
+
return /* @__PURE__ */ (0, import_jsx_runtime306.jsxs)(
|
|
6808
6852
|
"svg",
|
|
6809
6853
|
{
|
|
6810
6854
|
viewBox: `0 0 ${width} ${height}`,
|
|
@@ -6822,9 +6866,9 @@ var LineChart = import_react6.default.memo(({ data, labels, width, height, anima
|
|
|
6822
6866
|
onLeave();
|
|
6823
6867
|
},
|
|
6824
6868
|
children: [
|
|
6825
|
-
animate && /* @__PURE__ */ (0,
|
|
6826
|
-
/* @__PURE__ */ (0,
|
|
6827
|
-
/* @__PURE__ */ (0,
|
|
6869
|
+
animate && /* @__PURE__ */ (0, import_jsx_runtime306.jsx)("defs", { children: /* @__PURE__ */ (0, import_jsx_runtime306.jsx)("clipPath", { id: lineClipId, children: /* @__PURE__ */ (0, import_jsx_runtime306.jsx)("rect", { ref: clipRef, x: "0", y: "0", width: animate ? 0 : width, height }) }) }),
|
|
6870
|
+
/* @__PURE__ */ (0, import_jsx_runtime306.jsx)(GridLines, { width, height, chartH, maxVal }),
|
|
6871
|
+
/* @__PURE__ */ (0, import_jsx_runtime306.jsx)(AxisLabels, { labels, count, chartW, height }),
|
|
6828
6872
|
entries.map(([key], di) => {
|
|
6829
6873
|
const palette = getPalette(LINE_BAR_PALETTES, di, key);
|
|
6830
6874
|
const color = palette[2];
|
|
@@ -6833,16 +6877,16 @@ var LineChart = import_react6.default.memo(({ data, labels, width, height, anima
|
|
|
6833
6877
|
const gradientId = `line-gradient-${di}`;
|
|
6834
6878
|
const polyPoints = points.map((p) => `${p.x},${p.y}`).join(" ");
|
|
6835
6879
|
const areaD = `M ${points[0].x},${points[0].y} ${points.map((p) => `L ${p.x},${p.y}`).join(" ")} L ${points[points.length - 1].x},${PADDING.top + chartH} L ${points[0].x},${PADDING.top + chartH} Z`;
|
|
6836
|
-
return /* @__PURE__ */ (0,
|
|
6837
|
-
/* @__PURE__ */ (0,
|
|
6838
|
-
/* @__PURE__ */ (0,
|
|
6839
|
-
/* @__PURE__ */ (0,
|
|
6880
|
+
return /* @__PURE__ */ (0, import_jsx_runtime306.jsxs)("g", { children: [
|
|
6881
|
+
/* @__PURE__ */ (0, import_jsx_runtime306.jsx)("defs", { children: /* @__PURE__ */ (0, import_jsx_runtime306.jsxs)("linearGradient", { id: gradientId, x1: "0", y1: "0", x2: "0", y2: "1", children: [
|
|
6882
|
+
/* @__PURE__ */ (0, import_jsx_runtime306.jsx)("stop", { offset: "0%", stopColor: areaColor, stopOpacity: "0.2" }),
|
|
6883
|
+
/* @__PURE__ */ (0, import_jsx_runtime306.jsx)("stop", { offset: "100%", stopColor: areaColor, stopOpacity: "0" })
|
|
6840
6884
|
] }) }),
|
|
6841
|
-
/* @__PURE__ */ (0,
|
|
6842
|
-
/* @__PURE__ */ (0,
|
|
6843
|
-
/* @__PURE__ */ (0,
|
|
6885
|
+
/* @__PURE__ */ (0, import_jsx_runtime306.jsxs)("g", { clipPath: animate ? `url(#${lineClipId})` : void 0, children: [
|
|
6886
|
+
/* @__PURE__ */ (0, import_jsx_runtime306.jsx)("path", { d: areaD, fill: `url(#${gradientId})` }),
|
|
6887
|
+
/* @__PURE__ */ (0, import_jsx_runtime306.jsx)("polyline", { points: polyPoints, fill: "none", stroke: color, strokeWidth: "2" })
|
|
6844
6888
|
] }),
|
|
6845
|
-
activeIndex !== null && points[activeIndex] && /* @__PURE__ */ (0,
|
|
6889
|
+
activeIndex !== null && points[activeIndex] && /* @__PURE__ */ (0, import_jsx_runtime306.jsx)(
|
|
6846
6890
|
"circle",
|
|
6847
6891
|
{
|
|
6848
6892
|
cx: points[activeIndex].x,
|
|
@@ -6854,7 +6898,7 @@ var LineChart = import_react6.default.memo(({ data, labels, width, height, anima
|
|
|
6854
6898
|
)
|
|
6855
6899
|
] }, di);
|
|
6856
6900
|
}),
|
|
6857
|
-
activeX !== null && /* @__PURE__ */ (0,
|
|
6901
|
+
activeX !== null && /* @__PURE__ */ (0, import_jsx_runtime306.jsx)(
|
|
6858
6902
|
"line",
|
|
6859
6903
|
{
|
|
6860
6904
|
x1: activeX,
|
|
@@ -6864,7 +6908,7 @@ var LineChart = import_react6.default.memo(({ data, labels, width, height, anima
|
|
|
6864
6908
|
className: "chart-crosshair"
|
|
6865
6909
|
}
|
|
6866
6910
|
),
|
|
6867
|
-
/* @__PURE__ */ (0,
|
|
6911
|
+
/* @__PURE__ */ (0, import_jsx_runtime306.jsx)(
|
|
6868
6912
|
"rect",
|
|
6869
6913
|
{
|
|
6870
6914
|
x: PADDING.left,
|
|
@@ -6913,7 +6957,7 @@ var CurveChart = import_react6.default.memo(({ data, labels, width, height, anim
|
|
|
6913
6957
|
}, [animate, width]);
|
|
6914
6958
|
const activeX = activeIndex !== null ? seriesPoints[0]?.[activeIndex]?.x ?? null : null;
|
|
6915
6959
|
const curveClipId = "curve-area-clip";
|
|
6916
|
-
return /* @__PURE__ */ (0,
|
|
6960
|
+
return /* @__PURE__ */ (0, import_jsx_runtime306.jsxs)(
|
|
6917
6961
|
"svg",
|
|
6918
6962
|
{
|
|
6919
6963
|
viewBox: `0 0 ${width} ${height}`,
|
|
@@ -6932,9 +6976,9 @@ var CurveChart = import_react6.default.memo(({ data, labels, width, height, anim
|
|
|
6932
6976
|
onLeave();
|
|
6933
6977
|
},
|
|
6934
6978
|
children: [
|
|
6935
|
-
animate && /* @__PURE__ */ (0,
|
|
6936
|
-
/* @__PURE__ */ (0,
|
|
6937
|
-
/* @__PURE__ */ (0,
|
|
6979
|
+
animate && /* @__PURE__ */ (0, import_jsx_runtime306.jsx)("defs", { children: /* @__PURE__ */ (0, import_jsx_runtime306.jsx)("clipPath", { id: curveClipId, children: /* @__PURE__ */ (0, import_jsx_runtime306.jsx)("rect", { ref: curveClipRef, x: "0", y: "0", width: animate ? 0 : width, height }) }) }),
|
|
6980
|
+
/* @__PURE__ */ (0, import_jsx_runtime306.jsx)(GridLines, { width, height, chartH, maxVal }),
|
|
6981
|
+
/* @__PURE__ */ (0, import_jsx_runtime306.jsx)(AxisLabels, { labels, count, chartW, height }),
|
|
6938
6982
|
entries.map(([key], di) => {
|
|
6939
6983
|
const palette = getPalette(LINE_BAR_PALETTES, di, key);
|
|
6940
6984
|
const color = palette[2];
|
|
@@ -6943,16 +6987,16 @@ var CurveChart = import_react6.default.memo(({ data, labels, width, height, anim
|
|
|
6943
6987
|
const gradientId = `curve-gradient-${di}`;
|
|
6944
6988
|
const linePath = toSmoothPath(points);
|
|
6945
6989
|
const areaPath = linePath + ` L ${points[points.length - 1].x} ${PADDING.top + chartH} L ${points[0].x} ${PADDING.top + chartH} Z`;
|
|
6946
|
-
return /* @__PURE__ */ (0,
|
|
6947
|
-
/* @__PURE__ */ (0,
|
|
6948
|
-
/* @__PURE__ */ (0,
|
|
6949
|
-
/* @__PURE__ */ (0,
|
|
6990
|
+
return /* @__PURE__ */ (0, import_jsx_runtime306.jsxs)("g", { children: [
|
|
6991
|
+
/* @__PURE__ */ (0, import_jsx_runtime306.jsx)("defs", { children: /* @__PURE__ */ (0, import_jsx_runtime306.jsxs)("linearGradient", { id: gradientId, x1: "0", y1: "0", x2: "0", y2: "1", children: [
|
|
6992
|
+
/* @__PURE__ */ (0, import_jsx_runtime306.jsx)("stop", { offset: "0%", stopColor: areaColor, stopOpacity: "0.4" }),
|
|
6993
|
+
/* @__PURE__ */ (0, import_jsx_runtime306.jsx)("stop", { offset: "100%", stopColor: areaColor, stopOpacity: "0.02" })
|
|
6950
6994
|
] }) }),
|
|
6951
|
-
/* @__PURE__ */ (0,
|
|
6952
|
-
/* @__PURE__ */ (0,
|
|
6953
|
-
/* @__PURE__ */ (0,
|
|
6995
|
+
/* @__PURE__ */ (0, import_jsx_runtime306.jsxs)("g", { clipPath: animate ? `url(#${curveClipId})` : void 0, children: [
|
|
6996
|
+
/* @__PURE__ */ (0, import_jsx_runtime306.jsx)("path", { d: areaPath, fill: `url(#${gradientId})` }),
|
|
6997
|
+
/* @__PURE__ */ (0, import_jsx_runtime306.jsx)("path", { d: linePath, fill: "none", stroke: color, strokeWidth: "2" })
|
|
6954
6998
|
] }),
|
|
6955
|
-
activeIndex !== null && points[activeIndex] && /* @__PURE__ */ (0,
|
|
6999
|
+
activeIndex !== null && points[activeIndex] && /* @__PURE__ */ (0, import_jsx_runtime306.jsx)(
|
|
6956
7000
|
"circle",
|
|
6957
7001
|
{
|
|
6958
7002
|
cx: points[activeIndex].x,
|
|
@@ -6964,7 +7008,7 @@ var CurveChart = import_react6.default.memo(({ data, labels, width, height, anim
|
|
|
6964
7008
|
)
|
|
6965
7009
|
] }, di);
|
|
6966
7010
|
}),
|
|
6967
|
-
activeX !== null && /* @__PURE__ */ (0,
|
|
7011
|
+
activeX !== null && /* @__PURE__ */ (0, import_jsx_runtime306.jsx)(
|
|
6968
7012
|
"line",
|
|
6969
7013
|
{
|
|
6970
7014
|
x1: activeX,
|
|
@@ -6974,7 +7018,7 @@ var CurveChart = import_react6.default.memo(({ data, labels, width, height, anim
|
|
|
6974
7018
|
className: "chart-crosshair"
|
|
6975
7019
|
}
|
|
6976
7020
|
),
|
|
6977
|
-
/* @__PURE__ */ (0,
|
|
7021
|
+
/* @__PURE__ */ (0, import_jsx_runtime306.jsx)(
|
|
6978
7022
|
"rect",
|
|
6979
7023
|
{
|
|
6980
7024
|
x: PADDING.left,
|
|
@@ -7017,11 +7061,11 @@ var BarChart = import_react6.default.memo(({ data, labels, width, height, animat
|
|
|
7017
7061
|
[entries, maxVal, chartH, groupW, barW, barGap, groupCount]
|
|
7018
7062
|
);
|
|
7019
7063
|
const barLabelStep = getLabelStep(count, chartW);
|
|
7020
|
-
return /* @__PURE__ */ (0,
|
|
7021
|
-
/* @__PURE__ */ (0,
|
|
7064
|
+
return /* @__PURE__ */ (0, import_jsx_runtime306.jsxs)("svg", { viewBox: `0 0 ${width} ${height}`, className: "chart-svg", children: [
|
|
7065
|
+
/* @__PURE__ */ (0, import_jsx_runtime306.jsx)(GridLines, { width, height, chartH, maxVal }),
|
|
7022
7066
|
labels.map((label, i) => {
|
|
7023
7067
|
if (i % barLabelStep !== 0) return null;
|
|
7024
|
-
return /* @__PURE__ */ (0,
|
|
7068
|
+
return /* @__PURE__ */ (0, import_jsx_runtime306.jsx)("text", { x: PADDING.left + groupW * i + groupW / 2, y: height - 8, className: "chart-axis-label", textAnchor: "middle", children: label }, i);
|
|
7025
7069
|
}),
|
|
7026
7070
|
entries.map(([key], di) => {
|
|
7027
7071
|
const palette = getPalette(LINE_BAR_PALETTES, di, key);
|
|
@@ -7030,7 +7074,7 @@ var BarChart = import_react6.default.memo(({ data, labels, width, height, animat
|
|
|
7030
7074
|
const r2 = Math.min(4, b.w / 2);
|
|
7031
7075
|
const d = b.h <= r2 ? `M ${b.x} ${b.y + b.h} V ${b.y} H ${b.x + b.w} V ${b.y + b.h} Z` : `M ${b.x} ${b.y + b.h} V ${b.y + r2} Q ${b.x} ${b.y} ${b.x + r2} ${b.y} H ${b.x + b.w - r2} Q ${b.x + b.w} ${b.y} ${b.x + b.w} ${b.y + r2} V ${b.y + b.h} Z`;
|
|
7032
7076
|
const delay = 100 + i * 80;
|
|
7033
|
-
return /* @__PURE__ */ (0,
|
|
7077
|
+
return /* @__PURE__ */ (0, import_jsx_runtime306.jsx)(
|
|
7034
7078
|
"path",
|
|
7035
7079
|
{
|
|
7036
7080
|
d,
|
|
@@ -7110,8 +7154,8 @@ var PieDonutChart = import_react6.default.memo(
|
|
|
7110
7154
|
});
|
|
7111
7155
|
}, [values, total, cx, cy, r2, innerR, labels]);
|
|
7112
7156
|
const maskId = `pie-mask-${isDoughnut ? "d" : "p"}`;
|
|
7113
|
-
return /* @__PURE__ */ (0,
|
|
7114
|
-
animate && /* @__PURE__ */ (0,
|
|
7157
|
+
return /* @__PURE__ */ (0, import_jsx_runtime306.jsxs)("svg", { viewBox: `0 0 ${size} ${size}`, className: "chart-svg chart-pie", children: [
|
|
7158
|
+
animate && /* @__PURE__ */ (0, import_jsx_runtime306.jsx)("defs", { children: /* @__PURE__ */ (0, import_jsx_runtime306.jsx)("mask", { id: maskId, children: /* @__PURE__ */ (0, import_jsx_runtime306.jsx)(
|
|
7115
7159
|
"circle",
|
|
7116
7160
|
{
|
|
7117
7161
|
ref: maskRef,
|
|
@@ -7124,7 +7168,7 @@ var PieDonutChart = import_react6.default.memo(
|
|
|
7124
7168
|
transform: `rotate(-90 ${cx} ${cy})`
|
|
7125
7169
|
}
|
|
7126
7170
|
) }) }),
|
|
7127
|
-
/* @__PURE__ */ (0,
|
|
7171
|
+
/* @__PURE__ */ (0, import_jsx_runtime306.jsx)("g", { mask: animate ? `url(#${maskId})` : void 0, children: sliceData.map((s, i) => /* @__PURE__ */ (0, import_jsx_runtime306.jsx)("g", { children: /* @__PURE__ */ (0, import_jsx_runtime306.jsx)(
|
|
7128
7172
|
"path",
|
|
7129
7173
|
{
|
|
7130
7174
|
d: s.d,
|
|
@@ -7159,15 +7203,15 @@ var ChartTooltip = ({ x, y, containerWidth, containerHeight, tooltipType, childr
|
|
|
7159
7203
|
const sepIdx = content.indexOf(" \u2014 ");
|
|
7160
7204
|
const title = sepIdx >= 0 ? content.slice(0, sepIdx) : content;
|
|
7161
7205
|
const desc = sepIdx >= 0 ? content.slice(sepIdx + 3) : "";
|
|
7162
|
-
return /* @__PURE__ */ (0,
|
|
7206
|
+
return /* @__PURE__ */ (0, import_jsx_runtime306.jsxs)(
|
|
7163
7207
|
"div",
|
|
7164
7208
|
{
|
|
7165
7209
|
ref,
|
|
7166
7210
|
className: `lib-xplat-tooltip ${tooltipType} chart-tooltip-pos`,
|
|
7167
7211
|
style: { left: pos.left, top: pos.top },
|
|
7168
7212
|
children: [
|
|
7169
|
-
title && /* @__PURE__ */ (0,
|
|
7170
|
-
desc && /* @__PURE__ */ (0,
|
|
7213
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime306.jsx)("div", { className: "tooltip-title", children: title }),
|
|
7214
|
+
desc && /* @__PURE__ */ (0, import_jsx_runtime306.jsx)("div", { className: "tooltip-desc", children: desc })
|
|
7171
7215
|
]
|
|
7172
7216
|
}
|
|
7173
7217
|
);
|
|
@@ -7179,14 +7223,14 @@ var ChartLegend = ({ data, labels, type }) => {
|
|
|
7179
7223
|
const total = values.reduce((a, b) => a + b, 0) || 1;
|
|
7180
7224
|
const firstKey = entries[0]?.[0] ?? "";
|
|
7181
7225
|
const colorOffset = hashString(firstKey);
|
|
7182
|
-
return /* @__PURE__ */ (0,
|
|
7226
|
+
return /* @__PURE__ */ (0, import_jsx_runtime306.jsx)("div", { className: "chart-legend", children: values.map((v, i) => {
|
|
7183
7227
|
const pct = Math.round(v / total * 100);
|
|
7184
7228
|
const color = PIE_COLORS[(i + colorOffset) % PIE_COLORS.length];
|
|
7185
|
-
return /* @__PURE__ */ (0,
|
|
7186
|
-
/* @__PURE__ */ (0,
|
|
7187
|
-
/* @__PURE__ */ (0,
|
|
7188
|
-
/* @__PURE__ */ (0,
|
|
7189
|
-
/* @__PURE__ */ (0,
|
|
7229
|
+
return /* @__PURE__ */ (0, import_jsx_runtime306.jsxs)("div", { className: "chart-legend-item", children: [
|
|
7230
|
+
/* @__PURE__ */ (0, import_jsx_runtime306.jsx)("span", { className: "chart-legend-dot", style: { backgroundColor: color } }),
|
|
7231
|
+
/* @__PURE__ */ (0, import_jsx_runtime306.jsxs)("div", { className: "chart-legend-text", children: [
|
|
7232
|
+
/* @__PURE__ */ (0, import_jsx_runtime306.jsx)("span", { className: "chart-legend-label", children: labels[i] || `${i + 1}` }),
|
|
7233
|
+
/* @__PURE__ */ (0, import_jsx_runtime306.jsxs)("span", { className: "chart-legend-value", children: [
|
|
7190
7234
|
v.toLocaleString(),
|
|
7191
7235
|
"(",
|
|
7192
7236
|
pct,
|
|
@@ -7196,16 +7240,16 @@ var ChartLegend = ({ data, labels, type }) => {
|
|
|
7196
7240
|
] }, i);
|
|
7197
7241
|
}) });
|
|
7198
7242
|
}
|
|
7199
|
-
return /* @__PURE__ */ (0,
|
|
7243
|
+
return /* @__PURE__ */ (0, import_jsx_runtime306.jsx)("div", { className: "chart-legend", children: entries.map(([key], di) => {
|
|
7200
7244
|
const palette = getPalette(LINE_BAR_PALETTES, di, key);
|
|
7201
7245
|
const color = palette[2];
|
|
7202
7246
|
const values = entries[di][1];
|
|
7203
7247
|
const sum = values.reduce((a, b) => a + b, 0);
|
|
7204
|
-
return /* @__PURE__ */ (0,
|
|
7205
|
-
/* @__PURE__ */ (0,
|
|
7206
|
-
/* @__PURE__ */ (0,
|
|
7207
|
-
/* @__PURE__ */ (0,
|
|
7208
|
-
/* @__PURE__ */ (0,
|
|
7248
|
+
return /* @__PURE__ */ (0, import_jsx_runtime306.jsxs)("div", { className: "chart-legend-item", children: [
|
|
7249
|
+
/* @__PURE__ */ (0, import_jsx_runtime306.jsx)("span", { className: "chart-legend-dot", style: { backgroundColor: color } }),
|
|
7250
|
+
/* @__PURE__ */ (0, import_jsx_runtime306.jsxs)("div", { className: "chart-legend-text", children: [
|
|
7251
|
+
/* @__PURE__ */ (0, import_jsx_runtime306.jsx)("span", { className: "chart-legend-label", children: key }),
|
|
7252
|
+
/* @__PURE__ */ (0, import_jsx_runtime306.jsx)("span", { className: "chart-legend-value", children: sum.toLocaleString() })
|
|
7209
7253
|
] })
|
|
7210
7254
|
] }, di);
|
|
7211
7255
|
}) });
|
|
@@ -7219,14 +7263,14 @@ var Chart = import_react6.default.memo((props) => {
|
|
|
7219
7263
|
const dataKey = import_react6.default.useMemo(() => JSON.stringify(labels), [labels]);
|
|
7220
7264
|
const animate = useChartAnimation(containerRef, dataKey);
|
|
7221
7265
|
const ready = width > 0 && height > 0;
|
|
7222
|
-
return /* @__PURE__ */ (0,
|
|
7223
|
-
ready && type === "line" && /* @__PURE__ */ (0,
|
|
7224
|
-
ready && type === "curve" && /* @__PURE__ */ (0,
|
|
7225
|
-
ready && type === "bar" && /* @__PURE__ */ (0,
|
|
7226
|
-
ready && type === "pie" && /* @__PURE__ */ (0,
|
|
7227
|
-
ready && type === "doughnut" && /* @__PURE__ */ (0,
|
|
7228
|
-
ready && (type === "pie" || type === "doughnut") && /* @__PURE__ */ (0,
|
|
7229
|
-
tooltip.visible && tooltip.content && /* @__PURE__ */ (0,
|
|
7266
|
+
return /* @__PURE__ */ (0, import_jsx_runtime306.jsxs)("div", { className: "lib-xplat-chart", ref: containerRef, children: [
|
|
7267
|
+
ready && type === "line" && /* @__PURE__ */ (0, import_jsx_runtime306.jsx)(LineChart, { data: stableData, labels: stableLabels, width, height, animate, onHover: show, onMove: move, onLeave: hide }),
|
|
7268
|
+
ready && type === "curve" && /* @__PURE__ */ (0, import_jsx_runtime306.jsx)(CurveChart, { data: stableData, labels: stableLabels, width, height, animate, onHover: show, onMove: move, onLeave: hide }),
|
|
7269
|
+
ready && type === "bar" && /* @__PURE__ */ (0, import_jsx_runtime306.jsx)(BarChart, { data: stableData, labels: stableLabels, width, height, animate, onHover: show, onMove: move, onLeave: hide }),
|
|
7270
|
+
ready && type === "pie" && /* @__PURE__ */ (0, import_jsx_runtime306.jsx)(PieDonutChart, { data: stableData, labels: stableLabels, width, height, animate, onHover: show, onMove: move, onLeave: hide }),
|
|
7271
|
+
ready && type === "doughnut" && /* @__PURE__ */ (0, import_jsx_runtime306.jsx)(PieDonutChart, { data: stableData, labels: stableLabels, width, height, animate, isDoughnut: true, onHover: show, onMove: move, onLeave: hide }),
|
|
7272
|
+
ready && (type === "pie" || type === "doughnut") && /* @__PURE__ */ (0, import_jsx_runtime306.jsx)(ChartLegend, { data: stableData, labels: stableLabels, type }),
|
|
7273
|
+
tooltip.visible && tooltip.content && /* @__PURE__ */ (0, import_jsx_runtime306.jsx)(ChartTooltip, { x: tooltip.x, y: tooltip.y, containerWidth: width, containerHeight: height, tooltipType, children: tooltip.content })
|
|
7230
7274
|
] });
|
|
7231
7275
|
});
|
|
7232
7276
|
Chart.displayName = "Chart";
|
|
@@ -7236,7 +7280,7 @@ var Chart_default = Chart;
|
|
|
7236
7280
|
var import_react7 = __toESM(require("react"), 1);
|
|
7237
7281
|
|
|
7238
7282
|
// src/components/IconButton/IconButton.tsx
|
|
7239
|
-
var
|
|
7283
|
+
var import_jsx_runtime307 = require("react/jsx-runtime");
|
|
7240
7284
|
var IconButton = (props) => {
|
|
7241
7285
|
const {
|
|
7242
7286
|
icon,
|
|
@@ -7245,7 +7289,7 @@ var IconButton = (props) => {
|
|
|
7245
7289
|
disabled,
|
|
7246
7290
|
...rest
|
|
7247
7291
|
} = props;
|
|
7248
|
-
return /* @__PURE__ */ (0,
|
|
7292
|
+
return /* @__PURE__ */ (0, import_jsx_runtime307.jsx)(
|
|
7249
7293
|
"button",
|
|
7250
7294
|
{
|
|
7251
7295
|
className: clsx_default("lib-xplat-icon-button", type, size),
|
|
@@ -7259,7 +7303,7 @@ IconButton.displayName = "IconButton";
|
|
|
7259
7303
|
var IconButton_default = IconButton;
|
|
7260
7304
|
|
|
7261
7305
|
// src/components/ChatInput/ChatInput.tsx
|
|
7262
|
-
var
|
|
7306
|
+
var import_jsx_runtime308 = require("react/jsx-runtime");
|
|
7263
7307
|
var ChatInput = import_react7.default.forwardRef(
|
|
7264
7308
|
(props, ref) => {
|
|
7265
7309
|
const {
|
|
@@ -7268,7 +7312,8 @@ var ChatInput = import_react7.default.forwardRef(
|
|
|
7268
7312
|
disabled = false,
|
|
7269
7313
|
buttonType = "primary",
|
|
7270
7314
|
onSubmit,
|
|
7271
|
-
onChange
|
|
7315
|
+
onChange,
|
|
7316
|
+
validations
|
|
7272
7317
|
} = props;
|
|
7273
7318
|
const isControlled = valueProp !== void 0;
|
|
7274
7319
|
const [internalValue, setInternalValue] = import_react7.default.useState("");
|
|
@@ -7290,8 +7335,8 @@ var ChatInput = import_react7.default.forwardRef(
|
|
|
7290
7335
|
handleSubmit();
|
|
7291
7336
|
}
|
|
7292
7337
|
};
|
|
7293
|
-
|
|
7294
|
-
/* @__PURE__ */ (0,
|
|
7338
|
+
const control = /* @__PURE__ */ (0, import_jsx_runtime308.jsxs)("div", { className: clsx_default("lib-xplat-chat-input", disabled && "disabled"), children: [
|
|
7339
|
+
/* @__PURE__ */ (0, import_jsx_runtime308.jsx)(
|
|
7295
7340
|
AutoResizeTextArea_default,
|
|
7296
7341
|
{
|
|
7297
7342
|
ref,
|
|
@@ -7302,13 +7347,14 @@ var ChatInput = import_react7.default.forwardRef(
|
|
|
7302
7347
|
disabled,
|
|
7303
7348
|
rows: 1,
|
|
7304
7349
|
onChange: handleChange,
|
|
7350
|
+
"aria-invalid": hasError(validations) || void 0,
|
|
7305
7351
|
onKeyDown: handleKeyDown
|
|
7306
7352
|
}
|
|
7307
7353
|
),
|
|
7308
|
-
/* @__PURE__ */ (0,
|
|
7354
|
+
/* @__PURE__ */ (0, import_jsx_runtime308.jsx)(
|
|
7309
7355
|
IconButton_default,
|
|
7310
7356
|
{
|
|
7311
|
-
icon: /* @__PURE__ */ (0,
|
|
7357
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime308.jsx)(MessageSquareIcon_default, {}),
|
|
7312
7358
|
type: buttonType,
|
|
7313
7359
|
size: "sm",
|
|
7314
7360
|
disabled: !hasText || disabled,
|
|
@@ -7317,6 +7363,7 @@ var ChatInput = import_react7.default.forwardRef(
|
|
|
7317
7363
|
}
|
|
7318
7364
|
)
|
|
7319
7365
|
] });
|
|
7366
|
+
return /* @__PURE__ */ (0, import_jsx_runtime308.jsx)(Field, { validations, children: control });
|
|
7320
7367
|
}
|
|
7321
7368
|
);
|
|
7322
7369
|
ChatInput.displayName = "ChatInput";
|
|
@@ -7342,7 +7389,7 @@ var import_tokens_core = require("@x-plat/tokens-core");
|
|
|
7342
7389
|
var import_tokens_core2 = require("@x-plat/tokens-core");
|
|
7343
7390
|
|
|
7344
7391
|
// src/components/CheckBox/CheckBox.tsx
|
|
7345
|
-
var
|
|
7392
|
+
var import_jsx_runtime309 = require("react/jsx-runtime");
|
|
7346
7393
|
var CheckBox = (props) => {
|
|
7347
7394
|
const {
|
|
7348
7395
|
checked,
|
|
@@ -7352,6 +7399,7 @@ var CheckBox = (props) => {
|
|
|
7352
7399
|
disabled,
|
|
7353
7400
|
size = "md",
|
|
7354
7401
|
type = "brand",
|
|
7402
|
+
validations,
|
|
7355
7403
|
...rest
|
|
7356
7404
|
} = props;
|
|
7357
7405
|
const handleChange = (e) => {
|
|
@@ -7361,60 +7409,45 @@ var CheckBox = (props) => {
|
|
|
7361
7409
|
const checkedClasses = `checked`;
|
|
7362
7410
|
const disabledClasses = "disabled";
|
|
7363
7411
|
const boxClasses = disabled ? disabledClasses : checked ? checkedClasses : uncheckedClasses;
|
|
7364
|
-
|
|
7365
|
-
/* @__PURE__ */ (0,
|
|
7412
|
+
const control = /* @__PURE__ */ (0, import_jsx_runtime309.jsxs)("label", { className: clsx_default("lib-xplat-checkbox", size, type, className), children: [
|
|
7413
|
+
/* @__PURE__ */ (0, import_jsx_runtime309.jsx)(
|
|
7366
7414
|
"input",
|
|
7367
7415
|
{
|
|
7368
7416
|
type: "checkbox",
|
|
7369
7417
|
checked,
|
|
7370
7418
|
onChange: handleChange,
|
|
7371
7419
|
disabled,
|
|
7420
|
+
"aria-invalid": hasError(validations) || void 0,
|
|
7372
7421
|
...rest
|
|
7373
7422
|
}
|
|
7374
7423
|
),
|
|
7375
|
-
/* @__PURE__ */ (0,
|
|
7376
|
-
label && /* @__PURE__ */ (0,
|
|
7424
|
+
/* @__PURE__ */ (0, import_jsx_runtime309.jsx)("span", { className: clsx_default("checkbox", boxClasses), children: /* @__PURE__ */ (0, import_jsx_runtime309.jsx)("span", { className: clsx_default("check-icon", { visible: checked }), children: /* @__PURE__ */ (0, import_jsx_runtime309.jsx)(CheckIcon_default, {}) }) }),
|
|
7425
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime309.jsx)("span", { className: "label", children: label })
|
|
7377
7426
|
] });
|
|
7427
|
+
return /* @__PURE__ */ (0, import_jsx_runtime309.jsx)(Field, { validations, children: control });
|
|
7378
7428
|
};
|
|
7379
7429
|
CheckBox.displayName = "CheckBox";
|
|
7380
7430
|
var CheckBox_default = CheckBox;
|
|
7381
7431
|
|
|
7382
7432
|
// src/components/Chip/Chip.tsx
|
|
7383
|
-
var
|
|
7433
|
+
var import_jsx_runtime310 = require("react/jsx-runtime");
|
|
7384
7434
|
var Chip = (props) => {
|
|
7385
7435
|
const {
|
|
7386
7436
|
children,
|
|
7387
7437
|
type = "primary",
|
|
7388
7438
|
size = "md"
|
|
7389
7439
|
} = props;
|
|
7390
|
-
return /* @__PURE__ */ (0,
|
|
7440
|
+
return /* @__PURE__ */ (0, import_jsx_runtime310.jsx)("div", { className: clsx_default("lib-xplat-chip", type, size), children });
|
|
7391
7441
|
};
|
|
7392
7442
|
Chip.displayName = "Chip";
|
|
7393
7443
|
var Chip_default = Chip;
|
|
7394
7444
|
|
|
7395
7445
|
// src/components/DatePicker/InputDatePicker/index.tsx
|
|
7396
|
-
var
|
|
7446
|
+
var import_react12 = __toESM(require("react"), 1);
|
|
7397
7447
|
|
|
7398
7448
|
// src/components/Input/Input.tsx
|
|
7399
7449
|
var import_react8 = __toESM(require("react"), 1);
|
|
7400
7450
|
|
|
7401
|
-
// src/components/Input/InputValidations.tsx
|
|
7402
|
-
var import_jsx_runtime310 = require("react/jsx-runtime");
|
|
7403
|
-
var InputValidations = (props) => {
|
|
7404
|
-
const { message, status = "default" } = props;
|
|
7405
|
-
return /* @__PURE__ */ (0, import_jsx_runtime310.jsxs)("div", { className: clsx_default("lib-xplat-input-validation", status), children: [
|
|
7406
|
-
/* @__PURE__ */ (0, import_jsx_runtime310.jsxs)("div", { className: "icon", children: [
|
|
7407
|
-
status === "default" && /* @__PURE__ */ (0, import_jsx_runtime310.jsx)(InfoIcon_default, {}),
|
|
7408
|
-
status === "success" && /* @__PURE__ */ (0, import_jsx_runtime310.jsx)(SuccessIcon_default, {}),
|
|
7409
|
-
status === "warning" && /* @__PURE__ */ (0, import_jsx_runtime310.jsx)(InfoIcon_default, {}),
|
|
7410
|
-
status === "error" && /* @__PURE__ */ (0, import_jsx_runtime310.jsx)(ErrorIcon_default, {})
|
|
7411
|
-
] }),
|
|
7412
|
-
/* @__PURE__ */ (0, import_jsx_runtime310.jsx)("div", { className: "message", children: message })
|
|
7413
|
-
] });
|
|
7414
|
-
};
|
|
7415
|
-
InputValidations.displayName = "InputValidations";
|
|
7416
|
-
var InputValidations_default = InputValidations;
|
|
7417
|
-
|
|
7418
7451
|
// src/components/Input/reg.ts
|
|
7419
7452
|
var numberAndCommaReg = /^[0-9,]+$/;
|
|
7420
7453
|
var phoneNumberMaxLengthReg = /^.{0,13}$/;
|
|
@@ -7451,7 +7484,6 @@ var handleTelBackspace = (prevValue, currValue) => {
|
|
|
7451
7484
|
|
|
7452
7485
|
// src/components/Input/Input.tsx
|
|
7453
7486
|
var import_jsx_runtime311 = require("react/jsx-runtime");
|
|
7454
|
-
var import_react9 = require("react");
|
|
7455
7487
|
var formatValue = (type, value) => {
|
|
7456
7488
|
if (value === null || value === void 0) return "";
|
|
7457
7489
|
const strValue = Array.isArray(value) ? String(value[0] ?? "") : String(value);
|
|
@@ -7540,32 +7572,27 @@ var Input = import_react8.default.forwardRef((props, ref) => {
|
|
|
7540
7572
|
disabled,
|
|
7541
7573
|
type: type === "number" ? "text" : type,
|
|
7542
7574
|
value: localValue,
|
|
7543
|
-
onChange: handleChange
|
|
7575
|
+
onChange: handleChange,
|
|
7576
|
+
"aria-invalid": hasError(validations) || void 0
|
|
7544
7577
|
}
|
|
7545
7578
|
),
|
|
7546
7579
|
suffix && /* @__PURE__ */ (0, import_jsx_runtime311.jsx)("div", { className: "suffix", children: suffix })
|
|
7547
7580
|
]
|
|
7548
7581
|
}
|
|
7549
7582
|
),
|
|
7550
|
-
|
|
7551
|
-
InputValidations_default,
|
|
7552
|
-
{
|
|
7553
|
-
...validation,
|
|
7554
|
-
key: `${validation.message}_${idx}`
|
|
7555
|
-
}
|
|
7556
|
-
)) })
|
|
7583
|
+
/* @__PURE__ */ (0, import_jsx_runtime311.jsx)(FieldMessage_default, { validations })
|
|
7557
7584
|
] });
|
|
7558
7585
|
});
|
|
7559
7586
|
Input.displayName = "Input";
|
|
7560
7587
|
var Input_default = Input;
|
|
7561
7588
|
|
|
7562
7589
|
// src/components/Input/PasswordInput/PasswordInput.tsx
|
|
7563
|
-
var
|
|
7590
|
+
var import_react9 = __toESM(require("react"), 1);
|
|
7564
7591
|
var import_jsx_runtime312 = require("react/jsx-runtime");
|
|
7565
|
-
var PasswordInput =
|
|
7592
|
+
var PasswordInput = import_react9.default.forwardRef(
|
|
7566
7593
|
(props, ref) => {
|
|
7567
7594
|
const { reg: _reg, ...inputProps } = props;
|
|
7568
|
-
const [isView, setIsView] =
|
|
7595
|
+
const [isView, setIsView] = import_react9.default.useState(false);
|
|
7569
7596
|
const handleChangeView = () => {
|
|
7570
7597
|
setIsView((prev) => !prev);
|
|
7571
7598
|
};
|
|
@@ -7584,16 +7611,16 @@ PasswordInput.displayName = "PasswordInput";
|
|
|
7584
7611
|
var PasswordInput_default = PasswordInput;
|
|
7585
7612
|
|
|
7586
7613
|
// src/components/Modal/Modal.tsx
|
|
7587
|
-
var
|
|
7614
|
+
var import_react10 = __toESM(require("react"), 1);
|
|
7588
7615
|
var import_react_dom = require("react-dom");
|
|
7589
7616
|
var import_jsx_runtime313 = require("react/jsx-runtime");
|
|
7590
7617
|
var ANIMATION_DURATION_MS = 200;
|
|
7591
7618
|
var Modal = (props) => {
|
|
7592
7619
|
const { isOpen, onClose, children } = props;
|
|
7593
|
-
const [mounted, setMounted] =
|
|
7594
|
-
const [visible, setVisible] =
|
|
7595
|
-
const [settled, setSettled] =
|
|
7596
|
-
|
|
7620
|
+
const [mounted, setMounted] = import_react10.default.useState(false);
|
|
7621
|
+
const [visible, setVisible] = import_react10.default.useState(false);
|
|
7622
|
+
const [settled, setSettled] = import_react10.default.useState(false);
|
|
7623
|
+
import_react10.default.useEffect(() => {
|
|
7597
7624
|
if (isOpen) {
|
|
7598
7625
|
setMounted(true);
|
|
7599
7626
|
const show = setTimeout(() => setVisible(true), 1);
|
|
@@ -7636,9 +7663,9 @@ Modal.displayName = "Modal";
|
|
|
7636
7663
|
var Modal_default = Modal;
|
|
7637
7664
|
|
|
7638
7665
|
// src/components/DatePicker/SingleDatePicker/index.tsx
|
|
7639
|
-
var
|
|
7666
|
+
var import_react11 = __toESM(require("react"), 1);
|
|
7640
7667
|
var import_jsx_runtime314 = require("react/jsx-runtime");
|
|
7641
|
-
var DayCell2 =
|
|
7668
|
+
var DayCell2 = import_react11.default.memo(
|
|
7642
7669
|
({
|
|
7643
7670
|
day,
|
|
7644
7671
|
disabled,
|
|
@@ -7690,26 +7717,26 @@ var SingleDatePicker = (props) => {
|
|
|
7690
7717
|
initialYear,
|
|
7691
7718
|
initialMonth
|
|
7692
7719
|
);
|
|
7693
|
-
const [pickerMode, setPickerMode] =
|
|
7694
|
-
const [yearRangeStart, setYearRangeStart] =
|
|
7720
|
+
const [pickerMode, setPickerMode] = import_react11.default.useState("days");
|
|
7721
|
+
const [yearRangeStart, setYearRangeStart] = import_react11.default.useState(
|
|
7695
7722
|
Math.floor((initialYear ?? (/* @__PURE__ */ new Date()).getFullYear()) / 12) * 12
|
|
7696
7723
|
);
|
|
7697
|
-
const minTime =
|
|
7724
|
+
const minTime = import_react11.default.useMemo(
|
|
7698
7725
|
() => minDate ? new Date(minDate.getFullYear(), minDate.getMonth(), minDate.getDate()).getTime() : -Infinity,
|
|
7699
7726
|
[minDate]
|
|
7700
7727
|
);
|
|
7701
|
-
const maxTime =
|
|
7728
|
+
const maxTime = import_react11.default.useMemo(
|
|
7702
7729
|
() => maxDate ? new Date(maxDate.getFullYear(), maxDate.getMonth(), maxDate.getDate()).getTime() : Infinity,
|
|
7703
7730
|
[maxDate]
|
|
7704
7731
|
);
|
|
7705
|
-
const highlightSet =
|
|
7732
|
+
const highlightSet = import_react11.default.useMemo(() => {
|
|
7706
7733
|
const set = /* @__PURE__ */ new Set();
|
|
7707
7734
|
for (const h of highlightDates) {
|
|
7708
7735
|
set.add(`${h.getFullYear()}-${h.getMonth()}-${h.getDate()}`);
|
|
7709
7736
|
}
|
|
7710
7737
|
return set;
|
|
7711
7738
|
}, [highlightDates]);
|
|
7712
|
-
const handleSelect =
|
|
7739
|
+
const handleSelect = import_react11.default.useCallback(
|
|
7713
7740
|
(date) => {
|
|
7714
7741
|
onChange?.(date);
|
|
7715
7742
|
},
|
|
@@ -7838,8 +7865,8 @@ var formatDate = (date) => {
|
|
|
7838
7865
|
};
|
|
7839
7866
|
var InputDatePicker = (props) => {
|
|
7840
7867
|
const { value, onChange, minDate, maxDate, disabled, locale = "ko", placeholder } = props;
|
|
7841
|
-
const [isOpen, setIsOpen] =
|
|
7842
|
-
const [tempDate, setTempDate] =
|
|
7868
|
+
const [isOpen, setIsOpen] = import_react12.default.useState(false);
|
|
7869
|
+
const [tempDate, setTempDate] = import_react12.default.useState(value ?? /* @__PURE__ */ new Date());
|
|
7843
7870
|
const handleOpen = () => {
|
|
7844
7871
|
if (disabled) return;
|
|
7845
7872
|
setTempDate(value ?? /* @__PURE__ */ new Date());
|
|
@@ -7888,18 +7915,18 @@ InputDatePicker.displayName = "InputDatePicker";
|
|
|
7888
7915
|
var InputDatePicker_default = InputDatePicker;
|
|
7889
7916
|
|
|
7890
7917
|
// src/components/DatePicker/PopupPicker/index.tsx
|
|
7891
|
-
var
|
|
7918
|
+
var import_react16 = __toESM(require("react"), 1);
|
|
7892
7919
|
|
|
7893
7920
|
// src/components/DatePicker/RangePicker/index.tsx
|
|
7894
|
-
var
|
|
7921
|
+
var import_react15 = __toESM(require("react"), 1);
|
|
7895
7922
|
|
|
7896
7923
|
// src/components/Tab/Tab.tsx
|
|
7897
|
-
var
|
|
7924
|
+
var import_react14 = __toESM(require("react"), 1);
|
|
7898
7925
|
|
|
7899
7926
|
// src/components/Tab/TabItem.tsx
|
|
7900
|
-
var
|
|
7927
|
+
var import_react13 = __toESM(require("react"), 1);
|
|
7901
7928
|
var import_jsx_runtime316 = require("react/jsx-runtime");
|
|
7902
|
-
var TabItem =
|
|
7929
|
+
var TabItem = import_react13.default.forwardRef((props, ref) => {
|
|
7903
7930
|
const { isActive: isActive2, title, onClick } = props;
|
|
7904
7931
|
return /* @__PURE__ */ (0, import_jsx_runtime316.jsx)(
|
|
7905
7932
|
"div",
|
|
@@ -7918,15 +7945,15 @@ var TabItem_default = TabItem;
|
|
|
7918
7945
|
var import_jsx_runtime317 = require("react/jsx-runtime");
|
|
7919
7946
|
var Tab = (props) => {
|
|
7920
7947
|
const { activeIndex, onChange, tabs, type, size = "md" } = props;
|
|
7921
|
-
const [underlineStyle, setUnderlineStyle] =
|
|
7948
|
+
const [underlineStyle, setUnderlineStyle] = import_react14.default.useState({
|
|
7922
7949
|
left: 0,
|
|
7923
7950
|
width: 0
|
|
7924
7951
|
});
|
|
7925
|
-
const itemRefs =
|
|
7952
|
+
const itemRefs = import_react14.default.useRef([]);
|
|
7926
7953
|
const handleChangeActiveTab = (tabItem, tabIdx) => {
|
|
7927
7954
|
onChange(tabItem, tabIdx);
|
|
7928
7955
|
};
|
|
7929
|
-
|
|
7956
|
+
import_react14.default.useEffect(() => {
|
|
7930
7957
|
const el = itemRefs.current[activeIndex];
|
|
7931
7958
|
if (el) {
|
|
7932
7959
|
setUnderlineStyle({ left: el.offsetLeft, width: el.offsetWidth });
|
|
@@ -7971,7 +7998,7 @@ var RangePicker = (props) => {
|
|
|
7971
7998
|
maxDate,
|
|
7972
7999
|
locale = "ko"
|
|
7973
8000
|
} = props;
|
|
7974
|
-
const [activeTab, setActiveTab] =
|
|
8001
|
+
const [activeTab, setActiveTab] = import_react15.default.useState("start");
|
|
7975
8002
|
const handleStartChange = (date) => {
|
|
7976
8003
|
if (!date) return;
|
|
7977
8004
|
const newStart = date > endDate ? endDate : date;
|
|
@@ -8056,7 +8083,7 @@ var RangePicker_default = RangePicker;
|
|
|
8056
8083
|
var import_jsx_runtime319 = require("react/jsx-runtime");
|
|
8057
8084
|
var PopupPicker = (props) => {
|
|
8058
8085
|
const { component, type, locale } = props;
|
|
8059
|
-
const [isOpen, setIsOpen] =
|
|
8086
|
+
const [isOpen, setIsOpen] = import_react16.default.useState(false);
|
|
8060
8087
|
const handleClick = () => setIsOpen(true);
|
|
8061
8088
|
const handleClose = () => setIsOpen(false);
|
|
8062
8089
|
const handleSingleChange = (date) => {
|
|
@@ -8065,7 +8092,7 @@ var PopupPicker = (props) => {
|
|
|
8065
8092
|
handleClose();
|
|
8066
8093
|
};
|
|
8067
8094
|
return /* @__PURE__ */ (0, import_jsx_runtime319.jsxs)("div", { className: "lib-xplat-popup-datepicker", children: [
|
|
8068
|
-
|
|
8095
|
+
import_react16.default.cloneElement(component, { onClick: handleClick }),
|
|
8069
8096
|
/* @__PURE__ */ (0, import_jsx_runtime319.jsx)(Modal_default, { isOpen, onClose: handleClose, children: /* @__PURE__ */ (0, import_jsx_runtime319.jsxs)("div", { className: clsx_default("lib-xplat-popup-datepicker-card", type === "range" && "range-mode"), children: [
|
|
8070
8097
|
/* @__PURE__ */ (0, import_jsx_runtime319.jsxs)("div", { className: "popup-datepicker-content", children: [
|
|
8071
8098
|
type === "single" && /* @__PURE__ */ (0, import_jsx_runtime319.jsx)(
|
|
@@ -8124,15 +8151,15 @@ Divider.displayName = "Divider";
|
|
|
8124
8151
|
var Divider_default = Divider;
|
|
8125
8152
|
|
|
8126
8153
|
// src/components/Drawer/Drawer.tsx
|
|
8127
|
-
var
|
|
8154
|
+
var import_react17 = __toESM(require("react"), 1);
|
|
8128
8155
|
var import_react_dom2 = require("react-dom");
|
|
8129
8156
|
var import_jsx_runtime321 = require("react/jsx-runtime");
|
|
8130
8157
|
var ANIMATION_DURATION_MS2 = 250;
|
|
8131
8158
|
var Drawer = (props) => {
|
|
8132
8159
|
const { isOpen, onClose, placement = "right", size = "md", title, children } = props;
|
|
8133
|
-
const [mounted, setMounted] =
|
|
8134
|
-
const [visible, setVisible] =
|
|
8135
|
-
|
|
8160
|
+
const [mounted, setMounted] = import_react17.default.useState(false);
|
|
8161
|
+
const [visible, setVisible] = import_react17.default.useState(false);
|
|
8162
|
+
import_react17.default.useEffect(() => {
|
|
8136
8163
|
if (isOpen) {
|
|
8137
8164
|
setMounted(true);
|
|
8138
8165
|
const t2 = setTimeout(() => setVisible(true), 1);
|
|
@@ -8176,7 +8203,7 @@ Drawer.displayName = "Drawer";
|
|
|
8176
8203
|
var Drawer_default = Drawer;
|
|
8177
8204
|
|
|
8178
8205
|
// src/components/Dropdown/Dropdown.tsx
|
|
8179
|
-
var
|
|
8206
|
+
var import_react20 = __toESM(require("react"), 1);
|
|
8180
8207
|
|
|
8181
8208
|
// src/tokens/hooks/Portal.tsx
|
|
8182
8209
|
var import_react_dom3 = __toESM(require("react-dom"), 1);
|
|
@@ -8188,13 +8215,13 @@ Portal.displayName = "Portal";
|
|
|
8188
8215
|
var Portal_default = Portal;
|
|
8189
8216
|
|
|
8190
8217
|
// src/tokens/hooks/useAutoPosition.ts
|
|
8191
|
-
var
|
|
8218
|
+
var import_react18 = __toESM(require("react"), 1);
|
|
8192
8219
|
var useAutoPosition = (triggerRef, popRef, enabled = true) => {
|
|
8193
|
-
const [position, setPosition] =
|
|
8220
|
+
const [position, setPosition] = import_react18.default.useState({
|
|
8194
8221
|
position: {},
|
|
8195
8222
|
direction: "bottom"
|
|
8196
8223
|
});
|
|
8197
|
-
const calculatePosition =
|
|
8224
|
+
const calculatePosition = import_react18.default.useCallback(() => {
|
|
8198
8225
|
if (!triggerRef.current || !popRef.current) return;
|
|
8199
8226
|
const triggerRect = triggerRef.current.getBoundingClientRect();
|
|
8200
8227
|
const popW = popRef.current.offsetWidth;
|
|
@@ -8221,13 +8248,13 @@ var useAutoPosition = (triggerRef, popRef, enabled = true) => {
|
|
|
8221
8248
|
direction
|
|
8222
8249
|
});
|
|
8223
8250
|
}, [triggerRef, popRef]);
|
|
8224
|
-
|
|
8251
|
+
import_react18.default.useLayoutEffect(() => {
|
|
8225
8252
|
if (!enabled) return;
|
|
8226
8253
|
calculatePosition();
|
|
8227
8254
|
const raf = requestAnimationFrame(calculatePosition);
|
|
8228
8255
|
return () => cancelAnimationFrame(raf);
|
|
8229
8256
|
}, [calculatePosition, enabled]);
|
|
8230
|
-
|
|
8257
|
+
import_react18.default.useEffect(() => {
|
|
8231
8258
|
if (!enabled || !popRef.current) return;
|
|
8232
8259
|
const observer = new ResizeObserver(() => {
|
|
8233
8260
|
calculatePosition();
|
|
@@ -8235,7 +8262,7 @@ var useAutoPosition = (triggerRef, popRef, enabled = true) => {
|
|
|
8235
8262
|
observer.observe(popRef.current);
|
|
8236
8263
|
return () => observer.disconnect();
|
|
8237
8264
|
}, [calculatePosition, enabled, popRef]);
|
|
8238
|
-
|
|
8265
|
+
import_react18.default.useEffect(() => {
|
|
8239
8266
|
if (!enabled) return;
|
|
8240
8267
|
window.addEventListener("resize", calculatePosition);
|
|
8241
8268
|
window.addEventListener("scroll", calculatePosition, true);
|
|
@@ -8249,9 +8276,9 @@ var useAutoPosition = (triggerRef, popRef, enabled = true) => {
|
|
|
8249
8276
|
var useAutoPosition_default = useAutoPosition;
|
|
8250
8277
|
|
|
8251
8278
|
// src/tokens/hooks/useClickOutside.ts
|
|
8252
|
-
var
|
|
8279
|
+
var import_react19 = __toESM(require("react"), 1);
|
|
8253
8280
|
var useClickOutside = (refs, handler, enabled = true) => {
|
|
8254
|
-
|
|
8281
|
+
import_react19.default.useEffect(() => {
|
|
8255
8282
|
if (!enabled) return;
|
|
8256
8283
|
const refArray = Array.isArray(refs) ? refs : [refs];
|
|
8257
8284
|
const listener = (event) => {
|
|
@@ -8277,14 +8304,14 @@ var useClickOutside_default = useClickOutside;
|
|
|
8277
8304
|
var import_jsx_runtime322 = require("react/jsx-runtime");
|
|
8278
8305
|
var Dropdown = (props) => {
|
|
8279
8306
|
const { items, children } = props;
|
|
8280
|
-
const [isOpen, setIsOpen] =
|
|
8281
|
-
const [mounted, setMounted] =
|
|
8282
|
-
const [visible, setVisible] =
|
|
8283
|
-
const triggerRef =
|
|
8284
|
-
const menuRef =
|
|
8307
|
+
const [isOpen, setIsOpen] = import_react20.default.useState(false);
|
|
8308
|
+
const [mounted, setMounted] = import_react20.default.useState(false);
|
|
8309
|
+
const [visible, setVisible] = import_react20.default.useState(false);
|
|
8310
|
+
const triggerRef = import_react20.default.useRef(null);
|
|
8311
|
+
const menuRef = import_react20.default.useRef(null);
|
|
8285
8312
|
const { position, direction } = useAutoPosition_default(triggerRef, menuRef, mounted);
|
|
8286
8313
|
useClickOutside_default([triggerRef, menuRef], () => setIsOpen(false), isOpen);
|
|
8287
|
-
|
|
8314
|
+
import_react20.default.useEffect(() => {
|
|
8288
8315
|
if (isOpen) {
|
|
8289
8316
|
setMounted(true);
|
|
8290
8317
|
const t2 = setTimeout(() => setVisible(true), 1);
|
|
@@ -8338,7 +8365,7 @@ Dropdown.displayName = "Dropdown";
|
|
|
8338
8365
|
var Dropdown_default = Dropdown;
|
|
8339
8366
|
|
|
8340
8367
|
// src/components/Editor/Editor.tsx
|
|
8341
|
-
var
|
|
8368
|
+
var import_react21 = __toESM(require("react"), 1);
|
|
8342
8369
|
var import_jsx_runtime323 = require("react/jsx-runtime");
|
|
8343
8370
|
var DEFAULT_TOOLBAR = [
|
|
8344
8371
|
"bold",
|
|
@@ -8446,21 +8473,21 @@ var Editor = (props) => {
|
|
|
8446
8473
|
onImageUpload,
|
|
8447
8474
|
minHeight = 200
|
|
8448
8475
|
} = props;
|
|
8449
|
-
const editorRef =
|
|
8450
|
-
const lastRangeRef =
|
|
8451
|
-
const composingRef =
|
|
8452
|
-
const [isFocused, setIsFocused] =
|
|
8453
|
-
const [isEmpty, setIsEmpty] =
|
|
8454
|
-
const [activeFormats, setActiveFormats] =
|
|
8455
|
-
const [slashOpen, setSlashOpen] =
|
|
8456
|
-
const [slashFilter, setSlashFilter] =
|
|
8457
|
-
const [slashIdx, setSlashIdx] =
|
|
8458
|
-
const [slashPos, setSlashPos] =
|
|
8459
|
-
const slashStartRangeRef =
|
|
8460
|
-
const [linkOpen, setLinkOpen] =
|
|
8461
|
-
const [linkValue, setLinkValue] =
|
|
8462
|
-
const [linkPos, setLinkPos] =
|
|
8463
|
-
|
|
8476
|
+
const editorRef = import_react21.default.useRef(null);
|
|
8477
|
+
const lastRangeRef = import_react21.default.useRef(null);
|
|
8478
|
+
const composingRef = import_react21.default.useRef(false);
|
|
8479
|
+
const [isFocused, setIsFocused] = import_react21.default.useState(false);
|
|
8480
|
+
const [isEmpty, setIsEmpty] = import_react21.default.useState(!value);
|
|
8481
|
+
const [activeFormats, setActiveFormats] = import_react21.default.useState(/* @__PURE__ */ new Set());
|
|
8482
|
+
const [slashOpen, setSlashOpen] = import_react21.default.useState(false);
|
|
8483
|
+
const [slashFilter, setSlashFilter] = import_react21.default.useState("");
|
|
8484
|
+
const [slashIdx, setSlashIdx] = import_react21.default.useState(0);
|
|
8485
|
+
const [slashPos, setSlashPos] = import_react21.default.useState({ top: 0, left: 0 });
|
|
8486
|
+
const slashStartRangeRef = import_react21.default.useRef(null);
|
|
8487
|
+
const [linkOpen, setLinkOpen] = import_react21.default.useState(false);
|
|
8488
|
+
const [linkValue, setLinkValue] = import_react21.default.useState("");
|
|
8489
|
+
const [linkPos, setLinkPos] = import_react21.default.useState({ top: 0, left: 0 });
|
|
8490
|
+
import_react21.default.useEffect(() => {
|
|
8464
8491
|
if (!editorRef.current) return;
|
|
8465
8492
|
if (editorRef.current.innerHTML !== value) {
|
|
8466
8493
|
editorRef.current.innerHTML = sanitizeHtml(value || "");
|
|
@@ -8574,7 +8601,7 @@ var Editor = (props) => {
|
|
|
8574
8601
|
setSlashIdx(0);
|
|
8575
8602
|
slashStartRangeRef.current = null;
|
|
8576
8603
|
};
|
|
8577
|
-
const filteredSlashItems =
|
|
8604
|
+
const filteredSlashItems = import_react21.default.useMemo(() => {
|
|
8578
8605
|
if (!slashFilter) return SLASH_ITEMS;
|
|
8579
8606
|
const f = slashFilter.toLowerCase();
|
|
8580
8607
|
return SLASH_ITEMS.filter((it) => it.label.toLowerCase().includes(f) || it.key.includes(f));
|
|
@@ -8967,7 +8994,7 @@ var EditorToolbar = ({ items, active, onAction }) => {
|
|
|
8967
8994
|
)) });
|
|
8968
8995
|
};
|
|
8969
8996
|
var SlashMenu = ({ position, items, activeIndex, onSelect, onClose }) => {
|
|
8970
|
-
|
|
8997
|
+
import_react21.default.useEffect(() => {
|
|
8971
8998
|
const handleClickOutside = (e) => {
|
|
8972
8999
|
const target = e.target;
|
|
8973
9000
|
const menu = document.querySelector(".lib-xplat-editor__slash-menu");
|
|
@@ -9001,8 +9028,8 @@ var SlashMenu = ({ position, items, activeIndex, onSelect, onClose }) => {
|
|
|
9001
9028
|
);
|
|
9002
9029
|
};
|
|
9003
9030
|
var LinkPopover = ({ position, value, onChange, onConfirm, onClose }) => {
|
|
9004
|
-
const inputRef =
|
|
9005
|
-
|
|
9031
|
+
const inputRef = import_react21.default.useRef(null);
|
|
9032
|
+
import_react21.default.useEffect(() => {
|
|
9006
9033
|
inputRef.current?.focus();
|
|
9007
9034
|
}, []);
|
|
9008
9035
|
return /* @__PURE__ */ (0, import_jsx_runtime323.jsxs)(
|
|
@@ -9060,7 +9087,7 @@ EmptyState.displayName = "EmptyState";
|
|
|
9060
9087
|
var EmptyState_default = EmptyState;
|
|
9061
9088
|
|
|
9062
9089
|
// src/components/FileUpload/FileUpload.tsx
|
|
9063
|
-
var
|
|
9090
|
+
var import_react22 = __toESM(require("react"), 1);
|
|
9064
9091
|
var import_jsx_runtime325 = require("react/jsx-runtime");
|
|
9065
9092
|
var FileUpload = (props) => {
|
|
9066
9093
|
const {
|
|
@@ -9069,10 +9096,11 @@ var FileUpload = (props) => {
|
|
|
9069
9096
|
maxSize,
|
|
9070
9097
|
onChange,
|
|
9071
9098
|
label = "\uD30C\uC77C\uC744 \uB4DC\uB798\uADF8\uD558\uAC70\uB098 \uD074\uB9AD\uD558\uC5EC \uC5C5\uB85C\uB4DC",
|
|
9072
|
-
description
|
|
9099
|
+
description,
|
|
9100
|
+
validations
|
|
9073
9101
|
} = props;
|
|
9074
|
-
const [isDragOver, setIsDragOver] =
|
|
9075
|
-
const inputRef =
|
|
9102
|
+
const [isDragOver, setIsDragOver] = import_react22.default.useState(false);
|
|
9103
|
+
const inputRef = import_react22.default.useRef(null);
|
|
9076
9104
|
const handleFiles = (fileList) => {
|
|
9077
9105
|
let files = Array.from(fileList);
|
|
9078
9106
|
if (maxSize) {
|
|
@@ -9102,7 +9130,7 @@ var FileUpload = (props) => {
|
|
|
9102
9130
|
handleFiles(e.target.files);
|
|
9103
9131
|
}
|
|
9104
9132
|
};
|
|
9105
|
-
|
|
9133
|
+
const control = /* @__PURE__ */ (0, import_jsx_runtime325.jsxs)(
|
|
9106
9134
|
"div",
|
|
9107
9135
|
{
|
|
9108
9136
|
className: clsx_default("lib-xplat-file-upload", { "drag-over": isDragOver }),
|
|
@@ -9118,7 +9146,8 @@ var FileUpload = (props) => {
|
|
|
9118
9146
|
type: "file",
|
|
9119
9147
|
accept,
|
|
9120
9148
|
multiple,
|
|
9121
|
-
onChange: handleChange
|
|
9149
|
+
onChange: handleChange,
|
|
9150
|
+
"aria-invalid": hasError(validations) || void 0
|
|
9122
9151
|
}
|
|
9123
9152
|
),
|
|
9124
9153
|
/* @__PURE__ */ (0, import_jsx_runtime325.jsx)("div", { className: "upload-icon", children: /* @__PURE__ */ (0, import_jsx_runtime325.jsx)(UploadIcon_default, {}) }),
|
|
@@ -9127,15 +9156,16 @@ var FileUpload = (props) => {
|
|
|
9127
9156
|
]
|
|
9128
9157
|
}
|
|
9129
9158
|
);
|
|
9159
|
+
return /* @__PURE__ */ (0, import_jsx_runtime325.jsx)(Field, { validations, children: control });
|
|
9130
9160
|
};
|
|
9131
9161
|
FileUpload.displayName = "FileUpload";
|
|
9132
9162
|
var FileUpload_default = FileUpload;
|
|
9133
9163
|
|
|
9134
9164
|
// src/components/HtmlTypeWriter/HtmlTypeWriter.tsx
|
|
9135
|
-
var
|
|
9165
|
+
var import_react24 = __toESM(require("react"), 1);
|
|
9136
9166
|
|
|
9137
9167
|
// src/components/HtmlTypeWriter/utils.ts
|
|
9138
|
-
var
|
|
9168
|
+
var import_react23 = __toESM(require("react"), 1);
|
|
9139
9169
|
var voidTags = /* @__PURE__ */ new Set([
|
|
9140
9170
|
"br",
|
|
9141
9171
|
"img",
|
|
@@ -9203,15 +9233,15 @@ var convertNodeToReactWithRange = (node, typedLen, rangeMap) => {
|
|
|
9203
9233
|
props[attr.name] = attr.value;
|
|
9204
9234
|
});
|
|
9205
9235
|
if (voidTags.has(tag)) {
|
|
9206
|
-
return
|
|
9236
|
+
return import_react23.default.createElement(tag, props);
|
|
9207
9237
|
}
|
|
9208
9238
|
const children = Array.from(element.childNodes).map((child) => convertNodeToReactWithRange(child, typedLen, rangeMap)).filter((n) => n != null);
|
|
9209
|
-
return
|
|
9239
|
+
return import_react23.default.createElement(tag, props, ...children);
|
|
9210
9240
|
};
|
|
9211
9241
|
var htmlToReactProgressive = (root, typedLen, rangeMap) => {
|
|
9212
9242
|
const nodes = Array.from(root.childNodes).map((child, idx) => {
|
|
9213
9243
|
const node = convertNodeToReactWithRange(child, typedLen, rangeMap);
|
|
9214
|
-
return node == null ? null :
|
|
9244
|
+
return node == null ? null : import_react23.default.createElement(import_react23.default.Fragment, { key: idx }, node);
|
|
9215
9245
|
}).filter(Boolean);
|
|
9216
9246
|
return nodes.length === 0 ? null : nodes;
|
|
9217
9247
|
};
|
|
@@ -9224,20 +9254,20 @@ var HtmlTypeWriter = ({
|
|
|
9224
9254
|
onDone,
|
|
9225
9255
|
onChange
|
|
9226
9256
|
}) => {
|
|
9227
|
-
const [typedLen, setTypedLen] =
|
|
9228
|
-
const doneCalledRef =
|
|
9229
|
-
const { doc, rangeMap, totalLength } =
|
|
9257
|
+
const [typedLen, setTypedLen] = import_react24.default.useState(0);
|
|
9258
|
+
const doneCalledRef = import_react24.default.useRef(false);
|
|
9259
|
+
const { doc, rangeMap, totalLength } = import_react24.default.useMemo(() => {
|
|
9230
9260
|
if (typeof window === "undefined") return { doc: null, rangeMap: /* @__PURE__ */ new Map(), totalLength: 0 };
|
|
9231
9261
|
const decoded = decodeHtmlEntities(html);
|
|
9232
9262
|
const doc2 = new DOMParser().parseFromString(decoded, "text/html");
|
|
9233
9263
|
const { rangeMap: rangeMap2, totalLength: totalLength2 } = buildRangeMap(doc2.body);
|
|
9234
9264
|
return { doc: doc2, rangeMap: rangeMap2, totalLength: totalLength2 };
|
|
9235
9265
|
}, [html]);
|
|
9236
|
-
|
|
9266
|
+
import_react24.default.useEffect(() => {
|
|
9237
9267
|
setTypedLen(0);
|
|
9238
9268
|
doneCalledRef.current = false;
|
|
9239
9269
|
}, [html]);
|
|
9240
|
-
|
|
9270
|
+
import_react24.default.useEffect(() => {
|
|
9241
9271
|
if (!totalLength) return;
|
|
9242
9272
|
if (typedLen >= totalLength) return;
|
|
9243
9273
|
const timer = window.setInterval(() => {
|
|
@@ -9245,18 +9275,18 @@ var HtmlTypeWriter = ({
|
|
|
9245
9275
|
}, duration);
|
|
9246
9276
|
return () => window.clearInterval(timer);
|
|
9247
9277
|
}, [typedLen, totalLength, duration]);
|
|
9248
|
-
|
|
9278
|
+
import_react24.default.useEffect(() => {
|
|
9249
9279
|
if (typedLen > 0 && typedLen < totalLength) {
|
|
9250
9280
|
onChange?.();
|
|
9251
9281
|
}
|
|
9252
9282
|
}, [typedLen, totalLength, onChange]);
|
|
9253
|
-
|
|
9283
|
+
import_react24.default.useEffect(() => {
|
|
9254
9284
|
if (typedLen === totalLength && totalLength > 0 && !doneCalledRef.current) {
|
|
9255
9285
|
doneCalledRef.current = true;
|
|
9256
9286
|
onDone?.();
|
|
9257
9287
|
}
|
|
9258
9288
|
}, [typedLen, totalLength, onDone]);
|
|
9259
|
-
const parsed =
|
|
9289
|
+
const parsed = import_react24.default.useMemo(
|
|
9260
9290
|
() => doc ? htmlToReactProgressive(doc.body, typedLen, rangeMap) : null,
|
|
9261
9291
|
[doc, typedLen, rangeMap]
|
|
9262
9292
|
);
|
|
@@ -9266,12 +9296,12 @@ HtmlTypeWriter.displayName = "HtmlTypeWriter";
|
|
|
9266
9296
|
var HtmlTypeWriter_default = HtmlTypeWriter;
|
|
9267
9297
|
|
|
9268
9298
|
// src/components/ImageSelector/ImageSelector.tsx
|
|
9269
|
-
var
|
|
9299
|
+
var import_react25 = __toESM(require("react"), 1);
|
|
9270
9300
|
var import_jsx_runtime327 = require("react/jsx-runtime");
|
|
9271
9301
|
var ImageSelector = (props) => {
|
|
9272
|
-
const { value, label, onChange } = props;
|
|
9273
|
-
const [previewUrl, setPreviewUrl] =
|
|
9274
|
-
|
|
9302
|
+
const { value, label, onChange, validations } = props;
|
|
9303
|
+
const [previewUrl, setPreviewUrl] = import_react25.default.useState();
|
|
9304
|
+
import_react25.default.useEffect(() => {
|
|
9275
9305
|
if (!value) {
|
|
9276
9306
|
setPreviewUrl(void 0);
|
|
9277
9307
|
return;
|
|
@@ -9280,7 +9310,7 @@ var ImageSelector = (props) => {
|
|
|
9280
9310
|
setPreviewUrl(url);
|
|
9281
9311
|
return () => URL.revokeObjectURL(url);
|
|
9282
9312
|
}, [value]);
|
|
9283
|
-
const inputRef =
|
|
9313
|
+
const inputRef = import_react25.default.useRef(null);
|
|
9284
9314
|
const handleFileChange = (e) => {
|
|
9285
9315
|
const selectedFile = e.target.files?.[0];
|
|
9286
9316
|
if (selectedFile) {
|
|
@@ -9293,7 +9323,7 @@ var ImageSelector = (props) => {
|
|
|
9293
9323
|
const handleOpenFileDialog = () => {
|
|
9294
9324
|
inputRef.current?.click();
|
|
9295
9325
|
};
|
|
9296
|
-
|
|
9326
|
+
const control = /* @__PURE__ */ (0, import_jsx_runtime327.jsxs)("div", { className: `lib-xplat-imageselector${value ? "" : " none-value"}`, children: [
|
|
9297
9327
|
/* @__PURE__ */ (0, import_jsx_runtime327.jsx)(
|
|
9298
9328
|
"input",
|
|
9299
9329
|
{
|
|
@@ -9301,7 +9331,8 @@ var ImageSelector = (props) => {
|
|
|
9301
9331
|
accept: "image/*",
|
|
9302
9332
|
id: "image-input",
|
|
9303
9333
|
onChange: handleFileChange,
|
|
9304
|
-
ref: inputRef
|
|
9334
|
+
ref: inputRef,
|
|
9335
|
+
"aria-invalid": hasError(validations) || void 0
|
|
9305
9336
|
}
|
|
9306
9337
|
),
|
|
9307
9338
|
value && /* @__PURE__ */ (0, import_jsx_runtime327.jsxs)("div", { className: "action-bar", children: [
|
|
@@ -9313,6 +9344,7 @@ var ImageSelector = (props) => {
|
|
|
9313
9344
|
/* @__PURE__ */ (0, import_jsx_runtime327.jsx)("div", { className: "label", children: label || "\uC774\uBBF8\uC9C0 \uCD94\uAC00\uD558\uAE30" })
|
|
9314
9345
|
] }) })
|
|
9315
9346
|
] });
|
|
9347
|
+
return /* @__PURE__ */ (0, import_jsx_runtime327.jsx)(Field, { validations, children: control });
|
|
9316
9348
|
};
|
|
9317
9349
|
ImageSelector.displayName = "ImageSelector";
|
|
9318
9350
|
var ImageSelector_default = ImageSelector;
|
|
@@ -9459,17 +9491,17 @@ Pagination.displayName = "Pagination";
|
|
|
9459
9491
|
var Pagination_default = Pagination;
|
|
9460
9492
|
|
|
9461
9493
|
// src/components/PopOver/PopOver.tsx
|
|
9462
|
-
var
|
|
9494
|
+
var import_react26 = __toESM(require("react"), 1);
|
|
9463
9495
|
var import_jsx_runtime332 = require("react/jsx-runtime");
|
|
9464
9496
|
var PopOver = (props) => {
|
|
9465
9497
|
const { children, isOpen, onClose, PopOverEl } = props;
|
|
9466
|
-
const popRef =
|
|
9467
|
-
const triggerRef =
|
|
9468
|
-
const [localOpen, setLocalOpen] =
|
|
9469
|
-
const [eventTrigger, setEventTrigger] =
|
|
9498
|
+
const popRef = import_react26.default.useRef(null);
|
|
9499
|
+
const triggerRef = import_react26.default.useRef(null);
|
|
9500
|
+
const [localOpen, setLocalOpen] = import_react26.default.useState(false);
|
|
9501
|
+
const [eventTrigger, setEventTrigger] = import_react26.default.useState(false);
|
|
9470
9502
|
useClickOutside_default([popRef, triggerRef], onClose, isOpen);
|
|
9471
9503
|
const position = useAutoPosition_default(triggerRef, popRef, localOpen);
|
|
9472
|
-
|
|
9504
|
+
import_react26.default.useEffect(() => {
|
|
9473
9505
|
if (isOpen) {
|
|
9474
9506
|
setLocalOpen(isOpen);
|
|
9475
9507
|
setTimeout(() => {
|
|
@@ -9553,12 +9585,12 @@ Progress.displayName = "Progress";
|
|
|
9553
9585
|
var Progress_default = Progress;
|
|
9554
9586
|
|
|
9555
9587
|
// src/components/Radio/RadioGroupContext.tsx
|
|
9556
|
-
var
|
|
9557
|
-
var RadioGroupContext =
|
|
9588
|
+
var import_react27 = __toESM(require("react"), 1);
|
|
9589
|
+
var RadioGroupContext = import_react27.default.createContext(
|
|
9558
9590
|
null
|
|
9559
9591
|
);
|
|
9560
9592
|
var useRadioGroupContext = () => {
|
|
9561
|
-
return
|
|
9593
|
+
return import_react27.default.useContext(RadioGroupContext);
|
|
9562
9594
|
};
|
|
9563
9595
|
var RadioGroupContext_default = RadioGroupContext;
|
|
9564
9596
|
|
|
@@ -9571,6 +9603,7 @@ var Radio = (props) => {
|
|
|
9571
9603
|
value,
|
|
9572
9604
|
size: sizeProp,
|
|
9573
9605
|
type = "brand",
|
|
9606
|
+
validations,
|
|
9574
9607
|
...rest
|
|
9575
9608
|
} = props;
|
|
9576
9609
|
const context = useRadioGroupContext();
|
|
@@ -9582,7 +9615,7 @@ var Radio = (props) => {
|
|
|
9582
9615
|
value,
|
|
9583
9616
|
onChange: rest.onChange
|
|
9584
9617
|
};
|
|
9585
|
-
|
|
9618
|
+
const control = /* @__PURE__ */ (0, import_jsx_runtime334.jsxs)(
|
|
9586
9619
|
"label",
|
|
9587
9620
|
{
|
|
9588
9621
|
className: clsx_default(
|
|
@@ -9593,7 +9626,16 @@ var Radio = (props) => {
|
|
|
9593
9626
|
className
|
|
9594
9627
|
),
|
|
9595
9628
|
children: [
|
|
9596
|
-
/* @__PURE__ */ (0, import_jsx_runtime334.jsx)(
|
|
9629
|
+
/* @__PURE__ */ (0, import_jsx_runtime334.jsx)(
|
|
9630
|
+
"input",
|
|
9631
|
+
{
|
|
9632
|
+
...rest,
|
|
9633
|
+
...inputProps,
|
|
9634
|
+
checked: localChecked,
|
|
9635
|
+
type: "radio",
|
|
9636
|
+
"aria-invalid": hasError(validations) || void 0
|
|
9637
|
+
}
|
|
9638
|
+
),
|
|
9597
9639
|
/* @__PURE__ */ (0, import_jsx_runtime334.jsx)(
|
|
9598
9640
|
"div",
|
|
9599
9641
|
{
|
|
@@ -9608,6 +9650,7 @@ var Radio = (props) => {
|
|
|
9608
9650
|
]
|
|
9609
9651
|
}
|
|
9610
9652
|
);
|
|
9653
|
+
return /* @__PURE__ */ (0, import_jsx_runtime334.jsx)(Field, { validations, children: control });
|
|
9611
9654
|
};
|
|
9612
9655
|
Radio.displayName = "Radio";
|
|
9613
9656
|
var Radio_default = Radio;
|
|
@@ -9622,19 +9665,19 @@ RadioGroup.displayName = "RadioGroup";
|
|
|
9622
9665
|
var RadioGroup_default = RadioGroup;
|
|
9623
9666
|
|
|
9624
9667
|
// src/components/Select/Select.tsx
|
|
9625
|
-
var
|
|
9668
|
+
var import_react30 = __toESM(require("react"), 1);
|
|
9626
9669
|
|
|
9627
9670
|
// src/components/Select/context.ts
|
|
9628
|
-
var
|
|
9629
|
-
var SelectContext =
|
|
9671
|
+
var import_react28 = __toESM(require("react"), 1);
|
|
9672
|
+
var SelectContext = import_react28.default.createContext(null);
|
|
9630
9673
|
var context_default = SelectContext;
|
|
9631
9674
|
|
|
9632
9675
|
// src/components/Select/SelectItem.tsx
|
|
9633
|
-
var
|
|
9676
|
+
var import_react29 = __toESM(require("react"), 1);
|
|
9634
9677
|
var import_jsx_runtime336 = require("react/jsx-runtime");
|
|
9635
9678
|
var SelectItem = (props) => {
|
|
9636
9679
|
const { children, value, onClick, disabled = false } = props;
|
|
9637
|
-
const ctx =
|
|
9680
|
+
const ctx = import_react29.default.useContext(context_default);
|
|
9638
9681
|
const handleClick = (e) => {
|
|
9639
9682
|
e.preventDefault();
|
|
9640
9683
|
e.stopPropagation();
|
|
@@ -9675,30 +9718,31 @@ var SelectRoot = (props) => {
|
|
|
9675
9718
|
children,
|
|
9676
9719
|
disabled = false,
|
|
9677
9720
|
error = false,
|
|
9721
|
+
validations,
|
|
9678
9722
|
size = "md"
|
|
9679
9723
|
} = props;
|
|
9680
|
-
const itemChildren =
|
|
9681
|
-
(child) =>
|
|
9724
|
+
const itemChildren = import_react30.default.Children.toArray(children).filter(
|
|
9725
|
+
(child) => import_react30.default.isValidElement(child) && child.type === SelectItem_default
|
|
9682
9726
|
);
|
|
9683
9727
|
const isControlled = valueProp !== void 0;
|
|
9684
|
-
const [isOpen, setOpen] =
|
|
9685
|
-
const [uncontrolledLabel, setUncontrolledLabel] =
|
|
9686
|
-
const [uncontrolledValue, setUncontrolledValue] =
|
|
9687
|
-
const controlledLabel =
|
|
9728
|
+
const [isOpen, setOpen] = import_react30.default.useState(false);
|
|
9729
|
+
const [uncontrolledLabel, setUncontrolledLabel] = import_react30.default.useState(null);
|
|
9730
|
+
const [uncontrolledValue, setUncontrolledValue] = import_react30.default.useState(void 0);
|
|
9731
|
+
const controlledLabel = import_react30.default.useMemo(() => {
|
|
9688
9732
|
if (!isControlled) return null;
|
|
9689
9733
|
const match = itemChildren.find((child) => child.props.value === valueProp);
|
|
9690
9734
|
return match ? match.props.children : null;
|
|
9691
9735
|
}, [isControlled, valueProp, itemChildren]);
|
|
9692
9736
|
const selectedLabel = isControlled ? controlledLabel : uncontrolledLabel;
|
|
9693
9737
|
const selectedValue = isControlled ? valueProp : uncontrolledValue;
|
|
9694
|
-
const triggerRef =
|
|
9695
|
-
const contentRef =
|
|
9696
|
-
const [mounted, setMounted] =
|
|
9697
|
-
const [visible, setVisible] =
|
|
9698
|
-
|
|
9738
|
+
const triggerRef = import_react30.default.useRef(null);
|
|
9739
|
+
const contentRef = import_react30.default.useRef(null);
|
|
9740
|
+
const [mounted, setMounted] = import_react30.default.useState(false);
|
|
9741
|
+
const [visible, setVisible] = import_react30.default.useState(false);
|
|
9742
|
+
import_react30.default.useEffect(() => {
|
|
9699
9743
|
if (disabled && isOpen) setOpen(false);
|
|
9700
9744
|
}, [disabled, isOpen]);
|
|
9701
|
-
|
|
9745
|
+
import_react30.default.useEffect(() => {
|
|
9702
9746
|
if (isOpen) {
|
|
9703
9747
|
setMounted(true);
|
|
9704
9748
|
const t2 = setTimeout(() => setVisible(true), 1);
|
|
@@ -9708,12 +9752,12 @@ var SelectRoot = (props) => {
|
|
|
9708
9752
|
const t = setTimeout(() => setMounted(false), ANIMATION_DURATION_MS3);
|
|
9709
9753
|
return () => clearTimeout(t);
|
|
9710
9754
|
}, [isOpen]);
|
|
9711
|
-
const open =
|
|
9712
|
-
const close =
|
|
9713
|
-
const toggle =
|
|
9755
|
+
const open = import_react30.default.useCallback(() => setOpen(true), []);
|
|
9756
|
+
const close = import_react30.default.useCallback(() => setOpen(false), []);
|
|
9757
|
+
const toggle = import_react30.default.useCallback(() => setOpen((prev) => !prev), []);
|
|
9714
9758
|
useClickOutside_default([contentRef, triggerRef], close, isOpen);
|
|
9715
9759
|
const position = useAutoPosition_default(triggerRef, contentRef, mounted);
|
|
9716
|
-
const setSelected =
|
|
9760
|
+
const setSelected = import_react30.default.useCallback(
|
|
9717
9761
|
(label, itemValue) => {
|
|
9718
9762
|
if (!isControlled) {
|
|
9719
9763
|
setUncontrolledLabel(label);
|
|
@@ -9723,7 +9767,7 @@ var SelectRoot = (props) => {
|
|
|
9723
9767
|
},
|
|
9724
9768
|
[isControlled, onChange]
|
|
9725
9769
|
);
|
|
9726
|
-
const ctxValue =
|
|
9770
|
+
const ctxValue = import_react30.default.useMemo(
|
|
9727
9771
|
() => ({
|
|
9728
9772
|
isOpen,
|
|
9729
9773
|
mounted,
|
|
@@ -9745,14 +9789,14 @@ var SelectRoot = (props) => {
|
|
|
9745
9789
|
if (disabled) return;
|
|
9746
9790
|
toggle();
|
|
9747
9791
|
};
|
|
9748
|
-
|
|
9792
|
+
const control = /* @__PURE__ */ (0, import_jsx_runtime337.jsx)(context_default.Provider, { value: ctxValue, children: /* @__PURE__ */ (0, import_jsx_runtime337.jsxs)(
|
|
9749
9793
|
"div",
|
|
9750
9794
|
{
|
|
9751
9795
|
className: clsx_default(
|
|
9752
9796
|
"lib-xplat-select",
|
|
9753
9797
|
size,
|
|
9754
9798
|
disabled && "disabled",
|
|
9755
|
-
error && "error",
|
|
9799
|
+
(error || hasError(validations)) && "error",
|
|
9756
9800
|
mounted && "is-open"
|
|
9757
9801
|
),
|
|
9758
9802
|
children: [
|
|
@@ -9763,14 +9807,14 @@ var SelectRoot = (props) => {
|
|
|
9763
9807
|
className: clsx_default(
|
|
9764
9808
|
"select-trigger",
|
|
9765
9809
|
disabled && "disabled",
|
|
9766
|
-
error && "error"
|
|
9810
|
+
(error || hasError(validations)) && "error"
|
|
9767
9811
|
),
|
|
9768
9812
|
onClick: handleTriggerClick,
|
|
9769
9813
|
role: "combobox",
|
|
9770
9814
|
"aria-expanded": isOpen,
|
|
9771
9815
|
"aria-haspopup": "listbox",
|
|
9772
9816
|
"aria-disabled": disabled,
|
|
9773
|
-
"aria-invalid": error,
|
|
9817
|
+
"aria-invalid": error || hasError(validations) || void 0,
|
|
9774
9818
|
tabIndex: disabled ? -1 : 0,
|
|
9775
9819
|
onKeyDown: (e) => {
|
|
9776
9820
|
if (disabled) return;
|
|
@@ -9814,6 +9858,7 @@ var SelectRoot = (props) => {
|
|
|
9814
9858
|
]
|
|
9815
9859
|
}
|
|
9816
9860
|
) });
|
|
9861
|
+
return /* @__PURE__ */ (0, import_jsx_runtime337.jsx)(Field, { validations, children: control });
|
|
9817
9862
|
};
|
|
9818
9863
|
SelectRoot.displayName = "Select";
|
|
9819
9864
|
var Select = Object.assign(SelectRoot, {
|
|
@@ -9915,7 +9960,7 @@ Steps.displayName = "Steps";
|
|
|
9915
9960
|
var Steps_default = Steps;
|
|
9916
9961
|
|
|
9917
9962
|
// src/components/Swiper/Swiper.tsx
|
|
9918
|
-
var
|
|
9963
|
+
var import_react31 = __toESM(require("react"), 1);
|
|
9919
9964
|
var import_jsx_runtime341 = require("react/jsx-runtime");
|
|
9920
9965
|
var Swiper = (props) => {
|
|
9921
9966
|
const {
|
|
@@ -9940,26 +9985,26 @@ var Swiper = (props) => {
|
|
|
9940
9985
|
const maxIndex = Math.max(0, totalSlides - viewItemCount);
|
|
9941
9986
|
const useLoop = loop && canSlide;
|
|
9942
9987
|
const cloneCount = useLoop ? totalSlides : 0;
|
|
9943
|
-
const extendedItems =
|
|
9988
|
+
const extendedItems = import_react31.default.useMemo(() => {
|
|
9944
9989
|
if (!useLoop) return items;
|
|
9945
9990
|
return [...items, ...items, ...items];
|
|
9946
9991
|
}, [items, useLoop]);
|
|
9947
9992
|
const initialIdx = Math.max(0, Math.min(indexProp ?? 0, maxIndex));
|
|
9948
|
-
const [innerIndex, setInnerIndex] =
|
|
9993
|
+
const [innerIndex, setInnerIndex] = import_react31.default.useState(
|
|
9949
9994
|
useLoop ? cloneCount + initialIdx : initialIdx
|
|
9950
9995
|
);
|
|
9951
|
-
const [isDragging, setIsDragging] =
|
|
9952
|
-
const [dragOffset, setDragOffset] =
|
|
9953
|
-
const [animated, setAnimated] =
|
|
9954
|
-
const [containerWidth, setContainerWidth] =
|
|
9955
|
-
const containerRef =
|
|
9956
|
-
const startXRef =
|
|
9957
|
-
const startTimeRef =
|
|
9958
|
-
const autoplayTimerRef =
|
|
9959
|
-
const resumeTimeoutRef =
|
|
9960
|
-
const [paused, setPaused] =
|
|
9961
|
-
const initializedRef =
|
|
9962
|
-
|
|
9996
|
+
const [isDragging, setIsDragging] = import_react31.default.useState(false);
|
|
9997
|
+
const [dragOffset, setDragOffset] = import_react31.default.useState(0);
|
|
9998
|
+
const [animated, setAnimated] = import_react31.default.useState(false);
|
|
9999
|
+
const [containerWidth, setContainerWidth] = import_react31.default.useState(0);
|
|
10000
|
+
const containerRef = import_react31.default.useRef(null);
|
|
10001
|
+
const startXRef = import_react31.default.useRef(0);
|
|
10002
|
+
const startTimeRef = import_react31.default.useRef(0);
|
|
10003
|
+
const autoplayTimerRef = import_react31.default.useRef(null);
|
|
10004
|
+
const resumeTimeoutRef = import_react31.default.useRef(null);
|
|
10005
|
+
const [paused, setPaused] = import_react31.default.useState(false);
|
|
10006
|
+
const initializedRef = import_react31.default.useRef(false);
|
|
10007
|
+
import_react31.default.useEffect(() => {
|
|
9963
10008
|
const el = containerRef.current;
|
|
9964
10009
|
if (!el) return;
|
|
9965
10010
|
const ro = new ResizeObserver((entries) => {
|
|
@@ -9982,7 +10027,7 @@ var Swiper = (props) => {
|
|
|
9982
10027
|
return ((inner - cloneCount) % totalSlides + totalSlides) % totalSlides;
|
|
9983
10028
|
};
|
|
9984
10029
|
const realIndex = getRealIndex(innerIndex);
|
|
9985
|
-
const moveToInner =
|
|
10030
|
+
const moveToInner = import_react31.default.useCallback(
|
|
9986
10031
|
(idx, withAnim = true) => {
|
|
9987
10032
|
if (!useLoop) {
|
|
9988
10033
|
setAnimated(withAnim);
|
|
@@ -10010,7 +10055,7 @@ var Swiper = (props) => {
|
|
|
10010
10055
|
},
|
|
10011
10056
|
[useLoop, cloneCount, totalSlides]
|
|
10012
10057
|
);
|
|
10013
|
-
const handleTransitionEnd =
|
|
10058
|
+
const handleTransitionEnd = import_react31.default.useCallback(() => {
|
|
10014
10059
|
if (!useLoop) return;
|
|
10015
10060
|
const real = getRealIndex(innerIndex);
|
|
10016
10061
|
const canonical = cloneCount + real;
|
|
@@ -10020,7 +10065,7 @@ var Swiper = (props) => {
|
|
|
10020
10065
|
}
|
|
10021
10066
|
onChange?.(Math.min(real, maxIndex));
|
|
10022
10067
|
}, [useLoop, innerIndex, cloneCount, totalSlides, maxIndex, onChange]);
|
|
10023
|
-
const slideTo =
|
|
10068
|
+
const slideTo = import_react31.default.useCallback(
|
|
10024
10069
|
(logicalIndex) => {
|
|
10025
10070
|
if (!canSlide) return;
|
|
10026
10071
|
const clamped = useLoop ? logicalIndex : Math.max(0, Math.min(logicalIndex, maxIndex));
|
|
@@ -10030,7 +10075,7 @@ var Swiper = (props) => {
|
|
|
10030
10075
|
},
|
|
10031
10076
|
[canSlide, useLoop, cloneCount, maxIndex, onChange, moveToInner]
|
|
10032
10077
|
);
|
|
10033
|
-
const slideNext =
|
|
10078
|
+
const slideNext = import_react31.default.useCallback(() => {
|
|
10034
10079
|
if (!canSlide) return;
|
|
10035
10080
|
const nextInner = innerIndex + slideBy;
|
|
10036
10081
|
if (useLoop) {
|
|
@@ -10039,7 +10084,7 @@ var Swiper = (props) => {
|
|
|
10039
10084
|
moveToInner(Math.min(nextInner, maxIndex), true);
|
|
10040
10085
|
}
|
|
10041
10086
|
}, [canSlide, useLoop, innerIndex, slideBy, maxIndex, moveToInner]);
|
|
10042
|
-
const slidePrev =
|
|
10087
|
+
const slidePrev = import_react31.default.useCallback(() => {
|
|
10043
10088
|
if (!canSlide) return;
|
|
10044
10089
|
const prevInner = innerIndex - slideBy;
|
|
10045
10090
|
if (useLoop) {
|
|
@@ -10048,7 +10093,7 @@ var Swiper = (props) => {
|
|
|
10048
10093
|
moveToInner(Math.max(prevInner, 0), true);
|
|
10049
10094
|
}
|
|
10050
10095
|
}, [canSlide, useLoop, innerIndex, slideBy, moveToInner]);
|
|
10051
|
-
|
|
10096
|
+
import_react31.default.useEffect(() => {
|
|
10052
10097
|
if (indexProp === void 0) return;
|
|
10053
10098
|
const clamped = Math.max(0, Math.min(indexProp, maxIndex));
|
|
10054
10099
|
const target = useLoop ? cloneCount + clamped : clamped;
|
|
@@ -10056,12 +10101,12 @@ var Swiper = (props) => {
|
|
|
10056
10101
|
moveToInner(target, true);
|
|
10057
10102
|
}
|
|
10058
10103
|
}, [indexProp]);
|
|
10059
|
-
|
|
10104
|
+
import_react31.default.useImperativeHandle(swiperRef, () => ({
|
|
10060
10105
|
slidePrev,
|
|
10061
10106
|
slideNext,
|
|
10062
10107
|
slideTo
|
|
10063
10108
|
}));
|
|
10064
|
-
|
|
10109
|
+
import_react31.default.useEffect(() => {
|
|
10065
10110
|
if (!auto || !canSlide || paused) return;
|
|
10066
10111
|
autoplayTimerRef.current = setInterval(slideNext, autoplayDelay);
|
|
10067
10112
|
return () => {
|
|
@@ -10087,7 +10132,7 @@ var Swiper = (props) => {
|
|
|
10087
10132
|
resumeTimeoutRef.current = null;
|
|
10088
10133
|
}, pauseOnInteraction);
|
|
10089
10134
|
};
|
|
10090
|
-
|
|
10135
|
+
import_react31.default.useEffect(() => {
|
|
10091
10136
|
return () => {
|
|
10092
10137
|
if (resumeTimeoutRef.current) clearTimeout(resumeTimeoutRef.current);
|
|
10093
10138
|
};
|
|
@@ -10105,7 +10150,7 @@ var Swiper = (props) => {
|
|
|
10105
10150
|
startXRef.current = getClientX(e);
|
|
10106
10151
|
startTimeRef.current = Date.now();
|
|
10107
10152
|
};
|
|
10108
|
-
|
|
10153
|
+
import_react31.default.useEffect(() => {
|
|
10109
10154
|
if (!isDragging) return;
|
|
10110
10155
|
const handleMove = (e) => {
|
|
10111
10156
|
setDragOffset(getClientX(e) - startXRef.current);
|
|
@@ -10144,7 +10189,7 @@ var Swiper = (props) => {
|
|
|
10144
10189
|
}, [isDragging, dragOffset, innerIndex, useLoop, maxIndex, slideStep, moveToInner]);
|
|
10145
10190
|
const slideWidthPercent = 100 / viewItemCount;
|
|
10146
10191
|
const gapAdjust = spaceBetween * (viewItemCount - 1) / viewItemCount;
|
|
10147
|
-
const slideElements =
|
|
10192
|
+
const slideElements = import_react31.default.useMemo(
|
|
10148
10193
|
() => extendedItems.map((item, idx) => /* @__PURE__ */ (0, import_jsx_runtime341.jsx)(
|
|
10149
10194
|
"div",
|
|
10150
10195
|
{
|
|
@@ -10218,7 +10263,7 @@ Swiper.displayName = "Swiper";
|
|
|
10218
10263
|
var Swiper_default = Swiper;
|
|
10219
10264
|
|
|
10220
10265
|
// src/components/Switch/Switch.tsx
|
|
10221
|
-
var
|
|
10266
|
+
var import_react32 = __toESM(require("react"), 1);
|
|
10222
10267
|
var import_jsx_runtime342 = require("react/jsx-runtime");
|
|
10223
10268
|
var KNOB_TRANSITION_MS = 250;
|
|
10224
10269
|
var Switch = (props) => {
|
|
@@ -10227,11 +10272,12 @@ var Switch = (props) => {
|
|
|
10227
10272
|
size = "md",
|
|
10228
10273
|
type = "brand",
|
|
10229
10274
|
disabled,
|
|
10230
|
-
onChange
|
|
10275
|
+
onChange,
|
|
10276
|
+
validations
|
|
10231
10277
|
} = props;
|
|
10232
|
-
const [isAnimating, setIsAnimating] =
|
|
10233
|
-
const timeoutRef =
|
|
10234
|
-
|
|
10278
|
+
const [isAnimating, setIsAnimating] = import_react32.default.useState(false);
|
|
10279
|
+
const timeoutRef = import_react32.default.useRef(null);
|
|
10280
|
+
import_react32.default.useEffect(() => {
|
|
10235
10281
|
return () => {
|
|
10236
10282
|
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
10237
10283
|
};
|
|
@@ -10246,7 +10292,7 @@ var Switch = (props) => {
|
|
|
10246
10292
|
timeoutRef.current = null;
|
|
10247
10293
|
}, KNOB_TRANSITION_MS);
|
|
10248
10294
|
};
|
|
10249
|
-
|
|
10295
|
+
const control = /* @__PURE__ */ (0, import_jsx_runtime342.jsx)(
|
|
10250
10296
|
"div",
|
|
10251
10297
|
{
|
|
10252
10298
|
className: clsx_default(
|
|
@@ -10258,19 +10304,21 @@ var Switch = (props) => {
|
|
|
10258
10304
|
isAnimating && "animating"
|
|
10259
10305
|
),
|
|
10260
10306
|
onClick: handleClick,
|
|
10307
|
+
"aria-invalid": hasError(validations) || void 0,
|
|
10261
10308
|
"aria-disabled": disabled || isAnimating,
|
|
10262
10309
|
children: /* @__PURE__ */ (0, import_jsx_runtime342.jsx)("div", { className: clsx_default("knob", value ? "checked" : void 0) })
|
|
10263
10310
|
}
|
|
10264
10311
|
);
|
|
10312
|
+
return /* @__PURE__ */ (0, import_jsx_runtime342.jsx)(Field, { validations, children: control });
|
|
10265
10313
|
};
|
|
10266
10314
|
Switch.displayName = "Switch";
|
|
10267
10315
|
var Switch_default = Switch;
|
|
10268
10316
|
|
|
10269
10317
|
// src/components/Table/TableContext.tsx
|
|
10270
|
-
var
|
|
10271
|
-
var TableContext =
|
|
10318
|
+
var import_react33 = __toESM(require("react"), 1);
|
|
10319
|
+
var TableContext = import_react33.default.createContext(null);
|
|
10272
10320
|
var useTableContext = () => {
|
|
10273
|
-
const ctx =
|
|
10321
|
+
const ctx = import_react33.default.useContext(TableContext);
|
|
10274
10322
|
if (!ctx) throw new Error("Table components must be used inside <Table>");
|
|
10275
10323
|
return ctx;
|
|
10276
10324
|
};
|
|
@@ -10313,24 +10361,24 @@ TableBody.displayName = "TableBody";
|
|
|
10313
10361
|
var TableBody_default = TableBody;
|
|
10314
10362
|
|
|
10315
10363
|
// src/components/Table/TableCell.tsx
|
|
10316
|
-
var
|
|
10364
|
+
var import_react36 = __toESM(require("react"), 1);
|
|
10317
10365
|
|
|
10318
10366
|
// src/components/Table/TableHeadContext.tsx
|
|
10319
|
-
var
|
|
10320
|
-
var TableHeadContext =
|
|
10367
|
+
var import_react34 = __toESM(require("react"), 1);
|
|
10368
|
+
var TableHeadContext = import_react34.default.createContext(
|
|
10321
10369
|
null
|
|
10322
10370
|
);
|
|
10323
10371
|
var useTableHeadContext = () => {
|
|
10324
|
-
const ctx =
|
|
10372
|
+
const ctx = import_react34.default.useContext(TableHeadContext);
|
|
10325
10373
|
return ctx;
|
|
10326
10374
|
};
|
|
10327
10375
|
var TableHeadContext_default = TableHeadContext;
|
|
10328
10376
|
|
|
10329
10377
|
// src/components/Table/TableRowContext.tsx
|
|
10330
|
-
var
|
|
10331
|
-
var TableRowContext =
|
|
10378
|
+
var import_react35 = __toESM(require("react"), 1);
|
|
10379
|
+
var TableRowContext = import_react35.default.createContext(null);
|
|
10332
10380
|
var useTableRowContext = () => {
|
|
10333
|
-
const ctx =
|
|
10381
|
+
const ctx = import_react35.default.useContext(TableRowContext);
|
|
10334
10382
|
if (!ctx) throw new Error("Table components must be used inside <Table>");
|
|
10335
10383
|
return ctx;
|
|
10336
10384
|
};
|
|
@@ -10338,7 +10386,7 @@ var TableRowContext_default = TableRowContext;
|
|
|
10338
10386
|
|
|
10339
10387
|
// src/components/Table/TableCell.tsx
|
|
10340
10388
|
var import_jsx_runtime345 = require("react/jsx-runtime");
|
|
10341
|
-
var TableCell =
|
|
10389
|
+
var TableCell = import_react36.default.memo((props) => {
|
|
10342
10390
|
const {
|
|
10343
10391
|
children,
|
|
10344
10392
|
align = "center",
|
|
@@ -10352,9 +10400,9 @@ var TableCell = import_react37.default.memo((props) => {
|
|
|
10352
10400
|
const { registerStickyCell, stickyCells } = useTableRowContext();
|
|
10353
10401
|
const { stickyShadow } = useTableContext();
|
|
10354
10402
|
const headContext = useTableHeadContext();
|
|
10355
|
-
const [left, setLeft] =
|
|
10356
|
-
const cellRef =
|
|
10357
|
-
const calculateLeft =
|
|
10403
|
+
const [left, setLeft] = import_react36.default.useState(0);
|
|
10404
|
+
const cellRef = import_react36.default.useRef(null);
|
|
10405
|
+
const calculateLeft = import_react36.default.useCallback(() => {
|
|
10358
10406
|
if (!cellRef.current) return 0;
|
|
10359
10407
|
let totalLeft = 0;
|
|
10360
10408
|
for (const ref of stickyCells) {
|
|
@@ -10363,7 +10411,7 @@ var TableCell = import_react37.default.memo((props) => {
|
|
|
10363
10411
|
}
|
|
10364
10412
|
return totalLeft;
|
|
10365
10413
|
}, [stickyCells]);
|
|
10366
|
-
|
|
10414
|
+
import_react36.default.useEffect(() => {
|
|
10367
10415
|
if (!isSticky || !cellRef.current) return;
|
|
10368
10416
|
registerStickyCell(cellRef);
|
|
10369
10417
|
setLeft(calculateLeft());
|
|
@@ -10421,9 +10469,9 @@ TableHead.displayName = "TableHead";
|
|
|
10421
10469
|
var TableHead_default = TableHead;
|
|
10422
10470
|
|
|
10423
10471
|
// src/components/Table/TableRow.tsx
|
|
10424
|
-
var
|
|
10472
|
+
var import_react37 = __toESM(require("react"), 1);
|
|
10425
10473
|
var import_jsx_runtime347 = require("react/jsx-runtime");
|
|
10426
|
-
var TableRow =
|
|
10474
|
+
var TableRow = import_react37.default.memo((props) => {
|
|
10427
10475
|
const {
|
|
10428
10476
|
children,
|
|
10429
10477
|
type = "secondary",
|
|
@@ -10432,7 +10480,7 @@ var TableRow = import_react38.default.memo((props) => {
|
|
|
10432
10480
|
onClick
|
|
10433
10481
|
} = props;
|
|
10434
10482
|
const { rowBorderUse } = useTableContext();
|
|
10435
|
-
const [stickyCells, setStickyCells] =
|
|
10483
|
+
const [stickyCells, setStickyCells] = import_react37.default.useState([]);
|
|
10436
10484
|
const registerStickyCell = (ref) => {
|
|
10437
10485
|
setStickyCells((prev) => {
|
|
10438
10486
|
if (prev.includes(ref)) return prev;
|
|
@@ -10494,49 +10542,52 @@ Tag.displayName = "Tag";
|
|
|
10494
10542
|
var Tag_default = Tag;
|
|
10495
10543
|
|
|
10496
10544
|
// src/components/TextArea/TextArea.tsx
|
|
10497
|
-
var
|
|
10545
|
+
var import_react38 = __toESM(require("react"), 1);
|
|
10498
10546
|
var import_jsx_runtime349 = require("react/jsx-runtime");
|
|
10499
|
-
var TextArea =
|
|
10547
|
+
var TextArea = import_react38.default.forwardRef(
|
|
10500
10548
|
(props, ref) => {
|
|
10501
10549
|
const {
|
|
10502
10550
|
className,
|
|
10503
10551
|
size = "md",
|
|
10552
|
+
validations,
|
|
10504
10553
|
resize = "vertical",
|
|
10505
10554
|
rows = 3,
|
|
10506
10555
|
disabled,
|
|
10507
10556
|
...textareaProps
|
|
10508
10557
|
} = props;
|
|
10509
|
-
|
|
10558
|
+
const control = /* @__PURE__ */ (0, import_jsx_runtime349.jsx)("div", { className: clsx_default("lib-xplat-textarea-wrap", className), children: /* @__PURE__ */ (0, import_jsx_runtime349.jsx)(
|
|
10510
10559
|
"textarea",
|
|
10511
10560
|
{
|
|
10512
10561
|
...textareaProps,
|
|
10513
10562
|
ref,
|
|
10514
10563
|
rows,
|
|
10515
10564
|
disabled,
|
|
10565
|
+
"aria-invalid": hasError(validations) || void 0,
|
|
10516
10566
|
className: clsx_default("lib-xplat-textarea", size, disabled && "disabled"),
|
|
10517
10567
|
style: { resize }
|
|
10518
10568
|
}
|
|
10519
10569
|
) });
|
|
10570
|
+
return /* @__PURE__ */ (0, import_jsx_runtime349.jsx)(Field, { validations, children: control });
|
|
10520
10571
|
}
|
|
10521
10572
|
);
|
|
10522
10573
|
TextArea.displayName = "TextArea";
|
|
10523
10574
|
var TextArea_default = TextArea;
|
|
10524
10575
|
|
|
10525
10576
|
// src/components/Toast/Toast.tsx
|
|
10526
|
-
var
|
|
10577
|
+
var import_react39 = __toESM(require("react"), 1);
|
|
10527
10578
|
var import_react_dom4 = require("react-dom");
|
|
10528
10579
|
var import_jsx_runtime350 = require("react/jsx-runtime");
|
|
10529
|
-
var ToastContext =
|
|
10580
|
+
var ToastContext = import_react39.default.createContext(null);
|
|
10530
10581
|
var useToast = () => {
|
|
10531
|
-
const ctx =
|
|
10582
|
+
const ctx = import_react39.default.useContext(ToastContext);
|
|
10532
10583
|
if (!ctx) throw new Error("useToast must be used within ToastProvider");
|
|
10533
10584
|
return ctx;
|
|
10534
10585
|
};
|
|
10535
10586
|
var EXIT_DURATION = 300;
|
|
10536
10587
|
var ToastItemComponent = ({ item, isExiting, onClose }) => {
|
|
10537
|
-
const ref =
|
|
10538
|
-
const [height, setHeight] =
|
|
10539
|
-
|
|
10588
|
+
const ref = import_react39.default.useRef(null);
|
|
10589
|
+
const [height, setHeight] = import_react39.default.useState(void 0);
|
|
10590
|
+
import_react39.default.useEffect(() => {
|
|
10540
10591
|
if (ref.current && !isExiting) {
|
|
10541
10592
|
setHeight(ref.current.offsetHeight);
|
|
10542
10593
|
}
|
|
@@ -10568,13 +10619,13 @@ var ToastProvider = ({
|
|
|
10568
10619
|
children,
|
|
10569
10620
|
position = "top-right"
|
|
10570
10621
|
}) => {
|
|
10571
|
-
const [toasts, setToasts] =
|
|
10572
|
-
const [removing, setRemoving] =
|
|
10573
|
-
const [mounted, setMounted] =
|
|
10574
|
-
|
|
10622
|
+
const [toasts, setToasts] = import_react39.default.useState([]);
|
|
10623
|
+
const [removing, setRemoving] = import_react39.default.useState(/* @__PURE__ */ new Set());
|
|
10624
|
+
const [mounted, setMounted] = import_react39.default.useState(false);
|
|
10625
|
+
import_react39.default.useEffect(() => {
|
|
10575
10626
|
setMounted(true);
|
|
10576
10627
|
}, []);
|
|
10577
|
-
const remove =
|
|
10628
|
+
const remove = import_react39.default.useCallback((id) => {
|
|
10578
10629
|
setRemoving((prev) => new Set(prev).add(id));
|
|
10579
10630
|
setTimeout(() => {
|
|
10580
10631
|
setToasts((prev) => prev.filter((t) => t.id !== id));
|
|
@@ -10585,7 +10636,7 @@ var ToastProvider = ({
|
|
|
10585
10636
|
});
|
|
10586
10637
|
}, EXIT_DURATION);
|
|
10587
10638
|
}, []);
|
|
10588
|
-
const toast =
|
|
10639
|
+
const toast = import_react39.default.useCallback(
|
|
10589
10640
|
(type, message, duration = 3e3) => {
|
|
10590
10641
|
const id = `${Date.now()}-${Math.random()}`;
|
|
10591
10642
|
setToasts((prev) => [...prev, { id, type, message }]);
|
|
@@ -10614,7 +10665,7 @@ var ToastProvider = ({
|
|
|
10614
10665
|
ToastProvider.displayName = "ToastProvider";
|
|
10615
10666
|
|
|
10616
10667
|
// src/components/Tooltip/Tooltip.tsx
|
|
10617
|
-
var
|
|
10668
|
+
var import_react40 = __toESM(require("react"), 1);
|
|
10618
10669
|
var import_jsx_runtime351 = require("react/jsx-runtime");
|
|
10619
10670
|
var OFFSET = 12;
|
|
10620
10671
|
var GAP = 8;
|
|
@@ -10628,14 +10679,14 @@ var Tooltip = (props) => {
|
|
|
10628
10679
|
follow = false,
|
|
10629
10680
|
disabled = false
|
|
10630
10681
|
} = props;
|
|
10631
|
-
const triggerRef =
|
|
10632
|
-
const tooltipRef =
|
|
10633
|
-
const [visible, setVisible] =
|
|
10634
|
-
const [pos, setPos] =
|
|
10635
|
-
const delayTimer =
|
|
10636
|
-
const rafRef =
|
|
10637
|
-
const cursor =
|
|
10638
|
-
const clamp =
|
|
10682
|
+
const triggerRef = import_react40.default.useRef(null);
|
|
10683
|
+
const tooltipRef = import_react40.default.useRef(null);
|
|
10684
|
+
const [visible, setVisible] = import_react40.default.useState(false);
|
|
10685
|
+
const [pos, setPos] = import_react40.default.useState({ left: 0, top: 0 });
|
|
10686
|
+
const delayTimer = import_react40.default.useRef(0);
|
|
10687
|
+
const rafRef = import_react40.default.useRef(0);
|
|
10688
|
+
const cursor = import_react40.default.useRef(null);
|
|
10689
|
+
const clamp = import_react40.default.useCallback((left, top, w, h) => {
|
|
10639
10690
|
const vw = window.innerWidth;
|
|
10640
10691
|
const vh = window.innerHeight;
|
|
10641
10692
|
return {
|
|
@@ -10643,7 +10694,7 @@ var Tooltip = (props) => {
|
|
|
10643
10694
|
top: Math.min(Math.max(GAP, top), Math.max(GAP, vh - h - GAP))
|
|
10644
10695
|
};
|
|
10645
10696
|
}, []);
|
|
10646
|
-
const placeAtCursor =
|
|
10697
|
+
const placeAtCursor = import_react40.default.useCallback((x, y) => {
|
|
10647
10698
|
const el = tooltipRef.current;
|
|
10648
10699
|
if (!el) return;
|
|
10649
10700
|
const w = el.offsetWidth;
|
|
@@ -10654,7 +10705,7 @@ var Tooltip = (props) => {
|
|
|
10654
10705
|
if (top < GAP) top = y + OFFSET;
|
|
10655
10706
|
setPos(clamp(left, top, w, h));
|
|
10656
10707
|
}, [clamp]);
|
|
10657
|
-
const placeAtTrigger =
|
|
10708
|
+
const placeAtTrigger = import_react40.default.useCallback(() => {
|
|
10658
10709
|
const el = tooltipRef.current;
|
|
10659
10710
|
const trigger = triggerRef.current;
|
|
10660
10711
|
if (!el || !trigger) return;
|
|
@@ -10666,19 +10717,19 @@ var Tooltip = (props) => {
|
|
|
10666
10717
|
const left = rect.left + rect.width / 2 - w / 2;
|
|
10667
10718
|
setPos(clamp(left, top, w, h));
|
|
10668
10719
|
}, [clamp]);
|
|
10669
|
-
const reposition =
|
|
10720
|
+
const reposition = import_react40.default.useCallback(() => {
|
|
10670
10721
|
if (follow && cursor.current) {
|
|
10671
10722
|
placeAtCursor(cursor.current.x, cursor.current.y);
|
|
10672
10723
|
} else {
|
|
10673
10724
|
placeAtTrigger();
|
|
10674
10725
|
}
|
|
10675
10726
|
}, [follow, placeAtCursor, placeAtTrigger]);
|
|
10676
|
-
const handleMouseEnter =
|
|
10727
|
+
const handleMouseEnter = import_react40.default.useCallback((e) => {
|
|
10677
10728
|
if (disabled) return;
|
|
10678
10729
|
cursor.current = { x: e.clientX, y: e.clientY };
|
|
10679
10730
|
delayTimer.current = window.setTimeout(() => setVisible(true), SHOW_DELAY);
|
|
10680
10731
|
}, [disabled]);
|
|
10681
|
-
const handleMouseMove =
|
|
10732
|
+
const handleMouseMove = import_react40.default.useCallback((e) => {
|
|
10682
10733
|
cursor.current = { x: e.clientX, y: e.clientY };
|
|
10683
10734
|
if (!visible || !follow) return;
|
|
10684
10735
|
cancelAnimationFrame(rafRef.current);
|
|
@@ -10686,25 +10737,25 @@ var Tooltip = (props) => {
|
|
|
10686
10737
|
if (cursor.current) placeAtCursor(cursor.current.x, cursor.current.y);
|
|
10687
10738
|
});
|
|
10688
10739
|
}, [visible, follow, placeAtCursor]);
|
|
10689
|
-
const close =
|
|
10740
|
+
const close = import_react40.default.useCallback(() => {
|
|
10690
10741
|
window.clearTimeout(delayTimer.current);
|
|
10691
10742
|
cancelAnimationFrame(rafRef.current);
|
|
10692
10743
|
setVisible(false);
|
|
10693
10744
|
}, []);
|
|
10694
|
-
const handleMouseLeave =
|
|
10745
|
+
const handleMouseLeave = import_react40.default.useCallback(() => {
|
|
10695
10746
|
cursor.current = null;
|
|
10696
10747
|
close();
|
|
10697
10748
|
}, [close]);
|
|
10698
|
-
const handleFocus =
|
|
10749
|
+
const handleFocus = import_react40.default.useCallback(() => {
|
|
10699
10750
|
if (disabled) return;
|
|
10700
10751
|
cursor.current = null;
|
|
10701
10752
|
setVisible(true);
|
|
10702
10753
|
}, [disabled]);
|
|
10703
|
-
|
|
10754
|
+
import_react40.default.useLayoutEffect(() => {
|
|
10704
10755
|
if (!visible) return;
|
|
10705
10756
|
reposition();
|
|
10706
10757
|
}, [visible, reposition]);
|
|
10707
|
-
|
|
10758
|
+
import_react40.default.useEffect(() => {
|
|
10708
10759
|
if (!visible || follow) return;
|
|
10709
10760
|
const onChange = () => placeAtTrigger();
|
|
10710
10761
|
window.addEventListener("scroll", onChange, true);
|
|
@@ -10714,7 +10765,7 @@ var Tooltip = (props) => {
|
|
|
10714
10765
|
window.removeEventListener("resize", onChange);
|
|
10715
10766
|
};
|
|
10716
10767
|
}, [visible, follow, placeAtTrigger]);
|
|
10717
|
-
|
|
10768
|
+
import_react40.default.useEffect(() => () => {
|
|
10718
10769
|
window.clearTimeout(delayTimer.current);
|
|
10719
10770
|
cancelAnimationFrame(rafRef.current);
|
|
10720
10771
|
}, []);
|
|
@@ -10753,7 +10804,7 @@ Tooltip.displayName = "Tooltip";
|
|
|
10753
10804
|
var Tooltip_default = Tooltip;
|
|
10754
10805
|
|
|
10755
10806
|
// src/components/Video/Video.tsx
|
|
10756
|
-
var
|
|
10807
|
+
var import_react41 = __toESM(require("react"), 1);
|
|
10757
10808
|
var import_jsx_runtime352 = require("react/jsx-runtime");
|
|
10758
10809
|
var PipIcon = () => /* @__PURE__ */ (0, import_jsx_runtime352.jsxs)("svg", { viewBox: "0 0 24 24", width: "1em", height: "1em", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: [
|
|
10759
10810
|
/* @__PURE__ */ (0, import_jsx_runtime352.jsx)("rect", { x: "3", y: "5", width: "18", height: "14", rx: "2" }),
|
|
@@ -10765,7 +10816,7 @@ var formatTime = (sec) => {
|
|
|
10765
10816
|
const s = Math.floor(sec % 60);
|
|
10766
10817
|
return `${m}:${s.toString().padStart(2, "0")}`;
|
|
10767
10818
|
};
|
|
10768
|
-
var Video =
|
|
10819
|
+
var Video = import_react41.default.forwardRef((props, ref) => {
|
|
10769
10820
|
const {
|
|
10770
10821
|
src,
|
|
10771
10822
|
poster,
|
|
@@ -10789,21 +10840,21 @@ var Video = import_react42.default.forwardRef((props, ref) => {
|
|
|
10789
10840
|
children,
|
|
10790
10841
|
...rest
|
|
10791
10842
|
} = props;
|
|
10792
|
-
const containerRef =
|
|
10793
|
-
const videoRef =
|
|
10794
|
-
const [isPlaying, setIsPlaying] =
|
|
10795
|
-
const [isLoaded, setIsLoaded] =
|
|
10796
|
-
const [currentTime, setCurrentTime] =
|
|
10797
|
-
const [duration, setDuration] =
|
|
10798
|
-
const [buffered, setBuffered] =
|
|
10799
|
-
const [volume, setVolume] =
|
|
10800
|
-
const [isMuted, setIsMuted] =
|
|
10801
|
-
const [isFullscreen, setIsFullscreen] =
|
|
10802
|
-
const [playbackRate, setPlaybackRate] =
|
|
10803
|
-
const [rateMenuOpen, setRateMenuOpen] =
|
|
10804
|
-
const [captionsOn, setCaptionsOn] =
|
|
10805
|
-
const [isPip, setIsPip] =
|
|
10806
|
-
const setRefs =
|
|
10843
|
+
const containerRef = import_react41.default.useRef(null);
|
|
10844
|
+
const videoRef = import_react41.default.useRef(null);
|
|
10845
|
+
const [isPlaying, setIsPlaying] = import_react41.default.useState(Boolean(autoPlay));
|
|
10846
|
+
const [isLoaded, setIsLoaded] = import_react41.default.useState(false);
|
|
10847
|
+
const [currentTime, setCurrentTime] = import_react41.default.useState(0);
|
|
10848
|
+
const [duration, setDuration] = import_react41.default.useState(0);
|
|
10849
|
+
const [buffered, setBuffered] = import_react41.default.useState(0);
|
|
10850
|
+
const [volume, setVolume] = import_react41.default.useState(1);
|
|
10851
|
+
const [isMuted, setIsMuted] = import_react41.default.useState(Boolean(muted));
|
|
10852
|
+
const [isFullscreen, setIsFullscreen] = import_react41.default.useState(false);
|
|
10853
|
+
const [playbackRate, setPlaybackRate] = import_react41.default.useState(1);
|
|
10854
|
+
const [rateMenuOpen, setRateMenuOpen] = import_react41.default.useState(false);
|
|
10855
|
+
const [captionsOn, setCaptionsOn] = import_react41.default.useState(false);
|
|
10856
|
+
const [isPip, setIsPip] = import_react41.default.useState(false);
|
|
10857
|
+
const setRefs = import_react41.default.useCallback(
|
|
10807
10858
|
(el) => {
|
|
10808
10859
|
videoRef.current = el;
|
|
10809
10860
|
if (typeof ref === "function") ref(el);
|
|
@@ -10811,14 +10862,14 @@ var Video = import_react42.default.forwardRef((props, ref) => {
|
|
|
10811
10862
|
},
|
|
10812
10863
|
[ref]
|
|
10813
10864
|
);
|
|
10814
|
-
|
|
10865
|
+
import_react41.default.useEffect(() => {
|
|
10815
10866
|
const onFsChange = () => {
|
|
10816
10867
|
setIsFullscreen(document.fullscreenElement === containerRef.current);
|
|
10817
10868
|
};
|
|
10818
10869
|
document.addEventListener("fullscreenchange", onFsChange);
|
|
10819
10870
|
return () => document.removeEventListener("fullscreenchange", onFsChange);
|
|
10820
10871
|
}, []);
|
|
10821
|
-
|
|
10872
|
+
import_react41.default.useEffect(() => {
|
|
10822
10873
|
const v = videoRef.current;
|
|
10823
10874
|
if (!v) return;
|
|
10824
10875
|
const onEnter = () => setIsPip(true);
|
|
@@ -11207,13 +11258,13 @@ Layout.displayName = "Layout";
|
|
|
11207
11258
|
var Layout_default = Layout;
|
|
11208
11259
|
|
|
11209
11260
|
// src/layout/SideBar/SideBar.tsx
|
|
11210
|
-
var
|
|
11261
|
+
var import_react43 = __toESM(require("react"), 1);
|
|
11211
11262
|
|
|
11212
11263
|
// src/layout/SideBar/SideBarContext.tsx
|
|
11213
|
-
var
|
|
11214
|
-
var SideBarContext =
|
|
11264
|
+
var import_react42 = __toESM(require("react"), 1);
|
|
11265
|
+
var SideBarContext = import_react42.default.createContext(null);
|
|
11215
11266
|
var useSideBarContext = () => {
|
|
11216
|
-
const ctx =
|
|
11267
|
+
const ctx = import_react42.default.useContext(SideBarContext);
|
|
11217
11268
|
if (!ctx) throw new Error("Error");
|
|
11218
11269
|
return ctx;
|
|
11219
11270
|
};
|
|
@@ -11223,7 +11274,7 @@ var SideBarContext_default = SideBarContext;
|
|
|
11223
11274
|
var import_jsx_runtime358 = require("react/jsx-runtime");
|
|
11224
11275
|
var SideBar = (props) => {
|
|
11225
11276
|
const { children, className } = props;
|
|
11226
|
-
const [isOpen, setIsOpen] =
|
|
11277
|
+
const [isOpen, setIsOpen] = import_react43.default.useState(true);
|
|
11227
11278
|
const handleSwitchSideBar = () => {
|
|
11228
11279
|
setIsOpen((prev) => !prev);
|
|
11229
11280
|
};
|
|
@@ -11384,6 +11435,8 @@ var SideBar_default = SideBar;
|
|
|
11384
11435
|
FacebookIcon,
|
|
11385
11436
|
FastForwardIcon,
|
|
11386
11437
|
FeatherIcon,
|
|
11438
|
+
Field,
|
|
11439
|
+
FieldMessage,
|
|
11387
11440
|
FigmaIcon,
|
|
11388
11441
|
FileIcon,
|
|
11389
11442
|
FileMinusIcon,
|
|
@@ -11612,6 +11665,7 @@ var SideBar_default = SideBar;
|
|
|
11612
11665
|
breakpoints,
|
|
11613
11666
|
cssVar,
|
|
11614
11667
|
gridColumns,
|
|
11668
|
+
hasError,
|
|
11615
11669
|
isInRange,
|
|
11616
11670
|
isSameDay,
|
|
11617
11671
|
semantic,
|