@elliemae/ds-menu-items-commons 3.80.0-next.72 → 3.80.0-next.76

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,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 lockFlags_exports = {};
30
+ __export(lockFlags_exports, {
31
+ isAriaDisabledProp: () => isAriaDisabledProp,
32
+ isDisabledProp: () => isDisabledProp,
33
+ isReadOnlyProp: () => isReadOnlyProp
34
+ });
35
+ module.exports = __toCommonJS(lockFlags_exports);
36
+ var React = __toESM(require("react"));
37
+ const isDisabledProp = ({ disabled, $disabled }) => Boolean(disabled || $disabled);
38
+ const isAriaDisabledProp = ({ applyAriaDisabled, $applyAriaDisabled }) => Boolean(applyAriaDisabled || $applyAriaDisabled);
39
+ const isReadOnlyProp = ({ readOnly, $readOnly }) => Boolean(readOnly || $readOnly);
40
+ //# sourceMappingURL=lockFlags.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/lockFlags.ts", "../../../../../scripts/build/transpile/react-shim.js"],
4
+ "sourcesContent": ["/**\n * Lock flags, read from the transient (`$`) spelling and from the plain one. See `StyledGlobalMenuItemWrapper`.\n */\nexport type LockFlagsT = {\n disabled?: boolean;\n applyAriaDisabled?: boolean;\n readOnly?: boolean;\n $disabled?: boolean;\n $applyAriaDisabled?: boolean;\n $readOnly?: boolean;\n};\nexport const isDisabledProp = ({ disabled, $disabled }: LockFlagsT) => Boolean(disabled || $disabled);\nexport const isAriaDisabledProp = ({ applyAriaDisabled, $applyAriaDisabled }: LockFlagsT) =>\n Boolean(applyAriaDisabled || $applyAriaDisabled);\nexport const isReadOnlyProp = ({ readOnly, $readOnly }: LockFlagsT) => Boolean(readOnly || $readOnly);\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADWhB,MAAM,iBAAiB,CAAC,EAAE,UAAU,UAAU,MAAkB,QAAQ,YAAY,SAAS;AAC7F,MAAM,qBAAqB,CAAC,EAAE,mBAAmB,mBAAmB,MACzE,QAAQ,qBAAqB,kBAAkB;AAC1C,MAAM,iBAAiB,CAAC,EAAE,UAAU,UAAU,MAAkB,QAAQ,YAAY,SAAS;",
6
+ "names": []
7
+ }
@@ -0,0 +1,84 @@
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 menuItemStateCss_exports = {};
30
+ __export(menuItemStateCss_exports, {
31
+ borderOutside: () => borderOutside,
32
+ disabledOption: () => disabledOption,
33
+ plainLockCss: () => plainLockCss
34
+ });
35
+ module.exports = __toCommonJS(menuItemStateCss_exports);
36
+ var React = __toESM(require("react"));
37
+ var import_ds_system = require("@elliemae/ds-system");
38
+ var import_lockFlags = require("./lockFlags.js");
39
+ const borderOutside = () => import_ds_system.css`
40
+ :after {
41
+ display: block;
42
+ content: ' ';
43
+ position: absolute;
44
+ top: 0;
45
+ left: 0;
46
+ right: 0;
47
+ bottom: 0;
48
+ border: 1px solid ${({ theme }) => theme.colors.brand[500]};
49
+ pointer-events: none;
50
+ z-index: 7;
51
+ }
52
+ `;
53
+ const disabledOption = () => import_ds_system.css`
54
+ color: ${({ theme }) => theme.colors.neutral[500]};
55
+ /** Checkbox label has its own color rule (n700 per checkbox spec) so the wrapper's color does not cascade through it
56
+ * The multi-select menu item needs explicit label overrides in both non-hover and hover states.
57
+ */
58
+ label {
59
+ color: ${({ theme }) => theme.colors.neutral[500]};
60
+ }
61
+ :hover {
62
+ color: ${({ theme }) => theme.colors.neutral[600]};
63
+ label {
64
+ color: ${({ theme }) => theme.colors.neutral[600]};
65
+ }
66
+ /** single menu item spec:
67
+ * a locked and selected item + hover → the checkmark icon goes from neutral-400 (set by the item) to neutral-500
68
+ * ds-icons sets svg fill via !important internally — override with same flag at higher specificity
69
+ */
70
+ svg {
71
+ fill: ${({ theme }) => theme.colors.neutral[500]} !important;
72
+ }
73
+ }
74
+ /* the element's own not-allowed cursor comes from plainLockCss; the descendants keep theirs here */
75
+ * {
76
+ cursor: not-allowed;
77
+ }
78
+ `;
79
+ const plainLockCss = (props) => {
80
+ if ((0, import_lockFlags.isDisabledProp)(props)) return import_ds_system.disabledInteractionCss;
81
+ if ((0, import_lockFlags.isAriaDisabledProp)(props) || (0, import_lockFlags.isReadOnlyProp)(props)) return import_ds_system.ariaDisabledInteractionCss;
82
+ return "";
83
+ };
84
+ //# sourceMappingURL=menuItemStateCss.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/menuItemStateCss.ts", "../../../../../scripts/build/transpile/react-shim.js"],
4
+ "sourcesContent": ["import { css, ariaDisabledInteractionCss, disabledInteractionCss } from '@elliemae/ds-system';\nimport { isAriaDisabledProp, isDisabledProp, isReadOnlyProp, type LockFlagsT } from './lockFlags.js';\n\nexport const borderOutside = () => css`\n :after {\n display: block;\n content: ' ';\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n border: 1px solid ${({ theme }) => theme.colors.brand[500]};\n pointer-events: none;\n z-index: 7;\n }\n`;\n\nexport const disabledOption = () => css`\n color: ${({ theme }) => theme.colors.neutral[500]};\n /** Checkbox label has its own color rule (n700 per checkbox spec) so the wrapper's color does not cascade through it\n * The multi-select menu item needs explicit label overrides in both non-hover and hover states. \n */\n label {\n color: ${({ theme }) => theme.colors.neutral[500]};\n }\n :hover {\n color: ${({ theme }) => theme.colors.neutral[600]};\n label {\n color: ${({ theme }) => theme.colors.neutral[600]};\n }\n /** single menu item spec:\n * a locked and selected item + hover \u2192 the checkmark icon goes from neutral-400 (set by the item) to neutral-500\n * ds-icons sets svg fill via !important internally \u2014 override with same flag at higher specificity\n */\n svg {\n fill: ${({ theme }) => theme.colors.neutral[500]} !important;\n }\n }\n /* the element's own not-allowed cursor comes from plainLockCss; the descendants keep theirs here */\n * {\n cursor: not-allowed;\n }\n`;\n\n// The wrapper's lock style depends on the lock kind (PUI-16695, the contract is in\n// stories/docs/principles/software-design/DisabledAriaDisabledReadOnly.md):\n// - disabled is a hard lock: the wrapper only gets the not-allowed cursor. Its pointer events stay on, and the actions\n// are stopped in JavaScript, not by CSS.\n// - applyAriaDisabled / readOnly are soft locks: the wrapper gets the same cursor, and keeps hover. A soft-locked item\n// with a submenu still opens it (view-only popup).\n// Read from the plain flags (exported API) and the transient ones alike.\nexport const plainLockCss = (props: LockFlagsT) => {\n if (isDisabledProp(props)) return disabledInteractionCss;\n if (isAriaDisabledProp(props) || isReadOnlyProp(props)) return ariaDisabledInteractionCss;\n return '';\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,uBAAwE;AACxE,uBAAoF;AAE7E,MAAM,gBAAgB,MAAM;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,wBASX,CAAC,EAAE,MAAM,MAAM,MAAM,OAAO,MAAM,GAAG,CAAC;AAAA;AAAA;AAAA;AAAA;AAMvD,MAAM,iBAAiB,MAAM;AAAA,WACzB,CAAC,EAAE,MAAM,MAAM,MAAM,OAAO,QAAQ,GAAG,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA,aAKtC,CAAC,EAAE,MAAM,MAAM,MAAM,OAAO,QAAQ,GAAG,CAAC;AAAA;AAAA;AAAA,aAGxC,CAAC,EAAE,MAAM,MAAM,MAAM,OAAO,QAAQ,GAAG,CAAC;AAAA;AAAA,eAEtC,CAAC,EAAE,MAAM,MAAM,MAAM,OAAO,QAAQ,GAAG,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,cAOzC,CAAC,EAAE,MAAM,MAAM,MAAM,OAAO,QAAQ,GAAG,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAgB/C,MAAM,eAAe,CAAC,UAAsB;AACjD,UAAI,iCAAe,KAAK,EAAG,QAAO;AAClC,UAAI,qCAAmB,KAAK,SAAK,iCAAe,KAAK,EAAG,QAAO;AAC/D,SAAO;AACT;",
6
+ "names": []
7
+ }
@@ -47,47 +47,9 @@ var import_ds_system = require("@elliemae/ds-system");
47
47
  var import_ds_grid = require("@elliemae/ds-grid");
48
48
  var import_ds_typography = require("@elliemae/ds-typography");
49
49
  var import_constants = require("./constants/index.js");
50
+ var import_lockFlags = require("./lockFlags.js");
51
+ var import_menuItemStateCss = require("./menuItemStateCss.js");
50
52
  const MENU_ITEM_ROW_HEIGHT = "32px";
