@elliemae/ds-legacy-indeterminate-progress-indicator 1.0.0-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/DSIndeterminateProgressIndicator.js +107 -0
- package/dist/cjs/DSIndeterminateProgressIndicator.js.map +7 -0
- package/dist/cjs/config/useIndeterminateProgressIndicator.js +78 -0
- package/dist/cjs/config/useIndeterminateProgressIndicator.js.map +7 -0
- package/dist/cjs/config/useValidateProps.js +40 -0
- package/dist/cjs/config/useValidateProps.js.map +7 -0
- package/dist/cjs/constants/index.js +49 -0
- package/dist/cjs/constants/index.js.map +7 -0
- package/dist/cjs/index.js +41 -0
- package/dist/cjs/index.js.map +7 -0
- package/dist/cjs/package.json +7 -0
- package/dist/cjs/react-desc-prop-types.js +67 -0
- package/dist/cjs/react-desc-prop-types.js.map +7 -0
- package/dist/cjs/styled.js +182 -0
- package/dist/cjs/styled.js.map +7 -0
- package/dist/esm/DSIndeterminateProgressIndicator.js +79 -0
- package/dist/esm/DSIndeterminateProgressIndicator.js.map +7 -0
- package/dist/esm/config/useIndeterminateProgressIndicator.js +51 -0
- package/dist/esm/config/useIndeterminateProgressIndicator.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 +19 -0
- package/dist/esm/constants/index.js.map +7 -0
- package/dist/esm/index.js +10 -0
- package/dist/esm/index.js.map +7 -0
- package/dist/esm/package.json +7 -0
- package/dist/esm/react-desc-prop-types.js +37 -0
- package/dist/esm/react-desc-prop-types.js.map +7 -0
- package/dist/esm/styled.js +152 -0
- package/dist/esm/styled.js.map +7 -0
- package/dist/types/DSIndeterminateProgressIndicator.d.ts +6 -0
- package/dist/types/config/useIndeterminateProgressIndicator.d.ts +8 -0
- package/dist/types/config/useValidateProps.d.ts +3 -0
- package/dist/types/constants/index.d.ts +8 -0
- package/dist/types/index.d.ts +3 -0
- package/dist/types/react-desc-prop-types.d.ts +28 -0
- package/dist/types/styled.d.ts +6 -0
- package/package.json +70 -0
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/styled.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["/* eslint-disable complexity */\nimport { css, kfrm, styled } from '@elliemae/ds-legacy-system';\nimport { type DSIndeterminateProgressIndicatorT } from './react-desc-prop-types.js';\nimport { DSTruncatedTooltipText } from '@elliemae/ds-legacy-truncated-tooltip-text';\nimport { DSIndeterminateProgressIndicatorName, DSIndeterminateProgressIndicatorSlots } from './constants/index.js';\n\nconst IndeterminateAnimation = (color: string) => kfrm`\n 0% {\n transform: scaleX(0.015);\n transform-origin: 0% 0%;\n background-image: linear-gradient(to right, rgba(255,255,255,0.8) 10%, ${color});\n }\n 25% {\n transform: scaleX(0.4);\n }\n 50% {\n transform: scaleX(0.015);\n transform-origin: 100% 0%;\n background-image: linear-gradient(to right, rgba(255,255,255,0.8) 10%, ${color});\n }\n 50.1% {\n transform: scaleX(0.015);\n transform-origin: 100% 0%;\n background-image: linear-gradient(to left, rgba(255,255,255,0.8) 10%, ${color});\n }\n 75% {\n transform: scaleX(0.4);\n }\n 100% {\n transform: scaleX(0.015);\n transform-origin: 0% 0%;\n background-image: linear-gradient(to left, rgba(255,255,255,0.8) 10%, ${color});\n }\n`;\n\nconst ProcessingSuccess = kfrm`\n 0%, 30% { transform: translateX(-50%); width: 50% }\n 15% { transform: translateX(150%); width: 50% }\n 0%, 60% { transform: translateX(-50%); width: 50% }\n 45% { transform: translateX(150%); width: 50% }\n 0%, 90% { transform: translateX(-50%); width: 50% }\n 75% { transform: translateX(150%); width: 50% }\n 100% { transform: translateX(0%); }\n`;\n\nconst ProcessingSuccessEnd = (color: string) => kfrm`\n 0% { transform: translateX(-50%); width: 50% }\n 45% { transform: translateX(150%); width: 50% }\n 100% { transform: translateX(0%); background-color: ${color}; }\n`;\n\nconst ProcessingFail = kfrm`\n 0%, 30% { transform: translateX(-50%); width: 50% }\n 15% { transform: translateX(150%); width: 50% }\n 0%, 60% { transform: translateX(-50%); width: 50% }\n 45% { transform: translateX(150%); width: 50% }\n 0%, 90% { transform: translateX(-50%); width: 50% }\n 75% { transform: translateX(150%); width: 50%; }\n 100% { transform: translateX(0%); }\n`;\n\nconst ProcessingFailEnd = kfrm`\n 0% { transform: translateX(-50%); width: 50% }\n 45% { transform: translateX(150%); width: 50% }\n 100% { transform: translateX(0%); background-color: #e34256; }\n`;\n\nexport const Container = styled('div', {\n name: DSIndeterminateProgressIndicatorName,\n slot: DSIndeterminateProgressIndicatorSlots.ROOT,\n})<DSIndeterminateProgressIndicatorT.Props>`\n width: 100%;\n padding: ${({ theme, lineOnly }) => (lineOnly ? 0 : `${theme.space.xxs} ${theme.space.xs}`)};\n`;\n\nexport const StyledTruncatedTooltipText = styled(DSTruncatedTooltipText, {\n name: DSIndeterminateProgressIndicatorName,\n slot: DSIndeterminateProgressIndicatorSlots.LABEL,\n})``;\n\nexport const Bar = styled('div', {\n name: DSIndeterminateProgressIndicatorName,\n slot: DSIndeterminateProgressIndicatorSlots.BAR,\n})`\n background-color: ${({ theme }) => theme.colors.neutral[100]};\n overflow: hidden;\n`;\n\nexport const BarIndicator = styled('div', {\n name: DSIndeterminateProgressIndicatorName,\n slot: DSIndeterminateProgressIndicatorSlots.BAR_INDICATOR,\n})<DSIndeterminateProgressIndicatorT.Props>`\n height: ${({ theme }) => theme.space.xxxs};\n width: ${({ complete, failed, animated, processing, percent }) =>\n `${!complete && !failed && !animated && processing ? percent : 100}%`};\n ${({ theme, complete, failed, processing, animated, processingComplete, processingFail }) => {\n // Default\n if (!complete && !failed && !processing && !processingComplete && !processingFail)\n return css`\n background-color: ${theme.colors.neutral[500]};\n `;\n // Completed\n else if (complete && processing)\n return css`\n width: 100%;\n background-color: ${theme.colors.brand[500]};\n animation: ${ProcessingSuccessEnd(theme.colors.success[900])} 1s ease-in-out;\n animation-fill-mode: forwards;\n `;\n else if (complete && !processingComplete && !processing)\n return css`\n background-color: ${theme.colors.success[900]};\n `;\n // Failed\n else if (failed && !processingFail && !processing)\n return css`\n background-color: #e34256;\n `;\n // Processing\n else if (processing) {\n if (animated) {\n return css`\n width: 100%;\n animation: ${IndeterminateAnimation(theme.colors.brand[500])} 2s cubic-bezier(0.645, 0.045, 0.355, 1) infinite;\n background-color: ${theme.colors.brand[500]};\n `;\n }\n return css`\n background-color: ${theme.colors.brand[500]};\n `;\n }\n // Processing -> Completed\n else if (processingComplete && !complete) {\n return css`\n width: 50%;\n animation: ${ProcessingSuccess} 4s infinite;\n animation-fill-mode: forwards;\n background-color: ${theme.colors.brand[500]};\n `;\n } else if (processingComplete && complete)\n return css`\n width: 100%;\n background-color: ${theme.colors.brand[500]};\n animation: ${ProcessingSuccessEnd(theme.colors.success[900])} 1s ease-in-out;\n animation-fill-mode: forwards;\n `;\n // Processing -> Failed\n else if (processingFail && !failed)\n return css`\n width: 50%;\n animation: ${ProcessingFail} 4s infinite;\n animation-fill-mode: forwards;\n background-color: ${theme.colors.brand[500]};\n `;\n else if (processingFail && failed)\n return css`\n width: 100%;\n background-color: ${theme.colors.brand[500]};\n animation: ${ProcessingFailEnd} 1s ease-in-out;\n animation-fill-mode: forwards;\n `;\n }};\n`;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,8BAAkC;AAElC,8CAAuC;AACvC,uBAA4F;AAE5F,MAAM,yBAAyB,CAAC,UAAkB;AAAA;AAAA;AAAA;AAAA,6EAI2B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,6EAQA;AAAA;AAAA;AAAA;AAAA;AAAA,4EAKD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,4E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OAAO,MAAM,GAAG;AAAA,qBAC7B,qBAAqB,MAAM,OAAO,QAAQ,GAAG,CAAC;AAAA;AAAA;AAAA,WAGtD,YAAY,CAAC,sBAAsB,CAAC;AAC3C,WAAO;AAAA,4BACe,MAAM,OAAO,QAAQ,GAAG;AAAA;AAAA,WAGvC,UAAU,CAAC,kBAAkB,CAAC;AACrC,WAAO;AAAA;AAAA;AAAA,WAIA,YAAY;AACnB,QAAI,UAAU;AACZ,aAAO;AAAA;AAAA,uBAEQ,uBAAuB,MAAM,OAAO,MAAM,GAAG,CAAC;AAAA,8BACvC,MAAM,OAAO,MAAM,GAAG;AAAA;AAAA,IAE9C;AACA,WAAO;AAAA,4BACe,MAAM,OAAO,MAAM,GAAG;AAAA;AAAA,EAE9C,WAES,sBAAsB,CAAC,UAAU;AACxC,WAAO;AAAA;AAAA,qBAEQ;AAAA;AAAA,4BAEO,MAAM,OAAO,MAAM,GAAG;AAAA;AAAA,EAE9C,WAAW,sBAAsB;AAC/B,WAAO;AAAA;AAAA,4BAEe,MAAM,OAAO,MAAM,GAAG;AAAA,qBAC7B,qBAAqB,MAAM,OAAO,QAAQ,GAAG,CAAC;AAAA;AAAA;AAAA,WAItD,kBAAkB,CAAC;AAC1B,WAAO;AAAA;AAAA,qBAEQ;AAAA;AAAA,4BAEO,MAAM,OAAO,MAAM,GAAG;AAAA;AAAA,WAErC,kBAAkB;AACzB,WAAO;AAAA;AAAA,4BAEe,MAAM,OAAO,MAAM,GAAG;AAAA,qBAC7B;AAAA;AAAA;AAGnB;AAAA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useCallback } from "react";
|
|
4
|
+
import { describe, useGetGlobalAttributes, useGetXstyledProps } from "@elliemae/ds-legacy-props-helpers";
|
|
5
|
+
import {
|
|
6
|
+
DSIndeterminateProgressIndicatorPropTypes
|
|
7
|
+
} from "./react-desc-prop-types.js";
|
|
8
|
+
import { useIndeterminateProgressIndicator } from "./config/useIndeterminateProgressIndicator.js";
|
|
9
|
+
import { DSIndeterminateProgressIndicatorName } from "./constants/index.js";
|
|
10
|
+
import { TooltipTextProvider } from "@elliemae/ds-legacy-truncated-tooltip-text";
|
|
11
|
+
import { Bar, BarIndicator, Container, StyledTruncatedTooltipText } from "./styled.js";
|
|
12
|
+
const DSIndeterminateProgressIndicator = (props) => {
|
|
13
|
+
const { propsWithDefault, label } = useIndeterminateProgressIndicator(props);
|
|
14
|
+
const {
|
|
15
|
+
containerProps,
|
|
16
|
+
complete,
|
|
17
|
+
failed,
|
|
18
|
+
processing,
|
|
19
|
+
processingComplete,
|
|
20
|
+
processingFail,
|
|
21
|
+
animated,
|
|
22
|
+
percent,
|
|
23
|
+
lineOnly
|
|
24
|
+
} = propsWithDefault;
|
|
25
|
+
const globalAttributes = useGetGlobalAttributes(propsWithDefault);
|
|
26
|
+
const xstyledAttributes = useGetXstyledProps(propsWithDefault);
|
|
27
|
+
const getOwnerProps = useCallback(() => propsWithDefault, [propsWithDefault]);
|
|
28
|
+
const getOwnerPropsArguments = useCallback(() => ({}), []);
|
|
29
|
+
return /* @__PURE__ */ jsxs(
|
|
30
|
+
Container,
|
|
31
|
+
{
|
|
32
|
+
"aria-busy": processing,
|
|
33
|
+
"aria-label": label,
|
|
34
|
+
"aria-live": "polite",
|
|
35
|
+
role: "alert",
|
|
36
|
+
lineOnly,
|
|
37
|
+
getOwnerProps,
|
|
38
|
+
getOwnerPropsArguments,
|
|
39
|
+
...globalAttributes,
|
|
40
|
+
...xstyledAttributes,
|
|
41
|
+
...containerProps,
|
|
42
|
+
children: [
|
|
43
|
+
!lineOnly ? /* @__PURE__ */ jsx(TooltipTextProvider, { children: /* @__PURE__ */ jsx(
|
|
44
|
+
StyledTruncatedTooltipText,
|
|
45
|
+
{
|
|
46
|
+
value: label,
|
|
47
|
+
getOwnerProps,
|
|
48
|
+
getOwnerPropsArguments
|
|
49
|
+
}
|
|
50
|
+
) }) : null,
|
|
51
|
+
/* @__PURE__ */ jsx(Bar, { getOwnerProps, getOwnerPropsArguments, children: /* @__PURE__ */ jsx(
|
|
52
|
+
BarIndicator,
|
|
53
|
+
{
|
|
54
|
+
complete,
|
|
55
|
+
failed,
|
|
56
|
+
processing,
|
|
57
|
+
animated,
|
|
58
|
+
processingComplete,
|
|
59
|
+
processingFail,
|
|
60
|
+
percent,
|
|
61
|
+
getOwnerProps,
|
|
62
|
+
getOwnerPropsArguments
|
|
63
|
+
}
|
|
64
|
+
) })
|
|
65
|
+
]
|
|
66
|
+
}
|
|
67
|
+
);
|
|
68
|
+
};
|
|
69
|
+
DSIndeterminateProgressIndicator.propTypes = DSIndeterminateProgressIndicatorPropTypes;
|
|
70
|
+
DSIndeterminateProgressIndicator.displayName = DSIndeterminateProgressIndicatorName;
|
|
71
|
+
const IndeterminateProgressIndicatorWithSchema = describe(DSIndeterminateProgressIndicator);
|
|
72
|
+
IndeterminateProgressIndicatorWithSchema.propTypes = DSIndeterminateProgressIndicatorPropTypes;
|
|
73
|
+
var DSIndeterminateProgressIndicator_default = DSIndeterminateProgressIndicator;
|
|
74
|
+
export {
|
|
75
|
+
DSIndeterminateProgressIndicator,
|
|
76
|
+
IndeterminateProgressIndicatorWithSchema,
|
|
77
|
+
DSIndeterminateProgressIndicator_default as default
|
|
78
|
+
};
|
|
79
|
+
//# sourceMappingURL=DSIndeterminateProgressIndicator.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/DSIndeterminateProgressIndicator.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useCallback } from 'react';\nimport { describe, useGetGlobalAttributes, useGetXstyledProps } from '@elliemae/ds-legacy-props-helpers';\nimport {\n DSIndeterminateProgressIndicatorPropTypes,\n type DSIndeterminateProgressIndicatorT,\n} from './react-desc-prop-types.js';\nimport { useIndeterminateProgressIndicator } from './config/useIndeterminateProgressIndicator.js';\nimport { DSIndeterminateProgressIndicatorName } from './constants/index.js';\nimport { TooltipTextProvider } from '@elliemae/ds-legacy-truncated-tooltip-text';\nimport { Bar, BarIndicator, Container, StyledTruncatedTooltipText } from './styled.js';\n\nconst DSIndeterminateProgressIndicator: React.ComponentType<DSIndeterminateProgressIndicatorT.Props> = (props) => {\n const { propsWithDefault, label } = useIndeterminateProgressIndicator(props);\n const {\n containerProps,\n complete,\n failed,\n processing,\n processingComplete,\n processingFail,\n animated,\n percent,\n lineOnly,\n } = propsWithDefault;\n\n const globalAttributes = useGetGlobalAttributes(propsWithDefault);\n const xstyledAttributes = useGetXstyledProps(propsWithDefault);\n const getOwnerProps = useCallback(() => propsWithDefault, [propsWithDefault]);\n const getOwnerPropsArguments = useCallback(() => ({}), []);\n\n return (\n <Container\n aria-busy={processing}\n aria-label={label}\n aria-live=\"polite\"\n role=\"alert\"\n lineOnly={lineOnly}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n {...globalAttributes}\n {...xstyledAttributes}\n {...containerProps}\n >\n {!lineOnly ? (\n <TooltipTextProvider>\n <StyledTruncatedTooltipText\n value={label}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n />\n </TooltipTextProvider>\n ) : null}\n <Bar getOwnerProps={getOwnerProps} getOwnerPropsArguments={getOwnerPropsArguments}>\n <BarIndicator\n complete={complete}\n failed={failed}\n processing={processing}\n animated={animated}\n processingComplete={processingComplete}\n processingFail={processingFail}\n percent={percent}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n />\n </Bar>\n </Container>\n );\n};\n\nDSIndeterminateProgressIndicator.propTypes = DSIndeterminateProgressIndicatorPropTypes;\nDSIndeterminateProgressIndicator.displayName = DSIndeterminateProgressIndicatorName;\nconst IndeterminateProgressIndicatorWithSchema = describe(DSIndeterminateProgressIndicator);\nIndeterminateProgressIndicatorWithSchema.propTypes = DSIndeterminateProgressIndicatorPropTypes;\n\nexport { DSIndeterminateProgressIndicator, IndeterminateProgressIndicatorWithSchema };\nexport default DSIndeterminateProgressIndicator;\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;AC+BnB,SAcM,KAdN;AA/BJ,SAAgB,mBAAmB;AACnC,SAAS,UAAU,wBAAwB,0BAA0B;AACrE;AAAA,EACE;AAAA,OAEK;AACP,SAAS,yCAAyC;AAClD,SAAS,4CAA4C;AACrD,SAAS,2BAA2B;AACpC,SAAS,KAAK,cAAc,WAAW,kCAAkC;AAEzE,MAAM,mCAAiG,CAAC,UAAU;AAChH,QAAM,EAAE,kBAAkB,MAAM,IAAI,kCAAkC,KAAK;AAC3E,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI;AAEJ,QAAM,mBAAmB,uBAAuB,gBAAgB;AAChE,QAAM,oBAAoB,mBAAmB,gBAAgB;AAC7D,QAAM,gBAAgB,YAAY,MAAM,kBAAkB,CAAC,gBAAgB,CAAC;AAC5E,QAAM,yBAAyB,YAAY,OAAO,CAAC,IAAI,CAAC,CAAC;AAEzD,SACE;AAAA,IAAC;AAAA;AAAA,MACC,aAAW;AAAA,MACX,cAAY;AAAA,MACZ,aAAU;AAAA,MACV,MAAK;AAAA,MACL;AAAA,MACA;AAAA,MACA;AAAA,MACC,GAAG;AAAA,MACH,GAAG;AAAA,MACH,GAAG;AAAA,MAEH;AAAA,SAAC,WACA,oBAAC,uBACC;AAAA,UAAC;AAAA;AAAA,YACC,OAAO;AAAA,YACP;AAAA,YACA;AAAA;AAAA,QACF,GACF,IACE;AAAA,QACJ,oBAAC,OAAI,eAA8B,wBACjC;AAAA,UAAC;AAAA;AAAA,YACC;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA;AAAA,QACF,GACF;AAAA;AAAA;AAAA,EACF;AAEJ;AAEA,iCAAiC,YAAY;AAC7C,iCAAiC,cAAc;AAC/C,MAAM,2CAA2C,SAAS,gCAAgC;AAC1F,yCAAyC,YAAY;AAGrD,IAAO,2CAAQ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import React2, { useMemo } from "react";
|
|
3
|
+
import { useMemoMergePropsWithDefault } from "@elliemae/ds-legacy-props-helpers";
|
|
4
|
+
import {
|
|
5
|
+
DSIndeterminateProgressIndicatorPropTypes,
|
|
6
|
+
defaultProps
|
|
7
|
+
} from "../react-desc-prop-types.js";
|
|
8
|
+
import { useValidateProps } from "./useValidateProps.js";
|
|
9
|
+
const useIndeterminateProgressIndicator = (propsFromUser) => {
|
|
10
|
+
const propsWithDefault = useMemoMergePropsWithDefault(
|
|
11
|
+
propsFromUser,
|
|
12
|
+
defaultProps
|
|
13
|
+
);
|
|
14
|
+
useValidateProps(propsWithDefault, DSIndeterminateProgressIndicatorPropTypes);
|
|
15
|
+
const {
|
|
16
|
+
title,
|
|
17
|
+
complete,
|
|
18
|
+
failed,
|
|
19
|
+
processing,
|
|
20
|
+
processingComplete,
|
|
21
|
+
processingCompleteTitle,
|
|
22
|
+
processingFail,
|
|
23
|
+
processingFailTitle
|
|
24
|
+
} = propsWithDefault;
|
|
25
|
+
const label = useMemo(() => {
|
|
26
|
+
if ((processingComplete || processingFail || processing) && (complete || failed)) {
|
|
27
|
+
return complete ? processingCompleteTitle : processingFailTitle;
|
|
28
|
+
}
|
|
29
|
+
return title;
|
|
30
|
+
}, [
|
|
31
|
+
processingComplete,
|
|
32
|
+
processingFail,
|
|
33
|
+
processing,
|
|
34
|
+
complete,
|
|
35
|
+
failed,
|
|
36
|
+
title,
|
|
37
|
+
processingCompleteTitle,
|
|
38
|
+
processingFailTitle
|
|
39
|
+
]);
|
|
40
|
+
return React2.useMemo(
|
|
41
|
+
() => ({
|
|
42
|
+
propsWithDefault,
|
|
43
|
+
label
|
|
44
|
+
}),
|
|
45
|
+
[propsWithDefault, label]
|
|
46
|
+
);
|
|
47
|
+
};
|
|
48
|
+
export {
|
|
49
|
+
useIndeterminateProgressIndicator
|
|
50
|
+
};
|
|
51
|
+
//# sourceMappingURL=useIndeterminateProgressIndicator.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/config/useIndeterminateProgressIndicator.ts"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useMemo } from 'react';\nimport { useMemoMergePropsWithDefault } from '@elliemae/ds-legacy-props-helpers';\nimport {\n type DSIndeterminateProgressIndicatorT,\n DSIndeterminateProgressIndicatorPropTypes,\n defaultProps,\n} from '../react-desc-prop-types.js';\nimport { useValidateProps } from './useValidateProps.js';\n\nexport interface IndeterminateProgressIndicatorCTX {\n propsWithDefault: DSIndeterminateProgressIndicatorT.InternalProps;\n}\n\nexport const useIndeterminateProgressIndicator = (propsFromUser: DSIndeterminateProgressIndicatorT.Props) => {\n // =============================================================================\n // MERGE WITH DEFAULT AND VALIDATE PROPS\n // =============================================================================\n const propsWithDefault = useMemoMergePropsWithDefault<DSIndeterminateProgressIndicatorT.InternalProps>(\n propsFromUser,\n defaultProps,\n );\n useValidateProps(propsWithDefault, DSIndeterminateProgressIndicatorPropTypes);\n // =============================================================================\n // AD HOC PER COMPONENT LOGIC\n // =============================================================================\n const {\n title,\n complete,\n failed,\n processing,\n processingComplete,\n processingCompleteTitle,\n processingFail,\n processingFailTitle,\n } = propsWithDefault;\n\n const label = useMemo(() => {\n if ((processingComplete || processingFail || processing) && (complete || failed)) {\n return complete ? processingCompleteTitle : processingFailTitle;\n }\n return title;\n }, [\n processingComplete,\n processingFail,\n processing,\n complete,\n failed,\n title,\n processingCompleteTitle,\n processingFailTitle,\n ]);\n\n return React.useMemo(\n () => ({\n propsWithDefault,\n label,\n }),\n [propsWithDefault, label],\n );\n};\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB,OAAOA,UAAS,eAAe;AAC/B,SAAS,oCAAoC;AAC7C;AAAA,EAEE;AAAA,EACA;AAAA,OACK;AACP,SAAS,wBAAwB;AAM1B,MAAM,oCAAoC,CAAC,kBAA2D;AAI3G,QAAM,mBAAmB;AAAA,IACvB;AAAA,IACA;AAAA,EACF;AACA,mBAAiB,kBAAkB,yCAAyC;AAI5E,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI;AAEJ,QAAM,QAAQ,QAAQ,MAAM;AAC1B,SAAK,sBAAsB,kBAAkB,gBAAgB,YAAY,SAAS;AAChF,aAAO,WAAW,0BAA0B;AAAA,IAC9C;AACA,WAAO;AAAA,EACT,GAAG;AAAA,IACD;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,CAAC;AAED,SAAOA,OAAM;AAAA,IACX,OAAO;AAAA,MACL;AAAA,MACA;AAAA,IACF;AAAA,IACA,CAAC,kBAAkB,KAAK;AAAA,EAC1B;AACF;",
|
|
6
|
+
"names": ["React"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { useValidateTypescriptPropTypes } from "@elliemae/ds-legacy-props-helpers";
|
|
3
|
+
import { DSIndeterminateProgressIndicatorName } from "../constants/index.js";
|
|
4
|
+
const useValidateProps = (props, propTypes) => {
|
|
5
|
+
useValidateTypescriptPropTypes(props, propTypes, DSIndeterminateProgressIndicatorName);
|
|
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-legacy-props-helpers';\nimport type { WeakValidationMap } from 'react';\nimport { type DSIndeterminateProgressIndicatorT } from '../react-desc-prop-types.js';\nimport { DSIndeterminateProgressIndicatorName } from '../constants/index.js';\n\nexport const useValidateProps = (\n props: DSIndeterminateProgressIndicatorT.InternalProps,\n propTypes: WeakValidationMap<unknown>,\n): void => {\n // we validate the \"required if\" via 'isRequiredIf from our custom PropTypes\n useValidateTypescriptPropTypes(props, propTypes, DSIndeterminateProgressIndicatorName);\n};\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,sCAAsC;AAG/C,SAAS,4CAA4C;AAE9C,MAAM,mBAAmB,CAC9B,OACA,cACS;AAET,iCAA+B,OAAO,WAAW,oCAAoC;AACvF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { slotObjectToDataTestIds } from "@elliemae/ds-legacy-system";
|
|
3
|
+
const DSIndeterminateProgressIndicatorName = "DSIndeterminateProgressIndicator";
|
|
4
|
+
const DSIndeterminateProgressIndicatorSlots = {
|
|
5
|
+
ROOT: "root",
|
|
6
|
+
LABEL: "label",
|
|
7
|
+
BAR: "bar",
|
|
8
|
+
BAR_INDICATOR: "bar_indicator"
|
|
9
|
+
};
|
|
10
|
+
const DSIndeterminateProgressIndicatorDataTestIds = slotObjectToDataTestIds(
|
|
11
|
+
DSIndeterminateProgressIndicatorName,
|
|
12
|
+
DSIndeterminateProgressIndicatorSlots
|
|
13
|
+
);
|
|
14
|
+
export {
|
|
15
|
+
DSIndeterminateProgressIndicatorDataTestIds,
|
|
16
|
+
DSIndeterminateProgressIndicatorName,
|
|
17
|
+
DSIndeterminateProgressIndicatorSlots
|
|
18
|
+
};
|
|
19
|
+
//# 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-legacy-system';\n\nexport const DSIndeterminateProgressIndicatorName = 'DSIndeterminateProgressIndicator';\n\nexport const DSIndeterminateProgressIndicatorSlots = {\n ROOT: 'root',\n LABEL: 'label',\n BAR: 'bar',\n BAR_INDICATOR: 'bar_indicator',\n};\n\nexport const DSIndeterminateProgressIndicatorDataTestIds = slotObjectToDataTestIds(\n DSIndeterminateProgressIndicatorName,\n DSIndeterminateProgressIndicatorSlots,\n);\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,+BAA+B;AAEjC,MAAM,uCAAuC;AAE7C,MAAM,wCAAwC;AAAA,EACnD,MAAM;AAAA,EACN,OAAO;AAAA,EACP,KAAK;AAAA,EACL,eAAe;AACjB;AAEO,MAAM,8CAA8C;AAAA,EACzD;AAAA,EACA;AACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export * from "./DSIndeterminateProgressIndicator.js";
|
|
3
|
+
import { default as default2 } from "./DSIndeterminateProgressIndicator.js";
|
|
4
|
+
import { DSIndeterminateProgressIndicatorName, DSIndeterminateProgressIndicatorSlots } from "./constants/index.js";
|
|
5
|
+
export {
|
|
6
|
+
DSIndeterminateProgressIndicatorName,
|
|
7
|
+
DSIndeterminateProgressIndicatorSlots,
|
|
8
|
+
default2 as default
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/index.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export * from './DSIndeterminateProgressIndicator.js';\nexport { default } from './DSIndeterminateProgressIndicator.js';\nexport { DSIndeterminateProgressIndicatorName, DSIndeterminateProgressIndicatorSlots } from './constants/index.js';\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB,cAAc;AACd,SAAS,WAAAA,gBAAe;AACxB,SAAS,sCAAsC,6CAA6C;",
|
|
6
|
+
"names": ["default"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { PropTypes, globalAttributesPropTypes, xstyledPropTypes } from "@elliemae/ds-legacy-props-helpers";
|
|
3
|
+
const defaultProps = {
|
|
4
|
+
containerProps: {},
|
|
5
|
+
title: "",
|
|
6
|
+
complete: false,
|
|
7
|
+
failed: false,
|
|
8
|
+
processing: false,
|
|
9
|
+
processingComplete: false,
|
|
10
|
+
processingCompleteTitle: "Complete",
|
|
11
|
+
processingFail: false,
|
|
12
|
+
processingFailTitle: "Fail",
|
|
13
|
+
animated: true,
|
|
14
|
+
percent: 50,
|
|
15
|
+
lineOnly: false
|
|
16
|
+
};
|
|
17
|
+
const DSIndeterminateProgressIndicatorPropTypes = {
|
|
18
|
+
...globalAttributesPropTypes,
|
|
19
|
+
...xstyledPropTypes,
|
|
20
|
+
containerProps: PropTypes.object.description("Set of Properties attached to the main container"),
|
|
21
|
+
title: PropTypes.string.description("component s label"),
|
|
22
|
+
complete: PropTypes.bool.description("Sets the process state to completed").defaultValue(false),
|
|
23
|
+
failed: PropTypes.bool.description("Sets the process state to failed").defaultValue(false),
|
|
24
|
+
processing: PropTypes.bool.description("Sets the process state to processing").defaultValue(false),
|
|
25
|
+
processingComplete: PropTypes.bool.description("Sets the process state to processing and then completed").defaultValue(false),
|
|
26
|
+
processingCompleteTitle: PropTypes.string.description("label to display when the process is completed"),
|
|
27
|
+
processingFail: PropTypes.bool.description("Sets the process state to processing and then failed").defaultValue(false),
|
|
28
|
+
processingFailTitle: PropTypes.string.description("label to display when the process has failed"),
|
|
29
|
+
animated: PropTypes.bool.description("animate or not").defaultValue(true),
|
|
30
|
+
percent: PropTypes.number.description("completion percentage").defaultValue(50),
|
|
31
|
+
lineOnly: PropTypes.bool.description("hide the label from rendering")
|
|
32
|
+
};
|
|
33
|
+
export {
|
|
34
|
+
DSIndeterminateProgressIndicatorPropTypes,
|
|
35
|
+
defaultProps
|
|
36
|
+
};
|
|
37
|
+
//# sourceMappingURL=react-desc-prop-types.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
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 { GlobalAttributesT, XstyledProps } from '@elliemae/ds-legacy-props-helpers';\nimport { PropTypes, globalAttributesPropTypes, xstyledPropTypes } from '@elliemae/ds-legacy-props-helpers';\n\nexport declare namespace DSIndeterminateProgressIndicatorT {\n export interface RequiredProps {}\n\n export interface DefaultProps {\n containerProps: object;\n title: string;\n complete: boolean;\n failed: boolean;\n processing: boolean;\n processingComplete: boolean;\n processingCompleteTitle: string;\n processingFail: boolean;\n processingFailTitle: string;\n animated: boolean;\n percent: number;\n lineOnly: boolean;\n }\n\n export interface OptionalProps {}\n\n export interface Props\n extends Partial<DefaultProps>,\n OptionalProps,\n Omit<GlobalAttributesT<HTMLDivElement>, keyof DefaultProps>,\n XstyledProps,\n RequiredProps {}\n\n export interface InternalProps\n extends DefaultProps,\n OptionalProps,\n Omit<GlobalAttributesT<HTMLDivElement>, keyof DefaultProps>,\n XstyledProps,\n RequiredProps {}\n}\n\nexport const defaultProps: DSIndeterminateProgressIndicatorT.DefaultProps = {\n containerProps: {},\n title: '',\n complete: false,\n failed: false,\n processing: false,\n processingComplete: false,\n processingCompleteTitle: 'Complete',\n processingFail: false,\n processingFailTitle: 'Fail',\n animated: true,\n percent: 50,\n lineOnly: false,\n};\n\nexport const DSIndeterminateProgressIndicatorPropTypes = {\n ...globalAttributesPropTypes,\n ...xstyledPropTypes,\n containerProps: PropTypes.object.description('Set of Properties attached to the main container'),\n title: PropTypes.string.description('component s label'),\n complete: PropTypes.bool.description('Sets the process state to completed').defaultValue(false),\n failed: PropTypes.bool.description('Sets the process state to failed').defaultValue(false),\n processing: PropTypes.bool.description('Sets the process state to processing').defaultValue(false),\n processingComplete: PropTypes.bool\n .description('Sets the process state to processing and then completed')\n .defaultValue(false),\n processingCompleteTitle: PropTypes.string.description('label to display when the process is completed'),\n processingFail: PropTypes.bool\n .description('Sets the process state to processing and then failed')\n .defaultValue(false),\n processingFailTitle: PropTypes.string.description('label to display when the process has failed'),\n animated: PropTypes.bool.description('animate or not').defaultValue(true),\n percent: PropTypes.number.description('completion percentage').defaultValue(50),\n lineOnly: PropTypes.bool.description('hide the label from rendering'),\n} as React.WeakValidationMap<unknown>;\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACCvB,SAAS,WAAW,2BAA2B,wBAAwB;AAqChE,MAAM,eAA+D;AAAA,EAC1E,gBAAgB,CAAC;AAAA,EACjB,OAAO;AAAA,EACP,UAAU;AAAA,EACV,QAAQ;AAAA,EACR,YAAY;AAAA,EACZ,oBAAoB;AAAA,EACpB,yBAAyB;AAAA,EACzB,gBAAgB;AAAA,EAChB,qBAAqB;AAAA,EACrB,UAAU;AAAA,EACV,SAAS;AAAA,EACT,UAAU;AACZ;AAEO,MAAM,4CAA4C;AAAA,EACvD,GAAG;AAAA,EACH,GAAG;AAAA,EACH,gBAAgB,UAAU,OAAO,YAAY,kDAAkD;AAAA,EAC/F,OAAO,UAAU,OAAO,YAAY,mBAAmB;AAAA,EACvD,UAAU,UAAU,KAAK,YAAY,qCAAqC,EAAE,aAAa,KAAK;AAAA,EAC9F,QAAQ,UAAU,KAAK,YAAY,kCAAkC,EAAE,aAAa,KAAK;AAAA,EACzF,YAAY,UAAU,KAAK,YAAY,sCAAsC,EAAE,aAAa,KAAK;AAAA,EACjG,oBAAoB,UAAU,KAC3B,YAAY,yDAAyD,EACrE,aAAa,KAAK;AAAA,EACrB,yBAAyB,UAAU,OAAO,YAAY,gDAAgD;AAAA,EACtG,gBAAgB,UAAU,KACvB,YAAY,sDAAsD,EAClE,aAAa,KAAK;AAAA,EACrB,qBAAqB,UAAU,OAAO,YAAY,8CAA8C;AAAA,EAChG,UAAU,UAAU,KAAK,YAAY,gBAAgB,EAAE,aAAa,IAAI;AAAA,EACxE,SAAS,UAAU,OAAO,YAAY,uBAAuB,EAAE,aAAa,EAAE;AAAA,EAC9E,UAAU,UAAU,KAAK,YAAY,+BAA+B;AACtE;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { css, kfrm, styled } from "@elliemae/ds-legacy-system";
|
|
3
|
+
import { DSTruncatedTooltipText } from "@elliemae/ds-legacy-truncated-tooltip-text";
|
|
4
|
+
import { DSIndeterminateProgressIndicatorName, DSIndeterminateProgressIndicatorSlots } from "./constants/index.js";
|
|
5
|
+
const IndeterminateAnimation = (color) => kfrm`
|
|
6
|
+
0% {
|
|
7
|
+
transform: scaleX(0.015);
|
|
8
|
+
transform-origin: 0% 0%;
|
|
9
|
+
background-image: linear-gradient(to right, rgba(255,255,255,0.8) 10%, ${color});
|
|
10
|
+
}
|
|
11
|
+
25% {
|
|
12
|
+
transform: scaleX(0.4);
|
|
13
|
+
}
|
|
14
|
+
50% {
|
|
15
|
+
transform: scaleX(0.015);
|
|
16
|
+
transform-origin: 100% 0%;
|
|
17
|
+
background-image: linear-gradient(to right, rgba(255,255,255,0.8) 10%, ${color});
|
|
18
|
+
}
|
|
19
|
+
50.1% {
|
|
20
|
+
transform: scaleX(0.015);
|
|
21
|
+
transform-origin: 100% 0%;
|
|
22
|
+
background-image: linear-gradient(to left, rgba(255,255,255,0.8) 10%, ${color});
|
|
23
|
+
}
|
|
24
|
+
75% {
|
|
25
|
+
transform: scaleX(0.4);
|
|
26
|
+
}
|
|
27
|
+
100% {
|
|
28
|
+
transform: scaleX(0.015);
|
|
29
|
+
transform-origin: 0% 0%;
|
|
30
|
+
background-image: linear-gradient(to left, rgba(255,255,255,0.8) 10%, ${color});
|
|
31
|
+
}
|
|
32
|
+
`;
|
|
33
|
+
const ProcessingSuccess = kfrm`
|
|
34
|
+
0%, 30% { transform: translateX(-50%); width: 50% }
|
|
35
|
+
15% { transform: translateX(150%); width: 50% }
|
|
36
|
+
0%, 60% { transform: translateX(-50%); width: 50% }
|
|
37
|
+
45% { transform: translateX(150%); width: 50% }
|
|
38
|
+
0%, 90% { transform: translateX(-50%); width: 50% }
|
|
39
|
+
75% { transform: translateX(150%); width: 50% }
|
|
40
|
+
100% { transform: translateX(0%); }
|
|
41
|
+
`;
|
|
42
|
+
const ProcessingSuccessEnd = (color) => kfrm`
|
|
43
|
+
0% { transform: translateX(-50%); width: 50% }
|
|
44
|
+
45% { transform: translateX(150%); width: 50% }
|
|
45
|
+
100% { transform: translateX(0%); background-color: ${color}; }
|
|
46
|
+
`;
|
|
47
|
+
const ProcessingFail = kfrm`
|
|
48
|
+
0%, 30% { transform: translateX(-50%); width: 50% }
|
|
49
|
+
15% { transform: translateX(150%); width: 50% }
|
|
50
|
+
0%, 60% { transform: translateX(-50%); width: 50% }
|
|
51
|
+
45% { transform: translateX(150%); width: 50% }
|
|
52
|
+
0%, 90% { transform: translateX(-50%); width: 50% }
|
|
53
|
+
75% { transform: translateX(150%); width: 50%; }
|
|
54
|
+
100% { transform: translateX(0%); }
|
|
55
|
+
`;
|
|
56
|
+
const ProcessingFailEnd = kfrm`
|
|
57
|
+
0% { transform: translateX(-50%); width: 50% }
|
|
58
|
+
45% { transform: translateX(150%); width: 50% }
|
|
59
|
+
100% { transform: translateX(0%); background-color: #e34256; }
|
|
60
|
+
`;
|
|
61
|
+
const Container = styled("div", {
|
|
62
|
+
name: DSIndeterminateProgressIndicatorName,
|
|
63
|
+
slot: DSIndeterminateProgressIndicatorSlots.ROOT
|
|
64
|
+
})`
|
|
65
|
+
width: 100%;
|
|
66
|
+
padding: ${({ theme, lineOnly }) => lineOnly ? 0 : `${theme.space.xxs} ${theme.space.xs}`};
|
|
67
|
+
`;
|
|
68
|
+
const StyledTruncatedTooltipText = styled(DSTruncatedTooltipText, {
|
|
69
|
+
name: DSIndeterminateProgressIndicatorName,
|
|
70
|
+
slot: DSIndeterminateProgressIndicatorSlots.LABEL
|
|
71
|
+
})``;
|
|
72
|
+
const Bar = styled("div", {
|
|
73
|
+
name: DSIndeterminateProgressIndicatorName,
|
|
74
|
+
slot: DSIndeterminateProgressIndicatorSlots.BAR
|
|
75
|
+
})`
|
|
76
|
+
background-color: ${({ theme }) => theme.colors.neutral[100]};
|
|
77
|
+
overflow: hidden;
|
|
78
|
+
`;
|
|
79
|
+
const BarIndicator = styled("div", {
|
|
80
|
+
name: DSIndeterminateProgressIndicatorName,
|
|
81
|
+
slot: DSIndeterminateProgressIndicatorSlots.BAR_INDICATOR
|
|
82
|
+
})`
|
|
83
|
+
height: ${({ theme }) => theme.space.xxxs};
|
|
84
|
+
width: ${({ complete, failed, animated, processing, percent }) => `${!complete && !failed && !animated && processing ? percent : 100}%`};
|
|
85
|
+
${({ theme, complete, failed, processing, animated, processingComplete, processingFail }) => {
|
|
86
|
+
if (!complete && !failed && !processing && !processingComplete && !processingFail)
|
|
87
|
+
return css`
|
|
88
|
+
background-color: ${theme.colors.neutral[500]};
|
|
89
|
+
`;
|
|
90
|
+
else if (complete && processing)
|
|
91
|
+
return css`
|
|
92
|
+
width: 100%;
|
|
93
|
+
background-color: ${theme.colors.brand[500]};
|
|
94
|
+
animation: ${ProcessingSuccessEnd(theme.colors.success[900])} 1s ease-in-out;
|
|
95
|
+
animation-fill-mode: forwards;
|
|
96
|
+
`;
|
|
97
|
+
else if (complete && !processingComplete && !processing)
|
|
98
|
+
return css`
|
|
99
|
+
background-color: ${theme.colors.success[900]};
|
|
100
|
+
`;
|
|
101
|
+
else if (failed && !processingFail && !processing)
|
|
102
|
+
return css`
|
|
103
|
+
background-color: #e34256;
|
|
104
|
+
`;
|
|
105
|
+
else if (processing) {
|
|
106
|
+
if (animated) {
|
|
107
|
+
return css`
|
|
108
|
+
width: 100%;
|
|
109
|
+
animation: ${IndeterminateAnimation(theme.colors.brand[500])} 2s cubic-bezier(0.645, 0.045, 0.355, 1) infinite;
|
|
110
|
+
background-color: ${theme.colors.brand[500]};
|
|
111
|
+
`;
|
|
112
|
+
}
|
|
113
|
+
return css`
|
|
114
|
+
background-color: ${theme.colors.brand[500]};
|
|
115
|
+
`;
|
|
116
|
+
} else if (processingComplete && !complete) {
|
|
117
|
+
return css`
|
|
118
|
+
width: 50%;
|
|
119
|
+
animation: ${ProcessingSuccess} 4s infinite;
|
|
120
|
+
animation-fill-mode: forwards;
|
|
121
|
+
background-color: ${theme.colors.brand[500]};
|
|
122
|
+
`;
|
|
123
|
+
} else if (processingComplete && complete)
|
|
124
|
+
return css`
|
|
125
|
+
width: 100%;
|
|
126
|
+
background-color: ${theme.colors.brand[500]};
|
|
127
|
+
animation: ${ProcessingSuccessEnd(theme.colors.success[900])} 1s ease-in-out;
|
|
128
|
+
animation-fill-mode: forwards;
|
|
129
|
+
`;
|
|
130
|
+
else if (processingFail && !failed)
|
|
131
|
+
return css`
|
|
132
|
+
width: 50%;
|
|
133
|
+
animation: ${ProcessingFail} 4s infinite;
|
|
134
|
+
animation-fill-mode: forwards;
|
|
135
|
+
background-color: ${theme.colors.brand[500]};
|
|
136
|
+
`;
|
|
137
|
+
else if (processingFail && failed)
|
|
138
|
+
return css`
|
|
139
|
+
width: 100%;
|
|
140
|
+
background-color: ${theme.colors.brand[500]};
|
|
141
|
+
animation: ${ProcessingFailEnd} 1s ease-in-out;
|
|
142
|
+
animation-fill-mode: forwards;
|
|
143
|
+
`;
|
|
144
|
+
}};
|
|
145
|
+
`;
|
|
146
|
+
export {
|
|
147
|
+
Bar,
|
|
148
|
+
BarIndicator,
|
|
149
|
+
Container,
|
|
150
|
+
StyledTruncatedTooltipText
|
|
151
|
+
};
|
|
152
|
+
//# sourceMappingURL=styled.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/styled.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable complexity */\nimport { css, kfrm, styled } from '@elliemae/ds-legacy-system';\nimport { type DSIndeterminateProgressIndicatorT } from './react-desc-prop-types.js';\nimport { DSTruncatedTooltipText } from '@elliemae/ds-legacy-truncated-tooltip-text';\nimport { DSIndeterminateProgressIndicatorName, DSIndeterminateProgressIndicatorSlots } from './constants/index.js';\n\nconst IndeterminateAnimation = (color: string) => kfrm`\n 0% {\n transform: scaleX(0.015);\n transform-origin: 0% 0%;\n background-image: linear-gradient(to right, rgba(255,255,255,0.8) 10%, ${color});\n }\n 25% {\n transform: scaleX(0.4);\n }\n 50% {\n transform: scaleX(0.015);\n transform-origin: 100% 0%;\n background-image: linear-gradient(to right, rgba(255,255,255,0.8) 10%, ${color});\n }\n 50.1% {\n transform: scaleX(0.015);\n transform-origin: 100% 0%;\n background-image: linear-gradient(to left, rgba(255,255,255,0.8) 10%, ${color});\n }\n 75% {\n transform: scaleX(0.4);\n }\n 100% {\n transform: scaleX(0.015);\n transform-origin: 0% 0%;\n background-image: linear-gradient(to left, rgba(255,255,255,0.8) 10%, ${color});\n }\n`;\n\nconst ProcessingSuccess = kfrm`\n 0%, 30% { transform: translateX(-50%); width: 50% }\n 15% { transform: translateX(150%); width: 50% }\n 0%, 60% { transform: translateX(-50%); width: 50% }\n 45% { transform: translateX(150%); width: 50% }\n 0%, 90% { transform: translateX(-50%); width: 50% }\n 75% { transform: translateX(150%); width: 50% }\n 100% { transform: translateX(0%); }\n`;\n\nconst ProcessingSuccessEnd = (color: string) => kfrm`\n 0% { transform: translateX(-50%); width: 50% }\n 45% { transform: translateX(150%); width: 50% }\n 100% { transform: translateX(0%); background-color: ${color}; }\n`;\n\nconst ProcessingFail = kfrm`\n 0%, 30% { transform: translateX(-50%); width: 50% }\n 15% { transform: translateX(150%); width: 50% }\n 0%, 60% { transform: translateX(-50%); width: 50% }\n 45% { transform: translateX(150%); width: 50% }\n 0%, 90% { transform: translateX(-50%); width: 50% }\n 75% { transform: translateX(150%); width: 50%; }\n 100% { transform: translateX(0%); }\n`;\n\nconst ProcessingFailEnd = kfrm`\n 0% { transform: translateX(-50%); width: 50% }\n 45% { transform: translateX(150%); width: 50% }\n 100% { transform: translateX(0%); background-color: #e34256; }\n`;\n\nexport const Container = styled('div', {\n name: DSIndeterminateProgressIndicatorName,\n slot: DSIndeterminateProgressIndicatorSlots.ROOT,\n})<DSIndeterminateProgressIndicatorT.Props>`\n width: 100%;\n padding: ${({ theme, lineOnly }) => (lineOnly ? 0 : `${theme.space.xxs} ${theme.space.xs}`)};\n`;\n\nexport const StyledTruncatedTooltipText = styled(DSTruncatedTooltipText, {\n name: DSIndeterminateProgressIndicatorName,\n slot: DSIndeterminateProgressIndicatorSlots.LABEL,\n})``;\n\nexport const Bar = styled('div', {\n name: DSIndeterminateProgressIndicatorName,\n slot: DSIndeterminateProgressIndicatorSlots.BAR,\n})`\n background-color: ${({ theme }) => theme.colors.neutral[100]};\n overflow: hidden;\n`;\n\nexport const BarIndicator = styled('div', {\n name: DSIndeterminateProgressIndicatorName,\n slot: DSIndeterminateProgressIndicatorSlots.BAR_INDICATOR,\n})<DSIndeterminateProgressIndicatorT.Props>`\n height: ${({ theme }) => theme.space.xxxs};\n width: ${({ complete, failed, animated, processing, percent }) =>\n `${!complete && !failed && !animated && processing ? percent : 100}%`};\n ${({ theme, complete, failed, processing, animated, processingComplete, processingFail }) => {\n // Default\n if (!complete && !failed && !processing && !processingComplete && !processingFail)\n return css`\n background-color: ${theme.colors.neutral[500]};\n `;\n // Completed\n else if (complete && processing)\n return css`\n width: 100%;\n background-color: ${theme.colors.brand[500]};\n animation: ${ProcessingSuccessEnd(theme.colors.success[900])} 1s ease-in-out;\n animation-fill-mode: forwards;\n `;\n else if (complete && !processingComplete && !processing)\n return css`\n background-color: ${theme.colors.success[900]};\n `;\n // Failed\n else if (failed && !processingFail && !processing)\n return css`\n background-color: #e34256;\n `;\n // Processing\n else if (processing) {\n if (animated) {\n return css`\n width: 100%;\n animation: ${IndeterminateAnimation(theme.colors.brand[500])} 2s cubic-bezier(0.645, 0.045, 0.355, 1) infinite;\n background-color: ${theme.colors.brand[500]};\n `;\n }\n return css`\n background-color: ${theme.colors.brand[500]};\n `;\n }\n // Processing -> Completed\n else if (processingComplete && !complete) {\n return css`\n width: 50%;\n animation: ${ProcessingSuccess} 4s infinite;\n animation-fill-mode: forwards;\n background-color: ${theme.colors.brand[500]};\n `;\n } else if (processingComplete && complete)\n return css`\n width: 100%;\n background-color: ${theme.colors.brand[500]};\n animation: ${ProcessingSuccessEnd(theme.colors.success[900])} 1s ease-in-out;\n animation-fill-mode: forwards;\n `;\n // Processing -> Failed\n else if (processingFail && !failed)\n return css`\n width: 50%;\n animation: ${ProcessingFail} 4s infinite;\n animation-fill-mode: forwards;\n background-color: ${theme.colors.brand[500]};\n `;\n else if (processingFail && failed)\n return css`\n width: 100%;\n background-color: ${theme.colors.brand[500]};\n animation: ${ProcessingFailEnd} 1s ease-in-out;\n animation-fill-mode: forwards;\n `;\n }};\n`;\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACCvB,SAAS,KAAK,MAAM,cAAc;AAElC,SAAS,8BAA8B;AACvC,SAA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6 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type DSIndeterminateProgressIndicatorT } from './react-desc-prop-types.js';
|
|
3
|
+
declare const DSIndeterminateProgressIndicator: React.ComponentType<DSIndeterminateProgressIndicatorT.Props>;
|
|
4
|
+
declare const IndeterminateProgressIndicatorWithSchema: import("@elliemae/ds-legacy-props-helpers/dist/types/propTypes/types.js").DocumentedReactComponent<DSIndeterminateProgressIndicatorT.Props>;
|
|
5
|
+
export { DSIndeterminateProgressIndicator, IndeterminateProgressIndicatorWithSchema };
|
|
6
|
+
export default DSIndeterminateProgressIndicator;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type DSIndeterminateProgressIndicatorT } from '../react-desc-prop-types.js';
|
|
2
|
+
export interface IndeterminateProgressIndicatorCTX {
|
|
3
|
+
propsWithDefault: DSIndeterminateProgressIndicatorT.InternalProps;
|
|
4
|
+
}
|
|
5
|
+
export declare const useIndeterminateProgressIndicator: (propsFromUser: DSIndeterminateProgressIndicatorT.Props) => {
|
|
6
|
+
propsWithDefault: DSIndeterminateProgressIndicatorT.InternalProps;
|
|
7
|
+
label: string;
|
|
8
|
+
};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { WeakValidationMap } from 'react';
|
|
2
|
+
import { type DSIndeterminateProgressIndicatorT } from '../react-desc-prop-types.js';
|
|
3
|
+
export declare const useValidateProps: (props: DSIndeterminateProgressIndicatorT.InternalProps, propTypes: WeakValidationMap<unknown>) => void;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare const DSIndeterminateProgressIndicatorName = "DSIndeterminateProgressIndicator";
|
|
2
|
+
export declare const DSIndeterminateProgressIndicatorSlots: {
|
|
3
|
+
ROOT: string;
|
|
4
|
+
LABEL: string;
|
|
5
|
+
BAR: string;
|
|
6
|
+
BAR_INDICATOR: string;
|
|
7
|
+
};
|
|
8
|
+
export declare const DSIndeterminateProgressIndicatorDataTestIds: Record<string, string>;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { GlobalAttributesT, XstyledProps } from '@elliemae/ds-legacy-props-helpers';
|
|
3
|
+
export declare namespace DSIndeterminateProgressIndicatorT {
|
|
4
|
+
interface RequiredProps {
|
|
5
|
+
}
|
|
6
|
+
interface DefaultProps {
|
|
7
|
+
containerProps: object;
|
|
8
|
+
title: string;
|
|
9
|
+
complete: boolean;
|
|
10
|
+
failed: boolean;
|
|
11
|
+
processing: boolean;
|
|
12
|
+
processingComplete: boolean;
|
|
13
|
+
processingCompleteTitle: string;
|
|
14
|
+
processingFail: boolean;
|
|
15
|
+
processingFailTitle: string;
|
|
16
|
+
animated: boolean;
|
|
17
|
+
percent: number;
|
|
18
|
+
lineOnly: boolean;
|
|
19
|
+
}
|
|
20
|
+
interface OptionalProps {
|
|
21
|
+
}
|
|
22
|
+
interface Props extends Partial<DefaultProps>, OptionalProps, Omit<GlobalAttributesT<HTMLDivElement>, keyof DefaultProps>, XstyledProps, RequiredProps {
|
|
23
|
+
}
|
|
24
|
+
interface InternalProps extends DefaultProps, OptionalProps, Omit<GlobalAttributesT<HTMLDivElement>, keyof DefaultProps>, XstyledProps, RequiredProps {
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
export declare const defaultProps: DSIndeterminateProgressIndicatorT.DefaultProps;
|
|
28
|
+
export declare const DSIndeterminateProgressIndicatorPropTypes: import("react").WeakValidationMap<unknown>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { type DSIndeterminateProgressIndicatorT } from './react-desc-prop-types.js';
|
|
3
|
+
export declare const Container: import("styled-components").StyledComponent<"div", import("@elliemae/ds-legacy-system").Theme, DSIndeterminateProgressIndicatorT.Props & import("@elliemae/ds-legacy-system").OwnerInterface, never>;
|
|
4
|
+
export declare const StyledTruncatedTooltipText: import("styled-components").StyledComponent<keyof JSX.IntrinsicElements | import("react").ComponentType<any> | import("styled-components").AnyStyledComponent, import("@elliemae/ds-legacy-system").Theme, object & import("@elliemae/ds-legacy-system").OwnerInterface, never>;
|
|
5
|
+
export declare const Bar: import("styled-components").StyledComponent<"div", import("@elliemae/ds-legacy-system").Theme, object & import("@elliemae/ds-legacy-system").OwnerInterface, never>;
|
|
6
|
+
export declare const BarIndicator: import("styled-components").StyledComponent<"div", import("@elliemae/ds-legacy-system").Theme, DSIndeterminateProgressIndicatorT.Props & import("@elliemae/ds-legacy-system").OwnerInterface, never>;
|