@nation-a/ui 0.11.1 → 0.11.3
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.cjs +8897 -3721
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +8919 -3743
- package/dist/index.js.map +1 -1
- package/dist/styled-system/styles.css +87 -51
- package/dist/types/components/BottomSheet/BottomSheet.stories.d.ts +5 -0
- package/dist/types/components/BottomSheet/bottomsheet.recipe.d.ts +11 -0
- package/dist/types/components/BottomSheet/index.d.ts +31 -37
- package/dist/types/components/BottomSheet/src/SheetBackdrop.d.ts +2 -0
- package/dist/types/components/BottomSheet/src/SheetContainer.d.ts +5 -0
- package/dist/types/components/BottomSheet/src/SheetContent.d.ts +6 -0
- package/dist/types/components/BottomSheet/src/SheetHeader.d.ts +6 -0
- package/dist/types/components/BottomSheet/src/SheetScroller.d.ts +3 -0
- package/dist/types/components/BottomSheet/src/constants.d.ts +12 -0
- package/dist/types/components/BottomSheet/src/context.d.ts +9 -0
- package/dist/types/components/BottomSheet/src/hooks.d.ts +22 -0
- package/dist/types/components/BottomSheet/src/index.d.ts +10 -0
- package/dist/types/components/BottomSheet/src/sheet.d.ts +16 -0
- package/dist/types/components/BottomSheet/src/styles.d.ts +2 -0
- package/dist/types/components/BottomSheet/src/types.d.ts +87 -0
- package/dist/types/components/BottomSheet/src/use-prevent-scroll.d.ts +13 -0
- package/dist/types/components/BottomSheet/src/utils.d.ts +10 -0
- package/dist/types/components/Navigation/navigation.recipe.d.ts +1 -1
- package/dist/types/components/Tabs/tabs.recipe.d.ts +1 -1
- package/package.json +3 -1
|
@@ -999,64 +999,68 @@ html:not(#\#),body:not(#\#) {
|
|
|
999
999
|
gap: 10px;
|
|
1000
1000
|
}
|
|
1001
1001
|
|
|
1002
|
-
.
|
|
1003
|
-
|
|
1002
|
+
.p_0:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) {
|
|
1003
|
+
padding: var(--spacing-0);
|
|
1004
1004
|
}
|
|
1005
1005
|
|
|
1006
|
-
.
|
|
1007
|
-
|
|
1006
|
+
.p_5:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) {
|
|
1007
|
+
padding: var(--spacing-5);
|
|
1008
1008
|
}
|
|
1009
1009
|
|
|
1010
|
-
.
|
|
1011
|
-
|
|
1010
|
+
.bd_5px_solid_red:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) {
|
|
1011
|
+
border: 5px solid red;
|
|
1012
1012
|
}
|
|
1013
1013
|
|
|
1014
|
-
.
|
|
1015
|
-
|
|
1014
|
+
.gap_15:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) {
|
|
1015
|
+
gap: 15px;
|
|
1016
1016
|
}
|
|
1017
1017
|
|
|
1018
|
-
.
|
|
1019
|
-
|
|
1018
|
+
.bd_1px_solid_red:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) {
|
|
1019
|
+
border: 1px solid red;
|
|
1020
1020
|
}
|
|
1021
1021
|
|
|
1022
|
-
.
|
|
1023
|
-
|
|
1022
|
+
.c_white:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) {
|
|
1023
|
+
color: white;
|
|
1024
1024
|
}
|
|
1025
1025
|
|
|
1026
|
-
.
|
|
1027
|
-
|
|
1026
|
+
.bx-sh_md:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) {
|
|
1027
|
+
box-shadow: md;
|
|
1028
1028
|
}
|
|
1029
1029
|
|
|
1030
|
-
.
|
|
1031
|
-
|
|
1032
|
-
}
|
|
1033
|
-
|
|
1034
|
-
.bx-sh_0_-15px_15px_0px_rgba\(0\,_0\,_0\,_0\.05\):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) {
|
|
1035
|
-
box-shadow: 0 -15px 15px 0px rgba(0, 0, 0, 0.05);
|
|
1030
|
+
.bg_surface\.layer_1:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) {
|
|
1031
|
+
background: var(--colors-surface-layer_1);
|
|
1036
1032
|
}
|
|
1037
1033
|
|
|
1038
|
-
.
|
|
1039
|
-
|
|
1034
|
+
.h_100\%:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) {
|
|
1035
|
+
height: 100%;
|
|
1040
1036
|
}
|
|
1041
1037
|
|
|
1042
|
-
.
|
|
1043
|
-
|
|
1038
|
+
.p_4:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) {
|
|
1039
|
+
padding: var(--spacing-4);
|
|
1044
1040
|
}
|
|
1045
1041
|
|
|
1046
|
-
.
|
|
1047
|
-
|
|
1042
|
+
.bd-b_none:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) {
|
|
1043
|
+
border-bottom: var(--borders-none);
|
|
1048
1044
|
}
|
|
1049
1045
|
|
|
1050
|
-
.
|
|
1051
|
-
|
|
1046
|
+
.z_0:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) {
|
|
1047
|
+
z-index: 0;
|
|
1052
1048
|
}
|
|
1053
1049
|
|
|
1054
1050
|
.tch-a_none:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) {
|
|
1055
1051
|
touch-action: none;
|
|
1056
1052
|
}
|
|
1057
1053
|
|
|
1058
|
-
.
|
|
1059
|
-
|
|
1054
|
+
.bx-sh_overlay:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) {
|
|
1055
|
+
box-shadow: var(--shadows-overlay);
|
|
1056
|
+
}
|
|
1057
|
+
|
|
1058
|
+
.op_0\.5:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) {
|
|
1059
|
+
opacity: 0.5;
|
|
1060
|
+
}
|
|
1061
|
+
|
|
1062
|
+
.m_15px_auto:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) {
|
|
1063
|
+
margin: 15px auto;
|
|
1060
1064
|
}
|
|
1061
1065
|
|
|
1062
1066
|
.h_1\.5:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) {
|
|
@@ -1079,6 +1083,11 @@ html:not(#\#),body:not(#\#) {
|
|
|
1079
1083
|
background: #bebebe;
|
|
1080
1084
|
}
|
|
1081
1085
|
|
|
1086
|
+
.us_none:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) {
|
|
1087
|
+
-webkit-user-select: none;
|
|
1088
|
+
user-select: none;
|
|
1089
|
+
}
|
|
1090
|
+
|
|
1082
1091
|
.ap_none:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) {
|
|
1083
1092
|
appearance: none;
|
|
1084
1093
|
-webkit-appearance: none;
|
|
@@ -1108,11 +1117,6 @@ html:not(#\#),body:not(#\#) {
|
|
|
1108
1117
|
position: relative;
|
|
1109
1118
|
}
|
|
1110
1119
|
|
|
1111
|
-
.us_none:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) {
|
|
1112
|
-
-webkit-user-select: none;
|
|
1113
|
-
user-select: none;
|
|
1114
|
-
}
|
|
1115
|
-
|
|
1116
1120
|
.va_middle:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) {
|
|
1117
1121
|
vertical-align: middle;
|
|
1118
1122
|
}
|
|
@@ -1269,6 +1273,10 @@ html:not(#\#),body:not(#\#) {
|
|
|
1269
1273
|
pointer-events: none;
|
|
1270
1274
|
}
|
|
1271
1275
|
|
|
1276
|
+
.pointer-events_auto:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) {
|
|
1277
|
+
pointer-events: auto;
|
|
1278
|
+
}
|
|
1279
|
+
|
|
1272
1280
|
.pos_absolute:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) {
|
|
1273
1281
|
position: absolute;
|
|
1274
1282
|
}
|
|
@@ -1302,16 +1310,24 @@ html:not(#\#),body:not(#\#) {
|
|
|
1302
1310
|
background: var(--colors-shadow-overlay);
|
|
1303
1311
|
}
|
|
1304
1312
|
|
|
1313
|
+
.pos_fixed:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) {
|
|
1314
|
+
position: fixed;
|
|
1315
|
+
}
|
|
1316
|
+
|
|
1305
1317
|
.w_100vw:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) {
|
|
1306
1318
|
width: 100vw;
|
|
1307
1319
|
}
|
|
1308
1320
|
|
|
1321
|
+
.z_overlay:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) {
|
|
1322
|
+
z-index: var(--z-index-overlay);
|
|
1323
|
+
}
|
|
1324
|
+
|
|
1309
1325
|
.ov_auto:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) {
|
|
1310
1326
|
overflow: auto;
|
|
1311
1327
|
}
|
|
1312
1328
|
|
|
1313
|
-
.
|
|
1314
|
-
|
|
1329
|
+
.z_modal:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) {
|
|
1330
|
+
z-index: var(--z-index-modal);
|
|
1315
1331
|
}
|
|
1316
1332
|
|
|
1317
1333
|
.min-w_xs:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) {
|
|
@@ -1346,6 +1362,10 @@ html:not(#\#),body:not(#\#) {
|
|
|
1346
1362
|
padding: 8px;
|
|
1347
1363
|
}
|
|
1348
1364
|
|
|
1365
|
+
.w_100\%:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) {
|
|
1366
|
+
width: 100%;
|
|
1367
|
+
}
|
|
1368
|
+
|
|
1349
1369
|
.cursor_text:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) {
|
|
1350
1370
|
cursor: text;
|
|
1351
1371
|
}
|
|
@@ -1410,10 +1430,6 @@ html:not(#\#),body:not(#\#) {
|
|
|
1410
1430
|
color: var(--colors-content-neutral-subtlest);
|
|
1411
1431
|
}
|
|
1412
1432
|
|
|
1413
|
-
.bg_surface\.layer_1:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) {
|
|
1414
|
-
background: var(--colors-surface-layer_1);
|
|
1415
|
-
}
|
|
1416
|
-
|
|
1417
1433
|
.z_10:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) {
|
|
1418
1434
|
z-index: 10;
|
|
1419
1435
|
}
|
|
@@ -1516,6 +1532,10 @@ html:not(#\#),body:not(#\#) {
|
|
|
1516
1532
|
flex: 1 1 0%;
|
|
1517
1533
|
}
|
|
1518
1534
|
|
|
1535
|
+
.ov_hidden:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) {
|
|
1536
|
+
overflow: hidden;
|
|
1537
|
+
}
|
|
1538
|
+
|
|
1519
1539
|
.tov_ellipsis:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) {
|
|
1520
1540
|
text-overflow: ellipsis;
|
|
1521
1541
|
}
|
|
@@ -1612,10 +1632,6 @@ html:not(#\#),body:not(#\#) {
|
|
|
1612
1632
|
color: var(--colors-content-neutral-inverse-bold);
|
|
1613
1633
|
}
|
|
1614
1634
|
|
|
1615
|
-
.bx-sh_overlay:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) {
|
|
1616
|
-
box-shadow: var(--shadows-overlay);
|
|
1617
|
-
}
|
|
1618
|
-
|
|
1619
1635
|
.anim_fadeIn_0\.25s_ease-out:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) {
|
|
1620
1636
|
animation: fadeIn 0.25s ease-out;
|
|
1621
1637
|
}
|
|
@@ -1964,16 +1980,28 @@ html:not(#\#),body:not(#\#) {
|
|
|
1964
1980
|
row-gap: var(--spacing-10);
|
|
1965
1981
|
}
|
|
1966
1982
|
|
|
1967
|
-
.bg-
|
|
1968
|
-
background-color:
|
|
1983
|
+
.bg-c_skyblue:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) {
|
|
1984
|
+
background-color: skyblue;
|
|
1969
1985
|
}
|
|
1970
1986
|
|
|
1971
|
-
.
|
|
1972
|
-
top:
|
|
1987
|
+
.bdr-tl_20:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) {
|
|
1988
|
+
border-top-left-radius: 20px;
|
|
1973
1989
|
}
|
|
1974
1990
|
|
|
1975
|
-
.
|
|
1976
|
-
|
|
1991
|
+
.bdr-tr_20:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) {
|
|
1992
|
+
border-top-right-radius: 20px;
|
|
1993
|
+
}
|
|
1994
|
+
|
|
1995
|
+
.fw_bold:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) {
|
|
1996
|
+
font-weight: var(--font-weights-bold);
|
|
1997
|
+
}
|
|
1998
|
+
|
|
1999
|
+
.bg-c_surface\.layer_1:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) {
|
|
2000
|
+
background-color: var(--colors-surface-layer_1);
|
|
2001
|
+
}
|
|
2002
|
+
|
|
2003
|
+
.bg-c_shadow\.overlay:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) {
|
|
2004
|
+
background-color: var(--colors-shadow-overlay);
|
|
1977
2005
|
}
|
|
1978
2006
|
|
|
1979
2007
|
.fw_semibold:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) {
|
|
@@ -2043,6 +2071,10 @@ html:not(#\#),body:not(#\#) {
|
|
|
2043
2071
|
top: 50%;
|
|
2044
2072
|
}
|
|
2045
2073
|
|
|
2074
|
+
.top_0:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) {
|
|
2075
|
+
top: var(--spacing-0);
|
|
2076
|
+
}
|
|
2077
|
+
|
|
2046
2078
|
.left_0:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) {
|
|
2047
2079
|
left: var(--spacing-0);
|
|
2048
2080
|
}
|
|
@@ -2219,6 +2251,10 @@ html:not(#\#),body:not(#\#) {
|
|
|
2219
2251
|
gap: var(--spacing-10);
|
|
2220
2252
|
}
|
|
2221
2253
|
|
|
2254
|
+
.\[\&_\[data-rsbs-backdrop\]\]\:bg_rgba\(0\,_0\,_0\,_0\.6\):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) [data-rsbs-backdrop] {
|
|
2255
|
+
background: rgba(0, 0, 0, 0.6);
|
|
2256
|
+
}
|
|
2257
|
+
|
|
2222
2258
|
.hidden\:d_none:is([hidden]):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) {
|
|
2223
2259
|
display: none;
|
|
2224
2260
|
}
|
|
@@ -4,3 +4,8 @@ declare const meta: Meta<typeof BottomSheet>;
|
|
|
4
4
|
export default meta;
|
|
5
5
|
type Story = StoryObj<BottomSheetProps>;
|
|
6
6
|
export declare const Basic: Story;
|
|
7
|
+
export declare const WithoutHandle: Story;
|
|
8
|
+
export declare const CustomRounded: Story;
|
|
9
|
+
export declare const WithoutDefaultPadding: Story;
|
|
10
|
+
export declare const CustomDesignWithScroller: Story;
|
|
11
|
+
export declare const DisableBackdropBlocking: Story;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { RecipeVariantProps } from '../../../styled-system/css';
|
|
2
|
+
export type BottomSheetVariantProps = RecipeVariantProps<typeof bottomSheetRecipe>;
|
|
3
|
+
export declare const bottomSheetRecipe: import('../../../styled-system/types').SlotRecipeRuntimeFn<"header" | "content" | "container" | "backdrop" | "root", {
|
|
4
|
+
fullHeight: {
|
|
5
|
+
true: {
|
|
6
|
+
container: {
|
|
7
|
+
height: "100%";
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
}>;
|
|
@@ -1,42 +1,36 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
* onClose: 바텀시트 close시 callback
|
|
7
|
-
*/
|
|
8
|
-
onClose?: () => void;
|
|
9
|
-
/**
|
|
10
|
-
* onOpen: 바텀시트 open시 callback
|
|
11
|
-
*/
|
|
12
|
-
onOpen?: () => void;
|
|
1
|
+
import { ComponentProps, ReactNode } from 'react';
|
|
2
|
+
import { Sheet } from './src';
|
|
3
|
+
import { BottomSheetVariantProps } from './bottomsheet.recipe';
|
|
4
|
+
import { HTMLStyledProps } from '../../../styled-system/jsx';
|
|
5
|
+
export type BottomSheetProps = Omit<ComponentProps<typeof Sheet>, 'children'> & BottomSheetVariantProps & {
|
|
13
6
|
children: ReactNode;
|
|
14
|
-
className?: string;
|
|
15
|
-
css?: Styles;
|
|
16
|
-
style?: CSSProperties;
|
|
17
|
-
/**
|
|
18
|
-
* snapPercent: window 높이 기준 바텀시트 최소 / 최대 스냅 퍼센트 (default: min: DEFAULT_MIN_SNAP, max: DEFAULT_MIN_SNAP)
|
|
19
|
-
*/
|
|
20
7
|
snapPercent?: {
|
|
21
|
-
min
|
|
22
|
-
max
|
|
8
|
+
min: number;
|
|
9
|
+
max: number;
|
|
23
10
|
};
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
* hideHandle: 바텀시트 핸들 숨기기 설정 (true, false(default))
|
|
34
|
-
*/
|
|
35
|
-
hideHandle?: boolean;
|
|
36
|
-
/**
|
|
37
|
-
* expendOnContentDrag: 컨텐츠 스크롤 시 바텀시트 드래깅 여부 설정 (true, false(default))
|
|
38
|
-
*/
|
|
39
|
-
expendOnContentDrag?: boolean;
|
|
11
|
+
rounded?: number;
|
|
12
|
+
onClose?: () => void;
|
|
13
|
+
};
|
|
14
|
+
interface BottomSheetComponent extends React.ForwardRefExoticComponent<BottomSheetProps & React.RefAttributes<HTMLDivElement>> {
|
|
15
|
+
Header: typeof Header;
|
|
16
|
+
Content: typeof Content;
|
|
17
|
+
Backdrop: typeof Backdrop;
|
|
18
|
+
Handle: typeof Handle;
|
|
19
|
+
Scroller: typeof Sheet.Scroller;
|
|
40
20
|
}
|
|
41
|
-
declare const BottomSheet:
|
|
21
|
+
declare const BottomSheet: BottomSheetComponent;
|
|
22
|
+
declare const Header: import('react').ForwardRefExoticComponent<{
|
|
23
|
+
fullHeight?: boolean | undefined;
|
|
24
|
+
} & {
|
|
25
|
+
children: ReactNode;
|
|
26
|
+
className?: string;
|
|
27
|
+
} & import('react').RefAttributes<HTMLDivElement>>;
|
|
28
|
+
type ContentProps = ComponentProps<typeof Sheet.Content> & HTMLStyledProps<'div'>;
|
|
29
|
+
declare const Content: import('react').ForwardRefExoticComponent<Omit<ContentProps, "ref"> & import('react').RefAttributes<HTMLStyledProps<"div">>>;
|
|
30
|
+
type BackdropProps = ComponentProps<typeof Sheet.Backdrop> & {
|
|
31
|
+
opacity?: number;
|
|
32
|
+
disableCloseOnTap?: boolean;
|
|
33
|
+
};
|
|
34
|
+
declare const Backdrop: import('react').ForwardRefExoticComponent<Omit<BackdropProps, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
|
|
35
|
+
declare const Handle: () => import("react/jsx-runtime").JSX.Element;
|
|
42
36
|
export default BottomSheet;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare const SheetContainer: import('react').ForwardRefExoticComponent<Omit<import('motion/react').MotionProps & {
|
|
2
|
+
className?: string;
|
|
3
|
+
}, "animate" | "initial" | "exit" | "onAnimationComplete"> & {
|
|
4
|
+
children: import('react').ReactNode;
|
|
5
|
+
} & import('react').RefAttributes<any>>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare const SheetContent: import('react').ForwardRefExoticComponent<Omit<import('motion/react').MotionProps & {
|
|
2
|
+
className?: string;
|
|
3
|
+
}, "onDrag" | "onDragEnd" | "onDragStart" | "drag" | "dragConstraints" | "dragElastic" | "dragMomentum"> & {
|
|
4
|
+
children?: import('react').ReactNode;
|
|
5
|
+
disableDrag?: boolean;
|
|
6
|
+
} & import('react').RefAttributes<any>>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare const SheetHeader: import('react').ForwardRefExoticComponent<Omit<import('motion/react').MotionProps & {
|
|
2
|
+
className?: string;
|
|
3
|
+
}, "onDrag" | "onDragEnd" | "onDragStart" | "drag" | "dragConstraints" | "dragElastic" | "dragMomentum"> & {
|
|
4
|
+
children?: import('react').ReactNode;
|
|
5
|
+
disableDrag?: boolean;
|
|
6
|
+
} & import('react').RefAttributes<any>>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare const MAX_HEIGHT = "calc(100% - env(safe-area-inset-top))";
|
|
2
|
+
export declare const IS_SSR: boolean;
|
|
3
|
+
export declare const DEFAULT_TWEEN_CONFIG: {
|
|
4
|
+
ease: string;
|
|
5
|
+
duration: number;
|
|
6
|
+
};
|
|
7
|
+
export declare const REDUCED_MOTION_TWEEN_CONFIG: {
|
|
8
|
+
ease: string;
|
|
9
|
+
duration: number;
|
|
10
|
+
};
|
|
11
|
+
export declare const DEFAULT_DRAG_CLOSE_THRESHOLD = 0.6;
|
|
12
|
+
export declare const DEFAULT_DRAG_VELOCITY_THRESHOLD = 500;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { SheetScrollerContextType, SheetContextType } from './types';
|
|
3
|
+
export declare const SheetContext: import('react').Context<SheetContextType | undefined>;
|
|
4
|
+
export declare const useSheetContext: () => SheetContextType;
|
|
5
|
+
export declare const SheetScrollerContext: import('react').Context<SheetScrollerContextType | undefined>;
|
|
6
|
+
export declare function SheetScrollerContextProvider({ children }: {
|
|
7
|
+
children: ReactNode;
|
|
8
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export declare const useSheetScrollerContext: () => SheetScrollerContextType;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { RefObject, useEffect } from 'react';
|
|
2
|
+
import { MotionValue, BoundingBox } from 'motion/react';
|
|
3
|
+
import { SheetEvents } from './types';
|
|
4
|
+
export declare const useIsomorphicLayoutEffect: typeof useEffect;
|
|
5
|
+
export declare function useModalEffect({ y, rootId, sheetRef, }: {
|
|
6
|
+
y: MotionValue<number>;
|
|
7
|
+
rootId?: string;
|
|
8
|
+
sheetRef: RefObject<HTMLDivElement | null>;
|
|
9
|
+
}): void;
|
|
10
|
+
export declare function useEventCallbacks(isOpen: boolean, callbacks: RefObject<SheetEvents>): {
|
|
11
|
+
handleAnimationComplete: () => void;
|
|
12
|
+
};
|
|
13
|
+
export declare function useDimensions(): {
|
|
14
|
+
height: number;
|
|
15
|
+
width: number;
|
|
16
|
+
};
|
|
17
|
+
export declare function usePrevious<T>(state: T): T | undefined;
|
|
18
|
+
export declare function useEffectEvent<T extends (...args: any[]) => any>(handler: T): T;
|
|
19
|
+
export declare function useDragConstraints(): {
|
|
20
|
+
constraintsRef: import('react').MutableRefObject<any>;
|
|
21
|
+
onMeasureDragConstraints: () => BoundingBox;
|
|
22
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { MotionValue } from 'motion/react';
|
|
2
|
+
import { SheetCompound, SheetDraggableProps } from './types';
|
|
3
|
+
export interface SheetRef {
|
|
4
|
+
y: MotionValue<number>;
|
|
5
|
+
snapTo: (index: number) => void;
|
|
6
|
+
}
|
|
7
|
+
export declare const Sheet: SheetCompound;
|
|
8
|
+
export type SheetHeaderProps = SheetDraggableProps;
|
|
9
|
+
export type SheetContentProps = SheetDraggableProps;
|
|
10
|
+
export type { SheetProps, SheetBackdropProps, SheetScrollerProps, SheetContainerProps, } from './types';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export declare const Sheet: import('react').ForwardRefExoticComponent<{
|
|
2
|
+
isOpen: boolean;
|
|
3
|
+
children: import('react').ReactNode;
|
|
4
|
+
onClose: () => void;
|
|
5
|
+
rootId?: string;
|
|
6
|
+
mountPoint?: Element;
|
|
7
|
+
snapPoints?: number[];
|
|
8
|
+
detent?: import('./types').SheetDetent;
|
|
9
|
+
initialSnap?: number;
|
|
10
|
+
tweenConfig?: import('./types').SheetTweenConfig;
|
|
11
|
+
disableDrag?: boolean;
|
|
12
|
+
disableScrollLocking?: boolean;
|
|
13
|
+
prefersReducedMotion?: boolean;
|
|
14
|
+
dragVelocityThreshold?: number;
|
|
15
|
+
dragCloseThreshold?: number;
|
|
16
|
+
} & import('./types').SheetEvents & Omit<Omit<import('motion/react').HTMLMotionProps<"div">, "ref"> & import('react').RefAttributes<HTMLDivElement>, "ref"> & import('react').RefAttributes<any>>;
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { ComponentPropsWithoutRef, ForwardRefExoticComponent, HTMLAttributes, MutableRefObject, ReactNode, RefAttributes } from 'react';
|
|
2
|
+
import { DragHandlers, MotionValue, MotionProps, motion, EasingDefinition, Transition } from 'motion/react';
|
|
3
|
+
export interface SheetEvents {
|
|
4
|
+
onOpenStart?: () => void;
|
|
5
|
+
onOpenEnd?: () => void;
|
|
6
|
+
onCloseStart?: () => void;
|
|
7
|
+
onCloseEnd?: () => void;
|
|
8
|
+
onSnap?: (index: number) => void;
|
|
9
|
+
}
|
|
10
|
+
export type SheetDetent = 'full-height' | 'content-height';
|
|
11
|
+
type CommonProps = MotionProps & {
|
|
12
|
+
className?: string;
|
|
13
|
+
};
|
|
14
|
+
export interface SheetTweenConfig {
|
|
15
|
+
ease: EasingDefinition;
|
|
16
|
+
duration: number;
|
|
17
|
+
}
|
|
18
|
+
export type SheetProps = {
|
|
19
|
+
isOpen: boolean;
|
|
20
|
+
children: ReactNode;
|
|
21
|
+
onClose: () => void;
|
|
22
|
+
rootId?: string;
|
|
23
|
+
mountPoint?: Element;
|
|
24
|
+
snapPoints?: number[];
|
|
25
|
+
detent?: SheetDetent;
|
|
26
|
+
initialSnap?: number;
|
|
27
|
+
tweenConfig?: SheetTweenConfig;
|
|
28
|
+
disableDrag?: boolean;
|
|
29
|
+
disableScrollLocking?: boolean;
|
|
30
|
+
prefersReducedMotion?: boolean;
|
|
31
|
+
dragVelocityThreshold?: number;
|
|
32
|
+
dragCloseThreshold?: number;
|
|
33
|
+
} & SheetEvents & ComponentPropsWithoutRef<typeof motion.div>;
|
|
34
|
+
export type SheetContainerProps = Omit<CommonProps, 'initial' | 'animate' | 'exit' | 'onAnimationComplete'> & {
|
|
35
|
+
children: ReactNode;
|
|
36
|
+
};
|
|
37
|
+
export type SheetDraggableProps = Omit<CommonProps, 'drag' | 'dragElastic' | 'dragConstraints' | 'dragMomentum' | 'onDrag' | 'onDragStart' | 'onDragEnd'> & {
|
|
38
|
+
children?: ReactNode;
|
|
39
|
+
disableDrag?: boolean;
|
|
40
|
+
};
|
|
41
|
+
export type SheetBackdropProps = Omit<CommonProps, 'initial' | 'animate' | 'exit'>;
|
|
42
|
+
export type SheetScrollerProps = HTMLAttributes<HTMLDivElement> & {
|
|
43
|
+
draggableAt?: 'top' | 'bottom' | 'both';
|
|
44
|
+
};
|
|
45
|
+
export interface SheetDragProps {
|
|
46
|
+
drag: 'y';
|
|
47
|
+
dragElastic: number;
|
|
48
|
+
dragMomentum: boolean;
|
|
49
|
+
dragPropagation: boolean;
|
|
50
|
+
onDrag: DragHandlers['onDrag'];
|
|
51
|
+
onDragStart: DragHandlers['onDragStart'];
|
|
52
|
+
onDragEnd: DragHandlers['onDragEnd'];
|
|
53
|
+
}
|
|
54
|
+
export interface SheetContextType {
|
|
55
|
+
y: MotionValue<any>;
|
|
56
|
+
sheetRef: MutableRefObject<any>;
|
|
57
|
+
isOpen: boolean;
|
|
58
|
+
snapPoints: SheetProps['snapPoints'];
|
|
59
|
+
detent: SheetDetent;
|
|
60
|
+
initialSnap: SheetProps['initialSnap'];
|
|
61
|
+
indicatorRotation: MotionValue<number>;
|
|
62
|
+
callbacks: MutableRefObject<SheetEvents>;
|
|
63
|
+
dragProps?: SheetDragProps;
|
|
64
|
+
windowHeight: number;
|
|
65
|
+
animationOptions: Transition;
|
|
66
|
+
reduceMotion: boolean;
|
|
67
|
+
disableDrag: boolean;
|
|
68
|
+
}
|
|
69
|
+
export interface SheetScrollerContextType {
|
|
70
|
+
disableDrag: boolean;
|
|
71
|
+
setDragDisabled: () => void;
|
|
72
|
+
setDragEnabled: () => void;
|
|
73
|
+
}
|
|
74
|
+
type ContainerComponent = ForwardRefExoticComponent<SheetContainerProps & RefAttributes<any>>;
|
|
75
|
+
type DraggableComponent = ForwardRefExoticComponent<SheetDraggableProps & RefAttributes<any>>;
|
|
76
|
+
type BackdropComponent = ForwardRefExoticComponent<SheetBackdropProps & RefAttributes<any>>;
|
|
77
|
+
type SheetComponent = ForwardRefExoticComponent<SheetProps & RefAttributes<any>>;
|
|
78
|
+
type ScrollerComponent = ForwardRefExoticComponent<SheetScrollerProps & RefAttributes<any>>;
|
|
79
|
+
interface SheetCompoundComponent {
|
|
80
|
+
Container: ContainerComponent;
|
|
81
|
+
Header: DraggableComponent;
|
|
82
|
+
Content: DraggableComponent;
|
|
83
|
+
Backdrop: BackdropComponent;
|
|
84
|
+
Scroller: ScrollerComponent;
|
|
85
|
+
}
|
|
86
|
+
export type SheetCompound = SheetComponent & SheetCompoundComponent;
|
|
87
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
interface PreventScrollOptions {
|
|
2
|
+
/** Whether the scroll lock is disabled. */
|
|
3
|
+
isDisabled?: boolean;
|
|
4
|
+
}
|
|
5
|
+
export declare function isScrollable(node: Element | null, checkForOverflow?: boolean): boolean;
|
|
6
|
+
export declare function getScrollParent(node: Element, checkForOverflow?: boolean): Element;
|
|
7
|
+
/**
|
|
8
|
+
* Prevents scrolling on the document body on mount, and
|
|
9
|
+
* restores it on unmount. Also ensures that content does not
|
|
10
|
+
* shift due to the scrollbars disappearing.
|
|
11
|
+
*/
|
|
12
|
+
export declare function usePreventScroll(options?: PreventScrollOptions): void;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ForwardedRef, RefCallback } from 'react';
|
|
2
|
+
export declare function getClosest(nums: number[], goal: number): number;
|
|
3
|
+
export declare function inDescendingOrder(arr: number[]): boolean;
|
|
4
|
+
export declare function validateSnapTo({ snapTo, sheetHeight, }: {
|
|
5
|
+
snapTo: number;
|
|
6
|
+
sheetHeight: number;
|
|
7
|
+
}): number;
|
|
8
|
+
export declare function mergeRefs<T = any>(refs: ForwardedRef<T>[]): RefCallback<T>;
|
|
9
|
+
export declare function isTouchDevice(): boolean;
|
|
10
|
+
export declare const isIOS: () => boolean;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { RecipeVariantProps } from '../../../styled-system/css';
|
|
2
2
|
export type NavigationVariantProps = RecipeVariantProps<typeof navigationRecipe>;
|
|
3
|
-
export declare const navigationRecipe: import('../../../styled-system/types').SlotRecipeRuntimeFn<"list" | "content" | "trigger" | "
|
|
3
|
+
export declare const navigationRecipe: import('../../../styled-system/types').SlotRecipeRuntimeFn<"list" | "content" | "trigger" | "indicator" | "root", import('../../../styled-system/types').SlotRecipeVariantRecord<"list" | "content" | "trigger" | "indicator" | "root">>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { RecipeVariantProps } from '../../../styled-system/css';
|
|
2
2
|
export type TabsVariantProps = RecipeVariantProps<typeof tabsRecipe>;
|
|
3
|
-
export declare const tabsRecipe: import('../../../styled-system/types').SlotRecipeRuntimeFn<"list" | "content" | "trigger" | "
|
|
3
|
+
export declare const tabsRecipe: import('../../../styled-system/types').SlotRecipeRuntimeFn<"list" | "content" | "trigger" | "indicator" | "root", {
|
|
4
4
|
variant: {
|
|
5
5
|
line: {
|
|
6
6
|
list: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nation-a/ui",
|
|
3
|
-
"version": "0.11.
|
|
3
|
+
"version": "0.11.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.cjs",
|
|
6
6
|
"module": "./dist/index.js",
|
|
@@ -14,6 +14,8 @@
|
|
|
14
14
|
"dependencies": {
|
|
15
15
|
"@ark-ui/react": "^5.1.0",
|
|
16
16
|
"@react-spring/web": "^9.7.5",
|
|
17
|
+
"csstype": "^3.1.3",
|
|
18
|
+
"motion": "^12.6.3",
|
|
17
19
|
"react": "^18.3.1",
|
|
18
20
|
"react-dom": "^18.3.1",
|
|
19
21
|
"@nation-a/icons": "0.2.0",
|