@bigtablet/design-system 3.23.0 → 3.24.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.
package/dist/index.css CHANGED
@@ -1734,6 +1734,171 @@ body:has(.bottom_nav) {
1734
1734
  }
1735
1735
  }
1736
1736
 
1737
+ /* src/ui/navigation/stepper/style.scss */
1738
+ @keyframes skeleton_loading {
1739
+ 0% {
1740
+ background-position: 100% 0;
1741
+ }
1742
+ 100% {
1743
+ background-position: 0 0;
1744
+ }
1745
+ }
1746
+ .stepper {
1747
+ margin: 0;
1748
+ padding: 0;
1749
+ list-style: none;
1750
+ display: flex;
1751
+ font-family: "Pretendard", sans-serif;
1752
+ }
1753
+ .stepper_step {
1754
+ position: relative;
1755
+ display: flex;
1756
+ min-width: 0;
1757
+ }
1758
+ .stepper_content {
1759
+ display: flex;
1760
+ align-items: flex-start;
1761
+ gap: 8px;
1762
+ min-width: 0;
1763
+ padding: 0;
1764
+ border: none;
1765
+ background: none;
1766
+ color: inherit;
1767
+ font: inherit;
1768
+ text-align: left;
1769
+ }
1770
+ .stepper_button {
1771
+ cursor: pointer;
1772
+ border-radius: 6px;
1773
+ transition: background-color 0.1s ease-in-out;
1774
+ }
1775
+ .stepper_button:hover:not([aria-disabled=true]) {
1776
+ background-color: var(--bt-color-bg-solid-dim);
1777
+ }
1778
+ .stepper_button[aria-disabled=true] {
1779
+ cursor: default;
1780
+ }
1781
+ .stepper_button:focus-visible {
1782
+ outline: none;
1783
+ box-shadow: var(--bt-focus-ring);
1784
+ }
1785
+ .stepper_indicator {
1786
+ flex-shrink: 0;
1787
+ display: inline-flex;
1788
+ align-items: center;
1789
+ justify-content: center;
1790
+ box-sizing: border-box;
1791
+ width: 28px;
1792
+ height: 28px;
1793
+ border-radius: 9999px;
1794
+ background: var(--bt-color-bg-solid-dim);
1795
+ color: var(--bt-color-text-caption);
1796
+ font-size: 14px;
1797
+ font-weight: 500;
1798
+ line-height: 20px;
1799
+ letter-spacing: 0px;
1800
+ font-variant-numeric: tabular-nums;
1801
+ transition: background-color 0.1s ease-in-out, color 0.1s ease-in-out;
1802
+ }
1803
+ .stepper_text {
1804
+ display: flex;
1805
+ flex-direction: column;
1806
+ gap: 2px;
1807
+ min-width: 0;
1808
+ padding-top: 4px;
1809
+ }
1810
+ .stepper_label {
1811
+ color: var(--bt-color-text-heading);
1812
+ font-size: 15px;
1813
+ font-weight: 500;
1814
+ line-height: 22.5px;
1815
+ letter-spacing: 0px;
1816
+ overflow-wrap: anywhere;
1817
+ }
1818
+ .stepper_description {
1819
+ color: var(--bt-color-text-caption);
1820
+ font-size: 14px;
1821
+ font-weight: 400;
1822
+ line-height: 20px;
1823
+ letter-spacing: 0px;
1824
+ overflow-wrap: anywhere;
1825
+ }
1826
+ .stepper_sr_only {
1827
+ position: absolute;
1828
+ width: 1px;
1829
+ height: 1px;
1830
+ padding: 0;
1831
+ margin: -1px;
1832
+ overflow: hidden;
1833
+ clip: rect(0 0 0 0);
1834
+ clip-path: inset(50%);
1835
+ white-space: nowrap;
1836
+ border: 0;
1837
+ }
1838
+ .stepper_step_done .stepper_indicator {
1839
+ background: var(--bt-color-status-success-container);
1840
+ color: var(--bt-color-status-success-on-container);
1841
+ }
1842
+ .stepper_step_active .stepper_indicator {
1843
+ background: var(--bt-color-accent-default);
1844
+ color: var(--bt-color-accent-on-surface);
1845
+ }
1846
+ .stepper_step_pending .stepper_indicator {
1847
+ background: transparent;
1848
+ border: 2px solid var(--bt-color-border-default);
1849
+ }
1850
+ .stepper_step_pending .stepper_label {
1851
+ color: var(--bt-color-text-caption);
1852
+ }
1853
+ .stepper_horizontal {
1854
+ flex-direction: row;
1855
+ align-items: flex-start;
1856
+ gap: 8px;
1857
+ }
1858
+ .stepper_horizontal .stepper_step {
1859
+ flex: 1;
1860
+ align-items: flex-start;
1861
+ }
1862
+ .stepper_horizontal .stepper_step:not(:last-child)::after {
1863
+ content: "";
1864
+ flex: 1;
1865
+ height: 1px;
1866
+ margin-top: 14px;
1867
+ margin-left: 8px;
1868
+ background: var(--bt-color-border-default);
1869
+ }
1870
+ .stepper_horizontal .stepper_step_done:not(:last-child)::after {
1871
+ background: var(--bt-color-accent-default);
1872
+ }
1873
+ .stepper_vertical {
1874
+ flex-direction: column;
1875
+ }
1876
+ .stepper_vertical .stepper_step {
1877
+ padding-bottom: 20px;
1878
+ }
1879
+ .stepper_vertical .stepper_step:last-child {
1880
+ padding-bottom: 0;
1881
+ }
1882
+ .stepper_vertical .stepper_step:not(:last-child) .stepper_indicator::before {
1883
+ content: "";
1884
+ position: absolute;
1885
+ top: 28px;
1886
+ bottom: -4px;
1887
+ left: 14px;
1888
+ width: 1px;
1889
+ background: var(--bt-color-border-default);
1890
+ transform: translateX(-50%);
1891
+ }
1892
+ .stepper_vertical .stepper_step_done:not(:last-child) .stepper_indicator::before {
1893
+ background: var(--bt-color-accent-default);
1894
+ }
1895
+ @media (prefers-reduced-motion: reduce) {
1896
+ .stepper_button,
1897
+ .stepper_indicator {
1898
+ transition: none;
1899
+ }
1900
+ }
1901
+
1737
1902
  /* src/ui/navigation/tabs/style.scss */
