@elliemae/ds-card-v2 3.22.0-next.22 → 3.22.0-next.24

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.
@@ -0,0 +1,189 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var CardV3_exports = {};
30
+ __export(CardV3_exports, {
31
+ Card: () => Card,
32
+ CardActionArea: () => CardActionArea,
33
+ CardContent: () => CardContent,
34
+ CardFooter: () => CardFooter,
35
+ CardSelectIndicator: () => CardSelectIndicator,
36
+ DSCardV3DataTestIds: () => DSCardV3DataTestIds,
37
+ DSCardV3Name: () => DSCardV3Name,
38
+ DSCardV3Slots: () => DSCardV3Slots,
39
+ StyledButtonCard: () => StyledButtonCard,
40
+ StyledCard: () => StyledCard,
41
+ StyledCardDisabled: () => StyledCardDisabled,
42
+ StyledCardError: () => StyledCardError,
43
+ StyledCardSingleIndicator: () => StyledCardSingleIndicator,
44
+ defaultProps: () => defaultProps
45
+ });
46
+ module.exports = __toCommonJS(CardV3_exports);
47
+ var React = __toESM(require("react"));
48
+ var import_jsx_runtime = require("react/jsx-runtime");
49
+ var import_react = __toESM(require("react"));
50
+ var import_lodash = require("lodash");
51
+ var import_ds_grid = require("@elliemae/ds-grid");
52
+ var import_ds_system = require("@elliemae/ds-system");
53
+ var import_ds_controlled_form = require("@elliemae/ds-controlled-form");
54
+ var import_ds_utilities = require("@elliemae/ds-utilities");
55
+ const DSCardV3Name = "DSCardV3";
56
+ const DSCardV3Slots = {
57
+ ACTION_AREA: "action-area"
58
+ };
59
+ const DSCardV3DataTestIds = (0, import_ds_system.slotObjectToDataTestIds)(DSCardV3Name, DSCardV3Slots);
60
+ const defaultProps = {
61
+ hasError: false
62
+ };
63
+ const CardActionArea = (0, import_ds_system.styled)("button", {
64
+ name: DSCardV3Name,
65
+ slot: DSCardV3Slots.ACTION_AREA
66
+ })`
67
+ border: none;
68
+ background-color: transparent;
69
+ width: 0px;
70
+ height: 0px;
71
+ padding: 0;
72
+ &:focus {
73
+ outline: none;
74
+ }
75
+ text-align: unset;
76
+ `;
77
+ const StyledCard = (0, import_ds_system.styled)(import_ds_grid.Grid)`
78
+ background-color: ${({ theme, isOverlay }) => isOverlay ? theme.colors.neutral["080"] : "white"};
79
+ outline-offset: -2px;
80
+ * {
81
+ color: ${({ theme, isOverlay }) => isOverlay ? theme.colors.neutral["500"] : "inherit"};
82
+ }
83
+ `;
84
+ const StyledButtonCard = (0, import_ds_system.styled)(StyledCard)`
85
+ cursor: pointer;
86
+ `;
87
+ const StyledCardError = (0, import_ds_system.styled)(StyledCard)`
88
+ outline: ${({ theme }) => `2px solid ${theme.colors.danger[900]}`};
89
+ `;
90
+ const StyledCardSingleIndicator = (0, import_ds_system.styled)(import_ds_grid.Grid)`
91
+ width: 4px;
92
+ align-self: normal;
93
+ background-color: ${({ theme, isSelected }) => isSelected ? theme.colors.brand["700"] : theme.colors.brand["300"]};
94
+ transition: background-color 0.1s ease-in-out;
95
+ `;
96
+ const StyledCardDisabled = (0, import_ds_system.styled)(StyledCard)`
97
+ cursor: not-allowed;
98
+ user-select: none;
99
+ opacity: 0.5;
100
+ ${StyledCardSingleIndicator} {
101
+ background-color: ${({ theme, isSelected }) => isSelected ? theme.colors.neutral["800"] : theme.colors.neutral["080"]};
102
+ }
103
+
104
+ ${CardActionArea} {
105
+ pointer-events: none;
106
+ }
107
+ `;
108
+ const CardContent = (0, import_ds_system.styled)(import_ds_grid.Grid)``;
109
+ const CardFooter = (0, import_ds_system.styled)(import_ds_grid.Grid)`
110
+ border-top: 1px solid ${({ theme }) => theme.colors.neutral["200"]};
111
+ `;
112
+ const CardSelectIndicator = (props) => {
113
+ const { isSelected, isMultiSelect } = props;
114
+ if (isMultiSelect) {
115
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ds_grid.Grid, { alignItems: "center", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ds_controlled_form.PresentationalRadio, { checked: isSelected, "aria-label": "@todo" }) });
116
+ }
117
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(StyledCardSingleIndicator, { isSelected });
118
+ };
119
+ const StyledFocusRing = (0, import_ds_system.styled)(import_ds_grid.Grid)`
120
+ width: 100%;
121
+ height: 100%;
122
+ outline-offset: -1px;
123
+ outline: ${({ showFocusRing, hasError, theme }) => {
124
+ if (showFocusRing) {
125
+ return `2px solid ${theme.colors.brand[700]}`;
126
+ }
127
+ if (hasError) {
128
+ return `2px solid ${theme.colors.danger[900]}`;
129
+ }
130
+ return "none";
131
+ }};
132
+ `;
133
+ const FocusRing = (props) => {
134
+ const { target, children, hasError } = props;
135
+ const [showFocusRing, setShowFocusingRing] = import_react.default.useState(false);
136
+ const handleOnFocus = import_react.default.useCallback(
137
+ (e) => {
138
+ if (e.target.matches(target)) {
139
+ setShowFocusingRing(true);
140
+ }
141
+ },
142
+ [target]
143
+ );
144
+ const handleOnBlur = import_react.default.useCallback(
145
+ (e) => {
146
+ if (e.target.matches(target)) {
147
+ setShowFocusingRing(false);
148
+ }
149
+ },
150
+ [target]
151
+ );
152
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
153
+ StyledFocusRing,
154
+ {
155
+ hasError,
156
+ onFocusCapture: handleOnFocus,
157
+ onBlurCapture: handleOnBlur,
158
+ showFocusRing,
159
+ children
160
+ }
161
+ );
162
+ };
163
+ const Card = (props) => {
164
+ const propsWithDefault = (0, import_ds_utilities.useMemoMergePropsWithDefault)(props, defaultProps);
165
+ const { children, hasError, disabled, isOverlay, onClick } = propsWithDefault;
166
+ const StyledCardContainer = (0, import_react.useMemo)(() => {
167
+ if (onClick && !disabled) {
168
+ return StyledButtonCard;
169
+ }
170
+ if (disabled) {
171
+ return StyledCardDisabled;
172
+ }
173
+ return StyledCard;
174
+ }, [disabled, onClick]);
175
+ const globalsAttrs = (0, import_lodash.omit)((0, import_ds_utilities.useGetGlobalAttributes)(propsWithDefault), ["cols", "rows", "wrap"]);
176
+ const getOwnerProps = (0, import_react.useCallback)(() => propsWithDefault, [propsWithDefault]);
177
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(StyledCardContainer, { border: "solid 1px neutral-100", boxShadow: "xs", isOverlay, ...globalsAttrs, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(FocusRing, { target: `[data-testid=${DSCardV3DataTestIds.ACTION_AREA}]`, hasError, children: [
178
+ onClick ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
179
+ CardActionArea,
180
+ {
181
+ disabled,
182
+ "data-testid": DSCardV3DataTestIds.ACTION_AREA,
183
+ getOwnerProps
184
+ }
185
+ ) : null,
186
+ children
187
+ ] }) });
188
+ };
189
+ //# sourceMappingURL=CardV3.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 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 { omit } from 'lodash';\nimport { Grid } from '@elliemae/ds-grid';\nimport { styled, slotObjectToDataTestIds } from '@elliemae/ds-system';\nimport { PresentationalRadio } from '@elliemae/ds-controlled-form';\n\nimport { useMemoMergePropsWithDefault, useGetGlobalAttributes, type GlobalAttributesT } from '@elliemae/ds-utilities';\n\nexport const DSCardV3Name = 'DSCardV3';\nexport const DSCardV3Slots = {\n ACTION_AREA: 'action-area',\n};\n\nexport const DSCardV3DataTestIds = slotObjectToDataTestIds(DSCardV3Name, DSCardV3Slots);\n\ndeclare 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\nexport const defaultProps: CardT.DefaultProps = {\n hasError: false,\n};\n\nexport const CardActionArea = styled('button', {\n name: DSCardV3Name,\n slot: DSCardV3Slots.ACTION_AREA,\n})`\n border: none;\n background-color: transparent;\n width: 0px;\n height: 0px;\n padding: 0;\n &:focus {\n outline: none;\n }\n text-align: unset;\n`;\n\n// START style cards variants\nexport const StyledCard = styled(Grid)<{\n isOverlay?: boolean;\n onClick?: (e: React.MouseEvent<HTMLDivElement, MouseEvent>) => void;\n}>`\n background-color: ${({ theme, isOverlay }) => (isOverlay ? theme.colors.neutral['080'] : 'white')};\n outline-offset: -2px;\n * {\n color: ${({ theme, isOverlay }) => (isOverlay ? theme.colors.neutral['500'] : 'inherit')};\n }\n`;\n\nexport const StyledButtonCard = styled(StyledCard)<{ isOverlay?: boolean }>`\n cursor: pointer;\n`;\n\nexport const StyledCardError = styled(StyledCard)`\n outline: ${({ theme }) => `2px solid ${theme.colors.danger[900]}`};\n`;\n\nexport const StyledCardSingleIndicator = styled(Grid)<{ isSelected?: boolean }>`\n width: 4px;\n align-self: normal;\n background-color: ${({ theme, isSelected }) => (isSelected ? theme.colors.brand['700'] : theme.colors.brand['300'])};\n transition: background-color 0.1s ease-in-out;\n`;\n\nexport const StyledCardDisabled = styled(StyledCard)`\n cursor: not-allowed;\n user-select: none;\n opacity: 0.5;\n ${StyledCardSingleIndicator} {\n background-color: ${({ theme, isSelected }) =>\n isSelected ? theme.colors.neutral['800'] : theme.colors.neutral['080']};\n }\n\n ${CardActionArea} {\n pointer-events: none;\n }\n`;\n// END style cards variants\nexport const CardContent = styled(Grid)``;\n\nexport const CardFooter = styled(Grid)`\n border-top: 1px solid ${({ theme }) => theme.colors.neutral['200']};\n`;\n\nexport const CardSelectIndicator = (props: CardT.CardSelectIndicatorProps) => {\n const { isSelected, isMultiSelect } = props;\n if (isMultiSelect) {\n return (\n <Grid alignItems=\"center\">\n <PresentationalRadio checked={isSelected} aria-label=\"@todo\" />\n </Grid>\n );\n }\n return <StyledCardSingleIndicator isSelected={isSelected} />;\n};\n\nconst StyledFocusRing = styled(Grid)<{ showFocusRing: boolean; hasError?: boolean }>`\n width: 100%;\n height: 100%;\n outline-offset: -1px;\n outline: ${({ showFocusRing, hasError, theme }) => {\n if (showFocusRing) {\n return `2px solid ${theme.colors.brand[700]}`;\n }\n if (hasError) {\n return `2px solid ${theme.colors.danger[900]}`;\n }\n return 'none';\n }};\n`;\n\ninterface FocusRingProps {\n target: string;\n children: React.ReactNode;\n hasError?: boolean;\n}\nconst FocusRing = (props: FocusRingProps) => {\n const { target, children, hasError } = props;\n const [showFocusRing, setShowFocusingRing] = React.useState(false);\n const handleOnFocus: React.FocusEventHandler<HTMLDivElement> = React.useCallback(\n (e) => {\n if (e.target.matches(target)) {\n setShowFocusingRing(true);\n }\n },\n [target],\n );\n\n const handleOnBlur: React.FocusEventHandler<HTMLDivElement> = React.useCallback(\n (e) => {\n if (e.target.matches(target)) {\n setShowFocusingRing(false);\n }\n },\n [target],\n );\n return (\n <StyledFocusRing\n hasError={hasError}\n onFocusCapture={handleOnFocus}\n onBlurCapture={handleOnBlur}\n showFocusRing={showFocusRing}\n >\n {children}\n </StyledFocusRing>\n );\n};\n\nexport const Card: React.ComponentType<CardT.InternalProps> = (props) => {\n const propsWithDefault = useMemoMergePropsWithDefault<CardT.Props>(props, defaultProps);\n const { children, hasError, disabled, isOverlay, onClick } = propsWithDefault;\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 = omit(useGetGlobalAttributes(propsWithDefault), ['cols', 'rows', 'wrap']);\n const getOwnerProps = useCallback(() => propsWithDefault, [propsWithDefault]);\n\n return (\n <StyledCardContainer border=\"solid 1px neutral-100\" boxShadow=\"xs\" isOverlay={isOverlay} {...globalsAttrs}>\n <FocusRing target={`[data-testid=${DSCardV3DataTestIds.ACTION_AREA}]`} hasError={hasError}>\n {onClick ? (\n <CardActionArea\n disabled={disabled}\n data-testid={DSCardV3DataTestIds.ACTION_AREA}\n getOwnerProps={getOwnerProps}\n />\n ) : null}\n {children}\n </FocusRing>\n </StyledCardContainer>\n );\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;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A,MACA,gBAAgB;AAAA,MAChB,eAAe;AAAA,MACf;AAAA,MAEC;AAAA;AAAA,EACH;AAEJ;AAEO,MAAM,OAAiD,CAAC,UAAU;AACvE,QAAM,uBAAmB,kDAA0C,OAAO,YAAY;AACtF,QAAM,EAAE,UAAU,UAAU,UAAU,WAAW,QAAQ,IAAI;AAC7D,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,wBAAK,4CAAuB,gBAAgB,GAAG,CAAC,QAAQ,QAAQ,MAAM,CAAC;AAC5F,QAAM,oBAAgB,0BAAY,MAAM,kBAAkB,CAAC,gBAAgB,CAAC;AAE5E,SACE,4CAAC,uBAAoB,QAAO,yBAAwB,WAAU,MAAK,WAAuB,GAAG,cAC3F,uDAAC,aAAU,QAAQ,gBAAgB,oBAAoB,gBAAgB,UACpE;AAAA,cACC;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA,eAAa,oBAAoB;AAAA,QACjC;AAAA;AAAA,IACF,IACE;AAAA,IACH;AAAA,KACH,GACF;AAEJ;",
6
+ "names": ["React"]
7
+ }
package/dist/cjs/index.js CHANGED
@@ -17,6 +17,7 @@ var __copyProps = (to, from, except, desc) => {
17
17
  }
