@primer/components 0.0.0-20219151326 → 0.0.0-202191524113
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 +27 -3
- package/codemods/deprecateUtilityComponents.js +1 -1
- package/dist/browser.esm.js +874 -769
- package/dist/browser.esm.js.map +1 -1
- package/dist/browser.umd.js +877 -772
- package/dist/browser.umd.js.map +1 -1
- package/lib/ActionList/Header.js +1 -1
- package/lib/ActionList/Item.js +8 -8
- package/lib/ActionList/List.d.ts +2 -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/BranchName.js +1 -1
- package/lib/Breadcrumbs.js +1 -1
- package/lib/Button/Button.js +1 -1
- package/lib/Button/ButtonClose.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/Dialog/ConfirmationDialog.js +1 -1
- package/lib/Dialog/Dialog.js +2 -2
- package/lib/Dialog.js +1 -1
- package/lib/FilterList.js +1 -1
- package/lib/FilteredActionList/FilteredActionList.d.ts +3 -2
- package/lib/FilteredActionList/FilteredActionList.js +8 -32
- package/lib/Flash.js +16 -16
- package/lib/Label.js +2 -2
- package/lib/Link.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 +10 -10
- package/lib/SelectMenu/SelectMenuDivider.js +1 -1
- package/lib/SelectMenu/SelectMenuFooter.js +1 -1
- package/lib/SelectMenu/SelectMenuItem.js +1 -1
- package/lib/SelectMenu/SelectMenuTab.js +1 -1
- package/lib/SelectPanel/SelectPanel.d.ts +1 -1
- package/lib/SelectPanel/SelectPanel.js +9 -11
- package/lib/StateLabel.js +13 -19
- package/lib/SubNav.js +1 -1
- package/lib/TextInput.d.ts +5 -13
- package/lib/TextInput.js +4 -46
- package/lib/TextInputWithTokens.d.ts +323 -0
- package/lib/TextInputWithTokens.js +245 -0
- package/lib/Timeline.js +2 -2
- 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/UnderlineNav.js +1 -1
- 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 +370 -3100
- package/lib/utils/testing.d.ts +50 -493
- 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/Header.js +1 -1
- package/lib-esm/ActionList/Item.js +8 -8
- package/lib-esm/ActionList/List.d.ts +2 -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/BranchName.js +1 -1
- package/lib-esm/Breadcrumbs.js +1 -1
- package/lib-esm/Button/Button.js +1 -1
- package/lib-esm/Button/ButtonClose.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/Dialog/ConfirmationDialog.js +1 -1
- package/lib-esm/Dialog/Dialog.js +2 -2
- package/lib-esm/Dialog.js +1 -1
- package/lib-esm/FilterList.js +1 -1
- package/lib-esm/FilteredActionList/FilteredActionList.d.ts +3 -2
- package/lib-esm/FilteredActionList/FilteredActionList.js +6 -32
- package/lib-esm/Flash.js +16 -16
- package/lib-esm/Label.js +2 -2
- package/lib-esm/Link.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 +10 -10
- package/lib-esm/SelectMenu/SelectMenuDivider.js +1 -1
- package/lib-esm/SelectMenu/SelectMenuFooter.js +1 -1
- package/lib-esm/SelectMenu/SelectMenuItem.js +1 -1
- package/lib-esm/SelectMenu/SelectMenuTab.js +1 -1
- package/lib-esm/SelectPanel/SelectPanel.d.ts +1 -1
- package/lib-esm/SelectPanel/SelectPanel.js +9 -8
- package/lib-esm/StateLabel.js +13 -19
- package/lib-esm/SubNav.js +1 -1
- package/lib-esm/TextInput.d.ts +5 -13
- package/lib-esm/TextInput.js +4 -37
- package/lib-esm/TextInputWithTokens.d.ts +323 -0
- package/lib-esm/TextInputWithTokens.js +220 -0
- package/lib-esm/Timeline.js +2 -2
- 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/UnderlineNav.js +1 -1
- 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 +370 -3100
- package/lib-esm/utils/testing.d.ts +50 -493
- 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 +4 -3
- package/lib/ActionList2/Description.d.ts +0 -5
- package/lib/ActionList2/Description.js +0 -54
- package/lib/ActionList2/Divider.d.ts +0 -8
- package/lib/ActionList2/Divider.js +0 -42
- package/lib/ActionList2/Group.d.ts +0 -8
- package/lib/ActionList2/Group.js +0 -39
- package/lib/ActionList2/Header.d.ts +0 -26
- package/lib/ActionList2/Header.js +0 -55
- package/lib/ActionList2/Item.d.ts +0 -52
- package/lib/ActionList2/Item.js +0 -188
- package/lib/ActionList2/List.d.ts +0 -18
- package/lib/ActionList2/List.js +0 -52
- package/lib/ActionList2/Selection.d.ts +0 -5
- package/lib/ActionList2/Selection.js +0 -67
- package/lib/ActionList2/Visuals.d.ts +0 -12
- package/lib/ActionList2/Visuals.js +0 -91
- package/lib/ActionList2/hacks.d.ts +0 -30
- package/lib/ActionList2/hacks.js +0 -38
- package/lib/ActionList2/index.d.ts +0 -26
- package/lib/ActionList2/index.js +0 -36
- package/lib-esm/ActionList2/Description.d.ts +0 -5
- package/lib-esm/ActionList2/Description.js +0 -38
- package/lib-esm/ActionList2/Divider.d.ts +0 -8
- package/lib-esm/ActionList2/Divider.js +0 -30
- package/lib-esm/ActionList2/Group.d.ts +0 -8
- package/lib-esm/ActionList2/Group.js +0 -29
- package/lib-esm/ActionList2/Header.d.ts +0 -26
- package/lib-esm/ActionList2/Header.js +0 -45
- package/lib-esm/ActionList2/Item.d.ts +0 -52
- package/lib-esm/ActionList2/Item.js +0 -184
- package/lib-esm/ActionList2/List.d.ts +0 -18
- package/lib-esm/ActionList2/List.js +0 -42
- package/lib-esm/ActionList2/Selection.d.ts +0 -5
- package/lib-esm/ActionList2/Selection.js +0 -50
- package/lib-esm/ActionList2/Visuals.d.ts +0 -12
- package/lib-esm/ActionList2/Visuals.js +0 -68
- package/lib-esm/ActionList2/hacks.d.ts +0 -30
- package/lib-esm/ActionList2/hacks.js +0 -30
- package/lib-esm/ActionList2/index.d.ts +0 -26
- package/lib-esm/ActionList2/index.js +0 -23
@@ -9,7 +9,7 @@ import { buildComponentData, buildPaginationModel } from './model';
|
|
9
9
|
const Page = styled.a.withConfig({
|
10
10
|
displayName: "Pagination__Page",
|
11
11
|
componentId: "b80nss-0"
|
12
|
-
})(["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 );}}", ";"], get('colors.fg.default'), get('space.1'), get('borderWidths.1'), get('radii.2'), get('colors.border.default'), get('colors.border.muted'), get('colors.accent.fg'), get('colors.fg.onEmphasis'), get('colors.accent.emphasis'), get('colors.fg.
|
12
|
+
})(["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 );}}", ";"], get('colors.fg.default'), get('space.1'), get('borderWidths.1'), get('radii.2'), get('colors.border.default'), get('colors.border.muted'), get('colors.accent.fg'), get('colors.fg.onEmphasis'), get('colors.accent.emphasis'), get('colors.primer.fg.disabled'), get('space.1'), get('space.1'), COMMON);
|
13
13
|
|
14
14
|
function usePaginationPages({
|
15
15
|
theme,
|
package/lib-esm/ProgressBar.js
CHANGED
@@ -32,7 +32,15 @@ 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
|
+
as?: string | React.ComponentType<any> | undefined;
|
42
|
+
forwardedAs?: string | React.ComponentType<any> | undefined;
|
43
|
+
}, string | number | symbol>, "maxWidth" | "minWidth" | "width" | "theme" | "className" | "block" | "icon" | "sx" | "disabled" | "variant" | "contrast"> & {
|
36
44
|
className?: string | undefined;
|
37
45
|
icon?: React.ComponentType<{
|
38
46
|
className?: string | undefined;
|
@@ -307,15 +315,7 @@ declare const _default: React.ForwardRefExoticComponent<Pick<SelectMenuInternalP
|
|
307
315
|
contrast?: boolean | undefined;
|
308
316
|
} & {
|
309
317
|
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>>;
|
318
|
+
}, "maxWidth" | "minWidth" | "width" | "theme" | "block" | "sx" | "disabled" | "variant" | "contrast">, string | number | symbol> & React.RefAttributes<HTMLInputElement>, string | number | symbol> & React.RefAttributes<HTMLInputElement>>;
|
319
319
|
Footer: import("styled-components").StyledComponent<"footer", any, SystemCommonProps & SxProp, never>;
|
320
320
|
Item: React.ForwardRefExoticComponent<Pick<{
|
321
321
|
as?: React.ElementType<any> | undefined;
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import styled, { css } from 'styled-components';
|
2
2
|
import { COMMON, get } from '../constants';
|
3
3
|
import sx from '../sx';
|
4
|
-
const dividerStyles = css(["padding:", " ", ";margin:0;font-size:", ";font-weight:", ";color:", ";background-color:", ";border-bottom:", " solid ", ";"], get('space.1'), get('space.3'), get('fontSizes.0'), get('fontWeights.bold'), get('colors.fg.
|
4
|
+
const dividerStyles = css(["padding:", " ", ";margin:0;font-size:", ";font-weight:", ";color:", ";background-color:", ";border-bottom:", " solid ", ";"], get('space.1'), get('space.3'), get('fontSizes.0'), get('fontWeights.bold'), get('colors.primer.fg.disabled'), get('colors.canvas.subtle'), get('borderWidths.1'), get('colors.border.muted'));
|
5
5
|
const SelectMenuDivider = styled.div.withConfig({
|
6
6
|
displayName: "SelectMenuDivider",
|
7
7
|
componentId: "sc-2p0bwt-0"
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import styled, { css } from 'styled-components';
|
2
2
|
import { COMMON, get } from '../constants';
|
3
3
|
import sx from '../sx';
|
4
|
-
const footerStyles = css(["margin-top:-1px;padding:", " ", ";font-size:", ";color:", ";text-align:center;border-top:", " solid ", ";@media (min-width:", "){padding:", " ", ";}"], get('space.2'), get('space.3'), get('fontSizes.0'), get('colors.fg.
|
4
|
+
const footerStyles = css(["margin-top:-1px;padding:", " ", ";font-size:", ";color:", ";text-align:center;border-top:", " solid ", ";@media (min-width:", "){padding:", " ", ";}"], get('space.2'), get('space.3'), get('fontSizes.0'), get('colors.primer.fg.disabled'), get('borderWidths.1'), get('colors.border.muted'), get('breakpoints.0'), get('space.1'), get('space.2'));
|
5
5
|
const SelectMenuFooter = styled.footer.withConfig({
|
6
6
|
displayName: "SelectMenuFooter",
|
7
7
|
componentId: "rkvco1-0"
|
@@ -7,7 +7,7 @@ import { COMMON, get } from '../constants';
|
|
7
7
|
import StyledOcticon from '../StyledOcticon';
|
8
8
|
import sx from '../sx';
|
9
9
|
import { MenuContext } from './SelectMenuContext';
|
10
|
-
export const listItemStyles = css(["display:flex;align-items:center;padding:", ";overflow:hidden;text-align:left;cursor:pointer;background-color:", ";border:0;border-bottom:", " solid ", ";color:", ";text-decoration:none;font-size:", ";font-family:inherit;width:100%;&:hover{text-decoration:none;}&:focus{outline:none;}&[hidden]{display:none !important;}@media (min-width:", "){padding-top:", ";padding-bottom:", ";}.SelectMenu-icon{width:", ";margin-right:", ";flex-shrink:0;}.SelectMenu-selected-icon{visibility:hidden;transition:transform 0.12s cubic-bezier(0.5,0.1,1,0.5),visibility 0s 0.12s linear;transform:scale(0);}&[aria-checked='true']{font-weight:500;color:", ";.SelectMenu-selected-icon{visibility:visible;transition:transform 0.12s cubic-bezier(0,0,0.2,1),visibility 0s linear;transform:scale(1);}}@media (hover:hover){&:hover,&:active,&:focus{background-color:", ";}}@media (hover:none){&:focus,&:active{background-color:", ";}-webkit-tap-highlight-color:", ";}"], get('space.3'), get('colors.canvas.overlay'), get('borderWidths.1'), get('colors.border.muted'), get('colors.fg.
|
10
|
+
export const listItemStyles = css(["display:flex;align-items:center;padding:", ";overflow:hidden;text-align:left;cursor:pointer;background-color:", ";border:0;border-bottom:", " solid ", ";color:", ";text-decoration:none;font-size:", ";font-family:inherit;width:100%;&:hover{text-decoration:none;}&:focus{outline:none;}&[hidden]{display:none !important;}@media (min-width:", "){padding-top:", ";padding-bottom:", ";}.SelectMenu-icon{width:", ";margin-right:", ";flex-shrink:0;}.SelectMenu-selected-icon{visibility:hidden;transition:transform 0.12s cubic-bezier(0.5,0.1,1,0.5),visibility 0s 0.12s linear;transform:scale(0);}&[aria-checked='true']{font-weight:500;color:", ";.SelectMenu-selected-icon{visibility:visible;transition:transform 0.12s cubic-bezier(0,0,0.2,1),visibility 0s linear;transform:scale(1);}}@media (hover:hover){&:hover,&:active,&:focus{background-color:", ";}}@media (hover:none){&:focus,&:active{background-color:", ";}-webkit-tap-highlight-color:", ";}"], get('space.3'), get('colors.canvas.overlay'), get('borderWidths.1'), get('colors.border.muted'), get('colors.primer.fg.disabled'), get('fontSizes.0'), get('breakpoints.0'), get('space.2'), get('space.2'), get('space.3'), get('space.2'), get('colors.fg.default'), get('colors.neutral.subtle'), get('colors.canvas.subtle'), get('colors.selectMenu.tapHighlight'));
|
11
11
|
const StyledItem = styled.a.attrs(() => ({
|
12
12
|
role: 'menuitemcheckbox'
|
13
13
|
})).withConfig({
|
@@ -6,7 +6,7 @@ import styled, { css } from 'styled-components';
|
|
6
6
|
import { COMMON, get } from '../constants';
|
7
7
|
import sx from '../sx';
|
8
8
|
import { MenuContext } from './SelectMenuContext';
|
9
|
-
const tabStyles = css(["flex:1;padding:", " ", ";font-size:", ";font-weight:500;color:", ";text-align:center;background-color:transparent;border:0;box-shadow:inset 0 -1px 0 ", ";@media (min-width:", "){flex:none;padding:", " ", ";border:", " solid transparent;border-bottom-width:0;border-top-left-radius:", ";border-top-right-radius:", ";}&[aria-selected='true']{z-index:1;color:", ";background-color:", ";box-shadow:0 0 0 1px ", ";@media (min-width:", "){border-color:", ";box-shadow:none;}}&:focus{background-color:", ";}"], get('space.2'), get('space.3'), get('fontSizes.0'), get('colors.fg.
|
9
|
+
const tabStyles = css(["flex:1;padding:", " ", ";font-size:", ";font-weight:500;color:", ";text-align:center;background-color:transparent;border:0;box-shadow:inset 0 -1px 0 ", ";@media (min-width:", "){flex:none;padding:", " ", ";border:", " solid transparent;border-bottom-width:0;border-top-left-radius:", ";border-top-right-radius:", ";}&[aria-selected='true']{z-index:1;color:", ";background-color:", ";box-shadow:0 0 0 1px ", ";@media (min-width:", "){border-color:", ";box-shadow:none;}}&:focus{background-color:", ";}"], get('space.2'), get('space.3'), get('fontSizes.0'), get('colors.primer.fg.disabled'), get('colors.border.muted'), get('breakpoints.0'), get('space.1'), get('space.3'), get('borderWidths.1'), get('radii.2'), get('radii.2'), get('colors.text-primary'), get('colors.canvas.overlay'), get('colors.border.muted'), get('breakpoints.0'), get('colors.border.muted'), get('colors.neutral.subtle'));
|
10
10
|
const StyledTab = styled.button.withConfig({
|
11
11
|
displayName: "SelectMenuTab__StyledTab",
|
12
12
|
componentId: "ga32sz-0"
|
@@ -18,7 +18,7 @@ interface SelectPanelBaseProps {
|
|
18
18
|
overlayProps?: Partial<OverlayProps>;
|
19
19
|
}
|
20
20
|
export declare type SelectPanelProps = SelectPanelBaseProps & Omit<FilteredActionListProps, 'selectionVariant'> & Pick<AnchoredOverlayProps, 'open'> & AnchoredOverlayWrapperAnchorProps & (SelectPanelSingleSelection | SelectPanelMultiSelection);
|
21
|
-
export declare function SelectPanel({ open, onOpenChange, renderAnchor, anchorRef: externalAnchorRef, placeholder, selected, onSelectedChange, filterValue: externalFilterValue, onFilterChange: externalOnFilterChange, items, textInputProps, overlayProps, ...listProps }: SelectPanelProps): JSX.Element;
|
21
|
+
export declare function SelectPanel({ open, onOpenChange, renderAnchor, anchorRef: externalAnchorRef, placeholder, selected, onSelectedChange, filterValue: externalFilterValue, onFilterChange: externalOnFilterChange, items, textInputProps, overlayProps, sx, ...listProps }: SelectPanelProps): JSX.Element;
|
22
22
|
export declare namespace SelectPanel {
|
23
23
|
var displayName: string;
|
24
24
|
}
|
@@ -4,7 +4,6 @@ import React, { useCallback, useMemo } from 'react';
|
|
4
4
|
import { FilteredActionList } from '../FilteredActionList';
|
5
5
|
import { DropdownButton } from '../DropdownMenu';
|
6
6
|
import { AnchoredOverlay } from '../AnchoredOverlay';
|
7
|
-
import Box from '../Box';
|
8
7
|
import { useProvidedStateOrCreate } from '../hooks/useProvidedStateOrCreate';
|
9
8
|
import { useProvidedRefOrCreate } from '../hooks';
|
10
9
|
|
@@ -29,6 +28,7 @@ export function SelectPanel({
|
|
29
28
|
items,
|
30
29
|
textInputProps,
|
31
30
|
overlayProps,
|
31
|
+
sx,
|
32
32
|
...listProps
|
33
33
|
}) {
|
34
34
|
const [filterValue, setInternalFilterValue] = useProvidedStateOrCreate(externalFilterValue, undefined, '');
|
@@ -106,11 +106,6 @@ export function SelectPanel({
|
|
106
106
|
overlayProps: overlayProps,
|
107
107
|
focusTrapSettings: focusTrapSettings,
|
108
108
|
focusZoneSettings: focusZoneSettings
|
109
|
-
}, /*#__PURE__*/React.createElement(Box, {
|
110
|
-
display: "flex",
|
111
|
-
flexDirection: "column",
|
112
|
-
width: "100%",
|
113
|
-
height: "100%"
|
114
109
|
}, /*#__PURE__*/React.createElement(FilteredActionList, _extends({
|
115
110
|
filterValue: filterValue,
|
116
111
|
onFilterChange: onFilterChange
|
@@ -119,8 +114,14 @@ export function SelectPanel({
|
|
119
114
|
items: itemsToRender,
|
120
115
|
selectionVariant: isMultiSelectVariant(selected) ? 'multiple' : 'single',
|
121
116
|
textInputProps: extendedTextInputProps,
|
122
|
-
inputRef: inputRef
|
123
|
-
|
117
|
+
inputRef: inputRef // inheriting height and maxHeight ensures that the FilteredActionList is never taller
|
118
|
+
// than the Overlay (which would break scrolling the items)
|
119
|
+
,
|
120
|
+
sx: { ...sx,
|
121
|
+
height: 'inherit',
|
122
|
+
maxHeight: 'inherit'
|
123
|
+
}
|
124
|
+
})));
|
124
125
|
}
|
125
126
|
SelectPanel.displayName = "SelectPanel";
|
126
127
|
SelectPanel.displayName = 'SelectPanel';
|
package/lib-esm/StateLabel.js
CHANGED
@@ -19,34 +19,28 @@ const colorVariants = variant({
|
|
19
19
|
prop: 'status',
|
20
20
|
variants: {
|
21
21
|
issueClosed: {
|
22
|
-
backgroundColor: '
|
23
|
-
color: '
|
24
|
-
borderColor: 'prState.closed.border'
|
22
|
+
backgroundColor: 'danger.emphasis',
|
23
|
+
color: 'fg.onEmphasis'
|
25
24
|
},
|
26
25
|
pullClosed: {
|
27
|
-
backgroundColor: '
|
28
|
-
color: '
|
29
|
-
borderColor: 'prState.closed.border'
|
26
|
+
backgroundColor: 'danger.emphasis',
|
27
|
+
color: 'fg.onEmphasis'
|
30
28
|
},
|
31
29
|
pullMerged: {
|
32
|
-
backgroundColor: '
|
33
|
-
color: '
|
34
|
-
borderColor: 'prState.merged.border'
|
30
|
+
backgroundColor: 'done.emphasis',
|
31
|
+
color: 'fg.onEmphasis'
|
35
32
|
},
|
36
33
|
issueOpened: {
|
37
|
-
backgroundColor: '
|
38
|
-
color: '
|
39
|
-
borderColor: 'prState.open.border'
|
34
|
+
backgroundColor: 'success.emphasis',
|
35
|
+
color: 'fg.onEmphasis'
|
40
36
|
},
|
41
37
|
pullOpened: {
|
42
|
-
backgroundColor: '
|
43
|
-
color: '
|
44
|
-
borderColor: 'prState.open.border'
|
38
|
+
backgroundColor: 'success.emphasis',
|
39
|
+
color: 'fg.onEmphasis'
|
45
40
|
},
|
46
41
|
draft: {
|
47
|
-
backgroundColor: '
|
48
|
-
color: '
|
49
|
-
borderColor: 'prState.draft.border'
|
42
|
+
backgroundColor: 'neutral.emphasis',
|
43
|
+
color: 'fg.onEmphasis'
|
50
44
|
}
|
51
45
|
}
|
52
46
|
});
|
@@ -68,7 +62,7 @@ const sizeVariants = variant({
|
|
68
62
|
const StateLabelBase = styled.span.withConfig({
|
69
63
|
displayName: "StateLabel__StateLabelBase",
|
70
64
|
componentId: "k4pd9e-0"
|
71
|
-
})(["display:inline-flex;align-items:center;font-weight:", ";line-height:16px;color:", ";text-align:center;border-radius:", ";
|
65
|
+
})(["display:inline-flex;align-items:center;font-weight:", ";line-height:16px;color:", ";text-align:center;border-radius:", ";", ";", ";", ";", ";"], get('fontWeights.bold'), get('colors.canvas.default'), get('radii.3'), colorVariants, sizeVariants, COMMON, sx);
|
72
66
|
|
73
67
|
function StateLabel({
|
74
68
|
children,
|
package/lib-esm/SubNav.js
CHANGED
@@ -47,7 +47,7 @@ const SubNavLink = styled.a.attrs(props => ({
|
|
47
47
|
})).withConfig({
|
48
48
|
displayName: "SubNav__SubNavLink",
|
49
49
|
componentId: "f7w0xa-1"
|
50
|
-
})(["padding-left:", ";padding-right:", ";font-weight:", ";font-size:", ";line-height:20px;min-height:34px;color:", ";text-align:center;text-decoration:none;border-top:1px solid ", ";border-bottom:1px solid ", ";border-right:1px solid ", ";display:flex;align-items:center;&:first-of-type{border-top-left-radius:", ";border-bottom-left-radius:", ";border-left:1px solid ", ";}&:last-of-type{border-top-right-radius:", ";border-bottom-right-radius:", ";}&:hover,&:focus{text-decoration:none;background-color:", ";transition:0.2s ease;.SubNav-octicon{color:", ";}}&.selected{color:", ";background-color:", ";border-color:", ";.SubNav-octicon{color:", ";}}", ";", ";"], get('space.3'), get('space.3'), get('fontWeights.semibold'), get('fontSizes.1'), get('colors.fg.default'), get('colors.border.default'), get('colors.border.default'), get('colors.border.default'), get('radii.2'), get('radii.2'), get('colors.border.default'), get('radii.2'), get('radii.2'), get('colors.canvas.subtle'), get('colors.fg.
|
50
|
+
})(["padding-left:", ";padding-right:", ";font-weight:", ";font-size:", ";line-height:20px;min-height:34px;color:", ";text-align:center;text-decoration:none;border-top:1px solid ", ";border-bottom:1px solid ", ";border-right:1px solid ", ";display:flex;align-items:center;&:first-of-type{border-top-left-radius:", ";border-bottom-left-radius:", ";border-left:1px solid ", ";}&:last-of-type{border-top-right-radius:", ";border-bottom-right-radius:", ";}&:hover,&:focus{text-decoration:none;background-color:", ";transition:0.2s ease;.SubNav-octicon{color:", ";}}&.selected{color:", ";background-color:", ";border-color:", ";.SubNav-octicon{color:", ";}}", ";", ";"], get('space.3'), get('space.3'), get('fontWeights.semibold'), get('fontSizes.1'), get('colors.fg.default'), get('colors.border.default'), get('colors.border.default'), get('colors.border.default'), get('radii.2'), get('radii.2'), get('colors.border.default'), get('radii.2'), get('radii.2'), get('colors.canvas.subtle'), get('colors.primer.fg.disabled'), get('colors.fg.onEmphasis'), get('colors.accent.emphasis'), get('colors.accent.emphasis'), get('colors.fg.onEmphasis'), COMMON, sx);
|
51
51
|
SubNavLink.displayName = 'SubNav.Link';
|
52
52
|
SubNavLinks.displayName = 'SubNav.Links';
|
53
53
|
export default Object.assign(SubNav, {
|
package/lib-esm/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-esm/TextInput.js
CHANGED
@@ -2,41 +2,8 @@ function _extends() { _extends = Object.assign || function (target) { for (var i
|
|
2
2
|
|
3
3
|
import classnames from 'classnames';
|
4
4
|
import React from 'react';
|
5
|
-
import
|
6
|
-
import
|
7
|
-
import { get } from './constants';
|
8
|
-
import sx from './sx';
|
9
|
-
const sizeVariants = variant({
|
10
|
-
variants: {
|
11
|
-
small: {
|
12
|
-
minHeight: '28px',
|
13
|
-
px: 2,
|
14
|
-
py: '3px',
|
15
|
-
fontSize: 0,
|
16
|
-
lineHeight: '20px'
|
17
|
-
},
|
18
|
-
large: {
|
19
|
-
px: 2,
|
20
|
-
py: '10px',
|
21
|
-
fontSize: 3
|
22
|
-
}
|
23
|
-
}
|
24
|
-
});
|
25
|
-
const Input = styled.input.withConfig({
|
26
|
-
displayName: "TextInput__Input",
|
27
|
-
componentId: "sc-1apmpmt-0"
|
28
|
-
})(["border:0;font-size:inherit;font-family:inherit;background-color:transparent;-webkit-appearance:none;color:inherit;width:100%;&:focus{outline:0;}"]);
|
29
|
-
const Wrapper = styled.span.withConfig({
|
30
|
-
displayName: "TextInput__Wrapper",
|
31
|
-
componentId: "sc-1apmpmt-1"
|
32
|
-
})(["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:", ";}", " ", " ", " ", " ", ";"], get('fontSizes.1'), get('colors.fg.default'), get('colors.border.default'), get('radii.2'), get('shadows.primer.shadow.inset'), props => {
|
33
|
-
if (props.hasIcon) {
|
34
|
-
return css(["padding:0;"]);
|
35
|
-
} else {
|
36
|
-
return css(["padding:6px 12px;"]);
|
37
|
-
}
|
38
|
-
}, get('colors.fg.muted'), get('space.2'), get('colors.accent.emphasis'), get('shadows.primer.shadow.focus'), props => props.contrast && css(["background-color:", ";"], get('colors.canvas.inset')), props => props.disabled && css(["color:", ";background-color:", ";border-color:", ";"], get('colors.fg.muted'), get('colors.input.disabledBg'), get('colors.border.default')), props => props.block && css(["display:block;width:100%;"]), get('breakpoints.1'), get('fontSizes.1'), width, minWidth, maxWidth, sizeVariants, sx); // Props that are not passed through to Input:
|
39
|
-
|
5
|
+
import UnstyledTextInput from './_UnstyledTextInput';
|
6
|
+
import TextInputWrapper from './_TextInputWrapper';
|
40
7
|
// using forwardRef is important so that other components (ex. SelectMenu) can autofocus the input
|
41
8
|
const TextInput = /*#__PURE__*/React.forwardRef(({
|
42
9
|
icon: IconComponent,
|
@@ -54,7 +21,7 @@ const TextInput = /*#__PURE__*/React.forwardRef(({
|
|
54
21
|
}, ref) => {
|
55
22
|
// this class is necessary to style FilterSearch, plz no touchy!
|
56
23
|
const wrapperClasses = classnames(className, 'TextInput-wrapper');
|
57
|
-
return /*#__PURE__*/React.createElement(
|
24
|
+
return /*#__PURE__*/React.createElement(TextInputWrapper, {
|
58
25
|
block: block,
|
59
26
|
className: wrapperClasses,
|
60
27
|
contrast: contrast,
|
@@ -68,7 +35,7 @@ const TextInput = /*#__PURE__*/React.forwardRef(({
|
|
68
35
|
variant: variantProp
|
69
36
|
}, IconComponent && /*#__PURE__*/React.createElement(IconComponent, {
|
70
37
|
className: "TextInput-icon"
|
71
|
-
}), /*#__PURE__*/React.createElement(
|
38
|
+
}), /*#__PURE__*/React.createElement(UnstyledTextInput, _extends({
|
72
39
|
ref: ref,
|
73
40
|
disabled: disabled
|
74
41
|
}, inputProps)));
|