@elliemae/ds-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.
Files changed (63) hide show
  1. package/dist/cjs/DSProgressIndicator.js +73 -37
  2. package/dist/cjs/DSProgressIndicator.js.map +2 -2
  3. package/dist/cjs/ProgressBar.js +62 -10
  4. package/dist/cjs/ProgressBar.js.map +2 -2
  5. package/dist/cjs/ProgressCounter.js +18 -8
  6. package/dist/cjs/ProgressCounter.js.map +2 -2
  7. package/dist/cjs/config/useProgressIndicator.js +67 -0
  8. package/dist/cjs/config/useProgressIndicator.js.map +7 -0
  9. package/dist/cjs/{classedComponents.js → config/useValidateProps.js} +10 -20
  10. package/dist/cjs/config/useValidateProps.js.map +7 -0
  11. package/dist/cjs/constants/index.js +50 -0
  12. package/dist/cjs/constants/index.js.map +7 -0
  13. package/dist/cjs/index.js +13 -2
  14. package/dist/cjs/index.js.map +2 -2
  15. package/dist/cjs/react-desc-prop-types.js +52 -0
  16. package/dist/cjs/react-desc-prop-types.js.map +2 -2
  17. package/dist/cjs/styled.js +75 -2
  18. package/dist/cjs/styled.js.map +2 -2
  19. package/dist/cjs/typescript-testing/slot-props.js +40 -0
  20. package/dist/cjs/typescript-testing/slot-props.js.map +7 -0
  21. package/dist/cjs/typescript-testing/typescript-progress-indicator-valid.js +4 -2
  22. package/dist/cjs/typescript-testing/typescript-progress-indicator-valid.js.map +2 -2
  23. package/dist/cjs/utils.js +14 -2
  24. package/dist/cjs/utils.js.map +2 -2
  25. package/dist/esm/DSProgressIndicator.js +75 -39
  26. package/dist/esm/DSProgressIndicator.js.map +2 -2
  27. package/dist/esm/ProgressBar.js +63 -11
  28. package/dist/esm/ProgressBar.js.map +2 -2
  29. package/dist/esm/ProgressCounter.js +19 -9
  30. package/dist/esm/ProgressCounter.js.map +2 -2
  31. package/dist/esm/config/useProgressIndicator.js +37 -0
  32. package/dist/esm/config/useProgressIndicator.js.map +7 -0
  33. package/dist/esm/config/useValidateProps.js +10 -0
  34. package/dist/esm/config/useValidateProps.js.map +7 -0
  35. package/dist/esm/constants/index.js +20 -0
  36. package/dist/esm/constants/index.js.map +7 -0
  37. package/dist/esm/index.js +13 -1
  38. package/dist/esm/index.js.map +2 -2
  39. package/dist/esm/react-desc-prop-types.js +48 -0
  40. package/dist/esm/react-desc-prop-types.js.map +3 -3
  41. package/dist/esm/styled.js +76 -3
  42. package/dist/esm/styled.js.map +2 -2
  43. package/dist/esm/typescript-testing/slot-props.js +17 -0
  44. package/dist/esm/typescript-testing/slot-props.js.map +7 -0
  45. package/dist/esm/typescript-testing/typescript-progress-indicator-valid.js +4 -2
  46. package/dist/esm/typescript-testing/typescript-progress-indicator-valid.js.map +2 -2
  47. package/dist/esm/utils.js +14 -2
  48. package/dist/esm/utils.js.map +2 -2
  49. package/dist/types/DSProgressIndicator.d.ts +14 -3
  50. package/dist/types/ProgressBar.d.ts +13 -3
  51. package/dist/types/ProgressCounter.d.ts +3 -1
  52. package/dist/types/config/useProgressIndicator.d.ts +8 -0
  53. package/dist/types/config/useValidateProps.d.ts +3 -0
  54. package/dist/types/constants/index.d.ts +15 -0
  55. package/dist/types/index.d.ts +2 -1
  56. package/dist/types/react-desc-prop-types.d.ts +35 -3
  57. package/dist/types/styled.d.ts +24 -1
  58. package/dist/types/utils.d.ts +10 -0
  59. package/package.json +8 -7
  60. package/dist/cjs/classedComponents.js.map +0 -7
  61. package/dist/esm/classedComponents.js +0 -20
  62. package/dist/esm/classedComponents.js.map +0 -7
  63. package/dist/types/classedComponents.d.ts +0 -15
@@ -1,32 +1,84 @@
1
1
  import * as React from "react";
2
2
  import { jsx } from "react/jsx-runtime";
3
- import { ProgressBarProgress, ProgressBarStatusBar } from "./classedComponents.js";
4
- import { getPercentage } from "./utils.js";
5
- function useProgressTrait({ now = 0, min = 0, max = 0 }) {
3
+ import { legacyBarClassName, legacyProgressClassName, StyledProgress, StyledProgressBar } from "./styled.js";
4
+ import { clamp, getPercentage, hasValidRange } from "./utils.js";
5
+ function useProgressTrait({
6
+ now = 0,
7
+ min = 0,
8
+ max = 0,
9
+ labelledBy,
10
+ label,
11
+ valueTextRenderer
12
+ }) {
13
+ const rangeIsValid = hasValidRange(min, max);
6
14
  const percentage = getPercentage(now, min, max);
15
+ const valueText = valueTextRenderer?.({ now, min, max });
16
+ const hasTextualValue = typeof valueText === "string" || typeof valueText === "number";
7
17
  return {
8
18
  role: "progressbar",
9
- "aria-valuenow": now,
10
- "aria-valuemin": min,
11
- "aria-valuemax": max,
12
- "aria-label": "progress bar",
19
+ // An invalid range — `max` omitted, or 0 while data loads — is an indeterminate progress, and WAI-ARIA says an
20
+ // indeterminate progressbar omits aria-valuenow. AT then announces "busy" instead of the invalid "0 of 0"
21
+ // range this used to emit. When the range is valid, aria-valuenow is clamped so it never leaves [min, max].
22
+ ...rangeIsValid ? { "aria-valuenow": clamp(now, min, max), "aria-valuemin": min, "aria-valuemax": max } : {},
23
+ // Mirrors the visible counter so screen readers hear the same formatted value sighted users see, not just
24
+ // the raw number. Uses the same renderer as the counter, applied to this bar's own values — for a segment
25
+ // that is the segment's range, which is what its aria-valuenow describes.
26
+ ...rangeIsValid && hasTextualValue ? { "aria-valuetext": String(valueText) } : {},
27
+ // Precedence: a per-segment label wins, because it is the only thing that tells two segments apart
28
+ // once they share the indicator title. Then the visible title. `aria-label` is the last-resort fallback
29
+ // for a titleless indicator, which would otherwise have no accessible name at all.
30
+ ...label ? { "aria-label": label } : {},
31
+ ...!label && labelledBy ? { "aria-labelledby": labelledBy } : {},
32
+ ...!label && !labelledBy ? { "aria-label": "progress bar" } : {},
13
33
  style: {
14
34
  width: `${percentage}%`
15
35
  }
16
36
  };
17
37
  }
18
38
  const Progress = (props) => {
19
- const { variant = "default" } = props;
39
+ const { variant = "default", getOwnerProps, getOwnerPropsArguments } = props;
20
40
  const progressTraitProps = useProgressTrait(props);
21
- return /* @__PURE__ */ jsx(ProgressBarProgress, { classProps: { variant }, ...progressTraitProps });
41
+ return /* @__PURE__ */ jsx(
42
+ StyledProgress,
43
+ {
44
+ className: legacyProgressClassName(variant),
45
+ getOwnerProps,
46
+ getOwnerPropsArguments,
47
+ ...progressTraitProps
48
+ }
49
+ );
22
50
  };
23
51
  const ProgressBar = ({
24
52
  variant = "default",
25
53
  now = void 0,
26
54
  min = void 0,
27
55
  max = void 0,
28
- children: progressSegments
29
- }) => /* @__PURE__ */ jsx(ProgressBarStatusBar, { children: progressSegments || /* @__PURE__ */ jsx(Progress, { max, min, now, variant }) });
56
+ labelledBy = void 0,
57
+ valueTextRenderer = void 0,
58
+ children: progressSegments,
59
+ getOwnerProps,
60
+ getOwnerPropsArguments
61
+ }) => /* @__PURE__ */ jsx(
62
+ StyledProgressBar,
63
+ {
64
+ className: legacyBarClassName(),
65
+ getOwnerProps,
66
+ getOwnerPropsArguments,
67
+ children: progressSegments || /* @__PURE__ */ jsx(
68
+ Progress,
69
+ {
70
+ max,
71
+ min,
72
+ now,
73
+ variant,
74
+ labelledBy,
75
+ valueTextRenderer,
76
+ getOwnerProps,
77
+ getOwnerPropsArguments
78
+ }
79
+ )
80
+ }
81
+ );
30
82
  ProgressBar.Segment = Progress;
