@bacon-pos/ui 0.9.0 → 0.11.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 (175) hide show
  1. package/lib/commonjs/components/Alert/Alert.js +137 -0
  2. package/lib/commonjs/components/Alert/Alert.js.map +1 -0
  3. package/lib/commonjs/components/Alert/Alert.stories.js +104 -0
  4. package/lib/commonjs/components/Alert/Alert.stories.js.map +1 -0
  5. package/lib/commonjs/components/Alert/Alert.test.js +62 -0
  6. package/lib/commonjs/components/Alert/Alert.test.js.map +1 -0
  7. package/lib/commonjs/components/Alert/index.js +13 -0
  8. package/lib/commonjs/components/Alert/index.js.map +1 -0
  9. package/lib/commonjs/components/EmptyState/EmptyState.js +88 -0
  10. package/lib/commonjs/components/EmptyState/EmptyState.js.map +1 -0
  11. package/lib/commonjs/components/EmptyState/EmptyState.stories.js +46 -0
  12. package/lib/commonjs/components/EmptyState/EmptyState.stories.js.map +1 -0
  13. package/lib/commonjs/components/EmptyState/EmptyState.test.js +40 -0
  14. package/lib/commonjs/components/EmptyState/EmptyState.test.js.map +1 -0
  15. package/lib/commonjs/components/EmptyState/index.js +13 -0
  16. package/lib/commonjs/components/EmptyState/index.js.map +1 -0
  17. package/lib/commonjs/components/Sidebar/Sidebar.js +264 -0
  18. package/lib/commonjs/components/Sidebar/Sidebar.js.map +1 -0
  19. package/lib/commonjs/components/Sidebar/Sidebar.stories.js +229 -0
  20. package/lib/commonjs/components/Sidebar/Sidebar.stories.js.map +1 -0
  21. package/lib/commonjs/components/Sidebar/Sidebar.test.js +131 -0
  22. package/lib/commonjs/components/Sidebar/Sidebar.test.js.map +1 -0
  23. package/lib/commonjs/components/Sidebar/index.js +13 -0
  24. package/lib/commonjs/components/Sidebar/index.js.map +1 -0
  25. package/lib/commonjs/components/StatTile/StatTile.js +94 -0
  26. package/lib/commonjs/components/StatTile/StatTile.js.map +1 -0
  27. package/lib/commonjs/components/StatTile/StatTile.stories.js +100 -0
  28. package/lib/commonjs/components/StatTile/StatTile.stories.js.map +1 -0
  29. package/lib/commonjs/components/StatTile/StatTile.test.js +49 -0
  30. package/lib/commonjs/components/StatTile/StatTile.test.js.map +1 -0
  31. package/lib/commonjs/components/StatTile/index.js +13 -0
  32. package/lib/commonjs/components/StatTile/index.js.map +1 -0
  33. package/lib/commonjs/components/Table/DataTable.js +149 -0
  34. package/lib/commonjs/components/Table/DataTable.js.map +1 -0
  35. package/lib/commonjs/components/Table/DataTable.stories.js +214 -0
  36. package/lib/commonjs/components/Table/DataTable.stories.js.map +1 -0
  37. package/lib/commonjs/components/Table/DataTable.test.js +143 -0
  38. package/lib/commonjs/components/Table/DataTable.test.js.map +1 -0
  39. package/lib/commonjs/components/Table/Table.js +520 -0
  40. package/lib/commonjs/components/Table/Table.js.map +1 -0
  41. package/lib/commonjs/components/Table/Table.stories.js +385 -0
  42. package/lib/commonjs/components/Table/Table.stories.js.map +1 -0
  43. package/lib/commonjs/components/Table/Table.test.js +278 -0
  44. package/lib/commonjs/components/Table/Table.test.js.map +1 -0
  45. package/lib/commonjs/components/Table/index.js +20 -0
  46. package/lib/commonjs/components/Table/index.js.map +1 -0
  47. package/lib/commonjs/components/brand/BaconLogo.js +29 -0
  48. package/lib/commonjs/components/brand/BaconLogo.js.map +1 -0
  49. package/lib/commonjs/components/brand/index.js +7 -0
  50. package/lib/commonjs/components/brand/index.js.map +1 -1
  51. package/lib/commonjs/components/index.js +83 -28
  52. package/lib/commonjs/components/index.js.map +1 -1
  53. package/lib/module/components/Alert/Alert.js +133 -0
  54. package/lib/module/components/Alert/Alert.js.map +1 -0
  55. package/lib/module/components/Alert/Alert.stories.js +100 -0
  56. package/lib/module/components/Alert/Alert.stories.js.map +1 -0
  57. package/lib/module/components/Alert/Alert.test.js +62 -0
  58. package/lib/module/components/Alert/Alert.test.js.map +1 -0
  59. package/lib/module/components/Alert/index.js +4 -0
  60. package/lib/module/components/Alert/index.js.map +1 -0
  61. package/lib/module/components/EmptyState/EmptyState.js +84 -0
  62. package/lib/module/components/EmptyState/EmptyState.js.map +1 -0
  63. package/lib/module/components/EmptyState/EmptyState.stories.js +42 -0
  64. package/lib/module/components/EmptyState/EmptyState.stories.js.map +1 -0
  65. package/lib/module/components/EmptyState/EmptyState.test.js +40 -0
  66. package/lib/module/components/EmptyState/EmptyState.test.js.map +1 -0
  67. package/lib/module/components/EmptyState/index.js +4 -0
  68. package/lib/module/components/EmptyState/index.js.map +1 -0
  69. package/lib/module/components/Sidebar/Sidebar.js +260 -0
  70. package/lib/module/components/Sidebar/Sidebar.js.map +1 -0
  71. package/lib/module/components/Sidebar/Sidebar.stories.js +225 -0
  72. package/lib/module/components/Sidebar/Sidebar.stories.js.map +1 -0
  73. package/lib/module/components/Sidebar/Sidebar.test.js +131 -0
  74. package/lib/module/components/Sidebar/Sidebar.test.js.map +1 -0
  75. package/lib/module/components/Sidebar/index.js +4 -0
  76. package/lib/module/components/Sidebar/index.js.map +1 -0
  77. package/lib/module/components/StatTile/StatTile.js +90 -0
  78. package/lib/module/components/StatTile/StatTile.js.map +1 -0
  79. package/lib/module/components/StatTile/StatTile.stories.js +96 -0
  80. package/lib/module/components/StatTile/StatTile.stories.js.map +1 -0
  81. package/lib/module/components/StatTile/StatTile.test.js +49 -0
  82. package/lib/module/components/StatTile/StatTile.test.js.map +1 -0
  83. package/lib/module/components/StatTile/index.js +4 -0
  84. package/lib/module/components/StatTile/index.js.map +1 -0
  85. package/lib/module/components/Table/DataTable.js +145 -0
  86. package/lib/module/components/Table/DataTable.js.map +1 -0
  87. package/lib/module/components/Table/DataTable.stories.js +210 -0
  88. package/lib/module/components/Table/DataTable.stories.js.map +1 -0
  89. package/lib/module/components/Table/DataTable.test.js +143 -0
  90. package/lib/module/components/Table/DataTable.test.js.map +1 -0
  91. package/lib/module/components/Table/Table.js +516 -0
  92. package/lib/module/components/Table/Table.js.map +1 -0
  93. package/lib/module/components/Table/Table.stories.js +381 -0
  94. package/lib/module/components/Table/Table.stories.js.map +1 -0
  95. package/lib/module/components/Table/Table.test.js +278 -0
  96. package/lib/module/components/Table/Table.test.js.map +1 -0
  97. package/lib/module/components/Table/index.js +5 -0
  98. package/lib/module/components/Table/index.js.map +1 -0
  99. package/lib/module/components/brand/BaconLogo.js +25 -0
  100. package/lib/module/components/brand/BaconLogo.js.map +1 -0
  101. package/lib/module/components/brand/index.js +1 -0
  102. package/lib/module/components/brand/index.js.map +1 -1
  103. package/lib/module/components/index.js +5 -0
  104. package/lib/module/components/index.js.map +1 -1
  105. package/lib/typescript/commonjs/components/Alert/Alert.d.ts +41 -0
  106. package/lib/typescript/commonjs/components/Alert/Alert.d.ts.map +1 -0
  107. package/lib/typescript/commonjs/components/Alert/index.d.ts +3 -0
  108. package/lib/typescript/commonjs/components/Alert/index.d.ts.map +1 -0
  109. package/lib/typescript/commonjs/components/EmptyState/EmptyState.d.ts +30 -0
  110. package/lib/typescript/commonjs/components/EmptyState/EmptyState.d.ts.map +1 -0
  111. package/lib/typescript/commonjs/components/EmptyState/index.d.ts +3 -0
  112. package/lib/typescript/commonjs/components/EmptyState/index.d.ts.map +1 -0
  113. package/lib/typescript/commonjs/components/Sidebar/Sidebar.d.ts +57 -0
  114. package/lib/typescript/commonjs/components/Sidebar/Sidebar.d.ts.map +1 -0
  115. package/lib/typescript/commonjs/components/Sidebar/index.d.ts +3 -0
  116. package/lib/typescript/commonjs/components/Sidebar/index.d.ts.map +1 -0
  117. package/lib/typescript/commonjs/components/StatTile/StatTile.d.ts +31 -0
  118. package/lib/typescript/commonjs/components/StatTile/StatTile.d.ts.map +1 -0
  119. package/lib/typescript/commonjs/components/StatTile/index.d.ts +3 -0
  120. package/lib/typescript/commonjs/components/StatTile/index.d.ts.map +1 -0
  121. package/lib/typescript/commonjs/components/Table/DataTable.d.ts +53 -0
  122. package/lib/typescript/commonjs/components/Table/DataTable.d.ts.map +1 -0
  123. package/lib/typescript/commonjs/components/Table/Table.d.ts +85 -0
  124. package/lib/typescript/commonjs/components/Table/Table.d.ts.map +1 -0
  125. package/lib/typescript/commonjs/components/Table/index.d.ts +5 -0
  126. package/lib/typescript/commonjs/components/Table/index.d.ts.map +1 -0
  127. package/lib/typescript/commonjs/components/brand/BaconLogo.d.ts +13 -0
  128. package/lib/typescript/commonjs/components/brand/BaconLogo.d.ts.map +1 -0
  129. package/lib/typescript/commonjs/components/brand/index.d.ts +1 -0
  130. package/lib/typescript/commonjs/components/brand/index.d.ts.map +1 -1
  131. package/lib/typescript/commonjs/components/index.d.ts +5 -0
  132. package/lib/typescript/commonjs/components/index.d.ts.map +1 -1
  133. package/lib/typescript/module/components/Alert/Alert.d.ts +41 -0
  134. package/lib/typescript/module/components/Alert/Alert.d.ts.map +1 -0
  135. package/lib/typescript/module/components/Alert/index.d.ts +3 -0
  136. package/lib/typescript/module/components/Alert/index.d.ts.map +1 -0
  137. package/lib/typescript/module/components/EmptyState/EmptyState.d.ts +30 -0
  138. package/lib/typescript/module/components/EmptyState/EmptyState.d.ts.map +1 -0
  139. package/lib/typescript/module/components/EmptyState/index.d.ts +3 -0
  140. package/lib/typescript/module/components/EmptyState/index.d.ts.map +1 -0
  141. package/lib/typescript/module/components/Sidebar/Sidebar.d.ts +57 -0
  142. package/lib/typescript/module/components/Sidebar/Sidebar.d.ts.map +1 -0
  143. package/lib/typescript/module/components/Sidebar/index.d.ts +3 -0
  144. package/lib/typescript/module/components/Sidebar/index.d.ts.map +1 -0
  145. package/lib/typescript/module/components/StatTile/StatTile.d.ts +31 -0
  146. package/lib/typescript/module/components/StatTile/StatTile.d.ts.map +1 -0
  147. package/lib/typescript/module/components/StatTile/index.d.ts +3 -0
  148. package/lib/typescript/module/components/StatTile/index.d.ts.map +1 -0
  149. package/lib/typescript/module/components/Table/DataTable.d.ts +53 -0
  150. package/lib/typescript/module/components/Table/DataTable.d.ts.map +1 -0
  151. package/lib/typescript/module/components/Table/Table.d.ts +85 -0
  152. package/lib/typescript/module/components/Table/Table.d.ts.map +1 -0
  153. package/lib/typescript/module/components/Table/index.d.ts +5 -0
  154. package/lib/typescript/module/components/Table/index.d.ts.map +1 -0
  155. package/lib/typescript/module/components/brand/BaconLogo.d.ts +13 -0
  156. package/lib/typescript/module/components/brand/BaconLogo.d.ts.map +1 -0
  157. package/lib/typescript/module/components/brand/index.d.ts +1 -0
  158. package/lib/typescript/module/components/brand/index.d.ts.map +1 -1
  159. package/lib/typescript/module/components/index.d.ts +5 -0
  160. package/lib/typescript/module/components/index.d.ts.map +1 -1
  161. package/package.json +1 -1
  162. package/src/components/Alert/Alert.tsx +132 -0
  163. package/src/components/Alert/index.ts +2 -0
  164. package/src/components/EmptyState/EmptyState.tsx +91 -0
  165. package/src/components/EmptyState/index.ts +2 -0
  166. package/src/components/Sidebar/Sidebar.tsx +320 -0
  167. package/src/components/Sidebar/index.ts +2 -0
  168. package/src/components/StatTile/StatTile.tsx +98 -0
  169. package/src/components/StatTile/index.ts +2 -0
  170. package/src/components/Table/DataTable.tsx +173 -0
  171. package/src/components/Table/Table.tsx +556 -0
  172. package/src/components/Table/index.ts +10 -0
  173. package/src/components/brand/BaconLogo.tsx +25 -0
  174. package/src/components/brand/index.ts +1 -0
  175. package/src/components/index.ts +5 -0
