@primer/components 0.0.0-20218248253 → 0.0.0-202182493810

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.
@@ -0,0 +1,40 @@
1
+ import * as History from 'history';
2
+ import React from 'react';
3
+ import { SystemCommonProps, SystemFlexProps } from './constants';
4
+ import { SxProp } from './sx';
5
+ 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;
9
+ declare namespace Breadcrumbs {
10
+ var displayName: string;
11
+ }
12
+ declare const BreadcrumbsItem: import("styled-components").StyledComponent<"a", any, {
13
+ to?: History.LocationDescriptor<unknown> | undefined;
14
+ selected?: boolean | undefined;
15
+ } & SystemCommonProps & SxProp, never>;
16
+ export declare type BreadcrumbsItemProps = ComponentProps<typeof BreadcrumbsItem>;
17
+ declare const _default: typeof Breadcrumbs & {
18
+ Item: import("styled-components").StyledComponent<"a", any, {
19
+ to?: History.LocationDescriptor<unknown> | undefined;
20
+ selected?: boolean | undefined;
21
+ } & SystemCommonProps & SxProp, never>;
22
+ };
23
+ export default _default;
24
+ /**
25
+ * @deprecated Use the `Breadcrumbs` component instead (i.e. `<Breadcrumb>` → `<Breadcrumbs>`)
26
+ */
27
+ export declare const Breadcrumb: typeof Breadcrumbs & {
28
+ Item: import("styled-components").StyledComponent<"a", any, {
29
+ to?: History.LocationDescriptor<unknown> | undefined;
30
+ selected?: boolean | undefined;
31
+ } & SystemCommonProps & SxProp, never>;
32
+ };
33
+ /**
34
+ * @deprecated Use the `BreadcrumbsProps` type instead
35
+ */
36
+ export declare type BreadcrumbProps = ComponentProps<typeof BreadcrumbsBase>;
37
+ /**
38
+ * @deprecated Use the `BreadcrumbsItemProps` type instead
39
+ */
40
+ export declare type BreadcrumbItemProps = ComponentProps<typeof BreadcrumbsItem>;
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.default = void 0;
6
+ exports.Breadcrumb = exports.default = void 0;
7
7
 
8
8
  var _classnames = _interopRequireDefault(require("classnames"));
9
9
 
