@primer/styled-react 0.0.0-20251006192403 → 0.0.0-20251006201210

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.
@@ -1,15 +1,20 @@
1
- import { TextInput as PrimerTextInput, type TextInputActionProps as PrimerTextInputActionProps, type TextInputProps } from '@primer/react';
1
+ import { type TextInputProps as PrimerTextInputProps, type TextInputActionProps as PrimerTextInputActionProps } from '@primer/react';
2
2
  import type { SxProp } from '../sx';
3
+ import type { ForwardRefExoticComponent, RefAttributes } from 'react';
4
+ export type TextInputProps = PrimerTextInputProps & SxProp & {
5
+ as?: React.ElementType;
6
+ };
3
7
  export type TextInputActionProps = PrimerTextInputActionProps & SxProp;
4
- declare const TextInputAction: import("react").ForwardRefExoticComponent<Omit<import("react").ButtonHTMLAttributes<HTMLButtonElement>, "aria-label" | "size" | "tooltipDirection"> & {
8
+ declare const TextInputAction: ForwardRefExoticComponent<Omit<import("react").ButtonHTMLAttributes<HTMLButtonElement>, "size" | "aria-label" | "tooltipDirection"> & {
5
9
  children?: React.ReactNode;
6
10
  "aria-label"?: string;
7
11
  tooltipDirection?: "n" | "ne" | "e" | "se" | "s" | "sw" | "w" | "nw";
8
12
  icon?: React.FunctionComponent<React.PropsWithChildren<import("@primer/octicons-react").IconProps>>;
9
13
  variant?: import("@primer/react").ButtonProps["variant"];
10
- } & SxProp & import("react").RefAttributes<HTMLButtonElement>>;
11
- declare const TextInput: typeof PrimerTextInput & {
14
+ } & SxProp & RefAttributes<HTMLButtonElement>>;
15
+ type TextInputComposite = ForwardRefExoticComponent<TextInputProps & RefAttributes<HTMLInputElement>> & {
12
16
  Action: typeof TextInputAction;
13
17
  };
14
- export { TextInput, type TextInputProps };
18
+ export declare const TextInput: TextInputComposite;
19
+ export {};
15
20
  //# sourceMappingURL=TextInput.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"TextInput.d.ts","sourceRoot":"","sources":["../../src/components/TextInput.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,IAAI,eAAe,EAC5B,KAAK,oBAAoB,IAAI,0BAA0B,EACvD,KAAK,cAAc,EACpB,MAAM,eAAe,CAAA;AAGtB,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,OAAO,CAAA;AAEjC,MAAM,MAAM,oBAAoB,GAAG,0BAA0B,GAAG,MAAM,CAAA;AAEtE,QAAA,MAAM,eAAe;;;;;;8DAEnB,CAAA;AAEF,QAAA,MAAM,SAAS,EAAE,OAAO,eAAe,GAAG;IAAC,MAAM,EAAE,OAAO,eAAe,CAAA;CAEvE,CAAA;AAIF,OAAO,EAAC,SAAS,EAAE,KAAK,cAAc,EAAC,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;AAGtB,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,OAAO,CAAA;AACjC,OAAO,KAAK,EAAC,yBAAyB,EAAE,aAAa,EAAC,MAAM,OAAO,CAAA;AAEnE,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;AAUtE,QAAA,MAAM,eAAe;;;;;;8CAEnB,CAAA;AAEF,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"}
package/dist/index.js CHANGED
@@ -532,6 +532,25 @@ const Text = /*#__PURE__*/forwardRef(({
532
532
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
533
533
  });
534
534
 
535
+ const StyledTextInput = /*#__PURE__*/forwardRef((props, ref) => {
536
+ return /*#__PURE__*/jsx(Box, {
537
+ as: TextInput$1,
538
+ ref: ref,
539
+ ...props
540
+ });
541
+ });
542
+ const TextInputImpl = /*#__PURE__*/forwardRef(({
543
+ as,
544
+ ...props
545
+ }, ref) => {
546
+ return /*#__PURE__*/jsx(StyledTextInput, {
547
+ ref: ref,
548
+ ...props,
549
+ ...(as ? {
550
+ forwardedAs: as
551
+ } : {})
552
+ });
553
+ });
535
554
  const TextInputAction = /*#__PURE__*/forwardRef((props, ref) => {
536
555
  return /*#__PURE__*/jsx(Box, {
537
556
  as: TextInput$1.Action,
@@ -539,11 +558,11 @@ const TextInputAction = /*#__PURE__*/forwardRef((props, ref) => {
539
558
  ...props
540
559
  });
541
560
  });
542
- const TextInput = Object.assign(TextInput$1, {
561
+ const TextInput = Object.assign(TextInputImpl, {
543
562
  Action: TextInputAction
544
563
  });
545
- TextInput.displayName = 'TextInput';
546
- TextInputAction.displayName = 'TextInput.Action';
564
+ TextInputAction.displayName = 'TextInputAction';
565
+ TextInputImpl.displayName = 'TextInput';
547
566
 
548
567
  const TimelineImpl = /*#__PURE__*/forwardRef(function Timeline(props, ref) {
549
568
  return /*#__PURE__*/jsx(Box, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@primer/styled-react",
3
- "version": "0.0.0-20251006192403",
3
+ "version": "0.0.0-20251006201210",
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-20251006192403",
33
+ "@primer/react": "0.0.0-20251006201210",
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-20251006192403",
49
+ "@primer/react": "0.0.0-20251006201210",
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",