@telegraph/input 0.0.47 → 0.0.49

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 CHANGED
@@ -1,5 +1,27 @@
1
1
  # @telegraph/input
2
2
 
3
+ ## 0.0.49
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [[`bca0117`](https://github.com/knocklabs/telegraph/commit/bca011776c3b8b96e4f46a049578fcd7a167e052)]:
8
+ - @telegraph/layout@0.2.0
9
+ - @telegraph/typography@0.1.22
10
+
11
+ ## 0.0.48
12
+
13
+ ### Patch Changes
14
+
15
+ - [#501](https://github.com/knocklabs/telegraph/pull/501) [`dc12662`](https://github.com/knocklabs/telegraph/commit/dc12662f6f41697d976d0978871a567d564777e8) Thanks [@kylemcd](https://github.com/kylemcd)! - deprecate usage of `@telegraph/motion` in favor of tiny `motion` package
16
+
17
+ - [#498](https://github.com/knocklabs/telegraph/pull/498) [`99e01e3`](https://github.com/knocklabs/telegraph/commit/99e01e3dcf7508af0bfae14e9b62cccff7af3388) Thanks [@kylemcd](https://github.com/kylemcd)! - update imports for the `Lucide` object from `@telegraph/icon` to import icons directly from `lucide-react` instead.
18
+
19
+ - [#497](https://github.com/knocklabs/telegraph/pull/497) [`2d3e1cd`](https://github.com/knocklabs/telegraph/commit/2d3e1cddd8a6bfac7108e350649f81bdc18f57c8) Thanks [@kylemcd](https://github.com/kylemcd)! - deprecate tailwind usage and migrate any remaining packages
20
+
21
+ - Updated dependencies [[`e554068`](https://github.com/knocklabs/telegraph/commit/e554068b0f9ca5a1e8fe9d6f27dd2a30373a3cc8), [`99e01e3`](https://github.com/knocklabs/telegraph/commit/99e01e3dcf7508af0bfae14e9b62cccff7af3388), [`2d3e1cd`](https://github.com/knocklabs/telegraph/commit/2d3e1cddd8a6bfac7108e350649f81bdc18f57c8)]:
22
+ - @telegraph/layout@0.1.21
23
+ - @telegraph/typography@0.1.21
24
+
3
25
  ## 0.0.47
4
26
 
5
27
  ### Patch Changes
package/dist/cjs/index.js CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),C=require("@radix-ui/react-slot"),I=require("@telegraph/compose-refs"),b=require("@telegraph/layout"),v=require("@telegraph/typography"),l=require("clsx"),s=require("react"),a={Container:{1:"h-6 pl-0 rounded-2",2:"h-8 pl-0 rounded-2",3:"h-10 pl-0 rounded-3"},Input:{1:"px-1",2:"px-2",3:"px-3"},Text:{1:"1",2:"2",3:"3"},Slot:{1:"[&>[data-tgph-button]]:rounded-1",2:"[&>[data-tgph-button]]:rounded-1",3:"[&>[data-tgph-button]]:rounded-2"},SlotLeading:{1:"order-1 pl-1",2:"order-1 pl-2",3:"order-1 pl-3"},SlotTrailing:{1:"order-3 pr-1",2:"order-3 pr-2",3:"order-3 pr-3"}},z={Container:{default:{outline:"bg-surface-1 border-gray-6 hover:border-gray-7 focus-within:!border-blue-8",ghost:"bg-transparent border-transparent hover:bg-gray-3 focus-within:!bg-gray-4 focus-within:!border-blue-8"},disabled:{outline:"cursor-not-allowed bg-gray-2 border-gray-2 [&_[data-tgph-icon]]:text-gray-8 placeholder:text-gray-9 [&>input]:text-gray-9",ghost:"cursor-not-allowed bg-transparent border border-transparent [&_[data-tgph-icon]]:text-gray-8 placeholder:text-gray-9 [&>input]:text-gray-9"},error:{outline:"bg-surface-1 border-red-6",ghost:"bg-transparent border-red-6"}}},h=s.createContext({state:"default",size:"2",variant:"outline"}),x=({as:r="input",size:t="2",variant:o="outline",textProps:n={size:a.Text[t],color:"default"},className:y,disabled:d,errored:j,children:m,tgphRef:S,...R})=>{const q=r,i=s.useRef(null),w=I.useComposedRefs(S,i),c=d?"disabled":j?"error":"default";return e.jsx(h.Provider,{value:{size:t,variant:o,state:c},children:e.jsxs(b.Box,{className:l("box-border flex items-center transition-all","border-[1px] border-solid text-gray-12 placeholder:text-gray-10",z.Container[c][o],a.Container[t]),onPointerDown:p=>{if(p.target.closest("button, a")){p.preventDefault();return}const g=i.current;g&&requestAnimationFrame(()=>{g.focus()})},children:[e.jsx(v.Text,{as:q,className:l("appearance-none border-none shadow-0 outline-0 bg-transparent","[font-family:inherit] h-full w-full","order-2",a.Input[t],y),disabled:d,...n,...R,tgphRef:w}),m]})})},u=s.forwardRef(({position:r="leading",...t},o)=>{const n=s.useContext(h);return e.jsx(b.Box,{className:l("group box-border flex items-center justify-center h-full","[&>[data-tgph-button]]:w-full [&>[data-tgph-button]]:h-auto","[&>[data-tgph-button-layout='icon-only']]:aspect-square [&>[data-tgph-button-layout='icon-only']]:p-0","[&>[data-tgph-button-layout='default']]:px-2","[&:has([data-tgph-button-layout='icon-only'])]:aspect-square","[&:has([data-tgph-button-layout='icon-only'])]:!p-1",r==="leading"&&a.SlotLeading[n.size],r==="trailing"&&a.SlotTrailing[n.size],a.Slot[t.size??n.size]),children:e.jsx(C.Slot,{size:n.size,...t,ref:o})})}),f=({LeadingComponent:r,TrailingComponent:t,...o})=>e.jsxs(x,{...o,children:[r&&e.jsx(u,{position:"leading",children:r}),t&&e.jsx(u,{position:"trailing",children:t})]});Object.assign(f,{Root:x,Slot:u});const T=f;exports.Input=T;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),_=require("@radix-ui/react-slot"),q=require("@telegraph/compose-refs"),b=require("@telegraph/layout"),w=require("@telegraph/typography"),s=require("react"),i={Container:{1:{h:"6",pl:"0",rounded:"2"},2:{h:"8",pl:"0",rounded:"2"},3:{h:"10",pl:"0",rounded:"2"}},Text:{1:{size:"1",px:"1"},2:{size:"2",px:"2"},3:{size:"3",px:"3"}},SlotLeading:{1:{pl:"1"},2:{pl:"2"},3:{pl:"3"}},SlotTrailing:{1:{pr:"1"},2:{pr:"2"},3:{pr:"3"}}},g={Container:{default:{outline:{bg:"surface-1",border:"px",borderColor:"gray-6",hover_borderColor:"gray-7",focus_within_borderColor:"blue-8"},ghost:{bg:"transparent",border:"px",borderColor:"transparent",hover_backgroundColor:"gray-3",hover_borderColor:"transparent",focus_within_backgroundColor:"gray-4",focus_within_borderColor:"blue-8"}},disabled:{outline:{bg:"gray-2",border:"px",borderColor:"gray-2"},ghost:{bg:"transparent",border:"px",borderColor:"transparent"}},error:{outline:{bg:"surface-1",border:"px",borderColor:"red-6"},ghost:{bg:"transparent",border:"px",borderColor:"red-6"}}},Text:{default:{color:"default"},disabled:{color:"disabled"},error:{color:"default"}}},f=s.createContext({state:"default",size:"2",variant:"outline"}),h=({as:e="input",size:t="2",variant:o="outline",textProps:n,disabled:u,errored:C,children:j,tgphRef:y,...S})=>{const R=e,d=s.useRef(null),z=q.useComposedRefs(y,d),a=u?"disabled":C?"error":"default";return r.jsx(f.Provider,{value:{size:t,variant:o,state:a},children:r.jsxs(b.Stack,{onPointerDown:c=>{if(c.target.closest("button, a")){c.preventDefault();return}const p=d.current;p&&requestAnimationFrame(()=>{p.focus()})},align:"center",...i.Container[t],...g.Container[a][o],"data-tgph-input-container":!0,"data-tgph-input-container-variant":o,"data-tgph-input-container-state":a,"data-tgph-input-container-size":t,children:[r.jsx(w.Text,{as:R,bg:"transparent",shadow:"0",h:"full",w:"full",disabled:u,tgphRef:z,...i.Text[t],...g.Text[a],...S,...n,"data-tgph-input-field":!0}),j]})})},l=s.forwardRef(({position:e="leading",...t},o)=>{const n=s.useContext(f);return r.jsx(b.Stack,{align:"center",justify:"center",h:"full","data-tgph-input-slot":!0,"data-tgph-input-slot-position":e,"data-tgph-input-slot-size":t.size??n.size,...e==="leading"&&i.SlotLeading[n.size],...e==="trailing"&&i.SlotTrailing[n.size],children:r.jsx(_.Slot,{size:n.size,...t,ref:o})})}),x=({LeadingComponent:e,TrailingComponent:t,...o})=>r.jsxs(h,{...o,children:[e&&r.jsx(l,{position:"leading",children:e}),t&&r.jsx(l,{position:"trailing",children:t})]});Object.assign(x,{Root:h,Slot:l});const T=x;exports.Input=T;
2
2
  //# sourceMappingURL=index.js.map
@@ -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\": \"h-6 pl-0 rounded-2\",\n \"2\": \"h-8 pl-0 rounded-2\",\n \"3\": \"h-10 pl-0 rounded-3\",\n },\n Input: {\n \"1\": \"px-1\",\n \"2\": \"px-2\",\n \"3\": \"px-3\",\n },\n Text: {\n \"1\": \"1\",\n \"2\": \"2\",\n \"3\": \"3\",\n },\n Slot: {\n \"1\": \"[&>[data-tgph-button]]:rounded-1\",\n \"2\": \"[&>[data-tgph-button]]:rounded-1\",\n \"3\": \"[&>[data-tgph-button]]:rounded-2\",\n },\n SlotLeading: {\n \"1\": \"order-1 pl-1\",\n \"2\": \"order-1 pl-2\",\n \"3\": \"order-1 pl-3\",\n },\n SlotTrailing: {\n \"1\": \"order-3 pr-1\",\n \"2\": \"order-3 pr-2\",\n \"3\": \"order-3 pr-3\",\n },\n} as const;\n\nexport const COLOR = {\n Container: {\n default: {\n outline:\n \"bg-surface-1 border-gray-6 hover:border-gray-7 focus-within:!border-blue-8\",\n ghost:\n \"bg-transparent border-transparent hover:bg-gray-3 focus-within:!bg-gray-4 focus-within:!border-blue-8\",\n },\n disabled: {\n outline:\n \"cursor-not-allowed bg-gray-2 border-gray-2 [&_[data-tgph-icon]]:text-gray-8 placeholder:text-gray-9 [&>input]:text-gray-9\",\n ghost:\n \"cursor-not-allowed bg-transparent border border-transparent [&_[data-tgph-icon]]:text-gray-8 placeholder:text-gray-9 [&>input]:text-gray-9\",\n },\n error: {\n outline: \"bg-surface-1 border-red-6\",\n ghost: \"bg-transparent border-red-6\",\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 PolymorphicPropsWithTgphRef,\n Required,\n TgphComponentProps,\n TgphElement,\n} from \"@telegraph/helpers\";\nimport { Box } from \"@telegraph/layout\";\nimport { Text } from \"@telegraph/typography\";\nimport clsx from \"clsx\";\nimport React from \"react\";\n\nimport { COLOR, SIZE } from \"./Input.constants\";\n\ntype BaseRootProps = {\n size?: keyof typeof SIZE.Container;\n variant?: keyof typeof COLOR.Container.default;\n errored?: boolean;\n};\n\ntype RootProps<T extends TgphElement> = Omit<\n PolymorphicPropsWithTgphRef<T, HTMLInputElement>,\n \"size\"\n> &\n BaseRootProps & {\n textProps?: Omit<React.ComponentProps<typeof Text<\"input\">>, \"as\">;\n };\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 = { size: SIZE.Text[size], color: \"default\" },\n className,\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 <Box\n className={clsx(\n \"box-border flex items-center transition-all\",\n \"border-[1px] border-solid text-gray-12 placeholder:text-gray-10\",\n COLOR.Container[state][variant],\n SIZE.Container[size],\n )}\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 >\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 className={clsx(\n \"appearance-none border-none shadow-0 outline-0 bg-transparent\",\n \"[font-family:inherit] h-full w-full\",\n \"order-2\",\n SIZE.Input[size],\n className,\n )}\n disabled={disabled}\n {...textProps}\n {...props}\n tgphRef={composedRefs}\n />\n {children}\n </Box>\n </InputContext.Provider>\n );\n};\n\ntype SlotProps = React.ComponentPropsWithoutRef<typeof RadixSlot> & {\n size?: keyof typeof SIZE.Slot;\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 <Box\n className={clsx(\n \"group box-border flex items-center justify-center h-full\",\n \"[&>[data-tgph-button]]:w-full [&>[data-tgph-button]]:h-auto\",\n // Overrides to match the icon button in figma\n \"[&>[data-tgph-button-layout='icon-only']]:aspect-square [&>[data-tgph-button-layout='icon-only']]:p-0\",\n // Overrides default button layout to match the button in figma\n \"[&>[data-tgph-button-layout='default']]:px-2\",\n // If only an icon button is present, set the aspect ratio to square\n \"[&:has([data-tgph-button-layout='icon-only'])]:aspect-square\",\n // If only an icon button is present, reset the padding to spacing-1\n \"[&:has([data-tgph-button-layout='icon-only'])]:!p-1\",\n position === \"leading\" && SIZE.SlotLeading[context.size],\n position === \"trailing\" && SIZE.SlotTrailing[context.size],\n SIZE.Slot[props.size ?? context.size],\n )}\n >\n <RadixSlot size={context.size} {...props} ref={forwardedRef} />\n </Box>\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","className","disabled","errored","children","tgphRef","props","Component","inputRef","composedRefs","useComposedRefs","state","jsx","jsxs","Box","clsx","event","input","Text","Slot","position","forwardedRef","context","RadixSlot","Default","LeadingComponent","TrailingComponent","Input"],"mappings":"mSAAaA,EAAO,CAClB,UAAW,CACT,EAAK,qBACL,EAAK,qBACL,EAAK,qBACP,EACA,MAAO,CACL,EAAK,OACL,EAAK,OACL,EAAK,MACP,EACA,KAAM,CACJ,EAAK,IACL,EAAK,IACL,EAAK,GACP,EACA,KAAM,CACJ,EAAK,mCACL,EAAK,mCACL,EAAK,kCACP,EACA,YAAa,CACX,EAAK,eACL,EAAK,eACL,EAAK,cACP,EACA,aAAc,CACZ,EAAK,eACL,EAAK,eACL,EAAK,cAAA,CAET,EAEaC,EAAQ,CACnB,UAAW,CACT,QAAS,CACP,QACE,6EACF,MACE,uGACJ,EACA,SAAU,CACR,QACE,4HACF,MACE,4IACJ,EACA,MAAO,CACL,QAAS,4BACT,MAAO,6BAAA,CACT,CAEJ,EClBMC,EAAeC,EAAM,cAAuC,CAChE,MAAO,UACP,KAAM,IACN,QAAS,SACX,CAAC,EAEKC,EAAO,CAAwB,CACnC,GAAAC,EAAK,QACL,KAAAC,EAAO,IACP,QAAAC,EAAU,UACV,UAAAC,EAAY,CAAE,KAAMR,EAAK,KAAKM,CAAI,EAAG,MAAO,SAAU,EACtD,UAAAG,EACA,SAAAC,EACA,QAAAC,EACA,SAAAC,EACA,QAAAC,EACA,GAAGC,CACL,IAAoB,CAClB,MAAMC,EAAYV,EACZW,EAAWb,EAAM,OAAyB,IAAI,EAC9Cc,EAAeC,EAAAA,gBAAgBL,EAASG,CAAQ,EAEhDG,EAAQT,EAAW,WAAaC,EAAU,QAAU,UAGxD,OAAAS,MAAClB,EAAa,SAAb,CAAsB,MAAO,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,SAAS,UAAW,SAAiBM,EAAA,EAC/DC,GACCd,EAAA,IAACO,EAAK,CAAA,SAAS,WAAY,SAAkBO,CAAA,CAAA,CAAA,EAEjD,EAIJ,OAAO,OAAOF,EAAS,CAAE,KAAA5B,EAAM,KAAAuB,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\",\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} & 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 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 >\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","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,GAAA,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,QAAS,CACP,GAAI,YACJ,OAAQ,KACR,YAAa,OAAA,EAEf,MAAO,CACL,GAAI,cACJ,OAAQ,KACR,YAAa,OAAA,CACf,CACF,EAEF,KAAM,CACJ,QA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AM,WACjB,CAAC,CAAE,SAAAuB,EAAW,UAAW,GAAGb,CAAA,EAASc,IAAiB,CACpD,MAAMC,EAAUzB,EAAM,WAAWD,CAAY,EAC7C,OACEiB,EAAAA,IAACE,EAAAA,MAAA,CACC,MAAM,SACN,QAAQ,SACR,EAAE,OACF,uBAAoB,GACpB,gCAA+BK,EAC/B,4BAA2Bb,EAAM,MAAQe,EAAQ,KAChD,GAAIF,IAAa,WAAa1B,EAAK,YAAY4B,EAAQ,IAAI,EAC3D,GAAIF,IAAa,YAAc1B,EAAK,aAAa4B,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,KAAChB,EAAA,CAAM,GAAGS,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,KAAA1B,EAAM,KAAAqB,EAAM,EAErC,MAAMQ,EAAQH"}
@@ -1 +1 @@
1
- .tgph .order-1{order:1}.tgph .order-2{order:2}.tgph .order-3{order:3}.tgph .box-border{box-sizing:border-box}.tgph .flex{display:flex}.tgph .aspect-square{aspect-ratio:1 / 1}.tgph .h-10{height:var(--tgph-spacing-10)}.tgph .h-6{height:var(--tgph-spacing-6)}.tgph .h-8{height:var(--tgph-spacing-8)}.tgph .h-full{height:var(--tgph-spacing-full)}.tgph .w-full{width:var(--tgph-spacing-full)}.tgph .cursor-not-allowed{cursor:not-allowed}.tgph .appearance-none{-webkit-appearance:none;-moz-appearance:none;appearance:none}.tgph .items-center{align-items:center}.tgph .justify-center{justify-content:center}.tgph .rounded-2{border-radius:var(--tgph-rounded-2)}.tgph .rounded-3{border-radius:var(--tgph-rounded-3)}.tgph .border,.tgph .border-\[1px\]{border-width:1px}.tgph .border-solid{border-style:solid}.tgph .border-none{border-style:none}.tgph .border-gray-2{border-color:var(--tgph-gray-2)}.tgph .border-gray-6{border-color:var(--tgph-gray-6)}.tgph .border-red-6{border-color:var(--tgph-red-6)}.tgph .border-transparent{border-color:var(--tgph-transparent)}.tgph .bg-gray-2{background-color:var(--tgph-gray-2)}.tgph .bg-surface-1{background-color:var(--tgph-surface-1)}.tgph .bg-transparent{background-color:var(--tgph-transparent)}.tgph .\!p-1{padding:var(--tgph-spacing-1)!important}.tgph .px-1{padding-left:var(--tgph-spacing-1);padding-right:var(--tgph-spacing-1)}.tgph .px-2{padding-left:var(--tgph-spacing-2);padding-right:var(--tgph-spacing-2)}.tgph .px-3{padding-left:var(--tgph-spacing-3);padding-right:var(--tgph-spacing-3)}.tgph .pl-0{padding-left:var(--tgph-spacing-0)}.tgph .pl-1{padding-left:var(--tgph-spacing-1)}.tgph .pl-2{padding-left:var(--tgph-spacing-2)}.tgph .pl-3{padding-left:var(--tgph-spacing-3)}.tgph .pr-1{padding-right:var(--tgph-spacing-1)}.tgph .pr-2{padding-right:var(--tgph-spacing-2)}.tgph .pr-3{padding-right:var(--tgph-spacing-3)}.tgph .text-gray-12{color:var(--tgph-gray-12)}.tgph .shadow-0{--tw-shadow: var(--tgph-shadow-0);--tw-shadow-colored: var(--tgph-shadow-0);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.tgph .outline{outline-style:solid}.tgph .outline-0{outline-width:0px}.tgph .transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.tgph .\[font-family\:inherit\]{font-family:inherit}.tgph .placeholder\:text-gray-10::-moz-placeholder{color:var(--tgph-gray-10)}.tgph .placeholder\:text-gray-10::placeholder{color:var(--tgph-gray-10)}.tgph .placeholder\:text-gray-9::-moz-placeholder{color:var(--tgph-gray-9)}.tgph .placeholder\:text-gray-9::placeholder{color:var(--tgph-gray-9)}.tgph .focus-within\:\!border-blue-8:focus-within{border-color:var(--tgph-blue-8)!important}.tgph .focus-within\:\!bg-gray-4:focus-within{background-color:var(--tgph-gray-4)!important}.tgph .hover\:border-gray-7:hover{border-color:var(--tgph-gray-7)}.tgph .hover\:bg-gray-3:hover{background-color:var(--tgph-gray-3)}.tgph .\[\&\:has\(\[data-tgph-button-layout\=\'icon-only\'\]\)\]\:aspect-square:has([data-tgph-button-layout=icon-only]){aspect-ratio:1 / 1}.tgph .\[\&\:has\(\[data-tgph-button-layout\=\'icon-only\'\]\)\]\:\!p-1:has([data-tgph-button-layout=icon-only]){padding:var(--tgph-spacing-1)!important}.tgph :is(.\[\&\>\[data-tgph-button-layout\=\'default\'\]\]\:px-2>[data-tgph-button-layout=default]){padding-left:var(--tgph-spacing-2);padding-right:var(--tgph-spacing-2)}.tgph :is(.\[\&\>\[data-tgph-button-layout\=\'icon-only\'\]\]\:aspect-square>[data-tgph-button-layout=icon-only]){aspect-ratio:1 / 1}.tgph :is(.\[\&\>\[data-tgph-button-layout\=\'icon-only\'\]\]\:p-0>[data-tgph-button-layout=icon-only]){padding:var(--tgph-spacing-0)}.tgph :is(.\[\&\>\[data-tgph-button\]\]\:h-auto>[data-tgph-button]){height:var(--tgph-spacing-auto)}.tgph :is(.\[\&\>\[data-tgph-button\]\]\:w-full>[data-tgph-button]){width:var(--tgph-spacing-full)}.tgph :is(.\[\&\>\[data-tgph-button\]\]\:rounded-1>[data-tgph-button]){border-radius:var(--tgph-rounded-1)}.tgph :is(.\[\&\>\[data-tgph-button\]\]\:rounded-2>[data-tgph-button]){border-radius:var(--tgph-rounded-2)}.tgph :is(.\[\&\>input\]\:text-gray-9>input){color:var(--tgph-gray-9)}.tgph :is(.\[\&_\[data-tgph-icon\]\]\:text-gray-8 [data-tgph-icon]){color:var(--tgph-gray-8)}
1
+ [data-tgph-input-container]{box-sizing:border-box}[data-tgph-input-slot]{box-sizing:border-box;order:2}[data-tgph-input-slot]>[data-tgph-button]{width:var(--tgph-spacing-full);height:var(--tgph-spacing-auto)}[data-tgph-input-slot]>[data-tgph-button-layout=icon-only]{aspect-ratio:1;padding:var(--tgph-spacing-0)}[data-tgph-input-slot]>[data-tgph-button-layout=default]{padding:var(--tgph-spacing-2)}[data-tgph-input-slot]:has([data-tgph-button-layout=icon-only]){aspect-ratio:1}[data-tgph-input-slot]:has([data-tgph-button-layout=icon-only]){padding:var(--tgph-spacing-1)!important}[data-tgph-input-slot-position=leading]{order:1}[data-tgph-input-slot-position=trailing]{order:3}[data-tgph-input-slot-size="1"]>[data-tgph-button]{border-radius:var(--tgph-rounded-1)}[data-tgph-input-slot-size="2"]>[data-tgph-button]{border-radius:var(--tgph-rounded-1)}[data-tgph-input-slot-size="3"]>[data-tgph-button]{border-radius:var(--tgph-rounded-2)}[data-tgph-input-container-state=disabled]{cursor:not-allowed}[data-tgph-input-field]{-webkit-appearance:none;-moz-appearance:none;appearance:none;outline:none;border:none;box-shadow:none;order:2;font-family:inherit}
@@ -1,57 +1,120 @@
1
- import { jsx as a, jsxs as b } from "react/jsx-runtime";
2
- import { Slot as j } from "@radix-ui/react-slot";
3
- import { useComposedRefs as v } from "@telegraph/compose-refs";
4
- import { Box as h } from "@telegraph/layout";
5
- import { Text as T } from "@telegraph/typography";
6
- import d from "clsx";
7
- import l from "react";
8
- const n = {
1
+ import { jsx as n, jsxs as f } from "react/jsx-runtime";
2
+ import { Slot as y } from "@radix-ui/react-slot";
3
+ import { useComposedRefs as T } from "@telegraph/compose-refs";
4
+ import { Stack as b } from "@telegraph/layout";
5
+ import { Text as v } from "@telegraph/typography";
6
+ import i from "react";
7
+ const l = {
9
8
  Container: {
10
- 1: "h-6 pl-0 rounded-2",
11
- 2: "h-8 pl-0 rounded-2",
12
- 3: "h-10 pl-0 rounded-3"
13
- },
14
- Input: {
15
- 1: "px-1",
16
- 2: "px-2",
17
- 3: "px-3"
9
+ 1: {
10
+ h: "6",
11
+ pl: "0",
12
+ rounded: "2"
13
+ },
14
+ 2: {
15
+ h: "8",
16
+ pl: "0",
17
+ rounded: "2"
18
+ },
19
+ 3: {
20
+ h: "10",
21
+ pl: "0",
22
+ rounded: "2"
23
+ }
18
24
  },
19
25
  Text: {
20
- 1: "1",
21
- 2: "2",
22
- 3: "3"
23
- },
24
- Slot: {
25
- 1: "[&>[data-tgph-button]]:rounded-1",
26
- 2: "[&>[data-tgph-button]]:rounded-1",
27
- 3: "[&>[data-tgph-button]]:rounded-2"
26
+ 1: {
27
+ size: "1",
28
+ px: "1"
29
+ },
30
+ 2: {
31
+ size: "2",
32
+ px: "2"
33
+ },
34
+ 3: {
35
+ size: "3",
36
+ px: "3"
37
+ }
28
38
  },
29
39
  SlotLeading: {
30
- 1: "order-1 pl-1",
31
- 2: "order-1 pl-2",
32
- 3: "order-1 pl-3"
40
+ 1: {
41
+ pl: "1"
42
+ },
43
+ 2: {
44
+ pl: "2"
45
+ },
46
+ 3: {
47
+ pl: "3"
48
+ }
33
49
  },
34
50
  SlotTrailing: {
35
- 1: "order-3 pr-1",
36
- 2: "order-3 pr-2",
37
- 3: "order-3 pr-3"
51
+ 1: {
52
+ pr: "1"
53
+ },
54
+ 2: {
55
+ pr: "2"
56
+ },
57
+ 3: {
58
+ pr: "3"
59
+ }
38
60
  }
39
- }, q = {
61
+ }, g = {
40
62
  Container: {
41
63
  default: {
42
- outline: "bg-surface-1 border-gray-6 hover:border-gray-7 focus-within:!border-blue-8",
43
- ghost: "bg-transparent border-transparent hover:bg-gray-3 focus-within:!bg-gray-4 focus-within:!border-blue-8"
64
+ outline: {
65
+ bg: "surface-1",
66
+ border: "px",
67
+ borderColor: "gray-6",
68
+ hover_borderColor: "gray-7",
69
+ focus_within_borderColor: "blue-8"
70
+ },
71
+ ghost: {
72
+ bg: "transparent",
73
+ border: "px",
74
+ borderColor: "transparent",
75
+ hover_backgroundColor: "gray-3",
76
+ hover_borderColor: "transparent",
77
+ focus_within_backgroundColor: "gray-4",
78
+ focus_within_borderColor: "blue-8"
79
+ }
80
+ },
81
+ disabled: {
82
+ outline: {
83
+ bg: "gray-2",
84
+ border: "px",
85
+ borderColor: "gray-2"
86
+ },
87
+ ghost: {
88
+ bg: "transparent",
89
+ border: "px",
90
+ borderColor: "transparent"
91
+ }
92
+ },
93
+ error: {
94
+ outline: {
95
+ bg: "surface-1",
96
+ border: "px",
97
+ borderColor: "red-6"
98
+ },
99
+ ghost: {
100
+ bg: "transparent",
101
+ border: "px",
102
+ borderColor: "red-6"
103
+ }
104
+ }
105
+ },
106
+ Text: {
107
+ default: {
108
+ color: "default"
44
109
  },
45
110
  disabled: {
46
- outline: "cursor-not-allowed bg-gray-2 border-gray-2 [&_[data-tgph-icon]]:text-gray-8 placeholder:text-gray-9 [&>input]:text-gray-9",
47
- ghost: "cursor-not-allowed bg-transparent border border-transparent [&_[data-tgph-icon]]:text-gray-8 placeholder:text-gray-9 [&>input]:text-gray-9"
111
+ color: "disabled"
48
112
  },
49
113
  error: {
50
- outline: "bg-surface-1 border-red-6",
51
- ghost: "bg-transparent border-red-6"
114
+ color: "default"
52
115
  }
53
116
  }
54
- }, f = l.createContext({
117
+ }, h = i.createContext({
55
118
  state: "default",
56
119
  size: "2",
57
120
  variant: "outline"
@@ -59,92 +122,85 @@ const n = {
59
122
  as: r = "input",
60
123
  size: t = "2",
61
124
  variant: e = "outline",
62
- textProps: o = { size: n.Text[t], color: "default" },
63
- className: m,
64
- disabled: u,
65
- errored: w,
66
- children: S,
125
+ textProps: o,
126
+ disabled: d,
127
+ errored: m,
128
+ children: z,
67
129
  tgphRef: R,
68
- ...C
130
+ ...S
69
131
  }) => {
70
- const z = r, i = l.useRef(null), I = v(R, i), p = u ? "disabled" : w ? "error" : "default";
71
- return /* @__PURE__ */ a(f.Provider, { value: { size: t, variant: e, state: p }, children: /* @__PURE__ */ b(
72
- h,
132
+ const _ = r, u = i.useRef(null), w = T(R, u), a = d ? "disabled" : m ? "error" : "default";
133
+ return /* @__PURE__ */ n(h.Provider, { value: { size: t, variant: e, state: a }, children: /* @__PURE__ */ f(
134
+ b,
73
135
  {
74
- className: d(
75
- "box-border flex items-center transition-all",
76
- "border-[1px] border-solid text-gray-12 placeholder:text-gray-10",
77
- q.Container[p][e],
78
- n.Container[t]
79
- ),
80
- onPointerDown: (c) => {
81
- if (c.target.closest("button, a")) {
82
- c.preventDefault();
136
+ onPointerDown: (p) => {
137
+ if (p.target.closest("button, a")) {
138
+ p.preventDefault();
83
139
  return;
84
140
  }
85
- const g = i.current;
86
- g && requestAnimationFrame(() => {
87
- g.focus();
141
+ const c = u.current;
142
+ c && requestAnimationFrame(() => {
143
+ c.focus();
88
144
  });
89
145
  },
146
+ align: "center",
147
+ ...l.Container[t],
148
+ ...g.Container[a][e],
149
+ "data-tgph-input-container": !0,
150
+ "data-tgph-input-container-variant": e,
151
+ "data-tgph-input-container-state": a,
152
+ "data-tgph-input-container-size": t,
90
153
  children: [
91
- /* @__PURE__ */ a(
92
- T,
154
+ /* @__PURE__ */ n(
155
+ v,
93
156
  {
94
- as: z,
95
- className: d(
96
- "appearance-none border-none shadow-0 outline-0 bg-transparent",
97
- "[font-family:inherit] h-full w-full",
98
- "order-2",
99
- n.Input[t],
100
- m
101
- ),
102
- disabled: u,
157
+ as: _,
158
+ bg: "transparent",
159
+ shadow: "0",
160
+ h: "full",
161
+ w: "full",
162
+ disabled: d,
163
+ tgphRef: w,
164
+ ...l.Text[t],
165
+ ...g.Text[a],
166
+ ...S,
103
167
  ...o,
104
- ...C,
105
- tgphRef: I
168
+ "data-tgph-input-field": !0
106
169
  }
107
170
  ),
108
- S
171
+ z
109
172
  ]
110
173
  }
111
174
  ) });
112
- }, s = l.forwardRef(
175
+ }, s = i.forwardRef(
113
176
  ({ position: r = "leading", ...t }, e) => {
114
- const o = l.useContext(f);
115
- return /* @__PURE__ */ a(
116
- h,
177
+ const o = i.useContext(h);
178
+ return /* @__PURE__ */ n(
179
+ b,
117
180
  {
118
- className: d(
119
- "group box-border flex items-center justify-center h-full",
120
- "[&>[data-tgph-button]]:w-full [&>[data-tgph-button]]:h-auto",
121
- // Overrides to match the icon button in figma
122
- "[&>[data-tgph-button-layout='icon-only']]:aspect-square [&>[data-tgph-button-layout='icon-only']]:p-0",
123
- // Overrides default button layout to match the button in figma
124
- "[&>[data-tgph-button-layout='default']]:px-2",
125
- // If only an icon button is present, set the aspect ratio to square
126
- "[&:has([data-tgph-button-layout='icon-only'])]:aspect-square",
127
- // If only an icon button is present, reset the padding to spacing-1
128
- "[&:has([data-tgph-button-layout='icon-only'])]:!p-1",
129
- r === "leading" && n.SlotLeading[o.size],
130
- r === "trailing" && n.SlotTrailing[o.size],
131
- n.Slot[t.size ?? o.size]
132
- ),
133
- children: /* @__PURE__ */ a(j, { size: o.size, ...t, ref: e })
181
+ align: "center",
182
+ justify: "center",
183
+ h: "full",
184
+ "data-tgph-input-slot": !0,
185
+ "data-tgph-input-slot-position": r,
186
+ "data-tgph-input-slot-size": t.size ?? o.size,
187
+ ...r === "leading" && l.SlotLeading[o.size],
188
+ ...r === "trailing" && l.SlotTrailing[o.size],
189
+ children: /* @__PURE__ */ n(y, { size: o.size, ...t, ref: e })
134
190
  }
135
191
  );
136
192
  }
137
- ), y = ({
193
+ ), C = ({
138
194
  LeadingComponent: r,
139
195
  TrailingComponent: t,
140
196
  ...e
141
- }) => /* @__PURE__ */ b(x, { ...e, children: [
142
- r && /* @__PURE__ */ a(s, { position: "leading", children: r }),
143
- t && /* @__PURE__ */ a(s, { position: "trailing", children: t })
197
+ }) => /* @__PURE__ */ f(x, { ...e, children: [
198
+ r && /* @__PURE__ */ n(s, { position: "leading", children: r }),
199
+ t && /* @__PURE__ */ n(s, { position: "trailing", children: t })
144
200
  ] });
145
- Object.assign(y, { Root: x, Slot: s });
146
- const E = y;
201
+ Object.assign(C, { Root: x, Slot: s });
202
+ const q = C;
147
203
  export {
148
- E as Input
204
+ q as Input
149
205
  };
150
206
  //# sourceMappingURL=index.mjs.map
@@ -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\": \"h-6 pl-0 rounded-2\",\n \"2\": \"h-8 pl-0 rounded-2\",\n \"3\": \"h-10 pl-0 rounded-3\",\n },\n Input: {\n \"1\": \"px-1\",\n \"2\": \"px-2\",\n \"3\": \"px-3\",\n },\n Text: {\n \"1\": \"1\",\n \"2\": \"2\",\n \"3\": \"3\",\n },\n Slot: {\n \"1\": \"[&>[data-tgph-button]]:rounded-1\",\n \"2\": \"[&>[data-tgph-button]]:rounded-1\",\n \"3\": \"[&>[data-tgph-button]]:rounded-2\",\n },\n SlotLeading: {\n \"1\": \"order-1 pl-1\",\n \"2\": \"order-1 pl-2\",\n \"3\": \"order-1 pl-3\",\n },\n SlotTrailing: {\n \"1\": \"order-3 pr-1\",\n \"2\": \"order-3 pr-2\",\n \"3\": \"order-3 pr-3\",\n },\n} as const;\n\nexport const COLOR = {\n Container: {\n default: {\n outline:\n \"bg-surface-1 border-gray-6 hover:border-gray-7 focus-within:!border-blue-8\",\n ghost:\n \"bg-transparent border-transparent hover:bg-gray-3 focus-within:!bg-gray-4 focus-within:!border-blue-8\",\n },\n disabled: {\n outline:\n \"cursor-not-allowed bg-gray-2 border-gray-2 [&_[data-tgph-icon]]:text-gray-8 placeholder:text-gray-9 [&>input]:text-gray-9\",\n ghost:\n \"cursor-not-allowed bg-transparent border border-transparent [&_[data-tgph-icon]]:text-gray-8 placeholder:text-gray-9 [&>input]:text-gray-9\",\n },\n error: {\n outline: \"bg-surface-1 border-red-6\",\n ghost: \"bg-transparent border-red-6\",\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 PolymorphicPropsWithTgphRef,\n Required,\n TgphComponentProps,\n TgphElement,\n} from \"@telegraph/helpers\";\nimport { Box } from \"@telegraph/layout\";\nimport { Text } from \"@telegraph/typography\";\nimport clsx from \"clsx\";\nimport React from \"react\";\n\nimport { COLOR, SIZE } from \"./Input.constants\";\n\ntype BaseRootProps = {\n size?: keyof typeof SIZE.Container;\n variant?: keyof typeof COLOR.Container.default;\n errored?: boolean;\n};\n\ntype RootProps<T extends TgphElement> = Omit<\n PolymorphicPropsWithTgphRef<T, HTMLInputElement>,\n \"size\"\n> &\n BaseRootProps & {\n textProps?: Omit<React.ComponentProps<typeof Text<\"input\">>, \"as\">;\n };\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 = { size: SIZE.Text[size], color: \"default\" },\n className,\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 <Box\n className={clsx(\n \"box-border flex items-center transition-all\",\n \"border-[1px] border-solid text-gray-12 placeholder:text-gray-10\",\n COLOR.Container[state][variant],\n SIZE.Container[size],\n )}\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 >\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 className={clsx(\n \"appearance-none border-none shadow-0 outline-0 bg-transparent\",\n \"[font-family:inherit] h-full w-full\",\n \"order-2\",\n SIZE.Input[size],\n className,\n )}\n disabled={disabled}\n {...textProps}\n {...props}\n tgphRef={composedRefs}\n />\n {children}\n </Box>\n </InputContext.Provider>\n );\n};\n\ntype SlotProps = React.ComponentPropsWithoutRef<typeof RadixSlot> & {\n size?: keyof typeof SIZE.Slot;\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 <Box\n className={clsx(\n \"group box-border flex items-center justify-center h-full\",\n \"[&>[data-tgph-button]]:w-full [&>[data-tgph-button]]:h-auto\",\n // Overrides to match the icon button in figma\n \"[&>[data-tgph-button-layout='icon-only']]:aspect-square [&>[data-tgph-button-layout='icon-only']]:p-0\",\n // Overrides default button layout to match the button in figma\n \"[&>[data-tgph-button-layout='default']]:px-2\",\n // If only an icon button is present, set the aspect ratio to square\n \"[&:has([data-tgph-button-layout='icon-only'])]:aspect-square\",\n // If only an icon button is present, reset the padding to spacing-1\n \"[&:has([data-tgph-button-layout='icon-only'])]:!p-1\",\n position === \"leading\" && SIZE.SlotLeading[context.size],\n position === \"trailing\" && SIZE.SlotTrailing[context.size],\n SIZE.Slot[props.size ?? context.size],\n )}\n >\n <RadixSlot size={context.size} {...props} ref={forwardedRef} />\n </Box>\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","className","disabled","errored","children","tgphRef","props","Component","inputRef","composedRefs","useComposedRefs","state","jsx","jsxs","Box","clsx","event","input","Text","Slot","position","forwardedRef","context","RadixSlot","Default","LeadingComponent","TrailingComponent","Input"],"mappings":";;;;;;;AAAO,MAAMA,IAAO;AAAA,EAClB,WAAW;AAAA,IACT,GAAK;AAAA,IACL,GAAK;AAAA,IACL,GAAK;AAAA,EACP;AAAA,EACA,OAAO;AAAA,IACL,GAAK;AAAA,IACL,GAAK;AAAA,IACL,GAAK;AAAA,EACP;AAAA,EACA,MAAM;AAAA,IACJ,GAAK;AAAA,IACL,GAAK;AAAA,IACL,GAAK;AAAA,EACP;AAAA,EACA,MAAM;AAAA,IACJ,GAAK;AAAA,IACL,GAAK;AAAA,IACL,GAAK;AAAA,EACP;AAAA,EACA,aAAa;AAAA,IACX,GAAK;AAAA,IACL,GAAK;AAAA,IACL,GAAK;AAAA,EACP;AAAA,EACA,cAAc;AAAA,IACZ,GAAK;AAAA,IACL,GAAK;AAAA,IACL,GAAK;AAAA,EAAA;AAET,GAEaC,IAAQ;AAAA,EACnB,WAAW;AAAA,IACT,SAAS;AAAA,MACP,SACE;AAAA,MACF,OACE;AAAA,IACJ;AAAA,IACA,UAAU;AAAA,MACR,SACE;AAAA,MACF,OACE;AAAA,IACJ;AAAA,IACA,OAAO;AAAA,MACL,SAAS;AAAA,MACT,OAAO;AAAA,IAAA;AAAA,EACT;AAEJ,GClBMC,IAAeC,EAAM,cAAuC;AAAA,EAChE,OAAO;AAAA,EACP,MAAM;AAAA,EACN,SAAS;AACX,CAAC,GAEKC,IAAO,CAAwB;AAAA,EACnC,IAAAC,IAAK;AAAA,EACL,MAAAC,IAAO;AAAA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jB,CAAC,EAAE,UAAAyB,IAAW,WAAW,GAAGd,EAAA,GAASe,MAAiB;AAC9C,UAAAC,IAAU3B,EAAM,WAAWD,CAAY;AAE3C,WAAA,gBAAAkB;AAAA,MAACE;AAAA,MAAA;AAAA,QACC,WAAWC;AAAA,UACT;AAAA,UACA;AAAA;AAAA,UAEA;AAAA;AAAA,UAEA;AAAA;AAAA,UAEA;AAAA;AAAA,UAEA;AAAA,UACAK,MAAa,aAAa5B,EAAK,YAAY8B,EAAQ,IAAI;AAAA,UACvDF,MAAa,cAAc5B,EAAK,aAAa8B,EAAQ,IAAI;AAAA,UACzD9B,EAAK,KAAKc,EAAM,QAAQgB,EAAQ,IAAI;AAAA,QACtC;AAAA,QAEA,UAAA,gBAAAV,EAACW,KAAU,MAAMD,EAAQ,MAAO,GAAGhB,GAAO,KAAKe,EAAc,CAAA;AAAA,MAAA;AAAA,IAC/D;AAAA,EAAA;AAGN,GAQMG,IAAU,CAAwB;AAAA,EACtC,kBAAAC;AAAA,EACA,mBAAAC;AAAA,EACA,GAAGpB;AACL,MAEI,gBAAAO,EAACjB,GAAM,EAAA,GAAGU,GACP,UAAA;AAAA,EAAAmB,KAAqB,gBAAAb,EAAAO,GAAA,EAAK,UAAS,WAAW,UAAiBM,GAAA;AAAA,EAC/DC,KACC,gBAAAd,EAACO,GAAK,EAAA,UAAS,YAAY,UAAkBO,EAAA,CAAA;AAAA,GAEjD;AAIJ,OAAO,OAAOF,GAAS,EAAE,MAAA5B,GAAM,MAAAuB,GAAM;AAErC,MAAMQ,IAAQH;"}
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\",\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} & 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 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 >\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","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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UAAS,WAAW,UAAAM,GAAiB;AAAA,EAC/DC,KACC,gBAAAb,EAACM,GAAA,EAAK,UAAS,YAAY,UAAAO,EAAA,CAAkB;AAAA,GAEjD;AAIJ,OAAO,OAAOF,GAAS,EAAE,MAAA1B,GAAM,MAAAqB,GAAM;AAErC,MAAMQ,IAAQH;"}
@@ -1,48 +1,112 @@
1
1
  export declare const SIZE: {
2
2
  readonly Container: {
3
- readonly "1": "h-6 pl-0 rounded-2";
4
- readonly "2": "h-8 pl-0 rounded-2";
5
- readonly "3": "h-10 pl-0 rounded-3";
6
- };
7
- readonly Input: {
8
- readonly "1": "px-1";
9
- readonly "2": "px-2";
10
- readonly "3": "px-3";
3
+ readonly "1": {
4
+ readonly h: "6";
5
+ readonly pl: "0";
6
+ readonly rounded: "2";
7
+ };
8
+ readonly "2": {
9
+ readonly h: "8";
10
+ readonly pl: "0";
11
+ readonly rounded: "2";
12
+ };
13
+ readonly "3": {
14
+ readonly h: "10";
15
+ readonly pl: "0";
16
+ readonly rounded: "2";
17
+ };
11
18
  };
12
19
  readonly Text: {
13
- readonly "1": "1";
14
- readonly "2": "2";
15
- readonly "3": "3";
16
- };
17
- readonly Slot: {
18
- readonly "1": "[&>[data-tgph-button]]:rounded-1";
19
- readonly "2": "[&>[data-tgph-button]]:rounded-1";
20
- readonly "3": "[&>[data-tgph-button]]:rounded-2";
20
+ readonly "1": {
21
+ readonly size: "1";
22
+ readonly px: "1";
23
+ };
24
+ readonly "2": {
25
+ readonly size: "2";
26
+ readonly px: "2";
27
+ };
28
+ readonly "3": {
29
+ readonly size: "3";
30
+ readonly px: "3";
31
+ };
21
32
  };
22
33
  readonly SlotLeading: {
23
- readonly "1": "order-1 pl-1";
24
- readonly "2": "order-1 pl-2";
25
- readonly "3": "order-1 pl-3";
34
+ readonly "1": {
35
+ readonly pl: "1";
36
+ };
37
+ readonly "2": {
38
+ readonly pl: "2";
39
+ };
40
+ readonly "3": {
41
+ readonly pl: "3";
42
+ };
26
43
  };
27
44
  readonly SlotTrailing: {
28
- readonly "1": "order-3 pr-1";
29
- readonly "2": "order-3 pr-2";
30
- readonly "3": "order-3 pr-3";
45
+ readonly "1": {
46
+ readonly pr: "1";
47
+ };
48
+ readonly "2": {
49
+ readonly pr: "2";
50
+ };
51
+ readonly "3": {
52
+ readonly pr: "3";
53
+ };
31
54
  };
32
55
  };
33
56
  export declare const COLOR: {
34
57
  readonly Container: {
35
58
  readonly default: {
36
- readonly outline: "bg-surface-1 border-gray-6 hover:border-gray-7 focus-within:!border-blue-8";
37
- readonly ghost: "bg-transparent border-transparent hover:bg-gray-3 focus-within:!bg-gray-4 focus-within:!border-blue-8";
59
+ readonly outline: {
60
+ readonly bg: "surface-1";
61
+ readonly border: "px";
62
+ readonly borderColor: "gray-6";
63
+ readonly hover_borderColor: "gray-7";
64
+ readonly focus_within_borderColor: "blue-8";
65
+ };
66
+ readonly ghost: {
67
+ readonly bg: "transparent";
68
+ readonly border: "px";
69
+ readonly borderColor: "transparent";
70
+ readonly hover_backgroundColor: "gray-3";
71
+ readonly hover_borderColor: "transparent";
72
+ readonly focus_within_backgroundColor: "gray-4";
73
+ readonly focus_within_borderColor: "blue-8";
74
+ };
75
+ };
76
+ readonly disabled: {
77
+ readonly outline: {
78
+ readonly bg: "gray-2";
79
+ readonly border: "px";
80
+ readonly borderColor: "gray-2";
81
+ };
82
+ readonly ghost: {
83
+ readonly bg: "transparent";
84
+ readonly border: "px";
85
+ readonly borderColor: "transparent";
86
+ };
87
+ };
88
+ readonly error: {
89
+ readonly outline: {
90
+ readonly bg: "surface-1";
91
+ readonly border: "px";
92
+ readonly borderColor: "red-6";
93
+ };
94
+ readonly ghost: {
95
+ readonly bg: "transparent";
96
+ readonly border: "px";
97
+ readonly borderColor: "red-6";
98
+ };
99
+ };
100
+ };
101
+ readonly Text: {
102
+ readonly default: {
103
+ readonly color: "default";
38
104
  };
39
105
  readonly disabled: {
40
- readonly outline: "cursor-not-allowed bg-gray-2 border-gray-2 [&_[data-tgph-icon]]:text-gray-8 placeholder:text-gray-9 [&>input]:text-gray-9";
41
- readonly ghost: "cursor-not-allowed bg-transparent border border-transparent [&_[data-tgph-icon]]:text-gray-8 placeholder:text-gray-9 [&>input]:text-gray-9";
106
+ readonly color: "disabled";
42
107
  };
43
108
  readonly error: {
44
- readonly outline: "bg-surface-1 border-red-6";
45
- readonly ghost: "bg-transparent border-red-6";
109
+ readonly color: "default";
46
110
  };
47
111
  };
48
112
  };
@@ -1 +1 @@
1
- {"version":3,"file":"Input.constants.d.ts","sourceRoot":"","sources":["../../../src/Input/Input.constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+BP,CAAC;AAEX,eAAO,MAAM,KAAK;;;;;;;;;;;;;;;CAmBR,CAAC"}
1
+ {"version":3,"file":"Input.constants.d.ts","sourceRoot":"","sources":["../../../src/Input/Input.constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsDP,CAAC;AAEX,eAAO,MAAM,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwDR,CAAC"}
@@ -1,18 +1,17 @@
1
- import { PolymorphicProps, PolymorphicPropsWithTgphRef, TgphComponentProps, TgphElement } from '@telegraph/helpers';
1
+ import { PolymorphicProps, TgphComponentProps, TgphElement } from '@telegraph/helpers';
2
2
  import { Text } from '@telegraph/typography';
3
3
  import { default as React } from 'react';
4
- import { COLOR, SIZE } from './Input.constants';
5
4
  type BaseRootProps = {
6
- size?: keyof typeof SIZE.Container;
7
- variant?: keyof typeof COLOR.Container.default;
5
+ size?: "1" | "2" | "3";
6
+ variant?: "outline" | "ghost";
8
7
  errored?: boolean;
9
8
  };
10
- type RootProps<T extends TgphElement> = Omit<PolymorphicPropsWithTgphRef<T, HTMLInputElement>, "size"> & BaseRootProps & {
11
- textProps?: Omit<React.ComponentProps<typeof Text<"input">>, "as">;
12
- };
13
- declare const Root: <T extends TgphElement>({ as, size, variant, textProps, className, disabled, errored, children, tgphRef, ...props }: RootProps<T>) => import("react/jsx-runtime").JSX.Element;
9
+ type RootProps<T extends TgphElement> = BaseRootProps & {
10
+ textProps?: Omit<React.ComponentProps<typeof Text<T>>, "as">;
11
+ } & Omit<React.ComponentProps<typeof Text<T>>, "as">;
12
+ declare const Root: <T extends TgphElement>({ as, size, variant, textProps, disabled, errored, children, tgphRef, ...props }: RootProps<T>) => import("react/jsx-runtime").JSX.Element;
14
13
  declare const Slot: React.ForwardRefExoticComponent<Omit<import('@radix-ui/react-slot').SlotProps & React.RefAttributes<HTMLElement>, "ref"> & {
15
- size?: keyof typeof SIZE.Slot;
14
+ size?: "1" | "2" | "3";
16
15
  position?: "leading" | "trailing";
17
16
  } & React.RefAttributes<HTMLElement>>;
18
17
  type DefaultProps<T extends TgphElement> = PolymorphicProps<T> & TgphComponentProps<typeof Root> & {
@@ -1 +1 @@
1
- {"version":3,"file":"Input.d.ts","sourceRoot":"","sources":["../../../src/Input/Input.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,gBAAgB,EAChB,2BAA2B,EAE3B,kBAAkB,EAClB,WAAW,EACZ,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAE7C,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAEhD,KAAK,aAAa,GAAG;IACnB,IAAI,CAAC,EAAE,MAAM,OAAO,IAAI,CAAC,SAAS,CAAC;IACnC,OAAO,CAAC,EAAE,MAAM,OAAO,KAAK,CAAC,SAAS,CAAC,OAAO,CAAC;IAC/C,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC;AAEF,KAAK,SAAS,CAAC,CAAC,SAAS,WAAW,IAAI,I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,GAAG,CAAC;IACvB,OAAO,CAAC,EAAE,SAAS,GAAG,OAAO,CAAC;IAC9B,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC;AAEF,KAAK,SAAS,CAAC,CAAC,SAAS,WAAW,IAAI,aAAa,GAAG;IACtD,SAAS,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,OAAO,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC;CAC9D,GAAG,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,OAAO,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC;AAYrD,QAAA,MAAM,IAAI,GAAI,CAAC,SAAS,WAAW,oFAUhC,SAAS,CAAC,CAAC,CAAC,4CAyDd,CAAC;AAQF,QAAA,MAAM,IAAI;WALD,GAAG,GAAG,GAAG,GAAG,GAAG;eACX,SAAS,GAAG,UAAU;qCAsBlC,CAAC;AAEF,KAAK,YAAY,CAAC,CAAC,SAAS,WAAW,IAAI,gBAAgB,CAAC,CAAC,CAAC,GAC5D,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,qDAInC,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"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@telegraph/input",
3
- "version": "0.0.47",
3
+ "version": "0.0.49",
4
4
  "description": "Input component for Telegraph",
5
5
  "repository": "https://github.com/knocklabs/telegraph/tree/main/packages/input",
6
6
  "author": "@knocklabs",
@@ -35,16 +35,15 @@
35
35
  "@radix-ui/react-slot": "^1.2.3",
36
36
  "@telegraph/compose-refs": "^0.0.7",
37
37
  "@telegraph/helpers": "^0.0.13",
38
- "@telegraph/layout": "^0.1.20",
39
- "@telegraph/typography": "^0.1.20",
38
+ "@telegraph/layout": "^0.2.0",
39
+ "@telegraph/typography": "^0.1.22",
40
40
  "clsx": "^2.1.1"
41
41
  },
42
42
  "devDependencies": {
43
43
  "@knocklabs/eslint-config": "^0.0.4",
44
44
  "@knocklabs/typescript-config": "^0.0.2",
45
- "@telegraph/postcss-config": "^0.0.26",
45
+ "@telegraph/postcss-config": "^0.0.28",
46
46
  "@telegraph/prettier-config": "^0.0.7",
47
- "@telegraph/tailwind-config": "^0.0.13",
48
47
  "@telegraph/vite-config": "^0.0.15",
49
48
  "@types/react": "^18.3.18",
50
49
  "eslint": "^8.56.0",