@primer/components 0.0.0-20211030175634 → 0.0.0-2021103018051
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 +11 -1
- package/dist/browser.esm.js +104 -108
- package/dist/browser.esm.js.map +1 -1
- package/dist/browser.umd.js +104 -108
- package/dist/browser.umd.js.map +1 -1
- package/lib/Avatar.d.ts +1 -2
- package/lib/Avatar.js +1 -1
- package/lib/BranchName.d.ts +1 -2
- package/lib/BranchName.js +1 -1
- package/lib/Details.d.ts +1 -2
- package/lib/Details.js +1 -3
- package/lib/Dropdown.d.ts +2 -66
- package/lib/Heading.d.ts +1 -2
- package/lib/Heading.js +1 -6
- package/lib/ProgressBar.d.ts +16 -11
- package/lib/ProgressBar.js +6 -10
- package/lib/Spinner.d.ts +1 -2
- package/lib/Spinner.js +1 -3
- package/lib-esm/Avatar.d.ts +1 -2
- package/lib-esm/Avatar.js +2 -2
- package/lib-esm/BranchName.d.ts +1 -2
- package/lib-esm/BranchName.js +2 -2
- package/lib-esm/Details.d.ts +1 -2
- package/lib-esm/Details.js +1 -2
- package/lib-esm/Dropdown.d.ts +2 -66
- package/lib-esm/Heading.d.ts +1 -2
- package/lib-esm/Heading.js +2 -6
- package/lib-esm/ProgressBar.d.ts +16 -11
- package/lib-esm/ProgressBar.js +7 -11
- package/lib-esm/Spinner.d.ts +1 -2
- package/lib-esm/Spinner.js +1 -2
- package/package.json +1 -1
package/lib-esm/ProgressBar.js
CHANGED
@@ -1,14 +1,12 @@
|
|
1
|
-
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); }
|
2
|
-
|
3
1
|
import React from 'react';
|
4
2
|
import styled from 'styled-components';
|
5
3
|
import { width } from 'styled-system';
|
6
|
-
import {
|
4
|
+
import { get } from './constants';
|
7
5
|
import sx from './sx';
|
8
6
|
const Bar = styled.span.withConfig({
|
9
7
|
displayName: "ProgressBar__Bar",
|
10
8
|
componentId: "sc-1tiva13-0"
|
11
|
-
})(["width:", ";", ""], props => props.progress ? `${props.progress}%` : 0,
|
9
|
+
})(["width:", ";", ";"], props => props.progress ? `${props.progress}%` : 0, sx);
|
12
10
|
const sizeMap = {
|
13
11
|
small: '5px',
|
14
12
|
large: '10px',
|
@@ -17,20 +15,18 @@ const sizeMap = {
|
|
17
15
|
const ProgressContainer = styled.span.withConfig({
|
18
16
|
displayName: "ProgressBar__ProgressContainer",
|
19
17
|
componentId: "sc-1tiva13-1"
|
20
|
-
})(["display:", ";overflow:hidden;background-color:", ";border-radius:", ";height:", ";", " ", "
|
18
|
+
})(["display:", ";overflow:hidden;background-color:", ";border-radius:", ";height:", ";", " ", ";"], props => props.inline ? 'inline-flex' : 'flex', get('colors.border.default'), get('radii.1'), props => sizeMap[props.barSize || 'default'], width, sx);
|
21
19
|
|
22
20
|
function ProgressBar({
|
23
21
|
progress,
|
24
22
|
bg,
|
25
|
-
theme,
|
26
23
|
...rest
|
27
24
|
}) {
|
28
|
-
return /*#__PURE__*/React.createElement(ProgressContainer,
|
29
|
-
theme: theme
|
30
|
-
}, rest), /*#__PURE__*/React.createElement(Bar, {
|
25
|
+
return /*#__PURE__*/React.createElement(ProgressContainer, rest, /*#__PURE__*/React.createElement(Bar, {
|
31
26
|
progress: progress,
|
32
|
-
|
33
|
-
|
27
|
+
sx: {
|
28
|
+
bg
|
29
|
+
}
|
34
30
|
}));
|
35
31
|
}
|
36
32
|
|
package/lib-esm/Spinner.d.ts
CHANGED
@@ -1,5 +1,4 @@
|
|
1
1
|
/// <reference types="react" />
|
2
|
-
import { SystemCommonProps } from './constants';
|
3
2
|
import { SxProp } from './sx';
|
4
3
|
import { ComponentProps } from './utils/types';
|
5
4
|
declare const sizeMap: {
|
@@ -12,6 +11,6 @@ export interface SpinnerInternalProps {
|
|
12
11
|
size?: keyof typeof sizeMap;
|
13
12
|
}
|
14
13
|
declare function Spinner({ size: sizeKey, ...props }: SpinnerInternalProps): JSX.Element;
|
15
|
-
declare const StyledSpinner: import("styled-components").StyledComponent<typeof Spinner, any,
|
14
|
+
declare const StyledSpinner: import("styled-components").StyledComponent<typeof Spinner, any, SxProp, never>;
|
16
15
|
export declare type SpinnerProps = ComponentProps<typeof StyledSpinner>;
|
17
16
|
export default StyledSpinner;
|
package/lib-esm/Spinner.js
CHANGED
@@ -2,7 +2,6 @@ function _extends() { _extends = Object.assign || function (target) { for (var i
|
|
2
2
|
|
3
3
|
import React from 'react';
|
4
4
|
import styled from 'styled-components';
|
5
|
-
import { COMMON } from './constants';
|
6
5
|
import sx from './sx';
|
7
6
|
const sizeMap = {
|
8
7
|
small: '16px',
|
@@ -41,6 +40,6 @@ Spinner.displayName = "Spinner";
|
|
41
40
|
const StyledSpinner = styled(Spinner).withConfig({
|
42
41
|
displayName: "Spinner__StyledSpinner",
|
43
42
|
componentId: "sc-14tspit-0"
|
44
|
-
})(["@keyframes rotate-keyframes{100%{transform:rotate(360deg);}}animation:rotate-keyframes 1s linear infinite;", "
|
43
|
+
})(["@keyframes rotate-keyframes{100%{transform:rotate(360deg);}}animation:rotate-keyframes 1s linear infinite;", ""], sx);
|
45
44
|
StyledSpinner.displayName = 'Spinner';
|
46
45
|
export default StyledSpinner;
|