@@ -0,0 +1,278 @@
1
+ "use strict";
2
+
3
+ var _reactNative = require("@testing-library/react-native");
4
+ var _reactNative2 = require("react-native");
5
+ var _index = require("../../theme/index.js");
6
+ var _IconButton = require("../IconButton/IconButton.js");
7
+ var _Table = require("./Table.js");
8
+ var _jsxRuntime = require("react/jsx-runtime");
9
+ function wrap(ui) {
10
+ return (0, _reactNative.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_index.ThemeProvider, {
11
+ children: ui
12
+ }));
13
+ }
14
+ const DATA = [{
15
+ id: 'a',
16
+ name: 'Alpha',
17
+ price: '$3'
18
+ }, {
19
+ id: 'b',
20
+ name: 'Beta',
21
+ price: '$1'
22
+ }, {
23
+ id: 'c',
24
+ name: 'Gamma',
25
+ price: '$2'
26
+ }];
27
+ const COLS = [{
28
+ key: 'name',
29
+ header: 'Name'
30
+ }, {
31
+ key: 'price',
32
+ header: 'Price'
33
+ }];
34
+ // mobileBreakpoint={0} forces the desktop layout regardless of the test window.
35
+ const desktop = {
36
+ mobileBreakpoint: 0
37
+ };
38
+ describe('Table', () => {
39
+ it('renders headers and cell values', () => {
40
+ wrap(/*#__PURE__*/(0, _jsxRuntime.jsx)(_Table.Table, {
41
+ ...desktop,
42
+ columns: COLS,
43
+ data: DATA,
44
+ keyExtractor: r => r.id
45
+ }));
46
+ expect(_reactNative.screen.getByText('Name')).toBeTruthy();
47
+ expect(_reactNative.screen.getByText('Alpha')).toBeTruthy();
48
+ expect(_reactNative.screen.getByText('$3')).toBeTruthy();
49
+ });
50
+ it('renders a custom cell node', () => {
51
+ const cols = [{
52
+ key: 'name',
53
+ header: 'Name'
54
+ }, {
55
+ key: 'price',
56
+ header: 'Price',
57
+ render: r => /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative2.Text, {
58
+ children: `price:${r.price}`
59
+ })
60
+ }];
61
+ wrap(/*#__PURE__*/(0, _jsxRuntime.jsx)(_Table.Table, {
62
+ ...desktop,
63
+ columns: cols,
64
+ data: DATA,
65
+ keyExtractor: r => r.id
66
+ }));
67
+ expect(_reactNative.screen.getByText('price:$3')).toBeTruthy();
68
+ });
69
+ it('fires onRowPress', () => {
70
+ const onRowPress = jest.fn();
71
+ wrap(/*#__PURE__*/(0, _jsxRuntime.jsx)(_Table.Table, {
72
+ ...desktop,
73
+ columns: COLS,
74
+ data: DATA,
75
+ keyExtractor: r => r.id,
76
+ onRowPress: onRowPress
77
+ }));
78
+ _reactNative.fireEvent.press(_reactNative.screen.getByText('Alpha'));
79
+ expect(onRowPress).toHaveBeenCalledWith(DATA[0], 0);
80
+ });
81
+ it('expands a row on press and collapses the previous one (single mode)', () => {
82
+ wrap(/*#__PURE__*/(0, _jsxRuntime.jsx)(_Table.Table, {
83
+ ...desktop,
84
+ columns: COLS,
85
+ data: DATA,
86
+ keyExtractor: r => r.id,
87
+ expandable: true,
88
+ renderExpanded: r => /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative2.Text, {
89
+ children: `detail-${r.id}`
90
+ })
91
+ }));
92
+ expect(_reactNative.screen.queryByText('detail-a')).toBeNull();
93
+ _reactNative.fireEvent.press(_reactNative.screen.getByText('Alpha'));
94
+ expect(_reactNative.screen.getByText('detail-a')).toBeTruthy();
95
+ _reactNative.fireEvent.press(_reactNative.screen.getByText('Beta'));
96
+ expect(_reactNative.screen.queryByText('detail-a')).toBeNull();
97
+ expect(_reactNative.screen.getByText('detail-b')).toBeTruthy();
98
+ });
99
+ it('renders an actions column', () => {
100
+ wrap(/*#__PURE__*/(0, _jsxRuntime.jsx)(_Table.Table, {
101
+ ...desktop,
102
+ columns: COLS,
103
+ data: DATA,
104
+ keyExtractor: r => r.id,
105
+ renderActions: () => /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative2.Text, {
106
+ children: "row-action"
107
+ })
108
+ }));
109
+ expect(_reactNative.screen.getAllByText('row-action').length).toBe(DATA.length);
110
+ });
111
+ it('row press coexists with the actions column (buttons keep their own handlers)', () => {
112
+ const onRowPress = jest.fn();
113
+ const onEdit = jest.fn();
114
+ wrap(/*#__PURE__*/(0, _jsxRuntime.jsx)(_Table.Table, {
115
+ ...desktop,
116
+ columns: COLS,
117
+ data: DATA,
118
+ keyExtractor: r => r.id,
119
+ onRowPress: onRowPress,
120
+ renderActions: r => /*#__PURE__*/(0, _jsxRuntime.jsx)(_IconButton.IconButton, {
121
+ icon: "edit",
122
+ accessibilityLabel: `edit-${r.id}`,
123
+ variant: "ghost",
124
+ size: "sm",
125
+ onPress: () => onEdit(r.id)
126
+ })
127
+ }));
128
+ // Pressing the action button runs its handler, not the row's.
129
+ _reactNative.fireEvent.press(_reactNative.screen.getByLabelText('edit-a'));
130
+ expect(onEdit).toHaveBeenCalledWith('a');
131
+ expect(onRowPress).not.toHaveBeenCalled();
132
+ // Pressing a cell runs the row handler.
133
+ _reactNative.fireEvent.press(_reactNative.screen.getByText('Alpha'));
134
+ expect(onRowPress).toHaveBeenCalledWith(DATA[0], 0);
135
+ });
136
+ it('shows a spinner with default loading text, a custom text, or none', () => {
137
+ const {
138
+ rerender
139
+ } = wrap(/*#__PURE__*/(0, _jsxRuntime.jsx)(_Table.Table, {
140
+ ...desktop,
141
+ columns: COLS,
142
+ data: [],
143
+ keyExtractor: r => r.id,
144
+ loading: true
145
+ }));
146
+ expect(_reactNative.screen.getByText('Loading data')).toBeTruthy();
147
+ rerender(/*#__PURE__*/(0, _jsxRuntime.jsx)(_index.ThemeProvider, {
148
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Table.Table, {
149
+ ...desktop,
150
+ columns: COLS,
151
+ data: [],
152
+ keyExtractor: r => r.id,
153
+ loading: true,
154
+ loadingText: "Fetching\u2026"
155
+ })
156
+ }));
157
+ expect(_reactNative.screen.getByText('Fetching…')).toBeTruthy();
158
+ rerender(/*#__PURE__*/(0, _jsxRuntime.jsx)(_index.ThemeProvider, {
159
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Table.Table, {
160
+ ...desktop,
161
+ columns: COLS,
162
+ data: [],
163
+ keyExtractor: r => r.id,
164
+ loading: true,
165
+ loadingText: null
166
+ })
167
+ }));
168
+ expect(_reactNative.screen.queryByText('Loading data')).toBeNull();
169
+ });
170
+ it('renders a skeleton without the loading text', () => {
171
+ wrap(/*#__PURE__*/(0, _jsxRuntime.jsx)(_Table.Table, {
172
+ ...desktop,
173
+ columns: COLS,
174
+ data: [],
175
+ keyExtractor: r => r.id,
176
+ loading: true,
177
+ loadingVariant: "skeleton"
178
+ }));
179
+ expect(_reactNative.screen.queryByText('Loading data')).toBeNull();
180
+ // Header is still shown while skeleton loads.
181
+ expect(_reactNative.screen.getByText('Name')).toBeTruthy();
182
+ });
183
+ it('selects rows and select-all', () => {
184
+ const onSelectionChange = jest.fn();
185
+ wrap(/*#__PURE__*/(0, _jsxRuntime.jsx)(_Table.Table, {
186
+ ...desktop,
187
+ columns: COLS,
188
+ data: DATA,
189
+ keyExtractor: r => r.id,
190
+ selectable: true,
191
+ selectedKeys: [],
192
+ onSelectionChange: onSelectionChange
193
+ }));
194
+ const checkboxes = _reactNative.screen.getAllByRole('checkbox');
195
+ // [0] = header select-all, [1..] = rows
196
+ _reactNative.fireEvent.press(checkboxes[1]);
197
+ expect(onSelectionChange).toHaveBeenCalledWith(['a']);
198
+ _reactNative.fireEvent.press(checkboxes[0]);
199
+ expect(onSelectionChange).toHaveBeenCalledWith(['a', 'b', 'c']);
200
+ });
201
+ it('emits sort changes from a sortable header (controlled)', () => {
202
+ const onSortChange = jest.fn();
203
+ const cols = [{
204
+ key: 'name',
205
+ header: 'Name',
206
+ sortable: true,
207
+ sortAccessor: r => r.name
208
+ }, {
209
+ key: 'price',
210
+ header: 'Price'
211
+ }];
212
+ wrap(/*#__PURE__*/(0, _jsxRuntime.jsx)(_Table.Table, {
213
+ ...desktop,
214
+ columns: cols,
215
+ data: DATA,
216
+ keyExtractor: r => r.id,
217
+ sort: {
218
+ key: 'price',
219
+ direction: 'asc'
220
+ },
221
+ onSortChange: onSortChange
222
+ }));
223
+ _reactNative.fireEvent.press(_reactNative.screen.getByText('Name'));
224
+ expect(onSortChange).toHaveBeenCalledWith({
225
+ key: 'name',
226
+ direction: 'asc'
227
+ });
228
+ });
229
+ it('sorts internally by the column accessor', () => {
230
+ const cols = [{
231
+ key: 'name',
232
+ header: 'Name'
233
+ }, {
234
+ key: 'price',
235
+ header: 'Price',
236
+ sortable: true,
237
+ sortAccessor: r => Number(r.price.replace('$', ''))
238
+ }];
239
+ wrap(/*#__PURE__*/(0, _jsxRuntime.jsx)(_Table.Table, {
240
+ ...desktop,
241
+ columns: cols,
242
+ data: DATA,
243
+ keyExtractor: r => r.id,
244
+ defaultSort: {
245
+ key: 'price',
246
+ direction: 'asc'
247
+ }
248
+ }));
249
+ // Ascending by price: Beta ($1), Gamma ($2), Alpha ($3)
250
+ const names = _reactNative.screen.getAllByText(/Alpha|Beta|Gamma/).map(n => n.props.children);
251
+ expect(names).toEqual(['Beta', 'Gamma', 'Alpha']);
252
+ });
253
+ it('shows the empty slot when there is no data', () => {
254
+ wrap(/*#__PURE__*/(0, _jsxRuntime.jsx)(_Table.Table, {
255
+ ...desktop,
256
+ columns: COLS,
257
+ data: [],
258
+ keyExtractor: r => r.id,
259
+ empty: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative2.Text, {
260
+ children: "Nothing here"
261
+ })
262
+ }));
263
+ expect(_reactNative.screen.getByText('Nothing here')).toBeTruthy();
264
+ });
265
+ it('renders a card layout below the mobile breakpoint (no header row)', () => {
266
+ wrap(/*#__PURE__*/(0, _jsxRuntime.jsx)(_Table.Table, {
267
+ mobileBreakpoint: 99999,
268
+ columns: COLS,
269
+ data: DATA,
270
+ keyExtractor: r => r.id
271
+ }));
272
+ // Values still render; header labels appear inside each card.
273
+ expect(_reactNative.screen.getByText('Alpha')).toBeTruthy();
274
+ // "Name" header label appears once per card (3), not once as a table header.
275
+ expect(_reactNative.screen.getAllByText('Name').length).toBe(DATA.length);
276
+ });
277
+ });
278
+ //# sourceMappingURL=Table.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_reactNative","require","_reactNative2","_index","_IconButton","_Table","_jsxRuntime","wrap","ui","render","jsx","ThemeProvider","children","DATA","id","name","price","COLS","key","header","desktop","mobileBreakpoint","describe","it","Table","columns","data","keyExtractor","r","expect","screen","getByText","toBeTruthy","cols","Text","onRowPress","jest","fn","fireEvent","press","toHaveBeenCalledWith","expandable","renderExpanded","queryByText","toBeNull","renderActions","getAllByText","length","toBe","onEdit","IconButton","icon","accessibilityLabel","variant","size","onPress","getByLabelText","not","toHaveBeenCalled","rerender","loading","loadingText","loadingVariant","onSelectionChange","selectable","selectedKeys","checkboxes","getAllByRole","onSortChange","sortable","sortAccessor","sort","direction","Number","replace","defaultSort","names","map","n","props","toEqual","empty"],"sourceRoot":"..\\..\\..\\..\\src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aAAA,CAAAgC,IAAI;QAAAtB,QAAA,EAAC;MAAY,CAAM;IAAE,CAAE,CAAC,CAAC;IAClHiB,MAAM,CAACC,mBAAM,CAACC,SAAS,CAAC,cAAc,CAAC,CAAC,CAACC,UAAU,CAAC,CAAC;EACvD,CAAC,CAAC;EAEFT,EAAE,CAAC,mEAAmE,EAAE,MAAM;IAC5EhB,IAAI,cAAC,IAAAD,WAAA,CAAAI,GAAA,EAACL,MAAA,CAAAmB,KAAK;MAACH,gBAAgB,EAAE,KAAM;MAACI,OAAO,EAAER,IAAK;MAACS,IAAI,EAAEb,IAAK;MAACc,YAAY,EAAGC,CAAC,IAAKA,CAAC,CAACd;IAAG,CAAE,CAAC,CAAC;IAC9F;IACAe,MAAM,CAACC,mBAAM,CAACC,SAAS,CAAC,OAAO,CAAC,CAAC,CAACC,UAAU,CAAC,CAAC;IAC9C;IACAH,MAAM,CAACC,mBAAM,CAACgB,YAAY,CAAC,MAAM,CAAC,CAACC,MAAM,CAAC,CAACC,IAAI,CAACnC,IAAI,CAACkC,MAAM,CAAC;EAC9D,CAAC,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ Object.defineProperty(exports, "DataTable", {
7
+ enumerable: true,
8
+ get: function () {
9
+ return _DataTable.DataTable;
10
+ }
11
+ });
12
+ Object.defineProperty(exports, "Table", {
13
+ enumerable: true,
14
+ get: function () {
15
+ return _Table.Table;
16
+ }
17
+ });
18
+ var _Table = require("./Table.js");
19
+ var _DataTable = require("./DataTable.js");
20
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_Table","require","_DataTable"],"sourceRoot":"..\\..\\..\\..\\src","sources":["components/Table/index.ts"],"mappings":";;;;;;;;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAQA,IAAAC,UAAA,GAAAD,OAAA","ignoreList":[]}
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.BaconLogo = BaconLogo;
7
+ var _reactNativeSvg = require("react-native-svg");
8
+ var _jsxRuntime = require("react/jsx-runtime");
9
+ const VIEWBOX_W = 90.029;
10
+ const VIEWBOX_H = 75.2663;
11
+ const ASPECT = VIEWBOX_W / VIEWBOX_H;
12
+ const PATH = 'M79.6034 46.0332C84.1787 43.6264 87.0741 39.2894 87.0741 33.6655C87.0741 24.914 79.8477 19.0519 65.794 19.0519H51.2579H41.8987C40.594 19.0519 39.3728 18.7481 38.2826 18.2119C37.1626 17.6638 36.1975 16.8715 35.4409 15.9004C34.3923 14.5421 33.7609 12.8443 33.7609 11.0034V8.05447C33.7609 3.60426 30.1149 0 25.6289 0C21.143 0 17.497 3.60426 17.497 8.05447V11.0034C17.497 12.8443 16.8715 14.5421 15.817 15.9004C15.0604 16.8715 14.0953 17.6698 12.9753 18.2119C11.8851 18.7481 10.6638 19.0519 9.35915 19.0519H0V28.846H9.35915C13.857 28.846 17.4911 25.2357 17.4911 20.7915V16.4306C17.4911 11.9804 21.137 8.37617 25.623 8.37617C30.1089 8.37617 33.7549 11.9804 33.7549 16.4306V20.7915C33.7549 25.2357 37.3949 28.846 41.8868 28.846H64.1736C70.5183 28.846 73.9677 31.0145 73.9677 35.4289C73.9677 39.8434 70.5123 42.0953 64.1736 42.0953H51.9728H41.7617C40.5047 42.0775 39.3251 41.7796 38.2706 41.2553C37.1506 40.7132 36.1855 39.9149 35.4289 38.9438C34.3804 37.5855 33.7489 35.8877 33.7489 34.0468V31.0979C33.7489 26.6477 30.103 23.0494 25.6111 23.0494C21.1192 23.0494 17.4732 26.6536 17.4732 31.0979V34.0468C17.4732 35.8877 16.8477 37.5855 15.7932 38.9438C15.0366 39.9149 14.0715 40.7132 12.9515 41.2553C11.897 41.7796 10.7174 42.0775 9.46043 42.0953H0V51.5736H12.7251C12.7251 51.5736 12.737 51.5736 12.743 51.5736C15.3583 51.5736 17.4792 49.4528 17.4792 46.8375V44.24C17.4851 44.1089 17.4911 43.9779 17.4911 43.8468V39.486C17.4911 35.0357 21.137 31.4315 25.6289 31.4315C30.1209 31.4315 33.7668 35.0357 33.7668 39.486V43.8468C33.7668 43.9779 33.7728 44.1089 33.7787 44.24V46.8375C33.7787 49.4528 35.8996 51.5736 38.5149 51.5736C38.5149 51.5736 38.5268 51.5736 38.5328 51.5736H51.2579H66.4315C73.1753 51.5736 76.7915 53.8196 76.7915 58.5617C76.7915 63.3038 73.1753 65.4664 66.4315 65.4664H41.8928C40.5881 65.4664 39.3668 65.1626 38.2766 64.6264C37.1566 64.0783 36.1915 63.286 35.4349 62.3149C34.3864 60.9566 33.7549 59.2587 33.7549 57.4179V54.4689C33.7549 50.0187 30.1089 46.4145 25.623 46.4145C21.137 46.4145 17.4911 50.0187 17.4911 54.4689V57.4179C17.4911 59.2587 16.8655 60.9566 15.8111 62.3149C15.0545 63.286 14.0894 64.0843 12.9694 64.6264C11.8792 65.1626 10.6579 65.4664 9.35319 65.4664H0V75.2604H9.35915C13.857 75.2604 17.4911 71.6502 17.4911 67.206V62.8451C17.4911 58.3949 21.137 54.7906 25.623 54.7906C30.1089 54.7906 33.7549 58.3949 33.7549 62.8451V67.206C33.7549 71.6502 37.3949 75.2604 41.8868 75.2604H67.3906C82.1651 75.2604 89.8741 69.6366 89.8741 59.926C89.8741 52.8604 85.8587 48.0409 79.5975 46.0332H79.6034Z';
13
+ /**
14
+ * The Bacon POS brand mark (the red "B"). Rendered at its natural aspect ratio
15
+ * and not tinted by default — the brand color is preserved. Used as the default
16
+ * logo in `Sidebar`.
17
+ */
18
+ function BaconLogo({
19
+ height = 40,
20
+ color = '#FF003A'
21
+ }) {
22
+ const xml = `<svg viewBox="0 0 ${VIEWBOX_W} ${VIEWBOX_H}" xmlns="http://www.w3.org/2000/svg"><path d="${PATH}" fill="${color}"/></svg>`;
23
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeSvg.SvgXml, {
24
+ xml: xml,
25
+ width: height * ASPECT,
26
+ height: height
27
+ });
28
+ }
29
+ //# sourceMappingURL=BaconLogo.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_reactNativeSvg","require","_jsxRuntime","VIEWBOX_W","VIEWBOX_H","ASPECT","PATH","BaconLogo","height","color","xml","jsx","SvgXml","width"],"sourceRoot":"..\\..\\..\\..\\src","sources":["components/brand/BaconLogo.tsx"],"mappings":";;;;;;AAAA,IAAAA,eAAA,GAAAC,OAAA;AAA0C,IAAAC,WAAA,GAAAD,OAAA;AAE1C,MAAME,SAAS,GAAG,MAAM;AACxB,MAAMC,SAAS,GAAG,OAAO;AACzB,MAAMC,MAAM,GAAGF,SAAS,GAAGC,SAAS;AAEpC,MAAME,IAAI,GACR,k9EAAk9E;AASp9E;AACA;AACA;AACA;AACA;AACO,SAASC,SAASA,CAAC;EAAEC,MAAM,GAAG,EAAE;EAAEC,KAAK,GAAG;AAA0B,CAAC,EAAE;EAC5E,MAAMC,GAAG,GAAG,qBAAqBP,SAAS,IAAIC,SAAS,iDAAiDE,IAAI,WAAWG,KAAK,WAAW;EACvI,oBAAO,IAAAP,WAAA,CAAAS,GAAA,EAACX,eAAA,CAAAY,MAAM;IAACF,GAAG,EAAEA,GAAI;IAACG,KAAK,EAAEL,MAAM,GAAGH,MAAO;IAACG,MAAM,EAAEA;EAAO,CAAE,CAAC;AACrE","ignoreList":[]}
@@ -3,6 +3,12 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
+ Object.defineProperty(exports, "BaconLogo", {
7
+ enumerable: true,
8
+ get: function () {
9
+ return _BaconLogo.BaconLogo;
10
+ }
11
+ });
6
12
  Object.defineProperty(exports, "Flag", {
7
13
  enumerable: true,
8
14
  get: function () {
@@ -22,6 +28,7 @@ Object.defineProperty(exports, "graphics", {
22
28
  }
23
29
  });
24
30
  var _Logo = require("./Logo.js");
31
+ var _BaconLogo = require("./BaconLogo.js");
25
32
  var _Flag = require("./Flag.js");
26
33
  var _registry = require("./registry.js");
27
34
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_Logo","require","_Flag","_registry"],"sourceRoot":"..\\..\\..\\..\\src","sources":["components/brand/index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA","ignoreList":[]}
1
+ {"version":3,"names":["_Logo","require","_BaconLogo","_Flag","_registry"],"sourceRoot":"..\\..\\..\\..\\src","sources":["components/brand/index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,UAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,SAAA,GAAAH,OAAA","ignoreList":[]}