@elliemae/ds-indeterminate-progress-indicator 3.80.0-next.4 → 3.80.0-next.40
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/cjs/DSIndeterminateProgressIndicator.js +21 -7
- package/dist/cjs/DSIndeterminateProgressIndicator.js.map +2 -2
- package/dist/cjs/TruncatedTooltipText.js +49 -6
- package/dist/cjs/TruncatedTooltipText.js.map +2 -2
- package/dist/cjs/config/useIndeterminateProgressIndicator.js +1 -1
- package/dist/cjs/config/useIndeterminateProgressIndicator.js.map +2 -2
- package/dist/cjs/config/useValidateProps.js.map +1 -1
- package/dist/cjs/constants/index.js +10 -5
- package/dist/cjs/constants/index.js.map +2 -2
- package/dist/cjs/index.js +6 -3
- package/dist/cjs/index.js.map +2 -2
- package/dist/cjs/react-desc-prop-types.js +13 -1
- package/dist/cjs/react-desc-prop-types.js.map +2 -2
- package/dist/cjs/styled.js +4 -6
- package/dist/cjs/styled.js.map +3 -3
- package/dist/cjs/typescript-testing/slot-props.js +43 -0
- package/dist/cjs/typescript-testing/slot-props.js.map +7 -0
- package/dist/cjs/typescript-testing/typescript-indeterminate-progress-indicator-valid.js +125 -0
- package/dist/cjs/typescript-testing/typescript-indeterminate-progress-indicator-valid.js.map +7 -0
- package/dist/esm/DSIndeterminateProgressIndicator.js +49 -35
- package/dist/esm/DSIndeterminateProgressIndicator.js.map +2 -2
- package/dist/esm/TruncatedTooltipText.js +50 -7
- package/dist/esm/TruncatedTooltipText.js.map +2 -2
- package/dist/esm/config/useIndeterminateProgressIndicator.js +2 -2
- package/dist/esm/config/useIndeterminateProgressIndicator.js.map +2 -2
- package/dist/esm/config/useValidateProps.js.map +1 -1
- package/dist/esm/constants/index.js +10 -5
- package/dist/esm/constants/index.js.map +2 -2
- package/dist/esm/index.js +15 -3
- package/dist/esm/index.js.map +2 -2
- package/dist/esm/react-desc-prop-types.js +19 -2
- package/dist/esm/react-desc-prop-types.js.map +2 -2
- package/dist/esm/styled.js +5 -7
- package/dist/esm/styled.js.map +3 -3
- package/dist/esm/typescript-testing/slot-props.js +20 -0
- package/dist/esm/typescript-testing/slot-props.js.map +7 -0
- package/dist/esm/typescript-testing/typescript-indeterminate-progress-indicator-valid.js +102 -0
- package/dist/esm/typescript-testing/typescript-indeterminate-progress-indicator-valid.js.map +7 -0
- package/dist/types/TruncatedTooltipText.d.ts +3 -1
- package/dist/types/config/useValidateProps.d.ts +2 -2
- package/dist/types/constants/index.d.ts +22 -10
- package/dist/types/index.d.ts +3 -2
- package/dist/types/react-desc-prop-types.d.ts +19 -5
- package/dist/types/styled.d.ts +0 -1
- package/package.json +9 -7
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __copyProps = (to, from, except, desc) => {
|
|
9
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
10
|
+
for (let key of __getOwnPropNames(from))
|
|
11
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
12
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
13
|
+
}
|
|
14
|
+
return to;
|
|
15
|
+
};
|
|
16
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
17
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
18
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
19
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
20
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
21
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
|
+
mod
|
|
23
|
+
));
|
|
24
|
+
var React = __toESM(require("react"));
|
|
25
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
26
|
+
var import__ = require("../index.js");
|
|
27
|
+
const testRequiredProps = {};
|
|
28
|
+
const testOptionalProps = {
|
|
29
|
+
dsIndeterminateprogressindicatorRoot: { "data-testid": "custom-root" },
|
|
30
|
+
dsIndeterminateprogressindicatorBar_indicator: () => ({ "aria-hidden": true })
|
|
31
|
+
};
|
|
32
|
+
const testPartialDefaults = {
|
|
33
|
+
title: "Loading",
|
|
34
|
+
processing: true
|
|
35
|
+
};
|
|
36
|
+
const testProps = {
|
|
37
|
+
...testRequiredProps,
|
|
38
|
+
...testOptionalProps,
|
|
39
|
+
...testPartialDefaults
|
|
40
|
+
};
|
|
41
|
+
const testPropsAsSyntax = {
|
|
42
|
+
...testRequiredProps,
|
|
43
|
+
...testOptionalProps,
|
|
44
|
+
...testPartialDefaults
|
|
45
|
+
};
|
|
46
|
+
const testCompleteDefaults = {
|
|
47
|
+
containerProps: {},
|
|
48
|
+
title: "",
|
|
49
|
+
complete: false,
|
|
50
|
+
failed: false,
|
|
51
|
+
processing: false,
|
|
52
|
+
processingComplete: false,
|
|
53
|
+
processingCompleteTitle: "Complete",
|
|
54
|
+
processingFail: false,
|
|
55
|
+
processingFailTitle: "Fail",
|
|
56
|
+
animated: true,
|
|
57
|
+
percent: 50,
|
|
58
|
+
lineOnly: false
|
|
59
|
+
};
|
|
60
|
+
const testInternalProps = {
|
|
61
|
+
...testRequiredProps,
|
|
62
|
+
...testOptionalProps,
|
|
63
|
+
...testCompleteDefaults
|
|
64
|
+
};
|
|
65
|
+
const testInternalPropsAsSyntax = {
|
|
66
|
+
...testRequiredProps,
|
|
67
|
+
...testOptionalProps,
|
|
68
|
+
...testCompleteDefaults
|
|
69
|
+
};
|
|
70
|
+
const testExplicitDefinition = {
|
|
71
|
+
containerProps: { "data-testid": "custom-root" },
|
|
72
|
+
title: "Loading documents",
|
|
73
|
+
complete: false,
|
|
74
|
+
failed: false,
|
|
75
|
+
processing: true,
|
|
76
|
+
processingComplete: false,
|
|
77
|
+
processingCompleteTitle: "Done",
|
|
78
|
+
processingFail: false,
|
|
79
|
+
processingFailTitle: "Failed",
|
|
80
|
+
animated: true,
|
|
81
|
+
percent: 50,
|
|
82
|
+
lineOnly: false,
|
|
83
|
+
id: "documents-loader",
|
|
84
|
+
mt: "xs"
|
|
85
|
+
};
|
|
86
|
+
const testInferedTypeCompatibility = {
|
|
87
|
+
containerProps: { "data-testid": "custom-root" },
|
|
88
|
+
title: "Loading documents",
|
|
89
|
+
processing: true,
|
|
90
|
+
processingCompleteTitle: "Done",
|
|
91
|
+
processingFailTitle: "Failed",
|
|
92
|
+
animated: false,
|
|
93
|
+
percent: 40
|
|
94
|
+
};
|
|
95
|
+
const testDefinitionAsConst = {
|
|
96
|
+
containerProps: { "data-testid": "custom-root" },
|
|
97
|
+
title: "Loading documents",
|
|
98
|
+
processing: true,
|
|
99
|
+
lineOnly: true
|
|
100
|
+
};
|
|
101
|
+
const ExampleUsageComponent = () => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
102
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__.DSIndeterminateProgressIndicator, { ...testExplicitDefinition }),
|
|
103
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__.DSIndeterminateProgressIndicator, { ...testInferedTypeCompatibility }),
|
|
104
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__.DSIndeterminateProgressIndicator, { ...testDefinitionAsConst }),
|
|
105
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
106
|
+
import__.DSIndeterminateProgressIndicator,
|
|
107
|
+
{
|
|
108
|
+
containerProps: { "data-testid": "custom-root" },
|
|
109
|
+
title: "Loading documents",
|
|
110
|
+
complete: false,
|
|
111
|
+
failed: false,
|
|
112
|
+
processing: true,
|
|
113
|
+
processingComplete: false,
|
|
114
|
+
processingCompleteTitle: "Done",
|
|
115
|
+
processingFail: false,
|
|
116
|
+
processingFailTitle: "Failed",
|
|
117
|
+
animated: true,
|
|
118
|
+
percent: 50,
|
|
119
|
+
lineOnly: false,
|
|
120
|
+
dsIndeterminateprogressindicatorLabel: { "aria-hidden": true },
|
|
121
|
+
dsIndeterminateprogressindicatorBar_indicator: () => ({ "data-custom": "bar" })
|
|
122
|
+
}
|
|
123
|
+
)
|
|
124
|
+
] });
|
|
125
|
+
//# sourceMappingURL=typescript-indeterminate-progress-indicator-valid.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/typescript-testing/typescript-indeterminate-progress-indicator-valid.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable @typescript-eslint/no-unused-vars, no-unused-vars */\nimport React from 'react';\nimport { DSIndeterminateProgressIndicator } from '../index.js';\nimport type { DSIndeterminateProgressIndicatorT } from '../index.js';\n\n// test we expose the namespace and the namespace follows our deliverable conventions\ntype ComponentPropsForApp = DSIndeterminateProgressIndicatorT.Props;\ntype ComponentPropsInternals = DSIndeterminateProgressIndicatorT.InternalProps;\ntype ComponentPropsDefaultProps = DSIndeterminateProgressIndicatorT.DefaultProps;\ntype ComponentPropsOptionalProps = DSIndeterminateProgressIndicatorT.OptionalProps;\ntype ComponentPropsRequiredProps = DSIndeterminateProgressIndicatorT.RequiredProps;\n\nconst testRequiredProps: ComponentPropsRequiredProps = {};\n\nconst testOptionalProps: ComponentPropsOptionalProps = {\n dsIndeterminateprogressindicatorRoot: { 'data-testid': 'custom-root' },\n dsIndeterminateprogressindicatorBar_indicator: () => ({ 'aria-hidden': true }),\n};\n\n// difference Props and InternalProps is that InternalProps has all the default props filled in\n// Props allows for partial defaults\nconst testPartialDefaults: Partial<ComponentPropsDefaultProps> = {\n title: 'Loading',\n processing: true,\n};\n\nconst testProps: ComponentPropsForApp = {\n ...testRequiredProps,\n ...testOptionalProps,\n ...testPartialDefaults,\n};\n\nconst testPropsAsSyntax = {\n ...testRequiredProps,\n ...testOptionalProps,\n ...testPartialDefaults,\n} as ComponentPropsForApp;\n\n// InternalProps requires all defaults to be filled in\nconst testCompleteDefaults: Required<ComponentPropsDefaultProps> = {\n containerProps: {},\n title: '',\n complete: false,\n failed: false,\n processing: false,\n processingComplete: false,\n processingCompleteTitle: 'Complete',\n processingFail: false,\n processingFailTitle: 'Fail',\n animated: true,\n percent: 50,\n lineOnly: false,\n};\n\nconst testInternalProps: ComponentPropsInternals = {\n ...testRequiredProps,\n ...testOptionalProps,\n ...testCompleteDefaults,\n};\n\nconst testInternalPropsAsSyntax = {\n ...testRequiredProps,\n ...testOptionalProps,\n ...testCompleteDefaults,\n} as ComponentPropsInternals;\n\n// using the explicit type definition, if there is an error, it will be marked on the key that is wrong\nconst testExplicitDefinition: ComponentPropsForApp = {\n containerProps: { 'data-testid': 'custom-root' },\n title: 'Loading documents',\n complete: false,\n failed: false,\n processing: true,\n processingComplete: false,\n processingCompleteTitle: 'Done',\n processingFail: false,\n processingFailTitle: 'Failed',\n animated: true,\n percent: 50,\n lineOnly: false,\n id: 'documents-loader',\n mt: 'xs',\n};\n\n// using the \"as\" syntax, if there is an error, it will be marking the whole object as wrong because it is not compatible with the type\nconst testInferedTypeCompatibility = {\n containerProps: { 'data-testid': 'custom-root' },\n title: 'Loading documents',\n processing: true,\n processingCompleteTitle: 'Done',\n processingFailTitle: 'Failed',\n animated: false,\n percent: 40,\n} as ComponentPropsForApp;\n\nconst testDefinitionAsConst = {\n containerProps: { 'data-testid': 'custom-root' },\n title: 'Loading documents',\n processing: true,\n lineOnly: true,\n} as const;\n\nconst ExampleUsageComponent = () => (\n <>\n {/* works with explicitly casted props, all syntaxes */}\n <DSIndeterminateProgressIndicator {...testExplicitDefinition} />\n <DSIndeterminateProgressIndicator {...testInferedTypeCompatibility} />\n <DSIndeterminateProgressIndicator {...testDefinitionAsConst} />\n {/* works with inline values */}\n <DSIndeterminateProgressIndicator\n containerProps={{ 'data-testid': 'custom-root' }}\n title=\"Loading documents\"\n complete={false}\n failed={false}\n processing\n processingComplete={false}\n processingCompleteTitle=\"Done\"\n processingFail={false}\n processingFailTitle=\"Failed\"\n animated\n percent={50}\n lineOnly={false}\n dsIndeterminateprogressindicatorLabel={{ 'aria-hidden': true }}\n dsIndeterminateprogressindicatorBar_indicator={() => ({ 'data-custom': 'bar' })}\n />\n </>\n);\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;AAAA,YAAuB;ACuGrB;AArGF,eAAiD;AAUjD,MAAM,oBAAiD,CAAC;AAExD,MAAM,oBAAiD;AAAA,EACrD,sCAAsC,EAAE,eAAe,cAAc;AAAA,EACrE,+CAA+C,OAAO,EAAE,eAAe,KAAK;AAC9E;AAIA,MAAM,sBAA2D;AAAA,EAC/D,OAAO;AAAA,EACP,YAAY;AACd;AAEA,MAAM,YAAkC;AAAA,EACtC,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AACL;AAEA,MAAM,oBAAoB;AAAA,EACxB,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AACL;AAGA,MAAM,uBAA6D;AAAA,EACjE,gBAAgB,CAAC;AAAA,EACjB,OAAO;AAAA,EACP,UAAU;AAAA,EACV,QAAQ;AAAA,EACR,YAAY;AAAA,EACZ,oBAAoB;AAAA,EACpB,yBAAyB;AAAA,EACzB,gBAAgB;AAAA,EAChB,qBAAqB;AAAA,EACrB,UAAU;AAAA,EACV,SAAS;AAAA,EACT,UAAU;AACZ;AAEA,MAAM,oBAA6C;AAAA,EACjD,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AACL;AAEA,MAAM,4BAA4B;AAAA,EAChC,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AACL;AAGA,MAAM,yBAA+C;AAAA,EACnD,gBAAgB,EAAE,eAAe,cAAc;AAAA,EAC/C,OAAO;AAAA,EACP,UAAU;AAAA,EACV,QAAQ;AAAA,EACR,YAAY;AAAA,EACZ,oBAAoB;AAAA,EACpB,yBAAyB;AAAA,EACzB,gBAAgB;AAAA,EAChB,qBAAqB;AAAA,EACrB,UAAU;AAAA,EACV,SAAS;AAAA,EACT,UAAU;AAAA,EACV,IAAI;AAAA,EACJ,IAAI;AACN;AAGA,MAAM,+BAA+B;AAAA,EACnC,gBAAgB,EAAE,eAAe,cAAc;AAAA,EAC/C,OAAO;AAAA,EACP,YAAY;AAAA,EACZ,yBAAyB;AAAA,EACzB,qBAAqB;AAAA,EACrB,UAAU;AAAA,EACV,SAAS;AACX;AAEA,MAAM,wBAAwB;AAAA,EAC5B,gBAAgB,EAAE,eAAe,cAAc;AAAA,EAC/C,OAAO;AAAA,EACP,YAAY;AAAA,EACZ,UAAU;AACZ;AAEA,MAAM,wBAAwB,MAC5B,4EAEE;AAAA,8CAAC,6CAAkC,GAAG,wBAAwB;AAAA,EAC9D,4CAAC,6CAAkC,GAAG,8BAA8B;AAAA,EACpE,4CAAC,6CAAkC,GAAG,uBAAuB;AAAA,EAE7D;AAAA,IAAC;AAAA;AAAA,MACC,gBAAgB,EAAE,eAAe,cAAc;AAAA,MAC/C,OAAM;AAAA,MACN,UAAU;AAAA,MACV,QAAQ;AAAA,MACR,YAAU;AAAA,MACV,oBAAoB;AAAA,MACpB,yBAAwB;AAAA,MACxB,gBAAgB;AAAA,MAChB,qBAAoB;AAAA,MACpB,UAAQ;AAAA,MACR,SAAS;AAAA,MACT,UAAU;AAAA,MACV,uCAAuC,EAAE,eAAe,KAAK;AAAA,MAC7D,+CAA+C,OAAO,EAAE,eAAe,MAAM;AAAA;AAAA,EAC/E;AAAA,GACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -3,11 +3,12 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
3
3
|
import { useCallback } from "react";
|
|
4
4
|
import { describe, useGetGlobalAttributes, useGetXstyledProps } from "@elliemae/ds-props-helpers";
|
|
5
5
|
import {
|
|
6
|
-
|
|
6
|
+
DSIndeterminateProgressIndicatorPropTypesSchema
|
|
7
7
|
} from "./react-desc-prop-types.js";
|
|
8
8
|
import { useIndeterminateProgressIndicator } from "./config/useIndeterminateProgressIndicator.js";
|
|
9
9
|
import { DSIndeterminateProgressIndicatorName } from "./constants/index.js";
|
|
10
|
-
import { Bar, BarIndicator, Container
|
|
10
|
+
import { Bar, BarIndicator, Container } from "./styled.js";
|
|
11
|
+
import { TruncatedTooltipText } from "./TruncatedTooltipText.js";
|
|
11
12
|
const DSIndeterminateProgressIndicator = (props) => {
|
|
12
13
|
const { propsWithDefault, label } = useIndeterminateProgressIndicator(props);
|
|
13
14
|
const {
|
|
@@ -21,46 +22,59 @@ const DSIndeterminateProgressIndicator = (props) => {
|
|
|
21
22
|
percent,
|
|
22
23
|
lineOnly
|
|
23
24
|
} = propsWithDefault;
|
|
24
|
-
const globalAttributes = useGetGlobalAttributes(propsWithDefault);
|
|
25
|
+
const { title: titleConsumed, ...globalAttributes } = useGetGlobalAttributes(propsWithDefault);
|
|
25
26
|
const xstyledAttributes = useGetXstyledProps(propsWithDefault);
|
|
26
27
|
const getOwnerProps = useCallback(() => propsWithDefault, [propsWithDefault]);
|
|
27
28
|
const getOwnerPropsArguments = useCallback(() => ({}), []);
|
|
28
|
-
return
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
29
|
+
return (
|
|
30
|
+
// Live-region contract, per the Accessibility Expert Validation (PUI-18878, PUI-18879, PUI-18622):
|
|
31
|
+
// - `role="status"` in every state: a loader is ambient feedback and must not interrupt, which the assertive
|
|
32
|
+
// `role="alert"` did. Its implicit polite/atomic semantics make an explicit `aria-live` redundant, and the
|
|
33
|
+
// explicit `aria-live="polite"` next to `role="alert"` was the conflicting signal.
|
|
34
|
+
// - no `aria-busy`: it belongs on the region being loaded, which only the consumer renders.
|
|
35
|
+
// These are defaults, so global attributes, containerProps and the root slot can still override them.
|
|
36
|
+
/* @__PURE__ */ jsxs(
|
|
37
|
+
Container,
|
|
38
|
+
{
|
|
39
|
+
role: "status",
|
|
40
|
+
"aria-label": label,
|
|
41
|
+
lineOnly,
|
|
42
|
+
getOwnerProps,
|
|
43
|
+
getOwnerPropsArguments,
|
|
44
|
+
...globalAttributes,
|
|
45
|
+
...xstyledAttributes,
|
|
46
|
+
...containerProps,
|
|
47
|
+
children: [
|
|
48
|
+
!lineOnly ? /* @__PURE__ */ jsx(
|
|
49
|
+
TruncatedTooltipText,
|
|
50
|
+
{
|
|
51
|
+
value: label,
|
|
52
|
+
getOwnerProps,
|
|
53
|
+
getOwnerPropsArguments
|
|
54
|
+
}
|
|
55
|
+
) : null,
|
|
56
|
+
/* @__PURE__ */ jsx(Bar, { getOwnerProps, getOwnerPropsArguments, children: /* @__PURE__ */ jsx(
|
|
57
|
+
BarIndicator,
|
|
58
|
+
{
|
|
59
|
+
complete,
|
|
60
|
+
failed,
|
|
61
|
+
processing,
|
|
62
|
+
animated,
|
|
63
|
+
processingComplete,
|
|
64
|
+
processingFail,
|
|
65
|
+
percent,
|
|
66
|
+
getOwnerProps,
|
|
67
|
+
getOwnerPropsArguments
|
|
68
|
+
}
|
|
69
|
+
) })
|
|
70
|
+
]
|
|
71
|
+
}
|
|
72
|
+
)
|
|
59
73
|
);
|
|
60
74
|
};
|
|
61
75
|
DSIndeterminateProgressIndicator.displayName = DSIndeterminateProgressIndicatorName;
|
|
62
76
|
const IndeterminateProgressIndicatorWithSchema = describe(DSIndeterminateProgressIndicator);
|
|
63
|
-
IndeterminateProgressIndicatorWithSchema.propTypes =
|
|
77
|
+
IndeterminateProgressIndicatorWithSchema.propTypes = DSIndeterminateProgressIndicatorPropTypesSchema;
|
|
64
78
|
var DSIndeterminateProgressIndicator_default = DSIndeterminateProgressIndicator;
|
|
65
79
|
export {
|
|
66
80
|
DSIndeterminateProgressIndicator,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/DSIndeterminateProgressIndicator.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useCallback } from 'react';\nimport { describe, useGetGlobalAttributes, useGetXstyledProps } from '@elliemae/ds-props-helpers';\nimport {\n
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useCallback } from 'react';\nimport { describe, useGetGlobalAttributes, useGetXstyledProps } from '@elliemae/ds-props-helpers';\nimport {\n DSIndeterminateProgressIndicatorPropTypesSchema,\n type DSIndeterminateProgressIndicatorT,\n} from './react-desc-prop-types.js';\nimport { useIndeterminateProgressIndicator } from './config/useIndeterminateProgressIndicator.js';\nimport { DSIndeterminateProgressIndicatorName } from './constants/index.js';\nimport { Bar, BarIndicator, Container } from './styled.js';\nimport { TruncatedTooltipText } from './TruncatedTooltipText.js';\n\nconst DSIndeterminateProgressIndicator: React.ComponentType<DSIndeterminateProgressIndicatorT.Props> = (props) => {\n const { propsWithDefault, label } = useIndeterminateProgressIndicator(props);\n const {\n containerProps,\n complete,\n failed,\n processing,\n processingComplete,\n processingFail,\n animated,\n percent,\n lineOnly,\n } = propsWithDefault;\n\n // exclude `title` \u2014 it is consumed as the accessible name (aria-label); forwarding it as the HTML\n // `title` attribute would make some screen readers announce the label twice (PUI-18880).\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const { title: titleConsumed, ...globalAttributes } = useGetGlobalAttributes(propsWithDefault);\n const xstyledAttributes = useGetXstyledProps(propsWithDefault);\n const getOwnerProps = useCallback(() => propsWithDefault, [propsWithDefault]);\n const getOwnerPropsArguments = useCallback(() => ({}), []);\n\n return (\n // Live-region contract, per the Accessibility Expert Validation (PUI-18878, PUI-18879, PUI-18622):\n // - `role=\"status\"` in every state: a loader is ambient feedback and must not interrupt, which the assertive\n // `role=\"alert\"` did. Its implicit polite/atomic semantics make an explicit `aria-live` redundant, and the\n // explicit `aria-live=\"polite\"` next to `role=\"alert\"` was the conflicting signal.\n // - no `aria-busy`: it belongs on the region being loaded, which only the consumer renders.\n // These are defaults, so global attributes, containerProps and the root slot can still override them.\n <Container\n role=\"status\"\n aria-label={label}\n lineOnly={lineOnly}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n {...globalAttributes}\n {...xstyledAttributes}\n {...containerProps}\n >\n {!lineOnly ? (\n <TruncatedTooltipText\n value={label}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n />\n ) : null}\n <Bar getOwnerProps={getOwnerProps} getOwnerPropsArguments={getOwnerPropsArguments}>\n <BarIndicator\n complete={complete}\n failed={failed}\n processing={processing}\n animated={animated}\n processingComplete={processingComplete}\n processingFail={processingFail}\n percent={percent}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n />\n </Bar>\n </Container>\n );\n};\n\nDSIndeterminateProgressIndicator.displayName = DSIndeterminateProgressIndicatorName;\nconst IndeterminateProgressIndicatorWithSchema = describe(DSIndeterminateProgressIndicator);\nIndeterminateProgressIndicatorWithSchema.propTypes = DSIndeterminateProgressIndicatorPropTypesSchema;\n\nexport { DSIndeterminateProgressIndicator, IndeterminateProgressIndicatorWithSchema };\nexport default DSIndeterminateProgressIndicator;\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACwCnB,SAWI,KAXJ;AAxCJ,SAAgB,mBAAmB;AACnC,SAAS,UAAU,wBAAwB,0BAA0B;AACrE;AAAA,EACE;AAAA,OAEK;AACP,SAAS,yCAAyC;AAClD,SAAS,4CAA4C;AACrD,SAAS,KAAK,cAAc,iBAAiB;AAC7C,SAAS,4BAA4B;AAErC,MAAM,mCAAiG,CAAC,UAAU;AAChH,QAAM,EAAE,kBAAkB,MAAM,IAAI,kCAAkC,KAAK;AAC3E,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI;AAKJ,QAAM,EAAE,OAAO,eAAe,GAAG,iBAAiB,IAAI,uBAAuB,gBAAgB;AAC7F,QAAM,oBAAoB,mBAAmB,gBAAgB;AAC7D,QAAM,gBAAgB,YAAY,MAAM,kBAAkB,CAAC,gBAAgB,CAAC;AAC5E,QAAM,yBAAyB,YAAY,OAAO,CAAC,IAAI,CAAC,CAAC;AAEzD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOE;AAAA,MAAC;AAAA;AAAA,QACC,MAAK;AAAA,QACL,cAAY;AAAA,QACZ;AAAA,QACA;AAAA,QACA;AAAA,QACC,GAAG;AAAA,QACH,GAAG;AAAA,QACH,GAAG;AAAA,QAEH;AAAA,WAAC,WACA;AAAA,YAAC;AAAA;AAAA,cACC,OAAO;AAAA,cACP;AAAA,cACA;AAAA;AAAA,UACF,IACE;AAAA,UACJ,oBAAC,OAAI,eAA8B,wBACjC;AAAA,YAAC;AAAA;AAAA,cACC;AAAA,cACA;AAAA,cACA;AAAA,cACA;AAAA,cACA;AAAA,cACA;AAAA,cACA;AAAA,cACA;AAAA,cACA;AAAA;AAAA,UACF,GACF;AAAA;AAAA;AAAA,IACF;AAAA;AAEJ;AAEA,iCAAiC,cAAc;AAC/C,MAAM,2CAA2C,SAAS,gCAAgC;AAC1F,yCAAyC,YAAY;AAGrD,IAAO,2CAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,20 +1,40 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { useCallback, useState } from "react";
|
|
4
|
-
import { styled } from "@elliemae/ds-system";
|
|
4
|
+
import { css, styled } from "@elliemae/ds-system";
|
|
5
|
+
import { DSTypography } from "@elliemae/ds-typography";
|
|
5
6
|
import {
|
|
6
7
|
useFloatingContext,
|
|
7
8
|
FloatingWrapper,
|
|
8
9
|
PopoverArrow
|
|
9
10
|
} from "@elliemae/ds-floating-context";
|
|
10
|
-
|
|
11
|
+
import { DSIndeterminateProgressIndicatorName, INDETERMINATE_PROGRESS_INDICATOR_SLOTS } from "./constants/index.js";
|
|
12
|
+
const inheritedTypography = css`
|
|
13
|
+
font: inherit;
|
|
14
|
+
line-height: inherit;
|
|
15
|
+
color: inherit;
|
|
16
|
+
white-space: inherit;
|
|
17
|
+
overflow-wrap: inherit;
|
|
18
|
+
margin: 0;
|
|
19
|
+
padding: 0;
|
|
20
|
+
`;
|
|
21
|
+
const StyledLabel = styled("span", {
|
|
22
|
+
name: DSIndeterminateProgressIndicatorName,
|
|
23
|
+
slot: INDETERMINATE_PROGRESS_INDICATOR_SLOTS.LABEL
|
|
24
|
+
})`
|
|
11
25
|
text-overflow: ellipsis;
|
|
12
26
|
white-space: nowrap;
|
|
13
27
|
overflow: hidden;
|
|
14
28
|
display: inline-block;
|
|
15
29
|
max-width: 100%;
|
|
30
|
+
&& > * {
|
|
31
|
+
${inheritedTypography}
|
|
32
|
+
}
|
|
16
33
|
`;
|
|
17
|
-
const
|
|
34
|
+
const StyledTooltipContainer = styled("div", {
|
|
35
|
+
name: DSIndeterminateProgressIndicatorName,
|
|
36
|
+
slot: INDETERMINATE_PROGRESS_INDICATOR_SLOTS.TOOLTIP_CONTAINER
|
|
37
|
+
})`
|
|
18
38
|
text-align: center;
|
|
19
39
|
min-width: ${({ theme }) => theme.space.l};
|
|
20
40
|
max-width: 250px;
|
|
@@ -31,7 +51,20 @@ const TooltipContainer = styled.div`
|
|
|
31
51
|
color: ${({ theme }) => theme.colors.neutral[600]};
|
|
32
52
|
pointer-events: none;
|
|
33
53
|
`;
|
|
34
|
-
const
|
|
54
|
+
const StyledTooltipText = styled("span", {
|
|
55
|
+
name: DSIndeterminateProgressIndicatorName,
|
|
56
|
+
slot: INDETERMINATE_PROGRESS_INDICATOR_SLOTS.TOOLTIP_TEXT
|
|
57
|
+
})`
|
|
58
|
+
&& > * {
|
|
59
|
+
${inheritedTypography}
|
|
60
|
+
}
|
|
61
|
+
`;
|
|
62
|
+
const TruncatedTooltipText = ({
|
|
63
|
+
value = "",
|
|
64
|
+
placement = "top",
|
|
65
|
+
getOwnerProps,
|
|
66
|
+
getOwnerPropsArguments
|
|
67
|
+
}) => {
|
|
35
68
|
const [showTooltip, setShowTooltip] = useState(false);
|
|
36
69
|
const { refs, floatingStyles, arrowStyles, context } = useFloatingContext({
|
|
37
70
|
placement,
|
|
@@ -46,7 +79,17 @@ const TruncatedTooltipText = ({ value = "", placement = "top" }) => {
|
|
|
46
79
|
setShowTooltip(false);
|
|
47
80
|
}, []);
|
|
48
81
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
49
|
-
/* @__PURE__ */ jsx(
|
|
82
|
+
/* @__PURE__ */ jsx(
|
|
83
|
+
StyledLabel,
|
|
84
|
+
{
|
|
85
|
+
innerRef: refs.setReference,
|
|
86
|
+
onMouseEnter: handleMouseEnter,
|
|
87
|
+
onMouseLeave: handleMouseLeave,
|
|
88
|
+
getOwnerProps,
|
|
89
|
+
getOwnerPropsArguments,
|
|
90
|
+
children: /* @__PURE__ */ jsx(DSTypography, { component: "span", variant: "b2", children: value })
|
|
91
|
+
}
|
|
92
|
+
),
|
|
50
93
|
/* @__PURE__ */ jsx(
|
|
51
94
|
FloatingWrapper,
|
|
52
95
|
{
|
|
@@ -54,8 +97,8 @@ const TruncatedTooltipText = ({ value = "", placement = "top" }) => {
|
|
|
54
97
|
isOpen: showTooltip,
|
|
55
98
|
floatingStyles,
|
|
56
99
|
context,
|
|
57
|
-
children: /* @__PURE__ */ jsxs(
|
|
58
|
-
value,
|
|
100
|
+
children: /* @__PURE__ */ jsxs(StyledTooltipContainer, { getOwnerProps, getOwnerPropsArguments, children: [
|
|
101
|
+
/* @__PURE__ */ jsx(StyledTooltipText, { getOwnerProps, getOwnerPropsArguments, children: /* @__PURE__ */ jsx(DSTypography, { component: "span", variant: "b2-light", children: value }) }),
|
|
59
102
|
/* @__PURE__ */ jsx(PopoverArrow, { ...arrowStyles })
|
|
60
103
|
] })
|
|
61
104
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/TruncatedTooltipText.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useCallback, useState } from 'react';\nimport { styled } from '@elliemae/ds-system';\nimport {\n useFloatingContext,\n FloatingWrapper,\n PopoverArrow,\n type DSHookFloatingContextT,\n} from '@elliemae/ds-floating-context';\n\nconst
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useCallback, useState } from 'react';\nimport { css, styled } from '@elliemae/ds-system';\nimport { DSTypography } from '@elliemae/ds-typography';\nimport {\n useFloatingContext,\n FloatingWrapper,\n PopoverArrow,\n type DSHookFloatingContextT,\n} from '@elliemae/ds-floating-context';\nimport { DSIndeterminateProgressIndicatorName, INDETERMINATE_PROGRESS_INDICATOR_SLOTS } from './constants/index.js';\n\n// ============================================================================================================\n// Typography (PUI-18944)\n// ============================================================================================================\n// The label and the tooltip text render through DSTypography, following the ds-form-radio reference pattern\n// (b2 / b2-light). Three constraints shape how:\n//\n// - Each DSTypography is nested inside its slot element (LABEL, TOOLTIP_TEXT) rather than being the slot.\n// Making DSTypography the slot would let the nested-slot mechanism rewrite `data-dimsum-slot` to\n// `dsTypographyRoot` and demote ours to `data-dimsum-parent-slot` (see ds-progress-indicator, PUI-18942).\n// `dsIndeterminateprogressindicatorLabel` shipped on the label span until the ds-truncated-tooltip-text\n// deprecation (PUI-17903) silently dropped it, so it is restored here with its original value.\n// - No visual change. Today the label inherits the consumer's typography and the tooltip text inherits the\n// body's, inside a container that pins 13px / neutral-600. DSTypography's own metrics (b2 line-height,\n// font-family, `white-space: pre-wrap`) would change both, so the DSTypography elements inherit everything\n// from their slot. `&& > *` gives 0-2-0, which beats DSTypography's single class whatever the injection order.\n// - Slot customization must still reach the text. The theme's `styleOverrides` for a slot are emitted at the end\n// of the slot's own class (0-1-0), so the inherit rules target the child only: a 0-2-0 rule on the slot\n// element itself would silently beat a consumer's `styleOverrides` color or font for that slot.\n//\n// Deliberately neutral: adopting the b2 / b2-light metrics is a UX decision, not a side effect of this change.\n// When it is taken, drop `font` / `line-height` / `color` from these blocks and let the variants apply.\nconst inheritedTypography = css`\n font: inherit;\n line-height: inherit;\n color: inherit;\n white-space: inherit;\n overflow-wrap: inherit;\n margin: 0;\n padding: 0;\n`;\n\nconst StyledLabel = styled('span', {\n name: DSIndeterminateProgressIndicatorName,\n slot: INDETERMINATE_PROGRESS_INDICATOR_SLOTS.LABEL,\n})`\n text-overflow: ellipsis;\n white-space: nowrap;\n overflow: hidden;\n display: inline-block;\n max-width: 100%;\n && > * {\n ${inheritedTypography}\n }\n`;\n\n// Matches DSTooltipV3's StyledTooltipContainer styles for visual consistency\nconst StyledTooltipContainer = styled('div', {\n name: DSIndeterminateProgressIndicatorName,\n slot: INDETERMINATE_PROGRESS_INDICATOR_SLOTS.TOOLTIP_CONTAINER,\n})`\n text-align: center;\n min-width: ${({ theme }) => theme.space.l};\n max-width: 250px;\n overflow-wrap: break-word;\n word-break: break-word;\n min-height: 30px;\n display: grid;\n align-items: center;\n padding: ${({ theme }) => `${theme.space.xxs} ${theme.space.xs}`};\n position: relative;\n background-color: white;\n border-radius: 2px;\n font-size: 13px;\n color: ${({ theme }) => theme.colors.neutral[600]};\n pointer-events: none;\n`;\n\nconst StyledTooltipText = styled('span', {\n name: DSIndeterminateProgressIndicatorName,\n slot: INDETERMINATE_PROGRESS_INDICATOR_SLOTS.TOOLTIP_TEXT,\n})`\n && > * {\n ${inheritedTypography}\n }\n`;\n\ninterface TruncatedTooltipTextProps {\n value?: string;\n placement?: DSHookFloatingContextT.PopperPlacementsT;\n getOwnerProps?: () => object;\n getOwnerPropsArguments?: () => object;\n}\n\nconst TruncatedTooltipText = ({\n value = '',\n placement = 'top',\n getOwnerProps,\n getOwnerPropsArguments,\n}: TruncatedTooltipTextProps) => {\n const [showTooltip, setShowTooltip] = useState(false);\n\n const { refs, floatingStyles, arrowStyles, context } = useFloatingContext({\n placement,\n externallyControlledIsOpen: showTooltip,\n withoutAnimation: true,\n });\n\n const handleMouseEnter = useCallback((e: React.MouseEvent<HTMLSpanElement>) => {\n const el = e.currentTarget;\n setShowTooltip(el.offsetWidth < el.scrollWidth);\n }, []);\n\n const handleMouseLeave = useCallback(() => {\n setShowTooltip(false);\n }, []);\n\n return (\n <>\n <StyledLabel\n innerRef={refs.setReference}\n onMouseEnter={handleMouseEnter}\n onMouseLeave={handleMouseLeave}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n <DSTypography component=\"span\" variant=\"b2\">\n {value}\n </DSTypography>\n </StyledLabel>\n <FloatingWrapper\n innerRef={refs.setFloating}\n isOpen={showTooltip}\n floatingStyles={floatingStyles}\n context={context}\n >\n <StyledTooltipContainer getOwnerProps={getOwnerProps} getOwnerPropsArguments={getOwnerPropsArguments}>\n <StyledTooltipText getOwnerProps={getOwnerProps} getOwnerPropsArguments={getOwnerPropsArguments}>\n <DSTypography component=\"span\" variant=\"b2-light\">\n {value}\n </DSTypography>\n </StyledTooltipText>\n <PopoverArrow {...arrowStyles} />\n </StyledTooltipContainer>\n </FloatingWrapper>\n </>\n );\n};\n\nexport { TruncatedTooltipText };\nexport default TruncatedTooltipText;\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACsHnB,mBAQI,KAUA,YAlBJ;AAtHJ,SAAgB,aAAa,gBAAgB;AAC7C,SAAS,KAAK,cAAc;AAC5B,SAAS,oBAAoB;AAC7B;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OAEK;AACP,SAAS,sCAAsC,8CAA8C;AAuB7F,MAAM,sBAAsB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAU5B,MAAM,cAAc,OAAO,QAAQ;AAAA,EACjC,MAAM;AAAA,EACN,MAAM,uCAAuC;AAC/C,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MAOK,mBAAmB;AAAA;AAAA;AAKzB,MAAM,yBAAyB,OAAO,OAAO;AAAA,EAC3C,MAAM;AAAA,EACN,MAAM,uCAAuC;AAC/C,CAAC;AAAA;AAAA,eAEc,CAAC,EAAE,MAAM,MAAM,MAAM,MAAM,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,aAO9B,CAAC,EAAE,MAAM,MAAM,GAAG,MAAM,MAAM,GAAG,IAAI,MAAM,MAAM,EAAE,EAAE;AAAA;AAAA;AAAA;AAAA;AAAA,WAKvD,CAAC,EAAE,MAAM,MAAM,MAAM,OAAO,QAAQ,GAAG,CAAC;AAAA;AAAA;AAInD,MAAM,oBAAoB,OAAO,QAAQ;AAAA,EACvC,MAAM;AAAA,EACN,MAAM,uCAAuC;AAC/C,CAAC;AAAA;AAAA,MAEK,mBAAmB;AAAA;AAAA;AAWzB,MAAM,uBAAuB,CAAC;AAAA,EAC5B,QAAQ;AAAA,EACR,YAAY;AAAA,EACZ;AAAA,EACA;AACF,MAAiC;AAC/B,QAAM,CAAC,aAAa,cAAc,IAAI,SAAS,KAAK;AAEpD,QAAM,EAAE,MAAM,gBAAgB,aAAa,QAAQ,IAAI,mBAAmB;AAAA,IACxE;AAAA,IACA,4BAA4B;AAAA,IAC5B,kBAAkB;AAAA,EACpB,CAAC;AAED,QAAM,mBAAmB,YAAY,CAAC,MAAyC;AAC7E,UAAM,KAAK,EAAE;AACb,mBAAe,GAAG,cAAc,GAAG,WAAW;AAAA,EAChD,GAAG,CAAC,CAAC;AAEL,QAAM,mBAAmB,YAAY,MAAM;AACzC,mBAAe,KAAK;AAAA,EACtB,GAAG,CAAC,CAAC;AAEL,SACE,iCACE;AAAA;AAAA,MAAC;AAAA;AAAA,QACC,UAAU,KAAK;AAAA,QACf,cAAc;AAAA,QACd,cAAc;AAAA,QACd;AAAA,QACA;AAAA,QAEA,8BAAC,gBAAa,WAAU,QAAO,SAAQ,MACpC,iBACH;AAAA;AAAA,IACF;AAAA,IACA;AAAA,MAAC;AAAA;AAAA,QACC,UAAU,KAAK;AAAA,QACf,QAAQ;AAAA,QACR;AAAA,QACA;AAAA,QAEA,+BAAC,0BAAuB,eAA8B,wBACpD;AAAA,8BAAC,qBAAkB,eAA8B,wBAC/C,8BAAC,gBAAa,WAAU,QAAO,SAAQ,YACpC,iBACH,GACF;AAAA,UACA,oBAAC,gBAAc,GAAG,aAAa;AAAA,WACjC;AAAA;AAAA,IACF;AAAA,KACF;AAEJ;AAGA,IAAO,+BAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -2,7 +2,7 @@ import * as React from "react";
|
|
|
2
2
|
import React2, { useMemo } from "react";
|
|
3
3
|
import { useMemoMergePropsWithDefault } from "@elliemae/ds-props-helpers";
|
|
4
4
|
import {
|
|
5
|
-
|
|
5
|
+
DSIndeterminateProgressIndicatorPropTypesSchema,
|
|
6
6
|
defaultProps
|
|
7
7
|
} from "../react-desc-prop-types.js";
|
|
8
8
|
import { useValidateProps } from "./useValidateProps.js";
|
|
@@ -11,7 +11,7 @@ const useIndeterminateProgressIndicator = (propsFromUser) => {
|
|
|
11
11
|
propsFromUser,
|
|
12
12
|
defaultProps
|
|
13
13
|
);
|
|
14
|
-
useValidateProps(propsWithDefault,
|
|
14
|
+
useValidateProps(propsWithDefault, DSIndeterminateProgressIndicatorPropTypesSchema);
|
|
15
15
|
const {
|
|
16
16
|
title,
|
|
17
17
|
complete,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/config/useIndeterminateProgressIndicator.ts"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useMemo } from 'react';\nimport { useMemoMergePropsWithDefault } from '@elliemae/ds-props-helpers';\nimport {\n type DSIndeterminateProgressIndicatorT,\n
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACAvB,OAAOA,UAAS,eAAe;AAC/B,SAAS,oCAAoC;AAC7C;AAAA,EAEE;AAAA,EACA;AAAA,OACK;AACP,SAAS,wBAAwB;AAM1B,MAAM,oCAAoC,CAAC,kBAA2D;AAI3G,QAAM,mBAAmB;AAAA,IACvB;AAAA,IACA;AAAA,EACF;AACA,mBAAiB,kBAAkB
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useMemo } from 'react';\nimport { useMemoMergePropsWithDefault } from '@elliemae/ds-props-helpers';\nimport {\n type DSIndeterminateProgressIndicatorT,\n DSIndeterminateProgressIndicatorPropTypesSchema,\n defaultProps,\n} from '../react-desc-prop-types.js';\nimport { useValidateProps } from './useValidateProps.js';\n\nexport interface IndeterminateProgressIndicatorCTX {\n propsWithDefault: DSIndeterminateProgressIndicatorT.InternalProps;\n}\n\nexport const useIndeterminateProgressIndicator = (propsFromUser: DSIndeterminateProgressIndicatorT.Props) => {\n // =============================================================================\n // MERGE WITH DEFAULT AND VALIDATE PROPS\n // =============================================================================\n const propsWithDefault = useMemoMergePropsWithDefault<DSIndeterminateProgressIndicatorT.InternalProps>(\n propsFromUser,\n defaultProps,\n );\n useValidateProps(propsWithDefault, DSIndeterminateProgressIndicatorPropTypesSchema);\n // =============================================================================\n // AD HOC PER COMPONENT LOGIC\n // =============================================================================\n const {\n title,\n complete,\n failed,\n processing,\n processingComplete,\n processingCompleteTitle,\n processingFail,\n processingFailTitle,\n } = propsWithDefault;\n\n const label = useMemo(() => {\n if ((processingComplete || processingFail || processing) && (complete || failed)) {\n return complete ? processingCompleteTitle : processingFailTitle;\n }\n return title;\n }, [\n processingComplete,\n processingFail,\n processing,\n complete,\n failed,\n title,\n processingCompleteTitle,\n processingFailTitle,\n ]);\n\n return React.useMemo(\n () => ({\n propsWithDefault,\n label,\n }),\n [propsWithDefault, label],\n );\n};\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB,OAAOA,UAAS,eAAe;AAC/B,SAAS,oCAAoC;AAC7C;AAAA,EAEE;AAAA,EACA;AAAA,OACK;AACP,SAAS,wBAAwB;AAM1B,MAAM,oCAAoC,CAAC,kBAA2D;AAI3G,QAAM,mBAAmB;AAAA,IACvB;AAAA,IACA;AAAA,EACF;AACA,mBAAiB,kBAAkB,+CAA+C;AAIlF,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI;AAEJ,QAAM,QAAQ,QAAQ,MAAM;AAC1B,SAAK,sBAAsB,kBAAkB,gBAAgB,YAAY,SAAS;AAChF,aAAO,WAAW,0BAA0B;AAAA,IAC9C;AACA,WAAO;AAAA,EACT,GAAG;AAAA,IACD;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,CAAC;AAED,SAAOA,OAAM;AAAA,IACX,OAAO;AAAA,MACL;AAAA,MACA;AAAA,IACF;AAAA,IACA,CAAC,kBAAkB,KAAK;AAAA,EAC1B;AACF;",
|
|
6
6
|
"names": ["React"]
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/config/useValidateProps.ts"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { useValidateTypescriptPropTypes } from '@elliemae/ds-props-helpers';\nimport type {
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { useValidateTypescriptPropTypes } from '@elliemae/ds-props-helpers';\nimport type { ValidationMap } from '@elliemae/ds-props-helpers';\nimport { type DSIndeterminateProgressIndicatorT } from '../react-desc-prop-types.js';\nimport { DSIndeterminateProgressIndicatorName } from '../constants/index.js';\n\nexport const useValidateProps = (\n props: DSIndeterminateProgressIndicatorT.InternalProps,\n propTypes: ValidationMap<unknown>,\n): void => {\n // we validate the \"required if\" via 'isRequiredIf from our custom PropTypes\n useValidateTypescriptPropTypes(props, propTypes, DSIndeterminateProgressIndicatorName);\n};\n"],
|
|
5
5
|
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,sCAAsC;AAG/C,SAAS,4CAA4C;AAE9C,MAAM,mBAAmB,CAC9B,OACA,cACS;AAET,iCAA+B,OAAO,WAAW,oCAAoC;AACvF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,19 +1,24 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { slotObjectToDataTestIds } from "@elliemae/ds-system";
|
|
3
3
|
const DSIndeterminateProgressIndicatorName = "DSIndeterminateprogressindicator";
|
|
4
|
-
const
|
|
4
|
+
const INDETERMINATE_PROGRESS_INDICATOR_SLOTS = {
|
|
5
5
|
ROOT: "root",
|
|
6
6
|
LABEL: "label",
|
|
7
|
+
TOOLTIP_CONTAINER: "tooltip-container",
|
|
8
|
+
TOOLTIP_TEXT: "tooltip-text",
|
|
7
9
|
BAR: "bar",
|
|
10
|
+
// legacy snake_case value — shipped as "ds-indeterminateprogressindicator-bar_indicator", breaking change if renamed
|
|
8
11
|
BAR_INDICATOR: "bar_indicator"
|
|
9
12
|
};
|
|
10
|
-
const
|
|
13
|
+
const INDETERMINATE_PROGRESS_INDICATOR_DATA_TESTID = slotObjectToDataTestIds(
|
|
11
14
|
DSIndeterminateProgressIndicatorName,
|
|
12
|
-
|
|
15
|
+
INDETERMINATE_PROGRESS_INDICATOR_SLOTS
|
|
13
16
|
);
|
|
17
|
+
const DSIndeterminateProgressIndicatorSlots = INDETERMINATE_PROGRESS_INDICATOR_SLOTS;
|
|
14
18
|
export {
|
|
15
|
-
DSIndeterminateProgressIndicatorDataTestIds,
|
|
16
19
|
DSIndeterminateProgressIndicatorName,
|
|
17
|
-
DSIndeterminateProgressIndicatorSlots
|
|
20
|
+
DSIndeterminateProgressIndicatorSlots,
|
|
21
|
+
INDETERMINATE_PROGRESS_INDICATOR_DATA_TESTID,
|
|
22
|
+
INDETERMINATE_PROGRESS_INDICATOR_SLOTS
|
|
18
23
|
};
|
|
19
24
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/constants/index.ts"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { slotObjectToDataTestIds } from '@elliemae/ds-system';\n\nexport const DSIndeterminateProgressIndicatorName = 'DSIndeterminateprogressindicator';\n\nexport const
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,+BAA+B;AAEjC,MAAM,uCAAuC;
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { slotObjectToDataTestIds } from '@elliemae/ds-system';\n\nexport const DSIndeterminateProgressIndicatorName = 'DSIndeterminateprogressindicator';\n\n// we are naming this with the ${component_name}_slots convention to namespace & avoid errors on duplicate exports variables in aggregators\nexport const INDETERMINATE_PROGRESS_INDICATOR_SLOTS = {\n ROOT: 'root',\n LABEL: 'label',\n TOOLTIP_CONTAINER: 'tooltip-container',\n TOOLTIP_TEXT: 'tooltip-text',\n BAR: 'bar',\n // legacy snake_case value \u2014 shipped as \"ds-indeterminateprogressindicator-bar_indicator\", breaking change if renamed\n BAR_INDICATOR: 'bar_indicator',\n} as const;\n\n// we are naming this with the ${component_name}_data_testid convention to namespace & avoid errors on duplicate exports variables in aggregators\nexport const INDETERMINATE_PROGRESS_INDICATOR_DATA_TESTID = slotObjectToDataTestIds(\n DSIndeterminateProgressIndicatorName,\n INDETERMINATE_PROGRESS_INDICATOR_SLOTS,\n);\n\n// pre-convention public name, kept so existing imports keep working\nexport const DSIndeterminateProgressIndicatorSlots = INDETERMINATE_PROGRESS_INDICATOR_SLOTS;\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,+BAA+B;AAEjC,MAAM,uCAAuC;AAG7C,MAAM,yCAAyC;AAAA,EACpD,MAAM;AAAA,EACN,OAAO;AAAA,EACP,mBAAmB;AAAA,EACnB,cAAc;AAAA,EACd,KAAK;AAAA;AAAA,EAEL,eAAe;AACjB;AAGO,MAAM,+CAA+C;AAAA,EAC1D;AAAA,EACA;AACF;AAGO,MAAM,wCAAwC;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/esm/index.js
CHANGED
|
@@ -1,8 +1,20 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
import {
|
|
3
|
+
DSIndeterminateProgressIndicator,
|
|
4
|
+
IndeterminateProgressIndicatorWithSchema
|
|
5
|
+
} from "./DSIndeterminateProgressIndicator.js";
|
|
6
|
+
import {
|
|
5
7
|
DSIndeterminateProgressIndicatorName,
|
|
8
|
+
INDETERMINATE_PROGRESS_INDICATOR_SLOTS,
|
|
9
|
+
INDETERMINATE_PROGRESS_INDICATOR_DATA_TESTID,
|
|
6
10
|
DSIndeterminateProgressIndicatorSlots
|
|
11
|
+
} from "./constants/index.js";
|
|
12
|
+
export {
|
|
13
|
+
DSIndeterminateProgressIndicator,
|
|
14
|
+
DSIndeterminateProgressIndicatorName,
|
|
15
|
+
DSIndeterminateProgressIndicatorSlots,
|
|
16
|
+
INDETERMINATE_PROGRESS_INDICATOR_DATA_TESTID,
|
|
17
|
+
INDETERMINATE_PROGRESS_INDICATOR_SLOTS,
|
|
18
|
+
IndeterminateProgressIndicatorWithSchema
|
|
7
19
|
};
|
|
8
20
|
//# sourceMappingURL=index.js.map
|
package/dist/esm/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/index.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACAvB,
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export {\n DSIndeterminateProgressIndicator,\n IndeterminateProgressIndicatorWithSchema,\n} from './DSIndeterminateProgressIndicator.js';\nexport { type DSIndeterminateProgressIndicatorT } from './react-desc-prop-types.js';\nexport {\n DSIndeterminateProgressIndicatorName,\n INDETERMINATE_PROGRESS_INDICATOR_SLOTS,\n INDETERMINATE_PROGRESS_INDICATOR_DATA_TESTID,\n DSIndeterminateProgressIndicatorSlots,\n} from './constants/index.js';\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB;AAAA,EACE;AAAA,EACA;AAAA,OACK;AAEP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
PropTypes,
|
|
4
|
+
getPropsPerSlotPropTypes,
|
|
5
|
+
globalAttributesPropTypes,
|
|
6
|
+
xstyledPropTypes
|
|
7
|
+
} from "@elliemae/ds-props-helpers";
|
|
8
|
+
import { DSIndeterminateProgressIndicatorName, INDETERMINATE_PROGRESS_INDICATOR_SLOTS } from "./constants/index.js";
|
|
3
9
|
const defaultProps = {
|
|
4
10
|
containerProps: {},
|
|
5
11
|
title: "",
|
|
@@ -14,7 +20,14 @@ const defaultProps = {
|
|
|
14
20
|
percent: 50,
|
|
15
21
|
lineOnly: false
|
|
16
22
|
};
|
|
23
|
+
const slotPropTypes = getPropsPerSlotPropTypes(
|
|
24
|
+
DSIndeterminateProgressIndicatorName,
|
|
25
|
+
INDETERMINATE_PROGRESS_INDICATOR_SLOTS
|
|
26
|
+
);
|
|
17
27
|
const DSIndeterminateProgressIndicatorPropTypes = {
|
|
28
|
+
...slotPropTypes,
|
|
29
|
+
// already built by the spread above under its real (underscore) key — restated so TypeScript sees that key too
|
|
30
|
+
dsIndeterminateprogressindicatorBar_indicator: slotPropTypes.dsIndeterminateprogressindicatorBar_indicator,
|
|
18
31
|
...globalAttributesPropTypes,
|
|
19
32
|
...xstyledPropTypes,
|
|
20
33
|
containerProps: PropTypes.object.description("Set of Properties attached to the main container"),
|
|
@@ -27,11 +40,15 @@ const DSIndeterminateProgressIndicatorPropTypes = {
|
|
|
27
40
|
processingFail: PropTypes.bool.description("Sets the process state to processing and then failed").defaultValue(false),
|
|
28
41
|
processingFailTitle: PropTypes.string.description("label to display when the process has failed"),
|
|
29
42
|
animated: PropTypes.bool.description("animate or not").defaultValue(true),
|
|
30
|
-
percent: PropTypes.number.description(
|
|
43
|
+
percent: PropTypes.number.description(
|
|
44
|
+
'Width of the static fill shown while "processing" with "animated" set to false. Visual only: it is not exposed to assistive technology and does not represent measurable progress \u2014 use DSProgressIndicator for determinate progress.'
|
|
45
|
+
).defaultValue(50),
|
|
31
46
|
lineOnly: PropTypes.bool.description("hide the label from rendering")
|
|
32
47
|
};
|
|
48
|
+
const DSIndeterminateProgressIndicatorPropTypesSchema = DSIndeterminateProgressIndicatorPropTypes;
|
|
33
49
|
export {
|
|
34
50
|
DSIndeterminateProgressIndicatorPropTypes,
|
|
51
|
+
DSIndeterminateProgressIndicatorPropTypesSchema,
|
|
35
52
|
defaultProps
|
|
36
53
|
};
|
|
37
54
|
//# sourceMappingURL=react-desc-prop-types.js.map
|