@s-works/s-works-ui 0.0.1 → 0.0.2

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.
Files changed (53) hide show
  1. package/README.md +3 -3
  2. package/cjs/standard/index.cjs +2633 -6
  3. package/esm/standard/index.mjs +2633 -6
  4. package/package.json +3 -5
  5. package/tailwind.css +1598 -2
  6. package/tailwind.layer.css +1598 -2
  7. package/types/standard/components/Alert/Alert.d.ts +397 -0
  8. package/types/standard/components/Alert/icons.d.ts +58 -0
  9. package/types/standard/components/AppShell/AppShell.d.ts +31 -0
  10. package/types/standard/components/AppShell/AppShellTaskItem.d.ts +26 -0
  11. package/types/standard/components/AppShell/useAppShellSidebar.d.ts +19 -0
  12. package/types/standard/components/Breadcrumbs/Breadcrumbs.d.ts +18 -0
  13. package/types/standard/components/Breadcrumbs/useBreadcrumbItems.d.ts +7 -0
  14. package/types/standard/components/Checkbox/Checkbox.d.ts +440 -0
  15. package/types/standard/components/Checkbox/icons.d.ts +4 -0
  16. package/types/standard/components/CloseButton/CloseButton.d.ts +18 -0
  17. package/types/standard/components/CloseButton/icons.d.ts +4 -0
  18. package/types/standard/components/DateInput/DateInput.d.ts +61 -0
  19. package/types/standard/components/DateInput/icons.d.ts +7 -0
  20. package/types/standard/components/DatePicker/DatePicker.d.ts +39 -0
  21. package/types/standard/components/DatePicker/icons.d.ts +3 -0
  22. package/types/standard/components/DateRangeShortcuts.d.ts +12 -0
  23. package/types/standard/components/InputBase/InputBase.d.ts +148 -0
  24. package/types/standard/components/InputBase/icons.d.ts +3 -0
  25. package/types/standard/components/Layout/Layout.d.ts +18 -0
  26. package/types/standard/components/Layout/use-layout-state.d.ts +18 -0
  27. package/types/standard/components/Loader/Loader.d.ts +25 -0
  28. package/types/standard/components/Loader/icons.d.ts +3 -0
  29. package/types/standard/components/Modal/Modal.d.ts +22 -0
  30. package/types/standard/components/Modal/icons.d.ts +9 -0
  31. package/types/standard/components/Pagination/Pagination.d.ts +34 -0
  32. package/types/standard/components/Radio/Radio.d.ts +432 -0
  33. package/types/standard/components/Select/Select.d.ts +43 -0
  34. package/types/standard/components/Select/icons.d.ts +5 -0
  35. package/types/standard/components/Skeleton/Skeleton.d.ts +6 -0
  36. package/types/standard/components/Space/Space.d.ts +1 -0
  37. package/types/standard/components/Switch/Switch.d.ts +434 -0
  38. package/types/standard/components/Table/Table.d.ts +39 -0
  39. package/types/standard/components/Tabs/Tabs.d.ts +33 -0
  40. package/types/standard/components/Tag/Tag.d.ts +115 -0
  41. package/types/standard/components/Tag/icons.d.ts +8 -0
  42. package/types/standard/components/TagsInput/TagsInput.d.ts +422 -0
  43. package/types/standard/components/TagsInput/controller.d.ts +713 -0
  44. package/types/standard/components/TagsInput/icons.d.ts +13 -0
  45. package/types/standard/components/TagsInput/types.d.ts +7 -0
  46. package/types/standard/components/ThreeColumnLayout/ThreeColumnLayout.d.ts +45 -0
  47. package/types/standard/components/ThreeColumnLayout/use-resizable-panel.d.ts +30 -0
  48. package/types/standard/components/TimePicker/TimePicker.d.ts +28 -0
  49. package/types/standard/components/Title/Title.d.ts +20 -0
  50. package/types/standard/components/Toast/Toast.d.ts +16 -0
  51. package/types/standard/components/Tooltip/Tooltip.d.ts +20 -0
  52. package/types/standard/index.d.mts +27 -0
  53. package/types/standard/index.d.ts +27 -0
@@ -31,7 +31,33 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
31
31
  // src/index.ts
32
32
  var index_exports = {};
33
33
  __export(index_exports, {
34
- Button: () => Button
34
+ Alert: () => Alert,
35
+ AppShell: () => AppShell,
36
+ Breadcrumbs: () => Breadcrumbs,
37
+ Button: () => Button,
38
+ Checkbox: () => Checkbox,
39
+ CloseButton: () => CloseButton2,
40
+ DateInput: () => DateInput,
41
+ DatePicker: () => DatePicker,
42
+ InputBase: () => InputBase,
43
+ Layout: () => Layout,
44
+ Loader: () => Loader,
45
+ Modal: () => Modal,
46
+ Pagination: () => Pagination,
47
+ Radio: () => Radio,
48
+ Select: () => Select,
49
+ Skeleton: () => Skeleton,
50
+ Space: () => import_core27.Space,
51
+ Switch: () => Switch,
52
+ Table: () => Table,
53
+ Tabs: () => Tabs,
54
+ Tag: () => Tag,
55
+ TagsInput: () => TagsInput,
56
+ ThreeColumnLayout: () => ThreeColumnLayout,
57
+ TimePicker: () => TimePicker,
58
+ Title: () => Title,
59
+ Toast: () => Toast,
60
+ Tooltip: () => Tooltip
35
61
  });
36
62
  module.exports = __toCommonJS(index_exports);
37
63
 
@@ -73,19 +99,19 @@ function resolveButtonProps(props = {}) {
73
99
  const definedProps = Object.fromEntries(Object.entries(props).filter(([, value]) => value !== void 0));
74
100
  const standardColor = color === void 0 || color === "blue" || color === "blue.8";
75
101
  const standardVariant = ["filled", "outline", "light", "subtle"].includes(variant);
76
- const palette = standardColor && standardVariant;
102
+ const palette2 = standardColor && standardVariant;
77
103
  return {
78
104
  ff: "PingFang SC, sans-serif",
79
105
  fw: 400,
80
106
  radius: buttonRadiusProps[size] ?? 6,
81
107
  ...buttonSizeProps[size],
82
- ...palette ? { bd: 0 } : {},
83
- ...palette && variant === "filled" ? { c: "#ffffff" } : {},
84
- ...palette && (variant === "outline" || variant === "subtle") ? { bg: "#ffffff" } : {},
108
+ ...palette2 ? { bd: 0 } : {},
109
+ ...palette2 && variant === "filled" ? { c: "#ffffff" } : {},
110
+ ...palette2 && (variant === "outline" || variant === "subtle") ? { bg: "#ffffff" } : {},
85
111
  ...definedProps,
86
112
  size,
87
113
  variant,
88
- color: palette ? variant === "light" || color === void 0 ? "#262626" : "#165dff" : color
114
+ color: palette2 ? variant === "light" || color === void 0 ? "#262626" : "#165dff" : color
89
115
  };
90
116
  }
91
117
  var buttonClassNames = {
@@ -144,3 +170,2604 @@ var ButtonRoot = (0, import_react.forwardRef)(({ classNames, ...props }, ref) =>
144
170
  } }));
145
171
  ButtonRoot.displayName = "SWorks/Button";
146
172
  var Button = (0, import_core.createPolymorphicComponent)(ButtonRoot);