51
- const borderOutside = () => import_ds_system.css`
52
- :after {
53
- display: block;
54
- content: ' ';
55
- position: absolute;
56
- top: 0;
57
- left: 0;
58
- right: 0;
59
- bottom: 0;
60
- border: 1px solid ${({ theme }) => theme.colors.brand[500]};
61
- pointer-events: none;
62
- z-index: 7;
63
- }
64
- `;
65
- const disabledOption = () => import_ds_system.css`
66
- color: ${({ theme }) => theme.colors.neutral[500]};
67
- /** Checkbox label has its own color rule (n700 per checkbox spec) so the wrapper's color does not cascade through it
68
- * The multi-select menu item needs explicit label overrides in both non-hover and hover states.
69
- */
70
- label {
71
- color: ${({ theme }) => theme.colors.neutral[500]};
72
- }
73
- :hover {
74
- color: ${({ theme }) => theme.colors.neutral[600]};
75
- label {
76
- color: ${({ theme }) => theme.colors.neutral[600]};
77
- }
78
- /** single menu item spec:
79
- * aria-disabled-selected + hover → checkmark icon goes from neutral-400 to neutral-500
80
- * ds-icons sets svg fill via !important internally — override with same flag at higher specificity
81
- */
82
- svg {
83
- fill: ${({ theme }) => theme.colors.neutral[500]} !important;
84
- }
85
- }
86
- cursor: not-allowed;
87
- * {
88
- cursor: not-allowed;
89
- }
90
- `;
91
53
  const StyledGlobalMenuItemWrapper = (0, import_ds_system.styled)("li", {
92
54
  name: import_constants.DSMenuItemName,
93
55
  slot: import_constants.DSMenuItemSlots.MENU_ITEM_WRAPPER
@@ -103,36 +65,41 @@ const StyledGlobalMenuItemWrapper = (0, import_ds_system.styled)("li", {
103
65
  position: relative;
104
66
 
105
67
  ${(props) => {
106
- if (props.isActive) return borderOutside();
68
+ if (props.isActive) return (0, import_menuItemStateCss.borderOutside)();
107
69
  return "";
108
70
  }};
109
71
 
110
72
  ${(props) => {
111
- if (props.disabled || props.applyAriaDisabled || props.readOnly) return disabledOption();
73
+ if ((0, import_lockFlags.isDisabledProp)(props) || (0, import_lockFlags.isAriaDisabledProp)(props) || (0, import_lockFlags.isReadOnlyProp)(props)) return (0, import_menuItemStateCss.disabledOption)();
112
74
  return "";
113
75
  }};
114
76
 
115
77
  background-color: ${(props) => props.isActive ? props.theme.colors.brand[200] : props.theme.colors.neutral["000"]};
116
78
 
117
79
  // focus style for standalone version
80
+ // a menu item is a navigation pattern: a disabled item stays keyboard reachable, so its focus must be visible too
81
+ // (the text keeps the disabled colour, the focus ring and background are the same as an enabled item)
118
82
  &:focus {
119
- ${(props) => {
120
- if (props.disabled) return disabledOption();
121
- if (!props.disabled) return borderOutside();
122
- return "";
123
- }};
83
+ ${(props) => (0, import_lockFlags.isDisabledProp)(props) ? (0, import_menuItemStateCss.disabledOption)() : ""};
84
+ ${(0, import_menuItemStateCss.borderOutside)()};
124
85
  outline: none;
125
- background-color: ${(props) => !props.disabled ? props.theme.colors.brand[200] : props.theme.colors.neutral["000"]};
86
+ background-color: ${({ theme }) => theme.colors.brand[200]};
126
87
  }
127
88
  &:hover {
128
- background-color: ${(props) => (!props.disabled || !props.applyAriaDisabled || !props.readOnly) && props.theme.colors.brand[200]};
89
+ background-color: ${(props) => !(0, import_lockFlags.isDisabledProp)(props) && props.theme.colors.brand[200]};
129
90
  }
130
91
 
131
92
  &[aria-disabled='true'] {
132
- ${disabledOption()}
93
+ ${(0, import_menuItemStateCss.disabledOption)()}
133
94
  }
134
95
 
135
96
  ${import_ds_system.xStyledCommonProps}
97
+ ${(props) => (0, import_menuItemStateCss.plainLockCss)(props)}
98
+ /* DOM fallback: any wrapper that prints aria-disabled gets the not-allowed cursor, even when plainLockCss did not read
99
+ the flag. It sets the cursor only, so it adds no lock behaviour of its own */
100
+ &&[aria-disabled='true'] {
101
+ ${import_ds_system.ariaDisabledInteractionCss}
102
+ }
136
103
  `;
137
104
  const StyleMenuItemLabel = (0, import_ds_system.styled)(import_ds_typography.DSTypography, { name: import_constants.DSMenuItemName, slot: import_constants.DSMenuItemSlots.MENU_ITEM_LABEL })`
138
105
  padding: 8px 0;
@@ -144,7 +111,7 @@ const StyleMenuItemSecondaryLabel = (0, import_ds_system.styled)("span", {
144
111
  padding: 8px 0;
145
112
  font-size: 0.8462rem;
146
113
  font-style: italic;
147
- color: ${(props) => props.disabled ? props.theme.colors.neutral["500"] : props.theme.colors.brand["800"]};
114
+ color: ${(props) => (0, import_lockFlags.isDisabledProp)(props) ? props.theme.colors.neutral["500"] : props.theme.colors.brand["800"]};
148
115
  text-align: right;
149
116
  `;
150
117
  const StyledIconContainer = (0, import_ds_system.styled)("div", { name: import_constants.DSMenuItemName, slot: import_constants.DSMenuItemSlots.MENU_ITEM_ICON })`
@@ -165,7 +132,7 @@ const StyledEllipsisButton = (0, import_ds_system.styled)("div", {
165
132
  place-items: center;
166
133
  background: transparent;
167
134
  :active {
168
- ${(props) => props.disabled || props.applyAriaDisabled ? "" : borderOutside()}
135
+ ${(props) => (0, import_lockFlags.isDisabledProp)(props) || (0, import_lockFlags.isAriaDisabledProp)(props) ? "" : (0, import_menuItemStateCss.borderOutside)()}
169
136
  }
170
137
  `;
171
138
  const StyledItemContent = (0, import_ds_system.styled)("div", { name: import_constants.DSMenuItemName, slot: import_constants.DSMenuItemSlots.MENU_ITEM_CONTENT })`
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/styled.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["import type { LayoutProps, SizingProps, PositionProps, SpaceProps } from '@elliemae/ds-system';\nimport { styled, css, xStyledCommonProps } from '@elliemae/ds-system';\nimport { Grid } from '@elliemae/ds-grid';\nimport { DSTypography } from '@elliemae/ds-typography';\nimport { DSMenuItemName, DSMenuItemSlots } from './constants/index.js';\n\n/**\n * Single source for the menu list row height. The option row and the group-label/section row\n * are peers and must stay the same height \u2014 consuming one value keeps them aligned and prevents\n * the kind of drift fixed in PUI-18609 (group label was 24 while options were 32).\n */\nconst MENU_ITEM_ROW_HEIGHT = '32px';\n\nconst borderOutside = () => css`\n :after {\n display: block;\n content: ' ';\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n border: 1px solid ${({ theme }) => theme.colors.brand[500]};\n pointer-events: none;\n z-index: 7;\n }\n`;\n\nconst disabledOption = () => css`\n color: ${({ theme }) => theme.colors.neutral[500]};\n /** Checkbox label has its own color rule (n700 per checkbox spec) so the wrapper's color does not cascade through it\n * The multi-select menu item needs explicit label overrides in both non-hover and hover states. \n */\n label {\n color: ${({ theme }) => theme.colors.neutral[500]};\n }\n :hover {\n color: ${({ theme }) => theme.colors.neutral[600]};\n label {\n color: ${({ theme }) => theme.colors.neutral[600]};\n }\n /** single menu item spec: \n * aria-disabled-selected + hover \u2192 checkmark icon goes from neutral-400 to neutral-500\n * ds-icons sets svg fill via !important internally \u2014 override with same flag at higher specificity\n */\n svg {\n fill: ${({ theme }) => theme.colors.neutral[500]} !important;\n }\n }\n cursor: not-allowed;\n * {\n cursor: not-allowed;\n }\n`;\n\ninterface StyledGlobalMenuItemWrapperT extends LayoutProps, SizingProps, PositionProps, SpaceProps {\n isSelected?: boolean;\n isActive?: boolean;\n disabled?: boolean;\n applyAriaDisabled?: boolean;\n readOnly?: boolean;\n}\n\nexport const StyledGlobalMenuItemWrapper = styled('li', {\n name: DSMenuItemName,\n slot: DSMenuItemSlots.MENU_ITEM_WRAPPER,\n})<StyledGlobalMenuItemWrapperT>`\n cursor: pointer;\n min-height: ${MENU_ITEM_ROW_HEIGHT};\n\n padding-left: 16px;\n padding-right: 16px;\n display: grid;\n align-items: center;\n list-style: none;\n position: relative;\n\n ${(props) => {\n if (props.isActive) return borderOutside();\n return '';\n }};\n\n ${(props) => {\n if (props.disabled || props.applyAriaDisabled || props.readOnly) return disabledOption();\n return '';\n }};\n\n background-color: ${(props) => (props.isActive ? props.theme.colors.brand[200] : props.theme.colors.neutral['000'])};\n\n // focus style for standalone version\n &:focus {\n ${(props) => {\n if (props.disabled) return disabledOption();\n if (!props.disabled) return borderOutside();\n return '';\n }};\n outline: none;\n background-color: ${(props) =>\n !props.disabled ? props.theme.colors.brand[200] : props.theme.colors.neutral['000']};\n }\n &:hover {\n background-color: ${(props) =>\n (!props.disabled || !props.applyAriaDisabled || !props.readOnly) && props.theme.colors.brand[200]};\n }\n\n &[aria-disabled='true'] {\n ${disabledOption()}\n }\n\n ${xStyledCommonProps}\n`;\n\nexport const StyleMenuItemLabel = styled(DSTypography, { name: DSMenuItemName, slot: DSMenuItemSlots.MENU_ITEM_LABEL })`\n padding: 8px 0;\n`;\n\nexport const StyleMenuItemSecondaryLabel = styled('span', {\n name: DSMenuItemName,\n slot: DSMenuItemSlots.MENU_ITEM_SECONDARY_LABEL,\n})<{ disabled?: boolean }>`\n padding: 8px 0;\n font-size: 0.8462rem;\n font-style: italic;\n color: ${(props) => (props.disabled ? props.theme.colors.neutral['500'] : props.theme.colors.brand['800'])};\n text-align: right;\n`;\n\nexport const StyledIconContainer = styled('div', { name: DSMenuItemName, slot: DSMenuItemSlots.MENU_ITEM_ICON })`\n width: 25px;\n height: 24px;\n display: grid;\n grid-template-columns: min-content auto;\n place-items: center;\n`;\n\nexport const StyledEllipsisButton = styled('div', {\n name: DSMenuItemName,\n slot: DSMenuItemSlots.MENU_ITEM_ELLIPSIS_BUTTON,\n})<{ disabled: boolean; applyAriaDisabled: boolean }>`\n position: relative;\n width: 100%;\n height: 100%;\n display: grid;\n place-items: center;\n background: transparent;\n :active {\n ${(props) => (props.disabled || props.applyAriaDisabled ? '' : borderOutside())}\n }\n`;\n\nexport const StyledItemContent = styled('div', { name: DSMenuItemName, slot: DSMenuItemSlots.MENU_ITEM_CONTENT })`\n display: flex;\n width: 100%;\n margin: 8px 0px;\n`;\n\nexport const StyledSeparator = styled('hr', { name: DSMenuItemName, slot: DSMenuItemSlots.MENU_ITEM_SEPARATOR })`\n border: 0;\n border-top: 1px solid #697489;\n margin: 4px 0px;\n padding: 0;\n`;\n\nexport const StyledSeparatorWrapper = styled('li', {\n name: DSMenuItemName,\n slot: DSMenuItemSlots.MENU_ITEM_SEPARATOR_WRAPPER,\n})`\n list-style: none;\n padding: 0px 16px;\n\n ${xStyledCommonProps}\n`;\n\nexport const StyledGroupLabel = styled(DSTypography, {\n name: DSMenuItemName,\n slot: DSMenuItemSlots.MENU_ITEM_GROUP_LABEL,\n})``;\n\n/**\n * The \"section / group label\" row is reimplemented independently in three sibling surfaces, each\n * reaching the same 32px row by a different mechanism \u2014 keep all four in sync (PUI-18609):\n * - ds-form-combobox \u2192 src/parts/Section.tsx (height via label padding + b3-strong line-height)\n * - ds-form-layout-autocomplete \u2192 src/parts/Section.tsx (own StyledSectionWrapper min-height)\n * - ds-menu-button \u2192 parts/DSMenuItemRendererFactory (StyledGroupLabelWrapper min-height)\n * The duplication is intentional (different semantics + slot namespaces) and tracked in each\n * package's KNOWN_INTENTIONAL_DEVIATIONS.md.\n */\nexport const StyledSectionWrapper = styled('li', {\n name: DSMenuItemName,\n slot: DSMenuItemSlots.MENU_ITEM_SECTION_WRAPPER,\n})`\n list-style: none;\n padding: 0px 16px;\n min-height: ${MENU_ITEM_ROW_HEIGHT};\n display: flex;\n align-items: center;\n\n ${xStyledCommonProps}\n`;\n\nexport const StyledVerticalSeparator = styled('div', {\n name: DSMenuItemName,\n slot: DSMenuItemSlots.MENU_ITEM_VERTICAL_SEPARATOR,\n})`\n width: 1px;\n height: 18px;\n background-color: neutral-300;\n`;\n\nexport const StyledContentWrapper = styled(Grid, {\n name: DSMenuItemName,\n slot: DSMenuItemSlots.MENU_ITEM_CONTENT_WRAPPER,\n})``;\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,uBAAgD;AAChD,qBAAqB;AACrB,2BAA6B;AAC7B,uBAAgD;AAOhD,MAAM,uBAAuB;AAE7B,MAAM,gBAAgB,MAAM;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,wBASJ,CAAC,EAAE,MAAM,MAAM,MAAM,OAAO,MAAM,GAAG,CAAC;AAAA;AAAA;AAAA;AAAA;AAM9D,MAAM,iBAAiB,MAAM;AAAA,WAClB,CAAC,EAAE,MAAM,MAAM,MAAM,OAAO,QAAQ,GAAG,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA,aAKtC,CAAC,EAAE,MAAM,MAAM,MAAM,OAAO,QAAQ,GAAG,CAAC;AAAA;AAAA;AAAA,aAGxC,CAAC,EAAE,MAAM,MAAM,MAAM,OAAO,QAAQ,GAAG,CAAC;AAAA;AAAA,eAEtC,CAAC,EAAE,MAAM,MAAM,MAAM,OAAO,QAAQ,GAAG,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,cAOzC,CAAC,E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yBAAO,qBAAM;AAAA,EAC/C,MAAM;AAAA,EACN,MAAM,iCAAgB;AACxB,CAAC;",
4
+ "sourcesContent": ["import type { LayoutProps, SizingProps, PositionProps, SpaceProps } from '@elliemae/ds-system';\nimport { styled, xStyledCommonProps, ariaDisabledInteractionCss } from '@elliemae/ds-system';\nimport { Grid } from '@elliemae/ds-grid';\nimport { DSTypography } from '@elliemae/ds-typography';\nimport { DSMenuItemName, DSMenuItemSlots } from './constants/index.js';\nimport { isAriaDisabledProp, isDisabledProp, isReadOnlyProp, type LockFlagsT } from './lockFlags.js';\nimport { borderOutside, disabledOption, plainLockCss } from './menuItemStateCss.js';\n\n/**\n * Single source for the menu list row height. The option row and the group-label/section row\n * are peers and must stay the same height \u2014 consuming one value keeps them aligned and prevents\n * the kind of drift fixed in PUI-18609 (group label was 24 while options were 32).\n */\nconst MENU_ITEM_ROW_HEIGHT = '32px';\n\ninterface StyledGlobalMenuItemWrapperT extends LayoutProps, SizingProps, PositionProps, SpaceProps, LockFlagsT {\n isSelected?: boolean;\n isActive?: boolean;\n}\n\n/**\n * The lock flags are passed as transient props (`$disabled`, `$applyAriaDisabled`, `$readOnly`) by the menu item\n * packages: styled-components never forwards `$` props to the DOM, so a locked `li` no longer gets a `disabled=\"\"`\n * attribute, which is invalid on a `li`. The plain `disabled` / `applyAriaDisabled` / `readOnly` props are the public\n * API of this exported component: they are still read here and still reach the DOM as before, for external consumers.\n */\nexport const StyledGlobalMenuItemWrapper = styled('li', {\n name: DSMenuItemName,\n slot: DSMenuItemSlots.MENU_ITEM_WRAPPER,\n})<StyledGlobalMenuItemWrapperT>`\n cursor: pointer;\n min-height: ${MENU_ITEM_ROW_HEIGHT};\n\n padding-left: 16px;\n padding-right: 16px;\n display: grid;\n align-items: center;\n list-style: none;\n position: relative;\n\n ${(props) => {\n if (props.isActive) return borderOutside();\n return '';\n }};\n\n ${(props) => {\n if (isDisabledProp(props) || isAriaDisabledProp(props) || isReadOnlyProp(props)) return disabledOption();\n return '';\n }};\n\n background-color: ${(props) => (props.isActive ? props.theme.colors.brand[200] : props.theme.colors.neutral['000'])};\n\n // focus style for standalone version\n // a menu item is a navigation pattern: a disabled item stays keyboard reachable, so its focus must be visible too\n // (the text keeps the disabled colour, the focus ring and background are the same as an enabled item)\n &:focus {\n ${(props) => (isDisabledProp(props) ? disabledOption() : '')};\n ${borderOutside()};\n outline: none;\n background-color: ${({ theme }) => theme.colors.brand[200]};\n }\n &:hover {\n background-color: ${(props) => !isDisabledProp(props) && props.theme.colors.brand[200]};\n }\n\n &[aria-disabled='true'] {\n ${disabledOption()}\n }\n\n ${xStyledCommonProps}\n ${(props) => plainLockCss(props)}\n /* DOM fallback: any wrapper that prints aria-disabled gets the not-allowed cursor, even when plainLockCss did not read\n the flag. It sets the cursor only, so it adds no lock behaviour of its own */\n &&[aria-disabled='true'] {\n ${ariaDisabledInteractionCss}\n }\n`;\n\nexport const StyleMenuItemLabel = styled(DSTypography, { name: DSMenuItemName, slot: DSMenuItemSlots.MENU_ITEM_LABEL })`\n padding: 8px 0;\n`;\n\nexport const StyleMenuItemSecondaryLabel = styled('span', {\n name: DSMenuItemName,\n slot: DSMenuItemSlots.MENU_ITEM_SECONDARY_LABEL,\n})<{ disabled?: boolean; $disabled?: boolean }>`\n padding: 8px 0;\n font-size: 0.8462rem;\n font-style: italic;\n color: ${(props) => (isDisabledProp(props) ? props.theme.colors.neutral['500'] : props.theme.colors.brand['800'])};\n text-align: right;\n`;\n\nexport const StyledIconContainer = styled('div', { name: DSMenuItemName, slot: DSMenuItemSlots.MENU_ITEM_ICON })`\n width: 25px;\n height: 24px;\n display: grid;\n grid-template-columns: min-content auto;\n place-items: center;\n`;\n\n/**\n * Same transition as `StyledGlobalMenuItemWrapper`: the item packages pass `$disabled` / `$applyAriaDisabled`, the\n * plain props stay supported for external consumers. Both spellings are optional: a caller passes only one of them.\n */\nexport const StyledEllipsisButton = styled('div', {\n name: DSMenuItemName,\n slot: DSMenuItemSlots.MENU_ITEM_ELLIPSIS_BUTTON,\n})<{ disabled?: boolean; applyAriaDisabled?: boolean; $disabled?: boolean; $applyAriaDisabled?: boolean }>`\n position: relative;\n width: 100%;\n height: 100%;\n display: grid;\n place-items: center;\n background: transparent;\n :active {\n ${(props) => (isDisabledProp(props) || isAriaDisabledProp(props) ? '' : borderOutside())}\n }\n`;\n\nexport const StyledItemContent = styled('div', { name: DSMenuItemName, slot: DSMenuItemSlots.MENU_ITEM_CONTENT })`\n display: flex;\n width: 100%;\n margin: 8px 0px;\n`;\n\nexport const StyledSeparator = styled('hr', { name: DSMenuItemName, slot: DSMenuItemSlots.MENU_ITEM_SEPARATOR })`\n border: 0;\n border-top: 1px solid #697489;\n margin: 4px 0px;\n padding: 0;\n`;\n\nexport const StyledSeparatorWrapper = styled('li', {\n name: DSMenuItemName,\n slot: DSMenuItemSlots.MENU_ITEM_SEPARATOR_WRAPPER,\n})`\n list-style: none;\n padding: 0px 16px;\n\n ${xStyledCommonProps}\n`;\n\nexport const StyledGroupLabel = styled(DSTypography, {\n name: DSMenuItemName,\n slot: DSMenuItemSlots.MENU_ITEM_GROUP_LABEL,\n})``;\n\n/**\n * The \"section / group label\" row is reimplemented independently in three sibling surfaces, each\n * reaching the same 32px row by a different mechanism \u2014 keep all four in sync (PUI-18609):\n * - ds-form-combobox \u2192 src/parts/Section.tsx (height via label padding + b3-strong line-height)\n * - ds-form-layout-autocomplete \u2192 src/parts/Section.tsx (own StyledSectionWrapper min-height)\n * - ds-menu-button \u2192 parts/DSMenuItemRendererFactory (StyledGroupLabelWrapper min-height)\n * The duplication is intentional (different semantics + slot namespaces) and tracked in each\n * package's KNOWN_INTENTIONAL_DEVIATIONS.md.\n */\nexport const StyledSectionWrapper = styled('li', {\n name: DSMenuItemName,\n slot: DSMenuItemSlots.MENU_ITEM_SECTION_WRAPPER,\n})`\n list-style: none;\n padding: 0px 16px;\n min-height: ${MENU_ITEM_ROW_HEIGHT};\n display: flex;\n align-items: center;\n\n ${xStyledCommonProps}\n`;\n\nexport const StyledVerticalSeparator = styled('div', {\n name: DSMenuItemName,\n slot: DSMenuItemSlots.MENU_ITEM_VERTICAL_SEPARATOR,\n})`\n width: 1px;\n height: 18px;\n background-color: neutral-300;\n`;\n\nexport const StyledContentWrapper = styled(Grid, {\n name: DSMenuItemName,\n slot: DSMenuItemSlots.MENU_ITEM_CONTENT_WRAPPER,\n})``;\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,uBAAuE;AACvE,qBAAqB;AACrB,2BAA6B;AAC7B,uBAAgD;AAChD,uBAAoF;AACpF,8BAA4D;AAO5D,MAAM,uBAAuB;AAatB,MAAM,kCAA8B,yBAAO,MAAM;AAAA,EACtD,MAAM;AAAA,EACN,MAAM,iCAAgB;AACxB,CAAC;AAAA;AAAA,gBAEe,oBAAoB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAShC,CAAC,UAAU;AACX,MAAI,MAAM,SAAU,YAAO,uCAAc;AACzC,SAAO;AACT,CAAC;AAAA;AAAA,IAEC,CAAC,UAAU;AACX,UAAI,iCAAe,KAAK,SAAK,qCAAmB,KAAK,SAAK,iCAAe,KAAK,EAAG,YAAO,wCAAe;AACvG,SAAO;AACT,CAAC;AAAA;AAAA,sBAEmB,CAAC,UAAW,MAAM,WAAW,MAAM,MAAM,OAAO,MAAM,GAAG,IAAI,MAAM,MAAM,OAAO,QAAQ,KAAK,CAAE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MAM/G,CAAC,cAAW,iCAAe,KAAK,QAAI,wCAAe,IAAI,EAAG;AAAA,UAC1D,uCAAc,CAAC;AAAA;AAAA,wBAEG,CAAC,EAAE,MAAM,MAAM,MAAM,OAAO,MAAM,GAAG,CAAC;AAAA;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N,MAAM,iCAAgB;AACxB,CAAC;AAAA;AAAA;AAAA;AAAA,IAIG,mCAAkB;AAAA;AAGf,MAAM,uBAAmB,yBAAO,mCAAc;AAAA,EACnD,MAAM;AAAA,EACN,MAAM,iCAAgB;AACxB,CAAC;AAWM,MAAM,2BAAuB,yBAAO,MAAM;AAAA,EAC/C,MAAM;AAAA,EACN,MAAM,iCAAgB;AACxB,CAAC;AAAA;AAAA;AAAA,gBAGe,oBAAoB;AAAA;AAAA;AAAA;AAAA,IAIhC,mCAAkB;AAAA;AAGf,MAAM,8BAA0B,yBAAO,OAAO;AAAA,EACnD,MAAM;AAAA,EACN,MAAM,iCAAgB;AACxB,CAAC;AAAA;AAAA;AAAA;AAAA;AAMM,MAAM,2BAAuB,yBAAO,qBAAM;AAAA,EAC/C,MAAM;AAAA,EACN,MAAM,iCAAgB;AACxB,CAAC;",
6
6
  "names": []
7
7
  }
@@ -0,0 +1,10 @@
1
+ import * as React from "react";
2
+ const isDisabledProp = ({ disabled, $disabled }) => Boolean(disabled || $disabled);
3
+ const isAriaDisabledProp = ({ applyAriaDisabled, $applyAriaDisabled }) => Boolean(applyAriaDisabled || $applyAriaDisabled);
4
+ const isReadOnlyProp = ({ readOnly, $readOnly }) => Boolean(readOnly || $readOnly);
5
+ export {
6
+ isAriaDisabledProp,
7
+ isDisabledProp,
8
+ isReadOnlyProp
9
+ };
10
+ //# sourceMappingURL=lockFlags.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/lockFlags.ts"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/**\n * Lock flags, read from the transient (`$`) spelling and from the plain one. See `StyledGlobalMenuItemWrapper`.\n */\nexport type LockFlagsT = {\n disabled?: boolean;\n applyAriaDisabled?: boolean;\n readOnly?: boolean;\n $disabled?: boolean;\n $applyAriaDisabled?: boolean;\n $readOnly?: boolean;\n};\nexport const isDisabledProp = ({ disabled, $disabled }: LockFlagsT) => Boolean(disabled || $disabled);\nexport const isAriaDisabledProp = ({ applyAriaDisabled, $applyAriaDisabled }: LockFlagsT) =>\n Boolean(applyAriaDisabled || $applyAriaDisabled);\nexport const isReadOnlyProp = ({ readOnly, $readOnly }: LockFlagsT) => Boolean(readOnly || $readOnly);\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACWhB,MAAM,iBAAiB,CAAC,EAAE,UAAU,UAAU,MAAkB,QAAQ,YAAY,SAAS;AAC7F,MAAM,qBAAqB,CAAC,EAAE,mBAAmB,mBAAmB,MACzE,QAAQ,qBAAqB,kBAAkB;AAC1C,MAAM,iBAAiB,CAAC,EAAE,UAAU,UAAU,MAAkB,QAAQ,YAAY,SAAS;",
6
+ "names": []
7
+ }
@@ -0,0 +1,54 @@
1
+ import * as React from "react";
2
+ import { css, ariaDisabledInteractionCss, disabledInteractionCss } from "@elliemae/ds-system";
3
+ import { isAriaDisabledProp, isDisabledProp, isReadOnlyProp } from "./lockFlags.js";
4
+ const borderOutside = () => css`
5
+ :after {
6
+ display: block;
7
+ content: ' ';
8
+ position: absolute;
9
+ top: 0;
10
+ left: 0;
11
+ right: 0;
12
+ bottom: 0;
13
+ border: 1px solid ${({ theme }) => theme.colors.brand[500]};
14
+ pointer-events: none;
15
+ z-index: 7;
16
+ }
17
+ `;
18
+ const disabledOption = () => css`
19
+ color: ${({ theme }) => theme.colors.neutral[500]};
20
+ /** Checkbox label has its own color rule (n700 per checkbox spec) so the wrapper's color does not cascade through it
21
+ * The multi-select menu item needs explicit label overrides in both non-hover and hover states.
22
+ */
23
+ label {
24
+ color: ${({ theme }) => theme.colors.neutral[500]};
25
+ }
26
+ :hover {
27
+ color: ${({ theme }) => theme.colors.neutral[600]};
28
+ label {
29
+ color: ${({ theme }) => theme.colors.neutral[600]};
30
+ }
31
+ /** single menu item spec:
32
+ * a locked and selected item + hover → the checkmark icon goes from neutral-400 (set by the item) to neutral-500
33
+ * ds-icons sets svg fill via !important internally — override with same flag at higher specificity
34
+ */
35
+ svg {
36
+ fill: ${({ theme }) => theme.colors.neutral[500]} !important;
37
+ }
38
+ }
39
+ /* the element's own not-allowed cursor comes from plainLockCss; the descendants keep theirs here */
40
+ * {
41
+ cursor: not-allowed;
42
+ }
43
+ `;
44
+ const plainLockCss = (props) => {
45
+ if (isDisabledProp(props)) return disabledInteractionCss;
46
+ if (isAriaDisabledProp(props) || isReadOnlyProp(props)) return ariaDisabledInteractionCss;
47
+ return "";
48
+ };
49
+ export {
50
+ borderOutside,
51
+ disabledOption,
52
+ plainLockCss
53
+ };
54
+ //# sourceMappingURL=menuItemStateCss.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/menuItemStateCss.ts"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { css, ariaDisabledInteractionCss, disabledInteractionCss } from '@elliemae/ds-system';\nimport { isAriaDisabledProp, isDisabledProp, isReadOnlyProp, type LockFlagsT } from './lockFlags.js';\n\nexport const borderOutside = () => css`\n :after {\n display: block;\n content: ' ';\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n border: 1px solid ${({ theme }) => theme.colors.brand[500]};\n pointer-events: none;\n z-index: 7;\n }\n`;\n\nexport const disabledOption = () => css`\n color: ${({ theme }) => theme.colors.neutral[500]};\n /** Checkbox label has its own color rule (n700 per checkbox spec) so the wrapper's color does not cascade through it\n * The multi-select menu item needs explicit label overrides in both non-hover and hover states. \n */\n label {\n color: ${({ theme }) => theme.colors.neutral[500]};\n }\n :hover {\n color: ${({ theme }) => theme.colors.neutral[600]};\n label {\n color: ${({ theme }) => theme.colors.neutral[600]};\n }\n /** single menu item spec:\n * a locked and selected item + hover \u2192 the checkmark icon goes from neutral-400 (set by the item) to neutral-500\n * ds-icons sets svg fill via !important internally \u2014 override with same flag at higher specificity\n */\n svg {\n fill: ${({ theme }) => theme.colors.neutral[500]} !important;\n }\n }\n /* the element's own not-allowed cursor comes from plainLockCss; the descendants keep theirs here */\n * {\n cursor: not-allowed;\n }\n`;\n\n// The wrapper's lock style depends on the lock kind (PUI-16695, the contract is in\n// stories/docs/principles/software-design/DisabledAriaDisabledReadOnly.md):\n// - disabled is a hard lock: the wrapper only gets the not-allowed cursor. Its pointer events stay on, and the actions\n// are stopped in JavaScript, not by CSS.\n// - applyAriaDisabled / readOnly are soft locks: the wrapper gets the same cursor, and keeps hover. A soft-locked item\n// with a submenu still opens it (view-only popup).\n// Read from the plain flags (exported API) and the transient ones alike.\nexport const plainLockCss = (props: LockFlagsT) => {\n if (isDisabledProp(props)) return disabledInteractionCss;\n if (isAriaDisabledProp(props) || isReadOnlyProp(props)) return ariaDisabledInteractionCss;\n return '';\n};\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,KAAK,4BAA4B,8BAA8B;AACxE,SAAS,oBAAoB,gBAAgB,sBAAuC;AAE7E,MAAM,gBAAgB,MAAM;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,wBASX,CAAC,EAAE,MAAM,MAAM,MAAM,OAAO,MAAM,GAAG,CAAC;AAAA;AAAA;AAAA;AAAA;AAMvD,MAAM,iBAAiB,MAAM;AAAA,WACzB,CAAC,EAAE,MAAM,MAAM,MAAM,OAAO,QAAQ,GAAG,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA,aAKtC,CAAC,EAAE,MAAM,MAAM,MAAM,OAAO,QAAQ,GAAG,CAAC;AAAA;AAAA;AAAA,aAGxC,CAAC,EAAE,MAAM,MAAM,MAAM,OAAO,QAAQ,GAAG,CAAC;AAAA;AAAA,eAEtC,CAAC,EAAE,MAAM,MAAM,MAAM,OAAO,QAAQ,GAAG,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,cAOzC,CAAC,EAAE,MAAM,MAAM,MAAM,OAAO,QAAQ,GAAG,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAgB/C,MAAM,eAAe,CAAC,UAAsB;AACjD,MAAI,eAAe,KAAK,EAAG,QAAO;AAClC,MAAI,mBAAmB,KAAK,KAAK,eAAe,KAAK,EAAG,QAAO;AAC/D,SAAO;AACT;",
6
+ "names": []
7
+ }
@@ -1,49 +1,11 @@
1
1
  import * as React from "react";
2
- import { styled, css, xStyledCommonProps } from "@elliemae/ds-system";
2
+ import { styled, xStyledCommonProps, ariaDisabledInteractionCss } from "@elliemae/ds-system";
3
3
  import { Grid } from "@elliemae/ds-grid";
4
4
  import { DSTypography } from "@elliemae/ds-typography";
5
5
  import { DSMenuItemName, DSMenuItemSlots } from "./constants/index.js";
6
+ import { isAriaDisabledProp, isDisabledProp, isReadOnlyProp } from "./lockFlags.js";
7
+ import { borderOutside, disabledOption, plainLockCss } from "./menuItemStateCss.js";
6
8
  const MENU_ITEM_ROW_HEIGHT = "32px";
7
- const borderOutside = () => css`
8
- :after {
9
- display: block;
10
- content: ' ';
11
- position: absolute;
12
- top: 0;
13
- left: 0;
14
- right: 0;
15
- bottom: 0;
16
- border: 1px solid ${({ theme }) => theme.colors.brand[500]};
17
- pointer-events: none;
18
- z-index: 7;
19
- }
20
- `;
21
- const disabledOption = () => css`
22
- color: ${({ theme }) => theme.colors.neutral[500]};
23
- /** Checkbox label has its own color rule (n700 per checkbox spec) so the wrapper's color does not cascade through it
24
- * The multi-select menu item needs explicit label overrides in both non-hover and hover states.
25
- */
26
- label {
27
- color: ${({ theme }) => theme.colors.neutral[500]};
28
- }
29
- :hover {
30
- color: ${({ theme }) => theme.colors.neutral[600]};
31
- label {
32
- color: ${({ theme }) => theme.colors.neutral[600]};
33
- }
34
- /** single menu item spec:
35
- * aria-disabled-selected + hover → checkmark icon goes from neutral-400 to neutral-500
36
- * ds-icons sets svg fill via !important internally — override with same flag at higher specificity
37
- */
38
- svg {
39
- fill: ${({ theme }) => theme.colors.neutral[500]} !important;
40
- }
41
- }
42
- cursor: not-allowed;
43
- * {
44
- cursor: not-allowed;
45
- }
46
- `;
47
9
  const StyledGlobalMenuItemWrapper = styled("li", {
48
10
  name: DSMenuItemName,
49
11
  slot: DSMenuItemSlots.MENU_ITEM_WRAPPER
@@ -64,24 +26,23 @@ const StyledGlobalMenuItemWrapper = styled("li", {
64
26
  }};
65
27
 
66
28
  ${(props) => {
67
- if (props.disabled || props.applyAriaDisabled || props.readOnly) return disabledOption();
29
+ if (isDisabledProp(props) || isAriaDisabledProp(props) || isReadOnlyProp(props)) return disabledOption();
68
30
  return "";
69
31
  }};
70
32
 
71
33
  background-color: ${(props) => props.isActive ? props.theme.colors.brand[200] : props.theme.colors.neutral["000"]};
72
34
 
73
35
  // focus style for standalone version
36
+ // a menu item is a navigation pattern: a disabled item stays keyboard reachable, so its focus must be visible too
37
+ // (the text keeps the disabled colour, the focus ring and background are the same as an enabled item)
74
38
  &:focus {
75
- ${(props) => {
76
- if (props.disabled) return disabledOption();
77
- if (!props.disabled) return borderOutside();
78
- return "";
79
- }};
39
+ ${(props) => isDisabledProp(props) ? disabledOption() : ""};
40
+ ${borderOutside()};
80
41
  outline: none;
81
- background-color: ${(props) => !props.disabled ? props.theme.colors.brand[200] : props.theme.colors.neutral["000"]};
42
+ background-color: ${({ theme }) => theme.colors.brand[200]};
82
43
  }
83
44
  &:hover {
84
- background-color: ${(props) => (!props.disabled || !props.applyAriaDisabled || !props.readOnly) && props.theme.colors.brand[200]};
45
+ background-color: ${(props) => !isDisabledProp(props) && props.theme.colors.brand[200]};
85
46
  }
86
47
 
87
48
  &[aria-disabled='true'] {
@@ -89,6 +50,12 @@ const StyledGlobalMenuItemWrapper = styled("li", {
89
50
  }
90
51
 
91
52
  ${xStyledCommonProps}
53
+ ${(props) => plainLockCss(props)}
54
+ /* DOM fallback: any wrapper that prints aria-disabled gets the not-allowed cursor, even when plainLockCss did not read
55
+ the flag. It sets the cursor only, so it adds no lock behaviour of its own */
56
+ &&[aria-disabled='true'] {
57
+ ${ariaDisabledInteractionCss}
58
+ }
92
59
  `;
93
60
  const StyleMenuItemLabel = styled(DSTypography, { name: DSMenuItemName, slot: DSMenuItemSlots.MENU_ITEM_LABEL })`
94
61
  padding: 8px 0;
@@ -100,7 +67,7 @@ const StyleMenuItemSecondaryLabel = styled("span", {
100
67
  padding: 8px 0;
101
68
  font-size: 0.8462rem;
102
69
  font-style: italic;
103
- color: ${(props) => props.disabled ? props.theme.colors.neutral["500"] : props.theme.colors.brand["800"]};
70
+ color: ${(props) => isDisabledProp(props) ? props.theme.colors.neutral["500"] : props.theme.colors.brand["800"]};
104
71
  text-align: right;
105
72
  `;
106
73
  const StyledIconContainer = styled("div", { name: DSMenuItemName, slot: DSMenuItemSlots.MENU_ITEM_ICON })`
@@ -121,7 +88,7 @@ const StyledEllipsisButton = styled("div", {
121
88
  place-items: center;
122
89
  background: transparent;
123
90
  :active {
124
- ${(props) => props.disabled || props.applyAriaDisabled ? "" : borderOutside()}
91
+ ${(props) => isDisabledProp(props) || isAriaDisabledProp(props) ? "" : borderOutside()}
125
92
  }
126
93
  `;
127
94
  const StyledItemContent = styled("div", { name: DSMenuItemName, slot: DSMenuItemSlots.MENU_ITEM_CONTENT })`
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/styled.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import type { LayoutProps, SizingProps, PositionProps, SpaceProps } from '@elliemae/ds-system';\nimport { styled, css, xStyledCommonProps } from '@elliemae/ds-system';\nimport { Grid } from '@elliemae/ds-grid';\nimport { DSTypography } from '@elliemae/ds-typography';\nimport { DSMenuItemName, DSMenuItemSlots } from './constants/index.js';\n\n/**\n * Single source for the menu list row height. The option row and the group-label/section row\n * are peers and must stay the same height \u2014 consuming one value keeps them aligned and prevents\n * the kind of drift fixed in PUI-18609 (group label was 24 while options were 32).\n */\nconst MENU_ITEM_ROW_HEIGHT = '32px';\n\nconst borderOutside = () => css`\n :after {\n display: block;\n content: ' ';\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n border: 1px solid ${({ theme }) => theme.colors.brand[500]};\n pointer-events: none;\n z-index: 7;\n }\n`;\n\nconst disabledOption = () => css`\n color: ${({ theme }) => theme.colors.neutral[500]};\n /** Checkbox label has its own color rule (n700 per checkbox spec) so the wrapper's color does not cascade through it\n * The multi-select menu item needs explicit label overrides in both non-hover and hover states. \n */\n label {\n color: ${({ theme }) => theme.colors.neutral[500]};\n }\n :hover {\n color: ${({ theme }) => theme.colors.neutral[600]};\n label {\n color: ${({ theme }) => theme.colors.neutral[600]};\n }\n /** single menu item spec: \n * aria-disabled-selected + hover \u2192 checkmark icon goes from neutral-400 to neutral-500\n * ds-icons sets svg fill via !important internally \u2014 override with same flag at higher specificity\n */\n svg {\n fill: ${({ theme }) => theme.colors.neutral[500]} !important;\n }\n }\n cursor: not-allowed;\n * {\n cursor: not-allowed;\n }\n`;\n\ninterface StyledGlobalMenuItemWrapperT extends LayoutProps, SizingProps, PositionProps, SpaceProps {\n isSelected?: boolean;\n isActive?: boolean;\n disabled?: boolean;\n applyAriaDisabled?: boolean;\n readOnly?: boolean;\n}\n\nexport const StyledGlobalMenuItemWrapper = styled('li', {\n name: DSMenuItemName,\n slot: DSMenuItemSlots.MENU_ITEM_WRAPPER,\n})<StyledGlobalMenuItemWrapperT>`\n cursor: pointer;\n min-height: ${MENU_ITEM_ROW_HEIGHT};\n\n padding-left: 16px;\n padding-right: 16px;\n display: grid;\n align-items: center;\n list-style: none;\n position: relative;\n\n ${(props) => {\n if (props.isActive) return borderOutside();\n return '';\n }};\n\n ${(props) => {\n if (props.disabled || props.applyAriaDisabled || props.readOnly) return disabledOption();\n return '';\n }};\n\n background-color: ${(props) => (props.isActive ? props.theme.colors.brand[200] : props.theme.colors.neutral['000'])};\n\n // focus style for standalone version\n &:focus {\n ${(props) => {\n if (props.disabled) return disabledOption();\n if (!props.disabled) return borderOutside();\n return '';\n }};\n outline: none;\n background-color: ${(props) =>\n !props.disabled ? props.theme.colors.brand[200] : props.theme.colors.neutral['000']};\n }\n &:hover {\n background-color: ${(props) =>\n (!props.disabled || !props.applyAriaDisabled || !props.readOnly) && props.theme.colors.brand[200]};\n }\n\n &[aria-disabled='true'] {\n ${disabledOption()}\n }\n\n ${xStyledCommonProps}\n`;\n\nexport const StyleMenuItemLabel = styled(DSTypography, { name: DSMenuItemName, slot: DSMenuItemSlots.MENU_ITEM_LABEL })`\n padding: 8px 0;\n`;\n\nexport const StyleMenuItemSecondaryLabel = styled('span', {\n name: DSMenuItemName,\n slot: DSMenuItemSlots.MENU_ITEM_SECONDARY_LABEL,\n})<{ disabled?: boolean }>`\n padding: 8px 0;\n font-size: 0.8462rem;\n font-style: italic;\n color: ${(props) => (props.disabled ? props.theme.colors.neutral['500'] : props.theme.colors.brand['800'])};\n text-align: right;\n`;\n\nexport const StyledIconContainer = styled('div', { name: DSMenuItemName, slot: DSMenuItemSlots.MENU_ITEM_ICON })`\n width: 25px;\n height: 24px;\n display: grid;\n grid-template-columns: min-content auto;\n place-items: center;\n`;\n\nexport const StyledEllipsisButton = styled('div', {\n name: DSMenuItemName,\n slot: DSMenuItemSlots.MENU_ITEM_ELLIPSIS_BUTTON,\n})<{ disabled: boolean; applyAriaDisabled: boolean }>`\n position: relative;\n width: 100%;\n height: 100%;\n display: grid;\n place-items: center;\n background: transparent;\n :active {\n ${(props) => (props.disabled || props.applyAriaDisabled ? '' : borderOutside())}\n }\n`;\n\nexport const StyledItemContent = styled('div', { name: DSMenuItemName, slot: DSMenuItemSlots.MENU_ITEM_CONTENT })`\n display: flex;\n width: 100%;\n margin: 8px 0px;\n`;\n\nexport const StyledSeparator = styled('hr', { name: DSMenuItemName, slot: DSMenuItemSlots.MENU_ITEM_SEPARATOR })`\n border: 0;\n border-top: 1px solid #697489;\n margin: 4px 0px;\n padding: 0;\n`;\n\nexport const StyledSeparatorWrapper = styled('li', {\n name: DSMenuItemName,\n slot: DSMenuItemSlots.MENU_ITEM_SEPARATOR_WRAPPER,\n})`\n list-style: none;\n padding: 0px 16px;\n\n ${xStyledCommonProps}\n`;\n\nexport const StyledGroupLabel = styled(DSTypography, {\n name: DSMenuItemName,\n slot: DSMenuItemSlots.MENU_ITEM_GROUP_LABEL,\n})``;\n\n/**\n * The \"section / group label\" row is reimplemented independently in three sibling surfaces, each\n * reaching the same 32px row by a different mechanism \u2014 keep all four in sync (PUI-18609):\n * - ds-form-combobox \u2192 src/parts/Section.tsx (height via label padding + b3-strong line-height)\n * - ds-form-layout-autocomplete \u2192 src/parts/Section.tsx (own StyledSectionWrapper min-height)\n * - ds-menu-button \u2192 parts/DSMenuItemRendererFactory (StyledGroupLabelWrapper min-height)\n * The duplication is intentional (different semantics + slot namespaces) and tracked in each\n * package's KNOWN_INTENTIONAL_DEVIATIONS.md.\n */\nexport const StyledSectionWrapper = styled('li', {\n name: DSMenuItemName,\n slot: DSMenuItemSlots.MENU_ITEM_SECTION_WRAPPER,\n})`\n list-style: none;\n padding: 0px 16px;\n min-height: ${MENU_ITEM_ROW_HEIGHT};\n display: flex;\n align-items: center;\n\n ${xStyledCommonProps}\n`;\n\nexport const StyledVerticalSeparator = styled('div', {\n name: DSMenuItemName,\n slot: DSMenuItemSlots.MENU_ITEM_VERTICAL_SEPARATOR,\n})`\n width: 1px;\n height: 18px;\n background-color: neutral-300;\n`;\n\nexport const StyledContentWrapper = styled(Grid, {\n name: DSMenuItemName,\n slot: DSMenuItemSlots.MENU_ITEM_CONTENT_WRAPPER,\n})``;\n"],
5
- "mappings": "AAAA,YAAY,WAAW;ACCvB,SAAS,QAAQ,KAAK,0BAA0B;AAChD,SAAS,YAAY;AACrB,SAAS,oBAAoB;AAC7B,SAAS,gBAAgB,uBAAuB;AAOhD,MAAM,uBAAuB;AAE7B,MAAM,gBAAgB,MAAM;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,wBASJ,CAAC,EAAE,MAAM,MAAM,MAAM,OAAO,MAAM,GAA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;AAAA,IAIG,kBAAkB;AAAA;AAGf,MAAM,mBAAmB,OAAO,cAAc;AAAA,EACnD,MAAM;AAAA,EACN,MAAM,gBAAgB;AACxB,CAAC;AAWM,MAAM,uBAAuB,OAAO,MAAM;AAAA,EAC/C,MAAM;AAAA,EACN,MAAM,gBAAgB;AACxB,CAAC;AAAA;AAAA;AAAA,gBAGe,oBAAoB;AAAA;AAAA;AAAA;AAAA,IAIhC,kBAAkB;AAAA;AAGf,MAAM,0BAA0B,OAAO,OAAO;AAAA,EACnD,MAAM;AAAA,EACN,MAAM,gBAAgB;AACxB,CAAC;AAAA;AAAA;AAAA;AAAA;AAMM,MAAM,uBAAuB,OAAO,MAAM;AAAA,EAC/C,MAAM;AAAA,EACN,MAAM,gBAAgB;AACxB,CAAC;",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import type { LayoutProps, SizingProps, PositionProps, SpaceProps } from '@elliemae/ds-system';\nimport { styled, xStyledCommonProps, ariaDisabledInteractionCss } from '@elliemae/ds-system';\nimport { Grid } from '@elliemae/ds-grid';\nimport { DSTypography } from '@elliemae/ds-typography';\nimport { DSMenuItemName, DSMenuItemSlots } from './constants/index.js';\nimport { isAriaDisabledProp, isDisabledProp, isReadOnlyProp, type LockFlagsT } from './lockFlags.js';\nimport { borderOutside, disabledOption, plainLockCss } from './menuItemStateCss.js';\n\n/**\n * Single source for the menu list row height. The option row and the group-label/section row\n * are peers and must stay the same height \u2014 consuming one value keeps them aligned and prevents\n * the kind of drift fixed in PUI-18609 (group label was 24 while options were 32).\n */\nconst MENU_ITEM_ROW_HEIGHT = '32px';\n\ninterface StyledGlobalMenuItemWrapperT extends LayoutProps, SizingProps, PositionProps, SpaceProps, LockFlagsT {\n isSelected?: boolean;\n isActive?: boolean;\n}\n\n/**\n * The lock flags are passed as transient props (`$disabled`, `$applyAriaDisabled`, `$readOnly`) by the menu item\n * packages: styled-components never forwards `$` props to the DOM, so a locked `li` no longer gets a `disabled=\"\"`\n * attribute, which is invalid on a `li`. The plain `disabled` / `applyAriaDisabled` / `readOnly` props are the public\n * API of this exported component: they are still read here and still reach the DOM as before, for external consumers.\n */\nexport const StyledGlobalMenuItemWrapper = styled('li', {\n name: DSMenuItemName,\n slot: DSMenuItemSlots.MENU_ITEM_WRAPPER,\n})<StyledGlobalMenuItemWrapperT>`\n cursor: pointer;\n min-height: ${MENU_ITEM_ROW_HEIGHT};\n\n padding-left: 16px;\n padding-right: 16px;\n display: grid;\n align-items: center;\n list-style: none;\n position: relative;\n\n ${(props) => {\n if (props.isActive) return borderOutside();\n return '';\n }};\n\n ${(props) => {\n if (isDisabledProp(props) || isAriaDisabledProp(props) || isReadOnlyProp(props)) return disabledOption();\n return '';\n }};\n\n background-color: ${(props) => (props.isActive ? props.theme.colors.brand[200] : props.theme.colors.neutral['000'])};\n\n // focus style for standalone version\n // a menu item is a navigation pattern: a disabled item stays keyboard reachable, so its focus must be visible too\n // (the text keeps the disabled colour, the focus ring and background are the same as an enabled item)\n &:focus {\n ${(props) => (isDisabledProp(props) ? disabledOption() : '')};\n ${borderOutside()};\n outline: none;\n background-color: ${({ theme }) => theme.colors.brand[200]};\n }\n &:hover {\n background-color: ${(props) => !isDisabledProp(props) && props.theme.colors.brand[200]};\n }\n\n &[aria-disabled='true'] {\n ${disabledOption()}\n }\n\n ${xStyledCommonProps}\n ${(props) => plainLockCss(props)}\n /* DOM fallback: any wrapper that prints aria-disabled gets the not-allowed cursor, even when plainLockCss did not read\n the flag. It sets the cursor only, so it adds no lock behaviour of its own */\n &&[aria-disabled='true'] {\n ${ariaDisabledInteractionCss}\n }\n`;\n\nexport const StyleMenuItemLabel = styled(DSTypography, { name: DSMenuItemName, slot: DSMenuItemSlots.MENU_ITEM_LABEL })`\n padding: 8px 0;\n`;\n\nexport const StyleMenuItemSecondaryLabel = styled('span', {\n name: DSMenuItemName,\n slot: DSMenuItemSlots.MENU_ITEM_SECONDARY_LABEL,\n})<{ disabled?: boolean; $disabled?: boolean }>`\n padding: 8px 0;\n font-size: 0.8462rem;\n font-style: italic;\n color: ${(props) => (isDisabledProp(props) ? props.theme.colors.neutral['500'] : props.theme.colors.brand['800'])};\n text-align: right;\n`;\n\nexport const StyledIconContainer = styled('div', { name: DSMenuItemName, slot: DSMenuItemSlots.MENU_ITEM_ICON })`\n width: 25px;\n height: 24px;\n display: grid;\n grid-template-columns: min-content auto;\n place-items: center;\n`;\n\n/**\n * Same transition as `StyledGlobalMenuItemWrapper`: the item packages pass `$disabled` / `$applyAriaDisabled`, the\n * plain props stay supported for external consumers. Both spellings are optional: a caller passes only one of them.\n */\nexport const StyledEllipsisButton = styled('div', {\n name: DSMenuItemName,\n slot: DSMenuItemSlots.MENU_ITEM_ELLIPSIS_BUTTON,\n})<{ disabled?: boolean; applyAriaDisabled?: boolean; $disabled?: boolean; $applyAriaDisabled?: boolean }>`\n position: relative;\n width: 100%;\n height: 100%;\n display: grid;\n place-items: center;\n background: transparent;\n :active {\n ${(props) => (isDisabledProp(props) || isAriaDisabledProp(props) ? '' : borderOutside())}\n }\n`;\n\nexport const StyledItemContent = styled('div', { name: DSMenuItemName, slot: DSMenuItemSlots.MENU_ITEM_CONTENT })`\n display: flex;\n width: 100%;\n margin: 8px 0px;\n`;\n\nexport const StyledSeparator = styled('hr', { name: DSMenuItemName, slot: DSMenuItemSlots.MENU_ITEM_SEPARATOR })`\n border: 0;\n border-top: 1px solid #697489;\n margin: 4px 0px;\n padding: 0;\n`;\n\nexport const StyledSeparatorWrapper = styled('li', {\n name: DSMenuItemName,\n slot: DSMenuItemSlots.MENU_ITEM_SEPARATOR_WRAPPER,\n})`\n list-style: none;\n padding: 0px 16px;\n\n ${xStyledCommonProps}\n`;\n\nexport const StyledGroupLabel = styled(DSTypography, {\n name: DSMenuItemName,\n slot: DSMenuItemSlots.MENU_ITEM_GROUP_LABEL,\n})``;\n\n/**\n * The \"section / group label\" row is reimplemented independently in three sibling surfaces, each\n * reaching the same 32px row by a different mechanism \u2014 keep all four in sync (PUI-18609):\n * - ds-form-combobox \u2192 src/parts/Section.tsx (height via label padding + b3-strong line-height)\n * - ds-form-layout-autocomplete \u2192 src/parts/Section.tsx (own StyledSectionWrapper min-height)\n * - ds-menu-button \u2192 parts/DSMenuItemRendererFactory (StyledGroupLabelWrapper min-height)\n * The duplication is intentional (different semantics + slot namespaces) and tracked in each\n * package's KNOWN_INTENTIONAL_DEVIATIONS.md.\n */\nexport const StyledSectionWrapper = styled('li', {\n name: DSMenuItemName,\n slot: DSMenuItemSlots.MENU_ITEM_SECTION_WRAPPER,\n})`\n list-style: none;\n padding: 0px 16px;\n min-height: ${MENU_ITEM_ROW_HEIGHT};\n display: flex;\n align-items: center;\n\n ${xStyledCommonProps}\n`;\n\nexport const StyledVerticalSeparator = styled('div', {\n name: DSMenuItemName,\n slot: DSMenuItemSlots.MENU_ITEM_VERTICAL_SEPARATOR,\n})`\n width: 1px;\n height: 18px;\n background-color: neutral-300;\n`;\n\nexport const StyledContentWrapper = styled(Grid, {\n name: DSMenuItemName,\n slot: DSMenuItemSlots.MENU_ITEM_CONTENT_WRAPPER,\n})``;\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACCvB,SAAS,QAAQ,oBAAoB,kCAAkC;AACvE,SAAS,YAAY;AACrB,SAAS,oBAAoB;AAC7B,SAAS,gBAAgB,uBAAuB;AAChD,SAAS,oBAAoB,gBAAgB,sBAAuC;AACpF,SAAS,eAAe,gBAAgB,oBAAoB;AAO5D,MAAM,uBAAuB;AAatB,MAAM,8BAA8B,OAAO,MAAM;AAAA,EACtD,MAAM;AAAA,EACN,MAAM,gBAAgB;AACxB,CAAC;AAAA;AAAA,gBAEe,oBAAoB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAShC,CAAC,UAAU;AACX,MAAI,MAAM,SAAU,QAAO,cAAc;AACzC,SAAO;AACT,CAAC;AAAA;AAAA,IAEC,CAAC,UAAU;AACX,MAAI,eAAe,KAAK,KAAK,mBAAmB,KAAK,KAAK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W,eAAe,KAAK,KAAK,mBAAmB,KAAK,IAAI,KAAK,cAAc,CAAE;AAAA;AAAA;AAIrF,MAAM,oBAAoB,OAAO,OAAO,EAAE,MAAM,gBAAgB,MAAM,gBAAgB,kBAAkB,CAAC;AAAA;AAAA;AAAA;AAAA;AAMzG,MAAM,kBAAkB,OAAO,MAAM,EAAE,MAAM,gBAAgB,MAAM,gBAAgB,oBAAoB,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAOxG,MAAM,yBAAyB,OAAO,MAAM;AAAA,EACjD,MAAM;AAAA,EACN,MAAM,gBAAgB;AACxB,CAAC;AAAA;AAAA;AAAA;AAAA,IAIG,kBAAkB;AAAA;AAGf,MAAM,mBAAmB,OAAO,cAAc;AAAA,EACnD,MAAM;AAAA,EACN,MAAM,gBAAgB;AACxB,CAAC;AAWM,MAAM,uBAAuB,OAAO,MAAM;AAAA,EAC/C,MAAM;AAAA,EACN,MAAM,gBAAgB;AACxB,CAAC;AAAA;AAAA;AAAA,gBAGe,oBAAoB;AAAA;AAAA;AAAA;AAAA,IAIhC,kBAAkB;AAAA;AAGf,MAAM,0BAA0B,OAAO,OAAO;AAAA,EACnD,MAAM;AAAA,EACN,MAAM,gBAAgB;AACxB,CAAC;AAAA;AAAA;AAAA;AAAA;AAMM,MAAM,uBAAuB,OAAO,MAAM;AAAA,EAC/C,MAAM;AAAA,EACN,MAAM,gBAAgB;AACxB,CAAC;",
6
6
  "names": []
7
7
  }
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Lock flags, read from the transient (`$`) spelling and from the plain one. See `StyledGlobalMenuItemWrapper`.
3
+ */
4
+ export type LockFlagsT = {
5
+ disabled?: boolean;
6
+ applyAriaDisabled?: boolean;
7
+ readOnly?: boolean;
8
+ $disabled?: boolean;
9
+ $applyAriaDisabled?: boolean;
10
+ $readOnly?: boolean;
11
+ };
12
+ export declare const isDisabledProp: ({ disabled, $disabled }: LockFlagsT) => boolean;
13
+ export declare const isAriaDisabledProp: ({ applyAriaDisabled, $applyAriaDisabled }: LockFlagsT) => boolean;
14
+ export declare const isReadOnlyProp: ({ readOnly, $readOnly }: LockFlagsT) => boolean;
@@ -0,0 +1,4 @@
1
+ import { type LockFlagsT } from './lockFlags.js';
2
+ export declare const borderOutside: () => import("styled-components").FlattenInterpolation<import("styled-components").ThemeProps<import("@xstyled/system").Theme>>;
3
+ export declare const disabledOption: () => import("styled-components").FlattenInterpolation<import("styled-components").ThemeProps<import("@xstyled/system").Theme>>;
4
+ export declare const plainLockCss: (props: LockFlagsT) => "" | import("styled-components").FlattenSimpleInterpolation;
@@ -1,20 +1,31 @@
1
1
  import type { LayoutProps, SizingProps, PositionProps, SpaceProps } from '@elliemae/ds-system';
2
- interface StyledGlobalMenuItemWrapperT extends LayoutProps, SizingProps, PositionProps, SpaceProps {
2
+ import { type LockFlagsT } from './lockFlags.js';
3
+ interface StyledGlobalMenuItemWrapperT extends LayoutProps, SizingProps, PositionProps, SpaceProps, LockFlagsT {
3
4
  isSelected?: boolean;
4
5
  isActive?: boolean;
5
- disabled?: boolean;
6
- applyAriaDisabled?: boolean;
7
- readOnly?: boolean;
8
6
  }
7
+ /**
8
+ * The lock flags are passed as transient props (`$disabled`, `$applyAriaDisabled`, `$readOnly`) by the menu item
9
+ * packages: styled-components never forwards `$` props to the DOM, so a locked `li` no longer gets a `disabled=""`
10
+ * attribute, which is invalid on a `li`. The plain `disabled` / `applyAriaDisabled` / `readOnly` props are the public
11
+ * API of this exported component: they are still read here and still reach the DOM as before, for external consumers.
12
+ */
9
13
  export declare const StyledGlobalMenuItemWrapper: import("styled-components").StyledComponent<"li", import("@elliemae/ds-system").Theme, StyledGlobalMenuItemWrapperT & import("@elliemae/ds-system").OwnerInterface & import("@elliemae/ds-system").InnerRefInterface<"li">, never>;
10
14
  export declare const StyleMenuItemLabel: import("styled-components").StyledComponent<import("react").FC<import("@elliemae/ds-typography").DSTypographyT.Props>, import("@elliemae/ds-system").Theme, object & import("@elliemae/ds-system").OwnerInterface & import("@elliemae/ds-system").InnerRefInterface<import("react").FC<import("@elliemae/ds-typography").DSTypographyT.Props>>, never>;
11
15
  export declare const StyleMenuItemSecondaryLabel: import("styled-components").StyledComponent<"span", import("@elliemae/ds-system").Theme, {
12
16
  disabled?: boolean;
17
+ $disabled?: boolean;
13
18
  } & import("@elliemae/ds-system").OwnerInterface & import("@elliemae/ds-system").InnerRefInterface<"span">, never>;
14
19
  export declare const StyledIconContainer: import("styled-components").StyledComponent<"div", import("@elliemae/ds-system").Theme, object & import("@elliemae/ds-system").OwnerInterface & import("@elliemae/ds-system").InnerRefInterface<"div">, never>;
20
+ /**
21
+ * Same transition as `StyledGlobalMenuItemWrapper`: the item packages pass `$disabled` / `$applyAriaDisabled`, the
22
+ * plain props stay supported for external consumers. Both spellings are optional: a caller passes only one of them.
23
+ */
15
24
  export declare const StyledEllipsisButton: import("styled-components").StyledComponent<"div", import("@elliemae/ds-system").Theme, {
16
- disabled: boolean;
17
- applyAriaDisabled: boolean;
25
+ disabled?: boolean;
26
+ applyAriaDisabled?: boolean;
27
+ $disabled?: boolean;
28
+ $applyAriaDisabled?: boolean;
18
29
  } & import("@elliemae/ds-system").OwnerInterface & import("@elliemae/ds-system").InnerRefInterface<"div">, never>;
19
30
  export declare const StyledItemContent: import("styled-components").StyledComponent<"div", import("@elliemae/ds-system").Theme, object & import("@elliemae/ds-system").OwnerInterface & import("@elliemae/ds-system").InnerRefInterface<"div">, never>;
20
31
  export declare const StyledSeparator: import("styled-components").StyledComponent<"hr", import("@elliemae/ds-system").Theme, object & import("@elliemae/ds-system").OwnerInterface & import("@elliemae/ds-system").InnerRefInterface<"hr">, never>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elliemae/ds-menu-items-commons",
3
- "version": "3.80.0-next.72",
3
+ "version": "3.80.0-next.76",
4
4
  "license": "MIT",
5
5
  "description": "ICE MT - Dimsum - Menu Items Commons",
6
6
  "files": [
@@ -36,13 +36,13 @@
36
36
  "indent": 4
37
37
  },
38
38
  "dependencies": {
39
- "@elliemae/ds-grid": "3.80.0-next.72",
40
- "@elliemae/ds-props-helpers": "3.80.0-next.72",
41
- "@elliemae/ds-system": "3.80.0-next.72",
42
- "@elliemae/ds-typography": "3.80.0-next.72"
39
+ "@elliemae/ds-grid": "3.80.0-next.76",
40
+ "@elliemae/ds-props-helpers": "3.80.0-next.76",
41
+ "@elliemae/ds-system": "3.80.0-next.76",
42
+ "@elliemae/ds-typography": "3.80.0-next.76"
43
43
  },
44
44
  "devDependencies": {
45
- "@elliemae/ds-monorepo-devops": "3.80.0-next.72",
45
+ "@elliemae/ds-monorepo-devops": "3.80.0-next.76",
46
46
  "jest": "^30.0.0",
47
47
  "lodash-es": "^4.18.1",
48
48
  "styled-components": "~5.3.11"