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
package/README.md
CHANGED
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
|
|
38
38
|
## ✨ 주요 기능
|
|
39
39
|
|
|
40
|
-
- 🎨 **
|
|
40
|
+
- 🎨 **18개의 고품질 컴포넌트** - 웹뷰 애플리케이션을 위해 세심하게 제작
|
|
41
41
|
- 💪 **TypeScript 우선** - 포괄적인 타입 정의 완벽 지원
|
|
42
42
|
- 🎭 **커스터마이징 가능** - CSS 변수로 쉬운 테마 설정
|
|
43
43
|
- 📱 **모바일 최적화** - 터치 친화적 인터랙션과 반응형 디자인
|
|
@@ -187,6 +187,8 @@ color props > --motile-ui-btn > --motile-theme > #3b82f6 (기본값)
|
|
|
187
187
|
- **Tooltip** - 툴팁
|
|
188
188
|
- **Accordion** - 접을 수 있는 패널
|
|
189
189
|
- **Dock** - 독 스타일 네비게이션 바
|
|
190
|
+
- **NumberFlow** - 숫자 애니메이션 컴포넌트
|
|
191
|
+
- **TimePicker** - 휠 스크롤 방식 타임피커
|
|
190
192
|
|
|
191
193
|
---
|
|
192
194
|
|
|
@@ -217,7 +219,7 @@ MIT © [Innopers](https://github.com/Innopers)
|
|
|
217
219
|
|
|
218
220
|
## ✨ Features
|
|
219
221
|
|
|
220
|
-
- 🎨 **
|
|
222
|
+
- 🎨 **18 High-Quality Components** - Carefully crafted for webview applications
|
|
221
223
|
- 💪 **TypeScript First** - Full TypeScript support with comprehensive type definitions
|
|
222
224
|
- 🎭 **Customizable** - Easy theming with CSS variables
|
|
223
225
|
- 📱 **Mobile Optimized** - Touch-friendly interactions and responsive design
|
|
@@ -367,6 +369,8 @@ color props > --motile-ui-btn > --motile-theme > #3b82f6 (default)
|
|
|
367
369
|
- **Tooltip** - Tooltip
|
|
368
370
|
- **Accordion** - Collapsible panel
|
|
369
371
|
- **Dock** - Dock-style navigation bar
|
|
372
|
+
- **NumberFlow** - Animated number transition component
|
|
373
|
+
- **TimePicker** - Wheel scroll style time picker
|
|
370
374
|
|
|
371
375
|
---
|
|
372
376
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.motile-badge{display:inline-flex;align-items:center;justify-content:center;font-weight:500;line-height:1.2;border-radius:9999px;white-space:nowrap;vertical-align:middle;background-color:var( --motile-badge-color, var(--motile-ui-badge, var(--motile-theme, #3b82f6)) );color:#fff}.motile-badge--large{padding:6px 16px;font-size:1rem;min-height:32px}.motile-badge--medium{padding:5px 12px;font-size:.875rem;min-height:26px}.motile-badge--small{padding:4px 8px;font-size:.75rem;min-height:24px}.motile-badge--primary{background-color:var( --motile-badge-color, var(--motile-ui-badge, var(--motile-theme, #3b82f6)) );color:#fff}.motile-badge--secondary{background:color-mix(in srgb,var(--motile-badge-color, var(--motile-ui-badge, var(--motile-theme, #3b82f6))) 10%,transparent);color:var( --motile-badge-color, var(--motile-ui-badge, var(--motile-theme, #3b82f6)) );border:1px solid var(--motile-badge-color, var(--motile-ui-badge, var(--motile-theme, #3b82f6)))}.motile-badge--secondary.motile-badge--large{padding:5px 15px;min-height:30px}.motile-badge--secondary.motile-badge--medium{padding:4px 11px;min-height:24px}.motile-badge--secondary.motile-badge--small{padding:3px 7px;min-height:22px}.motile-badge--outlined{background-color:#fff;color:var( --motile-badge-color, var(--motile-ui-badge, var(--motile-theme, #3b82f6)) );border:1px solid var(--motile-badge-color, var(--motile-ui-badge, var(--motile-theme, #3b82f6)))}.motile-badge--outlined.motile-badge--large{padding:5px 15px;min-height:30px}.motile-badge--outlined.motile-badge--medium{padding:4px 11px;min-height:24px}.motile-badge--outlined.motile-badge--small{padding:3px 7px;min-height:22px}.motile-badge--dot{background-color:transparent;padding:0;gap:6px;color:inherit}.motile-badge__dot{display:inline-block;border-radius:50%;background-color:var( --motile-badge-color, var(--motile-ui-badge, var(--motile-theme, #3b82f6)) )}.motile-badge__text{line-height:1.2}.motile-badge--dot.motile-badge--large .motile-badge__dot{width:12px;height:12px}.motile-badge--dot.motile-badge--medium .motile-badge__dot{width:10px;height:10px}.motile-badge--dot.motile-badge--small .motile-badge__dot{width:8px;height:8px}.motile-badge--shimmer{background-color:var( --motile-badge-color, var(--motile-ui-badge, var(--motile-theme, #3b82f6)) );color:#fff;position:relative;overflow:hidden}.motile-badge--shimmer:before{content:"";position:absolute;top:0;left:-100%;width:100%;height:100%;background:linear-gradient(90deg,transparent 0%,rgba(255,255,255,.3) 50%,transparent 100%);animation:shimmer 2s infinite}@keyframes shimmer{0%{transform:translate(0)}to{transform:translate(200%)}}@media (prefers-reduced-motion: reduce){.motile-badge--shimmer:before{animation:none}}@media (max-width: 768px){.motile-badge:active{filter:brightness(.92)}}@supports (-webkit-touch-callout: none){.motile-badge{-webkit-tap-highlight-color:transparent;-webkit-user-select:none;user-select:none}}
|
|
1
|
+
.motile-badge{display:inline-flex;align-items:center;justify-content:center;font-weight:500;line-height:1.2;border-radius:9999px;white-space:nowrap;vertical-align:middle;background-color:var( --motile-badge-color, var(--motile-ui-badge, var(--motile-theme, #3b82f6)) );color:#fff}.motile-badge--large{padding:6px 16px;font-size:1rem;min-height:32px}.motile-badge--medium{padding:5px 12px;font-size:.875rem;min-height:26px}.motile-badge--small{padding:4px 8px;font-size:.75rem;min-height:24px}.motile-badge--primary{background-color:var( --motile-badge-color, var(--motile-ui-badge, var(--motile-theme, #3b82f6)) );color:#fff}.motile-badge--secondary{background:color-mix(in srgb,var( --motile-badge-color, var(--motile-ui-badge, var(--motile-theme, #3b82f6)) ) 10%,transparent);color:var( --motile-badge-color, var(--motile-ui-badge, var(--motile-theme, #3b82f6)) );border:1px solid var( --motile-badge-color, var(--motile-ui-badge, var(--motile-theme, #3b82f6)) )}.motile-badge--secondary.motile-badge--large{padding:5px 15px;min-height:30px}.motile-badge--secondary.motile-badge--medium{padding:4px 11px;min-height:24px}.motile-badge--secondary.motile-badge--small{padding:3px 7px;min-height:22px}.motile-badge--outlined{background-color:#fff;color:var( --motile-badge-color, var(--motile-ui-badge, var(--motile-theme, #3b82f6)) );border:1px solid var( --motile-badge-color, var(--motile-ui-badge, var(--motile-theme, #3b82f6)) )}.motile-badge--outlined.motile-badge--large{padding:5px 15px;min-height:30px}.motile-badge--outlined.motile-badge--medium{padding:4px 11px;min-height:24px}.motile-badge--outlined.motile-badge--small{padding:3px 7px;min-height:22px}.motile-badge--dot{background-color:transparent;padding:0;gap:6px;color:inherit}.motile-badge__dot{display:inline-block;border-radius:50%;background-color:var( --motile-badge-color, var(--motile-ui-badge, var(--motile-theme, #3b82f6)) )}.motile-badge__text{line-height:1.2}.motile-badge--dot.motile-badge--large .motile-badge__dot{width:12px;height:12px}.motile-badge--dot.motile-badge--medium .motile-badge__dot{width:10px;height:10px}.motile-badge--dot.motile-badge--small .motile-badge__dot{width:8px;height:8px}.motile-badge--shimmer{background-color:var( --motile-badge-color, var(--motile-ui-badge, var(--motile-theme, #3b82f6)) );color:#fff;position:relative;overflow:hidden}.motile-badge--shimmer:before{content:"";position:absolute;top:0;left:-100%;width:100%;height:100%;background:linear-gradient(90deg,transparent 0%,rgba(255,255,255,.3) 50%,transparent 100%);animation:shimmer 2s infinite}@keyframes shimmer{0%{transform:translate(0)}to{transform:translate(200%)}}@media (prefers-reduced-motion: reduce){.motile-badge--shimmer:before{animation:none}}@media (max-width: 768px){.motile-badge:active{filter:brightness(.92)}}@supports (-webkit-touch-callout: none){.motile-badge{-webkit-tap-highlight-color:transparent;-webkit-user-select:none;user-select:none}}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export
|
|
1
|
+
export type { DockItemProps, DockPosition, DockRootProps, DockSeparatorProps, } from './Dock';
|
|
2
|
+
export { Dock, DockItem, DockRoot, DockSeparator } from './Dock';
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsx as u } from "react/jsx-runtime";
|
|
2
2
|
import W, { forwardRef as w, useState as g, useEffect as Y, useRef as _, createContext as G, useContext as J } from "react";
|
|
3
3
|
import { createPortal as Q } from "react-dom";
|
|
4
|
+
import { useClickOutside as X } from "../../hooks/useClickOutside.js";
|
|
5
|
+
import { useEscapeKey as Z } from "../../hooks/useEscapeKey.js";
|
|
6
|
+
import { useScrollLock as k } from "../../hooks/useScrollLock.js";
|
|
4
7
|
import { Slot as M } from "../../utils/Slot.js";
|
|
5
|
-
import { useScrollLock as X } from "../../hooks/useScrollLock.js";
|
|
6
|
-
import { useClickOutside as Z } from "../../hooks/useClickOutside.js";
|
|
7
|
-
import { useEscapeKey as k } from "../../hooks/useEscapeKey.js";
|
|
8
8
|
import './Drawer.css';/* empty css */
|
|
9
9
|
const $ = G(null), f = () => {
|
|
10
10
|
const r = J($);
|
|
@@ -29,7 +29,7 @@ const $ = G(null), f = () => {
|
|
|
29
29
|
escapeKey: (e == null ? void 0 : e.escapeKey) ?? !1,
|
|
30
30
|
clickOutside: (e == null ? void 0 : e.clickOutside) ?? !1
|
|
31
31
|
};
|
|
32
|
-
|
|
32
|
+
k({
|
|
33
33
|
enabled: D,
|
|
34
34
|
allowedSelectors: ["[data-scroll-allowed]", ".motile-drawer__body"]
|
|
35
35
|
});
|
|
@@ -54,11 +54,11 @@ const $ = G(null), f = () => {
|
|
|
54
54
|
i.style.transition = "transform 0.3s ease", i.style.transform = "translateY(0)", N(!0);
|
|
55
55
|
});
|
|
56
56
|
});
|
|
57
|
-
}, [x]),
|
|
57
|
+
}, [x]), X({
|
|
58
58
|
refs: [a],
|
|
59
59
|
handler: p,
|
|
60
60
|
enabled: D && S.clickOutside
|
|
61
|
-
}),
|
|
61
|
+
}), Z({
|
|
62
62
|
handler: p,
|
|
63
63
|
enabled: D && S.escapeKey
|
|
64
64
|
});
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
+
export type { CloseOnBackdropOptions, DrawerBodyProps, DrawerCloseProps, DrawerContentProps, DrawerHandleProps, DrawerOverlayProps, DrawerPortalProps, DrawerRootProps, DrawerTitleProps, DrawerTriggerProps, } from './Drawer';
|
|
1
2
|
export { Drawer } from './Drawer';
|
|
2
|
-
export type { CloseOnBackdropOptions, DrawerRootProps, DrawerTriggerProps, DrawerPortalProps, DrawerOverlayProps, DrawerContentProps, DrawerHandleProps, DrawerTitleProps, DrawerBodyProps, DrawerCloseProps, } from './Drawer';
|
|
@@ -148,4 +148,4 @@ export declare const Modal: {
|
|
|
148
148
|
Footer: React.ForwardRefExoticComponent<ModalFooterProps & React.RefAttributes<HTMLDivElement>>;
|
|
149
149
|
Header: React.ForwardRefExoticComponent<ModalHeaderProps & React.RefAttributes<HTMLDivElement>>;
|
|
150
150
|
};
|
|
151
|
-
export type {
|
|
151
|
+
export type { ModalBodyProps, ModalCloseProps, ModalContentProps, ModalFooterProps, ModalHeaderProps, ModalOverlayProps, ModalRootProps, ModalTitleProps, ModalVariant, };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsx as l, jsxs as L } from "react/jsx-runtime";
|
|
2
2
|
import n, { useRef as k, useState as O, useEffect as P, useId as h, createContext as V, useContext as q } from "react";
|
|
3
3
|
import { createPortal as z } from "react-dom";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
4
|
+
import { useClickOutside as A } from "../../hooks/useClickOutside.js";
|
|
5
|
+
import { useEscapeKey as D } from "../../hooks/useEscapeKey.js";
|
|
6
|
+
import { useScrollLock as G } from "../../hooks/useScrollLock.js";
|
|
7
|
+
import { Slot as J } from "../../utils/Slot.js";
|
|
8
8
|
import './Modal.css';/* empty css */
|
|
9
9
|
const v = V(null), m = () => {
|
|
10
10
|
const o = q(v);
|
|
@@ -45,16 +45,16 @@ const v = V(null), m = () => {
|
|
|
45
45
|
E(!0);
|
|
46
46
|
}, []);
|
|
47
47
|
const b = typeof e == "boolean" ? e : e.clickOutside ?? !1, T = typeof e == "boolean" ? e : e.escapeKey ?? !1;
|
|
48
|
-
|
|
48
|
+
G({
|
|
49
49
|
enabled: c && !a,
|
|
50
50
|
allowedSelectors: [".motile-modal__content"]
|
|
51
|
-
}),
|
|
51
|
+
}), A({
|
|
52
52
|
refs: [M],
|
|
53
53
|
handler: () => {
|
|
54
54
|
b && f(!1);
|
|
55
55
|
},
|
|
56
56
|
enabled: c
|
|
57
|
-
}),
|
|
57
|
+
}), D({
|
|
58
58
|
handler: () => {
|
|
59
59
|
T && f(!1);
|
|
60
60
|
},
|
|
@@ -152,7 +152,7 @@ const R = n.forwardRef(
|
|
|
152
152
|
e == null || e(i), s(!1);
|
|
153
153
|
};
|
|
154
154
|
return o ? /* @__PURE__ */ l(
|
|
155
|
-
|
|
155
|
+
J,
|
|
156
156
|
{
|
|
157
157
|
...d,
|
|
158
158
|
onClick: u,
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
+
export type { CloseOnBackdropOptions, ModalBodyProps, ModalCloseProps, ModalContentProps, ModalFooterProps, ModalHeaderProps, ModalOverlayProps, ModalRootProps, ModalTitleProps, ModalVariant, } from './Modal';
|
|
1
2
|
export { Modal } from './Modal';
|
|
2
|
-
export type { ModalVariant, CloseOnBackdropOptions, ModalRootProps, ModalOverlayProps, ModalContentProps, ModalCloseProps, ModalTitleProps, ModalBodyProps, ModalHeaderProps, ModalFooterProps, } from './Modal';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.motile-number-flow{display:inline-flex;align-items:center;font-variant-numeric:tabular-nums;line-height:1}.motile-number-flow__sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.motile-number-flow__value{display:inline-flex;align-items:center}.motile-number-flow__digit{display:inline-block;height:1em;overflow:hidden;line-height:1;vertical-align:top}.motile-number-flow__digit-column{display:flex;flex-direction:column;will-change:transform;transform:translateZ(0);backface-visibility:hidden}.motile-number-flow__digit-value{display:flex;align-items:center;justify-content:center;height:1em;line-height:1}.motile-number-flow__separator{display:inline-block;line-height:1}@media (prefers-reduced-motion: reduce){.motile-number-flow__digit-column{transition:none!important}}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export interface NumberFlowProps {
|
|
3
|
+
/**
|
|
4
|
+
* 표시할 숫자 값
|
|
5
|
+
*/
|
|
6
|
+
value: number;
|
|
7
|
+
/**
|
|
8
|
+
* 로케일 (기본값: 'ko-KR')
|
|
9
|
+
* @example 'en-US', 'ko-KR', 'ja-JP'
|
|
10
|
+
*/
|
|
11
|
+
locale?: string;
|
|
12
|
+
/**
|
|
13
|
+
* 애니메이션 지속 시간 (ms)
|
|
14
|
+
* @default 600
|
|
15
|
+
*/
|
|
16
|
+
duration?: number;
|
|
17
|
+
/**
|
|
18
|
+
* 컨테이너 className
|
|
19
|
+
*/
|
|
20
|
+
className?: string;
|
|
21
|
+
/**
|
|
22
|
+
* 인라인 스타일
|
|
23
|
+
*/
|
|
24
|
+
style?: React.CSSProperties;
|
|
25
|
+
/**
|
|
26
|
+
* 마운트 시 애니메이션 적용 여부
|
|
27
|
+
* @default true
|
|
28
|
+
*/
|
|
29
|
+
animateOnMount?: boolean;
|
|
30
|
+
}
|
|
31
|
+
export declare const NumberFlow: React.ForwardRefExoticComponent<NumberFlowProps & React.RefAttributes<HTMLSpanElement>>;
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import { jsx as l, jsxs as M } from "react/jsx-runtime";
|
|
2
|
+
import g, { useRef as y, useMemo as _, useEffect as R, useState as C } from "react";
|
|
3
|
+
import './NumberFlow.css';/* empty css */
|
|
4
|
+
function O(t, a) {
|
|
5
|
+
return new Intl.NumberFormat(a).format(t);
|
|
6
|
+
}
|
|
7
|
+
function x(t) {
|
|
8
|
+
return /^\d$/.test(t);
|
|
9
|
+
}
|
|
10
|
+
const T = [
|
|
11
|
+
"0",
|
|
12
|
+
"1",
|
|
13
|
+
"2",
|
|
14
|
+
"3",
|
|
15
|
+
"4",
|
|
16
|
+
"5",
|
|
17
|
+
"6",
|
|
18
|
+
"7",
|
|
19
|
+
"8",
|
|
20
|
+
"9",
|
|
21
|
+
"0",
|
|
22
|
+
"1",
|
|
23
|
+
"2",
|
|
24
|
+
"3",
|
|
25
|
+
"4",
|
|
26
|
+
"5",
|
|
27
|
+
"6",
|
|
28
|
+
"7",
|
|
29
|
+
"8",
|
|
30
|
+
"9",
|
|
31
|
+
"0",
|
|
32
|
+
"1",
|
|
33
|
+
"2",
|
|
34
|
+
"3",
|
|
35
|
+
"4",
|
|
36
|
+
"5",
|
|
37
|
+
"6",
|
|
38
|
+
"7",
|
|
39
|
+
"8",
|
|
40
|
+
"9"
|
|
41
|
+
], S = g.memo(
|
|
42
|
+
({ value: t, prevValue: a, direction: i, duration: N, index: b, animateOnMount: p }) => {
|
|
43
|
+
const r = parseInt(t, 10), e = a === null ? p ? 0 : r : parseInt(a, 10), [s, u] = C(e), c = b * 50;
|
|
44
|
+
R(() => {
|
|
45
|
+
if (e === r)
|
|
46
|
+
return;
|
|
47
|
+
let n;
|
|
48
|
+
i === "up" ? n = r >= e ? r - e : 10 - e + r : n = e >= r ? e - r : e + 10 - r;
|
|
49
|
+
const o = setTimeout(() => {
|
|
50
|
+
u(
|
|
51
|
+
(f) => i === "up" ? f + n : f - n
|
|
52
|
+
);
|
|
53
|
+
}, c + 10);
|
|
54
|
+
return () => clearTimeout(o);
|
|
55
|
+
}, [t, e, r, i, c]);
|
|
56
|
+
const w = {
|
|
57
|
+
transform: `translateY(${-((s % 30 + 30) % 30) * (100 / 30)}%)`,
|
|
58
|
+
transition: `transform ${N}ms ease-out`
|
|
59
|
+
};
|
|
60
|
+
return /* @__PURE__ */ l("span", { className: "motile-number-flow__digit", children: /* @__PURE__ */ l("span", { className: "motile-number-flow__digit-column", style: w, children: T.map((n, o) => /* @__PURE__ */ l("span", { className: "motile-number-flow__digit-value", children: n }, o)) }) });
|
|
61
|
+
}
|
|
62
|
+
);
|
|
63
|
+
S.displayName = "NumberFlow.Digit";
|
|
64
|
+
const $ = g.memo(({ value: t }) => /* @__PURE__ */ l("span", { className: "motile-number-flow__separator", children: t }));
|
|
65
|
+
$.displayName = "NumberFlow.Separator";
|
|
66
|
+
const Y = g.forwardRef(
|
|
67
|
+
({
|
|
68
|
+
value: t,
|
|
69
|
+
locale: a = "ko-KR",
|
|
70
|
+
duration: i = 600,
|
|
71
|
+
className: N,
|
|
72
|
+
style: b,
|
|
73
|
+
animateOnMount: p = !0
|
|
74
|
+
}, r) => {
|
|
75
|
+
const d = y(null), e = y(null), s = _(
|
|
76
|
+
() => O(t, a),
|
|
77
|
+
[t, a]
|
|
78
|
+
), u = e.current, c = _(() => {
|
|
79
|
+
if (d.current === null) return "up";
|
|
80
|
+
const m = d.current;
|
|
81
|
+
return m < 0 && t < 0 ? Math.abs(t) >= Math.abs(m) ? "up" : "down" : t >= m ? "up" : "down";
|
|
82
|
+
}, [t]);
|
|
83
|
+
R(() => {
|
|
84
|
+
d.current = t, e.current = s;
|
|
85
|
+
}, [t, s]);
|
|
86
|
+
const h = _(() => {
|
|
87
|
+
const m = s.split(""), w = (u == null ? void 0 : u.split("")) || [];
|
|
88
|
+
let n = 0;
|
|
89
|
+
return m.map((o, f) => {
|
|
90
|
+
const I = `${f}-${o}`, D = w[f] || null;
|
|
91
|
+
if (x(o)) {
|
|
92
|
+
const F = n;
|
|
93
|
+
return n++, /* @__PURE__ */ l(
|
|
94
|
+
S,
|
|
95
|
+
{
|
|
96
|
+
value: o,
|
|
97
|
+
prevValue: x(D || "") ? D : null,
|
|
98
|
+
direction: c,
|
|
99
|
+
duration: i,
|
|
100
|
+
index: F,
|
|
101
|
+
animateOnMount: p
|
|
102
|
+
},
|
|
103
|
+
I
|
|
104
|
+
);
|
|
105
|
+
}
|
|
106
|
+
return /* @__PURE__ */ l($, { value: o }, I);
|
|
107
|
+
});
|
|
108
|
+
}, [s, u, c, i, p]);
|
|
109
|
+
return /* @__PURE__ */ M(
|
|
110
|
+
"span",
|
|
111
|
+
{
|
|
112
|
+
ref: r,
|
|
113
|
+
className: `motile-number-flow ${N || ""}`,
|
|
114
|
+
style: b,
|
|
115
|
+
"aria-label": s,
|
|
116
|
+
role: "text",
|
|
117
|
+
children: [
|
|
118
|
+
/* @__PURE__ */ l("span", { className: "motile-number-flow__sr-only", children: s }),
|
|
119
|
+
/* @__PURE__ */ l("span", { className: "motile-number-flow__value", "aria-hidden": "true", children: h })
|
|
120
|
+
]
|
|
121
|
+
}
|
|
122
|
+
);
|
|
123
|
+
}
|
|
124
|
+
);
|
|
125
|
+
Y.displayName = "NumberFlow";
|
|
126
|
+
export {
|
|
127
|
+
Y as NumberFlow
|
|
128
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -68,4 +68,4 @@ export declare const Popover: {
|
|
|
68
68
|
Trigger: typeof PopoverTrigger;
|
|
69
69
|
Content: typeof PopoverContent;
|
|
70
70
|
};
|
|
71
|
-
export type {
|
|
71
|
+
export type { Align, Placement, PopoverContentProps, PopoverRootProps, PopoverTriggerProps, PopoverVariant, };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsxs as $, jsx as g } from "react/jsx-runtime";
|
|
2
2
|
import h, { useCallback as R, useId as k, useRef as I, useMemo as N, createContext as j, useContext as E } from "react";
|
|
3
|
+
import { useClickOutside as T } from "../../hooks/useClickOutside.js";
|
|
4
|
+
import { useEscapeKey as A } from "../../hooks/useEscapeKey.js";
|
|
5
|
+
import { FloatingArrow as B } from "../../utils/FloatingArrow.js";
|
|
6
|
+
import { Slot as F } from "../../utils/Slot.js";
|
|
3
7
|
import './Popover.css';/* empty css */
|
|
4
|
-
import { Slot as T } from "../../utils/Slot.js";
|
|
5
|
-
import { useClickOutside as A } from "../../hooks/useClickOutside.js";
|
|
6
|
-
import { useEscapeKey as B } from "../../hooks/useEscapeKey.js";
|
|
7
|
-
import { FloatingArrow as F } from "../../utils/FloatingArrow.js";
|
|
8
8
|
const S = j(null);
|
|
9
9
|
function C() {
|
|
10
10
|
const t = E(S);
|
|
@@ -91,7 +91,7 @@ function V({ children: t, asChild: s = !1 }) {
|
|
|
91
91
|
e((c) => !c);
|
|
92
92
|
}, [e]);
|
|
93
93
|
return s ? /* @__PURE__ */ g(
|
|
94
|
-
|
|
94
|
+
F,
|
|
95
95
|
{
|
|
96
96
|
ref: (c) => {
|
|
97
97
|
l.current = c;
|
|
@@ -137,7 +137,7 @@ function q({
|
|
|
137
137
|
contentRef: w,
|
|
138
138
|
wrapperRef: b
|
|
139
139
|
} = C();
|
|
140
|
-
if (
|
|
140
|
+
if (A({
|
|
141
141
|
handler: R(
|
|
142
142
|
(p) => {
|
|
143
143
|
u && (n == null || n(p), p.defaultPrevented || r(!1));
|
|
@@ -145,7 +145,7 @@ function q({
|
|
|
145
145
|
[u, n, r]
|
|
146
146
|
),
|
|
147
147
|
enabled: e
|
|
148
|
-
}),
|
|
148
|
+
}), T({
|
|
149
149
|
refs: [b],
|
|
150
150
|
handler: R(
|
|
151
151
|
(p) => {
|
|
@@ -175,7 +175,7 @@ function q({
|
|
|
175
175
|
},
|
|
176
176
|
children: [
|
|
177
177
|
c && /* @__PURE__ */ g(
|
|
178
|
-
|
|
178
|
+
B,
|
|
179
179
|
{
|
|
180
180
|
className: "motile-popover-arrow",
|
|
181
181
|
variant: a,
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
+
export type { Align, Placement, PopoverContentProps, PopoverRootProps, PopoverTriggerProps, PopoverVariant, } from './Popover';
|
|
1
2
|
export { Popover } from './Popover';
|
|
2
|
-
export type { PopoverRootProps, PopoverTriggerProps, PopoverContentProps, Placement, Align, PopoverVariant, } from './Popover';
|
|
@@ -26,8 +26,14 @@ interface SheetRootProps {
|
|
|
26
26
|
open?: boolean;
|
|
27
27
|
defaultOpen?: boolean;
|
|
28
28
|
onOpenChange?: (open: boolean) => void;
|
|
29
|
+
/**
|
|
30
|
+
* 히스토리 기반 뒤로가기 닫기 기능 활성화 여부
|
|
31
|
+
* URL로 Sheet를 제어하는 경우 false로 설정하세요.
|
|
32
|
+
* @default true
|
|
33
|
+
*/
|
|
34
|
+
enableHistoryClose?: boolean;
|
|
29
35
|
}
|
|
30
|
-
declare function SheetRoot({ children, position, closeOnBackdrop, maxWidth, zIndex, open: controlledOpen, defaultOpen, onOpenChange, }: SheetRootProps): import("react/jsx-runtime").JSX.Element;
|
|
36
|
+
declare function SheetRoot({ children, position, closeOnBackdrop, maxWidth, zIndex, open: controlledOpen, defaultOpen, onOpenChange, enableHistoryClose, }: SheetRootProps): import("react/jsx-runtime").JSX.Element;
|
|
31
37
|
interface SheetTriggerProps {
|
|
32
38
|
children: React.ReactElement;
|
|
33
39
|
asChild?: boolean;
|
|
@@ -90,4 +96,4 @@ export declare const Sheet: {
|
|
|
90
96
|
Body: typeof SheetBody;
|
|
91
97
|
Close: typeof SheetClose;
|
|
92
98
|
};
|
|
93
|
-
export type {
|
|
99
|
+
export type { SheetBodyProps, SheetCloseProps, SheetContentProps, SheetHeaderProps, SheetOverlayProps, SheetPortalProps, SheetRootProps, SheetTitleProps, SheetTriggerProps, };
|