@elliemae/ds-card-v3-poc 3.37.0-rc.4 → 3.37.0
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/CardV3.js
CHANGED
|
@@ -35,7 +35,7 @@ module.exports = __toCommonJS(CardV3_exports);
|
|
|
35
35
|
var React = __toESM(require("react"));
|
|
36
36
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
37
37
|
var import_react = require("react");
|
|
38
|
-
var
|
|
38
|
+
var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
|
|
39
39
|
var import_parts = require("./parts/index.js");
|
|
40
40
|
var import_styled = require("./styled.js");
|
|
41
41
|
var import_CardContext = require("./parts/CardContext.js");
|
|
@@ -44,7 +44,7 @@ const defaultProps = {
|
|
|
44
44
|
hasError: false
|
|
45
45
|
};
|
|
46
46
|
const Card = (props) => {
|
|
47
|
-
const propsWithDefault = (0,
|
|
47
|
+
const propsWithDefault = (0, import_ds_props_helpers.useMemoMergePropsWithDefault)(props, defaultProps);
|
|
48
48
|
const { children, hasError, disabled, isOverlay, onClick, isSelected, isMultiSelect } = propsWithDefault;
|
|
49
49
|
const StyledCardContainer = (0, import_react.useMemo)(() => {
|
|
50
50
|
if (onClick && !disabled) {
|
|
@@ -55,8 +55,8 @@ const Card = (props) => {
|
|
|
55
55
|
}
|
|
56
56
|
return import_styled.StyledCard;
|
|
57
57
|
}, [disabled, onClick]);
|
|
58
|
-
const globalsAttrs = (0,
|
|
59
|
-
const xstyledProps = (0,
|
|
58
|
+
const globalsAttrs = (0, import_ds_props_helpers.useGetGlobalAttributes)(propsWithDefault);
|
|
59
|
+
const xstyledProps = (0, import_ds_props_helpers.useGetXstyledProps)(propsWithDefault);
|
|
60
60
|
const getOwnerProps = (0, import_react.useCallback)(() => propsWithDefault, [propsWithDefault]);
|
|
61
61
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_CardContext.CardContext.Provider, { value: { isMultiSelect, disabled, isSelected, onClick }, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
62
62
|
StyledCardContainer,
|
package/dist/cjs/CardV3.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/CardV3.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["/* eslint-disable max-lines */\n/* eslint-disable @typescript-eslint/no-empty-interface */\n/* eslint-disable react/display-name */\nimport React, { useMemo, useCallback } from 'react';\nimport { useMemoMergePropsWithDefault, useGetXstyledProps, useGetGlobalAttributes } from '@elliemae/ds-
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;AD+Cf;AA5CR,mBAA4C;AAC5C,
|
|
4
|
+
"sourcesContent": ["/* eslint-disable max-lines */\n/* eslint-disable @typescript-eslint/no-empty-interface */\n/* eslint-disable react/display-name */\nimport React, { useMemo, useCallback } from 'react';\nimport { useMemoMergePropsWithDefault, useGetXstyledProps, useGetGlobalAttributes } from '@elliemae/ds-props-helpers';\nimport type { CardT } from './react-desc-prop-types.js';\nimport { FocusRing } from './parts/index.js';\nimport { CardActionArea, StyledButtonCard, StyledCard, StyledCardDisabled } from './styled.js';\nimport { CardContext } from './parts/CardContext.js';\nimport { DSCardV3DataTestIds } from './CardV3Definitions.js';\nimport type { DSGridT } from '@elliemae/ds-grid';\n\nexport const defaultProps: CardT.DefaultProps = {\n hasError: false,\n};\n\n// create acontext\n\nexport const Card: React.ComponentType<CardT.InternalProps> = (props) => {\n const propsWithDefault = useMemoMergePropsWithDefault<CardT.Props>(props, defaultProps);\n const { children, hasError, disabled, isOverlay, onClick, isSelected, isMultiSelect } = propsWithDefault;\n\n const StyledCardContainer = useMemo(() => {\n if (onClick && !disabled) {\n return StyledButtonCard;\n }\n if (disabled) {\n return StyledCardDisabled;\n }\n return StyledCard;\n }, [disabled, onClick]);\n\n const globalsAttrs = useGetGlobalAttributes<CardT.InternalProps, HTMLDivElement, DSGridT.Props>(propsWithDefault);\n const xstyledProps = useGetXstyledProps(propsWithDefault);\n const getOwnerProps = useCallback(() => propsWithDefault, [propsWithDefault]);\n\n return (\n <CardContext.Provider value={{ isMultiSelect, disabled, isSelected, onClick }}>\n <StyledCardContainer\n border=\"solid 1px neutral-100\"\n boxShadow=\"xs\"\n isOverlay={isOverlay}\n {...globalsAttrs}\n {...xstyledProps}\n data-disabled={disabled}\n data-selected={isSelected}\n >\n <FocusRing target={`[data-testid=${DSCardV3DataTestIds.ACTION_AREA}]`} hasError={hasError}>\n {onClick ? (\n <CardActionArea\n disabled={disabled}\n data-testid={DSCardV3DataTestIds.ACTION_AREA}\n aria-selected={isSelected}\n aria-multiselectable={isMultiSelect}\n aria-disabled={disabled}\n aria-invalid={hasError}\n getOwnerProps={getOwnerProps}\n />\n ) : null}\n {children}\n </FocusRing>\n </StyledCardContainer>\n </CardContext.Provider>\n );\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;AD+Cf;AA5CR,mBAA4C;AAC5C,8BAAyF;AAEzF,mBAA0B;AAC1B,oBAAiF;AACjF,yBAA4B;AAC5B,+BAAoC;AAG7B,MAAM,eAAmC;AAAA,EAC9C,UAAU;AACZ;AAIO,MAAM,OAAiD,CAAC,UAAU;AACvE,QAAM,uBAAmB,sDAA0C,OAAO,YAAY;AACtF,QAAM,EAAE,UAAU,UAAU,UAAU,WAAW,SAAS,YAAY,cAAc,IAAI;AAExF,QAAM,0BAAsB,sBAAQ,MAAM;AACxC,QAAI,WAAW,CAAC,UAAU;AACxB,aAAO;AAAA,IACT;AACA,QAAI,UAAU;AACZ,aAAO;AAAA,IACT;AACA,WAAO;AAAA,EACT,GAAG,CAAC,UAAU,OAAO,CAAC;AAEtB,QAAM,mBAAe,gDAA2E,gBAAgB;AAChH,QAAM,mBAAe,4CAAmB,gBAAgB;AACxD,QAAM,oBAAgB,0BAAY,MAAM,kBAAkB,CAAC,gBAAgB,CAAC;AAE5E,SACE,4CAAC,+BAAY,UAAZ,EAAqB,OAAO,EAAE,eAAe,UAAU,YAAY,QAAQ,GAC1E;AAAA,IAAC;AAAA;AAAA,MACC,QAAO;AAAA,MACP,WAAU;AAAA,MACV;AAAA,MACC,GAAG;AAAA,MACH,GAAG;AAAA,MACJ,iBAAe;AAAA,MACf,iBAAe;AAAA,MAEf,uDAAC,0BAAU,QAAQ,gBAAgB,6CAAoB,WAAW,KAAK,UACpE;AAAA,kBACC;AAAA,UAAC;AAAA;AAAA,YACC;AAAA,YACA,eAAa,6CAAoB;AAAA,YACjC,iBAAe;AAAA,YACf,wBAAsB;AAAA,YACtB,iBAAe;AAAA,YACf,gBAAc;AAAA,YACd;AAAA;AAAA,QACF,IACE;AAAA,QACH;AAAA,SACH;AAAA;AAAA,EACF,GACF;AAEJ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/react-desc-prop-types.ts", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import { type GlobalAttributesT } from '@elliemae/ds-
|
|
4
|
+
"sourcesContent": ["import { type GlobalAttributesT } from '@elliemae/ds-props-helpers';\nimport { type DSGridT } from '@elliemae/ds-grid';\n\nexport declare namespace CardT {\n export interface RequiredProps {\n children: React.ReactNode;\n }\n\n export interface OptinalProps {\n isSelected?: boolean;\n isMultiSelect?: boolean;\n isOverlay?: boolean;\n onClick?: (event: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;\n }\n\n export interface DefaultProps {\n hasError: boolean;\n }\n\n export interface Props\n extends RequiredProps,\n Omit<GlobalAttributesT<HTMLButtonElement>, keyof DefaultProps | keyof RequiredProps>,\n OptinalProps,\n DefaultProps {}\n export interface InternalProps\n extends RequiredProps,\n Omit<GlobalAttributesT<HTMLButtonElement>, keyof DefaultProps | keyof RequiredProps>,\n OptinalProps,\n Partial<DefaultProps> {}\n\n export interface CardSelectIndicatorProps {\n isSelected?: boolean;\n isMultiSelect?: boolean;\n }\n\n export interface FocusRingProps {\n target: string;\n children: React.ReactNode;\n hasError?: boolean;\n }\n\n export interface CardElementsProps extends Partial<DSGridT.InternalProps> {\n children: React.ReactNode;\n }\n}\n\nexport interface CardContextProps {\n onClick?: (event: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;\n isSelected?: boolean;\n isMultiSelect?: boolean;\n disabled?: boolean;\n}\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
5
|
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;ACAA,YAAuB;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/esm/CardV3.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { useMemo, useCallback } from "react";
|
|
4
|
-
import { useMemoMergePropsWithDefault, useGetXstyledProps, useGetGlobalAttributes } from "@elliemae/ds-
|
|
4
|
+
import { useMemoMergePropsWithDefault, useGetXstyledProps, useGetGlobalAttributes } from "@elliemae/ds-props-helpers";
|
|
5
5
|
import { FocusRing } from "./parts/index.js";
|
|
6
6
|
import { CardActionArea, StyledButtonCard, StyledCard, StyledCardDisabled } from "./styled.js";
|
|
7
7
|
import { CardContext } from "./parts/CardContext.js";
|
package/dist/esm/CardV3.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/CardV3.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-lines */\n/* eslint-disable @typescript-eslint/no-empty-interface */\n/* eslint-disable react/display-name */\nimport React, { useMemo, useCallback } from 'react';\nimport { useMemoMergePropsWithDefault, useGetXstyledProps, useGetGlobalAttributes } from '@elliemae/ds-
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-lines */\n/* eslint-disable @typescript-eslint/no-empty-interface */\n/* eslint-disable react/display-name */\nimport React, { useMemo, useCallback } from 'react';\nimport { useMemoMergePropsWithDefault, useGetXstyledProps, useGetGlobalAttributes } from '@elliemae/ds-props-helpers';\nimport type { CardT } from './react-desc-prop-types.js';\nimport { FocusRing } from './parts/index.js';\nimport { CardActionArea, StyledButtonCard, StyledCard, StyledCardDisabled } from './styled.js';\nimport { CardContext } from './parts/CardContext.js';\nimport { DSCardV3DataTestIds } from './CardV3Definitions.js';\nimport type { DSGridT } from '@elliemae/ds-grid';\n\nexport const defaultProps: CardT.DefaultProps = {\n hasError: false,\n};\n\n// create acontext\n\nexport const Card: React.ComponentType<CardT.InternalProps> = (props) => {\n const propsWithDefault = useMemoMergePropsWithDefault<CardT.Props>(props, defaultProps);\n const { children, hasError, disabled, isOverlay, onClick, isSelected, isMultiSelect } = propsWithDefault;\n\n const StyledCardContainer = useMemo(() => {\n if (onClick && !disabled) {\n return StyledButtonCard;\n }\n if (disabled) {\n return StyledCardDisabled;\n }\n return StyledCard;\n }, [disabled, onClick]);\n\n const globalsAttrs = useGetGlobalAttributes<CardT.InternalProps, HTMLDivElement, DSGridT.Props>(propsWithDefault);\n const xstyledProps = useGetXstyledProps(propsWithDefault);\n const getOwnerProps = useCallback(() => propsWithDefault, [propsWithDefault]);\n\n return (\n <CardContext.Provider value={{ isMultiSelect, disabled, isSelected, onClick }}>\n <StyledCardContainer\n border=\"solid 1px neutral-100\"\n boxShadow=\"xs\"\n isOverlay={isOverlay}\n {...globalsAttrs}\n {...xstyledProps}\n data-disabled={disabled}\n data-selected={isSelected}\n >\n <FocusRing target={`[data-testid=${DSCardV3DataTestIds.ACTION_AREA}]`} hasError={hasError}>\n {onClick ? (\n <CardActionArea\n disabled={disabled}\n data-testid={DSCardV3DataTestIds.ACTION_AREA}\n aria-selected={isSelected}\n aria-multiselectable={isMultiSelect}\n aria-disabled={disabled}\n aria-invalid={hasError}\n getOwnerProps={getOwnerProps}\n />\n ) : null}\n {children}\n </FocusRing>\n </StyledCardContainer>\n </CardContext.Provider>\n );\n};\n"],
|
|
5
5
|
"mappings": "AAAA,YAAY,WAAW;AC+Cf,SAEI,KAFJ;AA5CR,SAAgB,SAAS,mBAAmB;AAC5C,SAAS,8BAA8B,oBAAoB,8BAA8B;AAEzF,SAAS,iBAAiB;AAC1B,SAAS,gBAAgB,kBAAkB,YAAY,0BAA0B;AACjF,SAAS,mBAAmB;AAC5B,SAAS,2BAA2B;AAG7B,MAAM,eAAmC;AAAA,EAC9C,UAAU;AACZ;AAIO,MAAM,OAAiD,CAAC,UAAU;AACvE,QAAM,mBAAmB,6BAA0C,OAAO,YAAY;AACtF,QAAM,EAAE,UAAU,UAAU,UAAU,WAAW,SAAS,YAAY,cAAc,IAAI;AAExF,QAAM,sBAAsB,QAAQ,MAAM;AACxC,QAAI,WAAW,CAAC,UAAU;AACxB,aAAO;AAAA,IACT;AACA,QAAI,UAAU;AACZ,aAAO;AAAA,IACT;AACA,WAAO;AAAA,EACT,GAAG,CAAC,UAAU,OAAO,CAAC;AAEtB,QAAM,eAAe,uBAA2E,gBAAgB;AAChH,QAAM,eAAe,mBAAmB,gBAAgB;AACxD,QAAM,gBAAgB,YAAY,MAAM,kBAAkB,CAAC,gBAAgB,CAAC;AAE5E,SACE,oBAAC,YAAY,UAAZ,EAAqB,OAAO,EAAE,eAAe,UAAU,YAAY,QAAQ,GAC1E;AAAA,IAAC;AAAA;AAAA,MACC,QAAO;AAAA,MACP,WAAU;AAAA,MACV;AAAA,MACC,GAAG;AAAA,MACH,GAAG;AAAA,MACJ,iBAAe;AAAA,MACf,iBAAe;AAAA,MAEf,+BAAC,aAAU,QAAQ,gBAAgB,oBAAoB,WAAW,KAAK,UACpE;AAAA,kBACC;AAAA,UAAC;AAAA;AAAA,YACC;AAAA,YACA,eAAa,oBAAoB;AAAA,YACjC,iBAAe;AAAA,YACf,wBAAsB;AAAA,YACtB,iBAAe;AAAA,YACf,gBAAc;AAAA,YACd;AAAA;AAAA,QACF,IACE;AAAA,QACH;AAAA,SACH;AAAA;AAAA,EACF,GACF;AAEJ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { type GlobalAttributesT } from '@elliemae/ds-
|
|
2
|
+
import { type GlobalAttributesT } from '@elliemae/ds-props-helpers';
|
|
3
3
|
import { type DSGridT } from '@elliemae/ds-grid';
|
|
4
4
|
export declare namespace CardT {
|
|
5
5
|
interface RequiredProps {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elliemae/ds-card-v3-poc",
|
|
3
|
-
"version": "3.37.0
|
|
3
|
+
"version": "3.37.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "ICE MT - Dimsum - Card V3",
|
|
6
6
|
"files": [
|
|
@@ -36,18 +36,17 @@
|
|
|
36
36
|
"indent": 4
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@elliemae/ds-form-radio": "3.37.0
|
|
40
|
-
"@elliemae/ds-
|
|
41
|
-
"@elliemae/ds-
|
|
42
|
-
"@elliemae/ds-
|
|
43
|
-
"@elliemae/ds-utilities": "3.37.0-rc.4"
|
|
39
|
+
"@elliemae/ds-form-radio": "3.37.0",
|
|
40
|
+
"@elliemae/ds-grid": "3.37.0",
|
|
41
|
+
"@elliemae/ds-props-helpers": "3.37.0",
|
|
42
|
+
"@elliemae/ds-system": "3.37.0"
|
|
44
43
|
},
|
|
45
44
|
"devDependencies": {
|
|
46
45
|
"@elliemae/pui-cli": "9.0.0-next.50",
|
|
47
46
|
"@elliemae/pui-theme": "~2.9.3",
|
|
48
47
|
"styled-components": "~5.3.9",
|
|
49
48
|
"styled-system": "~5.1.5",
|
|
50
|
-
"@elliemae/ds-monorepo-devops": "3.37.0
|
|
49
|
+
"@elliemae/ds-monorepo-devops": "3.37.0"
|
|
51
50
|
},
|
|
52
51
|
"peerDependencies": {
|
|
53
52
|
"@elliemae/pui-theme": "~2.9.3",
|