@elliemae/ds-stepper 2.3.0-alpha.1 → 2.3.0-alpha.10

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 (40) hide show
  1. package/{cjs → dist/cjs}/Stepper.js +2 -2
  2. package/dist/cjs/Stepper.js.map +7 -0
  3. package/{cjs → dist/cjs}/StepperButton.js +3 -2
  4. package/dist/cjs/StepperButton.js.map +7 -0
  5. package/{cjs → dist/cjs}/index.js +0 -0
  6. package/{cjs → dist/cjs}/index.js.map +0 -0
  7. package/{cjs → dist/cjs}/props.js +6 -5
  8. package/dist/cjs/props.js.map +7 -0
  9. package/{cjs → dist/cjs}/styled.js +1 -1
  10. package/dist/cjs/styled.js.map +7 -0
  11. package/{esm → dist/esm}/Stepper.js +3 -4
  12. package/dist/esm/Stepper.js.map +7 -0
  13. package/{esm → dist/esm}/StepperButton.js +4 -4
  14. package/dist/esm/StepperButton.js.map +7 -0
  15. package/{esm → dist/esm}/index.js +0 -0
  16. package/{esm → dist/esm}/index.js.map +0 -0
  17. package/{esm → dist/esm}/props.js +6 -5
  18. package/dist/esm/props.js.map +7 -0
  19. package/{esm → dist/esm}/styled.js +1 -1
  20. package/dist/esm/styled.js.map +7 -0
  21. package/dist/types/Stepper.d.ts +383 -0
  22. package/dist/types/StepperButton.d.ts +394 -0
  23. package/{types → dist/types}/index.d.ts +0 -0
  24. package/dist/types/props.d.ts +797 -0
  25. package/{types → dist/types}/styled.d.ts +1 -1
  26. package/{types/tests/Stepper.test.d.ts → dist/types/tests/Stepper.global-attributes.test.d.ts} +0 -0
  27. package/dist/types/tests/Stepper.test.d.ts +1 -0
  28. package/dist/types/tests/StepperButton.global-attributes.test.d.ts +1 -0
  29. package/package.json +30 -28
  30. package/cjs/Stepper.js.map +0 -7
  31. package/cjs/StepperButton.js.map +0 -7
  32. package/cjs/props.js.map +0 -7
  33. package/cjs/styled.js.map +0 -7
  34. package/esm/Stepper.js.map +0 -7
  35. package/esm/StepperButton.js.map +0 -7
  36. package/esm/props.js.map +0 -7
  37. package/esm/styled.js.map +0 -7
  38. package/types/Stepper.d.ts +0 -22
  39. package/types/StepperButton.d.ts +0 -48
  40. package/types/props.d.ts +0 -90
@@ -28,7 +28,7 @@ export declare const Label: import("styled-components").StyledComponent<{
28
28
  };
29
29
  }, import("styled-components").DefaultTheme, {}, never>;
30
30
  export declare const StyledButton: import("styled-components").StyledComponent<{
31
- (props: import("@elliemae/ds-button/types/v2/propTypes").DSButtonPropsT): JSX.Element;
31
+ (props: import("@elliemae/ds-button/dist/types/v2/propTypes").DSButtonPropsT): JSX.Element;
32
32
  propTypes: import("react").WeakValidationMap<unknown>;
33
33
  }, import("styled-components").DefaultTheme, DSStepperInternalsT.StepperButtonPropsT, never>;
34
34
  export {};
@@ -0,0 +1 @@
1
+ export {};
package/package.json CHANGED
@@ -1,31 +1,34 @@
1
1
  {
2
2
  "name": "@elliemae/ds-stepper",
3
- "version": "2.3.0-alpha.1",
3
+ "version": "2.3.0-alpha.10",
4
4
  "license": "MIT",
5
5
  "description": "ICE MT - Dimsum - Stepper",
6
- "module": "./esm/index.js",
7
- "main": "./cjs/index.js",
8
- "types": "./types/index.d.ts",
6
+ "files": [
7
+ "dist"
8
+ ],
9
+ "module": "./dist/esm/index.js",
10
+ "main": "./dist/cjs/index.js",
11
+ "types": "./dist/types/index.d.ts",
9
12
  "exports": {
10
13
  ".": {
11
- "import": "./esm/index.js",
12
- "require": "./cjs/index.js"
14
+ "import": "./dist/esm/index.js",
15
+ "require": "./dist/cjs/index.js"
13
16
  },
14
17
  "./styled": {
15
- "import": "./esm/styled.js",
16
- "require": "./cjs/styled.js"
18
+ "import": "./dist/esm/styled.js",
19
+ "require": "./dist/cjs/styled.js"
17
20
  },
18
21
  "./StepperButton": {
19
- "import": "./esm/StepperButton.js",
20
- "require": "./cjs/StepperButton.js"
22
+ "import": "./dist/esm/StepperButton.js",
23
+ "require": "./dist/cjs/StepperButton.js"
21
24
  },
22
25
  "./Stepper": {
23
- "import": "./esm/Stepper.js",
24
- "require": "./cjs/Stepper.js"
26
+ "import": "./dist/esm/Stepper.js",
27
+ "require": "./dist/cjs/Stepper.js"
25
28
  },
26
29
  "./props": {
27
- "import": "./esm/props.js",
28
- "require": "./cjs/props.js"
30
+ "import": "./dist/esm/props.js",
31
+ "require": "./dist/cjs/props.js"
29
32
  }
30
33
  },
31
34
  "sideEffects": [
@@ -37,21 +40,15 @@
37
40
  "url": "https://git.elliemae.io/platform-ui/dimsum.git"
38
41
  },
39
42
  "engines": {
40
- "npm": ">=7",
41
- "node": ">=14"
43
+ "pnpm": ">=6",
44
+ "node": ">=16"
42
45
  },
43
46
  "author": "ICE MT",
44
- "scripts": {
45
- "dev": "cross-env NODE_ENV=development && node ../../scripts/build/build.js -w",
46
- "prebuild": "exit 0",
47
- "predev": "exit 0",
48
- "build": "node ../../scripts/build/build.js"
49
- },
50
47
  "dependencies": {
51
- "@elliemae/ds-button": "2.3.0-alpha.1",
52
- "@elliemae/ds-icons": "2.3.0-alpha.1",
53
- "@elliemae/ds-props-helpers": "2.3.0-alpha.1",
54
- "@elliemae/ds-truncated-tooltip-text": "2.3.0-alpha.1",
48
+ "@elliemae/ds-button": "2.3.0-alpha.10",
49
+ "@elliemae/ds-icons": "2.3.0-alpha.10",
50
+ "@elliemae/ds-props-helpers": "2.3.0-alpha.10",
51
+ "@elliemae/ds-truncated-tooltip-text": "2.3.0-alpha.10",
55
52
  "react-desc": "~4.1.3",
56
53
  "uid": "~2.0.0"
57
54
  },
@@ -67,7 +64,12 @@
67
64
  },