18
18
  return to;
19
19
  };
20
+ var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
20
21
  var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
22
  // If the importer is in node compatibility mode or this is not an ESM
22
23
  // file that has been converted to a CommonJS file using a Babel-
@@ -39,4 +40,5 @@ var React = __toESM(require("react"));
39
40
  var import_DSCardV2 = require("./DSCardV2.js");
40
41
  var import_react_desc_prop_types = require("./react-desc-prop-types.js");
41
42
  var import_constants = require("./constants/index.js");
43
+ __reExport(src_exports, require("./CardV3.js"), module.exports);
42
44
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/index.ts", "../../../../scripts/build/transpile/react-shim.js"],
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 DSCardV2,\n DSCardV2 as CustomCard,\n DSCardV2WithSchema,\n DSCardV2WithSchema as DSCardCustomWithSchema,\n} from './DSCardV2.js';\nexport { type DSCardV2T } from './react-desc-prop-types.js';\nexport { CARD_V2_DATA_TESTID } from './constants/index.js';\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADGvB,sBAKO;AACP,mCAA+B;AAC/B,uBAAoC;",
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 DSCardV2,\n DSCardV2 as CustomCard,\n DSCardV2WithSchema,\n DSCardV2WithSchema as DSCardCustomWithSchema,\n} from './DSCardV2.js';\nexport { type DSCardV2T } from './react-desc-prop-types.js';\nexport { CARD_V2_DATA_TESTID } from './constants/index.js';\nexport * from './CardV3.js';\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADGvB,sBAKO;AACP,mCAA+B;AAC/B,uBAAoC;AACpC,wBAAc,wBAXd;",
6
6
  "names": []
