@nethru/ui 1.0.81 → 2.0.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 (140) hide show
  1. package/base/AddableFormList.js +56 -0
  2. package/base/Alert.js +27 -0
  3. package/base/Checkbox.js +20 -0
  4. package/base/CircularProgressButton.js +36 -0
  5. package/base/ColumnedSection.js +44 -0
  6. package/base/DropdownButton.js +74 -0
  7. package/base/MainHeader.js +56 -0
  8. package/base/MenuItem.js +92 -0
  9. package/base/PropertyTable.js +69 -0
  10. package/base/SearchTextField.js +44 -0
  11. package/base/SearchableSelect.js +64 -0
  12. package/base/Select.js +33 -0
  13. package/{dist → base}/Slider.js +12 -13
  14. package/base/Snackbar.js +33 -0
  15. package/base/Switch.js +20 -0
  16. package/base/assets/icons.js +390 -0
  17. package/base/assets/images.js +1 -0
  18. package/base/colors/blue.js +15 -0
  19. package/base/colors/blueGrey.js +6 -0
  20. package/base/colors/green.js +13 -0
  21. package/base/colors/grey.js +18 -0
  22. package/base/colors/index.js +9 -0
  23. package/base/colors/lime.js +13 -0
  24. package/base/colors/orange.js +13 -0
  25. package/base/colors/purple.js +13 -0
  26. package/base/colors/red.js +13 -0
  27. package/base/colors/yellow.js +13 -0
  28. package/base/datagrid/DataGrid.js +57 -0
  29. package/base/datagrid/Footer.js +51 -0
  30. package/base/datagrid/Pagination.js +24 -0
  31. package/base/dialog/AlertDialog.js +21 -0
  32. package/base/dialog/ConfirmDialog.js +29 -0
  33. package/base/dialog/Dialog.js +56 -0
  34. package/base/dialog/SimpleDialog.js +33 -0
  35. package/{dist → base}/error/Error.js +1 -2
  36. package/base/frame/AppBar.js +54 -0
  37. package/base/frame/Brand.js +36 -0
  38. package/base/frame/Frame.js +49 -0
  39. package/{dist → base/frame}/sidebar/MenuToggler.js +14 -3
  40. package/{dist → base/frame}/sidebar/PrimaryMenu.js +15 -20
  41. package/base/frame/sidebar/SecondaryMenu.js +41 -0
  42. package/{dist → base/frame}/sidebar/Sidebar.js +21 -10
  43. package/base/frame/sidebar/SidebarContext.js +74 -0
  44. package/base/frame/sidebar/css/primary.module.css +69 -0
  45. package/base/frame/sidebar/css/sidebar.module.css +63 -0
  46. package/base/index.js +33 -0
  47. package/{dist → base}/samples/menu.sample.json +2 -2
  48. package/base/styles/borderRadius.js +7 -0
  49. package/base/styles/createTheme.js +90 -0
  50. package/base/styles/globalStyles.js +47 -0
  51. package/base/styles/mui/alert.js +40 -0
  52. package/base/styles/mui/appBar.js +17 -0
  53. package/base/styles/mui/autocomplete.js +46 -0
  54. package/base/styles/mui/avatar.js +14 -0
  55. package/base/styles/mui/button.js +276 -0
  56. package/base/styles/mui/buttonBase.js +10 -0
  57. package/base/styles/mui/checkbox.js +37 -0
  58. package/base/styles/mui/chip.js +83 -0
  59. package/base/styles/mui/cssBaseline.js +12 -0
  60. package/base/styles/mui/dataGrid.js +101 -0
  61. package/base/styles/mui/dialog.js +13 -0
  62. package/base/styles/mui/dialogActions.js +8 -0
  63. package/base/styles/mui/dialogContent.js +10 -0
  64. package/base/styles/mui/dialogTitle.js +11 -0
  65. package/base/styles/mui/formControl.js +8 -0
  66. package/base/styles/mui/formControlLabel.js +9 -0
  67. package/base/styles/mui/formHelperText.js +10 -0
  68. package/base/styles/mui/grid.js +15 -0
  69. package/base/styles/mui/icon.js +12 -0
  70. package/base/styles/mui/iconButton.js +79 -0
  71. package/base/styles/mui/inputLabel.js +13 -0
  72. package/base/styles/mui/list.js +11 -0
  73. package/base/styles/mui/menuItem.js +83 -0
  74. package/base/styles/mui/outlinedInput.js +53 -0
  75. package/base/styles/mui/paginationItem.js +25 -0
  76. package/base/styles/mui/paper.js +8 -0
  77. package/base/styles/mui/popover.js +11 -0
  78. package/base/styles/mui/select.js +11 -0
  79. package/base/styles/mui/slider.js +15 -0
  80. package/base/styles/mui/snackbar.js +24 -0
  81. package/base/styles/mui/switch.js +33 -0
  82. package/base/styles/mui/tab.js +23 -0
  83. package/base/styles/mui/tablePagination.js +8 -0
  84. package/base/styles/mui/tabs.js +20 -0
  85. package/base/styles/mui/textField.js +11 -0
  86. package/base/styles/mui/toggleButton.js +96 -0
  87. package/base/styles/mui/tooltip.js +22 -0
  88. package/base/styles/palette.js +40 -0
  89. package/base/styles/shadow.js +8 -0
  90. package/base/styles/typography.js +131 -0
  91. package/package.json +14 -10
  92. package/dist/Accordion.js +0 -45
  93. package/dist/AccordionDetails.js +0 -19
  94. package/dist/AccordionSummary.js +0 -35
  95. package/dist/AlertDialog.js +0 -55
  96. package/dist/AppBar.js +0 -68
  97. package/dist/AppendableFormList.js +0 -56
  98. package/dist/AvatarDropdown.js +0 -80
  99. package/dist/Button.js +0 -61
  100. package/dist/Checkbox.js +0 -27
  101. package/dist/CircularProgress.js +0 -33
  102. package/dist/ColumnedSection.js +0 -64
  103. package/dist/ConfirmDialog.js +0 -65
  104. package/dist/DataGrid.js +0 -150
  105. package/dist/Dialog.js +0 -42
  106. package/dist/DropdownButton.js +0 -59
  107. package/dist/FormLabel.js +0 -23
  108. package/dist/Frame.js +0 -47
  109. package/dist/GroupSelect.js +0 -67
  110. package/dist/ListItem.js +0 -21
  111. package/dist/ListItemDivider.js +0 -15
  112. package/dist/ListItemGrid.js +0 -12
  113. package/dist/ListItemText.js +0 -44
  114. package/dist/MainHeader.js +0 -59
  115. package/dist/PropertyTable.js +0 -141
  116. package/dist/ReferenceChipList.js +0 -59
  117. package/dist/SearchTextField.js +0 -24
  118. package/dist/SearchableSelect.js +0 -41
  119. package/dist/Section.js +0 -22
  120. package/dist/Select.js +0 -48
  121. package/dist/ShadowedSection.js +0 -36
  122. package/dist/Snackbar.js +0 -51
  123. package/dist/StatusChip.js +0 -34
  124. package/dist/Switch.js +0 -37
  125. package/dist/TabbedSection.js +0 -37
  126. package/dist/Tabs.js +0 -38
  127. package/dist/TextField.js +0 -25
  128. package/dist/index.js +0 -42
  129. package/dist/samples/global.sample.css +0 -59
  130. package/dist/sidebar/MenuTree.js +0 -95
  131. package/dist/sidebar/MenuTreeGroup.js +0 -65
  132. package/dist/sidebar/SecondaryMenu.js +0 -36
  133. package/dist/sidebar/SidebarContext.js +0 -122
  134. package/dist/sidebar/css/primary.module.css +0 -80
  135. package/dist/sidebar/css/sidebar.module.css +0 -50
  136. package/dist/variables.js +0 -6
  137. /package/{dist → base}/editor/Editor.js +0 -0
  138. /package/{dist → base}/editor/nScript.js +0 -0
  139. /package/{dist → base}/editor/nScriptKeywords.js +0 -0
  140. /package/{dist → base}/error/HttpError.js +0 -0
