@primer/components 0.0.0-2021103231153 → 0.0.0-2021103231920

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/lib/Label.d.ts CHANGED
@@ -1,10 +1,11 @@
1
1
  import { BorderColorProps } from 'styled-system';
2
+ import { SystemCommonProps } from './constants';
2
3
  import { SxProp } from './sx';
3
4
  import { ComponentProps } from './utils/types';
4
5
  declare const Label: import("styled-components").StyledComponent<"span", any, {
5
6
  variant?: "small" | "medium" | "large" | "xl" | undefined;
6
7
  dropshadow?: boolean | undefined;
7
8
  outline?: boolean | undefined;
8
- } & BorderColorProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>, string | number | symbol> & SxProp, never>;
9
+ } & BorderColorProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>, string | number | symbol> & SystemCommonProps & SxProp, never>;
9
10
  export declare type LabelProps = ComponentProps<typeof Label>;
10
11
  export default Label;
package/lib/Label.js CHANGED
@@ -19,7 +19,7 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
19
19
 
20
20
  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; }
21
21
 
22
- const outlineStyles = (0, _styledComponents.css)(["margin-top:-1px;margin-bottom:-1px;color:", ";border:", " solid ", ";box-shadow:none;", ";background-color:transparent;"], (0, _constants.get)('colors.fg.muted'), (0, _constants.get)('borderWidths.1'), (0, _constants.get)('colors.border.default'), _styledSystem.borderColor);
22
+ const outlineStyles = (0, _styledComponents.css)(["margin-top:-1px;margin-bottom:-1px;color:", ";border:", " solid ", ";box-shadow:none;", ";", ";background-color:transparent;"], (0, _constants.get)('colors.fg.muted'), (0, _constants.get)('borderWidths.1'), (0, _constants.get)('colors.border.default'), _styledSystem.borderColor, _constants.COMMON);
23
23
  const sizeVariant = (0, _styledSystem.variant)({
24
24
  variants: {
25
25
  small: {
@@ -49,9 +49,10 @@ const sizeVariant = (0, _styledSystem.variant)({
49
49
  const Label = _styledComponents.default.span.withConfig({
50
50
  displayName: "Label",
51
51
  componentId: "sc-1t3ykp0-0"
52
- })(["display:inline-block;font-weight:", ";color:", ";border-radius:", ";background-color:", ";&:hover{text-decoration:none;}", " ", " ", " ", ""], (0, _constants.get)('fontWeights.semibold'), (0, _constants.get)('colors.fg.onEmphasis'), (0, _constants.get)('radii.3'), (0, _constants.get)('colors.neutral.emphasis'), sizeVariant, props => props.dropshadow ? 'box-shadow: inset 0 -1px 0 rgba(27, 31, 35, 0.12)' : '', props => props.outline ? outlineStyles : '', _sx.default);
52
+ })(["display:inline-block;font-weight:", ";color:", ";border-radius:", ";&:hover{text-decoration:none;}", " ", " ", " ", " ", ""], (0, _constants.get)('fontWeights.semibold'), (0, _constants.get)('colors.fg.onEmphasis'), (0, _constants.get)('radii.3'), sizeVariant, _constants.COMMON, props => props.dropshadow ? 'box-shadow: inset 0 -1px 0 rgba(27, 31, 35, 0.12)' : '', props => props.outline ? outlineStyles : '', _sx.default);
53
53
 
54
54
  Label.defaultProps = {
55
+ bg: 'neutral.emphasis',
55
56
  variant: 'medium'
56
57
  };
57
58
  var _default = Label;
package/lib/Link.d.ts CHANGED
@@ -1,10 +1,9 @@
1
- import { SystemCommonProps, SystemTypographyProps } from './constants';
2
1
  import { SxProp } from './sx';
3
2
  import { ComponentProps } from './utils/types';
4
3
  declare const Link: import("styled-components").StyledComponent<"a", any, {
5
4
  hoverColor?: string | undefined;
6
5
  muted?: boolean | undefined;
7
6
  underline?: boolean | undefined;
8
- } & SystemCommonProps & SxProp & SystemTypographyProps, never>;
7
+ } & SxProp, never>;
9
8
  export declare type LinkProps = ComponentProps<typeof Link>;
10
9
  export default Link;
package/lib/Link.js CHANGED
@@ -25,7 +25,7 @@ const hoverColor = (0, _styledSystem.system)({
25
25
  const Link = _styledComponents.default.a.withConfig({
26
26
  displayName: "Link",
27
27
  componentId: "sc-1brdqhf-0"
28
- })(["color:", ";text-decoration:", ";&:hover{text-decoration:", ";", ";}&:is(button){display:inline-block;padding:0;font-size:inherit;white-space:nowrap;cursor:pointer;user-select:none;background-color:transparent;border:0;appearance:none;}", ";", ";", ";"], props => props.muted ? (0, _constants.get)('colors.fg.muted')(props) : (0, _constants.get)('colors.accent.fg')(props), props => props.underline ? 'underline' : 'none', props => props.muted ? 'none' : 'underline', props => props.hoverColor ? hoverColor : props.muted ? `color: ${(0, _constants.get)('colors.accent.fg')(props)}` : '', _constants.TYPOGRAPHY, _constants.COMMON, _sx.default);
28
+ })(["color:", ";text-decoration:", ";&:hover{text-decoration:", ";", ";}&:is(button){display:inline-block;padding:0;font-size:inherit;white-space:nowrap;cursor:pointer;user-select:none;background-color:transparent;border:0;appearance:none;}", ";"], props => props.muted ? (0, _constants.get)('colors.fg.muted')(props) : (0, _constants.get)('colors.accent.fg')(props), props => props.underline ? 'underline' : 'none', props => props.muted ? 'none' : 'underline', props => props.hoverColor ? hoverColor : props.muted ? `color: ${(0, _constants.get)('colors.accent.fg')(props)}` : '', _sx.default);
29
29
 
30
30
  var _default = Link;
31
31
  exports.default = _default;
package/lib/SideNav.d.ts CHANGED
@@ -18,7 +18,7 @@ declare const SideNavLink: import("styled-components").StyledComponent<"a", any,
18
18
  hoverColor?: string | undefined;
19
19
  muted?: boolean | undefined;
20
20
  underline?: boolean | undefined;
21
- } & import("./constants").SystemCommonProps & import("./sx").SxProp & import("./constants").SystemTypographyProps & StyledSideNavLinkProps, never>;
21
+ } & import("./sx").SxProp & StyledSideNavLinkProps, never>;
22
22
  export declare type SideNavProps = ComponentProps<typeof SideNav>;
23
23
  export declare type SideNavLinkProps = ComponentProps<typeof SideNavLink>;
24
24
  declare const _default: string & import("styled-components").StyledComponentBase<typeof SideNavBase, any, {}, never> & import("hoist-non-react-statics").NonReactStatics<typeof SideNavBase, {}> & {
@@ -26,6 +26,6 @@ declare const _default: string & import("styled-components").StyledComponentBase
26
26
  hoverColor?: string | undefined;
27
27
  muted?: boolean | undefined;
28
28
  underline?: boolean | undefined;
29
- } & import("./constants").SystemCommonProps & import("./sx").SxProp & import("./constants").SystemTypographyProps & StyledSideNavLinkProps, never>;
29
+ } & import("./sx").SxProp & StyledSideNavLinkProps, never>;
30
30
  };
