@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
@@ -38,19 +38,19 @@ function resolveButtonProps(props = {}) {
38
38
  const definedProps = Object.fromEntries(Object.entries(props).filter(([, value]) => value !== void 0));
39
39
  const standardColor = color === void 0 || color === "blue" || color === "blue.8";
40
40
  const standardVariant = ["filled", "outline", "light", "subtle"].includes(variant);
41
- const palette = standardColor && standardVariant;
41
+ const palette2 = standardColor && standardVariant;
42
42
  return {
43
43
  ff: "PingFang SC, sans-serif",
44
44
  fw: 400,
45
45
  radius: buttonRadiusProps[size] ?? 6,
46
46
  ...buttonSizeProps[size],
47
- ...palette ? { bd: 0 } : {},
48
- ...palette && variant === "filled" ? { c: "#ffffff" } : {},
49
- ...palette && (variant === "outline" || variant === "subtle") ? { bg: "#ffffff" } : {},
47
+ ...palette2 ? { bd: 0 } : {},
48
+ ...palette2 && variant === "filled" ? { c: "#ffffff" } : {},
49
+ ...palette2 && (variant === "outline" || variant === "subtle") ? { bg: "#ffffff" } : {},
50
50
  ...definedProps,
51
51
  size,
52
52
  variant,
53
- color: palette ? variant === "light" || color === void 0 ? "#262626" : "#165dff" : color
53
+ color: palette2 ? variant === "light" || color === void 0 ? "#262626" : "#165dff" : color
54
54
  };
55
55
  }
56
56
  var buttonClassNames = {
@@ -109,6 +109,2633 @@ var ButtonRoot = forwardRef(({ classNames, ...props }, ref) => /* @__PURE__ */ j
109
109
  } }));
110
110
  ButtonRoot.displayName = "SWorks/Button";
111
111
  var Button = createPolymorphicComponent(ButtonRoot);
