@astryxdesign/core 0.7.6-canary.9d2de2d → 0.7.6-canary.9efcc3a
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/CodeBlock/CodeBlock.d.ts.map +1 -1
- package/dist/CodeBlock/CodeBlock.js +24 -5
- package/dist/Collapsible/Collapsible.d.ts.map +1 -1
- package/dist/Collapsible/Collapsible.js +23 -3
- package/dist/ContextMenu/ContextMenu.d.ts +6 -0
- package/dist/ContextMenu/ContextMenu.d.ts.map +1 -1
- package/dist/ContextMenu/ContextMenu.js +31 -7
- package/dist/DropdownMenu/DropdownMenu.d.ts +1 -1
- package/dist/DropdownMenu/DropdownMenu.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenu.js +6 -61
- package/dist/DropdownMenu/DropdownMenuCheckboxItem.d.ts +3 -2
- package/dist/DropdownMenu/DropdownMenuCheckboxItem.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenuCheckboxItem.js +4 -3
- package/dist/DropdownMenu/DropdownMenuItem.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenuItem.js +4 -3
- package/dist/DropdownMenu/DropdownMenuRadioItem.d.ts +4 -3
- package/dist/DropdownMenu/DropdownMenuRadioItem.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenuRadioItem.js +4 -3
- package/dist/DropdownMenu/DropdownMenuSubMenu.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenuSubMenu.js +9 -5
- package/dist/Field/inputDisabledFocus.d.ts +5 -1
- package/dist/Field/inputDisabledFocus.d.ts.map +1 -1
- package/dist/Field/inputDisabledFocus.js +6 -1
- package/dist/Grid/GridSpan.d.ts +2 -0
- package/dist/Grid/GridSpan.d.ts.map +1 -1
- package/dist/Grid/GridSpan.js +2 -0
- package/dist/Heading/Heading.d.ts +5 -3
- package/dist/Heading/Heading.d.ts.map +1 -1
- package/dist/Heading/Heading.js +5 -3
- package/dist/Layer/useLayer.d.ts +8 -0
- package/dist/Layer/useLayer.d.ts.map +1 -1
- package/dist/Layer/useLayer.js +6 -4
- package/dist/Resizable/resizableModel.d.ts +64 -0
- package/dist/Resizable/resizableModel.d.ts.map +1 -0
- package/dist/Resizable/resizableModel.js +287 -0
- package/dist/Resizable/useResizable.d.ts +2 -2
- package/dist/Resizable/useResizable.d.ts.map +1 -1
- package/dist/Resizable/useResizable.js +1 -284
- package/dist/SegmentedControl/SegmentedControl.d.ts +7 -5
- package/dist/SegmentedControl/SegmentedControl.d.ts.map +1 -1
- package/dist/SegmentedControl/SegmentedControl.js +13 -20
- package/dist/SegmentedControl/SegmentedControlContext.d.ts +2 -9
- package/dist/SegmentedControl/SegmentedControlContext.d.ts.map +1 -1
- package/dist/SegmentedControl/SegmentedControlItem.d.ts.map +1 -1
- package/dist/SegmentedControl/SegmentedControlItem.js +4 -14
- package/dist/SideNav/SideNav.d.ts.map +1 -1
- package/dist/SideNav/SideNav.js +126 -5
- package/dist/SideNav/SideNavCollapseButton.d.ts.map +1 -1
- package/dist/SideNav/SideNavCollapseButton.js +11 -2
- package/dist/SideNav/SideNavFocusTargetsContext.d.ts +11 -0
- package/dist/SideNav/SideNavFocusTargetsContext.d.ts.map +1 -0
- package/dist/SideNav/SideNavFocusTargetsContext.js +16 -0
- package/dist/SideNav/SideNavHeading.js +6 -2
- package/dist/SideNav/SideNavItem.d.ts.map +1 -1
- package/dist/SideNav/SideNavItem.js +13 -1
- package/dist/SideNav/railMotion.d.ts +5 -5
- package/dist/SideNav/railMotion.d.ts.map +1 -1
- package/dist/SideNav/railMotion.js +69 -177
- package/dist/Token/Token.d.ts.map +1 -1
- package/dist/Token/Token.js +2 -0
- package/dist/Token/TokenLink.d.ts +9 -2
- package/dist/Token/TokenLink.d.ts.map +1 -1
- package/dist/Token/TokenLink.js +2 -0
- package/dist/Tokenizer/Tokenizer.d.ts +9 -3
- package/dist/Tokenizer/Tokenizer.d.ts.map +1 -1
- package/dist/Tokenizer/Tokenizer.js +8 -3
- package/dist/TopNav/TopNavHeading.d.ts.map +1 -1
- package/dist/TopNav/TopNavHeading.js +8 -2
- package/dist/Typeahead/BaseTypeahead.d.ts +4 -4
- package/dist/Typeahead/BaseTypeahead.d.ts.map +1 -1
- package/dist/Typeahead/BaseTypeahead.js +28 -0
- package/dist/Typeahead/Typeahead.d.ts +10 -6
- package/dist/Typeahead/Typeahead.d.ts.map +1 -1
- package/dist/Typeahead/Typeahead.disabled.a11y.chromium.spec.d.ts.map +1 -0
- package/dist/Typeahead/Typeahead.js +9 -7
- package/dist/astryx.css +3 -0
- package/dist/hooks/useFocusTrap.d.ts.map +1 -1
- package/dist/hooks/useFocusTrap.js +2 -3
- package/dist/hooks/useListFocus.d.ts +18 -7
- package/dist/hooks/useListFocus.d.ts.map +1 -1
- package/dist/hooks/useListFocus.js +37 -19
- package/dist/i18n/generated-locales/af-ZA.generated.d.ts.map +1 -1
- package/dist/i18n/generated-locales/af-ZA.generated.js +2 -2
- package/dist/i18n/generated-locales/ar-SA.generated.d.ts.map +1 -1
- package/dist/i18n/generated-locales/ar-SA.generated.js +2 -2
- package/dist/i18n/generated-locales/ca-ES.generated.d.ts.map +1 -1
- package/dist/i18n/generated-locales/ca-ES.generated.js +2 -2
- package/dist/i18n/generated-locales/cs-CZ.generated.d.ts.map +1 -1
- package/dist/i18n/generated-locales/cs-CZ.generated.js +2 -2
- package/dist/i18n/generated-locales/da-DK.generated.d.ts.map +1 -1
- package/dist/i18n/generated-locales/da-DK.generated.js +2 -2
- package/dist/i18n/generated-locales/de-DE.generated.d.ts.map +1 -1
- package/dist/i18n/generated-locales/de-DE.generated.js +2 -2
- package/dist/i18n/generated-locales/el-GR.generated.d.ts.map +1 -1
- package/dist/i18n/generated-locales/el-GR.generated.js +2 -2
- package/dist/i18n/generated-locales/en.generated.d.ts.map +1 -1
- package/dist/i18n/generated-locales/en.generated.js +2 -2
- package/dist/i18n/generated-locales/es-ES.generated.d.ts.map +1 -1
- package/dist/i18n/generated-locales/es-ES.generated.js +2 -2
- package/dist/i18n/generated-locales/fi-FI.generated.d.ts.map +1 -1
- package/dist/i18n/generated-locales/fi-FI.generated.js +2 -2
- package/dist/i18n/generated-locales/fr-FR.generated.d.ts.map +1 -1
- package/dist/i18n/generated-locales/fr-FR.generated.js +2 -2
- package/dist/i18n/generated-locales/he-IL.generated.d.ts.map +1 -1
- package/dist/i18n/generated-locales/he-IL.generated.js +2 -2
- package/dist/i18n/generated-locales/hu-HU.generated.d.ts.map +1 -1
- package/dist/i18n/generated-locales/hu-HU.generated.js +2 -2
- package/dist/i18n/generated-locales/it-IT.generated.d.ts.map +1 -1
- package/dist/i18n/generated-locales/it-IT.generated.js +2 -2
- package/dist/i18n/generated-locales/ja-JP.generated.d.ts.map +1 -1
- package/dist/i18n/generated-locales/ja-JP.generated.js +2 -2
- package/dist/i18n/generated-locales/ko-KR.generated.d.ts.map +1 -1
- package/dist/i18n/generated-locales/ko-KR.generated.js +2 -2
- package/dist/i18n/generated-locales/nl-NL.generated.d.ts.map +1 -1
- package/dist/i18n/generated-locales/nl-NL.generated.js +2 -2
- package/dist/i18n/generated-locales/no-NO.generated.d.ts.map +1 -1
- package/dist/i18n/generated-locales/no-NO.generated.js +2 -2
- package/dist/i18n/generated-locales/pl-PL.generated.d.ts.map +1 -1
- package/dist/i18n/generated-locales/pl-PL.generated.js +2 -2
- package/dist/i18n/generated-locales/pseudo.generated.d.ts.map +1 -1
- package/dist/i18n/generated-locales/pseudo.generated.js +2 -2
- package/dist/i18n/generated-locales/pt-BR.generated.d.ts.map +1 -1
- package/dist/i18n/generated-locales/pt-BR.generated.js +2 -2
- package/dist/i18n/generated-locales/pt-PT.generated.d.ts.map +1 -1
- package/dist/i18n/generated-locales/pt-PT.generated.js +2 -2
- package/dist/i18n/generated-locales/ro-RO.generated.d.ts.map +1 -1
- package/dist/i18n/generated-locales/ro-RO.generated.js +2 -2
- package/dist/i18n/generated-locales/ru-RU.generated.d.ts.map +1 -1
- package/dist/i18n/generated-locales/ru-RU.generated.js +2 -2
- package/dist/i18n/generated-locales/sr-SP.generated.d.ts.map +1 -1
- package/dist/i18n/generated-locales/sr-SP.generated.js +2 -2
- package/dist/i18n/generated-locales/sv-SE.generated.d.ts.map +1 -1
- package/dist/i18n/generated-locales/sv-SE.generated.js +2 -2
- package/dist/i18n/generated-locales/tr-TR.generated.d.ts.map +1 -1
- package/dist/i18n/generated-locales/tr-TR.generated.js +2 -2
- package/dist/i18n/generated-locales/uk-UA.generated.d.ts.map +1 -1
- package/dist/i18n/generated-locales/uk-UA.generated.js +2 -2
- package/dist/i18n/generated-locales/vi-VN.generated.d.ts.map +1 -1
- package/dist/i18n/generated-locales/vi-VN.generated.js +2 -2
- package/dist/i18n/generated-locales/zh-CN.generated.d.ts.map +1 -1
- package/dist/i18n/generated-locales/zh-CN.generated.js +2 -2
- package/dist/i18n/generated-locales/zh-TW.generated.d.ts.map +1 -1
- package/dist/i18n/generated-locales/zh-TW.generated.js +2 -2
- package/dist/motion/animatedLayout.d.ts +130 -5
- package/dist/motion/animatedLayout.d.ts.map +1 -1
- package/dist/motion/animatedLayout.js +771 -44
- package/dist/motion/animator.d.ts.map +1 -1
- package/dist/motion/animator.js +69 -3
- package/dist/utils/accessibleName.d.ts +8 -0
- package/dist/utils/accessibleName.d.ts.map +1 -0
- package/dist/utils/accessibleName.js +72 -0
- package/dist/utils/focusReturn.d.ts +35 -2
- package/dist/utils/focusReturn.d.ts.map +1 -1
- package/dist/utils/focusReturn.js +53 -2
- package/dist/utils/useFocusLeavingChange.d.ts +13 -0
- package/dist/utils/useFocusLeavingChange.d.ts.map +1 -0
- package/dist/utils/useFocusLeavingChange.js +48 -0
- package/locales/af-ZA.json +2 -2
- package/locales/ar-SA.json +2 -2
- package/locales/ca-ES.json +2 -2
- package/locales/cs-CZ.json +2 -2
- package/locales/da-DK.json +2 -2
- package/locales/de-DE.json +2 -2
- package/locales/el-GR.json +2 -2
- package/locales/en.json +4 -4
- package/locales/es-ES.json +2 -2
- package/locales/fi-FI.json +2 -2
- package/locales/fr-FR.json +2 -2
- package/locales/he-IL.json +2 -2
- package/locales/hu-HU.json +2 -2
- package/locales/it-IT.json +2 -2
- package/locales/ja-JP.json +2 -2
- package/locales/ko-KR.json +2 -2
- package/locales/nl-NL.json +2 -2
- package/locales/no-NO.json +2 -2
- package/locales/pl-PL.json +2 -2
- package/locales/pseudo.json +2 -2
- package/locales/pt-BR.json +2 -2
- package/locales/pt-PT.json +2 -2
- package/locales/ro-RO.json +2 -2
- package/locales/ru-RU.json +2 -2
- package/locales/sr-SP.json +2 -2
- package/locales/sv-SE.json +2 -2
- package/locales/tr-TR.json +2 -2
- package/locales/uk-UA.json +2 -2
- package/locales/vi-VN.json +2 -2
- package/locales/zh-CN.json +2 -2
- package/locales/zh-TW.json +2 -2
- package/package.json +4 -4
- package/src/CodeBlock/CodeBlock.tsx +6 -2
- package/src/Collapsible/Collapsible.tsx +33 -4
- package/src/ContextMenu/ContextMenu.tsx +30 -6
- package/src/DropdownMenu/DropdownMenu.doc.mjs +2 -2
- package/src/DropdownMenu/DropdownMenu.tsx +5 -75
- package/src/DropdownMenu/DropdownMenuCheckboxItem.doc.mjs +2 -2
- package/src/DropdownMenu/DropdownMenuCheckboxItem.tsx +15 -5
- package/src/DropdownMenu/DropdownMenuItem.tsx +7 -1
- package/src/DropdownMenu/DropdownMenuRadioItem.doc.mjs +2 -2
- package/src/DropdownMenu/DropdownMenuRadioItem.tsx +16 -6
- package/src/DropdownMenu/DropdownMenuSubMenu.tsx +8 -3
- package/src/Field/inputDisabledFocus.ts +15 -1
- package/src/Grid/GridSpan.doc.mjs +51 -2
- package/src/Grid/GridSpan.tsx +2 -0
- package/src/Heading/Heading.tsx +5 -3
- package/src/Layer/useLayer.tsx +23 -4
- package/src/Resizable/resizableModel.ts +364 -0
- package/src/Resizable/useResizable.ts +17 -348
- package/src/SegmentedControl/SegmentedControl.doc.mjs +5 -5
- package/src/SegmentedControl/SegmentedControl.tsx +23 -30
- package/src/SegmentedControl/SegmentedControlContext.ts +2 -9
- package/src/SegmentedControl/SegmentedControlItem.doc.mjs +1 -1
- package/src/SegmentedControl/SegmentedControlItem.tsx +4 -17
- package/src/SideNav/SideNav.tsx +182 -6
- package/src/SideNav/SideNavCollapseButton.tsx +18 -2
- package/src/SideNav/SideNavFocusTargetsContext.ts +29 -0
- package/src/SideNav/SideNavHeading.tsx +2 -2
- package/src/SideNav/SideNavItem.tsx +19 -3
- package/src/SideNav/railMotion.ts +73 -179
- package/src/Text/Heading.doc.mjs +49 -0
- package/src/Token/Token.tsx +2 -0
- package/src/Token/TokenLink.tsx +16 -1
- package/src/Tokenizer/Tokenizer.doc.mjs +4 -3
- package/src/Tokenizer/Tokenizer.tsx +17 -4
- package/src/TopNav/TopNavHeading.tsx +8 -2
- package/src/Typeahead/BaseTypeahead.tsx +32 -4
- package/src/Typeahead/Typeahead.doc.mjs +3 -2
- package/src/Typeahead/Typeahead.tsx +17 -11
- package/src/hooks/useFocusTrap.ts +2 -8
- package/src/hooks/useListFocus.ts +66 -23
- package/src/i18n/generated-locales/af-ZA.generated.ts +3 -2
- package/src/i18n/generated-locales/ar-SA.generated.ts +3 -2
- package/src/i18n/generated-locales/ca-ES.generated.ts +3 -2
- package/src/i18n/generated-locales/cs-CZ.generated.ts +3 -2
- package/src/i18n/generated-locales/da-DK.generated.ts +3 -2
- package/src/i18n/generated-locales/de-DE.generated.ts +3 -2
- package/src/i18n/generated-locales/el-GR.generated.ts +3 -2
- package/src/i18n/generated-locales/en.generated.ts +3 -2
- package/src/i18n/generated-locales/es-ES.generated.ts +3 -2
- package/src/i18n/generated-locales/fi-FI.generated.ts +3 -2
- package/src/i18n/generated-locales/fr-FR.generated.ts +3 -2
- package/src/i18n/generated-locales/he-IL.generated.ts +3 -2
- package/src/i18n/generated-locales/hu-HU.generated.ts +3 -2
- package/src/i18n/generated-locales/it-IT.generated.ts +3 -2
- package/src/i18n/generated-locales/ja-JP.generated.ts +3 -2
- package/src/i18n/generated-locales/ko-KR.generated.ts +3 -2
- package/src/i18n/generated-locales/nl-NL.generated.ts +3 -2
- package/src/i18n/generated-locales/no-NO.generated.ts +3 -2
- package/src/i18n/generated-locales/pl-PL.generated.ts +3 -2
- package/src/i18n/generated-locales/pseudo.generated.ts +3 -2
- package/src/i18n/generated-locales/pt-BR.generated.ts +3 -2
- package/src/i18n/generated-locales/pt-PT.generated.ts +3 -2
- package/src/i18n/generated-locales/ro-RO.generated.ts +3 -2
- package/src/i18n/generated-locales/ru-RU.generated.ts +3 -2
- package/src/i18n/generated-locales/sr-SP.generated.ts +3 -2
- package/src/i18n/generated-locales/sv-SE.generated.ts +3 -2
- package/src/i18n/generated-locales/tr-TR.generated.ts +3 -2
- package/src/i18n/generated-locales/uk-UA.generated.ts +3 -2
- package/src/i18n/generated-locales/vi-VN.generated.ts +3 -2
- package/src/i18n/generated-locales/zh-CN.generated.ts +3 -2
- package/src/i18n/generated-locales/zh-TW.generated.ts +3 -2
- package/src/motion/animatedLayout.ts +977 -45
- package/src/motion/animator.ts +81 -11
- package/src/utils/accessibleName.ts +87 -0
- package/src/utils/focusReturn.ts +67 -2
- package/src/utils/useFocusLeavingChange.ts +53 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CodeBlock.d.ts","sourceRoot":"","sources":["../../src/CodeBlock/CodeBlock.tsx"],"names":[],"mappings":"AAoBA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AA2B5C,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,WAAW,CAAC;AAY5C,OAAO,EAAc,KAAK,qBAAqB,EAAC,MAAM,iBAAiB,CAAC;AAuexE,MAAM,WAAW,cAAe,SAAQ,SAAS,CAAC,cAAc,CAAC;IAC/D,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;IAChC,IAAI,EAAE,MAAM,CAAC;IACb;;;;;;;OA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B,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IACnB;;;;;;OAMG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;;;;;;OAQG;IACH,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC/B;;;;;OAKG;IACH,SAAS,CAAC,EAAE,CACV,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,MAAM,KACb;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAC,EAAE,CAAC;IAClD,aAAa,CAAC,EAAE,MAAM,GAAG,QAAQ,GAAG,OAAO,CAAC;IAC5C;;;;;;OAMG;IACH,WAAW,CAAC,EAAE,qBAAqB,CAAC;CACrC;AAgUD;;;;;;;;GAQG;AACH,wBAAgB,SAAS,CAAC,EACxB,IAAI,EACJ,QAAsB,EACtB,KAAK,EACL,gBAAuB,EACvB,cAAsB,EACtB,cAAc,EACd,MAAc,EACd,aAAoB,EACpB,MAAM,EACN,UAAU,EACV,SAAiB,EACjB,SAAS,EACT,aAAqB,EACrB,oBAAyB,EACzB,IAAW,EACX,KAAK,EAAE,SAAyB,EAChC,SAAkB,EAClB,SAAS,EAAE,eAAe,EAC1B,aAAsB,EACtB,WAAW,EACX,MAAM,EACN,SAAS,EACT,KAAK,EACL,GAAG,EACH,GAAG,KAAK,EACT,EAAE,cAAc,qBAkThB;yBA5Ue,SAAS"}
|
|
@@ -13,7 +13,7 @@ import * as React from 'react';
|
|
|
13
13
|
import * as stylex from '@stylexjs/stylex';
|
|
14
14
|
import "../theme/tokens.stylex.js";
|
|
15
15
|
import { colorVars, spacingVars, radiusVars, typographyVars, fontWeightVars, typeScaleVars, borderVars, durationVars, easeVars } from "../theme/tokens.stylex.js";
|
|
16
|
-
import { isRenderable, mergeProps } from "../utils/index.js";
|
|
16
|
+
import { isRenderable, mergeProps, rtlStyles } from "../utils/index.js";
|
|
17
17
|
import { useClipboard } from "../hooks/useClipboard.js";
|
|
18
18
|
import { useScrollableArea } from "../hooks/useScrollableArea.js";
|
|
19
19
|
import { Icon } from "../Icon/index.js";
|
|
@@ -104,6 +104,21 @@ const styles = {
|
|
|
104
104
|
k9WMMc: "x1yc453h",
|
|
105
105
|
$$css: true
|
|
106
106
|
},
|
|
107
|
+
collapseChevron: {
|
|
108
|
+
k1xSpc: "x3nfvp2",
|
|
109
|
+
kGNEyG: "x6s0dn4",
|
|
110
|
+
kjj79g: "xl56j7k",
|
|
111
|
+
kmuXW: "x2lah0s",
|
|
112
|
+
kzqmXN: "x6jxa94",
|
|
113
|
+
kZKoxP: "x1v9usgg",
|
|
114
|
+
k71WvV: "xnur1sd",
|
|
115
|
+
kVQacm: "xb3r6kr",
|
|
116
|
+
kMwMTN: "x1mjzq1q",
|
|
117
|
+
kKVMdj: "x1gbn2au x1aquc0h",
|
|
118
|
+
k44tkh: "x12wqnr7",
|
|
119
|
+
kyAemX: "x128ha8g",
|
|
120
|
+
$$css: true
|
|
121
|
+
},
|
|
107
122
|
collapseChevronIcon: {
|
|
108
123
|
k1ekBW: "x11xpdln",
|
|
109
124
|
kIyJzY: "xuedmi6",
|
|
@@ -714,10 +729,14 @@ export function CodeBlock({
|
|
|
714
729
|
}), {
|
|
715
730
|
className: "x78zum5 x6s0dn4 x141an7d x9m5x89 x1e4wzip x1mjzq1q x1ghz6dp x1ltkj2j"
|
|
716
731
|
}),
|
|
717
|
-
children: [canCollapse &&
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
732
|
+
children: [canCollapse &&
|
|
733
|
+
/*#__PURE__*/
|
|
734
|
+
// The collapsed chevron points toward the inline end, so it mirrors
|
|
735
|
+
// in RTL (design:bidirectionality DR4). The mirror sits on this box
|
|
736
|
+
// so the glyph's own rotation still eases: rotated down when
|
|
737
|
+
// expanded, a mirrored glyph still points down.
|
|
738
|
+
_jsx("span", {
|
|
739
|
+
...stylex.props(styles.collapseChevron, rtlStyles.mirror),
|
|
721
740
|
children: /*#__PURE__*/_jsx(Icon, {
|
|
722
741
|
icon: "chevronRight",
|
|
723
742
|
size: "xsm",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Collapsible.d.ts","sourceRoot":"","sources":["../../src/Collapsible/Collapsible.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,EAQL,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"Collapsible.d.ts","sourceRoot":"","sources":["../../src/Collapsible/Collapsible.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,EAQL,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAuBf,OAAO,EAML,KAAK,cAAc,EACpB,MAAM,0BAA0B,CAAC;AAElC,OAAO,KAAK,EAAC,0BAA0B,EAAC,MAAM,2BAA2B,CAAC;AAG1E,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AA0J5C,MAAM,WAAW,gBAAiB,SAAQ,SAAS;IACjD,wCAAwC;IACxC,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;IAChC;;;OAGG;IACH,OAAO,EAAE,SAAS,CAAC;IAEnB;;OAEG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;IAErB;;;;OAIG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IAExB;;;OAGG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IAEjB;;;;;;;;OAQG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IAErB;;;OAGG;IACH,YAAY,CAAC,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,IAAI,CAAC;IACzC;;;;OAIG;IACH,cAAc,CAAC,EAAE,cAAc,CAAC;IAEhC;;;;;;;;;;;;OAYG;IACH,eAAe,CAAC,EAAE,0BAA0B,CAAC;IAE7C;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,wBAAgB,WAAW,CAAC,EAC1B,OAAO,EACP,QAAQ,EACR,aAAa,EACb,MAAM,EAAE,gBAAgB,EACxB,UAAkB,EAClB,YAAY,EACZ,eAAe,EACf,KAAK,EACL,cAAc,EACd,GAAG,EACH,MAAM,EACN,SAAS,EACT,KAAK,EACL,GAAG,KAAK,EACT,EAAE,gBAAgB,+BAwPlB;yBAvQe,WAAW"}
|
|
@@ -32,6 +32,10 @@ import "../theme/tokens.stylex.js";
|
|
|
32
32
|
import { borderVars, colorVars, typographyVars, fontWeightVars, spacingVars, typeScaleVars, durationVars, easeVars } from "../theme/tokens.stylex.js";
|
|
33
33
|
import { useCollapsible } from "./useCollapsible.js";
|
|
34
34
|
import { LayoutChangeSnapshot } from "../motion/LayoutChangeSnapshot.js";
|
|
35
|
+
import { moveFocusLeftBehind, noteFocusWithin } from "../utils/focusReturn.js";
|
|
36
|
+
import { useInteractionModalityTracking } from "../utils/interactionModality.js";
|
|
37
|
+
import { useFocusLeavingChange } from "../utils/useFocusLeavingChange.js";
|
|
38
|
+
import { useMergedRefs } from "../hooks/useMergedRefs.js";
|
|
35
39
|
import { applyLayoutChangeTransition, holdLayoutExit, playLayoutChange, releaseLayoutExit, reportLayoutChange } from "../motion/animatedLayout.js";
|
|
36
40
|
import { CollapsibleGroupPresentationContext } from "./CollapsibleGroupContext.js";
|
|
37
41
|
import { Icon } from "../Icon/index.js";
|
|
@@ -303,6 +307,22 @@ export function Collapsible({
|
|
|
303
307
|
}
|
|
304
308
|
}, [isOpen, isExiting]);
|
|
305
309
|
|
|
310
|
+
// Focus inside the content when it closes would be lost to the page once
|
|
311
|
+
// the content hides. It moves to the trigger that closes it (AR4); focus
|
|
312
|
+
// anywhere else is not moved. The shared sequence notes it in the commit
|
|
313
|
+
// before the DOM changes and moves it once the close has committed.
|
|
314
|
+
// The trigger's own document's last input decides the moved focus's ring.
|
|
315
|
+
const {
|
|
316
|
+
ref: modalityRef
|
|
317
|
+
} = useInteractionModalityTracking();
|
|
318
|
+
const mergedTriggerRef = useMergedRefs(triggerRef, modalityRef);
|
|
319
|
+
const noteClosingFocus = useFocusLeavingChange(isOpen, wasOpen => wasOpen ? noteFocusWithin(contentRef.current) : null, focus => moveFocusLeftBehind(focus, triggerRef.current, contentRef.current));
|
|
320
|
+
const beforeOpenChange = useCallback(wasOpen => {
|
|
321
|
+
noteClosingFocus(wasOpen);
|
|
322
|
+
if (animatedLayout != null) {
|
|
323
|
+
measureChange();
|
|
324
|
+
}
|
|
325
|
+
}, [animatedLayout, measureChange, noteClosingFocus]);
|
|
306
326
|
// Activation is blocked by this guard rather than the native `disabled`
|
|
307
327
|
// attribute, so the trigger keeps `aria-disabled` semantics and stays
|
|
308
328
|
// discoverable. A native `disabled` button would silently swallow events
|
|
@@ -349,7 +369,7 @@ export function Collapsible({
|
|
|
349
369
|
}), stylex.props(styles.root, isDivided && styles.divided, xstyle), className, style),
|
|
350
370
|
...props,
|
|
351
371
|
children: [/*#__PURE__*/_jsxs("button", {
|
|
352
|
-
ref:
|
|
372
|
+
ref: mergedTriggerRef,
|
|
353
373
|
type: "button",
|
|
354
374
|
onClick: handleToggle,
|
|
355
375
|
"aria-disabled": isDisabled || undefined,
|
|
@@ -379,9 +399,9 @@ export function Collapsible({
|
|
|
379
399
|
},
|
|
380
400
|
children: trigger
|
|
381
401
|
}), !isChevronAtStart && chevron]
|
|
382
|
-
}),
|
|
402
|
+
}), /*#__PURE__*/_jsx(LayoutChangeSnapshot, {
|
|
383
403
|
value: isOpen,
|
|
384
|
-
onBeforeChange:
|
|
404
|
+
onBeforeChange: beforeOpenChange
|
|
385
405
|
}), /*#__PURE__*/_jsx("div", {
|
|
386
406
|
ref: contentRef,
|
|
387
407
|
id: contentId,
|
|
@@ -19,6 +19,12 @@
|
|
|
19
19
|
*
|
|
20
20
|
* Both modes use useListFocus for DOM-based keyboard navigation.
|
|
21
21
|
* Open state is managed internally — right-click opens, click-outside/Escape closes.
|
|
22
|
+
* The menu's layer mounts at its first open, and shows as it attaches
|
|
23
|
+
* (`useLayer`'s `lazyMount`, kept mounted after the first show): a closed
|
|
24
|
+
* context menu that was never opened adds no popover element to the page (a
|
|
25
|
+
* table with a menu on every cell would otherwise carry one per cell). Once
|
|
26
|
+
* mounted it stays, so every later open and close, its exit animation
|
|
27
|
+
* included, runs as before.
|
|
22
28
|
* The trigger wrapper is a `div` by default; `triggerAs` makes it an inline
|
|
23
29
|
* `span`, so a reference inside prose can own a context menu without
|
|
24
30
|
* breaking the text flow.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContextMenu.d.ts","sourceRoot":"","sources":["../../src/ContextMenu/ContextMenu.tsx"],"names":[],"mappings":"AAGA
|
|
1
|
+
{"version":3,"file":"ContextMenu.d.ts","sourceRoot":"","sources":["../../src/ContextMenu/ContextMenu.tsx"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AAEH,OAAO,KASN,MAAM,OAAO,CAAC;AACf,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,OAAO,CAAC;AAuCrC,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAC5C,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,gBAAgB,CAAC;AAGjD,OAAO,KAAK,EACV,kBAAkB,EAClB,oBAAoB,EACpB,uBAAuB,EACvB,mBAAmB,EACpB,MAAM,8BAA8B,CAAC;AAGtC,OAAO,EAEL,KAAK,oBAAoB,EAC1B,MAAM,kCAAkC,CAAC;AAyH1C,MAAM,MAAM,mBAAmB,GAAG,oBAAoB,CAAC;AAEvD,MAAM,MAAM,sBAAsB,GAAG,uBAAuB,CAAC;AAE7D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KAAK,EAAE,cAAc,EACrB,UAAkB,EAClB,YAAY,EACZ,YAAwB,EACxB,SAAiB,EACjB,GAAG,EACH,SAAS,EACT,KAAK,EACL,MAAM,EACN,aAAa,EACb,aAAa,EAAE,iBAAiB,EAChC,YAAY,EAAE,gBAAgB,EAC9B,WAAW,EAAE,eAAe,EAC5B,UAAU,EAAE,cAAc,EAC1B,aAAa,EAAE,iBAAiB,EAChC,aAAa,EAAE,MAAM,EACrB,GAAG,IAAI,EACR,EAAE,gBAAgB,qBAgjBlB;yBArkBe,WAAW"}
|
|
@@ -22,6 +22,12 @@
|
|
|
22
22
|
*
|
|
23
23
|
* Both modes use useListFocus for DOM-based keyboard navigation.
|
|
24
24
|
* Open state is managed internally — right-click opens, click-outside/Escape closes.
|
|
25
|
+
* The menu's layer mounts at its first open, and shows as it attaches
|
|
26
|
+
* (`useLayer`'s `lazyMount`, kept mounted after the first show): a closed
|
|
27
|
+
* context menu that was never opened adds no popover element to the page (a
|
|
28
|
+
* table with a menu on every cell would otherwise carry one per cell). Once
|
|
29
|
+
* mounted it stays, so every later open and close, its exit animation
|
|
30
|
+
* included, runs as before.
|
|
25
31
|
* The trigger wrapper is a `div` by default; `triggerAs` makes it an inline
|
|
26
32
|
* `span`, so a reference inside prose can own a context menu without
|
|
27
33
|
* breaking the text flow.
|
|
@@ -38,7 +44,7 @@ import * as stylex from '@stylexjs/stylex';
|
|
|
38
44
|
import { Button } from "../Button/index.js";
|
|
39
45
|
import { Heading } from "../Heading/index.js";
|
|
40
46
|
import { Icon } from "../Icon/index.js";
|
|
41
|
-
import {
|
|
47
|
+
import { useLayerInternal } from "../Layer/useLayer.js";
|
|
42
48
|
import { LayerDepthProvider } from "../Layer/LayerDepthContext.js";
|
|
43
49
|
import { useLayerDismissal } from "../Layer/useLayerDismissal.js";
|
|
44
50
|
import { currentGesture } from "../Layer/gestureCounter.js";
|
|
@@ -49,7 +55,7 @@ import { DropdownMenuContext, DropdownMenuRootOpenContext } from "../DropdownMen
|
|
|
49
55
|
import { MENU_ITEM_ROLES, MENU_ITEM_SELECTOR, MENU_BOUNDARY_SELECTOR, activateMenuItem } from "../DropdownMenu/menuItemRoles.js";
|
|
50
56
|
import { useMenuOverflow } from "../DropdownMenu/useMenuOverflow.js";
|
|
51
57
|
import { useMenuDrillIn } from "../DropdownMenu/useMenuDrillIn.js";
|
|
52
|
-
import {
|
|
58
|
+
import { useInternalListFocus } from "../hooks/useListFocus.js";
|
|
53
59
|
import { useMenuPress } from "../hooks/useMenuPress.js";
|
|
54
60
|
import { useTypeahead } from "../hooks/useTypeahead.js";
|
|
55
61
|
import { useLongPress } from "../hooks/useLongPress.js";
|
|
@@ -251,6 +257,10 @@ export function ContextMenu({
|
|
|
251
257
|
// outside.
|
|
252
258
|
const openingGestureRef = useRef(null);
|
|
253
259
|
const [isOpen, setIsOpen] = useState(false);
|
|
260
|
+
// An open from the trigger moves focus into the menu once it shows: a frame
|
|
261
|
+
// after the show, which for a first open comes as its layer attaches.
|
|
262
|
+
const focusOnShowRef = useRef(false);
|
|
263
|
+
const focusFirstRef = useRef(() => {});
|
|
254
264
|
const [submenuPath, setSubmenuPath] = useState([]);
|
|
255
265
|
const currentSubmenu = submenuPath.at(-1);
|
|
256
266
|
const currentItems = currentSubmenu?.items ?? items;
|
|
@@ -263,8 +273,11 @@ export function ContextMenu({
|
|
|
263
273
|
setIsOpen(nextIsOpen);
|
|
264
274
|
onOpenChange?.(nextIsOpen);
|
|
265
275
|
}, [onOpenChange]);
|
|
266
|
-
const layer =
|
|
276
|
+
const layer = useLayerInternal({
|
|
267
277
|
mode: 'context',
|
|
278
|
+
// Mounted at the first open and kept (see the file header).
|
|
279
|
+
lazyMount: true,
|
|
280
|
+
keepsMountAfterShow: true,
|
|
268
281
|
onHide: useCallback(() => {
|
|
269
282
|
setIsOpen(false);
|
|
270
283
|
onOpenChange?.(false);
|
|
@@ -278,6 +291,10 @@ export function ContextMenu({
|
|
|
278
291
|
onShow: useCallback(() => {
|
|
279
292
|
setIsOpen(true);
|
|
280
293
|
onOpenChange?.(true);
|
|
294
|
+
if (focusOnShowRef.current) {
|
|
295
|
+
focusOnShowRef.current = false;
|
|
296
|
+
requestAnimationFrame(() => focusFirstRef.current());
|
|
297
|
+
}
|
|
281
298
|
}, [onOpenChange]),
|
|
282
299
|
lightDismiss: false
|
|
283
300
|
});
|
|
@@ -311,13 +328,17 @@ export function ContextMenu({
|
|
|
311
328
|
focusItem,
|
|
312
329
|
ownsEvent,
|
|
313
330
|
getItems: getMenuItems
|
|
314
|
-
} =
|
|
331
|
+
} = useInternalListFocus({
|
|
315
332
|
itemSelector: MENU_ITEM_SELECTOR,
|
|
316
333
|
boundarySelector: MENU_BOUNDARY_SELECTOR,
|
|
317
334
|
// Menus wrap from the last row to the first and back.
|
|
318
335
|
wrap: true,
|
|
319
|
-
hasPaging: true
|
|
336
|
+
hasPaging: true,
|
|
337
|
+
// A right-click or long-press focuses the first row without the keyboard
|
|
338
|
+
// ring; the context-menu key or Shift+F10 shows it.
|
|
339
|
+
focusFollowsLastInput: true
|
|
320
340
|
});
|
|
341
|
+
focusFirstRef.current = focusFirst;
|
|
321
342
|
|
|
322
343
|
// Join the shared stack so an Escape press dismisses exactly one top-most
|
|
323
344
|
// surface. BottomSheet owns its own dismissal path.
|
|
@@ -433,10 +454,13 @@ export function ContextMenu({
|
|
|
433
454
|
if (usesBottomSheet) {
|
|
434
455
|
updateOpenState(true);
|
|
435
456
|
} else {
|
|
457
|
+
// A first open mounts the layer, and the show runs from the popover
|
|
458
|
+
// element's callback ref as it attaches, in the same commit, before
|
|
459
|
+
// the browser paints; a later one shows at once.
|
|
460
|
+
focusOnShowRef.current = true;
|
|
436
461
|
layer.show();
|
|
437
|
-
requestAnimationFrame(() => focusFirst());
|
|
438
462
|
}
|
|
439
|
-
}, [layer,
|
|
463
|
+
}, [layer, updateOpenState, usesBottomSheet]);
|
|
440
464
|
|
|
441
465
|
// The box the cursor anchor's offsets are measured from: the trigger, which
|
|
442
466
|
// is its containing block.
|
|
@@ -80,7 +80,7 @@ export type DropdownMenuOption = DropdownMenuItemData | DropdownMenuDividerData
|
|
|
80
80
|
export type DropdownMenuButtonProps = Omit<ButtonProps, 'onClick'>;
|
|
81
81
|
export type DropdownMenuPresentation = AdaptivePresentation;
|
|
82
82
|
/**
|
|
83
|
-
* The props
|
|
83
|
+
* The props `renderTrigger` spreads onto the control that opens the menu.
|
|
84
84
|
* They carry the press model — a mouse opens on press-down, a held finger
|
|
85
85
|
* opens with the finger down — the keyboard opens (Enter, Space, ArrowDown,
|
|
86
86
|
* ArrowUp), the toggle click, and the ARIA wiring that names the menu after
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DropdownMenu.d.ts","sourceRoot":"","sources":["../../src/DropdownMenu/DropdownMenu.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAEH,OAAO,KAAK,EAAE,EAOZ,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"DropdownMenu.d.ts","sourceRoot":"","sources":["../../src/DropdownMenu/DropdownMenu.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAEH,OAAO,KAAK,EAAE,EAOZ,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAIf,OAAO,EAAS,KAAK,WAAW,EAAC,MAAM,WAAW,CAAC;AAKnD,OAAO,KAAK,EAAC,qBAAqB,EAAC,MAAM,oBAAoB,CAAC;AA+B9D,OAAO,EAEL,KAAK,oBAAoB,EAC1B,MAAM,kCAAkC,CAAC;AAS1C,OAAO,KAAK,EAAC,cAAc,EAAE,cAAc,EAAC,MAAM,mBAAmB,CAAC;AAStE,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAqL5C;;;;;;;GAOG;AACH,MAAM,WAAW,oBAAqB,SAAQ,IAAI,CAChD,qBAAqB,EACnB,MAAM,GACN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CACtB;AAED,UAAU,yBAA0B,SAAQ,qBAAqB;IAC/D,YAAY,CAAC,EAAE,SAAS,CAAC;IACzB,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED,MAAM,MAAM,iBAAiB,GAC3B,qBAAqB,GAAG,yBAAyB,CAAC;AA+tCpD,wBAAgB,YAAY,CAAC,KAAK,EAAE,iBAAiB,qBA4CpD;yBA5Ce,YAAY"}
|
|
@@ -35,6 +35,7 @@
|
|
|
35
35
|
* - /packages/cli/assets/templates/blocks/components/DropdownMenu/ (showcase blocks)
|
|
36
36
|
*/
|
|
37
37
|
import React, { useCallback, useEffect, useId, useMemo, useRef, useState } from 'react';
|
|
38
|
+
import { readAccessibleName } from "../utils/accessibleName.js";
|
|
38
39
|
import * as stylex from '@stylexjs/stylex';
|
|
39
40
|
import { usePopover } from "../Popover/usePopover.js";
|
|
40
41
|
import { Button } from "../Button/index.js";
|
|
@@ -216,7 +217,7 @@ const bottomSheetStyles = {
|
|
|
216
217
|
// =============================================================================
|
|
217
218
|
|
|
218
219
|
/**
|
|
219
|
-
* The props
|
|
220
|
+
* The props `renderTrigger` spreads onto the control that opens the menu.
|
|
220
221
|
* They carry the press model — a mouse opens on press-down, a held finger
|
|
221
222
|
* opens with the finger down — the keyboard opens (Enter, Space, ArrowDown,
|
|
222
223
|
* ArrowUp), the toggle click, and the ARIA wiring that names the menu after
|
|
@@ -276,64 +277,6 @@ function holdInvokerThroughPress(control, popoverId) {
|
|
|
276
277
|
doc.addEventListener('pointerup', onPressEnd, true);
|
|
277
278
|
doc.addEventListener('pointercancel', onPressEnd, true);
|
|
278
279
|
}
|
|
279
|
-
|
|
280
|
-
/** Text an assistive technology reads from `element`, `aria-hidden` left out. */
|
|
281
|
-
function visibleText(element) {
|
|
282
|
-
const copy = element.cloneNode(true);
|
|
283
|
-
for (const hidden of copy.querySelectorAll('[aria-hidden="true"]')) {
|
|
284
|
-
hidden.remove();
|
|
285
|
-
}
|
|
286
|
-
// An icon-only control is named by its image's alt, an inner aria-label, or
|
|
287
|
-
// an svg title rather than by text, so those count as its contents too.
|
|
288
|
-
for (const named of copy.querySelectorAll('img[alt], [aria-label]')) {
|
|
289
|
-
const name = named.getAttribute(named.tagName === 'IMG' ? 'alt' : 'aria-label') ?? '';
|
|
290
|
-
named.replaceWith(copy.ownerDocument.createTextNode(` ${name} `));
|
|
291
|
-
}
|
|
292
|
-
for (const svg of copy.querySelectorAll('svg')) {
|
|
293
|
-
const title = svg.querySelector('title')?.textContent ?? '';
|
|
294
|
-
svg.replaceWith(copy.ownerDocument.createTextNode(` ${title} `));
|
|
295
|
-
}
|
|
296
|
-
return (copy.textContent ?? '').replace(/\s+/g, ' ').trim();
|
|
297
|
-
}
|
|
298
|
-
|
|
299
|
-
/**
|
|
300
|
-
* The name a custom trigger gives the menu it labels (`aria-labelledby` on
|
|
301
|
-
* the menu points at it): its own `aria-labelledby` targets, its
|
|
302
|
-
* `aria-label`, its text, or its `title`, in that order.
|
|
303
|
-
*/
|
|
304
|
-
function readAccessibleName(element) {
|
|
305
|
-
if (element == null) {
|
|
306
|
-
return undefined;
|
|
307
|
-
}
|
|
308
|
-
const labelledBy = element.getAttribute('aria-labelledby');
|
|
309
|
-
if (labelledBy != null && labelledBy.trim() !== '') {
|
|
310
|
-
const text = labelledBy.split(/\s+/).map(id => element.ownerDocument.getElementById(id)).filter(node => node != null).map(visibleText).join(' ').trim();
|
|
311
|
-
if (text !== '') {
|
|
312
|
-
return text;
|
|
313
|
-
}
|
|
314
|
-
}
|
|
315
|
-
const label = element.getAttribute('aria-label')?.trim();
|
|
316
|
-
if (label) {
|
|
317
|
-
return label;
|
|
318
|
-
}
|
|
319
|
-
// A form control is named by its own <label>s; an input button by its value.
|
|
320
|
-
const labels = 'labels' in element ? Array.from(element.labels ?? []) : [];
|
|
321
|
-
const labelText = labels.map(visibleText).join(' ').trim();
|
|
322
|
-
if (labelText !== '') {
|
|
323
|
-
return labelText;
|
|
324
|
-
}
|
|
325
|
-
if (element instanceof HTMLInputElement && ['button', 'submit', 'reset'].includes(element.getAttribute('type') ?? '')) {
|
|
326
|
-
const value = element.value.trim();
|
|
327
|
-
if (value !== '') {
|
|
328
|
-
return value;
|
|
329
|
-
}
|
|
330
|
-
}
|
|
331
|
-
const text = visibleText(element);
|
|
332
|
-
if (text !== '') {
|
|
333
|
-
return text;
|
|
334
|
-
}
|
|
335
|
-
return element.getAttribute('title')?.trim() || undefined;
|
|
336
|
-
}
|
|
337
280
|
function DropdownMenuBottomSheet({
|
|
338
281
|
button: buttonFromProps,
|
|
339
282
|
renderTrigger,
|
|
@@ -1286,7 +1229,9 @@ function DropdownMenuPopover({
|
|
|
1286
1229
|
}
|
|
1287
1230
|
},
|
|
1288
1231
|
...menuPress.menuProps,
|
|
1289
|
-
...mergeProps(themeProps('dropdown-menu'
|
|
1232
|
+
...mergeProps(themeProps('dropdown-menu', {
|
|
1233
|
+
presentation: 'popover'
|
|
1234
|
+
}), stylex.props(styles.dropdown, resolvedMaxHeight != null && dynamicStyles.menuMaxHeight(resolvedMaxHeight), hasOverflow ? menuTouchActionStyles.scrolls : menuTouchActionStyles.fits, hasOverflow && styles.scrollable, hasRegions && styles.menuInFrame,
|
|
1290
1235
|
// Between a header and a footer the menu is a Tab stop, so
|
|
1291
1236
|
// keyboard focus on it must be visible (the base style removes
|
|
1292
1237
|
// the ring for the pointer-open focus target).
|
|
@@ -1317,7 +1262,7 @@ export function DropdownMenu(props) {
|
|
|
1317
1262
|
onOpenChange
|
|
1318
1263
|
} = props;
|
|
1319
1264
|
// Both presentations hang the menu off ONE control.
|
|
1320
|
-
useDevWarning('DropdownMenu', '`button` and `
|
|
1265
|
+
useDevWarning('DropdownMenu', '`button` and `renderTrigger` are mutually exclusive: the menu hangs ' + 'off one control. `renderTrigger` wins; drop `button`.', props.button != null && props.renderTrigger != null);
|
|
1321
1266
|
const requestedPresentation = 'items' in props ? props.presentation ?? 'popover' : 'popover';
|
|
1322
1267
|
const resolvedPresentation = useAdaptivePresentation(requestedPresentation);
|
|
1323
1268
|
const isControlled = props.isMenuOpen !== undefined;
|
|
@@ -47,8 +47,9 @@ export interface DropdownMenuCheckboxItemProps extends Omit<BaseProps, 'onChange
|
|
|
47
47
|
*/
|
|
48
48
|
onChange?: (checked: boolean) => void;
|
|
49
49
|
/**
|
|
50
|
-
* Whether the item is disabled.
|
|
51
|
-
*
|
|
50
|
+
* Whether the item is disabled. A disabled item stays in the accessibility
|
|
51
|
+
* tree as disabled (`aria-disabled`) but takes no focus: the arrow keys,
|
|
52
|
+
* typeahead, and the pointer highlight skip it, and activation is blocked.
|
|
52
53
|
* @default false
|
|
53
54
|
*/
|
|
54
55
|
isDisabled?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DropdownMenuCheckboxItem.d.ts","sourceRoot":"","sources":["../../src/DropdownMenu/DropdownMenuCheckboxItem.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,EAIL,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAEf,OAAO,EAAiB,KAAK,QAAQ,EAAC,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"DropdownMenuCheckboxItem.d.ts","sourceRoot":"","sources":["../../src/DropdownMenu/DropdownMenuCheckboxItem.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,EAIL,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAEf,OAAO,EAAiB,KAAK,QAAQ,EAAC,MAAM,SAAS,CAAC;AAQtD,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AA+C5C,MAAM,WAAW,6BAA8B,SAAQ,IAAI,CACzD,SAAS,EACT,UAAU,GAAG,MAAM,GAAG,cAAc,GAAG,UAAU,CAClD;IACC;;OAEG;IACH,KAAK,EAAE,SAAS,CAAC;IACjB;;OAEG;IACH,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB;;;OAGG;IACH,IAAI,CAAC,EAAE,SAAS,GAAG,QAAQ,CAAC;IAC5B;;OAEG;IACH,KAAK,EAAE,OAAO,CAAC;IACf;;OAEG;IACH,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IACtC;;;;;OAKG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;;;OAKG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,sFAAsF;IACtF,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;IAC7B;;;OAGG;IACH,UAAU,CAAC,EAAE,SAAS,CAAC;CACxB;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,wBAAwB,CAAC,EACvC,KAAK,EACL,WAAW,EACX,IAAI,EACJ,KAAK,EACL,QAAQ,EACR,UAAkB,EAClB,gBAAwB,EACxB,UAAU,EACV,MAAM,EACN,SAAS,EACT,KAAK,EACL,OAAO,EACP,aAAa,EACb,GAAG,IAAI,EACR,EAAE,6BAA6B,+BAoE/B;yBAnFe,wBAAwB"}
|
|
@@ -31,9 +31,10 @@ import { renderIconSlot } from "../Icon/index.js";
|
|
|
31
31
|
import { useIndicator } from "../Indicator/index.js";
|
|
32
32
|
import { Item } from "../Item/index.js";
|
|
33
33
|
import { useDropdownMenuContext } from "./DropdownMenuContext.js";
|
|
34
|
+
import { focusOutlineStyles } from "../utils/focusOutline.stylex.js";
|
|
34
35
|
import { focusMenuItemOnHover } from "./menuItemHover.js";
|
|
35
36
|
import "../theme/tokens.stylex.js";
|
|
36
|
-
import { colorVars, spacingVars } from "../theme/tokens.stylex.js";
|
|
37
|
+
import { colorVars, focusVars, spacingVars } from "../theme/tokens.stylex.js";
|
|
37
38
|
import { composeEventHandlers, mergeProps, themeProps } from "../utils/index.js";
|
|
38
39
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
39
40
|
const styles = {
|
|
@@ -43,7 +44,7 @@ const styles = {
|
|
|
43
44
|
kMwMTN: "x1tgivj0",
|
|
44
45
|
kWkggS: "xjbqb8w x1c52tdz",
|
|
45
46
|
kkrTdU: "x1ypdohk x16khyan",
|
|
46
|
-
|
|
47
|
+
kInvED: "x1c097ug",
|
|
47
48
|
$$css: true
|
|
48
49
|
},
|
|
49
50
|
disabled: {
|
|
@@ -143,7 +144,7 @@ export function DropdownMenuCheckboxItem({
|
|
|
143
144
|
endContent: endContent,
|
|
144
145
|
onClick: handleClick,
|
|
145
146
|
isDisabled: isDisabled,
|
|
146
|
-
xstyle: [styles.root, isDisabled && styles.disabled, xstyle],
|
|
147
|
+
xstyle: [focusOutlineStyles.focusVisible, styles.root, isDisabled && styles.disabled, xstyle],
|
|
147
148
|
...mergeProps(themeProps('dropdown-menu-item', {
|
|
148
149
|
size: menuSize
|
|
149
150
|
}), {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DropdownMenuItem.d.ts","sourceRoot":"","sources":["../../src/DropdownMenu/DropdownMenuItem.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,OAAO,EAEL,KAAK,UAAU,EAEf,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAEf,OAAO,EAAiB,KAAK,QAAQ,EAAC,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"DropdownMenuItem.d.ts","sourceRoot":"","sources":["../../src/DropdownMenu/DropdownMenuItem.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,OAAO,EAEL,KAAK,UAAU,EAEf,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAEf,OAAO,EAAiB,KAAK,QAAQ,EAAC,MAAM,SAAS,CAAC;AAWtD,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAoE5C,MAAM,WAAW,qBAAsB,SAAQ,IAAI,CACjD,SAAS,EACT,MAAM,GAAG,UAAU,CACpB;IACC,wCAAwC;IACxC,IAAI,CAAC,EAAE,SAAS,GAAG,QAAQ,CAAC;IAC5B,0BAA0B;IAC1B,KAAK,EAAE,SAAS,CAAC;IACjB,4DAA4D;IAC5D,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB;;;;;;OAMG;IACH,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,KAAK,IAAI,CAAC;IACtC;;;;OAIG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,0CAA0C;IAC1C,MAAM,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC;IAC5B;;;OAGG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,mDAAmD;IACnD,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,gEAAgE;IAChE,UAAU,CAAC,EAAE,SAAS,CAAC;IACvB;;;;;;OAMG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B;;;OAGG;IACH,OAAO,CAAC,EAAE,SAAS,GAAG,aAAa,CAAC;IACpC;;;;;OAKG;IACH,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;CAC9B;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,gBAAgB,CAAC,EAC/B,IAAI,EACJ,KAAK,EACL,WAAW,EACX,OAAO,EACP,IAAI,EACJ,MAAM,EACN,GAAG,EACH,UAAkB,EAClB,UAAU,EACV,gBAAuB,EACvB,OAAmB,EACnB,MAAM,EACN,SAAS,EACT,KAAK,EACL,GAAG,EACH,aAAa,EACb,UAAU,EACV,GAAG,IAAI,EACR,EAAE,qBAAqB,+BAoHvB;yBAvIe,gBAAgB"}
|
|
@@ -33,9 +33,10 @@ import { renderIconSlot } from "../Icon/index.js";
|
|
|
33
33
|
import { Item } from "../Item/index.js";
|
|
34
34
|
import { useLinkComponent } from "../Link/useLinkComponent.js";
|
|
35
35
|
import "../theme/tokens.stylex.js";
|
|
36
|
-
import { colorVars, spacingVars, typographyVars, typeScaleVars } from "../theme/tokens.stylex.js";
|
|
36
|
+
import { colorVars, spacingVars, typographyVars, typeScaleVars, focusVars } from "../theme/tokens.stylex.js";
|
|
37
37
|
import { composeEventHandlers, mergeProps } from "../utils/index.js";
|
|
38
38
|
import { useDropdownMenuContext } from "./DropdownMenuContext.js";
|
|
39
|
+
import { focusOutlineStyles } from "../utils/focusOutline.stylex.js";
|
|
39
40
|
import { focusMenuItemOnHover } from "./menuItemHover.js";
|
|
40
41
|
import { isModifiedClick } from "./menuItemRoles.js";
|
|
41
42
|
import { themeProps } from "../utils/themeProps.js";
|
|
@@ -56,7 +57,7 @@ const menuItemStyles = {
|
|
|
56
57
|
ksu8eU: "xng3xce",
|
|
57
58
|
kkrTdU: "x1ypdohk x16khyan",
|
|
58
59
|
k9WMMc: "x1yc453h",
|
|
59
|
-
|
|
60
|
+
kInvED: "x1c097ug",
|
|
60
61
|
$$css: true
|
|
61
62
|
},
|
|
62
63
|
disabled: {
|
|
@@ -198,7 +199,7 @@ export function DropdownMenuItem({
|
|
|
198
199
|
,
|
|
199
200
|
draggable: href != null ? false : undefined,
|
|
200
201
|
isDisabled: isDisabled,
|
|
201
|
-
xstyle: [menuItemStyles.root, itemSizeStyles[menuSize], isDestructive && menuItemStyles.destructive, isDisabled && menuItemStyles.disabled, xstyle],
|
|
202
|
+
xstyle: [focusOutlineStyles.focusVisible, menuItemStyles.root, itemSizeStyles[menuSize], isDestructive && menuItemStyles.destructive, isDisabled && menuItemStyles.disabled, xstyle],
|
|
202
203
|
...mergeProps(themeProps('dropdown-menu-item', {
|
|
203
204
|
size: menuSize,
|
|
204
205
|
variant: isDestructive ? 'destructive' : null
|
|
@@ -40,9 +40,10 @@ export interface DropdownMenuRadioItemProps extends Omit<BaseProps, 'role' | 'ar
|
|
|
40
40
|
*/
|
|
41
41
|
icon?: ReactNode | IconType;
|
|
42
42
|
/**
|
|
43
|
-
* Whether this individual radio item is disabled.
|
|
44
|
-
* `aria-disabled
|
|
45
|
-
*
|
|
43
|
+
* Whether this individual radio item is disabled. A disabled item stays in
|
|
44
|
+
* the accessibility tree as disabled (`aria-disabled`) but takes no focus:
|
|
45
|
+
* the arrow keys, typeahead, and the pointer highlight skip it, and
|
|
46
|
+
* selection is blocked.
|
|
46
47
|
* @default false
|
|
47
48
|
*/
|
|
48
49
|
isDisabled?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DropdownMenuRadioItem.d.ts","sourceRoot":"","sources":["../../src/DropdownMenu/DropdownMenuRadioItem.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAIL,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAEf,OAAO,EAAiB,KAAK,QAAQ,EAAC,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"DropdownMenuRadioItem.d.ts","sourceRoot":"","sources":["../../src/DropdownMenu/DropdownMenuRadioItem.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAIL,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAEf,OAAO,EAAiB,KAAK,QAAQ,EAAC,MAAM,SAAS,CAAC;AAQtD,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AA+C5C,MAAM,WAAW,0BAA2B,SAAQ,IAAI,CACtD,SAAS,EACT,MAAM,GAAG,cAAc,GAAG,UAAU,CACrC;IACC;;;OAGG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,KAAK,EAAE,SAAS,CAAC;IACjB;;OAEG;IACH,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB;;;OAGG;IACH,IAAI,CAAC,EAAE,SAAS,GAAG,QAAQ,CAAC;IAC5B;;;;;;OAMG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;OAGG;IACH,UAAU,CAAC,EAAE,SAAS,CAAC;IACvB,mFAAmF;IACnF,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;CAC9B;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,qBAAqB,CAAC,EACpC,KAAK,EACL,KAAK,EACL,WAAW,EACX,IAAI,EACJ,UAAkB,EAClB,UAAU,EACV,MAAM,EACN,SAAS,EACT,KAAK,EACL,OAAO,EACP,aAAa,EACb,GAAG,IAAI,EACR,EAAE,0BAA0B,+BA4E5B;yBAzFe,qBAAqB"}
|
|
@@ -27,9 +27,10 @@ import { renderIconSlot } from "../Icon/index.js";
|
|
|
27
27
|
import { useIndicator } from "../Indicator/index.js";
|
|
28
28
|
import { Item } from "../Item/index.js";
|
|
29
29
|
import { useDropdownMenuContext } from "./DropdownMenuContext.js";
|
|
30
|
+
import { focusOutlineStyles } from "../utils/focusOutline.stylex.js";
|
|
30
31
|
import { focusMenuItemOnHover } from "./menuItemHover.js";
|
|
31
32
|
import "../theme/tokens.stylex.js";
|
|
32
|
-
import { colorVars, spacingVars } from "../theme/tokens.stylex.js";
|
|
33
|
+
import { colorVars, focusVars, spacingVars } from "../theme/tokens.stylex.js";
|
|
33
34
|
import { composeEventHandlers, mergeProps, themeProps } from "../utils/index.js";
|
|
34
35
|
import { useDropdownMenuRadioGroupContext } from "./DropdownMenuContext.js";
|
|
35
36
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
@@ -40,7 +41,7 @@ const styles = {
|
|
|
40
41
|
kMwMTN: "x1tgivj0",
|
|
41
42
|
kWkggS: "xjbqb8w x1c52tdz",
|
|
42
43
|
kkrTdU: "x1ypdohk x16khyan",
|
|
43
|
-
|
|
44
|
+
kInvED: "x1c097ug",
|
|
44
45
|
$$css: true
|
|
45
46
|
},
|
|
46
47
|
disabled: {
|
|
@@ -138,7 +139,7 @@ export function DropdownMenuRadioItem({
|
|
|
138
139
|
endContent: endContent,
|
|
139
140
|
onClick: handleClick,
|
|
140
141
|
isDisabled: isDisabled,
|
|
141
|
-
xstyle: [styles.root, isDisabled && styles.disabled, xstyle],
|
|
142
|
+
xstyle: [focusOutlineStyles.focusVisible, styles.root, isDisabled && styles.disabled, xstyle],
|
|
142
143
|
...mergeProps(themeProps('dropdown-menu-item', {
|
|
143
144
|
size: menuSize
|
|
144
145
|
}), {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DropdownMenuSubMenu.d.ts","sourceRoot":"","sources":["../../src/DropdownMenu/DropdownMenuSubMenu.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AAEH,OAAO,KAAK,EAAE,EASZ,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAGf,OAAO,EAAuB,KAAK,QAAQ,EAAC,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"DropdownMenuSubMenu.d.ts","sourceRoot":"","sources":["../../src/DropdownMenu/DropdownMenuSubMenu.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AAEH,OAAO,KAAK,EAAE,EASZ,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAGf,OAAO,EAAuB,KAAK,QAAQ,EAAC,MAAM,SAAS,CAAC;AA0C5D,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAgO5C,MAAM,MAAM,+BAA+B,GACzC,QAAQ,GAAG,UAAU,GAAG,UAAU,CAAC;AAErC,UAAU,4BAA6B,SAAQ,IAAI,CACjD,SAAS,EACT,MAAM,GAAG,UAAU,CACpB;IACC,2DAA2D;IAC3D,IAAI,CAAC,EAAE,SAAS,GAAG,QAAQ,CAAC;IAC5B,8CAA8C;IAC9C,KAAK,EAAE,SAAS,CAAC;IACjB,4DAA4D;IAC5D,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB;;;;OAIG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;;OAIG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC5B,8CAA8C;IAC9C,YAAY,CAAC,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,IAAI,CAAC;IACzC;;;;;;;OAOG;IACH,YAAY,CAAC,EAAE,+BAA+B,CAAC;IAC/C;;;;;;;;;;OAUG;IACH,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB;;;OAGG;IACH,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,mCAAmC;IACnC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;;OAGG;IACH,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;CAC9B;AAED,MAAM,WAAW,wBAAyB,SAAQ,4BAA4B;IAC5E;;;;;;;;OAQG;IACH,QAAQ,EAAE,SAAS,CAAC;CACrB;AA6CD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,wBAAwB,GAC9B,SAAS,CAm5BX;yBAr5Be,mBAAmB"}
|
|
@@ -67,7 +67,7 @@ import { resolveMenuWidth } from "./menuWidth.js";
|
|
|
67
67
|
import "../Layer/layerViewportInset.stylex.js";
|
|
68
68
|
import { layerViewportInset } from "../Layer/layerViewportInset.stylex.js";
|
|
69
69
|
import "../theme/tokens.stylex.js";
|
|
70
|
-
import { colorVars, spacingVars, radiusVars, durationVars, easeVars, shadowVars, typographyVars, typeScaleVars } from "../theme/tokens.stylex.js";
|
|
70
|
+
import { colorVars, spacingVars, radiusVars, durationVars, easeVars, shadowVars, typographyVars, typeScaleVars, focusVars } from "../theme/tokens.stylex.js";
|
|
71
71
|
import { composeEventHandlers, isImeKeyEvent, isRenderable, mergeProps, rtlStyles } from "../utils/index.js";
|
|
72
72
|
import { focusOutlineStyles } from "../utils/focusOutline.stylex.js";
|
|
73
73
|
import { getInteractionModality } from "../utils/interactionModality.js";
|
|
@@ -101,7 +101,7 @@ const triggerStyles = {
|
|
|
101
101
|
ksu8eU: "xng3xce",
|
|
102
102
|
kkrTdU: "x1ypdohk x16khyan",
|
|
103
103
|
k9WMMc: "x1yc453h",
|
|
104
|
-
|
|
104
|
+
kInvED: "x1c097ug",
|
|
105
105
|
$$css: true
|
|
106
106
|
},
|
|
107
107
|
open: {
|
|
@@ -847,7 +847,9 @@ export function DropdownMenuSubMenu(props) {
|
|
|
847
847
|
...(surface === 'flyout' ?
|
|
848
848
|
// The flyout's frame paints its surface, so the menu target rides
|
|
849
849
|
// on it; a drilled-in view sits inside the root's surface.
|
|
850
|
-
mergeProps(themeProps('dropdown-menu'
|
|
850
|
+
mergeProps(themeProps('dropdown-menu', {
|
|
851
|
+
presentation: 'popover'
|
|
852
|
+
}), {
|
|
851
853
|
className: "x9f619 x78zum5 xdt5ytf x1uh1i8a x1fcsqxe xgory14 x1n97fys xc0b1yq x1prclbq x1i5ehqx x1hc1fzr x19991ni xuedmi6 xlr8y92"
|
|
852
854
|
}) : stylex.props(regionStyles.frame, rootSurface?.menuMaxHeight != null && dynamicRegionStyles.viewMaxHeight(rootSurface.menuMaxHeight), frameProps.hidden === true && regionStyles.hidden)),
|
|
853
855
|
children: [isRenderable(header) && /*#__PURE__*/_jsx("div", {
|
|
@@ -911,7 +913,7 @@ export function DropdownMenuSubMenu(props) {
|
|
|
911
913
|
onClick: handleRowClick,
|
|
912
914
|
onKeyDown: composeEventHandlers(handleTriggerKeyDown, onKeyDown),
|
|
913
915
|
isDisabled: isDisabled,
|
|
914
|
-
xstyle: [triggerStyles.root, triggerSizeStyles[menuSize], isOpen && triggerStyles.open, isDisabled && triggerStyles.disabled, xstyle],
|
|
916
|
+
xstyle: [focusOutlineStyles.focusVisible, triggerStyles.root, triggerSizeStyles[menuSize], isOpen && triggerStyles.open, isDisabled && triggerStyles.disabled, xstyle],
|
|
915
917
|
...mergeProps(themeProps('dropdown-menu-item', {
|
|
916
918
|
size: menuSize
|
|
917
919
|
}), {
|
|
@@ -1004,7 +1006,9 @@ export function DropdownMenuSubMenu(props) {
|
|
|
1004
1006
|
onMouseLeave: contentProps.onMouseLeave,
|
|
1005
1007
|
"data-testid": menuDataTestId,
|
|
1006
1008
|
...menuPress.menuProps,
|
|
1007
|
-
...mergeProps(themeProps('dropdown-menu'
|
|
1009
|
+
...mergeProps(themeProps('dropdown-menu', {
|
|
1010
|
+
presentation: 'popover'
|
|
1011
|
+
}), {
|
|
1008
1012
|
0: {
|
|
1009
1013
|
className: "x9f619 x78zum5 xdt5ytf x1lsbc85 xc0b1yq x1uh1i8a x1fcsqxe xgory14 x9epnlk x1n97fys x1prclbq x1i5ehqx x1hc1fzr x19991ni xuedmi6 xlr8y92 xpdipgo x87ps6o x1j4r261"
|
|
1010
1014
|
},
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @file inputDisabledFocus.ts
|
|
3
3
|
* @input Uses StyleX and theme tokens
|
|
4
4
|
* @output inputDisabledFocusStyles (internal; not re-exported from Field/index.ts)
|
|
5
|
-
* @position Field wrapper style shared by
|
|
5
|
+
* @position Field wrapper style shared by the text-entry fields
|
|
6
6
|
*/
|
|
7
7
|
import * as stylex from '@stylexjs/stylex';
|
|
8
8
|
export declare const inputDisabledFocusStyles: Readonly<{
|
|
@@ -10,5 +10,9 @@ export declare const inputDisabledFocusStyles: Readonly<{
|
|
|
10
10
|
readonly borderColor: stylex.StyleXClassNameFor<"borderColor", "light-dark(#0064E0, #2694FE)" | "light-dark(#CCD3DB, #494D53)">;
|
|
11
11
|
readonly boxShadow: stylex.StyleXClassNameFor<"boxShadow", "none" | `inset 0px 0px 0px 2px ${stylex.StyleXVar<"light-dark(#0082FB33, #0082FB3F)">}`>;
|
|
12
12
|
}>;
|
|
13
|
+
readonly nestedRing: Readonly<{
|
|
14
|
+
readonly borderColor: stylex.StyleXClassNameFor<"borderColor", "light-dark(#0064E0, #2694FE)" | "light-dark(#CCD3DB, #494D53)">;
|
|
15
|
+
readonly boxShadow: stylex.StyleXClassNameFor<"boxShadow", "none" | `inset 0px 0px 0px 2px ${stylex.StyleXVar<"light-dark(#0082FB33, #0082FB3F)">}`>;
|
|
16
|
+
}>;
|
|
13
17
|
}>;
|
|
14
18
|
//# sourceMappingURL=inputDisabledFocus.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inputDisabledFocus.d.ts","sourceRoot":"","sources":["../../src/Field/inputDisabledFocus.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AAEH,OAAO,KAAK,MAAM,MAAM,kBAAkB,CAAC;AAG3C,eAAO,MAAM,wBAAwB
|
|
1
|
+
{"version":3,"file":"inputDisabledFocus.d.ts","sourceRoot":"","sources":["../../src/Field/inputDisabledFocus.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AAEH,OAAO,KAAK,MAAM,MAAM,kBAAkB,CAAC;AAG3C,eAAO,MAAM,wBAAwB;;;;;;;;;EA6BnC,CAAC"}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* @file inputDisabledFocus.ts
|
|
5
5
|
* @input Uses StyleX and theme tokens
|
|
6
6
|
* @output inputDisabledFocusStyles (internal; not re-exported from Field/index.ts)
|
|
7
|
-
* @position Field wrapper style shared by
|
|
7
|
+
* @position Field wrapper style shared by the text-entry fields
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
import * as stylex from '@stylexjs/stylex';
|
|
@@ -15,5 +15,10 @@ export const inputDisabledFocusStyles = {
|
|
|
15
15
|
kVAM5u: "xvy26l8 x16it14f",
|
|
16
16
|
kGVxlE: "x1gnnqk1 xwmge8v",
|
|
17
17
|
$$css: true
|
|
18
|
+
},
|
|
19
|
+
nestedRing: {
|
|
20
|
+
kVAM5u: "xvy26l8 x1ta6xgg",
|
|
21
|
+
kGVxlE: "x1gnnqk1 x151j4nw",
|
|
22
|
+
$$css: true
|
|
18
23
|
}
|
|
19
24
|
};
|