@fluentui-react-native/drawer 0.4.19 → 0.5.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.
Files changed (50) hide show
  1. package/CHANGELOG.md +40 -0
  2. package/lib/Drawer.d.ts +7 -2
  3. package/lib/Drawer.d.ts.map +1 -1
  4. package/lib/Drawer.js +39 -27
  5. package/lib/Drawer.js.map +1 -1
  6. package/lib/Drawer.styling.d.ts +1 -1
  7. package/lib/Drawer.styling.js +51 -42
  8. package/lib/Drawer.types.d.ts +179 -168
  9. package/lib/Drawer.types.d.ts.map +1 -1
  10. package/lib/Drawer.types.js +1 -1
  11. package/lib/Drawer.types.js.map +1 -1
  12. package/lib/DrawerTokens.d.ts +1 -1
  13. package/lib/DrawerTokens.js +32 -32
  14. package/lib/DrawerTokens.js.map +1 -1
  15. package/lib/__tests__/Drawer.test.d.ts +1 -1
  16. package/lib/__tests__/Drawer.test.js +12 -8
  17. package/lib/__tests__/Drawer.test.js.map +1 -1
  18. package/lib/index.d.ts +1 -1
  19. package/lib/index.js +1 -1
  20. package/lib/useDrawer.d.ts +1 -1
  21. package/lib/useDrawer.d.ts.map +1 -1
  22. package/lib/useDrawer.js +72 -67
  23. package/lib/useDrawer.js.map +1 -1
  24. package/lib-commonjs/Drawer.d.ts +7 -2
  25. package/lib-commonjs/Drawer.d.ts.map +1 -1
  26. package/lib-commonjs/Drawer.js +48 -33
  27. package/lib-commonjs/Drawer.js.map +1 -1
  28. package/lib-commonjs/Drawer.styling.d.ts +1 -1
  29. package/lib-commonjs/Drawer.styling.js +56 -47
  30. package/lib-commonjs/Drawer.types.d.ts +179 -168
  31. package/lib-commonjs/Drawer.types.d.ts.map +1 -1
  32. package/lib-commonjs/Drawer.types.js +3 -3
  33. package/lib-commonjs/Drawer.types.js.map +1 -1
  34. package/lib-commonjs/DrawerTokens.d.ts +1 -1
  35. package/lib-commonjs/DrawerTokens.js +35 -35
  36. package/lib-commonjs/DrawerTokens.js.map +1 -1
  37. package/lib-commonjs/__tests__/Drawer.test.d.ts +1 -1
  38. package/lib-commonjs/__tests__/Drawer.test.js +66 -35
  39. package/lib-commonjs/__tests__/Drawer.test.js.map +1 -1
  40. package/lib-commonjs/index.d.ts +1 -1
  41. package/lib-commonjs/index.js +17 -7
  42. package/lib-commonjs/index.js.map +1 -1
  43. package/lib-commonjs/useDrawer.d.ts +1 -1
  44. package/lib-commonjs/useDrawer.d.ts.map +1 -1
  45. package/lib-commonjs/useDrawer.js +76 -71
  46. package/lib-commonjs/useDrawer.js.map +1 -1
  47. package/package.json +61 -60
  48. package/src/Drawer.tsx +2 -3
  49. package/src/Drawer.types.ts +4 -3
  50. package/src/__tests__/Drawer.test.tsx +7 -6
@@ -1,184 +1,195 @@
1
- import type { Animated, ColorValue, DimensionValue, FlexAlignType, ModalProps, TouchableWithoutFeedbackProps, ViewProps } from 'react-native';
1
+ import type {
2
+ AnimatableNumericValue,
3
+ Animated,
4
+ ColorValue,
5
+ DimensionValue,
6
+ FlexAlignType,
7
+ ModalProps,
8
+ TouchableWithoutFeedbackProps,
9
+ ViewProps,
10
+ } from 'react-native';
2
11
  import type { InteractionEvent, PressableFocusProps } from '@fluentui-react-native/interactive-hooks';