1738
1903
  @keyframes skeleton_loading {
1739
1904
  0% {
@@ -4620,6 +4785,13 @@ body:has(.bottom_nav) {
4620
4785
  height: 16px;
4621
4786
  }
4622
4787
  }
4788
+ .toast_live {
4789
+ flex: 1;
4790
+ min-width: 0;
4791
+ display: flex;
4792
+ align-items: flex-start;
4793
+ gap: 8px;
4794
+ }
4623
4795
  .toast_message {
4624
4796
  flex: 1;
4625
4797
  overflow-wrap: anywhere;
@@ -4656,6 +4828,28 @@ body:has(.bottom_nav) {
4656
4828
  margin-top: 0;
4657
4829
  }
4658
4830
  }
4831
+ .toast_action {
4832
+ flex-shrink: 0;
4833
+ margin-top: -1px;
4834
+ padding: 2px 8px;
4835
+ border: none;
4836
+ background: none;
4837
+ cursor: pointer;
4838
+ color: var(--bt-color-accent-default);
4839
+ font-size: 13px;
4840
+ font-weight: 600;
4841
+ line-height: 20px;
4842
+ border-radius: 6px;
4843
+ transition: color 0.1s ease-in-out, background-color 0.1s ease-in-out;
4844
+ }
4845
+ .toast_action:hover {
4846
+ color: var(--bt-color-accent-strong);
4847
+ background-color: var(--bt-color-bg-solid-dim);
4848
+ }
4849
+ .toast_action:focus-visible {
4850
+ outline: none;
4851
+ box-shadow: var(--bt-focus-ring);
4852
+ }
4659
4853
  .toast_progress {
4660
4854
  position: absolute;
4661
4855
  bottom: 0;
package/dist/index.d.ts CHANGED
@@ -80,6 +80,13 @@ interface FocusTrapOptions {
80
80
  * 우회 없이 세 갈래가 그대로 표현된다.
81
81
  */
82
82
  preferWithin?: React$1.RefObject<HTMLElement | null>;
83
+ /**
84
+ * 초기 포커스를 **이 요소**에 둔다. `preferWithin` 보다 먼저 본다. 컨테이너 안에 붙어 있어야
85
+ * 하고, 아직 없거나 밖이면 기존 순서(`preferWithin` → skip 없는 첫 요소 → 첫 요소 → 컨테이너)
86
+ * 로 떨어진다. 기본 순서가 틀린 자리로 가는 화면 - 검색 모달의 검색 입력, 위험 확인 모달의
87
+ * "취소" - 에서 쓴다.
88
+ */
89
+ initialFocus?: React$1.RefObject<HTMLElement | null>;
83
90
  }
84
91
  declare function useFocusTrap(containerRef: React$1.RefObject<HTMLElement | null>, isActive: boolean, options?: FocusTrapOptions): void;
85
92
 
@@ -792,6 +799,61 @@ interface SidebarSectionProps extends React$1.HTMLAttributes<HTMLDivElement> {
792
799
  /** SidebarItem 그룹 라벨. collapsed에선 sr-only로 숨김. */
793
800
  declare const SidebarSection: ({ label, className, children, ...props }: SidebarSectionProps) => React$1.JSX.Element;
794
801
 
802
+ /** 단계의 진행 상태. `current` 와의 인덱스 비교로 파생된다 - 소비자가 따로 관리하지 않는다 */
803
+ type StepperStatus = "done" | "active" | "pending";
804
+ type StepperOrientation = "horizontal" | "vertical";
805
+ interface StepperStep {
806
+ /** 목록 키 */
807
+ id: string | number;
808
+ /** 단계 이름. 인라인 내용만 - 클릭 가능한 단계는 `<button>` 안에 그려진다 */
809
+ label: React$1.ReactNode;
810
+ /** 이름 아래 짧은 설명. 인라인 내용만 */
811
+ description?: React$1.ReactNode;
812
+ }
813
+ interface StepperProps extends Omit<React$1.HTMLAttributes<HTMLOListElement>, "onClick"> {
814
+ /** 순서대로 */
815
+ steps: StepperStep[];
816
+ /** 현재 단계 인덱스 (0-based). 앞은 `done`, 뒤는 `pending` 이 된다 */
817
+ current: number;
818
+ /** 배치 방향 (기본값: "horizontal") */
819
+ orientation?: StepperOrientation;
820
+ /**
821
+ * 주면 모든 단계가 버튼이 되되 **지나간 단계만 눌린다**. 현재·이후 단계는 `aria-disabled` 다 -
822
+ * 아직 오지 않은 단계로 건너뛰는 것은 그 사이 폼 검증을 우회하는 일이라 컴포넌트가 열지 않는다.
823
+ */
824
+ onStepClick?: (index: number, step: StepperStep) => void;
825
+ /** 루트 요소 ref (React 19 ref-as-prop) */
826
+ ref?: React$1.Ref<HTMLOListElement>;
827
+ }
828
+ /**
829
+ * 다단계 폼의 진행 표시. 가입·온보딩·결제처럼 "몇 단계 중 어디" 를 보여 준다.
830
+ *
831
+ * `<ol>` 로 렌더한다 - 순서가 있는 목록이고 스크린리더가 "3개 중 2번째" 를 읽어 준다. 현재 단계는
832
+ * `aria-current="step"`, 지나간 단계는 시각 숨김 텍스트 "완료" 를 함께 갖는다. 색·모양만으로
833
+ * 상태를 전달하지 않는다 (WCAG 1.4.1) - `done` 은 체크, `active`·`pending` 은 번호이고 `pending`
834
+ * 은 빈 원이다.
835
+ *
836
+ * `Timeline` 과의 경계: 시간 순 **기록**(주문 추적, 활동 로그)은 `Timeline`, 사용자가 **밟아
837
+ * 가는 절차**는 `Stepper`.
838
+ *
839
+ * @example
840
+ * ```tsx
841
+ * <Stepper
842
+ * steps={[
843
+ * { id: "account", label: "계정" },
844
+ * { id: "profile", label: "프로필", description: "이름과 소속" },
845
+ * { id: "done", label: "완료" },
846
+ * ]}
847
+ * current={1}
848
+ * onStepClick={setStep}
849
+ * />
850
+ * ```
851
+ */
852
+ declare const Stepper: {
853
+ ({ steps, current, orientation, onStepClick, className, ref, ...props }: StepperProps): React$1.JSX.Element;
854
+ displayName: string;
855
+ };
856
+
795
857
  type TabsVariant = "line" | "fills";
796
858
  type TabsSize = "sm" | "md";
797
859
  interface TabsProps extends Omit<React$1.HTMLAttributes<HTMLDivElement>, "onChange"> {
@@ -1539,8 +1601,15 @@ type TableProps<T extends object> = {
1539
1601
  onSortChange?: (sort: TableSort | undefined) => void;
1540
1602
  /** 전체 선택 체크박스 aria-label */
1541
1603
  selectAllAriaLabel?: string;
1542
- /** 개별 행 선택 체크박스 aria-label. 인자는 `rowIndexOffset` 이 더해진 **전체 순번**이다 (기본값: (i) => `${i+1}번째 행 선택`) */
1543
- selectRowAriaLabel?: (index: number) => string;
1604
+ /**
1605
+ * 개별 행 선택 체크박스 aria-label. 첫 인자는 `rowIndexOffset` 이 더해진 **전체 순번**, 둘째는
1606
+ * 그 행의 데이터 - 번호 대신 이름으로 읽히게 할 때 쓴다 (기본값: (i) => `${i+1}번째 행 선택`)
1607
+ * @example
1608
+ * ```tsx
1609
+ * selectRowAriaLabel={(_, row) => `${row.name} 선택`}
1610
+ * ```
1611
+ */
1612
+ selectRowAriaLabel?: (index: number, row: T) => string;
1544
1613
  /**
1545
1614
  * 이 표의 첫 행이 전체에서 몇 번째인지 (0-based, 기본 0). 서버 페이지네이션처럼 한 쪽만
1546
1615
  * 받아 그릴 때 준다.
@@ -1636,15 +1705,14 @@ interface DataViewProps<T extends object> extends Omit<React$1.HTMLAttributes<HT
1636
1705
  /** 전체 선택 체크박스의 라벨 (기본값: `Table` 의 기본 라벨) */
1637
1706
  selectAllAriaLabel?: string;
1638
1707
  /**
1639
- * 행 선택 체크박스의 라벨. 인자는 `pagination.pageSize` 를 반영한 **전체 순번**(0-based)이다.
1640
- * 기본값은 순번만 읽어 주므로, 행을 이름으로 구분하려면 바깥 `rows` 를 닫아 넘긴다.
1708
+ * 행 선택 체크박스의 라벨. 첫 인자는 `pagination.pageSize` 를 반영한 **전체 순번**(0-based),
1709
+ * 둘째는 그 행의 데이터. 기본값은 순번만 읽어 주므로 행을 이름으로 구분하려면 둘째 인자를 쓴다.
1641
1710
  * @example
1642
1711
  * ```tsx
1643
- * const offset = (page - 1) * SIZE;
1644
- * selectRowAriaLabel={(index) => `${rows[index - offset].name} 선택`}
1712
+ * selectRowAriaLabel={(_, row) => `${row.name} 선택`}
1645
1713
  * ```
1646
1714
  */
1647
- selectRowAriaLabel?: (index: number) => string;
1715
+ selectRowAriaLabel?: (index: number, row: T) => string;
1648
1716
  /** 선택 액션 줄의 안내 문구 (기본값: (n) => `${n}개 선택됨`) */
1649
1717
  selectionSummary?: (count: number) => string;
1650
1718
  /** 선택 해제 버튼 라벨 */
@@ -1951,6 +2019,25 @@ interface SpinnerProps {
1951
2019
  declare const Spinner: ({ size, ariaLabel: ariaLabelProp }: SpinnerProps) => React$1.JSX.Element;
1952
2020
 
1953
2021
  type ToastVariant = "success" | "error" | "warning" | "info" | "default";
2022
+ interface ToastAction {
2023
+ /** 버튼 라벨 - "실행 취소" 등 */
2024
+ label: string;
2025
+ /** 누르면 실행되고, 이어서 토스트가 닫힌다 */
2026
+ onClick: () => void;
2027
+ }
2028
+ interface ToastOptions {
2029
+ /** 자동 닫힘까지의 ms (기본값: 3000). `Infinity` 면 닫기 버튼·`dismiss` 로만 닫힌다 - 진행 토스트용 */
2030
+ duration?: number;
2031
+ /** 메시지 옆 버튼. 한 번 누를 수 있는 되돌리기 같은 동작에 쓴다 */
2032
+ action?: ToastAction;
2033
+ }
2034
+ /** `update` 로 바꿀 수 있는 필드. `action: null` 이면 버튼을 뗀다 */
2035
+ type ToastPatch = Partial<{
2036
+ message: string;
2037
+ variant: ToastVariant;
2038
+ duration: number;
2039
+ action: ToastAction | null;
2040
+ }>;
1954
2041
  interface ToastProviderProps {
1955
2042
  /** 앱 루트에서 감싸는 자식 요소 */
1956
2043
  children: React$1.ReactNode;
@@ -1972,19 +2059,23 @@ declare const ToastProvider: ({ children, maxCount, closeAriaLabel: closeAriaLab
1972
2059
  /**
1973
2060
  * 토스트 메시지를 표시하는 훅.
1974
2061
  * ToastProvider 내부에서만 사용할 수 있다.
1975
- * @returns 토스트 메시지 표시 함수 객체
2062
+ * @returns 토스트 표시·닫기·갱신 함수 객체. 표시 함수는 토스트 id 를 반환한다
1976
2063
  */
1977
2064
  declare const useToast: () => {
1978
- /** 성공 메시지를 표시한다 */
1979
- success: (message: string, duration?: number) => void;
2065
+ /** 성공 메시지를 표시한다. 두 번째 인자는 ms 또는 `{ duration, action }` */
2066
+ success: (message: string, options?: number | ToastOptions) => string;
1980
2067
  /** 오류 메시지를 표시한다 */
1981
- error: (message: string, duration?: number) => void;
2068
+ error: (message: string, options?: number | ToastOptions) => string;
1982
2069
  /** 경고 메시지를 표시한다 */
1983
- warning: (message: string, duration?: number) => void;
2070
+ warning: (message: string, options?: number | ToastOptions) => string;
1984
2071
  /** 정보 메시지를 표시한다 */
1985
- info: (message: string, duration?: number) => void;
2072
+ info: (message: string, options?: number | ToastOptions) => string;
1986
2073
  /** 기본 메시지를 표시한다 */
1987
- message: (message: string, duration?: number) => void;
2074
+ message: (message: string, options?: number | ToastOptions) => string;
2075
+ /** id 의 토스트를 닫는다 - 닫기 버튼과 같은 퇴출 모션 */
2076
+ dismiss: (id: string) => void;
2077
+ /** id 의 토스트 내용을 바꾼다 - "업로드 중…" 을 "완료" 로 */
2078
+ update: (id: string, patch: ToastPatch) => void;
1988
2079
  };
1989
2080
 
1990
2081
  interface TopLoadingProps {
@@ -3131,6 +3222,12 @@ interface DrawerProps extends Omit<React$1.HTMLAttributes<HTMLDivElement>, "titl
3131
3222
  * 둘 다 비우면 이름 없는 대화상자가 되고 axe `aria-dialog-name` 이 잡는다.
3132
3223
  */
3133
3224
  ariaLabel?: string;
3225
+ /**
3226
+ * 열릴 때 포커스를 둘 요소. 기본 순서(본문 첫 컨트롤 → 닫기 버튼 → 패널)가 틀린 자리로 가는
3227
+ * 화면에서 쓴다 - 검색 드로어의 검색 입력, 위험 확인 드로어의 "취소" 버튼. 패널 안에 붙어
3228
+ * 있는 요소여야 하고, 아니면 기본 순서로 떨어진다.
3229
+ */
3230
+ initialFocusRef?: React$1.RefObject<HTMLElement | null>;
3134
3231
  /**
3135
3232
  * 퇴출 애니메이션이 끝나 패널이 실제로 언마운트된 뒤 호출된다.
3136
3233
  * `open` 을 끈 직후가 아니라 이 시점에 상세 데이터를 비워야 본문만 먼저 사라지지 않는다.
@@ -3145,7 +3242,7 @@ interface DrawerProps extends Omit<React$1.HTMLAttributes<HTMLDivElement>, "titl
3145
3242
  * @returns 열림 상태일 때 렌더링된 드로어, 닫힘 상태면 null
3146
3243
  */
3147
3244
  declare const Drawer: {
3148
- ({ open, onClose, placement, size, title, footer, closeOnOverlay, dismissible, showCloseIcon, closeLabel: closeLabelProp, ariaLabel, onExited, children, className, ...props }: DrawerProps): React$1.ReactPortal | null;
3245
+ ({ open, onClose, placement, size, title, footer, closeOnOverlay, dismissible, showCloseIcon, closeLabel: closeLabelProp, ariaLabel, initialFocusRef, onExited, children, className, ...props }: DrawerProps): React$1.ReactPortal | null;
3149
3246
  displayName: string;
3150
3247
  };
3151
3248
 
@@ -3184,6 +3281,12 @@ interface ModalProps extends Omit<React$1.HTMLAttributes<HTMLDivElement>, "title
3184
3281
  * 둘 다 비우면 이름 없는 대화상자가 되고 axe `aria-dialog-name` 이 잡는다.
3185
3282
  */
3186
3283
  ariaLabel?: string;
3284
+ /**
3285
+ * 열릴 때 포커스를 둘 요소. 기본 순서(본문 첫 컨트롤 → 닫기 버튼 → 패널)가 틀린 자리로 가는
3286
+ * 화면에서 쓴다 - 검색 모달의 검색 입력, 위험 확인 모달의 "취소" 버튼. 패널 안에 붙어
3287
+ * 있는 요소여야 하고, 아니면 기본 순서로 떨어진다.
3288
+ */
3289
+ initialFocusRef?: React$1.RefObject<HTMLElement | null>;
3187
3290
  /**
3188
3291
  * 퇴출 애니메이션이 끝나 패널이 실제로 언마운트된 뒤 호출된다.
3189
3292
  * `open` 을 끈 직후가 아니라 이 시점에 상세 데이터를 비워야 본문만 먼저 사라지지 않는다.
@@ -3196,7 +3299,7 @@ interface ModalProps extends Omit<React$1.HTMLAttributes<HTMLDivElement>, "title
3196
3299
  * @param props 모달 속성
3197
3300
  * @returns 열림 상태일 때 렌더링된 모달, 닫힘 상태면 null
3198
3301
  */
3199
- declare const Modal: ({ open, onClose, closeOnOverlay, dismissible, width, title, description, footer, footerAlign, showCloseIcon, closeLabel: closeLabelProp, children, className, ariaLabel, onExited, ...props }: ModalProps) => React$1.ReactPortal | null;
3302
+ declare const Modal: ({ open, onClose, closeOnOverlay, dismissible, width, title, description, footer, footerAlign, showCloseIcon, closeLabel: closeLabelProp, children, className, ariaLabel, initialFocusRef, onExited, ...props }: ModalProps) => React$1.ReactPortal | null;
3200
3303
 
3201
3304
  /**
3202
3305
  * DS 가 스스로 렌더하는 모든 사용자 노출 문구. 컴포넌트 안에 흩어져 있던 기본값을 한곳에 모은다.
@@ -3269,6 +3372,8 @@ interface LocaleMessages {
3269
3372
  "pagination.next": string;
3270
3373
  "pagination.prev": string;
3271
3374
  "sidebar.toggle": string;
3375
+ "stepper.current": string;
3376
+ "stepper.done": string;
3272
3377
  "drawer.close": string;
3273
3378
  "modal.close": string;
3274
3379
  }
@@ -3607,4 +3712,4 @@ type StackProps<T extends React$1.ElementType = "div"> = PolymorphicProps<T, Sta
3607
3712
  */
3608
3713
  declare const Stack: <T extends React$1.ElementType = "div">({ direction, gap, align, justify, wrap, as, ref, className, children, style, ...props }: StackProps<T>) => React$1.JSX.Element;
3609
3714
 
3610
- export { Accordion, type AccordionItem, type AccordionProps, type AlertActionsAlign, type AlertOptions, AlertProvider, type AlertVariant, AppShell, type AppShellProps, Avatar, type AvatarProps, type AvatarShape, type AvatarSize, Badge, type BadgeAppearance, type BadgeProps, type BadgeShape, type BadgeSize, type BadgeVariant, BottomNav, BottomNavItem, type BottomNavItemProps, type BottomNavProps, BottomNavSpacer, Breadcrumb, type BreadcrumbItem, type BreadcrumbProps, Button, type ButtonAsAnchor, type ButtonAsButton, type ButtonProps, type ButtonSize, type ButtonVariant, Card, type CardFooterAlign, type CardProps, type CardVariant, Checkbox, type CheckboxProps, Chip, type ChipProps, type ChipSize, type ChipTone, type ChipType, Combobox, type ComboboxOption, type ComboboxProps, type ComboboxSize, Container, type ContainerProps, type ContainerSize, type CropImageSize, type CropOffset, type CropRect, DataView, type DataViewPagination, type DataViewProps, type DataViewQuery, type DataViewSelectionAction, type DataViewToolbar, DatePicker, type DatePickerProps, type DateRange, DateRangePicker, type DateRangePickerProps, DescriptionList, type DescriptionListItem, type DescriptionListLayout, type DescriptionListProps, Divider, type DividerProps, Drawer, type DrawerPlacement, type DrawerProps, Dropdown, type DropdownMultipleProps, type DropdownOption, type DropdownProps, type DropdownSingleProps, type DropdownSize, type DropdownVariant, EmptyState, type EmptyStateProps, ErrorState, type ErrorStateProps, type ErrorStateVariant, Field, type FieldControl, type FieldProps, FileInput, type FileInputProps, type FileInputVariant, type FocusTrapOptions, Form, type FormActionsProps, type FormProps, Grid, type GridCols, type GridGap, type GridProps, Hero, type HeroAction, type HeroAlign, type HeroHeight, type HeroOverlay, type HeroProps, Icon, IconButton, type IconButtonProps, type IconButtonSize, type IconButtonVariant, type IconProps, ImageCropper, type ImageCropperHandle, type ImageCropperProps, type ImeStrategy, LinearProgress, type LinearProgressProps, ListItem, type ListItemProps, type ListboxItem, type LocaleKey, type LocaleMessages, type LocaleName, LocaleProvider, type LocaleProviderProps, type LocaleText, MediaCard, type MediaCardImage, type MediaCardImagePosition, type MediaCardProps, type MediaCardShadow, Menu, type MenuItem, type MenuProps, Modal, type ModalFooterAlign, type ModalProps, NavBar, type NavBarLayout, type NavBarLocaleConfig, type NavBarLocaleOption, type NavBarProps, type NavBarVariant, NavLink, type NavLinkProps, OtpInput, type OtpInputProps, PageHeader, type PageHeaderProps, Pagination, type PaginationProps, type PolymorphicProps, type PolymorphicRef, Popover, type PopoverPlacement, type PopoverProps, Prose, type ProseProps, type ProseSize, Radio, RadioGroup, type RadioGroupContextValue, type RadioGroupOrientation, type RadioGroupProps, type RadioGroupSize, type RadioProps, type ResolvedTheme, Section, type SectionBg, type SectionProps, type SectionSpacing, Sidebar, SidebarItem, type SidebarItemProps, type SidebarMode, type SidebarProps, SidebarSection, type SidebarSectionProps, Skeleton, type SkeletonProps, type SkeletonVariant, Spinner, type SpinnerProps, Stack, type StackAlign, type StackDirection, type StackGap, type StackJustify, type StackProps, type StackWrap, Stat, type StatDeltaTone, type StatProps, Tab, TabList, type TabListProps, TabPanel, type TabPanelProps, type TabProps, Table, type TableColumn, type TableProps, type TableSize, type TableSort, type TableSortDirection, Tabs, type TabsProps, type TabsSize, type TabsVariant, TagInput, type TagInputProps, type TagInputSize, TextField, type TextFieldProps, type TextFieldSize, type TextFieldVariant, Textarea, type TextareaProps, type TextareaResize, type TextareaSize, type ThemeMode, ThemeProvider, type ThemeProviderProps, TimePicker, type TimePickerProps, Timeline, type TimelineItem, type TimelineProps, type TimelineStatus, ToastProvider, type ToastProviderProps, type ToastVariant, Toggle, type ToggleProps, Tooltip, type TooltipPlacement, type TooltipProps, TopLoading, type TopLoadingProps, type UseListboxPopupArgs, type UseListboxPopupResult, a11y, baseBorderWidth, baseColors, baseTypography, borderWidth, breakpoints, catalogs, cn, colors, elevation, en, iconSize, ko, motion, opacity, radius, skeleton, spacing, typography, useAlert, useFieldControl, useFocusTrap, useListboxPopup, useLocaleName, useLocaleText, useRadioGroupContext, useReducedMotion, useSpringHover, useSpringPresence, useTheme, useToast, zIndex };
3715
+ export { Accordion, type AccordionItem, type AccordionProps, type AlertActionsAlign, type AlertOptions, AlertProvider, type AlertVariant, AppShell, type AppShellProps, Avatar, type AvatarProps, type AvatarShape, type AvatarSize, Badge, type BadgeAppearance, type BadgeProps, type BadgeShape, type BadgeSize, type BadgeVariant, BottomNav, BottomNavItem, type BottomNavItemProps, type BottomNavProps, BottomNavSpacer, Breadcrumb, type BreadcrumbItem, type BreadcrumbProps, Button, type ButtonAsAnchor, type ButtonAsButton, type ButtonProps, type ButtonSize, type ButtonVariant, Card, type CardFooterAlign, type CardProps, type CardVariant, Checkbox, type CheckboxProps, Chip, type ChipProps, type ChipSize, type ChipTone, type ChipType, Combobox, type ComboboxOption, type ComboboxProps, type ComboboxSize, Container, type ContainerProps, type ContainerSize, type CropImageSize, type CropOffset, type CropRect, DataView, type DataViewPagination, type DataViewProps, type DataViewQuery, type DataViewSelectionAction, type DataViewToolbar, DatePicker, type DatePickerProps, type DateRange, DateRangePicker, type DateRangePickerProps, DescriptionList, type DescriptionListItem, type DescriptionListLayout, type DescriptionListProps, Divider, type DividerProps, Drawer, type DrawerPlacement, type DrawerProps, Dropdown, type DropdownMultipleProps, type DropdownOption, type DropdownProps, type DropdownSingleProps, type DropdownSize, type DropdownVariant, EmptyState, type EmptyStateProps, ErrorState, type ErrorStateProps, type ErrorStateVariant, Field, type FieldControl, type FieldProps, FileInput, type FileInputProps, type FileInputVariant, type FocusTrapOptions, Form, type FormActionsProps, type FormProps, Grid, type GridCols, type GridGap, type GridProps, Hero, type HeroAction, type HeroAlign, type HeroHeight, type HeroOverlay, type HeroProps, Icon, IconButton, type IconButtonProps, type IconButtonSize, type IconButtonVariant, type IconProps, ImageCropper, type ImageCropperHandle, type ImageCropperProps, type ImeStrategy, LinearProgress, type LinearProgressProps, ListItem, type ListItemProps, type ListboxItem, type LocaleKey, type LocaleMessages, type LocaleName, LocaleProvider, type LocaleProviderProps, type LocaleText, MediaCard, type MediaCardImage, type MediaCardImagePosition, type MediaCardProps, type MediaCardShadow, Menu, type MenuItem, type MenuProps, Modal, type ModalFooterAlign, type ModalProps, NavBar, type NavBarLayout, type NavBarLocaleConfig, type NavBarLocaleOption, type NavBarProps, type NavBarVariant, NavLink, type NavLinkProps, OtpInput, type OtpInputProps, PageHeader, type PageHeaderProps, Pagination, type PaginationProps, type PolymorphicProps, type PolymorphicRef, Popover, type PopoverPlacement, type PopoverProps, Prose, type ProseProps, type ProseSize, Radio, RadioGroup, type RadioGroupContextValue, type RadioGroupOrientation, type RadioGroupProps, type RadioGroupSize, type RadioProps, type ResolvedTheme, Section, type SectionBg, type SectionProps, type SectionSpacing, Sidebar, SidebarItem, type SidebarItemProps, type SidebarMode, type SidebarProps, SidebarSection, type SidebarSectionProps, Skeleton, type SkeletonProps, type SkeletonVariant, Spinner, type SpinnerProps, Stack, type StackAlign, type StackDirection, type StackGap, type StackJustify, type StackProps, type StackWrap, Stat, type StatDeltaTone, type StatProps, Stepper, type StepperOrientation, type StepperProps, type StepperStatus, type StepperStep, Tab, TabList, type TabListProps, TabPanel, type TabPanelProps, type TabProps, Table, type TableColumn, type TableProps, type TableSize, type TableSort, type TableSortDirection, Tabs, type TabsProps, type TabsSize, type TabsVariant, TagInput, type TagInputProps, type TagInputSize, TextField, type TextFieldProps, type TextFieldSize, type TextFieldVariant, Textarea, type TextareaProps, type TextareaResize, type TextareaSize, type ThemeMode, ThemeProvider, type ThemeProviderProps, TimePicker, type TimePickerProps, Timeline, type TimelineItem, type TimelineProps, type TimelineStatus, type ToastAction, type ToastOptions, type ToastPatch, ToastProvider, type ToastProviderProps, type ToastVariant, Toggle, type ToggleProps, Tooltip, type TooltipPlacement, type TooltipProps, TopLoading, type TopLoadingProps, type UseListboxPopupArgs, type UseListboxPopupResult, a11y, baseBorderWidth, baseColors, baseTypography, borderWidth, breakpoints, catalogs, cn, colors, elevation, en, iconSize, ko, motion, opacity, radius, skeleton, spacing, typography, useAlert, useFieldControl, useFocusTrap, useListboxPopup, useLocaleName, useLocaleText, useRadioGroupContext, useReducedMotion, useSpringHover, useSpringPresence, useTheme, useToast, zIndex };
package/dist/index.js CHANGED
@@ -1,10 +1,10 @@
1
1
  "use client";
2
2
  import './index.css';
3
3
  import * as React20 from 'react';
4
- import { createContext, useState, useRef, useCallback, useEffect, useMemo, useContext, useId, Fragment, useImperativeHandle, useLayoutEffect } from 'react';
4
+ import { createContext, useState, useRef, useCallback, useEffect, useMemo, useContext, useId, Fragment as Fragment$1, useImperativeHandle, useLayoutEffect } from 'react';
5
5
  import { useSpring, animated } from '@react-spring/web';
6
- import { ChevronDown, ChevronRight, Globe, ChevronLeft, EyeOff, Eye, ArrowUp, ArrowDown, ArrowUpDown, Search, XCircle, AlertTriangle, CheckCircle2, Info, Bell, Check, Image, X, TriangleAlert } from 'lucide-react';
7
- import { jsx, jsxs, Fragment as Fragment$1 } from 'react/jsx-runtime';
6
+ import { ChevronDown, ChevronRight, Globe, ChevronLeft, Check, EyeOff, Eye, ArrowUp, ArrowDown, ArrowUpDown, Search, XCircle, AlertTriangle, CheckCircle2, Info, Bell, Image, X, TriangleAlert } from 'lucide-react';
7
+ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
8
8
  import { createPortal } from 'react-dom';
9
9
 
10
10
  // src/utils/cn.ts
@@ -387,12 +387,16 @@ function useFocusTrap(containerRef, isActive, options) {
387
387
  const preferred = preferredRoot ? Array.from(preferredRoot.querySelectorAll(FOCUSABLE_SELECTORS)).find(
388
388
  (el) => !el.hasAttribute(SKIP_AUTOFOCUS_ATTR)
389
389
  ) ?? null : null;
390
- const initialTarget = preferred ?? Array.from(focusableElements).find((el) => !el.hasAttribute(SKIP_AUTOFOCUS_ATTR)) ?? focusableElements[0];
390
+ const explicit = options?.initialFocus?.current;
391
+ const explicitTarget = explicit && container.contains(explicit) && explicit.matches(FOCUSABLE_SELECTORS) ? explicit : null;
392
+ const initialTarget = explicitTarget ?? preferred ?? Array.from(focusableElements).find((el) => !el.hasAttribute(SKIP_AUTOFOCUS_ATTR)) ?? focusableElements[0];
391
393
  if (initialTarget) {
392
394
  initialTarget.focus();
393
395
  } else {
394
- container.setAttribute("tabindex", "-1");
395
- wasTabIndexAdded = true;
396
+ if (!container.hasAttribute("tabindex")) {
397
+ container.setAttribute("tabindex", "-1");
398
+ wasTabIndexAdded = true;
399
+ }
396
400
  container.focus();
397
401
  }
398
402
  const handleKeyDown2 = (e) => {
@@ -1037,6 +1041,8 @@ var ko = {
1037
1041
  "pagination.next": "\uB2E4\uC74C \uD398\uC774\uC9C0",
1038
1042
  "pagination.prev": "\uC774\uC804 \uD398\uC774\uC9C0",
1039
1043
  "sidebar.toggle": "\uC0AC\uC774\uB4DC\uBC14 \uD1A0\uAE00",
1044
+ "stepper.current": "\uD604\uC7AC \uB2E8\uACC4",
1045
+ "stepper.done": "\uC644\uB8CC",
1040
1046
  "drawer.close": "\uB2EB\uAE30",
1041
1047
  "modal.close": "\uB2EB\uAE30"
1042
1048
  };
@@ -1102,6 +1108,8 @@ var en = {
1102
1108
  "pagination.next": "Next page",
1103
1109
  "pagination.prev": "Previous page",
1104
1110
  "sidebar.toggle": "Toggle sidebar",
1111
+ "stepper.current": "Current step",
1112
+ "stepper.done": "Completed",
1105
1113
  "drawer.close": "Close",
1106
1114
  "modal.close": "Close"
1107
1115
  };
@@ -1194,7 +1202,7 @@ var BottomNavItem = (props) => {
1194
1202
  const ariaCurrent = active ? "page" : void 0;
1195
1203
  const anchorRest = rest;
1196
1204
  const Tag = as ?? (anchorRest.href != null ? "a" : "button");
1197
- const content = /* @__PURE__ */ jsxs(Fragment$1, { children: [
1205
+ const content = /* @__PURE__ */ jsxs(Fragment, { children: [
1198
1206
  /* @__PURE__ */ jsxs("span", { className: "bottom_nav_item_icon", "aria-hidden": "true", children: [
1199
1207
  icon,
1200
1208
  badge && /* @__PURE__ */ jsx("span", { className: "bottom_nav_item_badge", children: badge })
@@ -1711,7 +1719,7 @@ var SidebarItem = (props) => {
1711
1719
  const ariaCurrent = active ? "page" : void 0;
1712
1720
  const anchorRest = rest;
1713
1721
  const Tag = as ?? (anchorRest.href != null ? "a" : "button");
1714
- const inner = /* @__PURE__ */ jsxs(Fragment$1, { children: [
1722
+ const inner = /* @__PURE__ */ jsxs(Fragment, { children: [
1715
1723
  icon && /* @__PURE__ */ jsx("span", { className: "sidebar_item_icon", "aria-hidden": "true", children: icon }),
1716
1724
  /* @__PURE__ */ jsx("span", { className: "sidebar_item_label", children }),
1717
1725
  trailing && /* @__PURE__ */ jsx("span", { className: "sidebar_item_trailing", children: trailing })
@@ -1763,6 +1771,55 @@ var SidebarSection = ({ label, className, children, ...props }) => {
1763
1771
  children
1764
1772
  ] });
1765
1773
  };
1774
+ var Stepper = ({
1775
+ steps,
1776
+ current,
1777
+ orientation = "horizontal",
1778
+ onStepClick,
1779
+ className,
1780
+ ref,
1781
+ ...props
1782
+ }) => {
1783
+ const t = useLocaleText();
1784
+ return /* @__PURE__ */ jsx("ol", { ref, className: cn("stepper", `stepper_${orientation}`, className), ...props, children: steps.map((step, index) => {
1785
+ const status = index < current ? "done" : index === current ? "active" : "pending";
1786
+ const clickable = !!onStepClick && status === "done";
1787
+ const statusText = status === "done" ? t("stepper.done") : status === "active" ? t("stepper.current") : null;
1788
+ const inner = /* @__PURE__ */ jsxs(Fragment, { children: [
1789
+ /* @__PURE__ */ jsx("span", { className: "stepper_indicator", "aria-hidden": "true", children: status === "done" ? /* @__PURE__ */ jsx(Check, { size: iconSize.sm }) : index + 1 }),
1790
+ /* @__PURE__ */ jsxs("span", { className: "stepper_text", children: [
1791
+ /* @__PURE__ */ jsxs("span", { className: "stepper_label", children: [
1792
+ step.label,
1793
+ statusText && /* @__PURE__ */ jsxs("span", { className: "stepper_sr_only", children: [
1794
+ " ",
1795
+ statusText
1796
+ ] })
1797
+ ] }),
1798
+ step.description !== void 0 && step.description !== null && /* @__PURE__ */ jsx("span", { className: "stepper_description", children: step.description })
1799
+ ] })
1800
+ ] });
1801
+ return /* @__PURE__ */ jsx(
1802
+ "li",
1803
+ {
1804
+ className: cn("stepper_step", `stepper_step_${status}`),
1805
+ "aria-current": status === "active" ? "step" : void 0,
1806
+ children: onStepClick ? /* @__PURE__ */ jsx(
1807
+ "button",
1808
+ {
1809
+ type: "button",
1810
+ className: "stepper_content stepper_button",
1811
+ "aria-disabled": clickable ? void 0 : true,
1812
+ tabIndex: clickable ? void 0 : -1,
1813
+ onClick: clickable ? () => onStepClick(index, step) : void 0,
1814
+ children: inner
1815
+ }
1816
+ ) : /* @__PURE__ */ jsx("span", { className: "stepper_content", children: inner })
1817
+ },
1818
+ step.id
1819
+ );
1820
+ }) });
1821
+ };
1822
+ Stepper.displayName = "Stepper";
1766
1823
  var TabsContext = React20.createContext(null);
1767
1824
  function useTabsContext() {
1768
1825
  const ctx = React20.useContext(TabsContext);
@@ -3154,7 +3211,7 @@ var Button = (props) => {
3154
3211
  disabled && "button_disabled",
3155
3212
  className
3156
3213
  );
3157
- const content = /* @__PURE__ */ jsxs(Fragment$1, { children: [
3214
+ const content = /* @__PURE__ */ jsxs(Fragment, { children: [
3158
3215
  leadingIcon && /* @__PURE__ */ jsx("span", { className: "button_icon", "aria-hidden": "true", children: leadingIcon }),
3159
3216
  children && /* @__PURE__ */ jsx("span", { className: "button_label", children }),
3160
3217
  trailingIcon && /* @__PURE__ */ jsx("span", { className: "button_icon", "aria-hidden": "true", children: trailingIcon })
@@ -3384,7 +3441,7 @@ var Table = ({
3384
3441
  const rowClickHint = rowClickHintProp ?? t("table.rowClickHint");
3385
3442
  const emptyMessage = emptyMessageProp === void 0 ? t("table.empty") : emptyMessageProp;
3386
3443
  const selectAllAriaLabel = selectAllAriaLabelProp ?? t("table.selectAll");
3387
- const selectRowAriaLabel = selectRowAriaLabelProp ?? ((index) => t("table.selectRow", { index: index + 1 }));
3444
+ const selectRowAriaLabel = selectRowAriaLabelProp ?? ((index, _row) => t("table.selectRow", { index: index + 1 }));
3388
3445
  const toGlobalIndex = (rowIndex) => rowIndex + rowIndexOffset;
3389
3446
  const wrapperClassName = cn(
3390
3447
  "table_wrapper",
@@ -3534,7 +3591,7 @@ var Table = ({
3534
3591
  onRowClick && "table_row_clickable",
3535
3592
  isSelected && "table_row_selected"
3536
3593
  ),
3537
- "aria-selected": isSelected ? "true" : void 0,
3594
+ "aria-selected": selectable ? isSelected ? "true" : "false" : void 0,
3538
3595
  "aria-describedby": onRowClick && rowClickHint ? rowClickHintId : void 0,
3539
3596
  tabIndex: onRowClick ? 0 : void 0,
3540
3597
  onClick: onRowClick ? () => onRowClick(item, rowIndex) : void 0,
@@ -3554,7 +3611,7 @@ var Table = ({
3554
3611
  children: /* @__PURE__ */ jsx(
3555
3612
  Checkbox,
3556
3613
  {
3557
- "aria-label": selectRowAriaLabel(toGlobalIndex(rowIndex)),
3614
+ "aria-label": selectRowAriaLabel(toGlobalIndex(rowIndex), item),
3558
3615
  checked: isSelected,
3559
3616
  onChange: () => handleToggleRow(rowIdentity)
3560
3617
  }
@@ -4197,29 +4254,41 @@ var ToastItemComponent = ({ item, onRemove, closeAriaLabel }) => {
4197
4254
  closingRef.current = true;
4198
4255
  setVisible(false);
4199
4256
  }, []);
4200
- return /* @__PURE__ */ jsxs(
4201
- animated.div,
4202
- {
4203
- ref: rootRef,
4204
- className: "toast_item",
4205
- style,
4206
- role: item.variant === "error" ? "alert" : "status",
4207
- children: [
4208
- /* @__PURE__ */ jsx("span", { className: `toast_icon toast_icon_${item.variant}`, "aria-hidden": "true", children: VARIANT_ICONS[item.variant] }),
4209
- /* @__PURE__ */ jsx("span", { className: "toast_message", children: item.message }),
4210
- /* @__PURE__ */ jsx("button", { type: "button", className: "toast_close", onClick: close, "aria-label": closeAriaLabel, children: /* @__PURE__ */ jsx(X, { size: iconSize.xs }) }),
4211
- /* @__PURE__ */ jsx(
4212
- "div",
4213
- {
4214
- className: `toast_progress toast_progress_${item.variant}`,
4215
- style: { "--toast-duration": `${item.duration}ms` },
4216
- onAnimationEnd: close,
4217
- "aria-hidden": "true"
4218
- }
4219
- )
4220
- ]
4221
- }
4222
- );
4257
+ React20.useEffect(() => {
4258
+ if (item.dismissing) close();
4259
+ }, [item.dismissing, close]);
4260
+ const autoDismisses = Number.isFinite(item.duration);
4261
+ const liveRole = item.variant === "error" ? "alert" : "status";
4262
+ return /* @__PURE__ */ jsxs(animated.div, { ref: rootRef, className: "toast_item", style, children: [
4263
+ /* @__PURE__ */ jsxs("div", { className: "toast_live", role: liveRole, children: [
4264
+ /* @__PURE__ */ jsx("span", { className: `toast_icon toast_icon_${item.variant}`, "aria-hidden": "true", children: VARIANT_ICONS[item.variant] }),
4265
+ /* @__PURE__ */ jsx("span", { className: "toast_message", children: item.message })
4266
+ ] }, liveRole),
4267
+ item.action && /* @__PURE__ */ jsx(
4268
+ "button",
4269
+ {
4270
+ type: "button",
4271
+ className: "toast_action",
4272
+ onClick: () => {
4273
+ if (closingRef.current) return;
4274
+ item.action?.onClick();
4275
+ close();
4276
+ },
4277
+ children: item.action.label
4278
+ }
4279
+ ),
4280
+ /* @__PURE__ */ jsx("button", { type: "button", className: "toast_close", onClick: close, "aria-label": closeAriaLabel, children: /* @__PURE__ */ jsx(X, { size: iconSize.xs }) }),
4281
+ autoDismisses && /* @__PURE__ */ jsx(
4282
+ "div",
4283
+ {
4284
+ className: `toast_progress toast_progress_${item.variant}`,
4285
+ style: { "--toast-duration": `${item.duration}ms` },
4286
+ onAnimationEnd: close,
4287
+ "aria-hidden": "true"
4288
+ },
4289
+ item.duration
4290
+ )
4291
+ ] });
4223
4292
  };
4224
4293
  var toastSeq = 0;
4225
4294
  var ToastProvider = ({
@@ -4234,16 +4303,47 @@ var ToastProvider = ({
4234
4303
  const [toasts, setToasts] = React20.useState([]);
4235
4304
  const isMounted = useIsMounted();
4236
4305
  const addToast = React20.useCallback(
4237
- (message, variant, duration = 3e3) => {
4306
+ (message, variant, options = {}) => {
4307
+ const { duration = 3e3, action } = options;
4238
4308
  const id = `toast_${++toastSeq}`;
4239
- setToasts((prev) => [{ id, message, variant, duration }, ...prev].slice(0, maxCount));
4309
+ if (maxCount <= 0) return id;
4310
+ setToasts((prev) => {
4311
+ const next = [{ id, message, variant, duration, action }, ...prev];
4312
+ return next.map(
4313
+ (toast, index) => index >= maxCount && !toast.dismissing ? { ...toast, dismissing: true } : toast
4314
+ );
4315
+ });
4316
+ return id;
4240
4317
  },
4241
4318
  [maxCount]
4242
4319
  );
4320
+ const dismissToast = React20.useCallback((id) => {
4321
+ setToasts(
4322
+ (prev) => prev.map(
4323
+ (toast) => toast.id === id && !toast.dismissing ? { ...toast, dismissing: true } : toast
4324
+ )
4325
+ );
4326
+ }, []);
4327
+ const updateToast = React20.useCallback((id, patch) => {
4328
+ setToasts(
4329
+ (prev) => prev.map((toast) => {
4330
+ if (toast.id !== id || toast.dismissing) return toast;
4331
+ const { action, ...rest } = patch;
4332
+ return {
4333
+ ...toast,
4334
+ ...rest,
4335
+ action: action === null ? void 0 : action ?? toast.action
4336
+ };
4337
+ })
4338
+ );
4339
+ }, []);
4243
4340
  const removeToast = React20.useCallback((id) => {
4244
4341
  setToasts((prev) => prev.filter((t2) => t2.id !== id));
4245
4342
  }, []);
4246
- const contextValue = React20.useMemo(() => ({ addToast }), [addToast]);
4343
+ const contextValue = React20.useMemo(
4344
+ () => ({ addToast, dismissToast, updateToast }),
4345
+ [addToast, dismissToast, updateToast]
4346
+ );
4247
4347
  return /* @__PURE__ */ jsxs(ToastContext.Provider, { value: contextValue, children: [
4248
4348
  children,
4249
4349
  isMounted && createPortal(
@@ -4271,6 +4371,7 @@ var ToastProvider = ({
4271
4371
  )
4272
4372
  ] });
4273
4373
  };
4374
+ var toOptions = (durationOrOptions) => typeof durationOrOptions === "number" ? { duration: durationOrOptions } : durationOrOptions;
4274
4375
  var useToast = () => {
4275
4376
  const ctx = useContext(ToastContext);
4276
4377
  if (!ctx) {
@@ -4279,16 +4380,20 @@ var useToast = () => {
4279
4380
  );
4280
4381
  }
4281
4382
  return {
4282
- /** 성공 메시지를 표시한다 */
4283
- success: (message, duration) => ctx.addToast(message, "success", duration),
4383
+ /** 성공 메시지를 표시한다. 두 번째 인자는 ms 또는 `{ duration, action }` */
4384
+ success: (message, options) => ctx.addToast(message, "success", toOptions(options)),
4284
4385
  /** 오류 메시지를 표시한다 */
4285
- error: (message, duration) => ctx.addToast(message, "error", duration),
4386
+ error: (message, options) => ctx.addToast(message, "error", toOptions(options)),
4286
4387
  /** 경고 메시지를 표시한다 */
4287
- warning: (message, duration) => ctx.addToast(message, "warning", duration),
4388
+ warning: (message, options) => ctx.addToast(message, "warning", toOptions(options)),
4288
4389
  /** 정보 메시지를 표시한다 */
4289
- info: (message, duration) => ctx.addToast(message, "info", duration),
4390
+ info: (message, options) => ctx.addToast(message, "info", toOptions(options)),
4290
4391
  /** 기본 메시지를 표시한다 */
4291
- message: (message, duration) => ctx.addToast(message, "default", duration)
4392
+ message: (message, options) => ctx.addToast(message, "default", toOptions(options)),
4393
+ /** id 의 토스트를 닫는다 - 닫기 버튼과 같은 퇴출 모션 */
4394
+ dismiss: ctx.dismissToast,
4395
+ /** id 의 토스트 내용을 바꾼다 - "업로드 중…" 을 "완료" 로 */
4396
+ update: ctx.updateToast
4292
4397
  };
4293
4398
  };
4294
4399
  var TopLoading = ({
@@ -4383,6 +4488,9 @@ var Combobox = ({
4383
4488
  });
4384
4489
  const { isOpen, setIsOpen, close, activeIndex, setActiveIndex } = popup;
4385
4490
  closeRef.current = close;
4491
+ useEffect(() => {
4492
+ if (!isOpen) setQuery("");
4493
+ }, [isOpen]);
4386
4494
  const onSearchRef = useRef(onSearch);
4387
4495
  useEffect(() => {
4388
4496
  onSearchRef.current = onSearch;
@@ -4783,7 +4891,7 @@ var Dropdown = (props) => {
4783
4891
  children: visibleOptions.length === 0 ? searchable && /* @__PURE__ */ jsx("div", { className: "dropdown_empty", children: emptyText }) : visibleOptions.map((opt, i) => {
4784
4892
  const selected = selectedValues.includes(opt.value);
4785
4893
  const active = i === activeIndex;
4786
- return /* @__PURE__ */ jsxs(Fragment, { children: [
4894
+ return /* @__PURE__ */ jsxs(Fragment$1, { children: [
4787
4895
  /* @__PURE__ */ jsxs(
4788
4896
  "div",
4789
4897
  {
@@ -6344,6 +6452,7 @@ var Drawer = ({
6344
6452
  showCloseIcon = true,
6345
6453
  closeLabel: closeLabelProp,
6346
6454
  ariaLabel,
6455
+ initialFocusRef,
6347
6456
  onExited,
6348
6457
  children,
6349
6458
  className,
@@ -6363,7 +6472,10 @@ var Drawer = ({
6363
6472
  const [shouldRender, setShouldRender] = React20.useState(open);
6364
6473
  const reduced = useReducedMotion();
6365
6474
  const isMounted = useIsMounted();
6366
- useFocusTrap(panelRef, open && isMounted, { preferWithin: bodyRef });
6475
+ useFocusTrap(panelRef, open && isMounted, {
6476
+ preferWithin: bodyRef,
6477
+ initialFocus: initialFocusRef
6478
+ });
6367
6479
  useOverlayEscape(open && isMounted, () => {
6368
6480
  if (escapeDismissible) onClose?.();
6369
6481
  });
@@ -6460,6 +6572,7 @@ var Modal = ({
6460
6572
  children,
6461
6573
  className,
6462
6574
  ariaLabel,
6575
+ initialFocusRef,
6463
6576
  onExited,
6464
6577
  ...props
6465
6578
  }) => {
@@ -6476,7 +6589,10 @@ var Modal = ({
6476
6589
  const titleId = React20.useId();
6477
6590
  const [shouldRender, setShouldRender] = React20.useState(open);
6478
6591
  const isMounted = useIsMounted();
6479
- useFocusTrap(panelRef, open && isMounted, { preferWithin: bodyRef });
6592
+ useFocusTrap(panelRef, open && isMounted, {
6593
+ preferWithin: bodyRef,
6594
+ initialFocus: initialFocusRef
6595
+ });
6480
6596
  useOverlayEscape(open && isMounted, () => {
6481
6597
  if (escapeDismissible) onClose?.();
6482
6598
  });
@@ -6783,4 +6899,4 @@ var Stack = ({
6783
6899
  );
6784
6900
  };
6785
6901
 
6786
- export { Accordion, AlertProvider, AppShell, Avatar, Badge, BottomNav, BottomNavItem, BottomNavSpacer, Breadcrumb, Button, Card, Checkbox, Chip, Combobox, Container, DataView, DatePicker, DateRangePicker, DescriptionList, Divider, Drawer, Dropdown, EmptyState, ErrorState, Field, FileInput, Form, Grid, Hero, Icon, IconButton, ImageCropper, LinearProgress, ListItem, LocaleProvider, MediaCard, Menu, Modal, NavBar, NavLink, OtpInput, PageHeader, Pagination, Popover, Prose, Radio, RadioGroup, Section, Sidebar, SidebarItem, SidebarSection, Skeleton, Spinner, Stack, Stat, Tab, TabList, TabPanel, Table, Tabs, TagInput, TextField, Textarea, ThemeProvider, TimePicker, Timeline, ToastProvider, Toggle, Tooltip, TopLoading, a11y, baseBorderWidth, baseColors, baseTypography, borderWidth, breakpoints, catalogs, cn, colors, elevation, en, iconSize, ko, motion, opacity, radius, skeleton, spacing, typography, useAlert, useFieldControl, useFocusTrap, useListboxPopup, useLocaleName, useLocaleText, useRadioGroupContext, useReducedMotion, useSpringHover, useSpringPresence, useTheme, useToast, zIndex };
6902
+ export { Accordion, AlertProvider, AppShell, Avatar, Badge, BottomNav, BottomNavItem, BottomNavSpacer, Breadcrumb, Button, Card, Checkbox, Chip, Combobox, Container, DataView, DatePicker, DateRangePicker, DescriptionList, Divider, Drawer, Dropdown, EmptyState, ErrorState, Field, FileInput, Form, Grid, Hero, Icon, IconButton, ImageCropper, LinearProgress, ListItem, LocaleProvider, MediaCard, Menu, Modal, NavBar, NavLink, OtpInput, PageHeader, Pagination, Popover, Prose, Radio, RadioGroup, Section, Sidebar, SidebarItem, SidebarSection, Skeleton, Spinner, Stack, Stat, Stepper, Tab, TabList, TabPanel, Table, Tabs, TagInput, TextField, Textarea, ThemeProvider, TimePicker, Timeline, ToastProvider, Toggle, Tooltip, TopLoading, a11y, baseBorderWidth, baseColors, baseTypography, borderWidth, breakpoints, catalogs, cn, colors, elevation, en, iconSize, ko, motion, opacity, radius, skeleton, spacing, typography, useAlert, useFieldControl, useFocusTrap, useListboxPopup, useLocaleName, useLocaleText, useRadioGroupContext, useReducedMotion, useSpringHover, useSpringPresence, useTheme, useToast, zIndex };
@@ -5,31 +5,31 @@
5
5
  * @version 1.0.0
6
6
  * @license Bigtablet Inc. Open Source License - see LICENSE at the repo root
7
7
  * (https://github.com/Bigtablet/.github/blob/main/BIGTABLET_LICENSE.md)
8
- */((A,x)=>{typeof exports=="object"&&typeof module<"u"?module.exports=x():typeof define=="function"&&define.amd?define(x):(A=A||self,A.Bigtablet=x());})(void 0,()=>{function A(t="bt"){return `${t}_${Math.random().toString(36).substring(2,9)}`}function x(t){return String(t).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;")}function w(t,l,i,a){return t.addEventListener(l,i,a),()=>t.removeEventListener(l,i,a)}function L(t,l=document){return l.querySelector(t)}function _(t,l=document){return Array.from(l.querySelectorAll(t))}let R=["a[href]","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])",'[tabindex]:not([tabindex="-1"])'].join(", ");function Q(){let t=document.createElement("div");t.style.cssText="position:fixed;top:0;left:0;right:0;height:0;visibility:hidden;pointer-events:none",document.documentElement.appendChild(t);let l=t.getBoundingClientRect().width;return t.remove(),l<=0?0:Math.max(0,window.innerWidth-l)}let C=[];function z(t){if(t.key!=="Escape")return;let l=C[C.length-1];l&&(t.stopImmediatePropagation(),l());}function me(){}function J(t){C.length===0&&document.addEventListener("keydown",z),C.push(t);let l=false;return ()=>{if(l)return;l=true;let i=C.lastIndexOf(t);i!==-1&&C.splice(i,1),C.length===0&&document.removeEventListener("keydown",z);}}function Z(t,l){let i=l.dataset.btOriginalScrollbarWidthVar;i?t.style.setProperty("--bt-scrollbar-width",i):t.style.removeProperty("--bt-scrollbar-width");}function ee(){let t=document.body,l=document.documentElement,i=parseInt(t.dataset.btOpenModals||"0",10);if(i===0){let a=Q();if(t.dataset.btOriginalOverflow=t.style.overflow,t.dataset.btOriginalOverflowX=t.style.overflowX,t.dataset.btOriginalOverflowY=t.style.overflowY,t.dataset.btOriginalHtmlOverflow=l.style.overflow,t.dataset.btOriginalHtmlOverflowX=l.style.overflowX,t.dataset.btOriginalHtmlOverflowY=l.style.overflowY,t.dataset.btOriginalGutter=l.style.scrollbarGutter,t.dataset.btOriginalPaddingRight=t.style.paddingRight,t.dataset.btOriginalScrollbarWidthVar=l.style.getPropertyValue("--bt-scrollbar-width"),a>0&&l.style.setProperty("--bt-scrollbar-width",`${a}px`),t.style.overflow="hidden",l.style.overflow="hidden",a>0){l.style.scrollbarGutter="auto";let f=parseFloat(window.getComputedStyle(t).paddingRight)||0;t.style.paddingRight=`${f+a}px`,Q()>0&&(t.style.paddingRight=t.dataset.btOriginalPaddingRight||"",Z(l,t));}l.setAttribute("data-bt-scroll-locked","");}t.dataset.btOpenModals=String(i+1);}function W(){let t=document.body,l=document.documentElement,i=parseInt(t.dataset.btOpenModals||"1",10)-1;i<=0?(t.style.overflow=t.dataset.btOriginalOverflow||"",t.style.overflowX=t.dataset.btOriginalOverflowX||"",t.style.overflowY=t.dataset.btOriginalOverflowY||"",l.style.overflow=t.dataset.btOriginalHtmlOverflow||"",l.style.overflowX=t.dataset.btOriginalHtmlOverflowX||"",l.style.overflowY=t.dataset.btOriginalHtmlOverflowY||"",t.style.paddingRight=t.dataset.btOriginalPaddingRight||"",l.style.scrollbarGutter=t.dataset.btOriginalGutter||"",l.removeAttribute("data-bt-scroll-locked"),Z(l,t),delete t.dataset.btOpenModals,delete t.dataset.btOriginalOverflow,delete t.dataset.btOriginalOverflowX,delete t.dataset.btOriginalOverflowY,delete t.dataset.btOriginalHtmlOverflow,delete t.dataset.btOriginalHtmlOverflowX,delete t.dataset.btOriginalHtmlOverflowY,delete t.dataset.btOriginalGutter,delete t.dataset.btOriginalPaddingRight,delete t.dataset.btOriginalScrollbarWidthVar):t.dataset.btOpenModals=String(i);}function te(t){return String(t).toLowerCase().replace(/\s+/g,"")}function ne(t){if(t!==void 0)return t!=="false"}let ve='<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="11" cy="11" r="8"/><path d="m21 21-4.3-4.3"/></svg>',ye='<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M20 6 9 17l-5-5"/></svg>';function ie(t,l={}){let i=typeof t=="string"?L(t):t;if(!i)return null;let a={placeholder:"Select...",disabled:false,multiple:false,searchable:false,searchPlaceholder:"\uAC80\uC0C9\u2026",emptyText:"\uACB0\uACFC \uC5C6\uC74C",selectedSummary:e=>`${e}\uAC1C \uC120\uD0DD`,onValueChange:null,...l};if(l.multiple===void 0){let e=ne(i.dataset.multiple);e!==void 0&&(a.multiple=e);}if(l.searchable===void 0){let e=ne(i.dataset.searchable);e!==void 0&&(a.searchable=e);}if(l.searchPlaceholder===void 0&&i.dataset.searchPlaceholder&&(a.searchPlaceholder=i.dataset.searchPlaceholder),l.emptyText===void 0&&i.dataset.emptyText&&(a.emptyText=i.dataset.emptyText),l.placeholder===void 0&&i.dataset.placeholder)a.placeholder=i.dataset.placeholder;else if(l.placeholder===void 0){let e=i.querySelector(".bt-dropdown__placeholder")?.textContent.trim();e&&(a.placeholder=e);}let f=a.multiple===true,b=a.searchable===true,n={isOpen:false,value:null,values:[],activeIndex:-1,options:[],visible:[],committedQuery:""},v=false,y=i.id||A("dropdown"),r=i.querySelector(".bt-dropdown__control"),s=i.querySelector(".bt-dropdown__list");if(!r||!s)return console.warn("Dropdown: Missing required elements (.bt-dropdown__control, .bt-dropdown__list)"),null;let c=s.querySelector(".bt-dropdown__options");if(!c)if(b){let e=s,o=Array.from(e.classList).filter(m=>m.startsWith("bt-dropdown__list")),d=document.createElement("div");d.className=o.join(" "),e.classList.remove(...o),e.classList.add("bt-dropdown__options"),e.style.display="",e.parentNode.insertBefore(d,e),d.appendChild(e),c=e,s=d;}else c=s;(r.disabled||r.classList.contains("is-disabled"))&&(a.disabled=true),r.disabled=a.disabled,r.setAttribute("aria-disabled",a.disabled?"true":"false"),r.classList.toggle("is-disabled",a.disabled);let h=()=>_(".bt-dropdown__option",c).map(e=>({value:e.dataset.value!==void 0?e.dataset.value:e.textContent.trim(),label:e.textContent.trim(),disabled:e.classList.contains("is-disabled")})),g;if(i.dataset.options)try{let e=JSON.parse(i.dataset.options);Array.isArray(e)?g=e:console.warn("Dropdown: data-options is not a JSON array");}catch(e){console.warn("Dropdown: invalid JSON in data-options",e);}g===void 0&&(g=Array.isArray(a.options)?a.options:h()),n.options=g;let u=_(".bt-dropdown__option",c);if(u.length===0&&n.options.length>0){let e=c.tagName==="UL"||c.tagName==="OL"?"li":"div";n.options.forEach(o=>{let d=document.createElement(e);d.className="bt-dropdown__option",o.disabled&&d.classList.add("is-disabled"),d.dataset.value=o.value,d.textContent=o.label,c.appendChild(d);}),u=_(".bt-dropdown__option",c);}c.id=c.id||`${y}_listbox`,c.setAttribute("role","listbox"),f&&c.setAttribute("aria-multiselectable","true"),r.setAttribute("aria-haspopup","listbox"),r.setAttribute("aria-expanded","false"),r.setAttribute("aria-controls",c.id),b?r.removeAttribute("role"):r.setAttribute("role","combobox"),u.forEach((e,o)=>{if(e.id=e.id||`${y}_option_${o}`,e.setAttribute("role","option"),e.setAttribute("aria-selected","false"),n.options[o]?.disabled&&e.setAttribute("aria-disabled","true"),f&&!e.querySelector(".bt-dropdown__option-check")){let d=document.createElement("span");d.className="bt-dropdown__option-check",d.setAttribute("aria-hidden","true"),d.innerHTML=ye,e.insertBefore(d,e.firstChild);}});let p=null,O=null;if(b){let e=s.querySelector(".bt-dropdown__search");if(!e){e=document.createElement("div"),e.className="bt-dropdown__search";let o=document.createElement("span");o.className="bt-dropdown__search-icon",o.setAttribute("aria-hidden","true"),o.innerHTML=ve,e.appendChild(o),s.insertBefore(e,s.firstChild);}if(p=e.querySelector(".bt-dropdown__search-input"),p||(p=document.createElement("input"),p.type="text",p.className="bt-dropdown__search-input",p.autocomplete="off",e.appendChild(p)),p.placeholder=a.searchPlaceholder,p.setAttribute("aria-label",a.searchPlaceholder),p.setAttribute("role","combobox"),p.setAttribute("aria-autocomplete","list"),p.setAttribute("aria-expanded","false"),p.setAttribute("aria-controls",c.id),O=c.querySelector(".bt-dropdown__empty"),!O){let o=c.tagName==="UL"||c.tagName==="OL"?"li":"div";O=document.createElement(o),O.className="bt-dropdown__empty",c.appendChild(O);}O.textContent=a.emptyText,O.hidden=true;}let H=()=>b?p:r,E=_('input[type="hidden"]',i),M=a.name||i.dataset.name||E[0]?.name||null;if(E.length===0&&M){let e=document.createElement("input");e.type="hidden",e.name=M,i.appendChild(e),E.push(e);}function xe(){if(!M)return;let e=f?n.values.map(o=>o==null?"":String(o)):[n.value==null?"":String(n.value)];for(;E.length>e.length;)E.pop().remove();for(;E.length<e.length;){let o=document.createElement("input");o.type="hidden",o.name=M,i.appendChild(o),E.push(o);}E.forEach((o,d)=>{o.value=e[d];});}function U(e){return n.options.find(o=>String(o.value)===String(e))}function X(e){return e===void 0?false:f?n.values.some(o=>String(o)===String(e)):n.value!=null&&String(n.value)===String(e)}function Ae(){return n.values.map(U).filter(Boolean)}function Y(){let e=r.querySelector(".bt-dropdown__value, .bt-dropdown__placeholder");if(e){let o=a.placeholder,d=false;if(f)d=n.values.length>0,d&&(o=a.selectedSummary(n.values.length));else {let m=U(n.value);d=!!m,m&&(o=m.label);}e.textContent=o,e.classList.toggle("bt-dropdown__value",d),e.classList.toggle("bt-dropdown__placeholder",!d);}u.forEach((o,d)=>{let m=X(n.options[d]?.value);o.classList.toggle("is-selected",m),o.setAttribute("aria-selected",m?"true":"false");}),xe();}function T(e){f?(n.values=e==null?[]:Array.isArray(e)?e.slice():[e],Y(),a.onValueChange&&a.onValueChange(n.values.slice(),Ae())):(n.value=Array.isArray(e)?e[0]??null:e,Y(),a.onValueChange&&a.onValueChange(n.value,U(n.value)??null));}function Ee(e){let o=X(e.value)?n.values.filter(d=>String(d)!==String(e.value)):[...n.values,e.value];T(o);}function $(){let e=null,o=null;u.forEach((m,I)=>{let N=I===n.activeIndex;m.classList.toggle("is-active",N),N&&(e=m.id,o=m);}),o?.scrollIntoView?.({block:"nearest"});let d=H();d&&(e?d.setAttribute("aria-activedescendant",e):d.removeAttribute("aria-activedescendant"));}function se(){return n.visible.find(e=>!n.options[e]?.disabled)??-1}function q(){let e=b?te(n.committedQuery):"";n.visible=[],u.forEach((o,d)=>{let m=n.options[d]?.label??o.textContent,I=e===""||te(m).includes(e);o.hidden=!I,I&&n.visible.push(d);}),O&&(O.hidden=n.visible.length>0),n.isOpen?n.visible.includes(n.activeIndex)||(n.activeIndex=se()):n.activeIndex=-1,$();}let D=null,B=null;function re(){D||(D={parent:s.parentNode,next:s.nextSibling},document.body.appendChild(s));let e=r.getBoundingClientRect(),o=4,d=8,m=window.innerWidth-d*2;s.style.minWidth=`${Math.min(e.width,m)}px`,s.style.maxWidth=`${m}px`;let I=s.offsetWidth,N=window.innerHeight-d*2;s.style.maxHeight="";let be=s.offsetHeight,j=Math.min(be,N);be>N&&(s.style.maxHeight=`${N}px`);let ge=window.innerHeight-e.bottom-o-d,Ie=e.top-o-d,he=j>ge&&Ie>ge;s.classList.toggle("bt-dropdown__list--up",he),s.style.left=`${de(e.left,I,window.innerWidth,d)}px`;let Ne=he?e.top-o-j:e.bottom+o;s.style.top=`${de(Ne,j,window.innerHeight,d)}px`;}function de(e,o,d,m){return Math.max(m,Math.min(e,d-m-o))}function Ce(){if(B)return;let e=0,o=()=>{e||(e=requestAnimationFrame(()=>{e=0,n.isOpen&&re();}));};window.addEventListener("scroll",o,true),window.addEventListener("resize",o),B=()=>{e&&cancelAnimationFrame(e),window.removeEventListener("scroll",o,true),window.removeEventListener("resize",o),B=null;};}function ce(){B?.(),D&&(D.parent?.insertBefore(s,D.next),D=null,s.style.left="",s.style.top="",s.style.minWidth="",s.style.maxWidth="",s.style.maxHeight="");}function k(){if(a.disabled||r.disabled)return;n.isOpen=true,r.classList.add("is-open"),r.setAttribute("aria-expanded","true"),s.style.display="block",p&&p.setAttribute("aria-expanded","true"),re(),Ce(),n.activeIndex=n.options.findIndex(o=>X(o.value)&&!o.disabled),q(),p&&p.focus();let e=r.querySelector(".bt-dropdown__icon");e&&e.classList.add("is-open");}function P(){n.isOpen=false,r.classList.remove("is-open"),r.setAttribute("aria-expanded","false"),r.removeAttribute("aria-activedescendant"),s.style.display="none",ce(),p&&(p.value="",p.setAttribute("aria-expanded","false"),p.removeAttribute("aria-activedescendant")),n.committedQuery="",v=false,n.activeIndex=-1,q();let e=r.querySelector(".bt-dropdown__icon");e&&e.classList.remove("is-open");}function F(){let e=n.isOpen;P(),e&&b&&r.focus();}function ue(){n.isOpen?P():k();}function V(e){let o=n.visible.filter(m=>!n.options[m]?.disabled);if(o.length===0)return;let d=o.indexOf(n.activeIndex);n.activeIndex=d===-1?e===1?o[0]:o[o.length-1]:o[(d+e+o.length)%o.length],$();}function fe(e){let o=n.options[e];!o||o.disabled||(f?Ee(o):(T(o.value),F()));}function pe(){n.visible.includes(n.activeIndex)&&fe(n.activeIndex);}function ke(e){e.preventDefault(),ue();}function Se(e){if(!a.disabled)switch(e.key){case " ":case "Enter":e.preventDefault(),n.isOpen?pe():k();break;case "ArrowDown":e.preventDefault(),n.isOpen?V(1):k();break;case "ArrowUp":e.preventDefault(),n.isOpen?V(-1):k();break;case "Home":e.preventDefault(),k(),n.activeIndex=se(),$();break;case "End":e.preventDefault(),k();for(let o=n.visible.length-1;o>=0;o--)if(!n.options[n.visible[o]]?.disabled){n.activeIndex=n.visible[o],$();break}break;case "Escape":e.preventDefault(),P();break;case "Tab":P();break}}function Le(e){if(!(e.isComposing||e.keyCode===229))switch(e.key){case "ArrowDown":e.preventDefault(),V(1);break;case "ArrowUp":e.preventDefault(),V(-1);break;case "Enter":e.preventDefault(),pe();break;case "Escape":e.preventDefault(),F();break;case "Tab":F();break}}function Te(e){!i.contains(e.target)&&!s.contains(e.target)&&P();}function De(e){return o=>{o.preventDefault(),fe(e);}}function Pe(e){return ()=>{n.options[e]?.disabled||(n.activeIndex=e,$());}}let S=[w(r,"click",ke),w(r,"keydown",Se),w(document,"mousedown",Te)];u.forEach((e,o)=>{S.push(w(e,"click",De(o))),S.push(w(e,"mouseenter",Pe(o)));}),p&&(S.push(w(p,"compositionstart",()=>{v=true;})),S.push(w(p,"compositionend",e=>{v=false,n.committedQuery=e.target.value,q();})),S.push(w(p,"input",e=>{v||(n.committedQuery=e.target.value,q());})),S.push(w(p,"keydown",Le)));let G=E.map(e=>e.value).filter(e=>e!=="");if(s.style.display="none",q(),Y(),f){let e=Array.isArray(a.defaultValue)?a.defaultValue:a.defaultValue!=null?[a.defaultValue]:G;e.length>0&&T(e);}else a.defaultValue!=null?T(a.defaultValue):G[0]&&T(G[0]);return {getValue:()=>f?n.values.slice():n.value,setValue:T,open:k,close:P,toggle:ue,setDisabled:e=>{a.disabled=e,r.disabled=e,r.setAttribute("aria-disabled",e?"true":"false"),r.classList.toggle("is-disabled",e);},destroy:()=>{ce(),S.forEach(e=>{e();});}}}function ae(t,l={}){let i=typeof t=="string"?L(t):t;if(!i)return null;let a={closeOnOverlay:true,closeOnEscape:true,onOpen:null,onClose:null,...l},f={isOpen:false},b=i.querySelector(".bt-modal__panel"),n=null,v=false,y=null;if(b&&(b.setAttribute("role","dialog"),b.setAttribute("aria-modal","true"),!b.hasAttribute("aria-label")&&!b.hasAttribute("aria-labelledby"))){let u=b.querySelector(".bt-modal__header");u?(u.id=u.id||A("modal_title"),b.setAttribute("aria-labelledby",u.id)):b.setAttribute("aria-label","Dialog");}function r(){if(!f.isOpen){if(f.isOpen=true,i.classList.add("is-open"),ee(),y=J(a.closeOnEscape?s:me),n=document.activeElement,b){let u=b.querySelector(R);u?u.focus():(b.setAttribute("tabindex","-1"),v=true,b.focus());}a.onOpen&&a.onOpen();}}function s(){f.isOpen&&(f.isOpen=false,i.classList.remove("is-open"),y&&(y(),y=null),W(),v&&b&&(b.removeAttribute("tabindex"),v=false),n&&typeof n.focus=="function"&&n.focus(),n=null,a.onClose&&a.onClose());}function c(u){a.closeOnOverlay&&u.target===i&&s();}function h(u){if(f.isOpen&&u.key==="Tab"&&b){let p=_(R,b);if(p.length===0){u.preventDefault();return}let O=p[0],H=p[p.length-1];u.shiftKey&&document.activeElement===O?(u.preventDefault(),H.focus()):!u.shiftKey&&document.activeElement===H&&(u.preventDefault(),O.focus());}}let g=[w(i,"click",c),w(document,"keydown",h)];return _("[data-modal-close]",i).forEach(u=>{g.push(w(u,"click",s));}),{isOpen:()=>f.isOpen,open:r,close:s,toggle:()=>f.isOpen?s():r(),destroy:()=>{g.forEach(u=>{u();}),f.isOpen&&(f.isOpen=false,y&&(y(),y=null),W());}}}let we="bt-button--filled",_e="bt-button--outline";function Oe(t={}){let l={title:"",message:"",variant:"info",confirmText:"\uD655\uC778",cancelText:"\uCDE8\uC18C",showCancel:false,destructive:false,actionsAlign:"right",closeOnOverlay:true,onConfirm:null,onCancel:null,...t},i=document.createElement("div");i.className=`bt-alert__overlay bt-alert--${l.variant} is-open`,i.innerHTML=`
8
+ */((E,A)=>{typeof exports=="object"&&typeof module<"u"?module.exports=A():typeof define=="function"&&define.amd?define(A):(E=E||self,E.Bigtablet=A());})(void 0,()=>{function E(t="bt"){return `${t}_${Math.random().toString(36).substring(2,9)}`}function A(t){return String(t).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;")}function w(t,l,i,a){return t.addEventListener(l,i,a),()=>t.removeEventListener(l,i,a)}function L(t,l=document){return l.querySelector(t)}function _(t,l=document){return Array.from(l.querySelectorAll(t))}let R=["a[href]","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])",'[tabindex]:not([tabindex="-1"])'].join(", ");function j(){let t=document.createElement("div");t.style.cssText="position:fixed;top:0;left:0;right:0;height:0;visibility:hidden;pointer-events:none",document.documentElement.appendChild(t);let l=t.getBoundingClientRect().width;return t.remove(),l<=0?0:Math.max(0,window.innerWidth-l)}let C=[];function Q(t){if(t.key!=="Escape")return;let l=C[C.length-1];l&&(t.stopImmediatePropagation(),l());}function me(){}function z(t){C.length===0&&document.addEventListener("keydown",Q),C.push(t);let l=false;return ()=>{if(l)return;l=true;let i=C.lastIndexOf(t);i!==-1&&C.splice(i,1),C.length===0&&document.removeEventListener("keydown",Q);}}function J(t,l){let i=l.dataset.btOriginalScrollbarWidthVar;i?t.style.setProperty("--bt-scrollbar-width",i):t.style.removeProperty("--bt-scrollbar-width");}function Z(){let t=document.body,l=document.documentElement,i=parseInt(t.dataset.btOpenModals||"0",10);if(i===0){let a=j();if(t.dataset.btOriginalOverflow=t.style.overflow,t.dataset.btOriginalOverflowX=t.style.overflowX,t.dataset.btOriginalOverflowY=t.style.overflowY,t.dataset.btOriginalHtmlOverflow=l.style.overflow,t.dataset.btOriginalHtmlOverflowX=l.style.overflowX,t.dataset.btOriginalHtmlOverflowY=l.style.overflowY,t.dataset.btOriginalGutter=l.style.scrollbarGutter,t.dataset.btOriginalPaddingRight=t.style.paddingRight,t.dataset.btOriginalScrollbarWidthVar=l.style.getPropertyValue("--bt-scrollbar-width"),a>0&&l.style.setProperty("--bt-scrollbar-width",`${a}px`),t.style.overflow="hidden",l.style.overflow="hidden",a>0){l.style.scrollbarGutter="auto";let f=parseFloat(window.getComputedStyle(t).paddingRight)||0;t.style.paddingRight=`${f+a}px`,j()>0&&(t.style.paddingRight=t.dataset.btOriginalPaddingRight||"",J(l,t));}l.setAttribute("data-bt-scroll-locked","");}t.dataset.btOpenModals=String(i+1);}function ee(){let t=document.body,l=document.documentElement,i=parseInt(t.dataset.btOpenModals||"1",10)-1;i<=0?(t.style.overflow=t.dataset.btOriginalOverflow||"",t.style.overflowX=t.dataset.btOriginalOverflowX||"",t.style.overflowY=t.dataset.btOriginalOverflowY||"",l.style.overflow=t.dataset.btOriginalHtmlOverflow||"",l.style.overflowX=t.dataset.btOriginalHtmlOverflowX||"",l.style.overflowY=t.dataset.btOriginalHtmlOverflowY||"",t.style.paddingRight=t.dataset.btOriginalPaddingRight||"",l.style.scrollbarGutter=t.dataset.btOriginalGutter||"",l.removeAttribute("data-bt-scroll-locked"),J(l,t),delete t.dataset.btOpenModals,delete t.dataset.btOriginalOverflow,delete t.dataset.btOriginalOverflowX,delete t.dataset.btOriginalOverflowY,delete t.dataset.btOriginalHtmlOverflow,delete t.dataset.btOriginalHtmlOverflowX,delete t.dataset.btOriginalHtmlOverflowY,delete t.dataset.btOriginalGutter,delete t.dataset.btOriginalPaddingRight,delete t.dataset.btOriginalScrollbarWidthVar):t.dataset.btOpenModals=String(i);}function te(t){return String(t).toLowerCase().replace(/\s+/g,"")}function ne(t){if(t!==void 0)return t!=="false"}let ve='<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="11" cy="11" r="8"/><path d="m21 21-4.3-4.3"/></svg>',ye='<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M20 6 9 17l-5-5"/></svg>';function ie(t,l={}){let i=typeof t=="string"?L(t):t;if(!i)return null;let a={placeholder:"Select...",disabled:false,multiple:false,searchable:false,searchPlaceholder:"\uAC80\uC0C9\u2026",emptyText:"\uACB0\uACFC \uC5C6\uC74C",selectedSummary:e=>`${e}\uAC1C \uC120\uD0DD`,onValueChange:null,...l};if(l.multiple===void 0){let e=ne(i.dataset.multiple);e!==void 0&&(a.multiple=e);}if(l.searchable===void 0){let e=ne(i.dataset.searchable);e!==void 0&&(a.searchable=e);}if(l.searchPlaceholder===void 0&&i.dataset.searchPlaceholder&&(a.searchPlaceholder=i.dataset.searchPlaceholder),l.emptyText===void 0&&i.dataset.emptyText&&(a.emptyText=i.dataset.emptyText),l.placeholder===void 0&&i.dataset.placeholder)a.placeholder=i.dataset.placeholder;else if(l.placeholder===void 0){let e=i.querySelector(".bt-dropdown__placeholder")?.textContent.trim();e&&(a.placeholder=e);}let f=a.multiple===true,p=a.searchable===true,n={isOpen:false,value:null,values:[],activeIndex:-1,options:[],visible:[],committedQuery:""},v=false,y=i.id||E("dropdown"),r=i.querySelector(".bt-dropdown__control"),s=i.querySelector(".bt-dropdown__list");if(!r||!s)return console.warn("Dropdown: Missing required elements (.bt-dropdown__control, .bt-dropdown__list)"),null;let c=s.querySelector(".bt-dropdown__options");if(!c)if(p){let e=s,o=Array.from(e.classList).filter(m=>m.startsWith("bt-dropdown__list")),u=document.createElement("div");u.className=o.join(" "),e.classList.remove(...o),e.classList.add("bt-dropdown__options"),e.style.display="",e.parentNode.insertBefore(u,e),u.appendChild(e),c=e,s=u;}else c=s;(r.disabled||r.classList.contains("is-disabled"))&&(a.disabled=true),r.disabled=a.disabled,r.setAttribute("aria-disabled",a.disabled?"true":"false"),r.classList.toggle("is-disabled",a.disabled);let g=()=>_(".bt-dropdown__option",c).map(e=>({value:e.dataset.value!==void 0?e.dataset.value:e.textContent.trim(),label:e.textContent.trim(),disabled:e.classList.contains("is-disabled")})),b;if(i.dataset.options)try{let e=JSON.parse(i.dataset.options);Array.isArray(e)?b=e:console.warn("Dropdown: data-options is not a JSON array");}catch(e){console.warn("Dropdown: invalid JSON in data-options",e);}b===void 0&&(b=Array.isArray(a.options)?a.options:g()),n.options=b;let h=_(".bt-dropdown__option",c);if(h.length===0&&n.options.length>0){let e=c.tagName==="UL"||c.tagName==="OL"?"li":"div";n.options.forEach(o=>{let u=document.createElement(e);u.className="bt-dropdown__option",o.disabled&&u.classList.add("is-disabled"),u.dataset.value=o.value,u.textContent=o.label,c.appendChild(u);}),h=_(".bt-dropdown__option",c);}c.id=c.id||`${y}_listbox`,c.setAttribute("role","listbox"),f&&c.setAttribute("aria-multiselectable","true"),r.setAttribute("aria-haspopup","listbox"),r.setAttribute("aria-expanded","false"),r.setAttribute("aria-controls",c.id),p?r.removeAttribute("role"):r.setAttribute("role","combobox"),h.forEach((e,o)=>{if(e.id=e.id||`${y}_option_${o}`,e.setAttribute("role","option"),e.setAttribute("aria-selected","false"),n.options[o]?.disabled&&e.setAttribute("aria-disabled","true"),f&&!e.querySelector(".bt-dropdown__option-check")){let u=document.createElement("span");u.className="bt-dropdown__option-check",u.setAttribute("aria-hidden","true"),u.innerHTML=ye,e.insertBefore(u,e.firstChild);}});let d=null,O=null;if(p){let e=s.querySelector(".bt-dropdown__search");if(!e){e=document.createElement("div"),e.className="bt-dropdown__search";let o=document.createElement("span");o.className="bt-dropdown__search-icon",o.setAttribute("aria-hidden","true"),o.innerHTML=ve,e.appendChild(o),s.insertBefore(e,s.firstChild);}if(d=e.querySelector(".bt-dropdown__search-input"),d||(d=document.createElement("input"),d.type="text",d.className="bt-dropdown__search-input",d.autocomplete="off",e.appendChild(d)),d.placeholder=a.searchPlaceholder,d.setAttribute("aria-label",a.searchPlaceholder),d.setAttribute("role","combobox"),d.setAttribute("aria-autocomplete","list"),d.setAttribute("aria-expanded","false"),d.setAttribute("aria-controls",c.id),O=c.querySelector(".bt-dropdown__empty"),!O){let o=c.tagName==="UL"||c.tagName==="OL"?"li":"div";O=document.createElement(o),O.className="bt-dropdown__empty",c.appendChild(O);}O.textContent=a.emptyText,O.hidden=true;}let H=()=>p?d:r,x=_('input[type="hidden"]',i),M=a.name||i.dataset.name||x[0]?.name||null;if(x.length===0&&M){let e=document.createElement("input");e.type="hidden",e.name=M,i.appendChild(e),x.push(e);}function xe(){if(!M)return;let e=f?n.values.map(o=>o==null?"":String(o)):[n.value==null?"":String(n.value)];for(;x.length>e.length;)x.pop().remove();for(;x.length<e.length;){let o=document.createElement("input");o.type="hidden",o.name=M,i.appendChild(o),x.push(o);}x.forEach((o,u)=>{o.value=e[u];});}function K(e){return n.options.find(o=>String(o.value)===String(e))}function U(e){return e===void 0?false:f?n.values.some(o=>String(o)===String(e)):n.value!=null&&String(n.value)===String(e)}function Ae(){return n.values.map(K).filter(Boolean)}function X(){let e=r.querySelector(".bt-dropdown__value, .bt-dropdown__placeholder");if(e){let o=a.placeholder,u=false;if(f)u=n.values.length>0,u&&(o=a.selectedSummary(n.values.length));else {let m=K(n.value);u=!!m,m&&(o=m.label);}e.textContent=o,e.classList.toggle("bt-dropdown__value",u),e.classList.toggle("bt-dropdown__placeholder",!u);}h.forEach((o,u)=>{let m=U(n.options[u]?.value);o.classList.toggle("is-selected",m),o.setAttribute("aria-selected",m?"true":"false");}),xe();}function T(e){f?(n.values=e==null?[]:Array.isArray(e)?e.slice():[e],X(),a.onValueChange&&a.onValueChange(n.values.slice(),Ae())):(n.value=Array.isArray(e)?e[0]??null:e,X(),a.onValueChange&&a.onValueChange(n.value,K(n.value)??null));}function Ee(e){let o=U(e.value)?n.values.filter(u=>String(u)!==String(e.value)):[...n.values,e.value];T(o);}function $(){let e=null,o=null;h.forEach((m,I)=>{let N=I===n.activeIndex;m.classList.toggle("is-active",N),N&&(e=m.id,o=m);}),o?.scrollIntoView?.({block:"nearest"});let u=H();u&&(e?u.setAttribute("aria-activedescendant",e):u.removeAttribute("aria-activedescendant"));}function se(){return n.visible.find(e=>!n.options[e]?.disabled)??-1}function q(){let e=p?te(n.committedQuery):"";n.visible=[],h.forEach((o,u)=>{let m=n.options[u]?.label??o.textContent,I=e===""||te(m).includes(e);o.hidden=!I,I&&n.visible.push(u);}),O&&(O.hidden=n.visible.length>0),n.isOpen?n.visible.includes(n.activeIndex)||(n.activeIndex=se()):n.activeIndex=-1,$();}let D=null,B=null;function re(){D||(D={parent:s.parentNode,next:s.nextSibling},document.body.appendChild(s));let e=r.getBoundingClientRect(),o=4,u=8,m=window.innerWidth-u*2;s.style.minWidth=`${Math.min(e.width,m)}px`,s.style.maxWidth=`${m}px`;let I=s.offsetWidth,N=window.innerHeight-u*2;s.style.maxHeight="";let be=s.offsetHeight,G=Math.min(be,N);be>N&&(s.style.maxHeight=`${N}px`);let ge=window.innerHeight-e.bottom-o-u,Ie=e.top-o-u,he=G>ge&&Ie>ge;s.classList.toggle("bt-dropdown__list--up",he),s.style.left=`${de(e.left,I,window.innerWidth,u)}px`;let Ne=he?e.top-o-G:e.bottom+o;s.style.top=`${de(Ne,G,window.innerHeight,u)}px`;}function de(e,o,u,m){return Math.max(m,Math.min(e,u-m-o))}function Ce(){if(B)return;let e=0,o=()=>{e||(e=requestAnimationFrame(()=>{e=0,n.isOpen&&re();}));};window.addEventListener("scroll",o,true),window.addEventListener("resize",o),B=()=>{e&&cancelAnimationFrame(e),window.removeEventListener("scroll",o,true),window.removeEventListener("resize",o),B=null;};}function ce(){B?.(),D&&(D.parent?.insertBefore(s,D.next),D=null,s.style.left="",s.style.top="",s.style.minWidth="",s.style.maxWidth="",s.style.maxHeight="");}function k(){if(a.disabled||r.disabled)return;n.isOpen=true,r.classList.add("is-open"),r.setAttribute("aria-expanded","true"),s.style.display="block",d&&d.setAttribute("aria-expanded","true"),re(),Ce(),n.activeIndex=n.options.findIndex(o=>U(o.value)&&!o.disabled),q(),d&&d.focus();let e=r.querySelector(".bt-dropdown__icon");e&&e.classList.add("is-open");}function P(){n.isOpen=false,r.classList.remove("is-open"),r.setAttribute("aria-expanded","false"),r.removeAttribute("aria-activedescendant"),s.style.display="none",ce(),d&&(d.value="",d.setAttribute("aria-expanded","false"),d.removeAttribute("aria-activedescendant")),n.committedQuery="",v=false,n.activeIndex=-1,q();let e=r.querySelector(".bt-dropdown__icon");e&&e.classList.remove("is-open");}function Y(){let e=n.isOpen;P(),e&&p&&r.focus();}function ue(){n.isOpen?P():k();}function V(e){let o=n.visible.filter(m=>!n.options[m]?.disabled);if(o.length===0)return;let u=o.indexOf(n.activeIndex);n.activeIndex=u===-1?e===1?o[0]:o[o.length-1]:o[(u+e+o.length)%o.length],$();}function fe(e){let o=n.options[e];!o||o.disabled||(f?Ee(o):(T(o.value),Y()));}function pe(){n.visible.includes(n.activeIndex)&&fe(n.activeIndex);}function ke(e){e.preventDefault(),ue();}function Se(e){if(!a.disabled)switch(e.key){case " ":case "Enter":e.preventDefault(),n.isOpen?pe():k();break;case "ArrowDown":e.preventDefault(),n.isOpen?V(1):k();break;case "ArrowUp":e.preventDefault(),n.isOpen?V(-1):k();break;case "Home":e.preventDefault(),k(),n.activeIndex=se(),$();break;case "End":e.preventDefault(),k();for(let o=n.visible.length-1;o>=0;o--)if(!n.options[n.visible[o]]?.disabled){n.activeIndex=n.visible[o],$();break}break;case "Escape":e.preventDefault(),P();break;case "Tab":P();break}}function Le(e){if(!(e.isComposing||e.keyCode===229))switch(e.key){case "ArrowDown":e.preventDefault(),V(1);break;case "ArrowUp":e.preventDefault(),V(-1);break;case "Enter":e.preventDefault(),pe();break;case "Escape":e.preventDefault(),Y();break;case "Tab":Y();break}}function Te(e){!i.contains(e.target)&&!s.contains(e.target)&&P();}function De(e){return o=>{o.preventDefault(),fe(e);}}function Pe(e){return ()=>{n.options[e]?.disabled||(n.activeIndex=e,$());}}let S=[w(r,"click",ke),w(r,"keydown",Se),w(document,"mousedown",Te)];h.forEach((e,o)=>{S.push(w(e,"click",De(o))),S.push(w(e,"mouseenter",Pe(o)));}),d&&(S.push(w(d,"compositionstart",()=>{v=true;})),S.push(w(d,"compositionend",e=>{v=false,n.committedQuery=e.target.value,q();})),S.push(w(d,"input",e=>{v||(n.committedQuery=e.target.value,q());})),S.push(w(d,"keydown",Le)));let F=x.map(e=>e.value).filter(e=>e!=="");if(s.style.display="none",q(),X(),f){let e=Array.isArray(a.defaultValue)?a.defaultValue:a.defaultValue!=null?[a.defaultValue]:F;e.length>0&&T(e);}else a.defaultValue!=null?T(a.defaultValue):F[0]&&T(F[0]);return {getValue:()=>f?n.values.slice():n.value,setValue:T,open:k,close:P,toggle:ue,setDisabled:e=>{a.disabled=e,r.disabled=e,r.setAttribute("aria-disabled",e?"true":"false"),r.classList.toggle("is-disabled",e);},destroy:()=>{ce(),S.forEach(e=>{e();});}}}function ae(t,l={}){let i=typeof t=="string"?L(t):t;if(!i)return null;let a={closeOnOverlay:true,closeOnEscape:true,onOpen:null,onClose:null,...l},f={isOpen:false},p=i.querySelector(".bt-modal__panel"),n=null,v=false,y=null;if(p&&(p.setAttribute("role","dialog"),p.setAttribute("aria-modal","true"),!p.hasAttribute("aria-label")&&!p.hasAttribute("aria-labelledby"))){let d=p.querySelector(".bt-modal__header");d?(d.id=d.id||E("modal_title"),p.setAttribute("aria-labelledby",d.id)):p.setAttribute("aria-label","Dialog");}function r(){if(!f.isOpen){if(f.isOpen=true,i.classList.add("is-open"),Z(),y=z(a.closeOnEscape?c:me),n=document.activeElement,p){let d=p.querySelector(R);d?d.focus():(p.hasAttribute("tabindex")||(p.setAttribute("tabindex","-1"),v=true),p.focus());}a.onOpen&&a.onOpen();}}function s(){f.isOpen=false,i.classList.remove("is-open"),y&&(y(),y=null),ee(),v&&p&&(p.removeAttribute("tabindex"),v=false),n&&typeof n.focus=="function"&&n.focus(),n=null;}function c(){f.isOpen&&(s(),a.onClose&&a.onClose());}function g(d){a.closeOnOverlay&&d.target===i&&c();}function b(d){if(f.isOpen&&d.key==="Tab"&&p){let O=_(R,p);if(O.length===0){d.preventDefault();return}let H=O[0],x=O[O.length-1];d.shiftKey&&document.activeElement===H?(d.preventDefault(),x.focus()):!d.shiftKey&&document.activeElement===x&&(d.preventDefault(),H.focus());}}let h=[w(i,"click",g),w(document,"keydown",b)];return _("[data-modal-close]",i).forEach(d=>{h.push(w(d,"click",c));}),{isOpen:()=>f.isOpen,open:r,close:c,toggle:()=>f.isOpen?c():r(),destroy:()=>{h.forEach(d=>{d();}),f.isOpen&&s();}}}let we="bt-button--filled",_e="bt-button--outline";function Oe(t={}){let l={title:"",message:"",variant:"info",confirmText:"\uD655\uC778",cancelText:"\uCDE8\uC18C",showCancel:false,destructive:false,actionsAlign:"right",closeOnOverlay:true,onConfirm:null,onCancel:null,...t},i=document.createElement("div");i.className=`bt-alert__overlay bt-alert--${l.variant} is-open`,i.innerHTML=`
9
9
  <div class="bt-alert__modal">
10
- ${l.title?`<div class="bt-alert__title">${x(l.title)}</div>`:""}
11
- <div class="bt-alert__message">${x(l.message)}</div>
10
+ ${l.title?`<div class="bt-alert__title">${A(l.title)}</div>`:""}
11
+ <div class="bt-alert__message">${A(l.message)}</div>
12
12
  <div class="bt-alert__actions" style="justify-content: ${l.actionsAlign==="left"?"flex-start":l.actionsAlign==="center"?"center":"flex-end"}">
13
- ${l.showCancel?`<button class="bt-button bt-button--md ${_e}" data-alert-cancel>${x(l.cancelText)}</button>`:""}
14
- <button class="bt-button bt-button--md ${we}${l.destructive?" bt-button--danger":""}" data-alert-confirm>${x(l.confirmText)}</button>
13
+ ${l.showCancel?`<button class="bt-button bt-button--md ${_e}" data-alert-cancel>${A(l.cancelText)}</button>`:""}
14
+ <button class="bt-button bt-button--md ${we}${l.destructive?" bt-button--danger":""}" data-alert-confirm>${A(l.confirmText)}</button>
15
15
  </div>
16
16
  </div>
17
- `;let a=i.querySelector(".bt-alert__modal");if(a){a.setAttribute("role","alertdialog"),a.setAttribute("aria-modal","true");let h=i.querySelector(".bt-alert__title"),g=i.querySelector(".bt-alert__message");h&&(h.id=A("alert_title"),a.setAttribute("aria-labelledby",h.id)),g&&(g.id=A("alert_message"),a.setAttribute("aria-describedby",g.id));}let f=document.activeElement;document.body.appendChild(i),ee();let b=true,n=J(y);function v(){b&&(b=false,n(),document.removeEventListener("keydown",c),i.classList.remove("is-open"),f&&typeof f.focus=="function"&&f.focus(),setTimeout(()=>{i.remove(),W();},200));}function y(){b&&(l.onCancel&&l.onCancel(),v());}let r=i.querySelector("[data-alert-confirm]"),s=i.querySelector("[data-alert-cancel]");r&&r.addEventListener("click",()=>{l.onConfirm&&l.onConfirm(),v();}),s&&s.addEventListener("click",()=>{l.onCancel&&l.onCancel(),v();}),i.addEventListener("click",h=>{l.closeOnOverlay&&h.target===i&&y();});function c(h){if(h.key==="Tab"&&a){let g=_(R,a);if(g.length===0){h.preventDefault();return}let u=g[0],p=g[g.length-1];h.shiftKey&&document.activeElement===u?(h.preventDefault(),p.focus()):!h.shiftKey&&document.activeElement===p&&(h.preventDefault(),u.focus());}}return document.addEventListener("keydown",c),r&&r.focus(),{close:v}}function oe(t,l={}){let i=typeof t=="string"?L(t):t;if(!i)return null;let a={defaultChecked:false,disabled:false,onCheckedChange:null,...l},f={checked:a.defaultChecked||i.classList.contains("bt-toggle--on")};i.disabled&&(a.disabled=true),i.disabled=a.disabled,i.hasAttribute("role")||i.setAttribute("role","switch"),i.tagName==="BUTTON"&&!i.hasAttribute("type")&&i.setAttribute("type","button");let b=a.name||i.dataset.name||null,n=i.querySelector('input[type="hidden"]')||(b&&i.parentNode?Array.from(i.parentNode.children).find(s=>s.tagName==="INPUT"&&s.type==="hidden"&&s.name===b):null);!n&&b&&(n=document.createElement("input"),n.type="hidden",n.name=b,i.tagName==="BUTTON"&&i.parentNode?i.parentNode.insertBefore(n,i.nextSibling):i.appendChild(n));function v(s){f.checked=s,i.classList.toggle("bt-toggle--on",s),i.setAttribute("aria-checked",s?"true":"false"),n&&(n.value=s?"true":"false"),a.onCheckedChange&&a.onCheckedChange(s);}function y(){!a.disabled&&!i.disabled&&v(!f.checked);}let r=w(i,"click",y);if(n&&!f.checked){let s=String(n.value).trim().toLowerCase();(s==="true"||s==="1"||s==="on"||s==="y"||s==="yes")&&(f.checked=true);}return i.classList.toggle("bt-toggle--on",f.checked),i.setAttribute("aria-checked",f.checked?"true":"false"),n&&(n.value=f.checked?"true":"false"),{isChecked:()=>f.checked,setChecked:v,toggle:y,setDisabled:s=>{a.disabled=s,i.disabled=s;},destroy:()=>r()}}function le(t,l={}){let i=typeof t=="string"?L(t):t;if(!i)return null;let a={page:1,totalPages:1,sibling:2,onPageChange:null,...l};function f(r,s){let c=[];for(let h=r;h<=s;h++)c.push(h);return c}function b(r,s){if(s<=7)return f(1,s);let c=[],h=s,g=a.sibling;if(r<=g+2){for(let u of f(1,g+3))c.push(u);return c.push("ellipsis"),c.push(h),c}if(r>=h-g-1){c.push(1),c.push("ellipsis");for(let u of f(h-g-2,h))c.push(u);return c}c.push(1),c.push("ellipsis");for(let u of f(r-g,r+g))c.push(u);return c.push("ellipsis"),c.push(h),c}function n(){let r=b(a.page,a.totalPages),s=`
17
+ `;let a=i.querySelector(".bt-alert__modal");if(a){a.setAttribute("role","alertdialog"),a.setAttribute("aria-modal","true");let g=i.querySelector(".bt-alert__title"),b=i.querySelector(".bt-alert__message");g&&(g.id=E("alert_title"),a.setAttribute("aria-labelledby",g.id)),b&&(b.id=E("alert_message"),a.setAttribute("aria-describedby",b.id));}let f=document.activeElement;document.body.appendChild(i),Z();let p=true,n=z(y);function v(){p&&(p=false,n(),document.removeEventListener("keydown",c),i.classList.remove("is-open"),f&&typeof f.focus=="function"&&f.focus(),setTimeout(()=>{i.remove(),ee();},200));}function y(){p&&(l.onCancel&&l.onCancel(),v());}let r=i.querySelector("[data-alert-confirm]"),s=i.querySelector("[data-alert-cancel]");r&&r.addEventListener("click",()=>{l.onConfirm&&l.onConfirm(),v();}),s&&s.addEventListener("click",()=>{l.onCancel&&l.onCancel(),v();}),i.addEventListener("click",g=>{l.closeOnOverlay&&g.target===i&&y();});function c(g){if(g.key==="Tab"&&a){let b=_(R,a);if(b.length===0){g.preventDefault();return}let h=b[0],d=b[b.length-1];g.shiftKey&&document.activeElement===h?(g.preventDefault(),d.focus()):!g.shiftKey&&document.activeElement===d&&(g.preventDefault(),h.focus());}}return document.addEventListener("keydown",c),r&&r.focus(),{close:v}}function oe(t,l={}){let i=typeof t=="string"?L(t):t;if(!i)return null;let a={defaultChecked:false,disabled:false,onCheckedChange:null,...l},f={checked:a.defaultChecked||i.classList.contains("bt-toggle--on")};i.disabled&&(a.disabled=true),i.disabled=a.disabled,i.hasAttribute("role")||i.setAttribute("role","switch"),i.tagName==="BUTTON"&&!i.hasAttribute("type")&&i.setAttribute("type","button");let p=a.name||i.dataset.name||null,n=i.querySelector('input[type="hidden"]')||(p&&i.parentNode?Array.from(i.parentNode.children).find(s=>s.tagName==="INPUT"&&s.type==="hidden"&&s.name===p):null);!n&&p&&(n=document.createElement("input"),n.type="hidden",n.name=p,i.tagName==="BUTTON"&&i.parentNode?i.parentNode.insertBefore(n,i.nextSibling):i.appendChild(n));function v(s){f.checked=s,i.classList.toggle("bt-toggle--on",s),i.setAttribute("aria-checked",s?"true":"false"),n&&(n.value=s?"true":"false"),a.onCheckedChange&&a.onCheckedChange(s);}function y(){!a.disabled&&!i.disabled&&v(!f.checked);}let r=w(i,"click",y);if(n&&!f.checked){let s=String(n.value).trim().toLowerCase();(s==="true"||s==="1"||s==="on"||s==="y"||s==="yes")&&(f.checked=true);}return i.classList.toggle("bt-toggle--on",f.checked),i.setAttribute("aria-checked",f.checked?"true":"false"),n&&(n.value=f.checked?"true":"false"),{isChecked:()=>f.checked,setChecked:v,toggle:y,setDisabled:s=>{a.disabled=s,i.disabled=s;},destroy:()=>r()}}function le(t,l={}){let i=typeof t=="string"?L(t):t;if(!i)return null;let a={page:1,totalPages:1,sibling:2,onPageChange:null,...l};function f(r,s){let c=[];for(let g=r;g<=s;g++)c.push(g);return c}function p(r,s){if(s<=7)return f(1,s);let c=[],g=s,b=a.sibling;if(r<=b+2){for(let h of f(1,b+3))c.push(h);return c.push("ellipsis"),c.push(g),c}if(r>=g-b-1){c.push(1),c.push("ellipsis");for(let h of f(g-b-2,g))c.push(h);return c}c.push(1),c.push("ellipsis");for(let h of f(r-b,r+b))c.push(h);return c.push("ellipsis"),c.push(g),c}function n(){let r=p(a.page,a.totalPages),s=`
18
18
  <button class="bt-pagination__item" ${a.page<=1?"disabled":""} data-action="prev" aria-label="Previous page">
19
19
  \u2039
20
20
  </button>
21
21
  <div class="bt-pagination__pages">
22
- `;r.forEach((g,u)=>{if(g==="ellipsis")s+='<span class="bt-pagination__ellipsis" aria-hidden="true">\u2026</span>';else {let p=g===a.page;s+=`
22
+ `;r.forEach((b,h)=>{if(b==="ellipsis")s+='<span class="bt-pagination__ellipsis" aria-hidden="true">\u2026</span>';else {let d=b===a.page;s+=`
23
23
  <button
24
- class="bt-pagination__page${p?" bt-pagination__page--active":""}"
25
- data-page="${x(g)}"
26
- ${p?'aria-current="page"':""}
24
+ class="bt-pagination__page${d?" bt-pagination__page--active":""}"
25
+ data-page="${A(b)}"
26
+ ${d?'aria-current="page"':""}
27
27
  >
28
- ${x(g)}
28
+ ${A(b)}
29
29
  </button>
30
30
  `;}}),s+=`
31
31
  </div>
32
32
  <button class="bt-pagination__item" ${a.page>=a.totalPages?"disabled":""} data-action="next" aria-label="Next page">
33
33
  \u203A
34
34
  </button>
35
- `,i.innerHTML=s,_("[data-page]",i).forEach(g=>{g.addEventListener("click",()=>{let u=parseInt(g.dataset.page,10);v(u);});});let c=i.querySelector('[data-action="prev"]'),h=i.querySelector('[data-action="next"]');c&&c.addEventListener("click",()=>v(a.page-1)),h&&h.addEventListener("click",()=>v(a.page+1));}function v(r){r<1||r>a.totalPages||r===a.page||(a.page=r,n(),a.onPageChange&&a.onPageChange(r));}function y(r){a.totalPages=r,a.page>r&&(a.page=r),n();}return n(),{getPage:()=>a.page,setPage:v,setTotalPages:y,render:n}}function K(){_("[data-bt-dropdown]").forEach(t=>{t._btDropdown||(t._btDropdown=ie(t));}),_("[data-bt-modal]").forEach(t=>{t._btModal||(t._btModal=ae(t));}),_("[data-bt-modal-open]").forEach(t=>{if(t.dataset.btBound)return;let l=t.dataset.btModalOpen,i=L(`#${l}`);i?._btModal&&(t.dataset.btBound="true",t.addEventListener("click",()=>i._btModal.open()));}),_("[data-bt-toggle]").forEach(t=>{t._btToggle||(t._btToggle=oe(t));}),_("[data-bt-pagination]").forEach(t=>{if(!t._btPagination){let l=parseInt(t.dataset.page,10)||1,i=parseInt(t.dataset.totalPages,10)||1;t._btPagination=le(t,{page:l,totalPages:i});}});}return typeof document<"u"&&(document.readyState==="loading"?document.addEventListener("DOMContentLoaded",K):K()),{Dropdown:ie,Modal:ae,Alert:Oe,Toggle:oe,Pagination:le,init:K,generateId:A,$:L,$$:_,on:w,version:"1.0.0"}});})();
35
+ `,i.innerHTML=s,_("[data-page]",i).forEach(b=>{b.addEventListener("click",()=>{let h=parseInt(b.dataset.page,10);v(h);});});let c=i.querySelector('[data-action="prev"]'),g=i.querySelector('[data-action="next"]');c&&c.addEventListener("click",()=>v(a.page-1)),g&&g.addEventListener("click",()=>v(a.page+1));}function v(r){r<1||r>a.totalPages||r===a.page||(a.page=r,n(),a.onPageChange&&a.onPageChange(r));}function y(r){a.totalPages=r,a.page>r&&(a.page=r),n();}return n(),{getPage:()=>a.page,setPage:v,setTotalPages:y,render:n}}function W(){_("[data-bt-dropdown]").forEach(t=>{t._btDropdown||(t._btDropdown=ie(t));}),_("[data-bt-modal]").forEach(t=>{t._btModal||(t._btModal=ae(t));}),_("[data-bt-modal-open]").forEach(t=>{if(t.dataset.btBound)return;let l=t.dataset.btModalOpen,i=L(`#${l}`);i?._btModal&&(t.dataset.btBound="true",t.addEventListener("click",()=>i._btModal.open()));}),_("[data-bt-toggle]").forEach(t=>{t._btToggle||(t._btToggle=oe(t));}),_("[data-bt-pagination]").forEach(t=>{if(!t._btPagination){let l=parseInt(t.dataset.page,10)||1,i=parseInt(t.dataset.totalPages,10)||1;t._btPagination=le(t,{page:l,totalPages:i});}});}return typeof document<"u"&&(document.readyState==="loading"?document.addEventListener("DOMContentLoaded",W):W()),{Dropdown:ie,Modal:ae,Alert:Oe,Toggle:oe,Pagination:le,init:W,generateId:E,$:L,$$:_,on:w,version:"1.0.0"}});})();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bigtablet/design-system",
3
- "version": "3.23.0",
3
+ "version": "3.24.0",
4
4
  "description": "Bigtablet Design System UI Components",
5
5
  "type": "module",
6
6
  "types": "dist/index.d.ts",
@@ -130,8 +130,9 @@
130
130
  },
131
131
  {
132
132
  "path": "dist/vanilla/bigtablet.min.js",
133
+ "disablePlugins": ["@size-limit/esbuild"],
133
134
  "limit": "8 kB",
134
- "message": "Raised 7 kB -> 8 kB on 2026-09-10: baseline was 6.83 kB, leaving 0.17 kB (2.4%) under the old 7 kB limit. The current limit leaves 1.17 kB. Re-measure before raising again."
135
+ "message": "Raised 7 kB -> 8 kB on 2026-09-10: baseline was 6.83 kB, leaving 0.17 kB (2.4%) under the old 7 kB limit. Re-measured 2026-09-18 without esbuild: 6.54 kB raw brotli, leaving 1.46 kB. esbuild is disabled for this entry: the file is a pre-minified UMD script loaded via <script>, and bundling it as ESM (package.json type=module) only produced a commonjs-variable-in-esm warning - the raw file size is the number consumers actually download. Re-measure before raising again."
135
136
  },
136
137
  {
137
138
  "path": "dist/index.css",