31
83
  var ProgressBar_default = ProgressBar;
32
84
  export {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/ProgressBar.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { ProgressBarProgress, ProgressBarStatusBar } from './classedComponents.js';\nimport { getPercentage } from './utils.js';\n\nfunction useProgressTrait({ now = 0, min = 0, max = 0 }: { now?: number; min?: number; max?: number }) {\n const percentage = getPercentage(now, min, max);\n return {\n role: 'progressbar',\n 'aria-valuenow': now,\n 'aria-valuemin': min,\n 'aria-valuemax': max,\n 'aria-label': 'progress bar',\n style: {\n width: `${percentage}%`,\n },\n };\n}\n\nconst Progress = (props: { variant: string; now?: number; min?: number; max?: number }) => {\n const { variant = 'default' } = props;\n\n const progressTraitProps = useProgressTrait(props);\n\n return <ProgressBarProgress classProps={{ variant }} {...progressTraitProps} />;\n};\n\nconst ProgressBar = ({\n variant = 'default',\n now = undefined,\n min = undefined,\n max = undefined,\n children: progressSegments,\n}: {\n variant?: string;\n now?: number;\n min?: number;\n max?: number;\n children?: React.ReactNode;\n}) => (\n <ProgressBarStatusBar>\n {progressSegments || <Progress max={max} min={min} now={now} variant={variant} />}\n </ProgressBarStatusBar>\n);\n\nProgressBar.Segment = Progress;\n\nexport default ProgressBar;\n"],
5
- "mappings": "AAAA,YAAY,WAAW;ACuBd;AAtBT,SAAS,qBAAqB,4BAA4B;AAC1D,SAAS,qBAAqB;AAE9B,SAAS,iBAAiB,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,EAAE,GAAiD;AACrG,QAAM,aAAa,cAAc,KAAK,KAAK,GAAG;AAC9C,SAAO;AAAA,IACL,MAAM;AAAA,IACN,iBAAiB;AAAA,IACjB,iBAAiB;AAAA,IACjB,iBAAiB;AAAA,IACjB,cAAc;AAAA,IACd,OAAO;AAAA,MACL,OAAO,GAAG,UAAU;AAAA,IACtB;AAAA,EACF;AACF;AAEA,MAAM,WAAW,CAAC,UAAyE;AACzF,QAAM,EAAE,UAAU,UAAU,IAAI;AAEhC,QAAM,qBAAqB,iBAAiB,KAAK;AAEjD,SAAO,oBAAC,uBAAoB,YAAY,EAAE,QAAQ,GAAI,GAAG,oBAAoB;AAC/E;AAEA,MAAM,cAAc,CAAC;AAAA,EACnB,UAAU;AAAA,EACV,MAAM;AAAA,EACN,MAAM;AAAA,EACN,MAAM;AAAA,EACN,UAAU;AACZ,MAOE,oBAAC,wBACE,8BAAoB,oBAAC,YAAS,KAAU,KAAU,KAAU,SAAkB,GACjF;AAGF,YAAY,UAAU;AAEtB,IAAO,sBAAQ;",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "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"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACsEnB;AArEJ,SAAS,oBAAoB,yBAAyB,gBAAgB,yBAAyB;AAC/F,SAAS,OAAO,eAAe,qBAAqB;AAQpD,SAAS,iBAAiB;AAAA,EACxB,MAAM;AAAA,EACN,MAAM;AAAA,EACN,MAAM;AAAA,EACN;AAAA,EACA;AAAA,EACA;AACF,GAOG;AACD,QAAM,eAAe,cAAc,KAAK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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
  }
@@ -1,22 +1,32 @@
1
1
  import * as React from "react";
2
2
  import { jsx } from "react/jsx-runtime";
3
- import { getPercentage } from "./utils.js";
4
- import { ProgressIndicatorCounter } from "./classedComponents.js";
5
- const defaultRenderer = ({ now, max, min }) => `${min || now} of ${max}`;
3
+ import { DSTypography, TYPOGRAPHY_VARIANTS } from "@elliemae/ds-typography";
4
+ import { defaultCounterRenderer, getPercentage } from "./utils.js";
5
+ import { legacyCounterClassName, StyledProgressIndicatorCounter } from "./styled.js";
6
6
  const percentageRenderer = ({ now, max, min }) => {
7
7
  const percentage = getPercentage(now, min, max);
8
8
  return `${percentage}%`;
9
9
  };
10
10
  const renderers = {
11
- default: defaultRenderer,
11
+ default: defaultCounterRenderer,
12
12
  percentage: percentageRenderer
13
13
  };
14
14
  const ProgressCounter = ({
15
- now,
16
- max,
17
- min,
18
- renderer = renderers.default
19
- }) => /* @__PURE__ */ jsx(ProgressIndicatorCounter, { children: renderer({ now, max, min }) });
15
+ now = 0,
16
+ max = 0,
17
+ min = 0,
18
+ renderer = renderers.default,
19
+ getOwnerProps,
20
+ getOwnerPropsArguments
21
+ }) => /* @__PURE__ */ jsx(
22
+ StyledProgressIndicatorCounter,
23
+ {
24
+ className: legacyCounterClassName(),
25
+ getOwnerProps,
26
+ getOwnerPropsArguments,
27
+ children: /* @__PURE__ */ jsx(DSTypography, { component: "span", variant: TYPOGRAPHY_VARIANTS.B4, children: renderer({ now, max, min }) })
28
+ }
29
+ );
20
30
  var ProgressCounter_default = ProgressCounter;
