@planningcenter/tapestry 2.10.2-rc.2 → 2.10.2-rc.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/textarea/TextArea.d.ts +38 -0
- package/dist/components/textarea/TextArea.d.ts.map +1 -0
- package/dist/components/textarea/TextArea.js +27 -0
- package/dist/components/textarea/TextArea.js.map +1 -0
- package/dist/components/textarea/index.d.ts +4 -0
- package/dist/components/textarea/index.d.ts.map +1 -0
- package/dist/reactRender.css +1151 -923
- package/dist/reactRender.css.map +1 -1
- package/dist/reactRenderLegacy.css +1151 -923
- package/dist/reactRenderLegacy.css.map +1 -1
- package/dist/unstable.css +229 -1
- package/dist/unstable.css.map +1 -1
- package/dist/unstable.d.ts +1 -0
- package/dist/unstable.d.ts.map +1 -1
- package/dist/unstable.js +1 -0
- package/dist/unstable.js.map +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import "./index.css";
|
|
2
|
+
import React, { type TextareaHTMLAttributes } from "react";
|
|
3
|
+
export type TextAreaResize = "auto" | "none" | "vertical";
|
|
4
|
+
export type TextAreaSize = "lg" | "md";
|
|
5
|
+
interface TextAreaBaseProps {
|
|
6
|
+
/** Helper text displayed below the field. Styles as error text when `invalid` is true. */
|
|
7
|
+
description?: string;
|
|
8
|
+
/** If true, applies error styling to border and description. */
|
|
9
|
+
invalid?: boolean;
|
|
10
|
+
/** Controls resize behavior. Defaults to `'vertical'`. */
|
|
11
|
+
resize?: TextAreaResize;
|
|
12
|
+
/** Specifies visible height in lines. Defaults to `3`. */
|
|
13
|
+
rows?: number;
|
|
14
|
+
/** Controls spacing and font size. Defaults to `'md'`. */
|
|
15
|
+
size?: TextAreaSize;
|
|
16
|
+
}
|
|
17
|
+
interface TextAreaWithVisibleLabel extends TextAreaBaseProps {
|
|
18
|
+
/** If true, label is rendered as aria-label instead of visible label */
|
|
19
|
+
hideLabel?: false;
|
|
20
|
+
/** Label text displayed above the textarea */
|
|
21
|
+
label: React.ReactNode;
|
|
22
|
+
}
|
|
23
|
+
interface TextAreaWithHiddenLabel extends TextAreaBaseProps {
|
|
24
|
+
/** If true, label is rendered as aria-label instead of visible label */
|
|
25
|
+
hideLabel: true;
|
|
26
|
+
/** Label text used as aria-label (must be string when hidden) */
|
|
27
|
+
label: string;
|
|
28
|
+
}
|
|
29
|
+
interface TextAreaWithAriaLabelledBy extends TextAreaBaseProps {
|
|
30
|
+
"aria-labelledby": string;
|
|
31
|
+
hideLabel?: never;
|
|
32
|
+
label?: never;
|
|
33
|
+
}
|
|
34
|
+
export type TextAreaCustomProps = TextAreaWithAriaLabelledBy | TextAreaWithHiddenLabel | TextAreaWithVisibleLabel;
|
|
35
|
+
export type TextAreaProps = Omit<TextareaHTMLAttributes<HTMLTextAreaElement>, keyof TextAreaCustomProps | "rows"> & TextAreaCustomProps;
|
|
36
|
+
export declare const TextArea: React.ForwardRefExoticComponent<TextAreaProps & React.RefAttributes<HTMLTextAreaElement>>;
|
|
37
|
+
export {};
|
|
38
|
+
//# sourceMappingURL=TextArea.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TextArea.d.ts","sourceRoot":"","sources":["../../../src/components/textarea/TextArea.tsx"],"names":[],"mappings":"AAAA,OAAO,aAAa,CAAA;AAKpB,OAAO,KAAK,EAAE,EAAc,KAAK,sBAAsB,EAAE,MAAM,OAAO,CAAA;AAEtE,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,MAAM,GAAG,UAAU,CAAA;AAEzD,MAAM,MAAM,YAAY,GAAG,IAAI,GAAG,IAAI,CAAA;AAEtC,UAAU,iBAAiB;IACzB,0FAA0F;IAC1F,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,gEAAgE;IAChE,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,0DAA0D;IAC1D,MAAM,CAAC,EAAE,cAAc,CAAA;IACvB,0DAA0D;IAC1D,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,0DAA0D;IAC1D,IAAI,CAAC,EAAE,YAAY,CAAA;CACpB;AAED,UAAU,wBAAyB,SAAQ,iBAAiB;IAC1D,wEAAwE;IACxE,SAAS,CAAC,EAAE,KAAK,CAAA;IACjB,8CAA8C;IAC9C,KAAK,EAAE,KAAK,CAAC,SAAS,CAAA;CACvB;AAED,UAAU,uBAAwB,SAAQ,iBAAiB;IACzD,wEAAwE;IACxE,SAAS,EAAE,IAAI,CAAA;IACf,iEAAiE;IACjE,KAAK,EAAE,MAAM,CAAA;CACd;AAED,UAAU,0BAA2B,SAAQ,iBAAiB;IAC5D,iBAAiB,EAAE,MAAM,CAAA;IACzB,SAAS,CAAC,EAAE,KAAK,CAAA;IACjB,KAAK,CAAC,EAAE,KAAK,CAAA;CACd;AAED,MAAM,MAAM,mBAAmB,GAC3B,0BAA0B,GAC1B,uBAAuB,GACvB,wBAAwB,CAAA;AAE5B,MAAM,MAAM,aAAa,GAAG,IAAI,CAC9B,sBAAsB,CAAC,mBAAmB,CAAC,EAC3C,MAAM,mBAAmB,GAAG,MAAM,CACnC,GACC,mBAAmB,CAAA;AAErB,eAAO,MAAM,QAAQ,2FA4DpB,CAAA"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import Icon from '../../utilities/Icon.js';
|
|
2
|
+
import { useId } from '../../utilities/useId.js';
|
|
3
|
+
import classNames from 'classnames';
|
|
4
|
+
import React, { forwardRef } from 'react';
|
|
5
|
+
|
|
6
|
+
const TextArea = forwardRef(function TextArea({ "aria-label": ariaLabel, className, description, hideLabel, id, invalid, label, resize = "vertical", rows = 3, size = "md", ...restProps }, ref) {
|
|
7
|
+
const combinedClassName = classNames("tds-textarea", {
|
|
8
|
+
"tds-textarea--invalid": invalid,
|
|
9
|
+
"tds-textarea--lg": size === "lg",
|
|
10
|
+
"tds-textarea--resize-auto": resize === "auto",
|
|
11
|
+
"tds-textarea--resize-none": resize === "none",
|
|
12
|
+
"tds-textarea--resize-vertical": resize === "vertical",
|
|
13
|
+
}, className);
|
|
14
|
+
const stableId = useId();
|
|
15
|
+
const textareaId = id || `tds-textarea-${stableId}`;
|
|
16
|
+
const descriptionId = description ? `${textareaId}-description` : undefined;
|
|
17
|
+
return (React.createElement("div", { className: combinedClassName },
|
|
18
|
+
!hideLabel && label ? (React.createElement("label", { htmlFor: textareaId }, label)) : null,
|
|
19
|
+
React.createElement("textarea", { ...restProps, "aria-describedby": descriptionId, "aria-invalid": invalid || undefined, "aria-label": hideLabel ? ariaLabel || label : ariaLabel, id: textareaId, ref: ref, rows: rows }),
|
|
20
|
+
description && (React.createElement("p", { className: "tds-textarea-description", id: descriptionId },
|
|
21
|
+
React.createElement(Icon, { "aria-hidden": true, className: "tds-textarea-description-invalid-icon", symbol: "general#exclamation-triangle" }),
|
|
22
|
+
description))));
|
|
23
|
+
});
|
|
24
|
+
TextArea.displayName = "TextArea";
|
|
25
|
+
|
|
26
|
+
export { TextArea };
|
|
27
|
+
//# sourceMappingURL=TextArea.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TextArea.js","sources":["../../../src/components/textarea/TextArea.tsx"],"sourcesContent":["import \"./index.css\"\n\nimport Icon from \"@utilities/Icon\"\nimport { useId } from \"@utilities/useId\"\nimport classNames from \"classnames\"\nimport React, { forwardRef, type TextareaHTMLAttributes } from \"react\"\n\nexport type TextAreaResize = \"auto\" | \"none\" | \"vertical\"\n\nexport type TextAreaSize = \"lg\" | \"md\"\n\ninterface TextAreaBaseProps {\n /** Helper text displayed below the field. Styles as error text when `invalid` is true. */\n description?: string\n /** If true, applies error styling to border and description. */\n invalid?: boolean\n /** Controls resize behavior. Defaults to `'vertical'`. */\n resize?: TextAreaResize\n /** Specifies visible height in lines. Defaults to `3`. */\n rows?: number\n /** Controls spacing and font size. Defaults to `'md'`. */\n size?: TextAreaSize\n}\n\ninterface TextAreaWithVisibleLabel extends TextAreaBaseProps {\n /** If true, label is rendered as aria-label instead of visible label */\n hideLabel?: false\n /** Label text displayed above the textarea */\n label: React.ReactNode\n}\n\ninterface TextAreaWithHiddenLabel extends TextAreaBaseProps {\n /** If true, label is rendered as aria-label instead of visible label */\n hideLabel: true\n /** Label text used as aria-label (must be string when hidden) */\n label: string\n}\n\ninterface TextAreaWithAriaLabelledBy extends TextAreaBaseProps {\n \"aria-labelledby\": string\n hideLabel?: never\n label?: never\n}\n\nexport type TextAreaCustomProps =\n | TextAreaWithAriaLabelledBy\n | TextAreaWithHiddenLabel\n | TextAreaWithVisibleLabel\n\nexport type TextAreaProps = Omit<\n TextareaHTMLAttributes<HTMLTextAreaElement>,\n keyof TextAreaCustomProps | \"rows\"\n> &\n TextAreaCustomProps\n\nexport const TextArea = forwardRef<HTMLTextAreaElement, TextAreaProps>(\n function TextArea(\n {\n \"aria-label\": ariaLabel,\n className,\n description,\n hideLabel,\n id,\n invalid,\n label,\n resize = \"vertical\",\n rows = 3,\n size = \"md\",\n ...restProps\n }: TextAreaProps,\n ref\n ) {\n const combinedClassName = classNames(\n \"tds-textarea\",\n {\n \"tds-textarea--invalid\": invalid,\n \"tds-textarea--lg\": size === \"lg\",\n \"tds-textarea--resize-auto\": resize === \"auto\",\n \"tds-textarea--resize-none\": resize === \"none\",\n \"tds-textarea--resize-vertical\": resize === \"vertical\",\n },\n className\n )\n\n const stableId = useId()\n const textareaId = id || `tds-textarea-${stableId}`\n const descriptionId = description ? `${textareaId}-description` : undefined\n\n return (\n <div className={combinedClassName}>\n {!hideLabel && label ? (\n <label htmlFor={textareaId}>{label}</label>\n ) : null}\n <textarea\n {...restProps}\n aria-describedby={descriptionId}\n aria-invalid={invalid || undefined}\n aria-label={hideLabel ? ariaLabel || (label as string) : ariaLabel}\n id={textareaId}\n ref={ref}\n rows={rows}\n />\n {description && (\n <p className=\"tds-textarea-description\" id={descriptionId}>\n <Icon\n aria-hidden\n className=\"tds-textarea-description-invalid-icon\"\n symbol=\"general#exclamation-triangle\"\n />\n {description}\n </p>\n )}\n </div>\n )\n }\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