@@ -0,0 +1,131 @@
1
+ import { grey } from "../colors";
2
+ const typography = {
3
+ fontFamily: '"Pretendard Variable", Pretendard,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol"',
4
+ fontSize: 12,
5
+ h1: undefined,
6
+ h2: undefined,
7
+ h3: undefined,
8
+ h4: undefined,
9
+ h5: undefined,
10
+ h6: undefined,
11
+ subtitle1: undefined,
12
+ subtitle2: undefined,
13
+ body1: undefined,
14
+ body2: undefined,
15
+ button: undefined,
16
+ caption: undefined,
17
+ overline: undefined,
18
+ logo: {
19
+ color: grey[900],
20
+ fontSize: '18px',
21
+ fontWeight: 600,
22
+ lineHeight: 1.6,
23
+ letterSpacing: 0
24
+ },
25
+ headline1: {
26
+ color: grey[900],
27
+ fontSize: '24px',
28
+ fontWeight: 700,
29
+ lineHeight: 1.6,
30
+ letterSpacing: 0
31
+ },
32
+ headline2: {
33
+ color: grey[900],
34
+ fontSize: '16px',
35
+ fontWeight: 700,
36
+ lineHeight: 1.6,
37
+ letterSpacing: 0
38
+ },
39
+ bodyXlSemibold: {
40
+ color: grey[900],
41
+ fontSize: '16px',
42
+ fontWeight: 600,
43
+ lineHeight: 1.6,
44
+ letterSpacing: 0
45
+ },
46
+ bodyXlMedium: {
47
+ color: grey[900],
48
+ fontSize: '16px',
49
+ fontWeight: 500,
50
+ lineHeight: 1.6,
51
+ letterSpacing: 0
52
+ },
53
+ bodyLgSemibold: {
54
+ color: grey[900],
55
+ fontSize: '14px',
56
+ fontWeight: 600,
57
+ lineHeight: 1.6,
58
+ letterSpacing: 0
59
+ },
60
+ bodyLgMedium: {
61
+ color: grey[900],
62
+ fontSize: '14px',
63
+ fontWeight: 500,
64
+ lineHeight: 1.6,
65
+ letterSpacing: 0
66
+ },
67
+ bodyMdSemibold: {
68
+ color: grey[900],
69
+ fontSize: '13px',
70
+ fontWeight: 600,
71
+ lineHeight: 1.4,
72
+ letterSpacing: 0
73
+ },
74
+ bodyMdMedium: {
75
+ color: grey[900],
76
+ fontSize: '13px',
77
+ fontWeight: 500,
78
+ lineHeight: 1.4,
79
+ letterSpacing: 0
80
+ },
81
+ bodySmBold: {
82
+ color: grey[900],
83
+ fontSize: '12px',
84
+ fontWeight: 700,
85
+ lineHeight: 1.4,
86
+ letterSpacing: 0
87
+ },
88
+ bodySmSemibold: {
89
+ color: grey[900],
90
+ fontSize: '12px',
91
+ fontWeight: 600,
92
+ lineHeight: 1.4,
93
+ letterSpacing: 0
94
+ },
95
+ bodySmMedium: {
96
+ color: grey[900],
97
+ fontSize: '12px',
98
+ fontWeight: 500,
99
+ lineHeight: 1.4,
100
+ letterSpacing: 0
101
+ },
102
+ bodySmRegular: {
103
+ color: grey[900],
104
+ fontSize: '12px',
105
+ fontWeight: 400,
106
+ lineHeight: 1.4,
107
+ letterSpacing: 0
108
+ },
109
+ bodyXsSemibold: {
110
+ color: grey[900],
111
+ fontSize: '10px',
112
+ fontWeight: 600,
113
+ lineHeight: 1.4,
114
+ letterSpacing: 0
115
+ },
116
+ bodyXsMedium: {
117
+ color: grey[900],
118
+ fontSize: '10px',
119
+ fontWeight: 500,
120
+ lineHeight: 1.4,
121
+ letterSpacing: 0
122
+ },
123
+ code: {
124
+ color: grey[900],
125
+ fontSize: '13px',
126
+ fontWeight: 500,
127
+ lineHeight: 1.6,
128
+ letterSpacing: 0
129
+ }
130
+ };
131
+ export default typography;
package/package.json CHANGED
@@ -1,20 +1,21 @@
1
1
  {
2
2
  "name": "@nethru/ui",
3
- "version": "1.0.81",
4
- "main": "dist/index.js",
3
+ "version": "2.0.0",
4
+ "main": "base/index.js",
5
5
  "files": [
6
- "/dist"
6
+ "/base"
7
7
  ],
8
8
  "dependencies": {
9
9
  "@codemirror/lang-javascript": "^6.2.1",
10
10
  "@codemirror/lang-json": "^6.0.1",
11
- "@emotion/react": "^11.11.1",
12
- "@emotion/styled": "^11.11.0",
11
+ "@emotion/react": "^11.11.4",
12
+ "@emotion/styled": "^11.11.5",
13
13
  "@fontsource/roboto": "^5.0.8",
14
14
  "@mui/icons-material": "^5.14.18",
15
- "@mui/material": "^5.14.18",
16
- "@mui/x-data-grid-pro": "^6.19.10",
17
- "@mui/x-date-pickers-pro": "^7.2.0",
15
+ "@mui/material": "^5.15.21",
16
+ "@mui/styled-engine-sc": "^6.0.0-alpha.18",
17
+ "@mui/x-data-grid-pro": "^6.20.3",
18
+ "@mui/x-date-pickers-pro": "^7.8.0",
18
19
  "@mui/x-license": "^7.2.0",
19
20
  "@mui/x-tree-view": "^6.17.0",
20
21
  "@nethru/ui": "^1.0.19",
@@ -22,19 +23,22 @@
22
23
  "@testing-library/react": "^13.4.0",
23
24
  "@testing-library/user-event": "^13.5.0",
24
25
  "@uiw/react-codemirror": "^4.21.21",
26
+ "dayjs": "^1.11.11",
25
27
  "days": "^1.1.1",
26
28
  "immer": "^10.0.3",
27
29
  "react": "^18.2.0",
28
30
  "react-dom": "^18.2.0",
29
31
  "react-router-dom": "^6.20.1",
30
- "react-scripts": "5.0.1"
32
+ "react-scripts": "5.0.1",
33
+ "styled-components": "^6.1.11",
34
+ "uuid": "^10.0.0"
31
35
  },
32
36
  "scripts": {
33
37
  "start": "react-scripts start",
34
38
  "build": "react-scripts build",
35
39
  "test": "react-scripts test",
36
40
  "eject": "react-scripts eject",
37
- "publish:npm": "rm -rf dist && mkdir dist && babel src/lib -d dist --copy-files"
41
+ "publish": "rm -rf base && mkdir base && babel src/lib -d base --copy-files"
38
42
  },
39
43
  "babel": {
40
44
  "presets": [
package/dist/Accordion.js DELETED
@@ -1,45 +0,0 @@
1
- import MuiAccordion from "@mui/material/Accordion";
2
- import { jsx as _jsx } from "react/jsx-runtime";
3
- const styles = {
4
- border: '1px solid #eaeaea',
5
- boxShadow: 'none',
6
- '.MuiAccordionDetails-root': {
7
- pt: 0,
8
- pl: 8,
9
- pr: 8
10
- },
11
- '.MuiFormLabel-root.MuiInputLabel-root': {
12
- fontSize: '14px'
13
- },
14
- '.MuiInputBase-input.MuiInput-input': {
15
- color: '#555',
16
- fontSize: '15px'
17
- },
18
- '.MuiTabs-root.MuiTabs-vertical': {
19
- mt: 2
20
- },
21
- '.MuiTabs-root.MuiTabs-vertical .MuiButtonBase-root.MuiTab-root': {
22
- fontSize: '14px',
23
- minWidth: '32px',
24
- maxWidth: '32px'
25
- },
26
- '.MuiButtonBase-root.MuiToggleButton-root': {
27
- pt: '1px',
28
- pb: '1px',
29
- fontSize: '12px'
30
- }
31
- };
32
- export default function Accordion({
33
- children,
34
- sx,
35
- ...props
36
- }) {
37
- return /*#__PURE__*/_jsx(MuiAccordion, {
38
- sx: {
39
- ...sx,
40
- ...styles
41
- },
42
- ...props,
43
- children: children
44
- });
45
- }
@@ -1,19 +0,0 @@
1
- import MuiAccordionDetails from "@mui/material/AccordionDetails";
2
- import { jsx as _jsx } from "react/jsx-runtime";
3
- const styles = {
4
- mb: 2
5
- };
6
- export default function AccordionDetails({
7
- children,
8
- sx,
9
- ...props
10
- }) {
11
- return /*#__PURE__*/_jsx(MuiAccordionDetails, {
12
- sx: {
13
- ...sx,
14
- ...styles
15
- },
16
- ...props,
17
- children: children
18
- });
19
- }
@@ -1,35 +0,0 @@
1
- import { Stack, Typography } from "@mui/material";
2
- import MuiAccordionSummary from "@mui/material/AccordionSummary";
3
- import ExpandMoreIcon from "@mui/icons-material/ExpandMore";
4
- import { jsx as _jsx } from "react/jsx-runtime";
5
- import { jsxs as _jsxs } from "react/jsx-runtime";
6
- import { Fragment as _Fragment } from "react/jsx-runtime";
7
- export default function AccordionSummary({
8
- title,
9
- desc,
10
- children,
11
- ...props
12
- }) {
13
- return /*#__PURE__*/_jsxs(_Fragment, {
14
- children: [title && /*#__PURE__*/_jsx(MuiAccordionSummary, {
15
- expandIcon: /*#__PURE__*/_jsx(ExpandMoreIcon, {}),
16
- ...props,
17
- children: /*#__PURE__*/_jsxs(Stack, {
18
- direction: "row",
19
- alignItems: "flex-end",
20
- gap: 1,
21
- children: [/*#__PURE__*/_jsx(Typography, {
22
- children: title
23
- }), desc && /*#__PURE__*/_jsx(Typography, {
24
- variant: "caption",
25
- color: "#aaa",
26
- children: desc
27
- })]
28
- })
29
- }), !title && /*#__PURE__*/_jsx(MuiAccordionSummary, {
30
- expandIcon: /*#__PURE__*/_jsx(ExpandMoreIcon, {}),
31
- ...props,
32
- children: children
33
- })]
34
- });
35
- }
@@ -1,55 +0,0 @@
1
- import { Box, Button, Stack } from "@mui/material";
2
- import DialogContent from "@mui/material/DialogContent";
3
- import DialogContentText from "@mui/material/DialogContentText";
4
- import DialogActions from "@mui/material/DialogActions";
5
- import Dialog from "./Dialog";
6
- import CampaignIcon from "@mui/icons-material/Campaign";
7
- import { jsx as _jsx } from "react/jsx-runtime";
8
- import { jsxs as _jsxs } from "react/jsx-runtime";
9
- export default function AlertDialog({
10
- open,
11
- onClose,
12
- content,
13
- closeText = '확인'
14
- }) {
15
- return /*#__PURE__*/_jsxs(Dialog, {
16
- contentFontSize: 15,
17
- open: open,
18
- onClose: onClose,
19
- children: [/*#__PURE__*/_jsx(DialogContent, {
20
- children: /*#__PURE__*/_jsxs(Stack, {
21
- direction: "row",
22
- alignItems: "center",
23
- gap: 2,
24
- children: [/*#__PURE__*/_jsx(CampaignIcon, {
25
- sx: {
26
- color: '#777',
27
- '&': {
28
- fontSize: 50
29
- }
30
- }
31
- }), /*#__PURE__*/_jsx(DialogContentText, {
32
- component: "div",
33
- children: /*#__PURE__*/_jsx(Box, {
34
- component: "div",
35
- sx: {
36
- whiteSpace: 'pre-wrap'
37
- },
38
- children: content.replace(/(\\n)/g, '\n')
39
- })
40
- })]
41
- })
42
- }), /*#__PURE__*/_jsx(DialogActions, {
43
- sx: {
44
- mt: 0,
45
- mb: 1,
46
- justifyContent: 'center'
47
- },
48
- children: /*#__PURE__*/_jsx(Button, {
49
- variant: "contained",
50
- onClick: onClose,
51
- children: closeText
52
- })
53
- })]
54
- });
55
- }
package/dist/AppBar.js DELETED
@@ -1,68 +0,0 @@
1
- import { Box, Divider, Stack, Toolbar, Typography } from "@mui/material";
2
- import MuiAppBar from "@mui/material/AppBar";
3
- import { grey } from "@mui/material/colors";
4
- import { jsx as _jsx } from "react/jsx-runtime";
5
- import { jsxs as _jsxs } from "react/jsx-runtime";
6
- export default function AppBar({
7
- title,
8
- logoUri,
9
- onLogoClick,
10
- children,
11
- sx
12
- }) {
13
- const appbarStyles = {
14
- boxShadow: 'none',
15
- borderBottom: `1px solid ${grey[300]}`,
16
- '@media (min-width: 600px)': {
17
- '.MuiToolbar-root': {
18
- paddingLeft: '16px',
19
- paddingRight: '16px'
20
- }
21
- }
22
- };
23
- const logoStyles = {
24
- width: 37,
25
- height: 32,
26
- cursor: onLogoClick ? 'pointer' : 'default'
27
- };
28
- const dividerStyles = {
29
- borderColor: grey[200],
30
- mt: 2,
31
- mb: 2,
32
- ml: 2,
33
- mr: 1
34
- };
35
- return /*#__PURE__*/_jsx(MuiAppBar, {
36
- color: "transparent",
37
- sx: {
38
- ...sx,
39
- ...appbarStyles
40
- },
41
- children: /*#__PURE__*/_jsxs(Toolbar, {
42
- children: [/*#__PURE__*/_jsxs(Stack, {
43
- spacing: 1,
44
- direction: "row",
45
- alignItems: "center",
46
- children: [/*#__PURE__*/_jsx(Box, {
47
- component: "img",
48
- src: logoUri,
49
- alt: "logo",
50
- onClick: onLogoClick,
51
- sx: logoStyles
52
- }), /*#__PURE__*/_jsx(Typography, {
53
- noWrap: true,
54
- sx: {
55
- color: 'text.secondary',
56
- cursor: 'default'
57
- },
58
- children: title
59
- })]
60
- }), /*#__PURE__*/_jsx(Divider, {
61
- orientation: "vertical",
62
- variant: "middle",
63
- sx: dividerStyles,
64
- flexItem: true
65
- }), children]
66
- })
67
- });
68
- }
@@ -1,56 +0,0 @@
1
- import React from "react";
2
- import { Button, IconButton, Stack, Tooltip, Typography } from "@mui/material";
3
- import AddIcon from "@mui/icons-material/Add";
4
- import DeleteIcon from "@mui/icons-material/Delete";
5
- import { jsx as _jsx } from "react/jsx-runtime";
6
- import { jsxs as _jsxs } from "react/jsx-runtime";
7
- import { Fragment as _Fragment } from "react/jsx-runtime";
8
- export default function AppendableFormList({
9
- gap = 1,
10
- forms,
11
- renderForm,
12
- addOns,
13
- onAppend,
14
- onRemove,
15
- readOnly
16
- }) {
17
- return /*#__PURE__*/_jsxs(Stack, {
18
- gap: gap,
19
- children: [/*#__PURE__*/_jsxs(_Fragment, {
20
- children: [forms.map((form, index) => /*#__PURE__*/_jsxs(Stack, {
21
- direction: "row",
22
- alignItems: "end",
23
- gap: 2,
24
- children: [renderForm(form, index), !readOnly && /*#__PURE__*/_jsx(Tooltip, {
25
- title: "\uC0AD\uC81C",
26
- children: /*#__PURE__*/_jsx(IconButton, {
27
- onClick: _ => onRemove(index),
28
- size: "small",
29
- sx: {
30
- ml: '-10px',
31
- mb: '-5px'
32
- },
33
- children: /*#__PURE__*/_jsx(DeleteIcon, {
34
- fontSize: "small"
35
- })
36
- })
37
- })]
38
- }, index)), forms.length === 0 && /*#__PURE__*/_jsx(Typography, {
39
- variant: "body2",
40
- sx: {
41
- color: '#999'
42
- },
43
- children: "\uD56D\uBAA9\uC774 \uC5C6\uC2B5\uB2C8\uB2E4"
44
- })]
45
- }), !readOnly && /*#__PURE__*/_jsxs(Stack, {
46
- direction: "row",
47
- gap: 1,
48
- children: [/*#__PURE__*/_jsx(Button, {
49
- variant: "text",
50
- startIcon: /*#__PURE__*/_jsx(AddIcon, {}),
51
- onClick: onAppend,
52
- children: "\uCD94\uAC00"
53
- }), addOns]
54
- })]
55
- });
56
- }
@@ -1,80 +0,0 @@
1
- import { useMemo, useState } from 'react';
2
- import { Avatar, Box, IconButton } from '@mui/material';
3
- import Menu from '@mui/material/Menu';
4
- import MenuItem from '@mui/material/MenuItem';
5
- import ListItemIcon from '@mui/material/ListItemIcon';
6
- import Divider from '@mui/material/Divider';
7
- import LogoutRoundedIcon from '@mui/icons-material/LogoutRounded';
8
- import { red } from '@mui/material/colors';
9
- import { jsx as _jsx } from "react/jsx-runtime";
10
- import { jsxs as _jsxs } from "react/jsx-runtime";
11
- export default function AvatarDropdown({
12
- name,
13
- color,
14
- bgcolor,
15
- children,
16
- onProfileClick,
17
- onLogoutClick,
18
- ...props
19
- }) {
20
- const [anchorEl, setAnchorEl] = useState(null);
21
- const open = Boolean(anchorEl);
22
- const firstLetter = useMemo(() => {
23
- return name && name.length > 0 ? name[0].toUpperCase() : "?";
24
- }, [name]);
25
- const handleClick = event => setAnchorEl(event.currentTarget);
26
- const handleClose = () => setAnchorEl(null);
27
- const styles = {
28
- color: color ? color : '#fff',
29
- bgcolor: bgcolor ? bgcolor : red[900],
30
- width: 32,
31
- height: 32,
32
- fontSize: 16
33
- };
34
- return /*#__PURE__*/_jsxs(Box, {
35
- ...props,
36
- children: [/*#__PURE__*/_jsx(IconButton, {
37
- onClick: handleClick,
38
- size: "small",
39
- sx: {
40
- ml: 2
41
- },
42
- children: /*#__PURE__*/_jsx(Avatar, {
43
- sx: styles,
44
- children: firstLetter
45
- })
46
- }), /*#__PURE__*/_jsxs(Menu, {
47
- anchorEl: anchorEl,
48
- open: open,
49
- onClose: handleClose,
50
- onClick: handleClose,
51
- sx: {
52
- '.MuiButtonBase-root.MuiMenuItem-root': {
53
- fontSize: 14
54
- }
55
- },
56
- children: [/*#__PURE__*/_jsxs(MenuItem, {
57
- onClick: onProfileClick,
58
- children: [/*#__PURE__*/_jsx(ListItemIcon, {
59
- children: /*#__PURE__*/_jsx(Avatar, {
60
- sx: {
61
- ...styles,
62
- mr: 1,
63
- fontSize: 13,
64
- width: 22,
65
- height: 22
66
- },
67
- children: firstLetter
68
- })
69
- }), name]
70
- }), /*#__PURE__*/_jsx(Divider, {}), children, children && /*#__PURE__*/_jsx(Divider, {}), /*#__PURE__*/_jsxs(MenuItem, {
71
- onClick: onLogoutClick,
72
- children: [/*#__PURE__*/_jsx(ListItemIcon, {
73
- children: /*#__PURE__*/_jsx(LogoutRoundedIcon, {
74
- fontSize: "small"
75
- })
76
- }), "\uB85C\uADF8\uC544\uC6C3"]
77
- })]
78
- })]
79
- });
80
- }
package/dist/Button.js DELETED
@@ -1,61 +0,0 @@
1
- import { useMemo } from "react";
2
- import MuiButton from "@mui/material/Button";
3
- import { Box, CircularProgress, IconButton } from "@mui/material";
4
- import { jsx as _jsx } from "react/jsx-runtime";
5
- import { jsxs as _jsxs } from "react/jsx-runtime";
6
- export default function Button({
7
- label,
8
- icon,
9
- iconPlacement = 'start',
10
- iconSize = '20px',
11
- iconProps = {},
12
- progressProps = {},
13
- loading = false,
14
- ...props
15
- }) {
16
- const iconComponent = useMemo(() => {
17
- return icon ? /*#__PURE__*/_jsx(Box, {
18
- component: icon,
19
- sx: {
20
- '&.MuiSvgIcon-root': {
21
- fontSize: `${iconSize}!important`
22
- }
23
- },
24
- ...iconProps
25
- }) : null;
26
- }, [icon, iconSize, iconProps]);
27
- const startIcon = useMemo(() => {
28
- return iconPlacement === 'start' ? iconComponent : null;
29
- }, [iconComponent, iconPlacement]);
30
- const endIcon = useMemo(() => {
31
- return iconPlacement === 'end' ? iconComponent : null;
32
- }, [iconComponent, iconPlacement]);
33
- return /*#__PURE__*/_jsxs(Box, {
34
- sx: {
35
- position: 'relative',
36
- width: 'fit-content'
37
- },
38
- children: [label ? /*#__PURE__*/_jsx(MuiButton, {
39
- startIcon: startIcon,
40
- endIcon: endIcon,
41
- disabled: loading,
42
- ...props,
43
- children: label
44
- }) : /*#__PURE__*/_jsx(IconButton, {
45
- disabled: loading,
46
- ...props,
47
- children: iconComponent
48
- }), loading && /*#__PURE__*/_jsx(CircularProgress, {
49
- size: 24,
50
- thickness: 6,
51
- sx: {
52
- position: 'absolute',
53
- top: '50%',
54
- left: '50%',
55
- marginTop: '-12px',
56
- marginLeft: '-12px'
57
- },
58
- ...progressProps
59
- })]
60
- });
61
- }
package/dist/Checkbox.js DELETED
@@ -1,27 +0,0 @@
1
- import { useMemo } from "react";
2
- import MuiCheckbox from "@mui/material/Checkbox";
3
- import { FormControlLabel } from "@mui/material";
4
- import { jsx as _jsx } from "react/jsx-runtime";
5
- export default function Checkbox({
6
- label,
7
- size = 'medium',
8
- sx,
9
- ...props
10
- }) {
11
- const styles = useMemo(() => ({
12
- '& .MuiFormControlLabel-label': {
13
- fontSize: size === 'small' ? '14px' : '16px'
14
- }
15
- }), [size]);
16
- return /*#__PURE__*/_jsx(FormControlLabel, {
17
- label: label,
18
- control: /*#__PURE__*/_jsx(MuiCheckbox, {
19
- size: size,
20
- ...props
21
- }),
22
- sx: {
23
- ...styles,
24
- ...sx
25
- }
26
- });
27
- }
@@ -1,33 +0,0 @@
1
- import { Box, Typography } from "@mui/material";
2
- import MuiCircularProgress from "@mui/material/CircularProgress";
3
- import { jsx as _jsx } from "react/jsx-runtime";
4
- import { jsxs as _jsxs } from "react/jsx-runtime";
5
- export default function CircularProgress(props) {
6
- return /*#__PURE__*/_jsxs(Box, {
7
- sx: {
8
- position: 'relative',
9
- display: 'inline-flex'
10
- },
11
- children: [/*#__PURE__*/_jsx(MuiCircularProgress, {
12
- variant: "determinate",
13
- ...props
14
- }), /*#__PURE__*/_jsx(Box, {
15
- sx: {
16
- top: 0,
17
- left: 0,
18
- bottom: 0,
19
- right: 0,
20
- position: 'absolute',
21
- display: 'flex',
22
- alignItems: 'center',
23
- justifyContent: 'center'
24
- },
25
- children: /*#__PURE__*/_jsx(Typography, {
26
- variant: "caption",
27
- component: "div",
28
- color: "text.secondary",
29
- children: `${Math.round(props.value)}%`
30
- })
31
- })]
32
- });
33
- }