3
- export declare const DrawerName = "Drawer";
12
+ export declare const DrawerName = 'Drawer';
4
13
  /**
5
14
  * Specifies the possible position of the Drawer.
6
15
  */
7
16
  export type DrawerPositionType = 'bottom' | 'left' | 'right';
8
17
  export interface DrawerTokens {
9
- /**
10
- * The color of the scrim.
11
- * */
12
- scrimColor?: ColorValue;
13
- /**
14
- * The opacity of the scrim.
15
- * */
16
- scrimOpacity?: number;
17
- /**
18
- * Width of the handle.
19
- */
20
- handleWidth?: number;
21
- /**
22
- * Height of the handle.
23
- */
24
- handleHeight?: number;
25
- /**
26
- * The background color of the handle.
27
- * */
28
- handleBackgroundColor?: ColorValue;
29
- /**
30
- * The corner radius of the handle.
31
- * */
32
- handleCornerRadius?: number;
33
- /**
34
- * The top margin of the handle.
35
- * */
36
- handleMarginTop?: number;
37
- /**
38
- * The bottom margin of the handle.
39
- * */
40
- handleMarginBottom?: number;
41
- /**
42
- * The start margin of the handle.
43
- * */
44
- handleMarginStart?: number;
45
- /**
46
- * The end margin of the handle.
47
- * */
48
- handleMarginEnd?: number;
49
- /**
50
- * The flex alignment of the handle.
51
- * */
52
- handleAlignment?: FlexAlignType;
53
- /**
54
- * The background for drawer
55
- * */
56
- drawerBackgroundColor?: ColorValue;
57
- /**
58
- * The corner radius of the Drawer
59
- * @default 0
60
- * */
61
- drawerCornerRadius?: number;
62
- /**
63
- * The elevation of the Drawer
64
- * @default 5
65
- * @platform android
66
- * */
67
- drawerElevation?: number;
68
- /**
69
- * The width of the Drawer
70
- * Note: Only applicable when position is 'left' or 'right'
71
- * @default '100%'
72
- * */
73
- width?: DimensionValue;
74
- /**
75
- * The height of the Drawer
76
- * Note: Only applicable when position is 'bottom'
77
- * @default '40%'
78
- * */
79
- height?: DimensionValue;
80
- /**
81
- * The shadow color of the Drawer
82
- * @platform iOS
83
- * */
84
- shadowColor?: ColorValue;
85
- /**
86
- * The shadow offset of the Drawer
87
- * @platform iOS
88
- * */
89
- shadowOffset?: {
90
- width: number;
91
- height: number;
92
- };
93
- /**
94
- * The shadow opacity of the Drawer
95
- * @platform iOS
96
- * */
97
- shadowOpacity?: number;
98
- /**
99
- * The shadow radius of the Drawer
100
- * @platform iOS
101
- * */
102
- shadowRadius?: number;
103
- /**
104
- * Positions/Behaviours of the Drawer, This is used to apply different tokens for different positions.
105
- */
106
- left?: DrawerTokens;
107
- right?: DrawerTokens;
108
- bottom?: DrawerTokens;
109
- /**
110
- * Coordinate position of the Drawer, This is used to position the Drawer at a particular coordinate.
111
- */
112
- leftPosition?: number;
113
- rightPosition?: number;
114
- bottomPosition?: number;
115
- topPosition?: number;
18
+ /**
19
+ * The color of the scrim.
20
+ * */
21
+ scrimColor?: ColorValue;
22
+ /**
23
+ * The opacity of the scrim.
24
+ * */
25
+ scrimOpacity?: number;
26
+ /**
27
+ * Width of the handle.
28
+ */
29
+ handleWidth?: number;
30
+ /**
31
+ * Height of the handle.
32
+ */
33
+ handleHeight?: number;
34
+ /**
35
+ * The background color of the handle.
36
+ * */
37
+ handleBackgroundColor?: ColorValue;
38
+ /**
39
+ * The corner radius of the handle.
40
+ * */
41
+ handleCornerRadius?: AnimatableNumericValue | string;
42
+ /**
43
+ * The top margin of the handle.
44
+ * */
45
+ handleMarginTop?: number;
46
+ /**
47
+ * The bottom margin of the handle.
48
+ * */
49
+ handleMarginBottom?: number;
50
+ /**
51
+ * The start margin of the handle.
52
+ * */
53
+ handleMarginStart?: number;
54
+ /**
55
+ * The end margin of the handle.
56
+ * */
57
+ handleMarginEnd?: number;
58
+ /**
59
+ * The flex alignment of the handle.
60
+ * */
61
+ handleAlignment?: FlexAlignType;
62
+ /**
63
+ * The background for drawer
64
+ * */
65
+ drawerBackgroundColor?: ColorValue;
66
+ /**
67
+ * The corner radius of the Drawer
68
+ * @default 0
69
+ * */
70
+ drawerCornerRadius?: AnimatableNumericValue | string;
71
+ /**
72
+ * The elevation of the Drawer
73
+ * @default 5
74
+ * @platform android
75
+ * */
76
+ drawerElevation?: number;
77
+ /**
78
+ * The width of the Drawer
79
+ * Note: Only applicable when position is 'left' or 'right'
80
+ * @default '100%'
81
+ * */
82
+ width?: DimensionValue;
83
+ /**
84
+ * The height of the Drawer
85
+ * Note: Only applicable when position is 'bottom'
86
+ * @default '40%'
87
+ * */
88
+ height?: DimensionValue;
89
+ /**
90
+ * The shadow color of the Drawer
91
+ * @platform iOS
92
+ * */
93
+ shadowColor?: ColorValue;
94
+ /**
95
+ * The shadow offset of the Drawer
96
+ * @platform iOS
97
+ * */
98
+ shadowOffset?: {
99
+ width: number;
100
+ height: number;
101
+ };
102
+ /**
103
+ * The shadow opacity of the Drawer
104
+ * @platform iOS
105
+ * */
106
+ shadowOpacity?: number;
107
+ /**
108
+ * The shadow radius of the Drawer
109
+ * @platform iOS
110
+ * */
111
+ shadowRadius?: AnimatableNumericValue | string;
112
+ /**
113
+ * Positions/Behaviours of the Drawer, This is used to apply different tokens for different positions.
114
+ */
115
+ left?: DrawerTokens;
116
+ right?: DrawerTokens;
117
+ bottom?: DrawerTokens;
118
+ /**
119
+ * Coordinate position of the Drawer, This is used to position the Drawer at a particular coordinate.
120
+ */
121
+ leftPosition?: number;
122
+ rightPosition?: number;
123
+ bottomPosition?: number;
124
+ topPosition?: number;
116
125
  }