21
31
  export {
22
32
  ProgressCounter_default as default
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/ProgressCounter.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { getPercentage } from './utils.js';\nimport { ProgressIndicatorCounter } from './classedComponents.js';\nimport type { DSProgressIndicatorT } from './react-desc-prop-types.js';\n\nconst defaultRenderer: DSProgressIndicatorT.DefaultRendererT = ({ now, max, min }) => `${min || now} of ${max}`;\n\nconst percentageRenderer = ({ now, max, min }: DSProgressIndicatorT.PercentageT) => {\n const percentage = getPercentage(now, min, max);\n return `${percentage}%`;\n};\n\nconst renderers = {\n default: defaultRenderer,\n percentage: percentageRenderer,\n};\n\nconst ProgressCounter = ({\n now,\n max,\n min,\n renderer = renderers.default,\n}: DSProgressIndicatorT.PercentageT & { renderer?: DSProgressIndicatorT.DefaultRendererT }) => (\n <ProgressIndicatorCounter>{renderer({ now, max, min })}</ProgressIndicatorCounter>\n);\n\nexport default ProgressCounter;\n"],
5
- "mappings": "AAAA,YAAY,WAAW;ACuBrB;AAtBF,SAAS,qBAAqB;AAC9B,SAAS,gCAAgC;AAGzC,MAAM,kBAAyD,CAAC,EAAE,KAAK,KAAK,IAAI,MAAM,GAAG,OAAO,GAAG,OAAO,GAAG;AAE7G,MAAM,qBAAqB,CAAC,EAAE,KAAK,KAAK,IAAI,MAAwC;AAClF,QAAM,aAAa,cAAc,KAAK,KAAK,GAAG;AAC9C,SAAO,GAAG,UAAU;AACtB;AAEA,MAAM,YAAY;AAAA,EAChB,SAAS;AAAA,EACT,YAAY;AACd;AAEA,MAAM,kBAAkB,CAAC;AAAA,EACvB;AAAA,EACA;AAAA,EACA;AAAA,EACA,WAAW,UAAU;AACvB,MACE,oBAAC,4BAA0B,mBAAS,EAAE,KAAK,KAAK,IAAI,CAAC,GAAE;AAGzD,IAAO,0BAAQ;",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { DSTypography, TYPOGRAPHY_VARIANTS } from '@elliemae/ds-typography';\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 {/* span, not the variant's default <p>: this sits inside an inline slot and must stay phrasing content */}\n <DSTypography component=\"span\" variant={TYPOGRAPHY_VARIANTS.B4}>\n {renderer({ now, max, min })}\n </DSTypography>\n </StyledProgressIndicatorCounter>\n);\n\nexport default ProgressCounter;\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACkCnB;AAjCJ,SAAS,cAAc,2BAA2B;AAClD,SAAS,wBAAwB,qBAAqB;AACtD,SAAS,wBAAwB,sCAAsC;AAGvE,MAAM,qBAAqB,CAAC,EAAE,KAAK,KAAK,IAAI,MAAwC;AAClF,QAAM,aAAa,cAAc,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,WAAW,uBAAuB;AAAA,IAClC;AAAA,IACA;AAAA,IAGA,8BAAC,gBAAa,WAAU,QAAO,SAAS,oBAAoB,IACzD,mBAAS,EAAE,KAAK,KAAK,IAAI,CAAC,GAC7B;AAAA;AACF;AAGF,IAAO,0BAAQ;",
6
6
  "names": []
7
7
  }
@@ -0,0 +1,37 @@
1
+ import * as React from "react";
2
+ import React2 from "react";
3
+ import { useGetGlobalAttributes, useMemoMergePropsWithDefault } from "@elliemae/ds-props-helpers";
4
+ import { DSProgressIndicatorPropTypes, defaultProps } from "../react-desc-prop-types.js";
5
+ import { useValidateProps } from "./useValidateProps.js";
6
+ import { hasValidRange } from "../utils.js";
7
+ import { DSProgressIndicatorName } from "../constants/index.js";
8
+ const useProgressIndicator = (propsFromUser) => {
9
+ const propsWithDefault = useMemoMergePropsWithDefault(
10
+ propsFromUser,
11
+ defaultProps
12
+ );
13
+ useValidateProps(propsWithDefault, DSProgressIndicatorPropTypes);
14
+ const { title, style, min, max, disabled, ...globalPropsWithoutConsumedKeywords } = propsWithDefault;
15
+ const globalProps = useGetGlobalAttributes(globalPropsWithoutConsumedKeywords);
16
+ const reactId = React2.useId();
17
+ const titleId = `ds-progress-indicator-title-${reactId}`;
18
+ React2.useEffect(() => {
19
+ if (!hasValidRange(min, max)) {
20
+ console.warn(
21
+ `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.`
22
+ );
23
+ }
24
+ }, [min, max]);
25
+ return React2.useMemo(
26
+ () => ({
27
+ propsWithDefault,
28
+ globalProps,
29
+ titleId
30
+ }),
31
+ [propsWithDefault, globalProps, titleId]
32
+ );
33
+ };
34
+ export {
35
+ useProgressIndicator
36
+ };
37
+ //# sourceMappingURL=useProgressIndicator.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/config/useProgressIndicator.ts"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "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"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACAvB,OAAOA,YAAW;AAClB,SAAS,wBAAwB,oCAAoC;AAErE,SAAoC,8BAA8B,oBAAoB;AACtF,SAAS,wBAAwB;AACjC,SAAS,qBAAqB;AAC9B,SAAS,+BAA+B;AAQjC,MAAM,uBAAuB,CAAC,kBAAoE;AAIvG,QAAM,mBAAmB;AAAA,IACvB;AAAA,IACA;AAAA,EACF;AACA,mBAAiB,kBAAkB,4BAAiE;AAQpG,QAAM,EAAE,OAAO,OAAO,KAAK,KAAK,UAAU,GAAG,mCAAmC,IAAI;AACpF,QAAM,cAAc,uBAAuB,kCAAkC;AAM7E,QAAM,UAAUA,OAAM,MAAM;AAC5B,QAAM,UAAU,+BAA+B,OAAO;AAOtD,EAAAA,OAAM,UAAU,MAAM;AACpB,QAA6C,CAAC,cAAc,KAAK,GAAG,GAAG;AAErE,cAAQ;AAAA,QACN,YAAY,uBAAuB,qEAAqE,OAAO,GAAG,CAAC,SAAS,OAAO,GAAG,CAAC;AAAA,MACzI;AAAA,IACF;AAAA,EACF,GAAG,CAAC,KAAK,GAAG,CAAC;AAEb,SAAOA,OAAM;AAAA,IACX,OAAO;AAAA,MACL;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,IACA,CAAC,kBAAkB,aAAa,OAAO;AAAA,EACzC;AACF;",
6
+ "names": ["React"]
7
+ }
@@ -0,0 +1,10 @@
1
+ import * as React from "react";
2
+ import { useValidateTypescriptPropTypes } from "@elliemae/ds-props-helpers";
3
+ import { DSProgressIndicatorName } from "../constants/index.js";
4
+ const useValidateProps = (props, propTypes) => {
5
+ useValidateTypescriptPropTypes(props, propTypes, DSProgressIndicatorName);
6
+ };
7
+ export {
8
+ useValidateProps
9
+ };
10
+ //# sourceMappingURL=useValidateProps.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 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 { 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"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,sCAAsC;AAG/C,SAAS,+BAA+B;AAEjC,MAAM,mBAAmB,CAC9B,OACA,cACS;AACT,iCAA+B,OAAO,WAAW,uBAAuB;AAC1E;",
6
+ "names": []
7
+ }
@@ -0,0 +1,20 @@
1
+ import * as React from "react";
2
+ import { slotObjectToDataTestIds } from "@elliemae/ds-system";
3
+ const DSProgressIndicatorName = "DSProgressindicator";
4
+ const PROGRESS_INDICATOR_SLOTS = {
5
+ ROOT: "root",
6
+ TITLE: "title",
7
+ COUNTER: "counter",
8
+ PROGRESS_BAR: "progress-bar",
9
+ PROGRESS: "progress"
10
+ };
11
+ const PROGRESS_INDICATOR_DATA_TESTID = slotObjectToDataTestIds(
12
+ DSProgressIndicatorName,
13
+ PROGRESS_INDICATOR_SLOTS
14
+ );
15
+ export {
16
+ DSProgressIndicatorName,
17
+ PROGRESS_INDICATOR_DATA_TESTID,
18
+ PROGRESS_INDICATOR_SLOTS
19
+ };
20
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 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 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"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,+BAA+B;AAEjC,MAAM,0BAA0B;AAGhC,MAAM,2BAA2B;AAAA,EACtC,MAAM;AAAA,EACN,OAAO;AAAA,EACP,SAAS;AAAA,EACT,cAAc;AAAA,EACd,UAAU;AACZ;AAGO,MAAM,iCAAiC;AAAA,EAC5C;AAAA,EACA;AACF;",
6
+ "names": []
7
+ }
package/dist/esm/index.js CHANGED
@@ -1,3 +1,15 @@
1
1
  import * as React from "react";
