@primer/components 0.0.0-202110322927 → 0.0.0-202110323331
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 +5 -4
- package/dist/browser.esm.js.map +1 -1
- package/dist/browser.umd.js +47 -46
- package/dist/browser.umd.js.map +1 -1
- package/lib/FilterList.d.ts +264 -303
- package/lib/FilterList.js +2 -6
- package/lib/SideNav.d.ts +8 -10
- package/lib/SideNav.js +15 -6
- package/lib-esm/FilterList.d.ts +264 -303
- package/lib-esm/FilterList.js +3 -7
- package/lib-esm/SideNav.d.ts +8 -10
- package/lib-esm/SideNav.js +16 -6
- package/package.json +1 -1
package/lib/FilterList.js
CHANGED
@@ -18,7 +18,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
18
18
|
const FilterListBase = _styledComponents.default.ul.withConfig({
|
19
19
|
displayName: "FilterList__FilterListBase",
|
20
20
|
componentId: "sc-1l4pxmz-0"
|
21
|
-
})(["list-style-type:none;
|
21
|
+
})(["list-style-type:none;margin:0;padding:0;", ";"], _sx.default);
|
22
22
|
|
23
23
|
const FilterList = ({
|
24
24
|
children,
|
@@ -36,7 +36,7 @@ FilterList.displayName = "FilterList";
|
|
36
36
|
const FilterListItemBase = _styledComponents.default.a.withConfig({
|
37
37
|
displayName: "FilterList__FilterListItemBase",
|
38
38
|
componentId: "sc-1l4pxmz-1"
|
39
|
-
})(["position:relative;display:block;padding:", ";margin:", ";overflow:hidden;font-size:", ";color:", ";background-color:", "!important;text-decoration:none;text-overflow:ellipsis;white-space:nowrap;cursor:pointer;border-radius:", ";&:hover{text-decoration:none;background-color:", ";}&:active{color:", ";background-color:", ";}.count{float:right;font-weight:", ";}", ";"
|
39
|
+
})(["position:relative;display:block;padding:", ";margin:", ";overflow:hidden;font-size:", ";color:", ";background-color:", "!important;text-decoration:none;text-overflow:ellipsis;white-space:nowrap;cursor:pointer;border-radius:", ";&:hover{text-decoration:none;background-color:", ";}&:active{color:", ";background-color:", ";}.count{float:right;font-weight:", ";}", ";"], props => props.small ? `${(0, _constants.get)('space.1')(props)} 10px` : `${(0, _constants.get)('space.2')(props)} 11px`, props => props.small ? '0 0 2px' : '0 0 5px 0', (0, _constants.get)('fontSizes.1'), props => props.selected ? (0, _constants.get)('colors.fg.onEmphasis') : (0, _constants.get)('colors.fg.muted'), props => props.selected ? (0, _constants.get)('colors.accent.emphasis') : '', (0, _constants.get)('radii.1'), (0, _constants.get)('colors.canvas.subtle'), (0, _constants.get)('colors.fg.onEmphasis'), (0, _constants.get)('colors.accent.emphasis'), (0, _constants.get)('fontWeights.bold'), _sx.default);
|
40
40
|
|
41
41
|
function FilterListItem({
|
42
42
|
children,
|
@@ -50,10 +50,6 @@ function FilterListItem({
|
|
50
50
|
}
|
51
51
|
|
52
52
|
FilterListItem.displayName = "FilterListItem";
|
53
|
-
FilterList.defaultProps = {
|
54
|
-
m: 0,
|
55
|
-
p: 0
|
56
|
-
};
|
57
53
|
FilterListItem.displayName = 'FilterList.Item';
|
58
54
|
|
59
55
|
var _default = Object.assign(FilterList, {
|
package/lib/SideNav.d.ts
CHANGED
@@ -1,16 +1,14 @@
|
|
1
1
|
/// <reference types="hoist-non-react-statics" />
|
2
|
+
/// <reference types="react" />
|
2
3
|
import * as History from 'history';
|
4
|
+
import Box from './Box';
|
3
5
|
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
|
-
}
|
12
|
-
declare function SideNavBase({ variant, className, bordered, children }: SideNavBaseProps): JSX.Element;
|
13
|
-
declare const SideNav: import("styled-components").StyledComponent<typeof SideNavBase, any, SxProp, never>;
|
9
|
+
} & ComponentProps<typeof Box>;
|
10
|
+
declare function SideNavBase({ variant, className, bordered, children, ...props }: SideNavBaseProps): JSX.Element;
|
11
|
+
declare const SideNav: import("styled-components").StyledComponent<typeof SideNavBase, any, {}, never>;
|
14
12
|
declare type StyledSideNavLinkProps = {
|
15
13
|
to?: History.LocationDescriptor;
|
16
14
|
selected?: boolean;
|
@@ -20,14 +18,14 @@ declare const SideNavLink: import("styled-components").StyledComponent<"a", any,
|
|
20
18
|
hoverColor?: string | undefined;
|
21
19
|
muted?: boolean | undefined;
|
22
20
|
underline?: boolean | undefined;
|
23
|
-
} & import("./constants").SystemCommonProps & SxProp & import("./constants").SystemTypographyProps & StyledSideNavLinkProps, never>;
|
21
|
+
} & import("./constants").SystemCommonProps & import("./sx").SxProp & import("./constants").SystemTypographyProps & StyledSideNavLinkProps, never>;
|
24
22
|
export declare type SideNavProps = ComponentProps<typeof SideNav>;
|
25
23
|
export declare type SideNavLinkProps = ComponentProps<typeof SideNavLink>;
|
26
|
-
declare const _default: string & import("styled-components").StyledComponentBase<typeof SideNavBase, any,
|
24
|
+
declare const _default: string & import("styled-components").StyledComponentBase<typeof SideNavBase, any, {}, never> & import("hoist-non-react-statics").NonReactStatics<typeof SideNavBase, {}> & {
|
27
25
|
Link: import("styled-components").StyledComponent<"a", any, {
|
28
26
|
hoverColor?: string | undefined;
|
29
27
|
muted?: boolean | undefined;
|
30
28
|
underline?: boolean | undefined;
|
31
|
-
} & import("./constants").SystemCommonProps & SxProp & import("./constants").SystemTypographyProps & StyledSideNavLinkProps, never>;
|
29
|
+
} & import("./constants").SystemCommonProps & import("./sx").SxProp & import("./constants").SystemTypographyProps & StyledSideNavLinkProps, never>;
|
32
30
|
};
|
33
31
|
export default _default;
|
package/lib/SideNav.js
CHANGED
@@ -25,30 +25,39 @@ 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
|
-
|
28
|
+
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); }
|
29
|
+
|
29
30
|
function SideNavBase({
|
30
31
|
variant,
|
31
32
|
className,
|
32
33
|
bordered,
|
33
|
-
children
|
34
|
+
children,
|
35
|
+
...props
|
34
36
|
}) {
|
35
37
|
const variantClassName = variant === 'lightweight' ? 'lightweight' : 'normal';
|
36
38
|
const newClassName = (0, _classnames.default)(className, `variant-${variantClassName}`);
|
37
|
-
|
38
|
-
|
39
|
+
|
40
|
+
if (!bordered) {
|
41
|
+
props = { ...props,
|
42
|
+
borderWidth: 0
|
43
|
+
};
|
44
|
+
}
|
45
|
+
|
46
|
+
return /*#__PURE__*/_react.default.createElement(_Box.default, _extends({
|
47
|
+
borderWidth: "1px",
|
39
48
|
borderStyle: "solid",
|
40
49
|
borderColor: "border.default",
|
41
50
|
borderRadius: 2,
|
42
51
|
as: "nav",
|
43
52
|
className: newClassName
|
44
|
-
}, children);
|
53
|
+
}, props), children);
|
45
54
|
}
|
46
55
|
|
47
56
|
SideNavBase.displayName = "SideNavBase";
|
48
57
|
const SideNav = (0, _styledComponents.default)(SideNavBase).withConfig({
|
49
58
|
displayName: "SideNav",
|
50
59
|
componentId: "sc-15k667c-0"
|
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);
|
60
|
+
})(["background-color:", ";", " ", ";", ";"], (0, _constants.get)('colors.canvas.subtle'), props => props.bordered && (0, _styledComponents.css)(["& > &{border-left:0;border-right:0;border-bottom:0;}"]), _constants.COMMON, _sx.default);
|
52
61
|
// used for variant normal hover, focus pseudo selectors
|
53
62
|
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
|
54
63
|
|