@sia.soul/sia-react-ui 0.1.106 → 0.1.107

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 (45) hide show
  1. package/dist/Button-BiL3Wjsd.d.ts +44 -0
  2. package/dist/Button-O_pNB3SQ.d.cts +44 -0
  3. package/dist/{Select-DmT9pFRW.d.ts → Select-BddM4uXC.d.ts} +4 -42
  4. package/dist/{Select-DQpfyK7I.d.cts → Select-Cf0xz1Tg.d.cts} +4 -42
  5. package/dist/chart.js +5 -3
  6. package/dist/chunk-4TTHKFJ7.js +706 -0
  7. package/dist/chunk-CZ2ITBRW.js +65 -0
  8. package/dist/{chunk-EYB55TC5.js → chunk-D3HXXEEZ.js} +9 -5
  9. package/dist/{chunk-X4OLHWC3.js → chunk-JEDJQ257.js} +11 -7
  10. package/dist/chunk-KY6A5IJH.js +18 -0
  11. package/dist/{chunk-NURPAO7G.js → chunk-MMSYWDTR.js} +9 -5
  12. package/dist/{chunk-PUZWLIIJ.js → chunk-NZMUW5XI.js} +1 -13
  13. package/dist/{chunk-D456SSL3.js → chunk-OJ2WDC66.js} +6 -4
  14. package/dist/{chunk-V6CRVCSB.js → chunk-QV3AP6A2.js} +40 -729
  15. package/dist/chunk-RX242MUO.js +0 -0
  16. package/dist/chunk-SCEHVGKV.js +75 -0
  17. package/dist/{chunk-TUXNOSCT.js → chunk-SO7IJZIR.js} +4 -2
  18. package/dist/{chunk-T3EGAN7O.js → chunk-WD56MJO2.js} +5 -3
  19. package/dist/{core-_1K1jLyH.d.ts → core-Bm-1bOjF.d.ts} +8 -1
  20. package/dist/{core-DF7gei-P.d.cts → core-zpQkbNf_.d.cts} +8 -1
  21. package/dist/core.cjs +3 -1
  22. package/dist/core.css +31 -0
  23. package/dist/core.d.cts +3 -2
  24. package/dist/core.d.ts +3 -2
  25. package/dist/core.js +12 -7
  26. package/dist/game.cjs +2801 -0
  27. package/dist/game.css +8919 -0
  28. package/dist/game.d.cts +416 -0
  29. package/dist/game.d.ts +416 -0
  30. package/dist/game.js +1020 -0
  31. package/dist/index.cjs +5518 -5460
  32. package/dist/index.css +71 -0
  33. package/dist/index.d.cts +45 -10
  34. package/dist/index.d.ts +45 -10
  35. package/dist/index.js +718 -656
  36. package/dist/markdown-editor.js +3 -2
  37. package/dist/rich-text-editor.cjs +3 -1
  38. package/dist/rich-text-editor.js +7 -4
  39. package/dist/{select-date-range-BT71tp7y.d.cts → select-date-range-Cm5o2xPp.d.cts} +1 -1
  40. package/dist/{select-date-range-CFGzoyLs.d.ts → select-date-range-yGDEA1RP.d.ts} +1 -1
  41. package/dist/select-date-range.d.cts +3 -2
  42. package/dist/select-date-range.d.ts +3 -2
  43. package/dist/select-date-range.js +8 -5
  44. package/package.json +9 -3
  45. package/dist/chunk-SJFT5OSX.js +0 -131
