@sia.soul/sia-react-ui 0.1.77 → 0.1.78
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.js +2 -3
- package/dist/{chunk-Q4FDV6KP.js → chunk-BDS42FR3.js} +2 -4
- package/dist/{chunk-JNZXYBGM.js → chunk-GODBVCIQ.js} +2 -2
- package/dist/chunk-JZWTTSOZ.js +131 -0
- package/dist/{chunk-QDZXP2UO.js → chunk-NK2FZWKM.js} +8 -10
- package/dist/{chunk-TKCXP6RZ.js → chunk-WXERMWTW.js} +113 -436
- package/dist/{chunk-YMOOL62S.js → chunk-XHLIIDD2.js} +407 -21
- package/dist/{chunk-K5OU5NOT.js → chunk-Y4Y2NVBM.js} +2 -2
- package/dist/{core-CBLT4Vfl.d.ts → core-0ml74Q-C.d.ts} +7 -0
- package/dist/{core-Bx07vzrr.d.cts → core-vGTHkzIa.d.cts} +7 -0
- package/dist/core.cjs +336 -275
- package/dist/core.css +19 -0
- package/dist/core.d.cts +1 -1
- package/dist/core.d.ts +1 -1
- package/dist/core.js +5 -6
- package/dist/index.cjs +1006 -943
- package/dist/index.css +19 -0
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +13 -15
- package/dist/rich-text-editor.cjs +522 -74
- package/dist/rich-text-editor.js +3 -3
- package/dist/select-date-range.cjs +305 -178
- package/dist/select-date-range.js +4 -4
- package/package.json +1 -1
- package/dist/chunk-IKAMZNCK.js +0 -65
- package/dist/chunk-SMCYEPBL.js +0 -73
package/dist/chart.js
CHANGED
|
@@ -56,9 +56,8 @@ import {
|
|
|
56
56
|
smoothSvgPath,
|
|
57
57
|
svgArcPath,
|
|
58
58
|
transferCompositeValue
|
|
59
|
-
} from "./chunk-
|
|
60
|
-
import "./chunk-
|
|
61
|
-
import "./chunk-IKAMZNCK.js";
|
|
59
|
+
} from "./chunk-BDS42FR3.js";
|
|
60
|
+
import "./chunk-JZWTTSOZ.js";
|
|
62
61
|
import "./chunk-H7IAG72O.js";
|
|
63
62
|
export {
|
|
64
63
|
BarChart,
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import {
|
|
2
|
+
useControlSize,
|
|
3
|
+
useFloatingPlaceholder,
|
|
4
|
+
withTitleTooltip
|
|
5
|
+
} from "./chunk-H7IAG72O.js";
|
|
6
|
+
|
|
7
|
+
// src/components/Button.tsx
|
|
8
|
+
import { forwardRef, useRef } from "react";
|
|
9
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
10
|
+
var Button = forwardRef(function Button2({
|
|
11
|
+
variant = "default",
|
|
12
|
+
size: sizeProp,
|
|
13
|
+
loading = false,
|
|
14
|
+
block = false,
|
|
15
|
+
danger = false,
|
|
16
|
+
icon,
|
|
17
|
+
iconPosition = "start",
|
|
18
|
+
className = "",
|
|
19
|
+
children,
|
|
20
|
+
disabled,
|
|
21
|
+
onClick,
|
|
22
|
+
style,
|
|
23
|
+
...props
|
|
24
|
+
}, forwardedRef) {
|
|
25
|
+
const size = useControlSize(sizeProp);
|
|
26
|
+
const localRef = useRef(null);
|
|
27
|
+
function setRef(node) {
|
|
28
|
+
localRef.current = node;
|
|
29
|
+
if (typeof forwardedRef === "function") forwardedRef(node);
|
|
30
|
+
else if (forwardedRef) forwardedRef.current = node;
|
|
31
|
+
}
|
|
32
|
+
function handleClick(event) {
|
|
33
|
+
const button = localRef.current;
|
|
34
|
+
if (button && variant === "primary") {
|
|
35
|
+
const rect = button.getBoundingClientRect();
|
|
36
|
+
button.style.setProperty("--sia-wave-x", `${event.clientX - rect.left}px`);
|
|
37
|
+
button.style.setProperty("--sia-wave-y", `${event.clientY - rect.top}px`);
|
|
38
|
+
button.dataset.wave = "active";
|
|
39
|
+
window.setTimeout(() => delete button.dataset.wave, 360);
|
|
40
|
+
}
|
|
41
|
+
onClick?.(event);
|
|
42
|
+
}
|
|
43
|
+
const mergedStyle = block ? { ...style, width: "100%" } : style ?? {};
|
|
44
|
+
return /* @__PURE__ */ jsxs(
|
|
45
|
+
"button",
|
|
46
|
+
{
|
|
47
|
+
ref: setRef,
|
|
48
|
+
type: "button",
|
|
49
|
+
className: `sia-button sia-button--${variant} sia-button--${size}${danger ? " sia-button--danger" : ""} ${className}`.trim(),
|
|
50
|
+
"aria-busy": loading || void 0,
|
|
51
|
+
disabled: disabled || loading,
|
|
52
|
+
onClick: handleClick,
|
|
53
|
+
style: mergedStyle,
|
|
54
|
+
...withTitleTooltip(props),
|
|
55
|
+
children: [
|
|
56
|
+
loading ? /* @__PURE__ */ jsx("span", { className: "sia-button__spinner", "aria-hidden": "true" }) : icon && iconPosition === "start" ? /* @__PURE__ */ jsx("span", { className: "sia-button__icon", children: icon }) : null,
|
|
57
|
+
children !== void 0 && children !== null ? /* @__PURE__ */ jsx("span", { children }) : null,
|
|
58
|
+
!loading && icon && iconPosition === "end" ? /* @__PURE__ */ jsx("span", { className: "sia-button__icon", children: icon }) : null
|
|
59
|
+
]
|
|
60
|
+
}
|
|
61
|
+
);
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
// src/components/TextArea.tsx
|
|
65
|
+
import { forwardRef as forwardRef2, useId, useState } from "react";
|
|
66
|
+
import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
67
|
+
var TextArea = forwardRef2(function TextArea2({
|
|
68
|
+
label,
|
|
69
|
+
hint,
|
|
70
|
+
status = "default",
|
|
71
|
+
size: sizeProp,
|
|
72
|
+
showCount = false,
|
|
73
|
+
placeholder,
|
|
74
|
+
placeholderMode,
|
|
75
|
+
className = "",
|
|
76
|
+
id,
|
|
77
|
+
disabled,
|
|
78
|
+
value,
|
|
79
|
+
defaultValue,
|
|
80
|
+
maxLength,
|
|
81
|
+
onChange,
|
|
82
|
+
...props
|
|
83
|
+
}, ref) {
|
|
84
|
+
const size = useControlSize(sizeProp);
|
|
85
|
+
const fallbackId = useId();
|
|
86
|
+
const textAreaId = id ?? fallbackId;
|
|
87
|
+
const [uncontrolledValue, setUncontrolledValue] = useState(() => defaultValue === void 0 ? "" : String(defaultValue));
|
|
88
|
+
const currentText = value !== void 0 ? String(value) : uncontrolledValue;
|
|
89
|
+
const floating = useFloatingPlaceholder({ mode: placeholderMode, placeholder, filled: currentText.length > 0 });
|
|
90
|
+
const hintId = `${textAreaId}-hint`;
|
|
91
|
+
const describedBy = [props["aria-describedby"], hint ? hintId : null].filter(Boolean).join(" ") || void 0;
|
|
92
|
+
function handleChange(event) {
|
|
93
|
+
setUncontrolledValue(event.target.value);
|
|
94
|
+
onChange?.(event);
|
|
95
|
+
}
|
|
96
|
+
const control = /* @__PURE__ */ jsxs2("span", { className: `sia-textarea-control sia-textarea-control--${size} sia-textarea-control--${status}${floating.className}${disabled ? " is-disabled" : ""}`, children: [
|
|
97
|
+
/* @__PURE__ */ jsx2(
|
|
98
|
+
"textarea",
|
|
99
|
+
{
|
|
100
|
+
...withTitleTooltip(props),
|
|
101
|
+
ref,
|
|
102
|
+
id: textAreaId,
|
|
103
|
+
className: "sia-textarea",
|
|
104
|
+
disabled,
|
|
105
|
+
value,
|
|
106
|
+
defaultValue,
|
|
107
|
+
maxLength,
|
|
108
|
+
placeholder,
|
|
109
|
+
"aria-describedby": describedBy,
|
|
110
|
+
"aria-invalid": status === "error" || void 0,
|
|
111
|
+
onChange: handleChange
|
|
112
|
+
}
|
|
113
|
+
),
|
|
114
|
+
floating.label,
|
|
115
|
+
showCount ? /* @__PURE__ */ jsxs2("span", { className: `sia-textarea-control__count${maxLength !== void 0 && currentText.length >= maxLength ? " is-limit" : ""}`, "aria-live": "polite", children: [
|
|
116
|
+
currentText.length,
|
|
117
|
+
maxLength !== void 0 ? `/${maxLength}` : null
|
|
118
|
+
] }) : null
|
|
119
|
+
] });
|
|
120
|
+
if (!label && !hint) return /* @__PURE__ */ jsx2("span", { className: `sia-field ${className}`.trim(), children: control });
|
|
121
|
+
return /* @__PURE__ */ jsxs2("span", { className: `sia-field ${className}`.trim(), children: [
|
|
122
|
+
label ? /* @__PURE__ */ jsx2("label", { className: "sia-field__label", htmlFor: textAreaId, children: label }) : null,
|
|
123
|
+
control,
|
|
124
|
+
hint ? /* @__PURE__ */ jsx2("span", { id: hintId, className: `sia-field__hint sia-field__hint--${status}`, children: hint }) : null
|
|
125
|
+
] });
|
|
126
|
+
});
|
|
127
|
+
|
|
128
|
+
export {
|
|
129
|
+
Button,
|
|
130
|
+
TextArea
|
|
131
|
+
};
|
|
@@ -1,18 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
TextArea
|
|
3
|
-
} from "./chunk-SMCYEPBL.js";
|
|
4
1
|
import {
|
|
5
2
|
Popover,
|
|
6
|
-
Tooltip
|
|
7
|
-
|
|
8
|
-
} from "./chunk-TKCXP6RZ.js";
|
|
3
|
+
Tooltip
|
|
4
|
+
} from "./chunk-WXERMWTW.js";
|
|
9
5
|
import {
|
|
10
6
|
Dropdown,
|
|
11
|
-
Icon
|
|
12
|
-
|
|
7
|
+
Icon,
|
|
8
|
+
useOverlayLifecycle
|
|
9
|
+
} from "./chunk-XHLIIDD2.js";
|
|
13
10
|
import {
|
|
14
|
-
Button
|
|
15
|
-
|
|
11
|
+
Button,
|
|
12
|
+
TextArea
|
|
13
|
+
} from "./chunk-JZWTTSOZ.js";
|
|
16
14
|
import {
|
|
17
15
|
useControlSize,
|
|
18
16
|
useControllableState,
|