travelcircus-styleguide 2.3.3 → 2.4.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/esm/components/Button.js +79 -0
- package/dist/esm/components/Checkbox.js +122 -0
- package/dist/esm/components/EmptyState/EmptyState.js +16 -0
- package/dist/esm/components/EmptyState/index.js +1 -0
- package/dist/esm/components/FlatButton.js +121 -0
- package/dist/esm/components/FlatInput.js +65 -0
- package/dist/esm/components/IconChecker/IconChecker.js +38 -0
- package/dist/esm/components/IconChecker/images.js +1 -0
- package/dist/esm/components/IconChecker/index.js +1 -0
- package/dist/esm/components/Radio.js +61 -0
- package/dist/esm/components/RoundedButton.js +227 -0
- package/dist/esm/components/RoundedInput.js +100 -0
- package/dist/esm/components/RoundedSelect.js +152 -0
- package/dist/esm/components/RoundedTextarea.js +86 -0
- package/dist/esm/components/Stepper/Stepper.js +24 -0
- package/dist/esm/components/Stepper/StepperElements.js +73 -0
- package/dist/esm/components/Stepper/index.js +1 -0
- package/dist/esm/components/Switch.js +120 -0
- package/dist/esm/components/UnderlinedHeading/UnderlinedHeading.js +28 -0
- package/dist/esm/components/UnderlinedHeading/UnderlinedHeadingElements.js +31 -0
- package/dist/esm/components/UnderlinedHeading/index.js +2 -0
- package/dist/esm/components/basic/Box.js +8 -0
- package/dist/esm/components/basic/Button.js +22 -0
- package/dist/esm/components/basic/Card.js +14 -0
- package/dist/esm/components/basic/Flex.js +12 -0
- package/dist/esm/components/basic/Icon.js +29 -0
- package/dist/esm/components/basic/Input.js +22 -0
- package/dist/esm/components/basic/PositionBox.js +9 -0
- package/dist/esm/components/basic/Text.js +95 -0
- package/dist/esm/components/index.js +20 -0
- package/dist/esm/hocs/index.js +2 -0
- package/dist/esm/hocs/withInputLabel.js +105 -0
- package/dist/esm/hocs/withLabel.js +51 -0
- package/dist/esm/icons.js +899 -0
- package/dist/esm/index.js +4 -0
- package/dist/esm/theme/ThemeProvider.js +51 -0
- package/dist/esm/theme/browser.js +17 -0
- package/dist/esm/theme/button.js +180 -0
- package/dist/esm/theme/colors.js +244 -0
- package/dist/esm/theme/flatButton.js +251 -0
- package/dist/esm/theme/flatInput.js +100 -0
- package/dist/esm/theme/index.js +5 -0
- package/dist/esm/theme/media.js +22 -0
- package/dist/esm/theme/roundedButton.js +638 -0
- package/dist/esm/theme/roundedInput.js +128 -0
- package/dist/esm/theme/roundedTextarea.js +68 -0
- package/dist/esm/theme/theme.js +114 -0
- package/dist/esm/utils/accessibility.js +17 -0
- package/dist/esm/utils/number.js +18 -0
- package/dist/esm/utils/styles.js +9 -0
- package/dist/theme/button.js +1 -1
- package/dist/theme/flatButton.js +1 -1
- package/dist/theme/roundedButton.js +1 -1
- package/package.json +20 -4
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import styled from 'styled-components';
|
|
2
|
+
import { Link } from 'react-router-dom';
|
|
3
|
+
import { commonStyle, variants } from '../theme/button';
|
|
4
|
+
import { Button as BaseButton, style as defaultStyle } from './basic/Button';
|
|
5
|
+
export const ButtonVariant = {
|
|
6
|
+
PRIMARY: 'primary',
|
|
7
|
+
PRIMARY_ACCENT: 'primaryAccent',
|
|
8
|
+
PRIMARY_ACTIVE: 'primaryActive',
|
|
9
|
+
PRIMARY_SMALL: 'primarySmall',
|
|
10
|
+
PRIMARY_SMALL_ACTIVE: 'primarySmallActive',
|
|
11
|
+
PRIMARY_LONG: 'primaryLong',
|
|
12
|
+
PRIMARY_LONG_ACCENT: 'primaryLongAccent',
|
|
13
|
+
SECONDARY: 'secondary',
|
|
14
|
+
SECONDARY_SMALL: 'secondarySmall',
|
|
15
|
+
PRIMARY_TEXT: 'primaryText',
|
|
16
|
+
PRIMARY_TEXT_ACCENT: 'primaryTextAccent',
|
|
17
|
+
PRIMARY_ACCENT_DEFAULT: 'primaryAccentDefault'
|
|
18
|
+
};
|
|
19
|
+
const getCustomStyle = ({
|
|
20
|
+
theme: {
|
|
21
|
+
custom: {
|
|
22
|
+
color: {
|
|
23
|
+
primary
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}) => ({
|
|
28
|
+
backgroundColor: `${primary}`,
|
|
29
|
+
borderColor: `${primary}`,
|
|
30
|
+
':hover': {
|
|
31
|
+
backgroundColor: `${primary}`,
|
|
32
|
+
borderColor: `${primary}`
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
const handleCustom = props => props?.theme?.custom ? getCustomStyle(props) : {};
|
|
36
|
+
|
|
37
|
+
/* ================================================== *
|
|
38
|
+
* Button (pure HTML button)
|
|
39
|
+
* ================================================== */
|
|
40
|
+
|
|
41
|
+
export const Button = styled(BaseButton).attrs(({
|
|
42
|
+
variant
|
|
43
|
+
}) => ({
|
|
44
|
+
variant: variant || ButtonVariant.PRIMARY
|
|
45
|
+
}))(commonStyle, variants, handleCustom);
|
|
46
|
+
Button.displayName = 'Button';
|
|
47
|
+
|
|
48
|
+
/* ================================================== *
|
|
49
|
+
* <a> styled as a Button (HTML anchor)
|
|
50
|
+
* ================================================== */
|
|
51
|
+
|
|
52
|
+
export const ButtonLink = styled(Button).attrs({
|
|
53
|
+
as: 'a'
|
|
54
|
+
})``;
|
|
55
|
+
ButtonLink.displayName = 'ButtonLink';
|
|
56
|
+
|
|
57
|
+
/* ================================================== *
|
|
58
|
+
* <div> styled as a Button (non-W3C compliant)
|
|
59
|
+
* ================================================== */
|
|
60
|
+
|
|
61
|
+
export const ButtonBlock = styled(Button).attrs({
|
|
62
|
+
as: 'div'
|
|
63
|
+
})``;
|
|
64
|
+
ButtonBlock.displayName = 'ButtonBlock';
|
|
65
|
+
|
|
66
|
+
/* ================================================== *
|
|
67
|
+
* React Router Link component styled as a Button
|
|
68
|
+
* ================================================== */
|
|
69
|
+
|
|
70
|
+
export const ButtonRouter = styled(Link).attrs(({
|
|
71
|
+
variant
|
|
72
|
+
}) => ({
|
|
73
|
+
variant: variant || ButtonVariant.PRIMARY
|
|
74
|
+
}))({
|
|
75
|
+
...defaultStyle,
|
|
76
|
+
...commonStyle
|
|
77
|
+
}, variants);
|
|
78
|
+
ButtonRouter.displayName = 'ButtonRouter';
|
|
79
|
+
export { Button as default };
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import styled from 'styled-components';
|
|
4
|
+
import { Color } from '../theme/colors';
|
|
5
|
+
import Icon from './basic/Icon';
|
|
6
|
+
const StyledCheckboxWrapper = styled.label.attrs(({
|
|
7
|
+
size,
|
|
8
|
+
space,
|
|
9
|
+
themeColor
|
|
10
|
+
}) => ({
|
|
11
|
+
size: size || 24,
|
|
12
|
+
space: space || 3,
|
|
13
|
+
themeColor: themeColor || Color.BLACK
|
|
14
|
+
}))`
|
|
15
|
+
display: block;
|
|
16
|
+
width: ${({
|
|
17
|
+
size
|
|
18
|
+
}) => size}px;
|
|
19
|
+
height: ${({
|
|
20
|
+
size
|
|
21
|
+
}) => size}px;
|
|
22
|
+
cursor: pointer;
|
|
23
|
+
text-align: center;
|
|
24
|
+
line-height: 16px;
|
|
25
|
+
padding-top: 3px;
|
|
26
|
+
flex-grow: 0;
|
|
27
|
+
flex-shrink: 0;
|
|
28
|
+
position: relative;
|
|
29
|
+
|
|
30
|
+
input {
|
|
31
|
+
position: absolute;
|
|
32
|
+
opacity: 0;
|
|
33
|
+
width: 1px;
|
|
34
|
+
height: 1px;
|
|
35
|
+
margin: 0;
|
|
36
|
+
padding: 0;
|
|
37
|
+
border: 0;
|
|
38
|
+
pointer-events: none;
|
|
39
|
+
|
|
40
|
+
& ~ span {
|
|
41
|
+
display: block;
|
|
42
|
+
position: absolute;
|
|
43
|
+
top: 0;
|
|
44
|
+
left: 0;
|
|
45
|
+
right: 0;
|
|
46
|
+
bottom: 0;
|
|
47
|
+
border: 2px solid
|
|
48
|
+
${({
|
|
49
|
+
isError,
|
|
50
|
+
borderColor = Color.HOTEL_LIGHT_GREY,
|
|
51
|
+
errorBorderColor = Color.RED
|
|
52
|
+
}) => isError ? errorBorderColor : borderColor};
|
|
53
|
+
border-radius: 5px;
|
|
54
|
+
background-color: transparent;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
& ~ ${Icon} {
|
|
58
|
+
display: none;
|
|
59
|
+
position: absolute;
|
|
60
|
+
top: ${({
|
|
61
|
+
space
|
|
62
|
+
}) => space}px;
|
|
63
|
+
left: ${({
|
|
64
|
+
space
|
|
65
|
+
}) => space}px;
|
|
66
|
+
font-weight: 600;
|
|
67
|
+
color: ${Color.WHITE};
|
|
68
|
+
font-size: ${({
|
|
69
|
+
size,
|
|
70
|
+
space
|
|
71
|
+
}) => size - space * 2}px;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
&:checked {
|
|
75
|
+
& ~ span {
|
|
76
|
+
border-color: ${({
|
|
77
|
+
themeColor
|
|
78
|
+
}) => themeColor};
|
|
79
|
+
background-color: ${({
|
|
80
|
+
themeColor
|
|
81
|
+
}) => themeColor};
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
& ~ ${Icon} {
|
|
85
|
+
display: block;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
&:focus-visible ~ span {
|
|
90
|
+
outline: 2px solid #1e5bbb !important;
|
|
91
|
+
outline-offset: 2px;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
`;
|
|
95
|
+
const Checkbox = /*#__PURE__*/React.forwardRef(({
|
|
96
|
+
size = 24,
|
|
97
|
+
space = 3,
|
|
98
|
+
themeColor = Color.BLACK,
|
|
99
|
+
isLightTheme = false,
|
|
100
|
+
isError,
|
|
101
|
+
borderColor,
|
|
102
|
+
errorBorderColor,
|
|
103
|
+
checkColor = Color.WHITE,
|
|
104
|
+
...rest
|
|
105
|
+
}, ref) => /*#__PURE__*/React.createElement(StyledCheckboxWrapper, {
|
|
106
|
+
size: size,
|
|
107
|
+
space: space,
|
|
108
|
+
themeColor: themeColor,
|
|
109
|
+
isLightTheme: isLightTheme,
|
|
110
|
+
isError: isError,
|
|
111
|
+
borderColor: borderColor,
|
|
112
|
+
errorBorderColor: errorBorderColor
|
|
113
|
+
}, /*#__PURE__*/React.createElement("input", _extends({
|
|
114
|
+
type: "checkbox"
|
|
115
|
+
}, rest, {
|
|
116
|
+
ref: ref
|
|
117
|
+
})), /*#__PURE__*/React.createElement("span", null), /*#__PURE__*/React.createElement(Icon, {
|
|
118
|
+
name: "netguru_check",
|
|
119
|
+
color: `${checkColor || Color.WHITE} !important`
|
|
120
|
+
})));
|
|
121
|
+
Checkbox.displayName = 'Checkbox';
|
|
122
|
+
export default Checkbox;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { Box, Text } from "../../components";
|
|
3
|
+
export const EmptyState = () => /*#__PURE__*/React.createElement(Box, null, /*#__PURE__*/React.createElement(Text, {
|
|
4
|
+
as: "h1",
|
|
5
|
+
textAlign: "center",
|
|
6
|
+
mb: "8px"
|
|
7
|
+
}, "\uD83E\uDD17"), /*#__PURE__*/React.createElement(Text, {
|
|
8
|
+
as: "h2",
|
|
9
|
+
textAlign: "center",
|
|
10
|
+
mt: "0",
|
|
11
|
+
mb: "0"
|
|
12
|
+
}, "Nothing to see here!"), /*#__PURE__*/React.createElement(Text, {
|
|
13
|
+
as: "p",
|
|
14
|
+
textAlign: "center",
|
|
15
|
+
mt: "0"
|
|
16
|
+
}, "This variant is missing but it could be implemented upon necessity."));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { EmptyState as default } from './EmptyState';
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import styled from 'styled-components';
|
|
2
|
+
import darken from 'polished/lib/color/darken';
|
|
3
|
+
import colors from '../theme/colors';
|
|
4
|
+
import { commonStyle, variants } from '../theme/flatButton';
|
|
5
|
+
const variantGroups = {
|
|
6
|
+
primary: {
|
|
7
|
+
PRIMARY: 'primary',
|
|
8
|
+
PRIMARY_X_SMALL: 'primaryXSmall',
|
|
9
|
+
PRIMARY_SMALL: 'primarySmall',
|
|
10
|
+
PRIMARY_MEDIUM: 'primaryMedium',
|
|
11
|
+
PRIMARY_LARGE: 'primaryLarge',
|
|
12
|
+
PRIMARY_X_LARGE: 'primaryXLarge'
|
|
13
|
+
},
|
|
14
|
+
primaryLong: {
|
|
15
|
+
PRIMARY_LONG: 'primaryLong',
|
|
16
|
+
PRIMARY_X_SMALL_LONG: 'primaryXSmallLong',
|
|
17
|
+
PRIMARY_SMALL_LONG: 'primarySmallLong',
|
|
18
|
+
PRIMARY_MEDIUM_LONG: 'primaryMediumLong',
|
|
19
|
+
PRIMARY_LARGE_LONG: 'primaryLargeLong',
|
|
20
|
+
PRIMARY_X_LARGE_LONG: 'primaryXLargeLong'
|
|
21
|
+
},
|
|
22
|
+
secondary: {
|
|
23
|
+
SECONDARY: 'secondary',
|
|
24
|
+
SECONDARY_X_SMALL: 'secondaryXSmall',
|
|
25
|
+
SECONDARY_SMALL: 'secondarySmall',
|
|
26
|
+
SECONDARY_MEDIUM: 'secondaryMedium',
|
|
27
|
+
SECONDARY_LARGE: 'secondaryLarge',
|
|
28
|
+
SECONDARY_X_LARGE: 'secondaryXLarge'
|
|
29
|
+
},
|
|
30
|
+
secondaryLong: {
|
|
31
|
+
SECONDARY_LONG: 'secondaryLong',
|
|
32
|
+
SECONDARY_X_SMALL_LONG: 'secondaryXSmallLong',
|
|
33
|
+
SECONDARY_SMALL_LONG: 'secondarySmallLong',
|
|
34
|
+
SECONDARY_MEDIUM_LONG: 'secondaryMediumLong',
|
|
35
|
+
SECONDARY_LARGE_LONG: 'secondaryLargeLong',
|
|
36
|
+
SECONDARY_X_LARGE_LONG: 'secondaryXLargeLong'
|
|
37
|
+
},
|
|
38
|
+
tertiary: {
|
|
39
|
+
TERTIARY: 'tertiary',
|
|
40
|
+
TERTIARY_X_SMALL: 'tertiaryXSmall',
|
|
41
|
+
TERTIARY_SMALL: 'tertiarySmall',
|
|
42
|
+
TERTIARY_MEDIUM: 'tertiaryMedium',
|
|
43
|
+
TERTIARY_LARGE: 'tertiaryLarge',
|
|
44
|
+
TERTIARY_X_LARGE: 'tertiaryXLarge'
|
|
45
|
+
},
|
|
46
|
+
tertiaryLong: {
|
|
47
|
+
TERTIARY_LONG: 'tertiaryLong',
|
|
48
|
+
TERTIARY_X_SMALL_LONG: 'tertiaryXSmallLong',
|
|
49
|
+
TERTIARY_SMALL_LONG: 'tertiarySmallLong',
|
|
50
|
+
TERTIARY_MEDIUM_LONG: 'tertiaryMediumLong',
|
|
51
|
+
TERTIARY_LARGE_LONG: 'tertiaryLargeLong',
|
|
52
|
+
TERTIARY_X_LARGE_LONG: 'tertiaryXLargeLong'
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
export const FlatButtonVariant = {
|
|
56
|
+
...variantGroups.primary,
|
|
57
|
+
...variantGroups.primaryLong,
|
|
58
|
+
...variantGroups.secondary,
|
|
59
|
+
...variantGroups.secondaryLong,
|
|
60
|
+
...variantGroups.tertiary,
|
|
61
|
+
...variantGroups.tertiaryLong
|
|
62
|
+
};
|
|
63
|
+
const getCustomPrimaryStyle = ({
|
|
64
|
+
color: {
|
|
65
|
+
primary
|
|
66
|
+
}
|
|
67
|
+
}) => ({
|
|
68
|
+
backgroundColor: `${primary} !important`,
|
|
69
|
+
borderColor: `${primary} !important`,
|
|
70
|
+
':hover': {
|
|
71
|
+
backgroundColor: `${darken(0.05, primary)} !important`,
|
|
72
|
+
borderColor: `${darken(0.05, primary)} !important`
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
const getCustomSecondaryStyle = ({
|
|
76
|
+
color: {
|
|
77
|
+
primary
|
|
78
|
+
}
|
|
79
|
+
}) => ({
|
|
80
|
+
color: `${primary} !important`,
|
|
81
|
+
borderColor: `${primary} !important`,
|
|
82
|
+
backgroundColor: `${colors.white} !important`,
|
|
83
|
+
':hover': {
|
|
84
|
+
color: `${colors.white} !important`,
|
|
85
|
+
backgroundColor: `${primary} !important`,
|
|
86
|
+
borderColor: `${primary} !important`
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
const getCustomStyles = ({
|
|
90
|
+
variant,
|
|
91
|
+
theme: {
|
|
92
|
+
custom
|
|
93
|
+
}
|
|
94
|
+
}) => {
|
|
95
|
+
if (variant.indexOf(FlatButtonVariant.PRIMARY) === 0) {
|
|
96
|
+
return getCustomPrimaryStyle(custom);
|
|
97
|
+
} else if (variant.indexOf(FlatButtonVariant.SECONDARY) === 0) {
|
|
98
|
+
return getCustomSecondaryStyle(custom);
|
|
99
|
+
}
|
|
100
|
+
return '';
|
|
101
|
+
};
|
|
102
|
+
const whiteSpace = props => props.whiteSpace ? {
|
|
103
|
+
whiteSpace: props.whiteSpace
|
|
104
|
+
} : {};
|
|
105
|
+
const fontSize = props => props.fontSize ? {
|
|
106
|
+
fontSize: `${props.fontSize} !important`
|
|
107
|
+
} : {};
|
|
108
|
+
const fontWeight = props => props.fontWeight ? {
|
|
109
|
+
fontWeight: `${props.fontWeight} !important`
|
|
110
|
+
} : {};
|
|
111
|
+
const lineHeight = props => props.lineHeight ? {
|
|
112
|
+
lineHeight: `${props.lineHeight} !important`
|
|
113
|
+
} : {};
|
|
114
|
+
const handleCustom = props => props?.theme?.custom ? getCustomStyles(props) : {};
|
|
115
|
+
export const FlatButton = styled.button.attrs(({
|
|
116
|
+
variant
|
|
117
|
+
}) => ({
|
|
118
|
+
variant: variant || FlatButtonVariant.PRIMARY
|
|
119
|
+
}))(commonStyle, variants, whiteSpace, fontSize, fontWeight, lineHeight, handleCustom);
|
|
120
|
+
FlatButton.displayName = 'FlatButton';
|
|
121
|
+
export { FlatButton as default };
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import styled from 'styled-components';
|
|
4
|
+
import { commonStyle, variants } from '../theme/flatInput';
|
|
5
|
+
import { Input as BaseFlatInput } from './basic/Input';
|
|
6
|
+
import { useAccessibilityKeyboardMode } from '../utils/accessibility';
|
|
7
|
+
const variantGroups = {
|
|
8
|
+
default: {
|
|
9
|
+
DEFAULT: 'default',
|
|
10
|
+
DEFAULT_SMALL: 'defaultSmall'
|
|
11
|
+
},
|
|
12
|
+
defaultLong: {
|
|
13
|
+
DEFAULT_LONG: 'defaultLong',
|
|
14
|
+
DEFAULT_SMALL_LONG: 'defaultSmallLong'
|
|
15
|
+
},
|
|
16
|
+
error: {
|
|
17
|
+
ERROR: 'error',
|
|
18
|
+
ERROR_SMALL: 'errorSmall'
|
|
19
|
+
},
|
|
20
|
+
errorLong: {
|
|
21
|
+
ERROR_LONG: 'errorLong',
|
|
22
|
+
ERROR_SMALL_LONG: 'errorSmallLong'
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
export const FlatInputVariant = {
|
|
26
|
+
...variantGroups.default,
|
|
27
|
+
...variantGroups.defaultLong,
|
|
28
|
+
...variantGroups.error,
|
|
29
|
+
...variantGroups.errorLong
|
|
30
|
+
};
|
|
31
|
+
const getCustomDefaultStyle = ({
|
|
32
|
+
color: {
|
|
33
|
+
primary
|
|
34
|
+
}
|
|
35
|
+
}) => ({
|
|
36
|
+
':focus': {
|
|
37
|
+
borderColor: `${primary} !important`
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
const getCustomStyles = ({
|
|
41
|
+
variant,
|
|
42
|
+
theme: {
|
|
43
|
+
custom
|
|
44
|
+
}
|
|
45
|
+
}) => {
|
|
46
|
+
if (variant.indexOf(FlatInputVariant.DEFAULT) === 0) {
|
|
47
|
+
return getCustomDefaultStyle(custom);
|
|
48
|
+
}
|
|
49
|
+
return '';
|
|
50
|
+
};
|
|
51
|
+
const handleCustom = props => props?.theme?.custom ? getCustomStyles(props) : {};
|
|
52
|
+
const StyledFlatInput = styled(BaseFlatInput).attrs(({
|
|
53
|
+
variant
|
|
54
|
+
}) => ({
|
|
55
|
+
variant: variant || FlatInputVariant.DEFAULT
|
|
56
|
+
}))(commonStyle, variants, handleCustom);
|
|
57
|
+
export const FlatInput = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
58
|
+
const isKeyboardMode = useAccessibilityKeyboardMode();
|
|
59
|
+
return /*#__PURE__*/React.createElement(StyledFlatInput, _extends({
|
|
60
|
+
ref: ref,
|
|
61
|
+
$isKeyboardMode: isKeyboardMode
|
|
62
|
+
}, props));
|
|
63
|
+
});
|
|
64
|
+
FlatInput.displayName = 'FlatInput';
|
|
65
|
+
export { FlatInput as default };
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { Icon, Flex, Text, Box } from '../index';
|
|
4
|
+
import colors from '../../theme/colors';
|
|
5
|
+
import { active } from './images';
|
|
6
|
+
const IconChecker = ({
|
|
7
|
+
children,
|
|
8
|
+
checked = false,
|
|
9
|
+
icon = 'theater',
|
|
10
|
+
...rest
|
|
11
|
+
}) => /*#__PURE__*/React.createElement(Box, _extends({
|
|
12
|
+
mx: "auto",
|
|
13
|
+
cursor: "pointer"
|
|
14
|
+
}, rest), /*#__PURE__*/React.createElement(Flex, {
|
|
15
|
+
justifyContent: "center",
|
|
16
|
+
alignItems: checked ? 'baseline' : 'center',
|
|
17
|
+
boxSizing: "border-box",
|
|
18
|
+
border: checked ? 'none' : `1px solid ${colors.black}`,
|
|
19
|
+
borderRadius: checked ? '0' : '100%',
|
|
20
|
+
width: "58px",
|
|
21
|
+
height: "58px",
|
|
22
|
+
mx: "auto",
|
|
23
|
+
backgroundImage: checked ? `url(${active})` : 'none'
|
|
24
|
+
}, /*#__PURE__*/React.createElement(Icon, {
|
|
25
|
+
as: "div",
|
|
26
|
+
name: icon,
|
|
27
|
+
color: colors.black,
|
|
28
|
+
checked: checked,
|
|
29
|
+
size: "30px",
|
|
30
|
+
mt: checked ? '10px' : '0'
|
|
31
|
+
})), /*#__PURE__*/React.createElement(Text, {
|
|
32
|
+
fontSize: "14px",
|
|
33
|
+
fontWeight: "extraLight",
|
|
34
|
+
textAlign: "center",
|
|
35
|
+
color: colors.blackTwo,
|
|
36
|
+
mt: 2
|
|
37
|
+
}, children));
|
|
38
|
+
export default IconChecker;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const active = 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI1OCIgaGVpZ2h0PSI1OCIgdmlld0JveD0iMCAwIDU4IDU4Ij4KICAgIDxnIGZpbGw9Im5vbmUiIGZpbGwtcnVsZT0iZXZlbm9kZCIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMSAxKSI+CiAgICAgICAgPGNpcmNsZSBjeD0iMjgiIGN5PSIyOCIgcj0iMjgiIGZpbGw9IiNGMUVDRTUiIHN0cm9rZT0iYmxhY2siIHN0cm9rZS1saW5lY2FwPSJzcXVhcmUiLz4KICAgICAgICA8cGF0aCBmaWxsPSJibGFjayIgZD0iTTQ4Ljg1NyA0Ni4yMjJjLTE2LjE2OCAwLTEwLjA0My03LjYwMi0yMC44MzUtNy42MDItMTAuNzkxIDAtNC43IDcuNjAyLTIwLjgzNCA3LjYwMiA1LjMzMiA2LjIxIDEyLjI3NyA5LjMxNiAyMC44MzQgOS4zMTYgOC41NTggMCAxNS41MDMtMy4xMDUgMjAuODM1LTkuMzE2eiIvPgogICAgICAgIDxwYXRoIHN0cm9rZT0iI0ZGRiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIiBkPSJNMjMuMDU5IDQ3LjgxOEwyNS44NzYgNTAuOTggMzIuOTQxIDQzLjkyMiIvPgogICAgPC9nPgo8L3N2Zz4K';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "./IconChecker";
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import styled from 'styled-components';
|
|
4
|
+
import { Color } from '../theme';
|
|
5
|
+
const StyledRadio = styled.label`
|
|
6
|
+
cursor: pointer;
|
|
7
|
+
position: relative;
|
|
8
|
+
|
|
9
|
+
& > span {
|
|
10
|
+
position: relative;
|
|
11
|
+
display: block;
|
|
12
|
+
width: 24px;
|
|
13
|
+
height: 24px;
|
|
14
|
+
border-radius: 50%;
|
|
15
|
+
border: ${({
|
|
16
|
+
color
|
|
17
|
+
}) => `2px solid ${color || Color.MEDIUM_GREY}`};
|
|
18
|
+
&:before {
|
|
19
|
+
content: '';
|
|
20
|
+
position: absolute;
|
|
21
|
+
display: block;
|
|
22
|
+
width: 14px;
|
|
23
|
+
height: 14px;
|
|
24
|
+
border-radius: 50%;
|
|
25
|
+
background-color: transparent;
|
|
26
|
+
top: 3px;
|
|
27
|
+
left: 3px;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
& > input {
|
|
32
|
+
position: absolute;
|
|
33
|
+
opacity: 0;
|
|
34
|
+
width: 0;
|
|
35
|
+
height: 0;
|
|
36
|
+
|
|
37
|
+
&:focus-visible + span {
|
|
38
|
+
outline: 2px solid #1e5bbb !important;
|
|
39
|
+
}
|
|
40
|
+
&:checked + span {
|
|
41
|
+
border-color: ${({
|
|
42
|
+
color
|
|
43
|
+
}) => color || Color.HOTEL_DARK_GREY};
|
|
44
|
+
&:before {
|
|
45
|
+
background-color: ${({
|
|
46
|
+
color
|
|
47
|
+
}) => color || Color.HOTEL_DARK_GREY};
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
`;
|
|
52
|
+
const Radio = ({
|
|
53
|
+
color,
|
|
54
|
+
...rest
|
|
55
|
+
}) => /*#__PURE__*/React.createElement(StyledRadio, {
|
|
56
|
+
color: color
|
|
57
|
+
}, /*#__PURE__*/React.createElement("input", _extends({
|
|
58
|
+
type: "radio"
|
|
59
|
+
}, rest)), /*#__PURE__*/React.createElement("span", null));
|
|
60
|
+
Radio.displayName = 'Radio';
|
|
61
|
+
export default Radio;
|