@telegraph/input 0.1.6 → 0.2.0
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 +24 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.mjs.map +1 -1
- package/dist/types/Input/Input.d.ts +11 -6
- package/dist/types/Input/Input.d.ts.map +1 -1
- package/dist/types/Input/index.d.ts +1 -0
- package/dist/types/Input/index.d.ts.map +1 -1
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.d.ts.map +1 -1
- package/package.json +9 -9
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,29 @@
|
|
|
1
1
|
# @telegraph/input
|
|
2
2
|
|
|
3
|
+
## 0.2.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#688](https://github.com/knocklabs/telegraph/pull/688) [`8d55540`](https://github.com/knocklabs/telegraph/commit/8d5554005bea4695560efbee9ea4333ccddfc1bf) Thanks [@kylemcd](https://github.com/kylemcd)! - fix: invalid props on components would not throw type errors
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- Updated dependencies [[`8d55540`](https://github.com/knocklabs/telegraph/commit/8d5554005bea4695560efbee9ea4333ccddfc1bf)]:
|
|
12
|
+
- @telegraph/typography@0.2.0
|
|
13
|
+
- @telegraph/layout@0.4.0
|
|
14
|
+
|
|
15
|
+
## 0.1.7
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- [#653](https://github.com/knocklabs/telegraph/pull/653) [`d6c6aa9`](https://github.com/knocklabs/telegraph/commit/d6c6aa9cb0e11ba96df7d7efd479c8e4652fc029) Thanks [@dependabot](https://github.com/apps/dependabot)! - chore(deps): bump react and @types/react
|
|
20
|
+
|
|
21
|
+
- Updated dependencies [[`d6c6aa9`](https://github.com/knocklabs/telegraph/commit/d6c6aa9cb0e11ba96df7d7efd479c8e4652fc029)]:
|
|
22
|
+
- @telegraph/compose-refs@0.0.8
|
|
23
|
+
- @telegraph/typography@0.1.29
|
|
24
|
+
- @telegraph/helpers@0.0.15
|
|
25
|
+
- @telegraph/layout@0.3.3
|
|
26
|
+
|
|
3
27
|
## 0.1.6
|
|
4
28
|
|
|
5
29
|
### Patch Changes
|
package/dist/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../src/Input/Input.constants.ts","../../src/Input/Input.tsx"],"sourcesContent":["export const SIZE = {\n Container: {\n \"1\": {\n h: \"6\",\n pl: \"0\",\n rounded: \"2\",\n },\n \"2\": {\n h: \"8\",\n pl: \"0\",\n rounded: \"2\",\n },\n \"3\": {\n h: \"10\",\n pl: \"0\",\n rounded: \"2\",\n },\n },\n Text: {\n \"1\": {\n size: \"1\",\n px: \"1\",\n },\n \"2\": {\n size: \"2\",\n px: \"2\",\n },\n \"3\": {\n size: \"3\",\n px: \"3\",\n },\n },\n SlotLeading: {\n \"1\": {\n pl: \"1_5\",\n },\n \"2\": {\n pl: \"2\",\n },\n \"3\": {\n pl: \"3\",\n },\n },\n SlotTrailing: {\n \"1\": {\n pr: \"1\",\n },\n \"2\": {\n pr: \"2\",\n },\n \"3\": {\n pr: \"3\",\n },\n },\n} as const;\n\nexport const COLOR = {\n Container: {\n default: {\n outline: {\n bg: \"surface-1\",\n border: \"px\",\n borderColor: \"gray-6\",\n hover_borderColor: \"gray-7\",\n focus_within_borderColor: \"blue-8\",\n },\n ghost: {\n bg: \"transparent\",\n border: \"px\",\n borderColor: \"transparent\",\n hover_backgroundColor: \"gray-3\",\n hover_borderColor: \"transparent\",\n focus_within_backgroundColor: \"gray-4\",\n focus_within_borderColor: \"blue-8\",\n },\n },\n disabled: {\n outline: {\n bg: \"gray-2\",\n border: \"px\",\n borderColor: \"gray-2\",\n },\n ghost: {\n bg: \"transparent\",\n border: \"px\",\n borderColor: \"transparent\",\n },\n },\n error: {\n outline: {\n bg: \"surface-1\",\n border: \"px\",\n borderColor: \"red-6\",\n },\n ghost: {\n bg: \"transparent\",\n border: \"px\",\n borderColor: \"red-6\",\n },\n },\n },\n Text: {\n default: {\n color: \"default\",\n },\n disabled: {\n color: \"disabled\",\n },\n error: {\n color: \"default\",\n },\n },\n} as const;\n","import { Slot as RadixSlot } from \"@radix-ui/react-slot\";\nimport { useComposedRefs } from \"@telegraph/compose-refs\";\nimport type {\n PolymorphicProps,\n Required,\n TgphComponentProps,\n TgphElement,\n} from \"@telegraph/helpers\";\nimport { Stack } from \"@telegraph/layout\";\nimport { Text } from \"@telegraph/typography\";\nimport React from \"react\";\n\nimport { COLOR, SIZE } from \"./Input.constants\";\n\ntype BaseRootProps = {\n size?: \"1\" | \"2\" | \"3\";\n variant?: \"outline\" | \"ghost\";\n errored?: boolean;\n};\n\ntype RootProps<T extends TgphElement> = BaseRootProps & {\n textProps?: Omit<React.ComponentProps<typeof Text<T>>, \"as\">;\n stackProps?: Omit<React.ComponentProps<typeof Stack>, \"as\">;\n} & Omit<React.ComponentProps<typeof Text<T>>, \"as\">;\n\ntype InternalProps = Omit<BaseRootProps, \"errored\"> & {\n state: \"default\" | \"disabled\" | \"error\";\n};\n\nconst InputContext = React.createContext<Required<InternalProps>>({\n state: \"default\",\n size: \"2\",\n variant: \"outline\",\n});\n\nconst Root = <T extends TgphElement>({\n as = \"input\" as T,\n size = \"2\",\n variant = \"outline\",\n textProps,\n stackProps,\n disabled,\n errored,\n children,\n tgphRef,\n ...props\n}: RootProps<T>) => {\n const Component = as;\n const inputRef = React.useRef<HTMLInputElement>(null);\n const composedRefs = useComposedRefs(tgphRef, inputRef);\n\n const state = disabled ? \"disabled\" : errored ? \"error\" : \"default\";\n\n return (\n <InputContext.Provider value={{ size, variant, state }}>\n <Stack\n // Focus the input when clicking on the container\n onPointerDown={(event: React.MouseEvent<HTMLDivElement>) => {\n const target = event.target as HTMLElement;\n\n // Make sure we're not clicking on an interactive element\n if (target.closest(\"button, a\")) {\n event.preventDefault();\n return;\n }\n\n const input = inputRef.current;\n if (!input) return;\n\n requestAnimationFrame(() => {\n input.focus();\n });\n }}\n align=\"center\"\n {...SIZE.Container[size]}\n {...COLOR.Container[state][variant]}\n data-tgph-input-container\n data-tgph-input-container-variant={variant}\n data-tgph-input-container-state={state}\n data-tgph-input-container-size={size}\n {...stackProps}\n >\n {/* \n We choose to use the `<Text/>` component as a base here so that we can \n configure the text inside of the input to match the design system font sizes\n */}\n <Text\n as={Component}\n bg=\"transparent\"\n shadow=\"0\"\n h=\"full\"\n w=\"full\"\n disabled={disabled}\n tgphRef={composedRefs}\n {...SIZE.Text[size]}\n {...COLOR.Text[state]}\n {...props}\n {...textProps}\n data-tgph-input-field\n />\n {children}\n </Stack>\n </InputContext.Provider>\n );\n};\n\ntype SlotProps = React.ComponentPropsWithoutRef<typeof RadixSlot> & {\n size?: \"1\" | \"2\" | \"3\";\n position?: \"leading\" | \"trailing\";\n};\ntype SlotRef = React.ElementRef<typeof RadixSlot>;\n\nconst Slot = React.forwardRef<SlotRef, SlotProps>(\n ({ position = \"leading\", ...props }, forwardedRef) => {\n const context = React.useContext(InputContext);\n return (\n <Stack\n align=\"center\"\n justify=\"center\"\n h=\"full\"\n data-tgph-input-slot\n data-tgph-input-slot-position={position}\n data-tgph-input-slot-size={props.size ?? context.size}\n {...(position === \"leading\" && SIZE.SlotLeading[context.size])}\n {...(position === \"trailing\" && SIZE.SlotTrailing[context.size])}\n >\n <RadixSlot size={context.size} {...props} ref={forwardedRef} />\n </Stack>\n );\n },\n);\n\ntype DefaultProps<T extends TgphElement> = PolymorphicProps<T> &\n TgphComponentProps<typeof Root> & {\n LeadingComponent?: React.ReactNode;\n TrailingComponent?: React.ReactNode;\n };\n\nconst Default = <T extends TgphElement>({\n LeadingComponent,\n TrailingComponent,\n ...props\n}: DefaultProps<T>) => {\n return (\n <Root {...props}>\n {LeadingComponent && <Slot position=\"leading\">{LeadingComponent}</Slot>}\n {TrailingComponent && (\n <Slot position=\"trailing\">{TrailingComponent}</Slot>\n )}\n </Root>\n );\n};\n\nObject.assign(Default, { Root, Slot });\n\nconst Input = Default as typeof Default & {\n Root: typeof Root;\n Slot: typeof Slot;\n};\n\nexport { Input };\n"],"names":["SIZE","COLOR","InputContext","React","Root","as","size","variant","textProps","stackProps","disabled","errored","children","tgphRef","props","Component","inputRef","composedRefs","useComposedRefs","state","jsx","jsxs","Stack","event","input","Text","Slot","position","forwardedRef","context","RadixSlot","Default","LeadingComponent","TrailingComponent","Input"],"mappings":"iRAAaA,EAAO,CAClB,UAAW,CACT,EAAK,CACH,EAAG,IACH,GAAI,IACJ,QAAS,GAAA,EAEX,EAAK,CACH,EAAG,IACH,GAAI,IACJ,QAAS,GAAA,EAEX,EAAK,CACH,EAAG,KACH,GAAI,IACJ,QAAS,GAAA,CACX,EAEF,KAAM,CACJ,EAAK,CACH,KAAM,IACN,GAAI,GAAA,EAEN,EAAK,CACH,KAAM,IACN,GAAI,GAAA,EAEN,EAAK,CACH,KAAM,IACN,GAAI,GAAA,CACN,EAEF,YAAa,CACX,EAAK,CACH,GAAI,KAAA,EAEN,EAAK,CACH,GAAI,GAAA,EAEN,EAAK,CACH,GAAI,GAAA,CACN,EAEF,aAAc,CACZ,EAAK,CACH,GAAI,GAAA,EAEN,EAAK,CACH,GAAI,GAAA,EAEN,EAAK,CACH,GAAI,GAAA,CACN,CAEJ,EAEaC,EAAQ,CACnB,UAAW,CACT,QAAS,CACP,QAAS,CACP,GAAI,YACJ,OAAQ,KACR,YAAa,SACb,kBAAmB,SACnB,yBAA0B,QAAA,EAE5B,MAAO,CACL,GAAI,cACJ,OAAQ,KACR,YAAa,cACb,sBAAuB,SACvB,kBAAmB,cACnB,6BAA8B,SAC9B,yBAA0B,QAAA,CAC5B,EAEF,SAAU,CACR,QAAS,CACP,GAAI,SACJ,OAAQ,KACR,YAAa,QAAA,EAEf,MAAO,CACL,GAAI,cACJ,OAAQ,KACR,YAAa,aAAA,CACf,EAEF,MAAO,CACL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KAAKM,CAAI,EACjB,GAAGL,EAAM,KAAKkB,CAAK,EACnB,GAAGL,EACH,GAAGN,EACJ,wBAAqB,EAAA,CAAA,EAEtBI,CAAA,CAAA,CAAA,EAEL,CAEJ,EAQMc,EAAOvB,EAAM,WACjB,CAAC,CAAE,SAAAwB,EAAW,UAAW,GAAGb,CAAA,EAASc,IAAiB,CACpD,MAAMC,EAAU1B,EAAM,WAAWD,CAAY,EAC7C,OACEkB,EAAAA,IAACE,EAAAA,MAAA,CACC,MAAM,SACN,QAAQ,SACR,EAAE,OACF,uBAAoB,GACpB,gCAA+BK,EAC/B,4BAA2Bb,EAAM,MAAQe,EAAQ,KAChD,GAAIF,IAAa,WAAa3B,EAAK,YAAY6B,EAAQ,IAAI,EAC3D,GAAIF,IAAa,YAAc3B,EAAK,aAAa6B,EAAQ,IAAI,EAE9D,SAAAT,EAAAA,IAACU,EAAAA,MAAU,KAAMD,EAAQ,KAAO,GAAGf,EAAO,IAAKc,CAAA,CAAc,CAAA,CAAA,CAGnE,CACF,EAQMG,EAAU,CAAwB,CACtC,iBAAAC,EACA,kBAAAC,EACA,GAAGnB,CACL,IAEIO,EAAAA,KAACjB,EAAA,CAAM,GAAGU,EACP,SAAA,CAAAkB,GAAoBZ,EAAAA,IAACM,EAAA,CAAK,SAAS,UAAW,SAAAM,EAAiB,EAC/DC,GACCb,EAAAA,IAACM,EAAA,CAAK,SAAS,WAAY,SAAAO,CAAA,CAAkB,CAAA,EAEjD,EAIJ,OAAO,OAAOF,EAAS,CAAE,KAAA3B,EAAM,KAAAsB,EAAM,EAErC,MAAMQ,EAAQH"}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../src/Input/Input.constants.ts","../../src/Input/Input.tsx"],"sourcesContent":["export const SIZE = {\n Container: {\n \"1\": {\n h: \"6\",\n pl: \"0\",\n rounded: \"2\",\n },\n \"2\": {\n h: \"8\",\n pl: \"0\",\n rounded: \"2\",\n },\n \"3\": {\n h: \"10\",\n pl: \"0\",\n rounded: \"2\",\n },\n },\n Text: {\n \"1\": {\n size: \"1\",\n px: \"1\",\n },\n \"2\": {\n size: \"2\",\n px: \"2\",\n },\n \"3\": {\n size: \"3\",\n px: \"3\",\n },\n },\n SlotLeading: {\n \"1\": {\n pl: \"1_5\",\n },\n \"2\": {\n pl: \"2\",\n },\n \"3\": {\n pl: \"3\",\n },\n },\n SlotTrailing: {\n \"1\": {\n pr: \"1\",\n },\n \"2\": {\n pr: \"2\",\n },\n \"3\": {\n pr: \"3\",\n },\n },\n} as const;\n\nexport const COLOR = {\n Container: {\n default: {\n outline: {\n bg: \"surface-1\",\n border: \"px\",\n borderColor: \"gray-6\",\n hover_borderColor: \"gray-7\",\n focus_within_borderColor: \"blue-8\",\n },\n ghost: {\n bg: \"transparent\",\n border: \"px\",\n borderColor: \"transparent\",\n hover_backgroundColor: \"gray-3\",\n hover_borderColor: \"transparent\",\n focus_within_backgroundColor: \"gray-4\",\n focus_within_borderColor: \"blue-8\",\n },\n },\n disabled: {\n outline: {\n bg: \"gray-2\",\n border: \"px\",\n borderColor: \"gray-2\",\n },\n ghost: {\n bg: \"transparent\",\n border: \"px\",\n borderColor: \"transparent\",\n },\n },\n error: {\n outline: {\n bg: \"surface-1\",\n border: \"px\",\n borderColor: \"red-6\",\n },\n ghost: {\n bg: \"transparent\",\n border: \"px\",\n borderColor: \"red-6\",\n },\n },\n },\n Text: {\n default: {\n color: \"default\",\n },\n disabled: {\n color: \"disabled\",\n },\n error: {\n color: \"default\",\n },\n },\n} as const;\n","import { Slot as RadixSlot } from \"@radix-ui/react-slot\";\nimport { useComposedRefs } from \"@telegraph/compose-refs\";\nimport type {\n PolymorphicProps,\n Required,\n TgphComponentProps,\n TgphElement,\n} from \"@telegraph/helpers\";\nimport { Stack } from \"@telegraph/layout\";\nimport { Text } from \"@telegraph/typography\";\nimport React from \"react\";\n\nimport { COLOR, SIZE } from \"./Input.constants\";\n\nexport type BaseRootProps = {\n size?: \"1\" | \"2\" | \"3\";\n variant?: \"outline\" | \"ghost\";\n errored?: boolean;\n};\n\nexport type RootProps<T extends TgphElement = \"input\"> = BaseRootProps & {\n textProps?: Omit<React.ComponentProps<typeof Text<T>>, \"as\">;\n stackProps?: Omit<React.ComponentProps<typeof Stack>, \"as\">;\n} & Omit<React.ComponentProps<typeof Text<T>>, \"as\" | keyof BaseRootProps>;\n\ntype InternalProps = Omit<BaseRootProps, \"errored\"> & {\n state: \"default\" | \"disabled\" | \"error\";\n};\n\nconst InputContext = React.createContext<Required<InternalProps>>({\n state: \"default\",\n size: \"2\",\n variant: \"outline\",\n});\n\nconst Root = <T extends TgphElement = \"input\">({\n as = \"input\" as T,\n size = \"2\",\n variant = \"outline\",\n textProps,\n stackProps,\n disabled,\n errored,\n children,\n tgphRef,\n ...props\n}: RootProps<T>) => {\n const Component = as;\n const inputRef = React.useRef<HTMLInputElement>(null);\n const composedRefs = useComposedRefs(tgphRef, inputRef);\n\n const state = disabled ? \"disabled\" : errored ? \"error\" : \"default\";\n\n return (\n <InputContext.Provider value={{ size, variant, state }}>\n <Stack\n // Focus the input when clicking on the container\n onPointerDown={(event: React.MouseEvent<HTMLDivElement>) => {\n const target = event.target as HTMLElement;\n\n // Make sure we're not clicking on an interactive element\n if (target.closest(\"button, a\")) {\n event.preventDefault();\n return;\n }\n\n const input = inputRef.current;\n if (!input) return;\n\n requestAnimationFrame(() => {\n input.focus();\n });\n }}\n align=\"center\"\n {...SIZE.Container[size]}\n {...COLOR.Container[state][variant]}\n data-tgph-input-container\n data-tgph-input-container-variant={variant}\n data-tgph-input-container-state={state}\n data-tgph-input-container-size={size}\n {...stackProps}\n >\n {/* \n We choose to use the `<Text/>` component as a base here so that we can \n configure the text inside of the input to match the design system font sizes\n */}\n <Text\n as={Component}\n bg=\"transparent\"\n shadow=\"0\"\n h=\"full\"\n w=\"full\"\n disabled={disabled}\n tgphRef={composedRefs}\n {...SIZE.Text[size]}\n {...COLOR.Text[state]}\n {...props}\n {...textProps}\n data-tgph-input-field\n />\n {children}\n </Stack>\n </InputContext.Provider>\n );\n};\n\nexport type SlotProps = React.ComponentPropsWithoutRef<typeof RadixSlot> & {\n size?: \"1\" | \"2\" | \"3\";\n position?: \"leading\" | \"trailing\";\n};\ntype SlotRef = React.ElementRef<typeof RadixSlot>;\n\nconst Slot = React.forwardRef<SlotRef, SlotProps>(\n ({ position = \"leading\", ...props }, forwardedRef) => {\n const context = React.useContext(InputContext);\n return (\n <Stack\n align=\"center\"\n justify=\"center\"\n h=\"full\"\n data-tgph-input-slot\n data-tgph-input-slot-position={position}\n data-tgph-input-slot-size={props.size ?? context.size}\n {...(position === \"leading\" && SIZE.SlotLeading[context.size])}\n {...(position === \"trailing\" && SIZE.SlotTrailing[context.size])}\n >\n <RadixSlot size={context.size} {...props} ref={forwardedRef} />\n </Stack>\n );\n },\n);\n\nexport type DefaultProps<T extends TgphElement = \"input\"> = Omit<\n PolymorphicProps<T>,\n keyof BaseRootProps\n> &\n TgphComponentProps<typeof Root> & {\n LeadingComponent?: React.ReactNode;\n TrailingComponent?: React.ReactNode;\n };\n\nconst Default = <T extends TgphElement = \"input\">({\n LeadingComponent,\n TrailingComponent,\n ...props\n}: DefaultProps<T>) => {\n return (\n <Root {...props}>\n {LeadingComponent && <Slot position=\"leading\">{LeadingComponent}</Slot>}\n {TrailingComponent && (\n <Slot position=\"trailing\">{TrailingComponent}</Slot>\n )}\n </Root>\n );\n};\n\nObject.assign(Default, { Root, Slot });\n\nconst Input = Default as typeof Default & {\n Root: typeof Root;\n Slot: typeof Slot;\n};\n\nexport { Input };\n"],"names":["SIZE","COLOR","InputContext","React","Root","as","size","variant","textProps","stackProps","disabled","errored","children","tgphRef","props","Component","inputRef","composedRefs","useComposedRefs","state","jsx","jsxs","Stack","event","input","Text","Slot","position","forwardedRef","context","RadixSlot","Default","LeadingComponent","TrailingComponent","Input"],"mappings":"iRAAaA,EAAO,CAClB,UAAW,CACT,EAAK,CACH,EAAG,IACH,GAAI,IACJ,QAAS,GAAA,EAEX,EAAK,C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GAAIF,IAAa,WAAa3B,EAAK,YAAY6B,EAAQ,IAAI,EAC3D,GAAIF,IAAa,YAAc3B,EAAK,aAAa6B,EAAQ,IAAI,EAE9D,SAAAT,EAAAA,IAACU,EAAAA,MAAU,KAAMD,EAAQ,KAAO,GAAGf,EAAO,IAAKc,CAAA,CAAc,CAAA,CAAA,CAGnE,CACF,EAWMG,EAAU,CAAkC,CAChD,iBAAAC,EACA,kBAAAC,EACA,GAAGnB,CACL,IAEIO,EAAAA,KAACjB,EAAA,CAAM,GAAGU,EACP,SAAA,CAAAkB,GAAoBZ,EAAAA,IAACM,EAAA,CAAK,SAAS,UAAW,SAAAM,EAAiB,EAC/DC,GACCb,EAAAA,IAACM,EAAA,CAAK,SAAS,WAAY,SAAAO,CAAA,CAAkB,CAAA,EAEjD,EAIJ,OAAO,OAAOF,EAAS,CAAE,KAAA3B,EAAM,KAAAsB,EAAM,EAErC,MAAMQ,EAAQH"}
|
package/dist/esm/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../../src/Input/Input.constants.ts","../../src/Input/Input.tsx"],"sourcesContent":["export const SIZE = {\n Container: {\n \"1\": {\n h: \"6\",\n pl: \"0\",\n rounded: \"2\",\n },\n \"2\": {\n h: \"8\",\n pl: \"0\",\n rounded: \"2\",\n },\n \"3\": {\n h: \"10\",\n pl: \"0\",\n rounded: \"2\",\n },\n },\n Text: {\n \"1\": {\n size: \"1\",\n px: \"1\",\n },\n \"2\": {\n size: \"2\",\n px: \"2\",\n },\n \"3\": {\n size: \"3\",\n px: \"3\",\n },\n },\n SlotLeading: {\n \"1\": {\n pl: \"1_5\",\n },\n \"2\": {\n pl: \"2\",\n },\n \"3\": {\n pl: \"3\",\n },\n },\n SlotTrailing: {\n \"1\": {\n pr: \"1\",\n },\n \"2\": {\n pr: \"2\",\n },\n \"3\": {\n pr: \"3\",\n },\n },\n} as const;\n\nexport const COLOR = {\n Container: {\n default: {\n outline: {\n bg: \"surface-1\",\n border: \"px\",\n borderColor: \"gray-6\",\n hover_borderColor: \"gray-7\",\n focus_within_borderColor: \"blue-8\",\n },\n ghost: {\n bg: \"transparent\",\n border: \"px\",\n borderColor: \"transparent\",\n hover_backgroundColor: \"gray-3\",\n hover_borderColor: \"transparent\",\n focus_within_backgroundColor: \"gray-4\",\n focus_within_borderColor: \"blue-8\",\n },\n },\n disabled: {\n outline: {\n bg: \"gray-2\",\n border: \"px\",\n borderColor: \"gray-2\",\n },\n ghost: {\n bg: \"transparent\",\n border: \"px\",\n borderColor: \"transparent\",\n },\n },\n error: {\n outline: {\n bg: \"surface-1\",\n border: \"px\",\n borderColor: \"red-6\",\n },\n ghost: {\n bg: \"transparent\",\n border: \"px\",\n borderColor: \"red-6\",\n },\n },\n },\n Text: {\n default: {\n color: \"default\",\n },\n disabled: {\n color: \"disabled\",\n },\n error: {\n color: \"default\",\n },\n },\n} as const;\n","import { Slot as RadixSlot } from \"@radix-ui/react-slot\";\nimport { useComposedRefs } from \"@telegraph/compose-refs\";\nimport type {\n PolymorphicProps,\n Required,\n TgphComponentProps,\n TgphElement,\n} from \"@telegraph/helpers\";\nimport { Stack } from \"@telegraph/layout\";\nimport { Text } from \"@telegraph/typography\";\nimport React from \"react\";\n\nimport { COLOR, SIZE } from \"./Input.constants\";\n\ntype BaseRootProps = {\n size?: \"1\" | \"2\" | \"3\";\n variant?: \"outline\" | \"ghost\";\n errored?: boolean;\n};\n\ntype RootProps<T extends TgphElement> = BaseRootProps & {\n textProps?: Omit<React.ComponentProps<typeof Text<T>>, \"as\">;\n stackProps?: Omit<React.ComponentProps<typeof Stack>, \"as\">;\n} & Omit<React.ComponentProps<typeof Text<T>>, \"as\">;\n\ntype InternalProps = Omit<BaseRootProps, \"errored\"> & {\n state: \"default\" | \"disabled\" | \"error\";\n};\n\nconst InputContext = React.createContext<Required<InternalProps>>({\n state: \"default\",\n size: \"2\",\n variant: \"outline\",\n});\n\nconst Root = <T extends TgphElement>({\n as = \"input\" as T,\n size = \"2\",\n variant = \"outline\",\n textProps,\n stackProps,\n disabled,\n errored,\n children,\n tgphRef,\n ...props\n}: RootProps<T>) => {\n const Component = as;\n const inputRef = React.useRef<HTMLInputElement>(null);\n const composedRefs = useComposedRefs(tgphRef, inputRef);\n\n const state = disabled ? \"disabled\" : errored ? \"error\" : \"default\";\n\n return (\n <InputContext.Provider value={{ size, variant, state }}>\n <Stack\n // Focus the input when clicking on the container\n onPointerDown={(event: React.MouseEvent<HTMLDivElement>) => {\n const target = event.target as HTMLElement;\n\n // Make sure we're not clicking on an interactive element\n if (target.closest(\"button, a\")) {\n event.preventDefault();\n return;\n }\n\n const input = inputRef.current;\n if (!input) return;\n\n requestAnimationFrame(() => {\n input.focus();\n });\n }}\n align=\"center\"\n {...SIZE.Container[size]}\n {...COLOR.Container[state][variant]}\n data-tgph-input-container\n data-tgph-input-container-variant={variant}\n data-tgph-input-container-state={state}\n data-tgph-input-container-size={size}\n {...stackProps}\n >\n {/* \n We choose to use the `<Text/>` component as a base here so that we can \n configure the text inside of the input to match the design system font sizes\n */}\n <Text\n as={Component}\n bg=\"transparent\"\n shadow=\"0\"\n h=\"full\"\n w=\"full\"\n disabled={disabled}\n tgphRef={composedRefs}\n {...SIZE.Text[size]}\n {...COLOR.Text[state]}\n {...props}\n {...textProps}\n data-tgph-input-field\n />\n {children}\n </Stack>\n </InputContext.Provider>\n );\n};\n\ntype SlotProps = React.ComponentPropsWithoutRef<typeof RadixSlot> & {\n size?: \"1\" | \"2\" | \"3\";\n position?: \"leading\" | \"trailing\";\n};\ntype SlotRef = React.ElementRef<typeof RadixSlot>;\n\nconst Slot = React.forwardRef<SlotRef, SlotProps>(\n ({ position = \"leading\", ...props }, forwardedRef) => {\n const context = React.useContext(InputContext);\n return (\n <Stack\n align=\"center\"\n justify=\"center\"\n h=\"full\"\n data-tgph-input-slot\n data-tgph-input-slot-position={position}\n data-tgph-input-slot-size={props.size ?? context.size}\n {...(position === \"leading\" && SIZE.SlotLeading[context.size])}\n {...(position === \"trailing\" && SIZE.SlotTrailing[context.size])}\n >\n <RadixSlot size={context.size} {...props} ref={forwardedRef} />\n </Stack>\n );\n },\n);\n\ntype DefaultProps<T extends TgphElement> = PolymorphicProps<T> &\n TgphComponentProps<typeof Root> & {\n LeadingComponent?: React.ReactNode;\n TrailingComponent?: React.ReactNode;\n };\n\nconst Default = <T extends TgphElement>({\n LeadingComponent,\n TrailingComponent,\n ...props\n}: DefaultProps<T>) => {\n return (\n <Root {...props}>\n {LeadingComponent && <Slot position=\"leading\">{LeadingComponent}</Slot>}\n {TrailingComponent && (\n <Slot position=\"trailing\">{TrailingComponent}</Slot>\n )}\n </Root>\n );\n};\n\nObject.assign(Default, { Root, Slot });\n\nconst Input = Default as typeof Default & {\n Root: typeof Root;\n Slot: typeof Slot;\n};\n\nexport { Input };\n"],"names":["SIZE","COLOR","InputContext","React","Root","as","size","variant","textProps","stackProps","disabled","errored","children","tgphRef","props","Component","inputRef","composedRefs","useComposedRefs","state","jsx","jsxs","Stack","event","input","Text","Slot","position","forwardedRef","context","RadixSlot","Default","LeadingComponent","TrailingComponent","Input"],"mappings":";;;;;;AAAO,MAAMA,IAAO;AAAA,EAClB,WAAW;AAAA,IACT,GAAK;AAAA,MACH,GAAG;AAAA,MACH,IAAI;AAAA,MACJ,SAAS;AAAA,IAAA;AAAA,IAEX,GAAK;AAAA,MACH,GAAG;AAAA,MACH,IAAI;AAAA,MACJ,SAAS;AAAA,IAAA;AAAA,IAEX,GAAK;AAAA,MACH,GAAG;AAAA,MACH,IAAI;AAAA,MACJ,SAAS;AAAA,IAAA;AAAA,EACX;AAAA,EAEF,MAAM;AAAA,IACJ,GAAK;AAAA,MACH,MAAM;AAAA,MACN,IAAI;AAAA,IAAA;AAAA,IAEN,GAAK;AAAA,MACH,MAAM;AAAA,MACN,IAAI;AAAA,IAAA;AAAA,IAEN,GAAK;AAAA,MACH,MAAM;AAAA,MACN,IAAI;AAAA,IAAA;AAAA,EACN;AAAA,E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3,"file":"index.mjs","sources":["../../src/Input/Input.constants.ts","../../src/Input/Input.tsx"],"sourcesContent":["export const SIZE = {\n Container: {\n \"1\": {\n h: \"6\",\n pl: \"0\",\n rounded: \"2\",\n },\n \"2\": {\n h: \"8\",\n pl: \"0\",\n rounded: \"2\",\n },\n \"3\": {\n h: \"10\",\n pl: \"0\",\n rounded: \"2\",\n },\n },\n Text: {\n \"1\": {\n size: \"1\",\n px: \"1\",\n },\n \"2\": {\n size: \"2\",\n px: \"2\",\n },\n \"3\": {\n size: \"3\",\n px: \"3\",\n },\n },\n SlotLeading: {\n \"1\": {\n pl: \"1_5\",\n },\n \"2\": {\n pl: \"2\",\n },\n \"3\": {\n pl: \"3\",\n },\n },\n SlotTrailing: {\n \"1\": {\n pr: \"1\",\n },\n \"2\": {\n pr: \"2\",\n },\n \"3\": {\n pr: \"3\",\n },\n },\n} as const;\n\nexport const COLOR = {\n Container: {\n default: {\n outline: {\n bg: \"surface-1\",\n border: \"px\",\n borderColor: \"gray-6\",\n hover_borderColor: \"gray-7\",\n focus_within_borderColor: \"blue-8\",\n },\n ghost: {\n bg: \"transparent\",\n border: \"px\",\n borderColor: \"transparent\",\n hover_backgroundColor: \"gray-3\",\n hover_borderColor: \"transparent\",\n focus_within_backgroundColor: \"gray-4\",\n focus_within_borderColor: \"blue-8\",\n },\n },\n disabled: {\n outline: {\n bg: \"gray-2\",\n border: \"px\",\n borderColor: \"gray-2\",\n },\n ghost: {\n bg: \"transparent\",\n border: \"px\",\n borderColor: \"transparent\",\n },\n },\n error: {\n outline: {\n bg: \"surface-1\",\n border: \"px\",\n borderColor: \"red-6\",\n },\n ghost: {\n bg: \"transparent\",\n border: \"px\",\n borderColor: \"red-6\",\n },\n },\n },\n Text: {\n default: {\n color: \"default\",\n },\n disabled: {\n color: \"disabled\",\n },\n error: {\n color: \"default\",\n },\n },\n} as const;\n","import { Slot as RadixSlot } from \"@radix-ui/react-slot\";\nimport { useComposedRefs } from \"@telegraph/compose-refs\";\nimport type {\n PolymorphicProps,\n Required,\n TgphComponentProps,\n TgphElement,\n} from \"@telegraph/helpers\";\nimport { Stack } from \"@telegraph/layout\";\nimport { Text } from \"@telegraph/typography\";\nimport React from \"react\";\n\nimport { COLOR, SIZE } from \"./Input.constants\";\n\nexport type BaseRootProps = {\n size?: \"1\" | \"2\" | \"3\";\n variant?: \"outline\" | \"ghost\";\n errored?: boolean;\n};\n\nexport type RootProps<T extends TgphElement = \"input\"> = BaseRootProps & {\n textProps?: Omit<React.ComponentProps<typeof Text<T>>, \"as\">;\n stackProps?: Omit<React.ComponentProps<typeof Stack>, \"as\">;\n} & Omit<React.ComponentProps<typeof Text<T>>, \"as\" | keyof BaseRootProps>;\n\ntype InternalProps = Omit<BaseRootProps, \"errored\"> & {\n state: \"default\" | \"disabled\" | \"error\";\n};\n\nconst InputContext = React.createContext<Required<InternalProps>>({\n state: \"default\",\n size: \"2\",\n variant: \"outline\",\n});\n\nconst Root = <T extends TgphElement = \"input\">({\n as = \"input\" as T,\n size = \"2\",\n variant = \"outline\",\n textProps,\n stackProps,\n disabled,\n errored,\n children,\n tgphRef,\n ...props\n}: RootProps<T>) => {\n const Component = as;\n const inputRef = React.useRef<HTMLInputElement>(null);\n const composedRefs = useComposedRefs(tgphRef, inputRef);\n\n const state = disabled ? \"disabled\" : errored ? \"error\" : \"default\";\n\n return (\n <InputContext.Provider value={{ size, variant, state }}>\n <Stack\n // Focus the input when clicking on the container\n onPointerDown={(event: React.MouseEvent<HTMLDivElement>) => {\n const target = event.target as HTMLElement;\n\n // Make sure we're not clicking on an interactive element\n if (target.closest(\"button, a\")) {\n event.preventDefault();\n return;\n }\n\n const input = inputRef.current;\n if (!input) return;\n\n requestAnimationFrame(() => {\n input.focus();\n });\n }}\n align=\"center\"\n {...SIZE.Container[size]}\n {...COLOR.Container[state][variant]}\n data-tgph-input-container\n data-tgph-input-container-variant={variant}\n data-tgph-input-container-state={state}\n data-tgph-input-container-size={size}\n {...stackProps}\n >\n {/* \n We choose to use the `<Text/>` component as a base here so that we can \n configure the text inside of the input to match the design system font sizes\n */}\n <Text\n as={Component}\n bg=\"transparent\"\n shadow=\"0\"\n h=\"full\"\n w=\"full\"\n disabled={disabled}\n tgphRef={composedRefs}\n {...SIZE.Text[size]}\n {...COLOR.Text[state]}\n {...props}\n {...textProps}\n data-tgph-input-field\n />\n {children}\n </Stack>\n </InputContext.Provider>\n );\n};\n\nexport type SlotProps = React.ComponentPropsWithoutRef<typeof RadixSlot> & {\n size?: \"1\" | \"2\" | \"3\";\n position?: \"leading\" | \"trailing\";\n};\ntype SlotRef = React.ElementRef<typeof RadixSlot>;\n\nconst Slot = React.forwardRef<SlotRef, SlotProps>(\n ({ position = \"leading\", ...props }, forwardedRef) => {\n const context = React.useContext(InputContext);\n return (\n <Stack\n align=\"center\"\n justify=\"center\"\n h=\"full\"\n data-tgph-input-slot\n data-tgph-input-slot-position={position}\n data-tgph-input-slot-size={props.size ?? context.size}\n {...(position === \"leading\" && SIZE.SlotLeading[context.size])}\n {...(position === \"trailing\" && SIZE.SlotTrailing[context.size])}\n >\n <RadixSlot size={context.size} {...props} ref={forwardedRef} />\n </Stack>\n );\n },\n);\n\nexport type DefaultProps<T extends TgphElement = \"input\"> = Omit<\n PolymorphicProps<T>,\n keyof BaseRootProps\n> &\n TgphComponentProps<typeof Root> & {\n LeadingComponent?: React.ReactNode;\n TrailingComponent?: React.ReactNode;\n };\n\nconst Default = <T extends TgphElement = \"input\">({\n LeadingComponent,\n TrailingComponent,\n ...props\n}: DefaultProps<T>) => {\n return (\n <Root {...props}>\n {LeadingComponent && <Slot position=\"leading\">{LeadingComponent}</Slot>}\n {TrailingComponent && (\n <Slot position=\"trailing\">{TrailingComponent}</Slot>\n )}\n </Root>\n );\n};\n\nObject.assign(Default, { Root, Slot });\n\nconst Input = Default as typeof Default & {\n Root: typeof Root;\n Slot: typeof Slot;\n};\n\nexport { Input };\n"],"names":["SIZE","COLOR","InputContext","React","Root","as","size","variant","textProps","stackProps","disabled","errored","children","tgphRef","props","Component","inputRef","composedRefs","useComposedRefs","state","jsx","jsxs","Stack","event","input","Text","Slot","position","forwardedRef","context","RadixSlot","Default","LeadingComponent","TrailingComponent","Input"],"mappings":";;;;;;AAAO,MAAMA,IAAO;AAAA,EAClB,WAAW;AAAA,IACT,GAAK;AAAA,MACH,GAAG;AAAA,MACH,IAAI;AAAA,MACJ,SAAS;AAAA,IAAA;AAAA,IAEX,GAAK;AAAA,MACH,GAAG;AAAA,MACH,IAAI;AAAA,MACJ,SAAS;AAAA,IAAA;AAAA,IAEX,GAAK;AAAA,MACH,GAAG;AAAA,MACH,IAAI;AAAA,MACJ,SAAS;AAAA,IAAA;AAAA,EACX;AAAA,EAEF,MAAM;AAAA,IACJ,GAAK;AAAA,MACH,MAAM;AAAA,MACN,IAAI;AAAA,IAAA;AAAA,IAEN,GAAK;AAAA,MACH,MAAM;AAAA,MACN,IAAI;AAAA,IAAA;AAAA,IAEN,GAAK;AAAA,MACH,MAAM;AAAA,MACN,IAAI;AAAA,IAAA;AAAA,EACN;AAAA,EAEF,aAAa;AAAA,IACX,GAAK;AAAA,MACH,IAAI;AAAA,IAAA;AAAA,IAEN,GAAK;AAAA,MACH,IAAI;AAAA,IAAA;AAAA,IAEN,GAAK;AAAA,MACH,IAAI;AAAA,IAAA;AAAA,EACN;AAAA,EAEF,cAAc;AAAA,IACZ,GAAK;AAAA,MACH,IAAI;AAAA,IAAA;AAAA,IAEN,GAAK;AAAA,MACH,IAAI;AAAA,IAAA;AAAA,IAEN,GAAK;AAAA,MACH,IAAI;AAAA,IAAA;AAAA,EACN;AAEJ,GAEaC,IAAQ;AAAA,EACnB,WAAW;AAAA,IACT,SAAS;AAAA,MACP,SAAS;AAAA,QACP,IAAI;AAAA,QACJ,QAAQ;AAAA,QACR,aAAa;AAAA,QACb,mBAAmB;AAAA,QACnB,0BAA0B;AAAA,MAAA;AAAA,MAE5B,OAAO;AAAA,QACL,IAAI;AAAA,QACJ,QAAQ;AAAA,QACR,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AChD,GAAIF,MAAa,aAAa3B,EAAK,YAAY6B,EAAQ,IAAI;AAAA,QAC3D,GAAIF,MAAa,cAAc3B,EAAK,aAAa6B,EAAQ,IAAI;AAAA,QAE9D,UAAA,gBAAAT,EAACU,KAAU,MAAMD,EAAQ,MAAO,GAAGf,GAAO,KAAKc,EAAA,CAAc;AAAA,MAAA;AAAA,IAAA;AAAA,EAGnE;AACF,GAWMG,IAAU,CAAkC;AAAA,EAChD,kBAAAC;AAAA,EACA,mBAAAC;AAAA,EACA,GAAGnB;AACL,MAEI,gBAAAO,EAACjB,GAAA,EAAM,GAAGU,GACP,UAAA;AAAA,EAAAkB,KAAoB,gBAAAZ,EAACM,GAAA,EAAK,UAAS,WAAW,UAAAM,GAAiB;AAAA,EAC/DC,KACC,gBAAAb,EAACM,GAAA,EAAK,UAAS,YAAY,UAAAO,EAAA,CAAkB;AAAA,GAEjD;AAIJ,OAAO,OAAOF,GAAS,EAAE,MAAA3B,GAAM,MAAAsB,GAAM;AAErC,MAAMQ,IAAQH;"}
|
|
@@ -1,26 +1,31 @@
|
|
|
1
|
+
import { Slot as RadixSlot } from '@radix-ui/react-slot';
|
|
1
2
|
import { PolymorphicProps, TgphComponentProps, TgphElement } from '@telegraph/helpers';
|
|
2
3
|
import { Stack } from '@telegraph/layout';
|
|
3
4
|
import { Text } from '@telegraph/typography';
|
|
4
5
|
import { default as React } from 'react';
|
|
5
|
-
type BaseRootProps = {
|
|
6
|
+
export type BaseRootProps = {
|
|
6
7
|
size?: "1" | "2" | "3";
|
|
7
8
|
variant?: "outline" | "ghost";
|
|
8
9
|
errored?: boolean;
|
|
9
10
|
};
|
|
10
|
-
type RootProps<T extends TgphElement> = BaseRootProps & {
|
|
11
|
+
export type RootProps<T extends TgphElement = "input"> = BaseRootProps & {
|
|
11
12
|
textProps?: Omit<React.ComponentProps<typeof Text<T>>, "as">;
|
|
12
13
|
stackProps?: Omit<React.ComponentProps<typeof Stack>, "as">;
|
|
13
|
-
} & Omit<React.ComponentProps<typeof Text<T>>, "as">;
|
|
14
|
-
declare const Root: <T extends TgphElement>({ as, size, variant, textProps, stackProps, disabled, errored, children, tgphRef, ...props }: RootProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
} & Omit<React.ComponentProps<typeof Text<T>>, "as" | keyof BaseRootProps>;
|
|
15
|
+
declare const Root: <T extends TgphElement = "input">({ as, size, variant, textProps, stackProps, disabled, errored, children, tgphRef, ...props }: RootProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
export type SlotProps = React.ComponentPropsWithoutRef<typeof RadixSlot> & {
|
|
17
|
+
size?: "1" | "2" | "3";
|
|
18
|
+
position?: "leading" | "trailing";
|
|
19
|
+
};
|
|
15
20
|
declare const Slot: React.ForwardRefExoticComponent<Omit<import('@radix-ui/react-slot').SlotProps & React.RefAttributes<HTMLElement>, "ref"> & {
|
|
16
21
|
size?: "1" | "2" | "3";
|
|
17
22
|
position?: "leading" | "trailing";
|
|
18
23
|
} & React.RefAttributes<HTMLElement>>;
|
|
19
|
-
type DefaultProps<T extends TgphElement> = PolymorphicProps<T> & TgphComponentProps<typeof Root> & {
|
|
24
|
+
export type DefaultProps<T extends TgphElement = "input"> = Omit<PolymorphicProps<T>, keyof BaseRootProps> & TgphComponentProps<typeof Root> & {
|
|
20
25
|
LeadingComponent?: React.ReactNode;
|
|
21
26
|
TrailingComponent?: React.ReactNode;
|
|
22
27
|
};
|
|
23
|
-
declare const Default: <T extends TgphElement>({ LeadingComponent, TrailingComponent, ...props }: DefaultProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
28
|
+
declare const Default: <T extends TgphElement = "input">({ LeadingComponent, TrailingComponent, ...props }: DefaultProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
24
29
|
declare const Input: typeof Default & {
|
|
25
30
|
Root: typeof Root;
|
|
26
31
|
Slot: typeof Slot;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Input.d.ts","sourceRoot":"","sources":["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,CAAC,EAAE,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC;IACvB,QAAQ,CAAC,EAAE,SAAS,GAAG,UAAU,CAAC;CACnC,CAAC;AAGF,QAAA,MAAM,IAAI;WALD,GAAG,GAAG,GAAG,GAAG,GAAG;eACX,SAAS,GAAG,UAAU;qCAsBlC,CAAC;AAEF,MAAM,MAAM,YAAY,CAAC,CAAC,SAAS,WAAW,GAAG,OAAO,IAAI,IAAI,CAC9D,gBAAgB,CAAC,CAAC,CAAC,EACnB,MAAM,aAAa,CACpB,GACC,kBAAkB,CAAC,OAAO,IAAI,CAAC,GAAG;IAChC,gBAAgB,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACnC,iBAAiB,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CACrC,CAAC;AAEJ,QAAA,MAAM,OAAO,GAAI,CAAC,SAAS,WAAW,GAAG,OAAO,EAAE,mDAI/C,YAAY,CAAC,CAAC,CAAC,4CASjB,CAAC;AAIF,QAAA,MAAM,KAAK,EAAc,OAAO,OAAO,GAAG;IACxC,IAAI,EAAE,OAAO,IAAI,CAAC;IAClB,IAAI,EAAE,OAAO,IAAI,CAAC;CACnB,CAAC;AAEF,OAAO,EAAE,KAAK,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/Input/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/Input/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,YAAY,EACV,aAAa,IAAI,kBAAkB,EACnC,SAAS,IAAI,cAAc,EAC3B,SAAS,IAAI,cAAc,EAC3B,YAAY,IAAI,UAAU,GAC3B,MAAM,SAAS,CAAC"}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,YAAY,EACV,kBAAkB,EAClB,cAAc,EACd,cAAc,EACd,UAAU,GACX,MAAM,SAAS,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@telegraph/input",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "Input component for Telegraph",
|
|
5
5
|
"repository": "https://github.com/knocklabs/telegraph/tree/main/packages/input",
|
|
6
6
|
"author": "@knocklabs",
|
|
@@ -33,22 +33,22 @@
|
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"@radix-ui/react-slot": "^1.2.3",
|
|
36
|
-
"@telegraph/compose-refs": "^0.0.
|
|
37
|
-
"@telegraph/helpers": "^0.0.
|
|
38
|
-
"@telegraph/layout": "^0.
|
|
39
|
-
"@telegraph/typography": "^0.
|
|
36
|
+
"@telegraph/compose-refs": "^0.0.8",
|
|
37
|
+
"@telegraph/helpers": "^0.0.15",
|
|
38
|
+
"@telegraph/layout": "^0.4.0",
|
|
39
|
+
"@telegraph/typography": "^0.2.0",
|
|
40
40
|
"clsx": "^2.1.1"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"@knocklabs/eslint-config": "^0.0.5",
|
|
44
44
|
"@knocklabs/typescript-config": "^0.0.2",
|
|
45
|
-
"@telegraph/postcss-config": "^0.0.
|
|
45
|
+
"@telegraph/postcss-config": "^0.0.31",
|
|
46
46
|
"@telegraph/prettier-config": "^0.0.7",
|
|
47
47
|
"@telegraph/vite-config": "^0.0.15",
|
|
48
|
-
"@types/react": "^19.
|
|
48
|
+
"@types/react": "^19.2.9",
|
|
49
49
|
"eslint": "^8.56.0",
|
|
50
|
-
"react": "^19.
|
|
51
|
-
"react-dom": "^19.
|
|
50
|
+
"react": "^19.2.4",
|
|
51
|
+
"react-dom": "^19.2.4",
|
|
52
52
|
"typescript": "^5.9.3",
|
|
53
53
|
"vite": "^6.4.1"
|
|
54
54
|
},
|