@primer/components 0.0.0-202110321848 → 0.0.0-202110322927
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 +2 -2
- package/dist/browser.esm.js.map +1 -1
- package/dist/browser.umd.js +44 -44
- package/dist/browser.umd.js.map +1 -1
- package/lib/Pagehead.d.ts +2 -1
- package/lib/Pagehead.js +1 -1
- package/lib/SideNav.d.ts +10 -8
- package/lib/SideNav.js +6 -15
- package/lib-esm/Pagehead.d.ts +2 -1
- package/lib-esm/Pagehead.js +2 -2
- package/lib-esm/SideNav.d.ts +10 -8
- package/lib-esm/SideNav.js +6 -16
- package/package.json +1 -1
package/lib/Pagehead.d.ts
CHANGED
@@ -1,5 +1,6 @@
|
|
1
|
+
import { SystemCommonProps } from './constants';
|
1
2
|
import { SxProp } from './sx';
|
2
3
|
import { ComponentProps } from './utils/types';
|
3
|
-
declare const Pagehead: import("styled-components").StyledComponent<"div", any, SxProp, never>;
|
4
|
+
declare const Pagehead: import("styled-components").StyledComponent<"div", any, SystemCommonProps & SxProp, never>;
|
4
5
|
export declare type PageheadProps = ComponentProps<typeof Pagehead>;
|
5
6
|
export default Pagehead;
|
package/lib/Pagehead.js
CHANGED
@@ -16,7 +16,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
16
16
|
const Pagehead = _styledComponents.default.div.withConfig({
|
17
17
|
displayName: "Pagehead",
|
18
18
|
componentId: "sc-1ntn78e-0"
|
19
|
-
})(["position:relative;padding-top:", ";padding-bottom:", ";margin-bottom:", ";border-bottom:1px solid ", ";", ";"], (0, _constants.get)('space.4'), (0, _constants.get)('space.4'), (0, _constants.get)('space.4'), (0, _constants.get)('colors.border.default'), _sx.default);
|
19
|
+
})(["position:relative;padding-top:", ";padding-bottom:", ";margin-bottom:", ";border-bottom:1px solid ", ";", ";", ";"], (0, _constants.get)('space.4'), (0, _constants.get)('space.4'), (0, _constants.get)('space.4'), (0, _constants.get)('colors.border.default'), _constants.COMMON, _sx.default);
|
20
20
|
|
21
21
|
var _default = Pagehead;
|
22
22
|
exports.default = _default;
|
package/lib/SideNav.d.ts
CHANGED
@@ -1,14 +1,16 @@
|
|
1
1
|
/// <reference types="hoist-non-react-statics" />
|
2
|
-
/// <reference types="react" />
|
3
2
|
import * as History from 'history';
|
4
|
-
import Box from './Box';
|
5
3
|
import { ComponentProps } from './utils/types';
|
4
|
+
import React from 'react';
|
5
|
+
import { SxProp } from './sx';
|
6
6
|
declare type SideNavBaseProps = {
|
7
7
|
variant?: 'lightweight' | 'normal';
|
8
8
|
bordered?: boolean;
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
className?: string;
|
10
|
+
children?: React.ReactNode;
|
11
|
+
};
|
12
|
+
declare function SideNavBase({ variant, className, bordered, children }: SideNavBaseProps): JSX.Element;
|
13
|
+
declare const SideNav: import("styled-components").StyledComponent<typeof SideNavBase, any, SxProp, never>;
|
12
14
|
declare type StyledSideNavLinkProps = {
|
13
15
|
to?: History.LocationDescriptor;
|
14
16
|
selected?: boolean;
|
@@ -18,14 +20,14 @@ declare const SideNavLink: import("styled-components").StyledComponent<"a", any,
|
|
18
20
|
hoverColor?: string | undefined;
|
19
21
|
muted?: boolean | undefined;
|
20
22
|
underline?: boolean | undefined;
|
21
|
-
} & import("./constants").SystemCommonProps &
|
23
|
+
} & import("./constants").SystemCommonProps & SxProp & import("./constants").SystemTypographyProps & StyledSideNavLinkProps, never>;
|
22
24
|
export declare type SideNavProps = ComponentProps<typeof SideNav>;
|
23
25
|
export declare type SideNavLinkProps = ComponentProps<typeof SideNavLink>;
|
24
|
-
declare const _default: string & import("styled-components").StyledComponentBase<typeof SideNavBase, any,
|
26
|
+
declare const _default: string & import("styled-components").StyledComponentBase<typeof SideNavBase, any, SxProp, never> & import("hoist-non-react-statics").NonReactStatics<typeof SideNavBase, {}> & {
|
25
27
|
Link: import("styled-components").StyledComponent<"a", any, {
|
26
28
|
hoverColor?: string | undefined;
|
27
29
|
muted?: boolean | undefined;
|
28
30
|
underline?: boolean | undefined;
|
29
|
-
} & import("./constants").SystemCommonProps &
|
31
|
+
} & import("./constants").SystemCommonProps & SxProp & import("./constants").SystemTypographyProps & StyledSideNavLinkProps, never>;
|
30
32
|
};
|
31
33
|
export default _default;
|
package/lib/SideNav.js
CHANGED
@@ -25,39 +25,30 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
25
25
|
|
26
26
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
27
27
|
|
28
|
-
|
29
|
-
|
28
|
+
// eslint-disable-next-line import/no-namespace
|
30
29
|
function SideNavBase({
|
31
30
|
variant,
|
32
31
|
className,
|
33
32
|
bordered,
|
34
|
-
children
|
35
|
-
...props
|
33
|
+
children
|
36
34
|
}) {
|
37
35
|
const variantClassName = variant === 'lightweight' ? 'lightweight' : 'normal';
|
38
36
|
const newClassName = (0, _classnames.default)(className, `variant-${variantClassName}`);
|
39
|
-
|
40
|
-
|
41
|
-
props = { ...props,
|
42
|
-
borderWidth: 0
|
43
|
-
};
|
44
|
-
}
|
45
|
-
|
46
|
-
return /*#__PURE__*/_react.default.createElement(_Box.default, _extends({
|
47
|
-
borderWidth: "1px",
|
37
|
+
return /*#__PURE__*/_react.default.createElement(_Box.default, {
|
38
|
+
borderWidth: bordered ? '1px' : 0,
|
48
39
|
borderStyle: "solid",
|
49
40
|
borderColor: "border.default",
|
50
41
|
borderRadius: 2,
|
51
42
|
as: "nav",
|
52
43
|
className: newClassName
|
53
|
-
},
|
44
|
+
}, children);
|
54
45
|
}
|
55
46
|
|
56
47
|
SideNavBase.displayName = "SideNavBase";
|
57
48
|
const SideNav = (0, _styledComponents.default)(SideNavBase).withConfig({
|
58
49
|
displayName: "SideNav",
|
59
50
|
componentId: "sc-15k667c-0"
|
60
|
-
})(["background-color:", ";", " ", ";"
|
51
|
+
})(["background-color:", ";", " ", ";"], (0, _constants.get)('colors.canvas.subtle'), props => props.bordered && (0, _styledComponents.css)(["& > &{border-left:0;border-right:0;border-bottom:0;}"]), _sx.default);
|
61
52
|
// used for variant normal hover, focus pseudo selectors
|
62
53
|
const CommonAccessibilityVariantNormalStyles = (0, _styledComponents.css)(["background-color:", ";outline:none;text-decoration:none;"], (0, _constants.get)('colors.neutral.subtle')); // used for light weight hover, focus pseudo selectors
|
63
54
|
|
package/lib-esm/Pagehead.d.ts
CHANGED
@@ -1,5 +1,6 @@
|
|
1
|
+
import { SystemCommonProps } from './constants';
|
1
2
|
import { SxProp } from './sx';
|
2
3
|
import { ComponentProps } from './utils/types';
|
3
|
-
declare const Pagehead: import("styled-components").StyledComponent<"div", any, SxProp, never>;
|
4
|
+
declare const Pagehead: import("styled-components").StyledComponent<"div", any, SystemCommonProps & SxProp, never>;
|
4
5
|
export declare type PageheadProps = ComponentProps<typeof Pagehead>;
|
5
6
|
export default Pagehead;
|
package/lib-esm/Pagehead.js
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
import styled from 'styled-components';
|
2
|
-
import { get } from './constants';
|
2
|
+
import { COMMON, get } from './constants';
|
3
3
|
import sx from './sx';
|
4
4
|
const Pagehead = styled.div.withConfig({
|
5
5
|
displayName: "Pagehead",
|
6
6
|
componentId: "sc-1ntn78e-0"
|
7
|
-
})(["position:relative;padding-top:", ";padding-bottom:", ";margin-bottom:", ";border-bottom:1px solid ", ";", ";"], get('space.4'), get('space.4'), get('space.4'), get('colors.border.default'), sx);
|
7
|
+
})(["position:relative;padding-top:", ";padding-bottom:", ";margin-bottom:", ";border-bottom:1px solid ", ";", ";", ";"], get('space.4'), get('space.4'), get('space.4'), get('colors.border.default'), COMMON, sx);
|
8
8
|
export default Pagehead;
|
package/lib-esm/SideNav.d.ts
CHANGED
@@ -1,14 +1,16 @@
|
|
1
1
|
/// <reference types="hoist-non-react-statics" />
|
2
|
-
/// <reference types="react" />
|
3
2
|
import * as History from 'history';
|
4
|
-
import Box from './Box';
|
5
3
|
import { ComponentProps } from './utils/types';
|
4
|
+
import React from 'react';
|
5
|
+
import { SxProp } from './sx';
|
6
6
|
declare type SideNavBaseProps = {
|
7
7
|
variant?: 'lightweight' | 'normal';
|
8
8
|
bordered?: boolean;
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
className?: string;
|
10
|
+
children?: React.ReactNode;
|
11
|
+
};
|
12
|
+
declare function SideNavBase({ variant, className, bordered, children }: SideNavBaseProps): JSX.Element;
|
13
|
+
declare const SideNav: import("styled-components").StyledComponent<typeof SideNavBase, any, SxProp, never>;
|
12
14
|
declare type StyledSideNavLinkProps = {
|
13
15
|
to?: History.LocationDescriptor;
|
14
16
|
selected?: boolean;
|
@@ -18,14 +20,14 @@ declare const SideNavLink: import("styled-components").StyledComponent<"a", any,
|
|
18
20
|
hoverColor?: string | undefined;
|
19
21
|
muted?: boolean | undefined;
|
20
22
|
underline?: boolean | undefined;
|
21
|
-
} & import("./constants").SystemCommonProps &
|
23
|
+
} & import("./constants").SystemCommonProps & SxProp & import("./constants").SystemTypographyProps & StyledSideNavLinkProps, never>;
|
22
24
|
export declare type SideNavProps = ComponentProps<typeof SideNav>;
|
23
25
|
export declare type SideNavLinkProps = ComponentProps<typeof SideNavLink>;
|
24
|
-
declare const _default: string & import("styled-components").StyledComponentBase<typeof SideNavBase, any,
|
26
|
+
declare const _default: string & import("styled-components").StyledComponentBase<typeof SideNavBase, any, SxProp, never> & import("hoist-non-react-statics").NonReactStatics<typeof SideNavBase, {}> & {
|
25
27
|
Link: import("styled-components").StyledComponent<"a", any, {
|
26
28
|
hoverColor?: string | undefined;
|
27
29
|
muted?: boolean | undefined;
|
28
30
|
underline?: boolean | undefined;
|
29
|
-
} & import("./constants").SystemCommonProps &
|
31
|
+
} & import("./constants").SystemCommonProps & SxProp & import("./constants").SystemTypographyProps & StyledSideNavLinkProps, never>;
|
30
32
|
};
|
31
33
|
export default _default;
|
package/lib-esm/SideNav.js
CHANGED
@@ -1,7 +1,5 @@
|
|
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
|
// eslint-disable-next-line import/no-namespace
|
4
|
-
import {
|
2
|
+
import { get } from './constants';
|
5
3
|
import styled, { css } from 'styled-components';
|
6
4
|
import Box from './Box';
|
7
5
|
import Link from './Link';
|
@@ -13,33 +11,25 @@ function SideNavBase({
|
|
13
11
|
variant,
|
14
12
|
className,
|
15
13
|
bordered,
|
16
|
-
children
|
17
|
-
...props
|
14
|
+
children
|
18
15
|
}) {
|
19
16
|
const variantClassName = variant === 'lightweight' ? 'lightweight' : 'normal';
|
20
17
|
const newClassName = classnames(className, `variant-${variantClassName}`);
|
21
|
-
|
22
|
-
|
23
|
-
props = { ...props,
|
24
|
-
borderWidth: 0
|
25
|
-
};
|
26
|
-
}
|
27
|
-
|
28
|
-
return /*#__PURE__*/React.createElement(Box, _extends({
|
29
|
-
borderWidth: "1px",
|
18
|
+
return /*#__PURE__*/React.createElement(Box, {
|
19
|
+
borderWidth: bordered ? '1px' : 0,
|
30
20
|
borderStyle: "solid",
|
31
21
|
borderColor: "border.default",
|
32
22
|
borderRadius: 2,
|
33
23
|
as: "nav",
|
34
24
|
className: newClassName
|
35
|
-
},
|
25
|
+
}, children);
|
36
26
|
}
|
37
27
|
|
38
28
|
SideNavBase.displayName = "SideNavBase";
|
39
29
|
const SideNav = styled(SideNavBase).withConfig({
|
40
30
|
displayName: "SideNav",
|
41
31
|
componentId: "sc-15k667c-0"
|
42
|
-
})(["background-color:", ";", " ", ";"
|
32
|
+
})(["background-color:", ";", " ", ";"], get('colors.canvas.subtle'), props => props.bordered && css(["& > &{border-left:0;border-right:0;border-bottom:0;}"]), sx);
|
43
33
|
// used for variant normal hover, focus pseudo selectors
|
44
34
|
const CommonAccessibilityVariantNormalStyles = css(["background-color:", ";outline:none;text-decoration:none;"], get('colors.neutral.subtle')); // used for light weight hover, focus pseudo selectors
|
45
35
|
|