117
126
  export interface DrawerProps extends PressableFocusProps {
118
- accessibilityLabel?: string;
119
- /**
120
- * Visibility of the Drawer
121
- */
122
- open?: boolean;
123
- /**
124
- * Callback when the Drawer is closed
125
- * */
126
- onClose?: (e: InteractionEvent) => void;
127
- /**
128
- * Callback when the Drawer is opened
129
- * */
130
- onOpen?: (e: InteractionEvent) => void;
131
- /**
132
- * Callback when the scrim is clicked
133
- * */
134
- onScrimClick?: (e: InteractionEvent) => void;
135
- /**
136
- * The content of the Drawer
137
- * */
138
- children?: React.ReactNode;
139
- /**
140
- * The behavior of the Drawer
141
- * @default 'left'
142
- * */
143
- drawerPosition?: DrawerPositionType;
144
- /**
145
- * The behavior is for only bottom drawer in which content is scrollable without expanding the bottom drawer
146
- * @default false
147
- * */
148
- isContentScrollableUnexpanded?: boolean;
149
- /**
150
- * The behavior is for only bottom drawer in which handle can be hidden for some usecases
151
- * @default true
152
- * */
153
- showHandle?: boolean;
154
- /**
155
- * The width of the Drawer
156
- * Animation configuration for the Drawer
157
- * */
158
- animationConfig?: {
159
- animatedOpacity: Animated.AnimatedInterpolation<number>;
160
- animatedStyle: {
161
- transform: {
162
- translateX: Animated.AnimatedInterpolation<number>;
163
- }[] | {
164
- translateY: Animated.AnimatedInterpolation<number>;
165
- }[];
166
- };
127
+ accessibilityLabel?: string;
128
+ /**
129
+ * Visibility of the Drawer
130
+ */
131
+ open?: boolean;
132
+ /**
133
+ * Callback when the Drawer is closed
134
+ * */
135
+ onClose?: (e: InteractionEvent) => void;
136
+ /**
137
+ * Callback when the Drawer is opened
138
+ * */
139
+ onOpen?: (e: InteractionEvent) => void;
140
+ /**
141
+ * Callback when the scrim is clicked
142
+ * */
143
+ onScrimClick?: (e: InteractionEvent) => void;
144
+ /**
145
+ * The content of the Drawer
146
+ * */
147
+ children?: React.ReactNode;
148
+ /**
149
+ * The behavior of the Drawer
150
+ * @default 'left'
151
+ * */
152
+ drawerPosition?: DrawerPositionType;
153
+ /**
154
+ * The behavior is for only bottom drawer in which content is scrollable without expanding the bottom drawer
155
+ * @default false
156
+ * */
157
+ isContentScrollableUnexpanded?: boolean;
158
+ /**
159
+ * The behavior is for only bottom drawer in which handle can be hidden for some usecases
160
+ * @default true
161
+ * */
162
+ showHandle?: boolean;
163
+ /**
164
+ * The width of the Drawer
165
+ * Animation configuration for the Drawer
166
+ * */
167
+ animationConfig?: {
168
+ animatedOpacity: Animated.AnimatedInterpolation<number>;
169
+ animatedStyle: {
170
+ transform:
171
+ | {
172
+ translateX: Animated.AnimatedInterpolation<number>;
173
+ }[]
174
+ | {
175
+ translateY: Animated.AnimatedInterpolation<number>;
176
+ }[];
167
177
  };
178
+ };
168
179
  }
169
180
  export interface DrawerInfo {
170
- props: DrawerProps;
181
+ props: DrawerProps;
171
182
  }
172
183
  export interface DrawerSlotProps {
173
- modal: ModalProps;
174
- scrim: TouchableWithoutFeedbackProps;
175
- scrimContent: Animated.AnimatedProps<ViewProps>;
176
- content: Animated.AnimatedProps<ViewProps>;
177
- handle: ViewProps;
184
+ modal: ModalProps;
185
+ scrim: TouchableWithoutFeedbackProps;
186
+ scrimContent: Animated.AnimatedProps<ViewProps>;
187
+ content: Animated.AnimatedProps<ViewProps>;
188
+ handle: ViewProps;
178
189
  }
179
190
  export interface DrawerType {
180
- props: DrawerProps;
181
- tokens: DrawerTokens;
182
- slotProps: DrawerSlotProps;
191
+ props: DrawerProps;
192
+ tokens: DrawerTokens;
193
+ slotProps: DrawerSlotProps;
183
194
  }
184
- //# sourceMappingURL=Drawer.types.d.ts.map
195
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,CAAC,aAAa,CAAC,SAAS,CAAC,CAAC;IAC3C,MAAM,EAAE,SAAS,CAAC;CACnB;AAED,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,WAAW,CAAC;IACnB,MAAM,EAAE,YAAY,CAAC;IACrB,SAAS,EAAE,eAAe,CAAC;CAC5B"}
@@ -1,5 +1,5 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ 'use strict';
2
+ Object.defineProperty(exports, '__esModule', { value: true });
3
3
  exports.DrawerName = void 0;
4
4
  exports.DrawerName = 'Drawer';
5
- //# sourceMappingURL=Drawer.types.js.map
5
+ //# sourceMappingURL=Drawer.types.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Drawer.types.js","sourceRoot":"","sources":["../src/Drawer.types.ts"],"names":[],"mappings":";;;AAYa,QAAA,UAAU,GAAG,QAAQ,CAAC"}
1
+ {"version":3,"file":"Drawer.types.js","sourceRoot":"","sources":["../src/Drawer.types.ts"],"names":[],"mappings":";;;AAaa,QAAA,UAAU,GAAG,QAAQ,CAAC"}
@@ -2,4 +2,4 @@ import type { Theme } from '@fluentui-react-native/framework';
2
2
  import type { TokenSettings } from '@fluentui-react-native/use-styling';
3
3
  import type { DrawerTokens } from './Drawer.types';
4
4
  export declare const defaultDrawerTokens: TokenSettings<DrawerTokens, Theme>;
5
- //# sourceMappingURL=DrawerTokens.d.ts.map
5
+ //# sourceMappingURL=DrawerTokens.d.ts.map
@@ -1,39 +1,39 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ 'use strict';
2
+ Object.defineProperty(exports, '__esModule', { value: true });
3
3
  exports.defaultDrawerTokens = void 0;
4
- const theme_tokens_1 = require("@fluentui-react-native/theme-tokens");
4
+ const theme_tokens_1 = require('@fluentui-react-native/theme-tokens');
5
5
  const defaultDrawerTokens = (t) => ({
6
- scrimColor: '#00000080',
7
- drawerBackgroundColor: t.colors.neutralBackground2,
8
- handleBackgroundColor: t.colors.neutralStroke1,
9
- handleWidth: theme_tokens_1.globalTokens.size360,
10
- handleHeight: theme_tokens_1.globalTokens.size40,
11
- handleCornerRadius: theme_tokens_1.globalTokens.size20,
12
- handleAlignment: 'center',
13
- handleMarginTop: theme_tokens_1.globalTokens.size80,
14
- handleMarginBottom: theme_tokens_1.globalTokens.sizeNone,
15
- handleMarginEnd: theme_tokens_1.globalTokens.sizeNone,
16
- handleMarginStart: theme_tokens_1.globalTokens.sizeNone,
17
- drawerElevation: theme_tokens_1.globalTokens.size100,
18
- topPosition: 0,
19
- left: {
20
- height: '100%',
21
- width: '80%',
22
- leftPosition: 0,
23
- drawerCornerRadius: 0,
24
- },
25
- right: {
26
- height: '100%',
27
- width: '80%',
28
- rightPosition: 0,
29
- drawerCornerRadius: 0,
30
- },
31
- bottom: {
32
- bottomPosition: 0,
33
- width: '100%',
34
- drawerCornerRadius: theme_tokens_1.globalTokens.corner.radius120,
35
- height: '50%',
36
- },
6
+ scrimColor: '#00000080', // to be replace with token in future based on design guidance
7
+ drawerBackgroundColor: t.colors.neutralBackground2,
8
+ handleBackgroundColor: t.colors.neutralStroke1,
9
+ handleWidth: theme_tokens_1.globalTokens.size360,
10
+ handleHeight: theme_tokens_1.globalTokens.size40,
11
+ handleCornerRadius: theme_tokens_1.globalTokens.size20,
12
+ handleAlignment: 'center',
13
+ handleMarginTop: theme_tokens_1.globalTokens.size80,
14
+ handleMarginBottom: theme_tokens_1.globalTokens.sizeNone,
15
+ handleMarginEnd: theme_tokens_1.globalTokens.sizeNone,
16
+ handleMarginStart: theme_tokens_1.globalTokens.sizeNone,
17
+ drawerElevation: theme_tokens_1.globalTokens.size100,
18
+ topPosition: 0,
19
+ left: {
20
+ height: '100%',
21
+ width: '80%',
22
+ leftPosition: 0,
23
+ drawerCornerRadius: 0,
24
+ },
25
+ right: {
26
+ height: '100%',
27
+ width: '80%',
28
+ rightPosition: 0,
29
+ drawerCornerRadius: 0,
30
+ },
31
+ bottom: {
32
+ bottomPosition: 0,
33
+ width: '100%',
34
+ drawerCornerRadius: theme_tokens_1.globalTokens.corner.radius120,
35
+ height: '50%',
36
+ },
37
37
  });
38
38
  exports.defaultDrawerTokens = defaultDrawerTokens;
39
- //# sourceMappingURL=DrawerTokens.js.map
39
+ //# sourceMappingURL=DrawerTokens.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"DrawerTokens.js","sourceRoot":"","sources":["../src/DrawerTokens.ts"],"names":[],"mappings":";;;AACA,sEAAmE;AAK5D,MAAM,mBAAmB,GAAuC,CAAC,CAAQ,EAAE,EAAE,CAClF,CAAC;IACC,UAAU,EAAE,WAAW;IACvB,qBAAqB,EAAE,CAAC,CAAC,MAAM,CAAC,kBAAkB;IAClD,qBAAqB,EAAE,CAAC,CAAC,MAAM,CAAC,cAAc;IAC9C,WAAW,EAAE,2BAAY,CAAC,OAAO;IACjC,YAAY,EAAE,2BAAY,CAAC,MAAM;IACjC,kBAAkB,EAAE,2BAAY,CAAC,MAAM;IACvC,eAAe,EAAE,QAAQ;IACzB,eAAe,EAAE,2BAAY,CAAC,MAAM;IACpC,kBAAkB,EAAE,2BAAY,CAAC,QAAQ;IACzC,eAAe,EAAE,2BAAY,CAAC,QAAQ;IACtC,iBAAiB,EAAE,2BAAY,CAAC,QAAQ;IACxC,eAAe,EAAE,2BAAY,CAAC,OAAO;IACrC,WAAW,EAAE,CAAC;IACd,IAAI,EAAE;QACJ,MAAM,EAAE,MAAM;QACd,KAAK,EAAE,KAAK;QACZ,YAAY,EAAE,CAAC;QACf,kBAAkB,EAAE,CAAC;KACtB;IACD,KAAK,EAAE;QACL,MAAM,EAAE,MAAM;QACd,KAAK,EAAE,KAAK;QACZ,aAAa,EAAE,CAAC;QAChB,kBAAkB,EAAE,CAAC;KACtB;IACD,MAAM,EAAE;QACN,cAAc,EAAE,CAAC;QACjB,KAAK,EAAE,MAAM;QACb,kBAAkB,EAAE,2BAAY,CAAC,MAAM,CAAC,SAAS;QACjD,MAAM,EAAE,KAAK;KACd;CACe,CAAA,CAAC;AAjCR,QAAA,mBAAmB,uBAiCX"}
1
+ {"version":3,"file":"DrawerTokens.js","sourceRoot":"","sources":["../src/DrawerTokens.ts"],"names":[],"mappings":";;;AACA,sEAAmE;AAK5D,MAAM,mBAAmB,GAAuC,CAAC,CAAQ,EAAE,EAAE,EACjF;IACC,UAAU,EAAE,WAAW,EAAE,8DAA8D;IACvF,qBAAqB,EAAE,CAAC,CAAC,MAAM,CAAC,kBAAkB;IAClD,qBAAqB,EAAE,CAAC,CAAC,MAAM,CAAC,cAAc;IAC9C,WAAW,EAAE,2BAAY,CAAC,OAAO;IACjC,YAAY,EAAE,2BAAY,CAAC,MAAM;IACjC,kBAAkB,EAAE,2BAAY,CAAC,MAAM;IACvC,eAAe,EAAE,QAAQ;IACzB,eAAe,EAAE,2BAAY,CAAC,MAAM;IACpC,kBAAkB,EAAE,2BAAY,CAAC,QAAQ;IACzC,eAAe,EAAE,2BAAY,CAAC,QAAQ;IACtC,iBAAiB,EAAE,2BAAY,CAAC,QAAQ;IACxC,eAAe,EAAE,2BAAY,CAAC,OAAO;IACrC,WAAW,EAAE,CAAC;IACd,IAAI,EAAE;QACJ,MAAM,EAAE,MAAM;QACd,KAAK,EAAE,KAAK;QACZ,YAAY,EAAE,CAAC;QACf,kBAAkB,EAAE,CAAC;KACtB;IACD,KAAK,EAAE;QACL,MAAM,EAAE,MAAM;QACd,KAAK,EAAE,KAAK;QACZ,aAAa,EAAE,CAAC;QAChB,kBAAkB,EAAE,CAAC;KACtB;IACD,MAAM,EAAE;QACN,cAAc,EAAE,CAAC;QACjB,KAAK,EAAE,MAAM;QACb,kBAAkB,EAAE,2BAAY,CAAC,MAAM,CAAC,SAAS;QACjD,MAAM,EAAE,KAAK;KACd;CACe,CAAA,CAAC;AAjCR,QAAA,mBAAmB,GAAnB,mBAAmB,CAiCX"}
@@ -1,2 +1,2 @@
1
1
  export {};
2
- //# sourceMappingURL=Drawer.test.d.ts.map
2
+ //# sourceMappingURL=Drawer.test.d.ts.map
@@ -1,43 +1,74 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
- Object.defineProperty(exports, "__esModule", { value: true });
26
- const React = __importStar(require("react"));
27
- const react_native_1 = require("react-native");
28
- const renderer = __importStar(require("react-test-renderer"));
1
+ 'use strict';
2
+ var __createBinding =
3
+ (this && this.__createBinding) ||
4
+ (Object.create
5
+ ? function (o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ var desc = Object.getOwnPropertyDescriptor(m, k);
8
+ if (!desc || ('get' in desc ? !m.__esModule : desc.writable || desc.configurable)) {
9
+ desc = {
10
+ enumerable: true,
11
+ get: function () {
12
+ return m[k];
13
+ },
14
+ };
15
+ }
16
+ Object.defineProperty(o, k2, desc);
17
+ }
18
+ : function (o, m, k, k2) {
19
+ if (k2 === undefined) k2 = k;
20
+ o[k2] = m[k];
21
+ });
22
+ var __setModuleDefault =
23
+ (this && this.__setModuleDefault) ||
24
+ (Object.create
25
+ ? function (o, v) {
26
+ Object.defineProperty(o, 'default', { enumerable: true, value: v });
27
+ }
28
+ : function (o, v) {
29
+ o['default'] = v;
30
+ });
31
+ var __importStar =
32
+ (this && this.__importStar) ||
33
+ (function () {
34
+ var ownKeys = function (o) {
35
+ ownKeys =
36
+ Object.getOwnPropertyNames ||
37
+ function (o) {
38
+ var ar = [];
39
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
40
+ return ar;
41
+ };
42
+ return ownKeys(o);
43
+ };
44
+ return function (mod) {
45
+ if (mod && mod.__esModule) return mod;
46
+ var result = {};
47
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== 'default') __createBinding(result, mod, k[i]);
48
+ __setModuleDefault(result, mod);
49
+ return result;
50
+ };
51
+ })();
52
+ Object.defineProperty(exports, '__esModule', { value: true });
53
+ const jsx_runtime_1 = require('react/jsx-runtime');
54
+ const react_1 = require('react');
55
+ const react_native_1 = require('react-native');
56
+ const renderer = __importStar(require('react-test-renderer'));
29
57
  // import { Drawer } from '../Drawer';