2
- export * from "./DSProgressIndicator.js";
2
+ import { DSProgressIndicator, ProgressIndicatorWithSchema } from "./DSProgressIndicator.js";
3
+ import {
4
+ DSProgressIndicatorName,
5
+ PROGRESS_INDICATOR_SLOTS,
6
+ PROGRESS_INDICATOR_DATA_TESTID
7
+ } from "./constants/index.js";
8
+ export {
9
+ DSProgressIndicator,
10
+ DSProgressIndicatorName,
11
+ PROGRESS_INDICATOR_DATA_TESTID,
12
+ PROGRESS_INDICATOR_SLOTS,
13
+ ProgressIndicatorWithSchema
14
+ };
3
15
  //# sourceMappingURL=index.js.map
@@ -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 * from './DSProgressIndicator.js';\nexport { type DSProgressIndicatorT } from './react-desc-prop-types.js';\n"],
5
- "mappings": "AAAA,YAAY,WAAW;ACAvB,cAAc;",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "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"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,qBAAqB,mCAAmC;AAEjE;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;",
6
6
  "names": []
7
7
  }
@@ -1,2 +1,50 @@
1
1
  import * as React from "react";
2
+ import { PropTypes, getPropsPerSlotPropTypes, globalAttributesPropTypes } from "@elliemae/ds-props-helpers";
3
+ import { DSProgressIndicatorName, PROGRESS_INDICATOR_SLOTS } from "./constants/index.js";
4
+ const defaultProps = {
5
+ containerProps: {},
6
+ title: "",
7
+ now: 0,
8
+ min: 0,
9
+ max: 0,
10
+ disabled: false,
11
+ segments: [],
12
+ style: {}
13
+ };
14
+ const variants = ["default", "success", "warning", "info", "error"];
15
+ const DSProgressIndicatorPropTypes = {
16
+ ...getPropsPerSlotPropTypes(DSProgressIndicatorName, PROGRESS_INDICATOR_SLOTS),
17
+ ...globalAttributesPropTypes,
18
+ containerProps: PropTypes.object.description("Set of Properties attached to the main container"),
19
+ innerRef: PropTypes.object.description("ref to the components container"),
20
+ title: PropTypes.string.description("components title"),
21
+ variant: PropTypes.oneOf(variants).description(
22
+ "Progress intent variation of the fill in single-bar mode. Ignored when segments are given; each segment sets its own variant."
23
+ ),
24
+ now: PropTypes.number.description("Total current value"),
25
+ min: PropTypes.number.description("min value"),
26
+ max: PropTypes.number.description(
27
+ 'max value. Functionally required for a determinate progress: it must be a finite number greater than "min". Without it the progressbar renders as indeterminate and a dev-only warning is logged.'
28
+ ),
29
+ disabled: PropTypes.bool.description("Whether the progress indicator disabled or not").defaultValue(false),
30
+ counterRenderer: PropTypes.func.description("Render a custom counter"),
31
+ segments: PropTypes.arrayOf(
32
+ PropTypes.shape({
33
+ min: PropTypes.number,
34
+ max: PropTypes.number,
35
+ now: PropTypes.number,
36
+ variant: PropTypes.oneOf(variants),
37
+ label: PropTypes.string
38
+ })
39
+ ).description(
40
+ 'An array of multiple progress objects. Give each segment a "label" when its "variant" colour carries meaning \u2014 without one every segment reports the same accessible name and can only be told apart by colour.'
41
+ ),
42
+ style: PropTypes.object.description("css inline style")
43
+ };
44
+ const DSProgressIndicatorPropTypesSchema = DSProgressIndicatorPropTypes;
45
+ export {
46
+ DSProgressIndicatorPropTypes,
47
+ DSProgressIndicatorPropTypesSchema,
48
+ defaultProps
49
+ };
2
50
  //# sourceMappingURL=react-desc-prop-types.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n"],
