diginet-core-ui 1.4.65-beta.2 → 1.4.66-beta.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.
@@ -0,0 +1,15 @@
1
+ <svg width="39" height="39" viewBox="0 0 39 39" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <g clip-path="url(#clip0_2813_38)">
3
+ <path d="M9.70007 26.7C9.70007 27.3 10.1001 27.8 10.7001 28V25.4C10.1001 25.5 9.70007 26 9.70007 26.7Z" fill="#FF8C00"/>
4
+ <path d="M13.4001 31.5C13.3001 30.9 12.9001 30.4 12.4001 30.4V33C13.1001 32.7 13.5001 32.2 13.4001 31.5Z" fill="#FF8C00"/>
5
+ <path d="M18.7001 38.3V22.3C17.7001 21.1 16.6001 20 15.2001 19.1C15.1001 19 14.9001 19 14.8001 19C14.0001 19 13.2001 19.1 12.4001 19.1C12.1001 19.1 11.9001 19.1 11.6001 19.1C11.3001 19.1 11.1001 19.1 10.8001 19.1C10.0001 19.1 9.20007 19.1 8.40007 19C8.30007 19 8.10007 19 8.00007 19.1C6.50007 20 5.30007 21.2 4.30007 22.6C2.40007 25 1.00007 27.7 0.300074 30.7C7.42078e-05 32.2 -0.199926 33.6 0.200074 35.1C0.600074 36.5 1.40007 37.5 2.70007 38C3.80007 38.5 7.00007 39 7.00007 39C8.20007 39 9.30007 39 10.5001 39C10.9001 39 11.2001 39 11.6001 39C11.9001 39 12.3001 39 12.7001 39C13.9001 39 15.0001 39 16.2001 39C16.1001 39 18.7001 38.4 18.7001 38.3ZM12.9001 28.4C14.3001 28.9 15.2001 30 15.3001 31.5C15.4001 33 14.4001 34.2 13.0001 34.6C12.4001 34.8 12.4001 34.8 12.4001 35.4V36.1H10.8001C10.8001 35.7 10.8001 35.4 10.8001 35C10.8001 34.8 10.7001 34.7 10.5001 34.6C9.20007 34.2 8.30007 33.4 7.90007 32C7.80007 31.7 7.80007 31.4 7.80007 31.1H9.80007C9.80007 31.8 10.1001 32.2 10.8001 32.5V30C10.7001 30 10.5001 29.9 10.3001 29.9C8.80007 29.4 7.80007 28.2 7.90007 26.7C7.90007 25.2 8.90007 24 10.3001 23.6C10.8001 23.5 10.8001 23.5 10.8001 23V22.1H12.4001C12.4001 22.5 12.4001 22.9 12.4001 23.2C12.4001 23.4 12.5001 23.5 12.7001 23.6C14.0001 24 14.9001 24.8 15.3001 26.1C15.5001 27 15.5001 27 14.6001 27H13.4001C13.4001 26.3 13.1001 25.8 12.4001 25.5V28.2C12.5001 28.3 12.7001 28.3 12.9001 28.4Z" fill="#FF8C00"/>
6
+ <path d="M8.80007 17.7C8.60007 17.7 8.50007 17.6 8.40007 17.5C7.40007 16.1 6.40007 14.7 5.60007 13.2C5.30007 12.6 5.10007 12 4.90007 11.4C4.80007 11.2 4.90007 11 4.90007 10.8C4.90007 10.5 5.10007 10.3 5.50007 10.3C5.80007 10.3 6.10007 10.4 6.40007 10.5C6.90007 10.7 7.40007 10.9 7.90007 11.1C8.60007 11.4 9.30007 11.3 9.90007 10.8C10.1001 10.6 10.4001 10.4 10.7001 10.3C11.3001 9.9 11.9001 9.9 12.5001 10.3C12.8001 10.5 13.2001 10.7 13.5001 11C13.9001 11.3 14.4001 11.4 14.9001 11.3C15.5001 11.1 16.1001 10.9 16.7001 10.7C17.0001 10.6 17.3001 10.5 17.6001 10.5C18.0001 10.4 18.2001 10.6 18.2001 11C18.2001 11.4 18.1001 11.9 18.0001 12.3C17.6001 13.5 16.9001 14.5 16.2001 15.5C15.7001 16.2 15.2001 16.9 14.7001 17.6C14.6001 17.7 14.5001 17.8 14.4001 17.8C13.5001 17.7 9.70007 17.7 8.80007 17.7Z" fill="#FF8C00"/>
7
+ <path d="M31.1 7.8C31 8.1 30.7 8.2 30.4 8.3H27.6V14.5L23.6 18.5C23.1 19 23 19.7 23.2 20.3C23.5 20.9 24.1 21.3 24.7 21.3H26.6V38.3C26.6 38.6 26.7 38.8 26.8 39H20.3C19.9 39 19.6 38.7 19.5 38.3V8.3H16.7C16.4 8.3 16.1 8.1 16 7.8C16 7.5 16.1 7.2 16.3 7L23.1 0.2C23.2 0.1 23.4 0 23.6 0C23.8 0 24 0.1 24.1 0.2L30.9 7C31.1 7.2 31.2 7.5 31.1 7.8Z" fill="#1CA261"/>
8
+ <path d="M31.4598 12C31.6598 12 31.8598 12.1 31.9598 12.2L38.7598 19C38.9598 19.2 39.0598 19.5 38.9598 19.8C38.8598 20.1 38.5598 20.2 38.2598 20.3H35.4598V38.3C35.4598 38.7 35.1598 39 34.7598 39H28.2598C27.8598 39 27.5598 38.7 27.5598 38.3V20.3H24.7598C24.4598 20.3 24.1598 20.1 24.0598 19.8C23.9598 19.5 23.9598 19.2 24.2598 19L31.0598 12.2C31.0598 12.1 31.2598 12 31.4598 12Z" fill="#FF4444"/>
9
+ </g>
10
+ <defs>
11
+ <clipPath id="clip0_2813_38">
12
+ <rect width="39" height="39" fill="white"/>
13
+ </clipPath>
14
+ </defs>
15
+ </svg>
@@ -1,7 +1,7 @@
1
1
  /** @jsxRuntime classic */
