@1d1s/design-system 1.3.0 → 1.4.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.
@@ -10,8 +10,10 @@ export interface BottomSheetContentProps extends React.ComponentProps<typeof Dia
10
10
  inset?: number;
11
11
  /** 상단 그립 핸들 노출 (기본 true) */
12
12
  showHandle?: boolean;
13
+ /** 우측 상단 닫기 버튼 노출 (기본 false) */
14
+ showClose?: boolean;
13
15
  }
14
- declare function BottomSheetContent({ className, children, inset, showHandle, style, ...props }: BottomSheetContentProps): React.ReactElement;
16
+ declare function BottomSheetContent({ className, children, inset, showHandle, showClose, style, ...props }: BottomSheetContentProps): React.ReactElement;
15
17
  declare function BottomSheetHeader({ className, ...props }: React.ComponentProps<"div">): React.ReactElement;
16
18
  declare function BottomSheetFooter({ className, ...props }: React.ComponentProps<"div">): React.ReactElement;
17
19
  declare function BottomSheetTitle({ className, children, ...props }: React.ComponentProps<typeof DialogPrimitive.Title>): React.ReactElement;
@@ -3,7 +3,16 @@ import { DateRange } from 'react-day-picker';
3
3
  interface BasePickerProps {
4
4
  className?: string;
5
5
  placeholder?: string;
6
+ /** 비활성화 상태. 트리거를 클릭해도 열리지 않으며 회색조로 표시된다. */
7
+ disabled?: boolean;
6
8
  disableClickPropagation?: boolean;
9
+ /**
10
+ * 모바일 뷰포트에서 팝오버 대신 바텀시트로 표시한다. (기본 true)
11
+ * false면 항상 팝오버로 표시.
12
+ */
13
+ mobileSheet?: boolean;
14
+ /** 바텀시트 상단 제목 (모바일에서만 표시). 기본값은 placeholder. */
15
+ sheetTitle?: string;
7
16
  }
