@primer/components 0.0.0-202110320949 → 0.0.0-2021103211532
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/CHANGELOG.md +2 -2
- package/dist/browser.esm.js +3 -2
- package/dist/browser.esm.js.map +1 -1
- package/dist/browser.umd.js +3 -2
- package/dist/browser.umd.js.map +1 -1
- package/lib/Dropdown.d.ts +5 -4
- package/lib/Dropdown.js +3 -3
- package/lib/Pagination/Pagination.js +1 -1
- package/lib-esm/Dropdown.d.ts +5 -4
- package/lib-esm/Dropdown.js +4 -4
- package/lib-esm/Pagination/Pagination.js +2 -2
- package/package.json +1 -1
package/lib/Dropdown.d.ts
CHANGED
@@ -1,14 +1,15 @@
|
|
1
1
|
import React from 'react';
|
2
2
|
import { ButtonProps } from './Button';
|
3
|
+
import { SystemCommonProps } from './constants';
|
3
4
|
import { DetailsProps } from './Details';
|
4
5
|
import { SxProp } from './sx';
|
5
6
|
import { ComponentProps } from './utils/types';
|
6
7
|
export declare type DropdownProps = DetailsProps;
|
7
8
|
export declare type DropdownButtonProps = ButtonProps;
|
8
|
-
declare const DropdownCaret: import("styled-components").StyledComponent<"div", any, SxProp, never>;
|
9
|
+
declare const DropdownCaret: import("styled-components").StyledComponent<"div", any, SystemCommonProps & SxProp, never>;
|
9
10
|
declare const DropdownMenu: import("styled-components").StyledComponent<"ul", any, {
|
10
11
|
direction?: "s" | "ne" | "e" | "se" | "sw" | "w" | undefined;
|
11
|
-
} & SxProp, never>;
|
12
|
+
} & SystemCommonProps & SxProp, never>;
|
12
13
|
declare const DropdownItem: import("styled-components").StyledComponent<"li", any, SxProp, never>;
|
13
14
|
export declare type DropdownCaretProps = ComponentProps<typeof DropdownCaret>;
|
14
15
|
export declare type DropdownMenuProps = ComponentProps<typeof DropdownMenu>;
|
@@ -609,10 +610,10 @@ declare const _default: {
|
|
609
610
|
theme?: any;
|
610
611
|
}> | undefined;
|
611
612
|
} & {
|
612
|
-
Caret: import("styled-components").StyledComponent<"div", any, SxProp, never>;
|
613
|
+
Caret: import("styled-components").StyledComponent<"div", any, SystemCommonProps & SxProp, never>;
|
613
614
|
Menu: import("styled-components").StyledComponent<"ul", any, {
|
614
615
|
direction?: "s" | "ne" | "e" | "se" | "sw" | "w" | undefined;
|
615
|
-
} & SxProp, never>;
|
616
|
+
} & SystemCommonProps & SxProp, never>;
|
616
617
|
Item: import("styled-components").StyledComponent<"li", any, SxProp, never>;
|
617
618
|
Button: {
|
618
619
|
({ children, ...rest }: {
|
package/lib/Dropdown.js
CHANGED
@@ -62,17 +62,17 @@ DropdownButton.displayName = "DropdownButton";
|
|
62
62
|
const DropdownCaret = _styledComponents.default.div.withConfig({
|
63
63
|
displayName: "Dropdown__DropdownCaret",
|
64
64
|
componentId: "sc-16yoecj-1"
|
65
|
-
})(["border:4px solid transparent;margin-left:12px;border-top-color:currentcolor;border-bottom-width:0;content:'';display:inline-block;height:0;vertical-align:middle;width:0;", ";"], _sx.default);
|
65
|
+
})(["border:4px solid transparent;margin-left:12px;border-top-color:currentcolor;border-bottom-width:0;content:'';display:inline-block;height:0;vertical-align:middle;width:0;", ";", ";"], _constants.COMMON, _sx.default);
|
66
66
|
|
67
67
|
const DropdownMenu = _styledComponents.default.ul.withConfig({
|
68
68
|
displayName: "Dropdown__DropdownMenu",
|
69
69
|
componentId: "sc-16yoecj-2"
|
70
|
-
})(["background-clip:padding-box;background-color:", ";border:1px solid ", ";border-radius:", ";box-shadow:", ";left:0;list-style:none;margin-top:2px;padding:5px 0 5px 0 !important;position:absolute;top:100%;width:160px;z-index:100;&::before{position:absolute;display:inline-block;content:'';}&::after{position:absolute;display:inline-block;content:'';}&::before{border:8px solid transparent;border-bottom-color:", ";}&::after{border:7px solid transparent;border-bottom-color:", ";}> ul{list-style:none;}", ";", ";"], (0, _constants.get)('colors.canvas.overlay'), (0, _constants.get)('colors.border.default'), (0, _constants.get)('radii.2'), (0, _constants.get)('shadows.shadow.large'), (0, _constants.get)('colors.canvas.overlay'), (0, _constants.get)('colors.canvas.overlay'), props => props.direction ? (0, _DropdownStyles.default)(props.theme, props.direction) : '', _sx.default);
|
70
|
+
})(["background-clip:padding-box;background-color:", ";border:1px solid ", ";border-radius:", ";box-shadow:", ";left:0;list-style:none;margin-top:2px;padding:5px 0 5px 0 !important;position:absolute;top:100%;width:160px;z-index:100;&::before{position:absolute;display:inline-block;content:'';}&::after{position:absolute;display:inline-block;content:'';}&::before{border:8px solid transparent;border-bottom-color:", ";}&::after{border:7px solid transparent;border-bottom-color:", ";}> ul{list-style:none;}", ";", ";", ";"], (0, _constants.get)('colors.canvas.overlay'), (0, _constants.get)('colors.border.default'), (0, _constants.get)('radii.2'), (0, _constants.get)('shadows.shadow.large'), (0, _constants.get)('colors.canvas.overlay'), (0, _constants.get)('colors.canvas.overlay'), props => props.direction ? (0, _DropdownStyles.default)(props.theme, props.direction) : '', _constants.COMMON, _sx.default);
|
71
71
|
|
72
72
|
const DropdownItem = _styledComponents.default.li.withConfig({
|
73
73
|
displayName: "Dropdown__DropdownItem",
|
74
74
|
componentId: "sc-16yoecj-3"
|
75
|
-
})(["display:block;padding:", " 10px ", " 15px;overflow:hidden;color:", ";text-overflow:ellipsis;white-space:nowrap;a{color:", ";text-decoration:none;display:block;overflow:hidden;color:", ";text-overflow:ellipsis;white-space:nowrap;}&:focus,a:focus{color:", ";text-decoration:none;background-color:", ";}&:hover,&:hover a{color:", ";text-decoration:none;background-color:", ";outline:none;}", ";"], (0, _constants.get)('space.1'), (0, _constants.get)('space.1'), (0, _constants.get)('colors.fg.default'), (0, _constants.get)('colors.fg.default'), (0, _constants.get)('colors.fg.default'), (0, _constants.get)('colors.fg.onEmphasis'), (0, _constants.get)('colors.accent.emphasis'), (0, _constants.get)('colors.fg.onEmphasis'), (0, _constants.get)('colors.accent.emphasis'), _sx.default);
|
75
|
+
})(["display:block;padding:", " 10px ", " 15px;overflow:hidden;color:", ";text-overflow:ellipsis;white-space:nowrap;a{color:", ";text-decoration:none;display:block;overflow:hidden;color:", ";text-overflow:ellipsis;white-space:nowrap;}&:focus,a:focus{color:", ";text-decoration:none;background-color:", ";}&:hover,&:hover a{color:", ";text-decoration:none;background-color:", ";outline:none;}", ";", ";"], (0, _constants.get)('space.1'), (0, _constants.get)('space.1'), (0, _constants.get)('colors.fg.default'), (0, _constants.get)('colors.fg.default'), (0, _constants.get)('colors.fg.default'), (0, _constants.get)('colors.fg.onEmphasis'), (0, _constants.get)('colors.accent.emphasis'), (0, _constants.get)('colors.fg.onEmphasis'), (0, _constants.get)('colors.accent.emphasis'), _constants.COMMON, _sx.default);
|
76
76
|
|
77
77
|
DropdownMenu.defaultProps = {
|
78
78
|
direction: 'sw'
|
@@ -24,7 +24,7 @@ function _extends() { _extends = Object.assign || function (target) { for (var i
|
|
24
24
|
const Page = _styledComponents.default.a.withConfig({
|
25
25
|
displayName: "Pagination__Page",
|
26
26
|
componentId: "b80nss-0"
|
27
|
-
})(["display:inline-block;min-width:32px;padding:5px 10px;font-style:normal;line-height:20px;color:", ";text-align:center;white-space:nowrap;vertical-align:middle;cursor:pointer;user-select:none;text-decoration:none;margin-right:", ";&:last-child{margin-right:0;}border:", " solid transparent;border-radius:", ";transition:border-color 0.2s cubic-bezier(0.3,0,0.5,1);&:hover,&:focus{text-decoration:none;border-color:", ";outline:0;transition-duration:0.1s;}&:active{border-color:", ";}&[rel='prev'],&[rel='next']{color:", ";}&[aria-current],&[aria-current]:hover{color:", ";background-color:", ";border-color:transparent;}&[aria-disabled],&[aria-disabled]:hover{color:", ";cursor:default;border-color:transparent;}@supports (clip-path:polygon(50% 0,100% 50%,50% 100%)){&[rel='prev']::before,&[rel='next']::after{display:inline-block;width:16px;height:16px;vertical-align:text-bottom;content:'';background-color:currentColor;}&[rel='prev']::before{margin-right:", ";clip-path:polygon( 9.8px 12.8px,8.7px 12.8px,4.5px 8.5px,4.5px 7.5px,8.7px 3.2px,9.8px 4.3px,6.1px 8px,9.8px 11.7px,9.8px 12.8px );}&[rel='next']::after{margin-left:", ";clip-path:polygon( 6.2px 3.2px,7.3px 3.2px,11.5px 7.5px,11.5px 8.5px,7.3px 12.8px,6.2px 11.7px,9.9px 8px,6.2px 4.3px,6.2px 3.2px );}}"
|
27
|
+
})(["display:inline-block;min-width:32px;padding:5px 10px;font-style:normal;line-height:20px;color:", ";text-align:center;white-space:nowrap;vertical-align:middle;cursor:pointer;user-select:none;text-decoration:none;margin-right:", ";&:last-child{margin-right:0;}border:", " solid transparent;border-radius:", ";transition:border-color 0.2s cubic-bezier(0.3,0,0.5,1);&:hover,&:focus{text-decoration:none;border-color:", ";outline:0;transition-duration:0.1s;}&:active{border-color:", ";}&[rel='prev'],&[rel='next']{color:", ";}&[aria-current],&[aria-current]:hover{color:", ";background-color:", ";border-color:transparent;}&[aria-disabled],&[aria-disabled]:hover{color:", ";cursor:default;border-color:transparent;}@supports (clip-path:polygon(50% 0,100% 50%,50% 100%)){&[rel='prev']::before,&[rel='next']::after{display:inline-block;width:16px;height:16px;vertical-align:text-bottom;content:'';background-color:currentColor;}&[rel='prev']::before{margin-right:", ";clip-path:polygon( 9.8px 12.8px,8.7px 12.8px,4.5px 8.5px,4.5px 7.5px,8.7px 3.2px,9.8px 4.3px,6.1px 8px,9.8px 11.7px,9.8px 12.8px );}&[rel='next']::after{margin-left:", ";clip-path:polygon( 6.2px 3.2px,7.3px 3.2px,11.5px 7.5px,11.5px 8.5px,7.3px 12.8px,6.2px 11.7px,9.9px 8px,6.2px 4.3px,6.2px 3.2px );}}"], (0, _constants.get)('colors.fg.default'), (0, _constants.get)('space.1'), (0, _constants.get)('borderWidths.1'), (0, _constants.get)('radii.2'), (0, _constants.get)('colors.border.default'), (0, _constants.get)('colors.border.muted'), (0, _constants.get)('colors.accent.fg'), (0, _constants.get)('colors.fg.onEmphasis'), (0, _constants.get)('colors.accent.emphasis'), (0, _constants.get)('colors.primer.fg.disabled'), (0, _constants.get)('space.1'), (0, _constants.get)('space.1'));
|
28
28
|
|
29
29
|
function usePaginationPages({
|
30
30
|
theme,
|
package/lib-esm/Dropdown.d.ts
CHANGED
@@ -1,14 +1,15 @@
|
|
1
1
|
import React from 'react';
|
2
2
|
import { ButtonProps } from './Button';
|
3
|
+
import { SystemCommonProps } from './constants';
|
3
4
|
import { DetailsProps } from './Details';
|
4
5
|
import { SxProp } from './sx';
|
5
6
|
import { ComponentProps } from './utils/types';
|
6
7
|
export declare type DropdownProps = DetailsProps;
|
7
8
|
export declare type DropdownButtonProps = ButtonProps;
|
8
|
-
declare const DropdownCaret: import("styled-components").StyledComponent<"div", any, SxProp, never>;
|
9
|
+
declare const DropdownCaret: import("styled-components").StyledComponent<"div", any, SystemCommonProps & SxProp, never>;
|
9
10
|
declare const DropdownMenu: import("styled-components").StyledComponent<"ul", any, {
|
10
11
|
direction?: "s" | "ne" | "e" | "se" | "sw" | "w" | undefined;
|
11
|
-
} & SxProp, never>;
|
12
|
+
} & SystemCommonProps & SxProp, never>;
|
12
13
|
declare const DropdownItem: import("styled-components").StyledComponent<"li", any, SxProp, never>;
|
13
14
|
export declare type DropdownCaretProps = ComponentProps<typeof DropdownCaret>;
|
14
15
|
export declare type DropdownMenuProps = ComponentProps<typeof DropdownMenu>;
|
@@ -609,10 +610,10 @@ declare const _default: {
|
|
609
610
|
theme?: any;
|
610
611
|
}> | undefined;
|
611
612
|
} & {
|
612
|
-
Caret: import("styled-components").StyledComponent<"div", any, SxProp, never>;
|
613
|
+
Caret: import("styled-components").StyledComponent<"div", any, SystemCommonProps & SxProp, never>;
|
613
614
|
Menu: import("styled-components").StyledComponent<"ul", any, {
|
614
615
|
direction?: "s" | "ne" | "e" | "se" | "sw" | "w" | undefined;
|
615
|
-
} & SxProp, never>;
|
616
|
+
} & SystemCommonProps & SxProp, never>;
|
616
617
|
Item: import("styled-components").StyledComponent<"li", any, SxProp, never>;
|
617
618
|
Button: {
|
618
619
|
({ children, ...rest }: {
|
package/lib-esm/Dropdown.js
CHANGED
@@ -3,7 +3,7 @@ function _extends() { _extends = Object.assign || function (target) { for (var i
|
|
3
3
|
import React from 'react';
|
4
4
|
import styled from 'styled-components';
|
5
5
|
import Button from './Button';
|
6
|
-
import { get } from './constants';
|
6
|
+
import { COMMON, get } from './constants';
|
7
7
|
import Details from './Details';
|
8
8
|
import getDirectionStyles from './DropdownStyles';
|
9
9
|
import useDetails from './hooks/useDetails';
|
@@ -44,15 +44,15 @@ DropdownButton.displayName = "DropdownButton";
|
|
44
44
|
const DropdownCaret = styled.div.withConfig({
|
45
45
|
displayName: "Dropdown__DropdownCaret",
|
46
46
|
componentId: "sc-16yoecj-1"
|
47
|
-
})(["border:4px solid transparent;margin-left:12px;border-top-color:currentcolor;border-bottom-width:0;content:'';display:inline-block;height:0;vertical-align:middle;width:0;", ";"], sx);
|
47
|
+
})(["border:4px solid transparent;margin-left:12px;border-top-color:currentcolor;border-bottom-width:0;content:'';display:inline-block;height:0;vertical-align:middle;width:0;", ";", ";"], COMMON, sx);
|
48
48
|
const DropdownMenu = styled.ul.withConfig({
|
49
49
|
displayName: "Dropdown__DropdownMenu",
|
50
50
|
componentId: "sc-16yoecj-2"
|
51
|
-
})(["background-clip:padding-box;background-color:", ";border:1px solid ", ";border-radius:", ";box-shadow:", ";left:0;list-style:none;margin-top:2px;padding:5px 0 5px 0 !important;position:absolute;top:100%;width:160px;z-index:100;&::before{position:absolute;display:inline-block;content:'';}&::after{position:absolute;display:inline-block;content:'';}&::before{border:8px solid transparent;border-bottom-color:", ";}&::after{border:7px solid transparent;border-bottom-color:", ";}> ul{list-style:none;}", ";", ";"], get('colors.canvas.overlay'), get('colors.border.default'), get('radii.2'), get('shadows.shadow.large'), get('colors.canvas.overlay'), get('colors.canvas.overlay'), props => props.direction ? getDirectionStyles(props.theme, props.direction) : '', sx);
|
51
|
+
})(["background-clip:padding-box;background-color:", ";border:1px solid ", ";border-radius:", ";box-shadow:", ";left:0;list-style:none;margin-top:2px;padding:5px 0 5px 0 !important;position:absolute;top:100%;width:160px;z-index:100;&::before{position:absolute;display:inline-block;content:'';}&::after{position:absolute;display:inline-block;content:'';}&::before{border:8px solid transparent;border-bottom-color:", ";}&::after{border:7px solid transparent;border-bottom-color:", ";}> ul{list-style:none;}", ";", ";", ";"], get('colors.canvas.overlay'), get('colors.border.default'), get('radii.2'), get('shadows.shadow.large'), get('colors.canvas.overlay'), get('colors.canvas.overlay'), props => props.direction ? getDirectionStyles(props.theme, props.direction) : '', COMMON, sx);
|
52
52
|
const DropdownItem = styled.li.withConfig({
|
53
53
|
displayName: "Dropdown__DropdownItem",
|
54
54
|
componentId: "sc-16yoecj-3"
|
55
|
-
})(["display:block;padding:", " 10px ", " 15px;overflow:hidden;color:", ";text-overflow:ellipsis;white-space:nowrap;a{color:", ";text-decoration:none;display:block;overflow:hidden;color:", ";text-overflow:ellipsis;white-space:nowrap;}&:focus,a:focus{color:", ";text-decoration:none;background-color:", ";}&:hover,&:hover a{color:", ";text-decoration:none;background-color:", ";outline:none;}", ";"], get('space.1'), get('space.1'), get('colors.fg.default'), get('colors.fg.default'), get('colors.fg.default'), get('colors.fg.onEmphasis'), get('colors.accent.emphasis'), get('colors.fg.onEmphasis'), get('colors.accent.emphasis'), sx);
|
55
|
+
})(["display:block;padding:", " 10px ", " 15px;overflow:hidden;color:", ";text-overflow:ellipsis;white-space:nowrap;a{color:", ";text-decoration:none;display:block;overflow:hidden;color:", ";text-overflow:ellipsis;white-space:nowrap;}&:focus,a:focus{color:", ";text-decoration:none;background-color:", ";}&:hover,&:hover a{color:", ";text-decoration:none;background-color:", ";outline:none;}", ";", ";"], get('space.1'), get('space.1'), get('colors.fg.default'), get('colors.fg.default'), get('colors.fg.default'), get('colors.fg.onEmphasis'), get('colors.accent.emphasis'), get('colors.fg.onEmphasis'), get('colors.accent.emphasis'), COMMON, sx);
|
56
56
|
DropdownMenu.defaultProps = {
|
57
57
|
direction: 'sw'
|
58
58
|
};
|
@@ -3,13 +3,13 @@ function _extends() { _extends = Object.assign || function (target) { for (var i
|
|
3
3
|
import React from 'react';
|
4
4
|
import styled from 'styled-components';
|
5
5
|
import Box from '../Box';
|
6
|
-
import {
|
6
|
+
import { get } from '../constants';
|
7
7
|
import sx from '../sx';
|
8
8
|
import { buildComponentData, buildPaginationModel } from './model';
|
9
9
|
const Page = styled.a.withConfig({
|
10
10
|
displayName: "Pagination__Page",
|
11
11
|
componentId: "b80nss-0"
|
12
|
-
})(["display:inline-block;min-width:32px;padding:5px 10px;font-style:normal;line-height:20px;color:", ";text-align:center;white-space:nowrap;vertical-align:middle;cursor:pointer;user-select:none;text-decoration:none;margin-right:", ";&:last-child{margin-right:0;}border:", " solid transparent;border-radius:", ";transition:border-color 0.2s cubic-bezier(0.3,0,0.5,1);&:hover,&:focus{text-decoration:none;border-color:", ";outline:0;transition-duration:0.1s;}&:active{border-color:", ";}&[rel='prev'],&[rel='next']{color:", ";}&[aria-current],&[aria-current]:hover{color:", ";background-color:", ";border-color:transparent;}&[aria-disabled],&[aria-disabled]:hover{color:", ";cursor:default;border-color:transparent;}@supports (clip-path:polygon(50% 0,100% 50%,50% 100%)){&[rel='prev']::before,&[rel='next']::after{display:inline-block;width:16px;height:16px;vertical-align:text-bottom;content:'';background-color:currentColor;}&[rel='prev']::before{margin-right:", ";clip-path:polygon( 9.8px 12.8px,8.7px 12.8px,4.5px 8.5px,4.5px 7.5px,8.7px 3.2px,9.8px 4.3px,6.1px 8px,9.8px 11.7px,9.8px 12.8px );}&[rel='next']::after{margin-left:", ";clip-path:polygon( 6.2px 3.2px,7.3px 3.2px,11.5px 7.5px,11.5px 8.5px,7.3px 12.8px,6.2px 11.7px,9.9px 8px,6.2px 4.3px,6.2px 3.2px );}}"
|
12
|
+
})(["display:inline-block;min-width:32px;padding:5px 10px;font-style:normal;line-height:20px;color:", ";text-align:center;white-space:nowrap;vertical-align:middle;cursor:pointer;user-select:none;text-decoration:none;margin-right:", ";&:last-child{margin-right:0;}border:", " solid transparent;border-radius:", ";transition:border-color 0.2s cubic-bezier(0.3,0,0.5,1);&:hover,&:focus{text-decoration:none;border-color:", ";outline:0;transition-duration:0.1s;}&:active{border-color:", ";}&[rel='prev'],&[rel='next']{color:", ";}&[aria-current],&[aria-current]:hover{color:", ";background-color:", ";border-color:transparent;}&[aria-disabled],&[aria-disabled]:hover{color:", ";cursor:default;border-color:transparent;}@supports (clip-path:polygon(50% 0,100% 50%,50% 100%)){&[rel='prev']::before,&[rel='next']::after{display:inline-block;width:16px;height:16px;vertical-align:text-bottom;content:'';background-color:currentColor;}&[rel='prev']::before{margin-right:", ";clip-path:polygon( 9.8px 12.8px,8.7px 12.8px,4.5px 8.5px,4.5px 7.5px,8.7px 3.2px,9.8px 4.3px,6.1px 8px,9.8px 11.7px,9.8px 12.8px );}&[rel='next']::after{margin-left:", ";clip-path:polygon( 6.2px 3.2px,7.3px 3.2px,11.5px 7.5px,11.5px 8.5px,7.3px 12.8px,6.2px 11.7px,9.9px 8px,6.2px 4.3px,6.2px 3.2px );}}"], get('colors.fg.default'), get('space.1'), get('borderWidths.1'), get('radii.2'), get('colors.border.default'), get('colors.border.muted'), get('colors.accent.fg'), get('colors.fg.onEmphasis'), get('colors.accent.emphasis'), get('colors.primer.fg.disabled'), get('space.1'), get('space.1'));
|
13
13
|
|
14
14
|
function usePaginationPages({
|
15
15
|
theme,
|