@bacon-pos/ui 0.9.0 → 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/commonjs/components/EmptyState/EmptyState.js +88 -0
- package/lib/commonjs/components/EmptyState/EmptyState.js.map +1 -0
- package/lib/commonjs/components/EmptyState/EmptyState.stories.js +46 -0
- package/lib/commonjs/components/EmptyState/EmptyState.stories.js.map +1 -0
- package/lib/commonjs/components/EmptyState/EmptyState.test.js +40 -0
- package/lib/commonjs/components/EmptyState/EmptyState.test.js.map +1 -0
- package/lib/commonjs/components/EmptyState/index.js +13 -0
- package/lib/commonjs/components/EmptyState/index.js.map +1 -0
- package/lib/commonjs/components/Sidebar/Sidebar.js +264 -0
- package/lib/commonjs/components/Sidebar/Sidebar.js.map +1 -0
- package/lib/commonjs/components/Sidebar/Sidebar.stories.js +229 -0
- package/lib/commonjs/components/Sidebar/Sidebar.stories.js.map +1 -0
- package/lib/commonjs/components/Sidebar/Sidebar.test.js +131 -0
- package/lib/commonjs/components/Sidebar/Sidebar.test.js.map +1 -0
- package/lib/commonjs/components/Sidebar/index.js +13 -0
- package/lib/commonjs/components/Sidebar/index.js.map +1 -0
- package/lib/commonjs/components/Table/DataTable.js +149 -0
- package/lib/commonjs/components/Table/DataTable.js.map +1 -0
- package/lib/commonjs/components/Table/DataTable.stories.js +214 -0
- package/lib/commonjs/components/Table/DataTable.stories.js.map +1 -0
- package/lib/commonjs/components/Table/DataTable.test.js +143 -0
- package/lib/commonjs/components/Table/DataTable.test.js.map +1 -0
- package/lib/commonjs/components/Table/Table.js +520 -0
- package/lib/commonjs/components/Table/Table.js.map +1 -0
- package/lib/commonjs/components/Table/Table.stories.js +385 -0
- package/lib/commonjs/components/Table/Table.stories.js.map +1 -0
- package/lib/commonjs/components/Table/Table.test.js +278 -0
- package/lib/commonjs/components/Table/Table.test.js.map +1 -0
- package/lib/commonjs/components/Table/index.js +20 -0
- package/lib/commonjs/components/Table/index.js.map +1 -0
- package/lib/commonjs/components/brand/BaconLogo.js +29 -0
- package/lib/commonjs/components/brand/BaconLogo.js.map +1 -0
- package/lib/commonjs/components/brand/index.js +7 -0
- package/lib/commonjs/components/brand/index.js.map +1 -1
- package/lib/commonjs/components/index.js +50 -17
- package/lib/commonjs/components/index.js.map +1 -1
- package/lib/module/components/EmptyState/EmptyState.js +84 -0
- package/lib/module/components/EmptyState/EmptyState.js.map +1 -0
- package/lib/module/components/EmptyState/EmptyState.stories.js +42 -0
- package/lib/module/components/EmptyState/EmptyState.stories.js.map +1 -0
- package/lib/module/components/EmptyState/EmptyState.test.js +40 -0
- package/lib/module/components/EmptyState/EmptyState.test.js.map +1 -0
- package/lib/module/components/EmptyState/index.js +4 -0
- package/lib/module/components/EmptyState/index.js.map +1 -0
- package/lib/module/components/Sidebar/Sidebar.js +260 -0
- package/lib/module/components/Sidebar/Sidebar.js.map +1 -0
- package/lib/module/components/Sidebar/Sidebar.stories.js +225 -0
- package/lib/module/components/Sidebar/Sidebar.stories.js.map +1 -0
- package/lib/module/components/Sidebar/Sidebar.test.js +131 -0
- package/lib/module/components/Sidebar/Sidebar.test.js.map +1 -0
- package/lib/module/components/Sidebar/index.js +4 -0
- package/lib/module/components/Sidebar/index.js.map +1 -0
- package/lib/module/components/Table/DataTable.js +145 -0
- package/lib/module/components/Table/DataTable.js.map +1 -0
- package/lib/module/components/Table/DataTable.stories.js +210 -0
- package/lib/module/components/Table/DataTable.stories.js.map +1 -0
- package/lib/module/components/Table/DataTable.test.js +143 -0
- package/lib/module/components/Table/DataTable.test.js.map +1 -0
- package/lib/module/components/Table/Table.js +516 -0
- package/lib/module/components/Table/Table.js.map +1 -0
- package/lib/module/components/Table/Table.stories.js +381 -0
- package/lib/module/components/Table/Table.stories.js.map +1 -0
- package/lib/module/components/Table/Table.test.js +278 -0
- package/lib/module/components/Table/Table.test.js.map +1 -0
- package/lib/module/components/Table/index.js +5 -0
- package/lib/module/components/Table/index.js.map +1 -0
- package/lib/module/components/brand/BaconLogo.js +25 -0
- package/lib/module/components/brand/BaconLogo.js.map +1 -0
- package/lib/module/components/brand/index.js +1 -0
- package/lib/module/components/brand/index.js.map +1 -1
- package/lib/module/components/index.js +3 -0
- package/lib/module/components/index.js.map +1 -1
- package/lib/typescript/commonjs/components/EmptyState/EmptyState.d.ts +30 -0
- package/lib/typescript/commonjs/components/EmptyState/EmptyState.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/EmptyState/index.d.ts +3 -0
- package/lib/typescript/commonjs/components/EmptyState/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/Sidebar/Sidebar.d.ts +57 -0
- package/lib/typescript/commonjs/components/Sidebar/Sidebar.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/Sidebar/index.d.ts +3 -0
- package/lib/typescript/commonjs/components/Sidebar/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/Table/DataTable.d.ts +53 -0
- package/lib/typescript/commonjs/components/Table/DataTable.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/Table/Table.d.ts +85 -0
- package/lib/typescript/commonjs/components/Table/Table.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/Table/index.d.ts +5 -0
- package/lib/typescript/commonjs/components/Table/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/brand/BaconLogo.d.ts +13 -0
- package/lib/typescript/commonjs/components/brand/BaconLogo.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/brand/index.d.ts +1 -0
- package/lib/typescript/commonjs/components/brand/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/components/index.d.ts +3 -0
- package/lib/typescript/commonjs/components/index.d.ts.map +1 -1
- package/lib/typescript/module/components/EmptyState/EmptyState.d.ts +30 -0
- package/lib/typescript/module/components/EmptyState/EmptyState.d.ts.map +1 -0
- package/lib/typescript/module/components/EmptyState/index.d.ts +3 -0
- package/lib/typescript/module/components/EmptyState/index.d.ts.map +1 -0
- package/lib/typescript/module/components/Sidebar/Sidebar.d.ts +57 -0
- package/lib/typescript/module/components/Sidebar/Sidebar.d.ts.map +1 -0
- package/lib/typescript/module/components/Sidebar/index.d.ts +3 -0
- package/lib/typescript/module/components/Sidebar/index.d.ts.map +1 -0
- package/lib/typescript/module/components/Table/DataTable.d.ts +53 -0
- package/lib/typescript/module/components/Table/DataTable.d.ts.map +1 -0
- package/lib/typescript/module/components/Table/Table.d.ts +85 -0
- package/lib/typescript/module/components/Table/Table.d.ts.map +1 -0
- package/lib/typescript/module/components/Table/index.d.ts +5 -0
- package/lib/typescript/module/components/Table/index.d.ts.map +1 -0
- package/lib/typescript/module/components/brand/BaconLogo.d.ts +13 -0
- package/lib/typescript/module/components/brand/BaconLogo.d.ts.map +1 -0
- package/lib/typescript/module/components/brand/index.d.ts +1 -0
- package/lib/typescript/module/components/brand/index.d.ts.map +1 -1
- package/lib/typescript/module/components/index.d.ts +3 -0
- package/lib/typescript/module/components/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/components/EmptyState/EmptyState.tsx +91 -0
- package/src/components/EmptyState/index.ts +2 -0
- package/src/components/Sidebar/Sidebar.tsx +320 -0
- package/src/components/Sidebar/index.ts +2 -0
- package/src/components/Table/DataTable.tsx +173 -0
- package/src/components/Table/Table.tsx +556 -0
- package/src/components/Table/index.ts +10 -0
- package/src/components/brand/BaconLogo.tsx +25 -0
- package/src/components/brand/index.ts +1 -0
- package/src/components/index.ts +3 -0
|
@@ -0,0 +1,260 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { useEffect, useRef, useState } from 'react';
|
|
4
|
+
import { Animated, Easing, Pressable, View } from 'react-native';
|
|
5
|
+
import { useTheme } from "../../theme/index.js";
|
|
6
|
+
import { BaconLogo } from "../brand/BaconLogo.js";
|
|
7
|
+
import { Icon } from "../Icon/Icon.js";
|
|
8
|
+
import { IconButton } from "../IconButton/IconButton.js";
|
|
9
|
+
import { Text } from "../Text/Text.js";
|
|
10
|
+
import { ScrollArea } from "../_internal/ScrollArea.js";
|
|
11
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
12
|
+
const ITEM_HEIGHT = 74;
|
|
13
|
+
const ITEM_GAP = 16;
|
|
14
|
+
const PADDING = 24;
|
|
15
|
+
const TOGGLE_SIZE = 40; // IconButton size "sm"
|
|
16
|
+
|
|
17
|
+
function SidebarButton({
|
|
18
|
+
item,
|
|
19
|
+
active,
|
|
20
|
+
collapsed,
|
|
21
|
+
onPress
|
|
22
|
+
}) {
|
|
23
|
+
const theme = useTheme();
|
|
24
|
+
const [hovered, setHovered] = useState(false);
|
|
25
|
+
const disabled = item.disabled;
|
|
26
|
+
const backgroundColor = active ? theme.colors.action.secondary : hovered && !disabled ? theme.colors.background.muted : 'transparent';
|
|
27
|
+
const contentColor = active ? theme.colors.action.secondaryForeground : theme.colors.text.secondary;
|
|
28
|
+
const iconColor = active ? theme.colors.action.secondaryForeground : 'secondary';
|
|
29
|
+
const iconName = active && item.activeIcon ? item.activeIcon : item.icon;
|
|
30
|
+
const initial = item.label.trim().charAt(0).toUpperCase();
|
|
31
|
+
|
|
32
|
+
// Leading slot is always a fixed 24×24 box (flexShrink: 0) so the icon never
|
|
33
|
+
// shrinks next to a long label and labels stay aligned with or without an icon.
|
|
34
|
+
// No icon → reserve the space when expanded; show the initial when collapsed.
|
|
35
|
+
const leadingBox = {
|
|
36
|
+
width: 24,
|
|
37
|
+
height: 24,
|
|
38
|
+
flexShrink: 0,
|
|
39
|
+
alignItems: 'center',
|
|
40
|
+
justifyContent: 'center'
|
|
41
|
+
};
|
|
42
|
+
const leading = /*#__PURE__*/_jsx(View, {
|
|
43
|
+
style: leadingBox,
|
|
44
|
+
children: iconName ? /*#__PURE__*/_jsx(Icon, {
|
|
45
|
+
name: iconName,
|
|
46
|
+
size: 24,
|
|
47
|
+
color: iconColor
|
|
48
|
+
}) : collapsed ? /*#__PURE__*/_jsx(Text, {
|
|
49
|
+
variant: "bodyLarge",
|
|
50
|
+
weight: "medium",
|
|
51
|
+
color: contentColor,
|
|
52
|
+
children: initial
|
|
53
|
+
}) : null
|
|
54
|
+
});
|
|
55
|
+
return /*#__PURE__*/_jsxs(Pressable, {
|
|
56
|
+
onPress: disabled ? undefined : onPress,
|
|
57
|
+
onHoverIn: () => setHovered(true),
|
|
58
|
+
onHoverOut: () => setHovered(false),
|
|
59
|
+
disabled: disabled,
|
|
60
|
+
accessibilityRole: "tab",
|
|
61
|
+
accessibilityState: {
|
|
62
|
+
selected: active,
|
|
63
|
+
disabled
|
|
64
|
+
},
|
|
65
|
+
accessibilityLabel: item.label,
|
|
66
|
+
style: {
|
|
67
|
+
flexDirection: 'row',
|
|
68
|
+
alignItems: 'center',
|
|
69
|
+
justifyContent: collapsed ? 'center' : 'flex-start',
|
|
70
|
+
gap: 10,
|
|
71
|
+
height: ITEM_HEIGHT,
|
|
72
|
+
paddingHorizontal: PADDING,
|
|
73
|
+
borderRadius: theme.radii.pill,
|
|
74
|
+
borderWidth: active ? 1 : 0,
|
|
75
|
+
borderColor: active ? theme.colors.border.default : 'transparent',
|
|
76
|
+
backgroundColor,
|
|
77
|
+
opacity: disabled ? 0.5 : 1
|
|
78
|
+
},
|
|
79
|
+
children: [leading, !collapsed ? /*#__PURE__*/_jsx(Text, {
|
|
80
|
+
variant: "bodyLarge",
|
|
81
|
+
weight: "medium",
|
|
82
|
+
color: contentColor,
|
|
83
|
+
numberOfLines: 1,
|
|
84
|
+
ellipsizeMode: "tail",
|
|
85
|
+
style: {
|
|
86
|
+
flexShrink: 1,
|
|
87
|
+
minWidth: 0
|
|
88
|
+
},
|
|
89
|
+
children: item.label
|
|
90
|
+
}) : null]
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* Sidebar — the app's main navigation drawer (Figma "Sidebar"). Expands/collapses
|
|
96
|
+
* between a labelled and an icon-only rail (animated width). The logo defaults to
|
|
97
|
+
* the Bacon mark (override via `logo`); an optional `footer` shows supporting text
|
|
98
|
+
* at the bottom. Items are dynamic buttons (icon + label via props); the list
|
|
99
|
+
* scrolls with an elegant auto-hiding indicator when it overflows, leaving the
|
|
100
|
+
* footer pinned. Buttons have hover and active states to mark the current section.
|
|
101
|
+
*/
|
|
102
|
+
export function Sidebar({
|
|
103
|
+
items = [],
|
|
104
|
+
activeKey,
|
|
105
|
+
defaultActiveKey,
|
|
106
|
+
onChange,
|
|
107
|
+
collapsed: collapsedProp,
|
|
108
|
+
defaultCollapsed = false,
|
|
109
|
+
onCollapsedChange,
|
|
110
|
+
showToggle = true,
|
|
111
|
+
logo,
|
|
112
|
+
footer,
|
|
113
|
+
expandedWidth = 284,
|
|
114
|
+
collapsedWidth = 122,
|
|
115
|
+
scrollbarColor,
|
|
116
|
+
style
|
|
117
|
+
}) {
|
|
118
|
+
const theme = useTheme();
|
|
119
|
+
const activeControlled = activeKey !== undefined;
|
|
120
|
+
const [activeInternal, setActiveInternal] = useState(defaultActiveKey);
|
|
121
|
+
const active = activeControlled ? activeKey : activeInternal;
|
|
122
|
+
const collapseControlled = collapsedProp !== undefined;
|
|
123
|
+
const [collapsedInternal, setCollapsedInternal] = useState(defaultCollapsed);
|
|
124
|
+
const collapsed = collapseControlled ? collapsedProp : collapsedInternal;
|
|
125
|
+
const width = useRef(new Animated.Value(collapsed ? collapsedWidth : expandedWidth)).current;
|
|
126
|
+
// `visualCollapsed` drives the layout (labels, alignment, footer). It lags on
|
|
127
|
+
// collapse — labels stay mounted (clipped by overflow) until the width finishes
|
|
128
|
+
// shrinking — and leads on expand, so both directions animate without a jump.
|
|
129
|
+
const [visualCollapsed, setVisualCollapsed] = useState(collapsed);
|
|
130
|
+
useEffect(() => {
|
|
131
|
+
if (!collapsed) setVisualCollapsed(false);
|
|
132
|
+
const anim = Animated.timing(width, {
|
|
133
|
+
toValue: collapsed ? collapsedWidth : expandedWidth,
|
|
134
|
+
duration: 220,
|
|
135
|
+
easing: Easing.out(Easing.ease),
|
|
136
|
+
useNativeDriver: false // width
|
|
137
|
+
});
|
|
138
|
+
anim.start(({
|
|
139
|
+
finished
|
|
140
|
+
}) => {
|
|
141
|
+
if (finished && collapsed) setVisualCollapsed(true);
|
|
142
|
+
});
|
|
143
|
+
return () => anim.stop();
|
|
144
|
+
}, [collapsed, collapsedWidth, expandedWidth, width]);
|
|
145
|
+
|
|
146
|
+
// The toggle arrow spins in place (0° → 180°) instead of moving, so collapsing
|
|
147
|
+
// never nudges it. Driven by intent (`collapsed`), in sync with the width.
|
|
148
|
+
const arrowRot = useRef(new Animated.Value(collapsed ? 1 : 0)).current;
|
|
149
|
+
useEffect(() => {
|
|
150
|
+
const anim = Animated.timing(arrowRot, {
|
|
151
|
+
toValue: collapsed ? 1 : 0,
|
|
152
|
+
duration: 220,
|
|
153
|
+
easing: Easing.out(Easing.ease),
|
|
154
|
+
useNativeDriver: true
|
|
155
|
+
});
|
|
156
|
+
anim.start();
|
|
157
|
+
return () => anim.stop();
|
|
158
|
+
}, [collapsed, arrowRot]);
|
|
159
|
+
const arrowRotate = arrowRot.interpolate({
|
|
160
|
+
inputRange: [0, 1],
|
|
161
|
+
outputRange: ['0deg', '180deg']
|
|
162
|
+
});
|
|
163
|
+
|
|
164
|
+
// Glide the toggle from flush-left (expanded) to centered on the icon axis
|
|
165
|
+
// (collapsed), tracking the width so it never jumps.
|
|
166
|
+
const toggleTranslateX = width.interpolate({
|
|
167
|
+
inputRange: [collapsedWidth, expandedWidth],
|
|
168
|
+
outputRange: [Math.max(0, (collapsedWidth - 2 * PADDING - TOGGLE_SIZE) / 2), 0],
|
|
169
|
+
extrapolate: 'clamp'
|
|
170
|
+
});
|
|
171
|
+
const selectItem = item => {
|
|
172
|
+
if (!activeControlled) setActiveInternal(item.key);
|
|
173
|
+
item.onPress?.();
|
|
174
|
+
onChange?.(item.key);
|
|
175
|
+
};
|
|
176
|
+
const toggleCollapsed = () => {
|
|
177
|
+
const next = !collapsed;
|
|
178
|
+
if (!collapseControlled) setCollapsedInternal(next);
|
|
179
|
+
onCollapsedChange?.(next);
|
|
180
|
+
};
|
|
181
|
+
const logoNode = logo ?? /*#__PURE__*/_jsx(BaconLogo, {
|
|
182
|
+
height: visualCollapsed ? 36 : 40
|
|
183
|
+
});
|
|
184
|
+
const toggle = showToggle ? /*#__PURE__*/_jsx(Animated.View, {
|
|
185
|
+
style: {
|
|
186
|
+
transform: [{
|
|
187
|
+
translateX: toggleTranslateX
|
|
188
|
+
}]
|
|
189
|
+
},
|
|
190
|
+
children: /*#__PURE__*/_jsx(Animated.View, {
|
|
191
|
+
style: {
|
|
192
|
+
transform: [{
|
|
193
|
+
rotate: arrowRotate
|
|
194
|
+
}]
|
|
195
|
+
},
|
|
196
|
+
children: /*#__PURE__*/_jsx(IconButton, {
|
|
197
|
+
icon: "arrow-left",
|
|
198
|
+
accessibilityLabel: collapsed ? 'Expand sidebar' : 'Collapse sidebar',
|
|
199
|
+
variant: "ghost",
|
|
200
|
+
size: "sm",
|
|
201
|
+
onPress: toggleCollapsed
|
|
202
|
+
})
|
|
203
|
+
})
|
|
204
|
+
}) : null;
|
|
205
|
+
return /*#__PURE__*/_jsxs(Animated.View, {
|
|
206
|
+
style: [{
|
|
207
|
+
width,
|
|
208
|
+
height: '100%',
|
|
209
|
+
backgroundColor: theme.colors.background.default,
|
|
210
|
+
paddingTop: 48,
|
|
211
|
+
paddingBottom: PADDING,
|
|
212
|
+
paddingHorizontal: PADDING,
|
|
213
|
+
overflow: 'hidden'
|
|
214
|
+
}, style],
|
|
215
|
+
children: [/*#__PURE__*/_jsx(View, {
|
|
216
|
+
style: {
|
|
217
|
+
minHeight: 56,
|
|
218
|
+
alignItems: visualCollapsed ? 'center' : 'flex-start',
|
|
219
|
+
justifyContent: 'center'
|
|
220
|
+
},
|
|
221
|
+
children: logoNode
|
|
222
|
+
}), /*#__PURE__*/_jsx(ScrollArea, {
|
|
223
|
+
style: {
|
|
224
|
+
flex: 1,
|
|
225
|
+
marginTop: 32
|
|
226
|
+
},
|
|
227
|
+
indicatorColor: scrollbarColor ?? theme.colors.border.strong,
|
|
228
|
+
contentContainerStyle: {
|
|
229
|
+
gap: ITEM_GAP,
|
|
230
|
+
paddingBottom: 8
|
|
231
|
+
},
|
|
232
|
+
children: items.map(item => /*#__PURE__*/_jsx(SidebarButton, {
|
|
233
|
+
item: item,
|
|
234
|
+
active: item.key === active,
|
|
235
|
+
collapsed: visualCollapsed,
|
|
236
|
+
onPress: () => selectItem(item)
|
|
237
|
+
}, item.key))
|
|
238
|
+
}), /*#__PURE__*/_jsxs(View, {
|
|
239
|
+
style: {
|
|
240
|
+
marginTop: 28,
|
|
241
|
+
gap: 16
|
|
242
|
+
},
|
|
243
|
+
children: [footer && !visualCollapsed ? /*#__PURE__*/_jsx(Text, {
|
|
244
|
+
variant: "bodySmall",
|
|
245
|
+
color: "tertiary",
|
|
246
|
+
numberOfLines: 1,
|
|
247
|
+
style: {
|
|
248
|
+
marginLeft: 8
|
|
249
|
+
},
|
|
250
|
+
children: footer
|
|
251
|
+
}) : null, toggle ? /*#__PURE__*/_jsx(View, {
|
|
252
|
+
style: {
|
|
253
|
+
alignItems: 'flex-start'
|
|
254
|
+
},
|
|
255
|
+
children: toggle
|
|
256
|
+
}) : null]
|
|
257
|
+
})]
|
|
258
|
+
});
|
|
259
|
+
}
|
|
260
|
+
//# sourceMappingURL=Sidebar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["useEffect","useRef","useState","Animated","Easing","Pressable","View","useTheme","BaconLogo","Icon","IconButton","Text","ScrollArea","jsx","_jsx","jsxs","_jsxs","ITEM_HEIGHT","ITEM_GAP","PADDING","TOGGLE_SIZE","SidebarButton","item","active","collapsed","onPress","theme","hovered","setHovered","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","style","children","name","size","color","variant","weight","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","Value","current","visualCollapsed","setVisualCollapsed","anim","timing","toValue","duration","easing","out","ease","useNativeDriver","start","finished","stop","arrowRot","arrowRotate","interpolate","inputRange","outputRange","toggleTranslateX","Math","max","extrapolate","selectItem","key","toggleCollapsed","next","logoNode","toggle","transform","translateX","rotate","paddingTop","paddingBottom","overflow","minHeight","flex","marginTop","indicatorColor","strong","contentContainerStyle","map","marginLeft"],"sourceRoot":"..\\..\\..\\..\\src","sources":["components/Sidebar/Sidebar.tsx"],"mappings":";;AAAA,SAASA,SAAS,EAAEC,MAAM,EAAEC,QAAQ,QAAwB,OAAO;AACnE,SACEC,QAAQ,EACRC,MAAM,EACNC,SAAS,EACTC,IAAI,QAGC,cAAc;AACrB,SAASC,QAAQ,QAAQ,sBAAa;AACtC,SAASC,SAAS,QAAQ,uBAAoB;AAC9C,SAASC,IAAI,QAAQ,iBAAc;AAEnC,SAASC,UAAU,QAAQ,6BAA0B;AACrD,SAASC,IAAI,QAAQ,iBAAc;AACnC,SAASC,UAAU,QAAQ,4BAAyB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAmDrD,MAAMC,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,GAAGnB,QAAQ,CAAC,CAAC;EACxB,MAA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F,eAAgB;QAC3BhF,OAAO,EAAEA,CAAA,KAAMsG,UAAU,CAACzG,IAAI;MAAE,GAJ3BA,IAAI,CAAC0G,GAKX,CACF;IAAC,CACQ,CAAC,eAGbhH,KAAA,CAACV,IAAI;MAACiD,KAAK,EAAE;QAAEsF,SAAS,EAAE,EAAE;QAAEvE,GAAG,EAAE;MAAG,CAAE;MAAAd,QAAA,GACrCqC,MAAM,IAAI,CAACY,eAAe,gBACzB3F,IAAA,CAACH,IAAI;QAACiD,OAAO,EAAC,WAAW;QAACD,KAAK,EAAC,UAAU;QAACqB,aAAa,EAAE,CAAE;QAACzB,KAAK,EAAE;UAAE2F,UAAU,EAAE;QAAE,CAAE;QAAA1F,QAAA,EACnFqC;MAAM,CACH,CAAC,GACL,IAAI,EACPuC,MAAM,gBACLtH,IAAA,CAACR,IAAI;QAACiD,KAAK,EAAE;UAAEH,UAAU,EAAE;QAAa,CAAE;QAAAI,QAAA,EAAE4E;MAAM,CAAO,CAAC,GACxD,IAAI;IAAA,CACJ,CAAC;EAAA,CACM,CAAC;AAEpB","ignoreList":[]}
|
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { useState } from 'react';
|
|
4
|
+
import { View } from 'react-native';
|
|
5
|
+
import { Sidebar } from "./Sidebar.js";
|
|
6
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
|
+
const meta = {
|
|
8
|
+
title: 'Components/Sidebar',
|
|
9
|
+
component: Sidebar
|
|
10
|
+
};
|
|
11
|
+
export default meta;
|
|
12
|
+
const ITEMS = [{
|
|
13
|
+
key: 'home',
|
|
14
|
+
label: 'Home',
|
|
15
|
+
icon: 'home'
|
|
16
|
+
}, {
|
|
17
|
+
key: 'tables',
|
|
18
|
+
label: 'Table Map',
|
|
19
|
+
icon: 'table'
|
|
20
|
+
}, {
|
|
21
|
+
key: 'menu',
|
|
22
|
+
label: 'Menu List',
|
|
23
|
+
icon: 'dish'
|
|
24
|
+
}, {
|
|
25
|
+
key: 'orders',
|
|
26
|
+
label: 'Orders',
|
|
27
|
+
icon: 'receipt'
|
|
28
|
+
}, {
|
|
29
|
+
key: 'users',
|
|
30
|
+
label: 'User Mgmt.',
|
|
31
|
+
icon: 'usergroup'
|
|
32
|
+
}, {
|
|
33
|
+
key: 'customers',
|
|
34
|
+
label: 'Customers',
|
|
35
|
+
icon: 'user-star'
|
|
36
|
+
}, {
|
|
37
|
+
key: 'reports',
|
|
38
|
+
label: 'Reports',
|
|
39
|
+
icon: 'analytics'
|
|
40
|
+
}, {
|
|
41
|
+
key: 'settings',
|
|
42
|
+
label: 'Settings',
|
|
43
|
+
icon: 'settings'
|
|
44
|
+
}];
|
|
45
|
+
|
|
46
|
+
// A tall frame so the drawer fills a page-like height.
|
|
47
|
+
function Frame({
|
|
48
|
+
children
|
|
49
|
+
}) {
|
|
50
|
+
return /*#__PURE__*/_jsx(View, {
|
|
51
|
+
style: {
|
|
52
|
+
height: 720,
|
|
53
|
+
flexDirection: 'row'
|
|
54
|
+
},
|
|
55
|
+
children: children
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/** Expanded (Figma default), with footer text. */
|
|
60
|
+
export const Expanded = {
|
|
61
|
+
render: () => {
|
|
62
|
+
const [active, setActive] = useState('home');
|
|
63
|
+
return /*#__PURE__*/_jsx(Frame, {
|
|
64
|
+
children: /*#__PURE__*/_jsx(Sidebar, {
|
|
65
|
+
items: ITEMS,
|
|
66
|
+
activeKey: active,
|
|
67
|
+
onChange: setActive,
|
|
68
|
+
footer: "Bacon POS v2.0.12"
|
|
69
|
+
})
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
/** Collapsed (icon-only rail). */
|
|
75
|
+
export const Collapsed = {
|
|
76
|
+
render: () => {
|
|
77
|
+
const [active, setActive] = useState('home');
|
|
78
|
+
return /*#__PURE__*/_jsx(Frame, {
|
|
79
|
+
children: /*#__PURE__*/_jsx(Sidebar, {
|
|
80
|
+
items: ITEMS,
|
|
81
|
+
activeKey: active,
|
|
82
|
+
onChange: setActive,
|
|
83
|
+
defaultCollapsed: true,
|
|
84
|
+
footer: "Bacon POS v2.0.12"
|
|
85
|
+
})
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
/** Toggle it — press the arrow to expand/collapse. */
|
|
91
|
+
export const Toggleable = {
|
|
92
|
+
render: () => {
|
|
93
|
+
const [active, setActive] = useState('orders');
|
|
94
|
+
return /*#__PURE__*/_jsx(Frame, {
|
|
95
|
+
children: /*#__PURE__*/_jsx(Sidebar, {
|
|
96
|
+
items: ITEMS,
|
|
97
|
+
activeKey: active,
|
|
98
|
+
onChange: setActive,
|
|
99
|
+
footer: "Bacon POS v2.0.12"
|
|
100
|
+
})
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
/** No footer (default) and few items. */
|
|
106
|
+
export const Minimal = {
|
|
107
|
+
render: () => {
|
|
108
|
+
const [active, setActive] = useState('home');
|
|
109
|
+
return /*#__PURE__*/_jsx(Frame, {
|
|
110
|
+
children: /*#__PURE__*/_jsx(Sidebar, {
|
|
111
|
+
items: ITEMS.slice(0, 3),
|
|
112
|
+
activeKey: active,
|
|
113
|
+
onChange: setActive,
|
|
114
|
+
showToggle: false
|
|
115
|
+
})
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
};
|
|
119
|
+
|
|
120
|
+
/** Many items — the list scrolls, the footer stays pinned. */
|
|
121
|
+
export const Scrolling = {
|
|
122
|
+
render: () => {
|
|
123
|
+
const many = Array.from({
|
|
124
|
+
length: 14
|
|
125
|
+
}).map((_, i) => ({
|
|
126
|
+
key: String(i),
|
|
127
|
+
label: `Section ${i + 1}`,
|
|
128
|
+
icon: 'analytics'
|
|
129
|
+
}));
|
|
130
|
+
const [active, setActive] = useState('0');
|
|
131
|
+
return /*#__PURE__*/_jsx(View, {
|
|
132
|
+
style: {
|
|
133
|
+
height: 480,
|
|
134
|
+
flexDirection: 'row'
|
|
135
|
+
},
|
|
136
|
+
children: /*#__PURE__*/_jsx(Sidebar, {
|
|
137
|
+
items: many,
|
|
138
|
+
activeKey: active,
|
|
139
|
+
onChange: setActive,
|
|
140
|
+
footer: "Bacon POS v2.0.12"
|
|
141
|
+
})
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
};
|
|
145
|
+
|
|
146
|
+
/** Long labels truncate with an ellipsis (single line). */
|
|
147
|
+
export const LongLabels = {
|
|
148
|
+
render: () => {
|
|
149
|
+
const [active, setActive] = useState('a');
|
|
150
|
+
const items = [{
|
|
151
|
+
key: 'a',
|
|
152
|
+
label: 'Reservations & waitlist management',
|
|
153
|
+
icon: 'table'
|
|
154
|
+
}, {
|
|
155
|
+
key: 'b',
|
|
156
|
+
label: 'Kitchen display system settings',
|
|
157
|
+
icon: 'settings'
|
|
158
|
+
}, {
|
|
159
|
+
key: 'c',
|
|
160
|
+
label: 'Customer loyalty & rewards program',
|
|
161
|
+
icon: 'user-star'
|
|
162
|
+
}];
|
|
163
|
+
return /*#__PURE__*/_jsx(Frame, {
|
|
164
|
+
children: /*#__PURE__*/_jsx(Sidebar, {
|
|
165
|
+
items: items,
|
|
166
|
+
activeKey: active,
|
|
167
|
+
onChange: setActive,
|
|
168
|
+
footer: "Bacon POS v2.0.12"
|
|
169
|
+
})
|
|
170
|
+
});
|
|
171
|
+
}
|
|
172
|
+
};
|
|
173
|
+
|
|
174
|
+
/**
|
|
175
|
+
* Items without an icon: expanded keeps the icon's blank space (labels stay
|
|
176
|
+
* aligned); collapsed shows the label's initial.
|
|
177
|
+
*/
|
|
178
|
+
export const NoIcon = {
|
|
179
|
+
render: () => {
|
|
180
|
+
const [active, setActive] = useState('home');
|
|
181
|
+
const items = [{
|
|
182
|
+
key: 'home',
|
|
183
|
+
label: 'Home',
|
|
184
|
+
icon: 'home'
|
|
185
|
+
}, {
|
|
186
|
+
key: 'reports',
|
|
187
|
+
label: 'Reports'
|
|
188
|
+
},
|
|
189
|
+
// no icon → blank space / initial "R"
|
|
190
|
+
{
|
|
191
|
+
key: 'billing',
|
|
192
|
+
label: 'Billing'
|
|
193
|
+
},
|
|
194
|
+
// no icon → "B"
|
|
195
|
+
{
|
|
196
|
+
key: 'settings',
|
|
197
|
+
label: 'Settings',
|
|
198
|
+
icon: 'settings'
|
|
199
|
+
}];
|
|
200
|
+
return /*#__PURE__*/_jsx(Frame, {
|
|
201
|
+
children: /*#__PURE__*/_jsx(Sidebar, {
|
|
202
|
+
items: items,
|
|
203
|
+
activeKey: active,
|
|
204
|
+
onChange: setActive,
|
|
205
|
+
footer: "Bacon POS v2.0.12"
|
|
206
|
+
})
|
|
207
|
+
});
|
|
208
|
+
}
|
|
209
|
+
};
|
|
210
|
+
|
|
211
|
+
/** Custom logo color. */
|
|
212
|
+
export const CustomLogo = {
|
|
213
|
+
render: () => {
|
|
214
|
+
const [active, setActive] = useState('home');
|
|
215
|
+
return /*#__PURE__*/_jsx(Frame, {
|
|
216
|
+
children: /*#__PURE__*/_jsx(Sidebar, {
|
|
217
|
+
items: ITEMS,
|
|
218
|
+
activeKey: active,
|
|
219
|
+
onChange: setActive,
|
|
220
|
+
footer: "Acme v1"
|
|
221
|
+
})
|
|
222
|
+
});
|
|
223
|
+
}
|
|
224
|
+
};
|
|
225
|
+
//# sourceMappingURL=Sidebar.stories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["useState","View","Sidebar","jsx","_jsx","meta","title","component","ITEMS","key","label","icon","Frame","children","style","height","flexDirection","Expanded","render","active","setActive","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,SAASA,QAAQ,QAAQ,OA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Q,CAAC,MAAM,CAAC;IAC5C,oBACEI,IAAA,CAACQ,KAAK;MAAAC,QAAA,eACJT,IAAA,CAACF,OAAO;QAACmB,KAAK,EAAEb,KAAM;QAACc,SAAS,EAAEH,MAAO;QAACI,QAAQ,EAAEH,SAAU;QAACI,MAAM,EAAC;MAAS,CAAE;IAAC,CAC7E,CAAC;EAEZ;AACF,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { useState } from 'react';
|
|
4
|
+
import { render, fireEvent, screen } from '@testing-library/react-native';
|
|
5
|
+
import { ThemeProvider } from "../../theme/index.js";
|
|
6
|
+
import { Sidebar } from "./Sidebar.js";
|
|
7
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
|
+
function wrap(ui) {
|
|
9
|
+
return render(/*#__PURE__*/_jsx(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__*/_jsx(Sidebar, {
|
|
29
|
+
items: ITEMS
|
|
30
|
+
}));
|
|
31
|
+
expect(screen.getByText('Home')).toBeTruthy();
|
|
32
|
+
expect(screen.getByText('Orders')).toBeTruthy();
|
|
33
|
+
expect(screen.getByText('Settings')).toBeTruthy();
|
|
34
|
+
});
|
|
35
|
+
it('shows the footer only when provided', () => {
|
|
36
|
+
const {
|
|
37
|
+
rerender
|
|
38
|
+
} = wrap(/*#__PURE__*/_jsx(Sidebar, {
|
|
39
|
+
items: ITEMS
|
|
40
|
+
}));
|
|
41
|
+
expect(screen.queryByText('v1.0')).toBeNull();
|
|
42
|
+
rerender(/*#__PURE__*/_jsx(ThemeProvider, {
|
|
43
|
+
children: /*#__PURE__*/_jsx(Sidebar, {
|
|
44
|
+
items: ITEMS,
|
|
45
|
+
footer: "v1.0"
|
|
46
|
+
})
|
|
47
|
+
}));
|
|
48
|
+
expect(screen.getByText('v1.0')).toBeTruthy();
|
|
49
|
+
});
|
|
50
|
+
it('fires onChange with the pressed item key', () => {
|
|
51
|
+
const onChange = jest.fn();
|
|
52
|
+
wrap(/*#__PURE__*/_jsx(Sidebar, {
|
|
53
|
+
items: ITEMS,
|
|
54
|
+
onChange: onChange
|
|
55
|
+
}));
|
|
56
|
+
fireEvent.press(screen.getByText('Orders'));
|
|
57
|
+
expect(onChange).toHaveBeenCalledWith('orders');
|
|
58
|
+
});
|
|
59
|
+
it('marks the active item as selected', () => {
|
|
60
|
+
wrap(/*#__PURE__*/_jsx(Sidebar, {
|
|
61
|
+
items: ITEMS,
|
|
62
|
+
activeKey: "orders"
|
|
63
|
+
}));
|
|
64
|
+
expect(screen.getByLabelText('Orders').props.accessibilityState).toMatchObject({
|
|
65
|
+
selected: true
|
|
66
|
+
});
|
|
67
|
+
expect(screen.getByLabelText('Home').props.accessibilityState).toMatchObject({
|
|
68
|
+
selected: false
|
|
69
|
+
});
|
|
70
|
+
});
|
|
71
|
+
it('hides labels and footer when collapsed', () => {
|
|
72
|
+
wrap(/*#__PURE__*/_jsx(Sidebar, {
|
|
73
|
+
items: ITEMS,
|
|
74
|
+
defaultCollapsed: true,
|
|
75
|
+
footer: "v1.0"
|
|
76
|
+
}));
|
|
77
|
+
expect(screen.queryByText('Home')).toBeNull();
|
|
78
|
+
expect(screen.queryByText('v1.0')).toBeNull();
|
|
79
|
+
});
|
|
80
|
+
it('truncates a long label to a single line', () => {
|
|
81
|
+
wrap(/*#__PURE__*/_jsx(Sidebar, {
|
|
82
|
+
items: [{
|
|
83
|
+
key: 'a',
|
|
84
|
+
label: 'A very long navigation label',
|
|
85
|
+
icon: 'home'
|
|
86
|
+
}]
|
|
87
|
+
}));
|
|
88
|
+
expect(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__*/_jsx(Sidebar, {
|
|
92
|
+
items: [{
|
|
93
|
+
key: 'r',
|
|
94
|
+
label: 'Reports'
|
|
95
|
+
}],
|
|
96
|
+
defaultCollapsed: true
|
|
97
|
+
}));
|
|
98
|
+
expect(screen.getByText('R')).toBeTruthy();
|
|
99
|
+
});
|
|
100
|
+
it('renders an icon-less item normally when expanded (label shown, no initial)', () => {
|
|
101
|
+
wrap(/*#__PURE__*/_jsx(Sidebar, {
|
|
102
|
+
items: [{
|
|
103
|
+
key: 'r',
|
|
104
|
+
label: 'Reports'
|
|
105
|
+
}]
|
|
106
|
+
}));
|
|
107
|
+
expect(screen.getByText('Reports')).toBeTruthy();
|
|
108
|
+
expect(screen.queryByText('R')).toBeNull();
|
|
109
|
+
});
|
|
110
|
+
it('toggles collapse via the built-in control', () => {
|
|
111
|
+
function Ctrl() {
|
|
112
|
+
const [c, setC] = useState(false);
|
|
113
|
+
return /*#__PURE__*/_jsx(Sidebar, {
|
|
114
|
+
items: ITEMS,
|
|
115
|
+
collapsed: c,
|
|
116
|
+
onCollapsedChange: setC
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
wrap(/*#__PURE__*/_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(screen.getByLabelText('Collapse sidebar')).toBeTruthy();
|
|
123
|
+
fireEvent.press(screen.getByLabelText('Collapse sidebar'));
|
|
124
|
+
expect(screen.getByLabelText('Expand sidebar')).toBeTruthy();
|
|
125
|
+
fireEvent.press(screen.getByLabelText('Expand sidebar'));
|
|
126
|
+
expect(screen.getByLabelText('Collapse sidebar')).toBeTruthy();
|
|
127
|
+
// Labels are still present while expanded.
|
|
128
|
+
expect(screen.getByText('Home')).toBeTruthy();
|
|
129
|
+
});
|
|
130
|
+
});
|
|
131
|
+
//# sourceMappingURL=Sidebar.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["useState","render","fireEvent","screen","ThemeProvider","Sidebar","jsx","_jsx","wrap","ui","children","ITEMS","key","label","icon","describe","it","items","expect","getByText","toBeTruthy","rerender","queryByText","toBeNull","footer","onChange","jest","fn","press","toHaveBeenCalledWith","activeKey","getByLabelText","props","accessibilityState","toMatchObject","selected","defaultCollapsed","numberOfLines","toBe","Ctrl","c","setC","collapsed","onCollapsedChange"],"sourceRoot":"..\\..\\..\\..\\src","sources":["components/Sidebar/Sidebar.test.tsx"],"mappings":";;AAAA,SAASA,QAAQ,QAAQ,OAAO;AAChC,SAASC,MAAM,EAAEC,SAAS,EAAEC,MAAM,QAAQ,+BAA+B;AACzE,SAASC,aAAa,QAAQ,sBAAa;AAC3C,SAASC,OAAO,QAA0B,cAAW;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAEtD,SAASC,IAAIA,CAACC,EAAsB,EAAE;EACpC,OAAOR,MAAM,cAACM,IAAA,CAACH,aAAa;IAAAM,QAAA,EAAED;EAAE,CAAgB,CAAC,CAAC;AACpD;AAEA,MAAME,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;AAE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AC1Db,MAAM,CAACf,MAAM,CAAC4B,cAAc,CAAC,gBAAgB,CAAC,CAAC,CAACX,UAAU,CAAC,CAAC;IAC5DlB,SAAS,CAAC0B,KAAK,CAACzB,MAAM,CAAC4B,cAAc,CAAC,gBAAgB,CAAC,CAAC;IACxDb,MAAM,CAACf,MAAM,CAAC4B,cAAc,CAAC,kBAAkB,CAAC,CAAC,CAACX,UAAU,CAAC,CAAC;IAC9D;IACAF,MAAM,CAACf,MAAM,CAACgB,SAAS,CAAC,MAAM,CAAC,CAAC,CAACC,UAAU,CAAC,CAAC;EAC/C,CAAC,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["Sidebar"],"sourceRoot":"..\\..\\..\\..\\src","sources":["components/Sidebar/index.ts"],"mappings":";;AAAA,SAASA,OAAO,QAAQ,cAAW","ignoreList":[]}
|