@primer/components 0.0.0-202110229331 → 0.0.0-2021102321921
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 +68 -6
- package/dist/browser.esm.js +690 -759
- package/dist/browser.esm.js.map +1 -1
- package/dist/browser.umd.js +294 -363
- package/dist/browser.umd.js.map +1 -1
- package/lib/ActionList2/Group.d.ts +28 -2
- package/lib/ActionList2/Group.js +55 -6
- package/lib/ActionList2/Group.jsx +33 -4
- package/lib/ActionList2/List.d.ts +1 -1
- package/lib/Autocomplete/Autocomplete.d.ts +3 -3
- package/lib/Autocomplete/AutocompleteInput.d.ts +3 -3
- package/lib/Breadcrumbs.d.ts +8 -7
- package/lib/Breadcrumbs.js +7 -12
- package/lib/Breadcrumbs.jsx +3 -6
- package/lib/Button/Button.d.ts +2 -3
- package/lib/Button/Button.js +2 -6
- package/lib/Button/Button.jsx +1 -21
- package/lib/Button/ButtonBase.d.ts +5 -8
- package/lib/Button/ButtonBase.js +1 -5
- package/lib/Button/ButtonBase.jsx +0 -3
- package/lib/Button/ButtonClose.d.ts +3 -46
- package/lib/Button/ButtonClose.js +1 -1
- package/lib/Button/ButtonClose.jsx +0 -2
- package/lib/Button/ButtonDanger.d.ts +2 -3
- package/lib/Button/ButtonDanger.js +2 -6
- package/lib/Button/ButtonDanger.jsx +1 -21
- package/lib/Button/ButtonInvisible.d.ts +2 -3
- package/lib/Button/ButtonInvisible.js +2 -6
- package/lib/Button/ButtonInvisible.jsx +1 -21
- package/lib/Button/ButtonOutline.d.ts +2 -3
- package/lib/Button/ButtonOutline.js +2 -6
- package/lib/Button/ButtonOutline.jsx +1 -21
- package/lib/Button/ButtonPrimary.d.ts +2 -3
- package/lib/Button/ButtonPrimary.js +2 -6
- package/lib/Button/ButtonPrimary.jsx +1 -21
- package/lib/Button/ButtonTableList.d.ts +1 -2
- package/lib/Button/ButtonTableList.js +1 -1
- package/lib/Button/ButtonTableList.jsx +0 -3
- package/lib/CircleBadge.d.ts +4 -5
- package/lib/CircleBadge.js +1 -1
- package/lib/CircleBadge.jsx +0 -1
- package/lib/CircleOcticon.d.ts +1 -1
- package/lib/CounterLabel.d.ts +1 -2
- package/lib/CounterLabel.js +1 -1
- package/lib/CounterLabel.jsx +0 -1
- package/lib/Dialog/Dialog.d.ts +5 -9
- package/lib/Dialog/Dialog.js +17 -11
- package/lib/Dialog/Dialog.jsx +13 -7
- package/lib/Dialog.d.ts +4 -5
- package/lib/Dialog.js +1 -1
- package/lib/Dialog.jsx +0 -2
- package/lib/Dropdown.d.ts +10 -99
- package/lib/Dropdown.js +3 -3
- package/lib/Dropdown.jsx +0 -3
- package/lib/DropdownMenu/DropdownButton.d.ts +3 -47
- package/lib/DropdownMenu/DropdownButton.js +3 -1
- package/lib/DropdownMenu/DropdownButton.jsx +1 -1
- package/lib/FilterList.d.ts +264 -303
- package/lib/FilterList.js +2 -6
- package/lib/FilterList.jsx +2 -6
- package/lib/FilteredSearch.d.ts +1 -2
- package/lib/FilteredSearch.js +1 -1
- package/lib/FilteredSearch.jsx +0 -1
- package/lib/Flash.d.ts +1 -2
- package/lib/Flash.js +1 -1
- package/lib/Flash.jsx +0 -1
- package/lib/FormGroup.d.ts +4 -5
- package/lib/FormGroup.js +2 -2
- package/lib/FormGroup.jsx +0 -3
- package/lib/Header.d.ts +6 -7
- package/lib/Header.js +4 -4
- package/lib/Header.jsx +0 -7
- package/lib/Label.d.ts +1 -2
- package/lib/Label.js +2 -3
- package/lib/Label.jsx +1 -3
- package/lib/LabelGroup.d.ts +1 -2
- package/lib/LabelGroup.js +1 -1
- package/lib/LabelGroup.jsx +0 -1
- package/lib/Link.d.ts +1 -2
- package/lib/Link.js +1 -1
- package/lib/Link.jsx +0 -2
- package/lib/NewButton/button.js +1 -12
- package/lib/NewButton/button.jsx +3 -7
- package/lib/Overlay.d.ts +11 -10
- package/lib/Overlay.js +3 -4
- package/lib/Overlay.jsx +1 -3
- package/lib/Pagehead.d.ts +1 -2
- package/lib/Pagehead.js +1 -1
- package/lib/Pagehead.jsx +0 -1
- package/lib/Pagination/Pagination.js +1 -1
- package/lib/Pagination/Pagination.jsx +0 -2
- package/lib/Popover.d.ts +4 -5
- package/lib/Popover.js +4 -5
- package/lib/Popover.jsx +1 -9
- package/lib/Position.d.ts +4 -4
- package/lib/SelectMenu/SelectMenu.d.ts +21 -189
- package/lib/SelectMenu/SelectMenu.js +1 -3
- package/lib/SelectMenu/SelectMenu.jsx +0 -2
- package/lib/SelectMenu/SelectMenuDivider.d.ts +1 -2
- package/lib/SelectMenu/SelectMenuDivider.js +1 -1
- package/lib/SelectMenu/SelectMenuDivider.jsx +0 -1
- package/lib/SelectMenu/SelectMenuFilter.js +1 -1
- package/lib/SelectMenu/SelectMenuFilter.jsx +0 -1
- package/lib/SelectMenu/SelectMenuFooter.d.ts +1 -2
- package/lib/SelectMenu/SelectMenuFooter.js +1 -1
- package/lib/SelectMenu/SelectMenuFooter.jsx +0 -1
- package/lib/SelectMenu/SelectMenuHeader.d.ts +1 -2
- package/lib/SelectMenu/SelectMenuHeader.js +1 -1
- package/lib/SelectMenu/SelectMenuHeader.jsx +0 -2
- package/lib/SelectMenu/SelectMenuItem.d.ts +2 -3
- package/lib/SelectMenu/SelectMenuItem.js +1 -1
- package/lib/SelectMenu/SelectMenuItem.jsx +0 -1
- package/lib/SelectMenu/SelectMenuList.d.ts +1 -2
- package/lib/SelectMenu/SelectMenuList.js +1 -1
- package/lib/SelectMenu/SelectMenuList.jsx +0 -1
- package/lib/SelectMenu/SelectMenuLoadingAnimation.d.ts +2 -2
- package/lib/SelectMenu/SelectMenuLoadingAnimation.js +3 -1
- package/lib/SelectMenu/SelectMenuLoadingAnimation.jsx +2 -1
- package/lib/SelectMenu/SelectMenuModal.d.ts +2 -3
- package/lib/SelectMenu/SelectMenuModal.js +1 -1
- package/lib/SelectMenu/SelectMenuModal.jsx +0 -1
- package/lib/SelectMenu/SelectMenuTab.d.ts +1 -2
- package/lib/SelectMenu/SelectMenuTab.js +1 -1
- package/lib/SelectMenu/SelectMenuTab.jsx +0 -1
- package/lib/SelectMenu/SelectMenuTabPanel.d.ts +1 -2
- package/lib/SelectMenu/SelectMenuTabPanel.js +1 -1
- package/lib/SelectMenu/SelectMenuTabPanel.jsx +0 -1
- package/lib/SelectMenu/SelectMenuTabs.d.ts +1 -2
- package/lib/SelectMenu/SelectMenuTabs.js +1 -1
- package/lib/SelectMenu/SelectMenuTabs.jsx +0 -1
- package/lib/SideNav.d.ts +11 -8
- package/lib/SideNav.js +8 -15
- package/lib/SideNav.jsx +2 -6
- package/lib/StateLabel.d.ts +1 -2
- package/lib/StateLabel.js +6 -5
- package/lib/StateLabel.jsx +1 -2
- package/lib/StyledOcticon.d.ts +1 -2
- package/lib/StyledOcticon.js +1 -3
- package/lib/StyledOcticon.jsx +0 -2
- package/lib/SubNav.d.ts +5 -11
- package/lib/SubNav.js +7 -12
- package/lib/SubNav.jsx +4 -7
- package/lib/TabNav.d.ts +3 -4
- package/lib/TabNav.js +2 -2
- package/lib/TabNav.jsx +0 -2
- package/lib/TextInputWithTokens.d.ts +3 -3
- package/lib/Timeline.d.ts +19 -393
- package/lib/Timeline.js +16 -13
- package/lib/Timeline.jsx +9 -10
- package/lib/Token/Token.d.ts +1 -1
- package/lib/Tooltip.d.ts +1 -2
- package/lib/Tooltip.js +1 -1
- package/lib/Tooltip.jsx +1 -1
- package/lib/Truncate.d.ts +1 -2
- package/lib/Truncate.js +1 -3
- package/lib/Truncate.jsx +0 -3
- package/lib/UnderlineNav.d.ts +2 -3
- package/lib/UnderlineNav.js +2 -2
- package/lib/UnderlineNav.jsx +0 -2
- package/lib/index.d.ts +0 -2
- package/lib/index.js +1 -3
- package/lib-esm/ActionList2/Group.d.ts +28 -2
- package/lib-esm/ActionList2/Group.js +52 -5
- package/lib-esm/ActionList2/List.d.ts +1 -1
- package/lib-esm/Autocomplete/Autocomplete.d.ts +3 -3
- package/lib-esm/Autocomplete/AutocompleteInput.d.ts +3 -3
- package/lib-esm/Breadcrumbs.d.ts +8 -7
- package/lib-esm/Breadcrumbs.js +8 -13
- package/lib-esm/Button/Button.d.ts +2 -3
- package/lib-esm/Button/Button.js +2 -2
- package/lib-esm/Button/ButtonBase.d.ts +5 -8
- package/lib-esm/Button/ButtonBase.js +1 -3
- package/lib-esm/Button/ButtonClose.d.ts +3 -46
- package/lib-esm/Button/ButtonClose.js +2 -2
- package/lib-esm/Button/ButtonDanger.d.ts +2 -3
- package/lib-esm/Button/ButtonDanger.js +2 -2
- package/lib-esm/Button/ButtonInvisible.d.ts +2 -3
- package/lib-esm/Button/ButtonInvisible.js +2 -2
- package/lib-esm/Button/ButtonOutline.d.ts +2 -3
- package/lib-esm/Button/ButtonOutline.js +2 -2
- package/lib-esm/Button/ButtonPrimary.d.ts +2 -3
- package/lib-esm/Button/ButtonPrimary.js +2 -2
- package/lib-esm/Button/ButtonTableList.d.ts +1 -2
- package/lib-esm/Button/ButtonTableList.js +2 -2
- package/lib-esm/CircleBadge.d.ts +4 -5
- package/lib-esm/CircleBadge.js +2 -2
- package/lib-esm/CircleOcticon.d.ts +1 -1
- package/lib-esm/CounterLabel.d.ts +1 -2
- package/lib-esm/CounterLabel.js +2 -2
- package/lib-esm/Dialog/Dialog.d.ts +5 -9
- package/lib-esm/Dialog/Dialog.js +12 -12
- package/lib-esm/Dialog.d.ts +4 -5
- package/lib-esm/Dialog.js +2 -2
- package/lib-esm/Dropdown.d.ts +10 -99
- package/lib-esm/Dropdown.js +4 -4
- package/lib-esm/DropdownMenu/DropdownButton.d.ts +3 -47
- package/lib-esm/DropdownMenu/DropdownButton.js +3 -1
- package/lib-esm/FilterList.d.ts +264 -303
- package/lib-esm/FilterList.js +3 -7
- package/lib-esm/FilteredSearch.d.ts +1 -2
- package/lib-esm/FilteredSearch.js +2 -2
- package/lib-esm/Flash.d.ts +1 -2
- package/lib-esm/Flash.js +2 -2
- package/lib-esm/FormGroup.d.ts +4 -5
- package/lib-esm/FormGroup.js +3 -3
- package/lib-esm/Header.d.ts +6 -7
- package/lib-esm/Header.js +5 -5
- package/lib-esm/Label.d.ts +1 -2
- package/lib-esm/Label.js +3 -4
- package/lib-esm/LabelGroup.d.ts +1 -2
- package/lib-esm/LabelGroup.js +2 -2
- package/lib-esm/Link.d.ts +1 -2
- package/lib-esm/Link.js +2 -2
- package/lib-esm/NewButton/button.js +0 -11
- package/lib-esm/Overlay.d.ts +11 -10
- package/lib-esm/Overlay.js +2 -3
- package/lib-esm/Pagehead.d.ts +1 -2
- package/lib-esm/Pagehead.js +2 -2
- package/lib-esm/Pagination/Pagination.js +2 -2
- package/lib-esm/Popover.d.ts +4 -5
- package/lib-esm/Popover.js +4 -5
- package/lib-esm/Position.d.ts +4 -4
- package/lib-esm/SelectMenu/SelectMenu.d.ts +21 -189
- package/lib-esm/SelectMenu/SelectMenu.js +1 -2
- package/lib-esm/SelectMenu/SelectMenuDivider.d.ts +1 -2
- package/lib-esm/SelectMenu/SelectMenuDivider.js +2 -2
- package/lib-esm/SelectMenu/SelectMenuFilter.js +2 -2
- package/lib-esm/SelectMenu/SelectMenuFooter.d.ts +1 -2
- package/lib-esm/SelectMenu/SelectMenuFooter.js +2 -2
- package/lib-esm/SelectMenu/SelectMenuHeader.d.ts +1 -2
- package/lib-esm/SelectMenu/SelectMenuHeader.js +2 -2
- package/lib-esm/SelectMenu/SelectMenuItem.d.ts +2 -3
- package/lib-esm/SelectMenu/SelectMenuItem.js +2 -2
- package/lib-esm/SelectMenu/SelectMenuList.d.ts +1 -2
- package/lib-esm/SelectMenu/SelectMenuList.js +2 -2
- package/lib-esm/SelectMenu/SelectMenuLoadingAnimation.d.ts +2 -2
- package/lib-esm/SelectMenu/SelectMenuLoadingAnimation.js +3 -2
- package/lib-esm/SelectMenu/SelectMenuModal.d.ts +2 -3
- package/lib-esm/SelectMenu/SelectMenuModal.js +2 -2
- package/lib-esm/SelectMenu/SelectMenuTab.d.ts +1 -2
- package/lib-esm/SelectMenu/SelectMenuTab.js +2 -2
- package/lib-esm/SelectMenu/SelectMenuTabPanel.d.ts +1 -2
- package/lib-esm/SelectMenu/SelectMenuTabPanel.js +2 -2
- package/lib-esm/SelectMenu/SelectMenuTabs.d.ts +1 -2
- package/lib-esm/SelectMenu/SelectMenuTabs.js +2 -2
- package/lib-esm/SideNav.d.ts +11 -8
- package/lib-esm/SideNav.js +8 -16
- package/lib-esm/StateLabel.d.ts +1 -2
- package/lib-esm/StateLabel.js +7 -6
- package/lib-esm/StyledOcticon.d.ts +1 -2
- package/lib-esm/StyledOcticon.js +1 -2
- package/lib-esm/SubNav.d.ts +5 -11
- package/lib-esm/SubNav.js +8 -13
- package/lib-esm/TabNav.d.ts +3 -4
- package/lib-esm/TabNav.js +3 -3
- package/lib-esm/TextInputWithTokens.d.ts +3 -3
- package/lib-esm/Timeline.d.ts +19 -393
- package/lib-esm/Timeline.js +12 -13
- package/lib-esm/Token/Token.d.ts +1 -1
- package/lib-esm/Tooltip.d.ts +1 -2
- package/lib-esm/Tooltip.js +2 -2
- package/lib-esm/Truncate.d.ts +1 -2
- package/lib-esm/Truncate.js +1 -2
- package/lib-esm/UnderlineNav.d.ts +2 -3
- package/lib-esm/UnderlineNav.js +3 -3
- package/lib-esm/index.d.ts +0 -2
- package/lib-esm/index.js +0 -1
- package/package.json +2 -2
- package/lib/Checkbox.d.ts +0 -29
- package/lib/Checkbox.js +0 -65
- package/lib/Checkbox.jsx +0 -50
- package/lib-esm/Checkbox.d.ts +0 -29
- package/lib-esm/Checkbox.js +0 -45
|
@@ -1,11 +1,37 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { SxProp } from '../sx';
|
|
3
|
-
import { HeaderProps } from './Header';
|
|
4
3
|
import { ListProps } from './List';
|
|
5
|
-
|
|
4
|
+
import { AriaRole } from '../utils/types';
|
|
5
|
+
export declare type GroupProps = {
|
|
6
|
+
/**
|
|
7
|
+
* Style variations. Usage is discretionary.
|
|
8
|
+
*
|
|
9
|
+
* - `"filled"` - Superimposed on a background, offset from nearby content
|
|
10
|
+
* - `"subtle"` - Relatively less offset from nearby content
|
|
11
|
+
*/
|
|
12
|
+
variant?: 'subtle' | 'filled';
|
|
13
|
+
/**
|
|
14
|
+
* Primary text which names a `Group`.
|
|
15
|
+
*/
|
|
16
|
+
title?: string;
|
|
17
|
+
/**
|
|
18
|
+
* Secondary text which provides additional information about a `Group`.
|
|
19
|
+
*/
|
|
20
|
+
auxiliaryText?: string;
|
|
21
|
+
/**
|
|
22
|
+
* The ARIA role describing the function of the list inside `Group` component. `listbox` or `menu` are a common values.
|
|
23
|
+
*/
|
|
24
|
+
role?: AriaRole;
|
|
25
|
+
} & SxProp & {
|
|
26
|
+
/**
|
|
27
|
+
* Whether multiple Items or a single Item can be selected in the Group. Overrides value on ActionList root.
|
|
28
|
+
*/
|
|
6
29
|
selectionVariant?: ListProps['selectionVariant'] | false;
|
|
7
30
|
};
|
|
8
31
|
declare type ContextProps = Pick<GroupProps, 'selectionVariant'>;
|
|
9
32
|
export declare const GroupContext: React.Context<ContextProps>;
|
|
10
33
|
export declare const Group: React.FC<GroupProps>;
|
|
34
|
+
export declare type HeaderProps = Pick<GroupProps, 'variant' | 'title' | 'auxiliaryText'> & {
|
|
35
|
+
labelId: string;
|
|
36
|
+
};
|
|
11
37
|
export {};
|
package/lib/ActionList2/Group.js
CHANGED
|
@@ -7,9 +7,11 @@ exports.Group = exports.GroupContext = void 0;
|
|
|
7
7
|
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
|
|
10
|
+
var _ssr = require("@react-aria/ssr");
|
|
11
|
+
|
|
10
12
|
var _Box = _interopRequireDefault(require("../Box"));
|
|
11
13
|
|
|
12
|
-
var
|
|
14
|
+
var _List = require("./List");
|
|
13
15
|
|
|
14
16
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
17
|
|
|
@@ -21,12 +23,14 @@ exports.GroupContext = GroupContext;
|
|
|
21
23
|
|
|
22
24
|
const Group = ({
|
|
23
25
|
title,
|
|
24
|
-
variant,
|
|
26
|
+
variant = 'subtle',
|
|
25
27
|
auxiliaryText,
|
|
26
28
|
selectionVariant,
|
|
29
|
+
role,
|
|
27
30
|
sx = {},
|
|
28
31
|
...props
|
|
29
32
|
}) => {
|
|
33
|
+
const labelId = (0, _ssr.useSSRSafeId)();
|
|
30
34
|
return /*#__PURE__*/_react.default.createElement(_Box.default, _extends({
|
|
31
35
|
as: "li",
|
|
32
36
|
sx: {
|
|
@@ -37,10 +41,11 @@ const Group = ({
|
|
|
37
41
|
// hide the ::marker inserted by browser's stylesheet
|
|
38
42
|
...sx
|
|
39
43
|
}
|
|
40
|
-
}, props), title && /*#__PURE__*/_react.default.createElement(
|
|
44
|
+
}, props), title && /*#__PURE__*/_react.default.createElement(Header, {
|
|
41
45
|
title: title,
|
|
42
46
|
variant: variant,
|
|
43
|
-
auxiliaryText: auxiliaryText
|
|
47
|
+
auxiliaryText: auxiliaryText,
|
|
48
|
+
labelId: labelId
|
|
44
49
|
}), /*#__PURE__*/_react.default.createElement(GroupContext.Provider, {
|
|
45
50
|
value: {
|
|
46
51
|
selectionVariant
|
|
@@ -49,9 +54,53 @@ const Group = ({
|
|
|
49
54
|
as: "ul",
|
|
50
55
|
sx: {
|
|
51
56
|
paddingInlineStart: 0
|
|
52
|
-
}
|
|
57
|
+
},
|
|
58
|
+
"aria-labelledby": title ? labelId : undefined,
|
|
59
|
+
role: role
|
|
53
60
|
}, props.children)));
|
|
54
61
|
};
|
|
55
62
|
|
|
56
63
|
exports.Group = Group;
|
|
57
|
-
Group.displayName = "Group";
|
|
64
|
+
Group.displayName = "Group";
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Displays the name and description of a `Group`.
|
|
68
|
+
*
|
|
69
|
+
* For visual presentation only. It's hidden from screen readers.
|
|
70
|
+
*/
|
|
71
|
+
const Header = ({
|
|
72
|
+
variant,
|
|
73
|
+
title,
|
|
74
|
+
auxiliaryText,
|
|
75
|
+
labelId,
|
|
76
|
+
...props
|
|
77
|
+
}) => {
|
|
78
|
+
const {
|
|
79
|
+
variant: listVariant
|
|
80
|
+
} = _react.default.useContext(_List.ListContext);
|
|
81
|
+
|
|
82
|
+
const styles = {
|
|
83
|
+
paddingY: '6px',
|
|
84
|
+
paddingX: listVariant === 'full' ? 2 : 3,
|
|
85
|
+
fontSize: 0,
|
|
86
|
+
fontWeight: 'bold',
|
|
87
|
+
color: 'fg.muted',
|
|
88
|
+
...(variant === 'filled' && {
|
|
89
|
+
backgroundColor: 'canvas.subtle',
|
|
90
|
+
marginX: 0,
|
|
91
|
+
marginBottom: 2,
|
|
92
|
+
borderTop: '1px solid',
|
|
93
|
+
borderBottom: '1px solid',
|
|
94
|
+
borderColor: 'neutral.muted'
|
|
95
|
+
})
|
|
96
|
+
};
|
|
97
|
+
return /*#__PURE__*/_react.default.createElement(_Box.default, _extends({
|
|
98
|
+
sx: styles,
|
|
99
|
+
role: "presentation",
|
|
100
|
+
"aria-hidden": "true"
|
|
101
|
+
}, props), /*#__PURE__*/_react.default.createElement("span", {
|
|
102
|
+
id: labelId
|
|
103
|
+
}, title), auxiliaryText && /*#__PURE__*/_react.default.createElement("span", null, auxiliaryText));
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
Header.displayName = "Header";
|
|
@@ -5,21 +5,50 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.Group = exports.GroupContext = void 0;
|
|
7
7
|
const react_1 = __importDefault(require("react"));
|
|
8
|
+
const ssr_1 = require("@react-aria/ssr");
|
|
8
9
|
const Box_1 = __importDefault(require("../Box"));
|
|
9
|
-
const
|
|
10
|
+
const List_1 = require("./List");
|
|
10
11
|
exports.GroupContext = react_1.default.createContext({});
|
|
11
|
-
const Group = ({ title, variant, auxiliaryText, selectionVariant, sx = {}, ...props }) => {
|
|
12
|
+
const Group = ({ title, variant = 'subtle', auxiliaryText, selectionVariant, role, sx = {}, ...props }) => {
|
|
13
|
+
const labelId = ssr_1.useSSRSafeId();
|
|
12
14
|
return (<Box_1.default as="li" sx={{
|
|
13
15
|
'&:not(:first-child)': { marginTop: 2 },
|
|
14
16
|
listStyle: 'none',
|
|
15
17
|
...sx
|
|
16
18
|
}} {...props}>
|
|
17
|
-
{title && <
|
|
19
|
+
{title && <Header title={title} variant={variant} auxiliaryText={auxiliaryText} labelId={labelId}/>}
|
|
18
20
|
<exports.GroupContext.Provider value={{ selectionVariant }}>
|
|
19
|
-
<Box_1.default as="ul" sx={{ paddingInlineStart: 0 }}>
|
|
21
|
+
<Box_1.default as="ul" sx={{ paddingInlineStart: 0 }} aria-labelledby={title ? labelId : undefined} role={role}>
|
|
20
22
|
{props.children}
|
|
21
23
|
</Box_1.default>
|
|
22
24
|
</exports.GroupContext.Provider>
|
|
23
25
|
</Box_1.default>);
|
|
24
26
|
};
|
|
25
27
|
exports.Group = Group;
|
|
28
|
+
/**
|
|
29
|
+
* Displays the name and description of a `Group`.
|
|
30
|
+
*
|
|
31
|
+
* For visual presentation only. It's hidden from screen readers.
|
|
32
|
+
*/
|
|
33
|
+
const Header = ({ variant, title, auxiliaryText, labelId, ...props }) => {
|
|
34
|
+
const { variant: listVariant } = react_1.default.useContext(List_1.ListContext);
|
|
35
|
+
const styles = {
|
|
36
|
+
paddingY: '6px',
|
|
37
|
+
paddingX: listVariant === 'full' ? 2 : 3,
|
|
38
|
+
fontSize: 0,
|
|
39
|
+
fontWeight: 'bold',
|
|
40
|
+
color: 'fg.muted',
|
|
41
|
+
...(variant === 'filled' && {
|
|
42
|
+
backgroundColor: 'canvas.subtle',
|
|
43
|
+
marginX: 0,
|
|
44
|
+
marginBottom: 2,
|
|
45
|
+
borderTop: '1px solid',
|
|
46
|
+
borderBottom: '1px solid',
|
|
47
|
+
borderColor: 'neutral.muted'
|
|
48
|
+
})
|
|
49
|
+
};
|
|
50
|
+
return (<Box_1.default sx={styles} role="presentation" aria-hidden="true" {...props}>
|
|
51
|
+
<span id={labelId}>{title}</span>
|
|
52
|
+
{auxiliaryText && <span>{auxiliaryText}</span>}
|
|
53
|
+
</Box_1.default>);
|
|
54
|
+
};
|
|
@@ -20,7 +20,7 @@ export declare type ListProps = {
|
|
|
20
20
|
*/
|
|
21
21
|
role?: AriaRole;
|
|
22
22
|
} & SxProp;
|
|
23
|
-
declare type ContextProps =
|
|
23
|
+
declare type ContextProps = Pick<ListProps, 'variant' | 'selectionVariant' | 'showDividers'>;
|
|
24
24
|
export declare const ListContext: React.Context<ContextProps>;
|
|
25
25
|
export declare const List: PolymorphicForwardRefComponent<"ul", ListProps>;
|
|
26
26
|
export {};
|
|
@@ -20,7 +20,7 @@ declare const _default: React.FC<{
|
|
|
20
20
|
} & {
|
|
21
21
|
as?: string | React.ComponentType<any> | undefined;
|
|
22
22
|
forwardedAs?: string | React.ComponentType<any> | undefined;
|
|
23
|
-
}, string | number | symbol>, "maxWidth" | "minWidth" | "width" | "theme" | "block" | "icon" | "
|
|
23
|
+
}, string | number | symbol>, "maxWidth" | "minWidth" | "width" | "theme" | "block" | "icon" | "variant" | "sx" | "className" | "disabled" | "contrast"> & {
|
|
24
24
|
className?: string | undefined;
|
|
25
25
|
icon?: React.ComponentType<{
|
|
26
26
|
className?: string | undefined;
|
|
@@ -38,9 +38,9 @@ declare const _default: React.FC<{
|
|
|
38
38
|
style?: React.CSSProperties | undefined;
|
|
39
39
|
title?: string | undefined;
|
|
40
40
|
block?: boolean | undefined;
|
|
41
|
-
sx?: import("../sx").BetterSystemStyleObject | undefined;
|
|
42
41
|
variant?: "small" | "large" | undefined;
|
|
43
42
|
role?: React.AriaRole | undefined;
|
|
43
|
+
sx?: import("../sx").BetterSystemStyleObject | undefined;
|
|
44
44
|
key?: React.Key | null | undefined;
|
|
45
45
|
defaultChecked?: boolean | undefined;
|
|
46
46
|
defaultValue?: string | number | readonly string[] | undefined;
|
|
@@ -295,7 +295,7 @@ declare const _default: React.FC<{
|
|
|
295
295
|
contrast?: boolean | undefined;
|
|
296
296
|
} & {
|
|
297
297
|
theme?: any;
|
|
298
|
-
}, "maxWidth" | "minWidth" | "width" | "theme" | "block" | "
|
|
298
|
+
}, "maxWidth" | "minWidth" | "width" | "theme" | "block" | "variant" | "sx" | "disabled" | "contrast">, string | number | symbol> & React.RefAttributes<HTMLInputElement>>, {
|
|
299
299
|
as?: React.ComponentType<any> | undefined;
|
|
300
300
|
}>;
|
|
301
301
|
Menu: typeof AutocompleteMenu;
|
|
@@ -12,7 +12,7 @@ declare const AutocompleteInput: PolymorphicForwardRefComponent<React.ForwardRef
|
|
|
12
12
|
} & {
|
|
13
13
|
as?: string | React.ComponentType<any> | undefined;
|
|
14
14
|
forwardedAs?: string | React.ComponentType<any> | undefined;
|
|
15
|
-
}, string | number | symbol>, "maxWidth" | "minWidth" | "width" | "theme" | "block" | "icon" | "
|
|
15
|
+
}, string | number | symbol>, "maxWidth" | "minWidth" | "width" | "theme" | "block" | "icon" | "variant" | "sx" | "className" | "disabled" | "contrast"> & {
|
|
16
16
|
className?: string | undefined;
|
|
17
17
|
icon?: React.ComponentType<{
|
|
18
18
|
className?: string | undefined;
|
|
@@ -30,9 +30,9 @@ declare const AutocompleteInput: PolymorphicForwardRefComponent<React.ForwardRef
|
|
|
30
30
|
style?: React.CSSProperties | undefined;
|
|
31
31
|
title?: string | undefined;
|
|
32
32
|
block?: boolean | undefined;
|
|
33
|
-
sx?: import("../sx").BetterSystemStyleObject | undefined;
|
|
34
33
|
variant?: "small" | "large" | undefined;
|
|
35
34
|
role?: React.AriaRole | undefined;
|
|
35
|
+
sx?: import("../sx").BetterSystemStyleObject | undefined;
|
|
36
36
|
key?: React.Key | null | undefined;
|
|
37
37
|
defaultChecked?: boolean | undefined;
|
|
38
38
|
defaultValue?: string | number | readonly string[] | undefined;
|
|
@@ -287,6 +287,6 @@ declare const AutocompleteInput: PolymorphicForwardRefComponent<React.ForwardRef
|
|
|
287
287
|
contrast?: boolean | undefined;
|
|
288
288
|
} & {
|
|
289
289
|
theme?: any;
|
|
290
|
-
}, "maxWidth" | "minWidth" | "width" | "theme" | "block" | "
|
|
290
|
+
}, "maxWidth" | "minWidth" | "width" | "theme" | "block" | "variant" | "sx" | "disabled" | "contrast">, string | number | symbol> & React.RefAttributes<HTMLInputElement>>, InternalAutocompleteInputProps>;
|
|
291
291
|
export declare type AutocompleteInputProps = ComponentProps<typeof AutocompleteInput>;
|
|
292
292
|
export default AutocompleteInput;
|
package/lib/Breadcrumbs.d.ts
CHANGED
|
@@ -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,
|
|
7
|
-
export declare type BreadcrumbsProps =
|
|
8
|
-
|
|
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
|
-
} &
|
|
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
|
-
} &
|
|
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
|
-
} &
|
|
32
|
+
} & SxProp, never>;
|
|
32
33
|
};
|
|
33
34
|
/**
|
|
34
35
|
* @deprecated Use the `BreadcrumbsProps` type instead
|
package/lib/Breadcrumbs.js
CHANGED
|
@@ -19,8 +19,6 @@ var _sx = _interopRequireDefault(require("./sx"));
|
|
|
19
19
|
|
|
20
20
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
21
21
|
|
|
22
|
-
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); }
|
|
23
|
-
|
|
24
22
|
const SELECTED_CLASS = 'selected';
|
|
25
23
|
|
|
26
24
|
const Wrapper = _styledComponents.default.li.withConfig({
|
|
@@ -31,23 +29,20 @@ const Wrapper = _styledComponents.default.li.withConfig({
|
|
|
31
29
|
const BreadcrumbsBase = _styledComponents.default.nav.withConfig({
|
|
32
30
|
displayName: "Breadcrumbs__BreadcrumbsBase",
|
|
33
31
|
componentId: "hwwoo0-1"
|
|
34
|
-
})(["display:flex;justify-content:space-between;", ";"
|
|
32
|
+
})(["display:flex;justify-content:space-between;", ";"], _sx.default);
|
|
35
33
|
|
|
36
34
|
function Breadcrumbs({
|
|
37
35
|
className,
|
|
38
36
|
children,
|
|
39
|
-
|
|
40
|
-
...rest
|
|
37
|
+
sx: sxProp
|
|
41
38
|
}) {
|
|
42
|
-
const wrappedChildren = _react.default.Children.map(children, child => /*#__PURE__*/_react.default.createElement(Wrapper,
|
|
43
|
-
theme: theme
|
|
44
|
-
}, child));
|
|
39
|
+
const wrappedChildren = _react.default.Children.map(children, child => /*#__PURE__*/_react.default.createElement(Wrapper, null, child));
|
|
45
40
|
|
|
46
|
-
return /*#__PURE__*/_react.default.createElement(BreadcrumbsBase,
|
|
41
|
+
return /*#__PURE__*/_react.default.createElement(BreadcrumbsBase, {
|
|
47
42
|
className: className,
|
|
48
43
|
"aria-label": "Breadcrumbs",
|
|
49
|
-
|
|
50
|
-
},
|
|
44
|
+
sx: sxProp
|
|
45
|
+
}, /*#__PURE__*/_react.default.createElement(_Box.default, {
|
|
51
46
|
as: "ol",
|
|
52
47
|
my: 0,
|
|
53
48
|
pl: 0
|
|
@@ -63,7 +58,7 @@ const BreadcrumbsItem = _styledComponents.default.a.attrs(props => ({
|
|
|
63
58
|
})).withConfig({
|
|
64
59
|
displayName: "Breadcrumbs__BreadcrumbsItem",
|
|
65
60
|
componentId: "hwwoo0-2"
|
|
66
|
-
})(["color:", ";display:inline-block;font-size:", ";text-decoration:none;&:hover{text-decoration:underline;}&.selected{color:", ";pointer-events:none;}", "
|
|
61
|
+
})(["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'), _sx.default);
|
|
67
62
|
|
|
68
63
|
Breadcrumbs.displayName = 'Breadcrumbs';
|
|
69
64
|
BreadcrumbsItem.displayName = 'Breadcrumbs.Item';
|
package/lib/Breadcrumbs.jsx
CHANGED
|
@@ -34,13 +34,11 @@ const Wrapper = styled_components_1.default.li `
|
|
|
34
34
|
const BreadcrumbsBase = styled_components_1.default.nav `
|
|
35
35
|
display: flex;
|
|
36
36
|
justify-content: space-between;
|
|
37
|
-
${constants_1.COMMON};
|
|
38
|
-
${constants_1.FLEX};
|
|
39
37
|
${sx_1.default};
|
|
40
38
|
`;
|
|
41
|
-
function Breadcrumbs({ className, children,
|
|
42
|
-
const wrappedChildren = react_1.default.Children.map(children, child => <Wrapper
|
|
43
|
-
return (<BreadcrumbsBase className={className} aria-label="Breadcrumbs"
|
|
39
|
+
function Breadcrumbs({ className, children, sx: sxProp }) {
|
|
40
|
+
const wrappedChildren = react_1.default.Children.map(children, child => <Wrapper>{child}</Wrapper>);
|
|
41
|
+
return (<BreadcrumbsBase className={className} aria-label="Breadcrumbs" sx={sxProp}>
|
|
44
42
|
<Box_1.default as="ol" my={0} pl={0}>
|
|
45
43
|
{wrappedChildren}
|
|
46
44
|
</Box_1.default>
|
|
@@ -62,7 +60,6 @@ const BreadcrumbsItem = styled_components_1.default.a.attrs(props => ({
|
|
|
62
60
|
color: ${constants_1.get('colors.fg.default')};
|
|
63
61
|
pointer-events: none;
|
|
64
62
|
}
|
|
65
|
-
${constants_1.COMMON}
|
|
66
63
|
${sx_1.default};
|
|
67
64
|
`;
|
|
68
65
|
Breadcrumbs.displayName = 'Breadcrumbs';
|
package/lib/Button/Button.d.ts
CHANGED
|
@@ -4,9 +4,8 @@ import { ComponentProps } from '../utils/types';
|
|
|
4
4
|
declare const Button: import("styled-components").StyledComponent<"button", any, {
|
|
5
5
|
as?: string | import("react").ComponentClass<any, any> | import("react").FunctionComponent<any> | undefined;
|
|
6
6
|
variant?: "small" | "medium" | "large" | undefined;
|
|
7
|
-
} &
|
|
7
|
+
} & {
|
|
8
8
|
color?: string | undefined;
|
|
9
|
-
fontSize?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
|
10
9
|
translate?: "yes" | "no" | undefined;
|
|
11
10
|
hidden?: boolean | undefined;
|
|
12
11
|
children?: import("react").ReactNode;
|
|
@@ -279,6 +278,6 @@ declare const Button: import("styled-components").StyledComponent<"button", any,
|
|
|
279
278
|
formTarget?: string | undefined;
|
|
280
279
|
} & {
|
|
281
280
|
theme?: any;
|
|
282
|
-
} &
|
|
281
|
+
} & SxProp, never>;
|
|
283
282
|
export declare type ButtonProps = ComponentProps<typeof Button>;
|
|
284
283
|
export default Button;
|
package/lib/Button/Button.js
CHANGED
|
@@ -11,17 +11,13 @@ var _constants = require("../constants");
|
|
|
11
11
|
|
|
12
12
|
var _sx = _interopRequireDefault(require("../sx"));
|
|
13
13
|
|
|
14
|
-
var _ButtonBase =
|
|
15
|
-
|
|
16
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
17
|
-
|
|
18
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
14
|
+
var _ButtonBase = _interopRequireDefault(require("./ButtonBase"));
|
|
19
15
|
|
|
20
16
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
21
17
|
|
|
22
18
|
const Button = (0, _styledComponents.default)(_ButtonBase.default).withConfig({
|
|
23
19
|
displayName: "Button",
|
|
24
20
|
componentId: "xjtz72-0"
|
|
25
|
-
})(["color:", ";background-color:", ";border:1px solid ", ";box-shadow:", ",", "};&:hover{background-color:", ";border-color:", ";}&:focus{border-color:", ";box-shadow:", ";}&:active{background-color:", ";box-shadow:", ";}&:disabled{color:", ";background-color:", ";border-color:", ";}", ";"
|
|
21
|
+
})(["color:", ";background-color:", ";border:1px solid ", ";box-shadow:", ",", "};&:hover{background-color:", ";border-color:", ";}&:focus{border-color:", ";box-shadow:", ";}&:active{background-color:", ";box-shadow:", ";}&:disabled{color:", ";background-color:", ";border-color:", ";}", ";"], (0, _constants.get)('colors.btn.text'), (0, _constants.get)('colors.btn.bg'), (0, _constants.get)('colors.btn.border'), (0, _constants.get)('shadows.btn.shadow'), (0, _constants.get)('shadows.btn.insetShadow'), (0, _constants.get)('colors.btn.hoverBg'), (0, _constants.get)('colors.btn.hoverBorder'), (0, _constants.get)('colors.btn.focusBorder'), (0, _constants.get)('shadows.btn.focusShadow'), (0, _constants.get)('colors.btn.selectedBg'), (0, _constants.get)('shadows.btn.shadowActive'), (0, _constants.get)('colors.primer.fg.disabled'), (0, _constants.get)('colors.btn.bg'), (0, _constants.get)('colors.btn.border'), _sx.default);
|
|
26
22
|
var _default = Button;
|
|
27
23
|
exports.default = _default;
|
package/lib/Button/Button.jsx
CHANGED
|
@@ -1,23 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
-
}) : (function(o, m, k, k2) {
|
|
6
|
-
if (k2 === undefined) k2 = k;
|
|
7
|
-
o[k2] = m[k];
|
|
8
|
-
}));
|
|
9
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
10
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
11
|
-
}) : function(o, v) {
|
|
12
|
-
o["default"] = v;
|
|
13
|
-
});
|
|
14
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
15
|
-
if (mod && mod.__esModule) return mod;
|
|
16
|
-
var result = {};
|
|
17
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
18
|
-
__setModuleDefault(result, mod);
|
|
19
|
-
return result;
|
|
20
|
-
};
|
|
21
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
22
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
23
4
|
};
|
|
@@ -25,7 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
25
6
|
const styled_components_1 = __importDefault(require("styled-components"));
|
|
26
7
|
const constants_1 = require("../constants");
|
|
27
8
|
const sx_1 = __importDefault(require("../sx"));
|
|
28
|
-
const ButtonBase_1 =
|
|
9
|
+
const ButtonBase_1 = __importDefault(require("./ButtonBase"));
|
|
29
10
|
const Button = styled_components_1.default(ButtonBase_1.default) `
|
|
30
11
|
color: ${constants_1.get('colors.btn.text')};
|
|
31
12
|
background-color: ${constants_1.get('colors.btn.bg')};
|
|
@@ -54,7 +35,6 @@ const Button = styled_components_1.default(ButtonBase_1.default) `
|
|
|
54
35
|
border-color: ${constants_1.get('colors.btn.border')};
|
|
55
36
|
}
|
|
56
37
|
|
|
57
|
-
${ButtonBase_1.buttonSystemProps};
|
|
58
38
|
${sx_1.default};
|
|
59
39
|
`;
|
|
60
40
|
exports.default = Button;
|
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { FontSizeProps } from 'styled-system';
|
|
3
|
-
import { SystemCommonProps, SystemLayoutProps } from '../constants';
|
|
4
2
|
import { ComponentProps } from '../utils/types';
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
} & FontSizeProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>, string | number | symbol>, never>;
|
|
3
|
+
declare type StyledButtonBaseProps = {
|
|
4
|
+
as?: 'button' | 'a' | 'summary' | 'input' | string | React.ReactType;
|
|
5
|
+
variant?: 'small' | 'medium' | 'large';
|
|
6
|
+
};
|
|
7
|
+
declare const ButtonBase: import("styled-components").StyledComponent<"button", any, StyledButtonBaseProps, never>;
|
|
11
8
|
export declare type ButtonBaseProps = ComponentProps<typeof ButtonBase>;
|
|
12
9
|
export default ButtonBase;
|
package/lib/Button/ButtonBase.js
CHANGED
|
@@ -3,20 +3,16 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.default =
|
|
6
|
+
exports.default = void 0;
|
|
7
7
|
|
|
8
8
|
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
9
9
|
|
|
10
10
|
var _styledSystem = require("styled-system");
|
|
11
11
|
|
|
12
|
-
var _constants = require("../constants");
|
|
13
|
-
|
|
14
12
|
var _ButtonStyles = _interopRequireDefault(require("./ButtonStyles"));
|
|
15
13
|
|
|
16
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
15
|
|
|
18
|
-
const buttonSystemProps = (0, _styledSystem.compose)(_styledSystem.fontSize, _constants.COMMON, _constants.LAYOUT);
|
|
19
|
-
exports.buttonSystemProps = buttonSystemProps;
|
|
20
16
|
const variants = (0, _styledSystem.variant)({
|
|
21
17
|
variants: {
|
|
22
18
|
small: {
|
|
@@ -3,12 +3,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.buttonSystemProps = void 0;
|
|
7
6
|
const styled_components_1 = __importDefault(require("styled-components"));
|
|
8
7
|
const styled_system_1 = require("styled-system");
|
|
9
|
-
const constants_1 = require("../constants");
|
|
10
8
|
const ButtonStyles_1 = __importDefault(require("./ButtonStyles"));
|
|
11
|
-
exports.buttonSystemProps = styled_system_1.compose(styled_system_1.fontSize, constants_1.COMMON, constants_1.LAYOUT);
|
|
12
9
|
const variants = styled_system_1.variant({
|
|
13
10
|
variants: {
|
|
14
11
|
small: {
|