@bacon-pos/ui 0.5.1 → 0.7.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 (157) hide show
  1. package/lib/commonjs/components/Dropdown/Dropdown.js +282 -0
  2. package/lib/commonjs/components/Dropdown/Dropdown.js.map +1 -0
  3. package/lib/commonjs/components/Dropdown/Dropdown.stories.js +519 -0
  4. package/lib/commonjs/components/Dropdown/Dropdown.stories.js.map +1 -0
  5. package/lib/commonjs/components/Dropdown/Dropdown.test.js +113 -0
  6. package/lib/commonjs/components/Dropdown/Dropdown.test.js.map +1 -0
  7. package/lib/commonjs/components/Dropdown/index.js +19 -0
  8. package/lib/commonjs/components/Dropdown/index.js.map +1 -0
  9. package/lib/commonjs/components/Menu/Menu.js +214 -0
  10. package/lib/commonjs/components/Menu/Menu.js.map +1 -0
  11. package/lib/commonjs/components/Menu/Menu.test.js +71 -0
  12. package/lib/commonjs/components/Menu/Menu.test.js.map +1 -0
  13. package/lib/commonjs/components/Menu/MenuButton.js +73 -0
  14. package/lib/commonjs/components/Menu/MenuButton.js.map +1 -0
  15. package/lib/commonjs/components/Menu/MenuButton.stories.js +166 -0
  16. package/lib/commonjs/components/Menu/MenuButton.stories.js.map +1 -0
  17. package/lib/commonjs/components/Menu/SelectButton.js +143 -0
  18. package/lib/commonjs/components/Menu/SelectButton.js.map +1 -0
  19. package/lib/commonjs/components/Menu/SelectButton.stories.js +116 -0
  20. package/lib/commonjs/components/Menu/SelectButton.stories.js.map +1 -0
  21. package/lib/commonjs/components/Menu/SelectButton.test.js +80 -0
  22. package/lib/commonjs/components/Menu/SelectButton.test.js.map +1 -0
  23. package/lib/commonjs/components/Menu/UserMenu.js +73 -0
  24. package/lib/commonjs/components/Menu/UserMenu.js.map +1 -0
  25. package/lib/commonjs/components/Menu/UserMenu.stories.js +85 -0
  26. package/lib/commonjs/components/Menu/UserMenu.stories.js.map +1 -0
  27. package/lib/commonjs/components/Menu/UserMenu.test.js +52 -0
  28. package/lib/commonjs/components/Menu/UserMenu.test.js.map +1 -0
  29. package/lib/commonjs/components/Menu/index.js +34 -0
  30. package/lib/commonjs/components/Menu/index.js.map +1 -0
  31. package/lib/commonjs/components/Select/Select.js +246 -0
  32. package/lib/commonjs/components/Select/Select.js.map +1 -0
  33. package/lib/commonjs/components/Select/Select.stories.js +221 -0
  34. package/lib/commonjs/components/Select/Select.stories.js.map +1 -0
  35. package/lib/commonjs/components/Select/Select.test.js +165 -0
  36. package/lib/commonjs/components/Select/Select.test.js.map +1 -0
  37. package/lib/commonjs/components/Select/index.js +13 -0
  38. package/lib/commonjs/components/Select/index.js.map +1 -0
  39. package/lib/commonjs/components/UserChip/UserChip.js +121 -0
  40. package/lib/commonjs/components/UserChip/UserChip.js.map +1 -0
  41. package/lib/commonjs/components/UserChip/UserChip.stories.js +153 -0
  42. package/lib/commonjs/components/UserChip/UserChip.stories.js.map +1 -0
  43. package/lib/commonjs/components/UserChip/UserChip.test.js +59 -0
  44. package/lib/commonjs/components/UserChip/UserChip.test.js.map +1 -0
  45. package/lib/commonjs/components/UserChip/index.js +13 -0
  46. package/lib/commonjs/components/UserChip/index.js.map +1 -0
  47. package/lib/commonjs/components/index.js +57 -13
  48. package/lib/commonjs/components/index.js.map +1 -1
  49. package/lib/module/components/Dropdown/Dropdown.js +277 -0
  50. package/lib/module/components/Dropdown/Dropdown.js.map +1 -0
  51. package/lib/module/components/Dropdown/Dropdown.stories.js +515 -0
  52. package/lib/module/components/Dropdown/Dropdown.stories.js.map +1 -0
  53. package/lib/module/components/Dropdown/Dropdown.test.js +113 -0
  54. package/lib/module/components/Dropdown/Dropdown.test.js.map +1 -0
  55. package/lib/module/components/Dropdown/index.js +4 -0
  56. package/lib/module/components/Dropdown/index.js.map +1 -0
  57. package/lib/module/components/Menu/Menu.js +210 -0
  58. package/lib/module/components/Menu/Menu.js.map +1 -0
  59. package/lib/module/components/Menu/Menu.test.js +71 -0
  60. package/lib/module/components/Menu/Menu.test.js.map +1 -0
  61. package/lib/module/components/Menu/MenuButton.js +69 -0
  62. package/lib/module/components/Menu/MenuButton.js.map +1 -0
  63. package/lib/module/components/Menu/MenuButton.stories.js +162 -0
  64. package/lib/module/components/Menu/MenuButton.stories.js.map +1 -0
  65. package/lib/module/components/Menu/SelectButton.js +139 -0
  66. package/lib/module/components/Menu/SelectButton.js.map +1 -0
  67. package/lib/module/components/Menu/SelectButton.stories.js +112 -0
  68. package/lib/module/components/Menu/SelectButton.stories.js.map +1 -0
  69. package/lib/module/components/Menu/SelectButton.test.js +80 -0
  70. package/lib/module/components/Menu/SelectButton.test.js.map +1 -0
  71. package/lib/module/components/Menu/UserMenu.js +69 -0
  72. package/lib/module/components/Menu/UserMenu.js.map +1 -0
  73. package/lib/module/components/Menu/UserMenu.stories.js +81 -0
  74. package/lib/module/components/Menu/UserMenu.stories.js.map +1 -0
  75. package/lib/module/components/Menu/UserMenu.test.js +52 -0
  76. package/lib/module/components/Menu/UserMenu.test.js.map +1 -0
  77. package/lib/module/components/Menu/index.js +7 -0
  78. package/lib/module/components/Menu/index.js.map +1 -0
  79. package/lib/module/components/Select/Select.js +244 -0
  80. package/lib/module/components/Select/Select.js.map +1 -0
  81. package/lib/module/components/Select/Select.stories.js +217 -0
  82. package/lib/module/components/Select/Select.stories.js.map +1 -0
  83. package/lib/module/components/Select/Select.test.js +165 -0
  84. package/lib/module/components/Select/Select.test.js.map +1 -0
  85. package/lib/module/components/Select/index.js +4 -0
  86. package/lib/module/components/Select/index.js.map +1 -0
  87. package/lib/module/components/UserChip/UserChip.js +117 -0
  88. package/lib/module/components/UserChip/UserChip.js.map +1 -0
  89. package/lib/module/components/UserChip/UserChip.stories.js +149 -0
  90. package/lib/module/components/UserChip/UserChip.stories.js.map +1 -0
  91. package/lib/module/components/UserChip/UserChip.test.js +59 -0
  92. package/lib/module/components/UserChip/UserChip.test.js.map +1 -0
  93. package/lib/module/components/UserChip/index.js +4 -0
  94. package/lib/module/components/UserChip/index.js.map +1 -0
  95. package/lib/module/components/index.js +4 -0
  96. package/lib/module/components/index.js.map +1 -1
  97. package/lib/typescript/commonjs/components/Dropdown/Dropdown.d.ts +105 -0
  98. package/lib/typescript/commonjs/components/Dropdown/Dropdown.d.ts.map +1 -0
  99. package/lib/typescript/commonjs/components/Dropdown/index.d.ts +3 -0
  100. package/lib/typescript/commonjs/components/Dropdown/index.d.ts.map +1 -0
  101. package/lib/typescript/commonjs/components/Menu/Menu.d.ts +66 -0
  102. package/lib/typescript/commonjs/components/Menu/Menu.d.ts.map +1 -0
  103. package/lib/typescript/commonjs/components/Menu/MenuButton.d.ts +46 -0
  104. package/lib/typescript/commonjs/components/Menu/MenuButton.d.ts.map +1 -0
  105. package/lib/typescript/commonjs/components/Menu/SelectButton.d.ts +60 -0
  106. package/lib/typescript/commonjs/components/Menu/SelectButton.d.ts.map +1 -0
  107. package/lib/typescript/commonjs/components/Menu/UserMenu.d.ts +46 -0
  108. package/lib/typescript/commonjs/components/Menu/UserMenu.d.ts.map +1 -0
  109. package/lib/typescript/commonjs/components/Menu/index.d.ts +9 -0
  110. package/lib/typescript/commonjs/components/Menu/index.d.ts.map +1 -0
  111. package/lib/typescript/commonjs/components/Select/Select.d.ts +73 -0
  112. package/lib/typescript/commonjs/components/Select/Select.d.ts.map +1 -0
  113. package/lib/typescript/commonjs/components/Select/index.d.ts +3 -0
  114. package/lib/typescript/commonjs/components/Select/index.d.ts.map +1 -0
  115. package/lib/typescript/commonjs/components/UserChip/UserChip.d.ts +33 -0
  116. package/lib/typescript/commonjs/components/UserChip/UserChip.d.ts.map +1 -0
  117. package/lib/typescript/commonjs/components/UserChip/index.d.ts +3 -0
  118. package/lib/typescript/commonjs/components/UserChip/index.d.ts.map +1 -0
  119. package/lib/typescript/commonjs/components/index.d.ts +4 -0
  120. package/lib/typescript/commonjs/components/index.d.ts.map +1 -1
  121. package/lib/typescript/module/components/Dropdown/Dropdown.d.ts +105 -0
  122. package/lib/typescript/module/components/Dropdown/Dropdown.d.ts.map +1 -0
  123. package/lib/typescript/module/components/Dropdown/index.d.ts +3 -0
  124. package/lib/typescript/module/components/Dropdown/index.d.ts.map +1 -0
  125. package/lib/typescript/module/components/Menu/Menu.d.ts +66 -0
  126. package/lib/typescript/module/components/Menu/Menu.d.ts.map +1 -0
  127. package/lib/typescript/module/components/Menu/MenuButton.d.ts +46 -0
  128. package/lib/typescript/module/components/Menu/MenuButton.d.ts.map +1 -0
  129. package/lib/typescript/module/components/Menu/SelectButton.d.ts +60 -0
  130. package/lib/typescript/module/components/Menu/SelectButton.d.ts.map +1 -0
  131. package/lib/typescript/module/components/Menu/UserMenu.d.ts +46 -0
  132. package/lib/typescript/module/components/Menu/UserMenu.d.ts.map +1 -0
  133. package/lib/typescript/module/components/Menu/index.d.ts +9 -0
  134. package/lib/typescript/module/components/Menu/index.d.ts.map +1 -0
  135. package/lib/typescript/module/components/Select/Select.d.ts +73 -0
  136. package/lib/typescript/module/components/Select/Select.d.ts.map +1 -0
  137. package/lib/typescript/module/components/Select/index.d.ts +3 -0
  138. package/lib/typescript/module/components/Select/index.d.ts.map +1 -0
  139. package/lib/typescript/module/components/UserChip/UserChip.d.ts +33 -0
  140. package/lib/typescript/module/components/UserChip/UserChip.d.ts.map +1 -0
  141. package/lib/typescript/module/components/UserChip/index.d.ts +3 -0
  142. package/lib/typescript/module/components/UserChip/index.d.ts.map +1 -0
  143. package/lib/typescript/module/components/index.d.ts +4 -0
  144. package/lib/typescript/module/components/index.d.ts.map +1 -1
  145. package/package.json +1 -1
  146. package/src/components/Dropdown/Dropdown.tsx +319 -0
  147. package/src/components/Dropdown/index.ts +2 -0
  148. package/src/components/Menu/Menu.tsx +249 -0
  149. package/src/components/Menu/MenuButton.tsx +98 -0
  150. package/src/components/Menu/SelectButton.tsx +171 -0
  151. package/src/components/Menu/UserMenu.tsx +100 -0
  152. package/src/components/Menu/index.ts +14 -0
  153. package/src/components/Select/Select.tsx +323 -0
  154. package/src/components/Select/index.ts +2 -0
  155. package/src/components/UserChip/UserChip.tsx +138 -0
  156. package/src/components/UserChip/index.ts +2 -0
  157. package/src/components/index.ts +4 -0
