@elliemae/ds-button-v2 3.16.0-next.2 → 3.16.0-next.4
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/DSButtonV2.js +2 -2
- package/dist/cjs/DSButtonV2.js.map +2 -2
- package/dist/cjs/config/useButtonV2.js +4 -4
- package/dist/cjs/config/useButtonV2.js.map +2 -2
- package/dist/cjs/config/useValidateProps.js +2 -2
- package/dist/cjs/config/useValidateProps.js.map +2 -2
- package/dist/cjs/package.json +7 -0
- package/dist/cjs/react-desc-prop-types.js +12 -12
- package/dist/cjs/react-desc-prop-types.js.map +2 -2
- package/dist/esm/DSButtonV2.js +1 -1
- package/dist/esm/DSButtonV2.js.map +1 -1
- package/dist/esm/config/useButtonV2.js +1 -1
- package/dist/esm/config/useButtonV2.js.map +1 -1
- package/dist/esm/config/useValidateProps.js +1 -1
- package/dist/esm/config/useValidateProps.js.map +1 -1
- package/dist/esm/package.json +7 -0
- package/dist/esm/react-desc-prop-types.js +1 -1
- package/dist/esm/react-desc-prop-types.js.map +2 -2
- package/dist/types/DSButtonV2.d.ts +1 -1
- package/dist/types/config/useButtonV2.d.ts +1 -1
- package/dist/types/react-desc-prop-types.d.ts +1 -1
- package/package.json +5 -4
package/dist/cjs/DSButtonV2.js
CHANGED
|
@@ -30,7 +30,7 @@ __export(DSButtonV2_exports, {
|
|
|
30
30
|
module.exports = __toCommonJS(DSButtonV2_exports);
|
|
31
31
|
var React = __toESM(require("react"));
|
|
32
32
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
33
|
-
var
|
|
33
|
+
var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
|
|
34
34
|
var import_useButtonV2 = require("./config/useButtonV2");
|
|
35
35
|
var import_react_desc_prop_types = require("./react-desc-prop-types");
|
|
36
36
|
var import_DSButtonV2Definitions = require("./DSButtonV2Definitions");
|
|
@@ -68,6 +68,6 @@ const DSButtonV2 = (props) => {
|
|
|
68
68
|
};
|
|
69
69
|
DSButtonV2.propTypes = import_react_desc_prop_types.DSButtonPropTypes;
|
|
70
70
|
DSButtonV2.displayName = import_DSButtonV2Definitions.DSButtonV2Name;
|
|
71
|
-
const DSButtonV2WithSchema = (0,
|
|
71
|
+
const DSButtonV2WithSchema = (0, import_ds_props_helpers.describe)(DSButtonV2);
|
|
72
72
|
DSButtonV2WithSchema.propTypes = import_react_desc_prop_types.DSButtonPropTypes;
|
|
73
73
|
//# sourceMappingURL=DSButtonV2.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/DSButtonV2.tsx", "../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import React from 'react';\nimport { describe } from '@elliemae/ds-
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADqBnB;AApBJ,
|
|
4
|
+
"sourcesContent": ["import React from 'react';\nimport { describe } from '@elliemae/ds-props-helpers';\nimport { useButtonV2 } from './config/useButtonV2';\nimport type { DSButtonT } from './react-desc-prop-types';\nimport { DSButtonPropTypes } from './react-desc-prop-types';\nimport { DSButtonV2Name } from './DSButtonV2Definitions';\n\nconst DSButtonV2: React.ComponentType<DSButtonT.Props> = (props) => {\n const {\n propsWithDefault,\n tabIndex,\n handleOnMouseDown,\n globalProps,\n xstyledProps,\n handleOnKeyDown,\n handleOnClick,\n ButtonRenderer,\n } = useButtonV2(props);\n const { size, buttonType, innerRef, children, type, shape } = propsWithDefault;\n const { disabled, ...restGlobalProps } = globalProps;\n return (\n <ButtonRenderer\n aria-disabled={disabled ? 'true' : false}\n {...restGlobalProps}\n {...xstyledProps}\n shape={shape}\n type={type}\n buttonType={buttonType}\n tabIndex={tabIndex}\n size={size}\n ref={innerRef}\n onKeyDown={handleOnKeyDown}\n onClick={handleOnClick}\n onMouseDown={handleOnMouseDown}\n >\n {children}\n </ButtonRenderer>\n );\n};\n\nDSButtonV2.propTypes = DSButtonPropTypes;\nDSButtonV2.displayName = DSButtonV2Name;\nconst DSButtonV2WithSchema = describe(DSButtonV2);\nDSButtonV2WithSchema.propTypes = DSButtonPropTypes;\n\nexport { DSButtonV2, DSButtonV2WithSchema };\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADqBnB;AApBJ,8BAAyB;AACzB,yBAA4B;AAE5B,mCAAkC;AAClC,mCAA+B;AAE/B,MAAM,aAAmD,CAAC,UAAU;AAClE,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,QAAI,gCAAY,KAAK;AACrB,QAAM,EAAE,MAAM,YAAY,UAAU,UAAU,MAAM,MAAM,IAAI;AAC9D,QAAM,EAAE,aAAa,gBAAgB,IAAI;AACzC,SACE;AAAA,IAAC;AAAA;AAAA,MACC,iBAAe,WAAW,SAAS;AAAA,MAClC,GAAG;AAAA,MACH,GAAG;AAAA,MACJ;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,KAAK;AAAA,MACL,WAAW;AAAA,MACX,SAAS;AAAA,MACT,aAAa;AAAA,MAEZ;AAAA;AAAA,EACH;AAEJ;AAEA,WAAW,YAAY;AACvB,WAAW,cAAc;AACzB,MAAM,2BAAuB,kCAAS,UAAU;AAChD,qBAAqB,YAAY;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -29,15 +29,15 @@ __export(useButtonV2_exports, {
|
|
|
29
29
|
module.exports = __toCommonJS(useButtonV2_exports);
|
|
30
30
|
var React = __toESM(require("react"));
|
|
31
31
|
var import_react = __toESM(require("react"));
|
|
32
|
-
var
|
|
32
|
+
var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
|
|
33
33
|
var import_react_desc_prop_types = require("../react-desc-prop-types");
|
|
34
34
|
var import_useValidateProps = require("./useValidateProps");
|
|
35
35
|
var import_useButtonRenderer = require("./useButtonRenderer");
|
|
36
36
|
const useButtonV2 = (props) => {
|
|
37
|
-
const propsWithDefault = (0,
|
|
37
|
+
const propsWithDefault = (0, import_ds_props_helpers.useMemoMergePropsWithDefault)(props, import_react_desc_prop_types.defaultProps);
|
|
38
38
|
(0, import_useValidateProps.useValidateProps)(props, import_react_desc_prop_types.DSButtonPropTypes);
|
|
39
|
-
const globalProps = (0,
|
|
40
|
-
const xstyledProps = (0,
|
|
39
|
+
const globalProps = (0, import_ds_props_helpers.useGetGlobalAttributes)(propsWithDefault);
|
|
40
|
+
const xstyledProps = (0, import_ds_props_helpers.useGetXstyledProps)(propsWithDefault);
|
|
41
41
|
const { disabled } = globalProps;
|
|
42
42
|
const ButtonRenderer = (0, import_useButtonRenderer.useButtonRenderer)(propsWithDefault);
|
|
43
43
|
const { onKeyDown, onClick, onMouseDown } = propsWithDefault;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/config/useButtonV2.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import React from 'react';\nimport { useGetGlobalAttributes, useGetXstyledProps, useMemoMergePropsWithDefault } from '@elliemae/ds-
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAkB;AAClB,
|
|
4
|
+
"sourcesContent": ["import React from 'react';\nimport { useGetGlobalAttributes, useGetXstyledProps, useMemoMergePropsWithDefault } from '@elliemae/ds-props-helpers';\nimport type { DSButtonT } from '../react-desc-prop-types';\nimport { defaultProps, DSButtonPropTypes } from '../react-desc-prop-types';\nimport { useValidateProps } from './useValidateProps';\nimport { useButtonRenderer } from './useButtonRenderer';\n\nexport interface ButtonV2Configuration {\n propsWithDefault: DSButtonT.InternalProps;\n globalProps: ReturnType<typeof useGetGlobalAttributes>;\n xstyledProps: ReturnType<typeof useGetXstyledProps>;\n ButtonRenderer: ReturnType<typeof useButtonRenderer>;\n handleOnKeyDown: React.KeyboardEventHandler<HTMLButtonElement>;\n tabIndex?: WCAGTabIndex;\n handleOnClick: (e: React.MouseEvent<HTMLButtonElement> | React.KeyboardEvent<HTMLButtonElement>) => void;\n handleOnMouseDown: React.MouseEventHandler<HTMLButtonElement>;\n}\n\nexport const useButtonV2 = (props: DSButtonT.Props): ButtonV2Configuration => {\n // =============================================================================\n // MERGE WITH DEFAULT AND VALIDATE PROPS\n // =============================================================================\n const propsWithDefault = useMemoMergePropsWithDefault<DSButtonT.InternalProps>(props, defaultProps);\n useValidateProps(props, DSButtonPropTypes);\n // =============================================================================\n // GLOBAL ATTRIBUTES & XSTYLED PROPS\n // =============================================================================\n const globalProps = useGetGlobalAttributes<DSButtonT.InternalProps, HTMLButtonElement>(propsWithDefault);\n const xstyledProps = useGetXstyledProps(propsWithDefault);\n const { disabled } = globalProps;\n // =============================================================================\n // AD HOC PER COMPONENT LOGIC\n // =============================================================================\n const ButtonRenderer = useButtonRenderer(propsWithDefault);\n const { onKeyDown, onClick, onMouseDown } = propsWithDefault;\n\n const handleOnKeyDown: React.KeyboardEventHandler<HTMLButtonElement> = React.useCallback(\n (e) => {\n if (disabled || !onKeyDown) {\n return;\n }\n\n onKeyDown?.(e);\n const { key } = e;\n if (['Space', ' ', 'Enter'].includes(key)) {\n e.preventDefault();\n onClick(e);\n }\n },\n [disabled, onClick, onKeyDown],\n );\n\n const handleOnClick = React.useCallback(\n (e: React.MouseEvent<HTMLButtonElement> | React.KeyboardEvent<HTMLButtonElement>) => {\n if (!disabled && onClick) {\n onClick(e);\n }\n },\n [disabled, onClick],\n );\n\n const handleOnMouseDown: React.MouseEventHandler<HTMLButtonElement> = React.useCallback(\n (e) => {\n if (disabled) {\n e.preventDefault();\n return;\n }\n onMouseDown?.(e);\n },\n [disabled, onMouseDown],\n );\n\n const tabIndex = globalProps.disabled ? -1 : globalProps.tabIndex;\n\n return React.useMemo(\n () => ({\n propsWithDefault,\n globalProps,\n xstyledProps,\n ButtonRenderer,\n handleOnKeyDown,\n handleOnClick,\n tabIndex,\n handleOnMouseDown,\n }),\n [\n propsWithDefault,\n globalProps,\n xstyledProps,\n ButtonRenderer,\n handleOnKeyDown,\n handleOnClick,\n tabIndex,\n handleOnMouseDown,\n ],\n );\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAkB;AAClB,8BAAyF;AAEzF,mCAAgD;AAChD,8BAAiC;AACjC,+BAAkC;AAa3B,MAAM,cAAc,CAAC,UAAkD;AAI5E,QAAM,uBAAmB,sDAAsD,OAAO,yCAAY;AAClG,gDAAiB,OAAO,8CAAiB;AAIzC,QAAM,kBAAc,gDAAmE,gBAAgB;AACvG,QAAM,mBAAe,4CAAmB,gBAAgB;AACxD,QAAM,EAAE,SAAS,IAAI;AAIrB,QAAM,qBAAiB,4CAAkB,gBAAgB;AACzD,QAAM,EAAE,WAAW,SAAS,YAAY,IAAI;AAE5C,QAAM,kBAAiE,aAAAA,QAAM;AAAA,IAC3E,CAAC,MAAM;AACL,UAAI,YAAY,CAAC,WAAW;AAC1B;AAAA,MACF;AAEA,kBAAY,CAAC;AACb,YAAM,EAAE,IAAI,IAAI;AAChB,UAAI,CAAC,SAAS,KAAK,OAAO,EAAE,SAAS,GAAG,GAAG;AACzC,UAAE,eAAe;AACjB,gBAAQ,CAAC;AAAA,MACX;AAAA,IACF;AAAA,IACA,CAAC,UAAU,SAAS,SAAS;AAAA,EAC/B;AAEA,QAAM,gBAAgB,aAAAA,QAAM;AAAA,IAC1B,CAAC,MAAoF;AACnF,UAAI,CAAC,YAAY,SAAS;AACxB,gBAAQ,CAAC;AAAA,MACX;AAAA,IACF;AAAA,IACA,CAAC,UAAU,OAAO;AAAA,EACpB;AAEA,QAAM,oBAAgE,aAAAA,QAAM;AAAA,IAC1E,CAAC,MAAM;AACL,UAAI,UAAU;AACZ,UAAE,eAAe;AACjB;AAAA,MACF;AACA,oBAAc,CAAC;AAAA,IACjB;AAAA,IACA,CAAC,UAAU,WAAW;AAAA,EACxB;AAEA,QAAM,WAAW,YAAY,WAAW,KAAK,YAAY;AAEzD,SAAO,aAAAA,QAAM;AAAA,IACX,OAAO;AAAA,MACL;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,EACF;AACF;",
|
|
6
6
|
"names": ["React"]
|
|
7
7
|
}
|
|
@@ -28,9 +28,9 @@ __export(useValidateProps_exports, {
|
|
|
28
28
|
});
|
|
29
29
|
module.exports = __toCommonJS(useValidateProps_exports);
|
|
30
30
|
var React = __toESM(require("react"));
|
|
31
|
-
var
|
|
31
|
+
var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
|
|
32
32
|
var import_DSButtonV2Definitions = require("../DSButtonV2Definitions");
|
|
33
33
|
const useValidateProps = (props, propTypes) => {
|
|
34
|
-
(0,
|
|
34
|
+
(0, import_ds_props_helpers.useValidateTypescriptPropTypes)(props, propTypes, import_DSButtonV2Definitions.DSButtonV2Name);
|
|
35
35
|
};
|
|
36
36
|
//# sourceMappingURL=useValidateProps.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/config/useValidateProps.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import { useValidateTypescriptPropTypes } from '@elliemae/ds-
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,
|
|
4
|
+
"sourcesContent": ["import { useValidateTypescriptPropTypes } from '@elliemae/ds-props-helpers';\nimport type { WeakValidationMap } from 'react';\nimport { DSButtonV2Name } from '../DSButtonV2Definitions';\nimport type { DSButtonT } from '../react-desc-prop-types';\n\nexport const useValidateProps = (props: DSButtonT.Props, propTypes: WeakValidationMap<unknown>): void => {\n // we validate the \"required if\" via 'isRequiredIf from our custom PropTypes\n useValidateTypescriptPropTypes(props, propTypes, DSButtonV2Name);\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,8BAA+C;AAE/C,mCAA+B;AAGxB,MAAM,mBAAmB,CAAC,OAAwB,cAAgD;AAEvG,8DAA+B,OAAO,WAAW,2CAAc;AACjE;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -29,7 +29,7 @@ __export(react_desc_prop_types_exports, {
|
|
|
29
29
|
});
|
|
30
30
|
module.exports = __toCommonJS(react_desc_prop_types_exports);
|
|
31
31
|
var React = __toESM(require("react"));
|
|
32
|
-
var
|
|
32
|
+
var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
|
|
33
33
|
var import_constants = require("./constants");
|
|
34
34
|
var import_DSButtonV2Definitions = require("./DSButtonV2Definitions");
|
|
35
35
|
const defaultProps = {
|
|
@@ -42,20 +42,20 @@ const defaultProps = {
|
|
|
42
42
|
}
|
|
43
43
|
};
|
|
44
44
|
const DSButtonPropTypes = {
|
|
45
|
-
...
|
|
46
|
-
...
|
|
47
|
-
children:
|
|
45
|
+
...import_ds_props_helpers.globalAttributesPropTypes,
|
|
46
|
+
...import_ds_props_helpers.xstyledPropTypes,
|
|
47
|
+
children: import_ds_props_helpers.PropTypes.oneOfType([import_ds_props_helpers.PropTypes.node, import_ds_props_helpers.PropTypes.arrayOf(import_ds_props_helpers.PropTypes.node)]).description(
|
|
48
48
|
"String, Number and/or Dimsum Icon"
|
|
49
49
|
).isRequired,
|
|
50
|
-
buttonType:
|
|
51
|
-
shape:
|
|
52
|
-
type:
|
|
53
|
-
size:
|
|
54
|
-
onClick:
|
|
50
|
+
buttonType: import_ds_props_helpers.PropTypes.oneOf(import_constants.ButtonTypesValuesArray).description(import_constants.ButtonTypesValuesString).defaultValue(import_constants.BUTTON_TYPES.FILLED),
|
|
51
|
+
shape: import_ds_props_helpers.PropTypes.oneOf(import_constants.ButtonShapesValuesArray).description(import_constants.ButtonShapesValuesString).defaultValue(import_constants.BUTTON_SHAPES.DEFAULT),
|
|
52
|
+
type: import_ds_props_helpers.PropTypes.string.description('html "type" props').defaultValue("button"),
|
|
53
|
+
size: import_ds_props_helpers.PropTypes.oneOf(import_constants.ButtonSizesValuesArray).description(import_constants.ButtonSizesValuesString).defaultValue(import_constants.BUTTON_SIZES.M),
|
|
54
|
+
onClick: import_ds_props_helpers.PropTypes.func.description('function executed when the button is activated (via keyboard "space" or enter OR via mouse)').signature("(( e: React.SyntheticEvent ) => void )").defaultValue(() => {
|
|
55
55
|
}),
|
|
56
|
-
innerRef:
|
|
57
|
-
"data-testid":
|
|
58
|
-
"data-testemulatestate":
|
|
56
|
+
innerRef: import_ds_props_helpers.PropTypes.oneOfType([import_ds_props_helpers.PropTypes.object, import_ds_props_helpers.PropTypes.func]).description("Inner ref to button component."),
|
|
57
|
+
"data-testid": import_ds_props_helpers.PropTypes.string.description("root element data-testid").defaultValue(import_DSButtonV2Definitions.DSButtonV2DataTestId.ROOT),
|
|
58
|
+
"data-testemulatestate": import_ds_props_helpers.PropTypes.oneOf(import_constants.ButtonInteractionStates).description(
|
|
59
59
|
`Emulates button states. Useful for e2e tests. ${import_constants.ButtonInteractionStatesValuesString}`
|
|
60
60
|
)
|
|
61
61
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/react-desc-prop-types.tsx", "../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["/* eslint-disable @typescript-eslint/no-empty-interface */\nimport type { RefCallback, WeakValidationMap } from 'react';\nimport type React from 'react';\nimport type { GlobalAttributesT, XstyledProps } from '@elliemae/ds-
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;
|
|
4
|
+
"sourcesContent": ["/* eslint-disable @typescript-eslint/no-empty-interface */\nimport type { RefCallback, WeakValidationMap } from 'react';\nimport type React from 'react';\nimport type {} from '@elliemae/ds-utilities';\nimport type { GlobalAttributesT, XstyledProps } from '@elliemae/ds-props-helpers';\nimport { PropTypes, globalAttributesPropTypes, xstyledPropTypes } from '@elliemae/ds-props-helpers';\nimport {\n BUTTON_SIZES,\n BUTTON_TYPES,\n BUTTON_SHAPES,\n ButtonSizesValuesArray,\n ButtonInteractionStates,\n ButtonSizesValuesString,\n ButtonInteractionStatesValuesString,\n ButtonTypesValuesArray,\n ButtonTypesValuesString,\n ButtonShapesValuesArray,\n ButtonShapesValuesString,\n} from './constants';\nimport { DSButtonV2DataTestId } from './DSButtonV2Definitions';\nimport type { ButtonSizesT, ButtonTypesT, ButtonShapesT } from './sharedTypes';\n\nexport declare namespace DSButtonT {\n type HTMLButtonTypeProp = 'button' | 'submit' | 'reset';\n\n export interface DefaultProps {\n 'data-testid': string;\n size: ButtonSizesT;\n type: HTMLButtonTypeProp;\n buttonType: ButtonTypesT;\n onClick: (e: React.MouseEvent<HTMLButtonElement> | React.KeyboardEvent<HTMLButtonElement>) => void;\n shape: ButtonShapesT;\n }\n export interface OptionalProps {\n innerRef?: React.RefObject<HTMLButtonElement> | RefCallback<HTMLButtonElement>;\n }\n export interface RequiredProps {\n children: React.ReactNode;\n }\n\n export interface Props\n extends Partial<DefaultProps>,\n OptionalProps,\n Omit<GlobalAttributesT<HTMLButtonElement>, keyof DefaultProps | keyof OptionalProps | keyof RequiredProps>,\n XstyledProps,\n RequiredProps {}\n\n export interface InternalProps\n extends DefaultProps,\n OptionalProps,\n Omit<GlobalAttributesT<HTMLButtonElement>, keyof DefaultProps | keyof OptionalProps | keyof RequiredProps>,\n XstyledProps,\n RequiredProps {}\n}\n\nexport const defaultProps: DSButtonT.DefaultProps = {\n size: BUTTON_SIZES.M,\n buttonType: BUTTON_TYPES.FILLED,\n shape: BUTTON_SHAPES.DEFAULT,\n 'data-testid': DSButtonV2DataTestId.ROOT,\n type: 'button',\n onClick: () => {},\n};\n\nexport const DSButtonPropTypes = {\n ...globalAttributesPropTypes,\n ...xstyledPropTypes,\n children: PropTypes.oneOfType([PropTypes.node, PropTypes.arrayOf(PropTypes.node)]).description(\n 'String, Number and/or Dimsum Icon',\n ).isRequired,\n buttonType: PropTypes.oneOf(ButtonTypesValuesArray)\n .description(ButtonTypesValuesString)\n .defaultValue(BUTTON_TYPES.FILLED),\n shape: PropTypes.oneOf(ButtonShapesValuesArray)\n .description(ButtonShapesValuesString)\n .defaultValue(BUTTON_SHAPES.DEFAULT),\n type: PropTypes.string.description('html \"type\" props').defaultValue('button'),\n size: PropTypes.oneOf(ButtonSizesValuesArray).description(ButtonSizesValuesString).defaultValue(BUTTON_SIZES.M),\n onClick: PropTypes.func\n .description('function executed when the button is activated (via keyboard \"space\" or enter OR via mouse)')\n .signature('(( e: React.SyntheticEvent ) => void )')\n .defaultValue(() => {}),\n innerRef: PropTypes.oneOfType([PropTypes.object, PropTypes.func]).description('Inner ref to button component.'),\n\n 'data-testid': PropTypes.string.description('root element data-testid').defaultValue(DSButtonV2DataTestId.ROOT),\n 'data-testemulatestate': PropTypes.oneOf(ButtonInteractionStates).description(\n `Emulates button states. Useful for e2e tests. ${ButtonInteractionStatesValuesString}`,\n ),\n} as WeakValidationMap<unknown>;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADKvB,8BAAuE;AACvE,uBAYO;AACP,mCAAqC;AAoC9B,MAAM,eAAuC;AAAA,EAClD,MAAM,8BAAa;AAAA,EACnB,YAAY,8BAAa;AAAA,EACzB,OAAO,+BAAc;AAAA,EACrB,eAAe,kDAAqB;AAAA,EACpC,MAAM;AAAA,EACN,SAAS,MAAM;AAAA,EAAC;AAClB;AAEO,MAAM,oBAAoB;AAAA,EAC/B,GAAG;AAAA,EACH,GAAG;AAAA,EACH,UAAU,kCAAU,UAAU,CAAC,kCAAU,MAAM,kCAAU,QAAQ,kCAAU,IAAI,CAAC,CAAC,EAAE;AAAA,IACjF;AAAA,EACF,EAAE;AAAA,EACF,YAAY,kCAAU,MAAM,uCAAsB,EAC/C,YAAY,wCAAuB,EACnC,aAAa,8BAAa,MAAM;AAAA,EACnC,OAAO,kCAAU,MAAM,wCAAuB,EAC3C,YAAY,yCAAwB,EACpC,aAAa,+BAAc,OAAO;AAAA,EACrC,MAAM,kCAAU,OAAO,YAAY,mBAAmB,EAAE,aAAa,QAAQ;AAAA,EAC7E,MAAM,kCAAU,MAAM,uCAAsB,EAAE,YAAY,wCAAuB,EAAE,aAAa,8BAAa,CAAC;AAAA,EAC9G,SAAS,kCAAU,KAChB,YAAY,6FAA6F,EACzG,UAAU,wCAAwC,EAClD,aAAa,MAAM;AAAA,EAAC,CAAC;AAAA,EACxB,UAAU,kCAAU,UAAU,CAAC,kCAAU,QAAQ,kCAAU,IAAI,CAAC,EAAE,YAAY,gCAAgC;AAAA,EAE9G,eAAe,kCAAU,OAAO,YAAY,0BAA0B,EAAE,aAAa,kDAAqB,IAAI;AAAA,EAC9G,yBAAyB,kCAAU,MAAM,wCAAuB,EAAE;AAAA,IAChE,iDAAiD;AAAA,EACnD;AACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/esm/DSButtonV2.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { jsx } from "react/jsx-runtime";
|
|
3
|
-
import { describe } from "@elliemae/ds-
|
|
3
|
+
import { describe } from "@elliemae/ds-props-helpers";
|
|
4
4
|
import { useButtonV2 } from "./config/useButtonV2";
|
|
5
5
|
import { DSButtonPropTypes } from "./react-desc-prop-types";
|
|
6
6
|
import { DSButtonV2Name } from "./DSButtonV2Definitions";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/DSButtonV2.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { describe } from '@elliemae/ds-
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { describe } from '@elliemae/ds-props-helpers';\nimport { useButtonV2 } from './config/useButtonV2';\nimport type { DSButtonT } from './react-desc-prop-types';\nimport { DSButtonPropTypes } from './react-desc-prop-types';\nimport { DSButtonV2Name } from './DSButtonV2Definitions';\n\nconst DSButtonV2: React.ComponentType<DSButtonT.Props> = (props) => {\n const {\n propsWithDefault,\n tabIndex,\n handleOnMouseDown,\n globalProps,\n xstyledProps,\n handleOnKeyDown,\n handleOnClick,\n ButtonRenderer,\n } = useButtonV2(props);\n const { size, buttonType, innerRef, children, type, shape } = propsWithDefault;\n const { disabled, ...restGlobalProps } = globalProps;\n return (\n <ButtonRenderer\n aria-disabled={disabled ? 'true' : false}\n {...restGlobalProps}\n {...xstyledProps}\n shape={shape}\n type={type}\n buttonType={buttonType}\n tabIndex={tabIndex}\n size={size}\n ref={innerRef}\n onKeyDown={handleOnKeyDown}\n onClick={handleOnClick}\n onMouseDown={handleOnMouseDown}\n >\n {children}\n </ButtonRenderer>\n );\n};\n\nDSButtonV2.propTypes = DSButtonPropTypes;\nDSButtonV2.displayName = DSButtonV2Name;\nconst DSButtonV2WithSchema = describe(DSButtonV2);\nDSButtonV2WithSchema.propTypes = DSButtonPropTypes;\n\nexport { DSButtonV2, DSButtonV2WithSchema };\n"],
|
|
5
5
|
"mappings": "AAAA,YAAY,WAAW;ACqBnB;AApBJ,SAAS,gBAAgB;AACzB,SAAS,mBAAmB;AAE5B,SAAS,yBAAyB;AAClC,SAAS,sBAAsB;AAE/B,MAAM,aAAmD,CAAC,UAAU;AAClE,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI,YAAY,KAAK;AACrB,QAAM,EAAE,MAAM,YAAY,UAAU,UAAU,MAAM,MAAM,IAAI;AAC9D,QAAM,EAAE,aAAa,gBAAgB,IAAI;AACzC,SACE;AAAA,IAAC;AAAA;AAAA,MACC,iBAAe,WAAW,SAAS;AAAA,MAClC,GAAG;AAAA,MACH,GAAG;AAAA,MACJ;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,KAAK;AAAA,MACL,WAAW;AAAA,MACX,SAAS;AAAA,MACT,aAAa;AAAA,MAEZ;AAAA;AAAA,EACH;AAEJ;AAEA,WAAW,YAAY;AACvB,WAAW,cAAc;AACzB,MAAM,uBAAuB,SAAS,UAAU;AAChD,qBAAqB,YAAY;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import React2 from "react";
|
|
3
|
-
import { useGetGlobalAttributes, useGetXstyledProps, useMemoMergePropsWithDefault } from "@elliemae/ds-
|
|
3
|
+
import { useGetGlobalAttributes, useGetXstyledProps, useMemoMergePropsWithDefault } from "@elliemae/ds-props-helpers";
|
|
4
4
|
import { defaultProps, DSButtonPropTypes } from "../react-desc-prop-types";
|
|
5
5
|
import { useValidateProps } from "./useValidateProps";
|
|
6
6
|
import { useButtonRenderer } from "./useButtonRenderer";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/config/useButtonV2.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { useGetGlobalAttributes, useGetXstyledProps, useMemoMergePropsWithDefault } from '@elliemae/ds-
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { useGetGlobalAttributes, useGetXstyledProps, useMemoMergePropsWithDefault } from '@elliemae/ds-props-helpers';\nimport type { DSButtonT } from '../react-desc-prop-types';\nimport { defaultProps, DSButtonPropTypes } from '../react-desc-prop-types';\nimport { useValidateProps } from './useValidateProps';\nimport { useButtonRenderer } from './useButtonRenderer';\n\nexport interface ButtonV2Configuration {\n propsWithDefault: DSButtonT.InternalProps;\n globalProps: ReturnType<typeof useGetGlobalAttributes>;\n xstyledProps: ReturnType<typeof useGetXstyledProps>;\n ButtonRenderer: ReturnType<typeof useButtonRenderer>;\n handleOnKeyDown: React.KeyboardEventHandler<HTMLButtonElement>;\n tabIndex?: WCAGTabIndex;\n handleOnClick: (e: React.MouseEvent<HTMLButtonElement> | React.KeyboardEvent<HTMLButtonElement>) => void;\n handleOnMouseDown: React.MouseEventHandler<HTMLButtonElement>;\n}\n\nexport const useButtonV2 = (props: DSButtonT.Props): ButtonV2Configuration => {\n // =============================================================================\n // MERGE WITH DEFAULT AND VALIDATE PROPS\n // =============================================================================\n const propsWithDefault = useMemoMergePropsWithDefault<DSButtonT.InternalProps>(props, defaultProps);\n useValidateProps(props, DSButtonPropTypes);\n // =============================================================================\n // GLOBAL ATTRIBUTES & XSTYLED PROPS\n // =============================================================================\n const globalProps = useGetGlobalAttributes<DSButtonT.InternalProps, HTMLButtonElement>(propsWithDefault);\n const xstyledProps = useGetXstyledProps(propsWithDefault);\n const { disabled } = globalProps;\n // =============================================================================\n // AD HOC PER COMPONENT LOGIC\n // =============================================================================\n const ButtonRenderer = useButtonRenderer(propsWithDefault);\n const { onKeyDown, onClick, onMouseDown } = propsWithDefault;\n\n const handleOnKeyDown: React.KeyboardEventHandler<HTMLButtonElement> = React.useCallback(\n (e) => {\n if (disabled || !onKeyDown) {\n return;\n }\n\n onKeyDown?.(e);\n const { key } = e;\n if (['Space', ' ', 'Enter'].includes(key)) {\n e.preventDefault();\n onClick(e);\n }\n },\n [disabled, onClick, onKeyDown],\n );\n\n const handleOnClick = React.useCallback(\n (e: React.MouseEvent<HTMLButtonElement> | React.KeyboardEvent<HTMLButtonElement>) => {\n if (!disabled && onClick) {\n onClick(e);\n }\n },\n [disabled, onClick],\n );\n\n const handleOnMouseDown: React.MouseEventHandler<HTMLButtonElement> = React.useCallback(\n (e) => {\n if (disabled) {\n e.preventDefault();\n return;\n }\n onMouseDown?.(e);\n },\n [disabled, onMouseDown],\n );\n\n const tabIndex = globalProps.disabled ? -1 : globalProps.tabIndex;\n\n return React.useMemo(\n () => ({\n propsWithDefault,\n globalProps,\n xstyledProps,\n ButtonRenderer,\n handleOnKeyDown,\n handleOnClick,\n tabIndex,\n handleOnMouseDown,\n }),\n [\n propsWithDefault,\n globalProps,\n xstyledProps,\n ButtonRenderer,\n handleOnKeyDown,\n handleOnClick,\n tabIndex,\n handleOnMouseDown,\n ],\n );\n};\n"],
|
|
5
5
|
"mappings": "AAAA,YAAY,WAAW;ACAvB,OAAOA,YAAW;AAClB,SAAS,wBAAwB,oBAAoB,oCAAoC;AAEzF,SAAS,cAAc,yBAAyB;AAChD,SAAS,wBAAwB;AACjC,SAAS,yBAAyB;AAa3B,MAAM,cAAc,CAAC,UAAkD;AAI5E,QAAM,mBAAmB,6BAAsD,OAAO,YAAY;AAClG,mBAAiB,OAAO,iBAAiB;AAIzC,QAAM,cAAc,uBAAmE,gBAAgB;AACvG,QAAM,eAAe,mBAAmB,gBAAgB;AACxD,QAAM,EAAE,SAAS,IAAI;AAIrB,QAAM,iBAAiB,kBAAkB,gBAAgB;AACzD,QAAM,EAAE,WAAW,SAAS,YAAY,IAAI;AAE5C,QAAM,kBAAiEA,OAAM;AAAA,IAC3E,CAAC,MAAM;AACL,UAAI,YAAY,CAAC,WAAW;AAC1B;AAAA,MACF;AAEA,kBAAY,CAAC;AACb,YAAM,EAAE,IAAI,IAAI;AAChB,UAAI,CAAC,SAAS,KAAK,OAAO,EAAE,SAAS,GAAG,GAAG;AACzC,UAAE,eAAe;AACjB,gBAAQ,CAAC;AAAA,MACX;AAAA,IACF;AAAA,IACA,CAAC,UAAU,SAAS,SAAS;AAAA,EAC/B;AAEA,QAAM,gBAAgBA,OAAM;AAAA,IAC1B,CAAC,MAAoF;AACnF,UAAI,CAAC,YAAY,SAAS;AACxB,gBAAQ,CAAC;AAAA,MACX;AAAA,IACF;AAAA,IACA,CAAC,UAAU,OAAO;AAAA,EACpB;AAEA,QAAM,oBAAgEA,OAAM;AAAA,IAC1E,CAAC,MAAM;AACL,UAAI,UAAU;AACZ,UAAE,eAAe;AACjB;AAAA,MACF;AACA,oBAAc,CAAC;AAAA,IACjB;AAAA,IACA,CAAC,UAAU,WAAW;AAAA,EACxB;AAEA,QAAM,WAAW,YAAY,WAAW,KAAK,YAAY;AAEzD,SAAOA,OAAM;AAAA,IACX,OAAO;AAAA,MACL;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,EACF;AACF;",
|
|
6
6
|
"names": ["React"]
|
|
7
7
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import { useValidateTypescriptPropTypes } from "@elliemae/ds-
|
|
2
|
+
import { useValidateTypescriptPropTypes } from "@elliemae/ds-props-helpers";
|
|
3
3
|
import { DSButtonV2Name } from "../DSButtonV2Definitions";
|
|
4
4
|
const useValidateProps = (props, propTypes) => {
|
|
5
5
|
useValidateTypescriptPropTypes(props, propTypes, DSButtonV2Name);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/config/useValidateProps.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { useValidateTypescriptPropTypes } from '@elliemae/ds-
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { useValidateTypescriptPropTypes } from '@elliemae/ds-props-helpers';\nimport type { WeakValidationMap } from 'react';\nimport { DSButtonV2Name } from '../DSButtonV2Definitions';\nimport type { DSButtonT } from '../react-desc-prop-types';\n\nexport const useValidateProps = (props: DSButtonT.Props, propTypes: WeakValidationMap<unknown>): void => {\n // we validate the \"required if\" via 'isRequiredIf from our custom PropTypes\n useValidateTypescriptPropTypes(props, propTypes, DSButtonV2Name);\n};\n"],
|
|
5
5
|
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,sCAAsC;AAE/C,SAAS,sBAAsB;AAGxB,MAAM,mBAAmB,CAAC,OAAwB,cAAgD;AAEvG,iCAA+B,OAAO,WAAW,cAAc;AACjE;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import { PropTypes, globalAttributesPropTypes, xstyledPropTypes } from "@elliemae/ds-
|
|
2
|
+
import { PropTypes, globalAttributesPropTypes, xstyledPropTypes } from "@elliemae/ds-props-helpers";
|
|
3
3
|
import {
|
|
4
4
|
BUTTON_SIZES,
|
|
5
5
|
BUTTON_TYPES,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/react-desc-prop-types.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable @typescript-eslint/no-empty-interface */\nimport type { RefCallback, WeakValidationMap } from 'react';\nimport type React from 'react';\nimport type { GlobalAttributesT, XstyledProps } from '@elliemae/ds-
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable @typescript-eslint/no-empty-interface */\nimport type { RefCallback, WeakValidationMap } from 'react';\nimport type React from 'react';\nimport type {} from '@elliemae/ds-utilities';\nimport type { GlobalAttributesT, XstyledProps } from '@elliemae/ds-props-helpers';\nimport { PropTypes, globalAttributesPropTypes, xstyledPropTypes } from '@elliemae/ds-props-helpers';\nimport {\n BUTTON_SIZES,\n BUTTON_TYPES,\n BUTTON_SHAPES,\n ButtonSizesValuesArray,\n ButtonInteractionStates,\n ButtonSizesValuesString,\n ButtonInteractionStatesValuesString,\n ButtonTypesValuesArray,\n ButtonTypesValuesString,\n ButtonShapesValuesArray,\n ButtonShapesValuesString,\n} from './constants';\nimport { DSButtonV2DataTestId } from './DSButtonV2Definitions';\nimport type { ButtonSizesT, ButtonTypesT, ButtonShapesT } from './sharedTypes';\n\nexport declare namespace DSButtonT {\n type HTMLButtonTypeProp = 'button' | 'submit' | 'reset';\n\n export interface DefaultProps {\n 'data-testid': string;\n size: ButtonSizesT;\n type: HTMLButtonTypeProp;\n buttonType: ButtonTypesT;\n onClick: (e: React.MouseEvent<HTMLButtonElement> | React.KeyboardEvent<HTMLButtonElement>) => void;\n shape: ButtonShapesT;\n }\n export interface OptionalProps {\n innerRef?: React.RefObject<HTMLButtonElement> | RefCallback<HTMLButtonElement>;\n }\n export interface RequiredProps {\n children: React.ReactNode;\n }\n\n export interface Props\n extends Partial<DefaultProps>,\n OptionalProps,\n Omit<GlobalAttributesT<HTMLButtonElement>, keyof DefaultProps | keyof OptionalProps | keyof RequiredProps>,\n XstyledProps,\n RequiredProps {}\n\n export interface InternalProps\n extends DefaultProps,\n OptionalProps,\n Omit<GlobalAttributesT<HTMLButtonElement>, keyof DefaultProps | keyof OptionalProps | keyof RequiredProps>,\n XstyledProps,\n RequiredProps {}\n}\n\nexport const defaultProps: DSButtonT.DefaultProps = {\n size: BUTTON_SIZES.M,\n buttonType: BUTTON_TYPES.FILLED,\n shape: BUTTON_SHAPES.DEFAULT,\n 'data-testid': DSButtonV2DataTestId.ROOT,\n type: 'button',\n onClick: () => {},\n};\n\nexport const DSButtonPropTypes = {\n ...globalAttributesPropTypes,\n ...xstyledPropTypes,\n children: PropTypes.oneOfType([PropTypes.node, PropTypes.arrayOf(PropTypes.node)]).description(\n 'String, Number and/or Dimsum Icon',\n ).isRequired,\n buttonType: PropTypes.oneOf(ButtonTypesValuesArray)\n .description(ButtonTypesValuesString)\n .defaultValue(BUTTON_TYPES.FILLED),\n shape: PropTypes.oneOf(ButtonShapesValuesArray)\n .description(ButtonShapesValuesString)\n .defaultValue(BUTTON_SHAPES.DEFAULT),\n type: PropTypes.string.description('html \"type\" props').defaultValue('button'),\n size: PropTypes.oneOf(ButtonSizesValuesArray).description(ButtonSizesValuesString).defaultValue(BUTTON_SIZES.M),\n onClick: PropTypes.func\n .description('function executed when the button is activated (via keyboard \"space\" or enter OR via mouse)')\n .signature('(( e: React.SyntheticEvent ) => void )')\n .defaultValue(() => {}),\n innerRef: PropTypes.oneOfType([PropTypes.object, PropTypes.func]).description('Inner ref to button component.'),\n\n 'data-testid': PropTypes.string.description('root element data-testid').defaultValue(DSButtonV2DataTestId.ROOT),\n 'data-testemulatestate': PropTypes.oneOf(ButtonInteractionStates).description(\n `Emulates button states. Useful for e2e tests. ${ButtonInteractionStatesValuesString}`,\n ),\n} as WeakValidationMap<unknown>;\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACKvB,SAAS,WAAW,2BAA2B,wBAAwB;AACvE;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,4BAA4B;AAoC9B,MAAM,eAAuC;AAAA,EAClD,MAAM,aAAa;AAAA,EACnB,YAAY,aAAa;AAAA,EACzB,OAAO,cAAc;AAAA,EACrB,eAAe,qBAAqB;AAAA,EACpC,MAAM;AAAA,EACN,SAAS,MAAM;AAAA,EAAC;AAClB;AAEO,MAAM,oBAAoB;AAAA,EAC/B,GAAG;AAAA,EACH,GAAG;AAAA,EACH,UAAU,UAAU,UAAU,CAAC,UAAU,MAAM,UAAU,QAAQ,UAAU,IAAI,CAAC,CAAC,EAAE;AAAA,IACjF;AAAA,EACF,EAAE;AAAA,EACF,YAAY,UAAU,MAAM,sBAAsB,EAC/C,YAAY,uBAAuB,EACnC,aAAa,aAAa,MAAM;AAAA,EACnC,OAAO,UAAU,MAAM,uBAAuB,EAC3C,YAAY,wBAAwB,EACpC,aAAa,cAAc,OAAO;AAAA,EACrC,MAAM,UAAU,OAAO,YAAY,mBAAmB,EAAE,aAAa,QAAQ;AAAA,EAC7E,MAAM,UAAU,MAAM,sBAAsB,EAAE,YAAY,uBAAuB,EAAE,aAAa,aAAa,CAAC;AAAA,EAC9G,SAAS,UAAU,KAChB,YAAY,6FAA6F,EACzG,UAAU,wCAAwC,EAClD,aAAa,MAAM;AAAA,EAAC,CAAC;AAAA,EACxB,UAAU,UAAU,UAAU,CAAC,UAAU,QAAQ,UAAU,IAAI,CAAC,EAAE,YAAY,gCAAgC;AAAA,EAE9G,eAAe,UAAU,OAAO,YAAY,0BAA0B,EAAE,aAAa,qBAAqB,IAAI;AAAA,EAC9G,yBAAyB,UAAU,MAAM,uBAAuB,EAAE;AAAA,IAChE,iDAAiD;AAAA,EACnD;AACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { DSButtonT } from './react-desc-prop-types';
|
|
3
3
|
declare const DSButtonV2: React.ComponentType<DSButtonT.Props>;
|
|
4
|
-
declare const DSButtonV2WithSchema: import("@elliemae/ds-
|
|
4
|
+
declare const DSButtonV2WithSchema: import("@elliemae/ds-props-helpers/dist/types/propTypes/types").DocumentedReactComponent<DSButtonT.Props>;
|
|
5
5
|
export { DSButtonV2, DSButtonV2WithSchema };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { useGetGlobalAttributes, useGetXstyledProps } from '@elliemae/ds-
|
|
2
|
+
import { useGetGlobalAttributes, useGetXstyledProps } from '@elliemae/ds-props-helpers';
|
|
3
3
|
import type { DSButtonT } from '../react-desc-prop-types';
|
|
4
4
|
import { useButtonRenderer } from './useButtonRenderer';
|
|
5
5
|
export interface ButtonV2Configuration {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { RefCallback, WeakValidationMap } from 'react';
|
|
2
2
|
import type React from 'react';
|
|
3
|
-
import type { GlobalAttributesT, XstyledProps } from '@elliemae/ds-
|
|
3
|
+
import type { GlobalAttributesT, XstyledProps } from '@elliemae/ds-props-helpers';
|
|
4
4
|
import type { ButtonSizesT, ButtonTypesT, ButtonShapesT } from './sharedTypes';
|
|
5
5
|
export declare namespace DSButtonT {
|
|
6
6
|
type HTMLButtonTypeProp = 'button' | 'submit' | 'reset';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elliemae/ds-button-v2",
|
|
3
|
-
"version": "3.16.0-next.
|
|
3
|
+
"version": "3.16.0-next.4",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "ICE MT - Dimsum - Button",
|
|
6
6
|
"files": [
|
|
@@ -63,8 +63,9 @@
|
|
|
63
63
|
"indent": 4
|
|
64
64
|
},
|
|
65
65
|
"dependencies": {
|
|
66
|
-
"@elliemae/ds-
|
|
67
|
-
"@elliemae/ds-
|
|
66
|
+
"@elliemae/ds-props-helpers": "3.16.0-next.4",
|
|
67
|
+
"@elliemae/ds-system": "3.16.0-next.4",
|
|
68
|
+
"@elliemae/ds-utilities": "3.16.0-next.4"
|
|
68
69
|
},
|
|
69
70
|
"devDependencies": {
|
|
70
71
|
"@testing-library/jest-dom": "~5.16.4",
|
|
@@ -87,7 +88,7 @@
|
|
|
87
88
|
"eslint:fix": "eslint --ext='.js,.jsx,.test.js,.ts,.tsx' --fix --config='../../.eslintrc.js' src/",
|
|
88
89
|
"dts": "node ../../scripts/dts.mjs",
|
|
89
90
|
"build": "cross-env NODE_ENV=production node ../../scripts/build/build.mjs",
|
|
90
|
-
"dev:build": "pnpm --filter {.}... build
|
|
91
|
+
"dev:build": "pnpm --filter {.}... build",
|
|
91
92
|
"dev:install": "pnpm --filter {.}... i --no-lockfile && pnpm run dev:build",
|
|
92
93
|
"checkDeps": "npx -yes ../ds-codemods check-missing-packages --projectFolderPath=\"./\" --ignorePackagesGlobPattern=\"\" --ignoreFilesGlobPattern=\"**/test-ables/*,**/tests/*\""
|
|
93
94
|
}
|