@@ -24,30 +24,28 @@ function _extends() { _extends = Object.assign || function (target) { for (var i
24
24
  const SELECTED_CLASS = 'selected';
25
25
 
26
26
  const Wrapper = _styledComponents.default.li.withConfig({
27
- displayName: "Breadcrumb__Wrapper",
28
- componentId: "c1r3ff-0"
27
+ displayName: "Breadcrumbs__Wrapper",
28
+ componentId: "hwwoo0-0"
29
29
  })(["display:inline-block;white-space:nowrap;list-style:none;&::after{padding-right:0.5em;padding-left:0.5em;color:", ";font-size:", ";content:'/';}&:first-child{margin-left:0;}&:last-child{&::after{content:none;}}"], (0, _constants.get)('colors.fg.muted'), (0, _constants.get)('fontSizes.1'));
30
30
 
31
- const BreadcrumbBase = _styledComponents.default.nav.withConfig({
32
- displayName: "Breadcrumb__BreadcrumbBase",
33
- componentId: "c1r3ff-1"
31
+ const BreadcrumbsBase = _styledComponents.default.nav.withConfig({
32
+ displayName: "Breadcrumbs__BreadcrumbsBase",
33
+ componentId: "hwwoo0-1"
34
34
  })(["display:flex;justify-content:space-between;", ";", ";", ";"], _constants.COMMON, _constants.FLEX, _sx.default);
35
35
 
36
- function Breadcrumb({
36
+ function Breadcrumbs({
37
37
  className,
38
38
  children,
39
39
  theme,
40
40
  ...rest
41
41
  }) {
42
- const classes = (0, _classnames.default)(className, 'Breadcrumb');
43
-
44
42
  const wrappedChildren = _react.default.Children.map(children, child => /*#__PURE__*/_react.default.createElement(Wrapper, {
45
43
  theme: theme
46
44
  }, child));
47
45
 
48
- return /*#__PURE__*/_react.default.createElement(BreadcrumbBase, _extends({
49
- className: classes,
50
- "aria-label": "breadcrumb",
46
+ return /*#__PURE__*/_react.default.createElement(BreadcrumbsBase, _extends({
47
+ className: className,
48
+ "aria-label": "Breadcrumbs",
51
49
  theme: theme
52
50
  }, rest), /*#__PURE__*/_react.default.createElement(_Box.default, {
53
51
  as: "ol",
@@ -56,22 +54,34 @@ function Breadcrumb({
56
54
  }, wrappedChildren));
57
55
  }
58
56
 
59
- Breadcrumb.displayName = "Breadcrumb";
57
+ Breadcrumbs.displayName = "Breadcrumbs";
60
58
 
61
- const BreadcrumbItem = _styledComponents.default.a.attrs(props => ({
59
+ const BreadcrumbsItem = _styledComponents.default.a.attrs(props => ({
62
60
  activeClassName: typeof props.to === 'string' ? 'selected' : '',
63
61
  className: (0, _classnames.default)(props.selected && SELECTED_CLASS, props.className),
64
62
  'aria-current': props.selected ? 'page' : null
65
63
  })).withConfig({
66
- displayName: "Breadcrumb__BreadcrumbItem",
67
- componentId: "c1r3ff-2"
64
+ displayName: "Breadcrumbs__BreadcrumbsItem",
65
+ componentId: "hwwoo0-2"
68
66
  })(["color:", ";display:inline-block;font-size:", ";text-decoration:none;&:hover{text-decoration:underline;}&.selected{color:", ";pointer-events:none;}", " ", ";"], (0, _constants.get)('colors.accent.fg'), (0, _constants.get)('fontSizes.1'), (0, _constants.get)('colors.fg.default'), _constants.COMMON, _sx.default);
69
67
 
70
- Breadcrumb.displayName = 'Breadcrumb';
71
- BreadcrumbItem.displayName = 'Breadcrumb.Item';
68
+ Breadcrumbs.displayName = 'Breadcrumbs';
69
+ BreadcrumbsItem.displayName = 'Breadcrumbs.Item';
70
+
71
+ var _default = Object.assign(Breadcrumbs, {
72
+ Item: BreadcrumbsItem
73
+ });
74
+ /**
75
+ * @deprecated Use the `Breadcrumbs` component instead (i.e. `<Breadcrumb>` → `<Breadcrumbs>`)
76
+ */
77
+
72
78
 
73
- var _default = Object.assign(Breadcrumb, {
74
- Item: BreadcrumbItem
79
+ exports.default = _default;
80
+ const Breadcrumb = Object.assign(Breadcrumbs, {
81
+ Item: BreadcrumbsItem
75
82
  });
83
+ /**
84
+ * @deprecated Use the `BreadcrumbsProps` type instead
85
+ */
76
86
 
77
- exports.default = _default;
87
+ exports.Breadcrumb = Breadcrumb;
package/lib/index.d.ts CHANGED
@@ -32,8 +32,8 @@ export { default as AvatarStack } from './AvatarStack';
32
32
  export type { AvatarStackProps } from './AvatarStack';
33
33
  export { default as BranchName } from './BranchName';
34
34
  export type { BranchNameProps } from './BranchName';
35
- export { default as Breadcrumb } from './Breadcrumb';
36
- export type { BreadcrumbProps, BreadcrumbItemProps } from './Breadcrumb';
35
+ export { default as Breadcrumbs, Breadcrumb } from './Breadcrumbs';
36
+ export type { BreadcrumbsProps, BreadcrumbsItemProps, BreadcrumbProps, BreadcrumbItemProps } from './Breadcrumbs';
37
37
  export { default as Button, ButtonDanger, ButtonOutline, ButtonPrimary, ButtonInvisible, ButtonTableList, ButtonClose, ButtonGroup } from './Button';
38
38
  export type { ButtonProps, ButtonDangerProps, ButtonOutlineProps, ButtonPrimaryProps, ButtonInvisibleProps, ButtonTableListProps, ButtonCloseProps, ButtonGroupProps } from './Button';
39
39
  export { default as Caret } from './Caret';
package/lib/index.js CHANGED
@@ -177,10 +177,16 @@ Object.defineProperty(exports, "BranchName", {
177
177
  return _BranchName.default;
178
178
  }
179
179
  });
180
+ Object.defineProperty(exports, "Breadcrumbs", {
181
+ enumerable: true,
182
+ get: function () {
183
+ return _Breadcrumbs.default;
184
+ }
185
+ });
180
186
  Object.defineProperty(exports, "Breadcrumb", {
181
187
  enumerable: true,
182
188
  get: function () {
183
- return _Breadcrumb.default;
189
+ return _Breadcrumbs.Breadcrumb;
184
190
  }
185
191
  });
186
192
  Object.defineProperty(exports, "Button", {
@@ -510,7 +516,7 @@ var _AvatarStack = _interopRequireDefault(require("./AvatarStack"));
510
516
 
511
517
  var _BranchName = _interopRequireDefault(require("./BranchName"));
512
518
 
513
- var _Breadcrumb = _interopRequireDefault(require("./Breadcrumb"));
519
+ var _Breadcrumbs = _interopRequireWildcard(require("./Breadcrumbs"));
514
520
 
515
521
  var _Button = _interopRequireWildcard(require("./Button"));
516
522
 
@@ -0,0 +1,40 @@
1
+ import * as History from 'history';
2
+ import React from 'react';
3
+ import { SystemCommonProps, SystemFlexProps } from './constants';
4
+ import { SxProp } from './sx';
5
+ 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;
9
+ declare namespace Breadcrumbs {
10
+ var displayName: string;
11
+ }
12
+ declare const BreadcrumbsItem: import("styled-components").StyledComponent<"a", any, {
13
+ to?: History.LocationDescriptor<unknown> | undefined;
14
+ selected?: boolean | undefined;
15
+ } & SystemCommonProps & SxProp, never>;
16
+ export declare type BreadcrumbsItemProps = ComponentProps<typeof BreadcrumbsItem>;
17
+ declare const _default: typeof Breadcrumbs & {
18
+ Item: import("styled-components").StyledComponent<"a", any, {
19
+ to?: History.LocationDescriptor<unknown> | undefined;
20
+ selected?: boolean | undefined;
21
+ } & SystemCommonProps & SxProp, never>;
22
+ };
23
+ export default _default;
24
+ /**
25
+ * @deprecated Use the `Breadcrumbs` component instead (i.e. `<Breadcrumb>` → `<Breadcrumbs>`)
26
+ */
27
+ export declare const Breadcrumb: typeof Breadcrumbs & {
28
+ Item: import("styled-components").StyledComponent<"a", any, {
29
+ to?: History.LocationDescriptor<unknown> | undefined;
30
+ selected?: boolean | undefined;
31
+ } & SystemCommonProps & SxProp, never>;
32
+ };
33
+ /**
34
+ * @deprecated Use the `BreadcrumbsProps` type instead
35
+ */
36
+ export declare type BreadcrumbProps = ComponentProps<typeof BreadcrumbsBase>;
37
+ /**
38
+ * @deprecated Use the `BreadcrumbsItemProps` type instead
39
+ */
40
+ export declare type BreadcrumbItemProps = ComponentProps<typeof BreadcrumbsItem>;
@@ -9,27 +9,26 @@ import { COMMON, FLEX, get } from './constants';
9
9
  import sx from './sx';
10
10
  const SELECTED_CLASS = 'selected';
11
11
  const Wrapper = styled.li.withConfig({
12
- displayName: "Breadcrumb__Wrapper",
13
- componentId: "c1r3ff-0"
12
+ displayName: "Breadcrumbs__Wrapper",
13
+ componentId: "hwwoo0-0"
14
14
  })(["display:inline-block;white-space:nowrap;list-style:none;&::after{padding-right:0.5em;padding-left:0.5em;color:", ";font-size:", ";content:'/';}&:first-child{margin-left:0;}&:last-child{&::after{content:none;}}"], get('colors.fg.muted'), get('fontSizes.1'));
15
- const BreadcrumbBase = styled.nav.withConfig({
16
- displayName: "Breadcrumb__BreadcrumbBase",
17
- componentId: "c1r3ff-1"
15
+ const BreadcrumbsBase = styled.nav.withConfig({
16
+ displayName: "Breadcrumbs__BreadcrumbsBase",
17
+ componentId: "hwwoo0-1"
18
18
  })(["display:flex;justify-content:space-between;", ";", ";", ";"], COMMON, FLEX, sx);
19
19
 
20
- function Breadcrumb({
20
+ function Breadcrumbs({
21
21
  className,
22
22
  children,
23
23
  theme,
24
24
  ...rest
25
25
  }) {
26
- const classes = classnames(className, 'Breadcrumb');
27
26
  const wrappedChildren = React.Children.map(children, child => /*#__PURE__*/React.createElement(Wrapper, {
28
27
  theme: theme
29
28
  }, child));
30
- return /*#__PURE__*/React.createElement(BreadcrumbBase, _extends({
31
- className: classes,
32
- "aria-label": "breadcrumb",
29
+ return /*#__PURE__*/React.createElement(BreadcrumbsBase, _extends({
30
+ className: className,
31
+ "aria-label": "Breadcrumbs",
33
32
  theme: theme
34
33
  }, rest), /*#__PURE__*/React.createElement(Box, {
35
34
  as: "ol",
@@ -38,17 +37,27 @@ function Breadcrumb({
38
37
  }, wrappedChildren));
39
38
  }
40
39
 
41
- Breadcrumb.displayName = "Breadcrumb";
42
- const BreadcrumbItem = styled.a.attrs(props => ({
40
+ Breadcrumbs.displayName = "Breadcrumbs";
41
+ const BreadcrumbsItem = styled.a.attrs(props => ({
43
42
  activeClassName: typeof props.to === 'string' ? 'selected' : '',
44
43
  className: classnames(props.selected && SELECTED_CLASS, props.className),
45
44
  'aria-current': props.selected ? 'page' : null
46
45
  })).withConfig({
47
- displayName: "Breadcrumb__BreadcrumbItem",
48
- componentId: "c1r3ff-2"
46
+ displayName: "Breadcrumbs__BreadcrumbsItem",
47
+ componentId: "hwwoo0-2"
49
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);
50
- Breadcrumb.displayName = 'Breadcrumb';
51
- BreadcrumbItem.displayName = 'Breadcrumb.Item';
52
- export default Object.assign(Breadcrumb, {
53
- Item: BreadcrumbItem
54
- });
49
+ Breadcrumbs.displayName = 'Breadcrumbs';
50
+ BreadcrumbsItem.displayName = 'Breadcrumbs.Item';
51
+ export default Object.assign(Breadcrumbs, {
52
+ Item: BreadcrumbsItem
53
+ });
54
+ /**
55
+ * @deprecated Use the `Breadcrumbs` component instead (i.e. `<Breadcrumb>` → `<Breadcrumbs>`)
56
+ */
57
+
58
+ export const Breadcrumb = Object.assign(Breadcrumbs, {
59
+ Item: BreadcrumbsItem
60
+ });
61
+ /**
62
+ * @deprecated Use the `BreadcrumbsProps` type instead
63
+ */
@@ -32,8 +32,8 @@ export { default as AvatarStack } from './AvatarStack';
32
32
  export type { AvatarStackProps } from './AvatarStack';
33
33
  export { default as BranchName } from './BranchName';
34
34
  export type { BranchNameProps } from './BranchName';
35
- export { default as Breadcrumb } from './Breadcrumb';
36
- export type { BreadcrumbProps, BreadcrumbItemProps } from './Breadcrumb';
35
+ export { default as Breadcrumbs, Breadcrumb } from './Breadcrumbs';
36
+ export type { BreadcrumbsProps, BreadcrumbsItemProps, BreadcrumbProps, BreadcrumbItemProps } from './Breadcrumbs';
37
37
  export { default as Button, ButtonDanger, ButtonOutline, ButtonPrimary, ButtonInvisible, ButtonTableList, ButtonClose, ButtonGroup } from './Button';
38
38
  export type { ButtonProps, ButtonDangerProps, ButtonOutlineProps, ButtonPrimaryProps, ButtonInvisibleProps, ButtonTableListProps, ButtonCloseProps, ButtonGroupProps } from './Button';
39
39
  export { default as Caret } from './Caret';
package/lib-esm/index.js CHANGED
@@ -23,7 +23,7 @@ export { default as Avatar } from './Avatar';
23
23
  export { default as AvatarPair } from './AvatarPair';
24
24
  export { default as AvatarStack } from './AvatarStack';
25
25
  export { default as BranchName } from './BranchName';
26
- export { default as Breadcrumb } from './Breadcrumb';
26
+ export { default as Breadcrumbs, Breadcrumb } from './Breadcrumbs';
27
27
  export { default as Button, ButtonDanger, ButtonOutline, ButtonPrimary, ButtonInvisible, ButtonTableList, ButtonClose, ButtonGroup } from './Button';
28
28
  export { default as Caret } from './Caret';
29
29
  export { default as CircleBadge } from './CircleBadge';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@primer/components",
3
- "version": "0.0.0-20218248253",
3
+ "version": "0.0.0-202182493810",
4
4
  "description": "Primer react components",
5
5
  "main": "lib/index.js",
6
6
  "module": "lib-esm/index.js",
@@ -62,14 +62,14 @@
62
62
  "devDependencies": {
63
63
  "@babel/cli": "7.14.5",
64
64
  "@babel/core": "7.14.8",
65
- "@babel/eslint-parser": "7.14.5",
65
+ "@babel/eslint-parser": "7.15.7",
66
66
  "@babel/plugin-proposal-nullish-coalescing-operator": "7.14.5",
67
67
  "@babel/plugin-proposal-optional-chaining": "7.14.5",
68
68
  "@babel/plugin-transform-modules-commonjs": "7.14.5",
69
69
  "@babel/preset-react": "7.14.5",
70
70
  "@babel/preset-typescript": "7.14.5",
71
71
  "@changesets/changelog-github": "0.4.0",
72
- "@changesets/cli": "2.16.0",
72
+ "@changesets/cli": "2.17.0",
73
73
  "@github/prettier-config": "0.0.4",
74
74
  "@rollup/plugin-commonjs": "19.0.2",
75
75
  "@rollup/plugin-node-resolve": "13.0.0",
@@ -101,7 +101,7 @@
101
101
  "babel-plugin-transform-replace-expressions": "0.2.0",
102
102
  "babel-polyfill": "6.26.0",
103
103
  "chroma-js": "2.1.2",
104
- "concurrently": "6.2.0",
104
+ "concurrently": "6.2.1",
105
105
  "copyfiles": "2.4.1",
106
106
  "cross-env": "7.0.3",
107
107
  "enzyme": "3.11.0",
@@ -1,23 +0,0 @@
1
- import * as History from 'history';
2
- import React from 'react';
3
- import { SystemCommonProps, SystemFlexProps } from './constants';
4
- import { SxProp } from './sx';
5
- import { ComponentProps } from './utils/types';
6
- declare const BreadcrumbBase: import("styled-components").StyledComponent<"nav", any, SystemFlexProps & SystemCommonProps & SxProp, never>;
7
- export declare type BreadcrumbProps = ComponentProps<typeof BreadcrumbBase>;
8
- declare function Breadcrumb({ className, children, theme, ...rest }: React.PropsWithChildren<BreadcrumbProps>): JSX.Element;
9
- declare namespace Breadcrumb {
10
- var displayName: string;
11
- }
12
- declare const BreadcrumbItem: import("styled-components").StyledComponent<"a", any, {
13
- to?: History.LocationDescriptor<unknown> | undefined;
14
- selected?: boolean | undefined;
15
- } & SystemCommonProps & SxProp, never>;
16
- export declare type BreadcrumbItemProps = ComponentProps<typeof BreadcrumbItem>;
17
- declare const _default: typeof Breadcrumb & {
18
- Item: import("styled-components").StyledComponent<"a", any, {
19
- to?: History.LocationDescriptor<unknown> | undefined;
20
- selected?: boolean | undefined;
21
- } & SystemCommonProps & SxProp, never>;
22
- };
23
- export default _default;
@@ -1,23 +0,0 @@
1
- import * as History from 'history';
2
- import React from 'react';
3
- import { SystemCommonProps, SystemFlexProps } from './constants';
4
- import { SxProp } from './sx';
5
- import { ComponentProps } from './utils/types';
6
- declare const BreadcrumbBase: import("styled-components").StyledComponent<"nav", any, SystemFlexProps & SystemCommonProps & SxProp, never>;
7
- export declare type BreadcrumbProps = ComponentProps<typeof BreadcrumbBase>;
8
- declare function Breadcrumb({ className, children, theme, ...rest }: React.PropsWithChildren<BreadcrumbProps>): JSX.Element;
9
- declare namespace Breadcrumb {
10
- var displayName: string;
11
- }
12
- declare const BreadcrumbItem: import("styled-components").StyledComponent<"a", any, {
13
- to?: History.LocationDescriptor<unknown> | undefined;
14
- selected?: boolean | undefined;
15
- } & SystemCommonProps & SxProp, never>;
16
- export declare type BreadcrumbItemProps = ComponentProps<typeof BreadcrumbItem>;
17
- declare const _default: typeof Breadcrumb & {
18
- Item: import("styled-components").StyledComponent<"a", any, {
19
- to?: History.LocationDescriptor<unknown> | undefined;
20
- selected?: boolean | undefined;
21
- } & SystemCommonProps & SxProp, never>;
22
- };
23
- export default _default;