68
65
  "publishConfig": {
69
66
  "access": "public",
70
- "directory": "dist",
71
- "generateSubmodules": true
67
+ "typeSafety": false
68
+ },
69
+ "scripts": {
70
+ "dev": "cross-env NODE_ENV=development && node ../../scripts/build/build.js -w",
71
+ "prebuild": "exit 0",
72
+ "predev": "exit 0",
73
+ "build": "node ../../scripts/build/build.js"
72
74
  }
73
75
  }
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/Stepper.tsx", "../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["import React from 'react';\nimport { uid } from 'uid';\nimport { describe } from 'react-desc';\nimport {\n useMemoMergePropsWithDefault,\n useValidateTypescriptPropTypes,\n getAriaProps,\n getDataProps,\n} from '@elliemae/ds-props-helpers';\nimport { dsStepperProps, defaultProps, DSStepperInternalsT } from './props';\nimport { Step, StepperWrapper } from './styled';\n\nconst DSStepper = (props: DSStepperInternalsT.StepperPropsT) => {\n const propsWithDefaults = useMemoMergePropsWithDefault(props, defaultProps) as DSStepperInternalsT.StepperPropsT;\n useValidateTypescriptPropTypes(propsWithDefaults, dsStepperProps);\n\n const { steps, current, visited } = propsWithDefaults;\n const stepsArray = React.useMemo(() => new Array(steps).fill(1) as number[], [steps]);\n return (\n <StepperWrapper steps={steps} current={current} visited={visited} {...getAriaProps(props)} {...getDataProps(props)}>\n {stepsArray.map((item, index) => (\n <Step\n // eslint-disable-next-line react/no-array-index-key\n key={`${uid(4)}step-key-${index}`}\n active={current === index}\n visited={visited.includes(index)}\n data-testid={props['data-testid'] ? `${props['data-testid'] as string}-step` : undefined}\n data-active={current === index}\n data-visited={visited.includes(index)}\n />\n ))}\n </StepperWrapper>\n );\n};\n\nDSStepper.propTypes = dsStepperProps;\n\nconst StepperWithSchema = describe(DSStepper);\nStepperWithSchema.propTypes = dsStepperProps;\n\nexport { DSStepper, StepperWithSchema };\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAkB;AAClB,iBAAoB;AACpB,wBAAyB;AACzB,8BAKO;AACP,mBAAkE;AAClE,oBAAqC;AAErC,MAAM,YAAY,CAAC,UAA6C;AAC9D,QAAM,oBAAoB,0DAA6B,OAAO;AAC9D,8DAA+B,mBAAmB;AAElD,QAAM,EAAE,OAAO,SAAS,YAAY;AACpC,QAAM,aAAa,qBAAM,QAAQ,MAAM,IAAI,MAAM,OAAO,KAAK,IAAgB,CAAC;AAC9E,SACE,mDAAC,8BAAD;AAAA,IAAgB;AAAA,IAAc;AAAA,IAAkB;AAAA,OAAsB,0CAAa;AAAA,OAAY,0CAAa;AAAA,KACzG,WAAW,IAAI,CAAC,MAAM,UACrB,mDAAC,oBAAD;AAAA,IAEE,KAAK,GAAG,oBAAI,cAAc;AAAA,IAC1B,QAAQ,YAAY;AAAA,IACpB,SAAS,QAAQ,SAAS;AAAA,IAC1B,eAAa,MAAM,iBAAiB,GAAG,MAAM,wBAAkC;AAAA,IAC/E,eAAa,YAAY;AAAA,IACzB,gBAAc,QAAQ,SAAS;AAAA;AAAA;AAOzC,UAAU,YAAY;AAEtB,MAAM,oBAAoB,gCAAS;AACnC,kBAAkB,YAAY;",
6
- "names": []
7
- }
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/StepperButton.tsx", "../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["import React from 'react';\nimport { describe } from 'react-desc';\nimport {\n useMemoMergePropsWithDefault,\n useValidateTypescriptPropTypes,\n getAriaProps,\n getDataProps,\n} from '@elliemae/ds-props-helpers';\nimport { BUTTON_TYPES } from '@elliemae/ds-button';\nimport { ChevronLeft, ChevronRight } from '@elliemae/ds-icons';\nimport { dsStepperButtonProps, defaultButtonProps, DSStepperInternalsT } from './props';\nimport { StyledButton, Label } from './styled';\n\nconst DSStepperButton = (props: DSStepperInternalsT.StepperButtonPropsT) => {\n const propsWithDefaults = useMemoMergePropsWithDefault(\n props,\n defaultButtonProps,\n ) as DSStepperInternalsT.StepperButtonPropsT;\n useValidateTypescriptPropTypes(propsWithDefaults, dsStepperButtonProps);\n\n const { chevron, fontSize, label, disabled, onClick, innerRef } = propsWithDefaults;\n\n return (\n <StyledButton\n disabled={disabled}\n onClick={onClick}\n innerRef={innerRef}\n buttonType={BUTTON_TYPES.TEXT}\n fontSize={fontSize}\n {...getAriaProps(props)}\n {...getDataProps(props)}\n >\n {chevron === 'left' ? <ChevronLeft /> : null}\n <Label value={label} />\n {chevron === 'right' ? <ChevronRight /> : null}\n </StyledButton>\n );\n};\n\nDSStepperButton.propTypes = dsStepperButtonProps;\n\nconst DSStepperButtonWithSchema = describe(DSStepperButton);\nDSStepperButtonWithSchema.propTypes = dsStepperButtonProps;\n\nexport { DSStepperButton, DSStepperButtonWithSchema };\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAkB;AAClB,wBAAyB;AACzB,8BAKO;AACP,uBAA6B;AAC7B,sBAA0C;AAC1C,mBAA8E;AAC9E,oBAAoC;AAEpC,MAAM,kBAAkB,CAAC,UAAmD;AAC1E,QAAM,oBAAoB,0DACxB,OACA;AAEF,8DAA+B,mBAAmB;AAElD,QAAM,EAAE,SAAS,UAAU,OAAO,UAAU,SAAS,aAAa;AAElE,SACE,mDAAC,4BAAD;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,IACA,YAAY,8BAAa;AAAA,IACzB;AAAA,OACI,0CAAa;AAAA,OACb,0CAAa;AAAA,KAEhB,YAAY,SAAS,mDAAC,6BAAD,QAAkB,MACxC,mDAAC,qBAAD;AAAA,IAAO,OAAO;AAAA,MACb,YAAY,UAAU,mDAAC,8BAAD,QAAmB;AAAA;AAKhD,gBAAgB,YAAY;AAE5B,MAAM,4BAA4B,gCAAS;AAC3C,0BAA0B,YAAY;",
6
- "names": []
7
- }
package/cjs/props.js.map DELETED
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/props.ts", "../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["import { noop } from 'lodash';\nimport { PropTypes } from 'react-desc';\n\nconst BUTTON_SIZES = {\n normal: 'normal',\n large: 'large',\n} as const;\n\ntype ButtonSizesT = typeof BUTTON_SIZES[keyof typeof BUTTON_SIZES];\n\nconst CHEVRON_TYPE = {\n left: 'left',\n right: 'right',\n} as const;\n\ntype ChevronT = typeof CHEVRON_TYPE[keyof typeof CHEVRON_TYPE];\n\nexport declare namespace DSStepperInternalsT {\n export interface StepperPropsT {\n [property: string]: unknown;\n steps: number;\n current: number | null;\n visited: number[];\n }\n\n export interface StepperButtonPropsT {\n [property: string]: unknown;\n chevron?: ChevronT;\n fontSize?: ButtonSizesT;\n label: string;\n disabled?: boolean;\n onClick: VoidFunction;\n innerRef?: React.MutableRefObject<HTMLButtonElement> | ((_ref: HTMLButtonElement) => void);\n 'aria-label'?: string;\n 'aria-pressed'?: boolean;\n 'data-testid'?: string;\n }\n}\nexport const defaultProps = {\n steps: 5,\n current: undefined,\n visited: [],\n};\n\nexport const dsStepperProps = {\n steps: PropTypes.number.description('Number of steps').isRequired,\n current: PropTypes.number.description('Index of active step'),\n visited: PropTypes.arrayOf(PropTypes.number).description('Array of visited steps').isRequired,\n};\n\nexport const defaultButtonProps = {\n chevron: undefined,\n fontSize: BUTTON_SIZES.normal,\n disabled: false,\n onClick: noop,\n};\n\nexport const dsStepperButtonProps = {\n chevron: PropTypes.oneOf(['left', 'right', null])\n .description('Chevron icon position, if null/undefined no chevron will be shown')\n .defaultValue(null),\n fontSize: PropTypes.oneOf(['normal', 'large'])\n .description('Label size, used for marking last step')\n .defaultValue('normal'),\n label: PropTypes.string.description('Text Label, this only accepts text, no custom JSX').isRequired,\n disabled: PropTypes.bool.description('Adds disabled state.'),\n onClick: PropTypes.func.description('OnClick callback handler.').defaultValue('()=>{}'),\n innerRef: PropTypes.oneOfType([PropTypes.object, PropTypes.func]).description('Inner ref to button component.'),\n 'aria-': PropTypes.oneOfType([PropTypes.string, PropTypes.bool]).description(\n 'accept all the aria-* props, MUST receive aria-label',\n ),\n 'data-': PropTypes.oneOfType([PropTypes.string, PropTypes.bool]).description('accept all the data-* props'),\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,oBAAqB;AACrB,wBAA0B;AAE1B,MAAM,eAAe;AAAA,EACnB,QAAQ;AAAA,EACR,OAAO;AAAA;AAKT,MAAM,eAAe;AAAA,EACnB,MAAM;AAAA,EACN,OAAO;AAAA;AA0BF,MAAM,eAAe;AAAA,EAC1B,OAAO;AAAA,EACP,SAAS;AAAA,EACT,SAAS;AAAA;AAGJ,MAAM,iBAAiB;AAAA,EAC5B,OAAO,4BAAU,OAAO,YAAY,mBAAmB;AAAA,EACvD,SAAS,4BAAU,OAAO,YAAY;AAAA,EACtC,SAAS,4BAAU,QAAQ,4BAAU,QAAQ,YAAY,0BAA0B;AAAA;AAG9E,MAAM,qBAAqB;AAAA,EAChC,SAAS;AAAA,EACT,UAAU,aAAa;AAAA,EACvB,UAAU;AAAA,EACV,SAAS;AAAA;AAGJ,MAAM,uBAAuB;AAAA,EAClC,SAAS,4BAAU,MAAM,CAAC,QAAQ,SAAS,OACxC,YAAY,qEACZ,aAAa;AAAA,EAChB,UAAU,4BAAU,MAAM,CAAC,UAAU,UAClC,YAAY,0CACZ,aAAa;AAAA,EAChB,OAAO,4BAAU,OAAO,YAAY,qDAAqD;AAAA,EACzF,UAAU,4BAAU,KAAK,YAAY;AAAA,EACrC,SAAS,4BAAU,KAAK,YAAY,6BAA6B,aAAa;AAAA,EAC9E,UAAU,4BAAU,UAAU,CAAC,4BAAU,QAAQ,4BAAU,OAAO,YAAY;AAAA,EAC9E,SAAS,4BAAU,UAAU,CAAC,4BAAU,QAAQ,4BAAU,OAAO,YAC/D;AAAA,EAEF,SAAS,4BAAU,UAAU,CAAC,4BAAU,QAAQ,4BAAU,OAAO,YAAY;AAAA;",
6
- "names": []
7
- }
package/cjs/styled.js.map DELETED
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/styled.tsx", "../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["import styled from 'styled-components';\nimport { DSButtonV2 } from '@elliemae/ds-button';\nimport { SimpleTruncatedTooltipText } from '@elliemae/ds-truncated-tooltip-text';\nimport { DSStepperInternalsT } from './props';\n\nexport const StepperWrapper = styled.div`\n display: grid;\n align-items: flex-end;\n grid-template-columns repeat(${(props: DSStepperInternalsT.StepperPropsT) => props.steps}, 1fr);\n column-gap: ${(props) => (props.steps >= 8 ? props.theme.space.xxxs : props.theme.space.xxs)};\n`;\n\ninterface StepProps {\n active: boolean;\n visited: boolean;\n}\n\nexport const Step = styled.div<StepProps>`\n display: grid;\n border-radius: 1px;\n height: ${(props) => (props.active ? '5px' : '3px')};\n background: ${(props) => (props.active || props.visited ? props.theme.colors.brand[700] : '#A9B1BE')};\n`;\n\nexport const Label = styled(SimpleTruncatedTooltipText)`\n position: relative;\n top: 1px;\n`;\n\nexport const StyledButton = styled(DSButtonV2)`\n white-space: nowrap;\n overflow: hidden;\n max-width: 100%;\n padding-left: ${(props) => props.theme.space.xxs};\n padding-right: ${(props) => props.theme.space.xxs};\n color: ${(props) => props.theme.colors.brand[600]};\n & > span:not(.em-ds-icon) {\n position: relative;\n top: ${(props: DSStepperInternalsT.StepperButtonPropsT) => (props.fontSize === 'large' ? '2px' : '1px')};\n font-size: ${(props: DSStepperInternalsT.StepperButtonPropsT) => (props.fontSize === 'large' ? '22px' : '18px')};\n }\n`;\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,+BAAmB;AACnB,uBAA2B;AAC3B,uCAA2C;AAGpC,MAAM,iBAAiB,iCAAO;AAAA;AAAA;AAAA,mCAGF,CAAC,UAA6C,MAAM;AAAA,kBACrE,CAAC,UAAW,MAAM,SAAS,IAAI,MAAM,MAAM,MAAM,OAAO,MAAM,MAAM,MAAM;AAAA;AAQrF,MAAM,OAAO,iCAAO;AAAA;AAAA;AAAA,YAGf,CAAC,UAAW,MAAM,SAAS,QAAQ;AAAA,gBAC/B,CAAC,UAAW,MAAM,UAAU,MAAM,UAAU,MAAM,MAAM,OAAO,MAAM,OAAO;AAAA;AAGrF,MAAM,QAAQ,sCAAO;AAAA;AAAA;AAAA;AAKrB,MAAM,eAAe,sCAAO;AAAA;AAAA;AAAA;AAAA,kBAIjB,CAAC,UAAU,MAAM,MAAM,MAAM;AAAA,mBAC5B,CAAC,UAAU,MAAM,MAAM,MAAM;AAAA,WACrC,CAAC,UAAU,MAAM,MAAM,OAAO,MAAM;AAAA;AAAA;AAAA,WAGpC,CAAC,UAAoD,MAAM,aAAa,UAAU,QAAQ;AAAA,iBACpF,CAAC,UAAoD,MAAM,aAAa,UAAU,SAAS;AAAA;AAAA;",
6
- "names": []
7
- }
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/Stepper.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { uid } from 'uid';\nimport { describe } from 'react-desc';\nimport {\n useMemoMergePropsWithDefault,\n useValidateTypescriptPropTypes,\n getAriaProps,\n getDataProps,\n} from '@elliemae/ds-props-helpers';\nimport { dsStepperProps, defaultProps, DSStepperInternalsT } from './props';\nimport { Step, StepperWrapper } from './styled';\n\nconst DSStepper = (props: DSStepperInternalsT.StepperPropsT) => {\n const propsWithDefaults = useMemoMergePropsWithDefault(props, defaultProps) as DSStepperInternalsT.StepperPropsT;\n useValidateTypescriptPropTypes(propsWithDefaults, dsStepperProps);\n\n const { steps, current, visited } = propsWithDefaults;\n const stepsArray = React.useMemo(() => new Array(steps).fill(1) as number[], [steps]);\n return (\n <StepperWrapper steps={steps} current={current} visited={visited} {...getAriaProps(props)} {...getDataProps(props)}>\n {stepsArray.map((item, index) => (\n <Step\n // eslint-disable-next-line react/no-array-index-key\n key={`${uid(4)}step-key-${index}`}\n active={current === index}\n visited={visited.includes(index)}\n data-testid={props['data-testid'] ? `${props['data-testid'] as string}-step` : undefined}\n data-active={current === index}\n data-visited={visited.includes(index)}\n />\n ))}\n </StepperWrapper>\n );\n};\n\nDSStepper.propTypes = dsStepperProps;\n\nconst StepperWithSchema = describe(DSStepper);\nStepperWithSchema.propTypes = dsStepperProps;\n\nexport { DSStepper, StepperWithSchema };\n"],
5
- "mappings": "AAAA;ACAA;AACA;AACA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAMA;AACA;AAEA,MAAM,YAAY,CAAC,UAA6C;AAC9D,QAAM,oBAAoB,6BAA6B,OAAO;AAC9D,iCAA+B,mBAAmB;AAElD,QAAM,EAAE,OAAO,SAAS,YAAY;AACpC,QAAM,aAAa,OAAM,QAAQ,MAAM,IAAI,MAAM,OAAO,KAAK,IAAgB,CAAC;AAC9E,SACE,qCAAC,gBAAD;AAAA,IAAgB;AAAA,IAAc;AAAA,IAAkB;AAAA,OAAsB,aAAa;AAAA,OAAY,aAAa;AAAA,KACzG,WAAW,IAAI,CAAC,MAAM,UACrB,qCAAC,MAAD;AAAA,IAEE,KAAK,GAAG,IAAI,cAAc;AAAA,IAC1B,QAAQ,YAAY;AAAA,IACpB,SAAS,QAAQ,SAAS;AAAA,IAC1B,eAAa,MAAM,iBAAiB,GAAG,MAAM,wBAAkC;AAAA,IAC/E,eAAa,YAAY;AAAA,IACzB,gBAAc,QAAQ,SAAS;AAAA;AAAA;AAOzC,UAAU,YAAY;AAEtB,MAAM,oBAAoB,SAAS;AACnC,kBAAkB,YAAY;",
6
- "names": []
7
- }
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/StepperButton.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { describe } from 'react-desc';\nimport {\n useMemoMergePropsWithDefault,\n useValidateTypescriptPropTypes,\n getAriaProps,\n getDataProps,\n} from '@elliemae/ds-props-helpers';\nimport { BUTTON_TYPES } from '@elliemae/ds-button';\nimport { ChevronLeft, ChevronRight } from '@elliemae/ds-icons';\nimport { dsStepperButtonProps, defaultButtonProps, DSStepperInternalsT } from './props';\nimport { StyledButton, Label } from './styled';\n\nconst DSStepperButton = (props: DSStepperInternalsT.StepperButtonPropsT) => {\n const propsWithDefaults = useMemoMergePropsWithDefault(\n props,\n defaultButtonProps,\n ) as DSStepperInternalsT.StepperButtonPropsT;\n useValidateTypescriptPropTypes(propsWithDefaults, dsStepperButtonProps);\n\n const { chevron, fontSize, label, disabled, onClick, innerRef } = propsWithDefaults;\n\n return (\n <StyledButton\n disabled={disabled}\n onClick={onClick}\n innerRef={innerRef}\n buttonType={BUTTON_TYPES.TEXT}\n fontSize={fontSize}\n {...getAriaProps(props)}\n {...getDataProps(props)}\n >\n {chevron === 'left' ? <ChevronLeft /> : null}\n <Label value={label} />\n {chevron === 'right' ? <ChevronRight /> : null}\n </StyledButton>\n );\n};\n\nDSStepperButton.propTypes = dsStepperButtonProps;\n\nconst DSStepperButtonWithSchema = describe(DSStepperButton);\nDSStepperButtonWithSchema.propTypes = dsStepperButtonProps;\n\nexport { DSStepperButton, DSStepperButtonWithSchema };\n"],
5
- "mappings": "AAAA;ACAA;AACA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAMA;AACA;AACA;AACA;AAEA,MAAM,kBAAkB,CAAC,UAAmD;AAC1E,QAAM,oBAAoB,6BACxB,OACA;AAEF,iCAA+B,mBAAmB;AAElD,QAAM,EAAE,SAAS,UAAU,OAAO,UAAU,SAAS,aAAa;AAElE,SACE,qCAAC,cAAD;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,IACA,YAAY,aAAa;AAAA,IACzB;AAAA,OACI,aAAa;AAAA,OACb,aAAa;AAAA,KAEhB,YAAY,SAAS,qCAAC,aAAD,QAAkB,MACxC,qCAAC,OAAD;AAAA,IAAO,OAAO;AAAA,MACb,YAAY,UAAU,qCAAC,cAAD,QAAmB;AAAA;AAKhD,gBAAgB,YAAY;AAE5B,MAAM,4BAA4B,SAAS;AAC3C,0BAA0B,YAAY;",
6
- "names": []
7
- }
package/esm/props.js.map DELETED
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/props.ts"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { noop } from 'lodash';\nimport { PropTypes } from 'react-desc';\n\nconst BUTTON_SIZES = {\n normal: 'normal',\n large: 'large',\n} as const;\n\ntype ButtonSizesT = typeof BUTTON_SIZES[keyof typeof BUTTON_SIZES];\n\nconst CHEVRON_TYPE = {\n left: 'left',\n right: 'right',\n} as const;\n\ntype ChevronT = typeof CHEVRON_TYPE[keyof typeof CHEVRON_TYPE];\n\nexport declare namespace DSStepperInternalsT {\n export interface StepperPropsT {\n [property: string]: unknown;\n steps: number;\n current: number | null;\n visited: number[];\n }\n\n export interface StepperButtonPropsT {\n [property: string]: unknown;\n chevron?: ChevronT;\n fontSize?: ButtonSizesT;\n label: string;\n disabled?: boolean;\n onClick: VoidFunction;\n innerRef?: React.MutableRefObject<HTMLButtonElement> | ((_ref: HTMLButtonElement) => void);\n 'aria-label'?: string;\n 'aria-pressed'?: boolean;\n 'data-testid'?: string;\n }\n}\nexport const defaultProps = {\n steps: 5,\n current: undefined,\n visited: [],\n};\n\nexport const dsStepperProps = {\n steps: PropTypes.number.description('Number of steps').isRequired,\n current: PropTypes.number.description('Index of active step'),\n visited: PropTypes.arrayOf(PropTypes.number).description('Array of visited steps').isRequired,\n};\n\nexport const defaultButtonProps = {\n chevron: undefined,\n fontSize: BUTTON_SIZES.normal,\n disabled: false,\n onClick: noop,\n};\n\nexport const dsStepperButtonProps = {\n chevron: PropTypes.oneOf(['left', 'right', null])\n .description('Chevron icon position, if null/undefined no chevron will be shown')\n .defaultValue(null),\n fontSize: PropTypes.oneOf(['normal', 'large'])\n .description('Label size, used for marking last step')\n .defaultValue('normal'),\n label: PropTypes.string.description('Text Label, this only accepts text, no custom JSX').isRequired,\n disabled: PropTypes.bool.description('Adds disabled state.'),\n onClick: PropTypes.func.description('OnClick callback handler.').defaultValue('()=>{}'),\n innerRef: PropTypes.oneOfType([PropTypes.object, PropTypes.func]).description('Inner ref to button component.'),\n 'aria-': PropTypes.oneOfType([PropTypes.string, PropTypes.bool]).description(\n 'accept all the aria-* props, MUST receive aria-label',\n ),\n 'data-': PropTypes.oneOfType([PropTypes.string, PropTypes.bool]).description('accept all the data-* props'),\n};\n"],
5
- "mappings": "AAAA;ACAA;AACA;AAEA,MAAM,eAAe;AAAA,EACnB,QAAQ;AAAA,EACR,OAAO;AAAA;AAKT,MAAM,eAAe;AAAA,EACnB,MAAM;AAAA,EACN,OAAO;AAAA;AA0BF,MAAM,eAAe;AAAA,EAC1B,OAAO;AAAA,EACP,SAAS;AAAA,EACT,SAAS;AAAA;AAGJ,MAAM,iBAAiB;AAAA,EAC5B,OAAO,UAAU,OAAO,YAAY,mBAAmB;AAAA,EACvD,SAAS,UAAU,OAAO,YAAY;AAAA,EACtC,SAAS,UAAU,QAAQ,UAAU,QAAQ,YAAY,0BAA0B;AAAA;AAG9E,MAAM,qBAAqB;AAAA,EAChC,SAAS;AAAA,EACT,UAAU,aAAa;AAAA,EACvB,UAAU;AAAA,EACV,SAAS;AAAA;AAGJ,MAAM,uBAAuB;AAAA,EAClC,SAAS,UAAU,MAAM,CAAC,QAAQ,SAAS,OACxC,YAAY,qEACZ,aAAa;AAAA,EAChB,UAAU,UAAU,MAAM,CAAC,UAAU,UAClC,YAAY,0CACZ,aAAa;AAAA,EAChB,OAAO,UAAU,OAAO,YAAY,qDAAqD;AAAA,EACzF,UAAU,UAAU,KAAK,YAAY;AAAA,EACrC,SAAS,UAAU,KAAK,YAAY,6BAA6B,aAAa;AAAA,EAC9E,UAAU,UAAU,UAAU,CAAC,UAAU,QAAQ,UAAU,OAAO,YAAY;AAAA,EAC9E,SAAS,UAAU,UAAU,CAAC,UAAU,QAAQ,UAAU,OAAO,YAC/D;AAAA,EAEF,SAAS,UAAU,UAAU,CAAC,UAAU,QAAQ,UAAU,OAAO,YAAY;AAAA;",
6
- "names": []
7
- }
package/esm/styled.js.map DELETED
@@ -1,7 +0,0 @@
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", "import styled from 'styled-components';\nimport { DSButtonV2 } from '@elliemae/ds-button';\nimport { SimpleTruncatedTooltipText } from '@elliemae/ds-truncated-tooltip-text';\nimport { DSStepperInternalsT } from './props';\n\nexport const StepperWrapper = styled.div`\n display: grid;\n align-items: flex-end;\n grid-template-columns repeat(${(props: DSStepperInternalsT.StepperPropsT) => props.steps}, 1fr);\n column-gap: ${(props) => (props.steps >= 8 ? props.theme.space.xxxs : props.theme.space.xxs)};\n`;\n\ninterface StepProps {\n active: boolean;\n visited: boolean;\n}\n\nexport const Step = styled.div<StepProps>`\n display: grid;\n border-radius: 1px;\n height: ${(props) => (props.active ? '5px' : '3px')};\n background: ${(props) => (props.active || props.visited ? props.theme.colors.brand[700] : '#A9B1BE')};\n`;\n\nexport const Label = styled(SimpleTruncatedTooltipText)`\n position: relative;\n top: 1px;\n`;\n\nexport const StyledButton = styled(DSButtonV2)`\n white-space: nowrap;\n overflow: hidden;\n max-width: 100%;\n padding-left: ${(props) => props.theme.space.xxs};\n padding-right: ${(props) => props.theme.space.xxs};\n color: ${(props) => props.theme.colors.brand[600]};\n & > span:not(.em-ds-icon) {\n position: relative;\n top: ${(props: DSStepperInternalsT.StepperButtonPropsT) => (props.fontSize === 'large' ? '2px' : '1px')};\n font-size: ${(props: DSStepperInternalsT.StepperButtonPropsT) => (props.fontSize === 'large' ? '22px' : '18px')};\n }\n`;\n"],
5
- "mappings": "AAAA;ACAA;AACA;AACA;AAGO,MAAM,iBAAiB,OAAO;AAAA;AAAA;AAAA,mCAGF,CAAC,UAA6C,MAAM;AAAA,kBACrE,CAAC,UAAW,MAAM,SAAS,IAAI,MAAM,MAAM,MAAM,OAAO,MAAM,MAAM,MAAM;AAAA;AAQrF,MAAM,OAAO,OAAO;AAAA;AAAA;AAAA,YAGf,CAAC,UAAW,MAAM,SAAS,QAAQ;AAAA,gBAC/B,CAAC,UAAW,MAAM,UAAU,MAAM,UAAU,MAAM,MAAM,OAAO,MAAM,OAAO;AAAA;AAGrF,MAAM,QAAQ,OAAO;AAAA;AAAA;AAAA;AAKrB,MAAM,eAAe,OAAO;AAAA;AAAA;AAAA;AAAA,kBAIjB,CAAC,UAAU,MAAM,MAAM,MAAM;AAAA,mBAC5B,CAAC,UAAU,MAAM,MAAM,MAAM;AAAA,WACrC,CAAC,UAAU,MAAM,MAAM,OAAO,MAAM;AAAA;AAAA;AAAA,WAGpC,CAAC,UAAoD,MAAM,aAAa,UAAU,QAAQ;AAAA,iBACpF,CAAC,UAAoD,MAAM,aAAa,UAAU,SAAS;AAAA;AAAA;",
6
- "names": []
7
- }
@@ -1,22 +0,0 @@
1
- /// <reference path="../../../../shared/typings/react-desc.d.ts" />
2
- /// <reference types="react" />
3
- import { DSStepperInternalsT } from './props';
4
- declare const DSStepper: {
5
- (props: DSStepperInternalsT.StepperPropsT): JSX.Element;
6
- propTypes: {
7
- steps: import("react-desc").PropTypesDescValue;
8
- current: {
9
- defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
10
- deprecated: import("react-desc").PropTypesDescValidator;
11
- };
12
- isRequired: import("react-desc").PropTypesDescValue;
13
- };
14
- visited: import("react-desc").PropTypesDescValue;
15
- };
16
- };
17
- declare const StepperWithSchema: {
18
- (props?: unknown): JSX.Element;
19
- propTypes: unknown;
20
- toTypescript: () => import("react-desc").TypescriptSchema;
21
- };
22
- export { DSStepper, StepperWithSchema };
@@ -1,48 +0,0 @@
1
- /// <reference path="../../../../shared/typings/react-desc.d.ts" />
2
- /// <reference types="react" />
3
- import { DSStepperInternalsT } from './props';
4
- declare const DSStepperButton: {
5
- (props: DSStepperInternalsT.StepperButtonPropsT): JSX.Element;
6
- propTypes: {
7
- chevron: {
8
- deprecated: import("react-desc").PropTypesDescValidator;
9
- };
10
- fontSize: {
11
- deprecated: import("react-desc").PropTypesDescValidator;
12
- };
13
- label: import("react-desc").PropTypesDescValue;
14
- disabled: {
15
- defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
16
- deprecated: import("react-desc").PropTypesDescValidator;
17
- };
18
- isRequired: import("react-desc").PropTypesDescValue;
19
- };
20
- onClick: {
21
- deprecated: import("react-desc").PropTypesDescValidator;
22
- };
23
- innerRef: {
24
- defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
25
- deprecated: import("react-desc").PropTypesDescValidator;
26
- };
27
- isRequired: import("react-desc").PropTypesDescValue;
28
- };
29
- 'aria-': {
30
- defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
31
- deprecated: import("react-desc").PropTypesDescValidator;
32
- };
33
- isRequired: import("react-desc").PropTypesDescValue;
34
- };
35
- 'data-': {
36
- defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
37
- deprecated: import("react-desc").PropTypesDescValidator;
38
- };
39
- isRequired: import("react-desc").PropTypesDescValue;
40
- };
41
- };
42
- };
43
- declare const DSStepperButtonWithSchema: {
44
- (props?: unknown): JSX.Element;
45
- propTypes: unknown;
46
- toTypescript: () => import("react-desc").TypescriptSchema;
47
- };
48
- export { DSStepperButton, DSStepperButtonWithSchema };
package/types/props.d.ts DELETED
@@ -1,90 +0,0 @@
1
- /// <reference path="../../../../shared/typings/react-desc.d.ts" />
2
- /// <reference types="react" />
3
- declare const BUTTON_SIZES: {
4
- readonly normal: "normal";
5
- readonly large: "large";
6
- };
7
- declare type ButtonSizesT = typeof BUTTON_SIZES[keyof typeof BUTTON_SIZES];
8
- declare const CHEVRON_TYPE: {
9
- readonly left: "left";
10
- readonly right: "right";
11
- };
12
- declare type ChevronT = typeof CHEVRON_TYPE[keyof typeof CHEVRON_TYPE];
13
- export declare namespace DSStepperInternalsT {
14
- interface StepperPropsT {
15
- [property: string]: unknown;
16
- steps: number;
17
- current: number | null;
18
- visited: number[];
19
- }
20
- interface StepperButtonPropsT {
21
- [property: string]: unknown;
22
- chevron?: ChevronT;
23
- fontSize?: ButtonSizesT;
24
- label: string;
25
- disabled?: boolean;
26
- onClick: VoidFunction;
27
- innerRef?: React.MutableRefObject<HTMLButtonElement> | ((_ref: HTMLButtonElement) => void);
28
- 'aria-label'?: string;
29
- 'aria-pressed'?: boolean;
30
- 'data-testid'?: string;
31
- }
32
- }
33
- export declare const defaultProps: {
34
- steps: number;
35
- current: undefined;
36
- visited: never[];
37
- };
38
- export declare const dsStepperProps: {
39
- steps: import("react-desc").PropTypesDescValue;
40
- current: {
41
- defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
42
- deprecated: import("react-desc").PropTypesDescValidator;
43
- };
44
- isRequired: import("react-desc").PropTypesDescValue;
45
- };
46
- visited: import("react-desc").PropTypesDescValue;
47
- };
48
- export declare const defaultButtonProps: {
49
- chevron: undefined;
50
- fontSize: "normal";
51
- disabled: boolean;
52
- onClick: (...args: any[]) => void;
53
- };
54
- export declare const dsStepperButtonProps: {
55
- chevron: {
56
- deprecated: import("react-desc").PropTypesDescValidator;
57
- };
58
- fontSize: {
59
- deprecated: import("react-desc").PropTypesDescValidator;
60
- };
61
- label: import("react-desc").PropTypesDescValue;
62
- disabled: {
63
- defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
64
- deprecated: import("react-desc").PropTypesDescValidator;
65
- };
66
- isRequired: import("react-desc").PropTypesDescValue;
67
- };
68
- onClick: {
69
- deprecated: import("react-desc").PropTypesDescValidator;
70
- };
71
- innerRef: {
72
- defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
73
- deprecated: import("react-desc").PropTypesDescValidator;
74
- };
75
- isRequired: import("react-desc").PropTypesDescValue;
76
- };
77
- 'aria-': {
78
- defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
79
- deprecated: import("react-desc").PropTypesDescValidator;
80
- };
81
- isRequired: import("react-desc").PropTypesDescValue;
82
- };
83
- 'data-': {
84
- defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
85
- deprecated: import("react-desc").PropTypesDescValidator;
86
- };
87
- isRequired: import("react-desc").PropTypesDescValue;
88
- };
89
- };
90
- export {};