@primer/components 0.0.0-2021821174731 → 0.0.0-2021821193917
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +2 -28
- package/dist/browser.esm.js +619 -665
- package/dist/browser.esm.js.map +1 -1
- package/dist/browser.umd.js +386 -432
- package/dist/browser.umd.js.map +1 -1
- package/lib/ActionList/Divider.js +1 -1
- package/lib/ActionList/Header.js +2 -2
- package/lib/ActionList/Item.js +13 -13
- package/lib/ActionList/List.js +1 -1
- package/lib/AnchoredOverlay/AnchoredOverlay.js +2 -2
- package/lib/Autocomplete/Autocomplete.d.ts +36 -0
- package/lib/Autocomplete/Autocomplete.js +55 -0
- package/lib/Autocomplete/AutocompleteContext.d.ts +13 -0
- package/lib/Autocomplete/AutocompleteContext.js +14 -0
- package/lib/Autocomplete/AutocompleteInput.d.ts +9 -0
- package/lib/Autocomplete/AutocompleteInput.js +128 -0
- package/lib/Autocomplete/AutocompleteMenu.d.ts +54 -0
- package/lib/Autocomplete/AutocompleteMenu.js +268 -0
- package/lib/Autocomplete/index.d.ts +2 -0
- package/lib/Autocomplete/index.js +15 -0
- package/lib/Avatar.d.ts +0 -4
- package/lib/AvatarPair.js +1 -1
- package/lib/AvatarStack.js +1 -1
- package/lib/Badge/Badge.d.ts +8 -0
- package/lib/Badge/Badge.js +59 -0
- package/lib/Badge/BadgeState.d.ts +13 -0
- package/lib/Badge/BadgeState.js +51 -0
- package/lib/Badge/_badgeStyleUtils.d.ts +3 -0
- package/lib/Badge/_badgeStyleUtils.js +39 -0
- package/lib/BranchName.js +1 -1
- package/lib/Breadcrumb.js +2 -2
- package/lib/Button/Button.d.ts +1 -0
- package/lib/Button/Button.js +1 -1
- package/lib/Button/ButtonClose.d.ts +2 -1
- package/lib/Button/ButtonClose.js +1 -1
- package/lib/Button/ButtonDanger.d.ts +1 -0
- package/lib/Button/ButtonInvisible.d.ts +1 -0
- package/lib/Button/ButtonInvisible.js +1 -1
- package/lib/Button/ButtonOutline.d.ts +1 -0
- package/lib/Button/ButtonPrimary.d.ts +1 -0
- package/lib/Button/ButtonTableList.js +1 -1
- package/lib/CircleBadge.js +1 -1
- package/lib/CircleOcticon.d.ts +1 -0
- package/lib/CircleOcticon.js +1 -1
- package/lib/CounterLabel.js +2 -2
- package/lib/Dialog/ConfirmationDialog.js +1 -1
- package/lib/Dialog/Dialog.js +9 -9
- package/lib/Dialog.d.ts +3 -2
- package/lib/Dialog.js +4 -4
- package/lib/Dropdown.d.ts +4 -0
- package/lib/Dropdown.js +2 -2
- package/lib/DropdownMenu/DropdownButton.d.ts +2 -1
- package/lib/DropdownStyles.js +6 -6
- package/lib/FilterList.d.ts +1 -0
- package/lib/FilterList.js +1 -1
- package/lib/FilteredActionList/FilteredActionList.js +5 -5
- package/lib/Flash.js +1 -1
- package/lib/Label.js +2 -2
- package/lib/Link.js +1 -1
- package/lib/Overlay.d.ts +2 -1
- package/lib/Overlay.js +11 -6
- package/lib/Pagehead.js +1 -1
- package/lib/Pagination/Pagination.js +1 -1
- package/lib/Popover.js +1 -1
- package/lib/Position.d.ts +4 -4
- package/lib/ProgressBar.js +1 -1
- package/lib/SelectMenu/SelectMenu.d.ts +337 -15
- package/lib/SelectMenu/SelectMenuDivider.js +1 -1
- package/lib/SelectMenu/SelectMenuFilter.d.ts +1 -1
- package/lib/SelectMenu/SelectMenuFilter.js +1 -1
- package/lib/SelectMenu/SelectMenuFooter.js +1 -1
- package/lib/SelectMenu/SelectMenuHeader.js +2 -2
- package/lib/SelectMenu/SelectMenuItem.d.ts +1 -1
- package/lib/SelectMenu/SelectMenuItem.js +1 -1
- package/lib/SelectMenu/SelectMenuList.js +1 -1
- package/lib/SelectMenu/SelectMenuLoadingAnimation.js +1 -1
- package/lib/SelectMenu/SelectMenuModal.d.ts +1 -1
- package/lib/SelectMenu/SelectMenuModal.js +2 -2
- package/lib/SelectMenu/SelectMenuTab.js +1 -1
- package/lib/SelectMenu/SelectMenuTabPanel.js +1 -1
- package/lib/SideNav.js +5 -5
- package/lib/StateLabel.js +1 -1
- package/lib/SubNav.js +1 -1
- package/lib/TabNav.js +2 -2
- package/lib/TextInput.d.ts +6 -6
- package/lib/TextInput.js +16 -21
- package/lib/TextInputTokens.d.ts +32 -0
- package/lib/TextInputTokens.js +241 -0
- package/lib/TextInputWithTokens.d.ts +41 -0
- package/lib/TextInputWithTokens.js +396 -0
- package/lib/Timeline.d.ts +1 -0
- package/lib/Timeline.js +19 -16
- package/lib/Token/Token.d.ts +7 -0
- package/lib/Token/Token.js +69 -0
- package/lib/Token/TokenBase.d.ts +16 -0
- package/lib/Token/TokenBase.js +76 -0
- package/lib/Token/TokenLabel.d.ts +10 -0
- package/lib/Token/TokenLabel.js +115 -0
- package/lib/Token/TokenProfile.d.ts +7 -0
- package/lib/Token/TokenProfile.js +45 -0
- package/lib/Token/_AddTokenButton.d.ts +3 -0
- package/lib/Token/_AddTokenButton.js +42 -0
- package/lib/Token/_RemoveTokenButton.d.ts +3 -0
- package/lib/Token/_RemoveTokenButton.js +42 -0
- package/lib/Token/_tokenButtonUtils.d.ts +8 -0
- package/lib/Token/_tokenButtonUtils.js +42 -0
- package/lib/Tooltip.js +1 -1
- package/lib/UnderlineNav.js +2 -2
- package/lib/hooks/useOverlay.d.ts +2 -1
- package/lib/hooks/useOverlay.js +11 -6
- package/lib/index.d.ts +0 -1
- package/lib/index.js +0 -14
- package/lib/theme-preval.d.ts +6 -12
- package/lib/theme-preval.js +0 -940
- package/lib/utils/testing.d.ts +0 -1854
- package/lib/utils/uniqueId.js +0 -1
- package/lib-esm/ActionList/Divider.js +1 -1
- package/lib-esm/ActionList/Header.js +2 -2
- package/lib-esm/ActionList/Item.js +14 -14
- package/lib-esm/ActionList/List.js +1 -1
- package/lib-esm/AnchoredOverlay/AnchoredOverlay.js +3 -3
- package/lib-esm/Autocomplete/Autocomplete.d.ts +36 -0
- package/lib-esm/Autocomplete/Autocomplete.js +36 -0
- package/lib-esm/Autocomplete/AutocompleteContext.d.ts +13 -0
- package/lib-esm/Autocomplete/AutocompleteContext.js +5 -0
- package/lib-esm/Autocomplete/AutocompleteInput.d.ts +9 -0
- package/lib-esm/Autocomplete/AutocompleteInput.js +109 -0
- package/lib-esm/Autocomplete/AutocompleteMenu.d.ts +54 -0
- package/lib-esm/Autocomplete/AutocompleteMenu.js +244 -0
- package/lib-esm/Autocomplete/index.d.ts +2 -0
- package/lib-esm/Autocomplete/index.js +1 -0
- package/lib-esm/Avatar.d.ts +0 -4
- package/lib-esm/AvatarPair.js +1 -1
- package/lib-esm/AvatarStack.js +1 -1
- package/lib-esm/Badge/Badge.d.ts +8 -0
- package/lib-esm/Badge/Badge.js +44 -0
- package/lib-esm/Badge/BadgeState.d.ts +13 -0
- package/lib-esm/Badge/BadgeState.js +40 -0
- package/lib-esm/Badge/_badgeStyleUtils.d.ts +3 -0
- package/lib-esm/Badge/_badgeStyleUtils.js +29 -0
- package/lib-esm/BranchName.js +1 -1
- package/lib-esm/Breadcrumb.js +2 -2
- package/lib-esm/Button/Button.d.ts +1 -0
- package/lib-esm/Button/Button.js +1 -1
- package/lib-esm/Button/ButtonClose.d.ts +2 -1
- package/lib-esm/Button/ButtonClose.js +1 -1
- package/lib-esm/Button/ButtonDanger.d.ts +1 -0
- package/lib-esm/Button/ButtonInvisible.d.ts +1 -0
- package/lib-esm/Button/ButtonInvisible.js +1 -1
- package/lib-esm/Button/ButtonOutline.d.ts +1 -0
- package/lib-esm/Button/ButtonPrimary.d.ts +1 -0
- package/lib-esm/Button/ButtonTableList.js +1 -1
- package/lib-esm/CircleBadge.js +1 -1
- package/lib-esm/CircleOcticon.d.ts +1 -0
- package/lib-esm/CircleOcticon.js +1 -1
- package/lib-esm/CounterLabel.js +2 -2
- package/lib-esm/Dialog/ConfirmationDialog.js +1 -1
- package/lib-esm/Dialog/Dialog.js +8 -8
- package/lib-esm/Dialog.d.ts +3 -2
- package/lib-esm/Dialog.js +4 -4
- package/lib-esm/Dropdown.d.ts +4 -0
- package/lib-esm/Dropdown.js +2 -2
- package/lib-esm/DropdownMenu/DropdownButton.d.ts +2 -1
- package/lib-esm/DropdownStyles.js +6 -6
- package/lib-esm/FilterList.d.ts +1 -0
- package/lib-esm/FilterList.js +1 -1
- package/lib-esm/FilteredActionList/FilteredActionList.js +5 -5
- package/lib-esm/Flash.js +1 -1
- package/lib-esm/Label.js +2 -2
- package/lib-esm/Link.js +1 -1
- package/lib-esm/Overlay.d.ts +2 -1
- package/lib-esm/Overlay.js +9 -6
- package/lib-esm/Pagehead.js +1 -1
- package/lib-esm/Pagination/Pagination.js +1 -1
- package/lib-esm/Popover.js +1 -1
- package/lib-esm/Position.d.ts +4 -4
- package/lib-esm/ProgressBar.js +1 -1
- package/lib-esm/SelectMenu/SelectMenu.d.ts +337 -15
- package/lib-esm/SelectMenu/SelectMenuDivider.js +1 -1
- package/lib-esm/SelectMenu/SelectMenuFilter.d.ts +1 -1
- package/lib-esm/SelectMenu/SelectMenuFilter.js +1 -1
- package/lib-esm/SelectMenu/SelectMenuFooter.js +1 -1
- package/lib-esm/SelectMenu/SelectMenuHeader.js +2 -2
- package/lib-esm/SelectMenu/SelectMenuItem.d.ts +1 -1
- package/lib-esm/SelectMenu/SelectMenuItem.js +1 -1
- package/lib-esm/SelectMenu/SelectMenuList.js +1 -1
- package/lib-esm/SelectMenu/SelectMenuLoadingAnimation.js +1 -1
- package/lib-esm/SelectMenu/SelectMenuModal.d.ts +1 -1
- package/lib-esm/SelectMenu/SelectMenuModal.js +2 -2
- package/lib-esm/SelectMenu/SelectMenuTab.js +1 -1
- package/lib-esm/SelectMenu/SelectMenuTabPanel.js +1 -1
- package/lib-esm/SideNav.js +5 -5
- package/lib-esm/StateLabel.js +1 -1
- package/lib-esm/SubNav.js +1 -1
- package/lib-esm/TabNav.js +2 -2
- package/lib-esm/TextInput.d.ts +6 -6
- package/lib-esm/TextInput.js +16 -22
- package/lib-esm/TextInputTokens.d.ts +32 -0
- package/lib-esm/TextInputTokens.js +211 -0
- package/lib-esm/TextInputWithTokens.d.ts +41 -0
- package/lib-esm/TextInputWithTokens.js +361 -0
- package/lib-esm/Timeline.d.ts +1 -0
- package/lib-esm/Timeline.js +17 -12
- package/lib-esm/Token/Token.d.ts +7 -0
- package/lib-esm/Token/Token.js +49 -0
- package/lib-esm/Token/TokenBase.d.ts +16 -0
- package/lib-esm/Token/TokenBase.js +56 -0
- package/lib-esm/Token/TokenLabel.d.ts +10 -0
- package/lib-esm/Token/TokenLabel.js +99 -0
- package/lib-esm/Token/TokenProfile.d.ts +7 -0
- package/lib-esm/Token/TokenProfile.js +28 -0
- package/lib-esm/Token/_AddTokenButton.d.ts +3 -0
- package/lib-esm/Token/_AddTokenButton.js +27 -0
- package/lib-esm/Token/_RemoveTokenButton.d.ts +3 -0
- package/lib-esm/Token/_RemoveTokenButton.js +27 -0
- package/lib-esm/Token/_tokenButtonUtils.d.ts +8 -0
- package/lib-esm/Token/_tokenButtonUtils.js +26 -0
- package/lib-esm/Tooltip.js +1 -1
- package/lib-esm/UnderlineNav.js +2 -2
- package/lib-esm/hooks/useOverlay.d.ts +2 -1
- package/lib-esm/hooks/useOverlay.js +11 -6
- package/lib-esm/index.d.ts +0 -1
- package/lib-esm/index.js +1 -2
- package/lib-esm/theme-preval.d.ts +6 -12
- package/lib-esm/theme-preval.js +0 -940
- package/lib-esm/utils/testing.d.ts +0 -1854
- package/lib-esm/utils/uniqueId.js +0 -1
- package/package.json +7 -6
- package/lib/utils/ssr.d.ts +0 -1
- package/lib/utils/ssr.js +0 -19
- package/lib-esm/utils/ssr.d.ts +0 -1
- package/lib-esm/utils/ssr.js +0 -1
@@ -0,0 +1,268 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.default = void 0;
|
7
|
+
|
8
|
+
var _react = _interopRequireWildcard(require("react"));
|
9
|
+
|
10
|
+
var _ActionList = require("../ActionList");
|
11
|
+
|
12
|
+
var _hooks = require("../hooks");
|
13
|
+
|
14
|
+
var _useFocusZone = require("../hooks/useFocusZone");
|
15
|
+
|
16
|
+
var _Overlay = _interopRequireDefault(require("../Overlay"));
|
17
|
+
|
18
|
+
var _ = require("../");
|
19
|
+
|
20
|
+
var _Portal = require("../Portal");
|
21
|
+
|
22
|
+
var _AutocompleteContext = require("./AutocompleteContext");
|
23
|
+
|
24
|
+
var _useCombinedRefs = require("../hooks/useCombinedRefs");
|
25
|
+
|
26
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
27
|
+
|
28
|
+
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); }
|
29
|
+
|
30
|
+
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; }
|
31
|
+
|
32
|
+
const DROPDOWN_PORTAL_CONTAINER_NAME = '__listcontainerportal__';
|
33
|
+
|
34
|
+
const getDefaultSortFn = isItemSelectedFn => (itemIdA, itemIdB) => isItemSelectedFn(itemIdA) === isItemSelectedFn(itemIdB) ? 0 : isItemSelectedFn(itemIdA) ? -1 : 1;
|
35
|
+
|
36
|
+
function scrollIntoViewingArea(child, container, margin = 8, behavior = 'smooth') {
|
37
|
+
const {
|
38
|
+
top: childTop,
|
39
|
+
bottom: childBottom
|
40
|
+
} = child.getBoundingClientRect();
|
41
|
+
const {
|
42
|
+
top: containerTop,
|
43
|
+
bottom: containerBottom
|
44
|
+
} = container.getBoundingClientRect();
|
45
|
+
const isChildTopAboveViewingArea = childTop < containerTop + margin;
|
46
|
+
const isChildBottomBelowViewingArea = childBottom > containerBottom - margin;
|
47
|
+
|
48
|
+
if (isChildTopAboveViewingArea) {
|
49
|
+
const scrollHeightToChildTop = childTop - containerTop + container.scrollTop;
|
50
|
+
container.scrollTo({
|
51
|
+
behavior,
|
52
|
+
top: scrollHeightToChildTop - margin
|
53
|
+
});
|
54
|
+
} else if (isChildBottomBelowViewingArea) {
|
55
|
+
const scrollHeightToChildBottom = childBottom - containerBottom + container.scrollTop;
|
56
|
+
container.scrollTo({
|
57
|
+
behavior,
|
58
|
+
top: scrollHeightToChildBottom + margin
|
59
|
+
});
|
60
|
+
} // either completely in view or outside viewing area on both ends, don't scroll
|
61
|
+
|
62
|
+
}
|
63
|
+
|
64
|
+
const defaultItemFilter = filterValue => (item, _i) => {
|
65
|
+
var _item$text;
|
66
|
+
|
67
|
+
return Boolean(item === null || item === void 0 ? void 0 : (_item$text = item.text) === null || _item$text === void 0 ? void 0 : _item$text.toLowerCase().startsWith(filterValue.toLowerCase()));
|
68
|
+
}; // TODO:
|
69
|
+
// insteaad of using `forwardRef`, just use a regular Functional Component
|
70
|
+
// get rid of unused props
|
71
|
+
|
72
|
+
|
73
|
+
const AutocompleteMenu = /*#__PURE__*/_react.default.forwardRef(({
|
74
|
+
items,
|
75
|
+
selectedItemIds,
|
76
|
+
selectedSortFn,
|
77
|
+
onItemSelect,
|
78
|
+
onItemDeselect,
|
79
|
+
emptyStateText,
|
80
|
+
addNewItem,
|
81
|
+
loading,
|
82
|
+
selectionVariant,
|
83
|
+
filterFn: externalFilterFn,
|
84
|
+
width,
|
85
|
+
height,
|
86
|
+
maxHeight
|
87
|
+
}, ref) => {
|
88
|
+
const {
|
89
|
+
activeDescendantRef,
|
90
|
+
inputRef,
|
91
|
+
inputValue = '',
|
92
|
+
setAutocompleteSuggestion,
|
93
|
+
setShowMenu,
|
94
|
+
setInputValue,
|
95
|
+
setIsMenuDirectlyActivated,
|
96
|
+
showMenu
|
97
|
+
} = (0, _react.useContext)(_AutocompleteContext.AutocompleteContext);
|
98
|
+
const filterFn = externalFilterFn ? externalFilterFn : defaultItemFilter(inputValue);
|
99
|
+
const listContainerRef = (0, _react.useRef)(null);
|
100
|
+
const scrollContainerRef = (0, _react.useRef)(null);
|
101
|
+
const [highlightedItem, setHighlightedItem] = (0, _react.useState)(); // TODO: clean up this mess by making id required on ItemProps
|
102
|
+
|
103
|
+
const [sortedItemIds, setSortedItemIds] = (0, _react.useState)(items.map(({
|
104
|
+
id
|
105
|
+
}) => id || id === 0 ? id : ''));
|
106
|
+
const {
|
107
|
+
floatingElementRef,
|
108
|
+
position
|
109
|
+
} = (0, _hooks.useAnchoredPosition)({
|
110
|
+
side: 'outside-bottom',
|
111
|
+
align: 'start',
|
112
|
+
anchorElementRef: inputRef
|
113
|
+
}, [showMenu, selectedItemIds]);
|
114
|
+
const combinedOverlayRef = (0, _useCombinedRefs.useCombinedRefs)(scrollContainerRef, floatingElementRef);
|
115
|
+
|
116
|
+
const closeOptionList = () => {
|
117
|
+
if (setShowMenu) {
|
118
|
+
setShowMenu(false);
|
119
|
+
}
|
120
|
+
};
|
121
|
+
|
122
|
+
const isItemSelected = itemId => {
|
123
|
+
var _items$find;
|
124
|
+
|
125
|
+
return ((_items$find = items.find(selectableItem => selectableItem.id === itemId)) === null || _items$find === void 0 ? void 0 : _items$find.selected) || selectedItemIds.includes(itemId);
|
126
|
+
};
|
127
|
+
|
128
|
+
const itemsToRender = [// selectable tokens
|
129
|
+
...items.map(selectableItem => {
|
130
|
+
return { ...selectableItem,
|
131
|
+
//TODO: just make `id` required
|
132
|
+
selected: selectionVariant === 'multiple' ? isItemSelected(selectableItem.id) : undefined,
|
133
|
+
onAction: (item, e) => {
|
134
|
+
// TODO: clean up all of these `if/else` statements
|
135
|
+
if (item.selected) {
|
136
|
+
// TODO: make `onItemDeselect` optional
|
137
|
+
if (onItemDeselect) {
|
138
|
+
onItemDeselect(item, e);
|
139
|
+
}
|
140
|
+
} else {
|
141
|
+
// TODO: make `onItemSelect` optional
|
142
|
+
if (onItemSelect) {
|
143
|
+
onItemSelect(item, e);
|
144
|
+
}
|
145
|
+
|
146
|
+
if (selectionVariant === 'multiple') {
|
147
|
+
if (setInputValue) {
|
148
|
+
setInputValue('');
|
149
|
+
}
|
150
|
+
|
151
|
+
if (setAutocompleteSuggestion) {
|
152
|
+
setAutocompleteSuggestion('');
|
153
|
+
}
|
154
|
+
}
|
155
|
+
}
|
156
|
+
|
157
|
+
if (selectionVariant === 'single') {
|
158
|
+
if (setShowMenu) {
|
159
|
+
setShowMenu(false);
|
160
|
+
}
|
161
|
+
|
162
|
+
if (inputRef !== null && inputRef !== void 0 && inputRef.current) {
|
163
|
+
inputRef.current.setSelectionRange(inputRef.current.value.length, inputRef.current.value.length);
|
164
|
+
}
|
165
|
+
}
|
166
|
+
}
|
167
|
+
};
|
168
|
+
}), // menu item used for creating a token from whatever is in the text input
|
169
|
+
...(addNewItem ? [{ ...addNewItem,
|
170
|
+
onAction: onItemSelect ? (_item, e) => {
|
171
|
+
onItemSelect({
|
172
|
+
text: inputValue,
|
173
|
+
id: `randomlyGeneratedId-${inputValue}`
|
174
|
+
}, e);
|
175
|
+
} : undefined
|
176
|
+
}] : [])];
|
177
|
+
(0, _useFocusZone.useFocusZone)({
|
178
|
+
containerRef: listContainerRef,
|
179
|
+
focusOutBehavior: 'wrap',
|
180
|
+
focusableElementFilter: element => {
|
181
|
+
return !(element instanceof HTMLInputElement);
|
182
|
+
},
|
183
|
+
activeDescendantFocus: inputRef,
|
184
|
+
onActiveDescendantChanged: (current, _previous, directlyActivated) => {
|
185
|
+
if (activeDescendantRef) {
|
186
|
+
activeDescendantRef.current = current || null;
|
187
|
+
}
|
188
|
+
|
189
|
+
if (current) {
|
190
|
+
const selectedItem = itemsToRender.find(item => {
|
191
|
+
var _item$id;
|
192
|
+
|
193
|
+
return ((_item$id = item.id) === null || _item$id === void 0 ? void 0 : _item$id.toString()) === (current === null || current === void 0 ? void 0 : current.dataset.id);
|
194
|
+
});
|
195
|
+
setHighlightedItem({ ...selectedItem,
|
196
|
+
isDirectlyActivated: directlyActivated
|
197
|
+
});
|
198
|
+
|
199
|
+
if (setIsMenuDirectlyActivated) {
|
200
|
+
setIsMenuDirectlyActivated(directlyActivated);
|
201
|
+
}
|
202
|
+
}
|
203
|
+
|
204
|
+
if (current && scrollContainerRef.current && directlyActivated) {
|
205
|
+
scrollIntoViewingArea(current, scrollContainerRef.current);
|
206
|
+
}
|
207
|
+
}
|
208
|
+
});
|
209
|
+
(0, _react.useEffect)(() => {
|
210
|
+
var _highlightedItem$text;
|
211
|
+
|
212
|
+
if (!setAutocompleteSuggestion) {
|
213
|
+
return;
|
214
|
+
}
|
215
|
+
|
216
|
+
if (highlightedItem !== null && highlightedItem !== void 0 && (_highlightedItem$text = highlightedItem.text) !== null && _highlightedItem$text !== void 0 && _highlightedItem$text.startsWith(inputValue || '')) {
|
217
|
+
setAutocompleteSuggestion(highlightedItem.text);
|
218
|
+
} else {
|
219
|
+
setAutocompleteSuggestion('');
|
220
|
+
}
|
221
|
+
}, [highlightedItem, inputValue]);
|
222
|
+
(0, _react.useEffect)(() => {
|
223
|
+
setSortedItemIds([...sortedItemIds].sort(selectedSortFn ? selectedSortFn : getDefaultSortFn(isItemSelected)));
|
224
|
+
}, [showMenu]);
|
225
|
+
|
226
|
+
if (listContainerRef.current) {
|
227
|
+
(0, _Portal.registerPortalRoot)(listContainerRef.current, DROPDOWN_PORTAL_CONTAINER_NAME);
|
228
|
+
}
|
229
|
+
|
230
|
+
const itemSortOrderData = sortedItemIds.reduce((acc, curr, i) => {
|
231
|
+
acc[curr] = i;
|
232
|
+
return acc;
|
233
|
+
}, {});
|
234
|
+
const sortedAndFilteredItemsToRender = [...(filterFn ? itemsToRender.filter(filterFn) : itemsToRender)].sort((a, b) => itemSortOrderData[a.id] - itemSortOrderData[b.id]);
|
235
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
236
|
+
ref: listContainerRef
|
237
|
+
}, showMenu && emptyStateText ? /*#__PURE__*/_react.default.createElement(_Overlay.default, {
|
238
|
+
returnFocusRef: inputRef,
|
239
|
+
portalContainerName: DROPDOWN_PORTAL_CONTAINER_NAME,
|
240
|
+
preventFocusOnOpen: true,
|
241
|
+
onClickOutside: closeOptionList,
|
242
|
+
onEscape: closeOptionList,
|
243
|
+
ref: combinedOverlayRef,
|
244
|
+
top: position === null || position === void 0 ? void 0 : position.top,
|
245
|
+
left: position === null || position === void 0 ? void 0 : position.left,
|
246
|
+
width: width,
|
247
|
+
height: height,
|
248
|
+
maxHeight: maxHeight
|
249
|
+
}, loading ? /*#__PURE__*/_react.default.createElement(_.Box, {
|
250
|
+
p: 3,
|
251
|
+
display: "flex",
|
252
|
+
justifyContent: "center"
|
253
|
+
}, /*#__PURE__*/_react.default.createElement(_.Spinner, null)) : /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, sortedAndFilteredItemsToRender.length ? /*#__PURE__*/_react.default.createElement(_ActionList.ActionList, {
|
254
|
+
selectionVariant: "multiple",
|
255
|
+
items: sortedAndFilteredItemsToRender,
|
256
|
+
role: "listbox"
|
257
|
+
}) : /*#__PURE__*/_react.default.createElement(_.Box, {
|
258
|
+
p: 3
|
259
|
+
}, emptyStateText))) : null);
|
260
|
+
});
|
261
|
+
|
262
|
+
AutocompleteMenu.defaultProps = {
|
263
|
+
emptyStateText: 'No selectable options',
|
264
|
+
selectionVariant: 'single'
|
265
|
+
};
|
266
|
+
AutocompleteMenu.displayName = 'AutocompleteMenu';
|
267
|
+
var _default = AutocompleteMenu;
|
268
|
+
exports.default = _default;
|
@@ -0,0 +1,15 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
Object.defineProperty(exports, "default", {
|
7
|
+
enumerable: true,
|
8
|
+
get: function () {
|
9
|
+
return _Autocomplete.default;
|
10
|
+
}
|
11
|
+
});
|
12
|
+
|
13
|
+
var _Autocomplete = _interopRequireDefault(require("./Autocomplete"));
|
14
|
+
|
15
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
package/lib/Avatar.d.ts
CHANGED
@@ -6,10 +6,6 @@ declare const Avatar: import("styled-components").StyledComponent<"img", any, {
|
|
6
6
|
size?: number | undefined;
|
7
7
|
/** Sets the shape of the avatar to a square if true. If false, the avatar will be circular. */
|
8
8
|
square?: boolean | undefined;
|
9
|
-
/** URL of the avatar image. */
|
10
|
-
src: string;
|
11
|
-
/** Provide alt text when the Avatar is used without the user's name next to it. */
|
12
|
-
alt?: string | undefined;
|
13
9
|
} & SystemCommonProps & SxProp, never>;
|
14
10
|
export declare type AvatarProps = ComponentProps<typeof Avatar>;
|
15
11
|
export default Avatar;
|
package/lib/AvatarPair.js
CHANGED
@@ -33,7 +33,7 @@ const AvatarPair = ({
|
|
33
33
|
return i === 0 ? /*#__PURE__*/_react.default.cloneElement(child, {
|
34
34
|
size: 40
|
35
35
|
}) : /*#__PURE__*/_react.default.createElement(ChildAvatar, _extends({
|
36
|
-
bg: "canvas
|
36
|
+
bg: "bg.canvas"
|
37
37
|
}, child.props, {
|
38
38
|
size: 20
|
39
39
|
}));
|
package/lib/AvatarStack.js
CHANGED
@@ -24,7 +24,7 @@ function _extends() { _extends = Object.assign || function (target) { for (var i
|
|
24
24
|
const AvatarStackWrapper = _styledComponents.default.span.withConfig({
|
25
25
|
displayName: "AvatarStack__AvatarStackWrapper",
|
26
26
|
componentId: "sc-1qgzd2v-0"
|
27
|
-
})(["display:flex;position:relative;height:20px;min-width:", ";.pc-AvatarItem{flex-shrink:0;height:20px;width:20px;box-shadow:0 0 0 1px ", ";margin-left:-11px;position:relative;overflow:hidden;transition:margin 0.2s ease-in-out,opacity 0.2s ease-in-out,visibility 0.2s ease-in-out,box-shadow 0.1s ease-in-out;&:first-child{margin-left:0;}&:nth-child(n + 4){display:none;}}&.pc-AvatarStack--two{min-width:30px;.pc-AvatarItem{&:nth-child(n + 3){display:none;}}}&.pc-AvatarStack--three-plus{min-width:38px;.pc-AvatarItem{&:nth-child(3){opacity:", "%;margin-left:-17px;}&:nth-child(4){opacity:", "%;margin-left:-17px;}&:nth-child(5){opacity:", "%;margin-left:-17px;}&:nth-child(n + 4){display:block;}&:nth-child(n + 6){opacity:0;visibility:hidden;}}}&.pc-AvatarStack--right{justify-content:flex-end;.pc-AvatarItem{margin-left:0 !important;margin-right:-11px;&:first-child{margin-right:0;}}.pc-AvatarStackBody{flex-direction:row-reverse;&:hover{.pc-AvatarItem{margin-right:", "!important;margin-left:0 !important;&:first-child{margin-right:0 !important;}}}}}&.pc-AvatarStack--three-plus.pc-AvatarStack--right{.pc-AvatarItem{&:nth-child(3){margin-right:-17px;}&:nth-child(4){margin-right:-17px;}&:nth-child(5){margin-right:-17px;}}}.pc-AvatarStackBody:hover{width:auto;.pc-AvatarItem{margin-left:", ";opacity:100%;visibility:visible;box-shadow:0 0 0 4px ", ";&:first-child{margin-left:0;}}}", " ", ";"], props => props.count === 1 ? '20px' : props.count === 2 ? '30px' : '38px', (0, _constants.get)('colors.canvas
|
27
|
+
})(["display:flex;position:relative;height:20px;min-width:", ";.pc-AvatarItem{flex-shrink:0;height:20px;width:20px;box-shadow:0 0 0 1px ", ";margin-left:-11px;position:relative;overflow:hidden;transition:margin 0.2s ease-in-out,opacity 0.2s ease-in-out,visibility 0.2s ease-in-out,box-shadow 0.1s ease-in-out;&:first-child{margin-left:0;}&:nth-child(n + 4){display:none;}}&.pc-AvatarStack--two{min-width:30px;.pc-AvatarItem{&:nth-child(n + 3){display:none;}}}&.pc-AvatarStack--three-plus{min-width:38px;.pc-AvatarItem{&:nth-child(3){opacity:", "%;margin-left:-17px;}&:nth-child(4){opacity:", "%;margin-left:-17px;}&:nth-child(5){opacity:", "%;margin-left:-17px;}&:nth-child(n + 4){display:block;}&:nth-child(n + 6){opacity:0;visibility:hidden;}}}&.pc-AvatarStack--right{justify-content:flex-end;.pc-AvatarItem{margin-left:0 !important;margin-right:-11px;&:first-child{margin-right:0;}}.pc-AvatarStackBody{flex-direction:row-reverse;&:hover{.pc-AvatarItem{margin-right:", "!important;margin-left:0 !important;&:first-child{margin-right:0 !important;}}}}}&.pc-AvatarStack--three-plus.pc-AvatarStack--right{.pc-AvatarItem{&:nth-child(3){margin-right:-17px;}&:nth-child(4){margin-right:-17px;}&:nth-child(5){margin-right:-17px;}}}.pc-AvatarStackBody:hover{width:auto;.pc-AvatarItem{margin-left:", ";opacity:100%;visibility:visible;box-shadow:0 0 0 4px ", ";&:first-child{margin-left:0;}}}", " ", ";"], props => props.count === 1 ? '20px' : props.count === 2 ? '30px' : '38px', (0, _constants.get)('colors.bg.canvas'), 100 - 3 * 15, 100 - 4 * 15, 100 - 5 * 15, (0, _constants.get)('space.1'), (0, _constants.get)('space.1'), (0, _constants.get)('colors.bg.canvas'), _constants.COMMON, _sx.default);
|
28
28
|
|
29
29
|
const transformChildren = children => {
|
30
30
|
return _react.default.Children.map(children, (child, index) => {
|
@@ -0,0 +1,8 @@
|
|
1
|
+
import { BadgeSizeKeys } from './_badgeStyleUtils';
|
2
|
+
declare type BadgeColorOptions = 'default' | 'primary' | 'secondary' | 'info' | 'success' | 'warning' | 'danger';
|
3
|
+
interface Props {
|
4
|
+
color?: BadgeColorOptions;
|
5
|
+
variant?: BadgeSizeKeys;
|
6
|
+
}
|
7
|
+
declare const Badge: import("styled-components").StyledComponent<"span", any, Props, never>;
|
8
|
+
export default Badge;
|
@@ -0,0 +1,59 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.default = void 0;
|
7
|
+
|
8
|
+
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
9
|
+
|
10
|
+
var _constants = require("../constants");
|
11
|
+
|
12
|
+
var _badgeStyleUtils = require("./_badgeStyleUtils");
|
13
|
+
|
14
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
15
|
+
|
16
|
+
const badgeColorMap = {
|
17
|
+
default: {
|
18
|
+
borderColor: (0, _constants.get)('colors.border.default')
|
19
|
+
},
|
20
|
+
primary: {
|
21
|
+
borderColor: (0, _constants.get)('colors.fg.default')
|
22
|
+
},
|
23
|
+
secondary: {
|
24
|
+
borderColor: (0, _constants.get)('colors.border.muted'),
|
25
|
+
textColor: (0, _constants.get)('colors.fg.muted')
|
26
|
+
},
|
27
|
+
info: {
|
28
|
+
borderColor: (0, _constants.get)('colors.accent.fg'),
|
29
|
+
textColor: (0, _constants.get)('colors.accent.fg')
|
30
|
+
},
|
31
|
+
success: {
|
32
|
+
borderColor: (0, _constants.get)('colors.success.fg'),
|
33
|
+
textColor: (0, _constants.get)('colors.success.emphasis')
|
34
|
+
},
|
35
|
+
warning: {
|
36
|
+
borderColor: (0, _constants.get)('colors.attention.fg'),
|
37
|
+
textColor: (0, _constants.get)('colors.attention.emphasis')
|
38
|
+
},
|
39
|
+
danger: {
|
40
|
+
borderColor: (0, _constants.get)('colors.danger.fg'),
|
41
|
+
textColor: (0, _constants.get)('colors.danger.emphasis')
|
42
|
+
}
|
43
|
+
};
|
44
|
+
|
45
|
+
const Badge = _styledComponents.default.span.withConfig({
|
46
|
+
displayName: "Badge",
|
47
|
+
componentId: "sc-15t9m5z-0"
|
48
|
+
})(["align-items:center;background-color:transparent;border-width:1px;border-radius:999px;border-style:solid;border-color:", ";color:", ";display:inline-flex;font-weight:", ";line-height:1;white-space:nowrap;", ";"], ({
|
49
|
+
color = 'default'
|
50
|
+
}) => badgeColorMap[color].borderColor, ({
|
51
|
+
color = 'default'
|
52
|
+
}) => badgeColorMap[color].textColor, (0, _constants.get)('fontWeights.bold'), _badgeStyleUtils.badgeVariants);
|
53
|
+
|
54
|
+
Badge.defaultProps = {
|
55
|
+
variant: 'sm',
|
56
|
+
color: 'default'
|
57
|
+
};
|
58
|
+
var _default = Badge;
|
59
|
+
exports.default = _default;
|
@@ -0,0 +1,13 @@
|
|
1
|
+
/// <reference types="react" />
|
2
|
+
import { IconProps } from '@primer/octicons-react';
|
3
|
+
import { BadgeSizeKeys } from './_badgeStyleUtils';
|
4
|
+
declare type BadgeStateColorOptions = 'default' | 'open' | 'merged' | 'closed';
|
5
|
+
interface Props {
|
6
|
+
color?: BadgeStateColorOptions;
|
7
|
+
icon?: React.ComponentType<{
|
8
|
+
size?: IconProps['size'];
|
9
|
+
}>;
|
10
|
+
variant?: BadgeSizeKeys;
|
11
|
+
}
|
12
|
+
declare const BadgeState: React.FC<Props>;
|
13
|
+
export default BadgeState;
|
@@ -0,0 +1,51 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.default = void 0;
|
7
|
+
|
8
|
+
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
9
|
+
|
10
|
+
var _constants = require("../constants");
|
11
|
+
|
12
|
+
var _badgeStyleUtils = require("./_badgeStyleUtils");
|
13
|
+
|
14
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
15
|
+
|
16
|
+
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); }
|
17
|
+
|
18
|
+
const badgeStateColorMap = {
|
19
|
+
default: (0, _constants.get)('colors.neutral.emphasis'),
|
20
|
+
open: (0, _constants.get)('colors.success.emphasis'),
|
21
|
+
merged: (0, _constants.get)('colors.done.emphasis'),
|
22
|
+
closed: (0, _constants.get)('colors.danger.emphasis')
|
23
|
+
}; // const badgeStateIconSizeMap: Record<BadgeSizeKeys, number> = {
|
24
|
+
// 'sm':
|
25
|
+
// };
|
26
|
+
|
27
|
+
const StyledBadgeState = _styledComponents.default.span.withConfig({
|
28
|
+
displayName: "BadgeState__StyledBadgeState",
|
29
|
+
componentId: "sc-5hwzjt-0"
|
30
|
+
})(["align-items:center;background-color:", ";border-radius:999px;color:", ";display:inline-flex;font-weight:", ";gap:", ";line-height:1;white-space:nowrap;", ";"], ({
|
31
|
+
color = 'default'
|
32
|
+
}) => badgeStateColorMap[color], (0, _constants.get)('colors.fg.onEmphasis'), (0, _constants.get)('fontWeights.bold'), (0, _constants.get)('space.1'), _badgeStyleUtils.badgeVariants);
|
33
|
+
|
34
|
+
const BadgeState = ({
|
35
|
+
children,
|
36
|
+
icon: IconComponent,
|
37
|
+
variant,
|
38
|
+
...rest
|
39
|
+
}) => /*#__PURE__*/React.createElement(StyledBadgeState, _extends({
|
40
|
+
variant: variant
|
41
|
+
}, rest), IconComponent ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(IconComponent, {
|
42
|
+
size: variant === 'sm' ? 12 : 'small'
|
43
|
+
}), children) : children);
|
44
|
+
|
45
|
+
BadgeState.displayName = "BadgeState";
|
46
|
+
BadgeState.defaultProps = {
|
47
|
+
variant: 'lg',
|
48
|
+
color: 'default'
|
49
|
+
};
|
50
|
+
var _default = BadgeState;
|
51
|
+
exports.default = _default;
|
@@ -0,0 +1,39 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.badgeVariants = exports.badgeSizes = void 0;
|
7
|
+
|
8
|
+
var _styledSystem = require("styled-system");
|
9
|
+
|
10
|
+
// TODO: consider moving to Primitives
|
11
|
+
const badgeSizes = {
|
12
|
+
sm: 20,
|
13
|
+
md: 24,
|
14
|
+
lg: 32
|
15
|
+
};
|
16
|
+
exports.badgeSizes = badgeSizes;
|
17
|
+
const badgeVariants = (0, _styledSystem.variant)({
|
18
|
+
variants: {
|
19
|
+
sm: {
|
20
|
+
fontSize: 0,
|
21
|
+
height: `${badgeSizes.sm}px`,
|
22
|
+
paddingLeft: 2,
|
23
|
+
paddingRight: 2
|
24
|
+
},
|
25
|
+
md: {
|
26
|
+
fontSize: 0,
|
27
|
+
height: `${badgeSizes.md}px`,
|
28
|
+
paddingLeft: 2,
|
29
|
+
paddingRight: 2
|
30
|
+
},
|
31
|
+
lg: {
|
32
|
+
fontSize: 1,
|
33
|
+
height: `${badgeSizes.lg}px`,
|
34
|
+
paddingLeft: 3,
|
35
|
+
paddingRight: 3
|
36
|
+
}
|
37
|
+
}
|
38
|
+
});
|
39
|
+
exports.badgeVariants = badgeVariants;
|
package/lib/BranchName.js
CHANGED
@@ -16,7 +16,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
16
16
|
const BranchName = _styledComponents.default.a.withConfig({
|
17
17
|
displayName: "BranchName",
|
18
18
|
componentId: "sc-167ouzm-0"
|
19
|
-
})(["display:inline-block;padding:2px 6px;font-size:", ";font-family:", ";color:", ";background-color:", ";border-radius:", ";", ";", ";"], (0, _constants.get)('fontSizes.0'), (0, _constants.get)('fonts.mono'), (0, _constants.get)('colors.
|
19
|
+
})(["display:inline-block;padding:2px 6px;font-size:", ";font-family:", ";color:", ";background-color:", ";border-radius:", ";", ";", ";"], (0, _constants.get)('fontSizes.0'), (0, _constants.get)('fonts.mono'), (0, _constants.get)('colors.branchName.text'), (0, _constants.get)('colors.branchName.bg'), (0, _constants.get)('radii.2'), _constants.COMMON, _sx.default);
|
20
20
|
|
21
21
|
var _default = BranchName;
|
22
22
|
exports.default = _default;
|
package/lib/Breadcrumb.js
CHANGED
@@ -26,7 +26,7 @@ const SELECTED_CLASS = 'selected';
|
|
26
26
|
const Wrapper = _styledComponents.default.li.withConfig({
|
27
27
|
displayName: "Breadcrumb__Wrapper",
|
28
28
|
componentId: "c1r3ff-0"
|
29
|
-
})(["display:inline-block;white-space:nowrap;list-style:none;&::after{padding-right:0.5em;padding-left:0.5em;color:", ";font-size:", ";content:'/';}&:first-child{margin-left:0;}&:last-child{&::after{content:none;}}"], (0, _constants.get)('colors.
|
29
|
+
})(["display:inline-block;white-space:nowrap;list-style:none;&::after{padding-right:0.5em;padding-left:0.5em;color:", ";font-size:", ";content:'/';}&:first-child{margin-left:0;}&:last-child{&::after{content:none;}}"], (0, _constants.get)('colors.text.disabled'), (0, _constants.get)('fontSizes.1'));
|
30
30
|
|
31
31
|
const BreadcrumbBase = _styledComponents.default.nav.withConfig({
|
32
32
|
displayName: "Breadcrumb__BreadcrumbBase",
|
@@ -65,7 +65,7 @@ const BreadcrumbItem = _styledComponents.default.a.attrs(props => ({
|
|
65
65
|
})).withConfig({
|
66
66
|
displayName: "Breadcrumb__BreadcrumbItem",
|
67
67
|
componentId: "c1r3ff-2"
|
68
|
-
})(["color:", ";display:inline-block;font-size:", ";text-decoration:none;&:hover{text-decoration:underline;}&.selected{color:", ";pointer-events:none;}", " ", ";"], (0, _constants.get)('colors.
|
68
|
+
})(["color:", ";display:inline-block;font-size:", ";text-decoration:none;&:hover{text-decoration:underline;}&.selected{color:", ";pointer-events:none;}", " ", ";"], (0, _constants.get)('colors.text.link'), (0, _constants.get)('fontSizes.1'), (0, _constants.get)('colors.text.primary'), _constants.COMMON, _sx.default);
|
69
69
|
|
70
70
|
Breadcrumb.displayName = 'Breadcrumb';
|
71
71
|
BreadcrumbItem.displayName = 'Breadcrumb.Item';
|
package/lib/Button/Button.d.ts
CHANGED
@@ -268,6 +268,7 @@ declare const Button: import("styled-components").StyledComponent<"button", any,
|
|
268
268
|
onAnimationIterationCapture?: import("react").AnimationEventHandler<HTMLButtonElement> | undefined;
|
269
269
|
onTransitionEnd?: import("react").TransitionEventHandler<HTMLButtonElement> | undefined;
|
270
270
|
onTransitionEndCapture?: import("react").TransitionEventHandler<HTMLButtonElement> | undefined;
|
271
|
+
css?: import("@emotion/core").InterpolationWithTheme<any>;
|
271
272
|
autoFocus?: boolean | undefined;
|
272
273
|
disabled?: boolean | undefined;
|
273
274
|
formAction?: string | undefined;
|
package/lib/Button/Button.js
CHANGED
@@ -22,6 +22,6 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
22
22
|
const Button = (0, _styledComponents.default)(_ButtonBase.default).withConfig({
|
23
23
|
displayName: "Button",
|
24
24
|
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:", ";}", ";", ";"], (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.
|
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:", ";}", ";", ";"], (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.text.disabled'), (0, _constants.get)('colors.btn.bg'), (0, _constants.get)('colors.btn.border'), _ButtonBase.buttonSystemProps, _sx.default);
|
26
26
|
var _default = Button;
|
27
27
|
exports.default = _default;
|
@@ -287,6 +287,7 @@ declare const ButtonClose: React.ForwardRefExoticComponent<Pick<{
|
|
287
287
|
onAnimationIterationCapture?: React.AnimationEventHandler<HTMLButtonElement> | undefined;
|
288
288
|
onTransitionEnd?: React.TransitionEventHandler<HTMLButtonElement> | undefined;
|
289
289
|
onTransitionEndCapture?: React.TransitionEventHandler<HTMLButtonElement> | undefined;
|
290
|
+
css?: import("@emotion/core").InterpolationWithTheme<any>;
|
290
291
|
bg?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
291
292
|
m?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
292
293
|
mt?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
@@ -316,6 +317,6 @@ declare const ButtonClose: React.ForwardRefExoticComponent<Pick<{
|
|
316
317
|
formTarget?: string | undefined;
|
317
318
|
} & {
|
318
319
|
theme?: any;
|
319
|
-
}, "backgroundColor" | "color" | "display" | "height" | "marginBottom" | "marginLeft" | "marginRight" | "marginTop" | "maxHeight" | "maxWidth" | "minHeight" | "minWidth" | "opacity" | "overflowX" | "overflowY" | "paddingBottom" | "paddingLeft" | "paddingRight" | "paddingTop" | "translate" | "verticalAlign" | "width" | "margin" | "overflow" | "padding" | "hidden" | "children" | "theme" | "value" | "form" | "p" | "slot" | "style" | "title" | "type" | "name" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "id" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "bg" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "marginX" | "my" | "marginY" | "pt" | "pr" | "pb" | "pl" | "px" | "paddingX" | "py" | "paddingY" | "size" | "sx" | "autoFocus" | "disabled" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget"> & React.RefAttributes<HTMLButtonElement>>;
|
320
|
+
}, "backgroundColor" | "color" | "display" | "height" | "marginBottom" | "marginLeft" | "marginRight" | "marginTop" | "maxHeight" | "maxWidth" | "minHeight" | "minWidth" | "opacity" | "overflowX" | "overflowY" | "paddingBottom" | "paddingLeft" | "paddingRight" | "paddingTop" | "translate" | "verticalAlign" | "width" | "margin" | "overflow" | "padding" | "hidden" | "children" | "theme" | "value" | "form" | "p" | "slot" | "style" | "title" | "type" | "name" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "id" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "css" | "bg" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "marginX" | "my" | "marginY" | "pt" | "pr" | "pb" | "pl" | "px" | "paddingX" | "py" | "paddingY" | "size" | "sx" | "autoFocus" | "disabled" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget"> & React.RefAttributes<HTMLButtonElement>>;
|
320
321
|
export declare type ButtonCloseProps = ComponentProps<typeof ButtonClose>;
|
321
322
|
export default ButtonClose;
|
@@ -26,7 +26,7 @@ function _extends() { _extends = Object.assign || function (target) { for (var i
|
|
26
26
|
const StyledButton = _styledComponents.default.button.withConfig({
|
27
27
|
displayName: "ButtonClose__StyledButton",
|
28
28
|
componentId: "sc-13mzqph-0"
|
29
|
-
})(["border:none;padding:0;background:transparent;outline:none;cursor:pointer;border-radius:", ";color:", ";&:focus{box-shadow:", ";}&:hover{color:", ";}", ";", ";", ";"], (0, _constants.get)('radii.2'), (0, _constants.get)('colors.
|
29
|
+
})(["border:none;padding:0;background:transparent;outline:none;cursor:pointer;border-radius:", ";color:", ";&:focus{box-shadow:", ";}&:hover{color:", ";}", ";", ";", ";"], (0, _constants.get)('radii.2'), (0, _constants.get)('colors.text.secondary'), (0, _constants.get)('shadows.btn.focusShadow'), (0, _constants.get)('colors.text.link'), _constants.COMMON, _constants.LAYOUT, _sx.default);
|
30
30
|
|
31
31
|
const ButtonClose = /*#__PURE__*/(0, _react.forwardRef)((props, ref) => {
|
32
32
|
return /*#__PURE__*/_react.default.createElement(StyledButton, _extends({
|
@@ -268,6 +268,7 @@ declare const ButtonDanger: import("styled-components").StyledComponent<"button"
|
|
268
268
|
onAnimationIterationCapture?: import("react").AnimationEventHandler<HTMLButtonElement> | undefined;
|
269
269
|
onTransitionEnd?: import("react").TransitionEventHandler<HTMLButtonElement> | undefined;
|
270
270
|
onTransitionEndCapture?: import("react").TransitionEventHandler<HTMLButtonElement> | undefined;
|
271
|
+
css?: import("@emotion/core").InterpolationWithTheme<any>;
|
271
272
|
autoFocus?: boolean | undefined;
|
272
273
|
disabled?: boolean | undefined;
|
273
274
|
formAction?: string | undefined;
|
@@ -268,6 +268,7 @@ declare const ButtonInvisible: import("styled-components").StyledComponent<"butt
|
|
268
268
|
onAnimationIterationCapture?: import("react").AnimationEventHandler<HTMLButtonElement> | undefined;
|
269
269
|
onTransitionEnd?: import("react").TransitionEventHandler<HTMLButtonElement> | undefined;
|
270
270
|
onTransitionEndCapture?: import("react").TransitionEventHandler<HTMLButtonElement> | undefined;
|
271
|
+
css?: import("@emotion/core").InterpolationWithTheme<any>;
|
271
272
|
autoFocus?: boolean | undefined;
|
272
273
|
disabled?: boolean | undefined;
|
273
274
|
formAction?: string | undefined;
|