motile-ui 1.2.1 → 1.3.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/README.md CHANGED
@@ -37,7 +37,7 @@
37
37
 
38
38
  ## ✨ 주요 기능
39
39
 
40
- - 🎨 **18개의 고품질 컴포넌트** - 웹뷰 애플리케이션을 위해 세심하게 제작
40
+ - 🎨 **20개의 고품질 컴포넌트** - 웹뷰 애플리케이션을 위해 세심하게 제작
41
41
  - 💪 **TypeScript 우선** - 포괄적인 타입 정의 완벽 지원
42
42
  - 🎭 **커스터마이징 가능** - CSS 변수로 쉬운 테마 설정
43
43
  - 📱 **모바일 최적화** - 터치 친화적 인터랙션과 반응형 디자인
@@ -176,6 +176,7 @@ color props > --motile-ui-btn > --motile-theme > #3b82f6 (기본값)
176
176
  - **Textarea** - 여러 줄 텍스트 입력 필드
177
177
  - **Checkbox** - 체크박스 입력
178
178
  - **Switch** - 토글 스위치
179
+ - **Select** - 드롭다운 선택 메뉴
179
180
  - **Badge** - 상태 표시 배지
180
181
  - **Toast** - 알림 메시지
181
182
  - **Skeleton** - 로딩 상태 플레이스홀더
@@ -185,6 +186,7 @@ color props > --motile-ui-btn > --motile-theme > #3b82f6 (기본값)
185
186
  - **Sheet** - 좌우에서 슬라이드되는 사이드 패널
186
187
  - **Popover** - 팝오버 메뉴
187
188
  - **Tooltip** - 툴팁
189
+ - **Tab** - 콘텐츠 전환 탭
188
190
  - **Accordion** - 접을 수 있는 패널
189
191
  - **Dock** - 독 스타일 네비게이션 바
190
192
  - **NumberFlow** - 숫자 애니메이션 컴포넌트
