@majoo-ui/react 2.0.1 → 2.1.0-rc.1
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/charts.esm.js +3 -1453
- package/colors/Colors.esm.js +93 -0
- package/components/accordion/Accordion.esm.js +109 -0
- package/components/alertDialog/AlertDialog.esm.js +440 -0
- package/components/avatar/Avatar.esm.js +83 -0
- package/components/badge/Badge.esm.js +255 -0
- package/components/banner/Banner.esm.js +341 -0
- package/components/barChart/BarChart.esm.js +212 -0
- package/components/breadcrumb/Breadcrumb.esm.js +65 -0
- package/components/breadcrumb/index.esm.js +19 -0
- package/components/button/Button.esm.js +331 -0
- package/components/buttonGroup/ButtonGroup.esm.js +350 -0
- package/components/card/Card.esm.js +236 -0
- package/components/chart/assets/data_kosong.png.esm.js +3 -0
- package/components/chart/lineChart/LineChart.esm.js +358 -0
- package/components/chart/lineChart/components/Comparator.esm.js +82 -0
- package/components/chart/lineChart/components/ComparatorController.esm.js +112 -0
- package/components/chart/lineChart/components/ComparatorItem.esm.js +104 -0
- package/components/chart/lineChart/components/ProductList.esm.js +78 -0
- package/components/chart/lineChart/components/TitleLegend.esm.js +107 -0
- package/components/chart/lineChart/components/Tooltip.esm.js +90 -0
- package/components/chart/utils/index.esm.js +109 -0
- package/components/checkboxTable/CheckboxTable.esm.js +287 -0
- package/components/colorPicker/ColorPicker.esm.js +342 -0
- package/components/colorPicker/InputColorPicker.esm.js +120 -0
- package/components/colorPicker/assets/img_colormap.gif.esm.js +3 -0
- package/components/colorPicker/components/ColorFields.esm.js +144 -0
- package/components/colorPicker/components/ColorMap.esm.js +1188 -0
- package/components/contentEditor/ContentEditor.esm.js +251 -0
- package/components/contentEditor/assets/Inline-code-outline.svg.esm.js +3 -0
- package/components/contentEditor/assets/Link-outline.svg.esm.js +3 -0
- package/components/contentEditor/assets/List-bulleted-outline.svg.esm.js +3 -0
- package/components/contentEditor/assets/List-numbered-outline.svg.esm.js +3 -0
- package/components/contentEditor/assets/Redo-outline.svg.esm.js +3 -0
- package/components/contentEditor/assets/Text-bold-filled.svg.esm.js +3 -0
- package/components/contentEditor/assets/Text-clear-format-outline.svg.esm.js +3 -0
- package/components/contentEditor/assets/Text-italic-outline.svg.esm.js +3 -0
- package/components/contentEditor/assets/Text-strikethrough-outline.svg.esm.js +3 -0
- package/components/contentEditor/assets/Text-underline-outline.svg.esm.js +3 -0
- package/components/contentEditor/assets/Undo-outline.svg.esm.js +3 -0
- package/components/contextMenu/ContextMenu.esm.js +298 -0
- package/components/datePicker/AdvancedOption.esm.js +37 -0
- package/components/datePicker/CustomDatePicker.esm.js +121 -0
- package/components/datePicker/DatePicker.esm.js +244 -0
- package/components/datePicker/DatePickerMulti.esm.js +70 -0
- package/components/datePicker/InputDatePicker.esm.js +290 -0
- package/components/datePicker/InputDateRangePicker.esm.js +174 -0
- package/components/datePicker/components/Calendar.esm.js +654 -0
- package/components/datePicker/components/CalendarMulti.esm.js +407 -0
- package/components/datePicker/components/CalendarTimePicker.esm.js +104 -0
- package/components/datePicker/components/DateNumber.esm.js +89 -0
- package/components/datePicker/components/MobileCalendar.esm.js +522 -0
- package/components/datePicker/state/reducer.esm.js +286 -0
- package/components/datePicker/timePicker/InputTimePicker.esm.js +205 -0
- package/components/datePicker/timePicker/TimePicker.esm.js +481 -0
- package/components/devicePreview/DevicePreview.esm.js +631 -0
- package/components/devicePreview/deviceFrame/android-transparant.png.esm.js +3 -0
- package/components/devicePreview/deviceFrame/android-wide-transparant.png.esm.js +3 -0
- package/components/devicePreview/deviceFrame/bg-email.png.esm.js +3 -0
- package/components/devicePreview/deviceFrame/bg-notification.png.esm.js +3 -0
- package/components/devicePreview/deviceFrame/bg-sms.png.esm.js +3 -0
- package/components/devicePreview/deviceFrame/bg-whatsapp.png.esm.js +3 -0
- package/components/devicePreview/deviceFrame/desktop-transparant.png.esm.js +3 -0
- package/components/devicePreview/deviceFrame/ic-majoo-profpic.png.esm.js +3 -0
- package/components/devicePreview/deviceFrame/iphone-transparant.png.esm.js +3 -0
- package/components/dialog/Dialog.esm.js +106 -0
- package/components/drawer/Drawer.esm.js +294 -0
- package/components/dropdownMenu/DropdownMenu.esm.js +281 -0
- package/components/editableTable/EditableMobile.esm.js +361 -0
- package/components/editableTable/EditableTable.esm.js +618 -0
- package/components/editableTable/transition.esm.js +37 -0
- package/components/form/components/FormGroup/FormGroup.esm.js +142 -0
- package/components/form/components/FormHelper/Helper.esm.js +50 -0
- package/components/form/components/FormLabel/Label.esm.js +90 -0
- package/components/form/components/InputAddon/InputAddon.esm.js +105 -0
- package/components/form/components/InputCheckbox/CheckboxGroup.esm.js +60 -0
- package/components/form/components/InputCheckbox/InputCheckbox.esm.js +129 -0
- package/components/form/components/InputCheckbox/icon/CheckOutline.esm.js +33 -0
- package/components/form/components/InputCheckbox/icon/MinusOutline.esm.js +33 -0
- package/components/form/components/InputCombobox/InputCombobox.esm.js +169 -0
- package/components/form/components/InputCounter/InputCounter.esm.js +226 -0
- package/components/form/components/InputCreatable/InputCreatable.esm.js +229 -0
- package/components/form/components/InputDateRange/InputDateRange.esm.js +46 -0
- package/components/form/components/InputElement/InputElement.esm.js +35 -0
- package/components/form/components/InputGroup/InputGroup.esm.js +188 -0
- package/components/form/components/InputLetter/InputLetter.esm.js +68 -0
- package/components/form/components/InputNumber/InputNumber.esm.js +248 -0
- package/components/form/components/InputNumber/NumberFormat.esm.js +1263 -0
- package/components/form/components/InputOTP/InputOTP.esm.js +70 -0
- package/components/form/components/InputRadio/InputRadio.esm.js +273 -0
- package/components/form/components/InputRadio/InputRadioGroup.esm.js +35 -0
- package/components/form/components/InputRadio/context.esm.js +5 -0
- package/components/form/components/InputResourceList/InputResourceList.esm.js +429 -0
- package/components/form/components/InputSearchbox/CloseFilled.esm.js +34 -0
- package/components/form/components/InputSearchbox/InputSearchbox.esm.js +90 -0
- package/components/form/components/InputSearchbox/SearchOutline.esm.js +26 -0
- package/components/form/components/InputSelect/InputSelect.esm.js +964 -0
- package/components/form/components/InputSelectCheck/InputSelectCheck.esm.js +1388 -0
- package/components/form/components/InputSelectCheck/OptionGroupItem.esm.js +39 -0
- package/components/form/components/InputSelectCheck/icon/CheckOutline.esm.js +33 -0
- package/components/form/components/InputSelectTag/InputSelectTag.esm.js +62 -0
- package/components/form/components/InputSignature/InputSignature.esm.js +122 -0
- package/components/form/components/InputSignature/SignatureModal.esm.js +67 -0
- package/components/form/components/InputSwitch/InputSwitch.esm.js +96 -0
- package/components/form/components/InputSwitch/InputSwitchWithImage.esm.js +136 -0
- package/components/form/components/InputTags/InputTags.esm.js +268 -0
- package/components/form/components/InputText/InputText.esm.js +197 -0
- package/components/form/components/InputTextArea/InputTextArea.esm.js +77 -0
- package/components/heading/Heading.esm.js +64 -0
- package/components/iconButton/IconButton.esm.js +71 -0
- package/components/image/Image.esm.js +141 -0
- package/components/link/Link.esm.js +59 -0
- package/components/loadingBar/LoadingBar.esm.js +113 -0
- package/components/mapPicker/InputMapPicker.esm.js +160 -0
- package/components/mapPicker/MapPicker.esm.js +122 -0
- package/components/mapPicker/MapPicker.styles.esm.js +70 -0
- package/components/mapPicker/assets/images/Mapsicle.png.esm.js +3 -0
- package/components/mapPicker/components/AddressCard.esm.js +25 -0
- package/components/mapPicker/components/ButtonSelect.esm.js +46 -0
- package/components/mapPicker/components/ChangeView.esm.js +20 -0
- package/components/mapPicker/components/InputSearch.esm.js +74 -0
- package/components/mapPicker/components/MarkerIcon.esm.js +22 -0
- package/components/mapPicker/components/MarkerSvg.esm.js +62 -0
- package/components/mapPicker/components/ZoomControls.esm.js +36 -0
- package/components/mapPicker/hooks/useMapSearch.esm.js +161 -0
- package/components/modalDialog/ModalDialog.esm.js +247 -0
- package/components/notificationBadge/NotificationBadge.esm.js +149 -0
- package/components/pageDialog/PageDialog.esm.js +291 -0
- package/components/pageDialog/logo.svg.esm.js +3 -0
- package/components/pagination/Pagination.esm.js +94 -0
- package/components/pagination/PaginationButton.esm.js +346 -0
- package/components/pagination/PaginationInfo.esm.js +146 -0
- package/components/paper/Paper.esm.js +76 -0
- package/components/paragraph/Paragraph.esm.js +52 -0
- package/components/pieChart/PieChart.esm.js +287 -0
- package/components/popover/Popover.esm.js +142 -0
- package/components/progress/Progress.esm.js +170 -0
- package/components/progressIndicator/ProgressIndicator.esm.js +287 -0
- package/components/scrollSync/ScrollSync.esm.js +172 -0
- package/components/scrollSync/ScrollSyncNode.esm.js +87 -0
- package/components/scrollSync/utils.esm.js +9 -0
- package/components/separator/Separator.esm.js +43 -0
- package/components/skeleton/Skeleton.esm.js +131 -0
- package/components/slider/Slider.esm.js +345 -0
- package/components/stepWizard/StepWizard.esm.js +451 -0
- package/components/stepWizard/index.esm.js +14 -0
- package/components/table/MobileTable.esm.js +415 -0
- package/components/table/Table.esm.js +1472 -0
- package/components/table/components/columns/DateColumn.esm.js +26 -0
- package/components/table/components/columns/DecimalColumn.esm.js +36 -0
- package/components/table/components/columns/PriceColumn.esm.js +57 -0
- package/components/table/components/columns/RowDraggableColumn.esm.js +24 -0
- package/components/table/components/columns/RowExpanderColumn.esm.js +32 -0
- package/components/table/components/columns/RowExpanderMultipleColumn.esm.js +24 -0
- package/components/table/components/columns/RowMenuColumn.esm.js +101 -0
- package/components/table/components/columns/RowSelectionCallbackColumn.esm.js +38 -0
- package/components/table/components/columns/RowSelectionColumn.esm.js +34 -0
- package/components/table/images/img-emptydata.webp.esm.js +3 -0
- package/components/table/images/img-emptysearchdata.webp.esm.js +3 -0
- package/components/tableOfContent/TableOfContent.esm.js +267 -0
- package/components/tableOfContent/index.esm.js +18 -0
- package/components/tableOfContent/transition.esm.js +38 -0
- package/components/tabs/Tabs.esm.js +282 -0
- package/components/tag/Tag.esm.js +161 -0
- package/components/tagList/TagList.esm.js +90 -0
- package/components/tagStatus/TagStatus.esm.js +134 -0
- package/components/text/Text.esm.js +140 -0
- package/components/toast/Toast.esm.js +297 -0
- package/components/toast/ToastContainer.esm.js +73 -0
- package/components/toast/context/ToastContext.esm.js +5 -0
- package/components/toast/context/ToastProvider.esm.js +96 -0
- package/components/tooltip/Tooltip.esm.js +175 -0
- package/components/upload/Upload.esm.js +1103 -0
- package/components/upload/utils/canvasPreview.esm.js +39 -0
- package/components/upload/utils/imgPreview.esm.js +21 -0
- package/config/stitches.config.esm.js +216 -0
- package/editor.esm.js +1 -264
- package/hooks/useListOption/useListOption.esm.js +56 -0
- package/hooks/useToggle/useToggle.esm.js +8 -0
- package/index.esm.js +106 -42293
- package/layout/box/Box.esm.js +24 -0
- package/layout/flex/Flex.esm.js +135 -0
- package/layout/grid/Grid.esm.js +270 -0
- package/layout/pageContainer/PageContainer.esm.js +60 -0
- package/majoo-provider/MajooProvider.esm.js +42 -0
- package/majoo-provider/ThemeProvider.esm.js +41 -0
- package/majoo-provider/globalStyles.esm.js +242 -0
- package/majoo-provider/styles/modern-normalize.esm.js +95 -0
- package/map.esm.js +2 -734
- package/package.json +8 -4
- package/utils/calendar.esm.js +26 -0
- package/utils/element.esm.js +21 -0
- package/utils/object.esm.js +12 -0
- package/utils/request.esm.js +74 -0
- package/utils/strings.esm.js +6 -0
- package/{useMediaQuery.esm.js → utils/useMediaQuery.esm.js} +1 -1
- package/utils/useNavigatorOnline.esm.js +19 -0
- package/utils/variant.esm.js +12 -0
- package/wrapper/ConditionalWrapper.esm.js +9 -0
- package/ModalDialog.esm.js +0 -2669
- package/Separator.esm.js +0 -3002
- package/stitches.config.esm.js +0 -2284
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
import React__default from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import { colors, styled } from '../../config/stitches.config.esm.js';
|
|
4
|
+
import { CloseOutline } from '@majoo-ui/icons';
|
|
5
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
6
|
+
|
|
7
|
+
const TagWrapper = styled('div', {
|
|
8
|
+
boxSizing: 'border-box',
|
|
9
|
+
listStyle: 'none',
|
|
10
|
+
display: 'inline-flex',
|
|
11
|
+
alignItems: 'center',
|
|
12
|
+
height: 'auto',
|
|
13
|
+
width: 'auto',
|
|
14
|
+
justifyContent: 'center',
|
|
15
|
+
fontSize: '12px',
|
|
16
|
+
fontWeight: 500,
|
|
17
|
+
lineHeight: '16px',
|
|
18
|
+
borderRadius: '$sm',
|
|
19
|
+
background: '$bgGray',
|
|
20
|
+
color: '$textPrimary',
|
|
21
|
+
variants: {
|
|
22
|
+
size: {
|
|
23
|
+
sm: {
|
|
24
|
+
minWidth: '45px',
|
|
25
|
+
maxWidth: '118px',
|
|
26
|
+
height: '20px',
|
|
27
|
+
padding: '2px 4px'
|
|
28
|
+
},
|
|
29
|
+
lg: {
|
|
30
|
+
minWidth: '53px',
|
|
31
|
+
maxWidth: '126px',
|
|
32
|
+
height: '24px',
|
|
33
|
+
padding: '4px 8px'
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
disabled: {
|
|
37
|
+
true: {
|
|
38
|
+
background: '$bgInactive',
|
|
39
|
+
cursor: 'not-allowed',
|
|
40
|
+
color: '$textDisable'
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
readOnly: {
|
|
44
|
+
true: {
|
|
45
|
+
cursor: 'not-allowed'
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
type: {
|
|
49
|
+
success: {
|
|
50
|
+
background: '$bgSuccess',
|
|
51
|
+
color: '$textGreen'
|
|
52
|
+
},
|
|
53
|
+
error: {
|
|
54
|
+
background: '$bgFailed',
|
|
55
|
+
color: '$textRed'
|
|
56
|
+
},
|
|
57
|
+
primary: {
|
|
58
|
+
background: '$bgAccent',
|
|
59
|
+
color: '$textBrand'
|
|
60
|
+
},
|
|
61
|
+
varian: {
|
|
62
|
+
background: '$bgWhite',
|
|
63
|
+
color: '$textBrand',
|
|
64
|
+
border: '1px solid $bgBorder'
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
const TagComponent = styled('span', {
|
|
70
|
+
textAlign: 'center',
|
|
71
|
+
whiteSpace: 'nowrap',
|
|
72
|
+
overflow: 'hidden',
|
|
73
|
+
textOverflow: 'ellipsis'
|
|
74
|
+
});
|
|
75
|
+
const StyledIconRight = styled('div', {
|
|
76
|
+
marginLeft: '6px',
|
|
77
|
+
display: 'flex',
|
|
78
|
+
verticalAlign: 'middle',
|
|
79
|
+
alignItems: 'center',
|
|
80
|
+
cursor: 'pointer',
|
|
81
|
+
variants: {
|
|
82
|
+
disabled: {
|
|
83
|
+
true: {
|
|
84
|
+
background: '$bgInactive',
|
|
85
|
+
cursor: 'not-allowed'
|
|
86
|
+
}
|
|
87
|
+
},
|
|
88
|
+
readOnly: {
|
|
89
|
+
true: {
|
|
90
|
+
cursor: 'not-allowed'
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
});
|
|
95
|
+
const StyledIconLeft = styled('div', {
|
|
96
|
+
margin: '0 3px',
|
|
97
|
+
display: 'flex',
|
|
98
|
+
verticalAlign: 'middle',
|
|
99
|
+
alignItems: 'center',
|
|
100
|
+
color: 'inherit'
|
|
101
|
+
});
|
|
102
|
+
const Tag = /*#__PURE__*/React__default.forwardRef(({
|
|
103
|
+
className,
|
|
104
|
+
children,
|
|
105
|
+
onClick,
|
|
106
|
+
size,
|
|
107
|
+
icon,
|
|
108
|
+
isRemovable,
|
|
109
|
+
disabled,
|
|
110
|
+
type,
|
|
111
|
+
onRemove,
|
|
112
|
+
readOnly,
|
|
113
|
+
...props
|
|
114
|
+
}, ref) => {
|
|
115
|
+
return /*#__PURE__*/jsxs(TagWrapper, {
|
|
116
|
+
ref: ref,
|
|
117
|
+
onClick: onClick,
|
|
118
|
+
size: size,
|
|
119
|
+
disabled: disabled,
|
|
120
|
+
type: type,
|
|
121
|
+
readOnly: readOnly,
|
|
122
|
+
css: {
|
|
123
|
+
...props.css
|
|
124
|
+
},
|
|
125
|
+
...props,
|
|
126
|
+
children: [icon !== undefined ? /*#__PURE__*/jsx(StyledIconLeft, {
|
|
127
|
+
children: icon
|
|
128
|
+
}) : null, /*#__PURE__*/jsx(TagComponent, {
|
|
129
|
+
children: children
|
|
130
|
+
}), isRemovable ? /*#__PURE__*/jsx(StyledIconRight, {
|
|
131
|
+
disabled: disabled,
|
|
132
|
+
onClick: onRemove,
|
|
133
|
+
readOnly: readOnly,
|
|
134
|
+
children: /*#__PURE__*/jsx(CloseOutline, {
|
|
135
|
+
size: 16,
|
|
136
|
+
color: colors.iconSecondary,
|
|
137
|
+
style: {
|
|
138
|
+
verticalAlign: 'middle'
|
|
139
|
+
}
|
|
140
|
+
})
|
|
141
|
+
}) : null]
|
|
142
|
+
});
|
|
143
|
+
});
|
|
144
|
+
Tag.propTypes = {
|
|
145
|
+
size: PropTypes.string,
|
|
146
|
+
disabled: PropTypes.bool,
|
|
147
|
+
type: PropTypes.string,
|
|
148
|
+
icon: PropTypes.element,
|
|
149
|
+
isRemovable: PropTypes.bool,
|
|
150
|
+
onRemove: PropTypes.func,
|
|
151
|
+
onClick: PropTypes.func,
|
|
152
|
+
readOnly: PropTypes.bool
|
|
153
|
+
};
|
|
154
|
+
Tag.defaultProps = {
|
|
155
|
+
size: 'sm',
|
|
156
|
+
isRemovable: false,
|
|
157
|
+
disabled: false,
|
|
158
|
+
readOnly: false
|
|
159
|
+
};
|
|
160
|
+
|
|
161
|
+
export { Tag, Tag as default };
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import 'core-js/modules/es.iterator.constructor.js';
|
|
2
|
+
import 'core-js/modules/es.iterator.filter.js';
|
|
3
|
+
import 'core-js/modules/es.iterator.map.js';
|
|
4
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
5
|
+
import React__default, { useState } from 'react';
|
|
6
|
+
import Box from '../../layout/box/Box.esm.js';
|
|
7
|
+
import Flex from '../../layout/flex/Flex.esm.js';
|
|
8
|
+
import Paragraph from '../paragraph/Paragraph.esm.js';
|
|
9
|
+
import { Separator } from '../separator/Separator.esm.js';
|
|
10
|
+
import Text from '../text/Text.esm.js';
|
|
11
|
+
import { ChevronUpOutline, ChevronDownOutline } from '@majoo-ui/icons';
|
|
12
|
+
import { styled, colors } from '../../config/stitches.config.esm.js';
|
|
13
|
+
import { useTranslation } from 'react-i18next';
|
|
14
|
+
import { Tag } from '../tag/Tag.esm.js';
|
|
15
|
+
|
|
16
|
+
const TagWrapper = styled(Box, {
|
|
17
|
+
display: 'flex',
|
|
18
|
+
position: 'relative',
|
|
19
|
+
flexWrap: 'wrap',
|
|
20
|
+
maxWidth: '100%',
|
|
21
|
+
padding: '$spacing-03 0 $spacing-02 0',
|
|
22
|
+
gap: '5px'
|
|
23
|
+
});
|
|
24
|
+
function TagList({
|
|
25
|
+
selectedItems,
|
|
26
|
+
onRemoveItem,
|
|
27
|
+
counterLabel
|
|
28
|
+
}) {
|
|
29
|
+
const {
|
|
30
|
+
t
|
|
31
|
+
} = useTranslation(['MajooUI/inputSelectCheck', 'translation']);
|
|
32
|
+
const [showAllTags, setShowAllTags] = useState(false);
|
|
33
|
+
return jsxs(React__default.Fragment, {
|
|
34
|
+
children: [jsx(TagWrapper, {
|
|
35
|
+
children: selectedItems.filter(item => item.id !== '!all').filter((_, idx) => {
|
|
36
|
+
if (showAllTags) {
|
|
37
|
+
return true;
|
|
38
|
+
}
|
|
39
|
+
return idx < 5;
|
|
40
|
+
}).map((selectedItem, index) => jsx(Tag, {
|
|
41
|
+
isRemovable: true,
|
|
42
|
+
size: "lg",
|
|
43
|
+
onRemove: e => {
|
|
44
|
+
e.stopPropagation();
|
|
45
|
+
return onRemoveItem === null || onRemoveItem === void 0 ? void 0 : onRemoveItem(selectedItem);
|
|
46
|
+
},
|
|
47
|
+
children: selectedItem.name
|
|
48
|
+
}, `selected-item-${index}`))
|
|
49
|
+
}), selectedItems.length > 5 && jsxs(Flex, {
|
|
50
|
+
align: "center",
|
|
51
|
+
justify: "center",
|
|
52
|
+
onClick: () => setShowAllTags(current => !current),
|
|
53
|
+
css: {
|
|
54
|
+
padding: '$spacing-04 0 $spacing-02'
|
|
55
|
+
},
|
|
56
|
+
children: [jsx(Separator, {}), jsxs(Flex, {
|
|
57
|
+
align: "center",
|
|
58
|
+
justify: "center",
|
|
59
|
+
gap: 3,
|
|
60
|
+
css: {
|
|
61
|
+
cursor: 'pointer',
|
|
62
|
+
userSelect: 'none',
|
|
63
|
+
padding: '$spacing-02 $spacing-04',
|
|
64
|
+
boxShadow: '0px 1px 4px rgba(0, 0, 0, 0.04)'
|
|
65
|
+
},
|
|
66
|
+
children: [showAllTags ? jsx(ChevronUpOutline, {
|
|
67
|
+
color: colors.iconSecondary
|
|
68
|
+
}) : jsx(ChevronDownOutline, {
|
|
69
|
+
color: colors.iconSecondary
|
|
70
|
+
}), jsx(Paragraph, {
|
|
71
|
+
css: {
|
|
72
|
+
fontWeight: 600,
|
|
73
|
+
whiteSpace: 'nowrap'
|
|
74
|
+
},
|
|
75
|
+
color: "secondary",
|
|
76
|
+
children: showAllTags ? t('showSomeText', 'Tampilkan Sebagian') : t('showAllText', 'Tampilkan Semua')
|
|
77
|
+
})]
|
|
78
|
+
}), jsx(Separator, {})]
|
|
79
|
+
}), jsxs(Text, {
|
|
80
|
+
variant: "helper",
|
|
81
|
+
color: "brand",
|
|
82
|
+
css: {
|
|
83
|
+
marginTop: '$spacing-03 !important'
|
|
84
|
+
},
|
|
85
|
+
children: [selectedItems.length, " ", counterLabel || t('labelCounterText', 'Item terpilih')]
|
|
86
|
+
})]
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
export { TagList as default };
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import React__default from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import { styled } from '../../config/stitches.config.esm.js';
|
|
4
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
5
|
+
|
|
6
|
+
const TagWrapper = styled('div', {
|
|
7
|
+
boxSizing: 'border-box',
|
|
8
|
+
fontSize: '12px',
|
|
9
|
+
listStyle: 'none',
|
|
10
|
+
display: 'inline-flex',
|
|
11
|
+
height: 'auto',
|
|
12
|
+
width: 'auto',
|
|
13
|
+
justifyContent: 'center',
|
|
14
|
+
lineHeight: '16px',
|
|
15
|
+
borderRadius: '33px',
|
|
16
|
+
color: '$textPrimary',
|
|
17
|
+
fontWeight: 600,
|
|
18
|
+
variants: {
|
|
19
|
+
size: {
|
|
20
|
+
sm: {
|
|
21
|
+
minWidth: '49px',
|
|
22
|
+
maxWidth: '109px',
|
|
23
|
+
height: '22px',
|
|
24
|
+
padding: '2px 4px'
|
|
25
|
+
},
|
|
26
|
+
lg: {
|
|
27
|
+
minWidth: '57px',
|
|
28
|
+
maxWidth: '117px',
|
|
29
|
+
height: '26px',
|
|
30
|
+
padding: '4px 8px'
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
type: {
|
|
34
|
+
default: {
|
|
35
|
+
background: '$bgInactive'
|
|
36
|
+
},
|
|
37
|
+
new: {
|
|
38
|
+
background: '$bgNew'
|
|
39
|
+
},
|
|
40
|
+
process: {
|
|
41
|
+
background: '$bgProcess'
|
|
42
|
+
},
|
|
43
|
+
success: {
|
|
44
|
+
background: '$bgSuccess'
|
|
45
|
+
},
|
|
46
|
+
error: {
|
|
47
|
+
background: '$bgFailed'
|
|
48
|
+
},
|
|
49
|
+
inactive: {
|
|
50
|
+
background: '$bgInactive'
|
|
51
|
+
},
|
|
52
|
+
pending: {
|
|
53
|
+
background: '$bgPending'
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
const TagComponent = styled('span', {
|
|
59
|
+
textAlign: 'center',
|
|
60
|
+
whiteSpace: 'nowrap',
|
|
61
|
+
overflow: 'hidden',
|
|
62
|
+
textOverflow: 'ellipsis'
|
|
63
|
+
});
|
|
64
|
+
const StyledIconLeft = styled('div', {
|
|
65
|
+
margin: '5px 3px 5px 0px',
|
|
66
|
+
display: 'inline-flex',
|
|
67
|
+
verticalAlign: 'middle',
|
|
68
|
+
width: '6px',
|
|
69
|
+
height: '6px',
|
|
70
|
+
borderRadius: '50%',
|
|
71
|
+
variants: {
|
|
72
|
+
type: {
|
|
73
|
+
default: {
|
|
74
|
+
background: '$iconPrimary'
|
|
75
|
+
},
|
|
76
|
+
new: {
|
|
77
|
+
background: '$hlNews'
|
|
78
|
+
},
|
|
79
|
+
process: {
|
|
80
|
+
background: '$hlProcess'
|
|
81
|
+
},
|
|
82
|
+
success: {
|
|
83
|
+
background: '$hlSuccess'
|
|
84
|
+
},
|
|
85
|
+
error: {
|
|
86
|
+
background: '$hlFailed'
|
|
87
|
+
},
|
|
88
|
+
inactive: {
|
|
89
|
+
background: '$iconDisable'
|
|
90
|
+
},
|
|
91
|
+
pending: {
|
|
92
|
+
background: '$hlPending'
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
});
|
|
97
|
+
const TagStatus = /*#__PURE__*/React__default.forwardRef(({
|
|
98
|
+
className,
|
|
99
|
+
children,
|
|
100
|
+
onClick,
|
|
101
|
+
type,
|
|
102
|
+
size,
|
|
103
|
+
...props
|
|
104
|
+
}, ref) => {
|
|
105
|
+
return /*#__PURE__*/jsxs(TagWrapper, {
|
|
106
|
+
ref: ref,
|
|
107
|
+
className: className,
|
|
108
|
+
onClick: onClick,
|
|
109
|
+
type: type,
|
|
110
|
+
size: size,
|
|
111
|
+
css: {
|
|
112
|
+
...props.css
|
|
113
|
+
},
|
|
114
|
+
...props,
|
|
115
|
+
children: [/*#__PURE__*/jsx(StyledIconLeft, {
|
|
116
|
+
type: type
|
|
117
|
+
}), /*#__PURE__*/jsx(TagComponent, {
|
|
118
|
+
children: children
|
|
119
|
+
})]
|
|
120
|
+
});
|
|
121
|
+
});
|
|
122
|
+
TagStatus.propTypes = {
|
|
123
|
+
className: PropTypes.string,
|
|
124
|
+
onClick: PropTypes.func,
|
|
125
|
+
size: PropTypes.string,
|
|
126
|
+
type: PropTypes.string
|
|
127
|
+
// leftIcon: PropTypes.element,
|
|
128
|
+
};
|
|
129
|
+
TagStatus.defaultProps = {
|
|
130
|
+
size: 'sm',
|
|
131
|
+
type: 'default'
|
|
132
|
+
};
|
|
133
|
+
|
|
134
|
+
export { TagStatus, TagStatus as default };
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import 'react';
|
|
2
|
+
import { styled } from '../../config/stitches.config.esm.js';
|
|
3
|
+
import PropTypes from 'prop-types';
|
|
4
|
+
|
|
5
|
+
const Text = styled('p', {
|
|
6
|
+
margin: 0,
|
|
7
|
+
// padding: 0,
|
|
8
|
+
variants: {
|
|
9
|
+
variant: {
|
|
10
|
+
link: {
|
|
11
|
+
fontSize: '$link',
|
|
12
|
+
lineHeight: '$link',
|
|
13
|
+
letterSpacing: '$link',
|
|
14
|
+
fontWeight: '400'
|
|
15
|
+
},
|
|
16
|
+
contentButton: {
|
|
17
|
+
fontSize: '$content-button',
|
|
18
|
+
lineHeight: '$content-button',
|
|
19
|
+
letterSpacing: '$content-button',
|
|
20
|
+
fontWeight: '600'
|
|
21
|
+
},
|
|
22
|
+
placeholder: {
|
|
23
|
+
fontSize: '$placeholder',
|
|
24
|
+
lineHeight: '$placeholder',
|
|
25
|
+
letterSpacing: '$placeholder',
|
|
26
|
+
fontWeight: '400'
|
|
27
|
+
},
|
|
28
|
+
breadcrumb: {
|
|
29
|
+
fontSize: '$breadcrumb',
|
|
30
|
+
lineHeight: '$breadcrumb',
|
|
31
|
+
letterSpacing: '$breadcrumb',
|
|
32
|
+
fontWeight: '500'
|
|
33
|
+
},
|
|
34
|
+
label: {
|
|
35
|
+
fontSize: '$label',
|
|
36
|
+
lineHeight: '$label',
|
|
37
|
+
letterSpacing: '$label',
|
|
38
|
+
fontWeight: '500'
|
|
39
|
+
},
|
|
40
|
+
status: {
|
|
41
|
+
fontSize: '$status',
|
|
42
|
+
lineHeight: '$status',
|
|
43
|
+
letterSpacing: '$status',
|
|
44
|
+
fontWeight: '600'
|
|
45
|
+
},
|
|
46
|
+
helper: {
|
|
47
|
+
fontSize: '$helper',
|
|
48
|
+
lineHeight: '$helper',
|
|
49
|
+
letterSpacing: '$helper',
|
|
50
|
+
fontWeight: '400'
|
|
51
|
+
},
|
|
52
|
+
caption: {
|
|
53
|
+
fontSize: '$caption',
|
|
54
|
+
lineHeight: '$caption',
|
|
55
|
+
letterSpacing: '$caption',
|
|
56
|
+
fontWeight: '400'
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
color: {
|
|
60
|
+
primary: {
|
|
61
|
+
color: '$textPrimary'
|
|
62
|
+
},
|
|
63
|
+
secondary: {
|
|
64
|
+
color: '$textSecondary'
|
|
65
|
+
},
|
|
66
|
+
disable: {
|
|
67
|
+
color: '$textDisable'
|
|
68
|
+
},
|
|
69
|
+
green: {
|
|
70
|
+
color: '$textGreen'
|
|
71
|
+
},
|
|
72
|
+
red: {
|
|
73
|
+
color: '$textRed'
|
|
74
|
+
},
|
|
75
|
+
white: {
|
|
76
|
+
color: '$textWhite'
|
|
77
|
+
},
|
|
78
|
+
brand: {
|
|
79
|
+
color: '$textBrand'
|
|
80
|
+
}
|
|
81
|
+
},
|
|
82
|
+
uppercase: {
|
|
83
|
+
true: {
|
|
84
|
+
textTransform: 'uppercase'
|
|
85
|
+
}
|
|
86
|
+
},
|
|
87
|
+
isTruncated: {
|
|
88
|
+
true: {
|
|
89
|
+
textOverflow: 'ellipsis',
|
|
90
|
+
overflow: 'hidden',
|
|
91
|
+
whiteSpace: 'nowrap'
|
|
92
|
+
}
|
|
93
|
+
},
|
|
94
|
+
align: {
|
|
95
|
+
justify: {
|
|
96
|
+
textAlign: 'justify'
|
|
97
|
+
},
|
|
98
|
+
center: {
|
|
99
|
+
textAlign: 'center'
|
|
100
|
+
},
|
|
101
|
+
right: {
|
|
102
|
+
textAlign: 'right'
|
|
103
|
+
},
|
|
104
|
+
left: {
|
|
105
|
+
textAlign: 'left'
|
|
106
|
+
}
|
|
107
|
+
},
|
|
108
|
+
mobileOnly: {
|
|
109
|
+
true: {
|
|
110
|
+
'@lg': {
|
|
111
|
+
display: 'none !important'
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
},
|
|
115
|
+
desktopOnly: {
|
|
116
|
+
true: {
|
|
117
|
+
display: 'none !important',
|
|
118
|
+
'@lg': {
|
|
119
|
+
display: 'block !important'
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
},
|
|
124
|
+
defaultVariants: {
|
|
125
|
+
as: 'p',
|
|
126
|
+
align: 'left'
|
|
127
|
+
}
|
|
128
|
+
});
|
|
129
|
+
const TextVariantsEnum = ['link', 'contentButton', 'placeholder', 'breadcrumb', 'label', 'status', 'helper', 'caption'];
|
|
130
|
+
Text.propTypes = {
|
|
131
|
+
variant: PropTypes.oneOf(TextVariantsEnum),
|
|
132
|
+
uppercase: PropTypes.bool,
|
|
133
|
+
isTruncated: PropTypes.bool
|
|
134
|
+
};
|
|
135
|
+
Text.defaultProps = {
|
|
136
|
+
as: 'p'
|
|
137
|
+
};
|
|
138
|
+
Text.displayName = 'Text';
|
|
139
|
+
|
|
140
|
+
export { TextVariantsEnum, Text as default };
|