30
58
  // mocks out setTimeout and other timer functions with mock functions , test will fail without this as we're using Animated API
31
59
  jest.useFakeTimers();
32
60
  // Disable Drawer test, as it's still failing despite the line above
33
61
  describe('Drawer component tests', () => {
34
- it('Drawer default', () => {
35
- const tree = renderer
36
- .create(
62
+ it('Drawer default', () => {
63
+ let component;
64
+ (0, react_1.act)(() => {
65
+ component = renderer.create(
37
66
  // <Drawer open={false} drawerPosition="left">
38
- React.createElement(react_native_1.Text, null, "Hello"))
39
- .toJSON();
40
- expect(tree).toMatchSnapshot();
67
+ jsx_runtime_1.jsx(react_native_1.Text, { children: 'Hello' }),
68
+ // </Drawer>,
69
+ );
41
70
  });
71
+ expect(component.toJSON()).toMatchSnapshot();
72
+ });
42
73
  });
43
- //# sourceMappingURL=Drawer.test.js.map
74
+ //# sourceMappingURL=Drawer.test.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Drawer.test.js","sourceRoot":"","sources":["../../src/__tests__/Drawer.test.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6CAA+B;AAC/B,+CAAoC;AAEpC,8DAAgD;AAEhD,sCAAsC;AAEtC,+HAA+H;AAC/H,IAAI,CAAC,aAAa,EAAE,CAAC;AAErB,oEAAoE;AACpE,QAAQ,CAAC,wBAAwB,EAAE,GAAG,EAAE;IACtC,EAAE,CAAC,gBAAgB,EAAE,GAAG,EAAE;QACxB,MAAM,IAAI,GAAG,QAAQ;aAClB,MAAM;QACL,8CAA8C;QAC9C,oBAAC,mBAAI,gBAAa,CAEnB;aACA,MAAM,EAAE,CAAC;QACZ,MAAM,CAAC,IAAI,CAAC,CAAC,eAAe,EAAE,CAAC;IACjC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
1
+ {"version":3,"file":"Drawer.test.js","sourceRoot":"","sources":["../../src/__tests__/Drawer.test.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iCAA4B;AAC5B,+CAAoC;AAEpC,MAAY,QAAQ,gDAA4B;AAEhD,sCAAsC;AAEtC,+HAA+H;AAC/H,IAAI,CAAC,aAAa,EAAE,CAAC;AAErB,oEAAoE;AACpE,QAAQ,CAAC,wBAAwB,EAAE,GAAG,EAAE,CAAC;IACvC,EAAE,CAAC,gBAAgB,EAAE,GAAG,EAAE,CAAC;QACzB,IAAI,SAAqC,CAAC;QAC1C,IAAA,WAAG,EAAC,GAAG,EAAE,CAAC;YACR,SAAS,GAAG,QAAQ,CAAC,MAAM;YACzB,8CAA8C;YAC9C,kBAAC,mBAAI,wBAAa;YAClB,aAAa;aACd,CAAC;QAAA,CACH,CAAC,CAAC;QACH,MAAM,CAAC,SAAU,CAAC,MAAM,EAAE,CAAC,CAAC,eAAe,EAAE,CAAC;IAAA,CAC/C,CAAC,CAAC;AAAA,CACJ,CAAC,CAAC"}
@@ -1,4 +1,4 @@
1
1
  export { Drawer } from './Drawer';
2
2
  export type { DrawerProps, DrawerSlotProps, DrawerTokens, DrawerType, DrawerPositionType } from './Drawer.types';
3
3
  export { DrawerName } from './Drawer.types';
4
- //# sourceMappingURL=index.d.ts.map
4
+ //# sourceMappingURL=index.d.ts.map
@@ -1,8 +1,18 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ 'use strict';
2
+ Object.defineProperty(exports, '__esModule', { value: true });
3
3
  exports.DrawerName = exports.Drawer = void 0;
4
- var Drawer_1 = require("./Drawer");
5
- Object.defineProperty(exports, "Drawer", { enumerable: true, get: function () { return Drawer_1.Drawer; } });
6
- var Drawer_types_1 = require("./Drawer.types");
7
- Object.defineProperty(exports, "DrawerName", { enumerable: true, get: function () { return Drawer_types_1.DrawerName; } });
8
- //# sourceMappingURL=index.js.map
4
+ const Drawer_1 = require('./Drawer');
5
+ Object.defineProperty(exports, 'Drawer', {
6
+ enumerable: true,
7
+ get: function () {
8
+ return Drawer_1.Drawer;
9
+ },
10
+ });
11
+ const Drawer_types_1 = require('./Drawer.types');
12
+ Object.defineProperty(exports, 'DrawerName', {
13
+ enumerable: true,
14
+ get: function () {
15
+ return Drawer_types_1.DrawerName;
16
+ },
17
+ });
18
+ //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,mCAAkC;AAAzB,gGAAA,MAAM,OAAA;AAEf,+CAA4C;AAAnC,0GAAA,UAAU,OAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,qCAAkC;AAAzB,gGAAA,MAAM,OAAA;AAEf,iDAA4C;AAAnC,0GAAA,UAAU,OAAA"}