@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,137 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.Alert = Alert;
7
+ var _reactNative = require("react-native");
8
+ var _index = require("../../theme/index.js");
9
+ var _palette = require("../../theme/palette.js");
10
+ var _Icon = require("../Icon/Icon.js");
11
+ var _Text = require("../Text/Text.js");
12
+ var _jsxRuntime = require("react/jsx-runtime");
13
+ function statusColors(theme, status) {
14
+ switch (status) {
15
+ case 'warning':
16
+ return {
17
+ bg: theme.colors.feedback.warningSubtle,
18
+ fg: _palette.palette.warning[600]
19
+ };
20
+ case 'success':
21
+ return {
22
+ bg: theme.colors.feedback.successSubtle,
23
+ fg: theme.colors.feedback.success
24
+ };
25
+ case 'destructive':
26
+ return {
27
+ bg: theme.colors.feedback.errorSubtle,
28
+ fg: theme.colors.feedback.error
29
+ };
30
+ case 'info':
31
+ default:
32
+ return {
33
+ bg: theme.colors.background.subtle,
34
+ fg: _palette.palette.neutral[500]
35
+ };
36
+ }
37
+ }
38
+
39
+ /**
40
+ * Alert — an inline banner in four statuses (info / warning / success /
41
+ * destructive), each a subtle tinted surface with a matching icon and text
42
+ * (Figma "Alert"). Fills its parent by default (text wraps to any width) or takes
43
+ * a fixed `width`. Supports an optional title, a trailing action and a close
44
+ * button; colors are overridable for custom statuses.
45
+ */
46
+ function Alert({
47
+ status = 'info',
48
+ title,
49
+ message,
50
+ children,
51
+ icon = 'info',
52
+ showIcon = true,
53
+ iconAlign = 'center',
54
+ action,
55
+ onClose,
56
+ backgroundColor,
57
+ color,
58
+ width,
59
+ style
60
+ }) {
61
+ const theme = (0, _index.useTheme)();
62
+ const {
63
+ bg,
64
+ fg
65
+ } = statusColors(theme, status);
66
+ const foreground = color ?? fg;
67
+ const background = backgroundColor ?? bg;
68
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
69
+ accessibilityRole: "alert",
70
+ style: [{
71
+ flexDirection: 'row',
72
+ alignItems: 'flex-start',
73
+ gap: 16,
74
+ paddingVertical: 20,
75
+ paddingHorizontal: 16,
76
+ borderRadius: theme.radii.lg,
77
+ backgroundColor: background,
78
+ ...(width != null ? {
79
+ width
80
+ } : {
81
+ alignSelf: 'stretch'
82
+ })
83
+ }, style],
84
+ children: [showIcon ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
85
+ style: {
86
+ width: 24,
87
+ height: 24,
88
+ flexShrink: 0,
89
+ alignSelf: iconAlign === 'center' ? 'center' : 'flex-start'
90
+ },
91
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Icon.Icon, {
92
+ name: icon,
93
+ size: 24,
94
+ color: foreground
95
+ })
96
+ }) : null, /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
97
+ style: {
98
+ flex: 1,
99
+ minWidth: 0,
100
+ gap: 2
101
+ },
102
+ children: [title ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_Text.Text, {
103
+ variant: "bodyLarge",
104
+ weight: "semibold",
105
+ color: foreground,
106
+ children: title
107
+ }) : null, children ?? (message ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_Text.Text, {
108
+ variant: "bodyLarge",
109
+ color: foreground,
110
+ children: message
111
+ }) : null)]
112
+ }), action ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
113
+ style: {
114
+ flexShrink: 0
115
+ },
116
+ children: action
117
+ }) : null, onClose ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Pressable, {
118
+ onPress: onClose,
119
+ hitSlop: 8,
120
+ accessibilityRole: "button",
121
+ accessibilityLabel: "Dismiss",
122
+ style: {
123
+ width: 24,
124
+ height: 24,
125
+ flexShrink: 0,
126
+ alignItems: 'center',
127
+ justifyContent: 'center'
128
+ },
129
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Icon.Icon, {
130
+ name: "close",
131
+ size: 20,
132
+ color: foreground
133
+ })
134
+ }) : null]
135
+ });
136
+ }
137
+ //# sourceMappingURL=Alert.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_reactNative","require","_index","_palette","_Icon","_Text","_jsxRuntime","statusColors","theme","status","bg","colors","feedback","warningSubtle","fg","palette","warning","successSubtle","success","errorSubtle","error","background","subtle","neutral","Alert","title","message","children","icon","showIcon","iconAlign","action","onClose","backgroundColor","color","width","style","useTheme","foreground","jsxs","View","accessibilityRole","flexDirection","alignItems","gap","paddingVertical","paddingHorizontal","borderRadius","radii","lg","alignSelf","jsx","height","flexShrink","Icon","name","size","flex","minWidth","Text","variant","weight","Pressable","onPress","hitSlop","accessibilityLabel","justifyContent"],"sourceRoot":"..\\..\\..\\..\\src","sources":["components/Alert/Alert.tsx"],"mappings":";;;;;;AACA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,MAAA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.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = exports.WithTitle = exports.WithActionAndClose = exports.Statuses = exports.NoIcon = exports.Narrow = void 0;
7
+ var _reactNative = require("react-native");
8
+ var _Alert = require("./Alert.js");
9
+ var _LinkButton = require("../LinkButton/LinkButton.js");
10
+ var _jsxRuntime = require("react/jsx-runtime");
11
+ const meta = {
12
+ title: 'Components/Alert',
13
+ component: _Alert.Alert
14
+ };
15
+ var _default = exports.default = meta;
16
+ const MSG = 'No activity for 8h 10m — this shift was likely left open. Ending it resolves the 2 open checks, then counts the drawer.';
17
+
18
+ /** The four Figma statuses. */
19
+ const Statuses = exports.Statuses = {
20
+ render: () => /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
21
+ style: {
22
+ padding: 24,
23
+ width: 820,
24
+ gap: 16
25
+ },
26
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Alert.Alert, {
27
+ status: "info",
28
+ message: MSG
29
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Alert.Alert, {
30
+ status: "warning",
31
+ message: MSG
32
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Alert.Alert, {
33
+ status: "success",
34
+ message: MSG
35
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Alert.Alert, {
36
+ status: "destructive",
37
+ message: MSG
38
+ })]
39
+ })
40
+ };
41
+
42
+ /** With a title. */
43
+ const WithTitle = exports.WithTitle = {
44
+ render: () => /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
45
+ style: {
46
+ padding: 24,
47
+ width: 820
48
+ },
49
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Alert.Alert, {
50
+ status: "warning",
51
+ title: "Shift left open",
52
+ message: MSG
53
+ })
54
+ })
55
+ };
56
+
57
+ /** Short message, narrow container — width accommodates. */
58
+ const Narrow = exports.Narrow = {
59
+ render: () => /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
60
+ style: {
61
+ padding: 24,
62
+ width: 320
63
+ },
64
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Alert.Alert, {
65
+ status: "success",
66
+ message: "Drawer counted successfully."
67
+ })
68
+ })
69
+ };
70
+
71
+ /** With a trailing action and a close button. */
72
+ const WithActionAndClose = exports.WithActionAndClose = {
73
+ render: () => /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
74
+ style: {
75
+ padding: 24,
76
+ width: 820
77
+ },
78
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Alert.Alert, {
79
+ status: "destructive",
80
+ message: "Payment failed for order #02304.",
81
+ action: /*#__PURE__*/(0, _jsxRuntime.jsx)(_LinkButton.LinkButton, {
82
+ label: "Retry",
83
+ onPress: () => {}
84
+ }),
85
+ onClose: () => {}
86
+ })
87
+ })
88
+ };
89
+
90
+ /** Icon hidden. */
91
+ const NoIcon = exports.NoIcon = {
92
+ render: () => /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
93
+ style: {
94
+ padding: 24,
95
+ width: 820
96
+ },
97
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Alert.Alert, {
98
+ status: "info",
99
+ message: MSG,
100
+ showIcon: false
101
+ })
102
+ })
103
+ };
104
+ //# sourceMappingURL=Alert.stories.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_reactNative","require","_Alert","_LinkButton","_jsxRuntime","meta","title","component","Alert","_default","exports","default","MSG","Statuses","render","jsxs","View","style","padding","width","gap","children","jsx","status","message","WithTitle","Narrow","WithActionAndClose","action","LinkButton","label","onPress","onClose","NoIcon","showIcon"],"sourceRoot":"..\\..\\..\\..\\src","sources":["components/Alert/Alert.stories.tsx"],"mappings":";;;;;;AACA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AAAsD,IAAAG,WAAA,GAAAH,OAAA;AAEtD,MAAMI,IAAI,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AAE;MAAEC,OAAO,EAAE,EAAE;MAAEC,KAAK,EAAE;IAAI,CAAE;IAAAE,QAAA,eACvC,IAAAjB,WAAA,CAAAkB,GAAA,EAACpB,MAAA,CAAAM,KAAK;MAACe,MAAM,EAAC,MAAM;MAACC,OAAO,EAAEZ,GAAI;MAACsB,QAAQ,EAAE;IAAM,CAAE;EAAC,CAClD;AAEV,CAAC","ignoreList":[]}
@@ -0,0 +1,62 @@
1
+ "use strict";
2
+
3
+ var _reactNative = require("@testing-library/react-native");
4
+ var _reactNative2 = require("react-native");
5
+ var _index = require("../../theme/index.js");
6
+ var _Alert = require("./Alert.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
+ describe('Alert', () => {
14
+ it('renders the message', () => {
15
+ wrap(/*#__PURE__*/(0, _jsxRuntime.jsx)(_Alert.Alert, {
16
+ message: "Something happened"
17
+ }));
18
+ expect(_reactNative.screen.getByText('Something happened')).toBeTruthy();
19
+ });
20
+ it('renders a title and children', () => {
21
+ wrap(/*#__PURE__*/(0, _jsxRuntime.jsx)(_Alert.Alert, {
22
+ status: "warning",
23
+ title: "Heads up",
24
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative2.Text, {
25
+ children: "Custom body"
26
+ })
27
+ }));
28
+ expect(_reactNative.screen.getByText('Heads up')).toBeTruthy();
29
+ expect(_reactNative.screen.getByText('Custom body')).toBeTruthy();
30
+ });
31
+ it('renders each status without crashing', () => {
32
+ for (const status of ['info', 'warning', 'success', 'destructive']) {
33
+ const {
34
+ unmount
35
+ } = wrap(/*#__PURE__*/(0, _jsxRuntime.jsx)(_Alert.Alert, {
36
+ status: status,
37
+ message: `msg-${status}`
38
+ }));
39
+ expect(_reactNative.screen.getByText(`msg-${status}`)).toBeTruthy();
40
+ unmount();
41
+ }
42
+ });
43
+ it('fires onClose', () => {
44
+ const onClose = jest.fn();
45
+ wrap(/*#__PURE__*/(0, _jsxRuntime.jsx)(_Alert.Alert, {
46
+ message: "x",
47
+ onClose: onClose
48
+ }));
49
+ _reactNative.fireEvent.press(_reactNative.screen.getByLabelText('Dismiss'));
50
+ expect(onClose).toHaveBeenCalledTimes(1);
51
+ });
52
+ it('renders a trailing action', () => {
53
+ wrap(/*#__PURE__*/(0, _jsxRuntime.jsx)(_Alert.Alert, {
54
+ message: "x",
55
+ action: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative2.Text, {
56
+ children: "Retry"
57
+ })
58
+ }));
59
+ expect(_reactNative.screen.getByText('Retry')).toBeTruthy();
60
+ });
61
+ });
62
+ //# sourceMappingURL=Alert.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_reactNative","require","_reactNative2","_index","_Alert","_jsxRuntime","wrap","ui","render","jsx","ThemeProvider","children","describe","it","Alert","message","expect","screen","getByText","toBeTruthy","status","title","Text","unmount","onClose","jest","fn","fireEvent","press","getByLabelText","toHaveBeenCalledTimes","action"],"sourceRoot":"..\\..\\..\\..\\src","sources":["components/Alert/Alert.test.tsx"],"mappings":";;AAAA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,aAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AAAgC,IAAAI,WAAA,GAAAJ,OAAA;AAEhC,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;AAEAK,QAAQ,CAAC,OAAO,EAAE,MAAM;EACtBC,EAAE,CAAC,qBAAqB,EAAE,MAAM;IAC9BP,IAAI,cAAC,IAAAD,WAAA,CAAAI,GAAA,EAACL,MAAA,CAAAU,KAAK;MAACC,OA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,MAAA,CAAAU,KAAK;MAACC,OAAO,EAAC,GAAG;MAACS,OAAO,EAAEA;IAAQ,CAAE,CAAC,CAAC;IAC7CG,sBAAS,CAACC,KAAK,CAACX,mBAAM,CAACY,cAAc,CAAC,SAAS,CAAC,CAAC;IACjDb,MAAM,CAACQ,OAAO,CAAC,CAACM,qBAAqB,CAAC,CAAC,CAAC;EAC1C,CAAC,CAAC;EAEFjB,EAAE,CAAC,2BAA2B,EAAE,MAAM;IACpCP,IAAI,cAAC,IAAAD,WAAA,CAAAI,GAAA,EAACL,MAAA,CAAAU,KAAK;MAACC,OAAO,EAAC,GAAG;MAACgB,MAAM,eAAE,IAAA1B,WAAA,CAAAI,GAAA,EAACP,aAAA,CAAAoB,IAAI;QAAAX,QAAA,EAAC;MAAK,CAAM;IAAE,CAAE,CAAC,CAAC;IACvDK,MAAM,CAACC,mBAAM,CAACC,SAAS,CAAC,OAAO,CAAC,CAAC,CAACC,UAAU,CAAC,CAAC;EAChD,CAAC,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ Object.defineProperty(exports, "Alert", {
7
+ enumerable: true,
8
+ get: function () {
9
+ return _Alert.Alert;
10
+ }
11
+ });
12
+ var _Alert = require("./Alert.js");
13
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_Alert","require"],"sourceRoot":"..\\..\\..\\..\\src","sources":["components/Alert/index.ts"],"mappings":";;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA","ignoreList":[]}
@@ -0,0 +1,88 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.EmptyState = EmptyState;
7
+ var _reactNative = require("react-native");
8
+ var _index = require("../../theme/index.js");
9
+ var _Button = require("../Button/Button.js");
10
+ var _Icon = require("../Icon/Icon.js");
11
+ var _Text = require("../Text/Text.js");
12
+ var _jsxRuntime = require("react/jsx-runtime");
13
+ /**
14
+ * Empty state — a centered icon, title, description and optional action button.
15
+ * Used by `Table`/`DataTable` when there's no data, and reusable anywhere a
16
+ * "nothing here yet" message is needed.
17
+ */
18
+ function EmptyState({
19
+ icon = 'no-photo',
20
+ title,
21
+ description,
22
+ action,
23
+ paddingVertical = 32,
24
+ style
25
+ }) {
26
+ const theme = (0, _index.useTheme)();
27
+ const variant = action?.variant ?? 'inverse';
28
+ const actionIconColor = variant === 'default' ? theme.colors.action.primaryForeground : variant === 'secondary' ? theme.colors.action.secondaryForeground : theme.colors.action.inverseForeground;
29
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
30
+ style: [{
31
+ alignItems: 'center',
32
+ gap: 12,
33
+ paddingVertical,
34
+ paddingHorizontal: 24
35
+ }, style],
36
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
37
+ style: {
38
+ width: 48,
39
+ height: 48,
40
+ borderRadius: 24,
41
+ alignItems: 'center',
42
+ justifyContent: 'center',
43
+ backgroundColor: theme.colors.background.subtle
44
+ },
45
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Icon.Icon, {
46
+ name: icon,
47
+ size: 24,
48
+ color: "tertiary"
49
+ })
50
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
51
+ style: {
52
+ alignItems: 'center',
53
+ gap: 4
54
+ },
55
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Text.Text, {
56
+ variant: "bodyLarge",
57
+ weight: "medium",
58
+ color: "primary",
59
+ align: "center",
60
+ children: title
61
+ }), description ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_Text.Text, {
62
+ variant: "bodyMedium",
63
+ color: "tertiary",
64
+ align: "center",
65
+ style: {
66
+ maxWidth: 420
67
+ },
68
+ children: description
69
+ }) : null]
70
+ }), action ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
71
+ style: {
72
+ marginTop: 4
73
+ },
74
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Button.Button, {
75
+ label: action.label,
76
+ variant: action.variant ?? 'inverse',
77
+ size: "sm",
78
+ onPress: action.onPress,
79
+ leftIcon: action.icon ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_Icon.Icon, {
80
+ name: action.icon,
81
+ size: 20,
82
+ color: actionIconColor
83
+ }) : undefined
84
+ })
85
+ }) : null]
86
+ });
87
+ }
88
+ //# sourceMappingURL=EmptyState.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_reactNative","require","_index","_Button","_Icon","_Text","_jsxRuntime","EmptyState","icon","title","description","action","paddingVertical","style","theme","useTheme","variant","actionIconColor","colors","primaryForeground","secondaryForeground","inverseForeground","jsxs","View","alignItems","gap","paddingHorizontal","children","jsx","width","height","borderRadius","justifyContent","backgroundColor","background","subtle","Icon","name","size","color","Text","weight","align","maxWidth","marginTop","Button","label","onPress","leftIcon","undefined"],"sourceRoot":"..\\..\\..\\..\\src","sources":["components/EmptyState/EmptyState.tsx"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AAEA,IAAAI,KAAA,GAAAJ,OAAA;AAAoC,IAAAK,WAAA,GAAAL,OAAA;AAwBpC;AACA;AACA;AACA;AACA;AACO,SAASM,UAAUA,CAAC;EACzBC,IAAI,GAAG,UAAU;EACjBC,KAAK;EACLC,WAAW;EACXC,MAAM;EACNC,eAAe,GAAG,EAAE;EACpBC;AACe,CAAC,EAAE;EAClB,MAAMC,KAAK,GAAG,IAAAC,eAAQ,EAAC,CAAC;EACxB,MAAMC,OAAO,GAAGL,MAAM,EAAEK,OAAO,IAAI,SAAS;EAC5C,MAAMC,eAAe,GACnBD,OAAO,KAAK,SAAS,GACjBF,KAAK,CAACI,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CAAAsB,GAAA,EAACvB,KAAA,CAAAmC,IAAI;QAACxB,OAAO,EAAC,YAAY;QAACuB,KAAK,EAAC,UAAU;QAACG,KAAK,EAAC,QAAQ;QAAC7B,KAAK,EAAE;UAAE8B,QAAQ,EAAE;QAAI,CAAE;QAAAhB,QAAA,EACjFjB;MAAW,CACR,CAAC,GACL,IAAI;IAAA,CACJ,CAAC,EAENC,MAAM,gBACL,IAAAL,WAAA,CAAAsB,GAAA,EAAC5B,YAAA,CAAAuB,IAAI;MAACV,KAAK,EAAE;QAAE+B,SAAS,EAAE;MAAE,CAAE;MAAAjB,QAAA,eAC5B,IAAArB,WAAA,CAAAsB,GAAA,EAACzB,OAAA,CAAA0C,MAAM;QACLC,KAAK,EAAEnC,MAAM,CAACmC,KAAM;QACpB9B,OAAO,EAAEL,MAAM,CAACK,OAAO,IAAI,SAAU;QACrCsB,IAAI,EAAC,IAAI;QACTS,OAAO,EAAEpC,MAAM,CAACoC,OAAQ;QACxBC,QAAQ,EAAErC,MAAM,CAACH,IAAI,gBAAG,IAAAF,WAAA,CAAAsB,GAAA,EAACxB,KAAA,CAAAgC,IAAI;UAACC,IAAI,EAAE1B,MAAM,CAACH,IAAK;UAAC8B,IAAI,EAAE,EAAG;UAACC,KAAK,EAAEtB;QAAgB,CAAE,CAAC,GAAGgC;MAAU,CACnG;IAAC,CACE,CAAC,GACL,IAAI;EAAA,CACJ,CAAC;AAEX","ignoreList":[]}
@@ -0,0 +1,46 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = exports.NoAction = exports.Default = void 0;
7
+ var _reactNative = require("react-native");
8
+ var _EmptyState = require("./EmptyState.js");
9
+ var _jsxRuntime = require("react/jsx-runtime");
10
+ const meta = {
11
+ title: 'Components/EmptyState',
12
+ component: _EmptyState.EmptyState
13
+ };
14
+ var _default = exports.default = meta;
15
+ const Default = exports.Default = {
16
+ render: () => /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
17
+ style: {
18
+ padding: 24,
19
+ width: 520
20
+ },
21
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_EmptyState.EmptyState, {
22
+ icon: "dish",
23
+ title: "No items yet",
24
+ description: "Categories group your menu items, like Mains or Drinks, and give each a color on the POS. Create your first one above to get started.",
25
+ action: {
26
+ label: 'Create item',
27
+ icon: 'plus',
28
+ onPress: () => {}
29
+ }
30
+ })
31
+ })
32
+ };
33
+ const NoAction = exports.NoAction = {
34
+ render: () => /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
35
+ style: {
36
+ padding: 24,
37
+ width: 520
38
+ },
39
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_EmptyState.EmptyState, {
40
+ icon: "no-photo",
41
+ title: "Nothing to show",
42
+ description: "There are no results for this filter."
43
+ })
44
+ })
45
+ };
46
+ //# sourceMappingURL=EmptyState.stories.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_reactNative","require","_EmptyState","_jsxRuntime","meta","title","component","EmptyState","_default","exports","default","Default","render","jsx","View","style","padding","width","children","icon","description","action","label","onPress","NoAction"],"sourceRoot":"..\\..\\..\\..\\src","sources":["components/EmptyState/EmptyState.stories.tsx"],"mappings":";;;;;;AACA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AAA0C,IAAAE,WAAA,GAAAF,OAAA;AAE1C,MAAMG,IAAI,GAAG;EACXC,KAAK,EAAE,uBAAuB;EAC9BC,SAAS,EAAEC;AACb,CAAmC;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAErBN,IAAI;AAGZ,MAAMO,OAAc,GAAAF,OAAA,CAAAE,OAAA,GAAG;EAC5BC,MAAM,EAAEA,CAAA,kBACN,IAAAT,WAAA,CAAAU,GAAA,EAACb,YAAA,CAAAc,IAAI;IAACC,KAAK,EAAE;MAAEC,OAAO,EAAE,EAAE;MAAEC,KAAK,EAAE;IAAI,CAAE;IAAAC,QAAA,eACvC,IAAAf,WAAA,CAAAU,GAAA,EAACX,WAAA,CAAAK,UAAU;MACTY,IAAI,EAAC,MAAM;MACXd,KAAK,EAAC,cAAc;MACpBe,WAAW,EAAC,uIAAuI;MACnJC,MAAM,EAAE;QAAEC,KAAK,EAAE,aAAa;QAAEH,IAAI,EAAE,MAAM;QAAEI,OAAO,EAAEA,CAAA,KAAM,CAAC;MAAE;IAAE,CACnE;EAAC,CACE;AAEV,CAAC;AAEM,MAAMC,QAAe,GAAAf,OAAA,CAAAe,QAAA,GAAG;EAC7BZ,MAAM,EAAEA,CAAA,kBACN,IAAAT,WAAA,CAAAU,GAAA,EAACb,YAAA,CAAAc,IAAI;IAACC,KAAK,EAAE;MAAEC,OAAO,EAAE,EAAE;MAAEC,KAAK,EAAE;IAAI,CAAE;IAAAC,QAAA,eACvC,IAAAf,WAAA,CAAAU,GAAA,EAACX,WAAA,CAAAK,UAAU;MAACY,IAAI,EAAC,UAAU;MAACd,KAAK,EAAC,iBAAiB;MAACe,WAAW,EAAC;IAAuC,CAAE;EAAC,CACtG;AAEV,CAAC","ignoreList":[]}
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+
3
+ var _reactNative = require("@testing-library/react-native");
4
+ var _index = require("../../theme/index.js");
5
+ var _EmptyState = require("./EmptyState.js");
6
+ var _jsxRuntime = require("react/jsx-runtime");
7
+ function wrap(ui) {
8
+ return (0, _reactNative.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_index.ThemeProvider, {
9
+ children: ui
10
+ }));
11
+ }
12
+ describe('EmptyState', () => {
13
+ it('renders title and description', () => {
14
+ wrap(/*#__PURE__*/(0, _jsxRuntime.jsx)(_EmptyState.EmptyState, {
15
+ title: "No items yet",
16
+ description: "Create your first one."
17
+ }));
18
+ expect(_reactNative.screen.getByText('No items yet')).toBeTruthy();
19
+ expect(_reactNative.screen.getByText('Create your first one.')).toBeTruthy();
20
+ });
21
+ it('fires the action', () => {
22
+ const onPress = jest.fn();
23
+ wrap(/*#__PURE__*/(0, _jsxRuntime.jsx)(_EmptyState.EmptyState, {
24
+ title: "Empty",
25
+ action: {
26
+ label: 'Create item',
27
+ onPress
28
+ }
29
+ }));
30
+ _reactNative.fireEvent.press(_reactNative.screen.getByText('Create item'));
31
+ expect(onPress).toHaveBeenCalledTimes(1);
32
+ });
33
+ it('renders without an action', () => {
34
+ wrap(/*#__PURE__*/(0, _jsxRuntime.jsx)(_EmptyState.EmptyState, {
35
+ title: "Empty"
36
+ }));
37
+ expect(_reactNative.screen.getByText('Empty')).toBeTruthy();
38
+ });
39
+ });
40
+ //# sourceMappingURL=EmptyState.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_reactNative","require","_index","_EmptyState","_jsxRuntime","wrap","ui","render","jsx","ThemeProvider","children","describe","it","EmptyState","title","description","expect","screen","getByText","toBeTruthy","onPress","jest","fn","action","label","fireEvent","press","toHaveBeenCalledTimes"],"sourceRoot":"..\\..\\..\\..\\src","sources":["components/EmptyState/EmptyState.test.tsx"],"mappings":";;AAAA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AAA0C,IAAAG,WAAA,GAAAH,OAAA;AAE1C,SAASI,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;AAEAK,QAAQ,CAAC,YAAY,EAAE,MAAM;EAC3BC,EAAE,CAAC,+BAA+B,EAAE,MAAM;IACxCP,IAAI,cAAC,IAAAD,WAAA,CAAAI,GAAA,EAACL,WAAA,CAAAU,UAAU;MAACC,KAAK,EAAC,cAAc;MAACC,WAAW,EAAC;IAAwB,CAAE,CAAC,CAAC;IAC9EC,MAAM,CAACC,mBAAM,CAACC,SAAS,CAAC,cAAc,CAAC,CAAC,CAACC,UAAU,CAAC,CAAC;IACrDH,MAAM,CAACC,mBAAM,CAACC,SAAS,CAAC,wBAAwB,CAAC,CAAC,CAACC,UAAU,CAAC,CAAC;EACjE,CAAC,CAAC;EAEFP,EAAE,CAAC,kBAAkB,EAAE,MAAM;IAC3B,MAAMQ,OAAO,GAAGC,IAAI,CAACC,EAAE,CAAC,CAAC;IACzBjB,IAAI,cAAC,IAAAD,WAAA,CAAAI,GAAA,EAACL,WAAA,CAAAU,UAAU;MAACC,KAAK,EAAC,OAAO;MAACS,MAAM,EAAE;QAAEC,KAAK,EAAE,aAAa;QAAEJ;MAAQ;IAAE,CAAE,CAAC,CAAC;IAC7EK,sBAAS,CAACC,KAAK,CAACT,mBAAM,CAACC,SAAS,CAAC,aAAa,CAAC,CAAC;IAChDF,MAAM,CAACI,OAAO,CAAC,CAACO,qBAAqB,CAAC,CAAC,CAAC;EAC1C,CAAC,CAAC;EAEFf,EAAE,CAAC,2BAA2B,EAAE,MAAM;IACpCP,IAAI,cAAC,IAAAD,WAAA,CAAAI,GAAA,EAACL,WAAA,CAAAU,UAAU;MAACC,KAAK,EAAC;IAAO,CAAE,CAAC,CAAC;IAClCE,MAAM,CAACC,mBAAM,CAACC,SAAS,CAAC,OAAO,CAAC,CAAC,CAACC,UAAU,CAAC,CAAC;EAChD,CAAC,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ Object.defineProperty(exports, "EmptyState", {
7
+ enumerable: true,
8
+ get: function () {
9
+ return _EmptyState.EmptyState;
10
+ }
11
+ });
12
+ var _EmptyState = require("./EmptyState.js");
13
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_EmptyState","require"],"sourceRoot":"..\\..\\..\\..\\src","sources":["components/EmptyState/index.ts"],"mappings":";;;;;;;;;;;AAAA,IAAAA,WAAA,GAAAC,OAAA","ignoreList":[]}