8
17
  export interface DatePickerProps extends BasePickerProps {
9
18
  value: Date | undefined;
@@ -17,10 +26,10 @@ export interface RangeDatePickerProps extends BasePickerProps {
17
26
  * DatePicker
18
27
  * 단일 날짜를 선택하는 시안형 Date Picker 컴포넌트.
19
28
  */
20
- export declare function DatePicker({ value, onChange, className, placeholder, disableClickPropagation, }: DatePickerProps): React.ReactElement;
29
+ export declare function DatePicker({ value, onChange, className, placeholder, disabled, disableClickPropagation, mobileSheet, sheetTitle, }: DatePickerProps): React.ReactElement;
21
30
  /**
22
31
  * RangeDatePicker
23
32
  * 시작일/종료일 범위를 선택하는 시안형 Date Range Picker 컴포넌트.
24
33
  */
25
- export declare function RangeDatePicker({ value, onChange, className, placeholder, disableClickPropagation, }: RangeDatePickerProps): React.ReactElement;
34
+ export declare function RangeDatePicker({ value, onChange, className, placeholder, disabled, disableClickPropagation, mobileSheet, sheetTitle, }: RangeDatePickerProps): React.ReactElement;
26
35
  export {};
@@ -12,6 +12,12 @@ export interface DropdownMenuProps extends Omit<React.HTMLAttributes<HTMLDivElem
12
12
  onSelect?: (value: string) => void;
13
13
  /** 메뉴 너비 (default 240) */
14
14
  width?: number | string;
15
+ /**
16
+ * 열림 상태. 지정하면 입·퇴장 애니메이션과 마운트/언마운트를 내부에서 관리한다.
17
+ * (소비처는 조건부 렌더 없이 항상 렌더하고 open만 토글)
18
+ * 미지정 시 기존처럼 항상 정적으로 표시한다.
19
+ */
20
+ open?: boolean;
15
21
  }
16
22
  /**
17
23
  * DropdownMenu
@@ -26,4 +32,4 @@ export interface DropdownMenuProps extends Omit<React.HTMLAttributes<HTMLDivElem
26
32
  * />
27
33
  * ```
28
34
  */
29
- export declare function DropdownMenu({ items, value, onSelect, width, className, style, ...props }: DropdownMenuProps): React.ReactElement;
35
+ export declare function DropdownMenu({ items, value, onSelect, width, open, className, style, ...props }: DropdownMenuProps): React.ReactElement | null;
@@ -0,0 +1,2 @@
1
+ import { default as React } from 'react';
2
+ export declare const Challenge: (props: React.SVGProps<SVGSVGElement>) => import("react/jsx-runtime").JSX.Element;
@@ -2,6 +2,7 @@ export * from './AddCircle';
2
2
  export * from './Bell';
3
3
  export * from './BookOpen';
4
4
  export * from './Calendar';
5
+ export * from './Challenge';
5
6
  export * from './Dumbbell';
6
7
  export * from './Flag';
7
8
  export * from './Flame';
@@ -0,0 +1,40 @@
1
+ import { VariantProps } from 'class-variance-authority';
2
+ import * as React from "react";
3
+ declare const trackVariants: (props?: ({
4
+ size?: "sm" | "md" | "lg" | null | undefined;
5
+ fullWidth?: boolean | null | undefined;
6
+ } & import('class-variance-authority/types').ClassProp) | undefined) => string;
7
+ export interface SegmentedControlOption {
8
+ value: string;
9
+ label: React.ReactNode;
10
+ /** 좌측 아이콘 */
11
+ icon?: React.ReactNode;
12
+ disabled?: boolean;
13
+ }
14
+ export interface SegmentedControlProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "onChange" | "defaultValue">, VariantProps<typeof trackVariants> {
15
+ options: SegmentedControlOption[];
16
+ /** 선택값 (controlled) */
17
+ value?: string;
18
+ /** 초기 선택값 (uncontrolled) */
19
+ defaultValue?: string;
20
+ onValueChange?(value: string): void;
21
+ }
22
+ /**
23
+ * SegmentedControl
24
+ * 회색 트랙 위에서 흰 인디케이터가 슬라이드 이동하는 단일 선택 세그먼트 컨트롤.
25
+ *
26
+ * @example
27
+ * ```tsx
28
+ * <SegmentedControl
29
+ * aria-label="챌린지 유형"
30
+ * options={[
31
+ * { value: "personal", label: "개인 챌린지", icon: <Person /> },
32
+ * { value: "group", label: "단체 챌린지", icon: <People /> },
33
+ * ]}
34
+ * defaultValue="personal"
35
+ * onValueChange={(v) => setType(v)}
36
+ * />
37
+ * ```
38
+ */
39
+ export declare function SegmentedControl({ options, value, defaultValue, onValueChange, size, fullWidth, className, ...props }: SegmentedControlProps): React.ReactElement;
40
+ export {};
@@ -0,0 +1 @@
1
+ export * from './SegmentedControl';
@@ -17,7 +17,7 @@ export interface TextFieldProps extends Omit<React.InputHTMLAttributes<HTMLInput
17
17
  iconLeft?: React.ReactNode;
18
18
  /** suffix 텍스트/노드 (오른쪽 — 글자수, 단위 등) */
19
19
  suffix?: React.ReactNode;
20
- /** suffix 대신 자유 노드 — iconRight (suffix와 동일 자리) */
20
+ /** suffix 대신 자유 노드 — iconRight (suffix와 동일 자리, 버튼 등 클릭 가능) */
21
21
  iconRight?: React.ReactNode;
22
22
  multiline?: boolean;
23
23
  rows?: number;
@@ -2,6 +2,7 @@ import { VariantProps } from 'class-variance-authority';
2
2
  import * as ToggleGroupPrimitive from '@radix-ui/react-toggle-group';
3
3
  declare const toggleGroupItemVariants: (props?: ({
4
4
  shape?: "square" | "rounded" | null | undefined;
5
+ size?: "sm" | "md" | "lg" | null | undefined;
5
6
  } & import('class-variance-authority/types').ClassProp) | undefined) => string;
6
7
  interface ToggleGroupItemProps extends React.ComponentProps<typeof ToggleGroupPrimitive.Item>, VariantProps<typeof toggleGroupItemVariants> {
7
8
  icon?: React.ReactNode;
@@ -17,5 +18,5 @@ export declare function ToggleGroup({ children, className, ...props }: React.Com
17
18
  * ToggleGroupItem
18
19
  * 토글 그룹 안에서 사용하는 카테고리형 아이템 컴포넌트.
19
20
  */
20
- export declare function ToggleGroupItem({ icon, shape, children, className, ...props }: ToggleGroupItemProps): React.ReactElement;
21
+ export declare function ToggleGroupItem({ icon, shape, size, children, className, ...props }: ToggleGroupItemProps): React.ReactElement;
21
22
  export {};
@@ -29,6 +29,7 @@ export * from './ProgressBar';
29
29
  export * from './Radio';
30
30
  export * from './ScheduleCalendar';
31
31
  export * from './SectionHeader';
32
+ export * from './SegmentedControl';
32
33
  export * from './Select';
33
34
  export * from './Snackbar';
34
35
  export * from './StatCard';
@@ -0,0 +1 @@
1
+ export * from './useMediaQuery';
@@ -0,0 +1,8 @@
1
+ /**
2
+ * useMediaQuery
3
+ * 주어진 미디어쿼리의 매칭 여부를 SSR 안전하게 반환한다.
4
+ * 서버 렌더링 시점에는 항상 false를 반환하고, 마운트 이후 실제 값으로 동기화한다.
5
+ */
6
+ export declare function useMediaQuery(query: string): boolean;
7
+ /** 모바일 뷰포트(기본 640px 이하) 여부를 반환한다. */
8
+ export declare function useIsMobile(maxWidth?: number): boolean;
package/dist/index.d.ts CHANGED
@@ -1,2 +1,3 @@
1
1
  export * from './components';
2
+ export * from './hooks';
2
3
  export * from './lib/utils';