2
2
  /** @jsx jsx */
3
3
  import { css, jsx } from '@emotion/core';
4
- import { CircularProgress, Icon } from "./..";
4
+ import { CircularProgress, Icon, Tooltip } 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';
@@ -78,7 +78,8 @@ const ButtonIcon = /*#__PURE__*/memo( /*#__PURE__*/forwardRef((inProps, referenc
78
78
  style,
79
79
  viewBox,
80
80
  viewType,
81
- width
81
+ width,
82
+ title
82
83
  } = props;
83
84
  const ref = useRef(null);
84
85
  const rippleRef = useRef(null);
@@ -109,7 +110,10 @@ const ButtonIcon = /*#__PURE__*/memo( /*#__PURE__*/forwardRef((inProps, referenc
109
110
  return currentRef;
110
111
  });
111
112
  return useMemo(() => {
112
- return jsx("button", {
113
+ return jsx(Tooltip, {
114
+ title: title,
115
+ disableInteractive: !title
116
+ }, jsx("button", {
113
117
  css: [_ButtonRootCSS, _ButtonSizeCSS],
114
118
  ref: ref,
115
119
  id: id,
@@ -129,8 +133,8 @@ const ButtonIcon = /*#__PURE__*/memo( /*#__PURE__*/forwardRef((inProps, referenc
129
133
  ref: rippleRef,
130
134
  color: getRippleColor(colorProp, viewType, colors),
131
135
  circular: circular
132
- }));
133
- }, [children, circular, className, colorHover, colorProp, disabled, height, id, loading, name, onClick, size, style, viewBox, viewType, width, theme]);
136
+ })));
137
+ }, [children, circular, className, colorHover, colorProp, disabled, height, id, loading, name, onClick, size, style, viewBox, viewType, width, theme, title]);
134
138
  }));
135
139
  const ButtonIconCSS = iconSize => css`
136
140
  ${displayFlex};
@@ -287,18 +291,6 @@ const ButtonRootCSS = (circular, colorHover, color, name, isColorDefault, viewTy
287
291
  filter: brightness(1);
288
292
  }
289
293
  `;
