travelcircus-styleguide 2.0.9 → 2.0.11
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.
|
@@ -139,6 +139,6 @@ var RoundedInput = /*#__PURE__*/_react.default.forwardRef(function (props, ref)
|
|
|
139
139
|
RoundedInput.displayName = 'RoundedInput';
|
|
140
140
|
RoundedInput.defaultProps = _objectSpread({}, defaultProps);
|
|
141
141
|
|
|
142
|
-
var _default = (0, _hocs.
|
|
142
|
+
var _default = (0, _hocs.withInputLabel)(RoundedInput);
|
|
143
143
|
|
|
144
144
|
exports.default = _default;
|
|
@@ -30,7 +30,7 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
|
|
|
30
30
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
31
31
|
|
|
32
32
|
function _templateObject() {
|
|
33
|
-
var data = _taggedTemplateLiteral(["\n font-family: poppins-
|
|
33
|
+
var data = _taggedTemplateLiteral(["\n font-family: poppins-light;\n width: ", ";\n\n .", "__control {\n border: 1px solid\n ", ";\n border-radius: 5px;\n background-color: ", ";\n\n &:hover {\n border-color: black;\n box-shadow: none !important;\n }\n\n &--is-focused {\n border-color: ", ";\n box-shadow: none !important;\n }\n }\n\n .", "__value-container {\n padding-top: ", ";\n padding-bottom: ", ";\n padding-left: ", ";\n padding-right: ", ";\n font-size: ", ";\n height: ", ";\n line-height: 1.2em;\n\n .", "__single-value {\n color: ", ";\n }\n\n & > div[class*='Input'] {\n margin: 0 !important;\n padding-top: 0 !important;\n padding-bottom: 0 !important;\n height: 1em;\n }\n }\n\n .", "__indicator-separator {\n display: none;\n }\n\n .", "__dropdown-indicator {\n color: ", ";\n padding-right: ", ";\n }\n\n .", "__menu {\n z-index: 100;\n margin-top: 4px;\n }\n\n .", "__option {\n cursor: pointer;\n\n &:hover,\n &--is-focused,\n &--is-selected {\n color: ", ";\n background: ", ";\n }\n }\n .react-select__placeholder {\n color: ", ";\n }\n"]);
|
|
34
34
|
|
|
35
35
|
_templateObject = function _templateObject() {
|
|
36
36
|
return data;
|
package/dist/hocs/index.js
CHANGED
|
@@ -9,13 +9,13 @@ Object.defineProperty(exports, "withLabel", {
|
|
|
9
9
|
return _withLabel.withLabel;
|
|
10
10
|
}
|
|
11
11
|
});
|
|
12
|
-
Object.defineProperty(exports, "
|
|
12
|
+
Object.defineProperty(exports, "withInputLabel", {
|
|
13
13
|
enumerable: true,
|
|
14
14
|
get: function get() {
|
|
15
|
-
return
|
|
15
|
+
return _withInputLabel.withInputLabel;
|
|
16
16
|
}
|
|
17
17
|
});
|
|
18
18
|
|
|
19
19
|
var _withLabel = require("./withLabel");
|
|
20
20
|
|
|
21
|
-
var
|
|
21
|
+
var _withInputLabel = require("./withInputLabel");
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.withInputLabel = void 0;
|
|
7
7
|
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
|
|
@@ -21,12 +21,6 @@ var _Text = _interopRequireDefault(require("../components/basic/Text"));
|
|
|
21
21
|
|
|
22
22
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
23
23
|
|
|
24
|
-
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); }
|
|
25
|
-
|
|
26
|
-
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
27
|
-
|
|
28
|
-
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
29
|
-
|
|
30
24
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
31
25
|
|
|
32
26
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
@@ -40,7 +34,7 @@ function _iterableToArrayLimit(arr, i) { if (typeof Symbol === "undefined" || !(
|
|
|
40
34
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
41
35
|
|
|
42
36
|
function _templateObject2() {
|
|
43
|
-
var data = _taggedTemplateLiteral(["\n position: absolute;\n left: 17px;\n pointer-events: none;\n transform: translate(0, 19px) scale(1);\n transform-origin: top left;\n transition: 200ms cubic-bezier(0, 0, 0.2, 1) 0ms;\n max-width: 90%;\n"]);
|
|
37
|
+
var data = _taggedTemplateLiteral(["\n font-size: 14px;\n line-height: 16px;\n z-index: 1;\n position: absolute;\n left: 17px;\n pointer-events: none;\n transform: translate(0, 19px) scale(1);\n transform-origin: top left;\n transition: 200ms cubic-bezier(0, 0, 0.2, 1) 0ms;\n max-width: 90%;\n"]);
|
|
44
38
|
|
|
45
39
|
_templateObject2 = function _templateObject2() {
|
|
46
40
|
return data;
|
|
@@ -49,6 +43,12 @@ function _templateObject2() {
|
|
|
49
43
|
return data;
|
|
50
44
|
}
|
|
51
45
|
|
|
46
|
+
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); }
|
|
47
|
+
|
|
48
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
49
|
+
|
|
50
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
51
|
+
|
|
52
52
|
function _templateObject() {
|
|
53
53
|
var data = _taggedTemplateLiteral(["\n position: relative;\n display: flex;\n flex-direction: column;\n &:focus-within label {\n transform: translate(0, 3px) scale(0.8);\n top: 0;\n transform-origin: top left;\n }\n input:not(:focus):not(:placeholder-shown) ~ label {\n transform: translate(0, 3px) scale(0.8);\n top: 0;\n transform-origin: top left;\n }\n"]);
|
|
54
54
|
|
|
@@ -62,14 +62,46 @@ function _templateObject() {
|
|
|
62
62
|
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
63
63
|
|
|
64
64
|
var styledProps = (0, _styledSystem.compose)(_styledSystem.space, _styledSystem.layout, _styledSystem.flexbox, _styledSystem.color, _styledSystem.textAlign, _styledSystem.background, _styledSystem.border, _styledSystem.boxShadow);
|
|
65
|
-
var
|
|
66
|
-
|
|
65
|
+
var WrapperForOuterLabel = (0, _styledComponents.default)(_PositionBox.default)({
|
|
66
|
+
position: 'relative',
|
|
67
|
+
styledProps: styledProps
|
|
68
|
+
});
|
|
69
|
+
var WrapperForInnerLabel = (0, _styledComponents.default)(_PositionBox.default)(_templateObject());
|
|
70
|
+
|
|
71
|
+
var OuterLabel = function OuterLabel(_ref) {
|
|
72
|
+
var labelBackgroundColor = _ref.labelBackgroundColor,
|
|
73
|
+
labelTextColor = _ref.labelTextColor,
|
|
74
|
+
disabled = _ref.disabled,
|
|
75
|
+
id = _ref.id,
|
|
76
|
+
rest = _objectWithoutProperties(_ref, ["labelBackgroundColor", "labelTextColor", "disabled", "id"]);
|
|
77
|
+
|
|
78
|
+
return /*#__PURE__*/_react.default.createElement(_PositionBox.default, {
|
|
79
|
+
position: "absolute",
|
|
80
|
+
top: "-8px",
|
|
81
|
+
left: "10px",
|
|
82
|
+
bg: labelBackgroundColor || _colors.default.white,
|
|
83
|
+
px: "10px",
|
|
84
|
+
maxWidth: "90%",
|
|
85
|
+
borderRadius: "5px",
|
|
86
|
+
zIndex: 1
|
|
87
|
+
}, /*#__PURE__*/_react.default.createElement(_Text.default, _extends({
|
|
88
|
+
fontSize: "14px",
|
|
89
|
+
lineHeight: "17px",
|
|
90
|
+
borderRadius: "5px",
|
|
91
|
+
color: disabled ? _colors.default.hotelSmoke : labelTextColor || _colors.default.hotelLightGrey,
|
|
92
|
+
truncate: true,
|
|
93
|
+
as: "label",
|
|
94
|
+
htmlFor: id
|
|
95
|
+
}, rest)));
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
var InnerLabel = (0, _styledComponents.default)(_Text.default)(_templateObject2());
|
|
67
99
|
var DEFAULT_PASS_PROPS = [];
|
|
68
100
|
|
|
69
|
-
var
|
|
101
|
+
var withInputLabel = function withInputLabel(Component) {
|
|
70
102
|
var passProps = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : DEFAULT_PASS_PROPS;
|
|
71
103
|
|
|
72
|
-
var
|
|
104
|
+
var ComponentWithInputLabel = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
|
|
73
105
|
var _splitProps = (0, _styles.splitProps)(props, Object.keys(styledProps), passProps),
|
|
74
106
|
_splitProps2 = _slicedToArray(_splitProps, 2),
|
|
75
107
|
wrapperProps = _splitProps2[0],
|
|
@@ -80,13 +112,20 @@ var withInnerLabel = function withInnerLabel(Component) {
|
|
|
80
112
|
var id = rest.id,
|
|
81
113
|
disabled = rest.disabled,
|
|
82
114
|
required = rest.required,
|
|
83
|
-
|
|
84
|
-
|
|
115
|
+
labelBackgroundColor = rest.labelBackgroundColor,
|
|
116
|
+
labelTextColor = rest.labelTextColor,
|
|
117
|
+
placeholder = rest.placeholder;
|
|
118
|
+
var hasPlaceholder = (placeholder === null || placeholder === void 0 ? void 0 : placeholder.length) > 0;
|
|
119
|
+
return hasPlaceholder ? /*#__PURE__*/_react.default.createElement(WrapperForOuterLabel, wrapperProps, label && /*#__PURE__*/_react.default.createElement(OuterLabel, {
|
|
120
|
+
labelBackgroundColor: labelBackgroundColor,
|
|
121
|
+
labelTextColor: labelTextColor,
|
|
122
|
+
disabled: disabled,
|
|
123
|
+
id: id
|
|
124
|
+
}, label, required && '*'), /*#__PURE__*/_react.default.createElement(Component, _extends({}, rest, {
|
|
125
|
+
ref: ref
|
|
126
|
+
}))) : /*#__PURE__*/_react.default.createElement(WrapperForInnerLabel, wrapperProps, /*#__PURE__*/_react.default.createElement(Component, _extends({}, rest, {
|
|
85
127
|
ref: ref
|
|
86
|
-
})), label && /*#__PURE__*/_react.default.createElement(
|
|
87
|
-
fontSize: "14px",
|
|
88
|
-
lineHeight: "16px",
|
|
89
|
-
zIndex: 1,
|
|
128
|
+
})), label && /*#__PURE__*/_react.default.createElement(InnerLabel, {
|
|
90
129
|
color: disabled ? _colors.default.hotelSmoke : labelTextColor || _colors.default.mediumGrey,
|
|
91
130
|
truncate: true,
|
|
92
131
|
as: "label",
|
|
@@ -94,8 +133,8 @@ var withInnerLabel = function withInnerLabel(Component) {
|
|
|
94
133
|
}, label, required && '*'));
|
|
95
134
|
});
|
|
96
135
|
|
|
97
|
-
|
|
98
|
-
return
|
|
136
|
+
ComponentWithInputLabel.displayName = "".concat(Component.displayName || 'Component', "-WithInputLabel");
|
|
137
|
+
return ComponentWithInputLabel;
|
|
99
138
|
};
|
|
100
139
|
|
|
101
|
-
exports.
|
|
140
|
+
exports.withInputLabel = withInputLabel;
|
package/dist/theme/theme.js
CHANGED
|
@@ -29,8 +29,8 @@ addAliases(breakpoints, aliases);
|
|
|
29
29
|
var space = [0, 4, 8, 16, 24, 32, 40, 48, 64, 128];
|
|
30
30
|
exports.space = space;
|
|
31
31
|
var fontFamilies = {
|
|
32
|
-
default: "'poppins-
|
|
33
|
-
poppins: "'poppins-
|
|
32
|
+
default: "'poppins-light', sans-serif",
|
|
33
|
+
poppins: "'poppins-light', sans-serif",
|
|
34
34
|
helvetica: 'Helvetica, sans-serif',
|
|
35
35
|
poppinsFallback: 'sans-serif',
|
|
36
36
|
lato: "'Lato-Regular', sans-serif",
|
|
@@ -38,9 +38,9 @@ var fontFamilies = {
|
|
|
38
38
|
};
|
|
39
39
|
exports.fontFamilies = fontFamilies;
|
|
40
40
|
var italicFonts = {
|
|
41
|
-
default: "'poppins-
|
|
41
|
+
default: "'poppins-light-it', sans-serif",
|
|
42
42
|
lato: "'Lato-Italic', sans-serif",
|
|
43
|
-
poppins: "'poppins-
|
|
43
|
+
poppins: "'poppins-light-it', sans-serif",
|
|
44
44
|
cabin: "'Cabin-Italic', sans-serif"
|
|
45
45
|
};
|
|
46
46
|
exports.italicFonts = italicFonts;
|