@cimpress-ui/react 1.9.2 → 1.11.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/commonjs/components/copy/copy-button.d.ts +10 -5
- package/dist/commonjs/components/copy/copy-button.d.ts.map +1 -1
- package/dist/commonjs/components/copy/copy-button.js +18 -13
- package/dist/commonjs/components/copy/copy-button.js.map +1 -1
- package/dist/commonjs/components/copy/copy-inline.d.ts +17 -0
- package/dist/commonjs/components/copy/copy-inline.d.ts.map +1 -0
- package/dist/commonjs/components/copy/{inline-copy.js → copy-inline.js} +15 -10
- package/dist/commonjs/components/copy/copy-inline.js.map +1 -0
- package/dist/commonjs/components/internal/input/input.d.ts +8 -0
- package/dist/commonjs/components/internal/input/input.d.ts.map +1 -0
- package/dist/commonjs/components/internal/input/input.js +36 -0
- package/dist/commonjs/components/internal/input/input.js.map +1 -0
- package/dist/commonjs/components/number-field/number-field.d.ts.map +1 -1
- package/dist/commonjs/components/number-field/number-field.js +2 -2
- package/dist/commonjs/components/number-field/number-field.js.map +1 -1
- package/dist/commonjs/components/slider/slider.d.ts +34 -0
- package/dist/commonjs/components/slider/slider.d.ts.map +1 -0
- package/dist/commonjs/components/slider/slider.js +60 -0
- package/dist/commonjs/components/slider/slider.js.map +1 -0
- package/dist/commonjs/components/stepper/stepper-item.d.ts +6 -6
- package/dist/commonjs/components/stepper/stepper-item.d.ts.map +1 -1
- package/dist/commonjs/components/stepper/stepper-item.js +35 -27
- package/dist/commonjs/components/stepper/stepper-item.js.map +1 -1
- package/dist/commonjs/components/stepper/stepper.d.ts +1 -1
- package/dist/commonjs/components/stepper/stepper.d.ts.map +1 -1
- package/dist/commonjs/components/stepper/stepper.js +2 -2
- package/dist/commonjs/components/stepper/stepper.js.map +1 -1
- package/dist/commonjs/components/stepper/types.d.ts +1 -1
- package/dist/commonjs/components/stepper/types.d.ts.map +1 -1
- package/dist/commonjs/components/stepper/types.js.map +1 -1
- package/dist/commonjs/i18n/messages/en-US.d.ts.map +1 -1
- package/dist/commonjs/i18n/messages/en-US.js +1 -0
- package/dist/commonjs/i18n/messages/en-US.js.map +1 -1
- package/dist/commonjs/i18n/messages/types.d.ts +6 -0
- package/dist/commonjs/i18n/messages/types.d.ts.map +1 -1
- package/dist/commonjs/i18n/messages/types.js.map +1 -1
- package/dist/commonjs/index.d.ts +3 -2
- package/dist/commonjs/index.d.ts.map +1 -1
- package/dist/commonjs/index.js +3 -2
- package/dist/commonjs/index.js.map +1 -1
- package/dist/esm/components/copy/copy-button.d.ts +10 -5
- package/dist/esm/components/copy/copy-button.d.ts.map +1 -1
- package/dist/esm/components/copy/copy-button.js +15 -10
- package/dist/esm/components/copy/copy-button.js.map +1 -1
- package/dist/esm/components/copy/copy-inline.d.ts +17 -0
- package/dist/esm/components/copy/copy-inline.d.ts.map +1 -0
- package/dist/esm/components/copy/{inline-copy.js → copy-inline.js} +13 -8
- package/dist/esm/components/copy/copy-inline.js.map +1 -0
- package/dist/esm/components/internal/input/input.d.ts +8 -0
- package/dist/esm/components/internal/input/input.d.ts.map +1 -0
- package/dist/esm/components/internal/input/input.js +30 -0
- package/dist/esm/components/internal/input/input.js.map +1 -0
- package/dist/esm/components/number-field/number-field.d.ts.map +1 -1
- package/dist/esm/components/number-field/number-field.js +2 -2
- package/dist/esm/components/number-field/number-field.js.map +1 -1
- package/dist/esm/components/slider/slider.d.ts +34 -0
- package/dist/esm/components/slider/slider.d.ts.map +1 -0
- package/dist/esm/components/slider/slider.js +54 -0
- package/dist/esm/components/slider/slider.js.map +1 -0
- package/dist/esm/components/stepper/stepper-item.d.ts +6 -6
- package/dist/esm/components/stepper/stepper-item.d.ts.map +1 -1
- package/dist/esm/components/stepper/stepper-item.js +35 -27
- package/dist/esm/components/stepper/stepper-item.js.map +1 -1
- package/dist/esm/components/stepper/stepper.d.ts +1 -1
- package/dist/esm/components/stepper/stepper.d.ts.map +1 -1
- package/dist/esm/components/stepper/stepper.js +2 -2
- package/dist/esm/components/stepper/stepper.js.map +1 -1
- package/dist/esm/components/stepper/types.d.ts +1 -1
- package/dist/esm/components/stepper/types.d.ts.map +1 -1
- package/dist/esm/components/stepper/types.js.map +1 -1
- package/dist/esm/i18n/messages/en-US.d.ts.map +1 -1
- package/dist/esm/i18n/messages/en-US.js +1 -0
- package/dist/esm/i18n/messages/en-US.js.map +1 -1
- package/dist/esm/i18n/messages/types.d.ts +6 -0
- package/dist/esm/i18n/messages/types.d.ts.map +1 -1
- package/dist/esm/i18n/messages/types.js.map +1 -1
- package/dist/esm/index.d.ts +3 -2
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +3 -2
- package/dist/esm/index.js.map +1 -1
- package/dist-styles/core.css +1 -1
- package/dist-styles/styles.css +1 -1
- package/package.json +1 -1
- package/dist/commonjs/components/copy/inline-copy.d.ts +0 -12
- package/dist/commonjs/components/copy/inline-copy.d.ts.map +0 -1
- package/dist/commonjs/components/copy/inline-copy.js.map +0 -1
- package/dist/esm/components/copy/inline-copy.d.ts +0 -12
- package/dist/esm/components/copy/inline-copy.d.ts.map +0 -1
- package/dist/esm/components/copy/inline-copy.js.map +0 -1
|
@@ -4,34 +4,24 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
5
5
|
};
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.UNSTABLE_StepperItem =
|
|
7
|
+
exports.UNSTABLE_StepperItem = UNSTABLE_StepperItem;
|
|
8
8
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
9
9
|
const clsx_1 = __importDefault(require("clsx"));
|
|
10
10
|
const react_1 = require("react");
|
|
11
|
-
const
|
|
12
|
-
const forward_ref_js_1 = require("../../forward-ref.js");
|
|
11
|
+
const react_aria_components_1 = require("react-aria-components");
|
|
13
12
|
const index_js_1 = require("../../icons/index.js");
|
|
14
|
-
const with_style_props_js_1 = require("../../with-style-props.js");
|
|
15
13
|
const text_js_1 = require("../typography/text.js");
|
|
16
14
|
const context_js_1 = require("./context.js");
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
return ((0, jsx_runtime_1.jsxs)("li", { ...props, ref: ref, className: (0, clsx_1.default)('cim-stepper-item', UNSAFE_className), style: UNSAFE_style, "data-status": status, "aria-current": isCurrent, children: [(0, jsx_runtime_1.jsxs)("div", { className: "cim-stepper-item-icon-container", children: [isNavigable ? ((0, jsx_runtime_1.jsx)("button", { className: "cim-stepper-item-icon-button", type: "button", onClick: onChange, "aria-labelledby": labelId, children: iconElement })) : (iconElement), !isLast && orientation === 'vertical' && (0, jsx_runtime_1.jsx)("div", { className: "cim-stepper-item-tail" })] }), (0, jsx_runtime_1.jsxs)("div", { className: "cim-stepper-item-content", children: [isNavigable ? ((0, jsx_runtime_1.jsx)("button", { className: "cim-stepper-item-title-button", type: "button", onClick: onChange, tabIndex: -1, children: titleElement })) : (titleElement), description && ((0, jsx_runtime_1.jsx)(text_js_1.Text, { as: "div", UNSAFE_className: "cim-stepper-item-description", variant: "medium", tone: "muted", children: description }))] })] }));
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* Represents a single step in a stepper component.
|
|
31
|
-
*/
|
|
32
|
-
const _UNSTABLE_StepperItem = (0, with_style_props_js_1.withStyleProps)((0, forward_ref_js_1.forwardRef)(UNSTABLE_StepperItem), 'StepperItem');
|
|
33
|
-
exports.UNSTABLE_StepperItem = _UNSTABLE_StepperItem;
|
|
34
|
-
const statusToIcon = {
|
|
15
|
+
// TODO: move to translations
|
|
16
|
+
const assistiveTextMap = {
|
|
17
|
+
incomplete: 'Incomplete',
|
|
18
|
+
complete: 'Completed',
|
|
19
|
+
error: 'Invalid',
|
|
20
|
+
warning: 'Warning',
|
|
21
|
+
'in-progress': 'In progress',
|
|
22
|
+
};
|
|
23
|
+
const statusIconMap = {
|
|
24
|
+
incomplete: react_1.Fragment,
|
|
35
25
|
complete: index_js_1.IconCheckBold,
|
|
36
26
|
// TODO: replace with icon from library when available
|
|
37
27
|
error: () => ((0, jsx_runtime_1.jsxs)("svg", { width: "32", height: "32", viewBox: "0 0 32 32", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [(0, jsx_runtime_1.jsx)("path", { d: "M24.1421 21.1421C24.9232 21.9232 24.9232 23.1895 24.1421 23.9706C23.3611 24.7516 22.0948 24.7516 21.3137 23.9706L8.58579 11.2426C7.80474 10.4616 7.80474 9.19526 8.58579 8.41421C9.36684 7.63316 10.6332 7.63316 11.4142 8.41421L24.1421 21.1421Z", fill: "currentColor" }), (0, jsx_runtime_1.jsx)("path", { d: "M21.1421 8.85786C21.9232 8.07682 23.1895 8.07682 23.9706 8.85786C24.7516 9.63891 24.7516 10.9052 23.9706 11.6863L11.2426 24.4142C10.4616 25.1953 9.19526 25.1953 8.41421 24.4142C7.63316 23.6332 7.63316 22.3668 8.41421 21.5858L21.1421 8.85786Z", fill: "currentColor" })] })),
|
|
@@ -39,12 +29,30 @@ const statusToIcon = {
|
|
|
39
29
|
warning: () => ((0, jsx_runtime_1.jsxs)("svg", { width: "32", height: "32", viewBox: "0 0 32 32", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [(0, jsx_runtime_1.jsx)("path", { d: "M18 24C18 25.1046 17.1046 26 16 26C14.8954 26 14 25.1046 14 24C14 22.8954 14.8954 22 16 22C17.1046 22 18 22.8954 18 24Z", fill: "currentColor" }), (0, jsx_runtime_1.jsx)("line", { x1: "16", y1: "8", x2: "16", y2: "18", stroke: "currentColor", strokeWidth: "4", strokeLinecap: "round" })] })),
|
|
40
30
|
'in-progress': index_js_1.IconCircleBoldFill,
|
|
41
31
|
};
|
|
32
|
+
/**
|
|
33
|
+
* Represents a single step in a stepper component.
|
|
34
|
+
*/
|
|
35
|
+
function UNSTABLE_StepperItem({ children, description, status: overrideStatus, UNSAFE_className, UNSAFE_style, ...props }) {
|
|
36
|
+
const { currentStep, stepIndex, onChange, stepCount, orientation } = (0, react_1.useContext)(context_js_1.StepContext);
|
|
37
|
+
const isCurrent = stepIndex === currentStep;
|
|
38
|
+
const isPrevious = stepIndex < currentStep;
|
|
39
|
+
const isLast = stepIndex === stepCount - 1;
|
|
40
|
+
const status = overrideStatus ?? (isCurrent ? 'in-progress' : isPrevious ? 'complete' : 'incomplete');
|
|
41
|
+
const isNavigable = !isCurrent && onChange != null && (overrideStatus != null || isPrevious);
|
|
42
|
+
return ((0, jsx_runtime_1.jsxs)("div", { ...props, role: "listitem", className: (0, clsx_1.default)('cim-stepper-item', UNSAFE_className), style: UNSAFE_style, "data-status": status, "aria-current": isCurrent, children: [(0, jsx_runtime_1.jsxs)("div", { className: "cim-stepper-item-icon-container", "aria-hidden": true, children: [(0, jsx_runtime_1.jsx)(StepperItemIndicator, { status: status, isNavigable: isNavigable, isCurrent: isCurrent, onChange: onChange }), !isLast && orientation === 'vertical' && (0, jsx_runtime_1.jsx)("div", { className: "cim-stepper-item-tail" })] }), (0, jsx_runtime_1.jsxs)("div", { className: "cim-stepper-item-content", children: [(0, jsx_runtime_1.jsx)(StepperItemTitle, { status: status, isNavigable: isNavigable, isCurrent: isCurrent, onChange: onChange, children: children }), description && ((0, jsx_runtime_1.jsx)(text_js_1.Text, { as: "div", UNSAFE_className: "cim-stepper-item-description", variant: "medium", tone: "muted", children: description }))] })] }));
|
|
43
|
+
}
|
|
42
44
|
// eslint-disable-next-line react-refresh/only-export-components
|
|
43
|
-
function
|
|
44
|
-
const
|
|
45
|
-
if (
|
|
46
|
-
return
|
|
45
|
+
function StepperItemIndicator({ status, isNavigable, isCurrent, onChange, }) {
|
|
46
|
+
const icon = ((0, jsx_runtime_1.jsx)("div", { className: "cim-stepper-item-icon", children: status === 'in-progress' && !isCurrent ? null : (0, react_1.createElement)(statusIconMap[status]) }));
|
|
47
|
+
if (isNavigable) {
|
|
48
|
+
return ((0, jsx_runtime_1.jsx)(react_aria_components_1.Button, { className: "cim-stepper-item-icon-button", type: "button", onClick: onChange, excludeFromTabOrder: true, children: icon }));
|
|
47
49
|
}
|
|
48
|
-
return (0, jsx_runtime_1.jsx)(
|
|
50
|
+
return (0, jsx_runtime_1.jsx)("div", { className: "cim-stepper-item-icon-button", children: icon });
|
|
51
|
+
}
|
|
52
|
+
// eslint-disable-next-line react-refresh/only-export-components
|
|
53
|
+
function StepperItemTitle({ children, status, isNavigable, isCurrent, onChange, }) {
|
|
54
|
+
const assistiveText = assistiveTextMap[status];
|
|
55
|
+
const titleElement = ((0, jsx_runtime_1.jsxs)(text_js_1.Text, { as: "span", variant: isCurrent ? 'body-semibold' : 'body', UNSAFE_className: "cim-stepper-item-title", children: [(0, jsx_runtime_1.jsxs)(react_aria_components_1.VisuallyHidden, { children: [assistiveText, ": "] }), children] }));
|
|
56
|
+
return isNavigable ? ((0, jsx_runtime_1.jsx)(react_aria_components_1.Button, { className: "cim-stepper-item-title-button", type: "button", onClick: onChange, children: titleElement })) : ((0, jsx_runtime_1.jsx)("div", { className: "cim-stepper-item-title-button", children: titleElement }));
|
|
49
57
|
}
|
|
50
58
|
//# sourceMappingURL=stepper-item.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stepper-item.js","sourceRoot":"","sources":["../../../../src/components/stepper/stepper-item.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC
|
|
1
|
+
{"version":3,"file":"stepper-item.js","sourceRoot":"","sources":["../../../../src/components/stepper/stepper-item.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;;;;;AA6Db,oDAwCC;;AAnGD,gDAAwB;AACxB,iCAA4E;AAC5E,iEAAiG;AACjG,mDAAyE;AAEzE,mDAA6C;AAC7C,6CAA2C;AAG3C,6BAA6B;AAC7B,MAAM,gBAAgB,GAAkC;IACtD,UAAU,EAAE,YAAY;IACxB,QAAQ,EAAE,WAAW;IACrB,KAAK,EAAE,SAAS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,WAAW,EACX,SAAS,EACT,QAAQ,GAMT;IACC,MAAM,IAAI,GAAG,CACX,gCAAK,SAAS,EAAC,uBAAuB,YACnC,MAAM,KAAK,aAAa,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAA,qBAAa,EAAC,aAAa,CAAC,MAAM,CAAC,CAAC,GACjF,CACP,CAAC;IAEF,IAAI,WAAW,EAAE,CAAC;QAChB,OAAO,CACL,uBAAC,8BAAS,IAAC,SAAS,EAAC,8BAA8B,EAAC,IAAI,EAAC,QAAQ,EAAC,OAAO,EAAE,QAAQ,EAAE,mBAAmB,kBACrG,IAAI,GACK,CACb,CAAC;IACJ,CAAC;IAED,OAAO,gCAAK,SAAS,EAAC,8BAA8B,YAAE,IAAI,GAAO,CAAC;AACpE,CAAC;AAED,gEAAgE;AAChE,SAAS,gBAAgB,CAAC,EACxB,QAAQ,EACR,MAAM,EACN,WAAW,EACX,SAAS,EACT,QAAQ,GAOT;IACC,MAAM,aAAa,GAAG,gBAAgB,CAAC,MAAM,CAAC,CAAC;IAE/C,MAAM,YAAY,GAAG,CACnB,wBAAC,cAAI,IAAC,EAAE,EAAC,MAAM,EAAC,OAAO,EAAE,SAAS,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,MAAM,EAAE,gBAAgB,EAAC,wBAAwB,aACtG,wBAAC,sCAAiB,eAAE,aAAa,UAAuB,EACvD,QAAQ,IACJ,CACR,CAAC;IAEF,OAAO,WAAW,CAAC,CAAC,CAAC,CACnB,uBAAC,8BAAS,IAAC,SAAS,EAAC,+BAA+B,EAAC,IAAI,EAAC,QAAQ,EAAC,OAAO,EAAE,QAAQ,YACjF,YAAY,GACH,CACb,CAAC,CAAC,CAAC,CACF,gCAAK,SAAS,EAAC,+BAA+B,YAAE,YAAY,GAAO,CACpE,CAAC;AACJ,CAAC","sourcesContent":["'use client';\n\nimport clsx from 'clsx';\nimport { createElement, Fragment, useContext, type ReactNode } from 'react';\nimport { Button as RACButton, VisuallyHidden as RACVisuallyHidden } from 'react-aria-components';\nimport { IconCheckBold, IconCircleBoldFill } from '../../icons/index.js';\nimport type { CommonProps, StringLikeChildren } from '../types.js';\nimport { Text } from '../typography/text.js';\nimport { StepContext } from './context.js';\nimport type { StepperStatus } from './types.js';\n\n// TODO: move to translations\nconst assistiveTextMap: Record<StepperStatus, string> = {\n incomplete: 'Incomplete',\n complete: 'Completed',\n error: 'Invalid',\n warning: 'Warning',\n 'in-progress': 'In progress',\n};\n\nconst statusIconMap: Record<StepperStatus, React.ElementType> = {\n incomplete: Fragment,\n complete: IconCheckBold,\n // TODO: replace with icon from library when available\n error: () => (\n <svg width=\"32\" height=\"32\" viewBox=\"0 0 32 32\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n d=\"M24.1421 21.1421C24.9232 21.9232 24.9232 23.1895 24.1421 23.9706C23.3611 24.7516 22.0948 24.7516 21.3137 23.9706L8.58579 11.2426C7.80474 10.4616 7.80474 9.19526 8.58579 8.41421C9.36684 7.63316 10.6332 7.63316 11.4142 8.41421L24.1421 21.1421Z\"\n fill=\"currentColor\"\n />\n <path\n d=\"M21.1421 8.85786C21.9232 8.07682 23.1895 8.07682 23.9706 8.85786C24.7516 9.63891 24.7516 10.9052 23.9706 11.6863L11.2426 24.4142C10.4616 25.1953 9.19526 25.1953 8.41421 24.4142C7.63316 23.6332 7.63316 22.3668 8.41421 21.5858L21.1421 8.85786Z\"\n fill=\"currentColor\"\n />\n </svg>\n ),\n // TODO: replace with icon from library when available\n warning: () => (\n <svg width=\"32\" height=\"32\" viewBox=\"0 0 32 32\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n d=\"M18 24C18 25.1046 17.1046 26 16 26C14.8954 26 14 25.1046 14 24C14 22.8954 14.8954 22 16 22C17.1046 22 18 22.8954 18 24Z\"\n fill=\"currentColor\"\n />\n <line x1=\"16\" y1=\"8\" x2=\"16\" y2=\"18\" stroke=\"currentColor\" strokeWidth=\"4\" strokeLinecap=\"round\" />\n </svg>\n ),\n 'in-progress': IconCircleBoldFill,\n};\n\nexport interface UNSTABLE_StepperItemProps extends CommonProps {\n /** The title of the step. */\n children: StringLikeChildren;\n /** The description of the step. Optionally, you can pass a React node to render rich text. */\n description?: ReactNode;\n /** The status of the step. */\n status?: StepperStatus;\n}\n\n/**\n * Represents a single step in a stepper component.\n */\nexport function UNSTABLE_StepperItem({\n children,\n description,\n status: overrideStatus,\n UNSAFE_className,\n UNSAFE_style,\n ...props\n}: UNSTABLE_StepperItemProps) {\n const { currentStep, stepIndex, onChange, stepCount, orientation } = useContext(StepContext);\n const isCurrent = stepIndex === currentStep;\n const isPrevious = stepIndex < currentStep;\n const isLast = stepIndex === stepCount - 1;\n const status = overrideStatus ?? (isCurrent ? 'in-progress' : isPrevious ? 'complete' : 'incomplete');\n const isNavigable = !isCurrent && onChange != null && (overrideStatus != null || isPrevious);\n\n return (\n <div\n {...props}\n role=\"listitem\"\n className={clsx('cim-stepper-item', UNSAFE_className)}\n style={UNSAFE_style}\n data-status={status}\n aria-current={isCurrent}\n >\n <div className=\"cim-stepper-item-icon-container\" aria-hidden>\n <StepperItemIndicator status={status} isNavigable={isNavigable} isCurrent={isCurrent} onChange={onChange} />\n {!isLast && orientation === 'vertical' && <div className=\"cim-stepper-item-tail\" />}\n </div>\n <div className=\"cim-stepper-item-content\">\n <StepperItemTitle status={status} isNavigable={isNavigable} isCurrent={isCurrent} onChange={onChange}>\n {children}\n </StepperItemTitle>\n {description && (\n <Text as=\"div\" UNSAFE_className=\"cim-stepper-item-description\" variant=\"medium\" tone=\"muted\">\n {description}\n </Text>\n )}\n </div>\n </div>\n );\n}\n\n// eslint-disable-next-line react-refresh/only-export-components\nfunction StepperItemIndicator({\n status,\n isNavigable,\n isCurrent,\n onChange,\n}: {\n status: StepperStatus;\n isNavigable: boolean;\n isCurrent: boolean;\n onChange?: () => void;\n}) {\n const icon = (\n <div className=\"cim-stepper-item-icon\">\n {status === 'in-progress' && !isCurrent ? null : createElement(statusIconMap[status])}\n </div>\n );\n\n if (isNavigable) {\n return (\n <RACButton className=\"cim-stepper-item-icon-button\" type=\"button\" onClick={onChange} excludeFromTabOrder>\n {icon}\n </RACButton>\n );\n }\n\n return <div className=\"cim-stepper-item-icon-button\">{icon}</div>;\n}\n\n// eslint-disable-next-line react-refresh/only-export-components\nfunction StepperItemTitle({\n children,\n status,\n isNavigable,\n isCurrent,\n onChange,\n}: {\n children: StringLikeChildren;\n status: StepperStatus;\n isNavigable: boolean;\n isCurrent: boolean;\n onChange?: () => void;\n}) {\n const assistiveText = assistiveTextMap[status];\n\n const titleElement = (\n <Text as=\"span\" variant={isCurrent ? 'body-semibold' : 'body'} UNSAFE_className=\"cim-stepper-item-title\">\n <RACVisuallyHidden>{assistiveText}: </RACVisuallyHidden>\n {children}\n </Text>\n );\n\n return isNavigable ? (\n <RACButton className=\"cim-stepper-item-title-button\" type=\"button\" onClick={onChange}>\n {titleElement}\n </RACButton>\n ) : (\n <div className=\"cim-stepper-item-title-button\">{titleElement}</div>\n );\n}\n"]}
|
|
@@ -16,6 +16,6 @@ export interface UNSTABLE_StepperProps extends CommonProps {
|
|
|
16
16
|
/**
|
|
17
17
|
* Displays a series of steps in a process.
|
|
18
18
|
*/
|
|
19
|
-
declare const _UNSTABLE_Stepper: (props: UNSTABLE_StepperProps & import("react").RefAttributes<
|
|
19
|
+
declare const _UNSTABLE_Stepper: (props: UNSTABLE_StepperProps & import("react").RefAttributes<HTMLDivElement> & import("../../with-style-props.js").StyleProps) => import("react").JSX.Element | null;
|
|
20
20
|
export { _UNSTABLE_Stepper as UNSTABLE_Stepper };
|
|
21
21
|
//# sourceMappingURL=stepper.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stepper.d.ts","sourceRoot":"","sources":["../../../../src/components/stepper/stepper.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAmD,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAGxF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAG/C,MAAM,WAAW,qBAAsB,SAAQ,WAAW;IACxD,2CAA2C;IAC3C,QAAQ,EAAE,SAAS,CAAC;IACpB,oCAAoC;IACpC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,0DAA0D;IAC1D,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC;;;OAGG;IACH,WAAW,CAAC,EAAE,UAAU,GAAG,YAAY,CAAC;CACzC;
|
|
1
|
+
{"version":3,"file":"stepper.d.ts","sourceRoot":"","sources":["../../../../src/components/stepper/stepper.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAmD,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAGxF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAG/C,MAAM,WAAW,qBAAsB,SAAQ,WAAW;IACxD,2CAA2C;IAC3C,QAAQ,EAAE,SAAS,CAAC;IACpB,oCAAoC;IACpC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,0DAA0D;IAC1D,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC;;;OAGG;IACH,WAAW,CAAC,EAAE,UAAU,GAAG,YAAY,CAAC;CACzC;AAqDD;;GAEG;AACH,QAAA,MAAM,iBAAiB,uKAA0D,CAAC;AAElF,OAAO,EAAE,iBAAiB,IAAI,gBAAgB,EAAE,CAAC"}
|
|
@@ -13,7 +13,7 @@ const with_style_props_js_1 = require("../../with-style-props.js");
|
|
|
13
13
|
const context_js_1 = require("./context.js");
|
|
14
14
|
function UNSTABLE_Stepper({ children, currentStep, onChange, orientation = 'horizontal', UNSAFE_className, UNSAFE_style, ...props }, ref) {
|
|
15
15
|
const stepCount = react_1.Children.count(children);
|
|
16
|
-
return ((0, jsx_runtime_1.jsx)("
|
|
16
|
+
return ((0, jsx_runtime_1.jsx)("div", { ...props, role: "list", ref: ref, className: (0, clsx_1.default)('cim-stepper', UNSAFE_className), style: { ...UNSAFE_style, '--cim-stepper-step-count': stepCount }, "data-orientation": orientation, children: react_1.Children.map(children, (child, stepIndex) => {
|
|
17
17
|
const isLast = stepIndex === stepCount - 1;
|
|
18
18
|
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(context_js_1.StepContext.Provider, { value: {
|
|
19
19
|
orientation,
|
|
@@ -24,7 +24,7 @@ function UNSTABLE_Stepper({ children, currentStep, onChange, orientation = 'hori
|
|
|
24
24
|
(() => {
|
|
25
25
|
onChange(stepIndex);
|
|
26
26
|
}),
|
|
27
|
-
}, children: child }), !isLast && orientation === 'horizontal' && (0, jsx_runtime_1.jsx)("div", { className: "cim-stepper-item-tail" })] }));
|
|
27
|
+
}, children: child }), !isLast && orientation === 'horizontal' && (0, jsx_runtime_1.jsx)("div", { className: "cim-stepper-item-tail", role: "presentation" })] }));
|
|
28
28
|
}) }));
|
|
29
29
|
}
|
|
30
30
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stepper.js","sourceRoot":"","sources":["../../../../src/components/stepper/stepper.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;;;;;;;AAEb,gDAAwB;AACxB,iCAAwF;AACxF,yDAAkD;AAClD,mEAA2D;AAE3D,6CAA2C;AAgB3C,SAAS,gBAAgB,CACvB,EACE,QAAQ,EACR,WAAW,EACX,QAAQ,EACR,WAAW,GAAG,YAAY,EAC1B,gBAAgB,EAChB,YAAY,EACZ,GAAG,KAAK,EACc,EACxB,
|
|
1
|
+
{"version":3,"file":"stepper.js","sourceRoot":"","sources":["../../../../src/components/stepper/stepper.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;;;;;;;AAEb,gDAAwB;AACxB,iCAAwF;AACxF,yDAAkD;AAClD,mEAA2D;AAE3D,6CAA2C;AAgB3C,SAAS,gBAAgB,CACvB,EACE,QAAQ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ardedRef, type ReactNode } from 'react';\nimport { forwardRef } from '../../forward-ref.js';\nimport { withStyleProps } from '../../with-style-props.js';\nimport type { CommonProps } from '../types.js';\nimport { StepContext } from './context.js';\n\nexport interface UNSTABLE_StepperProps extends CommonProps {\n /** The steps to display in the stepper. */\n children: ReactNode;\n /** The index of the active step. */\n currentStep?: number;\n /** The callback to call when the current step changes. */\n onChange?: (step: number) => void;\n /** The orientation of the stepper.\n *\n * @default 'horizontal'\n */\n orientation?: 'vertical' | 'horizontal';\n}\n\nfunction UNSTABLE_Stepper(\n {\n children,\n currentStep,\n onChange,\n orientation = 'horizontal',\n UNSAFE_className,\n UNSAFE_style,\n ...props\n }: UNSTABLE_StepperProps,\n ref: ForwardedRef<HTMLDivElement>,\n) {\n const stepCount = Children.count(children);\n\n return (\n <div\n {...props}\n role=\"list\"\n ref={ref}\n className={clsx('cim-stepper', UNSAFE_className)}\n style={{ ...UNSAFE_style, '--cim-stepper-step-count': stepCount } as CSSProperties}\n data-orientation={orientation}\n >\n {Children.map(children, (child, stepIndex) => {\n const isLast = stepIndex === stepCount - 1;\n\n return (\n <>\n <StepContext.Provider\n value={{\n orientation,\n stepCount: Children.count(children),\n currentStep: currentStep ?? -1,\n stepIndex,\n onChange:\n onChange &&\n (() => {\n onChange(stepIndex);\n }),\n }}\n >\n {child}\n </StepContext.Provider>\n {!isLast && orientation === 'horizontal' && <div className=\"cim-stepper-item-tail\" role=\"presentation\" />}\n </>\n );\n })}\n </div>\n );\n}\n\n/**\n * Displays a series of steps in a process.\n */\nconst _UNSTABLE_Stepper = withStyleProps(forwardRef(UNSTABLE_Stepper), 'Stepper');\n\nexport { _UNSTABLE_Stepper as UNSTABLE_Stepper };\n"]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export type StepperStatus = 'complete' | 'error' | 'warning' | 'in-progress';
|
|
1
|
+
export type StepperStatus = 'incomplete' | 'complete' | 'error' | 'warning' | 'in-progress';
|
|
2
2
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/components/stepper/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,aAAa,GAAG,UAAU,GAAG,OAAO,GAAG,SAAS,GAAG,aAAa,CAAC"}
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/components/stepper/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,aAAa,GAAG,YAAY,GAAG,UAAU,GAAG,OAAO,GAAG,SAAS,GAAG,aAAa,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/components/stepper/types.ts"],"names":[],"mappings":"","sourcesContent":["export type StepperStatus = 'complete' | 'error' | 'warning' | 'in-progress';\n"]}
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/components/stepper/types.ts"],"names":[],"mappings":"","sourcesContent":["export type StepperStatus = 'incomplete' | 'complete' | 'error' | 'warning' | 'in-progress';\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"en-US.d.ts","sourceRoot":"","sources":["../../../../src/i18n/messages/en-US.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAEpD,+EAA+E;AAC/E,eAAO,MAAM,IAAI,EAAE,
|
|
1
|
+
{"version":3,"file":"en-US.d.ts","sourceRoot":"","sources":["../../../../src/i18n/messages/en-US.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAEpD,+EAA+E;AAC/E,eAAO,MAAM,IAAI,EAAE,iBAyClB,CAAC"}
|
|
@@ -5,6 +5,7 @@ exports.enUS = void 0;
|
|
|
5
5
|
/** Strings used by Cimpress UI components, localized in the `en-US` locale. */
|
|
6
6
|
exports.enUS = {
|
|
7
7
|
common: { clearValue: `Clear`, dismiss: `Dismiss`, clearValueDescription: `Press Escape to clear text.` },
|
|
8
|
+
copyToClipboard: { success: `Copied to clipboard.`, failure: `Failed to copy to clipboard.` },
|
|
8
9
|
label: { required: `(required)` },
|
|
9
10
|
datePicker: {
|
|
10
11
|
clearValue: `Clear`,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"en-US.js","sourceRoot":"","sources":["../../../../src/i18n/messages/en-US.ts"],"names":[],"mappings":";AAAA,cAAc;;;AAId,+EAA+E;AAClE,QAAA,IAAI,GAAsB;IACrC,MAAM,EAAE,EAAE,UAAU,EAAE,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,qBAAqB,EAAE,6BAA6B,EAAE;IACzG,KAAK,EAAE,EAAE,QAAQ,EAAE,YAAY,EAAE;IACjC,UAAU,EAAE;QACV,UAAU,EAAE,OAAO;QACnB,YAAY,EAAE,eAAe;QAC7B,aAAa,EAAE,gBAAgB;QAC/B,SAAS,EAAE,YAAY;QACvB,gBAAgB,EAAE,WAAW;QAC7B,YAAY,EAAE,eAAe;QAC7B,QAAQ,EAAE,WAAW;QACrB,qBAAqB,EAAE,iBAAiB;QACxC,wBAAwB,EAAE,CAAC,IAAI,EAAE,SAAS,EAAE,EAAE,CAAC,YAAY,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,QAAQ;QACnG,oBAAoB,EAAE,CAAC,IAAI,EAAE,SAAS,EAAE,EAAE,CAAC,QAAQ,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,QAAQ;KAC5F;IACD,WAAW,EAAE,EAAE,SAAS,EAAE,WAAW,EAAE,SAAS,EAAE,WAAW,EAAE;IAC/D,UAAU,EAAE;QACV,QAAQ,EAAE,CAAC,IAAI,EAAE,SAAS,EAAE,EAAE,CAAC,QAAQ,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE;QAC1E,YAAY,EAAE,eAAe;QAC7B,QAAQ,EAAE,W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press UI components, localized in the `en-US` locale. */\nexport const enUS: LocalizedMessages = {\n common: { clearValue: `Clear`, dismiss: `Dismiss`, clearValueDescription: `Press Escape to clear text.` },\n label: { required: `(required)` },\n datePicker: {\n clearValue: `Clear`,\n openCalendar: `Open calendar`,\n previousMonth: `Previous month`,\n nextMonth: `Next month`,\n switchToYearView: `Year view`,\n previousYear: `Previous year`,\n nextYear: `Next year`,\n switchToMultiYearView: `Multi-year view`,\n previousMultiYearSection: (args, formatter) => `Previous ${formatter.number(args.yearCount)} years`,\n nextMultiYearSection: (args, formatter) => `Next ${formatter.number(args.yearCount)} years`,\n },\n numberField: { decrement: `Decrement`, increment: `Increment` },\n pagination: {\n goToPage: (args, formatter) => `Page ${formatter.number(args.pageNumber)}`,\n previousPage: `Previous page`,\n nextPage: `Next page`,\n selectedPageAnnouncement: (args, formatter) => `Selected page: ${formatter.number(args.pageNumber)}`,\n },\n tagField: {\n itemsSelected: (args, formatter) =>\n `${formatter.plural(args.selectedItemCount, { one: () => `${formatter.number(args.selectedItemCount)} item selected`, other: () => `${formatter.number(args.selectedItemCount)} items selected` })}`,\n },\n filePicker: {\n chooseFile: `Choose file`,\n noFilesSelected: (args, formatter) =>\n `${formatter.select({ true: `No files selected`, other: `No file selected` }, args.allowsMultiple)}`,\n multipleFilesSelected: (args, formatter) => `${formatter.number(args.fileCount)} files`,\n },\n table: { toggleColumnSortOrder: `Toggle sort order of column:` },\n simpleAuthTool: {\n logIn: `Log in`,\n logOut: `Log out`,\n profileDetails: (args) => `Profile details for ${args.userFullName}`,\n unknownUser: `Unknown User`,\n },\n UNSTABLE_collection: { loading: `Loading items`, loadingMore: `Loading more items` },\n};\n"]}
|
|
1
|
+
{"version":3,"file":"en-US.js","sourceRoot":"","sources":["../../../../src/i18n/messages/en-US.ts"],"names":[],"mappings":";AAAA,cAAc;;;AAId,+EAA+E;AAClE,QAAA,IAAI,GAAsB;IACrC,MAAM,EAAE,EAAE,UAAU,EAAE,OAAO,EAAE,OAAO,E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AAC,MAAM,CAAC,IAAI,CAAC,iBAAiB,CAAC,gBAAgB,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC,GAAG,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,iBAAiB,CAAC,iBAAiB,EAAE,CAAC,EAAE;KACvM;IACD,UAAU,EAAE;QACV,UAAU,EAAE,aAAa;QACzB,eAAe,EAAE,CAAC,IAAI,EAAE,SAAS,EAAE,EAAE,CACnC,GAAG,SAAS,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,mBAAmB,EAAE,KAAK,EAAE,kBAAkB,EAAE,EAAE,IAAI,CAAC,cAAc,CAAC,EAAE;QACtG,qBAAqB,EAAE,CAAC,IAAI,EAAE,SAAS,EAAE,EAAE,CAAC,GAAG,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,QAAQ;KACxF;IACD,KAAK,EAAE,EAAE,qBAAqB,EAAE,8BAA8B,EAAE;IAChE,cAAc,EAAE;QACd,KAAK,EAAE,QAAQ;QACf,MAAM,EAAE,SAAS;QACjB,cAAc,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,uBAAuB,IAAI,CAAC,YAAY,EAAE;QACpE,WAAW,EAAE,cAAc;KAC5B;IACD,mBAAmB,EAAE,EAAE,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,oBAAoB,EAAE;CACrF,CAAC","sourcesContent":["// @ts-nocheck\n\nimport type { LocalizedMessages } from './types.js';\n\n/** Strings used by Cimpress UI components, localized in the `en-US` locale. */\nexport const enUS: LocalizedMessages = {\n common: { clearValue: `Clear`, dismiss: `Dismiss`, clearValueDescription: `Press Escape to clear text.` },\n copyToClipboard: { success: `Copied to clipboard.`, failure: `Failed to copy to clipboard.` },\n label: { required: `(required)` },\n datePicker: {\n clearValue: `Clear`,\n openCalendar: `Open calendar`,\n previousMonth: `Previous month`,\n nextMonth: `Next month`,\n switchToYearView: `Year view`,\n previousYear: `Previous year`,\n nextYear: `Next year`,\n switchToMultiYearView: `Multi-year view`,\n previousMultiYearSection: (args, formatter) => `Previous ${formatter.number(args.yearCount)} years`,\n nextMultiYearSection: (args, formatter) => `Next ${formatter.number(args.yearCount)} years`,\n },\n numberField: { decrement: `Decrement`, increment: `Increment` },\n pagination: {\n goToPage: (args, formatter) => `Page ${formatter.number(args.pageNumber)}`,\n previousPage: `Previous page`,\n nextPage: `Next page`,\n selectedPageAnnouncement: (args, formatter) => `Selected page: ${formatter.number(args.pageNumber)}`,\n },\n tagField: {\n itemsSelected: (args, formatter) =>\n `${formatter.plural(args.selectedItemCount, { one: () => `${formatter.number(args.selectedItemCount)} item selected`, other: () => `${formatter.number(args.selectedItemCount)} items selected` })}`,\n },\n filePicker: {\n chooseFile: `Choose file`,\n noFilesSelected: (args, formatter) =>\n `${formatter.select({ true: `No files selected`, other: `No file selected` }, args.allowsMultiple)}`,\n multipleFilesSelected: (args, formatter) => `${formatter.number(args.fileCount)} files`,\n },\n table: { toggleColumnSortOrder: `Toggle sort order of column:` },\n simpleAuthTool: {\n logIn: `Log in`,\n logOut: `Log out`,\n profileDetails: (args) => `Profile details for ${args.userFullName}`,\n unknownUser: `Unknown User`,\n },\n UNSTABLE_collection: { loading: `Loading items`, loadingMore: `Loading more items` },\n};\n"]}
|
|
@@ -14,6 +14,12 @@ export type LocalizedMessages = {
|
|
|
14
14
|
/** A visually hidden label that indicates a text field can be cleared by pressing the Escape key. This text is only announced by screen readers. */
|
|
15
15
|
clearValueDescription: LocalizedString;
|
|
16
16
|
};
|
|
17
|
+
copyToClipboard: {
|
|
18
|
+
/** The message displayed in a tooltip when a value is successfully copied to clipboard. */
|
|
19
|
+
success: LocalizedString;
|
|
20
|
+
/** The message displayed in a tooltip when a value fails to be copied to clipboard. */
|
|
21
|
+
failure: LocalizedString;
|
|
22
|
+
};
|
|
17
23
|
label: {
|
|
18
24
|
/** A visually hidden label that indicates a form field is required. This text is appended to the field's visible label and is only announced by screen readers. */
|
|
19
25
|
required: LocalizedString;
|
|
@@ -1 +1 @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A6G;QAC7G,QAAQ,EAAE,eAAe,CAAC;QAC1B,kHAAkH;QAClH,wBAAwB,EAAE,eAAe,CAAC;KAC3C,CAAC;IACF,QAAQ,EAAE;QACR,kGAAkG;QAClG,aAAa,EAAE,eAAe,CAAC;KAChC,CAAC;IACF,UAAU,EAAE;QACV,uEAAuE;QACvE,UAAU,EAAE,eAAe,CAAC;QAC5B,8CAA8C;QAC9C,eAAe,EAAE,eAAe,CAAC;QACjC,oDAAoD;QACpD,qBAAqB,EAAE,eAAe,CAAC;KACxC,CAAC;IACF,KAAK,EAAE;QACL,0JAA0J;QAC1J,qBAAqB,EAAE,eAAe,CAAC;KACxC,CAAC;IACF,cAAc,EAAE;QACd,gEAAgE;QAChE,KAAK,EAAE,eAAe,CAAC;QACvB,gEAAgE;QAChE,MAAM,EAAE,eAAe,CAAC;QACxB,sFAAsF;QACtF,cAAc,EAAE,eAAe,CAAC;QAChC,uEAAuE;QACvE,WAAW,EAAE,eAAe,CAAC;KAC9B,CAAC;IACF,mBAAmB,EAAE;QACnB,0GAA0G;QAC1G,OAAO,EAAE,eAAe,CAAC;QACzB,gGAAgG;QAChG,WAAW,EAAE,eAAe,CAAC;KAC9B,CAAC;CACH,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/i18n/messages/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { LocalizedStringFormatter } from 'react-aria';\n\n/**\n * Represents a localized piece of text used within a component.\n * It can either be a plain string, or a function that returns a plain string based on provided context.\n */\nexport type LocalizedString =\n | string\n | ((\n args?: Record<string, string | number | boolean>,\n formatter?: LocalizedStringFormatter<string, LocalizedString>,\n ) => string);\n\n/** A collection of localized strings used by Cimpress UI components. */\nexport type LocalizedMessages = {\n common: {\n /** An ARIA label for a button that clears the value of a field. */\n clearValue: LocalizedString;\n /** An ARIA label for a button that closes or dismisses an alert, a callout, a dialog, or other overlay component. Used for accessibility purposes to clearly indicate the button's function to screen reader users. */\n dismiss: LocalizedString;\n /** A visually hidden label that indicates a text field can be cleared by pressing the Escape key. This text is only announced by screen readers. */\n clearValueDescription: LocalizedString;\n };\n label: {\n /** A visually hidden label that indicates a form field is required. This text is appended to the field's visible label and is only announced by screen readers. */\n required: LocalizedString;\n };\n datePicker: {\n /** An ARIA label for a button that clears the value of a date picker field. */\n clearValue: LocalizedString;\n /** An ARIA label for a button that opens a calendar popup. Part of a date picker. */\n openCalendar: LocalizedString;\n /** An ARIA label for a button that displays the previous month in a calendar popup. Part of a date picker. */\n previousMonth: LocalizedString;\n /** An ARIA label for a button that displays the next month in a calendar popup. Part of a date picker. */\n nextMonth: LocalizedString;\n /** An ARIA label for a button that changes the calendar popup to a single-year view. Part of a date picker. */\n switchToYearView: LocalizedString;\n /** An ARIA label for a button that displays the previous year in a calendar popup. Part of a date picker. */\n previousYear: LocalizedString;\n /** An ARIA label for a button that displays the next year in a calendar popup. Part of a date picker. */\n nextYear: LocalizedString;\n /** An ARIA label for a button that changes the calendar popup to a multi-year view. Part of a date picker. */\n switchToMultiYearView: LocalizedString;\n /** An ARIA label for a button that displays the previous section of a multi-year view in a calendar popup. Year count will always be larger than 1. Part of a date picker. */\n previousMultiYearSection: LocalizedString;\n /** An ARIA label for a button that displays the next section of a multi-year view in a calendar popup. Year count will always be larger than 1. Part of a date picker. */\n nextMultiYearSection: LocalizedString;\n };\n numberField: {\n /** An ARIA label for a button that decrements the value of a number field. */\n decrement: LocalizedString;\n /** An ARIA label for a button that increments the value of a number field. */\n increment: LocalizedString;\n };\n pagination: {\n /** An ARIA label for a button that navigates to a specific page. Part of a pagination navigation structure. */\n goToPage: LocalizedString;\n /** An ARIA label for a button that navigates to the previous page. Part of a pagination navigation structure. */\n previousPage: LocalizedString;\n /** An ARIA label for a button that navigates to the next page. Part of a pagination navigation structure. */\n nextPage: LocalizedString;\n /** A screen reader announcement for when the selected page changes. Part of a pagination navigation structure. */\n selectedPageAnnouncement: LocalizedString;\n };\n tagField: {\n /** A label displayed within a tag field to inform the user about the number of selected items. */\n itemsSelected: LocalizedString;\n };\n filePicker: {\n /** A label for the button that opens the native file picker dialog. */\n chooseFile: LocalizedString;\n /** A label for when no files are selected. */\n noFilesSelected: LocalizedString;\n /** A label for when multiple files are selected. */\n multipleFilesSelected: LocalizedString;\n };\n table: {\n /** An ARIA label for a button that toggles the sort order of a specific column in a data table. This label will be followed by the name of the column. */\n toggleColumnSortOrder: LocalizedString;\n };\n simpleAuthTool: {\n /** A label used for a button that redirects to a login flow. */\n logIn: LocalizedString;\n /** A label used for a button that logs the current user out. */\n logOut: LocalizedString;\n /** An ARIA label for a popover that contains information about the logged in user. */\n profileDetails: LocalizedString;\n /** A name that's displayed when the current user's name is unknown. */\n unknownUser: LocalizedString;\n };\n UNSTABLE_collection: {\n /** An ARIA label for a spinner displayed when the list of items is first being loaded in a collection. */\n loading: LocalizedString;\n /** An ARIA label for a spinner displayed when more items are being loaded into a collection. */\n loadingMore: LocalizedString;\n };\n};\n"]}
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/i18n/messages/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { LocalizedStringFormatter } from 'react-aria';\n\n/**\n * Represents a localized piece of text used within a component.\n * It can either be a plain string, or a function that returns a plain string based on provided context.\n */\nexport type LocalizedString =\n | string\n | ((\n args?: Record<string, string | number | boolean>,\n formatter?: LocalizedStringFormatter<string, LocalizedString>,\n ) => string);\n\n/** A collection of localized strings used by Cimpress UI components. */\nexport type LocalizedMessages = {\n common: {\n /** An ARIA label for a button that clears the value of a field. */\n clearValue: LocalizedString;\n /** An ARIA label for a button that closes or dismisses an alert, a callout, a dialog, or other overlay component. Used for accessibility purposes to clearly indicate the button's function to screen reader users. */\n dismiss: LocalizedString;\n /** A visually hidden label that indicates a text field can be cleared by pressing the Escape key. This text is only announced by screen readers. */\n clearValueDescription: LocalizedString;\n };\n copyToClipboard: {\n /** The message displayed in a tooltip when a value is successfully copied to clipboard. */\n success: LocalizedString;\n /** The message displayed in a tooltip when a value fails to be copied to clipboard. */\n failure: LocalizedString;\n };\n label: {\n /** A visually hidden label that indicates a form field is required. This text is appended to the field's visible label and is only announced by screen readers. */\n required: LocalizedString;\n };\n datePicker: {\n /** An ARIA label for a button that clears the value of a date picker field. */\n clearValue: LocalizedString;\n /** An ARIA label for a button that opens a calendar popup. Part of a date picker. */\n openCalendar: LocalizedString;\n /** An ARIA label for a button that displays the previous month in a calendar popup. Part of a date picker. */\n previousMonth: LocalizedString;\n /** An ARIA label for a button that displays the next month in a calendar popup. Part of a date picker. */\n nextMonth: LocalizedString;\n /** An ARIA label for a button that changes the calendar popup to a single-year view. Part of a date picker. */\n switchToYearView: LocalizedString;\n /** An ARIA label for a button that displays the previous year in a calendar popup. Part of a date picker. */\n previousYear: LocalizedString;\n /** An ARIA label for a button that displays the next year in a calendar popup. Part of a date picker. */\n nextYear: LocalizedString;\n /** An ARIA label for a button that changes the calendar popup to a multi-year view. Part of a date picker. */\n switchToMultiYearView: LocalizedString;\n /** An ARIA label for a button that displays the previous section of a multi-year view in a calendar popup. Year count will always be larger than 1. Part of a date picker. */\n previousMultiYearSection: LocalizedString;\n /** An ARIA label for a button that displays the next section of a multi-year view in a calendar popup. Year count will always be larger than 1. Part of a date picker. */\n nextMultiYearSection: LocalizedString;\n };\n numberField: {\n /** An ARIA label for a button that decrements the value of a number field. */\n decrement: LocalizedString;\n /** An ARIA label for a button that increments the value of a number field. */\n increment: LocalizedString;\n };\n pagination: {\n /** An ARIA label for a button that navigates to a specific page. Part of a pagination navigation structure. */\n goToPage: LocalizedString;\n /** An ARIA label for a button that navigates to the previous page. Part of a pagination navigation structure. */\n previousPage: LocalizedString;\n /** An ARIA label for a button that navigates to the next page. Part of a pagination navigation structure. */\n nextPage: LocalizedString;\n /** A screen reader announcement for when the selected page changes. Part of a pagination navigation structure. */\n selectedPageAnnouncement: LocalizedString;\n };\n tagField: {\n /** A label displayed within a tag field to inform the user about the number of selected items. */\n itemsSelected: LocalizedString;\n };\n filePicker: {\n /** A label for the button that opens the native file picker dialog. */\n chooseFile: LocalizedString;\n /** A label for when no files are selected. */\n noFilesSelected: LocalizedString;\n /** A label for when multiple files are selected. */\n multipleFilesSelected: LocalizedString;\n };\n table: {\n /** An ARIA label for a button that toggles the sort order of a specific column in a data table. This label will be followed by the name of the column. */\n toggleColumnSortOrder: LocalizedString;\n };\n simpleAuthTool: {\n /** A label used for a button that redirects to a login flow. */\n logIn: LocalizedString;\n /** A label used for a button that logs the current user out. */\n logOut: LocalizedString;\n /** An ARIA label for a popover that contains information about the logged in user. */\n profileDetails: LocalizedString;\n /** A name that's displayed when the current user's name is unknown. */\n unknownUser: LocalizedString;\n };\n UNSTABLE_collection: {\n /** An ARIA label for a spinner displayed when the list of items is first being loaded in a collection. */\n loading: LocalizedString;\n /** An ARIA label for a spinner displayed when more items are being loaded into a collection. */\n loadingMore: LocalizedString;\n };\n};\n"]}
|
package/dist/commonjs/index.d.ts
CHANGED
|
@@ -11,6 +11,8 @@ export * from './components/card/card.js';
|
|
|
11
11
|
export * from './components/checkbox/checkbox.js';
|
|
12
12
|
export * from './components/checkbox/checkbox-group.js';
|
|
13
13
|
export * from './components/combo-box/combo-box.js';
|
|
14
|
+
export * from './components/copy/copy-button.js';
|
|
15
|
+
export * from './components/copy/copy-inline.js';
|
|
14
16
|
export * from './components/date-picker/date-picker.js';
|
|
15
17
|
export * from './components/dialog-root/dialog-root.js';
|
|
16
18
|
export * from './components/disclosure/disclosure.js';
|
|
@@ -27,6 +29,7 @@ export * from './components/pagination/pagination.js';
|
|
|
27
29
|
export * from './components/radio/radio.js';
|
|
28
30
|
export * from './components/radio/radio-group.js';
|
|
29
31
|
export * from './components/select/select.js';
|
|
32
|
+
export * from './components/slider/slider.js';
|
|
30
33
|
export * from './components/spinner/spinner.js';
|
|
31
34
|
export * from './components/text-inputs/search-field.js';
|
|
32
35
|
export * from './components/text-inputs/text-field.js';
|
|
@@ -81,7 +84,5 @@ export * from './components/app-shell/app-shell.js';
|
|
|
81
84
|
export * from './components/app-header/side-nav.js';
|
|
82
85
|
export * from './components/hidden/hidden.js';
|
|
83
86
|
export * from './components/app-header/nav-button.js';
|
|
84
|
-
export * from './components/copy/copy-button.js';
|
|
85
|
-
export * from './components/copy/inline-copy.js';
|
|
86
87
|
export * from './components/top-nav/top-nav.js';
|
|
87
88
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,6BAA6B,CAAC;AAC5C,cAAc,uCAAuC,CAAC;AACtD,cAAc,6CAA6C,CAAC;AAC5D,cAAc,6BAA6B,CAAC;AAC5C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,oCAAoC,CAAC;AACnD,cAAc,oCAAoC,CAAC;AACnD,cAAc,yCAAyC,CAAC;AACxD,cAAc,iCAAiC,CAAC;AAChD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,mCAAmC,CAAC;AAClD,cAAc,yCAAyC,CAAC;AACxD,cAAc,qCAAqC,CAAC;AACpD,cAAc,yCAAyC,CAAC;AACxD,cAAc,yCAAyC,CAAC;AACxD,cAAc,uCAAuC,CAAC;AACtD,cAAc,6CAA6C,CAAC;AAC5D,YAAY,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAC;AAC5F,cAAc,iCAAiC,CAAC;AAChD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,qCAAqC,CAAC;AACpD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,2CAA2C,CAAC;AAC1D,cAAc,2CAA2C,CAAC;AAC1D,cAAc,uCAAuC,CAAC;AACtD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,mCAAmC,CAAC;AAClD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,iCAAiC,CAAC;AAChD,cAAc,0CAA0C,CAAC;AACzD,c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D,cAAc,iCAAiC,CAAC;AAEhD,YAAY,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAE7D,YAAY,EACV,cAAc,EACd,SAAS,EACT,UAAU,EACV,UAAU,EACV,GAAG,EACH,SAAS,EACT,UAAU,EACV,YAAY,EACZ,IAAI,EACJ,aAAa,EACb,gBAAgB,GACjB,MAAM,uBAAuB,CAAC;AAC/B,YAAY,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AACzE,YAAY,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAExD,cAAc,iCAAiC,CAAC;AAChD,cAAc,uCAAuC,CAAC;AAEtD,cAAc,4CAA4C,CAAC;AAG3D,cAAc,iDAAiD,CAAC;AAChE,cAAc,yCAAyC,CAAC;AACxD,cAAc,qCAAqC,CAAC;AACpD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,oCAAoC,CAAC;AACnD,OAAO,EAAE,mBAAmB,EAAE,KAAK,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AAClG,YAAY,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AACzE,cAAc,2CAA2C,CAAC;AAC1D,cAAc,iCAAiC,CAAC;AAChD,cAAc,sCAAsC,CAAC;AACrD,YAAY,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AACnE,cAAc,qCAAqC,CAAC;AACpD,cAAc,qCAAqC,CAAC;AACpD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,uCAAuC,CAAC;AACtD,cAAc,iCAAiC,CAAC"}
|
package/dist/commonjs/index.js
CHANGED
|
@@ -28,6 +28,8 @@ __exportStar(require("./components/card/card.js"), exports);
|
|
|
28
28
|
__exportStar(require("./components/checkbox/checkbox.js"), exports);
|
|
29
29
|
__exportStar(require("./components/checkbox/checkbox-group.js"), exports);
|
|
30
30
|
__exportStar(require("./components/combo-box/combo-box.js"), exports);
|
|
31
|
+
__exportStar(require("./components/copy/copy-button.js"), exports);
|
|
32
|
+
__exportStar(require("./components/copy/copy-inline.js"), exports);
|
|
31
33
|
__exportStar(require("./components/date-picker/date-picker.js"), exports);
|
|
32
34
|
__exportStar(require("./components/dialog-root/dialog-root.js"), exports);
|
|
33
35
|
__exportStar(require("./components/disclosure/disclosure.js"), exports);
|
|
@@ -43,6 +45,7 @@ __exportStar(require("./components/pagination/pagination.js"), exports);
|
|
|
43
45
|
__exportStar(require("./components/radio/radio.js"), exports);
|
|
44
46
|
__exportStar(require("./components/radio/radio-group.js"), exports);
|
|
45
47
|
__exportStar(require("./components/select/select.js"), exports);
|
|
48
|
+
__exportStar(require("./components/slider/slider.js"), exports);
|
|
46
49
|
__exportStar(require("./components/spinner/spinner.js"), exports);
|
|
47
50
|
__exportStar(require("./components/text-inputs/search-field.js"), exports);
|
|
48
51
|
__exportStar(require("./components/text-inputs/text-field.js"), exports);
|
|
@@ -91,7 +94,5 @@ __exportStar(require("./components/app-shell/app-shell.js"), exports);
|
|
|
91
94
|
__exportStar(require("./components/app-header/side-nav.js"), exports);
|
|
92
95
|
__exportStar(require("./components/hidden/hidden.js"), exports);
|
|
93
96
|
__exportStar(require("./components/app-header/nav-button.js"), exports);
|
|
94
|
-
__exportStar(require("./components/copy/copy-button.js"), exports);
|
|
95
|
-
__exportStar(require("./components/copy/inline-copy.js"), exports);
|
|
96
97
|
__exportStar(require("./components/top-nav/top-nav.js"), exports);
|
|
97
98
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,8DAA4C;AAC5C,wEAAsD;AACtD,8EAA4D;AAC5D,8DAA4C;AAC5C,gEAA8C;AAC9C,qEAAmD;AACnD,qEAAmD;AACnD,0EAAwD;AACxD,kEAAgD;AAChD,4DAA0C;AAC1C,oEAAkD;AAClD,0EAAwD;AACxD,sEAAoD;AACpD,0EAAwD;AACxD,0EAAwD;AACxD,wEAA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;AACjD,0EAAwD;AACxD,0EAAwD;AACxD,wEAAsD;AACtD,8EAA4D;AAE5D,kEAAgD;AAChD,gEAA8C;AAC9C,4DAA0C;AAC1C,sEAAoD;AACpD,4DAA0C;AAC1C,4EAA0D;AAC1D,4EAA0D;AAC1D,wEAAsD;AACtD,8DAA4C;AAC5C,oEAAkD;AAClD,gEAA8C;AAC9C,gEAA8C;AAC9C,kEAAgD;AAChD,2EAAyD;AACzD,yEAAuD;AACvD,wEAAsD;AACtD,0EAAwD;AACxD,kEAAgD;AAChD,kEAAgD;AAChD,wEAAsD;AACtD,8DAA4C;AAC5C,qEAAmD;AACnD,yEAAuD;AACvD,0EAAwD;AACxD,mEAAiD;AACjD,uEAAqD;AACrD,wEAAsD;AACtD,2EAAyD;AACzD,gFAA8D;AAC9D,0EAAwD;AAGxD,4DAA0C;AAC1C,0DAAwC;AACxC,gEAA8C;AAC9C,sEAAoD;AACpD,8EAA4D;AAC5D,mFAAiE;AACjE,oFAAkE;AAClE,+DAA6C;AAE7C,kEAAgD;AAChD,sEAAoD;AAEpD,kEAAgD;AAChD,kEAAgD;AAoBhD,kEAAgD;AAChD,wEAAsD;AAEtD,6EAA2D;AAE3D,2BAA2B;AAC3B,kFAAgE;AAChE,0EAAwD;AACxD,sEAAoD;AACpD,gEAA8C;AAC9C,qEAAmD;AACnD,oEAAkG;AAAzF,qHAAA,mBAAmB,OAAA;AAE5B,4EAA0D;AAC1D,kEAAgD;AAChD,uEAAqD;AAErD,sEAAoD;AACpD,sEAAoD;AACpD,gEAA8C;AAC9C,wEAAsD;AACtD,kEAAgD","sourcesContent":["export * from './components/alert/alert.js';\nexport * from './components/app-header/app-header.js';\nexport * from './components/app-header/simple-auth-tool.js';\nexport * from './components/badge/badge.js';\nexport * from './components/button/button.js';\nexport * from './components/button/link-button.js';\nexport * from './components/button/icon-button.js';\nexport * from './components/button/icon-link-button.js';\nexport * from './components/callout/callout.js';\nexport * from './components/card/card.js';\nexport * from './components/checkbox/checkbox.js';\nexport * from './components/checkbox/checkbox-group.js';\nexport * from './components/combo-box/combo-box.js';\nexport * from './components/copy/copy-button.js';\nexport * from './components/copy/copy-inline.js';\nexport * from './components/date-picker/date-picker.js';\nexport * from './components/dialog-root/dialog-root.js';\nexport * from './components/disclosure/disclosure.js';\nexport * from './components/disclosure/disclosure-group.js';\nexport type { DisclosureSize, DisclosureVariant } from './components/disclosure/context.js';\nexport * from './components/divider/divider.js';\nexport * from './components/drawer/drawer.js';\nexport * from './components/form/form.js';\nexport * from './components/link-tabs/link-tabs.js';\nexport * from './components/menu/menu.js';\nexport * from './components/modal-dialog/modal-dialog.js';\nexport * from './components/number-field/number-field.js';\nexport * from './components/pagination/pagination.js';\nexport * from './components/radio/radio.js';\nexport * from './components/radio/radio-group.js';\nexport * from './components/select/select.js';\nexport * from './components/slider/slider.js';\nexport * from './components/spinner/spinner.js';\nexport * from './components/text-inputs/search-field.js';\nexport * from './components/text-inputs/text-field.js';\nexport * from './components/text-inputs/text-area.js';\nexport * from './components/breadcrumbs/breadcrumbs.js';\nexport * from './components/tooltip/tooltip.js';\nexport * from './components/popover/popover.js';\nexport * from './components/table/table-container.js';\nexport * from './components/table/table.js';\nexport * from './components/table/table-header.js';\nexport * from './components/table/table-header-row.js';\nexport * from './components/table/table-header-cell.js';\nexport * from './components/table/table-body.js';\nexport * from './components/table/table-body-row.js';\nexport * from './components/table/table-body-cell.js';\nexport * from './components/table/table-row-selector.js';\nexport * from './components/table/table-all-rows-selector.js';\nexport * from './components/table/table-empty-state.js';\nexport type { RowSelectionMode as TableRowSelectionMode } from './components/table/contexts/table-state.js';\nexport type { ColumnContentAlignment as TableColumnContentAlignment } from './components/table/contexts/column-collection.js';\nexport * from './components/tabs/tabs.js';\nexport * from './components/tag/tag.js';\nexport * from './components/tag/tag-group.js';\nexport * from './components/tag-field/tag-field.js';\nexport * from './components/toggle-button/toggle-button.js';\nexport * from './components/toggle-button/toggle-icon-button.js';\nexport * from './components/toggle-button/toggle-button-group.js';\nexport * from './components/file-trigger.js';\n\nexport * from './components/spacing/box/box.js';\nexport * from './components/spacing/stack/stack.js';\n\nexport * from './components/typography/text.js';\nexport * from './components/typography/link.js';\n\nexport type { ForegroundTone } from './utils/style/types.js';\n\nexport type {\n CollectionItem,\n Direction,\n FieldError,\n HoverEvent,\n Key,\n Selection,\n PressEvent,\n RouterConfig,\n Href,\n RouterOptions,\n ValidationResult,\n} from './components/types.js';\nexport type { Spacing, Responsive } from './components/spacing/types.js';\nexport type { StyleProps } from './with-style-props.js';\n\nexport * from './providers/ssr/ssr-provider.js';\nexport * from './providers/router/router-provider.js';\n\nexport * from './components/internal/x-button/x-button.js';\n\n// Unfinished exports below\nexport * from './components/visually-hidden/visually-hidden.js';\nexport * from './components/file-picker/file-picker.js';\nexport * from './components/container/container.js';\nexport * from './components/toggle/toggle.js';\nexport * from './components/toast/toast-region.js';\nexport { UNSTABLE_toastQueue, type UNSTABLE_ToastQueue } from './components/toast/toast-queue.js';\nexport type { UNSTABLE_ToastOptions } from './components/toast/types.js';\nexport * from './components/alert-dialog/alert-dialog.js';\nexport * from './components/stepper/stepper.js';\nexport * from './components/stepper/stepper-item.js';\nexport type { StepperStatus } from './components/stepper/types.js';\nexport * from './components/app-shell/app-shell.js';\nexport * from './components/app-header/side-nav.js';\nexport * from './components/hidden/hidden.js';\nexport * from './components/app-header/nav-button.js';\nexport * from './components/top-nav/top-nav.js';\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ActionButtonProps, BaseButtonProps } from '../button/types.js';
|
|
2
2
|
import type { AriaLabelingProps, CommonProps, StringLikeChildren } from '../types.js';
|
|
3
|
-
export interface
|
|
3
|
+
export interface CopyButtonProps extends CommonProps, AriaLabelingProps, Pick<BaseButtonProps, 'size'>, Pick<ActionButtonProps, 'isDisabled' | 'onHoverStart' | 'onHoverEnd'> {
|
|
4
4
|
/** The text displayed on the button. */
|
|
5
5
|
children?: StringLikeChildren;
|
|
6
6
|
/**
|
|
@@ -10,11 +10,16 @@ export interface UNSTABLE_CopyButtonProps extends CommonProps, AriaLabelingProps
|
|
|
10
10
|
variant?: 'secondary' | 'tertiary';
|
|
11
11
|
/** The content to be copied. */
|
|
12
12
|
value: string;
|
|
13
|
-
/** The
|
|
14
|
-
|
|
13
|
+
/** The description that appears in a tooltip when the user hovers or focuses the button. */
|
|
14
|
+
description?: string;
|
|
15
15
|
/** A handler that gets called when the user triggers the copying. */
|
|
16
16
|
onCopy?: () => void;
|
|
17
17
|
}
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
/**
|
|
19
|
+
* Displays a button that allows users to copy a specific value to clipboard.
|
|
20
|
+
*
|
|
21
|
+
* See [copy button usage guidelines](https://ui.cimpress.io/components/copy-button/).
|
|
22
|
+
*/
|
|
23
|
+
declare const _CopyButton: (props: CopyButtonProps & import("react").RefAttributes<HTMLButtonElement> & import("../../with-style-props.js").StyleProps) => import("react").JSX.Element | null;
|
|
24
|
+
export { _CopyButton as CopyButton };
|
|
20
25
|
//# sourceMappingURL=copy-button.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"copy-button.d.ts","sourceRoot":"","sources":["../../../../src/components/copy/copy-button.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"copy-button.d.ts","sourceRoot":"","sources":["../../../../src/components/copy/copy-button.tsx"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAE7E,OAAO,KAAK,EAAE,iBAAiB,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAGtF,MAAM,WAAW,eACf,SAAQ,WAAW,EACjB,iBAAiB,EACjB,IAAI,CAAC,eAAe,EAAE,MAAM,CAAC,EAC7B,IAAI,CAAC,iBAAiB,EAAE,YAAY,GAAG,cAAc,GAAG,YAAY,CAAC;IACvE,wCAAwC;IACxC,QAAQ,CAAC,EAAE,kBAAkB,CAAC;IAC9B;;;OAGG;IACH,OAAO,CAAC,EAAE,WAAW,GAAG,UAAU,CAAC;IACnC,gCAAgC;IAChC,KAAK,EAAE,MAAM,CAAC;IACd,4FAA4F;IAC5F,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,qEAAqE;IACrE,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;CACrB;AAuDD;;;;GAIG;AACH,QAAA,MAAM,WAAW,oKAAuD,CAAC;AAEzE,OAAO,EAAE,WAAW,IAAI,UAAU,EAAE,CAAC"}
|
|
@@ -3,6 +3,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
3
3
|
import { useContext, useEffect, useState } from 'react';
|
|
4
4
|
import { TooltipTriggerStateContext as RACTooltipTriggerStateContext } from 'react-aria-components';
|
|
5
5
|
import { forwardRef } from '../../forward-ref.js';
|
|
6
|
+
import { useLocalizedMessages } from '../../i18n/index.js';
|
|
6
7
|
import { IconCheckCircle, IconCopy } from '../../icons/index.js';
|
|
7
8
|
import { useProductionWarning } from '../../utils/use-production-warning.js';
|
|
8
9
|
import { withStyleProps } from '../../with-style-props.js';
|
|
@@ -10,7 +11,7 @@ import { Button } from '../button/button.js';
|
|
|
10
11
|
import { IconButton } from '../button/icon-button.js';
|
|
11
12
|
import { Tooltip } from '../tooltip/tooltip.js';
|
|
12
13
|
import { useCopyToClipboard } from './use-copy.js';
|
|
13
|
-
function
|
|
14
|
+
function CopyButton({ onCopy, description, ...props }, ref) {
|
|
14
15
|
const [copyStatus, showCopyFeedback, copyToClipboard] = useCopyToClipboard();
|
|
15
16
|
const [showCopyFeedbackLabel, setShowCopyFeedbackLabel] = useState(showCopyFeedback);
|
|
16
17
|
useEffect(() => {
|
|
@@ -38,16 +39,20 @@ function UNSTABLE_CopyButton({ onCopy, helpText, ...props }, ref) {
|
|
|
38
39
|
copyToClipboard(props.value);
|
|
39
40
|
onCopy?.();
|
|
40
41
|
};
|
|
41
|
-
|
|
42
|
+
const messages = useLocalizedMessages('copyToClipboard');
|
|
43
|
+
return (_jsx(Tooltip, { isDisabled: props.isDisabled || (!showCopyFeedback && !description), label: showCopyFeedbackLabel
|
|
42
44
|
? copyStatus?.success
|
|
43
|
-
?
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
: (helpText ?? ''), placement: "top", children: _jsx(CopyButtonInner, { ...props, buttonRef: ref, onCopy: onPress, showCopyFeedback: showCopyFeedback }) }));
|
|
45
|
+
? messages.format('success')
|
|
46
|
+
: messages.format('failure')
|
|
47
|
+
: (description ?? ''), placement: "top", children: _jsx(CopyButtonInner, { ...props, buttonRef: ref, onCopy: onPress, showCopyFeedback: showCopyFeedback }) }));
|
|
47
48
|
}
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
49
|
+
/**
|
|
50
|
+
* Displays a button that allows users to copy a specific value to clipboard.
|
|
51
|
+
*
|
|
52
|
+
* See [copy button usage guidelines](https://ui.cimpress.io/components/copy-button/).
|
|
53
|
+
*/
|
|
54
|
+
const _CopyButton = withStyleProps(forwardRef(CopyButton), 'CopyButton');
|
|
55
|
+
export { _CopyButton as CopyButton };
|
|
51
56
|
function CopyButtonInner({ UNSAFE_className, UNSAFE_style, children, value, onCopy, buttonRef, showCopyFeedback, ...props }) {
|
|
52
57
|
const tooltipTriggerState = useContext(RACTooltipTriggerStateContext);
|
|
53
58
|
const icon = showCopyFeedback ? _jsx(IconCheckCircle, {}) : _jsx(IconCopy, {});
|
|
@@ -60,6 +65,6 @@ function CopyButtonInner({ UNSAFE_className, UNSAFE_style, children, value, onCo
|
|
|
60
65
|
}
|
|
61
66
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
62
67
|
}, [showCopyFeedback]);
|
|
63
|
-
return children ? (_jsx(Button, { ...props, ref: buttonRef, iconStart: icon, tone: "base", onPress: onCopy, children: children })) : (_jsx(IconButton, { ...props, ref: buttonRef, icon: icon, tone: "base", "aria-label": props['aria-label'] ?? '', onPress: onCopy }));
|
|
68
|
+
return children ? (_jsx(Button, { ...props, ref: buttonRef, type: "button", iconStart: icon, tone: "base", onPress: onCopy, children: children })) : (_jsx(IconButton, { ...props, ref: buttonRef, type: "button", icon: icon, tone: "base", "aria-label": props['aria-label'] ?? '', onPress: onCopy }));
|
|
64
69
|
}
|
|
65
70
|
//# sourceMappingURL=copy-button.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"copy-button.js","sourceRoot":"","sources":["../../../../src/components/copy/copy-button.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAqB,MAAM,OAAO,CAAC;AAC3E,OAAO,EAAE,0BAA0B,IAAI,6BAA6B,EAAE,MAAM,uBAAuB,CAAC;AACpG,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AACjE,OAAO,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;AAC7E,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAEtD,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAEhD,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAsBnD,SAAS,
|
|
1
|
+
{"version":3,"file":"copy-button.js","sourceRoot":"","sources":["../../../../src/components/copy/copy-button.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAqB,MAAM,OAAO,CAAC;AAC3E,OAAO,EAAE,0BAA0B,IAAI,6BAA6B,EAAE,MAAM,uBAAuB,CAAC;AACpG,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAq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AA6B,CAAC,CAAC;IAEtE,MAAM,IAAI,GAAG,gBAAgB,CAAC,CAAC,CAAC,KAAC,eAAe,KAAG,CAAC,CAAC,CAAC,KAAC,QAAQ,KAAG,CAAC;IAEnE,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,gBAAgB,EAAE,CAAC;YACrB,mBAAmB,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;QAClC,CAAC;aAAM,CAAC;YACN,mBAAmB,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC;QACnC,CAAC;QACD,uDAAuD;IACzD,CAAC,EAAE,CAAC,gBAAgB,CAAC,CAAC,CAAC;IAEvB,OAAO,QAAQ,CAAC,CAAC,CAAC,CAChB,KAAC,MAAM,OAAK,KAAK,EAAE,GAAG,EAAE,SAAS,EAAE,IAAI,EAAC,QAAQ,EAAC,SAAS,EAAE,IAAI,EAAE,IAAI,EAAC,MAAM,EAAC,OAAO,EAAE,MAAM,YAC1F,QAAQ,GACF,CACV,CAAC,CAAC,CAAC,CACF,KAAC,UAAU,OACL,KAAK,EACT,GAAG,EAAE,SAAS,EACd,IAAI,EAAC,QAAQ,EACb,IAAI,EAAE,IAAI,EACV,IAAI,EAAC,MAAM,gBACC,KAAK,CAAC,YAAY,CAAC,IAAI,EAAE,EACrC,OAAO,EAAE,MAAM,GACf,CACH,CAAC;AACJ,CAAC","sourcesContent":["'use client';\n\nimport { useContext, useEffect, useState, type ForwardedRef } from 'react';\nimport { TooltipTriggerStateContext as RACTooltipTriggerStateContext } from 'react-aria-components';\nimport { forwardRef } from '../../forward-ref.js';\nimport { useLocalizedMessages } from '../../i18n/index.js';\nimport { IconCheckCircle, IconCopy } from '../../icons/index.js';\nimport { useProductionWarning } from '../../utils/use-production-warning.js';\nimport { withStyleProps } from '../../with-style-props.js';\nimport { Button } from '../button/button.js';\nimport { IconButton } from '../button/icon-button.js';\nimport type { ActionButtonProps, BaseButtonProps } from '../button/types.js';\nimport { Tooltip } from '../tooltip/tooltip.js';\nimport type { AriaLabelingProps, CommonProps, StringLikeChildren } from '../types.js';\nimport { useCopyToClipboard } from './use-copy.js';\n\nexport interface CopyButtonProps\n extends CommonProps,\n AriaLabelingProps,\n Pick<BaseButtonProps, 'size'>,\n Pick<ActionButtonProps, 'isDisabled' | 'onHoverStart' | 'onHoverEnd'> {\n /** The text displayed on the button. */\n children?: StringLikeChildren;\n /**\n * Determines the visual appearance of the button.\n * @default 'secondary'\n */\n variant?: 'secondary' | 'tertiary';\n /** The content to be copied. */\n value: string;\n /** The description that appears in a tooltip when the user hovers or focuses the button. */\n description?: string;\n /** A handler that gets called when the user triggers the copying. */\n onCopy?: () => void;\n}\n\nfunction CopyButton({ onCopy, description, ...props }: CopyButtonProps, ref: ForwardedRef<HTMLButtonElement>) {\n const [copyStatus, showCopyFeedback, copyToClipboard] = useCopyToClipboard();\n const [showCopyFeedbackLabel, setShowCopyFeedbackLabel] = useState(showCopyFeedback);\n\n useEffect(() => {\n let labelChangeTimeout: ReturnType<typeof setTimeout> | undefined;\n\n if (showCopyFeedback) {\n setShowCopyFeedbackLabel(true);\n } else {\n // Wait until the tooltip has animated away before changing the label\n labelChangeTimeout = setTimeout(() => setShowCopyFeedbackLabel(false), 200);\n }\n\n return () => {\n if (labelChangeTimeout) {\n clearTimeout(labelChangeTimeout);\n }\n };\n }, [showCopyFeedback]);\n\n const { children, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledBy } = props;\n\n useProductionWarning(() => {\n if (!children && !ariaLabel && !ariaLabelledBy) {\n console.warn('CopyButton requires one of children / aria-label / aria-labelledby for accessibility');\n }\n }, [children, ariaLabel, ariaLabelledBy]);\n\n const onPress = () => {\n copyToClipboard(props.value);\n onCopy?.();\n };\n\n const messages = useLocalizedMessages('copyToClipboard');\n\n return (\n <Tooltip\n isDisabled={props.isDisabled || (!showCopyFeedback && !description)}\n label={\n showCopyFeedbackLabel\n ? copyStatus?.success\n ? messages.format('success')\n : messages.format('failure')\n : (description ?? '')\n }\n placement=\"top\"\n >\n <CopyButtonInner {...props} buttonRef={ref} onCopy={onPress} showCopyFeedback={showCopyFeedback} />\n </Tooltip>\n );\n}\n\n/**\n * Displays a button that allows users to copy a specific value to clipboard.\n *\n * See [copy button usage guidelines](https://ui.cimpress.io/components/copy-button/).\n */\nconst _CopyButton = withStyleProps(forwardRef(CopyButton), 'CopyButton');\n\nexport { _CopyButton as CopyButton };\n\nfunction CopyButtonInner({\n UNSAFE_className,\n UNSAFE_style,\n children,\n value,\n onCopy,\n buttonRef,\n showCopyFeedback,\n ...props\n}: Omit<CopyButtonProps, 'description'> & {\n buttonRef: ForwardedRef<HTMLButtonElement>;\n showCopyFeedback: boolean;\n}) {\n const tooltipTriggerState = useContext(RACTooltipTriggerStateContext);\n\n const icon = showCopyFeedback ? <IconCheckCircle /> : <IconCopy />;\n\n useEffect(() => {\n if (showCopyFeedback) {\n tooltipTriggerState?.open(true);\n } else {\n tooltipTriggerState?.close(true);\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [showCopyFeedback]);\n\n return children ? (\n <Button {...props} ref={buttonRef} type=\"button\" iconStart={icon} tone=\"base\" onPress={onCopy}>\n {children}\n </Button>\n ) : (\n <IconButton\n {...props}\n ref={buttonRef}\n type=\"button\"\n icon={icon}\n tone=\"base\"\n aria-label={props['aria-label'] ?? ''}\n onPress={onCopy}\n />\n );\n}\n"]}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { ActionButtonProps } from '../button/types.js';
|
|
2
|
+
import type { AriaLabelingProps, CommonProps, StringLikeChildren } from '../types.js';
|
|
3
|
+
import type { TextStyleOptions } from '../typography/types.js';
|
|
4
|
+
export interface CopyInlineProps extends CommonProps, AriaLabelingProps, Pick<TextStyleOptions, 'variant'>, Pick<ActionButtonProps, 'isDisabled' | 'onHoverStart' | 'onHoverEnd'> {
|
|
5
|
+
/** The content to be copied. */
|
|
6
|
+
children: StringLikeChildren;
|
|
7
|
+
/** A handler that gets called when the user triggers the copying. */
|
|
8
|
+
onCopy?: () => void;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Allows copying an inline value to clipboard.
|
|
12
|
+
*
|
|
13
|
+
* See [copy inline usage guidelines](https://ui.cimpress.io/components/copy-inline/).
|
|
14
|
+
*/
|
|
15
|
+
declare const _CopyInline: (props: CopyInlineProps & import("react").RefAttributes<HTMLButtonElement> & import("../../with-style-props.js").StyleProps) => import("react").JSX.Element | null;
|
|
16
|
+
export { _CopyInline as CopyInline };
|
|
17
|
+
//# sourceMappingURL=copy-inline.d.ts.map
|