@sproutsocial/racine 11.8.0 → 11.9.0-typescript.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/__flow__/Button/{index.js → index.tsx} +20 -21
- package/__flow__/Button/{styles.js → styles.ts} +1 -1
- package/__flow__/Checkbox/index.stories.js +73 -56
- package/__flow__/Checkbox/styles.js +75 -75
- package/__flow__/Collapsible/index.js +3 -2
- package/__flow__/Icon/index.stories.js +41 -36
- package/__flow__/Image/index.js +10 -2
- package/__flow__/Loader/index.stories.js +18 -14
- package/__flow__/Numeral/index.stories.js +109 -50
- package/__flow__/Radio/index.stories.js +41 -26
- package/__flow__/SegmentedControl/index.js +3 -2
- package/__flow__/Switch/index.stories.js +26 -18
- package/__flow__/TableCell/index.js +9 -2
- package/__flow__/ToggleHint/index.js +9 -2
- package/__flow__/systemProps/color.js +1 -2
- package/__flow__/utils/responsiveProps/index.test.js +10 -2
- package/package.json +6 -1
- package/commonjs/Button/index.js +0 -70
- package/commonjs/Button/styles.js +0 -66
- package/lib/Button/index.js +0 -57
- package/lib/Button/styles.js +0 -48
package/lib/Button/index.js
DELETED
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
var _excluded = ["href", "appearance", "active", "disabled", "external", "children", "size", "innerRef", "onClick", "title", "qa", "as", "ariaLabel"];
|
|
2
|
-
|
|
3
|
-
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); }
|
|
4
|
-
|
|
5
|
-
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; }
|
|
6
|
-
|
|
7
|
-
import * as React from "react";
|
|
8
|
-
import Container from "./styles";
|
|
9
|
-
|
|
10
|
-
var Button = function Button(_ref) {
|
|
11
|
-
var href = _ref.href,
|
|
12
|
-
_ref$appearance = _ref.appearance,
|
|
13
|
-
appearance = _ref$appearance === void 0 ? "unstyled" : _ref$appearance,
|
|
14
|
-
_ref$active = _ref.active,
|
|
15
|
-
active = _ref$active === void 0 ? false : _ref$active,
|
|
16
|
-
disabled = _ref.disabled,
|
|
17
|
-
external = _ref.external,
|
|
18
|
-
children = _ref.children,
|
|
19
|
-
_ref$size = _ref.size,
|
|
20
|
-
size = _ref$size === void 0 ? "default" : _ref$size,
|
|
21
|
-
innerRef = _ref.innerRef,
|
|
22
|
-
onClick = _ref.onClick,
|
|
23
|
-
title = _ref.title,
|
|
24
|
-
_ref$qa = _ref.qa,
|
|
25
|
-
qa = _ref$qa === void 0 ? {} : _ref$qa,
|
|
26
|
-
as = _ref.as,
|
|
27
|
-
ariaLabel = _ref.ariaLabel,
|
|
28
|
-
rest = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
29
|
-
|
|
30
|
-
if (!href && external) {
|
|
31
|
-
console.warn("Warning: external prop cannot be set without a href declaration");
|
|
32
|
-
} // plans to properly deprecate captured in DS-1096
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
var appearanceCheck = appearance === "default" ? "unstyled" : appearance;
|
|
36
|
-
return /*#__PURE__*/React.createElement(Container, _extends({
|
|
37
|
-
title: title,
|
|
38
|
-
active: active,
|
|
39
|
-
href: href,
|
|
40
|
-
target: external ? "_blank" : undefined,
|
|
41
|
-
rel: external ? "noopener noreferrer" : undefined,
|
|
42
|
-
as: as || (href ? "a" : "button"),
|
|
43
|
-
type: href ? undefined : "button",
|
|
44
|
-
"aria-disabled": disabled ? disabled : undefined,
|
|
45
|
-
disabled: disabled,
|
|
46
|
-
buttonSize: size,
|
|
47
|
-
appearance: appearanceCheck,
|
|
48
|
-
ref: innerRef,
|
|
49
|
-
onClick: onClick,
|
|
50
|
-
"data-qa-button": title || "",
|
|
51
|
-
"data-qa-button-isdisabled": disabled === true,
|
|
52
|
-
"aria-label": ariaLabel
|
|
53
|
-
}, qa, rest), children);
|
|
54
|
-
};
|
|
55
|
-
|
|
56
|
-
Button.displayName = "Button";
|
|
57
|
-
export default Button;
|
package/lib/Button/styles.js
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import styled, { css } from "styled-components";
|
|
2
|
-
import { COMMON, LAYOUT } from "../utils/system-props";
|
|
3
|
-
import { focusRing, disabled, pill } from "../utils/mixins";
|
|
4
|
-
import Icon from "../Icon/styles";
|
|
5
|
-
var Container = styled.button.withConfig({
|
|
6
|
-
displayName: "styles__Container",
|
|
7
|
-
componentId: "sc-1juy94s-0"
|
|
8
|
-
})(["display:inline-block;box-sizing:border-box;text-align:center;font-family:", ";border:1px solid ", ";border-radius:", ";border-style:", ";background:", ";color:", ";cursor:pointer;text-decoration:none;line-height:16px;white-space:nowrap;font-weight:", ";transition:all ", " linear;margin:0;padding:", ";font-size:", ";&:visited{color:", ";}&:hover{color:", ";background:", ";text-decoration:none;box-shadow:", ";}&:active{color:", ";background:", ";transform:translateY(1px);}&:focus{", "}&:focus:active{box-shadow:none;}", " ", " ", " ", "{vertical-align:text-bottom;}", " ", ""], function (props) {
|
|
9
|
-
return props.theme.fontFamily;
|
|
10
|
-
}, function (props) {
|
|
11
|
-
return props.theme.colors.button[props.appearance].border.base;
|
|
12
|
-
}, function (props) {
|
|
13
|
-
return props.theme.radii[500];
|
|
14
|
-
}, function (props) {
|
|
15
|
-
return props.appearance === "placeholder" ? "dashed" : "solid";
|
|
16
|
-
}, function (props) {
|
|
17
|
-
return props.theme.colors.button[props.appearance].background.base;
|
|
18
|
-
}, function (props) {
|
|
19
|
-
return props.theme.colors.button[props.appearance].text.base;
|
|
20
|
-
}, function (props) {
|
|
21
|
-
return props.theme.fontWeights.bold;
|
|
22
|
-
}, function (props) {
|
|
23
|
-
return props.theme.duration.fast;
|
|
24
|
-
}, function (props) {
|
|
25
|
-
return props.buttonSize === "default" ? "" + props.theme.space[300] : "" + props.theme.space[350];
|
|
26
|
-
}, function (props) {
|
|
27
|
-
return props.buttonSize === "default" ? props.theme.typography[200].fontSize : props.theme.typography[300].fontSize;
|
|
28
|
-
}, function (props) {
|
|
29
|
-
return props.theme.colors.button[props.appearance].text.base;
|
|
30
|
-
}, function (props) {
|
|
31
|
-
return props.theme.colors.button[props.appearance].text.hover;
|
|
32
|
-
}, function (props) {
|
|
33
|
-
return props.theme.colors.button[props.appearance].background.hover;
|
|
34
|
-
}, function (props) {
|
|
35
|
-
return props.appearance === "placeholder" ? props.theme.shadows.low : "none";
|
|
36
|
-
}, function (props) {
|
|
37
|
-
return props.theme.colors.button[props.appearance].text.hover;
|
|
38
|
-
}, function (props) {
|
|
39
|
-
return props.theme.colors.button[props.appearance].background.active;
|
|
40
|
-
}, focusRing, function (props) {
|
|
41
|
-
return props.active && css(["color:", " !important;background:", " !important;"], props.theme.colors.button[props.appearance].text.hover, props.theme.colors.button[props.appearance].background.active);
|
|
42
|
-
}, function (props) {
|
|
43
|
-
return props.disabled && disabled;
|
|
44
|
-
}, function (props) {
|
|
45
|
-
return props.appearance === "pill" && css(["display:inline-flex;align-items:center;justify-content:center;mix-blend-mode:", ";", ""], props.theme.mode === "dark" ? "screen" : "multiply", pill);
|
|
46
|
-
}, Icon, LAYOUT, COMMON);
|
|
47
|
-
Container.displayName = "Button-Container";
|
|
48
|
-
export default Container; //${props.theme.mode === "dark" ? "screen" : "multiply"}
|