@coinbase/cds-mobile 8.43.2 → 8.44.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/CHANGELOG.md +6 -0
- package/dts/alpha/__figma__/Select.figma.d.ts +2 -0
- package/dts/alpha/__figma__/Select.figma.d.ts.map +1 -0
- package/dts/alpha/combobox/Combobox.d.ts.map +1 -1
- package/dts/overlays/drawer/Drawer.d.ts +44 -13
- package/dts/overlays/drawer/Drawer.d.ts.map +1 -1
- package/dts/overlays/handlebar/HandleBar.d.ts +26 -2
- package/dts/overlays/handlebar/HandleBar.d.ts.map +1 -1
- package/dts/overlays/tray/Tray.d.ts +48 -13
- package/dts/overlays/tray/Tray.d.ts.map +1 -1
- package/esm/alpha/__figma__/Select.figma.js +63 -0
- package/esm/alpha/combobox/Combobox.js +29 -24
- package/esm/overlays/__stories__/TrayRedesign.stories.js +1070 -0
- package/esm/overlays/drawer/Drawer.js +64 -37
- package/esm/overlays/handlebar/HandleBar.js +48 -25
- package/esm/overlays/tray/Tray.js +61 -26
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -8,6 +8,12 @@ All notable changes to this project will be documented in this file.
|
|
|
8
8
|
|
|
9
9
|
<!-- template-start -->
|
|
10
10
|
|
|
11
|
+
## 8.44.0 (2/9/2026 PST)
|
|
12
|
+
|
|
13
|
+
#### 🚀 Updates
|
|
14
|
+
|
|
15
|
+
- Add new tray design. [[#349](https://github.com/coinbase/cds/pull/349)]
|
|
16
|
+
|
|
11
17
|
## 8.43.2 ((2/9/2026, 09:05 AM PST))
|
|
12
18
|
|
|
13
19
|
This is an artificial version bump with no new change.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Select.figma.d.ts","sourceRoot":"","sources":["../../../src/alpha/__figma__/Select.figma.tsx"],"names":[],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Combobox.d.ts","sourceRoot":"","sources":["../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AAM,QAAQ,EAAmB,iBAAiB,CAAC"}
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type { ModalProps } from 'react-native';
|
|
3
|
-
import type {
|
|
2
|
+
import type { ModalProps, PressableProps, StyleProp, ViewStyle } from 'react-native';
|
|
3
|
+
import type {
|
|
4
|
+
PinningDirection,
|
|
5
|
+
SharedAccessibilityProps,
|
|
6
|
+
SharedProps,
|
|
7
|
+
} from '@coinbase/cds-common/types';
|
|
8
|
+
import { type HandleBarProps } from '../handlebar/HandleBar';
|
|
4
9
|
export type DrawerRenderChildren = React.FC<{
|
|
5
10
|
handleClose: () => void;
|
|
6
11
|
}>;
|
|
@@ -9,27 +14,31 @@ export type DrawerRefBaseProps = {
|
|
|
9
14
|
handleClose: () => void;
|
|
10
15
|
};
|
|
11
16
|
export type DrawerBaseProps = SharedProps &
|
|
17
|
+
Pick<SharedAccessibilityProps, 'accessibilityLabel' | 'accessibilityLabelledBy'> &
|
|
12
18
|
Omit<ModalProps, 'onRequestClose' | 'children'> & {
|
|
13
19
|
/** Component to render as the Modal content */
|
|
14
|
-
children
|
|
20
|
+
children?: DrawerRenderChildren | React.ReactNode;
|
|
15
21
|
/**
|
|
16
22
|
* Pin the modal to one side of the screen
|
|
17
23
|
* @default bottom
|
|
18
24
|
* */
|
|
19
|
-
pin
|
|
25
|
+
pin?: PinningDirection;
|
|
20
26
|
/**
|
|
21
27
|
* Prevents a user from dismissing the drawer by pressing the overlay or swiping
|
|
22
|
-
* @default false
|
|
23
28
|
*/
|
|
24
29
|
preventDismissGestures?: boolean;
|
|
25
30
|
/**
|
|
26
31
|
* Prevents a user from dismissing the drawer by pressing hardware back button on Android
|
|
27
|
-
* @default false
|
|
28
32
|
*/
|
|
29
33
|
preventHardwareBackBehaviorAndroid?: boolean;
|
|
34
|
+
/**
|
|
35
|
+
* The HandleBar can be rendered inside or outside the drawer, when pinned to bottom.
|
|
36
|
+
* @default 'outside'
|
|
37
|
+
* @note The 'outside' variant is deprecated. Use 'inside' for new implementations.
|
|
38
|
+
*/
|
|
39
|
+
handleBarVariant?: HandleBarProps['variant'];
|
|
30
40
|
/**
|
|
31
41
|
* The HandleBar by default only is used for a bottom pinned drawer. This removes it.
|
|
32
|
-
* @default false
|
|
33
42
|
* */
|
|
34
43
|
hideHandleBar?: boolean;
|
|
35
44
|
/** Action that will happen when drawer is dismissed */
|
|
@@ -57,31 +66,44 @@ export type DrawerBaseProps = SharedProps &
|
|
|
57
66
|
*/
|
|
58
67
|
stickyFooter?: DrawerRenderChildren | React.ReactNode;
|
|
59
68
|
};
|
|
60
|
-
export type DrawerProps = DrawerBaseProps
|
|
69
|
+
export type DrawerProps = DrawerBaseProps & {
|
|
70
|
+
styles?: {
|
|
71
|
+
root?: StyleProp<ViewStyle>;
|
|
72
|
+
overlay?: StyleProp<ViewStyle>;
|
|
73
|
+
container?: StyleProp<ViewStyle>;
|
|
74
|
+
handleBar?: PressableProps['style'];
|
|
75
|
+
handleBarHandle?: StyleProp<ViewStyle>;
|
|
76
|
+
drawer?: StyleProp<ViewStyle>;
|
|
77
|
+
};
|
|
78
|
+
};
|
|
61
79
|
export declare const Drawer: React.MemoExoticComponent<
|
|
62
80
|
React.ForwardRefExoticComponent<
|
|
63
81
|
SharedProps &
|
|
82
|
+
Pick<SharedAccessibilityProps, 'accessibilityLabel' | 'accessibilityLabelledBy'> &
|
|
64
83
|
Omit<ModalProps, 'children' | 'onRequestClose'> & {
|
|
65
84
|
/** Component to render as the Modal content */
|
|
66
|
-
children
|
|
85
|
+
children?: DrawerRenderChildren | React.ReactNode;
|
|
67
86
|
/**
|
|
68
87
|
* Pin the modal to one side of the screen
|
|
69
88
|
* @default bottom
|
|
70
89
|
* */
|
|
71
|
-
pin
|
|
90
|
+
pin?: PinningDirection;
|
|
72
91
|
/**
|
|
73
92
|
* Prevents a user from dismissing the drawer by pressing the overlay or swiping
|
|
74
|
-
* @default false
|
|
75
93
|
*/
|
|
76
94
|
preventDismissGestures?: boolean;
|
|
77
95
|
/**
|
|
78
96
|
* Prevents a user from dismissing the drawer by pressing hardware back button on Android
|
|
79
|
-
* @default false
|
|
80
97
|
*/
|
|
81
98
|
preventHardwareBackBehaviorAndroid?: boolean;
|
|
99
|
+
/**
|
|
100
|
+
* The HandleBar can be rendered inside or outside the drawer, when pinned to bottom.
|
|
101
|
+
* @default 'outside'
|
|
102
|
+
* @note The 'outside' variant is deprecated. Use 'inside' for new implementations.
|
|
103
|
+
*/
|
|
104
|
+
handleBarVariant?: HandleBarProps['variant'];
|
|
82
105
|
/**
|
|
83
106
|
* The HandleBar by default only is used for a bottom pinned drawer. This removes it.
|
|
84
|
-
* @default false
|
|
85
107
|
* */
|
|
86
108
|
hideHandleBar?: boolean;
|
|
87
109
|
/** Action that will happen when drawer is dismissed */
|
|
@@ -108,6 +130,15 @@ export declare const Drawer: React.MemoExoticComponent<
|
|
|
108
130
|
* @deprecated Use TrayStickyFooter as a Tray child instead.
|
|
109
131
|
*/
|
|
110
132
|
stickyFooter?: DrawerRenderChildren | React.ReactNode;
|
|
133
|
+
} & {
|
|
134
|
+
styles?: {
|
|
135
|
+
root?: StyleProp<ViewStyle>;
|
|
136
|
+
overlay?: StyleProp<ViewStyle>;
|
|
137
|
+
container?: StyleProp<ViewStyle>;
|
|
138
|
+
handleBar?: PressableProps['style'];
|
|
139
|
+
handleBarHandle?: StyleProp<ViewStyle>;
|
|
140
|
+
drawer?: StyleProp<ViewStyle>;
|
|
141
|
+
};
|
|
111
142
|
} & React.RefAttributes<DrawerRefBaseProps>
|
|
112
143
|
>
|
|
113
144
|
>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Drawer.d.ts","sourceRoot":"","sources":["../../../src/overlays/drawer/Drawer.tsx"],"names":[],"mappings":"AAAA,OAAO,KASN,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"Drawer.d.ts","sourceRoot":"","sources":["../../../src/overlays/drawer/Drawer.tsx"],"names":[],"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,CAAC,SAAS,CAAC,CAAC;QACvC,MAAM,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;KAC/B;6CAsOF,CAAC"}
|
|
@@ -1,10 +1,34 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type {
|
|
2
|
+
GestureResponderHandlers,
|
|
3
|
+
PressableProps,
|
|
4
|
+
StyleProp,
|
|
5
|
+
ViewProps,
|
|
6
|
+
ViewStyle,
|
|
7
|
+
} from 'react-native';
|
|
2
8
|
export type HandleBarProps = ViewProps & {
|
|
3
9
|
/** Callback fired when the handlebar is pressed via accessibility action */
|
|
4
10
|
onAccessibilityPress?: () => void;
|
|
11
|
+
/**
|
|
12
|
+
* The HandleBar can be rendered inside or outside the drawer.
|
|
13
|
+
* @default 'outside'
|
|
14
|
+
*/
|
|
15
|
+
variant?: 'inside' | 'outside';
|
|
16
|
+
/** Pan responder handlers for drag-to-dismiss functionality. */
|
|
17
|
+
panHandlers?: GestureResponderHandlers;
|
|
18
|
+
styles?: {
|
|
19
|
+
root?: PressableProps['style'];
|
|
20
|
+
handle?: StyleProp<ViewStyle>;
|
|
21
|
+
};
|
|
5
22
|
};
|
|
6
23
|
export declare const HandleBar: {
|
|
7
|
-
({
|
|
24
|
+
({
|
|
25
|
+
onAccessibilityPress,
|
|
26
|
+
variant,
|
|
27
|
+
panHandlers,
|
|
28
|
+
style,
|
|
29
|
+
styles,
|
|
30
|
+
...props
|
|
31
|
+
}: HandleBarProps): import('react/jsx-runtime').JSX.Element;
|
|
8
32
|
displayName: string;
|
|
9
33
|
};
|
|
10
34
|
//# sourceMappingURL=HandleBar.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HandleBar.d.ts","sourceRoot":"","sources":["../../../src/overlays/handlebar/HandleBar.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"HandleBar.d.ts","sourceRoot":"","sources":["../../../src/overlays/handlebar/HandleBar.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAEV,wBAAwB,EACxB,cAAc,EAEd,SAAS,EACT,SAAS,EACT,SAAS,EACV,MAAM,cAAc,CAAC;AAKtB,MAAM,MAAM,cAAc,GAAG,SAAS,GAAG;IACvC,4EAA4E;IAC5E,oBAAoB,CAAC,EAAE,MAAM,IAAI,CAAC;IAClC;;;OAGG;IACH,OAAO,CAAC,EAAE,QAAQ,GAAG,SAAS,CAAC;IAC/B,gEAAgE;IAChE,WAAW,CAAC,EAAE,wBAAwB,CAAC;IACvC,MAAM,CAAC,EAAE;QACP,IAAI,CAAC,EAAE,cAAc,CAAC,OAAO,CAAC,CAAC;QAC/B,MAAM,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;KAC/B,CAAC;CACH,CAAC;AAOF,eAAO,MAAM,SAAS;8EAOnB,cAAc;;CAwEhB,CAAC"}
|
|
@@ -1,15 +1,23 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { ReactNode } from 'react';
|
|
3
|
-
import {
|
|
3
|
+
import type { StyleProp, TextStyle, ViewStyle } from 'react-native';
|
|
4
|
+
import type { ElevationLevels } from '@coinbase/cds-common';
|
|
5
|
+
import { type DrawerBaseProps, type DrawerProps, type DrawerRefBaseProps } from '../drawer/Drawer';
|
|
4
6
|
export type TrayRenderChildren = React.FC<{
|
|
5
7
|
handleClose: () => void;
|
|
6
8
|
}>;
|
|
7
9
|
export type TrayBaseProps = Omit<DrawerBaseProps, 'pin' | 'children'> & {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
header
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
/** Component to render as the Tray content */
|
|
11
|
+
children?: React.ReactNode | TrayRenderChildren;
|
|
12
|
+
/** Component to render as the Tray header */
|
|
13
|
+
header?: React.ReactNode | TrayRenderChildren;
|
|
14
|
+
/**
|
|
15
|
+
* Elevation level for the header area (includes title and header content).
|
|
16
|
+
* Use this to add a drop shadow below the header when content is scrolled.
|
|
17
|
+
*/
|
|
18
|
+
headerElevation?: ElevationLevels;
|
|
19
|
+
/** Component to render as the Tray footer */
|
|
20
|
+
footer?: React.ReactNode | TrayRenderChildren;
|
|
13
21
|
/**
|
|
14
22
|
* Optional callback that, if provided, will be triggered when the Tray is toggled open/ closed
|
|
15
23
|
* If used for analytics, context ('visible' | 'hidden') can be bundled with the event info to track whether the
|
|
@@ -19,7 +27,18 @@ export type TrayBaseProps = Omit<DrawerBaseProps, 'pin' | 'children'> & {
|
|
|
19
27
|
/** Text or ReactNode for optional Tray title */
|
|
20
28
|
title?: React.ReactNode;
|
|
21
29
|
};
|
|
22
|
-
export type TrayProps = TrayBaseProps
|
|
30
|
+
export type TrayProps = TrayBaseProps &
|
|
31
|
+
Omit<DrawerProps, 'pin' | 'children'> & {
|
|
32
|
+
pin?: DrawerProps['pin'];
|
|
33
|
+
styles?: DrawerProps['styles'] & {
|
|
34
|
+
/** Styles for the content area */
|
|
35
|
+
content?: StyleProp<ViewStyle>;
|
|
36
|
+
/** Styles for the header section */
|
|
37
|
+
header?: StyleProp<ViewStyle>;
|
|
38
|
+
/** Styles for the title text */
|
|
39
|
+
title?: StyleProp<TextStyle>;
|
|
40
|
+
};
|
|
41
|
+
};
|
|
23
42
|
export declare const TrayContext: React.Context<{
|
|
24
43
|
verticalDrawerPercentageOfView: number;
|
|
25
44
|
titleHeight: number;
|
|
@@ -27,11 +46,17 @@ export declare const TrayContext: React.Context<{
|
|
|
27
46
|
export declare const Tray: React.MemoExoticComponent<
|
|
28
47
|
React.ForwardRefExoticComponent<
|
|
29
48
|
Omit<DrawerBaseProps, 'children' | 'pin'> & {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
header
|
|
33
|
-
|
|
34
|
-
|
|
49
|
+
/** Component to render as the Tray content */
|
|
50
|
+
children?: React.ReactNode | TrayRenderChildren;
|
|
51
|
+
/** Component to render as the Tray header */
|
|
52
|
+
header?: React.ReactNode | TrayRenderChildren;
|
|
53
|
+
/**
|
|
54
|
+
* Elevation level for the header area (includes title and header content).
|
|
55
|
+
* Use this to add a drop shadow below the header when content is scrolled.
|
|
56
|
+
*/
|
|
57
|
+
headerElevation?: ElevationLevels;
|
|
58
|
+
/** Component to render as the Tray footer */
|
|
59
|
+
footer?: React.ReactNode | TrayRenderChildren;
|
|
35
60
|
/**
|
|
36
61
|
* Optional callback that, if provided, will be triggered when the Tray is toggled open/ closed
|
|
37
62
|
* If used for analytics, context ('visible' | 'hidden') can be bundled with the event info to track whether the
|
|
@@ -40,7 +65,17 @@ export declare const Tray: React.MemoExoticComponent<
|
|
|
40
65
|
onVisibilityChange?: (context: 'visible' | 'hidden') => void;
|
|
41
66
|
/** Text or ReactNode for optional Tray title */
|
|
42
67
|
title?: React.ReactNode;
|
|
43
|
-
} &
|
|
68
|
+
} & Omit<DrawerProps, 'children' | 'pin'> & {
|
|
69
|
+
pin?: DrawerProps['pin'];
|
|
70
|
+
styles?: DrawerProps['styles'] & {
|
|
71
|
+
/** Styles for the content area */
|
|
72
|
+
content?: StyleProp<ViewStyle>;
|
|
73
|
+
/** Styles for the header section */
|
|
74
|
+
header?: StyleProp<ViewStyle>;
|
|
75
|
+
/** Styles for the title text */
|
|
76
|
+
title?: StyleProp<TextStyle>;
|
|
77
|
+
};
|
|
78
|
+
} & React.RefAttributes<DrawerRefBaseProps>
|
|
44
79
|
>
|
|
45
80
|
>;
|
|
46
81
|
export declare const TrayStickyFooter: ({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tray.d.ts","sourceRoot":"","sources":["../../../src/overlays/tray/Tray.tsx"],"names":[],"mappings":"AAAA,OAAO,KASN,MAAM,OAAO,CAAC;AAEf,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"Tray.d.ts","sourceRoot":"","sources":["../../../src/overlays/tray/Tray.tsx"],"names":[],"mappings":"AAAA,OAAO,KASN,MAAM,OAAO,CAAC;AAEf,OAAO,KAAK,EAAE,SAAS,E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,CAAC,SAAS,CAAC,CAAC;QAC9B,gCAAgC;QAChC,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;KAC9B,CAAC;CACH,CAAC;AAEJ,eAAO,MAAM,WAAW;oCACU,MAAM;iBACzB,MAAM;EAInB,CAAC;AAEH,eAAO,MAAM,IAAI;IA1Cf,8CAA8C;eACnC,KAAK,CAAC,SAAS,GAAG,kBAAkB;IAC/C,6CAA6C;aACpC,KAAK,CAAC,SAAS,GAAG,kBAAkB;IAC7C;;;OAGG;sBACe,eAAe;IACjC,6CAA6C;aACpC,KAAK,CAAC,SAAS,GAAG,kBAAkB;IAC7C;;;;OAIG;yBACkB,CAAC,OAAO,EAAE,SAAS,GAAG,QAAQ,KAAK,IAAI;IAC5D,gDAAgD;YACxC,KAAK,CAAC,SAAS;;UAKf,WAAW,CAAC,KAAK,CAAC;aACf,WAAW,CAAC,QAAQ,CAAC,GAAG;QAC/B,kCAAkC;QAClC,OAAO,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;QAC/B,oCAAoC;QACpC,MAAM,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;QAC9B,gCAAgC;QAChC,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;KAC9B;6CAmIJ,CAAC;AAEF,eAAO,MAAM,gBAAgB,GAAI,cAAc;IAAE,QAAQ,EAAE,SAAS,CAAA;CAAE,4CAQrE,CAAC"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
const _excluded = ["type", "value"];
|
|
2
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
3
|
+
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
4
|
+
import { figma } from '@figma/code-connect';
|
|
5
|
+
import { Select } from '../select/Select';
|
|
6
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
|
+
const selectOptions = [{
|
|
8
|
+
value: 'apple',
|
|
9
|
+
label: 'Apple'
|
|
10
|
+
}, {
|
|
11
|
+
value: 'banana',
|
|
12
|
+
label: 'Banana'
|
|
13
|
+
}, {
|
|
14
|
+
value: 'orange',
|
|
15
|
+
label: 'Orange',
|
|
16
|
+
description: 'Citrus'
|
|
17
|
+
}];
|
|
18
|
+
figma.connect(Select, 'https://www.figma.com/design/k5CtyJccNQUGMI5bI4lJ2g/✨-CDS-Components?node-id=71762-14938', {
|
|
19
|
+
imports: ["import { Select } from '@coinbase/cds-mobile/alpha/select/Select'"],
|
|
20
|
+
props: {
|
|
21
|
+
type: figma.enum('type', {
|
|
22
|
+
'single select': 'single',
|
|
23
|
+
'multi-select': 'multi'
|
|
24
|
+
}),
|
|
25
|
+
disabled: figma.boolean('disabled'),
|
|
26
|
+
compact: figma.boolean('compact'),
|
|
27
|
+
label: figma.boolean('show label', {
|
|
28
|
+
true: figma.boolean('show info icon') ? "<HStack alignItems=\"center\">\n <InputLabel>" + figma.string('label string') + "</InputLabel>\n <Tooltip content=\"This will be visible to other users.\">\n <Icon active color=\"fg\" name=\"info\" padding={0.75} size=\"xs\" tabIndex={0} />\n </Tooltip>\n </HStack>" : figma.string('label string'),
|
|
29
|
+
false: undefined
|
|
30
|
+
}),
|
|
31
|
+
start: figma.boolean('show start', {
|
|
32
|
+
true: figma.instance('start'),
|
|
33
|
+
false: undefined
|
|
34
|
+
}),
|
|
35
|
+
helperText: figma.boolean('show helper text', {
|
|
36
|
+
true: figma.string('helper text'),
|
|
37
|
+
false: undefined
|
|
38
|
+
}),
|
|
39
|
+
placeholder: figma.string('placeholderText'),
|
|
40
|
+
variant: figma.enum('state', {
|
|
41
|
+
default: undefined,
|
|
42
|
+
positive: 'positive',
|
|
43
|
+
negative: 'negative'
|
|
44
|
+
}),
|
|
45
|
+
value: figma.enum('type', {
|
|
46
|
+
'single select': 'Item 1',
|
|
47
|
+
'multi-select': ['Item 1', 'Item 2']
|
|
48
|
+
})
|
|
49
|
+
},
|
|
50
|
+
example: _ref => {
|
|
51
|
+
let {
|
|
52
|
+
type,
|
|
53
|
+
value
|
|
54
|
+
} = _ref,
|
|
55
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
56
|
+
return /*#__PURE__*/_jsx(Select, _extends({}, props, {
|
|
57
|
+
onChange: () => {},
|
|
58
|
+
options: selectOptions,
|
|
59
|
+
type: type,
|
|
60
|
+
value: value
|
|
61
|
+
}));
|
|
62
|
+
}
|
|
63
|
+
});
|
|
@@ -124,32 +124,37 @@ const ComboboxBase = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((_ref2, ref) => {
|
|
|
124
124
|
label: label,
|
|
125
125
|
minHeight: 500
|
|
126
126
|
}, props, {
|
|
127
|
-
footer:
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
127
|
+
footer: _ref3 => {
|
|
128
|
+
let {
|
|
129
|
+
handleClose
|
|
130
|
+
} = _ref3;
|
|
131
|
+
return /*#__PURE__*/_jsx(KeyboardAvoidingView, {
|
|
132
|
+
behavior: "padding",
|
|
133
|
+
keyboardVerticalOffset: Platform.OS === 'ios' ? 86 : 0,
|
|
134
|
+
children: /*#__PURE__*/_jsx(View, {
|
|
135
|
+
style: Platform.OS === 'android' ? {
|
|
136
|
+
overflow: 'hidden',
|
|
137
|
+
paddingTop: 4
|
|
138
|
+
} : undefined,
|
|
139
|
+
children: /*#__PURE__*/_jsx(StickyFooter, {
|
|
140
|
+
background: "bgElevation2",
|
|
141
|
+
elevation: 2,
|
|
142
|
+
style: {
|
|
143
|
+
shadowOffset: {
|
|
144
|
+
width: 0,
|
|
145
|
+
height: -32
|
|
146
|
+
},
|
|
147
|
+
shadowOpacity: 0.05
|
|
142
148
|
},
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
children: closeButtonLabel
|
|
149
|
+
children: /*#__PURE__*/_jsx(Button, {
|
|
150
|
+
compact: true,
|
|
151
|
+
onPress: handleClose,
|
|
152
|
+
children: closeButtonLabel
|
|
153
|
+
})
|
|
149
154
|
})
|
|
150
155
|
})
|
|
151
|
-
})
|
|
152
|
-
}
|
|
156
|
+
});
|
|
157
|
+
},
|
|
153
158
|
header: /*#__PURE__*/_jsx(Box, {
|
|
154
159
|
paddingX: 3,
|
|
155
160
|
children: /*#__PURE__*/_jsx(ComboboxControl, _extends({
|
|
@@ -165,7 +170,7 @@ const ComboboxBase = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((_ref2, ref) => {
|
|
|
165
170
|
}))
|
|
166
171
|
}),
|
|
167
172
|
onVisibilityChange: handleTrayVisibilityChange
|
|
168
|
-
})), [ComboboxControl, SelectDropdownComponent, accessibilityLabel, align, closeButtonLabel, endNode, handleTrayVisibilityChange, label, placeholder,
|
|
173
|
+
})), [ComboboxControl, SelectDropdownComponent, accessibilityLabel, align, closeButtonLabel, endNode, handleTrayVisibilityChange, label, placeholder, startNode, variant]);
|
|
169
174
|
return /*#__PURE__*/_jsx(ComboboxContext.Provider, {
|
|
170
175
|
value: {
|
|
171
176
|
searchText,
|