@@ -219,7 +221,7 @@ MIT © [Innopers](https://github.com/Innopers)
219
221
 
220
222
  ## ✨ Features
221
223
 
222
- - 🎨 **18 High-Quality Components** - Carefully crafted for webview applications
224
+ - 🎨 **20 High-Quality Components** - Carefully crafted for webview applications
223
225
  - 💪 **TypeScript First** - Full TypeScript support with comprehensive type definitions
224
226
  - 🎭 **Customizable** - Easy theming with CSS variables
225
227
  - 📱 **Mobile Optimized** - Touch-friendly interactions and responsive design
@@ -358,6 +360,7 @@ color props > --motile-ui-btn > --motile-theme > #3b82f6 (default)
358
360
  - **Textarea** - Multi-line text input field
359
361
  - **Checkbox** - Checkbox input
360
362
  - **Switch** - Toggle switch
363
+ - **Select** - Dropdown selection menu
361
364
  - **Badge** - Status badge indicator
362
365
  - **Toast** - Notification message
363
366
  - **Skeleton** - Loading state placeholder
@@ -367,6 +370,7 @@ color props > --motile-ui-btn > --motile-theme > #3b82f6 (default)
367
370
  - **Sheet** - Side panel that slides from left or right
368
371
  - **Popover** - Popover menu
369
372
  - **Tooltip** - Tooltip
373
+ - **Tab** - Content switching tabs
370
374
  - **Accordion** - Collapsible panel
371
375
  - **Dock** - Dock-style navigation bar
372
376
  - **NumberFlow** - Animated number transition component
@@ -0,0 +1 @@
1
+ .motile-select__trigger{position:relative;box-sizing:border-box;width:100%;min-height:48px;padding:12px 40px 12px 16px;display:flex;align-items:center;background-color:#fff;border:1px solid #d1d5db;border-radius:8px;font-size:16px;color:#1f2937;text-align:left;cursor:pointer;transition:border-color .2s ease}.motile-select__trigger[aria-expanded=true]{border-color:color-mix(in srgb,var( --motile-select-color, var(--motile-ui-select, var(--motile-theme, #3b82f6)) ) 60%,transparent);background-color:#e5e7eb80;-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px);filter:blur(1.5px);color:#1f293780}.motile-select__trigger:disabled,.motile-select__trigger[disabled]{background-color:#f9fafb;color:#9ca3af;border-color:#e5e7eb;cursor:not-allowed}.motile-select__icon{position:absolute;right:12px;top:50%;transform:translateY(-50%);pointer-events:none;transition:transform .2s}.motile-select__trigger[aria-expanded=true] .motile-select__icon{transform:translateY(-50%) rotate(180deg)}.motile-select__value{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.motile-select__content{position:absolute;top:calc(100% + 4px);left:0;width:100%;box-sizing:border-box;max-height:300px;overflow-y:auto;background-color:#fff;border:1px solid #e5e7eb;border-radius:8px;box-shadow:0 4px 6px -1px #0000001a,0 2px 4px -1px #0000000f;transform-origin:top center;visibility:hidden;opacity:0;transform:translateY(-12px) scaleY(.85);pointer-events:none;transition:opacity .45s cubic-bezier(.34,1.56,.64,1),transform .45s cubic-bezier(.34,1.56,.64,1),visibility 0s linear .45s}.motile-select__content--open{visibility:visible;opacity:1;transform:translateY(0) scaleY(1);pointer-events:auto;transition:opacity .45s cubic-bezier(.34,1.56,.64,1),transform .45s cubic-bezier(.34,1.56,.64,1),visibility 0s linear 0s}.motile-select__content::-webkit-scrollbar{width:8px}.motile-select__content::-webkit-scrollbar-track{background:transparent}.motile-select__content::-webkit-scrollbar-thumb{background-color:#d1d5db;border-radius:4px}.motile-select__content::-webkit-scrollbar-thumb:hover{background-color:#9ca3af}.motile-select__item{position:relative;box-sizing:border-box;min-height:44px;padding:12px 40px 12px 16px;display:flex;align-items:center;justify-content:space-between;gap:8px;font-size:16px;line-height:1.5;color:#1f2937;cursor:pointer;transition:background-color .15s;-webkit-tap-highlight-color:transparent}.motile-select__item:hover:not(.motile-select__item--disabled){background-color:#f9fafb}.motile-select__item--selected{font-weight:500}.motile-select__item--selected:not(.motile-select__item--disabled){background-color:color-mix(in srgb,var( --motile-select-color, var(--motile-ui-select, var(--motile-theme, #3b82f6)) ) 5%,transparent)}.motile-select__item--disabled{color:#d1d5db;cursor:not-allowed}.motile-select__check{position:absolute;right:12px;color:var( --motile-select-color, var(--motile-ui-select, var(--motile-theme, #3b82f6)) )}@media (prefers-color-scheme: dark){.motile-select__trigger:disabled,.motile-select__trigger[disabled]{background-color:#1f2937;color:#6b7280;border-color:#374151}.motile-select__content{background-color:#1f2937;border-color:#374151}.motile-select__item{color:#f9fafb}.motile-select__item:hover:not(.motile-select__item--disabled){background-color:#374151}.motile-select__item--selected:not(.motile-select__item--disabled){background-color:#3b82f626}.motile-select__item--disabled{color:#4b5563}}.motile-select__mobile-list{width:100%;box-sizing:border-box;padding-bottom:16px;padding-bottom:max(16px,env(safe-area-inset-bottom))}@media (prefers-reduced-motion: reduce){.motile-select__content,.motile-select__item{transition:none}}
@@ -0,0 +1,220 @@
1
+ import { default as React } from 'react';
2
+ /**
3
+ * Select Value Type
4
+ */
5
+ export type SelectValue = string | number;
6
+ /**
7
+ * 백드롭 인터랙션으로 닫기 옵션
8
+ * - boolean: ESC 키와 외부 클릭 모두 제어
9
+ * - object: 각각 독립적으로 제어
10
+ */
11
+ export type CloseOnBackdropOptions = boolean | {
12
+ /**
13
+ * ESC 키로 닫기 허용
14
+ * @default false (object 사용 시)
15
+ */
16
+ escapeKey?: boolean;
17
+ /**
18
+ * 외부 클릭으로 닫기 허용
19
+ * @default false (object 사용 시)
20
+ */
21
+ clickOutside?: boolean;
22
+ };
23
+ /**
24
+ * SelectRoot Props
25
+ */
26
+ export interface SelectRootProps {
27
+ /**
28
+ * 선택된 값 (Controlled)
29
+ * @remarks string | number를 지원합니다
30
+ */
31
+ value?: SelectValue;
32
+ /**
33
+ * 초기 선택 값 (Uncontrolled)
34
+ */
35
+ defaultValue?: SelectValue;
36
+ /**
37
+ * 값 변경 콜백
38
+ */
39
+ onValueChange?: (value: SelectValue) => void;
40
+ /**
41
+ * 열림/닫힘 상태 (Controlled)
42
+ * @remarks open prop을 제공하면 외부에서 열림 상태를 제어할 수 있습니다
43
+ */
44
+ open?: boolean;
45
+ /**
46
+ * 열림/닫힘 상태 변경 콜백
47
+ */
48
+ onOpenChange?: (open: boolean) => void;
49
+ /**
50
+ * 비활성화 여부
51
+ * @default false
52
+ */
53
+ disabled?: boolean;
54
+ /**
55
+ * z-index 값
56
+ * @default 40
57
+ *
58
+ * @example
59
+ * // 다른 오버레이보다 위에 표시
60
+ * <Select.Root zIndex={60}>
61
+ */
62
+ zIndex?: number;
63
+ /**
64
+ * 체크 아이콘 숨김 여부
65
+ * @default false
66
+ *
67
+ * @example
68
+ * // 커스텀 레이아웃 사용 시 체크 아이콘 숨기기
69
+ * <Select.Root hideCheckIcon>
70
+ */
71
+ hideCheckIcon?: boolean;
72
+ /**
73
+ * Select의 breakpoint (모바일/데스크톱 전환점)
74
+ * @default 768
75
+ *
76
+ * @example
77
+ * // 600px 이하: Drawer, 초과: Floating dropdown
78
+ * <Select.Root maxWidth="600px">
79
+ *
80
+ * // 1024px 이하: Drawer, 초과: Floating dropdown
81
+ * <Select.Root maxWidth={1024}>
82
+ *
83
+ * @remarks
84
+ * - maxWidth는 오직 mobile/desktop 전환 breakpoint로만 사용됩니다
85
+ * - viewport <= maxWidth: Drawer 사용 (전체 화면)
86
+ * - viewport > maxWidth: Floating dropdown 사용 (Trigger 너비와 동일)
87
+ * - Content 너비는 항상 Trigger 너비를 따라갑니다
88
+ * - 기본값: 768px breakpoint
89
+ */
90
+ maxWidth?: string | number;
91
+ /**
92
+ * 백드롭 인터랙션으로 닫기 제어
93
+ *
94
+ * - `true`: 외부 클릭과 ESC 키 모두 허용
95
+ * - `false`: 외부 클릭과 ESC 키 모두 비활성화
96
+ * - `{ escapeKey: true }`: ESC 키만 허용
97
+ * - `{ clickOutside: true }`: 외부 클릭만 허용
98
+ * - `{ escapeKey: true, clickOutside: true }`: 모두 허용 (명시적)
99
+ *
100
+ * @default true
101
+ *
102
+ * @example
103
+ * // 외부 클릭과 ESC 키 모두 허용
104
+ * <Select.Root closeOnBackdrop={true}>
105
+ *
106
+ * // ESC 키만 허용
107
+ * <Select.Root closeOnBackdrop={{ escapeKey: true }}>
108
+ *
109
+ * // 외부 클릭만 허용
110
+ * <Select.Root closeOnBackdrop={{ clickOutside: true }}>
111
+ *
112
+ * // 모두 비활성화
113
+ * <Select.Root closeOnBackdrop={false}>
114
+ */
115
+ closeOnBackdrop?: CloseOnBackdropOptions;
116
+ /**
117
+ * 커스텀 색상
118
+ * @example '#10b981'
119
+ *
120
+ * @remarks
121
+ * Trigger, Content, Item 전체에 적용되는 테마 색상을 설정합니다.
122
+ * CSS 변수 `--motile-select-color`로 적용됩니다.
123
+ */
124
+ color?: string;
125
+ /**
126
+ * 자식 컴포넌트
127
+ */
128
+ children: React.ReactNode;
129
+ }
130
+ /**
131
+ * SelectRoot - Context Provider
132
+ */
133
+ export declare const SelectRoot: React.FC<SelectRootProps>;
134
+ /**
135
+ * SelectTrigger Props
136
+ */
137
+ export interface SelectTriggerProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "children"> {
138
+ /**
139
+ * 자식 컴포넌트
140
+ */
141
+ children: React.ReactNode;
142
+ /**
143
+ * 자식 요소를 렌더링할지 여부 (Slot 패턴)
144
+ * @default false
145
+ */
146
+ asChild?: boolean;
147
+ }
148
+ /**
149
+ * SelectTrigger - 버튼
150
+ */
151
+ export declare const SelectTrigger: React.ForwardRefExoticComponent<SelectTriggerProps & React.RefAttributes<HTMLButtonElement>>;
152
+ /**
153
+ * SelectValue Props
154
+ */
155
+ export interface SelectValueProps {
156
+ /**
157
+ * 값이 없을 때 표시할 placeholder
158
+ */
159
+ placeholder?: string;
160
+ }
161
+ /**
162
+ * SelectValue - 선택된 값 표시
163
+ */
164
+ export declare const SelectValue: React.FC<SelectValueProps>;
165
+ /**
166
+ * SelectContent Props
167
+ */
168
+ export interface SelectContentProps extends React.HTMLAttributes<HTMLDivElement> {
169
+ /**
170
+ * 자식 컴포넌트 (SelectItem들)
171
+ */
172
+ children: React.ReactNode;
173
+ }
174
+ /**
175
+ * SelectContent - 드롭다운 컨테이너 (Portal)
176
+ * 모바일에서는 Drawer로, 데스크톱에서는 floating dropdown으로 렌더링
177
+ */
178
+ export declare const SelectContent: React.ForwardRefExoticComponent<SelectContentProps & React.RefAttributes<HTMLDivElement>>;
179
+ /**
180
+ * SelectItem Props
181
+ */
182
+ export interface SelectItemProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "children"> {
183
+ /**
184
+ * 옵션 값 (선택적)
185
+ * @remarks
186
+ * - value prop을 제공하면 SelectValue가 자동으로 label을 표시합니다
187
+ * - value prop이 없으면 onClick으로 완전히 제어할 수 있습니다
188
+ */
189
+ value?: SelectValue;
190
+ /**
191
+ * 선택 상태 (선택적)
192
+ * @remarks
193
+ * - selected prop을 제공하면 value 비교보다 우선합니다
194
+ * - 객체 데이터를 사용할 때 유용합니다
195
+ */
196
+ selected?: boolean;
197
+ /**
198
+ * 비활성화 여부
199
+ * @default false
200
+ */
201
+ disabled?: boolean;
202
+ /**
203
+ * 표시할 내용
204
+ */
205
+ children: React.ReactNode;
206
+ }
207
+ /**
208
+ * SelectItem - 개별 옵션
209
+ */
210
+ export declare const SelectItem: React.ForwardRefExoticComponent<SelectItemProps & React.RefAttributes<HTMLDivElement>>;
211
+ /**
212
+ * Select Namespace
213
+ */
214
+ export declare const Select: {
215
+ Root: React.FC<SelectRootProps>;
216
+ Trigger: React.ForwardRefExoticComponent<SelectTriggerProps & React.RefAttributes<HTMLButtonElement>>;
217
+ Value: React.FC<SelectValueProps>;
218
+ Content: React.ForwardRefExoticComponent<SelectContentProps & React.RefAttributes<HTMLDivElement>>;
219
+ Item: React.ForwardRefExoticComponent<SelectItemProps & React.RefAttributes<HTMLDivElement>>;
220
+ };
@@ -0,0 +1,323 @@
1
+ import { jsxs as L, jsx as n } from "react/jsx-runtime";
2
+ import M, { useEffect as j, useState as R, useRef as P, useId as ee, useCallback as $, createContext as te, useContext as oe } from "react";
3
+ import { Drawer as C } from "../Drawer/Drawer.js";
4
+ import { useClickOutside as se } from "../../hooks/useClickOutside.js";
5
+ import { useEscapeKey as ne } from "../../hooks/useEscapeKey.js";
6
+ import { useMediaQuery as le } from "../../hooks/useMediaQuery.js";
7
+ import { Slot as ie } from "../../utils/Slot.js";
8
+ import './Select.css';/* empty css */
9
+ const O = te(null), z = () => {
10
+ const e = oe(O);
11
+ if (!e)
12
+ throw new Error("Select components must be used within Select.Root");
13
+ return e;
14
+ }, Q = ({
15
+ value: e,
16
+ defaultValue: c,
17
+ onValueChange: l,
18
+ open: i,
19
+ onOpenChange: o,
20
+ disabled: a = !1,
21
+ zIndex: u = 40,
22
+ hideCheckIcon: g = !1,
23
+ maxWidth: r = 768,
24
+ closeOnBackdrop: s = !0,
25
+ color: S,
26
+ children: w
27
+ }) => {
28
+ const [d, _] = R(c), [y, p] = R(!1), f = P(null), v = P(null), m = e !== void 0, h = m ? e : d, E = i !== void 0, b = E ? i : y, K = P(b);
29
+ K.current = b;
30
+ const [D, T] = R(/* @__PURE__ */ new Map()), F = `select-content-${ee()}`, G = r ? `(max-width: ${typeof r == "number" ? `${r}px` : r})` : "(max-width: 768px)", k = le(G), J = typeof s == "boolean" ? s : s.clickOutside ?? !1, X = typeof s == "boolean" ? s : s.escapeKey ?? !1, x = $(
31
+ (t) => {
32
+ E || p(t), o == null || o(t);
33
+ },
34
+ [E, o]
35
+ ), Y = (t) => {
36
+ var I;
37
+ m || _(t), l == null || l(t), x(!1), (I = f.current) == null || I.focus();
38
+ }, Z = $(
39
+ (t, I) => {
40
+ T((N) => {
41
+ const H = new Map(N);
42
+ return H.set(t, I), H;
43
+ });
44
+ },
45
+ []
46
+ ), V = $((t) => {
47
+ T((I) => {
48
+ const N = new Map(I);
49
+ return N.delete(t), N;
50
+ });
51
+ }, []);
52
+ se({
53
+ refs: [v, f],
54
+ handler: () => {
55
+ b && J && x(!1);
56
+ },
57
+ enabled: b && !k
58
+ }), ne({
59
+ handler: () => {
60
+ var t;
61
+ b && X && (x(!1), (t = f.current) == null || t.focus());
62
+ },
63
+ enabled: b && !k
64
+ }), j(() => {
65
+ if (!b) return;
66
+ const t = () => {
67
+ x(!1);
68
+ };
69
+ return window.addEventListener("resize", t), () => window.removeEventListener("resize", t);
70
+ }, [b, x]), j(() => {
71
+ K.current && x(!1);
72
+ }, [k, x]);
73
+ const W = {
74
+ open: b,
75
+ setOpen: x,
76
+ value: h,
77
+ onValueChange: Y,
78
+ disabled: a,
79
+ triggerRef: f,
80
+ contentRef: v,
81
+ contentId: F,
82
+ itemLabels: D,
83
+ registerItem: Z,
84
+ unregisterItem: V,
85
+ zIndex: u,
86
+ hideCheckIcon: g,
87
+ isMobile: k,
88
+ maxWidth: r,
89
+ closeOnBackdrop: s,
90
+ color: S
91
+ };
92
+ return /* @__PURE__ */ n(O.Provider, { value: W, children: /* @__PURE__ */ n("div", { style: { position: "relative" }, children: w }) });
93
+ };
94
+ Q.displayName = "Select.Root";
95
+ const B = M.forwardRef(({ children: e, className: c, style: l, asChild: i = !1, ...o }, a) => {
96
+ const { open: u, setOpen: g, disabled: r, triggerRef: s, contentId: S, zIndex: w, color: d } = z(), _ = () => {
97
+ r || g(!u);
98
+ }, y = M.useCallback(
99
+ (h) => {
100
+ s.current = h, typeof a == "function" ? a(h) : a && (a.current = h);
101
+ },
102
+ [a, s]
103
+ ), p = ["motile-select__trigger", c].filter(Boolean).join(" "), f = {
104
+ zIndex: w,
105
+ ...l,
106
+ ...d && { "--motile-select-color": d }
107
+ }, v = {
108
+ ref: y,
109
+ type: "button",
110
+ role: "combobox",
111
+ "aria-controls": S,
112
+ "aria-expanded": u,
113
+ "aria-haspopup": "listbox",
114
+ disabled: r,
115
+ className: p,
116
+ style: f,
117
+ onClick: _,
118
+ ...o
119
+ }, m = /* @__PURE__ */ n(
120
+ "svg",
121
+ {
122
+ className: "motile-select__icon",
123
+ width: "20",
124
+ height: "20",
125
+ viewBox: "0 0 20 20",
126
+ fill: "none",
127
+ xmlns: "http://www.w3.org/2000/svg",
128
+ children: /* @__PURE__ */ n(
129
+ "path",
130
+ {
131
+ d: "M5 7.5L10 12.5L15 7.5",
132
+ stroke: "currentColor",
133
+ strokeWidth: "1.5",
134
+ strokeLinecap: "round",
135
+ strokeLinejoin: "round"
136
+ }
137
+ )
138
+ }
139
+ );
140
+ return i ? /* @__PURE__ */ n(ie, { ...v, children: e }) : /* @__PURE__ */ L("button", { ...v, children: [
141
+ e,
142
+ m
143
+ ] });
144
+ });
145
+ B.displayName = "Select.Trigger";
146
+ const U = ({
147
+ placeholder: e = "선택하세요"
148
+ }) => {
149
+ const { value: c, itemLabels: l } = z(), i = c ? l.get(c) : void 0;
150
+ return /* @__PURE__ */ n("span", { className: "motile-select__value", children: i || e });
151
+ };
152
+ U.displayName = "Select.Value";
153
+ const q = M.forwardRef(({ children: e, className: c, style: l, ...i }, o) => {
154
+ const {
155
+ open: a,
156
+ setOpen: u,
157
+ contentRef: g,
158
+ contentId: r,
159
+ zIndex: s,
160
+ isMobile: S,
161
+ closeOnBackdrop: w,
162
+ color: d
163
+ } = z(), [_, y] = R(!1);
164
+ j(() => {
165
+ y(!0);
166
+ }, []);
167
+ const p = M.useCallback(
168
+ (m) => {
169
+ g.current = m, typeof o == "function" ? o(m) : o && (o.current = m);
170
+ },
171
+ [o, g]
172
+ );
173
+ if (!_)
174
+ return null;
175
+ if (S)
176
+ return /* @__PURE__ */ L(
177
+ C.Root,
178
+ {
179
+ open: a,
180
+ onOpenChange: u,
181
+ closeOnBackdrop: w,
182
+ closeOnDrag: !0,
183
+ maxHeight: "70dvh",
184
+ zIndex: 9999,
185
+ children: [
186
+ /* @__PURE__ */ L(C.Portal, { children: [
187
+ /* @__PURE__ */ n(C.Overlay, {}),
188
+ /* @__PURE__ */ L(C.Content, { children: [
189
+ /* @__PURE__ */ n(C.Handle, {}),
190
+ /* @__PURE__ */ n(
191
+ C.Body,
192
+ {
193
+ style: { padding: 0 },
194
+ children: /* @__PURE__ */ n(
195
+ "div",
196
+ {
197
+ id: r,
198
+ role: "listbox",
199
+ className: `motile-select__mobile-list ${c || ""}`,
200
+ ...i,
201
+ children: e
202
+ }
203
+ )
204
+ }
205
+ )
206
+ ] })
207
+ ] }),
208
+ /* @__PURE__ */ n("div", { style: { display: "none" }, "aria-hidden": "true", children: e })
209
+ ]
210
+ }
211
+ );
212
+ const f = [
213
+ "motile-select__content",
214
+ a && "motile-select__content--open",
215
+ c
216
+ ].filter(Boolean).join(" "), v = {
217
+ zIndex: s,
218
+ ...l,
219
+ ...d && { "--motile-select-color": d }
220
+ };
221
+ return /* @__PURE__ */ n(
222
+ "div",
223
+ {
224
+ ref: p,
225
+ id: r,
226
+ role: "listbox",
227
+ className: f,
228
+ style: v,
229
+ tabIndex: -1,
230
+ ...i,
231
+ children: e
232
+ }
233
+ );
234
+ });
235
+ q.displayName = "Select.Content";
236
+ const A = M.forwardRef(
237
+ ({
238
+ value: e,
239
+ selected: c,
240
+ disabled: l = !1,
241
+ children: i,
242
+ className: o,
243
+ style: a,
244
+ onClick: u,
245
+ ...g
246
+ }, r) => {
247
+ const {
248
+ value: s,
249
+ onValueChange: S,
250
+ setOpen: w,
251
+ registerItem: d,
252
+ hideCheckIcon: _,
253
+ color: y
254
+ } = z(), p = c !== void 0 ? c : e !== void 0 && s === e;
255
+ j(() => {
256
+ e !== void 0 && d(e, i);
257
+ }, [e, i, d]);
258
+ const f = (h) => {
259
+ l || (u == null || u(h), !h.defaultPrevented && (e !== void 0 ? S(e) : w(!1)));
260
+ }, v = [
261
+ "motile-select__item",
262
+ p && "motile-select__item--selected",
263
+ l && "motile-select__item--disabled",
264
+ o
265
+ ].filter(Boolean).join(" "), m = {
266
+ ...a,
267
+ ...y && { "--motile-select-color": y }
268
+ };
269
+ return /* @__PURE__ */ L(
270
+ "div",
271
+ {
272
+ ref: r,
273
+ role: "option",
274
+ "aria-selected": p,
275
+ "aria-disabled": l,
276
+ className: v,
277
+ style: m,
278
+ onClick: f,
279
+ ...g,
280
+ children: [
281
+ i,
282
+ p && !_ && /* @__PURE__ */ n(
283
+ "svg",
284
+ {
285
+ className: "motile-select__check",
286
+ width: "16",
287
+ height: "16",
288
+ viewBox: "0 0 16 16",
289
+ fill: "none",
290
+ xmlns: "http://www.w3.org/2000/svg",
291
+ children: /* @__PURE__ */ n(
292
+ "path",
293
+ {
294
+ d: "M13.3334 4L6.00008 11.3333L2.66675 8",
295
+ stroke: "currentColor",
296
+ strokeWidth: "2",
297
+ strokeLinecap: "round",
298
+ strokeLinejoin: "round"
299
+ }
300
+ )
301
+ }
302
+ )
303
+ ]
304
+ }
305
+ );
306
+ }
307
+ );
308
+ A.displayName = "Select.Item";
309
+ const be = {
310
+ Root: Q,
311
+ Trigger: B,
312
+ Value: U,
313
+ Content: q,
314
+ Item: A
315
+ };
316
+ export {
317
+ be as Select,
318
+ q as SelectContent,
319
+ A as SelectItem,
320
+ Q as SelectRoot,
321
+ B as SelectTrigger,
322
+ U as SelectValue
323
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ export type { SelectContentProps, SelectItemProps, SelectRootProps, SelectTriggerProps, SelectValueProps, } from './Select';
2
+ export { Select } from './Select';