@elliemae/ds-card-v2 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/CardV3.js +189 -0
- package/dist/cjs/CardV3.js.map +7 -0
- package/dist/cjs/DSCardV2.js.map +1 -1
- package/dist/cjs/config/useCardV2.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 +2 -0
- package/dist/cjs/index.js.map +3 -3
- package/dist/cjs/react-desc-prop-types.js.map +1 -1
- package/dist/cjs/styles.js.map +1 -1
- package/dist/esm/CardV3.js +159 -0
- package/dist/esm/CardV3.js.map +7 -0
- package/dist/esm/DSCardV2.js.map +1 -1
- package/dist/esm/config/useCardV2.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 +1 -0
- package/dist/esm/index.js.map +3 -3
- package/dist/esm/react-desc-prop-types.js.map +1 -1
- package/dist/esm/styles.js.map +1 -1
- package/dist/types/CardV3.d.ts +66 -0
- package/dist/types/index.d.ts +1 -0
- package/package.json +22 -16
|
@@ -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: ${({ isSelected }) => isSelected ? "6px" : "4px"};
|
|
92
|
+
align-self: normal;
|
|
93
|
+
background-color: ${({ theme, isSelected }) => isSelected ? theme.colors.brand["700"] : theme.colors.brand["300"]};
|
|
94
|
+
transition: all 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: ${({ isSelected }) => (isSelected ? '6px' : '4px')};\n align-self: normal;\n background-color: ${({ theme, isSelected }) => (isSelected ? theme.colors.brand['700'] : theme.colors.brand['300'])};\n transition: all 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": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;AD0Hf;AAvHR,mBAA4C;AAC5C,oBAAqB;AACrB,qBAAqB;AACrB,uBAAgD;AAChD,gCAAoC;AAEpC,0BAA6F;AAEtF,MAAM,eAAe;AACrB,MAAM,gBAAgB;AAAA,EAC3B,aAAa;AACf;AAEO,MAAM,0BAAsB,0CAAwB,cAAc,aAAa;AAmC/E,MAAM,eAAmC;AA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;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/DSCardV2.js.map
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../src/DSCardV2.tsx", "
|
|
3
|
+
"sources": ["../../src/DSCardV2.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
4
|
"sourcesContent": ["import React from 'react';\nimport { describe } from '@elliemae/ds-utilities';\nimport { type DSCardV2T, DSCardV2PropTypesSchema } from './react-desc-prop-types.js';\nimport { useCardV2 } from './config/useCardV2.js';\nimport { DSCardV2Name, CARD_V2_DATA_TESTID } from './constants/index.js';\nimport DSTruncatedTooltipText, { TooltipTextProvider } from '@elliemae/ds-truncated-tooltip-text';\nimport { DSHeader } from '@elliemae/ds-header';\nimport {\n CardContainer,\n LeftSection,\n LeftAddon,\n MainSection,\n Description,\n RightAddonSection,\n RightAddon,\n Separator,\n} from './styles.js';\n\nconst getCol = (rightAddon: DSCardV2T.OptionalProps['rightAddon']) => {\n if (!rightAddon) return ['1fr'];\n return ['1fr', 'auto'];\n};\n\nconst DSCardV2: React.ComponentType<DSCardV2T.Props> = (props) => {\n const { propsWithDefault, globalProps, xstyledProps } = useCardV2(props);\n const { hasBorder, title, leftAddon, rightAddon, description } = propsWithDefault;\n return (\n <TooltipTextProvider>\n <CardContainer\n data-testid={CARD_V2_DATA_TESTID.CARD_CONTAINER} //we must keep this explicit to avoid the breaking changes\n {...globalProps}\n {...xstyledProps}\n hasBorder={hasBorder}\n cols={getCol(rightAddon)}\n >\n <LeftSection>\n {leftAddon && <LeftAddon>{leftAddon}</LeftAddon>}\n <MainSection\n style={{\n maxWidth: leftAddon ? 'calc(100% - 40px)' : '100%',\n }}\n >\n <DSHeader\n data-testid={CARD_V2_DATA_TESTID.CARD_HEADER} //we must keep this explicit to avoid the breaking changes\n fontSize=\"16px\"\n fontWeight=\"regular\"\n color=\"neutral.800\"\n text={<DSTruncatedTooltipText value={title} />}\n />\n {description && (\n <Description>\n <DSTruncatedTooltipText value={description} />\n </Description>\n )}\n </MainSection>\n </LeftSection>\n {Array.isArray(rightAddon) && (\n <RightAddonSection>\n {rightAddon[0] ? <RightAddon>{rightAddon[0]}</RightAddon> : null}\n {rightAddon[1] ? (\n <>\n {rightAddon.length > 1 && <Separator />}\n <RightAddon>{rightAddon[1]}</RightAddon>\n </>\n ) : null}\n </RightAddonSection>\n )}\n </CardContainer>\n </TooltipTextProvider>\n );\n};\n\nDSCardV2.propTypes = DSCardV2PropTypesSchema;\nDSCardV2.displayName = DSCardV2Name;\nconst DSCardV2WithSchema = describe(DSCardV2);\nDSCardV2WithSchema.propTypes = DSCardV2PropTypesSchema;\n\nexport { DSCardV2, DSCardV2WithSchema };\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
5
|
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADoCC;AAnCxB,0BAAyB;AACzB,mCAAwD;AACxD,uBAA0B;AAC1B,uBAAkD;AAClD,uCAA4D;AAC5D,uBAAyB;AACzB,oBASO;AAEP,MAAM,SAAS,CAAC,eAAsD;AACpE,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
|
6
6
|
"names": ["DSTruncatedTooltipText"]
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../../src/config/useCardV2.ts", "
|
|
3
|
+
"sources": ["../../../src/config/useCardV2.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 DSCardV2T, DSCardV2PropTypes, defaultProps } from '../react-desc-prop-types.js';\nimport { useValidateProps } from './useValidateProps.js';\n\nexport interface CardV2CTX {\n propsWithDefault: DSCardV2T.InternalProps;\n globalProps: ReturnType<typeof useGetGlobalAttributes>;\n xstyledProps: ReturnType<typeof useGetXstyledProps>;\n instanceUid: string;\n}\n\nexport const useCardV2 = (propsFromUser: DSCardV2T.Props) => {\n // =============================================================================\n // MERGE WITH DEFAULT AND VALIDATE PROPS\n // =============================================================================\n const propsWithDefault = useMemoMergePropsWithDefault<DSCardV2T.InternalProps>(propsFromUser, defaultProps);\n useValidateProps(propsWithDefault, DSCardV2PropTypes);\n // =============================================================================\n // GLOBAL ATTRIBUTES & XSTYLED PROPS\n // =============================================================================\n const globalProps = omit(useGetGlobalAttributes<DSCardV2T.InternalProps>(propsWithDefault), ['cols', 'rows', 'wrap']);\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,mCAAgE;AAChE,8BAAiC;AAS1B,MAAM,YAAY,CAAC,kBAAmC;AAI3D,QAAM,uBAAmB,kDAAsD,eAAe,yCAAY;AAC1G,gDAAiB,kBAAkB,8CAAiB;AAIpD,QAAM,kBAAc,wBAAK,4CAAgD,gBAAgB,GAAG,CAAC,QAAQ,QAAQ,MAAM,CAAC;AACpH,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 DSCardV2T } from '../react-desc-prop-types.js';\nimport { DSCardV2Name } from '../constants/index.js';\n\nexport const useValidateProps = (props: DSCardV2T.InternalProps, propTypes: WeakValidationMap<unknown>): void => {\n // we validate the \"required if\" via 'isRequiredIf from our custom PropTypes\n useValidateTypescriptPropTypes(props, propTypes, DSCardV2Name);\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,uBAA6B;AAEtB,MAAM,mBAAmB,CAAC,OAAgC,cAAgD;AAE/G,0DAA+B,OAAO,WAAW,6BAAY;AAC/D;",
|
|
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 DSCardV2Name = 'DSCardV2';\n\n// we are giving \"component_name_slots\" to avoid errors on duplicate exports variables in aggregators\nexport const CARD_V2_SLOTS = {\n CARD_CONTAINER: 'container',\n LEFT_SECTION: 'left-section',\n LEFT_ADDON: 'left-addon',\n RIGHT_ADDON: 'right-addon',\n RIGHT_ADDON_SECTION: 'right-addon-section',\n SEPARATOR: 'separator',\n MAIN_SECTION: 'main-section',\n TITLE: 'title',\n DESCRIPTION: 'description',\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_DATA_TESTID = {\n ...slotObjectToDataTestIds(DSCardV2Name, CARD_V2_SLOTS),\n CARD_CONTAINER: 'em-ds-card',\n CARD_HEADER: 'em-ds-card-header',\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,eAAe;AAGrB,MAAM,gBAAgB;AAAA,EAC3B,gBAAgB;AAAA,EAChB,cAAc;AAAA,EACd,YAAY;AAAA,EACZ,aAAa;AAAA,EACb,qBAAqB;AAAA,EACrB,WAAW;AAAA,EACX,cAAc;AAAA,EACd,OAAO;AAAA,EACP,aAAa;AACf;AAGO,MAAM,sBAAsB;AAAA,EACjC,OAAG,0CAAwB,cAAc,aAAa;AAAA,EACtD,gBAAgB;AAAA,EAChB,aAAa;AACf;",
|
|
6
6
|
"names": []
|
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
|
package/dist/cjs/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../src/index.ts", "
|
|
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": "
|
|
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';\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
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../src/react-desc-prop-types.ts", "
|
|
3
|
+
"sources": ["../../src/react-desc-prop-types.ts", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
4
|
"sourcesContent": ["import 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 DSCardV2T {\n export interface RequiredProps {\n title: string;\n }\n\n export interface DefaultProps {\n hasBorder?: boolean;\n }\n\n export interface OptionalProps {\n description: string;\n leftAddon: JSX.Element;\n rightAddon: JSX.Element | JSX.Element[];\n }\n\n export interface Props\n extends Partial<DefaultProps>,\n OptionalProps,\n Omit<\n GlobalAttributesT<HTMLButtonElement>,\n keyof DefaultProps | keyof OptionalProps | keyof RequiredProps | keyof XstyledProps\n >,\n XstyledProps,\n RequiredProps {}\n\n export interface InternalProps\n extends DefaultProps,\n OptionalProps,\n Omit<\n GlobalAttributesT<HTMLButtonElement>,\n keyof DefaultProps | keyof OptionalProps | keyof RequiredProps | keyof XstyledProps\n >,\n XstyledProps,\n RequiredProps {}\n}\n\nexport const defaultProps: DSCardV2T.DefaultProps = {\n hasBorder: false,\n};\n\nexport const DSCardV2PropTypes: DSPropTypesSchema<DSCardV2T.Props> = {\n ...globalAttributesPropTypes,\n ...xstyledPropTypes,\n /**\n * Title of the card. requiered\n */\n title: PropTypes.string.isRequired.description('Title of the card. requiered'),\n /**\n * Description of the card. not requiered\n */\n description: PropTypes.string.description('Description of the card. not requiered'),\n /**\n * Left Addon\n */\n leftAddon: PropTypes.element.description('Left Addon'),\n /**\n * Right addon array, max elements: 2\n */\n rightAddon: PropTypes.array.description('Right addon array, max elements: 2'),\n /**\n * Wheter if the card has border or not\n */\n hasBorder: PropTypes.bool.description('Wheter if the card has border or not').defaultValue(false),\n};\n\nexport const DSCardV2PropTypesSchema = DSCardV2PropTypes as unknown as WeakValidationMap<DSCardV2T.Props>;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
5
|
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADEvB,0BAAuE;AAsChE,MAAM,eAAuC;AAAA,EAClD,WAAW;AACb;AAEO,MAAM,oBAAwD;AAAA,EACnE,GAAG;AAAA,EACH,GAAG;AAAA;AAAA;AAAA;AAAA,EAIH,OAAO,8BAAU,OAAO,WAAW,YAAY,8BAA8B;AAAA;AAAA;AAAA;AAAA,EAI7E,aAAa,8BAAU,OAAO,YAAY,wCAAwC;AAAA;AAAA;AAAA;AAAA,EAIlF,WAAW,8BAAU,QAAQ,YAAY,YAAY;AAAA;AAAA;AAAA;AAAA,EAIrD,YAAY,8BAAU,MAAM,YAAY,oCAAoC;AAAA;AAAA;AAAA;AAAA,EAI5E,WAAW,8BAAU,KAAK,YAAY,sCAAsC,EAAE,aAAa,KAAK;AAClG;AAEO,MAAM,0BAA0B;",
|
|
6
6
|
"names": []
|
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, xStyledCommonProps } from '@elliemae/ds-system';\nimport { Grid } from '@elliemae/ds-grid';\nimport { DSCardV2Name, CARD_V2_SLOTS } from './constants/index.js';\n\nconst CardContainer = styled(Grid, { name: DSCardV2Name, slot: CARD_V2_SLOTS.CARD_CONTAINER })<{ hasBorder?: boolean }>`\n align-items: center;\n justify-content: space-between;\n width: 100%;\n height: 56px;\n padding: 8px 16px;\n position: relative;\n border: ${({ theme, hasBorder }) => (hasBorder ? `1px solid ${theme.colors.neutral['100']}` : '')};\n &:before {\n content: '';\n border-bottom: 1px solid ${(props) => props.theme.colors.neutral['100']};\n position: absolute;\n margin: 0 auto;\n width: 90%;\n bottom: 0;\n }\n &:last-child::before {\n content: none;\n }\n ${xStyledCommonProps}\n`;\n\nconst LeftSection = styled('div', { name: DSCardV2Name, slot: CARD_V2_SLOTS.LEFT_SECTION })`\n display: flex;\n align-items: center;\n`;\n\nconst LeftAddon = styled('div', { name: DSCardV2Name, slot: CARD_V2_SLOTS.LEFT_ADDON })`\n height: fit-content;\n width: fit-content;\n margin-right: 16px;\n cursor: pointer;\n`;\n\nconst RightAddonSection = styled('div', { name: DSCardV2Name, slot: CARD_V2_SLOTS.RIGHT_ADDON_SECTION })`\n display: flex;\n align-items: center;\n width: fit-content;\n`;\n\nconst RightAddon = styled('div', { name: DSCardV2Name, slot: CARD_V2_SLOTS.RIGHT_ADDON })`\n height: fit-content;\n width: fit-content;\n cursor: pointer;\n`;\n\nconst Separator = styled('div', { name: DSCardV2Name, slot: CARD_V2_SLOTS.SEPARATOR })`\n width: 0px;\n height: 24px;\n border-right: 1px solid ${(props) => props.theme.colors.neutral['300']};\n margin: 0 8px;\n`;\n\nconst MainSection = styled('div', { name: DSCardV2Name, slot: CARD_V2_SLOTS.MAIN_SECTION })`\n display: flex;\n flex-direction: column;\n`;\n\nconst Title = styled('h3', { name: DSCardV2Name, slot: CARD_V2_SLOTS.TITLE })`\n margin: 0;\n font-size: 16px;\n font-weight: ${(props) => props.theme.fontWeights.regular};\n color: ${(props) => props.theme.colors.neutral['800']};\n`;\n\nconst Description = styled('p', { name: DSCardV2Name, slot: CARD_V2_SLOTS.DESCRIPTION })`\n margin: 0;\n color: ${(props) => props.theme.colors.neutral['600']};\n`;\n\nexport {\n CardContainer,\n LeftSection,\n LeftAddon,\n RightAddonSection,\n RightAddon,\n Separator,\n MainSection,\n Title,\n Description,\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
5
|
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,uBAA2C;AAC3C,qBAAqB;AACrB,uBAA4C;AAE5C,MAAM,oBAAgB,yBAAO,qBAAM,EAAE,MAAM,+BAAc,MAAM,+BAAc,eAAe,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,YAOjF,CAAC,EAAE,OAAO,UAAU,MAAO,YAAY,aAAa,MAAM,OAAO,QAAQ,KAAK,MAAM;AAAA;AAAA;AAAA,+BAGjE,CAAC,UAAU,MAAM,MAAM,OAAO,QAAQ,KAAK;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAStE;AAAA;AAGJ,MAAM,kBAAc,yBAAO,OAAO,EAAE,MAAM,+BAAc,MAAM,+BAAc,aAAa,CAAC;AAAA;AAAA;AAAA;AAK1F,MAAM,gBAAY,yBAAO,OAAO,EAAE,MAAM,+BAAc,MAAM,+BAAc,WAAW,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAOtF,MAAM,wBAAoB,yBAAO,OAAO,EAAE,MAAM,+BAAc,MAAM,+BAAc,oBAAoB,CAAC;AAAA;AAAA;AAAA;AAAA;AAMvG,MAAM,iBAAa,yBAAO,OAAO,EAAE,MAAM,+BAAc,MAAM,+BAAc,YAAY,CAAC;AAAA;AAAA;AAAA;AAAA;AAMxF,MAAM,gBAAY,yBAAO,OAAO,EAAE,MAAM,+BAAc,MAAM,+BAAc,UAAU,CAAC;AAAA;AAAA;AAAA,4BAGzD,CAAC,UAAU,MAAM,MAAM,OAAO,QAAQ,KAAK;AAAA;AAAA;AAIvE,MAAM,kBAAc,yBAAO,OAAO,EAAE,MAAM,+BAAc,MAAM,+BAAc,aAAa,CAAC;AAAA;AAAA;AAAA;AAK1F,MAAM,YAAQ,yBAAO,MAAM,EAAE,MAAM,+BAAc,MAAM,+BAAc,MAAM,CAAC;AAAA;AAAA;AAAA,iBAG3D,CAAC,UAAU,MAAM,MAAM,YAAY;AAAA,WACzC,CAAC,UAAU,MAAM,MAAM,OAAO,QAAQ,KAAK;AAAA;AAGtD,MAAM,kBAAc,yBAAO,KAAK,EAAE,MAAM,+BAAc,MAAM,+BAAc,YAAY,CAAC;AAAA;AAAA,WAE5E,CAAC,UAAU,MAAM,MAAM,OAAO,QAAQ,KAAK;AAAA;",
|
|
6
6
|
"names": []
|
|
@@ -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: ${({ isSelected }) => isSelected ? "6px" : "4px"};
|
|
46
|
+
align-self: normal;
|
|
47
|
+
background-color: ${({ theme, isSelected }) => isSelected ? theme.colors.brand["700"] : theme.colors.brand["300"]};
|
|
48
|
+
transition: all 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: ${({ isSelected }) => (isSelected ? '6px' : '4px')};\n align-self: normal;\n background-color: ${({ theme, isSelected }) => (isSelected ? theme.colors.brand['700'] : theme.colors.brand['300'])};\n transition: all 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,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAaM,MAAM,aAAa,OAAO,IAAI;AAAA,sBAIf,CAAC,EAAE,OAAO,UAAU,M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F,+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/DSCardV2.js.map
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["
|
|
3
|
+
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/DSCardV2.tsx"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { describe } from '@elliemae/ds-utilities';\nimport { type DSCardV2T, DSCardV2PropTypesSchema } from './react-desc-prop-types.js';\nimport { useCardV2 } from './config/useCardV2.js';\nimport { DSCardV2Name, CARD_V2_DATA_TESTID } from './constants/index.js';\nimport DSTruncatedTooltipText, { TooltipTextProvider } from '@elliemae/ds-truncated-tooltip-text';\nimport { DSHeader } from '@elliemae/ds-header';\nimport {\n CardContainer,\n LeftSection,\n LeftAddon,\n MainSection,\n Description,\n RightAddonSection,\n RightAddon,\n Separator,\n} from './styles.js';\n\nconst getCol = (rightAddon: DSCardV2T.OptionalProps['rightAddon']) => {\n if (!rightAddon) return ['1fr'];\n return ['1fr', 'auto'];\n};\n\nconst DSCardV2: React.ComponentType<DSCardV2T.Props> = (props) => {\n const { propsWithDefault, globalProps, xstyledProps } = useCardV2(props);\n const { hasBorder, title, leftAddon, rightAddon, description } = propsWithDefault;\n return (\n <TooltipTextProvider>\n <CardContainer\n data-testid={CARD_V2_DATA_TESTID.CARD_CONTAINER} //we must keep this explicit to avoid the breaking changes\n {...globalProps}\n {...xstyledProps}\n hasBorder={hasBorder}\n cols={getCol(rightAddon)}\n >\n <LeftSection>\n {leftAddon && <LeftAddon>{leftAddon}</LeftAddon>}\n <MainSection\n style={{\n maxWidth: leftAddon ? 'calc(100% - 40px)' : '100%',\n }}\n >\n <DSHeader\n data-testid={CARD_V2_DATA_TESTID.CARD_HEADER} //we must keep this explicit to avoid the breaking changes\n fontSize=\"16px\"\n fontWeight=\"regular\"\n color=\"neutral.800\"\n text={<DSTruncatedTooltipText value={title} />}\n />\n {description && (\n <Description>\n <DSTruncatedTooltipText value={description} />\n </Description>\n )}\n </MainSection>\n </LeftSection>\n {Array.isArray(rightAddon) && (\n <RightAddonSection>\n {rightAddon[0] ? <RightAddon>{rightAddon[0]}</RightAddon> : null}\n {rightAddon[1] ? (\n <>\n {rightAddon.length > 1 && <Separator />}\n <RightAddon>{rightAddon[1]}</RightAddon>\n </>\n ) : null}\n </RightAddonSection>\n )}\n </CardContainer>\n </TooltipTextProvider>\n );\n};\n\nDSCardV2.propTypes = DSCardV2PropTypesSchema;\nDSCardV2.displayName = DSCardV2Name;\nconst DSCardV2WithSchema = describe(DSCardV2);\nDSCardV2WithSchema.propTypes = DSCardV2PropTypesSchema;\n\nexport { DSCardV2, DSCardV2WithSchema };\n"],
|
|
5
5
|
"mappings": "AAAA,YAAY,WAAW;ACoCC,SAwBV,UAxBU,KACd,YADc;AAnCxB,SAAS,gBAAgB;AACzB,SAAyB,+BAA+B;AACxD,SAAS,iBAAiB;AAC1B,SAAS,cAAc,2BAA2B;AAClD,OAAO,0BAA0B,2BAA2B;AAC5D,SAAS,gBAAgB;AACzB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAEP,MAAM,SAAS,CAAC,eAAsD;AACpE,MAAI,CAAC;AAAY,WAAO,CAAC,KAAK;AAC9B,SAAO,CAAC,OAAO,MAAM;AACvB;AAEA,MAAM,WAAiD,CAAC,UAAU;AAChE,QAAM,EAAE,kBAAkB,aAAa,aAAa,IAAI,UAAU,KAAK;AACvE,QAAM,EAAE,WAAW,OAAO,WAAW,YAAY,YAAY,IAAI;AACjE,SACE,oBAAC,uBACC;AAAA,IAAC;AAAA;AAAA,MACC,eAAa,oBAAoB;AAAA,MAChC,GAAG;AAAA,MACH,GAAG;AAAA,MACJ;AAAA,MACA,MAAM,OAAO,UAAU;AAAA,MAEvB;AAAA,6BAAC,eACE;AAAA,uBAAa,oBAAC,aAAW,qBAAU;AAAA,UACpC;AAAA,YAAC;AAAA;AAAA,cACC,OAAO;AAAA,gBACL,UAAU,YAAY,sBAAsB;AAAA,cAC9C;AAAA,cAEA;AAAA;AAAA,kBAAC;AAAA;AAAA,oBACC,eAAa,oBAAoB;AAAA,oBACjC,UAAS;AAAA,oBACT,YAAW;AAAA,oBACX,OAAM;AAAA,oBACN,MAAM,oBAAC,0BAAuB,OAAO,OAAO;AAAA;AAAA,gBAC9C;AAAA,gBACC,eACC,oBAAC,eACC,8BAAC,0BAAuB,OAAO,aAAa,GAC9C;AAAA;AAAA;AAAA,UAEJ;AAAA,WACF;AAAA,QACC,MAAM,QAAQ,UAAU,KACvB,qBAAC,qBACE;AAAA,qBAAW,CAAC,IAAI,oBAAC,cAAY,qBAAW,CAAC,GAAE,IAAgB;AAAA,UAC3D,WAAW,CAAC,IACX,iCACG;AAAA,uBAAW,SAAS,KAAK,oBAAC,aAAU;AAAA,YACrC,oBAAC,cAAY,qBAAW,CAAC,GAAE;AAAA,aAC7B,IACE;AAAA,WACN;AAAA;AAAA;AAAA,EAEJ,GACF;AAEJ;AAEA,SAAS,YAAY;AACrB,SAAS,cAAc;AACvB,MAAM,qBAAqB,SAAS,QAAQ;AAC5C,mBAAmB,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/useCardV2.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 DSCardV2T, DSCardV2PropTypes, defaultProps } from '../react-desc-prop-types.js';\nimport { useValidateProps } from './useValidateProps.js';\n\nexport interface CardV2CTX {\n propsWithDefault: DSCardV2T.InternalProps;\n globalProps: ReturnType<typeof useGetGlobalAttributes>;\n xstyledProps: ReturnType<typeof useGetXstyledProps>;\n instanceUid: string;\n}\n\nexport const useCardV2 = (propsFromUser: DSCardV2T.Props) => {\n // =============================================================================\n // MERGE WITH DEFAULT AND VALIDATE PROPS\n // =============================================================================\n const propsWithDefault = useMemoMergePropsWithDefault<DSCardV2T.InternalProps>(propsFromUser, defaultProps);\n useValidateProps(propsWithDefault, DSCardV2PropTypes);\n // =============================================================================\n // GLOBAL ATTRIBUTES & XSTYLED PROPS\n // =============================================================================\n const globalProps = omit(useGetGlobalAttributes<DSCardV2T.InternalProps>(propsWithDefault), ['cols', 'rows', 'wrap']);\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,SAAyB,mBAAmB,oBAAoB;AAChE,SAAS,wBAAwB;AAS1B,MAAM,YAAY,CAAC,kBAAmC;AAI3D,QAAM,mBAAmB,6BAAsD,eAAe,YAAY;AAC1G,mBAAiB,kBAAkB,iBAAiB;AAIpD,QAAM,cAAc,KAAK,uBAAgD,gBAAgB,GAAG,CAAC,QAAQ,QAAQ,MAAM,CAAC;AACpH,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 DSCardV2T } from '../react-desc-prop-types.js';\nimport { DSCardV2Name } from '../constants/index.js';\n\nexport const useValidateProps = (props: DSCardV2T.InternalProps, propTypes: WeakValidationMap<unknown>): void => {\n // we validate the \"required if\" via 'isRequiredIf from our custom PropTypes\n useValidateTypescriptPropTypes(props, propTypes, DSCardV2Name);\n};\n"],
|
|
5
5
|
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,sCAAsC;AAG/C,SAAS,oBAAoB;AAEtB,MAAM,mBAAmB,CAAC,OAAgC,cAAgD;AAE/G,iCAA+B,OAAO,WAAW,YAAY;AAC/D;",
|
|
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 DSCardV2Name = 'DSCardV2';\n\n// we are giving \"component_name_slots\" to avoid errors on duplicate exports variables in aggregators\nexport const CARD_V2_SLOTS = {\n CARD_CONTAINER: 'container',\n LEFT_SECTION: 'left-section',\n LEFT_ADDON: 'left-addon',\n RIGHT_ADDON: 'right-addon',\n RIGHT_ADDON_SECTION: 'right-addon-section',\n SEPARATOR: 'separator',\n MAIN_SECTION: 'main-section',\n TITLE: 'title',\n DESCRIPTION: 'description',\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_DATA_TESTID = {\n ...slotObjectToDataTestIds(DSCardV2Name, CARD_V2_SLOTS),\n CARD_CONTAINER: 'em-ds-card',\n CARD_HEADER: 'em-ds-card-header',\n};\n"],
|
|
5
5
|
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,+BAA+B;AAEjC,MAAM,eAAe;AAGrB,MAAM,gBAAgB;AAAA,EAC3B,gBAAgB;AAAA,EAChB,cAAc;AAAA,EACd,YAAY;AAAA,EACZ,aAAa;AAAA,EACb,qBAAqB;AAAA,EACrB,WAAW;AAAA,EACX,cAAc;AAAA,EACd,OAAO;AAAA,EACP,aAAa;AACf;AAGO,MAAM,sBAAsB;AAAA,EACjC,GAAG,wBAAwB,cAAc,aAAa;AAAA,EACtD,gBAAgB;AAAA,EAChB,aAAa;AACf;",
|
|
6
6
|
"names": []
|
package/dist/esm/index.js
CHANGED
package/dist/esm/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["
|
|
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;",
|
|
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';\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
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["
|
|
3
|
+
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/react-desc-prop-types.ts"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import 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 DSCardV2T {\n export interface RequiredProps {\n title: string;\n }\n\n export interface DefaultProps {\n hasBorder?: boolean;\n }\n\n export interface OptionalProps {\n description: string;\n leftAddon: JSX.Element;\n rightAddon: JSX.Element | JSX.Element[];\n }\n\n export interface Props\n extends Partial<DefaultProps>,\n OptionalProps,\n Omit<\n GlobalAttributesT<HTMLButtonElement>,\n keyof DefaultProps | keyof OptionalProps | keyof RequiredProps | keyof XstyledProps\n >,\n XstyledProps,\n RequiredProps {}\n\n export interface InternalProps\n extends DefaultProps,\n OptionalProps,\n Omit<\n GlobalAttributesT<HTMLButtonElement>,\n keyof DefaultProps | keyof OptionalProps | keyof RequiredProps | keyof XstyledProps\n >,\n XstyledProps,\n RequiredProps {}\n}\n\nexport const defaultProps: DSCardV2T.DefaultProps = {\n hasBorder: false,\n};\n\nexport const DSCardV2PropTypes: DSPropTypesSchema<DSCardV2T.Props> = {\n ...globalAttributesPropTypes,\n ...xstyledPropTypes,\n /**\n * Title of the card. requiered\n */\n title: PropTypes.string.isRequired.description('Title of the card. requiered'),\n /**\n * Description of the card. not requiered\n */\n description: PropTypes.string.description('Description of the card. not requiered'),\n /**\n * Left Addon\n */\n leftAddon: PropTypes.element.description('Left Addon'),\n /**\n * Right addon array, max elements: 2\n */\n rightAddon: PropTypes.array.description('Right addon array, max elements: 2'),\n /**\n * Wheter if the card has border or not\n */\n hasBorder: PropTypes.bool.description('Wheter if the card has border or not').defaultValue(false),\n};\n\nexport const DSCardV2PropTypesSchema = DSCardV2PropTypes as unknown as WeakValidationMap<DSCardV2T.Props>;\n"],
|
|
5
5
|
"mappings": "AAAA,YAAY,WAAW;ACEvB,SAAS,WAAW,2BAA2B,wBAAwB;AAsChE,MAAM,eAAuC;AAAA,EAClD,WAAW;AACb;AAEO,MAAM,oBAAwD;AAAA,EACnE,GAAG;AAAA,EACH,GAAG;AAAA;AAAA;AAAA;AAAA,EAIH,OAAO,UAAU,OAAO,WAAW,YAAY,8BAA8B;AAAA;AAAA;AAAA;AAAA,EAI7E,aAAa,UAAU,OAAO,YAAY,wCAAwC;AAAA;AAAA;AAAA;AAAA,EAIlF,WAAW,UAAU,QAAQ,YAAY,YAAY;AAAA;AAAA;AAAA;AAAA,EAIrD,YAAY,UAAU,MAAM,YAAY,oCAAoC;AAAA;AAAA;AAAA;AAAA,EAI5E,WAAW,UAAU,KAAK,YAAY,sCAAsC,EAAE,aAAa,KAAK;AAClG;AAEO,MAAM,0BAA0B;",
|
|
6
6
|
"names": []
|
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, xStyledCommonProps } from '@elliemae/ds-system';\nimport { Grid } from '@elliemae/ds-grid';\nimport { DSCardV2Name, CARD_V2_SLOTS } from './constants/index.js';\n\nconst CardContainer = styled(Grid, { name: DSCardV2Name, slot: CARD_V2_SLOTS.CARD_CONTAINER })<{ hasBorder?: boolean }>`\n align-items: center;\n justify-content: space-between;\n width: 100%;\n height: 56px;\n padding: 8px 16px;\n position: relative;\n border: ${({ theme, hasBorder }) => (hasBorder ? `1px solid ${theme.colors.neutral['100']}` : '')};\n &:before {\n content: '';\n border-bottom: 1px solid ${(props) => props.theme.colors.neutral['100']};\n position: absolute;\n margin: 0 auto;\n width: 90%;\n bottom: 0;\n }\n &:last-child::before {\n content: none;\n }\n ${xStyledCommonProps}\n`;\n\nconst LeftSection = styled('div', { name: DSCardV2Name, slot: CARD_V2_SLOTS.LEFT_SECTION })`\n display: flex;\n align-items: center;\n`;\n\nconst LeftAddon = styled('div', { name: DSCardV2Name, slot: CARD_V2_SLOTS.LEFT_ADDON })`\n height: fit-content;\n width: fit-content;\n margin-right: 16px;\n cursor: pointer;\n`;\n\nconst RightAddonSection = styled('div', { name: DSCardV2Name, slot: CARD_V2_SLOTS.RIGHT_ADDON_SECTION })`\n display: flex;\n align-items: center;\n width: fit-content;\n`;\n\nconst RightAddon = styled('div', { name: DSCardV2Name, slot: CARD_V2_SLOTS.RIGHT_ADDON })`\n height: fit-content;\n width: fit-content;\n cursor: pointer;\n`;\n\nconst Separator = styled('div', { name: DSCardV2Name, slot: CARD_V2_SLOTS.SEPARATOR })`\n width: 0px;\n height: 24px;\n border-right: 1px solid ${(props) => props.theme.colors.neutral['300']};\n margin: 0 8px;\n`;\n\nconst MainSection = styled('div', { name: DSCardV2Name, slot: CARD_V2_SLOTS.MAIN_SECTION })`\n display: flex;\n flex-direction: column;\n`;\n\nconst Title = styled('h3', { name: DSCardV2Name, slot: CARD_V2_SLOTS.TITLE })`\n margin: 0;\n font-size: 16px;\n font-weight: ${(props) => props.theme.fontWeights.regular};\n color: ${(props) => props.theme.colors.neutral['800']};\n`;\n\nconst Description = styled('p', { name: DSCardV2Name, slot: CARD_V2_SLOTS.DESCRIPTION })`\n margin: 0;\n color: ${(props) => props.theme.colors.neutral['600']};\n`;\n\nexport {\n CardContainer,\n LeftSection,\n LeftAddon,\n RightAddonSection,\n RightAddon,\n Separator,\n MainSection,\n Title,\n Description,\n};\n"],
|
|
5
5
|
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,QAAQ,0BAA0B;AAC3C,SAAS,YAAY;AACrB,SAAS,cAAc,qBAAqB;AAE5C,MAAM,gBAAgB,OAAO,MAAM,EAAE,MAAM,cAAc,MAAM,cAAc,eAAe,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,YAOjF,CAAC,EAAE,OAAO,UAAU,MAAO,YAAY,aAAa,MAAM,OAAO,QAAQ,KAAK,MAAM;AAAA;AAAA;AAAA,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3Name = "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 {};
|
package/dist/types/index.d.ts
CHANGED
|
@@ -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.
|
|
3
|
+
"version": "3.22.0-next.30",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "ICE MT - Dimsum - Card V2",
|
|
6
6
|
"files": [
|
|
@@ -47,18 +47,24 @@
|
|
|
47
47
|
"indent": 4
|
|
48
48
|
},
|
|
49
49
|
"dependencies": {
|
|
50
|
-
"@
|
|
51
|
-
"
|
|
52
|
-
"
|
|
53
|
-
"
|
|
54
|
-
"@elliemae/ds-
|
|
55
|
-
"@elliemae/ds-
|
|
56
|
-
"@elliemae/ds-
|
|
50
|
+
"@xstyled/system": "~3.7.3",
|
|
51
|
+
"jest-axe": "^7.0.1",
|
|
52
|
+
"lodash": "^4.17.21",
|
|
53
|
+
"uid": "~2.0.1",
|
|
54
|
+
"@elliemae/ds-button": "3.22.0-next.30",
|
|
55
|
+
"@elliemae/ds-controlled-form": "3.22.0-next.30",
|
|
56
|
+
"@elliemae/ds-grid": "3.22.0-next.30",
|
|
57
|
+
"@elliemae/ds-header": "3.22.0-next.30",
|
|
58
|
+
"@elliemae/ds-separator": "3.22.0-next.30",
|
|
59
|
+
"@elliemae/ds-icons": "3.22.0-next.30",
|
|
60
|
+
"@elliemae/ds-truncated-tooltip-text": "3.22.0-next.30",
|
|
61
|
+
"@elliemae/ds-system": "3.22.0-next.30",
|
|
62
|
+
"@elliemae/ds-utilities": "3.22.0-next.30"
|
|
57
63
|
},
|
|
58
64
|
"devDependencies": {
|
|
59
|
-
"@elliemae/pui-cli": "~9.0.0-next.
|
|
65
|
+
"@elliemae/pui-cli": "~9.0.0-next.22",
|
|
60
66
|
"styled-components": "~5.3.9",
|
|
61
|
-
"@elliemae/ds-monorepo-devops": "3.22.0-next.
|
|
67
|
+
"@elliemae/ds-monorepo-devops": "3.22.0-next.30"
|
|
62
68
|
},
|
|
63
69
|
"peerDependencies": {
|
|
64
70
|
"@testing-library/jest-dom": "~5.16.4",
|
|
@@ -73,15 +79,15 @@
|
|
|
73
79
|
"typeSafety": false
|
|
74
80
|
},
|
|
75
81
|
"scripts": {
|
|
76
|
-
"dev": "cross-env NODE_ENV=development node
|
|
82
|
+
"dev": "cross-env NODE_ENV=development node ../../../scripts/build/build.mjs --watch",
|
|
77
83
|
"test": "pui-cli test --passWithNoTests",
|
|
78
|
-
"lint": "node
|
|
79
|
-
"eslint:fix": "eslint --ext='.js,.jsx,.test.js,.ts,.tsx' --fix --config='
|
|
80
|
-
"dts": "node
|
|
84
|
+
"lint": "node ../../../scripts/lint.mjs --fix",
|
|
85
|
+
"eslint:fix": "eslint --ext='.js,.jsx,.test.js,.ts,.tsx' --fix --config='../../../.eslintrc.js' src/",
|
|
86
|
+
"dts": "node ../../../scripts/dts.mjs",
|
|
81
87
|
"dts:withdeps": "pnpm --filter {.}... dts",
|
|
82
|
-
"build": "cross-env NODE_ENV=production node
|
|
88
|
+
"build": "cross-env NODE_ENV=production node ../../../scripts/build/build.mjs",
|
|
83
89
|
"dev:build": "pnpm --filter {.}... build",
|
|
84
90
|
"dev:install": "pnpm --filter {.}... i --no-lockfile && pnpm run dev:build",
|
|
85
|
-
"checkDeps": "npx -yes
|
|
91
|
+
"checkDeps": "npx -yes ../../util/ds-codemods check-missing-packages --projectFolderPath=\"./\" --ignorePackagesGlobPattern=\"\" --ignoreFilesGlobPattern=\"**/test-ables/*,**/tests/*\""
|
|
86
92
|
}
|
|
87
93
|
}
|