@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.
@@ -1,11 +1,11 @@
1
1
  import React from 'react';
2
2
  import styled from 'styled-components';
3
- import { COMMON, get } from './constants';
3
+ import { get } from './constants';
4
4
  import sx from './sx';
5
5
  const FilterListBase = styled.ul.withConfig({
6
6
  displayName: "FilterList__FilterListBase",
7
7
  componentId: "sc-1l4pxmz-0"
8
- })(["list-style-type:none;", ";", ";"], COMMON, sx);
8
+ })(["list-style-type:none;margin:0;padding:0;", ";"], sx);
9
9
 
10
10
  const FilterList = ({
11
11
  children,
@@ -21,7 +21,7 @@ FilterList.displayName = "FilterList";
21
21
  const FilterListItemBase = styled.a.withConfig({
22
22
  displayName: "FilterList__FilterListItemBase",
23
23
  componentId: "sc-1l4pxmz-1"
24
- })(["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 ? `${get('space.1')(props)} 10px` : `${get('space.2')(props)} 11px`, props => props.small ? '0 0 2px' : '0 0 5px 0', get('fontSizes.1'), props => props.selected ? get('colors.fg.onEmphasis') : get('colors.fg.muted'), props => props.selected ? get('colors.accent.emphasis') : '', get('radii.1'), get('colors.canvas.subtle'), get('colors.fg.onEmphasis'), get('colors.accent.emphasis'), get('fontWeights.bold'), COMMON, sx);
24
+ })(["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 ? `${get('space.1')(props)} 10px` : `${get('space.2')(props)} 11px`, props => props.small ? '0 0 2px' : '0 0 5px 0', get('fontSizes.1'), props => props.selected ? get('colors.fg.onEmphasis') : get('colors.fg.muted'), props => props.selected ? get('colors.accent.emphasis') : '', get('radii.1'), get('colors.canvas.subtle'), get('colors.fg.onEmphasis'), get('colors.accent.emphasis'), get('fontWeights.bold'), sx);
25
25
 
26
26
  function FilterListItem({
27
27
  children,
@@ -35,10 +35,6 @@ function FilterListItem({
35
35
  }
36
36
 
37
37
  FilterListItem.displayName = "FilterListItem";
38
- FilterList.defaultProps = {
39
- m: 0,
40
- p: 0
41
- };
42
38
  FilterListItem.displayName = 'FilterList.Item';
43
39
  export default Object.assign(FilterList, {
44
40
  Item: FilterListItem
@@ -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
- 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>;
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, SxProp, never> & import("hoist-non-react-statics").NonReactStatics<typeof SideNavBase, {}> & {
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;
@@ -1,5 +1,7 @@
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
+
1
3
  // eslint-disable-next-line import/no-namespace
2
- import { get } from './constants';
4
+ import { COMMON, get } from './constants';
3
5
  import styled, { css } from 'styled-components';
4
6
  import Box from './Box';
5
7
  import Link from './Link';
@@ -11,25 +13,33 @@ function SideNavBase({
11
13
  variant,
12
14
  className,
13
15
  bordered,
14
- children
16
+ children,
17
+ ...props
15
18
  }) {
16
19
  const variantClassName = variant === 'lightweight' ? 'lightweight' : 'normal';
17
20
  const newClassName = classnames(className, `variant-${variantClassName}`);
18
- return /*#__PURE__*/React.createElement(Box, {
19
- borderWidth: bordered ? '1px' : 0,
21
+
22
+ if (!bordered) {
23
+ props = { ...props,
24
+ borderWidth: 0
25
+ };
26
+ }
27
+
28
+ return /*#__PURE__*/React.createElement(Box, _extends({
29
+ borderWidth: "1px",
20
30
  borderStyle: "solid",
21
31
  borderColor: "border.default",
22
32
  borderRadius: 2,
23
33
  as: "nav",
24
34
  className: newClassName
25
- }, children);
35
+ }, props), children);
26
36
  }
27
37
 
28
38
  SideNavBase.displayName = "SideNavBase";
29
39
  const SideNav = styled(SideNavBase).withConfig({
30
40
  displayName: "SideNav",
31
41
  componentId: "sc-15k667c-0"
32
- })(["background-color:", ";", " ", ";"], get('colors.canvas.subtle'), props => props.bordered && css(["& > &{border-left:0;border-right:0;border-bottom:0;}"]), sx);
42
+ })(["background-color:", ";", " ", ";", ";"], get('colors.canvas.subtle'), props => props.bordered && css(["& > &{border-left:0;border-right:0;border-bottom:0;}"]), COMMON, sx);
33
43
  // used for variant normal hover, focus pseudo selectors
34
44
  const CommonAccessibilityVariantNormalStyles = css(["background-color:", ";outline:none;text-decoration:none;"], get('colors.neutral.subtle')); // used for light weight hover, focus pseudo selectors
35
45
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@primer/components",
3
- "version": "0.0.0-202110322927",
3
+ "version": "0.0.0-202110323331",
4
4
  "description": "Primer react components",
5
5
  "main": "lib/index.js",
6
6
  "module": "lib-esm/index.js",