@sia.soul/sia-react-ui 0.1.13 → 0.1.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chart.cjs +21 -13
- package/dist/chart.js +4 -4
- package/dist/{chunk-RLTG3IK7.js → chunk-25BU7YTB.js} +21 -11
- package/dist/{chunk-EJDPRAU2.js → chunk-3VJ4CZDQ.js} +7 -0
- package/dist/{chunk-JJVD2ITI.js → chunk-ALWHRV4L.js} +7 -4
- package/dist/{chunk-MOOMDRAN.js → chunk-E7F47Z2C.js} +11 -8
- package/dist/{chunk-F3VH6LJH.js → chunk-MUTJVDM6.js} +3 -3
- package/dist/{chunk-Z3T6RDQP.js → chunk-OKP4DIQH.js} +2 -2
- package/dist/{chunk-5ZTWY3PG.js → chunk-QJ4OQNQ4.js} +3 -3
- package/dist/{chunk-BUMS62NO.js → chunk-R3TYVU53.js} +14 -8
- package/dist/{chunk-MBS2HXLZ.js → chunk-TZGUBGA4.js} +6 -1
- package/dist/{chunk-WHARTF2I.js → chunk-YT6E3X2K.js} +5 -2
- package/dist/{core-y0w5PBO2.d.cts → core-AeKYVPDZ.d.cts} +7 -4
- package/dist/{core-VmiEI1Jp.d.ts → core-DcSXqSRs.d.ts} +7 -4
- package/dist/core.cjs +56 -41
- package/dist/core.css +467 -40
- package/dist/core.d.cts +1 -1
- package/dist/core.d.ts +1 -1
- package/dist/core.js +6 -6
- package/dist/index.cjs +512 -112
- package/dist/index.css +467 -40
- package/dist/index.d.cts +77 -15
- package/dist/index.d.ts +77 -15
- package/dist/index.js +452 -76
- package/dist/markdown-editor.cjs +3 -2
- package/dist/markdown-editor.js +2 -2
- package/dist/rich-text-editor.cjs +9 -2
- package/dist/rich-text-editor.js +4 -4
- package/dist/{select-date-range-D-JMfpwD.d.ts → select-date-range-Bdb-hi9c.d.ts} +3 -3
- package/dist/{select-date-range-l-xgB959.d.cts → select-date-range-shDQ5uJA.d.cts} +3 -3
- package/dist/select-date-range.cjs +35 -15
- package/dist/select-date-range.d.cts +1 -1
- package/dist/select-date-range.d.ts +1 -1
- package/dist/select-date-range.js +5 -5
- package/package.json +1 -1
package/dist/markdown-editor.cjs
CHANGED
|
@@ -36,6 +36,7 @@ module.exports = __toCommonJS(markdown_editor_exports);
|
|
|
36
36
|
|
|
37
37
|
// src/components/shared.ts
|
|
38
38
|
var import_react = require("react");
|
|
39
|
+
var ControlSizeContext = (0, import_react.createContext)("medium");
|
|
39
40
|
var PlaceholderModeContext = (0, import_react.createContext)("default");
|
|
40
41
|
function usePlaceholderMode(mode) {
|
|
41
42
|
const inherited = (0, import_react.useContext)(PlaceholderModeContext);
|
|
@@ -325,7 +326,7 @@ function MarkdownEditor({
|
|
|
325
326
|
width: "100%",
|
|
326
327
|
height: "100%",
|
|
327
328
|
minHeight: typeof minHeight === "number" ? minHeight : void 0,
|
|
328
|
-
placeholder,
|
|
329
|
+
placeholder: floating.enabled ? "" : placeholder,
|
|
329
330
|
cdn: assetBaseUrl,
|
|
330
331
|
cache: { enable: false },
|
|
331
332
|
toolbar,
|
|
@@ -405,7 +406,7 @@ function MarkdownEditor({
|
|
|
405
406
|
if (editorRef.current === createdEditor) editorRef.current = null;
|
|
406
407
|
if (editorInitialized) createdEditor?.destroy();
|
|
407
408
|
};
|
|
408
|
-
}, [ariaLabel, assetBaseUrl, hasImageUpload, minHeight, mode, placeholder]);
|
|
409
|
+
}, [ariaLabel, assetBaseUrl, hasImageUpload, minHeight, mode, placeholder, floating.enabled]);
|
|
409
410
|
(0, import_react2.useEffect)(() => {
|
|
410
411
|
const editor = editorRef.current;
|
|
411
412
|
if (!editor || value === void 0) return;
|
package/dist/markdown-editor.js
CHANGED
|
@@ -37,6 +37,11 @@ module.exports = __toCommonJS(rich_text_editor_exports);
|
|
|
37
37
|
|
|
38
38
|
// src/components/shared.ts
|
|
39
39
|
var import_react = require("react");
|
|
40
|
+
var ControlSizeContext = (0, import_react.createContext)("medium");
|
|
41
|
+
function useControlSize(size) {
|
|
42
|
+
const inherited = (0, import_react.useContext)(ControlSizeContext);
|
|
43
|
+
return size ?? inherited;
|
|
44
|
+
}
|
|
40
45
|
var PlaceholderModeContext = (0, import_react.createContext)("default");
|
|
41
46
|
function usePlaceholderMode(mode) {
|
|
42
47
|
const inherited = (0, import_react.useContext)(PlaceholderModeContext);
|
|
@@ -85,7 +90,7 @@ var import_react2 = require("react");
|
|
|
85
90
|
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
86
91
|
var Button = (0, import_react2.forwardRef)(function Button2({
|
|
87
92
|
variant = "default",
|
|
88
|
-
size
|
|
93
|
+
size: sizeProp,
|
|
89
94
|
loading = false,
|
|
90
95
|
block = false,
|
|
91
96
|
danger = false,
|
|
@@ -98,6 +103,7 @@ var Button = (0, import_react2.forwardRef)(function Button2({
|
|
|
98
103
|
style,
|
|
99
104
|
...props
|
|
100
105
|
}, forwardedRef) {
|
|
106
|
+
const size = useControlSize(sizeProp);
|
|
101
107
|
const localRef = (0, import_react2.useRef)(null);
|
|
102
108
|
function setRef(node) {
|
|
103
109
|
localRef.current = node;
|
|
@@ -1506,7 +1512,7 @@ var Input = (0, import_react7.forwardRef)(function Input2({
|
|
|
1506
1512
|
label,
|
|
1507
1513
|
hint,
|
|
1508
1514
|
status = "default",
|
|
1509
|
-
size
|
|
1515
|
+
size: sizeProp,
|
|
1510
1516
|
prefix,
|
|
1511
1517
|
suffix,
|
|
1512
1518
|
allowClear = false,
|
|
@@ -1523,6 +1529,7 @@ var Input = (0, import_react7.forwardRef)(function Input2({
|
|
|
1523
1529
|
onChange,
|
|
1524
1530
|
...props
|
|
1525
1531
|
}, forwardedRef) {
|
|
1532
|
+
const size = useControlSize(sizeProp);
|
|
1526
1533
|
const fallbackId = (0, import_react7.useId)();
|
|
1527
1534
|
const inputId = id ?? fallbackId;
|
|
1528
1535
|
const localRef = (0, import_react7.useRef)(null);
|
package/dist/rich-text-editor.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
RichTextContent,
|
|
3
3
|
RichTextEditor
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-
|
|
6
|
-
import "./chunk-
|
|
7
|
-
import "./chunk-
|
|
4
|
+
} from "./chunk-MUTJVDM6.js";
|
|
5
|
+
import "./chunk-ALWHRV4L.js";
|
|
6
|
+
import "./chunk-TZGUBGA4.js";
|
|
7
|
+
import "./chunk-3VJ4CZDQ.js";
|
|
8
8
|
export {
|
|
9
9
|
RichTextContent,
|
|
10
10
|
RichTextEditor
|
|
@@ -62,8 +62,8 @@ interface DateRangePickerProps extends Omit<DatePickerProps, "value" | "defaultV
|
|
|
62
62
|
onCalendarChange?: (value: readonly [string, string]) => void;
|
|
63
63
|
onChange?: (value: readonly [string, string]) => void;
|
|
64
64
|
}
|
|
65
|
-
declare function DateRangePicker({ value, defaultValue, placeholder, placeholderMode, separator, presets, maxRangeDays, allowEmpty, endpointDisabled, size, status, allowClear, needConfirm, showTime, showToday, open, defaultOpen, suffixIcon, minDate, maxDate, disabledDate, disabled, className, onCalendarChange, onChange, onOpenChange, formatValue, renderExtraFooter, ...props }: DateRangePickerProps): react.JSX.Element;
|
|
66
|
-
declare function DatePicker({ value, defaultValue, picker, size, status, allowClear, multiple, needConfirm, showTime, showToday, open, defaultOpen, suffixIcon, minDate, maxDate, presets, disabledDate, disabled, className, onChange, onOpenChange, placeholder, placeholderMode, formatValue, renderExtraFooter, ...props }: DatePickerProps): react.JSX.Element;
|
|
65
|
+
declare function DateRangePicker({ value, defaultValue, placeholder, placeholderMode, separator, presets, maxRangeDays, allowEmpty, endpointDisabled, size: sizeProp, status, allowClear, needConfirm, showTime, showToday, open, defaultOpen, suffixIcon, minDate, maxDate, disabledDate, disabled, className, onCalendarChange, onChange, onOpenChange, formatValue, renderExtraFooter, ...props }: DateRangePickerProps): react.JSX.Element;
|
|
66
|
+
declare function DatePicker({ value, defaultValue, picker, size: sizeProp, status, allowClear, multiple, needConfirm, showTime, showToday, open, defaultOpen, suffixIcon, minDate, maxDate, presets, disabledDate, disabled, className, onChange, onOpenChange, placeholder, placeholderMode, formatValue, renderExtraFooter, ...props }: DatePickerProps): react.JSX.Element;
|
|
67
67
|
declare namespace DatePicker {
|
|
68
68
|
const RangePicker: typeof DateRangePicker;
|
|
69
69
|
}
|
|
@@ -89,6 +89,6 @@ interface SelectDateRangeProps extends Omit<HTMLAttributes<HTMLDivElement>, "def
|
|
|
89
89
|
disabled?: boolean;
|
|
90
90
|
onChange?: (value: SelectDateRangeValue) => void;
|
|
91
91
|
}
|
|
92
|
-
declare function SelectDateRange({ options, value, defaultValue, selectPlaceholder, placeholderMode, selectWidth, rangePlaceholder, selectAriaLabel, rangeAriaLabel, presets, size, status, disabled, onChange, className, style, ...props }: SelectDateRangeProps): react.JSX.Element;
|
|
92
|
+
declare function SelectDateRange({ options, value, defaultValue, selectPlaceholder, placeholderMode, selectWidth, rangePlaceholder, selectAriaLabel, rangeAriaLabel, presets, size: sizeProp, status, disabled, onChange, className, style, ...props }: SelectDateRangeProps): react.JSX.Element;
|
|
93
93
|
|
|
94
94
|
export { DatePicker as D, SelectDateRange as S, type DatePickerDisabledInfo as a, type DatePickerPreset as b, type DatePickerProps as c, type DatePickerShowTime as d, type DatePickerType as e, type DatePickerValue as f, type DateRangePickerPreset as g, type DateRangePickerProps as h, type SelectDateRangeProps as i, type SelectDateRangeValue as j };
|
|
@@ -62,8 +62,8 @@ interface DateRangePickerProps extends Omit<DatePickerProps, "value" | "defaultV
|
|
|
62
62
|
onCalendarChange?: (value: readonly [string, string]) => void;
|
|
63
63
|
onChange?: (value: readonly [string, string]) => void;
|
|
64
64
|
}
|
|
65
|
-
declare function DateRangePicker({ value, defaultValue, placeholder, placeholderMode, separator, presets, maxRangeDays, allowEmpty, endpointDisabled, size, status, allowClear, needConfirm, showTime, showToday, open, defaultOpen, suffixIcon, minDate, maxDate, disabledDate, disabled, className, onCalendarChange, onChange, onOpenChange, formatValue, renderExtraFooter, ...props }: DateRangePickerProps): react.JSX.Element;
|
|
66
|
-
declare function DatePicker({ value, defaultValue, picker, size, status, allowClear, multiple, needConfirm, showTime, showToday, open, defaultOpen, suffixIcon, minDate, maxDate, presets, disabledDate, disabled, className, onChange, onOpenChange, placeholder, placeholderMode, formatValue, renderExtraFooter, ...props }: DatePickerProps): react.JSX.Element;
|
|
65
|
+
declare function DateRangePicker({ value, defaultValue, placeholder, placeholderMode, separator, presets, maxRangeDays, allowEmpty, endpointDisabled, size: sizeProp, status, allowClear, needConfirm, showTime, showToday, open, defaultOpen, suffixIcon, minDate, maxDate, disabledDate, disabled, className, onCalendarChange, onChange, onOpenChange, formatValue, renderExtraFooter, ...props }: DateRangePickerProps): react.JSX.Element;
|
|
66
|
+
declare function DatePicker({ value, defaultValue, picker, size: sizeProp, status, allowClear, multiple, needConfirm, showTime, showToday, open, defaultOpen, suffixIcon, minDate, maxDate, presets, disabledDate, disabled, className, onChange, onOpenChange, placeholder, placeholderMode, formatValue, renderExtraFooter, ...props }: DatePickerProps): react.JSX.Element;
|
|
67
67
|
declare namespace DatePicker {
|
|
68
68
|
const RangePicker: typeof DateRangePicker;
|
|
69
69
|
}
|
|
@@ -89,6 +89,6 @@ interface SelectDateRangeProps extends Omit<HTMLAttributes<HTMLDivElement>, "def
|
|
|
89
89
|
disabled?: boolean;
|
|
90
90
|
onChange?: (value: SelectDateRangeValue) => void;
|
|
91
91
|
}
|
|
92
|
-
declare function SelectDateRange({ options, value, defaultValue, selectPlaceholder, placeholderMode, selectWidth, rangePlaceholder, selectAriaLabel, rangeAriaLabel, presets, size, status, disabled, onChange, className, style, ...props }: SelectDateRangeProps): react.JSX.Element;
|
|
92
|
+
declare function SelectDateRange({ options, value, defaultValue, selectPlaceholder, placeholderMode, selectWidth, rangePlaceholder, selectAriaLabel, rangeAriaLabel, presets, size: sizeProp, status, disabled, onChange, className, style, ...props }: SelectDateRangeProps): react.JSX.Element;
|
|
93
93
|
|
|
94
94
|
export { DatePicker as D, SelectDateRange as S, type DatePickerDisabledInfo as a, type DatePickerPreset as b, type DatePickerProps as c, type DatePickerShowTime as d, type DatePickerType as e, type DatePickerValue as f, type DateRangePickerPreset as g, type DateRangePickerProps as h, type SelectDateRangeProps as i, type SelectDateRangeValue as j };
|
|
@@ -26,6 +26,11 @@ module.exports = __toCommonJS(select_date_range_exports);
|
|
|
26
26
|
|
|
27
27
|
// src/components/shared.ts
|
|
28
28
|
var import_react = require("react");
|
|
29
|
+
var ControlSizeContext = (0, import_react.createContext)("medium");
|
|
30
|
+
function useControlSize(size) {
|
|
31
|
+
const inherited = (0, import_react.useContext)(ControlSizeContext);
|
|
32
|
+
return size ?? inherited;
|
|
33
|
+
}
|
|
29
34
|
var PlaceholderModeContext = (0, import_react.createContext)("default");
|
|
30
35
|
function usePlaceholderMode(mode) {
|
|
31
36
|
const inherited = (0, import_react.useContext)(PlaceholderModeContext);
|
|
@@ -1242,7 +1247,7 @@ function DatePicker({
|
|
|
1242
1247
|
value,
|
|
1243
1248
|
defaultValue,
|
|
1244
1249
|
picker = "date",
|
|
1245
|
-
size
|
|
1250
|
+
size: sizeProp,
|
|
1246
1251
|
status = "default",
|
|
1247
1252
|
allowClear = true,
|
|
1248
1253
|
multiple = false,
|
|
@@ -1266,6 +1271,7 @@ function DatePicker({
|
|
|
1266
1271
|
renderExtraFooter,
|
|
1267
1272
|
...props
|
|
1268
1273
|
}) {
|
|
1274
|
+
const size = useControlSize(sizeProp);
|
|
1269
1275
|
const id = (0, import_react5.useId)();
|
|
1270
1276
|
const rootRef = (0, import_react5.useRef)(null);
|
|
1271
1277
|
const popupRef = (0, import_react5.useRef)(null);
|
|
@@ -1426,7 +1432,7 @@ function DateRangePicker({
|
|
|
1426
1432
|
maxRangeDays,
|
|
1427
1433
|
allowEmpty = [false, false],
|
|
1428
1434
|
endpointDisabled = [false, false],
|
|
1429
|
-
size
|
|
1435
|
+
size: sizeProp,
|
|
1430
1436
|
status = "default",
|
|
1431
1437
|
allowClear = true,
|
|
1432
1438
|
needConfirm,
|
|
@@ -1447,6 +1453,7 @@ function DateRangePicker({
|
|
|
1447
1453
|
renderExtraFooter,
|
|
1448
1454
|
...props
|
|
1449
1455
|
}) {
|
|
1456
|
+
const size = useControlSize(sizeProp);
|
|
1450
1457
|
const id = (0, import_react5.useId)();
|
|
1451
1458
|
const rootRef = (0, import_react5.useRef)(null);
|
|
1452
1459
|
const popupRef = (0, import_react5.useRef)(null);
|
|
@@ -1687,8 +1694,9 @@ function DateRangePicker({
|
|
|
1687
1694
|
endpointLabel
|
|
1688
1695
|
);
|
|
1689
1696
|
}
|
|
1690
|
-
const
|
|
1691
|
-
|
|
1697
|
+
const startFloating = useFloatingPlaceholder({ mode: placeholderMode, placeholder: placeholder[0], filled: Boolean(currentValue[0]), active: visible });
|
|
1698
|
+
const endFloating = useFloatingPlaceholder({ mode: placeholderMode, placeholder: placeholder[1], filled: Boolean(currentValue[1]), active: visible });
|
|
1699
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("span", { ref: rootRef, className: `sia-picker sia-picker-range-control sia-picker--${size} sia-picker--${status}${visible ? " is-open" : ""}${disabled ? " is-disabled" : ""} ${className}`.trim(), children: [
|
|
1692
1700
|
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
|
|
1693
1701
|
"button",
|
|
1694
1702
|
{
|
|
@@ -1705,14 +1713,19 @@ function DateRangePicker({
|
|
|
1705
1713
|
disabled,
|
|
1706
1714
|
onClick: () => changeOpen(!visible),
|
|
1707
1715
|
children: [
|
|
1708
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.
|
|
1716
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("span", { className: `sia-picker-range-control__field${startFloating.className}`, children: [
|
|
1717
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: `sia-picker-range-control__value${currentValue[0] ? "" : " is-placeholder"}`, children: currentValue[0] ? formatValue(currentValue[0]) : placeholder[0] }),
|
|
1718
|
+
startFloating.label
|
|
1719
|
+
] }),
|
|
1709
1720
|
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "sia-picker-range-control__separator", children: separator }),
|
|
1710
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.
|
|
1721
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("span", { className: `sia-picker-range-control__field${endFloating.className}`, children: [
|
|
1722
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: `sia-picker-range-control__value${currentValue[1] ? "" : " is-placeholder"}`, children: currentValue[1] ? formatValue(currentValue[1]) : placeholder[1] }),
|
|
1723
|
+
endFloating.label
|
|
1724
|
+
] }),
|
|
1711
1725
|
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "sia-picker__icon", "aria-hidden": "true", children: suffixIcon ?? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Icon, { name: "calendar", size: 16 }) })
|
|
1712
1726
|
]
|
|
1713
1727
|
}
|
|
1714
1728
|
),
|
|
1715
|
-
floating.label,
|
|
1716
1729
|
allowClear && (currentValue[0] || currentValue[1]) && !disabled ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("button", { type: "button", className: "sia-picker__clear", "aria-label": "\u6E05\u9664\u65E5\u671F\u8303\u56F4", onClick: clearValue, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Icon, { name: "circle-close", variant: "filled", size: 15 }) }) : null,
|
|
1717
1730
|
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(PopupPortal, { ref: popupRef, anchorRef: rootRef, open: visible, className: `sia-date-panel sia-date-panel--range${showTime ? ` sia-date-panel--with-time sia-date-panel--range-time-${compactDateTime ? "compact" : "paired"}` : ""}${presets?.length ? " sia-date-panel--with-presets" : ""}`, role: "dialog", "aria-label": "\u65E5\u671F\u8303\u56F4\u9009\u62E9\u9762\u677F", children: [
|
|
1718
1731
|
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "sia-date-panel__body", children: showTime ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "sia-date-panel__range-date-time", children: compactDateTime ? renderDateTimeGroup(activeIndex) : /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, { children: [
|
|
@@ -1787,7 +1800,7 @@ var import_react6 = require("react");
|
|
|
1787
1800
|
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
1788
1801
|
var Button = (0, import_react6.forwardRef)(function Button2({
|
|
1789
1802
|
variant = "default",
|
|
1790
|
-
size
|
|
1803
|
+
size: sizeProp,
|
|
1791
1804
|
loading = false,
|
|
1792
1805
|
block = false,
|
|
1793
1806
|
danger = false,
|
|
@@ -1800,6 +1813,7 @@ var Button = (0, import_react6.forwardRef)(function Button2({
|
|
|
1800
1813
|
style,
|
|
1801
1814
|
...props
|
|
1802
1815
|
}, forwardedRef) {
|
|
1816
|
+
const size = useControlSize(sizeProp);
|
|
1803
1817
|
const localRef = (0, import_react6.useRef)(null);
|
|
1804
1818
|
function setRef(node) {
|
|
1805
1819
|
localRef.current = node;
|
|
@@ -2138,7 +2152,7 @@ var Input = (0, import_react9.forwardRef)(function Input2({
|
|
|
2138
2152
|
label,
|
|
2139
2153
|
hint,
|
|
2140
2154
|
status = "default",
|
|
2141
|
-
size
|
|
2155
|
+
size: sizeProp,
|
|
2142
2156
|
prefix,
|
|
2143
2157
|
suffix,
|
|
2144
2158
|
allowClear = false,
|
|
@@ -2155,6 +2169,7 @@ var Input = (0, import_react9.forwardRef)(function Input2({
|
|
|
2155
2169
|
onChange,
|
|
2156
2170
|
...props
|
|
2157
2171
|
}, forwardedRef) {
|
|
2172
|
+
const size = useControlSize(sizeProp);
|
|
2158
2173
|
const fallbackId = (0, import_react9.useId)();
|
|
2159
2174
|
const inputId = id ?? fallbackId;
|
|
2160
2175
|
const localRef = (0, import_react9.useRef)(null);
|
|
@@ -2238,7 +2253,8 @@ var Input = (0, import_react9.forwardRef)(function Input2({
|
|
|
2238
2253
|
var import_react10 = require("react");
|
|
2239
2254
|
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
2240
2255
|
var CheckboxGroupContext = (0, import_react10.createContext)(null);
|
|
2241
|
-
var CheckboxRoot = (0, import_react10.forwardRef)(function Checkbox({ value, indeterminate = false, children, disabled, checked, defaultChecked, className = "", onChange, ...props }, forwardedRef) {
|
|
2256
|
+
var CheckboxRoot = (0, import_react10.forwardRef)(function Checkbox({ value, size: sizeProp, indeterminate = false, children, disabled, checked, defaultChecked, className = "", onChange, ...props }, forwardedRef) {
|
|
2257
|
+
const size = useControlSize(sizeProp);
|
|
2242
2258
|
const group = (0, import_react10.useContext)(CheckboxGroupContext);
|
|
2243
2259
|
const localRef = (0, import_react10.useRef)(null);
|
|
2244
2260
|
const fallbackId = (0, import_react10.useId)();
|
|
@@ -2252,7 +2268,7 @@ var CheckboxRoot = (0, import_react10.forwardRef)(function Checkbox({ value, ind
|
|
|
2252
2268
|
if (typeof forwardedRef === "function") forwardedRef(node);
|
|
2253
2269
|
else if (forwardedRef) forwardedRef.current = node;
|
|
2254
2270
|
}
|
|
2255
|
-
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("label", { className: `sia-checkbox${disabled || group?.disabled ? " is-disabled" : ""} ${className}`.trim(), children: [
|
|
2271
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("label", { className: `sia-checkbox sia-checkbox--${size}${disabled || group?.disabled ? " is-disabled" : ""} ${className}`.trim(), children: [
|
|
2256
2272
|
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
2257
2273
|
"input",
|
|
2258
2274
|
{
|
|
@@ -2277,6 +2293,7 @@ var CheckboxRoot = (0, import_react10.forwardRef)(function Checkbox({ value, ind
|
|
|
2277
2293
|
] });
|
|
2278
2294
|
});
|
|
2279
2295
|
function CheckboxGroup({
|
|
2296
|
+
size: sizeProp,
|
|
2280
2297
|
value,
|
|
2281
2298
|
defaultValue = [],
|
|
2282
2299
|
options,
|
|
@@ -2286,6 +2303,7 @@ function CheckboxGroup({
|
|
|
2286
2303
|
children,
|
|
2287
2304
|
onChange
|
|
2288
2305
|
}) {
|
|
2306
|
+
const size = useControlSize(sizeProp);
|
|
2289
2307
|
const [values, setValues] = useControllableState({ value, defaultValue, onChange });
|
|
2290
2308
|
const context = (0, import_react10.useMemo)(() => ({
|
|
2291
2309
|
values,
|
|
@@ -2296,13 +2314,13 @@ function CheckboxGroup({
|
|
|
2296
2314
|
setValues(next);
|
|
2297
2315
|
}
|
|
2298
2316
|
}), [disabled, name, setValues, values]);
|
|
2299
|
-
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(CheckboxGroupContext.Provider, { value: context, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: `sia-checkbox-group ${className}`.trim(), role: "group", children: [
|
|
2317
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(ControlSizeContext.Provider, { value: size, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(CheckboxGroupContext.Provider, { value: context, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: `sia-checkbox-group ${className}`.trim(), role: "group", children: [
|
|
2300
2318
|
options?.map((option) => {
|
|
2301
2319
|
const normalized = typeof option === "object" ? option : { label: String(option), value: option };
|
|
2302
2320
|
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(CheckboxRoot, { value: normalized.value, disabled: normalized.disabled, children: normalized.label }, normalized.value);
|
|
2303
2321
|
}),
|
|
2304
2322
|
children
|
|
2305
|
-
] }) });
|
|
2323
|
+
] }) }) });
|
|
2306
2324
|
}
|
|
2307
2325
|
var Checkbox2 = Object.assign(CheckboxRoot, { Group: CheckboxGroup });
|
|
2308
2326
|
|
|
@@ -2736,7 +2754,7 @@ var Select = (0, import_react14.forwardRef)(function Select2({
|
|
|
2736
2754
|
onChange,
|
|
2737
2755
|
placeholder = "\u8BF7\u9009\u62E9",
|
|
2738
2756
|
placeholderMode,
|
|
2739
|
-
size
|
|
2757
|
+
size: sizeProp,
|
|
2740
2758
|
status = "default",
|
|
2741
2759
|
allowClear = false,
|
|
2742
2760
|
loading = false,
|
|
@@ -2762,6 +2780,7 @@ var Select = (0, import_react14.forwardRef)(function Select2({
|
|
|
2762
2780
|
onKeyDown,
|
|
2763
2781
|
...props
|
|
2764
2782
|
}, forwardedRef) {
|
|
2783
|
+
const size = useControlSize(sizeProp);
|
|
2765
2784
|
const fallbackId = (0, import_react14.useId)();
|
|
2766
2785
|
const selectId = id ?? fallbackId;
|
|
2767
2786
|
const listboxId = `${selectId}-listbox`;
|
|
@@ -3157,7 +3176,7 @@ function SelectDateRange({
|
|
|
3157
3176
|
selectAriaLabel = "\u9009\u62E9\u7C7B\u578B",
|
|
3158
3177
|
rangeAriaLabel = "\u65E5\u671F\u8303\u56F4",
|
|
3159
3178
|
presets,
|
|
3160
|
-
size
|
|
3179
|
+
size: sizeProp,
|
|
3161
3180
|
status = "default",
|
|
3162
3181
|
disabled = false,
|
|
3163
3182
|
onChange,
|
|
@@ -3165,6 +3184,7 @@ function SelectDateRange({
|
|
|
3165
3184
|
style,
|
|
3166
3185
|
...props
|
|
3167
3186
|
}) {
|
|
3187
|
+
const size = useControlSize(sizeProp);
|
|
3168
3188
|
const initialValue = defaultValue ?? { select: options[0]?.value ?? "", range: ["", ""] };
|
|
3169
3189
|
const [currentValue, setCurrentValue] = useControllableState({ value: value === void 0 ? void 0 : value && typeof value === "object" ? value : { select: "", range: ["", ""] }, defaultValue: initialValue, onChange });
|
|
3170
3190
|
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: `sia-select-date-range sia-select-date-range--${size} ${className}`.trim(), role: "group", "aria-label": `${selectAriaLabel}\u4E0E${rangeAriaLabel}`, ...props, style: { ...style, "--sia-select-date-range-select-width": typeof selectWidth === "number" ? `${selectWidth}px` : selectWidth }, children: [
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { S as SelectDateRange, i as SelectDateRangeProps, j as SelectDateRangeValue } from './select-date-range-
|
|
1
|
+
export { S as SelectDateRange, i as SelectDateRangeProps, j as SelectDateRangeValue } from './select-date-range-shDQ5uJA.cjs';
|
|
2
2
|
import 'react';
|
|
3
3
|
import './shared-DAYZvZVu.cjs';
|
|
4
4
|
import './Select-CVvF4mcy.cjs';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { S as SelectDateRange, i as SelectDateRangeProps, j as SelectDateRangeValue } from './select-date-range-
|
|
1
|
+
export { S as SelectDateRange, i as SelectDateRangeProps, j as SelectDateRangeValue } from './select-date-range-Bdb-hi9c.js';
|
|
2
2
|
import 'react';
|
|
3
3
|
import './shared-DAYZvZVu.js';
|
|
4
4
|
import './Select-Ce2Irbpt.js';
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
SelectDateRange
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
5
|
-
import "./chunk-
|
|
6
|
-
import "./chunk-
|
|
7
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-25BU7YTB.js";
|
|
4
|
+
import "./chunk-R3TYVU53.js";
|
|
5
|
+
import "./chunk-ALWHRV4L.js";
|
|
6
|
+
import "./chunk-TZGUBGA4.js";
|
|
7
|
+
import "./chunk-3VJ4CZDQ.js";
|
|
8
8
|
export {
|
|
9
9
|
SelectDateRange
|
|
10
10
|
};
|