@flodesk/grain 5.2.0 → 5.3.2
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/es/components/index.js +1 -0
- package/es/components/tab.js +60 -0
- package/es/icons/icon-phone.js +1 -1
- package/package.json +1 -1
package/es/components/index.js
CHANGED
|
@@ -5,6 +5,7 @@ export { TextInput } from './text-input';
|
|
|
5
5
|
export { Arrange } from './arrange';
|
|
6
6
|
export { Icon } from './icon';
|
|
7
7
|
export { IconButton } from './icon-button';
|
|
8
|
+
export { Tab, TabGroup } from './tab';
|
|
8
9
|
export { TextButton } from './text-button';
|
|
9
10
|
export { IconToggleGroup, IconToggle } from './icon-toggle';
|
|
10
11
|
export { TextToggleGroup, TextToggle } from './text-toggle';
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import "core-js/modules/es.array.slice.js";
|
|
2
|
+
import "core-js/modules/es.object.freeze.js";
|
|
3
|
+
import "core-js/modules/es.object.define-properties.js";
|
|
4
|
+
import "core-js/modules/es.object.keys.js";
|
|
5
|
+
import "core-js/modules/es.array.index-of.js";
|
|
6
|
+
import "core-js/modules/es.symbol.js";
|
|
7
|
+
var _excluded = ["children", "isActive", "onClick"],
|
|
8
|
+
_excluded2 = ["children", "height"];
|
|
9
|
+
|
|
10
|
+
var _templateObject, _templateObject2;
|
|
11
|
+
|
|
12
|
+
import "core-js/modules/es.object.assign.js";
|
|
13
|
+
|
|
14
|
+
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; }
|
|
15
|
+
|
|
16
|
+
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; }
|
|
17
|
+
|
|
18
|
+
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
19
|
+
|
|
20
|
+
import { getWeight, getTransition, getDimension } from '../utilities';
|
|
21
|
+
import React from 'react';
|
|
22
|
+
import styled from '@emotion/styled';
|
|
23
|
+
import PropTypes from 'prop-types';
|
|
24
|
+
import { types } from '../types';
|
|
25
|
+
var Wrapper = styled.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n gap: var(--grn-space-l);\n width: fit-content;\n align-items: stretch;\n height: ", ";\n"])), function (p) {
|
|
26
|
+
return getDimension(p.height);
|
|
27
|
+
});
|
|
28
|
+
var TabWrapper = styled.button(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n appearance: none;\n border: none;\n padding: 0;\n font-family: inherit;\n font-size: inherit;\n font-weight: ", ";\n cursor: pointer;\n height: 100%;\n background-color: transparent;\n color: var(--grn-color-bodyDimmed);\n border-radius: 0;\n white-space: nowrap;\n transition: color ", ", box-shadow ", ";\n\n &:hover {\n color: var(--grn-color-body);\n }\n\n ", ";\n"])), getWeight('medium'), getTransition('fast'), getTransition('xFast'), function (p) {
|
|
29
|
+
return p.isActive && "\n box-shadow: inset 0 -2px 0 var(--grn-color-grey6);\n color: var(--grn-color-body);\n ";
|
|
30
|
+
});
|
|
31
|
+
export var Tab = function Tab(_ref) {
|
|
32
|
+
var children = _ref.children,
|
|
33
|
+
isActive = _ref.isActive,
|
|
34
|
+
onClick = _ref.onClick,
|
|
35
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
36
|
+
|
|
37
|
+
return /*#__PURE__*/React.createElement(TabWrapper, Object.assign({
|
|
38
|
+
isActive: isActive,
|
|
39
|
+
onClick: onClick
|
|
40
|
+
}, props), children);
|
|
41
|
+
};
|
|
42
|
+
export var TabGroup = function TabGroup(_ref2) {
|
|
43
|
+
var children = _ref2.children,
|
|
44
|
+
_ref2$height = _ref2.height,
|
|
45
|
+
height = _ref2$height === void 0 ? 6 : _ref2$height,
|
|
46
|
+
props = _objectWithoutProperties(_ref2, _excluded2);
|
|
47
|
+
|
|
48
|
+
return /*#__PURE__*/React.createElement(Wrapper, Object.assign({
|
|
49
|
+
height: height
|
|
50
|
+
}, props), children);
|
|
51
|
+
};
|
|
52
|
+
TabGroup.propTypes = {
|
|
53
|
+
children: PropTypes.node,
|
|
54
|
+
height: types.dimension
|
|
55
|
+
};
|
|
56
|
+
Tab.propTypes = {
|
|
57
|
+
children: PropTypes.node,
|
|
58
|
+
isActive: PropTypes.bool,
|
|
59
|
+
onClick: PropTypes.func
|
|
60
|
+
};
|
package/es/icons/icon-phone.js
CHANGED
|
@@ -9,7 +9,7 @@ var IconPhone = function IconPhone(props) {
|
|
|
9
9
|
}, props), /*#__PURE__*/React.createElement("path", {
|
|
10
10
|
fillRule: "evenodd",
|
|
11
11
|
clipRule: "evenodd",
|
|
12
|
-
d: "M2 4a2 2 0 00-2 2v20a2 2 0 002 2h12a2 2 0 002-2V6a2 2 0 00-2-2H2zm0 2h12v20H2V6zm6
|
|
12
|
+
d: "M2 4a2 2 0 00-2 2v20a2 2 0 002 2h12a2 2 0 002-2V6a2 2 0 00-2-2H2zm0 2h12v20H2V6zm6 18.5a1.5 1.5 0 100-3 1.5 1.5 0 000 3z",
|
|
13
13
|
fill: "currentColor"
|
|
14
14
|
}));
|
|
15
15
|
};
|