@sproutsocial/racine 14.0.0 → 14.1.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/CHANGELOG.md +23 -0
- package/__flow__/Banner/Banner.flow.js +4 -0
- package/__flow__/systemProps/flexbox.js +4 -1
- package/__flow__/types/system-props.flow.js +3 -0
- package/__flow__/types/theme.flow.js +27 -0
- package/commonjs/Banner/Banner.js +45 -30
- package/commonjs/Banner/styles.js +10 -3
- package/commonjs/CharacterCounter/CharacterCounter.js +1 -0
- package/commonjs/DatePicker/DateRangePicker/DateRangePicker.js +2 -2
- package/commonjs/Input/styles.js +13 -2
- package/commonjs/Label/Label.js +13 -10
- package/commonjs/PartnerLogo/PartnerLogo.js +1 -2
- package/commonjs/Select/styles.js +13 -2
- package/commonjs/StatefulStory.js +32 -0
- package/commonjs/themes/extendedThemes/sproutTheme/dark/theme.js +20 -0
- package/commonjs/themes/extendedThemes/sproutTheme/light/theme.js +20 -0
- package/commonjs/utils/system-props/gap.js +22 -0
- package/commonjs/utils/system-props/index.js +16 -0
- package/commonjs/utils/{system-props.js → system-props/system-props.js} +2 -1
- package/dist/themes/extendedThemes/sproutTheme/dark/theme.scss +40 -0
- package/dist/themes/extendedThemes/sproutTheme/light/theme.scss +40 -0
- package/dist/types/Badge/BadgeTypes.d.ts +1 -1
- package/dist/types/Badge/BadgeTypes.d.ts.map +1 -1
- package/dist/types/Banner/Banner.d.ts +1 -1
- package/dist/types/Banner/Banner.d.ts.map +1 -1
- package/dist/types/Banner/BannerTypes.d.ts +4 -0
- package/dist/types/Banner/BannerTypes.d.ts.map +1 -1
- package/dist/types/Banner/styles.d.ts +7 -0
- package/dist/types/Banner/styles.d.ts.map +1 -1
- package/dist/types/Box/Box.d.ts +1 -1
- package/dist/types/Box/Box.d.ts.map +1 -1
- package/dist/types/Card/styles.d.ts +1 -1
- package/dist/types/Card/styles.d.ts.map +1 -1
- package/dist/types/CharacterCounter/CharacterCounter.d.ts.map +1 -1
- package/dist/types/Checkbox/styles.d.ts +1 -1
- package/dist/types/Checkbox/styles.d.ts.map +1 -1
- package/dist/types/Collapsible/styles.d.ts +1 -1
- package/dist/types/DatePicker/styles.d.ts +1 -1
- package/dist/types/Drawer/Drawer.d.ts +3 -2
- package/dist/types/Drawer/Drawer.d.ts.map +1 -1
- package/dist/types/Drawer/DrawerTypes.d.ts +2 -1
- package/dist/types/Drawer/DrawerTypes.d.ts.map +1 -1
- package/dist/types/Drawer/styles.d.ts +1 -1
- package/dist/types/Drawer/styles.d.ts.map +1 -1
- package/dist/types/Fieldset/styles.d.ts +1 -1
- package/dist/types/Fieldset/styles.d.ts.map +1 -1
- package/dist/types/Input/styles.d.ts.map +1 -1
- package/dist/types/Label/Label.d.ts.map +1 -1
- package/dist/types/Menu/styles.d.ts +2 -2
- package/dist/types/Menu/styles.d.ts.map +1 -1
- package/dist/types/Message/styles.d.ts +5 -5
- package/dist/types/Message/styles.d.ts.map +1 -1
- package/dist/types/Modal/Modal.d.ts +1 -1
- package/dist/types/Modal/styles.d.ts +4 -4
- package/dist/types/Modal/styles.d.ts.map +1 -1
- package/dist/types/SegmentedControl/styles.d.ts +2 -2
- package/dist/types/SegmentedControl/styles.d.ts.map +1 -1
- package/dist/types/Select/styles.d.ts.map +1 -1
- package/dist/types/Skeleton/Skeleton.d.ts +1 -1
- package/dist/types/Skeleton/Skeleton.d.ts.map +1 -1
- package/dist/types/StatefulStory.d.ts +22 -0
- package/dist/types/StatefulStory.d.ts.map +1 -0
- package/dist/types/Toast/styles.d.ts +1 -1
- package/dist/types/Toast/styles.d.ts.map +1 -1
- package/dist/types/Tooltip/styles.d.ts +1 -1
- package/dist/types/Tooltip/styles.d.ts.map +1 -1
- package/dist/types/themes/extendedThemes/sproutTheme/dark/theme.d.ts +20 -0
- package/dist/types/themes/extendedThemes/sproutTheme/dark/theme.d.ts.map +1 -1
- package/dist/types/themes/extendedThemes/sproutTheme/light/theme.d.ts +20 -0
- package/dist/types/themes/extendedThemes/sproutTheme/light/theme.d.ts.map +1 -1
- package/dist/types/types/system-props.d.ts +24 -2
- package/dist/types/types/system-props.d.ts.map +1 -1
- package/dist/types/utils/system-props/gap.d.ts +2 -0
- package/dist/types/utils/system-props/gap.d.ts.map +1 -0
- package/dist/types/utils/system-props/index.d.ts +2 -0
- package/dist/types/utils/system-props/index.d.ts.map +1 -0
- package/dist/types/utils/system-props/system-props.d.ts.map +1 -0
- package/lib/Banner/Banner.js +45 -30
- package/lib/Banner/styles.js +7 -2
- package/lib/CharacterCounter/CharacterCounter.js +1 -0
- package/lib/DatePicker/DateRangePicker/DateRangePicker.js +2 -2
- package/lib/Input/styles.js +13 -2
- package/lib/Label/Label.js +13 -10
- package/lib/PartnerLogo/PartnerLogo.js +1 -2
- package/lib/Select/styles.js +13 -2
- package/lib/StatefulStory.js +33 -0
- package/lib/themes/extendedThemes/sproutTheme/dark/theme.js +20 -0
- package/lib/themes/extendedThemes/sproutTheme/light/theme.js +20 -0
- package/lib/utils/system-props/gap.js +15 -0
- package/lib/utils/system-props/index.js +1 -0
- package/lib/utils/{system-props.js → system-props/system-props.js} +2 -1
- package/package.json +1 -2
- package/dist/types/utils/system-props.d.ts.map +0 -1
- /package/dist/types/utils/{system-props.d.ts → system-props/system-props.d.ts} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { BorderProps, BoxShadowProps, ColorProps as TypeColorProps, FlexboxProps, GridProps, Theme, RequiredTheme, WidthProps, HeightProps, MinWidthProps, MinHeightProps, MaxWidthProps, MaxHeightProps, DisplayProps, VerticalAlignProps, SizeProps, PositionProps, ResponsiveValue, SpaceProps as TypeSpaceProps, TextShadowProps, TypographyProps } from 'styled-system';
|
|
1
|
+
import type { BorderProps, BoxShadowProps, ColorProps as TypeColorProps, FlexboxProps, GridProps, Theme, RequiredTheme, WidthProps, HeightProps, MinWidthProps, MinHeightProps, MaxWidthProps, MaxHeightProps, DisplayProps, VerticalAlignProps, SizeProps, PositionProps, ResponsiveValue, SpaceProps as TypeSpaceProps, TextShadowProps, TypographyProps, ThemeValue } from 'styled-system';
|
|
2
2
|
import type { Property } from 'csstype';
|
|
3
3
|
import type { TypeTypography } from '../types/theme';
|
|
4
4
|
import { LiteralAsNumberOrString } from '../types/shared';
|
|
@@ -17,6 +17,28 @@ export interface TypeSystemLayoutProps<ThemeType extends Theme = RequiredTheme>
|
|
|
17
17
|
overflow?: ResponsiveValue<Property.Overflow, ThemeType> | undefined;
|
|
18
18
|
}
|
|
19
19
|
export declare type TypeSystemPositionProps = PositionProps;
|
|
20
|
-
export
|
|
20
|
+
export interface GapProps<ThemeType extends Theme = RequiredTheme, TVal = Property.Gap<ThemeValue<'space', ThemeType>>> {
|
|
21
|
+
/**
|
|
22
|
+
* The gap CSS property sets the gaps (gutters) between rows and columns. It is a shorthand for row-gap
|
|
23
|
+
* and column-gap.
|
|
24
|
+
*
|
|
25
|
+
* [MDN reference](https://developer.mozilla.org/en-US/docs/Web/CSS/gap)
|
|
26
|
+
*/
|
|
27
|
+
gap?: ResponsiveValue<TVal, ThemeType> | undefined;
|
|
28
|
+
/**
|
|
29
|
+
* The column-gap CSS property sets the size of the gap (gutter) between an element's columns.
|
|
30
|
+
*
|
|
31
|
+
* [MDN reference](https://developer.mozilla.org/en-US/docs/Web/CSS/column-gap)
|
|
32
|
+
*/
|
|
33
|
+
columnGap?: ResponsiveValue<TVal, ThemeType> | undefined;
|
|
34
|
+
/**
|
|
35
|
+
* The row-gap CSS property sets the size of the gap (gutter) between an element's rows.
|
|
36
|
+
*
|
|
37
|
+
* [MDN reference](https://developer.mozilla.org/en-US/docs/Web/CSS/row-gap)
|
|
38
|
+
*/
|
|
39
|
+
rowGap?: ResponsiveValue<TVal, ThemeType> | undefined;
|
|
40
|
+
}
|
|
41
|
+
export interface TypeSystemFlexboxProps<ThemeType extends Theme = RequiredTheme> extends FlexboxProps<ThemeType>, GapProps<ThemeType> {
|
|
42
|
+
}
|
|
21
43
|
export declare type TypeSystemGridProps = GridProps;
|
|
22
44
|
//# sourceMappingURL=system-props.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"system-props.d.ts","sourceRoot":"","sources":["../../../src/types/system-props.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,WAAW,EACX,cAAc,EACd,UAAU,IAAI,cAAc,EAC5B,YAAY,EACZ,SAAS,EACT,KAAK,EACL,aAAa,EACb,UAAU,EACV,WAAW,EACX,aAAa,EACb,cAAc,EACd,aAAa,EACb,cAAc,EACd,YAAY,EACZ,kBAAkB,EAClB,SAAS,EACT,aAAa,EACb,eAAe,EACf,UAAU,IAAI,cAAc,EAC5B,eAAe,EACf,eAAe,
|
|
1
|
+
{"version":3,"file":"system-props.d.ts","sourceRoot":"","sources":["../../../src/types/system-props.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,WAAW,EACX,cAAc,EACd,UAAU,IAAI,cAAc,EAC5B,YAAY,EACZ,SAAS,EACT,KAAK,EACL,aAAa,EACb,UAAU,EACV,WAAW,EACX,aAAa,EACb,cAAc,EACd,aAAa,EACb,cAAc,EACd,YAAY,EACZ,kBAAkB,EAClB,SAAS,EACT,aAAa,EACb,eAAe,EACf,UAAU,IAAI,cAAc,EAC5B,eAAe,EACf,eAAe,EACf,UAAU,EACX,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,EAAC,QAAQ,EAAC,MAAM,SAAS,CAAC;AACtC,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAC,uBAAuB,EAAC,MAAM,mBAAmB,CAAC;AAE1D,YAAY,EAAC,eAAe,IAAI,cAAc,EAAC,MAAM,eAAe,CAAC;AACrE,MAAM,WAAW,qBAAsB,SAAQ,cAAc,EAAE,cAAc;IAC3E,MAAM,CAAC,EAAE,eAAe,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;CAC3C;AACD,MAAM,WAAW,qBACf,SAAQ,WAAW,EACjB,cAAc,EACd,eAAe;CAAG;AAEtB,oBAAY,4BAA4B,GAAG,eAAe,CAExD,uBAAuB,CAAC,MAAM,cAAc,CAAC,CAC9C,CAAC;AACF,MAAM,WAAW,yBACf,SAAQ,IAAI,CAAC,eAAe,EAAE,UAAU,CAAC;IACzC,QAAQ,CAAC,EAAE,4BAA4B,CAAC;IACxC,SAAS,CAAC,EAAE,4BAA4B,CAAC;CAC1C;AACD,MAAM,WAAW,qBAAqB,CAAC,SAAS,SAAS,KAAK,GAAG,aAAa,CAC5E,SAAQ,UAAU,CAAC,SAAS,CAAC,EAC3B,WAAW,CAAC,SAAS,CAAC,EACtB,aAAa,CAAC,SAAS,CAAC,EACxB,cAAc,CAAC,SAAS,CAAC,EACzB,aAAa,CAAC,SAAS,CAAC,EACxB,cAAc,CAAC,SAAS,CAAC,EACzB,YAAY,CAAC,SAAS,CAAC,EACvB,kBAAkB,CAAC,SAAS,CAAC,EAC7B,SAAS,CAAC,SAAS,CAAC;IACtB,QAAQ,CAAC,EAAE,eAAe,CAAC,QAAQ,CAAC,QAAQ,EAAE,SAAS,CAAC,GAAG,SAAS,CAAC;CACtE;AACD,oBAAY,uBAAuB,GAAG,aAAa,CAAC;AAEpD,MAAM,WAAW,QAAQ,CACvB,SAAS,SAAS,KAAK,GAAG,aAAa,EACvC,IAAI,GAAG,QAAQ,CAAC,GAAG,CAAC,UAAU,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;IAEnD;;;;;OAKG;IACH,GAAG,CAAC,EAAE,eAAe,CAAC,IAAI,EAAE,SAAS,CAAC,GAAG,SAAS,CAAC;IACnD;;;;OAIG;IACH,SAAS,CAAC,EAAE,eAAe,CAAC,IAAI,EAAE,SAAS,CAAC,GAAG,SAAS,CAAC;IACzD;;;;OAIG;IACH,MAAM,CAAC,EAAE,eAAe,CAAC,IAAI,EAAE,SAAS,CAAC,GAAG,SAAS,CAAC;CACvD;AAED,MAAM,WAAW,sBAAsB,CAAC,SAAS,SAAS,KAAK,GAAG,aAAa,CAC7E,SAAQ,YAAY,CAAC,SAAS,CAAC,EAC7B,QAAQ,CAAC,SAAS,CAAC;CAAG;AAE1B,oBAAY,mBAAmB,GAAG,SAAS,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gap.d.ts","sourceRoot":"","sources":["../../../../src/utils/system-props/gap.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,GAAG,iCAad,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/utils/system-props/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"system-props.d.ts","sourceRoot":"","sources":["../../../../src/utils/system-props/system-props.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAQxC,eAAO,MAAM,MAAM,gBAOlB,CAAC;AAEF,eAAO,MAAM,MAAM,gBAgBlB,CAAC;AAEF,eAAO,MAAM,UAAU,gBAOtB,CAAC;AAEF,eAAO,MAAM,MAAM,gBAWlB,CAAC;AAEF,eAAO,MAAM,QAAQ,gBAOpB,CAAC;AAEF,eAAO,MAAM,OAAO,gBAenB,CAAC;AAEF,eAAO,MAAM,IAAI,gBAAc,CAAC"}
|
package/lib/Banner/Banner.js
CHANGED
|
@@ -1,45 +1,40 @@
|
|
|
1
|
-
var _excluded = ["type", "text"];
|
|
1
|
+
var _excluded = ["type", "text", "onClose", "closeButtonLabel"];
|
|
2
2
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : 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); }
|
|
3
3
|
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; }
|
|
4
4
|
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; }
|
|
5
5
|
import * as React from 'react';
|
|
6
6
|
import Box from "../Box";
|
|
7
|
+
import Button from "../Button";
|
|
7
8
|
import Icon from "../Icon";
|
|
8
|
-
import Container from "./styles";
|
|
9
|
-
var
|
|
9
|
+
import Container, { StyledBannerIcon } from "./styles";
|
|
10
|
+
var getBannerIconName = function getBannerIconName(type) {
|
|
10
11
|
switch (type) {
|
|
11
12
|
case 'success':
|
|
12
|
-
return
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
return 'circle-check-no-fill';
|
|
14
|
+
case 'error':
|
|
15
|
+
return 'triangle';
|
|
16
|
+
case 'warning':
|
|
17
|
+
return 'triangle';
|
|
18
|
+
case 'opportunity':
|
|
19
|
+
return 'sparkles';
|
|
17
20
|
case 'info':
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
default:
|
|
22
|
+
return 'info-white';
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
var getBannerIconColor = function getBannerIconColor(type) {
|
|
26
|
+
switch (type) {
|
|
27
|
+
case 'success':
|
|
28
|
+
return 'icon.success';
|
|
23
29
|
case 'error':
|
|
24
|
-
return
|
|
25
|
-
name: "triangle",
|
|
26
|
-
className: "Icon",
|
|
27
|
-
fixedWidth: true
|
|
28
|
-
});
|
|
30
|
+
return 'icon.error';
|
|
29
31
|
case 'warning':
|
|
30
|
-
return
|
|
31
|
-
name: "triangle",
|
|
32
|
-
className: "Icon",
|
|
33
|
-
fixedWidth: true
|
|
34
|
-
});
|
|
32
|
+
return 'icon.warning';
|
|
35
33
|
case 'opportunity':
|
|
36
|
-
return
|
|
37
|
-
|
|
38
|
-
className: "Icon",
|
|
39
|
-
fixedWidth: true
|
|
40
|
-
});
|
|
34
|
+
return 'icon.opportunity';
|
|
35
|
+
case 'info':
|
|
41
36
|
default:
|
|
42
|
-
return;
|
|
37
|
+
return 'icon.info';
|
|
43
38
|
}
|
|
44
39
|
};
|
|
45
40
|
|
|
@@ -48,6 +43,9 @@ var Banner = function Banner(_ref) {
|
|
|
48
43
|
var _ref$type = _ref.type,
|
|
49
44
|
type = _ref$type === void 0 ? 'info' : _ref$type,
|
|
50
45
|
text = _ref.text,
|
|
46
|
+
onClose = _ref.onClose,
|
|
47
|
+
_ref$closeButtonLabel = _ref.closeButtonLabel,
|
|
48
|
+
closeButtonLabel = _ref$closeButtonLabel === void 0 ? 'Close' : _ref$closeButtonLabel,
|
|
51
49
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
52
50
|
return /*#__PURE__*/React.createElement(Container, _extends({
|
|
53
51
|
type: type,
|
|
@@ -58,6 +56,23 @@ var Banner = function Banner(_ref) {
|
|
|
58
56
|
display: "flex",
|
|
59
57
|
alignItems: "center",
|
|
60
58
|
width: 1
|
|
61
|
-
},
|
|
59
|
+
}, /*#__PURE__*/React.createElement(StyledBannerIcon, {
|
|
60
|
+
name: getBannerIconName(type),
|
|
61
|
+
color: getBannerIconColor(type),
|
|
62
|
+
className: "Icon",
|
|
63
|
+
fixedWidth: true,
|
|
64
|
+
mt: "3px",
|
|
65
|
+
mr: 400
|
|
66
|
+
}), text, onClose && /*#__PURE__*/React.createElement(Box, {
|
|
67
|
+
ml: "auto",
|
|
68
|
+
pl: 400,
|
|
69
|
+
alignSelf: "flex-start"
|
|
70
|
+
}, /*#__PURE__*/React.createElement(Button, {
|
|
71
|
+
p: 0,
|
|
72
|
+
onClick: onClose,
|
|
73
|
+
ariaLabel: closeButtonLabel
|
|
74
|
+
}, /*#__PURE__*/React.createElement(Icon, {
|
|
75
|
+
name: "x"
|
|
76
|
+
})))));
|
|
62
77
|
};
|
|
63
78
|
export default Banner;
|
package/lib/Banner/styles.js
CHANGED
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
import styled, { css } from 'styled-components';
|
|
2
2
|
import { COMMON, LAYOUT } from "../utils/system-props";
|
|
3
|
+
import Icon from "../Icon";
|
|
3
4
|
var Container = styled.div.withConfig({
|
|
4
5
|
displayName: "styles__Container",
|
|
5
6
|
componentId: "sc-r8d7e5-0"
|
|
6
7
|
})(function (props) {
|
|
7
|
-
return css(["display:flex;overflow:hidden;align-items:center;justify-content:space-between;color:", ";border-radius:", ";font-family:", ";", " padding:", ";border:1px solid ", ";background-color:", "
|
|
8
|
+
return css(["display:flex;overflow:hidden;align-items:center;justify-content:space-between;color:", ";border-radius:", ";font-family:", ";", " padding:", ";border:1px solid ", ";background-color:", ";a,button{font-weight:", ";color:", ";font-size:inherit;&:hover{color:", ";text-decoration:underline;}}> span:not(.Icon){display:block;}", " ", ""], props.theme.colors.text.body, props.theme.radii.outer, props.theme.fontFamily, props.theme.typography[200], props.theme.space[300], props.theme.colors.container.border[props.type], props.theme.colors.container.background[props.type], props.theme.fontWeights.semibold, props.theme.colors.text.body, props.theme.colors.text.body, COMMON, LAYOUT);
|
|
8
9
|
});
|
|
9
|
-
export default Container;
|
|
10
|
+
export default Container;
|
|
11
|
+
export var StyledBannerIcon = styled(Icon).withConfig({
|
|
12
|
+
displayName: "styles__StyledBannerIcon",
|
|
13
|
+
componentId: "sc-r8d7e5-1"
|
|
14
|
+
})(["align-self:flex-start;min-width:16px;"]);
|
|
@@ -33,6 +33,7 @@ var CharacterCounter = /*#__PURE__*/function (_React$Component) {
|
|
|
33
33
|
rest = _objectWithoutProperties(_this$props, _excluded);
|
|
34
34
|
var remaining = this.props.maxValue - this.props.currentValue;
|
|
35
35
|
return /*#__PURE__*/React.createElement(Container, _extends({
|
|
36
|
+
role: "status",
|
|
36
37
|
mini: size === 'mini',
|
|
37
38
|
overlimit: remaining <= 0
|
|
38
39
|
}, rest), remaining);
|
|
@@ -13,12 +13,12 @@ var DateRangePicker = function DateRangePicker(_ref) {
|
|
|
13
13
|
endDate = _ref$endDate === void 0 ? null : _ref$endDate,
|
|
14
14
|
onDatesChange = _ref.onDatesChange,
|
|
15
15
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
16
|
-
return /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement(ReactDatesCssOverrides, null), /*#__PURE__*/React.createElement(DayPickerRangeController, _extends({
|
|
16
|
+
return /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement(ReactDatesCssOverrides, null), /*#__PURE__*/React.createElement(DayPickerRangeController, _extends({
|
|
17
17
|
startDate: startDate,
|
|
18
18
|
endDate: endDate,
|
|
19
19
|
onDatesChange: onDatesChange,
|
|
20
20
|
numberOfMonths: 2,
|
|
21
21
|
initialVisibleMonth: null
|
|
22
|
-
}, rest)));
|
|
22
|
+
}, commonDatePickerProps, rest)));
|
|
23
23
|
};
|
|
24
24
|
export default DateRangePicker;
|
package/lib/Input/styles.js
CHANGED
|
@@ -4,7 +4,7 @@ import { COMMON } from "../utils/system-props";
|
|
|
4
4
|
var Container = styled.div.withConfig({
|
|
5
5
|
displayName: "styles__Container",
|
|
6
6
|
componentId: "sc-4stdun-0"
|
|
7
|
-
})(["box-sizing:border-box;position:relative;input{box-sizing:border-box;width:100%;border:1px solid transparent;border-radius:", ";background-color:", ";color:", ";outline:none;transition:border-color ", " ", ",box-shadow ", " ", ";font-family:", ";font-weight:", ";appearance:none;
|
|
7
|
+
})(["box-sizing:border-box;position:relative;input{box-sizing:border-box;width:100%;border:1px solid transparent;border-radius:", ";background-color:", ";color:", ";outline:none;transition:border-color ", " ", ",box-shadow ", " ", ";font-family:", ";font-weight:", ";appearance:none;margin:0;padding:", ";font-size:", ";line-height:", ";&::-ms-clear{display:none;}&::-webkit-search-cancel-button{appearance:none;}&:focus{", "}&:not(output):not(:focus):-moz-ui-invalid{box-shadow:none;}&::placeholder{color:", ";}", " ", "}", " ", " ", " ", " ", ""], function (props) {
|
|
8
8
|
return props.theme.radii[500];
|
|
9
9
|
}, function (props) {
|
|
10
10
|
return props.theme.colors.form.background.base;
|
|
@@ -25,7 +25,7 @@ var Container = styled.div.withConfig({
|
|
|
25
25
|
}, function (props) {
|
|
26
26
|
switch (props.size) {
|
|
27
27
|
case 'large':
|
|
28
|
-
return props.theme.space[400];
|
|
28
|
+
return "".concat(props.theme.space[350], " ").concat(props.theme.space[400]);
|
|
29
29
|
case 'small':
|
|
30
30
|
return props.theme.space[200];
|
|
31
31
|
case 'default':
|
|
@@ -41,6 +41,17 @@ var Container = styled.div.withConfig({
|
|
|
41
41
|
default:
|
|
42
42
|
return props.theme.typography[200].fontSize;
|
|
43
43
|
}
|
|
44
|
+
}, function (props) {
|
|
45
|
+
switch (props.size) {
|
|
46
|
+
case 'large':
|
|
47
|
+
return props.theme.typography[300].lineHeight;
|
|
48
|
+
|
|
49
|
+
/* 16px was the value prior to this change to 'large'. Leaving as-is but it is a non-Seeds typography line-height. It may have a big impact though */
|
|
50
|
+
case 'small':
|
|
51
|
+
case 'default':
|
|
52
|
+
default:
|
|
53
|
+
return '16px';
|
|
54
|
+
}
|
|
44
55
|
}, focusRing, function (props) {
|
|
45
56
|
return props.theme.colors.form.placeholder.base;
|
|
46
57
|
}, function (props) {
|
package/lib/Label/Label.js
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
2
|
var _excluded = ["as"];
|
|
3
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : 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
|
-
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; }
|
|
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
3
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
7
4
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
8
5
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
@@ -15,10 +12,21 @@ function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) ===
|
|
|
15
12
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
16
13
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
17
14
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
15
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : 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); }
|
|
16
|
+
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; }
|
|
17
|
+
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; }
|
|
18
18
|
import * as React from 'react';
|
|
19
19
|
import styled from 'styled-components';
|
|
20
20
|
import Text from "../Text";
|
|
21
|
-
var
|
|
21
|
+
var LabelBase = function LabelBase(_ref) {
|
|
22
|
+
var _ref$as = _ref.as,
|
|
23
|
+
as = _ref$as === void 0 ? 'label' : _ref$as,
|
|
24
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
25
|
+
return /*#__PURE__*/React.createElement(Text, _extends({}, rest, {
|
|
26
|
+
as: as
|
|
27
|
+
}));
|
|
28
|
+
};
|
|
29
|
+
var StyledLabel = styled(LabelBase).withConfig({
|
|
22
30
|
displayName: "Label__StyledLabel",
|
|
23
31
|
componentId: "sc-dh0olx-0"
|
|
24
32
|
})(["display:flex;align-items:center;"]);
|
|
@@ -32,17 +40,12 @@ var Label = /*#__PURE__*/function (_React$Component) {
|
|
|
32
40
|
_createClass(Label, [{
|
|
33
41
|
key: "render",
|
|
34
42
|
value: function render() {
|
|
35
|
-
var _this$props = this.props,
|
|
36
|
-
_this$props$as = _this$props.as,
|
|
37
|
-
as = _this$props$as === void 0 ? 'label' : _this$props$as,
|
|
38
|
-
rest = _objectWithoutProperties(_this$props, _excluded);
|
|
39
43
|
return /*#__PURE__*/React.createElement(StyledLabel, _extends({
|
|
40
|
-
as: as,
|
|
41
44
|
fontSize: 200,
|
|
42
45
|
fontWeight: "semibold",
|
|
43
46
|
color: "text.headline",
|
|
44
47
|
"data-qa-label": this.props.htmlFor
|
|
45
|
-
},
|
|
48
|
+
}, this.props));
|
|
46
49
|
}
|
|
47
50
|
}]);
|
|
48
51
|
return Label;
|
|
@@ -13,8 +13,7 @@ var PartnerLogo = function PartnerLogo(_ref) {
|
|
|
13
13
|
logoType = _ref.logoType,
|
|
14
14
|
height = _ref.height,
|
|
15
15
|
width = _ref.width,
|
|
16
|
-
|
|
17
|
-
size = _ref$size === void 0 ? 'medium' : _ref$size,
|
|
16
|
+
size = _ref.size,
|
|
18
17
|
color = _ref.color,
|
|
19
18
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
20
19
|
var _useTheme = useTheme(),
|
package/lib/Select/styles.js
CHANGED
|
@@ -4,7 +4,7 @@ import { COMMON } from "../utils/system-props";
|
|
|
4
4
|
var Container = styled.div.withConfig({
|
|
5
5
|
displayName: "styles__Container",
|
|
6
6
|
componentId: "sc-egruk2-0"
|
|
7
|
-
})(["position:relative;box-sizing:border-box;select{box-sizing:border-box;width:100%;border:1px solid ", ";border-radius:", ";background-color:", ";color:", ";cursor:", ";outline:none;appearance:none;transition:border-color ", " ", ",box-shadow ", " ", ";font-family:", ";font-weight:", ";margin:0;visibility:visible;padding:", ";font-size:", ";&::-ms-expand{display:none;}&:focus{", "}&:not(output):not(:focus):-moz-ui-invalid{box-shadow:none;}}
|
|
7
|
+
})(["position:relative;box-sizing:border-box;select{box-sizing:border-box;width:100%;border:1px solid ", ";border-radius:", ";background-color:", ";color:", ";cursor:", ";outline:none;appearance:none;transition:border-color ", " ", ",box-shadow ", " ", ";font-family:", ";font-weight:", ";margin:0;visibility:visible;padding:", ";font-size:", ";line-height:", ";&::-ms-expand{display:none;}&:focus{", "}&:not(output):not(:focus):-moz-ui-invalid{box-shadow:none;}}", " ", " ", ""], function (props) {
|
|
8
8
|
return props.theme.colors.form.border.base;
|
|
9
9
|
}, function (props) {
|
|
10
10
|
return props.theme.radii[500];
|
|
@@ -29,7 +29,7 @@ var Container = styled.div.withConfig({
|
|
|
29
29
|
}, function (props) {
|
|
30
30
|
switch (props.size) {
|
|
31
31
|
case 'large':
|
|
32
|
-
return "".concat(props.theme.space[
|
|
32
|
+
return "".concat(props.theme.space[350], " ").concat(props.theme.space[600], " ").concat(props.theme.space[350], " ").concat(props.theme.space[400]);
|
|
33
33
|
case 'small':
|
|
34
34
|
return "".concat(props.theme.space[200], " ").concat(props.theme.space[500], " ").concat(props.theme.space[200], " ").concat(props.theme.space[200]);
|
|
35
35
|
case 'default':
|
|
@@ -45,6 +45,17 @@ var Container = styled.div.withConfig({
|
|
|
45
45
|
default:
|
|
46
46
|
return props.theme.typography[200].fontSize;
|
|
47
47
|
}
|
|
48
|
+
}, function (props) {
|
|
49
|
+
switch (props.size) {
|
|
50
|
+
case 'large':
|
|
51
|
+
return props.theme.typography[300].lineHeight;
|
|
52
|
+
|
|
53
|
+
/* hardcoded to 'normal' so the large change doesn't impact small/default */
|
|
54
|
+
case 'small':
|
|
55
|
+
case 'default':
|
|
56
|
+
default:
|
|
57
|
+
return 'normal';
|
|
58
|
+
}
|
|
48
59
|
}, focusRing, function (props) {
|
|
49
60
|
return props.disabled && css(["opacity:0.4;"]);
|
|
50
61
|
}, function (props) {
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
2
|
+
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."); }
|
|
3
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
4
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
5
|
+
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0) { ; } } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
6
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
7
|
+
import { useState } from 'react';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Props for the StatefulStory component.
|
|
11
|
+
*
|
|
12
|
+
* This type automatically detects the type of the `initialState` prop and passes it to the `children` when rendered.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* A wrapper component that allows you to pass in an initial state.
|
|
17
|
+
*
|
|
18
|
+
* This is useful for adding state inline for stories. Story functions are not intepretted as React components,
|
|
19
|
+
* so you can't use hooks in them. This component allows you to useState in a story without having to create a
|
|
20
|
+
* custom component for every story.
|
|
21
|
+
*/
|
|
22
|
+
export function StatefulStory(_ref) {
|
|
23
|
+
var children = _ref.children,
|
|
24
|
+
initialState = _ref.initialState;
|
|
25
|
+
var _useState = useState(initialState),
|
|
26
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
27
|
+
state = _useState2[0],
|
|
28
|
+
setState = _useState2[1];
|
|
29
|
+
return children({
|
|
30
|
+
state: state,
|
|
31
|
+
setState: setState
|
|
32
|
+
});
|
|
33
|
+
}
|
|
@@ -85,6 +85,26 @@ export var analytics = {
|
|
|
85
85
|
}
|
|
86
86
|
};
|
|
87
87
|
export var listening = {
|
|
88
|
+
chart: {
|
|
89
|
+
indicator: {
|
|
90
|
+
default: {
|
|
91
|
+
primary: baseDarkTheme.colors.neutral[100],
|
|
92
|
+
secondary: baseDarkTheme.colors.neutral[900]
|
|
93
|
+
},
|
|
94
|
+
hover: {
|
|
95
|
+
primary: baseDarkTheme.colors.neutral[300],
|
|
96
|
+
secondary: baseDarkTheme.colors.neutral[0]
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
spike: {
|
|
100
|
+
background: {
|
|
101
|
+
base: baseDarkTheme.colors.teal[500]
|
|
102
|
+
},
|
|
103
|
+
icon: {
|
|
104
|
+
base: baseDarkTheme.colors.neutral[0]
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
},
|
|
88
108
|
topicTypes: {
|
|
89
109
|
customTopic: baseDarkTheme.colors.teal[400],
|
|
90
110
|
brandHealth: baseDarkTheme.colors.red[400],
|
|
@@ -82,6 +82,26 @@ export var analytics = {
|
|
|
82
82
|
}
|
|
83
83
|
};
|
|
84
84
|
export var listening = {
|
|
85
|
+
chart: {
|
|
86
|
+
indicator: {
|
|
87
|
+
default: {
|
|
88
|
+
primary: baseLightTheme.colors.neutral[400],
|
|
89
|
+
secondary: baseLightTheme.colors.neutral[0]
|
|
90
|
+
},
|
|
91
|
+
hover: {
|
|
92
|
+
primary: baseLightTheme.colors.neutral[1000],
|
|
93
|
+
secondary: baseLightTheme.colors.neutral[0]
|
|
94
|
+
}
|
|
95
|
+
},
|
|
96
|
+
spike: {
|
|
97
|
+
background: {
|
|
98
|
+
base: baseLightTheme.colors.teal[500]
|
|
99
|
+
},
|
|
100
|
+
icon: {
|
|
101
|
+
base: baseLightTheme.colors.neutral[0]
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
},
|
|
85
105
|
topicTypes: {
|
|
86
106
|
customTopic: baseLightTheme.colors.blue[400],
|
|
87
107
|
brandHealth: baseLightTheme.colors.red[400],
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./system-props";
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
// eslint-disable-next-line no-restricted-syntax
|
|
2
2
|
import * as styles from 'styled-system';
|
|
3
|
+
import { gap } from "./gap";
|
|
3
4
|
var typeScale = styles.variant({
|
|
4
5
|
key: 'typography',
|
|
5
6
|
prop: 'typeScale'
|
|
@@ -18,5 +19,5 @@ styles.boxShadow);
|
|
|
18
19
|
export var TYPOGRAPHY = styles.compose(typeScale, styles.fontFamily, styles.fontStyle, styles.fontWeight, styles.lineHeight, styles.textAlign);
|
|
19
20
|
export var LAYOUT = styles.compose(styles.display, styles.size, styles.width, styles.height, styles.minWidth, styles.minHeight, styles.maxWidth, styles.maxHeight, styles.overflow, styles.verticalAlign);
|
|
20
21
|
export var POSITION = styles.compose(styles.position, styles.zIndex, styles.top, styles.right, styles.bottom, styles.left);
|
|
21
|
-
export var FLEXBOX = styles.compose(styles.flexBasis, styles.flexDirection, styles.flexWrap, styles.alignContent, styles.alignItems, styles.justifyContent, styles.justifyItems, styles.order, styles.flex, styles.flexShrink, styles.flexGrow, styles.justifySelf, styles.alignSelf);
|
|
22
|
+
export var FLEXBOX = styles.compose(styles.flexBasis, styles.flexDirection, styles.flexWrap, styles.alignContent, styles.alignItems, styles.justifyContent, styles.justifyItems, styles.order, styles.flex, styles.flexShrink, styles.flexGrow, styles.justifySelf, styles.alignSelf, gap);
|
|
22
23
|
export var GRID = styles.grid;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sproutsocial/racine",
|
|
3
|
-
"version": "14.
|
|
3
|
+
"version": "14.1.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"files": [
|
|
6
6
|
"__flow__",
|
|
@@ -100,7 +100,6 @@
|
|
|
100
100
|
"@babel/preset-typescript": "^7.18.6",
|
|
101
101
|
"@changesets/cli": "^2.12.0",
|
|
102
102
|
"@khanacademy/flow-to-ts": "^0.5.2",
|
|
103
|
-
"@reach/component-component": "^0.1.3",
|
|
104
103
|
"@sproutsocial/seeds-border": "^1.1.0",
|
|
105
104
|
"@sproutsocial/seeds-color": "^1.5.3",
|
|
106
105
|
"@sproutsocial/seeds-depth": "^3.0.0",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"system-props.d.ts","sourceRoot":"","sources":["../../../src/utils/system-props.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAOxC,eAAO,MAAM,MAAM,gBAOlB,CAAC;AAEF,eAAO,MAAM,MAAM,gBAgBlB,CAAC;AAEF,eAAO,MAAM,UAAU,gBAOtB,CAAC;AAEF,eAAO,MAAM,MAAM,gBAWlB,CAAC;AAEF,eAAO,MAAM,QAAQ,gBAOpB,CAAC;AAEF,eAAO,MAAM,OAAO,gBAcnB,CAAC;AAEF,eAAO,MAAM,IAAI,gBAAc,CAAC"}
|
|
File without changes
|