@elliemae/ds-card-navigation 3.55.0-next.1 → 3.55.0-next.11
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/DSCardNavigation.js +41 -40
- package/dist/cjs/DSCardNavigation.js.map +2 -2
- package/dist/cjs/config/useCardNavigation.js +19 -4
- package/dist/cjs/config/useCardNavigation.js.map +2 -2
- package/dist/cjs/parts/ActionsRegion.js +63 -0
- package/dist/cjs/parts/ActionsRegion.js.map +7 -0
- package/dist/cjs/{style.js → parts/style.js} +51 -34
- package/dist/cjs/parts/style.js.map +7 -0
- package/dist/cjs/parts/text-region/IconAndTextsRegion.js +101 -0
- package/dist/cjs/parts/text-region/IconAndTextsRegion.js.map +7 -0
- package/dist/cjs/parts/text-region/IconAndTextsRegionContent.js +88 -0
- package/dist/cjs/parts/text-region/IconAndTextsRegionContent.js.map +7 -0
- package/dist/cjs/react-desc-prop-types.js +3 -3
- package/dist/cjs/react-desc-prop-types.js.map +2 -2
- package/dist/esm/DSCardNavigation.js +42 -49
- package/dist/esm/DSCardNavigation.js.map +2 -2
- package/dist/esm/config/useCardNavigation.js +20 -5
- package/dist/esm/config/useCardNavigation.js.map +2 -2
- package/dist/esm/parts/ActionsRegion.js +33 -0
- package/dist/esm/parts/ActionsRegion.js.map +7 -0
- package/dist/esm/{style.js → parts/style.js} +51 -34
- package/dist/esm/parts/style.js.map +7 -0
- package/dist/esm/parts/text-region/IconAndTextsRegion.js +71 -0
- package/dist/esm/parts/text-region/IconAndTextsRegion.js.map +7 -0
- package/dist/esm/parts/text-region/IconAndTextsRegionContent.js +67 -0
- package/dist/esm/parts/text-region/IconAndTextsRegionContent.js.map +7 -0
- package/dist/esm/react-desc-prop-types.js +3 -3
- package/dist/esm/react-desc-prop-types.js.map +2 -2
- package/dist/types/DSCardNavigation.d.ts +1 -1
- package/dist/types/config/useCardNavigation.d.ts +7 -6
- package/dist/types/parts/ActionsRegion.d.ts +8 -0
- package/dist/types/{style.d.ts → parts/style.d.ts} +9 -4
- package/dist/types/parts/text-region/IconAndTextsRegion.d.ts +13 -0
- package/dist/types/parts/text-region/IconAndTextsRegionContent.d.ts +15 -0
- package/dist/types/tests/tooltip-tests/DSCardNavigation.tooltip.wrapText.interdependecy.test.playwright.d.ts +1 -0
- package/dist/types/tests/tooltip-tests/DSCardNavigationTooltipTestRenderer.d.ts +1 -0
- package/package.json +11 -11
- package/dist/cjs/DescriptionComponent.js +0 -79
- package/dist/cjs/DescriptionComponent.js.map +0 -7
- package/dist/cjs/TitleComponent.js +0 -51
- package/dist/cjs/TitleComponent.js.map +0 -7
- package/dist/cjs/style.js.map +0 -7
- package/dist/esm/DescriptionComponent.js +0 -49
- package/dist/esm/DescriptionComponent.js.map +0 -7
- package/dist/esm/TitleComponent.js +0 -21
- package/dist/esm/TitleComponent.js.map +0 -7
- package/dist/esm/style.js.map +0 -7
- package/dist/types/DescriptionComponent.d.ts +0 -4
- package/dist/types/TitleComponent.d.ts +0 -4
- package/dist/types/tests/overflow/DSCardNavigationOverflowTestRenderer.d.ts +0 -2
- package/dist/types/tests/wraptext/DSCardNavigationWrapTextTestRenderer.d.ts +0 -2
- /package/dist/types/tests/{overflow/DSCardNavigation.overflow.test.playwright.d.ts → tooltip-tests/DSCardNavigation.tooltip.hover.test.playwright.d.ts} +0 -0
- /package/dist/types/tests/{wraptext/DSCardNavigation.wrapText.test.playwright.d.ts → tooltip-tests/DSCardNavigation.tooltip.keyboard.test.playwright.d.ts} +0 -0
|
@@ -0,0 +1,88 @@
|
|
|
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 IconAndTextsRegionContent_exports = {};
|
|
30
|
+
__export(IconAndTextsRegionContent_exports, {
|
|
31
|
+
IconAndTextsRegionContent: () => IconAndTextsRegionContent
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(IconAndTextsRegionContent_exports);
|
|
34
|
+
var React = __toESM(require("react"));
|
|
35
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
36
|
+
var import_ds_typography = require("@elliemae/ds-typography");
|
|
37
|
+
var import_react = __toESM(require("react"));
|
|
38
|
+
var import_constants = require("../../constants/index.js");
|
|
39
|
+
var import_style = require("../style.js");
|
|
40
|
+
const mainIconColor = ["neutral", "0"];
|
|
41
|
+
const cols = ["1fr"];
|
|
42
|
+
const IconAndTextsRegionContent = import_react.default.memo((props) => {
|
|
43
|
+
const {
|
|
44
|
+
title,
|
|
45
|
+
description,
|
|
46
|
+
wrapText,
|
|
47
|
+
titleHandleRef,
|
|
48
|
+
descriptionHandleRef,
|
|
49
|
+
type,
|
|
50
|
+
Icon,
|
|
51
|
+
showFocusRingAroundAll,
|
|
52
|
+
hideFocusRingAroundAll
|
|
53
|
+
} = props;
|
|
54
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
55
|
+
import_style.StyledGridTextContainer,
|
|
56
|
+
{
|
|
57
|
+
role: "button",
|
|
58
|
+
tabIndex: 0,
|
|
59
|
+
onFocus: showFocusRingAroundAll,
|
|
60
|
+
onBlur: hideFocusRingAroundAll,
|
|
61
|
+
children: [
|
|
62
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_style.StyledCardNavigationIcon, { $type: type, "data-type": type, role: "presentation", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Icon, { size: "l", color: mainIconColor }) }),
|
|
63
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_style.StyledCardNavigationCentralContent, { cols, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_style.StyledCardNavigationContent, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_style.StyledCardNavigationContentTitleWrapper, { children: [
|
|
64
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_style.StyledCardNavigationContentTitle, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
65
|
+
import_style.StyledTitleTypography,
|
|
66
|
+
{
|
|
67
|
+
innerRef: titleHandleRef,
|
|
68
|
+
truncateWithEllipsis: !wrapText,
|
|
69
|
+
variant: import_ds_typography.TYPOGRAPHY_VARIANTS.B1,
|
|
70
|
+
children: title
|
|
71
|
+
}
|
|
72
|
+
) }),
|
|
73
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
74
|
+
import_style.StyledDescriptionTypography,
|
|
75
|
+
{
|
|
76
|
+
innerRef: descriptionHandleRef,
|
|
77
|
+
truncateWithEllipsis: !wrapText,
|
|
78
|
+
variant: import_ds_typography.TYPOGRAPHY_VARIANTS.B1,
|
|
79
|
+
"data-testid": import_constants.CARD_NAVIGATION_DATA_TESTID.DESCRIPTION_TEXT,
|
|
80
|
+
children: description
|
|
81
|
+
}
|
|
82
|
+
) })
|
|
83
|
+
] }) }) })
|
|
84
|
+
]
|
|
85
|
+
}
|
|
86
|
+
);
|
|
87
|
+
});
|
|
88
|
+
//# sourceMappingURL=IconAndTextsRegionContent.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/parts/text-region/IconAndTextsRegionContent.tsx", "../../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["import type { SvgIconT } from '@elliemae/ds-icons';\nimport { TYPOGRAPHY_VARIANTS } from '@elliemae/ds-typography';\nimport React from 'react';\nimport { CARD_NAVIGATION_DATA_TESTID } from '../../constants/index.js';\nimport type { DSCardNavigationT } from '../../react-desc-prop-types.js';\nimport {\n StyledCardNavigationCentralContent,\n StyledCardNavigationContent,\n StyledCardNavigationContentTitle,\n StyledCardNavigationContentTitleWrapper,\n StyledCardNavigationIcon,\n StyledDescriptionTypography,\n StyledGridTextContainer,\n StyledTitleTypography,\n} from '../style.js';\n\nconst mainIconColor = ['neutral', '0'] as SvgIconT.ColorType;\nconst cols = ['1fr'];\n\ninterface IconAndTextsRegionContentProps {\n title: DSCardNavigationT.InternalProps['title'];\n description: DSCardNavigationT.InternalProps['description'];\n wrapText: DSCardNavigationT.InternalProps['wrapText'];\n type: DSCardNavigationT.InternalProps['type'];\n Icon: DSCardNavigationT.InternalProps['Icon'];\n\n titleHandleRef: (node: HTMLElement | null) => void;\n descriptionHandleRef: (node: HTMLElement | null) => void;\n showFocusRingAroundAll: React.FocusEventHandler<HTMLDivElement>;\n hideFocusRingAroundAll: React.FocusEventHandler<HTMLDivElement>;\n}\n\nexport const IconAndTextsRegionContent = React.memo((props: IconAndTextsRegionContentProps) => {\n const {\n title,\n description,\n wrapText,\n titleHandleRef,\n descriptionHandleRef,\n type,\n Icon,\n showFocusRingAroundAll,\n hideFocusRingAroundAll,\n } = props;\n\n return (\n <StyledGridTextContainer\n role=\"button\"\n tabIndex={0}\n onFocus={showFocusRingAroundAll}\n onBlur={hideFocusRingAroundAll}\n >\n <StyledCardNavigationIcon $type={type} data-type={type} role=\"presentation\">\n <Icon size=\"l\" color={mainIconColor} />\n </StyledCardNavigationIcon>\n\n <StyledCardNavigationCentralContent cols={cols}>\n <StyledCardNavigationContent>\n <StyledCardNavigationContentTitleWrapper>\n <StyledCardNavigationContentTitle>\n <StyledTitleTypography\n innerRef={titleHandleRef}\n truncateWithEllipsis={!wrapText}\n variant={TYPOGRAPHY_VARIANTS.B1}\n >\n {title}\n </StyledTitleTypography>\n </StyledCardNavigationContentTitle>\n <div>\n <StyledDescriptionTypography\n innerRef={descriptionHandleRef}\n truncateWithEllipsis={!wrapText}\n variant={TYPOGRAPHY_VARIANTS.B1}\n data-testid={CARD_NAVIGATION_DATA_TESTID.DESCRIPTION_TEXT}\n >\n {description}\n </StyledDescriptionTypography>\n </div>\n </StyledCardNavigationContentTitleWrapper>\n </StyledCardNavigationContent>\n </StyledCardNavigationCentralContent>\n </StyledGridTextContainer>\n );\n});\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADqDf;AApDR,2BAAoC;AACpC,mBAAkB;AAClB,uBAA4C;AAE5C,mBASO;AAEP,MAAM,gBAAgB,CAAC,WAAW,GAAG;AACrC,MAAM,OAAO,CAAC,KAAK;AAeZ,MAAM,4BAA4B,aAAAA,QAAM,KAAK,CAAC,UAA0C;AAC7F,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI;AAEJ,SACE;AAAA,IAAC;AAAA;AAAA,MACC,MAAK;AAAA,MACL,UAAU;AAAA,MACV,SAAS;AAAA,MACT,QAAQ;AAAA,MAER;AAAA,oDAAC,yCAAyB,OAAO,MAAM,aAAW,MAAM,MAAK,gBAC3D,sDAAC,QAAK,MAAK,KAAI,OAAO,eAAe,GACvC;AAAA,QAEA,4CAAC,mDAAmC,MAClC,sDAAC,4CACC,uDAAC,wDACC;AAAA,sDAAC,iDACC;AAAA,YAAC;AAAA;AAAA,cACC,UAAU;AAAA,cACV,sBAAsB,CAAC;AAAA,cACvB,SAAS,yCAAoB;AAAA,cAE5B;AAAA;AAAA,UACH,GACF;AAAA,UACA,4CAAC,SACC;AAAA,YAAC;AAAA;AAAA,cACC,UAAU;AAAA,cACV,sBAAsB,CAAC;AAAA,cACvB,SAAS,yCAAoB;AAAA,cAC7B,eAAa,6CAA4B;AAAA,cAExC;AAAA;AAAA,UACH,GACF;AAAA,WACF,GACF,GACF;AAAA;AAAA;AAAA,EACF;AAEJ,CAAC;",
|
|
6
|
+
"names": ["React"]
|
|
7
|
+
}
|
|
@@ -57,9 +57,9 @@ const DSCardNavigationPropTypes = {
|
|
|
57
57
|
Icon: import_ds_props_helpers.PropTypes.func.description("component that will be used to render the icon").defaultValue('()=><LoanProducts size="l" color={["neutral", 0]} />'),
|
|
58
58
|
actions: import_ds_props_helpers.PropTypes.arrayOf(
|
|
59
59
|
import_ds_props_helpers.PropTypes.shape({
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
60
|
+
onClick: import_ds_props_helpers.PropTypes.func.isRequired,
|
|
61
|
+
icon: import_ds_props_helpers.PropTypes.element,
|
|
62
|
+
Icon: import_ds_props_helpers.PropTypes.func
|
|
63
63
|
})
|
|
64
64
|
).description("card navigation actions array").defaultValue("[]"),
|
|
65
65
|
wrapText: import_ds_props_helpers.PropTypes.bool.description("wrap text in the card navigation").defaultValue(false)
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/react-desc-prop-types.ts", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["/* eslint-disable @typescript-eslint/no-empty-interface */\nimport type React from 'react';\nimport type { GlobalAttributesT, XstyledProps, DSPropTypesSchema, ValidationMap } from '@elliemae/ds-props-helpers';\nimport {\n PropTypes,\n getPropsPerSlotPropTypes,\n globalAttributesPropTypes,\n xstyledPropTypes,\n} from '@elliemae/ds-props-helpers';\nimport { LoanProducts } from '@elliemae/ds-icons';\nimport { type TypescriptHelpersT } from '@elliemae/ds-typescript-helpers';\nimport { type SvgIconT } from '@elliemae/ds-icons';\nimport { DSCardNavigationName, CARD_NAVIGATION_SLOTS, CardNavigationTypesValues } from './constants/index.js';\n\nexport declare namespace DSCardNavigationT {\n export interface Action {\n icon?: React.ReactNode;\n Icon?: React.ComponentType<Record<string, never>>;\n onClick?: (e: React.KeyboardEvent<HTMLButtonElement> | React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;\n }\n\n export type TypeValues = (typeof CardNavigationTypesValues)[number];\n\n export interface RequiredProps {}\n\n export interface DefaultProps {\n containerProps: object;\n title: string;\n description: string;\n type: TypeValues;\n Icon: React.ComponentType<SvgIconT.Props>;\n actions: Array<Action> | ReadonlyArray<Action>;\n wrapText: boolean;\n }\n\n export interface OptionalProps\n extends TypescriptHelpersT.PropsForGlobalOnSlots<typeof DSCardNavigationName, typeof CARD_NAVIGATION_SLOTS> {}\n\n export interface Props\n extends Partial<DefaultProps>,\n OptionalProps,\n Omit<GlobalAttributesT<HTMLElement>, keyof DefaultProps | keyof XstyledProps>,\n XstyledProps,\n RequiredProps {}\n\n export interface InternalProps\n extends DefaultProps,\n OptionalProps,\n Omit<GlobalAttributesT<HTMLElement>, keyof DefaultProps | keyof XstyledProps>,\n XstyledProps,\n RequiredProps {}\n}\n\nexport const defaultProps: DSCardNavigationT.DefaultProps = {\n containerProps: {},\n title: '',\n description: '',\n type: CardNavigationTypesValues[0],\n Icon: LoanProducts,\n actions: [],\n wrapText: false,\n};\n\nexport const DSCardNavigationPropTypes: DSPropTypesSchema<DSCardNavigationT.Props> = {\n ...getPropsPerSlotPropTypes(DSCardNavigationName, CARD_NAVIGATION_SLOTS),\n ...globalAttributesPropTypes,\n ...xstyledPropTypes,\n\n containerProps: PropTypes.object.description('props to inject to card navigation wrapper').defaultValue('{}'),\n title: PropTypes.string.description('card navigation title').defaultValue(''),\n description: PropTypes.string.description('card navigation description').defaultValue(''),\n type: PropTypes.oneOf(CardNavigationTypesValues).description('card navigation type').defaultValue(''),\n\n Icon: PropTypes.func\n .description('component that will be used to render the icon')\n .defaultValue('()=><LoanProducts size=\"l\" color={[\"neutral\", 0]} />'),\n\n actions: PropTypes.arrayOf(\n PropTypes.shape({\n
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADGvB,8BAKO;AACP,sBAA6B;AAG7B,uBAAuF;AAyChF,MAAM,eAA+C;AAAA,EAC1D,gBAAgB,CAAC;AAAA,EACjB,OAAO;AAAA,EACP,aAAa;AAAA,EACb,MAAM,2CAA0B,CAAC;AAAA,EACjC,MAAM;AAAA,EACN,SAAS,CAAC;AAAA,EACV,UAAU;AACZ;AAEO,MAAM,4BAAwE;AAAA,EACnF,OAAG,kDAAyB,uCAAsB,sCAAqB;AAAA,EACvE,GAAG;AAAA,EACH,GAAG;AAAA,EAEH,gBAAgB,kCAAU,OAAO,YAAY,4CAA4C,EAAE,aAAa,IAAI;AAAA,EAC5G,OAAO,kCAAU,OAAO,YAAY,uBAAuB,EAAE,aAAa,EAAE;AAAA,EAC5E,aAAa,kCAAU,OAAO,YAAY,6BAA6B,EAAE,aAAa,EAAE;AAAA,EACxF,MAAM,kCAAU,MAAM,0CAAyB,EAAE,YAAY,sBAAsB,EAAE,aAAa,EAAE;AAAA,EAEpG,MAAM,kCAAU,KACb,YAAY,gDAAgD,EAC5D,aAAa,sDAAsD;AAAA,EAEtE,SAAS,kCAAU;AAAA,IACjB,kCAAU,MAAM;AAAA,MACd,
|
|
4
|
+
"sourcesContent": ["/* eslint-disable @typescript-eslint/no-empty-interface */\nimport type React from 'react';\nimport type { GlobalAttributesT, XstyledProps, DSPropTypesSchema, ValidationMap } from '@elliemae/ds-props-helpers';\nimport {\n PropTypes,\n getPropsPerSlotPropTypes,\n globalAttributesPropTypes,\n xstyledPropTypes,\n} from '@elliemae/ds-props-helpers';\nimport { LoanProducts } from '@elliemae/ds-icons';\nimport { type TypescriptHelpersT } from '@elliemae/ds-typescript-helpers';\nimport { type SvgIconT } from '@elliemae/ds-icons';\nimport { DSCardNavigationName, CARD_NAVIGATION_SLOTS, CardNavigationTypesValues } from './constants/index.js';\n\nexport declare namespace DSCardNavigationT {\n export interface Action {\n icon?: React.ReactNode;\n Icon?: React.ComponentType<Record<string, never>>;\n onClick?: (e: React.KeyboardEvent<HTMLButtonElement> | React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;\n }\n\n export type TypeValues = (typeof CardNavigationTypesValues)[number];\n\n export interface RequiredProps {}\n\n export interface DefaultProps {\n containerProps: object;\n title: string;\n description: string;\n type: TypeValues;\n Icon: React.ComponentType<SvgIconT.Props>;\n actions: Array<Action> | ReadonlyArray<Action>;\n wrapText: boolean;\n }\n\n export interface OptionalProps\n extends TypescriptHelpersT.PropsForGlobalOnSlots<typeof DSCardNavigationName, typeof CARD_NAVIGATION_SLOTS> {}\n\n export interface Props\n extends Partial<DefaultProps>,\n OptionalProps,\n Omit<GlobalAttributesT<HTMLElement>, keyof DefaultProps | keyof XstyledProps>,\n XstyledProps,\n RequiredProps {}\n\n export interface InternalProps\n extends DefaultProps,\n OptionalProps,\n Omit<GlobalAttributesT<HTMLElement>, keyof DefaultProps | keyof XstyledProps>,\n XstyledProps,\n RequiredProps {}\n}\n\nexport const defaultProps: DSCardNavigationT.DefaultProps = {\n containerProps: {},\n title: '',\n description: '',\n type: CardNavigationTypesValues[0],\n Icon: LoanProducts,\n actions: [],\n wrapText: false,\n};\n\nexport const DSCardNavigationPropTypes: DSPropTypesSchema<DSCardNavigationT.Props> = {\n ...getPropsPerSlotPropTypes(DSCardNavigationName, CARD_NAVIGATION_SLOTS),\n ...globalAttributesPropTypes,\n ...xstyledPropTypes,\n\n containerProps: PropTypes.object.description('props to inject to card navigation wrapper').defaultValue('{}'),\n title: PropTypes.string.description('card navigation title').defaultValue(''),\n description: PropTypes.string.description('card navigation description').defaultValue(''),\n type: PropTypes.oneOf(CardNavigationTypesValues).description('card navigation type').defaultValue(''),\n\n Icon: PropTypes.func\n .description('component that will be used to render the icon')\n .defaultValue('()=><LoanProducts size=\"l\" color={[\"neutral\", 0]} />'),\n\n actions: PropTypes.arrayOf(\n PropTypes.shape({\n onClick: PropTypes.func.isRequired,\n icon: PropTypes.element,\n Icon: PropTypes.func,\n }),\n )\n .description('card navigation actions array')\n .defaultValue('[]'),\n\n wrapText: PropTypes.bool.description('wrap text in the card navigation').defaultValue(false),\n};\n\nexport const DSCardNavigationPropTypesSchema =\n DSCardNavigationPropTypes as unknown as ValidationMap<DSCardNavigationT.Props>;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADGvB,8BAKO;AACP,sBAA6B;AAG7B,uBAAuF;AAyChF,MAAM,eAA+C;AAAA,EAC1D,gBAAgB,CAAC;AAAA,EACjB,OAAO;AAAA,EACP,aAAa;AAAA,EACb,MAAM,2CAA0B,CAAC;AAAA,EACjC,MAAM;AAAA,EACN,SAAS,CAAC;AAAA,EACV,UAAU;AACZ;AAEO,MAAM,4BAAwE;AAAA,EACnF,OAAG,kDAAyB,uCAAsB,sCAAqB;AAAA,EACvE,GAAG;AAAA,EACH,GAAG;AAAA,EAEH,gBAAgB,kCAAU,OAAO,YAAY,4CAA4C,EAAE,aAAa,IAAI;AAAA,EAC5G,OAAO,kCAAU,OAAO,YAAY,uBAAuB,EAAE,aAAa,EAAE;AAAA,EAC5E,aAAa,kCAAU,OAAO,YAAY,6BAA6B,EAAE,aAAa,EAAE;AAAA,EACxF,MAAM,kCAAU,MAAM,0CAAyB,EAAE,YAAY,sBAAsB,EAAE,aAAa,EAAE;AAAA,EAEpG,MAAM,kCAAU,KACb,YAAY,gDAAgD,EAC5D,aAAa,sDAAsD;AAAA,EAEtE,SAAS,kCAAU;AAAA,IACjB,kCAAU,MAAM;AAAA,MACd,SAAS,kCAAU,KAAK;AAAA,MACxB,MAAM,kCAAU;AAAA,MAChB,MAAM,kCAAU;AAAA,IAClB,CAAC;AAAA,EACH,EACG,YAAY,+BAA+B,EAC3C,aAAa,IAAI;AAAA,EAEpB,UAAU,kCAAU,KAAK,YAAY,kCAAkC,EAAE,aAAa,KAAK;AAC7F;AAEO,MAAM,kCACX;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,58 +1,51 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
-
import {
|
|
4
|
-
import { MoreOptionsVert } from "@elliemae/ds-icons";
|
|
5
|
-
import { describe } from "@elliemae/ds-props-helpers";
|
|
6
|
-
import { useMemo } from "react";
|
|
3
|
+
import { describe, useOwnerProps } from "@elliemae/ds-props-helpers";
|
|
7
4
|
import { useCardNavigation } from "./config/useCardNavigation.js";
|
|
8
5
|
import { DSCardNavigationName } from "./constants/index.js";
|
|
9
6
|
import { DSCardNavigationPropTypesSchema } from "./react-desc-prop-types.js";
|
|
10
|
-
import {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
StyledCardNavigationBoxWrapper,
|
|
14
|
-
StyledCardNavigationCentralContent,
|
|
15
|
-
StyledCardNavigationContent,
|
|
16
|
-
StyledCardNavigationContentTitleWrapper,
|
|
17
|
-
StyledCardNavigationIcon
|
|
18
|
-
} from "./style.js";
|
|
19
|
-
import { TitleComponent } from "./TitleComponent.js";
|
|
20
|
-
import { DescriptionComponent } from "./DescriptionComponent.js";
|
|
21
|
-
const mainIconColor = ["neutral", "0"];
|
|
7
|
+
import { StyledCardNavigationBoxWrapper } from "./parts/style.js";
|
|
8
|
+
import { IconAndTextsRegion } from "./parts/text-region/IconAndTextsRegion.js";
|
|
9
|
+
import { ActionsRegion } from "./parts/ActionsRegion.js";
|
|
22
10
|
const DSCardNavigation = (props) => {
|
|
23
|
-
const
|
|
24
|
-
const {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
11
|
+
const cardNavigationConfig = useCardNavigation(props);
|
|
12
|
+
const {
|
|
13
|
+
propsWithDefault,
|
|
14
|
+
xstyledProps,
|
|
15
|
+
globalProps,
|
|
16
|
+
iconAndTextsRegionIsFocused,
|
|
17
|
+
showFocusRingAroundAll,
|
|
18
|
+
hideFocusRingAroundAll,
|
|
19
|
+
instanceUid
|
|
20
|
+
} = cardNavigationConfig;
|
|
21
|
+
const { containerProps, title, description, type, Icon, actions, wrapText } = propsWithDefault;
|
|
22
|
+
const { getOwnerProps, getOwnerPropsArguments } = useOwnerProps(propsWithDefault);
|
|
23
|
+
return /* @__PURE__ */ jsxs(
|
|
24
|
+
StyledCardNavigationBoxWrapper,
|
|
25
|
+
{
|
|
26
|
+
...globalProps,
|
|
27
|
+
...xstyledProps,
|
|
28
|
+
...containerProps,
|
|
29
|
+
getOwnerProps,
|
|
30
|
+
getOwnerPropsArguments,
|
|
31
|
+
$isIconAndTextsRegionFocused: iconAndTextsRegionIsFocused,
|
|
32
|
+
children: [
|
|
33
|
+
/* @__PURE__ */ jsx(
|
|
34
|
+
IconAndTextsRegion,
|
|
35
|
+
{
|
|
36
|
+
title,
|
|
37
|
+
description,
|
|
38
|
+
wrapText,
|
|
39
|
+
type,
|
|
40
|
+
Icon,
|
|
41
|
+
showFocusRingAroundAll,
|
|
42
|
+
hideFocusRingAroundAll
|
|
43
|
+
}
|
|
44
|
+
),
|
|
45
|
+
/* @__PURE__ */ jsx(ActionsRegion, { actions, instanceUid })
|
|
46
|
+
]
|
|
47
|
+
}
|
|
48
|
+
);
|
|
56
49
|
};
|
|
57
50
|
DSCardNavigation.displayName = DSCardNavigationName;
|
|
58
51
|
const DSCardNavigationWithSchema = describe(DSCardNavigation);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/DSCardNavigation.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import {
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { describe, useOwnerProps } from '@elliemae/ds-props-helpers';\nimport React from 'react';\nimport { useCardNavigation } from './config/useCardNavigation.js';\nimport { DSCardNavigationName } from './constants/index.js';\nimport { type DSCardNavigationT, DSCardNavigationPropTypesSchema } from './react-desc-prop-types.js';\nimport { StyledCardNavigationBoxWrapper } from './parts/style.js';\nimport { IconAndTextsRegion } from './parts/text-region/IconAndTextsRegion.js';\nimport { ActionsRegion } from './parts/ActionsRegion.js';\n\nconst DSCardNavigation: React.ComponentType<DSCardNavigationT.Props> = (props) => {\n const cardNavigationConfig = useCardNavigation(props);\n const {\n propsWithDefault,\n xstyledProps,\n globalProps,\n iconAndTextsRegionIsFocused,\n showFocusRingAroundAll,\n hideFocusRingAroundAll,\n instanceUid,\n } = cardNavigationConfig;\n const { containerProps, title, description, type, Icon, actions, wrapText } = propsWithDefault;\n\n const { getOwnerProps, getOwnerPropsArguments } = useOwnerProps<DSCardNavigationT.Props>(propsWithDefault);\n\n return (\n <StyledCardNavigationBoxWrapper\n {...globalProps}\n {...xstyledProps}\n {...containerProps}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n $isIconAndTextsRegionFocused={iconAndTextsRegionIsFocused}\n >\n <IconAndTextsRegion\n title={title}\n description={description}\n wrapText={wrapText}\n type={type}\n Icon={Icon}\n showFocusRingAroundAll={showFocusRingAroundAll}\n hideFocusRingAroundAll={hideFocusRingAroundAll}\n />\n <ActionsRegion actions={actions} instanceUid={instanceUid} />\n </StyledCardNavigationBoxWrapper>\n );\n};\n\nDSCardNavigation.displayName = DSCardNavigationName;\nconst DSCardNavigationWithSchema = describe(DSCardNavigation);\nDSCardNavigationWithSchema.propTypes = DSCardNavigationPropTypesSchema;\n\nexport { DSCardNavigation, DSCardNavigationWithSchema };\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACyBnB,SAQE,KARF;AAzBJ,SAAS,UAAU,qBAAqB;AAExC,SAAS,yBAAyB;AAClC,SAAS,4BAA4B;AACrC,SAAiC,uCAAuC;AACxE,SAAS,sCAAsC;AAC/C,SAAS,0BAA0B;AACnC,SAAS,qBAAqB;AAE9B,MAAM,mBAAiE,CAAC,UAAU;AAChF,QAAM,uBAAuB,kBAAkB,KAAK;AACpD,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI;AACJ,QAAM,EAAE,gBAAgB,OAAO,aAAa,MAAM,MAAM,SAAS,SAAS,IAAI;AAE9E,QAAM,EAAE,eAAe,uBAAuB,IAAI,cAAuC,gBAAgB;AAEzG,SACE;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACH,GAAG;AAAA,MACH,GAAG;AAAA,MACJ;AAAA,MACA;AAAA,MACA,8BAA8B;AAAA,MAE9B;AAAA;AAAA,UAAC;AAAA;AAAA,YACC;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA;AAAA,QACF;AAAA,QACA,oBAAC,iBAAc,SAAkB,aAA0B;AAAA;AAAA;AAAA,EAC7D;AAEJ;AAEA,iBAAiB,cAAc;AAC/B,MAAM,6BAA6B,SAAS,gBAAgB;AAC5D,2BAA2B,YAAY;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,26 +1,41 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import React2 from "react";
|
|
3
|
-
import { useGetXstyledProps, useMemoMergePropsWithDefault } from "@elliemae/ds-props-helpers";
|
|
3
|
+
import { useGetXstyledProps, useMemoMergePropsWithDefault, useGetGlobalAttributes } from "@elliemae/ds-props-helpers";
|
|
4
4
|
import { uid } from "uid";
|
|
5
5
|
import { DSCardNavigationPropTypes, defaultProps } from "../react-desc-prop-types.js";
|
|
6
6
|
import { useValidateProps } from "./useValidateProps.js";
|
|
7
7
|
const useCardNavigation = (propsFromUser) => {
|
|
8
8
|
const propsWithDefault = useMemoMergePropsWithDefault(propsFromUser, defaultProps);
|
|
9
9
|
useValidateProps(propsWithDefault, DSCardNavigationPropTypes);
|
|
10
|
+
const { title, ...globalPropsWithoutReusedReservedKeywords } = propsWithDefault;
|
|
11
|
+
const globalProps = useGetGlobalAttributes(globalPropsWithoutReusedReservedKeywords);
|
|
10
12
|
const xstyledProps = useGetXstyledProps(propsWithDefault);
|
|
11
13
|
const instanceUid = React2.useMemo(() => `ds-card-navigation-${uid(5)}`, []);
|
|
14
|
+
const [iconAndTextsRegionIsFocused, setIconAndTextsRegionIsFocused] = React2.useState(false);
|
|
15
|
+
const showFocusRingAroundAll = React2.useCallback(() => {
|
|
16
|
+
setIconAndTextsRegionIsFocused(true);
|
|
17
|
+
}, []);
|
|
18
|
+
const hideFocusRingAroundAll = React2.useCallback(() => {
|
|
19
|
+
setIconAndTextsRegionIsFocused(false);
|
|
20
|
+
}, []);
|
|
12
21
|
return React2.useMemo(
|
|
13
22
|
() => ({
|
|
14
23
|
propsWithDefault,
|
|
15
24
|
xstyledProps,
|
|
16
|
-
|
|
17
|
-
|
|
25
|
+
globalProps,
|
|
26
|
+
instanceUid,
|
|
27
|
+
iconAndTextsRegionIsFocused,
|
|
28
|
+
showFocusRingAroundAll,
|
|
29
|
+
hideFocusRingAroundAll
|
|
18
30
|
}),
|
|
19
31
|
[
|
|
20
32
|
propsWithDefault,
|
|
21
33
|
xstyledProps,
|
|
22
|
-
|
|
23
|
-
|
|
34
|
+
globalProps,
|
|
35
|
+
instanceUid,
|
|
36
|
+
iconAndTextsRegionIsFocused,
|
|
37
|
+
showFocusRingAroundAll,
|
|
38
|
+
hideFocusRingAroundAll
|
|
24
39
|
]
|
|
25
40
|
);
|
|
26
41
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/config/useCardNavigation.ts"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { useGetXstyledProps, useMemoMergePropsWithDefault } from '@elliemae/ds-props-helpers';\nimport { uid } from 'uid';\nimport { type DSCardNavigationT, DSCardNavigationPropTypes, defaultProps } from '../react-desc-prop-types.js';\nimport { useValidateProps } from './useValidateProps.js';\n\nexport interface CardNavigationCTX {\n propsWithDefault: DSCardNavigationT.InternalProps;\n xstyledProps: ReturnType<typeof useGetXstyledProps>;\n instanceUid: string;\n}\n\nexport const useCardNavigation = (propsFromUser: DSCardNavigationT.Props) => {\n // =============================================================================\n // MERGE WITH DEFAULT AND VALIDATE PROPS\n // =============================================================================\n const propsWithDefault = useMemoMergePropsWithDefault<DSCardNavigationT.InternalProps>(propsFromUser, defaultProps);\n useValidateProps(propsWithDefault, DSCardNavigationPropTypes);\n // =============================================================================\n // XSTYLED PROPS\n // =============================================================================\n const xstyledProps = useGetXstyledProps(propsWithDefault);\n // =============================================================================\n // AD HOC PER COMPONENT LOGIC\n // =============================================================================\n
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACAvB,OAAOA,YAAW;AAClB,SAAS,oBAAoB,
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { useGetXstyledProps, useMemoMergePropsWithDefault, useGetGlobalAttributes } from '@elliemae/ds-props-helpers';\nimport { uid } from 'uid';\nimport { type DSCardNavigationT, DSCardNavigationPropTypes, defaultProps } from '../react-desc-prop-types.js';\nimport { useValidateProps } from './useValidateProps.js';\n\nexport interface CardNavigationCTX {\n propsWithDefault: DSCardNavigationT.InternalProps;\n xstyledProps: ReturnType<typeof useGetXstyledProps>;\n globalProps: ReturnType<typeof useGetGlobalAttributes>;\n instanceUid: string;\n iconAndTextsRegionIsFocused: boolean;\n showFocusRingAroundAll: React.FocusEventHandler<HTMLDivElement>;\n hideFocusRingAroundAll: React.FocusEventHandler<HTMLDivElement>;\n}\n\nexport const useCardNavigation = (propsFromUser: DSCardNavigationT.Props): CardNavigationCTX => {\n // =============================================================================\n // MERGE WITH DEFAULT AND VALIDATE PROPS\n // =============================================================================\n const propsWithDefault = useMemoMergePropsWithDefault<DSCardNavigationT.InternalProps>(propsFromUser, defaultProps);\n useValidateProps(propsWithDefault, DSCardNavigationPropTypes);\n // =============================================================================\n // GLOBAL ATTRIBUTES & XSTYLED PROPS\n // =============================================================================\n // exclude `title` as it is a reused reserved keyword from global props,\n // we intend to \"consume\" the title props, not \"spread\" in the html\n const { title, ...globalPropsWithoutReusedReservedKeywords } = propsWithDefault;\n const globalProps = useGetGlobalAttributes(globalPropsWithoutReusedReservedKeywords);\n const xstyledProps = useGetXstyledProps(propsWithDefault);\n // =============================================================================\n // AD HOC PER COMPONENT LOGIC\n // =============================================================================\n const instanceUid = React.useMemo(() => `ds-card-navigation-${uid(5)}`, []);\n const [iconAndTextsRegionIsFocused, setIconAndTextsRegionIsFocused] = React.useState(false);\n const showFocusRingAroundAll = React.useCallback<React.FocusEventHandler<HTMLDivElement>>(() => {\n setIconAndTextsRegionIsFocused(true);\n }, []);\n const hideFocusRingAroundAll = React.useCallback<React.FocusEventHandler<HTMLDivElement>>(() => {\n setIconAndTextsRegionIsFocused(false);\n }, []);\n\n return React.useMemo(\n () => ({\n propsWithDefault,\n xstyledProps,\n globalProps,\n instanceUid,\n iconAndTextsRegionIsFocused,\n showFocusRingAroundAll,\n hideFocusRingAroundAll,\n }),\n [\n propsWithDefault,\n xstyledProps,\n globalProps,\n instanceUid,\n iconAndTextsRegionIsFocused,\n showFocusRingAroundAll,\n hideFocusRingAroundAll,\n ],\n );\n};\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB,OAAOA,YAAW;AAClB,SAAS,oBAAoB,8BAA8B,8BAA8B;AACzF,SAAS,WAAW;AACpB,SAAiC,2BAA2B,oBAAoB;AAChF,SAAS,wBAAwB;AAY1B,MAAM,oBAAoB,CAAC,kBAA8D;AAI9F,QAAM,mBAAmB,6BAA8D,eAAe,YAAY;AAClH,mBAAiB,kBAAkB,yBAAyB;AAM5D,QAAM,EAAE,OAAO,GAAG,yCAAyC,IAAI;AAC/D,QAAM,cAAc,uBAAuB,wCAAwC;AACnF,QAAM,eAAe,mBAAmB,gBAAgB;AAIxD,QAAM,cAAcA,OAAM,QAAQ,MAAM,sBAAsB,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC;AAC1E,QAAM,CAAC,6BAA6B,8BAA8B,IAAIA,OAAM,SAAS,KAAK;AAC1F,QAAM,yBAAyBA,OAAM,YAAqD,MAAM;AAC9F,mCAA+B,IAAI;AAAA,EACrC,GAAG,CAAC,CAAC;AACL,QAAM,yBAAyBA,OAAM,YAAqD,MAAM;AAC9F,mCAA+B,KAAK;AAAA,EACtC,GAAG,CAAC,CAAC;AAEL,SAAOA,OAAM;AAAA,IACX,OAAO;AAAA,MACL;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,EACF;AACF;",
|
|
6
6
|
"names": ["React"]
|
|
7
7
|
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import { BUTTON_SIZES, BUTTON_TYPES, DSButtonV3 } from "@elliemae/ds-button-v2";
|
|
4
|
+
import { MoreOptionsVert } from "@elliemae/ds-icons";
|
|
5
|
+
import { StyledCardNavigationAction, StyledCardNavigationActions } from "./style.js";
|
|
6
|
+
const ActionsRegion = ({ actions, instanceUid }) => {
|
|
7
|
+
if (actions.length === 0) return null;
|
|
8
|
+
return /* @__PURE__ */ jsx(StyledCardNavigationActions, { children: actions.map(({ icon, Icon, onClick, ...unexpectedButPreviouslySupportedOtherProps }, index) => {
|
|
9
|
+
const defaultIconJSX = /* @__PURE__ */ jsx(MoreOptionsVert, { "aria-label": "More options" });
|
|
10
|
+
const iconJSX = icon ?? defaultIconJSX;
|
|
11
|
+
return /* @__PURE__ */ jsx(
|
|
12
|
+
StyledCardNavigationAction,
|
|
13
|
+
{
|
|
14
|
+
children: /* @__PURE__ */ jsx(
|
|
15
|
+
DSButtonV3,
|
|
16
|
+
{
|
|
17
|
+
onClick,
|
|
18
|
+
"aria-label": "More options",
|
|
19
|
+
...unexpectedButPreviouslySupportedOtherProps,
|
|
20
|
+
buttonType: BUTTON_TYPES.ICON,
|
|
21
|
+
size: BUTTON_SIZES.L,
|
|
22
|
+
children: Icon ? /* @__PURE__ */ jsx(Icon, {}) : iconJSX
|
|
23
|
+
}
|
|
24
|
+
)
|
|
25
|
+
},
|
|
26
|
+
`${instanceUid}-${index}`
|
|
27
|
+
);
|
|
28
|
+
}) });
|
|
29
|
+
};
|
|
30
|
+
export {
|
|
31
|
+
ActionsRegion
|
|
32
|
+
};
|
|
33
|
+
//# sourceMappingURL=ActionsRegion.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/parts/ActionsRegion.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { BUTTON_SIZES, BUTTON_TYPES, DSButtonV3 } from '@elliemae/ds-button-v2';\nimport { MoreOptionsVert } from '@elliemae/ds-icons';\nimport React from 'react';\nimport type { DSCardNavigationT } from '../react-desc-prop-types.js';\nimport { StyledCardNavigationAction, StyledCardNavigationActions } from './style.js';\n\ninterface ActionRegionProps {\n actions: DSCardNavigationT.InternalProps['actions'];\n instanceUid: string;\n}\n\nexport const ActionsRegion: React.ComponentType<ActionRegionProps> = ({ actions, instanceUid }) => {\n if (actions.length === 0) return null;\n return (\n <StyledCardNavigationActions>\n {actions.map(({ icon, Icon, onClick, ...unexpectedButPreviouslySupportedOtherProps }, index) => {\n const defaultIconJSX = <MoreOptionsVert aria-label=\"More options\" />;\n const iconJSX = icon ?? defaultIconJSX;\n return (\n <StyledCardNavigationAction\n // eslint-disable-next-line react/no-array-index-key\n key={`${instanceUid}-${index}`}\n >\n <DSButtonV3\n onClick={onClick}\n aria-label=\"More options\"\n {...unexpectedButPreviouslySupportedOtherProps}\n buttonType={BUTTON_TYPES.ICON}\n size={BUTTON_SIZES.L}\n >\n {Icon ? <Icon /> : iconJSX}\n </DSButtonV3>\n </StyledCardNavigationAction>\n );\n })}\n </StyledCardNavigationActions>\n );\n};\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACgBQ;AAhB/B,SAAS,cAAc,cAAc,kBAAkB;AACvD,SAAS,uBAAuB;AAGhC,SAAS,4BAA4B,mCAAmC;AAOjE,MAAM,gBAAwD,CAAC,EAAE,SAAS,YAAY,MAAM;AACjG,MAAI,QAAQ,WAAW,EAAG,QAAO;AACjC,SACE,oBAAC,+BACE,kBAAQ,IAAI,CAAC,EAAE,MAAM,MAAM,SAAS,GAAG,2CAA2C,GAAG,UAAU;AAC9F,UAAM,iBAAiB,oBAAC,mBAAgB,cAAW,gBAAe;AAClE,UAAM,UAAU,QAAQ;AACxB,WACE;AAAA,MAAC;AAAA;AAAA,QAIC;AAAA,UAAC;AAAA;AAAA,YACC;AAAA,YACA,cAAW;AAAA,YACV,GAAG;AAAA,YACJ,YAAY,aAAa;AAAA,YACzB,MAAM,aAAa;AAAA,YAElB,iBAAO,oBAAC,QAAK,IAAK;AAAA;AAAA,QACrB;AAAA;AAAA,MAVK,GAAG,WAAW,IAAI,KAAK;AAAA,IAW9B;AAAA,EAEJ,CAAC,GACH;AAEJ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,30 +1,33 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import { DSTypography } from "@elliemae/ds-typography";
|
|
3
|
-
import { styled } from "@elliemae/ds-system";
|
|
4
2
|
import { Grid } from "@elliemae/ds-grid";
|
|
5
|
-
import {
|
|
3
|
+
import { css, styled } from "@elliemae/ds-system";
|
|
4
|
+
import { DSTypography } from "@elliemae/ds-typography";
|
|
5
|
+
import { CARD_NAVIGATION_SLOTS, CardNavigationTypes, DSCardNavigationName } from "../constants/index.js";
|
|
6
6
|
const StyledCardNavigationContentTitle = styled("div", {
|
|
7
7
|
name: DSCardNavigationName,
|
|
8
8
|
slot: CARD_NAVIGATION_SLOTS.TITLE
|
|
9
|
-
})
|
|
10
|
-
padding-top: ${(props) => props.theme.space.xxs};
|
|
11
|
-
`;
|
|
9
|
+
})``;
|
|
12
10
|
const StyledTitleTypography = styled(DSTypography)`
|
|
13
11
|
color: ${(props) => props.theme.colors.neutral["700"]};
|
|
14
12
|
font-weight: ${(props) => props.theme.fontWeights.semibold};
|
|
15
|
-
font-size: 18px
|
|
13
|
+
font-size: 1.3846rem; // 18px -> 18/13 = 1.3846rem
|
|
14
|
+
|
|
15
|
+
@media (max-width: ${({ theme }) => theme.breakpoints.small}) {
|
|
16
|
+
font-size: 1.125rem; // 18px -> 18/16 = 1.125rem
|
|
17
|
+
}
|
|
16
18
|
`;
|
|
17
|
-
const StyledCardNavigationContentDescription = styled.div``;
|
|
18
19
|
const StyledDescriptionTypography = styled(DSTypography)`
|
|
19
20
|
color: ${(props) => props.theme.colors.neutral["500"]};
|
|
20
|
-
font-size: 12px
|
|
21
|
+
font-size: 0.923rem; // 12px -> 12/13 = 0.923rem
|
|
22
|
+
|
|
23
|
+
@media (max-width: ${({ theme }) => theme.breakpoints.small}) {
|
|
24
|
+
font-size: 0.8775rem; // 12px -> 10.5/12 = 0.8775rem
|
|
25
|
+
}
|
|
21
26
|
`;
|
|
22
27
|
const StyledCardNavigationContentTitleWrapper = styled.div`
|
|
23
28
|
width: 100%;
|
|
24
29
|
`;
|
|
25
30
|
const StyledCardNavigationContent = styled.div`
|
|
26
|
-
padding-right: ${(props) => props.theme.space.xs};
|
|
27
|
-
padding-left: ${(props) => props.theme.space.xs};
|
|
28
31
|
display: flex;
|
|
29
32
|
align-items: center;
|
|
30
33
|
flex: 1;
|
|
@@ -34,15 +37,14 @@ const StyledCardNavigationCentralContent = styled(Grid, {
|
|
|
34
37
|
slot: CARD_NAVIGATION_SLOTS.CENTRAL_CONTENT,
|
|
35
38
|
name: DSCardNavigationName
|
|
36
39
|
})`
|
|
37
|
-
|
|
38
|
-
@media (max-width: ${(props) => props.theme.breakpoints.small}) {
|
|
39
|
-
min-width: 336px;
|
|
40
|
-
}
|
|
40
|
+
padding: ${(props) => props.theme.space.xs};
|
|
41
41
|
`;
|
|
42
42
|
const StyledCardNavigationBoxWrapper = styled("div", {
|
|
43
43
|
name: DSCardNavigationName,
|
|
44
44
|
slot: CARD_NAVIGATION_SLOTS.ROOT
|
|
45
45
|
})`
|
|
46
|
+
min-width: 240px;
|
|
47
|
+
min-height: 64px;
|
|
46
48
|
width: 337px;
|
|
47
49
|
display: flex;
|
|
48
50
|
flex-direction: row;
|
|
@@ -51,10 +53,12 @@ const StyledCardNavigationBoxWrapper = styled("div", {
|
|
|
51
53
|
border-radius: 2px;
|
|
52
54
|
position: relative;
|
|
53
55
|
outline: none;
|
|
56
|
+
|
|
54
57
|
${(props) => props.fluid ? "width: 100%" : ""};
|
|
55
58
|
@media (max-width: ${(props) => props.theme.breakpoints.small}) {
|
|
56
59
|
width: ${(props) => props.fluid ? "width: 100%" : "414px"};
|
|
57
60
|
}
|
|
61
|
+
|
|
58
62
|
:after {
|
|
59
63
|
display: block;
|
|
60
64
|
content: '';
|
|
@@ -67,46 +71,59 @@ const StyledCardNavigationBoxWrapper = styled("div", {
|
|
|
67
71
|
border-radius: 2px;
|
|
68
72
|
pointer-events: none;
|
|
69
73
|
}
|
|
70
|
-
&:hover
|
|
71
|
-
&:focus {
|
|
74
|
+
&:hover {
|
|
72
75
|
box-shadow: 0 3px 8px 0px rgba(37, 41, 47, 0.4);
|
|
76
|
+
outline-offset: 2px;
|
|
73
77
|
}
|
|
78
|
+
|
|
79
|
+
${(props) => props.$isIconAndTextsRegionFocused ? css`
|
|
80
|
+
outline: 2px solid ${props.theme.colors.brand["700"]};
|
|
81
|
+
outline-offset: 2px;
|
|
82
|
+
` : css``}
|
|
74
83
|
`;
|
|
75
84
|
const StyledCardNavigationIcon = styled("div", {
|
|
76
85
|
name: DSCardNavigationName,
|
|
77
86
|
slot: CARD_NAVIGATION_SLOTS.TYPE
|
|
78
87
|
})`
|
|
79
|
-
width: 64px;
|
|
80
|
-
height: 64px;
|
|
81
|
-
|
|
88
|
+
min-width: 64px;
|
|
89
|
+
min-height: 64px;
|
|
90
|
+
height: 100%;
|
|
82
91
|
border-top-left-radius: 2px;
|
|
83
92
|
border-bottom-left-radius: 2px;
|
|
84
|
-
padding: ${(props) => props.theme.space.
|
|
93
|
+
padding: ${(props) => props.theme.space.xs};
|
|
85
94
|
display: flex;
|
|
86
95
|
align-items: center;
|
|
87
96
|
justify-content: center;
|
|
88
97
|
fill: #ffffff;
|
|
89
|
-
background-color: ${({ $type }) => $type === CardNavigationTypes.BORROWER && "#32aad1" || $type === CardNavigationTypes.FINANCIAL && "#1ba88d" || $type === CardNavigationTypes.LOAN && "#8e49b2" || $type === CardNavigationTypes.REGULATORY && "#db5575" || "#32aad1"};
|
|
98
|
+
background-color: ${({ $type }) => $type === CardNavigationTypes.BORROWER && "#32aad1" || $type === CardNavigationTypes.FINANCIAL && "#1ba88d" || $type === CardNavigationTypes.LOAN && "#8e49b2" || $type === CardNavigationTypes.REGULATORY && "#db5575" || "#32aad1"};
|
|
90
99
|
`;
|
|
91
100
|
const StyledCardNavigationActions = styled("div", {
|
|
92
101
|
name: DSCardNavigationName,
|
|
93
102
|
slot: CARD_NAVIGATION_SLOTS.ACTIONS
|
|
94
103
|
})`
|
|
104
|
+
padding: 0 ${(props) => props.theme.space.xs};
|
|
95
105
|
display: flex;
|
|
96
106
|
flex-direction: row;
|
|
97
107
|
align-items: center;
|
|
98
|
-
|
|
108
|
+
gap: ${(props) => props.theme.space.xs};
|
|
109
|
+
`;
|
|
110
|
+
const StyledCardNavigationAction = styled("div")`
|
|
111
|
+
span,
|
|
112
|
+
svg {
|
|
113
|
+
height: ${({ theme }) => theme.space.s};
|
|
114
|
+
width: ${({ theme }) => theme.space.s};
|
|
115
|
+
fill: ${({ theme }) => theme.colors.neutral[500]};
|
|
116
|
+
}
|
|
99
117
|
`;
|
|
100
|
-
const
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
}
|
|
118
|
+
const StyledGridTextContainer = styled("div")`
|
|
119
|
+
display: grid;
|
|
120
|
+
grid-template-columns: max-content auto;
|
|
121
|
+
align-items: center;
|
|
122
|
+
min-width: 0;
|
|
123
|
+
max-width: 100%;
|
|
124
|
+
overflow: hidden;
|
|
125
|
+
&:focus {
|
|
126
|
+
outline: none;
|
|
110
127
|
}
|
|
111
128
|
`;
|
|
112
129
|
export {
|
|
@@ -115,11 +132,11 @@ export {
|
|
|
115
132
|
StyledCardNavigationBoxWrapper,
|
|
116
133
|
StyledCardNavigationCentralContent,
|
|
117
134
|
StyledCardNavigationContent,
|
|
118
|
-
StyledCardNavigationContentDescription,
|
|
119
135
|
StyledCardNavigationContentTitle,
|
|
120
136
|
StyledCardNavigationContentTitleWrapper,
|
|
121
137
|
StyledCardNavigationIcon,
|
|
122
138
|
StyledDescriptionTypography,
|
|
139
|
+
StyledGridTextContainer,
|
|
123
140
|
StyledTitleTypography
|
|
124
141
|
};
|
|
125
142
|
//# sourceMappingURL=style.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/parts/style.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { Grid } from '@elliemae/ds-grid';\nimport { css, styled } from '@elliemae/ds-system';\nimport { DSTypography } from '@elliemae/ds-typography';\nimport { CARD_NAVIGATION_SLOTS, CardNavigationTypes, DSCardNavigationName } from '../constants/index.js';\n\nexport const StyledCardNavigationContentTitle = styled('div', {\n name: DSCardNavigationName,\n slot: CARD_NAVIGATION_SLOTS.TITLE,\n})``;\n\nexport const StyledTitleTypography = styled(DSTypography)`\n color: ${(props) => props.theme.colors.neutral['700']};\n font-weight: ${(props) => props.theme.fontWeights.semibold};\n font-size: 1.3846rem; // 18px -> 18/13 = 1.3846rem\n\n @media (max-width: ${({ theme }) => theme.breakpoints.small}) {\n font-size: 1.125rem; // 18px -> 18/16 = 1.125rem\n }\n`;\n\nexport const StyledDescriptionTypography = styled(DSTypography)`\n color: ${(props) => props.theme.colors.neutral['500']};\n font-size: 0.923rem; // 12px -> 12/13 = 0.923rem\n\n @media (max-width: ${({ theme }) => theme.breakpoints.small}) {\n font-size: 0.8775rem; // 12px -> 10.5/12 = 0.8775rem\n }\n`;\n\nexport const StyledCardNavigationContentTitleWrapper = styled.div`\n width: 100%;\n`;\n\nexport const StyledCardNavigationContent = styled.div<{ wrapText?: boolean }>`\n display: flex;\n align-items: center;\n flex: 1;\n width: 100%;\n`;\n\nexport const StyledCardNavigationCentralContent = styled(Grid, {\n slot: CARD_NAVIGATION_SLOTS.CENTRAL_CONTENT,\n name: DSCardNavigationName,\n})<{ wrapText?: boolean; AnyOverFlow?: boolean }>`\n padding: ${(props) => props.theme.space.xs};\n`;\ninterface StyledCardNavigationBoxWrapperProps {\n fluid?: boolean;\n}\n\nexport const StyledCardNavigationBoxWrapper = styled('div', {\n name: DSCardNavigationName,\n slot: CARD_NAVIGATION_SLOTS.ROOT,\n})<StyledCardNavigationBoxWrapperProps & { $isIconAndTextsRegionFocused?: boolean }>`\n min-width: 240px;\n min-height: 64px;\n width: 337px;\n display: flex;\n flex-direction: row;\n flex-wrap: nowrap;\n box-shadow: 0 1px 4px 0px rgba(37, 41, 47, 0.5);\n border-radius: 2px;\n position: relative;\n outline: none;\n\n ${(props) => (props.fluid ? 'width: 100%' : '')};\n @media (max-width: ${(props) => props.theme.breakpoints.small}) {\n width: ${(props) => (props.fluid ? 'width: 100%' : '414px')};\n }\n\n :after {\n display: block;\n content: '';\n position: absolute;\n height: 100%;\n width: 100%;\n top: 0;\n left: 0;\n border: solid ${(props) => props.theme.space.xxs} transparent;\n border-radius: 2px;\n pointer-events: none;\n }\n &:hover {\n box-shadow: 0 3px 8px 0px rgba(37, 41, 47, 0.4);\n outline-offset: 2px;\n }\n\n ${(props) =>\n props.$isIconAndTextsRegionFocused\n ? css`\n outline: 2px solid ${props.theme.colors.brand['700']};\n outline-offset: 2px;\n `\n : css``}\n`;\n\ninterface StyledCardNavigationIconProps {\n $type: (typeof CardNavigationTypes)[keyof typeof CardNavigationTypes];\n}\n\nexport const StyledCardNavigationIcon = styled('div', {\n name: DSCardNavigationName,\n slot: CARD_NAVIGATION_SLOTS.TYPE,\n})<StyledCardNavigationIconProps>`\n min-width: 64px;\n min-height: 64px;\n height: 100%;\n border-top-left-radius: 2px;\n border-bottom-left-radius: 2px;\n padding: ${(props) => props.theme.space.xs};\n display: flex;\n align-items: center;\n justify-content: center;\n fill: #ffffff;\n background-color: ${({ $type }) =>\n ($type === CardNavigationTypes.BORROWER && '#32aad1') ||\n ($type === CardNavigationTypes.FINANCIAL && '#1ba88d') ||\n ($type === CardNavigationTypes.LOAN && '#8e49b2') ||\n ($type === CardNavigationTypes.REGULATORY && '#db5575') ||\n '#32aad1'};\n`;\n\nexport const StyledCardNavigationActions = styled('div', {\n name: DSCardNavigationName,\n slot: CARD_NAVIGATION_SLOTS.ACTIONS,\n})`\n padding: 0 ${(props) => props.theme.space.xs};\n display: flex;\n flex-direction: row;\n align-items: center;\n gap: ${(props) => props.theme.space.xs};\n`;\n\nexport const StyledCardNavigationAction = styled('div')`\n span,\n svg {\n height: ${({ theme }) => theme.space.s};\n width: ${({ theme }) => theme.space.s};\n fill: ${({ theme }) => theme.colors.neutral[500]};\n }\n`;\n\nexport const StyledGridTextContainer = styled('div')`\n display: grid;\n grid-template-columns: max-content auto;\n align-items: center;\n min-width: 0;\n max-width: 100%;\n overflow: hidden;\n &:focus {\n outline: none;\n }\n`;\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,YAAY;AACrB,SAAS,KAAK,cAAc;AAC5B,SAAS,oBAAoB;AAC7B,SAAS,uBAAuB,qBAAqB,4BAA4B;AAE1E,MAAM,mCAAmC,OAAO,OAAO;AAAA,EAC5D,MAAM;AAAA,EACN,MAAM,sBAAsB;AAC9B,CAAC;AAEM,MAAM,wBAAwB,OAAO,YAAY;AAAA,WAC7C,CAAC,UAAU,MAAM,MAAM,OAAO,QAAQ,KAAK,CAAC;AAAA,iBACtC,CAAC,UAAU,MAAM,MAAM,YAAY,QAAQ;AAAA;AAAA;AAAA,uBAGrC,CAAC,EAAE,MAAM,MAAM,MAAM,YAAY,KAAK;AAAA;AAAA;AAAA;AAKtD,MAAM,8BAA8B,OAAO,YAAY;AAAA,WACnD,CAAC,UAAU,MAAM,MAAM,OAAO,QAAQ,KAAK,CAAC;AAAA;AAAA;AAAA,uBAGhC,CAAC,EAAE,MAAM,MAAM,MAAM,YAAY,KAAK;AAAA;AAAA;AAAA;AAKtD,MAAM,0CAA0C,OAAO;AAAA;AAAA;AAIvD,MAAM,8BAA8B,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAO3C,MAAM,qCAAqC,OAAO,MAAM;AAAA,EAC7D,MAAM,sBAAsB;AAAA,EAC5B,MAAM;AACR,CAAC;AAAA,aACY,CAAC,UAAU,MAAM,MAAM,MAAM,EAAE;AAAA;AAMrC,MAAM,iCAAiC,OAAO,OAAO;AAAA,EAC1D,MAAM;AAAA,EACN,MAAM,sBAAsB;AAC9B,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAYG,CAAC,UAAW,MAAM,QAAQ,gBAAgB,EAAG;AAAA,uBAC1B,CAAC,UAAU,MAAM,MAAM,YAAY,KAAK;AAAA,aAClD,CAAC,UAAW,MAAM,QAAQ,gBAAgB,OAAQ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAW3C,CAAC,UAAU,MAAM,MAAM,MAAM,GAAG;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAShD,CAAC,UACD,MAAM,+BACF;AAAA,+BACuB,MAAM,MAAM,OAAO,MAAM,KAAK,CAAC;AAAA;AAAA,YAGtD,KAAK;AAAA;AAON,MAAM,2BAA2B,OAAO,OAAO;AAAA,EACpD,MAAM;AAAA,EACN,MAAM,sBAAsB;AAC9B,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,aAMY,CAAC,UAAU,MAAM,MAAM,MAAM,EAAE;AAAA;AAAA;AAAA;AAAA;AAAA,sBAKtB,CAAC,EAAE,MAAM,MAC1B,UAAU,oBAAoB,YAAY,aAC1C,UAAU,oBAAoB,aAAa,aAC3C,UAAU,oBAAoB,QAAQ,aACtC,UAAU,oBAAoB,cAAc,aAC7C,SAAS;AAAA;AAGN,MAAM,8BAA8B,OAAO,OAAO;AAAA,EACvD,MAAM;AAAA,EACN,MAAM,sBAAsB;AAC9B,CAAC;AAAA,eACc,CAAC,UAAU,MAAM,MAAM,MAAM,EAAE;AAAA;AAAA;AAAA;AAAA,SAIrC,CAAC,UAAU,MAAM,MAAM,MAAM,EAAE;AAAA;AAGjC,MAAM,6BAA6B,OAAO,KAAK;AAAA;AAAA;AAAA,cAGxC,CAAC,EAAE,MAAM,MAAM,MAAM,MAAM,CAAC;AAAA,aAC7B,CAAC,EAAE,MAAM,MAAM,MAAM,MAAM,CAAC;AAAA,YAC7B,CAAC,EAAE,MAAM,MAAM,MAAM,OAAO,QAAQ,GAAG,CAAC;AAAA;AAAA;AAI7C,MAAM,0BAA0B,OAAO,KAAK;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|