@majoo-ui/react 2.0.0 → 2.1.0-rc.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 (203) hide show
  1. package/charts.esm.js +3 -1453
  2. package/colors/Colors.esm.js +93 -0
  3. package/components/accordion/Accordion.esm.js +109 -0
  4. package/components/alertDialog/AlertDialog.esm.js +440 -0
  5. package/components/avatar/Avatar.esm.js +83 -0
  6. package/components/badge/Badge.esm.js +255 -0
  7. package/components/banner/Banner.esm.js +341 -0
  8. package/components/barChart/BarChart.esm.js +212 -0
  9. package/components/breadcrumb/Breadcrumb.esm.js +65 -0
  10. package/components/breadcrumb/index.esm.js +19 -0
  11. package/components/button/Button.esm.js +331 -0
  12. package/components/buttonGroup/ButtonGroup.esm.js +350 -0
  13. package/components/card/Card.esm.js +236 -0
  14. package/components/chart/assets/data_kosong.png.esm.js +3 -0
  15. package/components/chart/lineChart/LineChart.esm.js +358 -0
  16. package/components/chart/lineChart/components/Comparator.esm.js +82 -0
  17. package/components/chart/lineChart/components/ComparatorController.esm.js +112 -0
  18. package/components/chart/lineChart/components/ComparatorItem.esm.js +104 -0
  19. package/components/chart/lineChart/components/ProductList.esm.js +78 -0
  20. package/components/chart/lineChart/components/TitleLegend.esm.js +107 -0
  21. package/components/chart/lineChart/components/Tooltip.esm.js +90 -0
  22. package/components/chart/utils/index.esm.js +109 -0
  23. package/components/checkboxTable/CheckboxTable.esm.js +287 -0
  24. package/components/colorPicker/ColorPicker.esm.js +342 -0
  25. package/components/colorPicker/InputColorPicker.esm.js +120 -0
  26. package/components/colorPicker/assets/img_colormap.gif.esm.js +3 -0
  27. package/components/colorPicker/components/ColorFields.esm.js +144 -0
  28. package/components/colorPicker/components/ColorMap.esm.js +1188 -0
  29. package/components/contentEditor/ContentEditor.esm.js +251 -0
  30. package/components/contentEditor/assets/Inline-code-outline.svg.esm.js +3 -0
  31. package/components/contentEditor/assets/Link-outline.svg.esm.js +3 -0
  32. package/components/contentEditor/assets/List-bulleted-outline.svg.esm.js +3 -0
  33. package/components/contentEditor/assets/List-numbered-outline.svg.esm.js +3 -0
  34. package/components/contentEditor/assets/Redo-outline.svg.esm.js +3 -0
  35. package/components/contentEditor/assets/Text-bold-filled.svg.esm.js +3 -0
  36. package/components/contentEditor/assets/Text-clear-format-outline.svg.esm.js +3 -0
  37. package/components/contentEditor/assets/Text-italic-outline.svg.esm.js +3 -0
  38. package/components/contentEditor/assets/Text-strikethrough-outline.svg.esm.js +3 -0
  39. package/components/contentEditor/assets/Text-underline-outline.svg.esm.js +3 -0
  40. package/components/contentEditor/assets/Undo-outline.svg.esm.js +3 -0
  41. package/components/contextMenu/ContextMenu.esm.js +298 -0
  42. package/components/datePicker/AdvancedOption.esm.js +37 -0
  43. package/components/datePicker/CustomDatePicker.esm.js +121 -0
  44. package/components/datePicker/DatePicker.esm.js +244 -0
  45. package/components/datePicker/DatePickerMulti.esm.js +70 -0
  46. package/components/datePicker/InputDatePicker.esm.js +290 -0
  47. package/components/datePicker/InputDateRangePicker.esm.js +174 -0
  48. package/components/datePicker/components/Calendar.esm.js +654 -0
  49. package/components/datePicker/components/CalendarMulti.esm.js +407 -0
  50. package/components/datePicker/components/CalendarTimePicker.esm.js +104 -0
  51. package/components/datePicker/components/DateNumber.esm.js +89 -0
  52. package/components/datePicker/components/MobileCalendar.esm.js +522 -0
  53. package/components/datePicker/state/reducer.esm.js +286 -0
  54. package/components/datePicker/timePicker/InputTimePicker.esm.js +205 -0
  55. package/components/datePicker/timePicker/TimePicker.esm.js +481 -0
  56. package/components/devicePreview/DevicePreview.esm.js +631 -0
  57. package/components/devicePreview/deviceFrame/android-transparant.png.esm.js +3 -0
  58. package/components/devicePreview/deviceFrame/android-wide-transparant.png.esm.js +3 -0
  59. package/components/devicePreview/deviceFrame/bg-email.png.esm.js +3 -0
  60. package/components/devicePreview/deviceFrame/bg-notification.png.esm.js +3 -0
  61. package/components/devicePreview/deviceFrame/bg-sms.png.esm.js +3 -0
  62. package/components/devicePreview/deviceFrame/bg-whatsapp.png.esm.js +3 -0
  63. package/components/devicePreview/deviceFrame/desktop-transparant.png.esm.js +3 -0
  64. package/components/devicePreview/deviceFrame/ic-majoo-profpic.png.esm.js +3 -0
  65. package/components/devicePreview/deviceFrame/iphone-transparant.png.esm.js +3 -0
  66. package/components/dialog/Dialog.esm.js +106 -0
  67. package/components/drawer/Drawer.esm.js +294 -0
  68. package/components/dropdownMenu/DropdownMenu.esm.js +281 -0
  69. package/components/editableTable/EditableMobile.esm.js +361 -0
  70. package/components/editableTable/EditableTable.esm.js +618 -0
  71. package/components/editableTable/transition.esm.js +37 -0
  72. package/components/form/components/FormGroup/FormGroup.esm.js +142 -0
  73. package/components/form/components/FormHelper/Helper.esm.js +50 -0
  74. package/components/form/components/FormLabel/Label.esm.js +90 -0
  75. package/components/form/components/InputAddon/InputAddon.esm.js +105 -0
  76. package/components/form/components/InputCheckbox/CheckboxGroup.esm.js +60 -0
  77. package/components/form/components/InputCheckbox/InputCheckbox.esm.js +129 -0
  78. package/components/form/components/InputCheckbox/icon/CheckOutline.esm.js +33 -0
  79. package/components/form/components/InputCheckbox/icon/MinusOutline.esm.js +33 -0
  80. package/components/form/components/InputCombobox/InputCombobox.esm.js +169 -0
  81. package/components/form/components/InputCounter/InputCounter.esm.js +226 -0
  82. package/components/form/components/InputCreatable/InputCreatable.esm.js +229 -0
  83. package/components/form/components/InputDateRange/InputDateRange.esm.js +46 -0
  84. package/components/form/components/InputElement/InputElement.esm.js +35 -0
  85. package/components/form/components/InputGroup/InputGroup.esm.js +188 -0
  86. package/components/form/components/InputLetter/InputLetter.esm.js +68 -0
  87. package/components/form/components/InputNumber/InputNumber.esm.js +248 -0
  88. package/components/form/components/InputNumber/NumberFormat.esm.js +1263 -0
  89. package/components/form/components/InputOTP/InputOTP.esm.js +70 -0
  90. package/components/form/components/InputRadio/InputRadio.esm.js +273 -0
  91. package/components/form/components/InputRadio/InputRadioGroup.esm.js +35 -0
  92. package/components/form/components/InputRadio/context.esm.js +5 -0
  93. package/components/form/components/InputResourceList/InputResourceList.esm.js +429 -0
  94. package/components/form/components/InputSearchbox/CloseFilled.esm.js +34 -0
  95. package/components/form/components/InputSearchbox/InputSearchbox.esm.js +90 -0
  96. package/components/form/components/InputSearchbox/SearchOutline.esm.js +26 -0
  97. package/components/form/components/InputSelect/InputSelect.esm.js +964 -0
  98. package/components/form/components/InputSelectCheck/InputSelectCheck.esm.js +1388 -0
  99. package/components/form/components/InputSelectCheck/OptionGroupItem.esm.js +39 -0
  100. package/components/form/components/InputSelectCheck/icon/CheckOutline.esm.js +33 -0
  101. package/components/form/components/InputSelectTag/InputSelectTag.esm.js +62 -0
  102. package/components/form/components/InputSignature/InputSignature.esm.js +122 -0
  103. package/components/form/components/InputSignature/SignatureModal.esm.js +67 -0
  104. package/components/form/components/InputSwitch/InputSwitch.esm.js +96 -0
  105. package/components/form/components/InputSwitch/InputSwitchWithImage.esm.js +136 -0
  106. package/components/form/components/InputTags/InputTags.esm.js +268 -0
  107. package/components/form/components/InputText/InputText.esm.js +197 -0
  108. package/components/form/components/InputTextArea/InputTextArea.esm.js +77 -0
  109. package/components/heading/Heading.esm.js +64 -0
  110. package/components/iconButton/IconButton.esm.js +71 -0
  111. package/components/image/Image.esm.js +141 -0
  112. package/components/link/Link.esm.js +59 -0
  113. package/components/loadingBar/LoadingBar.esm.js +113 -0
  114. package/components/mapPicker/InputMapPicker.esm.js +160 -0
  115. package/components/mapPicker/MapPicker.esm.js +122 -0
  116. package/components/mapPicker/MapPicker.styles.esm.js +70 -0
  117. package/components/mapPicker/assets/images/Mapsicle.png.esm.js +3 -0
  118. package/components/mapPicker/components/AddressCard.esm.js +25 -0
  119. package/components/mapPicker/components/ButtonSelect.esm.js +46 -0
  120. package/components/mapPicker/components/ChangeView.esm.js +20 -0
  121. package/components/mapPicker/components/InputSearch.esm.js +74 -0
  122. package/components/mapPicker/components/MarkerIcon.esm.js +22 -0
  123. package/components/mapPicker/components/MarkerSvg.esm.js +62 -0
  124. package/components/mapPicker/components/ZoomControls.esm.js +36 -0
  125. package/components/mapPicker/hooks/useMapSearch.esm.js +161 -0
  126. package/components/modalDialog/ModalDialog.esm.js +247 -0
  127. package/components/notificationBadge/NotificationBadge.esm.js +149 -0
  128. package/components/pageDialog/PageDialog.esm.js +291 -0
  129. package/components/pageDialog/logo.svg.esm.js +3 -0
  130. package/components/pagination/Pagination.esm.js +94 -0
  131. package/components/pagination/PaginationButton.esm.js +346 -0
  132. package/components/pagination/PaginationInfo.esm.js +146 -0
  133. package/components/paper/Paper.esm.js +76 -0
  134. package/components/paragraph/Paragraph.esm.js +52 -0
  135. package/components/pieChart/PieChart.esm.js +287 -0
  136. package/components/popover/Popover.esm.js +142 -0
  137. package/components/progress/Progress.esm.js +170 -0
  138. package/components/progressIndicator/ProgressIndicator.esm.js +287 -0
  139. package/components/scrollSync/ScrollSync.esm.js +172 -0
  140. package/components/scrollSync/ScrollSyncNode.esm.js +87 -0
  141. package/components/scrollSync/utils.esm.js +9 -0
  142. package/components/separator/Separator.esm.js +43 -0
  143. package/components/skeleton/Skeleton.esm.js +131 -0
  144. package/components/slider/Slider.esm.js +345 -0
  145. package/components/stepWizard/StepWizard.esm.js +451 -0
  146. package/components/stepWizard/index.esm.js +14 -0
  147. package/components/table/MobileTable.esm.js +415 -0
  148. package/components/table/Table.esm.js +1472 -0
  149. package/components/table/components/columns/DateColumn.esm.js +26 -0
  150. package/components/table/components/columns/DecimalColumn.esm.js +36 -0
  151. package/components/table/components/columns/PriceColumn.esm.js +57 -0
  152. package/components/table/components/columns/RowDraggableColumn.esm.js +24 -0
  153. package/components/table/components/columns/RowExpanderColumn.esm.js +32 -0
  154. package/components/table/components/columns/RowExpanderMultipleColumn.esm.js +24 -0
  155. package/components/table/components/columns/RowMenuColumn.esm.js +101 -0
  156. package/components/table/components/columns/RowSelectionCallbackColumn.esm.js +38 -0
  157. package/components/table/components/columns/RowSelectionColumn.esm.js +34 -0
  158. package/components/table/images/img-emptydata.webp.esm.js +3 -0
  159. package/components/table/images/img-emptysearchdata.webp.esm.js +3 -0
  160. package/components/tableOfContent/TableOfContent.esm.js +267 -0
  161. package/components/tableOfContent/index.esm.js +18 -0
  162. package/components/tableOfContent/transition.esm.js +38 -0
  163. package/components/tabs/Tabs.esm.js +282 -0
  164. package/components/tag/Tag.esm.js +161 -0
  165. package/components/tagList/TagList.esm.js +90 -0
  166. package/components/tagStatus/TagStatus.esm.js +134 -0
  167. package/components/text/Text.esm.js +140 -0
  168. package/components/toast/Toast.esm.js +297 -0
  169. package/components/toast/ToastContainer.esm.js +73 -0
  170. package/components/toast/context/ToastContext.esm.js +5 -0
  171. package/components/toast/context/ToastProvider.esm.js +96 -0
  172. package/components/tooltip/Tooltip.esm.js +175 -0
  173. package/components/upload/Upload.esm.js +1103 -0
  174. package/components/upload/utils/canvasPreview.esm.js +39 -0
  175. package/components/upload/utils/imgPreview.esm.js +21 -0
  176. package/config/stitches.config.esm.js +216 -0
  177. package/editor.esm.js +1 -264
  178. package/hooks/useListOption/useListOption.esm.js +56 -0
  179. package/hooks/useToggle/useToggle.esm.js +8 -0
  180. package/index.esm.js +106 -42293
  181. package/layout/box/Box.esm.js +24 -0
  182. package/layout/flex/Flex.esm.js +135 -0
  183. package/layout/grid/Grid.esm.js +270 -0
  184. package/layout/pageContainer/PageContainer.esm.js +60 -0
  185. package/majoo-provider/MajooProvider.esm.js +42 -0
  186. package/majoo-provider/ThemeProvider.esm.js +41 -0
  187. package/majoo-provider/globalStyles.esm.js +242 -0
  188. package/majoo-provider/styles/modern-normalize.esm.js +95 -0
  189. package/map.esm.js +2 -734
  190. package/package.json +16 -5
  191. package/utils/calendar.esm.js +26 -0
  192. package/utils/element.esm.js +21 -0
  193. package/utils/object.esm.js +12 -0
  194. package/utils/request.esm.js +74 -0
  195. package/utils/strings.esm.js +6 -0
  196. package/{useMediaQuery.esm.js → utils/useMediaQuery.esm.js} +1 -1
  197. package/utils/useNavigatorOnline.esm.js +19 -0
  198. package/utils/variant.esm.js +12 -0
  199. package/wrapper/ConditionalWrapper.esm.js +9 -0
  200. package/ModalDialog.esm.js +0 -2669
  201. package/Separator.esm.js +0 -3002
  202. package/stitches.config.esm.js +0 -2284
  203. package/{index.esm.css → charts.esm.css} +4 -4
