diginet-core-ui 1.3.93-beta.4 → 1.3.94

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.
@@ -301,14 +301,14 @@ ButtonIcon.propTypes = {
301
301
  onClick: PropTypes.func,
302
302
  /** Name of [icon](https://core.diginet.com.vn/ui/?path=/story/icon-basic). */
303
303
  name: PropTypes.string,
304
- /**
305
- * The size of the component.
306
- *
307
- * * tiny (button 24px, icon 16px)
308
- * * small (button 32px, icon 20px)
309
- * * medium (button 40px, icon 24px)
310
- * * large (button 48px, icon 32px)
311
- * * giant (button 56px, icon 40px)
304
+ /**
305
+ * The size of the component.
306
+ *
307
+ * * tiny (button 24px, icon 16px)
308
+ * * small (button 32px, icon 20px)
309
+ * * medium (button 40px, icon 24px)
310
+ * * large (button 48px, icon 32px)
311
+ * * giant (button 56px, icon 40px)
312
312
  * */
313
313
  size: PropTypes.oneOf(['tiny', 'small', 'medium', 'large', 'giant', 'extraGiant']),
314
314
  /** Style inline of component. */
@@ -319,19 +319,19 @@ ButtonIcon.propTypes = {
319
319
  viewType: PropTypes.oneOf(['text', 'outlined', 'filled', 'ghost']),
320
320
  /** Width of the component. */
321
321
  width: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
322
- /**
323
- * ref methods (ref.current.instance.*method*)
324
- *
325
- * * option(): Gets all UI component properties
326
- * * Returns value - object
327
- * * option(optionName): Gets the value of a single property
328
- * * @param {optionName} - string
329
- * * Returns value - any
330
- * * option(optionName, optionValue): Updates the value of a single property
331
- * * @param {optionName} - string
332
- * * @param {optionValue} - any
333
- * * option(options): Updates the values of several properties
334
- * * @param {options} - object
322
+ /**
323
+ * ref methods (ref.current.instance.*method*)
324
+ *
325
+ * * option(): Gets all UI component properties
326
+ * * Returns value - object
327
+ * * option(optionName): Gets the value of a single property
328
+ * * @param {optionName} - string
329
+ * * Returns value - any
330
+ * * option(optionName, optionValue): Updates the value of a single property
331
+ * * @param {optionName} - string
332
+ * * @param {optionValue} - any
333
+ * * option(options): Updates the values of several properties
334
+ * * @param {options} - object
335
335
  */
336
336
  reference: ref
337
337
  };
@@ -405,19 +405,19 @@ Button.propTypes = {
405
405
  urlParams: PropTypes.object,
406
406
  /** The variant to use. */
407
407
  viewType: PropTypes.oneOf(['text', 'outlined', 'filled', 'link']),
408
- /**
409
- * ref methods (ref.current.instance.*method*)
410
- *
411
- * * option(): Gets all UI component properties
412
- * * Returns value - object
413
- * * option(optionName): Gets the value of a single property
414
- * * @param {optionName} - string
415
- * * Returns value - any
416
- * * option(optionName, optionValue): Updates the value of a single property
417
- * * @param {optionName} - string
418
- * * @param {optionValue} - any
419
- * * option(options): Updates the values of several properties
420
- * * @param {options} - object
408
+ /**
409
+ * ref methods (ref.current.instance.*method*)
410
+ *
411
+ * * option(): Gets all UI component properties
412
+ * * Returns value - object
413
+ * * option(optionName): Gets the value of a single property
414
+ * * @param {optionName} - string
415
+ * * Returns value - any
416
+ * * option(optionName, optionValue): Updates the value of a single property
417
+ * * @param {optionName} - string
418
+ * * @param {optionValue} - any
419
+ * * option(options): Updates the values of several properties
420
+ * * @param {options} - object
421
421
  */
422
422
  ref: ref
423
423
  };
@@ -3,7 +3,7 @@
3
3
  import { css, jsx } from '@emotion/core';
4
4
  import { ButtonIcon, Icon, Popover, Typography } from "./..";
5
5
  import PropTypes from 'prop-types';
6
- import React, { forwardRef, isValidElement, memo, useImperativeHandle, useMemo, useRef, useState } from 'react';
6
+ import { forwardRef, isValidElement, memo, useImperativeHandle, useMemo, useRef, useState } from 'react';
7
7
  import { bgColor, borderNone, cursorPointer, displayFlex, flexCol, flexRow, gap, itemsCenter, outlineNone, parseHeight, pd, pdl } from "../../styles/general";
8
8
  import { useTheme } from "../../theme";
9
9
  import { classNames, refType as ref } from "../../utils";
@@ -88,7 +88,7 @@ const ButtonMore = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
88
88
  const renderAnchor = () => {
89
89
  var _anchor, _anchor2, _anchor2$props;
90
90
  if (!((_anchor = anchor) !== null && _anchor !== void 0 && _anchor.type)) return null;
91
- const AnchorTag = /*#__PURE__*/React.cloneElement(anchor, {
91
+ const AnchorTag = React.cloneElement(anchor, {
92
92
  ref: ref => {
93
93
  anchor = ref;
94
94
  },
@@ -187,19 +187,19 @@ ButtonMore.propTypes = {
187
187
  popoverProp: PropTypes.object,
188
188
  /** Style inline of component. */
189
189
  style: PropTypes.object,
190
- /**
191
- * ref methods (ref.current.instance.*method*)
192
- *
193
- * * option(): Gets all UI component properties
194
- * * Returns value - object
195
- * * option(optionName): Gets the value of a single property
196
- * * @param {optionName} - string
197
- * * Returns value - any
198
- * * option(optionName, optionValue): Updates the value of a single property
199
- * * @param {optionName} - string
200
- * * @param {optionValue} - any
201
- * * option(options): Updates the values of several properties
202
- * * @param {options} - object
190
+ /**
191
+ * ref methods (ref.current.instance.*method*)
192
+ *
193
+ * * option(): Gets all UI component properties
194
+ * * Returns value - object
195
+ * * option(optionName): Gets the value of a single property
196
+ * * @param {optionName} - string
197
+ * * Returns value - any
198
+ * * option(optionName, optionValue): Updates the value of a single property
199
+ * * @param {optionName} - string
200
+ * * @param {optionValue} - any
201
+ * * option(options): Updates the values of several properties
202
+ * * @param {options} - object
203
203
  */
204
204
  reference: ref
205
205
  };
@@ -1292,8 +1292,7 @@ Attachment.defaultProps = {
1292
1292
  maxSize: getGlobal(['errorDefault', 'maxSize']),
1293
1293
  fileType: getGlobal(['errorDefault', 'fileType']),
1294
1294
  existingFile: getGlobal(['errorDefault', 'existingFile'])
1295
- },
1296
- viewType: 'detail'
1295
+ }
1297
1296
  };
1298
1297
  Attachment.propTypes = {
1299
1298
  /** File types that can be accepted. */
@@ -4,8 +4,18 @@ import { css, jsx } from '@emotion/core';
4
4
  import OptionWrapper from "../others/option-wrapper";
5
5
  import PropTypes from 'prop-types';
6
6
  import { forwardRef, memo, useImperativeHandle, useMemo, useRef } from 'react';
7
- import { bgColor, border, borderRadius, displayFlex, flexCol, order, overflowAuto, parseWidth, pd, positionRelative } from "../../styles/general";
7
+ import { flexCol, overflowAuto, positionRelative } from "../../styles/general";
8
+ import { useTheme } from "../../theme";
8
9
  import { classNames } from "../../utils";
10
+ const {
11
+ colors: {
12
+ fill: {
13
+ 'scrollbar-rest': fillScrollbarRest,
14
+ 'scrollbar-active': fillScrollbarActive
15
+ }
16
+ },
17
+ spacing
18
+ } = useTheme();
9
19
  const PopoverBody = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
10
20
  action = {},
11
21
  children,
@@ -13,7 +23,6 @@ const PopoverBody = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
13
23
  id,
14
24
  style
15
25
  }, reference) => {
16
- if (!reference) reference = useRef(null);
17
26
  const ref = useRef(null);
18
27
  useImperativeHandle(reference, () => {
19
28
  const currentRef = ref.current || {};
@@ -34,23 +43,22 @@ const PopoverBody = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
34
43
  }, children), [children, className, id, style]);
35
44
  }));
