@primer/components 0.0.0-202192231947 → 0.0.0-202192543046
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 +23 -1
- package/codemods/deprecateUtilityComponents.js +1 -1
- package/dist/browser.esm.js +880 -770
- package/dist/browser.esm.js.map +1 -1
- package/dist/browser.umd.js +883 -773
- package/dist/browser.umd.js.map +1 -1
- package/lib/ActionList/Item.js +4 -4
- package/lib/ActionList/List.d.ts +2 -1
- package/lib/AnchoredOverlay/AnchoredOverlay.d.ts +6 -3
- package/lib/AnchoredOverlay/AnchoredOverlay.js +11 -3
- package/lib/Autocomplete/Autocomplete.d.ts +306 -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 +294 -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/Button.js +1 -1
- package/lib/Button/ButtonInvisible.js +1 -1
- package/lib/Button/ButtonTableList.js +1 -1
- package/lib/Caret.js +2 -2
- package/lib/DatePicker/DatePicker.js +14 -8
- package/lib/DatePicker/DatePickerAnchor.js +7 -2
- package/lib/DatePicker/DatePickerOverlay.d.ts +3 -0
- package/lib/DatePicker/DatePickerOverlay.js +39 -0
- package/lib/DatePicker/DatePickerPanel.js +92 -9
- package/lib/DatePicker/Day.js +2 -1
- package/lib/DatePicker/Month.js +16 -6
- package/lib/DatePicker/useDatePicker.d.ts +18 -2
- package/lib/DatePicker/useDatePicker.js +155 -51
- 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/Pagination/Pagination.js +1 -1
- package/lib/ProgressBar.js +1 -1
- package/lib/SelectMenu/SelectMenu.d.ts +12 -10
- package/lib/StateLabel.js +13 -19
- package/lib/TextInput.d.ts +5 -13
- package/lib/TextInput.js +4 -46
- package/lib/TextInputWithTokens.d.ts +325 -0
- package/lib/TextInputWithTokens.js +245 -0
- package/lib/Token/AvatarToken.d.ts +7 -0
- package/lib/Token/AvatarToken.js +64 -0
- package/lib/Token/IssueLabelToken.d.ts +14 -0
- package/lib/Token/IssueLabelToken.js +144 -0
- package/lib/Token/Token.d.ts +15 -0
- package/lib/Token/Token.js +94 -0
- package/lib/Token/TokenBase.d.ts +31 -0
- package/lib/Token/TokenBase.js +108 -0
- package/lib/Token/_RemoveTokenButton.d.ts +12 -0
- package/lib/Token/_RemoveTokenButton.js +77 -0
- package/lib/Token/_TokenTextContainer.d.ts +3 -0
- package/lib/Token/_TokenTextContainer.js +17 -0
- package/lib/Token/index.d.ts +3 -0
- package/lib/Token/index.js +31 -0
- package/lib/_TextInputWrapper.d.ts +10 -0
- package/lib/_TextInputWrapper.js +51 -0
- package/lib/_UnstyledTextInput.d.ts +2 -0
- package/lib/_UnstyledTextInput.js +20 -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 +5 -0
- package/lib/index.js +36 -0
- package/lib/theme-preval.js +372 -3102
- package/lib/utils/testing.d.ts +51 -494
- package/lib/utils/{types.d.ts → types/AriaRole.d.ts} +0 -13
- package/lib/utils/{types.js → types/AriaRole.js} +0 -0
- package/lib/utils/types/ComponentProps.d.ts +9 -0
- package/lib/utils/types/ComponentProps.js +1 -0
- package/lib/utils/types/Flatten.d.ts +4 -0
- package/lib/utils/types/Flatten.js +1 -0
- package/lib/utils/types/MandateProps.d.ts +3 -0
- package/lib/utils/types/MandateProps.js +1 -0
- package/lib/utils/types/Merge.d.ts +19 -0
- package/lib/utils/types/Merge.js +1 -0
- package/lib/utils/types/index.d.ts +5 -0
- package/lib/utils/types/index.js +70 -0
- package/lib-esm/ActionList/Item.js +4 -4
- package/lib-esm/ActionList/List.d.ts +2 -1
- package/lib-esm/AnchoredOverlay/AnchoredOverlay.d.ts +6 -3
- package/lib-esm/AnchoredOverlay/AnchoredOverlay.js +11 -3
- package/lib-esm/Autocomplete/Autocomplete.d.ts +306 -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 +294 -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/Button.js +1 -1
- package/lib-esm/Button/ButtonInvisible.js +1 -1
- package/lib-esm/Button/ButtonTableList.js +1 -1
- package/lib-esm/Caret.js +2 -2
- package/lib-esm/DatePicker/DatePicker.js +13 -6
- package/lib-esm/DatePicker/DatePickerAnchor.js +7 -2
- package/lib-esm/DatePicker/DatePickerOverlay.d.ts +3 -0
- package/lib-esm/DatePicker/DatePickerOverlay.js +24 -0
- package/lib-esm/DatePicker/DatePickerPanel.js +86 -10
- package/lib-esm/DatePicker/Day.js +2 -1
- package/lib-esm/DatePicker/Month.js +15 -6
- package/lib-esm/DatePicker/useDatePicker.d.ts +18 -2
- package/lib-esm/DatePicker/useDatePicker.js +156 -52
- 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/Pagination/Pagination.js +1 -1
- package/lib-esm/ProgressBar.js +1 -1
- package/lib-esm/SelectMenu/SelectMenu.d.ts +12 -10
- package/lib-esm/StateLabel.js +13 -19
- package/lib-esm/TextInput.d.ts +5 -13
- package/lib-esm/TextInput.js +4 -37
- package/lib-esm/TextInputWithTokens.d.ts +325 -0
- package/lib-esm/TextInputWithTokens.js +220 -0
- package/lib-esm/Token/AvatarToken.d.ts +7 -0
- package/lib-esm/Token/AvatarToken.js +43 -0
- package/lib-esm/Token/IssueLabelToken.d.ts +14 -0
- package/lib-esm/Token/IssueLabelToken.js +124 -0
- package/lib-esm/Token/Token.d.ts +15 -0
- package/lib-esm/Token/Token.js +73 -0
- package/lib-esm/Token/TokenBase.d.ts +31 -0
- package/lib-esm/Token/TokenBase.js +87 -0
- package/lib-esm/Token/_RemoveTokenButton.d.ts +12 -0
- package/lib-esm/Token/_RemoveTokenButton.js +60 -0
- package/lib-esm/Token/_TokenTextContainer.d.ts +3 -0
- package/lib-esm/Token/_TokenTextContainer.js +6 -0
- package/lib-esm/Token/index.d.ts +3 -0
- package/lib-esm/Token/index.js +3 -0
- package/lib-esm/_TextInputWrapper.d.ts +10 -0
- package/lib-esm/_TextInputWrapper.js +31 -0
- package/lib-esm/_UnstyledTextInput.d.ts +2 -0
- package/lib-esm/_UnstyledTextInput.js +7 -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 +5 -0
- package/lib-esm/index.js +3 -0
- package/lib-esm/theme-preval.js +372 -3102
- package/lib-esm/utils/testing.d.ts +51 -494
- package/lib-esm/utils/{types.d.ts → types/AriaRole.d.ts} +0 -13
- package/lib-esm/utils/{types.js → types/AriaRole.js} +0 -0
- package/lib-esm/utils/types/ComponentProps.d.ts +9 -0
- package/lib-esm/utils/types/ComponentProps.js +1 -0
- package/lib-esm/utils/types/Flatten.d.ts +4 -0
- package/lib-esm/utils/types/Flatten.js +1 -0
- package/lib-esm/utils/types/MandateProps.d.ts +3 -0
- package/lib-esm/utils/types/MandateProps.js +1 -0
- package/lib-esm/utils/types/Merge.d.ts +19 -0
- package/lib-esm/utils/types/Merge.js +1 -0
- package/lib-esm/utils/types/index.d.ts +5 -0
- package/lib-esm/utils/types/index.js +5 -0
- package/package.json +10 -9
@@ -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;
|
@@ -24,7 +24,7 @@ function _extends() { _extends = Object.assign || function (target) { for (var i
|
|
24
24
|
const Page = _styledComponents.default.a.withConfig({
|
25
25
|
displayName: "Pagination__Page",
|
26
26
|
componentId: "b80nss-0"
|
27
|
-
})(["display:inline-block;min-width:32px;padding:5px 10px;font-style:normal;line-height:20px;color:", ";text-align:center;white-space:nowrap;vertical-align:middle;cursor:pointer;user-select:none;text-decoration:none;margin-right:", ";&:last-child{margin-right:0;}border:", " solid transparent;border-radius:", ";transition:border-color 0.2s cubic-bezier(0.3,0,0.5,1);&:hover,&:focus{text-decoration:none;border-color:", ";outline:0;transition-duration:0.1s;}&:active{border-color:", ";}&[rel='prev'],&[rel='next']{color:", ";}&[aria-current],&[aria-current]:hover{color:", ";background-color:", ";border-color:transparent;}&[aria-disabled],&[aria-disabled]:hover{color:", ";cursor:default;border-color:transparent;}@supports (clip-path:polygon(50% 0,100% 50%,50% 100%)){&[rel='prev']::before,&[rel='next']::after{display:inline-block;width:16px;height:16px;vertical-align:text-bottom;content:'';background-color:currentColor;}&[rel='prev']::before{margin-right:", ";clip-path:polygon( 9.8px 12.8px,8.7px 12.8px,4.5px 8.5px,4.5px 7.5px,8.7px 3.2px,9.8px 4.3px,6.1px 8px,9.8px 11.7px,9.8px 12.8px );}&[rel='next']::after{margin-left:", ";clip-path:polygon( 6.2px 3.2px,7.3px 3.2px,11.5px 7.5px,11.5px 8.5px,7.3px 12.8px,6.2px 11.7px,9.9px 8px,6.2px 4.3px,6.2px 3.2px );}}", ";"], (0, _constants.get)('colors.fg.default'), (0, _constants.get)('space.1'), (0, _constants.get)('borderWidths.1'), (0, _constants.get)('radii.2'), (0, _constants.get)('colors.border.default'), (0, _constants.get)('colors.border.muted'), (0, _constants.get)('colors.accent.fg'), (0, _constants.get)('colors.fg.onEmphasis'), (0, _constants.get)('colors.accent.emphasis'), (0, _constants.get)('colors.fg.
|
27
|
+
})(["display:inline-block;min-width:32px;padding:5px 10px;font-style:normal;line-height:20px;color:", ";text-align:center;white-space:nowrap;vertical-align:middle;cursor:pointer;user-select:none;text-decoration:none;margin-right:", ";&:last-child{margin-right:0;}border:", " solid transparent;border-radius:", ";transition:border-color 0.2s cubic-bezier(0.3,0,0.5,1);&:hover,&:focus{text-decoration:none;border-color:", ";outline:0;transition-duration:0.1s;}&:active{border-color:", ";}&[rel='prev'],&[rel='next']{color:", ";}&[aria-current],&[aria-current]:hover{color:", ";background-color:", ";border-color:transparent;}&[aria-disabled],&[aria-disabled]:hover{color:", ";cursor:default;border-color:transparent;}@supports (clip-path:polygon(50% 0,100% 50%,50% 100%)){&[rel='prev']::before,&[rel='next']::after{display:inline-block;width:16px;height:16px;vertical-align:text-bottom;content:'';background-color:currentColor;}&[rel='prev']::before{margin-right:", ";clip-path:polygon( 9.8px 12.8px,8.7px 12.8px,4.5px 8.5px,4.5px 7.5px,8.7px 3.2px,9.8px 4.3px,6.1px 8px,9.8px 11.7px,9.8px 12.8px );}&[rel='next']::after{margin-left:", ";clip-path:polygon( 6.2px 3.2px,7.3px 3.2px,11.5px 7.5px,11.5px 8.5px,7.3px 12.8px,6.2px 11.7px,9.9px 8px,6.2px 4.3px,6.2px 3.2px );}}", ";"], (0, _constants.get)('colors.fg.default'), (0, _constants.get)('space.1'), (0, _constants.get)('borderWidths.1'), (0, _constants.get)('radii.2'), (0, _constants.get)('colors.border.default'), (0, _constants.get)('colors.border.muted'), (0, _constants.get)('colors.accent.fg'), (0, _constants.get)('colors.fg.onEmphasis'), (0, _constants.get)('colors.accent.emphasis'), (0, _constants.get)('colors.primer.fg.disabled'), (0, _constants.get)('space.1'), (0, _constants.get)('space.1'), _constants.COMMON);
|
28
28
|
|
29
29
|
function usePaginationPages({
|
30
30
|
theme,
|
package/lib/ProgressBar.js
CHANGED
@@ -32,7 +32,17 @@ declare const _default: React.ForwardRefExoticComponent<Pick<SelectMenuInternalP
|
|
32
32
|
Divider: import("styled-components").StyledComponent<"div", any, SystemCommonProps & SxProp, never>;
|
33
33
|
Filter: React.ForwardRefExoticComponent<Pick<{
|
34
34
|
value?: string | undefined;
|
35
|
-
} & Pick<{
|
35
|
+
} & Pick<Omit<Pick<({
|
36
|
+
[x: string]: any;
|
37
|
+
[x: number]: any;
|
38
|
+
} & {
|
39
|
+
theme?: any;
|
40
|
+
} & ({} | {
|
41
|
+
children?: React.ReactNode;
|
42
|
+
})) & {
|
43
|
+
as?: string | React.ComponentType<any> | undefined;
|
44
|
+
forwardedAs?: string | React.ComponentType<any> | undefined;
|
45
|
+
}, string | number | symbol>, "maxWidth" | "minWidth" | "width" | "theme" | "className" | "block" | "icon" | "sx" | "disabled" | "variant" | "contrast"> & {
|
36
46
|
className?: string | undefined;
|
37
47
|
icon?: React.ComponentType<{
|
38
48
|
className?: string | undefined;
|
@@ -307,15 +317,7 @@ declare const _default: React.ForwardRefExoticComponent<Pick<SelectMenuInternalP
|
|
307
317
|
contrast?: boolean | undefined;
|
308
318
|
} & {
|
309
319
|
theme?: any;
|
310
|
-
}, "maxWidth" | "minWidth" | "width" | "theme" | "block" | "sx" | "disabled" | "variant" | "contrast"> &
|
311
|
-
[x: string]: any;
|
312
|
-
[x: number]: any;
|
313
|
-
} & {
|
314
|
-
theme?: any;
|
315
|
-
} & {
|
316
|
-
as?: string | React.ComponentType<any> | undefined;
|
317
|
-
forwardedAs?: string | React.ComponentType<any> | undefined;
|
318
|
-
}, string | number | symbol>, "maxWidth" | "minWidth" | "width" | "theme" | "className" | "block" | "icon" | "sx" | "disabled" | "variant" | "contrast">, string | number | symbol> & React.RefAttributes<HTMLInputElement>, string | number | symbol> & React.RefAttributes<HTMLInputElement>>;
|
320
|
+
}, "maxWidth" | "minWidth" | "width" | "theme" | "block" | "sx" | "disabled" | "variant" | "contrast">, string | number | symbol> & React.RefAttributes<HTMLInputElement>, string | number | symbol> & React.RefAttributes<HTMLInputElement>>;
|
319
321
|
Footer: import("styled-components").StyledComponent<"footer", any, SystemCommonProps & SxProp, never>;
|
320
322
|
Item: React.ForwardRefExoticComponent<Pick<{
|
321
323
|
as?: React.ElementType<any> | undefined;
|
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,
|
package/lib/TextInput.d.ts
CHANGED
@@ -1,22 +1,14 @@
|
|
1
1
|
import React from 'react';
|
2
|
-
import {
|
3
|
-
import
|
4
|
-
import
|
5
|
-
declare const Input: import("styled-components").StyledComponent<"input", any, {}, never>;
|
6
|
-
declare const Wrapper: import("styled-components").StyledComponent<"span", any, {
|
7
|
-
disabled?: boolean | undefined;
|
8
|
-
hasIcon?: boolean | undefined;
|
9
|
-
block?: boolean | undefined;
|
10
|
-
contrast?: boolean | undefined;
|
11
|
-
variant?: "large" | "small" | undefined;
|
12
|
-
} & WidthProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>, import("csstype").Property.Width<import("styled-system").TLengthStyledSystem>> & MinWidthProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>, import("csstype").Property.MinWidth<import("styled-system").TLengthStyledSystem>> & MaxWidthProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>, import("csstype").Property.MaxWidth<import("styled-system").TLengthStyledSystem>> & SxProp, never>;
|
2
|
+
import { ComponentProps, Merge } from './utils/types';
|
3
|
+
import UnstyledTextInput from './_UnstyledTextInput';
|
4
|
+
import TextInputWrapper from './_TextInputWrapper';
|
13
5
|
declare type NonPassthroughProps = {
|
14
6
|
className?: string;
|
15
7
|
icon?: React.ComponentType<{
|
16
8
|
className?: string;
|
17
9
|
}>;
|
18
|
-
} & Pick<ComponentProps<typeof
|
19
|
-
declare type TextInputInternalProps =
|
10
|
+
} & Pick<ComponentProps<typeof TextInputWrapper>, 'block' | 'contrast' | 'disabled' | 'sx' | 'theme' | 'width' | 'maxWidth' | 'minWidth' | 'variant'>;
|
11
|
+
declare type TextInputInternalProps = Merge<React.ComponentPropsWithoutRef<typeof UnstyledTextInput>, NonPassthroughProps>;
|
20
12
|
declare const TextInput: React.ForwardRefExoticComponent<Pick<TextInputInternalProps, string | number | symbol> & React.RefAttributes<HTMLInputElement>>;
|
21
13
|
export declare type TextInputProps = ComponentProps<typeof TextInput>;
|
22
14
|
export default TextInput;
|
package/lib/TextInput.js
CHANGED
@@ -9,56 +9,14 @@ var _classnames = _interopRequireDefault(require("classnames"));
|
|
9
9
|
|
10
10
|
var _react = _interopRequireDefault(require("react"));
|
11
11
|
|
12
|
-
var
|
12
|
+
var _UnstyledTextInput = _interopRequireDefault(require("./_UnstyledTextInput"));
|
13
13
|
|
14
|
-
var
|
15
|
-
|
16
|
-
var _constants = require("./constants");
|
17
|
-
|
18
|
-
var _sx = _interopRequireDefault(require("./sx"));
|
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; }
|
14
|
+
var _TextInputWrapper = _interopRequireDefault(require("./_TextInputWrapper"));
|
23
15
|
|
24
16
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
25
17
|
|
26
18
|
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); }
|
27
19
|
|
28
|
-
const sizeVariants = (0, _styledSystem.variant)({
|
29
|
-
variants: {
|
30
|
-
small: {
|
31
|
-
minHeight: '28px',
|
32
|
-
px: 2,
|
33
|
-
py: '3px',
|
34
|
-
fontSize: 0,
|
35
|
-
lineHeight: '20px'
|
36
|
-
},
|
37
|
-
large: {
|
38
|
-
px: 2,
|
39
|
-
py: '10px',
|
40
|
-
fontSize: 3
|
41
|
-
}
|
42
|
-
}
|
43
|
-
});
|
44
|
-
|
45
|
-
const Input = _styledComponents.default.input.withConfig({
|
46
|
-
displayName: "TextInput__Input",
|
47
|
-
componentId: "sc-1apmpmt-0"
|
48
|
-
})(["border:0;font-size:inherit;font-family:inherit;background-color:transparent;-webkit-appearance:none;color:inherit;width:100%;&:focus{outline:0;}"]);
|
49
|
-
|
50
|
-
const Wrapper = _styledComponents.default.span.withConfig({
|
51
|
-
displayName: "TextInput__Wrapper",
|
52
|
-
componentId: "sc-1apmpmt-1"
|
53
|
-
})(["display:inline-flex;align-items:stretch;min-height:34px;font-size:", ";line-height:20px;color:", ";vertical-align:middle;background-repeat:no-repeat;background-position:right 8px center;border:1px solid ", ";border-radius:", ";outline:none;box-shadow:", ";", " .TextInput-icon{align-self:center;color:", ";margin:0 ", ";flex-shrink:0;}&:focus-within{border-color:", ";box-shadow:", ";}", " ", " ", " @media (min-width:", "){font-size:", ";}", " ", " ", " ", " ", ";"], (0, _constants.get)('fontSizes.1'), (0, _constants.get)('colors.fg.default'), (0, _constants.get)('colors.border.default'), (0, _constants.get)('radii.2'), (0, _constants.get)('shadows.primer.shadow.inset'), props => {
|
54
|
-
if (props.hasIcon) {
|
55
|
-
return (0, _styledComponents.css)(["padding:0;"]);
|
56
|
-
} else {
|
57
|
-
return (0, _styledComponents.css)(["padding:6px 12px;"]);
|
58
|
-
}
|
59
|
-
}, (0, _constants.get)('colors.fg.muted'), (0, _constants.get)('space.2'), (0, _constants.get)('colors.accent.emphasis'), (0, _constants.get)('shadows.primer.shadow.focus'), props => props.contrast && (0, _styledComponents.css)(["background-color:", ";"], (0, _constants.get)('colors.canvas.inset')), props => props.disabled && (0, _styledComponents.css)(["color:", ";background-color:", ";border-color:", ";"], (0, _constants.get)('colors.fg.muted'), (0, _constants.get)('colors.input.disabledBg'), (0, _constants.get)('colors.border.default')), props => props.block && (0, _styledComponents.css)(["display:block;width:100%;"]), (0, _constants.get)('breakpoints.1'), (0, _constants.get)('fontSizes.1'), _styledSystem.width, _styledSystem.minWidth, _styledSystem.maxWidth, sizeVariants, _sx.default); // Props that are not passed through to Input:
|
60
|
-
|
61
|
-
|
62
20
|
// using forwardRef is important so that other components (ex. SelectMenu) can autofocus the input
|
63
21
|
const TextInput = /*#__PURE__*/_react.default.forwardRef(({
|
64
22
|
icon: IconComponent,
|
@@ -76,7 +34,7 @@ const TextInput = /*#__PURE__*/_react.default.forwardRef(({
|
|
76
34
|
}, ref) => {
|
77
35
|
// this class is necessary to style FilterSearch, plz no touchy!
|
78
36
|
const wrapperClasses = (0, _classnames.default)(className, 'TextInput-wrapper');
|
79
|
-
return /*#__PURE__*/_react.default.createElement(
|
37
|
+
return /*#__PURE__*/_react.default.createElement(_TextInputWrapper.default, {
|
80
38
|
block: block,
|
81
39
|
className: wrapperClasses,
|
82
40
|
contrast: contrast,
|
@@ -90,7 +48,7 @@ const TextInput = /*#__PURE__*/_react.default.forwardRef(({
|
|
90
48
|
variant: variantProp
|
91
49
|
}, IconComponent && /*#__PURE__*/_react.default.createElement(IconComponent, {
|
92
50
|
className: "TextInput-icon"
|
93
|
-
}), /*#__PURE__*/_react.default.createElement(
|
51
|
+
}), /*#__PURE__*/_react.default.createElement(_UnstyledTextInput.default, _extends({
|
94
52
|
ref: ref,
|
95
53
|
disabled: disabled
|
96
54
|
}, inputProps)));
|