@wordpress/components 25.10.0 → 25.11.1-next.f8d8eceb.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (74) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/build/autocomplete/index.js +104 -52
  3. package/build/autocomplete/index.js.map +1 -1
  4. package/build/dropdown-menu-v2-ariakit/index.js +217 -0
  5. package/build/dropdown-menu-v2-ariakit/index.js.map +1 -0
  6. package/build/dropdown-menu-v2-ariakit/styles.js +157 -0
  7. package/build/dropdown-menu-v2-ariakit/styles.js.map +1 -0
  8. package/build/dropdown-menu-v2-ariakit/types.js +6 -0
  9. package/build/dropdown-menu-v2-ariakit/types.js.map +1 -0
  10. package/build/input-control/styles/input-control-styles.js +23 -23
  11. package/build/input-control/styles/input-control-styles.js.map +1 -1
  12. package/build/mobile/global-styles-context/utils.native.js +1 -1
  13. package/build/mobile/global-styles-context/utils.native.js.map +1 -1
  14. package/build/private-apis.js +9 -1
  15. package/build/private-apis.js.map +1 -1
  16. package/build/select-control/styles/select-control-styles.js +8 -8
  17. package/build/select-control/styles/select-control-styles.js.map +1 -1
  18. package/build/tabs/index.js +2 -2
  19. package/build/tabs/index.js.map +1 -1
  20. package/build/tooltip/index.js +2 -2
  21. package/build/tooltip/index.js.map +1 -1
  22. package/build-module/autocomplete/index.js +104 -52
  23. package/build-module/autocomplete/index.js.map +1 -1
  24. package/build-module/dropdown-menu-v2-ariakit/index.js +199 -0
  25. package/build-module/dropdown-menu-v2-ariakit/index.js.map +1 -0
  26. package/build-module/dropdown-menu-v2-ariakit/styles.js +136 -0
  27. package/build-module/dropdown-menu-v2-ariakit/styles.js.map +1 -0
  28. package/build-module/dropdown-menu-v2-ariakit/types.js +2 -0
  29. package/build-module/dropdown-menu-v2-ariakit/types.js.map +1 -0
  30. package/build-module/input-control/styles/input-control-styles.js +23 -23
  31. package/build-module/input-control/styles/input-control-styles.js.map +1 -1
  32. package/build-module/mobile/global-styles-context/utils.native.js +2 -2
  33. package/build-module/mobile/global-styles-context/utils.native.js.map +1 -1
  34. package/build-module/private-apis.js +9 -1
  35. package/build-module/private-apis.js.map +1 -1
  36. package/build-module/select-control/styles/select-control-styles.js +8 -8
  37. package/build-module/select-control/styles/select-control-styles.js.map +1 -1
  38. package/build-module/tabs/index.js +3 -3
  39. package/build-module/tabs/index.js.map +1 -1
  40. package/build-module/tooltip/index.js +2 -2
  41. package/build-module/tooltip/index.js.map +1 -1
  42. package/build-style/style-rtl.css +1 -1
  43. package/build-style/style.css +1 -1
  44. package/build-types/autocomplete/index.d.ts.map +1 -1
  45. package/build-types/dropdown-menu-v2-ariakit/index.d.ts +11 -0
  46. package/build-types/dropdown-menu-v2-ariakit/index.d.ts.map +1 -0
  47. package/build-types/dropdown-menu-v2-ariakit/stories/index.story.d.ts +16 -0
  48. package/build-types/dropdown-menu-v2-ariakit/stories/index.story.d.ts.map +1 -0
  49. package/build-types/dropdown-menu-v2-ariakit/styles.d.ts +88 -0
  50. package/build-types/dropdown-menu-v2-ariakit/styles.d.ts.map +1 -0
  51. package/build-types/dropdown-menu-v2-ariakit/test/index.d.ts +2 -0
  52. package/build-types/dropdown-menu-v2-ariakit/test/index.d.ts.map +1 -0
  53. package/build-types/dropdown-menu-v2-ariakit/types.d.ts +174 -0
  54. package/build-types/dropdown-menu-v2-ariakit/types.d.ts.map +1 -0
  55. package/build-types/private-apis.d.ts.map +1 -1
  56. package/build-types/tooltip/index.d.ts.map +1 -1
  57. package/package.json +21 -20
  58. package/src/autocomplete/index.tsx +136 -77
  59. package/src/dimension-control/test/__snapshots__/index.test.js.snap +8 -8
  60. package/src/dropdown-menu-v2-ariakit/README.md +324 -0
  61. package/src/dropdown-menu-v2-ariakit/index.tsx +318 -0
  62. package/src/dropdown-menu-v2-ariakit/stories/index.story.tsx +506 -0
  63. package/src/dropdown-menu-v2-ariakit/styles.ts +297 -0
  64. package/src/dropdown-menu-v2-ariakit/test/index.tsx +1139 -0
  65. package/src/dropdown-menu-v2-ariakit/types.ts +186 -0
  66. package/src/input-control/styles/input-control-styles.tsx +2 -2
  67. package/src/mobile/global-styles-context/utils.native.js +2 -2
  68. package/src/private-apis.ts +16 -0
  69. package/src/select-control/styles/select-control-styles.ts +2 -2
  70. package/src/tabs/index.tsx +3 -3
  71. package/src/tabs/test/index.tsx +12 -3
  72. package/src/toggle-group-control/test/__snapshots__/index.tsx.snap +8 -0
  73. package/src/tooltip/index.tsx +2 -3
  74. package/tsconfig.tsbuildinfo +1 -1