File without changes
@@ -0,0 +1,75 @@
1
+ import {
2
+ useFloatingPlaceholder
3
+ } from "./chunk-KY6A5IJH.js";
4
+ import {
5
+ useControlSize,
6
+ withTitleTooltip
7
+ } from "./chunk-NZMUW5XI.js";
8
+
9
+ // src/components/TextArea.tsx
10
+ import { forwardRef, useId, useState } from "react";
11
+ import { jsx, jsxs } from "react/jsx-runtime";
12
+ var TextArea = forwardRef(function TextArea2({
13
+ label,
14
+ hint,
15
+ status = "default",
16
+ size: sizeProp,
17
+ showCount = false,
18
+ placeholder,
19
+ placeholderMode,
20
+ className = "",
21
+ id,
22
+ disabled,
23
+ value,
24
+ defaultValue,
25
+ maxLength,
26
+ onChange,
27
+ ...props
28
+ }, ref) {
29
+ const size = useControlSize(sizeProp);
30
+ const fallbackId = useId();
31
+ const textAreaId = id ?? fallbackId;
32
+ const [uncontrolledValue, setUncontrolledValue] = useState(() => defaultValue === void 0 ? "" : String(defaultValue));
33
+ const currentText = value !== void 0 ? String(value) : uncontrolledValue;
34
+ const floating = useFloatingPlaceholder({ mode: placeholderMode, placeholder, filled: currentText.length > 0 });
35
+ const hintId = `${textAreaId}-hint`;
36
+ const describedBy = [props["aria-describedby"], hint ? hintId : null].filter(Boolean).join(" ") || void 0;
37
+ function handleChange(event) {
38
+ setUncontrolledValue(event.target.value);
39
+ onChange?.(event);
40
+ }
41
+ const control = /* @__PURE__ */ jsxs("span", { className: `sia-textarea-control sia-textarea-control--${size} sia-textarea-control--${status}${floating.className}${disabled ? " is-disabled" : ""}`, children: [
42
+ /* @__PURE__ */ jsx(
43
+ "textarea",
44
+ {
45
+ ...withTitleTooltip(props),
46
+ ref,
47
+ id: textAreaId,
48
+ className: "sia-textarea",
49
+ disabled,
50
+ value,
51
+ defaultValue,
52
+ maxLength,
53
+ placeholder,
54
+ "aria-describedby": describedBy,
55
+ "aria-invalid": status === "error" || void 0,
56
+ onChange: handleChange
57
+ }
58
+ ),
59
+ floating.label,
60
+ showCount ? /* @__PURE__ */ jsxs("span", { className: `sia-textarea-control__count${maxLength !== void 0 && currentText.length >= maxLength ? " is-limit" : ""}`, "aria-live": "polite", children: [
61
+ currentText.length,
62
+ maxLength !== void 0 ? `/${maxLength}` : null
63
+ ] }) : null
64
+ ] });
65
+ if (!label && !hint) return /* @__PURE__ */ jsx("span", { className: `sia-field ${className}`.trim(), children: control });
66
+ return /* @__PURE__ */ jsxs("span", { className: `sia-field ${className}`.trim(), children: [
67
+ label ? /* @__PURE__ */ jsx("label", { className: "sia-field__label", htmlFor: textAreaId, children: label }) : null,
68
+ control,
69
+ hint ? /* @__PURE__ */ jsx("span", { id: hintId, className: `sia-field__hint sia-field__hint--${status}`, children: hint }) : null
70
+ ] });
71
+ });
72
+
73
+ export {
74
+ TextArea
75
+ };
@@ -1,7 +1,9 @@
1
1
  import {
2
- useFloatingPlaceholder,
2
+ useFloatingPlaceholder
3
+ } from "./chunk-KY6A5IJH.js";
4
+ import {
3
5
  withTitleTooltip
4
- } from "./chunk-PUZWLIIJ.js";
6
+ } from "./chunk-NZMUW5XI.js";
5
7
 
6
8
  // src/components/MarkdownEditor.tsx
7
9
  import { useEffect, useRef, useState } from "react";
@@ -1,10 +1,12 @@
1
1
  import {
2
- Button,
3
2
  TextArea
4
- } from "./chunk-SJFT5OSX.js";
3
+ } from "./chunk-SCEHVGKV.js";
4
+ import {
5
+ Button
6
+ } from "./chunk-CZ2ITBRW.js";
5
7
  import {
6
8
  withTitleTooltip
7
- } from "./chunk-PUZWLIIJ.js";
9
+ } from "./chunk-NZMUW5XI.js";
8
10
 
9
11
  // src/components/ChartWhirlingLoading.tsx
10
12
  import { useEffect, useState } from "react";
@@ -1,7 +1,8 @@
1
1
  import * as react from 'react';
