@telegraph/textarea 0.0.25 → 0.1.1
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,20 @@
|
|
|
1
1
|
# @telegraph/textarea
|
|
2
2
|
|
|
3
|
+
## 0.1.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#524](https://github.com/knocklabs/telegraph/pull/524) [`fd14d50`](https://github.com/knocklabs/telegraph/commit/fd14d509c3f3f76eafc07d08c73e30db79255a2e) Thanks [@kylemcd](https://github.com/kylemcd)! - bump packages to get tokens upgrades
|
|
8
|
+
|
|
9
|
+
- Updated dependencies []:
|
|
10
|
+
- @telegraph/typography@0.1.23
|
|
11
|
+
|
|
12
|
+
## 0.1.0
|
|
13
|
+
|
|
14
|
+
### Minor Changes
|
|
15
|
+
|
|
16
|
+
- [#519](https://github.com/knocklabs/telegraph/pull/519) [`aa0df27`](https://github.com/knocklabs/telegraph/commit/aa0df2714578f411fd7c80ce3610713d6e77d053) Thanks [@ksorathia](https://github.com/ksorathia)! - Standardize spacing and style across primitives.
|
|
17
|
+
|
|
3
18
|
## 0.0.25
|
|
4
19
|
|
|
5
20
|
### Patch Changes
|
package/dist/cjs/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("react/jsx-runtime"),u=require("@telegraph/typography"),x={1:{
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("react/jsx-runtime"),u=require("@telegraph/typography"),x={1:{px:"1_5",py:"1",size:"1"},2:{px:"2",py:"1_5",size:"2"},3:{px:"3",py:"2",size:"3"}},g={outline:{border:"px"},ghost:{border:"px",borderColor:"transparent"}},l={default:{},disabled:{bg:"gray-2",borderColor:"gray-2"},error:{borderColor:"red-6"}},b=({disabled:t,errored:e})=>t?"disabled":e?"error":"default",c=({size:t="2",variant:e="outline",rounded:o="2",resize:s="both",disabled:r,errored:n,textProps:d,...i})=>{const a=b({disabled:r,errored:n});return p.jsx(u.Text,{as:"textarea","data-tgph-textarea":!0,"data-tgph-textarea-state":a,"data-tgph-textarea-resize":s,"data-tgph-textarea-variant":e,rounded:o,disabled:r,...x[t],...g[e],...l[a],...d,...i})};exports.TextArea=c;
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/dist/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../src/TextArea/TextArea.constants.ts","../../src/TextArea/TextArea.tsx"],"sourcesContent":["import type { TgphComponentProps } from \"@telegraph/helpers\";\nimport type { Text } from \"@telegraph/typography\";\n\nexport type Size = \"1\" | \"2\" | \"3\";\nexport type Variant = \"outline\" | \"ghost\";\nexport type State = \"default\" | \"disabled\" | \"error\";\n\ntype SizeMap = {\n [key in Size]: Partial<\n Pick<TgphComponentProps<typeof Text>, \"p\" | \"size\" | \"px\" | \"py\">\n >;\n};\n\ntype VariantMap = {\n [key in Variant]: Partial<\n Pick<TgphComponentProps<typeof Text>, \"border\" | \"borderColor\">\n >;\n};\n\ntype StateMap = {\n [key in State]: Partial<\n Pick<TgphComponentProps<typeof Text>, \"bg\" | \"borderColor\">\n >;\n};\n\nexport const sizeMap: SizeMap = {\n \"1\": {\n
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../src/TextArea/TextArea.constants.ts","../../src/TextArea/TextArea.tsx"],"sourcesContent":["import type { TgphComponentProps } from \"@telegraph/helpers\";\nimport type { Text } from \"@telegraph/typography\";\n\nexport type Size = \"1\" | \"2\" | \"3\";\nexport type Variant = \"outline\" | \"ghost\";\nexport type State = \"default\" | \"disabled\" | \"error\";\n\ntype SizeMap = {\n [key in Size]: Partial<\n Pick<TgphComponentProps<typeof Text>, \"p\" | \"size\" | \"px\" | \"py\">\n >;\n};\n\ntype VariantMap = {\n [key in Variant]: Partial<\n Pick<TgphComponentProps<typeof Text>, \"border\" | \"borderColor\">\n >;\n};\n\ntype StateMap = {\n [key in State]: Partial<\n Pick<TgphComponentProps<typeof Text>, \"bg\" | \"borderColor\">\n >;\n};\n\nexport const sizeMap: SizeMap = {\n \"1\": {\n px: \"1_5\",\n py: \"1\",\n size: \"1\",\n },\n \"2\": {\n px: \"2\",\n py: \"1_5\",\n size: \"2\",\n },\n \"3\": {\n px: \"3\",\n py: \"2\",\n size: \"3\",\n },\n};\n\nexport const variantMap: VariantMap = {\n outline: {\n border: \"px\",\n },\n ghost: {\n border: \"px\",\n borderColor: \"transparent\",\n },\n};\n\nexport const stateMap: StateMap = {\n default: {},\n disabled: {\n bg: \"gray-2\",\n borderColor: \"gray-2\",\n },\n error: {\n borderColor: \"red-6\",\n },\n};\n","import type { TgphComponentProps } from \"@telegraph/helpers\";\nimport { Text } from \"@telegraph/typography\";\nimport React from \"react\";\n\nimport {\n type Size,\n type State,\n type Variant,\n sizeMap,\n stateMap,\n variantMap,\n} from \"./TextArea.constants\";\n\nconst deriveState = ({ disabled, errored }: TextAreaBaseProps): State => {\n if (disabled) return \"disabled\";\n if (errored) return \"error\";\n return \"default\";\n};\n\ntype TextAreaBaseProps = {\n size?: Size;\n variant?: Variant;\n errored?: boolean;\n disabled?: boolean;\n resize?: \"both\" | \"vertical\" | \"horizontal\" | \"none\";\n textProps?: Omit<React.ComponentProps<typeof Text>, \"as\">;\n};\n\ntype TextAreaProps = TextAreaBaseProps &\n TgphComponentProps<typeof Text> &\n React.ComponentPropsWithoutRef<\"textarea\">;\n\nconst TextArea = ({\n size = \"2\",\n variant = \"outline\",\n rounded = \"2\",\n resize = \"both\",\n disabled,\n errored,\n textProps,\n ...props\n}: TextAreaProps) => {\n const derivedState = deriveState({ disabled, errored });\n\n return (\n <Text\n as=\"textarea\"\n data-tgph-textarea\n data-tgph-textarea-state={derivedState}\n data-tgph-textarea-resize={resize}\n data-tgph-textarea-variant={variant}\n rounded={rounded}\n disabled={disabled}\n {...sizeMap[size]}\n {...variantMap[variant]}\n {...stateMap[derivedState]}\n {...textProps}\n {...props}\n />\n );\n};\n\ntype TextAreaExportedProps = TgphComponentProps<typeof TextArea>;\n\nexport { TextArea, type TextAreaExportedProps as TextAreaProps };\n"],"names":["sizeMap","variantMap","stateMap","deriveState","disabled","errored","TextArea","size","variant","rounded","resize","textProps","props","derivedState","jsx","Text"],"mappings":"wJAyBaA,EAAmB,CAC9B,EAAK,CACH,GAAI,MACJ,GAAI,IACJ,KAAM,GAAA,EAER,EAAK,CACH,GAAI,IACJ,GAAI,MACJ,KAAM,GAAA,EAER,EAAK,CACH,GAAI,IACJ,GAAI,IACJ,KAAM,GAAA,CAEV,EAEaC,EAAyB,CACpC,QAAS,CACP,OAAQ,IAAA,EAEV,MAAO,CACL,OAAQ,KACR,YAAa,aAAA,CAEjB,EAEaC,EAAqB,CAChC,QAAS,CAAA,EACT,SAAU,CACR,GAAI,SACJ,YAAa,QAAA,EAEf,MAAO,CACL,YAAa,OAAA,CAEjB,ECjDMC,EAAc,CAAC,CAAE,SAAAC,EAAU,QAAAC,KAC3BD,EAAiB,WACjBC,EAAgB,QACb,UAgBHC,EAAW,CAAC,CAChB,KAAAC,EAAO,IACP,QAAAC,EAAU,UACV,QAAAC,EAAU,IACV,OAAAC,EAAS,OACT,SAAAN,EACA,QAAAC,EACA,UAAAM,EACA,GAAGC,CACL,IAAqB,CACnB,MAAMC,EAAeV,EAAY,CAAE,SAAAC,EAAU,QAAAC,EAAS,EAEtD,OACES,EAAAA,IAACC,EAAAA,KAAA,CACC,GAAG,WACH,qBAAkB,GAClB,2BAA0BF,EAC1B,4BAA2BH,EAC3B,6BAA4BF,EAC5B,QAAAC,EACA,SAAAL,EACC,GAAGJ,EAAQO,CAAI,EACf,GAAGN,EAAWO,CAAO,EACrB,GAAGN,EAASW,CAAY,EACxB,GAAGF,EACH,GAAGC,CAAA,CAAA,CAGV"}
|
package/dist/esm/index.mjs
CHANGED
package/dist/esm/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../../src/TextArea/TextArea.constants.ts","../../src/TextArea/TextArea.tsx"],"sourcesContent":["import type { TgphComponentProps } from \"@telegraph/helpers\";\nimport type { Text } from \"@telegraph/typography\";\n\nexport type Size = \"1\" | \"2\" | \"3\";\nexport type Variant = \"outline\" | \"ghost\";\nexport type State = \"default\" | \"disabled\" | \"error\";\n\ntype SizeMap = {\n [key in Size]: Partial<\n Pick<TgphComponentProps<typeof Text>, \"p\" | \"size\" | \"px\" | \"py\">\n >;\n};\n\ntype VariantMap = {\n [key in Variant]: Partial<\n Pick<TgphComponentProps<typeof Text>, \"border\" | \"borderColor\">\n >;\n};\n\ntype StateMap = {\n [key in State]: Partial<\n Pick<TgphComponentProps<typeof Text>, \"bg\" | \"borderColor\">\n >;\n};\n\nexport const sizeMap: SizeMap = {\n \"1\": {\n
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../src/TextArea/TextArea.constants.ts","../../src/TextArea/TextArea.tsx"],"sourcesContent":["import type { TgphComponentProps } from \"@telegraph/helpers\";\nimport type { Text } from \"@telegraph/typography\";\n\nexport type Size = \"1\" | \"2\" | \"3\";\nexport type Variant = \"outline\" | \"ghost\";\nexport type State = \"default\" | \"disabled\" | \"error\";\n\ntype SizeMap = {\n [key in Size]: Partial<\n Pick<TgphComponentProps<typeof Text>, \"p\" | \"size\" | \"px\" | \"py\">\n >;\n};\n\ntype VariantMap = {\n [key in Variant]: Partial<\n Pick<TgphComponentProps<typeof Text>, \"border\" | \"borderColor\">\n >;\n};\n\ntype StateMap = {\n [key in State]: Partial<\n Pick<TgphComponentProps<typeof Text>, \"bg\" | \"borderColor\">\n >;\n};\n\nexport const sizeMap: SizeMap = {\n \"1\": {\n px: \"1_5\",\n py: \"1\",\n size: \"1\",\n },\n \"2\": {\n px: \"2\",\n py: \"1_5\",\n size: \"2\",\n },\n \"3\": {\n px: \"3\",\n py: \"2\",\n size: \"3\",\n },\n};\n\nexport const variantMap: VariantMap = {\n outline: {\n border: \"px\",\n },\n ghost: {\n border: \"px\",\n borderColor: \"transparent\",\n },\n};\n\nexport const stateMap: StateMap = {\n default: {},\n disabled: {\n bg: \"gray-2\",\n borderColor: \"gray-2\",\n },\n error: {\n borderColor: \"red-6\",\n },\n};\n","import type { TgphComponentProps } from \"@telegraph/helpers\";\nimport { Text } from \"@telegraph/typography\";\nimport React from \"react\";\n\nimport {\n type Size,\n type State,\n type Variant,\n sizeMap,\n stateMap,\n variantMap,\n} from \"./TextArea.constants\";\n\nconst deriveState = ({ disabled, errored }: TextAreaBaseProps): State => {\n if (disabled) return \"disabled\";\n if (errored) return \"error\";\n return \"default\";\n};\n\ntype TextAreaBaseProps = {\n size?: Size;\n variant?: Variant;\n errored?: boolean;\n disabled?: boolean;\n resize?: \"both\" | \"vertical\" | \"horizontal\" | \"none\";\n textProps?: Omit<React.ComponentProps<typeof Text>, \"as\">;\n};\n\ntype TextAreaProps = TextAreaBaseProps &\n TgphComponentProps<typeof Text> &\n React.ComponentPropsWithoutRef<\"textarea\">;\n\nconst TextArea = ({\n size = \"2\",\n variant = \"outline\",\n rounded = \"2\",\n resize = \"both\",\n disabled,\n errored,\n textProps,\n ...props\n}: TextAreaProps) => {\n const derivedState = deriveState({ disabled, errored });\n\n return (\n <Text\n as=\"textarea\"\n data-tgph-textarea\n data-tgph-textarea-state={derivedState}\n data-tgph-textarea-resize={resize}\n data-tgph-textarea-variant={variant}\n rounded={rounded}\n disabled={disabled}\n {...sizeMap[size]}\n {...variantMap[variant]}\n {...stateMap[derivedState]}\n {...textProps}\n {...props}\n />\n );\n};\n\ntype TextAreaExportedProps = TgphComponentProps<typeof TextArea>;\n\nexport { TextArea, type TextAreaExportedProps as TextAreaProps };\n"],"names":["sizeMap","variantMap","stateMap","deriveState","disabled","errored","TextArea","size","variant","rounded","resize","textProps","props","derivedState","jsx","Text"],"mappings":";;AAyBO,MAAMA,IAAmB;AAAA,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}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextArea.constants.d.ts","sourceRoot":"","sources":["../../../src/TextArea/TextArea.constants.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAC7D,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAElD,MAAM,MAAM,IAAI,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC;AACnC,MAAM,MAAM,OAAO,GAAG,SAAS,GAAG,OAAO,CAAC;AAC1C,MAAM,MAAM,KAAK,GAAG,SAAS,GAAG,UAAU,GAAG,OAAO,CAAC;AAErD,KAAK,OAAO,GAAG;KACZ,GAAG,IAAI,IAAI,GAAG,OAAO,CACpB,IAAI,CAAC,kBAAkB,CAAC,OAAO,IAAI,CAAC,EAAE,GAAG,GAAG,MAAM,GAAG,IAAI,GAAG,IAAI,CAAC,CAClE;CACF,CAAC;AAEF,KAAK,UAAU,GAAG;KACf,GAAG,IAAI,OAAO,GAAG,OAAO,CACvB,IAAI,CAAC,kBAAkB,CAAC,OAAO,IAAI,CAAC,EAAE,QAAQ,GAAG,aAAa,CAAC,CAChE;CACF,CAAC;AAEF,KAAK,QAAQ,GAAG;KACb,GAAG,IAAI,KAAK,GAAG,OAAO,CACrB,IAAI,CAAC,kBAAkB,CAAC,OAAO,IAAI,CAAC,EAAE,IAAI,GAAG,aAAa,CAAC,CAC5D;CACF,CAAC;AAEF,eAAO,MAAM,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"TextArea.constants.d.ts","sourceRoot":"","sources":["../../../src/TextArea/TextArea.constants.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAC7D,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAElD,MAAM,MAAM,IAAI,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC;AACnC,MAAM,MAAM,OAAO,GAAG,SAAS,GAAG,OAAO,CAAC;AAC1C,MAAM,MAAM,KAAK,GAAG,SAAS,GAAG,UAAU,GAAG,OAAO,CAAC;AAErD,KAAK,OAAO,GAAG;KACZ,GAAG,IAAI,IAAI,GAAG,OAAO,CACpB,IAAI,CAAC,kBAAkB,CAAC,OAAO,IAAI,CAAC,EAAE,GAAG,GAAG,MAAM,GAAG,IAAI,GAAG,IAAI,CAAC,CAClE;CACF,CAAC;AAEF,KAAK,UAAU,GAAG;KACf,GAAG,IAAI,OAAO,GAAG,OAAO,CACvB,IAAI,CAAC,kBAAkB,CAAC,OAAO,IAAI,CAAC,EAAE,QAAQ,GAAG,aAAa,CAAC,CAChE;CACF,CAAC;AAEF,KAAK,QAAQ,GAAG;KACb,GAAG,IAAI,KAAK,GAAG,OAAO,CACrB,IAAI,CAAC,kBAAkB,CAAC,OAAO,IAAI,CAAC,EAAE,IAAI,GAAG,aAAa,CAAC,CAC5D;CACF,CAAC;AAEF,eAAO,MAAM,OAAO,EAAE,OAgBrB,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,UAQxB,CAAC;AAEF,eAAO,MAAM,QAAQ,EAAE,QAStB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@telegraph/textarea",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "A multi-line user input.",
|
|
5
5
|
"repository": "https://github.com/knocklabs/telegraph/tree/main/packages/textarea",
|
|
6
6
|
"author": "@knocklabs",
|
|
@@ -33,12 +33,12 @@
|
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"@telegraph/helpers": "^0.0.13",
|
|
36
|
-
"@telegraph/typography": "^0.1.
|
|
36
|
+
"@telegraph/typography": "^0.1.23"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
39
|
"@knocklabs/eslint-config": "^0.0.4",
|
|
40
40
|
"@knocklabs/typescript-config": "^0.0.2",
|
|
41
|
-
"@telegraph/postcss-config": "^0.0.
|
|
41
|
+
"@telegraph/postcss-config": "^0.0.29",
|
|
42
42
|
"@telegraph/prettier-config": "^0.0.7",
|
|
43
43
|
"@telegraph/vite-config": "^0.0.15",
|
|
44
44
|
"@types/react": "^18.3.18",
|