112
+
113
+ // src/components/Breadcrumbs/Breadcrumbs.tsx
114
+ import { forwardRef as forwardRef2 } from "react";
115
+ import cx2 from "clsx";
116
+ import { Breadcrumbs as MantineBreadcrumbs } from "@s-works/s-works-ui/core";
117
+
118
+ // src/components/Breadcrumbs/useBreadcrumbItems.tsx
119
+ import { useEffect, useRef, useState } from "react";
120
+ import { jsx as jsx2 } from "react/jsx-runtime";
121
+ function useBreadcrumbItems(items, collapse = true, resetKey) {
122
+ const [expanded, setExpanded] = useState(false);
123
+ const [previousKey, setPreviousKey] = useState(resetKey);
124
+ if (previousKey !== resetKey) {
125
+ setPreviousKey(resetKey);
126
+ setExpanded(false);
127
+ }
128
+ const firstHidden = useRef(null);
129
+ useEffect(() => {
130
+ if (expanded)
131
+ firstHidden.current?.focus();
132
+ }, [expanded]);
133
+ const indexes = collapse && !expanded && items.length > 4 ? [0, 1, "ellipsis", items.length - 2, items.length - 1] : items.map((_, index) => index);
134
+ return indexes.map((index) => {
135
+ if (index === "ellipsis") {
136
+ return /* @__PURE__ */ jsx2("button", { type: "button", "aria-label": "\u5C55\u5F00\u9690\u85CF\u8DEF\u5F84", "aria-expanded": false, onClick: () => setExpanded(true), children: "..." }, "ellipsis");
137
+ }
138
+ const item = items[index];
139
+ if (index === items.length - 1) {
140
+ return /* @__PURE__ */ jsx2("span", { "aria-current": "page", children: item.label }, index);
141
+ }
142
+ return item.href ? /* @__PURE__ */ jsx2("a", { ref: (node) => {
143
+ if (index === 2)
144
+ firstHidden.current = node;
145
+ }, href: item.href, onClick: item.onClick, children: item.label }, index) : item.onClick ? /* @__PURE__ */ jsx2("button", { type: "button", ref: (node) => {
146
+ if (index === 2)
147
+ firstHidden.current = node;
148
+ }, onClick: item.onClick, children: item.label }, index) : /* @__PURE__ */ jsx2("span", { tabIndex: index === 2 ? -1 : void 0, ref: (node) => {
149
+ if (index === 2)
150
+ firstHidden.current = node;
151
+ }, children: item.label }, index);
152
+ });
153
+ }
154
+
155
+ // src/components/Breadcrumbs/Breadcrumbs.tsx
156
+ import { jsx as jsx3 } from "react/jsx-runtime";
157
+ var breadcrumbsClassNames = {
158
+ 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]",
159
+ 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]",
160
+ 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]"
161
+ };
162
+ function resolveBreadcrumbsClassNames(overrides = {}) {
163
+ return {
164
+ root: cx2(breadcrumbsClassNames.root, overrides.root),
165
+ breadcrumb: cx2(breadcrumbsClassNames.breadcrumb, overrides.breadcrumb),
166
+ separator: cx2(breadcrumbsClassNames.separator, overrides.separator)
167
+ };
168
+ }
169
+ var Breadcrumbs = forwardRef2(({ items, collapse = true, classNames, separator = "/", ...props }, ref) => {
170
+ const children = useBreadcrumbItems(items, collapse);
171
+ if (!items.length)
172
+ return null;
173
+ return /* @__PURE__ */ jsx3(MantineBreadcrumbs, { ...props, ref, role: props.role ?? "navigation", "aria-label": props["aria-label"] ?? "\u9762\u5305\u5C51", separator, attributes: {
174
+ ...props.attributes,
175
+ separator: { ...props.attributes?.separator, "aria-hidden": true }
176
+ }, classNames: (theme, values, ctx) => resolveBreadcrumbsClassNames(typeof classNames === "function" ? classNames(theme, values, ctx) : classNames), children });
177
+ });
178
+ Breadcrumbs.displayName = "SWorks/Breadcrumbs";
179
+
180
+ // src/components/Title/Title.tsx
181
+ import { forwardRef as forwardRef3 } from "react";
182
+ import cx3 from "clsx";
183
+ import { Title as MantineTitle } from "@s-works/s-works-ui/core";
184
+ import { jsx as jsx4 } from "react/jsx-runtime";
185
+ var titleBaseClassNames = {
186
+ root: "sw:m-0 sw:[font-family:PingFang_SC,sans-serif] sw:text-[#262626] sw:tracking-[0px] sw:not-italic"
187
+ };
188
+ var titlePresetClassNames = {
189
+ "h1-medium": "sw:text-[38px] sw:leading-[46px] sw:font-medium",
190
+ "h2-medium": "sw:text-[30px] sw:leading-[40px] sw:font-medium",
191
+ "h3-medium": "sw:text-[24px] sw:leading-[32px] sw:font-medium",
192
+ "h3-regular": "sw:text-[24px] sw:leading-[32px] sw:font-normal",
193
+ "h4-medium": "sw:text-[20px] sw:leading-[28px] sw:font-medium",
194
+ "h5-regular": "sw:text-[16px] sw:leading-[24px] sw:font-normal",
195
+ "h5-medium": "sw:text-[16px] sw:leading-[24px] sw:font-medium",
196
+ "h5-semibold": "sw:text-[16px] sw:leading-[24px] sw:font-semibold"
197
+ };
198
+ var presetOrders = {
199
+ "h1-medium": 1,
200
+ "h2-medium": 2,
201
+ "h3-medium": 3,
202
+ "h3-regular": 3,
203
+ "h4-medium": 4,
204
+ "h5-regular": 5,
205
+ "h5-medium": 5,
206
+ "h5-semibold": 5
207
+ };
208
+ var Title = forwardRef3(({ preset = "h1-medium", order, classNames, ...props }, ref) => /* @__PURE__ */ jsx4(MantineTitle, { ...props, ref, order: order ?? presetOrders[preset], classNames: (theme, values, ctx) => {
209
+ const overrides = typeof classNames === "function" ? classNames(theme, values, ctx) : classNames;
210
+ return { root: cx3(titleBaseClassNames.root, titlePresetClassNames[preset], overrides?.root) };
211
+ } }));
212
+ Title.displayName = "SWork/Title";
213
+
214
+ // src/components/Tooltip/Tooltip.tsx
215
+ import { forwardRef as forwardRef4 } from "react";
216
+ import cx4 from "clsx";
217
+ import { Tooltip as MantineTooltip } from "@s-works/s-works-ui/core";
218
+ import { jsx as jsx5 } from "react/jsx-runtime";
219
+ var tooltipClassNames = {
220
+ tooltip: "sw:shadow-none"
221
+ };
222
+ function resolveTooltipProps({ radius = 8, color = "rgba(0,0,0,0.9)", events = { hover: true, focus: true, touch: false }, ...props }) {
223
+ return {
224
+ p: 8,
225
+ ff: "PingFang SC, sans-serif",
226
+ fz: 12,
227
+ fw: 400,
228
+ lh: 1.5,
229
+ lts: 0,
230
+ fs: "normal",
231
+ bd: 0,
232
+ ...props,
233
+ radius,
234
+ color,
235
+ events
236
+ };
237
+ }
238
+ function resolveTooltipClassNames(overrides = {}) {
239
+ return {
240
+ tooltip: cx4(tooltipClassNames.tooltip, overrides.tooltip),
241
+ arrow: overrides.arrow
242
+ };
243
+ }
244
+ var TooltipRoot = forwardRef4(({ classNames, ...props }, ref) => /* @__PURE__ */ jsx5(MantineTooltip, { ...resolveTooltipProps(props), ref, classNames: (theme, values, ctx) => resolveTooltipClassNames(typeof classNames === "function" ? classNames(theme, values, ctx) : classNames) }));
245
+ TooltipRoot.displayName = "SWorks/Tooltip";
246
+ var Tooltip = Object.assign(TooltipRoot, {
247
+ Group: MantineTooltip.Group,
248
+ Floating: MantineTooltip.Floating
249
+ });
250
+
251
+ // src/components/AppShell/AppShell.tsx
252
+ import { forwardRef as forwardRef6 } from "react";
253
+ import cx6 from "clsx";
254
+ import { AppShell as MantineAppShell, rem } from "@s-works/s-works-ui/core";
255
+
256
+ // src/components/AppShell/AppShellTaskItem.tsx
257
+ import { forwardRef as forwardRef5, useCallback, useEffect as useEffect2, useRef as useRef2, useState as useState2 } from "react";
258
+ import cx5 from "clsx";
259
+ import { UnstyledButton } from "@s-works/s-works-ui/core";
260
+ import { jsx as jsx6, jsxs } from "react/jsx-runtime";
261
+ var appShellTaskItemClassNames = {
262
+ 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]",
263
+ normal: "sw:bg-transparent sw:pl-[4px] sw:pr-[16px]",
264
+ normalControl: "sw:font-normal sw:text-[#262626]",
265
+ highlighted: "sw:bg-[rgba(22,93,255,0.05)] sw:px-[8px]",
266
+ 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",
267
+ icon: "sw:flex sw:h-[32px] sw:w-[32px] sw:shrink-0 sw:items-center sw:justify-center sw:overflow-hidden",
268
+ label: "sw:block sw:min-w-0 sw:flex-1 sw:overflow-hidden sw:text-ellipsis sw:whitespace-nowrap sw:data-[marquee]:text-clip",
269
+ 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"
270
+ };
271
+ var AppShellTaskItem = forwardRef5(({ label, icon, deleteIcon, highlighted = false, onRemove, disabled = false, classNames, ...props }, ref) => {
272
+ const textRef = useRef2(null);
273
+ const frame = useRef2(null);
274
+ const hovered = useRef2(false);
275
+ const focused = useRef2(false);
276
+ const [marquee, setMarquee] = useState2(false);
277
+ const stop = useCallback(() => {
278
+ if (frame.current !== null)
279
+ cancelAnimationFrame(frame.current);
280
+ frame.current = null;
281
+ if (textRef.current)
282
+ textRef.current.scrollLeft = 0;
283
+ setMarquee(false);
284
+ }, []);
285
+ const start = useCallback(() => {
286
+ stop();
287
+ const text = textRef.current;
288
+ if (!text || disabled || !(hovered.current || focused.current))
289
+ return;
290
+ const reducedMotion = window.matchMedia("(prefers-reduced-motion: reduce)");
291
+ if (reducedMotion.matches || text.scrollWidth <= text.clientWidth)
292
+ return;
293
+ setMarquee(true);
294
+ let position = 0;
295
+ let direction = 1;
296
+ let previous = performance.now();
297
+ let pauseUntil = previous + 500;
298
+ const tick = (now) => {
299
+ if (reducedMotion.matches || !(hovered.current || focused.current)) {
300
+ stop();
301
+ return;
302
+ }
303
+ const delta = Math.min(50, now - previous);
304
+ previous = now;
305
+ const maximum = text.scrollWidth - text.clientWidth;
306
+ if (now >= pauseUntil) {
307
+ position = Math.max(0, Math.min(maximum, position + direction * delta * 0.032));
308
+ text.scrollLeft = position;
309
+ if (position === maximum) {
310
+ direction = -1;
311
+ pauseUntil = now + 800;
312
+ } else if (position === 0) {
313
+ direction = 1;
314
+ pauseUntil = now + 500;
315
+ }
316
+ }
317
+ frame.current = requestAnimationFrame(tick);
318
+ };
319
+ frame.current = requestAnimationFrame(tick);
320
+ }, [disabled, stop]);
321
+ useEffect2(() => {
322
+ const text = textRef.current;
323
+ const observer = typeof ResizeObserver === "undefined" ? void 0 : new ResizeObserver(() => {
324
+ if (hovered.current || focused.current)
325
+ start();
326
+ });
327
+ if (text)
328
+ observer?.observe(text);
329
+ if (hovered.current || focused.current)
330
+ start();
331
+ return () => {
332
+ observer?.disconnect();
333
+ if (frame.current !== null)
334
+ cancelAnimationFrame(frame.current);
335
+ frame.current = null;
336
+ if (text)
337
+ text.scrollLeft = 0;
338
+ };
339
+ }, [label, highlighted, start]);
340
+ const overrides = typeof classNames === "function" ? classNames({ highlighted, disabled }) : classNames;
341
+ return /* @__PURE__ */ jsxs("div", { "data-highlighted": highlighted || void 0, className: cx5(appShellTaskItemClassNames.root, highlighted ? appShellTaskItemClassNames.highlighted : appShellTaskItemClassNames.normal, disabled && "sw:opacity-50", overrides?.root), onMouseEnter: () => {
342
+ hovered.current = true;
343
+ start();
344
+ }, onMouseLeave: () => {
345
+ hovered.current = false;
346
+ if (!focused.current)
347
+ stop();
348
+ }, onFocusCapture: (event) => {
349
+ focused.current = event.target instanceof HTMLElement && event.target.matches(":focus-visible");
350
+ start();
351
+ }, onBlurCapture: (event) => {
352
+ if (event.currentTarget.contains(event.relatedTarget))
353
+ return;
354
+ focused.current = false;
355
+ if (!hovered.current)
356
+ stop();
357
+ }, children: [
358
+ /* @__PURE__ */ jsxs(UnstyledButton, { ...props, ref, type: props.type ?? "button", disabled, "aria-label": props["aria-label"] ?? label, classNames: {
359
+ root: cx5(appShellTaskItemClassNames.control, appShellTaskItemClassNames.normalControl, overrides?.control)
360
+ }, children: [
361
+ icon && /* @__PURE__ */ jsx6("span", { "aria-hidden": "true", className: cx5(appShellTaskItemClassNames.icon, overrides?.icon), children: icon }),
362
+ /* @__PURE__ */ jsx6("span", { ref: textRef, "data-marquee": marquee || void 0, className: cx5(appShellTaskItemClassNames.label, overrides?.label), children: label })
363
+ ] }),
364
+ onRemove && /* @__PURE__ */ jsx6(UnstyledButton, { type: "button", disabled, "aria-label": `\u5220\u9664 ${label}`, onClick: (event) => {
365
+ event.stopPropagation();
366
+ onRemove(event);
367
+ }, classNames: {
368
+ root: cx5(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)
369
+ }, children: deleteIcon ?? "\u5220\u9664" })
370
+ ] });
371
+ });
372
+ AppShellTaskItem.displayName = "SWorks/AppShell.TaskItem";
373
+
374
+ // src/components/AppShell/useAppShellSidebar.ts
375
+ import { useEffect as useEffect3, useRef as useRef3, useState as useState3 } from "react";
376
+ var normalize = (width) => !Number.isFinite(width) ? 260 : width <= 56 ? 56 : Math.min(400, Math.max(220, Math.round(width)));
377
+ function useAppShellSidebar({ sidebarWidth, defaultSidebarWidth = 260, storageKey = "s-work-app-shell-sidebar", onSidebarWidthChange, onSidebarWidthCommit } = {}) {
378
+ const [internalWidth, setInternalWidth] = useState3(() => normalize(defaultSidebarWidth));
379
+ const [draft, setDraft] = useState3();
380
+ const expandedWidth = useRef3(normalize(defaultSidebarWidth) === 56 ? 260 : normalize(defaultSidebarWidth));
381
+ const drag = useRef3(null);
382
+ const width = draft ?? normalize(sidebarWidth ?? internalWidth);
383
+ const collapsed = width === 56;
384
+ useEffect3(() => {
385
+ if (sidebarWidth !== void 0 || !storageKey)
386
+ return;
387
+ try {
388
+ const saved = JSON.parse(localStorage.getItem(storageKey) ?? "null");
389
+ if (saved && typeof saved.width === "number" && Number.isFinite(saved.width)) {
390
+ setInternalWidth(normalize(saved.width));
391
+ onSidebarWidthChange?.(normalize(saved.width));
392
+ expandedWidth.current = typeof saved.expandedWidth === "number" && saved.expandedWidth >= 220 && saved.expandedWidth <= 400 ? Math.round(saved.expandedWidth) : 260;
393
+ }
394
+ } catch {
395
+ }
396
+ }, [storageKey, sidebarWidth !== void 0]);
397
+ const commit = (value) => {
398
+ const next = normalize(value);
399
+ if (next > 56)
400
+ expandedWidth.current = next;
401
+ if (sidebarWidth === void 0)
402
+ setInternalWidth(next);
403
+ onSidebarWidthChange?.(next);
404
+ onSidebarWidthCommit?.(next);
405
+ if (storageKey) {
406
+ try {
407
+ localStorage.setItem(storageKey, JSON.stringify({
408
+ width: next,
409
+ expandedWidth: expandedWidth.current
410
+ }));
411
+ } catch {
412
+ }
413
+ }
414
+ };
415
+ const state = {
416
+ width,
417
+ collapsed,
418
+ setWidth: commit,
419
+ toggleCollapsed: () => {
420
+ if (!collapsed)
421
+ expandedWidth.current = normalize(width);
422
+ commit(collapsed ? expandedWidth.current : 56);
423
+ }
424
+ };
425
+ const finish = (cancelled = false) => {
426
+ const current = drag.current;
427
+ if (!current)
428
+ return;
429
+ drag.current = null;
430
+ setDraft(void 0);
431
+ if (cancelled) {
432
+ if (sidebarWidth === void 0)
433
+ setInternalWidth(current.startWidth);
434
+ onSidebarWidthChange?.(current.startWidth);
435
+ } else {
436
+ if (current.lastWidth <= 56 && current.startWidth > 56)
437
+ expandedWidth.current = normalize(current.startWidth);
438
+ commit(current.lastWidth);
439
+ }
440
+ };
441
+ const separatorProps = {
442
+ role: "separator",
443
+ "aria-label": "\u8C03\u6574\u4FA7\u680F\u5BBD\u5EA6",
444
+ "aria-orientation": "vertical",
445
+ "aria-valuemin": 56,
446
+ "aria-valuemax": Math.max(400, width),
447
+ "aria-valuenow": width,
448
+ "aria-valuetext": collapsed ? "\u5DF2\u6298\u53E0\uFF0C56\u50CF\u7D20" : `${width}\u50CF\u7D20`,
449
+ tabIndex: 0,
450
+ onPointerDown: (event) => {
451
+ if (!event.isPrimary || event.button !== 0)
452
+ return;
453
+ event.preventDefault();
454
+ const renderedWidth = event.currentTarget.parentElement?.getBoundingClientRect().width ?? width;
455
+ drag.current = {
456
+ id: event.pointerId,
457
+ startX: event.clientX,
458
+ startWidth: width,
459
+ lastWidth: width,
460
+ unitsPerPixel: renderedWidth > 0 ? width / renderedWidth : 1
461
+ };
462
+ event.currentTarget.setPointerCapture(event.pointerId);
463
+ setDraft(width);
464
+ },
465
+ onPointerMove: (event) => {
466
+ const current = drag.current;
467
+ if (!current || current.id !== event.pointerId)
468
+ return;
469
+ const next = Math.max(56, Math.round(current.startWidth + (event.clientX - current.startX) * current.unitsPerPixel));
470
+ current.lastWidth = next;
471
+ setDraft(next);
472
+ onSidebarWidthChange?.(next);
473
+ },
474
+ onPointerUp: () => finish(),
475
+ onPointerCancel: () => finish(true),
476
+ onLostPointerCapture: () => finish(true),
477
+ onKeyDown: (event) => {
478
+ if (!["ArrowLeft", "ArrowRight", "Home", "End", "Enter", "Escape"].includes(event.key))
479
+ return;
480
+ event.preventDefault();
481
+ if (event.key === "Escape") {
482
+ finish(true);
483
+ return;
484
+ }
485
+ if (event.key === "Enter")
486
+ state.toggleCollapsed();
487
+ else if (event.key === "Home")
488
+ commit(220);
489
+ else if (event.key === "End")
490
+ commit(400);
491
+ else
492
+ commit(width + (event.key === "ArrowLeft" ? -10 : 10));
493
+ }
494
+ };
495
+ return { state, resizing: draft !== void 0, separatorProps };
496
+ }
497
+
498
+ // src/components/AppShell/AppShell.tsx
499
+ import { jsx as jsx7, jsxs as jsxs2 } from "react/jsx-runtime";
500
+ var appShellClassNames = {
501
+ 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]",
502
+ navbar: "sw:border-0 sw:bg-[#f9f9f9] sw:min-h-0 sw:overflow-hidden",
503
+ main: "sw:min-w-0 sw:bg-white"
504
+ };
505
+ 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";
506
+ function resolveAppShellClassNames({ mode = "fixed", resizing = false, withBorder = true } = {}, overrides = {}) {
507
+ return {
508
+ ...overrides,
509
+ root: cx6(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),
510
+ navbar: cx6(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),
511
+ main: cx6(appShellClassNames.main, mode === "static" && "sw:min-h-0 sw:flex-1 sw:p-[var(--app-shell-padding)]", overrides.main)
512
+ };
513
+ }
514
+ var AppShellRoot = forwardRef6(({ sidebar, children, sidebarWidth, defaultSidebarWidth, storageKey, onSidebarWidthChange, onSidebarWidthCommit, classNames, mode = "fixed", transitionDuration = 200, ...props }, ref) => {
515
+ const { state, resizing, separatorProps } = useAppShellSidebar({
516
+ sidebarWidth,
517
+ defaultSidebarWidth,
518
+ storageKey,
519
+ onSidebarWidthChange,
520
+ onSidebarWidthCommit
521
+ });
522
+ return /* @__PURE__ */ jsxs2(MantineAppShell, { ...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: [
523
+ /* @__PURE__ */ jsxs2(MantineAppShell.Navbar, { w: state.width, "aria-label": "\u5E94\u7528\u4FA7\u680F", "data-sidebar-width": state.width, "data-collapsed": state.collapsed || void 0, children: [
524
+ typeof sidebar === "function" ? sidebar(state) : sidebar,
525
+ /* @__PURE__ */ jsx7("div", { ...separatorProps, className: appShellHandleClassName })
526
+ ] }),
527
+ /* @__PURE__ */ jsx7(MantineAppShell.Main, { ps: mode === "fixed" && !props.disabled ? `calc(${rem(state.width)} + var(--app-shell-padding))` : void 0, children })
528
+ ] });
529
+ });
530
+ AppShellRoot.displayName = "SWorks/AppShell";
531
+ var AppShell = Object.assign(AppShellRoot, {
532
+ TaskItem: AppShellTaskItem
533
+ });
534
+
535
+ // src/components/Table/Table.tsx
536
+ import { forwardRef as forwardRef7 } from "react";
537
+ import cx7 from "clsx";
538
+ import { Table as MantineTable } from "@s-works/s-works-ui/core";
539
+ import { jsx as jsx8 } from "react/jsx-runtime";
540
+ var tableClassNames = {
541
+ table: "sw:[font-family:PingFang_SC,sans-serif] sw:tracking-[0px] sw:not-italic sw:border-separate sw:border-spacing-0 sw:text-[#262626]",
542
+ th: "sw:text-left sw:font-medium",
543
+ td: "sw:font-normal"
544
+ };
545
+ var tableAppearanceClassNames = {
546
+ primary: {
547
+ 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]",
548
+ 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",
549
+ 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",
550
+ tr: "sw:[&:nth-child(odd)>td]:bg-white sw:[&:nth-child(even)>td]:bg-[#f2f3f5]"
551
+ },
552
+ meeting: {
553
+ table: "sw:table-fixed",
554
+ 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]",
555
+ 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]",
556
+ 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]"
557
+ },
558
+ drawer: {
559
+ table: "sw:table-fixed sw:overflow-hidden sw:rounded-[8px] sw:border sw:border-solid sw:border-[#f0f0f0]",
560
+ 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]",
561
+ 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]",
562
+ tr: "sw:last:[&>td]:border-b-0"
563
+ }
564
+ };
565
+ function resolveTableClassNames(appearance, overrides = {}) {
566
+ const visual = tableAppearanceClassNames[appearance];
567
+ return {
568
+ table: cx7(tableClassNames.table, visual.table, overrides.table),
569
+ th: cx7(tableClassNames.th, visual.th, overrides.th),
570
+ td: cx7(tableClassNames.td, visual.td, overrides.td),
571
+ tr: cx7(visual.tr, overrides.tr)
572
+ };
573
+ }
574
+ var TableRoot = forwardRef7(({ appearance = "meeting", classNames, ...props }, ref) => /* @__PURE__ */ jsx8(MantineTable, { ...props, ref, classNames: (theme, values, ctx) => {
575
+ const overrides = typeof classNames === "function" ? classNames(theme, values, ctx) : classNames;
576
+ return {
577
+ ...overrides,
578
+ ...resolveTableClassNames(appearance, overrides)
579
+ };
580
+ } }));
581
+ TableRoot.displayName = "SWorks/Table";
582
+ var Table = Object.assign(TableRoot, {
583
+ Thead: MantineTable.Thead,
584
+ Tbody: MantineTable.Tbody,
585
+ Tfoot: MantineTable.Tfoot,
586
+ Tr: MantineTable.Tr,
587
+ Th: MantineTable.Th,
588
+ Td: MantineTable.Td,
589
+ Caption: MantineTable.Caption,
590
+ ScrollContainer: MantineTable.ScrollContainer,
591
+ DataRenderer: MantineTable.DataRenderer
592
+ });
593
+
594
+ // src/components/Pagination/Pagination.tsx
595
+ import { forwardRef as forwardRef8 } from "react";
596
+ import cx8 from "clsx";
597
+ import { Group, Pagination as MantinePagination } from "@s-works/s-works-ui/core";
598
+ import { useUncontrolled } from "@s-works/s-works-ui/hooks";
599
+ import { jsx as jsx9, jsxs as jsxs3 } from "react/jsx-runtime";
600
+ function PreviousLabel() {
601
+ return /* @__PURE__ */ jsx9("span", { children: "\u4E0A\u4E00\u9875" });
602
+ }
603
+ function NextLabel() {
604
+ return /* @__PURE__ */ jsx9("span", { children: "\u4E0B\u4E00\u9875" });
605
+ }
606
+ function DotsLabel() {
607
+ return /* @__PURE__ */ jsx9("span", { children: "..." });
608
+ }
609
+ var paginationClassNames = {
610
+ 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",
611
+ fullRoot: "sw:min-h-[52px] sw:w-full sw:justify-between",
612
+ miniRoot: "sw:min-h-[30px] sw:w-fit sw:justify-center",
613
+ simpleControl: "sw:data-[navigation]:disabled:bg-white",
614
+ 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]",
615
+ dots: "sw:flex sw:h-[30px] sw:w-[32px] sw:items-center sw:justify-center sw:text-[13px] sw:leading-[20px] sw:text-[#8c8c8c]"
616
+ };
617
+ var paginationInfoClassName = "sw:text-[12px] sw:leading-[18px] sw:text-[#8c8c8c]";
618
+ var paginationCounterClassNames = {
619
+ root: "sw:flex sw:gap-[4px] sw:text-[13px] sw:leading-[20px] sw:text-[#8c8c8c]",
620
+ current: "sw:text-[#262626]"
621
+ };
622
+ function resolvePaginationInfo({ info, totalRecords, pageSize = 10 }) {
623
+ return info ?? (totalRecords === void 0 ? null : `\u5171 ${totalRecords} \u6761\u6570\u636E\uFF0C\u6BCF\u9875 ${pageSize} \u6761`);
624
+ }
625
+ function resolvePaginationClassNames({ layout = "full" } = {}, overrides = {}) {
626
+ return {
627
+ ...overrides,
628
+ root: cx8(paginationClassNames.root, layout === "mini" ? paginationClassNames.miniRoot : paginationClassNames.fullRoot, overrides.root),
629
+ control: cx8(paginationClassNames.control, layout === "simple" && paginationClassNames.simpleControl, overrides.control),
630
+ dots: cx8(paginationClassNames.dots, overrides.dots)
631
+ };
632
+ }
633
+ function resolvePaginationRootProps({ size = 30, radius = 4, color = "#262626", siblings = 1, boundaries = 1, ...props } = {}) {
634
+ return { ...props, size, radius, color, siblings, boundaries };
635
+ }
636
+ var PaginationRoot = forwardRef8(({ 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) => {
637
+ const [page, setPage] = useUncontrolled({
638
+ value,
639
+ defaultValue,
640
+ finalValue: 1,
641
+ onChange
642
+ });
643
+ if (total <= 0 || hideWithOnePage && total === 1)
644
+ return null;
645
+ const detail = resolvePaginationInfo({ info, totalRecords, pageSize });
646
+ return /* @__PURE__ */ jsxs3(MantinePagination.Root, { role: "navigation", "aria-label": "\u5206\u9875", ...resolvePaginationRootProps(props), total, value: page, onChange: setPage, siblings, boundaries, ref, classNames: (theme, values, ctx) => {
647
+ const overrides = typeof classNames === "function" ? classNames(theme, values, ctx) : classNames;
648
+ return resolvePaginationClassNames({ layout }, overrides);
649
+ }, children: [
650
+ layout !== "mini" && /* @__PURE__ */ jsx9("span", { className: paginationInfoClassName, children: detail }),
651
+ /* @__PURE__ */ jsxs3(Group, { gap, justify: "center", children: [
652
+ withEdges && /* @__PURE__ */ jsx9(MantinePagination.First, { icon: firstIcon, ...getControlProps?.("first") }),
653
+ withControls && /* @__PURE__ */ jsx9(MantinePagination.Previous, { icon: previousIcon ?? PreviousLabel, "data-navigation": true, "aria-label": "\u4E0A\u4E00\u9875", ...getControlProps?.("previous") }),
654
+ layout === "simple" ? /* @__PURE__ */ jsxs3("span", { "aria-live": "polite", className: paginationCounterClassNames.root, children: [
655
+ /* @__PURE__ */ jsx9("span", { className: paginationCounterClassNames.current, children: page }),
656
+ /* @__PURE__ */ jsx9("span", { children: "/" }),
657
+ /* @__PURE__ */ jsx9("span", { children: total })
658
+ ] }) : withPages && /* @__PURE__ */ jsx9(MantinePagination.Items, { dotsIcon: dotsIcon ?? DotsLabel }),
659
+ withControls && /* @__PURE__ */ jsx9(MantinePagination.Next, { icon: nextIcon ?? NextLabel, "data-navigation": true, "aria-label": "\u4E0B\u4E00\u9875", ...getControlProps?.("next") }),
660
+ withEdges && /* @__PURE__ */ jsx9(MantinePagination.Last, { icon: lastIcon, ...getControlProps?.("last") })
661
+ ] })
662
+ ] });
663
+ });
664
+ PaginationRoot.displayName = "SWorks/Pagination";
665
+ var Pagination = Object.assign(PaginationRoot, {
666
+ Root: MantinePagination.Root,
667
+ Control: MantinePagination.Control,
668
+ Dots: MantinePagination.Dots,
669
+ First: MantinePagination.First,
670
+ Last: MantinePagination.Last,
671
+ Next: MantinePagination.Next,
672
+ Previous: MantinePagination.Previous,
673
+ Items: MantinePagination.Items
674
+ });
675
+
676
+ // src/components/Radio/Radio.tsx
677
+ import { forwardRef as forwardRef9 } from "react";
678
+ import cx9 from "clsx";
679
+ import { Radio as MantineRadio } from "@s-works/s-works-ui/core";
680
+ import { jsx as jsx10 } from "react/jsx-runtime";
681
+ var radioClassNames = {
682
+ root: "sw:[font-family:PingFang_SC,sans-serif] sw:tracking-[0px] sw:not-italic",
683
+ body: "sw:items-center",
684
+ labeledBody: "sw:min-h-[22px] sw:items-start",
685
+ labeledInner: "sw:mt-[5px]",
686
+ 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]",
687
+ 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]",
688
+ label: "sw:pl-[8px] sw:text-[14px] sw:font-normal sw:leading-[22px] sw:text-[#262626] sw:data-[disabled]:text-[#bfbfbf]"
689
+ };
690
+ function resolveRadioProps({ size = "14px", color = "#165dff", iconColor = "#ffffff", ...props } = {}) {
691
+ return { ...props, size, color, iconColor };
692
+ }
693
+ function resolveRadioClassNames({ label } = {}, overrides = {}) {
694
+ return {
695
+ ...overrides,
696
+ root: cx9(radioClassNames.root, overrides.root),
697
+ body: cx9(radioClassNames.body, label && radioClassNames.labeledBody, overrides.body),
698
+ radio: cx9(radioClassNames.radio, overrides.radio),
699
+ icon: cx9(radioClassNames.icon, overrides.icon),
700
+ inner: cx9(label && radioClassNames.labeledInner, overrides.inner),
701
+ label: cx9(radioClassNames.label, overrides.label)
702
+ };
703
+ }
704
+ var RadioRoot = forwardRef9(({ classNames, ...props }, ref) => /* @__PURE__ */ jsx10(MantineRadio, { ...resolveRadioProps(props), ref, classNames: (theme, values, ctx) => {
705
+ const overrides = typeof classNames === "function" ? classNames(theme, values, ctx) : classNames;
706
+ return resolveRadioClassNames(props, overrides);
707
+ } }));
708
+ RadioRoot.displayName = "SWorks/Radio";
709
+ var Radio = Object.assign(RadioRoot, {
710
+ Group: MantineRadio.Group,
711
+ Card: MantineRadio.Card,
712
+ Indicator: MantineRadio.Indicator
713
+ });
714
+
715
+ // src/components/Checkbox/Checkbox.tsx
716
+ import { forwardRef as forwardRef10 } from "react";
717
+ import cx10 from "clsx";
718
+ import { Checkbox as MantineCheckbox } from "@s-works/s-works-ui/core";
719
+
720
+ // src/components/Checkbox/icons.tsx
721
+ import { jsx as jsx11 } from "react/jsx-runtime";
722
+ function CheckboxCheckIcon({ size, width = size ?? "14", height = size ?? "14", ...props }) {
723
+ return /* @__PURE__ */ jsx11("svg", { preserveAspectRatio: "none", overflow: "visible", viewBox: "0 0 14 14", fill: "none", width, height, "aria-hidden": "true", focusable: "false", ...props, children: /* @__PURE__ */ jsx11("g", { children: /* @__PURE__ */ jsx11("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" }) }) });
724
+ }
725
+
726
+ // src/components/Checkbox/Checkbox.tsx
727
+ import { jsx as jsx12 } from "react/jsx-runtime";
728
+ var checkboxClassNames = {
729
+ root: "sw:[font-family:PingFang_SC,sans-serif] sw:tracking-[0px] sw:not-italic",
730
+ body: "sw:items-center",
731
+ labeledBody: "sw:min-h-[22px] sw:items-start",
732
+ labeledInner: "sw:mt-[5px]",
733
+ 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]",
734
+ icon: "sw:m-0 sw:flex sw:h-full sw:w-full sw:items-center sw:justify-center",
735
+ label: "sw:pl-[8px] sw:text-[14px] sw:font-normal sw:leading-[22px] sw:text-[#262626] sw:data-[disabled]:text-[#bfbfbf]"
736
+ };
737
+ function CheckGlyph({ indeterminate, className }) {
738
+ return /* @__PURE__ */ jsx12("span", { className, children: indeterminate ? /* @__PURE__ */ jsx12("span", { className: "sw:h-[2px] sw:w-[6px] sw:rounded-[0.5px] sw:bg-current" }) : /* @__PURE__ */ jsx12(CheckboxCheckIcon, { width: "100%", height: "100%" }) });
739
+ }
740
+ function resolveCheckboxProps({ size = "14px", radius = 2, color = "#165dff", iconColor = "#ffffff", icon = CheckGlyph, ...props } = {}) {
741
+ return { ...props, size, radius, color, iconColor, icon };
742
+ }
743
+ function resolveCheckboxClassNames({ label } = {}, overrides = {}) {
744
+ return {
745
+ ...overrides,
746
+ root: cx10(checkboxClassNames.root, overrides.root),
747
+ body: cx10(checkboxClassNames.body, label && checkboxClassNames.labeledBody, overrides.body),
748
+ input: cx10(checkboxClassNames.input, overrides.input),
749
+ icon: cx10(checkboxClassNames.icon, overrides.icon),
750
+ inner: cx10(label && checkboxClassNames.labeledInner, overrides.inner),
751
+ label: cx10(checkboxClassNames.label, overrides.label)
752
+ };
753
+ }
754
+ var CheckboxRoot = forwardRef10(({ classNames, ...props }, ref) => /* @__PURE__ */ jsx12(MantineCheckbox, { ...resolveCheckboxProps(props), ref, classNames: (theme, values, ctx) => {
755
+ const overrides = typeof classNames === "function" ? classNames(theme, values, ctx) : classNames;
756
+ return resolveCheckboxClassNames(props, overrides);
757
+ } }));
758
+ CheckboxRoot.displayName = "SWorks/Checkbox";
759
+ var Checkbox = Object.assign(CheckboxRoot, {
760
+ Group: MantineCheckbox.Group,
761
+ Card: MantineCheckbox.Card,
762
+ Indicator: MantineCheckbox.Indicator
763
+ });
764
+
765
+ // src/components/Switch/Switch.tsx
766
+ import { forwardRef as forwardRef11 } from "react";
767
+ import cx11 from "clsx";
768
+ import { Switch as MantineSwitch } from "@s-works/s-works-ui/core";
769
+ import { jsx as jsx13 } from "react/jsx-runtime";
770
+ var switchClassNames = {
771
+ root: "sw:[font-family:PingFang_SC,sans-serif] sw:tracking-[0px] sw:not-italic",
772
+ body: "sw:items-center",
773
+ 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]",
774
+ thumb: "sw:border-0 sw:bg-white sw:shadow-[0_1px_3px_rgba(0,0,0,0.1)]",
775
+ largeTrack: "sw:w-[40px] sw:min-w-[40px] sw:h-[24px]",
776
+ smallTrack: "sw:w-[28px] sw:min-w-[28px] sw:h-[16px]",
777
+ largeThumb: "sw:h-[16px] sw:w-[16px] sw:start-[4px] sw:[input:checked+*>&]:start-[calc(100%-20px)]",
778
+ 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)]",
779
+ label: "sw:pl-[8px] sw:text-[14px] sw:font-normal sw:leading-[22px] sw:text-[#262626] sw:data-[disabled]:text-[#bfbfbf]"
780
+ };
781
+ function resolveSwitchProps({ size = "md", radius = 24, color = "#165dff", withThumbIndicator = false, ...props } = {}) {
782
+ return { ...props, size, radius, color, withThumbIndicator };
783
+ }
784
+ function resolveSwitchClassNames({ size = "md" } = {}, overrides = {}) {
785
+ return {
786
+ ...overrides,
787
+ root: cx11(switchClassNames.root, overrides.root),
788
+ body: cx11(switchClassNames.body, overrides.body),
789
+ track: cx11(switchClassNames.track, size === "md" && switchClassNames.largeTrack, size === "xs" && switchClassNames.smallTrack, overrides.track),
790
+ thumb: cx11(switchClassNames.thumb, size === "md" && switchClassNames.largeThumb, size === "xs" && switchClassNames.smallThumb, overrides.thumb),
791
+ label: cx11(switchClassNames.label, overrides.label)
792
+ };
793
+ }
794
+ var SwitchRoot = forwardRef11(({ classNames, ...props }, ref) => /* @__PURE__ */ jsx13(MantineSwitch, { ...resolveSwitchProps(props), ref, classNames: (theme, values, ctx) => {
795
+ const overrides = typeof classNames === "function" ? classNames(theme, values, ctx) : classNames;
796
+ return resolveSwitchClassNames(props, overrides);
797
+ } }));
798
+ SwitchRoot.displayName = "SWorks/Switch";
799
+ var Switch = Object.assign(SwitchRoot, { Group: MantineSwitch.Group });
800
+
801
+ // src/components/Alert/Alert.tsx
802
+ import { forwardRef as forwardRef12 } from "react";
803
+ import cx12 from "clsx";
804
+ import { Alert as MantineAlert } from "@s-works/s-works-ui/core";
805
+
806
+ // src/components/Alert/icons.tsx
807
+ import { useId } from "react";
808
+ import { jsx as jsx14, jsxs as jsxs4 } from "react/jsx-runtime";
809
+ function CloseIcon({ size, width = size ?? "6.33074", height = size ?? "6.33074", ...props }) {
810
+ return /* @__PURE__ */ jsx14("svg", { preserveAspectRatio: "none", overflow: "visible", viewBox: "0 0 6.33074 6.33074", fill: "none", width, height, "aria-hidden": "true", focusable: "false", ...props, children: /* @__PURE__ */ jsx14("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" }) });
811
+ }
812
+ function CloseNormalIcon({ size, width = size ?? "6.33074", height = size ?? "6.33074", ...props }) {
813
+ return /* @__PURE__ */ jsx14("svg", { preserveAspectRatio: "none", overflow: "visible", viewBox: "0 0 6.33074 6.33074", fill: "none", width, height, "aria-hidden": "true", focusable: "false", ...props, children: /* @__PURE__ */ jsx14("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" }) });
814
+ }
815
+ function DoneIcon({ size, width = size ?? "16", height = size ?? "16", ...props }) {
816
+ const id = useId();
817
+ return /* @__PURE__ */ jsxs4("svg", { preserveAspectRatio: "none", overflow: "visible", viewBox: "0 0 16 16", fill: "none", width, height, "aria-hidden": "true", focusable: "false", ...props, children: [
818
+ /* @__PURE__ */ jsx14("g", { clipPath: `url(#${id}-clip0_0_89)`, children: /* @__PURE__ */ jsx14("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" }) }),
819
+ /* @__PURE__ */ jsx14("defs", { children: /* @__PURE__ */ jsx14("clipPath", { id: id + "-clip0_0_89", children: /* @__PURE__ */ jsx14("rect", { width: "16", height: "16", fill: "white" }) }) })
820
+ ] });
821
+ }
822
+ function ErrorIcon({ size, width = size ?? "16", height = size ?? "16", ...props }) {
823
+ const id = useId();
824
+ return /* @__PURE__ */ jsxs4("svg", { preserveAspectRatio: "none", overflow: "visible", viewBox: "0 0 16 16", fill: "none", width, height, "aria-hidden": "true", focusable: "false", ...props, children: [
825
+ /* @__PURE__ */ jsx14("g", { clipPath: `url(#${id}-clip0_0_111)`, children: /* @__PURE__ */ jsx14("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" }) }),
826
+ /* @__PURE__ */ jsx14("defs", { children: /* @__PURE__ */ jsx14("clipPath", { id: id + "-clip0_0_111", children: /* @__PURE__ */ jsx14("rect", { width: "16", height: "16", fill: "white" }) }) })
827
+ ] });
828
+ }
829
+ function LoadingIcon({ size, width = size ?? "16", height = size ?? "16", ...props }) {
830
+ const id = useId();
831
+ return /* @__PURE__ */ jsxs4("svg", { preserveAspectRatio: "none", overflow: "visible", viewBox: "0 0 16 16", fill: "none", width, height, "aria-hidden": "true", focusable: "false", ...props, children: [
832
+ /* @__PURE__ */ jsx14("g", { children: /* @__PURE__ */ jsx14("g", { clipPath: `url(#${id}-clip0_0_59)`, children: /* @__PURE__ */ jsxs4("g", { children: [
833
+ /* @__PURE__ */ jsx14("mask", { id: id + "-stroke0_0_59", children: /* @__PURE__ */ jsx14("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" }) }),
834
+ /* @__PURE__ */ jsx14("g", { clipPath: `url(#${id}-paint0_angular_0_59_clip_path)`, mask: `url(#${id}-stroke0_0_59)`, children: /* @__PURE__ */ jsx14("g", { transform: "matrix(0 0.007 -0.007 0 8 8)", children: /* @__PURE__ */ jsx14("foreignObject", { x: "-2285.71", y: "-2285.71", width: "4571.43", height: "4571.43", children: /* @__PURE__ */ jsx14("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)]" }) }) }) }),
835
+ /* @__PURE__ */ jsx14("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" })
836
+ ] }) }) }),
837
+ /* @__PURE__ */ jsxs4("defs", { children: [
838
+ /* @__PURE__ */ jsx14("clipPath", { id: id + "-paint0_angular_0_59_clip_path", children: /* @__PURE__ */ jsx14("rect", { x: "-8", y: "-8", width: "32", height: "32" }) }),
839
+ /* @__PURE__ */ jsx14("clipPath", { id: id + "-clip0_0_59", children: /* @__PURE__ */ jsx14("rect", { width: "16", height: "16", rx: "8", fill: "white" }) })
840
+ ] })
841
+ ] });
842
+ }
843
+ function QuestionIcon({ size, width = size ?? "16", height = size ?? "16", ...props }) {
844
+ return /* @__PURE__ */ jsx14("svg", { preserveAspectRatio: "none", overflow: "visible", viewBox: "0 0 16 16", fill: "none", width, height, "aria-hidden": "true", focusable: "false", ...props, children: /* @__PURE__ */ jsx14("g", { children: /* @__PURE__ */ jsx14("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" }) }) });
845
+ }
846
+ function QuestionOrangeIcon({ size, width = size ?? "16", height = size ?? "16", ...props }) {
847
+ return /* @__PURE__ */ jsx14("svg", { preserveAspectRatio: "none", overflow: "visible", viewBox: "0 0 16 16", fill: "none", width, height, "aria-hidden": "true", focusable: "false", ...props, children: /* @__PURE__ */ jsx14("g", { children: /* @__PURE__ */ jsx14("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" }) }) });
848
+ }
849
+ function SuccessIcon({ size, width = size ?? "16", height = size ?? "16", ...props }) {
850
+ const id = useId();
851
+ return /* @__PURE__ */ jsxs4("svg", { preserveAspectRatio: "none", overflow: "visible", viewBox: "0 0 16 16", fill: "none", width, height, "aria-hidden": "true", focusable: "false", ...props, children: [
852
+ /* @__PURE__ */ jsx14("g", { clipPath: `url(#${id}-clip0_0_141)`, children: /* @__PURE__ */ jsx14("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" }) }),
853
+ /* @__PURE__ */ jsx14("defs", { children: /* @__PURE__ */ jsx14("clipPath", { id: id + "-clip0_0_141", children: /* @__PURE__ */ jsx14("rect", { width: "16", height: "16", fill: "white" }) }) })
854
+ ] });
855
+ }
856
+ function WaitingIcon({ size, width = size ?? "16", height = size ?? "16", ...props }) {
857
+ const id = useId();
858
+ return /* @__PURE__ */ jsxs4("svg", { preserveAspectRatio: "none", overflow: "visible", viewBox: "0 0 16 16", fill: "none", width, height, "aria-hidden": "true", focusable: "false", ...props, children: [
859
+ /* @__PURE__ */ jsx14("g", { clipPath: `url(#${id}-clip0_0_115)`, children: /* @__PURE__ */ jsx14("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" }) }),
860
+ /* @__PURE__ */ jsx14("defs", { children: /* @__PURE__ */ jsx14("clipPath", { id: id + "-clip0_0_115", children: /* @__PURE__ */ jsx14("rect", { width: "16", height: "16", fill: "white" }) }) })
861
+ ] });
862
+ }
863
+ function WaitingOrangeIcon({ size, width = size ?? "16", height = size ?? "16", ...props }) {
864
+ const id = useId();
865
+ return /* @__PURE__ */ jsxs4("svg", { preserveAspectRatio: "none", overflow: "visible", viewBox: "0 0 16 16", fill: "none", width, height, "aria-hidden": "true", focusable: "false", ...props, children: [
866
+ /* @__PURE__ */ jsx14("g", { clipPath: `url(#${id}-clip0_0_107)`, children: /* @__PURE__ */ jsx14("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" }) }),
867
+ /* @__PURE__ */ jsx14("defs", { children: /* @__PURE__ */ jsx14("clipPath", { id: id + "-clip0_0_107", children: /* @__PURE__ */ jsx14("rect", { width: "16", height: "16", fill: "white" }) }) })
868
+ ] });
869
+ }
870
+ function WarningIcon({ size, width = size ?? "16", height = size ?? "16", ...props }) {
871
+ const id = useId();
872
+ return /* @__PURE__ */ jsxs4("svg", { preserveAspectRatio: "none", overflow: "visible", viewBox: "0 0 16 16", fill: "none", width, height, "aria-hidden": "true", focusable: "false", ...props, children: [
873
+ /* @__PURE__ */ jsx14("g", { clipPath: `url(#${id}-clip0_0_119)`, children: /* @__PURE__ */ jsx14("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" }) }),
874
+ /* @__PURE__ */ jsx14("defs", { children: /* @__PURE__ */ jsx14("clipPath", { id: id + "-clip0_0_119", children: /* @__PURE__ */ jsx14("rect", { width: "16", height: "16", fill: "white" }) }) })
875
+ ] });
876
+ }
877
+ var alertStatusIcons = {
878
+ done: DoneIcon,
879
+ error: ErrorIcon,
880
+ loading: LoadingIcon,
881
+ question: QuestionIcon,
882
+ questionOrange: QuestionOrangeIcon,
883
+ success: SuccessIcon,
884
+ waiting: WaitingIcon,
885
+ waitingOrange: WaitingOrangeIcon,
886
+ warning: WarningIcon
887
+ };
888
+ var alertIcons = {
889
+ ...alertStatusIcons,
890
+ close: CloseIcon,
891
+ closeNormal: CloseNormalIcon
892
+ };
893
+
894
+ // src/components/Alert/Alert.tsx
895
+ import { jsx as jsx15 } from "react/jsx-runtime";
896
+ var alertClassNames = {
897
+ 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)]",
898
+ banner: "sw:shadow-[inset_0_0_0_1px_#fee8d0,0_8px_16px_rgba(0,0,0,0.1)]",
899
+ wrapper: "sw:h-full sw:items-center sw:gap-[8px]",
900
+ body: "sw:min-w-0 sw:gap-[4px]",
901
+ message: "sw:text-[14px] sw:font-normal sw:leading-[22px] sw:text-[#262626] sw:whitespace-nowrap",
902
+ title: "sw:p-0 sw:text-[14px] sw:font-medium sw:leading-[22px]",
903
+ icon: "sw:m-0 sw:h-[16px] sw:w-[16px] sw:shrink-0 sw:items-center sw:justify-center",
904
+ closeButton: "sw:h-[24px] sw:w-[24px] sw:shrink-0 sw:rounded-[6px] sw:p-0 sw:text-[#262626]"
905
+ };
906
+ function renderAlertIcon(status) {
907
+ const StatusIcon = alertStatusIcons[status];
908
+ return /* @__PURE__ */ jsx15("span", { className: status === "loading" ? "sw:motion-safe:animate-spin" : void 0, children: /* @__PURE__ */ jsx15(StatusIcon, {}) });
909
+ }
910
+ function resolveAlertProps({ status = "success", appearance = "message", withCloseButton = false, closeButtonLabel = "\u5173\u95ED\u63D0\u793A", icon, attributes, ...props } = {}) {
911
+ const CloseIcon2 = appearance === "banner" ? alertIcons.close : alertIcons.closeNormal;
912
+ return {
913
+ radius: 8,
914
+ h: props.title ? void 0 : 40,
915
+ px: 16,
916
+ py: props.title ? 8 : 0,
917
+ pr: withCloseButton ? 8 : 16,
918
+ bg: appearance === "banner" ? "#fff9f3" : "#ffffff",
919
+ c: "#262626",
920
+ ...props,
921
+ withCloseButton,
922
+ closeButtonLabel,
923
+ icon: icon === void 0 ? renderAlertIcon(status) : icon,
924
+ attributes: {
925
+ ...attributes,
926
+ closeButton: { icon: /* @__PURE__ */ jsx15(CloseIcon2, {}), ...attributes?.closeButton }
927
+ }
928
+ };
929
+ }
930
+ function resolveAlertClassNames({ appearance = "message" } = {}, overrides = {}) {
931
+ return {
932
+ ...overrides,
933
+ root: cx12(alertClassNames.root, appearance === "banner" && alertClassNames.banner, overrides.root),
934
+ wrapper: cx12(alertClassNames.wrapper, overrides.wrapper),
935
+ body: cx12(alertClassNames.body, overrides.body),
936
+ message: cx12(alertClassNames.message, overrides.message),
937
+ title: cx12(alertClassNames.title, overrides.title),
938
+ icon: cx12(alertClassNames.icon, overrides.icon),
939
+ closeButton: cx12(alertClassNames.closeButton, overrides.closeButton)
940
+ };
941
+ }
942
+ var Alert = forwardRef12(({ classNames, ...props }, ref) => /* @__PURE__ */ jsx15(MantineAlert, { ...resolveAlertProps(props), ref, classNames: (theme, values, ctx) => resolveAlertClassNames(props, typeof classNames === "function" ? classNames(theme, values, ctx) : classNames) }));
943
+ Alert.displayName = "SWorks/Alert";
944
+
945
+ // src/components/Toast/Toast.tsx
946
+ import { forwardRef as forwardRef13, useEffect as useEffect4, useRef as useRef4, useState as useState4 } from "react";
947
+ import cx13 from "clsx";
948
+ import { jsx as jsx16 } from "react/jsx-runtime";
949
+ function resolveToastClassNames(overrides = {}) {
950
+ return {
951
+ ...overrides,
952
+ root: cx13("sw:pointer-events-auto", overrides.root),
953
+ message: cx13("sw:!whitespace-normal sw:break-words", overrides.message)
954
+ };
955
+ }
956
+ var Toast = forwardRef13(({ autoClose = 4e3, onClose, withCloseButton = Boolean(onClose), classNames, role = "status", ...props }, ref) => {
957
+ const [hovered, setHovered] = useState4(false);
958
+ const [focused, setFocused] = useState4(false);
959
+ const focusBeforeToast = useRef4(null);
960
+ useEffect4(() => {
961
+ if (!onClose || autoClose === false || hovered || focused)
962
+ return;
963
+ const timeout = window.setTimeout(onClose, autoClose);
964
+ return () => window.clearTimeout(timeout);
965
+ }, [autoClose, focused, hovered, onClose]);
966
+ return /* @__PURE__ */ jsx16("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) => {
967
+ if (!event.currentTarget.contains(event.relatedTarget)) {
968
+ focusBeforeToast.current = event.relatedTarget instanceof HTMLElement ? event.relatedTarget : null;
969
+ setFocused(true);
970
+ }
971
+ }, onBlurCapture: (event) => {
972
+ if (!event.currentTarget.contains(event.relatedTarget))
973
+ setFocused(false);
974
+ }, children: /* @__PURE__ */ jsx16(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: () => {
975
+ if (focused && focusBeforeToast.current?.isConnected) {
976
+ focusBeforeToast.current.focus({ preventScroll: true });
977
+ }
978
+ onClose?.();
979
+ }, classNames: (theme, values, context) => resolveToastClassNames(typeof classNames === "function" ? classNames(theme, values, context) : classNames) }) });
980
+ });
981
+ Toast.displayName = "SWorks/Toast";
982
+
983
+ // src/components/Modal/Modal.tsx
984
+ import { forwardRef as forwardRef14 } from "react";
985
+ import { Modal as MantineModal, ScrollArea } from "@s-works/s-works-ui/core";
986
+ import cx14 from "clsx";
987
+
988
+ // src/components/Modal/icons.tsx
989
+ import { useId as useId2 } from "react";
990
+ import { jsx as jsx17, jsxs as jsxs5 } from "react/jsx-runtime";
991
+ function ModalCloseIcon(props) {
992
+ return /* @__PURE__ */ jsx17("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__ */ jsx17("g", { children: /* @__PURE__ */ jsx17("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" }) }) });
993
+ }
994
+ function ModalErrorIcon(props) {
995
+ const id = useId2();
996
+ return /* @__PURE__ */ jsxs5("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: [
997
+ /* @__PURE__ */ jsx17("g", { clipPath: `url(#${id}-clip0_0_235)`, children: /* @__PURE__ */ jsx17("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" }) }),
998
+ /* @__PURE__ */ jsx17("defs", { children: /* @__PURE__ */ jsx17("clipPath", { id: id + "-clip0_0_235", children: /* @__PURE__ */ jsx17("rect", { width: "24", height: "24", fill: "white" }) }) })
999
+ ] });
1000
+ }
1001
+ function ModalSuccessIcon(props) {
1002
+ const id = useId2();
1003
+ return /* @__PURE__ */ jsxs5("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: [
1004
+ /* @__PURE__ */ jsx17("g", { clipPath: `url(#${id}-clip0_0_295)`, children: /* @__PURE__ */ jsx17("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" }) }),
1005
+ /* @__PURE__ */ jsx17("defs", { children: /* @__PURE__ */ jsx17("clipPath", { id: id + "-clip0_0_295", children: /* @__PURE__ */ jsx17("rect", { width: "24", height: "24", fill: "white" }) }) })
1006
+ ] });
1007
+ }
1008
+ function ModalWarningIcon(props) {
1009
+ const id = useId2();
1010
+ return /* @__PURE__ */ jsxs5("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: [
1011
+ /* @__PURE__ */ jsx17("g", { clipPath: `url(#${id}-clip0_0_315)`, children: /* @__PURE__ */ jsx17("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" }) }),
1012
+ /* @__PURE__ */ jsx17("defs", { children: /* @__PURE__ */ jsx17("clipPath", { id: id + "-clip0_0_315", children: /* @__PURE__ */ jsx17("rect", { width: "24", height: "24", fill: "white" }) }) })
1013
+ ] });
1014
+ }
1015
+ function ModalEditIcon(props) {
1016
+ const id = useId2();
1017
+ return /* @__PURE__ */ jsxs5("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: [
1018
+ /* @__PURE__ */ jsx17("g", { children: /* @__PURE__ */ jsxs5("g", { children: [
1019
+ /* @__PURE__ */ jsx17("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)` }),
1020
+ /* @__PURE__ */ jsx17("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)` }),
1021
+ /* @__PURE__ */ jsx17("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)` })
1022
+ ] }) }),
1023
+ /* @__PURE__ */ jsxs5("defs", { children: [
1024
+ /* @__PURE__ */ jsxs5("linearGradient", { id: id + "-paint0_linear_0_303", x1: "8.90395", y1: "0.21206", x2: "8.90395", y2: "14.5828", gradientUnits: "userSpaceOnUse", children: [
1025
+ /* @__PURE__ */ jsx17("stop", { stopColor: "#4318FF" }),
1026
+ /* @__PURE__ */ jsx17("stop", { offset: "1", stopColor: "#165DFF" })
1027
+ ] }),
1028
+ /* @__PURE__ */ jsxs5("linearGradient", { id: id + "-paint1_linear_0_303", x1: "8.90395", y1: "0.21206", x2: "8.90395", y2: "14.5828", gradientUnits: "userSpaceOnUse", children: [
1029
+ /* @__PURE__ */ jsx17("stop", { stopColor: "#4318FF" }),
1030
+ /* @__PURE__ */ jsx17("stop", { offset: "1", stopColor: "#165DFF" })
1031
+ ] }),
1032
+ /* @__PURE__ */ jsxs5("linearGradient", { id: id + "-paint2_linear_0_303", x1: "8.90395", y1: "0.21206", x2: "8.90395", y2: "14.5828", gradientUnits: "userSpaceOnUse", children: [
1033
+ /* @__PURE__ */ jsx17("stop", { stopColor: "#4318FF" }),
1034
+ /* @__PURE__ */ jsx17("stop", { offset: "1", stopColor: "#165DFF" })
1035
+ ] })
1036
+ ] })
1037
+ ] });
1038
+ }
1039
+ function ModalStatusIcon({ status, ...props }) {
1040
+ const Icon = {
1041
+ error: ModalErrorIcon,
1042
+ success: ModalSuccessIcon,
1043
+ warning: ModalWarningIcon,
1044
+ edit: ModalEditIcon
1045
+ }[status];
1046
+ return /* @__PURE__ */ jsx17(Icon, { ...props });
1047
+ }
1048
+
1049
+ // src/components/Modal/Modal.tsx
1050
+ import { jsx as jsx18, jsxs as jsxs6 } from "react/jsx-runtime";
1051
+ function resolveModalClassNames({ layout = "standard" } = {}, overrides = {}) {
1052
+ return {
1053
+ ...overrides,
1054
+ content: cx14("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),
1055
+ header: cx14("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),
1056
+ title: cx14("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),
1057
+ close: cx14("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),
1058
+ body: cx14("sw:flex sw:min-h-0 sw:flex-auto sw:flex-col sw:text-[14px] sw:font-normal sw:leading-[24px]", overrides.body)
1059
+ };
1060
+ }
1061
+ var ModalComponent = forwardRef14(({ layout = "standard", headerIcon, status, footer, bodyHeight, title, children, classNames, closeButtonProps, ...props }, ref) => /* @__PURE__ */ jsxs6(MantineModal, { ref, centered: true, size: layout === "compact" ? 320 : layout === "form" ? 640 : 400, radius: 16, padding: 0, withCloseButton: layout !== "compact", ...props, title: title && /* @__PURE__ */ jsxs6("span", { className: "sw:flex sw:min-w-0 sw:items-center sw:gap-[8px]", children: [
1062
+ headerIcon ?? (status && /* @__PURE__ */ jsx18(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" })),
1063
+ /* @__PURE__ */ jsx18("span", { className: layout === "compact" ? "sw:min-w-0" : "sw:min-w-0 sw:truncate", children: title })
1064
+ ] }), closeButtonProps: {
1065
+ "aria-label": "\u5173\u95ED\u5F39\u7A97",
1066
+ icon: /* @__PURE__ */ jsx18(ModalCloseIcon, { className: "sw:h-[16px] sw:w-[16px]" }),
1067
+ ...closeButtonProps
1068
+ }, classNames: resolveModalClassNames({ layout }, classNames), children: [
1069
+ /* @__PURE__ */ jsx18(ScrollArea, { h: bodyHeight, type: "auto", classNames: {
1070
+ 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",
1071
+ viewport: "sw:h-auto sw:min-h-0 sw:flex-auto"
1072
+ }, children: /* @__PURE__ */ jsx18("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 }) }),
1073
+ footer && /* @__PURE__ */ jsx18("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 })
1074
+ ] }));
1075
+ ModalComponent.displayName = "SWorks/Modal";
1076
+ var Modal = Object.assign(ModalComponent, {
1077
+ Root: MantineModal.Root,
1078
+ Overlay: MantineModal.Overlay,
1079
+ Content: MantineModal.Content,
1080
+ Header: MantineModal.Header,
1081
+ Title: MantineModal.Title,
1082
+ Body: MantineModal.Body,
1083
+ CloseButton: MantineModal.CloseButton,
1084
+ Stack: MantineModal.Stack
1085
+ });
1086
+
1087
+ // src/components/DateInput/DateInput.tsx
1088
+ import { Fragment, forwardRef as forwardRef15, useEffect as useEffect5, useLayoutEffect, useRef as useRef5, useState as useState5, useId as useId3 } from "react";
1089
+ import cx15 from "clsx";
1090
+ import { Input, Popover } from "@s-works/s-works-ui/core";
1091
+ import { useUncontrolled as useUncontrolled2 } from "@s-works/s-works-ui/hooks";
1092
+ import { DateInput as MantineDateInput, DatePicker as MantineDatePicker, pickCalendarProps } from "@s-works/s-works-ui/dates";
1093
+
1094
+ // src/components/DateRangeShortcuts.tsx
1095
+ import { Button as Button2 } from "@s-works/s-works-ui/core";
1096
+ import dayjs from "dayjs";
1097
+ import { jsx as jsx19 } from "react/jsx-runtime";
1098
+ var dateShortcutClasses = {
1099
+ 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]",
1100
+ label: "sw:font-normal"
1101
+ };
1102
+ function isDateShortcutDisabled(date, { minDate, maxDate, excludeDate, getDayProps }) {
1103
+ return Boolean(minDate && dayjs(date).isBefore(minDate, "day") || maxDate && dayjs(date).isAfter(maxDate, "day") || excludeDate?.(date) || getDayProps?.(date)?.disabled);
1104
+ }
1105
+ function DateRangeShortcuts({ disabled, onChange, ...limits }) {
1106
+ const now = dayjs();
1107
+ const today = now.format("YYYY-MM-DD");
1108
+ const shortcuts = [
1109
+ ["\u4ECA\u5929", today, today],
1110
+ ["\u8FD17\u5929", now.subtract(6, "day").format("YYYY-MM-DD"), today],
1111
+ ["\u8FD130\u5929", now.subtract(29, "day").format("YYYY-MM-DD"), today],
1112
+ ["\u672C\u6708", now.startOf("month").format("YYYY-MM-DD"), now.endOf("month").format("YYYY-MM-DD")]
1113
+ ];
1114
+ return /* @__PURE__ */ jsx19("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__ */ jsx19(Button2, { type: "button", radius: 4, disabled: disabled || isDateShortcutDisabled(start, limits) || start !== end && isDateShortcutDisabled(end, limits), classNames: dateShortcutClasses, onClick: () => onChange([start, end]), children: label }, label)) });
1115
+ }
1116
+
1117
+ // src/components/DateInput/icons.tsx
1118
+ import { jsx as jsx20 } from "react/jsx-runtime";
1119
+ function Calendar(props) {
1120
+ return /* @__PURE__ */ jsx20("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__ */ jsx20("g", { id: "Calendar", children: /* @__PURE__ */ jsx20("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" }) }) });
1121
+ }
1122
+ function CalendarFocus(props) {
1123
+ return /* @__PURE__ */ jsx20("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__ */ jsx20("g", { id: "Calendar", children: /* @__PURE__ */ jsx20("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" }) }) });
1124
+ }
1125
+ function CalendarDisabled(props) {
1126
+ return /* @__PURE__ */ jsx20("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__ */ jsx20("g", { id: "Calendar", children: /* @__PURE__ */ jsx20("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" }) }) });
1127
+ }
1128
+ function CalendarMini(props) {
1129
+ return /* @__PURE__ */ jsx20("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__ */ jsx20("g", { id: "Calendar", children: /* @__PURE__ */ jsx20("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" }) }) });
1130
+ }
1131
+ function CalendarMiniFocus(props) {
1132
+ return /* @__PURE__ */ jsx20("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__ */ jsx20("g", { id: "Calendar", children: /* @__PURE__ */ jsx20("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" }) }) });
1133
+ }
1134
+ function CalendarMiniDisabled(props) {
1135
+ return /* @__PURE__ */ jsx20("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__ */ jsx20("g", { id: "Calendar", children: /* @__PURE__ */ jsx20("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" }) }) });
1136
+ }
1137
+
1138
+ // src/components/DateInput/DateInput.tsx
1139
+ import { Fragment as Fragment2, jsx as jsx21, jsxs as jsxs7 } from "react/jsx-runtime";
1140
+ var sizeClasses = {
1141
+ md: {
1142
+ input: "sw:px-[8px] sw:pr-[32px] sw:text-[14px] sw:leading-[22px]",
1143
+ height: "sw:h-[40px]",
1144
+ radius: 8,
1145
+ rangeRadius: "sw:rounded-[8px]",
1146
+ rangeWidth: 240,
1147
+ section: 32
1148
+ },
1149
+ sm: {
1150
+ input: "sw:px-[8px] sw:pr-[24px] sw:text-[12px] sw:leading-[18px]",
1151
+ height: "sw:h-[32px]",
1152
+ radius: 6,
1153
+ rangeRadius: "sw:rounded-[6px]",
1154
+ rangeWidth: 200,
1155
+ section: 28
1156
+ }
1157
+ };
1158
+ var appearances = {
1159
+ 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]",
1160
+ 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]"
1161
+ };
1162
+ function resolveDateInputClassNames({ size = "md", appearance = "filled" } = {}, overrides = {}) {
1163
+ const config = sizeClasses[size];
1164
+ return {
1165
+ ...overrides,
1166
+ root: cx15("sw:group/date-input sw:[font-family:PingFang_SC,sans-serif] sw:tracking-[0px]", overrides.root),
1167
+ wrapper: overrides.wrapper,
1168
+ input: cx15("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),
1169
+ section: cx15("sw:text-[#262626] sw:data-[position=right]:end-0", overrides.section)
1170
+ };
1171
+ }
1172
+ function DateInputCalendarIcon({ size = "md", disabled = false }) {
1173
+ const Normal = size === "sm" ? CalendarMini : Calendar;
1174
+ const Focus = size === "sm" ? CalendarMiniFocus : CalendarFocus;
1175
+ const Disabled = size === "sm" ? CalendarMiniDisabled : CalendarDisabled;
1176
+ return /* @__PURE__ */ jsx21("span", { "aria-hidden": "true", className: cx15("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__ */ jsx21(Disabled, {}) : /* @__PURE__ */ jsxs7(Fragment2, { children: [
1177
+ /* @__PURE__ */ jsx21("span", { className: "sw:flex sw:group-focus-within/date-input:hidden", children: /* @__PURE__ */ jsx21(Normal, {}) }),
1178
+ /* @__PURE__ */ jsx21("span", { className: "sw:hidden sw:group-focus-within/date-input:flex", children: /* @__PURE__ */ jsx21(Focus, {}) })
1179
+ ] }) });
1180
+ }
1181
+ var SingleDateInput = forwardRef15(({ size = "md", appearance = "filled", value, defaultValue, onChange, classNames, rightSection, ...props }, ref) => {
1182
+ const visual = {
1183
+ size,
1184
+ appearance,
1185
+ disabled: props.disabled
1186
+ };
1187
+ return /* @__PURE__ */ jsx21(MantineDateInput, { 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__ */ jsx21(DateInputCalendarIcon, { ...visual }) : rightSection, classNames: (theme, values, ctx) => resolveDateInputClassNames(visual, typeof classNames === "function" ? classNames(theme, values, ctx) : classNames) });
1188
+ });
1189
+ SingleDateInput.displayName = "SWorks/DateInput";
1190
+ var rangeSizes = {
1191
+ md: "sw:gap-[8px] sw:px-[8px] sw:text-[14px] sw:leading-[22px]",
1192
+ sm: "sw:gap-[4px] sw:px-[8px] sw:text-[12px] sw:leading-[18px]"
1193
+ };
1194
+ var rangeAppearances = {
1195
+ 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]",
1196
+ 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]"
1197
+ };
1198
+ var disabledRangeAppearances = {
1199
+ filled: "sw:border-0 sw:bg-[#f2f3f5]",
1200
+ outlined: "sw:border sw:border-solid sw:border-black/[0.08] sw:bg-white"
1201
+ };
1202
+ var RangeDateInput = forwardRef15(({ 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) => {
1203
+ const generatedId = useId3();
1204
+ const inputId = props.id ?? generatedId;
1205
+ const [local, setLocal] = useState5(defaultValue);
1206
+ const current = value ?? local;
1207
+ const [startDate, endDate] = current;
1208
+ const [activeField, setActiveField] = useState5(0);
1209
+ const inputs = useRef5([null, null]);
1210
+ const [inputVersions, setInputVersions] = useState5([0, 0]);
1211
+ const pendingValue = useRef5(null);
1212
+ const dropdownRef = useRef5(null);
1213
+ const focusOnOpen = useRef5(false);
1214
+ const focusOnClose = useRef5(false);
1215
+ const { opened: controlledOpened, defaultOpened, onChange: onPopoverChange, onDismiss, onEnterTransitionEnd, ...popoverOptions } = props.popoverProps ?? {};
1216
+ const [opened, setOpened] = useUncontrolled2({
1217
+ value: controlledOpened,
1218
+ defaultValue: defaultOpened ?? false,
1219
+ onChange: onPopoverChange
1220
+ });
1221
+ const calendarDisabled = props.disabled || props.readOnly || popoverOptions.disabled;
1222
+ const calendarOpen = opened && !calendarDisabled;
1223
+ const dropdownId = inputId + "-calendar";
1224
+ const { calendarProps } = pickCalendarProps(props);
1225
+ const { styles, unstyled } = props;
1226
+ const calendarAppearance = {
1227
+ styles: typeof styles === "function" ? (theme, _calendar, context) => styles(theme, {
1228
+ ...props,
1229
+ size,
1230
+ value: current[activeField],
1231
+ valueFormat: props.valueFormat ?? "YYYY/MM/DD"
1232
+ }, context) : styles,
1233
+ unstyled
1234
+ };
1235
+ useLayoutEffect(() => {
1236
+ const pending = pendingValue.current;
1237
+ if (!pending)
1238
+ return;
1239
+ const next = pending.field === 0 ? startDate : endDate;
1240
+ if (next === pending.previous)
1241
+ return;
1242
+ const input = inputs.current[pending.field];
1243
+ if (calendarOpen || !input || input.ownerDocument.activeElement !== input) {
1244
+ pendingValue.current = null;
1245
+ return;
1246
+ }
1247
+ pending.previous = next;
1248
+ focusOnClose.current = true;
1249
+ setInputVersions(([start, end]) => pending.field === 0 ? [start + 1, end] : [start, end + 1]);
1250
+ }, [calendarOpen, startDate, endDate]);
1251
+ useEffect5(() => {
1252
+ if (calendarOpen || !focusOnClose.current)
1253
+ return;
1254
+ const input = inputs.current[activeField];
1255
+ if (input?.isConnected) {
1256
+ const { activeElement, body } = input.ownerDocument;
1257
+ if (activeElement === body || dropdownRef.current?.contains(activeElement)) {
1258
+ input.focus({ preventScroll: true });
1259
+ }
1260
+ }
1261
+ focusOnClose.current = false;
1262
+ }, [activeField, calendarOpen, inputVersions]);
1263
+ const openCalendar = (field) => {
1264
+ if (calendarDisabled || focusOnClose.current)
1265
+ return;
1266
+ setActiveField(field);
1267
+ if (!opened)
1268
+ setOpened(true);
1269
+ };
1270
+ const focusCalendar = () => {
1271
+ const button = dropdownRef.current?.querySelector("button:not(:disabled)");
1272
+ button?.focus();
1273
+ if (button && button.ownerDocument.activeElement === button)
1274
+ focusOnOpen.current = false;
1275
+ };
1276
+ const dismissCalendar = (returnFocus = false) => {
1277
+ focusOnOpen.current = false;
1278
+ focusOnClose.current = returnFocus;
1279
+ setOpened(false);
1280
+ onDismiss?.();
1281
+ };
1282
+ const inputEvents = (field) => ({
1283
+ onFocus: (event) => {
1284
+ props.onFocus?.(event);
1285
+ openCalendar(field);
1286
+ },
1287
+ onClick: (event) => {
1288
+ props.onClick?.(event);
1289
+ if (!event.defaultPrevented)
1290
+ openCalendar(field);
1291
+ },
1292
+ onInput: (event) => {
1293
+ if (pendingValue.current?.field === field)
1294
+ pendingValue.current = null;
1295
+ props.onInput?.(event);
1296
+ },
1297
+ onKeyDown: (event) => {
1298
+ props.onKeyDown?.(event);
1299
+ if (event.defaultPrevented || calendarDisabled || event.nativeEvent.isComposing || event.keyCode === 229)
1300
+ return;
1301
+ if (event.key === "ArrowDown") {
1302
+ event.preventDefault();
1303
+ focusOnOpen.current = true;
1304
+ openCalendar(field);
1305
+ if (calendarOpen)
1306
+ focusCalendar();
1307
+ } else if (event.key === "Escape" && calendarOpen && popoverOptions.closeOnEscape !== false) {
1308
+ event.preventDefault();
1309
+ event.stopPropagation();
1310
+ dismissCalendar();
1311
+ }
1312
+ }
1313
+ });
1314
+ const config = rangeSizes[size];
1315
+ const changeRange = (pair) => {
1316
+ setLocal(pair);
1317
+ onChange?.(pair);
1318
+ };
1319
+ const updateEndpoint = (index, next) => {
1320
+ const pair = [...current];
1321
+ pair[index] = next;
1322
+ if (pair[0] && pair[1] && pair[0] > pair[1]) {
1323
+ if (index === 0)
1324
+ pair[1] = null;
1325
+ else
1326
+ pair[0] = null;
1327
+ }
1328
+ return pair;
1329
+ };
1330
+ const selectFromCalendar = (pair) => {
1331
+ if (!calendarOpen)
1332
+ return;
1333
+ const input = inputs.current[activeField];
1334
+ if (input?.ownerDocument.activeElement === input)
1335
+ dropdownRef.current?.focus();
1336
+ pendingValue.current = value !== void 0 && pair[activeField] !== current[activeField] ? { field: activeField, previous: current[activeField] } : null;
1337
+ changeRange(pair);
1338
+ focusOnClose.current = true;
1339
+ setOpened(false);
1340
+ };
1341
+ const wrapperProps = {
1342
+ label,
1343
+ description,
1344
+ error,
1345
+ required,
1346
+ withAsterisk
1347
+ };
1348
+ const rangeFont = {
1349
+ md: "sw:text-[14px] sw:leading-[22px]",
1350
+ sm: "sw:text-[12px] sw:leading-[18px]"
1351
+ };
1352
+ const nativeClasses = {
1353
+ root: "sw:h-full sw:min-w-0 sw:flex-1",
1354
+ wrapper: "sw:h-full",
1355
+ 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]"
1356
+ };
1357
+ return /* @__PURE__ */ jsx21(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) => {
1358
+ const next = event.relatedTarget;
1359
+ if (calendarOpen && next && !event.currentTarget.contains(next) && !dropdownRef.current?.contains(next)) {
1360
+ setOpened(false);
1361
+ }
1362
+ }, classNames: {
1363
+ root: cx15("sw:[font-family:PingFang_SC,sans-serif] sw:tracking-[0px]", classNames?.root),
1364
+ label: classNames?.label,
1365
+ error: classNames?.error,
1366
+ description: classNames?.description
1367
+ }, children: /* @__PURE__ */ jsxs7(Popover, { position: "bottom-start", unstyled, ...popoverOptions, opened: calendarOpen, disabled: calendarDisabled, onChange: setOpened, onDismiss, withRoles: false, closeOnEscape: false, onEnterTransitionEnd: () => {
1368
+ if (focusOnOpen.current)
1369
+ focusCalendar();
1370
+ onEnterTransitionEnd?.();
1371
+ }, children: [
1372
+ /* @__PURE__ */ jsx21(Popover.Target, { children: /* @__PURE__ */ jsxs7("div", { className: cx15("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: [
1373
+ [0, 1].map((field) => /* @__PURE__ */ jsxs7(Fragment, { children: [
1374
+ field === 1 && /* @__PURE__ */ jsx21("span", { "aria-hidden": "true", className: cx15("sw:w-[16px] sw:shrink-0 sw:text-center", props.disabled ? "sw:text-[#bfbfbf]" : "sw:text-[#8c8c8c]"), children: "-" }),
1375
+ /* @__PURE__ */ jsx21(MantineDateInput, { ref: (node) => {
1376
+ inputs.current[field] = node;
1377
+ }, ...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: {
1378
+ ...nativeClasses,
1379
+ input: cx15(nativeClasses.input, rangeFont[size], classNames?.input)
1380
+ } }, inputVersions[field])
1381
+ ] }, field)),
1382
+ /* @__PURE__ */ jsx21("span", { className: cx15("sw:shrink-0", classNames?.section), children: /* @__PURE__ */ jsx21(DateInputCalendarIcon, { size, appearance, disabled: props.disabled }) })
1383
+ ] }) }),
1384
+ /* @__PURE__ */ jsxs7(Popover.Dropdown, { id: dropdownId, ref: (node) => {
1385
+ dropdownRef.current = node;
1386
+ if (node && focusOnOpen.current)
1387
+ focusCalendar();
1388
+ }, role: "dialog", "aria-label": activeField === 0 ? startLabel : endLabel, tabIndex: -1, onKeyDown: (event) => {
1389
+ if (event.key === "Escape" && popoverOptions.closeOnEscape !== false) {
1390
+ event.preventDefault();
1391
+ event.stopPropagation();
1392
+ dismissCalendar(true);
1393
+ }
1394
+ }, children: [
1395
+ /* @__PURE__ */ jsx21("div", { className: "sw:mb-[8px]", children: /* @__PURE__ */ jsx21(DateRangeShortcuts, { minDate: props.minDate, maxDate: props.maxDate, excludeDate: props.excludeDate, getDayProps: props.getDayProps, onChange: selectFromCalendar }) }),
1396
+ /* @__PURE__ */ jsx21(MantineDatePicker, { ...calendarProps, ...calendarAppearance, size, defaultDate: current[activeField] ?? props.defaultDate, value: current[activeField], allowDeselect: props.allowDeselect ?? props.clearable, onChange: (next) => selectFromCalendar(updateEndpoint(activeField, next)) }, activeField)
1397
+ ] })
1398
+ ] }) });
1399
+ });
1400
+ RangeDateInput.displayName = "SWorks/DateInput.Range";
1401
+ var DateInput = Object.assign(SingleDateInput, { Range: RangeDateInput });
1402
+
1403
+ // src/components/DatePicker/DatePicker.tsx
1404
+ import { forwardRef as forwardRef17, useState as useState6 } from "react";
1405
+ import cx17 from "clsx";
1406
+ import dayjs2 from "dayjs";
1407
+ import { Paper, ActionIcon, Button as Button3 } from "@s-works/s-works-ui/core";
1408
+ import { DatePicker as MantineDatePicker2, DatesProvider, useDatesContext } from "@s-works/s-works-ui/dates";
1409
+
1410
+ // src/components/Select/Select.tsx
1411
+ import { forwardRef as forwardRef16 } from "react";
1412
+ import cx16 from "clsx";
1413
+ import { Select as MantineSelect } from "@s-works/s-works-ui/core";
1414
+
1415
+ // src/components/Select/icons.tsx
1416
+ import { jsx as jsx22 } from "react/jsx-runtime";
1417
+ function ChevronDown(props) {
1418
+ return /* @__PURE__ */ jsx22("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true", ...props, children: /* @__PURE__ */ jsx22("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" }) });
1419
+ }
1420
+ function CheckIcon(props) {
1421
+ return /* @__PURE__ */ jsx22("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true", ...props, children: /* @__PURE__ */ jsx22("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" }) });
1422
+ }
1423
+
1424
+ // src/components/Select/Select.tsx
1425
+ import { Fragment as Fragment3, jsx as jsx23, jsxs as jsxs8 } from "react/jsx-runtime";
1426
+ var sizes = {
1427
+ 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 },
1428
+ 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 },
1429
+ 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 }
1430
+ };
1431
+ var appearances2 = {
1432
+ 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]",
1433
+ 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]"
1434
+ };
1435
+ var tones = {
1436
+ blue: "sw:hover:bg-[#165dff]/[0.05] sw:data-[checked]:bg-[#165dff]/[0.05] sw:data-[combobox-selected]:bg-[#165dff]/[0.05]",
1437
+ dark: "sw:hover:bg-black/[0.03] sw:data-[checked]:bg-black/[0.03] sw:data-[combobox-selected]:bg-black/[0.03]",
1438
+ neutral: "sw:hover:bg-black/[0.03] sw:data-[checked]:bg-white sw:data-[combobox-selected]:bg-black/[0.03]"
1439
+ };
1440
+ function resolveSelectProps({ size = "md", leftSection, appearance: _appearance, menuTone: _menuTone, optionIcon: _optionIcon, ...props } = {}) {
1441
+ 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 };
1442
+ }
1443
+ function resolveSelectClassNames({ size = "md", appearance = "filled", menuTone = "blue", hasLeftSection = false } = {}, overrides = {}) {
1444
+ return {
1445
+ ...overrides,
1446
+ root: cx16("sw:group/select sw:min-w-0 sw:[font-family:PingFang_SC,sans-serif] sw:tracking-[0px]", overrides.root),
1447
+ input: cx16("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),
1448
+ section: cx16("sw:text-[#262626] sw:group-has-[[disabled]]/select:text-[#bfbfbf] sw:data-[position=right]:end-0 sw:data-[position=left]:start-0", overrides.section),
1449
+ dropdown: cx16("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),
1450
+ options: cx16("sw:p-0", overrides.options),
1451
+ option: cx16("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),
1452
+ empty: cx16("sw:px-[8px] sw:py-[12px] sw:text-[14px] sw:leading-[22px] sw:text-[#8c8c8c]", overrides.empty)
1453
+ };
1454
+ }
1455
+ function SelectChevron() {
1456
+ return /* @__PURE__ */ jsx23("span", { "aria-hidden": "true", className: "sw:flex sw:h-[16px] sw:w-[16px] sw:group-has-[[data-expanded]]/select:-scale-y-100", children: /* @__PURE__ */ jsx23(ChevronDown, {}) });
1457
+ }
1458
+ function SelectOptionContent({ icon, label, checked, withCheckIcon }) {
1459
+ return /* @__PURE__ */ jsxs8(Fragment3, { children: [
1460
+ icon && /* @__PURE__ */ jsx23("span", { "aria-hidden": "true", className: "sw:flex sw:h-[16px] sw:w-[16px] sw:shrink-0", children: icon }),
1461
+ /* @__PURE__ */ jsx23("span", { className: "sw:min-w-0 sw:flex-1 sw:truncate", children: label }),
1462
+ checked && withCheckIcon && /* @__PURE__ */ jsx23("span", { className: "sw:flex sw:h-[16px] sw:w-[16px] sw:shrink-0", children: /* @__PURE__ */ jsx23(CheckIcon, {}) })
1463
+ ] });
1464
+ }
1465
+ var Select = forwardRef16(({ size = "md", appearance = "filled", menuTone = "blue", optionIcon, classNames, rightSection, renderOption, withCheckIcon = Boolean(optionIcon), comboboxProps, ...props }, ref) => /* @__PURE__ */ jsx23(MantineSelect, { ref, ...resolveSelectProps({ size, ...props }), withCheckIcon, comboboxProps: { offset: 4, ...comboboxProps }, rightSection: rightSection === void 0 ? /* @__PURE__ */ jsx23(SelectChevron, {}) : rightSection, renderOption: renderOption ?? (({ option, checked }) => /* @__PURE__ */ jsx23(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) }));
1466
+ Select.displayName = "SWorks/Select";
1467
+
1468
+ // src/components/DatePicker/icons.tsx
1469
+ import { jsx as jsx24 } from "react/jsx-runtime";
1470
+ function ChevronLeft(props) {
1471
+ return /* @__PURE__ */ jsx24("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true", ...props, children: /* @__PURE__ */ jsx24("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" }) });
1472
+ }
1473
+ function ChevronRight(props) {
1474
+ return /* @__PURE__ */ jsx24("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true", ...props, children: /* @__PURE__ */ jsx24("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" }) });
1475
+ }
1476
+
1477
+ // src/components/DatePicker/DatePicker.tsx
1478
+ import { jsx as jsx25, jsxs as jsxs9 } from "react/jsx-runtime";
1479
+ function resolveDatePickerClassNames(overrides = {}) {
1480
+ return {
1481
+ ...overrides,
1482
+ calendarHeader: cx17("sw:hidden", overrides.calendarHeader),
1483
+ levelsGroup: cx17("sw:gap-0", overrides.levelsGroup),
1484
+ month: cx17("sw:block sw:w-[280px] sw:border-collapse", overrides.month),
1485
+ monthThead: cx17("sw:block", overrides.monthThead),
1486
+ monthTbody: cx17("sw:block", overrides.monthTbody),
1487
+ weekdaysRow: cx17("sw:flex sw:h-[30px] sw:items-center sw:justify-between sw:px-[16px]", overrides.weekdaysRow),
1488
+ weekday: cx17("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),
1489
+ monthRow: cx17("sw:flex sw:h-[30px] sw:items-center sw:justify-between sw:px-[16px]", overrides.monthRow),
1490
+ monthCell: cx17("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),
1491
+ day: cx17("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)
1492
+ };
1493
+ }
1494
+ 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" };
1495
+ 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) {
1496
+ const ctx = useDatesContext();
1497
+ const [local, setLocal] = useState6(() => defaultValue ?? (type === "range" ? [null, null] : type === "multiple" ? [] : null));
1498
+ const raw = value !== void 0 ? value : local;
1499
+ const current = Array.isArray(raw) ? raw.map((item) => item ? dayjs2(item).format("YYYY-MM-DD") : null) : raw ? dayjs2(raw).format("YYYY-MM-DD") : null;
1500
+ const initial = Array.isArray(current) ? current[0] : typeof current === "string" ? current : null;
1501
+ const [localDate, setLocalDate] = useState6(() => dayjs2(defaultDate ?? initial ?? /* @__PURE__ */ new Date()).startOf("month").format("YYYY-MM-DD"));
1502
+ const displayed = dayjs2(date ?? localDate).startOf("month");
1503
+ const columns = type === "range" ? 2 : 1;
1504
+ const changeMonth = (next) => {
1505
+ setLocalDate(next);
1506
+ onDateChange?.(next);
1507
+ };
1508
+ const change = (next) => {
1509
+ setLocal(next);
1510
+ onChange?.(next);
1511
+ };
1512
+ const today = dayjs2().format("YYYY-MM-DD");
1513
+ const selectShortcut = (start, end = start) => {
1514
+ change(type === "range" ? [start, end] : type === "multiple" ? [start] : start);
1515
+ changeMonth(dayjs2(start).startOf("month").format("YYYY-MM-DD"));
1516
+ };
1517
+ const years = Array.from({ length: (maxDate ? dayjs2(maxDate).year() : Math.max(displayed.year() + 100, dayjs2().year() + 100)) - (minDate ? dayjs2(minDate).year() : Math.min(1900, displayed.year())) + 1 }, (_, index) => String(index + (minDate ? dayjs2(minDate).year() : Math.min(1900, displayed.year()))));
1518
+ const months = Array.from({ length: 12 }, (_, index) => String(index + 1));
1519
+ const selectDropdown = { withinPortal: false, floatingStrategy: "fixed" };
1520
+ return /* @__PURE__ */ jsxs9(Paper, { ref, radius: 8, classNames: { root: cx17("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: [
1521
+ type === "range" && /* @__PURE__ */ jsx25("div", { className: "sw:px-[12px] sw:pt-[12px]", children: /* @__PURE__ */ jsx25(DateRangeShortcuts, { minDate, maxDate, excludeDate, getDayProps: props.getDayProps, onChange: ([start, end]) => selectShortcut(start, end) }) }),
1522
+ /* @__PURE__ */ jsx25("div", { className: "sw:flex", children: Array.from({ length: columns }, (_, index) => {
1523
+ const month = displayed.add(index, "month");
1524
+ const year = String(month.year());
1525
+ const yearOptions = years.includes(year) ? years : [...years, { value: year, label: year, disabled: true }];
1526
+ const previousDisabled = Boolean(minDate && displayed.subtract(1, "month").endOf("month").isBefore(minDate, "day"));
1527
+ const nextDisabled = Boolean(maxDate && displayed.add(columns, "month").startOf("month").isAfter(maxDate, "day"));
1528
+ return /* @__PURE__ */ jsxs9("div", { className: "sw:flex sw:h-[44px] sw:w-[280px] sw:items-center sw:justify-between sw:px-[12px] sw:pt-[12px]", children: [
1529
+ /* @__PURE__ */ jsxs9("div", { className: "sw:flex sw:gap-[8px]", children: [
1530
+ /* @__PURE__ */ jsx25(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) => {
1531
+ if (next)
1532
+ changeMonth(month.year(Number(next)).subtract(index, "month").format("YYYY-MM-DD"));
1533
+ } }),
1534
+ /* @__PURE__ */ jsx25(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) => {
1535
+ if (next)
1536
+ changeMonth(month.month(Number(next) - 1).subtract(index, "month").format("YYYY-MM-DD"));
1537
+ } })
1538
+ ] }),
1539
+ /* @__PURE__ */ jsxs9("div", { className: "sw:flex", children: [
1540
+ /* @__PURE__ */ jsx25(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__ */ jsx25(ChevronLeft, {}) }),
1541
+ /* @__PURE__ */ jsx25(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__ */ jsx25(ChevronRight, {}) })
1542
+ ] })
1543
+ ] }, index);
1544
+ }) }),
1545
+ /* @__PURE__ */ jsx25("div", { className: cx17("sw:pt-[12px]", !withFooter && "sw:pb-[12px]"), children: /* @__PURE__ */ jsx25(DatesProvider, { settings: { ...ctx, consistentWeeks: true }, children: /* @__PURE__ */ jsx25(MantineDatePicker2, { ...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) }) }) }),
1546
+ withFooter && /* @__PURE__ */ jsx25("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__ */ jsx25(Button3, { 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__ */ jsx25(Button3, { radius: 4, disabled: isDateShortcutDisabled(today, { minDate, maxDate, excludeDate, getDayProps: props.getDayProps }), fullWidth: true, classNames: dateShortcutClasses, onClick: () => selectShortcut(today), children: "\u4ECA\u5929" }) })
1547
+ ] });
1548
+ }
1549
+ var DatePicker = forwardRef17(DatePickerInner);
1550
+
1551
+ // src/components/TimePicker/TimePicker.tsx
1552
+ import { forwardRef as forwardRef18 } from "react";
1553
+ import cx18 from "clsx";
1554
+ import { Clock } from "lucide-react";
1555
+ import { useUncontrolled as useUncontrolled3 } from "@s-works/s-works-ui/hooks";
1556
+ import { TimePicker as MantineTimePicker } from "@s-works/s-works-ui/dates";
1557
+ import { jsx as jsx26 } from "react/jsx-runtime";
1558
+ var timePickerSizes = {
1559
+ sm: { input: "sw:h-[32px] sw:ps-[8px]", radius: 6, section: 32 },
1560
+ md: { input: "sw:h-[40px] sw:ps-[12px]", radius: 8, section: 40 }
1561
+ };
1562
+ function resolveTimePickerClassNames(size, appearance, overrides = {}) {
1563
+ return {
1564
+ ...overrides,
1565
+ root: cx18("sw:min-w-0 sw:[font-family:PingFang_SC,sans-serif] sw:tracking-[0px]", overrides.root),
1566
+ input: cx18("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),
1567
+ fieldsGroup: cx18("sw:h-[24px]", overrides.fieldsGroup),
1568
+ field: cx18("sw:min-w-[24px] sw:rounded-[4px] sw:text-inherit sw:disabled:text-[#bfbfbf] sw:focus:bg-[#165dff] sw:focus:text-white", overrides.field),
1569
+ section: cx18("sw:text-[#8c8c8c] sw:data-[position=right]:end-0", overrides.section),
1570
+ dropdown: cx18("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),
1571
+ control: cx18("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),
1572
+ presetControl: cx18("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)
1573
+ };
1574
+ }
1575
+ var TimePicker = forwardRef18(({ size = "md", appearance = "filled", withDropdown = true, classNames, popoverProps, rightSection, clearButtonProps, ...props }, ref) => {
1576
+ const [opened, setOpened] = useUncontrolled3({
1577
+ value: popoverProps?.opened,
1578
+ defaultValue: popoverProps?.defaultOpened ?? false,
1579
+ onChange: popoverProps?.onChange
1580
+ });
1581
+ const canOpen = withDropdown && !props.disabled && !props.readOnly && !popoverProps?.disabled;
1582
+ const showClock = rightSection === void 0 && !props.clearable;
1583
+ const openDropdown = () => {
1584
+ if (canOpen && !opened)
1585
+ setOpened(true);
1586
+ };
1587
+ return /* @__PURE__ */ jsx26(MantineTimePicker, { 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__ */ jsx26(Clock, { size: 16, "aria-hidden": true }) : rightSection, popoverProps: {
1588
+ withinPortal: false,
1589
+ floatingStrategy: "fixed",
1590
+ ...popoverProps,
1591
+ opened: canOpen && opened,
1592
+ onChange: setOpened
1593
+ }, onClickCapture: (event) => {
1594
+ props.onClickCapture?.(event);
1595
+ if (!event.defaultPrevented)
1596
+ openDropdown();
1597
+ }, onFocusCapture: (event) => {
1598
+ props.onFocusCapture?.(event);
1599
+ openDropdown();
1600
+ }, onBlurCapture: (event) => {
1601
+ props.onBlurCapture?.(event);
1602
+ if (opened && !event.currentTarget.contains(event.relatedTarget))
1603
+ setOpened(false);
1604
+ }, onKeyDown: (event) => {
1605
+ props.onKeyDown?.(event);
1606
+ if (event.key !== "Escape" || event.defaultPrevented || event.nativeEvent.isComposing || event.keyCode === 229 || !canOpen || !opened || popoverProps?.closeOnEscape === false)
1607
+ return;
1608
+ event.preventDefault();
1609
+ event.stopPropagation();
1610
+ setOpened(false);
1611
+ popoverProps?.onDismiss?.();
1612
+ }, classNames: (theme, values, context) => resolveTimePickerClassNames(size, appearance, typeof classNames === "function" ? classNames(theme, values, context) : classNames) });
1613
+ });
1614
+ TimePicker.displayName = "SWorks/TimePicker";
1615
+
1616
+ // src/components/Tabs/Tabs.tsx
1617
+ import { forwardRef as forwardRef19 } from "react";
1618
+ import cx19 from "clsx";
1619
+ import { Tabs as MantineTabs } from "@s-works/s-works-ui/core";
1620
+ import { jsx as jsx27 } from "react/jsx-runtime";
1621
+ function resolveTabsClassNames({ variant = "default" } = {}, overrides = {}) {
1622
+ return {
1623
+ ...overrides,
1624
+ root: cx19("sw:min-w-0 sw:max-w-full sw:[font-family:PingFang_SC,sans-serif] sw:tracking-[0px]", overrides.root),
1625
+ list: cx19("sw:max-w-full sw:flex-nowrap sw:overflow-x-auto sw:before:hidden", variant === "pills" ? "sw:gap-[12px]" : "sw:gap-[16px]", overrides.list),
1626
+ tab: cx19("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),
1627
+ tabLabel: cx19("sw:leading-[inherit]", overrides.tabLabel),
1628
+ tabSection: cx19("sw:data-[position=left]:me-[8px] sw:data-[position=right]:ms-[8px]", overrides.tabSection),
1629
+ panel: cx19("sw:min-w-0", overrides.panel)
1630
+ };
1631
+ }
1632
+ var TabsRoot = forwardRef19(({ variant = "default", classNames, ...props }, ref) => /* @__PURE__ */ jsx27(MantineTabs, { ref, ...props, variant, classNames: (theme, values, context) => resolveTabsClassNames({ variant }, typeof classNames === "function" ? classNames(theme, values, context) : classNames) }));
1633
+ TabsRoot.displayName = "SWorks/Tabs";
1634
+ var Tabs = Object.assign(TabsRoot, {
1635
+ List: MantineTabs.List,
1636
+ Tab: MantineTabs.Tab,
1637
+ Panel: MantineTabs.Panel
1638
+ });
1639
+
1640
+ // src/components/TagsInput/TagsInput.tsx
1641
+ import { forwardRef as forwardRef20 } from "react";
1642
+ import cx20 from "clsx";
1643
+ import { Combobox, OptionsDropdown, Pill, PillsInput } from "@s-works/s-works-ui/core";
1644
+
1645
+ // src/components/TagsInput/controller.tsx
1646
+ import { useEffect as useEffect6, useRef as useRef6 } from "react";
1647
+ import { extractStyleProps, getParsedComboboxData, getOptionsLockup, useCombobox, useMantineTheme } from "@s-works/s-works-ui/core";
1648
+ import { useId as useId4, useMergedRef, useUncontrolled as useUncontrolled4 } from "@s-works/s-works-ui/hooks";
1649
+ import { Fragment as Fragment4, jsx as jsx28 } from "react/jsx-runtime";
1650
+ function useTagsInputController(props, ref) {
1651
+ 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;
1652
+ const { styleProps, rest: { type: _type, ...fieldRest } } = extractStyleProps(others);
1653
+ const theme = useMantineTheme();
1654
+ const overrides = typeof classNames === "function" ? classNames(theme, props, void 0) : classNames;
1655
+ const [tags, setTags] = useUncontrolled4({ value, defaultValue, finalValue: [], onChange });
1656
+ const [search, setSearch] = useUncontrolled4({
1657
+ value: searchValue,
1658
+ defaultValue: defaultSearchValue,
1659
+ finalValue: "",
1660
+ onChange: onSearchChange
1661
+ });
1662
+ const inputRef = useRef6(null), fieldRef = useMergedRef(inputRef, ref), inputId = useId4(id);
1663
+ const ownStore = useCombobox({
1664
+ opened: dropdownOpened,
1665
+ defaultOpened: defaultDropdownOpened,
1666
+ onDropdownOpen: () => {
1667
+ onDropdownOpen?.();
1668
+ if (selectFirstOptionOnDropdownOpen)
1669
+ ownStore.selectFirstOption();
1670
+ },
1671
+ onDropdownClose: () => {
1672
+ onDropdownClose?.();
1673
+ ownStore.resetSelectedOption();
1674
+ }
1675
+ });
1676
+ const store = comboboxProps?.store ?? ownStore;
1677
+ const setSearchValue = (text) => {
1678
+ setSearch(text);
1679
+ store.resetSelectedOption();
1680
+ };
1681
+ const duplicate = (tag, current) => isDuplicate ? isDuplicate(tag, current) : current.some((t) => t.toLowerCase() === tag.toLowerCase());
1682
+ const append = (items, submit2 = false) => {
1683
+ if (disabled || readOnly)
1684
+ return;
1685
+ const next = [...tags];
1686
+ for (const raw of items) {
1687
+ const tag = raw.trim();
1688
+ if (!tag)
1689
+ continue;
1690
+ const repeated = duplicate(tag, next);
1691
+ if (repeated) {
1692
+ onDuplicate?.(tag);
1693
+ if (!allowDuplicates)
1694
+ continue;
1695
+ }
1696
+ if (next.length >= maxTags)
1697
+ break;
1698
+ next.push(tag);
1699
+ if (submit2)
1700
+ onOptionSubmit?.(tag);
1701
+ }
1702
+ if (next.length !== tags.length)
1703
+ setTags(next);
1704
+ setSearchValue("");
1705
+ };
1706
+ const split = (text) => {
1707
+ if (!splitChars.length)
1708
+ return [text];
1709
+ const escaped = splitChars.map((char) => char.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"));
1710
+ return text.split(new RegExp(escaped.join("|")));
1711
+ };
1712
+ const remove = (index) => {
1713
+ if (disabled || readOnly)
1714
+ return;
1715
+ onRemove?.(tags[index]);
1716
+ setTags(tags.filter((_, i) => i !== index));
1717
+ inputRef.current?.focus();
1718
+ };
1719
+ const parsed = getParsedComboboxData(data), lookup = getOptionsLockup(parsed);
1720
+ const available = (items) => items.flatMap((item) => {
1721
+ if ("group" in item) {
1722
+ const children = available(item.items);
1723
+ return children.length ? [{ ...item, items: children }] : [];
1724
+ }
1725
+ return tags.some((t) => t.toLowerCase() === item.label.toLowerCase()) ? [] : [item];
1726
+ });
1727
+ const options = available(parsed);
1728
+ useEffect6(() => {
1729
+ if (selectFirstOptionOnChange)
1730
+ store.selectFirstOption();
1731
+ }, [search, tags, selectFirstOptionOnChange, store]);
1732
+ const submit = (selected) => {
1733
+ if (!disabled && !readOnly && lookup[selected] && !lookup[selected].disabled)
1734
+ append([lookup[selected].label], true);
1735
+ };
1736
+ const rootProps = {
1737
+ ...styleProps,
1738
+ label,
1739
+ description,
1740
+ error,
1741
+ required,
1742
+ withAsterisk,
1743
+ labelProps,
1744
+ descriptionProps,
1745
+ errorProps,
1746
+ wrapperProps,
1747
+ inputContainer,
1748
+ inputWrapperOrder,
1749
+ withErrorStyles,
1750
+ leftSection,
1751
+ leftSectionWidth,
1752
+ leftSectionPointerEvents,
1753
+ leftSectionProps,
1754
+ rightSection,
1755
+ rightSectionWidth,
1756
+ rightSectionPointerEvents,
1757
+ rightSectionProps,
1758
+ radius,
1759
+ mod,
1760
+ attributes,
1761
+ unstyled,
1762
+ variant,
1763
+ vars: vars ? (_theme, _props, ctx) => vars(_theme, { ...props, classNames: void 0 }, ctx) : void 0,
1764
+ className,
1765
+ style,
1766
+ styles: typeof styles === "function" ? styles(theme, { ...props, classNames: void 0 }, void 0) : styles,
1767
+ disabled,
1768
+ id: inputId
1769
+ };
1770
+ const fieldProps = {
1771
+ ...fieldRest,
1772
+ id: inputId,
1773
+ ref: fieldRef,
1774
+ value: search,
1775
+ disabled,
1776
+ readOnly,
1777
+ required: required && tags.length === 0,
1778
+ onChange: (event) => {
1779
+ setSearchValue(event.currentTarget.value);
1780
+ store.openDropdown();
1781
+ },
1782
+ onFocus: (event) => {
1783
+ onFocus?.(event);
1784
+ if (openOnFocus && !disabled && !readOnly)
1785
+ store.openDropdown();
1786
+ },
1787
+ onBlur: (event) => {
1788
+ onBlur?.(event);
1789
+ if (acceptValueOnBlur)
1790
+ append([search], true);
1791
+ store.closeDropdown();
1792
+ },
1793
+ onKeyDown: (event) => {
1794
+ onKeyDown?.(event);
1795
+ if (event.defaultPrevented || event.isPropagationStopped() || event.nativeEvent.isComposing || disabled || readOnly)
1796
+ return;
1797
+ if (event.key === "Enter" && search.trim() && store.getSelectedOptionIndex() < 0) {
1798
+ event.preventDefault();
1799
+ append([search], true);
1800
+ }
1801
+ if (splitChars.includes(event.key) && search.trim()) {
1802
+ event.preventDefault();
1803
+ append(split(search));
1804
+ }
1805
+ if (event.key === "Backspace" && !search && tags.length)
1806
+ remove(tags.length - 1);
1807
+ },
1808
+ onPaste: (event) => {
1809
+ onPaste?.(event);
1810
+ if (event.defaultPrevented || disabled || readOnly)
1811
+ return;
1812
+ event.preventDefault();
1813
+ append(split(search + event.clipboardData.getData("text/plain")));
1814
+ }
1815
+ };
1816
+ return {
1817
+ props,
1818
+ size,
1819
+ overrides,
1820
+ tags,
1821
+ search,
1822
+ store,
1823
+ rootProps,
1824
+ fieldProps,
1825
+ options,
1826
+ filter,
1827
+ limit,
1828
+ withScrollArea,
1829
+ maxDropdownHeight,
1830
+ scrollAreaProps,
1831
+ renderOption,
1832
+ comboboxProps,
1833
+ submit,
1834
+ remove,
1835
+ clearable: clearable && tags.length > 0 && !disabled && !readOnly,
1836
+ clearButtonProps,
1837
+ clear: () => {
1838
+ setTags([]);
1839
+ setSearchValue("");
1840
+ inputRef.current?.focus();
1841
+ onClear?.();
1842
+ },
1843
+ hiddenInputProps: {
1844
+ name,
1845
+ form,
1846
+ value: tags,
1847
+ valuesDivider: hiddenInputValuesDivider,
1848
+ disabled,
1849
+ ...hiddenInputProps
1850
+ }
1851
+ };
1852
+ }
1853
+ function TagsInputController({ fieldRef, render, ...props }) {
1854
+ return /* @__PURE__ */ jsx28(Fragment4, { children: render(useTagsInputController(props, fieldRef)) });
1855
+ }
1856
+
1857
+ // src/components/TagsInput/icons.tsx
1858
+ import { jsx as jsx29 } from "react/jsx-runtime";
1859
+ function ChevronLarge(props) {
1860
+ return /* @__PURE__ */ jsx29("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__ */ jsx29("g", { children: /* @__PURE__ */ jsx29("g", { children: /* @__PURE__ */ jsx29("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" }) }) }) });
1861
+ }
1862
+ function ChevronMedium(props) {
1863
+ return /* @__PURE__ */ jsx29("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__ */ jsx29("g", { children: /* @__PURE__ */ jsx29("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" }) }) });
1864
+ }
1865
+ function ChevronSmall(props) {
1866
+ return /* @__PURE__ */ jsx29("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__ */ jsx29("g", { children: /* @__PURE__ */ jsx29("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" }) }) });
1867
+ }
1868
+ function CloseVector(props) {
1869
+ return /* @__PURE__ */ jsx29("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__ */ jsx29("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" }) });
1870
+ }
1871
+ function CloseSmall(props) {
1872
+ return /* @__PURE__ */ jsx29("svg", { width: "16", height: "16", viewBox: "0 0 16 16", "aria-hidden": "true", ...props, children: /* @__PURE__ */ jsx29("g", { transform: "translate(4.834526538848877 4.834324836730957)", children: /* @__PURE__ */ jsx29(CloseVector, {}) }) });
1873
+ }
1874
+ function CloseVectorSmall() {
1875
+ return /* @__PURE__ */ jsx29("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__ */ jsx29("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" }) });
1876
+ }
1877
+ function CloseSmallTwelve(props) {
1878
+ return /* @__PURE__ */ jsx29("svg", { width: "12", height: "12", viewBox: "0 0 12 12", "aria-hidden": "true", ...props, children: /* @__PURE__ */ jsx29("g", { transform: "translate(3.6258950233459473 3.6257436275482178)", children: /* @__PURE__ */ jsx29(CloseVectorSmall, {}) }) });
1879
+ }
1880
+
1881
+ // src/components/TagsInput/TagsInput.tsx
1882
+ import { Fragment as Fragment5, jsx as jsx30, jsxs as jsxs10 } from "react/jsx-runtime";
1883
+ var dimensions = {
1884
+ lg: {
1885
+ w: 320,
1886
+ radius: 8,
1887
+ section: 42,
1888
+ remove: "sw:h-[16px] sw:w-[16px] sw:min-w-[16px] sw:disabled:h-[16px] sw:disabled:w-[16px] sw:disabled:min-w-[16px]",
1889
+ pillHeight: 32,
1890
+ pillSize: 14,
1891
+ input: "sw:h-[48px] sw:pe-[38px]",
1892
+ padding: "sw:ps-[8px]",
1893
+ iconPadding: "sw:ps-[38px]",
1894
+ pill: "sw:gap-[12px] sw:rounded-[3px] sw:px-[12px]",
1895
+ label: "sw:text-[14px] sw:leading-[22px]",
1896
+ field: "sw:h-[22px] sw:text-[14px] sw:leading-[22px]",
1897
+ chevron: "sw:h-[18px] sw:w-[18px]",
1898
+ border: "sw:shadow-[inset_0_0_0_1px_rgba(0,0,0,0.12)]"
1899
+ },
1900
+ md: {
1901
+ w: 280,
1902
+ radius: 6,
1903
+ section: 32,
1904
+ remove: "sw:h-[16px] sw:w-[16px] sw:min-w-[16px] sw:disabled:h-[16px] sw:disabled:w-[16px] sw:disabled:min-w-[16px]",
1905
+ pillHeight: 24,
1906
+ pillSize: 12,
1907
+ input: "sw:h-[40px] sw:pe-[32px] sw:data-[disabled]:pe-[36px]",
1908
+ padding: "sw:ps-[8px]",
1909
+ iconPadding: "sw:ps-[32px]",
1910
+ pill: "sw:gap-[8px] sw:rounded-[3px] sw:px-[8px]",
1911
+ label: "sw:text-[12px] sw:leading-[20px] sw:group-data-[disabled]/tag:leading-[18px]",
1912
+ field: "sw:h-[20px] sw:text-[12px] sw:leading-[20px]",
1913
+ chevron: "sw:h-[16px] sw:w-[16px]",
1914
+ border: "sw:shadow-[inset_0_0_0_1px_#dedede]"
1915
+ },
1916
+ sm: {
1917
+ w: 240,
1918
+ radius: 6,
1919
+ section: 30,
1920
+ remove: "sw:h-[12px] sw:w-[12px] sw:min-w-[12px] sw:disabled:h-[12px] sw:disabled:w-[12px] sw:disabled:min-w-[12px]",
1921
+ pillHeight: 20,
1922
+ pillSize: 12,
1923
+ input: "sw:h-[32px] sw:pe-[30px]",
1924
+ padding: "sw:ps-[6px]",
1925
+ iconPadding: "sw:ps-[30px]",
1926
+ pill: "sw:gap-[4px] sw:px-[4px] sw:data-[disabled]:rounded-[3px]",
1927
+ label: "sw:text-[12px] sw:leading-[20px] sw:group-data-[disabled]/tag:leading-[18px]",
1928
+ field: "sw:h-[20px] sw:text-[12px] sw:leading-[20px]",
1929
+ chevron: "sw:h-[14px] sw:w-[14px]",
1930
+ border: "sw:shadow-[inset_0_0_0_1px_#dedede]"
1931
+ }
1932
+ };
1933
+ function resolveTagsInputProps({ size = "md", ...props } = {}) {
1934
+ return {
1935
+ w: dimensions[size].w,
1936
+ maw: "100%",
1937
+ ...props,
1938
+ size,
1939
+ radius: props.radius ?? dimensions[size].radius,
1940
+ leftSectionWidth: props.leftSectionWidth ?? dimensions[size].section,
1941
+ rightSectionWidth: props.rightSectionWidth ?? (size === "md" && props.disabled ? 40 : dimensions[size].section),
1942
+ rightSectionPointerEvents: props.rightSectionPointerEvents ?? "none"
1943
+ };
1944
+ }
1945
+ function resolveTagsInputClassNames({ size = "md", hasLeftSection = false } = {}, overrides = {}) {
1946
+ return {
1947
+ ...overrides,
1948
+ root: cx20("sw:group/tags sw:min-w-0 sw:[font-family:PingFang_SC,sans-serif] sw:tracking-[0px]", overrides.root),
1949
+ input: cx20("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),
1950
+ pillsList: cx20("sw:w-full sw:min-w-0 sw:flex-nowrap sw:gap-[4px] sw:overflow-x-auto sw:[scrollbar-width:none]", overrides.pillsList),
1951
+ pill: cx20("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),
1952
+ pillLabel: cx20("sw:h-auto sw:font-normal", dimensions[size].label, overrides.pillLabel),
1953
+ pillRemove: cx20("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),
1954
+ inputField: cx20("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),
1955
+ section: cx20("sw:text-[#bfbfbf] sw:data-[position=right]:end-0 sw:data-[position=left]:start-0", overrides.section),
1956
+ dropdown: cx20("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),
1957
+ options: cx20("sw:p-0", overrides.options),
1958
+ option: cx20("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)
1959
+ };
1960
+ }
1961
+ var TagsInput = forwardRef20((props, ref) => /* @__PURE__ */ jsx30(TagsInputController, { ...props, fieldRef: ref, render: (ctx) => {
1962
+ const classes = resolveTagsInputClassNames({ size: ctx.size, hasLeftSection: Boolean(ctx.rootProps.leftSection) }, ctx.overrides);
1963
+ const d = dimensions[ctx.size];
1964
+ return /* @__PURE__ */ jsxs10(Fragment5, { children: [
1965
+ /* @__PURE__ */ jsxs10(Combobox, { store: ctx.store, onOptionSubmit: ctx.submit, readOnly: ctx.props.readOnly, offset: 4, ...ctx.comboboxProps, classNames: classes, children: [
1966
+ /* @__PURE__ */ jsx30(Combobox.DropdownTarget, { children: /* @__PURE__ */ jsx30(PillsInput, { ...resolveTagsInputProps({ ...ctx.rootProps, size: ctx.size }), classNames: classes, rightSection: ctx.clearable ? /* @__PURE__ */ jsx30(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__ */ jsx30("span", { "aria-hidden": "true", className: cx20("sw:flex sw:items-center sw:justify-center", d.chevron), children: ctx.size === "lg" ? /* @__PURE__ */ jsx30(ChevronLarge, {}) : ctx.size === "md" ? /* @__PURE__ */ jsx30(ChevronMedium, {}) : /* @__PURE__ */ jsx30(ChevronSmall, {}) }) : ctx.rootProps.rightSection, onClick: () => {
1967
+ if (!ctx.props.disabled && !ctx.props.readOnly)
1968
+ ctx.store.openDropdown();
1969
+ }, children: /* @__PURE__ */ jsxs10(Pill.Group, { classNames: { group: classes.pillsList }, children: [
1970
+ ctx.tags.map((tag, index) => /* @__PURE__ */ jsx30(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: {
1971
+ root: classes.pill,
1972
+ label: classes.pillLabel,
1973
+ remove: classes.pillRemove
1974
+ }, removeButtonProps: {
1975
+ icon: ctx.size === "sm" ? /* @__PURE__ */ jsx30(CloseSmallTwelve, { className: "sw:block" }) : /* @__PURE__ */ jsx30(CloseSmall, { className: "sw:block" }),
1976
+ "aria-label": "\u5220\u9664\u6807\u7B7E " + tag,
1977
+ "aria-hidden": false,
1978
+ disabled: ctx.props.disabled,
1979
+ tabIndex: ctx.props.disabled ? -1 : 0
1980
+ }, children: tag }, tag + "-" + index)),
1981
+ /* @__PURE__ */ jsx30(Combobox.EventsTarget, { autoComplete: ctx.fieldProps.autoComplete, children: /* @__PURE__ */ jsx30(PillsInput.Field, { ...ctx.fieldProps, classNames: { field: classes.inputField } }) })
1982
+ ] }) }) }),
1983
+ /* @__PURE__ */ jsx30(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 })
1984
+ ] }),
1985
+ /* @__PURE__ */ jsx30(Combobox.HiddenInput, { ...ctx.hiddenInputProps })
1986
+ ] });
1987
+ } }));
1988
+ TagsInput.displayName = "SWorks/TagsInput";
1989
+
1990
+ // src/components/InputBase/InputBase.tsx
1991
+ import { forwardRef as forwardRef21 } from "react";
1992
+ import cx21 from "clsx";
1993
+ import { createPolymorphicComponent as createPolymorphicComponent2, InputBase as MantineInputBase } from "@s-works/s-works-ui/core";
1994
+ import { jsx as jsx31 } from "react/jsx-runtime";
1995
+ var sizes2 = {
1996
+ lg: {
1997
+ input: "sw:h-[48px] sw:text-[16px] sw:leading-[24px]",
1998
+ padding: "sw:ps-[16px]",
1999
+ end: "sw:pe-[16px]",
2000
+ left: "sw:ps-[44px] sw:focus:ps-[40px]",
2001
+ right: "sw:pe-[44px]",
2002
+ radius: 8,
2003
+ section: 48
2004
+ },
2005
+ md: {
2006
+ input: "sw:h-[40px] sw:text-[14px] sw:leading-[22px]",
2007
+ padding: "sw:ps-[12px]",
2008
+ end: "sw:pe-[12px]",
2009
+ left: "sw:ps-[36px]",
2010
+ right: "sw:pe-[36px]",
2011
+ radius: 8,
2012
+ section: 40
2013
+ },
2014
+ sm: {
2015
+ input: "sw:h-[32px] sw:text-[14px] sw:leading-[22px]",
2016
+ padding: "sw:ps-[8px]",
2017
+ end: "sw:pe-[8px]",
2018
+ left: "sw:ps-[32px]",
2019
+ right: "sw:pe-[32px]",
2020
+ radius: 6,
2021
+ section: 32
2022
+ }
2023
+ };
2024
+ var appearances3 = {
2025
+ 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]",
2026
+ 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]"
2027
+ };
2028
+ function resolveInputBaseProps({ size = "md", appearance: _appearance, ...props } = {}) {
2029
+ return {
2030
+ w: 220,
2031
+ maw: "100%",
2032
+ ...props,
2033
+ size,
2034
+ radius: props.radius ?? sizes2[size].radius,
2035
+ leftSectionWidth: props.leftSectionWidth ?? sizes2[size].section,
2036
+ rightSectionWidth: props.rightSectionWidth ?? sizes2[size].section,
2037
+ leftSectionPointerEvents: props.leftSectionPointerEvents ?? "none",
2038
+ inputWrapperOrder: props.inputWrapperOrder ?? ["label", "input", "description", "error"]
2039
+ };
2040
+ }
2041
+ function resolveInputBaseClassNames({ size = "md", appearance = "filled", hasLeftSection = false, hasRightSection = false, disabled = false } = {}, overrides = {}) {
2042
+ return {
2043
+ ...overrides,
2044
+ root: cx21("sw:group/base sw:min-w-0 sw:[font-family:PingFang_SC,sans-serif] sw:tracking-[0px]", overrides.root),
2045
+ wrapper: cx21("sw:mb-0", overrides.wrapper),
2046
+ input: cx21("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),
2047
+ section: cx21("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),
2048
+ description: cx21("sw:mb-0 sw:mt-[4px] sw:text-[12px] sw:font-normal sw:leading-[18px] sw:text-[#8c8c8c]", overrides.description),
2049
+ error: cx21("sw:mt-[4px] sw:text-[12px] sw:leading-[18px] sw:text-[#ff4d4f]", overrides.error)
2050
+ };
2051
+ }
2052
+ var InputBaseRoot = forwardRef21(({ size = "md", appearance = "filled", classNames, ...props }, ref) => /* @__PURE__ */ jsx31(MantineInputBase, { ref, ...resolveInputBaseProps({ size, ...props }), classNames: (theme, values, context) => resolveInputBaseClassNames({
2053
+ size,
2054
+ appearance,
2055
+ disabled: props.disabled,
2056
+ hasLeftSection: Boolean(props.leftSection),
2057
+ hasRightSection: Boolean(props.rightSection)
2058
+ }, typeof classNames === "function" ? classNames(theme, values, context) : classNames) }));
2059
+ InputBaseRoot.displayName = "SWorks/InputBase";
2060
+ var InputBase = createPolymorphicComponent2(InputBaseRoot);
2061
+
2062
+ // src/components/Tag/Tag.tsx
2063
+ import { forwardRef as forwardRef22 } from "react";
2064
+ import cx22 from "clsx";
2065
+ import { Badge as MantineBadge, CloseButton, createPolymorphicComponent as createPolymorphicComponent3 } from "@s-works/s-works-ui/core";
2066
+
2067
+ // src/components/Tag/icons.tsx
2068
+ import { jsx as jsx32 } from "react/jsx-runtime";
2069
+ function CloseVector2(props) {
2070
+ return /* @__PURE__ */ jsx32("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__ */ jsx32("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" }) });
2071
+ }
2072
+ function TagCloseIcon(props) {
2073
+ return /* @__PURE__ */ jsx32("svg", { width: "16", height: "16", viewBox: "0 0 16 16", "aria-hidden": "true", ...props, children: /* @__PURE__ */ jsx32("g", { transform: "translate(4.834526538848877 4.834324836730957)", children: /* @__PURE__ */ jsx32(CloseVector2, {}) }) });
2074
+ }
2075
+
2076
+ // src/components/Tag/Tag.tsx
2077
+ import { jsx as jsx33 } from "react/jsx-runtime";
2078
+ var sizes3 = {
2079
+ lg: {
2080
+ h: 32,
2081
+ fz: 14,
2082
+ px: 12,
2083
+ line: "sw:leading-[22px]",
2084
+ start: "me-[8px]",
2085
+ end: "ms-[8px]",
2086
+ r: { base: 4, rounded: 6, pill: 16 }
2087
+ },
2088
+ md: {
2089
+ h: 24,
2090
+ fz: 12,
2091
+ px: 8,
2092
+ line: "sw:leading-[18px]",
2093
+ start: "me-[4px]",
2094
+ end: "ms-[4px]",
2095
+ r: { base: 3, rounded: 6, pill: 12 }
2096
+ },
2097
+ sm: {
2098
+ h: 20,
2099
+ fz: 12,
2100
+ px: 6,
2101
+ line: "sw:leading-[18px]",
2102
+ start: "me-[4px]",
2103
+ end: "ms-[4px]",
2104
+ r: { base: 3, rounded: 4, pill: 12 }
2105
+ }
2106
+ };
2107
+ var palette = {
2108
+ neutral: {
2109
+ filled: {
2110
+ normal: "sw:text-[#262626] sw:bg-[#f2f3f5] sw:shadow-none",
2111
+ disabled: "sw:text-[#bfbfbf] sw:bg-[#f2f3f5] sw:shadow-none"
2112
+ },
2113
+ outline: {
2114
+ normal: "sw:text-[#262626] sw:bg-transparent sw:shadow-[inset_0_0_0_1px_rgba(0,0,0,0.08)]",
2115
+ disabled: "sw:text-[#bfbfbf] sw:bg-transparent sw:shadow-[inset_0_0_0_1px_rgba(0,0,0,0.05)]"
2116
+ },
2117
+ soft: {
2118
+ normal: "sw:text-[#262626] sw:bg-[#f5f5f5] sw:shadow-[inset_0_0_0_1px_rgba(0,0,0,0.08)]",
2119
+ disabled: "sw:text-[#bfbfbf] sw:bg-[#f5f5f5] sw:shadow-[inset_0_0_0_1px_rgba(0,0,0,0.05)]"
2120
+ },
2121
+ light: {
2122
+ normal: "sw:text-[#262626] sw:bg-[#f5f5f5] sw:shadow-none",
2123
+ disabled: "sw:text-[#bfbfbf] sw:bg-[#f5f5f5] sw:shadow-none"
2124
+ }
2125
+ },
2126
+ primary: {
2127
+ filled: {
2128
+ normal: "sw:text-white sw:bg-[#165dff] sw:shadow-none",
2129
+ disabled: "sw:text-white sw:bg-[#adc6ff] sw:shadow-none"
2130
+ },
2131
+ outline: {
2132
+ normal: "sw:text-[#165dff] sw:bg-transparent sw:shadow-[inset_0_0_0_1px_currentColor]",
2133
+ disabled: "sw:text-[#adc6ff] sw:bg-transparent sw:shadow-[inset_0_0_0_1px_currentColor]"
2134
+ },
2135
+ soft: {
2136
+ normal: "sw:text-[#165dff] sw:bg-[#f3f7ff] sw:shadow-[inset_0_0_0_1px_currentColor]",
2137
+ disabled: "sw:text-[#adc6ff] sw:bg-[#f3f7ff] sw:shadow-[inset_0_0_0_1px_currentColor]"
2138
+ },
2139
+ light: {
2140
+ normal: "sw:text-[#165dff] sw:bg-[#f3f7ff] sw:shadow-none",
2141
+ disabled: "sw:text-[#adc6ff] sw:bg-[#f3f7ff] sw:shadow-none"
2142
+ }
2143
+ },
2144
+ success: {
2145
+ filled: {
2146
+ normal: "sw:text-white sw:bg-[#0dc15b] sw:shadow-none",
2147
+ disabled: "sw:text-white sw:bg-[#b6ecce] sw:shadow-none"
2148
+ },
2149
+ outline: {
2150
+ normal: "sw:text-[#0dc15b] sw:bg-transparent sw:shadow-[inset_0_0_0_1px_currentColor]",
2151
+ disabled: "sw:text-[#b6ecce] sw:bg-transparent sw:shadow-[inset_0_0_0_1px_currentColor]"
2152
+ },
2153
+ soft: {
2154
+ normal: "sw:text-[#0dc15b] sw:bg-[#e7f9ef] sw:shadow-[inset_0_0_0_1px_currentColor]",
2155
+ disabled: "sw:text-[#b6ecce] sw:bg-[#e7f9ef] sw:shadow-[inset_0_0_0_1px_currentColor]"
2156
+ },
2157
+ light: {
2158
+ normal: "sw:text-[#0dc15b] sw:bg-[#e7f9ef] sw:shadow-none",
2159
+ disabled: "sw:text-[#b6ecce] sw:bg-[#e7f9ef] sw:shadow-none"
2160
+ }
2161
+ },
2162
+ error: {
2163
+ filled: {
2164
+ normal: "sw:text-white sw:bg-[#fa8c16] sw:shadow-none",
2165
+ disabled: "sw:text-white sw:bg-[#fdd7ad] sw:shadow-none"
2166
+ },
2167
+ outline: {
2168
+ normal: "sw:text-[#fa8c16] sw:bg-transparent sw:shadow-[inset_0_0_0_1px_currentColor]",
2169
+ disabled: "sw:text-[#fdd7ad] sw:bg-transparent sw:shadow-[inset_0_0_0_1px_currentColor]"
2170
+ },
2171
+ soft: {
2172
+ normal: "sw:text-[#fa8c16] sw:bg-[#fff9f3] sw:shadow-[inset_0_0_0_1px_currentColor]",
2173
+ disabled: "sw:text-[#fdd7ad] sw:bg-[#fff9f3] sw:shadow-[inset_0_0_0_1px_currentColor]"
2174
+ },
2175
+ light: {
2176
+ normal: "sw:text-[#fa8c16] sw:bg-[#fff9f3] sw:shadow-none",
2177
+ disabled: "sw:text-[#fdd7ad] sw:bg-[#fff9f3] sw:shadow-none"
2178
+ }
2179
+ },
2180
+ warning: {
2181
+ filled: {
2182
+ normal: "sw:text-white sw:bg-[#f53f3f] sw:shadow-none",
2183
+ disabled: "sw:text-white sw:bg-[#fbbcbc] sw:shadow-none"
2184
+ },
2185
+ outline: {
2186
+ normal: "sw:text-[#f53f3f] sw:bg-transparent sw:shadow-[inset_0_0_0_1px_currentColor]",
2187
+ disabled: "sw:text-[#fbbcbc] sw:bg-transparent sw:shadow-[inset_0_0_0_1px_currentColor]"
2188
+ },
2189
+ soft: {
2190
+ normal: "sw:text-[#f53f3f] sw:bg-[#fef5f5] sw:shadow-[inset_0_0_0_1px_currentColor]",
2191
+ disabled: "sw:text-[#fbbcbc] sw:bg-[#fef5f5] sw:shadow-[inset_0_0_0_1px_currentColor]"
2192
+ },
2193
+ light: {
2194
+ normal: "sw:text-[#f53f3f] sw:bg-[#fef5f5] sw:shadow-none",
2195
+ disabled: "sw:text-[#fbbcbc] sw:bg-[#fef5f5] sw:shadow-none"
2196
+ }
2197
+ }
2198
+ };
2199
+ function resolveTagProps({ size = "md", shape = "base", tone: _tone, variant: _variant, disabled: _disabled, closable: _closable, onClose: _onClose, closeButtonProps: _close, ...props } = {}) {
2200
+ return {
2201
+ h: sizes3[size].h,
2202
+ fz: sizes3[size].fz,
2203
+ px: sizes3[size].px,
2204
+ ...props,
2205
+ size,
2206
+ radius: props.radius ?? sizes3[size].r[shape],
2207
+ variant: "default"
2208
+ };
2209
+ }
2210
+ function resolveTagClassNames({ size = "md", tone = "neutral", variant = "filled", disabled = false } = {}, overrides = {}) {
2211
+ return {
2212
+ ...overrides,
2213
+ root: cx22("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),
2214
+ label: cx22("sw:leading-[inherit]", overrides.label),
2215
+ section: cx22("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)
2216
+ };
2217
+ }
2218
+ function renderTagCloseButton({ disabled, onClose, closeButtonProps }) {
2219
+ return /* @__PURE__ */ jsx33(CloseButton, { size: 16, radius: 0, c: "inherit", variant: "transparent", ...closeButtonProps, icon: closeButtonProps?.icon ?? /* @__PURE__ */ jsx33(TagCloseIcon, {}), disabled: disabled || closeButtonProps?.disabled, "aria-label": closeButtonProps?.["aria-label"] ?? "\u79FB\u9664\u6807\u7B7E", classNames: (theme, values, context) => {
2220
+ const overrides = typeof closeButtonProps?.classNames === "function" ? closeButtonProps.classNames(theme, values, context) : closeButtonProps?.classNames;
2221
+ return {
2222
+ ...overrides,
2223
+ root: cx22("sw:p-0 sw:hover:bg-transparent sw:disabled:bg-transparent sw:disabled:opacity-100", overrides?.root)
2224
+ };
2225
+ }, onClick: (event) => {
2226
+ event.stopPropagation();
2227
+ if (disabled)
2228
+ return;
2229
+ closeButtonProps?.onClick?.(event);
2230
+ if (!event.defaultPrevented)
2231
+ onClose?.(event);
2232
+ } });
2233
+ }
2234
+ var TagRoot = forwardRef22(({ size = "md", tone = "neutral", variant = "filled", shape = "base", disabled = false, closable = false, onClose, closeButtonProps, classNames, onClick, onKeyDown, ...props }, ref) => /* @__PURE__ */ jsx33(MantineBadge, { 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) => {
2235
+ if (disabled) {
2236
+ event.preventDefault();
2237
+ event.stopPropagation();
2238
+ return;
2239
+ }
2240
+ onClick?.(event);
2241
+ }, onKeyDown: (event) => {
2242
+ if (disabled) {
2243
+ if (event.key === "Enter" || event.key === " ") {
2244
+ event.preventDefault();
2245
+ event.stopPropagation();
2246
+ }
2247
+ return;
2248
+ }
2249
+ onKeyDown?.(event);
2250
+ }, classNames: (theme, values, context) => resolveTagClassNames({ size, tone, variant, disabled }, typeof classNames === "function" ? classNames(theme, values, context) : classNames) }));
2251
+ TagRoot.displayName = "SWorks/Tag";
2252
+ var Tag = createPolymorphicComponent3(TagRoot);
2253
+
2254
+ // src/components/CloseButton/CloseButton.tsx
2255
+ import { forwardRef as forwardRef23 } from "react";
2256
+ import cx23 from "clsx";
2257
+ import { CloseButton as MantineCloseButton, createPolymorphicComponent as createPolymorphicComponent4, rem as rem2 } from "@s-works/s-works-ui/core";
2258
+
2259
+ // src/components/CloseButton/icons.tsx
2260
+ import { jsx as jsx34 } from "react/jsx-runtime";
2261
+ function CloseLargeIcon(props) {
2262
+ return /* @__PURE__ */ jsx34("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__ */ jsx34("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" }) });
2263
+ }
2264
+ function CloseMediumIcon(props) {
2265
+ return /* @__PURE__ */ jsx34("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__ */ jsx34("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" }) });
2266
+ }
2267
+ function CloseSmallIcon(props) {
2268
+ return /* @__PURE__ */ jsx34("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__ */ jsx34("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" }) });
2269
+ }
2270
+
2271
+ // src/components/CloseButton/CloseButton.tsx
2272
+ import { jsx as jsx35 } from "react/jsx-runtime";
2273
+ var closeButtonSizes = { lg: 24, md: 20, sm: 16 };
2274
+ function resolveCloseButtonProps({ size = "lg", radius, variant = "subtle", ...props }) {
2275
+ return {
2276
+ p: 0,
2277
+ "aria-label": "\u5173\u95ED",
2278
+ ...props,
2279
+ size: typeof size === "string" ? closeButtonSizes[size] ?? size : size,
2280
+ radius: radius ?? (size === "md" || size === 20 ? 5 : size === "sm" || size === 16 ? 4 : 6),
2281
+ variant
2282
+ };
2283
+ }
2284
+ function resolveCloseButtonIcon({ size = "lg", icon, iconSize }) {
2285
+ if (icon !== void 0)
2286
+ return icon;
2287
+ const Glyph = size === "md" || size === 20 ? CloseMediumIcon : size === "sm" || size === 16 ? CloseSmallIcon : CloseLargeIcon;
2288
+ return iconSize === void 0 ? /* @__PURE__ */ jsx35(Glyph, {}) : /* @__PURE__ */ jsx35(Glyph, { width: rem2(iconSize), height: rem2(iconSize) });
2289
+ }
2290
+ function resolveCloseButtonClassNames(overrides = {}) {
2291
+ return {
2292
+ root: cx23("sw:bg-transparent sw:text-[#262626] sw:[&[data-variant=subtle]:not(:disabled):not([data-disabled]):hover]:bg-[#f5f5f5]", overrides.root)
2293
+ };
2294
+ }
2295
+ var CloseButtonRoot = forwardRef23(({ classNames, ...props }, ref) => /* @__PURE__ */ jsx35(MantineCloseButton, { ...resolveCloseButtonProps(props), ref, icon: resolveCloseButtonIcon(props), classNames: (theme, values, context) => resolveCloseButtonClassNames(typeof classNames === "function" ? classNames(theme, values, context) : classNames) }));
2296
+ CloseButtonRoot.displayName = "SWorks/CloseButton";
2297
+ var CloseButton2 = createPolymorphicComponent4(CloseButtonRoot);
2298
+
2299
+ // src/components/Loader/Loader.tsx
2300
+ import { forwardRef as forwardRef24 } from "react";
2301
+ import cx24 from "clsx";
2302
+ import { Loader as MantineLoader } from "@s-works/s-works-ui/core";
2303
+
2304
+ // src/components/Loader/icons.tsx
2305
+ import { useId as useId5 } from "react";
2306
+ import { jsx as jsx36, jsxs as jsxs11 } from "react/jsx-runtime";
2307
+ function RingIcon(props) {
2308
+ return /* @__PURE__ */ jsxs11("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: [
2309
+ /* @__PURE__ */ jsx36("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" }),
2310
+ /* @__PURE__ */ jsx36("path", { d: "M8 0C12.4183 0 16 3.58172 16 8H14C14 4.68629 11.3137 2 8 2V0Z", fill: "currentColor" })
2311
+ ] });
2312
+ }
2313
+ function GradientIcon(props) {
2314
+ const id = useId5();
2315
+ return /* @__PURE__ */ jsxs11("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: [
2316
+ /* @__PURE__ */ jsxs11("defs", { children: [
2317
+ /* @__PURE__ */ jsx36("mask", { id: id + "-mask", children: /* @__PURE__ */ jsx36("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" }) }),
2318
+ /* @__PURE__ */ jsx36("clipPath", { id: id + "-clip", children: /* @__PURE__ */ jsx36("rect", { width: "16", height: "16", rx: "8" }) })
2319
+ ] }),
2320
+ /* @__PURE__ */ jsx36("g", { clipPath: `url(#${id}-clip)`, children: /* @__PURE__ */ jsx36("g", { mask: `url(#${id}-mask)`, children: /* @__PURE__ */ jsx36("g", { transform: "matrix(0 0.007 -0.007 0 8 8)", children: /* @__PURE__ */ jsx36("foreignObject", { x: "-2285.71", y: "-2285.71", width: "4571.43", height: "4571.43", children: /* @__PURE__ */ jsx36("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)]" }) }) }) }) })
2321
+ ] });
2322
+ }
2323
+
2324
+ // src/components/Loader/Loader.tsx
2325
+ import { jsx as jsx37 } from "react/jsx-runtime";
2326
+ var RingLoader = forwardRef24((props, ref) => /* @__PURE__ */ jsx37("span", { ...props, ref, children: /* @__PURE__ */ jsx37(RingIcon, { className: "sw:block sw:h-full sw:w-full sw:animate-spin sw:motion-reduce:animate-none" }) }));
2327
+ RingLoader.displayName = "SWorks/RingLoader";
2328
+ var GradientLoader = forwardRef24((props, ref) => /* @__PURE__ */ jsx37("span", { ...props, ref, children: /* @__PURE__ */ jsx37(GradientIcon, { className: "sw:block sw:h-full sw:w-full sw:animate-spin sw:motion-reduce:animate-none" }) }));
2329
+ GradientLoader.displayName = "SWorks/GradientLoader";
2330
+ var loaderTypes = {
2331
+ ...MantineLoader.defaultLoaders,
2332
+ ring: RingLoader,
2333
+ gradient: GradientLoader
2334
+ };
2335
+ function resolveLoaderProps({ size = 16, color = "#165dff", type = "ring", loaders, ...props } = {}) {
2336
+ return {
2337
+ role: "status",
2338
+ "aria-label": "\u6B63\u5728\u52A0\u8F7D",
2339
+ ...props,
2340
+ size,
2341
+ color,
2342
+ type,
2343
+ loaders: { ...loaderTypes, ...loaders }
2344
+ };
2345
+ }
2346
+ function resolveLoaderClassNames(overrides = {}) {
2347
+ return {
2348
+ root: cx24("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)
2349
+ };
2350
+ }
2351
+ var LoaderRoot = forwardRef24(({ classNames, ...props }, ref) => /* @__PURE__ */ jsx37(MantineLoader, { ...resolveLoaderProps(props), ref, classNames: (theme, values, context) => resolveLoaderClassNames(typeof classNames === "function" ? classNames(theme, values, context) : classNames) }));
2352
+ LoaderRoot.displayName = "SWorks/Loader";
2353
+ var Loader = Object.assign(LoaderRoot, {
2354
+ defaultLoaders: loaderTypes
2355
+ });
2356
+
2357
+ // src/components/Layout/Layout.tsx
2358
+ import { forwardRef as forwardRef25 } from "react";
2359
+ import { Flex } from "@s-works/s-works-ui/core";
2360
+ import cx25 from "clsx";
2361
+
2362
+ // src/components/Layout/use-layout-state.ts
2363
+ import { useCallback as useCallback2, useRef as useRef7 } from "react";
2364
+ import { useUncontrolled as useUncontrolled5 } from "@s-works/s-works-ui/hooks";
2365
+ function useLayoutState(options) {
2366
+ const [isCollapsed, setCollapsed] = useUncontrolled5({ value: options.collapsed, defaultValue: options.defaultCollapsed, finalValue: false, onChange: options.onCollapsedChange });
2367
+ const [expandedWidth, setExpandedWidth] = useUncontrolled5({ value: options.siderWidth, defaultValue: options.defaultSiderWidth, finalValue: 260, onChange: options.onSiderWidthChange });
2368
+ const clamp = (value) => Math.min(400, Math.max(220, Math.round(Number.isFinite(value) ? value : 260)));
2369
+ const width = isCollapsed ? 56 : clamp(expandedWidth);
2370
+ const drag = useRef7(null);
2371
+ const resizeHandleRef = useCallback2((node) => {
2372
+ if (!node)
2373
+ drag.current = null;
2374
+ }, []);
2375
+ const onPointerDown = (event) => {
2376
+ if (!event.isPrimary || event.button !== 0 || isCollapsed || drag.current)
2377
+ return;
2378
+ const renderedWidth = event.currentTarget.parentElement?.getBoundingClientRect().width ?? width;
2379
+ event.currentTarget.setPointerCapture(event.pointerId);
2380
+ drag.current = {
2381
+ pointerId: event.pointerId,
2382
+ startX: event.clientX,
2383
+ startWidth: width,
2384
+ unitsPerPixel: renderedWidth > 0 ? width / renderedWidth : 1
2385
+ };
2386
+ event.preventDefault();
2387
+ };
2388
+ const onPointerMove = (event) => {
2389
+ const active = drag.current;
2390
+ if (active?.pointerId !== event.pointerId || isCollapsed)
2391
+ return;
2392
+ const delta = (event.clientX - active.startX) * active.unitsPerPixel;
2393
+ setExpandedWidth(clamp(active.startWidth + delta));
2394
+ };
2395
+ const onPointerEnd = (event) => {
2396
+ if (drag.current?.pointerId !== event.pointerId)
2397
+ return;
2398
+ drag.current = null;
2399
+ if (event.currentTarget.hasPointerCapture(event.pointerId)) {
2400
+ event.currentTarget.releasePointerCapture(event.pointerId);
2401
+ }
2402
+ };
2403
+ const onKeyDown = (event) => {
2404
+ if (event.key === "Enter") {
2405
+ event.preventDefault();
2406
+ setCollapsed(!isCollapsed);
2407
+ } else if (!isCollapsed && ["ArrowLeft", "ArrowRight", "Home", "End"].includes(event.key)) {
2408
+ event.preventDefault();
2409
+ setExpandedWidth(event.key === "Home" ? 220 : event.key === "End" ? 400 : clamp(width + (event.key === "ArrowRight" ? 8 : -8)));
2410
+ }
2411
+ };
2412
+ return { width, isCollapsed, resizeHandleRef, onPointerDown, onPointerMove, onPointerEnd, onKeyDown };
2413
+ }
2414
+
2415
+ // src/components/Layout/Layout.tsx
2416
+ import { jsx as jsx38, jsxs as jsxs12 } from "react/jsx-runtime";
2417
+ 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) {
2418
+ const layoutState = useLayoutState({ collapsed, defaultCollapsed, onCollapsedChange, siderWidth, defaultSiderWidth, onSiderWidthChange });
2419
+ return /* @__PURE__ */ jsxs12(Flex, { ...props, ref, h, w, direction: "row", wrap: "nowrap", classNames: (theme, values, context) => ({ root: cx25("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: [
2420
+ sider !== null && /* @__PURE__ */ jsxs12(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: [
2421
+ /* @__PURE__ */ jsx38(Flex, { px: 12, direction: "column", align: "center", classNames: { root: "sw:min-h-0 sw:flex-1 sw:overflow-auto" }, children: /* @__PURE__ */ jsx38("div", { className: "sw:my-auto sw:w-full sw:shrink-0 sw:text-center", children: sider ?? (layoutState.isCollapsed ? /* @__PURE__ */ jsx38("span", { className: "sw:text-[12px] sw:leading-[18px]", children: "\u4FA7\u680F" }) : /* @__PURE__ */ jsxs12("span", { className: "sw:text-center", children: [
2422
+ "Sider",
2423
+ /* @__PURE__ */ jsx38("br", {}),
2424
+ "\u4FA7\u8FB9\u533A\u57DF"
2425
+ ] })) }) }),
2426
+ resizable && /* @__PURE__ */ jsx38("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" })
2427
+ ] }),
2428
+ /* @__PURE__ */ jsxs12(Flex, { direction: "column", classNames: { root: "sw:min-h-0 sw:min-w-0 sw:flex-1" }, children: [
2429
+ header !== null && /* @__PURE__ */ jsx38(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" }),
2430
+ /* @__PURE__ */ jsxs12(Flex, { classNames: { root: "sw:min-h-0 sw:min-w-0 sw:flex-1" }, children: [
2431
+ /* @__PURE__ */ jsx38(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__ */ jsx38(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__ */ jsxs12("span", { children: [
2432
+ "Centered Content \u5C45\u4E2D\u5185\u5BB9\u533A\u57DF",
2433
+ /* @__PURE__ */ jsx38("br", {}),
2434
+ "\u6700\u5927\u5BBD\u5EA6 840 px"
2435
+ ] }) : /* @__PURE__ */ jsxs12("span", { children: [
2436
+ "Content \u5185\u5BB9\u533A\u57DF",
2437
+ /* @__PURE__ */ jsx38("br", {}),
2438
+ "\u586B\u6EE1\u5269\u4F59\u7A7A\u95F4"
2439
+ ] })) }) }),
2440
+ panel !== void 0 && panel !== null && /* @__PURE__ */ jsx38(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__ */ jsx38("div", { className: "sw:my-auto sw:w-full sw:shrink-0 sw:text-center", children: panel }) })
2441
+ ] }),
2442
+ footer !== void 0 && footer !== null && /* @__PURE__ */ jsx38(Flex, { component: "footer", h: 48, px: 12, align: "center", justify: "center", classNames: { root: "sw:shrink-0 sw:bg-[#d0dfff]" }, children: footer })
2443
+ ] })
2444
+ ] });
2445
+ }
2446
+ var Layout = forwardRef25(LayoutRoot);
2447
+ Layout.displayName = "SWorks/Layout";
2448
+
2449
+ // src/components/ThreeColumnLayout/ThreeColumnLayout.tsx
2450
+ import { forwardRef as forwardRef26, useId as useId6, useRef as useRef9 } from "react";
2451
+ import { ActionIcon as ActionIcon2, Button as Button4, Flex as Flex2 } from "@s-works/s-works-ui/core";
2452
+ import { PanelLeft, ChevronLeft as ChevronLeft2, ChevronRight as ChevronRight2, X } from "lucide-react";
2453
+ import cx26 from "clsx";
2454
+
2455
+ // src/components/ThreeColumnLayout/use-resizable-panel.ts
2456
+ import { useCallback as useCallback3, useEffect as useEffect7, useRef as useRef8 } from "react";
2457
+ import { useUncontrolled as useUncontrolled6 } from "@s-works/s-works-ui/hooks";
2458
+ function useResizablePanel(options) {
2459
+ const [opened, setOpened] = useUncontrolled6({
2460
+ value: options.opened,
2461
+ defaultValue: options.defaultOpened,
2462
+ finalValue: true,
2463
+ onChange: options.onOpenedChange
2464
+ });
2465
+ const [collapsed, setCollapsed] = useUncontrolled6({
2466
+ value: options.collapsed,
2467
+ defaultValue: options.defaultCollapsed,
2468
+ finalValue: false,
2469
+ onChange: options.onCollapsedChange
2470
+ });
2471
+ const [expandedWidth, updateWidth, widthControlled] = useUncontrolled6({
2472
+ value: options.width,
2473
+ defaultValue: options.defaultWidth,
2474
+ finalValue: options.defaultWidth,
2475
+ onChange: options.onWidthChange
2476
+ });
2477
+ const storageKey = widthControlled ? void 0 : options.storageKey;
2478
+ const clamp = (value) => Math.min(options.max, Math.max(options.min, Math.round(Number.isFinite(value) ? value : options.defaultWidth)));
2479
+ useEffect7(() => {
2480
+ if (!storageKey)
2481
+ return;
2482
+ try {
2483
+ const saved = window.localStorage.getItem(storageKey);
2484
+ if (saved !== null && Number.isFinite(Number(saved)))
2485
+ updateWidth(clamp(Number(saved)));
2486
+ } catch {
2487
+ }
2488
+ }, [storageKey]);
2489
+ const setWidth = (value) => {
2490
+ const next = clamp(value);
2491
+ updateWidth(next);
2492
+ if (storageKey) {
2493
+ try {
2494
+ window.localStorage.setItem(storageKey, String(next));
2495
+ } catch {
2496
+ }
2497
+ }
2498
+ };
2499
+ const width = opened ? collapsed ? 56 : clamp(expandedWidth) : 0;
2500
+ const drag = useRef8(null);
2501
+ const resizeHandleRef = useCallback3((node) => {
2502
+ if (!node)
2503
+ drag.current = null;
2504
+ }, []);
2505
+ const onPointerDown = (event) => {
2506
+ if (!event.isPrimary || event.button !== 0 || !opened || collapsed || drag.current)
2507
+ return;
2508
+ const renderedWidth = event.currentTarget.parentElement?.getBoundingClientRect().width ?? width;
2509
+ event.currentTarget.setPointerCapture(event.pointerId);
2510
+ drag.current = {
2511
+ pointerId: event.pointerId,
2512
+ startX: event.clientX,
2513
+ width,
2514
+ unitsPerPixel: renderedWidth > 0 ? width / renderedWidth : 1
2515
+ };
2516
+ event.preventDefault();
2517
+ };
2518
+ const onPointerMove = (event) => {
2519
+ const active = drag.current;
2520
+ if (!active || active.pointerId !== event.pointerId || !opened || collapsed)
2521
+ return;
2522
+ const direction = options.side === "left" ? 1 : -1;
2523
+ setWidth(clamp(active.width + direction * (event.clientX - active.startX) * active.unitsPerPixel));
2524
+ };
2525
+ const onPointerEnd = (event) => {
2526
+ if (drag.current?.pointerId !== event.pointerId)
2527
+ return;
2528
+ drag.current = null;
2529
+ if (event.currentTarget.hasPointerCapture(event.pointerId))
2530
+ event.currentTarget.releasePointerCapture(event.pointerId);
2531
+ };
2532
+ const onKeyDown = (event) => {
2533
+ if (!opened || collapsed || !["ArrowLeft", "ArrowRight", "Home", "End"].includes(event.key))
2534
+ return;
2535
+ event.preventDefault();
2536
+ const direction = options.side === "left" ? 1 : -1;
2537
+ setWidth(event.key === "Home" ? options.min : event.key === "End" ? options.max : clamp(width + direction * (event.key === "ArrowRight" ? 8 : -8)));
2538
+ };
2539
+ const changeOpened = (value) => {
2540
+ drag.current = null;
2541
+ setOpened(value);
2542
+ };
2543
+ const changeCollapsed = (value) => {
2544
+ drag.current = null;
2545
+ setCollapsed(value);
2546
+ };
2547
+ return {
2548
+ opened,
2549
+ collapsed,
2550
+ width,
2551
+ setWidth,
2552
+ setOpened: changeOpened,
2553
+ setCollapsed: changeCollapsed,
2554
+ resizeHandleRef,
2555
+ onPointerDown,
2556
+ onPointerMove,
2557
+ onPointerEnd,
2558
+ onKeyDown
2559
+ };
2560
+ }
2561
+
2562
+ // src/components/ThreeColumnLayout/ThreeColumnLayout.tsx
2563
+ import { Fragment as Fragment6, jsx as jsx39, jsxs as jsxs13 } from "react/jsx-runtime";
2564
+ 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) {
2565
+ const menuState = useResizablePanel({
2566
+ side: "left",
2567
+ width: menuWidth,
2568
+ defaultWidth: defaultMenuWidth,
2569
+ onWidthChange: onMenuWidthChange,
2570
+ opened: menuOpened,
2571
+ defaultOpened: defaultMenuOpened,
2572
+ onOpenedChange: onMenuOpenedChange,
2573
+ collapsed: menuCollapsed,
2574
+ defaultCollapsed: defaultMenuCollapsed,
2575
+ onCollapsedChange: onMenuCollapsedChange,
2576
+ storageKey: menuStorageKey,
2577
+ min: 220,
2578
+ max: 400
2579
+ });
2580
+ const agentState = useResizablePanel({
2581
+ side: "right",
2582
+ width: agentWidth,
2583
+ defaultWidth: defaultAgentWidth,
2584
+ onWidthChange: onAgentWidthChange,
2585
+ opened: agentOpened,
2586
+ defaultOpened: defaultAgentOpened,
2587
+ onOpenedChange: onAgentOpenedChange,
2588
+ min: 410,
2589
+ max: 710
2590
+ });
2591
+ const instanceId = useId6();
2592
+ const menuId = `${instanceId}-menu`;
2593
+ const agentId = `${instanceId}-agent`;
2594
+ const menuToggleRef = useRef9(null);
2595
+ const agentToggleRef = useRef9(null);
2596
+ const closeMenu = () => {
2597
+ menuState.setOpened(false);
2598
+ menuToggleRef.current?.focus();
2599
+ };
2600
+ const closeAgent = () => {
2601
+ agentState.setOpened(false);
2602
+ agentToggleRef.current?.focus();
2603
+ };
2604
+ const toggleAgent = () => {
2605
+ if (agentState.opened)
2606
+ closeAgent();
2607
+ else {
2608
+ agentState.setWidth(410);
2609
+ agentState.setOpened(true);
2610
+ }
2611
+ };
2612
+ const toggleCollapsed = () => {
2613
+ menuState.setCollapsed(!menuState.collapsed);
2614
+ menuToggleRef.current?.focus();
2615
+ };
2616
+ const controls = {
2617
+ menuId,
2618
+ menuOpened: menuState.opened,
2619
+ menuCollapsed: menuState.collapsed,
2620
+ agentOpened: agentState.opened,
2621
+ toggleMenu: () => menuState.setOpened(!menuState.opened),
2622
+ toggleCollapsed,
2623
+ toggleAgent,
2624
+ closeAgent,
2625
+ menuToggleRef,
2626
+ agentToggleRef
2627
+ };
2628
+ const toolClasses = {
2629
+ 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]"
2630
+ };
2631
+ return /* @__PURE__ */ jsx39(Flex2, { ...props, ref, h, w, bg, c, bdrs, bd, direction: "column", classNames: (theme, values, context) => ({
2632
+ root: cx26("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)
2633
+ }), children: /* @__PURE__ */ jsxs13(Flex2, { h: "100%", miw: menuState.width + agentState.width + 320, wrap: "nowrap", classNames: { root: "sw:min-h-0 sw:flex-1" }, children: [
2634
+ /* @__PURE__ */ jsxs13(Flex2, { 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: {
2635
+ root: cx26("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-['']")
2636
+ }, children: [
2637
+ /* @__PURE__ */ jsx39(Flex2, { h: 64, px: 12, gap: 4, align: "center", justify: "flex-end", classNames: { root: "sw:shrink-0" }, children: menuHeader ? menuHeader(controls) : /* @__PURE__ */ jsxs13(Fragment6, { children: [
2638
+ !menuState.collapsed && menuTitle !== void 0 && /* @__PURE__ */ jsx39(Flex2, { flex: 1, fz: 16, fw: 500, classNames: { root: "sw:min-w-0 sw:truncate" }, children: menuTitle }),
2639
+ /* @__PURE__ */ jsx39(ActionIcon2, { 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__ */ jsx39(ChevronRight2, { size: 16, "aria-hidden": true }) : /* @__PURE__ */ jsx39(ChevronLeft2, { size: 16, "aria-hidden": true }) }),
2640
+ !menuState.collapsed && menu !== void 0 && /* @__PURE__ */ jsx39(ActionIcon2, { variant: "subtle", size: 32, radius: 6, "aria-label": "\u5173\u95ED\u83DC\u5355", onClick: closeMenu, classNames: toolClasses, children: /* @__PURE__ */ jsx39(X, { size: 16, "aria-hidden": true }) })
2641
+ ] }) }),
2642
+ /* @__PURE__ */ jsx39(Flex2, { 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__ */ jsx39("div", { className: "sw:my-auto sw:text-center", children: menuState.collapsed ? /* @__PURE__ */ jsx39("span", { className: "sw:text-[12px] sw:leading-[18px]", children: "Tab" }) : /* @__PURE__ */ jsxs13(Fragment6, { children: [
2643
+ "Tabbar",
2644
+ /* @__PURE__ */ jsx39("br", {}),
2645
+ "\u5DE6\u4FA7\u5BFC\u822A"
2646
+ ] }) }) }),
2647
+ resizable && !menuState.collapsed && menuState.opened && /* @__PURE__ */ jsx39("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) => {
2648
+ if (event.key === "Enter") {
2649
+ event.preventDefault();
2650
+ toggleCollapsed();
2651
+ } else
2652
+ menuState.onKeyDown(event);
2653
+ }, 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" })
2654
+ ] }),
2655
+ /* @__PURE__ */ jsxs13(Flex2, { direction: "column", flex: 1, miw: 320, classNames: { root: "sw:min-h-0 sw:min-w-0" }, children: [
2656
+ /* @__PURE__ */ jsx39(Flex2, { component: "header", h: 66, px: 32, gap: 16, bg: appearance === "workspace" ? "white" : "#d0dfff", align: "center", classNames: {
2657
+ root: cx26("sw:shrink-0", appearance === "workspace" && "sw:border-0 sw:border-b sw:border-solid sw:border-[#f0f0f0]")
2658
+ }, children: header ? header(controls) : /* @__PURE__ */ jsxs13(Fragment6, { children: [
2659
+ /* @__PURE__ */ jsx39(ActionIcon2, { 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__ */ jsx39(PanelLeft, { size: 18, "aria-hidden": true }) }),
2660
+ /* @__PURE__ */ jsx39(Flex2, { flex: 1, fz: 16, fw: 500, classNames: { root: "sw:min-w-0 sw:truncate" }, children: title }),
2661
+ /* @__PURE__ */ jsx39(Button4, { 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: {
2662
+ root: "sw:shrink-0 sw:focus-visible:outline sw:focus-visible:outline-2 sw:focus-visible:outline-offset-2 sw:focus-visible:outline-[#165dff]",
2663
+ label: "sw:text-[14px] sw:font-medium sw:leading-[21px]"
2664
+ }, children: agentTitle })
2665
+ ] }) }),
2666
+ /* @__PURE__ */ jsx39(Flex2, { 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__ */ jsxs13(Flex2, { 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: [
2667
+ /* @__PURE__ */ jsx39("span", { className: "sw:text-[24px] sw:leading-[36px]", children: "Content \u5185\u5BB9\u533A\u57DF" }),
2668
+ /* @__PURE__ */ jsx39("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" })
2669
+ ] }) })
2670
+ ] }),
2671
+ /* @__PURE__ */ jsxs13(Flex2, { component: "aside", id: agentId, "aria-label": agentTitle, "aria-hidden": !agentState.opened, display: agentState.opened ? "flex" : "none", w: agentState.width, pos: "relative", direction: "column", classNames: {
2672
+ root: cx26("sw:min-h-0 sw:shrink-0", appearance === "workspace" ? "sw:bg-white" : "sw:bg-[#f3f7ff]")
2673
+ }, children: [
2674
+ /* @__PURE__ */ jsx39(Flex2, { h: 64, px: 16, gap: 12, bg: appearance === "workspace" ? "white" : "#d0dfff", align: "center", classNames: {
2675
+ root: "sw:shrink-0"
2676
+ }, children: agentHeader ? agentHeader(controls) : /* @__PURE__ */ jsxs13(Fragment6, { children: [
2677
+ /* @__PURE__ */ jsx39(Flex2, { flex: 1, fz: 16, fw: 500, classNames: { root: "sw:min-w-0 sw:truncate" }, children: agentTitle }),
2678
+ /* @__PURE__ */ jsx39(ActionIcon2, { size: 32, radius: 6, variant: "subtle", "aria-label": `\u5173\u95ED ${agentTitle}`, onClick: closeAgent, classNames: toolClasses, children: /* @__PURE__ */ jsx39(X, { size: 16, "aria-hidden": true }) })
2679
+ ] }) }),
2680
+ /* @__PURE__ */ jsx39(Flex2, { direction: "column", p: appearance === "workspace" ? 0 : 16, gap: 16, classNames: { root: "sw:min-h-0 sw:flex-1 sw:overflow-auto" }, children: agent ?? /* @__PURE__ */ jsxs13("div", { className: "sw:my-auto sw:text-center", children: [
2681
+ /* @__PURE__ */ jsx39("div", { children: "Agent \u5185\u5BB9\u533A\u57DF" }),
2682
+ /* @__PURE__ */ jsx39("div", { className: "sw:text-[14px] sw:font-normal sw:leading-[21px]", children: "\u968F\u9762\u677F\u5BBD\u5EA6\u9002\u914D" })
2683
+ ] }) }),
2684
+ resizable && agentState.opened && /* @__PURE__ */ jsx39("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) => {
2685
+ if (event.key === "Enter") {
2686
+ event.preventDefault();
2687
+ closeAgent();
2688
+ } else
2689
+ agentState.onKeyDown(event);
2690
+ }, 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" })
2691
+ ] })
2692
+ ] }) });
2693
+ }
2694
+ var ThreeColumnLayout = forwardRef26(ThreeColumnLayoutRoot);
2695
+ ThreeColumnLayout.displayName = "SWorks/ThreeColumnLayout";
2696
+
2697
+ // src/components/Space/Space.tsx
2698
+ import { Space } from "@s-works/s-works-ui/core";
2699
+
2700
+ // src/components/Skeleton/Skeleton.tsx
2701
+ import { forwardRef as forwardRef27 } from "react";
2702
+ import cx27 from "clsx";
2703
+ import { Skeleton as MantineSkeleton } from "@s-works/s-works-ui/core";
2704
+ import { jsx as jsx40 } from "react/jsx-runtime";
2705
+ function resolveSkeletonClassNames(overrides = {}) {
2706
+ return {
2707
+ root: cx27("sw:data-[visible]:after:bg-[rgba(46,50,56,0.05)] sw:motion-reduce:after:animate-none", overrides.root)
2708
+ };
2709
+ }
2710
+ var SkeletonRoot = forwardRef27(({ animate = false, radius = 4, classNames, ...props }, ref) => /* @__PURE__ */ jsx40(MantineSkeleton, { ...props, ref, animate, radius, classNames: (theme, values, context) => resolveSkeletonClassNames(typeof classNames === "function" ? classNames(theme, values, context) : classNames) }));
2711
+ SkeletonRoot.displayName = "SWorks/Skeleton";
2712
+ var Skeleton = SkeletonRoot;
112
2713
  export {
113
- Button
2714
+ Alert,
2715
+ AppShell,
2716
+ Breadcrumbs,
2717
+ Button,
2718
+ Checkbox,
2719
+ CloseButton2 as CloseButton,
2720
+ DateInput,
2721
+ DatePicker,
2722
+ InputBase,
2723
+ Layout,
2724
+ Loader,
2725
+ Modal,
2726
+ Pagination,
2727
+ Radio,
2728
+ Select,
2729
+ Skeleton,
2730
+ Space,
2731
+ Switch,
2732
+ Table,
2733
+ Tabs,
2734
+ Tag,
2735
+ TagsInput,
2736
+ ThreeColumnLayout,
2737
+ TimePicker,
2738
+ Title,
2739
+ Toast,
2740
+ Tooltip
114
2741
  };