2
2
  import { ReactNode, HTMLAttributes, CSSProperties, MouseEvent, ReactElement, ImgHTMLAttributes, InputHTMLAttributes, MouseEventHandler, AnchorHTMLAttributes, ButtonHTMLAttributes } from 'react';
3
- import { B as ButtonProps, f as Button } from './Select-DmT9pFRW.js';
3
+ import { B as ButtonProps, b as Button } from './Button-BiL3Wjsd.js';
4
4
  import { C as ControlSize, a as ControlStatus, I as InputPlaceholderMode } from './shared-Bx4B28Wh.js';
5
+ import './Select-BddM4uXC.js';
5
6
 
6
7
  /** 单个工具栏操作及其下拉菜单。 */
7
8
  interface ToolbarItem {
@@ -477,6 +478,12 @@ type MenuItem = {
477
478
  label?: ReactNode;
478
479
  /** 显示在内容旁的图标节点,建议使用 Icon 组件。 */
479
480
  icon?: ReactNode;
481
+ /** 图标槽的宽高,单位 px;未指定时沿用菜单图标尺寸变量。图片图标应传入与图片相同的尺寸,避免挤压。 */
482
+ iconSize?: number;
483
+ /** 是否显示当前生效的半透明勾选水印,默认为 false;独立于 selectedKeys 的浏览选中状态,由业务在应用成功后更新。 */
484
+ applied?: boolean;
485
+ /** 生效水印的无障碍说明;默认为“当前使用”,仅 applied 为 true 时显示。 */
486
+ appliedLabel?: string;
480
487
  /** 主体之外的补充内容或操作区。 */
481
488
  extra?: ReactNode;
482
489
  /** 菜单项的悬停提示文字,停留 600ms 后显示,禁用项同样支持;收起的图标菜单未设置时使用纯文本 label。 */
@@ -1,7 +1,8 @@
1
1
  import * as react from 'react';
2
2
  import { ReactNode, HTMLAttributes, CSSProperties, MouseEvent, ReactElement, ImgHTMLAttributes, InputHTMLAttributes, MouseEventHandler, AnchorHTMLAttributes, ButtonHTMLAttributes } from 'react';
3
- import { B as ButtonProps, f as Button } from './Select-DQpfyK7I.cjs';
3
+ import { B as ButtonProps, b as Button } from './Button-O_pNB3SQ.cjs';
4
4
  import { C as ControlSize, a as ControlStatus, I as InputPlaceholderMode } from './shared-Bx4B28Wh.cjs';
5
+ import './Select-Cf0xz1Tg.cjs';
5
6
 
6
7
  /** 单个工具栏操作及其下拉菜单。 */
7
8
  interface ToolbarItem {
@@ -477,6 +478,12 @@ type MenuItem = {
477
478
  label?: ReactNode;
478
479
  /** 显示在内容旁的图标节点,建议使用 Icon 组件。 */
479
480
  icon?: ReactNode;
481
+ /** 图标槽的宽高,单位 px;未指定时沿用菜单图标尺寸变量。图片图标应传入与图片相同的尺寸,避免挤压。 */
482
+ iconSize?: number;
483
+ /** 是否显示当前生效的半透明勾选水印,默认为 false;独立于 selectedKeys 的浏览选中状态,由业务在应用成功后更新。 */
484
+ applied?: boolean;
485
+ /** 生效水印的无障碍说明;默认为“当前使用”,仅 applied 为 true 时显示。 */
486
+ appliedLabel?: string;
480
487
  /** 主体之外的补充内容或操作区。 */
481
488
  extra?: ReactNode;
482
489
  /** 菜单项的悬停提示文字,停留 600ms 后显示,禁用项同样支持;收起的图标菜单未设置时使用纯文本 label。 */
package/dist/core.cjs CHANGED
@@ -1587,10 +1587,12 @@ function MenuEntry({
1587
1587
  ...withTitleTooltip({ title: collapsed ? item.title ?? (typeof item.label === "string" ? item.label : void 0) : item.title }),
1588
1588
  disabled: item.disabled,
1589
1589
  "aria-current": isSelected ? "page" : void 0,
1590
+ "data-applied": item.applied || void 0,
1590
1591
  "aria-expanded": hasChildren ? isOpen : void 0,
1591
1592
  onClick: (event) => hasChildren ? props.toggle(item.key) : props.select(item, path, event),
1592
1593
  children: [
1593
- reserveIcon ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "sia-menu__icon", "aria-hidden": !item.icon || void 0, children: item.icon }) : null,
1594
+ reserveIcon ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "sia-menu__icon", style: item.iconSize ? { width: item.iconSize, height: item.iconSize, flexBasis: item.iconSize } : void 0, "aria-hidden": !item.icon || void 0, children: item.icon }) : null,
1595
+ item.applied ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "sia-menu__applied", role: "img", "aria-label": item.appliedLabel ?? "\u5F53\u524D\u4F7F\u7528", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Icon, { name: "circle-check", size: 32 }) }) : null,
1594
1596
  !collapsed ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "sia-menu__label", children: item.label }) : null,
