@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.
- package/lib/commonjs/components/Alert/Alert.js +137 -0
- package/lib/commonjs/components/Alert/Alert.js.map +1 -0
- package/lib/commonjs/components/Alert/Alert.stories.js +104 -0
- package/lib/commonjs/components/Alert/Alert.stories.js.map +1 -0
- package/lib/commonjs/components/Alert/Alert.test.js +62 -0
- package/lib/commonjs/components/Alert/Alert.test.js.map +1 -0
- package/lib/commonjs/components/Alert/index.js +13 -0
- package/lib/commonjs/components/Alert/index.js.map +1 -0
- 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/StatTile/StatTile.js +94 -0
- package/lib/commonjs/components/StatTile/StatTile.js.map +1 -0
- package/lib/commonjs/components/StatTile/StatTile.stories.js +100 -0
- package/lib/commonjs/components/StatTile/StatTile.stories.js.map +1 -0
- package/lib/commonjs/components/StatTile/StatTile.test.js +49 -0
- package/lib/commonjs/components/StatTile/StatTile.test.js.map +1 -0
- package/lib/commonjs/components/StatTile/index.js +13 -0
- package/lib/commonjs/components/StatTile/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 +83 -28
- package/lib/commonjs/components/index.js.map +1 -1
- package/lib/module/components/Alert/Alert.js +133 -0
- package/lib/module/components/Alert/Alert.js.map +1 -0
- package/lib/module/components/Alert/Alert.stories.js +100 -0
- package/lib/module/components/Alert/Alert.stories.js.map +1 -0
- package/lib/module/components/Alert/Alert.test.js +62 -0
- package/lib/module/components/Alert/Alert.test.js.map +1 -0
- package/lib/module/components/Alert/index.js +4 -0
- package/lib/module/components/Alert/index.js.map +1 -0
- 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/StatTile/StatTile.js +90 -0
- package/lib/module/components/StatTile/StatTile.js.map +1 -0
- package/lib/module/components/StatTile/StatTile.stories.js +96 -0
- package/lib/module/components/StatTile/StatTile.stories.js.map +1 -0
- package/lib/module/components/StatTile/StatTile.test.js +49 -0
- package/lib/module/components/StatTile/StatTile.test.js.map +1 -0
- package/lib/module/components/StatTile/index.js +4 -0
- package/lib/module/components/StatTile/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 +5 -0
- package/lib/module/components/index.js.map +1 -1
- package/lib/typescript/commonjs/components/Alert/Alert.d.ts +41 -0
- package/lib/typescript/commonjs/components/Alert/Alert.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/Alert/index.d.ts +3 -0
- package/lib/typescript/commonjs/components/Alert/index.d.ts.map +1 -0
- 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/StatTile/StatTile.d.ts +31 -0
- package/lib/typescript/commonjs/components/StatTile/StatTile.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/StatTile/index.d.ts +3 -0
- package/lib/typescript/commonjs/components/StatTile/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 +5 -0
- package/lib/typescript/commonjs/components/index.d.ts.map +1 -1
- package/lib/typescript/module/components/Alert/Alert.d.ts +41 -0
- package/lib/typescript/module/components/Alert/Alert.d.ts.map +1 -0
- package/lib/typescript/module/components/Alert/index.d.ts +3 -0
- package/lib/typescript/module/components/Alert/index.d.ts.map +1 -0
- 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/StatTile/StatTile.d.ts +31 -0
- package/lib/typescript/module/components/StatTile/StatTile.d.ts.map +1 -0
- package/lib/typescript/module/components/StatTile/index.d.ts +3 -0
- package/lib/typescript/module/components/StatTile/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 +5 -0
- package/lib/typescript/module/components/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/components/Alert/Alert.tsx +132 -0
- package/src/components/Alert/index.ts +2 -0
- 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/StatTile/StatTile.tsx +98 -0
- package/src/components/StatTile/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 +5 -0
|
@@ -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,OAAO;AAEhC,SAASC,IAAI,QAAQ,cAAc;AACnC,SAASC,OAAO,QAA0B,cAAW;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAEtD,MAAMC,IAAI,GAAG;EACXC,KAAK,EAAE,oBAAoB;EAC3BC,SAAS,EAAEL;AACb,CAAgC;AAEhC,eAAeG,IAAI;AAGnB,MAAMG,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;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AACA;AACA;AACA;AACA,OAAO,MAAMiB,MAAa,GAAG;EAC3BvB,MAAM,EAAEA,CAAA,KAAM;IACZ,MAAM,CAACC,MAAM,EAAEC,SAAS,CAAC,GAAGpB,QAAQ,CAAC,MAAM,CAAC;IAC5C,MAAMqB,KAAoB,GAAG,CAC3B;MAAEZ,GAAG,EAAE,MAAM;MAAEC,KAAK,EAAE,MAAM;MAAEC,IAAI,EAAE;IAAO,CAAC,EAC5C;MAAEF,GAAG,EAAE,SAAS;MAAEC,KAAK,EAAE;IAAU,CAAC;IAAE;IACtC;MAAED,GAAG,EAAE,SAAS;MAAEC,KAAK,EAAE;IAAU,CAAC;IAAE;IACtC;MAAED,GAAG,EAAE,UAAU;MAAEC,KAAK,EAAE,UAAU;MAAEC,IAAI,EAAE;IAAW,CAAC,CACzD;IACD,oBACEP,IAAA,CAACQ,KAAK;MAAAC,QAAA,eACJT,IAAA,CAACF,OAAO;QAACmB,KAAK,EAAEA,KAAM;QAACC,SAAS,EAAEH,MAAO;QAACI,QAAQ,EAAEH,SAAU;QAACI,MAAM,EAAC;MAAmB,CAAE;IAAC,CACvF,CAAC;EAEZ;AACF,CAAC;;AAED;AACA,OAAO,MAAMkB,UAAiB,GAAG;EAC/BxB,MAAM,EAAEA,CAAA,KAAM;IACZ,MAAM,CAACC,MAAM,EAAEC,SAAS,CAAC,GAAGpB,QAAQ,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;AAEDC,QAAQ,CAAC,SAAS,EAAE,MAAM;EACxBC,EAAE,CAAC,uCAAuC,EAAE,MAAM;IAChDR,IAAI,cAACD,IAAA,CAACF,OAAO;MAACY,KAAK,EAAEN;IAAM,CAAE,CAAC,CAAC;IAC/BO,MAAM,CAACf,MAAM,CAACgB,SAAS,CAAC,MAAM,CAAC,CAAC,CAACC,UAAU,CAAC,CAAC;IAC7CF,MAAM,CAACf,MAAM,CAACgB,SAAS,CAAC,QAAQ,CAAC,CAAC,CAACC,UAAU,CAAC,CAAC;IAC/CF,MAAM,CAACf,MAAM,CAACgB,SAAS,CAAC,UAAU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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":[]}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { Pressable, View } from 'react-native';
|
|
4
|
+
import { useTheme } from "../../theme/index.js";
|
|
5
|
+
import { Icon } from "../Icon/Icon.js";
|
|
6
|
+
import { Text } from "../Text/Text.js";
|
|
7
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
8
|
+
/**
|
|
9
|
+
* StatTile — a compact KPI card: a small label over a prominent value (Figma
|
|
10
|
+
* "info card"). Fills its parent by default (so a row/grid of tiles sizes evenly)
|
|
11
|
+
* or takes a fixed `width`. `value` accepts a node for custom color/formatting.
|
|
12
|
+
*/
|
|
13
|
+
export function StatTile({
|
|
14
|
+
label,
|
|
15
|
+
value,
|
|
16
|
+
icon,
|
|
17
|
+
width,
|
|
18
|
+
onPress,
|
|
19
|
+
backgroundColor,
|
|
20
|
+
labelColor,
|
|
21
|
+
valueColor,
|
|
22
|
+
style,
|
|
23
|
+
accessibilityLabel
|
|
24
|
+
}) {
|
|
25
|
+
const theme = useTheme();
|
|
26
|
+
const content = /*#__PURE__*/_jsxs(_Fragment, {
|
|
27
|
+
children: [icon ? /*#__PURE__*/_jsx(View, {
|
|
28
|
+
style: {
|
|
29
|
+
width: 24,
|
|
30
|
+
height: 24,
|
|
31
|
+
flexShrink: 0
|
|
32
|
+
},
|
|
33
|
+
children: /*#__PURE__*/_jsx(Icon, {
|
|
34
|
+
name: icon,
|
|
35
|
+
size: 24,
|
|
36
|
+
color: "secondary"
|
|
37
|
+
})
|
|
38
|
+
}) : null, /*#__PURE__*/_jsxs(View, {
|
|
39
|
+
style: {
|
|
40
|
+
flex: 1,
|
|
41
|
+
minWidth: 0,
|
|
42
|
+
gap: 4
|
|
43
|
+
},
|
|
44
|
+
children: [/*#__PURE__*/_jsx(Text, {
|
|
45
|
+
variant: "bodySmall",
|
|
46
|
+
color: labelColor ?? 'secondary',
|
|
47
|
+
numberOfLines: 1,
|
|
48
|
+
children: label
|
|
49
|
+
}), typeof value === 'string' || typeof value === 'number' ? /*#__PURE__*/_jsx(Text, {
|
|
50
|
+
variant: "bodyLarge",
|
|
51
|
+
weight: "semibold",
|
|
52
|
+
color: valueColor ?? 'primary',
|
|
53
|
+
numberOfLines: 1,
|
|
54
|
+
children: String(value)
|
|
55
|
+
}) : value]
|
|
56
|
+
})]
|
|
57
|
+
});
|
|
58
|
+
const containerStyle = {
|
|
59
|
+
flexDirection: 'row',
|
|
60
|
+
alignItems: 'center',
|
|
61
|
+
gap: 12,
|
|
62
|
+
padding: 12,
|
|
63
|
+
borderRadius: theme.radii.lg,
|
|
64
|
+
backgroundColor: backgroundColor ?? theme.colors.background.subtle,
|
|
65
|
+
...(width != null ? {
|
|
66
|
+
width
|
|
67
|
+
} : {
|
|
68
|
+
alignSelf: 'stretch'
|
|
69
|
+
})
|
|
70
|
+
};
|
|
71
|
+
if (!onPress) {
|
|
72
|
+
return /*#__PURE__*/_jsx(View, {
|
|
73
|
+
accessibilityLabel: accessibilityLabel,
|
|
74
|
+
style: [containerStyle, style],
|
|
75
|
+
children: content
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
return /*#__PURE__*/_jsx(Pressable, {
|
|
79
|
+
onPress: onPress,
|
|
80
|
+
accessibilityRole: "button",
|
|
81
|
+
accessibilityLabel: accessibilityLabel ?? label,
|
|
82
|
+
style: ({
|
|
83
|
+
pressed
|
|
84
|
+
}) => [containerStyle, {
|
|
85
|
+
opacity: pressed ? 0.96 : 1
|
|
86
|
+
}, style],
|
|
87
|
+
children: content
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
//# sourceMappingURL=StatTile.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["Pressable","View","useTheme","Icon","Text","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","StatTile","label","value","icon","width","onPress","backgroundColor","labelColor","valueColor","style","accessibilityLabel","theme","content","children","height","flexShrink","name","size","color","flex","minWidth","gap","variant","numberOfLines","weight","String","containerStyle","flexDirection","alignItems","padding","borderRadius","radii","lg","colors","background","subtle","alignSelf","accessibilityRole","pressed","opacity"],"sourceRoot":"..\\..\\..\\..\\src","sources":["components/StatTile/StatTile.tsx"],"mappings":";;AACA,SAASA,SAAS,EAAEC,IAAI,QAAwC,cAAc;AAC9E,SAASC,QAAQ,QAAQ,sBAAa;AACtC,SAASC,IAAI,QAAQ,iBAAc;AAEnC,SAASC,IAAI,QAAQ,iBAAc;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA,EAAAC,QAAA,IAAAC,SAAA;AAwBpC;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,QAAQA,CAAC;EACvBC,KAAK;EACLC,KAAK;EACLC,IAAI;EACJC,KAAK;EACLC,OAAO;EACPC,eAAe;EACfC,UAAU;EACVC,UAAU;EACVC,KAAK;EACLC;AACa,CAAC,EAAE;EAChB,MAAMC,KAAK,GAAGpB,QAAQ,CAAC,CAAC;EAExB,MAAMqB,OAAO,gBACXf,KAAA,CAAAE,SAAA;IAAAc,QAAA,GACGV,IAAI,gBACHR,IAAA,CAACL,IAAI;MAACmB,KAAK,EAAE;QAAEL,KAAK,EAAE,EAAE;QAAEU,MAAM,EAAE,EAAE;QAAEC,UAAU,EAAE;MAAE,CAAE;MAAAF,QAAA,eACpDlB,IAAA,CAACH,IAAI;QAACwB,IAAI,EAAEb,IAAK;QAACc,IAAI,EAAE,EAAG;QAACC,KAAK,EAAC;MAAW,CAAE;IAAC,CAC5C,CAAC,GACL,IAAI,eACRrB,KAAA,CAACP,IAAI;MAACmB,KAAK,EAAE;QAAEU,IAAI,EA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T,KAAM;IAChDQ,KAAK,EAAEA,CAAC;MAAE6B;IAAQ,CAAC,KAAK,CAACZ,cAAc,EAAE;MAAEa,OAAO,EAAED,OAAO,GAAG,IAAI,GAAG;IAAE,CAAC,EAAE7B,KAAK,CAAE;IAAAI,QAAA,EAEhFD;EAAO,CACC,CAAC;AAEhB","ignoreList":[]}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { View } from 'react-native';
|
|
4
|
+
import { StatTile } from "./StatTile.js";
|
|
5
|
+
import { Text } from "../Text/Text.js";
|
|
6
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
7
|
+
const meta = {
|
|
8
|
+
title: 'Components/StatTile',
|
|
9
|
+
component: StatTile
|
|
10
|
+
};
|
|
11
|
+
export default meta;
|
|
12
|
+
/** Figma "info card". */
|
|
13
|
+
export const Default = {
|
|
14
|
+
render: () => /*#__PURE__*/_jsx(View, {
|
|
15
|
+
style: {
|
|
16
|
+
padding: 24,
|
|
17
|
+
width: 420
|
|
18
|
+
},
|
|
19
|
+
children: /*#__PURE__*/_jsx(StatTile, {
|
|
20
|
+
label: "Starting cash",
|
|
21
|
+
value: "$1,250.25"
|
|
22
|
+
})
|
|
23
|
+
})
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
/** A row of tiles sizing evenly (each fills its flex cell). */
|
|
27
|
+
export const Row = {
|
|
28
|
+
render: () => /*#__PURE__*/_jsxs(View, {
|
|
29
|
+
style: {
|
|
30
|
+
padding: 24,
|
|
31
|
+
flexDirection: 'row',
|
|
32
|
+
gap: 12,
|
|
33
|
+
width: 720
|
|
34
|
+
},
|
|
35
|
+
children: [/*#__PURE__*/_jsx(View, {
|
|
36
|
+
style: {
|
|
37
|
+
flex: 1
|
|
38
|
+
},
|
|
39
|
+
children: /*#__PURE__*/_jsx(StatTile, {
|
|
40
|
+
label: "Sales",
|
|
41
|
+
value: "$4,820"
|
|
42
|
+
})
|
|
43
|
+
}), /*#__PURE__*/_jsx(View, {
|
|
44
|
+
style: {
|
|
45
|
+
flex: 1
|
|
46
|
+
},
|
|
47
|
+
children: /*#__PURE__*/_jsx(StatTile, {
|
|
48
|
+
label: "Orders",
|
|
49
|
+
value: "128"
|
|
50
|
+
})
|
|
51
|
+
}), /*#__PURE__*/_jsx(View, {
|
|
52
|
+
style: {
|
|
53
|
+
flex: 1
|
|
54
|
+
},
|
|
55
|
+
children: /*#__PURE__*/_jsx(StatTile, {
|
|
56
|
+
label: "Avg. ticket",
|
|
57
|
+
value: "$37.60"
|
|
58
|
+
})
|
|
59
|
+
})]
|
|
60
|
+
})
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
/** With a leading icon. */
|
|
64
|
+
export const WithIcon = {
|
|
65
|
+
render: () => /*#__PURE__*/_jsx(View, {
|
|
66
|
+
style: {
|
|
67
|
+
padding: 24,
|
|
68
|
+
width: 420
|
|
69
|
+
},
|
|
70
|
+
children: /*#__PURE__*/_jsx(StatTile, {
|
|
71
|
+
label: "Starting cash",
|
|
72
|
+
value: "$1,250.25",
|
|
73
|
+
icon: "dollar-circle"
|
|
74
|
+
})
|
|
75
|
+
})
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
/** Custom value node (e.g. a colored delta). */
|
|
79
|
+
export const CustomValue = {
|
|
80
|
+
render: () => /*#__PURE__*/_jsx(View, {
|
|
81
|
+
style: {
|
|
82
|
+
padding: 24,
|
|
83
|
+
width: 420
|
|
84
|
+
},
|
|
85
|
+
children: /*#__PURE__*/_jsx(StatTile, {
|
|
86
|
+
label: "Net change",
|
|
87
|
+
value: /*#__PURE__*/_jsx(Text, {
|
|
88
|
+
variant: "bodyLarge",
|
|
89
|
+
weight: "semibold",
|
|
90
|
+
color: "#008C57",
|
|
91
|
+
children: "+$320.10"
|
|
92
|
+
})
|
|
93
|
+
})
|
|
94
|
+
})
|
|
95
|
+
};
|
|
96
|
+
//# sourceMappingURL=StatTile.stories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["View","StatTile","Text","jsx","_jsx","jsxs","_jsxs","meta","title","component","Default","render","style","padding","width","children","label","value","Row","flexDirection","gap","flex","WithIcon","icon","CustomValue","variant","weight","color"],"sourceRoot":"..\\..\\..\\..\\src","sources":["components/StatTile/StatTile.stories.tsx"],"mappings":";;AACA,SAASA,IAAI,QAAQ,cAAc;AACnC,SAASC,QAAQ,QAAQ,eAAY;AACrC,SAASC,IAAI,QAAQ,iBAAc;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAEpC,MAAMC,IAAI,GAAG;EACXC,KAAK,EAAE,qBAAqB;EAC5BC,SAAS,EAAER;AACb,CAAiC;AAEjC,eAAeM,IAAI;AAGnB;AACA,OAAO,MAAMG,OAAc,GAAG;EAC5BC,MAAM,EAAEA,CAAA,kBACNP,IAAA,CAACJ,IAAI;IAACY,KAAK,EAAE;MAAEC,OAAO,EAAE,EAAE;MAAEC,KAAK,EAAE;IAAI,CAAE;IAAAC,QAAA,eACvCX,IAAA,CAACH,QAAQ;MAACe,KAAK,EAAC,eAAe;MAACC,KAAK,EAAC;IAAW,CAAE;EAAC,CAChD;AAEV,CAAC;;AAED;AACA,OAAO,MAAMC,GAAU,GAAG;EACxBP,MAAM,EAAEA,CAAA,kBACNL,KAAA,CAACN,IAAI;IAACY,KAAK,EAAE;MAAEC,OAAO,EAAE,EAAE;MAAEM,aAAa,EAAE,KAAK;MAAEC,GAAG,EAAE,EAAE;MAAEN,KAAK,EAAE;IAAI,CAAE;IAAAC,QAAA,gBACtEX,IAAA,CAACJ,IAAI;MAACY,KAAK,EAAE;QAAES,IAAI,EAAE;MAAE,CAAE;MAAAN,QAAA,eAACX,IAAA,CAACH,QAAQ;QAACe,KAAK,EAAC,OAAO;QAACC,KAAK,EAAC;MAAQ,CAAE;IAAC,CAAM,CAAC,eAC1Eb,IAAA,CAACJ,IAAI;MAACY,KAAK,EAAE;QAAES,IAAI,EAAE;MAAE,CAAE;MAAAN,QAAA,eAACX,IAAA,CAACH,QAAQ;QAACe,KAAK,EAAC,QAAQ;QAACC,KAAK,EAAC;MAAK,CAAE;IAAC,CAAM,CAAC,eACxEb,IAAA,CAACJ,IAAI;MAACY,KAAK,EAAE;QAAES,IAAI,EAAE;MAAE,CAAE;MAAAN,QAAA,eAACX,IAAA,CAACH,QAAQ;QAACe,KAAK,EAAC,aAAa;QAACC,KAAK,EAAC;MAAQ,CAAE;IAAC,CAAM,CAAC;EAAA,CAC5E;AAEV,CAAC;;AAED;AACA,OAAO,MAAMK,QAAe,GAAG;EAC7BX,MAAM,EAAEA,CAAA,kBACNP,IAAA,CAACJ,IAAI;IAACY,KAAK,EAAE;MAAEC,OAAO,EAAE,EAAE;MAAEC,KAAK,EAAE;IAAI,CAAE;IAAAC,QAAA,eACvCX,IAAA,CAACH,QAAQ;MAACe,KAAK,EAAC,eAAe;MAACC,KAAK,EAAC,WAAW;MAACM,IAAI,EAAC;IAAe,CAAE;EAAC,CACrE;AAEV,CAAC;;AAED;AACA,OAAO,MAAMC,WAAkB,GAAG;EAChCb,MAAM,EAAEA,CAAA,kBACNP,IAAA,CAACJ,IAAI;IAACY,KAAK,EAAE;MAAEC,OAAO,EAAE,EAAE;MAAEC,KAAK,EAAE;IAAI,CAAE;IAAAC,QAAA,eACvCX,IAAA,CAACH,QAAQ;MACPe,KAAK,EAAC,YAAY;MAClBC,KAAK,eACHb,IAAA,CAACF,IAAI;QAACuB,OAAO,EAAC,WAAW;QAACC,MAAM,EAAC,UAAU;QAACC,KAAK,EAAC,SAAS;QAAAZ,QAAA,EAAC;MAE5D,CAAM;IACP,CACF;EAAC,CACE;AAEV,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { render, fireEvent, screen } from '@testing-library/react-native';
|
|
4
|
+
import { Text } from 'react-native';
|
|
5
|
+
import { ThemeProvider } from "../../theme/index.js";
|
|
6
|
+
import { StatTile } from "./StatTile.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
|
+
describe('StatTile', () => {
|
|
14
|
+
it('renders label and value', () => {
|
|
15
|
+
wrap(/*#__PURE__*/_jsx(StatTile, {
|
|
16
|
+
label: "Starting cash",
|
|
17
|
+
value: "$1,250.25"
|
|
18
|
+
}));
|
|
19
|
+
expect(screen.getByText('Starting cash')).toBeTruthy();
|
|
20
|
+
expect(screen.getByText('$1,250.25')).toBeTruthy();
|
|
21
|
+
});
|
|
22
|
+
it('renders a numeric value', () => {
|
|
23
|
+
wrap(/*#__PURE__*/_jsx(StatTile, {
|
|
24
|
+
label: "Orders",
|
|
25
|
+
value: 128
|
|
26
|
+
}));
|
|
27
|
+
expect(screen.getByText('128')).toBeTruthy();
|
|
28
|
+
});
|
|
29
|
+
it('renders a custom value node', () => {
|
|
30
|
+
wrap(/*#__PURE__*/_jsx(StatTile, {
|
|
31
|
+
label: "Delta",
|
|
32
|
+
value: /*#__PURE__*/_jsx(Text, {
|
|
33
|
+
children: "+3.2%"
|
|
34
|
+
})
|
|
35
|
+
}));
|
|
36
|
+
expect(screen.getByText('+3.2%')).toBeTruthy();
|
|
37
|
+
});
|
|
38
|
+
it('fires onPress', () => {
|
|
39
|
+
const onPress = jest.fn();
|
|
40
|
+
wrap(/*#__PURE__*/_jsx(StatTile, {
|
|
41
|
+
label: "Sales",
|
|
42
|
+
value: "$10",
|
|
43
|
+
onPress: onPress
|
|
44
|
+
}));
|
|
45
|
+
fireEvent.press(screen.getByText('Sales'));
|
|
46
|
+
expect(onPress).toHaveBeenCalledTimes(1);
|
|
47
|
+
});
|
|
48
|
+
});
|
|
49
|
+
//# sourceMappingURL=StatTile.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["render","fireEvent","screen","Text","ThemeProvider","StatTile","jsx","_jsx","wrap","ui","children","describe","it","label","value","expect","getByText","toBeTruthy","onPress","jest","fn","press","toHaveBeenCalledTimes"],"sourceRoot":"..\\..\\..\\..\\src","sources":["components/StatTile/StatTile.test.tsx"],"mappings":";;AAAA,SAASA,MAAM,EAAEC,SAAS,EAAEC,MAAM,QAAQ,+BAA+B;AACzE,SAASC,IAAI,QAAQ,cAAc;AACnC,SAASC,aAAa,QAAQ,sBAAa;AAC3C,SAASC,QAAQ,QAAQ,eAAY;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAEtC,SAASC,IAAIA,CAACC,EAAsB,EAAE;EACpC,OAAOT,MAAM,cAACO,IAAA,CAACH,aAAa;IAAAM,QAAA,EAAED;EAAE,CAAgB,CAAC,CAAC;AACpD;AAEAE,QAAQ,CAAC,UAAU,EAAE,MAAM;EACzBC,EAAE,CAAC,yBAAyB,EAAE,MAAM;IAClCJ,IAAI,cAACD,IAAA,CAACF,QAAQ;MAACQ,KAAK,EAAC,eAAe;MAACC,KAAK,EAAC;IAAW,CAAE,CAAC,CAAC;IAC1DC,MAAM,CAACb,MAAM,CAACc,SAAS,CAAC,eAAe,CAAC,CAAC,CAACC,UAAU,CAAC,CAAC;IACtDF,MAAM,CAACb,MAAM,CAACc,SAAS,CAAC,WAAW,CAAC,CAAC,CAACC,UAAU,CAAC,CAAC;EACpD,CAAC,CAAC;EAEFL,EAAE,CAAC,yBAAyB,EAAE,MAAM;IAClCJ,IAAI,cAACD,IAAA,CAACF,QAAQ;MAACQ,KAAK,EAAC,QAAQ;MAACC,KAAK,EAAE;IAAI,CAAE,CAAC,CAAC;IAC7CC,MAAM,CAACb,MAAM,CAACc,SAAS,CAAC,KAAK,CAAC,CAAC,CAACC,UAAU,CAAC,CAAC;EAC9C,CAAC,CAAC;EAEFL,EAAE,CAAC,6BAA6B,EAAE,MAAM;IACtCJ,IAAI,cAACD,IAAA,CAACF,Q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