36
45
  const PopoverBodyCSS = css`
37
- ${displayFlex};
38
46
  ${flexCol};
39
47
  ${positionRelative};
40
48
  ${overflowAuto};
41
- ${pd([4])};
42
- ${order(2)};
49
+ padding: ${spacing([4])};
50
+ order: 2;
43
51
  &::-webkit-scrollbar {
44
- ${parseWidth(24)};
52
+ width: 24px;
45
53
  }
46
54
  &::-webkit-scrollbar-thumb {
47
- ${borderRadius(10)};
55
+ border-radius: 10px;
48
56
  mix-blend-mode: normal;
49
- ${bgColor('fill/scrollbar_rest')};
57
+ background-color: ${fillScrollbarRest};
50
58
  background-clip: content-box;
51
- ${border(8, 'transparent')};
59
+ border: 8px solid transparent;
52
60
  :hover {
53
- ${bgColor('fill/scrollbar_hover')};
61
+ background-color: ${fillScrollbarActive};
54
62
  }
55
63
  }
56
64
  `;
@@ -4,8 +4,17 @@ import { css, jsx } from '@emotion/core';
4
4
  import OptionWrapper from "../others/option-wrapper";
5
5
  import PropTypes from 'prop-types';
6
6
  import { forwardRef, memo, useImperativeHandle, useMemo, useRef } from 'react';
