@planningcenter/tapestry 3.8.0-qa-1049.1 → 3.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/componentRegistration.js +7 -1
- package/dist/componentRegistration.js.map +1 -1
- package/dist/components/DataTable/DataTable.d.ts +39 -39
- package/dist/components/DataTable/DataTable.d.ts.map +1 -1
- package/dist/components/DataTable/DataTable.js +145 -24
- package/dist/components/DataTable/DataTable.js.map +1 -1
- package/dist/components/DataTable/DataTableColumn.d.ts +112 -0
- package/dist/components/DataTable/DataTableColumn.d.ts.map +1 -0
- package/dist/components/DataTable/DataTableColumnTypes.d.ts +60 -0
- package/dist/components/DataTable/DataTableColumnTypes.d.ts.map +1 -0
- package/dist/components/DataTable/DataTableColumnTypes.js +167 -0
- package/dist/components/DataTable/DataTableColumnTypes.js.map +1 -0
- package/dist/components/DataTable/DataTableRow.d.ts +2 -0
- package/dist/components/DataTable/DataTableRow.d.ts.map +1 -0
- package/dist/components/DataTable/DataTableRow.js +9 -0
- package/dist/components/DataTable/DataTableRow.js.map +1 -0
- package/dist/components/DataTable/index.d.ts +2 -1
- package/dist/components/DataTable/index.d.ts.map +1 -1
- package/dist/components/button-group/ButtonGroup.d.ts +35 -0
- package/dist/components/button-group/ButtonGroup.d.ts.map +1 -0
- package/dist/components/button-group/ButtonGroup.js +24 -0
- package/dist/components/button-group/ButtonGroup.js.map +1 -0
- package/dist/components/button-group/index.d.ts +4 -0
- package/dist/components/button-group/index.d.ts.map +1 -0
- package/dist/components/checkbox/Checkbox.d.ts +2 -2
- package/dist/components/checkbox/Checkbox.d.ts.map +1 -1
- package/dist/components/checkbox/Checkbox.js.map +1 -1
- package/dist/components/checkbox-group/CheckboxGroup.d.ts +1 -1
- package/dist/components/checkbox-group/CheckboxGroup.d.ts.map +1 -1
- package/dist/components/checkbox-group/CheckboxGroup.js.map +1 -1
- package/dist/components/combo-box/ComboBox.d.ts +1 -1
- package/dist/components/combo-box/ComboBox.d.ts.map +1 -1
- package/dist/components/combo-box/ComboBox.js.map +1 -1
- package/dist/components/date-picker/DatePicker.d.ts +2 -2
- package/dist/components/date-picker/DatePicker.d.ts.map +1 -1
- package/dist/components/date-picker/DatePicker.js +39 -39
- package/dist/components/date-picker/DatePicker.js.map +1 -1
- package/dist/components/dropdown/Dropdown.d.ts +9 -8
- package/dist/components/dropdown/Dropdown.d.ts.map +1 -1
- package/dist/components/dropdown/Dropdown.js +2 -2
- package/dist/components/dropdown/Dropdown.js.map +1 -1
- package/dist/components/input/Input.d.ts +1 -1
- package/dist/components/input/Input.d.ts.map +1 -1
- package/dist/components/input/Input.js.map +1 -1
- package/dist/components/input-text-base/InputTextBase.d.ts +1 -1
- package/dist/components/input-text-base/InputTextBase.d.ts.map +1 -1
- package/dist/components/input-text-base/InputTextBase.js.map +1 -1
- package/dist/components/modal/Modal.d.ts +20 -0
- package/dist/components/modal/Modal.d.ts.map +1 -0
- package/dist/components/modal/Modal.js +113 -0
- package/dist/components/modal/Modal.js.map +1 -0
- package/dist/components/modal/ModalBody.d.ts +21 -0
- package/dist/components/modal/ModalBody.d.ts.map +1 -0
- package/dist/components/modal/ModalBody.js +18 -0
- package/dist/components/modal/ModalBody.js.map +1 -0
- package/dist/components/modal/ModalContext.d.ts +9 -0
- package/dist/components/modal/ModalContext.d.ts.map +1 -0
- package/dist/components/modal/ModalContext.js +6 -0
- package/dist/components/modal/ModalContext.js.map +1 -0
- package/dist/components/modal/ModalFooter.d.ts +22 -0
- package/dist/components/modal/ModalFooter.d.ts.map +1 -0
- package/dist/components/modal/ModalFooter.js +21 -0
- package/dist/components/modal/ModalFooter.js.map +1 -0
- package/dist/components/modal/ModalHeader.d.ts +23 -0
- package/dist/components/modal/ModalHeader.d.ts.map +1 -0
- package/dist/components/modal/ModalHeader.js +32 -0
- package/dist/components/modal/ModalHeader.js.map +1 -0
- package/dist/components/modal/index.d.ts +10 -0
- package/dist/components/modal/index.d.ts.map +1 -0
- package/dist/components/number-stepper/NumberStepper.d.ts +1 -1
- package/dist/components/number-stepper/NumberStepper.d.ts.map +1 -1
- package/dist/components/number-stepper/NumberStepper.js +11 -11
- package/dist/components/number-stepper/NumberStepper.js.map +1 -1
- package/dist/components/radio/Radio.d.ts +2 -2
- package/dist/components/radio/Radio.d.ts.map +1 -1
- package/dist/components/radio/Radio.js.map +1 -1
- package/dist/components/radio-group/RadioGroup.d.ts +2 -2
- package/dist/components/radio-group/RadioGroup.d.ts.map +1 -1
- package/dist/components/radio-group/RadioGroup.js.map +1 -1
- package/dist/components/select/Select.d.ts +1 -1
- package/dist/components/select/Select.d.ts.map +1 -1
- package/dist/components/select/Select.js +6 -6
- package/dist/components/select/Select.js.map +1 -1
- package/dist/components/select/SelectNative.js +6 -6
- package/dist/components/select/SelectNative.js.map +1 -1
- package/dist/components/select/SelectOptions.js +9 -9
- package/dist/components/select/SelectOptions.js.map +1 -1
- package/dist/components/select/SelectPopover.js +14 -14
- package/dist/components/select/SelectPopover.js.map +1 -1
- package/dist/components/text-area/TextArea.d.ts +1 -1
- package/dist/components/text-area/TextArea.d.ts.map +1 -1
- package/dist/components/text-area/TextArea.js.map +1 -1
- package/dist/components/time-field/TimeField.d.ts +1 -1
- package/dist/components/time-field/TimeField.d.ts.map +1 -1
- package/dist/components/time-field/TimeField.js.map +1 -1
- package/dist/components/toggle-switch/ToggleSwitch.d.ts +2 -2
- package/dist/components/toggle-switch/ToggleSwitch.d.ts.map +1 -1
- package/dist/components/toggle-switch/ToggleSwitch.js.map +1 -1
- package/dist/ext/@internationalized/date/dist/private/DateFormatter.js +139 -0
- package/dist/ext/@internationalized/date/dist/private/DateFormatter.js.map +1 -0
- package/dist/index.css +159 -4
- package/dist/index.css.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -0
- package/dist/index.js.map +1 -1
- package/dist/packages/tapestry-render/dist/buildComponent-Dr2UOgFa.js.map +1 -0
- package/dist/packages/tapestry-render/dist/index.js.map +1 -0
- package/dist/packages/tapestry-render/dist/legacy.js.map +1 -0
- package/dist/packages/tapestry-render/dist/registry.js.map +1 -0
- package/dist/reactRender.css +4454 -4114
- package/dist/reactRender.css.map +1 -1
- package/dist/reactRender.js +2 -2
- package/dist/reactRenderLegacy.css +4454 -4114
- package/dist/reactRenderLegacy.css.map +1 -1
- package/dist/reactRenderLegacy.js +2 -2
- package/dist/unstable.css +374 -34
- package/dist/unstable.css.map +1 -1
- package/dist/unstable.js +5 -0
- package/dist/unstable.js.map +1 -1
- package/dist/utilities/Icon.js +2 -2
- package/dist/utilities/Icon.js.map +1 -1
- package/package.json +5 -5
- package/dist/tapestry-render/dist/buildComponent-Dr2UOgFa.js.map +0 -1
- package/dist/tapestry-render/dist/index.js.map +0 -1
- package/dist/tapestry-render/dist/legacy.js.map +0 -1
- package/dist/tapestry-render/dist/registry.js.map +0 -1
- /package/dist/{tapestry-render → packages/tapestry-render}/dist/buildComponent-Dr2UOgFa.js +0 -0
- /package/dist/{tapestry-render → packages/tapestry-render}/dist/index.js +0 -0
- /package/dist/{tapestry-render → packages/tapestry-render}/dist/legacy.js +0 -0
- /package/dist/{tapestry-render → packages/tapestry-render}/dist/registry.js +0 -0
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import { useId } from '../../utilities/useId.js';
|
|
2
|
+
import classNames from 'classnames';
|
|
3
|
+
import React__default, { forwardRef, useRef, useEffect, useCallback } from 'react';
|
|
4
|
+
import { ModalContext } from './ModalContext.js';
|
|
5
|
+
|
|
6
|
+
function supportsRequestClose(dialogEl) {
|
|
7
|
+
return "requestClose" in dialogEl;
|
|
8
|
+
}
|
|
9
|
+
function supportsClosedBy(dialogEl) {
|
|
10
|
+
return "closedBy" in dialogEl;
|
|
11
|
+
}
|
|
12
|
+
function getActiveFocusableElement() {
|
|
13
|
+
return document.activeElement instanceof HTMLElement
|
|
14
|
+
? document.activeElement
|
|
15
|
+
: null;
|
|
16
|
+
}
|
|
17
|
+
function isBackdropClick(event, dialogEl) {
|
|
18
|
+
return event.target === dialogEl;
|
|
19
|
+
}
|
|
20
|
+
function closeViaRequestOrDirect(dialogEl, dismissible) {
|
|
21
|
+
const dialogWithRequestClose = dialogEl;
|
|
22
|
+
if (supportsRequestClose(dialogEl)) {
|
|
23
|
+
dialogWithRequestClose.requestClose?.();
|
|
24
|
+
}
|
|
25
|
+
else if (dismissible) {
|
|
26
|
+
dialogEl.close();
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
const Modal = forwardRef(function Modal({ children, className, dismissible = false, id, onClose, open, size = "md", ...restProps }, ref) {
|
|
30
|
+
const stableId = useId();
|
|
31
|
+
const modalId = id || `tds-modal-${stableId}`;
|
|
32
|
+
const titleId = `${modalId}-title`;
|
|
33
|
+
const subtitleId = `${modalId}-subtitle`;
|
|
34
|
+
const dialogRef = useRef(null);
|
|
35
|
+
const previouslyFocusedElementRef = useRef(null);
|
|
36
|
+
const onCloseRef = useRef(onClose);
|
|
37
|
+
const requestClose = () => {
|
|
38
|
+
const dialogEl = dialogRef.current;
|
|
39
|
+
if (dialogEl)
|
|
40
|
+
closeViaRequestOrDirect(dialogEl, dismissible);
|
|
41
|
+
};
|
|
42
|
+
const contextValue = { dismissible, requestClose, subtitleId, titleId };
|
|
43
|
+
useEffect(() => {
|
|
44
|
+
onCloseRef.current = onClose;
|
|
45
|
+
}, [onClose]);
|
|
46
|
+
const setDialogRef = useCallback((element) => {
|
|
47
|
+
dialogRef.current = element;
|
|
48
|
+
if (typeof ref === "function") {
|
|
49
|
+
ref(element);
|
|
50
|
+
}
|
|
51
|
+
else if (ref) {
|
|
52
|
+
ref.current = element;
|
|
53
|
+
}
|
|
54
|
+
}, [ref]);
|
|
55
|
+
useEffect(() => {
|
|
56
|
+
const dialogEl = dialogRef.current;
|
|
57
|
+
if (!dialogEl)
|
|
58
|
+
return;
|
|
59
|
+
if (open && !dialogEl.open) {
|
|
60
|
+
previouslyFocusedElementRef.current = getActiveFocusableElement();
|
|
61
|
+
dialogEl.showModal();
|
|
62
|
+
}
|
|
63
|
+
else if (!open && dialogEl.open) {
|
|
64
|
+
dialogEl.close();
|
|
65
|
+
}
|
|
66
|
+
}, [open]);
|
|
67
|
+
useEffect(() => {
|
|
68
|
+
const dialogEl = dialogRef.current;
|
|
69
|
+
if (!dialogEl)
|
|
70
|
+
return;
|
|
71
|
+
const handleClose = () => {
|
|
72
|
+
onCloseRef.current?.();
|
|
73
|
+
previouslyFocusedElementRef.current?.focus();
|
|
74
|
+
previouslyFocusedElementRef.current = null;
|
|
75
|
+
};
|
|
76
|
+
const handleCancel = (event) => {
|
|
77
|
+
if (!dismissible)
|
|
78
|
+
event.preventDefault();
|
|
79
|
+
};
|
|
80
|
+
dialogEl.addEventListener("close", handleClose);
|
|
81
|
+
dialogEl.addEventListener("cancel", handleCancel);
|
|
82
|
+
let handleBackdropClick;
|
|
83
|
+
if (supportsClosedBy(dialogEl)) {
|
|
84
|
+
dialogEl.setAttribute("closedby", dismissible ? "any" : "none");
|
|
85
|
+
}
|
|
86
|
+
else {
|
|
87
|
+
handleBackdropClick = (event) => {
|
|
88
|
+
if (isBackdropClick(event, dialogEl)) {
|
|
89
|
+
closeViaRequestOrDirect(dialogEl, dismissible);
|
|
90
|
+
}
|
|
91
|
+
};
|
|
92
|
+
dialogEl.addEventListener("click", handleBackdropClick);
|
|
93
|
+
}
|
|
94
|
+
return () => {
|
|
95
|
+
dialogEl.removeEventListener("close", handleClose);
|
|
96
|
+
dialogEl.removeEventListener("cancel", handleCancel);
|
|
97
|
+
if (handleBackdropClick) {
|
|
98
|
+
dialogEl.removeEventListener("click", handleBackdropClick);
|
|
99
|
+
}
|
|
100
|
+
};
|
|
101
|
+
}, [dismissible]);
|
|
102
|
+
const combinedClassName = classNames("tds-modal", {
|
|
103
|
+
"tds-modal--lg": size === "lg",
|
|
104
|
+
"tds-modal--sm": size === "sm",
|
|
105
|
+
"tds-modal--xl": size === "xl",
|
|
106
|
+
}, className);
|
|
107
|
+
return (React__default.createElement("dialog", { ...restProps, ref: setDialogRef, "aria-describedby": subtitleId, "aria-labelledby": titleId, className: combinedClassName, id: modalId },
|
|
108
|
+
React__default.createElement(ModalContext.Provider, { value: contextValue }, children)));
|
|
109
|
+
});
|
|
110
|
+
Modal.displayName = "Modal";
|
|
111
|
+
|
|
112
|
+
export { Modal };
|
|
113
|
+
//# sourceMappingURL=Modal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Modal.js","sources":["../../../src/components/modal/Modal.tsx"],"sourcesContent":["import \"./index.css\"\n\nimport { useId } from \"@utilities/useId\"\nimport classNames from \"classnames\"\nimport React, {\n type DialogHTMLAttributes,\n forwardRef,\n useCallback,\n useEffect,\n useRef,\n} from \"react\"\n\nimport { ModalContext } from \"./ModalContext\"\n\nexport type ModalSize = \"sm\" | \"md\" | \"lg\" | \"xl\"\n\nexport interface ModalProps {\n /**\n * A `<ModalHeader>` followed by a `<ModalBody>` and a `<ModalFooter>`.\n */\n children: React.ReactNode\n /** Default `false`. `true` enables Esc, backdrop-click, and the close button together. */\n dismissible?: boolean\n /** Fires on every dismissal — Esc, backdrop, close button, or programmatic. */\n onClose?: () => void\n /** Controls the dialog. Synced to `showModal()`/`close()`. */\n open: boolean\n /** Default `'md'`. */\n size?: ModalSize\n}\n\nexport type ModalElementProps = Omit<\n DialogHTMLAttributes<HTMLDialogElement>,\n keyof ModalProps | \"onCancel\"\n> &\n ModalProps\n\ntype DialogWithRequestClose = HTMLDialogElement & {\n requestClose?: (returnValue?: string) => void\n}\n\nfunction supportsRequestClose(dialogEl: HTMLDialogElement): boolean {\n return \"requestClose\" in dialogEl\n}\n\nfunction supportsClosedBy(dialogEl: HTMLDialogElement): boolean {\n return \"closedBy\" in dialogEl\n}\n\nfunction getActiveFocusableElement(): HTMLElement | null {\n return document.activeElement instanceof HTMLElement\n ? document.activeElement\n : null\n}\n\nfunction isBackdropClick(\n event: MouseEvent,\n dialogEl: HTMLDialogElement\n): boolean {\n return event.target === dialogEl\n}\n\nfunction closeViaRequestOrDirect(\n dialogEl: HTMLDialogElement,\n dismissible: boolean\n) {\n const dialogWithRequestClose = dialogEl as DialogWithRequestClose\n if (supportsRequestClose(dialogEl)) {\n dialogWithRequestClose.requestClose?.()\n } else if (dismissible) {\n dialogEl.close()\n }\n}\n\nexport const Modal = forwardRef<HTMLDialogElement, ModalElementProps>(\n function Modal(\n {\n children,\n className,\n dismissible = false,\n id,\n onClose,\n open,\n size = \"md\",\n ...restProps\n }: ModalElementProps,\n ref\n ) {\n const stableId = useId()\n const modalId = id || `tds-modal-${stableId}`\n const titleId = `${modalId}-title`\n const subtitleId = `${modalId}-subtitle`\n\n const dialogRef = useRef<HTMLDialogElement | null>(null)\n const previouslyFocusedElementRef = useRef<HTMLElement | null>(null)\n const onCloseRef = useRef(onClose)\n\n const requestClose = () => {\n const dialogEl = dialogRef.current\n if (dialogEl) closeViaRequestOrDirect(dialogEl, dismissible)\n }\n\n const contextValue = { dismissible, requestClose, subtitleId, titleId }\n\n useEffect(() => {\n onCloseRef.current = onClose\n }, [onClose])\n\n const setDialogRef = useCallback(\n (element: HTMLDialogElement | null) => {\n dialogRef.current = element\n if (typeof ref === \"function\") {\n ref(element)\n } else if (ref) {\n ref.current = element\n }\n },\n [ref]\n )\n\n useEffect(() => {\n const dialogEl = dialogRef.current\n if (!dialogEl) return\n\n if (open && !dialogEl.open) {\n previouslyFocusedElementRef.current = getActiveFocusableElement()\n dialogEl.showModal()\n } else if (!open && dialogEl.open) {\n dialogEl.close()\n }\n }, [open])\n\n useEffect(() => {\n const dialogEl = dialogRef.current\n if (!dialogEl) return\n\n const handleClose = () => {\n onCloseRef.current?.()\n previouslyFocusedElementRef.current?.focus()\n previouslyFocusedElementRef.current = null\n }\n\n const handleCancel = (event: Event) => {\n if (!dismissible) event.preventDefault()\n }\n\n dialogEl.addEventListener(\"close\", handleClose)\n dialogEl.addEventListener(\"cancel\", handleCancel)\n\n let handleBackdropClick: ((event: MouseEvent) => void) | undefined\n if (supportsClosedBy(dialogEl)) {\n dialogEl.setAttribute(\"closedby\", dismissible ? \"any\" : \"none\")\n } else {\n handleBackdropClick = (event) => {\n if (isBackdropClick(event, dialogEl)) {\n closeViaRequestOrDirect(dialogEl, dismissible)\n }\n }\n dialogEl.addEventListener(\"click\", handleBackdropClick)\n }\n\n return () => {\n dialogEl.removeEventListener(\"close\", handleClose)\n dialogEl.removeEventListener(\"cancel\", handleCancel)\n if (handleBackdropClick) {\n dialogEl.removeEventListener(\"click\", handleBackdropClick)\n }\n }\n }, [dismissible])\n\n const combinedClassName = classNames(\n \"tds-modal\",\n {\n \"tds-modal--lg\": size === \"lg\",\n \"tds-modal--sm\": size === \"sm\",\n \"tds-modal--xl\": size === \"xl\",\n },\n className\n )\n\n return (\n <dialog\n {...restProps}\n ref={setDialogRef}\n aria-describedby={subtitleId}\n aria-labelledby={titleId}\n className={combinedClassName}\n id={modalId}\n >\n <ModalContext.Provider value={contextValue}>\n {children}\n </ModalContext.Provider>\n </dialog>\n )\n }\n)\n\nModal.displayName = \"Modal\"\n"],"names":["React"],"mappings":";;;;;AAyCA,SAAS,oBAAoB,CAAC,QAA2B,EAAA;IACvD,OAAO,cAAc,IAAI,QAAQ;AACnC;AAEA,SAAS,gBAAgB,CAAC,QAA2B,EAAA;IACnD,OAAO,UAAU,IAAI,QAAQ;AAC/B;AAEA,SAAS,yBAAyB,GAAA;AAChC,IAAA,OAAO,QAAQ,CAAC,aAAa,YAAY;UACrC,QAAQ,CAAC;UACT,IAAI;AACV;AAEA,SAAS,eAAe,CACtB,KAAiB,EACjB,QAA2B,EAAA;AAE3B,IAAA,OAAO,KAAK,CAAC,MAAM,KAAK,QAAQ;AAClC;AAEA,SAAS,uBAAuB,CAC9B,QAA2B,EAC3B,WAAoB,EAAA;IAEpB,MAAM,sBAAsB,GAAG,QAAkC;AACjE,IAAA,IAAI,oBAAoB,CAAC,QAAQ,CAAC,EAAE;AAClC,QAAA,sBAAsB,CAAC,YAAY,IA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|
+
export interface ModalBodyProps {
|
|
4
|
+
/** Content to display between the header and footer. */
|
|
5
|
+
children: React.ReactNode;
|
|
6
|
+
/** Default `false`. `true` removes the body's horizontal padding. */
|
|
7
|
+
fullWidth?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export type ModalBodyElementProps = Omit<HTMLAttributes<HTMLDivElement>, keyof ModalBodyProps> & ModalBodyProps;
|
|
10
|
+
/**
|
|
11
|
+
* The body region of a `Modal` — holds arbitrary content between the header
|
|
12
|
+
* and footer.
|
|
13
|
+
*
|
|
14
|
+
* @component
|
|
15
|
+
* @see {@link https://planningcenter.github.io/tapestry/?path=/docs/components-modal--docs | Storybook Documentation}
|
|
16
|
+
*/
|
|
17
|
+
export declare function ModalBody({ children, className, fullWidth, ...restProps }: ModalBodyElementProps): React.JSX.Element;
|
|
18
|
+
export declare namespace ModalBody {
|
|
19
|
+
var displayName: string;
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=ModalBody.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ModalBody.d.ts","sourceRoot":"","sources":["../../../src/components/modal/ModalBody.tsx"],"names":[],"mappings":"AAAA,OAAO,aAAa,CAAA;AAGpB,OAAO,KAAK,EAAE,EAAE,KAAK,cAAc,EAAE,MAAM,OAAO,CAAA;AAElD,MAAM,WAAW,cAAc;IAC7B,wDAAwD;IACxD,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;IACzB,qEAAqE;IACrE,SAAS,CAAC,EAAE,OAAO,CAAA;CACpB;AAED,MAAM,MAAM,qBAAqB,GAAG,IAAI,CACtC,cAAc,CAAC,cAAc,CAAC,EAC9B,MAAM,cAAc,CACrB,GACC,cAAc,CAAA;AAEhB;;;;;;GAMG;AACH,wBAAgB,SAAS,CAAC,EACxB,QAAQ,EACR,SAAS,EACT,SAAS,EACT,GAAG,SAAS,EACb,EAAE,qBAAqB,qBAYvB;yBAjBe,SAAS"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import classNames from 'classnames';
|
|
2
|
+
import React__default from 'react';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* The body region of a `Modal` — holds arbitrary content between the header
|
|
6
|
+
* and footer.
|
|
7
|
+
*
|
|
8
|
+
* @component
|
|
9
|
+
* @see {@link https://planningcenter.github.io/tapestry/?path=/docs/components-modal--docs | Storybook Documentation}
|
|
10
|
+
*/
|
|
11
|
+
function ModalBody({ children, className, fullWidth, ...restProps }) {
|
|
12
|
+
const combinedClassName = classNames("tds-modal-body", { "tds-modal-body--full-width": fullWidth }, className);
|
|
13
|
+
return (React__default.createElement("div", { ...restProps, className: combinedClassName }, children));
|
|
14
|
+
}
|
|
15
|
+
ModalBody.displayName = "ModalBody";
|
|
16
|
+
|
|
17
|
+
export { ModalBody };
|
|
18
|
+
//# sourceMappingURL=ModalBody.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ModalBody.js","sources":["../../../src/components/modal/ModalBody.tsx"],"sourcesContent":["import \"./index.css\"\n\nimport classNames from \"classnames\"\nimport React, { type HTMLAttributes } from \"react\"\n\nexport interface ModalBodyProps {\n /** Content to display between the header and footer. */\n children: React.ReactNode\n /** Default `false`. `true` removes the body's horizontal padding. */\n fullWidth?: boolean\n}\n\nexport type ModalBodyElementProps = Omit<\n HTMLAttributes<HTMLDivElement>,\n keyof ModalBodyProps\n> &\n ModalBodyProps\n\n/**\n * The body region of a `Modal` — holds arbitrary content between the header\n * and footer.\n *\n * @component\n * @see {@link https://planningcenter.github.io/tapestry/?path=/docs/components-modal--docs | Storybook Documentation}\n */\nexport function ModalBody({\n children,\n className,\n fullWidth,\n ...restProps\n}: ModalBodyElementProps) {\n const combinedClassName = classNames(\n \"tds-modal-body\",\n { \"tds-modal-body--full-width\": fullWidth },\n className\n )\n\n return (\n <div {...restProps} className={combinedClassName}>\n {children}\n </div>\n )\n}\n\nModalBody.displayName = \"ModalBody\"\n"],"names":["React"],"mappings":";;;AAkBA;;;;;;AAMG;AACG,SAAU,SAAS,CAAC,EACxB,QAAQ,EACR,SAAS,EACT,SAAS,EACT,GAAG,SAAS,EACU,EAAA;AACtB,IAAA,MAAM,iBAAiB,GAAG,UAAU,CAClC,gBAAgB,EAChB,EAAE,4BAA4B,EAAE,SAAS,EAAE,EAC3C,SAAS,CACV;IAED,QACEA,cAAA,CAAA,aAAA,CAAA,KAAA,EAAA,EAAA,GAAS,SAAS,EAAE,SAAS,EAAE,iBAAiB,EAAA,EAC7C,QAAQ,CACL;AAEV;AAEA,SAAS,CAAC,WAAW,GAAG,WAAW;;;;"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export interface ModalContextValue {
|
|
3
|
+
dismissible: boolean;
|
|
4
|
+
requestClose: () => void;
|
|
5
|
+
subtitleId: string;
|
|
6
|
+
titleId: string;
|
|
7
|
+
}
|
|
8
|
+
export declare const ModalContext: React.Context<ModalContextValue | null>;
|
|
9
|
+
//# sourceMappingURL=ModalContext.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ModalContext.d.ts","sourceRoot":"","sources":["../../../src/components/modal/ModalContext.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,MAAM,WAAW,iBAAiB;IAChC,WAAW,EAAE,OAAO,CAAA;IACpB,YAAY,EAAE,MAAM,IAAI,CAAA;IACxB,UAAU,EAAE,MAAM,CAAA;IAClB,OAAO,EAAE,MAAM,CAAA;CAChB;AAED,eAAO,MAAM,YAAY,yCAAsD,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ModalContext.js","sources":["../../../src/components/modal/ModalContext.tsx"],"sourcesContent":["import React from \"react\"\n\nexport interface ModalContextValue {\n dismissible: boolean\n requestClose: () => void\n subtitleId: string\n titleId: string\n}\n\nexport const ModalContext = React.createContext<ModalContextValue | null>(null)\n"],"names":["React"],"mappings":";;AASO,MAAM,YAAY,GAAGA,cAAK,CAAC,aAAa,CAA2B,IAAI;;;;"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import "./index.css";
|
|
2
|
+
import React, { type HTMLAttributes } from "react";
|
|
3
|
+
export interface ModalFooterProps {
|
|
4
|
+
/** `Button` elements in source order; optionally one marked `slot="start"` for a leading button. */
|
|
5
|
+
children: React.ReactNode;
|
|
6
|
+
}
|
|
7
|
+
export type ModalFooterElementProps = Omit<HTMLAttributes<HTMLDivElement>, keyof ModalFooterProps> & ModalFooterProps;
|
|
8
|
+
/**
|
|
9
|
+
* The footer region of a `Modal`, intended for `Button` components.
|
|
10
|
+
*
|
|
11
|
+
* Buttons render in source order and are spaced automatically.
|
|
12
|
+
* By default, buttons are right-aligned. To pin a specific button
|
|
13
|
+
* to the far left (start edge), add the `slot="start"` attribute to it.
|
|
14
|
+
*
|
|
15
|
+
* @component
|
|
16
|
+
* @see {@link https://planningcenter.github.io/tapestry/?path=/docs/components-modal--docs | Storybook Documentation}
|
|
17
|
+
*/
|
|
18
|
+
export declare function ModalFooter({ children, className, ...restProps }: ModalFooterElementProps): React.JSX.Element;
|
|
19
|
+
export declare namespace ModalFooter {
|
|
20
|
+
var displayName: string;
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=ModalFooter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ModalFooter.d.ts","sourceRoot":"","sources":["../../../src/components/modal/ModalFooter.tsx"],"names":[],"mappings":"AAAA,OAAO,aAAa,CAAA;AAGpB,OAAO,KAAK,EAAE,EAAE,KAAK,cAAc,EAAE,MAAM,OAAO,CAAA;AAElD,MAAM,WAAW,gBAAgB;IAC/B,oGAAoG;IACpG,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAC1B;AAED,MAAM,MAAM,uBAAuB,GAAG,IAAI,CACxC,cAAc,CAAC,cAAc,CAAC,EAC9B,MAAM,gBAAgB,CACvB,GACC,gBAAgB,CAAA;AAElB;;;;;;;;;GASG;AACH,wBAAgB,WAAW,CAAC,EAC1B,QAAQ,EACR,SAAS,EACT,GAAG,SAAS,EACb,EAAE,uBAAuB,qBAQzB;yBAZe,WAAW"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import classNames from 'classnames';
|
|
2
|
+
import React__default from 'react';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* The footer region of a `Modal`, intended for `Button` components.
|
|
6
|
+
*
|
|
7
|
+
* Buttons render in source order and are spaced automatically.
|
|
8
|
+
* By default, buttons are right-aligned. To pin a specific button
|
|
9
|
+
* to the far left (start edge), add the `slot="start"` attribute to it.
|
|
10
|
+
*
|
|
11
|
+
* @component
|
|
12
|
+
* @see {@link https://planningcenter.github.io/tapestry/?path=/docs/components-modal--docs | Storybook Documentation}
|
|
13
|
+
*/
|
|
14
|
+
function ModalFooter({ children, className, ...restProps }) {
|
|
15
|
+
const combinedClassName = classNames("tds-modal-footer", className);
|
|
16
|
+
return (React__default.createElement("footer", { ...restProps, className: combinedClassName }, children));
|
|
17
|
+
}
|
|
18
|
+
ModalFooter.displayName = "ModalFooter";
|
|
19
|
+
|
|
20
|
+
export { ModalFooter };
|
|
21
|
+
//# sourceMappingURL=ModalFooter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ModalFooter.js","sources":["../../../src/components/modal/ModalFooter.tsx"],"sourcesContent":["import \"./index.css\"\n\nimport classNames from \"classnames\"\nimport React, { type HTMLAttributes } from \"react\"\n\nexport interface ModalFooterProps {\n /** `Button` elements in source order; optionally one marked `slot=\"start\"` for a leading button. */\n children: React.ReactNode\n}\n\nexport type ModalFooterElementProps = Omit<\n HTMLAttributes<HTMLDivElement>,\n keyof ModalFooterProps\n> &\n ModalFooterProps\n\n/**\n * The footer region of a `Modal`, intended for `Button` components.\n *\n * Buttons render in source order and are spaced automatically.\n * By default, buttons are right-aligned. To pin a specific button\n * to the far left (start edge), add the `slot=\"start\"` attribute to it.\n *\n * @component\n * @see {@link https://planningcenter.github.io/tapestry/?path=/docs/components-modal--docs | Storybook Documentation}\n */\nexport function ModalFooter({\n children,\n className,\n ...restProps\n}: ModalFooterElementProps) {\n const combinedClassName = classNames(\"tds-modal-footer\", className)\n\n return (\n <footer {...restProps} className={combinedClassName}>\n {children}\n </footer>\n )\n}\n\nModalFooter.displayName = \"ModalFooter\"\n"],"names":["React"],"mappings":";;;AAgBA;;;;;;;;;AASG;AACG,SAAU,WAAW,CAAC,EAC1B,QAAQ,EACR,SAAS,EACT,GAAG,SAAS,EACY,EAAA;IACxB,MAAM,iBAAiB,GAAG,UAAU,CAAC,kBAAkB,EAAE,SAAS,CAAC;IAEnE,QACEA,cAAA,CAAA,aAAA,CAAA,QAAA,EAAA,EAAA,GAAY,SAAS,EAAE,SAAS,EAAE,iBAAiB,EAAA,EAChD,QAAQ,CACF;AAEb;AAEA,WAAW,CAAC,WAAW,GAAG,aAAa;;;;"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import "./index.css";
|
|
2
|
+
import React, { type HTMLAttributes } from "react";
|
|
3
|
+
export interface ModalHeaderProps {
|
|
4
|
+
/** Secondary line under the title. */
|
|
5
|
+
subtitle?: string;
|
|
6
|
+
/** The dialog's accessible name. */
|
|
7
|
+
title: string;
|
|
8
|
+
}
|
|
9
|
+
export type ModalHeaderElementProps = Omit<HTMLAttributes<HTMLDivElement>, keyof ModalHeaderProps | "children"> & ModalHeaderProps;
|
|
10
|
+
/**
|
|
11
|
+
* The header region of a `Modal` — renders the title, an optional subtitle,
|
|
12
|
+
* and the close button. `dismissible` on `Modal` controls whether the close
|
|
13
|
+
* button renders here, so there's a single knob rather than a second prop to
|
|
14
|
+
* keep in sync. Must be rendered inside a `Modal`.
|
|
15
|
+
*
|
|
16
|
+
* @component
|
|
17
|
+
* @see {@link https://planningcenter.github.io/tapestry/?path=/docs/components-modal--docs | Storybook Documentation}
|
|
18
|
+
*/
|
|
19
|
+
export declare function ModalHeader({ className, subtitle, title, ...restProps }: ModalHeaderElementProps): React.JSX.Element;
|
|
20
|
+
export declare namespace ModalHeader {
|
|
21
|
+
var displayName: string;
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=ModalHeader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ModalHeader.d.ts","sourceRoot":"","sources":["../../../src/components/modal/ModalHeader.tsx"],"names":[],"mappings":"AAAA,OAAO,aAAa,CAAA;AAKpB,OAAO,KAAK,EAAE,EAAE,KAAK,cAAc,EAAc,MAAM,OAAO,CAAA;AAI9D,MAAM,WAAW,gBAAgB;IAC/B,sCAAsC;IACtC,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,oCAAoC;IACpC,KAAK,EAAE,MAAM,CAAA;CACd;AAED,MAAM,MAAM,uBAAuB,GAAG,IAAI,CACxC,cAAc,CAAC,cAAc,CAAC,EAC9B,MAAM,gBAAgB,GAAG,UAAU,CACpC,GACC,gBAAgB,CAAA;AAElB;;;;;;;;GAQG;AACH,wBAAgB,WAAW,CAAC,EAC1B,SAAS,EACT,QAAQ,EACR,KAAK,EACL,GAAG,SAAS,EACb,EAAE,uBAAuB,qBA2BzB;yBAhCe,WAAW"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import '../button/Button.js';
|
|
2
|
+
import '../button/DropdownButton.js';
|
|
3
|
+
import '../button/DropdownIconButton.js';
|
|
4
|
+
import { IconButton } from '../button/IconButton.js';
|
|
5
|
+
import '../button/LoadingButton.js';
|
|
6
|
+
import '../button/PageHeaderActionsDropdownButton.js';
|
|
7
|
+
import Icon from '../../utilities/Icon.js';
|
|
8
|
+
import classNames from 'classnames';
|
|
9
|
+
import React__default, { useContext } from 'react';
|
|
10
|
+
import { ModalContext } from './ModalContext.js';
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* The header region of a `Modal` — renders the title, an optional subtitle,
|
|
14
|
+
* and the close button. `dismissible` on `Modal` controls whether the close
|
|
15
|
+
* button renders here, so there's a single knob rather than a second prop to
|
|
16
|
+
* keep in sync. Must be rendered inside a `Modal`.
|
|
17
|
+
*
|
|
18
|
+
* @component
|
|
19
|
+
* @see {@link https://planningcenter.github.io/tapestry/?path=/docs/components-modal--docs | Storybook Documentation}
|
|
20
|
+
*/
|
|
21
|
+
function ModalHeader({ className, subtitle, title, ...restProps }) {
|
|
22
|
+
const { dismissible, requestClose, subtitleId, titleId } = useContext(ModalContext) ?? {};
|
|
23
|
+
const combinedClassName = classNames("tds-modal-header", className);
|
|
24
|
+
return (React__default.createElement("header", { ...restProps, className: combinedClassName },
|
|
25
|
+
React__default.createElement("h2", { className: "tds-modal-title", id: titleId }, title),
|
|
26
|
+
subtitle && (React__default.createElement("p", { className: "tds-modal-subtitle", id: subtitleId }, subtitle)),
|
|
27
|
+
dismissible && (React__default.createElement(IconButton, { "aria-label": "Close", className: "tds-modal-close", icon: React__default.createElement(Icon, { "aria-hidden": true, symbol: "general#x" }), kind: "ghost", onClick: requestClose, size: "sm" }))));
|
|
28
|
+
}
|
|
29
|
+
ModalHeader.displayName = "ModalHeader";
|
|
30
|
+
|
|
31
|
+
export { ModalHeader };
|
|
32
|
+
//# sourceMappingURL=ModalHeader.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ModalHeader.js","sources":["../../../src/components/modal/ModalHeader.tsx"],"sourcesContent":["import \"./index.css\"\n\nimport { IconButton } from \"@components/button\"\nimport Icon from \"@utilities/Icon\"\nimport classNames from \"classnames\"\nimport React, { type HTMLAttributes, useContext } from \"react\"\n\nimport { ModalContext } from \"./ModalContext\"\n\nexport interface ModalHeaderProps {\n /** Secondary line under the title. */\n subtitle?: string\n /** The dialog's accessible name. */\n title: string\n}\n\nexport type ModalHeaderElementProps = Omit<\n HTMLAttributes<HTMLDivElement>,\n keyof ModalHeaderProps | \"children\"\n> &\n ModalHeaderProps\n\n/**\n * The header region of a `Modal` — renders the title, an optional subtitle,\n * and the close button. `dismissible` on `Modal` controls whether the close\n * button renders here, so there's a single knob rather than a second prop to\n * keep in sync. Must be rendered inside a `Modal`.\n *\n * @component\n * @see {@link https://planningcenter.github.io/tapestry/?path=/docs/components-modal--docs | Storybook Documentation}\n */\nexport function ModalHeader({\n className,\n subtitle,\n title,\n ...restProps\n}: ModalHeaderElementProps) {\n const { dismissible, requestClose, subtitleId, titleId } =\n useContext(ModalContext) ?? {}\n const combinedClassName = classNames(\"tds-modal-header\", className)\n\n return (\n <header {...restProps} className={combinedClassName}>\n <h2 className=\"tds-modal-title\" id={titleId}>\n {title}\n </h2>\n {subtitle && (\n <p className=\"tds-modal-subtitle\" id={subtitleId}>\n {subtitle}\n </p>\n )}\n {dismissible && (\n <IconButton\n aria-label=\"Close\"\n className=\"tds-modal-close\"\n icon={<Icon aria-hidden symbol=\"general#x\" />}\n kind=\"ghost\"\n onClick={requestClose}\n size=\"sm\"\n />\n )}\n </header>\n )\n}\n\nModalHeader.displayName = \"ModalHeader\"\n"],"names":["React"],"mappings":";;;;;;;;;;;AAsBA;;;;;;;;AAQG;AACG,SAAU,WAAW,CAAC,EAC1B,SAAS,EACT,QAAQ,EACR,KAAK,EACL,GAAG,SAAS,EACY,EAAA;AACxB,IAAA,MAAM,EAAE,WAAW,EAAE,YAAY,EAAE,UAAU,EAAE,OAAO,EAAE,GACtD,UAAU,CAAC,YAAY,CAAC,IAAI,EAAE;IAChC,MAAM,iBAAiB,GAAG,UAAU,CAAC,kBAAkB,EAAE,SAAS,CAAC;AAEnE,IAAA,QACEA,cAAA,CAAA,aAAA,CAAA,QAAA,EAAA,EAAA,GAAY,SAAS,EAAE,SAAS,EAAE,iBAAiB,EAAA;QACjDA,cAAA,CAAA,aAAA,CAAA,IAAA,EAAA,EAAI,SAAS,EAAC,iBAAiB,EAAC,EAAE,EAAE,OAAO,EAAA,EACxC,KAAK,CACH;AACJ,QAAA,QAAQ,KACPA,cAAA,CAAA,aAAA,CAAA,GAAA,EAAA,EAAG,SAAS,EAAC,oBAAoB,EAAC,EAAE,EAAE,UAAU,EAAA,EAC7C,QAAQ,CACP,CACL;AACA,QAAA,WAAW,KACVA,cAAA,CAAA,aAAA,CAAC,UAAU,EAAA,EAAA,YAAA,EACE,OAAO,EAClB,SAAS,EAAC,iBAAiB,EAC3B,IAAI,EAAEA,cAAA,CAAA,aAAA,CAAC,IAAI,yBAAa,MAAM,EAAC,WAAW,EAAA,CAAG,EAC7C,IAAI,EAAC,OAAO,EACZ,OAAO,EAAE,YAAY,EACrB,IAAI,EAAC,IAAI,EAAA,CACT,CACH,CACM;AAEb;AAEA,WAAW,CAAC,WAAW,GAAG,aAAa;;;;"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import "./index.css";
|
|
2
|
+
export type { ModalElementProps, ModalProps, ModalSize } from "./Modal";
|
|
3
|
+
export { Modal } from "./Modal";
|
|
4
|
+
export type { ModalBodyElementProps, ModalBodyProps } from "./ModalBody";
|
|
5
|
+
export { ModalBody } from "./ModalBody";
|
|
6
|
+
export type { ModalFooterElementProps, ModalFooterProps } from "./ModalFooter";
|
|
7
|
+
export { ModalFooter } from "./ModalFooter";
|
|
8
|
+
export type { ModalHeaderElementProps, ModalHeaderProps } from "./ModalHeader";
|
|
9
|
+
export { ModalHeader } from "./ModalHeader";
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/modal/index.ts"],"names":[],"mappings":"AAAA,OAAO,aAAa,CAAA;AAEpB,YAAY,EAAE,iBAAiB,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,SAAS,CAAA;AACvE,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAC/B,YAAY,EAAE,qBAAqB,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AACxE,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AACvC,YAAY,EAAE,uBAAuB,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAA;AAC9E,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAC3C,YAAY,EAAE,uBAAuB,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAA;AAC9E,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA"}
|
|
@@ -9,7 +9,7 @@ export interface NumberStepperProps {
|
|
|
9
9
|
/** The default uncontrolled value. */
|
|
10
10
|
defaultValue?: number;
|
|
11
11
|
/** Helper text displayed below the component. Styled as error text when `invalid` is `true`. */
|
|
12
|
-
description?:
|
|
12
|
+
description?: React.ReactNode;
|
|
13
13
|
/** Disables the input and stepper buttons. */
|
|
14
14
|
disabled?: boolean;
|
|
15
15
|
/** If `true`, renders the label visually hidden. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NumberStepper.d.ts","sourceRoot":"","sources":["../../../src/components/number-stepper/NumberStepper.tsx"],"names":[],"mappings":"AAAA,OAAO,mBAAmB,CAAA;AAC1B,OAAO,oBAAoB,CAAA;AAC3B,OAAO,aAAa,CAAA;AAGpB,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,2BAA2B,CAAA;AAEhF,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAML,KAAK,gBAAgB,IAAI,oBAAoB,EAE9C,MAAM,mCAAmC,CAAA;AAE1C,MAAM,MAAM,iBAAiB,GAAG,IAAI,GAAG,IAAI,CAAA;AAE3C,MAAM,WAAW,kBAAkB;IACjC,sCAAsC;IACtC,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,gGAAgG;IAChG,WAAW,CAAC,EAAE,
|
|
1
|
+
{"version":3,"file":"NumberStepper.d.ts","sourceRoot":"","sources":["../../../src/components/number-stepper/NumberStepper.tsx"],"names":[],"mappings":"AAAA,OAAO,mBAAmB,CAAA;AAC1B,OAAO,oBAAoB,CAAA;AAC3B,OAAO,aAAa,CAAA;AAGpB,OAAO,KAAK,EAAE,+BAA+B,EAAE,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AAQ,EACR,QAAQ,EACR,IAAW,EACX,GAAG,SAAS,EACb,EAAE,yBAAyB,qBAmD3B"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import Icon from '../../utilities/Icon.js';
|
|
2
2
|
import classNames from 'classnames';
|
|
3
|
-
import
|
|
3
|
+
import React from 'react';
|
|
4
4
|
import { NumberField, Label, Group, Input, Button, Text } from 'react-aria-components/NumberField';
|
|
5
5
|
|
|
6
6
|
/**
|
|
@@ -19,16 +19,16 @@ function NumberStepper({ className, defaultValue, description, disabled, hideLab
|
|
|
19
19
|
"tds-field--lg": size === "lg",
|
|
20
20
|
"tds-number-stepper--lg": size === "lg",
|
|
21
21
|
}, className);
|
|
22
|
-
return (
|
|
23
|
-
!hideLabel &&
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
description && (
|
|
31
|
-
|
|
22
|
+
return (React.createElement(NumberField, { ...restProps, "aria-label": hideLabel ? label : undefined, className: combinedClassName, defaultValue: defaultValue, isDisabled: disabled, isInvalid: invalid, isReadOnly: readOnly, isRequired: required, maxValue: max, minValue: min },
|
|
23
|
+
!hideLabel && React.createElement(Label, { className: "tds-field-label" }, label),
|
|
24
|
+
React.createElement(Group, { className: "tds-field-control tds-number-stepper-field" },
|
|
25
|
+
React.createElement(Input, { className: "tds-number-stepper-input" }),
|
|
26
|
+
React.createElement(Button, { className: "tds-btn tds-btn--infield tds-number-stepper-button", slot: "decrement" },
|
|
27
|
+
React.createElement(Icon, { "aria-hidden": true, symbol: "general#minus" })),
|
|
28
|
+
React.createElement(Button, { className: "tds-btn tds-btn--infield tds-number-stepper-button", slot: "increment" },
|
|
29
|
+
React.createElement(Icon, { "aria-hidden": true, symbol: "general#plus" }))),
|
|
30
|
+
description && (React.createElement(Text, { className: "tds-field-description", slot: "description" },
|
|
31
|
+
React.createElement(Icon, { "aria-hidden": true, className: "tds-field-description-invalid-icon", symbol: "general#exclamation-triangle" }),
|
|
32
32
|
description))));
|
|
33
33
|
}
|
|
34
34
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NumberStepper.js","sources":["../../../src/components/number-stepper/NumberStepper.tsx"],"sourcesContent":["import \"../button/btn.css\"\nimport \"../field/index.css\"\nimport \"./index.css\"\n\nimport Icon from \"@utilities/Icon\"\nimport type { CombineAriaPropsWithCustomProps } from \"@utilities/reactAriaProps\"\nimport classNames from \"classnames\"\nimport React from \"react\"\nimport {\n Button,\n Group,\n Input,\n Label,\n NumberField as AriaNumberField,\n type NumberFieldProps as AriaNumberFieldProps,\n Text,\n} from \"react-aria-components/NumberField\"\n\nexport type NumberStepperSize = \"md\" | \"lg\"\n\nexport interface NumberStepperProps {\n /** The default uncontrolled value. */\n defaultValue?: number\n /** Helper text displayed below the component. Styled as error text when `invalid` is `true`. */\n description?:
|
|
1
|
+
{"version":3,"file":"NumberStepper.js","sources":["../../../src/components/number-stepper/NumberStepper.tsx"],"sourcesContent":["import \"../button/btn.css\"\nimport \"../field/index.css\"\nimport \"./index.css\"\n\nimport Icon from \"@utilities/Icon\"\nimport type { CombineAriaPropsWithCustomProps } from \"@utilities/reactAriaProps\"\nimport classNames from \"classnames\"\nimport React from \"react\"\nimport {\n Button,\n Group,\n Input,\n Label,\n NumberField as AriaNumberField,\n type NumberFieldProps as AriaNumberFieldProps,\n Text,\n} from \"react-aria-components/NumberField\"\n\nexport type NumberStepperSize = \"md\" | \"lg\"\n\nexport interface NumberStepperProps {\n /** The default uncontrolled value. */\n defaultValue?: number\n /** Helper text displayed below the component. Styled as error text when `invalid` is `true`. */\n description?: React.ReactNode\n /** Disables the input and stepper buttons. */\n disabled?: boolean\n /** If `true`, renders the label visually hidden. */\n hideLabel?: boolean\n /** If `true`, applies error styling to the field and description. */\n invalid?: boolean\n /** Accessible label for the field. */\n label: string\n /** Maximum allowed value. */\n max?: number\n /** Minimum allowed value. */\n min?: number\n /** Allows the value to be read but not changed. */\n readOnly?: boolean\n /** If `true`, appends an asterisk after the label text. */\n required?: boolean\n /** The size of the number stepper. */\n size?: NumberStepperSize\n}\n\ntype AriaNumberFieldPropsToOmit =\n | \"children\"\n | \"render\"\n | \"slot\"\n | \"validate\"\n | \"validationBehavior\"\n\ntype AriaNumberFieldPropsToInclude =\n | \"formatOptions\"\n | \"name\"\n | \"onChange\"\n | \"step\"\n | \"value\"\n\nexport type NumberStepperElementProps = CombineAriaPropsWithCustomProps<\n AriaNumberFieldProps,\n NumberStepperProps,\n AriaNumberFieldPropsToOmit,\n AriaNumberFieldPropsToInclude\n>\n\n/**\n * A number stepper component that pairs a numeric input with increment and\n * decrement buttons. Use it when users need to enter or adjust a number by\n * small amounts, such as quantities or counts.\n *\n * Constrain the input with `min`, `max`, and `step`, and customize display\n * (currency, percentage, decimal precision) via the `formatOptions` prop.\n *\n * @component\n * @see {@link https://planningcenter.github.io/tapestry/?path=/docs/components-numberstepper--docs | Storybook Documentation}\n */\nexport function NumberStepper({\n className,\n defaultValue,\n description,\n disabled,\n hideLabel,\n invalid,\n label,\n max,\n min,\n readOnly,\n required,\n size = \"md\",\n ...restProps\n}: NumberStepperElementProps) {\n const combinedClassName = classNames(\n \"tds-field tds-number-stepper\",\n {\n \"tds-field--lg\": size === \"lg\",\n \"tds-number-stepper--lg\": size === \"lg\",\n },\n className\n )\n\n return (\n <AriaNumberField\n {...restProps}\n aria-label={hideLabel ? label : undefined}\n className={combinedClassName}\n defaultValue={defaultValue}\n isDisabled={disabled}\n isInvalid={invalid}\n isReadOnly={readOnly}\n isRequired={required}\n maxValue={max}\n minValue={min}\n >\n {!hideLabel && <Label className=\"tds-field-label\">{label}</Label>}\n <Group className=\"tds-field-control tds-number-stepper-field\">\n <Input className=\"tds-number-stepper-input\" />\n <Button\n className=\"tds-btn tds-btn--infield tds-number-stepper-button\"\n slot=\"decrement\"\n >\n <Icon aria-hidden symbol=\"general#minus\" />\n </Button>\n <Button\n className=\"tds-btn tds-btn--infield tds-number-stepper-button\"\n slot=\"increment\"\n >\n <Icon aria-hidden symbol=\"general#plus\" />\n </Button>\n </Group>\n {description && (\n <Text className=\"tds-field-description\" slot=\"description\">\n <Icon\n aria-hidden\n className=\"tds-field-description-invalid-icon\"\n symbol=\"general#exclamation-triangle\"\n />\n {description}\n </Text>\n )}\n </AriaNumberField>\n )\n}\n"],"names":["AriaNumberField"],"mappings":";;;;;AAkEA;;;;;;;;;;AAUG;AACG,SAAU,aAAa,CAAC,EAC5B,SAAS,EACT,YAAY,EACZ,WAAW,EACX,QAAQ,EACR,SAAS,EACT,OAAO,EACP,KAAK,EACL,GAAG,EACH,GAAG,EACH,QAAQ,EACR,QAAQ,EACR,IAAI,GAAG,IAAI,EACX,GAAG,SAAS,EACc,EAAA;AAC1B,IAAA,MAAM,iBAAiB,GAAG,UAAU,CAClC,8BAA8B,EAC9B;QACE,eAAe,EAAE,IAAI,KAAK,IAAI;QAC9B,wBAAwB,EAAE,IAAI,KAAK,IAAI;KACxC,EACD,SAAS,CACV;IAED,QACE,oBAACA,WAAe,EAAA,EAAA,GACV,SAAS,EAAA,YAAA,EACD,SAAS,GAAG,KAAK,GAAG,SAAS,EACzC,SAAS,EAAE,iBAAiB,EAC5B,YAAY,EAAE,YAAY,EAC1B,UAAU,EAAE,QAAQ,EACpB,SAAS,EAAE,OAAO,EAClB,UAAU,EAAE,QAAQ,EACpB,UAAU,EAAE,QAAQ,EACpB,QAAQ,EAAE,GAAG,EACb,QAAQ,EAAE,GAAG,EAAA;QAEZ,CAAC,SAAS,IAAI,KAAA,CAAA,aAAA,CAAC,KAAK,EAAA,EAAC,SAAS,EAAC,iBAAiB,EAAA,EAAE,KAAK,CAAS;AACjE,QAAA,KAAA,CAAA,aAAA,CAAC,KAAK,EAAA,EAAC,SAAS,EAAC,4CAA4C,EAAA;AAC3D,YAAA,KAAA,CAAA,aAAA,CAAC,KAAK,EAAA,EAAC,SAAS,EAAC,0BAA0B,EAAA,CAAG;YAC9C,KAAA,CAAA,aAAA,CAAC,MAAM,IACL,SAAS,EAAC,oDAAoD,EAC9D,IAAI,EAAC,WAAW,EAAA;AAEhB,gBAAA,KAAA,CAAA,aAAA,CAAC,IAAI,EAAA,EAAA,aAAA,EAAA,IAAA,EAAa,MAAM,EAAC,eAAe,GAAG,CACpC;YACT,KAAA,CAAA,aAAA,CAAC,MAAM,IACL,SAAS,EAAC,oDAAoD,EAC9D,IAAI,EAAC,WAAW,EAAA;AAEhB,gBAAA,KAAA,CAAA,aAAA,CAAC,IAAI,EAAA,EAAA,aAAA,EAAA,IAAA,EAAa,MAAM,EAAC,cAAc,EAAA,CAAG,CACnC,CACH;QACP,WAAW,KACV,KAAA,CAAA,aAAA,CAAC,IAAI,EAAA,EAAC,SAAS,EAAC,uBAAuB,EAAC,IAAI,EAAC,aAAa,EAAA;YACxD,KAAA,CAAA,aAAA,CAAC,IAAI,yBAEH,SAAS,EAAC,oCAAoC,EAC9C,MAAM,EAAC,8BAA8B,EAAA,CACrC;AACD,YAAA,WAAW,CACP,CACR,CACe;AAEtB;;;;"}
|
|
@@ -2,8 +2,8 @@ import "./index.css";
|
|
|
2
2
|
import React, { InputHTMLAttributes } from "react";
|
|
3
3
|
export type RadioSize = "md" | "sm";
|
|
4
4
|
interface RadioBaseProps {
|
|
5
|
-
/** Optional description
|
|
6
|
-
description?:
|
|
5
|
+
/** Optional description that appears below the radio label. */
|
|
6
|
+
description?: React.ReactNode;
|
|
7
7
|
/** The name of the radio group. All radios in the group must have the same name. */
|
|
8
8
|
name: string;
|
|
9
9
|
/** The size of the radio. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Radio.d.ts","sourceRoot":"","sources":["../../../src/components/radio/Radio.tsx"],"names":[],"mappings":"AAAA,OAAO,aAAa,CAAA;AAIpB,OAAO,KAAK,EAAE,EAAc,mBAAmB,EAAE,MAAM,OAAO,CAAA;AAE9D,MAAM,MAAM,SAAS,GAAG,IAAI,GAAG,IAAI,CAAA;AAEnC,UAAU,cAAc;IACtB
|
|
1
|
+
{"version":3,"file":"Radio.d.ts","sourceRoot":"","sources":["../../../src/components/radio/Radio.tsx"],"names":[],"mappings":"AAAA,OAAO,aAAa,CAAA;AAIpB,OAAO,KAAK,EAAE,EAAc,mBAAmB,EAAE,MAAM,OAAO,CAAA;AAE9D,MAAM,MAAM,SAAS,GAAG,IAAI,GAAG,IAAI,CAAA;AAEnC,UAAU,cAAc;IACtB,+DAA+D;IAC/D,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAC7B,oFAAoF;IACpF,IAAI,EAAE,MAAM,CAAA;IACZ,6BAA6B;IAC7B,IAAI,CAAC,EAAE,SAAS,CAAA;CACjB;AAED,UAAU,cAAe,SAAQ,cAAc;IAC7C,iBAAiB,CAAC,EAAE,KAAK,CAAA;IACzB;;;;;OAKG;IACH,KAAK,EAAE,KAAK,CAAC,SAAS,CAAA;CACvB;AAED,UAAU,uBAAwB,SAAQ,cAAc;IACtD,iBAAiB,EAAE,MAAM,CAAA;IACzB,KAAK,CAAC,EAAE,KAAK,CAAA;CACd;AAED,MAAM,MAAM,UAAU,GAAG,cAAc,GAAG,uBAAuB,CAAA;AAEjE,MAAM,MAAM,iBAAiB,GAAG,IAAI,CAClC,mBAAmB,CAAC,gBAAgB,CAAC,EACrC,MAAM,UAAU,GAAG,MAAM,CAC1B,GACC,UAAU,CAAA;AAEZ;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,KAAK,4FAuCjB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Radio.js","sources":["../../../src/components/radio/Radio.tsx"],"sourcesContent":["import \"./index.css\"\n\nimport { useId } from \"@utilities/useId\"\nimport classNames from \"classnames\"\nimport React, { forwardRef, InputHTMLAttributes } from \"react\"\n\nexport type RadioSize = \"md\" | \"sm\"\n\ninterface RadioBaseProps {\n /** Optional description
|
|
1
|
+
{"version":3,"file":"Radio.js","sources":["../../../src/components/radio/Radio.tsx"],"sourcesContent":["import \"./index.css\"\n\nimport { useId } from \"@utilities/useId\"\nimport classNames from \"classnames\"\nimport React, { forwardRef, InputHTMLAttributes } from \"react\"\n\nexport type RadioSize = \"md\" | \"sm\"\n\ninterface RadioBaseProps {\n /** Optional description that appears below the radio label. */\n description?: React.ReactNode\n /** The name of the radio group. All radios in the group must have the same name. */\n name: string\n /** The size of the radio. */\n size?: RadioSize\n}\n\ninterface RadioWithLabel extends RadioBaseProps {\n \"aria-labelledby\"?: never\n /**\n * Label content for the radio. When using non-string content\n * (e.g. JSX), it must not contain interactive elements. This\n * includes native HTML elements such as `<a>` and `<button>`, as\n * well as Tapestry or Tapestry-React interactive components.\n */\n label: React.ReactNode\n}\n\ninterface RadioWithAriaLabelledBy extends RadioBaseProps {\n \"aria-labelledby\": string\n label?: never\n}\n\nexport type RadioProps = RadioWithLabel | RadioWithAriaLabelledBy\n\nexport type RadioElementProps = Omit<\n InputHTMLAttributes<HTMLInputElement>,\n keyof RadioProps | \"type\"\n> &\n RadioProps\n\n/**\n * A radio component that renders as a radio input with label.\n * Supports various sizes.\n * Must have a name attribute.\n *\n * **Required:** You must provide either:\n * - `label` - Label content for the radio\n * - `aria-labelledby` - ID of an external element that provides the label\n *\n * When using non-string content for `label` (e.g. JSX), it must not contain\n * interactive elements. This includes native HTML elements such as `<a>` and\n * `<button>`, as well as Tapestry or Tapestry-React interactive components.\n *\n * @component\n * @see {@link https://planningcenter.github.io/tapestry/?path=/docs/components-radio--docs | Storybook Documentation}\n * @see {@link https://github.com/planningcenter/tapestry/tree/main/packages/tapestry-migration-cli | Migration CLI: Available}\n */\nexport const Radio = forwardRef<HTMLInputElement, RadioElementProps>(\n (\n {\n className,\n description,\n id,\n label,\n size = \"md\",\n ...restProps\n }: RadioElementProps,\n ref\n ) => {\n const combinedClassName = classNames(\n \"tds-radio\",\n size && size === \"sm\" && `tds-radio--sm`,\n className\n )\n\n const stableId = useId()\n const radioId = id || `tds-radio-${stableId}`\n\n return (\n <div className={combinedClassName}>\n <input\n {...restProps}\n aria-describedby={description ? `${radioId}-description` : undefined}\n id={radioId}\n ref={ref}\n type=\"radio\"\n />\n {label && <label htmlFor={radioId}>{label}</label>}\n {description && (\n <p id={`${radioId}-description`} className=\"tds-radio-description\">\n {description}\n </p>\n )}\n </div>\n )\n }\n)\n\nRadio.displayName = \"Radio\"\n"],"names":["React"],"mappings":";;;;AAyCA;;;;;;;;;;;;;;;;AAgBG;AACI,MAAM,KAAK,GAAG,UAAU,CAC7B,CACE,EACE,SAAS,EACT,WAAW,EACX,EAAE,EACF,KAAK,EACL,IAAI,GAAG,IAAI,EACX,GAAG,SAAS,EACM,EACpB,GAAG,KACD;AACF,IAAA,MAAM,iBAAiB,GAAG,UAAU,CAClC,WAAW,EACX,IAAI,IAAI,IAAI,KAAK,IAAI,IAAI,CAAA,aAAA,CAAe,EACxC,SAAS,CACV;AAED,IAAA,MAAM,QAAQ,GAAG,KAAK,EAAE;AACxB,IAAA,MAAM,OAAO,GAAG,EAAE,IAAI,CAAA,UAAA,EAAa,QAAQ,EAAE;AAE7C,IAAA,QACEA,cAAA,CAAA,aAAA,CAAA,KAAA,EAAA,EAAK,SAAS,EAAE,iBAAiB,EAAA;QAC/BA,cAAA,CAAA,aAAA,CAAA,OAAA,EAAA,EAAA,GACM,SAAS,EAAA,kBAAA,EACK,WAAW,GAAG,CAAA,EAAG,OAAO,CAAA,YAAA,CAAc,GAAG,SAAS,EACpE,EAAE,EAAE,OAAO,EACX,GAAG,EAAE,GAAG,EACR,IAAI,EAAC,OAAO,EAAA,CACZ;AACD,QAAA,KAAK,IAAIA,cAAA,CAAA,aAAA,CAAA,OAAA,EAAA,EAAO,OAAO,EAAE,OAAO,EAAA,EAAG,KAAK,CAAS;AACjD,QAAA,WAAW,KACVA,cAAA,CAAA,aAAA,CAAA,GAAA,EAAA,EAAG,EAAE,EAAE,CAAA,EAAG,OAAO,CAAA,YAAA,CAAc,EAAE,SAAS,EAAC,uBAAuB,EAAA,EAC/D,WAAW,CACV,CACL,CACG;AAEV,CAAC;AAGH,KAAK,CAAC,WAAW,GAAG,OAAO;;;;"}
|
|
@@ -2,8 +2,8 @@ import "./index.css";
|
|
|
2
2
|
import React, { FieldsetHTMLAttributes } from "react";
|
|
3
3
|
export type RadioGroupSize = "md" | "sm";
|
|
4
4
|
export interface RadioGroupProps {
|
|
5
|
-
/** Optional description
|
|
6
|
-
description?:
|
|
5
|
+
/** Optional description that appears below the label. */
|
|
6
|
+
description?: React.ReactNode;
|
|
7
7
|
/** Is invalid. If true, include a description to explain why; and if no description is provided, description defaults to "Please select an option". */
|
|
8
8
|
invalid?: boolean;
|
|
9
9
|
/** The label text (required). Renders as `<legend>` (not `<label>`) because `RadioGroup` is a `<fieldset>`. */
|
|
@@ -1 +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,
|
|
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,yDAAyD;IACzD,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAC7B,uJAAuJ;IACvJ,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,+GAA+G;IAC/G,KAAK,EAAE,MAAM,CAAA;IACb,8CAA8C;IAC9C,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;;;;;;;;GAQG;AACH,eAAO,MAAM,UAAU;+EAQpB,sBAAsB;;CAiCxB,CAAA"}
|
|
@@ -1 +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 /** Optional description
|
|
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 /** Optional description that appears below the label. */\n description?: React.ReactNode\n /** Is invalid. If true, include a description to explain why; and if no description is provided, description defaults to \"Please select an option\". */\n invalid?: boolean\n /** The label text (required). Renders as `<legend>` (not `<label>`) because `RadioGroup` is a `<fieldset>`. */\n label: string\n /** The size. Does not affect child radios. */\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 * @see {@link https://planningcenter.github.io/tapestry/?path=/docs/components-radio-group--docs | Storybook Documentation}\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":["React"],"mappings":";;;;;AA0BA;;;;;;;;AAQG;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,QACEA,cAAA,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,QAAAA,cAAA,CAAA,aAAA,CAAA,QAAA,EAAA,IAAA,EAAS,KAAK,CAAU;QACvB,kBAAkB,KACjBA,cAAA,CAAA,aAAA,CAAA,GAAA,EAAA,EAAG,EAAE,EAAE,aAAa,EAAE,SAAS,EAAC,6BAA6B,EAAA;YAC3DA,cAAA,CAAA,aAAA,CAAC,IAAI,IACH,SAAS,EAAC,0CAA0C,EACpD,MAAM,EAAC,8BAA8B,EAAA,aAAA,EAAA,IAAA,EAAA,CAErC;AACD,YAAA,kBAAkB,CACjB,CACL;QACDA,cAAA,CAAA,aAAA,CAAA,KAAA,EAAA,EAAK,SAAS,EAAC,wBAAwB,EAAA,EAAE,QAAQ,CAAO,CAC/C;AAEf;AAEA,UAAU,CAAC,WAAW,GAAG,YAAY;;;;"}
|
|
@@ -85,7 +85,7 @@ interface SelectBaseProps {
|
|
|
85
85
|
* `invalid`. Defaults to `"Please select an option"` when `invalid` is true
|
|
86
86
|
* and no description is provided.
|
|
87
87
|
*/
|
|
88
|
-
description?:
|
|
88
|
+
description?: React.ReactNode;
|
|
89
89
|
/**
|
|
90
90
|
* Whether the select is in an invalid state. Shows the default description
|
|
91
91
|
* if none is provided.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Select.d.ts","sourceRoot":"","sources":["../../../src/components/select/Select.tsx"],"names":[],"mappings":"AAAA,OAAO,aAAa,CAAA;AAKpB,OAAO,KAAK,EAAE,EAAc,KAAK,oBAAoB,EAAU,MAAM,OAAO,CAAA;AAS5E,MAAM,MAAM,UAAU,GAAG,IAAI,GAAG,IAAI,CAAA;AAEpC;;;;GAIG;AACH,MAAM,WAAW,yBAAyB;IACxC,0EAA0E;IAC1E,CAAC,GAAG,EAAE,QAAQ,MAAM,EAAE,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,SAAS,CAAA;IAC9D,8CAA8C;IAC9C,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,OAAO,CAAC,EAAE,KAAK,CAAA;IACf,wEAAwE;I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sBAAsB,CAAA;AAE1B,KAAK,sBAAsB,GAAG,IAAI,CAChC,oBAAoB,CAAC,iBAAiB,CAAC,EACvC,MAAM,WAAW,GAAG,UAAU,GAAG,MAAM,CACxC,CAAA;AAED,MAAM,MAAM,wBAAwB,GAAG,sBAAsB,GAC3D,WAAW,GAAG;IACZ,OAAO,CAAC,EAAE,KAAK,CAAA;CAChB,CAAA;AAEH,MAAM,MAAM,yBAAyB,GAAG,sBAAsB,GAC5D,WAAW,GAAG;IACZ,OAAO,EAAE,IAAI,CAAA;CACd,CAAA;AAEH,MAAM,MAAM,kBAAkB,GAC1B,wBAAwB,GACxB,yBAAyB,CAAA;AAkB7B;;;;;;;;;GASG;AACH,eAAO,MAAM,MAAM,8FAgHlB,CAAA"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import Icon from '../../utilities/Icon.js';
|
|
2
2
|
import { useId } from '../../utilities/useId.js';
|
|
3
3
|
import classNames from 'classnames';
|
|
4
|
-
import
|
|
4
|
+
import React, { forwardRef, useRef } from 'react';
|
|
5
5
|
import { SelectNative } from './SelectNative.js';
|
|
6
6
|
import { SelectPopover } from './SelectPopover.js';
|
|
7
7
|
|
|
@@ -66,14 +66,14 @@ const Select = forwardRef(function Select(props, ref) {
|
|
|
66
66
|
};
|
|
67
67
|
const handleComplexLabelClick = () => triggerRef.current?.focus();
|
|
68
68
|
const SelectComponent = complex ? SelectPopover : SelectNative;
|
|
69
|
-
return (
|
|
69
|
+
return (React.createElement("div", { className: computedClassName },
|
|
70
70
|
showLabel &&
|
|
71
71
|
(complex ? (
|
|
72
72
|
// eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions -- mirrors native label click-to-focus; keyboard users interact with the combobox directly
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
resolvedDescription && descriptionId && (
|
|
76
|
-
|
|
73
|
+
React.createElement("div", { className: "tds-select-label", id: labelId, onClick: handleComplexLabelClick }, label)) : (React.createElement("label", { htmlFor: controlId, id: labelId }, label))),
|
|
74
|
+
React.createElement(SelectComponent, { ...sharedControlProps, ref: ref, id: controlId, onChange: onChange, ...(complex && { triggerRef }) }),
|
|
75
|
+
resolvedDescription && descriptionId && (React.createElement("p", { className: "tds-select-description", id: descriptionId },
|
|
76
|
+
React.createElement(Icon, { "aria-hidden": true, className: "tds-select-description-invalid-icon", symbol: "general#exclamation-triangle" }),
|
|
77
77
|
resolvedDescription))));
|
|
78
78
|
});
|
|
79
79
|
Select.displayName = "Select";
|