@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,264 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.Sidebar = Sidebar;
7
+ var _react = require("react");
8
+ var _reactNative = require("react-native");
9
+ var _index = require("../../theme/index.js");
10
+ var _BaconLogo = require("../brand/BaconLogo.js");
11
+ var _Icon = require("../Icon/Icon.js");
12
+ var _IconButton = require("../IconButton/IconButton.js");
13
+ var _Text = require("../Text/Text.js");
14
+ var _ScrollArea = require("../_internal/ScrollArea.js");
15
+ var _jsxRuntime = require("react/jsx-runtime");
16
+ const ITEM_HEIGHT = 74;
17
+ const ITEM_GAP = 16;
18
+ const PADDING = 24;
19
+ const TOGGLE_SIZE = 40; // IconButton size "sm"
20
+
21
+ function SidebarButton({
22
+ item,
23
+ active,
24
+ collapsed,
25
+ onPress
26
+ }) {
27
+ const theme = (0, _index.useTheme)();
28
+ const [hovered, setHovered] = (0, _react.useState)(false);
29
+ const disabled = item.disabled;
30
+ const backgroundColor = active ? theme.colors.action.secondary : hovered && !disabled ? theme.colors.background.muted : 'transparent';
31
+ const contentColor = active ? theme.colors.action.secondaryForeground : theme.colors.text.secondary;
32
+ const iconColor = active ? theme.colors.action.secondaryForeground : 'secondary';
33
+ const iconName = active && item.activeIcon ? item.activeIcon : item.icon;
34
+ const initial = item.label.trim().charAt(0).toUpperCase();
35
+
36
+ // Leading slot is always a fixed 24×24 box (flexShrink: 0) so the icon never
37
+ // shrinks next to a long label and labels stay aligned with or without an icon.
38
+ // No icon → reserve the space when expanded; show the initial when collapsed.
39
+ const leadingBox = {
40
+ width: 24,
41
+ height: 24,
42
+ flexShrink: 0,
43
+ alignItems: 'center',
44
+ justifyContent: 'center'
45
+ };
46
+ const leading = /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
47
+ style: leadingBox,
48
+ children: iconName ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_Icon.Icon, {
49
+ name: iconName,
50
+ size: 24,
51
+ color: iconColor
52
+ }) : collapsed ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_Text.Text, {
53
+ variant: "bodyLarge",
54
+ weight: "medium",
55
+ color: contentColor,
56
+ children: initial
57
+ }) : null
58
+ });
59
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Pressable, {
60
+ onPress: disabled ? undefined : onPress,
61
+ onHoverIn: () => setHovered(true),
62
+ onHoverOut: () => setHovered(false),
63
+ disabled: disabled,
64
+ accessibilityRole: "tab",
65
+ accessibilityState: {
66
+ selected: active,
67
+ disabled
68
+ },
69
+ accessibilityLabel: item.label,
70
+ style: {
71
+ flexDirection: 'row',
72
+ alignItems: 'center',
73
+ justifyContent: collapsed ? 'center' : 'flex-start',
74
+ gap: 10,
75
+ height: ITEM_HEIGHT,
76
+ paddingHorizontal: PADDING,
77
+ borderRadius: theme.radii.pill,
78
+ borderWidth: active ? 1 : 0,
79
+ borderColor: active ? theme.colors.border.default : 'transparent',
80
+ backgroundColor,
81
+ opacity: disabled ? 0.5 : 1
82
+ },
83
+ children: [leading, !collapsed ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_Text.Text, {
84
+ variant: "bodyLarge",
85
+ weight: "medium",
86
+ color: contentColor,
87
+ numberOfLines: 1,
88
+ ellipsizeMode: "tail",
89
+ style: {
90
+ flexShrink: 1,
91
+ minWidth: 0
92
+ },
93
+ children: item.label
94
+ }) : null]
95
+ });
96
+ }
97
+
98
+ /**
99
+ * Sidebar — the app's main navigation drawer (Figma "Sidebar"). Expands/collapses
100
+ * between a labelled and an icon-only rail (animated width). The logo defaults to
101
+ * the Bacon mark (override via `logo`); an optional `footer` shows supporting text
102
+ * at the bottom. Items are dynamic buttons (icon + label via props); the list
103
+ * scrolls with an elegant auto-hiding indicator when it overflows, leaving the
104
+ * footer pinned. Buttons have hover and active states to mark the current section.
105
+ */
106
+ function Sidebar({
107
+ items = [],
108
+ activeKey,
109
+ defaultActiveKey,
110
+ onChange,
111
+ collapsed: collapsedProp,
112
+ defaultCollapsed = false,
113
+ onCollapsedChange,
114
+ showToggle = true,
115
+ logo,
116
+ footer,
117
+ expandedWidth = 284,
118
+ collapsedWidth = 122,
119
+ scrollbarColor,
120
+ style
121
+ }) {
122
+ const theme = (0, _index.useTheme)();
123
+ const activeControlled = activeKey !== undefined;
124
+ const [activeInternal, setActiveInternal] = (0, _react.useState)(defaultActiveKey);
125
+ const active = activeControlled ? activeKey : activeInternal;
126
+ const collapseControlled = collapsedProp !== undefined;
127
+ const [collapsedInternal, setCollapsedInternal] = (0, _react.useState)(defaultCollapsed);
128
+ const collapsed = collapseControlled ? collapsedProp : collapsedInternal;
129
+ const width = (0, _react.useRef)(new _reactNative.Animated.Value(collapsed ? collapsedWidth : expandedWidth)).current;
130
+ // `visualCollapsed` drives the layout (labels, alignment, footer). It lags on
131
+ // collapse — labels stay mounted (clipped by overflow) until the width finishes
132
+ // shrinking — and leads on expand, so both directions animate without a jump.
133
+ const [visualCollapsed, setVisualCollapsed] = (0, _react.useState)(collapsed);
134
+ (0, _react.useEffect)(() => {
135
+ if (!collapsed) setVisualCollapsed(false);
136
+ const anim = _reactNative.Animated.timing(width, {
137
+ toValue: collapsed ? collapsedWidth : expandedWidth,
138
+ duration: 220,
139
+ easing: _reactNative.Easing.out(_reactNative.Easing.ease),
140
+ useNativeDriver: false // width
141
+ });
142
+ anim.start(({
143
+ finished
144
+ }) => {
145
+ if (finished && collapsed) setVisualCollapsed(true);
146
+ });
147
+ return () => anim.stop();
148
+ }, [collapsed, collapsedWidth, expandedWidth, width]);
149
+
150
+ // The toggle arrow spins in place (0° → 180°) instead of moving, so collapsing
151
+ // never nudges it. Driven by intent (`collapsed`), in sync with the width.
152
+ const arrowRot = (0, _react.useRef)(new _reactNative.Animated.Value(collapsed ? 1 : 0)).current;
153
+ (0, _react.useEffect)(() => {
154
+ const anim = _reactNative.Animated.timing(arrowRot, {
155
+ toValue: collapsed ? 1 : 0,
156
+ duration: 220,
157
+ easing: _reactNative.Easing.out(_reactNative.Easing.ease),
158
+ useNativeDriver: true
159
+ });
160
+ anim.start();
161
+ return () => anim.stop();
162
+ }, [collapsed, arrowRot]);
163
+ const arrowRotate = arrowRot.interpolate({
164
+ inputRange: [0, 1],
165
+ outputRange: ['0deg', '180deg']
166
+ });
167
+
168
+ // Glide the toggle from flush-left (expanded) to centered on the icon axis
169
+ // (collapsed), tracking the width so it never jumps.
170
+ const toggleTranslateX = width.interpolate({
171
+ inputRange: [collapsedWidth, expandedWidth],
172
+ outputRange: [Math.max(0, (collapsedWidth - 2 * PADDING - TOGGLE_SIZE) / 2), 0],
173
+ extrapolate: 'clamp'
174
+ });
175
+ const selectItem = item => {
176
+ if (!activeControlled) setActiveInternal(item.key);
177
+ item.onPress?.();
178
+ onChange?.(item.key);
179
+ };
180
+ const toggleCollapsed = () => {
181
+ const next = !collapsed;
182
+ if (!collapseControlled) setCollapsedInternal(next);
183
+ onCollapsedChange?.(next);
184
+ };
185
+ const logoNode = logo ?? /*#__PURE__*/(0, _jsxRuntime.jsx)(_BaconLogo.BaconLogo, {
186
+ height: visualCollapsed ? 36 : 40
187
+ });
188
+ const toggle = showToggle ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Animated.View, {
189
+ style: {
190
+ transform: [{
191
+ translateX: toggleTranslateX
192
+ }]
193
+ },
194
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Animated.View, {
195
+ style: {
196
+ transform: [{
197
+ rotate: arrowRotate
198
+ }]
199
+ },
200
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_IconButton.IconButton, {
201
+ icon: "arrow-left",
202
+ accessibilityLabel: collapsed ? 'Expand sidebar' : 'Collapse sidebar',
203
+ variant: "ghost",
204
+ size: "sm",
205
+ onPress: toggleCollapsed
206
+ })
207
+ })
208
+ }) : null;
209
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Animated.View, {
210
+ style: [{
211
+ width,
212
+ height: '100%',
213
+ backgroundColor: theme.colors.background.default,
214
+ paddingTop: 48,
215
+ paddingBottom: PADDING,
216
+ paddingHorizontal: PADDING,
217
+ overflow: 'hidden'
218
+ }, style],
219
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
220
+ style: {
221
+ minHeight: 56,
222
+ alignItems: visualCollapsed ? 'center' : 'flex-start',
223
+ justifyContent: 'center'
224
+ },
225
+ children: logoNode
226
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ScrollArea.ScrollArea, {
227
+ style: {
228
+ flex: 1,
229
+ marginTop: 32
230
+ },
231
+ indicatorColor: scrollbarColor ?? theme.colors.border.strong,
232
+ contentContainerStyle: {
233
+ gap: ITEM_GAP,
234
+ paddingBottom: 8
235
+ },
236
+ children: items.map(item => /*#__PURE__*/(0, _jsxRuntime.jsx)(SidebarButton, {
237
+ item: item,
238
+ active: item.key === active,
239
+ collapsed: visualCollapsed,
240
+ onPress: () => selectItem(item)
241
+ }, item.key))
242
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
243
+ style: {
244
+ marginTop: 28,
245
+ gap: 16
246
+ },
247
+ children: [footer && !visualCollapsed ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_Text.Text, {
248
+ variant: "bodySmall",
249
+ color: "tertiary",
250
+ numberOfLines: 1,
251
+ style: {
252
+ marginLeft: 8
253
+ },
254
+ children: footer
255
+ }) : null, toggle ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
256
+ style: {
257
+ alignItems: 'flex-start'
258
+ },
259
+ children: toggle
260
+ }) : null]
261
+ })]
262
+ });
263
+ }
264
+ //# sourceMappingURL=Sidebar.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_react","require","_reactNative","_index","_BaconLogo","_Icon","_IconButton","_Text","_ScrollArea","_jsxRuntime","ITEM_HEIGHT","ITEM_GAP","PADDING","TOGGLE_SIZE","SidebarButton","item","active","collapsed","onPress","theme","useTheme","hovered","setHovered","useState","disabled","backgroundColor","colors","action","secondary","background","muted","contentColor","secondaryForeground","text","iconColor","iconName","activeIcon","icon","initial","label","trim","charAt","toUpperCase","leadingBox","width","height","flexShrink","alignItems","justifyContent","leading","jsx","View","style","children","Icon","name","size","color","Text","variant","weight","jsxs","Pressable","undefined","onHoverIn","onHoverOut","accessibilityRole","accessibilityState","selected","accessibilityLabel","flexDirection","gap","paddingHorizontal","borderRadius","radii","pill","borderWidth","borderColor","border","default","opacity","numberOfLines","ellipsizeMode","minWidth","Sidebar","items","activeKey","defaultActiveKey","onChange","collapsedProp","defaultCollapsed","onCollapsedChange","showToggle","logo","footer","expandedWidth","collapsedWidth","scrollbarColor","activeControlled","activeInternal","setActiveInternal","collapseControlled","collapsedInternal","setCollapsedInternal","useRef","Animated","Value","current","visualCollapsed","setVisualCollapsed","useEffect","anim","timing","toValue","duration","easing","Easing","out","ease","useNativeDriver","start","finished","stop","arrowRot","arrowRotate","interpolate","inputRange","outputRange","toggleTranslateX","Math","max","extrapolate","selectItem","key","toggleCollapsed","next","logoNode","BaconLogo","toggle","transform","translateX","rotate","IconButton","paddingTop","paddingBottom","overflow","minHeight","ScrollArea","flex","marginTop","indicatorColor","strong","contentContainerStyle","map","marginLeft"],"sourceRoot":"..\\..\\..\\..\\src","sources":["components/Sidebar/Sidebar.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAQA,IAAAE,MAAA,GAAAF,OAAA;AACA,IAAAG,UAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AAEA,IAAAK,WAAA,GAAAL,OAAA;AACA,IAAAM,KAAA,GAAAN,OAAA;AACA,IAAAO,WAAA,GAAAP,OAAA;AAAqD,IAAAQ,WAAA,GAAAR,OAAA;AAmDrD,MAAMS,WAAW,GAAG,EAAE;AACtB,MAAMC,QAAQ,GAAG,EAAE;AACnB,MAAMC,OAAO,GAAG,EAAE;AAClB,MAAMC,WAAW,GAAG,EAAE,CAAC,CAAC;;AAExB,SAASC,aAAaA,CAAC;EACrBC,IAAI;EACJC,MAAM;EACNC,SAAS;EACTC;AAMF,CAAC,EAAE;EACD,MAAMC,KAAK,GAAG,IAAAC,eAAQ,EAAC,CAAC;EACxB,MAAM,CAACC,OAAO,EAAEC,UAAU,CAAC,GAAG,IAAAC,eAAQ,EAAC,KAAK,CAAC;EAC7C,MAAMC,QAAQ,GAAGT,IAAI,CAACS,QAAQ;EAE9B,MAAMC,eAAe,GAAGT,MAAM,GAC1BG,KAAK,CAACO,MAAM,CAACC,MAAM,CAACC,SAAS,GAC7BP,OAAO,IAAI,CAACG,QAAQ,GAClBL,KAAK,CAACO,MAAM,CAACG,UAAU,CAACC,KAAK,GAC7B,aAAa;EACnB,MAAMC,YAAY,GAAGf,MAAM,GACv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AAA,CAAAyC,GAAA,EAACpC,aAAa;QAEZC,IAAI,EAAEA,IAAK;QACXC,MAAM,EAAED,IAAI,CAACsH,GAAG,KAAKrH,MAAO;QAC5BC,SAAS,EAAE2F,eAAgB;QAC3B1F,OAAO,EAAEA,CAAA,KAAMkH,UAAU,CAACrH,IAAI;MAAE,GAJ3BA,IAAI,CAACsH,GAKX,CACF;IAAC,CACQ,CAAC,eAGb,IAAA5H,WAAA,CAAAoD,IAAA,EAAC3D,YAAA,CAAAiD,IAAI;MAACC,KAAK,EAAE;QAAEiG,SAAS,EAAE,EAAE;QAAE9E,GAAG,EAAE;MAAG,CAAE;MAAAlB,QAAA,GACrCyC,MAAM,IAAI,CAACc,eAAe,gBACzB,IAAAnG,WAAA,CAAAyC,GAAA,EAAC3C,KAAA,CAAAmD,IAAI;QAACC,OAAO,EAAC,WAAW;QAACF,KAAK,EAAC,UAAU;QAACwB,aAAa,EAAE,CAAE;QAAC7B,KAAK,EAAE;UAAEsG,UAAU,EAAE;QAAE,CAAE;QAAArG,QAAA,EACnFyC;MAAM,CACH,CAAC,GACL,IAAI,EACP4C,MAAM,gBACL,IAAAjI,WAAA,CAAAyC,GAAA,EAAChD,YAAA,CAAAiD,IAAI;QAACC,KAAK,EAAE;UAAEL,UAAU,EAAE;QAAa,CAAE;QAAAM,QAAA,EAAEqF;MAAM,CAAO,CAAC,GACxD,IAAI;IAAA,CACJ,CAAC;EAAA,CACM,CAAC;AAEpB","ignoreList":[]}
@@ -0,0 +1,229 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = exports.Toggleable = exports.Scrolling = exports.NoIcon = exports.Minimal = exports.LongLabels = exports.Expanded = exports.CustomLogo = exports.Collapsed = void 0;
7
+ var _react = require("react");
8
+ var _reactNative = require("react-native");
9
+ var _Sidebar = require("./Sidebar.js");
10
+ var _jsxRuntime = require("react/jsx-runtime");
11
+ const meta = {
12
+ title: 'Components/Sidebar',
13
+ component: _Sidebar.Sidebar
14
+ };
15
+ var _default = exports.default = meta;
16
+ const ITEMS = [{
17
+ key: 'home',
18
+ label: 'Home',
19
+ icon: 'home'
20
+ }, {
21
+ key: 'tables',
22
+ label: 'Table Map',
23
+ icon: 'table'
24
+ }, {
25
+ key: 'menu',
26
+ label: 'Menu List',
27
+ icon: 'dish'
28
+ }, {
29
+ key: 'orders',
30
+ label: 'Orders',
31
+ icon: 'receipt'
32
+ }, {
33
+ key: 'users',
34
+ label: 'User Mgmt.',
35
+ icon: 'usergroup'
36
+ }, {
37
+ key: 'customers',
38
+ label: 'Customers',
39
+ icon: 'user-star'
40
+ }, {
41
+ key: 'reports',
42
+ label: 'Reports',
43
+ icon: 'analytics'
44
+ }, {
45
+ key: 'settings',
46
+ label: 'Settings',
47
+ icon: 'settings'
48
+ }];
49
+
50
+ // A tall frame so the drawer fills a page-like height.
51
+ function Frame({
52
+ children
53
+ }) {
54
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
55
+ style: {
56
+ height: 720,
57
+ flexDirection: 'row'
58
+ },
59
+ children: children
60
+ });
61
+ }
62
+
63
+ /** Expanded (Figma default), with footer text. */
64
+ const Expanded = exports.Expanded = {
65
+ render: () => {
66
+ const [active, setActive] = (0, _react.useState)('home');
67
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(Frame, {
68
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Sidebar.Sidebar, {
69
+ items: ITEMS,
70
+ activeKey: active,
71
+ onChange: setActive,
72
+ footer: "Bacon POS v2.0.12"
73
+ })
74
+ });
75
+ }
76
+ };
77
+
78
+ /** Collapsed (icon-only rail). */
79
+ const Collapsed = exports.Collapsed = {
80
+ render: () => {
81
+ const [active, setActive] = (0, _react.useState)('home');
82
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(Frame, {
83
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Sidebar.Sidebar, {
84
+ items: ITEMS,
85
+ activeKey: active,
86
+ onChange: setActive,
87
+ defaultCollapsed: true,
88
+ footer: "Bacon POS v2.0.12"
89
+ })
90
+ });
91
+ }
92
+ };
93
+
94
+ /** Toggle it — press the arrow to expand/collapse. */
95
+ const Toggleable = exports.Toggleable = {
96
+ render: () => {
97
+ const [active, setActive] = (0, _react.useState)('orders');
98
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(Frame, {
99
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Sidebar.Sidebar, {
100
+ items: ITEMS,
101
+ activeKey: active,
102
+ onChange: setActive,
103
+ footer: "Bacon POS v2.0.12"
104
+ })
105
+ });
106
+ }
107
+ };
108
+
109
+ /** No footer (default) and few items. */
110
+ const Minimal = exports.Minimal = {
111
+ render: () => {
112
+ const [active, setActive] = (0, _react.useState)('home');
113
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(Frame, {
114
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Sidebar.Sidebar, {
115
+ items: ITEMS.slice(0, 3),
116
+ activeKey: active,
117
+ onChange: setActive,
118
+ showToggle: false
119
+ })
120
+ });
121
+ }
122
+ };
123
+
124
+ /** Many items — the list scrolls, the footer stays pinned. */
125
+ const Scrolling = exports.Scrolling = {
126
+ render: () => {
127
+ const many = Array.from({
128
+ length: 14
129
+ }).map((_, i) => ({
130
+ key: String(i),
131
+ label: `Section ${i + 1}`,
132
+ icon: 'analytics'
133
+ }));
134
+ const [active, setActive] = (0, _react.useState)('0');
135
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
136
+ style: {
137
+ height: 480,
138
+ flexDirection: 'row'
139
+ },
140
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Sidebar.Sidebar, {
141
+ items: many,
142
+ activeKey: active,
143
+ onChange: setActive,
144
+ footer: "Bacon POS v2.0.12"
145
+ })
146
+ });
147
+ }
148
+ };
149
+
150
+ /** Long labels truncate with an ellipsis (single line). */
151
+ const LongLabels = exports.LongLabels = {
152
+ render: () => {
153
+ const [active, setActive] = (0, _react.useState)('a');
154
+ const items = [{
155
+ key: 'a',
156
+ label: 'Reservations & waitlist management',
157
+ icon: 'table'
158
+ }, {
159
+ key: 'b',
160
+ label: 'Kitchen display system settings',
161
+ icon: 'settings'
162
+ }, {
163
+ key: 'c',
164
+ label: 'Customer loyalty & rewards program',
165
+ icon: 'user-star'
166
+ }];
167
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(Frame, {
168
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Sidebar.Sidebar, {
169
+ items: items,
170
+ activeKey: active,
171
+ onChange: setActive,
172
+ footer: "Bacon POS v2.0.12"
173
+ })
174
+ });
175
+ }
176
+ };
177
+
178
+ /**
179
+ * Items without an icon: expanded keeps the icon's blank space (labels stay
180
+ * aligned); collapsed shows the label's initial.
181
+ */
182
+ const NoIcon = exports.NoIcon = {
183
+ render: () => {
184
+ const [active, setActive] = (0, _react.useState)('home');
185
+ const items = [{
186
+ key: 'home',
187
+ label: 'Home',
188
+ icon: 'home'
189
+ }, {
190
+ key: 'reports',
191
+ label: 'Reports'
192
+ },
193
+ // no icon → blank space / initial "R"
194
+ {
195
+ key: 'billing',
196
+ label: 'Billing'
197
+ },
198
+ // no icon → "B"
199
+ {
200
+ key: 'settings',
201
+ label: 'Settings',
202
+ icon: 'settings'
203
+ }];
204
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(Frame, {
205
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Sidebar.Sidebar, {
206
+ items: items,
207
+ activeKey: active,
208
+ onChange: setActive,
209
+ footer: "Bacon POS v2.0.12"
210
+ })
211
+ });
212
+ }
213
+ };
214
+
215
+ /** Custom logo color. */
216
+ const CustomLogo = exports.CustomLogo = {
217
+ render: () => {
218
+ const [active, setActive] = (0, _react.useState)('home');
219
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(Frame, {
220
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Sidebar.Sidebar, {
221
+ items: ITEMS,
222
+ activeKey: active,
223
+ onChange: setActive,
224
+ footer: "Acme v1"
225
+ })
226
+ });
227
+ }
228
+ };
229
+ //# sourceMappingURL=Sidebar.stories.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_react","require","_reactNative","_Sidebar","_jsxRuntime","meta","title","component","Sidebar","_default","exports","default","ITEMS","key","label","icon","Frame","children","jsx","View","style","height","flexDirection","Expanded","render","active","setActive","useState","items","activeKey","onChange","footer","Collapsed","defaultCollapsed","Toggleable","Minimal","slice","showToggle","Scrolling","many","Array","from","length","map","_","i","String","LongLabels","NoIcon","CustomLogo"],"sourceRoot":"..\\..\\..\\..\\src","sources":["components/Sidebar/Sidebar.stories.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAEA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AAAsD,IAAAG,WAAA,GAAAH,OAAA;AAEtD,MAAMI,IAAI,GAAG;EACXC,KAAK,EAAE,oBAAoB;EAC3BC,SAAS,EAAEC;AACb,CAAgC;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAElBN,IAAI;AAGnB,MAAMO,KAAoB,GAAG,CAC3B;EAAEC,GAAG,EAAE,MAAM;EAAEC,KAAK,EAAE,MAAM;EAAEC,IAAI,EAAE;AAAO,CAAC,EAC5C;EAAEF,GAAG,EAAE,QAAQ;EAAEC,KAAK,EAAE,WAAW;EAAEC,IAAI,EAAE;AAAQ,CAAC,EACpD;EAAEF,GAAG,EAAE,MAAM;EAAEC,KAAK,EAAE,WAAW;EAAEC,IAAI,EAAE;AAAO,CAAC,EACjD;EAAEF,GAAG,EAAE,QAAQ;EAAEC,KAAK,EAAE,QAAQ;EAAEC,IAAI,EAAE;AAAU,CAAC,EACnD;EAAEF,GAAG,EAAE,OAAO;EAAEC,KAAK,EAAE,YAAY;EAAEC,IAAI,EAAE;AAAY,CAAC,EACxD;EAAEF,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AvB,WAAA,CAAAc,GAAA,EAACF,KAAK;MAAAC,QAAA,eACJ,IAAAb,WAAA,CAAAc,GAAA,EAACf,QAAA,CAAAK,OAAO;QAACoB,KAAK,EAAEhB,KAAM;QAACiB,SAAS,EAAEJ,MAAO;QAACK,QAAQ,EAAEJ,SAAU;QAACK,MAAM,EAAC;MAAS,CAAE;IAAC,CAC7E,CAAC;EAEZ;AACF,CAAC","ignoreList":[]}
@@ -0,0 +1,131 @@
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 _Sidebar = require("./Sidebar.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 ITEMS = [{
14
+ key: 'home',
15
+ label: 'Home',
16
+ icon: 'home'
17
+ }, {
18
+ key: 'orders',
19
+ label: 'Orders',
20
+ icon: 'receipt'
21
+ }, {
22
+ key: 'settings',
23
+ label: 'Settings',
24
+ icon: 'settings'
25
+ }];
26
+ describe('Sidebar', () => {
27
+ it('renders all item labels when expanded', () => {
28
+ wrap(/*#__PURE__*/(0, _jsxRuntime.jsx)(_Sidebar.Sidebar, {
29
+ items: ITEMS
30
+ }));
31
+ expect(_reactNative.screen.getByText('Home')).toBeTruthy();
32
+ expect(_reactNative.screen.getByText('Orders')).toBeTruthy();
33
+ expect(_reactNative.screen.getByText('Settings')).toBeTruthy();
34
+ });
35
+ it('shows the footer only when provided', () => {
36
+ const {
37
+ rerender
38
+ } = wrap(/*#__PURE__*/(0, _jsxRuntime.jsx)(_Sidebar.Sidebar, {
39
+ items: ITEMS
40
+ }));
41
+ expect(_reactNative.screen.queryByText('v1.0')).toBeNull();
42
+ rerender(/*#__PURE__*/(0, _jsxRuntime.jsx)(_index.ThemeProvider, {
43
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Sidebar.Sidebar, {
44
+ items: ITEMS,
45
+ footer: "v1.0"
46
+ })
47
+ }));
48
+ expect(_reactNative.screen.getByText('v1.0')).toBeTruthy();
49
+ });
50
+ it('fires onChange with the pressed item key', () => {
51
+ const onChange = jest.fn();
52
+ wrap(/*#__PURE__*/(0, _jsxRuntime.jsx)(_Sidebar.Sidebar, {
53
+ items: ITEMS,
54
+ onChange: onChange
55
+ }));
56
+ _reactNative.fireEvent.press(_reactNative.screen.getByText('Orders'));
57
+ expect(onChange).toHaveBeenCalledWith('orders');
58
+ });
59
+ it('marks the active item as selected', () => {
60
+ wrap(/*#__PURE__*/(0, _jsxRuntime.jsx)(_Sidebar.Sidebar, {
61
+ items: ITEMS,
62
+ activeKey: "orders"
63
+ }));
64
+ expect(_reactNative.screen.getByLabelText('Orders').props.accessibilityState).toMatchObject({
65
+ selected: true
66
+ });
67
+ expect(_reactNative.screen.getByLabelText('Home').props.accessibilityState).toMatchObject({
68
+ selected: false
69
+ });
70
+ });
71
+ it('hides labels and footer when collapsed', () => {
72
+ wrap(/*#__PURE__*/(0, _jsxRuntime.jsx)(_Sidebar.Sidebar, {
73
+ items: ITEMS,
74
+ defaultCollapsed: true,
75
+ footer: "v1.0"
76
+ }));
77
+ expect(_reactNative.screen.queryByText('Home')).toBeNull();
78
+ expect(_reactNative.screen.queryByText('v1.0')).toBeNull();
79
+ });
80
+ it('truncates a long label to a single line', () => {
81
+ wrap(/*#__PURE__*/(0, _jsxRuntime.jsx)(_Sidebar.Sidebar, {
82
+ items: [{
83
+ key: 'a',
84
+ label: 'A very long navigation label',
85
+ icon: 'home'
86
+ }]
87
+ }));
88
+ expect(_reactNative.screen.getByText('A very long navigation label').props.numberOfLines).toBe(1);
89
+ });
90
+ it('shows the label initial for an icon-less item when collapsed', () => {
91
+ wrap(/*#__PURE__*/(0, _jsxRuntime.jsx)(_Sidebar.Sidebar, {
92
+ items: [{
93
+ key: 'r',
94
+ label: 'Reports'
95
+ }],
96
+ defaultCollapsed: true
97
+ }));
98
+ expect(_reactNative.screen.getByText('R')).toBeTruthy();
99
+ });
100
+ it('renders an icon-less item normally when expanded (label shown, no initial)', () => {
101
+ wrap(/*#__PURE__*/(0, _jsxRuntime.jsx)(_Sidebar.Sidebar, {
102
+ items: [{
103
+ key: 'r',
104
+ label: 'Reports'
105
+ }]
106
+ }));
107
+ expect(_reactNative.screen.getByText('Reports')).toBeTruthy();
108
+ expect(_reactNative.screen.queryByText('R')).toBeNull();
109
+ });
110
+ it('toggles collapse via the built-in control', () => {
111
+ function Ctrl() {
112
+ const [c, setC] = (0, _react.useState)(false);
113
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Sidebar.Sidebar, {
114
+ items: ITEMS,
115
+ collapsed: c,
116
+ onCollapsedChange: setC
117
+ });
118
+ }
119
+ wrap(/*#__PURE__*/(0, _jsxRuntime.jsx)(Ctrl, {}));
120
+ // The control flips its intent immediately (the visual collapse trails the
121
+ // width animation, so we assert on the toggle rather than label unmount).
122
+ expect(_reactNative.screen.getByLabelText('Collapse sidebar')).toBeTruthy();
123
+ _reactNative.fireEvent.press(_reactNative.screen.getByLabelText('Collapse sidebar'));
124
+ expect(_reactNative.screen.getByLabelText('Expand sidebar')).toBeTruthy();
125
+ _reactNative.fireEvent.press(_reactNative.screen.getByLabelText('Expand sidebar'));
126
+ expect(_reactNative.screen.getByLabelText('Collapse sidebar')).toBeTruthy();
127
+ // Labels are still present while expanded.
128
+ expect(_reactNative.screen.getByText('Home')).toBeTruthy();
129
+ });
130
+ });
131
+ //# sourceMappingURL=Sidebar.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_react","require","_reactNative","_index","_Sidebar","_jsxRuntime","wrap","ui","render","jsx","ThemeProvider","children","ITEMS","key","label","icon","describe","it","Sidebar","items","expect","screen","getByText","toBeTruthy","rerender","queryByText","toBeNull","footer","onChange","jest","fn","fireEvent","press","toHaveBeenCalledWith","activeKey","getByLabelText","props","accessibilityState","toMatchObject","selected","defaultCollapsed","numberOfLines","toBe","Ctrl","c","setC","useState","collapsed","onCollapsedChange"],"sourceRoot":"..\\..\\..\\..\\src","sources":["components/Sidebar/Sidebar.test.tsx"],"mappings":";;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AAAsD,IAAAI,WAAA,GAAAJ,OAAA;AAEtD,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,KAAoB,GAAG,CAC3B;EAAEC,GAAG,EAAE,MAAM;EAAEC,KAAK,EAAE,MAAM;EAAEC,IAAI,EAAE;AAAO,CAAC,EAC5C;EAAEF,GAAG,EAAE,QAAQ;EAAEC,KAAK,EAAE,QAAQ;EAAEC,IAAI,EAAE;AAAU,CAAC,EACnD;EAAEF,GAAG,EAAE,UAAU;EAAEC,KAAK,EAAE,UAAU;EAAEC,IAAI,EAAE;AAAW,CAAC,CACzD;AAEDC,QAAQ,CAAC,SAAS,EAAE,MAAM;EACxBC,EAAE,CAAC,uCAAuC,EAAE,MAAM;IAChDX,IAAI,cAAC,IAAAD,WAAA,CAAAI,GAAA,EAACL,QAAA,CAAAc,OAAO;MAACC,KAAK,EAAEP;IAAM,CAAE,CAAC,CAAC;IAC/BQ,MAAM,CAACC,mBAAM,CAACC,SAAS,CAAC,MAAM,CAAC,CAAC,CAACC,UAAU,CAAC,CAAC;IAC7CH,MAAM,CAACC,mBAAM,CAACC,SAAS,CAAC,QAAQ,CAAC,CAAC,CAACC,UAAU,CAAC,CAAC;IAC/CH,MAAM,CAACC,mBAAM,CAACC,SAAS,CAAC,UAAU,CAAC,CAAC,CAACC,UAAU,CAAC,CAAC;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