@bacon-pos/ui 0.5.0 → 0.6.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/lib/commonjs/components/CodeField/CodeField.js +10 -2
- package/lib/commonjs/components/CodeField/CodeField.js.map +1 -1
- package/lib/commonjs/components/CodeField/CodeField.stories.js +15 -2
- package/lib/commonjs/components/CodeField/CodeField.stories.js.map +1 -1
- package/lib/commonjs/components/Dropdown/Dropdown.js +282 -0
- package/lib/commonjs/components/Dropdown/Dropdown.js.map +1 -0
- package/lib/commonjs/components/Dropdown/Dropdown.stories.js +421 -0
- package/lib/commonjs/components/Dropdown/Dropdown.stories.js.map +1 -0
- package/lib/commonjs/components/Dropdown/Dropdown.test.js +113 -0
- package/lib/commonjs/components/Dropdown/Dropdown.test.js.map +1 -0
- package/lib/commonjs/components/Dropdown/index.js +19 -0
- package/lib/commonjs/components/Dropdown/index.js.map +1 -0
- package/lib/commonjs/components/Menu/Menu.js +214 -0
- package/lib/commonjs/components/Menu/Menu.js.map +1 -0
- package/lib/commonjs/components/Menu/Menu.test.js +71 -0
- package/lib/commonjs/components/Menu/Menu.test.js.map +1 -0
- package/lib/commonjs/components/Menu/MenuButton.js +73 -0
- package/lib/commonjs/components/Menu/MenuButton.js.map +1 -0
- package/lib/commonjs/components/Menu/MenuButton.stories.js +166 -0
- package/lib/commonjs/components/Menu/MenuButton.stories.js.map +1 -0
- package/lib/commonjs/components/Menu/SelectButton.js +143 -0
- package/lib/commonjs/components/Menu/SelectButton.js.map +1 -0
- package/lib/commonjs/components/Menu/SelectButton.stories.js +116 -0
- package/lib/commonjs/components/Menu/SelectButton.stories.js.map +1 -0
- package/lib/commonjs/components/Menu/SelectButton.test.js +80 -0
- package/lib/commonjs/components/Menu/SelectButton.test.js.map +1 -0
- package/lib/commonjs/components/Menu/index.js +27 -0
- package/lib/commonjs/components/Menu/index.js.map +1 -0
- package/lib/commonjs/components/Select/Select.js +246 -0
- package/lib/commonjs/components/Select/Select.js.map +1 -0
- package/lib/commonjs/components/Select/Select.stories.js +221 -0
- package/lib/commonjs/components/Select/Select.stories.js.map +1 -0
- package/lib/commonjs/components/Select/Select.test.js +165 -0
- package/lib/commonjs/components/Select/Select.test.js.map +1 -0
- package/lib/commonjs/components/Select/index.js +13 -0
- package/lib/commonjs/components/Select/index.js.map +1 -0
- package/lib/commonjs/components/UserChip/UserChip.js +121 -0
- package/lib/commonjs/components/UserChip/UserChip.js.map +1 -0
- package/lib/commonjs/components/UserChip/UserChip.stories.js +153 -0
- package/lib/commonjs/components/UserChip/UserChip.stories.js.map +1 -0
- package/lib/commonjs/components/UserChip/UserChip.test.js +59 -0
- package/lib/commonjs/components/UserChip/UserChip.test.js.map +1 -0
- package/lib/commonjs/components/UserChip/index.js +13 -0
- package/lib/commonjs/components/UserChip/index.js.map +1 -0
- package/lib/commonjs/components/index.js +57 -13
- package/lib/commonjs/components/index.js.map +1 -1
- package/lib/module/components/CodeField/CodeField.js +10 -2
- package/lib/module/components/CodeField/CodeField.js.map +1 -1
- package/lib/module/components/CodeField/CodeField.stories.js +14 -1
- package/lib/module/components/CodeField/CodeField.stories.js.map +1 -1
- package/lib/module/components/Dropdown/Dropdown.js +277 -0
- package/lib/module/components/Dropdown/Dropdown.js.map +1 -0
- package/lib/module/components/Dropdown/Dropdown.stories.js +417 -0
- package/lib/module/components/Dropdown/Dropdown.stories.js.map +1 -0
- package/lib/module/components/Dropdown/Dropdown.test.js +113 -0
- package/lib/module/components/Dropdown/Dropdown.test.js.map +1 -0
- package/lib/module/components/Dropdown/index.js +4 -0
- package/lib/module/components/Dropdown/index.js.map +1 -0
- package/lib/module/components/Menu/Menu.js +210 -0
- package/lib/module/components/Menu/Menu.js.map +1 -0
- package/lib/module/components/Menu/Menu.test.js +71 -0
- package/lib/module/components/Menu/Menu.test.js.map +1 -0
- package/lib/module/components/Menu/MenuButton.js +69 -0
- package/lib/module/components/Menu/MenuButton.js.map +1 -0
- package/lib/module/components/Menu/MenuButton.stories.js +162 -0
- package/lib/module/components/Menu/MenuButton.stories.js.map +1 -0
- package/lib/module/components/Menu/SelectButton.js +139 -0
- package/lib/module/components/Menu/SelectButton.js.map +1 -0
- package/lib/module/components/Menu/SelectButton.stories.js +112 -0
- package/lib/module/components/Menu/SelectButton.stories.js.map +1 -0
- package/lib/module/components/Menu/SelectButton.test.js +80 -0
- package/lib/module/components/Menu/SelectButton.test.js.map +1 -0
- package/lib/module/components/Menu/index.js +6 -0
- package/lib/module/components/Menu/index.js.map +1 -0
- package/lib/module/components/Select/Select.js +244 -0
- package/lib/module/components/Select/Select.js.map +1 -0
- package/lib/module/components/Select/Select.stories.js +217 -0
- package/lib/module/components/Select/Select.stories.js.map +1 -0
- package/lib/module/components/Select/Select.test.js +165 -0
- package/lib/module/components/Select/Select.test.js.map +1 -0
- package/lib/module/components/Select/index.js +4 -0
- package/lib/module/components/Select/index.js.map +1 -0
- package/lib/module/components/UserChip/UserChip.js +117 -0
- package/lib/module/components/UserChip/UserChip.js.map +1 -0
- package/lib/module/components/UserChip/UserChip.stories.js +149 -0
- package/lib/module/components/UserChip/UserChip.stories.js.map +1 -0
- package/lib/module/components/UserChip/UserChip.test.js +59 -0
- package/lib/module/components/UserChip/UserChip.test.js.map +1 -0
- package/lib/module/components/UserChip/index.js +4 -0
- package/lib/module/components/UserChip/index.js.map +1 -0
- package/lib/module/components/index.js +4 -0
- package/lib/module/components/index.js.map +1 -1
- package/lib/typescript/commonjs/components/CodeField/CodeField.d.ts +4 -2
- package/lib/typescript/commonjs/components/CodeField/CodeField.d.ts.map +1 -1
- package/lib/typescript/commonjs/components/Dropdown/Dropdown.d.ts +105 -0
- package/lib/typescript/commonjs/components/Dropdown/Dropdown.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/Dropdown/index.d.ts +3 -0
- package/lib/typescript/commonjs/components/Dropdown/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/Menu/Menu.d.ts +66 -0
- package/lib/typescript/commonjs/components/Menu/Menu.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/Menu/MenuButton.d.ts +46 -0
- package/lib/typescript/commonjs/components/Menu/MenuButton.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/Menu/SelectButton.d.ts +60 -0
- package/lib/typescript/commonjs/components/Menu/SelectButton.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/Menu/index.d.ts +7 -0
- package/lib/typescript/commonjs/components/Menu/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/Select/Select.d.ts +73 -0
- package/lib/typescript/commonjs/components/Select/Select.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/Select/index.d.ts +3 -0
- package/lib/typescript/commonjs/components/Select/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/UserChip/UserChip.d.ts +33 -0
- package/lib/typescript/commonjs/components/UserChip/UserChip.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/UserChip/index.d.ts +3 -0
- package/lib/typescript/commonjs/components/UserChip/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/index.d.ts +4 -0
- package/lib/typescript/commonjs/components/index.d.ts.map +1 -1
- package/lib/typescript/module/components/CodeField/CodeField.d.ts +4 -2
- package/lib/typescript/module/components/CodeField/CodeField.d.ts.map +1 -1
- package/lib/typescript/module/components/Dropdown/Dropdown.d.ts +105 -0
- package/lib/typescript/module/components/Dropdown/Dropdown.d.ts.map +1 -0
- package/lib/typescript/module/components/Dropdown/index.d.ts +3 -0
- package/lib/typescript/module/components/Dropdown/index.d.ts.map +1 -0
- package/lib/typescript/module/components/Menu/Menu.d.ts +66 -0
- package/lib/typescript/module/components/Menu/Menu.d.ts.map +1 -0
- package/lib/typescript/module/components/Menu/MenuButton.d.ts +46 -0
- package/lib/typescript/module/components/Menu/MenuButton.d.ts.map +1 -0
- package/lib/typescript/module/components/Menu/SelectButton.d.ts +60 -0
- package/lib/typescript/module/components/Menu/SelectButton.d.ts.map +1 -0
- package/lib/typescript/module/components/Menu/index.d.ts +7 -0
- package/lib/typescript/module/components/Menu/index.d.ts.map +1 -0
- package/lib/typescript/module/components/Select/Select.d.ts +73 -0
- package/lib/typescript/module/components/Select/Select.d.ts.map +1 -0
- package/lib/typescript/module/components/Select/index.d.ts +3 -0
- package/lib/typescript/module/components/Select/index.d.ts.map +1 -0
- package/lib/typescript/module/components/UserChip/UserChip.d.ts +33 -0
- package/lib/typescript/module/components/UserChip/UserChip.d.ts.map +1 -0
- package/lib/typescript/module/components/UserChip/index.d.ts +3 -0
- package/lib/typescript/module/components/UserChip/index.d.ts.map +1 -0
- package/lib/typescript/module/components/index.d.ts +4 -0
- package/lib/typescript/module/components/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/components/CodeField/CodeField.tsx +6 -3
- package/src/components/Dropdown/Dropdown.tsx +319 -0
- package/src/components/Dropdown/index.ts +2 -0
- package/src/components/Menu/Menu.tsx +249 -0
- package/src/components/Menu/MenuButton.tsx +98 -0
- package/src/components/Menu/SelectButton.tsx +171 -0
- package/src/components/Menu/index.ts +12 -0
- package/src/components/Select/Select.tsx +323 -0
- package/src/components/Select/index.ts +2 -0
- package/src/components/UserChip/UserChip.tsx +138 -0
- package/src/components/UserChip/index.ts +2 -0
- package/src/components/index.ts +4 -0
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { type StyleProp, type ViewStyle } from 'react-native';
|
|
2
|
+
import type { IconName } from '../Icon/icons.generated';
|
|
3
|
+
import { type EdgeInsets, type MenuOrigin } from '../Menu/Menu';
|
|
4
|
+
export type SelectSize = 'md' | 'lg';
|
|
5
|
+
/** An option in a `Select`. */
|
|
6
|
+
export interface SelectOption {
|
|
7
|
+
key: string;
|
|
8
|
+
label: string;
|
|
9
|
+
/** Leading icon shown in the option row. */
|
|
10
|
+
icon?: IconName;
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
}
|
|
13
|
+
export interface SelectProps {
|
|
14
|
+
/** The options to choose from. */
|
|
15
|
+
options: SelectOption[];
|
|
16
|
+
/** Allow choosing several options (checkbox rows; value is an array). */
|
|
17
|
+
multiple?: boolean;
|
|
18
|
+
/** Selected key(s) — a string (single) or string[] (multiple). Controlled. */
|
|
19
|
+
value?: string | string[];
|
|
20
|
+
/** Initial selection for the uncontrolled case. */
|
|
21
|
+
defaultValue?: string | string[];
|
|
22
|
+
/** Called with the new selection (string for single, string[] for multiple). */
|
|
23
|
+
onChange?: (value: string | string[]) => void;
|
|
24
|
+
/** Label above the field. */
|
|
25
|
+
label?: string;
|
|
26
|
+
/** Helper text below the field. Replaced by the error message when `error` is a string. */
|
|
27
|
+
helperText?: string;
|
|
28
|
+
/** Mark invalid. Pass a string to show it as the error message. */
|
|
29
|
+
error?: boolean | string;
|
|
30
|
+
/** Text shown when nothing is selected. Defaults to "Select option". */
|
|
31
|
+
placeholder?: string;
|
|
32
|
+
/** Fixed leading icon on the field. */
|
|
33
|
+
leftIcon?: IconName;
|
|
34
|
+
/** Field height: `md` = 48, `lg` = 58. Defaults to `lg`. */
|
|
35
|
+
size?: SelectSize;
|
|
36
|
+
/** Fixed field width. Omit to use `fullWidth` (the Figma default). */
|
|
37
|
+
width?: number;
|
|
38
|
+
/** Stretch to the full width of the parent. Defaults to true. Ignored when `width` is set. */
|
|
39
|
+
fullWidth?: boolean;
|
|
40
|
+
/** Disable the field. */
|
|
41
|
+
disabled?: boolean;
|
|
42
|
+
/** Custom display for the selected value(s). */
|
|
43
|
+
renderValue?: (selected: SelectOption[]) => string;
|
|
44
|
+
/** Match the menu width to the field width. Defaults to true. */
|
|
45
|
+
matchTriggerWidth?: boolean;
|
|
46
|
+
/** Menu width when `matchTriggerWidth` is false. */
|
|
47
|
+
menuWidth?: number;
|
|
48
|
+
/** Max menu height; scrolls beyond it. */
|
|
49
|
+
maxHeight?: number;
|
|
50
|
+
/** Point on the field the menu latches to. Defaults to `{ bottom, left }`. */
|
|
51
|
+
anchorOrigin?: MenuOrigin;
|
|
52
|
+
/** Point on the menu placed at the anchor. Defaults to `{ top, left }`. */
|
|
53
|
+
menuOrigin?: MenuOrigin;
|
|
54
|
+
/** Gap between field and menu. Defaults to 8. */
|
|
55
|
+
offset?: number;
|
|
56
|
+
/** Auto-fit the menu height and flip direction near screen edges. Defaults to true. */
|
|
57
|
+
autoFit?: boolean;
|
|
58
|
+
/** Safe-area insets to keep clear. */
|
|
59
|
+
insets?: EdgeInsets;
|
|
60
|
+
/** Close after selecting. Defaults to `!multiple`. */
|
|
61
|
+
closeOnSelect?: boolean;
|
|
62
|
+
/** Container style. */
|
|
63
|
+
style?: StyleProp<ViewStyle>;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Select — a form field that opens a `Dropdown` of options. The field mirrors
|
|
67
|
+
* `Input` (pill, label, helper/error, lime focus ring, red error ring); it is
|
|
68
|
+
* not editable — pressing it opens the menu, which matches the field width. The
|
|
69
|
+
* current option is marked with a check. With `multiple`, rows become checkboxes,
|
|
70
|
+
* the value is an array, and the menu stays open while picking.
|
|
71
|
+
*/
|
|
72
|
+
export declare function Select({ options, multiple, value, defaultValue, onChange, label, helperText, error, placeholder, leftIcon, size, width, fullWidth, disabled, renderValue, matchTriggerWidth, menuWidth, maxHeight, anchorOrigin, menuOrigin, offset, autoFit, insets, closeOnSelect, style, }: SelectProps): import("react/jsx-runtime").JSX.Element;
|
|
73
|
+
//# sourceMappingURL=Select.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Select.d.ts","sourceRoot":"","sources":["../../../../../src/components/Select/Select.tsx"],"names":[],"mappings":"AACA,OAAO,EAGL,KAAK,SAAS,EAEd,KAAK,SAAS,EACf,MAAM,cAAc,CAAC;AAKtB,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAQ,KAAK,UAAU,EAAE,KAAK,UAAU,EAAE,MAAM,cAAc,CAAC;AAiBtE,MAAM,MAAM,UAAU,GAAG,IAAI,GAAG,IAAI,CAAC;AAUrC,+BAA+B;AAC/B,MAAM,WAAW,YAAY;IAC3B,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,4CAA4C;IAC5C,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,WAAW;IAC1B,kCAAkC;IAClC,OAAO,EAAE,YAAY,EAAE,CAAC;IACxB,yEAAyE;IACzE,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,8EAA8E;IAC9E,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAC1B,mDAAmD;IACnD,YAAY,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IACjC,gFAAgF;IAChF,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,KAAK,IAAI,CAAC;IAE9C,6BAA6B;IAC7B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,2FAA2F;IAC3F,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,mEAAmE;IACnE,KAAK,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IACzB,wEAAwE;IACxE,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,uCAAuC;IACvC,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,4DAA4D;IAC5D,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,sEAAsE;IACtE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,8FAA8F;IAC9F,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,yBAAyB;IACzB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,gDAAgD;IAChD,WAAW,CAAC,EAAE,CAAC,QAAQ,EAAE,YAAY,EAAE,KAAK,MAAM,CAAC;IAEnD,iEAAiE;IACjE,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,oDAAoD;IACpD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,0CAA0C;IAC1C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,8EAA8E;IAC9E,YAAY,CAAC,EAAE,UAAU,CAAC;IAC1B,2EAA2E;IAC3E,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,iDAAiD;IACjD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,uFAAuF;IACvF,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,sCAAsC;IACtC,MAAM,CAAC,EAAE,UAAU,CAAC;IACpB,sDAAsD;IACtD,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,uBAAuB;IACvB,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9B;AAED;;;;;;GAMG;AACH,wBAAgB,MAAM,CAAC,EACrB,OAAO,EACP,QAAgB,EAChB,KAAK,EACL,YAAY,EACZ,QAAQ,EACR,KAAK,EACL,UAAU,EACV,KAAK,EACL,WAA6B,EAC7B,QAAQ,EACR,IAAW,EACX,KAAK,EACL,SAAgB,EAChB,QAAgB,EAChB,WAAW,EACX,iBAAwB,EACxB,SAAS,EACT,SAAS,EACT,YAAyD,EACzD,UAAoD,EACpD,MAAU,EACV,OAAc,EACd,MAAM,EACN,aAAa,EACb,KAAK,GACN,EAAE,WAAW,2CAyLb"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/Select/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,YAAY,EAAE,WAAW,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { type ImageSourcePropType, type StyleProp, type ViewStyle } from 'react-native';
|
|
2
|
+
export type UserChipSize = 'sm' | 'md' | 'lg';
|
|
3
|
+
export interface UserChipProps {
|
|
4
|
+
/** Avatar image; when omitted or it fails to load, initials from `name` show. */
|
|
5
|
+
source?: ImageSourcePropType;
|
|
6
|
+
/**
|
|
7
|
+
* Name shown as the label and used for the avatar initials. When omitted, only
|
|
8
|
+
* the avatar renders (no pill) — the label's presence is driven by this prop.
|
|
9
|
+
*/
|
|
10
|
+
name?: string;
|
|
11
|
+
/** Explicit initials for the avatar fallback (overrides `name`). */
|
|
12
|
+
initials?: string;
|
|
13
|
+
/** Size preset — scales the avatar, text and the fixed pill width. Defaults to `md`. */
|
|
14
|
+
size?: UserChipSize;
|
|
15
|
+
/** Pill background. Defaults to `action.primary` (lime). */
|
|
16
|
+
backgroundColor?: string;
|
|
17
|
+
/** Text color. Defaults to `action.secondaryForeground`. */
|
|
18
|
+
color?: string;
|
|
19
|
+
/** Make the chip pressable. */
|
|
20
|
+
onPress?: () => void;
|
|
21
|
+
/** Override the container style. */
|
|
22
|
+
style?: StyleProp<ViewStyle>;
|
|
23
|
+
/** Accessibility label. Defaults to `name`. */
|
|
24
|
+
accessibilityLabel?: string;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* User chip — an `Avatar` with an optional name. With a `name` it renders the
|
|
28
|
+
* lime pill from Figma "User": the avatar flush on the left and the name in a
|
|
29
|
+
* fixed-width box that is centered when short and truncates with an ellipsis when
|
|
30
|
+
* long. Without a `name` it is just the avatar. The pill width is fixed per size.
|
|
31
|
+
*/
|
|
32
|
+
export declare function UserChip({ source, name, initials, size, backgroundColor, color, onPress, style, accessibilityLabel, }: UserChipProps): import("react/jsx-runtime").JSX.Element;
|
|
33
|
+
//# sourceMappingURL=UserChip.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UserChip.d.ts","sourceRoot":"","sources":["../../../../../src/components/UserChip/UserChip.tsx"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,mBAAmB,EACxB,KAAK,SAAS,EACd,KAAK,SAAS,EACf,MAAM,cAAc,CAAC;AAMtB,MAAM,MAAM,YAAY,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAE9C,MAAM,WAAW,aAAa;IAC5B,iFAAiF;IACjF,MAAM,CAAC,EAAE,mBAAmB,CAAC;IAC7B;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,oEAAoE;IACpE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,wFAAwF;IACxF,IAAI,CAAC,EAAE,YAAY,CAAC;IACpB,4DAA4D;IAC5D,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,4DAA4D;IAC5D,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,+BAA+B;IAC/B,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,oCAAoC;IACpC,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B,+CAA+C;IAC/C,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B;AAgBD;;;;;GAKG;AACH,wBAAgB,QAAQ,CAAC,EACvB,MAAM,EACN,IAAI,EACJ,QAAQ,EACR,IAAW,EACX,eAAe,EACf,KAAK,EACL,OAAO,EACP,KAAK,EACL,kBAAkB,GACnB,EAAE,aAAa,2CAqEf"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/UserChip/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,YAAY,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC"}
|
|
@@ -7,18 +7,22 @@ export * from './Chip';
|
|
|
7
7
|
export * from './CodeField';
|
|
8
8
|
export * from './CodeInput';
|
|
9
9
|
export * from './Dialog';
|
|
10
|
+
export * from './Dropdown';
|
|
10
11
|
export * from './Icon';
|
|
11
12
|
export * from './IconButton';
|
|
12
13
|
export * from './Input';
|
|
13
14
|
export * from './Keypad';
|
|
14
15
|
export * from './LinkButton';
|
|
16
|
+
export * from './Menu';
|
|
15
17
|
export * from './ProductCard';
|
|
16
18
|
export * from './QuantityStepper';
|
|
17
19
|
export * from './Radio';
|
|
20
|
+
export * from './Select';
|
|
18
21
|
export * from './Spinner';
|
|
19
22
|
export * from './Surface';
|
|
20
23
|
export * from './Switch';
|
|
21
24
|
export * from './Text';
|
|
22
25
|
export * from './Toast';
|
|
26
|
+
export * from './UserChip';
|
|
23
27
|
export type { LabelPosition } from './_internal/Labeled';
|
|
24
28
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,QAAQ,CAAC;AACvB,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,QAAQ,CAAC;AACvB,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,QAAQ,CAAC;AACvB,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,cAAc,CAAC;AAC7B,cAAc,QAAQ,CAAC;AACvB,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC;AACxB,cAAc,YAAY,CAAC;AAE3B,YAAY,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC"}
|
package/package.json
CHANGED
|
@@ -51,8 +51,10 @@ export interface CodeFieldProps {
|
|
|
51
51
|
disabled?: boolean;
|
|
52
52
|
/** Focus on mount. */
|
|
53
53
|
autoFocus?: boolean;
|
|
54
|
-
/** Cell width in px (Figma default 126). */
|
|
54
|
+
/** Cell width in px (Figma default 126). Ignored when `fullWidth` is set. */
|
|
55
55
|
cellWidth?: number;
|
|
56
|
+
/** Stretch the row to 100% of the container; cells share the width evenly. */
|
|
57
|
+
fullWidth?: boolean;
|
|
56
58
|
/** Cell height in px (Figma default 58). */
|
|
57
59
|
cellHeight?: number;
|
|
58
60
|
/** Gap between cells in px (Figma default 24). */
|
|
@@ -84,6 +86,7 @@ export function CodeField({
|
|
|
84
86
|
disabled = false,
|
|
85
87
|
autoFocus = false,
|
|
86
88
|
cellWidth = 126,
|
|
89
|
+
fullWidth = false,
|
|
87
90
|
cellHeight = 58,
|
|
88
91
|
gap = 24,
|
|
89
92
|
fontFamily,
|
|
@@ -106,7 +109,7 @@ export function CodeField({
|
|
|
106
109
|
const message = typeof error === 'string' ? error : helperText;
|
|
107
110
|
|
|
108
111
|
return (
|
|
109
|
-
<View style={[{ alignSelf: 'flex-start' }, style]}>
|
|
112
|
+
<View style={[fullWidth ? { alignSelf: 'stretch', width: '100%' } : { alignSelf: 'flex-start' }, style]}>
|
|
110
113
|
<Pressable
|
|
111
114
|
onPress={() => inputRef.current?.focus()}
|
|
112
115
|
disabled={disabled}
|
|
@@ -130,7 +133,7 @@ export function CodeField({
|
|
|
130
133
|
key={i}
|
|
131
134
|
testID="code-field-cell"
|
|
132
135
|
style={{
|
|
133
|
-
width: cellWidth,
|
|
136
|
+
...(fullWidth ? { flex: 1 } : { width: cellWidth }),
|
|
134
137
|
height: cellHeight,
|
|
135
138
|
borderRadius: theme.radii.pill,
|
|
136
139
|
borderWidth: 1,
|
|
@@ -0,0 +1,319 @@
|
|
|
1
|
+
import { Fragment, type ReactNode } from 'react';
|
|
2
|
+
import { Pressable, View, type StyleProp, type ViewStyle } from 'react-native';
|
|
3
|
+
import { useTheme } from '../../theme';
|
|
4
|
+
import type { RadiusToken } from '../../theme/spacing';
|
|
5
|
+
import { Checkbox } from '../Checkbox/Checkbox';
|
|
6
|
+
import { Icon } from '../Icon/Icon';
|
|
7
|
+
import type { IconName } from '../Icon/icons.generated';
|
|
8
|
+
import { Radio } from '../Radio/Radio';
|
|
9
|
+
import { Switch, type SwitchSize } from '../Switch/Switch';
|
|
10
|
+
import { Text } from '../Text/Text';
|
|
11
|
+
import { ScrollArea } from '../_internal/ScrollArea';
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* A leading/trailing slot on a row. Either a decorative/actionable control from
|
|
15
|
+
* the design system, or any custom node (avatar, flag, badge…).
|
|
16
|
+
*/
|
|
17
|
+
export type DropdownSlot =
|
|
18
|
+
| { kind: 'icon'; name: IconName; color?: string }
|
|
19
|
+
| { kind: 'iconButton'; name: IconName; onPress: () => void; color?: string; accessibilityLabel?: string }
|
|
20
|
+
| { kind: 'checkbox'; checked: boolean; onChange: (checked: boolean) => void; indeterminate?: boolean }
|
|
21
|
+
| { kind: 'switch'; value: boolean; onChange: (value: boolean) => void; size?: SwitchSize }
|
|
22
|
+
| { kind: 'radio'; selected: boolean; onChange: () => void }
|
|
23
|
+
| { kind: 'custom'; node: ReactNode };
|
|
24
|
+
|
|
25
|
+
export interface DropdownItemProps {
|
|
26
|
+
/** Primary text. */
|
|
27
|
+
label: string;
|
|
28
|
+
/** Optional secondary line under the label. */
|
|
29
|
+
description?: string;
|
|
30
|
+
/** Slot before the text (icon / control / custom). */
|
|
31
|
+
leading?: DropdownSlot;
|
|
32
|
+
/** Slot after the text (icon / control / custom). */
|
|
33
|
+
trailing?: DropdownSlot;
|
|
34
|
+
/** Row press. If omitted, tapping the row toggles the trailing (then leading) control when it is a checkbox / switch / radio. */
|
|
35
|
+
onPress?: () => void;
|
|
36
|
+
/** Highlight the row as selected. */
|
|
37
|
+
selected?: boolean;
|
|
38
|
+
/** Dim and block the row. */
|
|
39
|
+
disabled?: boolean;
|
|
40
|
+
/** Render the label (and icon slots) in the error color — for "Delete" etc. */
|
|
41
|
+
destructive?: boolean;
|
|
42
|
+
/** Minimum row height. Defaults to 58 (Figma). */
|
|
43
|
+
height?: number;
|
|
44
|
+
/** Horizontal padding. Defaults to 16 (Figma). */
|
|
45
|
+
paddingHorizontal?: number;
|
|
46
|
+
style?: StyleProp<ViewStyle>;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Checkbox/Switch/Radio wrap their control in `Labeled`, which defaults to
|
|
51
|
+
* `alignSelf: 'flex-start'`. Inside a row we want them vertically centered, so we
|
|
52
|
+
* override that (their `style` prop wins over the Labeled default).
|
|
53
|
+
*/
|
|
54
|
+
const CONTROL_ALIGN: ViewStyle = { alignSelf: 'center' };
|
|
55
|
+
|
|
56
|
+
/** Returns the toggle a control slot performs when the row itself is pressed. */
|
|
57
|
+
function slotToggle(slot?: DropdownSlot): (() => void) | undefined {
|
|
58
|
+
if (!slot) return undefined;
|
|
59
|
+
switch (slot.kind) {
|
|
60
|
+
case 'checkbox':
|
|
61
|
+
return () => slot.onChange(!slot.checked);
|
|
62
|
+
case 'switch':
|
|
63
|
+
return () => slot.onChange(!slot.value);
|
|
64
|
+
case 'radio':
|
|
65
|
+
return () => slot.onChange();
|
|
66
|
+
default:
|
|
67
|
+
return undefined;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
function Slot({
|
|
72
|
+
slot,
|
|
73
|
+
disabled,
|
|
74
|
+
destructive,
|
|
75
|
+
}: {
|
|
76
|
+
slot?: DropdownSlot;
|
|
77
|
+
disabled: boolean;
|
|
78
|
+
destructive: boolean;
|
|
79
|
+
}) {
|
|
80
|
+
const theme = useTheme();
|
|
81
|
+
if (!slot) return null;
|
|
82
|
+
const iconColor = destructive ? theme.colors.feedback.error : 'secondary';
|
|
83
|
+
switch (slot.kind) {
|
|
84
|
+
case 'icon':
|
|
85
|
+
return <Icon name={slot.name} size={24} color={slot.color ?? iconColor} />;
|
|
86
|
+
case 'iconButton':
|
|
87
|
+
return (
|
|
88
|
+
<Pressable
|
|
89
|
+
onPress={slot.onPress}
|
|
90
|
+
disabled={disabled}
|
|
91
|
+
hitSlop={8}
|
|
92
|
+
accessibilityRole="button"
|
|
93
|
+
accessibilityLabel={slot.accessibilityLabel}
|
|
94
|
+
style={{ opacity: disabled ? 0.5 : 1 }}
|
|
95
|
+
>
|
|
96
|
+
<Icon name={slot.name} size={24} color={slot.color ?? iconColor} />
|
|
97
|
+
</Pressable>
|
|
98
|
+
);
|
|
99
|
+
case 'checkbox':
|
|
100
|
+
return (
|
|
101
|
+
<Checkbox
|
|
102
|
+
checked={slot.checked}
|
|
103
|
+
onChange={slot.onChange}
|
|
104
|
+
indeterminate={slot.indeterminate}
|
|
105
|
+
disabled={disabled}
|
|
106
|
+
style={CONTROL_ALIGN}
|
|
107
|
+
/>
|
|
108
|
+
);
|
|
109
|
+
case 'switch':
|
|
110
|
+
return (
|
|
111
|
+
<Switch
|
|
112
|
+
value={slot.value}
|
|
113
|
+
onValueChange={slot.onChange}
|
|
114
|
+
size={slot.size ?? 'sm'}
|
|
115
|
+
disabled={disabled}
|
|
116
|
+
style={CONTROL_ALIGN}
|
|
117
|
+
/>
|
|
118
|
+
);
|
|
119
|
+
case 'radio':
|
|
120
|
+
return (
|
|
121
|
+
<Radio selected={slot.selected} onChange={slot.onChange} disabled={disabled} style={CONTROL_ALIGN} />
|
|
122
|
+
);
|
|
123
|
+
case 'custom':
|
|
124
|
+
return <>{slot.node}</>;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* A single dropdown / menu row: text with optional leading and trailing slots
|
|
130
|
+
* (icon, icon button, checkbox, switch, radio, or a custom node). Used on its
|
|
131
|
+
* own or, more commonly, inside `Dropdown`.
|
|
132
|
+
*/
|
|
133
|
+
export function DropdownItem({
|
|
134
|
+
label,
|
|
135
|
+
description,
|
|
136
|
+
leading,
|
|
137
|
+
trailing,
|
|
138
|
+
onPress,
|
|
139
|
+
selected = false,
|
|
140
|
+
disabled = false,
|
|
141
|
+
destructive = false,
|
|
142
|
+
height = 58,
|
|
143
|
+
paddingHorizontal = 16,
|
|
144
|
+
style,
|
|
145
|
+
}: DropdownItemProps) {
|
|
146
|
+
const theme = useTheme();
|
|
147
|
+
const rowPress = onPress ?? slotToggle(trailing) ?? slotToggle(leading);
|
|
148
|
+
|
|
149
|
+
const labelColor = disabled
|
|
150
|
+
? 'tertiary'
|
|
151
|
+
: destructive
|
|
152
|
+
? theme.colors.feedback.error
|
|
153
|
+
: 'primary';
|
|
154
|
+
|
|
155
|
+
return (
|
|
156
|
+
<Pressable
|
|
157
|
+
onPress={rowPress}
|
|
158
|
+
disabled={disabled || !rowPress}
|
|
159
|
+
accessibilityRole="menuitem"
|
|
160
|
+
accessibilityState={{ selected, disabled }}
|
|
161
|
+
style={({ pressed }) => [
|
|
162
|
+
{
|
|
163
|
+
flexDirection: 'row',
|
|
164
|
+
alignItems: 'center',
|
|
165
|
+
gap: 10,
|
|
166
|
+
minHeight: height,
|
|
167
|
+
paddingHorizontal,
|
|
168
|
+
paddingVertical: description ? 8 : 0,
|
|
169
|
+
backgroundColor: selected
|
|
170
|
+
? theme.colors.background.subtle
|
|
171
|
+
: pressed && rowPress
|
|
172
|
+
? theme.colors.background.muted
|
|
173
|
+
: 'transparent',
|
|
174
|
+
opacity: disabled ? 0.6 : 1,
|
|
175
|
+
},
|
|
176
|
+
style,
|
|
177
|
+
]}
|
|
178
|
+
>
|
|
179
|
+
<Slot slot={leading} disabled={disabled} destructive={destructive} />
|
|
180
|
+
|
|
181
|
+
<View style={{ flex: 1, minWidth: 0, gap: 2 }}>
|
|
182
|
+
<Text variant="bodyLarge" color={labelColor} numberOfLines={1}>
|
|
183
|
+
{label}
|
|
184
|
+
</Text>
|
|
185
|
+
{description ? (
|
|
186
|
+
<Text variant="bodySmall" color="tertiary" numberOfLines={2}>
|
|
187
|
+
{description}
|
|
188
|
+
</Text>
|
|
189
|
+
) : null}
|
|
190
|
+
</View>
|
|
191
|
+
|
|
192
|
+
<Slot slot={trailing} disabled={disabled} destructive={destructive} />
|
|
193
|
+
</Pressable>
|
|
194
|
+
);
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
/** An entry in a `Dropdown`: an item, a section header, or a divider. */
|
|
198
|
+
export type DropdownEntry =
|
|
199
|
+
| (DropdownItemProps & { key: string; type?: 'item' })
|
|
200
|
+
| { key: string; type: 'header'; label: string }
|
|
201
|
+
| { key: string; type: 'divider' };
|
|
202
|
+
|
|
203
|
+
export interface DropdownProps {
|
|
204
|
+
/** The rows to render (dynamic length). Mix items, headers and dividers. */
|
|
205
|
+
options: DropdownEntry[];
|
|
206
|
+
/** Called with the key of the pressed item (after its own `onPress`). */
|
|
207
|
+
onSelect?: (key: string) => void;
|
|
208
|
+
/** Panel width. Defaults to 350 (Figma). Pass a style with `width: '100%'` to fill a parent/trigger instead. */
|
|
209
|
+
width?: number;
|
|
210
|
+
/** Minimum panel width. */
|
|
211
|
+
minWidth?: number;
|
|
212
|
+
/** Max panel height; content scrolls beyond it. */
|
|
213
|
+
maxHeight?: number;
|
|
214
|
+
/** Draw hairline dividers between items. Defaults to true (Figma). */
|
|
215
|
+
showDividers?: boolean;
|
|
216
|
+
/** Vertical padding inside the panel. Defaults to 0 (rows meet the rounded edges, Figma). */
|
|
217
|
+
paddingVertical?: number;
|
|
218
|
+
/** Corner radius token. Defaults to `xl` (16). */
|
|
219
|
+
radius?: RadiusToken;
|
|
220
|
+
style?: StyleProp<ViewStyle>;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
/**
|
|
224
|
+
* Dropdown / menu panel — an elevated surface listing a dynamic set of options.
|
|
225
|
+
* Meant to be shown from a trigger (an Input select, an IconButton, …). Each row
|
|
226
|
+
* is a `DropdownItem`, so options can carry icons, checkboxes, switches, radios
|
|
227
|
+
* or custom nodes on either side. Supports section headers, dividers and scroll.
|
|
228
|
+
*/
|
|
229
|
+
export function Dropdown({
|
|
230
|
+
options,
|
|
231
|
+
onSelect,
|
|
232
|
+
width = 350,
|
|
233
|
+
minWidth,
|
|
234
|
+
maxHeight,
|
|
235
|
+
showDividers = true,
|
|
236
|
+
paddingVertical = 0,
|
|
237
|
+
radius = 'xl',
|
|
238
|
+
style,
|
|
239
|
+
}: DropdownProps) {
|
|
240
|
+
const theme = useTheme();
|
|
241
|
+
|
|
242
|
+
const itemEntries = options.filter((o) => o.type !== 'header' && o.type !== 'divider');
|
|
243
|
+
const lastItemKey = itemEntries[itemEntries.length - 1]?.key;
|
|
244
|
+
|
|
245
|
+
const rows = options.map((entry) => {
|
|
246
|
+
if (entry.type === 'divider') {
|
|
247
|
+
return (
|
|
248
|
+
<View
|
|
249
|
+
key={entry.key}
|
|
250
|
+
style={{ height: 1, backgroundColor: theme.colors.border.subtle, marginVertical: 4 }}
|
|
251
|
+
/>
|
|
252
|
+
);
|
|
253
|
+
}
|
|
254
|
+
if (entry.type === 'header') {
|
|
255
|
+
return (
|
|
256
|
+
<Text
|
|
257
|
+
key={entry.key}
|
|
258
|
+
variant="caption"
|
|
259
|
+
weight="medium"
|
|
260
|
+
color="tertiary"
|
|
261
|
+
style={{ paddingHorizontal: 16, paddingTop: 8, paddingBottom: 4 }}
|
|
262
|
+
>
|
|
263
|
+
{entry.label}
|
|
264
|
+
</Text>
|
|
265
|
+
);
|
|
266
|
+
}
|
|
267
|
+
const { key, type: _type, onPress, ...itemProps } = entry;
|
|
268
|
+
return (
|
|
269
|
+
<Fragment key={key}>
|
|
270
|
+
<DropdownItem
|
|
271
|
+
{...itemProps}
|
|
272
|
+
onPress={
|
|
273
|
+
onPress || onSelect
|
|
274
|
+
? () => {
|
|
275
|
+
onPress?.();
|
|
276
|
+
onSelect?.(key);
|
|
277
|
+
}
|
|
278
|
+
: undefined
|
|
279
|
+
}
|
|
280
|
+
/>
|
|
281
|
+
{showDividers && key !== lastItemKey ? (
|
|
282
|
+
<View style={{ height: 1, backgroundColor: theme.colors.border.subtle }} />
|
|
283
|
+
) : null}
|
|
284
|
+
</Fragment>
|
|
285
|
+
);
|
|
286
|
+
});
|
|
287
|
+
|
|
288
|
+
const body = <View style={{ paddingVertical }}>{rows}</View>;
|
|
289
|
+
|
|
290
|
+
return (
|
|
291
|
+
<View
|
|
292
|
+
style={[
|
|
293
|
+
{
|
|
294
|
+
width,
|
|
295
|
+
minWidth,
|
|
296
|
+
borderRadius: theme.radii[radius],
|
|
297
|
+
borderWidth: 1,
|
|
298
|
+
borderColor: theme.colors.border.default,
|
|
299
|
+
backgroundColor: theme.colors.background.default,
|
|
300
|
+
overflow: 'hidden',
|
|
301
|
+
// Figma "shadow-5".
|
|
302
|
+
boxShadow: [
|
|
303
|
+
{ offsetX: 0, offsetY: 8, blurRadius: 10, spreadDistance: -6, color: 'rgba(0, 0, 0, 0.04)' },
|
|
304
|
+
{ offsetX: 0, offsetY: 20, blurRadius: 25, spreadDistance: -5, color: 'rgba(0, 0, 0, 0.04)' },
|
|
305
|
+
] as ViewStyle['boxShadow'],
|
|
306
|
+
},
|
|
307
|
+
style,
|
|
308
|
+
]}
|
|
309
|
+
>
|
|
310
|
+
{maxHeight ? (
|
|
311
|
+
<ScrollArea style={{ maxHeight }} indicatorColor={theme.colors.border.strong}>
|
|
312
|
+
{body}
|
|
313
|
+
</ScrollArea>
|
|
314
|
+
) : (
|
|
315
|
+
body
|
|
316
|
+
)}
|
|
317
|
+
</View>
|
|
318
|
+
);
|
|
319
|
+
}
|