@primer/components 0.0.0-20219296335 → 0.0.0-2021931194230
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +1 -23
- package/dist/browser.esm.js +440 -441
- package/dist/browser.esm.js.map +1 -1
- package/dist/browser.umd.js +444 -445
- package/dist/browser.umd.js.map +1 -1
- package/lib/ActionList/Item.d.ts +0 -6
- package/lib/ActionList/Item.js +1 -5
- package/lib/ActionMenu.js +2 -2
- package/lib/AnchoredOverlay/AnchoredOverlay.d.ts +4 -2
- package/lib/Autocomplete/Autocomplete.d.ts +35 -33
- package/lib/Autocomplete/AutocompleteInput.d.ts +35 -33
- package/lib/Button/Button.d.ts +29 -29
- package/lib/Button/ButtonBase.d.ts +1 -1
- package/lib/Button/ButtonClose.d.ts +49 -49
- package/lib/Button/ButtonDanger.d.ts +29 -29
- package/lib/Button/ButtonInvisible.d.ts +29 -29
- package/lib/Button/ButtonOutline.d.ts +29 -29
- package/lib/Button/ButtonPrimary.d.ts +29 -29
- package/lib/CircleBadge.d.ts +2 -2
- package/lib/CircleOcticon.d.ts +51 -51
- package/lib/DatePicker/DatePicker.d.ts +48 -0
- package/lib/DatePicker/DatePicker.js +106 -0
- package/lib/DatePicker/DatePickerAnchor.d.ts +5 -0
- package/lib/DatePicker/DatePickerAnchor.js +223 -0
- package/lib/DatePicker/DatePickerOverlay.d.ts +3 -0
- package/lib/DatePicker/DatePickerOverlay.js +48 -0
- package/lib/DatePicker/DatePickerPanel.d.ts +2 -0
- package/lib/DatePicker/DatePickerPanel.js +143 -0
- package/lib/DatePicker/Day.d.ts +14 -0
- package/lib/DatePicker/Day.js +192 -0
- package/lib/DatePicker/Month.d.ts +9 -0
- package/lib/DatePicker/Month.js +122 -0
- package/lib/DatePicker/dateParser.d.ts +11 -0
- package/lib/DatePicker/dateParser.js +192 -0
- package/lib/DatePicker/index.d.ts +2 -0
- package/lib/DatePicker/index.js +13 -0
- package/lib/DatePicker/useDatePicker.d.ts +89 -0
- package/lib/DatePicker/useDatePicker.js +439 -0
- package/lib/Dialog/Dialog.d.ts +4 -4
- package/lib/Dialog/Dialog.js +22 -12
- package/lib/Dialog.d.ts +54 -54
- package/lib/Dropdown.d.ts +245 -167
- package/lib/Dropdown.js +5 -6
- package/lib/DropdownMenu/DropdownButton.d.ts +50 -50
- package/lib/FilterList.d.ts +46 -46
- package/lib/Flash.d.ts +1 -1
- package/lib/Label.d.ts +1 -1
- package/lib/Position.d.ts +4 -4
- package/lib/ProgressBar.d.ts +1 -1
- package/lib/SelectMenu/SelectMenu.d.ts +273 -271
- package/lib/SelectMenu/SelectMenuItem.d.ts +1 -1
- package/lib/SelectMenu/SelectMenuModal.d.ts +1 -1
- package/lib/TextInputWithTokens.d.ts +35 -37
- package/lib/TextInputWithTokens.js +29 -102
- package/lib/Timeline.d.ts +52 -52
- package/lib/Token/AvatarToken.d.ts +1 -1
- package/lib/Token/IssueLabelToken.d.ts +1 -1
- package/lib/Token/Token.d.ts +1 -1
- package/lib/Token/Token.js +2 -13
- package/lib/Token/TokenBase.js +4 -0
- package/lib/Token/_RemoveTokenButton.js +2 -15
- package/lib/_TextInputWrapper.d.ts +1 -1
- package/lib/_TextInputWrapper.js +1 -1
- package/lib/constants.js +1 -3
- package/lib/hooks/useDebounce.d.ts +2 -0
- package/lib/hooks/useDebounce.js +24 -0
- package/lib/hooks/useResizeObserver.d.ts +1 -1
- package/lib/hooks/useResizeObserver.js +1 -1
- package/lib/index.d.ts +0 -2
- package/lib/index.js +0 -8
- package/lib/sx.d.ts +2 -8
- package/lib/theme-preval.js +2 -2
- package/lib/theme.d.ts +0 -78
- package/lib/theme.js +1 -3
- package/lib/utils/testing.d.ts +1 -1
- package/lib-esm/ActionList/Item.d.ts +0 -6
- package/lib-esm/ActionList/Item.js +1 -5
- package/lib-esm/ActionMenu.js +2 -2
- package/lib-esm/AnchoredOverlay/AnchoredOverlay.d.ts +4 -2
- package/lib-esm/Autocomplete/Autocomplete.d.ts +35 -33
- package/lib-esm/Autocomplete/AutocompleteInput.d.ts +35 -33
- package/lib-esm/Button/Button.d.ts +29 -29
- package/lib-esm/Button/ButtonBase.d.ts +1 -1
- package/lib-esm/Button/ButtonClose.d.ts +49 -49
- package/lib-esm/Button/ButtonDanger.d.ts +29 -29
- package/lib-esm/Button/ButtonInvisible.d.ts +29 -29
- package/lib-esm/Button/ButtonOutline.d.ts +29 -29
- package/lib-esm/Button/ButtonPrimary.d.ts +29 -29
- package/lib-esm/CircleBadge.d.ts +2 -2
- package/lib-esm/CircleOcticon.d.ts +51 -51
- package/lib-esm/DatePicker/DatePicker.d.ts +48 -0
- package/lib-esm/DatePicker/DatePicker.js +89 -0
- package/lib-esm/DatePicker/DatePickerAnchor.d.ts +5 -0
- package/lib-esm/DatePicker/DatePickerAnchor.js +196 -0
- package/lib-esm/DatePicker/DatePickerOverlay.d.ts +3 -0
- package/lib-esm/DatePicker/DatePickerOverlay.js +29 -0
- package/lib-esm/DatePicker/DatePickerPanel.d.ts +2 -0
- package/lib-esm/DatePicker/DatePickerPanel.js +116 -0
- package/lib-esm/DatePicker/Day.d.ts +14 -0
- package/lib-esm/DatePicker/Day.js +169 -0
- package/lib-esm/DatePicker/Month.d.ts +9 -0
- package/lib-esm/DatePicker/Month.js +98 -0
- package/lib-esm/DatePicker/dateParser.d.ts +11 -0
- package/lib-esm/DatePicker/dateParser.js +178 -0
- package/lib-esm/DatePicker/index.d.ts +2 -0
- package/lib-esm/DatePicker/index.js +1 -0
- package/lib-esm/DatePicker/useDatePicker.d.ts +89 -0
- package/lib-esm/DatePicker/useDatePicker.js +408 -0
- package/lib-esm/Dialog/Dialog.d.ts +4 -4
- package/lib-esm/Dialog/Dialog.js +21 -12
- package/lib-esm/Dialog.d.ts +54 -54
- package/lib-esm/Dropdown.d.ts +245 -167
- package/lib-esm/Dropdown.js +3 -4
- package/lib-esm/DropdownMenu/DropdownButton.d.ts +50 -50
- package/lib-esm/FilterList.d.ts +46 -46
- package/lib-esm/Flash.d.ts +1 -1
- package/lib-esm/Label.d.ts +1 -1
- package/lib-esm/Position.d.ts +4 -4
- package/lib-esm/ProgressBar.d.ts +1 -1
- package/lib-esm/SelectMenu/SelectMenu.d.ts +273 -271
- package/lib-esm/SelectMenu/SelectMenuItem.d.ts +1 -1
- package/lib-esm/SelectMenu/SelectMenuModal.d.ts +1 -1
- package/lib-esm/TextInputWithTokens.d.ts +35 -37
- package/lib-esm/TextInputWithTokens.js +30 -101
- package/lib-esm/Timeline.d.ts +52 -52
- package/lib-esm/Token/AvatarToken.d.ts +1 -1
- package/lib-esm/Token/IssueLabelToken.d.ts +1 -1
- package/lib-esm/Token/Token.d.ts +1 -1
- package/lib-esm/Token/Token.js +2 -13
- package/lib-esm/Token/TokenBase.js +4 -0
- package/lib-esm/Token/_RemoveTokenButton.js +2 -11
- package/lib-esm/_TextInputWrapper.d.ts +1 -1
- package/lib-esm/_TextInputWrapper.js +1 -1
- package/lib-esm/constants.js +1 -3
- package/lib-esm/hooks/useDebounce.d.ts +2 -0
- package/lib-esm/hooks/useDebounce.js +16 -0
- package/lib-esm/hooks/useResizeObserver.d.ts +1 -1
- package/lib-esm/hooks/useResizeObserver.js +1 -1
- package/lib-esm/index.d.ts +0 -2
- package/lib-esm/index.js +0 -1
- package/lib-esm/sx.d.ts +2 -8
- package/lib-esm/theme-preval.js +2 -2
- package/lib-esm/theme.d.ts +0 -78
- package/lib-esm/theme.js +1 -2
- package/lib-esm/utils/testing.d.ts +1 -1
- package/package.json +14 -14
- package/lib/NewButton/button.d.ts +0 -581
- package/lib/NewButton/button.js +0 -332
- package/lib/NewButton/buttonStyles.d.ts +0 -2
- package/lib/NewButton/buttonStyles.js +0 -14
- package/lib/NewButton/counter.d.ts +0 -6
- package/lib/NewButton/counter.js +0 -34
- package/lib/NewButton/index.d.ts +0 -4
- package/lib/NewButton/index.js +0 -21
- package/lib/utils/types/KeyPaths.d.ts +0 -3
- package/lib/utils/types/KeyPaths.js +0 -1
- package/lib-esm/NewButton/button.d.ts +0 -581
- package/lib-esm/NewButton/button.js +0 -308
- package/lib-esm/NewButton/buttonStyles.d.ts +0 -2
- package/lib-esm/NewButton/buttonStyles.js +0 -3
- package/lib-esm/NewButton/counter.d.ts +0 -6
- package/lib-esm/NewButton/counter.js +0 -22
- package/lib-esm/NewButton/index.d.ts +0 -4
- package/lib-esm/NewButton/index.js +0 -3
- package/lib-esm/utils/types/KeyPaths.d.ts +0 -3
- package/lib-esm/utils/types/KeyPaths.js +0 -1
package/lib/NewButton/button.js
DELETED
@@ -1,332 +0,0 @@
|
|
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 _octiconsReact = require("@primer/octicons-react");
|
11
|
-
|
12
|
-
var _Box = _interopRequireDefault(require("../Box"));
|
13
|
-
|
14
|
-
var _styledSystem = require("styled-system");
|
15
|
-
|
16
|
-
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
17
|
-
|
18
|
-
var _sx = _interopRequireDefault(require("../sx"));
|
19
|
-
|
20
|
-
var _constants = require("../constants");
|
21
|
-
|
22
|
-
var _buttonStyles = _interopRequireDefault(require("./buttonStyles"));
|
23
|
-
|
24
|
-
var _counter = _interopRequireDefault(require("./counter"));
|
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
|
-
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); }
|
33
|
-
|
34
|
-
const sizes = (0, _styledSystem.variant)({
|
35
|
-
prop: 'size',
|
36
|
-
variants: {
|
37
|
-
small: {
|
38
|
-
fontSize: 0
|
39
|
-
},
|
40
|
-
medium: {
|
41
|
-
fontSize: 1
|
42
|
-
},
|
43
|
-
large: {
|
44
|
-
fontSize: 2
|
45
|
-
}
|
46
|
-
}
|
47
|
-
});
|
48
|
-
|
49
|
-
const getVariantStyles = (theme, variant = 'default') => {
|
50
|
-
const style = {
|
51
|
-
default: `
|
52
|
-
color: ${(0, _constants.get)('colors.btn.text')({
|
53
|
-
theme
|
54
|
-
})};
|
55
|
-
background-color: ${(0, _constants.get)('colors.btn.bg')({
|
56
|
-
theme
|
57
|
-
})};
|
58
|
-
border-width: 1px;
|
59
|
-
border-style: solid;
|
60
|
-
border-color: ${(0, _constants.get)('colors.btn.border')({
|
61
|
-
theme
|
62
|
-
})};
|
63
|
-
box-shadow: ${((0, _constants.get)('shadows.btn.shadow')({
|
64
|
-
theme
|
65
|
-
}), (0, _constants.get)('shadows.btn.insetShadow')({
|
66
|
-
theme
|
67
|
-
}))};
|
68
|
-
&:hover:not([disabled]) {
|
69
|
-
background-color: ${(0, _constants.get)('colors.btn.hoverBg')({
|
70
|
-
theme
|
71
|
-
})};
|
72
|
-
}
|
73
|
-
// focus must come before :active so that the active box shadow overrides
|
74
|
-
&:focus:not([disabled]) {
|
75
|
-
box-shadow: ${(0, _constants.get)('shadows.btn.focusShadow')({
|
76
|
-
theme
|
77
|
-
})};
|
78
|
-
}
|
79
|
-
&:active:not([disabled]) {
|
80
|
-
background-color: ${(0, _constants.get)('colors.btn.selectedBg')({
|
81
|
-
theme
|
82
|
-
})};
|
83
|
-
box-shadow: ${(0, _constants.get)('shadows.btn.shadowActive')({
|
84
|
-
theme
|
85
|
-
})};
|
86
|
-
}
|
87
|
-
&:disabled {
|
88
|
-
color: ${(0, _constants.get)('colors.primer.fg.disabled')({
|
89
|
-
theme
|
90
|
-
})};
|
91
|
-
background-color: ${(0, _constants.get)('colors.btn.disabledBg')({
|
92
|
-
theme
|
93
|
-
})};
|
94
|
-
}
|
95
|
-
`,
|
96
|
-
primary: `
|
97
|
-
color: ${(0, _constants.get)('colors.btn.primary.text')({
|
98
|
-
theme
|
99
|
-
})};
|
100
|
-
background-color: ${(0, _constants.get)('colors.btn.primary.bg')({
|
101
|
-
theme
|
102
|
-
})};
|
103
|
-
border-width: 1px;
|
104
|
-
border-style: solid;
|
105
|
-
border-color: ${(0, _constants.get)('colors.border.subtle')({
|
106
|
-
theme
|
107
|
-
})};
|
108
|
-
box-shadow: ${(0, _constants.get)('shadows.btn.primary.shadow')({
|
109
|
-
theme
|
110
|
-
})};
|
111
|
-
|
112
|
-
&:hover:not([disabled]) {
|
113
|
-
color: ${(0, _constants.get)('colors.btn.primary.hoverText')({
|
114
|
-
theme
|
115
|
-
})};
|
116
|
-
background-color: ${(0, _constants.get)('colors.btn.primary.hoverBg')({
|
117
|
-
theme
|
118
|
-
})};
|
119
|
-
}
|
120
|
-
// focus must come before :active so that the active box shadow overrides
|
121
|
-
&:focus:not([disabled]) {
|
122
|
-
box-shadow: ${(0, _constants.get)('shadows.btn.primary.focusShadow')({
|
123
|
-
theme
|
124
|
-
})};
|
125
|
-
}
|
126
|
-
|
127
|
-
&:active:not([disabled]) {
|
128
|
-
background-color: ${(0, _constants.get)('colors.btn.primary.selectedBg')({
|
129
|
-
theme
|
130
|
-
})};
|
131
|
-
box-shadow: ${(0, _constants.get)('shadows.btn.primary.selectedShadow')({
|
132
|
-
theme
|
133
|
-
})};
|
134
|
-
}
|
135
|
-
|
136
|
-
&:disabled {
|
137
|
-
color: ${(0, _constants.get)('colors.btn.primary.disabledText')({
|
138
|
-
theme
|
139
|
-
})};
|
140
|
-
background-color: ${(0, _constants.get)('colors.btn.primary.disabledBg')({
|
141
|
-
theme
|
142
|
-
})};
|
143
|
-
}`,
|
144
|
-
danger: `
|
145
|
-
color: ${(0, _constants.get)('colors.btn.danger.text')({
|
146
|
-
theme
|
147
|
-
})};
|
148
|
-
border: 1px solid ${(0, _constants.get)('colors.btn.border')({
|
149
|
-
theme
|
150
|
-
})};
|
151
|
-
background-color: ${(0, _constants.get)('colors.btn.bg')({
|
152
|
-
theme
|
153
|
-
})};
|
154
|
-
box-shadow: ${(0, _constants.get)('shadows.btn.shadow')({
|
155
|
-
theme
|
156
|
-
})};
|
157
|
-
|
158
|
-
&:hover:not([disabled]) {
|
159
|
-
color: ${(0, _constants.get)('colors.btn.danger.hoverText')({
|
160
|
-
theme
|
161
|
-
})};
|
162
|
-
background-color: ${(0, _constants.get)('colors.btn.danger.hoverBg')({
|
163
|
-
theme
|
164
|
-
})};
|
165
|
-
border-color: ${(0, _constants.get)('colors.btn.danger.hoverBorder')({
|
166
|
-
theme
|
167
|
-
})};
|
168
|
-
box-shadow: ${(0, _constants.get)('shadows.btn.danger.hoverShadow')({
|
169
|
-
theme
|
170
|
-
})};
|
171
|
-
}
|
172
|
-
// focus must come before :active so that the active box shadow overrides
|
173
|
-
&:focus:not([disabled]) {
|
174
|
-
border-color: ${(0, _constants.get)('colors.btn.danger.focusBorder')({
|
175
|
-
theme
|
176
|
-
})};
|
177
|
-
box-shadow: ${(0, _constants.get)('shadows.btn.danger.focusShadow')({
|
178
|
-
theme
|
179
|
-
})};
|
180
|
-
}
|
181
|
-
|
182
|
-
&:active:not([disabled]) {
|
183
|
-
color: ${(0, _constants.get)('colors.btn.danger.selectedText')({
|
184
|
-
theme
|
185
|
-
})};
|
186
|
-
background-color: ${(0, _constants.get)('colors.btn.danger.selectedBg')({
|
187
|
-
theme
|
188
|
-
})};
|
189
|
-
box-shadow: ${(0, _constants.get)('shadows.btn.danger.selectedShadow')({
|
190
|
-
theme
|
191
|
-
})};
|
192
|
-
border-color: ${(0, _constants.get)('colors.btn.danger.selectedBorder')({
|
193
|
-
theme
|
194
|
-
})};
|
195
|
-
}
|
196
|
-
|
197
|
-
&:disabled {
|
198
|
-
color: ${(0, _constants.get)('colors.btn.danger.disabledText')({
|
199
|
-
theme
|
200
|
-
})};
|
201
|
-
background-color: ${(0, _constants.get)('colors.btn.danger.disabledBg')({
|
202
|
-
theme
|
203
|
-
})};
|
204
|
-
border-color: ${(0, _constants.get)('colors.btn.danger.disabledBorder')({
|
205
|
-
theme
|
206
|
-
})};
|
207
|
-
}
|
208
|
-
`,
|
209
|
-
invisible: `
|
210
|
-
color: ${(0, _constants.get)('colors.accent.fg')({
|
211
|
-
theme
|
212
|
-
})};
|
213
|
-
background-color: transparent;
|
214
|
-
border: 0;
|
215
|
-
border-radius: ${(0, _constants.get)('radii.2')({
|
216
|
-
theme
|
217
|
-
})};
|
218
|
-
box-shadow: none;
|
219
|
-
|
220
|
-
&:disabled {
|
221
|
-
color: ${(0, _constants.get)('colors.primer.fg.disabled')({
|
222
|
-
theme
|
223
|
-
})};
|
224
|
-
}
|
225
|
-
&:focus:not([disabled]) {
|
226
|
-
box-shadow: ${(0, _constants.get)('shadows.btn.focusShadow')({
|
227
|
-
theme
|
228
|
-
})};
|
229
|
-
}
|
230
|
-
&:hover:not([disabled]) {
|
231
|
-
background-color: ${(0, _constants.get)('colors.btn.hoverBg')({
|
232
|
-
theme
|
233
|
-
})};
|
234
|
-
}
|
235
|
-
&:active:not([disabled]) {
|
236
|
-
background-color: ${(0, _constants.get)('colors.btn.selectedBg')({
|
237
|
-
theme
|
238
|
-
})};
|
239
|
-
}
|
240
|
-
`
|
241
|
-
};
|
242
|
-
return style[variant];
|
243
|
-
};
|
244
|
-
|
245
|
-
const getSizes = (size = 'medium', variant = 'default', iconOnly) => {
|
246
|
-
let paddingTop, paddingLeft;
|
247
|
-
|
248
|
-
switch (size) {
|
249
|
-
case 'small':
|
250
|
-
paddingTop = 3;
|
251
|
-
paddingLeft = 12;
|
252
|
-
break;
|
253
|
-
|
254
|
-
case 'large':
|
255
|
-
paddingTop = 9;
|
256
|
-
paddingLeft = 20;
|
257
|
-
break;
|
258
|
-
|
259
|
-
case 'medium':
|
260
|
-
default:
|
261
|
-
paddingTop = 5;
|
262
|
-
paddingLeft = 16;
|
263
|
-
}
|
264
|
-
|
265
|
-
if (iconOnly) {
|
266
|
-
paddingLeft = paddingTop + 2;
|
267
|
-
}
|
268
|
-
|
269
|
-
if (variant === 'invisible') {
|
270
|
-
paddingTop = paddingTop + 1;
|
271
|
-
}
|
272
|
-
|
273
|
-
return `
|
274
|
-
padding:${paddingTop}px ${paddingLeft}px;
|
275
|
-
`;
|
276
|
-
};
|
277
|
-
|
278
|
-
const ButtonBase = _styledComponents.default.button.withConfig({
|
279
|
-
displayName: "button__ButtonBase",
|
280
|
-
componentId: "sc-15k5iqk-0"
|
281
|
-
})(["", " ", " ", " ", " ", " ", ""], _buttonStyles.default, props => getVariantStyles(props.theme, props.variant), props => getSizes(props.size, props.variant, props.iconOnly), sizes, _sx.default, _styledSystem.fontSize);
|
282
|
-
|
283
|
-
const Button = /*#__PURE__*/(0, _react.forwardRef)(({
|
284
|
-
children,
|
285
|
-
...props
|
286
|
-
}, forwardedRef) => {
|
287
|
-
const {
|
288
|
-
icon: Icon,
|
289
|
-
caret,
|
290
|
-
size
|
291
|
-
} = props;
|
292
|
-
let iconOnly = false;
|
293
|
-
|
294
|
-
if (Icon && !children) {
|
295
|
-
iconOnly = true;
|
296
|
-
}
|
297
|
-
|
298
|
-
const iconWrapStyles = {
|
299
|
-
display: 'inline-block',
|
300
|
-
...(!iconOnly ? {
|
301
|
-
mr: 2
|
302
|
-
} : {})
|
303
|
-
};
|
304
|
-
return /*#__PURE__*/_react.default.createElement(ButtonBase, _extends({
|
305
|
-
ref: forwardedRef
|
306
|
-
}, props, {
|
307
|
-
iconOnly: iconOnly
|
308
|
-
}), Icon && /*#__PURE__*/_react.default.createElement(_Box.default, {
|
309
|
-
sx: iconWrapStyles,
|
310
|
-
"aria-hidden": !iconOnly
|
311
|
-
}, /*#__PURE__*/_react.default.createElement(Icon, {
|
312
|
-
size: size
|
313
|
-
})), children, caret && /*#__PURE__*/_react.default.createElement(_Box.default, {
|
314
|
-
sx: {
|
315
|
-
display: 'inline-block',
|
316
|
-
pl: 3
|
317
|
-
},
|
318
|
-
"aria-hidden": true
|
319
|
-
}, /*#__PURE__*/_react.default.createElement(_octiconsReact.TriangleDownIcon, {
|
320
|
-
size: size
|
321
|
-
})));
|
322
|
-
});
|
323
|
-
Button.displayName = 'Button';
|
324
|
-
Button.defaultProps = {
|
325
|
-
size: 'medium',
|
326
|
-
variant: 'default'
|
327
|
-
};
|
328
|
-
const NewButton = Object.assign(Button, {
|
329
|
-
Counter: _counter.default
|
330
|
-
});
|
331
|
-
var _default = NewButton;
|
332
|
-
exports.default = _default;
|
@@ -1,14 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
4
|
-
value: true
|
5
|
-
});
|
6
|
-
exports.default = void 0;
|
7
|
-
|
8
|
-
var _styledComponents = require("styled-components");
|
9
|
-
|
10
|
-
var _constants = require("../constants");
|
11
|
-
|
12
|
-
var _default = (0, _styledComponents.css)(["position:relative;display:inline-block;font-family:inherit;font-weight:", ";line-height:20px;white-space:nowrap;vertical-align:middle;cursor:pointer;user-select:none;border-radius:", ";appearance:none;text-decoration:none;text-align:center;&:hover{text-decoration:none;}&:focus{outline:none;}&:disabled{cursor:default;}&:disabled svg{opacity:0.6;}"], (0, _constants.get)('fontWeights.bold'), (0, _constants.get)('radii.2'));
|
13
|
-
|
14
|
-
exports.default = _default;
|
package/lib/NewButton/counter.js
DELETED
@@ -1,34 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
4
|
-
value: true
|
5
|
-
});
|
6
|
-
exports.default = void 0;
|
7
|
-
|
8
|
-
var _react = _interopRequireDefault(require("react"));
|
9
|
-
|
10
|
-
var _Box = _interopRequireDefault(require("../Box"));
|
11
|
-
|
12
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
13
|
-
|
14
|
-
const styles = {
|
15
|
-
display: 'inline-block',
|
16
|
-
padding: '0px 6px',
|
17
|
-
backgroundColor: 'neutral.muted',
|
18
|
-
borderRadius: '50%',
|
19
|
-
marginLeft: '8px',
|
20
|
-
marginRight: '-4px'
|
21
|
-
};
|
22
|
-
|
23
|
-
const Counter = ({
|
24
|
-
count
|
25
|
-
}) => {
|
26
|
-
// get this to announce new count. How? Change aria property for every render? or aria-live?
|
27
|
-
return /*#__PURE__*/_react.default.createElement(_Box.default, {
|
28
|
-
sx: styles
|
29
|
-
}, count);
|
30
|
-
};
|
31
|
-
|
32
|
-
Counter.displayName = "Counter";
|
33
|
-
var _default = Counter;
|
34
|
-
exports.default = _default;
|
package/lib/NewButton/index.d.ts
DELETED
package/lib/NewButton/index.js
DELETED
@@ -1,21 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
4
|
-
value: true
|
5
|
-
});
|
6
|
-
Object.defineProperty(exports, "ButtonProps", {
|
7
|
-
enumerable: true,
|
8
|
-
get: function () {
|
9
|
-
return _button.NewButtonProps;
|
10
|
-
}
|
11
|
-
});
|
12
|
-
exports.default = void 0;
|
13
|
-
|
14
|
-
var _button = _interopRequireWildcard(require("./button"));
|
15
|
-
|
16
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
17
|
-
|
18
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
19
|
-
|
20
|
-
var _default = _button.default;
|
21
|
-
exports.default = _default;
|
@@ -1 +0,0 @@
|
|
1
|
-
"use strict";
|