31
31
  export default _default;
@@ -1,10 +1,11 @@
1
1
  import { BorderColorProps } from 'styled-system';
2
+ import { SystemCommonProps } from './constants';
2
3
  import { SxProp } from './sx';
3
4
  import { ComponentProps } from './utils/types';
4
5
  declare const Label: import("styled-components").StyledComponent<"span", any, {
5
6
  variant?: "small" | "medium" | "large" | "xl" | undefined;
6
7
  dropshadow?: boolean | undefined;
7
8
  outline?: boolean | undefined;
8
- } & BorderColorProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>, string | number | symbol> & SxProp, never>;
9
+ } & BorderColorProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>, string | number | symbol> & SystemCommonProps & SxProp, never>;
9
10
  export declare type LabelProps = ComponentProps<typeof Label>;
10
11
  export default Label;
package/lib-esm/Label.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import styled, { css } from 'styled-components';
2
2
  import { borderColor, variant } from 'styled-system';
3
- import { get } from './constants';
3
+ import { COMMON, get } from './constants';
4
4
  import sx from './sx';
5
- const outlineStyles = css(["margin-top:-1px;margin-bottom:-1px;color:", ";border:", " solid ", ";box-shadow:none;", ";background-color:transparent;"], get('colors.fg.muted'), get('borderWidths.1'), get('colors.border.default'), borderColor);
5
+ const outlineStyles = css(["margin-top:-1px;margin-bottom:-1px;color:", ";border:", " solid ", ";box-shadow:none;", ";", ";background-color:transparent;"], get('colors.fg.muted'), get('borderWidths.1'), get('colors.border.default'), borderColor, COMMON);
6
6
  const sizeVariant = variant({
7
7
  variants: {
8
8
  small: {
@@ -31,8 +31,9 @@ const sizeVariant = variant({
31
31
  const Label = styled.span.withConfig({
32
32
  displayName: "Label",
33
33
  componentId: "sc-1t3ykp0-0"
34
- })(["display:inline-block;font-weight:", ";color:", ";border-radius:", ";background-color:", ";&:hover{text-decoration:none;}", " ", " ", " ", ""], get('fontWeights.semibold'), get('colors.fg.onEmphasis'), get('radii.3'), get('colors.neutral.emphasis'), sizeVariant, props => props.dropshadow ? 'box-shadow: inset 0 -1px 0 rgba(27, 31, 35, 0.12)' : '', props => props.outline ? outlineStyles : '', sx);
34
+ })(["display:inline-block;font-weight:", ";color:", ";border-radius:", ";&:hover{text-decoration:none;}", " ", " ", " ", " ", ""], get('fontWeights.semibold'), get('colors.fg.onEmphasis'), get('radii.3'), sizeVariant, COMMON, props => props.dropshadow ? 'box-shadow: inset 0 -1px 0 rgba(27, 31, 35, 0.12)' : '', props => props.outline ? outlineStyles : '', sx);
35
35
  Label.defaultProps = {
36
+ bg: 'neutral.emphasis',
36
37
  variant: 'medium'
37
38
  };
38
39
  export default Label;
package/lib-esm/Link.d.ts CHANGED
@@ -1,10 +1,9 @@
1
- import { SystemCommonProps, SystemTypographyProps } from './constants';
2
1
  import { SxProp } from './sx';
3
2
  import { ComponentProps } from './utils/types';
4
3
  declare const Link: import("styled-components").StyledComponent<"a", any, {
5
4
  hoverColor?: string | undefined;
6
5
  muted?: boolean | undefined;
7
6
  underline?: boolean | undefined;
8
- } & SystemCommonProps & SxProp & SystemTypographyProps, never>;
7
+ } & SxProp, never>;
9
8
  export declare type LinkProps = ComponentProps<typeof Link>;
10
9
  export default Link;
package/lib-esm/Link.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import styled from 'styled-components';
2
2
  import { system } from 'styled-system';
3
- import { COMMON, get, TYPOGRAPHY } from './constants';
3
+ import { get } from './constants';
4
4
  import sx from './sx';
5
5
  const hoverColor = system({
6
6
  hoverColor: {
@@ -11,5 +11,5 @@ const hoverColor = system({
11
11
  const Link = styled.a.withConfig({
12
12
  displayName: "Link",
13
13
  componentId: "sc-1brdqhf-0"
14
- })(["color:", ";text-decoration:", ";&:hover{text-decoration:", ";", ";}&:is(button){display:inline-block;padding:0;font-size:inherit;white-space:nowrap;cursor:pointer;user-select:none;background-color:transparent;border:0;appearance:none;}", ";", ";", ";"], props => props.muted ? get('colors.fg.muted')(props) : get('colors.accent.fg')(props), props => props.underline ? 'underline' : 'none', props => props.muted ? 'none' : 'underline', props => props.hoverColor ? hoverColor : props.muted ? `color: ${get('colors.accent.fg')(props)}` : '', TYPOGRAPHY, COMMON, sx);
14
+ })(["color:", ";text-decoration:", ";&:hover{text-decoration:", ";", ";}&:is(button){display:inline-block;padding:0;font-size:inherit;white-space:nowrap;cursor:pointer;user-select:none;background-color:transparent;border:0;appearance:none;}", ";"], props => props.muted ? get('colors.fg.muted')(props) : get('colors.accent.fg')(props), props => props.underline ? 'underline' : 'none', props => props.muted ? 'none' : 'underline', props => props.hoverColor ? hoverColor : props.muted ? `color: ${get('colors.accent.fg')(props)}` : '', sx);
15
15
  export default Link;
@@ -18,7 +18,7 @@ declare const SideNavLink: import("styled-components").StyledComponent<"a", any,
18
18
  hoverColor?: string | undefined;
19
19
  muted?: boolean | undefined;
20
20
  underline?: boolean | undefined;
21
- } & import("./constants").SystemCommonProps & import("./sx").SxProp & import("./constants").SystemTypographyProps & StyledSideNavLinkProps, never>;
21
+ } & import("./sx").SxProp & StyledSideNavLinkProps, never>;
22
22
  export declare type SideNavProps = ComponentProps<typeof SideNav>;
23
23
  export declare type SideNavLinkProps = ComponentProps<typeof SideNavLink>;
24
24
  declare const _default: string & import("styled-components").StyledComponentBase<typeof SideNavBase, any, {}, never> & import("hoist-non-react-statics").NonReactStatics<typeof SideNavBase, {}> & {
@@ -26,6 +26,6 @@ declare const _default: string & import("styled-components").StyledComponentBase
26
26
  hoverColor?: string | undefined;
27
27
  muted?: boolean | undefined;
28
28
  underline?: boolean | undefined;
29
- } & import("./constants").SystemCommonProps & import("./sx").SxProp & import("./constants").SystemTypographyProps & StyledSideNavLinkProps, never>;
29
+ } & import("./sx").SxProp & StyledSideNavLinkProps, never>;
30
30
  };
31
31
  export default _default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@primer/components",
3
- "version": "0.0.0-2021103231153",
3
+ "version": "0.0.0-2021103231920",
4
4
  "description": "Primer react components",
5
5
  "main": "lib/index.js",
6
6
  "module": "lib-esm/index.js",