motile-ui 1.1.2 → 1.2.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 +6 -2
- package/dist/components/Accordion/index.d.ts +1 -1
- package/dist/components/Badge/Badge.css +1 -1
- package/dist/components/Badge/index.d.ts +1 -1
- package/dist/components/Button/index.d.ts +1 -1
- package/dist/components/Checkbox/index.d.ts +1 -1
- package/dist/components/Dock/index.d.ts +2 -2
- package/dist/components/Drawer/Drawer.js +6 -6
- package/dist/components/Drawer/index.d.ts +1 -1
- package/dist/components/Input/index.d.ts +1 -1
- package/dist/components/Modal/Modal.d.ts +1 -1
- package/dist/components/Modal/Modal.js +8 -8
- package/dist/components/Modal/index.d.ts +1 -1
- package/dist/components/NumberFlow/NumberFlow.css +1 -0
- package/dist/components/NumberFlow/NumberFlow.d.ts +31 -0
- package/dist/components/NumberFlow/NumberFlow.js +128 -0
- package/dist/components/NumberFlow/NumberFlow.test.d.ts +1 -0
- package/dist/components/NumberFlow/index.d.ts +2 -0
- package/dist/components/Popover/Popover.d.ts +1 -1
- package/dist/components/Popover/Popover.js +8 -8
- package/dist/components/Popover/index.d.ts +1 -1
- package/dist/components/Sheet/Sheet.d.ts +8 -2
- package/dist/components/Sheet/Sheet.js +119 -122
- package/dist/components/Sheet/index.d.ts +1 -1
- package/dist/components/Skeleton/index.d.ts +1 -1
- package/dist/components/SpeedDial/SpeedDial.js +1 -1
- package/dist/components/SpeedDial/index.d.ts +2 -2
- package/dist/components/Switch/index.d.ts +1 -1
- package/dist/components/Textarea/index.d.ts +1 -1
- package/dist/components/TimePicker/TimePicker.css +1 -0
- package/dist/components/TimePicker/TimePicker.d.ts +33 -0
- package/dist/components/TimePicker/TimePicker.js +281 -0
- package/dist/components/TimePicker/TimePicker.test.d.ts +1 -0
- package/dist/components/TimePicker/index.d.ts +2 -0
- package/dist/components/Toast/index.d.ts +2 -2
- package/dist/components/Tooltip/Tooltip.d.ts +1 -1
- package/dist/components/Tooltip/Tooltip.js +4 -4
- package/dist/components/Tooltip/index.d.ts +1 -1
- package/dist/hooks/index.d.ts +3 -3
- package/dist/hooks/index.js +6 -6
- package/dist/hooks/useHistoryClose.d.ts +7 -1
- package/dist/hooks/useHistoryClose.js +30 -29
- package/dist/index.d.ts +31 -27
- package/dist/index.js +34 -30
- package/dist/test/utils.d.ts +1 -1
- package/dist/utils/Slot.js +7 -7
- package/package.json +21 -1
|
@@ -1,155 +1,156 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useCallback as
|
|
1
|
+
import { jsx as d, jsxs as $ } from "react/jsx-runtime";
|
|
2
|
+
import { useCallback as k, useState as S, useEffect as b, useId as A, useRef as g, useMemo as F, createContext as N, useContext as T } from "react";
|
|
3
3
|
import { createPortal as w } from "react-dom";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import { useHistoryClose as q } from "../../hooks/useHistoryClose.js";
|
|
4
|
+
import { useEscapeKey as K } from "../../hooks/useEscapeKey.js";
|
|
5
|
+
import { useHistoryClose as H } from "../../hooks/useHistoryClose.js";
|
|
6
|
+
import { useScrollLock as P } from "../../hooks/useScrollLock.js";
|
|
7
|
+
import { Slot as O } from "../../utils/Slot.js";
|
|
9
8
|
import './Sheet.css';/* empty css */
|
|
10
9
|
const I = N(null);
|
|
11
|
-
function
|
|
10
|
+
function v() {
|
|
12
11
|
const e = T(I);
|
|
13
12
|
if (!e)
|
|
14
13
|
throw new Error("Sheet components must be used within Sheet.Root");
|
|
15
14
|
return e;
|
|
16
15
|
}
|
|
17
|
-
function
|
|
16
|
+
function V({
|
|
18
17
|
value: e,
|
|
19
18
|
defaultValue: n = !1,
|
|
20
19
|
onChange: o
|
|
21
20
|
}) {
|
|
22
|
-
const t = e !== void 0, [i,
|
|
23
|
-
(
|
|
24
|
-
const f = typeof
|
|
25
|
-
t ||
|
|
21
|
+
const t = e !== void 0, [i, l] = S(n), s = t ? e : i, r = k(
|
|
22
|
+
(a) => {
|
|
23
|
+
const f = typeof a == "function" ? a(s) : a;
|
|
24
|
+
t || l(f), o == null || o(f);
|
|
26
25
|
},
|
|
27
26
|
[t, o, s]
|
|
28
27
|
);
|
|
29
|
-
return [s,
|
|
28
|
+
return [s, r];
|
|
30
29
|
}
|
|
31
|
-
function
|
|
30
|
+
function q({
|
|
32
31
|
children: e,
|
|
33
32
|
position: n = "right",
|
|
34
33
|
closeOnBackdrop: o = !0,
|
|
35
34
|
maxWidth: t = "600px",
|
|
36
35
|
zIndex: i = 1e3,
|
|
37
|
-
open:
|
|
36
|
+
open: l,
|
|
38
37
|
defaultOpen: s = !1,
|
|
39
|
-
onOpenChange:
|
|
38
|
+
onOpenChange: r,
|
|
39
|
+
enableHistoryClose: a = !0
|
|
40
40
|
}) {
|
|
41
|
-
const
|
|
42
|
-
value:
|
|
41
|
+
const f = A().replace(/:/g, ""), h = g(null), m = g(null), [c, p] = V({
|
|
42
|
+
value: l,
|
|
43
43
|
defaultValue: s,
|
|
44
|
-
onChange:
|
|
45
|
-
}), { isClosingFromHistory:
|
|
46
|
-
isOpen:
|
|
47
|
-
onClose: () =>
|
|
48
|
-
|
|
44
|
+
onChange: r
|
|
45
|
+
}), { isClosingFromHistory: y, navigateAndClose: u } = H({
|
|
46
|
+
isOpen: c,
|
|
47
|
+
onClose: () => p(!1),
|
|
48
|
+
enabled: a
|
|
49
|
+
}), _ = F(
|
|
49
50
|
() => ({
|
|
50
|
-
open:
|
|
51
|
-
setOpen:
|
|
51
|
+
open: c,
|
|
52
|
+
setOpen: p,
|
|
52
53
|
position: n,
|
|
53
54
|
closeOnBackdrop: o,
|
|
54
55
|
maxWidth: t,
|
|
55
56
|
zIndex: i,
|
|
56
|
-
onOpenChange:
|
|
57
|
-
triggerId: `${
|
|
58
|
-
contentId: `${
|
|
59
|
-
overlayRef:
|
|
60
|
-
sheetRef:
|
|
61
|
-
isClosingFromHistory:
|
|
62
|
-
navigateAndClose:
|
|
57
|
+
onOpenChange: r,
|
|
58
|
+
triggerId: `${f}-trigger`,
|
|
59
|
+
contentId: `${f}-content`,
|
|
60
|
+
overlayRef: h,
|
|
61
|
+
sheetRef: m,
|
|
62
|
+
isClosingFromHistory: y,
|
|
63
|
+
navigateAndClose: u
|
|
63
64
|
}),
|
|
64
65
|
[
|
|
65
|
-
d,
|
|
66
66
|
c,
|
|
67
|
+
p,
|
|
67
68
|
n,
|
|
68
69
|
o,
|
|
69
70
|
t,
|
|
70
71
|
i,
|
|
71
|
-
l,
|
|
72
72
|
r,
|
|
73
73
|
f,
|
|
74
74
|
h,
|
|
75
|
-
|
|
76
|
-
y
|
|
75
|
+
m,
|
|
76
|
+
y,
|
|
77
|
+
u
|
|
77
78
|
]
|
|
78
79
|
);
|
|
79
|
-
return /* @__PURE__ */
|
|
80
|
+
return /* @__PURE__ */ d(I.Provider, { value: _, children: e });
|
|
80
81
|
}
|
|
81
|
-
function
|
|
82
|
-
const { open: o, setOpen: t, triggerId: i, contentId:
|
|
83
|
-
t((
|
|
82
|
+
function z({ children: e, asChild: n = !1 }) {
|
|
83
|
+
const { open: o, setOpen: t, triggerId: i, contentId: l } = v(), s = k(() => {
|
|
84
|
+
t((r) => !r);
|
|
84
85
|
}, [t]);
|
|
85
|
-
return n ? /* @__PURE__ */
|
|
86
|
-
|
|
86
|
+
return n ? /* @__PURE__ */ d(
|
|
87
|
+
O,
|
|
87
88
|
{
|
|
88
89
|
id: i,
|
|
89
90
|
"aria-expanded": o,
|
|
90
|
-
"aria-controls":
|
|
91
|
+
"aria-controls": l,
|
|
91
92
|
onClick: s,
|
|
92
93
|
children: e
|
|
93
94
|
}
|
|
94
|
-
) : /* @__PURE__ */
|
|
95
|
+
) : /* @__PURE__ */ d(
|
|
95
96
|
"button",
|
|
96
97
|
{
|
|
97
98
|
id: i,
|
|
98
99
|
type: "button",
|
|
99
100
|
"aria-expanded": o,
|
|
100
|
-
"aria-controls":
|
|
101
|
+
"aria-controls": l,
|
|
101
102
|
onClick: s,
|
|
102
103
|
children: e
|
|
103
104
|
}
|
|
104
105
|
);
|
|
105
106
|
}
|
|
106
|
-
function
|
|
107
|
-
const { open: o } =
|
|
108
|
-
return
|
|
107
|
+
function B({ children: e, container: n }) {
|
|
108
|
+
const { open: o } = v(), [t, i] = S(!1);
|
|
109
|
+
return b(() => {
|
|
109
110
|
i(!0);
|
|
110
111
|
}, []), !t || !o ? null : w(e, n || document.body);
|
|
111
112
|
}
|
|
112
|
-
function
|
|
113
|
-
const { open: o, setOpen: t, position: i, closeOnBackdrop:
|
|
114
|
-
escapeKey:
|
|
115
|
-
clickOutside:
|
|
113
|
+
function j({ className: e = "", style: n }) {
|
|
114
|
+
const { open: o, setOpen: t, position: i, closeOnBackdrop: l, zIndex: s, overlayRef: r } = v(), [a, f] = S(!1), [h, m] = S(!1), c = typeof l == "boolean" ? { clickOutside: l } : {
|
|
115
|
+
escapeKey: l.escapeKey ?? !1,
|
|
116
|
+
clickOutside: l.clickOutside ?? !1
|
|
116
117
|
};
|
|
117
|
-
|
|
118
|
+
b(() => {
|
|
118
119
|
if (o)
|
|
119
120
|
f(!0);
|
|
120
|
-
else if (
|
|
121
|
-
|
|
122
|
-
const
|
|
121
|
+
else if (a) {
|
|
122
|
+
m(!1);
|
|
123
|
+
const u = setTimeout(() => {
|
|
123
124
|
f(!1);
|
|
124
125
|
}, 300);
|
|
125
|
-
return () => clearTimeout(
|
|
126
|
+
return () => clearTimeout(u);
|
|
126
127
|
}
|
|
127
|
-
}, [o,
|
|
128
|
-
if (!
|
|
129
|
-
const
|
|
128
|
+
}, [o, a]), b(() => {
|
|
129
|
+
if (!a || !o) return;
|
|
130
|
+
const u = requestAnimationFrame(() => {
|
|
130
131
|
const _ = requestAnimationFrame(() => {
|
|
131
|
-
|
|
132
|
+
m(!0);
|
|
132
133
|
});
|
|
133
134
|
return () => cancelAnimationFrame(_);
|
|
134
135
|
});
|
|
135
|
-
return () => cancelAnimationFrame(
|
|
136
|
-
}, [
|
|
137
|
-
const p =
|
|
138
|
-
(
|
|
139
|
-
c.clickOutside &&
|
|
136
|
+
return () => cancelAnimationFrame(u);
|
|
137
|
+
}, [a, o]);
|
|
138
|
+
const p = k(
|
|
139
|
+
(u) => {
|
|
140
|
+
c.clickOutside && u.target === r.current && (u.stopPropagation(), t(!1));
|
|
140
141
|
},
|
|
141
|
-
[c.clickOutside, t,
|
|
142
|
+
[c.clickOutside, t, r]
|
|
142
143
|
);
|
|
143
|
-
if (!
|
|
144
|
+
if (!a)
|
|
144
145
|
return null;
|
|
145
146
|
const y = {
|
|
146
147
|
zIndex: s,
|
|
147
148
|
...n
|
|
148
149
|
};
|
|
149
|
-
return /* @__PURE__ */
|
|
150
|
+
return /* @__PURE__ */ d(
|
|
150
151
|
"div",
|
|
151
152
|
{
|
|
152
|
-
ref:
|
|
153
|
+
ref: r,
|
|
153
154
|
className: `motile-sheet__overlay ${h ? "motile-sheet__overlay--visible" : ""} motile-sheet__overlay--${i} ${e}`,
|
|
154
155
|
style: y,
|
|
155
156
|
onClick: p,
|
|
@@ -157,63 +158,59 @@ function E({ className: e = "", style: n }) {
|
|
|
157
158
|
}
|
|
158
159
|
);
|
|
159
160
|
}
|
|
160
|
-
function
|
|
161
|
+
function E({ children: e, className: n = "", style: o }) {
|
|
161
162
|
const {
|
|
162
163
|
open: t,
|
|
163
164
|
setOpen: i,
|
|
164
|
-
position:
|
|
165
|
+
position: l,
|
|
165
166
|
closeOnBackdrop: s,
|
|
166
|
-
maxWidth:
|
|
167
|
-
zIndex:
|
|
167
|
+
maxWidth: r,
|
|
168
|
+
zIndex: a,
|
|
168
169
|
contentId: f,
|
|
169
170
|
sheetRef: h,
|
|
170
|
-
isClosingFromHistory:
|
|
171
|
-
} =
|
|
171
|
+
isClosingFromHistory: m
|
|
172
|
+
} = v(), [c, p] = S(!1), [y, u] = S(!1), _ = typeof s == "boolean" ? { escapeKey: s } : {
|
|
172
173
|
escapeKey: s.escapeKey ?? !1,
|
|
173
174
|
clickOutside: s.clickOutside ?? !1
|
|
174
175
|
};
|
|
175
|
-
if (
|
|
176
|
+
if (P({
|
|
176
177
|
enabled: t,
|
|
177
178
|
allowedSelectors: [".motile-sheet__body"]
|
|
178
|
-
}),
|
|
179
|
-
refs: [h],
|
|
180
|
-
handler: () => i(!1),
|
|
181
|
-
enabled: t && _.clickOutside
|
|
182
|
-
}), V({
|
|
179
|
+
}), K({
|
|
183
180
|
handler: () => i(!1),
|
|
184
181
|
enabled: t && _.escapeKey
|
|
185
|
-
}),
|
|
182
|
+
}), b(() => {
|
|
186
183
|
if (t)
|
|
187
184
|
p(!0);
|
|
188
185
|
else if (c) {
|
|
189
|
-
|
|
186
|
+
u(!1);
|
|
190
187
|
const C = setTimeout(() => {
|
|
191
188
|
p(!1);
|
|
192
|
-
},
|
|
189
|
+
}, m ? 0 : 300);
|
|
193
190
|
return () => clearTimeout(C);
|
|
194
191
|
}
|
|
195
|
-
}, [t, c,
|
|
196
|
-
if (!c || !t ||
|
|
197
|
-
const
|
|
192
|
+
}, [t, c, m]), b(() => {
|
|
193
|
+
if (!c || !t || m) return;
|
|
194
|
+
const x = requestAnimationFrame(() => {
|
|
198
195
|
const C = requestAnimationFrame(() => {
|
|
199
|
-
|
|
196
|
+
u(!0);
|
|
200
197
|
});
|
|
201
198
|
return () => cancelAnimationFrame(C);
|
|
202
199
|
});
|
|
203
|
-
return () => cancelAnimationFrame(
|
|
204
|
-
}, [c, t,
|
|
200
|
+
return () => cancelAnimationFrame(x);
|
|
201
|
+
}, [c, t, m]), !c)
|
|
205
202
|
return null;
|
|
206
203
|
const R = {
|
|
207
|
-
...
|
|
208
|
-
zIndex:
|
|
204
|
+
...r !== "600px" && { "--sheet-max-width": r },
|
|
205
|
+
zIndex: a + 1,
|
|
209
206
|
...o
|
|
210
207
|
};
|
|
211
|
-
return /* @__PURE__ */
|
|
208
|
+
return /* @__PURE__ */ d(
|
|
212
209
|
"div",
|
|
213
210
|
{
|
|
214
211
|
ref: h,
|
|
215
212
|
id: f,
|
|
216
|
-
className: `motile-sheet__content motile-sheet__content--${
|
|
213
|
+
className: `motile-sheet__content motile-sheet__content--${l} ${y ? "motile-sheet__content--visible" : ""} ${n}`,
|
|
217
214
|
style: R,
|
|
218
215
|
role: "dialog",
|
|
219
216
|
"aria-modal": "true",
|
|
@@ -221,28 +218,28 @@ function L({ children: e, className: n = "", style: o }) {
|
|
|
221
218
|
}
|
|
222
219
|
);
|
|
223
220
|
}
|
|
221
|
+
function L({ children: e, className: n = "" }) {
|
|
222
|
+
return /* @__PURE__ */ d("div", { className: `motile-sheet__header ${n}`, children: e });
|
|
223
|
+
}
|
|
224
224
|
function D({ children: e, className: n = "" }) {
|
|
225
|
-
return /* @__PURE__ */
|
|
225
|
+
return /* @__PURE__ */ d("h2", { id: "sheet-title", className: `motile-sheet__title ${n}`, children: e });
|
|
226
226
|
}
|
|
227
227
|
function M({ children: e, className: n = "" }) {
|
|
228
|
-
return /* @__PURE__ */
|
|
229
|
-
}
|
|
230
|
-
function W({ children: e, className: n = "" }) {
|
|
231
|
-
return /* @__PURE__ */ u("div", { className: `motile-sheet__body ${n}`, children: e });
|
|
228
|
+
return /* @__PURE__ */ d("div", { className: `motile-sheet__body ${n}`, children: e });
|
|
232
229
|
}
|
|
233
|
-
function
|
|
234
|
-
const { setOpen: o } =
|
|
230
|
+
function W({ children: e, asChild: n = !1 }) {
|
|
231
|
+
const { setOpen: o } = v(), t = k(() => {
|
|
235
232
|
o(!1);
|
|
236
233
|
}, [o]);
|
|
237
|
-
return n ? /* @__PURE__ */
|
|
238
|
-
|
|
234
|
+
return n ? /* @__PURE__ */ d(
|
|
235
|
+
O,
|
|
239
236
|
{
|
|
240
237
|
className: "motile-sheet__close",
|
|
241
238
|
onClick: t,
|
|
242
239
|
"aria-label": "닫기",
|
|
243
240
|
children: e
|
|
244
241
|
}
|
|
245
|
-
) : /* @__PURE__ */
|
|
242
|
+
) : /* @__PURE__ */ d(
|
|
246
243
|
"button",
|
|
247
244
|
{
|
|
248
245
|
className: "motile-sheet__close",
|
|
@@ -261,30 +258,30 @@ function G({ children: e, asChild: n = !1 }) {
|
|
|
261
258
|
strokeLinecap: "round",
|
|
262
259
|
strokeLinejoin: "round",
|
|
263
260
|
children: [
|
|
264
|
-
/* @__PURE__ */
|
|
265
|
-
/* @__PURE__ */
|
|
261
|
+
/* @__PURE__ */ d("line", { x1: "18", y1: "6", x2: "6", y2: "18" }),
|
|
262
|
+
/* @__PURE__ */ d("line", { x1: "6", y1: "6", x2: "18", y2: "18" })
|
|
266
263
|
]
|
|
267
264
|
}
|
|
268
265
|
)
|
|
269
266
|
}
|
|
270
267
|
);
|
|
271
268
|
}
|
|
272
|
-
function
|
|
273
|
-
const { navigateAndClose: e } =
|
|
269
|
+
function te() {
|
|
270
|
+
const { navigateAndClose: e } = v();
|
|
274
271
|
return e;
|
|
275
272
|
}
|
|
276
|
-
const
|
|
277
|
-
Root:
|
|
278
|
-
Trigger:
|
|
279
|
-
Portal:
|
|
280
|
-
Overlay:
|
|
281
|
-
Content:
|
|
282
|
-
Header:
|
|
283
|
-
Title:
|
|
284
|
-
Body:
|
|
285
|
-
Close:
|
|
273
|
+
const oe = {
|
|
274
|
+
Root: q,
|
|
275
|
+
Trigger: z,
|
|
276
|
+
Portal: B,
|
|
277
|
+
Overlay: j,
|
|
278
|
+
Content: E,
|
|
279
|
+
Header: L,
|
|
280
|
+
Title: D,
|
|
281
|
+
Body: M,
|
|
282
|
+
Close: W
|
|
286
283
|
};
|
|
287
284
|
export {
|
|
288
|
-
|
|
289
|
-
|
|
285
|
+
oe as Sheet,
|
|
286
|
+
te as useSheetNavigation
|
|
290
287
|
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
+
export type { CloseOnBackdropOptions, SheetBodyProps, SheetCloseProps, SheetContentProps, SheetHeaderProps, SheetOverlayProps, SheetPortalProps, SheetPosition, SheetRootProps, SheetTitleProps, SheetTriggerProps, } from './Sheet';
|
|
1
2
|
export { Sheet } from './Sheet';
|
|
2
|
-
export type { SheetPosition, CloseOnBackdropOptions, SheetRootProps, SheetTriggerProps, SheetPortalProps, SheetOverlayProps, SheetContentProps, SheetHeaderProps, SheetTitleProps, SheetBodyProps, SheetCloseProps, } from './Sheet';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as s } from "react/jsx-runtime";
|
|
2
2
|
import m, { forwardRef as c, useRef as y, useId as b, createContext as R, useContext as h } from "react";
|
|
3
|
-
import { Slot as f } from "../../utils/Slot.js";
|
|
4
3
|
import { useClickOutside as v } from "../../hooks/useClickOutside.js";
|
|
5
4
|
import { useEscapeKey as A } from "../../hooks/useEscapeKey.js";
|
|
5
|
+
import { Slot as f } from "../../utils/Slot.js";
|
|
6
6
|
import './SpeedDial.css';/* empty css */
|
|
7
7
|
const _ = R(null), g = () => {
|
|
8
8
|
const e = h(_);
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export
|
|
1
|
+
export type { SpeedDialActionProps, SpeedDialActionsProps, SpeedDialDirection, SpeedDialRootProps, SpeedDialTriggerProps, } from './SpeedDial';
|
|
2
|
+
export { SpeedDial, SpeedDialAction, SpeedDialActions, SpeedDialRoot, SpeedDialTrigger, } from './SpeedDial';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.motile-timepicker{display:flex;position:relative;user-select:none;-webkit-user-select:none;overflow:hidden}.motile-timepicker--disabled{pointer-events:none}.motile-timepicker--full-width{width:100%}.motile-timepicker__column{flex:1;overflow-y:scroll;overflow-x:hidden;scroll-snap-type:none;scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;touch-action:pan-y;cursor:grab}@media (hover: none) and (pointer: coarse){.motile-timepicker__column{scroll-snap-type:y mandatory;cursor:default}}.motile-timepicker__column::-webkit-scrollbar{display:none}.motile-timepicker__item{display:flex;align-items:center;justify-content:center;scroll-snap-align:center;font-variant-numeric:tabular-nums;color:#d1d5db}.motile-timepicker__item--selected{color:inherit}.motile-timepicker__spacer{flex-shrink:0;pointer-events:none}.motile-timepicker__highlight{position:absolute;left:0;right:0;top:50%;transform:translateY(-50%);pointer-events:none;background-color:#0000000d;border-radius:8px}@media (prefers-reduced-motion: reduce){.motile-timepicker__column{scroll-behavior:auto}}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export type TimeFormat = "12" | "24";
|
|
3
|
+
export type TimePeriod = "AM" | "PM";
|
|
4
|
+
export type MinuteStep = 1 | 5 | 10 | 15 | 30;
|
|
5
|
+
export interface TimeValue {
|
|
6
|
+
hour: number;
|
|
7
|
+
minute: number;
|
|
8
|
+
period?: TimePeriod;
|
|
9
|
+
}
|
|
10
|
+
export interface TimePickerRootProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "onChange" | "defaultValue"> {
|
|
11
|
+
value?: TimeValue;
|
|
12
|
+
defaultValue?: TimeValue;
|
|
13
|
+
onChange?: (time: TimeValue) => void;
|
|
14
|
+
format?: TimeFormat;
|
|
15
|
+
minuteStep?: MinuteStep;
|
|
16
|
+
disabled?: boolean;
|
|
17
|
+
itemHeight?: number;
|
|
18
|
+
fullWidth?: boolean;
|
|
19
|
+
children: React.ReactNode;
|
|
20
|
+
}
|
|
21
|
+
export declare const TimePickerRoot: React.ForwardRefExoticComponent<TimePickerRootProps & React.RefAttributes<HTMLDivElement>>;
|
|
22
|
+
export interface TimePickerColumnProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "children"> {
|
|
23
|
+
type: "hour" | "minute" | "period";
|
|
24
|
+
}
|
|
25
|
+
export declare const TimePickerColumn: React.ForwardRefExoticComponent<TimePickerColumnProps & React.RefAttributes<HTMLDivElement>>;
|
|
26
|
+
export interface TimePickerHighlightProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
27
|
+
}
|
|
28
|
+
export declare const TimePickerHighlight: React.ForwardRefExoticComponent<TimePickerHighlightProps & React.RefAttributes<HTMLDivElement>>;
|
|
29
|
+
export declare const TimePicker: {
|
|
30
|
+
Root: React.ForwardRefExoticComponent<TimePickerRootProps & React.RefAttributes<HTMLDivElement>>;
|
|
31
|
+
Column: React.ForwardRefExoticComponent<TimePickerColumnProps & React.RefAttributes<HTMLDivElement>>;
|
|
32
|
+
Highlight: React.ForwardRefExoticComponent<TimePickerHighlightProps & React.RefAttributes<HTMLDivElement>>;
|
|
33
|
+
};
|