@elliemae/ds-panel-header 3.80.0-next.22

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.
Files changed (37) hide show
  1. package/dist/cjs/DSPanelHeader.js +91 -0
  2. package/dist/cjs/DSPanelHeader.js.map +7 -0
  3. package/dist/cjs/config/usePanelHeader.js +63 -0
  4. package/dist/cjs/config/usePanelHeader.js.map +7 -0
  5. package/dist/cjs/config/useValidateProps.js +40 -0
  6. package/dist/cjs/config/useValidateProps.js.map +7 -0
  7. package/dist/cjs/constants/index.js +45 -0
  8. package/dist/cjs/constants/index.js.map +7 -0
  9. package/dist/cjs/index.js +40 -0
  10. package/dist/cjs/index.js.map +7 -0
  11. package/dist/cjs/package.json +7 -0
  12. package/dist/cjs/react-desc-prop-types.js +50 -0
  13. package/dist/cjs/react-desc-prop-types.js.map +7 -0
  14. package/dist/cjs/typescript-testing/DSPanelHeaderNamespace.js +113 -0
  15. package/dist/cjs/typescript-testing/DSPanelHeaderNamespace.js.map +7 -0
  16. package/dist/esm/DSPanelHeader.js +61 -0
  17. package/dist/esm/DSPanelHeader.js.map +7 -0
  18. package/dist/esm/config/usePanelHeader.js +33 -0
  19. package/dist/esm/config/usePanelHeader.js.map +7 -0
  20. package/dist/esm/config/useValidateProps.js +10 -0
  21. package/dist/esm/config/useValidateProps.js.map +7 -0
  22. package/dist/esm/constants/index.js +15 -0
  23. package/dist/esm/constants/index.js.map +7 -0
  24. package/dist/esm/index.js +10 -0
  25. package/dist/esm/index.js.map +7 -0
  26. package/dist/esm/package.json +7 -0
  27. package/dist/esm/react-desc-prop-types.js +25 -0
  28. package/dist/esm/react-desc-prop-types.js.map +7 -0
  29. package/dist/esm/typescript-testing/DSPanelHeaderNamespace.js +90 -0
  30. package/dist/esm/typescript-testing/DSPanelHeaderNamespace.js.map +7 -0
  31. package/dist/types/DSPanelHeader.d.ts +5 -0
  32. package/dist/types/config/usePanelHeader.d.ts +379 -0
  33. package/dist/types/config/useValidateProps.d.ts +3 -0
  34. package/dist/types/constants/index.d.ts +11 -0
  35. package/dist/types/index.d.ts +3 -0
  36. package/dist/types/react-desc-prop-types.d.ts +23 -0
  37. package/package.json +73 -0