7
- import { bgColor, boxBorder, displayFlex, flexRow, itemsCenter, justifyEnd, order, parseMinHeight, parseWidth, pd, positionRelative } from "../../styles/general";
7
+ import { itemsCenter, boxBorder, flexRow, justifyEnd, parseWidth, positionRelative } from "../../styles/general";
8
+ import { useTheme } from "../../theme";
8
9
  import { classNames } from "../../utils";
10
+ const {
11
+ colors: {
12
+ system: {
13
+ white: systemWhite
14
+ }
15
+ },
16
+ spacing
17
+ } = useTheme();
9
18
  const PopoverFooter = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
10
19
  action = {},
11
20
  boxShadow,
@@ -14,7 +23,6 @@ const PopoverFooter = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
14
23
  id,
15
24
  style
16
25
  }, reference) => {
17
- if (!reference) reference = useRef(null);
18
26
  const ref = useRef(null);
19
27
  const _PopoverFooterCSS = PopoverFooterCSS(boxShadow);
20
28
  useImperativeHandle(reference, () => {
@@ -36,19 +44,18 @@ const PopoverFooter = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
36
44
  }, children), [boxShadow, children, className, id, style]);
37
45
  }));
38
46
  const PopoverFooterCSS = boxShadow => css`
39
- ${displayFlex};
40
47
  ${flexRow};
41
48
  ${positionRelative};
42
49
  ${itemsCenter};
43
50
  ${justifyEnd};
44
51
  ${boxBorder};
45
52
  ${parseWidth('100%')};
46
- ${parseMinHeight(56)};
47
- ${pd([4])};
48
- ${bgColor('system/white')};
53
+ min-height: 56px;
54
+ padding: ${spacing([4])};
55
+ background: ${systemWhite};
49
56
  border-radius: 0px 0px 4px 4px;
50
57
  box-shadow: ${boxShadow ? '0px -2px 2px rgba(0, 0, 0, 0.1)' : 'none'};
51
- ${order(3)};
58
+ order: 3;
52
59
  `;
