@sia.soul/sia-react-ui 0.1.76 → 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.
@@ -1,4 +1,4 @@
1
- export { S as SelectDateRange, i as SelectDateRangeProps, j as SelectDateRangeValue } from './select-date-range-DN4eBuVx.cjs';
1
+ export { S as SelectDateRange, i as SelectDateRangeProps, j as SelectDateRangeValue } from './select-date-range-CRWxqHFp.cjs';
2
2
  import 'react';
3
3
  import './shared-Bx4B28Wh.cjs';
4
4
  import './Select-Bv2AmXRD.cjs';
@@ -1,4 +1,4 @@
1
- export { S as SelectDateRange, i as SelectDateRangeProps, j as SelectDateRangeValue } from './select-date-range-YrK9kuKW.js';
1
+ export { S as SelectDateRange, i as SelectDateRangeProps, j as SelectDateRangeValue } from './select-date-range-rtYL9egr.js';
2
2
  import 'react';
3
3
  import './shared-Bx4B28Wh.js';
4
4
  import './Select-Cc1owuvN.js';
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  SelectDateRange
3
- } from "./chunk-TG7ZYXA7.js";
4
- import "./chunk-TKCXP6RZ.js";
5
- import "./chunk-YMOOL62S.js";
6
- import "./chunk-IKAMZNCK.js";
3
+ } from "./chunk-Y4Y2NVBM.js";
4
+ import "./chunk-WXERMWTW.js";
5
+ import "./chunk-XHLIIDD2.js";
6
+ import "./chunk-JZWTTSOZ.js";
7
7
  import "./chunk-H7IAG72O.js";