@@ -1 +1 @@
1
- {"version":3,"names":["Ariakit","useInstanceId","useEffect","useLayoutEffect","useRef","TabsContext","Tab","TabList","TabPanel","Tabs","selectOnMove","initialTabId","orientation","onSelect","children","selectedTabId","instanceId","store","useTabStore","defaultSelectedId","setSelectedId","selectedId","strippedDownId","replace","isControlled","undefined","items","useState","tabsHavePopulated","length","current","selectedTab","find","item","id","firstEnabledTab","dimmed","initialTab","createElement","Provider","value"],"sources":["@wordpress/components/src/tabs/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\n// eslint-disable-next-line no-restricted-imports\nimport * as Ariakit from '@ariakit/react';\n\n/**\n * WordPress dependencies\n */\nimport { useInstanceId } from '@wordpress/compose';\nimport { useEffect, useLayoutEffect, useRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport type { TabsProps } from './types';\nimport { TabsContext } from './context';\nimport { Tab } from './tab';\nimport { TabList } from './tablist';\nimport { TabPanel } from './tabpanel';\n\nfunction Tabs( {\n\tselectOnMove = true,\n\tinitialTabId,\n\torientation = 'horizontal',\n\tonSelect,\n\tchildren,\n\tselectedTabId,\n}: TabsProps ) {\n\tconst instanceId = useInstanceId( Tabs, 'tabs' );\n\tconst store = Ariakit.useTabStore( {\n\t\tselectOnMove,\n\t\torientation,\n\t\tdefaultSelectedId: initialTabId && `${ instanceId }-${ initialTabId }`,\n\t\tsetSelectedId: ( selectedId ) => {\n\t\t\tconst strippedDownId =\n\t\t\t\ttypeof selectedId === 'string'\n\t\t\t\t\t? selectedId.replace( `${ instanceId }-`, '' )\n\t\t\t\t\t: selectedId;\n\t\t\tonSelect?.( strippedDownId );\n\t\t},\n\t\tselectedId: selectedTabId && `${ instanceId }-${ selectedTabId }`,\n\t} );\n\n\tconst isControlled = selectedTabId !== undefined;\n\n\tconst { items, selectedId } = store.useState();\n\tconst { setSelectedId } = store;\n\n\t// Keep track of whether tabs have been populated. This is used to prevent\n\t// certain effects from firing too early while tab data and relevant\n\t// variables are undefined during the initial render.\n\tconst tabsHavePopulated = useRef( false );\n\tif ( items.length > 0 ) {\n\t\ttabsHavePopulated.current = true;\n\t}\n\n\tconst selectedTab = items.find( ( item ) => item.id === selectedId );\n\tconst firstEnabledTab = items.find( ( item ) => {\n\t\t// Ariakit internally refers to disabled tabs as `dimmed`.\n\t\treturn ! item.dimmed;\n\t} );\n\tconst initialTab = items.find(\n\t\t( item ) => item.id === `${ instanceId }-${ initialTabId }`\n\t);\n\n\t// Handle selecting the initial tab.\n\tuseLayoutEffect( () => {\n\t\tif ( isControlled ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Wait for the denoted initial tab to be declared before making a\n\t\t// selection. This ensures that if a tab is declared lazily it can\n\t\t// still receive initial selection, as well as ensuring no tab is\n\t\t// selected if an invalid `initialTabId` is provided.\n\t\tif ( initialTabId && ! initialTab ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// If the currently selected tab is missing (i.e. removed from the DOM),\n\t\t// fall back to the initial tab or the first enabled tab if there is\n\t\t// one. Otherwise, no tab should be selected.\n\t\tif ( ! items.find( ( item ) => item.id === selectedId ) ) {\n\t\t\tif ( initialTab && ! initialTab.dimmed ) {\n\t\t\t\tsetSelectedId( initialTab?.id );\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( firstEnabledTab ) {\n\t\t\t\tsetSelectedId( firstEnabledTab.id );\n\t\t\t} else if ( tabsHavePopulated.current ) {\n\t\t\t\tsetSelectedId( null );\n\t\t\t}\n\t\t}\n\t}, [\n\t\tfirstEnabledTab,\n\t\tinitialTab,\n\t\tinitialTabId,\n\t\tisControlled,\n\t\titems,\n\t\tselectedId,\n\t\tsetSelectedId,\n\t] );\n\n\t// Handle the currently selected tab becoming disabled.\n\tuseEffect( () => {\n\t\tif ( ! selectedTab?.dimmed ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// In controlled mode, we trust that disabling tabs is done\n\t\t// intentionally, and don't select a new tab automatically.\n\t\tif ( isControlled ) {\n\t\t\tsetSelectedId( null );\n\t\t\treturn;\n\t\t}\n\n\t\t// If the currently selected tab becomes disabled, fall back to the\n\t\t// `initialTabId` if possible. Otherwise select the first\n\t\t// enabled tab (if there is one).\n\t\tif ( initialTab && ! initialTab.dimmed ) {\n\t\t\tsetSelectedId( initialTab.id );\n\t\t\treturn;\n\t\t}\n\n\t\tif ( firstEnabledTab ) {\n\t\t\tsetSelectedId( firstEnabledTab.id );\n\t\t}\n\t}, [\n\t\tfirstEnabledTab,\n\t\tinitialTab,\n\t\tisControlled,\n\t\tselectedTab?.dimmed,\n\t\tsetSelectedId,\n\t] );\n\n\t// Clear `selectedId` if the active tab is removed from the DOM in controlled mode.\n\tuseEffect( () => {\n\t\tif ( ! isControlled ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Once the tabs have populated, if the `selectedTabId` still can't be\n\t\t// found, clear the selection.\n\t\tif ( tabsHavePopulated.current && !! selectedTabId && ! selectedTab ) {\n\t\t\tsetSelectedId( null );\n\t\t}\n\t}, [\n\t\tisControlled,\n\t\tselectedId,\n\t\tselectedTab,\n\t\tselectedTabId,\n\t\tsetSelectedId,\n\t] );\n\n\treturn (\n\t\t<TabsContext.Provider value={ { store, instanceId } }>\n\t\t\t{ children }\n\t\t</TabsContext.Provider>\n\t);\n}\n\nTabs.TabList = TabList;\nTabs.Tab = Tab;\nTabs.TabPanel = TabPanel;\nexport default Tabs;\n"],"mappings":";AAAA;AACA;AACA;AACA;AACA,OAAO,KAAKA,OAAO,MAAM,gBAAgB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AAEA,UAAU,CAACD,MAAM,EAAG;MACxChB,aAAa,CAAEiB,UAAU,CAACH,EAAG,CAAC;MAC9B;IACD;IAEA,IAAKC,eAAe,EAAG;MACtBf,aAAa,CAAEe,eAAe,CAACD,EAAG,CAAC;IACpC;EACD,CAAC,EAAE,CACFC,eAAe,EACfE,UAAU,EACVb,YAAY,EACZO,WAAW,EAAEK,MAAM,EACnBhB,aAAa,CACZ,CAAC;;EAEH;EACAlB,SAAS,CAAE,MAAM;IAChB,IAAK,CAAEsB,YAAY,EAAG;MACrB;IACD;;IAEA;IACA;IACA,IAAKI,iBAAiB,CAACE,OAAO,IAAI,CAAC,CAAEf,aAAa,IAAI,CAAEgB,WAAW,EAAG;MACrEX,aAAa,CAAE,IAAK,CAAC;IACtB;EACD,CAAC,EAAE,CACFI,YAAY,EACZH,UAAU,EACVU,WAAW,EACXhB,aAAa,EACbK,aAAa,CACZ,CAAC;EAEH,OACCkB,aAAA,CAACjC,WAAW,CAACkC,QAAQ;IAACC,KAAK,EAAG;MAAEvB,KAAK;MAAED;IAAW;EAAG,GAClDF,QACmB,CAAC;AAEzB;AAEAL,IAAI,CAACF,OAAO,GAAGA,OAAO;AACtBE,IAAI,CAACH,GAAG,GAAGA,GAAG;AACdG,IAAI,CAACD,QAAQ,GAAGA,QAAQ;AACxB,eAAeC,IAAI"}
1
+ {"version":3,"names":["Ariakit","useInstanceId","useLayoutEffect","useRef","TabsContext","Tab","TabList","TabPanel","Tabs","selectOnMove","initialTabId","orientation","onSelect","children","selectedTabId","instanceId","store","useTabStore","defaultSelectedId","setSelectedId","selectedId","strippedDownId","replace","isControlled","undefined","items","useState","tabsHavePopulated","length","current","selectedTab","find","item","id","firstEnabledTab","dimmed","initialTab","createElement","Provider","value"],"sources":["@wordpress/components/src/tabs/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\n// eslint-disable-next-line no-restricted-imports\nimport * as Ariakit from '@ariakit/react';\n\n/**\n * WordPress dependencies\n */\nimport { useInstanceId } from '@wordpress/compose';\nimport { useLayoutEffect, useRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport type { TabsProps } from './types';\nimport { TabsContext } from './context';\nimport { Tab } from './tab';\nimport { TabList } from './tablist';\nimport { TabPanel } from './tabpanel';\n\nfunction Tabs( {\n\tselectOnMove = true,\n\tinitialTabId,\n\torientation = 'horizontal',\n\tonSelect,\n\tchildren,\n\tselectedTabId,\n}: TabsProps ) {\n\tconst instanceId = useInstanceId( Tabs, 'tabs' );\n\tconst store = Ariakit.useTabStore( {\n\t\tselectOnMove,\n\t\torientation,\n\t\tdefaultSelectedId: initialTabId && `${ instanceId }-${ initialTabId }`,\n\t\tsetSelectedId: ( selectedId ) => {\n\t\t\tconst strippedDownId =\n\t\t\t\ttypeof selectedId === 'string'\n\t\t\t\t\t? selectedId.replace( `${ instanceId }-`, '' )\n\t\t\t\t\t: selectedId;\n\t\t\tonSelect?.( strippedDownId );\n\t\t},\n\t\tselectedId: selectedTabId && `${ instanceId }-${ selectedTabId }`,\n\t} );\n\n\tconst isControlled = selectedTabId !== undefined;\n\n\tconst { items, selectedId } = store.useState();\n\tconst { setSelectedId } = store;\n\n\t// Keep track of whether tabs have been populated. This is used to prevent\n\t// certain effects from firing too early while tab data and relevant\n\t// variables are undefined during the initial render.\n\tconst tabsHavePopulated = useRef( false );\n\tif ( items.length > 0 ) {\n\t\ttabsHavePopulated.current = true;\n\t}\n\n\tconst selectedTab = items.find( ( item ) => item.id === selectedId );\n\tconst firstEnabledTab = items.find( ( item ) => {\n\t\t// Ariakit internally refers to disabled tabs as `dimmed`.\n\t\treturn ! item.dimmed;\n\t} );\n\tconst initialTab = items.find(\n\t\t( item ) => item.id === `${ instanceId }-${ initialTabId }`\n\t);\n\n\t// Handle selecting the initial tab.\n\tuseLayoutEffect( () => {\n\t\tif ( isControlled ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Wait for the denoted initial tab to be declared before making a\n\t\t// selection. This ensures that if a tab is declared lazily it can\n\t\t// still receive initial selection, as well as ensuring no tab is\n\t\t// selected if an invalid `initialTabId` is provided.\n\t\tif ( initialTabId && ! initialTab ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// If the currently selected tab is missing (i.e. removed from the DOM),\n\t\t// fall back to the initial tab or the first enabled tab if there is\n\t\t// one. Otherwise, no tab should be selected.\n\t\tif ( ! items.find( ( item ) => item.id === selectedId ) ) {\n\t\t\tif ( initialTab && ! initialTab.dimmed ) {\n\t\t\t\tsetSelectedId( initialTab?.id );\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( firstEnabledTab ) {\n\t\t\t\tsetSelectedId( firstEnabledTab.id );\n\t\t\t} else if ( tabsHavePopulated.current ) {\n\t\t\t\tsetSelectedId( null );\n\t\t\t}\n\t\t}\n\t}, [\n\t\tfirstEnabledTab,\n\t\tinitialTab,\n\t\tinitialTabId,\n\t\tisControlled,\n\t\titems,\n\t\tselectedId,\n\t\tsetSelectedId,\n\t] );\n\n\t// Handle the currently selected tab becoming disabled.\n\tuseLayoutEffect( () => {\n\t\tif ( ! selectedTab?.dimmed ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// In controlled mode, we trust that disabling tabs is done\n\t\t// intentionally, and don't select a new tab automatically.\n\t\tif ( isControlled ) {\n\t\t\tsetSelectedId( null );\n\t\t\treturn;\n\t\t}\n\n\t\t// If the currently selected tab becomes disabled, fall back to the\n\t\t// `initialTabId` if possible. Otherwise select the first\n\t\t// enabled tab (if there is one).\n\t\tif ( initialTab && ! initialTab.dimmed ) {\n\t\t\tsetSelectedId( initialTab.id );\n\t\t\treturn;\n\t\t}\n\n\t\tif ( firstEnabledTab ) {\n\t\t\tsetSelectedId( firstEnabledTab.id );\n\t\t}\n\t}, [\n\t\tfirstEnabledTab,\n\t\tinitialTab,\n\t\tisControlled,\n\t\tselectedTab?.dimmed,\n\t\tsetSelectedId,\n\t] );\n\n\t// Clear `selectedId` if the active tab is removed from the DOM in controlled mode.\n\tuseLayoutEffect( () => {\n\t\tif ( ! isControlled ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Once the tabs have populated, if the `selectedTabId` still can't be\n\t\t// found, clear the selection.\n\t\tif ( tabsHavePopulated.current && !! selectedTabId && ! selectedTab ) {\n\t\t\tsetSelectedId( null );\n\t\t}\n\t}, [\n\t\tisControlled,\n\t\tselectedId,\n\t\tselectedTab,\n\t\tselectedTabId,\n\t\tsetSelectedId,\n\t] );\n\n\treturn (\n\t\t<TabsContext.Provider value={ { store, instanceId } }>\n\t\t\t{ children }\n\t\t</TabsContext.Provider>\n\t);\n}\n\nTabs.TabList = TabList;\nTabs.Tab = Tab;\nTabs.TabPanel = TabPanel;\nexport default Tabs;\n"],"mappings":";AAAA;AACA;AACA;AACA;AACA,OAAO,KAAKA,OAAO,MAAM,gBAAgB;;AAEzC;AACA;AACA;AACA,SAASC,aAAa,QAAQ,oBAAoB;AAClD,SAASC,eAAe,EAAEC,MAAM,QAAQ,oBAAoB;;AAE5D;AACA;AACA;;AAEA,SAASC,WAAW,QAAQ,WAAW;AACvC,SAASC,GAAG,QAAQ,OAAO;AAC3B,SAASC,OAAO,QAAQ,WAAW;AACnC,SAASC,QAAQ,QAAQ,YAAY;AAErC,SAASC,IAAIA,CAAE;EACdC,YAAY,GAAG,IAAI;EACnBC,YAAY;EACZC,WAAW,GAAG,YAAY;EAC1BC,QAAQ;EACRC,QAAQ;EACRC;AACU,CAAC,EAAG;EACd,MAAMC,UAAU,GAAGd,aAAa,CAAEO,IAAI,EAAE,MAAO,CAAC;EAChD,MAAMQ,KAAK,GAAGhB,OAAO,CAACiB,WAAW,CAAE;IAClCR,YAAY;IACZE,WAAW;IACXO,iBAAiB,EAAER,YAAY,IAAK,GAAGK,UAAY,IAAIL,YAAc,EAAC;IACtES,aAAa,EAAIC,UAAU,IAAM;MAChC,MAAMC,cAAc,GACnB,OAAOD,UAAU,KAAK,QAAQ,GAC3BA,UAAU,CAACE,OAAO,CAAG,GAAGP,UAAY,GAAE,EAAE,EAAG,CAA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GAAGA,GAAG;AACdG,IAAI,CAACD,QAAQ,GAAGA,QAAQ;AACxB,eAAeC,IAAI"}
@@ -63,12 +63,12 @@ function Tooltip(props) {
63
63
  placement: computedPlacement,
64
64
  timeout: delay
65
65
  });
