@primer/components 0.0.0-2021103222654 → 0.0.0-202110322387

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/Timeline.js CHANGED
@@ -11,7 +11,7 @@ var _react = _interopRequireDefault(require("react"));
11
11
 
12
12
  var _styledComponents = _interopRequireWildcard(require("styled-components"));
13
13
 
14
- var _Box = _interopRequireDefault(require("./Box"));
14
+ var _ = require(".");
15
15
 
16
16
  var _constants = require("./constants");
17
17
 
@@ -23,26 +23,25 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
23
23
 
24
24
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
25
25
 
26
- 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); }
27
-
28
- const Timeline = (0, _styledComponents.default)(_Box.default).withConfig({
26
+ const Timeline = _styledComponents.default.div.withConfig({
29
27
  displayName: "Timeline",
30
28
  componentId: "c4dq2e-0"
31
29
  })(["display:flex;flex-direction:column;", " ", ";"], props => props.clipSidebar && (0, _styledComponents.css)([".Timeline-Item:first-child{padding-top:0;}.Timeline-Item:last-child{padding-bottom:0;}"]), _sx.default);
32
- const TimelineItem = (0, _styledComponents.default)(_Box.default).attrs(props => ({
30
+
31
+ const TimelineItem = _styledComponents.default.div.attrs(props => ({
33
32
  className: (0, _classnames.default)('Timeline-Item', props.className)
34
33
  })).withConfig({
35
34
  displayName: "Timeline__TimelineItem",
36
35
  componentId: "c4dq2e-1"
37
- })(["display:flex;position:relative;padding:", " 0;margin-left:", ";&::before{position:absolute;top:0;bottom:0;left:0;display:block;width:2px;content:'';background-color:", ";}", " ", ";", ";"], (0, _constants.get)('space.3'), (0, _constants.get)('space.3'), (0, _constants.get)('colors.border.muted'), props => props.condensed && (0, _styledComponents.css)(["padding-top:", ";padding-bottom:0;&:last-child{padding-bottom:", ";}.TimelineItem-Badge{height:16px;margin-top:", ";margin-bottom:", ";color:", ";background-color:", ";border:0;}"], (0, _constants.get)('space.1'), (0, _constants.get)('space.3'), (0, _constants.get)('space.2'), (0, _constants.get)('space.2'), (0, _constants.get)('colors.fg.muted'), (0, _constants.get)('colors.canvas.default')), _constants.COMMON, _sx.default);
36
+ })(["display:flex;position:relative;padding:", " 0;margin-left:", ";&::before{position:absolute;top:0;bottom:0;left:0;display:block;width:2px;content:'';background-color:", ";}", " ", ";"], (0, _constants.get)('space.3'), (0, _constants.get)('space.3'), (0, _constants.get)('colors.border.muted'), props => props.condensed && (0, _styledComponents.css)(["padding-top:", ";padding-bottom:0;&:last-child{padding-bottom:", ";}.TimelineItem-Badge{height:16px;margin-top:", ";margin-bottom:", ";color:", ";background-color:", ";border:0;}"], (0, _constants.get)('space.1'), (0, _constants.get)('space.3'), (0, _constants.get)('space.2'), (0, _constants.get)('space.2'), (0, _constants.get)('colors.fg.muted'), (0, _constants.get)('colors.canvas.default')), _sx.default);
38
37
 
39
38
  const TimelineBadge = props => {
40
- return /*#__PURE__*/_react.default.createElement(_Box.default, {
39
+ return /*#__PURE__*/_react.default.createElement(_.Box, {
41
40
  position: "relative",
42
41
  zIndex: 1
43
- }, /*#__PURE__*/_react.default.createElement(_Box.default, _extends({
42
+ }, /*#__PURE__*/_react.default.createElement(_.Box, {
44
43
  display: "flex",
45
- className: (0, _classnames.default)(props.className, 'TimelineItem-Badge'),
44
+ className: "TimelineItem-Badge",
46
45
  flexShrink: 0,
47
46
  borderRadius: "50%",
48
47
  borderWidth: "2px",
@@ -56,19 +55,23 @@ const TimelineBadge = props => {
56
55
  mr: 2,
57
56
  ml: "-15px",
58
57
  alignItems: "center",
59
- justifyContent: "center"
60
- }, props), props.children));
58
+ justifyContent: "center",
59
+ sx: props.sx
60
+ }, props.children));
61
61
  };
62
62
 
63
63
  TimelineBadge.displayName = "TimelineBadge";
64
- const TimelineBody = (0, _styledComponents.default)(_Box.default).withConfig({
64
+
65
+ const TimelineBody = _styledComponents.default.div.withConfig({
65
66
  displayName: "Timeline__TimelineBody",
66
67
  componentId: "c4dq2e-2"
67
68
  })(["min-width:0;max-width:100%;margin-top:", ";color:", ";flex:auto;font-size:", ";", ";"], (0, _constants.get)('space.1'), (0, _constants.get)('colors.fg.muted'), (0, _constants.get)('fontSizes.1'), _sx.default);
68
- const TimelineBreak = (0, _styledComponents.default)(_Box.default).withConfig({
69
+
70
+ const TimelineBreak = _styledComponents.default.div.withConfig({
69
71
  displayName: "Timeline__TimelineBreak",
70
72
  componentId: "c4dq2e-3"
71
73
  })(["position:relative z-index:1;height:24px;margin:0;margin-bottom:-", ";margin-left:0;background-color:", ";border:0;border-top:", " solid ", ";", ";"], (0, _constants.get)('space.3'), (0, _constants.get)('colors.canvas.default'), (0, _constants.get)('space.1'), (0, _constants.get)('colors.border.default'), _sx.default);
74
+
72
75
  TimelineItem.displayName = 'Timeline.Item';
73
76
  TimelineBadge.displayName = 'Timeline.Badge';
74
77
  TimelineBody.displayName = 'Timeline.Body';
@@ -1,19 +1,20 @@
1
1
  /// <reference types="react" />
2
2
  import * as History from 'history';
3
+ import { SystemCommonProps, SystemTypographyProps } from './constants';
3
4
  import { SxProp } from './sx';
4
5
  import { ComponentProps } from './utils/types';
5
- declare const TabNavBase: import("styled-components").StyledComponent<"div", any, SxProp, never>;
6
+ declare const TabNavBase: import("styled-components").StyledComponent<"div", any, SystemCommonProps & SxProp, never>;
6
7
  export declare type TabNavProps = ComponentProps<typeof TabNavBase>;
7
8
  declare function TabNav({ children, 'aria-label': ariaLabel, ...rest }: TabNavProps): JSX.Element;
8
9
  declare const TabNavLink: import("styled-components").StyledComponent<"a", any, {
9
10
  to?: History.LocationDescriptor<unknown> | undefined;
10
11
  selected?: boolean | undefined;
11
- } & SxProp, never>;
12
+ } & SystemCommonProps & SxProp & SystemTypographyProps, never>;
12
13
  export declare type TabNavLinkProps = ComponentProps<typeof TabNavLink>;
13
14
  declare const _default: typeof TabNav & {
14
15
  Link: import("styled-components").StyledComponent<"a", any, {
15
16
  to?: History.LocationDescriptor<unknown> | undefined;
16
17
  selected?: boolean | undefined;
17
- } & SxProp, never>;
18
+ } & SystemCommonProps & SxProp & SystemTypographyProps, never>;
18
19
  };
19
20
  export default _default;
package/lib-esm/TabNav.js CHANGED
@@ -2,14 +2,14 @@ import classnames from 'classnames'; // eslint-disable-next-line import/no-names
2
2
 
3
3
  import React from 'react';
4
4
  import styled from 'styled-components';
5
- import { get } from './constants';
5
+ import { COMMON, get } from './constants';
6
6
  import sx from './sx';
7
7
  const ITEM_CLASS = 'TabNav-item';
8
8
  const SELECTED_CLASS = 'selected';
9
9
  const TabNavBase = styled.div.withConfig({
10
10
  displayName: "TabNav__TabNavBase",
11
11
  componentId: "sc-1xod0ow-0"
12
- })(["margin-top:0;border-bottom:1px solid ", ";", ""], get('colors.border.default'), sx);
12
+ })(["margin-top:0;border-bottom:1px solid ", ";", " ", ""], get('colors.border.default'), COMMON, sx);
13
13
  const TabNavBody = styled.nav.withConfig({
14
14
  displayName: "TabNav__TabNavBody",
15
15
  componentId: "sc-1xod0ow-1"
@@ -32,7 +32,7 @@ const TabNavLink = styled.a.attrs(props => ({
32
32
  })).withConfig({
33
33
  displayName: "TabNav__TabNavLink",
34
34
  componentId: "sc-1xod0ow-2"
35
- })(["padding:8px 12px;font-size:", ";line-height:20px;color:", ";text-decoration:none;background-color:transparent;border:1px solid transparent;border-bottom:0;&:hover,&:focus{color:", ";text-decoration:none;}&.selected{color:", ";border-color:", ";border-top-right-radius:", ";border-top-left-radius:", ";background-color:", ";}", ";"], get('fontSizes.1'), get('colors.fg.default'), get('colors.fg.default'), get('colors.fg.default'), get('colors.border.default'), get('radii.2'), get('radii.2'), get('colors.canvas.default'), sx);
35
+ })(["padding:8px 12px;font-size:", ";line-height:20px;color:", ";text-decoration:none;background-color:transparent;border:1px solid transparent;border-bottom:0;&:hover,&:focus{color:", ";text-decoration:none;}&.selected{color:", ";border-color:", ";border-top-right-radius:", ";border-top-left-radius:", ";background-color:", ";}", ";", ";"], get('fontSizes.1'), get('colors.fg.default'), get('colors.fg.default'), get('colors.fg.default'), get('colors.border.default'), get('radii.2'), get('radii.2'), get('colors.canvas.default'), COMMON, sx);
36
36
  TabNavLink.displayName = 'TabNav.Link';
37
37
  export default Object.assign(TabNav, {
38
38
  Link: TabNavLink