@@ -0,0 +1,212 @@
1
+ import 'core-js/modules/es.iterator.constructor.js';
2
+ import 'core-js/modules/es.iterator.map.js';
3
+ import { jsxs, jsx } from 'react/jsx-runtime';
4
+ import Heading from '../heading/Heading.esm.js';
5
+ import Paragraph from '../paragraph/Paragraph.esm.js';
6
+ import { Separator } from '../separator/Separator.esm.js';
7
+ import Text from '../text/Text.esm.js';
8
+ import Box from '../../layout/box/Box.esm.js';
9
+ import Flex from '../../layout/flex/Flex.esm.js';
10
+ import { ResponsiveContainer, BarChart, CartesianGrid, XAxis, YAxis, Tooltip, Legend, Bar, Cell, LabelList } from 'recharts';
11
+ import { foundations } from '@majoo-ui/core';
12
+
13
+ const {
14
+ colors
15
+ } = foundations;
16
+ const renderLegend = (formattedData, legend, subtitle, tickFormatter) => jsxs(Box, {
17
+ css: {
18
+ marginTop: '$spacing-09'
19
+ },
20
+ children: [subtitle && jsx(Flex, {
21
+ justify: "center",
22
+ children: jsx(Heading, {
23
+ css: {
24
+ marginBottom: '$spacing-06'
25
+ },
26
+ heading: "sectionTitle",
27
+ children: subtitle
28
+ })
29
+ }), formattedData.length > 0 && jsx(Flex, {
30
+ direction: "column",
31
+ gap: 5,
32
+ children: formattedData.map((data, index) => {
33
+ var _a, _b;
34
+ return jsxs(Box, {
35
+ children: [jsxs(Flex, {
36
+ justify: "between",
37
+ children: [jsxs(Flex, {
38
+ align: "center",
39
+ children: [jsx(Box, {
40
+ css: {
41
+ backgroundColor: data.color,
42
+ borderRadius: '50%',
43
+ height: 12,
44
+ width: 12,
45
+ display: 'inline-block',
46
+ marginRight: '$spacing-03'
47
+ }
48
+ }), jsx(Box, {
49
+ css: {
50
+ width: 120
51
+ },
52
+ children: jsx(Text, {
53
+ variant: "label",
54
+ color: "secondary",
55
+ children: data.name
56
+ })
57
+ })]
58
+ }), legend.showTotal && jsx(Text, {
59
+ variant: "label",
60
+ color: "secondary",
61
+ children: tickFormatter ? tickFormatter === null || tickFormatter === void 0 ? void 0 : tickFormatter((_a = formattedData[index]) === null || _a === void 0 ? void 0 : _a.total) : (_b = formattedData[index]) === null || _b === void 0 ? void 0 : _b.total
62
+ })]
63
+ }), jsx(Separator, {
64
+ css: {
65
+ marginTop: '$spacing-03'
66
+ }
67
+ })]
68
+ }, index);
69
+ })
70
+ })]
71
+ });
72
+ const DEFAULT_DATA = [{
73
+ name: 'none',
74
+ total: 0,
75
+ color: colors.chartGreen
76
+ }];
77
+ function BarChartComponent({
78
+ css,
79
+ data,
80
+ legend,
81
+ title,
82
+ subtitle,
83
+ tooltip,
84
+ direction,
85
+ tickFormatter,
86
+ label,
87
+ yAxis
88
+ }) {
89
+ var _a, _b;
90
+ const isHorizontal = direction === 'horizontal';
91
+ const MIN_HEIGHT = 350;
92
+ const MIN_WIDTH = 500;
93
+ const formattedData = data.length ? data : DEFAULT_DATA;
94
+ const CustomTooltip = ({
95
+ payload = {},
96
+ active = false
97
+ }) => {
98
+ var _a;
99
+ if (active) {
100
+ const {
101
+ total,
102
+ name
103
+ } = payload[0].payload;
104
+ return jsxs(Box, {
105
+ css: {
106
+ backgroundColor: '$textContent',
107
+ color: '$white',
108
+ borderRadius: '$sm',
109
+ padding: '$spacing-02',
110
+ flexDirection: 'column'
111
+ },
112
+ children: [jsx(Text, {
113
+ variant: "placeholder",
114
+ color: "disable",
115
+ css: {
116
+ fontSize: 11
117
+ },
118
+ children: name
119
+ }), jsx(Paragraph, {
120
+ paragraph: "shortContentRegular",
121
+ css: {
122
+ color: '$white',
123
+ fontSize: 12
124
+ },
125
+ children: (tooltip === null || tooltip === void 0 ? void 0 : tooltip.label) ? (_a = tooltip === null || tooltip === void 0 ? void 0 : tooltip.label) === null || _a === void 0 ? void 0 : _a.call(tooltip, total) : total
126
+ })]
127
+ });
128
+ }
129
+ return null;
130
+ };
131
+ return jsxs(Box, {
132
+ children: [title && jsx(Heading, {
133
+ heading: "sectionTitle",
134
+ children: title
135
+ }), jsx(Box, {
136
+ css: Object.assign({
137
+ width: MIN_WIDTH,
138
+ height: MIN_HEIGHT,
139
+ marginTop: '$spacing-07'
140
+ }, css),
141
+ children: jsx(ResponsiveContainer, {
142
+ children: jsxs(BarChart, {
143
+ width: MIN_WIDTH,
144
+ height: MIN_HEIGHT,
145
+ data: formattedData,
146
+ layout: isHorizontal ? 'vertical' : 'horizontal',
147
+ children: [jsx(CartesianGrid, {
148
+ stroke: colors.gray150,
149
+ vertical: isHorizontal,
150
+ horizontal: !isHorizontal
151
+ }), isHorizontal && jsx(XAxis, Object.assign({
152
+ type: "number",
153
+ stroke: colors.textSecondary,
154
+ fontSize: 12,
155
+ axisLine: false
156
+ }, isHorizontal && {
157
+ tickFormatter
158
+ })), jsx(YAxis, Object.assign({
159
+ axisLine: false,
160
+ type: isHorizontal ? 'category' : 'number',
161
+ dataKey: isHorizontal ? 'name' : 'total',
162
+ width: isHorizontal ? 100 : 50,
163
+ hide: !(yAxis === null || yAxis === void 0 ? void 0 : yAxis.show),
164
+ stroke: colors.textSecondary,
165
+ fontSize: 12
166
+ }, !isHorizontal && {
167
+ tickFormatter
168
+ })), data.length > 0 && jsx(Tooltip, {
169
+ wrapperStyle: {
170
+ outline: 'none'
171
+ },
172
+ cursor: {
173
+ fill: 'transparent'
174
+ },
175
+ content: (tooltip === null || tooltip === void 0 ? void 0 : tooltip.render) ? (_a = tooltip === null || tooltip === void 0 ? void 0 : tooltip.render) === null || _a === void 0 ? void 0 : _a.call(tooltip) : jsx(CustomTooltip, {})
176
+ }), (legend === null || legend === void 0 ? void 0 : legend.show) && jsx(Legend, {
177
+ content: renderLegend(formattedData, legend, subtitle, tickFormatter)
178
+ }), jsxs(Bar, {
179
+ dataKey: "total",
180
+ barSize: 12,
181
+ radius: 50,
182
+ children: [formattedData.map(item => jsx(Cell, {
183
+ fill: item.color || colors.chartGreen
184
+ }, item.name)), (label === null || label === void 0 ? void 0 : label.show) && jsx(LabelList, {
185
+ style: {
186
+ marginLeft: '-8px'
187
+ },
188
+ dataKey: (label === null || label === void 0 ? void 0 : label.dataKey) || 'total',
189
+ formatter: label === null || label === void 0 ? void 0 : label.formatter,
190
+ position: (label === null || label === void 0 ? void 0 : label.position) || 'top',
191
+ content: (_b = label === null || label === void 0 ? void 0 : label.render) === null || _b === void 0 ? void 0 : _b.call(label),
192
+ fill: colors.textDisable,
193
+ fontSize: 12
194
+ })]
195
+ })]
196
+ })
197
+ })
198
+ })]
199
+ });
200
+ }
201
+ BarChartComponent.defaultProps = {
202
+ data: [],
203
+ legend: {
204
+ show: true,
205
+ showTotal: true
206
+ },
207
+ yAxis: {
208
+ show: true
209
+ }
210
+ };
211
+
212
+ export { BarChartComponent as default };
@@ -0,0 +1,65 @@
1
+ import 'react';
2
+ import { styled } from '../../config/stitches.config.esm.js';
3
+ import Text from '../text/Text.esm.js';
4
+ import { jsx } from 'react/jsx-runtime';
5
+
6
+ const BreadcrumbStyle = styled('nav', {
7
+ wordWrap: 'break-word',
8
+ '& li+li:before': {
9
+ marginInline: '0.5rem',
10
+ content: '/',
11
+ fontSize: 12,
12
+ color: '$textBrand'
13
+ },
14
+ '& li:last-child:before': {
15
+ color: '$textSecondary'
16
+ }
17
+ });
18
+ const Ol = styled('ol', {
19
+ margin: 0,
20
+ padding: 0
21
+ });
22
+ const BreadcrumbItem = styled('li', {
23
+ display: 'inline-flex',
24
+ alignItems: 'center'
25
+ });
26
+ const BreadcrumbLinkStyle = styled(Text, {
27
+ '&:hover': {
28
+ textDecoration: 'underline'
29
+ },
30
+ color: '$textBrand',
31
+ variants: {
32
+ isCurrentPage: {
33
+ true: {
34
+ color: '$textSecondary'
35
+ }
36
+ }
37
+ }
38
+ });
39
+ BreadcrumbLinkStyle.defaultProps = {
40
+ variant: 'breadcrumb',
41
+ as: 'a'
42
+ };
43
+ const BreadcrumbLinkBase = props => {
44
+ const aria = props.isCurrentPage && {
45
+ 'aria-current': 'page'
46
+ };
47
+ return /*#__PURE__*/jsx(BreadcrumbLinkStyle, {
48
+ ...props,
49
+ ...aria
50
+ });
51
+ };
52
+ const BreadcrumbBase = ({
53
+ children,
54
+ ...rest
55
+ }) => {
56
+ return /*#__PURE__*/jsx(BreadcrumbStyle, {
57
+ ...rest,
58
+ "aria-label": "breadcrumb",
59
+ children: /*#__PURE__*/jsx(Ol, {
60
+ children: children
61
+ })
62
+ });
63
+ };
64
+
65
+ export { BreadcrumbBase, BreadcrumbItem, BreadcrumbLinkBase, BreadcrumbLinkStyle, BreadcrumbStyle };
@@ -0,0 +1,19 @@
1
+ import { __rest } from 'tslib';
2
+ import { jsx } from 'react/jsx-runtime';
3
+ import { BreadcrumbBase, BreadcrumbLinkBase } from './Breadcrumb.esm.js';
4
+ export { BreadcrumbItem } from './Breadcrumb.esm.js';
5
+
6
+ const Breadcrumb = _a => {
7
+ var {
8
+ children
9
+ } = _a,
10
+ rest = __rest(_a, ["children"]);
11
+ return jsx(BreadcrumbBase, Object.assign({}, rest, {
12
+ children: children
13
+ }));
14
+ };
15
+ const BreadcrumbLink = props => {
16
+ return jsx(BreadcrumbLinkBase, Object.assign({}, props));
17
+ };
18
+
19
+ export { Breadcrumb, BreadcrumbLink };
@@ -0,0 +1,331 @@
1
+ import { __rest } from 'tslib';
2
+ import { jsxs, jsx } from 'react/jsx-runtime';
3
+ import * as React from 'react';
4
+ import { styled } from '../../config/stitches.config.esm.js';
5
+
6
+ const ButtonPrimary = {
7
+ backgroundColor: '$btnPrimary',
8
+ color: '$textWhite',
9
+ border: 'none',
10
+ '&:hover': {
11
+ backgroundColor: '$btnHoverPrimary'
12
+ },
13
+ '&:active': {
14
+ backgroundColor: '$btnActivePrimary'
15
+ }
16
+ };
17
+ const PrimarySecondary = {
18
+ backgroundColor: '$btnSecondary',
19
+ border: '1px solid $btnPrimary',
20
+ color: '$textBrand',
21
+ '&:hover': {
22
+ backgroundColor: '$btnHoverSecondary',
23
+ border: '1px solid $btnPrimary',
24
+ color: '$textBrand'
25
+ },
26
+ '&:active': {
27
+ backgroundColor: '$btnActiveSecondary',
28
+ border: '1px solid $btnPrimary'
29
+ }
30
+ };
31
+ const GhostButton = {
32
+ backgroundColor: '$btnSecondary',
33
+ color: '$textBrand',
34
+ border: 'none',
35
+ '&:focus': {
36
+ outline: 'none'
37
+ },
38
+ '&:hover': {
39
+ backgroundColor: '$btnHoverSecondary',
40
+ outline: '1px solid $btnHoverSecondary',
41
+ color: '$textBrand'
42
+ },
43
+ '&:active': {
44
+ backgroundColor: '$btnActiveSecondary',
45
+ outline: '1px solid $btnPrimary'
46
+ }
47
+ };
48
+ const ButtonNegative = {
49
+ backgroundColor: '$btnNegative',
50
+ color: '$textWhite',
51
+ border: 'none',
52
+ '&:hover': {
53
+ backgroundColor: '$btnHoverNegative'
54
+ },
55
+ '&:active': {
56
+ backgroundColor: '$btnActiveNegative'
57
+ }
58
+ };
59
+ const ButtonNegativeSecondary = {
60
+ backgroundColor: '$bgWhite',
61
+ border: '1px solid $btnNegative',
62
+ color: '$textRed',
63
+ '&:hover': {
64
+ backgroundColor: '$btnHoverNegativeSecondary',
65
+ border: '1px solid $textRed'
66
+ },
67
+ '&:active': {
68
+ backgroundColor: '$btnActiveNegativeSecondary',
69
+ border: '1px solid $textRed'
70
+ }
71
+ };
72
+ const ButtonNegativeGhost = {
73
+ backgroundColor: '$btnSecondary',
74
+ color: '$textRed',
75
+ border: 'none',
76
+ '&:hover': {
77
+ backgroundColor: '$btnHoverNegativeSecondary',
78
+ outline: '1px solid $btnHoverNegativeSecondary',
79
+ color: '$textRed'
80
+ },
81
+ '&:active': {
82
+ backgroundColor: '$btnActiveNegativeSecondary',
83
+ outline: '1px solid $btnNegative'
84
+ }
85
+ };
86
+ const ButtonGhostSecondary = {
87
+ backgroundColor: '$btnSecondary',
88
+ color: '$textSecondary',
89
+ border: 'none',
90
+ '&:hover': {
91
+ backgroundColor: '$gray100',
92
+ outline: '1px solid $gray100',
93
+ color: '$textSecondary'
94
+ },
95
+ '&:active': {
96
+ backgroundColor: '$gray150',
97
+ outline: '1px solid $gray150'
98
+ }
99
+ };
100
+ const ButtonHeaderMenu = {
101
+ backgroundColor: '$bgWhite',
102
+ border: '1px solid $bgBorder',
103
+ color: '$textPrimary',
104
+ '&:hover': {
105
+ backgroundColor: '$gray50',
106
+ border: '1px solid $bgBorder',
107
+ color: '$textPrimary'
108
+ },
109
+ '&:active': {
110
+ backgroundColor: '$gray50'
111
+ }
112
+ };
113
+ const ButtonTableMenu = {
114
+ backgroundColor: '$bgWhite',
115
+ color: '$textPrimary',
116
+ padding: '$spacing-04 $spacing-05',
117
+ width: '180px',
118
+ textAlign: 'left',
119
+ border: 'none',
120
+ borderRadius: 0,
121
+ '&:focus': {
122
+ outline: 'none'
123
+ },
124
+ '&:hover': {
125
+ backgroundColor: '$gray50'
126
+ },
127
+ '&:active': {
128
+ backgroundColor: '$gray100'
129
+ }
130
+ };
131
+ const StyledIcon = styled('div', {
132
+ display: 'inline-flex',
133
+ justifyContent: 'center',
134
+ alignItems: 'center',
135
+ '& svg': {
136
+ verticalAlign: 'middle'
137
+ }
138
+ });
139
+ const StyledIconLeft = styled('div', {
140
+ marginRight: '$spacing-03',
141
+ display: 'inline-flex',
142
+ justifyContent: 'center',
143
+ alignItems: 'center'
144
+ });
145
+ const StyledIconRight = styled('div', {
146
+ marginLeft: '$spacing-03',
147
+ display: 'inline-flex',
148
+ justifyContent: 'center',
149
+ alignItems: 'center'
150
+ });
151
+ const ButtonPrimitive = styled('button', {
152
+ margin: 0,
153
+ display: 'block',
154
+ verticalAlign: 'middle',
155
+ fontWeight: 600,
156
+ width: 'auto',
157
+ height: '40px',
158
+ userSelect: 'none',
159
+ borderRadius: '$md',
160
+ cursor: 'pointer',
161
+ fontSize: '14px',
162
+ textAlign: 'center',
163
+ lineHeight: '20px',
164
+ position: 'relative',
165
+ whiteSpace: 'nowrap',
166
+ '&:focus': {
167
+ outline: '2px solid $borderFocus'
168
+ },
169
+ '&:disabled': {
170
+ border: '1px solid $btnDisable',
171
+ backgroundColor: '$btnDisable',
172
+ color: '$textDisable',
173
+ cursor: 'not-allowed',
174
+ '&:hover': {
175
+ backgroundColor: '$btnDisable',
176
+ border: '1px solid $btnDisable',
177
+ color: '$textDisable'
178
+ },
179
+ '&:active': {
180
+ backgroundColor: '$btnDisable',
181
+ border: '1px solid $btnDisable'
182
+ }
183
+ },
184
+ variants: {
185
+ /**
186
+ * Specify the button type
187
+ */
188
+ buttonType: {
189
+ primary: Object.assign({}, ButtonPrimary),
190
+ secondary: Object.assign({}, PrimarySecondary),
191
+ ghost: Object.assign({}, GhostButton),
192
+ 'ghost-secondary': Object.assign({}, ButtonGhostSecondary),
193
+ negative: Object.assign({}, ButtonNegative),
194
+ 'negative-secondary': Object.assign({}, ButtonNegativeSecondary),
195
+ 'negative-ghost': Object.assign({}, ButtonNegativeGhost),
196
+ headerMenu: Object.assign({}, ButtonHeaderMenu),
197
+ tableMenu: Object.assign({}, ButtonTableMenu)
198
+ },
199
+ /**
200
+ * Specify the button size
201
+ */
202
+ size: {
203
+ xs: {
204
+ minWidth: '70px',
205
+ height: '28px',
206
+ padding: '1px 12px'
207
+ // padding: '4px 12px',
208
+ },
209
+ sm: {
210
+ minWidth: '70px',
211
+ height: '32px',
212
+ padding: '3px 12px'
213
+ // padding: '6px 12px',
214
+ },
215
+ md: {
216
+ minWidth: '70px',
217
+ height: '40px',
218
+ padding: '7px 12px'
219
+ // padding: '10px 12px',
220
+ },
221
+ lg: {
222
+ minWidth: '84px',
223
+ height: '48px',
224
+ padding: '11px 16px'
225
+ // padding: '14px 16px',
226
+ }
227
+ },
228
+ /**
229
+ * Specify the button icon size
230
+ */
231
+ iconSize: {
232
+ xs: {
233
+ minWidth: '28px',
234
+ height: '28px',
235
+ padding: '3px',
236
+ borderRadius: '$md'
237
+ },
238
+ sm: {
239
+ minWidth: '32px',
240
+ height: '32px',
241
+ padding: '5px',
242
+ borderRadius: '$md'
243
+ },
244
+ md: {
245
+ minWidth: '40px',
246
+ height: '40px',
247
+ padding: '7px',
248
+ borderRadius: '$md'
249
+ },
250
+ lg: {
251
+ minWidth: '48px',
252
+ height: '48px',
253
+ padding: '11px',
254
+ borderRadius: '$md'
255
+ }
256
+ },
257
+ /**
258
+ * Hidden the button
259
+ */
260
+ hidden: {
261
+ true: {
262
+ display: 'none'
263
+ }
264
+ },
265
+ withIcon: {
266
+ true: {
267
+ display: 'inline-flex',
268
+ flexDirection: 'row',
269
+ alignItems: 'center',
270
+ justifyContent: 'center'
271
+ }
272
+ },
273
+ mobileOnly: {
274
+ true: {
275
+ '@md': {
276
+ display: 'none !important'
277
+ }
278
+ }
279
+ },
280
+ desktopOnly: {
281
+ true: {
282
+ display: 'none !important',
283
+ '@md': {
284
+ display: 'inherit !important'
285
+ }
286
+ }
287
+ }
288
+ }
289
+ });
290
+ const Button = /*#__PURE__*/React.forwardRef((_a, forwardedRef) => {
291
+ var {
292
+ children,
293
+ type,
294
+ buttonType = 'primary',
295
+ size = 'md',
296
+ disabled = false,
297
+ block = false,
298
+ width,
299
+ leftIcon,
300
+ rightIcon,
301
+ icon = false,
302
+ iconSize,
303
+ mobileOnly,
304
+ desktopOnly
305
+ } = _a,
306
+ props = __rest(_a, ["children", "type", "buttonType", "size", "disabled", "block", "width", "leftIcon", "rightIcon", "icon", "iconSize", "mobileOnly", "desktopOnly"]);
307
+ return jsxs(ButtonPrimitive, Object.assign({
308
+ type: type,
309
+ buttonType: buttonType,
310
+ size: size,
311
+ withIcon: Boolean(icon || leftIcon || rightIcon),
312
+ iconSize: icon ? size : undefined,
313
+ disabled: disabled,
314
+ mobileOnly: mobileOnly,
315
+ desktopOnly: desktopOnly,
316
+ css: Object.assign(Object.assign({}, props.css), {
317
+ width: block ? '100%' : width
318
+ }),
319
+ ref: forwardedRef
320
+ }, props, {
321
+ children: [leftIcon && jsx(StyledIconLeft, {
322
+ children: leftIcon
323
+ }), icon ? jsx(StyledIcon, {
324
+ children: children
325
+ }) : children, rightIcon && jsx(StyledIconRight, {
326
+ children: rightIcon
327
+ })]
328
+ }));
329
+ });
330
+
331
+ export { Button, ButtonPrimitive, Button as default };