@primer/components 0.0.0-2021103224924 → 0.0.0-202110322537
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 +2 -2
- package/dist/browser.esm.js +3 -4
- package/dist/browser.esm.js.map +1 -1
- package/dist/browser.umd.js +3 -4
- package/dist/browser.umd.js.map +1 -1
- package/lib/Breadcrumbs.d.ts +8 -7
- package/lib/Breadcrumbs.js +7 -12
- package/lib/UnderlineNav.d.ts +3 -2
- package/lib/UnderlineNav.js +2 -2
- package/lib-esm/Breadcrumbs.d.ts +8 -7
- package/lib-esm/Breadcrumbs.js +8 -13
- package/lib-esm/UnderlineNav.d.ts +3 -2
- package/lib-esm/UnderlineNav.js +3 -3
- package/package.json +1 -1
package/lib/Breadcrumbs.d.ts
CHANGED
@@ -1,24 +1,25 @@
|
|
1
1
|
import * as History from 'history';
|
2
2
|
import React from 'react';
|
3
|
-
import { SystemCommonProps, SystemFlexProps } from './constants';
|
4
3
|
import { SxProp } from './sx';
|
5
4
|
import { ComponentProps } from './utils/types';
|
6
|
-
declare const BreadcrumbsBase: import("styled-components").StyledComponent<"nav", any,
|
7
|
-
export declare type BreadcrumbsProps =
|
8
|
-
|
5
|
+
declare const BreadcrumbsBase: import("styled-components").StyledComponent<"nav", any, SxProp, never>;
|
6
|
+
export declare type BreadcrumbsProps = React.PropsWithChildren<{
|
7
|
+
className?: string;
|
8
|
+
} & SxProp>;
|
9
|
+
declare function Breadcrumbs({ className, children, sx: sxProp }: React.PropsWithChildren<BreadcrumbsProps>): JSX.Element;
|
9
10
|
declare namespace Breadcrumbs {
|
10
11
|
var displayName: string;
|
11
12
|
}
|
12
13
|
declare const BreadcrumbsItem: import("styled-components").StyledComponent<"a", any, {
|
13
14
|
to?: History.LocationDescriptor<unknown> | undefined;
|
14
15
|
selected?: boolean | undefined;
|
15
|
-
} &
|
16
|
+
} & SxProp, never>;
|
16
17
|
export declare type BreadcrumbsItemProps = ComponentProps<typeof BreadcrumbsItem>;
|
17
18
|
declare const _default: typeof Breadcrumbs & {
|
18
19
|
Item: import("styled-components").StyledComponent<"a", any, {
|
19
20
|
to?: History.LocationDescriptor<unknown> | undefined;
|
20
21
|
selected?: boolean | undefined;
|
21
|
-
} &
|
22
|
+
} & SxProp, never>;
|
22
23
|
};
|
23
24
|
export default _default;
|
24
25
|
/**
|
@@ -28,7 +29,7 @@ export declare const Breadcrumb: typeof Breadcrumbs & {
|
|
28
29
|
Item: import("styled-components").StyledComponent<"a", any, {
|
29
30
|
to?: History.LocationDescriptor<unknown> | undefined;
|
30
31
|
selected?: boolean | undefined;
|
31
|
-
} &
|
32
|
+
} & SxProp, never>;
|
32
33
|
};
|
33
34
|
/**
|
34
35
|
* @deprecated Use the `BreadcrumbsProps` type instead
|
package/lib/Breadcrumbs.js
CHANGED
@@ -19,8 +19,6 @@ var _sx = _interopRequireDefault(require("./sx"));
|
|
19
19
|
|
20
20
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
21
21
|
|
22
|
-
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); }
|
23
|
-
|
24
22
|
const SELECTED_CLASS = 'selected';
|
25
23
|
|
26
24
|
const Wrapper = _styledComponents.default.li.withConfig({
|
@@ -31,23 +29,20 @@ const Wrapper = _styledComponents.default.li.withConfig({
|
|
31
29
|
const BreadcrumbsBase = _styledComponents.default.nav.withConfig({
|
32
30
|
displayName: "Breadcrumbs__BreadcrumbsBase",
|
33
31
|
componentId: "hwwoo0-1"
|
34
|
-
})(["display:flex;justify-content:space-between;", ";"
|
32
|
+
})(["display:flex;justify-content:space-between;", ";"], _sx.default);
|
35
33
|
|
36
34
|
function Breadcrumbs({
|
37
35
|
className,
|
38
36
|
children,
|
39
|
-
|
40
|
-
...rest
|
37
|
+
sx: sxProp
|
41
38
|
}) {
|
42
|
-
const wrappedChildren = _react.default.Children.map(children, child => /*#__PURE__*/_react.default.createElement(Wrapper,
|
43
|
-
theme: theme
|
44
|
-
}, child));
|
39
|
+
const wrappedChildren = _react.default.Children.map(children, child => /*#__PURE__*/_react.default.createElement(Wrapper, null, child));
|
45
40
|
|
46
|
-
return /*#__PURE__*/_react.default.createElement(BreadcrumbsBase,
|
41
|
+
return /*#__PURE__*/_react.default.createElement(BreadcrumbsBase, {
|
47
42
|
className: className,
|
48
43
|
"aria-label": "Breadcrumbs",
|
49
|
-
|
50
|
-
},
|
44
|
+
sx: sxProp
|
45
|
+
}, /*#__PURE__*/_react.default.createElement(_Box.default, {
|
51
46
|
as: "ol",
|
52
47
|
my: 0,
|
53
48
|
pl: 0
|
@@ -63,7 +58,7 @@ const BreadcrumbsItem = _styledComponents.default.a.attrs(props => ({
|
|
63
58
|
})).withConfig({
|
64
59
|
displayName: "Breadcrumbs__BreadcrumbsItem",
|
65
60
|
componentId: "hwwoo0-2"
|
66
|
-
})(["color:", ";display:inline-block;font-size:", ";text-decoration:none;&:hover{text-decoration:underline;}&.selected{color:", ";pointer-events:none;}", "
|
61
|
+
})(["color:", ";display:inline-block;font-size:", ";text-decoration:none;&:hover{text-decoration:underline;}&.selected{color:", ";pointer-events:none;}", ";"], (0, _constants.get)('colors.accent.fg'), (0, _constants.get)('fontSizes.1'), (0, _constants.get)('colors.fg.default'), _sx.default);
|
67
62
|
|
68
63
|
Breadcrumbs.displayName = 'Breadcrumbs';
|
69
64
|
BreadcrumbsItem.displayName = 'Breadcrumbs.Item';
|
package/lib/UnderlineNav.d.ts
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
import * as History from 'history';
|
2
2
|
import React from 'react';
|
3
|
+
import { SystemCommonProps } from './constants';
|
3
4
|
import { SxProp } from './sx';
|
4
5
|
import { ComponentProps } from './utils/types';
|
5
6
|
declare const UnderlineNavBase: import("styled-components").StyledComponent<"nav", any, SxProp, never>;
|
@@ -13,12 +14,12 @@ declare function UnderlineNav({ actions, className, align, children, full, label
|
|
13
14
|
declare const UnderlineNavLink: import("styled-components").StyledComponent<"a", any, {
|
14
15
|
to?: History.LocationDescriptor<unknown> | undefined;
|
15
16
|
selected?: boolean | undefined;
|
16
|
-
} & SxProp, never>;
|
17
|
+
} & SystemCommonProps & SxProp, never>;
|
17
18
|
export declare type UnderlineNavLinkProps = ComponentProps<typeof UnderlineNavLink>;
|
18
19
|
declare const _default: typeof UnderlineNav & {
|
19
20
|
Link: import("styled-components").StyledComponent<"a", any, {
|
20
21
|
to?: History.LocationDescriptor<unknown> | undefined;
|
21
22
|
selected?: boolean | undefined;
|
22
|
-
} & SxProp, never>;
|
23
|
+
} & SystemCommonProps & SxProp, never>;
|
23
24
|
};
|
24
25
|
export default _default;
|
package/lib/UnderlineNav.js
CHANGED
@@ -25,7 +25,7 @@ const SELECTED_CLASS = 'selected';
|
|
25
25
|
const UnderlineNavBase = _styledComponents.default.nav.withConfig({
|
26
26
|
displayName: "UnderlineNav__UnderlineNavBase",
|
27
27
|
componentId: "zrnxqt-0"
|
28
|
-
})(["display:flex;justify-content:space-between;border-bottom:1px solid ", ";&.UnderlineNav--right{justify-content:flex-end;.UnderlineNav-item{margin-right:0;margin-left:", ";}.UnderlineNav-actions{flex:1 1 auto;}}&.UnderlineNav--full{display:block;}.UnderlineNav-body{display:flex;margin-bottom:-1px;}.UnderlineNav-actions{align-self:center;}", ";"], (0, _constants.get)('colors.border.muted'), (0, _constants.get)('space.3'), _sx.default);
|
28
|
+
})(["display:flex;justify-content:space-between;border-bottom:1px solid ", ";&.UnderlineNav--right{justify-content:flex-end;.UnderlineNav-item{margin-right:0;margin-left:", ";}.UnderlineNav-actions{flex:1 1 auto;}}&.UnderlineNav--full{display:block;}.UnderlineNav-body{display:flex;margin-bottom:-1px;}.UnderlineNav-actions{align-self:center;}", ";", ";"], (0, _constants.get)('colors.border.muted'), (0, _constants.get)('space.3'), _constants.COMMON, _sx.default);
|
29
29
|
|
30
30
|
function UnderlineNav({
|
31
31
|
actions,
|
@@ -57,7 +57,7 @@ const UnderlineNavLink = _styledComponents.default.a.attrs(props => ({
|
|
57
57
|
})).withConfig({
|
58
58
|
displayName: "UnderlineNav__UnderlineNavLink",
|
59
59
|
componentId: "zrnxqt-1"
|
60
|
-
})(["padding:", " ", ";margin-right:", ";font-size:", ";line-height:", ";color:", ";text-align:center;border-bottom:2px solid transparent;text-decoration:none;&:hover,&:focus{color:", ";text-decoration:none;border-bottom-color:", ";transition:0.2s ease;.UnderlineNav-octicon{color:", ";}}&.selected{color:", ";border-bottom-color:", ";.UnderlineNav-octicon{color:", ";}}", ";"], (0, _constants.get)('space.3'), (0, _constants.get)('space.2'), (0, _constants.get)('space.3'), (0, _constants.get)('fontSizes.1'), (0, _constants.get)('lineHeights.default'), (0, _constants.get)('colors.fg.default'), (0, _constants.get)('colors.fg.default'), (0, _constants.get)('colors.neutral.muted'), (0, _constants.get)('colors.fg.muted'), (0, _constants.get)('colors.fg.default'), (0, _constants.get)('colors.primer.border.active'), (0, _constants.get)('colors.fg.default'), _sx.default);
|
60
|
+
})(["padding:", " ", ";margin-right:", ";font-size:", ";line-height:", ";color:", ";text-align:center;border-bottom:2px solid transparent;text-decoration:none;&:hover,&:focus{color:", ";text-decoration:none;border-bottom-color:", ";transition:0.2s ease;.UnderlineNav-octicon{color:", ";}}&.selected{color:", ";border-bottom-color:", ";.UnderlineNav-octicon{color:", ";}}", ";", ";"], (0, _constants.get)('space.3'), (0, _constants.get)('space.2'), (0, _constants.get)('space.3'), (0, _constants.get)('fontSizes.1'), (0, _constants.get)('lineHeights.default'), (0, _constants.get)('colors.fg.default'), (0, _constants.get)('colors.fg.default'), (0, _constants.get)('colors.neutral.muted'), (0, _constants.get)('colors.fg.muted'), (0, _constants.get)('colors.fg.default'), (0, _constants.get)('colors.primer.border.active'), (0, _constants.get)('colors.fg.default'), _constants.COMMON, _sx.default);
|
61
61
|
|
62
62
|
UnderlineNavLink.displayName = 'UnderlineNav.Link';
|
63
63
|
|
package/lib-esm/Breadcrumbs.d.ts
CHANGED
@@ -1,24 +1,25 @@
|
|
1
1
|
import * as History from 'history';
|
2
2
|
import React from 'react';
|
3
|
-
import { SystemCommonProps, SystemFlexProps } from './constants';
|
4
3
|
import { SxProp } from './sx';
|
5
4
|
import { ComponentProps } from './utils/types';
|
6
|
-
declare const BreadcrumbsBase: import("styled-components").StyledComponent<"nav", any,
|
7
|
-
export declare type BreadcrumbsProps =
|
8
|
-
|
5
|
+
declare const BreadcrumbsBase: import("styled-components").StyledComponent<"nav", any, SxProp, never>;
|
6
|
+
export declare type BreadcrumbsProps = React.PropsWithChildren<{
|
7
|
+
className?: string;
|
8
|
+
} & SxProp>;
|
9
|
+
declare function Breadcrumbs({ className, children, sx: sxProp }: React.PropsWithChildren<BreadcrumbsProps>): JSX.Element;
|
9
10
|
declare namespace Breadcrumbs {
|
10
11
|
var displayName: string;
|
11
12
|
}
|
12
13
|
declare const BreadcrumbsItem: import("styled-components").StyledComponent<"a", any, {
|
13
14
|
to?: History.LocationDescriptor<unknown> | undefined;
|
14
15
|
selected?: boolean | undefined;
|
15
|
-
} &
|
16
|
+
} & SxProp, never>;
|
16
17
|
export declare type BreadcrumbsItemProps = ComponentProps<typeof BreadcrumbsItem>;
|
17
18
|
declare const _default: typeof Breadcrumbs & {
|
18
19
|
Item: import("styled-components").StyledComponent<"a", any, {
|
19
20
|
to?: History.LocationDescriptor<unknown> | undefined;
|
20
21
|
selected?: boolean | undefined;
|
21
|
-
} &
|
22
|
+
} & SxProp, never>;
|
22
23
|
};
|
23
24
|
export default _default;
|
24
25
|
/**
|
@@ -28,7 +29,7 @@ export declare const Breadcrumb: typeof Breadcrumbs & {
|
|
28
29
|
Item: import("styled-components").StyledComponent<"a", any, {
|
29
30
|
to?: History.LocationDescriptor<unknown> | undefined;
|
30
31
|
selected?: boolean | undefined;
|
31
|
-
} &
|
32
|
+
} & SxProp, never>;
|
32
33
|
};
|
33
34
|
/**
|
34
35
|
* @deprecated Use the `BreadcrumbsProps` type instead
|
package/lib-esm/Breadcrumbs.js
CHANGED
@@ -1,11 +1,9 @@
|
|
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 classnames from 'classnames'; // eslint-disable-next-line import/no-namespace
|
4
2
|
|
5
3
|
import React from 'react';
|
6
4
|
import styled from 'styled-components';
|
7
5
|
import Box from './Box';
|
8
|
-
import {
|
6
|
+
import { get } from './constants';
|
9
7
|
import sx from './sx';
|
10
8
|
const SELECTED_CLASS = 'selected';
|
11
9
|
const Wrapper = styled.li.withConfig({
|
@@ -15,22 +13,19 @@ const Wrapper = styled.li.withConfig({
|
|
15
13
|
const BreadcrumbsBase = styled.nav.withConfig({
|
16
14
|
displayName: "Breadcrumbs__BreadcrumbsBase",
|
17
15
|
componentId: "hwwoo0-1"
|
18
|
-
})(["display:flex;justify-content:space-between;", ";"
|
16
|
+
})(["display:flex;justify-content:space-between;", ";"], sx);
|
19
17
|
|
20
18
|
function Breadcrumbs({
|
21
19
|
className,
|
22
20
|
children,
|
23
|
-
|
24
|
-
...rest
|
21
|
+
sx: sxProp
|
25
22
|
}) {
|
26
|
-
const wrappedChildren = React.Children.map(children, child => /*#__PURE__*/React.createElement(Wrapper,
|
27
|
-
|
28
|
-
}, child));
|
29
|
-
return /*#__PURE__*/React.createElement(BreadcrumbsBase, _extends({
|
23
|
+
const wrappedChildren = React.Children.map(children, child => /*#__PURE__*/React.createElement(Wrapper, null, child));
|
24
|
+
return /*#__PURE__*/React.createElement(BreadcrumbsBase, {
|
30
25
|
className: className,
|
31
26
|
"aria-label": "Breadcrumbs",
|
32
|
-
|
33
|
-
},
|
27
|
+
sx: sxProp
|
28
|
+
}, /*#__PURE__*/React.createElement(Box, {
|
34
29
|
as: "ol",
|
35
30
|
my: 0,
|
36
31
|
pl: 0
|
@@ -45,7 +40,7 @@ const BreadcrumbsItem = styled.a.attrs(props => ({
|
|
45
40
|
})).withConfig({
|
46
41
|
displayName: "Breadcrumbs__BreadcrumbsItem",
|
47
42
|
componentId: "hwwoo0-2"
|
48
|
-
})(["color:", ";display:inline-block;font-size:", ";text-decoration:none;&:hover{text-decoration:underline;}&.selected{color:", ";pointer-events:none;}", "
|
43
|
+
})(["color:", ";display:inline-block;font-size:", ";text-decoration:none;&:hover{text-decoration:underline;}&.selected{color:", ";pointer-events:none;}", ";"], get('colors.accent.fg'), get('fontSizes.1'), get('colors.fg.default'), sx);
|
49
44
|
Breadcrumbs.displayName = 'Breadcrumbs';
|
50
45
|
BreadcrumbsItem.displayName = 'Breadcrumbs.Item';
|
51
46
|
export default Object.assign(Breadcrumbs, {
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import * as History from 'history';
|
2
2
|
import React from 'react';
|
3
|
+
import { SystemCommonProps } from './constants';
|
3
4
|
import { SxProp } from './sx';
|
4
5
|
import { ComponentProps } from './utils/types';
|
5
6
|
declare const UnderlineNavBase: import("styled-components").StyledComponent<"nav", any, SxProp, never>;
|
@@ -13,12 +14,12 @@ declare function UnderlineNav({ actions, className, align, children, full, label
|
|
13
14
|
declare const UnderlineNavLink: import("styled-components").StyledComponent<"a", any, {
|
14
15
|
to?: History.LocationDescriptor<unknown> | undefined;
|
15
16
|
selected?: boolean | undefined;
|
16
|
-
} & SxProp, never>;
|
17
|
+
} & SystemCommonProps & SxProp, never>;
|
17
18
|
export declare type UnderlineNavLinkProps = ComponentProps<typeof UnderlineNavLink>;
|
18
19
|
declare const _default: typeof UnderlineNav & {
|
19
20
|
Link: import("styled-components").StyledComponent<"a", any, {
|
20
21
|
to?: History.LocationDescriptor<unknown> | undefined;
|
21
22
|
selected?: boolean | undefined;
|
22
|
-
} & SxProp, never>;
|
23
|
+
} & SystemCommonProps & SxProp, never>;
|
23
24
|
};
|
24
25
|
export default _default;
|
package/lib-esm/UnderlineNav.js
CHANGED
@@ -4,14 +4,14 @@ import classnames from 'classnames'; // eslint-disable-next-line import/no-names
|
|
4
4
|
|
5
5
|
import React from 'react';
|
6
6
|
import styled from 'styled-components';
|
7
|
-
import { get } from './constants';
|
7
|
+
import { COMMON, get } from './constants';
|
8
8
|
import sx from './sx';
|
9
9
|
const ITEM_CLASS = 'UnderlineNav-item';
|
10
10
|
const SELECTED_CLASS = 'selected';
|
11
11
|
const UnderlineNavBase = styled.nav.withConfig({
|
12
12
|
displayName: "UnderlineNav__UnderlineNavBase",
|
13
13
|
componentId: "zrnxqt-0"
|
14
|
-
})(["display:flex;justify-content:space-between;border-bottom:1px solid ", ";&.UnderlineNav--right{justify-content:flex-end;.UnderlineNav-item{margin-right:0;margin-left:", ";}.UnderlineNav-actions{flex:1 1 auto;}}&.UnderlineNav--full{display:block;}.UnderlineNav-body{display:flex;margin-bottom:-1px;}.UnderlineNav-actions{align-self:center;}", ";"], get('colors.border.muted'), get('space.3'), sx);
|
14
|
+
})(["display:flex;justify-content:space-between;border-bottom:1px solid ", ";&.UnderlineNav--right{justify-content:flex-end;.UnderlineNav-item{margin-right:0;margin-left:", ";}.UnderlineNav-actions{flex:1 1 auto;}}&.UnderlineNav--full{display:block;}.UnderlineNav-body{display:flex;margin-bottom:-1px;}.UnderlineNav-actions{align-self:center;}", ";", ";"], get('colors.border.muted'), get('space.3'), COMMON, sx);
|
15
15
|
|
16
16
|
function UnderlineNav({
|
17
17
|
actions,
|
@@ -42,7 +42,7 @@ const UnderlineNavLink = styled.a.attrs(props => ({
|
|
42
42
|
})).withConfig({
|
43
43
|
displayName: "UnderlineNav__UnderlineNavLink",
|
44
44
|
componentId: "zrnxqt-1"
|
45
|
-
})(["padding:", " ", ";margin-right:", ";font-size:", ";line-height:", ";color:", ";text-align:center;border-bottom:2px solid transparent;text-decoration:none;&:hover,&:focus{color:", ";text-decoration:none;border-bottom-color:", ";transition:0.2s ease;.UnderlineNav-octicon{color:", ";}}&.selected{color:", ";border-bottom-color:", ";.UnderlineNav-octicon{color:", ";}}", ";"], get('space.3'), get('space.2'), get('space.3'), get('fontSizes.1'), get('lineHeights.default'), get('colors.fg.default'), get('colors.fg.default'), get('colors.neutral.muted'), get('colors.fg.muted'), get('colors.fg.default'), get('colors.primer.border.active'), get('colors.fg.default'), sx);
|
45
|
+
})(["padding:", " ", ";margin-right:", ";font-size:", ";line-height:", ";color:", ";text-align:center;border-bottom:2px solid transparent;text-decoration:none;&:hover,&:focus{color:", ";text-decoration:none;border-bottom-color:", ";transition:0.2s ease;.UnderlineNav-octicon{color:", ";}}&.selected{color:", ";border-bottom-color:", ";.UnderlineNav-octicon{color:", ";}}", ";", ";"], get('space.3'), get('space.2'), get('space.3'), get('fontSizes.1'), get('lineHeights.default'), get('colors.fg.default'), get('colors.fg.default'), get('colors.neutral.muted'), get('colors.fg.muted'), get('colors.fg.default'), get('colors.primer.border.active'), get('colors.fg.default'), COMMON, sx);
|
46
46
|
UnderlineNavLink.displayName = 'UnderlineNav.Link';
|
47
47
|
export default Object.assign(UnderlineNav, {
|
48
48
|
Link: UnderlineNavLink
|