53
60
  PopoverFooter.defaultProps = {
54
61
  className: '',
@@ -5,8 +5,18 @@ import { Typography } from "./..";
5
5
  import OptionWrapper from "../others/option-wrapper";
6
6
  import PropTypes from 'prop-types';
7
7
  import { forwardRef, memo, useImperativeHandle, useMemo, useRef } from 'react';
8
- import { bgColor, boxBorder, displayFlex, flexRow, itemsCenter, order, parseWidthHeight, pd, positionRelative, z } from "../../styles/general";
8
+ import { itemsCenter, boxBorder, flexRow, parseWidthHeight, positionRelative } from "../../styles/general";
9
+ import { useTheme } from "../../theme";
9
10
  import { classNames } from "../../utils";
11
+ const {
12
+ colors: {
13
+ fill: {
14
+ headerbar: fillHeaderbar
15
+ }
16
+ },
17
+ spacing,
18
+ zIndex: zIndexCORE
19
+ } = useTheme();
10
20
  const PopoverHeader = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
11
21
  action = {},
12
22
  children,
@@ -15,7 +25,6 @@ const PopoverHeader = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
15
25
  style,
16
26
  title
17
27
  }, reference) => {
18
- if (!reference) reference = useRef(null);
19
28
  const ref = useRef(null);
20
29
  useImperativeHandle(reference, () => {
21
30
  const currentRef = ref.current || {};
@@ -44,18 +53,17 @@ const PopoverHeader = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
44
53
  }, children ? children : title)), [children, className, id, style, title]);
45
54
  }));
46
55
  const PopoverHeaderCSS = css`
47
- ${displayFlex};
48
56
  ${flexRow};
49
57
  ${itemsCenter};
50
58
  ${positionRelative};
51
59
  ${boxBorder};
52
60
  ${parseWidthHeight('100%', 56)};
53
- ${bgColor('fill/headerbar')};
54
- ${pd([4])};
61
+ background-color: ${fillHeaderbar};
62
+ padding: ${spacing([4])};
55
63
  border-radius: 4px 4px 0px 0px;
56
64
  box-shadow: 0px 2px 2px rgba(0, 0, 0, 0.25);
57
- ${order(1)};
58
- ${z(1)};
65
+ order: 1;
66
+ z-index: ${zIndexCORE(1)};
59
67
  `;
60
68
  PopoverHeader.defaultProps = {
61
69
  title: '',
@@ -126,7 +126,6 @@ const Popover = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
126
126
  height,
127
127
  marginThreshold,
128
128
  onClose,
129
- onOpen,
130
129
  open,
131
130
  pressESCToClose,
132
131
  style,
@@ -154,7 +153,6 @@ const Popover = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
154
153
  }
155
154
  const onOpenPopover = () => {
156
155
  if (!openState) setOpenState(true);
157
- onOpen && onOpen();
158
156
  };