290
-
291
- // ButtonIcon.defaultProps = {
292
- // circular: false,
293
- // className: '',
294
- // color: 'default',
295
- // colorHover: 'system/active',
296
- // disabled: false,
297
- // size: 'medium',
298
- // viewBox: true,
299
- // viewType: 'outlined',
300
- // };
301
-
302
294
  ButtonIcon.propTypes = {
303
295
  /** The content of the component. */
304
296
  children: PropTypes.node,
@@ -314,20 +306,22 @@ ButtonIcon.propTypes = {
314
306
  disabled: PropTypes.bool,
315
307
  /** Height oof the component. */
316
308
  height: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
309
+ /** Title of hover tooltip */
310
+ title: PropTypes.string,
317
311
  /** If `true`, the loading indicator is shown. */
318
312
  loading: PropTypes.bool,
319
313
  /** Callback fired when the component is clicked. */
320
314
  onClick: PropTypes.func,
321
315
  /** Name of [icon](https://core.diginet.com.vn/ui/?path=/story/icon-basic). */
322
316
  name: PropTypes.string,
323
- /**
324
- * The size of the component.
325
- *
326
- * * tiny (button 24px, icon 16px)
327
- * * small (button 32px, icon 20px)
328
- * * medium (button 40px, icon 24px)
329
- * * large (button 48px, icon 32px)
330
- * * giant (button 56px, icon 40px)
317
+ /**
318
+ * The size of the component.
319
+ *
320
+ * * tiny (button 24px, icon 16px)
321
+ * * small (button 32px, icon 20px)
322
+ * * medium (button 40px, icon 24px)
323
+ * * large (button 48px, icon 32px)
324
+ * * giant (button 56px, icon 40px)
331
325
  * */
332
326
  size: PropTypes.oneOf(['tiny', 'small', 'medium', 'large', 'giant', 'extraGiant']),
333
327
  /** Style inline of component. */
@@ -338,19 +332,19 @@ ButtonIcon.propTypes = {
338
332
  viewType: PropTypes.oneOf(['text', 'outlined', 'filled', 'ghost']),
339
333
  /** Width of the component. */
340
334
  width: PropTypes.oneOfType([PropTypes.number, PropTypes.string])
341
- /**
342
- * ref methods (ref.current.instance.*method*)
343
- *
344
- * * option(): Gets all UI component properties
345
- * * Returns value - object
346
- * * option(optionName): Gets the value of a single property
347
- * * @param {optionName} - string
348
- * * Returns value - any
349
- * * option(optionName, optionValue): Updates the value of a single property
350
- * * @param {optionName} - string
351
- * * @param {optionValue} - any
352
- * * option(options): Updates the values of several properties
353
- * * @param {options} - object
335
+ /**
336
+ * ref methods (ref.current.instance.*method*)
337
+ *
338
+ * * option(): Gets all UI component properties
339
+ * * Returns value - object
340
+ * * option(optionName): Gets the value of a single property
341
+ * * @param {optionName} - string
342
+ * * Returns value - any
343
+ * * option(optionName, optionValue): Updates the value of a single property
344
+ * * @param {optionName} - string
345
+ * * @param {optionValue} - any
346
+ * * option(options): Updates the values of several properties
347
+ * * @param {options} - object
354
348
  */
355
349
  };
356
350
  export { ButtonIcon };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "diginet-core-ui",
3
- "version": "1.4.65-beta.2",
3
+ "version": "1.4.66-beta.1",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "license": "UNLICENSED",
package/readme.md CHANGED
@@ -41,6 +41,12 @@ npm test
41
41
  ```
42
42
 
43
43
  ## Changelog
44
+
45
+ ## 1.4.66
46
+ - \[Added\]: Icon – Add Icon Import
47
+ - \[Added\]: Icon – Add IconMenu W109F1000, W110F1000
48
+ - \[Added\]: ButtonIcon – Use the title prop to show text on hover for the ButtonIcon
49
+
44
50
  ## 1.4.65
45
51
  - \[Added\]: Icon – Add Icon OpenNew
46
52
  - \[Added\]: Icon – Add IconMenu WEO53TR001, WEO53APP01