@primer/components 0.0.0-202110417386 → 0.0.0-202110871242

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.
Files changed (34) hide show
  1. package/CHANGELOG.md +5 -3
  2. package/dist/browser.esm.js +176 -176
  3. package/dist/browser.esm.js.map +1 -1
  4. package/dist/browser.umd.js +187 -187
  5. package/dist/browser.umd.js.map +1 -1
  6. package/lib/Overlay.js +3 -1
  7. package/lib/Portal/Portal.js +3 -2
  8. package/lib/hooks/useAnchoredPosition.js +3 -2
  9. package/lib/hooks/useCombinedRefs.d.ts +2 -2
  10. package/lib/hooks/useCombinedRefs.js +3 -7
  11. package/lib/hooks/useResizeObserver.js +2 -4
  12. package/lib/utils/useIsomorphicLayoutEffect.d.ts +2 -0
  13. package/lib/utils/useIsomorphicLayoutEffect.js +14 -0
  14. package/lib-esm/Overlay.js +2 -1
  15. package/lib-esm/Portal/Portal.js +2 -1
  16. package/lib-esm/hooks/useAnchoredPosition.js +2 -1
  17. package/lib-esm/hooks/useCombinedRefs.d.ts +2 -2
  18. package/lib-esm/hooks/useCombinedRefs.js +3 -2
  19. package/lib-esm/hooks/useResizeObserver.js +2 -2
  20. package/lib-esm/utils/useIsomorphicLayoutEffect.d.ts +2 -0
  21. package/lib-esm/utils/useIsomorphicLayoutEffect.js +4 -0
  22. package/package.json +1 -1
  23. package/lib/NewLabel/NewLabel.d.ts +0 -11
  24. package/lib/NewLabel/NewLabel.js +0 -134
  25. package/lib/NewLabel/NewStateLabel.d.ts +0 -10
  26. package/lib/NewLabel/NewStateLabel.js +0 -49
  27. package/lib/NewLabel/_newLabelStyleUtils.d.ts +0 -3
  28. package/lib/NewLabel/_newLabelStyleUtils.js +0 -40
  29. package/lib-esm/NewLabel/NewLabel.d.ts +0 -11
  30. package/lib-esm/NewLabel/NewLabel.js +0 -115
  31. package/lib-esm/NewLabel/NewStateLabel.d.ts +0 -10
  32. package/lib-esm/NewLabel/NewStateLabel.js +0 -36
  33. package/lib-esm/NewLabel/_newLabelStyleUtils.d.ts +0 -3
  34. package/lib-esm/NewLabel/_newLabelStyleUtils.js +0 -30
@@ -1,36 +0,0 @@
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
- import React from 'react';
4
- import { GitMergeIcon, GitPullRequestIcon, IssueClosedIcon, IssueOpenedIcon } from '@primer/octicons-react';
5
- import NewLabel from './NewLabel';
6
- const colorMap = {
7
- issueClosed: 'done',
8
- pullClosed: 'done',
9
- pullMerged: 'done',
10
- issueOpened: 'success',
11
- pullOpened: 'success',
12
- draft: 'primary'
13
- };
14
- const octiconMap = {
15
- issueOpened: IssueOpenedIcon,
16
- pullOpened: GitPullRequestIcon,
17
- issueClosed: IssueClosedIcon,
18
- pullClosed: GitPullRequestIcon,
19
- pullMerged: GitMergeIcon,
20
- draft: GitPullRequestIcon
21
- };
22
-
23
- const NewStateLabel = ({
24
- status,
25
- ...rest
26
- }) => /*#__PURE__*/React.createElement(NewLabel, _extends({
27
- filled: true,
28
- color: colorMap[status],
29
- leadingVisual: octiconMap[status]
30
- }, rest));
31
-
32
- NewStateLabel.displayName = "NewStateLabel";
33
- NewStateLabel.defaultProps = {
34
- size: 'lg'
35
- };
36
- export default NewStateLabel;
@@ -1,3 +0,0 @@
1
- export declare type LabelSizeKeys = 'sm' | 'md' | 'lg';
2
- export declare const badgeSizes: Record<LabelSizeKeys, number>;
3
- export declare const labelVariants: (...args: any[]) => any;
@@ -1,30 +0,0 @@
1
- import { variant } from 'styled-system';
2
- // TODO: consider moving to Primitives
3
- export const badgeSizes = {
4
- sm: 20,
5
- md: 24,
6
- lg: 32
7
- };
8
- export const labelVariants = variant({
9
- prop: 'size',
10
- variants: {
11
- sm: {
12
- fontSize: 0,
13
- height: `${badgeSizes.sm}px`,
14
- paddingLeft: 2,
15
- paddingRight: 2
16
- },
17
- md: {
18
- fontSize: 0,
19
- height: `${badgeSizes.md}px`,
20
- paddingLeft: 2,
21
- paddingRight: 2
22
- },
23
- lg: {
24
- fontSize: 1,
25
- height: `${badgeSizes.lg}px`,
26
- paddingLeft: 3,
27
- paddingRight: 3
28
- }
29
- }
30
- });