7
7
  }
@@ -0,0 +1,159 @@
1
+ import * as React from "react";
2
+ import { jsx, jsxs } from "react/jsx-runtime";
3
+ import React2, { useMemo, useCallback } from "react";
4
+ import { omit } from "lodash";
5
+ import { Grid } from "@elliemae/ds-grid";
6
+ import { styled, slotObjectToDataTestIds } from "@elliemae/ds-system";
7
+ import { PresentationalRadio } from "@elliemae/ds-controlled-form";
8
+ import { useMemoMergePropsWithDefault, useGetGlobalAttributes } from "@elliemae/ds-utilities";
9
+ const DSCardV3Name = "DSCardV3";
10
+ const DSCardV3Slots = {
11
+ ACTION_AREA: "action-area"
12
+ };
13
+ const DSCardV3DataTestIds = slotObjectToDataTestIds(DSCardV3Name, DSCardV3Slots);
14
+ const defaultProps = {
15
+ hasError: false
16
+ };
17
+ const CardActionArea = styled("button", {
18
+ name: DSCardV3Name,
19
+ slot: DSCardV3Slots.ACTION_AREA
20
+ })`
21
+ border: none;
22
+ background-color: transparent;
23
+ width: 0px;
24
+ height: 0px;
25
+ padding: 0;
26
+ &:focus {
27
+ outline: none;
28
+ }
29
+ text-align: unset;
30
+ `;
31
+ const StyledCard = styled(Grid)`
32
+ background-color: ${({ theme, isOverlay }) => isOverlay ? theme.colors.neutral["080"] : "white"};
33
+ outline-offset: -2px;
34
+ * {
35
+ color: ${({ theme, isOverlay }) => isOverlay ? theme.colors.neutral["500"] : "inherit"};
36
+ }
37
+ `;
38
+ const StyledButtonCard = styled(StyledCard)`
39
+ cursor: pointer;
40
+ `;
41
+ const StyledCardError = styled(StyledCard)`
42
+ outline: ${({ theme }) => `2px solid ${theme.colors.danger[900]}`};
43
+ `;
44
+ const StyledCardSingleIndicator = styled(Grid)`
45
+ width: 4px;
46
+ align-self: normal;
47
+ background-color: ${({ theme, isSelected }) => isSelected ? theme.colors.brand["700"] : theme.colors.brand["300"]};
48
+ transition: background-color 0.1s ease-in-out;
49
+ `;
50
+ const StyledCardDisabled = styled(StyledCard)`
51
+ cursor: not-allowed;
52
+ user-select: none;
53
+ opacity: 0.5;
54
+ ${StyledCardSingleIndicator} {
55
+ background-color: ${({ theme, isSelected }) => isSelected ? theme.colors.neutral["800"] : theme.colors.neutral["080"]};
56
+ }
57
+
58
+ ${CardActionArea} {
59
+ pointer-events: none;
60
+ }
61
+ `;
62
+ const CardContent = styled(Grid)``;
63
+ const CardFooter = styled(Grid)`
64
+ border-top: 1px solid ${({ theme }) => theme.colors.neutral["200"]};
65
+ `;
66
+ const CardSelectIndicator = (props) => {
67
+ const { isSelected, isMultiSelect } = props;
68
+ if (isMultiSelect) {
69
+ return /* @__PURE__ */ jsx(Grid, { alignItems: "center", children: /* @__PURE__ */ jsx(PresentationalRadio, { checked: isSelected, "aria-label": "@todo" }) });
70
+ }
71
+ return /* @__PURE__ */ jsx(StyledCardSingleIndicator, { isSelected });
72
+ };
73
+ const StyledFocusRing = styled(Grid)`
74
+ width: 100%;
75
+ height: 100%;
76
+ outline-offset: -1px;
77
+ outline: ${({ showFocusRing, hasError, theme }) => {
78
+ if (showFocusRing) {
79
+ return `2px solid ${theme.colors.brand[700]}`;
80
+ }
81
+ if (hasError) {
82
+ return `2px solid ${theme.colors.danger[900]}`;
83
+ }
84
+ return "none";
85
+ }};
86
+ `;
87
+ const FocusRing = (props) => {
88
+ const { target, children, hasError } = props;
89
+ const [showFocusRing, setShowFocusingRing] = React2.useState(false);
90
+ const handleOnFocus = React2.useCallback(
91
+ (e) => {
92
+ if (e.target.matches(target)) {
93
+ setShowFocusingRing(true);
94
+ }
95
+ },
96
+ [target]
97
+ );
98
+ const handleOnBlur = React2.useCallback(
99
+ (e) => {
100
+ if (e.target.matches(target)) {
101
+ setShowFocusingRing(false);
102
+ }
103
+ },
104
+ [target]
105
+ );
106
+ return /* @__PURE__ */ jsx(
107
+ StyledFocusRing,
108
+ {
109
+ hasError,
110
+ onFocusCapture: handleOnFocus,
111
+ onBlurCapture: handleOnBlur,
112
+ showFocusRing,
113
+ children
114
+ }
115
+ );
116
+ };
117
+ const Card = (props) => {
118
+ const propsWithDefault = useMemoMergePropsWithDefault(props, defaultProps);
119
+ const { children, hasError, disabled, isOverlay, onClick } = propsWithDefault;
120
+ const StyledCardContainer = useMemo(() => {
121
+ if (onClick && !disabled) {
122
+ return StyledButtonCard;
123
+ }
124
+ if (disabled) {
125
+ return StyledCardDisabled;
126
+ }
127
+ return StyledCard;
128
+ }, [disabled, onClick]);
129
+ const globalsAttrs = omit(useGetGlobalAttributes(propsWithDefault), ["cols", "rows", "wrap"]);
130
+ const getOwnerProps = useCallback(() => propsWithDefault, [propsWithDefault]);
131
+ return /* @__PURE__ */ jsx(StyledCardContainer, { border: "solid 1px neutral-100", boxShadow: "xs", isOverlay, ...globalsAttrs, children: /* @__PURE__ */ jsxs(FocusRing, { target: `[data-testid=${DSCardV3DataTestIds.ACTION_AREA}]`, hasError, children: [
132
+ onClick ? /* @__PURE__ */ jsx(
133
+ CardActionArea,
134
+ {
135
+ disabled,
136
+ "data-testid": DSCardV3DataTestIds.ACTION_AREA,
137
+ getOwnerProps
138
+ }
139
+ ) : null,
140
+ children
141
+ ] }) });
142
+ };
143
+ export {
144
+ Card,
145
+ CardActionArea,
146
+ CardContent,
147
+ CardFooter,
148
+ CardSelectIndicator,
149
+ DSCardV3DataTestIds,
150
+ DSCardV3Name,
151
+ DSCardV3Slots,
152
+ StyledButtonCard,
153
+ StyledCard,
154
+ StyledCardDisabled,
155
+ StyledCardError,
156
+ StyledCardSingleIndicator,
157
+ defaultProps
158
+ };
159
+ //# sourceMappingURL=CardV3.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 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 { omit } from 'lodash';\nimport { Grid } from '@elliemae/ds-grid';\nimport { styled, slotObjectToDataTestIds } from '@elliemae/ds-system';\nimport { PresentationalRadio } from '@elliemae/ds-controlled-form';\n\nimport { useMemoMergePropsWithDefault, useGetGlobalAttributes, type GlobalAttributesT } from '@elliemae/ds-utilities';\n\nexport const DSCardV3Name = 'DSCardV3';\nexport const DSCardV3Slots = {\n ACTION_AREA: 'action-area',\n};\n\nexport const DSCardV3DataTestIds = slotObjectToDataTestIds(DSCardV3Name, DSCardV3Slots);\n\ndeclare 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\nexport const defaultProps: CardT.DefaultProps = {\n hasError: false,\n};\n\nexport const CardActionArea = styled('button', {\n name: DSCardV3Name,\n slot: DSCardV3Slots.ACTION_AREA,\n})`\n border: none;\n background-color: transparent;\n width: 0px;\n height: 0px;\n padding: 0;\n &:focus {\n outline: none;\n }\n text-align: unset;\n`;\n\n// START style cards variants\nexport const StyledCard = styled(Grid)<{\n isOverlay?: boolean;\n onClick?: (e: React.MouseEvent<HTMLDivElement, MouseEvent>) => void;\n}>`\n background-color: ${({ theme, isOverlay }) => (isOverlay ? theme.colors.neutral['080'] : 'white')};\n outline-offset: -2px;\n * {\n color: ${({ theme, isOverlay }) => (isOverlay ? theme.colors.neutral['500'] : 'inherit')};\n }\n`;\n\nexport const StyledButtonCard = styled(StyledCard)<{ isOverlay?: boolean }>`\n cursor: pointer;\n`;\n\nexport const StyledCardError = styled(StyledCard)`\n outline: ${({ theme }) => `2px solid ${theme.colors.danger[900]}`};\n`;\n\nexport const StyledCardSingleIndicator = styled(Grid)<{ isSelected?: boolean }>`\n width: 4px;\n align-self: normal;\n background-color: ${({ theme, isSelected }) => (isSelected ? theme.colors.brand['700'] : theme.colors.brand['300'])};\n transition: background-color 0.1s ease-in-out;\n`;\n\nexport const StyledCardDisabled = styled(StyledCard)`\n cursor: not-allowed;\n user-select: none;\n opacity: 0.5;\n ${StyledCardSingleIndicator} {\n background-color: ${({ theme, isSelected }) =>\n isSelected ? theme.colors.neutral['800'] : theme.colors.neutral['080']};\n }\n\n ${CardActionArea} {\n pointer-events: none;\n }\n`;\n// END style cards variants\nexport const CardContent = styled(Grid)``;\n\nexport const CardFooter = styled(Grid)`\n border-top: 1px solid ${({ theme }) => theme.colors.neutral['200']};\n`;\n\nexport const CardSelectIndicator = (props: CardT.CardSelectIndicatorProps) => {\n const { isSelected, isMultiSelect } = props;\n if (isMultiSelect) {\n return (\n <Grid alignItems=\"center\">\n <PresentationalRadio checked={isSelected} aria-label=\"@todo\" />\n </Grid>\n );\n }\n return <StyledCardSingleIndicator isSelected={isSelected} />;\n};\n\nconst StyledFocusRing = styled(Grid)<{ showFocusRing: boolean; hasError?: boolean }>`\n width: 100%;\n height: 100%;\n outline-offset: -1px;\n outline: ${({ showFocusRing, hasError, theme }) => {\n if (showFocusRing) {\n return `2px solid ${theme.colors.brand[700]}`;\n }\n if (hasError) {\n return `2px solid ${theme.colors.danger[900]}`;\n }\n return 'none';\n }};\n`;\n\ninterface FocusRingProps {\n target: string;\n children: React.ReactNode;\n hasError?: boolean;\n}\nconst FocusRing = (props: FocusRingProps) => {\n const { target, children, hasError } = props;\n const [showFocusRing, setShowFocusingRing] = React.useState(false);\n const handleOnFocus: React.FocusEventHandler<HTMLDivElement> = React.useCallback(\n (e) => {\n if (e.target.matches(target)) {\n setShowFocusingRing(true);\n }\n },\n [target],\n );\n\n const handleOnBlur: React.FocusEventHandler<HTMLDivElement> = React.useCallback(\n (e) => {\n if (e.target.matches(target)) {\n setShowFocusingRing(false);\n }\n },\n [target],\n );\n return (\n <StyledFocusRing\n hasError={hasError}\n onFocusCapture={handleOnFocus}\n onBlurCapture={handleOnBlur}\n showFocusRing={showFocusRing}\n >\n {children}\n </StyledFocusRing>\n );\n};\n\nexport const Card: React.ComponentType<CardT.InternalProps> = (props) => {\n const propsWithDefault = useMemoMergePropsWithDefault<CardT.Props>(props, defaultProps);\n const { children, hasError, disabled, isOverlay, onClick } = propsWithDefault;\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 = omit(useGetGlobalAttributes(propsWithDefault), ['cols', 'rows', 'wrap']);\n const getOwnerProps = useCallback(() => propsWithDefault, [propsWithDefault]);\n\n return (\n <StyledCardContainer border=\"solid 1px neutral-100\" boxShadow=\"xs\" isOverlay={isOverlay} {...globalsAttrs}>\n <FocusRing target={`[data-testid=${DSCardV3DataTestIds.ACTION_AREA}]`} hasError={hasError}>\n {onClick ? (\n <CardActionArea\n disabled={disabled}\n data-testid={DSCardV3DataTestIds.ACTION_AREA}\n getOwnerProps={getOwnerProps}\n />\n ) : null}\n {children}\n </FocusRing>\n </StyledCardContainer>\n );\n};\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;AC0Hf,cA6EF,YA7EE;AAvHR,OAAOA,UAAS,SAAS,mBAAmB;AAC5C,SAAS,YAAY;AACrB,SAAS,YAAY;AACrB,SAAS,QAAQ,+BAA+B;AAChD,SAAS,2BAA2B;AAEpC,SAAS,8BAA8B,8BAAsD;AAEtF,MAAM,eAAe;AACrB,MAAM,gBAAgB;AAAA,EAC3B,aAAa;AACf;AAEO,MAAM,sBAAsB,wBAAwB,cAAc,aAAa;AAmC/E,MAAM,eAAmC;AAAA,EAC9C,UAAU;AACZ;AAEO,MAAM,iBAAiB,OAAO,UAAU;AAAA,EAC7C,MAAM;AAAA,EACN,MAAM,cAAc;AACtB,CAA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,gBAAgB,CAAC;AAE5E,SACE,oBAAC,uBAAoB,QAAO,yBAAwB,WAAU,MAAK,WAAuB,GAAG,cAC3F,+BAAC,aAAU,QAAQ,gBAAgB,oBAAoB,gBAAgB,UACpE;AAAA,cACC;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA,eAAa,oBAAoB;AAAA,QACjC;AAAA;AAAA,IACF,IACE;AAAA,IACH;AAAA,KACH,GACF;AAEJ;",
6
+ "names": ["React"]
7
+ }
package/dist/esm/index.js CHANGED
@@ -7,6 +7,7 @@ import {
7
7
  } from "./DSCardV2.js";