@@ -0,0 +1,91 @@
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 DSPanelHeader_exports = {};
30
+ __export(DSPanelHeader_exports, {
31
+ DSPanelHeader: () => DSPanelHeader,
32
+ DSPanelHeaderWithSchema: () => DSPanelHeaderWithSchema
33
+ });
34
+ module.exports = __toCommonJS(DSPanelHeader_exports);
35
+ var React = __toESM(require("react"));
36
+ var import_jsx_runtime = require("react/jsx-runtime");
37
+ var import_react = __toESM(require("react"));
38
+ var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
39
+ var import_ds_system = require("@elliemae/ds-system");
40
+ var import_ds_grid = require("@elliemae/ds-grid");
41
+ var import_react_desc_prop_types = require("./react-desc-prop-types.js");
42
+ var import_usePanelHeader = require("./config/usePanelHeader.js");
43
+ var import_constants = require("./constants/index.js");
44
+ const StyledWrapper = (0, import_ds_system.styled)(import_ds_grid.Grid, { name: import_constants.DSPanelHeaderName, slot: import_constants.PANEL_HEADER_SLOTS.ROOT })`
45
+ background-color: ${(props) => props.theme.colors.brand[100]};
46
+ padding-top: ${(props) => props.theme.space.xxs2};
47
+ padding-bottom: ${(props) => props.theme.space.xxs2};
48
+ padding-left: ${(props) => props.theme.space.xs};
49
+ padding-right: ${(props) => props.theme.space.xxs};
50
+ col-gap: ${(props) => props.theme.space.xs};
51
+ row-gap: ${(props) => props.theme.space.xxs};
52
+ min-height: 46px;
53
+ min-width: 312px;
54
+ `;
55
+ const StyledLeftRegion = (0, import_ds_system.styled)(import_ds_grid.Grid, { name: import_constants.DSPanelHeaderName, slot: import_constants.PANEL_HEADER_SLOTS.LEFT_REGION })`
56
+ min-width: 0;
57
+ `;
58
+ const StyledRightRegion = (0, import_ds_system.styled)(import_ds_grid.Grid, { name: import_constants.DSPanelHeaderName, slot: import_constants.PANEL_HEADER_SLOTS.RIGHT_REGION })`
59
+ min-width: 0;
60
+ `;
61
+ const NARROW_LAYOUT_MODES = ["s", "xs"];
62
+ const DSPanelHeader = (props) => {
63
+ const { propsWithDefault, xstyledProps } = (0, import_usePanelHeader.usePanelHeader)(props);
64
+ const { LeftRegion, RightRegion } = propsWithDefault;
65
+ const layoutMode = (0, import_ds_system.useGetLayoutMode)();
66
+ const mainContentCols = import_react.default.useMemo(
67
+ () => layoutMode && NARROW_LAYOUT_MODES.includes(layoutMode) ? ["1fr"] : ["1fr", "auto"],
68
+ [layoutMode]
69
+ );
70
+ const getOwnerProps = () => propsWithDefault;
71
+ const getOwnerPropsArguments = () => ({});
72
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
73
+ StyledWrapper,
74
+ {
75
+ className: propsWithDefault.className,
76
+ cols: mainContentCols,
77
+ alignItems: "center",
78
+ getOwnerProps,
79
+ getOwnerPropsArguments,
80
+ ...xstyledProps,
81
+ children: [
82
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(StyledLeftRegion, { getOwnerProps, getOwnerPropsArguments, children: LeftRegion && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(LeftRegion, {}) }),
83
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(StyledRightRegion, { getOwnerProps, getOwnerPropsArguments, children: RightRegion && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(RightRegion, {}) })
84
+ ]
85
+ }
86
+ );
87
+ };
88
+ DSPanelHeader.displayName = import_constants.DSPanelHeaderName;
89
+ const DSPanelHeaderWithSchema = (0, import_ds_props_helpers.describe)(DSPanelHeader);
90
+ DSPanelHeaderWithSchema.propTypes = import_react_desc_prop_types.DSPanelHeaderPropTypesSchema;
91
+ //# sourceMappingURL=DSPanelHeader.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/DSPanelHeader.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
4
+ "sourcesContent": ["import React from 'react';\nimport { describe } from '@elliemae/ds-props-helpers';\nimport { styled, useGetLayoutMode } from '@elliemae/ds-system';\nimport { Grid } from '@elliemae/ds-grid';\nimport { type DSPanelHeaderT, DSPanelHeaderPropTypesSchema } from './react-desc-prop-types.js';\nimport { usePanelHeader } from './config/usePanelHeader.js';\nimport { PANEL_HEADER_SLOTS, DSPanelHeaderName } from './constants/index.js';\n\nconst StyledWrapper = styled(Grid, { name: DSPanelHeaderName, slot: PANEL_HEADER_SLOTS.ROOT })`\n background-color: ${(props) => props.theme.colors.brand[100]};\n padding-top: ${(props) => props.theme.space.xxs2};\n padding-bottom: ${(props) => props.theme.space.xxs2};\n padding-left: ${(props) => props.theme.space.xs};\n padding-right: ${(props) => props.theme.space.xxs};\n col-gap: ${(props) => props.theme.space.xs};\n row-gap: ${(props) => props.theme.space.xxs};\n min-height: 46px;\n min-width: 312px;\n`;\n// Grid items default to `min-width: auto`, which sizes to the content's intrinsic (unwrapped) width and\n// blows out the grid instead of letting text wrap \u2014 `min-width: 0` is what actually allows a consumer's\n// title/subtitle typography inside this region to wrap onto additional lines instead of overflowing.\nconst StyledLeftRegion = styled(Grid, { name: DSPanelHeaderName, slot: PANEL_HEADER_SLOTS.LEFT_REGION })`\n min-width: 0;\n`;\nconst StyledRightRegion = styled(Grid, { name: DSPanelHeaderName, slot: PANEL_HEADER_SLOTS.RIGHT_REGION })`\n min-width: 0;\n`;\n// Narrow layout modes stack RightRegion below LeftRegion (single column, two rows) instead of side-by-side.\n// `layoutMode` comes from an ancestor DSLayoutProvider \u2014 Dimsum components react to it rather than measuring\n// their own width, since the consumer is the one who knows what \"narrow\" means for their layout.\nconst NARROW_LAYOUT_MODES = ['s', 'xs'];\n\nconst DSPanelHeader: React.ComponentType<DSPanelHeaderT.Props> = (props) => {\n const { propsWithDefault, xstyledProps } = usePanelHeader(props);\n const { LeftRegion, RightRegion } = propsWithDefault;\n const layoutMode = useGetLayoutMode();\n const mainContentCols = React.useMemo(\n () => (layoutMode && NARROW_LAYOUT_MODES.includes(layoutMode) ? ['1fr'] : ['1fr', 'auto']),\n [layoutMode],\n );\n const getOwnerProps = () => propsWithDefault;\n const getOwnerPropsArguments = () => ({});\n return (\n <StyledWrapper\n className={propsWithDefault.className}\n cols={mainContentCols}\n alignItems=\"center\"\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n {...xstyledProps}\n >\n <StyledLeftRegion getOwnerProps={getOwnerProps} getOwnerPropsArguments={getOwnerPropsArguments}>\n {LeftRegion && <LeftRegion />}\n </StyledLeftRegion>\n <StyledRightRegion getOwnerProps={getOwnerProps} getOwnerPropsArguments={getOwnerPropsArguments}>\n {RightRegion && <RightRegion />}\n </StyledRightRegion>\n </StyledWrapper>\n );\n};\n\nDSPanelHeader.displayName = DSPanelHeaderName;\nconst DSPanelHeaderWithSchema = describe(DSPanelHeader);\nDSPanelHeaderWithSchema.propTypes = DSPanelHeaderPropTypesSchema;\n\nexport { DSPanelHeader, DSPanelHeaderWithSchema };\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;AD4CnB;AA5CJ,mBAAkB;AAClB,8BAAyB;AACzB,uBAAyC;AACzC,qBAAqB;AACrB,mCAAkE;AAClE,4BAA+B;AAC/B,uBAAsD;AAEtD,MAAM,oBAAgB,yBAAO,qBAAM,EAAE,MAAM,oCAAmB,MAAM,oCAAmB,KAAK,CAAC;AAAA,sBACvE,CAAC,UAAU,MAAM,MAAM,OAAO,MAAM,GAAG,CAAC;AAAA,iBAC7C,CAAC,UAAU,MAAM,MAAM,MAAM,IAAI;AAAA,oBAC9B,CAAC,UAAU,MAAM,MAAM,MAAM,IAAI;AAAA,kBACnC,CAAC,UAAU,MAAM,MAAM,MAAM,EAAE;AAAA,mBAC9B,CAAC,UAAU,MAAM,MAAM,MAAM,GAAG;AAAA,aACtC,CAAC,UAAU,MAAM,MAAM,MAAM,EAAE;AAAA,aAC/B,CAAC,UAAU,MAAM,MAAM,MAAM,GAAG;AAAA;AAAA;AAAA;AAO7C,MAAM,uBAAmB,yBAAO,qBAAM,EAAE,MAAM,oCAAmB,MAAM,oCAAmB,YAAY,CAAC;AAAA;AAAA;AAGvG,MAAM,wBAAoB,yBAAO,qBAAM,EAAE,MAAM,oCAAmB,MAAM,oCAAmB,aAAa,CAAC;AAAA;AAAA;AAMzG,MAAM,sBAAsB,CAAC,KAAK,IAAI;AAEtC,MAAM,gBAA2D,CAAC,UAAU;AAC1E,QAAM,EAAE,kBAAkB,aAAa,QAAI,sCAAe,KAAK;AAC/D,QAAM,EAAE,YAAY,YAAY,IAAI;AACpC,QAAM,iBAAa,mCAAiB;AACpC,QAAM,kBAAkB,aAAAA,QAAM;AAAA,IAC5B,MAAO,cAAc,oBAAoB,SAAS,UAAU,IAAI,CAAC,KAAK,IAAI,CAAC,OAAO,MAAM;AAAA,IACxF,CAAC,UAAU;AAAA,EACb;AACA,QAAM,gBAAgB,MAAM;AAC5B,QAAM,yBAAyB,OAAO,CAAC;AACvC,SACE;AAAA,IAAC;AAAA;AAAA,MACC,WAAW,iBAAiB;AAAA,MAC5B,MAAM;AAAA,MACN,YAAW;AAAA,MACX;AAAA,MACA;AAAA,MACC,GAAG;AAAA,MAEJ;AAAA,oDAAC,oBAAiB,eAA8B,wBAC7C,wBAAc,4CAAC,cAAW,GAC7B;AAAA,QACA,4CAAC,qBAAkB,eAA8B,wBAC9C,yBAAe,4CAAC,eAAY,GAC/B;AAAA;AAAA;AAAA,EACF;AAEJ;AAEA,cAAc,cAAc;AAC5B,MAAM,8BAA0B,kCAAS,aAAa;AACtD,wBAAwB,YAAY;",
6
+ "names": ["React"]
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 usePanelHeader_exports = {};
30
+ __export(usePanelHeader_exports, {
31
+ usePanelHeader: () => usePanelHeader
32
+ });
33
+ module.exports = __toCommonJS(usePanelHeader_exports);
34
+ var React = __toESM(require("react"));
35
+ var import_react = __toESM(require("react"));
36
+ var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
37
+ var import_uid = require("uid");
38
+ var import_react_desc_prop_types = require("../react-desc-prop-types.js");
39
+ var import_useValidateProps = require("./useValidateProps.js");
40
+ const usePanelHeader = (propsFromUser) => {
41
+ const propsWithDefault = (0, import_ds_props_helpers.useMemoMergePropsWithDefault)(propsFromUser, import_react_desc_prop_types.defaultProps);
42
+ (0, import_useValidateProps.useValidateProps)(propsWithDefault, import_react_desc_prop_types.DSPanelHeaderPropTypes);
43
+ const globalProps = (0, import_ds_props_helpers.useGetGlobalAttributes)(propsWithDefault);
44
+ const xstyledProps = (0, import_ds_props_helpers.useGetXstyledProps)(propsWithDefault);
45
+ const instanceUid = import_react.default.useMemo(() => `ds-panel-header-${(0, import_uid.uid)(5)}`, []);
46
+ return import_react.default.useMemo(
47
+ () => ({
48
+ propsWithDefault,
49
+ xstyledProps,
50
+ globalProps,
51
+ instanceUid
52
+ // ...eventHandlers,
53
+ }),
54
+ [
55
+ propsWithDefault,
56
+ xstyledProps,
57
+ globalProps,
58
+ instanceUid
59
+ // eventHandlers,
60
+ ]
61
+ );
62
+ };
63
+ //# sourceMappingURL=usePanelHeader.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/config/usePanelHeader.ts", "../../../../../../scripts/build/transpile/react-shim.js"],
4
+ "sourcesContent": ["import React from 'react';\nimport { useGetGlobalAttributes, useGetXstyledProps, useMemoMergePropsWithDefault } from '@elliemae/ds-props-helpers';\nimport { uid } from 'uid';\nimport { type DSPanelHeaderT, DSPanelHeaderPropTypes, defaultProps } from '../react-desc-prop-types.js';\nimport { useValidateProps } from './useValidateProps.js';\n\nexport interface PanelHeaderCTX {\n propsWithDefault: DSPanelHeaderT.InternalProps;\n xstyledProps: ReturnType<typeof useGetXstyledProps>;\n instanceUid: string;\n}\n\nexport const usePanelHeader = (propsFromUser: DSPanelHeaderT.Props) => {\n // =============================================================================\n // MERGE WITH DEFAULT AND VALIDATE PROPS\n // =============================================================================\n const propsWithDefault = useMemoMergePropsWithDefault<DSPanelHeaderT.InternalProps>(propsFromUser, defaultProps);\n useValidateProps(propsWithDefault, DSPanelHeaderPropTypes);\n // =============================================================================\n // GLOBAL ATTRIBUTES & XSTYLED PROPS\n // =============================================================================\n const globalProps = useGetGlobalAttributes<DSPanelHeaderT.InternalProps, HTMLElement>(propsWithDefault);\n const xstyledProps = useGetXstyledProps(propsWithDefault);\n // =============================================================================\n // AD HOC PER COMPONENT LOGIC\n // =============================================================================\n // custom code goes here, this is an example\n const instanceUid = React.useMemo(() => `ds-panel-header-${uid(5)}`, []);\n // =============================================================================\n // HELPERS HOOKS CONFIGS\n // =============================================================================\n // const eventHandlers = useEventHandlers({ propsWithDefault, instanceUid }); // <-- complex logic should be made atomics this way\n\n return React.useMemo(\n () => ({\n propsWithDefault,\n xstyledProps,\n globalProps,\n instanceUid,\n // ...eventHandlers,\n }),\n [\n propsWithDefault,\n xstyledProps,\n globalProps,\n instanceUid,\n // eventHandlers,\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,mCAA0E;AAC1E,8BAAiC;AAQ1B,MAAM,iBAAiB,CAAC,kBAAwC;AAIrE,QAAM,uBAAmB,sDAA2D,eAAe,yCAAY;AAC/G,gDAAiB,kBAAkB,mDAAsB;AAIzD,QAAM,kBAAc,gDAAkE,gBAAgB;AACtG,QAAM,mBAAe,4CAAmB,gBAAgB;AAKxD,QAAM,cAAc,aAAAA,QAAM,QAAQ,MAAM,uBAAmB,gBAAI,CAAC,CAAC,IAAI,CAAC,CAAC;AAMvE,SAAO,aAAAA,QAAM;AAAA,IACX,OAAO;AAAA,MACL;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA;AAAA,IAEF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA;AAAA,IAEF;AAAA,EACF;AACF;",
6
+ "names": ["React"]
7
+ }
@@ -0,0 +1,40 @@
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 useValidateProps_exports = {};
30
+ __export(useValidateProps_exports, {
31
+ useValidateProps: () => useValidateProps
32
+ });
33
+ module.exports = __toCommonJS(useValidateProps_exports);
34
+ var React = __toESM(require("react"));
35
+ var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
36
+ var import_constants = require("../constants/index.js");
37
+ const useValidateProps = (props, propTypes) => {
38
+ (0, import_ds_props_helpers.useValidateTypescriptPropTypes)(props, propTypes, import_constants.DSPanelHeaderName);
39
+ };
40
+ //# sourceMappingURL=useValidateProps.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/config/useValidateProps.ts", "../../../../../../scripts/build/transpile/react-shim.js"],
4
+ "sourcesContent": ["import { useValidateTypescriptPropTypes } from '@elliemae/ds-props-helpers';\nimport type { ValidationMap } from '@elliemae/ds-props-helpers';\nimport { type DSPanelHeaderT } from '../react-desc-prop-types.js';\nimport { DSPanelHeaderName } from '../constants/index.js';\n\nexport const useValidateProps = (props: DSPanelHeaderT.InternalProps, propTypes: ValidationMap<unknown>): void => {\n // we validate the \"required if\" via 'isRequiredIf from our custom PropTypes\n useValidateTypescriptPropTypes(props, propTypes, DSPanelHeaderName);\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,8BAA+C;AAG/C,uBAAkC;AAE3B,MAAM,mBAAmB,CAAC,OAAqC,cAA4C;AAEhH,8DAA+B,OAAO,WAAW,kCAAiB;AACpE;",
6
+ "names": []
7
+ }
@@ -0,0 +1,45 @@
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 constants_exports = {};
30
+ __export(constants_exports, {
31
+ DSPanelHeaderName: () => DSPanelHeaderName,
32
+ PANEL_HEADER_DATA_TESTID: () => PANEL_HEADER_DATA_TESTID,
33
+ PANEL_HEADER_SLOTS: () => PANEL_HEADER_SLOTS
34
+ });
35
+ module.exports = __toCommonJS(constants_exports);
36
+ var React = __toESM(require("react"));
37
+ var import_ds_system = require("@elliemae/ds-system");
38
+ const DSPanelHeaderName = "DSPanelheader";
39
+ const PANEL_HEADER_SLOTS = {
40
+ ROOT: "root",
41
+ LEFT_REGION: "leftRegion",
42
+ RIGHT_REGION: "rightRegion"
43
+ };
44
+ const PANEL_HEADER_DATA_TESTID = (0, import_ds_system.slotObjectToDataTestIds)(DSPanelHeaderName, PANEL_HEADER_SLOTS);
45
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/constants/index.ts", "../../../../../../scripts/build/transpile/react-shim.js"],
4
+ "sourcesContent": ["import { slotObjectToDataTestIds } from '@elliemae/ds-system';\n\nexport const DSPanelHeaderName = 'DSPanelheader';\n\n// we are naming this with the ${component_name}_slots convention to namespace & avoid errors on duplicate exports variables in aggregators\nexport const PANEL_HEADER_SLOTS = {\n ROOT: 'root',\n LEFT_REGION: 'leftRegion',\n RIGHT_REGION: 'rightRegion',\n} as const;\n\n// we are naming this with the ${component_name}_data_testid convention to namespace & avoid errors on duplicate exports variables in aggregators\nexport const PANEL_HEADER_DATA_TESTID = slotObjectToDataTestIds(DSPanelHeaderName, PANEL_HEADER_SLOTS);\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,uBAAwC;AAEjC,MAAM,oBAAoB;AAG1B,MAAM,qBAAqB;AAAA,EAChC,MAAM;AAAA,EACN,aAAa;AAAA,EACb,cAAc;AAChB;AAGO,MAAM,+BAA2B,0CAAwB,mBAAmB,kBAAkB;",
6
+ "names": []
7
+ }
@@ -0,0 +1,40 @@
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 index_exports = {};
30
+ __export(index_exports, {
31
+ DSPanelHeader: () => import_DSPanelHeader.DSPanelHeader,
32
+ DSPanelHeaderWithSchema: () => import_DSPanelHeader.DSPanelHeaderWithSchema,
33
+ PANEL_HEADER_DATA_TESTID: () => import_constants.PANEL_HEADER_DATA_TESTID,
34
+ PANEL_HEADER_SLOTS: () => import_constants.PANEL_HEADER_SLOTS
35
+ });
36
+ module.exports = __toCommonJS(index_exports);
37
+ var React = __toESM(require("react"));
38
+ var import_DSPanelHeader = require("./DSPanelHeader.js");
39
+ var import_constants = require("./constants/index.js");
40
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/index.ts", "../../../../../scripts/build/transpile/react-shim.js"],
4
+ "sourcesContent": ["// this is a workaround to typescript error TS2742\n// https://github.com/microsoft/TypeScript/issues/47663\nimport type {} from '@xstyled/system';\nexport { DSPanelHeader, DSPanelHeaderWithSchema } from './DSPanelHeader.js';\nexport { type DSPanelHeaderT } from './react-desc-prop-types.js';\nexport { PANEL_HEADER_SLOTS, PANEL_HEADER_DATA_TESTID } from './constants/index.js';\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADGvB,2BAAuD;AAEvD,uBAA6D;",
6
+ "names": []
7
+ }
@@ -0,0 +1,7 @@
1
+ {
2
+ "type": "commonjs",
3
+ "sideEffects": [
4
+ "*.css",
5
+ "*.scss"
6
+ ]
7
+ }
@@ -0,0 +1,50 @@
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 react_desc_prop_types_exports = {};
30
+ __export(react_desc_prop_types_exports, {
31
+ DSPanelHeaderPropTypes: () => DSPanelHeaderPropTypes,
32
+ DSPanelHeaderPropTypesSchema: () => DSPanelHeaderPropTypesSchema,
33
+ defaultProps: () => defaultProps
34
+ });
35
+ module.exports = __toCommonJS(react_desc_prop_types_exports);
36
+ var React = __toESM(require("react"));
37
+ var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
38
+ var import_constants = require("./constants/index.js");
39
+ const defaultProps = {};
40
+ const DSPanelHeaderPropTypes = {
41
+ ...(0, import_ds_props_helpers.getPropsPerSlotPropTypes)(import_constants.DSPanelHeaderName, import_constants.PANEL_HEADER_SLOTS),
42
+ ...import_ds_props_helpers.globalAttributesPropTypes,
43
+ ...import_ds_props_helpers.xstyledPropTypes,
44
+ LeftRegion: import_ds_props_helpers.PropTypes.func.description("Region A \u2014 agnostic region intended to identify the content (e.g. a title)"),
45
+ RightRegion: import_ds_props_helpers.PropTypes.func.description(
46
+ "Region 1 \u2014 agnostic region reserved for interactive elements, such as a Toolbar"
47
+ )
48
+ };
49
+ const DSPanelHeaderPropTypesSchema = DSPanelHeaderPropTypes;
50
+ //# sourceMappingURL=react-desc-prop-types.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 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 { 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 { type TypescriptHelpersT } from '@elliemae/ds-typescript-helpers';\nimport { DSPanelHeaderName, PANEL_HEADER_SLOTS } from './constants/index.js';\n\nexport declare namespace DSPanelHeaderT {\n export interface RequiredProps {}\n\n export interface DefaultProps {}\n\n export interface OptionalProps extends TypescriptHelpersT.PropsForGlobalOnSlots<\n typeof DSPanelHeaderName,\n typeof PANEL_HEADER_SLOTS\n > {\n className?: string;\n /** Region A \u2014 agnostic region intended to identify the content (e.g. a title) */\n LeftRegion?: () => JSX.Element;\n /** Region 1 \u2014 agnostic region reserved for interactive elements, such as a Toolbar */\n RightRegion?: () => JSX.Element;\n }\n\n export interface Props\n extends\n Partial<DefaultProps>,\n OptionalProps,\n Omit<GlobalAttributesT<HTMLElement>, keyof DefaultProps | keyof XstyledProps>,\n XstyledProps,\n RequiredProps {}\n\n export interface InternalProps\n extends\n DefaultProps,\n OptionalProps,\n Omit<GlobalAttributesT<HTMLElement>, keyof DefaultProps | keyof XstyledProps>,\n XstyledProps,\n RequiredProps {}\n}\n\nexport const defaultProps: DSPanelHeaderT.DefaultProps = {};\n\nexport const DSPanelHeaderPropTypes: DSPropTypesSchema<DSPanelHeaderT.Props> = {\n ...getPropsPerSlotPropTypes(DSPanelHeaderName, PANEL_HEADER_SLOTS),\n ...globalAttributesPropTypes,\n ...xstyledPropTypes,\n LeftRegion: PropTypes.func.description('Region A \u2014 agnostic region intended to identify the content (e.g. a title)'),\n RightRegion: PropTypes.func.description(\n 'Region 1 \u2014 agnostic region reserved for interactive elements, such as a Toolbar',\n ),\n};\n\nexport const DSPanelHeaderPropTypesSchema = DSPanelHeaderPropTypes as unknown as ValidationMap<DSPanelHeaderT.Props>;\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADEvB,8BAKO;AAEP,uBAAsD;AAmC/C,MAAM,eAA4C,CAAC;AAEnD,MAAM,yBAAkE;AAAA,EAC7E,OAAG,kDAAyB,oCAAmB,mCAAkB;AAAA,EACjE,GAAG;AAAA,EACH,GAAG;AAAA,EACH,YAAY,kCAAU,KAAK,YAAY,iFAA4E;AAAA,EACnH,aAAa,kCAAU,KAAK;AAAA,IAC1B;AAAA,EACF;AACF;AAEO,MAAM,+BAA+B;",
6
+ "names": []
7
+ }
@@ -0,0 +1,113 @@
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 __copyProps = (to, from, except, desc) => {
9
+ if (from && typeof from === "object" || typeof from === "function") {
10
+ for (let key of __getOwnPropNames(from))
11
+ if (!__hasOwnProp.call(to, key) && key !== except)
12
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
13
+ }
14
+ return to;
15
+ };
16
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
17
+ // If the importer is in node compatibility mode or this is not an ESM
18
+ // file that has been converted to a CommonJS file using a Babel-
19
+ // compatible transform (i.e. "__esModule" has not been set), then set
20
+ // "default" to the CommonJS "module.exports" for node compatibility.
21
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
22
+ mod
23
+ ));
24
+ var React = __toESM(require("react"));
25
+ var import_jsx_runtime = require("react/jsx-runtime");
26
+ var import__ = require("../index.js");
27
+ const TitleRegion = () => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: "title" });
28
+ const ToolbarRegion = () => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: "toolbar" });
29
+ const testRequiredProps = {};
30
+ const testOptionalProps = {
31
+ className: "string",
32
+ LeftRegion: TitleRegion,
33
+ RightRegion: ToolbarRegion,
34
+ dsPanelheaderRoot: {
35
+ onClick: () => {
36
+ },
37
+ "data-testid": "over-ride-test-id",
38
+ "aria-label": "over-ride-aria-label"
39
+ }
40
+ };
41
+ const testPartialDefaults = {};
42
+ const testProps = {
43
+ ...testRequiredProps,
44
+ ...testOptionalProps,
45
+ ...testPartialDefaults
46
+ };
47
+ const testPropsAsSyntax = {
48
+ ...testRequiredProps,
49
+ ...testOptionalProps,
50
+ ...testPartialDefaults
51
+ };
52
+ const testCompleteDefaults = {};
53
+ const testInternalProps = {
54
+ ...testRequiredProps,
55
+ ...testOptionalProps,
56
+ ...testCompleteDefaults
57
+ };
58
+ const testInternalPropsAsSyntax = {
59
+ ...testRequiredProps,
60
+ ...testOptionalProps,
61
+ ...testCompleteDefaults
62
+ };
63
+ const testExplicitDefinition = {
64
+ className: "string",
65
+ LeftRegion: TitleRegion,
66
+ RightRegion: ToolbarRegion,
67
+ dsPanelheaderRoot: {
68
+ onClick: () => {
69
+ },
70
+ "data-testid": "over-ride-test-id",
71
+ "aria-label": "over-ride-aria-label"
72
+ }
73
+ };
74
+ const testInferedTypeCompatibility = {
75
+ className: "string",
76
+ LeftRegion: TitleRegion,
77
+ RightRegion: ToolbarRegion,
78
+ dsPanelheaderRoot: {
79
+ onClick: () => {
80
+ },
81
+ "data-testid": "over-ride-test-id",
82
+ "aria-label": "over-ride-aria-label"
83
+ }
84
+ };
85
+ const testDefinitionAsConst = {
86
+ className: "string",
87
+ dsPanelheaderRoot: {
88
+ onClick: () => {
89
+ },
90
+ "data-testid": "over-ride-test-id",
91
+ "aria-label": "over-ride-aria-label"
92
+ }
93
+ };
94
+ const ExampleUsageComponent = () => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
95
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__.DSPanelHeader, { ...testExplicitDefinition }),
96
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__.DSPanelHeader, { ...testInferedTypeCompatibility }),
97
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__.DSPanelHeader, { ...testDefinitionAsConst }),
98
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
99
+ import__.DSPanelHeader,
100
+ {
101
+ className: "string",
102
+ LeftRegion: TitleRegion,
103
+ RightRegion: ToolbarRegion,
104
+ dsPanelheaderRoot: {
105
+ onClick: () => {
106
+ },
107
+ "data-testid": "over-ride-test-id",
108
+ "aria-label": "over-ride-aria-label"
109
+ }
110
+ }
111
+ )
112
+ ] });
113
+ //# sourceMappingURL=DSPanelHeaderNamespace.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/typescript-testing/DSPanelHeaderNamespace.tsx"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable @typescript-eslint/no-unused-vars, no-unused-vars */\nimport { DSPanelHeader, type DSPanelHeaderT } from '../index.js';\n\n// test we expose the namespace and the namespace follows our deliverable conventions\ntype ComponentPropsForApp = DSPanelHeaderT.Props;\ntype ComponentPropsInternals = DSPanelHeaderT.InternalProps;\ntype ComponentPropsDefaultProps = DSPanelHeaderT.DefaultProps;\ntype ComponentPropsOptionalProps = DSPanelHeaderT.OptionalProps;\ntype ComponentPropsRequiredProps = DSPanelHeaderT.RequiredProps;\n\nconst TitleRegion = () => <span>title</span>;\nconst ToolbarRegion = () => <span>toolbar</span>;\n\nconst testRequiredProps: ComponentPropsRequiredProps = {};\n\nconst testOptionalProps: ComponentPropsOptionalProps = {\n className: 'string',\n LeftRegion: TitleRegion,\n RightRegion: ToolbarRegion,\n dsPanelheaderRoot: {\n onClick: () => {},\n 'data-testid': 'over-ride-test-id',\n 'aria-label': 'over-ride-aria-label',\n },\n};\n\n// difference Props and InternalProps is that InternalProps has all the default props filled in\n// Props allows for partial defaults\nconst testPartialDefaults: Partial<ComponentPropsDefaultProps> = {};\n\nconst testProps: ComponentPropsForApp = {\n ...testRequiredProps,\n ...testOptionalProps,\n ...testPartialDefaults,\n};\n\nconst testPropsAsSyntax = {\n ...testRequiredProps,\n ...testOptionalProps,\n ...testPartialDefaults,\n} as ComponentPropsForApp;\n\n// InternalProps requires all defaults to be filled in\nconst testCompleteDefaults: Required<ComponentPropsDefaultProps> = {};\n\nconst testInternalProps: ComponentPropsInternals = {\n ...testRequiredProps,\n ...testOptionalProps,\n ...testCompleteDefaults,\n};\n\nconst testInternalPropsAsSyntax = {\n ...testRequiredProps,\n ...testOptionalProps,\n ...testCompleteDefaults,\n} as ComponentPropsInternals;\n\n// using the explicit type definition, if there is an error, it will be marked on the key that is wrong\nconst testExplicitDefinition: ComponentPropsForApp = {\n className: 'string',\n LeftRegion: TitleRegion,\n RightRegion: ToolbarRegion,\n dsPanelheaderRoot: {\n onClick: () => {},\n 'data-testid': 'over-ride-test-id',\n 'aria-label': 'over-ride-aria-label',\n },\n};\n\n// using the \"as\" syntax, if there is an error, it will be marking the whole object as wrong because it is not compatible with the type\nconst testInferedTypeCompatibility = {\n className: 'string',\n LeftRegion: TitleRegion,\n RightRegion: ToolbarRegion,\n dsPanelheaderRoot: {\n onClick: () => {},\n 'data-testid': 'over-ride-test-id',\n 'aria-label': 'over-ride-aria-label',\n },\n} as ComponentPropsForApp;\n\nconst testDefinitionAsConst = {\n className: 'string',\n dsPanelheaderRoot: {\n onClick: () => {},\n 'data-testid': 'over-ride-test-id',\n 'aria-label': 'over-ride-aria-label',\n },\n} as const;\n\nconst ExampleUsageComponent = () => (\n <>\n {/* works with explicitly casted props, all syntaxes */}\n <DSPanelHeader {...testExplicitDefinition} />\n <DSPanelHeader {...testInferedTypeCompatibility} />\n <DSPanelHeader {...testDefinitionAsConst} />\n {/* works with inline values */}\n <DSPanelHeader\n className=\"string\"\n LeftRegion={TitleRegion}\n RightRegion={ToolbarRegion}\n dsPanelheaderRoot={{\n onClick: () => {},\n 'data-testid': 'over-ride-test-id',\n 'aria-label': 'over-ride-aria-label',\n }}\n />\n </>\n);\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;AAAA,YAAuB;ACUG;AAT1B,eAAmD;AASnD,MAAM,cAAc,MAAM,4CAAC,UAAK,mBAAK;AACrC,MAAM,gBAAgB,MAAM,4CAAC,UAAK,qBAAO;AAEzC,MAAM,oBAAiD,CAAC;AAExD,MAAM,oBAAiD;AAAA,EACrD,WAAW;AAAA,EACX,YAAY;AAAA,EACZ,aAAa;AAAA,EACb,mBAAmB;AAAA,IACjB,SAAS,MAAM;AAAA,IAAC;AAAA,IAChB,eAAe;AAAA,IACf,cAAc;AAAA,EAChB;AACF;AAIA,MAAM,sBAA2D,CAAC;AAElE,MAAM,YAAkC;AAAA,EACtC,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AACL;AAEA,MAAM,oBAAoB;AAAA,EACxB,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AACL;AAGA,MAAM,uBAA6D,CAAC;AAEpE,MAAM,oBAA6C;AAAA,EACjD,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AACL;AAEA,MAAM,4BAA4B;AAAA,EAChC,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AACL;AAGA,MAAM,yBAA+C;AAAA,EACnD,WAAW;AAAA,EACX,YAAY;AAAA,EACZ,aAAa;AAAA,EACb,mBAAmB;AAAA,IACjB,SAAS,MAAM;AAAA,IAAC;AAAA,IAChB,eAAe;AAAA,IACf,cAAc;AAAA,EAChB;AACF;AAGA,MAAM,+BAA+B;AAAA,EACnC,WAAW;AAAA,EACX,YAAY;AAAA,EACZ,aAAa;AAAA,EACb,mBAAmB;AAAA,IACjB,SAAS,MAAM;AAAA,IAAC;AAAA,IAChB,eAAe;AAAA,IACf,cAAc;AAAA,EAChB;AACF;AAEA,MAAM,wBAAwB;AAAA,EAC5B,WAAW;AAAA,EACX,mBAAmB;AAAA,IACjB,SAAS,MAAM;AAAA,IAAC;AAAA,IAChB,eAAe;AAAA,IACf,cAAc;AAAA,EAChB;AACF;AAEA,MAAM,wBAAwB,MAC5B,4EAEE;AAAA,8CAAC,0BAAe,GAAG,wBAAwB;AAAA,EAC3C,4CAAC,0BAAe,GAAG,8BAA8B;AAAA,EACjD,4CAAC,0BAAe,GAAG,uBAAuB;AAAA,EAE1C;AAAA,IAAC;AAAA;AAAA,MACC,WAAU;AAAA,MACV,YAAY;AAAA,MACZ,aAAa;AAAA,MACb,mBAAmB;AAAA,QACjB,SAAS,MAAM;AAAA,QAAC;AAAA,QAChB,eAAe;AAAA,QACf,cAAc;AAAA,MAChB;AAAA;AAAA,EACF;AAAA,GACF;",
6
+ "names": []
7
+ }
@@ -0,0 +1,61 @@
1
+ import * as React from "react";
2
+ import { jsx, jsxs } from "react/jsx-runtime";
3
+ import React2 from "react";
4
+ import { describe } from "@elliemae/ds-props-helpers";
5
+ import { styled, useGetLayoutMode } from "@elliemae/ds-system";
6
+ import { Grid } from "@elliemae/ds-grid";
7
+ import { DSPanelHeaderPropTypesSchema } from "./react-desc-prop-types.js";
8
+ import { usePanelHeader } from "./config/usePanelHeader.js";
9
+ import { PANEL_HEADER_SLOTS, DSPanelHeaderName } from "./constants/index.js";
10
+ const StyledWrapper = styled(Grid, { name: DSPanelHeaderName, slot: PANEL_HEADER_SLOTS.ROOT })`
11
+ background-color: ${(props) => props.theme.colors.brand[100]};
12
+ padding-top: ${(props) => props.theme.space.xxs2};
13
+ padding-bottom: ${(props) => props.theme.space.xxs2};
14
+ padding-left: ${(props) => props.theme.space.xs};
15
+ padding-right: ${(props) => props.theme.space.xxs};
16
+ col-gap: ${(props) => props.theme.space.xs};
17
+ row-gap: ${(props) => props.theme.space.xxs};
18
+ min-height: 46px;
19
+ min-width: 312px;
20
+ `;
21
+ const StyledLeftRegion = styled(Grid, { name: DSPanelHeaderName, slot: PANEL_HEADER_SLOTS.LEFT_REGION })`
22
+ min-width: 0;
23
+ `;
24
+ const StyledRightRegion = styled(Grid, { name: DSPanelHeaderName, slot: PANEL_HEADER_SLOTS.RIGHT_REGION })`
25
+ min-width: 0;
26
+ `;
27
+ const NARROW_LAYOUT_MODES = ["s", "xs"];
28
+ const DSPanelHeader = (props) => {
29
+ const { propsWithDefault, xstyledProps } = usePanelHeader(props);
30
+ const { LeftRegion, RightRegion } = propsWithDefault;
31
+ const layoutMode = useGetLayoutMode();
32
+ const mainContentCols = React2.useMemo(
33
+ () => layoutMode && NARROW_LAYOUT_MODES.includes(layoutMode) ? ["1fr"] : ["1fr", "auto"],
34
+ [layoutMode]
35
+ );
36
+ const getOwnerProps = () => propsWithDefault;
37
+ const getOwnerPropsArguments = () => ({});
38
+ return /* @__PURE__ */ jsxs(
39
+ StyledWrapper,
40
+ {
41
+ className: propsWithDefault.className,
42
+ cols: mainContentCols,
43
+ alignItems: "center",
44
+ getOwnerProps,
45
+ getOwnerPropsArguments,
46
+ ...xstyledProps,
47
+ children: [
48
+ /* @__PURE__ */ jsx(StyledLeftRegion, { getOwnerProps, getOwnerPropsArguments, children: LeftRegion && /* @__PURE__ */ jsx(LeftRegion, {}) }),
49
+ /* @__PURE__ */ jsx(StyledRightRegion, { getOwnerProps, getOwnerPropsArguments, children: RightRegion && /* @__PURE__ */ jsx(RightRegion, {}) })
50
+ ]
51
+ }
52
+ );
53
+ };
54
+ DSPanelHeader.displayName = DSPanelHeaderName;
55
+ const DSPanelHeaderWithSchema = describe(DSPanelHeader);
56
+ DSPanelHeaderWithSchema.propTypes = DSPanelHeaderPropTypesSchema;
57
+ export {
58
+ DSPanelHeader,
59
+ DSPanelHeaderWithSchema
60
+ };
61
+ //# sourceMappingURL=DSPanelHeader.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/DSPanelHeader.tsx"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { describe } from '@elliemae/ds-props-helpers';\nimport { styled, useGetLayoutMode } from '@elliemae/ds-system';\nimport { Grid } from '@elliemae/ds-grid';\nimport { type DSPanelHeaderT, DSPanelHeaderPropTypesSchema } from './react-desc-prop-types.js';\nimport { usePanelHeader } from './config/usePanelHeader.js';\nimport { PANEL_HEADER_SLOTS, DSPanelHeaderName } from './constants/index.js';\n\nconst StyledWrapper = styled(Grid, { name: DSPanelHeaderName, slot: PANEL_HEADER_SLOTS.ROOT })`\n background-color: ${(props) => props.theme.colors.brand[100]};\n padding-top: ${(props) => props.theme.space.xxs2};\n padding-bottom: ${(props) => props.theme.space.xxs2};\n padding-left: ${(props) => props.theme.space.xs};\n padding-right: ${(props) => props.theme.space.xxs};\n col-gap: ${(props) => props.theme.space.xs};\n row-gap: ${(props) => props.theme.space.xxs};\n min-height: 46px;\n min-width: 312px;\n`;\n// Grid items default to `min-width: auto`, which sizes to the content's intrinsic (unwrapped) width and\n// blows out the grid instead of letting text wrap \u2014 `min-width: 0` is what actually allows a consumer's\n// title/subtitle typography inside this region to wrap onto additional lines instead of overflowing.\nconst StyledLeftRegion = styled(Grid, { name: DSPanelHeaderName, slot: PANEL_HEADER_SLOTS.LEFT_REGION })`\n min-width: 0;\n`;\nconst StyledRightRegion = styled(Grid, { name: DSPanelHeaderName, slot: PANEL_HEADER_SLOTS.RIGHT_REGION })`\n min-width: 0;\n`;\n// Narrow layout modes stack RightRegion below LeftRegion (single column, two rows) instead of side-by-side.\n// `layoutMode` comes from an ancestor DSLayoutProvider \u2014 Dimsum components react to it rather than measuring\n// their own width, since the consumer is the one who knows what \"narrow\" means for their layout.\nconst NARROW_LAYOUT_MODES = ['s', 'xs'];\n\nconst DSPanelHeader: React.ComponentType<DSPanelHeaderT.Props> = (props) => {\n const { propsWithDefault, xstyledProps } = usePanelHeader(props);\n const { LeftRegion, RightRegion } = propsWithDefault;\n const layoutMode = useGetLayoutMode();\n const mainContentCols = React.useMemo(\n () => (layoutMode && NARROW_LAYOUT_MODES.includes(layoutMode) ? ['1fr'] : ['1fr', 'auto']),\n [layoutMode],\n );\n const getOwnerProps = () => propsWithDefault;\n const getOwnerPropsArguments = () => ({});\n return (\n <StyledWrapper\n className={propsWithDefault.className}\n cols={mainContentCols}\n alignItems=\"center\"\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n {...xstyledProps}\n >\n <StyledLeftRegion getOwnerProps={getOwnerProps} getOwnerPropsArguments={getOwnerPropsArguments}>\n {LeftRegion && <LeftRegion />}\n </StyledLeftRegion>\n <StyledRightRegion getOwnerProps={getOwnerProps} getOwnerPropsArguments={getOwnerPropsArguments}>\n {RightRegion && <RightRegion />}\n </StyledRightRegion>\n </StyledWrapper>\n );\n};\n\nDSPanelHeader.displayName = DSPanelHeaderName;\nconst DSPanelHeaderWithSchema = describe(DSPanelHeader);\nDSPanelHeaderWithSchema.propTypes = DSPanelHeaderPropTypesSchema;\n\nexport { DSPanelHeader, DSPanelHeaderWithSchema };\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;AC4CnB,SASmB,KATnB;AA5CJ,OAAOA,YAAW;AAClB,SAAS,gBAAgB;AACzB,SAAS,QAAQ,wBAAwB;AACzC,SAAS,YAAY;AACrB,SAA8B,oCAAoC;AAClE,SAAS,sBAAsB;AAC/B,SAAS,oBAAoB,yBAAyB;AAEtD,MAAM,gBAAgB,OAAO,MAAM,EAAE,MAAM,mBAAmB,MAAM,mBAAmB,KAAK,CAAC;AAAA,sBACvE,CAAC,UAAU,MAAM,MAAM,OAAO,MAAM,GAAG,CAAC;AAAA,iBAC7C,CAAC,UAAU,MAAM,MAAM,MAAM,IAAI;AAAA,oBAC9B,CAAC,UAAU,MAAM,MAAM,MAAM,IAAI;AAAA,kBACnC,CAAC,UAAU,MAAM,MAAM,MAAM,EAAE;AAAA,mBAC9B,CAAC,UAAU,MAAM,MAAM,MAAM,GAAG;AAAA,aACtC,CAAC,UAAU,MAAM,MAAM,MAAM,EAAE;AAAA,aAC/B,CAAC,UAAU,MAAM,MAAM,MAAM,GAAG;AAAA;AAAA;AAAA;AAO7C,MAAM,mBAAmB,OAAO,MAAM,EAAE,MAAM,mBAAmB,MAAM,mBAAmB,YAAY,CAAC;AAAA;AAAA;AAGvG,MAAM,oBAAoB,OAAO,MAAM,EAAE,MAAM,mBAAmB,MAAM,mBAAmB,aAAa,CAAC;AAAA;AAAA;AAMzG,MAAM,sBAAsB,CAAC,KAAK,IAAI;AAEtC,MAAM,gBAA2D,CAAC,UAAU;AAC1E,QAAM,EAAE,kBAAkB,aAAa,IAAI,eAAe,KAAK;AAC/D,QAAM,EAAE,YAAY,YAAY,IAAI;AACpC,QAAM,aAAa,iBAAiB;AACpC,QAAM,kBAAkBA,OAAM;AAAA,IAC5B,MAAO,cAAc,oBAAoB,SAAS,UAAU,IAAI,CAAC,KAAK,IAAI,CAAC,OAAO,MAAM;AAAA,IACxF,CAAC,UAAU;AAAA,EACb;AACA,QAAM,gBAAgB,MAAM;AAC5B,QAAM,yBAAyB,OAAO,CAAC;AACvC,SACE;AAAA,IAAC;AAAA;AAAA,MACC,WAAW,iBAAiB;AAAA,MAC5B,MAAM;AAAA,MACN,YAAW;AAAA,MACX;AAAA,MACA;AAAA,MACC,GAAG;AAAA,MAEJ;AAAA,4BAAC,oBAAiB,eAA8B,wBAC7C,wBAAc,oBAAC,cAAW,GAC7B;AAAA,QACA,oBAAC,qBAAkB,eAA8B,wBAC9C,yBAAe,oBAAC,eAAY,GAC/B;AAAA;AAAA;AAAA,EACF;AAEJ;AAEA,cAAc,cAAc;AAC5B,MAAM,0BAA0B,SAAS,aAAa;AACtD,wBAAwB,YAAY;",
6
+ "names": ["React"]
7
+ }