66
- const isTooltipOpen = tooltipStore.useState('open');
67
66
  return createElement(Fragment, null, createElement(Ariakit.TooltipAnchor, {
68
67
  onClick: hideOnClick ? tooltipStore.hide : undefined,
69
68
  store: tooltipStore,
70
69
  render: isOnlyChild ? children : undefined
71
- }, isOnlyChild ? undefined : children), isOnlyChild && (text || shortcut) && isTooltipOpen && createElement(Ariakit.Tooltip, {
70
+ }, isOnlyChild ? undefined : children), isOnlyChild && (text || shortcut) && createElement(Ariakit.Tooltip, {
71
+ unmountOnHide: true,
72
72
  className: "components-tooltip",
73
73
  gutter: 4,
74
74
  id: describedById,
@@ -1 +1 @@
1
- {"version":3,"names":["Ariakit","useInstanceId","Children","deprecated","Shortcut","positionToPlacement","TOOLTIP_DELAY","Tooltip","props","children","delay","hideOnClick","placement","position","shortcut","text","baseId","describedById","undefined","isOnlyChild","count","process","env","NODE_ENV","console","error","computedPlacement","since","alternative","tooltipStore","useTooltipStore","timeout","isTooltipOpen","useState","createElement","Fragment","TooltipAnchor","onClick","hide","store","render","className","gutter","id","overflowPadding"],"sources":["@wordpress/components/src/tooltip/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\n// eslint-disable-next-line no-restricted-imports\nimport * as Ariakit from '@ariakit/react';\n\n/**\n * WordPress dependencies\n */\nimport { useInstanceId } from '@wordpress/compose';\nimport { Children } from '@wordpress/element';\nimport deprecated from '@wordpress/deprecated';\n\n/**\n * Internal dependencies\n */\nimport type { TooltipProps } from './types';\nimport Shortcut from '../shortcut';\nimport { positionToPlacement } from '../popover/utils';\n\n/**\n * Time over anchor to wait before showing tooltip\n */\nexport const TOOLTIP_DELAY = 700;\n\nfunction Tooltip( props: TooltipProps ) {\n\tconst {\n\t\tchildren,\n\t\tdelay = TOOLTIP_DELAY,\n\t\thideOnClick = true,\n\t\tplacement,\n\t\tposition,\n\t\tshortcut,\n\t\ttext,\n\t} = props;\n\n\tconst baseId = useInstanceId( Tooltip, 'tooltip' );\n\tconst describedById = text || shortcut ? baseId : undefined;\n\n\tconst isOnlyChild = Children.count( children ) === 1;\n\t// console error if more than one child element is added\n\tif ( ! isOnlyChild ) {\n\t\tif ( 'development' === process.env.NODE_ENV ) {\n\t\t\t// eslint-disable-next-line no-console\n\t\t\tconsole.error(\n\t\t\t\t'Tooltip should be called with only a single child element.'\n\t\t\t);\n\t\t}\n\t}\n\n\t// Compute tooltip's placement:\n\t// - give priority to `placement` prop, if defined\n\t// - otherwise, compute it from the legacy `position` prop (if defined)\n\t// - finally, fallback to the default placement: 'bottom'\n\tlet computedPlacement;\n\tif ( placement !== undefined ) {\n\t\tcomputedPlacement = placement;\n\t} else if ( position !== undefined ) {\n\t\tcomputedPlacement = positionToPlacement( position );\n\t\tdeprecated( '`position` prop in wp.components.tooltip', {\n\t\t\tsince: '6.4',\n\t\t\talternative: '`placement` prop',\n\t\t} );\n\t}\n\tcomputedPlacement = computedPlacement || 'bottom';\n\n\tconst tooltipStore = Ariakit.useTooltipStore( {\n\t\tplacement: computedPlacement,\n\t\ttimeout: delay,\n\t} );\n\n\tconst isTooltipOpen = tooltipStore.useState( 'open' );\n\n\treturn (\n\t\t<>\n\t\t\t<Ariakit.TooltipAnchor\n\t\t\t\tonClick={ hideOnClick ? tooltipStore.hide : undefined }\n\t\t\t\tstore={ tooltipStore }\n\t\t\t\trender={ isOnlyChild ? children : undefined }\n\t\t\t>\n\t\t\t\t{ isOnlyChild ? undefined : children }\n\t\t\t</Ariakit.TooltipAnchor>\n\t\t\t{ isOnlyChild && ( text || shortcut ) && isTooltipOpen && (\n\t\t\t\t<Ariakit.Tooltip\n\t\t\t\t\tclassName=\"components-tooltip\"\n\t\t\t\t\tgutter={ 4 }\n\t\t\t\t\tid={ describedById }\n\t\t\t\t\toverflowPadding={ 0.5 }\n\t\t\t\t\tstore={ tooltipStore }\n\t\t\t\t>\n\t\t\t\t\t{ text }\n\t\t\t\t\t{ shortcut && (\n\t\t\t\t\t\t<Shortcut\n\t\t\t\t\t\t\tclassName={\n\t\t\t\t\t\t\t\ttext ? 'components-tooltip__shortcut' : ''\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tshortcut={ shortcut }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</Ariakit.Tooltip>\n\t\t\t) }\n\t\t</>\n\t);\n}\n\nexport default Tooltip;\n"],"mappings":";AAAA;AACA;AACA;AACA;AACA,OAAO,KAAKA,OAAO,MAAM,gBAAgB;;AAEzC;AACA;AACA;AACA,SAASC,aAAa,QAAQ,oBAAoB;AAClD,SAASC,QAAQ,QAAQ,oBAAoB;AAC7C,OAAOC,UAAU,MAAM,uBAAuB;;AAE9C;AACA;AACA;;AAEA,OAAOC,QAAQ,MAAM,aAAa;AAClC,SAASC,mBAAmB,QAAQ,kBAAkB;;AAEtD;AACA;AACA;AACA,OAAO,MAAMC,aAAa,GAAG,GAAG;AAEhC,SAASC,OAAOA,CAAEC,KAAmB,EAAG;EACvC,MAAM;IACLC,QAAQ;IACRC,KAAK,GAAGJ,aAAa;IACrBK,WAAW,GAAG,IAAI;IAClBC,SAAS;IACTC,QAAQ;IACRC,QAAQ;IACRC;EACD,CAAC,GAAGP,KAAK;EAET,MAAMQ,MAAM,GAAGf,aAAa,CAAEM,OAAO,EAAE,SAAU,CAAC;EAClD,MAAMU,aAAa,GAAGF,IAAI,IAAID,QAAQ,GAAGE,MAAM,GAAGE,SAAS;EAE3D,MAAMC,WAAW,GAAGjB,QAAQ,CAACkB,KAAK,CAAEX,QAAS,CAAC,KAAK,CAAC;EACpD;EACA,IAAK,CAAEU,WAAW,EAAG;IACpB,IAAK,aAAa,KAAKE,OAAO,CAACC,GAAG,CAACC,QAAQ,EAAG;MAC7C;MACAC,OAAO,CAACC,KAAK,CACZ,4DACD,CAAC;IACF;EACD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P,OAAO"}
1
+ {"version":3,"names":["Ariakit","useInstanceId","Children","deprecated","Shortcut","positionToPlacement","TOOLTIP_DELAY","Tooltip","props","children","delay","hideOnClick","placement","position","shortcut","text","baseId","describedById","undefined","isOnlyChild","count","process","env","NODE_ENV","console","error","computedPlacement","since","alternative","tooltipStore","useTooltipStore","timeout","createElement","Fragment","TooltipAnchor","onClick","hide","store","render","unmountOnHide","className","gutter","id","overflowPadding"],"sources":["@wordpress/components/src/tooltip/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\n// eslint-disable-next-line no-restricted-imports\nimport * as Ariakit from '@ariakit/react';\n\n/**\n * WordPress dependencies\n */\nimport { useInstanceId } from '@wordpress/compose';\nimport { Children } from '@wordpress/element';\nimport deprecated from '@wordpress/deprecated';\n\n/**\n * Internal dependencies\n */\nimport type { TooltipProps } from './types';\nimport Shortcut from '../shortcut';\nimport { positionToPlacement } from '../popover/utils';\n\n/**\n * Time over anchor to wait before showing tooltip\n */\nexport const TOOLTIP_DELAY = 700;\n\nfunction Tooltip( props: TooltipProps ) {\n\tconst {\n\t\tchildren,\n\t\tdelay = TOOLTIP_DELAY,\n\t\thideOnClick = true,\n\t\tplacement,\n\t\tposition,\n\t\tshortcut,\n\t\ttext,\n\t} = props;\n\n\tconst baseId = useInstanceId( Tooltip, 'tooltip' );\n\tconst describedById = text || shortcut ? baseId : undefined;\n\n\tconst isOnlyChild = Children.count( children ) === 1;\n\t// console error if more than one child element is added\n\tif ( ! isOnlyChild ) {\n\t\tif ( 'development' === process.env.NODE_ENV ) {\n\t\t\t// eslint-disable-next-line no-console\n\t\t\tconsole.error(\n\t\t\t\t'Tooltip should be called with only a single child element.'\n\t\t\t);\n\t\t}\n\t}\n\n\t// Compute tooltip's placement:\n\t// - give priority to `placement` prop, if defined\n\t// - otherwise, compute it from the legacy `position` prop (if defined)\n\t// - finally, fallback to the default placement: 'bottom'\n\tlet computedPlacement;\n\tif ( placement !== undefined ) {\n\t\tcomputedPlacement = placement;\n\t} else if ( position !== undefined ) {\n\t\tcomputedPlacement = positionToPlacement( position );\n\t\tdeprecated( '`position` prop in wp.components.tooltip', {\n\t\t\tsince: '6.4',\n\t\t\talternative: '`placement` prop',\n\t\t} );\n\t}\n\tcomputedPlacement = computedPlacement || 'bottom';\n\n\tconst tooltipStore = Ariakit.useTooltipStore( {\n\t\tplacement: computedPlacement,\n\t\ttimeout: delay,\n\t} );\n\n\treturn (\n\t\t<>\n\t\t\t<Ariakit.TooltipAnchor\n\t\t\t\tonClick={ hideOnClick ? tooltipStore.hide : undefined }\n\t\t\t\tstore={ tooltipStore }\n\t\t\t\trender={ isOnlyChild ? children : undefined }\n\t\t\t>\n\t\t\t\t{ isOnlyChild ? undefined : children }\n\t\t\t</Ariakit.TooltipAnchor>\n\t\t\t{ isOnlyChild && ( text || shortcut ) && (\n\t\t\t\t<Ariakit.Tooltip\n\t\t\t\t\tunmountOnHide\n\t\t\t\t\tclassName=\"components-tooltip\"\n\t\t\t\t\tgutter={ 4 }\n\t\t\t\t\tid={ describedById }\n\t\t\t\t\toverflowPadding={ 0.5 }\n\t\t\t\t\tstore={ tooltipStore }\n\t\t\t\t>\n\t\t\t\t\t{ text }\n\t\t\t\t\t{ shortcut && (\n\t\t\t\t\t\t<Shortcut\n\t\t\t\t\t\t\tclassName={\n\t\t\t\t\t\t\t\ttext ? 'components-tooltip__shortcut' : ''\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tshortcut={ shortcut }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</Ariakit.Tooltip>\n\t\t\t) }\n\t\t</>\n\t);\n}\n\nexport default Tooltip;\n"],"mappings":";AAAA;AACA;AACA;AACA;AACA,OAAO,KAAKA,OAAO,MAAM,gBAAgB;;AAEzC;AACA;AACA;AACA,SAASC,aAAa,QAAQ,oBAAoB;AAClD,SAASC,QAAQ,QAAQ,oBAAoB;AAC7C,OAAOC,UAAU,MAAM,uBAAuB;;AAE9C;AACA;AACA;;AAEA,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aAAa;IACrBC,OAAO,EAAGxB,WAAW,GAAGkB,YAAY,CAACO,IAAI,GAAGlB,SAAW;IACvDmB,KAAK,EAAGR,YAAc;IACtBS,MAAM,EAAGnB,WAAW,GAAGV,QAAQ,GAAGS;EAAW,GAE3CC,WAAW,GAAGD,SAAS,GAAGT,QACN,CAAC,EACtBU,WAAW,KAAMJ,IAAI,IAAID,QAAQ,CAAE,IACpCkB,aAAA,CAAChC,OAAO,CAACO,OAAO;IACfgC,aAAa;IACbC,SAAS,EAAC,oBAAoB;IAC9BC,MAAM,EAAG,CAAG;IACZC,EAAE,EAAGzB,aAAe;IACpB0B,eAAe,EAAG,GAAK;IACvBN,KAAK,EAAGR;EAAc,GAEpBd,IAAI,EACJD,QAAQ,IACTkB,aAAA,CAAC5B,QAAQ;IACRoC,SAAS,EACRzB,IAAI,GAAG,8BAA8B,GAAG,EACxC;IACDD,QAAQ,EAAGA;EAAU,CACrB,CAEc,CAEjB,CAAC;AAEL;AAEA,eAAeP,OAAO"}
@@ -3299,7 +3299,7 @@ body.lockscroll {
3299
3299
  }
3300
3300
  .components-accessible-toolbar .components-button:focus::before,
3301
3301
  .components-toolbar .components-button:focus::before {
3302
- box-shadow: inset 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color), inset 0 0 0 4px #fff;
3302
+ box-shadow: inset 0 0 0 1px var(--wp-components-color-background, #fff), 0 0 0 var(--wp-admin-border-width-focus) var(--wp-components-color-accent, var(--wp-admin-theme-color, #3858e9));
3303
3303
  outline: 2px solid transparent;
3304
3304
  }
3305
3305
  .components-accessible-toolbar .components-button.has-icon.has-icon,
@@ -3311,7 +3311,7 @@ body.lockscroll {
3311
3311
  }
3312
3312
  .components-accessible-toolbar .components-button:focus::before,
3313
3313
  .components-toolbar .components-button:focus::before {
3314
- box-shadow: inset 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color), inset 0 0 0 4px #fff;
3314
+ box-shadow: inset 0 0 0 1px var(--wp-components-color-background, #fff), 0 0 0 var(--wp-admin-border-width-focus) var(--wp-components-color-accent, var(--wp-admin-theme-color, #3858e9));
3315
3315
  outline: 2px solid transparent;
3316
3316
  }
3317
3317
  .components-accessible-toolbar .components-button.has-icon.has-icon,
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/autocomplete/index.tsx"],"names":[],"mappings":";AA8BA,OAAO,KAAK,EACX,iBAAiB,EAMjB,oBAAoB,EAEpB,MAAM,SAAS,CAAC;AAIjB,wBAAgB,eAAe,CAAE,EAChC,MAAM,EACN,QAAQ,EACR,SAAS,EACT,UAAU,EACV,UAAU,GACV,EAAE,oBAAoB;;;uBA+FS,aAAa;;EA6M5C;AAeD,wBAAgB,oBAAoB,CAAE,OAAO,EAAE,oBAAoB;;;;;;;;;;;;EAsClE;AAED,MAAM,CAAC,OAAO,UAAU,YAAY,CAAE,EACrC,QAAQ,EACR,UAAU,EACV,GAAG,OAAO,EACV,EAAE,iBAAiB,eAQnB"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/autocomplete/index.tsx"],"names":[],"mappings":";AAgCA,OAAO,KAAK,EACX,iBAAiB,EAMjB,oBAAoB,EAEpB,MAAM,SAAS,CAAC;AAiCjB,wBAAgB,eAAe,CAAE,EAChC,MAAM,EACN,QAAQ,EACR,SAAS,EACT,UAAU,EACV,UAAU,GACV,EAAE,oBAAoB;;;uBA+FS,aAAa;;EAyO5C;AAeD,wBAAgB,oBAAoB,CAAE,OAAO,EAAE,oBAAoB;;;;;;;;;;;;EAsClE;AAED,MAAM,CAAC,OAAO,UAAU,YAAY,CAAE,EACrC,QAAQ,EACR,UAAU,EACV,GAAG,OAAO,EACV,EAAE,iBAAiB,eAQnB"}
@@ -0,0 +1,11 @@
1
+ /// <reference types="react" />
2
+ import type { DropdownMenuContext as DropdownMenuContextType, DropdownMenuProps, DropdownMenuGroupProps, DropdownMenuGroupLabelProps, DropdownMenuItemProps, DropdownMenuCheckboxItemProps, DropdownMenuRadioItemProps, DropdownMenuSeparatorProps } from './types';
3
+ export declare const DropdownMenuContext: import("react").Context<DropdownMenuContextType | undefined>;
4
+ export declare const DropdownMenuItem: import("react").ForwardRefExoticComponent<DropdownMenuItemProps & Omit<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof import("react").HTMLAttributes<HTMLDivElement>>, "as" | keyof DropdownMenuItemProps> & import("react").RefAttributes<HTMLDivElement>>;
5
+ export declare const DropdownMenuCheckboxItem: import("react").ForwardRefExoticComponent<DropdownMenuCheckboxItemProps & Omit<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof import("react").HTMLAttributes<HTMLDivElement>>, "as" | keyof DropdownMenuCheckboxItemProps> & import("react").RefAttributes<HTMLDivElement>>;
6
+ export declare const DropdownMenuRadioItem: import("react").ForwardRefExoticComponent<DropdownMenuRadioItemProps & Omit<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof import("react").HTMLAttributes<HTMLDivElement>>, "as" | keyof DropdownMenuRadioItemProps> & import("react").RefAttributes<HTMLDivElement>>;
7
+ export declare const DropdownMenuGroup: import("react").ForwardRefExoticComponent<DropdownMenuGroupProps & Omit<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof import("react").HTMLAttributes<HTMLDivElement>>, "children" | "as"> & import("react").RefAttributes<HTMLDivElement>>;
8
+ export declare const DropdownMenuGroupLabel: import("react").ForwardRefExoticComponent<DropdownMenuGroupLabelProps & Omit<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof import("react").HTMLAttributes<HTMLDivElement>>, "children" | "as"> & import("react").RefAttributes<HTMLDivElement>>;
9
+ export declare const DropdownMenu: import("../context").WordPressComponent<"div", DropdownMenuProps & import("react").RefAttributes<any>, false>;
10
+ export declare const DropdownMenuSeparator: import("react").ForwardRefExoticComponent<DropdownMenuSeparatorProps & Omit<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLHRElement>, HTMLHRElement>, "key" | keyof import("react").HTMLAttributes<HTMLHRElement>>, "children" | "as"> & import("react").RefAttributes<HTMLHRElement>>;
11
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/dropdown-menu-v2-ariakit/index.tsx"],"names":[],"mappings":";AA2BA,OAAO,KAAK,EACX,mBAAmB,IAAI,uBAAuB,EAC9C,iBAAiB,EACjB,sBAAsB,EACtB,2BAA2B,EAC3B,qBAAqB,EACrB,6BAA6B,EAC7B,0BAA0B,EAC1B,0BAA0B,EAC1B,MAAM,SAAS,CAAC;AAGjB,eAAO,MAAM,mBAAmB,8DAElB,CAAC;AAEf,eAAO,MAAM,gBAAgB,oUAyB1B,CAAC;AAEJ,eAAO,MAAM,wBAAwB,oVA6BlC,CAAC;AAEJ,eAAO,MAAM,qBAAqB,8UAiC/B,CAAC;AAEJ,eAAO,MAAM,iBAAiB,oTAY3B,CAAC;AAEJ,eAAO,MAAM,sBAAsB,yTAYhC,CAAC;AAyIJ,eAAO,MAAM,YAAY,+GAGxB,CAAC;AAEF,eAAO,MAAM,qBAAqB,oTAa/B,CAAC"}
@@ -0,0 +1,16 @@
1
+ /**
2
+ * External dependencies
3
+ */
4
+ import type { Meta, StoryFn } from '@storybook/react';
5
+ import { DropdownMenu } from '..';
6
+ declare const meta: Meta<typeof DropdownMenu>;
7
+ export default meta;
8
+ export declare const Default: StoryFn<typeof DropdownMenu>;
9
+ export declare const WithSubmenu: StoryFn<typeof DropdownMenu>;
10
+ export declare const WithCheckboxes: StoryFn<typeof DropdownMenu>;
11
+ export declare const WithRadios: StoryFn<typeof DropdownMenu>;
12
+ export declare const WithModals: StoryFn<typeof DropdownMenu>;
13
+ export declare const WithSlotFill: StoryFn<typeof DropdownMenu>;
14
+ export declare const ToolbarVariant: StoryFn<typeof DropdownMenu>;
15
+ export declare const InsideModal: StoryFn<typeof DropdownMenu>;
16
+ //# sourceMappingURL=index.story.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.story.d.ts","sourceRoot":"","sources":["../../../src/dropdown-menu-v2-ariakit/stories/index.story.tsx"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AActD,OAAO,EACN,YAAY,EAQZ,MAAM,IAAI,CAAC;AAOZ,QAAA,MAAM,IAAI,EAAE,IAAI,CAAE,OAAO,YAAY,CA8BpC,CAAC;AACF,eAAe,IAAI,CAAC;AAgBpB,eAAO,MAAM,OAAO,EAAE,OAAO,CAAE,OAAO,YAAY,CAqCjD,CAAC;AASF,eAAO,MAAM,WAAW,EAAE,OAAO,CAAE,OAAO,YAAY,CAgBrD,CAAC;AAKF,eAAO,MAAM,cAAc,EAAE,OAAO,CAAE,OAAO,YAAY,CAuGxD,CAAC;AAKF,eAAO,MAAM,UAAU,EAAE,OAAO,CAAE,OAAO,YAAY,CA+CpD,CAAC;AAYF,eAAO,MAAM,UAAU,EAAE,OAAO,CAAE,OAAO,YAAY,CA+CpD,CAAC;AAkDF,eAAO,MAAM,YAAY,EAAE,OAAO,CAAE,OAAO,YAAY,CAoBtD,CAAC;AAUF,eAAO,MAAM,cAAc,EAAE,OAAO,CAAE,OAAO,YAAY,CAaxD,CAAC;AAKF,eAAO,MAAM,WAAW,EAAE,OAAO,CAAE,OAAO,YAAY,CAkCrD,CAAC"}
@@ -0,0 +1,88 @@
1
+ /// <reference types="react" />
2
+ /**
3
+ * External dependencies
4
+ */
5
+ import * as Ariakit from '@ariakit/react';
6
+ import type { DropdownMenuContext } from './types';
7
+ export declare const DropdownMenu: import("@emotion/styled").StyledComponent<Ariakit.MenuOptions<"div"> & {
8
+ [index: `data-${string}`]: unknown;
9
+ wrapElement?: import("@ariakit/react-core/cjs/utils/types").WrapElement | undefined;
10
+ children?: import("@ariakit/react-core/cjs/utils/types").Children<any>;
11
+ render?: import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | import("@ariakit/react-core/cjs/utils/types").RenderProp<import("react").HTMLAttributes<any> & import("react").RefAttributes<any>> | undefined;
12
+ } & Omit<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof import("react").HTMLAttributes<HTMLDivElement>> & {
13
+ ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
14
+ }, "children" | keyof Ariakit.MenuOptions<"div">> & {
15
+ theme?: import("@emotion/react").Theme | undefined;
16
+ } & Pick<DropdownMenuContext, "variant">, {}, {}>;
17
+ export declare const ItemPrefixWrapper: import("@emotion/styled").StyledComponent<{
18
+ theme?: import("@emotion/react").Theme | undefined;
19
+ as?: import("react").ElementType<any> | undefined;
20
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
21
+ export declare const ItemSuffixWrapper: import("@emotion/styled").StyledComponent<{
22
+ theme?: import("@emotion/react").Theme | undefined;
23
+ as?: import("react").ElementType<any> | undefined;
24
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
25
+ export declare const DropdownMenuItem: import("@emotion/styled").StyledComponent<Ariakit.MenuItemOptions<"div"> & {
26
+ [index: `data-${string}`]: unknown;
27
+ wrapElement?: import("@ariakit/react-core/cjs/utils/types").WrapElement | undefined;
28
+ children?: import("@ariakit/react-core/cjs/utils/types").Children<any>;
29
+ render?: import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | import("@ariakit/react-core/cjs/utils/types").RenderProp<import("react").HTMLAttributes<any> & import("react").RefAttributes<any>> | undefined;
30
+ } & Omit<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof import("react").HTMLAttributes<HTMLDivElement>> & {
31
+ ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
32
+ }, "children" | keyof Ariakit.MenuItemOptions<"div">> & {
33
+ theme?: import("@emotion/react").Theme | undefined;
34
+ }, {}, {}>;
35
+ export declare const DropdownMenuCheckboxItem: import("@emotion/styled").StyledComponent<Ariakit.MenuItemCheckboxOptions<"div"> & {
36
+ [index: `data-${string}`]: unknown;
37
+ wrapElement?: import("@ariakit/react-core/cjs/utils/types").WrapElement | undefined;
38
+ children?: import("@ariakit/react-core/cjs/utils/types").Children<any>;
39
+ render?: import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | import("@ariakit/react-core/cjs/utils/types").RenderProp<import("react").HTMLAttributes<any> & import("react").RefAttributes<any>> | undefined;
40
+ } & Omit<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof import("react").HTMLAttributes<HTMLDivElement>> & {
41
+ ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
42
+ }, "children" | keyof Ariakit.MenuItemCheckboxOptions<"div">> & {
43
+ theme?: import("@emotion/react").Theme | undefined;
44
+ }, {}, {}>;
45
+ export declare const DropdownMenuRadioItem: import("@emotion/styled").StyledComponent<Ariakit.MenuItemRadioOptions<"div"> & {
46
+ [index: `data-${string}`]: unknown;
47
+ wrapElement?: import("@ariakit/react-core/cjs/utils/types").WrapElement | undefined;
48
+ children?: import("@ariakit/react-core/cjs/utils/types").Children<any>;
49
+ render?: import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | import("@ariakit/react-core/cjs/utils/types").RenderProp<import("react").HTMLAttributes<any> & import("react").RefAttributes<any>> | undefined;
50
+ } & Omit<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof import("react").HTMLAttributes<HTMLDivElement>> & {
51
+ ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
52
+ }, "children" | keyof Ariakit.MenuItemRadioOptions<"div">> & {
53
+ theme?: import("@emotion/react").Theme | undefined;
54
+ }, {}, {}>;
55
+ export declare const DropdownMenuGroup: import("@emotion/styled").StyledComponent<Ariakit.MenuGroupOptions<"div"> & {
56
+ [index: `data-${string}`]: unknown;
57
+ wrapElement?: import("@ariakit/react-core/cjs/utils/types").WrapElement | undefined;
58
+ children?: import("@ariakit/react-core/cjs/utils/types").Children<any>;
59
+ render?: import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | import("@ariakit/react-core/cjs/utils/types").RenderProp<import("react").HTMLAttributes<any> & import("react").RefAttributes<any>> | undefined;
60
+ } & Omit<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof import("react").HTMLAttributes<HTMLDivElement>> & {
61
+ ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
62
+ }, "children" | keyof Ariakit.MenuGroupOptions<"div">> & {
63
+ theme?: import("@emotion/react").Theme | undefined;
64
+ }, {}, {}>;
65
+ export declare const DropdownMenuGroupLabel: import("@emotion/styled").StyledComponent<Ariakit.MenuGroupLabelOptions<"div"> & {
66
+ [index: `data-${string}`]: unknown;
67
+ wrapElement?: import("@ariakit/react-core/cjs/utils/types").WrapElement | undefined;
68
+ children?: import("@ariakit/react-core/cjs/utils/types").Children<any>;
69
+ render?: import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | import("@ariakit/react-core/cjs/utils/types").RenderProp<import("react").HTMLAttributes<any> & import("react").RefAttributes<any>> | undefined;
70
+ } & Omit<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof import("react").HTMLAttributes<HTMLDivElement>> & {
71
+ ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
72
+ }, "children" | keyof Ariakit.MenuGroupLabelOptions<"div">> & {
73
+ theme?: import("@emotion/react").Theme | undefined;
74
+ }, {}, {}>;
75
+ export declare const DropdownMenuSeparator: import("@emotion/styled").StyledComponent<Ariakit.MenuSeparatorOptions<"hr"> & {
76
+ [index: `data-${string}`]: unknown;
77
+ wrapElement?: import("@ariakit/react-core/cjs/utils/types").WrapElement | undefined;
78
+ children?: import("@ariakit/react-core/cjs/utils/types").Children<any>;
79
+ render?: import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | import("@ariakit/react-core/cjs/utils/types").RenderProp<import("react").HTMLAttributes<any> & import("react").RefAttributes<any>> | undefined;
80
+ } & Omit<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLHRElement>, HTMLHRElement>, "key" | keyof import("react").HTMLAttributes<HTMLHRElement>> & {
81
+ ref?: ((instance: HTMLHRElement | null) => void) | import("react").RefObject<HTMLHRElement> | null | undefined;
82
+ }, "children" | keyof Ariakit.MenuSeparatorOptions<"hr">> & {
83
+ theme?: import("@emotion/react").Theme | undefined;
84
+ } & Pick<DropdownMenuContext, "variant">, {}, {}>;
85
+ export declare const SubmenuChevronIcon: import("@emotion/styled").StyledComponent<import("../icon").Props & {
86
+ theme?: import("@emotion/react").Theme | undefined;
87
+ }, {}, {}>;
88
+ //# sourceMappingURL=styles.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../src/dropdown-menu-v2-ariakit/styles.ts"],"names":[],"mappings":";AAAA;;GAEG;AAEH,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAC;AAU1C,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAmDnD,eAAO,MAAM,YAAY;;;;;;;;;iDA6CxB,CAAC;AA4DF,eAAO,MAAM,iBAAiB;;;2GAE7B,CAAC;AAEF,eAAO,MAAM,iBAAiB;;;2GAE7B,CAAC;AA8DF,eAAO,MAAM,gBAAgB;;;;;;;;;UAE5B,CAAC;AAEF,eAAO,MAAM,wBAAwB;;;;;;;;;UAEpC,CAAC;AAEF,eAAO,MAAM,qBAAqB;;;;;;;;;UAEjC,CAAC;AAEF,eAAO,MAAM,iBAAiB;;;;;;;;;UAAgC,CAAC;AAE/D,eAAO,MAAM,sBAAsB;;;;;;;;;UAgBlC,CAAC;AAEF,eAAO,MAAM,qBAAqB;;;;;;;;;iDAejC,CAAC;AAEF,eAAO,MAAM,kBAAkB;;UAS9B,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/dropdown-menu-v2-ariakit/test/index.tsx"],"names":[],"mappings":""}
@@ -0,0 +1,174 @@
1
+ /// <reference types="react" />
2
+ /**
3
+ * External dependencies
4
+ */
5
+ import type * as Ariakit from '@ariakit/react';
6
+ import type { Placement } from '@floating-ui/react-dom';
7
+ export interface DropdownMenuContext {
8
+ /**
9
+ * The ariakit store shared across all DropdownMenu subcomponents.
10
+ */
11
+ store: Ariakit.MenuStore;
12
+ /**
13
+ * The variant used by the underlying menu popover.
14
+ */
15
+ variant?: 'toolbar';
16
+ }
17
+ export interface DropdownMenuProps {
18
+ /**
19
+ * The trigger button.
20
+ */
21
+ trigger: React.ReactElement;
22
+ /**
23
+ * The contents of the dropdown.
24
+ */
25
+ children?: React.ReactNode;
26
+ /**
27
+ * The open state of the dropdown menu when it is initially rendered. Use when
28
+ * not wanting to control its open state.
29
+ *
30
+ * @default false
31
+ */
32
+ defaultOpen?: boolean;
33
+ /**
34
+ * The controlled open state of the dropdown menu. Must be used in conjunction
35
+ * with `onOpenChange`.
36
+ */
37
+ open?: boolean;
38
+ /**
39
+ * Event handler called when the open state of the dropdown menu changes.
40
+ */
41
+ onOpenChange?: (open: boolean) => void;
42
+ /**
43
+ * The modality of the dropdown menu. When set to true, interaction with
44
+ * outside elements will be disabled and only menu content will be visible to
45
+ * screen readers.
46
+ *
47
+ * @default true
48
+ */
49
+ modal?: boolean;
50
+ /**
51
+ * The placement of the dropdown menu popover.
52
+ *
53
+ * @default 'bottom-start' for root-level menus, 'right-start' for nested menus
54
+ */
55
+ placement?: Placement;
56
+ /**
57
+ * The distance between the popover and the anchor element.
58
+ *
59
+ * @default 8 for root-level menus, 16 for nested menus
60
+ */
61
+ gutter?: number;
62
+ /**
63
+ * The skidding of the popover along the anchor element. Can be set to
64
+ * negative values to make the popover shift to the opposite side.
65
+ *
66
+ * @default 0 for root-level menus, -8 for nested menus
67
+ */
68
+ shift?: number;
69
+ /**
70
+ * Determines whether the menu popover will be hidden when the user presses
71
+ * the Escape key.
72
+ *
73
+ * @default true
74
+ */
75
+ hideOnEscape?: boolean | ((event: KeyboardEvent | React.KeyboardEvent<Element>) => boolean);
76
+ }
77
+ export interface DropdownMenuGroupProps {
78
+ /**
79
+ * The contents of the dropdown menu group.
80
+ */
81
+ children: React.ReactNode;
82
+ }
83
+ export interface DropdownMenuGroupLabelProps {
84
+ /**
85
+ * The contents of the dropdown menu group label.
86
+ */
87
+ children: React.ReactNode;
88
+ }
89
+ export interface DropdownMenuItemProps {
90
+ /**
91
+ * The contents of the menu item.
92
+ */
93
+ children: React.ReactNode;
94
+ /**
95
+ * The contents of the menu item's prefix.
96
+ */
97
+ prefix?: React.ReactNode;
98
+ /**
99
+ * The contents of the menu item's suffix.
100
+ */
101
+ suffix?: React.ReactNode;
102
+ /**
103
+ * Whether to hide the parent menu when the item is clicked.
104
+ *
105
+ * @default true
106
+ */
107
+ hideOnClick?: boolean;
108
+ /**
109
+ * Determines if the element is disabled.
110
+ */
111
+ disabled?: boolean;
112
+ }
113
+ export interface DropdownMenuCheckboxItemProps extends Omit<DropdownMenuItemProps, 'prefix' | 'hideOnClick'> {
114
+ /**
115
+ * Whether to hide the dropdown menu when the item is clicked.
116
+ *
117
+ * @default false
118
+ */
119
+ hideOnClick?: boolean;
120
+ /**
121
+ * The checkbox menu item's name.
122
+ */
123
+ name: string;
124
+ /**
125
+ * The checkbox item's value, useful when using multiple checkbox menu items
126
+ * associated to the same `name`.
127
+ */
128
+ value?: string;
129
+ /**
130
+ * The controlled checked state of the checkbox menu item.
131
+ */
132
+ checked?: boolean;
133
+ /**
134
+ * The checked state of the checkbox menu item when it is initially rendered.
135
+ * Use when not wanting to control its checked state.
136
+ */
137
+ defaultChecked?: boolean;
138
+ /**
139
+ * Event handler called when the checked state of the checkbox menu item changes.
140
+ */
141
+ onChange?: (event: React.ChangeEvent<HTMLInputElement>) => void;
142
+ }
143
+ export interface DropdownMenuRadioItemProps extends Omit<DropdownMenuItemProps, 'prefix' | 'hideOnClick'> {
144
+ /**
145
+ * Whether to hide the dropdown menu when the item is clicked.
146
+ *
147
+ * @default false
148
+ */
149
+ hideOnClick?: boolean;
150
+ /**
151
+ * The radio item's name.
152
+ */
153
+ name: string;
154
+ /**
155
+ * The radio item's value.
156
+ */
157
+ value: string | number;
158
+ /**
159
+ * The controlled checked state of the radio menu item.
160
+ */
161
+ checked?: boolean;
162
+ /**
163
+ * The checked state of the radio menu item when it is initially rendered.
164
+ * Use when not wanting to control its checked state.
165
+ */
166
+ defaultChecked?: boolean;
167
+ /**
168
+ * Event handler called when the checked radio menu item changes.
169
+ */
170
+ onChange?: (event: React.ChangeEvent<HTMLInputElement>) => void;
171
+ }
172
+ export interface DropdownMenuSeparatorProps {
173
+ }
174
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/dropdown-menu-v2-ariakit/types.ts"],"names":[],"mappings":";AAAA;;GAEG;AAEH,OAAO,KAAK,KAAK,OAAO,MAAM,gBAAgB,CAAC;AAC/C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAExD,MAAM,WAAW,mBAAmB;IACnC;;OAEG;IACH,KAAK,EAAE,OAAO,CAAC,SAAS,CAA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W,6BAChB,SAAQ,IAAI,CAAE,qBAAqB,EAAE,QAAQ,GAAG,aAAa,CAAE;IAC/D;;;;OAIG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;OAGG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB;;OAEG;IACH,QAAQ,CAAC,EAAE,CAAE,KAAK,EAAE,KAAK,CAAC,WAAW,CAAE,gBAAgB,CAAE,KAAM,IAAI,CAAC;CACpE;AAED,MAAM,WAAW,0BAChB,SAAQ,IAAI,CAAE,qBAAqB,EAAE,QAAQ,GAAG,aAAa,CAAE;IAC/D;;;;OAIG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;IACvB;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;OAGG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB;;OAEG;IACH,QAAQ,CAAC,EAAE,CAAE,KAAK,EAAE,KAAK,CAAC,WAAW,CAAE,gBAAgB,CAAE,KAAM,IAAI,CAAC;CACpE;AAED,MAAM,WAAW,0BAA0B;CAAG"}
@@ -1 +1 @@
1
- {"version":3,"file":"private-apis.d.ts","sourceRoot":"","sources":["../src/private-apis.ts"],"names":[],"mappings":"AAmCA,eAAO,MAAQ,IAAI,2CAAE,MAAM,sBAIzB,CAAC;AAEH,eAAO,MAAM,WAAW,IAAK,CAAC"}
1
+ {"version":3,"file":"private-apis.d.ts","sourceRoot":"","sources":["../src/private-apis.ts"],"names":[],"mappings":"AA4CA,eAAO,MAAQ,IAAI,2CAAE,MAAM,sBAIzB,CAAC;AAEH,eAAO,MAAM,WAAW,IAAK,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tooltip/index.tsx"],"names":[],"mappings":";AAaA;;GAEG;AACH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAI5C;;GAEG;AACH,eAAO,MAAM,aAAa,MAAM,CAAC;AAEjC,iBAAS,OAAO,CAAE,KAAK,EAAE,YAAY,eA8EpC;AAED,eAAe,OAAO,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tooltip/index.tsx"],"names":[],"mappings":";AAaA;;GAEG;AACH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAI5C;;GAEG;AACH,eAAO,MAAM,aAAa,MAAM,CAAC;AAEjC,iBAAS,OAAO,CAAE,KAAK,EAAE,YAAY,eA6EpC;AAED,eAAe,OAAO,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/components",
3
- "version": "25.10.0",
3
+ "version": "25.11.1-next.f8d8eceb.0",
4
4
  "description": "UI components for WordPress.",
5
5
  "author": "The WordPress Contributors",
6
6
  "license": "GPL-2.0-or-later",
@@ -30,7 +30,8 @@
30
30
  ],
31
31
  "types": "build-types",
32
32
  "dependencies": {
33
- "@ariakit/react": "^0.3.3",
33
+ "@ariakit/react": "^0.3.5",
34
+ "@ariakit/test": "^0.3.0",
34
35
  "@babel/runtime": "^7.16.0",
35
36
  "@emotion/cache": "^11.7.1",
36
37
  "@emotion/css": "^11.7.1",
@@ -43,23 +44,23 @@
43
44
  "@types/gradient-parser": "0.1.3",
44
45
  "@types/highlight-words-core": "1.2.1",
45
46
  "@use-gesture/react": "^10.2.24",
46
- "@wordpress/a11y": "^3.44.0",
47
- "@wordpress/compose": "^6.21.0",
48
- "@wordpress/date": "^4.44.0",
49
- "@wordpress/deprecated": "^3.44.0",
50
- "@wordpress/dom": "^3.44.0",
51
- "@wordpress/element": "^5.21.0",
52
- "@wordpress/escape-html": "^2.44.0",
53
- "@wordpress/hooks": "^3.44.0",
54
- "@wordpress/html-entities": "^3.44.0",
55
- "@wordpress/i18n": "^4.44.0",
56
- "@wordpress/icons": "^9.35.0",
57
- "@wordpress/is-shallow-equal": "^4.44.0",
58
- "@wordpress/keycodes": "^3.44.0",
59
- "@wordpress/primitives": "^3.42.0",
60
- "@wordpress/private-apis": "^0.26.0",
61
- "@wordpress/rich-text": "^6.21.0",
62
- "@wordpress/warning": "^2.44.0",
47
+ "@wordpress/a11y": "^3.44.1-next.f8d8eceb.0",
48
+ "@wordpress/compose": "^6.21.1-next.f8d8eceb.0",
49
+ "@wordpress/date": "^4.44.1-next.f8d8eceb.0",
50
+ "@wordpress/deprecated": "^3.44.1-next.f8d8eceb.0",
51
+ "@wordpress/dom": "^3.44.1-next.f8d8eceb.0",
52
+ "@wordpress/element": "^5.21.1-next.f8d8eceb.0",
53
+ "@wordpress/escape-html": "^2.44.1-next.f8d8eceb.0",
54
+ "@wordpress/hooks": "^3.44.1-next.f8d8eceb.0",
55
+ "@wordpress/html-entities": "^3.44.1-next.f8d8eceb.0",
56
+ "@wordpress/i18n": "^4.44.1-next.f8d8eceb.0",
57
+ "@wordpress/icons": "^9.35.1-next.f8d8eceb.0",
58
+ "@wordpress/is-shallow-equal": "^4.44.1-next.f8d8eceb.0",
59
+ "@wordpress/keycodes": "^3.44.1-next.f8d8eceb.0",
60
+ "@wordpress/primitives": "^3.42.1-next.f8d8eceb.0",
61
+ "@wordpress/private-apis": "^0.26.1-next.f8d8eceb.0",
62
+ "@wordpress/rich-text": "^6.21.1-next.f8d8eceb.0",
63
+ "@wordpress/warning": "^2.44.1-next.f8d8eceb.0",
63
64
  "change-case": "^4.1.2",
64
65
  "classnames": "^2.3.1",
65
66
  "colord": "^2.7.0",
@@ -89,5 +90,5 @@
89
90
  "publishConfig": {
90
91
  "access": "public"
91
92
  },
92
- "gitHead": "f83bb1a71e8fa416131b81a9f282a72a1dc6c694"
93
+ "gitHead": "8d8fd197e202b8104ffb1cb83048efd0a6c3faf4"
93
94
  }