diginet-core-ui 1.3.24 → 1.3.29

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 (153) hide show
  1. package/assets/fonts/SF-Pro-Display-Bold.otf +0 -0
  2. package/assets/fonts/SF-Pro-Display-Medium.otf +0 -0
  3. package/assets/fonts/SF-Pro-Display-Regular.otf +0 -0
  4. package/assets/images/icons/wifi.svg +3 -0
  5. package/assets/images/menu/dhr/MHRM09N0004.svg +14 -0
  6. package/assets/images/menu/dhr/MHRP09N0028.svg +6 -0
  7. package/assets/images/menu/dhr/MHRP09N0029.svg +14 -0
  8. package/assets/images/menu/dhr/MHRP09N0030.svg +4 -0
  9. package/assets/images/menu/dhr/MHRP09N0031.svg +5 -0
  10. package/assets/images/menu/dhr/MHRP29N0012.svg +7 -0
  11. package/assets/images/menu/dhr/MHRP29N0021.svg +8 -0
  12. package/assets/images/menu/dhr/MHRP29N0022.svg +9 -0
  13. package/assets/images/menu/dhr/MHRP29N0023.svg +22 -0
  14. package/assets/images/menu/dhr/MHRP39N0015.svg +5 -0
  15. package/assets/images/menu/dhr/TASK.svg +9 -0
  16. package/assets/images/menu/erp/D05.svg +8 -0
  17. package/assets/images/menu/erp/D06.svg +4 -0
  18. package/assets/images/menu/erp/D90R.svg +9 -0
  19. package/assets/images/menu/erp/DBC.svg +9 -0
  20. package/assets/images/menu/erp/{W05F0006.svg → W05F0006N0000.svg} +0 -0
  21. package/assets/images/menu/erp/{W05F0008.svg → W05F0008N0000.svg} +0 -0
  22. package/assets/images/menu/erp/{W05F4000.svg → W05F4000N0000.svg} +0 -0
  23. package/assets/images/menu/erp/{W06F0005.svg → W06F0005N0000.svg} +0 -0
  24. package/assets/images/menu/erp/{W06F0006.svg → W06F0006N0000.svg} +0 -0
  25. package/assets/images/menu/erp/{W06F0008.svg → W06F0008N0000.svg} +0 -0
  26. package/assets/images/menu/erp/W94F1000N0000.svg +9 -0
  27. package/assets/images/menu/erp/W94F1000N0001.svg +9 -0
  28. package/components/accordion/css.js +42 -33
  29. package/components/accordion/details.js +29 -17
  30. package/components/accordion/group.js +23 -23
  31. package/components/accordion/index.js +36 -27
  32. package/components/accordion/summary.js +10 -11
  33. package/components/alert/index.js +97 -91
  34. package/components/alert/notify.js +10 -8
  35. package/components/avatar/index.js +19 -17
  36. package/components/badge/index.js +122 -139
  37. package/components/button/icon.js +242 -334
  38. package/components/button/index.js +272 -427
  39. package/components/button/more.js +4 -5
  40. package/components/button/ripple-effect.js +4 -6
  41. package/components/card/body-card.js +4 -6
  42. package/components/card/card.js +4 -8
  43. package/components/card/index.js +4 -5
  44. package/components/chart/Pie/Sector.js +4 -5
  45. package/components/chart/Pie/Sectors.js +5 -5
  46. package/components/chart/Pie/index.js +8 -9
  47. package/components/chart/Pie-v2/Sector.js +4 -5
  48. package/components/chart/Pie-v2/Sectors.js +7 -8
  49. package/components/chart/Pie-v2/index.js +11 -16
  50. package/components/chart/bar/Bar.js +2 -3
  51. package/components/chart/bar/Labels.js +9 -11
  52. package/components/chart/bar/index.js +17 -9
  53. package/components/chart/bar-v2/Bar.js +2 -3
  54. package/components/chart/bar-v2/Labels.js +9 -11
  55. package/components/chart/bar-v2/index.js +17 -9
  56. package/components/chart/line/Labels.js +8 -10
  57. package/components/chart/line/Point.js +2 -3
  58. package/components/chart/line/index.js +17 -9
  59. package/components/chart/line-v2/Labels.js +8 -10
  60. package/components/chart/line-v2/Point.js +2 -3
  61. package/components/chart/line-v2/index.js +17 -9
  62. package/components/chip/attach.js +12 -16
  63. package/components/chip/index.js +8 -11
  64. package/components/collapse/index.js +4 -5
  65. package/components/divider/index.js +27 -14
  66. package/components/form-control/attachment/index.js +143 -87
  67. package/components/form-control/calendar/function.js +24 -23
  68. package/components/form-control/calendar/index.js +2 -4
  69. package/components/form-control/calendar/range.js +3 -4
  70. package/components/form-control/checkbox/index.js +85 -71
  71. package/components/form-control/control/index.js +4 -6
  72. package/components/form-control/date-picker/index-old.js +0 -2
  73. package/components/form-control/date-picker/index.js +39 -43
  74. package/components/form-control/date-range-picker/index.js +26 -28
  75. package/components/form-control/dropdown/index.js +173 -202
  76. package/components/form-control/dropdown-box/index.js +72 -49
  77. package/components/form-control/form-group/index.js +4 -5
  78. package/components/form-control/helper-text/index.js +4 -5
  79. package/components/form-control/input-base/index.js +28 -38
  80. package/components/form-control/label/index.js +23 -13
  81. package/components/form-control/money-input/index.js +6 -6
  82. package/components/form-control/number-input/index.js +12 -14
  83. package/components/form-control/phone-input/index.js +4 -5
  84. package/components/form-control/radio/index.js +7 -15
  85. package/components/form-control/text-input/index.js +14 -24
  86. package/components/form-control/time-picker/index.js +15 -26
  87. package/components/form-control/time-picker/swiper.js +2 -4
  88. package/components/form-control/toggle/index.js +22 -18
  89. package/components/form-view/helper-text.js +4 -5
  90. package/components/form-view/index.js +4 -5
  91. package/components/form-view/input.js +5 -7
  92. package/components/form-view/label.js +2 -6
  93. package/components/list/list-item-action.js +7 -8
  94. package/components/list/list-item-icon.js +4 -5
  95. package/components/list/list-item-text.js +4 -5
  96. package/components/list/list-item.js +4 -5
  97. package/components/list/list.js +4 -5
  98. package/components/list/sub-header.js +4 -5
  99. package/components/modal/body.js +4 -6
  100. package/components/modal/footer.js +4 -6
  101. package/components/modal/header.js +8 -14
  102. package/components/modal/index.js +4 -5
  103. package/components/modal/modal.js +6 -13
  104. package/components/others/extra/index.js +4 -8
  105. package/components/others/option-wrapper/index.js +57 -0
  106. package/components/others/scrollbar/index.js +4 -5
  107. package/components/paging/page-info.js +282 -231
  108. package/components/paging/page-selector.js +4 -7
  109. package/components/popover/index.js +6 -7
  110. package/components/popup/danger_popup.js +8 -18
  111. package/components/popup/index.js +26 -34
  112. package/components/popup/proposals_popup.js +9 -16
  113. package/components/popup/v2/danger-popup.js +4 -6
  114. package/components/popup/v2/index.js +116 -98
  115. package/components/popup/v2/info-popup.js +4 -6
  116. package/components/popup/v2/success-popup.js +4 -6
  117. package/components/popup/v2/warning-popup.js +4 -6
  118. package/components/popup/v2/yes-no-popup.js +4 -6
  119. package/components/progress/circular.js +17 -26
  120. package/components/progress/linear.js +11 -13
  121. package/components/rating/index.js +114 -233
  122. package/components/slider/slider-container.js +15 -10
  123. package/components/slider/slider-item.js +10 -12
  124. package/components/status/index.js +63 -57
  125. package/components/tab/tab-container.js +26 -24
  126. package/components/tab/tab-header.js +36 -27
  127. package/components/tab/tab-panel.js +32 -15
  128. package/components/tab/tab.js +79 -80
  129. package/components/tooltip/index.js +4 -4
  130. package/components/transfer/index.js +10 -11
  131. package/components/tree-view/css.js +2 -0
  132. package/components/tree-view/index.js +14 -13
  133. package/components/typography/index.js +6 -112
  134. package/css/styles.css +1 -1
  135. package/css/styles.css.map +1 -1
  136. package/global/index.js +2 -0
  137. package/icons/basic.js +1648 -959
  138. package/icons/effect.js +45 -103
  139. package/package.json +1 -1
  140. package/readme.md +66 -0
  141. package/styles/color-helper.js +7 -146
  142. package/styles/colors.js +6 -2
  143. package/styles/font.js +9 -0
  144. package/styles/general.js +100 -7
  145. package/styles/typography.js +25 -26
  146. package/theme/settings.js +9 -2
  147. package/theme/theme-provider.js +15 -7
  148. package/theme/with-styles.js +2 -4
  149. package/theme/with-theme.js +2 -4
  150. package/utils/isMobile.js +21 -0
  151. package/utils/renderHTML.js +4 -5
  152. package/utils/renderIcon.js +15 -11
  153. package/utils/updatePosition.js +2 -2
