@planningcenter/tapestry 2.10.0-rc.0 → 2.10.0-rc.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/dist/components/radio-group/RadioGroup.d.ts +23 -0
- package/dist/components/radio-group/RadioGroup.d.ts.map +1 -0
- package/dist/components/radio-group/RadioGroup.js +29 -0
- package/dist/components/radio-group/RadioGroup.js.map +1 -0
- package/dist/components/radio-group/index.d.ts +4 -0
- package/dist/components/radio-group/index.d.ts.map +1 -0
- package/dist/reactRender.css +586 -499
- package/dist/reactRender.css.map +1 -1
- package/dist/reactRenderLegacy.css +586 -499
- package/dist/reactRenderLegacy.css.map +1 -1
- package/dist/unstable.css +87 -0
- 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,23 @@
|
|
|
1
|
+
import "./index.css";
|
|
2
|
+
import React, { FieldsetHTMLAttributes } from "react";
|
|
3
|
+
export type RadioGroupSize = "md" | "sm";
|
|
4
|
+
export interface RadioGroupProps {
|
|
5
|
+
description?: string;
|
|
6
|
+
invalid?: boolean;
|
|
7
|
+
label: string;
|
|
8
|
+
size?: RadioGroupSize;
|
|
9
|
+
}
|
|
10
|
+
export type RadioGroupElementProps = Omit<FieldsetHTMLAttributes<HTMLFieldSetElement>, keyof RadioGroupProps> & RadioGroupProps;
|
|
11
|
+
/**
|
|
12
|
+
* A radio group component that renders as a fieldset with legend.
|
|
13
|
+
* Use to group two or more Radio components.
|
|
14
|
+
* Supports label and description text, sizes, invalid, and disabled state.
|
|
15
|
+
* Label is required and must be a string. Renders as <legend>.
|
|
16
|
+
*
|
|
17
|
+
* @component
|
|
18
|
+
*/
|
|
19
|
+
export declare const RadioGroup: {
|
|
20
|
+
({ children, className, description, invalid, label, size, ...restProps }: RadioGroupElementProps): React.JSX.Element;
|
|
21
|
+
displayName: string;
|
|
22
|
+
};
|
|
23
|
+
//# sourceMappingURL=RadioGroup.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RadioGroup.d.ts","sourceRoot":"","sources":["../../../src/components/radio-group/RadioGroup.tsx"],"names":[],"mappings":"AAAA,OAAO,aAAa,CAAA;AAKpB,OAAO,KAAK,EAAE,EAAE,sBAAsB,EAAE,MAAM,OAAO,CAAA;AAErD,MAAM,MAAM,cAAc,GAAG,IAAI,GAAG,IAAI,CAAA;AAExC,MAAM,WAAW,eAAe;IAC9B,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,CAAC,EAAE,cAAc,CAAA;CACtB;AAED,MAAM,MAAM,sBAAsB,GAAG,IAAI,CACvC,sBAAsB,CAAC,mBAAmB,CAAC,EAC3C,MAAM,eAAe,CACtB,GACC,eAAe,CAAA;AAEjB;;;;;;;GAOG;AACH,eAAO,MAAM,UAAU;+EAQpB,sBAAsB;;CAiCxB,CAAA"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import Icon from '../../utilities/Icon.js';
|
|
2
|
+
import { useId } from '../../utilities/useId.js';
|
|
3
|
+
import classNames from 'classnames';
|
|
4
|
+
import React from 'react';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* A radio group component that renders as a fieldset with legend.
|
|
8
|
+
* Use to group two or more Radio components.
|
|
9
|
+
* Supports label and description text, sizes, invalid, and disabled state.
|
|
10
|
+
* Label is required and must be a string. Renders as <legend>.
|
|
11
|
+
*
|
|
12
|
+
* @component
|
|
13
|
+
*/
|
|
14
|
+
const RadioGroup = ({ children, className, description, invalid, label, size = "md", ...restProps }) => {
|
|
15
|
+
const combinedClassName = classNames("tds-radio-group", size && size === "sm" && "tds-radio-group--sm", className);
|
|
16
|
+
const stableId = useId();
|
|
17
|
+
const displayDescription = description || (invalid ? "Please select an option" : undefined);
|
|
18
|
+
const descriptionId = `tds-radio-group-${stableId}-description`;
|
|
19
|
+
return (React.createElement("fieldset", { ...restProps, "aria-describedby": displayDescription ? descriptionId : undefined, "aria-invalid": invalid ? "true" : undefined, className: combinedClassName },
|
|
20
|
+
React.createElement("legend", null, label),
|
|
21
|
+
displayDescription && (React.createElement("p", { id: descriptionId, className: "tds-radio-group-description" },
|
|
22
|
+
React.createElement(Icon, { className: "tds-radio-group-description-invalid-icon", symbol: "general#exclamation-triangle", "aria-hidden": true }),
|
|
23
|
+
displayDescription)),
|
|
24
|
+
React.createElement("div", { className: "tds-radio-group-fields" }, children)));
|
|
25
|
+
};
|
|
26
|
+
RadioGroup.displayName = "RadioGroup";
|
|
27
|
+
|
|
28
|
+
export { RadioGroup };
|
|
29
|
+
//# sourceMappingURL=RadioGroup.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RadioGroup.js","sources":["../../../src/components/radio-group/RadioGroup.tsx"],"sourcesContent":["import \"./index.css\"\n\nimport Icon from \"@utilities/Icon\"\nimport { useId } from \"@utilities/useId\"\nimport classNames from \"classnames\"\nimport React, { FieldsetHTMLAttributes } from \"react\"\n\nexport type RadioGroupSize = \"md\" | \"sm\"\n\nexport interface RadioGroupProps {\n description?: string\n invalid?: boolean\n label: string\n size?: RadioGroupSize\n}\n\nexport type RadioGroupElementProps = Omit<\n FieldsetHTMLAttributes<HTMLFieldSetElement>,\n keyof RadioGroupProps\n> &\n RadioGroupProps\n\n/**\n * A radio group component that renders as a fieldset with legend.\n * Use to group two or more Radio components.\n * Supports label and description text, sizes, invalid, and disabled state.\n * Label is required and must be a string. Renders as <legend>.\n *\n * @component\n */\nexport const RadioGroup = ({\n children,\n className,\n description,\n invalid,\n label,\n size = \"md\",\n ...restProps\n}: RadioGroupElementProps) => {\n const combinedClassName = classNames(\n \"tds-radio-group\",\n size && size === \"sm\" && \"tds-radio-group--sm\",\n className\n )\n const stableId = useId()\n\n const displayDescription =\n description || (invalid ? \"Please select an option\" : undefined)\n const descriptionId = `tds-radio-group-${stableId}-description`\n\n return (\n <fieldset\n {...restProps}\n aria-describedby={displayDescription ? descriptionId : undefined}\n aria-invalid={invalid ? \"true\" : undefined}\n className={combinedClassName}\n >\n <legend>{label}</legend>\n {displayDescription && (\n <p id={descriptionId} className=\"tds-radio-group-description\">\n <Icon\n className=\"tds-radio-group-description-invalid-icon\"\n symbol=\"general#exclamation-triangle\"\n aria-hidden\n />\n {displayDescription}\n </p>\n )}\n <div className=\"tds-radio-group-fields\">{children}</div>\n </fieldset>\n )\n}\n\nRadioGroup.displayName = \"RadioGroup\"\n"],"names":[],"mappings":";;;;;AAsBA;;;;;;;AAOG;AACI,MAAM,UAAU,GAAG,CAAC,EACzB,QAAQ,EACR,SAAS,EACT,WAAW,EACX,OAAO,EACP,KAAK,EACL,IAAI,GAAG,IAAI,EACX,GAAG,SAAS,EACW,KAAI;AAC3B,IAAA,MAAM,iBAAiB,GAAG,UAAU,CAClC,iBAAiB,EACjB,IAAI,IAAI,IAAI,KAAK,IAAI,IAAI,qBAAqB,EAC9C,SAAS,CACV;AACD,IAAA,MAAM,QAAQ,GAAG,KAAK,EAAE;AAExB,IAAA,MAAM,kBAAkB,GACtB,WAAW,KAAK,OAAO,GAAG,yBAAyB,GAAG,SAAS,CAAC;AAClE,IAAA,MAAM,aAAa,GAAG,CAAA,gBAAA,EAAmB,QAAQ,cAAc;IAE/D,QACE,KAAA,CAAA,aAAA,CAAA,UAAA,EAAA,EAAA,GACM,SAAS,EAAA,kBAAA,EACK,kBAAkB,GAAG,aAAa,GAAG,SAAS,kBAClD,OAAO,GAAG,MAAM,GAAG,SAAS,EAC1C,SAAS,EAAE,iBAAiB,EAAA;AAE5B,QAAA,KAAA,CAAA,aAAA,CAAA,QAAA,EAAA,IAAA,EAAS,KAAK,CAAU;QACvB,kBAAkB,KACjB,KAAA,CAAA,aAAA,CAAA,GAAA,EAAA,EAAG,EAAE,EAAE,aAA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