@elliemae/ds-wizard 3.35.0 → 3.36.0-next.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.
@@ -44,10 +44,8 @@ const WizardStep = (props) => {
44
44
  import_react_desc_prop_types.defaultStepProps
45
45
  );
46
46
  const currentIcon = (0, import_react.useMemo)(() => {
47
- if (active && iconActive)
48
- return iconActive;
49
- if (completed && iconCompleted)
50
- return iconCompleted;
47
+ if (active && iconActive) return iconActive;
48
+ if (completed && iconCompleted) return iconCompleted;
51
49
  return icon;
52
50
  }, [active, completed, icon, iconActive, iconCompleted]);
53
51
  const iconWithOptions = (0, import_react.useMemo)(
@@ -61,10 +59,8 @@ const WizardStep = (props) => {
61
59
  );
62
60
  const itemClassName = (0, import_react.useMemo)(() => {
63
61
  let className = "em-ds-wizard-steps-indicator-step em-ds-wizard-steps-indicator-step--default";
64
- if (active)
65
- className += " em-ds-wizard-steps-indicator-step--active";
66
- if (completed)
67
- className += " em-ds-wizard-steps-indicator-step--completed";
62
+ if (active) className += " em-ds-wizard-steps-indicator-step--active";
63
+ if (completed) className += " em-ds-wizard-steps-indicator-step--completed";
68
64
  return className;
69
65
  }, [active, completed]);
70
66
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_styled.StyledItem, { className: itemClassName, active, completed, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_styled.StyledWrapper, { className: "em-ds-wizard-steps-indicator-step-wrapper", children: [
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../src/WizardStep.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
4
4
  "sourcesContent": ["import React, { cloneElement, useMemo, isValidElement } from 'react';\nimport { describe, useMemoMergePropsWithDefault } from '@elliemae/ds-props-helpers';\nimport { DSWizardStepPropsTypesSchema, defaultStepProps, type DSWizardT } from './react-desc-prop-types.js';\nimport { StyledBullet, StyledBulletWrapper, StyledItem, StyledLabel, StyledWrapper } from './styled.js';\n\nconst WizardStep = (props: DSWizardT.StepProps) => {\n const { label, icon, iconCompleted, iconActive, active, completed, index } = useMemoMergePropsWithDefault(\n props,\n defaultStepProps,\n );\n\n const currentIcon = useMemo(() => {\n if (active && iconActive) return iconActive;\n if (completed && iconCompleted) return iconCompleted;\n return icon;\n }, [active, completed, icon, iconActive, iconCompleted]);\n\n const iconWithOptions = useMemo(\n () =>\n isValidElement<{ color: [string, string] }>(currentIcon)\n ? cloneElement(currentIcon, {\n color: ((currentIcon?.props as Record<string, unknown>)?.color as [string, string]) ?? [\n 'brand-primary',\n completed ? '600' : '500',\n ],\n })\n : currentIcon || index + 1,\n [completed, currentIcon, index],\n );\n\n const itemClassName = useMemo(() => {\n let className = 'em-ds-wizard-steps-indicator-step em-ds-wizard-steps-indicator-step--default';\n if (active) className += ' em-ds-wizard-steps-indicator-step--active';\n if (completed) className += ' em-ds-wizard-steps-indicator-step--completed';\n return className;\n }, [active, completed]);\n\n return (\n <StyledItem className={itemClassName} active={active} completed={completed}>\n <StyledWrapper className=\"em-ds-wizard-steps-indicator-step-wrapper\">\n <StyledBulletWrapper className=\"em-ds-wizard-steps-indicator-step__bullet-wrapper\">\n <StyledBullet className=\"em-ds-wizard-steps-indicator-step__bullet\">{iconWithOptions}</StyledBullet>\n </StyledBulletWrapper>\n <StyledLabel className=\"em-ds-wizard-steps-indicator-step__label\">{label}</StyledLabel>\n </StyledWrapper>\n </StyledItem>\n );\n};\n\nWizardStep.displayName = 'WizardStep';\nconst WizzardStepWithSchema = describe(WizardStep);\nWizzardStepWithSchema.propTypes = DSWizardStepPropsTypesSchema;\n\nexport { WizzardStepWithSchema };\nexport default WizardStep;\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADuCjB;AAvCN,mBAA6D;AAC7D,8BAAuD;AACvD,mCAA+E;AAC/E,oBAA0F;AAE1F,M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EAAE,OAAO,MAAM,eAAe,YAAY,QAAQ,WAAW,MAAM,QAAI;AAAA,IAC3E;AAAA,IACA;AAAA,EACF;AAEA,QAAM,kBAAc,sBAAQ,MAAM;AAChC,QAAI,UAAU,WAAY,QAAO;AACjC,QAAI,aAAa,cAAe,QAAO;AACvC,WAAO;AAAA,EACT,GAAG,CAAC,QAAQ,WAAW,MAAM,YAAY,aAAa,CAAC;AAEvD,QAAM,sBAAkB;AAAA,IACtB,UACE,6BAA4C,WAAW,QACnD,2BAAa,aAAa;AAAA,MACxB,OAAS,aAAa,OAAmC,SAA8B;AAAA,QACrF;AAAA,QACA,YAAY,QAAQ;AAAA,MACtB;AAAA,IACF,CAAC,IACD,eAAe,QAAQ;AAAA,IAC7B,CAAC,WAAW,aAAa,KAAK;AAAA,EAChC;AAEA,QAAM,oBAAgB,sBAAQ,MAAM;AAClC,QAAI,YAAY;AAChB,QAAI,OAAQ,cAAa;AACzB,QAAI,UAAW,cAAa;AAC5B,WAAO;AAAA,EACT,GAAG,CAAC,QAAQ,SAAS,CAAC;AAEtB,SACE,4CAAC,4BAAW,WAAW,eAAe,QAAgB,WACpD,uDAAC,+BAAc,WAAU,6CACvB;AAAA,gDAAC,qCAAoB,WAAU,qDAC7B,sDAAC,8BAAa,WAAU,6CAA6C,2BAAgB,GACvF;AAAA,IACA,4CAAC,6BAAY,WAAU,4CAA4C,iBAAM;AAAA,KAC3E,GACF;AAEJ;AAEA,WAAW,cAAc;AACzB,MAAM,4BAAwB,kCAAS,UAAU;AACjD,sBAAsB,YAAY;AAGlC,IAAO,qBAAQ;",
6
6
  "names": []
7
7
  }
@@ -51,8 +51,7 @@ const WizardSteps = (props) => {
51
51
  completed: index < current
52
52
  });
53
53
  return steps ? steps.map((step, index) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_WizardStep.default, { ...step, ...mergeStepProps(index) }, index)) : import_react.default.Children.map(children, (item, index) => {
54
- if (item === void 0)
55
- return null;
54
+ if (item === void 0) return null;
56
55
  return (0, import_react.cloneElement)(item, mergeStepProps(index));
57
56
  });
58
57
  }, [current, children, steps]);
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../src/WizardSteps.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
4
4
  "sourcesContent": ["import React, { cloneElement, useMemo } from 'react';\nimport {\n describe,\n useGetGlobalAttributes,\n useGetXstyledProps,\n useMemoMergePropsWithDefault,\n} from '@elliemae/ds-props-helpers';\nimport WizardStep from './WizardStep.js';\nimport { DSWizardPropTypesSchema, defaultProps, type DSWizardT } from './react-desc-prop-types.js';\nimport { StyledStepsWrapper } from './styled.js';\n\nconst WizardSteps = (props: DSWizardT.Props) => {\n const propsWithDefault = useMemoMergePropsWithDefault<DSWizardT.InternalProps>(props, defaultProps);\n\n const xstyledProps = useGetXstyledProps(propsWithDefault);\n\n const globalAttributes = useGetGlobalAttributes(propsWithDefault);\n\n const { children, steps, current } = propsWithDefault;\n\n const items = useMemo(() => {\n const mergeStepProps = (index: number) => ({\n index,\n active: current === index,\n completed: index < current,\n });\n\n return steps\n ? steps.map((step, index) => <WizardStep key={index} {...step} {...mergeStepProps(index)} />)\n : React.Children.map(children, (item, index) => {\n if (item === undefined) return null;\n return cloneElement(item, mergeStepProps(index));\n });\n }, [current, children, steps]);\n\n return (\n <StyledStepsWrapper className=\"em-ds-wizard-steps-indicator\" {...xstyledProps} {...globalAttributes}>\n {items}\n </StyledStepsWrapper>\n );\n};\n\nWizardSteps.Item = WizardStep;\n\nWizardSteps.displayName = 'WizardSteps';\nconst WizzardWithSchema = describe(WizardSteps);\nWizzardWithSchema.propTypes = DSWizardPropTypesSchema;\n\nexport { WizzardWithSchema };\nexport default WizardSteps;\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;AD4BY;AA5BnC,mBAA6C;AAC7C,8BAKO;AACP,wBAAu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AAM,EAAE,UAAU,OAAO,QAAQ,IAAI;AAErC,QAAM,YAAQ,sBAAQ,MAAM;AAC1B,UAAM,iBAAiB,CAAC,WAAmB;AAAA,MACzC;AAAA,MACA,QAAQ,YAAY;AAAA,MACpB,WAAW,QAAQ;AAAA,IACrB;AAEA,WAAO,QACH,MAAM,IAAI,CAAC,MAAM,UAAU,4CAAC,kBAAAA,SAAA,EAAwB,GAAG,MAAO,GAAG,eAAe,KAAK,KAAzC,KAA4C,CAAE,IAC1F,aAAAC,QAAM,SAAS,IAAI,UAAU,CAAC,MAAM,UAAU;AAC5C,UAAI,SAAS,OAAW,QAAO;AAC/B,iBAAO,2BAAa,MAAM,eAAe,KAAK,CAAC;AAAA,IACjD,CAAC;AAAA,EACP,GAAG,CAAC,SAAS,UAAU,KAAK,CAAC;AAE7B,SACE,4CAAC,oCAAmB,WAAU,gCAAgC,GAAG,cAAe,GAAG,kBAChF,iBACH;AAEJ;AAEA,YAAY,OAAO,kBAAAD;AAEnB,YAAY,cAAc;AAC1B,MAAM,wBAAoB,kCAAS,WAAW;AAC9C,kBAAkB,YAAY;AAG9B,IAAO,sBAAQ;",
6
6
  "names": ["WizardStep", "React"]
7
7
  }