5
- "mappings": "AAAA,YAAY,WAAW;",
3
+ "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/react-desc-prop-types.ts"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import type { DSPropTypesSchema, GlobalAttributesT, ValidationMap } from '@elliemae/ds-props-helpers';\nimport { PropTypes, getPropsPerSlotPropTypes, globalAttributesPropTypes } from '@elliemae/ds-props-helpers';\nimport { type TypescriptHelpersT } from '@elliemae/ds-typescript-helpers';\nimport { DSProgressIndicatorName, PROGRESS_INDICATOR_SLOTS } from './constants/index.js';\n\nexport declare namespace DSProgressIndicatorT {\n export type PercentageT = {\n min: number;\n max: number;\n now: number;\n };\n\n export type DefaultRendererT = ({ now, max, min }: DSProgressIndicatorT.PercentageT) => string;\n\n export type VariantT = 'default' | 'success' | 'warning' | 'info' | 'error';\n\n export type SegmentsT = {\n length?: number;\n min: number;\n max: number;\n now: number;\n variant: VariantT;\n /**\n * Accessible name for this specific segment. Without it every segment inherits the same name from the\n * indicator title, so segments are told apart only by their variant colour. See PUI-18942.\n */\n label?: string;\n };\n\n export type SlotFunctionArguments = {\n dsProgressindicatorRoot: () => object;\n dsProgressindicatorTitle: () => object;\n dsProgressindicatorCounter: () => object;\n dsProgressindicatorProgressBar: () => object;\n dsProgressindicatorProgress: () => object;\n };\n\n export interface DefaultProps {\n title: string;\n innerRef: React.MutableRefObject<unknown>;\n counterRenderer: DefaultRendererT;\n min: number;\n disabled: boolean;\n segments: SegmentsT[] | readonly SegmentsT[];\n style: object;\n }\n\n export interface OptionalProps extends TypescriptHelpersT.PropsForGlobalOnSlots<\n typeof DSProgressIndicatorName,\n typeof PROGRESS_INDICATOR_SLOTS\n > {\n // deliberately wide: this has accepted arbitrary keys since PUI-12598 and consumers pass data-* through\n // it. Narrowing it to React.HTMLAttributes rejects data-* in object position \u2014 a breaking type change.\n containerProps?: { [key: string]: string };\n now?: number;\n max?: number;\n /**\n * Colour intent of the fill in single-bar mode. Ignored when `segments` are given \u2014 each segment carries its\n * own `variant`. Colour alone does not convey the intent to every user; say it in `title` or the counter too.\n */\n variant?: VariantT;\n }\n\n export interface Props\n extends\n Partial<DefaultProps>,\n OptionalProps,\n Omit<GlobalAttributesT<HTMLElement>, keyof DefaultProps | keyof OptionalProps> {}\n\n export interface InternalProps\n extends\n DefaultProps,\n OptionalProps,\n Omit<GlobalAttributesT<HTMLElement>, keyof DefaultProps | keyof OptionalProps> {}\n}\n\nexport const defaultProps = {\n containerProps: {},\n title: '',\n now: 0,\n min: 0,\n max: 0,\n disabled: false,\n segments: [],\n style: {},\n};\n\nconst variants: DSProgressIndicatorT.VariantT[] = ['default', 'success', 'warning', 'info', 'error'];\n\nexport const DSProgressIndicatorPropTypes: DSPropTypesSchema<DSProgressIndicatorT.Props> = {\n ...getPropsPerSlotPropTypes(DSProgressIndicatorName, PROGRESS_INDICATOR_SLOTS),\n ...globalAttributesPropTypes,\n\n containerProps: PropTypes.object.description('Set of Properties attached to the main container'),\n innerRef: PropTypes.object.description('ref to the components container'),\n title: PropTypes.string.description('components title'),\n variant: PropTypes.oneOf(variants).description(\n 'Progress intent variation of the fill in single-bar mode. Ignored when segments are given; each segment sets its own variant.',\n ),\n now: PropTypes.number.description('Total current value'),\n min: PropTypes.number.description('min value'),\n max: PropTypes.number.description(\n 'max value. Functionally required for a determinate progress: it must be a finite number greater than \"min\". Without it the progressbar renders as indeterminate and a dev-only warning is logged.',\n ),\n disabled: PropTypes.bool.description('Whether the progress indicator disabled or not').defaultValue(false),\n counterRenderer: PropTypes.func.description('Render a custom counter'),\n segments: PropTypes.arrayOf(\n PropTypes.shape({\n min: PropTypes.number,\n max: PropTypes.number,\n now: PropTypes.number,\n variant: PropTypes.oneOf(variants),\n label: PropTypes.string,\n }),\n ).description(\n 'An array of multiple progress objects. Give each segment a \"label\" when its \"variant\" colour carries meaning \u2014 without one every segment reports the same accessible name and can only be told apart by colour.',\n ),\n style: PropTypes.object.description('css inline style'),\n};\n\nexport const DSProgressIndicatorPropTypesSchema =\n DSProgressIndicatorPropTypes as unknown as ValidationMap<DSProgressIndicatorT.Props>;\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACCvB,SAAS,WAAW,0BAA0B,iCAAiC;AAE/E,SAAS,yBAAyB,gCAAgC;AAyE3D,MAAM,eAAe;AAAA,EAC1B,gBAAgB,CAAC;AAAA,EACjB,OAAO;AAAA,EACP,KAAK;AAAA,EACL,KAAK;AAAA,EACL,KAAK;AAAA,EACL,UAAU;AAAA,EACV,UAAU,CAAC;AAAA,EACX,OAAO,CAAC;AACV;AAEA,MAAM,WAA4C,CAAC,WAAW,WAAW,WAAW,QAAQ,OAAO;AAE5F,MAAM,+BAA8E;AAAA,EACzF,GAAG,yBAAyB,yBAAyB,wBAAwB;AAAA,EAC7E,GAAG;AAAA,EAEH,gBAAgB,UAAU,OAAO,YAAY,kDAAkD;AAAA,EAC/F,UAAU,UAAU,OAAO,YAAY,iCAAiC;AAAA,EACxE,OAAO,UAAU,OAAO,YAAY,kBAAkB;AAAA,EACtD,SAAS,UAAU,MAAM,QAAQ,EAAE;AAAA,IACjC;AAAA,EACF;AAAA,EACA,KAAK,UAAU,OAAO,YAAY,qBAAqB;AAAA,EACvD,KAAK,UAAU,OAAO,YAAY,WAAW;AAAA,EAC7C,KAAK,UAAU,OAAO;AAAA,IACpB;AAAA,EACF;AAAA,EACA,UAAU,UAAU,KAAK,YAAY,gDAAgD,EAAE,aAAa,KAAK;AAAA,EACzG,iBAAiB,UAAU,KAAK,YAAY,yBAAyB;AAAA,EACrE,UAAU,UAAU;AAAA,IAClB,UAAU,MAAM;AAAA,MACd,KAAK,UAAU;AAAA,MACf,KAAK,UAAU;AAAA,MACf,KAAK,UAAU;AAAA,MACf,SAAS,UAAU,MAAM,QAAQ;AAAA,MACjC,OAAO,UAAU;AAAA,IACnB,CAAC;AAAA,EACH,EAAE;AAAA,IACA;AAAA,EACF;AAAA,EACA,OAAO,UAAU,OAAO,YAAY,kBAAkB;AACxD;AAEO,MAAM,qCACX;",
6
6
  "names": []
7
7
  }
@@ -1,9 +1,82 @@
1
1
  import * as React from "react";
2
- import { styled } from "@elliemae/ds-system";
3
- const Title = styled.span`
2
+ import { css, styled } from "@elliemae/ds-system";
3
+ import { DSProgressIndicatorName, PROGRESS_INDICATOR_SLOTS } from "./constants/index.js";
4
+ const LEGACY_ROOT_BLOCK = "em-ds-determinate-progress-indicator";
5
+ const LEGACY_BAR_BLOCK = "em-ds-progress-bar";
6
+ const joinClasses = (...classes) => [...new Set(classes.filter(Boolean))].join(" ");
7
+ const legacyRootClassName = (disabled, ...consumerClasses) => joinClasses(
8
+ LEGACY_ROOT_BLOCK,
9
+ `${LEGACY_ROOT_BLOCK}--default`,
10
+ disabled && `${LEGACY_ROOT_BLOCK}--disabled`,
11
+ ...consumerClasses
12
+ );
13
+ const legacyCounterClassName = (...consumerClasses) => joinClasses(`${LEGACY_ROOT_BLOCK}__counter`, ...consumerClasses);
14
+ const legacyBarClassName = (...consumerClasses) => joinClasses(LEGACY_BAR_BLOCK, ...consumerClasses);
15
+ const legacyProgressClassName = (variant, ...consumerClasses) => joinClasses(
16
+ `${LEGACY_BAR_BLOCK}__progress`,
17
+ `${LEGACY_BAR_BLOCK}__progress--default`,
18
+ variant && `${LEGACY_BAR_BLOCK}__progress--${variant}`,
19
+ ...consumerClasses
20
+ );
21
+ const legacyProofStyleOverrides = (slot) => ({ theme }) => {
22
+ const overrides = theme?.components?.[DSProgressIndicatorName]?.styleOverrides?.[slot];
23
+ return overrides ? css`
24
+ &&& {
25
+ ${overrides}
26
+ }
27
+ ` : "";
28
+ };
29
+ const inheritTypographyFromSlot = css`
30
+ && > * {
31
+ font: inherit;
32
+ line-height: inherit;
33
+ color: inherit;
34
+ white-space: inherit;
35
+ overflow-wrap: inherit;
36
+ margin: 0;
37
+ padding: 0;
38
+ }
39
+ `;
40
+ const StyledProgressIndicatorRoot = styled("div", {
41
+ name: DSProgressIndicatorName,
42
+ slot: PROGRESS_INDICATOR_SLOTS.ROOT
43
+ })``;
44
+ const Title = styled("span", {
45
+ name: DSProgressIndicatorName,
46
+ slot: PROGRESS_INDICATOR_SLOTS.TITLE
47
+ })`
4
48
  grid-area: title;
49
+ ${inheritTypographyFromSlot}
50
+ ${legacyProofStyleOverrides(PROGRESS_INDICATOR_SLOTS.TITLE)}
51
+ `;
52
+ const StyledProgressIndicatorCounter = styled("span", {
53
+ name: DSProgressIndicatorName,
54
+ slot: PROGRESS_INDICATOR_SLOTS.COUNTER
55
+ })`
56
+ ${inheritTypographyFromSlot}
57
+ ${legacyProofStyleOverrides(PROGRESS_INDICATOR_SLOTS.COUNTER)}
58
+ `;
59
+ const StyledProgressBar = styled("div", {
60
+ name: DSProgressIndicatorName,
61
+ slot: PROGRESS_INDICATOR_SLOTS.PROGRESS_BAR
62
+ })`
63
+ ${legacyProofStyleOverrides(PROGRESS_INDICATOR_SLOTS.PROGRESS_BAR)}
64
+ `;
65
+ const StyledProgress = styled("div", {
66
+ name: DSProgressIndicatorName,
67
+ slot: PROGRESS_INDICATOR_SLOTS.PROGRESS
68
+ })`
69
+ ${legacyProofStyleOverrides(PROGRESS_INDICATOR_SLOTS.PROGRESS)}
5
70
  `;
6
71
  export {
7
- Title
72
+ StyledProgress,
73
+ StyledProgressBar,
74
+ StyledProgressIndicatorCounter,
75
+ StyledProgressIndicatorRoot,
76
+ Title,
77
+ legacyBarClassName,
78
+ legacyCounterClassName,
79
+ legacyProgressClassName,
80
+ legacyRootClassName
8
81
  };
9
82
  //# sourceMappingURL=styled.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/styled.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { styled } from '@elliemae/ds-system';\n\nexport const Title = styled.span`\n grid-area: title;\n`;\n"],
5
- "mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,cAAc;AAEhB,MAAM,QAAQ,OAAO;AAAA;AAAA;",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { css, styled } from '@elliemae/ds-system';\nimport type { CSSObject, DefaultTheme } from 'styled-components';\nimport { DSProgressIndicatorName, PROGRESS_INDICATOR_SLOTS } from './constants/index.js';\n\n// ============================================================================================================\n// Legacy BEM class contract\n// ============================================================================================================\n// This component carries no CSS of its own: its entire visual layer is the\n// `em-ds-determinate-progress-indicator` / `em-ds-progress-bar` SCSS compiled into `@elliemae/ds-basic`'s\n// dimsum.css, which is frozen. Consumers may also hold stylesheet overrides and QA selectors against these\n// exact names, so the class strings are a compatibility contract, not an implementation detail.\n//\n// They used to be produced by `aggregatedClasses` from the sunsetted `@elliemae/ds-classnames`. They are\n// reproduced verbatim here so that dependency could be dropped and the slot system put in its place without\n// a visual or breaking change. `DSProgressIndicator.api.test.js` locks the resulting class set per state.\n//\n// `--default` is reproduced deliberately and is not a typo: the legacy layout modifier pipeline emitted a\n// `--default` modifier unconditionally on every element that received `classProps`, which is why the root and\n// the progress fill carry it while the counter and the bar (which received none) do not.\n//\n// These are applied as an explicit `className` prop rather than through `.attrs()`, because `.attrs()` on\n// ds-system's `styled` is silently a no-op \u2014 it calls styled-components' immutable `.attrs()` and discards\n// the new resolver it returns (`styledFunction.tsx:173`). Do not \"simplify\" this back to `.attrs()`.\nconst LEGACY_ROOT_BLOCK = 'em-ds-determinate-progress-indicator';\nconst LEGACY_BAR_BLOCK = 'em-ds-progress-bar';\n\n// `aggregatedClasses` appended any consumer-supplied className after its own, so a className arriving through\n// containerProps adds to the contract rather than replacing it. That ordering is preserved.\nconst joinClasses = (...classes: (string | false | undefined)[]) =>\n [...new Set(classes.filter(Boolean) as string[])].join(' ');\n\nexport const legacyRootClassName = (disabled?: boolean, ...consumerClasses: (string | undefined)[]) =>\n joinClasses(\n LEGACY_ROOT_BLOCK,\n `${LEGACY_ROOT_BLOCK}--default`,\n disabled && `${LEGACY_ROOT_BLOCK}--disabled`,\n ...consumerClasses,\n );\n\nexport const legacyCounterClassName = (...consumerClasses: (string | undefined)[]) =>\n joinClasses(`${LEGACY_ROOT_BLOCK}__counter`, ...consumerClasses);\n\nexport const legacyBarClassName = (...consumerClasses: (string | undefined)[]) =>\n joinClasses(LEGACY_BAR_BLOCK, ...consumerClasses);\n\nexport const legacyProgressClassName = (variant?: string, ...consumerClasses: (string | undefined)[]) =>\n joinClasses(\n `${LEGACY_BAR_BLOCK}__progress`,\n `${LEGACY_BAR_BLOCK}__progress--default`,\n variant && `${LEGACY_BAR_BLOCK}__progress--${variant}`,\n ...consumerClasses,\n );\n\n// ============================================================================================================\n// styleOverrides vs the legacy cascade\n// ============================================================================================================\n// ds-system emits `theme.components.DSProgressindicator.styleOverrides[slot]` inside the slot's own generated\n// class \u2014 specificity 0-1-0. Four of the retained legacy rules are descendant selectors:\n//\n// .em-ds-determinate-progress-indicator .em-ds-progress-bar 0-2-0 (track)\n// .em-ds-determinate-progress-indicator .em-ds-progress-bar__progress 0-2-0 (fill)\n// .em-ds-determinate-progress-indicator .em-ds-progress-bar__progress:not(:first-child) 0-3-0\n// .em-ds-determinate-progress-indicator--disabled .em-ds-\u2026__title / __counter / __progress 0-2-0\n//\n// so any property they set (the track's background most visibly \u2014 found by QA while writing SlotsTest) beats\n// the consumer's override. Re-emitting the same override under `&&&` gives it 0-3-0: it ties the strongest\n// legacy rule and wins on source order, because styled-components injects after dimsum.css. The root slot is\n// left alone \u2014 its legacy rules are single-class and already lose to the override on that same source order.\n//\n// This is a consequence of deviation 1 (the legacy SCSS is frozen and still ships) and goes away with it.\ntype ThemeWithComponents = DefaultTheme & {\n components?: Record<string, { styleOverrides?: Record<string, CSSObject> }>;\n};\n\nconst legacyProofStyleOverrides =\n (slot: (typeof PROGRESS_INDICATOR_SLOTS)[keyof typeof PROGRESS_INDICATOR_SLOTS]) =>\n ({ theme }: { theme: ThemeWithComponents }) => {\n const overrides = theme?.components?.[DSProgressIndicatorName]?.styleOverrides?.[slot];\n return overrides\n ? css`\n &&& {\n ${overrides}\n }\n `\n : '';\n };\n\n// ============================================================================================================\n// Text slots carry a DSTypography child\n// ============================================================================================================\n// The title and counter text render through DSTypography (typography remediation, PUI-18942), nested inside the\n// slot element rather than being the slot element. Making DSTypography the slot itself would let the nested-slot\n// mechanism rewrite `data-dimsum-slot` to `dsTypographyRoot` and demote ours to `data-dimsum-parent-slot` \u2014\n// verified by probe \u2014 breaking a slot value that shipped in 3.80 and the E2E `getSlot()` lookups against it.\n//\n// DSTypography brings its own metrics (B4: 0.85rem / 1rem line-height, `white-space: pre-wrap`, font-family,\n// margin/padding). Today the counter takes its metrics from the frozen legacy SCSS and the title inherits the\n// body's, so those must win for the render to stay identical: the child inherits everything from its slot. That\n// keeps consumer `styleOverrides` on the slot flowing into the text too. `&& > *` is 0-2-0, so it beats\n// DSTypography's single class regardless of which rule styled-components happens to inject first.\n//\n// Deliberately neutral: whether the title should finally adopt the counter's micro-text metrics (the SCSS\n// always intended both to share them \u2014 deviation 4) is a UX decision, not a side effect of this change. When\n// it is taken, drop `font` / `line-height` from this block and let the variant apply.\nconst inheritTypographyFromSlot = css`\n && > * {\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`;\n\n// ============================================================================================================\n// Slots\n// ============================================================================================================\n\nexport const StyledProgressIndicatorRoot = styled('div', {\n name: DSProgressIndicatorName,\n slot: PROGRESS_INDICATOR_SLOTS.ROOT,\n})``;\n\nexport const Title = styled('span', {\n name: DSProgressIndicatorName,\n slot: PROGRESS_INDICATOR_SLOTS.TITLE,\n})`\n grid-area: title;\n ${inheritTypographyFromSlot}\n ${legacyProofStyleOverrides(PROGRESS_INDICATOR_SLOTS.TITLE)}\n`;\n\nexport const StyledProgressIndicatorCounter = styled('span', {\n name: DSProgressIndicatorName,\n slot: PROGRESS_INDICATOR_SLOTS.COUNTER,\n})`\n ${inheritTypographyFromSlot}\n ${legacyProofStyleOverrides(PROGRESS_INDICATOR_SLOTS.COUNTER)}\n`;\n\nexport const StyledProgressBar = styled('div', {\n name: DSProgressIndicatorName,\n slot: PROGRESS_INDICATOR_SLOTS.PROGRESS_BAR,\n})`\n ${legacyProofStyleOverrides(PROGRESS_INDICATOR_SLOTS.PROGRESS_BAR)}\n`;\n\nexport const StyledProgress = styled('div', {\n name: DSProgressIndicatorName,\n slot: PROGRESS_INDICATOR_SLOTS.PROGRESS,\n})`\n ${legacyProofStyleOverrides(PROGRESS_INDICATOR_SLOT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;AAAA,EAC3D,MAAM;AAAA,EACN,MAAM,yBAAyB;AACjC,CAAC;AAAA,IACG,yBAAyB;AAAA,IACzB,0BAA0B,yBAAyB,OAAO,CAAC;AAAA;AAGxD,MAAM,oBAAoB,OAAO,OAAO;AAAA,EAC7C,MAAM;AAAA,EACN,MAAM,yBAAyB;AACjC,CAAC;AAAA,IACG,0BAA0B,yBAAyB,YAAY,CAAC;AAAA;AAG7D,MAAM,iBAAiB,OAAO,OAAO;AAAA,EAC1C,MAAM;AAAA,EACN,MAAM,yBAAyB;AACjC,CAAC;AAAA,IACG,0BAA0B,yBAAyB,QAAQ,CAAC;AAAA;",
6
6
  "names": []
7
7
  }
@@ -0,0 +1,17 @@
1
+ import * as React from "react";
2
+ const SlotPropsAsObject = {
3
+ dsProgressindicatorRoot: { "aria-label": "just a typescript test" },
4
+ dsProgressindicatorTitle: { "aria-label": "just a typescript test" },
5
+ dsProgressindicatorCounter: { "aria-label": "just a typescript test" },
6
+ dsProgressindicatorProgressBar: { "aria-label": "just a typescript test" },
7
+ dsProgressindicatorProgress: { "aria-label": "just a typescript test" }
8
+ };
9
+ const SlotPropsAsFunctions = {
10
+ dsProgressindicatorRoot: () => ({ "aria-label": "just a typescript test" }),
11
+ dsProgressindicatorTitle: () => ({ "aria-label": "just a typescript test" }),
12
+ dsProgressindicatorCounter: () => ({ "aria-label": "just a typescript test" }),
13
+ dsProgressindicatorProgressBar: () => ({ "aria-label": "just a typescript test" }),
14
+ dsProgressindicatorProgress: () => ({ "aria-label": "just a typescript test" })
15
+ };
16
+ const EnsureAllSlotsExistInSlotFunctionArguments = SlotPropsAsFunctions;
17
+ //# sourceMappingURL=slot-props.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/typescript-testing/slot-props.ts"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable @typescript-eslint/no-unused-vars, no-unused-vars */\nimport { type TypescriptHelpersT } from '@elliemae/ds-typescript-helpers';\nimport type { DSProgressIndicatorName, PROGRESS_INDICATOR_SLOTS } from '../constants/index.js';\nimport type { DSProgressIndicatorT } from '../react-desc-prop-types.js';\n\nconst SlotPropsAsObject: Partial<DSProgressIndicatorT.Props> = {\n dsProgressindicatorRoot: { 'aria-label': 'just a typescript test' },\n dsProgressindicatorTitle: { 'aria-label': 'just a typescript test' },\n dsProgressindicatorCounter: { 'aria-label': 'just a typescript test' },\n dsProgressindicatorProgressBar: { 'aria-label': 'just a typescript test' },\n dsProgressindicatorProgress: { 'aria-label': 'just a typescript test' },\n};\n\nconst SlotPropsAsFunctions: DSProgressIndicatorT.SlotFunctionArguments = {\n dsProgressindicatorRoot: () => ({ 'aria-label': 'just a typescript test' }),\n dsProgressindicatorTitle: () => ({ 'aria-label': 'just a typescript test' }),\n dsProgressindicatorCounter: () => ({ 'aria-label': 'just a typescript test' }),\n dsProgressindicatorProgressBar: () => ({ 'aria-label': 'just a typescript test' }),\n dsProgressindicatorProgress: () => ({ 'aria-label': 'just a typescript test' }),\n};\n\n// Exhaustiveness check \u2014 fails compilation if a slot is missing from SlotFunctionArguments\nconst EnsureAllSlotsExistInSlotFunctionArguments: Required<\n TypescriptHelpersT.PropsForSlots<typeof DSProgressIndicatorName, typeof PROGRESS_INDICATOR_SLOTS>\n> = SlotPropsAsFunctions;\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACKvB,MAAM,oBAAyD;AAAA,EAC7D,yBAAyB,EAAE,cAAc,yBAAyB;AAAA,EAClE,0BAA0B,EAAE,cAAc,yBAAyB;AAAA,EACnE,4BAA4B,EAAE,cAAc,yBAAyB;AAAA,EACrE,gCAAgC,EAAE,cAAc,yBAAyB;AAAA,EACzE,6BAA6B,EAAE,cAAc,yBAAyB;AACxE;AAEA,MAAM,uBAAmE;AAAA,EACvE,yBAAyB,OAAO,EAAE,cAAc,yBAAyB;AAAA,EACzE,0BAA0B,OAAO,EAAE,cAAc,yBAAyB;AAAA,EAC1E,4BAA4B,OAAO,EAAE,cAAc,yBAAyB;AAAA,EAC5E,gCAAgC,OAAO,EAAE,cAAc,yBAAyB;AAAA,EAChF,6BAA6B,OAAO,EAAE,cAAc,yBAAyB;AAC/E;AAGA,MAAM,6CAEF;",
6
+ "names": []
7
+ }
@@ -5,7 +5,8 @@ import { DSProgressIndicator } from "../index.js";
5
5
  const testOptionalProps = {
6
6
  containerProps: { "data-testid": "" },
7
7
  max: 100,
8
- now: 10
8
+ now: 10,
9
+ variant: "success"
9
10
  };
10
11
  const ref = React2.createRef();
11
12
  const testPartialDefaults = {
@@ -90,7 +91,8 @@ const ExampleUsageComponent = () => /* @__PURE__ */ jsxs(Fragment, { children: [
90
91
  title: "",
91
92
  containerProps: {},
92
93
  max: 100,
93
- now: 20
94
+ now: 20,
95
+ variant: "success"
94
96
  }
95
97
  )
96
98
  ] });
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/typescript-testing/typescript-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 { DSProgressIndicator } from '../index.js';\nimport type { DSProgressIndicatorT } from '../index.js';\n\n// test we expose the namespace and the namespace follows our deliverable conventions\ntype ComponentPropsForApp = DSProgressIndicatorT.Props;\ntype ComponentPropsInternals = DSProgressIndicatorT.InternalProps;\ntype ComponentPropsDefaultProps = DSProgressIndicatorT.DefaultProps;\ntype ComponentPropsOptionalProps = DSProgressIndicatorT.OptionalProps;\n\nconst testOptionalProps: ComponentPropsOptionalProps = {\n containerProps: { 'data-testid': '' },\n max: 100,\n now: 10,\n};\n\nconst ref = React.createRef();\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 disabled: false,\n min: 0,\n style: { border: '1px solid red' },\n};\n\nconst testProps: ComponentPropsForApp = {\n ...testOptionalProps,\n ...testPartialDefaults,\n};\n\nconst testPropsAsSyntax = {\n ...testOptionalProps,\n ...testPartialDefaults,\n} as ComponentPropsForApp;\n\n// InternalProps requires all defaults to be filled in\nconst testCompleteDefaults: Required<ComponentPropsDefaultProps> = {\n counterRenderer: () => '',\n disabled: false,\n innerRef: ref,\n min: 0,\n segments: [],\n style: {},\n title: '',\n};\n\nconst testInternalProps: ComponentPropsInternals = {\n ...testOptionalProps,\n ...testCompleteDefaults,\n};\n\nconst testInternalPropsAsSyntax = {\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 counterRenderer: () => '',\n disabled: false,\n innerRef: ref,\n min: 0,\n segments: [],\n style: {},\n title: '',\n containerProps: {},\n max: 100,\n now: 20,\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 counterRenderer: () => '',\n disabled: false,\n innerRef: ref,\n min: 0,\n segments: [],\n style: {},\n title: '',\n containerProps: {},\n max: 100,\n now: 20,\n} as ComponentPropsForApp;\n\nconst testDefinitionAsConst = {\n counterRenderer: () => '',\n disabled: false,\n innerRef: ref,\n min: 0,\n segments: [],\n style: {},\n title: '',\n containerProps: {},\n max: 100,\n now: 20,\n} as const;\n\nconst ExampleUsageComponent = () => (\n <>\n {/* works with explicitly casted props, all syntaxes */}\n <DSProgressIndicator {...testExplicitDefinition} />\n <DSProgressIndicator {...testInferedTypeCompatibility} />\n <DSProgressIndicator {...testDefinitionAsConst} />\n {/* works with inline values */}\n <DSProgressIndicator\n counterRenderer={() => ''}\n disabled\n innerRef={ref}\n min={0}\n segments={[]}\n style={{}}\n title=\"\"\n containerProps={{}}\n max={100}\n now={20}\n />\n </>\n);\n"],
5
- "mappings": "AAAA,YAAY,WAAW;AC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;AAAA,EACV,KAAK;AAAA,EACL,UAAU,CAAC;AAAA,EACX,OAAO,CAAC;AAAA,EACR,OAAO;AAAA,EACP,gBAAgB,CAAC;AAAA,EACjB,KAAK;AAAA,EACL,KAAK;AACP;AAEA,MAAM,wBAAwB,MAC5B,iCAEE;AAAA,sBAAC,uBAAqB,GAAG,wBAAwB;AAAA,EACjD,oBAAC,uBAAqB,GAAG,8BAA8B;AAAA,EACvD,oBAAC,uBAAqB,GAAG,uBAAuB;AAAA,EAEhD;AAAA,IAAC;AAAA;AAAA,MACC,iBAAiB,MAAM;AAAA,MACvB,UAAQ;AAAA,MACR,UAAU;AAAA,MACV,KAAK;AAAA,MACL,UAAU,CAAC;AAAA,MACX,OAAO,CAAC;AAAA,MACR,OAAM;AAAA,MACN,gBAAgB,CAAC;AAAA,MACjB,KAAK;AAAA,MACL,KAAK;AAAA;AAAA,EACP;AAAA,GACF;",
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 { DSProgressIndicator } from '../index.js';\nimport type { DSProgressIndicatorT } from '../index.js';\n\n// test we expose the namespace and the namespace follows our deliverable conventions\ntype ComponentPropsForApp = DSProgressIndicatorT.Props;\ntype ComponentPropsInternals = DSProgressIndicatorT.InternalProps;\ntype ComponentPropsDefaultProps = DSProgressIndicatorT.DefaultProps;\ntype ComponentPropsOptionalProps = DSProgressIndicatorT.OptionalProps;\n\nconst testOptionalProps: ComponentPropsOptionalProps = {\n containerProps: { 'data-testid': '' },\n max: 100,\n now: 10,\n variant: 'success',\n};\n\nconst ref = React.createRef();\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 disabled: false,\n min: 0,\n style: { border: '1px solid red' },\n};\n\nconst testProps: ComponentPropsForApp = {\n ...testOptionalProps,\n ...testPartialDefaults,\n};\n\nconst testPropsAsSyntax = {\n ...testOptionalProps,\n ...testPartialDefaults,\n} as ComponentPropsForApp;\n\n// InternalProps requires all defaults to be filled in\nconst testCompleteDefaults: Required<ComponentPropsDefaultProps> = {\n counterRenderer: () => '',\n disabled: false,\n innerRef: ref,\n min: 0,\n segments: [],\n style: {},\n title: '',\n};\n\nconst testInternalProps: ComponentPropsInternals = {\n ...testOptionalProps,\n ...testCompleteDefaults,\n};\n\nconst testInternalPropsAsSyntax = {\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 counterRenderer: () => '',\n disabled: false,\n innerRef: ref,\n min: 0,\n segments: [],\n style: {},\n title: '',\n containerProps: {},\n max: 100,\n now: 20,\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 counterRenderer: () => '',\n disabled: false,\n innerRef: ref,\n min: 0,\n segments: [],\n style: {},\n title: '',\n containerProps: {},\n max: 100,\n now: 20,\n} as ComponentPropsForApp;\n\nconst testDefinitionAsConst = {\n counterRenderer: () => '',\n disabled: false,\n innerRef: ref,\n min: 0,\n segments: [],\n style: {},\n title: '',\n containerProps: {},\n max: 100,\n now: 20,\n} as const;\n\nconst ExampleUsageComponent = () => (\n <>\n {/* works with explicitly casted props, all syntaxes */}\n <DSProgressIndicator {...testExplicitDefinition} />\n <DSProgressIndicator {...testInferedTypeCompatibility} />\n <DSProgressIndicator {...testDefinitionAsConst} />\n {/* works with inline values */}\n <DSProgressIndicator\n counterRenderer={() => ''}\n disabled\n innerRef={ref}\n min={0}\n segments={[]}\n style={{}}\n title=\"\"\n containerProps={{}}\n max={100}\n now={20}\n variant=\"success\"\n />\n </>\n);\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACqGrB,mBAEE,KAFF;AApGF,OAAOA,YAAW;AAClB,SAAS,2BAA2B;AASpC,MAAM,oBAAiD;AAAA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