@primer/components 0.0.0-2021103221942 → 0.0.0-2021103224544

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/SubNav.d.ts CHANGED
@@ -1,8 +1,10 @@
1
1
  import * as History from 'history';
2
2
  import React from 'react';
3
+ import { SystemBorderProps, SystemCommonProps, SystemFlexProps } from './constants';
4
+ import { BoxProps } from './Box';
3
5
  import { SxProp } from './sx';
4
6
  import { ComponentProps } from './utils/types';
5
- declare const SubNavBase: import("styled-components").StyledComponent<"nav", any, SxProp, never>;
7
+ declare const SubNavBase: import("styled-components").StyledComponent<"nav", any, SystemFlexProps & SystemCommonProps & SxProp, never>;
6
8
  export declare type SubNavProps = {
7
9
  actions?: React.ReactNode;
8
10
  align?: 'right';
@@ -10,17 +12,21 @@ export declare type SubNavProps = {
10
12
  label?: string;
11
13
  } & ComponentProps<typeof SubNavBase>;
12
14
  declare function SubNav({ actions, className, children, label, ...rest }: SubNavProps): JSX.Element;
13
- export declare type SubNavLinksProps = SxProp;
15
+ export declare type SubNavLinksProps = BoxProps;
16
+ declare function SubNavLinks(props: SubNavLinksProps): JSX.Element;
17
+ declare namespace SubNavLinks {
18
+ var displayName: string;
19
+ }
14
20
  declare const SubNavLink: import("styled-components").StyledComponent<"a", any, {
15
21
  to?: History.LocationDescriptor<unknown> | undefined;
16
22
  selected?: boolean | undefined;
17
- } & SxProp, never>;
23
+ } & SystemCommonProps & SxProp & SystemBorderProps, never>;
18
24
  export declare type SubNavLinkProps = ComponentProps<typeof SubNavLink>;
19
25
  declare const _default: typeof SubNav & {
20
26
  Link: import("styled-components").StyledComponent<"a", any, {
21
27
  to?: History.LocationDescriptor<unknown> | undefined;
22
28
  selected?: boolean | undefined;
23
- } & SxProp, never>;
24
- Links: import("styled-components").StyledComponent<"div", any, SxProp, never>;
29
+ } & SystemCommonProps & SxProp & SystemBorderProps, never>;
30
+ Links: typeof SubNavLinks;
25
31
  };
26
32
  export default _default;
package/lib/SubNav.js CHANGED
@@ -13,6 +13,8 @@ var _styledComponents = _interopRequireDefault(require("styled-components"));
13
13
 
14
14
  var _constants = require("./constants");
15
15
 
16
+ var _Box = _interopRequireDefault(require("./Box"));
17
+
16
18
  var _sx = _interopRequireDefault(require("./sx"));
17
19
 
18
20
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
@@ -25,7 +27,7 @@ const SELECTED_CLASS = 'selected';
25
27
  const SubNavBase = _styledComponents.default.nav.withConfig({
26
28
  displayName: "SubNav__SubNavBase",
27
29
  componentId: "f7w0xa-0"
28
- })(["display:flex;justify-content:space-between;.SubNav-body{display:flex;margin-bottom:-1px;> *{margin-left:", ";}> *:first-child{margin-left:0;}}.SubNav-actions{align-self:center;}", ";"], (0, _constants.get)('space.2'), _sx.default);
30
+ })(["display:flex;justify-content:space-between;.SubNav-body{display:flex;margin-bottom:-1px;> *{margin-left:", ";}> *:first-child{margin-left:0;}}.SubNav-actions{align-self:center;}", ";", ";", ";"], (0, _constants.get)('space.2'), _constants.COMMON, _constants.FLEX, _sx.default);
29
31
 
