@primer/components 30.3.0-rc.2010c7d4 → 31.0.0-rc.15aa0a10
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/.eslintrc.json +2 -1
- package/.storybook/preview.js +4 -4
- package/CHANGELOG.md +12 -2
- package/codemods/deprecateUtilityComponents.js +1 -1
- package/contributor-docs/adrs/adr-003-prop-norms.md +72 -0
- package/dist/browser.esm.js +798 -794
- package/dist/browser.esm.js.map +1 -1
- package/dist/browser.umd.js +801 -797
- package/dist/browser.umd.js.map +1 -1
- package/docs/content/Autocomplete.mdx +627 -0
- package/docs/content/TextInputTokens.mdx +89 -0
- package/docs/content/getting-started.md +1 -1
- package/docs/content/overriding-styles.mdx +7 -6
- package/docs/content/theming.md +5 -5
- package/docs/package-lock.json +288 -511
- package/docs/package.json +1 -1
- package/docs/src/@primer/gatsby-theme-doctocat/components/hero.js +14 -12
- package/docs/src/@primer/gatsby-theme-doctocat/nav.yml +2 -0
- package/docs/src/@primer/gatsby-theme-doctocat/primer-components-hero.svg +7 -7
- package/lib/ActionList/Item.js +1 -1
- package/lib/AnchoredOverlay/AnchoredOverlay.d.ts +2 -1
- package/lib/AnchoredOverlay/AnchoredOverlay.js +11 -3
- package/lib/Autocomplete/Autocomplete.d.ts +304 -0
- package/lib/Autocomplete/Autocomplete.js +145 -0
- package/lib/Autocomplete/AutocompleteContext.d.ts +17 -0
- package/lib/Autocomplete/AutocompleteContext.js +11 -0
- package/lib/Autocomplete/AutocompleteInput.d.ts +292 -0
- package/lib/Autocomplete/AutocompleteInput.js +157 -0
- package/lib/Autocomplete/AutocompleteMenu.d.ts +72 -0
- package/lib/Autocomplete/AutocompleteMenu.js +224 -0
- package/lib/Autocomplete/AutocompleteOverlay.d.ts +20 -0
- package/lib/Autocomplete/AutocompleteOverlay.js +80 -0
- package/lib/Autocomplete/index.d.ts +2 -0
- package/lib/Autocomplete/index.js +15 -0
- package/lib/BaseStyles.js +1 -1
- package/lib/BorderBox.js +1 -1
- package/lib/Button/ButtonInvisible.js +1 -1
- package/lib/Caret.js +2 -2
- package/lib/Dialog.js +1 -1
- package/lib/FilteredActionList/FilteredActionList.js +5 -31
- package/lib/Flash.js +16 -16
- package/lib/Label.js +1 -1
- package/lib/Overlay.d.ts +1 -0
- package/lib/Overlay.js +3 -1
- package/lib/ProgressBar.js +1 -1
- package/lib/StateLabel.js +13 -19
- package/lib/Token/_RemoveTokenButton.js +1 -1
- package/lib/__tests__/Autocomplete.test.d.ts +1 -0
- package/lib/__tests__/Autocomplete.test.js +528 -0
- package/lib/__tests__/BorderBox.test.js +1 -1
- package/lib/__tests__/CircleOcticon.test.js +1 -1
- package/lib/__tests__/CounterLabel.test.js +4 -4
- package/lib/__tests__/Flash.test.js +4 -4
- package/lib/__tests__/Link.test.js +1 -1
- package/lib/__tests__/behaviors/scrollIntoViewingArea.test.d.ts +1 -0
- package/lib/__tests__/behaviors/scrollIntoViewingArea.test.js +226 -0
- package/lib/behaviors/scrollIntoViewingArea.d.ts +1 -0
- package/lib/behaviors/scrollIntoViewingArea.js +39 -0
- package/lib/hooks/useOpenAndCloseFocus.d.ts +2 -1
- package/lib/hooks/useOpenAndCloseFocus.js +7 -2
- package/lib/hooks/useOverlay.d.ts +2 -1
- package/lib/hooks/useOverlay.js +4 -2
- package/lib/index.d.ts +2 -0
- package/lib/index.js +8 -0
- package/lib/stories/Autocomplete.stories.js +608 -0
- package/lib/stories/Dialog.stories.js +3 -3
- package/lib/stories/IssueLabelToken.stories.js +1 -1
- package/lib/stories/ProfileToken.stories.js +1 -1
- package/lib/theme-preval.js +370 -3100
- package/lib/utils/testing.d.ts +50 -493
- package/lib/utils/types/MandateProps.d.ts +3 -0
- package/lib/utils/types/MandateProps.js +1 -0
- package/lib/utils/types/index.d.ts +1 -0
- package/lib/utils/types/index.js +13 -0
- package/lib-esm/ActionList/Item.js +1 -1
- package/lib-esm/AnchoredOverlay/AnchoredOverlay.d.ts +2 -1
- package/lib-esm/AnchoredOverlay/AnchoredOverlay.js +11 -3
- package/lib-esm/Autocomplete/Autocomplete.d.ts +304 -0
- package/lib-esm/Autocomplete/Autocomplete.js +123 -0
- package/lib-esm/Autocomplete/AutocompleteContext.d.ts +17 -0
- package/lib-esm/Autocomplete/AutocompleteContext.js +2 -0
- package/lib-esm/Autocomplete/AutocompleteInput.d.ts +292 -0
- package/lib-esm/Autocomplete/AutocompleteInput.js +138 -0
- package/lib-esm/Autocomplete/AutocompleteMenu.d.ts +72 -0
- package/lib-esm/Autocomplete/AutocompleteMenu.js +205 -0
- package/lib-esm/Autocomplete/AutocompleteOverlay.d.ts +20 -0
- package/lib-esm/Autocomplete/AutocompleteOverlay.js +62 -0
- package/lib-esm/Autocomplete/index.d.ts +2 -0
- package/lib-esm/Autocomplete/index.js +1 -0
- package/lib-esm/BaseStyles.js +1 -1
- package/lib-esm/BorderBox.js +1 -1
- package/lib-esm/Button/ButtonInvisible.js +1 -1
- package/lib-esm/Caret.js +2 -2
- package/lib-esm/Dialog.js +1 -1
- package/lib-esm/FilteredActionList/FilteredActionList.js +3 -31
- package/lib-esm/Flash.js +16 -16
- package/lib-esm/Label.js +1 -1
- package/lib-esm/Overlay.d.ts +1 -0
- package/lib-esm/Overlay.js +3 -1
- package/lib-esm/ProgressBar.js +1 -1
- package/lib-esm/StateLabel.js +13 -19
- package/lib-esm/Token/_RemoveTokenButton.js +1 -1
- package/lib-esm/__tests__/Autocomplete.test.d.ts +1 -0
- package/lib-esm/__tests__/Autocomplete.test.js +494 -0
- package/lib-esm/__tests__/BorderBox.test.js +1 -1
- package/lib-esm/__tests__/CircleOcticon.test.js +1 -1
- package/lib-esm/__tests__/CounterLabel.test.js +4 -4
- package/lib-esm/__tests__/Flash.test.js +4 -4
- package/lib-esm/__tests__/Link.test.js +1 -1
- package/lib-esm/__tests__/behaviors/scrollIntoViewingArea.test.d.ts +1 -0
- package/lib-esm/__tests__/behaviors/scrollIntoViewingArea.test.js +224 -0
- package/lib-esm/behaviors/scrollIntoViewingArea.d.ts +1 -0
- package/lib-esm/behaviors/scrollIntoViewingArea.js +30 -0
- package/lib-esm/hooks/useOpenAndCloseFocus.d.ts +2 -1
- package/lib-esm/hooks/useOpenAndCloseFocus.js +7 -2
- package/lib-esm/hooks/useOverlay.d.ts +2 -1
- package/lib-esm/hooks/useOverlay.js +4 -2
- package/lib-esm/index.d.ts +2 -0
- package/lib-esm/index.js +1 -0
- package/lib-esm/stories/Autocomplete.stories.js +549 -0
- package/lib-esm/stories/Dialog.stories.js +3 -3
- package/lib-esm/stories/IssueLabelToken.stories.js +1 -1
- package/lib-esm/stories/ProfileToken.stories.js +1 -1
- package/lib-esm/theme-preval.js +370 -3100
- package/lib-esm/utils/testing.d.ts +50 -493
- package/lib-esm/utils/types/MandateProps.d.ts +3 -0
- package/lib-esm/utils/types/MandateProps.js +1 -0
- package/lib-esm/utils/types/index.d.ts +1 -0
- package/lib-esm/utils/types/index.js +2 -1
- package/package-lock.json +11 -8
- package/package.json +3 -3
- package/src/ActionList/Item.tsx +1 -1
- package/src/AnchoredOverlay/AnchoredOverlay.tsx +14 -3
- package/src/Autocomplete/Autocomplete.tsx +103 -0
- package/src/Autocomplete/AutocompleteContext.tsx +19 -0
- package/src/Autocomplete/AutocompleteInput.tsx +179 -0
- package/src/Autocomplete/AutocompleteMenu.tsx +341 -0
- package/src/Autocomplete/AutocompleteOverlay.tsx +68 -0
- package/src/Autocomplete/index.ts +2 -0
- package/src/BaseStyles.tsx +1 -1
- package/src/BorderBox.tsx +1 -1
- package/src/Button/ButtonInvisible.tsx +7 -2
- package/src/Caret.tsx +2 -2
- package/src/Dialog.tsx +1 -1
- package/src/FilteredActionList/FilteredActionList.tsx +10 -25
- package/src/Flash.tsx +16 -16
- package/src/Label.tsx +1 -1
- package/src/Overlay.tsx +4 -1
- package/src/ProgressBar.tsx +1 -1
- package/src/StateLabel.tsx +12 -20
- package/src/Token/_RemoveTokenButton.tsx +4 -2
- package/src/__tests__/Autocomplete.test.tsx +444 -0
- package/src/__tests__/BorderBox.test.tsx +1 -1
- package/src/__tests__/CircleOcticon.test.tsx +1 -1
- package/src/__tests__/CounterLabel.test.tsx +4 -4
- package/src/__tests__/Flash.test.tsx +4 -4
- package/src/__tests__/Link.test.tsx +1 -1
- package/src/__tests__/__snapshots__/AnchoredOverlay.test.tsx.snap +3 -3
- package/src/__tests__/__snapshots__/Autocomplete.test.tsx.snap +3414 -0
- package/src/__tests__/__snapshots__/Button.test.tsx.snap +9 -1
- package/src/__tests__/__snapshots__/ConfirmationDialog.test.tsx.snap +1 -1
- package/src/__tests__/__snapshots__/SelectPanel.test.tsx.snap +1 -1
- package/src/__tests__/__snapshots__/StateLabel.test.tsx.snap +0 -21
- package/src/__tests__/__snapshots__/TextInputWithTokens.test.tsx.snap +16 -16
- package/src/__tests__/__snapshots__/Token.test.tsx.snap +34 -34
- package/src/__tests__/behaviors/scrollIntoViewingArea.test.ts +195 -0
- package/src/behaviors/scrollIntoViewingArea.ts +27 -0
- package/src/hooks/useOpenAndCloseFocus.ts +7 -2
- package/src/hooks/useOverlay.tsx +4 -2
- package/src/index.ts +2 -0
- package/src/stories/Autocomplete.stories.tsx +572 -0
- package/src/stories/Dialog.stories.tsx +3 -3
- package/src/stories/IssueLabelToken.stories.tsx +1 -1
- package/src/stories/ProfileToken.stories.tsx +1 -1
- package/src/utils/types/MandateProps.ts +19 -0
- package/src/utils/types/index.ts +1 -0
- package/stats.html +1 -1
- package/docs/src/@primer/gatsby-theme-doctocat/components/live-code.js +0 -84
- package/docs/src/@primer/gatsby-theme-doctocat/components/nav-dropdown.js +0 -48
- package/docs/src/@primer/gatsby-theme-doctocat/components/wrap-page-element.js +0 -25
@@ -0,0 +1,224 @@
|
|
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 _useFocusZone = require("../hooks/useFocusZone");
|
13
|
+
|
14
|
+
var _ = require("../");
|
15
|
+
|
16
|
+
var _AutocompleteContext = require("./AutocompleteContext");
|
17
|
+
|
18
|
+
var _octiconsReact = require("@primer/octicons-react");
|
19
|
+
|
20
|
+
var _uniqueId = require("../utils/uniqueId");
|
21
|
+
|
22
|
+
var _scrollIntoViewingArea = require("../behaviors/scrollIntoViewingArea");
|
23
|
+
|
24
|
+
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); }
|
25
|
+
|
26
|
+
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; }
|
27
|
+
|
28
|
+
const getDefaultSortFn = isItemSelectedFn => (itemIdA, itemIdB) => isItemSelectedFn(itemIdA) === isItemSelectedFn(itemIdB) ? 0 : isItemSelectedFn(itemIdA) ? -1 : 1;
|
29
|
+
|
30
|
+
function getDefaultItemFilter(filterValue) {
|
31
|
+
return function (item, _i) {
|
32
|
+
var _item$text;
|
33
|
+
|
34
|
+
return Boolean((_item$text = item.text) === null || _item$text === void 0 ? void 0 : _item$text.toLowerCase().startsWith(filterValue.toLowerCase()));
|
35
|
+
};
|
36
|
+
}
|
37
|
+
|
38
|
+
function getDefaultOnSelectionChange(setInputValueFn) {
|
39
|
+
return function (itemOrItems) {
|
40
|
+
const {
|
41
|
+
text = ''
|
42
|
+
} = Array.isArray(itemOrItems) ? itemOrItems.slice(-1)[0] : itemOrItems;
|
43
|
+
setInputValueFn(text);
|
44
|
+
};
|
45
|
+
}
|
46
|
+
|
47
|
+
const isItemSelected = (itemId, selectedItemIds) => selectedItemIds.includes(itemId);
|
48
|
+
|
49
|
+
function getItemById(itemId, items) {
|
50
|
+
return items.find(item => item.id === itemId);
|
51
|
+
} // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
52
|
+
|
53
|
+
|
54
|
+
function AutocompleteMenu(props) {
|
55
|
+
const autocompleteContext = (0, _react.useContext)(_AutocompleteContext.AutocompleteContext);
|
56
|
+
|
57
|
+
if (autocompleteContext === null) {
|
58
|
+
throw new Error('AutocompleteContext returned null values');
|
59
|
+
}
|
60
|
+
|
61
|
+
const {
|
62
|
+
activeDescendantRef,
|
63
|
+
id,
|
64
|
+
inputRef,
|
65
|
+
inputValue = '',
|
66
|
+
scrollContainerRef,
|
67
|
+
setAutocompleteSuggestion,
|
68
|
+
setShowMenu,
|
69
|
+
setInputValue,
|
70
|
+
setIsMenuDirectlyActivated,
|
71
|
+
setSelectedItemLength,
|
72
|
+
showMenu
|
73
|
+
} = autocompleteContext;
|
74
|
+
const {
|
75
|
+
items,
|
76
|
+
selectedItemIds,
|
77
|
+
sortOnCloseFn,
|
78
|
+
emptyStateText,
|
79
|
+
addNewItem,
|
80
|
+
loading,
|
81
|
+
selectionVariant,
|
82
|
+
filterFn,
|
83
|
+
'aria-labelledby': ariaLabelledBy,
|
84
|
+
onOpenChange,
|
85
|
+
onSelectedChange,
|
86
|
+
customScrollContainerRef
|
87
|
+
} = props;
|
88
|
+
const listContainerRef = (0, _react.useRef)(null);
|
89
|
+
const [highlightedItem, setHighlightedItem] = (0, _react.useState)();
|
90
|
+
const [sortedItemIds, setSortedItemIds] = (0, _react.useState)(items.map(({
|
91
|
+
id: itemId
|
92
|
+
}) => itemId));
|
93
|
+
const selectableItems = (0, _react.useMemo)(() => items.map(selectableItem => {
|
94
|
+
return { ...selectableItem,
|
95
|
+
role: 'option',
|
96
|
+
id: selectableItem.id,
|
97
|
+
selected: selectionVariant === 'multiple' ? selectedItemIds.includes(selectableItem.id) : undefined,
|
98
|
+
onAction: item => {
|
99
|
+
const otherSelectedItemIds = selectedItemIds.filter(selectedItemId => selectedItemId !== item.id);
|
100
|
+
const newSelectedItemIds = selectedItemIds.includes(item.id) ? otherSelectedItemIds : [...otherSelectedItemIds, item.id];
|
101
|
+
const onSelectedChangeFn = onSelectedChange ? onSelectedChange : getDefaultOnSelectionChange(setInputValue);
|
102
|
+
onSelectedChangeFn(newSelectedItemIds.map(newSelectedItemId => getItemById(newSelectedItemId, items)));
|
103
|
+
|
104
|
+
if (selectionVariant === 'multiple') {
|
105
|
+
setInputValue('');
|
106
|
+
setAutocompleteSuggestion('');
|
107
|
+
} else {
|
108
|
+
var _inputRef$current;
|
109
|
+
|
110
|
+
setShowMenu(false);
|
111
|
+
(_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 ? void 0 : _inputRef$current.setSelectionRange(inputRef.current.value.length, inputRef.current.value.length);
|
112
|
+
}
|
113
|
+
}
|
114
|
+
};
|
115
|
+
}), [items, selectedItemIds, inputRef, onSelectedChange, selectionVariant, setAutocompleteSuggestion, setInputValue, setShowMenu]);
|
116
|
+
const itemSortOrderData = (0, _react.useMemo)(() => sortedItemIds.reduce((acc, curr, i) => {
|
117
|
+
acc[curr] = i;
|
118
|
+
return acc;
|
119
|
+
}, {}), [sortedItemIds]);
|
120
|
+
const sortedAndFilteredItemsToRender = (0, _react.useMemo)(() => selectableItems.filter(filterFn ? filterFn : getDefaultItemFilter(inputValue)).sort((a, b) => itemSortOrderData[a.id] - itemSortOrderData[b.id]), [selectableItems, itemSortOrderData, filterFn, inputValue]);
|
121
|
+
const allItemsToRender = (0, _react.useMemo)(() => [// sorted and filtered selectable items
|
122
|
+
...sortedAndFilteredItemsToRender, // menu item used for creating a token from whatever is in the text input
|
123
|
+
...(addNewItem ? [{ ...addNewItem,
|
124
|
+
leadingVisual: () => /*#__PURE__*/_react.default.createElement(_octiconsReact.PlusIcon, null),
|
125
|
+
onAction: item => {
|
126
|
+
// TODO: make it possible to pass a leadingVisual when using `addNewItem`
|
127
|
+
addNewItem.handleAddItem({ ...item,
|
128
|
+
id: item.id || (0, _uniqueId.uniqueId)(),
|
129
|
+
leadingVisual: undefined
|
130
|
+
});
|
131
|
+
|
132
|
+
if (selectionVariant === 'multiple') {
|
133
|
+
setInputValue('');
|
134
|
+
setAutocompleteSuggestion('');
|
135
|
+
}
|
136
|
+
}
|
137
|
+
}] : [])], [sortedAndFilteredItemsToRender, addNewItem, setAutocompleteSuggestion, selectionVariant, setInputValue]);
|
138
|
+
(0, _useFocusZone.useFocusZone)({
|
139
|
+
containerRef: listContainerRef,
|
140
|
+
focusOutBehavior: 'wrap',
|
141
|
+
focusableElementFilter: element => {
|
142
|
+
return !(element instanceof HTMLInputElement);
|
143
|
+
},
|
144
|
+
activeDescendantFocus: inputRef,
|
145
|
+
onActiveDescendantChanged: (current, _previous, directlyActivated) => {
|
146
|
+
activeDescendantRef.current = current || null;
|
147
|
+
|
148
|
+
if (current) {
|
149
|
+
const selectedItem = selectableItems.find(item => item.id.toString() === current.getAttribute('data-id'));
|
150
|
+
setHighlightedItem(selectedItem);
|
151
|
+
setIsMenuDirectlyActivated(directlyActivated);
|
152
|
+
}
|
153
|
+
|
154
|
+
if (current && customScrollContainerRef && customScrollContainerRef.current && directlyActivated) {
|
155
|
+
(0, _scrollIntoViewingArea.scrollIntoViewingArea)(current, customScrollContainerRef.current);
|
156
|
+
} else if (current && scrollContainerRef.current && directlyActivated) {
|
157
|
+
(0, _scrollIntoViewingArea.scrollIntoViewingArea)(current, scrollContainerRef.current);
|
158
|
+
}
|
159
|
+
}
|
160
|
+
}, [loading]);
|
161
|
+
(0, _react.useEffect)(() => {
|
162
|
+
var _highlightedItem$text;
|
163
|
+
|
164
|
+
if (highlightedItem !== null && highlightedItem !== void 0 && (_highlightedItem$text = highlightedItem.text) !== null && _highlightedItem$text !== void 0 && _highlightedItem$text.startsWith(inputValue) && !selectedItemIds.includes(highlightedItem.id)) {
|
165
|
+
setAutocompleteSuggestion(highlightedItem.text);
|
166
|
+
} else {
|
167
|
+
setAutocompleteSuggestion('');
|
168
|
+
}
|
169
|
+
}, [highlightedItem, inputValue, selectedItemIds, setAutocompleteSuggestion]);
|
170
|
+
(0, _react.useEffect)(() => {
|
171
|
+
const itemIdSortResult = [...sortedItemIds].sort(sortOnCloseFn ? sortOnCloseFn : getDefaultSortFn(itemId => isItemSelected(itemId, selectedItemIds)));
|
172
|
+
const sortResultMatchesState = itemIdSortResult.length === sortedItemIds.length && itemIdSortResult.every((element, index) => element === sortedItemIds[index]);
|
173
|
+
|
174
|
+
if (showMenu === false && !sortResultMatchesState) {
|
175
|
+
setSortedItemIds(itemIdSortResult);
|
176
|
+
}
|
177
|
+
|
178
|
+
onOpenChange && onOpenChange(Boolean(showMenu));
|
179
|
+
}, [showMenu, onOpenChange, selectedItemIds, sortOnCloseFn, sortedItemIds]);
|
180
|
+
(0, _react.useEffect)(() => {
|
181
|
+
if (selectedItemIds.length) {
|
182
|
+
setSelectedItemLength(selectedItemIds.length);
|
183
|
+
}
|
184
|
+
}, [selectedItemIds, setSelectedItemLength]);
|
185
|
+
return /*#__PURE__*/_react.default.createElement(_.Box, {
|
186
|
+
sx: !showMenu ? {
|
187
|
+
// visually hides this label for sighted users
|
188
|
+
position: 'absolute',
|
189
|
+
width: '1px',
|
190
|
+
height: '1px',
|
191
|
+
padding: '0',
|
192
|
+
margin: '-1px',
|
193
|
+
overflow: 'hidden',
|
194
|
+
clip: 'rect(0, 0, 0, 0)',
|
195
|
+
whiteSpace: 'nowrap',
|
196
|
+
borderWidth: '0'
|
197
|
+
} : {}
|
198
|
+
}, loading ? /*#__PURE__*/_react.default.createElement(_.Box, {
|
199
|
+
p: 3,
|
200
|
+
display: "flex",
|
201
|
+
justifyContent: "center"
|
202
|
+
}, /*#__PURE__*/_react.default.createElement(_.Spinner, null)) : /*#__PURE__*/_react.default.createElement("div", {
|
203
|
+
ref: listContainerRef
|
204
|
+
}, allItemsToRender.length ? /*#__PURE__*/_react.default.createElement(_ActionList.ActionList, {
|
205
|
+
selectionVariant: "multiple" // have to typecast to `ItemProps` because we have an extra property
|
206
|
+
// on `items` for Autocomplete: `metadata`
|
207
|
+
,
|
208
|
+
items: allItemsToRender,
|
209
|
+
role: "listbox",
|
210
|
+
id: `${id}-listbox`,
|
211
|
+
"aria-labelledby": ariaLabelledBy
|
212
|
+
}) : /*#__PURE__*/_react.default.createElement(_.Box, {
|
213
|
+
p: 3
|
214
|
+
}, emptyStateText)));
|
215
|
+
}
|
216
|
+
|
217
|
+
AutocompleteMenu.displayName = "AutocompleteMenu";
|
218
|
+
AutocompleteMenu.defaultProps = {
|
219
|
+
emptyStateText: 'No selectable options',
|
220
|
+
selectionVariant: 'single'
|
221
|
+
};
|
222
|
+
AutocompleteMenu.displayName = 'AutocompleteMenu';
|
223
|
+
var _default = AutocompleteMenu;
|
224
|
+
exports.default = _default;
|
@@ -0,0 +1,20 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { OverlayProps } from '../Overlay';
|
3
|
+
import { ComponentProps } from '../utils/types';
|
4
|
+
declare type AutocompleteOverlayInternalProps = {
|
5
|
+
/**
|
6
|
+
* The ref of the element that the position of the menu is based on. By default, the menu is positioned based on the text input
|
7
|
+
*/
|
8
|
+
menuAnchorRef?: React.RefObject<HTMLElement>;
|
9
|
+
/**
|
10
|
+
* Props to be spread on the internal `Overlay` component.
|
11
|
+
*/
|
12
|
+
overlayProps?: Partial<OverlayProps>;
|
13
|
+
children?: React.ReactNode;
|
14
|
+
} & Pick<React.AriaAttributes, 'aria-labelledby'>;
|
15
|
+
declare function AutocompleteOverlay({ menuAnchorRef, overlayProps, children }: AutocompleteOverlayInternalProps): JSX.Element | null;
|
16
|
+
declare namespace AutocompleteOverlay {
|
17
|
+
var displayName: string;
|
18
|
+
}
|
19
|
+
export declare type AutocompleteOverlayProps = ComponentProps<typeof AutocompleteOverlay>;
|
20
|
+
export default AutocompleteOverlay;
|
@@ -0,0 +1,80 @@
|
|
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 _hooks = require("../hooks");
|
11
|
+
|
12
|
+
var _Overlay = _interopRequireDefault(require("../Overlay"));
|
13
|
+
|
14
|
+
var _AutocompleteContext = require("./AutocompleteContext");
|
15
|
+
|
16
|
+
var _useCombinedRefs = require("../hooks/useCombinedRefs");
|
17
|
+
|
18
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
19
|
+
|
20
|
+
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); }
|
21
|
+
|
22
|
+
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; }
|
23
|
+
|
24
|
+
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); }
|
25
|
+
|
26
|
+
// TODO: consider making 'aria-labelledby' required
|
27
|
+
function AutocompleteOverlay({
|
28
|
+
menuAnchorRef,
|
29
|
+
overlayProps,
|
30
|
+
children
|
31
|
+
}) {
|
32
|
+
const autocompleteContext = (0, _react.useContext)(_AutocompleteContext.AutocompleteContext);
|
33
|
+
|
34
|
+
if (autocompleteContext === null) {
|
35
|
+
throw new Error('AutocompleteContext returned null values');
|
36
|
+
}
|
37
|
+
|
38
|
+
const {
|
39
|
+
inputRef,
|
40
|
+
scrollContainerRef,
|
41
|
+
selectedItemLength,
|
42
|
+
setShowMenu,
|
43
|
+
showMenu = false
|
44
|
+
} = autocompleteContext;
|
45
|
+
const {
|
46
|
+
floatingElementRef,
|
47
|
+
position
|
48
|
+
} = (0, _hooks.useAnchoredPosition)({
|
49
|
+
side: 'outside-bottom',
|
50
|
+
align: 'start',
|
51
|
+
anchorElementRef: menuAnchorRef ? menuAnchorRef : inputRef
|
52
|
+
}, [showMenu, selectedItemLength]);
|
53
|
+
const combinedOverlayRef = (0, _useCombinedRefs.useCombinedRefs)(scrollContainerRef, floatingElementRef);
|
54
|
+
const closeOptionList = (0, _react.useCallback)(() => {
|
55
|
+
setShowMenu(false);
|
56
|
+
}, [setShowMenu]);
|
57
|
+
|
58
|
+
if (typeof window === 'undefined') {
|
59
|
+
return null;
|
60
|
+
}
|
61
|
+
|
62
|
+
return /*#__PURE__*/_react.default.createElement(_Overlay.default, _extends({
|
63
|
+
returnFocusRef: inputRef,
|
64
|
+
preventFocusOnOpen: true,
|
65
|
+
onClickOutside: closeOptionList,
|
66
|
+
onEscape: closeOptionList,
|
67
|
+
ref: combinedOverlayRef,
|
68
|
+
top: position === null || position === void 0 ? void 0 : position.top,
|
69
|
+
left: position === null || position === void 0 ? void 0 : position.left,
|
70
|
+
visibility: showMenu ? 'visible' : 'hidden',
|
71
|
+
sx: {
|
72
|
+
overflow: 'auto'
|
73
|
+
}
|
74
|
+
}, overlayProps), children);
|
75
|
+
}
|
76
|
+
|
77
|
+
AutocompleteOverlay.displayName = "AutocompleteOverlay";
|
78
|
+
AutocompleteOverlay.displayName = 'AutocompleteOverlay';
|
79
|
+
var _default = AutocompleteOverlay;
|
80
|
+
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/BaseStyles.js
CHANGED
package/lib/BorderBox.js
CHANGED
@@ -21,7 +21,7 @@ const BorderBox = (0, _styledComponents.default)(_Box.default).withConfig({
|
|
21
21
|
BorderBox.defaultProps = {
|
22
22
|
borderWidth: '1px',
|
23
23
|
borderStyle: 'solid',
|
24
|
-
borderColor: 'border.
|
24
|
+
borderColor: 'border.default',
|
25
25
|
borderRadius: 2
|
26
26
|
};
|
27
27
|
var _default = BorderBox;
|
@@ -22,6 +22,6 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
22
22
|
const ButtonInvisible = (0, _styledComponents.default)(_ButtonBase.default).withConfig({
|
23
23
|
displayName: "ButtonInvisible",
|
24
24
|
componentId: "sc-1195tpn-0"
|
25
|
-
})(["color:", ";background-color:transparent;border:0;border-radius:", ";box-shadow:none;&:disabled{color:", ";}&:focus{box-shadow:", ";}", ";", ""], (0, _constants.get)('colors.accent.fg'), (0, _constants.get)('radii.2'), (0, _constants.get)('colors.fg.
|
25
|
+
})(["color:", ";background-color:transparent;border:0;border-radius:", ";box-shadow:none;&:disabled{color:", ";}&:focus{box-shadow:", ";}&:hover{background-color:", ";}&:active{background-color:", ";}", ";", ""], (0, _constants.get)('colors.accent.fg'), (0, _constants.get)('radii.2'), (0, _constants.get)('colors.primer.fg.disabled'), (0, _constants.get)('shadows.btn.focusShadow'), (0, _constants.get)('colors.btn.hoverBg'), (0, _constants.get)('colors.btn.selectedBg'), _ButtonBase.buttonSystemProps, _sx.default);
|
26
26
|
var _default = ButtonInvisible;
|
27
27
|
exports.default = _default;
|
package/lib/Caret.js
CHANGED
@@ -119,8 +119,8 @@ function Caret(props) {
|
|
119
119
|
Caret.displayName = "Caret";
|
120
120
|
Caret.locations = ['top', 'top-left', 'top-right', 'right', 'right-top', 'right-bottom', 'bottom', 'bottom-left', 'bottom-right', 'left', 'left-top', 'left-bottom'];
|
121
121
|
Caret.defaultProps = {
|
122
|
-
bg: '
|
123
|
-
borderColor: 'border.
|
122
|
+
bg: 'canvas.default',
|
123
|
+
borderColor: 'border.default',
|
124
124
|
borderWidth: 1
|
125
125
|
};
|
126
126
|
var _default = Caret;
|
package/lib/Dialog.js
CHANGED
@@ -122,7 +122,7 @@ const Dialog = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
122
122
|
}), children)) : null;
|
123
123
|
});
|
124
124
|
DialogHeader.defaultProps = {
|
125
|
-
backgroundColor: '
|
125
|
+
backgroundColor: 'canvas.subtle'
|
126
126
|
};
|
127
127
|
DialogHeader.propTypes = { ..._Box.default.propTypes
|
128
128
|
};
|
@@ -7,6 +7,8 @@ exports.FilteredActionList = FilteredActionList;
|
|
7
7
|
|
8
8
|
var _react = _interopRequireWildcard(require("react"));
|
9
9
|
|
10
|
+
var _ssr = require("@react-aria/ssr");
|
11
|
+
|
10
12
|
var _TextInput = _interopRequireDefault(require("../TextInput"));
|
11
13
|
|
12
14
|
var _Box = _interopRequireDefault(require("../Box"));
|
@@ -27,7 +29,7 @@ var _useProvidedRefOrCreate = require("../hooks/useProvidedRefOrCreate");
|
|
27
29
|
|
28
30
|
var _useScrollFlash = _interopRequireDefault(require("../hooks/useScrollFlash"));
|
29
31
|
|
30
|
-
var
|
32
|
+
var _scrollIntoViewingArea = require("../behaviors/scrollIntoViewingArea");
|
31
33
|
|
32
34
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
33
35
|
|
@@ -37,34 +39,6 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
37
39
|
|
38
40
|
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); }
|
39
41
|
|
40
|
-
function scrollIntoViewingArea(child, container, margin = 8, behavior = 'smooth') {
|
41
|
-
const {
|
42
|
-
top: childTop,
|
43
|
-
bottom: childBottom
|
44
|
-
} = child.getBoundingClientRect();
|
45
|
-
const {
|
46
|
-
top: containerTop,
|
47
|
-
bottom: containerBottom
|
48
|
-
} = container.getBoundingClientRect();
|
49
|
-
const isChildTopAboveViewingArea = childTop < containerTop + margin;
|
50
|
-
const isChildBottomBelowViewingArea = childBottom > containerBottom - margin;
|
51
|
-
|
52
|
-
if (isChildTopAboveViewingArea) {
|
53
|
-
const scrollHeightToChildTop = childTop - containerTop + container.scrollTop;
|
54
|
-
container.scrollTo({
|
55
|
-
behavior,
|
56
|
-
top: scrollHeightToChildTop - margin
|
57
|
-
});
|
58
|
-
} else if (isChildBottomBelowViewingArea) {
|
59
|
-
const scrollHeightToChildBottom = childBottom - containerBottom + container.scrollTop;
|
60
|
-
container.scrollTo({
|
61
|
-
behavior,
|
62
|
-
top: scrollHeightToChildBottom + margin
|
63
|
-
});
|
64
|
-
} // either completely in view or outside viewing area on both ends, don't scroll
|
65
|
-
|
66
|
-
}
|
67
|
-
|
68
42
|
const StyledHeader = _styledComponents.default.div.withConfig({
|
69
43
|
displayName: "FilteredActionList__StyledHeader",
|
70
44
|
componentId: "yg3jkv-0"
|
@@ -112,7 +86,7 @@ function FilteredActionList({
|
|
112
86
|
activeDescendantRef.current = current;
|
113
87
|
|
114
88
|
if (current && scrollContainerRef.current && directlyActivated) {
|
115
|
-
scrollIntoViewingArea(current, scrollContainerRef.current);
|
89
|
+
(0, _scrollIntoViewingArea.scrollIntoViewingArea)(current, scrollContainerRef.current);
|
116
90
|
}
|
117
91
|
}
|
118
92
|
}, [// List ref isn't set while loading. Need to re-bind focus zone when it changes
|
@@ -120,7 +94,7 @@ function FilteredActionList({
|
|
120
94
|
(0, _react.useEffect)(() => {
|
121
95
|
// if items changed, we want to instantly move active descendant into view
|
122
96
|
if (activeDescendantRef.current && scrollContainerRef.current) {
|
123
|
-
scrollIntoViewingArea(activeDescendantRef.current, scrollContainerRef.current, undefined, 'auto');
|
97
|
+
(0, _scrollIntoViewingArea.scrollIntoViewingArea)(activeDescendantRef.current, scrollContainerRef.current, 'vertical', undefined, undefined, 'auto');
|
124
98
|
}
|
125
99
|
}, [items]);
|
126
100
|
(0, _useScrollFlash.default)(scrollContainerRef);
|
package/lib/Flash.js
CHANGED
@@ -18,35 +18,35 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
18
18
|
const variants = (0, _styledSystem.variant)({
|
19
19
|
variants: {
|
20
20
|
default: {
|
21
|
-
color: '
|
22
|
-
backgroundColor: '
|
23
|
-
borderColor: '
|
21
|
+
color: 'fg.default',
|
22
|
+
backgroundColor: 'accent.subtle',
|
23
|
+
borderColor: 'accent.muted',
|
24
24
|
svg: {
|
25
|
-
color: '
|
25
|
+
color: 'accent.fg'
|
26
26
|
}
|
27
27
|
},
|
28
28
|
success: {
|
29
|
-
color: '
|
30
|
-
backgroundColor: '
|
31
|
-
borderColor: '
|
29
|
+
color: 'fg.default',
|
30
|
+
backgroundColor: 'success.subtle',
|
31
|
+
borderColor: 'success.muted',
|
32
32
|
svg: {
|
33
|
-
color: '
|
33
|
+
color: 'success.fg'
|
34
34
|
}
|
35
35
|
},
|
36
36
|
danger: {
|
37
|
-
color: '
|
38
|
-
backgroundColor: '
|
39
|
-
borderColor: '
|
37
|
+
color: 'fg.default',
|
38
|
+
backgroundColor: 'danger.subtle',
|
39
|
+
borderColor: 'danger.muted',
|
40
40
|
svg: {
|
41
|
-
color: '
|
41
|
+
color: 'danger.fg'
|
42
42
|
}
|
43
43
|
},
|
44
44
|
warning: {
|
45
|
-
color: '
|
46
|
-
backgroundColor: '
|
47
|
-
borderColor: '
|
45
|
+
color: 'fg.default',
|
46
|
+
backgroundColor: 'attention.subtle',
|
47
|
+
borderColor: 'attention.muted',
|
48
48
|
svg: {
|
49
|
-
color: '
|
49
|
+
color: 'attention.fg'
|
50
50
|
}
|
51
51
|
}
|
52
52
|
}
|
package/lib/Label.js
CHANGED
@@ -52,7 +52,7 @@ const Label = _styledComponents.default.span.withConfig({
|
|
52
52
|
})(["display:inline-block;font-weight:", ";color:", ";border-radius:", ";&:hover{text-decoration:none;}", " ", " ", " ", " ", ""], (0, _constants.get)('fontWeights.semibold'), (0, _constants.get)('colors.fg.onEmphasis'), (0, _constants.get)('radii.3'), sizeVariant, _constants.COMMON, props => props.dropshadow ? 'box-shadow: inset 0 -1px 0 rgba(27, 31, 35, 0.12)' : '', props => props.outline ? outlineStyles : '', _sx.default);
|
53
53
|
|
54
54
|
Label.defaultProps = {
|
55
|
-
bg: '
|
55
|
+
bg: 'neutral.emphasis',
|
56
56
|
variant: 'medium'
|
57
57
|
};
|
58
58
|
var _default = Label;
|
package/lib/Overlay.d.ts
CHANGED
@@ -40,6 +40,7 @@ export declare type OverlayProps = {
|
|
40
40
|
top: number;
|
41
41
|
left: number;
|
42
42
|
portalContainerName?: string;
|
43
|
+
preventFocusOnOpen?: boolean;
|
43
44
|
} & Omit<ComponentProps<typeof StyledOverlay>, 'visibility' | keyof SystemPositionProps>;
|
44
45
|
/**
|
45
46
|
* An `Overlay` is a flexible floating surface, used to display transient content such as menus,
|
package/lib/Overlay.js
CHANGED
@@ -113,6 +113,7 @@ const Overlay = /*#__PURE__*/_react.default.forwardRef(({
|
|
113
113
|
left,
|
114
114
|
anchorSide,
|
115
115
|
portalContainerName,
|
116
|
+
preventFocusOnOpen,
|
116
117
|
...rest
|
117
118
|
}, forwardedRef) => {
|
118
119
|
const overlayRef = (0, _react.useRef)(null);
|
@@ -128,7 +129,8 @@ const Overlay = /*#__PURE__*/_react.default.forwardRef(({
|
|
128
129
|
onEscape,
|
129
130
|
ignoreClickRefs,
|
130
131
|
onClickOutside,
|
131
|
-
initialFocusRef
|
132
|
+
initialFocusRef,
|
133
|
+
preventFocusOnOpen
|
132
134
|
});
|
133
135
|
(0, _react.useEffect)(() => {
|
134
136
|
var _combinedRef$current;
|
package/lib/ProgressBar.js
CHANGED
package/lib/StateLabel.js
CHANGED
@@ -35,34 +35,28 @@ const colorVariants = (0, _styledSystem.variant)({
|
|
35
35
|
prop: 'status',
|
36
36
|
variants: {
|
37
37
|
issueClosed: {
|
38
|
-
backgroundColor: '
|
39
|
-
color: '
|
40
|
-
borderColor: 'prState.closed.border'
|
38
|
+
backgroundColor: 'danger.emphasis',
|
39
|
+
color: 'fg.onEmphasis'
|
41
40
|
},
|
42
41
|
pullClosed: {
|
43
|
-
backgroundColor: '
|
44
|
-
color: '
|
45
|
-
borderColor: 'prState.closed.border'
|
42
|
+
backgroundColor: 'danger.emphasis',
|
43
|
+
color: 'fg.onEmphasis'
|
46
44
|
},
|
47
45
|
pullMerged: {
|
48
|
-
backgroundColor: '
|
49
|
-
color: '
|
50
|
-
borderColor: 'prState.merged.border'
|
46
|
+
backgroundColor: 'done.emphasis',
|
47
|
+
color: 'fg.onEmphasis'
|
51
48
|
},
|
52
49
|
issueOpened: {
|
53
|
-
backgroundColor: '
|
54
|
-
color: '
|
55
|
-
borderColor: 'prState.open.border'
|
50
|
+
backgroundColor: 'success.emphasis',
|
51
|
+
color: 'fg.onEmphasis'
|
56
52
|
},
|
57
53
|
pullOpened: {
|
58
|
-
backgroundColor: '
|
59
|
-
color: '
|
60
|
-
borderColor: 'prState.open.border'
|
54
|
+
backgroundColor: 'success.emphasis',
|
55
|
+
color: 'fg.onEmphasis'
|
61
56
|
},
|
62
57
|
draft: {
|
63
|
-
backgroundColor: '
|
64
|
-
color: '
|
65
|
-
borderColor: 'prState.draft.border'
|
58
|
+
backgroundColor: 'neutral.emphasis',
|
59
|
+
color: 'fg.onEmphasis'
|
66
60
|
}
|
67
61
|
}
|
68
62
|
});
|
@@ -85,7 +79,7 @@ const sizeVariants = (0, _styledSystem.variant)({
|
|
85
79
|
const StateLabelBase = _styledComponents.default.span.withConfig({
|
86
80
|
displayName: "StateLabel__StateLabelBase",
|
87
81
|
componentId: "k4pd9e-0"
|
88
|
-
})(["display:inline-flex;align-items:center;font-weight:", ";line-height:16px;color:", ";text-align:center;border-radius:", ";
|
82
|
+
})(["display:inline-flex;align-items:center;font-weight:", ";line-height:16px;color:", ";text-align:center;border-radius:", ";", ";", ";", ";", ";"], (0, _constants.get)('fontWeights.bold'), (0, _constants.get)('colors.canvas.default'), (0, _constants.get)('radii.3'), colorVariants, sizeVariants, _constants.COMMON, _sx.default);
|
89
83
|
|
90
84
|
function StateLabel({
|
91
85
|
children,
|
@@ -50,7 +50,7 @@ const getTokenButtonIconSize = size => parseInt(_TokenBase.tokenSizes[size || _T
|
|
50
50
|
const StyledTokenButton = _styledComponents.default.span.withConfig({
|
51
51
|
displayName: "_RemoveTokenButton__StyledTokenButton",
|
52
52
|
componentId: "sc-14lvcw1-0"
|
53
|
-
})(["background-color:transparent;font-family:inherit;color:currentColor;cursor:pointer;display:inline-flex;justify-content:center;align-items:center;user-select:none;appearance:none;text-decoration:none;padding:0;transform:", ";align-self:baseline;border:0;border-radius:999px;&:hover,&:focus{background-color:", ";}&:active{background-color:", ";}", " ", ""], props => `translate(${props.borderOffset}px, -${props.borderOffset}px)`, (0, _constants.get)('colors.
|
53
|
+
})(["background-color:transparent;font-family:inherit;color:currentColor;cursor:pointer;display:inline-flex;justify-content:center;align-items:center;user-select:none;appearance:none;text-decoration:none;padding:0;transform:", ";align-self:baseline;border:0;border-radius:999px;&:hover,&:focus{background-color:", ";}&:active{background-color:", ";}", " ", ""], props => `translate(${props.borderOffset}px, -${props.borderOffset}px)`, (0, _constants.get)('colors.neutral.muted'), (0, _constants.get)('colors.neutral.subtle'), variants, _sx.default);
|
54
54
|
|
55
55
|
const RemoveTokenButton = ({
|
56
56
|
'aria-label': ariaLabel,
|
@@ -0,0 +1 @@
|
|
1
|
+
import 'babel-polyfill';
|