8
8
  import {} from "./react-desc-prop-types.js";
9
9
  import { CARD_V2_DATA_TESTID } from "./constants/index.js";
10
+ export * from "./CardV3.js";
10
11
  export {
11
12
  CARD_V2_DATA_TESTID,
12
13
  DSCardV22 as CustomCard,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/index.ts"],
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 DSCardV2,\n DSCardV2 as CustomCard,\n DSCardV2WithSchema,\n DSCardV2WithSchema as DSCardCustomWithSchema,\n} from './DSCardV2.js';\nexport { type DSCardV2T } from './react-desc-prop-types.js';\nexport { CARD_V2_DATA_TESTID } from './constants/index.js';\n"],
5
- "mappings": "AAAA,YAAY,WAAW;ACGvB;AAAA,EACE;AAAA,EACY,YAAZA;AAAA,EACA;AAAA,EACsB,sBAAtBC;AAAA,OACK;AACP,eAA+B;AAC/B,SAAS,2BAA2B;",
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 DSCardV2,\n DSCardV2 as CustomCard,\n DSCardV2WithSchema,\n DSCardV2WithSchema as DSCardCustomWithSchema,\n} from './DSCardV2.js';\nexport { type DSCardV2T } from './react-desc-prop-types.js';\nexport { CARD_V2_DATA_TESTID } from './constants/index.js';\nexport * from './CardV3.js';\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACGvB;AAAA,EACE;AAAA,EACY,YAAZA;AAAA,EACA;AAAA,EACsB,sBAAtBC;AAAA,OACK;AACP,eAA+B;AAC/B,SAAS,2BAA2B;AACpC,cAAc;",
6
6
  "names": ["DSCardV2", "DSCardV2WithSchema"]