@@ -101,8 +101,7 @@ const StyledItem = import_ds_system.styled.div`
101
101
  }
102
102
 
103
103
  ${({ active, theme }) => {
104
- if (!active)
105
- return "";
104
+ if (!active) return "";
106
105
  return `
107
106
  ${StyledBullet} {
108
107
  border-color: ${import_ds_system.th.color("brand-700")({ theme })};
@@ -118,8 +117,7 @@ const StyledItem = import_ds_system.styled.div`
118
117
  }}
119
118
 
120
119
  ${({ completed, theme }) => {
121
- if (!completed)
122
- return "";
120
+ if (!completed) return "";
123
121
  return `
124
122
  ${StyledBullet} {
125
123
  border-color: ${import_ds_system.th.color("brand-600")({ theme })};
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../src/styled.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
4
4
  "sourcesContent": ["import { styled, th, xStyledCommonProps } from '@elliemae/ds-system';\n\nexport const StyledWrapper = styled.div`\n display: flex;\n flex-direction: column;\n align-items: center;\n width: 100%;\n`;\nexport const StyledLabel = styled.span`\n font-size: 1.0769rem;\n line-height: normal;\n font-weight: 400;\n color: neutral-500;\n transition: all 200ms cubic-bezier(0.36, 0, 1, 1);\n text-align: center;\n width: 100%;\n max-height: 36px;\n`;\nexport const StyledBulletWrapper = styled.div`\n display: flex;\n justify-content: center;\n position: relative;\n width: 100%;\n`;\nexport const StyledBullet = styled.div`\n margin: 8px;\n font-size: 1.2307rem;\n width: 2.46154rem;\n height: 2.46154rem;\n border-radius: 50%;\n border: 1px solid #cbcfd7;\n color: brand-600;\n position: relative;\n transition: all 200ms cubic-bezier(0.36, 0, 1, 1);\n display: flex;\n justify-content: center;\n align-items: center;\n`;\nexport const StyledItem = styled.div<{ active: boolean; completed: boolean }>`\n display: flex;\n justify-content: center;\n flex: 1 1 0px;\n min-width: 96px;\n max-width: 144px;\n margin: 0 8px;\n\n &:not(:last-child) {\n ${StyledBulletWrapper}::after {\n margin: 0 5px;\n position: absolute;\n top: 50%;\n left: calc(62%);\n display: block;\n width: 80%;\n content: '';\n transition: all 300ms cubic-bezier(0.36, 0, 1, 1);\n height: 1px;\n background-image: linear-gradient(to right, #cbcfd7 40%, rgba(255, 255, 255, 0) 0%);\n background-position: top;\n background-size: 3px 1px;\n background-repeat: repeat-x;\n }\n }\n\n ${({ active, theme }) => {\n if (!active) return '';\n return `\n ${StyledBullet} {\n border-color: ${th.color('brand-700')({ theme })};\n color: ${th.color('brand-700')({ theme })};\n font-weight: bold;\n border-width: 1.5px;\n }\n ${StyledLabel} {\n color: ${th.color('brand-700')({ theme })};\n font-weight: bold;\n }\n `;\n }}\n\n ${({ completed, theme }) => {\n if (!completed) return '';\n return `\n ${StyledBullet} {\n border-color: ${th.color('brand-600')({ theme })};\n }\n ${StyledLabel} {\n color: ${th.color('neutral-800')({ theme })};\n }\n &:not(:last-child) {\n ${StyledBulletWrapper}::after {\n background: ${th.color('brand-700')({ theme })};\n background-size: initial;\n }\n }\n `;\n }}\n`;\n\nexport const StyledStepsWrapper = styled.div`\n display: flex;\n justify-content: center;\n overflow: hidden;\n ${xStyledCommonProps}\n`;\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,uBAA+C;AAExC,MAAM,gBAAgB,wBAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAM7B,MAAM,cAAc,wBAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAU3B,MAAM,sBAAsB,wBAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAMnC,MAAM,eAAe,wBAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAc5B,MAAM,aAAa,wBAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MAS3B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAiBF,CAAC,EAAE,QAAQ,MAAM,MAAM;AACvB,MAAI,CAAC;AAAQ,WAAO;AACpB,SAAO;AAAA,MACL;AAAA,sBACgB,oBAAG,MAAM,WAAW,EAAE,EAAE,MAAM,CAAC;AAAA,eACtC,oBAAG,MAAM,WAAW,EAAE,EAAE,MAAM,CAAC;AAAA;AAAA;AAAA;AAAA,MAIxC;AAAA,eACS,oBAAG,MAAM,WAAW,EAAE,EAAE,MAAM,CAAC;AAAA;AAAA;AAAA;AAI5C;AAAA;AAAA,IAEE,CAAC,EAAE,WAAW,MAAM,MAAM;AAC1B,MAAI,CAAC;AAAW,WAAO;AACvB,SAAO;AAAA,QACH;AAAA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AAW,EAAE,EAAE,MAAM,CAAC,CAAC;AAAA;AAAA;AAAA;AAI7C,CAAC;AAAA;AAAA,IAEC,CAAC,EAAE,WAAW,MAAM,MAAM;AAC1B,MAAI,CAAC,UAAW,QAAO;AACvB,SAAO;AAAA,QACH,YAAY;AAAA,wBACI,oBAAG,MAAM,WAAW,EAAE,EAAE,MAAM,CAAC,CAAC;AAAA;AAAA,QAEhD,WAAW;AAAA,iBACF,oBAAG,MAAM,aAAa,EAAE,EAAE,MAAM,CAAC,CAAC;AAAA;AAAA;AAAA,UAGzC,mBAAmB;AAAA,wBACL,oBAAG,MAAM,WAAW,EAAE,EAAE,MAAM,CAAC,CAAC;AAAA;AAAA;AAAA;AAAA;AAKtD,CAAC;AAAA;AAGI,MAAM,qBAAqB,wBAAO;AAAA;AAAA;AAAA;AAAA,IAIrC,mCAAkB;AAAA;",
6
6
  "names": []
7
7
  }
@@ -45,8 +45,7 @@ function useWizard({
45
45
  }) {
46
46
  const [currentStep, setCurrentStep] = (0, import_react.useState)(initial);
47
47
  (0, import_react.useEffect)(() => {
48
- if (typeof current !== "undefined")
49
- setCurrentStep(current);
48
+ if (typeof current !== "undefined") setCurrentStep(current);
50
49
  }, [current]);
51
50
  const handleNext = (0, import_react.useCallback)(() => {
52
51
  if (checkCanNext(currentStep, wizardSteps)) {
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../src/useWizard.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
4
4
  "sourcesContent": ["import { useEffect, useCallback, useState } from 'react';\nimport type { DSWizardT } from './react-desc-prop-types.js';\n\nconst checkCanNext = (prevIndex: number, array: DSWizardT.WizardStep[]): boolean => array.length > prevIndex + 1;\nconst checkCanPrevious = (prevIndex: number): boolean => prevIndex - 1 >= 0;\n\nconst noop = () => null;\n\ninterface WizardConfig<T extends DSWizardT.WizardStep> {\n steps: T[];\n current?: number;\n onNext?: (currentStep: number) => void;\n onPrevious?: (currentStep: number) => void;\n initial?: number;\n}\n\nexport default function useWizard<T extends DSWizardT.WizardStep>({\n steps: wizardSteps,\n current,\n onNext = noop,\n onPrevious = noop,\n initial = 0,\n}: WizardConfig<T>) {\n const [currentStep, setCurrentStep] = useState(initial);\n\n useEffect(() => {\n if (typeof current !== 'undefined') setCurrentStep(current);\n }, [current]);\n\n const handleNext = useCallback(() => {\n if (checkCanNext(currentStep, wizardSteps)) {\n onNext(currentStep);\n setCurrentStep(currentStep + 1);\n }\n }, [currentStep, wizardSteps, onNext]);\n\n const handlePrevious = useCallback(() => {\n if (checkCanPrevious(currentStep)) {\n onPrevious(currentStep);\n setCurrentStep(currentStep - 1);\n }\n }, [currentStep, onPrevious]);\n\n return {\n current: currentStep,\n next: handleNext,\n previous: handlePrevious,\n canNext: checkCanNext(currentStep, wizardSteps),\n canPrevious: checkCanPrevious(currentStep),\n WizardCurrentContent: wizardSteps[currentStep]?.content,\n };\n}\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAiD;AAGjD,MAAM,eAAe,CAAC,WAAmB,UAA2C,MAAM,SAAS,YAAY;AAC/G,MAAM,mBAAmB,CAAC,cAA+B,YAAY,KAAK;AAE1E,MAAM,OAAO,MAAM;AAUJ,SAAR,UAA2D;AAAA,EAChE,OAAO;AAAA,EACP;AAAA,EACA,SAAS;AAAA,EACT,aAAa;AAAA,EACb,UAAU;AACZ,GAAoB;AAClB,QAAM,CAAC,aAAa,cAAc,QAAI,uBAAS,OAAO;AAEtD,8BAAU,MAAM;AACd,QAAI,OAAO,YAAY;AAAa,qBAAe,OAAO;AAAA,EAC5D,GAAG,CAAC,OAAO,CAAC;AAEZ,QAAM,iBAAa,0BAAY,MAAM;AACnC,QAAI,aAAa,aAAa,WAAW,GAAG;AAC1C,aAAO,WAAW;AAClB,qBAAe,cAAc,CAAC;AAAA,IAChC;AAAA,EACF,GAAG,CAAC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IACL,SAAS;AAAA,IACT,MAAM;AAAA,IACN,UAAU;AAAA,IACV,SAAS,aAAa,aAAa,WAAW;AAAA,IAC9C,aAAa,iBAAiB,WAAW;AAAA,IACzC,sBAAsB,YAAY,WAAW,GAAG;AAAA,EAClD;AACF;",
6
6
  "names": []
7
7
  }
@@ -10,10 +10,8 @@ const WizardStep = (props) => {
10
10
  defaultStepProps
11
11
  );
12
12
  const currentIcon = useMemo(() => {
13
- if (active && iconActive)
14
- return iconActive;
15
- if (completed && iconCompleted)
16
- return iconCompleted;
13
+ if (active && iconActive) return iconActive;
14
+ if (completed && iconCompleted) return iconCompleted;
17
15
  return icon;
18
16
  }, [active, completed, icon, iconActive, iconCompleted]);
19
17
  const iconWithOptions = useMemo(
@@ -27,10 +25,8 @@ const WizardStep = (props) => {
27
25
  );
28
26
  const itemClassName = useMemo(() => {
29
27
  let className = "em-ds-wizard-steps-indicator-step em-ds-wizard-steps-indicator-step--default";
30
- if (active)
31
- className += " em-ds-wizard-steps-indicator-step--active";
32
- if (completed)
33
- className += " em-ds-wizard-steps-indicator-step--completed";
28
+ if (active) className += " em-ds-wizard-steps-indicator-step--active";
29
+ if (completed) className += " em-ds-wizard-steps-indicator-step--completed";
34
30
  return className;
35
31
  }, [active, completed]);
36
32
  return /* @__PURE__ */ jsx(StyledItem, { className: itemClassName, active, completed, children: /* @__PURE__ */ jsxs(StyledWrapper, { className: "em-ds-wizard-steps-indicator-step-wrapper", children: [
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/WizardStep.tsx"],
4
4
  "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { cloneElement, useMemo, isValidElement } from 'react';\nimport { describe, useMemoMergePropsWithDefault } from '@elliemae/ds-props-helpers';\nimport { DSWizardStepPropsTypesSchema, defaultStepProps, type DSWizardT } from './react-desc-prop-types.js';\nimport { StyledBullet, StyledBulletWrapper, StyledItem, StyledLabel, StyledWrapper } from './styled.js';\n\nconst WizardStep = (props: DSWizardT.StepProps) => {\n const { label, icon, iconCompleted, iconActive, active, completed, index } = useMemoMergePropsWithDefault(\n props,\n defaultStepProps,\n );\n\n const currentIcon = useMemo(() => {\n if (active && iconActive) return iconActive;\n if (completed && iconCompleted) return iconCompleted;\n return icon;\n }, [active, completed, icon, iconActive, iconCompleted]);\n\n const iconWithOptions = useMemo(\n () =>\n isValidElement<{ color: [string, string] }>(currentIcon)\n ? cloneElement(currentIcon, {\n color: ((currentIcon?.props as Record<string, unknown>)?.color as [string, string]) ?? [\n 'brand-primary',\n completed ? '600' : '500',\n ],\n })\n : currentIcon || index + 1,\n [completed, currentIcon, index],\n );\n\n const itemClassName = useMemo(() => {\n let className = 'em-ds-wizard-steps-indicator-step em-ds-wizard-steps-indicator-step--default';\n if (active) className += ' em-ds-wizard-steps-indicator-step--active';\n if (completed) className += ' em-ds-wizard-steps-indicator-step--completed';\n return className;\n }, [active, completed]);\n\n return (\n <StyledItem className={itemClassName} active={active} completed={completed}>\n <StyledWrapper className=\"em-ds-wizard-steps-indicator-step-wrapper\">\n <StyledBulletWrapper className=\"em-ds-wizard-steps-indicator-step__bullet-wrapper\">\n <StyledBullet className=\"em-ds-wizard-steps-indicator-step__bullet\">{iconWithOptions}</StyledBullet>\n </StyledBulletWrapper>\n <StyledLabel className=\"em-ds-wizard-steps-indicator-step__label\">{label}</StyledLabel>\n </StyledWrapper>\n </StyledItem>\n );\n};\n\nWizardStep.displayName = 'WizardStep';\nconst WizzardStepWithSchema = describe(WizardStep);\nWizzardStepWithSchema.propTypes = DSWizardStepPropsTypesSchema;\n\nexport { WizzardStepWithSchema };\nexport default WizardStep;\n"],
5
- "mappings": "AAAA,YAAY,WAAW;ACuCjB,SAEI,KAFJ;AAvCN,SAAgB,cAAc,SAAS,sBAAsB;AAC7D,SAAS,UAAU,oCAAoC;AACvD,SAAS,8BAA8B,wBAAwC;AAC/E,SAAS,cAAc,qBAAqB,YAAY,aAAa,qBAAqB;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CAAC,UAA+B;AACjD,QAAM,EAAE,OAAO,MAAM,eAAe,YAAY,QAAQ,WAAW,MAAM,IAAI;AAAA,IAC3E;AAAA,IACA;AAAA,EACF;AAEA,QAAM,cAAc,QAAQ,MAAM;AAChC,QAAI,UAAU,WAAY,QAAO;AACjC,QAAI,aAAa,cAAe,QAAO;AACvC,WAAO;AAAA,EACT,GAAG,CAAC,QAAQ,WAAW,MAAM,YAAY,aAAa,CAAC;AAEvD,QAAM,kBAAkB;AAAA,IACtB,MACE,eAA4C,WAAW,IACnD,aAAa,aAAa;AAAA,MACxB,OAAS,aAAa,OAAmC,SAA8B;AAAA,QACrF;AAAA,QACA,YAAY,QAAQ;AAAA,MACtB;AAAA,IACF,CAAC,IACD,eAAe,QAAQ;AAAA,IAC7B,CAAC,WAAW,aAAa,KAAK;AAAA,EAChC;AAEA,QAAM,gBAAgB,QAAQ,MAAM;AAClC,QAAI,YAAY;AAChB,QAAI,OAAQ,cAAa;AACzB,QAAI,UAAW,cAAa;AAC5B,WAAO;AAAA,EACT,GAAG,CAAC,QAAQ,SAAS,CAAC;AAEtB,SACE,oBAAC,cAAW,WAAW,eAAe,QAAgB,WACpD,+BAAC,iBAAc,WAAU,6CACvB;AAAA,wBAAC,uBAAoB,WAAU,qDAC7B,8BAAC,gBAAa,WAAU,6CAA6C,2BAAgB,GACvF;AAAA,IACA,oBAAC,eAAY,WAAU,4CAA4C,iBAAM;AAAA,KAC3E,GACF;AAEJ;AAEA,WAAW,cAAc;AACzB,MAAM,wBAAwB,SAAS,UAAU;AACjD,sBAAsB,YAAY;AAGlC,IAAO,qBAAQ;",
6
6
  "names": []
7
7
  }
@@ -22,8 +22,7 @@ const WizardSteps = (props) => {
22
22
  completed: index < current
23
23
  });
24
24
  return steps ? steps.map((step, index) => /* @__PURE__ */ jsx(WizardStep, { ...step, ...mergeStepProps(index) }, index)) : React2.Children.map(children, (item, index) => {
25
- if (item === void 0)
26
- return null;
25
+ if (item === void 0) return null;
27
26
  return cloneElement(item, mergeStepProps(index));
28
27
  });
29
28
  }, [current, children, steps]);
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/WizardSteps.tsx"],
4
4
  "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { cloneElement, useMemo } from 'react';\nimport {\n describe,\n useGetGlobalAttributes,\n useGetXstyledProps,\n useMemoMergePropsWithDefault,\n} from '@elliemae/ds-props-helpers';\nimport WizardStep from './WizardStep.js';\nimport { DSWizardPropTypesSchema, defaultProps, type DSWizardT } from './react-desc-prop-types.js';\nimport { StyledStepsWrapper } from './styled.js';\n\nconst WizardSteps = (props: DSWizardT.Props) => {\n const propsWithDefault = useMemoMergePropsWithDefault<DSWizardT.InternalProps>(props, defaultProps);\n\n const xstyledProps = useGetXstyledProps(propsWithDefault);\n\n const globalAttributes = useGetGlobalAttributes(propsWithDefault);\n\n const { children, steps, current } = propsWithDefault;\n\n const items = useMemo(() => {\n const mergeStepProps = (index: number) => ({\n index,\n active: current === index,\n completed: index < current,\n });\n\n return steps\n ? steps.map((step, index) => <WizardStep key={index} {...step} {...mergeStepProps(index)} />)\n : React.Children.map(children, (item, index) => {\n if (item === undefined) return null;\n return cloneElement(item, mergeStepProps(index));\n });\n }, [current, children, steps]);\n\n return (\n <StyledStepsWrapper className=\"em-ds-wizard-steps-indicator\" {...xstyledProps} {...globalAttributes}>\n {items}\n </StyledStepsWrapper>\n );\n};\n\nWizardSteps.Item = WizardStep;\n\nWizardSteps.displayName = 'WizardSteps';\nconst WizzardWithSchema = describe(WizardSteps);\nWizzardWithSchema.propTypes = DSWizardPropTypesSchema;\n\nexport { WizzardWithSchema };\nexport default WizardSteps;\n"],
5
- "mappings": "AAAA,YAAY,WAAW;AC4BY;AA5BnC,OAAOA,UAAS,cAAc,eAAe;AAC7C;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,OAAO,gBAAgB;AACvB,SAAS,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AE,UAAU,OAAO,QAAQ,IAAI;AAErC,QAAM,QAAQ,QAAQ,MAAM;AAC1B,UAAM,iBAAiB,CAAC,WAAmB;AAAA,MACzC;AAAA,MACA,QAAQ,YAAY;AAAA,MACpB,WAAW,QAAQ;AAAA,IACrB;AAEA,WAAO,QACH,MAAM,IAAI,CAAC,MAAM,UAAU,oBAAC,cAAwB,GAAG,MAAO,GAAG,eAAe,KAAK,KAAzC,KAA4C,CAAE,IAC1FA,OAAM,SAAS,IAAI,UAAU,CAAC,MAAM,UAAU;AAC5C,UAAI,SAAS,OAAW,QAAO;AAC/B,aAAO,aAAa,MAAM,eAAe,KAAK,CAAC;AAAA,IACjD,CAAC;AAAA,EACP,GAAG,CAAC,SAAS,UAAU,KAAK,CAAC;AAE7B,SACE,oBAAC,sBAAmB,WAAU,gCAAgC,GAAG,cAAe,GAAG,kBAChF,iBACH;AAEJ;AAEA,YAAY,OAAO;AAEnB,YAAY,cAAc;AAC1B,MAAM,oBAAoB,SAAS,WAAW;AAC9C,kBAAkB,YAAY;AAG9B,IAAO,sBAAQ;",
6
6
  "names": ["React"]
7
7
  }
@@ -63,8 +63,7 @@ const StyledItem = styled.div`
63
63
  }
64
64
 
65
65
  ${({ active, theme }) => {
66
- if (!active)
67
- return "";
66
+ if (!active) return "";
68
67
  return `
69
68
  ${StyledBullet} {
70
69
  border-color: ${th.color("brand-700")({ theme })};
@@ -80,8 +79,7 @@ const StyledItem = styled.div`
80
79
  }}
81
80
 
82
81
  ${({ completed, theme }) => {
83
- if (!completed)
84
- return "";
82
+ if (!completed) return "";
85
83
  return `
86
84
  ${StyledBullet} {
87
85
  border-color: ${th.color("brand-600")({ theme })};
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/styled.tsx"],
4
4
  "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { styled, th, xStyledCommonProps } from '@elliemae/ds-system';\n\nexport const StyledWrapper = styled.div`\n display: flex;\n flex-direction: column;\n align-items: center;\n width: 100%;\n`;\nexport const StyledLabel = styled.span`\n font-size: 1.0769rem;\n line-height: normal;\n font-weight: 400;\n color: neutral-500;\n transition: all 200ms cubic-bezier(0.36, 0, 1, 1);\n text-align: center;\n width: 100%;\n max-height: 36px;\n`;\nexport const StyledBulletWrapper = styled.div`\n display: flex;\n justify-content: center;\n position: relative;\n width: 100%;\n`;\nexport const StyledBullet = styled.div`\n margin: 8px;\n font-size: 1.2307rem;\n width: 2.46154rem;\n height: 2.46154rem;\n border-radius: 50%;\n border: 1px solid #cbcfd7;\n color: brand-600;\n position: relative;\n transition: all 200ms cubic-bezier(0.36, 0, 1, 1);\n display: flex;\n justify-content: center;\n align-items: center;\n`;\nexport const StyledItem = styled.div<{ active: boolean; completed: boolean }>`\n display: flex;\n justify-content: center;\n flex: 1 1 0px;\n min-width: 96px;\n max-width: 144px;\n margin: 0 8px;\n\n &:not(:last-child) {\n ${StyledBulletWrapper}::after {\n margin: 0 5px;\n position: absolute;\n top: 50%;\n left: calc(62%);\n display: block;\n width: 80%;\n content: '';\n transition: all 300ms cubic-bezier(0.36, 0, 1, 1);\n height: 1px;\n background-image: linear-gradient(to right, #cbcfd7 40%, rgba(255, 255, 255, 0) 0%);\n background-position: top;\n background-size: 3px 1px;\n background-repeat: repeat-x;\n }\n }\n\n ${({ active, theme }) => {\n if (!active) return '';\n return `\n ${StyledBullet} {\n border-color: ${th.color('brand-700')({ theme })};\n color: ${th.color('brand-700')({ theme })};\n font-weight: bold;\n border-width: 1.5px;\n }\n ${StyledLabel} {\n color: ${th.color('brand-700')({ theme })};\n font-weight: bold;\n }\n `;\n }}\n\n ${({ completed, theme }) => {\n if (!completed) return '';\n return `\n ${StyledBullet} {\n border-color: ${th.color('brand-600')({ theme })};\n }\n ${StyledLabel} {\n color: ${th.color('neutral-800')({ theme })};\n }\n &:not(:last-child) {\n ${StyledBulletWrapper}::after {\n background: ${th.color('brand-700')({ theme })};\n background-size: initial;\n }\n }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QAEhD,WAAW;AAAA,iBACF,GAAG,MAAM,aAAa,EAAE,EAAE,MAAM,CAAC,CAAC;AAAA;AAAA;AAAA,UAGzC,mBAAmB;AAAA,wBACL,GAAG,MAAM,WAAW,EAAE,EAAE,MAAM,CAAC,CAAC;AAAA;AAAA;AAAA;AAAA;AAKtD,CAAC;AAAA;AAGI,MAAM,qBAAqB,OAAO;AAAA;AAAA;AAAA;AAAA,IAIrC,kBAAkB;AAAA;",
6
6
  "names": []
7
7
  }
@@ -12,8 +12,7 @@ function useWizard({
12
12
  }) {
13
13
  const [currentStep, setCurrentStep] = useState(initial);
14
14
  useEffect(() => {
15
- if (typeof current !== "undefined")
16
- setCurrentStep(current);
15
+ if (typeof current !== "undefined") setCurrentStep(current);
17
16
  }, [current]);
18
17
  const handleNext = useCallback(() => {
19
18
  if (checkCanNext(currentStep, wizardSteps)) {
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/useWizard.tsx"],
4
4
  "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { useEffect, useCallback, useState } from 'react';\nimport type { DSWizardT } from './react-desc-prop-types.js';\n\nconst checkCanNext = (prevIndex: number, array: DSWizardT.WizardStep[]): boolean => array.length > prevIndex + 1;\nconst checkCanPrevious = (prevIndex: number): boolean => prevIndex - 1 >= 0;\n\nconst noop = () => null;\n\ninterface WizardConfig<T extends DSWizardT.WizardStep> {\n steps: T[];\n current?: number;\n onNext?: (currentStep: number) => void;\n onPrevious?: (currentStep: number) => void;\n initial?: number;\n}\n\nexport default function useWizard<T extends DSWizardT.WizardStep>({\n steps: wizardSteps,\n current,\n onNext = noop,\n onPrevious = noop,\n initial = 0,\n}: WizardConfig<T>) {\n const [currentStep, setCurrentStep] = useState(initial);\n\n useEffect(() => {\n if (typeof current !== 'undefined') setCurrentStep(current);\n }, [current]);\n\n const handleNext = useCallback(() => {\n if (checkCanNext(currentStep, wizardSteps)) {\n onNext(currentStep);\n setCurrentStep(currentStep + 1);\n }\n }, [currentStep, wizardSteps, onNext]);\n\n const handlePrevious = useCallback(() => {\n if (checkCanPrevious(currentStep)) {\n onPrevious(currentStep);\n setCurrentStep(currentStep - 1);\n }\n }, [currentStep, onPrevious]);\n\n return {\n current: currentStep,\n next: handleNext,\n previous: handlePrevious,\n canNext: checkCanNext(currentStep, wizardSteps),\n canPrevious: checkCanPrevious(currentStep),\n WizardCurrentContent: wizardSteps[currentStep]?.content,\n };\n}\n"],
5
- "mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,WAAW,aAAa,gBAAgB;AAGjD,MAAM,eAAe,CAAC,WAAmB,UAA2C,MAAM,SAAS,YAAY;AAC/G,MAAM,mBAAmB,CAAC,cAA+B,YAAY,KAAK;AAE1E,MAAM,OAAO,MAAM;AAUJ,SAAR,UAA2D;AAAA,EAChE,OAAO;AAAA,EACP;AAAA,EACA,SAAS;AAAA,EACT,aAAa;AAAA,EACb,UAAU;AACZ,GAAoB;AAClB,QAAM,CAAC,aAAa,cAAc,IAAI,SAAS,OAAO;AAEtD,YAAU,MAAM;AACd,QAAI,OAAO,YAAY;AAAa,qBAAe,OAAO;AAAA,EAC5D,GAAG,CAAC,OAAO,CAAC;AAEZ,QAAM,aAAa,YAAY,MAAM;AACnC,QAAI,aAAa,aAAa,WAAW,GAAG;AAC1C,aAAO,WAAW;AAClB,qBAAe,cAAc,CAAC;AAAA,IAChC;AAAA,EACF,GAAG,CAAC,aAAa,aAAa,MAAM,CAAC;AAErC,QAAM,iBAAiB,YAAY,MAAM;AACvC,QAAI,iBAAiB,WAAW,GAAG;AACjC,iBAAW,WAAW;AACtB,qBAAe,cAAc,CAAC;AAAA,IAChC;AAAA,EACF,GAAG,CAAC,aAAa,UAAU,CAAC;AAE5B,SAAO;AAAA,IACL,SAAS;AAAA,IACT,MAAM;AAAA,IACN,UAAU;AAAA,IACV,SAAS,aAAa,aAAa,WAAW;AAAA,IAC9C,aAAa,iBAAiB,WAAW;AAAA,IACzC,sBAAsB,YAAY,WAAW,GAAG;AAAA,EAClD;AACF;",
5
+ "mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,WAAW,aAAa,gBAAgB;AAGjD,MAAM,eAAe,CAAC,WAAmB,UAA2C,MAAM,SAAS,YAAY;AAC/G,MAAM,mBAAmB,CAAC,cAA+B,YAAY,KAAK;AAE1E,MAAM,OAAO,MAAM;AAUJ,SAAR,UAA2D;AAAA,EAChE,OAAO;AAAA,EACP;AAAA,EACA,SAAS;AAAA,EACT,aAAa;AAAA,EACb,UAAU;AACZ,GAAoB;AAClB,QAAM,CAAC,aAAa,cAAc,IAAI,SAAS,OAAO;AAEtD,YAAU,MAAM;AACd,QAAI,OAAO,YAAY,YAAa,gBAAe,OAAO;AAAA,EAC5D,GAAG,CAAC,OAAO,CAAC;AAEZ,QAAM,aAAa,YAAY,MAAM;AACnC,QAAI,aAAa,aAAa,WAAW,GAAG;AAC1C,aAAO,WAAW;AAClB,qBAAe,cAAc,CAAC;AAAA,IAChC;AAAA,EACF,GAAG,CAAC,aAAa,aAAa,MAAM,CAAC;AAErC,QAAM,iBAAiB,YAAY,MAAM;AACvC,QAAI,iBAAiB,WAAW,GAAG;AACjC,iBAAW,WAAW;AACtB,qBAAe,cAAc,CAAC;AAAA,IAChC;AAAA,EACF,GAAG,CAAC,aAAa,UAAU,CAAC;AAE5B,SAAO;AAAA,IACL,SAAS;AAAA,IACT,MAAM;AAAA,IACN,UAAU;AAAA,IACV,SAAS,aAAa,aAAa,WAAW;AAAA,IAC9C,aAAa,iBAAiB,WAAW;AAAA,IACzC,sBAAsB,YAAY,WAAW,GAAG;AAAA,EAClD;AACF;",
6
6
  "names": []
7
7
  }
@@ -0,0 +1,9 @@
1
+ export declare const StyledWrapper: import("styled-components").StyledComponent<"div", import("@elliemae/ds-system").Theme, object & import("@elliemae/ds-system").OwnerInterface & import("@elliemae/ds-system").InnerRefInterface<"div">, never>;
2
+ export declare const StyledLabel: import("styled-components").StyledComponent<"span", import("@elliemae/ds-system").Theme, object & import("@elliemae/ds-system").OwnerInterface & import("@elliemae/ds-system").InnerRefInterface<"span">, never>;
3
+ export declare const StyledBulletWrapper: import("styled-components").StyledComponent<"div", import("@elliemae/ds-system").Theme, object & import("@elliemae/ds-system").OwnerInterface & import("@elliemae/ds-system").InnerRefInterface<"div">, never>;
4
+ export declare const StyledBullet: import("styled-components").StyledComponent<"div", import("@elliemae/ds-system").Theme, object & import("@elliemae/ds-system").OwnerInterface & import("@elliemae/ds-system").InnerRefInterface<"div">, never>;
5
+ export declare const StyledItem: import("styled-components").StyledComponent<"div", import("@elliemae/ds-system").Theme, {
6
+ active: boolean;
7
+ completed: boolean;
8
+ } & import("@elliemae/ds-system").OwnerInterface & import("@elliemae/ds-system").InnerRefInterface<"div">, never>;
9
+ export declare const StyledStepsWrapper: import("styled-components").StyledComponent<"div", import("@elliemae/ds-system").Theme, import("@xstyled/styled-components").Props<import("@xstyled/styled-components").Theme> & import("@elliemae/ds-system").TypographyProps<import("@xstyled/styled-components").Theme> & import("@elliemae/ds-system").BackgroundProps & import("@elliemae/ds-system").SpaceProps & import("@elliemae/ds-system").BoxShadowProps<import("@xstyled/styled-components").Theme> & import("@elliemae/ds-system").FlexboxesProps<import("@xstyled/styled-components").Theme> & import("@elliemae/ds-system").LayoutProps<import("@xstyled/styled-components").Theme> & import("@elliemae/ds-system").ColorProps & import("@elliemae/ds-system").OwnerInterface & import("@elliemae/ds-system").InnerRefInterface<"div">, never>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elliemae/ds-wizard",
3
- "version": "3.35.0",
3
+ "version": "3.36.0-next.1",
4
4
  "license": "MIT",
5
5
  "description": "ICE MT - Dimsum - Wizard",
6
6
  "files": [
@@ -56,16 +56,16 @@
56
56
  "indent": 4
57
57
  },
58
58
  "dependencies": {
59
- "@elliemae/ds-classnames": "3.35.0",
60
- "@elliemae/ds-icons": "3.35.0",
61
- "@elliemae/ds-props-helpers": "3.35.0",
62
- "@elliemae/ds-system": "3.35.0",
63
- "@elliemae/ds-utilities": "3.35.0"
59
+ "@elliemae/ds-classnames": "3.36.0-next.1",
60
+ "@elliemae/ds-icons": "3.36.0-next.1",
61
+ "@elliemae/ds-props-helpers": "3.36.0-next.1",
62
+ "@elliemae/ds-system": "3.36.0-next.1",
63
+ "@elliemae/ds-utilities": "3.36.0-next.1"
64
64
  },
65
65
  "devDependencies": {
66
66
  "@elliemae/pui-cli": "~9.0.0-next.31",
67
67
  "styled-components": "~5.3.9",
68
- "@elliemae/ds-monorepo-devops": "3.35.0"
68
+ "@elliemae/ds-monorepo-devops": "3.36.0-next.1"
69
69
  },
70
70
  "peerDependencies": {
71
71
  "lodash": "^4.17.21",