package/icons/effect.js CHANGED
@@ -1,59 +1,22 @@
1
- function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
-
3
1
  /** @jsxRuntime classic */
4
2
 
5
3
  /** @jsx jsx */
6
- import { memo, useRef, useEffect, useMemo, forwardRef } from 'react';
4
+ import { memo, useRef, useMemo, forwardRef } from 'react';
7
5
  import PropTypes from 'prop-types';
8
6
  import { jsx, css } from '@emotion/core';
9
- import { success5, success7, warning5, warning7, danger5, danger7, info5, info7, brand, blue13, dark1, dark4, dark6, dark12 } from '../styles/colors';
7
+ import { color as colors } from '../styles/colors';
10
8
  import * as Icons from './basic';
11
9
  import { capitalize } from '../utils';
12
- import { useTheme } from '../theme';
13
10
  const {
14
- colors
15
- } = useTheme();
16
-
17
- const getColor = name => {
18
- switch (capitalize(name)) {
19
- case 'Approval':
20
- return {
21
- color: success5,
22
- pressed: success7
23
- };
24
-
25
- case 'Delete':
26
- return {
27
- color: warning5,
28
- pressed: warning7
29
- };
30
-
31
- case 'Cancel':
32
- case 'Close':
33
- return {
34
- color: danger5,
35
- pressed: danger7
36
- };
37
-
38
- case 'Edit':
39
- case 'View':
40
- return {
41
- color: info5,
42
- pressed: info7
43
- };
44
-
45
- default:
46
- return {
47
- color: brand,
48
- pressed: '#697CCE'
49
- };
11
+ system: {
12
+ rest
50
13
  }
51
- };
52
-
14
+ } = colors;
53
15
  const Icon = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
