@elliemae/ds-card-navigation 3.55.0-next.7 → 3.55.0-next.8
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
|
@@ -34,51 +34,52 @@ __export(DSCardNavigation_exports, {
|
|
|
34
34
|
module.exports = __toCommonJS(DSCardNavigation_exports);
|
|
35
35
|
var React = __toESM(require("react"));
|
|
36
36
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
37
|
-
var import_ds_button_v2 = require("@elliemae/ds-button-v2");
|
|
38
|
-
var import_ds_icons = require("@elliemae/ds-icons");
|
|
39
37
|
var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
|
|
40
|
-
var import_react = require("react");
|
|
41
38
|
var import_useCardNavigation = require("./config/useCardNavigation.js");
|
|
42
39
|
var import_constants = require("./constants/index.js");
|
|
43
40
|
var import_react_desc_prop_types = require("./react-desc-prop-types.js");
|
|
44
|
-
var import_style = require("./style.js");
|
|
45
|
-
var
|
|
46
|
-
var
|
|
47
|
-
const mainIconColor = ["neutral", "0"];
|
|
41
|
+
var import_style = require("./parts/style.js");
|
|
42
|
+
var import_IconAndTextsRegion = require("./parts/text-region/IconAndTextsRegion.js");
|
|
43
|
+
var import_ActionsRegion = require("./parts/ActionsRegion.js");
|
|
48
44
|
const DSCardNavigation = (props) => {
|
|
49
|
-
const
|
|
50
|
-
const {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
45
|
+
const cardNavigationConfig = (0, import_useCardNavigation.useCardNavigation)(props);
|
|
46
|
+
const {
|
|
47
|
+
propsWithDefault,
|
|
48
|
+
xstyledProps,
|
|
49
|
+
globalProps,
|
|
50
|
+
iconAndTextsRegionIsFocused,
|
|
51
|
+
showFocusRingAroundAll,
|
|
52
|
+
hideFocusRingAroundAll,
|
|
53
|
+
instanceUid
|
|
54
|
+
} = cardNavigationConfig;
|
|
55
|
+
const { containerProps, title, description, type, Icon, actions, wrapText } = propsWithDefault;
|
|
56
|
+
const { getOwnerProps, getOwnerPropsArguments } = (0, import_ds_props_helpers.useOwnerProps)(propsWithDefault);
|
|
57
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
58
|
+
import_style.StyledCardNavigationBoxWrapper,
|
|
59
|
+
{
|
|
60
|
+
...globalProps,
|
|
61
|
+
...xstyledProps,
|
|
62
|
+
...containerProps,
|
|
63
|
+
getOwnerProps,
|
|
64
|
+
getOwnerPropsArguments,
|
|
65
|
+
$isIconAndTextsRegionFocused: iconAndTextsRegionIsFocused,
|
|
66
|
+
children: [
|
|
67
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
68
|
+
import_IconAndTextsRegion.IconAndTextsRegion,
|
|
69
|
+
{
|
|
70
|
+
title,
|
|
71
|
+
description,
|
|
72
|
+
wrapText,
|
|
73
|
+
type,
|
|
74
|
+
Icon,
|
|
75
|
+
showFocusRingAroundAll,
|
|
76
|
+
hideFocusRingAroundAll
|
|
77
|
+
}
|
|
78
|
+
),
|
|
79
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ActionsRegion.ActionsRegion, { actions, instanceUid })
|
|
80
|
+
]
|
|
81
|
+
}
|
|
82
|
+
);
|
|
82
83
|
};
|
|
83
84
|
DSCardNavigation.displayName = import_constants.DSCardNavigationName;
|
|
84
85
|
const DSCardNavigationWithSchema = (0, import_ds_props_helpers.describe)(DSCardNavigation);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/DSCardNavigation.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import {
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;
|
|
4
|
+
"sourcesContent": ["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", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADyBnB;AAzBJ,8BAAwC;AAExC,+BAAkC;AAClC,uBAAqC;AACrC,mCAAwE;AACxE,mBAA+C;AAC/C,gCAAmC;AACnC,2BAA8B;AAE9B,MAAM,mBAAiE,CAAC,UAAU;AAChF,QAAM,2BAAuB,4CAAkB,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,QAAI,uCAAuC,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,4CAAC,sCAAc,SAAkB,aAA0B;AAAA;AAAA;AAAA,EAC7D;AAEJ;AAEA,iBAAiB,cAAc;AAC/B,MAAM,iCAA6B,kCAAS,gBAAgB;AAC5D,2BAA2B,YAAY;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -40,20 +40,35 @@ var import_useValidateProps = require("./useValidateProps.js");
|
|
|
40
40
|
const useCardNavigation = (propsFromUser) => {
|
|
41
41
|
const propsWithDefault = (0, import_ds_props_helpers.useMemoMergePropsWithDefault)(propsFromUser, import_react_desc_prop_types.defaultProps);
|
|
42
42
|
(0, import_useValidateProps.useValidateProps)(propsWithDefault, import_react_desc_prop_types.DSCardNavigationPropTypes);
|
|
43
|
+
const { title, ...globalPropsWithoutReusedReservedKeywords } = propsWithDefault;
|
|
44
|
+
const globalProps = (0, import_ds_props_helpers.useGetGlobalAttributes)(globalPropsWithoutReusedReservedKeywords);
|
|
43
45
|
const xstyledProps = (0, import_ds_props_helpers.useGetXstyledProps)(propsWithDefault);
|
|
44
46
|
const instanceUid = import_react.default.useMemo(() => `ds-card-navigation-${(0, import_uid.uid)(5)}`, []);
|
|
47
|
+
const [iconAndTextsRegionIsFocused, setIconAndTextsRegionIsFocused] = import_react.default.useState(false);
|
|
48
|
+
const showFocusRingAroundAll = import_react.default.useCallback(() => {
|
|
49
|
+
setIconAndTextsRegionIsFocused(true);
|
|
50
|
+
}, []);
|
|
51
|
+
const hideFocusRingAroundAll = import_react.default.useCallback(() => {
|
|
52
|
+
setIconAndTextsRegionIsFocused(false);
|
|
53
|
+
}, []);
|
|
45
54
|
return import_react.default.useMemo(
|
|
46
55
|
() => ({
|
|
47
56
|
propsWithDefault,
|
|
48
57
|
xstyledProps,
|
|
49
|
-
|
|
50
|
-
|
|
58
|
+
globalProps,
|
|
59
|
+
instanceUid,
|
|
60
|
+
iconAndTextsRegionIsFocused,
|
|
61
|
+
showFocusRingAroundAll,
|
|
62
|
+
hideFocusRingAroundAll
|
|
51
63
|
}),
|
|
52
64
|
[
|
|
53
65
|
propsWithDefault,
|
|
54
66
|
xstyledProps,
|
|
55
|
-
|
|
56
|
-
|
|
67
|
+
globalProps,
|
|
68
|
+
instanceUid,
|
|
69
|
+
iconAndTextsRegionIsFocused,
|
|
70
|
+
showFocusRingAroundAll,
|
|
71
|
+
hideFocusRingAroundAll
|
|
57
72
|
]
|
|
58
73
|
);
|
|
59
74
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/config/useCardNavigation.ts", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["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;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAkB;AAClB,
|
|
4
|
+
"sourcesContent": ["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", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAkB;AAClB,8BAAyF;AACzF,iBAAoB;AACpB,mCAAgF;AAChF,8BAAiC;AAY1B,MAAM,oBAAoB,CAAC,kBAA8D;AAI9F,QAAM,uBAAmB,sDAA8D,eAAe,yCAAY;AAClH,gDAAiB,kBAAkB,sDAAyB;AAM5D,QAAM,EAAE,OAAO,GAAG,yCAAyC,IAAI;AAC/D,QAAM,kBAAc,gDAAuB,wCAAwC;AACnF,QAAM,mBAAe,4CAAmB,gBAAgB;AAIxD,QAAM,cAAc,aAAAA,QAAM,QAAQ,MAAM,0BAAsB,gBAAI,CAAC,CAAC,IAAI,CAAC,CAAC;AAC1E,QAAM,CAAC,6BAA6B,8BAA8B,IAAI,aAAAA,QAAM,SAAS,KAAK;AAC1F,QAAM,yBAAyB,aAAAA,QAAM,YAAqD,MAAM;AAC9F,mCAA+B,IAAI;AAAA,EACrC,GAAG,CAAC,CAAC;AACL,QAAM,yBAAyB,aAAAA,QAAM,YAAqD,MAAM;AAC9F,mCAA+B,KAAK;AAAA,EACtC,GAAG,CAAC,CAAC;AAEL,SAAO,aAAAA,QAAM;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,63 @@
|
|
|
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 ActionsRegion_exports = {};
|
|
30
|
+
__export(ActionsRegion_exports, {
|
|
31
|
+
ActionsRegion: () => ActionsRegion
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(ActionsRegion_exports);
|
|
34
|
+
var React = __toESM(require("react"));
|
|
35
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
36
|
+
var import_ds_button_v2 = require("@elliemae/ds-button-v2");
|
|
37
|
+
var import_ds_icons = require("@elliemae/ds-icons");
|
|
38
|
+
var import_style = require("./style.js");
|
|
39
|
+
const ActionsRegion = ({ actions, instanceUid }) => {
|
|
40
|
+
if (actions.length === 0) return null;
|
|
41
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_style.StyledCardNavigationActions, { children: actions.map(({ icon, Icon, onClick, ...unexpectedButPreviouslySupportedOtherProps }, index) => {
|
|
42
|
+
const defaultIconJSX = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ds_icons.MoreOptionsVert, { "aria-label": "More options" });
|
|
43
|
+
const iconJSX = icon ?? defaultIconJSX;
|
|
44
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
45
|
+
import_style.StyledCardNavigationAction,
|
|
46
|
+
{
|
|
47
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
48
|
+
import_ds_button_v2.DSButtonV3,
|
|
49
|
+
{
|
|
50
|
+
onClick,
|
|
51
|
+
"aria-label": "More options",
|
|
52
|
+
...unexpectedButPreviouslySupportedOtherProps,
|
|
53
|
+
buttonType: import_ds_button_v2.BUTTON_TYPES.ICON,
|
|
54
|
+
size: import_ds_button_v2.BUTTON_SIZES.L,
|
|
55
|
+
children: Icon ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Icon, {}) : iconJSX
|
|
56
|
+
}
|
|
57
|
+
)
|
|
58
|
+
},
|
|
59
|
+
`${instanceUid}-${index}`
|
|
60
|
+
);
|
|
61
|
+
}) });
|
|
62
|
+
};
|
|
63
|
+
//# sourceMappingURL=ActionsRegion.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/parts/ActionsRegion.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["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", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADgBQ;AAhB/B,0BAAuD;AACvD,sBAAgC;AAGhC,mBAAwE;AAOjE,MAAM,gBAAwD,CAAC,EAAE,SAAS,YAAY,MAAM;AACjG,MAAI,QAAQ,WAAW,EAAG,QAAO;AACjC,SACE,4CAAC,4CACE,kBAAQ,IAAI,CAAC,EAAE,MAAM,MAAM,SAAS,GAAG,2CAA2C,GAAG,UAAU;AAC9F,UAAM,iBAAiB,4CAAC,mCAAgB,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,iCAAa;AAAA,YACzB,MAAM,iCAAa;AAAA,YAElB,iBAAO,4CAAC,QAAK,IAAK;AAAA;AAAA,QACrB;AAAA;AAAA,MAVK,GAAG,WAAW,IAAI,KAAK;AAAA,IAW9B;AAAA,EAEJ,CAAC,GACH;AAEJ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -33,41 +33,44 @@ __export(style_exports, {
|
|
|
33
33
|
StyledCardNavigationBoxWrapper: () => StyledCardNavigationBoxWrapper,
|
|
34
34
|
StyledCardNavigationCentralContent: () => StyledCardNavigationCentralContent,
|
|
35
35
|
StyledCardNavigationContent: () => StyledCardNavigationContent,
|
|
36
|
-
StyledCardNavigationContentDescription: () => StyledCardNavigationContentDescription,
|
|
37
36
|
StyledCardNavigationContentTitle: () => StyledCardNavigationContentTitle,
|
|
38
37
|
StyledCardNavigationContentTitleWrapper: () => StyledCardNavigationContentTitleWrapper,
|
|
39
38
|
StyledCardNavigationIcon: () => StyledCardNavigationIcon,
|
|
40
39
|
StyledDescriptionTypography: () => StyledDescriptionTypography,
|
|
40
|
+
StyledGridTextContainer: () => StyledGridTextContainer,
|
|
41
41
|
StyledTitleTypography: () => StyledTitleTypography
|
|
42
42
|
});
|
|
43
43
|
module.exports = __toCommonJS(style_exports);
|
|
44
44
|
var React = __toESM(require("react"));
|
|
45
|
-
var import_ds_typography = require("@elliemae/ds-typography");
|
|
46
|
-
var import_ds_system = require("@elliemae/ds-system");
|
|
47
45
|
var import_ds_grid = require("@elliemae/ds-grid");
|
|
48
|
-
var
|
|
46
|
+
var import_ds_system = require("@elliemae/ds-system");
|
|
47
|
+
var import_ds_typography = require("@elliemae/ds-typography");
|
|
48
|
+
var import_constants = require("../constants/index.js");
|
|
49
49
|
const StyledCardNavigationContentTitle = (0, import_ds_system.styled)("div", {
|
|
50
50
|
name: import_constants.DSCardNavigationName,
|
|
51
51
|
slot: import_constants.CARD_NAVIGATION_SLOTS.TITLE
|
|
52
|
-
})
|
|
53
|
-
padding-top: ${(props) => props.theme.space.xxs};
|
|
54
|
-
`;
|
|
52
|
+
})``;
|
|
55
53
|
const StyledTitleTypography = (0, import_ds_system.styled)(import_ds_typography.DSTypography)`
|
|
56
54
|
color: ${(props) => props.theme.colors.neutral["700"]};
|
|
57
55
|
font-weight: ${(props) => props.theme.fontWeights.semibold};
|
|
58
|
-
font-size: 18px
|
|
56
|
+
font-size: 1.3846rem; // 18px -> 18/13 = 1.3846rem
|
|
57
|
+
|
|
58
|
+
@media (max-width: ${({ theme }) => theme.breakpoints.small}) {
|
|
59
|
+
font-size: 1.125rem; // 18px -> 18/16 = 1.125rem
|
|
60
|
+
}
|
|
59
61
|
`;
|
|
60
|
-
const StyledCardNavigationContentDescription = import_ds_system.styled.div``;
|
|
61
62
|
const StyledDescriptionTypography = (0, import_ds_system.styled)(import_ds_typography.DSTypography)`
|
|
62
63
|
color: ${(props) => props.theme.colors.neutral["500"]};
|
|
63
|
-
font-size: 12px
|
|
64
|
+
font-size: 0.923rem; // 12px -> 12/13 = 0.923rem
|
|
65
|
+
|
|
66
|
+
@media (max-width: ${({ theme }) => theme.breakpoints.small}) {
|
|
67
|
+
font-size: 0.8775rem; // 12px -> 10.5/12 = 0.8775rem
|
|
68
|
+
}
|
|
64
69
|
`;
|
|
65
70
|
const StyledCardNavigationContentTitleWrapper = import_ds_system.styled.div`
|
|
66
71
|
width: 100%;
|
|
67
72
|
`;
|
|
68
73
|
const StyledCardNavigationContent = import_ds_system.styled.div`
|
|
69
|
-
padding-right: ${(props) => props.theme.space.xs};
|
|
70
|
-
padding-left: ${(props) => props.theme.space.xs};
|
|
71
74
|
display: flex;
|
|
72
75
|
align-items: center;
|
|
73
76
|
flex: 1;
|
|
@@ -77,15 +80,14 @@ const StyledCardNavigationCentralContent = (0, import_ds_system.styled)(import_d
|
|
|
77
80
|
slot: import_constants.CARD_NAVIGATION_SLOTS.CENTRAL_CONTENT,
|
|
78
81
|
name: import_constants.DSCardNavigationName
|
|
79
82
|
})`
|
|
80
|
-
|
|
81
|
-
@media (max-width: ${(props) => props.theme.breakpoints.small}) {
|
|
82
|
-
min-width: 336px;
|
|
83
|
-
}
|
|
83
|
+
padding: ${(props) => props.theme.space.xs};
|
|
84
84
|
`;
|
|
85
85
|
const StyledCardNavigationBoxWrapper = (0, import_ds_system.styled)("div", {
|
|
86
86
|
name: import_constants.DSCardNavigationName,
|
|
87
87
|
slot: import_constants.CARD_NAVIGATION_SLOTS.ROOT
|
|
88
88
|
})`
|
|
89
|
+
min-width: 240px;
|
|
90
|
+
min-height: 64px;
|
|
89
91
|
width: 337px;
|
|
90
92
|
display: flex;
|
|
91
93
|
flex-direction: row;
|
|
@@ -94,10 +96,12 @@ const StyledCardNavigationBoxWrapper = (0, import_ds_system.styled)("div", {
|
|
|
94
96
|
border-radius: 2px;
|
|
95
97
|
position: relative;
|
|
96
98
|
outline: none;
|
|
99
|
+
|
|
97
100
|
${(props) => props.fluid ? "width: 100%" : ""};
|
|
98
101
|
@media (max-width: ${(props) => props.theme.breakpoints.small}) {
|
|
99
102
|
width: ${(props) => props.fluid ? "width: 100%" : "414px"};
|
|
100
103
|
}
|
|
104
|
+
|
|
101
105
|
:after {
|
|
102
106
|
display: block;
|
|
103
107
|
content: '';
|
|
@@ -110,46 +114,59 @@ const StyledCardNavigationBoxWrapper = (0, import_ds_system.styled)("div", {
|
|
|
110
114
|
border-radius: 2px;
|
|
111
115
|
pointer-events: none;
|
|
112
116
|
}
|
|
113
|
-
&:hover
|
|
114
|
-
&:focus {
|
|
117
|
+
&:hover {
|
|
115
118
|
box-shadow: 0 3px 8px 0px rgba(37, 41, 47, 0.4);
|
|
119
|
+
outline-offset: 2px;
|
|
116
120
|
}
|
|
121
|
+
|
|
122
|
+
${(props) => props.$isIconAndTextsRegionFocused ? import_ds_system.css`
|
|
123
|
+
outline: 2px solid ${props.theme.colors.brand["700"]};
|
|
124
|
+
outline-offset: 2px;
|
|
125
|
+
` : import_ds_system.css``}
|
|
117
126
|
`;
|
|
118
127
|
const StyledCardNavigationIcon = (0, import_ds_system.styled)("div", {
|
|
119
128
|
name: import_constants.DSCardNavigationName,
|
|
120
129
|
slot: import_constants.CARD_NAVIGATION_SLOTS.TYPE
|
|
121
130
|
})`
|
|
122
|
-
width: 64px;
|
|
123
|
-
height: 64px;
|
|
124
|
-
|
|
131
|
+
min-width: 64px;
|
|
132
|
+
min-height: 64px;
|
|
133
|
+
height: 100%;
|
|
125
134
|
border-top-left-radius: 2px;
|
|
126
135
|
border-bottom-left-radius: 2px;
|
|
127
|
-
padding: ${(props) => props.theme.space.
|
|
136
|
+
padding: ${(props) => props.theme.space.xs};
|
|
128
137
|
display: flex;
|
|
129
138
|
align-items: center;
|
|
130
139
|
justify-content: center;
|
|
131
140
|
fill: #ffffff;
|
|
132
|
-
background-color: ${({ $type }) => $type === import_constants.CardNavigationTypes.BORROWER && "#32aad1" || $type === import_constants.CardNavigationTypes.FINANCIAL && "#1ba88d" || $type === import_constants.CardNavigationTypes.LOAN && "#8e49b2" || $type === import_constants.CardNavigationTypes.REGULATORY && "#db5575" || "#32aad1"};
|
|
141
|
+
background-color: ${({ $type }) => $type === import_constants.CardNavigationTypes.BORROWER && "#32aad1" || $type === import_constants.CardNavigationTypes.FINANCIAL && "#1ba88d" || $type === import_constants.CardNavigationTypes.LOAN && "#8e49b2" || $type === import_constants.CardNavigationTypes.REGULATORY && "#db5575" || "#32aad1"};
|
|
133
142
|
`;
|
|
134
143
|
const StyledCardNavigationActions = (0, import_ds_system.styled)("div", {
|
|
135
144
|
name: import_constants.DSCardNavigationName,
|
|
136
145
|
slot: import_constants.CARD_NAVIGATION_SLOTS.ACTIONS
|
|
137
146
|
})`
|
|
147
|
+
padding: 0 ${(props) => props.theme.space.xs};
|
|
138
148
|
display: flex;
|
|
139
149
|
flex-direction: row;
|
|
140
150
|
align-items: center;
|
|
141
|
-
|
|
151
|
+
gap: ${(props) => props.theme.space.xs};
|
|
142
152
|
`;
|
|
143
|
-
const StyledCardNavigationAction = import_ds_system.styled
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
height: ${(
|
|
147
|
-
width: ${(
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
+
const StyledCardNavigationAction = (0, import_ds_system.styled)("div")`
|
|
154
|
+
span,
|
|
155
|
+
svg {
|
|
156
|
+
height: ${({ theme }) => theme.space.s};
|
|
157
|
+
width: ${({ theme }) => theme.space.s};
|
|
158
|
+
fill: ${({ theme }) => theme.colors.neutral[500]};
|
|
159
|
+
}
|
|
160
|
+
`;
|
|
161
|
+
const StyledGridTextContainer = (0, import_ds_system.styled)("div")`
|
|
162
|
+
display: grid;
|
|
163
|
+
grid-template-columns: max-content auto;
|
|
164
|
+
align-items: center;
|
|
165
|
+
min-width: 0;
|
|
166
|
+
max-width: 100%;
|
|
167
|
+
overflow: hidden;
|
|
168
|
+
&:focus {
|
|
169
|
+
outline: none;
|
|
153
170
|
}
|
|
154
171
|
`;
|
|
155
172
|
//# sourceMappingURL=style.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/parts/style.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["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", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": "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",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,101 @@
|
|
|
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 IconAndTextsRegion_exports = {};
|
|
30
|
+
__export(IconAndTextsRegion_exports, {
|
|
31
|
+
IconAndTextsRegion: () => IconAndTextsRegion
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(IconAndTextsRegion_exports);
|
|
34
|
+
var React = __toESM(require("react"));
|
|
35
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
36
|
+
var import_ds_grid = require("@elliemae/ds-grid");
|
|
37
|
+
var import_ds_hooks_on_overflow_change = require("@elliemae/ds-hooks-on-overflow-change");
|
|
38
|
+
var import_ds_tooltip_v3 = require("@elliemae/ds-tooltip-v3");
|
|
39
|
+
var import_ds_typography = require("@elliemae/ds-typography");
|
|
40
|
+
var import_react = __toESM(require("react"));
|
|
41
|
+
var import_IconAndTextsRegionContent = require("./IconAndTextsRegionContent.js");
|
|
42
|
+
const TooltipText = ({ title, description }) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_ds_grid.Grid, { children: [
|
|
43
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ds_typography.DSTypography, { variant: import_ds_typography.TYPOGRAPHY_VARIANTS.H5_ARTICLE, children: title }),
|
|
44
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ds_typography.DSTypography, { variant: import_ds_typography.TYPOGRAPHY_VARIANTS.B1, children: description })
|
|
45
|
+
] });
|
|
46
|
+
const IconAndTextsRegion = ({
|
|
47
|
+
title,
|
|
48
|
+
description,
|
|
49
|
+
wrapText,
|
|
50
|
+
type,
|
|
51
|
+
Icon,
|
|
52
|
+
showFocusRingAroundAll,
|
|
53
|
+
hideFocusRingAroundAll
|
|
54
|
+
}) => {
|
|
55
|
+
const [isTitleTruncating, setIsTitleTruncating] = import_react.default.useState(false);
|
|
56
|
+
const [isDescriptionTruncating, setIsDescriptionTruncating] = import_react.default.useState(false);
|
|
57
|
+
const AnyOverFlow = isTitleTruncating || isDescriptionTruncating;
|
|
58
|
+
const { handleRef: titleHandleRef } = (0, import_ds_hooks_on_overflow_change.useOnOverflowChange)({
|
|
59
|
+
onOverflowStateChange: setIsTitleTruncating
|
|
60
|
+
});
|
|
61
|
+
const { handleRef: descriptionHandleRef } = (0, import_ds_hooks_on_overflow_change.useOnOverflowChange)({
|
|
62
|
+
onOverflowStateChange: setIsDescriptionTruncating
|
|
63
|
+
});
|
|
64
|
+
const TooltipTextProps = import_react.default.useMemo(
|
|
65
|
+
() => ({
|
|
66
|
+
title,
|
|
67
|
+
description
|
|
68
|
+
}),
|
|
69
|
+
[title, description]
|
|
70
|
+
);
|
|
71
|
+
if (AnyOverFlow)
|
|
72
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ds_tooltip_v3.DSTooltipV3, { Text: TooltipText, textProps: TooltipTextProps, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
73
|
+
import_IconAndTextsRegionContent.IconAndTextsRegionContent,
|
|
74
|
+
{
|
|
75
|
+
title,
|
|
76
|
+
description,
|
|
77
|
+
wrapText,
|
|
78
|
+
type,
|
|
79
|
+
Icon,
|
|
80
|
+
titleHandleRef,
|
|
81
|
+
descriptionHandleRef,
|
|
82
|
+
showFocusRingAroundAll,
|
|
83
|
+
hideFocusRingAroundAll
|
|
84
|
+
}
|
|
85
|
+
) });
|
|
86
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
87
|
+
import_IconAndTextsRegionContent.IconAndTextsRegionContent,
|
|
88
|
+
{
|
|
89
|
+
title,
|
|
90
|
+
description,
|
|
91
|
+
wrapText,
|
|
92
|
+
type,
|
|
93
|
+
Icon,
|
|
94
|
+
titleHandleRef,
|
|
95
|
+
descriptionHandleRef,
|
|
96
|
+
showFocusRingAroundAll,
|
|
97
|
+
hideFocusRingAroundAll
|
|
98
|
+
}
|
|
99
|
+
);
|
|
100
|
+
};
|
|
101
|
+
//# sourceMappingURL=IconAndTextsRegion.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/parts/text-region/IconAndTextsRegion.tsx", "../../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["import { Grid } from '@elliemae/ds-grid';\nimport { useOnOverflowChange } from '@elliemae/ds-hooks-on-overflow-change';\nimport type { DSTooltipV3T } from '@elliemae/ds-tooltip-v3';\nimport { DSTooltipV3 } from '@elliemae/ds-tooltip-v3';\nimport { DSTypography, TYPOGRAPHY_VARIANTS } from '@elliemae/ds-typography';\nimport React from 'react';\nimport type { DSCardNavigationT } from '../../react-desc-prop-types.js';\nimport { IconAndTextsRegionContent } from './IconAndTextsRegionContent.js';\n\ntype TooltipTextProps = DSTooltipV3T.CustomInterface<{\n title: string;\n description: string;\n}>;\n\nconst TooltipText: React.ComponentType<TooltipTextProps> = ({ title, description }) => (\n <Grid>\n <DSTypography variant={TYPOGRAPHY_VARIANTS.H5_ARTICLE}>{title}</DSTypography>\n <DSTypography variant={TYPOGRAPHY_VARIANTS.B1}>{description}</DSTypography>\n </Grid>\n);\n\ninterface IconAndTextsRegionProps {\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 showFocusRingAroundAll: React.FocusEventHandler<HTMLDivElement>;\n hideFocusRingAroundAll: React.FocusEventHandler<HTMLDivElement>;\n}\n\nexport const IconAndTextsRegion: React.ComponentType<IconAndTextsRegionProps> = ({\n title,\n description,\n wrapText,\n type,\n Icon,\n showFocusRingAroundAll,\n hideFocusRingAroundAll,\n}) => {\n const [isTitleTruncating, setIsTitleTruncating] = React.useState(false);\n const [isDescriptionTruncating, setIsDescriptionTruncating] = React.useState(false);\n\n const AnyOverFlow = isTitleTruncating || isDescriptionTruncating;\n\n const { handleRef: titleHandleRef } = useOnOverflowChange({\n onOverflowStateChange: setIsTitleTruncating,\n });\n\n const { handleRef: descriptionHandleRef } = useOnOverflowChange({\n onOverflowStateChange: setIsDescriptionTruncating,\n });\n const TooltipTextProps = React.useMemo(\n () => ({\n title,\n description,\n }),\n [title, description],\n );\n\n if (AnyOverFlow)\n return (\n <DSTooltipV3<TooltipTextProps> Text={TooltipText} textProps={TooltipTextProps}>\n <IconAndTextsRegionContent\n title={title}\n description={description}\n wrapText={wrapText}\n type={type}\n Icon={Icon}\n titleHandleRef={titleHandleRef}\n descriptionHandleRef={descriptionHandleRef}\n showFocusRingAroundAll={showFocusRingAroundAll}\n hideFocusRingAroundAll={hideFocusRingAroundAll}\n />\n </DSTooltipV3>\n );\n return (\n <IconAndTextsRegionContent\n title={title}\n description={description}\n wrapText={wrapText}\n type={type}\n Icon={Icon}\n titleHandleRef={titleHandleRef}\n descriptionHandleRef={descriptionHandleRef}\n showFocusRingAroundAll={showFocusRingAroundAll}\n hideFocusRingAroundAll={hideFocusRingAroundAll}\n />\n );\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADerB;AAfF,qBAAqB;AACrB,yCAAoC;AAEpC,2BAA4B;AAC5B,2BAAkD;AAClD,mBAAkB;AAElB,uCAA0C;AAO1C,MAAM,cAAqD,CAAC,EAAE,OAAO,YAAY,MAC/E,6CAAC,uBACC;AAAA,8CAAC,qCAAa,SAAS,yCAAoB,YAAa,iBAAM;AAAA,EAC9D,4CAAC,qCAAa,SAAS,yCAAoB,IAAK,uBAAY;AAAA,GAC9D;AAaK,MAAM,qBAAmE,CAAC;AAAA,EAC/E;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAAM;AACJ,QAAM,CAAC,mBAAmB,oBAAoB,IAAI,aAAAA,QAAM,SAAS,KAAK;AACtE,QAAM,CAAC,yBAAyB,0BAA0B,IAAI,aAAAA,QAAM,SAAS,KAAK;AAElF,QAAM,cAAc,qBAAqB;AAEzC,QAAM,EAAE,WAAW,eAAe,QAAI,wDAAoB;AAAA,IACxD,uBAAuB;AAAA,EACzB,CAAC;AAED,QAAM,EAAE,WAAW,qBAAqB,QAAI,wDAAoB;AAAA,IAC9D,uBAAuB;AAAA,EACzB,CAAC;AACD,QAAM,mBAAmB,aAAAA,QAAM;AAAA,IAC7B,OAAO;AAAA,MACL;AAAA,MACA;AAAA,IACF;AAAA,IACA,CAAC,OAAO,WAAW;AAAA,EACrB;AAEA,MAAI;AACF,WACE,4CAAC,oCAA8B,MAAM,aAAa,WAAW,kBAC3D;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA;AAAA,IACF,GACF;AAEJ,SACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA;AAAA,EACF;AAEJ;",
|
|
6
|
+
"names": ["React"]
|
|
7
|
+
}
|