173
+
174
+ // src/components/Breadcrumbs/Breadcrumbs.tsx
175
+ var import_react3 = require("react");
176
+ var import_clsx2 = __toESM(require("clsx"));
177
+ var import_core2 = require("@s-works/s-works-ui/core");
178
+
179
+ // src/components/Breadcrumbs/useBreadcrumbItems.tsx
180
+ var import_react2 = require("react");
181
+ var import_jsx_runtime2 = require("react/jsx-runtime");
182
+ function useBreadcrumbItems(items, collapse = true, resetKey) {
183
+ const [expanded, setExpanded] = (0, import_react2.useState)(false);
184
+ const [previousKey, setPreviousKey] = (0, import_react2.useState)(resetKey);
185
+ if (previousKey !== resetKey) {
186
+ setPreviousKey(resetKey);
187
+ setExpanded(false);
188
+ }
189
+ const firstHidden = (0, import_react2.useRef)(null);
190
+ (0, import_react2.useEffect)(() => {
191
+ if (expanded)
192
+ firstHidden.current?.focus();
193
+ }, [expanded]);
194
+ const indexes = collapse && !expanded && items.length > 4 ? [0, 1, "ellipsis", items.length - 2, items.length - 1] : items.map((_, index) => index);
195
+ return indexes.map((index) => {
196
+ if (index === "ellipsis") {
197
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("button", { type: "button", "aria-label": "\u5C55\u5F00\u9690\u85CF\u8DEF\u5F84", "aria-expanded": false, onClick: () => setExpanded(true), children: "..." }, "ellipsis");
198
+ }
199
+ const item = items[index];
200
+ if (index === items.length - 1) {
201
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { "aria-current": "page", children: item.label }, index);
202
+ }
203
+ return item.href ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("a", { ref: (node) => {
204
+ if (index === 2)
205
+ firstHidden.current = node;
206
+ }, href: item.href, onClick: item.onClick, children: item.label }, index) : item.onClick ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("button", { type: "button", ref: (node) => {
207
+ if (index === 2)
208
+ firstHidden.current = node;
209
+ }, onClick: item.onClick, children: item.label }, index) : /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { tabIndex: index === 2 ? -1 : void 0, ref: (node) => {
210
+ if (index === 2)
211
+ firstHidden.current = node;
212
+ }, children: item.label }, index);
213
+ });
214
+ }
215
+
216
+ // src/components/Breadcrumbs/Breadcrumbs.tsx
217
+ var import_jsx_runtime3 = require("react/jsx-runtime");
218
+ var breadcrumbsClassNames = {
219
+ root: "sw:[font-family:PingFang_SC,sans-serif] sw:min-h-[24px] sw:w-max sw:max-w-full sw:flex-nowrap sw:overflow-x-auto sw:tracking-[0px] sw:text-[14px] sw:leading-[24px]",
220
+ breadcrumb: "sw:inline-flex sw:h-[24px] sw:shrink-0 sw:items-center sw:border-0 sw:bg-transparent sw:p-0 sw:text-[14px] sw:font-normal sw:leading-[24px] sw:text-[#8c8c8c] sw:no-underline sw:[font-family:inherit] sw:[&[aria-current=page]]:font-medium sw:[&[aria-current=page]]:text-[#262626] sw:hover:text-[#262626] sw:focus-visible:[outline-style:solid] sw:focus-visible:outline-[2px] sw:focus-visible:outline-offset-[-2px] sw:focus-visible:outline-[#165dff]",
221
+ separator: "sw:m-0 sw:h-[24px] sw:shrink-0 sw:px-[8px] sw:text-[14px] sw:font-normal sw:leading-[24px] sw:text-[#8c8c8c]"
222
+ };
223
+ function resolveBreadcrumbsClassNames(overrides = {}) {
224
+ return {
225
+ root: (0, import_clsx2.default)(breadcrumbsClassNames.root, overrides.root),
226
+ breadcrumb: (0, import_clsx2.default)(breadcrumbsClassNames.breadcrumb, overrides.breadcrumb),
227
+ separator: (0, import_clsx2.default)(breadcrumbsClassNames.separator, overrides.separator)
228
+ };
229
+ }
230
+ var Breadcrumbs = (0, import_react3.forwardRef)(({ items, collapse = true, classNames, separator = "/", ...props }, ref) => {
231
+ const children = useBreadcrumbItems(items, collapse);
232
+ if (!items.length)
233
+ return null;
234
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_core2.Breadcrumbs, { ...props, ref, role: props.role ?? "navigation", "aria-label": props["aria-label"] ?? "\u9762\u5305\u5C51", separator, attributes: {
235
+ ...props.attributes,
236
+ separator: { ...props.attributes?.separator, "aria-hidden": true }
237
+ }, classNames: (theme, values, ctx) => resolveBreadcrumbsClassNames(typeof classNames === "function" ? classNames(theme, values, ctx) : classNames), children });
238
+ });
239
+ Breadcrumbs.displayName = "SWorks/Breadcrumbs";
240
+
241
+ // src/components/Title/Title.tsx
242
+ var import_react4 = require("react");
243
+ var import_clsx3 = __toESM(require("clsx"));
244
+ var import_core3 = require("@s-works/s-works-ui/core");
245
+ var import_jsx_runtime4 = require("react/jsx-runtime");
246
+ var titleBaseClassNames = {
247
+ root: "sw:m-0 sw:[font-family:PingFang_SC,sans-serif] sw:text-[#262626] sw:tracking-[0px] sw:not-italic"
248
+ };
249
+ var titlePresetClassNames = {
250
+ "h1-medium": "sw:text-[38px] sw:leading-[46px] sw:font-medium",
251
+ "h2-medium": "sw:text-[30px] sw:leading-[40px] sw:font-medium",
252
+ "h3-medium": "sw:text-[24px] sw:leading-[32px] sw:font-medium",
253
+ "h3-regular": "sw:text-[24px] sw:leading-[32px] sw:font-normal",
254
+ "h4-medium": "sw:text-[20px] sw:leading-[28px] sw:font-medium",
255
+ "h5-regular": "sw:text-[16px] sw:leading-[24px] sw:font-normal",
256
+ "h5-medium": "sw:text-[16px] sw:leading-[24px] sw:font-medium",
257
+ "h5-semibold": "sw:text-[16px] sw:leading-[24px] sw:font-semibold"
258
+ };
259
+ var presetOrders = {
260
+ "h1-medium": 1,
261
+ "h2-medium": 2,
262
+ "h3-medium": 3,
263
+ "h3-regular": 3,
264
+ "h4-medium": 4,
265
+ "h5-regular": 5,
266
+ "h5-medium": 5,
267
+ "h5-semibold": 5
268
+ };
269
+ var Title = (0, import_react4.forwardRef)(({ preset = "h1-medium", order, classNames, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_core3.Title, { ...props, ref, order: order ?? presetOrders[preset], classNames: (theme, values, ctx) => {
270
+ const overrides = typeof classNames === "function" ? classNames(theme, values, ctx) : classNames;
271
+ return { root: (0, import_clsx3.default)(titleBaseClassNames.root, titlePresetClassNames[preset], overrides?.root) };
272
+ } }));
273
+ Title.displayName = "SWork/Title";
274
+
275
+ // src/components/Tooltip/Tooltip.tsx
276
+ var import_react5 = require("react");
277
+ var import_clsx4 = __toESM(require("clsx"));
278
+ var import_core4 = require("@s-works/s-works-ui/core");
279
+ var import_jsx_runtime5 = require("react/jsx-runtime");
280
+ var tooltipClassNames = {
281
+ tooltip: "sw:shadow-none"
282
+ };
283
+ function resolveTooltipProps({ radius = 8, color = "rgba(0,0,0,0.9)", events = { hover: true, focus: true, touch: false }, ...props }) {
284
+ return {
285
+ p: 8,
286
+ ff: "PingFang SC, sans-serif",
287
+ fz: 12,
288
+ fw: 400,
289
+ lh: 1.5,
290
+ lts: 0,
291
+ fs: "normal",
292
+ bd: 0,
293
+ ...props,
294
+ radius,
295
+ color,
296
+ events
297
+ };
298
+ }
299
+ function resolveTooltipClassNames(overrides = {}) {
300
+ return {
301
+ tooltip: (0, import_clsx4.default)(tooltipClassNames.tooltip, overrides.tooltip),
302
+ arrow: overrides.arrow
303
+ };
304
+ }
305
+ var TooltipRoot = (0, import_react5.forwardRef)(({ classNames, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_core4.Tooltip, { ...resolveTooltipProps(props), ref, classNames: (theme, values, ctx) => resolveTooltipClassNames(typeof classNames === "function" ? classNames(theme, values, ctx) : classNames) }));
306
+ TooltipRoot.displayName = "SWorks/Tooltip";
307
+ var Tooltip = Object.assign(TooltipRoot, {
308
+ Group: import_core4.Tooltip.Group,
309
+ Floating: import_core4.Tooltip.Floating
310
+ });
311
+
312
+ // src/components/AppShell/AppShell.tsx
313
+ var import_react8 = require("react");
314
+ var import_clsx6 = __toESM(require("clsx"));
315
+ var import_core6 = require("@s-works/s-works-ui/core");
316
+
317
+ // src/components/AppShell/AppShellTaskItem.tsx
318
+ var import_react6 = require("react");
319
+ var import_clsx5 = __toESM(require("clsx"));
320
+ var import_core5 = require("@s-works/s-works-ui/core");
321
+ var import_jsx_runtime6 = require("react/jsx-runtime");
322
+ var appShellTaskItemClassNames = {
323
+ root: "sw:group/app-shell-task sw:flex sw:h-[40px] sw:w-full sw:min-w-0 sw:shrink-0 sw:items-center sw:rounded-[8px] sw:[font-family:PingFang_SC,sans-serif] sw:tracking-[0px] sw:not-italic sw:hover:bg-[rgba(22,93,255,0.05)] sw:hover:px-[8px] sw:has-[:focus-visible]:bg-[rgba(22,93,255,0.05)] sw:has-[:focus-visible]:px-[8px]",
324
+ normal: "sw:bg-transparent sw:pl-[4px] sw:pr-[16px]",
325
+ normalControl: "sw:font-normal sw:text-[#262626]",
326
+ highlighted: "sw:bg-[rgba(22,93,255,0.05)] sw:px-[8px]",
327
+ control: "sw:flex sw:h-full sw:min-w-0 sw:flex-1 sw:items-center sw:border-0 sw:bg-transparent sw:p-0 sw:text-left sw:text-[14px] sw:leading-[24px] sw:focus-visible:outline-[2px] sw:focus-visible:outline-offset-[-2px] sw:focus-visible:outline-[#165dff] sw:disabled:cursor-not-allowed",
328
+ icon: "sw:flex sw:h-[32px] sw:w-[32px] sw:shrink-0 sw:items-center sw:justify-center sw:overflow-hidden",
329
+ label: "sw:block sw:min-w-0 sw:flex-1 sw:overflow-hidden sw:text-ellipsis sw:whitespace-nowrap sw:data-[marquee]:text-clip",
330
+ deleteButton: "sw:h-[32px] sw:w-[32px] sw:shrink-0 sw:items-center sw:justify-center sw:overflow-hidden sw:rounded-[8px] sw:border-0 sw:bg-transparent sw:p-[4px] sw:text-[12px] sw:focus-visible:outline-[2px] sw:focus-visible:outline-[#165dff] sw:disabled:cursor-not-allowed"
331
+ };
332
+ var AppShellTaskItem = (0, import_react6.forwardRef)(({ label, icon, deleteIcon, highlighted = false, onRemove, disabled = false, classNames, ...props }, ref) => {
333
+ const textRef = (0, import_react6.useRef)(null);
334
+ const frame = (0, import_react6.useRef)(null);
335
+ const hovered = (0, import_react6.useRef)(false);
336
+ const focused = (0, import_react6.useRef)(false);
337
+ const [marquee, setMarquee] = (0, import_react6.useState)(false);
338
+ const stop = (0, import_react6.useCallback)(() => {
339
+ if (frame.current !== null)
340
+ cancelAnimationFrame(frame.current);
341
+ frame.current = null;
342
+ if (textRef.current)
343
+ textRef.current.scrollLeft = 0;
344
+ setMarquee(false);
345
+ }, []);
346
+ const start = (0, import_react6.useCallback)(() => {
347
+ stop();
348
+ const text = textRef.current;
349
+ if (!text || disabled || !(hovered.current || focused.current))
350
+ return;
351
+ const reducedMotion = window.matchMedia("(prefers-reduced-motion: reduce)");
352
+ if (reducedMotion.matches || text.scrollWidth <= text.clientWidth)
353
+ return;
354
+ setMarquee(true);
355
+ let position = 0;
356
+ let direction = 1;
357
+ let previous = performance.now();
358
+ let pauseUntil = previous + 500;
359
+ const tick = (now) => {
360
+ if (reducedMotion.matches || !(hovered.current || focused.current)) {
361
+ stop();
362
+ return;
363
+ }
364
+ const delta = Math.min(50, now - previous);
365
+ previous = now;
366
+ const maximum = text.scrollWidth - text.clientWidth;
367
+ if (now >= pauseUntil) {
368
+ position = Math.max(0, Math.min(maximum, position + direction * delta * 0.032));
369
+ text.scrollLeft = position;
370
+ if (position === maximum) {
371
+ direction = -1;
372
+ pauseUntil = now + 800;
373
+ } else if (position === 0) {
374
+ direction = 1;
375
+ pauseUntil = now + 500;
376
+ }
377
+ }
378
+ frame.current = requestAnimationFrame(tick);
379
+ };
380
+ frame.current = requestAnimationFrame(tick);
381
+ }, [disabled, stop]);
382
+ (0, import_react6.useEffect)(() => {
383
+ const text = textRef.current;
384
+ const observer = typeof ResizeObserver === "undefined" ? void 0 : new ResizeObserver(() => {
385
+ if (hovered.current || focused.current)
386
+ start();
387
+ });
388
+ if (text)
389
+ observer?.observe(text);
390
+ if (hovered.current || focused.current)
391
+ start();
392
+ return () => {
393
+ observer?.disconnect();
394
+ if (frame.current !== null)
395
+ cancelAnimationFrame(frame.current);
396
+ frame.current = null;
397
+ if (text)
398
+ text.scrollLeft = 0;
399
+ };
400
+ }, [label, highlighted, start]);
401
+ const overrides = typeof classNames === "function" ? classNames({ highlighted, disabled }) : classNames;
402
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { "data-highlighted": highlighted || void 0, className: (0, import_clsx5.default)(appShellTaskItemClassNames.root, highlighted ? appShellTaskItemClassNames.highlighted : appShellTaskItemClassNames.normal, disabled && "sw:opacity-50", overrides?.root), onMouseEnter: () => {
403
+ hovered.current = true;
404
+ start();
405
+ }, onMouseLeave: () => {
406
+ hovered.current = false;
407
+ if (!focused.current)
408
+ stop();
409
+ }, onFocusCapture: (event) => {
410
+ focused.current = event.target instanceof HTMLElement && event.target.matches(":focus-visible");
411
+ start();
412
+ }, onBlurCapture: (event) => {
413
+ if (event.currentTarget.contains(event.relatedTarget))
414
+ return;
415
+ focused.current = false;
416
+ if (!hovered.current)
417
+ stop();
418
+ }, children: [
419
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_core5.UnstyledButton, { ...props, ref, type: props.type ?? "button", disabled, "aria-label": props["aria-label"] ?? label, classNames: {
420
+ root: (0, import_clsx5.default)(appShellTaskItemClassNames.control, appShellTaskItemClassNames.normalControl, overrides?.control)
421
+ }, children: [
422
+ icon && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { "aria-hidden": "true", className: (0, import_clsx5.default)(appShellTaskItemClassNames.icon, overrides?.icon), children: icon }),
423
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { ref: textRef, "data-marquee": marquee || void 0, className: (0, import_clsx5.default)(appShellTaskItemClassNames.label, overrides?.label), children: label })
424
+ ] }),
425
+ onRemove && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_core5.UnstyledButton, { type: "button", disabled, "aria-label": `\u5220\u9664 ${label}`, onClick: (event) => {
426
+ event.stopPropagation();
427
+ onRemove(event);
428
+ }, classNames: {
429
+ root: (0, import_clsx5.default)(appShellTaskItemClassNames.deleteButton, highlighted ? "sw:flex" : "sw:hidden sw:group-hover/app-shell-task:flex sw:group-has-[:focus-visible]/app-shell-task:flex", overrides?.deleteButton)
430
+ }, children: deleteIcon ?? "\u5220\u9664" })
431
+ ] });
432
+ });
433
+ AppShellTaskItem.displayName = "SWorks/AppShell.TaskItem";
434
+
435
+ // src/components/AppShell/useAppShellSidebar.ts
436
+ var import_react7 = require("react");
437
+ var normalize = (width) => !Number.isFinite(width) ? 260 : width <= 56 ? 56 : Math.min(400, Math.max(220, Math.round(width)));
438
+ function useAppShellSidebar({ sidebarWidth, defaultSidebarWidth = 260, storageKey = "s-work-app-shell-sidebar", onSidebarWidthChange, onSidebarWidthCommit } = {}) {
439
+ const [internalWidth, setInternalWidth] = (0, import_react7.useState)(() => normalize(defaultSidebarWidth));
440
+ const [draft, setDraft] = (0, import_react7.useState)();
441
+ const expandedWidth = (0, import_react7.useRef)(normalize(defaultSidebarWidth) === 56 ? 260 : normalize(defaultSidebarWidth));
442
+ const drag = (0, import_react7.useRef)(null);
443
+ const width = draft ?? normalize(sidebarWidth ?? internalWidth);
444
+ const collapsed = width === 56;
445
+ (0, import_react7.useEffect)(() => {
446
+ if (sidebarWidth !== void 0 || !storageKey)
447
+ return;
448
+ try {
449
+ const saved = JSON.parse(localStorage.getItem(storageKey) ?? "null");
450
+ if (saved && typeof saved.width === "number" && Number.isFinite(saved.width)) {
451
+ setInternalWidth(normalize(saved.width));
452
+ onSidebarWidthChange?.(normalize(saved.width));
453
+ expandedWidth.current = typeof saved.expandedWidth === "number" && saved.expandedWidth >= 220 && saved.expandedWidth <= 400 ? Math.round(saved.expandedWidth) : 260;
454
+ }
455
+ } catch {
456
+ }
457
+ }, [storageKey, sidebarWidth !== void 0]);
458
+ const commit = (value) => {
459
+ const next = normalize(value);
460
+ if (next > 56)
461
+ expandedWidth.current = next;
462
+ if (sidebarWidth === void 0)
463
+ setInternalWidth(next);
464
+ onSidebarWidthChange?.(next);
465
+ onSidebarWidthCommit?.(next);
466
+ if (storageKey) {
467
+ try {
468
+ localStorage.setItem(storageKey, JSON.stringify({
469
+ width: next,
470
+ expandedWidth: expandedWidth.current
471
+ }));
472
+ } catch {
473
+ }
474
+ }
475
+ };
476
+ const state = {
477
+ width,
478
+ collapsed,
479
+ setWidth: commit,
480
+ toggleCollapsed: () => {
481
+ if (!collapsed)
482
+ expandedWidth.current = normalize(width);
483
+ commit(collapsed ? expandedWidth.current : 56);
484
+ }
485
+ };
486
+ const finish = (cancelled = false) => {
487
+ const current = drag.current;
488
+ if (!current)
489
+ return;
490
+ drag.current = null;
491
+ setDraft(void 0);
492
+ if (cancelled) {
493
+ if (sidebarWidth === void 0)
494
+ setInternalWidth(current.startWidth);
495
+ onSidebarWidthChange?.(current.startWidth);
496
+ } else {
497
+ if (current.lastWidth <= 56 && current.startWidth > 56)
498
+ expandedWidth.current = normalize(current.startWidth);
499
+ commit(current.lastWidth);
500
+ }
501
+ };
502
+ const separatorProps = {
503
+ role: "separator",
504
+ "aria-label": "\u8C03\u6574\u4FA7\u680F\u5BBD\u5EA6",
505
+ "aria-orientation": "vertical",
506
+ "aria-valuemin": 56,
507
+ "aria-valuemax": Math.max(400, width),
508
+ "aria-valuenow": width,
509
+ "aria-valuetext": collapsed ? "\u5DF2\u6298\u53E0\uFF0C56\u50CF\u7D20" : `${width}\u50CF\u7D20`,
510
+ tabIndex: 0,
511
+ onPointerDown: (event) => {
512
+ if (!event.isPrimary || event.button !== 0)
513
+ return;
514
+ event.preventDefault();
515
+ const renderedWidth = event.currentTarget.parentElement?.getBoundingClientRect().width ?? width;
516
+ drag.current = {
517
+ id: event.pointerId,
518
+ startX: event.clientX,
519
+ startWidth: width,
520
+ lastWidth: width,
521
+ unitsPerPixel: renderedWidth > 0 ? width / renderedWidth : 1
522
+ };
523
+ event.currentTarget.setPointerCapture(event.pointerId);
524
+ setDraft(width);
525
+ },
526
+ onPointerMove: (event) => {
527
+ const current = drag.current;
528
+ if (!current || current.id !== event.pointerId)
529
+ return;
530
+ const next = Math.max(56, Math.round(current.startWidth + (event.clientX - current.startX) * current.unitsPerPixel));
531
+ current.lastWidth = next;
532
+ setDraft(next);
533
+ onSidebarWidthChange?.(next);
534
+ },
535
+ onPointerUp: () => finish(),
536
+ onPointerCancel: () => finish(true),
537
+ onLostPointerCapture: () => finish(true),
538
+ onKeyDown: (event) => {
539
+ if (!["ArrowLeft", "ArrowRight", "Home", "End", "Enter", "Escape"].includes(event.key))
540
+ return;
541
+ event.preventDefault();
542
+ if (event.key === "Escape") {
543
+ finish(true);
544
+ return;
545
+ }
546
+ if (event.key === "Enter")
547
+ state.toggleCollapsed();
548
+ else if (event.key === "Home")
549
+ commit(220);
550
+ else if (event.key === "End")
551
+ commit(400);
552
+ else
553
+ commit(width + (event.key === "ArrowLeft" ? -10 : 10));
554
+ }
555
+ };
556
+ return { state, resizing: draft !== void 0, separatorProps };
557
+ }
558
+
559
+ // src/components/AppShell/AppShell.tsx
560
+ var import_jsx_runtime7 = require("react/jsx-runtime");
561
+ var appShellClassNames = {
562
+ root: "sw:min-w-0 sw:[font-family:PingFang_SC,sans-serif] sw:tracking-[0px] sw:not-italic sw:text-[14px] sw:font-normal sw:leading-[24px] sw:text-[#262626]",
563
+ navbar: "sw:border-0 sw:bg-[#f9f9f9] sw:min-h-0 sw:overflow-hidden",
564
+ main: "sw:min-w-0 sw:bg-white"
565
+ };
566
+ var appShellHandleClassName = "sw:absolute sw:bottom-0 sw:right-0 sw:top-0 sw:z-[2] sw:w-[4px] sw:cursor-col-resize sw:touch-none sw:focus-visible:bg-[#165dff] sw:focus-visible:outline-none";
567
+ function resolveAppShellClassNames({ mode = "fixed", resizing = false, withBorder = true } = {}, overrides = {}) {
568
+ return {
569
+ ...overrides,
570
+ root: (0, import_clsx6.default)(appShellClassNames.root, mode === "static" && "sw:relative sw:isolate sw:flex sw:h-full sw:overflow-hidden", resizing && "sw:select-none sw:cursor-col-resize sw:[&_*]:cursor-col-resize", overrides.root),
571
+ navbar: (0, import_clsx6.default)(appShellClassNames.navbar, withBorder && "sw:shadow-[inset_-1px_0_0_#f0f0f0]", mode === "static" && "sw:relative sw:top-auto sw:h-full sw:shrink-0", overrides.navbar),
572
+ main: (0, import_clsx6.default)(appShellClassNames.main, mode === "static" && "sw:min-h-0 sw:flex-1 sw:p-[var(--app-shell-padding)]", overrides.main)
573
+ };
574
+ }
575
+ var AppShellRoot = (0, import_react8.forwardRef)(({ sidebar, children, sidebarWidth, defaultSidebarWidth, storageKey, onSidebarWidthChange, onSidebarWidthCommit, classNames, mode = "fixed", transitionDuration = 200, ...props }, ref) => {
576
+ const { state, resizing, separatorProps } = useAppShellSidebar({
577
+ sidebarWidth,
578
+ defaultSidebarWidth,
579
+ storageKey,
580
+ onSidebarWidthChange,
581
+ onSidebarWidthCommit
582
+ });
583
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_core6.AppShell, { ...props, mode, ref, navbar: { width: state.width, breakpoint: 0 }, transitionDuration: resizing ? 0 : transitionDuration, classNames: (theme, values, ctx) => resolveAppShellClassNames({ mode, resizing, withBorder: props.withBorder }, typeof classNames === "function" ? classNames(theme, values, ctx) : classNames), children: [
584
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_core6.AppShell.Navbar, { w: state.width, "aria-label": "\u5E94\u7528\u4FA7\u680F", "data-sidebar-width": state.width, "data-collapsed": state.collapsed || void 0, children: [
585
+ typeof sidebar === "function" ? sidebar(state) : sidebar,
586
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { ...separatorProps, className: appShellHandleClassName })
587
+ ] }),
588
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_core6.AppShell.Main, { ps: mode === "fixed" && !props.disabled ? `calc(${(0, import_core6.rem)(state.width)} + var(--app-shell-padding))` : void 0, children })
589
+ ] });
590
+ });
591
+ AppShellRoot.displayName = "SWorks/AppShell";
592
+ var AppShell = Object.assign(AppShellRoot, {
593
+ TaskItem: AppShellTaskItem
594
+ });
595
+
596
+ // src/components/Table/Table.tsx
597
+ var import_react9 = require("react");
598
+ var import_clsx7 = __toESM(require("clsx"));
599
+ var import_core7 = require("@s-works/s-works-ui/core");
600
+ var import_jsx_runtime8 = require("react/jsx-runtime");
601
+ var tableClassNames = {
602
+ table: "sw:[font-family:PingFang_SC,sans-serif] sw:tracking-[0px] sw:not-italic sw:border-separate sw:border-spacing-0 sw:text-[#262626]",
603
+ th: "sw:text-left sw:font-medium",
604
+ td: "sw:font-normal"
605
+ };
606
+ var tableAppearanceClassNames = {
607
+ primary: {
608
+ table: "sw:table-fixed sw:overflow-hidden sw:rounded-[16px] sw:bg-white sw:[outline:1px_solid_rgba(0,0,0,0.08)] sw:outline-offset-[-1px]",
609
+ th: "sw:h-[56px] sw:overflow-hidden sw:border-0 sw:border-b sw:border-r sw:border-solid sw:border-black/[0.08] sw:bg-[#f3f7ff] sw:px-[16px] sw:py-0 sw:text-[14px] sw:leading-[24px] sw:text-[#262626] sw:last:border-r-0",
610
+ td: "sw:h-[66px] sw:overflow-hidden sw:text-ellipsis sw:whitespace-nowrap sw:border-0 sw:border-r sw:border-solid sw:border-black/[0.08] sw:px-[16px] sw:py-0 sw:text-[14px] sw:leading-[24px] sw:text-[#262626] sw:first:text-center sw:last:border-r-0",
611
+ tr: "sw:[&:nth-child(odd)>td]:bg-white sw:[&:nth-child(even)>td]:bg-[#f2f3f5]"
612
+ },
613
+ meeting: {
614
+ table: "sw:table-fixed",
615
+ th: "sw:h-[45px] sw:border-0 sw:border-b sw:border-solid sw:border-[#f0f0f0] sw:px-[5px] sw:py-[12px] sw:text-[13px] sw:leading-[20px] sw:text-[#8c8c8c] sw:first:pl-[16px] sw:last:pr-[16px]",
616
+ td: "sw:h-[78px] sw:border-0 sw:shadow-[inset_0_-1px_0_#f5f5f5] sw:px-[5px] sw:py-[16px] sw:text-[12px] sw:leading-[18px] sw:text-[#8c8c8c] sw:first:pl-[16px] sw:last:pr-[16px]",
617
+ tr: "sw:[&>td:first-child]:rounded-l-[12px] sw:[&>td:last-child]:rounded-r-[12px] sw:data-[hoverable]:hover:[&>td]:bg-[#f3f7ff] sw:data-[hoverable]:has-[:focus-visible]:[&>td]:bg-[#f3f7ff] sw:data-[hoverable]:data-[menu-open]:[&>td]:bg-[#f3f7ff]"
618
+ },
619
+ drawer: {
620
+ table: "sw:table-fixed sw:overflow-hidden sw:rounded-[8px] sw:border sw:border-solid sw:border-[#f0f0f0]",
621
+ th: "sw:h-[40px] sw:border-0 sw:bg-[rgba(0,0,0,0.03)] sw:px-[12px] sw:py-0 sw:text-[12px] sw:leading-[18px]",
622
+ td: "sw:h-[42px] sw:border-0 sw:border-b sw:border-solid sw:border-[#f0f0f0] sw:px-[12px] sw:py-0 sw:text-[12px] sw:leading-[18px]",
623
+ tr: "sw:last:[&>td]:border-b-0"
624
+ }
625
+ };
626
+ function resolveTableClassNames(appearance, overrides = {}) {
627
+ const visual = tableAppearanceClassNames[appearance];
628
+ return {
629
+ table: (0, import_clsx7.default)(tableClassNames.table, visual.table, overrides.table),
630
+ th: (0, import_clsx7.default)(tableClassNames.th, visual.th, overrides.th),
631
+ td: (0, import_clsx7.default)(tableClassNames.td, visual.td, overrides.td),
632
+ tr: (0, import_clsx7.default)(visual.tr, overrides.tr)
633
+ };
634
+ }
635
+ var TableRoot = (0, import_react9.forwardRef)(({ appearance = "meeting", classNames, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_core7.Table, { ...props, ref, classNames: (theme, values, ctx) => {
636
+ const overrides = typeof classNames === "function" ? classNames(theme, values, ctx) : classNames;
637
+ return {
638
+ ...overrides,
639
+ ...resolveTableClassNames(appearance, overrides)
640
+ };
641
+ } }));
642
+ TableRoot.displayName = "SWorks/Table";
643
+ var Table = Object.assign(TableRoot, {
644
+ Thead: import_core7.Table.Thead,
645
+ Tbody: import_core7.Table.Tbody,
646
+ Tfoot: import_core7.Table.Tfoot,
647
+ Tr: import_core7.Table.Tr,
648
+ Th: import_core7.Table.Th,
649
+ Td: import_core7.Table.Td,
650
+ Caption: import_core7.Table.Caption,
651
+ ScrollContainer: import_core7.Table.ScrollContainer,
652
+ DataRenderer: import_core7.Table.DataRenderer
653
+ });
654
+
655
+ // src/components/Pagination/Pagination.tsx
656
+ var import_react10 = require("react");
657
+ var import_clsx8 = __toESM(require("clsx"));
658
+ var import_core8 = require("@s-works/s-works-ui/core");
659
+ var import_hooks = require("@s-works/s-works-ui/hooks");
660
+ var import_jsx_runtime9 = require("react/jsx-runtime");
661
+ function PreviousLabel() {
662
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { children: "\u4E0A\u4E00\u9875" });
663
+ }
664
+ function NextLabel() {
665
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { children: "\u4E0B\u4E00\u9875" });
666
+ }
667
+ function DotsLabel() {
668
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { children: "..." });
669
+ }
670
+ var paginationClassNames = {
671
+ root: "sw:flex sw:flex-wrap sw:items-center sw:gap-[8px] sw:[font-family:PingFang_SC,sans-serif] sw:tracking-[0px] sw:not-italic",
672
+ fullRoot: "sw:min-h-[52px] sw:w-full sw:justify-between",
673
+ miniRoot: "sw:min-h-[30px] sw:w-fit sw:justify-center",
674
+ simpleControl: "sw:data-[navigation]:disabled:bg-white",
675
+ control: "sw:border sw:border-solid sw:border-black/[0.08] sw:bg-white sw:p-0 sw:text-[13px] sw:font-normal sw:leading-[20px] sw:text-[#8c8c8c] sw:data-[active]:border-[var(--pagination-active-bg)] sw:data-[active]:bg-[var(--pagination-active-bg)] sw:data-[active]:text-white sw:disabled:bg-[#f5f5f5] sw:disabled:text-[#8c8c8c] sw:disabled:opacity-100 sw:enabled:hover:[&:not([data-active])]:bg-[#f5f5f5] sw:data-[navigation]:min-w-0 sw:data-[navigation]:px-[12px] sw:data-[navigation]:py-[4px] sw:data-[navigation]:text-[#262626] sw:data-[navigation]:disabled:text-[#8c8c8c]",
676
+ dots: "sw:flex sw:h-[30px] sw:w-[32px] sw:items-center sw:justify-center sw:text-[13px] sw:leading-[20px] sw:text-[#8c8c8c]"
677
+ };
678
+ var paginationInfoClassName = "sw:text-[12px] sw:leading-[18px] sw:text-[#8c8c8c]";
679
+ var paginationCounterClassNames = {
680
+ root: "sw:flex sw:gap-[4px] sw:text-[13px] sw:leading-[20px] sw:text-[#8c8c8c]",
681
+ current: "sw:text-[#262626]"
682
+ };
683
+ function resolvePaginationInfo({ info, totalRecords, pageSize = 10 }) {
684
+ return info ?? (totalRecords === void 0 ? null : `\u5171 ${totalRecords} \u6761\u6570\u636E\uFF0C\u6BCF\u9875 ${pageSize} \u6761`);
685
+ }
686
+ function resolvePaginationClassNames({ layout = "full" } = {}, overrides = {}) {
687
+ return {
688
+ ...overrides,
689
+ root: (0, import_clsx8.default)(paginationClassNames.root, layout === "mini" ? paginationClassNames.miniRoot : paginationClassNames.fullRoot, overrides.root),
690
+ control: (0, import_clsx8.default)(paginationClassNames.control, layout === "simple" && paginationClassNames.simpleControl, overrides.control),
691
+ dots: (0, import_clsx8.default)(paginationClassNames.dots, overrides.dots)
692
+ };
693
+ }
694
+ function resolvePaginationRootProps({ size = 30, radius = 4, color = "#262626", siblings = 1, boundaries = 1, ...props } = {}) {
695
+ return { ...props, size, radius, color, siblings, boundaries };
696
+ }
697
+ var PaginationRoot = (0, import_react10.forwardRef)(({ layout = "full", totalRecords, pageSize = 10, info, total, value, defaultValue, onChange, classNames, gap = 8, withPages = true, withControls = true, withEdges, previousIcon, nextIcon, firstIcon, lastIcon, dotsIcon, getControlProps, hideWithOnePage, siblings = 1, boundaries = 1, ...props }, ref) => {
698
+ const [page, setPage] = (0, import_hooks.useUncontrolled)({
699
+ value,
700
+ defaultValue,
701
+ finalValue: 1,
702
+ onChange
703
+ });
704
+ if (total <= 0 || hideWithOnePage && total === 1)
705
+ return null;
706
+ const detail = resolvePaginationInfo({ info, totalRecords, pageSize });
707
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_core8.Pagination.Root, { role: "navigation", "aria-label": "\u5206\u9875", ...resolvePaginationRootProps(props), total, value: page, onChange: setPage, siblings, boundaries, ref, classNames: (theme, values, ctx) => {
708
+ const overrides = typeof classNames === "function" ? classNames(theme, values, ctx) : classNames;
709
+ return resolvePaginationClassNames({ layout }, overrides);
710
+ }, children: [
711
+ layout !== "mini" && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: paginationInfoClassName, children: detail }),
712
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_core8.Group, { gap, justify: "center", children: [
713
+ withEdges && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_core8.Pagination.First, { icon: firstIcon, ...getControlProps?.("first") }),
714
+ withControls && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_core8.Pagination.Previous, { icon: previousIcon ?? PreviousLabel, "data-navigation": true, "aria-label": "\u4E0A\u4E00\u9875", ...getControlProps?.("previous") }),
715
+ layout === "simple" ? /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("span", { "aria-live": "polite", className: paginationCounterClassNames.root, children: [
716
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: paginationCounterClassNames.current, children: page }),
717
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { children: "/" }),
718
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { children: total })
719
+ ] }) : withPages && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_core8.Pagination.Items, { dotsIcon: dotsIcon ?? DotsLabel }),
720
+ withControls && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_core8.Pagination.Next, { icon: nextIcon ?? NextLabel, "data-navigation": true, "aria-label": "\u4E0B\u4E00\u9875", ...getControlProps?.("next") }),
721
+ withEdges && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_core8.Pagination.Last, { icon: lastIcon, ...getControlProps?.("last") })
722
+ ] })
723
+ ] });
724
+ });
725
+ PaginationRoot.displayName = "SWorks/Pagination";
726
+ var Pagination = Object.assign(PaginationRoot, {
727
+ Root: import_core8.Pagination.Root,
728
+ Control: import_core8.Pagination.Control,
729
+ Dots: import_core8.Pagination.Dots,
730
+ First: import_core8.Pagination.First,
731
+ Last: import_core8.Pagination.Last,
732
+ Next: import_core8.Pagination.Next,
733
+ Previous: import_core8.Pagination.Previous,
734
+ Items: import_core8.Pagination.Items
735
+ });
736
+
737
+ // src/components/Radio/Radio.tsx
738
+ var import_react11 = require("react");
739
+ var import_clsx9 = __toESM(require("clsx"));
740
+ var import_core9 = require("@s-works/s-works-ui/core");
741
+ var import_jsx_runtime10 = require("react/jsx-runtime");
742
+ var radioClassNames = {
743
+ root: "sw:[font-family:PingFang_SC,sans-serif] sw:tracking-[0px] sw:not-italic",
744
+ body: "sw:items-center",
745
+ labeledBody: "sw:min-h-[22px] sw:items-start",
746
+ labeledInner: "sw:mt-[5px]",
747
+ radio: "sw:border-2 sw:border-solid sw:border-[#e5e6eb] sw:bg-white sw:enabled:hover:[&:not(:checked)]:border-[#dadbe2] sw:checked:border-[var(--radio-color)] sw:checked:bg-[var(--radio-color)] sw:disabled:border-[#e5e6eb] sw:disabled:bg-[#f2f3f5] sw:disabled:checked:border-[#adc6ff] sw:disabled:checked:bg-[#adc6ff]",
748
+ icon: "sw:h-[6px] sw:w-[6px] sw:left-[calc(50%-3px)] sw:top-[calc(50%-3px)] sw:[input:disabled:checked+&]:[--radio-icon-color:inherit]",
749
+ label: "sw:pl-[8px] sw:text-[14px] sw:font-normal sw:leading-[22px] sw:text-[#262626] sw:data-[disabled]:text-[#bfbfbf]"
750
+ };
751
+ function resolveRadioProps({ size = "14px", color = "#165dff", iconColor = "#ffffff", ...props } = {}) {
752
+ return { ...props, size, color, iconColor };
753
+ }
754
+ function resolveRadioClassNames({ label } = {}, overrides = {}) {
755
+ return {
756
+ ...overrides,
757
+ root: (0, import_clsx9.default)(radioClassNames.root, overrides.root),
758
+ body: (0, import_clsx9.default)(radioClassNames.body, label && radioClassNames.labeledBody, overrides.body),
759
+ radio: (0, import_clsx9.default)(radioClassNames.radio, overrides.radio),
760
+ icon: (0, import_clsx9.default)(radioClassNames.icon, overrides.icon),
761
+ inner: (0, import_clsx9.default)(label && radioClassNames.labeledInner, overrides.inner),
762
+ label: (0, import_clsx9.default)(radioClassNames.label, overrides.label)
763
+ };
764
+ }
765
+ var RadioRoot = (0, import_react11.forwardRef)(({ classNames, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_core9.Radio, { ...resolveRadioProps(props), ref, classNames: (theme, values, ctx) => {
766
+ const overrides = typeof classNames === "function" ? classNames(theme, values, ctx) : classNames;
767
+ return resolveRadioClassNames(props, overrides);
768
+ } }));
769
+ RadioRoot.displayName = "SWorks/Radio";
770
+ var Radio = Object.assign(RadioRoot, {
771
+ Group: import_core9.Radio.Group,
772
+ Card: import_core9.Radio.Card,
773
+ Indicator: import_core9.Radio.Indicator
774
+ });
775
+
776
+ // src/components/Checkbox/Checkbox.tsx
777
+ var import_react12 = require("react");
778
+ var import_clsx10 = __toESM(require("clsx"));
779
+ var import_core10 = require("@s-works/s-works-ui/core");
780
+
781
+ // src/components/Checkbox/icons.tsx
782
+ var import_jsx_runtime11 = require("react/jsx-runtime");
783
+ function CheckboxCheckIcon({ size, width = size ?? "14", height = size ?? "14", ...props }) {
784
+ return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("svg", { preserveAspectRatio: "none", overflow: "visible", viewBox: "0 0 14 14", fill: "none", width, height, "aria-hidden": "true", focusable: "false", ...props, children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("g", { children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("path", { d: "M10.1787 4.48866C10.3626 4.67236 10.3747 4.96606 10.207 5.16469L7.02914 8.92534L7.05538 8.95296L6.74049 9.26785L6.46221 9.59723C6.38965 9.68306 6.29457 9.73609 6.19359 9.75951C6.00891 9.83603 5.78823 9.79845 5.64116 9.64488L3.79053 7.71138C3.60265 7.51508 3.60545 7.20484 3.79744 7.01256L4.15099 6.65901C4.34921 6.46067 4.67172 6.46412 4.86569 6.66661L5.99057 7.83982L9.09176 4.16963C9.28044 3.94631 9.61944 3.93146 9.82649 4.13787L10.1787 4.48866Z", fill: "currentColor" }) }) });
785
+ }
786
+
787
+ // src/components/Checkbox/Checkbox.tsx
788
+ var import_jsx_runtime12 = require("react/jsx-runtime");
789
+ var checkboxClassNames = {
790
+ root: "sw:[font-family:PingFang_SC,sans-serif] sw:tracking-[0px] sw:not-italic",
791
+ body: "sw:items-center",
792
+ labeledBody: "sw:min-h-[22px] sw:items-start",
793
+ labeledInner: "sw:mt-[5px]",
794
+ input: "sw:border-2 sw:border-solid sw:border-[#e5e6eb] sw:bg-white sw:enabled:hover:[&:not(:checked):not([data-indeterminate])]:border-[#dadbe2] sw:checked:border-transparent sw:checked:bg-[var(--checkbox-color)] sw:data-[indeterminate]:border-transparent sw:data-[indeterminate]:bg-[var(--checkbox-color)] sw:disabled:border-[#e5e6eb] sw:disabled:bg-[#f2f3f5] sw:disabled:checked:border-transparent sw:disabled:checked:bg-[#adc6ff] sw:disabled:data-[indeterminate]:border-transparent sw:disabled:data-[indeterminate]:bg-[#adc6ff]",
795
+ icon: "sw:m-0 sw:flex sw:h-full sw:w-full sw:items-center sw:justify-center",
796
+ label: "sw:pl-[8px] sw:text-[14px] sw:font-normal sw:leading-[22px] sw:text-[#262626] sw:data-[disabled]:text-[#bfbfbf]"
797
+ };
798
+ function CheckGlyph({ indeterminate, className }) {
799
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className, children: indeterminate ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "sw:h-[2px] sw:w-[6px] sw:rounded-[0.5px] sw:bg-current" }) : /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(CheckboxCheckIcon, { width: "100%", height: "100%" }) });
800
+ }
801
+ function resolveCheckboxProps({ size = "14px", radius = 2, color = "#165dff", iconColor = "#ffffff", icon = CheckGlyph, ...props } = {}) {
802
+ return { ...props, size, radius, color, iconColor, icon };
803
+ }
804
+ function resolveCheckboxClassNames({ label } = {}, overrides = {}) {
805
+ return {
806
+ ...overrides,
807
+ root: (0, import_clsx10.default)(checkboxClassNames.root, overrides.root),
808
+ body: (0, import_clsx10.default)(checkboxClassNames.body, label && checkboxClassNames.labeledBody, overrides.body),
809
+ input: (0, import_clsx10.default)(checkboxClassNames.input, overrides.input),
810
+ icon: (0, import_clsx10.default)(checkboxClassNames.icon, overrides.icon),
811
+ inner: (0, import_clsx10.default)(label && checkboxClassNames.labeledInner, overrides.inner),
812
+ label: (0, import_clsx10.default)(checkboxClassNames.label, overrides.label)
813
+ };
814
+ }
815
+ var CheckboxRoot = (0, import_react12.forwardRef)(({ classNames, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_core10.Checkbox, { ...resolveCheckboxProps(props), ref, classNames: (theme, values, ctx) => {
816
+ const overrides = typeof classNames === "function" ? classNames(theme, values, ctx) : classNames;
817
+ return resolveCheckboxClassNames(props, overrides);
818
+ } }));
819
+ CheckboxRoot.displayName = "SWorks/Checkbox";
820
+ var Checkbox = Object.assign(CheckboxRoot, {
821
+ Group: import_core10.Checkbox.Group,
822
+ Card: import_core10.Checkbox.Card,
823
+ Indicator: import_core10.Checkbox.Indicator
824
+ });
825
+
826
+ // src/components/Switch/Switch.tsx
827
+ var import_react13 = require("react");
828
+ var import_clsx11 = __toESM(require("clsx"));
829
+ var import_core11 = require("@s-works/s-works-ui/core");
830
+ var import_jsx_runtime13 = require("react/jsx-runtime");
831
+ var switchClassNames = {
832
+ root: "sw:[font-family:PingFang_SC,sans-serif] sw:tracking-[0px] sw:not-italic",
833
+ body: "sw:items-center",
834
+ track: "sw:border-0 sw:bg-[#dadbe2] sw:[input:checked+&]:bg-[var(--switch-color)] sw:[input:disabled+&]:bg-[#f2f3f5] sw:[input:checked:disabled+&]:bg-[#adc6ff]",
835
+ thumb: "sw:border-0 sw:bg-white sw:shadow-[0_1px_3px_rgba(0,0,0,0.1)]",
836
+ largeTrack: "sw:w-[40px] sw:min-w-[40px] sw:h-[24px]",
837
+ smallTrack: "sw:w-[28px] sw:min-w-[28px] sw:h-[16px]",
838
+ largeThumb: "sw:h-[16px] sw:w-[16px] sw:start-[4px] sw:[input:checked+*>&]:start-[calc(100%-20px)]",
839
+ smallThumb: "sw:h-[12px] sw:w-[12px] sw:start-[2px] sw:[input:checked+*>&]:start-[calc(100%-14px)] sw:shadow-[0_0.75px_2.25px_rgba(0,0,0,0.1)]",
840
+ label: "sw:pl-[8px] sw:text-[14px] sw:font-normal sw:leading-[22px] sw:text-[#262626] sw:data-[disabled]:text-[#bfbfbf]"
841
+ };
842
+ function resolveSwitchProps({ size = "md", radius = 24, color = "#165dff", withThumbIndicator = false, ...props } = {}) {
843
+ return { ...props, size, radius, color, withThumbIndicator };
844
+ }
845
+ function resolveSwitchClassNames({ size = "md" } = {}, overrides = {}) {
846
+ return {
847
+ ...overrides,
848
+ root: (0, import_clsx11.default)(switchClassNames.root, overrides.root),
849
+ body: (0, import_clsx11.default)(switchClassNames.body, overrides.body),
850
+ track: (0, import_clsx11.default)(switchClassNames.track, size === "md" && switchClassNames.largeTrack, size === "xs" && switchClassNames.smallTrack, overrides.track),
851
+ thumb: (0, import_clsx11.default)(switchClassNames.thumb, size === "md" && switchClassNames.largeThumb, size === "xs" && switchClassNames.smallThumb, overrides.thumb),
852
+ label: (0, import_clsx11.default)(switchClassNames.label, overrides.label)
853
+ };
854
+ }
855
+ var SwitchRoot = (0, import_react13.forwardRef)(({ classNames, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_core11.Switch, { ...resolveSwitchProps(props), ref, classNames: (theme, values, ctx) => {
856
+ const overrides = typeof classNames === "function" ? classNames(theme, values, ctx) : classNames;
857
+ return resolveSwitchClassNames(props, overrides);
858
+ } }));
859
+ SwitchRoot.displayName = "SWorks/Switch";
860
+ var Switch = Object.assign(SwitchRoot, { Group: import_core11.Switch.Group });
861
+
862
+ // src/components/Alert/Alert.tsx
863
+ var import_react15 = require("react");
864
+ var import_clsx12 = __toESM(require("clsx"));
865
+ var import_core12 = require("@s-works/s-works-ui/core");
866
+
867
+ // src/components/Alert/icons.tsx
868
+ var import_react14 = require("react");
869
+ var import_jsx_runtime14 = require("react/jsx-runtime");
870
+ function CloseIcon({ size, width = size ?? "6.33074", height = size ?? "6.33074", ...props }) {
871
+ return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("svg", { preserveAspectRatio: "none", overflow: "visible", viewBox: "0 0 6.33074 6.33074", fill: "none", width, height, "aria-hidden": "true", focusable: "false", ...props, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("path", { d: "M5.19464 0.194563C5.45427 -0.0648887 5.87638 -0.0648198 6.13605 0.194563C6.3957 0.454208 6.39559 0.876257 6.13605 1.13597L4.10675 3.16527L6.13605 5.19456C6.3957 5.45421 6.39559 5.87626 6.13605 6.13597C5.87635 6.39567 5.45434 6.39567 5.19464 6.13597L3.16535 4.10667L1.13605 6.13597C0.87635 6.39567 0.454341 6.39567 0.194642 6.13597C-0.0647931 5.87625 -0.0649685 5.45417 0.194642 5.19456L2.22394 3.16527L0.194642 1.13597C-0.0647928 0.876248 -0.0649684 0.454174 0.194642 0.194563C0.454267 -0.0648888 0.876381 -0.0648196 1.13605 0.194563L3.16535 2.22386L5.19464 0.194563Z", fill: "#BFBFBF" }) });
872
+ }
873
+ function CloseNormalIcon({ size, width = size ?? "6.33074", height = size ?? "6.33074", ...props }) {
874
+ return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("svg", { preserveAspectRatio: "none", overflow: "visible", viewBox: "0 0 6.33074 6.33074", fill: "none", width, height, "aria-hidden": "true", focusable: "false", ...props, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("path", { d: "M5.19464 0.194563C5.45427 -0.0648887 5.87638 -0.0648198 6.13605 0.194563C6.3957 0.454208 6.39559 0.876257 6.13605 1.13597L4.10675 3.16527L6.13605 5.19456C6.3957 5.45421 6.39559 5.87626 6.13605 6.13597C5.87635 6.39567 5.45434 6.39567 5.19464 6.13597L3.16535 4.10667L1.13605 6.13597C0.87635 6.39567 0.454341 6.39567 0.194642 6.13597C-0.0647931 5.87625 -0.0649685 5.45417 0.194642 5.19456L2.22394 3.16527L0.194642 1.13597C-0.0647928 0.876248 -0.0649684 0.454174 0.194642 0.194563C0.454267 -0.0648888 0.876381 -0.0648196 1.13605 0.194563L3.16535 2.22386L5.19464 0.194563Z", fill: "black" }) });
875
+ }
876
+ function DoneIcon({ size, width = size ?? "16", height = size ?? "16", ...props }) {
877
+ const id = (0, import_react14.useId)();
878
+ return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("svg", { preserveAspectRatio: "none", overflow: "visible", viewBox: "0 0 16 16", fill: "none", width, height, "aria-hidden": "true", focusable: "false", ...props, children: [
879
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("g", { clipPath: `url(#${id}-clip0_0_89)`, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("path", { d: "M8 0C12.4183 0 16 3.58172 16 8C16 12.4183 12.4183 16 8 16C3.58172 16 0 12.4183 0 8C0 3.58172 3.58172 0 8 0ZM11.9707 5.5293C11.711 5.2696 11.289 5.2696 11.0293 5.5293L7 9.55859L4.9707 7.5293C4.711 7.2696 4.289 7.2696 4.0293 7.5293C3.7696 7.789 3.7696 8.211 4.0293 8.4707L6.5293 10.9707L7 11.4404L7.4707 10.9707L11.9707 6.4707C12.2304 6.211 12.2304 5.789 11.9707 5.5293Z", fillRule: "evenodd", clipRule: "evenodd", fill: "#165DFF" }) }),
880
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("defs", { children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("clipPath", { id: id + "-clip0_0_89", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("rect", { width: "16", height: "16", fill: "white" }) }) })
881
+ ] });
882
+ }
883
+ function ErrorIcon({ size, width = size ?? "16", height = size ?? "16", ...props }) {
884
+ const id = (0, import_react14.useId)();
885
+ return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("svg", { preserveAspectRatio: "none", overflow: "visible", viewBox: "0 0 16 16", fill: "none", width, height, "aria-hidden": "true", focusable: "false", ...props, children: [
886
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("g", { clipPath: `url(#${id}-clip0_0_111)`, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("path", { d: "M8 0C12.4183 0 16 3.58172 16 8C16 12.4183 12.4183 16 8 16C3.58172 16 0 12.4183 0 8C0 3.58172 3.58172 0 8 0ZM8 11.335C7.63273 11.335 7.33496 11.6327 7.33496 12C7.33496 12.3673 7.63273 12.665 8 12.665C8.36726 12.665 8.66504 12.3673 8.66504 12C8.66504 11.6327 8.36727 11.335 8 11.335ZM8 3.33496C7.63273 3.33496 7.33496 3.63273 7.33496 4V9.5C7.33496 9.86727 7.63273 10.165 8 10.165C8.36727 10.165 8.66504 9.86727 8.66504 9.5V4C8.66504 3.63273 8.36727 3.33496 8 3.33496Z", fillRule: "evenodd", clipRule: "evenodd", fill: "#F53F3F" }) }),
887
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("defs", { children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("clipPath", { id: id + "-clip0_0_111", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("rect", { width: "16", height: "16", fill: "white" }) }) })
888
+ ] });
889
+ }
890
+ function LoadingIcon({ size, width = size ?? "16", height = size ?? "16", ...props }) {
891
+ const id = (0, import_react14.useId)();
892
+ return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("svg", { preserveAspectRatio: "none", overflow: "visible", viewBox: "0 0 16 16", fill: "none", width, height, "aria-hidden": "true", focusable: "false", ...props, children: [
893
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("g", { children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("g", { clipPath: `url(#${id}-clip0_0_59)`, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("g", { children: [
894
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("mask", { id: id + "-stroke0_0_59", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("path", { d: "M15 8C15 11.866 11.866 15 8 15C4.13401 15 1 11.866 1 8C1 4.13401 4.13401 1 8 1C11.866 1 15 4.13401 15 8Z", strokeWidth: "2", stroke: "white" }) }),
895
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("g", { clipPath: `url(#${id}-paint0_angular_0_59_clip_path)`, mask: `url(#${id}-stroke0_0_59)`, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("g", { transform: "matrix(0 0.007 -0.007 0 8 8)", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("foreignObject", { x: "-2285.71", y: "-2285.71", width: "4571.43", height: "4571.43", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "sw:h-full sw:w-full sw:bg-[conic-gradient(from_90deg,rgba(22,93,255,0)_0deg,rgba(22,93,255,0.5)_90deg,rgba(22,93,255,0.5)_144deg,rgba(22,93,255,0.5)_216deg,rgba(22,93,255,0)_270deg,rgba(22,93,255,0)_360deg)]" }) }) }) }),
896
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("path", { d: "M15 8C15 11.866 11.866 15 8 15C4.13401 15 1 11.866 1 8C1 4.13401 4.13401 1 8 1C11.866 1 15 4.13401 15 8Z", strokeWidth: "2", stroke: "black", strokeOpacity: "0" })
897
+ ] }) }) }),
898
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("defs", { children: [
899
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("clipPath", { id: id + "-paint0_angular_0_59_clip_path", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("rect", { x: "-8", y: "-8", width: "32", height: "32" }) }),
900
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("clipPath", { id: id + "-clip0_0_59", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("rect", { width: "16", height: "16", rx: "8", fill: "white" }) })
901
+ ] })
902
+ ] });
903
+ }
904
+ function QuestionIcon({ size, width = size ?? "16", height = size ?? "16", ...props }) {
905
+ return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("svg", { preserveAspectRatio: "none", overflow: "visible", viewBox: "0 0 16 16", fill: "none", width, height, "aria-hidden": "true", focusable: "false", ...props, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("g", { children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("path", { d: "M8 0C12.4183 0 16 3.58172 16 8C16 12.4183 12.4183 16 8 16C3.58172 16 0 12.4183 0 8C0 3.58172 3.58172 0 8 0ZM8.07812 10.8281C7.83098 10.8281 7.60858 10.9023 7.43555 11.0752C7.26247 11.2359 7.17578 11.4464 7.17578 11.7061C7.17583 11.9532 7.26258 12.1629 7.43555 12.3359C7.60861 12.509 7.83089 12.5957 8.07812 12.5957C8.32531 12.5957 8.54765 12.5093 8.7207 12.3486C8.89373 12.1756 8.99311 11.9656 8.99316 11.7061C8.99316 11.4464 8.90648 11.2359 8.7334 11.0752C8.56033 10.9022 8.3377 10.8281 8.07812 10.8281ZM8.30078 3.5957C7.38602 3.5957 6.66863 3.85521 6.14941 4.38672C5.76139 4.77474 5.51895 5.26688 5.4209 5.86719C5.36317 6.22084 5.66121 6.51353 6.01953 6.51367C6.37795 6.51367 6.65496 6.21887 6.7334 5.86914C6.78818 5.62477 6.87807 5.41944 7.00293 5.25293C7.25014 4.89448 7.6577 4.72076 8.21387 4.7207C8.65881 4.7207 9.0174 4.84467 9.26465 5.0918C9.49952 5.33903 9.62303 5.67282 9.62305 6.10547C9.62305 6.42685 9.4998 6.72351 9.27734 7.00781L9.06738 7.24316C8.3009 7.92311 7.83064 8.43021 7.66992 8.77637C7.49705 9.09767 7.42287 9.49307 7.42285 9.9502C7.42285 10.0662 7.51688 10.16 7.63281 10.1602H8.53516C8.65123 10.1602 8.74609 10.0663 8.74609 9.9502C8.74611 9.65369 8.80753 9.38188 8.94336 9.13477C9.05462 8.91224 9.228 8.68901 9.46289 8.49121C10.0435 7.98468 10.3896 7.66342 10.501 7.52734C10.81 7.13174 10.9707 6.62432 10.9707 6.01855C10.9706 5.27703 10.7239 4.68358 10.2295 4.25098C9.735 3.80594 9.09195 3.59572 8.30078 3.5957Z", fill: "#165DFF" }) }) });
906
+ }
907
+ function QuestionOrangeIcon({ size, width = size ?? "16", height = size ?? "16", ...props }) {
908
+ return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("svg", { preserveAspectRatio: "none", overflow: "visible", viewBox: "0 0 16 16", fill: "none", width, height, "aria-hidden": "true", focusable: "false", ...props, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("g", { children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("path", { d: "M8 0C12.4183 0 16 3.58172 16 8C16 12.4183 12.4183 16 8 16C3.58172 16 0 12.4183 0 8C0 3.58172 3.58172 0 8 0ZM8.07812 10.8281C7.83098 10.8281 7.60858 10.9023 7.43555 11.0752C7.26247 11.2359 7.17578 11.4464 7.17578 11.7061C7.17583 11.9532 7.26258 12.1629 7.43555 12.3359C7.60861 12.509 7.83089 12.5957 8.07812 12.5957C8.32531 12.5957 8.54765 12.5093 8.7207 12.3486C8.89373 12.1756 8.99311 11.9656 8.99316 11.7061C8.99316 11.4464 8.90648 11.2359 8.7334 11.0752C8.56033 10.9022 8.3377 10.8281 8.07812 10.8281ZM8.30078 3.5957C7.38602 3.5957 6.66863 3.85521 6.14941 4.38672C5.76139 4.77474 5.51895 5.26688 5.4209 5.86719C5.36317 6.22084 5.66121 6.51353 6.01953 6.51367C6.37795 6.51367 6.65496 6.21887 6.7334 5.86914C6.78818 5.62477 6.87807 5.41944 7.00293 5.25293C7.25014 4.89448 7.6577 4.72076 8.21387 4.7207C8.65881 4.7207 9.0174 4.84467 9.26465 5.0918C9.49952 5.33903 9.62303 5.67282 9.62305 6.10547C9.62305 6.42685 9.4998 6.72351 9.27734 7.00781L9.06738 7.24316C8.3009 7.92311 7.83064 8.43021 7.66992 8.77637C7.49705 9.09767 7.42287 9.49307 7.42285 9.9502C7.42285 10.0662 7.51688 10.16 7.63281 10.1602H8.53516C8.65123 10.1602 8.74609 10.0663 8.74609 9.9502C8.74611 9.65369 8.80753 9.38188 8.94336 9.13477C9.05462 8.91224 9.228 8.68901 9.46289 8.49121C10.0435 7.98468 10.3896 7.66342 10.501 7.52734C10.81 7.13174 10.9707 6.62432 10.9707 6.01855C10.9706 5.27703 10.7239 4.68358 10.2295 4.25098C9.735 3.80594 9.09195 3.59572 8.30078 3.5957Z", fill: "#FA8C16" }) }) });
909
+ }
910
+ function SuccessIcon({ size, width = size ?? "16", height = size ?? "16", ...props }) {
911
+ const id = (0, import_react14.useId)();
912
+ return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("svg", { preserveAspectRatio: "none", overflow: "visible", viewBox: "0 0 16 16", fill: "none", width, height, "aria-hidden": "true", focusable: "false", ...props, children: [
913
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("g", { clipPath: `url(#${id}-clip0_0_141)`, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("path", { d: "M8 0C12.4183 0 16 3.58172 16 8C16 12.4183 12.4183 16 8 16C3.58172 16 0 12.4183 0 8C0 3.58172 3.58172 0 8 0ZM11.9707 5.5293C11.711 5.2696 11.289 5.2696 11.0293 5.5293L7 9.55859L4.9707 7.5293C4.711 7.2696 4.289 7.2696 4.0293 7.5293C3.7696 7.789 3.7696 8.211 4.0293 8.4707L6.5293 10.9707L7 11.4404L7.4707 10.9707L11.9707 6.4707C12.2304 6.211 12.2304 5.789 11.9707 5.5293Z", fillRule: "evenodd", clipRule: "evenodd", fill: "#0DC15B" }) }),
914
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("defs", { children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("clipPath", { id: id + "-clip0_0_141", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("rect", { width: "16", height: "16", fill: "white" }) }) })
915
+ ] });
916
+ }
917
+ function WaitingIcon({ size, width = size ?? "16", height = size ?? "16", ...props }) {
918
+ const id = (0, import_react14.useId)();
919
+ return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("svg", { preserveAspectRatio: "none", overflow: "visible", viewBox: "0 0 16 16", fill: "none", width, height, "aria-hidden": "true", focusable: "false", ...props, children: [
920
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("g", { clipPath: `url(#${id}-clip0_0_115)`, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("path", { d: "M8 0C12.4183 0 16 3.58172 16 8C16 12.4183 12.4183 16 8 16C3.58172 16 0 12.4183 0 8C1.88982e-07 3.58172 3.58172 1.88988e-07 8 0ZM8 3.33496C7.63273 3.33496 7.33496 3.63273 7.33496 4V8C7.33496 8.36727 7.63273 8.66504 8 8.66504H12C12.3673 8.66504 12.665 8.36727 12.665 8C12.665 7.63273 12.3673 7.33496 12 7.33496H8.66504V4C8.66504 3.63273 8.36727 3.33496 8 3.33496Z", fillRule: "evenodd", clipRule: "evenodd", fill: "#165DFF" }) }),
921
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("defs", { children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("clipPath", { id: id + "-clip0_0_115", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("rect", { width: "16", height: "16", fill: "white" }) }) })
922
+ ] });
923
+ }
924
+ function WaitingOrangeIcon({ size, width = size ?? "16", height = size ?? "16", ...props }) {
925
+ const id = (0, import_react14.useId)();
926
+ return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("svg", { preserveAspectRatio: "none", overflow: "visible", viewBox: "0 0 16 16", fill: "none", width, height, "aria-hidden": "true", focusable: "false", ...props, children: [
927
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("g", { clipPath: `url(#${id}-clip0_0_107)`, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("path", { d: "M8 0C12.4183 0 16 3.58172 16 8C16 12.4183 12.4183 16 8 16C3.58172 16 0 12.4183 0 8C1.88982e-07 3.58172 3.58172 1.88988e-07 8 0ZM8 3.33496C7.63273 3.33496 7.33496 3.63273 7.33496 4V8C7.33496 8.36727 7.63273 8.66504 8 8.66504H12C12.3673 8.66504 12.665 8.36727 12.665 8C12.665 7.63273 12.3673 7.33496 12 7.33496H8.66504V4C8.66504 3.63273 8.36727 3.33496 8 3.33496Z", fillRule: "evenodd", clipRule: "evenodd", fill: "#FA8C16" }) }),
928
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("defs", { children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("clipPath", { id: id + "-clip0_0_107", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("rect", { width: "16", height: "16", fill: "white" }) }) })
929
+ ] });
930
+ }
931
+ function WarningIcon({ size, width = size ?? "16", height = size ?? "16", ...props }) {
932
+ const id = (0, import_react14.useId)();
933
+ return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("svg", { preserveAspectRatio: "none", overflow: "visible", viewBox: "0 0 16 16", fill: "none", width, height, "aria-hidden": "true", focusable: "false", ...props, children: [
934
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("g", { clipPath: `url(#${id}-clip0_0_119)`, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("path", { d: "M8 0C12.4183 0 16 3.58172 16 8C16 12.4183 12.4183 16 8 16C3.58172 16 0 12.4183 0 8C0 3.58172 3.58172 0 8 0ZM8 11.335C7.63273 11.335 7.33496 11.6327 7.33496 12C7.33496 12.3673 7.63273 12.665 8 12.665C8.36726 12.665 8.66504 12.3673 8.66504 12C8.66504 11.6327 8.36727 11.335 8 11.335ZM8 3.33496C7.63273 3.33496 7.33496 3.63273 7.33496 4V9.5C7.33496 9.86727 7.63273 10.165 8 10.165C8.36727 10.165 8.66504 9.86727 8.66504 9.5V4C8.66504 3.63273 8.36727 3.33496 8 3.33496Z", fillRule: "evenodd", clipRule: "evenodd", fill: "#FA8C16" }) }),
935
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("defs", { children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("clipPath", { id: id + "-clip0_0_119", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("rect", { width: "16", height: "16", fill: "white" }) }) })
936
+ ] });
937
+ }
938
+ var alertStatusIcons = {
939
+ done: DoneIcon,
940
+ error: ErrorIcon,
941
+ loading: LoadingIcon,
942
+ question: QuestionIcon,
943
+ questionOrange: QuestionOrangeIcon,
944
+ success: SuccessIcon,
945
+ waiting: WaitingIcon,
946
+ waitingOrange: WaitingOrangeIcon,
947
+ warning: WarningIcon
948
+ };
949
+ var alertIcons = {
950
+ ...alertStatusIcons,
951
+ close: CloseIcon,
952
+ closeNormal: CloseNormalIcon
953
+ };
954
+
955
+ // src/components/Alert/Alert.tsx
956
+ var import_jsx_runtime15 = require("react/jsx-runtime");
957
+ var alertClassNames = {
958
+ root: "sw:inline-block sw:max-w-full sw:border-0 sw:[font-family:PingFang_SC,sans-serif] sw:tracking-[0px] sw:not-italic sw:shadow-[inset_0_0_0_1px_rgba(0,0,0,0.08),0_8px_16px_rgba(0,0,0,0.1)]",
959
+ banner: "sw:shadow-[inset_0_0_0_1px_#fee8d0,0_8px_16px_rgba(0,0,0,0.1)]",
960
+ wrapper: "sw:h-full sw:items-center sw:gap-[8px]",
961
+ body: "sw:min-w-0 sw:gap-[4px]",
962
+ message: "sw:text-[14px] sw:font-normal sw:leading-[22px] sw:text-[#262626] sw:whitespace-nowrap",
963
+ title: "sw:p-0 sw:text-[14px] sw:font-medium sw:leading-[22px]",
964
+ icon: "sw:m-0 sw:h-[16px] sw:w-[16px] sw:shrink-0 sw:items-center sw:justify-center",
965
+ closeButton: "sw:h-[24px] sw:w-[24px] sw:shrink-0 sw:rounded-[6px] sw:p-0 sw:text-[#262626]"
966
+ };
967
+ function renderAlertIcon(status) {
968
+ const StatusIcon = alertStatusIcons[status];
969
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: status === "loading" ? "sw:motion-safe:animate-spin" : void 0, children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(StatusIcon, {}) });
970
+ }
971
+ function resolveAlertProps({ status = "success", appearance = "message", withCloseButton = false, closeButtonLabel = "\u5173\u95ED\u63D0\u793A", icon, attributes, ...props } = {}) {
972
+ const CloseIcon2 = appearance === "banner" ? alertIcons.close : alertIcons.closeNormal;
973
+ return {
974
+ radius: 8,
975
+ h: props.title ? void 0 : 40,
976
+ px: 16,
977
+ py: props.title ? 8 : 0,
978
+ pr: withCloseButton ? 8 : 16,
979
+ bg: appearance === "banner" ? "#fff9f3" : "#ffffff",
980
+ c: "#262626",
981
+ ...props,
982
+ withCloseButton,
983
+ closeButtonLabel,
984
+ icon: icon === void 0 ? renderAlertIcon(status) : icon,
985
+ attributes: {
986
+ ...attributes,
987
+ closeButton: { icon: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(CloseIcon2, {}), ...attributes?.closeButton }
988
+ }
989
+ };
990
+ }
991
+ function resolveAlertClassNames({ appearance = "message" } = {}, overrides = {}) {
992
+ return {
993
+ ...overrides,
994
+ root: (0, import_clsx12.default)(alertClassNames.root, appearance === "banner" && alertClassNames.banner, overrides.root),
995
+ wrapper: (0, import_clsx12.default)(alertClassNames.wrapper, overrides.wrapper),
996
+ body: (0, import_clsx12.default)(alertClassNames.body, overrides.body),
997
+ message: (0, import_clsx12.default)(alertClassNames.message, overrides.message),
998
+ title: (0, import_clsx12.default)(alertClassNames.title, overrides.title),
999
+ icon: (0, import_clsx12.default)(alertClassNames.icon, overrides.icon),
1000
+ closeButton: (0, import_clsx12.default)(alertClassNames.closeButton, overrides.closeButton)
1001
+ };
1002
+ }
1003
+ var Alert = (0, import_react15.forwardRef)(({ classNames, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_core12.Alert, { ...resolveAlertProps(props), ref, classNames: (theme, values, ctx) => resolveAlertClassNames(props, typeof classNames === "function" ? classNames(theme, values, ctx) : classNames) }));
1004
+ Alert.displayName = "SWorks/Alert";
1005
+
1006
+ // src/components/Toast/Toast.tsx
1007
+ var import_react16 = require("react");
1008
+ var import_clsx13 = __toESM(require("clsx"));
1009
+ var import_jsx_runtime16 = require("react/jsx-runtime");
1010
+ function resolveToastClassNames(overrides = {}) {
1011
+ return {
1012
+ ...overrides,
1013
+ root: (0, import_clsx13.default)("sw:pointer-events-auto", overrides.root),
1014
+ message: (0, import_clsx13.default)("sw:!whitespace-normal sw:break-words", overrides.message)
1015
+ };
1016
+ }
1017
+ var Toast = (0, import_react16.forwardRef)(({ autoClose = 4e3, onClose, withCloseButton = Boolean(onClose), classNames, role = "status", ...props }, ref) => {
1018
+ const [hovered, setHovered] = (0, import_react16.useState)(false);
1019
+ const [focused, setFocused] = (0, import_react16.useState)(false);
1020
+ const focusBeforeToast = (0, import_react16.useRef)(null);
1021
+ (0, import_react16.useEffect)(() => {
1022
+ if (!onClose || autoClose === false || hovered || focused)
1023
+ return;
1024
+ const timeout = window.setTimeout(onClose, autoClose);
1025
+ return () => window.clearTimeout(timeout);
1026
+ }, [autoClose, focused, hovered, onClose]);
1027
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "sw:pointer-events-none sw:fixed sw:inset-x-[20px] sw:top-[80px] sw:z-50 sw:flex sw:justify-center", onMouseEnter: () => setHovered(true), onMouseLeave: () => setHovered(false), onFocusCapture: (event) => {
1028
+ if (!event.currentTarget.contains(event.relatedTarget)) {
1029
+ focusBeforeToast.current = event.relatedTarget instanceof HTMLElement ? event.relatedTarget : null;
1030
+ setFocused(true);
1031
+ }
1032
+ }, onBlurCapture: (event) => {
1033
+ if (!event.currentTarget.contains(event.relatedTarget))
1034
+ setFocused(false);
1035
+ }, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Alert, { ref, appearance: "message", role, "aria-live": role === "alert" ? "assertive" : "polite", "aria-atomic": "true", h: "auto", mih: 40, py: 8, ...props, withCloseButton: withCloseButton && Boolean(onClose), onClose: () => {
1036
+ if (focused && focusBeforeToast.current?.isConnected) {
1037
+ focusBeforeToast.current.focus({ preventScroll: true });
1038
+ }
1039
+ onClose?.();
1040
+ }, classNames: (theme, values, context) => resolveToastClassNames(typeof classNames === "function" ? classNames(theme, values, context) : classNames) }) });
1041
+ });
1042
+ Toast.displayName = "SWorks/Toast";
1043
+
1044
+ // src/components/Modal/Modal.tsx
1045
+ var import_react18 = require("react");
1046
+ var import_core13 = require("@s-works/s-works-ui/core");
1047
+ var import_clsx14 = __toESM(require("clsx"));
1048
+
1049
+ // src/components/Modal/icons.tsx
1050
+ var import_react17 = require("react");
1051
+ var import_jsx_runtime17 = require("react/jsx-runtime");
1052
+ function ModalCloseIcon(props) {
1053
+ return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("svg", { preserveAspectRatio: "none", overflow: "visible", width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", "aria-hidden": "true", focusable: "false", ...props, children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("g", { children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("path", { d: "M13.0296 2.02974C13.2893 1.77005 13.7113 1.77005 13.971 2.02974C14.2303 2.28947 14.2306 2.71157 13.971 2.97115L8.94169 8.00045L13.971 13.0297C14.2303 13.2895 14.2306 13.7116 13.971 13.9711C13.7114 14.2307 13.2893 14.2305 13.0296 13.9711L8.00028 8.94185L2.97099 13.9711C2.7114 14.2307 2.28929 14.2305 2.02958 13.9711C1.7699 13.7115 1.76994 13.2894 2.02958 13.0297L7.05888 8.00045L2.02958 2.97115C1.7699 2.71147 1.76994 2.28945 2.02958 2.02974C2.28928 1.77005 2.71129 1.77005 2.97099 2.02974L8.00028 7.05904L13.0296 2.02974Z", fill: "#262626" }) }) });
1054
+ }
1055
+ function ModalErrorIcon(props) {
1056
+ const id = (0, import_react17.useId)();
1057
+ return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("svg", { preserveAspectRatio: "none", overflow: "visible", width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", "aria-hidden": "true", focusable: "false", ...props, children: [
1058
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("g", { clipPath: `url(#${id}-clip0_0_235)`, children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("path", { d: "M12 0C18.6274 0 24 5.37258 24 12C24 18.6274 18.6274 24 12 24C5.37258 24 0 18.6274 0 12C0 5.37258 5.37258 0 12 0ZM16.4561 7.54395C16.0665 7.1544 15.4335 7.1544 15.0439 7.54395L12 10.5879L8.95605 7.54395C8.56651 7.1544 7.93349 7.1544 7.54395 7.54395C7.1544 7.93349 7.1544 8.56651 7.54395 8.95605L10.5879 12L7.54395 15.0439C7.1544 15.4335 7.1544 16.0665 7.54395 16.4561C7.93349 16.8456 8.56651 16.8456 8.95605 16.4561L12 13.4121L15.0439 16.4561C15.4335 16.8456 16.0665 16.8456 16.4561 16.4561C16.8456 16.0665 16.8456 15.4335 16.4561 15.0439L13.4121 12L16.4561 8.95605C16.8456 8.56651 16.8456 7.93349 16.4561 7.54395Z", fillRule: "evenodd", clipRule: "evenodd", fill: "#F53F3F" }) }),
1059
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("defs", { children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("clipPath", { id: id + "-clip0_0_235", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("rect", { width: "24", height: "24", fill: "white" }) }) })
1060
+ ] });
1061
+ }
1062
+ function ModalSuccessIcon(props) {
1063
+ const id = (0, import_react17.useId)();
1064
+ return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("svg", { preserveAspectRatio: "none", overflow: "visible", width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", "aria-hidden": "true", focusable: "false", ...props, children: [
1065
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("g", { clipPath: `url(#${id}-clip0_0_295)`, children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("path", { d: "M12 0C18.6274 0 24 5.37258 24 12C24 18.6274 18.6274 24 12 24C5.37258 24 0 18.6274 0 12C0 5.37258 5.37258 0 12 0ZM17.9561 8.29395C17.5665 7.9044 16.9335 7.9044 16.5439 8.29395L10.5 14.3379L7.45605 11.2939C7.06651 10.9044 6.43349 10.9044 6.04395 11.2939C5.6544 11.6835 5.6544 12.3165 6.04395 12.7061L9.79395 16.4561L10.5 17.1606L11.2061 16.4561L17.9561 9.70605C18.3456 9.31651 18.3456 8.68349 17.9561 8.29395Z", fillRule: "evenodd", clipRule: "evenodd", fill: "#00D58A" }) }),
1066
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("defs", { children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("clipPath", { id: id + "-clip0_0_295", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("rect", { width: "24", height: "24", fill: "white" }) }) })
1067
+ ] });
1068
+ }
1069
+ function ModalWarningIcon(props) {
1070
+ const id = (0, import_react17.useId)();
1071
+ return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("svg", { preserveAspectRatio: "none", overflow: "visible", width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", "aria-hidden": "true", focusable: "false", ...props, children: [
1072
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("g", { clipPath: `url(#${id}-clip0_0_315)`, children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("path", { d: "M12 0C18.6274 0 24 5.37258 24 12C24 18.6274 18.6274 24 12 24C5.37258 24 0 18.6274 0 12C0 5.37258 5.37258 0 12 0ZM12 17.0024C11.4491 17.0024 11.0024 17.4491 11.0024 18C11.0024 18.5509 11.4491 18.9976 12 18.9976C12.5509 18.9975 12.9976 18.5509 12.9976 18C12.9976 17.4491 12.5509 17.0024 12 17.0024ZM12 5.00244C11.4491 5.00245 11.0024 5.4491 11.0024 6V14.25C11.0024 14.8009 11.4491 15.2476 12 15.2476C12.5509 15.2476 12.9976 14.8009 12.9976 14.25V6C12.9976 5.4491 12.5509 5.00244 12 5.00244Z", fillRule: "evenodd", clipRule: "evenodd", fill: "#FA8C16" }) }),
1073
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("defs", { children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("clipPath", { id: id + "-clip0_0_315", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("rect", { width: "24", height: "24", fill: "white" }) }) })
1074
+ ] });
1075
+ }
1076
+ function ModalEditIcon(props) {
1077
+ const id = (0, import_react17.useId)();
1078
+ return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("svg", { preserveAspectRatio: "none", overflow: "visible", width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", "aria-hidden": "true", focusable: "false", ...props, children: [
1079
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("g", { children: /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("g", { children: [
1080
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("path", { d: "M14.5826 4.41504C14.5826 4.85667 14.4076 5.2805 14.0953 5.59277L6.0885 13.5996C5.90016 13.7879 5.66747 13.9265 5.41174 14.001L3.49768 14.5596C3.39729 14.5889 3.29039 14.5904 3.18909 14.5645C3.08792 14.5385 2.9954 14.4859 2.92151 14.4121C2.84757 14.3382 2.79512 14.2449 2.76917 14.1436C2.74329 14.0424 2.74482 13.9362 2.77405 13.8359L3.33264 11.9209C3.40722 11.6656 3.54493 11.4332 3.73303 11.2451L11.7408 3.2373C12.053 2.92534 12.4763 2.75009 12.9176 2.75C13.3591 2.75 13.7831 2.92517 14.0953 3.2373C14.4076 3.54955 14.5826 3.97345 14.5826 4.41504Z", fill: `url(#${id}-paint0_linear_0_303)` }),
1081
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("path", { d: "M13.9998 12.6681L14.1336 12.6818C14.4368 12.7437 14.6649 13.0117 14.6649 13.3332C14.6649 13.6546 14.4368 13.9227 14.1336 13.9845L13.9998 13.9982H9.07406C8.70679 13.9982 8.40902 13.7004 8.40902 13.3332C8.40902 12.9659 8.70679 12.6681 9.07406 12.6681H13.9998Z", fill: `url(#${id}-paint1_linear_0_303)` }),
1082
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("path", { d: "M4.24265 6.24973C4.29294 6.27847 4.35402 6.29284 4.42587 6.29284C4.49772 6.29284 4.55879 6.27847 4.60909 6.24973C4.65938 6.22098 4.6989 6.17069 4.72764 6.09884L5.35274 4.63308L6.92628 3.94331C6.99813 3.91457 7.04842 3.87506 7.07716 3.82476C7.1059 3.77446 7.12027 3.71339 7.12027 3.64154C7.12027 3.56969 7.1059 3.50862 7.07716 3.45832C7.04842 3.40802 6.99813 3.36851 6.92628 3.33977L5.35274 2.67155L4.72764 1.27046C4.6989 1.19861 4.65938 1.14832 4.60909 1.11958C4.55879 1.09084 4.49772 1.07646 4.42587 1.07646C4.35402 1.07646 4.29294 1.09084 4.24265 1.11958C4.19235 1.14832 4.15284 1.19861 4.1241 1.27046L3.49899 2.67155L1.92546 3.33977C1.85361 3.36851 1.80331 3.40802 1.77457 3.45832C1.74583 3.50862 1.73146 3.56969 1.73146 3.64154C1.73146 3.71339 1.74583 3.77446 1.77457 3.82476C1.80331 3.87506 1.85361 3.91457 1.92546 3.94331L3.49899 4.63308L4.1241 6.09884C4.15284 6.17069 4.19235 6.22098 4.24265 6.24973Z", fill: `url(#${id}-paint2_linear_0_303)` })
1083
+ ] }) }),
1084
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("defs", { children: [
1085
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("linearGradient", { id: id + "-paint0_linear_0_303", x1: "8.90395", y1: "0.21206", x2: "8.90395", y2: "14.5828", gradientUnits: "userSpaceOnUse", children: [
1086
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("stop", { stopColor: "#4318FF" }),
1087
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("stop", { offset: "1", stopColor: "#165DFF" })
1088
+ ] }),
1089
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("linearGradient", { id: id + "-paint1_linear_0_303", x1: "8.90395", y1: "0.21206", x2: "8.90395", y2: "14.5828", gradientUnits: "userSpaceOnUse", children: [
1090
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("stop", { stopColor: "#4318FF" }),
1091
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("stop", { offset: "1", stopColor: "#165DFF" })
1092
+ ] }),
1093
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("linearGradient", { id: id + "-paint2_linear_0_303", x1: "8.90395", y1: "0.21206", x2: "8.90395", y2: "14.5828", gradientUnits: "userSpaceOnUse", children: [
1094
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("stop", { stopColor: "#4318FF" }),
1095
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("stop", { offset: "1", stopColor: "#165DFF" })
1096
+ ] })
1097
+ ] })
1098
+ ] });
1099
+ }
1100
+ function ModalStatusIcon({ status, ...props }) {
1101
+ const Icon = {
1102
+ error: ModalErrorIcon,
1103
+ success: ModalSuccessIcon,
1104
+ warning: ModalWarningIcon,
1105
+ edit: ModalEditIcon
1106
+ }[status];
1107
+ return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Icon, { ...props });
1108
+ }
1109
+
1110
+ // src/components/Modal/Modal.tsx
1111
+ var import_jsx_runtime18 = require("react/jsx-runtime");
1112
+ function resolveModalClassNames({ layout = "standard" } = {}, overrides = {}) {
1113
+ return {
1114
+ ...overrides,
1115
+ content: (0, import_clsx14.default)("sw:flex sw:flex-col sw:bg-white sw:text-[#262626] sw:[font-family:PingFang_SC,sans-serif] sw:tracking-[0px] sw:shadow-[0_8px_16px_rgba(0,0,0,0.1)]", layout === "share" ? "sw:p-[16px]" : layout !== "form" && "sw:p-[24px]", overrides.content),
1116
+ header: (0, import_clsx14.default)("sw:min-h-0 sw:shrink-0 sw:bg-white", layout === "form" ? "sw:h-[64px] sw:px-[16px] sw:py-[12px] sw:shadow-[inset_0_-1px_0_rgba(0,0,0,0.05)]" : void 0, overrides.header),
1117
+ title: (0, import_clsx14.default)("sw:min-w-0 sw:flex-1 sw:text-[16px] sw:font-medium sw:text-black", layout === "form" ? "sw:leading-[24px]" : "sw:leading-[28px]", overrides.title),
1118
+ close: (0, import_clsx14.default)("sw:m-0 sw:shrink-0 sw:rounded-[6px] sw:text-[#262626]", layout === "form" ? "sw:h-[32px] sw:w-[32px]" : "sw:h-[24px] sw:w-[24px]", overrides.close),
1119
+ body: (0, import_clsx14.default)("sw:flex sw:min-h-0 sw:flex-auto sw:flex-col sw:text-[14px] sw:font-normal sw:leading-[24px]", overrides.body)
1120
+ };
1121
+ }
1122
+ var ModalComponent = (0, import_react18.forwardRef)(({ layout = "standard", headerIcon, status, footer, bodyHeight, title, children, classNames, closeButtonProps, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_core13.Modal, { ref, centered: true, size: layout === "compact" ? 320 : layout === "form" ? 640 : 400, radius: 16, padding: 0, withCloseButton: layout !== "compact", ...props, title: title && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("span", { className: "sw:flex sw:min-w-0 sw:items-center sw:gap-[8px]", children: [
1123
+ headerIcon ?? (status && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(ModalStatusIcon, { status, className: status === "edit" ? "sw:mx-[4px] sw:h-[16px] sw:w-[16px] sw:shrink-0" : "sw:h-[24px] sw:w-[24px] sw:shrink-0" })),
1124
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: layout === "compact" ? "sw:min-w-0" : "sw:min-w-0 sw:truncate", children: title })
1125
+ ] }), closeButtonProps: {
1126
+ "aria-label": "\u5173\u95ED\u5F39\u7A97",
1127
+ icon: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(ModalCloseIcon, { className: "sw:h-[16px] sw:w-[16px]" }),
1128
+ ...closeButtonProps
1129
+ }, classNames: resolveModalClassNames({ layout }, classNames), children: [
1130
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_core13.ScrollArea, { h: bodyHeight, type: "auto", classNames: {
1131
+ root: layout === "form" ? "sw:flex sw:max-h-[464px] sw:min-h-0 sw:flex-col" : "sw:flex sw:min-h-0 sw:flex-col",
1132
+ viewport: "sw:h-auto sw:min-h-0 sw:flex-auto"
1133
+ }, children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: layout === "form" ? "sw:px-[24px] sw:py-[16px]" : layout === "share" ? "sw:pt-[8px]" : layout === "editor" ? "sw:pt-[12px]" : title ? "sw:py-[12px]" : "", children }) }),
1134
+ footer && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: layout === "form" ? "sw:flex sw:min-h-[72px] sw:shrink-0 sw:items-center sw:justify-between sw:gap-[12px] sw:px-[24px] sw:pb-[24px] sw:pt-[16px]" : title ? "sw:mt-[8px] sw:shrink-0" : "sw:mt-[24px] sw:shrink-0", children: footer })
1135
+ ] }));
1136
+ ModalComponent.displayName = "SWorks/Modal";
1137
+ var Modal = Object.assign(ModalComponent, {
1138
+ Root: import_core13.Modal.Root,
1139
+ Overlay: import_core13.Modal.Overlay,
1140
+ Content: import_core13.Modal.Content,
1141
+ Header: import_core13.Modal.Header,
1142
+ Title: import_core13.Modal.Title,
1143
+ Body: import_core13.Modal.Body,
1144
+ CloseButton: import_core13.Modal.CloseButton,
1145
+ Stack: import_core13.Modal.Stack
1146
+ });
1147
+
1148
+ // src/components/DateInput/DateInput.tsx
1149
+ var import_react19 = require("react");
1150
+ var import_clsx15 = __toESM(require("clsx"));
1151
+ var import_core15 = require("@s-works/s-works-ui/core");
1152
+ var import_hooks2 = require("@s-works/s-works-ui/hooks");
1153
+ var import_dates = require("@s-works/s-works-ui/dates");
1154
+
1155
+ // src/components/DateRangeShortcuts.tsx
1156
+ var import_core14 = require("@s-works/s-works-ui/core");
1157
+ var import_dayjs = __toESM(require("dayjs"));
1158
+ var import_jsx_runtime19 = require("react/jsx-runtime");
1159
+ var dateShortcutClasses = {
1160
+ root: "sw:h-[24px] sw:min-h-0 sw:border sw:border-solid sw:border-black/[0.08] sw:bg-white sw:px-[8px] sw:py-0 sw:text-[12px] sw:font-normal sw:leading-[18px] sw:text-[#262626] sw:hover:bg-[#f2f3f5] sw:disabled:bg-[#f2f3f5] sw:disabled:text-[#bfbfbf]",
1161
+ label: "sw:font-normal"
1162
+ };
1163
+ function isDateShortcutDisabled(date, { minDate, maxDate, excludeDate, getDayProps }) {
1164
+ return Boolean(minDate && (0, import_dayjs.default)(date).isBefore(minDate, "day") || maxDate && (0, import_dayjs.default)(date).isAfter(maxDate, "day") || excludeDate?.(date) || getDayProps?.(date)?.disabled);
1165
+ }
1166
+ function DateRangeShortcuts({ disabled, onChange, ...limits }) {
1167
+ const now = (0, import_dayjs.default)();
1168
+ const today = now.format("YYYY-MM-DD");
1169
+ const shortcuts = [
1170
+ ["\u4ECA\u5929", today, today],
1171
+ ["\u8FD17\u5929", now.subtract(6, "day").format("YYYY-MM-DD"), today],
1172
+ ["\u8FD130\u5929", now.subtract(29, "day").format("YYYY-MM-DD"), today],
1173
+ ["\u672C\u6708", now.startOf("month").format("YYYY-MM-DD"), now.endOf("month").format("YYYY-MM-DD")]
1174
+ ];
1175
+ return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { role: "group", "aria-label": "\u65E5\u671F\u533A\u95F4\u5FEB\u6377\u9009\u62E9", className: "sw:flex sw:flex-wrap sw:gap-[8px]", children: shortcuts.map(([label, start, end]) => /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_core14.Button, { type: "button", radius: 4, disabled: disabled || isDateShortcutDisabled(start, limits) || start !== end && isDateShortcutDisabled(end, limits), classNames: dateShortcutClasses, onClick: () => onChange([start, end]), children: label }, label)) });
1176
+ }
1177
+
1178
+ // src/components/DateInput/icons.tsx
1179
+ var import_jsx_runtime20 = require("react/jsx-runtime");
1180
+ function Calendar(props) {
1181
+ return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("svg", { ...props, preserveAspectRatio: "none", overflow: "visible", width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("g", { id: "Calendar", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("path", { id: "Vector (Stroke)", d: "M13.333 7.33333H2.66699V13.3333C2.66699 13.7014 2.96497 14.0002 3.33301 14.0003H12.667C13.035 14.0002 13.333 13.7014 13.333 13.3333V7.33333ZM10 4.00033V3.33333H6V4.00033C5.99982 4.36837 5.70109 4.66634 5.33301 4.66634C4.96508 4.66617 4.66717 4.36826 4.66699 4.00033V3.33333H3.33301C2.96497 3.33351 2.66699 3.63224 2.66699 4.00033V6.00033H13.333V4.00033C13.333 3.63224 13.035 3.33351 12.667 3.33333H11.333V4.00033C11.3328 4.36826 11.0349 4.66617 10.667 4.66634C10.2989 4.66634 10.0002 4.36837 10 4.00033ZM14.667 13.3333C14.667 14.4378 13.7714 15.3332 12.667 15.3333H3.33301C2.22859 15.3332 1.33301 14.4378 1.33301 13.3333V4.00033C1.33301 2.89586 2.22859 2.0005 3.33301 2.00033H4.66699V1.33333C4.66699 0.965252 4.96497 0.666517 5.33301 0.666341C5.7012 0.666341 6 0.965144 6 1.33333V2.00033H10V1.33333C10 0.965144 10.2988 0.666341 10.667 0.666341C11.035 0.666517 11.333 0.965252 11.333 1.33333V2.00033H12.667C13.7714 2.0005 14.667 2.89586 14.667 4.00033V13.3333Z", fill: "#262626" }) }) });
1182
+ }
1183
+ function CalendarFocus(props) {
1184
+ return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("svg", { ...props, preserveAspectRatio: "none", overflow: "visible", width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("g", { id: "Calendar", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("path", { id: "Vector (Stroke)", d: "M13.333 7.33333H2.66699V13.3333C2.66699 13.7014 2.96497 14.0002 3.33301 14.0003H12.667C13.035 14.0002 13.333 13.7014 13.333 13.3333V7.33333ZM10 4.00033V3.33333H6V4.00033C5.99982 4.36837 5.70109 4.66634 5.33301 4.66634C4.96508 4.66617 4.66717 4.36826 4.66699 4.00033V3.33333H3.33301C2.96497 3.33351 2.66699 3.63224 2.66699 4.00033V6.00033H13.333V4.00033C13.333 3.63224 13.035 3.33351 12.667 3.33333H11.333V4.00033C11.3328 4.36826 11.0349 4.66617 10.667 4.66634C10.2989 4.66634 10.0002 4.36837 10 4.00033ZM14.667 13.3333C14.667 14.4378 13.7714 15.3332 12.667 15.3333H3.33301C2.22859 15.3332 1.33301 14.4378 1.33301 13.3333V4.00033C1.33301 2.89586 2.22859 2.0005 3.33301 2.00033H4.66699V1.33333C4.66699 0.965252 4.96497 0.666517 5.33301 0.666341C5.7012 0.666341 6 0.965144 6 1.33333V2.00033H10V1.33333C10 0.965144 10.2988 0.666341 10.667 0.666341C11.035 0.666517 11.333 0.965252 11.333 1.33333V2.00033H12.667C13.7714 2.0005 14.667 2.89586 14.667 4.00033V13.3333Z", fill: "#165DFF" }) }) });
1185
+ }
1186
+ function CalendarDisabled(props) {
1187
+ return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("svg", { ...props, preserveAspectRatio: "none", overflow: "visible", width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("g", { id: "Calendar", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("path", { id: "Vector (Stroke)", d: "M13.333 7.33333H2.66699V13.3333C2.66699 13.7014 2.96497 14.0002 3.33301 14.0003H12.667C13.035 14.0002 13.333 13.7014 13.333 13.3333V7.33333ZM10 4.00033V3.33333H6V4.00033C5.99982 4.36837 5.70109 4.66634 5.33301 4.66634C4.96508 4.66617 4.66717 4.36826 4.66699 4.00033V3.33333H3.33301C2.96497 3.33351 2.66699 3.63224 2.66699 4.00033V6.00033H13.333V4.00033C13.333 3.63224 13.035 3.33351 12.667 3.33333H11.333V4.00033C11.3328 4.36826 11.0349 4.66617 10.667 4.66634C10.2989 4.66634 10.0002 4.36837 10 4.00033ZM14.667 13.3333C14.667 14.4378 13.7714 15.3332 12.667 15.3333H3.33301C2.22859 15.3332 1.33301 14.4378 1.33301 13.3333V4.00033C1.33301 2.89586 2.22859 2.0005 3.33301 2.00033H4.66699V1.33333C4.66699 0.965252 4.96497 0.666517 5.33301 0.666341C5.7012 0.666341 6 0.965144 6 1.33333V2.00033H10V1.33333C10 0.965144 10.2988 0.666341 10.667 0.666341C11.035 0.666517 11.333 0.965252 11.333 1.33333V2.00033H12.667C13.7714 2.0005 14.667 2.89586 14.667 4.00033V13.3333Z", fill: "#BFBFBF" }) }) });
1188
+ }
1189
+ function CalendarMini(props) {
1190
+ return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("svg", { ...props, preserveAspectRatio: "none", overflow: "visible", width: "12", height: "12", viewBox: "0 0 12 12", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("g", { id: "Calendar", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("path", { id: "Vector (Stroke)", d: "M9.99976 5.5H2.00024V10C2.00024 10.2761 2.22373 10.5001 2.49976 10.5002H9.50024C9.77627 10.5001 9.99976 10.2761 9.99976 10V5.5ZM7.5 3.00024V2.5H4.5V3.00024C4.49987 3.27627 4.27582 3.49976 3.99976 3.49976C3.72381 3.49962 3.50038 3.27619 3.50024 3.00024V2.5H2.49976C2.22373 2.50013 2.00024 2.72418 2.00024 3.00024V4.50024H9.99976V3.00024C9.99976 2.72418 9.77627 2.50013 9.50024 2.5H8.49976V3.00024C8.49962 3.27619 8.27619 3.49962 8.00024 3.49976C7.72418 3.49976 7.50013 3.27627 7.5 3.00024ZM11.0002 10C11.0002 10.8283 10.3286 11.4999 9.50024 11.5H2.49976C1.67144 11.4999 0.999756 10.8283 0.999756 10V3.00024C0.999756 2.1719 1.67144 1.50038 2.49976 1.50024H3.50024V1C3.50024 0.723939 3.72373 0.499888 3.99976 0.499756C4.2759 0.499756 4.5 0.723858 4.5 1V1.50024H7.5V1C7.5 0.723858 7.7241 0.499756 8.00024 0.499756C8.27627 0.499888 8.49976 0.723939 8.49976 1V1.50024H9.50024C10.3286 1.50038 11.0002 2.1719 11.0002 3.00024V10Z", fill: "#262626" }) }) });
1191
+ }
1192
+ function CalendarMiniFocus(props) {
1193
+ return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("svg", { ...props, preserveAspectRatio: "none", overflow: "visible", width: "12", height: "12", viewBox: "0 0 12 12", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("g", { id: "Calendar", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("path", { id: "Vector (Stroke)", d: "M9.99976 5.5H2.00024V10C2.00024 10.2761 2.22373 10.5001 2.49976 10.5002H9.50024C9.77627 10.5001 9.99976 10.2761 9.99976 10V5.5ZM7.5 3.00024V2.5H4.5V3.00024C4.49987 3.27627 4.27582 3.49976 3.99976 3.49976C3.72381 3.49962 3.50038 3.27619 3.50024 3.00024V2.5H2.49976C2.22373 2.50013 2.00024 2.72418 2.00024 3.00024V4.50024H9.99976V3.00024C9.99976 2.72418 9.77627 2.50013 9.50024 2.5H8.49976V3.00024C8.49962 3.27619 8.27619 3.49962 8.00024 3.49976C7.72418 3.49976 7.50013 3.27627 7.5 3.00024ZM11.0002 10C11.0002 10.8283 10.3286 11.4999 9.50024 11.5H2.49976C1.67144 11.4999 0.999756 10.8283 0.999756 10V3.00024C0.999756 2.1719 1.67144 1.50038 2.49976 1.50024H3.50024V1C3.50024 0.723939 3.72373 0.499888 3.99976 0.499756C4.2759 0.499756 4.5 0.723858 4.5 1V1.50024H7.5V1C7.5 0.723858 7.7241 0.499756 8.00024 0.499756C8.27627 0.499888 8.49976 0.723939 8.49976 1V1.50024H9.50024C10.3286 1.50038 11.0002 2.1719 11.0002 3.00024V10Z", fill: "#165DFF" }) }) });
1194
+ }
1195
+ function CalendarMiniDisabled(props) {
1196
+ return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("svg", { ...props, preserveAspectRatio: "none", overflow: "visible", width: "12", height: "12", viewBox: "0 0 12 12", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("g", { id: "Calendar", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("path", { id: "Vector (Stroke)", d: "M9.99976 5.5H2.00024V10C2.00024 10.2761 2.22373 10.5001 2.49976 10.5002H9.50024C9.77627 10.5001 9.99976 10.2761 9.99976 10V5.5ZM7.5 3.00024V2.5H4.5V3.00024C4.49987 3.27627 4.27582 3.49976 3.99976 3.49976C3.72381 3.49962 3.50038 3.27619 3.50024 3.00024V2.5H2.49976C2.22373 2.50013 2.00024 2.72418 2.00024 3.00024V4.50024H9.99976V3.00024C9.99976 2.72418 9.77627 2.50013 9.50024 2.5H8.49976V3.00024C8.49962 3.27619 8.27619 3.49962 8.00024 3.49976C7.72418 3.49976 7.50013 3.27627 7.5 3.00024ZM11.0002 10C11.0002 10.8283 10.3286 11.4999 9.50024 11.5H2.49976C1.67144 11.4999 0.999756 10.8283 0.999756 10V3.00024C0.999756 2.1719 1.67144 1.50038 2.49976 1.50024H3.50024V1C3.50024 0.723939 3.72373 0.499888 3.99976 0.499756C4.2759 0.499756 4.5 0.723858 4.5 1V1.50024H7.5V1C7.5 0.723858 7.7241 0.499756 8.00024 0.499756C8.27627 0.499888 8.49976 0.723939 8.49976 1V1.50024H9.50024C10.3286 1.50038 11.0002 2.1719 11.0002 3.00024V10Z", fill: "#BFBFBF" }) }) });
1197
+ }
1198
+
1199
+ // src/components/DateInput/DateInput.tsx
1200
+ var import_jsx_runtime21 = require("react/jsx-runtime");
1201
+ var sizeClasses = {
1202
+ md: {
1203
+ input: "sw:px-[8px] sw:pr-[32px] sw:text-[14px] sw:leading-[22px]",
1204
+ height: "sw:h-[40px]",
1205
+ radius: 8,
1206
+ rangeRadius: "sw:rounded-[8px]",
1207
+ rangeWidth: 240,
1208
+ section: 32
1209
+ },
1210
+ sm: {
1211
+ input: "sw:px-[8px] sw:pr-[24px] sw:text-[12px] sw:leading-[18px]",
1212
+ height: "sw:h-[32px]",
1213
+ radius: 6,
1214
+ rangeRadius: "sw:rounded-[6px]",
1215
+ rangeWidth: 200,
1216
+ section: 28
1217
+ }
1218
+ };
1219
+ var appearances = {
1220
+ filled: "sw:border-0 sw:bg-[#f2f3f5] sw:enabled:hover:bg-[#e5e6eb] sw:enabled:focus:bg-white sw:enabled:focus:shadow-[inset_0_0_0_1px_#165dff]",
1221
+ outlined: "sw:border sw:border-solid sw:border-black/[0.08] sw:bg-white sw:enabled:hover:border-black/[0.12] sw:enabled:focus:border-[#165dff]"
1222
+ };
1223
+ function resolveDateInputClassNames({ size = "md", appearance = "filled" } = {}, overrides = {}) {
1224
+ const config = sizeClasses[size];
1225
+ return {
1226
+ ...overrides,
1227
+ root: (0, import_clsx15.default)("sw:group/date-input sw:[font-family:PingFang_SC,sans-serif] sw:tracking-[0px]", overrides.root),
1228
+ wrapper: overrides.wrapper,
1229
+ input: (0, import_clsx15.default)("sw:min-h-0 sw:py-0 sw:font-normal sw:text-[#262626] sw:placeholder:text-[#8c8c8c] sw:disabled:cursor-not-allowed sw:disabled:opacity-100 sw:disabled:text-[#bfbfbf] sw:disabled:placeholder:text-[#bfbfbf] sw:data-[error]:border-[#ff4d4f]", config.input, config.height, appearances[appearance], overrides.input),
1230
+ section: (0, import_clsx15.default)("sw:text-[#262626] sw:data-[position=right]:end-0", overrides.section)
1231
+ };
1232
+ }
1233
+ function DateInputCalendarIcon({ size = "md", disabled = false }) {
1234
+ const Normal = size === "sm" ? CalendarMini : Calendar;
1235
+ const Focus = size === "sm" ? CalendarMiniFocus : CalendarFocus;
1236
+ const Disabled = size === "sm" ? CalendarMiniDisabled : CalendarDisabled;
1237
+ return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { "aria-hidden": "true", className: (0, import_clsx15.default)("sw:relative sw:flex sw:items-center sw:justify-center", size === "sm" ? "sw:h-[12px] sw:w-[12px]" : "sw:h-[16px] sw:w-[16px]"), children: disabled ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Disabled, {}) : /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_jsx_runtime21.Fragment, { children: [
1238
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "sw:flex sw:group-focus-within/date-input:hidden", children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Normal, {}) }),
1239
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "sw:hidden sw:group-focus-within/date-input:flex", children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Focus, {}) })
1240
+ ] }) });
1241
+ }
1242
+ var SingleDateInput = (0, import_react19.forwardRef)(({ size = "md", appearance = "filled", value, defaultValue, onChange, classNames, rightSection, ...props }, ref) => {
1243
+ const visual = {
1244
+ size,
1245
+ appearance,
1246
+ disabled: props.disabled
1247
+ };
1248
+ return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_dates.DateInput, { ref, size, radius: sizeClasses[size].radius, w: 220, maw: "100%", valueFormat: "YYYY/MM/DD", placeholder: "\u65E5\u671F", rightSectionWidth: sizeClasses[size].section, rightSectionPointerEvents: "none", ...props, value, defaultValue, onChange, rightSection: rightSection === void 0 ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(DateInputCalendarIcon, { ...visual }) : rightSection, classNames: (theme, values, ctx) => resolveDateInputClassNames(visual, typeof classNames === "function" ? classNames(theme, values, ctx) : classNames) });
1249
+ });
1250
+ SingleDateInput.displayName = "SWorks/DateInput";
1251
+ var rangeSizes = {
1252
+ md: "sw:gap-[8px] sw:px-[8px] sw:text-[14px] sw:leading-[22px]",
1253
+ sm: "sw:gap-[4px] sw:px-[8px] sw:text-[12px] sw:leading-[18px]"
1254
+ };
1255
+ var rangeAppearances = {
1256
+ filled: "sw:border-0 sw:bg-[#f2f3f5] sw:hover:bg-[#e5e6eb] sw:focus-within:bg-white sw:focus-within:shadow-[inset_0_0_0_1px_#165dff]",
1257
+ outlined: "sw:border sw:border-solid sw:border-black/[0.08] sw:bg-white sw:hover:border-black/[0.12] sw:focus-within:border-[#165dff]"
1258
+ };
1259
+ var disabledRangeAppearances = {
1260
+ filled: "sw:border-0 sw:bg-[#f2f3f5]",
1261
+ outlined: "sw:border sw:border-solid sw:border-black/[0.08] sw:bg-white"
1262
+ };
1263
+ var RangeDateInput = (0, import_react19.forwardRef)(({ size = "md", appearance = "filled", value, defaultValue = [null, null], onChange, label, description, error, required, withAsterisk, startPlaceholder = "\u5F00\u59CB\u65E5\u671F", endPlaceholder = "\u7ED3\u675F\u65E5\u671F", startLabel = "\u5F00\u59CB\u65E5\u671F", endLabel = "\u7ED3\u675F\u65E5\u671F", classNames, w, maw, ...props }, ref) => {
1264
+ const generatedId = (0, import_react19.useId)();
1265
+ const inputId = props.id ?? generatedId;
1266
+ const [local, setLocal] = (0, import_react19.useState)(defaultValue);
1267
+ const current = value ?? local;
1268
+ const [startDate, endDate] = current;
1269
+ const [activeField, setActiveField] = (0, import_react19.useState)(0);
1270
+ const inputs = (0, import_react19.useRef)([null, null]);
1271
+ const [inputVersions, setInputVersions] = (0, import_react19.useState)([0, 0]);
1272
+ const pendingValue = (0, import_react19.useRef)(null);
1273
+ const dropdownRef = (0, import_react19.useRef)(null);
1274
+ const focusOnOpen = (0, import_react19.useRef)(false);
1275
+ const focusOnClose = (0, import_react19.useRef)(false);
1276
+ const { opened: controlledOpened, defaultOpened, onChange: onPopoverChange, onDismiss, onEnterTransitionEnd, ...popoverOptions } = props.popoverProps ?? {};
1277
+ const [opened, setOpened] = (0, import_hooks2.useUncontrolled)({
1278
+ value: controlledOpened,
1279
+ defaultValue: defaultOpened ?? false,
1280
+ onChange: onPopoverChange
1281
+ });
1282
+ const calendarDisabled = props.disabled || props.readOnly || popoverOptions.disabled;
1283
+ const calendarOpen = opened && !calendarDisabled;
1284
+ const dropdownId = inputId + "-calendar";
1285
+ const { calendarProps } = (0, import_dates.pickCalendarProps)(props);
1286
+ const { styles, unstyled } = props;
1287
+ const calendarAppearance = {
1288
+ styles: typeof styles === "function" ? (theme, _calendar, context) => styles(theme, {
1289
+ ...props,
1290
+ size,
1291
+ value: current[activeField],
1292
+ valueFormat: props.valueFormat ?? "YYYY/MM/DD"
1293
+ }, context) : styles,
1294
+ unstyled
1295
+ };
1296
+ (0, import_react19.useLayoutEffect)(() => {
1297
+ const pending = pendingValue.current;
1298
+ if (!pending)
1299
+ return;
1300
+ const next = pending.field === 0 ? startDate : endDate;
1301
+ if (next === pending.previous)
1302
+ return;
1303
+ const input = inputs.current[pending.field];
1304
+ if (calendarOpen || !input || input.ownerDocument.activeElement !== input) {
1305
+ pendingValue.current = null;
1306
+ return;
1307
+ }
1308
+ pending.previous = next;
1309
+ focusOnClose.current = true;
1310
+ setInputVersions(([start, end]) => pending.field === 0 ? [start + 1, end] : [start, end + 1]);
1311
+ }, [calendarOpen, startDate, endDate]);
1312
+ (0, import_react19.useEffect)(() => {
1313
+ if (calendarOpen || !focusOnClose.current)
1314
+ return;
1315
+ const input = inputs.current[activeField];
1316
+ if (input?.isConnected) {
1317
+ const { activeElement, body } = input.ownerDocument;
1318
+ if (activeElement === body || dropdownRef.current?.contains(activeElement)) {
1319
+ input.focus({ preventScroll: true });
1320
+ }
1321
+ }
1322
+ focusOnClose.current = false;
1323
+ }, [activeField, calendarOpen, inputVersions]);
1324
+ const openCalendar = (field) => {
1325
+ if (calendarDisabled || focusOnClose.current)
1326
+ return;
1327
+ setActiveField(field);
1328
+ if (!opened)
1329
+ setOpened(true);
1330
+ };
1331
+ const focusCalendar = () => {
1332
+ const button = dropdownRef.current?.querySelector("button:not(:disabled)");
1333
+ button?.focus();
1334
+ if (button && button.ownerDocument.activeElement === button)
1335
+ focusOnOpen.current = false;
1336
+ };
1337
+ const dismissCalendar = (returnFocus = false) => {
1338
+ focusOnOpen.current = false;
1339
+ focusOnClose.current = returnFocus;
1340
+ setOpened(false);
1341
+ onDismiss?.();
1342
+ };
1343
+ const inputEvents = (field) => ({
1344
+ onFocus: (event) => {
1345
+ props.onFocus?.(event);
1346
+ openCalendar(field);
1347
+ },
1348
+ onClick: (event) => {
1349
+ props.onClick?.(event);
1350
+ if (!event.defaultPrevented)
1351
+ openCalendar(field);
1352
+ },
1353
+ onInput: (event) => {
1354
+ if (pendingValue.current?.field === field)
1355
+ pendingValue.current = null;
1356
+ props.onInput?.(event);
1357
+ },
1358
+ onKeyDown: (event) => {
1359
+ props.onKeyDown?.(event);
1360
+ if (event.defaultPrevented || calendarDisabled || event.nativeEvent.isComposing || event.keyCode === 229)
1361
+ return;
1362
+ if (event.key === "ArrowDown") {
1363
+ event.preventDefault();
1364
+ focusOnOpen.current = true;
1365
+ openCalendar(field);
1366
+ if (calendarOpen)
1367
+ focusCalendar();
1368
+ } else if (event.key === "Escape" && calendarOpen && popoverOptions.closeOnEscape !== false) {
1369
+ event.preventDefault();
1370
+ event.stopPropagation();
1371
+ dismissCalendar();
1372
+ }
1373
+ }
1374
+ });
1375
+ const config = rangeSizes[size];
1376
+ const changeRange = (pair) => {
1377
+ setLocal(pair);
1378
+ onChange?.(pair);
1379
+ };
1380
+ const updateEndpoint = (index, next) => {
1381
+ const pair = [...current];
1382
+ pair[index] = next;
1383
+ if (pair[0] && pair[1] && pair[0] > pair[1]) {
1384
+ if (index === 0)
1385
+ pair[1] = null;
1386
+ else
1387
+ pair[0] = null;
1388
+ }
1389
+ return pair;
1390
+ };
1391
+ const selectFromCalendar = (pair) => {
1392
+ if (!calendarOpen)
1393
+ return;
1394
+ const input = inputs.current[activeField];
1395
+ if (input?.ownerDocument.activeElement === input)
1396
+ dropdownRef.current?.focus();
1397
+ pendingValue.current = value !== void 0 && pair[activeField] !== current[activeField] ? { field: activeField, previous: current[activeField] } : null;
1398
+ changeRange(pair);
1399
+ focusOnClose.current = true;
1400
+ setOpened(false);
1401
+ };
1402
+ const wrapperProps = {
1403
+ label,
1404
+ description,
1405
+ error,
1406
+ required,
1407
+ withAsterisk
1408
+ };
1409
+ const rangeFont = {
1410
+ md: "sw:text-[14px] sw:leading-[22px]",
1411
+ sm: "sw:text-[12px] sw:leading-[18px]"
1412
+ };
1413
+ const nativeClasses = {
1414
+ root: "sw:h-full sw:min-w-0 sw:flex-1",
1415
+ wrapper: "sw:h-full",
1416
+ input: "sw:h-full sw:min-h-0 sw:rounded-none sw:border-0 sw:bg-transparent sw:p-0 sw:font-normal sw:text-[#262626] sw:placeholder:text-[#8c8c8c] sw:disabled:bg-transparent sw:disabled:text-[#bfbfbf] sw:disabled:placeholder:text-[#bfbfbf]"
1417
+ };
1418
+ return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_core15.Input.Wrapper, { ...wrapperProps, labelElement: "div", role: "group", "aria-labelledby": label ? inputId + "-label" : void 0, ref, w: w ?? sizeClasses[size].rangeWidth, maw: maw ?? "100%", id: inputId, onBlur: (event) => {
1419
+ const next = event.relatedTarget;
1420
+ if (calendarOpen && next && !event.currentTarget.contains(next) && !dropdownRef.current?.contains(next)) {
1421
+ setOpened(false);
1422
+ }
1423
+ }, classNames: {
1424
+ root: (0, import_clsx15.default)("sw:[font-family:PingFang_SC,sans-serif] sw:tracking-[0px]", classNames?.root),
1425
+ label: classNames?.label,
1426
+ error: classNames?.error,
1427
+ description: classNames?.description
1428
+ }, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_core15.Popover, { position: "bottom-start", unstyled, ...popoverOptions, opened: calendarOpen, disabled: calendarDisabled, onChange: setOpened, onDismiss, withRoles: false, closeOnEscape: false, onEnterTransitionEnd: () => {
1429
+ if (focusOnOpen.current)
1430
+ focusCalendar();
1431
+ onEnterTransitionEnd?.();
1432
+ }, children: [
1433
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_core15.Popover.Target, { children: /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: (0, import_clsx15.default)("sw:group/date-input sw:flex sw:items-center", sizeClasses[size].rangeRadius, config, sizeClasses[size].height, props.disabled ? disabledRangeAppearances[appearance] : rangeAppearances[appearance], Boolean(error) && "sw:shadow-[inset_0_0_0_1px_#ff4d4f]", classNames?.wrapper), children: [
1434
+ [0, 1].map((field) => /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_react19.Fragment, { children: [
1435
+ field === 1 && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { "aria-hidden": "true", className: (0, import_clsx15.default)("sw:w-[16px] sw:shrink-0 sw:text-center", props.disabled ? "sw:text-[#bfbfbf]" : "sw:text-[#8c8c8c]"), children: "-" }),
1436
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_dates.DateInput, { ref: (node) => {
1437
+ inputs.current[field] = node;
1438
+ }, ...props, ...inputEvents(field), popoverProps: { disabled: true }, "aria-haspopup": "dialog", "aria-expanded": calendarOpen, "aria-controls": calendarOpen ? dropdownId : void 0, required, id: inputId + (field === 0 ? "-start" : "-end"), name: props.name ? props.name + "." + field : void 0, "aria-describedby": description ? inputId + "-description" : void 0, label: void 0, description: void 0, error: Boolean(error), size, value: current[field], onChange: (next) => changeRange(updateEndpoint(field, next)), "aria-label": field === 0 ? startLabel : endLabel, placeholder: field === 0 ? startPlaceholder : endPlaceholder, valueFormat: props.valueFormat ?? "YYYY/MM/DD", rightSection: null, rightSectionWidth: 0, classNames: {
1439
+ ...nativeClasses,
1440
+ input: (0, import_clsx15.default)(nativeClasses.input, rangeFont[size], classNames?.input)
1441
+ } }, inputVersions[field])
1442
+ ] }, field)),
1443
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: (0, import_clsx15.default)("sw:shrink-0", classNames?.section), children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(DateInputCalendarIcon, { size, appearance, disabled: props.disabled }) })
1444
+ ] }) }),
1445
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_core15.Popover.Dropdown, { id: dropdownId, ref: (node) => {
1446
+ dropdownRef.current = node;
1447
+ if (node && focusOnOpen.current)
1448
+ focusCalendar();
1449
+ }, role: "dialog", "aria-label": activeField === 0 ? startLabel : endLabel, tabIndex: -1, onKeyDown: (event) => {
1450
+ if (event.key === "Escape" && popoverOptions.closeOnEscape !== false) {
1451
+ event.preventDefault();
1452
+ event.stopPropagation();
1453
+ dismissCalendar(true);
1454
+ }
1455
+ }, children: [
1456
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "sw:mb-[8px]", children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(DateRangeShortcuts, { minDate: props.minDate, maxDate: props.maxDate, excludeDate: props.excludeDate, getDayProps: props.getDayProps, onChange: selectFromCalendar }) }),
1457
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_dates.DatePicker, { ...calendarProps, ...calendarAppearance, size, defaultDate: current[activeField] ?? props.defaultDate, value: current[activeField], allowDeselect: props.allowDeselect ?? props.clearable, onChange: (next) => selectFromCalendar(updateEndpoint(activeField, next)) }, activeField)
1458
+ ] })
1459
+ ] }) });
1460
+ });
1461
+ RangeDateInput.displayName = "SWorks/DateInput.Range";
1462
+ var DateInput = Object.assign(SingleDateInput, { Range: RangeDateInput });
1463
+
1464
+ // src/components/DatePicker/DatePicker.tsx
1465
+ var import_react21 = require("react");
1466
+ var import_clsx17 = __toESM(require("clsx"));
1467
+ var import_dayjs2 = __toESM(require("dayjs"));
1468
+ var import_core17 = require("@s-works/s-works-ui/core");
1469
+ var import_dates2 = require("@s-works/s-works-ui/dates");
1470
+
1471
+ // src/components/Select/Select.tsx
1472
+ var import_react20 = require("react");
1473
+ var import_clsx16 = __toESM(require("clsx"));
1474
+ var import_core16 = require("@s-works/s-works-ui/core");
1475
+
1476
+ // src/components/Select/icons.tsx
1477
+ var import_jsx_runtime22 = require("react/jsx-runtime");
1478
+ function ChevronDown(props) {
1479
+ return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true", ...props, children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("path", { d: "M11.0293 6.03477C11.289 5.77508 11.711 5.77508 11.9707 6.03477C12.2304 6.29447 12.2304 6.71648 11.9707 6.97618L8.47071 10.4762C8.21102 10.7359 7.78901 10.7359 7.52931 10.4762L4.02931 6.97618C3.76961 6.71648 3.76961 6.29447 4.02931 6.03477C4.28901 5.77508 4.71102 5.77508 4.97071 6.03477L8.00001 9.06407L11.0293 6.03477Z", fill: "currentColor" }) });
1480
+ }
1481
+ function CheckIcon(props) {
1482
+ return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true", ...props, children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("path", { d: "M13.0293 3.5293C13.289 3.2696 13.711 3.2696 13.9707 3.5293C14.2304 3.789 14.2304 4.211 13.9707 4.4707L6.4707 11.9707L6 12.4404L5.5293 11.9707L2.0293 8.4707C1.7696 8.211 1.7696 7.789 2.0293 7.5293C2.289 7.2696 2.711 7.2696 2.9707 7.5293L6 10.5586L13.0293 3.5293Z", fill: "currentColor" }) });
1483
+ }
1484
+
1485
+ // src/components/Select/Select.tsx
1486
+ var import_jsx_runtime23 = require("react/jsx-runtime");
1487
+ var sizes = {
1488
+ lg: { input: "sw:pe-[44px] sw:text-[16px] sw:leading-[24px]", noIconInput: "sw:h-[48px] sw:ps-[16px]", iconInput: "sw:h-[44px] sw:ps-[44px]", option: "sw:h-[48px] sw:px-[12px] sw:text-[16px] sw:leading-[24px]", dropdown: "sw:p-[8px] sw:shadow-[inset_0_0_0_1px_rgba(0,0,0,0.08),0_8px_16px_rgba(0,0,0,0.1)]", radius: 8, section: 48 },
1489
+ md: { input: "sw:h-[40px] sw:pe-[36px] sw:text-[14px] sw:leading-[22px]", noIconInput: "sw:ps-[12px]", iconInput: "sw:ps-[36px]", option: "sw:h-[40px] sw:px-[8px] sw:text-[14px] sw:leading-[22px]", dropdown: "sw:p-[8px] sw:shadow-[inset_0_0_0_1px_rgba(0,0,0,0.08),0_8px_16px_rgba(0,0,0,0.1)]", radius: 8, section: 40 },
1490
+ sm: { input: "sw:h-[32px] sw:pe-[32px] sw:text-[14px] sw:leading-[22px]", noIconInput: "sw:ps-[8px]", iconInput: "sw:ps-[32px]", option: "sw:h-[32px] sw:px-[8px] sw:text-[14px] sw:leading-[22px]", dropdown: "sw:p-[6px] sw:shadow-[inset_0_0_0_0.5px_rgba(0,0,0,0.08),0_8px_16px_rgba(0,0,0,0.1)]", radius: 6, section: 32 }
1491
+ };
1492
+ var appearances2 = {
1493
+ filled: "sw:bg-[#f2f3f5] sw:enabled:hover:bg-[#e5e6eb] sw:enabled:focus:bg-white sw:enabled:focus:shadow-[inset_0_0_0_1px_#165dff] sw:data-[expanded]:bg-white sw:data-[expanded]:shadow-[inset_0_0_0_1px_#165dff]",
1494
+ outlined: "sw:bg-white sw:shadow-[inset_0_0_0_1px_rgba(0,0,0,0.08)] sw:enabled:hover:shadow-[inset_0_0_0_1px_rgba(0,0,0,0.12)] sw:enabled:focus:shadow-[inset_0_0_0_1px_#165dff] sw:data-[expanded]:shadow-[inset_0_0_0_1px_#165dff]"
1495
+ };
1496
+ var tones = {
1497
+ blue: "sw:hover:bg-[#165dff]/[0.05] sw:data-[checked]:bg-[#165dff]/[0.05] sw:data-[combobox-selected]:bg-[#165dff]/[0.05]",
1498
+ dark: "sw:hover:bg-black/[0.03] sw:data-[checked]:bg-black/[0.03] sw:data-[combobox-selected]:bg-black/[0.03]",
1499
+ neutral: "sw:hover:bg-black/[0.03] sw:data-[checked]:bg-white sw:data-[combobox-selected]:bg-black/[0.03]"
1500
+ };
1501
+ function resolveSelectProps({ size = "md", leftSection, appearance: _appearance, menuTone: _menuTone, optionIcon: _optionIcon, ...props } = {}) {
1502
+ return { size, radius: sizes[size].radius, w: 280, maw: "100%", leftSectionWidth: sizes[size].section, rightSectionWidth: sizes[size].section, rightSectionPointerEvents: "none", placeholder: "\u8BF7\u9009\u62E9", withScrollArea: false, ...props, leftSection };
1503
+ }
1504
+ function resolveSelectClassNames({ size = "md", appearance = "filled", menuTone = "blue", hasLeftSection = false } = {}, overrides = {}) {
1505
+ return {
1506
+ ...overrides,
1507
+ root: (0, import_clsx16.default)("sw:group/select sw:min-w-0 sw:[font-family:PingFang_SC,sans-serif] sw:tracking-[0px]", overrides.root),
1508
+ input: (0, import_clsx16.default)("sw:min-h-0 sw:border-0 sw:py-0 sw:font-normal sw:text-[#262626] sw:placeholder:text-[#262626] sw:disabled:cursor-not-allowed sw:disabled:text-[#bfbfbf] sw:disabled:placeholder:text-[#bfbfbf] sw:disabled:opacity-100 sw:data-[error]:text-[#ff4d4f] sw:data-[error]:shadow-[inset_0_0_0_1px_#ff4d4f]", sizes[size].input, hasLeftSection ? sizes[size].iconInput : sizes[size].noIconInput, appearances2[appearance], overrides.input),
1509
+ section: (0, import_clsx16.default)("sw:text-[#262626] sw:group-has-[[disabled]]/select:text-[#bfbfbf] sw:data-[position=right]:end-0 sw:data-[position=left]:start-0", overrides.section),
1510
+ dropdown: (0, import_clsx16.default)("sw:rounded-[8px] sw:border-0 sw:bg-white sw:text-[#262626] sw:[font-family:PingFang_SC,sans-serif] sw:tracking-[0px]", sizes[size].dropdown, overrides.dropdown),
1511
+ options: (0, import_clsx16.default)("sw:p-0", overrides.options),
1512
+ option: (0, import_clsx16.default)("sw:flex sw:items-center sw:gap-[8px] sw:rounded-[4px] sw:border-0 sw:bg-white sw:py-0 sw:font-normal sw:text-[#262626] sw:data-[combobox-selected]:text-[#262626] sw:data-[combobox-disabled]:cursor-not-allowed sw:data-[combobox-disabled]:bg-white sw:data-[combobox-disabled]:text-[#bfbfbf] sw:data-[combobox-disabled]:opacity-100", sizes[size].option, tones[menuTone], overrides.option),
1513
+ empty: (0, import_clsx16.default)("sw:px-[8px] sw:py-[12px] sw:text-[14px] sw:leading-[22px] sw:text-[#8c8c8c]", overrides.empty)
1514
+ };
1515
+ }
1516
+ function SelectChevron() {
1517
+ return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { "aria-hidden": "true", className: "sw:flex sw:h-[16px] sw:w-[16px] sw:group-has-[[data-expanded]]/select:-scale-y-100", children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(ChevronDown, {}) });
1518
+ }
1519
+ function SelectOptionContent({ icon, label, checked, withCheckIcon }) {
1520
+ return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(import_jsx_runtime23.Fragment, { children: [
1521
+ icon && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { "aria-hidden": "true", className: "sw:flex sw:h-[16px] sw:w-[16px] sw:shrink-0", children: icon }),
1522
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "sw:min-w-0 sw:flex-1 sw:truncate", children: label }),
1523
+ checked && withCheckIcon && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "sw:flex sw:h-[16px] sw:w-[16px] sw:shrink-0", children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(CheckIcon, {}) })
1524
+ ] });
1525
+ }
1526
+ var Select = (0, import_react20.forwardRef)(({ size = "md", appearance = "filled", menuTone = "blue", optionIcon, classNames, rightSection, renderOption, withCheckIcon = Boolean(optionIcon), comboboxProps, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_core16.Select, { ref, ...resolveSelectProps({ size, ...props }), withCheckIcon, comboboxProps: { offset: 4, ...comboboxProps }, rightSection: rightSection === void 0 ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(SelectChevron, {}) : rightSection, renderOption: renderOption ?? (({ option, checked }) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(SelectOptionContent, { icon: optionIcon, label: option.label, checked: Boolean(checked), withCheckIcon })), classNames: (theme, values, context) => resolveSelectClassNames({ size, appearance, menuTone, hasLeftSection: Boolean(props.leftSection) }, typeof classNames === "function" ? classNames(theme, values, context) : classNames) }));
1527
+ Select.displayName = "SWorks/Select";
1528
+
1529
+ // src/components/DatePicker/icons.tsx
1530
+ var import_jsx_runtime24 = require("react/jsx-runtime");
1531
+ function ChevronLeft(props) {
1532
+ return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true", ...props, children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("path", { d: "M9.0293 4.0293C9.289 3.7696 9.711 3.7696 9.9707 4.0293C10.2304 4.289 10.2304 4.711 9.9707 4.9707L6.94141 8L9.9707 11.0293C10.2304 11.289 10.2304 11.711 9.9707 11.9707C9.711 12.2304 9.289 12.2304 9.0293 11.9707L5.5293 8.4707C5.2696 8.211 5.2696 7.789 5.5293 7.5293L9.0293 4.0293Z", fill: "currentColor" }) });
1533
+ }
1534
+ function ChevronRight(props) {
1535
+ return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true", ...props, children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("path", { d: "M6.0293 4.0293C6.289 3.7696 6.711 3.7696 6.9707 4.0293L10.4707 7.5293C10.7304 7.789 10.7304 8.211 10.4707 8.4707L6.9707 11.9707C6.711 12.2304 6.289 12.2304 6.0293 11.9707C5.7696 11.711 5.7696 11.289 6.0293 11.0293L9.05859 8L6.0293 4.9707C5.7696 4.711 5.7696 4.289 6.0293 4.0293Z", fill: "currentColor" }) });
1536
+ }
1537
+
1538
+ // src/components/DatePicker/DatePicker.tsx
1539
+ var import_jsx_runtime25 = require("react/jsx-runtime");
1540
+ function resolveDatePickerClassNames(overrides = {}) {
1541
+ return {
1542
+ ...overrides,
1543
+ calendarHeader: (0, import_clsx17.default)("sw:hidden", overrides.calendarHeader),
1544
+ levelsGroup: (0, import_clsx17.default)("sw:gap-0", overrides.levelsGroup),
1545
+ month: (0, import_clsx17.default)("sw:block sw:w-[280px] sw:border-collapse", overrides.month),
1546
+ monthThead: (0, import_clsx17.default)("sw:block", overrides.monthThead),
1547
+ monthTbody: (0, import_clsx17.default)("sw:block", overrides.monthTbody),
1548
+ weekdaysRow: (0, import_clsx17.default)("sw:flex sw:h-[30px] sw:items-center sw:justify-between sw:px-[16px]", overrides.weekdaysRow),
1549
+ weekday: (0, import_clsx17.default)("sw:flex sw:h-[24px] sw:w-[24px] sw:items-center sw:justify-center sw:p-0 sw:text-[14px] sw:font-normal sw:leading-[22px] sw:text-black/[0.4]", overrides.weekday),
1550
+ monthRow: (0, import_clsx17.default)("sw:flex sw:h-[30px] sw:items-center sw:justify-between sw:px-[16px]", overrides.monthRow),
1551
+ monthCell: (0, import_clsx17.default)("sw:relative sw:h-[24px] sw:w-[24px] sw:p-0 sw:before:pointer-events-none sw:before:absolute sw:before:-inset-x-[8px] sw:before:inset-y-0 sw:has-[[data-in-range]]:before:bg-[#f3f7ff] sw:has-[[data-first-in-range]]:before:start-[12px] sw:has-[[data-last-in-range]]:before:end-[12px] sw:has-[[data-first-in-range][data-last-in-range]]:before:hidden", overrides.monthCell),
1552
+ day: (0, import_clsx17.default)("sw:relative sw:z-[1] sw:h-[24px] sw:w-[24px] sw:rounded-[3px] sw:border-0 sw:bg-transparent sw:p-0 sw:text-[14px] sw:font-normal sw:leading-[22px] sw:text-black sw:opacity-100 sw:hover:bg-transparent sw:hover:shadow-[inset_0_0_0_1px_#165dff] sw:data-[outside]:text-[#bfbfbf] sw:data-[outside]:opacity-100 sw:[&[data-today]:not([data-selected]):not([data-in-range])]:bg-[#f3f7ff] sw:[&[data-today]:not([data-selected]):not([data-in-range])]:text-[#0052d9] sw:data-[in-range]:rounded-[3px] sw:data-[in-range]:bg-transparent sw:data-[in-range]:text-black sw:data-[selected]:rounded-[3px] sw:data-[selected]:bg-[#165dff] sw:data-[selected]:text-white sw:data-[selected]:hover:bg-[#165dff] sw:data-[disabled]:cursor-not-allowed sw:data-[disabled]:bg-[#f2f3f5] sw:data-[disabled]:text-[#bfbfbf] sw:data-[disabled]:opacity-100 sw:data-[disabled]:shadow-[inset_0_0_0_1px_#e5e6eb] sw:data-[disabled]:hover:shadow-[inset_0_0_0_1px_#e5e6eb]", overrides.day)
1553
+ };
1554
+ }
1555
+ var arrowClasses = { root: "sw:h-[24px] sw:min-h-0 sw:w-[24px] sw:min-w-0 sw:border-0 sw:bg-transparent sw:p-0 sw:text-[#262626] sw:hover:bg-[#f2f3f5] sw:disabled:bg-transparent sw:disabled:opacity-40" };
1556
+ function DatePickerInner({ type = "default", value, defaultValue, onChange, date, defaultDate, onDateChange, withFooter = type === "range", onConfirm, classNames, minDate, maxDate, excludeDate, locale, firstDayOfWeek = 0, weekdayFormat = "dd", ...props }, ref) {
1557
+ const ctx = (0, import_dates2.useDatesContext)();
1558
+ const [local, setLocal] = (0, import_react21.useState)(() => defaultValue ?? (type === "range" ? [null, null] : type === "multiple" ? [] : null));
1559
+ const raw = value !== void 0 ? value : local;
1560
+ const current = Array.isArray(raw) ? raw.map((item) => item ? (0, import_dayjs2.default)(item).format("YYYY-MM-DD") : null) : raw ? (0, import_dayjs2.default)(raw).format("YYYY-MM-DD") : null;
1561
+ const initial = Array.isArray(current) ? current[0] : typeof current === "string" ? current : null;
1562
+ const [localDate, setLocalDate] = (0, import_react21.useState)(() => (0, import_dayjs2.default)(defaultDate ?? initial ?? /* @__PURE__ */ new Date()).startOf("month").format("YYYY-MM-DD"));
1563
+ const displayed = (0, import_dayjs2.default)(date ?? localDate).startOf("month");
1564
+ const columns = type === "range" ? 2 : 1;
1565
+ const changeMonth = (next) => {
1566
+ setLocalDate(next);
1567
+ onDateChange?.(next);
1568
+ };
1569
+ const change = (next) => {
1570
+ setLocal(next);
1571
+ onChange?.(next);
1572
+ };
1573
+ const today = (0, import_dayjs2.default)().format("YYYY-MM-DD");
1574
+ const selectShortcut = (start, end = start) => {
1575
+ change(type === "range" ? [start, end] : type === "multiple" ? [start] : start);
1576
+ changeMonth((0, import_dayjs2.default)(start).startOf("month").format("YYYY-MM-DD"));
1577
+ };
1578
+ const years = Array.from({ length: (maxDate ? (0, import_dayjs2.default)(maxDate).year() : Math.max(displayed.year() + 100, (0, import_dayjs2.default)().year() + 100)) - (minDate ? (0, import_dayjs2.default)(minDate).year() : Math.min(1900, displayed.year())) + 1 }, (_, index) => String(index + (minDate ? (0, import_dayjs2.default)(minDate).year() : Math.min(1900, displayed.year()))));
1579
+ const months = Array.from({ length: 12 }, (_, index) => String(index + 1));
1580
+ const selectDropdown = { withinPortal: false, floatingStrategy: "fixed" };
1581
+ return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(import_core17.Paper, { ref, radius: 8, classNames: { root: (0, import_clsx17.default)("sw:w-fit sw:bg-white sw:font-normal sw:text-[#262626] sw:shadow-[inset_0_0_0_1px_rgba(0,0,0,0.08),0_8px_16px_rgba(0,0,0,0.1)] sw:[font-family:PingFang_SC,sans-serif] sw:tracking-[0px]") }, children: [
1582
+ type === "range" && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "sw:px-[12px] sw:pt-[12px]", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(DateRangeShortcuts, { minDate, maxDate, excludeDate, getDayProps: props.getDayProps, onChange: ([start, end]) => selectShortcut(start, end) }) }),
1583
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "sw:flex", children: Array.from({ length: columns }, (_, index) => {
1584
+ const month = displayed.add(index, "month");
1585
+ const year = String(month.year());
1586
+ const yearOptions = years.includes(year) ? years : [...years, { value: year, label: year, disabled: true }];
1587
+ const previousDisabled = Boolean(minDate && displayed.subtract(1, "month").endOf("month").isBefore(minDate, "day"));
1588
+ const nextDisabled = Boolean(maxDate && displayed.add(columns, "month").startOf("month").isAfter(maxDate, "day"));
1589
+ return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "sw:flex sw:h-[44px] sw:w-[280px] sw:items-center sw:justify-between sw:px-[12px] sw:pt-[12px]", children: [
1590
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "sw:flex sw:gap-[8px]", children: [
1591
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Select, { "aria-label": `\u7B2C${index + 1}\u4E2A\u6708\u5E74\u4EFD`, size: "sm", appearance: "outlined", w: 80, value: year, data: yearOptions, allowDeselect: false, searchable: true, selectFirstOptionOnChange: true, nothingFoundMessage: "\u6CA1\u6709\u5339\u914D\u7684\u5E74\u4EFD", withScrollArea: true, comboboxProps: selectDropdown, onChange: (next) => {
1592
+ if (next)
1593
+ changeMonth(month.year(Number(next)).subtract(index, "month").format("YYYY-MM-DD"));
1594
+ } }),
1595
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Select, { "aria-label": `\u7B2C${index + 1}\u4E2A\u6708\u6708\u4EFD`, size: "sm", appearance: "outlined", w: 80, value: String(month.month() + 1), data: months, allowDeselect: false, withScrollArea: true, comboboxProps: selectDropdown, onChange: (next) => {
1596
+ if (next)
1597
+ changeMonth(month.month(Number(next) - 1).subtract(index, "month").format("YYYY-MM-DD"));
1598
+ } })
1599
+ ] }),
1600
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "sw:flex", children: [
1601
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_core17.ActionIcon, { "aria-label": `\u7B2C${index + 1}\u4E2A\u6708\u4E0A\u4E2A\u6708`, radius: 6, disabled: previousDisabled, classNames: arrowClasses, onClick: () => changeMonth(displayed.subtract(1, "month").format("YYYY-MM-DD")), children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(ChevronLeft, {}) }),
1602
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_core17.ActionIcon, { "aria-label": `\u7B2C${index + 1}\u4E2A\u6708\u4E0B\u4E2A\u6708`, radius: 6, disabled: nextDisabled, classNames: arrowClasses, onClick: () => changeMonth(displayed.add(1, "month").format("YYYY-MM-DD")), children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(ChevronRight, {}) })
1603
+ ] })
1604
+ ] }, index);
1605
+ }) }),
1606
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: (0, import_clsx17.default)("sw:pt-[12px]", !withFooter && "sw:pb-[12px]"), children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_dates2.DatesProvider, { settings: { ...ctx, consistentWeeks: true }, children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_dates2.DatePicker, { ...props, type, value: current, onChange: change, date: displayed.format("YYYY-MM-DD"), onDateChange: changeMonth, numberOfColumns: columns, columnsToScroll: 1, maxLevel: "month", firstDayOfWeek, weekdayFormat, locale: locale ?? ctx.locale, minDate, maxDate, excludeDate, hideOutsideDates: props.hideOutsideDates ?? false, withCellSpacing: false, classNames: (theme, values, context) => resolveDatePickerClassNames(typeof classNames === "function" ? classNames(theme, values, context) : classNames) }) }) }),
1607
+ withFooter && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "sw:flex sw:h-[48px] sw:items-start sw:justify-end sw:px-[16px] sw:pt-[8px] sw:pb-[16px]", children: type === "range" ? /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_core17.Button, { radius: 4, disabled: !Array.isArray(current) || !current[0] || !current[1], classNames: { root: "sw:h-[24px] sw:min-h-0 sw:border-0 sw:bg-[#165dff] sw:px-[8px] sw:py-0 sw:text-[12px] sw:font-normal sw:leading-[18px] sw:text-white sw:hover:bg-[#165dff] sw:disabled:bg-[#f2f3f5] sw:disabled:text-[#bfbfbf]", label: "sw:font-normal" }, onClick: () => onConfirm?.(current), children: "\u786E\u5B9A" }) : /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_core17.Button, { radius: 4, disabled: isDateShortcutDisabled(today, { minDate, maxDate, excludeDate, getDayProps: props.getDayProps }), fullWidth: true, classNames: dateShortcutClasses, onClick: () => selectShortcut(today), children: "\u4ECA\u5929" }) })
1608
+ ] });
1609
+ }
1610
+ var DatePicker = (0, import_react21.forwardRef)(DatePickerInner);
1611
+
1612
+ // src/components/TimePicker/TimePicker.tsx
1613
+ var import_react22 = require("react");
1614
+ var import_clsx18 = __toESM(require("clsx"));
1615
+ var import_lucide_react = require("lucide-react");
1616
+ var import_hooks3 = require("@s-works/s-works-ui/hooks");
1617
+ var import_dates3 = require("@s-works/s-works-ui/dates");
1618
+ var import_jsx_runtime26 = require("react/jsx-runtime");
1619
+ var timePickerSizes = {
1620
+ sm: { input: "sw:h-[32px] sw:ps-[8px]", radius: 6, section: 32 },
1621
+ md: { input: "sw:h-[40px] sw:ps-[12px]", radius: 8, section: 40 }
1622
+ };
1623
+ function resolveTimePickerClassNames(size, appearance, overrides = {}) {
1624
+ return {
1625
+ ...overrides,
1626
+ root: (0, import_clsx18.default)("sw:min-w-0 sw:[font-family:PingFang_SC,sans-serif] sw:tracking-[0px]", overrides.root),
1627
+ input: (0, import_clsx18.default)("sw:min-h-0 sw:border-0 sw:py-0 sw:text-[14px] sw:font-normal sw:leading-[22px] sw:text-[#262626] sw:data-[disabled]:cursor-not-allowed sw:data-[disabled]:text-[#bfbfbf] sw:data-[disabled]:opacity-100 sw:data-[error]:shadow-[inset_0_0_0_1px_#ff4d4f]", timePickerSizes[size].input, appearance === "filled" ? "sw:bg-[#f2f3f5] sw:hover:bg-[#e5e6eb] sw:focus-within:bg-white sw:focus-within:shadow-[inset_0_0_0_1px_#165dff] sw:data-[disabled]:bg-[#f2f3f5]" : "sw:bg-white sw:shadow-[inset_0_0_0_1px_rgba(0,0,0,0.08)] sw:focus-within:shadow-[inset_0_0_0_1px_#165dff]", overrides.input),
1628
+ fieldsGroup: (0, import_clsx18.default)("sw:h-[24px]", overrides.fieldsGroup),
1629
+ field: (0, import_clsx18.default)("sw:min-w-[24px] sw:rounded-[4px] sw:text-inherit sw:disabled:text-[#bfbfbf] sw:focus:bg-[#165dff] sw:focus:text-white", overrides.field),
1630
+ section: (0, import_clsx18.default)("sw:text-[#8c8c8c] sw:data-[position=right]:end-0", overrides.section),
1631
+ dropdown: (0, import_clsx18.default)("sw:rounded-[8px] sw:border-0 sw:bg-white sw:p-[6px] sw:text-[#262626] sw:shadow-[inset_0_0_0_1px_rgba(0,0,0,0.08),0_8px_16px_rgba(0,0,0,0.1)]", overrides.dropdown),
1632
+ control: (0, import_clsx18.default)("sw:h-[32px] sw:min-w-[40px] sw:rounded-[4px] sw:text-[14px] sw:hover:bg-[#f3f7ff] sw:data-[active]:bg-[#165dff] sw:data-[active]:text-white", overrides.control),
1633
+ presetControl: (0, import_clsx18.default)("sw:h-[32px] sw:rounded-[4px] sw:text-[14px] sw:hover:bg-[#f3f7ff] sw:data-[active]:bg-[#165dff] sw:data-[active]:text-white", overrides.presetControl)
1634
+ };
1635
+ }
1636
+ var TimePicker = (0, import_react22.forwardRef)(({ size = "md", appearance = "filled", withDropdown = true, classNames, popoverProps, rightSection, clearButtonProps, ...props }, ref) => {
1637
+ const [opened, setOpened] = (0, import_hooks3.useUncontrolled)({
1638
+ value: popoverProps?.opened,
1639
+ defaultValue: popoverProps?.defaultOpened ?? false,
1640
+ onChange: popoverProps?.onChange
1641
+ });
1642
+ const canOpen = withDropdown && !props.disabled && !props.readOnly && !popoverProps?.disabled;
1643
+ const showClock = rightSection === void 0 && !props.clearable;
1644
+ const openDropdown = () => {
1645
+ if (canOpen && !opened)
1646
+ setOpened(true);
1647
+ };
1648
+ return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_dates3.TimePicker, { ref, w: 220, maw: "100%", radius: timePickerSizes[size].radius, rightSectionWidth: timePickerSizes[size].section, rightSectionPointerEvents: showClock ? "none" : void 0, hoursInputLabel: "\u5C0F\u65F6", minutesInputLabel: "\u5206\u949F", secondsInputLabel: "\u79D2", amPmInputLabel: "\u4E0A\u5348\u6216\u4E0B\u5348", clearButtonProps: { "aria-label": "\u6E05\u7A7A\u65F6\u95F4", miw: 24, mih: 24, ...clearButtonProps }, ...props, size, withDropdown, rightSection: showClock ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_lucide_react.Clock, { size: 16, "aria-hidden": true }) : rightSection, popoverProps: {
1649
+ withinPortal: false,
1650
+ floatingStrategy: "fixed",
1651
+ ...popoverProps,
1652
+ opened: canOpen && opened,
1653
+ onChange: setOpened
1654
+ }, onClickCapture: (event) => {
1655
+ props.onClickCapture?.(event);
1656
+ if (!event.defaultPrevented)
1657
+ openDropdown();
1658
+ }, onFocusCapture: (event) => {
1659
+ props.onFocusCapture?.(event);
1660
+ openDropdown();
1661
+ }, onBlurCapture: (event) => {
1662
+ props.onBlurCapture?.(event);
1663
+ if (opened && !event.currentTarget.contains(event.relatedTarget))
1664
+ setOpened(false);
1665
+ }, onKeyDown: (event) => {
1666
+ props.onKeyDown?.(event);
1667
+ if (event.key !== "Escape" || event.defaultPrevented || event.nativeEvent.isComposing || event.keyCode === 229 || !canOpen || !opened || popoverProps?.closeOnEscape === false)
1668
+ return;
1669
+ event.preventDefault();
1670
+ event.stopPropagation();
1671
+ setOpened(false);
1672
+ popoverProps?.onDismiss?.();
1673
+ }, classNames: (theme, values, context) => resolveTimePickerClassNames(size, appearance, typeof classNames === "function" ? classNames(theme, values, context) : classNames) });
1674
+ });
1675
+ TimePicker.displayName = "SWorks/TimePicker";
1676
+
1677
+ // src/components/Tabs/Tabs.tsx
1678
+ var import_react23 = require("react");
1679
+ var import_clsx19 = __toESM(require("clsx"));
1680
+ var import_core18 = require("@s-works/s-works-ui/core");
1681
+ var import_jsx_runtime27 = require("react/jsx-runtime");
1682
+ function resolveTabsClassNames({ variant = "default" } = {}, overrides = {}) {
1683
+ return {
1684
+ ...overrides,
1685
+ root: (0, import_clsx19.default)("sw:min-w-0 sw:max-w-full sw:[font-family:PingFang_SC,sans-serif] sw:tracking-[0px]", overrides.root),
1686
+ list: (0, import_clsx19.default)("sw:max-w-full sw:flex-nowrap sw:overflow-x-auto sw:before:hidden", variant === "pills" ? "sw:gap-[12px]" : "sw:gap-[16px]", overrides.list),
1687
+ tab: (0, import_clsx19.default)("sw:relative sw:h-[32px] sw:shrink-0 sw:justify-center sw:border-0 sw:py-0 sw:text-[14px] sw:font-normal sw:focus-visible:outline-offset-[-2px]", variant === "pills" ? "sw:rounded-[6px] sw:bg-white sw:px-[12px] sw:leading-[22px] sw:text-[#262626] sw:shadow-[inset_0_0_0_1px_rgba(0,0,0,0.08)] sw:hover:bg-[#f2f3f5] sw:data-[active]:bg-[#262626] sw:data-[active]:text-white sw:data-[active]:shadow-none sw:data-[active]:hover:bg-[#262626]" : "sw:min-w-[56px] sw:items-start sw:rounded-none sw:bg-transparent sw:px-[4px] sw:pb-[8px] sw:leading-[24px] sw:text-[#8c8c8c] sw:hover:bg-transparent sw:hover:text-[#262626] sw:data-[active]:font-semibold sw:data-[active]:text-[#262626] sw:after:absolute sw:after:bottom-[1px] sw:after:left-[calc(50%-12px)] sw:after:h-[3px] sw:after:w-[24px] sw:after:rounded-[4px] sw:after:bg-[#262626] sw:after:content-[''] sw:after:opacity-0 sw:data-[active]:after:opacity-100", overrides.tab),
1688
+ tabLabel: (0, import_clsx19.default)("sw:leading-[inherit]", overrides.tabLabel),
1689
+ tabSection: (0, import_clsx19.default)("sw:data-[position=left]:me-[8px] sw:data-[position=right]:ms-[8px]", overrides.tabSection),
1690
+ panel: (0, import_clsx19.default)("sw:min-w-0", overrides.panel)
1691
+ };
1692
+ }
1693
+ var TabsRoot = (0, import_react23.forwardRef)(({ variant = "default", classNames, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_core18.Tabs, { ref, ...props, variant, classNames: (theme, values, context) => resolveTabsClassNames({ variant }, typeof classNames === "function" ? classNames(theme, values, context) : classNames) }));
1694
+ TabsRoot.displayName = "SWorks/Tabs";
1695
+ var Tabs = Object.assign(TabsRoot, {
1696
+ List: import_core18.Tabs.List,
1697
+ Tab: import_core18.Tabs.Tab,
1698
+ Panel: import_core18.Tabs.Panel
1699
+ });
1700
+
1701
+ // src/components/TagsInput/TagsInput.tsx
1702
+ var import_react25 = require("react");
1703
+ var import_clsx20 = __toESM(require("clsx"));
1704
+ var import_core20 = require("@s-works/s-works-ui/core");
1705
+
1706
+ // src/components/TagsInput/controller.tsx
1707
+ var import_react24 = require("react");
1708
+ var import_core19 = require("@s-works/s-works-ui/core");
1709
+ var import_hooks4 = require("@s-works/s-works-ui/hooks");
1710
+ var import_jsx_runtime28 = require("react/jsx-runtime");
1711
+ function useTagsInputController(props, ref) {
1712
+ const { size = "md", value, defaultValue, onChange, searchValue, defaultSearchValue, onSearchChange, data, maxTags = Infinity, allowDuplicates = false, isDuplicate, onDuplicate, splitChars = [","], onRemove, onClear, acceptValueOnBlur = true, openOnFocus = true, readOnly, disabled, onKeyDown, onFocus, onBlur, onPaste, dropdownOpened, defaultDropdownOpened, onDropdownOpen, onDropdownClose, selectFirstOptionOnChange, selectFirstOptionOnDropdownOpen, onOptionSubmit, comboboxProps, filter, limit, withScrollArea = true, maxDropdownHeight = 250, scrollAreaProps, renderOption, clearable, clearButtonProps, hiddenInputProps, hiddenInputValuesDivider = ",", name, form, id, classNames, label, description, error, required, withAsterisk, labelProps, descriptionProps, errorProps, wrapperProps, inputContainer, inputWrapperOrder, withErrorStyles, leftSection, leftSectionWidth, leftSectionPointerEvents, leftSectionProps, rightSection, rightSectionWidth, rightSectionPointerEvents, rightSectionProps, radius, mod, attributes, unstyled, variant, vars, className, style, styles, ...others } = props;
1713
+ const { styleProps, rest: { type: _type, ...fieldRest } } = (0, import_core19.extractStyleProps)(others);
1714
+ const theme = (0, import_core19.useMantineTheme)();
1715
+ const overrides = typeof classNames === "function" ? classNames(theme, props, void 0) : classNames;
1716
+ const [tags, setTags] = (0, import_hooks4.useUncontrolled)({ value, defaultValue, finalValue: [], onChange });
1717
+ const [search, setSearch] = (0, import_hooks4.useUncontrolled)({
1718
+ value: searchValue,
1719
+ defaultValue: defaultSearchValue,
1720
+ finalValue: "",
1721
+ onChange: onSearchChange
1722
+ });
1723
+ const inputRef = (0, import_react24.useRef)(null), fieldRef = (0, import_hooks4.useMergedRef)(inputRef, ref), inputId = (0, import_hooks4.useId)(id);
1724
+ const ownStore = (0, import_core19.useCombobox)({
1725
+ opened: dropdownOpened,
1726
+ defaultOpened: defaultDropdownOpened,
1727
+ onDropdownOpen: () => {
1728
+ onDropdownOpen?.();
1729
+ if (selectFirstOptionOnDropdownOpen)
1730
+ ownStore.selectFirstOption();
1731
+ },
1732
+ onDropdownClose: () => {
1733
+ onDropdownClose?.();
1734
+ ownStore.resetSelectedOption();
1735
+ }
1736
+ });
1737
+ const store = comboboxProps?.store ?? ownStore;
1738
+ const setSearchValue = (text) => {
1739
+ setSearch(text);
1740
+ store.resetSelectedOption();
1741
+ };
1742
+ const duplicate = (tag, current) => isDuplicate ? isDuplicate(tag, current) : current.some((t) => t.toLowerCase() === tag.toLowerCase());
1743
+ const append = (items, submit2 = false) => {
1744
+ if (disabled || readOnly)
1745
+ return;
1746
+ const next = [...tags];
1747
+ for (const raw of items) {
1748
+ const tag = raw.trim();
1749
+ if (!tag)
1750
+ continue;
1751
+ const repeated = duplicate(tag, next);
1752
+ if (repeated) {
1753
+ onDuplicate?.(tag);
1754
+ if (!allowDuplicates)
1755
+ continue;
1756
+ }
1757
+ if (next.length >= maxTags)
1758
+ break;
1759
+ next.push(tag);
1760
+ if (submit2)
1761
+ onOptionSubmit?.(tag);
1762
+ }
1763
+ if (next.length !== tags.length)
1764
+ setTags(next);
1765
+ setSearchValue("");
1766
+ };
1767
+ const split = (text) => {
1768
+ if (!splitChars.length)
1769
+ return [text];
1770
+ const escaped = splitChars.map((char) => char.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"));
1771
+ return text.split(new RegExp(escaped.join("|")));
1772
+ };
1773
+ const remove = (index) => {
1774
+ if (disabled || readOnly)
1775
+ return;
1776
+ onRemove?.(tags[index]);
1777
+ setTags(tags.filter((_, i) => i !== index));
1778
+ inputRef.current?.focus();
1779
+ };
1780
+ const parsed = (0, import_core19.getParsedComboboxData)(data), lookup = (0, import_core19.getOptionsLockup)(parsed);
1781
+ const available = (items) => items.flatMap((item) => {
1782
+ if ("group" in item) {
1783
+ const children = available(item.items);
1784
+ return children.length ? [{ ...item, items: children }] : [];
1785
+ }
1786
+ return tags.some((t) => t.toLowerCase() === item.label.toLowerCase()) ? [] : [item];
1787
+ });
1788
+ const options = available(parsed);
1789
+ (0, import_react24.useEffect)(() => {
1790
+ if (selectFirstOptionOnChange)
1791
+ store.selectFirstOption();
1792
+ }, [search, tags, selectFirstOptionOnChange, store]);
1793
+ const submit = (selected) => {
1794
+ if (!disabled && !readOnly && lookup[selected] && !lookup[selected].disabled)
1795
+ append([lookup[selected].label], true);
1796
+ };
1797
+ const rootProps = {
1798
+ ...styleProps,
1799
+ label,
1800
+ description,
1801
+ error,
1802
+ required,
1803
+ withAsterisk,
1804
+ labelProps,
1805
+ descriptionProps,
1806
+ errorProps,
1807
+ wrapperProps,
1808
+ inputContainer,
1809
+ inputWrapperOrder,
1810
+ withErrorStyles,
1811
+ leftSection,
1812
+ leftSectionWidth,
1813
+ leftSectionPointerEvents,
1814
+ leftSectionProps,
1815
+ rightSection,
1816
+ rightSectionWidth,
1817
+ rightSectionPointerEvents,
1818
+ rightSectionProps,
1819
+ radius,
1820
+ mod,
1821
+ attributes,
1822
+ unstyled,
1823
+ variant,
1824
+ vars: vars ? (_theme, _props, ctx) => vars(_theme, { ...props, classNames: void 0 }, ctx) : void 0,
1825
+ className,
1826
+ style,
1827
+ styles: typeof styles === "function" ? styles(theme, { ...props, classNames: void 0 }, void 0) : styles,
1828
+ disabled,
1829
+ id: inputId
1830
+ };
1831
+ const fieldProps = {
1832
+ ...fieldRest,
1833
+ id: inputId,
1834
+ ref: fieldRef,
1835
+ value: search,
1836
+ disabled,
1837
+ readOnly,
1838
+ required: required && tags.length === 0,
1839
+ onChange: (event) => {
1840
+ setSearchValue(event.currentTarget.value);
1841
+ store.openDropdown();
1842
+ },
1843
+ onFocus: (event) => {
1844
+ onFocus?.(event);
1845
+ if (openOnFocus && !disabled && !readOnly)
1846
+ store.openDropdown();
1847
+ },
1848
+ onBlur: (event) => {
1849
+ onBlur?.(event);
1850
+ if (acceptValueOnBlur)
1851
+ append([search], true);
1852
+ store.closeDropdown();
1853
+ },
1854
+ onKeyDown: (event) => {
1855
+ onKeyDown?.(event);
1856
+ if (event.defaultPrevented || event.isPropagationStopped() || event.nativeEvent.isComposing || disabled || readOnly)
1857
+ return;
1858
+ if (event.key === "Enter" && search.trim() && store.getSelectedOptionIndex() < 0) {
1859
+ event.preventDefault();
1860
+ append([search], true);
1861
+ }
1862
+ if (splitChars.includes(event.key) && search.trim()) {
1863
+ event.preventDefault();
1864
+ append(split(search));
1865
+ }
1866
+ if (event.key === "Backspace" && !search && tags.length)
1867
+ remove(tags.length - 1);
1868
+ },
1869
+ onPaste: (event) => {
1870
+ onPaste?.(event);
1871
+ if (event.defaultPrevented || disabled || readOnly)
1872
+ return;
1873
+ event.preventDefault();
1874
+ append(split(search + event.clipboardData.getData("text/plain")));
1875
+ }
1876
+ };
1877
+ return {
1878
+ props,
1879
+ size,
1880
+ overrides,
1881
+ tags,
1882
+ search,
1883
+ store,
1884
+ rootProps,
1885
+ fieldProps,
1886
+ options,
1887
+ filter,
1888
+ limit,
1889
+ withScrollArea,
1890
+ maxDropdownHeight,
1891
+ scrollAreaProps,
1892
+ renderOption,
1893
+ comboboxProps,
1894
+ submit,
1895
+ remove,
1896
+ clearable: clearable && tags.length > 0 && !disabled && !readOnly,
1897
+ clearButtonProps,
1898
+ clear: () => {
1899
+ setTags([]);
1900
+ setSearchValue("");
1901
+ inputRef.current?.focus();
1902
+ onClear?.();
1903
+ },
1904
+ hiddenInputProps: {
1905
+ name,
1906
+ form,
1907
+ value: tags,
1908
+ valuesDivider: hiddenInputValuesDivider,
1909
+ disabled,
1910
+ ...hiddenInputProps
1911
+ }
1912
+ };
1913
+ }
1914
+ function TagsInputController({ fieldRef, render, ...props }) {
1915
+ return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_jsx_runtime28.Fragment, { children: render(useTagsInputController(props, fieldRef)) });
1916
+ }
1917
+
1918
+ // src/components/TagsInput/icons.tsx
1919
+ var import_jsx_runtime29 = require("react/jsx-runtime");
1920
+ function ChevronLarge(props) {
1921
+ return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("svg", { "aria-hidden": "true", ...props, preserveAspectRatio: "none", overflow: "visible", width: "18", height: "18", viewBox: "0 0 18 18", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("g", { children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("g", { children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("path", { d: "M12.0293 7.03477C12.289 6.77508 12.711 6.77508 12.9707 7.03477C13.2304 7.29447 13.2304 7.71648 12.9707 7.97618L9.47071 11.4762C9.21102 11.7359 8.78901 11.7359 8.52931 11.4762L5.02931 7.97618C4.76961 7.71648 4.76961 7.29447 5.02931 7.03477C5.28901 6.77508 5.71102 6.77508 5.97071 7.03477L9.00001 10.0641L12.0293 7.03477Z", fill: "currentColor" }) }) }) });
1922
+ }
1923
+ function ChevronMedium(props) {
1924
+ return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("svg", { "aria-hidden": "true", ...props, preserveAspectRatio: "none", overflow: "visible", width: "14.2222", height: "14.2222", viewBox: "0 0 14.2222 14.2222", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("g", { children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("path", { d: "M9.80383 5.36424C10.0347 5.1334 10.4098 5.1334 10.6406 5.36424C10.8715 5.59509 10.8715 5.97021 10.6406 6.20105L7.52952 9.31216C7.29868 9.543 6.92356 9.543 6.69272 9.31216L3.58161 6.20105C3.35076 5.97021 3.35076 5.59509 3.58161 5.36424C3.81245 5.1334 4.18757 5.1334 4.41841 5.36424L7.11112 8.05695L9.80383 5.36424Z", fill: "currentColor" }) }) });
1925
+ }
1926
+ function ChevronSmall(props) {
1927
+ return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("svg", { "aria-hidden": "true", ...props, preserveAspectRatio: "none", overflow: "visible", width: "12.4444", height: "12.4444", viewBox: "0 0 12.4444 12.4444", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("g", { children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("path", { d: "M8.57835 4.69371C8.78034 4.49173 9.10857 4.49173 9.31056 4.69371C9.51254 4.8957 9.51254 5.22393 9.31056 5.42592L6.58833 8.14814C6.38635 8.35013 6.05812 8.35013 5.85613 8.14814L3.13391 5.42592C2.93192 5.22393 2.93192 4.8957 3.13391 4.69371C3.33589 4.49173 3.66412 4.49173 3.86611 4.69371L6.22223 7.04983L8.57835 4.69371Z", fill: "currentColor" }) }) });
1928
+ }
1929
+ function CloseVector(props) {
1930
+ return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("svg", { "aria-hidden": "true", ...props, preserveAspectRatio: "none", overflow: "visible", width: "6.33074", height: "6.33074", viewBox: "0 0 6.33074 6.33074", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("path", { d: "M5.19464 0.194563C5.45427 -0.0648887 5.87638 -0.0648198 6.13605 0.194563C6.3957 0.454208 6.39559 0.876257 6.13605 1.13597L4.10675 3.16527L6.13605 5.19456C6.3957 5.45421 6.39559 5.87626 6.13605 6.13597C5.87635 6.39567 5.45434 6.39567 5.19464 6.13597L3.16535 4.10667L1.13605 6.13597C0.87635 6.39567 0.454341 6.39567 0.194642 6.13597C-0.0647931 5.87625 -0.0649685 5.45417 0.194642 5.19456L2.22394 3.16527L0.194642 1.13597C-0.0647928 0.876248 -0.0649684 0.454174 0.194642 0.194563C0.454267 -0.0648888 0.876381 -0.0648196 1.13605 0.194563L3.16535 2.22386L5.19464 0.194563Z", fill: "currentColor" }) });
1931
+ }
1932
+ function CloseSmall(props) {
1933
+ return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("svg", { width: "16", height: "16", viewBox: "0 0 16 16", "aria-hidden": "true", ...props, children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("g", { transform: "translate(4.834526538848877 4.834324836730957)", children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(CloseVector, {}) }) });
1934
+ }
1935
+ function CloseVectorSmall() {
1936
+ return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("svg", { preserveAspectRatio: "none", overflow: "visible", width: "4.74806", height: "4.74806", viewBox: "0 0 4.74806 4.74806", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("path", { d: "M3.89598 0.145922C4.0907 -0.0486666 4.40729 -0.0486149 4.60204 0.145922C4.79677 0.340656 4.79669 0.657193 4.60204 0.851977L3.08006 2.37395L4.60204 3.89592C4.79677 4.09066 4.79669 4.40719 4.60204 4.60198C4.40726 4.79675 4.09076 4.79675 3.89598 4.60198L2.37401 3.08L0.852037 4.60198C0.657263 4.79675 0.340756 4.79675 0.145982 4.60198C-0.0485949 4.40719 -0.0487264 4.09063 0.145982 3.89592L1.66795 2.37395L0.145982 0.851977C-0.0485946 0.657186 -0.0487263 0.34063 0.145982 0.145922C0.3407 -0.0486666 0.657286 -0.0486147 0.852037 0.145922L2.37401 1.66789L3.89598 0.145922Z", fill: "currentColor" }) });
1937
+ }
1938
+ function CloseSmallTwelve(props) {
1939
+ return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("svg", { width: "12", height: "12", viewBox: "0 0 12 12", "aria-hidden": "true", ...props, children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("g", { transform: "translate(3.6258950233459473 3.6257436275482178)", children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(CloseVectorSmall, {}) }) });
1940
+ }
1941
+
1942
+ // src/components/TagsInput/TagsInput.tsx
1943
+ var import_jsx_runtime30 = require("react/jsx-runtime");
1944
+ var dimensions = {
1945
+ lg: {
1946
+ w: 320,
1947
+ radius: 8,
1948
+ section: 42,
1949
+ remove: "sw:h-[16px] sw:w-[16px] sw:min-w-[16px] sw:disabled:h-[16px] sw:disabled:w-[16px] sw:disabled:min-w-[16px]",
1950
+ pillHeight: 32,
1951
+ pillSize: 14,
1952
+ input: "sw:h-[48px] sw:pe-[38px]",
1953
+ padding: "sw:ps-[8px]",
1954
+ iconPadding: "sw:ps-[38px]",
1955
+ pill: "sw:gap-[12px] sw:rounded-[3px] sw:px-[12px]",
1956
+ label: "sw:text-[14px] sw:leading-[22px]",
1957
+ field: "sw:h-[22px] sw:text-[14px] sw:leading-[22px]",
1958
+ chevron: "sw:h-[18px] sw:w-[18px]",
1959
+ border: "sw:shadow-[inset_0_0_0_1px_rgba(0,0,0,0.12)]"
1960
+ },
1961
+ md: {
1962
+ w: 280,
1963
+ radius: 6,
1964
+ section: 32,
1965
+ remove: "sw:h-[16px] sw:w-[16px] sw:min-w-[16px] sw:disabled:h-[16px] sw:disabled:w-[16px] sw:disabled:min-w-[16px]",
1966
+ pillHeight: 24,
1967
+ pillSize: 12,
1968
+ input: "sw:h-[40px] sw:pe-[32px] sw:data-[disabled]:pe-[36px]",
1969
+ padding: "sw:ps-[8px]",
1970
+ iconPadding: "sw:ps-[32px]",
1971
+ pill: "sw:gap-[8px] sw:rounded-[3px] sw:px-[8px]",
1972
+ label: "sw:text-[12px] sw:leading-[20px] sw:group-data-[disabled]/tag:leading-[18px]",
1973
+ field: "sw:h-[20px] sw:text-[12px] sw:leading-[20px]",
1974
+ chevron: "sw:h-[16px] sw:w-[16px]",
1975
+ border: "sw:shadow-[inset_0_0_0_1px_#dedede]"
1976
+ },
1977
+ sm: {
1978
+ w: 240,
1979
+ radius: 6,
1980
+ section: 30,
1981
+ remove: "sw:h-[12px] sw:w-[12px] sw:min-w-[12px] sw:disabled:h-[12px] sw:disabled:w-[12px] sw:disabled:min-w-[12px]",
1982
+ pillHeight: 20,
1983
+ pillSize: 12,
1984
+ input: "sw:h-[32px] sw:pe-[30px]",
1985
+ padding: "sw:ps-[6px]",
1986
+ iconPadding: "sw:ps-[30px]",
1987
+ pill: "sw:gap-[4px] sw:px-[4px] sw:data-[disabled]:rounded-[3px]",
1988
+ label: "sw:text-[12px] sw:leading-[20px] sw:group-data-[disabled]/tag:leading-[18px]",
1989
+ field: "sw:h-[20px] sw:text-[12px] sw:leading-[20px]",
1990
+ chevron: "sw:h-[14px] sw:w-[14px]",
1991
+ border: "sw:shadow-[inset_0_0_0_1px_#dedede]"
1992
+ }
1993
+ };
1994
+ function resolveTagsInputProps({ size = "md", ...props } = {}) {
1995
+ return {
1996
+ w: dimensions[size].w,
1997
+ maw: "100%",
1998
+ ...props,
1999
+ size,
2000
+ radius: props.radius ?? dimensions[size].radius,
2001
+ leftSectionWidth: props.leftSectionWidth ?? dimensions[size].section,
2002
+ rightSectionWidth: props.rightSectionWidth ?? (size === "md" && props.disabled ? 40 : dimensions[size].section),
2003
+ rightSectionPointerEvents: props.rightSectionPointerEvents ?? "none"
2004
+ };
2005
+ }
2006
+ function resolveTagsInputClassNames({ size = "md", hasLeftSection = false } = {}, overrides = {}) {
2007
+ return {
2008
+ ...overrides,
2009
+ root: (0, import_clsx20.default)("sw:group/tags sw:min-w-0 sw:[font-family:PingFang_SC,sans-serif] sw:tracking-[0px]", overrides.root),
2010
+ input: (0, import_clsx20.default)("sw:flex sw:min-h-0 sw:items-center sw:border-0 sw:bg-white sw:py-0 sw:text-[#262626] sw:[&:hover:not(:focus-within):not([data-disabled])]:shadow-[inset_0_0_0_1px_rgba(0,0,0,0.12)] sw:focus-within:shadow-[inset_0_0_0_1px_#165dff] sw:data-[disabled]:bg-[#f2f3f5] sw:data-[disabled]:shadow-[inset_0_0_0_1px_rgba(0,0,0,0.08)] sw:data-[error]:shadow-[inset_0_0_0_1px_#ff4d4f]", dimensions[size].input, dimensions[size].border, hasLeftSection ? dimensions[size].iconPadding : dimensions[size].padding, overrides.input),
2011
+ pillsList: (0, import_clsx20.default)("sw:w-full sw:min-w-0 sw:flex-nowrap sw:gap-[4px] sw:overflow-x-auto sw:[scrollbar-width:none]", overrides.pillsList),
2012
+ pill: (0, import_clsx20.default)("sw:group/tag sw:max-w-none sw:flex-none sw:bg-[#f3f7ff] sw:py-0 sw:font-normal sw:text-[#262626] sw:data-[disabled]:bg-[#f2f3f5] sw:data-[disabled]:text-[#bfbfbf] sw:data-[disabled]:shadow-[inset_0_0_0_1px_rgba(0,0,0,0.08)]", dimensions[size].pill, size === "sm" ? hasLeftSection ? "sw:rounded-[3px]" : "sw:rounded-[4px] sw:group-focus-within/tags:rounded-[3px]" : void 0, overrides.pill),
2013
+ pillLabel: (0, import_clsx20.default)("sw:h-auto sw:font-normal", dimensions[size].label, overrides.pillLabel),
2014
+ pillRemove: (0, import_clsx20.default)("sw:flex sw:min-h-0 sw:flex-none sw:rounded-none sw:p-0 sw:text-[#bfbfbf] sw:hover:bg-transparent sw:disabled:flex sw:disabled:bg-transparent", dimensions[size].remove, overrides.pillRemove),
2015
+ inputField: (0, import_clsx20.default)("sw:min-w-[64px] sw:flex-1 sw:border-0 sw:bg-transparent sw:p-0 sw:text-[#262626] sw:placeholder:text-[#8c8c8c] sw:disabled:text-[#bfbfbf]", dimensions[size].field, overrides.inputField),
2016
+ section: (0, import_clsx20.default)("sw:text-[#bfbfbf] sw:data-[position=right]:end-0 sw:data-[position=left]:start-0", overrides.section),
2017
+ dropdown: (0, import_clsx20.default)("sw:rounded-[8px] sw:border-0 sw:bg-white sw:p-[8px] sw:shadow-[inset_0_0_0_1px_rgba(0,0,0,0.08),0_8px_16px_rgba(0,0,0,0.1)] sw:[font-family:PingFang_SC,sans-serif]", overrides.dropdown),
2018
+ options: (0, import_clsx20.default)("sw:p-0", overrides.options),
2019
+ option: (0, import_clsx20.default)("sw:h-[40px] sw:rounded-[4px] sw:px-[8px] sw:py-0 sw:text-[14px] sw:font-normal sw:leading-[22px] sw:text-[#262626] sw:hover:bg-[#165dff]/[0.05] sw:data-[combobox-selected]:bg-[#165dff]/[0.05] sw:data-[combobox-disabled]:text-[#bfbfbf]", overrides.option)
2020
+ };
2021
+ }
2022
+ var TagsInput = (0, import_react25.forwardRef)((props, ref) => /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(TagsInputController, { ...props, fieldRef: ref, render: (ctx) => {
2023
+ const classes = resolveTagsInputClassNames({ size: ctx.size, hasLeftSection: Boolean(ctx.rootProps.leftSection) }, ctx.overrides);
2024
+ const d = dimensions[ctx.size];
2025
+ return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(import_jsx_runtime30.Fragment, { children: [
2026
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(import_core20.Combobox, { store: ctx.store, onOptionSubmit: ctx.submit, readOnly: ctx.props.readOnly, offset: 4, ...ctx.comboboxProps, classNames: classes, children: [
2027
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_core20.Combobox.DropdownTarget, { children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_core20.PillsInput, { ...resolveTagsInputProps({ ...ctx.rootProps, size: ctx.size }), classNames: classes, rightSection: ctx.clearable ? /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_core20.Combobox.ClearButton, { ...ctx.clearButtonProps, onClear: ctx.clear, "aria-label": ctx.clearButtonProps?.["aria-label"] ?? "\u6E05\u9664\u5168\u90E8\u6807\u7B7E", "aria-hidden": false, tabIndex: 0 }) : ctx.rootProps.rightSection === void 0 ? /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { "aria-hidden": "true", className: (0, import_clsx20.default)("sw:flex sw:items-center sw:justify-center", d.chevron), children: ctx.size === "lg" ? /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(ChevronLarge, {}) : ctx.size === "md" ? /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(ChevronMedium, {}) : /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(ChevronSmall, {}) }) : ctx.rootProps.rightSection, onClick: () => {
2028
+ if (!ctx.props.disabled && !ctx.props.readOnly)
2029
+ ctx.store.openDropdown();
2030
+ }, children: /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(import_core20.Pill.Group, { classNames: { group: classes.pillsList }, children: [
2031
+ ctx.tags.map((tag, index) => /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_core20.Pill, { h: ctx.props.disabled && ctx.size === "md" ? 22 : d.pillHeight, fz: d.pillSize, disabled: ctx.props.disabled, withRemoveButton: !ctx.props.readOnly, onRemove: () => ctx.remove(index), classNames: {
2032
+ root: classes.pill,
2033
+ label: classes.pillLabel,
2034
+ remove: classes.pillRemove
2035
+ }, removeButtonProps: {
2036
+ icon: ctx.size === "sm" ? /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(CloseSmallTwelve, { className: "sw:block" }) : /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(CloseSmall, { className: "sw:block" }),
2037
+ "aria-label": "\u5220\u9664\u6807\u7B7E " + tag,
2038
+ "aria-hidden": false,
2039
+ disabled: ctx.props.disabled,
2040
+ tabIndex: ctx.props.disabled ? -1 : 0
2041
+ }, children: tag }, tag + "-" + index)),
2042
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_core20.Combobox.EventsTarget, { autoComplete: ctx.fieldProps.autoComplete, children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_core20.PillsInput.Field, { ...ctx.fieldProps, classNames: { field: classes.inputField } }) })
2043
+ ] }) }) }),
2044
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_core20.OptionsDropdown, { data: ctx.options, search: ctx.search, filter: ctx.filter, limit: ctx.limit, withScrollArea: ctx.withScrollArea, maxDropdownHeight: ctx.maxDropdownHeight, scrollAreaProps: ctx.scrollAreaProps, renderOption: ctx.renderOption, hidden: ctx.props.disabled || ctx.props.readOnly || ctx.tags.length >= (ctx.props.maxTags ?? Infinity), hiddenWhenEmpty: true, unstyled: ctx.props.unstyled, "aria-label": ctx.props["aria-label"], labelId: ctx.props.label ? ctx.fieldProps.id + "-label" : void 0 })
2045
+ ] }),
2046
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_core20.Combobox.HiddenInput, { ...ctx.hiddenInputProps })
2047
+ ] });
2048
+ } }));
2049
+ TagsInput.displayName = "SWorks/TagsInput";
2050
+
2051
+ // src/components/InputBase/InputBase.tsx
2052
+ var import_react26 = require("react");
2053
+ var import_clsx21 = __toESM(require("clsx"));
2054
+ var import_core21 = require("@s-works/s-works-ui/core");
2055
+ var import_jsx_runtime31 = require("react/jsx-runtime");
2056
+ var sizes2 = {
2057
+ lg: {
2058
+ input: "sw:h-[48px] sw:text-[16px] sw:leading-[24px]",
2059
+ padding: "sw:ps-[16px]",
2060
+ end: "sw:pe-[16px]",
2061
+ left: "sw:ps-[44px] sw:focus:ps-[40px]",
2062
+ right: "sw:pe-[44px]",
2063
+ radius: 8,
2064
+ section: 48
2065
+ },
2066
+ md: {
2067
+ input: "sw:h-[40px] sw:text-[14px] sw:leading-[22px]",
2068
+ padding: "sw:ps-[12px]",
2069
+ end: "sw:pe-[12px]",
2070
+ left: "sw:ps-[36px]",
2071
+ right: "sw:pe-[36px]",
2072
+ radius: 8,
2073
+ section: 40
2074
+ },
2075
+ sm: {
2076
+ input: "sw:h-[32px] sw:text-[14px] sw:leading-[22px]",
2077
+ padding: "sw:ps-[8px]",
2078
+ end: "sw:pe-[8px]",
2079
+ left: "sw:ps-[32px]",
2080
+ right: "sw:pe-[32px]",
2081
+ radius: 6,
2082
+ section: 32
2083
+ }
2084
+ };
2085
+ var appearances3 = {
2086
+ filled: "sw:bg-[#f2f3f5] sw:[&:enabled:hover:not(:focus)]:bg-[#e5e6eb] sw:enabled:focus:bg-white sw:enabled:focus:shadow-[inset_0_0_0_1px_#165dff]",
2087
+ outlined: "sw:bg-white sw:shadow-[inset_0_0_0_1px_rgba(0,0,0,0.08)] sw:[&:enabled:hover:not(:focus)]:shadow-[inset_0_0_0_1px_rgba(0,0,0,0.12)] sw:enabled:focus:shadow-[inset_0_0_0_1px_#165dff]"
2088
+ };
2089
+ function resolveInputBaseProps({ size = "md", appearance: _appearance, ...props } = {}) {
2090
+ return {
2091
+ w: 220,
2092
+ maw: "100%",
2093
+ ...props,
2094
+ size,
2095
+ radius: props.radius ?? sizes2[size].radius,
2096
+ leftSectionWidth: props.leftSectionWidth ?? sizes2[size].section,
2097
+ rightSectionWidth: props.rightSectionWidth ?? sizes2[size].section,
2098
+ leftSectionPointerEvents: props.leftSectionPointerEvents ?? "none",
2099
+ inputWrapperOrder: props.inputWrapperOrder ?? ["label", "input", "description", "error"]
2100
+ };
2101
+ }
2102
+ function resolveInputBaseClassNames({ size = "md", appearance = "filled", hasLeftSection = false, hasRightSection = false, disabled = false } = {}, overrides = {}) {
2103
+ return {
2104
+ ...overrides,
2105
+ root: (0, import_clsx21.default)("sw:group/base sw:min-w-0 sw:[font-family:PingFang_SC,sans-serif] sw:tracking-[0px]", overrides.root),
2106
+ wrapper: (0, import_clsx21.default)("sw:mb-0", overrides.wrapper),
2107
+ input: (0, import_clsx21.default)("sw:min-h-0 sw:border-0 sw:py-0 sw:font-normal sw:text-[#262626] sw:placeholder:text-[#8c8c8c] sw:disabled:cursor-not-allowed sw:disabled:text-[#bfbfbf] sw:disabled:placeholder:text-[#bfbfbf] sw:disabled:opacity-100 sw:data-[error]:shadow-[inset_0_0_0_1px_#ff4d4f]", sizes2[size].input, hasLeftSection ? sizes2[size].left : sizes2[size].padding, hasRightSection ? sizes2[size].right : sizes2[size].end, appearances3[appearance], overrides.input),
2108
+ section: (0, import_clsx21.default)("sw:data-[position=left]:start-0 sw:data-[position=right]:end-0", disabled ? "sw:text-[#bfbfbf]" : "sw:text-[#8c8c8c] sw:group-has-[input:not(:placeholder-shown)]/base:text-[#262626]", overrides.section),
2109
+ description: (0, import_clsx21.default)("sw:mb-0 sw:mt-[4px] sw:text-[12px] sw:font-normal sw:leading-[18px] sw:text-[#8c8c8c]", overrides.description),
2110
+ error: (0, import_clsx21.default)("sw:mt-[4px] sw:text-[12px] sw:leading-[18px] sw:text-[#ff4d4f]", overrides.error)
2111
+ };
2112
+ }
2113
+ var InputBaseRoot = (0, import_react26.forwardRef)(({ size = "md", appearance = "filled", classNames, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_core21.InputBase, { ref, ...resolveInputBaseProps({ size, ...props }), classNames: (theme, values, context) => resolveInputBaseClassNames({
2114
+ size,
2115
+ appearance,
2116
+ disabled: props.disabled,
2117
+ hasLeftSection: Boolean(props.leftSection),
2118
+ hasRightSection: Boolean(props.rightSection)
2119
+ }, typeof classNames === "function" ? classNames(theme, values, context) : classNames) }));
2120
+ InputBaseRoot.displayName = "SWorks/InputBase";
2121
+ var InputBase = (0, import_core21.createPolymorphicComponent)(InputBaseRoot);
2122
+
2123
+ // src/components/Tag/Tag.tsx
2124
+ var import_react27 = require("react");
2125
+ var import_clsx22 = __toESM(require("clsx"));
2126
+ var import_core22 = require("@s-works/s-works-ui/core");
2127
+
2128
+ // src/components/Tag/icons.tsx
2129
+ var import_jsx_runtime32 = require("react/jsx-runtime");
2130
+ function CloseVector2(props) {
2131
+ return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("svg", { preserveAspectRatio: "none", overflow: "visible", width: "6.33074", height: "6.33074", viewBox: "0 0 6.33074 6.33074", fill: "none", xmlns: "http://www.w3.org/2000/svg", "aria-hidden": "true", ...props, children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("path", { d: "M5.19464 0.194563C5.45427 -0.0648887 5.87638 -0.0648198 6.13605 0.194563C6.3957 0.454208 6.39559 0.876257 6.13605 1.13597L4.10675 3.16527L6.13605 5.19456C6.3957 5.45421 6.39559 5.87626 6.13605 6.13597C5.87635 6.39567 5.45434 6.39567 5.19464 6.13597L3.16535 4.10667L1.13605 6.13597C0.87635 6.39567 0.454341 6.39567 0.194642 6.13597C-0.0647931 5.87625 -0.0649685 5.45417 0.194642 5.19456L2.22394 3.16527L0.194642 1.13597C-0.0647928 0.876248 -0.0649684 0.454174 0.194642 0.194563C0.454267 -0.0648888 0.876381 -0.0648196 1.13605 0.194563L3.16535 2.22386L5.19464 0.194563Z", fill: "white" }) });
2132
+ }
2133
+ function TagCloseIcon(props) {
2134
+ return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("svg", { width: "16", height: "16", viewBox: "0 0 16 16", "aria-hidden": "true", ...props, children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("g", { transform: "translate(4.834526538848877 4.834324836730957)", children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(CloseVector2, {}) }) });
2135
+ }
2136
+
2137
+ // src/components/Tag/Tag.tsx
2138
+ var import_jsx_runtime33 = require("react/jsx-runtime");
2139
+ var sizes3 = {
2140
+ lg: {
2141
+ h: 32,
2142
+ fz: 14,
2143
+ px: 12,
2144
+ line: "sw:leading-[22px]",
2145
+ start: "me-[8px]",
2146
+ end: "ms-[8px]",
2147
+ r: { base: 4, rounded: 6, pill: 16 }
2148
+ },
2149
+ md: {
2150
+ h: 24,
2151
+ fz: 12,
2152
+ px: 8,
2153
+ line: "sw:leading-[18px]",
2154
+ start: "me-[4px]",
2155
+ end: "ms-[4px]",
2156
+ r: { base: 3, rounded: 6, pill: 12 }
2157
+ },
2158
+ sm: {
2159
+ h: 20,
2160
+ fz: 12,
2161
+ px: 6,
2162
+ line: "sw:leading-[18px]",
2163
+ start: "me-[4px]",
2164
+ end: "ms-[4px]",
2165
+ r: { base: 3, rounded: 4, pill: 12 }
2166
+ }
2167
+ };
2168
+ var palette = {
2169
+ neutral: {
2170
+ filled: {
2171
+ normal: "sw:text-[#262626] sw:bg-[#f2f3f5] sw:shadow-none",
2172
+ disabled: "sw:text-[#bfbfbf] sw:bg-[#f2f3f5] sw:shadow-none"
2173
+ },
2174
+ outline: {
2175
+ normal: "sw:text-[#262626] sw:bg-transparent sw:shadow-[inset_0_0_0_1px_rgba(0,0,0,0.08)]",
2176
+ disabled: "sw:text-[#bfbfbf] sw:bg-transparent sw:shadow-[inset_0_0_0_1px_rgba(0,0,0,0.05)]"
2177
+ },
2178
+ soft: {
2179
+ normal: "sw:text-[#262626] sw:bg-[#f5f5f5] sw:shadow-[inset_0_0_0_1px_rgba(0,0,0,0.08)]",
2180
+ disabled: "sw:text-[#bfbfbf] sw:bg-[#f5f5f5] sw:shadow-[inset_0_0_0_1px_rgba(0,0,0,0.05)]"
2181
+ },
2182
+ light: {
2183
+ normal: "sw:text-[#262626] sw:bg-[#f5f5f5] sw:shadow-none",
2184
+ disabled: "sw:text-[#bfbfbf] sw:bg-[#f5f5f5] sw:shadow-none"
2185
+ }
2186
+ },
2187
+ primary: {
2188
+ filled: {
2189
+ normal: "sw:text-white sw:bg-[#165dff] sw:shadow-none",
2190
+ disabled: "sw:text-white sw:bg-[#adc6ff] sw:shadow-none"
2191
+ },
2192
+ outline: {
2193
+ normal: "sw:text-[#165dff] sw:bg-transparent sw:shadow-[inset_0_0_0_1px_currentColor]",
2194
+ disabled: "sw:text-[#adc6ff] sw:bg-transparent sw:shadow-[inset_0_0_0_1px_currentColor]"
2195
+ },
2196
+ soft: {
2197
+ normal: "sw:text-[#165dff] sw:bg-[#f3f7ff] sw:shadow-[inset_0_0_0_1px_currentColor]",
2198
+ disabled: "sw:text-[#adc6ff] sw:bg-[#f3f7ff] sw:shadow-[inset_0_0_0_1px_currentColor]"
2199
+ },
2200
+ light: {
2201
+ normal: "sw:text-[#165dff] sw:bg-[#f3f7ff] sw:shadow-none",
2202
+ disabled: "sw:text-[#adc6ff] sw:bg-[#f3f7ff] sw:shadow-none"
2203
+ }
2204
+ },
2205
+ success: {
2206
+ filled: {
2207
+ normal: "sw:text-white sw:bg-[#0dc15b] sw:shadow-none",
2208
+ disabled: "sw:text-white sw:bg-[#b6ecce] sw:shadow-none"
2209
+ },
2210
+ outline: {
2211
+ normal: "sw:text-[#0dc15b] sw:bg-transparent sw:shadow-[inset_0_0_0_1px_currentColor]",
2212
+ disabled: "sw:text-[#b6ecce] sw:bg-transparent sw:shadow-[inset_0_0_0_1px_currentColor]"
2213
+ },
2214
+ soft: {
2215
+ normal: "sw:text-[#0dc15b] sw:bg-[#e7f9ef] sw:shadow-[inset_0_0_0_1px_currentColor]",
2216
+ disabled: "sw:text-[#b6ecce] sw:bg-[#e7f9ef] sw:shadow-[inset_0_0_0_1px_currentColor]"
2217
+ },
2218
+ light: {
2219
+ normal: "sw:text-[#0dc15b] sw:bg-[#e7f9ef] sw:shadow-none",
2220
+ disabled: "sw:text-[#b6ecce] sw:bg-[#e7f9ef] sw:shadow-none"
2221
+ }
2222
+ },
2223
+ error: {
2224
+ filled: {
2225
+ normal: "sw:text-white sw:bg-[#fa8c16] sw:shadow-none",
2226
+ disabled: "sw:text-white sw:bg-[#fdd7ad] sw:shadow-none"
2227
+ },
2228
+ outline: {
2229
+ normal: "sw:text-[#fa8c16] sw:bg-transparent sw:shadow-[inset_0_0_0_1px_currentColor]",
2230
+ disabled: "sw:text-[#fdd7ad] sw:bg-transparent sw:shadow-[inset_0_0_0_1px_currentColor]"
2231
+ },
2232
+ soft: {
2233
+ normal: "sw:text-[#fa8c16] sw:bg-[#fff9f3] sw:shadow-[inset_0_0_0_1px_currentColor]",
2234
+ disabled: "sw:text-[#fdd7ad] sw:bg-[#fff9f3] sw:shadow-[inset_0_0_0_1px_currentColor]"
2235
+ },
2236
+ light: {
2237
+ normal: "sw:text-[#fa8c16] sw:bg-[#fff9f3] sw:shadow-none",
2238
+ disabled: "sw:text-[#fdd7ad] sw:bg-[#fff9f3] sw:shadow-none"
2239
+ }
2240
+ },
2241
+ warning: {
2242
+ filled: {
2243
+ normal: "sw:text-white sw:bg-[#f53f3f] sw:shadow-none",
2244
+ disabled: "sw:text-white sw:bg-[#fbbcbc] sw:shadow-none"
2245
+ },
2246
+ outline: {
2247
+ normal: "sw:text-[#f53f3f] sw:bg-transparent sw:shadow-[inset_0_0_0_1px_currentColor]",
2248
+ disabled: "sw:text-[#fbbcbc] sw:bg-transparent sw:shadow-[inset_0_0_0_1px_currentColor]"
2249
+ },
2250
+ soft: {
2251
+ normal: "sw:text-[#f53f3f] sw:bg-[#fef5f5] sw:shadow-[inset_0_0_0_1px_currentColor]",
2252
+ disabled: "sw:text-[#fbbcbc] sw:bg-[#fef5f5] sw:shadow-[inset_0_0_0_1px_currentColor]"
2253
+ },
2254
+ light: {
2255
+ normal: "sw:text-[#f53f3f] sw:bg-[#fef5f5] sw:shadow-none",
2256
+ disabled: "sw:text-[#fbbcbc] sw:bg-[#fef5f5] sw:shadow-none"
2257
+ }
2258
+ }
2259
+ };
2260
+ function resolveTagProps({ size = "md", shape = "base", tone: _tone, variant: _variant, disabled: _disabled, closable: _closable, onClose: _onClose, closeButtonProps: _close, ...props } = {}) {
2261
+ return {
2262
+ h: sizes3[size].h,
2263
+ fz: sizes3[size].fz,
2264
+ px: sizes3[size].px,
2265
+ ...props,
2266
+ size,
2267
+ radius: props.radius ?? sizes3[size].r[shape],
2268
+ variant: "default"
2269
+ };
2270
+ }
2271
+ function resolveTagClassNames({ size = "md", tone = "neutral", variant = "filled", disabled = false } = {}, overrides = {}) {
2272
+ return {
2273
+ ...overrides,
2274
+ root: (0, import_clsx22.default)("sw:inline-flex sw:flex-none sw:items-center sw:border-0 sw:py-0 sw:font-normal sw:normal-case sw:tracking-[0px] sw:[font-family:PingFang_SC,sans-serif]", sizes3[size].line, palette[tone][variant][disabled ? "disabled" : "normal"], disabled ? "sw:cursor-not-allowed" : "", overrides.root),
2275
+ label: (0, import_clsx22.default)("sw:leading-[inherit]", overrides.label),
2276
+ section: (0, import_clsx22.default)("sw:inline-flex sw:shrink-0 sw:items-center sw:leading-none sw:data-[position=left]:ms-0 sw:data-[position=right]:me-0", size === "lg" ? "sw:data-[position=left]:me-[8px] sw:data-[position=right]:ms-[8px]" : "sw:data-[position=left]:me-[4px] sw:data-[position=right]:ms-[4px]", overrides.section)
2277
+ };
2278
+ }
2279
+ function renderTagCloseButton({ disabled, onClose, closeButtonProps }) {
2280
+ return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_core22.CloseButton, { size: 16, radius: 0, c: "inherit", variant: "transparent", ...closeButtonProps, icon: closeButtonProps?.icon ?? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(TagCloseIcon, {}), disabled: disabled || closeButtonProps?.disabled, "aria-label": closeButtonProps?.["aria-label"] ?? "\u79FB\u9664\u6807\u7B7E", classNames: (theme, values, context) => {
2281
+ const overrides = typeof closeButtonProps?.classNames === "function" ? closeButtonProps.classNames(theme, values, context) : closeButtonProps?.classNames;
2282
+ return {
2283
+ ...overrides,
2284
+ root: (0, import_clsx22.default)("sw:p-0 sw:hover:bg-transparent sw:disabled:bg-transparent sw:disabled:opacity-100", overrides?.root)
2285
+ };
2286
+ }, onClick: (event) => {
2287
+ event.stopPropagation();
2288
+ if (disabled)
2289
+ return;
2290
+ closeButtonProps?.onClick?.(event);
2291
+ if (!event.defaultPrevented)
2292
+ onClose?.(event);
2293
+ } });
2294
+ }
2295
+ var TagRoot = (0, import_react27.forwardRef)(({ size = "md", tone = "neutral", variant = "filled", shape = "base", disabled = false, closable = false, onClose, closeButtonProps, classNames, onClick, onKeyDown, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_core22.Badge, { component: "span", ...resolveTagProps({ size, shape, ...props }), ...props.component === "button" ? { disabled } : {}, ref, "aria-disabled": disabled || props["aria-disabled"], "data-disabled": disabled || void 0, rightSection: props.rightSection !== void 0 ? props.rightSection : closable ? renderTagCloseButton({ disabled, onClose, closeButtonProps }) : void 0, onClick: (event) => {
2296
+ if (disabled) {
2297
+ event.preventDefault();
2298
+ event.stopPropagation();
2299
+ return;
2300
+ }
2301
+ onClick?.(event);
2302
+ }, onKeyDown: (event) => {
2303
+ if (disabled) {
2304
+ if (event.key === "Enter" || event.key === " ") {
2305
+ event.preventDefault();
2306
+ event.stopPropagation();
2307
+ }
2308
+ return;
2309
+ }
2310
+ onKeyDown?.(event);
2311
+ }, classNames: (theme, values, context) => resolveTagClassNames({ size, tone, variant, disabled }, typeof classNames === "function" ? classNames(theme, values, context) : classNames) }));
2312
+ TagRoot.displayName = "SWorks/Tag";
2313
+ var Tag = (0, import_core22.createPolymorphicComponent)(TagRoot);
2314
+
2315
+ // src/components/CloseButton/CloseButton.tsx
2316
+ var import_react28 = require("react");
2317
+ var import_clsx23 = __toESM(require("clsx"));
2318
+ var import_core23 = require("@s-works/s-works-ui/core");
2319
+
2320
+ // src/components/CloseButton/icons.tsx
2321
+ var import_jsx_runtime34 = require("react/jsx-runtime");
2322
+ function CloseLargeIcon(props) {
2323
+ return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true", focusable: "false", ...props, children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("path", { d: "M13.0296 2.02974C13.2893 1.77005 13.7113 1.77005 13.971 2.02974C14.2303 2.28947 14.2306 2.71157 13.971 2.97115L8.94169 8.00045L13.971 13.0297C14.2303 13.2895 14.2306 13.7116 13.971 13.9711C13.7114 14.2307 13.2893 14.2305 13.0296 13.9711L8.00028 8.94185L2.97099 13.9711C2.7114 14.2307 2.28929 14.2305 2.02958 13.9711C1.7699 13.7115 1.76994 13.2894 2.02958 13.0297L7.05888 8.00045L2.02958 2.97115C1.7699 2.71147 1.76994 2.28945 2.02958 2.02974C2.28928 1.77005 2.71129 1.77005 2.97099 2.02974L8.00028 7.05904L13.0296 2.02974Z", fill: "currentColor" }) });
2324
+ }
2325
+ function CloseMediumIcon(props) {
2326
+ return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("svg", { xmlns: "http://www.w3.org/2000/svg", width: "12", height: "12", viewBox: "0 0 12 12", fill: "none", "aria-hidden": "true", focusable: "false", ...props, children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("path", { d: "M9.77218 1.52231C9.96696 1.32753 10.2835 1.32753 10.4782 1.52231C10.6727 1.7171 10.6729 2.03368 10.4782 2.22836L6.70627 6.00034L10.4782 9.77231C10.6727 9.9671 10.6729 10.2837 10.4782 10.4784C10.2836 10.673 9.96696 10.6728 9.77218 10.4784L6.00021 6.70639L2.22824 10.4784C2.03355 10.673 1.71697 10.6728 1.52218 10.4784C1.32743 10.2836 1.32746 9.96709 1.52218 9.77231L5.29416 6.00034L1.52218 2.22836C1.32743 2.0336 1.32746 1.71709 1.52218 1.52231C1.71696 1.32753 2.03346 1.32753 2.22824 1.52231L6.00021 5.29428L9.77218 1.52231Z", fill: "currentColor" }) });
2327
+ }
2328
+ function CloseSmallIcon(props) {
2329
+ return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("svg", { xmlns: "http://www.w3.org/2000/svg", width: "8", height: "8", viewBox: "0 0 8 8", fill: "none", "aria-hidden": "true", focusable: "false", ...props, children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("path", { d: "M6.51479 1.01487C6.64464 0.885023 6.85564 0.885023 6.98549 1.01487C7.11516 1.14474 7.11528 1.35579 6.98549 1.48558L4.47084 4.00022L6.98549 6.51487C7.11516 6.64474 7.11528 6.85579 6.98549 6.98557C6.8557 7.11533 6.64464 7.11523 6.51479 6.98557L4.00014 4.47093L1.48549 6.98557C1.3557 7.11533 1.14464 7.11523 1.01479 6.98557C0.884951 6.85574 0.884972 6.64472 1.01479 6.51487L3.52944 4.00022L1.01479 1.48558C0.884951 1.35574 0.884972 1.14472 1.01479 1.01487C1.14464 0.885023 1.35564 0.885023 1.48549 1.01487L4.00014 3.52952L6.51479 1.01487Z", fill: "currentColor" }) });
2330
+ }
2331
+
2332
+ // src/components/CloseButton/CloseButton.tsx
2333
+ var import_jsx_runtime35 = require("react/jsx-runtime");
2334
+ var closeButtonSizes = { lg: 24, md: 20, sm: 16 };
2335
+ function resolveCloseButtonProps({ size = "lg", radius, variant = "subtle", ...props }) {
2336
+ return {
2337
+ p: 0,
2338
+ "aria-label": "\u5173\u95ED",
2339
+ ...props,
2340
+ size: typeof size === "string" ? closeButtonSizes[size] ?? size : size,
2341
+ radius: radius ?? (size === "md" || size === 20 ? 5 : size === "sm" || size === 16 ? 4 : 6),
2342
+ variant
2343
+ };
2344
+ }
2345
+ function resolveCloseButtonIcon({ size = "lg", icon, iconSize }) {
2346
+ if (icon !== void 0)
2347
+ return icon;
2348
+ const Glyph = size === "md" || size === 20 ? CloseMediumIcon : size === "sm" || size === 16 ? CloseSmallIcon : CloseLargeIcon;
2349
+ return iconSize === void 0 ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Glyph, {}) : /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Glyph, { width: (0, import_core23.rem)(iconSize), height: (0, import_core23.rem)(iconSize) });
2350
+ }
2351
+ function resolveCloseButtonClassNames(overrides = {}) {
2352
+ return {
2353
+ root: (0, import_clsx23.default)("sw:bg-transparent sw:text-[#262626] sw:[&[data-variant=subtle]:not(:disabled):not([data-disabled]):hover]:bg-[#f5f5f5]", overrides.root)
2354
+ };
2355
+ }
2356
+ var CloseButtonRoot = (0, import_react28.forwardRef)(({ classNames, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_core23.CloseButton, { ...resolveCloseButtonProps(props), ref, icon: resolveCloseButtonIcon(props), classNames: (theme, values, context) => resolveCloseButtonClassNames(typeof classNames === "function" ? classNames(theme, values, context) : classNames) }));
2357
+ CloseButtonRoot.displayName = "SWorks/CloseButton";
2358
+ var CloseButton2 = (0, import_core23.createPolymorphicComponent)(CloseButtonRoot);
2359
+
2360
+ // src/components/Loader/Loader.tsx
2361
+ var import_react30 = require("react");
2362
+ var import_clsx24 = __toESM(require("clsx"));
2363
+ var import_core24 = require("@s-works/s-works-ui/core");
2364
+
2365
+ // src/components/Loader/icons.tsx
2366
+ var import_react29 = require("react");
2367
+ var import_jsx_runtime36 = require("react/jsx-runtime");
2368
+ function RingIcon(props) {
2369
+ return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true", focusable: "false", ...props, children: [
2370
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("path", { d: "M14 8C14 4.68629 11.3137 2 8 2C4.68629 2 2 4.68629 2 8C2 11.3137 4.68629 14 8 14V16C3.58172 16 0 12.4183 0 8C0 3.58172 3.58172 0 8 0C12.4183 0 16 3.58172 16 8C16 12.4183 12.4183 16 8 16V14C11.3137 14 14 11.3137 14 8Z", fill: "currentColor", fillOpacity: "0.1" }),
2371
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("path", { d: "M8 0C12.4183 0 16 3.58172 16 8H14C14 4.68629 11.3137 2 8 2V0Z", fill: "currentColor" })
2372
+ ] });
2373
+ }
2374
+ function GradientIcon(props) {
2375
+ const id = (0, import_react29.useId)();
2376
+ return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true", focusable: "false", ...props, children: [
2377
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("defs", { children: [
2378
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("mask", { id: id + "-mask", children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("path", { d: "M15 8C15 11.866 11.866 15 8 15C4.13401 15 1 11.866 1 8C1 4.13401 4.13401 1 8 1C11.866 1 15 4.13401 15 8Z", strokeWidth: "2", stroke: "white" }) }),
2379
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("clipPath", { id: id + "-clip", children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("rect", { width: "16", height: "16", rx: "8" }) })
2380
+ ] }),
2381
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("g", { clipPath: `url(#${id}-clip)`, children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("g", { mask: `url(#${id}-mask)`, children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("g", { transform: "matrix(0 0.007 -0.007 0 8 8)", children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("foreignObject", { x: "-2285.71", y: "-2285.71", width: "4571.43", height: "4571.43", children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: "sw:h-full sw:w-full sw:bg-[conic-gradient(from_90deg,rgba(22,93,255,0)_0deg,rgba(22,93,255,0.5)_90deg,rgba(22,93,255,0.5)_144deg,rgba(22,93,255,0.5)_216deg,rgba(22,93,255,0)_270deg,rgba(22,93,255,0)_360deg)]" }) }) }) }) })
2382
+ ] });
2383
+ }
2384
+
2385
+ // src/components/Loader/Loader.tsx
2386
+ var import_jsx_runtime37 = require("react/jsx-runtime");
2387
+ var RingLoader = (0, import_react30.forwardRef)((props, ref) => /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("span", { ...props, ref, children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(RingIcon, { className: "sw:block sw:h-full sw:w-full sw:animate-spin sw:motion-reduce:animate-none" }) }));
2388
+ RingLoader.displayName = "SWorks/RingLoader";
2389
+ var GradientLoader = (0, import_react30.forwardRef)((props, ref) => /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("span", { ...props, ref, children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(GradientIcon, { className: "sw:block sw:h-full sw:w-full sw:animate-spin sw:motion-reduce:animate-none" }) }));
2390
+ GradientLoader.displayName = "SWorks/GradientLoader";
2391
+ var loaderTypes = {
2392
+ ...import_core24.Loader.defaultLoaders,
2393
+ ring: RingLoader,
2394
+ gradient: GradientLoader
2395
+ };
2396
+ function resolveLoaderProps({ size = 16, color = "#165dff", type = "ring", loaders, ...props } = {}) {
2397
+ return {
2398
+ role: "status",
2399
+ "aria-label": "\u6B63\u5728\u52A0\u8F7D",
2400
+ ...props,
2401
+ size,
2402
+ color,
2403
+ type,
2404
+ loaders: { ...loaderTypes, ...loaders }
2405
+ };
2406
+ }
2407
+ function resolveLoaderClassNames(overrides = {}) {
2408
+ return {
2409
+ root: (0, import_clsx24.default)("sw:relative sw:inline-flex sw:h-[var(--loader-size)] sw:w-[var(--loader-size)] sw:shrink-0 sw:items-center sw:justify-center sw:text-[var(--loader-color)]", overrides.root)
2410
+ };
2411
+ }
2412
+ var LoaderRoot = (0, import_react30.forwardRef)(({ classNames, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_core24.Loader, { ...resolveLoaderProps(props), ref, classNames: (theme, values, context) => resolveLoaderClassNames(typeof classNames === "function" ? classNames(theme, values, context) : classNames) }));
2413
+ LoaderRoot.displayName = "SWorks/Loader";
2414
+ var Loader = Object.assign(LoaderRoot, {
2415
+ defaultLoaders: loaderTypes
2416
+ });
2417
+
2418
+ // src/components/Layout/Layout.tsx
2419
+ var import_react32 = require("react");
2420
+ var import_core25 = require("@s-works/s-works-ui/core");
2421
+ var import_clsx25 = __toESM(require("clsx"));
2422
+
2423
+ // src/components/Layout/use-layout-state.ts
2424
+ var import_react31 = require("react");
2425
+ var import_hooks5 = require("@s-works/s-works-ui/hooks");
2426
+ function useLayoutState(options) {
2427
+ const [isCollapsed, setCollapsed] = (0, import_hooks5.useUncontrolled)({ value: options.collapsed, defaultValue: options.defaultCollapsed, finalValue: false, onChange: options.onCollapsedChange });
2428
+ const [expandedWidth, setExpandedWidth] = (0, import_hooks5.useUncontrolled)({ value: options.siderWidth, defaultValue: options.defaultSiderWidth, finalValue: 260, onChange: options.onSiderWidthChange });
2429
+ const clamp = (value) => Math.min(400, Math.max(220, Math.round(Number.isFinite(value) ? value : 260)));
2430
+ const width = isCollapsed ? 56 : clamp(expandedWidth);
2431
+ const drag = (0, import_react31.useRef)(null);
2432
+ const resizeHandleRef = (0, import_react31.useCallback)((node) => {
2433
+ if (!node)
2434
+ drag.current = null;
2435
+ }, []);
2436
+ const onPointerDown = (event) => {
2437
+ if (!event.isPrimary || event.button !== 0 || isCollapsed || drag.current)
2438
+ return;
2439
+ const renderedWidth = event.currentTarget.parentElement?.getBoundingClientRect().width ?? width;
2440
+ event.currentTarget.setPointerCapture(event.pointerId);
2441
+ drag.current = {
2442
+ pointerId: event.pointerId,
2443
+ startX: event.clientX,
2444
+ startWidth: width,
2445
+ unitsPerPixel: renderedWidth > 0 ? width / renderedWidth : 1
2446
+ };
2447
+ event.preventDefault();
2448
+ };
2449
+ const onPointerMove = (event) => {
2450
+ const active = drag.current;
2451
+ if (active?.pointerId !== event.pointerId || isCollapsed)
2452
+ return;
2453
+ const delta = (event.clientX - active.startX) * active.unitsPerPixel;
2454
+ setExpandedWidth(clamp(active.startWidth + delta));
2455
+ };
2456
+ const onPointerEnd = (event) => {
2457
+ if (drag.current?.pointerId !== event.pointerId)
2458
+ return;
2459
+ drag.current = null;
2460
+ if (event.currentTarget.hasPointerCapture(event.pointerId)) {
2461
+ event.currentTarget.releasePointerCapture(event.pointerId);
2462
+ }
2463
+ };
2464
+ const onKeyDown = (event) => {
2465
+ if (event.key === "Enter") {
2466
+ event.preventDefault();
2467
+ setCollapsed(!isCollapsed);
2468
+ } else if (!isCollapsed && ["ArrowLeft", "ArrowRight", "Home", "End"].includes(event.key)) {
2469
+ event.preventDefault();
2470
+ setExpandedWidth(event.key === "Home" ? 220 : event.key === "End" ? 400 : clamp(width + (event.key === "ArrowRight" ? 8 : -8)));
2471
+ }
2472
+ };
2473
+ return { width, isCollapsed, resizeHandleRef, onPointerDown, onPointerMove, onPointerEnd, onKeyDown };
2474
+ }
2475
+
2476
+ // src/components/Layout/Layout.tsx
2477
+ var import_jsx_runtime38 = require("react/jsx-runtime");
2478
+ function LayoutRoot({ children, sider, header, panel, footer, centered = false, collapsed, defaultCollapsed = false, onCollapsedChange, siderWidth, defaultSiderWidth = 260, onSiderWidthChange, resizable = false, h = 900, w = "100%", classNames, ...props }, ref) {
2479
+ const layoutState = useLayoutState({ collapsed, defaultCollapsed, onCollapsedChange, siderWidth, defaultSiderWidth, onSiderWidthChange });
2480
+ return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(import_core25.Flex, { ...props, ref, h, w, direction: "row", wrap: "nowrap", classNames: (theme, values, context) => ({ root: (0, import_clsx25.default)("sw:min-h-0 sw:min-w-0 sw:overflow-hidden sw:bg-white sw:[font-family:PingFang_SC,sans-serif] sw:text-[16px] sw:font-medium sw:leading-[24px] sw:tracking-[0px] sw:text-[#165dff]", (typeof classNames === "function" ? classNames(theme, values, context) : classNames)?.root) }), children: [
2481
+ sider !== null && /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(import_core25.Flex, { component: "aside", "aria-label": "\u4FA7\u8FB9\u533A\u57DF", w: layoutState.width, h: "100%", pos: "relative", direction: "column", classNames: { root: "sw:min-h-0 sw:shrink-0 sw:bg-[#adc6ff]" }, children: [
2482
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_core25.Flex, { px: 12, direction: "column", align: "center", classNames: { root: "sw:min-h-0 sw:flex-1 sw:overflow-auto" }, children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: "sw:my-auto sw:w-full sw:shrink-0 sw:text-center", children: sider ?? (layoutState.isCollapsed ? /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("span", { className: "sw:text-[12px] sw:leading-[18px]", children: "\u4FA7\u680F" }) : /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("span", { className: "sw:text-center", children: [
2483
+ "Sider",
2484
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("br", {}),
2485
+ "\u4FA7\u8FB9\u533A\u57DF"
2486
+ ] })) }) }),
2487
+ resizable && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { ref: layoutState.resizeHandleRef, role: "separator", "aria-label": "\u8C03\u6574\u4FA7\u680F\u5BBD\u5EA6", "aria-orientation": "vertical", "aria-valuemin": layoutState.isCollapsed ? 56 : 220, "aria-valuemax": 400, "aria-valuenow": layoutState.width, tabIndex: 0, onKeyDown: layoutState.onKeyDown, onPointerDown: layoutState.onPointerDown, onPointerMove: layoutState.onPointerMove, onPointerUp: layoutState.onPointerEnd, onPointerCancel: layoutState.onPointerEnd, onLostPointerCapture: layoutState.onPointerEnd, className: "sw:absolute sw:inset-y-0 sw:right-0 sw:w-[4px] sw:touch-none sw:cursor-col-resize sw:hover:bg-[#3975ff] sw:focus-visible:bg-[#3975ff] sw:focus-visible:outline-none" })
2488
+ ] }),
2489
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(import_core25.Flex, { direction: "column", classNames: { root: "sw:min-h-0 sw:min-w-0 sw:flex-1" }, children: [
2490
+ header !== null && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_core25.Flex, { component: "header", h: 66, px: 12, align: "center", justify: "center", classNames: { root: "sw:shrink-0 sw:bg-[#d0dfff]" }, children: header ?? "Header \u9876\u90E8\u533A\u57DF" }),
2491
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(import_core25.Flex, { classNames: { root: "sw:min-h-0 sw:min-w-0 sw:flex-1" }, children: [
2492
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_core25.Flex, { pt: 24, px: 32, pb: 32, gap: 16, direction: "column", classNames: { root: "sw:min-h-0 sw:min-w-0 sw:flex-1 sw:overflow-auto" }, children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_core25.Flex, { maw: centered ? 840 : void 0, w: "100%", mx: centered ? "auto" : void 0, px: 12, direction: "column", align: "center", justify: "center", classNames: { root: "sw:min-h-full sw:shrink-0 sw:bg-[#f3f7ff] sw:text-center" }, children: children ?? (centered ? /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("span", { children: [
2493
+ "Centered Content \u5C45\u4E2D\u5185\u5BB9\u533A\u57DF",
2494
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("br", {}),
2495
+ "\u6700\u5927\u5BBD\u5EA6 840 px"
2496
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("span", { children: [
2497
+ "Content \u5185\u5BB9\u533A\u57DF",
2498
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("br", {}),
2499
+ "\u586B\u6EE1\u5269\u4F59\u7A7A\u95F4"
2500
+ ] })) }) }),
2501
+ panel !== void 0 && panel !== null && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_core25.Flex, { component: "aside", "aria-label": "\u8F85\u52A9\u533A\u57DF", w: 300, px: 12, direction: "column", align: "center", classNames: { root: "sw:min-h-0 sw:shrink-0 sw:overflow-auto sw:bg-[#d0dfff]" }, children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: "sw:my-auto sw:w-full sw:shrink-0 sw:text-center", children: panel }) })
2502
+ ] }),
2503
+ footer !== void 0 && footer !== null && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_core25.Flex, { component: "footer", h: 48, px: 12, align: "center", justify: "center", classNames: { root: "sw:shrink-0 sw:bg-[#d0dfff]" }, children: footer })
2504
+ ] })
2505
+ ] });
2506
+ }
2507
+ var Layout = (0, import_react32.forwardRef)(LayoutRoot);
2508
+ Layout.displayName = "SWorks/Layout";
2509
+
2510
+ // src/components/ThreeColumnLayout/ThreeColumnLayout.tsx
2511
+ var import_react34 = require("react");
2512
+ var import_core26 = require("@s-works/s-works-ui/core");
2513
+ var import_lucide_react2 = require("lucide-react");
2514
+ var import_clsx26 = __toESM(require("clsx"));
2515
+
2516
+ // src/components/ThreeColumnLayout/use-resizable-panel.ts
2517
+ var import_react33 = require("react");
2518
+ var import_hooks6 = require("@s-works/s-works-ui/hooks");
2519
+ function useResizablePanel(options) {
2520
+ const [opened, setOpened] = (0, import_hooks6.useUncontrolled)({
2521
+ value: options.opened,
2522
+ defaultValue: options.defaultOpened,
2523
+ finalValue: true,
2524
+ onChange: options.onOpenedChange
2525
+ });
2526
+ const [collapsed, setCollapsed] = (0, import_hooks6.useUncontrolled)({
2527
+ value: options.collapsed,
2528
+ defaultValue: options.defaultCollapsed,
2529
+ finalValue: false,
2530
+ onChange: options.onCollapsedChange
2531
+ });
2532
+ const [expandedWidth, updateWidth, widthControlled] = (0, import_hooks6.useUncontrolled)({
2533
+ value: options.width,
2534
+ defaultValue: options.defaultWidth,
2535
+ finalValue: options.defaultWidth,
2536
+ onChange: options.onWidthChange
2537
+ });
2538
+ const storageKey = widthControlled ? void 0 : options.storageKey;
2539
+ const clamp = (value) => Math.min(options.max, Math.max(options.min, Math.round(Number.isFinite(value) ? value : options.defaultWidth)));
2540
+ (0, import_react33.useEffect)(() => {
2541
+ if (!storageKey)
2542
+ return;
2543
+ try {
2544
+ const saved = window.localStorage.getItem(storageKey);
2545
+ if (saved !== null && Number.isFinite(Number(saved)))
2546
+ updateWidth(clamp(Number(saved)));
2547
+ } catch {
2548
+ }
2549
+ }, [storageKey]);
2550
+ const setWidth = (value) => {
2551
+ const next = clamp(value);
2552
+ updateWidth(next);
2553
+ if (storageKey) {
2554
+ try {
2555
+ window.localStorage.setItem(storageKey, String(next));
2556
+ } catch {
2557
+ }
2558
+ }
2559
+ };
2560
+ const width = opened ? collapsed ? 56 : clamp(expandedWidth) : 0;
2561
+ const drag = (0, import_react33.useRef)(null);
2562
+ const resizeHandleRef = (0, import_react33.useCallback)((node) => {
2563
+ if (!node)
2564
+ drag.current = null;
2565
+ }, []);
2566
+ const onPointerDown = (event) => {
2567
+ if (!event.isPrimary || event.button !== 0 || !opened || collapsed || drag.current)
2568
+ return;
2569
+ const renderedWidth = event.currentTarget.parentElement?.getBoundingClientRect().width ?? width;
2570
+ event.currentTarget.setPointerCapture(event.pointerId);
2571
+ drag.current = {
2572
+ pointerId: event.pointerId,
2573
+ startX: event.clientX,
2574
+ width,
2575
+ unitsPerPixel: renderedWidth > 0 ? width / renderedWidth : 1
2576
+ };
2577
+ event.preventDefault();
2578
+ };
2579
+ const onPointerMove = (event) => {
2580
+ const active = drag.current;
2581
+ if (!active || active.pointerId !== event.pointerId || !opened || collapsed)
2582
+ return;
2583
+ const direction = options.side === "left" ? 1 : -1;
2584
+ setWidth(clamp(active.width + direction * (event.clientX - active.startX) * active.unitsPerPixel));
2585
+ };
2586
+ const onPointerEnd = (event) => {
2587
+ if (drag.current?.pointerId !== event.pointerId)
2588
+ return;
2589
+ drag.current = null;
2590
+ if (event.currentTarget.hasPointerCapture(event.pointerId))
2591
+ event.currentTarget.releasePointerCapture(event.pointerId);
2592
+ };
2593
+ const onKeyDown = (event) => {
2594
+ if (!opened || collapsed || !["ArrowLeft", "ArrowRight", "Home", "End"].includes(event.key))
2595
+ return;
2596
+ event.preventDefault();
2597
+ const direction = options.side === "left" ? 1 : -1;
2598
+ setWidth(event.key === "Home" ? options.min : event.key === "End" ? options.max : clamp(width + direction * (event.key === "ArrowRight" ? 8 : -8)));
2599
+ };
2600
+ const changeOpened = (value) => {
2601
+ drag.current = null;
2602
+ setOpened(value);
2603
+ };
2604
+ const changeCollapsed = (value) => {
2605
+ drag.current = null;
2606
+ setCollapsed(value);
2607
+ };
2608
+ return {
2609
+ opened,
2610
+ collapsed,
2611
+ width,
2612
+ setWidth,
2613
+ setOpened: changeOpened,
2614
+ setCollapsed: changeCollapsed,
2615
+ resizeHandleRef,
2616
+ onPointerDown,
2617
+ onPointerMove,
2618
+ onPointerEnd,
2619
+ onKeyDown
2620
+ };
2621
+ }
2622
+
2623
+ // src/components/ThreeColumnLayout/ThreeColumnLayout.tsx
2624
+ var import_jsx_runtime39 = require("react/jsx-runtime");
2625
+ function ThreeColumnLayoutRoot({ renderContent, header, menuHeader, agentHeader, appearance = "diagram", children, menu, agent, title = "Content \u5185\u5BB9\u533A", menuTitle, agentTitle = "Ask Agent", menuOpened, defaultMenuOpened = true, onMenuOpenedChange, agentOpened, defaultAgentOpened = true, onAgentOpenedChange, menuCollapsed, defaultMenuCollapsed = false, onMenuCollapsedChange, menuWidth, defaultMenuWidth = 260, onMenuWidthChange, agentWidth, defaultAgentWidth = 410, onAgentWidthChange, resizable = true, menuStorageKey, h = 900, w = "100%", bg = "white", c = appearance === "workspace" ? "#262626" : "#165dff", bdrs = 0, bd = "0", classNames, ...props }, ref) {
2626
+ const menuState = useResizablePanel({
2627
+ side: "left",
2628
+ width: menuWidth,
2629
+ defaultWidth: defaultMenuWidth,
2630
+ onWidthChange: onMenuWidthChange,
2631
+ opened: menuOpened,
2632
+ defaultOpened: defaultMenuOpened,
2633
+ onOpenedChange: onMenuOpenedChange,
2634
+ collapsed: menuCollapsed,
2635
+ defaultCollapsed: defaultMenuCollapsed,
2636
+ onCollapsedChange: onMenuCollapsedChange,
2637
+ storageKey: menuStorageKey,
2638
+ min: 220,
2639
+ max: 400
2640
+ });
2641
+ const agentState = useResizablePanel({
2642
+ side: "right",
2643
+ width: agentWidth,
2644
+ defaultWidth: defaultAgentWidth,
2645
+ onWidthChange: onAgentWidthChange,
2646
+ opened: agentOpened,
2647
+ defaultOpened: defaultAgentOpened,
2648
+ onOpenedChange: onAgentOpenedChange,
2649
+ min: 410,
2650
+ max: 710
2651
+ });
2652
+ const instanceId = (0, import_react34.useId)();
2653
+ const menuId = `${instanceId}-menu`;
2654
+ const agentId = `${instanceId}-agent`;
2655
+ const menuToggleRef = (0, import_react34.useRef)(null);
2656
+ const agentToggleRef = (0, import_react34.useRef)(null);
2657
+ const closeMenu = () => {
2658
+ menuState.setOpened(false);
2659
+ menuToggleRef.current?.focus();
2660
+ };
2661
+ const closeAgent = () => {
2662
+ agentState.setOpened(false);
2663
+ agentToggleRef.current?.focus();
2664
+ };
2665
+ const toggleAgent = () => {
2666
+ if (agentState.opened)
2667
+ closeAgent();
2668
+ else {
2669
+ agentState.setWidth(410);
2670
+ agentState.setOpened(true);
2671
+ }
2672
+ };
2673
+ const toggleCollapsed = () => {
2674
+ menuState.setCollapsed(!menuState.collapsed);
2675
+ menuToggleRef.current?.focus();
2676
+ };
2677
+ const controls = {
2678
+ menuId,
2679
+ menuOpened: menuState.opened,
2680
+ menuCollapsed: menuState.collapsed,
2681
+ agentOpened: agentState.opened,
2682
+ toggleMenu: () => menuState.setOpened(!menuState.opened),
2683
+ toggleCollapsed,
2684
+ toggleAgent,
2685
+ closeAgent,
2686
+ menuToggleRef,
2687
+ agentToggleRef
2688
+ };
2689
+ const toolClasses = {
2690
+ root: "sw:shrink-0 sw:bg-white sw:text-[#165dff] sw:hover:bg-[#f3f7ff] sw:focus-visible:outline sw:focus-visible:outline-2 sw:focus-visible:outline-offset-2 sw:focus-visible:outline-[#165dff]"
2691
+ };
2692
+ return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_core26.Flex, { ...props, ref, h, w, bg, c, bdrs, bd, direction: "column", classNames: (theme, values, context) => ({
2693
+ root: (0, import_clsx26.default)("sw:min-h-0 sw:min-w-0 sw:overflow-x-auto sw:[font-family:Noto_Sans_SC,sans-serif] sw:text-[16px] sw:font-medium sw:leading-[24px]", (typeof classNames === "function" ? classNames(theme, values, context) : classNames)?.root)
2694
+ }), children: /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(import_core26.Flex, { h: "100%", miw: menuState.width + agentState.width + 320, wrap: "nowrap", classNames: { root: "sw:min-h-0 sw:flex-1" }, children: [
2695
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(import_core26.Flex, { component: "aside", id: menuId, "aria-label": "\u5DE6\u4FA7\u83DC\u5355", "aria-hidden": !menuState.opened, display: menuState.opened ? "flex" : "none", w: menuState.width, pos: "relative", direction: "column", bg: appearance === "workspace" ? "#f9f9f9" : "#adc6ff", classNames: {
2696
+ root: (0, import_clsx26.default)("sw:min-h-0 sw:shrink-0", appearance === "workspace" && menuState.collapsed && "sw:after:pointer-events-none sw:after:absolute sw:after:inset-y-0 sw:after:right-0 sw:after:w-px sw:after:bg-[#f0f0f0] sw:after:content-['']")
2697
+ }, children: [
2698
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_core26.Flex, { h: 64, px: 12, gap: 4, align: "center", justify: "flex-end", classNames: { root: "sw:shrink-0" }, children: menuHeader ? menuHeader(controls) : /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(import_jsx_runtime39.Fragment, { children: [
2699
+ !menuState.collapsed && menuTitle !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_core26.Flex, { flex: 1, fz: 16, fw: 500, classNames: { root: "sw:min-w-0 sw:truncate" }, children: menuTitle }),
2700
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_core26.ActionIcon, { variant: "subtle", size: 32, radius: 6, "aria-label": menuState.collapsed ? "\u5C55\u5F00\u83DC\u5355" : "\u6298\u53E0\u83DC\u5355", "aria-expanded": !menuState.collapsed, "aria-controls": menuId, onClick: toggleCollapsed, classNames: toolClasses, children: menuState.collapsed ? /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_lucide_react2.ChevronRight, { size: 16, "aria-hidden": true }) : /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_lucide_react2.ChevronLeft, { size: 16, "aria-hidden": true }) }),
2701
+ !menuState.collapsed && menu !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_core26.ActionIcon, { variant: "subtle", size: 32, radius: 6, "aria-label": "\u5173\u95ED\u83DC\u5355", onClick: closeMenu, classNames: toolClasses, children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_lucide_react2.X, { size: 16, "aria-hidden": true }) })
2702
+ ] }) }),
2703
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_core26.Flex, { direction: "column", px: appearance === "workspace" ? 0 : 12, pb: appearance === "workspace" ? 0 : 64, classNames: { root: "sw:min-h-0 sw:flex-1 sw:overflow-auto" }, children: typeof menu === "function" ? menu(menuState.collapsed) : menu ?? /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { className: "sw:my-auto sw:text-center", children: menuState.collapsed ? /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("span", { className: "sw:text-[12px] sw:leading-[18px]", children: "Tab" }) : /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(import_jsx_runtime39.Fragment, { children: [
2704
+ "Tabbar",
2705
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("br", {}),
2706
+ "\u5DE6\u4FA7\u5BFC\u822A"
2707
+ ] }) }) }),
2708
+ resizable && !menuState.collapsed && menuState.opened && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { ref: menuState.resizeHandleRef, role: "separator", "aria-label": "\u8C03\u6574\u83DC\u5355\u5BBD\u5EA6", "aria-controls": menuId, "aria-orientation": "vertical", "aria-valuemin": 220, "aria-valuemax": 400, "aria-valuenow": menuState.width, tabIndex: 0, onPointerDown: menuState.onPointerDown, onPointerMove: menuState.onPointerMove, onPointerUp: menuState.onPointerEnd, onPointerCancel: menuState.onPointerEnd, onLostPointerCapture: menuState.onPointerEnd, onKeyDown: (event) => {
2709
+ if (event.key === "Enter") {
2710
+ event.preventDefault();
2711
+ toggleCollapsed();
2712
+ } else
2713
+ menuState.onKeyDown(event);
2714
+ }, className: "sw:absolute sw:inset-y-0 sw:right-[-2px] sw:z-10 sw:w-[4px] sw:touch-none sw:cursor-col-resize sw:bg-transparent sw:before:absolute sw:before:inset-y-0 sw:before:left-1/2 sw:before:w-px sw:before:bg-[#e5e5e5] sw:hover:bg-[#adc6ff] sw:focus-visible:bg-[#adc6ff] sw:focus-visible:outline-none" })
2715
+ ] }),
2716
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(import_core26.Flex, { direction: "column", flex: 1, miw: 320, classNames: { root: "sw:min-h-0 sw:min-w-0" }, children: [
2717
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_core26.Flex, { component: "header", h: 66, px: 32, gap: 16, bg: appearance === "workspace" ? "white" : "#d0dfff", align: "center", classNames: {
2718
+ root: (0, import_clsx26.default)("sw:shrink-0", appearance === "workspace" && "sw:border-0 sw:border-b sw:border-solid sw:border-[#f0f0f0]")
2719
+ }, children: header ? header(controls) : /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(import_jsx_runtime39.Fragment, { children: [
2720
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_core26.ActionIcon, { ref: menuToggleRef, size: 32, radius: 6, variant: "subtle", "aria-label": menuState.opened ? "\u9690\u85CF\u83DC\u5355" : "\u663E\u793A\u83DC\u5355", "aria-expanded": menuState.opened, "aria-controls": menuId, onClick: () => menuState.setOpened(!menuState.opened), classNames: toolClasses, children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_lucide_react2.PanelLeft, { size: 18, "aria-hidden": true }) }),
2721
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_core26.Flex, { flex: 1, fz: 16, fw: 500, classNames: { root: "sw:min-w-0 sw:truncate" }, children: title }),
2722
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_core26.Button, { ref: agentToggleRef, size: "compact-sm", h: 32, w: 128, px: 12, radius: 8, bg: "white", variant: "light", color: "#165dff", "aria-expanded": agentState.opened, "aria-controls": agentId, onClick: toggleAgent, classNames: {
2723
+ root: "sw:shrink-0 sw:focus-visible:outline sw:focus-visible:outline-2 sw:focus-visible:outline-offset-2 sw:focus-visible:outline-[#165dff]",
2724
+ label: "sw:text-[14px] sw:font-medium sw:leading-[21px]"
2725
+ }, children: agentTitle })
2726
+ ] }) }),
2727
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_core26.Flex, { direction: "column", pt: 24, px: 32, pb: 32, gap: 16, classNames: { root: "sw:min-h-0 sw:flex-1 sw:overflow-auto" }, children: renderContent ? renderContent(controls) : children ?? /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(import_core26.Flex, { direction: "column", align: "center", justify: "center", gap: 8, bdrs: 12, bg: "#f3f7ff", classNames: { root: "sw:min-h-full sw:shrink-0 sw:text-center" }, children: [
2728
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("span", { className: "sw:text-[24px] sw:leading-[36px]", children: "Content \u5185\u5BB9\u533A\u57DF" }),
2729
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("span", { className: "sw:text-[14px] sw:font-normal sw:leading-[21px]", children: "Fill \xB7 \u586B\u6EE1\u4E24\u4FA7\u533A\u57DF\u4EE5\u5916\u7684\u5269\u4F59\u7A7A\u95F4" })
2730
+ ] }) })
2731
+ ] }),
2732
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(import_core26.Flex, { component: "aside", id: agentId, "aria-label": agentTitle, "aria-hidden": !agentState.opened, display: agentState.opened ? "flex" : "none", w: agentState.width, pos: "relative", direction: "column", classNames: {
2733
+ root: (0, import_clsx26.default)("sw:min-h-0 sw:shrink-0", appearance === "workspace" ? "sw:bg-white" : "sw:bg-[#f3f7ff]")
2734
+ }, children: [
2735
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_core26.Flex, { h: 64, px: 16, gap: 12, bg: appearance === "workspace" ? "white" : "#d0dfff", align: "center", classNames: {
2736
+ root: "sw:shrink-0"
2737
+ }, children: agentHeader ? agentHeader(controls) : /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(import_jsx_runtime39.Fragment, { children: [
2738
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_core26.Flex, { flex: 1, fz: 16, fw: 500, classNames: { root: "sw:min-w-0 sw:truncate" }, children: agentTitle }),
2739
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_core26.ActionIcon, { size: 32, radius: 6, variant: "subtle", "aria-label": `\u5173\u95ED ${agentTitle}`, onClick: closeAgent, classNames: toolClasses, children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_lucide_react2.X, { size: 16, "aria-hidden": true }) })
2740
+ ] }) }),
2741
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_core26.Flex, { direction: "column", p: appearance === "workspace" ? 0 : 16, gap: 16, classNames: { root: "sw:min-h-0 sw:flex-1 sw:overflow-auto" }, children: agent ?? /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: "sw:my-auto sw:text-center", children: [
2742
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { children: "Agent \u5185\u5BB9\u533A\u57DF" }),
2743
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { className: "sw:text-[14px] sw:font-normal sw:leading-[21px]", children: "\u968F\u9762\u677F\u5BBD\u5EA6\u9002\u914D" })
2744
+ ] }) }),
2745
+ resizable && agentState.opened && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { ref: agentState.resizeHandleRef, role: "separator", "aria-label": "\u8C03\u6574 AskAgent \u5BBD\u5EA6", "aria-controls": agentId, "aria-orientation": "vertical", "aria-valuemin": 410, "aria-valuemax": 710, "aria-valuenow": agentState.width, tabIndex: 0, onPointerDown: agentState.onPointerDown, onPointerMove: agentState.onPointerMove, onPointerUp: agentState.onPointerEnd, onPointerCancel: agentState.onPointerEnd, onLostPointerCapture: agentState.onPointerEnd, onKeyDown: (event) => {
2746
+ if (event.key === "Enter") {
2747
+ event.preventDefault();
2748
+ closeAgent();
2749
+ } else
2750
+ agentState.onKeyDown(event);
2751
+ }, className: "sw:absolute sw:inset-y-0 sw:left-[-2px] sw:z-10 sw:w-[4px] sw:touch-none sw:cursor-col-resize sw:bg-transparent sw:before:absolute sw:before:inset-y-0 sw:before:left-1/2 sw:before:w-px sw:before:bg-[#e5e5e5] sw:hover:bg-[#adc6ff] sw:focus-visible:bg-[#adc6ff] sw:focus-visible:outline-none" })
2752
+ ] })
2753
+ ] }) });
2754
+ }
2755
+ var ThreeColumnLayout = (0, import_react34.forwardRef)(ThreeColumnLayoutRoot);
2756
+ ThreeColumnLayout.displayName = "SWorks/ThreeColumnLayout";
2757
+
2758
+ // src/components/Space/Space.tsx
2759
+ var import_core27 = require("@s-works/s-works-ui/core");
2760
+
2761
+ // src/components/Skeleton/Skeleton.tsx
2762
+ var import_react35 = require("react");
2763
+ var import_clsx27 = __toESM(require("clsx"));
2764
+ var import_core28 = require("@s-works/s-works-ui/core");
2765
+ var import_jsx_runtime40 = require("react/jsx-runtime");
2766
+ function resolveSkeletonClassNames(overrides = {}) {
2767
+ return {
2768
+ root: (0, import_clsx27.default)("sw:data-[visible]:after:bg-[rgba(46,50,56,0.05)] sw:motion-reduce:after:animate-none", overrides.root)
2769
+ };
2770
+ }
2771
+ var SkeletonRoot = (0, import_react35.forwardRef)(({ animate = false, radius = 4, classNames, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_core28.Skeleton, { ...props, ref, animate, radius, classNames: (theme, values, context) => resolveSkeletonClassNames(typeof classNames === "function" ? classNames(theme, values, context) : classNames) }));
2772
+ SkeletonRoot.displayName = "SWorks/Skeleton";
2773
+ var Skeleton = SkeletonRoot;