30
32
  function SubNav({
31
33
  actions,
@@ -47,18 +49,21 @@ function SubNav({
47
49
 
48
50
  SubNav.displayName = "SubNav";
49
51
 
50
- const SubNavLinks = _styledComponents.default.div.withConfig({
51
- displayName: "SubNav__SubNavLinks",
52
- componentId: "f7w0xa-1"
53
- })(["display:flex;", ";"], _sx.default);
52
+ function SubNavLinks(props) {
53
+ return /*#__PURE__*/_react.default.createElement(_Box.default, _extends({
54
+ display: "flex"
55
+ }, props));
56
+ }
57
+
58
+ SubNavLinks.displayName = "SubNavLinks";
54
59
 
55
60
  const SubNavLink = _styledComponents.default.a.attrs(props => ({
56
61
  activeClassName: typeof props.to === 'string' ? 'selected' : '',
57
62
  className: (0, _classnames.default)(ITEM_CLASS, props.selected && SELECTED_CLASS, props.className)
58
63
  })).withConfig({
59
64
  displayName: "SubNav__SubNavLink",
60
- componentId: "f7w0xa-2"
61
- })(["padding-left:", ";padding-right:", ";font-weight:", ";font-size:", ";line-height:20px;min-height:34px;color:", ";text-align:center;text-decoration:none;border-top:1px solid ", ";border-bottom:1px solid ", ";border-right:1px solid ", ";display:flex;align-items:center;&:first-of-type{border-top-left-radius:", ";border-bottom-left-radius:", ";border-left:1px solid ", ";}&:last-of-type{border-top-right-radius:", ";border-bottom-right-radius:", ";}&:hover,&:focus{text-decoration:none;background-color:", ";transition:0.2s ease;.SubNav-octicon{color:", ";}}&.selected{color:", ";background-color:", ";border-color:", ";.SubNav-octicon{color:", ";}}", ";"], (0, _constants.get)('space.3'), (0, _constants.get)('space.3'), (0, _constants.get)('fontWeights.semibold'), (0, _constants.get)('fontSizes.1'), (0, _constants.get)('colors.fg.default'), (0, _constants.get)('colors.border.default'), (0, _constants.get)('colors.border.default'), (0, _constants.get)('colors.border.default'), (0, _constants.get)('radii.2'), (0, _constants.get)('radii.2'), (0, _constants.get)('colors.border.default'), (0, _constants.get)('radii.2'), (0, _constants.get)('radii.2'), (0, _constants.get)('colors.canvas.subtle'), (0, _constants.get)('colors.fg.muted'), (0, _constants.get)('colors.fg.onEmphasis'), (0, _constants.get)('colors.accent.emphasis'), (0, _constants.get)('colors.accent.emphasis'), (0, _constants.get)('colors.fg.onEmphasis'), _sx.default);
65
+ componentId: "f7w0xa-1"
66
+ })(["padding-left:", ";padding-right:", ";font-weight:", ";font-size:", ";line-height:20px;min-height:34px;color:", ";text-align:center;text-decoration:none;border-top:1px solid ", ";border-bottom:1px solid ", ";border-right:1px solid ", ";display:flex;align-items:center;&:first-of-type{border-top-left-radius:", ";border-bottom-left-radius:", ";border-left:1px solid ", ";}&:last-of-type{border-top-right-radius:", ";border-bottom-right-radius:", ";}&:hover,&:focus{text-decoration:none;background-color:", ";transition:0.2s ease;.SubNav-octicon{color:", ";}}&.selected{color:", ";background-color:", ";border-color:", ";.SubNav-octicon{color:", ";}}", ";", ";"], (0, _constants.get)('space.3'), (0, _constants.get)('space.3'), (0, _constants.get)('fontWeights.semibold'), (0, _constants.get)('fontSizes.1'), (0, _constants.get)('colors.fg.default'), (0, _constants.get)('colors.border.default'), (0, _constants.get)('colors.border.default'), (0, _constants.get)('colors.border.default'), (0, _constants.get)('radii.2'), (0, _constants.get)('radii.2'), (0, _constants.get)('colors.border.default'), (0, _constants.get)('radii.2'), (0, _constants.get)('radii.2'), (0, _constants.get)('colors.canvas.subtle'), (0, _constants.get)('colors.fg.muted'), (0, _constants.get)('colors.fg.onEmphasis'), (0, _constants.get)('colors.accent.emphasis'), (0, _constants.get)('colors.accent.emphasis'), (0, _constants.get)('colors.fg.onEmphasis'), _constants.COMMON, _sx.default);
62
67
 
63
68
  SubNavLink.displayName = 'SubNav.Link';
64
69
  SubNavLinks.displayName = 'SubNav.Links';
package/lib/Truncate.d.ts CHANGED
@@ -1,11 +1,10 @@
1
1
  import { MaxWidthProps } from 'styled-system';
2
- import { SystemCommonProps, SystemTypographyProps } from './constants';
3
2
  import { SxProp } from './sx';
4
3
  import { ComponentProps } from './utils/types';
5
4
  declare const Truncate: import("styled-components").StyledComponent<"div", any, {
6
5
  title: string;
7
6
  inline?: boolean | undefined;
8
7
  expandable?: boolean | undefined;
9
- } & MaxWidthProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>, import("csstype").Property.MaxWidth<import("styled-system").TLengthStyledSystem>> & SystemTypographyProps & SystemCommonProps & SxProp, never>;
8
+ } & MaxWidthProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>, import("csstype").Property.MaxWidth<import("styled-system").TLengthStyledSystem>> & SxProp, never>;
10
9
  export declare type TruncateProps = ComponentProps<typeof Truncate>;
11
10
  export default Truncate;
package/lib/Truncate.js CHANGED
@@ -9,8 +9,6 @@ var _styledComponents = _interopRequireDefault(require("styled-components"));
9
9
 
10
10
  var _styledSystem = require("styled-system");
11
11
 
12
- var _constants = require("./constants");
13
-
14
12
  var _sx = _interopRequireDefault(require("./sx"));
15
13
 
16
14
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
@@ -18,7 +16,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
18
16
  const Truncate = _styledComponents.default.div.withConfig({
19
17
  displayName: "Truncate",
20
18
  componentId: "sc-1074h1l-0"
21
- })(["", " ", " display:", ";overflow:hidden;text-overflow:ellipsis;vertical-align:", ";white-space:nowrap;", " ", " ", ";"], _constants.TYPOGRAPHY, _constants.COMMON, props => props.inline ? 'inline-block' : 'inherit', props => props.inline ? 'top' : 'initial', _styledSystem.maxWidth, props => props.expandable ? `&:hover { max-width: 10000px; }` : '', _sx.default);
19
+ })(["display:", ";overflow:hidden;text-overflow:ellipsis;vertical-align:", ";white-space:nowrap;", " ", " ", ";"], props => props.inline ? 'inline-block' : 'inherit', props => props.inline ? 'top' : 'initial', _styledSystem.maxWidth, props => props.expandable ? `&:hover { max-width: 10000px; }` : '', _sx.default);
22
20
 
