@scality/core-ui 0.118.0 → 0.119.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.
- package/dist/components/buttonv2/Buttonv2.component.js +2 -2
- package/dist/components/card/Card.component.d.ts +1 -1
- package/dist/components/card/Card.component.d.ts.map +1 -1
- package/dist/components/card/Card.component.js +7 -13
- package/dist/components/checkbox/Checkbox.component.js +2 -2
- package/dist/components/dropdown/Dropdown.component.d.ts.map +1 -1
- package/dist/components/dropdown/Dropdown.component.js +0 -1
- package/dist/components/inputv2/inputv2.d.ts +1 -2
- package/dist/components/inputv2/inputv2.d.ts.map +1 -1
- package/dist/components/inputv2/inputv2.js +5 -3
- package/dist/components/searchinput/SearchInput.component.d.ts +3 -0
- package/dist/components/searchinput/SearchInput.component.d.ts.map +1 -1
- package/dist/components/searchinput/SearchInput.component.js +33 -52
- package/dist/components/sidebar/Sidebar.component.d.ts.map +1 -1
- package/dist/components/sidebar/Sidebar.component.js +8 -7
- package/dist/components/tablev2/Search.d.ts +1 -1
- package/dist/components/tablev2/Search.d.ts.map +1 -1
- package/dist/components/tablev2/Search.js +1 -1
- package/dist/components/tablev2/SearchWithQueryParams.d.ts +2 -2
- package/dist/components/tablev2/SearchWithQueryParams.d.ts.map +1 -1
- package/dist/components/tablev2/SearchWithQueryParams.js +1 -1
- package/dist/components/tablev2/Tablestyle.js +2 -2
- package/dist/components/vegachartv2/VegaChartV2.component.d.ts.map +1 -1
- package/dist/components/vegachartv2/VegaChartV2.component.js +44 -42
- package/dist/icons/branding-logo.d.ts +4 -0
- package/dist/icons/branding-logo.d.ts.map +1 -0
- package/dist/icons/branding-logo.js +3 -0
- package/dist/index.d.ts +0 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -1
- package/dist/style/theme.js +15 -15
- package/package.json +15 -15
- package/src/lib/components/buttonv2/Buttonv2.component.tsx +2 -2
- package/src/lib/components/card/Card.component.tsx +10 -19
- package/src/lib/components/checkbox/Checkbox.component.tsx +14 -2
- package/src/lib/components/dropdown/Dropdown.component.tsx +0 -1
- package/src/lib/components/inputv2/inputv2.tsx +19 -24
- package/src/lib/components/searchinput/SearchInput.component.tsx +54 -62
- package/src/lib/components/sidebar/Sidebar.component.tsx +8 -9
- package/src/lib/components/tablev2/Search.tsx +2 -1
- package/src/lib/components/tablev2/SearchWithQueryParams.tsx +4 -3
- package/src/lib/components/tablev2/Tablestyle.tsx +2 -2
- package/src/lib/components/vegachartv2/VegaChartV2.component.tsx +47 -50
- package/src/lib/icons/branding-logo.tsx +47 -0
- package/src/lib/index.ts +0 -1
- package/src/lib/style/theme.ts +15 -15
- package/stories/card.stories.tsx +4 -11
- package/stories/color.mdx +3 -3
- package/stories/layout.stories.tsx +11 -60
- package/stories/navbar.stories.tsx +4 -2
- package/stories/searchinput.stories.tsx +21 -1
- package/stories/spacing.stories.tsx +8 -8
- package/stories/steppers.stories.tsx +14 -15
- package/stories/tablev2.stories.tsx +23 -10
- package/stories/tabsv2.stories.tsx +0 -2
- package/dist/components/input/Input.component.d.ts +0 -24
- package/dist/components/input/Input.component.d.ts.map +0 -1
- package/dist/components/input/Input.component.js +0 -55
- package/dist/components/input/Input.component.style.d.ts +0 -9
- package/dist/components/input/Input.component.style.d.ts.map +0 -1
- package/dist/components/input/Input.component.style.js +0 -136
- package/src/lib/components/input/Input.component.style.ts +0 -141
- package/src/lib/components/input/Input.component.tsx +0 -174
package/dist/index.d.ts
CHANGED
|
@@ -6,7 +6,6 @@ export { Button } from './components/button/Button.component';
|
|
|
6
6
|
export { Checkbox } from './components/checkbox/Checkbox.component';
|
|
7
7
|
export { Chips } from './components/chips/Chips.component';
|
|
8
8
|
export { Dropdown } from './components/dropdown/Dropdown.component';
|
|
9
|
-
export { Input } from './components/input/Input.component';
|
|
10
9
|
export { LOADER_SIZE } from './components/constants';
|
|
11
10
|
export { Layout } from './components/layout/Layout.component';
|
|
12
11
|
export { Loader } from './components/loader/Loader.component';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/lib/index.ts"],"names":[],"mappings":"AAAA,OAAO,2CAA2C,CAAC;AACnD,OAAO,aAAa,CAAC;AACrB,OAAO,EAAE,MAAM,EAAE,MAAM,sCAAsC,CAAC;AAC9D,OAAO,EAAE,UAAU,EAAE,MAAM,8CAA8C,CAAC;AAC1E,OAAO,EAAE,MAAM,EAAE,MAAM,sCAAsC,CAAC;AAC9D,OAAO,EAAE,QAAQ,EAAE,MAAM,0CAA0C,CAAC;AACpE,OAAO,EAAE,KAAK,EAAE,MAAM,oCAAoC,CAAC;AAC3D,OAAO,EAAE,QAAQ,EAAE,MAAM,0CAA0C,CAAC;AACpE,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/lib/index.ts"],"names":[],"mappings":"AAAA,OAAO,2CAA2C,CAAC;AACnD,OAAO,aAAa,CAAC;AACrB,OAAO,EAAE,MAAM,EAAE,MAAM,sCAAsC,CAAC;AAC9D,OAAO,EAAE,UAAU,EAAE,MAAM,8CAA8C,CAAC;AAC1E,OAAO,EAAE,MAAM,EAAE,MAAM,sCAAsC,CAAC;AAC9D,OAAO,EAAE,QAAQ,EAAE,MAAM,0CAA0C,CAAC;AACpE,OAAO,EAAE,KAAK,EAAE,MAAM,oCAAoC,CAAC;AAC3D,OAAO,EAAE,QAAQ,EAAE,MAAM,0CAA0C,CAAC;AACpE,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,MAAM,EAAE,MAAM,sCAAsC,CAAC;AAC9D,OAAO,EAAE,MAAM,EAAE,MAAM,sCAAsC,CAAC;AAC9D,OAAO,EAAE,KAAK,EAAE,MAAM,oCAAoC,CAAC;AAC3D,OAAO,EAAE,MAAM,EAAE,MAAM,sCAAsC,CAAC;AAC9D,OAAO,EAAE,aAAa,EAAE,MAAM,oDAAoD,CAA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AAE,MAAM,kCAAkC,CAAC;AAC3E,OAAO,EAAE,mBAAmB,EAAE,MAAM,wCAAwC,CAAC;AAC7E,OAAO,EAAE,OAAO,EAAE,MAAM,yCAAyC,CAAC;AAClE,OAAO,EAAE,WAAW,EAAE,MAAM,gDAAgD,CAAC;AAC7E,OAAO,EAAE,SAAS,EAAE,MAAM,4CAA4C,CAAC;AACvE,OAAO,EAAE,WAAW,EAAE,MAAM,sCAAsC,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -6,7 +6,6 @@ export { Button } from './components/button/Button.component';
|
|
|
6
6
|
export { Checkbox } from './components/checkbox/Checkbox.component';
|
|
7
7
|
export { Chips } from './components/chips/Chips.component';
|
|
8
8
|
export { Dropdown } from './components/dropdown/Dropdown.component';
|
|
9
|
-
export { Input } from './components/input/Input.component';
|
|
10
9
|
export { LOADER_SIZE } from './components/constants';
|
|
11
10
|
export { Layout } from './components/layout/Layout.component';
|
|
12
11
|
export { Loader } from './components/loader/Loader.component';
|
package/dist/style/theme.js
CHANGED
|
@@ -61,25 +61,25 @@ export const coreUIAvailableThemes = {
|
|
|
61
61
|
},
|
|
62
62
|
artescaLight: {
|
|
63
63
|
statusHealthy: '#009E93',
|
|
64
|
-
statusHealthyRGB: '
|
|
64
|
+
statusHealthyRGB: '0, 158, 147',
|
|
65
65
|
statusWarning: '#E77B00',
|
|
66
|
-
statusWarningRGB: '
|
|
66
|
+
statusWarningRGB: '231, 123, 0',
|
|
67
67
|
statusCritical: '#C10004',
|
|
68
|
-
statusCriticalRGB: '
|
|
69
|
-
selectedActive: '#
|
|
68
|
+
statusCriticalRGB: '193, 0, 4',
|
|
69
|
+
selectedActive: '#63A9D4',
|
|
70
70
|
highlight: '#E3F2FD',
|
|
71
|
-
border: '#
|
|
72
|
-
buttonPrimary: '#
|
|
73
|
-
buttonSecondary: '#
|
|
71
|
+
border: '#A9A9A9',
|
|
72
|
+
buttonPrimary: '#ABB4F5',
|
|
73
|
+
buttonSecondary: '#B8BCCD',
|
|
74
74
|
buttonDelete: '#FFCDD2',
|
|
75
75
|
infoPrimary: '#5C486D',
|
|
76
|
-
infoSecondary: '#
|
|
77
|
-
backgroundLevel1: '#
|
|
78
|
-
backgroundLevel2: '#
|
|
79
|
-
backgroundLevel3: '#
|
|
80
|
-
backgroundLevel4: '#
|
|
81
|
-
textPrimary: '#
|
|
82
|
-
textSecondary: '#
|
|
76
|
+
infoSecondary: '#E2D0E2',
|
|
77
|
+
backgroundLevel1: '#FCFCFC',
|
|
78
|
+
backgroundLevel2: '#F0F0F4',
|
|
79
|
+
backgroundLevel3: '#E4E6EC',
|
|
80
|
+
backgroundLevel4: '#FAFAF6',
|
|
81
|
+
textPrimary: '#0D0D0D',
|
|
82
|
+
textSecondary: '#4F506D',
|
|
83
83
|
textTertiary: '#DFDFDF', // TO CHECK
|
|
84
84
|
textReverse: '#EAEAEA',
|
|
85
85
|
textLink: '#1349C5',
|
|
@@ -90,7 +90,7 @@ export const coreUIAvailableThemes = {
|
|
|
90
90
|
statusWarning: '#FC8A32',
|
|
91
91
|
statusWarningRGB: '252,138,50',
|
|
92
92
|
statusCritical: '#E84855',
|
|
93
|
-
statusCriticalRGB: '232,72,85
|
|
93
|
+
statusCriticalRGB: '232,72,85',
|
|
94
94
|
selectedActive: '#2196F3',
|
|
95
95
|
highlight: '#1A3C75',
|
|
96
96
|
border: '#313131',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@scality/core-ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.119.0",
|
|
4
4
|
"description": "Scality common React component library",
|
|
5
5
|
"author": "Scality Engineering",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE",
|
|
@@ -33,18 +33,18 @@
|
|
|
33
33
|
"@babel/preset-env": "^7.17.10",
|
|
34
34
|
"@babel/preset-react": "^7.16.7",
|
|
35
35
|
"@babel/preset-typescript": "^7.16.7",
|
|
36
|
-
"@storybook/addon-actions": "^7.6.
|
|
37
|
-
"@storybook/addon-essentials": "^7.6.
|
|
38
|
-
"@storybook/addon-links": "^7.6.
|
|
39
|
-
"@storybook/addon-mdx-gfm": "^7.6.
|
|
40
|
-
"@storybook/addon-storyshots": "^7.6.
|
|
41
|
-
"@storybook/addon-storysource": "^7.6.
|
|
42
|
-
"@storybook/blocks": "^7.6.
|
|
43
|
-
"@storybook/manager-api": "^7.6.
|
|
44
|
-
"@storybook/react": "^7.6.
|
|
45
|
-
"@storybook/react-webpack5": "^7.6.
|
|
36
|
+
"@storybook/addon-actions": "^7.6.14",
|
|
37
|
+
"@storybook/addon-essentials": "^7.6.14",
|
|
38
|
+
"@storybook/addon-links": "^7.6.14",
|
|
39
|
+
"@storybook/addon-mdx-gfm": "^7.6.14",
|
|
40
|
+
"@storybook/addon-storyshots": "^7.6.14",
|
|
41
|
+
"@storybook/addon-storysource": "^7.6.14",
|
|
42
|
+
"@storybook/blocks": "^7.6.14",
|
|
43
|
+
"@storybook/manager-api": "^7.6.14",
|
|
44
|
+
"@storybook/react": "^7.6.14",
|
|
45
|
+
"@storybook/react-webpack5": "^7.6.14",
|
|
46
46
|
"@storybook/storybook-deployer": "^2.8.16",
|
|
47
|
-
"@storybook/theming": "^7.6.
|
|
47
|
+
"@storybook/theming": "^7.6.14",
|
|
48
48
|
"@testing-library/jest-dom": "^5.14.1",
|
|
49
49
|
"@testing-library/react": "^11.2.7",
|
|
50
50
|
"@testing-library/react-hooks": "^8.0.1",
|
|
@@ -75,7 +75,7 @@
|
|
|
75
75
|
"regenerator-runtime": "^0.13.7",
|
|
76
76
|
"rimraf": "^3.0.0",
|
|
77
77
|
"source-map-explorer": "^2.0.1",
|
|
78
|
-
"storybook": "^7.6.
|
|
78
|
+
"storybook": "^7.6.14",
|
|
79
79
|
"typescript": "^5.3.2"
|
|
80
80
|
},
|
|
81
81
|
"husky": {
|
|
@@ -93,14 +93,14 @@
|
|
|
93
93
|
}
|
|
94
94
|
},
|
|
95
95
|
"dependencies": {
|
|
96
|
-
"@floating-ui/dom": "^
|
|
96
|
+
"@floating-ui/dom": "^1.6.3",
|
|
97
97
|
"@fortawesome/fontawesome-free": "^5.10.2",
|
|
98
98
|
"@fortawesome/fontawesome-svg-core": "^1.2.35",
|
|
99
99
|
"@fortawesome/free-regular-svg-icons": "^5.15.3",
|
|
100
100
|
"@fortawesome/free-solid-svg-icons": "^5.15.3",
|
|
101
101
|
"@fortawesome/react-fontawesome": "^0.1.14",
|
|
102
102
|
"@js-temporal/polyfill": "^0.4.4",
|
|
103
|
-
"@storybook/preview-api": "^7.6.
|
|
103
|
+
"@storybook/preview-api": "^7.6.14",
|
|
104
104
|
"framer-motion": "^4.1.17",
|
|
105
105
|
"polished": "3.4.1",
|
|
106
106
|
"pretty-bytes": "^5.6.0",
|
|
@@ -53,7 +53,7 @@ export const ButtonStyled = styled.button<Props>`
|
|
|
53
53
|
return css`
|
|
54
54
|
background-color: ${brand.buttonPrimary};
|
|
55
55
|
border: ${spacing.r1} solid ${brand.buttonPrimary};
|
|
56
|
-
color: ${brand.
|
|
56
|
+
color: ${brand.textPrimary};
|
|
57
57
|
&:hover:enabled {
|
|
58
58
|
cursor: pointer;
|
|
59
59
|
border: ${spacing.r1} solid ${brand.infoPrimary};
|
|
@@ -75,7 +75,7 @@ export const ButtonStyled = styled.button<Props>`
|
|
|
75
75
|
return css`
|
|
76
76
|
background-color: ${brand.buttonSecondary};
|
|
77
77
|
border: ${spacing.r1} solid ${brand.buttonSecondary};
|
|
78
|
-
color: ${brand.
|
|
78
|
+
color: ${brand.textPrimary};
|
|
79
79
|
&:hover:enabled {
|
|
80
80
|
cursor: pointer;
|
|
81
81
|
border: ${spacing.r1} solid ${brand.infoPrimary};
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
import { HTMLProps } from 'react';
|
|
3
3
|
import { createContext } from 'react';
|
|
4
4
|
import styled, { css } from 'styled-components';
|
|
5
|
-
import { hex2RGB } from '../../utils';
|
|
6
5
|
import { FocusVisibleStyle } from '../buttonv2/Buttonv2.component';
|
|
7
6
|
const CardContext = createContext(null);
|
|
8
7
|
type CardElementProps = {
|
|
@@ -42,7 +41,8 @@ function withCompoundCheck(Component) {
|
|
|
42
41
|
|
|
43
42
|
const StyledCardHeader = styled.div`
|
|
44
43
|
padding: 0.7rem;
|
|
45
|
-
border-radius: 3px;
|
|
44
|
+
border-top-left-radius: 3px;
|
|
45
|
+
border-top-right-radius: 3px;
|
|
46
46
|
font-weight: bold;
|
|
47
47
|
`;
|
|
48
48
|
StyledCardHeader.displayName = 'CardHeader';
|
|
@@ -76,27 +76,18 @@ const StyledCard = styled.div<{
|
|
|
76
76
|
flex-flow: column;
|
|
77
77
|
width: ${(props) => props.width};
|
|
78
78
|
height: ${(props) => props.height};
|
|
79
|
-
background: ${(props) =>
|
|
80
|
-
|
|
81
|
-
|
|
79
|
+
background: ${(props) => props.theme[props.bodyBackgroundColor]};
|
|
80
|
+
filter: drop-shadow(0px 2px 4px rgba(0, 0, 0, 0.2));
|
|
82
81
|
${StyledCardBody} {
|
|
83
82
|
opacity: ${(props) => (props.disabled ? '0.2' : '1')};
|
|
84
83
|
}
|
|
85
84
|
|
|
86
85
|
${StyledCardHeader} {
|
|
87
|
-
border-radius: 2px;
|
|
88
86
|
color: ${(props) => props.theme.textPrimary};
|
|
89
|
-
${(props) =>
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
],
|
|
94
|
-
).join(',');
|
|
95
|
-
let opacity = 1;
|
|
96
|
-
if (props.colorStatus && props.colorStatus !== 'backgroundLevel4')
|
|
97
|
-
opacity = 0.4;
|
|
98
|
-
return `background: rgba(${hexColor}, ${opacity});`;
|
|
99
|
-
}}
|
|
87
|
+
background: ${(props) =>
|
|
88
|
+
props.theme[props.colorStatus || props.headerBackgroundColor]};
|
|
89
|
+
opacity: ${(props) =>
|
|
90
|
+
props.colorStatus && props.colorStatus !== 'backgroundLevel4' ? 0.4 : 1};
|
|
100
91
|
${(props) => props.disabled && 'opacity: 0.3;'}
|
|
101
92
|
}
|
|
102
93
|
|
|
@@ -129,13 +120,13 @@ type CardProps = {
|
|
|
129
120
|
onClick?: () => void;
|
|
130
121
|
active?: boolean;
|
|
131
122
|
disabled?: boolean;
|
|
132
|
-
children:
|
|
123
|
+
children: React.ReactNode;
|
|
133
124
|
className?: string;
|
|
134
125
|
} & HTMLProps<HTMLDivElement>;
|
|
135
126
|
function Card({
|
|
136
127
|
width = 'auto',
|
|
137
128
|
height = 'auto',
|
|
138
|
-
headerBackgroundColor = '
|
|
129
|
+
headerBackgroundColor = 'buttonSecondary',
|
|
139
130
|
bodyBackgroundColor = 'backgroundLevel3',
|
|
140
131
|
status = null,
|
|
141
132
|
onClick = null,
|
|
@@ -87,7 +87,13 @@ const StyledCheckbox = styled.label<{
|
|
|
87
87
|
|
|
88
88
|
[type='checkbox']:checked::before {
|
|
89
89
|
box-shadow: none;
|
|
90
|
-
background-image: url('data:image/svg+xml,%3Csvg width="13" height="13" viewBox="0 0 13 13" fill="none" xmlns="http://www.w3.org/2000/svg"%3E %3Cpath d="M3 6.68646L5.0671 9L9 3" stroke="
|
|
90
|
+
background-image: url('data:image/svg+xml,%3Csvg width="13" height="13" viewBox="0 0 13 13" fill="none" xmlns="http://www.w3.org/2000/svg"%3E %3Cpath d="M3 6.68646L5.0671 9L9 3" stroke="${(
|
|
91
|
+
props,
|
|
92
|
+
) =>
|
|
93
|
+
props.theme.textPrimary.replace(
|
|
94
|
+
'#',
|
|
95
|
+
'%23',
|
|
96
|
+
)}" stroke-width="1.5"/%3E %3C/svg%3E');
|
|
91
97
|
background-repeat: no-repeat;
|
|
92
98
|
background-position: center;
|
|
93
99
|
}
|
|
@@ -98,7 +104,13 @@ const StyledCheckbox = styled.label<{
|
|
|
98
104
|
box-shadow: inset 0 0 0 ${spacing.r1}
|
|
99
105
|
${(props) => props.theme.selectedActive};
|
|
100
106
|
background-color: ${(props) => props.theme.highlight};
|
|
101
|
-
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E %3Cline x1='6' y1='12' x2='20' y2='12' style='stroke
|
|
107
|
+
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E %3Cline x1='6' y1='12' x2='20' y2='12' style='stroke:${(
|
|
108
|
+
props,
|
|
109
|
+
) =>
|
|
110
|
+
props.theme.textPrimary.replace(
|
|
111
|
+
'#',
|
|
112
|
+
'%23',
|
|
113
|
+
)};stroke-width:4'/%3E %3C/svg%3E");
|
|
102
114
|
}
|
|
103
115
|
|
|
104
116
|
/* Hover & focus */
|
|
@@ -60,7 +60,6 @@ const DropdownMenuItemStyled = styled.li`
|
|
|
60
60
|
cursor: pointer;
|
|
61
61
|
font-size: ${fontSize.base};
|
|
62
62
|
${(props) => {
|
|
63
|
-
console.log(props.isSelected);
|
|
64
63
|
return props.isSelected
|
|
65
64
|
? `background-color: ${props.theme.highlight};`
|
|
66
65
|
: `background-color: ${props.theme.backgroundLevel1};`;
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { forwardRef, InputHTMLAttributes } from 'react';
|
|
2
2
|
import styled from 'styled-components';
|
|
3
3
|
import { spacing } from '../../spacing';
|
|
4
|
-
|
|
5
|
-
import { Box } from '../box/Box';
|
|
6
4
|
import { DESCRIPTION_PREFIX, useFieldContext } from '../form/Form.component';
|
|
7
5
|
import { Icon, IconName } from '../icon/Icon.component';
|
|
8
6
|
|
|
@@ -13,8 +11,10 @@ export const convertSizeToRem = (size?: '1' | '2/3' | '1/2' | '1/3') => {
|
|
|
13
11
|
else return '20.5rem';
|
|
14
12
|
};
|
|
15
13
|
|
|
16
|
-
const StyledInput = styled.input
|
|
17
|
-
max-width:
|
|
14
|
+
const StyledInput = styled.input<{ hasIcon: boolean }>`
|
|
15
|
+
max-width: ${(props) =>
|
|
16
|
+
props.hasIcon ? `calc(100% - 1rem - ${spacing.f8})` : '100%'};
|
|
17
|
+
|
|
18
18
|
font-family: 'Lato';
|
|
19
19
|
${(props) =>
|
|
20
20
|
props.disabled &&
|
|
@@ -49,6 +49,7 @@ const InputContainer = styled.div<{
|
|
|
49
49
|
height: 100%;
|
|
50
50
|
display: flex;
|
|
51
51
|
align-items: center;
|
|
52
|
+
gap: ${spacing.f8};
|
|
52
53
|
padding: 0 ${spacing.r8} 0 ${spacing.r8};
|
|
53
54
|
background: ${(props) => props.theme.backgroundLevel1};
|
|
54
55
|
border-radius: ${spacing.r4};
|
|
@@ -85,9 +86,10 @@ const InputBorder = styled.div<{
|
|
|
85
86
|
|
|
86
87
|
const SelfCenterredIcon = styled(Icon)`
|
|
87
88
|
align-self: center;
|
|
89
|
+
color: ${(props) => props.theme.textSecondary};
|
|
88
90
|
`;
|
|
89
91
|
|
|
90
|
-
type InputSize = '1' | '2/3' | '1/2' | '1/3';
|
|
92
|
+
export type InputSize = '1' | '2/3' | '1/2' | '1/3';
|
|
91
93
|
|
|
92
94
|
export type InputProps = {
|
|
93
95
|
error?: string;
|
|
@@ -129,25 +131,18 @@ export const Input = forwardRef<HTMLInputElement, InputProps>(
|
|
|
129
131
|
disabled={!!(disabled || disabledFromFieldContext)}
|
|
130
132
|
hasError={!!(error || errorFromFieldContext)}
|
|
131
133
|
>
|
|
132
|
-
<
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
aria-describedby={`${DESCRIPTION_PREFIX}${id}`}
|
|
145
|
-
id={id}
|
|
146
|
-
{...inputProps}
|
|
147
|
-
placeholder={placeholder}
|
|
148
|
-
/>
|
|
149
|
-
{rightIcon && <SelfCenterredIcon name={rightIcon} />}
|
|
150
|
-
</Box>
|
|
134
|
+
{leftIcon && <SelfCenterredIcon name={leftIcon} />}
|
|
135
|
+
<StyledInput
|
|
136
|
+
ref={ref}
|
|
137
|
+
disabled={disabled || disabledFromFieldContext}
|
|
138
|
+
aria-invalid={!!(error || errorFromFieldContext)}
|
|
139
|
+
aria-describedby={`${DESCRIPTION_PREFIX}${id}`}
|
|
140
|
+
hasIcon={!!(leftIcon || rightIcon)}
|
|
141
|
+
id={id}
|
|
142
|
+
{...inputProps}
|
|
143
|
+
placeholder={placeholder}
|
|
144
|
+
/>
|
|
145
|
+
{rightIcon && <SelfCenterredIcon name={rightIcon} />}
|
|
151
146
|
</InputContainer>
|
|
152
147
|
</InputBorder>
|
|
153
148
|
);
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { ChangeEvent, forwardRef, useRef, useState } from 'react';
|
|
1
|
+
import { ChangeEvent, forwardRef, useEffect, useRef, useState } from 'react';
|
|
2
2
|
import styled, { css } from 'styled-components';
|
|
3
|
-
import { fontSize } from '../../style/theme';
|
|
4
|
-
import { getThemePropSelector } from '../../utils';
|
|
5
3
|
import { Icon } from '../icon/Icon.component';
|
|
6
|
-
import { Input } from '../
|
|
4
|
+
import { Input, InputSize } from '../inputv2/inputv2';
|
|
5
|
+
import { Button } from '../buttonv2/Buttonv2.component';
|
|
6
|
+
import { spacing } from '../../spacing';
|
|
7
7
|
export type Props = {
|
|
8
8
|
placeholder?: string;
|
|
9
9
|
value: string;
|
|
@@ -11,12 +11,18 @@ export type Props = {
|
|
|
11
11
|
onReset?: () => void;
|
|
12
12
|
disableToggle: boolean;
|
|
13
13
|
disabled?: boolean;
|
|
14
|
+
id?: string;
|
|
15
|
+
size?: InputSize;
|
|
14
16
|
};
|
|
15
17
|
const SearchInputContainer = styled.div<{
|
|
16
18
|
docked?: boolean;
|
|
17
19
|
disabled?: boolean;
|
|
18
20
|
}>`
|
|
19
21
|
position: relative;
|
|
22
|
+
width: max-content;
|
|
23
|
+
input {
|
|
24
|
+
max-width: calc(100% - 1rem - ${spacing.f8} - 1rem);
|
|
25
|
+
}
|
|
20
26
|
|
|
21
27
|
${(props) => {
|
|
22
28
|
if (props.disabled) {
|
|
@@ -29,47 +35,16 @@ const SearchInputContainer = styled.div<{
|
|
|
29
35
|
}
|
|
30
36
|
}}
|
|
31
37
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
width: ${(props) => (props.docked ? '40px' : '100%')};
|
|
36
|
-
box-sizing: border-box;
|
|
37
|
-
padding-left: ${(props) => (props.docked ? '28px' : '40px')};
|
|
38
|
-
transition: width 0.2s ease-in-out;
|
|
39
|
-
}
|
|
38
|
+
//hide the default clear button in chrome
|
|
39
|
+
.search-box::-webkit-search-cancel-button {
|
|
40
|
+
display: none;
|
|
40
41
|
}
|
|
41
42
|
`;
|
|
42
|
-
|
|
43
|
+
|
|
44
|
+
const ClearButton = styled.div`
|
|
43
45
|
position: absolute;
|
|
44
|
-
border: none;
|
|
45
|
-
outline: none;
|
|
46
|
-
top: 1px;
|
|
47
|
-
padding: 8px 12px;
|
|
48
|
-
border-radius: 5px;
|
|
49
|
-
font-size: ${fontSize.base};
|
|
50
|
-
color: ${getThemePropSelector('textSecondary')};
|
|
51
|
-
background-color: transparent;
|
|
52
|
-
${(props) => {
|
|
53
|
-
// TODO
|
|
54
|
-
return (
|
|
55
|
-
!props.disabled &&
|
|
56
|
-
css`
|
|
57
|
-
cursor: pointer;
|
|
58
|
-
&:hover {
|
|
59
|
-
color: ${getThemePropSelector('selectedActive')};
|
|
60
|
-
}
|
|
61
|
-
`
|
|
62
|
-
);
|
|
63
|
-
}};
|
|
64
|
-
`;
|
|
65
|
-
const SearchIcon = styled(IconButton)`
|
|
66
|
-
left: 1px;
|
|
67
|
-
`;
|
|
68
|
-
const ResetIcon = styled(IconButton)<{ visible?: boolean }>`
|
|
69
46
|
right: 1px;
|
|
70
|
-
|
|
71
|
-
opacity: ${(props) => (props.visible ? 1 : 0)};
|
|
72
|
-
transition: opacity 0.5s ease-in-out;
|
|
47
|
+
top: 0px;
|
|
73
48
|
`;
|
|
74
49
|
|
|
75
50
|
const SearchInput = forwardRef(
|
|
@@ -81,49 +56,63 @@ const SearchInput = forwardRef(
|
|
|
81
56
|
onChange,
|
|
82
57
|
onReset,
|
|
83
58
|
disabled,
|
|
59
|
+
id,
|
|
60
|
+
size,
|
|
84
61
|
...rest
|
|
85
62
|
}: Props,
|
|
86
63
|
forwardedRef,
|
|
87
64
|
) => {
|
|
88
|
-
const [docked, setDocked] = useState(!disableToggle);
|
|
89
65
|
const myInputRef = useRef<HTMLInputElement | null>(null);
|
|
66
|
+
const debounce = useRef<NodeJS.Timeout | null>(null);
|
|
67
|
+
const [debouncedValue, setDebouncedValue] = useState(value);
|
|
90
68
|
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
myInputRef.current.focus();
|
|
69
|
+
useEffect(() => {
|
|
70
|
+
return () => {
|
|
71
|
+
if (debounce.current) {
|
|
72
|
+
clearTimeout(debounce.current);
|
|
96
73
|
}
|
|
97
|
-
}
|
|
98
|
-
};
|
|
74
|
+
};
|
|
75
|
+
}, []);
|
|
99
76
|
|
|
100
77
|
const reset = () => {
|
|
78
|
+
setDebouncedValue('');
|
|
101
79
|
if (onReset) {
|
|
102
80
|
onReset();
|
|
103
81
|
}
|
|
82
|
+
};
|
|
104
83
|
|
|
105
|
-
|
|
106
|
-
|
|
84
|
+
const handleChange = (e: ChangeEvent<HTMLInputElement>) => {
|
|
85
|
+
setDebouncedValue(e.target.value);
|
|
86
|
+
if (debounce.current) {
|
|
87
|
+
clearTimeout(debounce.current);
|
|
107
88
|
}
|
|
89
|
+
|
|
90
|
+
debounce.current = setTimeout(() => {
|
|
91
|
+
onChange(e);
|
|
92
|
+
}, 300);
|
|
108
93
|
};
|
|
109
94
|
|
|
110
95
|
return (
|
|
111
96
|
<SearchInputContainer
|
|
112
97
|
className="sc-searchinput"
|
|
113
98
|
disabled={disabled}
|
|
114
|
-
docked={docked}
|
|
115
99
|
{...rest}
|
|
116
100
|
>
|
|
117
101
|
<Input
|
|
118
102
|
min={'1'}
|
|
119
|
-
|
|
103
|
+
id={id || 'search'}
|
|
104
|
+
type="search"
|
|
120
105
|
aria-label="search"
|
|
121
106
|
name="search"
|
|
122
107
|
placeholder={placeholder}
|
|
123
|
-
value={
|
|
124
|
-
onChange={
|
|
108
|
+
value={debouncedValue}
|
|
109
|
+
onChange={handleChange}
|
|
110
|
+
onReset={reset}
|
|
111
|
+
size={size}
|
|
112
|
+
leftIcon="Search"
|
|
113
|
+
className="search-box"
|
|
125
114
|
disabled={disabled}
|
|
126
|
-
|
|
115
|
+
ref={(element) => {
|
|
127
116
|
myInputRef.current = element;
|
|
128
117
|
if (typeof forwardedRef === 'function') {
|
|
129
118
|
forwardedRef(element);
|
|
@@ -132,12 +121,15 @@ const SearchInput = forwardRef(
|
|
|
132
121
|
}
|
|
133
122
|
}}
|
|
134
123
|
/>
|
|
135
|
-
|
|
136
|
-
<
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
124
|
+
{debouncedValue && (
|
|
125
|
+
<ClearButton className="close-icon">
|
|
126
|
+
<Button
|
|
127
|
+
icon={<Icon name="Close" />}
|
|
128
|
+
tooltip={{ overlay: 'Reset' }}
|
|
129
|
+
onClick={reset}
|
|
130
|
+
/>
|
|
131
|
+
</ClearButton>
|
|
132
|
+
)}
|
|
141
133
|
</SearchInputContainer>
|
|
142
134
|
);
|
|
143
135
|
},
|
|
@@ -7,8 +7,7 @@ import {
|
|
|
7
7
|
sidebarWidth,
|
|
8
8
|
sidebarItemHeight,
|
|
9
9
|
} from '../../style/theme';
|
|
10
|
-
import {
|
|
11
|
-
import { Button } from '../button/Button.component';
|
|
10
|
+
import { Button } from '../buttonv2/Buttonv2.component';
|
|
12
11
|
import { Icon } from '../icon/Icon.component';
|
|
13
12
|
import { spacing } from '../../spacing';
|
|
14
13
|
import { FocusVisibleStyle } from '../buttonv2/Buttonv2.component';
|
|
@@ -42,7 +41,8 @@ const Wrapper = styled.div<WrapperProps>`
|
|
|
42
41
|
}
|
|
43
42
|
`;
|
|
44
43
|
}}
|
|
45
|
-
|
|
44
|
+
margin-top: 1px;
|
|
45
|
+
border-right: 1px solid ${(props) => props.theme.backgroundLevel3};
|
|
46
46
|
${(props) => {
|
|
47
47
|
if (props.expanded) {
|
|
48
48
|
return css`
|
|
@@ -96,9 +96,10 @@ const SidebarContainer = styled.div<WrapperProps>`
|
|
|
96
96
|
|
|
97
97
|
.sc-button {
|
|
98
98
|
border-radius: 0;
|
|
99
|
-
background-color: ${
|
|
99
|
+
background-color: ${(props) => props.theme.backgroundLevel1};
|
|
100
|
+
color: ${(props) => props.theme.textPrimary};
|
|
100
101
|
&:hover {
|
|
101
|
-
background-color: ${
|
|
102
|
+
background-color: ${(props) => props.theme.highlight};
|
|
102
103
|
}
|
|
103
104
|
&:focus-visible {
|
|
104
105
|
${FocusVisibleStyle}
|
|
@@ -153,7 +154,7 @@ const MenuItemSelected = styled.div`
|
|
|
153
154
|
width: 3px;
|
|
154
155
|
height: 100%;
|
|
155
156
|
right: 0;
|
|
156
|
-
background-color: ${
|
|
157
|
+
background-color: ${(props) => props.theme.selectedActive};
|
|
157
158
|
`;
|
|
158
159
|
const MenuItemIcon = styled.div`
|
|
159
160
|
width: ${sidebarWidth};
|
|
@@ -189,9 +190,7 @@ function Sidebar({
|
|
|
189
190
|
{onToggleClick && (
|
|
190
191
|
<MenuItemIcon>
|
|
191
192
|
<Button
|
|
192
|
-
size="
|
|
193
|
-
variant="backgroundLevel1"
|
|
194
|
-
icon={<Icon name="Lat-menu" />}
|
|
193
|
+
icon={<Icon size="lg" name="Lat-menu" />}
|
|
195
194
|
onClick={() => {
|
|
196
195
|
setHovered(false);
|
|
197
196
|
onToggleClick();
|
|
@@ -23,7 +23,7 @@ export type SearchProps = {
|
|
|
23
23
|
displayedName: DisplayedName;
|
|
24
24
|
locale?: TableLocalType;
|
|
25
25
|
totalCount?: number;
|
|
26
|
-
} & Omit<Props, 'disableToggle'>;
|
|
26
|
+
} & Omit<Props, 'disableToggle' | 'onChange'>;
|
|
27
27
|
|
|
28
28
|
const SearchContainer = styled.div`
|
|
29
29
|
display: flex;
|
|
@@ -99,6 +99,7 @@ export function TableSearch(props: SearchProps) {
|
|
|
99
99
|
value={value}
|
|
100
100
|
placeholder={translations[locale].search}
|
|
101
101
|
disableToggle
|
|
102
|
+
size="2/3"
|
|
102
103
|
onChange={(evt) => {
|
|
103
104
|
if (typeof onChange === 'function') {
|
|
104
105
|
// @ts-ignore
|
|
@@ -4,14 +4,15 @@ import { TableSearch as Search, SearchProps } from './Search';
|
|
|
4
4
|
|
|
5
5
|
export type SearchWithQueryParamsProps = {
|
|
6
6
|
queryParams?: string;
|
|
7
|
-
} & SearchProps
|
|
7
|
+
} & Omit<SearchProps, 'onChange' | 'value'> &
|
|
8
|
+
Partial<Pick<SearchProps, 'onChange'>>;
|
|
8
9
|
|
|
9
|
-
export function SearchWithQueryParams(props) {
|
|
10
|
+
export function SearchWithQueryParams(props: SearchWithQueryParamsProps) {
|
|
10
11
|
const { queryParams = 'search', onChange, ...rest } = props;
|
|
11
12
|
const { search, pathname } = useLocation();
|
|
12
13
|
const history = useHistory();
|
|
13
14
|
const params = new URLSearchParams(search);
|
|
14
|
-
const initialValue = params.get(queryParams);
|
|
15
|
+
const initialValue = params.get(queryParams) || '';
|
|
15
16
|
const [value, setValue] = useState(initialValue);
|
|
16
17
|
|
|
17
18
|
function handleOnChange(value: string) {
|
|
@@ -53,8 +53,8 @@ export const HeadRow = styled.div<HeadRowType>`
|
|
|
53
53
|
height: 2.286rem;
|
|
54
54
|
width: ${(props) =>
|
|
55
55
|
props.hasScrollBar
|
|
56
|
-
? `calc(100% - ${props.scrollBarWidth}px - ${borderSize} )!important
|
|
57
|
-
: `calc(100% - ${borderSize} ) !important
|
|
56
|
+
? `calc(100% - ${props.scrollBarWidth}px - ${borderSize} )!important` // -4px for border
|
|
57
|
+
: `calc(100% - ${borderSize} ) !important`};
|
|
58
58
|
height: ${(props) => tableRowHeight[props.rowHeight]}rem;
|
|
59
59
|
table-layout: fixed;
|
|
60
60
|
color: ${(props) => props.theme.textPrimary};
|