@primer/components 0.0.0-202110322387 → 0.0.0-202110322537

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 _ = require(".");
14
+ var _Box = _interopRequireDefault(require("./Box"));
15
15
 
16
16
  var _constants = require("./constants");
17
17
 
@@ -23,25 +23,26 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
23
23
 
24
24
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
25
25
 
26
- const Timeline = _styledComponents.default.div.withConfig({
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({
27
29
  displayName: "Timeline",
28
30
  componentId: "c4dq2e-0"
29
31
  })(["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);
30
-
31
- const TimelineItem = _styledComponents.default.div.attrs(props => ({
32
+ const TimelineItem = (0, _styledComponents.default)(_Box.default).attrs(props => ({
32
33
  className: (0, _classnames.default)('Timeline-Item', props.className)
33
34
  })).withConfig({
34
35
  displayName: "Timeline__TimelineItem",
35
36
  componentId: "c4dq2e-1"
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);
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);
37
38
 
38
39
  const TimelineBadge = props => {
39
- return /*#__PURE__*/_react.default.createElement(_.Box, {
40
+ return /*#__PURE__*/_react.default.createElement(_Box.default, {
40
41
  position: "relative",
41
42
  zIndex: 1
42
- }, /*#__PURE__*/_react.default.createElement(_.Box, {
43
+ }, /*#__PURE__*/_react.default.createElement(_Box.default, _extends({
43
44
  display: "flex",
44
- className: "TimelineItem-Badge",
45
+ className: (0, _classnames.default)(props.className, 'TimelineItem-Badge'),
45
46
  flexShrink: 0,
46
47
  borderRadius: "50%",
47
48
  borderWidth: "2px",
@@ -55,23 +56,19 @@ const TimelineBadge = props => {
55
56
  mr: 2,
56
57
  ml: "-15px",
57
58
  alignItems: "center",
58
- justifyContent: "center",
59
- sx: props.sx
60
- }, props.children));
59
+ justifyContent: "center"
60
+ }, props), props.children));
61
61
  };
62
62
 
63
63
  TimelineBadge.displayName = "TimelineBadge";
64
-
65
- const TimelineBody = _styledComponents.default.div.withConfig({
64
+ const TimelineBody = (0, _styledComponents.default)(_Box.default).withConfig({
66
65
  displayName: "Timeline__TimelineBody",
67
66
  componentId: "c4dq2e-2"
68
67
  })(["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);
69
-
70
- const TimelineBreak = _styledComponents.default.div.withConfig({
68
+ const TimelineBreak = (0, _styledComponents.default)(_Box.default).withConfig({
71
69
  displayName: "Timeline__TimelineBreak",
72
70
  componentId: "c4dq2e-3"
73
71
  })(["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
-
75
72
  TimelineItem.displayName = 'Timeline.Item';
76
73
  TimelineBadge.displayName = 'Timeline.Badge';
77
74
  TimelineBody.displayName = 'Timeline.Body';
@@ -1,24 +1,25 @@
1
1
  import * as History from 'history';
2
2
  import React from 'react';
3
- import { SystemCommonProps, SystemFlexProps } from './constants';
4
3
  import { SxProp } from './sx';
5
4
  import { ComponentProps } from './utils/types';
6
- declare const BreadcrumbsBase: import("styled-components").StyledComponent<"nav", any, SystemFlexProps & SystemCommonProps & SxProp, never>;
7
- export declare type BreadcrumbsProps = ComponentProps<typeof BreadcrumbsBase>;
8
- declare function Breadcrumbs({ className, children, theme, ...rest }: React.PropsWithChildren<BreadcrumbsProps>): JSX.Element;
5
+ declare const BreadcrumbsBase: import("styled-components").StyledComponent<"nav", any, SxProp, never>;
6
+ export declare type BreadcrumbsProps = React.PropsWithChildren<{
7
+ className?: string;
8
+ } & SxProp>;
9
+ declare function Breadcrumbs({ className, children, sx: sxProp }: React.PropsWithChildren<BreadcrumbsProps>): JSX.Element;
9
10
  declare namespace Breadcrumbs {
10
11
  var displayName: string;
11
12
  }
12
13
  declare const BreadcrumbsItem: import("styled-components").StyledComponent<"a", any, {
13
14
  to?: History.LocationDescriptor<unknown> | undefined;
14
15
  selected?: boolean | undefined;
15
- } & SystemCommonProps & SxProp, never>;
16
+ } & SxProp, never>;
16
17
  export declare type BreadcrumbsItemProps = ComponentProps<typeof BreadcrumbsItem>;
17
18
  declare const _default: typeof Breadcrumbs & {
18
19
  Item: import("styled-components").StyledComponent<"a", any, {
19
20
  to?: History.LocationDescriptor<unknown> | undefined;
20
21
  selected?: boolean | undefined;
21
- } & SystemCommonProps & SxProp, never>;
22
+ } & SxProp, never>;
22
23
  };
23
24
  export default _default;
24
25
  /**
@@ -28,7 +29,7 @@ export declare const Breadcrumb: typeof Breadcrumbs & {
28
29
  Item: import("styled-components").StyledComponent<"a", any, {
29
30
  to?: History.LocationDescriptor<unknown> | undefined;
30
31
  selected?: boolean | undefined;
31
- } & SystemCommonProps & SxProp, never>;
32
+ } & SxProp, never>;
32
33
  };
33
34
  /**
34
35
  * @deprecated Use the `BreadcrumbsProps` type instead
@@ -1,11 +1,9 @@
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
-
3
1
  import classnames from 'classnames'; // eslint-disable-next-line import/no-namespace
4
2
 
5
3
  import React from 'react';
6
4
  import styled from 'styled-components';
7
5
  import Box from './Box';
8
- import { COMMON, FLEX, get } from './constants';
6
+ import { get } from './constants';
9
7
  import sx from './sx';
10
8
  const SELECTED_CLASS = 'selected';
11
9
  const Wrapper = styled.li.withConfig({
@@ -15,22 +13,19 @@ const Wrapper = styled.li.withConfig({
15
13
  const BreadcrumbsBase = styled.nav.withConfig({
16
14
  displayName: "Breadcrumbs__BreadcrumbsBase",
17
15
  componentId: "hwwoo0-1"
18
- })(["display:flex;justify-content:space-between;", ";", ";", ";"], COMMON, FLEX, sx);
16
+ })(["display:flex;justify-content:space-between;", ";"], sx);
19
17
 
20
18
  function Breadcrumbs({
21
19
  className,
22
20
  children,
23
- theme,
24
- ...rest
21
+ sx: sxProp
25
22
  }) {
26
- const wrappedChildren = React.Children.map(children, child => /*#__PURE__*/React.createElement(Wrapper, {
27
- theme: theme
28
- }, child));
29
- return /*#__PURE__*/React.createElement(BreadcrumbsBase, _extends({
23
+ const wrappedChildren = React.Children.map(children, child => /*#__PURE__*/React.createElement(Wrapper, null, child));
24
+ return /*#__PURE__*/React.createElement(BreadcrumbsBase, {
30
25
  className: className,
31
26
  "aria-label": "Breadcrumbs",
32
- theme: theme
33
- }, rest), /*#__PURE__*/React.createElement(Box, {
27
+ sx: sxProp
28
+ }, /*#__PURE__*/React.createElement(Box, {
34
29
  as: "ol",
35
30
  my: 0,
36
31
  pl: 0
@@ -45,7 +40,7 @@ const BreadcrumbsItem = styled.a.attrs(props => ({
45
40
  })).withConfig({
46
41
  displayName: "Breadcrumbs__BreadcrumbsItem",
47
42
  componentId: "hwwoo0-2"
48
- })(["color:", ";display:inline-block;font-size:", ";text-decoration:none;&:hover{text-decoration:underline;}&.selected{color:", ";pointer-events:none;}", " ", ";"], get('colors.accent.fg'), get('fontSizes.1'), get('colors.fg.default'), COMMON, sx);
43
+ })(["color:", ";display:inline-block;font-size:", ";text-decoration:none;&:hover{text-decoration:underline;}&.selected{color:", ";pointer-events:none;}", ";"], get('colors.accent.fg'), get('fontSizes.1'), get('colors.fg.default'), sx);
49
44
  Breadcrumbs.displayName = 'Breadcrumbs';
50
45
  BreadcrumbsItem.displayName = 'Breadcrumbs.Item';
51
46
  export default Object.assign(Breadcrumbs, {