23
21
  Truncate.defaultProps = {
24
22
  expandable: false,
@@ -1,8 +1,10 @@
1
1
  import * as History from 'history';
2
2
  import React from 'react';
3
+ import { SystemBorderProps, SystemCommonProps, SystemFlexProps } from './constants';
4
+ import { BoxProps } from './Box';
3
5
  import { SxProp } from './sx';
4
6
  import { ComponentProps } from './utils/types';
5
- declare const SubNavBase: import("styled-components").StyledComponent<"nav", any, SxProp, never>;
7
+ declare const SubNavBase: import("styled-components").StyledComponent<"nav", any, SystemFlexProps & SystemCommonProps & SxProp, never>;
6
8
  export declare type SubNavProps = {
7
9
  actions?: React.ReactNode;
8
10
  align?: 'right';
@@ -10,17 +12,21 @@ export declare type SubNavProps = {
10
12
  label?: string;
11
13
  } & ComponentProps<typeof SubNavBase>;
12
14
  declare function SubNav({ actions, className, children, label, ...rest }: SubNavProps): JSX.Element;
13
- export declare type SubNavLinksProps = SxProp;
15
+ export declare type SubNavLinksProps = BoxProps;
16
+ declare function SubNavLinks(props: SubNavLinksProps): JSX.Element;
17
+ declare namespace SubNavLinks {
18
+ var displayName: string;
19
+ }
14
20
  declare const SubNavLink: import("styled-components").StyledComponent<"a", any, {
15
21
  to?: History.LocationDescriptor<unknown> | undefined;
16
22
  selected?: boolean | undefined;
17
- } & SxProp, never>;
23
+ } & SystemCommonProps & SxProp & SystemBorderProps, never>;
18
24
  export declare type SubNavLinkProps = ComponentProps<typeof SubNavLink>;
19
25
  declare const _default: typeof SubNav & {
20
26
  Link: import("styled-components").StyledComponent<"a", any, {
21
27
  to?: History.LocationDescriptor<unknown> | undefined;
22
28
  selected?: boolean | undefined;
23
- } & SxProp, never>;
24
- Links: import("styled-components").StyledComponent<"div", any, SxProp, never>;
29
+ } & SystemCommonProps & SxProp & SystemBorderProps, never>;
30
+ Links: typeof SubNavLinks;
25
31
  };
