@primer/styled-react 0.0.0-20251011023219 → 0.0.0-20251011030639
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/dist/components/Autocomplete.d.ts +4 -2
- package/dist/components/Autocomplete.d.ts.map +1 -1
- package/dist/components/Autocomplete.js +7 -1
- package/dist/components/PageHeader.d.ts.map +1 -1
- package/dist/components/Select.d.ts +8 -0
- package/dist/components/Select.d.ts.map +1 -0
- package/dist/components/Select.js +23 -0
- package/dist/components/TextInput.d.ts +3 -8
- package/dist/components/TextInput.d.ts.map +1 -1
- package/dist/components/TextInput.js +14 -15
- package/dist/components/Textarea.d.ts +9 -0
- package/dist/components/Textarea.d.ts.map +1 -0
- package/dist/components/Textarea.js +25 -0
- package/dist/components.json +2 -2
- package/dist/index.d.ts +4 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -3
- package/dist/sx.d.ts +0 -3
- package/dist/sx.d.ts.map +1 -1
- package/package.json +3 -3
- package/dist/components/Button.d.ts +0 -13
- package/dist/components/Button.d.ts.map +0 -1
- package/dist/components/Button.js +0 -110
- package/dist/components/IconButton.d.ts +0 -9
- package/dist/components/IconButton.d.ts.map +0 -1
- package/dist/components/IconButton.js +0 -38
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
import { Autocomplete as PrimerAutocomplete, type AutocompleteOverlayProps as PrimerAutocompleteOverlayProps, type SlotMarker } from '@primer/react';
|
|
1
|
+
import { Autocomplete as PrimerAutocomplete, type AutocompleteOverlayProps as PrimerAutocompleteOverlayProps, type AutocompleteInputProps as PrimerAutocompleteInputProps, type SlotMarker } from '@primer/react';
|
|
2
2
|
import { type SxProp } from '../sx';
|
|
3
3
|
import type { ComponentProps } from 'react';
|
|
4
4
|
export type AutocompleteOverlayProps = PrimerAutocompleteOverlayProps & SxProp;
|
|
5
5
|
declare const AutocompleteOverlay: React.ComponentType<AutocompleteOverlayProps> & SlotMarker;
|
|
6
|
+
export type AutocompleteInputProps = PrimerAutocompleteInputProps & SxProp;
|
|
7
|
+
declare const AutocompleteInput: React.ComponentType<AutocompleteInputProps>;
|
|
6
8
|
interface AutocompleteExport {
|
|
7
9
|
(props: ComponentProps<typeof PrimerAutocomplete>): React.ReactNode;
|
|
8
10
|
Context: typeof PrimerAutocomplete.Context;
|
|
9
|
-
Input: typeof
|
|
11
|
+
Input: typeof AutocompleteInput;
|
|
10
12
|
Menu: typeof PrimerAutocomplete.Menu;
|
|
11
13
|
Overlay: typeof AutocompleteOverlay;
|
|
12
14
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Autocomplete.d.ts","sourceRoot":"","sources":["../../src/components/Autocomplete.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,IAAI,kBAAkB,EAClC,KAAK,wBAAwB,IAAI,8BAA8B,EAC/D,KAAK,UAAU,EAChB,MAAM,eAAe,CAAA;AACtB,OAAO,EAAK,KAAK,MAAM,EAAC,MAAM,OAAO,CAAA;AAErC,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,OAAO,CAAA;AAEzC,MAAM,MAAM,wBAAwB,GAAG,8BAA8B,GAAG,MAAM,CAAA;AAE9E,QAAA,MAAM,mBAAmB,EAAE,KAAK,CAAC,aAAa,CAAC,wBAAwB,CAAC,GAAG,UAM1E,CAAA;AAED,UAAU,kBAAkB;IAC1B,CAAC,KAAK,EAAE,cAAc,CAAC,OAAO,kBAAkB,CAAC,GAAG,KAAK,CAAC,SAAS,CAAA;IACnE,OAAO,EAAE,OAAO,kBAAkB,CAAC,OAAO,CAAA;IAC1C,KAAK,EAAE,OAAO,
|
|
1
|
+
{"version":3,"file":"Autocomplete.d.ts","sourceRoot":"","sources":["../../src/components/Autocomplete.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,IAAI,kBAAkB,EAClC,KAAK,wBAAwB,IAAI,8BAA8B,EAC/D,KAAK,sBAAsB,IAAI,4BAA4B,EAC3D,KAAK,UAAU,EAChB,MAAM,eAAe,CAAA;AACtB,OAAO,EAAK,KAAK,MAAM,EAAC,MAAM,OAAO,CAAA;AAErC,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,OAAO,CAAA;AAEzC,MAAM,MAAM,wBAAwB,GAAG,8BAA8B,GAAG,MAAM,CAAA;AAE9E,QAAA,MAAM,mBAAmB,EAAE,KAAK,CAAC,aAAa,CAAC,wBAAwB,CAAC,GAAG,UAM1E,CAAA;AAED,MAAM,MAAM,sBAAsB,GAAG,4BAA4B,GAAG,MAAM,CAAA;AAE1E,QAAA,MAAM,iBAAiB,EAAE,KAAK,CAAC,aAAa,CAAC,sBAAsB,CAIlE,CAAA;AAED,UAAU,kBAAkB;IAC1B,CAAC,KAAK,EAAE,cAAc,CAAC,OAAO,kBAAkB,CAAC,GAAG,KAAK,CAAC,SAAS,CAAA;IACnE,OAAO,EAAE,OAAO,kBAAkB,CAAC,OAAO,CAAA;IAC1C,KAAK,EAAE,OAAO,iBAAiB,CAAA;IAC/B,IAAI,EAAE,OAAO,kBAAkB,CAAC,IAAI,CAAA;IACpC,OAAO,EAAE,OAAO,mBAAmB,CAAA;CACpC;AAED,QAAA,MAAM,YAAY,EAAE,kBAKlB,CAAA;AAIF,OAAO,EAAC,YAAY,EAAC,CAAA"}
|
|
@@ -7,9 +7,15 @@ const AutocompleteOverlay = styled(Autocomplete$1.Overlay).withConfig({
|
|
|
7
7
|
displayName: "Autocomplete__AutocompleteOverlay",
|
|
8
8
|
componentId: "sc-j8ax2e-0"
|
|
9
9
|
})(["", ""], sx);
|
|
10
|
+
const AutocompleteInput = styled(Autocomplete$1.Input).withConfig({
|
|
11
|
+
shouldForwardProp: prop => prop !== 'sx'
|
|
12
|
+
}).withConfig({
|
|
13
|
+
displayName: "Autocomplete__AutocompleteInput",
|
|
14
|
+
componentId: "sc-j8ax2e-1"
|
|
15
|
+
})(["", ""], sx);
|
|
10
16
|
const Autocomplete = Object.assign(Autocomplete$1, {
|
|
11
17
|
Context: Autocomplete$1.Context,
|
|
12
|
-
Input:
|
|
18
|
+
Input: AutocompleteInput,
|
|
13
19
|
Menu: Autocomplete$1.Menu,
|
|
14
20
|
Overlay: AutocompleteOverlay
|
|
15
21
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PageHeader.d.ts","sourceRoot":"","sources":["../../src/components/PageHeader.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,IAAI,gBAAgB,EAC9B,KAAK,eAAe,IAAI,qBAAqB,EAC7C,KAAK,oBAAoB,IAAI,0BAA0B,EACvD,KAAK,sBAAsB,IAAI,4BAA4B,EAC3D,KAAK,wBAAwB,IAAI,8BAA8B,EAChE,MAAM,eAAe,CAAA;AAEtB,OAAO,EAAK,KAAK,MAAM,
|
|
1
|
+
{"version":3,"file":"PageHeader.d.ts","sourceRoot":"","sources":["../../src/components/PageHeader.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,IAAI,gBAAgB,EAC9B,KAAK,eAAe,IAAI,qBAAqB,EAC7C,KAAK,oBAAoB,IAAI,0BAA0B,EACvD,KAAK,sBAAsB,IAAI,4BAA4B,EAC3D,KAAK,wBAAwB,IAAI,8BAA8B,EAChE,MAAM,eAAe,CAAA;AAEtB,OAAO,EAAK,KAAK,MAAM,EAAC,MAAM,OAAO,CAAA;AACrC,OAAO,KAAK,EAAC,mBAAmB,EAAC,MAAM,gBAAgB,CAAA;AAEvD,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,OAAO,CAAA;AAC5C,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,KAAK,eAAe,GAAG,qBAAqB,GAAG,MAAM,CAAA;AAcrD,KAAK,sBAAsB,GAAG,4BAA4B,GAAG,MAAM,CAAA;AAEnE,iBAAS,iBAAiB,CAAC,EAAC,EAAE,EAAE,GAAG,IAAI,EAAC,EAAE,sBAAsB,qBAY/D;AAED,KAAK,oBAAoB,GAAG,iBAAiB,CAAC,0BAA0B,CAAC,GAAG,MAAM,CAAA;AA4BlF,QAAA,MAAM,eAAe,GAAI,kBAAgB,oBAAoB,sBAE5D,CAAA;AAED,KAAK,wBAAwB,GAAG,iBAAiB,CAAC,8BAA8B,CAAC,GAAG,MAAM,CAAA;AAE1F,QAAA,MAAM,mBAAmB,EAAE,mBAAmB,CAAC,KAAK,EAAE,wBAAwB,CAM7E,CAAA;AAED,KAAK,uBAAuB,GAAG,mBAAmB,CAAC,KAAK,EAAE,eAAe,CAAC,GAAG;IAC3E,OAAO,EAAE,OAAO,iBAAiB,CAAA;IACjC,WAAW,EAAE,OAAO,gBAAgB,CAAC,WAAW,CAAA;IAChD,UAAU,EAAE,OAAO,gBAAgB,CAAC,UAAU,CAAA;IAC9C,UAAU,EAAE,OAAO,gBAAgB,CAAC,UAAU,CAAA;IAC9C,SAAS,EAAE,OAAO,mBAAmB,CAAA;IACrC,kBAAkB,EAAE,OAAO,gBAAgB,CAAC,kBAAkB,CAAA;IAC9D,aAAa,EAAE,OAAO,gBAAgB,CAAC,aAAa,CAAA;IACpD,WAAW,EAAE,OAAO,gBAAgB,CAAC,WAAW,CAAA;IAChD,aAAa,EAAE,OAAO,gBAAgB,CAAC,aAAa,CAAA;IACpD,KAAK,EAAE,OAAO,eAAe,CAAA;IAC7B,cAAc,EAAE,OAAO,gBAAgB,CAAC,cAAc,CAAA;IACtD,WAAW,EAAE,OAAO,gBAAgB,CAAC,WAAW,CAAA;IAChD,cAAc,EAAE,OAAO,gBAAgB,CAAC,cAAc,CAAA;CACvD,CAAA;AAED,QAAA,MAAM,UAAU,EAAE,uBAchB,CAAA;AAEF,OAAO,EAAC,UAAU,EAAC,CAAA;AACnB,YAAY,EAAC,eAAe,EAAE,sBAAsB,EAAE,oBAAoB,EAAC,CAAA"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type SelectProps as PrimerSelectProps } from '@primer/react';
|
|
2
|
+
import { type SxProp } from '../sx';
|
|
3
|
+
type SelectProps = PrimerSelectProps & SxProp & {
|
|
4
|
+
as?: React.ElementType;
|
|
5
|
+
};
|
|
6
|
+
declare const Select: ({ as, ...props }: SelectProps) => import("react").JSX.Element;
|
|
7
|
+
export { Select, type SelectProps };
|
|
8
|
+
//# sourceMappingURL=Select.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Select.d.ts","sourceRoot":"","sources":["../../src/components/Select.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAyB,KAAK,WAAW,IAAI,iBAAiB,EAAC,MAAM,eAAe,CAAA;AAC3F,OAAO,EAAK,KAAK,MAAM,EAAC,MAAM,OAAO,CAAA;AAIrC,KAAK,WAAW,GAAG,iBAAiB,GAAG,MAAM,GAAG;IAAC,EAAE,CAAC,EAAE,KAAK,CAAC,WAAW,CAAA;CAAC,CAAA;AAOxE,QAAA,MAAM,MAAM,GAAI,kBAAgB,WAAW,gCAE1C,CAAA;AAED,OAAO,EAAC,MAAM,EAAE,KAAK,WAAW,EAAC,CAAA"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Select as Select$1, sx } from '@primer/react';
|
|
2
|
+
import styled from 'styled-components';
|
|
3
|
+
import { jsx } from 'react/jsx-runtime';
|
|
4
|
+
|
|
5
|
+
const StyledSelect = styled(Select$1).withConfig({
|
|
6
|
+
shouldForwardProp: prop => prop !== 'sx'
|
|
7
|
+
}).withConfig({
|
|
8
|
+
displayName: "Select__StyledSelect",
|
|
9
|
+
componentId: "sc-1pyiuc8-0"
|
|
10
|
+
})(["", ""], sx);
|
|
11
|
+
const Select = ({
|
|
12
|
+
as,
|
|
13
|
+
...props
|
|
14
|
+
}) => {
|
|
15
|
+
return /*#__PURE__*/jsx(StyledSelect, {
|
|
16
|
+
...props,
|
|
17
|
+
...(as ? {
|
|
18
|
+
forwardedAs: as
|
|
19
|
+
} : {})
|
|
20
|
+
});
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export { Select };
|
|
@@ -1,17 +1,12 @@
|
|
|
1
1
|
import { type TextInputProps as PrimerTextInputProps, type TextInputActionProps as PrimerTextInputActionProps } from '@primer/react';
|
|
2
|
-
import type
|
|
2
|
+
import { type SxProp } from '../sx';
|
|
3
3
|
import type { ForwardRefExoticComponent, RefAttributes } from 'react';
|
|
4
|
+
import { type ForwardRefComponent } from '../polymorphic';
|
|
4
5
|
export type TextInputProps = PrimerTextInputProps & SxProp & {
|
|
5
6
|
as?: React.ElementType;
|
|
6
7
|
};
|
|
7
8
|
export type TextInputActionProps = PrimerTextInputActionProps & SxProp;
|
|
8
|
-
declare const TextInputAction:
|
|
9
|
-
children?: React.ReactNode;
|
|
10
|
-
"aria-label"?: string;
|
|
11
|
-
tooltipDirection?: "n" | "ne" | "e" | "se" | "s" | "sw" | "w" | "nw";
|
|
12
|
-
icon?: React.FunctionComponent<React.PropsWithChildren<import("@primer/octicons-react").IconProps>>;
|
|
13
|
-
variant?: import("@primer/react").ButtonProps["variant"];
|
|
14
|
-
} & SxProp & RefAttributes<HTMLButtonElement>>;
|
|
9
|
+
declare const TextInputAction: ForwardRefComponent<'button', TextInputActionProps>;
|
|
15
10
|
type TextInputComposite = ForwardRefExoticComponent<TextInputProps & RefAttributes<HTMLInputElement>> & {
|
|
16
11
|
Action: typeof TextInputAction;
|
|
17
12
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextInput.d.ts","sourceRoot":"","sources":["../../src/components/TextInput.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,cAAc,IAAI,oBAAoB,EAC3C,KAAK,oBAAoB,IAAI,0BAA0B,EACxD,MAAM,eAAe,CAAA;
|
|
1
|
+
{"version":3,"file":"TextInput.d.ts","sourceRoot":"","sources":["../../src/components/TextInput.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,cAAc,IAAI,oBAAoB,EAC3C,KAAK,oBAAoB,IAAI,0BAA0B,EACxD,MAAM,eAAe,CAAA;AAEtB,OAAO,EAAK,KAAK,MAAM,EAAC,MAAM,OAAO,CAAA;AACrC,OAAO,KAAK,EAAC,yBAAyB,EAAE,aAAa,EAAC,MAAM,OAAO,CAAA;AACnE,OAAO,EAAC,KAAK,mBAAmB,EAAC,MAAM,gBAAgB,CAAA;AAGvD,MAAM,MAAM,cAAc,GAAG,oBAAoB,GAAG,MAAM,GAAG;IAAC,EAAE,CAAC,EAAE,KAAK,CAAC,WAAW,CAAA;CAAC,CAAA;AACrF,MAAM,MAAM,oBAAoB,GAAG,0BAA0B,GAAG,MAAM,CAAA;AAYtE,QAAA,MAAM,eAAe,EAAE,mBAAmB,CAAC,QAAQ,EAAE,oBAAoB,CAIxE,CAAA;AAED,KAAK,kBAAkB,GAAG,yBAAyB,CAAC,cAAc,GAAG,aAAa,CAAC,gBAAgB,CAAC,CAAC,GAAG;IACtG,MAAM,EAAE,OAAO,eAAe,CAAA;CAC/B,CAAA;AAED,eAAO,MAAM,SAAS,EAAE,kBAEtB,CAAA"}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { TextInput as TextInput$1, sx } from '@primer/react';
|
|
2
2
|
import { forwardRef } from 'react';
|
|
3
|
+
import styled from 'styled-components';
|
|
3
4
|
import { jsx } from 'react/jsx-runtime';
|
|
4
5
|
|
|
5
|
-
const StyledTextInput =
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
});
|
|
6
|
+
const StyledTextInput = styled(TextInput$1).withConfig({
|
|
7
|
+
shouldForwardProp: prop => prop !== 'sx'
|
|
8
|
+
}).withConfig({
|
|
9
|
+
displayName: "TextInput__StyledTextInput",
|
|
10
|
+
componentId: "sc-ttxlvl-0"
|
|
11
|
+
})(["", ""], sx);
|
|
12
12
|
const TextInputImpl = /*#__PURE__*/forwardRef(({
|
|
13
13
|
as,
|
|
14
14
|
...props
|
|
@@ -21,13 +21,12 @@ const TextInputImpl = /*#__PURE__*/forwardRef(({
|
|
|
21
21
|
} : {})
|
|
22
22
|
});
|
|
23
23
|
});
|
|
24
|
-
const TextInputAction =
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
});
|
|
24
|
+
const TextInputAction = styled(TextInput$1.Action).withConfig({
|
|
25
|
+
shouldForwardProp: prop => prop !== 'sx'
|
|
26
|
+
}).withConfig({
|
|
27
|
+
displayName: "TextInput__TextInputAction",
|
|
28
|
+
componentId: "sc-ttxlvl-1"
|
|
29
|
+
})(["", ""], sx);
|
|
31
30
|
const TextInput = Object.assign(TextInputImpl, {
|
|
32
31
|
Action: TextInputAction
|
|
33
32
|
});
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type TextareaProps as PrimerTextareaProps } from '@primer/react';
|
|
2
|
+
import { type SxProp } from '../sx';
|
|
3
|
+
import type { ForwardRefComponent } from '../polymorphic';
|
|
4
|
+
type TextareaProps = PrimerTextareaProps & SxProp & {
|
|
5
|
+
as?: React.ElementType;
|
|
6
|
+
};
|
|
7
|
+
declare const Textarea: ForwardRefComponent<"textarea", TextareaProps>;
|
|
8
|
+
export { Textarea, type TextareaProps };
|
|
9
|
+
//# sourceMappingURL=Textarea.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Textarea.d.ts","sourceRoot":"","sources":["../../src/components/Textarea.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA6B,KAAK,aAAa,IAAI,mBAAmB,EAAC,MAAM,eAAe,CAAA;AAEnG,OAAO,EAAK,KAAK,MAAM,EAAC,MAAM,OAAO,CAAA;AACrC,OAAO,KAAK,EAAC,mBAAmB,EAAC,MAAM,gBAAgB,CAAA;AAGvD,KAAK,aAAa,GAAG,mBAAmB,GAAG,MAAM,GAAG;IAAC,EAAE,CAAC,EAAE,KAAK,CAAC,WAAW,CAAA;CAAC,CAAA;AAQ5E,QAAA,MAAM,QAAQ,EAER,mBAAmB,CAAC,UAAU,EAAE,aAAa,CAAC,CAAA;AAEpD,OAAO,EAAC,QAAQ,EAAE,KAAK,aAAa,EAAC,CAAA"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Textarea as Textarea$1, sx } from '@primer/react';
|
|
2
|
+
import styled from 'styled-components';
|
|
3
|
+
import { forwardRef } from 'react';
|
|
4
|
+
import { jsx } from 'react/jsx-runtime';
|
|
5
|
+
|
|
6
|
+
const StyledTextarea = styled(Textarea$1).withConfig({
|
|
7
|
+
shouldForwardProp: prop => prop !== 'sx'
|
|
8
|
+
}).withConfig({
|
|
9
|
+
displayName: "Textarea__StyledTextarea",
|
|
10
|
+
componentId: "sc-40d1gp-0"
|
|
11
|
+
})(["", ""], sx);
|
|
12
|
+
const Textarea = /*#__PURE__*/forwardRef(({
|
|
13
|
+
as,
|
|
14
|
+
...props
|
|
15
|
+
}, ref) => {
|
|
16
|
+
return /*#__PURE__*/jsx(StyledTextarea, {
|
|
17
|
+
...props,
|
|
18
|
+
...(as ? {
|
|
19
|
+
forwardedAs: as
|
|
20
|
+
} : {}),
|
|
21
|
+
ref: ref
|
|
22
|
+
});
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
export { Textarea };
|
package/dist/components.json
CHANGED
|
@@ -65,7 +65,6 @@
|
|
|
65
65
|
"BoxProps",
|
|
66
66
|
"BreadcrumbsItemProps",
|
|
67
67
|
"BreadcrumbsProps",
|
|
68
|
-
"ButtonProps",
|
|
69
68
|
"CheckboxGroupProps",
|
|
70
69
|
"CheckboxProps",
|
|
71
70
|
"CounterLabelProps",
|
|
@@ -74,7 +73,6 @@
|
|
|
74
73
|
"DialogProps",
|
|
75
74
|
"FormControlProps",
|
|
76
75
|
"HeaderProps",
|
|
77
|
-
"IconButtonProps",
|
|
78
76
|
"LabelProps",
|
|
79
77
|
"LinkButtonProps",
|
|
80
78
|
"LinkProps",
|
|
@@ -89,6 +87,7 @@
|
|
|
89
87
|
"SegmentedControlButtonProps",
|
|
90
88
|
"SegmentedControlIconButtonProps",
|
|
91
89
|
"SegmentedControlProps",
|
|
90
|
+
"SelectProps",
|
|
92
91
|
"SpinnerProps",
|
|
93
92
|
"StateLabelProps",
|
|
94
93
|
"SubNavLinkProps",
|
|
@@ -105,6 +104,7 @@
|
|
|
105
104
|
"TableTitleProps",
|
|
106
105
|
"TabNavLinkProps",
|
|
107
106
|
"TabNavProps",
|
|
107
|
+
"TextareaProps",
|
|
108
108
|
"TextInputActionProps",
|
|
109
109
|
"TextInputProps",
|
|
110
110
|
"TextProps",
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export { Box, type BoxProps } from './components/Box';
|
|
2
|
+
export { Button } from '@primer/react';
|
|
2
3
|
export { Details } from '@primer/react';
|
|
4
|
+
export { IconButton } from '@primer/react';
|
|
3
5
|
export { ProgressBar } from '@primer/react';
|
|
4
|
-
export { Select } from '@primer/react';
|
|
5
|
-
export { Textarea } from '@primer/react';
|
|
6
6
|
export { ThemeProvider, useTheme, useColorSchemeVar, BaseStyles } from './components/FeatureFlaggedTheming';
|
|
7
7
|
export { merge } from '@primer/react';
|
|
8
8
|
export { theme } from '@primer/react';
|
|
@@ -12,7 +12,6 @@ export { ActionMenu } from './components/ActionMenu';
|
|
|
12
12
|
export { Autocomplete, type AutocompleteOverlayProps } from './components/Autocomplete';
|
|
13
13
|
export { Avatar, type AvatarProps } from './components/Avatar';
|
|
14
14
|
export { Breadcrumbs, Breadcrumb, type BreadcrumbsProps, type BreadcrumbsItemProps } from './components/Breadcrumbs';
|
|
15
|
-
export { ButtonComponent as Button, type ButtonComponentProps as ButtonProps } from './components/Button';
|
|
16
15
|
export { Checkbox, type CheckboxProps } from './components/Checkbox';
|
|
17
16
|
export { CheckboxGroup, type CheckboxGroupProps } from './components/CheckboxGroup';
|
|
18
17
|
export { CircleBadge } from './components/CircleBadge';
|
|
@@ -22,7 +21,6 @@ export { Flash } from './components/Flash';
|
|
|
22
21
|
export { FormControl, type FormControlProps } from './components/FormControl';
|
|
23
22
|
export { Header, type HeaderProps } from './components/Header';
|
|
24
23
|
export { Heading } from './components/Heading';
|
|
25
|
-
export { IconButton, type IconButtonProps } from './components/IconButton';
|
|
26
24
|
export { Label, type LabelProps } from './components/Label';
|
|
27
25
|
export { Link, type LinkProps } from './components/Link';
|
|
28
26
|
export { LinkButton, type LinkButtonProps } from './components/LinkButton';
|
|
@@ -33,10 +31,12 @@ export { PageHeader, type PageHeaderProps, type PageHeaderActionsProps, type Pag
|
|
|
33
31
|
export { RadioGroup, type RadioGroupProps } from './components/RadioGroup';
|
|
34
32
|
export { RelativeTime, type RelativeTimeProps } from './components/RelativeTime';
|
|
35
33
|
export { SegmentedControl, type SegmentedControlProps, type SegmentedControlButtonProps, type SegmentedControlIconButtonProps, } from './components/SegmentedControl';
|
|
34
|
+
export { Select, type SelectProps } from './components/Select';
|
|
36
35
|
export { Spinner, type SpinnerProps } from './components/Spinner';
|
|
37
36
|
export { StateLabel, type StateLabelProps } from './components/StateLabel';
|
|
38
37
|
export { SubNav, type SubNavProps, type SubNavLinkProps } from './components/SubNav';
|
|
39
38
|
export { Text, type TextProps } from './components/Text';
|
|
39
|
+
export { Textarea, type TextareaProps } from './components/Textarea';
|
|
40
40
|
export { TextInput, type TextInputProps, type TextInputActionProps } from './components/TextInput';
|
|
41
41
|
export { Timeline, type TimelineProps, type TimelineItemProps, type TimelineBadgeProps, type TimelineBodyProps, type TimelineBreakProps, } from './components/Timeline';
|
|
42
42
|
export { ToggleSwitch, type ToggleSwitchProps } from './components/ToggleSwitch';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAC,GAAG,EAAE,KAAK,QAAQ,EAAC,MAAM,kBAAkB,CAAA;AACnD,OAAO,EAAC,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":"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"}
|
package/dist/index.js
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
export { Box,
|
|
2
|
+
export { Box, Button, Details, IconButton, ProgressBar, merge, sx, theme, themeGet } from '@primer/react';
|
|
3
3
|
export { BaseStyles, ThemeProvider, useColorSchemeVar, useTheme } from './components/FeatureFlaggedTheming.js';
|
|
4
4
|
export { ActionList } from './components/ActionList.js';
|
|
5
5
|
export { ActionMenu } from './components/ActionMenu.js';
|
|
6
6
|
export { Autocomplete } from './components/Autocomplete.js';
|
|
7
7
|
export { Avatar } from './components/Avatar.js';
|
|
8
8
|
export { Breadcrumb, Breadcrumbs } from './components/Breadcrumbs.js';
|
|
9
|
-
export { ButtonComponent as Button } from './components/Button.js';
|
|
10
9
|
export { Checkbox } from './components/Checkbox.js';
|
|
11
10
|
export { CheckboxGroup } from './components/CheckboxGroup.js';
|
|
12
11
|
export { CircleBadge } from './components/CircleBadge.js';
|
|
@@ -16,7 +15,6 @@ export { Flash } from './components/Flash.js';
|
|
|
16
15
|
export { FormControl } from './components/FormControl.js';
|
|
17
16
|
export { Header } from './components/Header.js';
|
|
18
17
|
export { Heading } from './components/Heading.js';
|
|
19
|
-
export { IconButton } from './components/IconButton.js';
|
|
20
18
|
export { Label } from './components/Label.js';
|
|
21
19
|
export { Link } from './components/Link.js';
|
|
22
20
|
export { LinkButton } from './components/LinkButton.js';
|
|
@@ -27,10 +25,12 @@ export { PageHeader } from './components/PageHeader.js';
|
|
|
27
25
|
export { RadioGroup } from './components/RadioGroup.js';
|
|
28
26
|
export { RelativeTime } from './components/RelativeTime.js';
|
|
29
27
|
export { SegmentedControl } from './components/SegmentedControl.js';
|
|
28
|
+
export { Select } from './components/Select.js';
|
|
30
29
|
export { Spinner } from './components/Spinner.js';
|
|
31
30
|
export { StateLabel } from './components/StateLabel.js';
|
|
32
31
|
export { SubNav } from './components/SubNav.js';
|
|
33
32
|
export { Text } from './components/Text.js';
|
|
33
|
+
export { Textarea } from './components/Textarea.js';
|
|
34
34
|
export { TextInput } from './components/TextInput.js';
|
|
35
35
|
export { Timeline } from './components/Timeline.js';
|
|
36
36
|
export { ToggleSwitch } from './components/ToggleSwitch.js';
|
package/dist/sx.d.ts
CHANGED
package/dist/sx.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sx.d.ts","sourceRoot":"","sources":["../src/sx.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,EAAE,EAAE,KAAK,MAAM,EAAC,MAAM,eAAe,CAAA
|
|
1
|
+
{"version":3,"file":"sx.d.ts","sourceRoot":"","sources":["../src/sx.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,EAAE,EAAE,KAAK,MAAM,EAAC,MAAM,eAAe,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@primer/styled-react",
|
|
3
|
-
"version": "0.0.0-
|
|
3
|
+
"version": "0.0.0-20251011030639",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": {
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"@babel/preset-react": "^7.27.1",
|
|
32
32
|
"@babel/preset-typescript": "^7.27.1",
|
|
33
|
-
"@primer/react": "0.0.0-
|
|
33
|
+
"@primer/react": "0.0.0-20251011030639",
|
|
34
34
|
"@rollup/plugin-babel": "^6.0.4",
|
|
35
35
|
"@types/react": "18.3.11",
|
|
36
36
|
"@types/react-dom": "18.3.1",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"typescript": "^5.9.2"
|
|
47
47
|
},
|
|
48
48
|
"peerDependencies": {
|
|
49
|
-
"@primer/react": "0.0.0-
|
|
49
|
+
"@primer/react": "0.0.0-20251011030639",
|
|
50
50
|
"@types/react": "18.x || 19.x",
|
|
51
51
|
"@types/react-dom": "18.x || 19.x",
|
|
52
52
|
"@types/react-is": "18.x || 19.x",
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { type ButtonProps as PrimerButtonProps } from '@primer/react';
|
|
2
|
-
import type { SxProp } from '../sx';
|
|
3
|
-
import type { BetterSystemStyleObject } from '../styled-props';
|
|
4
|
-
import type { ForwardRefComponent } from '../polymorphic';
|
|
5
|
-
type ButtonComponentProps = PrimerButtonProps & SxProp & {
|
|
6
|
-
as?: React.ElementType;
|
|
7
|
-
};
|
|
8
|
-
declare const ButtonComponent: ForwardRefComponent<"button", ButtonComponentProps>;
|
|
9
|
-
export declare function generateCustomSxProp(props: Partial<Pick<PrimerButtonProps, 'size' | 'block' | 'leadingVisual' | 'trailingVisual' | 'trailingAction'>>, providedSx: BetterSystemStyleObject): {
|
|
10
|
-
[key: string]: BetterSystemStyleObject;
|
|
11
|
-
};
|
|
12
|
-
export { ButtonComponent, type ButtonComponentProps };
|
|
13
|
-
//# sourceMappingURL=Button.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../src/components/Button.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAyB,KAAK,WAAW,IAAI,iBAAiB,EAAC,MAAM,eAAe,CAAA;AAC3F,OAAO,KAAK,EAAC,MAAM,EAAsB,MAAM,OAAO,CAAA;AACtD,OAAO,KAAK,EAAC,uBAAuB,EAAC,MAAM,iBAAiB,CAAA;AAE5D,OAAO,KAAK,EAAC,mBAAmB,EAAC,MAAM,gBAAgB,CAAA;AAIvD,KAAK,oBAAoB,GAAG,iBAAiB,GAAG,MAAM,GAAG;IAAC,EAAE,CAAC,EAAE,KAAK,CAAC,WAAW,CAAA;CAAC,CAAA;AAQjF,QAAA,MAAM,eAAe,EAgBf,mBAAmB,CAAC,QAAQ,EAAE,oBAAoB,CAAC,CAAA;AA0CzD,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,OAAO,CAAC,IAAI,CAAC,iBAAiB,EAAE,MAAM,GAAG,OAAO,GAAG,eAAe,GAAG,gBAAgB,GAAG,gBAAgB,CAAC,CAAC,EACjH,UAAU,EAAE,uBAAuB;;EAmBpC;AAID,OAAO,EAAC,eAAe,EAAE,KAAK,oBAAoB,EAAC,CAAA"}
|
|
@@ -1,110 +0,0 @@
|
|
|
1
|
-
import { Button, sx } from '@primer/react';
|
|
2
|
-
import { forwardRef } from 'react';
|
|
3
|
-
import styled from 'styled-components';
|
|
4
|
-
import { jsx } from 'react/jsx-runtime';
|
|
5
|
-
|
|
6
|
-
const StyledButtonComponent = styled(Button).withConfig({
|
|
7
|
-
shouldForwardProp: prop => prop !== 'sx'
|
|
8
|
-
}).withConfig({
|
|
9
|
-
displayName: "Button__StyledButtonComponent",
|
|
10
|
-
componentId: "sc-vqy3e4-0"
|
|
11
|
-
})(["", ""], sx);
|
|
12
|
-
const ButtonComponent = /*#__PURE__*/forwardRef(({
|
|
13
|
-
as,
|
|
14
|
-
sx,
|
|
15
|
-
style: propStyle,
|
|
16
|
-
...props
|
|
17
|
-
}, ref) => {
|
|
18
|
-
const {
|
|
19
|
-
block,
|
|
20
|
-
size = 'medium',
|
|
21
|
-
leadingVisual,
|
|
22
|
-
trailingVisual,
|
|
23
|
-
trailingAction
|
|
24
|
-
} = props;
|
|
25
|
-
let sxStyles = {};
|
|
26
|
-
const style = {
|
|
27
|
-
...(propStyle || {})
|
|
28
|
-
};
|
|
29
|
-
if (sx !== null && Object.keys(sx || {}).length > 0) {
|
|
30
|
-
sxStyles = generateCustomSxProp({
|
|
31
|
-
block,
|
|
32
|
-
size,
|
|
33
|
-
leadingVisual,
|
|
34
|
-
trailingVisual,
|
|
35
|
-
trailingAction
|
|
36
|
-
}, sx);
|
|
37
|
-
const {
|
|
38
|
-
color
|
|
39
|
-
} = sx;
|
|
40
|
-
if (color) style['--button-color'] = color;
|
|
41
|
-
}
|
|
42
|
-
return /*#__PURE__*/jsx(StyledButtonComponent, {
|
|
43
|
-
style: style,
|
|
44
|
-
sx: sxStyles,
|
|
45
|
-
ref: ref,
|
|
46
|
-
...props,
|
|
47
|
-
...(as ? {
|
|
48
|
-
forwardedAs: as
|
|
49
|
-
} : {})
|
|
50
|
-
});
|
|
51
|
-
});
|
|
52
|
-
|
|
53
|
-
// This function is used to generate a custom cssSelector for the sxProp
|
|
54
|
-
|
|
55
|
-
// The usual sx prop can like this:
|
|
56
|
-
// sx={{
|
|
57
|
-
// [`@media (max-width: 768px)`]: {
|
|
58
|
-
// '& > ul': {
|
|
59
|
-
// backgroundColor: 'deeppink',
|
|
60
|
-
// },
|
|
61
|
-
// '&:hover': {
|
|
62
|
-
// backgroundColor: 'yellow',
|
|
63
|
-
// },
|
|
64
|
-
// },
|
|
65
|
-
// '&:hover': {
|
|
66
|
-
// backgroundColor: 'yellow',
|
|
67
|
-
// },
|
|
68
|
-
// '&': {
|
|
69
|
-
// width : 320px
|
|
70
|
-
// }
|
|
71
|
-
// }}
|
|
72
|
-
//*
|
|
73
|
-
/* What we want for Button styles is this:
|
|
74
|
-
sx={{
|
|
75
|
-
// [`@media (max-width: 768px)`]: {
|
|
76
|
-
// '&[data-attribute="something"] > ul': {
|
|
77
|
-
// backgroundColor: 'deeppink',
|
|
78
|
-
// },
|
|
79
|
-
// '&[data-attribute="something"]:hover': {
|
|
80
|
-
// backgroundColor: 'yellow',
|
|
81
|
-
// },
|
|
82
|
-
// },
|
|
83
|
-
// '&[data-attribute="something"]:hover': {
|
|
84
|
-
// backgroundColor: 'yellow',
|
|
85
|
-
// },
|
|
86
|
-
// '&[data-attribute="something"]': {
|
|
87
|
-
// width : 320px
|
|
88
|
-
// }
|
|
89
|
-
// }}
|
|
90
|
-
|
|
91
|
-
// We need to make sure we append the customCSSSelector to the original class selector. i.e & - > &[data-attribute="Icon"][data-size="small"]
|
|
92
|
-
*/
|
|
93
|
-
function generateCustomSxProp(props, providedSx) {
|
|
94
|
-
// Possible data attributes: data-size, data-block, data-no-visuals
|
|
95
|
-
const size = `[data-size="${props.size}"]`;
|
|
96
|
-
const block = props.block ? `[data-block="block"]` : '';
|
|
97
|
-
const noVisuals = props.leadingVisual || props.trailingVisual || props.trailingAction ? '' : '[data-no-visuals]';
|
|
98
|
-
|
|
99
|
-
// this is a custom selector. We need to make sure we add the data attributes to the base css class (& -> &[data-attributename="value"]])
|
|
100
|
-
const cssSelector = `&${size}${block}${noVisuals}`; // &[data-size="small"][data-block="block"][data-no-visuals]
|
|
101
|
-
|
|
102
|
-
const customSxProp = {};
|
|
103
|
-
if (!providedSx) return customSxProp;else {
|
|
104
|
-
customSxProp[cssSelector] = providedSx;
|
|
105
|
-
return customSxProp;
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
ButtonComponent.displayName = 'Button';
|
|
109
|
-
|
|
110
|
-
export { ButtonComponent, generateCustomSxProp };
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { type IconButtonProps as PrimerIconButtonProps, type SxProp } from '@primer/react';
|
|
2
|
-
import { type ForwardRefComponent } from '../polymorphic';
|
|
3
|
-
type IconButtonProps = PrimerIconButtonProps & SxProp & {
|
|
4
|
-
as?: React.ElementType;
|
|
5
|
-
};
|
|
6
|
-
declare const IconButton: ForwardRefComponent<"a" | "button", IconButtonProps>;
|
|
7
|
-
export { IconButton };
|
|
8
|
-
export type { IconButtonProps };
|
|
9
|
-
//# sourceMappingURL=IconButton.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"IconButton.d.ts","sourceRoot":"","sources":["../../src/components/IconButton.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAiC,KAAK,eAAe,IAAI,qBAAqB,EAAE,KAAK,MAAM,EAAC,MAAM,eAAe,CAAA;AACxH,OAAO,EAAC,KAAK,mBAAmB,EAAC,MAAM,gBAAgB,CAAA;AAMvD,KAAK,eAAe,GAAG,qBAAqB,GAAG,MAAM,GAAG;IAAC,EAAE,CAAC,EAAE,KAAK,CAAC,WAAW,CAAA;CAAC,CAAA;AAQhF,QAAA,MAAM,UAAU,EAUV,mBAAmB,CAAC,GAAG,GAAG,QAAQ,EAAE,eAAe,CAAC,CAAA;AAE1D,OAAO,EAAC,UAAU,EAAC,CAAA;AACnB,YAAY,EAAC,eAAe,EAAC,CAAA"}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { IconButton as IconButton$1, sx } from '@primer/react';
|
|
2
|
-
import { generateCustomSxProp } from './Button.js';
|
|
3
|
-
import { forwardRef } from 'react';
|
|
4
|
-
import styled from 'styled-components';
|
|
5
|
-
import { jsx } from 'react/jsx-runtime';
|
|
6
|
-
|
|
7
|
-
const StyledIconButton = styled(IconButton$1).withConfig({
|
|
8
|
-
shouldForwardProp: prop => prop !== 'sx'
|
|
9
|
-
}).withConfig({
|
|
10
|
-
displayName: "IconButton__StyledIconButton",
|
|
11
|
-
componentId: "sc-i53dt6-0"
|
|
12
|
-
})(["", ""], sx);
|
|
13
|
-
const IconButton = /*#__PURE__*/forwardRef(({
|
|
14
|
-
as,
|
|
15
|
-
sx,
|
|
16
|
-
...props
|
|
17
|
-
}, ref) => {
|
|
18
|
-
let sxStyles = sx;
|
|
19
|
-
// grap the button props that have associated data attributes in the styles
|
|
20
|
-
const {
|
|
21
|
-
size = 'medium'
|
|
22
|
-
} = props;
|
|
23
|
-
if (sx !== null && sx !== undefined && Object.keys(sx).length > 0) {
|
|
24
|
-
sxStyles = generateCustomSxProp({
|
|
25
|
-
size
|
|
26
|
-
}, sx);
|
|
27
|
-
}
|
|
28
|
-
return /*#__PURE__*/jsx(StyledIconButton, {
|
|
29
|
-
sx: sxStyles,
|
|
30
|
-
...props,
|
|
31
|
-
...(as ? {
|
|
32
|
-
forwardedAs: as
|
|
33
|
-
} : {}),
|
|
34
|
-
ref: ref
|
|
35
|
-
});
|
|
36
|
-
});
|
|
37
|
-
|
|
38
|
-
export { IconButton };
|