@bacon-pos/ui 0.5.1 → 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.
Files changed (140) 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 +421 -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/index.js +27 -0
  24. package/lib/commonjs/components/Menu/index.js.map +1 -0
  25. package/lib/commonjs/components/Select/Select.js +246 -0
  26. package/lib/commonjs/components/Select/Select.js.map +1 -0
  27. package/lib/commonjs/components/Select/Select.stories.js +221 -0
  28. package/lib/commonjs/components/Select/Select.stories.js.map +1 -0
  29. package/lib/commonjs/components/Select/Select.test.js +165 -0
  30. package/lib/commonjs/components/Select/Select.test.js.map +1 -0
  31. package/lib/commonjs/components/Select/index.js +13 -0
  32. package/lib/commonjs/components/Select/index.js.map +1 -0
  33. package/lib/commonjs/components/UserChip/UserChip.js +121 -0
  34. package/lib/commonjs/components/UserChip/UserChip.js.map +1 -0
  35. package/lib/commonjs/components/UserChip/UserChip.stories.js +153 -0
  36. package/lib/commonjs/components/UserChip/UserChip.stories.js.map +1 -0
  37. package/lib/commonjs/components/UserChip/UserChip.test.js +59 -0
  38. package/lib/commonjs/components/UserChip/UserChip.test.js.map +1 -0
  39. package/lib/commonjs/components/UserChip/index.js +13 -0
  40. package/lib/commonjs/components/UserChip/index.js.map +1 -0
  41. package/lib/commonjs/components/index.js +57 -13
  42. package/lib/commonjs/components/index.js.map +1 -1
  43. package/lib/module/components/Dropdown/Dropdown.js +277 -0
  44. package/lib/module/components/Dropdown/Dropdown.js.map +1 -0
  45. package/lib/module/components/Dropdown/Dropdown.stories.js +417 -0
  46. package/lib/module/components/Dropdown/Dropdown.stories.js.map +1 -0
  47. package/lib/module/components/Dropdown/Dropdown.test.js +113 -0
  48. package/lib/module/components/Dropdown/Dropdown.test.js.map +1 -0
  49. package/lib/module/components/Dropdown/index.js +4 -0
  50. package/lib/module/components/Dropdown/index.js.map +1 -0
  51. package/lib/module/components/Menu/Menu.js +210 -0
  52. package/lib/module/components/Menu/Menu.js.map +1 -0
  53. package/lib/module/components/Menu/Menu.test.js +71 -0
  54. package/lib/module/components/Menu/Menu.test.js.map +1 -0
  55. package/lib/module/components/Menu/MenuButton.js +69 -0
  56. package/lib/module/components/Menu/MenuButton.js.map +1 -0
  57. package/lib/module/components/Menu/MenuButton.stories.js +162 -0
  58. package/lib/module/components/Menu/MenuButton.stories.js.map +1 -0
  59. package/lib/module/components/Menu/SelectButton.js +139 -0
  60. package/lib/module/components/Menu/SelectButton.js.map +1 -0
  61. package/lib/module/components/Menu/SelectButton.stories.js +112 -0
  62. package/lib/module/components/Menu/SelectButton.stories.js.map +1 -0
  63. package/lib/module/components/Menu/SelectButton.test.js +80 -0
  64. package/lib/module/components/Menu/SelectButton.test.js.map +1 -0
  65. package/lib/module/components/Menu/index.js +6 -0
  66. package/lib/module/components/Menu/index.js.map +1 -0
  67. package/lib/module/components/Select/Select.js +244 -0
  68. package/lib/module/components/Select/Select.js.map +1 -0
  69. package/lib/module/components/Select/Select.stories.js +217 -0
  70. package/lib/module/components/Select/Select.stories.js.map +1 -0
  71. package/lib/module/components/Select/Select.test.js +165 -0
  72. package/lib/module/components/Select/Select.test.js.map +1 -0
  73. package/lib/module/components/Select/index.js +4 -0
  74. package/lib/module/components/Select/index.js.map +1 -0
  75. package/lib/module/components/UserChip/UserChip.js +117 -0
  76. package/lib/module/components/UserChip/UserChip.js.map +1 -0
  77. package/lib/module/components/UserChip/UserChip.stories.js +149 -0
  78. package/lib/module/components/UserChip/UserChip.stories.js.map +1 -0
  79. package/lib/module/components/UserChip/UserChip.test.js +59 -0
  80. package/lib/module/components/UserChip/UserChip.test.js.map +1 -0
  81. package/lib/module/components/UserChip/index.js +4 -0
  82. package/lib/module/components/UserChip/index.js.map +1 -0
  83. package/lib/module/components/index.js +4 -0
  84. package/lib/module/components/index.js.map +1 -1
  85. package/lib/typescript/commonjs/components/Dropdown/Dropdown.d.ts +105 -0
  86. package/lib/typescript/commonjs/components/Dropdown/Dropdown.d.ts.map +1 -0
  87. package/lib/typescript/commonjs/components/Dropdown/index.d.ts +3 -0
  88. package/lib/typescript/commonjs/components/Dropdown/index.d.ts.map +1 -0
  89. package/lib/typescript/commonjs/components/Menu/Menu.d.ts +66 -0
  90. package/lib/typescript/commonjs/components/Menu/Menu.d.ts.map +1 -0
  91. package/lib/typescript/commonjs/components/Menu/MenuButton.d.ts +46 -0
  92. package/lib/typescript/commonjs/components/Menu/MenuButton.d.ts.map +1 -0
  93. package/lib/typescript/commonjs/components/Menu/SelectButton.d.ts +60 -0
  94. package/lib/typescript/commonjs/components/Menu/SelectButton.d.ts.map +1 -0
  95. package/lib/typescript/commonjs/components/Menu/index.d.ts +7 -0
  96. package/lib/typescript/commonjs/components/Menu/index.d.ts.map +1 -0
  97. package/lib/typescript/commonjs/components/Select/Select.d.ts +73 -0
  98. package/lib/typescript/commonjs/components/Select/Select.d.ts.map +1 -0
  99. package/lib/typescript/commonjs/components/Select/index.d.ts +3 -0
  100. package/lib/typescript/commonjs/components/Select/index.d.ts.map +1 -0
  101. package/lib/typescript/commonjs/components/UserChip/UserChip.d.ts +33 -0
  102. package/lib/typescript/commonjs/components/UserChip/UserChip.d.ts.map +1 -0
  103. package/lib/typescript/commonjs/components/UserChip/index.d.ts +3 -0
  104. package/lib/typescript/commonjs/components/UserChip/index.d.ts.map +1 -0
  105. package/lib/typescript/commonjs/components/index.d.ts +4 -0
  106. package/lib/typescript/commonjs/components/index.d.ts.map +1 -1
  107. package/lib/typescript/module/components/Dropdown/Dropdown.d.ts +105 -0
  108. package/lib/typescript/module/components/Dropdown/Dropdown.d.ts.map +1 -0
  109. package/lib/typescript/module/components/Dropdown/index.d.ts +3 -0
  110. package/lib/typescript/module/components/Dropdown/index.d.ts.map +1 -0
  111. package/lib/typescript/module/components/Menu/Menu.d.ts +66 -0
  112. package/lib/typescript/module/components/Menu/Menu.d.ts.map +1 -0
  113. package/lib/typescript/module/components/Menu/MenuButton.d.ts +46 -0
  114. package/lib/typescript/module/components/Menu/MenuButton.d.ts.map +1 -0
  115. package/lib/typescript/module/components/Menu/SelectButton.d.ts +60 -0
  116. package/lib/typescript/module/components/Menu/SelectButton.d.ts.map +1 -0
  117. package/lib/typescript/module/components/Menu/index.d.ts +7 -0
  118. package/lib/typescript/module/components/Menu/index.d.ts.map +1 -0
  119. package/lib/typescript/module/components/Select/Select.d.ts +73 -0
  120. package/lib/typescript/module/components/Select/Select.d.ts.map +1 -0
  121. package/lib/typescript/module/components/Select/index.d.ts +3 -0
  122. package/lib/typescript/module/components/Select/index.d.ts.map +1 -0
  123. package/lib/typescript/module/components/UserChip/UserChip.d.ts +33 -0
  124. package/lib/typescript/module/components/UserChip/UserChip.d.ts.map +1 -0
  125. package/lib/typescript/module/components/UserChip/index.d.ts +3 -0
  126. package/lib/typescript/module/components/UserChip/index.d.ts.map +1 -0
  127. package/lib/typescript/module/components/index.d.ts +4 -0
  128. package/lib/typescript/module/components/index.d.ts.map +1 -1
  129. package/package.json +1 -1
  130. package/src/components/Dropdown/Dropdown.tsx +319 -0
  131. package/src/components/Dropdown/index.ts +2 -0
  132. package/src/components/Menu/Menu.tsx +249 -0
  133. package/src/components/Menu/MenuButton.tsx +98 -0
  134. package/src/components/Menu/SelectButton.tsx +171 -0
  135. package/src/components/Menu/index.ts +12 -0
  136. package/src/components/Select/Select.tsx +323 -0
  137. package/src/components/Select/index.ts +2 -0
  138. package/src/components/UserChip/UserChip.tsx +138 -0
  139. package/src/components/UserChip/index.ts +2 -0
  140. package/src/components/index.ts +4 -0
