@elliemae/ds-progress-indicator 3.80.0-next.5 → 3.80.0-next.6
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/DSProgressIndicator.js +71 -37
- package/dist/cjs/DSProgressIndicator.js.map +2 -2
- package/dist/cjs/ProgressBar.js +62 -10
- package/dist/cjs/ProgressBar.js.map +2 -2
- package/dist/cjs/ProgressCounter.js +17 -8
- package/dist/cjs/ProgressCounter.js.map +2 -2
- package/dist/cjs/config/useProgressIndicator.js +67 -0
- package/dist/cjs/config/useProgressIndicator.js.map +7 -0
- package/dist/cjs/{classedComponents.js → config/useValidateProps.js} +10 -20
- package/dist/cjs/config/useValidateProps.js.map +7 -0
- package/dist/cjs/constants/index.js +50 -0
- package/dist/cjs/constants/index.js.map +7 -0
- package/dist/cjs/index.js +13 -2
- package/dist/cjs/index.js.map +2 -2
- package/dist/cjs/react-desc-prop-types.js +50 -0
- package/dist/cjs/react-desc-prop-types.js.map +2 -2
- package/dist/cjs/styled.js +47 -2
- package/dist/cjs/styled.js.map +2 -2
- package/dist/cjs/typescript-testing/slot-props.js +40 -0
- package/dist/cjs/typescript-testing/slot-props.js.map +7 -0
- package/dist/cjs/utils.js +14 -2
- package/dist/cjs/utils.js.map +2 -2
- package/dist/esm/DSProgressIndicator.js +73 -39
- package/dist/esm/DSProgressIndicator.js.map +2 -2
- package/dist/esm/ProgressBar.js +63 -11
- package/dist/esm/ProgressBar.js.map +2 -2
- package/dist/esm/ProgressCounter.js +18 -9
- package/dist/esm/ProgressCounter.js.map +2 -2
- package/dist/esm/config/useProgressIndicator.js +37 -0
- package/dist/esm/config/useProgressIndicator.js.map +7 -0
- package/dist/esm/config/useValidateProps.js +10 -0
- package/dist/esm/config/useValidateProps.js.map +7 -0
- package/dist/esm/constants/index.js +20 -0
- package/dist/esm/constants/index.js.map +7 -0
- package/dist/esm/index.js +13 -1
- package/dist/esm/index.js.map +2 -2
- package/dist/esm/react-desc-prop-types.js +46 -0
- package/dist/esm/react-desc-prop-types.js.map +3 -3
- package/dist/esm/styled.js +47 -2
- package/dist/esm/styled.js.map +2 -2
- package/dist/esm/typescript-testing/slot-props.js +17 -0
- package/dist/esm/typescript-testing/slot-props.js.map +7 -0
- package/dist/esm/utils.js +14 -2
- package/dist/esm/utils.js.map +2 -2
- package/dist/types/DSProgressIndicator.d.ts +14 -3
- package/dist/types/ProgressBar.d.ts +13 -3
- package/dist/types/ProgressCounter.d.ts +3 -1
- package/dist/types/config/useProgressIndicator.d.ts +8 -0
- package/dist/types/config/useValidateProps.d.ts +3 -0
- package/dist/types/constants/index.d.ts +15 -0
- package/dist/types/index.d.ts +2 -1
- package/dist/types/react-desc-prop-types.d.ts +34 -3
- package/dist/types/styled.d.ts +8 -0
- package/dist/types/utils.d.ts +10 -0
- package/package.json +6 -6
- package/dist/cjs/classedComponents.js.map +0 -7
- package/dist/esm/classedComponents.js +0 -20
- package/dist/esm/classedComponents.js.map +0 -7
- package/dist/types/classedComponents.d.ts +0 -15
|
@@ -39,49 +39,83 @@ var import_react = require("react");
|
|
|
39
39
|
var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
|
|
40
40
|
var import_ProgressCounter = __toESM(require("./ProgressCounter.js"));
|
|
41
41
|
var import_ProgressBar = __toESM(require("./ProgressBar.js"));
|
|
42
|
-
var
|
|
42
|
+
var import_useProgressIndicator = require("./config/useProgressIndicator.js");
|
|
43
43
|
var import_styled = require("./styled.js");
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
counterRenderer,
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
disabled = false,
|
|
53
|
-
segments = [],
|
|
54
|
-
style = {}
|
|
55
|
-
}) => {
|
|
44
|
+
var import_utils = require("./utils.js");
|
|
45
|
+
var import_react_desc_prop_types = require("./react-desc-prop-types.js");
|
|
46
|
+
const DSProgressIndicator = (props) => {
|
|
47
|
+
const { propsWithDefault, globalProps, titleId } = (0, import_useProgressIndicator.useProgressIndicator)(props);
|
|
48
|
+
const { containerProps, innerRef, title, counterRenderer, now, min, max, disabled, segments, style } = propsWithDefault;
|
|
49
|
+
const { getOwnerProps, getOwnerPropsArguments } = (0, import_ds_props_helpers.useOwnerProps)(propsWithDefault);
|
|
50
|
+
const labelledBy = title ? titleId : void 0;
|
|
51
|
+
const valueRenderer = counterRenderer ?? import_utils.defaultCounterRenderer;
|
|
56
52
|
const renderProgressBar = (0, import_react.useMemo)(
|
|
57
|
-
() => segments.length ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
53
|
+
() => segments.length ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
54
|
+
import_ProgressBar.default,
|
|
55
|
+
{
|
|
56
|
+
valueTextRenderer: valueRenderer,
|
|
57
|
+
getOwnerProps,
|
|
58
|
+
getOwnerPropsArguments,
|
|
59
|
+
children: segments.map(
|
|
60
|
+
(segmentProps, i) => !(segmentProps.now < segmentProps.min) && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
61
|
+
import_ProgressBar.default.Segment,
|
|
62
|
+
{
|
|
63
|
+
...segmentProps,
|
|
64
|
+
labelledBy,
|
|
65
|
+
valueTextRenderer: valueRenderer,
|
|
66
|
+
getOwnerProps,
|
|
67
|
+
getOwnerPropsArguments
|
|
68
|
+
},
|
|
69
|
+
i
|
|
70
|
+
)
|
|
71
|
+
)
|
|
72
|
+
}
|
|
73
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
74
|
+
import_ProgressBar.default,
|
|
75
|
+
{
|
|
76
|
+
max,
|
|
77
|
+
min,
|
|
78
|
+
now,
|
|
79
|
+
labelledBy,
|
|
80
|
+
valueTextRenderer: valueRenderer,
|
|
81
|
+
getOwnerProps,
|
|
82
|
+
getOwnerPropsArguments
|
|
83
|
+
}
|
|
84
|
+
),
|
|
85
|
+
[segments, min, max, now, labelledBy, valueRenderer, getOwnerProps, getOwnerPropsArguments]
|
|
86
|
+
);
|
|
87
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
88
|
+
import_styled.StyledProgressIndicatorRoot,
|
|
89
|
+
{
|
|
90
|
+
...globalProps,
|
|
91
|
+
innerRef,
|
|
92
|
+
"aria-disabled": disabled,
|
|
93
|
+
...containerProps,
|
|
94
|
+
className: (0, import_styled.legacyRootClassName)(disabled, globalProps.className, containerProps?.className),
|
|
95
|
+
style,
|
|
96
|
+
getOwnerProps,
|
|
97
|
+
getOwnerPropsArguments,
|
|
98
|
+
children: [
|
|
99
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_styled.Title, { id: titleId, getOwnerProps, getOwnerPropsArguments, children: title }),
|
|
100
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
101
|
+
import_ProgressCounter.default,
|
|
102
|
+
{
|
|
103
|
+
max,
|
|
104
|
+
min,
|
|
105
|
+
now,
|
|
106
|
+
renderer: valueRenderer,
|
|
107
|
+
getOwnerProps,
|
|
108
|
+
getOwnerPropsArguments
|
|
109
|
+
}
|
|
110
|
+
),
|
|
111
|
+
renderProgressBar
|
|
112
|
+
]
|
|
113
|
+
}
|
|
61
114
|
);
|
|
62
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_classedComponents.Wrapper, { ref: innerRef, "aria-disabled": disabled, classProps: { disabled }, ...containerProps, style, children: [
|
|
63
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_styled.Title, { children: title }),
|
|
64
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ProgressCounter.default, { max, min, now, renderer: counterRenderer }),
|
|
65
|
-
renderProgressBar
|
|
66
|
-
] });
|
|
67
|
-
};
|
|
68
|
-
const variants = ["default", "success", "warning", "info", "error"];
|
|
69
|
-
const progressIndicatorProps = {
|
|
70
|
-
containerProps: import_ds_props_helpers.PropTypes.object.description("Set of Properties attached to the main container"),
|
|
71
|
-
innerRef: import_ds_props_helpers.PropTypes.object.description("ref to the components container"),
|
|
72
|
-
title: import_ds_props_helpers.PropTypes.string.description("components title"),
|
|
73
|
-
variant: import_ds_props_helpers.PropTypes.oneOf(variants).description("Progress intent variation"),
|
|
74
|
-
now: import_ds_props_helpers.PropTypes.number.description("Total current value"),
|
|
75
|
-
min: import_ds_props_helpers.PropTypes.number.description("min value"),
|
|
76
|
-
max: import_ds_props_helpers.PropTypes.number.description("max value"),
|
|
77
|
-
disabled: import_ds_props_helpers.PropTypes.bool.description("Whether the progress indicator disabled or not").defaultValue(false),
|
|
78
|
-
counterRenderer: import_ds_props_helpers.PropTypes.func.description("Render a custom counter"),
|
|
79
|
-
segments: import_ds_props_helpers.PropTypes.array.description("An array of multiple progress objects"),
|
|
80
|
-
style: import_ds_props_helpers.PropTypes.object.description("css inline style")
|
|
81
115
|
};
|
|
82
116
|
DSProgressIndicator.displayName = "DSProgressIndicator";
|
|
83
117
|
const ProgressIndicatorWithSchema = (0, import_ds_props_helpers.describe)(DSProgressIndicator);
|
|
84
|
-
ProgressIndicatorWithSchema.propTypes =
|
|
118
|
+
ProgressIndicatorWithSchema.propTypes = import_react_desc_prop_types.DSProgressIndicatorPropTypesSchema;
|
|
85
119
|
DSProgressIndicator.ProgressBar = import_ProgressBar.default;
|
|
86
120
|
var DSProgressIndicator_default = DSProgressIndicator;
|
|
87
121
|
//# sourceMappingURL=DSProgressIndicator.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/DSProgressIndicator.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["/* eslint-disable react/no-array-index-key */\nimport React, { useMemo
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;
|
|
4
|
+
"sourcesContent": ["/* eslint-disable react/no-array-index-key */\nimport React, { useMemo } from 'react';\nimport { describe, useOwnerProps } from '@elliemae/ds-props-helpers';\nimport Counter from './ProgressCounter.js';\nimport ProgressBar from './ProgressBar.js';\nimport { useProgressIndicator } from './config/useProgressIndicator.js';\nimport { legacyRootClassName, StyledProgressIndicatorRoot, Title } from './styled.js';\nimport { defaultCounterRenderer } from './utils.js';\nimport { type DSProgressIndicatorT, DSProgressIndicatorPropTypesSchema } from './react-desc-prop-types.js';\n\nconst DSProgressIndicator = (props: DSProgressIndicatorT.Props) => {\n const { propsWithDefault, globalProps, titleId } = useProgressIndicator(props);\n const { containerProps, innerRef, title, counterRenderer, now, min, max, disabled, segments, style } =\n propsWithDefault;\n\n const { getOwnerProps, getOwnerPropsArguments } = useOwnerProps<DSProgressIndicatorT.Props>(propsWithDefault);\n\n // A titleless progress indicator has nothing to be labelled by, so the fallback aria-label is kept instead.\n const labelledBy = title ? titleId : undefined;\n // Resolved once so the visible counter and every progressbar's aria-valuetext share the exact same text.\n const valueRenderer = counterRenderer ?? defaultCounterRenderer;\n\n const renderProgressBar = useMemo(\n () =>\n segments.length ? (\n <ProgressBar\n valueTextRenderer={valueRenderer}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n {segments.map(\n (segmentProps, i) =>\n !(segmentProps.now < segmentProps.min) && (\n <ProgressBar.Segment\n key={i}\n {...segmentProps}\n labelledBy={labelledBy}\n valueTextRenderer={valueRenderer}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n />\n ),\n )}\n </ProgressBar>\n ) : (\n <ProgressBar\n max={max}\n min={min}\n now={now}\n labelledBy={labelledBy}\n valueTextRenderer={valueRenderer}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n />\n ),\n [segments, min, max, now, labelledBy, valueRenderer, getOwnerProps, getOwnerPropsArguments],\n );\n\n return (\n <StyledProgressIndicatorRoot\n {...globalProps}\n // the public innerRef contract is MutableRefObject<unknown>; the styled root is a div. Casting here\n // keeps the published prop type unchanged rather than narrowing it on consumers.\n innerRef={innerRef as React.RefObject<HTMLDivElement>}\n aria-disabled={disabled}\n {...containerProps}\n // after the spreads on purpose: aggregatedClasses used to append a consumer className to the legacy\n // contract rather than let it replace them, and that ordering is part of the compatibility surface\n className={legacyRootClassName(disabled, globalProps.className, containerProps?.className)}\n style={style}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n <Title id={titleId} getOwnerProps={getOwnerProps} getOwnerPropsArguments={getOwnerPropsArguments}>\n {title}\n </Title>\n <Counter\n max={max}\n min={min}\n now={now}\n renderer={valueRenderer}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n />\n {renderProgressBar}\n </StyledProgressIndicatorRoot>\n );\n};\n\nDSProgressIndicator.displayName = 'DSProgressIndicator';\nconst ProgressIndicatorWithSchema = describe(DSProgressIndicator);\nProgressIndicatorWithSchema.propTypes = DSProgressIndicatorPropTypesSchema;\n\nDSProgressIndicator.ProgressBar = ProgressBar;\n\nexport { DSProgressIndicator, ProgressIndicatorWithSchema };\nexport default DSProgressIndicator;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADiCP;AAhChB,mBAA+B;AAC/B,8BAAwC;AACxC,6BAAoB;AACpB,yBAAwB;AACxB,kCAAqC;AACrC,oBAAwE;AACxE,mBAAuC;AACvC,mCAA8E;AAE9E,MAAM,sBAAsB,CAAC,UAAsC;AACjE,QAAM,EAAE,kBAAkB,aAAa,QAAQ,QAAI,kDAAqB,KAAK;AAC7E,QAAM,EAAE,gBAAgB,UAAU,OAAO,iBAAiB,KAAK,KAAK,KAAK,UAAU,UAAU,MAAM,IACjG;AAEF,QAAM,EAAE,eAAe,uBAAuB,QAAI,uCAA0C,gBAAgB;AAG5G,QAAM,aAAa,QAAQ,UAAU;AAErC,QAAM,gBAAgB,mBAAmB;AAEzC,QAAM,wBAAoB;AAAA,IACxB,MACE,SAAS,SACP;AAAA,MAAC,mBAAAA;AAAA,MAAA;AAAA,QACC,mBAAmB;AAAA,QACnB;AAAA,QACA;AAAA,QAEC,mBAAS;AAAA,UACR,CAAC,cAAc,MACb,EAAE,aAAa,MAAM,aAAa,QAChC;AAAA,YAAC,mBAAAA,QAAY;AAAA,YAAZ;AAAA,cAEE,GAAG;AAAA,cACJ;AAAA,cACA,mBAAmB;AAAA,cACnB;AAAA,cACA;AAAA;AAAA,YALK;AAAA,UAMP;AAAA,QAEN;AAAA;AAAA,IACF,IAEA;AAAA,MAAC,mBAAAA;AAAA,MAAA;AAAA,QACC;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA,mBAAmB;AAAA,QACnB;AAAA,QACA;AAAA;AAAA,IACF;AAAA,IAEJ,CAAC,UAAU,KAAK,KAAK,KAAK,YAAY,eAAe,eAAe,sBAAsB;AAAA,EAC5F;AAEA,SACE;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MAGJ;AAAA,MACA,iBAAe;AAAA,MACd,GAAG;AAAA,MAGJ,eAAW,mCAAoB,UAAU,YAAY,WAAW,gBAAgB,SAAS;AAAA,MACzF;AAAA,MACA;AAAA,MACA;AAAA,MAEA;AAAA,oDAAC,uBAAM,IAAI,SAAS,eAA8B,wBAC/C,iBACH;AAAA,QACA;AAAA,UAAC,uBAAAC;AAAA,UAAA;AAAA,YACC;AAAA,YACA;AAAA,YACA;AAAA,YACA,UAAU;AAAA,YACV;AAAA,YACA;AAAA;AAAA,QACF;AAAA,QACC;AAAA;AAAA;AAAA,EACH;AAEJ;AAEA,oBAAoB,cAAc;AAClC,MAAM,kCAA8B,kCAAS,mBAAmB;AAChE,4BAA4B,YAAY;AAExC,oBAAoB,cAAc,mBAAAD;AAGlC,IAAO,8BAAQ;",
|
|
6
6
|
"names": ["ProgressBar", "Counter"]
|
|
7
7
|
}
|
package/dist/cjs/ProgressBar.js
CHANGED
|
@@ -33,33 +33,85 @@ __export(ProgressBar_exports, {
|
|
|
33
33
|
module.exports = __toCommonJS(ProgressBar_exports);
|
|
34
34
|
var React = __toESM(require("react"));
|
|
35
35
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
36
|
-
var
|
|
36
|
+
var import_styled = require("./styled.js");
|
|
37
37
|
var import_utils = require("./utils.js");
|
|
38
|
-
function useProgressTrait({
|
|
38
|
+
function useProgressTrait({
|
|
39
|
+
now = 0,
|
|
40
|
+
min = 0,
|
|
41
|
+
max = 0,
|
|
42
|
+
labelledBy,
|
|
43
|
+
label,
|
|
44
|
+
valueTextRenderer
|
|
45
|
+
}) {
|
|
46
|
+
const rangeIsValid = (0, import_utils.hasValidRange)(min, max);
|
|
39
47
|
const percentage = (0, import_utils.getPercentage)(now, min, max);
|
|
48
|
+
const valueText = valueTextRenderer?.({ now, min, max });
|
|
49
|
+
const hasTextualValue = typeof valueText === "string" || typeof valueText === "number";
|
|
40
50
|
return {
|
|
41
51
|
role: "progressbar",
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
"aria-
|
|
52
|
+
// An invalid range — `max` omitted, or 0 while data loads — is an indeterminate progress, and WAI-ARIA says an
|
|
53
|
+
// indeterminate progressbar omits aria-valuenow. AT then announces "busy" instead of the invalid "0 of 0"
|
|
54
|
+
// range this used to emit. When the range is valid, aria-valuenow is clamped so it never leaves [min, max].
|
|
55
|
+
...rangeIsValid ? { "aria-valuenow": (0, import_utils.clamp)(now, min, max), "aria-valuemin": min, "aria-valuemax": max } : {},
|
|
56
|
+
// Mirrors the visible counter so screen readers hear the same formatted value sighted users see, not just
|
|
57
|
+
// the raw number. Uses the same renderer as the counter, applied to this bar's own values — for a segment
|
|
58
|
+
// that is the segment's range, which is what its aria-valuenow describes.
|
|
59
|
+
...rangeIsValid && hasTextualValue ? { "aria-valuetext": String(valueText) } : {},
|
|
60
|
+
// Precedence: a per-segment label wins, because it is the only thing that tells two segments apart
|
|
61
|
+
// once they share the indicator title. Then the visible title. `aria-label` is the last-resort fallback
|
|
62
|
+
// for a titleless indicator, which would otherwise have no accessible name at all.
|
|
63
|
+
...label ? { "aria-label": label } : {},
|
|
64
|
+
...!label && labelledBy ? { "aria-labelledby": labelledBy } : {},
|
|
65
|
+
...!label && !labelledBy ? { "aria-label": "progress bar" } : {},
|
|
46
66
|
style: {
|
|
47
67
|
width: `${percentage}%`
|
|
48
68
|
}
|
|
49
69
|
};
|
|
50
70
|
}
|
|
51
71
|
const Progress = (props) => {
|
|
52
|
-
const { variant = "default" } = props;
|
|
72
|
+
const { variant = "default", getOwnerProps, getOwnerPropsArguments } = props;
|
|
53
73
|
const progressTraitProps = useProgressTrait(props);
|
|
54
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
74
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
75
|
+
import_styled.StyledProgress,
|
|
76
|
+
{
|
|
77
|
+
className: (0, import_styled.legacyProgressClassName)(variant),
|
|
78
|
+
getOwnerProps,
|
|
79
|
+
getOwnerPropsArguments,
|
|
80
|
+
...progressTraitProps
|
|
81
|
+
}
|
|
82
|
+
);
|
|
55
83
|
};
|
|
56
84
|
const ProgressBar = ({
|
|
57
85
|
variant = "default",
|
|
58
86
|
now = void 0,
|
|
59
87
|
min = void 0,
|
|
60
88
|
max = void 0,
|
|
61
|
-
|
|
62
|
-
|
|
89
|
+
labelledBy = void 0,
|
|
90
|
+
valueTextRenderer = void 0,
|
|
91
|
+
children: progressSegments,
|
|
92
|
+
getOwnerProps,
|
|
93
|
+
getOwnerPropsArguments
|
|
94
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
95
|
+
import_styled.StyledProgressBar,
|
|
96
|
+
{
|
|
97
|
+
className: (0, import_styled.legacyBarClassName)(),
|
|
98
|
+
getOwnerProps,
|
|
99
|
+
getOwnerPropsArguments,
|
|
100
|
+
children: progressSegments || /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
101
|
+
Progress,
|
|
102
|
+
{
|
|
103
|
+
max,
|
|
104
|
+
min,
|
|
105
|
+
now,
|
|
106
|
+
variant,
|
|
107
|
+
labelledBy,
|
|
108
|
+
valueTextRenderer,
|
|
109
|
+
getOwnerProps,
|
|
110
|
+
getOwnerPropsArguments
|
|
111
|
+
}
|
|
112
|
+
)
|
|
113
|
+
}
|
|
114
|
+
);
|
|
63
115
|
ProgressBar.Segment = Progress;
|
|
64
116
|
var ProgressBar_default = ProgressBar;
|
|
65
117
|
//# sourceMappingURL=ProgressBar.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/ProgressBar.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import React from 'react';\nimport {
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;
|
|
4
|
+
"sourcesContent": ["import React from 'react';\nimport { legacyBarClassName, legacyProgressClassName, StyledProgress, StyledProgressBar } from './styled.js';\nimport { clamp, getPercentage, hasValidRange } from './utils.js';\nimport type { DSProgressIndicatorT } from './react-desc-prop-types.js';\n\ntype OwnerPropsPassthrough = {\n getOwnerProps?: () => object;\n getOwnerPropsArguments?: () => object;\n};\n\nfunction useProgressTrait({\n now = 0,\n min = 0,\n max = 0,\n labelledBy,\n label,\n valueTextRenderer,\n}: {\n now?: number;\n min?: number;\n max?: number;\n labelledBy?: string;\n label?: string;\n valueTextRenderer?: DSProgressIndicatorT.DefaultRendererT;\n}) {\n const rangeIsValid = hasValidRange(min, max);\n const percentage = getPercentage(now, min, max);\n // Only text is a valid aria-valuetext. The renderer type says string, but a JS consumer can return JSX for\n // a styled counter \u2014 React would then set the attribute to \"[object Object]\", which is worse than omitting\n // it and letting AT fall back to the numeric range, exactly as it did before aria-valuetext existed.\n const valueText = valueTextRenderer?.({ now, min, max }) as unknown;\n const hasTextualValue = typeof valueText === 'string' || typeof valueText === 'number';\n return {\n role: 'progressbar',\n // An invalid range \u2014 `max` omitted, or 0 while data loads \u2014 is an indeterminate progress, and WAI-ARIA says an\n // indeterminate progressbar omits aria-valuenow. AT then announces \"busy\" instead of the invalid \"0 of 0\"\n // range this used to emit. When the range is valid, aria-valuenow is clamped so it never leaves [min, max].\n ...(rangeIsValid ? { 'aria-valuenow': clamp(now, min, max), 'aria-valuemin': min, 'aria-valuemax': max } : {}),\n // Mirrors the visible counter so screen readers hear the same formatted value sighted users see, not just\n // the raw number. Uses the same renderer as the counter, applied to this bar's own values \u2014 for a segment\n // that is the segment's range, which is what its aria-valuenow describes.\n ...(rangeIsValid && hasTextualValue ? { 'aria-valuetext': String(valueText) } : {}),\n // Precedence: a per-segment label wins, because it is the only thing that tells two segments apart\n // once they share the indicator title. Then the visible title. `aria-label` is the last-resort fallback\n // for a titleless indicator, which would otherwise have no accessible name at all.\n ...(label ? { 'aria-label': label } : {}),\n ...(!label && labelledBy ? { 'aria-labelledby': labelledBy } : {}),\n ...(!label && !labelledBy ? { 'aria-label': 'progress bar' } : {}),\n style: {\n width: `${percentage}%`,\n },\n };\n}\n\nconst Progress = (\n props: {\n variant: string;\n now?: number;\n min?: number;\n max?: number;\n labelledBy?: string;\n label?: string;\n valueTextRenderer?: DSProgressIndicatorT.DefaultRendererT;\n } & OwnerPropsPassthrough,\n) => {\n const { variant = 'default', getOwnerProps, getOwnerPropsArguments } = props;\n\n const progressTraitProps = useProgressTrait(props);\n\n return (\n <StyledProgress\n className={legacyProgressClassName(variant)}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n {...progressTraitProps}\n />\n );\n};\n\nconst ProgressBar = ({\n variant = 'default',\n now = undefined,\n min = undefined,\n max = undefined,\n labelledBy = undefined,\n valueTextRenderer = undefined,\n children: progressSegments,\n getOwnerProps,\n getOwnerPropsArguments,\n}: {\n variant?: string;\n now?: number;\n min?: number;\n max?: number;\n labelledBy?: string;\n children?: React.ReactNode;\n valueTextRenderer?: DSProgressIndicatorT.DefaultRendererT;\n} & OwnerPropsPassthrough) => (\n <StyledProgressBar\n className={legacyBarClassName()}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n {progressSegments || (\n <Progress\n max={max}\n min={min}\n now={now}\n variant={variant}\n labelledBy={labelledBy}\n valueTextRenderer={valueTextRenderer}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n />\n )}\n </StyledProgressBar>\n);\n\nProgressBar.Segment = Progress;\n\nexport default ProgressBar;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADsEnB;AArEJ,oBAA+F;AAC/F,mBAAoD;AAQpD,SAAS,iBAAiB;AAAA,EACxB,MAAM;AAAA,EACN,MAAM;AAAA,EACN,MAAM;AAAA,EACN;AAAA,EACA;AAAA,EACA;AACF,GAOG;AACD,QAAM,mBAAe,4BAAc,KAAK,GAAG;AAC3C,QAAM,iBAAa,4BAAc,KAAK,KAAK,GAAG;AAI9C,QAAM,YAAY,oBAAoB,EAAE,KAAK,KAAK,IAAI,CAAC;AACvD,QAAM,kBAAkB,OAAO,cAAc,YAAY,OAAO,cAAc;AAC9E,SAAO;AAAA,IACL,MAAM;AAAA;AAAA;AAAA;AAAA,IAIN,GAAI,eAAe,EAAE,qBAAiB,oBAAM,KAAK,KAAK,GAAG,GAAG,iBAAiB,KAAK,iBAAiB,IAAI,IAAI,CAAC;AAAA;AAAA;AAAA;AAAA,IAI5G,GAAI,gBAAgB,kBAAkB,EAAE,kBAAkB,OAAO,SAAS,EAAE,IAAI,CAAC;AAAA;AAAA;AAAA;AAAA,IAIjF,GAAI,QAAQ,EAAE,cAAc,MAAM,IAAI,CAAC;AAAA,IACvC,GAAI,CAAC,SAAS,aAAa,EAAE,mBAAmB,WAAW,IAAI,CAAC;AAAA,IAChE,GAAI,CAAC,SAAS,CAAC,aAAa,EAAE,cAAc,eAAe,IAAI,CAAC;AAAA,IAChE,OAAO;AAAA,MACL,OAAO,GAAG,UAAU;AAAA,IACtB;AAAA,EACF;AACF;AAEA,MAAM,WAAW,CACf,UASG;AACH,QAAM,EAAE,UAAU,WAAW,eAAe,uBAAuB,IAAI;AAEvE,QAAM,qBAAqB,iBAAiB,KAAK;AAEjD,SACE;AAAA,IAAC;AAAA;AAAA,MACC,eAAW,uCAAwB,OAAO;AAAA,MAC1C;AAAA,MACA;AAAA,MACC,GAAG;AAAA;AAAA,EACN;AAEJ;AAEA,MAAM,cAAc,CAAC;AAAA,EACnB,UAAU;AAAA,EACV,MAAM;AAAA,EACN,MAAM;AAAA,EACN,MAAM;AAAA,EACN,aAAa;AAAA,EACb,oBAAoB;AAAA,EACpB,UAAU;AAAA,EACV;AAAA,EACA;AACF,MASE;AAAA,EAAC;AAAA;AAAA,IACC,eAAW,kCAAmB;AAAA,IAC9B;AAAA,IACA;AAAA,IAEC,8BACC;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA;AAAA,IACF;AAAA;AAEJ;AAGF,YAAY,UAAU;AAEtB,IAAO,sBAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -34,21 +34,30 @@ module.exports = __toCommonJS(ProgressCounter_exports);
|
|
|
34
34
|
var React = __toESM(require("react"));
|
|
35
35
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
36
36
|
var import_utils = require("./utils.js");
|
|
37
|
-
var
|
|
38
|
-
const defaultRenderer = ({ now, max, min }) => `${min || now} of ${max}`;
|
|
37
|
+
var import_styled = require("./styled.js");
|
|
39
38
|
const percentageRenderer = ({ now, max, min }) => {
|
|
40
39
|
const percentage = (0, import_utils.getPercentage)(now, min, max);
|
|
41
40
|
return `${percentage}%`;
|
|
42
41
|
};
|
|
43
42
|
const renderers = {
|
|
44
|
-
default:
|
|
43
|
+
default: import_utils.defaultCounterRenderer,
|
|
45
44
|
percentage: percentageRenderer
|
|
46
45
|
};
|
|
47
46
|
const ProgressCounter = ({
|
|
48
|
-
now,
|
|
49
|
-
max,
|
|
50
|
-
min,
|
|
51
|
-
renderer = renderers.default
|
|
52
|
-
|
|
47
|
+
now = 0,
|
|
48
|
+
max = 0,
|
|
49
|
+
min = 0,
|
|
50
|
+
renderer = renderers.default,
|
|
51
|
+
getOwnerProps,
|
|
52
|
+
getOwnerPropsArguments
|
|
53
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
54
|
+
import_styled.StyledProgressIndicatorCounter,
|
|
55
|
+
{
|
|
56
|
+
className: (0, import_styled.legacyCounterClassName)(),
|
|
57
|
+
getOwnerProps,
|
|
58
|
+
getOwnerPropsArguments,
|
|
59
|
+
children: renderer({ now, max, min })
|
|
60
|
+
}
|
|
61
|
+
);
|
|
53
62
|
var ProgressCounter_default = ProgressCounter;
|
|
54
63
|
//# sourceMappingURL=ProgressCounter.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/ProgressCounter.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import React from 'react';\nimport { getPercentage } from './utils.js';\nimport {
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;
|
|
4
|
+
"sourcesContent": ["import React from 'react';\nimport { defaultCounterRenderer, getPercentage } from './utils.js';\nimport { legacyCounterClassName, StyledProgressIndicatorCounter } from './styled.js';\nimport type { DSProgressIndicatorT } from './react-desc-prop-types.js';\n\nconst percentageRenderer = ({ now, max, min }: DSProgressIndicatorT.PercentageT) => {\n const percentage = getPercentage(now, min, max);\n return `${percentage}%`;\n};\n\nconst renderers = {\n default: defaultCounterRenderer,\n percentage: percentageRenderer,\n};\n\nconst ProgressCounter = ({\n now = 0,\n max = 0,\n min = 0,\n renderer = renderers.default,\n getOwnerProps,\n getOwnerPropsArguments,\n}: Partial<DSProgressIndicatorT.PercentageT> & {\n renderer?: DSProgressIndicatorT.DefaultRendererT;\n getOwnerProps?: () => object;\n getOwnerPropsArguments?: () => object;\n}) => (\n <StyledProgressIndicatorCounter\n className={legacyCounterClassName()}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n {renderer({ now, max, min })}\n </StyledProgressIndicatorCounter>\n);\n\nexport default ProgressCounter;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;AD2BrB;AA1BF,mBAAsD;AACtD,oBAAuE;AAGvE,MAAM,qBAAqB,CAAC,EAAE,KAAK,KAAK,IAAI,MAAwC;AAClF,QAAM,iBAAa,4BAAc,KAAK,KAAK,GAAG;AAC9C,SAAO,GAAG,UAAU;AACtB;AAEA,MAAM,YAAY;AAAA,EAChB,SAAS;AAAA,EACT,YAAY;AACd;AAEA,MAAM,kBAAkB,CAAC;AAAA,EACvB,MAAM;AAAA,EACN,MAAM;AAAA,EACN,MAAM;AAAA,EACN,WAAW,UAAU;AAAA,EACrB;AAAA,EACA;AACF,MAKE;AAAA,EAAC;AAAA;AAAA,IACC,eAAW,sCAAuB;AAAA,IAClC;AAAA,IACA;AAAA,IAEC,mBAAS,EAAE,KAAK,KAAK,IAAI,CAAC;AAAA;AAC7B;AAGF,IAAO,0BAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -0,0 +1,67 @@
|
|
|
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 __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var useProgressIndicator_exports = {};
|
|
30
|
+
__export(useProgressIndicator_exports, {
|
|
31
|
+
useProgressIndicator: () => useProgressIndicator
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(useProgressIndicator_exports);
|
|
34
|
+
var React = __toESM(require("react"));
|
|
35
|
+
var import_react = __toESM(require("react"));
|
|
36
|
+
var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
|
|
37
|
+
var import_react_desc_prop_types = require("../react-desc-prop-types.js");
|
|
38
|
+
var import_useValidateProps = require("./useValidateProps.js");
|
|
39
|
+
var import_utils = require("../utils.js");
|
|
40
|
+
var import_constants = require("../constants/index.js");
|
|
41
|
+
const useProgressIndicator = (propsFromUser) => {
|
|
42
|
+
const propsWithDefault = (0, import_ds_props_helpers.useMemoMergePropsWithDefault)(
|
|
43
|
+
propsFromUser,
|
|
44
|
+
import_react_desc_prop_types.defaultProps
|
|
45
|
+
);
|
|
46
|
+
(0, import_useValidateProps.useValidateProps)(propsWithDefault, import_react_desc_prop_types.DSProgressIndicatorPropTypes);
|
|
47
|
+
const { title, style, min, max, disabled, ...globalPropsWithoutConsumedKeywords } = propsWithDefault;
|
|
48
|
+
const globalProps = (0, import_ds_props_helpers.useGetGlobalAttributes)(globalPropsWithoutConsumedKeywords);
|
|
49
|
+
const reactId = import_react.default.useId();
|
|
50
|
+
const titleId = `ds-progress-indicator-title-${reactId}`;
|
|
51
|
+
import_react.default.useEffect(() => {
|
|
52
|
+
if (!(0, import_utils.hasValidRange)(min, max)) {
|
|
53
|
+
console.warn(
|
|
54
|
+
`Warning: ${import_constants.DSProgressIndicatorName}:: "max" must be a finite number greater than "min" (received min=${String(min)}, max=${String(max)}). A determinate progress cannot be computed, so the progressbar is rendered as indeterminate.`
|
|
55
|
+
);
|
|
56
|
+
}
|
|
57
|
+
}, [min, max]);
|
|
58
|
+
return import_react.default.useMemo(
|
|
59
|
+
() => ({
|
|
60
|
+
propsWithDefault,
|
|
61
|
+
globalProps,
|
|
62
|
+
titleId
|
|
63
|
+
}),
|
|
64
|
+
[propsWithDefault, globalProps, titleId]
|
|
65
|
+
);
|
|
66
|
+
};
|
|
67
|
+
//# sourceMappingURL=useProgressIndicator.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/config/useProgressIndicator.ts", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["import React from 'react';\nimport { useGetGlobalAttributes, useMemoMergePropsWithDefault } from '@elliemae/ds-props-helpers';\nimport type { ValidationMap } from '@elliemae/ds-props-helpers';\nimport { type DSProgressIndicatorT, DSProgressIndicatorPropTypes, defaultProps } from '../react-desc-prop-types.js';\nimport { useValidateProps } from './useValidateProps.js';\nimport { hasValidRange } from '../utils.js';\nimport { DSProgressIndicatorName } from '../constants/index.js';\n\nexport interface ProgressIndicatorCTX {\n propsWithDefault: DSProgressIndicatorT.InternalProps;\n globalProps: ReturnType<typeof useGetGlobalAttributes>;\n titleId: string;\n}\n\nexport const useProgressIndicator = (propsFromUser: DSProgressIndicatorT.Props): ProgressIndicatorCTX => {\n // =============================================================================\n // MERGE WITH DEFAULT AND VALIDATE PROPS\n // =============================================================================\n const propsWithDefault = useMemoMergePropsWithDefault<DSProgressIndicatorT.InternalProps>(\n propsFromUser,\n defaultProps as unknown as Partial<DSProgressIndicatorT.InternalProps>,\n );\n useValidateProps(propsWithDefault, DSProgressIndicatorPropTypes as unknown as ValidationMap<unknown>);\n // =============================================================================\n // GLOBAL ATTRIBUTES\n // =============================================================================\n // These five props are consumed by this component but are also HTML global attributes, so spreading them\n // onto the root would emit attributes the component has never rendered: `title` would add a native browser\n // tooltip, `min`/`max`/`disabled` are not even valid on a div, and `style` is forwarded explicitly further\n // down. Everything else still flows through so consumers can reach the root with id/className/data-*/aria-*.\n const { title, style, min, max, disabled, ...globalPropsWithoutConsumedKeywords } = propsWithDefault;\n const globalProps = useGetGlobalAttributes(globalPropsWithoutConsumedKeywords);\n // =============================================================================\n // AD HOC PER COMPONENT LOGIC\n // =============================================================================\n // The progressbar takes its accessible name from the visible title via aria-labelledby, which needs a\n // stable unique id per instance. See the Accessibility Expert Validation doc for this component.\n const reactId = React.useId();\n const titleId = `ds-progress-indicator-title-${reactId}`;\n\n // `max` is functionally required for a determinate progress but stays optional in the public contract \u2014 making\n // it required would break every consumer that omits it today, at compile time for TS users and at render time\n // for JS users (PropTypes `isRequired` throws). So an invalid range renders safely as an indeterminate\n // progressbar, and this is the signal the consumer gets instead: a dev-only warning, once per range. It is\n // step 1 of the breaking-change protocol should `max` ever become required. PUI-18672.\n React.useEffect(() => {\n if (process.env.NODE_ENV !== 'production' && !hasValidRange(min, max)) {\n // eslint-disable-next-line no-console\n console.warn(\n `Warning: ${DSProgressIndicatorName}:: \"max\" must be a finite number greater than \"min\" (received min=${String(min)}, max=${String(max)}). A determinate progress cannot be computed, so the progressbar is rendered as indeterminate.`,\n );\n }\n }, [min, max]);\n\n return React.useMemo(\n () => ({\n propsWithDefault,\n globalProps,\n titleId,\n }),\n [propsWithDefault, globalProps, titleId],\n );\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAkB;AAClB,8BAAqE;AAErE,mCAAsF;AACtF,8BAAiC;AACjC,mBAA8B;AAC9B,uBAAwC;AAQjC,MAAM,uBAAuB,CAAC,kBAAoE;AAIvG,QAAM,uBAAmB;AAAA,IACvB;AAAA,IACA;AAAA,EACF;AACA,gDAAiB,kBAAkB,yDAAiE;AAQpG,QAAM,EAAE,OAAO,OAAO,KAAK,KAAK,UAAU,GAAG,mCAAmC,IAAI;AACpF,QAAM,kBAAc,gDAAuB,kCAAkC;AAM7E,QAAM,UAAU,aAAAA,QAAM,MAAM;AAC5B,QAAM,UAAU,+BAA+B,OAAO;AAOtD,eAAAA,QAAM,UAAU,MAAM;AACpB,QAA6C,KAAC,4BAAc,KAAK,GAAG,GAAG;AAErE,cAAQ;AAAA,QACN,YAAY,wCAAuB,qEAAqE,OAAO,GAAG,CAAC,SAAS,OAAO,GAAG,CAAC;AAAA,MACzI;AAAA,IACF;AAAA,EACF,GAAG,CAAC,KAAK,GAAG,CAAC;AAEb,SAAO,aAAAA,QAAM;AAAA,IACX,OAAO;AAAA,MACL;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,IACA,CAAC,kBAAkB,aAAa,OAAO;AAAA,EACzC;AACF;",
|
|
6
|
+
"names": ["React"]
|
|
7
|
+
}
|
|
@@ -26,25 +26,15 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
26
26
|
mod
|
|
27
27
|
));
|
|
28
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var
|
|
30
|
-
__export(
|
|
31
|
-
|
|
32
|
-
ProgressBarStatusBar: () => ProgressBarStatusBar,
|
|
33
|
-
ProgressIndicatorCounter: () => ProgressIndicatorCounter,
|
|
34
|
-
Wrapper: () => Wrapper,
|
|
35
|
-
blockName: () => blockName
|
|
29
|
+
var useValidateProps_exports = {};
|
|
30
|
+
__export(useValidateProps_exports, {
|
|
31
|
+
useValidateProps: () => useValidateProps
|
|
36
32
|
});
|
|
37
|
-
module.exports = __toCommonJS(
|
|
33
|
+
module.exports = __toCommonJS(useValidateProps_exports);
|
|
38
34
|
var React = __toESM(require("react"));
|
|
39
|
-
var
|
|
40
|
-
|
|
41
|
-
const
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
const ProgressIndicatorCounter = (0, import_ds_classnames.aggregatedClasses)("span")(blockName, "counter");
|
|
46
|
-
const ProgressBarStatusBar = (0, import_ds_classnames.aggregatedClasses)("div")(progressBlockName);
|
|
47
|
-
const ProgressBarProgress = (0, import_ds_classnames.aggregatedClasses)("div")(progressBlockName, "progress", ({ variant }) => ({
|
|
48
|
-
[variant]: true
|
|
49
|
-
}));
|
|
50
|
-
//# sourceMappingURL=classedComponents.js.map
|
|
35
|
+
var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
|
|
36
|
+
var import_constants = require("../constants/index.js");
|
|
37
|
+
const useValidateProps = (props, propTypes) => {
|
|
38
|
+
(0, import_ds_props_helpers.useValidateTypescriptPropTypes)(props, propTypes, import_constants.DSProgressIndicatorName);
|
|
39
|
+
};
|
|
40
|
+
//# sourceMappingURL=useValidateProps.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/config/useValidateProps.ts", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["import { useValidateTypescriptPropTypes } from '@elliemae/ds-props-helpers';\nimport type { ValidationMap } from '@elliemae/ds-props-helpers';\nimport { type DSProgressIndicatorT } from '../react-desc-prop-types.js';\nimport { DSProgressIndicatorName } from '../constants/index.js';\n\nexport const useValidateProps = (\n props: DSProgressIndicatorT.InternalProps,\n propTypes: ValidationMap<unknown>,\n): void => {\n useValidateTypescriptPropTypes(props, propTypes, DSProgressIndicatorName);\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,8BAA+C;AAG/C,uBAAwC;AAEjC,MAAM,mBAAmB,CAC9B,OACA,cACS;AACT,8DAA+B,OAAO,WAAW,wCAAuB;AAC1E;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
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 __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var constants_exports = {};
|
|
30
|
+
__export(constants_exports, {
|
|
31
|
+
DSProgressIndicatorName: () => DSProgressIndicatorName,
|
|
32
|
+
PROGRESS_INDICATOR_DATA_TESTID: () => PROGRESS_INDICATOR_DATA_TESTID,
|
|
33
|
+
PROGRESS_INDICATOR_SLOTS: () => PROGRESS_INDICATOR_SLOTS
|
|
34
|
+
});
|
|
35
|
+
module.exports = __toCommonJS(constants_exports);
|
|
36
|
+
var React = __toESM(require("react"));
|
|
37
|
+
var import_ds_system = require("@elliemae/ds-system");
|
|
38
|
+
const DSProgressIndicatorName = "DSProgressindicator";
|
|
39
|
+
const PROGRESS_INDICATOR_SLOTS = {
|
|
40
|
+
ROOT: "root",
|
|
41
|
+
TITLE: "title",
|
|
42
|
+
COUNTER: "counter",
|
|
43
|
+
PROGRESS_BAR: "progress-bar",
|
|
44
|
+
PROGRESS: "progress"
|
|
45
|
+
};
|
|
46
|
+
const PROGRESS_INDICATOR_DATA_TESTID = (0, import_ds_system.slotObjectToDataTestIds)(
|
|
47
|
+
DSProgressIndicatorName,
|
|
48
|
+
PROGRESS_INDICATOR_SLOTS
|
|
49
|
+
);
|
|
50
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/constants/index.ts", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["import { slotObjectToDataTestIds } from '@elliemae/ds-system';\n\nexport const DSProgressIndicatorName = 'DSProgressindicator';\n\n// we are naming this with the ${component_name}_slots convention to namespace & avoid errors on duplicate exports variables in aggregators\nexport const PROGRESS_INDICATOR_SLOTS = {\n ROOT: 'root',\n TITLE: 'title',\n COUNTER: 'counter',\n PROGRESS_BAR: 'progress-bar',\n PROGRESS: 'progress',\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 PROGRESS_INDICATOR_DATA_TESTID = slotObjectToDataTestIds(\n DSProgressIndicatorName,\n PROGRESS_INDICATOR_SLOTS,\n);\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,uBAAwC;AAEjC,MAAM,0BAA0B;AAGhC,MAAM,2BAA2B;AAAA,EACtC,MAAM;AAAA,EACN,OAAO;AAAA,EACP,SAAS;AAAA,EACT,cAAc;AAAA,EACd,UAAU;AACZ;AAGO,MAAM,qCAAiC;AAAA,EAC5C;AAAA,EACA;AACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/dist/cjs/index.js
CHANGED
|
@@ -5,6 +5,10 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
5
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
6
|
var __getProtoOf = Object.getPrototypeOf;
|
|
7
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
8
12
|
var __copyProps = (to, from, except, desc) => {
|
|
9
13
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
10
14
|
for (let key of __getOwnPropNames(from))
|
|
@@ -13,7 +17,6 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
13
17
|
}
|
|
14
18
|
return to;
|
|
15
19
|
};
|
|
16
|
-
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
17
20
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
18
21
|
// If the importer is in node compatibility mode or this is not an ESM
|
|
19
22
|
// file that has been converted to a CommonJS file using a Babel-
|
|
@@ -24,7 +27,15 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
24
27
|
));
|
|
25
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
26
29
|
var index_exports = {};
|
|
30
|
+
__export(index_exports, {
|
|
31
|
+
DSProgressIndicator: () => import_DSProgressIndicator.DSProgressIndicator,
|
|
32
|
+
DSProgressIndicatorName: () => import_constants.DSProgressIndicatorName,
|
|
33
|
+
PROGRESS_INDICATOR_DATA_TESTID: () => import_constants.PROGRESS_INDICATOR_DATA_TESTID,
|
|
34
|
+
PROGRESS_INDICATOR_SLOTS: () => import_constants.PROGRESS_INDICATOR_SLOTS,
|
|
35
|
+
ProgressIndicatorWithSchema: () => import_DSProgressIndicator.ProgressIndicatorWithSchema
|
|
36
|
+
});
|
|
27
37
|
module.exports = __toCommonJS(index_exports);
|
|
28
38
|
var React = __toESM(require("react"));
|
|
29
|
-
|
|
39
|
+
var import_DSProgressIndicator = require("./DSProgressIndicator.js");
|
|
40
|
+
var import_constants = require("./constants/index.js");
|
|
30
41
|
//# sourceMappingURL=index.js.map
|
package/dist/cjs/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/index.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["export
|
|
5
|
-
"mappings": "
|
|
4
|
+
"sourcesContent": ["export { DSProgressIndicator, ProgressIndicatorWithSchema } from './DSProgressIndicator.js';\nexport { type DSProgressIndicatorT } from './react-desc-prop-types.js';\nexport {\n DSProgressIndicatorName,\n PROGRESS_INDICATOR_SLOTS,\n PROGRESS_INDICATOR_DATA_TESTID,\n} from './constants/index.js';\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,iCAAiE;AAEjE,uBAIO;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|