@primer/components 0.0.0-2021103213523 → 0.0.0-2021103221942
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 +12 -5
- package/dist/browser.esm.js.map +1 -1
- package/dist/browser.umd.js +12 -5
- package/dist/browser.umd.js.map +1 -1
- package/lib/Popover.d.ts +5 -4
- package/lib/Popover.js +5 -4
- package/lib/SubNav.d.ts +5 -11
- package/lib/SubNav.js +7 -12
- package/lib-esm/Popover.d.ts +5 -4
- package/lib-esm/Popover.js +5 -4
- package/lib-esm/SubNav.d.ts +5 -11
- package/lib-esm/SubNav.js +8 -13
- package/package.json +1 -1
package/lib/Popover.d.ts
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
/// <reference types="hoist-non-react-statics" />
|
2
|
+
import { SystemCommonProps, SystemLayoutProps, SystemPositionProps } from './constants';
|
2
3
|
import { SxProp } from './sx';
|
3
4
|
import { ComponentProps } from './utils/types';
|
4
5
|
declare type CaretPosition = 'top' | 'bottom' | 'left' | 'right' | 'bottom-left' | 'bottom-right' | 'top-left' | 'top-right' | 'left-bottom' | 'left-top' | 'right-bottom' | 'right-top';
|
@@ -6,15 +7,15 @@ declare const Popover: import("styled-components").StyledComponent<"div", any, {
|
|
6
7
|
caret?: CaretPosition | undefined;
|
7
8
|
relative?: boolean | undefined;
|
8
9
|
open?: boolean | undefined;
|
9
|
-
} & SxProp, never>;
|
10
|
-
declare const PopoverContent: import("styled-components").StyledComponent<"div", any, SxProp, never>;
|
10
|
+
} & SystemCommonProps & SystemLayoutProps & SystemPositionProps & SxProp, never>;
|
11
|
+
declare const PopoverContent: import("styled-components").StyledComponent<"div", any, import("styled-system").SpaceProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>, string | number | symbol> & import("styled-system").ColorProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>, string | number | symbol> & import("styled-system").TypographyProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> & import("styled-system").LayoutProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> & import("styled-system").FlexboxProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> & import("styled-system").GridProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> & import("styled-system").BackgroundProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>, import("csstype").Property.Background<import("styled-system").TLengthStyledSystem>> & import("styled-system").BorderProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>, import("csstype").Property.Border<import("styled-system").TLengthStyledSystem>> & import("styled-system").PositionProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> & import("styled-system").ShadowProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> & SxProp, never>;
|
11
12
|
export declare type PopoverProps = ComponentProps<typeof Popover>;
|
12
13
|
export declare type PopoverContentProps = ComponentProps<typeof PopoverContent>;
|
13
14
|
declare const _default: string & import("styled-components").StyledComponentBase<"div", any, {
|
14
15
|
caret?: CaretPosition | undefined;
|
15
16
|
relative?: boolean | undefined;
|
16
17
|
open?: boolean | undefined;
|
17
|
-
} & SxProp, never> & import("hoist-non-react-statics").NonReactStatics<never, {}> & {
|
18
|
-
Content: import("styled-components").StyledComponent<"div", any, SxProp, never>;
|
18
|
+
} & SystemCommonProps & SystemLayoutProps & SystemPositionProps & SxProp, never> & import("hoist-non-react-statics").NonReactStatics<never, {}> & {
|
19
|
+
Content: import("styled-components").StyledComponent<"div", any, import("styled-system").SpaceProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>, string | number | symbol> & import("styled-system").ColorProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>, string | number | symbol> & import("styled-system").TypographyProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> & import("styled-system").LayoutProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> & import("styled-system").FlexboxProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> & import("styled-system").GridProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> & import("styled-system").BackgroundProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>, import("csstype").Property.Background<import("styled-system").TLengthStyledSystem>> & import("styled-system").BorderProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>, import("csstype").Property.Border<import("styled-system").TLengthStyledSystem>> & import("styled-system").PositionProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> & import("styled-system").ShadowProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> & SxProp, never>;
|
19
20
|
};
|
20
21
|
export default _default;
|
package/lib/Popover.js
CHANGED
@@ -9,6 +9,8 @@ var _classnames = _interopRequireDefault(require("classnames"));
|
|
9
9
|
|
10
10
|
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
11
11
|
|
12
|
+
var _Box = _interopRequireDefault(require("./Box"));
|
13
|
+
|
12
14
|
var _constants = require("./constants");
|
13
15
|
|
14
16
|
var _sx = _interopRequireDefault(require("./sx"));
|
@@ -25,13 +27,12 @@ const Popover = _styledComponents.default.div.attrs(({
|
|
25
27
|
}).withConfig({
|
26
28
|
displayName: "Popover",
|
27
29
|
componentId: "sc-1nxygy2-0"
|
28
|
-
})(["position:", ";z-index:100;display:", ";", ";"], props => props.relative ? 'relative' : 'absolute', props => props.open ? 'block' : 'none', _sx.default);
|
30
|
+
})(["position:", ";z-index:100;display:", ";", ";", ";", ";", ";"], props => props.relative ? 'relative' : 'absolute', props => props.open ? 'block' : 'none', _constants.COMMON, _constants.LAYOUT, _constants.POSITION, _sx.default);
|
29
31
|
|
30
|
-
const PopoverContent = _styledComponents.default.
|
32
|
+
const PopoverContent = (0, _styledComponents.default)(_Box.default).withConfig({
|
31
33
|
displayName: "Popover__PopoverContent",
|
32
34
|
componentId: "sc-1nxygy2-1"
|
33
|
-
})(["border:1px solid ", ";border-radius:", ";position:relative;width:232px;margin-right:auto;margin-left:auto;padding:", ";background-color:", ";&::before,&::after{position:absolute;left:50%;display:inline-block;content:'';}&::before{top:-", ";margin-left:-9px;border:", " solid transparent;border-bottom-color:", ";}&::after{top:-14px;margin-left:-", ";border:7px solid transparent;border-bottom-color:", ";}", ".caret-pos--bottom &,", ".caret-pos--bottom-right &,", ".caret-pos--bottom-left &{&::before,&::after{top:auto;border-bottom-color:transparent;}&::before{bottom:-", ";border-top-color:", ";}&::after{bottom:-14px;border-top-color:", ";}}", ".caret-pos--top-right &,", ".caret-pos--bottom-right &{right:-9px;margin-right:0;&::before,&::after{left:auto;margin-left:0;}&::before{right:20px;}&::after{right:21px;}}", ".caret-pos--top-left &,", ".caret-pos--bottom-left &{left:-9px;margin-left:0;&::before,&::after{left:", ";margin-left:0;}&::after{left:calc(", " + 1px);}}", ".caret-pos--right &,", ".caret-pos--right-top &,", ".caret-pos--right-bottom &,", ".caret-pos--left &,", ".caret-pos--left-top &,", ".caret-pos--left-bottom &{&::before,&::after{top:50%;left:auto;margin-left:0;border-bottom-color:transparent;}&::before{margin-top:calc((", " + 1px) * -1);}&::after{margin-top:-", ";}}", ".caret-pos--right &,", ".caret-pos--right-top &,", ".caret-pos--right-bottom &{&::before{right:-", ";border-left-color:", ";}&::after{right:-14px;border-left-color:", ";}}", ".caret-pos--left &,", ".caret-pos--left-top &,", ".caret-pos--left-bottom &{&::before{left:-", ";border-right-color:", ";}&::after{left:-14px;border-right-color:", ";}}", ".caret-pos--right-top &,", ".caret-pos--left-top &{&::before,&::after{top:", ";}}", ".caret-pos--right-bottom &,", ".caret-pos--left-bottom &{&::before,&::after{top:auto;}&::before{bottom:", ";}&::after{bottom:calc(", " + 1px);}}", ";"], (0, _constants.get)('colors.border.default'), (0, _constants.get)('radii.2'), (0, _constants.get)('space.4'), (0, _constants.get)('colors.canvas.overlay'), (0, _constants.get)('space.3'), (0, _constants.get)('space.2'), (0, _constants.get)('colors.border.default'), (0, _constants.get)('space.2'), (0, _constants.get)('colors.canvas.overlay'), Popover, Popover, Popover, (0, _constants.get)('space.3'), (0, _constants.get)('colors.border.default'), (0, _constants.get)('colors.canvas.overlay'), Popover, Popover, Popover, Popover, (0, _constants.get)('space.4'), (0, _constants.get)('space.4'), Popover, Popover, Popover, Popover, Popover, Popover, (0, _constants.get)('space.2'), (0, _constants.get)('space.2'), Popover, Popover, Popover, (0, _constants.get)('space.3'), (0, _constants.get)('colors.border.default'), (0, _constants.get)('colors.canvas.overlay'), Popover, Popover, Popover, (0, _constants.get)('space.3'), (0, _constants.get)('colors.border.default'), (0, _constants.get)('colors.canvas.overlay'), Popover, Popover, (0, _constants.get)('space.4'), Popover, Popover, (0, _constants.get)('space.3'), (0, _constants.get)('space.3'), _sx.default);
|
34
|
-
|
35
|
+
})(["border:1px solid ", ";border-radius:", ";position:relative;width:232px;margin-right:auto;margin-left:auto;padding:", ";background-color:", ";", ";", ";&::before,&::after{position:absolute;left:50%;display:inline-block;content:'';}&::before{top:-", ";margin-left:-9px;border:", " solid transparent;border-bottom-color:", ";}&::after{top:-14px;margin-left:-", ";border:7px solid transparent;border-bottom-color:", ";}", ".caret-pos--bottom &,", ".caret-pos--bottom-right &,", ".caret-pos--bottom-left &{&::before,&::after{top:auto;border-bottom-color:transparent;}&::before{bottom:-", ";border-top-color:", ";}&::after{bottom:-14px;border-top-color:", ";}}", ".caret-pos--top-right &,", ".caret-pos--bottom-right &{right:-9px;margin-right:0;&::before,&::after{left:auto;margin-left:0;}&::before{right:20px;}&::after{right:21px;}}", ".caret-pos--top-left &,", ".caret-pos--bottom-left &{left:-9px;margin-left:0;&::before,&::after{left:", ";margin-left:0;}&::after{left:calc(", " + 1px);}}", ".caret-pos--right &,", ".caret-pos--right-top &,", ".caret-pos--right-bottom &,", ".caret-pos--left &,", ".caret-pos--left-top &,", ".caret-pos--left-bottom &{&::before,&::after{top:50%;left:auto;margin-left:0;border-bottom-color:transparent;}&::before{margin-top:calc((", " + 1px) * -1);}&::after{margin-top:-", ";}}", ".caret-pos--right &,", ".caret-pos--right-top &,", ".caret-pos--right-bottom &{&::before{right:-", ";border-left-color:", ";}&::after{right:-14px;border-left-color:", ";}}", ".caret-pos--left &,", ".caret-pos--left-top &,", ".caret-pos--left-bottom &{&::before{left:-", ";border-right-color:", ";}&::after{left:-14px;border-right-color:", ";}}", ".caret-pos--right-top &,", ".caret-pos--left-top &{&::before,&::after{top:", ";}}", ".caret-pos--right-bottom &,", ".caret-pos--left-bottom &{&::before,&::after{top:auto;}&::before{bottom:", ";}&::after{bottom:calc(", " + 1px);}}", ";"], (0, _constants.get)('colors.border.default'), (0, _constants.get)('radii.2'), (0, _constants.get)('space.4'), (0, _constants.get)('colors.canvas.overlay'), _constants.COMMON, _constants.LAYOUT, (0, _constants.get)('space.3'), (0, _constants.get)('space.2'), (0, _constants.get)('colors.border.default'), (0, _constants.get)('space.2'), (0, _constants.get)('colors.canvas.overlay'), Popover, Popover, Popover, (0, _constants.get)('space.3'), (0, _constants.get)('colors.border.default'), (0, _constants.get)('colors.canvas.overlay'), Popover, Popover, Popover, Popover, (0, _constants.get)('space.4'), (0, _constants.get)('space.4'), Popover, Popover, Popover, Popover, Popover, Popover, (0, _constants.get)('space.2'), (0, _constants.get)('space.2'), Popover, Popover, Popover, (0, _constants.get)('space.3'), (0, _constants.get)('colors.border.default'), (0, _constants.get)('colors.canvas.overlay'), Popover, Popover, Popover, (0, _constants.get)('space.3'), (0, _constants.get)('colors.border.default'), (0, _constants.get)('colors.canvas.overlay'), Popover, Popover, (0, _constants.get)('space.4'), Popover, Popover, (0, _constants.get)('space.3'), (0, _constants.get)('space.3'), _sx.default);
|
35
36
|
Popover.defaultProps = {
|
36
37
|
caret: 'top'
|
37
38
|
};
|
package/lib/SubNav.d.ts
CHANGED
@@ -1,10 +1,8 @@
|
|
1
1
|
import * as History from 'history';
|
2
2
|
import React from 'react';
|
3
|
-
import { SystemBorderProps, SystemCommonProps, SystemFlexProps } from './constants';
|
4
|
-
import { BoxProps } from './Box';
|
5
3
|
import { SxProp } from './sx';
|
6
4
|
import { ComponentProps } from './utils/types';
|
7
|
-
declare const SubNavBase: import("styled-components").StyledComponent<"nav", any,
|
5
|
+
declare const SubNavBase: import("styled-components").StyledComponent<"nav", any, SxProp, never>;
|
8
6
|
export declare type SubNavProps = {
|
9
7
|
actions?: React.ReactNode;
|
10
8
|
align?: 'right';
|
@@ -12,21 +10,17 @@ export declare type SubNavProps = {
|
|
12
10
|
label?: string;
|
13
11
|
} & ComponentProps<typeof SubNavBase>;
|
14
12
|
declare function SubNav({ actions, className, children, label, ...rest }: SubNavProps): JSX.Element;
|
15
|
-
export declare type SubNavLinksProps =
|
16
|
-
declare function SubNavLinks(props: SubNavLinksProps): JSX.Element;
|
17
|
-
declare namespace SubNavLinks {
|
18
|
-
var displayName: string;
|
19
|
-
}
|
13
|
+
export declare type SubNavLinksProps = SxProp;
|
20
14
|
declare const SubNavLink: import("styled-components").StyledComponent<"a", any, {
|
21
15
|
to?: History.LocationDescriptor<unknown> | undefined;
|
22
16
|
selected?: boolean | undefined;
|
23
|
-
} &
|
17
|
+
} & SxProp, never>;
|
24
18
|
export declare type SubNavLinkProps = ComponentProps<typeof SubNavLink>;
|
25
19
|
declare const _default: typeof SubNav & {
|
26
20
|
Link: import("styled-components").StyledComponent<"a", any, {
|
27
21
|
to?: History.LocationDescriptor<unknown> | undefined;
|
28
22
|
selected?: boolean | undefined;
|
29
|
-
} &
|
30
|
-
Links:
|
23
|
+
} & SxProp, never>;
|
24
|
+
Links: import("styled-components").StyledComponent<"div", any, SxProp, never>;
|
31
25
|
};
|
32
26
|
export default _default;
|
package/lib/SubNav.js
CHANGED
@@ -13,8 +13,6 @@ var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
13
13
|
|
14
14
|
var _constants = require("./constants");
|
15
15
|
|
16
|
-
var _Box = _interopRequireDefault(require("./Box"));
|
17
|
-
|
18
16
|
var _sx = _interopRequireDefault(require("./sx"));
|
19
17
|
|
20
18
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
@@ -27,7 +25,7 @@ const SELECTED_CLASS = 'selected';
|
|
27
25
|
const SubNavBase = _styledComponents.default.nav.withConfig({
|
28
26
|
displayName: "SubNav__SubNavBase",
|
29
27
|
componentId: "f7w0xa-0"
|
30
|
-
})(["display:flex;justify-content:space-between;.SubNav-body{display:flex;margin-bottom:-1px;> *{margin-left:", ";}> *:first-child{margin-left:0;}}.SubNav-actions{align-self:center;}", ";"
|
28
|
+
})(["display:flex;justify-content:space-between;.SubNav-body{display:flex;margin-bottom:-1px;> *{margin-left:", ";}> *:first-child{margin-left:0;}}.SubNav-actions{align-self:center;}", ";"], (0, _constants.get)('space.2'), _sx.default);
|
31
29
|
|
32
30
|
function SubNav({
|
33
31
|
actions,
|
@@ -49,21 +47,18 @@ function SubNav({
|
|
49
47
|
|
50
48
|
SubNav.displayName = "SubNav";
|
51
49
|
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
}
|
57
|
-
|
58
|
-
SubNavLinks.displayName = "SubNavLinks";
|
50
|
+
const SubNavLinks = _styledComponents.default.div.withConfig({
|
51
|
+
displayName: "SubNav__SubNavLinks",
|
52
|
+
componentId: "f7w0xa-1"
|
53
|
+
})(["display:flex;", ";"], _sx.default);
|
59
54
|
|
60
55
|
const SubNavLink = _styledComponents.default.a.attrs(props => ({
|
61
56
|
activeClassName: typeof props.to === 'string' ? 'selected' : '',
|
62
57
|
className: (0, _classnames.default)(ITEM_CLASS, props.selected && SELECTED_CLASS, props.className)
|
63
58
|
})).withConfig({
|
64
59
|
displayName: "SubNav__SubNavLink",
|
65
|
-
componentId: "f7w0xa-
|
66
|
-
})(["padding-left:", ";padding-right:", ";font-weight:", ";font-size:", ";line-height:20px;min-height:34px;color:", ";text-align:center;text-decoration:none;border-top:1px solid ", ";border-bottom:1px solid ", ";border-right:1px solid ", ";display:flex;align-items:center;&:first-of-type{border-top-left-radius:", ";border-bottom-left-radius:", ";border-left:1px solid ", ";}&:last-of-type{border-top-right-radius:", ";border-bottom-right-radius:", ";}&:hover,&:focus{text-decoration:none;background-color:", ";transition:0.2s ease;.SubNav-octicon{color:", ";}}&.selected{color:", ";background-color:", ";border-color:", ";.SubNav-octicon{color:", ";}}", ";"
|
60
|
+
componentId: "f7w0xa-2"
|
61
|
+
})(["padding-left:", ";padding-right:", ";font-weight:", ";font-size:", ";line-height:20px;min-height:34px;color:", ";text-align:center;text-decoration:none;border-top:1px solid ", ";border-bottom:1px solid ", ";border-right:1px solid ", ";display:flex;align-items:center;&:first-of-type{border-top-left-radius:", ";border-bottom-left-radius:", ";border-left:1px solid ", ";}&:last-of-type{border-top-right-radius:", ";border-bottom-right-radius:", ";}&:hover,&:focus{text-decoration:none;background-color:", ";transition:0.2s ease;.SubNav-octicon{color:", ";}}&.selected{color:", ";background-color:", ";border-color:", ";.SubNav-octicon{color:", ";}}", ";"], (0, _constants.get)('space.3'), (0, _constants.get)('space.3'), (0, _constants.get)('fontWeights.semibold'), (0, _constants.get)('fontSizes.1'), (0, _constants.get)('colors.fg.default'), (0, _constants.get)('colors.border.default'), (0, _constants.get)('colors.border.default'), (0, _constants.get)('colors.border.default'), (0, _constants.get)('radii.2'), (0, _constants.get)('radii.2'), (0, _constants.get)('colors.border.default'), (0, _constants.get)('radii.2'), (0, _constants.get)('radii.2'), (0, _constants.get)('colors.canvas.subtle'), (0, _constants.get)('colors.fg.muted'), (0, _constants.get)('colors.fg.onEmphasis'), (0, _constants.get)('colors.accent.emphasis'), (0, _constants.get)('colors.accent.emphasis'), (0, _constants.get)('colors.fg.onEmphasis'), _sx.default);
|
67
62
|
|
68
63
|
SubNavLink.displayName = 'SubNav.Link';
|
69
64
|
SubNavLinks.displayName = 'SubNav.Links';
|
package/lib-esm/Popover.d.ts
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
/// <reference types="hoist-non-react-statics" />
|
2
|
+
import { SystemCommonProps, SystemLayoutProps, SystemPositionProps } from './constants';
|
2
3
|
import { SxProp } from './sx';
|
3
4
|
import { ComponentProps } from './utils/types';
|
4
5
|
declare type CaretPosition = 'top' | 'bottom' | 'left' | 'right' | 'bottom-left' | 'bottom-right' | 'top-left' | 'top-right' | 'left-bottom' | 'left-top' | 'right-bottom' | 'right-top';
|
@@ -6,15 +7,15 @@ declare const Popover: import("styled-components").StyledComponent<"div", any, {
|
|
6
7
|
caret?: CaretPosition | undefined;
|
7
8
|
relative?: boolean | undefined;
|
8
9
|
open?: boolean | undefined;
|
9
|
-
} & SxProp, never>;
|
10
|
-
declare const PopoverContent: import("styled-components").StyledComponent<"div", any, SxProp, never>;
|
10
|
+
} & SystemCommonProps & SystemLayoutProps & SystemPositionProps & SxProp, never>;
|
11
|
+
declare const PopoverContent: import("styled-components").StyledComponent<"div", any, import("styled-system").SpaceProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>, string | number | symbol> & import("styled-system").ColorProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>, string | number | symbol> & import("styled-system").TypographyProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> & import("styled-system").LayoutProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> & import("styled-system").FlexboxProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> & import("styled-system").GridProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> & import("styled-system").BackgroundProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>, import("csstype").Property.Background<import("styled-system").TLengthStyledSystem>> & import("styled-system").BorderProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>, import("csstype").Property.Border<import("styled-system").TLengthStyledSystem>> & import("styled-system").PositionProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> & import("styled-system").ShadowProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> & SxProp, never>;
|
11
12
|
export declare type PopoverProps = ComponentProps<typeof Popover>;
|
12
13
|
export declare type PopoverContentProps = ComponentProps<typeof PopoverContent>;
|
13
14
|
declare const _default: string & import("styled-components").StyledComponentBase<"div", any, {
|
14
15
|
caret?: CaretPosition | undefined;
|
15
16
|
relative?: boolean | undefined;
|
16
17
|
open?: boolean | undefined;
|
17
|
-
} & SxProp, never> & import("hoist-non-react-statics").NonReactStatics<never, {}> & {
|
18
|
-
Content: import("styled-components").StyledComponent<"div", any, SxProp, never>;
|
18
|
+
} & SystemCommonProps & SystemLayoutProps & SystemPositionProps & SxProp, never> & import("hoist-non-react-statics").NonReactStatics<never, {}> & {
|
19
|
+
Content: import("styled-components").StyledComponent<"div", any, import("styled-system").SpaceProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>, string | number | symbol> & import("styled-system").ColorProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>, string | number | symbol> & import("styled-system").TypographyProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> & import("styled-system").LayoutProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> & import("styled-system").FlexboxProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> & import("styled-system").GridProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> & import("styled-system").BackgroundProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>, import("csstype").Property.Background<import("styled-system").TLengthStyledSystem>> & import("styled-system").BorderProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>, import("csstype").Property.Border<import("styled-system").TLengthStyledSystem>> & import("styled-system").PositionProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> & import("styled-system").ShadowProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> & SxProp, never>;
|
19
20
|
};
|
20
21
|
export default _default;
|
package/lib-esm/Popover.js
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
import classnames from 'classnames';
|
2
2
|
import styled from 'styled-components';
|
3
|
-
import
|
3
|
+
import Box from './Box';
|
4
|
+
import { COMMON, get, LAYOUT, POSITION } from './constants';
|
4
5
|
import sx from './sx';
|
5
6
|
const Popover = styled.div.attrs(({
|
6
7
|
className,
|
@@ -12,11 +13,11 @@ const Popover = styled.div.attrs(({
|
|
12
13
|
}).withConfig({
|
13
14
|
displayName: "Popover",
|
14
15
|
componentId: "sc-1nxygy2-0"
|
15
|
-
})(["position:", ";z-index:100;display:", ";", ";"], props => props.relative ? 'relative' : 'absolute', props => props.open ? 'block' : 'none', sx);
|
16
|
-
const PopoverContent = styled.
|
16
|
+
})(["position:", ";z-index:100;display:", ";", ";", ";", ";", ";"], props => props.relative ? 'relative' : 'absolute', props => props.open ? 'block' : 'none', COMMON, LAYOUT, POSITION, sx);
|
17
|
+
const PopoverContent = styled(Box).withConfig({
|
17
18
|
displayName: "Popover__PopoverContent",
|
18
19
|
componentId: "sc-1nxygy2-1"
|
19
|
-
})(["border:1px solid ", ";border-radius:", ";position:relative;width:232px;margin-right:auto;margin-left:auto;padding:", ";background-color:", ";&::before,&::after{position:absolute;left:50%;display:inline-block;content:'';}&::before{top:-", ";margin-left:-9px;border:", " solid transparent;border-bottom-color:", ";}&::after{top:-14px;margin-left:-", ";border:7px solid transparent;border-bottom-color:", ";}", ".caret-pos--bottom &,", ".caret-pos--bottom-right &,", ".caret-pos--bottom-left &{&::before,&::after{top:auto;border-bottom-color:transparent;}&::before{bottom:-", ";border-top-color:", ";}&::after{bottom:-14px;border-top-color:", ";}}", ".caret-pos--top-right &,", ".caret-pos--bottom-right &{right:-9px;margin-right:0;&::before,&::after{left:auto;margin-left:0;}&::before{right:20px;}&::after{right:21px;}}", ".caret-pos--top-left &,", ".caret-pos--bottom-left &{left:-9px;margin-left:0;&::before,&::after{left:", ";margin-left:0;}&::after{left:calc(", " + 1px);}}", ".caret-pos--right &,", ".caret-pos--right-top &,", ".caret-pos--right-bottom &,", ".caret-pos--left &,", ".caret-pos--left-top &,", ".caret-pos--left-bottom &{&::before,&::after{top:50%;left:auto;margin-left:0;border-bottom-color:transparent;}&::before{margin-top:calc((", " + 1px) * -1);}&::after{margin-top:-", ";}}", ".caret-pos--right &,", ".caret-pos--right-top &,", ".caret-pos--right-bottom &{&::before{right:-", ";border-left-color:", ";}&::after{right:-14px;border-left-color:", ";}}", ".caret-pos--left &,", ".caret-pos--left-top &,", ".caret-pos--left-bottom &{&::before{left:-", ";border-right-color:", ";}&::after{left:-14px;border-right-color:", ";}}", ".caret-pos--right-top &,", ".caret-pos--left-top &{&::before,&::after{top:", ";}}", ".caret-pos--right-bottom &,", ".caret-pos--left-bottom &{&::before,&::after{top:auto;}&::before{bottom:", ";}&::after{bottom:calc(", " + 1px);}}", ";"], get('colors.border.default'), get('radii.2'), get('space.4'), get('colors.canvas.overlay'), get('space.3'), get('space.2'), get('colors.border.default'), get('space.2'), get('colors.canvas.overlay'), Popover, Popover, Popover, get('space.3'), get('colors.border.default'), get('colors.canvas.overlay'), Popover, Popover, Popover, Popover, get('space.4'), get('space.4'), Popover, Popover, Popover, Popover, Popover, Popover, get('space.2'), get('space.2'), Popover, Popover, Popover, get('space.3'), get('colors.border.default'), get('colors.canvas.overlay'), Popover, Popover, Popover, get('space.3'), get('colors.border.default'), get('colors.canvas.overlay'), Popover, Popover, get('space.4'), Popover, Popover, get('space.3'), get('space.3'), sx);
|
20
|
+
})(["border:1px solid ", ";border-radius:", ";position:relative;width:232px;margin-right:auto;margin-left:auto;padding:", ";background-color:", ";", ";", ";&::before,&::after{position:absolute;left:50%;display:inline-block;content:'';}&::before{top:-", ";margin-left:-9px;border:", " solid transparent;border-bottom-color:", ";}&::after{top:-14px;margin-left:-", ";border:7px solid transparent;border-bottom-color:", ";}", ".caret-pos--bottom &,", ".caret-pos--bottom-right &,", ".caret-pos--bottom-left &{&::before,&::after{top:auto;border-bottom-color:transparent;}&::before{bottom:-", ";border-top-color:", ";}&::after{bottom:-14px;border-top-color:", ";}}", ".caret-pos--top-right &,", ".caret-pos--bottom-right &{right:-9px;margin-right:0;&::before,&::after{left:auto;margin-left:0;}&::before{right:20px;}&::after{right:21px;}}", ".caret-pos--top-left &,", ".caret-pos--bottom-left &{left:-9px;margin-left:0;&::before,&::after{left:", ";margin-left:0;}&::after{left:calc(", " + 1px);}}", ".caret-pos--right &,", ".caret-pos--right-top &,", ".caret-pos--right-bottom &,", ".caret-pos--left &,", ".caret-pos--left-top &,", ".caret-pos--left-bottom &{&::before,&::after{top:50%;left:auto;margin-left:0;border-bottom-color:transparent;}&::before{margin-top:calc((", " + 1px) * -1);}&::after{margin-top:-", ";}}", ".caret-pos--right &,", ".caret-pos--right-top &,", ".caret-pos--right-bottom &{&::before{right:-", ";border-left-color:", ";}&::after{right:-14px;border-left-color:", ";}}", ".caret-pos--left &,", ".caret-pos--left-top &,", ".caret-pos--left-bottom &{&::before{left:-", ";border-right-color:", ";}&::after{left:-14px;border-right-color:", ";}}", ".caret-pos--right-top &,", ".caret-pos--left-top &{&::before,&::after{top:", ";}}", ".caret-pos--right-bottom &,", ".caret-pos--left-bottom &{&::before,&::after{top:auto;}&::before{bottom:", ";}&::after{bottom:calc(", " + 1px);}}", ";"], get('colors.border.default'), get('radii.2'), get('space.4'), get('colors.canvas.overlay'), COMMON, LAYOUT, get('space.3'), get('space.2'), get('colors.border.default'), get('space.2'), get('colors.canvas.overlay'), Popover, Popover, Popover, get('space.3'), get('colors.border.default'), get('colors.canvas.overlay'), Popover, Popover, Popover, Popover, get('space.4'), get('space.4'), Popover, Popover, Popover, Popover, Popover, Popover, get('space.2'), get('space.2'), Popover, Popover, Popover, get('space.3'), get('colors.border.default'), get('colors.canvas.overlay'), Popover, Popover, Popover, get('space.3'), get('colors.border.default'), get('colors.canvas.overlay'), Popover, Popover, get('space.4'), Popover, Popover, get('space.3'), get('space.3'), sx);
|
20
21
|
Popover.defaultProps = {
|
21
22
|
caret: 'top'
|
22
23
|
};
|
package/lib-esm/SubNav.d.ts
CHANGED
@@ -1,10 +1,8 @@
|
|
1
1
|
import * as History from 'history';
|
2
2
|
import React from 'react';
|
3
|
-
import { SystemBorderProps, SystemCommonProps, SystemFlexProps } from './constants';
|
4
|
-
import { BoxProps } from './Box';
|
5
3
|
import { SxProp } from './sx';
|
6
4
|
import { ComponentProps } from './utils/types';
|
7
|
-
declare const SubNavBase: import("styled-components").StyledComponent<"nav", any,
|
5
|
+
declare const SubNavBase: import("styled-components").StyledComponent<"nav", any, SxProp, never>;
|
8
6
|
export declare type SubNavProps = {
|
9
7
|
actions?: React.ReactNode;
|
10
8
|
align?: 'right';
|
@@ -12,21 +10,17 @@ export declare type SubNavProps = {
|
|
12
10
|
label?: string;
|
13
11
|
} & ComponentProps<typeof SubNavBase>;
|
14
12
|
declare function SubNav({ actions, className, children, label, ...rest }: SubNavProps): JSX.Element;
|
15
|
-
export declare type SubNavLinksProps =
|
16
|
-
declare function SubNavLinks(props: SubNavLinksProps): JSX.Element;
|
17
|
-
declare namespace SubNavLinks {
|
18
|
-
var displayName: string;
|
19
|
-
}
|
13
|
+
export declare type SubNavLinksProps = SxProp;
|
20
14
|
declare const SubNavLink: import("styled-components").StyledComponent<"a", any, {
|
21
15
|
to?: History.LocationDescriptor<unknown> | undefined;
|
22
16
|
selected?: boolean | undefined;
|
23
|
-
} &
|
17
|
+
} & SxProp, never>;
|
24
18
|
export declare type SubNavLinkProps = ComponentProps<typeof SubNavLink>;
|
25
19
|
declare const _default: typeof SubNav & {
|
26
20
|
Link: import("styled-components").StyledComponent<"a", any, {
|
27
21
|
to?: History.LocationDescriptor<unknown> | undefined;
|
28
22
|
selected?: boolean | undefined;
|
29
|
-
} &
|
30
|
-
Links:
|
23
|
+
} & SxProp, never>;
|
24
|
+
Links: import("styled-components").StyledComponent<"div", any, SxProp, never>;
|
31
25
|
};
|
32
26
|
export default _default;
|
package/lib-esm/SubNav.js
CHANGED
@@ -4,15 +4,14 @@ import classnames from 'classnames'; // eslint-disable-next-line import/no-names
|
|
4
4
|
|
5
5
|
import React from 'react';
|
6
6
|
import styled from 'styled-components';
|
7
|
-
import {
|
8
|
-
import Box from './Box';
|
7
|
+
import { get } from './constants';
|
9
8
|
import sx from './sx';
|
10
9
|
const ITEM_CLASS = 'SubNav-item';
|
11
10
|
const SELECTED_CLASS = 'selected';
|
12
11
|
const SubNavBase = styled.nav.withConfig({
|
13
12
|
displayName: "SubNav__SubNavBase",
|
14
13
|
componentId: "f7w0xa-0"
|
15
|
-
})(["display:flex;justify-content:space-between;.SubNav-body{display:flex;margin-bottom:-1px;> *{margin-left:", ";}> *:first-child{margin-left:0;}}.SubNav-actions{align-self:center;}", ";"
|
14
|
+
})(["display:flex;justify-content:space-between;.SubNav-body{display:flex;margin-bottom:-1px;> *{margin-left:", ";}> *:first-child{margin-left:0;}}.SubNav-actions{align-self:center;}", ";"], get('space.2'), sx);
|
16
15
|
|
17
16
|
function SubNav({
|
18
17
|
actions,
|
@@ -33,21 +32,17 @@ function SubNav({
|
|
33
32
|
}
|
34
33
|
|
35
34
|
SubNav.displayName = "SubNav";
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
}, props));
|
41
|
-
}
|
42
|
-
|
43
|
-
SubNavLinks.displayName = "SubNavLinks";
|
35
|
+
const SubNavLinks = styled.div.withConfig({
|
36
|
+
displayName: "SubNav__SubNavLinks",
|
37
|
+
componentId: "f7w0xa-1"
|
38
|
+
})(["display:flex;", ";"], sx);
|
44
39
|
const SubNavLink = styled.a.attrs(props => ({
|
45
40
|
activeClassName: typeof props.to === 'string' ? 'selected' : '',
|
46
41
|
className: classnames(ITEM_CLASS, props.selected && SELECTED_CLASS, props.className)
|
47
42
|
})).withConfig({
|
48
43
|
displayName: "SubNav__SubNavLink",
|
49
|
-
componentId: "f7w0xa-
|
50
|
-
})(["padding-left:", ";padding-right:", ";font-weight:", ";font-size:", ";line-height:20px;min-height:34px;color:", ";text-align:center;text-decoration:none;border-top:1px solid ", ";border-bottom:1px solid ", ";border-right:1px solid ", ";display:flex;align-items:center;&:first-of-type{border-top-left-radius:", ";border-bottom-left-radius:", ";border-left:1px solid ", ";}&:last-of-type{border-top-right-radius:", ";border-bottom-right-radius:", ";}&:hover,&:focus{text-decoration:none;background-color:", ";transition:0.2s ease;.SubNav-octicon{color:", ";}}&.selected{color:", ";background-color:", ";border-color:", ";.SubNav-octicon{color:", ";}}", ";"
|
44
|
+
componentId: "f7w0xa-2"
|
45
|
+
})(["padding-left:", ";padding-right:", ";font-weight:", ";font-size:", ";line-height:20px;min-height:34px;color:", ";text-align:center;text-decoration:none;border-top:1px solid ", ";border-bottom:1px solid ", ";border-right:1px solid ", ";display:flex;align-items:center;&:first-of-type{border-top-left-radius:", ";border-bottom-left-radius:", ";border-left:1px solid ", ";}&:last-of-type{border-top-right-radius:", ";border-bottom-right-radius:", ";}&:hover,&:focus{text-decoration:none;background-color:", ";transition:0.2s ease;.SubNav-octicon{color:", ";}}&.selected{color:", ";background-color:", ";border-color:", ";.SubNav-octicon{color:", ";}}", ";"], get('space.3'), get('space.3'), get('fontWeights.semibold'), get('fontSizes.1'), get('colors.fg.default'), get('colors.border.default'), get('colors.border.default'), get('colors.border.default'), get('radii.2'), get('radii.2'), get('colors.border.default'), get('radii.2'), get('radii.2'), get('colors.canvas.subtle'), get('colors.fg.muted'), get('colors.fg.onEmphasis'), get('colors.accent.emphasis'), get('colors.accent.emphasis'), get('colors.fg.onEmphasis'), sx);
|
51
46
|
SubNavLink.displayName = 'SubNav.Link';
|
52
47
|
SubNavLinks.displayName = 'SubNav.Links';
|
53
48
|
export default Object.assign(SubNav, {
|