7
7
  }
@@ -0,0 +1,66 @@
1
+ import React from 'react';
2
+ import { type GlobalAttributesT } from '@elliemae/ds-utilities';
3
+ export declare const DSCardV3Name = "DSCardV3";
4
+ export declare const DSCardV3Slots: {
5
+ ACTION_AREA: string;
6
+ };
7
+ export declare const DSCardV3DataTestIds: Record<string, string>;
8
+ declare namespace CardT {
9
+ interface RequiredProps {
10
+ children: React.ReactNode;
11
+ }
12
+ interface OptinalProps {
13
+ isSelected?: boolean;
14
+ isMultiSelect?: boolean;
15
+ isOverlay?: boolean;
16
+ onClick?: (event: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;
17
+ }
18
+ interface DefaultProps {
19
+ hasError: boolean;
20
+ }
21
+ interface Props extends RequiredProps, Omit<GlobalAttributesT<HTMLButtonElement>, keyof DefaultProps | keyof RequiredProps>, OptinalProps, DefaultProps {
22
+ }
23
+ interface InternalProps extends RequiredProps, Omit<GlobalAttributesT<HTMLButtonElement>, keyof DefaultProps | keyof RequiredProps>, OptinalProps, Partial<DefaultProps> {
24
+ }
25
+ interface CardSelectIndicatorProps {
26
+ isSelected?: boolean;
27
+ isMultiSelect?: boolean;
28
+ }
29
+ }
30
+ export declare const defaultProps: CardT.DefaultProps;
31
+ export declare const CardActionArea: import("styled-components").StyledComponent<"button", import("@elliemae/ds-system").Theme, object & import("@elliemae/ds-system").OwnerInterface, never>;
32
+ export declare const StyledCard: import("styled-components").StyledComponent<React.ForwardRefExoticComponent<import("@elliemae/ds-grid/dist/types/react-desc-prop-types").DSGridT.Props & React.RefAttributes<HTMLDivElement>>, import("@elliemae/ds-system").Theme, {
33
+ isOverlay?: boolean | undefined;
34
+ onClick?: ((e: React.MouseEvent<HTMLDivElement, MouseEvent>) => void) | undefined;
35
+ } & import("@elliemae/ds-system").OwnerInterface, never>;
36
+ export declare const StyledButtonCard: import("styled-components").StyledComponent<import("styled-components").StyledComponent<React.ForwardRefExoticComponent<import("@elliemae/ds-grid/dist/types/react-desc-prop-types").DSGridT.Props & React.RefAttributes<HTMLDivElement>>, import("@elliemae/ds-system").Theme, {
37
+ isOverlay?: boolean | undefined;
38
+ onClick?: ((e: React.MouseEvent<HTMLDivElement, MouseEvent>) => void) | undefined;
39
+ } & import("@elliemae/ds-system").OwnerInterface, never>, import("@elliemae/ds-system").Theme, {
40
+ isOverlay?: boolean | undefined;
41
+ } & import("@elliemae/ds-system").OwnerInterface, never>;
42
+ export declare const StyledCardError: import("styled-components").StyledComponent<import("styled-components").StyledComponent<React.ForwardRefExoticComponent<import("@elliemae/ds-grid/dist/types/react-desc-prop-types").DSGridT.Props & React.RefAttributes<HTMLDivElement>>, import("@elliemae/ds-system").Theme, {
43
+ isOverlay?: boolean | undefined;
44
+ onClick?: ((e: React.MouseEvent<HTMLDivElement, MouseEvent>) => void) | undefined;
45
+ } & import("@elliemae/ds-system").OwnerInterface, never>, import("@elliemae/ds-system").Theme, object & import("@elliemae/ds-system").OwnerInterface, never>;
46
+ export declare const StyledCardSingleIndicator: import("styled-components").StyledComponent<React.ForwardRefExoticComponent<import("@elliemae/ds-grid/dist/types/react-desc-prop-types").DSGridT.Props & React.RefAttributes<HTMLDivElement>>, import("@elliemae/ds-system").Theme, {
47
+ isSelected?: boolean | undefined;
48
+ } & import("@elliemae/ds-system").OwnerInterface, never>;
49
+ export declare const StyledCardDisabled: import("styled-components").StyledComponent<import("styled-components").StyledComponent<React.ForwardRefExoticComponent<import("@elliemae/ds-grid/dist/types/react-desc-prop-types").DSGridT.Props & React.RefAttributes<HTMLDivElement>>, import("@elliemae/ds-system").Theme, {
50
+ isOverlay?: boolean | undefined;
51
+ onClick?: ((e: React.MouseEvent<HTMLDivElement, MouseEvent>) => void) | undefined;
52
+ } & import("@elliemae/ds-system").OwnerInterface, never>, import("@elliemae/ds-system").Theme, {
53
+ [x: string]: any;
54
+ [x: number]: any;
55
+ [x: symbol]: any;
56
+ } & {
57
+ theme?: import("@elliemae/ds-system").Theme | undefined;
58
+ } & {
59
+ as?: string | React.ComponentType<any> | undefined;
60
+ forwardedAs?: string | React.ComponentType<any> | undefined;
61
+ } & import("@elliemae/ds-system").OwnerInterface, never>;
62
+ export declare const CardContent: import("styled-components").StyledComponent<React.ForwardRefExoticComponent<import("@elliemae/ds-grid/dist/types/react-desc-prop-types").DSGridT.Props & React.RefAttributes<HTMLDivElement>>, import("@elliemae/ds-system").Theme, object & import("@elliemae/ds-system").OwnerInterface, never>;
63
+ export declare const CardFooter: import("styled-components").StyledComponent<React.ForwardRefExoticComponent<import("@elliemae/ds-grid/dist/types/react-desc-prop-types").DSGridT.Props & React.RefAttributes<HTMLDivElement>>, import("@elliemae/ds-system").Theme, object & import("@elliemae/ds-system").OwnerInterface, never>;
64
+ export declare const CardSelectIndicator: (props: CardT.CardSelectIndicatorProps) => import("react/jsx-runtime").JSX.Element;
65
+ export declare const Card: React.ComponentType<CardT.InternalProps>;
66
+ export {};
@@ -1,3 +1,4 @@
1
1
  export { DSCardV2, DSCardV2 as CustomCard, DSCardV2WithSchema, DSCardV2WithSchema as DSCardCustomWithSchema, } from './DSCardV2.js';
2
2
  export { type DSCardV2T } from './react-desc-prop-types.js';
3
3
  export { CARD_V2_DATA_TESTID } from './constants/index.js';
4
+ export * from './CardV3.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elliemae/ds-card-v2",
3
- "version": "3.22.0-next.22",
3
+ "version": "3.22.0-next.24",
4
4
  "license": "MIT",
5
5
  "description": "ICE MT - Dimsum - Card V2",
6
6
  "files": [
@@ -51,19 +51,20 @@
51
51
  "jest-axe": "^7.0.1",
52
52
  "lodash": "^4.17.21",
53
53
  "uid": "~2.0.1",
54
- "@elliemae/ds-button": "3.22.0-next.22",
55
- "@elliemae/ds-grid": "3.22.0-next.22",
56
- "@elliemae/ds-icons": "3.22.0-next.22",
57
- "@elliemae/ds-header": "3.22.0-next.22",
58
- "@elliemae/ds-separator": "3.22.0-next.22",
59
- "@elliemae/ds-system": "3.22.0-next.22",
60
- "@elliemae/ds-truncated-tooltip-text": "3.22.0-next.22",
61
- "@elliemae/ds-utilities": "3.22.0-next.22"
54
+ "@elliemae/ds-button": "3.22.0-next.24",
55
+ "@elliemae/ds-controlled-form": "3.22.0-next.24",
56
+ "@elliemae/ds-header": "3.22.0-next.24",
57
+ "@elliemae/ds-grid": "3.22.0-next.24",
58
+ "@elliemae/ds-separator": "3.22.0-next.24",
59
+ "@elliemae/ds-system": "3.22.0-next.24",
60
+ "@elliemae/ds-truncated-tooltip-text": "3.22.0-next.24",
61
+ "@elliemae/ds-icons": "3.22.0-next.24",
62
+ "@elliemae/ds-utilities": "3.22.0-next.24"
62
63
  },
63
64
  "devDependencies": {
64
65
  "@elliemae/pui-cli": "~9.0.0-next.22",
65
66
  "styled-components": "~5.3.9",
66
- "@elliemae/ds-monorepo-devops": "3.22.0-next.22"
67
+ "@elliemae/ds-monorepo-devops": "3.22.0-next.24"
67
68
  },
68
69
  "peerDependencies": {
69
70
  "@testing-library/jest-dom": "~5.16.4",