@@ -0,0 +1,46 @@
1
+ import type { ImageSourcePropType } from 'react-native';
2
+ import { type DropdownEntry } from '../Dropdown/Dropdown';
3
+ import { type UserChipSize } from '../UserChip/UserChip';
4
+ import { type MenuOrigin } from './Menu';
5
+ export interface UserMenuProps {
6
+ /** The menu rows (see `Dropdown`). */
7
+ options: DropdownEntry[];
8
+ /** Called with the key of the selected row. */
9
+ onSelect?: (key: string) => void;
10
+ /** Avatar image for the trigger. */
11
+ source?: ImageSourcePropType;
12
+ /** Name for the trigger. With a name the trigger is the `UserChip` pill; without it, just the avatar. */
13
+ name?: string;
14
+ /** Explicit avatar initials. */
15
+ initials?: string;
16
+ /** Trigger size. Defaults to `md`. */
17
+ size?: UserChipSize;
18
+ /** Trigger pill background (when a name is shown). */
19
+ chipBackgroundColor?: string;
20
+ /** Trigger text color (when a name is shown). */
21
+ chipColor?: string;
22
+ /** Point on the trigger the menu latches to. Defaults to `{ bottom, left }`. */
23
+ anchorOrigin?: MenuOrigin;
24
+ /** Point on the menu placed at the anchor. Defaults to `{ top, left }`. */
25
+ menuOrigin?: MenuOrigin;
26
+ /** Gap between trigger and menu. Defaults to 8. */
27
+ offset?: number;
28
+ /** Menu width. Defaults to the `Dropdown` default (350). */
29
+ menuWidth?: number;
30
+ /** Draw dividers between rows. Defaults to the `Dropdown` default (true). */
31
+ showDividers?: boolean;
32
+ /** Close the menu after a row is selected. Defaults to true. */
33
+ closeOnSelect?: boolean;
34
+ /** Controlled open state. */
35
+ open?: boolean;
36
+ /** Notified whenever the open state changes. */
37
+ onOpenChange?: (open: boolean) => void;
38
+ }
39
+ /**
40
+ * User menu — an avatar / `UserChip` that opens an anchored `Dropdown` (e.g. an
41
+ * account menu). A composed component built from `UserChip` + `Menu` +
42
+ * `Dropdown`. Pass a `name` to use the labelled pill as the trigger, or omit it
43
+ * for just the avatar. Dismisses on outside press / back button.
44
+ */
45
+ export declare function UserMenu({ options, onSelect, source, name, initials, size, chipBackgroundColor, chipColor, anchorOrigin, menuOrigin, offset, menuWidth, showDividers, closeOnSelect, open, onOpenChange, }: UserMenuProps): import("react/jsx-runtime").JSX.Element;
46
+ //# sourceMappingURL=UserMenu.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UserMenu.d.ts","sourceRoot":"","sources":["../../../../../src/components/Menu/UserMenu.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AACxD,OAAO,EAAY,KAAK,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACpE,OAAO,EAAY,KAAK,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACnE,OAAO,EAAQ,KAAK,UAAU,EAAE,MAAM,QAAQ,CAAC;AAE/C,MAAM,WAAW,aAAa;IAC5B,sCAAsC;IACtC,OAAO,EAAE,aAAa,EAAE,CAAC;IACzB,+CAA+C;IAC/C,QAAQ,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IAEjC,oCAAoC;IACpC,MAAM,CAAC,EAAE,mBAAmB,CAAC;IAC7B,yGAAyG;IACzG,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,gCAAgC;IAChC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,sCAAsC;IACtC,IAAI,CAAC,EAAE,YAAY,CAAC;IACpB,sDAAsD;IACtD,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,iDAAiD;IACjD,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,gFAAgF;IAChF,YAAY,CAAC,EAAE,UAAU,CAAC;IAC1B,2EAA2E;IAC3E,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,mDAAmD;IACnD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,4DAA4D;IAC5D,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,6EAA6E;IAC7E,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,gEAAgE;IAChE,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,6BAA6B;IAC7B,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,gDAAgD;IAChD,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;CACxC;AAED;;;;;GAKG;AACH,wBAAgB,QAAQ,CAAC,EACvB,OAAO,EACP,QAAQ,EACR,MAAM,EACN,IAAI,EACJ,QAAQ,EACR,IAAW,EACX,mBAAmB,EACnB,SAAS,EACT,YAAyD,EACzD,UAAoD,EACpD,MAAU,EACV,SAAS,EACT,YAAY,EACZ,aAAoB,EACpB,IAAI,EACJ,YAAY,GACb,EAAE,aAAa,2CAkCf"}
@@ -0,0 +1,9 @@
1
+ export { Menu } from './Menu';
2
+ export type { MenuProps, MenuOrigin, MenuTriggerState, OriginVertical, OriginHorizontal, } from './Menu';
3
+ export { MenuButton } from './MenuButton';
4
+ export type { MenuButtonProps } from './MenuButton';
5
+ export { SelectButton } from './SelectButton';
6
+ export type { SelectButtonProps, SelectButtonOption } from './SelectButton';
7
+ export { UserMenu } from './UserMenu';
8
+ export type { UserMenuProps } from './UserMenu';
9
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/Menu/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,YAAY,EACV,SAAS,EACT,UAAU,EACV,gBAAgB,EAChB,cAAc,EACd,gBAAgB,GACjB,MAAM,QAAQ,CAAC;AAChB,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,YAAY,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,YAAY,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAC5E,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,YAAY,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC"}
@@ -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,3 @@
1
+ export { Select } from './Select';
2
+ export type { SelectProps, SelectOption, SelectSize } from './Select';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -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,3 @@
1
+ export { UserChip } from './UserChip';
2
+ export type { UserChipProps, UserChipSize } from './UserChip';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -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;AAExB,YAAY,EAAE,aAAa,EAAE,MAAM,qBAAqB,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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bacon-pos/ui",
3
- "version": "0.5.1",
3
+ "version": "0.7.0",
4
4
  "description": "Bacon POS design system — React Native component library",
5
5
  "main": "./lib/commonjs/index.js",
6
6
  "module": "./lib/module/index.js",
@@ -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
+ }
@@ -0,0 +1,2 @@
1
+ export { Dropdown, DropdownItem } from './Dropdown';
2
+ export type { DropdownProps, DropdownItemProps, DropdownEntry, DropdownSlot } from './Dropdown';