@tide-design/components 0.19.0 → 0.21.0

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.
@@ -6,6 +6,8 @@ export interface CheckboxOwnProps {
6
6
  children?: ReactNode;
7
7
  /** 상자 16px(`sm`) 또는 20px(`md`). 누르는 영역은 둘 다 24×24px. 기본값 `md`. */
8
8
  size?: ChoiceSize;
9
+ /** 상자 모양. `circle`은 원이고 체크 전에도 회색 체크가 보인다. 기본값 `square`. */
10
+ shape?: CheckboxShape;
9
11
  /** 체크했을 때 상자 색(Role). 기본값 `primary`. */
10
12
  color?: Role;
11
13
  /** 일부만 선택된 상태(가로줄). 누르면 브라우저가 지우므로 앱이 다시 계산해 넘긴다. */
@@ -17,9 +19,10 @@ export interface CheckboxOwnProps {
17
19
  /** 루트 label의 style */
18
20
  style?: CSSProperties;
19
21
  }
22
+ export type CheckboxShape = "square" | "circle";
20
23
  export interface CheckboxProps extends CheckboxOwnProps, Omit<ComponentProps<"input">, keyof CheckboxOwnProps | "type"> {}
21
24
  /**
22
25
  * 네이티브 체크박스. 여러 개를 묶어 이름·설명·오류를 붙이려면 `Field group` 안의 `CheckboxGroup`에 둔다.
23
- * Tide props: `children`, `size`, `color`, `indeterminate`, `invalid`, `className`, `style` ({@link CheckboxOwnProps}). 나머지는 `<input>` 속성.
26
+ * Tide props: `children`, `size`, `shape`, `color`, `indeterminate`, `invalid`, `className`, `style` ({@link CheckboxOwnProps}). 나머지는 `<input>` 속성.
24
27
  */
25
- export declare function Checkbox({ children, size, color, indeterminate, invalid, id, disabled, required, className, style, ref, "aria-describedby": ariaDescribedBy, "aria-invalid": ariaInvalid, ...props }: CheckboxProps): ReactElement;
28
+ export declare function Checkbox({ children, size, shape, color, indeterminate, invalid, id, disabled, required, className, style, ref, "aria-describedby": ariaDescribedBy, "aria-invalid": ariaInvalid, ...props }: CheckboxProps): ReactElement;
@@ -3,22 +3,26 @@
3
3
  import { CheckboxGroupContext } from "../_internal/hooks/useChoiceGroup.js";
4
4
  import { choiceAreaClass, choiceInputClass, choiceMarkClass, choiceRootClass, choiceTextClass } from "../_internal/constants/choiceClass.js";
5
5
  import { cn } from "../_internal/libs/cn.js";
6
- import { checkboxFillClass, checkboxInputStateClass, checkboxMarkClass, checkboxMarkShownClass } from "./constants/checkboxClass.js";
6
+ import { checkboxFillClass, checkboxIdleMarkClass, checkboxInputStateClass, checkboxMarkClass, checkboxMarkShownClass } from "./constants/checkboxClass.js";
7
7
  import { CheckboxMark } from "./components/CheckboxMark.js";
8
8
  import { useFieldControl } from "../_internal/hooks/useFieldControl.js";
9
9
  import { jsx, jsxs } from "react/jsx-runtime";
10
10
  import { use, useImperativeHandle, useLayoutEffect, useRef } from "react";
11
11
 
12
12
  // src/Checkbox/Checkbox.tsx
13
- const boxClass = {
14
- sm: "size-4 rounded-sm",
15
- md: "size-5 rounded-sm"
13
+ const boxSizeClass = {
14
+ sm: "size-4",
15
+ md: "size-5"
16
+ };
17
+ const boxShapeClass = {
18
+ square: "rounded-sm",
19
+ circle: "rounded-full"
16
20
  };
17
21
  /**
18
22
  * 네이티브 체크박스. 여러 개를 묶어 이름·설명·오류를 붙이려면 `Field group` 안의 `CheckboxGroup`에 둔다.
19
- * Tide props: `children`, `size`, `color`, `indeterminate`, `invalid`, `className`, `style` ({@link CheckboxOwnProps}). 나머지는 `<input>` 속성.
23
+ * Tide props: `children`, `size`, `shape`, `color`, `indeterminate`, `invalid`, `className`, `style` ({@link CheckboxOwnProps}). 나머지는 `<input>` 속성.
20
24
  */
21
- function Checkbox({ children, size = "md", color = "primary", indeterminate = false, invalid, id, disabled, required, className, style, ref, "aria-describedby": ariaDescribedBy, "aria-invalid": ariaInvalid, ...props }) {
25
+ function Checkbox({ children, size = "md", shape = "square", color = "primary", indeterminate = false, invalid, id, disabled, required, className, style, ref, "aria-describedby": ariaDescribedBy, "aria-invalid": ariaInvalid, ...props }) {
22
26
  const group = use(CheckboxGroupContext);
23
27
  const control = useFieldControl({
24
28
  id,
@@ -33,6 +37,7 @@ function Checkbox({ children, size = "md", color = "primary", indeterminate = fa
33
37
  useLayoutEffect(() => {
34
38
  if (inputRef.current) inputRef.current.indeterminate = indeterminate;
35
39
  });
40
+ const boxClass = cn(boxSizeClass[size], boxShapeClass[shape]);
36
41
  return /* @__PURE__ */ jsxs("label", {
37
42
  "data-color": color,
38
43
  "data-disabled": control.disabled ? "" : void 0,
@@ -47,12 +52,18 @@ function Checkbox({ children, size = "md", color = "primary", indeterminate = fa
47
52
  ...control,
48
53
  ref: inputRef,
49
54
  type: "checkbox",
50
- className: cn(boxClass[size], choiceInputClass, checkboxInputStateClass)
55
+ className: cn(boxClass, choiceInputClass, checkboxInputStateClass)
51
56
  }),
57
+ shape === "circle" ? /* @__PURE__ */ jsx(CheckboxMark, {
58
+ kind: "check",
59
+ size,
60
+ idle: true,
61
+ className: cn(choiceMarkClass, checkboxIdleMarkClass)
62
+ }) : null,
52
63
  /* @__PURE__ */ jsx("span", {
53
64
  "aria-hidden": "true",
54
65
  "data-fill": "",
55
- className: cn(boxClass[size], checkboxFillClass)
66
+ className: cn(boxClass, checkboxFillClass)
56
67
  }),
57
68
  /* @__PURE__ */ jsx(CheckboxMark, {
58
69
  kind: "check",
@@ -10,12 +10,13 @@ const pixelSize = {
10
10
  md: 16
11
11
  };
12
12
  /** 그려지는 체크 표시. 상태는 input이 보조 기술에 알려 장식으로 숨긴다. */
13
- function CheckboxMark({ kind, size, className }) {
13
+ function CheckboxMark({ kind, size, idle, className }) {
14
14
  const px = pixelSize[size];
15
15
  return /* @__PURE__ */ jsx("svg", {
16
16
  "aria-hidden": "true",
17
17
  focusable: "false",
18
18
  "data-mark": kind,
19
+ "data-idle": idle ? "" : void 0,
19
20
  width: px,
20
21
  height: px,
21
22
  viewBox: "0 0 24 24",
@@ -1,11 +1,13 @@
1
1
  // src/Checkbox/constants/checkboxClass.ts
2
- /** 체크 전 hover·누름은 subtle 바탕이다. 체크·indeterminate 채움은 채움 레이어가 맡고, forced-colors에서만 input이 칠한다. */
3
- const checkboxInputStateClass = "checked:border-accent indeterminate:border-accent enabled:not-checked:not-indeterminate:group-hover/choice:bg-accent-subtle enabled:not-checked:not-indeterminate:group-active/choice:bg-accent-subtle-active forced-colors:enabled:checked:bg-accent-solid forced-colors:enabled:indeterminate:bg-accent-solid";
2
+ /** 체크 전에는 hover·누름에도 바탕을 칠하지 않는다. 체크·indeterminate 채움은 채움 레이어가 맡고, forced-colors에서만 input이 칠한다. */
3
+ const checkboxInputStateClass = "checked:border-accent indeterminate:border-accent forced-colors:enabled:checked:bg-accent-solid forced-colors:enabled:indeterminate:bg-accent-solid";
4
4
  /**
5
5
  * 체크·indeterminate 채움. input과 같은 크기라 테두리까지 덮는다. opacity와 scale이 함께 fast로 바뀐다.
6
6
  * 비활성·forced-colors에서는 숨고 input 바탕이 그 색을 맡는다. 오류 색은 input의 변수가 닿지 않아 다시 적는다(ADR 0035).
7
7
  */
8
8
  const checkboxFillClass = "pointer-events-none col-start-1 row-start-1 bg-accent-solid opacity-0 transition-[opacity,background-color] group-hover/choice:bg-accent-solid-hover group-active/choice:bg-accent-solid-active peer-checked:opacity-100 peer-indeterminate:opacity-100 motion-safe:scale-70 motion-safe:transition-[opacity,scale,background-color] motion-safe:peer-checked:scale-100 motion-safe:peer-indeterminate:scale-100 peer-aria-invalid:[--tide-accent-solid:var(--tide-bg-danger-solid)] peer-aria-invalid:[--tide-accent-solid-hover:var(--tide-bg-danger-solid-hover)] peer-aria-invalid:[--tide-accent-solid-active:var(--tide-bg-danger-solid-active)] peer-disabled:hidden forced-colors:hidden";
9
+ /** circle의 체크 전 회색 체크. 비활성에서는 체크된 것처럼 보여 숨긴다. */
10
+ const checkboxIdleMarkClass = "text-disabled peer-enabled:peer-not-checked:peer-not-indeterminate:opacity-100";
9
11
  /** solid 위 흰 표시. 숨을 때는 지연 없이 fast로 거꾸로 지워지며 사라진다. dash는 svg에 두고 path가 물려받는다. */
10
12
  const checkboxMarkClass = "relative text-accent-on-solid forced-colors:[--tide-accent-on-solid:HighlightText] motion-safe:[stroke-dasharray:1] motion-safe:[stroke-dashoffset:1] motion-safe:transition-[opacity,stroke-dashoffset]";
11
13
  /** 보이는 조건과 그리기. 채움이 찬 뒤(fast 지연) opacity와 dash가 fast로 함께 바뀐다. */
@@ -14,4 +16,4 @@ const checkboxMarkShownClass = {
14
16
  indeterminate: "peer-indeterminate:opacity-100 motion-safe:peer-indeterminate:[stroke-dashoffset:0] motion-safe:peer-indeterminate:duration-fast motion-safe:peer-indeterminate:delay-(--tide-duration-fast)"
15
17
  };
16
18
 
17
- export { checkboxFillClass, checkboxInputStateClass, checkboxMarkClass, checkboxMarkShownClass };
19
+ export { checkboxFillClass, checkboxIdleMarkClass, checkboxInputStateClass, checkboxMarkClass, checkboxMarkShownClass };
@@ -1,2 +1,2 @@
1
- import { Checkbox, CheckboxOwnProps, CheckboxProps } from "./Checkbox.js";
2
- export { Checkbox, type CheckboxOwnProps, type CheckboxProps };
1
+ import { Checkbox, CheckboxOwnProps, CheckboxProps, CheckboxShape } from "./Checkbox.js";
2
+ export { Checkbox, type CheckboxOwnProps, type CheckboxProps, type CheckboxShape };
@@ -1,6 +1,9 @@
1
1
  import { InputSize } from "../_internal/constants/inputClass.js";
2
- import { ComponentProps, ReactElement } from "react";
2
+ import { ComponentProps, HTMLInputTypeAttribute, ReactElement } from "react";
3
+ type NamedInputType<T = HTMLInputTypeAttribute> = T extends unknown ? string extends T ? never : T : never;
3
4
  export interface InputOwnProps {
5
+ /** 네이티브 `type`. 기본값 `text`. 숫자는 `NumberFormatInput`을 쓴다(`number`는 받지 않는다). */
6
+ type?: Exclude<NamedInputType, "number">;
4
7
  /** 높이 `sm` 32px, `md` 40px, `lg` 48px. 같은 size의 Button과 높이가 같다. 기본값은 `md`다. */
5
8
  size?: InputSize;
6
9
  /**
@@ -12,7 +15,8 @@ export interface InputOwnProps {
12
15
  export interface InputProps extends InputOwnProps, Omit<ComponentProps<"input">, keyof InputOwnProps> {}
13
16
  /**
14
17
  * 한 줄 텍스트를 입력하는 네이티브 `<input>`. `type`(`email`, `password`, `date` 등)을 그대로 받는다.
15
- * Field 안에 두면 label, 설명, 오류 메시지가 자동으로 연결된다.
16
- * Tide props: `size`, `invalid` ({@link InputOwnProps}). 나머지는 `<input>` 속성.
18
+ * 숫자는 `NumberFormatInput`을 쓴다. Field 안에 두면 label, 설명, 오류 메시지가 자동으로 연결된다.
19
+ * Tide props: `type`, `size`, `invalid` ({@link InputOwnProps}). 나머지는 `<input>` 속성.
17
20
  */
18
- export declare function Input({ size, invalid, id, disabled, required, className, "aria-describedby": ariaDescribedBy, "aria-invalid": ariaInvalid, ...props }: InputProps): ReactElement;
21
+ export declare function Input({ size, invalid, id, disabled, required, className, "aria-describedby": ariaDescribedBy, "aria-invalid": ariaInvalid, ...props }: InputProps): ReactElement;
22
+ export {};
@@ -8,8 +8,8 @@ import { jsx } from "react/jsx-runtime";
8
8
  // src/Input/Input.tsx
9
9
  /**
10
10
  * 한 줄 텍스트를 입력하는 네이티브 `<input>`. `type`(`email`, `password`, `date` 등)을 그대로 받는다.
11
- * Field 안에 두면 label, 설명, 오류 메시지가 자동으로 연결된다.
12
- * Tide props: `size`, `invalid` ({@link InputOwnProps}). 나머지는 `<input>` 속성.
11
+ * 숫자는 `NumberFormatInput`을 쓴다. Field 안에 두면 label, 설명, 오류 메시지가 자동으로 연결된다.
12
+ * Tide props: `type`, `size`, `invalid` ({@link InputOwnProps}). 나머지는 `<input>` 속성.
13
13
  */
14
14
  function Input({ size = "md", invalid, id, disabled, required, className, "aria-describedby": ariaDescribedBy, "aria-invalid": ariaInvalid, ...props }) {
15
15
  const control = useFieldControl({
@@ -0,0 +1,35 @@
1
+ import { InputSize } from "../_internal/constants/inputClass.js";
2
+ import { MaskFormatOptions, NumericFormatOptions, WithoutNumericOptions } from "./types.js";
3
+ import { ComponentProps, ReactElement } from "react";
4
+ export interface NumberFormatInputOwnProps extends NumericFormatOptions {
5
+ /** 패턴 모드 틀. `#` 자리에 숫자가 들어간다(`"###-####-####"`). 주면 숫자 모드 옵션은 받지 않는다. */
6
+ mask?: MaskFormatOptions["mask"];
7
+ /**
8
+ * 값(제어). 빈 칸은 `null`. 패턴 모드는 앞자리 0을 지키도록 숫자 문자열(`"01012345678"`)도 받는다.
9
+ */
10
+ value?: number | string | null;
11
+ /** 처음 값(비제어). `value`와 같은 형태다. */
12
+ defaultValue?: number | string | null;
13
+ /**
14
+ * 사용자가 값을 바꾸면 부른다. `value`는 숫자(빈 칸 `null`), `formattedValue`는 화면 글자,
15
+ * `digits`는 숫자만 남긴 문자열이다. 앞자리 0·큰 자릿수(전화·카드번호)는 `digits`를 쓴다.
16
+ */
17
+ onValueChange?: (value: number | null, formattedValue: string, digits: string) => void;
18
+ /** 높이 `sm` 32px, `md` 40px, `lg` 48px. 같은 size의 Input과 같다. 기본값은 `md`다. */
19
+ size?: InputSize;
20
+ /** 오류 상태. `aria-invalid="true"`와 `data-invalid`가 붙는다. Field 값보다 여기 준 값이 이긴다. */
21
+ invalid?: boolean;
22
+ }
23
+ type NumberFormatInputModeProps = {
24
+ mask?: undefined;
25
+ value?: number | null;
26
+ defaultValue?: number | null;
27
+ } | (Required<Pick<MaskFormatOptions, "mask">> & WithoutNumericOptions);
28
+ export type NumberFormatInputProps = NumberFormatInputModeProps & NumberFormatInputOwnProps & Omit<ComponentProps<"input">, keyof NumberFormatInputOwnProps | "type" | "pattern" | "children" | "dangerouslySetInnerHTML">;
29
+ /**
30
+ * 칠 때 바로 포맷하는 숫자 입력. 천 단위 구분자·prefix·suffix·소수 자릿수(숫자 모드)와
31
+ * `mask` 틀(패턴 모드)을 다룬다. `<input type="text">`이고 Field 안에서 label·설명·오류가 연결된다.
32
+ * Tide props: `mask`, `value`, `defaultValue`, `onValueChange`, `size`, `invalid`, `prefix`, `suffix`, `decimalPlaces`, `fixedDecimalPlaces`, `allowNegative`, `groupStyle`, `groupSeparator`, `decimalSeparator`, `locale` ({@link NumberFormatInputOwnProps}). 나머지는 `<input>` 속성.
33
+ */
34
+ export declare function NumberFormatInput({ mask, value, defaultValue, onValueChange, prefix, suffix, decimalPlaces, fixedDecimalPlaces, allowNegative, groupStyle, groupSeparator, decimalSeparator, locale, inputMode, ref, onCompositionStart, onInput, ...props }: NumberFormatInputProps): ReactElement;
35
+ export {};
@@ -0,0 +1,70 @@
1
+ "use client";
2
+
3
+ import { Input } from "../Input/Input.js";
4
+ import { MaskModeInput } from "./components/MaskModeInput.js";
5
+ import { NumericModeInput } from "./components/NumericModeInput.js";
6
+ import { useNumberCompositionGuard } from "./hooks/useNumberCompositionGuard.js";
7
+ import { maskDigits } from "./libs/maskFormat.js";
8
+ import { toNumericString } from "./libs/numericFormat.js";
9
+ import { jsx } from "react/jsx-runtime";
10
+ import { useRef } from "react";
11
+
12
+ // src/NumberFormatInput/NumberFormatInput.tsx
13
+ /**
14
+ * 칠 때 바로 포맷하는 숫자 입력. 천 단위 구분자·prefix·suffix·소수 자릿수(숫자 모드)와
15
+ * `mask` 틀(패턴 모드)을 다룬다. `<input type="text">`이고 Field 안에서 label·설명·오류가 연결된다.
16
+ * Tide props: `mask`, `value`, `defaultValue`, `onValueChange`, `size`, `invalid`, `prefix`, `suffix`, `decimalPlaces`, `fixedDecimalPlaces`, `allowNegative`, `groupStyle`, `groupSeparator`, `decimalSeparator`, `locale` ({@link NumberFormatInputOwnProps}). 나머지는 `<input>` 속성.
17
+ */
18
+ function NumberFormatInput({ mask, value, defaultValue, onValueChange, prefix, suffix, decimalPlaces, fixedDecimalPlaces, allowNegative, groupStyle, groupSeparator, decimalSeparator, locale, inputMode, ref, onCompositionStart, onInput, ...props }) {
19
+ const compositionGuard = useNumberCompositionGuard({
20
+ onCompositionStart,
21
+ onInput
22
+ });
23
+ const lastEmitted = useRef(null);
24
+ const toDigits = (input) => {
25
+ if (typeof input === "number") return mask === void 0 ? toNumericString(input, decimalPlaces) : String(input);
26
+ return mask === void 0 ? input : maskDigits(input);
27
+ };
28
+ const libraryValue = value === void 0 ? void 0 : lastEmitted.current && Object.is(value, lastEmitted.current.value) ? lastEmitted.current.digits : value === null ? "" : toDigits(value);
29
+ const handleValueChange = (values, { source }) => {
30
+ if (source !== "event") return;
31
+ const next = mask === void 0 ? values.floatValue ?? null : values.value === "" ? null : Number(values.value);
32
+ lastEmitted.current = {
33
+ value: next,
34
+ digits: values.value
35
+ };
36
+ onValueChange?.(next, values.formattedValue, values.value);
37
+ };
38
+ const shared = {
39
+ ...props,
40
+ ...compositionGuard,
41
+ type: "text",
42
+ inputMode: inputMode ?? (mask !== void 0 || decimalPlaces === 0 ? "numeric" : allowNegative ? void 0 : "decimal"),
43
+ customInput: Input,
44
+ getInputRef: ref,
45
+ value: libraryValue,
46
+ defaultValue: defaultValue === void 0 || defaultValue === null ? defaultValue : toDigits(defaultValue),
47
+ valueIsNumericString: true,
48
+ onValueChange: handleValueChange
49
+ };
50
+ if (mask !== void 0) return /* @__PURE__ */ jsx(MaskModeInput, {
51
+ ...shared,
52
+ mask
53
+ });
54
+ return /* @__PURE__ */ jsx(NumericModeInput, {
55
+ ...shared,
56
+ options: {
57
+ prefix,
58
+ suffix,
59
+ decimalPlaces,
60
+ fixedDecimalPlaces,
61
+ allowNegative,
62
+ groupStyle,
63
+ groupSeparator,
64
+ decimalSeparator,
65
+ locale
66
+ }
67
+ });
68
+ }
69
+
70
+ export { NumberFormatInput };
@@ -0,0 +1,22 @@
1
+ "use client";
2
+
3
+ import { applyMask, maskDigits, maxMaskDigits, sortMasks } from "../libs/maskFormat.js";
4
+ import { jsx } from "react/jsx-runtime";
5
+ import { NumberFormatBase } from "react-number-format";
6
+
7
+ // src/NumberFormatInput/components/MaskModeInput.tsx
8
+ function MaskModeInput({ mask, ...props }) {
9
+ const masks = sortMasks(mask);
10
+ const maxDigits = maxMaskDigits(masks);
11
+ return /* @__PURE__ */ jsx(NumberFormatBase, {
12
+ ...props,
13
+ format: (digits) => applyMask(digits, masks),
14
+ removeFormatting: (text, change) => {
15
+ const digits = maskDigits(text);
16
+ if (digits.length > maxDigits && change) return maskDigits(change.lastValue);
17
+ return digits.slice(0, maxDigits);
18
+ }
19
+ });
20
+ }
21
+
22
+ export { MaskModeInput };
@@ -0,0 +1,16 @@
1
+ "use client";
2
+
3
+ import { toLibraryNumericOptions } from "../libs/numericFormat.js";
4
+ import { jsx } from "react/jsx-runtime";
5
+ import { NumberFormatBase, useNumericFormat } from "react-number-format";
6
+
7
+ // src/NumberFormatInput/components/NumericModeInput.tsx
8
+ function NumericModeInput({ options, ...props }) {
9
+ const baseProps = useNumericFormat({
10
+ ...props,
11
+ ...toLibraryNumericOptions(options)
12
+ });
13
+ return /* @__PURE__ */ jsx(NumberFormatBase, { ...baseProps });
14
+ }
15
+
16
+ export { NumericModeInput };
@@ -0,0 +1,21 @@
1
+ "use client";
2
+
3
+ import { useRef } from "react";
4
+
5
+ // src/NumberFormatInput/hooks/useNumberCompositionGuard.ts
6
+ /** IME 조합 중인 글자를 지워 조합 직전 값으로 되돌린다. 넘긴 처리기는 되돌린 뒤 부른다. */
7
+ function useNumberCompositionGuard({ onCompositionStart, onInput }) {
8
+ const valueBeforeComposition = useRef("");
9
+ return {
10
+ onCompositionStart: (event) => {
11
+ valueBeforeComposition.current = event.currentTarget.value;
12
+ onCompositionStart?.(event);
13
+ },
14
+ onInput: (event) => {
15
+ if (event.nativeEvent.isComposing) event.currentTarget.value = valueBeforeComposition.current;
16
+ onInput?.(event);
17
+ }
18
+ };
19
+ }
20
+
21
+ export { useNumberCompositionGuard };
@@ -0,0 +1,3 @@
1
+ import { NumberFormatInput, NumberFormatInputOwnProps, NumberFormatInputProps } from "./NumberFormatInput.js";
2
+ import { NumberGroupStyle } from "./types.js";
3
+ export { NumberFormatInput, type NumberFormatInputOwnProps, type NumberFormatInputProps, type NumberGroupStyle };
@@ -0,0 +1,6 @@
1
+ import { NumberFormatOptions } from "../types.js";
2
+ /**
3
+ * 값을 `NumberFormatInput`과 같은 옵션으로 포맷한 글자. 표·카드의 금액처럼 보여 주기만 할 때 쓴다.
4
+ * 숫자 문자열(`digits`)도 받는다. `null`·`undefined`·`NaN`은 빈 문자열이다.
5
+ */
6
+ export declare function formatNumber(value: number | string | null | undefined, options?: NumberFormatOptions): string;
@@ -0,0 +1,17 @@
1
+ import { applyMask, maskDigits, sortMasks } from "./maskFormat.js";
2
+ import { toLibraryNumericOptions, toNumericString } from "./numericFormat.js";
3
+ import { numericFormatter } from "react-number-format";
4
+
5
+ // src/NumberFormatInput/libs/formatNumber.ts
6
+ /**
7
+ * 값을 `NumberFormatInput`과 같은 옵션으로 포맷한 글자. 표·카드의 금액처럼 보여 주기만 할 때 쓴다.
8
+ * 숫자 문자열(`digits`)도 받는다. `null`·`undefined`·`NaN`은 빈 문자열이다.
9
+ */
10
+ function formatNumber(value, options = {}) {
11
+ if (value === null || value === void 0 || Number.isNaN(value)) return "";
12
+ if (options.mask !== void 0) return applyMask(maskDigits(String(value)), sortMasks(options.mask));
13
+ const numStr = typeof value === "number" ? toNumericString(value, options.decimalPlaces) : value;
14
+ return numericFormatter(numStr, toLibraryNumericOptions(options));
15
+ }
16
+
17
+ export { formatNumber };
@@ -0,0 +1,39 @@
1
+ // src/NumberFormatInput/libs/maskFormat.ts
2
+ const slotChar = "#";
3
+ function slotCount(mask) {
4
+ return mask.split(slotChar).length - 1;
5
+ }
6
+ /** 자릿수가 적은 틀부터 늘어놓는다. */
7
+ function sortMasks(mask) {
8
+ return [...typeof mask === "string" ? [mask] : mask].sort((a, b) => slotCount(a) - slotCount(b));
9
+ }
10
+ /** 틀이 받을 수 있는 최대 자릿수 */
11
+ function maxMaskDigits(masks) {
12
+ return Math.max(0, ...masks.map(slotCount));
13
+ }
14
+ /** 숫자가 아닌 글자를 뺀다. 전각 숫자(`1`)는 반각으로 바꾼다. */
15
+ function maskDigits(text) {
16
+ return text.replace(/[0-9]/g, (char) => String.fromCharCode(char.charCodeAt(0) - 65248)).replace(/\D/g, "");
17
+ }
18
+ /**
19
+ * `sortMasks` 결과로 숫자를 틀에 채운다. 비어 있는 자리 앞의 고정 글자는 쓰지 않는다.
20
+ * 그래야 지울 때 caret이 고정 글자에 걸리지 않는다.
21
+ */
22
+ function applyMask(digits, masks) {
23
+ const mask = masks.find((candidate) => slotCount(candidate) >= digits.length) ?? masks.at(-1);
24
+ if (!mask || digits === "") return "";
25
+ let result = "";
26
+ let index = 0;
27
+ for (const char of mask) if (char === slotChar) {
28
+ const digit = digits[index];
29
+ if (digit === void 0) break;
30
+ result += digit;
31
+ index += 1;
32
+ } else {
33
+ if (index >= digits.length && index < slotCount(mask)) break;
34
+ result += char;
35
+ }
36
+ return result;
37
+ }
38
+
39
+ export { applyMask, maskDigits, maxMaskDigits, sortMasks };
@@ -0,0 +1,47 @@
1
+ // src/NumberFormatInput/libs/numericFormat.ts
2
+ function localeSeparators(locale) {
3
+ if (locale === void 0) return {
4
+ group: ",",
5
+ decimal: "."
6
+ };
7
+ const parts = new Intl.NumberFormat(locale).formatToParts(1234567.5);
8
+ return {
9
+ group: parts.find((part) => part.type === "group")?.value ?? ",",
10
+ decimal: parts.find((part) => part.type === "decimal")?.value ?? "."
11
+ };
12
+ }
13
+ /** Tide 옵션을 react-number-format 옵션으로 바꾼다. */
14
+ function toLibraryNumericOptions(options) {
15
+ const separators = localeSeparators(options.locale);
16
+ const groupSeparator = options.groupSeparator ?? separators.group;
17
+ const decimalSeparator = options.decimalSeparator ?? separators.decimal;
18
+ const groupStyle = options.groupStyle ?? "thousand";
19
+ return {
20
+ prefix: options.prefix,
21
+ suffix: options.suffix,
22
+ decimalScale: options.decimalPlaces,
23
+ fixedDecimalScale: options.fixedDecimalPlaces ?? false,
24
+ allowNegative: options.allowNegative ?? false,
25
+ thousandSeparator: groupStyle === "none" ? false : groupSeparator,
26
+ thousandsGroupStyle: groupStyle,
27
+ decimalSeparator,
28
+ allowedDecimalSeparators: [decimalSeparator, "."].filter((char) => char !== groupSeparator)
29
+ };
30
+ }
31
+ /**
32
+ * 숫자를 지수 표기 없는 숫자 문자열로 바꾼다. `decimalPlaces`가 있으면 그 자릿수로 반올림한다.
33
+ * 입력 칸과 `formatNumber`가 함께 써서 반올림 결과를 맞춘다.
34
+ */
35
+ function toNumericString(value, decimalPlaces) {
36
+ if (decimalPlaces === void 0) {
37
+ const plain = String(value);
38
+ if (!/e/i.test(plain)) return plain;
39
+ }
40
+ return new Intl.NumberFormat("en-US", {
41
+ useGrouping: false,
42
+ maximumFractionDigits: decimalPlaces ?? 20,
43
+ signDisplay: "negative"
44
+ }).format(value);
45
+ }
46
+
47
+ export { toLibraryNumericOptions, toNumericString };
@@ -0,0 +1,39 @@
1
+ import "../Input/Input.js";
2
+ import "react-number-format";
3
+ /** 숫자를 몇 자리씩 묶는지. `thousand` 1,234,567 · `wan` 123,4567(만 단위) · `none` 묶지 않음. */
4
+ export type NumberGroupStyle = "thousand" | "wan" | "none";
5
+ /** 숫자 모드 포맷 옵션. `NumberFormatInput`과 `formatNumber`가 같은 옵션으로 같은 글자를 만든다. */
6
+ export interface NumericFormatOptions {
7
+ /** 숫자 앞에 붙는 글자(예: `"₩"`). 값이 있을 때만 보인다. */
8
+ prefix?: string;
9
+ /** 숫자 뒤에 붙는 글자(예: `"원"`, `"%"`). 값이 있을 때만 보인다. */
10
+ suffix?: string;
11
+ /** 소수 최대 자릿수. `0`이면 소수점을 받지 않는다. 기본값은 제한 없음. */
12
+ decimalPlaces?: number;
13
+ /** `decimalPlaces`만큼 소수 자리를 늘 채운다(`1` → `1.00`). 입력 칸은 blur 때 채운다. 기본값 `false`. */
14
+ fixedDecimalPlaces?: boolean;
15
+ /** 음수(`-`)를 받는다. 기본값 `false`. */
16
+ allowNegative?: boolean;
17
+ /** 자릿수 묶음 방식. 기본값 `thousand`. */
18
+ groupStyle?: NumberGroupStyle;
19
+ /** 묶음 구분자. 기본값은 `locale`의 구분자, `locale`이 없으면 `","`. */
20
+ groupSeparator?: string;
21
+ /** 소수점 글자. 기본값은 `locale`의 소수점, `locale`이 없으면 `"."`. */
22
+ decimalSeparator?: string;
23
+ /** 구분자 기본값을 가져올 BCP 47 locale(예: `"de-DE"`). 묶음 방식은 바꾸지 않는다. */
24
+ locale?: string;
25
+ }
26
+ /** 패턴 모드 포맷 옵션 */
27
+ export interface MaskFormatOptions {
28
+ /**
29
+ * 숫자를 채울 틀. `#` 자리에 숫자가 들어간다(예: `"###-####-####"`). 틀의 고정 글자에 숫자를 쓰지 않는다.
30
+ * 배열이면 입력한 자릿수에 맞는 가장 짧은 틀을 고른다.
31
+ */
32
+ mask: string | readonly string[];
33
+ }
34
+ /** 패턴 모드에서 숫자 모드 옵션을 막는다. */
35
+ export type WithoutNumericOptions = { [K in keyof NumericFormatOptions]?: undefined; };
36
+ /** `formatNumber` 옵션. `mask`가 있으면 패턴 모드, 없으면 숫자 모드다. */
37
+ export type NumberFormatOptions = (NumericFormatOptions & {
38
+ mask?: undefined;
39
+ }) | (MaskFormatOptions & WithoutNumericOptions);
@@ -1,6 +1,6 @@
1
1
  // src/_internal/constants/choiceClass.ts
2
2
  /** 루트 label. 글자 크기 class와 사용자 className은 뒤에 붙인다. */
3
- const choiceRootClass = "group/choice inline-flex items-start gap-2 align-top text-default cursor-pointer has-disabled:cursor-not-allowed has-disabled:text-disabled";
3
+ const choiceRootClass = "group/choice inline-flex items-start gap-2 align-top text-default cursor-pointer select-none has-disabled:cursor-not-allowed has-disabled:text-disabled";
4
4
  /** 상자보다 큰 24×24 조작 영역(WCAG 2.5.8). */
5
5
  const choiceAreaClass = "grid size-6 shrink-0 place-items-center";
6
6
  /** 네이티브 input을 상자·원으로 그린다. 선택 상태 모양은 Checkbox·Radio가 각자 더한다. */
package/dist/index.d.ts CHANGED
@@ -15,8 +15,12 @@ import "./Input/index.js";
15
15
  import { Input, InputOwnProps, InputProps } from "./Input/Input.js";
16
16
  import "./Textarea/index.js";
17
17
  import { Textarea, TextareaOwnProps, TextareaProps } from "./Textarea/Textarea.js";
18
+ import "./NumberFormatInput/index.js";
19
+ import { formatNumber } from "./NumberFormatInput/libs/formatNumber.js";
20
+ import { NumberFormatInput, NumberFormatInputOwnProps, NumberFormatInputProps } from "./NumberFormatInput/NumberFormatInput.js";
21
+ import { MaskFormatOptions, NumberFormatOptions, NumberGroupStyle, NumericFormatOptions } from "./NumberFormatInput/types.js";
18
22
  import "./Checkbox/index.js";
19
- import { Checkbox, CheckboxOwnProps, CheckboxProps } from "./Checkbox/Checkbox.js";
23
+ import { Checkbox, CheckboxOwnProps, CheckboxProps, CheckboxShape } from "./Checkbox/Checkbox.js";
20
24
  import "./CheckboxGroup/index.js";
21
25
  import { ChoiceOrientation } from "./_internal/constants/choiceGroupClass.js";
22
26
  import { CheckboxGroup, CheckboxGroupOwnProps, CheckboxGroupProps } from "./CheckboxGroup/CheckboxGroup.js";
@@ -117,4 +121,4 @@ import { TooltipTrigger, TooltipTriggerOwnProps, TooltipTriggerProps } from "./T
117
121
  import { TooltipPlacement } from "./Tooltip/types.js";
118
122
  import { TooltipContent, TooltipContentOwnProps, TooltipContentProps } from "./Tooltip/components/TooltipContent.js";
119
123
  import { Color, ColorFamilyName, ColorFamilyRegistry, FillVariant, Role, RoleRegistry, Size } from "./types.js";
120
- export { Accordion, type AccordionHeadingLevel, AccordionItem, type AccordionItemOwnProps, type AccordionItemProps, type AccordionOwnProps, AccordionPanel, type AccordionPanelOwnProps, type AccordionPanelProps, type AccordionProps, AccordionTrigger, type AccordionTriggerOwnProps, type AccordionTriggerProps, Alert, AlertDialog, type AlertDialogProps, type AlertOwnProps, type AlertProps, Avatar, type AvatarOwnProps, type AvatarProps, Badge, type BadgeOwnProps, type BadgeProps, Breadcrumb, BreadcrumbCurrent, type BreadcrumbCurrentProps, BreadcrumbItem, type BreadcrumbItemProps, BreadcrumbLink, type BreadcrumbLinkOwnProps, type BreadcrumbLinkProps, type BreadcrumbOwnProps, type BreadcrumbProps, Button, type ButtonOwnProps, type ButtonProps, Card, type CardOwnProps, type CardProps, Checkbox, CheckboxGroup, type CheckboxGroupOwnProps, type CheckboxGroupProps, type CheckboxOwnProps, type CheckboxProps, type ChoiceOrientation, type Color, type ColorFamilyName, type ColorFamilyRegistry, Combobox, ComboboxItem, type ComboboxItemOwnProps, type ComboboxItemProps, type ComboboxOwnProps, type ComboboxProps, ComboboxSection, type ComboboxSectionProps, Dialog, DialogClose, type DialogCloseOwnProps, type DialogCloseProps, DialogContent, type DialogContentOwnProps, type DialogContentProps, DialogDescription, type DialogDescriptionProps, DialogFooter, type DialogFooterProps, DialogHeader, type DialogHeaderAlign, type DialogHeaderOwnProps, type DialogHeaderProps, type DialogProps, type DialogSize, DialogTitle, type DialogTitleProps, DialogTrigger, type DialogTriggerOwnProps, type DialogTriggerProps, Field, type FieldOwnProps, type FieldProps, type FillVariant, IconButton, type IconButtonOwnProps, type IconButtonProps, Input, type InputOwnProps, type InputProps, Link, type LinkOwnProps, type LinkProps, Menu, MenuContent, type MenuContentOwnProps, type MenuContentProps, MenuItem, type MenuItemOwnProps, type MenuItemProps, type MenuPlacement, type MenuProps, MenuSection, type MenuSectionProps, MenuTrigger, type MenuTriggerOwnProps, type MenuTriggerProps, Pagination, PaginationEllipsis, type PaginationEllipsisOwnProps, type PaginationEllipsisProps, PaginationItem, type PaginationItemProps, PaginationLink, type PaginationLinkOwnProps, type PaginationLinkProps, PaginationNext, type PaginationNextOwnProps, type PaginationNextProps, type PaginationOwnProps, PaginationPrevious, type PaginationPreviousOwnProps, type PaginationPreviousProps, type PaginationProps, Popover, PopoverContent, type PopoverContentOwnProps, type PopoverContentProps, type PopoverPlacement, type PopoverProps, PopoverTrigger, type PopoverTriggerOwnProps, type PopoverTriggerProps, Progress, type ProgressOwnProps, type ProgressProps, Radio, RadioGroup, type RadioGroupOwnProps, type RadioGroupProps, type RadioOwnProps, type RadioProps, type Role, type RoleRegistry, Select, SelectItem, type SelectItemOwnProps, type SelectItemProps, type SelectOwnProps, type SelectProps, SelectSection, type SelectSectionProps, Separator, type SeparatorOwnProps, type SeparatorProps, type Size, Skeleton, type SkeletonOwnProps, type SkeletonProps, Spinner, type SpinnerOwnProps, type SpinnerProps, Switch, type SwitchOwnProps, type SwitchProps, Tab, TabList, type TabListOwnProps, type TabListProps, type TabOwnProps, TabPanel, type TabPanelOwnProps, type TabPanelProps, type TabProps, Table, TableBody, type TableBodyProps, TableCell, type TableCellProps, TableHead, type TableHeadProps, TableHeaderCell, type TableHeaderCellOwnProps, type TableHeaderCellProps, type TableProps, TableRow, type TableRowProps, Tabs, type TabsActivationMode, type TabsOrientation, type TabsOwnProps, type TabsProps, type TabsShape, Tag, TagGroup, type TagGroupOwnProps, type TagGroupProps, type TagOwnProps, type TagProps, Textarea, type TextareaOwnProps, type TextareaProps, type ToastAction, type ToastOptions, ToastQueue, type ToastQueueOptions, ToastRegion, type ToastRegionOwnProps, type ToastRegionProps, Tooltip, TooltipContent, type TooltipContentOwnProps, type TooltipContentProps, type TooltipPlacement, type TooltipProps, TooltipTrigger, type TooltipTriggerOwnProps, type TooltipTriggerProps, VisuallyHidden, type VisuallyHiddenProps, cn };
124
+ export { Accordion, type AccordionHeadingLevel, AccordionItem, type AccordionItemOwnProps, type AccordionItemProps, type AccordionOwnProps, AccordionPanel, type AccordionPanelOwnProps, type AccordionPanelProps, type AccordionProps, AccordionTrigger, type AccordionTriggerOwnProps, type AccordionTriggerProps, Alert, AlertDialog, type AlertDialogProps, type AlertOwnProps, type AlertProps, Avatar, type AvatarOwnProps, type AvatarProps, Badge, type BadgeOwnProps, type BadgeProps, Breadcrumb, BreadcrumbCurrent, type BreadcrumbCurrentProps, BreadcrumbItem, type BreadcrumbItemProps, BreadcrumbLink, type BreadcrumbLinkOwnProps, type BreadcrumbLinkProps, type BreadcrumbOwnProps, type BreadcrumbProps, Button, type ButtonOwnProps, type ButtonProps, Card, type CardOwnProps, type CardProps, Checkbox, CheckboxGroup, type CheckboxGroupOwnProps, type CheckboxGroupProps, type CheckboxOwnProps, type CheckboxProps, type CheckboxShape, type ChoiceOrientation, type Color, type ColorFamilyName, type ColorFamilyRegistry, Combobox, ComboboxItem, type ComboboxItemOwnProps, type ComboboxItemProps, type ComboboxOwnProps, type ComboboxProps, ComboboxSection, type ComboboxSectionProps, Dialog, DialogClose, type DialogCloseOwnProps, type DialogCloseProps, DialogContent, type DialogContentOwnProps, type DialogContentProps, DialogDescription, type DialogDescriptionProps, DialogFooter, type DialogFooterProps, DialogHeader, type DialogHeaderAlign, type DialogHeaderOwnProps, type DialogHeaderProps, type DialogProps, type DialogSize, DialogTitle, type DialogTitleProps, DialogTrigger, type DialogTriggerOwnProps, type DialogTriggerProps, Field, type FieldOwnProps, type FieldProps, type FillVariant, IconButton, type IconButtonOwnProps, type IconButtonProps, Input, type InputOwnProps, type InputProps, Link, type LinkOwnProps, type LinkProps, type MaskFormatOptions, Menu, MenuContent, type MenuContentOwnProps, type MenuContentProps, MenuItem, type MenuItemOwnProps, type MenuItemProps, type MenuPlacement, type MenuProps, MenuSection, type MenuSectionProps, MenuTrigger, type MenuTriggerOwnProps, type MenuTriggerProps, NumberFormatInput, type NumberFormatInputOwnProps, type NumberFormatInputProps, type NumberFormatOptions, type NumberGroupStyle, type NumericFormatOptions, Pagination, PaginationEllipsis, type PaginationEllipsisOwnProps, type PaginationEllipsisProps, PaginationItem, type PaginationItemProps, PaginationLink, type PaginationLinkOwnProps, type PaginationLinkProps, PaginationNext, type PaginationNextOwnProps, type PaginationNextProps, type PaginationOwnProps, PaginationPrevious, type PaginationPreviousOwnProps, type PaginationPreviousProps, type PaginationProps, Popover, PopoverContent, type PopoverContentOwnProps, type PopoverContentProps, type PopoverPlacement, type PopoverProps, PopoverTrigger, type PopoverTriggerOwnProps, type PopoverTriggerProps, Progress, type ProgressOwnProps, type ProgressProps, Radio, RadioGroup, type RadioGroupOwnProps, type RadioGroupProps, type RadioOwnProps, type RadioProps, type Role, type RoleRegistry, Select, SelectItem, type SelectItemOwnProps, type SelectItemProps, type SelectOwnProps, type SelectProps, SelectSection, type SelectSectionProps, Separator, type SeparatorOwnProps, type SeparatorProps, type Size, Skeleton, type SkeletonOwnProps, type SkeletonProps, Spinner, type SpinnerOwnProps, type SpinnerProps, Switch, type SwitchOwnProps, type SwitchProps, Tab, TabList, type TabListOwnProps, type TabListProps, type TabOwnProps, TabPanel, type TabPanelOwnProps, type TabPanelProps, type TabProps, Table, TableBody, type TableBodyProps, TableCell, type TableCellProps, TableHead, type TableHeadProps, TableHeaderCell, type TableHeaderCellOwnProps, type TableHeaderCellProps, type TableProps, TableRow, type TableRowProps, Tabs, type TabsActivationMode, type TabsOrientation, type TabsOwnProps, type TabsProps, type TabsShape, Tag, TagGroup, type TagGroupOwnProps, type TagGroupProps, type TagOwnProps, type TagProps, Textarea, type TextareaOwnProps, type TextareaProps, type ToastAction, type ToastOptions, ToastQueue, type ToastQueueOptions, ToastRegion, type ToastRegionOwnProps, type ToastRegionProps, Tooltip, TooltipContent, type TooltipContentOwnProps, type TooltipContentProps, type TooltipPlacement, type TooltipProps, TooltipTrigger, type TooltipTriggerOwnProps, type TooltipTriggerProps, VisuallyHidden, type VisuallyHiddenProps, cn, formatNumber };
package/dist/index.js CHANGED
@@ -7,6 +7,8 @@ import { Link } from "./Link/Link.js";
7
7
  import { Field } from "./Field/Field.js";
8
8
  import { Input } from "./Input/Input.js";
9
9
  import { Textarea } from "./Textarea/Textarea.js";
10
+ import { NumberFormatInput } from "./NumberFormatInput/NumberFormatInput.js";
11
+ import { formatNumber } from "./NumberFormatInput/libs/formatNumber.js";
10
12
  import { Checkbox } from "./Checkbox/Checkbox.js";
11
13
  import { CheckboxGroup } from "./CheckboxGroup/CheckboxGroup.js";
12
14
  import { Radio } from "./Radio/Radio.js";
@@ -74,4 +76,4 @@ import { Tooltip } from "./Tooltip/Tooltip.js";
74
76
  import { TooltipContent } from "./Tooltip/components/TooltipContent.js";
75
77
  import { TooltipTrigger } from "./Tooltip/components/TooltipTrigger.js";
76
78
 
77
- export { Accordion, AccordionItem, AccordionPanel, AccordionTrigger, Alert, AlertDialog, Avatar, Badge, Breadcrumb, BreadcrumbCurrent, BreadcrumbItem, BreadcrumbLink, Button, Card, Checkbox, CheckboxGroup, Combobox, ComboboxItem, ComboboxSection, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger, Field, IconButton, Input, Link, Menu, MenuContent, MenuItem, MenuSection, MenuTrigger, Pagination, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious, Popover, PopoverContent, PopoverTrigger, Progress, Radio, RadioGroup, Select, SelectItem, SelectSection, Separator, Skeleton, Spinner, Switch, Tab, TabList, TabPanel, Table, TableBody, TableCell, TableHead, TableHeaderCell, TableRow, Tabs, Tag, TagGroup, Textarea, ToastQueue, ToastRegion, Tooltip, TooltipContent, TooltipTrigger, VisuallyHidden, cn };
79
+ export { Accordion, AccordionItem, AccordionPanel, AccordionTrigger, Alert, AlertDialog, Avatar, Badge, Breadcrumb, BreadcrumbCurrent, BreadcrumbItem, BreadcrumbLink, Button, Card, Checkbox, CheckboxGroup, Combobox, ComboboxItem, ComboboxSection, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger, Field, IconButton, Input, Link, Menu, MenuContent, MenuItem, MenuSection, MenuTrigger, NumberFormatInput, Pagination, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious, Popover, PopoverContent, PopoverTrigger, Progress, Radio, RadioGroup, Select, SelectItem, SelectSection, Separator, Skeleton, Spinner, Switch, Tab, TabList, TabPanel, Table, TableBody, TableCell, TableHead, TableHeaderCell, TableRow, Tabs, Tag, TagGroup, Textarea, ToastQueue, ToastRegion, Tooltip, TooltipContent, TooltipTrigger, VisuallyHidden, cn, formatNumber };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tide-design/components",
3
- "version": "0.19.0",
3
+ "version": "0.21.0",
4
4
  "description": "Tide 디자인 시스템의 React Component",
5
5
  "keywords": [
6
6
  "accessibility",
@@ -34,10 +34,11 @@
34
34
  "./styles.css": "./dist/styles.css"
35
35
  },
36
36
  "dependencies": {
37
- "@tide-design/foundation": "0.19.0",
38
- "@tide-design/icons": "0.19.0",
37
+ "@tide-design/foundation": "0.21.0",
38
+ "@tide-design/icons": "0.21.0",
39
39
  "clsx": "^2.1.1",
40
40
  "react-aria": "^3.53.1",
41
+ "react-number-format": "^5.4.5",
41
42
  "react-stately": "^3.51.0",
42
43
  "tailwind-merge": "^3.7.0"
43
44
  },