onekijs-ui 0.19.21 → 0.19.22
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/alert/components/AlertComponent.d.ts +4 -0
- package/dist/components/alert/index.d.ts +2 -0
- package/dist/components/alert/style.d.ts +4 -0
- package/dist/components/alert/typings.d.ts +11 -0
- package/dist/components/card/typings.d.ts +1 -0
- package/dist/components/icon/CrossIcon.d.ts +2 -1
- package/dist/components/icon/typings.d.ts +3 -1
- package/dist/components/wizard/typings.d.ts +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +237 -112
- package/dist/index.js.map +1 -1
- package/dist/index.module.js +235 -113
- package/dist/index.module.js.map +1 -1
- package/package.json +3 -3
- package/src/components/alert/components/AlertComponent.tsx +56 -0
- package/src/components/alert/index.tsx +9 -0
- package/src/components/alert/style.ts +57 -0
- package/src/components/alert/typings.ts +12 -0
- package/src/components/card/FormCard.tsx +8 -2
- package/src/components/card/typings.ts +1 -0
- package/src/components/icon/CloseAllIcon.tsx +4 -1
- package/src/components/icon/CloseIcon.tsx +4 -1
- package/src/components/icon/CrossIcon.tsx +4 -1
- package/src/components/icon/DebugIcon.tsx +4 -1
- package/src/components/icon/ErrorIcon.tsx +4 -1
- package/src/components/icon/FileIcon.tsx +4 -1
- package/src/components/icon/FilterIcon.tsx +4 -1
- package/src/components/icon/FolderIcon.tsx +4 -1
- package/src/components/icon/HelpIcon.tsx +4 -1
- package/src/components/icon/HideIcon.tsx +4 -1
- package/src/components/icon/InfoIcon.tsx +7 -3
- package/src/components/icon/LoadingIcon.tsx +5 -0
- package/src/components/icon/MenuIcon.tsx +4 -1
- package/src/components/icon/RefreshIcon.tsx +4 -1
- package/src/components/icon/RemoveIcon.tsx +4 -1
- package/src/components/icon/SearchIcon.tsx +4 -1
- package/src/components/icon/ShowIcon.tsx +4 -1
- package/src/components/icon/SuccessIcon.tsx +4 -1
- package/src/components/icon/TogglerIcon.tsx +5 -1
- package/src/components/icon/WarningIcon.tsx +4 -1
- package/src/components/icon/typings.ts +3 -1
- package/src/components/wizard/components/Step.tsx +3 -0
- package/src/components/wizard/typings.ts +1 -0
- package/src/index.ts +5 -0
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "onekijs-ui",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.19.
|
|
4
|
+
"version": "0.19.22",
|
|
5
5
|
"description": "Advanced React Web Components",
|
|
6
6
|
"source": "src/index.ts",
|
|
7
7
|
"main": "dist/index.js",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"@clr/city": "^1.1.0",
|
|
35
35
|
"@popperjs/core": "^2.4.4",
|
|
36
36
|
"@reach/observe-rect": "^1.2.0",
|
|
37
|
-
"onekijs-framework": "^0.19.
|
|
37
|
+
"onekijs-framework": "^0.19.22",
|
|
38
38
|
"react-popper": "^2.3.0",
|
|
39
39
|
"react-popper-tooltip": "^4.4.2",
|
|
40
40
|
"react-virtualized-auto-sizer": "^1.0.2",
|
|
@@ -53,5 +53,5 @@
|
|
|
53
53
|
"react-dom": ">=18"
|
|
54
54
|
},
|
|
55
55
|
"sideEffects": false,
|
|
56
|
-
"gitHead": "
|
|
56
|
+
"gitHead": "828f0f1467d11e7b7fa9379ef26b668db37f7a84"
|
|
57
57
|
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { addClassname } from '../../../utils/style';
|
|
3
|
+
import { FCC } from 'onekijs-framework';
|
|
4
|
+
import { AlertProps } from '../typings';
|
|
5
|
+
import InfoIcon from '../../icon/InfoIcon';
|
|
6
|
+
import DebugIcon from '../../icon/DebugIcon';
|
|
7
|
+
import ErrorIcon from '../../icon/ErrorIcon';
|
|
8
|
+
import WarningIcon from '../../icon/WarningIcon';
|
|
9
|
+
import SuccessIcon from '../../icon/SuccessIcon';
|
|
10
|
+
|
|
11
|
+
const getDefautltIconComponent = (kind: AlertProps['kind']) => {
|
|
12
|
+
switch(kind) {
|
|
13
|
+
case 'debug':
|
|
14
|
+
return DebugIcon;
|
|
15
|
+
case 'error':
|
|
16
|
+
return ErrorIcon;
|
|
17
|
+
case 'warning':
|
|
18
|
+
return WarningIcon;
|
|
19
|
+
case 'success':
|
|
20
|
+
return SuccessIcon;
|
|
21
|
+
default:
|
|
22
|
+
return InfoIcon;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
const getIconSize = (size: AlertProps['size']) => {
|
|
27
|
+
switch(size) {
|
|
28
|
+
case 'small':
|
|
29
|
+
return '24px';
|
|
30
|
+
case 'large':
|
|
31
|
+
return '48px';
|
|
32
|
+
default:
|
|
33
|
+
return '36px';
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
const AlertComponent: FCC<AlertProps> = ({
|
|
38
|
+
kind = 'info',
|
|
39
|
+
icon = true,
|
|
40
|
+
IconComponent,
|
|
41
|
+
className,
|
|
42
|
+
children,
|
|
43
|
+
size,
|
|
44
|
+
}) => {
|
|
45
|
+
if (IconComponent === undefined) {
|
|
46
|
+
IconComponent = getDefautltIconComponent(kind);
|
|
47
|
+
}
|
|
48
|
+
return (
|
|
49
|
+
<div className={addClassname(`g-alert g-alert-${kind}`, className)}>
|
|
50
|
+
{icon && <IconComponent width={getIconSize(size)} height={getIconSize(size)} marginRight='20px' marginLeft='20px' />}
|
|
51
|
+
<div>{children}</div>
|
|
52
|
+
</div>
|
|
53
|
+
)
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export default AlertComponent;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { css } from 'styled-components';
|
|
2
|
+
import { ComponentStyle } from '../../styles/typings';
|
|
3
|
+
import { AlertProps } from './typings';
|
|
4
|
+
import { display } from '../../styles/display';
|
|
5
|
+
import { alignItems } from '../../styles/alignment';
|
|
6
|
+
import { backgroundColor } from '../../styles/background';
|
|
7
|
+
import { borderColor, borderRadius, borderStyle, borderWidth } from '../../styles/border';
|
|
8
|
+
import { color } from '../../styles/typography';
|
|
9
|
+
import { marginBottom, marginTop, padding } from '../../styles/spacing';
|
|
10
|
+
|
|
11
|
+
const getBackgroundColor = (kind: AlertProps['kind']) => {
|
|
12
|
+
switch(kind) {
|
|
13
|
+
case 'success': return 'green-100';
|
|
14
|
+
case 'info': return 'blue-100';
|
|
15
|
+
case 'warning': return 'orange-200';
|
|
16
|
+
case 'error': return 'red-100';
|
|
17
|
+
default: return 'lighter';
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
const getBorderColor = (kind: AlertProps['kind']) => {
|
|
22
|
+
switch(kind) {
|
|
23
|
+
case 'success': return 'success';
|
|
24
|
+
case 'info': return 'info';
|
|
25
|
+
case 'warning': return 'warning';
|
|
26
|
+
case 'error': return 'danger';
|
|
27
|
+
default: return 'darker';
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
const getFontColor = (kind: AlertProps['kind']) => {
|
|
32
|
+
switch(kind) {
|
|
33
|
+
case 'success': return 'green-800';
|
|
34
|
+
case 'info': return 'blue-800';
|
|
35
|
+
case 'warning': return 'orange-800';
|
|
36
|
+
case 'error': return 'red-800';
|
|
37
|
+
default: return 'darkest';
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
const alertStyle: ComponentStyle<AlertProps> = ({ kind = 'info', marginTop: mTop = '0px', marginBottom: mBottom = '0px', size = 'medium' }) => {
|
|
42
|
+
return css`
|
|
43
|
+
${display('flex')}
|
|
44
|
+
${alignItems('center')}
|
|
45
|
+
${backgroundColor(getBackgroundColor(kind))}
|
|
46
|
+
${borderColor(getBorderColor(kind))}
|
|
47
|
+
${color(getFontColor(kind))}
|
|
48
|
+
${padding(size === 'large' ? 'lg' : size === 'small' ? 'sm' : 'md')}
|
|
49
|
+
${borderStyle('solid')}
|
|
50
|
+
${borderWidth('1px')}
|
|
51
|
+
${borderRadius('sm')}
|
|
52
|
+
${marginTop(mTop)}
|
|
53
|
+
${marginBottom(mBottom)}
|
|
54
|
+
`
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export default alertStyle;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { SpacingPropertyTheme, StylableProps } from '../../styles/typings';
|
|
3
|
+
import { IconProps } from '../icon/typings';
|
|
4
|
+
|
|
5
|
+
export type AlertProps = StylableProps & {
|
|
6
|
+
kind?: 'success' | 'info' | 'warning' | 'error' | 'debug'
|
|
7
|
+
icon?: boolean;
|
|
8
|
+
IconComponent?: React.FC<IconProps>;
|
|
9
|
+
marginBottom?: SpacingPropertyTheme;
|
|
10
|
+
marginTop?: SpacingPropertyTheme;
|
|
11
|
+
size?: 'small' | 'medium' | 'large'
|
|
12
|
+
}
|
|
@@ -4,9 +4,10 @@ import Card from '.';
|
|
|
4
4
|
import { FormCardProps } from './typings';
|
|
5
5
|
import { titlelize } from '../../utils/misc';
|
|
6
6
|
import FormCardDisplayer from './FormCardDisplayer';
|
|
7
|
+
import Alert from '../alert';
|
|
7
8
|
|
|
8
9
|
|
|
9
|
-
const FormCard: FCC<FormCardProps> = ({ name, ...cardProps }) => {
|
|
10
|
+
const FormCard: FCC<FormCardProps> = ({ name, help, children, ...cardProps }) => {
|
|
10
11
|
const decorator = useFormDecorator(name, {
|
|
11
12
|
Displayer: (displayerProps: FormDisplayerProps) => {
|
|
12
13
|
return <FormCardDisplayer {...displayerProps} name={typeof cardProps.title === 'string' ? cardProps.title : titlelize(name)} />
|
|
@@ -63,7 +64,12 @@ const FormCard: FCC<FormCardProps> = ({ name, ...cardProps }) => {
|
|
|
63
64
|
{...cardProps}
|
|
64
65
|
open={!metadata.disabled}
|
|
65
66
|
onToggle={() => (metadata.disabled ? form.enable(decorator.name) : form.disable(decorator.name))}
|
|
66
|
-
|
|
67
|
+
>
|
|
68
|
+
<>
|
|
69
|
+
{help && <Alert kind="info" size="small" marginBottom="2xl">{help}</Alert>}
|
|
70
|
+
{children}
|
|
71
|
+
</>
|
|
72
|
+
</Card>
|
|
67
73
|
</FormContext.Provider>
|
|
68
74
|
);
|
|
69
75
|
};
|
|
@@ -4,6 +4,7 @@ import { alignItems } from '../../styles/alignment';
|
|
|
4
4
|
import { display } from '../../styles/display';
|
|
5
5
|
import { color } from '../../styles/typography';
|
|
6
6
|
import { IconProps } from './typings';
|
|
7
|
+
import { marginLeft, marginRight } from '../../styles/spacing';
|
|
7
8
|
|
|
8
9
|
const IconComponent: FC<IconProps> = ({ className, onClick }) => {
|
|
9
10
|
return (
|
|
@@ -25,9 +26,11 @@ const IconComponent: FC<IconProps> = ({ className, onClick }) => {
|
|
|
25
26
|
};
|
|
26
27
|
|
|
27
28
|
export default styled(IconComponent)`
|
|
28
|
-
${({ width, height, color: cssColor = 'inherit' }) => css`
|
|
29
|
+
${({ width, height, color: cssColor = 'inherit', marginLeft: ml = '0', marginRight: mr = '0' }) => css`
|
|
29
30
|
width: ${width};
|
|
30
31
|
height: ${height};
|
|
32
|
+
${marginLeft(ml)}
|
|
33
|
+
${marginRight(mr)}
|
|
31
34
|
${display('flex')};
|
|
32
35
|
${alignItems('center')};
|
|
33
36
|
${color(cssColor)}
|
|
@@ -4,6 +4,7 @@ import { alignItems } from '../../styles/alignment';
|
|
|
4
4
|
import { display } from '../../styles/display';
|
|
5
5
|
import { color } from '../../styles/typography';
|
|
6
6
|
import { IconProps } from './typings';
|
|
7
|
+
import { marginLeft, marginRight } from '../../styles/spacing';
|
|
7
8
|
|
|
8
9
|
const CloseIconComponent: FC<IconProps> = (props) => {
|
|
9
10
|
return (
|
|
@@ -20,9 +21,11 @@ const CloseIconComponent: FC<IconProps> = (props) => {
|
|
|
20
21
|
};
|
|
21
22
|
|
|
22
23
|
export default styled(CloseIconComponent)`
|
|
23
|
-
${({ width = '16px', height = '16px', color: cssColor = 'inherit' }) => css`
|
|
24
|
+
${({ width = '16px', height = '16px', color: cssColor = 'inherit', marginLeft: ml = '0', marginRight: mr = '0' }) => css`
|
|
24
25
|
width: ${width};
|
|
25
26
|
height: ${height};
|
|
27
|
+
${marginLeft(ml)}
|
|
28
|
+
${marginRight(mr)}
|
|
26
29
|
${display('flex')};
|
|
27
30
|
${alignItems('center')};
|
|
28
31
|
${color(cssColor)}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
//#region -- system import
|
|
2
2
|
import React, { FC } from 'react';
|
|
3
3
|
import styled from 'styled-components';
|
|
4
|
+
import { IconProps } from './typings';
|
|
4
5
|
//#endregion
|
|
5
6
|
|
|
6
|
-
const IconComponent: FC<
|
|
7
|
+
const IconComponent: FC<IconProps> = ({ className }) => {
|
|
7
8
|
return (
|
|
8
9
|
<div className={className}>
|
|
9
10
|
<svg className="o-icon-close-svg" viewBox="0 0 100 100">
|
|
@@ -16,6 +17,8 @@ const IconComponent: FC<React.InputHTMLAttributes<HTMLDivElement>> = ({ classNam
|
|
|
16
17
|
const CrossIcon = styled(IconComponent)`
|
|
17
18
|
width: ${(props) => props.width || '32px'};
|
|
18
19
|
height: ${(props) => props.height || '32px'};
|
|
20
|
+
margin-top: ${(props) => props.marginRight || '0px'};
|
|
21
|
+
margin-left: ${(props) => props.marginLeft || '0px'};
|
|
19
22
|
.o-icon-close-svg {
|
|
20
23
|
display: inline-block;
|
|
21
24
|
stroke-width: 0;
|
|
@@ -4,6 +4,7 @@ import { alignItems } from '../../styles/alignment';
|
|
|
4
4
|
import { display } from '../../styles/display';
|
|
5
5
|
import { color } from '../../styles/typography';
|
|
6
6
|
import { IconProps } from './typings';
|
|
7
|
+
import { marginLeft, marginRight } from '../../styles/spacing';
|
|
7
8
|
|
|
8
9
|
const DebugIconComponent: FC<IconProps> = (props) => {
|
|
9
10
|
return (
|
|
@@ -21,9 +22,11 @@ const DebugIconComponent: FC<IconProps> = (props) => {
|
|
|
21
22
|
};
|
|
22
23
|
|
|
23
24
|
export default styled(DebugIconComponent)`
|
|
24
|
-
${({ width = '16px', height = '16px', color: cssColor = 'inherit' }) => css`
|
|
25
|
+
${({ width = '16px', height = '16px', color: cssColor = 'inherit', marginLeft: ml = '0', marginRight: mr = '0' }) => css`
|
|
25
26
|
width: ${width};
|
|
26
27
|
height: ${height};
|
|
28
|
+
${marginLeft(ml)}
|
|
29
|
+
${marginRight(mr)}
|
|
27
30
|
${display('flex')};
|
|
28
31
|
${alignItems('center')};
|
|
29
32
|
${color(cssColor)}
|
|
@@ -4,6 +4,7 @@ import { alignItems } from '../../styles/alignment';
|
|
|
4
4
|
import { display } from '../../styles/display';
|
|
5
5
|
import { color } from '../../styles/typography';
|
|
6
6
|
import { IconProps } from './typings';
|
|
7
|
+
import { marginLeft, marginRight } from '../../styles/spacing';
|
|
7
8
|
|
|
8
9
|
const ErrorIconComponent: FC<IconProps> = (props) => {
|
|
9
10
|
return (
|
|
@@ -20,9 +21,11 @@ const ErrorIconComponent: FC<IconProps> = (props) => {
|
|
|
20
21
|
};
|
|
21
22
|
|
|
22
23
|
export default styled(ErrorIconComponent)`
|
|
23
|
-
${({ width = '16px', height = '16px', color: cssColor = 'danger' }) => css`
|
|
24
|
+
${({ width = '16px', height = '16px', color: cssColor = 'danger', marginLeft: ml = '0', marginRight: mr = '0' }) => css`
|
|
24
25
|
width: ${width};
|
|
25
26
|
height: ${height};
|
|
27
|
+
${marginLeft(ml)}
|
|
28
|
+
${marginRight(mr)}
|
|
26
29
|
${display('flex')};
|
|
27
30
|
${alignItems('center')};
|
|
28
31
|
${color(cssColor)}
|
|
@@ -4,6 +4,7 @@ import { alignItems } from '../../styles/alignment';
|
|
|
4
4
|
import { display } from '../../styles/display';
|
|
5
5
|
import { addClassname } from '../../utils/style';
|
|
6
6
|
import { IconProps } from './typings';
|
|
7
|
+
import { marginLeft, marginRight } from '../../styles/spacing';
|
|
7
8
|
|
|
8
9
|
const IconComponent: FC<IconProps> = (props) => {
|
|
9
10
|
const className = addClassname('o-icon-file', props.className);
|
|
@@ -23,9 +24,11 @@ const IconComponent: FC<IconProps> = (props) => {
|
|
|
23
24
|
};
|
|
24
25
|
|
|
25
26
|
export default styled(IconComponent)`
|
|
26
|
-
${({ width = '16px', height = '16px', color: cssColor = 'currentColor' }) => css`
|
|
27
|
+
${({ width = '16px', height = '16px', color: cssColor = 'currentColor', marginLeft: ml = '0', marginRight: mr = '0' }) => css`
|
|
27
28
|
width: ${width};
|
|
28
29
|
height: ${height};
|
|
30
|
+
${marginLeft(ml)}
|
|
31
|
+
${marginRight(mr)}
|
|
29
32
|
${display('flex')};
|
|
30
33
|
${alignItems('center')};
|
|
31
34
|
.o-icon-file-svg {
|
|
@@ -4,6 +4,7 @@ import { alignItems } from '../../styles/alignment';
|
|
|
4
4
|
import { display } from '../../styles/display';
|
|
5
5
|
import { color } from '../../styles/typography';
|
|
6
6
|
import { IconProps } from './typings';
|
|
7
|
+
import { marginLeft, marginRight } from '../../styles/spacing';
|
|
7
8
|
|
|
8
9
|
// <!-- Font Awesome Free 5.15.4 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) -->
|
|
9
10
|
const IconComponent: FC<IconProps> = ({ className, onClick }) => {
|
|
@@ -17,9 +18,11 @@ const IconComponent: FC<IconProps> = ({ className, onClick }) => {
|
|
|
17
18
|
};
|
|
18
19
|
|
|
19
20
|
export default styled(IconComponent)`
|
|
20
|
-
${({ width, height, color: cssColor = 'inherit' }) => css`
|
|
21
|
+
${({ width, height, color: cssColor = 'inherit', marginLeft: ml = '0', marginRight: mr = '0' }) => css`
|
|
21
22
|
width: ${width};
|
|
22
23
|
height: ${height};
|
|
24
|
+
${marginLeft(ml)}
|
|
25
|
+
${marginRight(mr)}
|
|
23
26
|
${display('flex')};
|
|
24
27
|
${alignItems('center')};
|
|
25
28
|
${color(cssColor)}
|
|
@@ -4,6 +4,7 @@ import { addClassname } from '../../utils/style';
|
|
|
4
4
|
import { alignItems } from '../../styles/alignment';
|
|
5
5
|
import { display } from '../../styles/display';
|
|
6
6
|
import { IconProps } from './typings';
|
|
7
|
+
import { marginLeft, marginRight } from '../../styles/spacing';
|
|
7
8
|
|
|
8
9
|
const IconComponent: FC<IconProps> = (props) => {
|
|
9
10
|
const className = addClassname('o-icon-folder', props.className);
|
|
@@ -23,9 +24,11 @@ const IconComponent: FC<IconProps> = (props) => {
|
|
|
23
24
|
};
|
|
24
25
|
|
|
25
26
|
export default styled(IconComponent)`
|
|
26
|
-
${({ width = '24px', height = '24px', color: cssColor = 'currentColor' }) => css`
|
|
27
|
+
${({ width = '24px', height = '24px', color: cssColor = 'currentColor', marginLeft: ml = '0', marginRight: mr = '0' }) => css`
|
|
27
28
|
width: ${width};
|
|
28
29
|
height: ${height};
|
|
30
|
+
${marginLeft(ml)}
|
|
31
|
+
${marginRight(mr)}
|
|
29
32
|
${display('flex')};
|
|
30
33
|
${alignItems('center')};
|
|
31
34
|
.o-icon-folder-svg {
|
|
@@ -5,6 +5,7 @@ import { alignItems } from '../../styles/alignment';
|
|
|
5
5
|
import { display } from '../../styles/display';
|
|
6
6
|
import { IconProps } from './typings';
|
|
7
7
|
import { addClassname } from '../../utils/style';
|
|
8
|
+
import { marginLeft, marginRight } from '../../styles/spacing';
|
|
8
9
|
|
|
9
10
|
const IconComponent: FC<IconProps> = ({ className, onClick, style }) => {
|
|
10
11
|
return (
|
|
@@ -21,9 +22,11 @@ const IconComponent: FC<IconProps> = ({ className, onClick, style }) => {
|
|
|
21
22
|
};
|
|
22
23
|
|
|
23
24
|
export default styled(IconComponent)`
|
|
24
|
-
${({ width = '24px', height = '24px', color: cssColor = 'inherit' }) => css`
|
|
25
|
+
${({ width = '24px', height = '24px', color: cssColor = 'inherit', marginLeft: ml = '0', marginRight: mr = '0' }) => css`
|
|
25
26
|
width: ${width};
|
|
26
27
|
height: ${height};
|
|
28
|
+
${marginLeft(ml)}
|
|
29
|
+
${marginRight(mr)}
|
|
27
30
|
${display('flex')};
|
|
28
31
|
${alignItems('center')};
|
|
29
32
|
${color(cssColor)}
|
|
@@ -4,6 +4,7 @@ import { alignItems } from '../../styles/alignment';
|
|
|
4
4
|
import { display } from '../../styles/display';
|
|
5
5
|
import { addClassname } from '../../utils/style';
|
|
6
6
|
import { IconProps } from './typings';
|
|
7
|
+
import { marginLeft, marginRight } from '../../styles/spacing';
|
|
7
8
|
|
|
8
9
|
const IconComponent: FC<IconProps> = (props) => {
|
|
9
10
|
const className = addClassname('o-icon-hide', props.className);
|
|
@@ -18,9 +19,11 @@ const IconComponent: FC<IconProps> = (props) => {
|
|
|
18
19
|
};
|
|
19
20
|
|
|
20
21
|
export default styled(IconComponent)`
|
|
21
|
-
${({ width = '16px', height = '16px', color: cssColor = 'currentColor' }) => css`
|
|
22
|
+
${({ width = '16px', height = '16px', color: cssColor = 'currentColor', marginLeft: ml = '0', marginRight: mr = '0' }) => css`
|
|
22
23
|
width: ${width};
|
|
23
24
|
height: ${height};
|
|
25
|
+
${marginLeft(ml)}
|
|
26
|
+
${marginRight(mr)}
|
|
24
27
|
${display('flex')};
|
|
25
28
|
${alignItems('center')};
|
|
26
29
|
.o-icon-hide-svg {
|
|
@@ -4,11 +4,13 @@ import { alignItems } from '../../styles/alignment';
|
|
|
4
4
|
import { display } from '../../styles/display';
|
|
5
5
|
import { color } from '../../styles/typography';
|
|
6
6
|
import { IconProps } from './typings';
|
|
7
|
+
import { marginLeft, marginRight } from '../../styles/spacing';
|
|
8
|
+
import { fill } from '../../styles/svg';
|
|
7
9
|
|
|
8
10
|
const InfoIconComponent: FC<IconProps> = (props) => {
|
|
9
11
|
return (
|
|
10
12
|
<div {...props}>
|
|
11
|
-
<svg className="o-icon-
|
|
13
|
+
<svg className="o-icon-info-svg" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg">
|
|
12
14
|
<path
|
|
13
15
|
fillRule="evenodd"
|
|
14
16
|
clipRule="evenodd"
|
|
@@ -20,15 +22,17 @@ const InfoIconComponent: FC<IconProps> = (props) => {
|
|
|
20
22
|
};
|
|
21
23
|
|
|
22
24
|
export default styled(InfoIconComponent)`
|
|
23
|
-
${({ width = '16px', height = '16px', color: cssColor = 'info' }) => css`
|
|
25
|
+
${({ width = '16px', height = '16px', color: cssColor = 'info', marginLeft: ml = '0', marginRight: mr = '0' }) => css`
|
|
24
26
|
width: ${width};
|
|
25
27
|
height: ${height};
|
|
28
|
+
${marginLeft(ml)}
|
|
29
|
+
${marginRight(mr)}
|
|
26
30
|
${display('flex')};
|
|
27
31
|
${alignItems('center')};
|
|
28
32
|
${color(cssColor)}
|
|
29
33
|
.o-icon-info-svg {
|
|
30
34
|
display: inline-block;
|
|
31
|
-
fill
|
|
35
|
+
${fill('currentColor')}
|
|
32
36
|
}
|
|
33
37
|
`}
|
|
34
38
|
`;
|
|
@@ -4,6 +4,7 @@ import { stroke } from '../../styles/svg';
|
|
|
4
4
|
import { ComponentStyle } from '../../styles/typings';
|
|
5
5
|
import { addClassname } from '../../utils/style';
|
|
6
6
|
import { IconProps } from './typings';
|
|
7
|
+
import { marginLeft, marginRight } from '../../styles/spacing';
|
|
7
8
|
|
|
8
9
|
const IconComponent: FC<IconProps> = ({ className }) => {
|
|
9
10
|
return (
|
|
@@ -45,10 +46,14 @@ const iconStyle: ComponentStyle<IconProps> = ({
|
|
|
45
46
|
width: cssWidth = '16px',
|
|
46
47
|
height: cssHeight = '16px',
|
|
47
48
|
color: cssColor = 'primary',
|
|
49
|
+
marginLeft: ml = '0',
|
|
50
|
+
marginRight: mr = '0',
|
|
48
51
|
}) => {
|
|
49
52
|
return css`
|
|
50
53
|
height: ${cssHeight};
|
|
51
54
|
width: ${cssWidth};
|
|
55
|
+
${marginLeft(ml)}
|
|
56
|
+
${marginRight(mr)}
|
|
52
57
|
display: inline-flex;
|
|
53
58
|
align-items: center;
|
|
54
59
|
|
|
@@ -5,6 +5,7 @@ import { alignItems } from '../../styles/alignment';
|
|
|
5
5
|
import { display } from '../../styles/display';
|
|
6
6
|
import { IconProps } from './typings';
|
|
7
7
|
import { cursor } from '../../styles/interactivity';
|
|
8
|
+
import { marginLeft, marginRight } from '../../styles/spacing';
|
|
8
9
|
|
|
9
10
|
const IconComponent: FC<IconProps> = (props) => {
|
|
10
11
|
return (
|
|
@@ -19,9 +20,11 @@ const IconComponent: FC<IconProps> = (props) => {
|
|
|
19
20
|
};
|
|
20
21
|
|
|
21
22
|
export default styled(IconComponent)`
|
|
22
|
-
${({ width = '16px', height = '16px', color: cssColor = 'inherit' }) => css`
|
|
23
|
+
${({ width = '16px', height = '16px', color: cssColor = 'inherit', marginLeft: ml = '0', marginRight: mr = '0' }) => css`
|
|
23
24
|
width: ${width};
|
|
24
25
|
height: ${height};
|
|
26
|
+
${marginLeft(ml)}
|
|
27
|
+
${marginRight(mr)}
|
|
25
28
|
${display('flex')};
|
|
26
29
|
${alignItems('center')};
|
|
27
30
|
${color(cssColor)}
|
|
@@ -4,6 +4,7 @@ import { alignItems } from '../../styles/alignment';
|
|
|
4
4
|
import { display } from '../../styles/display';
|
|
5
5
|
import { color } from '../../styles/typography';
|
|
6
6
|
import { IconProps } from './typings';
|
|
7
|
+
import { marginLeft, marginRight } from '../../styles/spacing';
|
|
7
8
|
|
|
8
9
|
const RefreshIconComponent: FC<IconProps> = (props) => {
|
|
9
10
|
return (
|
|
@@ -28,9 +29,11 @@ const RefreshIconComponent: FC<IconProps> = (props) => {
|
|
|
28
29
|
};
|
|
29
30
|
|
|
30
31
|
export default styled(RefreshIconComponent)`
|
|
31
|
-
${({ width = '16px', height = '16px', color: cssColor = 'inherit' }) => css`
|
|
32
|
+
${({ width = '16px', height = '16px', color: cssColor = 'inherit', marginLeft: ml = '0', marginRight: mr = '0' }) => css`
|
|
32
33
|
width: ${width};
|
|
33
34
|
height: ${height};
|
|
35
|
+
${marginLeft(ml)}
|
|
36
|
+
${marginRight(mr)}
|
|
34
37
|
${display('flex')};
|
|
35
38
|
${alignItems('center')};
|
|
36
39
|
${color(cssColor)}
|
|
@@ -4,6 +4,7 @@ import { alignItems } from '../../styles/alignment';
|
|
|
4
4
|
import { display } from '../../styles/display';
|
|
5
5
|
import { color } from '../../styles/typography';
|
|
6
6
|
import { IconProps } from './typings';
|
|
7
|
+
import { marginLeft, marginRight } from '../../styles/spacing';
|
|
7
8
|
|
|
8
9
|
const RemoveIcon: FC<IconProps> = ({ className, onClick }) => {
|
|
9
10
|
return (
|
|
@@ -26,9 +27,11 @@ const RemoveIcon: FC<IconProps> = ({ className, onClick }) => {
|
|
|
26
27
|
};
|
|
27
28
|
|
|
28
29
|
export default styled(RemoveIcon)`
|
|
29
|
-
${({ width = '16px', height = '16px', color: cssColor = 'inherit' }) => css`
|
|
30
|
+
${({ width = '16px', height = '16px', color: cssColor = 'inherit', marginLeft: ml = '0', marginRight: mr = '0' }) => css`
|
|
30
31
|
width: ${width};
|
|
31
32
|
height: ${height};
|
|
33
|
+
${marginLeft(ml)}
|
|
34
|
+
${marginRight(mr)}
|
|
32
35
|
${display('flex')};
|
|
33
36
|
${alignItems('center')};
|
|
34
37
|
${color(cssColor)}
|
|
@@ -5,6 +5,7 @@ import { alignItems } from '../../styles/alignment';
|
|
|
5
5
|
import { display } from '../../styles/display';
|
|
6
6
|
import { IconProps } from './typings';
|
|
7
7
|
import styled, { css } from 'styled-components';
|
|
8
|
+
import { marginLeft, marginRight } from '../../styles/spacing';
|
|
8
9
|
|
|
9
10
|
const IconComponent: FC<IconProps> = ({ className, onClick }) => {
|
|
10
11
|
return (
|
|
@@ -23,9 +24,11 @@ const IconComponent: FC<IconProps> = ({ className, onClick }) => {
|
|
|
23
24
|
};
|
|
24
25
|
|
|
25
26
|
export default styled(IconComponent)`
|
|
26
|
-
${({ width, height, color: cssColor = 'inherit' }) => css`
|
|
27
|
+
${({ width, height, color: cssColor = 'inherit', marginLeft: ml = '0', marginRight: mr = '0' }) => css`
|
|
27
28
|
width: ${width};
|
|
28
29
|
height: ${height};
|
|
30
|
+
${marginLeft(ml)}
|
|
31
|
+
${marginRight(mr)}
|
|
29
32
|
${display('flex')};
|
|
30
33
|
${alignItems('center')};
|
|
31
34
|
${color(cssColor)}
|
|
@@ -4,6 +4,7 @@ import { alignItems } from '../../styles/alignment';
|
|
|
4
4
|
import { display } from '../../styles/display';
|
|
5
5
|
import { addClassname } from '../../utils/style';
|
|
6
6
|
import { IconProps } from './typings';
|
|
7
|
+
import { marginLeft, marginRight } from '../../styles/spacing';
|
|
7
8
|
|
|
8
9
|
const IconComponent: FC<IconProps> = (props) => {
|
|
9
10
|
const className = addClassname('o-icon-show', props.className);
|
|
@@ -17,9 +18,11 @@ const IconComponent: FC<IconProps> = (props) => {
|
|
|
17
18
|
};
|
|
18
19
|
|
|
19
20
|
export default styled(IconComponent)`
|
|
20
|
-
${({ width = '16px', height = '16px', color: cssColor = 'currentColor' }) => css`
|
|
21
|
+
${({ width = '16px', height = '16px', color: cssColor = 'currentColor', marginLeft: ml = '0', marginRight: mr = '0' }) => css`
|
|
21
22
|
width: ${width};
|
|
22
23
|
height: ${height};
|
|
24
|
+
${marginLeft(ml)}
|
|
25
|
+
${marginRight(mr)}
|
|
23
26
|
${display('flex')};
|
|
24
27
|
${alignItems('center')};
|
|
25
28
|
.o-icon-show-svg {
|
|
@@ -4,6 +4,7 @@ import { alignItems } from '../../styles/alignment';
|
|
|
4
4
|
import { display } from '../../styles/display';
|
|
5
5
|
import { color } from '../../styles/typography';
|
|
6
6
|
import { IconProps } from './typings';
|
|
7
|
+
import { marginLeft, marginRight } from '../../styles/spacing';
|
|
7
8
|
|
|
8
9
|
const SuccessIconComponent: FC<IconProps> = (props) => {
|
|
9
10
|
return (
|
|
@@ -23,12 +24,14 @@ const SuccessIconComponent: FC<IconProps> = (props) => {
|
|
|
23
24
|
};
|
|
24
25
|
|
|
25
26
|
export default styled(SuccessIconComponent)`
|
|
26
|
-
${({ width = '16px', height = '16px', color: cssColor = 'success' }) => css`
|
|
27
|
+
${({ width = '16px', height = '16px', color: cssColor = 'success', marginLeft: ml = '0', marginRight: mr = '0' }) => css`
|
|
27
28
|
width: ${width};
|
|
28
29
|
height: ${height};
|
|
29
30
|
${display('flex')};
|
|
30
31
|
${alignItems('center')};
|
|
31
32
|
${color(cssColor)}
|
|
33
|
+
${marginLeft(ml)}
|
|
34
|
+
${marginRight(mr)}
|
|
32
35
|
.o-icon-success-svg {
|
|
33
36
|
display: inline-block;
|
|
34
37
|
fill: currentColor;
|
|
@@ -7,6 +7,7 @@ import { color } from '../../styles/typography';
|
|
|
7
7
|
import { addClassname } from '../../utils/style';
|
|
8
8
|
import LoadingIcon from './LoadingIcon';
|
|
9
9
|
import { TogglerIconProps } from './typings';
|
|
10
|
+
import { marginLeft, marginRight } from '../../styles/spacing';
|
|
10
11
|
|
|
11
12
|
const toDegree = (position: 'n' | 's' | 'w' | 'e'): string => {
|
|
12
13
|
switch (position) {
|
|
@@ -29,6 +30,7 @@ const IconComponent: FC<TogglerIconProps> = ({
|
|
|
29
30
|
model = 'arrow',
|
|
30
31
|
closeArrowPosition = 'e',
|
|
31
32
|
openArrowPosition = 's',
|
|
33
|
+
|
|
32
34
|
}) => {
|
|
33
35
|
const iconClassName = addClassname('o-toggler-icon-container', className);
|
|
34
36
|
if (!loading) {
|
|
@@ -65,9 +67,11 @@ const IconComponent: FC<TogglerIconProps> = ({
|
|
|
65
67
|
};
|
|
66
68
|
|
|
67
69
|
const TogglerIcon = styled(IconComponent)`
|
|
68
|
-
${({ width = '24px', height = '24px', color: cssColor = 'inherit', visible = true }) => css`
|
|
70
|
+
${({ width = '24px', height = '24px', color: cssColor = 'inherit', visible = true, marginLeft: ml = '0', marginRight: mr = '0' }) => css`
|
|
69
71
|
width: ${width};
|
|
70
72
|
height: ${height};
|
|
73
|
+
${marginLeft(ml)}
|
|
74
|
+
${marginRight(mr)}
|
|
71
75
|
${display('inline-flex')};
|
|
72
76
|
${alignItems('center')};
|
|
73
77
|
${color(cssColor)}
|