@primer/components 0.0.0-202111194229 → 0.0.0-202111215914
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 +5 -1
- package/dist/browser.esm.js +147 -165
- package/dist/browser.esm.js.map +1 -1
- package/dist/browser.umd.js +154 -172
- package/dist/browser.umd.js.map +1 -1
- package/lib/ActionList2/Divider.d.ts +3 -2
- package/lib/ActionList2/Divider.js +10 -5
- package/lib/ActionList2/Item.js +21 -5
- package/lib/ActionList2/List.js +11 -1
- package/lib/ActionList2/MenuContext.d.ts +10 -0
- package/lib/ActionList2/MenuContext.js +15 -0
- package/lib/ActionList2/Selection.js +11 -0
- package/lib/ActionList2/index.d.ts +1 -2
- package/lib/ActionMenu2.d.ts +310 -0
- package/lib/ActionMenu2.js +91 -0
- package/lib/Autocomplete/Autocomplete.d.ts +2 -10
- package/lib/Autocomplete/AutocompleteInput.d.ts +2 -10
- package/lib/Checkbox.d.ts +1 -1
- package/lib/SelectMenu/SelectMenu.d.ts +2 -10
- package/lib/TextInput.d.ts +1 -8
- package/lib/TextInput.js +5 -16
- package/lib/TextInputWithTokens.d.ts +2 -10
- package/lib/_TextInputWrapper.d.ts +0 -3
- package/lib/_TextInputWrapper.js +7 -18
- package/lib/drafts.d.ts +1 -0
- package/lib/drafts.js +13 -0
- package/lib-esm/ActionList2/Divider.d.ts +3 -2
- package/lib-esm/ActionList2/Divider.js +8 -5
- package/lib-esm/ActionList2/Item.js +19 -5
- package/lib-esm/ActionList2/List.js +9 -1
- package/lib-esm/ActionList2/MenuContext.d.ts +10 -0
- package/lib-esm/ActionList2/MenuContext.js +3 -0
- package/lib-esm/ActionList2/Selection.js +9 -0
- package/lib-esm/ActionList2/index.d.ts +1 -2
- package/lib-esm/ActionMenu2.d.ts +310 -0
- package/lib-esm/ActionMenu2.js +67 -0
- package/lib-esm/Autocomplete/Autocomplete.d.ts +2 -10
- package/lib-esm/Autocomplete/AutocompleteInput.d.ts +2 -10
- package/lib-esm/Checkbox.d.ts +1 -1
- package/lib-esm/SelectMenu/SelectMenu.d.ts +2 -10
- package/lib-esm/TextInput.d.ts +1 -8
- package/lib-esm/TextInput.js +5 -16
- package/lib-esm/TextInputWithTokens.d.ts +2 -10
- package/lib-esm/_TextInputWrapper.d.ts +0 -3
- package/lib-esm/_TextInputWrapper.js +7 -18
- package/lib-esm/drafts.d.ts +1 -0
- package/lib-esm/drafts.js +2 -1
- package/package.json +1 -1
@@ -5,9 +5,6 @@ declare const TextInputWrapper: import("styled-components").StyledComponent<"spa
|
|
5
5
|
hasIcon?: boolean | undefined;
|
6
6
|
block?: boolean | undefined;
|
7
7
|
contrast?: boolean | undefined;
|
8
|
-
validationStatus?: "error" | "warning" | undefined;
|
9
|
-
/** @deprecated Use `size` prop instead */
|
10
8
|
variant?: "small" | "large" | undefined;
|
11
|
-
size?: "small" | "large" | undefined;
|
12
9
|
} & 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>;
|
13
10
|
export default TextInputWrapper;
|
@@ -2,24 +2,7 @@ import styled, { css } from 'styled-components';
|
|
2
2
|
import { maxWidth, minWidth, variant, width } from 'styled-system';
|
3
3
|
import { get } from './constants';
|
4
4
|
import sx from './sx';
|
5
|
-
const sizeDeprecatedVariants = variant({
|
6
|
-
variants: {
|
7
|
-
small: {
|
8
|
-
minHeight: '28px',
|
9
|
-
px: 2,
|
10
|
-
py: '3px',
|
11
|
-
fontSize: 0,
|
12
|
-
lineHeight: '20px'
|
13
|
-
},
|
14
|
-
large: {
|
15
|
-
px: 2,
|
16
|
-
py: '10px',
|
17
|
-
fontSize: 3
|
18
|
-
}
|
19
|
-
}
|
20
|
-
});
|
21
5
|
const sizeVariants = variant({
|
22
|
-
prop: 'size',
|
23
6
|
variants: {
|
24
7
|
small: {
|
25
8
|
minHeight: '28px',
|
@@ -38,5 +21,11 @@ const sizeVariants = variant({
|
|
38
21
|
const TextInputWrapper = styled.span.withConfig({
|
39
22
|
displayName: "_TextInputWrapper__TextInputWrapper",
|
40
23
|
componentId: "sc-5vfcis-0"
|
41
|
-
})(["
|
24
|
+
})(["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:", ";cursor:text;", " .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 => {
|
25
|
+
if (props.hasIcon) {
|
26
|
+
return css(["padding:0;"]);
|
27
|
+
} else {
|
28
|
+
return css(["padding:6px 12px;"]);
|
29
|
+
}
|
30
|
+
}, 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.primer.fg.disabled'), get('colors.input.disabledBg'), get('colors.border.default')), props => props.block && css(["display:block;width:100%;"]), props => props.block && props.hasIcon && css(["display:flex;"]), get('breakpoints.1'), get('fontSizes.1'), width, minWidth, maxWidth, sizeVariants, sx);
|
42
31
|
export default TextInputWrapper;
|
package/lib-esm/drafts.d.ts
CHANGED
package/lib-esm/drafts.js
CHANGED