1595
1597
  !collapsed && item.extra ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "sia-menu__extra", children: item.extra }) : null,
1596
1598
  !collapsed && hasChildren ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Icon, { className: "sia-menu__expand-icon", name: "chevron-down", size: 13 }) : null
package/dist/core.css CHANGED
@@ -5821,6 +5821,19 @@ fieldset:disabled .sia-input-number__floating-placeholder {
5821
5821
  transform: translateY(-50%);
5822
5822
  opacity: 1;
5823
5823
  }
5824
+ body:has(.sia-window-frame[data-sia-text-selectable=false]) {
5825
+ -webkit-user-select: none;
5826
+ user-select: none;
5827
+ }
5828
+ body:has(.sia-window-frame[data-sia-text-selectable=false]) :is(input, textarea, [contenteditable]:not([contenteditable=false])) {
5829
+ -webkit-user-select: text;
5830
+ user-select: text;
5831
+ }
5832
+ body:has(.sia-window-frame[data-sia-text-selectable=false]) img {
5833
+ -webkit-user-select: none;
5834
+ user-select: none;
5835
+ -webkit-user-drag: none;
5836
+ }
5824
5837
  .sia-window-frame {
5825
5838
  --sia-window-titlebar-height: 42px;
5826
5839
  --sia-window-control-width: 46px;
@@ -8186,6 +8199,24 @@ fieldset:disabled .sia-input-number__floating-placeholder {
8186
8199
  .sia-menu__icon > * {
8187
8200
  max-width: 100%;
8188
8201
  }
8202
+ .sia-menu__icon img {
8203
+ object-fit: contain;
8204
+ }
8205
+ .sia-menu__item {
8206
+ position: relative;
8207
+ isolation: isolate;
8208
+ }
8209
+ .sia-menu__applied {
8210
+ position: absolute;
8211
+ right: 8px;
8212
+ top: 50%;
8213
+ transform: translateY(-50%);
8214
+ display: inline-flex;
8215
+ color: var(--sia-color-primary);
8216
+ opacity: .18;
8217
+ pointer-events: none;
8218
+ z-index: -1;
8219
+ }
8189
8220
  .sia-menu__extra {
8190
8221
  color: var(--sia-color-text-secondary);
8191
8222
  font-size: 12px;
package/dist/core.d.cts CHANGED
@@ -1,4 +1,5 @@
1
- export { d as Breadcrumb, e as BreadcrumbItem, f as BreadcrumbProps, h as Card, i as CardAccent, j as CardProps, n as Collapse, o as CollapseItem, p as CollapseKey, q as CollapseProps, x as FilledIconName, y as FloatButton, z as FloatButtonBackTopProps, A as FloatButtonGroupProps, E as FloatButtonProps, G as FloatButtonShape, K as Icon, L as IconName, M as IconProps, N as IconVariant, U as Input, V as InputProps, a0 as MessageConfig, a1 as MessageHandle, a2 as MessageKey, a3 as MessageType, ab as Progress, ac as ProgressProps, ad as ProgressStatus, ag as Result, ah as ResultProps, ai as ResultStatus, aj as Segmented, ak as SegmentedOption, al as SegmentedProps, am as SegmentedValue, at as TabItem, au as Tabs, aw as TabsOrientation, ax as TabsPosition, ay as TabsProps, az as TabsType, aA as Tag, aB as TagProps, aC as TagSize, T as TagStatus, aD as TagVariant, aH as Toolbar, aI as ToolbarItem, aJ as ToolbarProps, aU as Typography, aV as TypographyLinkProps, aW as TypographyProps, aX as TypographyTitleProps, aY as TypographyType, aZ as Upload, a_ as UploadChangeInfo, a$ as UploadDraggerProps, b0 as UploadFile, b1 as UploadFileStatus, b4 as UploadProps, b8 as UploadRequestOptions, bc as message } from './core-DF7gei-P.cjs';
2
- export { f as Button, B as ButtonProps, e as ButtonSize, g as ButtonVariant, h as Modal, d as ModalActionResult, M as ModalOpenConfig, i as ModalProps, j as ModalType, a as OverlayApiHandle, k as Select, S as SelectOption, c as SelectProps, m as SelectValue } from './Select-DQpfyK7I.cjs';
1
+ export { d as Breadcrumb, e as BreadcrumbItem, f as BreadcrumbProps, h as Card, i as CardAccent, j as CardProps, n as Collapse, o as CollapseItem, p as CollapseKey, q as CollapseProps, x as FilledIconName, y as FloatButton, z as FloatButtonBackTopProps, A as FloatButtonGroupProps, E as FloatButtonProps, G as FloatButtonShape, K as Icon, L as IconName, M as IconProps, N as IconVariant, U as Input, V as InputProps, a0 as MessageConfig, a1 as MessageHandle, a2 as MessageKey, a3 as MessageType, ab as Progress, ac as ProgressProps, ad as ProgressStatus, ag as Result, ah as ResultProps, ai as ResultStatus, aj as Segmented, ak as SegmentedOption, al as SegmentedProps, am as SegmentedValue, at as TabItem, au as Tabs, aw as TabsOrientation, ax as TabsPosition, ay as TabsProps, az as TabsType, aA as Tag, aB as TagProps, aC as TagSize, T as TagStatus, aD as TagVariant, aH as Toolbar, aI as ToolbarItem, aJ as ToolbarProps, aU as Typography, aV as TypographyLinkProps, aW as TypographyProps, aX as TypographyTitleProps, aY as TypographyType, aZ as Upload, a_ as UploadChangeInfo, a$ as UploadDraggerProps, b0 as UploadFile, b1 as UploadFileStatus, b4 as UploadProps, b8 as UploadRequestOptions, bc as message } from './core-zpQkbNf_.cjs';
2
+ export { b as Button, B as ButtonProps, a as ButtonSize, c as ButtonVariant } from './Button-O_pNB3SQ.cjs';
3
+ export { e as Modal, d as ModalActionResult, M as ModalOpenConfig, f as ModalProps, g as ModalType, a as OverlayApiHandle, h as Select, S as SelectOption, c as SelectProps, j as SelectValue } from './Select-Cf0xz1Tg.cjs';
3
4
  import 'react';
4
5
  import './shared-Bx4B28Wh.cjs';
package/dist/core.d.ts CHANGED
@@ -1,4 +1,5 @@
1
- export { d as Breadcrumb, e as BreadcrumbItem, f as BreadcrumbProps, h as Card, i as CardAccent, j as CardProps, n as Collapse, o as CollapseItem, p as CollapseKey, q as CollapseProps, x as FilledIconName, y as FloatButton, z as FloatButtonBackTopProps, A as FloatButtonGroupProps, E as FloatButtonProps, G as FloatButtonShape, K as Icon, L as IconName, M as IconProps, N as IconVariant, U as Input, V as InputProps, a0 as MessageConfig, a1 as MessageHandle, a2 as MessageKey, a3 as MessageType, ab as Progress, ac as ProgressProps, ad as ProgressStatus, ag as Result, ah as ResultProps, ai as ResultStatus, aj as Segmented, ak as SegmentedOption, al as SegmentedProps, am as SegmentedValue, at as TabItem, au as Tabs, aw as TabsOrientation, ax as TabsPosition, ay as TabsProps, az as TabsType, aA as Tag, aB as TagProps, aC as TagSize, T as TagStatus, aD as TagVariant, aH as Toolbar, aI as ToolbarItem, aJ as ToolbarProps, aU as Typography, aV as TypographyLinkProps, aW as TypographyProps, aX as TypographyTitleProps, aY as TypographyType, aZ as Upload, a_ as UploadChangeInfo, a$ as UploadDraggerProps, b0 as UploadFile, b1 as UploadFileStatus, b4 as UploadProps, b8 as UploadRequestOptions, bc as message } from './core-_1K1jLyH.js';
2
- export { f as Button, B as ButtonProps, e as ButtonSize, g as ButtonVariant, h as Modal, d as ModalActionResult, M as ModalOpenConfig, i as ModalProps, j as ModalType, a as OverlayApiHandle, k as Select, S as SelectOption, c as SelectProps, m as SelectValue } from './Select-DmT9pFRW.js';
1
+ export { d as Breadcrumb, e as BreadcrumbItem, f as BreadcrumbProps, h as Card, i as CardAccent, j as CardProps, n as Collapse, o as CollapseItem, p as CollapseKey, q as CollapseProps, x as FilledIconName, y as FloatButton, z as FloatButtonBackTopProps, A as FloatButtonGroupProps, E as FloatButtonProps, G as FloatButtonShape, K as Icon, L as IconName, M as IconProps, N as IconVariant, U as Input, V as InputProps, a0 as MessageConfig, a1 as MessageHandle, a2 as MessageKey, a3 as MessageType, ab as Progress, ac as ProgressProps, ad as ProgressStatus, ag as Result, ah as ResultProps, ai as ResultStatus, aj as Segmented, ak as SegmentedOption, al as SegmentedProps, am as SegmentedValue, at as TabItem, au as Tabs, aw as TabsOrientation, ax as TabsPosition, ay as TabsProps, az as TabsType, aA as Tag, aB as TagProps, aC as TagSize, T as TagStatus, aD as TagVariant, aH as Toolbar, aI as ToolbarItem, aJ as ToolbarProps, aU as Typography, aV as TypographyLinkProps, aW as TypographyProps, aX as TypographyTitleProps, aY as TypographyType, aZ as Upload, a_ as UploadChangeInfo, a$ as UploadDraggerProps, b0 as UploadFile, b1 as UploadFileStatus, b4 as UploadProps, b8 as UploadRequestOptions, bc as message } from './core-Bm-1bOjF.js';
2
+ export { b as Button, B as ButtonProps, a as ButtonSize, c as ButtonVariant } from './Button-BiL3Wjsd.js';
3
+ export { e as Modal, d as ModalActionResult, M as ModalOpenConfig, f as ModalProps, g as ModalType, a as OverlayApiHandle, h as Select, S as SelectOption, c as SelectProps, j as SelectValue } from './Select-BddM4uXC.js';
3
4
  import 'react';
4
5
  import './shared-Bx4B28Wh.js';
package/dist/core.js CHANGED
@@ -11,20 +11,25 @@ import {
11
11
  Typography,
12
12
  Upload,
13
13
  message
14
- } from "./chunk-X4OLHWC3.js";
14
+ } from "./chunk-JEDJQ257.js";
15
+ import "./chunk-RX242MUO.js";
15
16
  import {
16
17
  Select
17
- } from "./chunk-EYB55TC5.js";
18
+ } from "./chunk-D3HXXEEZ.js";
18
19
  import {
19
- Icon,
20
20
  Input,
21
- Modal,
22
21
  Segmented
23
- } from "./chunk-V6CRVCSB.js";
22
+ } from "./chunk-4TTHKFJ7.js";
23
+ import "./chunk-SCEHVGKV.js";
24
+ import {
25
+ Icon,
26
+ Modal
27
+ } from "./chunk-QV3AP6A2.js";
24
28
  import {
25
29
  Button
26
- } from "./chunk-SJFT5OSX.js";
27
- import "./chunk-PUZWLIIJ.js";
30
+ } from "./chunk-CZ2ITBRW.js";
31
+ import "./chunk-KY6A5IJH.js";
32
+ import "./chunk-NZMUW5XI.js";
28
33
  export {
29
34
  Breadcrumb,
30
35
  Button,