159
157
  const onClosePopover = () => {
160
158
  if (openState) {
@@ -537,7 +535,7 @@ Popover.defaultProps = {
537
535
  horizontal: 'center'
538
536
  },
539
537
  arrow: false,
540
- bgColor: 'system/white',
538
+ bgColor: 'system.white',
541
539
  className: '',
542
540
  clickOutsideToClose: true,
543
541
  fullScreen: true,
@@ -590,8 +588,6 @@ Popover.propTypes = {
590
588
  marginThreshold: PropTypes.number,
591
589
  /** Callback fired when the component requests to be closed. */
592
590
  onClose: PropTypes.func,
593
- /** Callback fired when the component requests to be opened. */
594
- onOpen: PropTypes.func,
595
591
  /** If `true`, the component is shown. */
596
592
  open: PropTypes.bool,
597
593
  /** If `true`, hitting escape will close component. */
@@ -620,7 +616,7 @@ Popover.propTypes = {
620
616
  * * setPosition(element): Set position of popover
621
617
  * * @param {element} - element
622
618
  */
623
- ref: ref
619
+ reference: ref
624
620
  };
625
621
  export { Popover };
626
622
  export default OptionWrapper(Popover);
@@ -143,16 +143,16 @@ Typography.defaultProps = {
143
143
  type: 'p1'
144
144
  };
145
145
 
146
- /** type of text<br/>
147
- * h1: Title <br/>
148
- * h2: Header Popup <br/>
149
- * h3: Header popup <br/>
150
- * h4: Button, Tab, Title group <br/>
151
- * h5: Label column, Title group <br/>
152
- * h6: Label form <br/>
153
- * p1: Body text <br/>
154
- * p2: Body text <br/>
155
- * p3: Notice, Tooltip <br/>
146
+ /** type of text<br/>
147
+ * h1: Title <br/>
148
+ * h2: Header Popup <br/>
149
+ * h3: Header popup <br/>
150
+ * h4: Button, Tab, Title group <br/>
151
+ * h5: Label column, Title group <br/>
152
+ * h6: Label form <br/>
153
+ * p1: Body text <br/>
154
+ * p2: Body text <br/>
155
+ * p3: Notice, Tooltip <br/>
156
156
  */
157
157
  export const arrTypeTypography = ['t1', 't2', 't3', 't4', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'p1', 'p2', 'p3', 'title1', 'title2', 'title3', 'title4', 'heading1', 'heading2', 'heading3', 'heading4', 'heading5', 'heading6', 'paragraph1', 'paragraph2', 'paragraph3'];
158
158
  Typography.propTypes = {
package/package.json CHANGED
@@ -1,73 +1,42 @@
1
1
  {
2
2
  "name": "diginet-core-ui",
3
- "version": "1.3.93-beta.4",
4
- "description": "",
3
+ "version": "1.3.94",
4
+ "description": "The DigiNet core ui",
5
+ "homepage": "https://diginet.com.vn",
5
6
  "main": "index.js",
6
- "license": "UNLICENSED",
7
7
  "scripts": {
8
- "start": "npm-run-all --parallel start-sb eslint-test",
9
- "start-sb": "start-storybook -p 9050",
10
- "build-storybook": "build-storybook -c .storybook -s src",
11
- "build": "run-script-os",
12
- "build:windows": "rimraf dist && mkdirp dist/components && npm run compile && sass --style=compressed src/scss:dist/css && xcopy src\\\\assets dist\\\\assets\\ /e /y",
13
- "build:darwin:linux:default": "rm -rf dist && npm run compile && sass --style=compressed src/scss:dist/css && cp -rf src/assets dist/assets",
14
- "compile": "babel src --out-dir dist --ignore **/*.stories.js",
15
- "pack": "npm run build && cp *.md dist/ && npm run version:bump --silent && npm run version:add --silent && cd dist && npm pack",
16
- "production-keep-version": "npm run build && cp *.md dist/ && cp package.json dist/ && cd dist && npm publish",
17
- "beta": "npm run build && cp *.md dist/ && cp package.json dist/ && cd dist && npm publish --tag beta",
18
- "production": "npm run build && cp *.md dist/ && npm run version:bump --silent && npm run version:add --silent && cd dist && npm publish",
19
- "version:add": "run-script-os",
20
- "version:add:windows": "cat package.json.tmp | sed \"s/0.0.0/%npm_package_version%/g\" > dist/package.json",
21
- "version:add:darwin:linux:default": "VERSION=$(npm run version:extract --silent) && cat package.json.tmp | sed \"s/0.0.0/${VERSION}/g\" > dist/package.json",
22
- "version:bump": "npm version patch --no-git-tag-version --silent",
23
- "version:extract": "cat package.json | grep version | head -1 | awk -F: '{ print $2 }' | sed 's/[\",]//g' | tr -d '[[:space:]]'",
24
- "test": "echo \"Error: no test specified\" && exit 1",
25
- "lint": "eslint --fix --config .eslintrc.js \"**/*.js\"",
26
- "eslint-test": "onchange \"src/**/*.{js,jsx,json}\" -- eslint . --fix",
27
- "test-storybook": "test-storybook --url http://localhost:9050"
8
+ "start-js": "react-scripts start --max_old_space_size=4096",
9
+ "start": "npx npm-run-all -p start-js",
10
+ "build": "GENERATE_SOURCEMAP=false && react-scripts build --env=production --max_old_space_size=8192",
11
+ "eject": "react-scripts eject",
12
+ "test": "echo \"Error: no test specified\" && exit 1"
28
13
  },
29
14
  "dependencies": {
30
15
  "@emotion/core": "^10.0.35",
31
- "babel-plugin-module-resolver": "^4.1.0",
32
16
  "prop-types": "^15.7.2"
33
17
  },
34
- "lint-staged": {
35
- "*/**/*.{js,jsx,json}": [
36
- "prettier --write",
37
- "git add"
38
- ]
18
+ "repository": {
19
+ "type": "git",
20
+ "url": "git+https://diginetvn@bitbucket.org/diginetvn/diginet-core-ui.git"
39
21
  },
40
- "devDependencies": {
41
- "@babel/cli": "^7.14.3",
42
- "@babel/plugin-proposal-class-properties": "^7.13.0",
43
- "@babel/plugin-proposal-logical-assignment-operators": "^7.16.0",
44
- "@babel/plugin-proposal-nullish-coalescing-operator": "^7.16.0",
45
- "@babel/plugin-proposal-optional-chaining": "^7.14.2",
46
- "@babel/plugin-proposal-private-methods": "^7.18.6",
47
- "@babel/plugin-proposal-private-property-in-object": "^7.18.6",
48
- "@babel/preset-react": "^7.13.13",
49
- "@storybook/addon-actions": "6.2.9",
50
- "@storybook/addon-essentials": "6.2.9",
51
- "@storybook/addon-links": "6.2.9",
52
- "@storybook/addon-postcss": "^2.0.0",
53
- "@storybook/react": "6.2.9",
54
- "@storybook/test-runner": "^0.7.1",
55
- "autoprefixer": "^10.3.1",
56
- "babel-loader": "^8.2.2",
57
- "eslint": "^8.4.1",
58
- "eslint-plugin-react": "^7.27.1",
59
- "eslint-plugin-regex": "^1.10.0",
60
- "husky": "^7.0.4",
61
- "jest": "^27.5.1",
62
- "lint-staged": "^12.1.2",
63
- "mkdirp": "^1.0.4",
64
- "npm-run-all": "^4.1.5",
65
- "onchange": "^7.1.0",
66
- "postcss-flexbugs-fixes": "^5.0.2",
67
- "react": "^17.0.1",
68
- "react-dom": "^17.0.1",
69
- "rimraf": "^3.0.2",
70
- "run-script-os": "^1.1.6",
71
- "sass": "^1.37.0"
72
- }
22
+ "keywords": [
23
+ "core ui",
24
+ "diginet"
25
+ ],
26
+ "author": "rocachien",
27
+ "contributors": [
28
+ {
29
+ "name": "Chien Do",
30
+ "email": "rocachien@gmail.com"
31
+ },
32
+ {
33
+ "name": "Nhat Tran",
34
+ "email": "tranminhnhat1005@gmail.com"
35
+ },
36
+ {
37
+ "name": "Thuan Nguyen",
38
+ "email": "nt.thuan.hutech@gmail.com"
39
+ }
40
+ ],
41
+ "license": "MIT"
73
42
  }
package/readme.md CHANGED
@@ -38,6 +38,14 @@ npm test
38
38
  ```
39
39
 
40
40
  ## Changelog
41
+ ## 1.3.94
42
+ - \[Changed\]: Breadcrumb – Update design
43
+ - \[Changed\]: Button – Add text sentence for Button
44
+ - \[Changed\]: Accordion – Add prop fullHeight
45
+ - \[Changed\]: Divider – Optimize code
46
+ - \[Changed\]: Icon – Add color default
47
+ - \[Fixed\]: Accordion – Fix UI background color
48
+
41
49
  ## 1.3.93
42
50
  - \[Changed\]: Dropdown – Apply multilineSelectedItem to renderSelectedItem
43
51
  - \[Fixed\]: Checkbox – Fix bug still uncheck when not set state