8
8
  export {
9
9
  SelectDateRange
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sia.soul/sia-react-ui",
3
- "version": "0.1.76",
3
+ "version": "0.1.78",
4
4
  "description": "Sia Design components and tokens for React",
5
5
  "publishConfig": {
6
6
  "access": "public",
@@ -1,65 +0,0 @@
1
- import {
2
- useControlSize,
3
- withTitleTooltip
4
- } from "./chunk-H7IAG72O.js";
5
-
6
- // src/components/Button.tsx
7
- import { forwardRef, useRef } from "react";
8
- import { jsx, jsxs } from "react/jsx-runtime";
9
- var Button = forwardRef(function Button2({
10
- variant = "default",
11
- size: sizeProp,
12
- loading = false,
13
- block = false,
14
- danger = false,
15
- icon,
16
- iconPosition = "start",
17
- className = "",
18
- children,
19
- disabled,
20
- onClick,
21
- style,
22
- ...props
23
- }, forwardedRef) {
24
- const size = useControlSize(sizeProp);
25
- const localRef = useRef(null);
26
- function setRef(node) {
27
- localRef.current = node;
28
- if (typeof forwardedRef === "function") forwardedRef(node);
29
- else if (forwardedRef) forwardedRef.current = node;
30
- }
31
- function handleClick(event) {
32
- const button = localRef.current;
33
- if (button && variant === "primary") {
34
- const rect = button.getBoundingClientRect();
35
- button.style.setProperty("--sia-wave-x", `${event.clientX - rect.left}px`);
36
- button.style.setProperty("--sia-wave-y", `${event.clientY - rect.top}px`);
37
- button.dataset.wave = "active";
38
- window.setTimeout(() => delete button.dataset.wave, 360);
39
- }
40
- onClick?.(event);
41
- }
42
- const mergedStyle = block ? { ...style, width: "100%" } : style ?? {};
43
- return /* @__PURE__ */ jsxs(
44
- "button",
45
- {
46
- ref: setRef,
47
- type: "button",
48
- className: `sia-button sia-button--${variant} sia-button--${size}${danger ? " sia-button--danger" : ""} ${className}`.trim(),
49
- "aria-busy": loading || void 0,
50
- disabled: disabled || loading,
51
- onClick: handleClick,
52
- style: mergedStyle,
53
- ...withTitleTooltip(props),
54
- children: [
55
- loading ? /* @__PURE__ */ jsx("span", { className: "sia-button__spinner", "aria-hidden": "true" }) : icon && iconPosition === "start" ? /* @__PURE__ */ jsx("span", { className: "sia-button__icon", children: icon }) : null,
56
- children !== void 0 && children !== null ? /* @__PURE__ */ jsx("span", { children }) : null,
57
- !loading && icon && iconPosition === "end" ? /* @__PURE__ */ jsx("span", { className: "sia-button__icon", children: icon }) : null
58
- ]
59
- }
60
- );
61
- });
62
-
63
- export {
64
- Button
65
- };
@@ -1,73 +0,0 @@
1
- import {
2
- useControlSize,
3
- useFloatingPlaceholder,
4
- withTitleTooltip
5
- } from "./chunk-H7IAG72O.js";
6
-
7
- // src/components/TextArea.tsx
8
- import { forwardRef, useId, useState } from "react";
9
- import { jsx, jsxs } from "react/jsx-runtime";
10
- var TextArea = forwardRef(function TextArea2({
11
- label,
12
- hint,
13
- status = "default",
14
- size: sizeProp,
15
- showCount = false,
16
- placeholder,
17
- placeholderMode,
18
- className = "",
19
- id,
20
- disabled,
21
- value,
22
- defaultValue,
23
- maxLength,
24
- onChange,
25
- ...props
26
- }, ref) {
27
- const size = useControlSize(sizeProp);
28
- const fallbackId = useId();
29
- const textAreaId = id ?? fallbackId;
30
- const [uncontrolledValue, setUncontrolledValue] = useState(() => defaultValue === void 0 ? "" : String(defaultValue));
31
- const currentText = value !== void 0 ? String(value) : uncontrolledValue;
32
- const floating = useFloatingPlaceholder({ mode: placeholderMode, placeholder, filled: currentText.length > 0 });
33
- const hintId = `${textAreaId}-hint`;
34
- const describedBy = [props["aria-describedby"], hint ? hintId : null].filter(Boolean).join(" ") || void 0;
35
- function handleChange(event) {
36
- setUncontrolledValue(event.target.value);
37
- onChange?.(event);
38
- }
39
- const control = /* @__PURE__ */ jsxs("span", { className: `sia-textarea-control sia-textarea-control--${size} sia-textarea-control--${status}${floating.className}${disabled ? " is-disabled" : ""}`, children: [
40
- /* @__PURE__ */ jsx(
41
- "textarea",
42
- {
43
- ...withTitleTooltip(props),
44
- ref,
45
- id: textAreaId,
46
- className: "sia-textarea",
47
- disabled,
48
- value,
49
- defaultValue,
50
- maxLength,
51
- placeholder,
52
- "aria-describedby": describedBy,
53
- "aria-invalid": status === "error" || void 0,
54
- onChange: handleChange
55
- }
56
- ),
57
- floating.label,
58
- showCount ? /* @__PURE__ */ jsxs("span", { className: `sia-textarea-control__count${maxLength !== void 0 && currentText.length >= maxLength ? " is-limit" : ""}`, "aria-live": "polite", children: [
59
- currentText.length,
60
- maxLength !== void 0 ? `/${maxLength}` : null
61
- ] }) : null
62
- ] });
63
- if (!label && !hint) return /* @__PURE__ */ jsx("span", { className: `sia-field ${className}`.trim(), children: control });
64
- return /* @__PURE__ */ jsxs("span", { className: `sia-field ${className}`.trim(), children: [
65
- label ? /* @__PURE__ */ jsx("label", { className: "sia-field__label", htmlFor: textAreaId, children: label }) : null,
66
- control,
67
- hint ? /* @__PURE__ */ jsx("span", { id: hintId, className: `sia-field__hint sia-field__hint--${status}`, children: hint }) : null
68
- ] });
69
- });
70
-
71
- export {
72
- TextArea
73
- };