54
16
  type,
55
17
  name,
56
18
  className,
19
+ style,
57
20
  color,
58
21
  width,
59
22
  height,
@@ -67,80 +30,62 @@ const Icon = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
67
30
  }
68
31
 
69
32
  const dgnIcon = css`
70
- display: inline-flex;
33
+ display: flex;
71
34
  justify-content: center;
72
35
  align-items: center;
73
36
  width: max-content;
74
37
  height: max-content;
75
38
  min-width: ${width ? isNaN(width) ? width : width + 'px' : '24px'};
76
39
  min-height: ${width ? isNaN(height) ? height : height + 'px' : '24px'};
77
- padding: ${viewBox ? type === 'filled' ? 0 : 4 : Math.floor((width || 24) / 8)}px;
78
- margin: ${type === 'filled' ? 4 : 0}px;
79
- color: ${type === 'filled' ? 'white' : colors[color] || color};
80
- background-color: ${type === 'filled' ? brand : 'transparent'};
81
- border-radius: 50%;
82
40
  outline: none;
83
41
  box-sizing: border-box;
84
- cursor: ${onClick ? 'pointer' : 'default'};
85
42
  user-select: none;
86
- &:hover {
87
- color: ${getColor(name).color};
88
- background-color: ${type === 'filled' ? blue13 : 'transparent'};
89
- }
90
- &:focus {
91
- color: ${type === 'filled' ? 'white' : getColor(name).pressed};
92
- background-color: ${type === 'filled' ? getColor(name).pressed : 'transparent'};
93
- }
94
- &:active {
95
- color: ${getColor(name).color};
96
- background-color: ${dark1};
97
- }
98
- &.disabled {
99
- color: ${dark4} !important;
100
- background-color: ${dark12} !important;
101
- pointer-events: none;
102
- }
103
43
  `;