26
32
  export default _default;
package/lib-esm/SubNav.js CHANGED
@@ -4,14 +4,15 @@ 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, FLEX, get } from './constants';
8
+ import Box from './Box';
8
9
  import sx from './sx';
9
10
  const ITEM_CLASS = 'SubNav-item';
10
11
  const SELECTED_CLASS = 'selected';
11
12
  const SubNavBase = styled.nav.withConfig({
12
13
  displayName: "SubNav__SubNavBase",
13
14
  componentId: "f7w0xa-0"
14
- })(["display:flex;justify-content:space-between;.SubNav-body{display:flex;margin-bottom:-1px;> *{margin-left:", ";}> *:first-child{margin-left:0;}}.SubNav-actions{align-self:center;}", ";"], get('space.2'), sx);
15
+ })(["display:flex;justify-content:space-between;.SubNav-body{display:flex;margin-bottom:-1px;> *{margin-left:", ";}> *:first-child{margin-left:0;}}.SubNav-actions{align-self:center;}", ";", ";", ";"], get('space.2'), COMMON, FLEX, sx);
15
16
 
16
17
  function SubNav({
17
18
  actions,
@@ -32,17 +33,21 @@ function SubNav({
32
33
  }
33
34
 
34
35
  SubNav.displayName = "SubNav";
35
- const SubNavLinks = styled.div.withConfig({
36
- displayName: "SubNav__SubNavLinks",
37
- componentId: "f7w0xa-1"
38
- })(["display:flex;", ";"], sx);
36
+
37
+ function SubNavLinks(props) {
38
+ return /*#__PURE__*/React.createElement(Box, _extends({
39
+ display: "flex"
40
+ }, props));
41
+ }
42
+
43
+ SubNavLinks.displayName = "SubNavLinks";
39
44
  const SubNavLink = styled.a.attrs(props => ({
40
45
  activeClassName: typeof props.to === 'string' ? 'selected' : '',
41
46
  className: classnames(ITEM_CLASS, props.selected && SELECTED_CLASS, props.className)
42
47
  })).withConfig({
43
48
  displayName: "SubNav__SubNavLink",
44
- componentId: "f7w0xa-2"
45
- })(["padding-left:", ";padding-right:", ";font-weight:", ";font-size:", ";line-height:20px;min-height:34px;color:", ";text-align:center;text-decoration:none;border-top:1px solid ", ";border-bottom:1px solid ", ";border-right:1px solid ", ";display:flex;align-items:center;&:first-of-type{border-top-left-radius:", ";border-bottom-left-radius:", ";border-left:1px solid ", ";}&:last-of-type{border-top-right-radius:", ";border-bottom-right-radius:", ";}&:hover,&:focus{text-decoration:none;background-color:", ";transition:0.2s ease;.SubNav-octicon{color:", ";}}&.selected{color:", ";background-color:", ";border-color:", ";.SubNav-octicon{color:", ";}}", ";"], get('space.3'), get('space.3'), get('fontWeights.semibold'), get('fontSizes.1'), get('colors.fg.default'), get('colors.border.default'), get('colors.border.default'), get('colors.border.default'), get('radii.2'), get('radii.2'), get('colors.border.default'), get('radii.2'), get('radii.2'), get('colors.canvas.subtle'), get('colors.fg.muted'), get('colors.fg.onEmphasis'), get('colors.accent.emphasis'), get('colors.accent.emphasis'), get('colors.fg.onEmphasis'), sx);
49
+ componentId: "f7w0xa-1"
50
+ })(["padding-left:", ";padding-right:", ";font-weight:", ";font-size:", ";line-height:20px;min-height:34px;color:", ";text-align:center;text-decoration:none;border-top:1px solid ", ";border-bottom:1px solid ", ";border-right:1px solid ", ";display:flex;align-items:center;&:first-of-type{border-top-left-radius:", ";border-bottom-left-radius:", ";border-left:1px solid ", ";}&:last-of-type{border-top-right-radius:", ";border-bottom-right-radius:", ";}&:hover,&:focus{text-decoration:none;background-color:", ";transition:0.2s ease;.SubNav-octicon{color:", ";}}&.selected{color:", ";background-color:", ";border-color:", ";.SubNav-octicon{color:", ";}}", ";", ";"], get('space.3'), get('space.3'), get('fontWeights.semibold'), get('fontSizes.1'), get('colors.fg.default'), get('colors.border.default'), get('colors.border.default'), get('colors.border.default'), get('radii.2'), get('radii.2'), get('colors.border.default'), get('radii.2'), get('radii.2'), get('colors.canvas.subtle'), get('colors.fg.muted'), get('colors.fg.onEmphasis'), get('colors.accent.emphasis'), get('colors.accent.emphasis'), get('colors.fg.onEmphasis'), COMMON, sx);
46
51
  SubNavLink.displayName = 'SubNav.Link';
47
52
  SubNavLinks.displayName = 'SubNav.Links';
48
53
  export default Object.assign(SubNav, {
@@ -1,11 +1,10 @@
1
1
  import { MaxWidthProps } from 'styled-system';
2
- import { SystemCommonProps, SystemTypographyProps } from './constants';
3
2
  import { SxProp } from './sx';
4
3
  import { ComponentProps } from './utils/types';
5
4
  declare const Truncate: import("styled-components").StyledComponent<"div", any, {
6
5
  title: string;
7
6
  inline?: boolean | undefined;
8
7
  expandable?: boolean | undefined;
9
- } & MaxWidthProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>, import("csstype").Property.MaxWidth<import("styled-system").TLengthStyledSystem>> & SystemTypographyProps & SystemCommonProps & SxProp, never>;
8
+ } & MaxWidthProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>, import("csstype").Property.MaxWidth<import("styled-system").TLengthStyledSystem>> & SxProp, never>;
10
9
  export declare type TruncateProps = ComponentProps<typeof Truncate>;
11
10
  export default Truncate;
@@ -1,11 +1,10 @@
1
1
  import styled from 'styled-components';
2
2
  import { maxWidth } from 'styled-system';
3
- import { COMMON, TYPOGRAPHY } from './constants';
4
3
  import sx from './sx';
5
4
  const Truncate = styled.div.withConfig({
6
5
  displayName: "Truncate",
7
6
  componentId: "sc-1074h1l-0"
8
- })(["", " ", " display:", ";overflow:hidden;text-overflow:ellipsis;vertical-align:", ";white-space:nowrap;", " ", " ", ";"], TYPOGRAPHY, COMMON, props => props.inline ? 'inline-block' : 'inherit', props => props.inline ? 'top' : 'initial', maxWidth, props => props.expandable ? `&:hover { max-width: 10000px; }` : '', sx);
7
+ })(["display:", ";overflow:hidden;text-overflow:ellipsis;vertical-align:", ";white-space:nowrap;", " ", " ", ";"], props => props.inline ? 'inline-block' : 'inherit', props => props.inline ? 'top' : 'initial', maxWidth, props => props.expandable ? `&:hover { max-width: 10000px; }` : '', sx);
9
8
  Truncate.defaultProps = {
10
9
  expandable: false,
11
10
  inline: false,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@primer/components",
3
- "version": "0.0.0-2021103221942",
3
+ "version": "0.0.0-2021103224544",
4
4
  "description": "Primer react components",
5
5
  "main": "lib/index.js",
6
6
  "module": "lib-esm/index.js",