@@ -0,0 +1,143 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.SelectButton = SelectButton;
7
+ var _react = require("react");
8
+ var _index = require("../../theme/index.js");
9
+ var _Button = require("../Button/Button.js");
10
+ var _Dropdown = require("../Dropdown/Dropdown.js");
11
+ var _Icon = require("../Icon/Icon.js");
12
+ var _Menu = require("./Menu.js");
13
+ var _jsxRuntime = require("react/jsx-runtime");
14
+ /** A selectable option. Its `icon` shows both in the row and on the trigger when chosen. */
15
+
16
+ /** Button foreground per variant — mirrors Button so the trigger icon matches the label. */
17
+ function triggerForeground(theme, variant) {
18
+ const {
19
+ action,
20
+ state
21
+ } = theme.colors;
22
+ switch (variant) {
23
+ case 'secondary':
24
+ return action.secondaryForeground;
25
+ case 'inverse':
26
+ return action.inverseForeground;
27
+ case 'destructive':
28
+ return state.destructiveSubtleForeground;
29
+ case 'success':
30
+ return state.successForeground;
31
+ case 'successSubtle':
32
+ return state.successSubtleForeground;
33
+ default:
34
+ return action.primaryForeground;
35
+ }
36
+ }
37
+
38
+ /**
39
+ * Select-style button — a `Button` (label + leading icon) that opens an anchored
40
+ * `Dropdown` to change its value; the current option is marked with a check.
41
+ * A composed component built from `Button` + `Menu` + `Dropdown`. Controlled via
42
+ * `value` / `onChange`, or uncontrolled via `defaultValue`.
43
+ */
44
+ function SelectButton({
45
+ options,
46
+ value: valueProp,
47
+ defaultValue,
48
+ onChange,
49
+ placeholder = 'Select',
50
+ placeholderIcon,
51
+ showSelectedIcon = true,
52
+ chevron = false,
53
+ variant = 'secondary',
54
+ size = 'sm',
55
+ fullWidth = false,
56
+ disabled = false,
57
+ anchorOrigin = {
58
+ vertical: 'bottom',
59
+ horizontal: 'left'
60
+ },
61
+ menuOrigin = {
62
+ vertical: 'top',
63
+ horizontal: 'left'
64
+ },
65
+ offset = 8,
66
+ menuWidth,
67
+ showDividers,
68
+ closeOnSelect = true,
69
+ open,
70
+ onOpenChange
71
+ }) {
72
+ const theme = (0, _index.useTheme)();
73
+ const isControlled = valueProp !== undefined;
74
+ const [uncontrolled, setUncontrolled] = (0, _react.useState)(defaultValue);
75
+ const value = isControlled ? valueProp : uncontrolled;
76
+ const selected = options.find(o => o.key === value);
77
+ const label = selected?.label ?? placeholder;
78
+ const triggerIcon = selected?.icon ?? placeholderIcon;
79
+ const fg = triggerForeground(theme, variant);
80
+ const iconSize = size === 'sm' ? 20 : 24;
81
+ const setValue = key => {
82
+ if (!isControlled) setUncontrolled(key);
83
+ onChange?.(key);
84
+ };
85
+ const rows = options.map(o => ({
86
+ key: o.key,
87
+ label: o.label,
88
+ disabled: o.disabled,
89
+ leading: o.icon ? {
90
+ kind: 'icon',
91
+ name: o.icon
92
+ } : undefined,
93
+ trailing: o.key === value ? {
94
+ kind: 'icon',
95
+ name: 'check',
96
+ color: theme.colors.feedback.success
97
+ } : undefined
98
+ }));
99
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Menu.Menu, {
100
+ anchorOrigin: anchorOrigin,
101
+ menuOrigin: menuOrigin,
102
+ offset: offset,
103
+ open: open,
104
+ onOpenChange: onOpenChange,
105
+ triggerStyle: fullWidth ? {
106
+ alignSelf: 'stretch'
107
+ } : undefined,
108
+ renderTrigger: ({
109
+ toggle
110
+ }) => /*#__PURE__*/(0, _jsxRuntime.jsx)(_Button.Button, {
111
+ label: label,
112
+ variant: variant,
113
+ size: size,
114
+ fullWidth: fullWidth,
115
+ disabled: disabled,
116
+ onPress: toggle,
117
+ leftIcon: showSelectedIcon && triggerIcon ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_Icon.Icon, {
118
+ name: triggerIcon,
119
+ size: iconSize,
120
+ color: fg
121
+ }) : undefined,
122
+ rightIcon: chevron ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_Icon.Icon, {
123
+ name: "chevron-down",
124
+ size: iconSize,
125
+ color: fg
126
+ }) : undefined
127
+ }),
128
+ children: ({
129
+ close,
130
+ maxHeight
131
+ }) => /*#__PURE__*/(0, _jsxRuntime.jsx)(_Dropdown.Dropdown, {
132
+ options: rows,
133
+ width: menuWidth,
134
+ maxHeight: maxHeight,
135
+ showDividers: showDividers,
136
+ onSelect: key => {
137
+ setValue(key);
138
+ if (closeOnSelect) close();
139
+ }
140
+ })
141
+ });
142
+ }
143
+ //# sourceMappingURL=SelectButton.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_react","require","_index","_Button","_Dropdown","_Icon","_Menu","_jsxRuntime","triggerForeground","theme","variant","action","state","colors","secondaryForeground","inverseForeground","destructiveSubtleForeground","successForeground","successSubtleForeground","primaryForeground","SelectButton","options","value","valueProp","defaultValue","onChange","placeholder","placeholderIcon","showSelectedIcon","chevron","size","fullWidth","disabled","anchorOrigin","vertical","horizontal","menuOrigin","offset","menuWidth","showDividers","closeOnSelect","open","onOpenChange","useTheme","isControlled","undefined","uncontrolled","setUncontrolled","useState","selected","find","o","key","label","triggerIcon","icon","fg","iconSize","setValue","rows","map","leading","kind","name","trailing","color","feedback","success","jsx","Menu","triggerStyle","alignSelf","renderTrigger","toggle","Button","onPress","leftIcon","Icon","rightIcon","children","close","maxHeight","Dropdown","width","onSelect"],"sourceRoot":"..\\..\\..\\..\\src","sources":["components/Menu/SelectButton.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AACA,IAAAG,SAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AAEA,IAAAK,KAAA,GAAAL,OAAA;AAA+C,IAAAM,WAAA,GAAAN,OAAA;AAE/C;;AAmDA;AACA,SAASO,iBAAiBA,CAACC,KAAkC,EAAEC,OAAsB,EAAU;EAC7F,MAAM;IAAEC,MAAM;IAAEC;EAAM,CAAC,GAAGH,KAAK,CAACI,MAAM;EACtC,QAAQH,OAAO;IACb,KAAK,WAAW;MACd,OAAOC,MAAM,CAACG,mBAAmB;IACnC,KAAK,SAAS;MACZ,OAAOH,MAAM,CAACI,iBAAiB;IACjC,KAAK,aAAa;MAChB,OAAOH,KAAK,CAACI,2BAA2B;IAC1C,KAAK,SAAS;MACZ,OAAOJ,KAAK,CAACK,iBAAiB;IAChC,KAAK,eAAe;MAClB,OAAOL,KAAK,CAACM,uBAAuB;IACtC;MACE,OAAOP,MAAM,CAACQ,iBAAiB;EACnC;AACF;;AAEA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,YAAYA,CAAC;EAC3BC,OAAO;EACPC,KAAK,EAAEC,SAAS;EAChBC,YAAY;EACZC,QAAQ;EACRC,WAAW,GAAG,QAAQ;EACtBC,eAAe;EACfC,gBAAgB,GAAG,IAAI;EACvBC,OAAO,GAAG,KAAK;EACfnB,OAAO,GAAG,WAAW;EACrBoB,IAAI,GAAG,IAAI;EACXC,SAAS,GAAG,KAAK;EACjBC,QAAQ,GAAG,KAAK;EAChBC,YAAY,GAAG;IAAEC,QAAQ,EAAE,QAAQ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CAAE,CAAC,GAAGX;IAAU,CAC1F,CACD;IAAAkC,QAAA,EAEDA,CAAC;MAAEC,KAAK;MAAEC;IAAU,CAAC,kBACpB,IAAA1E,WAAA,CAAA6D,GAAA,EAAChE,SAAA,CAAA8E,QAAQ;MACP7D,OAAO,EAAEsC,IAAK;MACdwB,KAAK,EAAE7C,SAAU;MACjB2C,SAAS,EAAEA,SAAU;MACrB1C,YAAY,EAAEA,YAAa;MAC3B6C,QAAQ,EAAGhC,GAAG,IAAK;QACjBM,QAAQ,CAACN,GAAG,CAAC;QACb,IAAIZ,aAAa,EAAEwC,KAAK,CAAC,CAAC;MAC5B;IAAE,CACH;EACF,CACG,CAAC;AAEX","ignoreList":[]}
@@ -0,0 +1,116 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = exports.WithChevron = exports.Placeholder = exports.OrderType = exports.FullWidth = void 0;
7
+ var _react = require("react");
8
+ var _reactNative = require("react-native");
9
+ var _SelectButton = require("./SelectButton.js");
10
+ var _Text = require("../Text/Text.js");
11
+ var _jsxRuntime = require("react/jsx-runtime");
12
+ const meta = {
13
+ title: 'Components/SelectButton',
14
+ component: _SelectButton.SelectButton
15
+ };
16
+ var _default = exports.default = meta;
17
+ const ORDER_TYPES = [{
18
+ key: 'dine-in',
19
+ label: 'Dine in',
20
+ icon: 'dish'
21
+ }, {
22
+ key: 'take-out',
23
+ label: 'Take out',
24
+ icon: 'shopping-bag'
25
+ }, {
26
+ key: 'delivery',
27
+ label: 'Delivery',
28
+ icon: 'truck-delivery'
29
+ }];
30
+
31
+ /** The order-type selector from the mockup: leading icon, green check on the current value. */
32
+ const OrderType = exports.OrderType = {
33
+ render: () => {
34
+ const [value, setValue] = (0, _react.useState)('dine-in');
35
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
36
+ style: {
37
+ padding: 24,
38
+ height: 340
39
+ },
40
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_SelectButton.SelectButton, {
41
+ options: ORDER_TYPES,
42
+ value: value,
43
+ onChange: setValue,
44
+ menuWidth: 300
45
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Text.Text, {
46
+ variant: "caption",
47
+ color: "secondary",
48
+ style: {
49
+ marginTop: 12
50
+ },
51
+ children: ["value: ", value]
52
+ })]
53
+ });
54
+ }
55
+ };
56
+
57
+ /** With a trailing chevron on the trigger. */
58
+ const WithChevron = exports.WithChevron = {
59
+ render: () => {
60
+ const [value, setValue] = (0, _react.useState)('dine-in');
61
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
62
+ style: {
63
+ padding: 24,
64
+ height: 340
65
+ },
66
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_SelectButton.SelectButton, {
67
+ options: ORDER_TYPES,
68
+ value: value,
69
+ onChange: setValue,
70
+ chevron: true,
71
+ menuWidth: 300
72
+ })
73
+ });
74
+ }
75
+ };
76
+
77
+ /** Uncontrolled with a placeholder (nothing selected initially). */
78
+ const Placeholder = exports.Placeholder = {
79
+ render: () => /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
80
+ style: {
81
+ padding: 24,
82
+ height: 340
83
+ },
84
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_SelectButton.SelectButton, {
85
+ options: ORDER_TYPES,
86
+ placeholder: "Order type",
87
+ placeholderIcon: "dish",
88
+ chevron: true,
89
+ menuWidth: 300,
90
+ onChange: () => {}
91
+ })
92
+ })
93
+ };
94
+
95
+ /** Full-width trigger (e.g. inside a form). */
96
+ const FullWidth = exports.FullWidth = {
97
+ render: () => {
98
+ const [value, setValue] = (0, _react.useState)('take-out');
99
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
100
+ style: {
101
+ padding: 24,
102
+ height: 340,
103
+ width: 360
104
+ },
105
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_SelectButton.SelectButton, {
106
+ options: ORDER_TYPES,
107
+ value: value,
108
+ onChange: setValue,
109
+ fullWidth: true,
110
+ chevron: true,
111
+ menuWidth: 312
112
+ })
113
+ });
114
+ }
115
+ };
116
+ //# sourceMappingURL=SelectButton.stories.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_react","require","_reactNative","_SelectButton","_Text","_jsxRuntime","meta","title","component","SelectButton","_default","exports","default","ORDER_TYPES","key","label","icon","OrderType","render","value","setValue","useState","jsxs","View","style","padding","height","children","jsx","options","onChange","menuWidth","Text","variant","color","marginTop","WithChevron","chevron","Placeholder","placeholder","placeholderIcon","FullWidth","width","fullWidth"],"sourceRoot":"..\\..\\..\\..\\src","sources":["components/Menu/SelectButton.stories.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAEA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,aAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AAAoC,IAAAI,WAAA,GAAAJ,OAAA;AAEpC,MAAMK,IAAI,GAAG;EACXC,KAAK,EAAE,yBAAyB;EAChCC,SAAS,EAAEC;AACb,CAAqC;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEvBN,IAAI;AAGnB,MAAMO,WAAiC,GAAG,CACxC;EAAEC,GAAG,EAAE,SAAS;EAAEC,KAAK,EAAE,SAAS;EAAEC,IAAI,EAAE;AAAO,CAAC,EAClD;EAAEF,GAAG,EAAE,UAAU;EAAEC,KAAK,EAAE,UAAU;EAAEC,IAAI,EAAE;AAAe,CAAC,EAC5D;EAAEF,GAAG,EAAE,UAAU;EAAEC,KAAK,EAAE,UAAU;EAAEC,IAAI,EAAE;AAAiB,CAAC,CAC/D;;AAED;AACO,MAAMC,SAAgB,GAAAN,OAAA,CAAAM,SAAA,GAAG;EAC9BC,MAAM,EAAEA,CAAA,KAAM;IACZ,MAAM,CAACC,KAAK,EAAEC,QAAQ,CAAC,GAAG,IAAAC,eAAQ,EAAC,SAA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AAA,kBACN,IAAAb,WAAA,CAAAuB,GAAA,EAAC1B,YAAA,CAAAqB,IAAI;IAACC,KAAK,EAAE;MAAEC,OAAO,EAAE,EAAE;MAAEC,MAAM,EAAE;IAAI,CAAE;IAAAC,QAAA,eACxC,IAAAtB,WAAA,CAAAuB,GAAA,EAACzB,aAAA,CAAAM,YAAY;MACXoB,OAAO,EAAEhB,WAAY;MACrB0B,WAAW,EAAC,YAAY;MACxBC,eAAe,EAAC,MAAM;MACtBH,OAAO;MACPN,SAAS,EAAE,GAAI;MACfD,QAAQ,EAAEA,CAAA,KAAM,CAAC;IAAE,CACpB;EAAC,CACE;AAEV,CAAC;;AAED;AACO,MAAMW,SAAgB,GAAA9B,OAAA,CAAA8B,SAAA,GAAG;EAC9BvB,MAAM,EAAEA,CAAA,KAAM;IACZ,MAAM,CAACC,KAAK,EAAEC,QAAQ,CAAC,GAAG,IAAAC,eAAQ,EAAC,UAAU,CAAC;IAC9C,oBACE,IAAAhB,WAAA,CAAAuB,GAAA,EAAC1B,YAAA,CAAAqB,IAAI;MAACC,KAAK,EAAE;QAAEC,OAAO,EAAE,EAAE;QAAEC,MAAM,EAAE,GAAG;QAAEgB,KAAK,EAAE;MAAI,CAAE;MAAAf,QAAA,eACpD,IAAAtB,WAAA,CAAAuB,GAAA,EAACzB,aAAA,CAAAM,YAAY;QACXoB,OAAO,EAAEhB,WAAY;QACrBM,KAAK,EAAEA,KAAM;QACbW,QAAQ,EAAEV,QAAS;QACnBuB,SAAS;QACTN,OAAO;QACPN,SAAS,EAAE;MAAI,CAChB;IAAC,CACE,CAAC;EAEX;AACF,CAAC","ignoreList":[]}
@@ -0,0 +1,80 @@
1
+ "use strict";
2
+
3
+ var _react = require("react");
4
+ var _reactNative = require("@testing-library/react-native");
5
+ var _index = require("../../theme/index.js");
6
+ var _SelectButton = require("./SelectButton.js");
7
+ var _jsxRuntime = require("react/jsx-runtime");
8
+ function wrap(ui) {
9
+ return (0, _reactNative.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_index.ThemeProvider, {
10
+ children: ui
11
+ }));
12
+ }
13
+ const OPTIONS = [{
14
+ key: 'dine-in',
15
+ label: 'Dine in',
16
+ icon: 'dish'
17
+ }, {
18
+ key: 'take-out',
19
+ label: 'Take out',
20
+ icon: 'shopping-bag'
21
+ }, {
22
+ key: 'delivery',
23
+ label: 'Delivery',
24
+ icon: 'truck-delivery'
25
+ }];
26
+ function Controlled() {
27
+ const [value, setValue] = (0, _react.useState)('dine-in');
28
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_SelectButton.SelectButton, {
29
+ options: OPTIONS,
30
+ value: value,
31
+ onChange: setValue
32
+ });
33
+ }
34
+ describe('SelectButton', () => {
35
+ it('shows the placeholder when nothing is selected', () => {
36
+ wrap(/*#__PURE__*/(0, _jsxRuntime.jsx)(_SelectButton.SelectButton, {
37
+ options: OPTIONS,
38
+ placeholder: "Order type"
39
+ }));
40
+ expect(_reactNative.screen.getByText('Order type')).toBeTruthy();
41
+ });
42
+ it('shows the selected option label on the trigger', () => {
43
+ wrap(/*#__PURE__*/(0, _jsxRuntime.jsx)(_SelectButton.SelectButton, {
44
+ options: OPTIONS,
45
+ value: "take-out"
46
+ }));
47
+ expect(_reactNative.screen.getByText('Take out')).toBeTruthy();
48
+ });
49
+ it('opens the menu and lists the options', () => {
50
+ wrap(/*#__PURE__*/(0, _jsxRuntime.jsx)(_SelectButton.SelectButton, {
51
+ options: OPTIONS,
52
+ value: "dine-in"
53
+ }));
54
+ // The trigger shows "Dine in"; open the menu to reveal the rows.
55
+ _reactNative.fireEvent.press(_reactNative.screen.getByText('Dine in'));
56
+ expect(_reactNative.screen.getByText('Take out')).toBeTruthy();
57
+ expect(_reactNative.screen.getByText('Delivery')).toBeTruthy();
58
+ });
59
+ it('selecting a row calls onChange with its key and closes', () => {
60
+ const onChange = jest.fn();
61
+ wrap(/*#__PURE__*/(0, _jsxRuntime.jsx)(_SelectButton.SelectButton, {
62
+ options: OPTIONS,
63
+ value: "dine-in",
64
+ onChange: onChange
65
+ }));
66
+ _reactNative.fireEvent.press(_reactNative.screen.getByText('Dine in'));
67
+ _reactNative.fireEvent.press(_reactNative.screen.getByText('Delivery'));
68
+ expect(onChange).toHaveBeenCalledWith('delivery');
69
+ expect(_reactNative.screen.queryByText('Take out')).toBeNull();
70
+ });
71
+ it('uncontrolled: the trigger reflects the new selection', () => {
72
+ wrap(/*#__PURE__*/(0, _jsxRuntime.jsx)(Controlled, {}));
73
+ _reactNative.fireEvent.press(_reactNative.screen.getByText('Dine in'));
74
+ _reactNative.fireEvent.press(_reactNative.screen.getByText('Delivery'));
75
+ // Trigger now shows Delivery; menu closed.
76
+ expect(_reactNative.screen.getByText('Delivery')).toBeTruthy();
77
+ expect(_reactNative.screen.queryByText('Take out')).toBeNull();
78
+ });
79
+ });
80
+ //# sourceMappingURL=SelectButton.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_react","require","_reactNative","_index","_SelectButton","_jsxRuntime","wrap","ui","render","jsx","ThemeProvider","children","OPTIONS","key","label","icon","Controlled","value","setValue","useState","SelectButton","options","onChange","describe","it","placeholder","expect","screen","getByText","toBeTruthy","fireEvent","press","jest","fn","toHaveBeenCalledWith","queryByText","toBeNull"],"sourceRoot":"..\\..\\..\\..\\src","sources":["components/Menu/SelectButton.test.tsx"],"mappings":";;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AACA,IAAAG,aAAA,GAAAH,OAAA;AAAuE,IAAAI,WAAA,GAAAJ,OAAA;AAEvE,SAASK,IAAIA,CAACC,EAAsB,EAAE;EACpC,OAAO,IAAAC,mBAAM,eAAC,IAAAH,WAAA,CAAAI,GAAA,EAACN,MAAA,CAAAO,aAAa;IAAAC,QAAA,EAAEJ;EAAE,CAAgB,CAAC,CAAC;AACpD;AAEA,MAAMK,OAA6B,GAAG,CACpC;EAAEC,GAAG,EAAE,SAAS;EA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ACAF,MAAM,CAACC,mBAAM,CAACC,SAAS,CAAC,UAAU,CAAC,CAAC,CAACC,UAAU,CAAC,CAAC;IACjDH,MAAM,CAACC,mBAAM,CAACQ,WAAW,CAAC,UAAU,CAAC,CAAC,CAACC,QAAQ,CAAC,CAAC;EACnD,CAAC,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ Object.defineProperty(exports, "Menu", {
7
+ enumerable: true,
8
+ get: function () {
9
+ return _Menu.Menu;
10
+ }
11
+ });
12
+ Object.defineProperty(exports, "MenuButton", {
13
+ enumerable: true,
14
+ get: function () {
15
+ return _MenuButton.MenuButton;
16
+ }
17
+ });
18
+ Object.defineProperty(exports, "SelectButton", {
19
+ enumerable: true,
20
+ get: function () {
21
+ return _SelectButton.SelectButton;
22
+ }
23
+ });
24
+ var _Menu = require("./Menu.js");
25
+ var _MenuButton = require("./MenuButton.js");
26
+ var _SelectButton = require("./SelectButton.js");
27
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_Menu","require","_MenuButton","_SelectButton"],"sourceRoot":"..\\..\\..\\..\\src","sources":["components/Menu/index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,KAAA,GAAAC,OAAA;AAQA,IAAAC,WAAA,GAAAD,OAAA;AAEA,IAAAE,aAAA,GAAAF,OAAA","ignoreList":[]}
@@ -0,0 +1,246 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.Select = Select;
7
+ var _react = require("react");
8
+ var _reactNative = require("react-native");
9
+ var _index = require("../../theme/index.js");
10
+ var _Dropdown = require("../Dropdown/Dropdown.js");
11
+ var _Icon = require("../Icon/Icon.js");
12
+ var _Menu = require("../Menu/Menu.js");
13
+ var _Text = require("../Text/Text.js");
14
+ var _jsxRuntime = require("react/jsx-runtime");
15
+ /** Width of the focus ring, in px (Figma "Focus" effect: spread 6). */const FOCUS_RING_SPREAD = 6;
16
+ const FOCUS_RING_ALPHA = 0.15;
17
+
18
+ /** Convert a `#RRGGBB` (or `#RGB`) token to an `rgba()` string at the given alpha. */
19
+ function hexToRgba(hex, alpha) {
20
+ const h = hex.replace('#', '');
21
+ const full = h.length === 3 ? h.replace(/./g, c => c + c) : h;
22
+ const r = parseInt(full.slice(0, 2), 16);
23
+ const g = parseInt(full.slice(2, 4), 16);
24
+ const b = parseInt(full.slice(4, 6), 16);
25
+ return `rgba(${r}, ${g}, ${b}, ${alpha})`;
26
+ }
27
+ const SIZES = {
28
+ md: {
29
+ height: 48,
30
+ gap: 8,
31
+ iconSize: 20,
32
+ textVariant: 'bodyMedium'
33
+ },
34
+ lg: {
35
+ height: 58,
36
+ gap: 10,
37
+ iconSize: 24,
38
+ textVariant: 'bodyLarge'
39
+ }
40
+ };
41
+
42
+ /** An option in a `Select`. */
43
+
44
+ /**
45
+ * Select — a form field that opens a `Dropdown` of options. The field mirrors
46
+ * `Input` (pill, label, helper/error, lime focus ring, red error ring); it is
47
+ * not editable — pressing it opens the menu, which matches the field width. The
48
+ * current option is marked with a check. With `multiple`, rows become checkboxes,
49
+ * the value is an array, and the menu stays open while picking.
50
+ */
51
+ function Select({
52
+ options,
53
+ multiple = false,
54
+ value,
55
+ defaultValue,
56
+ onChange,
57
+ label,
58
+ helperText,
59
+ error,
60
+ placeholder = 'Select option',
61
+ leftIcon,
62
+ size = 'lg',
63
+ width,
64
+ fullWidth = true,
65
+ disabled = false,
66
+ renderValue,
67
+ matchTriggerWidth = true,
68
+ menuWidth,
69
+ maxHeight,
70
+ anchorOrigin = {
71
+ vertical: 'bottom',
72
+ horizontal: 'left'
73
+ },
74
+ menuOrigin = {
75
+ vertical: 'top',
76
+ horizontal: 'left'
77
+ },
78
+ offset = 8,
79
+ autoFit = true,
80
+ insets,
81
+ closeOnSelect,
82
+ style
83
+ }) {
84
+ const theme = (0, _index.useTheme)();
85
+ const sizeConfig = SIZES[size];
86
+ const isControlled = value !== undefined;
87
+ const [internal, setInternal] = (0, _react.useState)(defaultValue ?? (multiple ? [] : undefined));
88
+ const current = isControlled ? value : internal;
89
+ const selectedKeys = multiple ? current ?? [] : current != null ? [current] : [];
90
+ const commit = next => {
91
+ if (!isControlled) setInternal(next);
92
+ onChange?.(next);
93
+ };
94
+ const selectSingle = key => commit(key);
95
+ const toggleMulti = key => {
96
+ const set = new Set(selectedKeys);
97
+ if (set.has(key)) set.delete(key);else set.add(key);
98
+ commit([...set]);
99
+ };
100
+ const selectedOptions = options.filter(o => selectedKeys.includes(o.key));
101
+ const isEmpty = selectedOptions.length === 0;
102
+ const displayText = renderValue ? renderValue(selectedOptions) : isEmpty ? placeholder : selectedOptions.map(o => o.label).join(', ');
103
+ const hasError = Boolean(error);
104
+ const message = typeof error === 'string' ? error : helperText;
105
+ const rows = options.map(o => ({
106
+ key: o.key,
107
+ label: o.label,
108
+ disabled: o.disabled,
109
+ leading: o.icon ? {
110
+ kind: 'icon',
111
+ name: o.icon
112
+ } : undefined,
113
+ trailing: multiple ? {
114
+ kind: 'checkbox',
115
+ checked: selectedKeys.includes(o.key),
116
+ onChange: () => toggleMulti(o.key)
117
+ } : selectedKeys.includes(o.key) ? {
118
+ kind: 'icon',
119
+ name: 'check',
120
+ color: theme.colors.feedback.success
121
+ } : undefined
122
+ }));
123
+ const shouldClose = closeOnSelect ?? !multiple;
124
+ const iconBox = {
125
+ width: sizeConfig.iconSize,
126
+ height: sizeConfig.iconSize,
127
+ alignItems: 'center',
128
+ justifyContent: 'center'
129
+ };
130
+ const containerWidth = width != null ? {
131
+ width,
132
+ alignSelf: 'flex-start'
133
+ } : fullWidth ? {
134
+ alignSelf: 'stretch'
135
+ } : {
136
+ alignSelf: 'flex-start'
137
+ };
138
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
139
+ style: [containerWidth, style],
140
+ children: [label ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_Text.Text, {
141
+ variant: "bodySmall",
142
+ color: "secondary",
143
+ style: {
144
+ marginBottom: 4,
145
+ marginLeft: 8
146
+ },
147
+ children: label
148
+ }) : null, /*#__PURE__*/(0, _jsxRuntime.jsx)(_Menu.Menu, {
149
+ anchorOrigin: anchorOrigin,
150
+ menuOrigin: menuOrigin,
151
+ offset: offset,
152
+ autoFit: autoFit,
153
+ insets: insets,
154
+ triggerStyle: {
155
+ alignSelf: 'stretch'
156
+ },
157
+ renderTrigger: ({
158
+ open,
159
+ toggle
160
+ }) => {
161
+ const showRing = open && !disabled;
162
+ const borderColor = disabled ? theme.colors.disabled.border : hasError ? theme.colors.feedback.error : open ? theme.colors.border.focus : theme.colors.border.default;
163
+ const ringColor = hasError ? theme.colors.feedback.error : theme.colors.border.focus;
164
+ const boxShadow = showRing ? [{
165
+ offsetX: 0,
166
+ offsetY: 0,
167
+ blurRadius: 0,
168
+ spreadDistance: FOCUS_RING_SPREAD,
169
+ color: hexToRgba(ringColor, FOCUS_RING_ALPHA)
170
+ }] : undefined;
171
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Pressable, {
172
+ onPress: toggle,
173
+ disabled: disabled,
174
+ accessibilityRole: "button",
175
+ accessibilityState: {
176
+ expanded: open,
177
+ disabled
178
+ },
179
+ accessibilityLabel: label ?? placeholder,
180
+ style: {
181
+ flexDirection: 'row',
182
+ alignItems: 'center',
183
+ gap: sizeConfig.gap,
184
+ height: sizeConfig.height,
185
+ paddingHorizontal: 16,
186
+ borderWidth: 1,
187
+ borderColor,
188
+ borderRadius: theme.radii.pill,
189
+ backgroundColor: disabled ? theme.colors.disabled.background : theme.colors.background.default,
190
+ boxShadow
191
+ },
192
+ children: [leftIcon ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
193
+ style: iconBox,
194
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Icon.Icon, {
195
+ name: leftIcon,
196
+ size: sizeConfig.iconSize,
197
+ color: disabled ? theme.colors.disabled.foreground : 'secondary'
198
+ })
199
+ }) : null, /*#__PURE__*/(0, _jsxRuntime.jsx)(_Text.Text, {
200
+ variant: sizeConfig.textVariant,
201
+ color: disabled ? 'tertiary' : isEmpty ? 'tertiary' : 'primary',
202
+ numberOfLines: 1,
203
+ style: {
204
+ flex: 1,
205
+ minWidth: 0
206
+ },
207
+ children: displayText
208
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
209
+ style: [iconBox, {
210
+ transform: [{
211
+ rotate: open ? '180deg' : '0deg'
212
+ }]
213
+ }],
214
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Icon.Icon, {
215
+ name: "chevron-down",
216
+ size: sizeConfig.iconSize,
217
+ color: disabled ? theme.colors.disabled.foreground : 'secondary'
218
+ })
219
+ })]
220
+ });
221
+ },
222
+ children: ({
223
+ close,
224
+ triggerWidth,
225
+ maxHeight: autoMaxHeight
226
+ }) => /*#__PURE__*/(0, _jsxRuntime.jsx)(_Dropdown.Dropdown, {
227
+ options: rows,
228
+ width: matchTriggerWidth ? triggerWidth : menuWidth,
229
+ maxHeight: maxHeight ?? autoMaxHeight,
230
+ onSelect: multiple ? undefined : key => {
231
+ selectSingle(key);
232
+ if (shouldClose) close();
233
+ }
234
+ })
235
+ }), message ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_Text.Text, {
236
+ variant: "bodySmall",
237
+ color: hasError ? theme.colors.feedback.error : 'tertiary',
238
+ style: {
239
+ marginTop: 8,
240
+ marginLeft: 8
241
+ },
242
+ children: message
243
+ }) : null]
244
+ });
245
+ }
246
+ //# sourceMappingURL=Select.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_react","require","_reactNative","_index","_Dropdown","_Icon","_Menu","_Text","_jsxRuntime","FOCUS_RING_SPREAD","FOCUS_RING_ALPHA","hexToRgba","hex","alpha","h","replace","full","length","c","r","parseInt","slice","g","b","SIZES","md","height","gap","iconSize","textVariant","lg","Select","options","multiple","value","defaultValue","onChange","label","helperText","error","placeholder","leftIcon","size","width","fullWidth","disabled","renderValue","matchTriggerWidth","menuWidth","maxHeight","anchorOrigin","vertical","horizontal","menuOrigin","offset","autoFit","insets","closeOnSelect","style","theme","useTheme","sizeConfig","isControlled","undefined","internal","setInternal","useState","current","selectedKeys","commit","next","selectSingle","key","toggleMulti","set","Set","has","delete","add","selectedOptions","filter","o","includes","isEmpty","displayText","map","join","hasError","Boolean","message","rows","leading","icon","kind","name","trailing","checked","color","colors","feedback","success","shouldClose","iconBox","alignItems","justifyContent","containerWidth","alignSelf","jsxs","View","children","jsx","Text","variant","marginBottom","marginLeft","Menu","triggerStyle","renderTrigger","open","toggle","showRing","borderColor","border","focus","default","ringColor","boxShadow","offsetX","offsetY","blurRadius","spreadDistance","Pressable","onPress","accessibilityRole","accessibilityState","expanded","accessibilityLabel","flexDirection","paddingHorizontal","borderWidth","borderRadius","radii","pill","backgroundColor","background","Icon","foreground","numberOfLines","flex","minWidth","transform","rotate","close","triggerWidth","autoMaxHeight","Dropdown","onSelect","marginTop"],"sourceRoot":"..\\..\\..\\..\\src","sources":["components/Select/Select.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAOA,IAAAE,MAAA,GAAAF,OAAA;AAEA,IAAAG,SAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AAEA,IAAAK,KAAA,GAAAL,OAAA;AACA,IAAAM,KAAA,GAAAN,OAAA;AAAoC,IAAAO,WAAA,GAAAP,OAAA;AAEpC,uEACA,MAAMQ,iBAAiB,GAAG,CAAC;AAC3B,MAAMC,gBAAgB,GAAG,IAAI;;AAE7B;AACA,SAASC,SAASA,CAACC,GAAW,EAAEC,KAAa,EAAU;EACrD,MAAMC,CAAC,GAAGF,GAAG,CAACG,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC;EAC9B,MAAMC,IAAI,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