104
- useEffect(() => {
105
- if (disabled && ref.current) {
106
- ref.current.classList.add('disabled');
107
- }
108
-
109
- return () => {
110
- if (disabled && ref.current) {
111
- ref.current.classList.remove('disabled');
112
- }
113
- };
114
- }, [disabled]);
115
- const IconEffect = useMemo(() => {
44
+ const NotFoundIcon = css`
45
+ display: flex;
46
+ box-sizing: border-box;
47
+ width: ${width ? isNaN(width) ? width : width + 'px' : '24px'};
48
+ height: ${width ? isNaN(width) ? width : width + 'px' : '24px'};
49
+ border: 1px dashed ${rest};
50
+ `;
51
+ return useMemo(() => {
116
52
  if (!name) return null;
53
+ let node = null;
117
54
  const IconComp = Icons[capitalize(name)];
118
- if (!IconComp) return null;
119
- return jsx("span", _extends({
55
+
56
+ if (IconComp) {
57
+ node = jsx(IconComp, {
58
+ width: width,
59
+ height: height,
60
+ color: color,
61
+ viewBox: viewBox
62
+ });
63
+ } else {
64
+ node = jsx("span", {
65
+ css: NotFoundIcon
66
+ });
67
+ }
68
+
69
+ return jsx("span", {
120
70
  className: 'DGN-UI-Icon ' + className,
71
+ style: style,
121
72
  css: dgnIcon,
122
- tabIndex: -1,
123
73
  ref: ref,
124
- onClick: onClick
125
- }, props), jsx(IconComp, {
126
- width: width,
127
- height: height,
128
- color: 'currentColor',
129
- viewBox: viewBox
130
- }));
131
- }, [name, type, color, width, height, onClick]);
132
- return IconEffect;
74
+ onClick: onClick,
75
+ ...props
76
+ }, node);
77
+ }, [name, color, width, height, className, style, viewBox, onClick]);
133
78
  }));
134
79
  Icon.defaultProps = {
135
- type: 'default',
136
80
  className: '',
137
- color: dark6,
138
- disabled: false,
139
- viewBox: false
81
+ color: rest,
82
+ viewBox: true
140
83
  };
