@elliemae/ds-card-v2-action-addon 3.22.0-next.3 → 3.22.0-next.30
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/DSCardV2ActionAddon.js.map +1 -1
- package/dist/cjs/config/useCardV2ActionAddon.js.map +1 -1
- package/dist/cjs/config/useValidateProps.js.map +1 -1
- package/dist/cjs/constants/index.js.map +1 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/react-desc-prop-types.js.map +3 -3
- package/dist/cjs/styles.js.map +1 -1
- package/dist/esm/DSCardV2ActionAddon.js.map +1 -1
- package/dist/esm/config/useCardV2ActionAddon.js.map +1 -1
- package/dist/esm/config/useValidateProps.js.map +1 -1
- package/dist/esm/constants/index.js.map +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/react-desc-prop-types.js.map +3 -3
- package/dist/esm/styles.js.map +1 -1
- package/dist/types/react-desc-prop-types.d.ts +2 -2
- package/package.json +13 -13
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../src/DSCardV2ActionAddon.tsx", "
|
|
3
|
+
"sources": ["../../src/DSCardV2ActionAddon.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
4
|
"sourcesContent": ["import React from 'react';\nimport { describe } from '@elliemae/ds-utilities';\nimport { ChevronSmallDown } from '@elliemae/ds-icons';\nimport { type DSCardV2ActionAddonT, DSCardV2ActionAddonPropTypesSchema } from './react-desc-prop-types.js';\nimport { useCardV2ActionAddon } from './config/useCardV2ActionAddon.js';\nimport { Addon } from './styles.js';\nimport { DSCardV2ActionAddonName } from './constants/index.js';\n\nconst DSCardV2ActionAddon: React.ComponentType<DSCardV2ActionAddonT.Props> = (props) => {\n const { propsWithDefault, globalProps, xstyledProps } = useCardV2ActionAddon(props);\n const { innerRef, onClick, label, icon } = propsWithDefault;\n return (\n <Addon innerRef={innerRef} buttonType=\"icon\" {...globalProps} {...xstyledProps} onClick={onClick}>\n {label}\n {icon || <ChevronSmallDown color={['brand-primary', '700']} />}\n </Addon>\n );\n};\n\nDSCardV2ActionAddon.propTypes = DSCardV2ActionAddonPropTypesSchema;\nDSCardV2ActionAddon.displayName = DSCardV2ActionAddonName;\nconst DSCardV2ActionAddonWithSchema = describe(DSCardV2ActionAddon);\nDSCardV2ActionAddonWithSchema.propTypes = DSCardV2ActionAddonPropTypesSchema;\n\nexport { DSCardV2ActionAddon, DSCardV2ActionAddonWithSchema };\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
5
|
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADYnB;AAXJ,0BAAyB;AACzB,sBAAiC;AACjC,mCAA8E;AAC9E,kCAAqC;AACrC,oBAAsB;AACtB,uBAAwC;AAExC,MAAM,sBAAuE,CAAC,UAAU;AACtF,QAAM,EAAE,kBAAkB,aAAa,aAAa,QAAI,kDAAqB,KAAK;AAClF,QAAM,EAAE,UAAU,SAAS,OAAO,KAAK,IAAI;AAC3C,SACE,6CAAC,uBAAM,UAAoB,YAAW,QAAQ,GAAG,aAAc,GAAG,cAAc,SAC7E;AAAA;AAAA,IACA,QAAQ,4CAAC,oCAAiB,OAAO,CAAC,iBAAiB,KAAK,GAAG;AAAA,KAC9D;AAEJ;AAEA,oBAAoB,YAAY;AAChC,oBAAoB,cAAc;AAClC,MAAM,oCAAgC,8BAAS,mBAAmB;AAClE,8BAA8B,YAAY;",
|
|
6
6
|
"names": []
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../../src/config/useCardV2ActionAddon.ts", "
|
|
3
|
+
"sources": ["../../../src/config/useCardV2ActionAddon.ts", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
4
|
"sourcesContent": ["import React from 'react';\nimport { omit } from 'lodash';\nimport { useGetGlobalAttributes, useGetXstyledProps, useMemoMergePropsWithDefault } from '@elliemae/ds-utilities';\nimport { uid } from 'uid';\nimport { type DSCardV2ActionAddonT, DSCardV2ActionAddonPropTypes, defaultProps } from '../react-desc-prop-types.js';\nimport { useValidateProps } from './useValidateProps.js';\n\nexport interface CardV2ActionAddonCTX {\n propsWithDefault: DSCardV2ActionAddonT.InternalProps;\n globalProps: ReturnType<typeof useGetGlobalAttributes>;\n xstyledProps: ReturnType<typeof useGetXstyledProps>;\n instanceUid: string;\n}\n\nexport const useCardV2ActionAddon = (propsFromUser: DSCardV2ActionAddonT.Props) => {\n // =============================================================================\n // MERGE WITH DEFAULT AND VALIDATE PROPS\n // =============================================================================\n const propsWithDefault = useMemoMergePropsWithDefault<DSCardV2ActionAddonT.InternalProps>(\n propsFromUser,\n defaultProps,\n );\n useValidateProps(propsWithDefault, DSCardV2ActionAddonPropTypes);\n // =============================================================================\n // GLOBAL ATTRIBUTES & XSTYLED PROPS\n // =============================================================================\n const globalProps = omit(useGetGlobalAttributes<DSCardV2ActionAddonT.InternalProps>(propsWithDefault), [\n 'cols',\n 'rows',\n 'wrap',\n ]);\n const xstyledProps = useGetXstyledProps(propsWithDefault);\n // =============================================================================\n // AD HOC PER COMPONENT LOGIC\n // =============================================================================\n // custom code goes here, this is an example\n const { id } = propsWithDefault;\n const instanceUid = React.useMemo(() => id || uid(5), [id]);\n // =============================================================================\n // HELPERS HOOKS CONFIGS\n // =============================================================================\n // const eventHandlers = useEventHandlers({ propsWithDefault, instanceUid }); // <-- complex logic should be made atomics this way\n\n return React.useMemo(\n () => ({\n propsWithDefault,\n globalProps,\n xstyledProps,\n instanceUid,\n // ...eventHandlers,\n }),\n [\n propsWithDefault,\n globalProps,\n xstyledProps,\n instanceUid,\n // eventHandlers,\n ],\n );\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
5
|
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAkB;AAClB,oBAAqB;AACrB,0BAAyF;AACzF,iBAAoB;AACpB,mCAAsF;AACtF,8BAAiC;AAS1B,MAAM,uBAAuB,CAAC,kBAA8C;AAIjF,QAAM,uBAAmB;AAAA,IACvB;AAAA,IACA;AAAA,EACF;AACA,gDAAiB,kBAAkB,yDAA4B;AAI/D,QAAM,kBAAc,wBAAK,4CAA2D,gBAAgB,GAAG;AAAA,IACrG;AAAA,IACA;AAAA,IACA;AAAA,EACF,CAAC;AACD,QAAM,mBAAe,wCAAmB,gBAAgB;AAKxD,QAAM,EAAE,GAAG,IAAI;AACf,QAAM,cAAc,aAAAA,QAAM,QAAQ,MAAM,UAAM,gBAAI,CAAC,GAAG,CAAC,EAAE,CAAC;AAM1D,SAAO,aAAAA,QAAM;AAAA,IACX,OAAO;AAAA,MACL;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA;AAAA,IAEF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA;AAAA,IAEF;AAAA,EACF;AACF;",
|
|
6
6
|
"names": ["React"]
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../../src/config/useValidateProps.ts", "
|
|
3
|
+
"sources": ["../../../src/config/useValidateProps.ts", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
4
|
"sourcesContent": ["import { useValidateTypescriptPropTypes } from '@elliemae/ds-utilities';\nimport type { WeakValidationMap } from 'react';\nimport { type DSCardV2ActionAddonT } from '../react-desc-prop-types.js';\nimport { DSCardV2ActionAddonName } from '../constants/index.js';\n\nexport const useValidateProps = (\n props: DSCardV2ActionAddonT.InternalProps,\n propTypes: WeakValidationMap<unknown>,\n): void => {\n // we validate the \"required if\" via 'isRequiredIf from our custom PropTypes\n useValidateTypescriptPropTypes(props, propTypes, DSCardV2ActionAddonName);\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
5
|
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,0BAA+C;AAG/C,uBAAwC;AAEjC,MAAM,mBAAmB,CAC9B,OACA,cACS;AAET,0DAA+B,OAAO,WAAW,wCAAuB;AAC1E;",
|
|
6
6
|
"names": []
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../../src/constants/index.ts", "
|
|
3
|
+
"sources": ["../../../src/constants/index.ts", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
4
|
"sourcesContent": ["import { slotObjectToDataTestIds } from '@elliemae/ds-system';\n\nexport const DSCardV2ActionAddonName = 'DSCardV2ActionAddon';\n\n// we are giving \"component_name_slots\" to avoid errors on duplicate exports variables in aggregators\nexport const CARD_V2_ACTION_ADDON_SLOTS = {\n ADDON: 'action-addon',\n} as const;\n\n// we are giving \"component_name_data_testid\" to avoid errors on duplicate exports variables in aggregators\nexport const CARD_V2_ACTION_ADDON_DATA_TESTID = slotObjectToDataTestIds(\n DSCardV2ActionAddonName,\n CARD_V2_ACTION_ADDON_SLOTS,\n);\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
5
|
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,uBAAwC;AAEjC,MAAM,0BAA0B;AAGhC,MAAM,6BAA6B;AAAA,EACxC,OAAO;AACT;AAGO,MAAM,uCAAmC;AAAA,EAC9C;AAAA,EACA;AACF;",
|
|
6
6
|
"names": []
|
package/dist/cjs/index.js.map
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../src/index.ts", "
|
|
3
|
+
"sources": ["../../src/index.ts", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
4
|
"sourcesContent": ["// this is a workaround to typescript error TS2742\n// https://github.com/microsoft/TypeScript/issues/47663\nimport type {} from '@xstyled/system';\nexport {\n DSCardV2ActionAddon,\n DSCardV2ActionAddonWithSchema,\n DSCardV2ActionAddonWithSchema as DSCardActionAddonWithSchema,\n} from './DSCardV2ActionAddon.js';\nexport { type DSCardV2ActionAddonT } from './react-desc-prop-types.js';\nexport { CARD_V2_ACTION_ADDON_DATA_TESTID } from './constants/index.js';\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
5
|
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADGvB,iCAIO;AACP,mCAA0C;AAC1C,uBAAiD;",
|
|
6
6
|
"names": []
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../src/react-desc-prop-types.ts", "
|
|
4
|
-
"sourcesContent": ["/* eslint-disable @typescript-eslint/no-empty-interface */\nimport type { WeakValidationMap } from 'react';\nimport type { GlobalAttributesT, XstyledProps, DSPropTypesSchema } from '@elliemae/ds-utilities';\nimport { PropTypes, globalAttributesPropTypes, xstyledPropTypes } from '@elliemae/ds-utilities';\n\nexport declare namespace DSCardV2ActionAddonT {\n export interface RequiredProps {}\n\n export interface DefaultProps {}\n\n export interface OptionalProps {\n label?: string;\n onClick?: (e: React.MouseEvent<HTMLButtonElement> | React.KeyboardEvent<HTMLButtonElement>) => void;\n icon?: JSX.Element;\n innerRef: React.RefObject<HTMLButtonElement> | ((_ref: HTMLButtonElement) => void);\n }\n\n export interface Props\n extends Partial<DefaultProps>,\n OptionalProps,\n Omit
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADGvB,0BAAuE;
|
|
3
|
+
"sources": ["../../src/react-desc-prop-types.ts", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["/* eslint-disable @typescript-eslint/no-empty-interface */\nimport type { WeakValidationMap } from 'react';\nimport type { GlobalAttributesT, XstyledProps, DSPropTypesSchema } from '@elliemae/ds-utilities';\nimport { PropTypes, globalAttributesPropTypes, xstyledPropTypes } from '@elliemae/ds-utilities';\n\nexport declare namespace DSCardV2ActionAddonT {\n export interface RequiredProps {}\n\n export interface DefaultProps {}\n\n export interface OptionalProps {\n label?: string;\n onClick?: (e: React.MouseEvent<HTMLButtonElement> | React.KeyboardEvent<HTMLButtonElement>) => void;\n icon?: JSX.Element;\n innerRef: React.RefObject<HTMLButtonElement> | ((_ref: HTMLButtonElement) => void);\n }\n\n export interface Props\n extends Partial<DefaultProps>,\n OptionalProps,\n Omit<GlobalAttributesT<HTMLButtonElement>, keyof DefaultProps | keyof OptionalProps | keyof XstyledProps>,\n XstyledProps,\n RequiredProps {}\n\n export interface InternalProps\n extends DefaultProps,\n OptionalProps,\n Omit<GlobalAttributesT<HTMLButtonElement>, keyof DefaultProps | keyof OptionalProps | keyof XstyledProps>,\n XstyledProps,\n RequiredProps {}\n}\n\nexport const defaultProps: DSCardV2ActionAddonT.DefaultProps = {};\n\nexport const DSCardV2ActionAddonPropTypes: DSPropTypesSchema<DSCardV2ActionAddonT.Props> = {\n ...globalAttributesPropTypes,\n ...xstyledPropTypes,\n /**\n * Addon label\n */\n label: PropTypes.string.description('Addon label'),\n /**\n * On click callback\n */\n onClick: PropTypes.func.description('On click callback'),\n /**\n * Icon to display after the label\n */\n icon: PropTypes.element.description('Icon to display after the label'),\n innerRef: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({ current: PropTypes.any })]).description(\n 'Ref to the action button',\n ),\n};\n\nexport const DSCardV2ActionAddonPropTypesSchema =\n DSCardV2ActionAddonPropTypes as unknown as WeakValidationMap<DSCardV2ActionAddonT.Props>;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADGvB,0BAAuE;AA6BhE,MAAM,eAAkD,CAAC;AAEzD,MAAM,+BAA8E;AAAA,EACzF,GAAG;AAAA,EACH,GAAG;AAAA;AAAA;AAAA;AAAA,EAIH,OAAO,8BAAU,OAAO,YAAY,aAAa;AAAA;AAAA;AAAA;AAAA,EAIjD,SAAS,8BAAU,KAAK,YAAY,mBAAmB;AAAA;AAAA;AAAA;AAAA,EAIvD,MAAM,8BAAU,QAAQ,YAAY,iCAAiC;AAAA,EACrE,UAAU,8BAAU,UAAU,CAAC,8BAAU,MAAM,8BAAU,MAAM,EAAE,SAAS,8BAAU,IAAI,CAAC,CAAC,CAAC,EAAE;AAAA,IAC3F;AAAA,EACF;AACF;AAEO,MAAM,qCACX;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/cjs/styles.js.map
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../src/styles.tsx", "
|
|
3
|
+
"sources": ["../../src/styles.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
4
|
"sourcesContent": ["import { styled } from '@elliemae/ds-system';\nimport type { DSCardV2ActionAddonT } from './react-desc-prop-types.js';\nimport { DSButtonV2 } from '@elliemae/ds-button-v2';\nimport { DSCardV2ActionAddonName, CARD_V2_ACTION_ADDON_SLOTS } from './constants/index.js';\n\nconst Addon = styled(DSButtonV2, { name: DSCardV2ActionAddonName, slot: CARD_V2_ACTION_ADDON_SLOTS.ADDON })<{\n onClick: DSCardV2ActionAddonT.Props['onClick'];\n}>`\n background-color: transparent;\n padding: 4px;\n height: 100%;\n border: none;\n font-size: 13px;\n font-weight: ${(props) => props.theme.fontWeights.semibold};\n color: ${(props) => props.theme.colors.brand['700']};\n cursor: pointer;\n`;\n\nexport { Addon };\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
5
|
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,uBAAuB;AAEvB,0BAA2B;AAC3B,uBAAoE;AAEpE,MAAM,YAAQ,yBAAO,gCAAY,EAAE,MAAM,0CAAyB,MAAM,4CAA2B,MAAM,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,iBAQzF,CAAC,UAAU,MAAM,MAAM,YAAY;AAAA,WACzC,CAAC,UAAU,MAAM,MAAM,OAAO,MAAM,KAAK;AAAA;AAAA;",
|
|
6
6
|
"names": []
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["
|
|
3
|
+
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/DSCardV2ActionAddon.tsx"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { describe } from '@elliemae/ds-utilities';\nimport { ChevronSmallDown } from '@elliemae/ds-icons';\nimport { type DSCardV2ActionAddonT, DSCardV2ActionAddonPropTypesSchema } from './react-desc-prop-types.js';\nimport { useCardV2ActionAddon } from './config/useCardV2ActionAddon.js';\nimport { Addon } from './styles.js';\nimport { DSCardV2ActionAddonName } from './constants/index.js';\n\nconst DSCardV2ActionAddon: React.ComponentType<DSCardV2ActionAddonT.Props> = (props) => {\n const { propsWithDefault, globalProps, xstyledProps } = useCardV2ActionAddon(props);\n const { innerRef, onClick, label, icon } = propsWithDefault;\n return (\n <Addon innerRef={innerRef} buttonType=\"icon\" {...globalProps} {...xstyledProps} onClick={onClick}>\n {label}\n {icon || <ChevronSmallDown color={['brand-primary', '700']} />}\n </Addon>\n );\n};\n\nDSCardV2ActionAddon.propTypes = DSCardV2ActionAddonPropTypesSchema;\nDSCardV2ActionAddon.displayName = DSCardV2ActionAddonName;\nconst DSCardV2ActionAddonWithSchema = describe(DSCardV2ActionAddon);\nDSCardV2ActionAddonWithSchema.propTypes = DSCardV2ActionAddonPropTypesSchema;\n\nexport { DSCardV2ActionAddon, DSCardV2ActionAddonWithSchema };\n"],
|
|
5
5
|
"mappings": "AAAA,YAAY,WAAW;ACYnB,SAEW,KAFX;AAXJ,SAAS,gBAAgB;AACzB,SAAS,wBAAwB;AACjC,SAAoC,0CAA0C;AAC9E,SAAS,4BAA4B;AACrC,SAAS,aAAa;AACtB,SAAS,+BAA+B;AAExC,MAAM,sBAAuE,CAAC,UAAU;AACtF,QAAM,EAAE,kBAAkB,aAAa,aAAa,IAAI,qBAAqB,KAAK;AAClF,QAAM,EAAE,UAAU,SAAS,OAAO,KAAK,IAAI;AAC3C,SACE,qBAAC,SAAM,UAAoB,YAAW,QAAQ,GAAG,aAAc,GAAG,cAAc,SAC7E;AAAA;AAAA,IACA,QAAQ,oBAAC,oBAAiB,OAAO,CAAC,iBAAiB,KAAK,GAAG;AAAA,KAC9D;AAEJ;AAEA,oBAAoB,YAAY;AAChC,oBAAoB,cAAc;AAClC,MAAM,gCAAgC,SAAS,mBAAmB;AAClE,8BAA8B,YAAY;",
|
|
6
6
|
"names": []
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["
|
|
3
|
+
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/config/useCardV2ActionAddon.ts"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { omit } from 'lodash';\nimport { useGetGlobalAttributes, useGetXstyledProps, useMemoMergePropsWithDefault } from '@elliemae/ds-utilities';\nimport { uid } from 'uid';\nimport { type DSCardV2ActionAddonT, DSCardV2ActionAddonPropTypes, defaultProps } from '../react-desc-prop-types.js';\nimport { useValidateProps } from './useValidateProps.js';\n\nexport interface CardV2ActionAddonCTX {\n propsWithDefault: DSCardV2ActionAddonT.InternalProps;\n globalProps: ReturnType<typeof useGetGlobalAttributes>;\n xstyledProps: ReturnType<typeof useGetXstyledProps>;\n instanceUid: string;\n}\n\nexport const useCardV2ActionAddon = (propsFromUser: DSCardV2ActionAddonT.Props) => {\n // =============================================================================\n // MERGE WITH DEFAULT AND VALIDATE PROPS\n // =============================================================================\n const propsWithDefault = useMemoMergePropsWithDefault<DSCardV2ActionAddonT.InternalProps>(\n propsFromUser,\n defaultProps,\n );\n useValidateProps(propsWithDefault, DSCardV2ActionAddonPropTypes);\n // =============================================================================\n // GLOBAL ATTRIBUTES & XSTYLED PROPS\n // =============================================================================\n const globalProps = omit(useGetGlobalAttributes<DSCardV2ActionAddonT.InternalProps>(propsWithDefault), [\n 'cols',\n 'rows',\n 'wrap',\n ]);\n const xstyledProps = useGetXstyledProps(propsWithDefault);\n // =============================================================================\n // AD HOC PER COMPONENT LOGIC\n // =============================================================================\n // custom code goes here, this is an example\n const { id } = propsWithDefault;\n const instanceUid = React.useMemo(() => id || uid(5), [id]);\n // =============================================================================\n // HELPERS HOOKS CONFIGS\n // =============================================================================\n // const eventHandlers = useEventHandlers({ propsWithDefault, instanceUid }); // <-- complex logic should be made atomics this way\n\n return React.useMemo(\n () => ({\n propsWithDefault,\n globalProps,\n xstyledProps,\n instanceUid,\n // ...eventHandlers,\n }),\n [\n propsWithDefault,\n globalProps,\n xstyledProps,\n instanceUid,\n // eventHandlers,\n ],\n );\n};\n"],
|
|
5
5
|
"mappings": "AAAA,YAAY,WAAW;ACAvB,OAAOA,YAAW;AAClB,SAAS,YAAY;AACrB,SAAS,wBAAwB,oBAAoB,oCAAoC;AACzF,SAAS,WAAW;AACpB,SAAoC,8BAA8B,oBAAoB;AACtF,SAAS,wBAAwB;AAS1B,MAAM,uBAAuB,CAAC,kBAA8C;AAIjF,QAAM,mBAAmB;AAAA,IACvB;AAAA,IACA;AAAA,EACF;AACA,mBAAiB,kBAAkB,4BAA4B;AAI/D,QAAM,cAAc,KAAK,uBAA2D,gBAAgB,GAAG;AAAA,IACrG;AAAA,IACA;AAAA,IACA;AAAA,EACF,CAAC;AACD,QAAM,eAAe,mBAAmB,gBAAgB;AAKxD,QAAM,EAAE,GAAG,IAAI;AACf,QAAM,cAAcA,OAAM,QAAQ,MAAM,MAAM,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;AAM1D,SAAOA,OAAM;AAAA,IACX,OAAO;AAAA,MACL;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA;AAAA,IAEF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA;AAAA,IAEF;AAAA,EACF;AACF;",
|
|
6
6
|
"names": ["React"]
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["
|
|
3
|
+
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/config/useValidateProps.ts"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { useValidateTypescriptPropTypes } from '@elliemae/ds-utilities';\nimport type { WeakValidationMap } from 'react';\nimport { type DSCardV2ActionAddonT } from '../react-desc-prop-types.js';\nimport { DSCardV2ActionAddonName } from '../constants/index.js';\n\nexport const useValidateProps = (\n props: DSCardV2ActionAddonT.InternalProps,\n propTypes: WeakValidationMap<unknown>,\n): void => {\n // we validate the \"required if\" via 'isRequiredIf from our custom PropTypes\n useValidateTypescriptPropTypes(props, propTypes, DSCardV2ActionAddonName);\n};\n"],
|
|
5
5
|
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,sCAAsC;AAG/C,SAAS,+BAA+B;AAEjC,MAAM,mBAAmB,CAC9B,OACA,cACS;AAET,iCAA+B,OAAO,WAAW,uBAAuB;AAC1E;",
|
|
6
6
|
"names": []
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["
|
|
3
|
+
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/constants/index.ts"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { slotObjectToDataTestIds } from '@elliemae/ds-system';\n\nexport const DSCardV2ActionAddonName = 'DSCardV2ActionAddon';\n\n// we are giving \"component_name_slots\" to avoid errors on duplicate exports variables in aggregators\nexport const CARD_V2_ACTION_ADDON_SLOTS = {\n ADDON: 'action-addon',\n} as const;\n\n// we are giving \"component_name_data_testid\" to avoid errors on duplicate exports variables in aggregators\nexport const CARD_V2_ACTION_ADDON_DATA_TESTID = slotObjectToDataTestIds(\n DSCardV2ActionAddonName,\n CARD_V2_ACTION_ADDON_SLOTS,\n);\n"],
|
|
5
5
|
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,+BAA+B;AAEjC,MAAM,0BAA0B;AAGhC,MAAM,6BAA6B;AAAA,EACxC,OAAO;AACT;AAGO,MAAM,mCAAmC;AAAA,EAC9C;AAAA,EACA;AACF;",
|
|
6
6
|
"names": []
|
package/dist/esm/index.js.map
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["
|
|
3
|
+
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/index.ts"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "// this is a workaround to typescript error TS2742\n// https://github.com/microsoft/TypeScript/issues/47663\nimport type {} from '@xstyled/system';\nexport {\n DSCardV2ActionAddon,\n DSCardV2ActionAddonWithSchema,\n DSCardV2ActionAddonWithSchema as DSCardActionAddonWithSchema,\n} from './DSCardV2ActionAddon.js';\nexport { type DSCardV2ActionAddonT } from './react-desc-prop-types.js';\nexport { CARD_V2_ACTION_ADDON_DATA_TESTID } from './constants/index.js';\n"],
|
|
5
5
|
"mappings": "AAAA,YAAY,WAAW;ACGvB;AAAA,EACE;AAAA,EACA;AAAA,EACiC,iCAAjCA;AAAA,OACK;AACP,eAA0C;AAC1C,SAAS,wCAAwC;",
|
|
6
6
|
"names": ["DSCardV2ActionAddonWithSchema"]
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable @typescript-eslint/no-empty-interface */\nimport type { WeakValidationMap } from 'react';\nimport type { GlobalAttributesT, XstyledProps, DSPropTypesSchema } from '@elliemae/ds-utilities';\nimport { PropTypes, globalAttributesPropTypes, xstyledPropTypes } from '@elliemae/ds-utilities';\n\nexport declare namespace DSCardV2ActionAddonT {\n export interface RequiredProps {}\n\n export interface DefaultProps {}\n\n export interface OptionalProps {\n label?: string;\n onClick?: (e: React.MouseEvent<HTMLButtonElement> | React.KeyboardEvent<HTMLButtonElement>) => void;\n icon?: JSX.Element;\n innerRef: React.RefObject<HTMLButtonElement> | ((_ref: HTMLButtonElement) => void);\n }\n\n export interface Props\n extends Partial<DefaultProps>,\n OptionalProps,\n Omit
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACGvB,SAAS,WAAW,2BAA2B,wBAAwB;
|
|
3
|
+
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/react-desc-prop-types.ts"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable @typescript-eslint/no-empty-interface */\nimport type { WeakValidationMap } from 'react';\nimport type { GlobalAttributesT, XstyledProps, DSPropTypesSchema } from '@elliemae/ds-utilities';\nimport { PropTypes, globalAttributesPropTypes, xstyledPropTypes } from '@elliemae/ds-utilities';\n\nexport declare namespace DSCardV2ActionAddonT {\n export interface RequiredProps {}\n\n export interface DefaultProps {}\n\n export interface OptionalProps {\n label?: string;\n onClick?: (e: React.MouseEvent<HTMLButtonElement> | React.KeyboardEvent<HTMLButtonElement>) => void;\n icon?: JSX.Element;\n innerRef: React.RefObject<HTMLButtonElement> | ((_ref: HTMLButtonElement) => void);\n }\n\n export interface Props\n extends Partial<DefaultProps>,\n OptionalProps,\n Omit<GlobalAttributesT<HTMLButtonElement>, keyof DefaultProps | keyof OptionalProps | keyof XstyledProps>,\n XstyledProps,\n RequiredProps {}\n\n export interface InternalProps\n extends DefaultProps,\n OptionalProps,\n Omit<GlobalAttributesT<HTMLButtonElement>, keyof DefaultProps | keyof OptionalProps | keyof XstyledProps>,\n XstyledProps,\n RequiredProps {}\n}\n\nexport const defaultProps: DSCardV2ActionAddonT.DefaultProps = {};\n\nexport const DSCardV2ActionAddonPropTypes: DSPropTypesSchema<DSCardV2ActionAddonT.Props> = {\n ...globalAttributesPropTypes,\n ...xstyledPropTypes,\n /**\n * Addon label\n */\n label: PropTypes.string.description('Addon label'),\n /**\n * On click callback\n */\n onClick: PropTypes.func.description('On click callback'),\n /**\n * Icon to display after the label\n */\n icon: PropTypes.element.description('Icon to display after the label'),\n innerRef: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({ current: PropTypes.any })]).description(\n 'Ref to the action button',\n ),\n};\n\nexport const DSCardV2ActionAddonPropTypesSchema =\n DSCardV2ActionAddonPropTypes as unknown as WeakValidationMap<DSCardV2ActionAddonT.Props>;\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACGvB,SAAS,WAAW,2BAA2B,wBAAwB;AA6BhE,MAAM,eAAkD,CAAC;AAEzD,MAAM,+BAA8E;AAAA,EACzF,GAAG;AAAA,EACH,GAAG;AAAA;AAAA;AAAA;AAAA,EAIH,OAAO,UAAU,OAAO,YAAY,aAAa;AAAA;AAAA;AAAA;AAAA,EAIjD,SAAS,UAAU,KAAK,YAAY,mBAAmB;AAAA;AAAA;AAAA;AAAA,EAIvD,MAAM,UAAU,QAAQ,YAAY,iCAAiC;AAAA,EACrE,UAAU,UAAU,UAAU,CAAC,UAAU,MAAM,UAAU,MAAM,EAAE,SAAS,UAAU,IAAI,CAAC,CAAC,CAAC,EAAE;AAAA,IAC3F;AAAA,EACF;AACF;AAEO,MAAM,qCACX;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/esm/styles.js.map
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["
|
|
3
|
+
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/styles.tsx"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { styled } from '@elliemae/ds-system';\nimport type { DSCardV2ActionAddonT } from './react-desc-prop-types.js';\nimport { DSButtonV2 } from '@elliemae/ds-button-v2';\nimport { DSCardV2ActionAddonName, CARD_V2_ACTION_ADDON_SLOTS } from './constants/index.js';\n\nconst Addon = styled(DSButtonV2, { name: DSCardV2ActionAddonName, slot: CARD_V2_ACTION_ADDON_SLOTS.ADDON })<{\n onClick: DSCardV2ActionAddonT.Props['onClick'];\n}>`\n background-color: transparent;\n padding: 4px;\n height: 100%;\n border: none;\n font-size: 13px;\n font-weight: ${(props) => props.theme.fontWeights.semibold};\n color: ${(props) => props.theme.colors.brand['700']};\n cursor: pointer;\n`;\n\nexport { Addon };\n"],
|
|
5
5
|
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,cAAc;AAEvB,SAAS,kBAAkB;AAC3B,SAAS,yBAAyB,kCAAkC;AAEpE,MAAM,QAAQ,OAAO,YAAY,EAAE,MAAM,yBAAyB,MAAM,2BAA2B,MAAM,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,iBAQzF,CAAC,UAAU,MAAM,MAAM,YAAY;AAAA,WACzC,CAAC,UAAU,MAAM,MAAM,OAAO,MAAM,KAAK;AAAA;AAAA;",
|
|
6
6
|
"names": []
|
|
@@ -11,9 +11,9 @@ export declare namespace DSCardV2ActionAddonT {
|
|
|
11
11
|
icon?: JSX.Element;
|
|
12
12
|
innerRef: React.RefObject<HTMLButtonElement> | ((_ref: HTMLButtonElement) => void);
|
|
13
13
|
}
|
|
14
|
-
interface Props extends Partial<DefaultProps>, OptionalProps, Omit<GlobalAttributesT<HTMLButtonElement>, keyof DefaultProps | keyof OptionalProps | keyof
|
|
14
|
+
interface Props extends Partial<DefaultProps>, OptionalProps, Omit<GlobalAttributesT<HTMLButtonElement>, keyof DefaultProps | keyof OptionalProps | keyof XstyledProps>, XstyledProps, RequiredProps {
|
|
15
15
|
}
|
|
16
|
-
interface InternalProps extends DefaultProps, OptionalProps, Omit<GlobalAttributesT<HTMLButtonElement>, keyof DefaultProps | keyof OptionalProps | keyof
|
|
16
|
+
interface InternalProps extends DefaultProps, OptionalProps, Omit<GlobalAttributesT<HTMLButtonElement>, keyof DefaultProps | keyof OptionalProps | keyof XstyledProps>, XstyledProps, RequiredProps {
|
|
17
17
|
}
|
|
18
18
|
}
|
|
19
19
|
export declare const defaultProps: DSCardV2ActionAddonT.DefaultProps;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elliemae/ds-card-v2-action-addon",
|
|
3
|
-
"version": "3.22.0-next.
|
|
3
|
+
"version": "3.22.0-next.30",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "ICE MT - Dimsum - Card V2 Action Addon",
|
|
6
6
|
"files": [
|
|
@@ -37,17 +37,17 @@
|
|
|
37
37
|
"dependencies": {
|
|
38
38
|
"@xstyled/system": "~3.7.3",
|
|
39
39
|
"uid": "~2.0.1",
|
|
40
|
-
"@elliemae/ds-button-v2": "3.22.0-next.
|
|
41
|
-
"@elliemae/ds-
|
|
42
|
-
"@elliemae/ds-
|
|
43
|
-
"@elliemae/ds-utilities": "3.22.0-next.
|
|
40
|
+
"@elliemae/ds-button-v2": "3.22.0-next.30",
|
|
41
|
+
"@elliemae/ds-system": "3.22.0-next.30",
|
|
42
|
+
"@elliemae/ds-icons": "3.22.0-next.30",
|
|
43
|
+
"@elliemae/ds-utilities": "3.22.0-next.30"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
|
-
"@elliemae/pui-cli": "~9.0.0-next.
|
|
46
|
+
"@elliemae/pui-cli": "~9.0.0-next.22",
|
|
47
47
|
"jest-axe": "^7.0.1",
|
|
48
48
|
"lodash": "^4.17.21",
|
|
49
49
|
"styled-components": "~5.3.9",
|
|
50
|
-
"@elliemae/ds-monorepo-devops": "3.22.0-next.
|
|
50
|
+
"@elliemae/ds-monorepo-devops": "3.22.0-next.30"
|
|
51
51
|
},
|
|
52
52
|
"peerDependencies": {
|
|
53
53
|
"@testing-library/jest-dom": "~5.16.4",
|
|
@@ -62,15 +62,15 @@
|
|
|
62
62
|
"typeSafety": false
|
|
63
63
|
},
|
|
64
64
|
"scripts": {
|
|
65
|
-
"dev": "cross-env NODE_ENV=development node
|
|
65
|
+
"dev": "cross-env NODE_ENV=development node ../../../scripts/build/build.mjs --watch",
|
|
66
66
|
"test": "pui-cli test --passWithNoTests",
|
|
67
|
-
"lint": "node
|
|
68
|
-
"eslint:fix": "eslint --ext='.js,.jsx,.test.js,.ts,.tsx' --fix --config='
|
|
69
|
-
"dts": "node
|
|
67
|
+
"lint": "node ../../../scripts/lint.mjs --fix",
|
|
68
|
+
"eslint:fix": "eslint --ext='.js,.jsx,.test.js,.ts,.tsx' --fix --config='../../../.eslintrc.js' src/",
|
|
69
|
+
"dts": "node ../../../scripts/dts.mjs",
|
|
70
70
|
"dts:withdeps": "pnpm --filter {.}... dts",
|
|
71
|
-
"build": "cross-env NODE_ENV=production node
|
|
71
|
+
"build": "cross-env NODE_ENV=production node ../../../scripts/build/build.mjs",
|
|
72
72
|
"dev:build": "pnpm --filter {.}... build",
|
|
73
73
|
"dev:install": "pnpm --filter {.}... i --no-lockfile && pnpm run dev:build",
|
|
74
|
-
"checkDeps": "npx -yes
|
|
74
|
+
"checkDeps": "npx -yes ../../util/ds-codemods check-missing-packages --projectFolderPath=\"./\" --ignorePackagesGlobPattern=\"\" --ignoreFilesGlobPattern=\"**/test-ables/*,**/tests/*\""
|
|
75
75
|
}
|
|
76
76
|
}
|