@spothero/ui 15.4.0-beta.1 → 15.5.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/backlog/v1/components/Table/Table.js +2 -2
- package/package.json +1 -1
- package/styles/v1/components/Table/Table.jsx +2 -2
- package/styles/v2/components/Modal/styles/dialogContainer.js +4 -0
- package/styles/v2/components/ThemeProvider/ThemeProvider.jsx +13 -2
- package/styles/v2/components/ThemeProvider/ThemeProvider.stories.js +6 -0
- package/styles/v2/theme/base/typography.js +2 -2
- package/styles/v2/theme/global.js +6 -4
- package/v1/index.js +1 -1
- package/v1/index.js.map +1 -1
- package/v2/index.js +1 -1
- package/v2/index.js.map +1 -1
- package/styles/v2/theme/fonts/OpenSans-Bold.ttf +0 -0
- package/styles/v2/theme/fonts/OpenSans-Light.ttf +0 -0
- package/styles/v2/theme/fonts/OpenSans-Regular.ttf +0 -0
- package/styles/v2/theme/fonts/OpenSans-SemiBold.ttf +0 -0
|
@@ -51,7 +51,7 @@ var _map2 = _interopRequireDefault(require("lodash/map"));
|
|
|
51
51
|
|
|
52
52
|
var _some = _interopRequireDefault(require("lodash/some"));
|
|
53
53
|
|
|
54
|
-
var
|
|
54
|
+
var _sortBy = _interopRequireDefault(require("lodash/sortBy"));
|
|
55
55
|
|
|
56
56
|
var _react = _interopRequireWildcard(require("react"));
|
|
57
57
|
|
|
@@ -169,7 +169,7 @@ var Table = /*#__PURE__*/function (_Component) {
|
|
|
169
169
|
|
|
170
170
|
if (sorting) {
|
|
171
171
|
var sort = (0, _isFunction.default)(sorting) ? [sorting] : (0, _toConsumableArray2.default)(sorting);
|
|
172
|
-
sortedData = (0,
|
|
172
|
+
sortedData = (0, _sortBy.default)(data, sort);
|
|
173
173
|
}
|
|
174
174
|
|
|
175
175
|
return /*#__PURE__*/_react.default.createElement("tbody", {
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@ import isNumber from 'lodash/isNumber';
|
|
|
4
4
|
import isObject from 'lodash/isObject';
|
|
5
5
|
import map from 'lodash/map';
|
|
6
6
|
import some from 'lodash/some';
|
|
7
|
-
import
|
|
7
|
+
import sortBy from 'lodash/sortBy';
|
|
8
8
|
import React, {Component} from 'react';
|
|
9
9
|
import PropTypes from 'prop-types';
|
|
10
10
|
import classNames from 'classnames';
|
|
@@ -248,7 +248,7 @@ export default class Table extends Component {
|
|
|
248
248
|
if (sorting) {
|
|
249
249
|
const sort = isFunction(sorting) ? [sorting] : [...sorting];
|
|
250
250
|
|
|
251
|
-
sortedData =
|
|
251
|
+
sortedData = sortBy(data, sort);
|
|
252
252
|
}
|
|
253
253
|
|
|
254
254
|
return (
|
|
@@ -7,9 +7,18 @@ import {Fonts, LegacyOverrides} from 'v2/theme/global';
|
|
|
7
7
|
import merge from 'lodash/merge';
|
|
8
8
|
|
|
9
9
|
const ThemeProvider = forwardRef(
|
|
10
|
-
(
|
|
10
|
+
(
|
|
11
|
+
{
|
|
12
|
+
theme,
|
|
13
|
+
useLegacyOverrides,
|
|
14
|
+
disableExternalFonts = false,
|
|
15
|
+
children,
|
|
16
|
+
...props
|
|
17
|
+
},
|
|
18
|
+
ref
|
|
19
|
+
) => (
|
|
11
20
|
<ChakraProvider {...props} ref={ref} theme={merge(THEME, theme)}>
|
|
12
|
-
<Fonts />
|
|
21
|
+
{disableExternalFonts ? null : <Fonts />}
|
|
13
22
|
<LegacyOverrides useLegacyOverrides={useLegacyOverrides} />
|
|
14
23
|
{children}
|
|
15
24
|
</ChakraProvider>
|
|
@@ -19,6 +28,8 @@ const ThemeProvider = forwardRef(
|
|
|
19
28
|
ThemeProvider.propTypes = {
|
|
20
29
|
/** If true, this will use the old `spothero-html` base styles */
|
|
21
30
|
useLegacyOverrides: PropTypes.bool,
|
|
31
|
+
/** If true, this will not load the `Fonts` global styles */
|
|
32
|
+
disableExternalFonts: PropTypes.bool,
|
|
22
33
|
/** The React node (generally your entire App) that will be provided the theme */
|
|
23
34
|
children: PropTypes.node,
|
|
24
35
|
/** Adds additional themeing on top of SpotHero's default configuration */
|
|
@@ -64,6 +64,12 @@ const Template = (props, {hasDarkBackground}) => {
|
|
|
64
64
|
a boolean. If true, the ThemeProvider will insert the typography
|
|
65
65
|
styling from .spothero-html
|
|
66
66
|
</Text>{' '}
|
|
67
|
+
<Text mb={8} color={contentTextColor}>
|
|
68
|
+
ThemeProvider also has a <Code>disableExternalFonts</Code> prop
|
|
69
|
+
that is a boolean. If true, the ThemeProvider will not load the
|
|
70
|
+
font files from Google's CDN, and you will be able to handle
|
|
71
|
+
fonts on a project-level.
|
|
72
|
+
</Text>{' '}
|
|
67
73
|
</Box>
|
|
68
74
|
);
|
|
69
75
|
};
|
|
@@ -23,12 +23,14 @@ export default global;
|
|
|
23
23
|
export const Fonts = () => (
|
|
24
24
|
<Global
|
|
25
25
|
styles={`
|
|
26
|
+
@import url('https://fonts.googleapis.com/css2?family=Open+Sans:wght@300;400;600;700&display=swap');
|
|
27
|
+
/* Copied from https://fonts.googleapis.com/css2?family=Open+Sans:wght@700&display=swap */
|
|
26
28
|
/* latin-ext */
|
|
27
29
|
@font-face {
|
|
28
30
|
font-family: 'Open Sans';
|
|
29
31
|
font-style: normal;
|
|
30
32
|
font-weight: 700;
|
|
31
|
-
src: url(
|
|
33
|
+
src: url(https://fonts.gstatic.com/s/opensans/v18/mem5YaGs126MiZpBA-UN7rgOXOhpKKSTj5PW.woff2) format('woff2');
|
|
32
34
|
unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
|
|
33
35
|
}
|
|
34
36
|
/* latin-ext */
|
|
@@ -36,7 +38,7 @@ export const Fonts = () => (
|
|
|
36
38
|
font-family: 'Open Sans';
|
|
37
39
|
font-style: normal;
|
|
38
40
|
font-weight: 600;
|
|
39
|
-
src: url(
|
|
41
|
+
src: url(https://fonts.gstatic.com/s/opensans/v18/mem5YaGs126MiZpBA-UNirkOXOhpKKSTj5PW.woff2) format('woff2');
|
|
40
42
|
unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
|
|
41
43
|
}
|
|
42
44
|
/* latin-ext */
|
|
@@ -44,7 +46,7 @@ export const Fonts = () => (
|
|
|
44
46
|
font-family: 'Open Sans';
|
|
45
47
|
font-style: normal;
|
|
46
48
|
font-weight: 400;
|
|
47
|
-
src: url(
|
|
49
|
+
src: url(https://fonts.gstatic.com/s/opensans/v18/mem8YaGs126MiZpBA-UFW50bf8pkAp6a.woff2) format('woff2');
|
|
48
50
|
unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
|
|
49
51
|
}
|
|
50
52
|
/* latin-ext */
|
|
@@ -52,7 +54,7 @@ export const Fonts = () => (
|
|
|
52
54
|
font-family: 'Open Sans';
|
|
53
55
|
font-style: normal;
|
|
54
56
|
font-weight: 300;
|
|
55
|
-
src: url(
|
|
57
|
+
src: url(https://fonts.gstatic.com/s/opensans/v18/mem5YaGs126MiZpBA-UN_r8OXOhpKKSTj5PW.woff2) format('woff2');
|
|
56
58
|
unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
|
|
57
59
|
}
|
|
58
60
|
`}
|