141
84
  Icon.propTypes = {
142
- /** used to fill/non-fill background for icon */
143
- type: PropTypes.oneOf(['default', 'filled']),
85
+ /** name of icon in icons store */
86
+ name: PropTypes.string.isRequired,
87
+
88
+ /** the width of icon */
144
89
 
145
90
  /** color of icon<br />
146
91
  * default: #7F828E
@@ -150,8 +95,8 @@ Icon.propTypes = {
150
95
  /** className of icon in icons store */
151
96
  className: PropTypes.string,
152
97
 
153
- /** name of icon in icons store */
154
- name: PropTypes.string.isRequired,
98
+ /** style of icon in icons store */
99
+ style: PropTypes.object,
155
100
 
156
101
  /** the width of icon */
157
102
  width: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
@@ -162,10 +107,7 @@ Icon.propTypes = {
162
107
  /** have view box if true */
163
108
  viewBox: PropTypes.bool,
164
109
 
165
- /** prevent all event if true */
166
- disabled: PropTypes.bool,
167
-
168
- /** function for click event on icon */
110
+ /** have view box if true */
169
111
  onClick: PropTypes.func
170
112
  };
171
113
  export default Icon;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "diginet-core-ui",
3
- "version": "1.3.24",
3
+ "version": "1.3.29",
4
4
  "description": "The DigiNet core ui",
5
5
  "homepage": "https://diginet.com.vn",
6
6
  "main": "index.js",
package/readme.md CHANGED
@@ -37,6 +37,72 @@ To test run
37
37
  npm test
38
38
  ```
39
39
 
40
+ ## Changelog
41
+ ## 1.3.28
42
+ - \[Added\]: Icon - Bug, Link
43
+ - \[Added\]: MenuIcon - MHRM09N0004, MHRP29N0023
44
+ - \[Changed\]: Accordion - Update Accordion, add expended like expend (keep prop expend), fix logic
45
+ - \[Changed\]: Button - Add HOC OptionWrapper to Button
46
+ - \[Changed\]: ButtonIcon - Add custom width height
47
+ - \[Fixed\]: Button - Fix Typography white-space nowrap, icon width height, add min-width, hide prop 'text'
48
+ - \[Fixed\]: Dropdown - Fix bug clear data Dropdown close DropdownBox
49
+ - \[Fixed\]: PopupV2 - Fix wrong icon color of type danger
50
+ - \[Fixed\]: Accordion - Fix css min-height AccordionSummary
51
+ - \[Fixed\]: Button, ButtonIcon - Remove prop disabled in tag <button>
52
+ - \[Fixed\]: ButtonIcon - Fix ref of ButtonIcon, Add HOC OptionWrapper
53
+ - \[Fixed\]: Tab - Fix css, Add style, className
54
+
55
+ ## 1.3.27
56
+ - \[Added\]: MenuIcon - D05, D06, D90R, DBC, MHRP09N0030, MHRP09N0031, MHRP29N0021, MHRP29N0022
57
+ - \[Added\]: Icon - Share, InsuranceHistory, School, Assessment, Ninedot, MoreHoriz, HalfClock, List, Treeview, NotificationV2, Website, Update, InfoCancel, CheckList, SpeedHigh, SpeedLow, PersonSync, SaveCancel, ApprovalOutLine, ApprovalCancel, FilterFilled
58
+ - \[Changed\]: TECH - Check and correct typography of all components
59
+ - \[Changed\]: TECH - Check and correct colors of some components
60
+ - \[Changed\]: PageInfo - Phát triển lại component PageInfo
61
+ - \[Changed\]: Icon - Remove effect; fix css; change storybook
62
+ - \[Changed\]: PopupV2 - Replace close button with ButtonIcon (Design update)
63
+ - \[Changed\]: ButtonIcon - Add props colorHover to custom hover color for ButtonIcon with color 'default'
64
+ - \[Changed\]: Badge - Phát triển lại component Badge
65
+ - \[Changed\]: Icon - Change icon Archive to ApprovalFilled
66
+ - \[Changed\]: DropdownBox - Add props onChangeInput, delayOnInput
67
+ - \[Changed\]: Icon - Fix storybook remove outlineIcon, underlineIcon
68
+ - \[Changed\]: Icon - PersonRate, Warehouse, PersonHistory, FolderInsurance, Maximize, Minimize, Scan, ArrowLeftFilled, ArrowRightFilled, ArrowUpFilled, ArrowDownFilled, CancelFilled, CloseFilled, BackFilled, AddFilled, PlusFilled, MinusFilled, Setting, Notification, Logout, LogoutV2, Login, Failed, PaperFilled, ListAprroval, StarFilled, StarOutline
69
+ - \[Fixed\]: Status - Fix height not flexible; Fix perfect pixel
70
+ - \[Fixed\]: Button - Fix perfect pixel
71
+ - \[Fixed\]: Dropdown - Optimize code
72
+ - \[Fixed\]: PopupV2 - Fix bug show less, more of description
73
+ - \[Fixed\]: Alert - Fix perfect pixel; Add size tiny
74
+ - \[Fixed\]: Attachment - Update localize
75
+ - \[Fixed\]: Button - Remove margin css
76
+ - \[Fixed\]: Label - Add css ellipsis, fix colors
77
+ - \[Fixed\]: Divider - Fix css, colors
78
+ - \[Fixed\]: Dropdown - Fix show wrong icon clear
79
+ - \[Fixed\]: Rating - Optimize code
80
+ - \[Fixed\]: DropdownBox - Fix bug not show dropdown
81
+ - \[Fixed\]: Button - Fix css Button with icon and Button without icon not in same row
82
+ - \[Fixed\]: TECH - Fix wrong color of Alert, Button, ButtonIcon, Paging, PopupV2, Rating
83
+ - \[Fixed\]: Dropdown - Fix bug show hide wrong on mobile
84
+ - \[Fixed\]: Datepicker - Fix bug not show defaultValue, warning when pass moment instance to date prop
85
+ - \[Fixed\]: Status - Fix css text to nowrap
86
+ - \[Fixed\]: Dropdown - Fix bug not show error when use multiple
87
+
88
+ ## 1.3.25
89
+ - \[Added\]: Icon - PersonRate
90
+ - \[Added\]: MenuIcon - MHRP39N0015, MHRP29N0012, TASK, MHRP09N0028, MHRP09N0029
91
+ - \[Changed\]: MenuIcon - Rename Menu Icon ERP
92
+ - \[Changed\]: ButtonIcon - Update UI (Design update)
93
+ - \[Changed\]: Fonts - Add fonts to assets
94
+ - \[Changed\]: TECH - Replace <Icon /> with <ButtonIcon />
95
+ - \[Changed\]: Icon - Bag, Calendar, Clock, Copy, Edit, Export, Login, Logout, Mail, Mapping, Marker, Paper, Phone, PlanePaper, QuestionMark, Save, Send, Wait, Menu
96
+ - \[Fixed\]: Chip - Fix css width not max-content
97
+ - \[Fixed\]: Avatar - Fix bug Cannot read properties of null (reading 'querySelector')
98
+ - \[Fixed\]: DropdownBox - Fix bug DropdownBox not close when open modal
99
+ - \[Fixed\]: Dropdown - Remove ::after border-color when focus
100
+ - \[Changed\]: InputBase - Add text-overflow ellipsis
101
+ - \[Fixed\]: Dropdown - Fix bug cannot read properties of null (reading 'childNodes')
102
+ - \[Fixed\]: Dropdown - Fix bug scrollbar covering search bar of treeview
103
+ - \[Fixed\]: Avatar - Fix bug wrong size of default icon
104
+ - \[Fixed\]: PopupV2 - Fix bug not set open state when call onConfirm, onCancel
105
+
40
106
  ## Changelog
41
107
  ## 1.3.24
42
108
  - \[Add\]: Icon - HourGlass
@@ -286,6 +286,8 @@ export const darken = (color, coefficient) => {
286
286
  */
287
287
 
288
288
  export const lighten = (color, coefficient) => {
289
+ if (isColorName(color)) color = isColorName(color);
290
+ if (!isColor(color)) return;
289
291
  color = decomposeColor(color);
290
292
  coefficient = clamp(coefficient);
291
293
 
@@ -329,149 +331,6 @@ export const detectColor = color => {
329
331
 
330
332
  return null;
331
333
  };
332
- export const colorNames = {
333
- aliceblue: '#f0f8ff',
334
- antiquewhite: '#faebd7',
335
- aqua: '#00ffff',
336
- aquamarine: '#7fffd4',
337
- azure: '#f0ffff',
338
- beige: '#f5f5dc',
339
- bisque: '#ffe4c4',
340
- black: '#000000',
341
- blanchedalmond: '#ffebcd',
342
- blue: '#0000ff',
343
- blueviolet: '#8a2be2',
344
- brown: '#a52a2a',
345
- burlywood: '#deb887',
346
- cadetblue: '#5f9ea0',
347
- chartreuse: '#7fff00',
348
- chocolate: '#d2691e',
349
- coral: '#ff7f50',
350
- cornflowerblue: '#6495ed',
351
- cornsilk: '#fff8dc',
352
- crimson: '#dc143c',
353
- cyan: '#00ffff',
354
- darkblue: '#00008b',
355
- darkcyan: '#008b8b',
356
- darkgoldenrod: '#b8860b',
357
- darkgray: '#a9a9a9',
358
- darkgreen: '#006400',
359
- darkkhaki: '#bdb76b',
360
- darkmagenta: '#8b008b',
361
- darkolivegreen: '#556b2f',
362
- darkorange: '#ff8c00',
363
- darkorchid: '#9932cc',
364
- darkred: '#8b0000',
365
- darksalmon: '#e9967a',
366
- darkseagreen: '#8fbc8f',
367
- darkslateblue: '#483d8b',
368
- darkslategray: '#2f4f4f',
369
- darkturquoise: '#00ced1',
370
- darkviolet: '#9400d3',
371
- deeppink: '#ff1493',
372
- deepskyblue: '#00bfff',
373
- dimgray: '#696969',
374
- dodgerblue: '#1e90ff',
375
- firebrick: '#b22222',
376
- floralwhite: '#fffaf0',
377
- forestgreen: '#228b22',
378
- fuchsia: '#ff00ff',
379
- gainsboro: '#dcdcdc',
380
- ghostwhite: '#f8f8ff',
381
- gold: '#ffd700',
382
- goldenrod: '#daa520',
383
- gray: '#808080',
384
- green: '#008000',
385
- greenyellow: '#adff2f',
386
- honeydew: '#f0fff0',
387
- hotpink: '#ff69b4',
388
- indianred: '#cd5c5c',
389
- indigo: '#4b0082',
390
- ivory: '#fffff0',
391
- khaki: '#f0e68c',
392
- lavender: '#e6e6fa',
393
- lavenderblush: '#fff0f5',
394
- lawngreen: '#7cfc00',
395
- lemonchiffon: '#fffacd',
396
- lightblue: '#add8e6',
397
- lightcoral: '#f08080',
398
- lightcyan: '#e0ffff',
399
- lightgoldenrodyellow: '#fafad2',
400
- lightgreen: '#90ee90',
401
- lightgrey: '#d3d3d3',
402
- lightpink: '#ffb6c1',
403
- lightsalmon: '#ffa07a',
404
- lightseagreen: '#20b2aa',
405
- lightskyblue: '#87cefa',
406
- lightslategray: '#778899',
407
- lightsteelblue: '#b0c4de',
408
- lightyellow: '#ffffe0',
409
- lime: '#00ff00',
410
- limegreen: '#32cd32',
411
- linen: '#faf0e6',
412
- magenta: '#ff00ff',
413
- maroon: '#800000',
414
- mediumaquamarine: '#66cdaa',
415
- mediumblue: '#0000cd',
416
- mediumorchid: '#ba55d3',
417
- mediumpurple: '#9370d8',
418
- mediumseagreen: '#3cb371',
419
- mediumslateblue: '#7b68ee',
420
- mediumspringgreen: '#00fa9a',
421
- mediumturquoise: '#48d1cc',
422
- mediumvioletred: '#c71585',
423
- midnightblue: '#191970',
424
- mintcream: '#f5fffa',
425
- mistyrose: '#ffe4e1',
426
- moccasin: '#ffe4b5',
427
- navajowhite: '#ffdead',
428
- navy: '#000080',
429
- oldlace: '#fdf5e6',
430
- olive: '#808000',
431
- olivedrab: '#6b8e23',
432
- orange: '#ffa500',
433
- orangered: '#ff4500',
434
- orchid: '#da70d6',
435
- palegoldenrod: '#eee8aa',
436
- palegreen: '#98fb98',
437
- paleturquoise: '#afeeee',
438
- palevioletred: '#d87093',
439
- papayawhip: '#ffefd5',
440
- peachpuff: '#ffdab9',
441
- peru: '#cd853f',
442
- pink: '#ffc0cb',
443
- plum: '#dda0dd',
444
- powderblue: '#b0e0e6',
445
- purple: '#800080',
446
- rebeccapurple: '#663399',
447
- red: '#ff0000',
448
- rosybrown: '#bc8f8f',
449
- royalblue: '#4169e1',
450
- saddlebrown: '#8b4513',
451
- salmon: '#fa8072',
452
- sandybrown: '#f4a460',
453
- seagreen: '#2e8b57',
454
- seashell: '#fff5ee',
455
- sienna: '#a0522d',
456
- silver: '#c0c0c0',
457
- skyblue: '#87ceeb',
458
- slateblue: '#6a5acd',
459
- slategray: '#708090',
460
- snow: '#fffafa',
461
- springgreen: '#00ff7f',
462
- steelblue: '#4682b4',
463
- tan: '#d2b48c',
464
- teal: '#008080',
465
- thistle: '#d8bfd8',
466
- tomato: '#ff6347',
467
- turquoise: '#40e0d0',
468
- violet: '#ee82ee',
469
- wheat: '#f5deb3',
470
- white: '#ffffff',
471
- whitesmoke: '#f5f5f5',
472
- yellow: '#ffff00',
473
- yellowgreen: '#9acd32'
474
- };
475
334
  /**
476
335
  * Validate a color name.
477
336
  *
@@ -480,9 +339,9 @@ export const colorNames = {
480
339
  */
481
340
 
482
341
  export const isColorName = color => {
483
- const plaintColor = color.replace(/\s+/g, '').trim().toLowerCase();
484
- if (typeof colorNames[plaintColor] !== 'undefined') return colorNames[plaintColor];
485
- return false;
342
+ let ctx = document.createElement('canvas').getContext('2d');
343
+ ctx.fillStyle = color;
344
+ return ctx.fillStyle === '#000000' ? false : ctx.fillStyle;
486
345
  };
487
346
  /**
488
347
  * Convert from #ffffff to rgba()
@@ -492,6 +351,8 @@ export const isColorName = color => {
492
351
  */
493
352
 
494
353
  export const hexToRGBA = (hex, alpha) => {
354
+ if (isColorName(hex)) hex = isColorName(hex);
355
+ if (!isColor(hex)) return;
495
356
  var r = parseInt(hex.slice(1, 3), 16),
496
357
  g = parseInt(hex.slice(3, 5), 16),
497
358
  b = parseInt(hex.slice(5, 7), 16);
package/styles/colors.js CHANGED
@@ -273,7 +273,6 @@ color.fill = {
273
273
  sidebar: color.white,
274
274
  headerbar: color.brand12,
275
275
  tabbar: color.brand12,
276
- "tabbar-active": color.brand,
277
276
  "scrollbar-tabbar": color.brand13,
278
277
  "odd_raw": color.brand21,
279
278
  "even_raw": color.white,
@@ -303,4 +302,9 @@ color.line = {
303
302
  "grid_w_header": color.white,
304
303
  category: color.dark2,
305
304
  tab: color.dark2
306
- };
305
+ };
306
+ color.primary = color.system.active;
307
+ color.success = color.semantic.success;
308
+ color.warning = color.semantic.warning;
309
+ color.danger = color.semantic.danger;
310
+ color.info = color.semantic.info;
package/styles/font.js ADDED
@@ -0,0 +1,9 @@
1
+ export const font = {
2
+ fontFamily: `"SF Pro Display"`,
3
+ fontFamilyLink: require("../assets/fonts/SF-Pro-Display-Regular.otf"),
4
+ fontFamilyMedium: `"SF Pro Display Medium"`,
5
+ fontFamilyMediumLink: require("../assets/fonts/SF-Pro-Display-Medium.otf"),
6
+ fontFamilyBold: `"SF Pro Display Bold"`,
7
+ fontFamilyBoldLink: require("../assets/fonts/SF-Pro-Display-Bold.otf"),
8
+ fontSize: "16px"
9
+ };
package/styles/general.js CHANGED
@@ -32,17 +32,110 @@ export const fontSizes = {
32
32
  xxlarge: '1.424rem'
33
33
  };
34
34
  export const flexRow = css`
35
- display: flex;
36
- flex-direction: row;
37
- flex-wrap: wrap;
35
+ display: flex;
36
+ `;
37
+ export const inlineFlex = css`
38
+ display: inline-flex;
38
39
  `;
39
40
  export const flexCol = css`
40
- display: flex;
41
- flex-direction: column;
41
+ display: flex;
42
+ flex-direction: column;
43
+ `;
44
+ export const flexRowReverse = css`
45
+ flex-direction: row-reverse;
46
+ `;
47
+ export const flexWrap = css`
48
+ flex-wrap: wrap;
49
+ `;
50
+ export const alignStart = css`
51
+ align-items: flex-start;
52
+ `;
53
+ export const alignCenter = css`
54
+ align-items: center;
55
+ `;
56
+ export const alignEnd = css`
57
+ align-items: flex-end;
58
+ `;
59
+ export const justifyStart = css`
60
+ justify-content: flex-start;
61
+ `;
62
+ export const justifyCenter = css`
63
+ justify-content: center;
64
+ `;
65
+ export const justifyEnd = css`
66
+ justify-content: flex-end;
67
+ `;
68
+ export const displayBlock = css`
69
+ display: block;
70
+ `;
71
+ export const displayInlineBlock = css`
72
+ display: inline-block;
73
+ `;
74
+ export const positionRelative = css`
75
+ position: relative;
76
+ `;
77
+ export const positionAbsolute = css`
78
+ position: absolute;
79
+ `;
80
+ export const positionFixed = css`
81
+ position: fixed;
82
+ `;
83
+ export const borderRadius4px = css`
84
+ border-radius: 4px;
85
+ `;
86
+ export const borderBox = css`
87
+ box-sizing: border-box;
88
+ `;
89
+ export const cursorPointer = css`
90
+ cursor: pointer;
91
+ `;
92
+ export const overflowHidden = css`
93
+ overflow: hidden;
94
+ `;
95
+ export const backgroundTransparent = css`
96
+ background-color: transparent;
97
+ `;
98
+ export const ellipsis = css`
99
+ white-space: nowrap;
100
+ text-overflow: ellipsis;
101
+ overflow: hidden;
102
+ `;
103
+ export const whiteSpaceNoWrap = css`
104
+ white-space: nowrap;
105
+ `;
106
+ export const breakWord = css`
107
+ word-break: break-word;
108
+ `;
109
+ export const textCapitalize = css`
110
+ text-transform: capitalize;
111
+ `;
112
+ export const textUppercase = css`
113
+ text-transform: uppercase;
114
+ `;
115
+ export const outlineNone = css`
116
+ outline: none;
117
+ `;
118
+ export const userSelectNone = css`
119
+ user-select: none;
120
+ `;
121
+ export const pointerEventsNone = css`
122
+ pointer-events: none;
123
+ `;
124
+ export const borderNone = css`
125
+ border: none;
126
+ `;
127
+ export const textCenter = css`
128
+ text-align: center;
42
129
  `;
43
130
  export const noMargin = css`
44
- margin: 0 !important;
131
+ margin: 0 !important;
132
+ `;
133
+ export const noPadding = css`
134
+ padding: 0 !important;
135
+ `;
136
+ export const noBorder = css`
137
+ border: none !important;
45
138
  `;
46
139
  export const border = (withVl, colorVl) => css`
47
- border: ${parseToPixel(withVl)} solid ${colorVl || color.dark};
140
+ border: ${parseToPixel(withVl)} solid ${colorVl || color.dark};
48
141
  `;