@wordpress/ui 0.13.1-next.v.202605131032.0 → 0.15.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.
- package/CHANGELOG.md +46 -1
- package/CONTRIBUTING.md +34 -0
- package/README.md +15 -0
- package/build/alert-dialog/portal.cjs.map +2 -2
- package/build/alert-dialog/types.cjs.map +1 -1
- package/build/button/button.cjs +1 -1
- package/build/button/button.cjs.map +2 -2
- package/build/card/content.cjs +1 -1
- package/build/card/content.cjs.map +2 -2
- package/build/card/full-bleed.cjs +1 -1
- package/build/card/full-bleed.cjs.map +2 -2
- package/build/card/header.cjs +1 -1
- package/build/card/header.cjs.map +2 -2
- package/build/card/root.cjs +1 -1
- package/build/card/root.cjs.map +2 -2
- package/build/collapsible-card/header.cjs.map +2 -2
- package/build/dialog/portal.cjs.map +2 -2
- package/build/dialog/types.cjs.map +1 -1
- package/build/drawer/portal.cjs.map +2 -2
- package/build/drawer/types.cjs.map +1 -1
- package/build/form/primitives/autocomplete/clear.cjs +4 -1
- package/build/form/primitives/autocomplete/clear.cjs.map +2 -2
- package/build/form/primitives/autocomplete/empty.cjs +1 -1
- package/build/form/primitives/autocomplete/empty.cjs.map +2 -2
- package/build/form/primitives/autocomplete/index.cjs +4 -1
- package/build/form/primitives/autocomplete/index.cjs.map +2 -2
- package/build/form/primitives/autocomplete/item.cjs +1 -1
- package/build/form/primitives/autocomplete/item.cjs.map +2 -2
- package/build/form/primitives/autocomplete/list-body.cjs +1 -1
- package/build/form/primitives/autocomplete/list-body.cjs.map +2 -2
- package/build/form/primitives/autocomplete/list.cjs +1 -1
- package/build/form/primitives/autocomplete/list.cjs.map +2 -2
- package/build/form/primitives/autocomplete/popup.cjs +14 -31
- package/build/form/primitives/autocomplete/popup.cjs.map +3 -3
- package/build/form/primitives/autocomplete/portal.cjs +10 -2
- package/build/form/primitives/autocomplete/portal.cjs.map +2 -2
- package/build/form/primitives/autocomplete/positioner.cjs +158 -0
- package/build/form/primitives/autocomplete/positioner.cjs.map +7 -0
- package/build/form/primitives/autocomplete/types.cjs.map +1 -1
- package/build/form/primitives/constants.cjs.map +2 -2
- package/build/form/primitives/select/index.cjs +4 -1
- package/build/form/primitives/select/index.cjs.map +2 -2
- package/build/form/primitives/select/item.cjs +1 -1
- package/build/form/primitives/select/item.cjs.map +2 -2
- package/build/form/primitives/select/popup.cjs +18 -36
- package/build/form/primitives/select/popup.cjs.map +3 -3
- package/build/form/primitives/select/portal.cjs +11 -5
- package/build/form/primitives/select/portal.cjs.map +2 -2
- package/build/form/primitives/select/positioner.cjs +159 -0
- package/build/form/primitives/select/positioner.cjs.map +7 -0
- package/build/form/primitives/select/types.cjs.map +1 -1
- package/build/icon-button/icon-button.cjs +1 -1
- package/build/icon-button/icon-button.cjs.map +2 -2
- package/build/index.cjs +7 -1
- package/build/index.cjs.map +2 -2
- package/build/popover/index.cjs +3 -0
- package/build/popover/index.cjs.map +2 -2
- package/build/popover/popup.cjs +23 -51
- package/build/popover/popup.cjs.map +3 -3
- package/build/popover/portal.cjs.map +2 -2
- package/build/popover/positioner.cjs +168 -0
- package/build/popover/positioner.cjs.map +7 -0
- package/build/popover/root.cjs.map +2 -2
- package/build/popover/types.cjs.map +1 -1
- package/build/tooltip/portal.cjs +10 -2
- package/build/tooltip/portal.cjs.map +2 -2
- package/build/tooltip/positioner.cjs.map +2 -2
- package/build/tooltip/types.cjs.map +1 -1
- package/build/utils/use-enable-wp-compat-overlay-slot.cjs +39 -0
- package/build/utils/use-enable-wp-compat-overlay-slot.cjs.map +7 -0
- package/build/utils/wp-compat-overlay-slot.cjs +177 -0
- package/build/utils/wp-compat-overlay-slot.cjs.map +7 -0
- package/build-module/alert-dialog/portal.mjs.map +2 -2
- package/build-module/button/button.mjs +1 -1
- package/build-module/button/button.mjs.map +2 -2
- package/build-module/card/content.mjs +1 -1
- package/build-module/card/content.mjs.map +2 -2
- package/build-module/card/full-bleed.mjs +1 -1
- package/build-module/card/full-bleed.mjs.map +2 -2
- package/build-module/card/header.mjs +1 -1
- package/build-module/card/header.mjs.map +2 -2
- package/build-module/card/root.mjs +1 -1
- package/build-module/card/root.mjs.map +2 -2
- package/build-module/collapsible-card/header.mjs.map +2 -2
- package/build-module/dialog/portal.mjs.map +2 -2
- package/build-module/drawer/portal.mjs.map +2 -2
- package/build-module/form/primitives/autocomplete/clear.mjs +4 -1
- package/build-module/form/primitives/autocomplete/clear.mjs.map +2 -2
- package/build-module/form/primitives/autocomplete/empty.mjs +1 -1
- package/build-module/form/primitives/autocomplete/empty.mjs.map +2 -2
- package/build-module/form/primitives/autocomplete/index.mjs +3 -1
- package/build-module/form/primitives/autocomplete/index.mjs.map +2 -2
- package/build-module/form/primitives/autocomplete/item.mjs +1 -1
- package/build-module/form/primitives/autocomplete/item.mjs.map +2 -2
- package/build-module/form/primitives/autocomplete/list-body.mjs +1 -1
- package/build-module/form/primitives/autocomplete/list-body.mjs.map +2 -2
- package/build-module/form/primitives/autocomplete/list.mjs +1 -1
- package/build-module/form/primitives/autocomplete/list.mjs.map +2 -2
- package/build-module/form/primitives/autocomplete/popup.mjs +14 -31
- package/build-module/form/primitives/autocomplete/popup.mjs.map +3 -3
- package/build-module/form/primitives/autocomplete/portal.mjs +10 -2
- package/build-module/form/primitives/autocomplete/portal.mjs.map +2 -2
- package/build-module/form/primitives/autocomplete/positioner.mjs +123 -0
- package/build-module/form/primitives/autocomplete/positioner.mjs.map +7 -0
- package/build-module/form/primitives/constants.mjs.map +2 -2
- package/build-module/form/primitives/select/index.mjs +3 -1
- package/build-module/form/primitives/select/index.mjs.map +2 -2
- package/build-module/form/primitives/select/item.mjs +1 -1
- package/build-module/form/primitives/select/item.mjs.map +2 -2
- package/build-module/form/primitives/select/popup.mjs +18 -36
- package/build-module/form/primitives/select/popup.mjs.map +3 -3
- package/build-module/form/primitives/select/portal.mjs +11 -5
- package/build-module/form/primitives/select/portal.mjs.map +2 -2
- package/build-module/form/primitives/select/positioner.mjs +124 -0
- package/build-module/form/primitives/select/positioner.mjs.map +7 -0
- package/build-module/icon-button/icon-button.mjs +1 -1
- package/build-module/icon-button/icon-button.mjs.map +2 -2
- package/build-module/index.mjs +5 -1
- package/build-module/index.mjs.map +2 -2
- package/build-module/popover/index.mjs +2 -0
- package/build-module/popover/index.mjs.map +2 -2
- package/build-module/popover/popup.mjs +23 -51
- package/build-module/popover/popup.mjs.map +3 -3
- package/build-module/popover/portal.mjs.map +2 -2
- package/build-module/popover/positioner.mjs +133 -0
- package/build-module/popover/positioner.mjs.map +7 -0
- package/build-module/popover/root.mjs.map +2 -2
- package/build-module/tooltip/portal.mjs +10 -2
- package/build-module/tooltip/portal.mjs.map +2 -2
- package/build-module/tooltip/positioner.mjs.map +2 -2
- package/build-module/utils/use-enable-wp-compat-overlay-slot.mjs +14 -0
- package/build-module/utils/use-enable-wp-compat-overlay-slot.mjs.map +7 -0
- package/build-module/utils/wp-compat-overlay-slot.mjs +148 -0
- package/build-module/utils/wp-compat-overlay-slot.mjs.map +7 -0
- package/build-types/alert-dialog/portal.d.ts +8 -5
- package/build-types/alert-dialog/portal.d.ts.map +1 -1
- package/build-types/alert-dialog/types.d.ts +2 -2
- package/build-types/alert-dialog/types.d.ts.map +1 -1
- package/build-types/badge/stories/e2e/index.story.d.ts +7 -0
- package/build-types/badge/stories/e2e/index.story.d.ts.map +1 -0
- package/build-types/button/stories/e2e/index.story.d.ts +8 -0
- package/build-types/button/stories/e2e/index.story.d.ts.map +1 -0
- package/build-types/card/full-bleed.d.ts +18 -0
- package/build-types/card/full-bleed.d.ts.map +1 -1
- package/build-types/card/stories/index.story.d.ts +23 -0
- package/build-types/card/stories/index.story.d.ts.map +1 -1
- package/build-types/collapsible-card/header.d.ts +2 -0
- package/build-types/collapsible-card/header.d.ts.map +1 -1
- package/build-types/collapsible-card/stories/index.story.d.ts +14 -0
- package/build-types/collapsible-card/stories/index.story.d.ts.map +1 -1
- package/build-types/dialog/portal.d.ts +8 -6
- package/build-types/dialog/portal.d.ts.map +1 -1
- package/build-types/dialog/types.d.ts +2 -2
- package/build-types/dialog/types.d.ts.map +1 -1
- package/build-types/drawer/portal.d.ts +8 -6
- package/build-types/drawer/portal.d.ts.map +1 -1
- package/build-types/drawer/types.d.ts +2 -2
- package/build-types/drawer/types.d.ts.map +1 -1
- package/build-types/form/primitives/autocomplete/clear.d.ts.map +1 -1
- package/build-types/form/primitives/autocomplete/index.d.ts +2 -1
- package/build-types/form/primitives/autocomplete/index.d.ts.map +1 -1
- package/build-types/form/primitives/autocomplete/popup.d.ts +1 -0
- package/build-types/form/primitives/autocomplete/popup.d.ts.map +1 -1
- package/build-types/form/primitives/autocomplete/portal.d.ts +9 -4
- package/build-types/form/primitives/autocomplete/portal.d.ts.map +1 -1
- package/build-types/form/primitives/autocomplete/positioner.d.ts +12 -0
- package/build-types/form/primitives/autocomplete/positioner.d.ts.map +1 -0
- package/build-types/form/primitives/autocomplete/stories/index.story.d.ts.map +1 -1
- package/build-types/form/primitives/autocomplete/types.d.ts +11 -9
- package/build-types/form/primitives/autocomplete/types.d.ts.map +1 -1
- package/build-types/form/primitives/constants.d.ts +9 -4
- package/build-types/form/primitives/constants.d.ts.map +1 -1
- package/build-types/form/primitives/select/index.d.ts +2 -1
- package/build-types/form/primitives/select/index.d.ts.map +1 -1
- package/build-types/form/primitives/select/popup.d.ts +1 -0
- package/build-types/form/primitives/select/popup.d.ts.map +1 -1
- package/build-types/form/primitives/select/portal.d.ts +9 -4
- package/build-types/form/primitives/select/portal.d.ts.map +1 -1
- package/build-types/form/primitives/select/positioner.d.ts +12 -0
- package/build-types/form/primitives/select/positioner.d.ts.map +1 -0
- package/build-types/form/primitives/select/stories/index.story.d.ts.map +1 -1
- package/build-types/form/primitives/select/types.d.ts +11 -2
- package/build-types/form/primitives/select/types.d.ts.map +1 -1
- package/build-types/icon/stories/index.story.d.ts.map +1 -1
- package/build-types/index.d.ts +2 -0
- package/build-types/index.d.ts.map +1 -1
- package/build-types/popover/index.d.ts +2 -1
- package/build-types/popover/index.d.ts.map +1 -1
- package/build-types/popover/popup.d.ts +2 -1
- package/build-types/popover/popup.d.ts.map +1 -1
- package/build-types/popover/portal.d.ts +8 -5
- package/build-types/popover/portal.d.ts.map +1 -1
- package/build-types/popover/positioner.d.ts +12 -0
- package/build-types/popover/positioner.d.ts.map +1 -0
- package/build-types/popover/root.d.ts +5 -2
- package/build-types/popover/root.d.ts.map +1 -1
- package/build-types/popover/stories/index.story.d.ts +10 -21
- package/build-types/popover/stories/index.story.d.ts.map +1 -1
- package/build-types/popover/types.d.ts +12 -3
- package/build-types/popover/types.d.ts.map +1 -1
- package/build-types/tooltip/portal.d.ts +9 -4
- package/build-types/tooltip/portal.d.ts.map +1 -1
- package/build-types/tooltip/positioner.d.ts +8 -5
- package/build-types/tooltip/positioner.d.ts.map +1 -1
- package/build-types/tooltip/types.d.ts +3 -3
- package/build-types/tooltip/types.d.ts.map +1 -1
- package/build-types/utils/test/use-enable-wp-compat-overlay-slot.test.d.ts +2 -0
- package/build-types/utils/test/use-enable-wp-compat-overlay-slot.test.d.ts.map +1 -0
- package/build-types/utils/test/wp-compat-overlay-slot.test.d.ts +2 -0
- package/build-types/utils/test/wp-compat-overlay-slot.test.d.ts.map +1 -0
- package/build-types/utils/use-enable-wp-compat-overlay-slot.d.ts +17 -0
- package/build-types/utils/use-enable-wp-compat-overlay-slot.d.ts.map +1 -0
- package/build-types/utils/wp-compat-overlay-slot.d.ts +30 -0
- package/build-types/utils/wp-compat-overlay-slot.d.ts.map +1 -0
- package/package.json +12 -12
- package/src/alert-dialog/portal.tsx +1 -4
- package/src/alert-dialog/types.ts +2 -4
- package/src/badge/stories/e2e/index.story.tsx +20 -0
- package/src/button/stories/e2e/index.story.tsx +130 -0
- package/src/button/stories/index.story.tsx +1 -1
- package/src/button/style.module.css +17 -12
- package/src/card/full-bleed.tsx +18 -0
- package/src/card/stories/index.story.tsx +115 -1
- package/src/card/style.module.css +16 -0
- package/src/card/test/index.test.tsx +18 -1
- package/src/collapsible-card/header.tsx +2 -0
- package/src/collapsible-card/stories/index.story.tsx +66 -0
- package/src/dialog/portal.tsx +1 -5
- package/src/dialog/types.ts +2 -2
- package/src/drawer/portal.tsx +1 -5
- package/src/drawer/types.ts +2 -2
- package/src/form/primitives/autocomplete/clear.tsx +10 -4
- package/src/form/primitives/autocomplete/index.ts +2 -1
- package/src/form/primitives/autocomplete/popup.tsx +17 -21
- package/src/form/primitives/autocomplete/portal.tsx +11 -5
- package/src/form/primitives/autocomplete/positioner.tsx +29 -0
- package/src/form/primitives/autocomplete/stories/index.story.tsx +1 -0
- package/src/form/primitives/autocomplete/test/index.test.tsx +219 -0
- package/src/form/primitives/autocomplete/types.ts +15 -15
- package/src/form/primitives/constants.ts +7 -4
- package/src/form/primitives/select/index.ts +2 -1
- package/src/form/primitives/select/popup.tsx +30 -34
- package/src/form/primitives/select/portal.tsx +15 -8
- package/src/form/primitives/select/positioner.tsx +33 -0
- package/src/form/primitives/select/stories/index.story.tsx +1 -0
- package/src/form/primitives/select/test/index.test.tsx +134 -0
- package/src/form/primitives/select/types.ts +12 -2
- package/src/form/select-control/test/index.test.tsx +64 -0
- package/src/icon/stories/index.story.tsx +3 -2
- package/src/icon-button/icon-button.tsx +1 -1
- package/src/icon-button/test/index.test.tsx +10 -10
- package/src/index.ts +2 -0
- package/src/popover/index.ts +12 -1
- package/src/popover/popup.tsx +28 -45
- package/src/popover/portal.tsx +1 -4
- package/src/popover/positioner.tsx +42 -0
- package/src/popover/root.tsx +5 -2
- package/src/popover/stories/index.story.tsx +85 -138
- package/src/popover/test/index.test.tsx +36 -1
- package/src/popover/types.ts +13 -15
- package/src/tabs/stories/index.story.tsx +2 -2
- package/src/tooltip/portal.tsx +11 -5
- package/src/tooltip/positioner.tsx +1 -4
- package/src/tooltip/style.module.css +1 -1
- package/src/tooltip/test/index.test.tsx +110 -0
- package/src/tooltip/types.ts +3 -5
- package/src/utils/css/item-popup.module.css +7 -4
- package/src/utils/css/wp-compat-overlay-slot.module.css +35 -0
- package/src/utils/test/use-enable-wp-compat-overlay-slot.test.tsx +74 -0
- package/src/utils/test/wp-compat-overlay-slot.test.ts +300 -0
- package/src/utils/use-enable-wp-compat-overlay-slot.ts +32 -0
- package/src/utils/wp-compat-overlay-slot.ts +129 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/form/primitives/select/types.ts"],
|
|
4
|
-
"sourcesContent": ["import type { Select as _Select } from '@base-ui/react/select';\nimport type {
|
|
4
|
+
"sourcesContent": ["import type { Select as _Select } from '@base-ui/react/select';\nimport type { ReactElement } from 'react';\n\nimport type { ComponentProps } from '../../../utils/types';\nimport type { InputLayoutProps } from '../input-layout/types';\n\nexport type PortalProps = ComponentProps< typeof _Select.Portal >;\n\nexport type PositionerProps = ComponentProps< typeof _Select.Positioner >;\n\n// The second type parameter is the `multiple` flag (currently disabled).\nexport type SelectRootProps< Value = unknown > = Omit<\n\t_Select.Root.Props< Value, false >,\n\t'multiple'\n>;\n\nexport type SelectTriggerProps = ComponentProps< typeof _Select.Trigger > & {\n\t/**\n\t * The size of the trigger.\n\t *\n\t * @default 'default'\n\t */\n\tsize?: InputLayoutProps[ 'size' ];\n\t/**\n\t * The style variant of the trigger.\n\t *\n\t * @default 'default'\n\t */\n\tvariant?: 'default' | 'minimal';\n\t/**\n\t * Text to show when no value is selected.\n\t * This is overridden by `children` if specified, or by a null item's label in `items`.\n\t *\n\t * @default __( 'Select' )\n\t */\n\tplaceholder?: _Select.Value.Props[ 'placeholder' ];\n\t/**\n\t * A function that gets called with the current value as an argument.\n\t * Use this to customize the trigger content.\n\t *\n\t * When no value is selected, the rendered content inherits the\n\t * placeholder text color.\n\t */\n\tchildren?: _Select.Value.Props[ 'children' ];\n};\n\nexport type SelectPopupProps = ComponentProps< typeof _Select.Popup > & {\n\t/**\n\t * The content to be rendered inside the popup.\n\t */\n\tchildren?: React.ReactNode;\n\t/**\n\t * Optional portal element, typically `<Select.Portal />` with custom\n\t * `container`. When omitted, `Select.Popup` uses `Select.Portal` with\n\t * default props. Do not pass `children` on the portal element; they would\n\t * be ignored.\n\t */\n\tportal?: ReactElement< Omit< PortalProps, 'children' > >;\n\t/**\n\t * Optional positioner element, typically `<Select.Positioner />` with\n\t * custom positioning props (`side`, `align`, `sideOffset`, collision\n\t * settings, etc.). When omitted, `Select.Popup` uses `Select.Positioner`\n\t * with default props. Do not pass `children` on the positioner element;\n\t * they would be ignored.\n\t */\n\tpositioner?: ReactElement< Omit< PositionerProps, 'children' > >;\n};\n\nexport type SelectItemProps = Omit<\n\tComponentProps< typeof _Select.Item >,\n\t'value'\n> & {\n\t/**\n\t * A unique value that identifies this select item.\n\t */\n\tvalue?: unknown;\n\t/**\n\t * The size of the item.\n\t *\n\t * @default 'default'\n\t */\n\tsize?: InputLayoutProps[ 'size' ];\n\t/**\n\t * The content of the item.\n\t */\n\tchildren?: _Select.Item.Props[ 'children' ];\n};\n"],
|
|
5
5
|
"mappings": ";;;;;;;;;;;;;;;;AAAA;AAAA;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/icon-button/icon-button.tsx", "../../../style-runtime/src/index.ts", "../../src/icon-button/style.module.css"],
|
|
4
|
-
"sourcesContent": ["import clsx from 'clsx';\nimport { forwardRef } from '@wordpress/element';\nimport { Button } from '../button';\nimport { Icon } from '../icon';\nimport * as Tooltip from '../tooltip';\nimport styles from './style.module.css';\nimport { type IconButtonProps } from './types';\n\n/**\n * An icon-only button with automatic tooltip and optimized styling.\n * Inherits all Button props while providing icon-specific enhancements.\n */\nexport const IconButton = forwardRef< HTMLButtonElement, IconButtonProps >(\n\tfunction IconButton(\n\t\t{\n\t\t\tlabel,\n\t\t\tclassName,\n\t\t\t// Prevent accidental forwarding of `children`\n\t\t\tchildren: _children,\n\t\t\tdisabled,\n\t\t\tfocusableWhenDisabled,\n\t\t\ticon,\n\t\t\tsize,\n\t\t\tshortcut,\n\t\t\tpositioner,\n\t\t\t...restProps\n\t\t}: IconButtonProps & { children?: unknown },\n\t\tref\n\t) {\n\t\tconst classes = clsx( styles[ 'icon-button' ], className );\n\n\t\treturn (\n\t\t\t<Tooltip.Provider delay={ 0 }>\n\t\t\t\t<Tooltip.Root>\n\t\t\t\t\t<Tooltip.Trigger\n\t\t\t\t\t\tref={ ref }\n\t\t\t\t\t\tdisabled={ disabled && ! focusableWhenDisabled }\n\t\t\t\t\t\trender={\n\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t{ ...restProps }\n\t\t\t\t\t\t\t\tsize={ size }\n\t\t\t\t\t\t\t\taria-label={ label }\n\t\t\t\t\t\t\t\taria-keyshortcuts={ shortcut?.ariaKeyShortcut }\n\t\t\t\t\t\t\t\tdisabled={ disabled }\n\t\t\t\t\t\t\t\tfocusableWhenDisabled={ focusableWhenDisabled }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t}\n\t\t\t\t\t\tclassName={ classes }\n\t\t\t\t\t>\n\t\t\t\t\t\t<Icon\n\t\t\t\t\t\t\ticon={ icon }\n\t\t\t\t\t\t\tsize={ 24 }\n\t\t\t\t\t\t\tclassName={ styles.icon }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</Tooltip.Trigger>\n\t\t\t\t\t<Tooltip.Popup positioner={ positioner }>\n\t\t\t\t\t\t{ label }\n\t\t\t\t\t\t{ shortcut && (\n\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t{ ' ' }\n\t\t\t\t\t\t\t\t<span aria-hidden=\"true\">\n\t\t\t\t\t\t\t\t\t{ shortcut.displayShortcut }\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</Tooltip.Popup>\n\t\t\t\t</Tooltip.Root>\n\t\t\t</Tooltip.Provider>\n\t\t);\n\t}\n);\n", "type GlobalScopeWithStyleRuntime = typeof globalThis & {\n\t// This global is shared by separately bundled copies of this package.\n\t// Keep its shape backward compatible after release.\n\t__wpStyleRuntime?: {\n\t\tdocuments: Map< Document, number >;\n\t\tstyles: Map< string, string >;\n\t\tinjectedStyles: WeakMap< Document, Set< string > >;\n\t};\n};\n\nconst STYLE_HASH_ATTRIBUTE = 'data-wp-hash';\n\n/**\n * Returns the shared style runtime registry.\n *\n * The registry is stored on `globalThis` so separately bundled copies of this\n * package can coordinate through the same document and style maps.\n *\n * @return The shared runtime registry.\n */\nfunction getRuntime() {\n\tconst globalScope = globalThis as GlobalScopeWithStyleRuntime;\n\n\tif ( globalScope.__wpStyleRuntime ) {\n\t\treturn globalScope.__wpStyleRuntime;\n\t}\n\n\tglobalScope.__wpStyleRuntime = {\n\t\tdocuments: new Map(),\n\t\tstyles: new Map(),\n\t\tinjectedStyles: new WeakMap(),\n\t};\n\n\tif ( typeof document !== 'undefined' ) {\n\t\tregisterDocument( document );\n\t}\n\n\treturn globalScope.__wpStyleRuntime;\n}\n\n/**\n * Checks whether a document already contains a style tag for a hash.\n *\n * @param targetDocument Document to inspect.\n * @param hash Stable hash for the transformed CSS.\n *\n * @return Whether the style hash already exists in the document.\n */\nfunction documentContainsStyleHash(\n\ttargetDocument: Document,\n\thash: string\n): boolean {\n\tif ( ! targetDocument.head ) {\n\t\treturn false;\n\t}\n\n\tfor ( const style of targetDocument.head.querySelectorAll(\n\t\t`style[${ STYLE_HASH_ATTRIBUTE }]`\n\t) ) {\n\t\tif ( style.getAttribute( STYLE_HASH_ATTRIBUTE ) === hash ) {\n\t\t\treturn true;\n\t\t}\n\t}\n\n\treturn false;\n}\n\n/**\n * Injects a registered style into a document, unless that document already\n * contains a style tag for the same hash.\n *\n * @param targetDocument Document to inject the style into.\n * @param hash Stable hash for the transformed CSS.\n * @param css CSS text to inject.\n */\nfunction injectStyle( targetDocument: Document, hash: string, css: string ) {\n\tif ( ! targetDocument.head ) {\n\t\treturn;\n\t}\n\n\tconst runtime = getRuntime();\n\tlet injectedStyles = runtime.injectedStyles.get( targetDocument );\n\n\tif ( ! injectedStyles ) {\n\t\tinjectedStyles = new Set();\n\t\truntime.injectedStyles.set( targetDocument, injectedStyles );\n\t}\n\n\tif ( injectedStyles.has( hash ) ) {\n\t\treturn;\n\t}\n\n\t// Older generated CSS module output can still inject matching style tags\n\t// after this document's cache is created, so keep the DOM as the fallback\n\t// source of truth on cache misses.\n\tif ( documentContainsStyleHash( targetDocument, hash ) ) {\n\t\tinjectedStyles.add( hash );\n\t\treturn;\n\t}\n\n\tconst style = targetDocument.createElement( 'style' );\n\tstyle.setAttribute( STYLE_HASH_ATTRIBUTE, hash );\n\tstyle.appendChild( targetDocument.createTextNode( css ) );\n\ttargetDocument.head.appendChild( style );\n\tinjectedStyles.add( hash );\n}\n\n/**\n * Registers a document as a style injection target.\n *\n * Existing registered styles are replayed into the document immediately.\n * Documents are reference-counted so multiple providers can safely register the\n * same document without one cleanup removing it while another registration is\n * still active.\n *\n * @param targetDocument Document to receive registered styles.\n * @return Cleanup function that unregisters this document registration.\n */\nexport function registerDocument( targetDocument: Document ) {\n\tconst runtime = getRuntime();\n\n\truntime.documents.set(\n\t\ttargetDocument,\n\t\t( runtime.documents.get( targetDocument ) ?? 0 ) + 1\n\t);\n\n\tfor ( const [ hash, css ] of runtime.styles ) {\n\t\tinjectStyle( targetDocument, hash, css );\n\t}\n\n\treturn () => {\n\t\tconst count = runtime.documents.get( targetDocument );\n\n\t\tif ( count === undefined ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( count <= 1 ) {\n\t\t\truntime.documents.delete( targetDocument );\n\t\t\treturn;\n\t\t}\n\n\t\truntime.documents.set( targetDocument, count - 1 );\n\t};\n}\n\n/**\n * Registers a style and injects it into all registered documents.\n *\n * The hash is used as the deduplication key, so calling this repeatedly with\n * the same hash will not add duplicate style tags to a document.\n * Registered styles are retained for the lifetime of the page so they can be\n * replayed into documents that are registered later.\n *\n * @param hash Stable hash for the transformed CSS.\n * @param css CSS text to inject.\n */\nexport function registerStyle( hash: string, css: string ) {\n\tconst runtime = getRuntime();\n\n\truntime.styles.set( hash, css );\n\n\tfor ( const targetDocument of runtime.documents.keys() ) {\n\t\tinjectStyle( targetDocument, hash, css );\n\t}\n}\n", "import { registerStyle } from '@wordpress/style-runtime';\nif (typeof process === 'undefined' || process.env.NODE_ENV !== 'test') {\n\tregisterStyle(\"358a2a646a\", \"@layer wp-ui-utilities, wp-ui-components, wp-ui-compositions, wp-ui-overrides;@layer wp-ui-compositions{._28cfdc260e755391__icon-button{--wp-ui-button-aspect-ratio:1;--wp-ui-button-padding-inline:0;--wp-ui-button-min-width:unset}.f1c70d719989a85a__icon{margin:-1px}}\");\n}\nexport default {\"icon-button\":\"_28cfdc260e755391__icon-button\",\"icon\":\"f1c70d719989a85a__icon\"};\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAiB;AACjB,qBAA2B;AAC3B,oBAAuB;AACvB,kBAAqB;AACrB,cAAyB;;;ACMzB,IAAM,uBAAuB;AAU7B,SAAS,aAAa;AACrB,QAAM,cAAc;AAEpB,MAAK,YAAY,kBAAmB;AACnC,WAAO,YAAY;AAAA,EACpB;AAEA,cAAY,mBAAmB;AAAA,IAC9B,WAAW,oBAAI,IAAI;AAAA,IACnB,QAAQ,oBAAI,IAAI;AAAA,IAChB,gBAAgB,oBAAI,QAAQ;AAAA,EAC7B;AAEA,MAAK,OAAO,aAAa,aAAc;AACtC,qBAAkB,QAAS;AAAA,EAC5B;AAEA,SAAO,YAAY;AACpB;AAUA,SAAS,0BACR,gBACA,MACU;AACV,MAAK,CAAE,eAAe,MAAO;AAC5B,WAAO;AAAA,EACR;AAEA,aAAY,SAAS,eAAe,KAAK;AAAA,IACxC,SAAU,oBAAqB;AAAA,EAChC,GAAI;AACH,QAAK,MAAM,aAAc,oBAAqB,MAAM,MAAO;AAC1D,aAA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UAAU,KAAK,GAAI;AACxD,gBAAa,gBAAgB,MAAM,GAAI;AAAA,EACxC;AACD;;;ACpKA,IAAI,OAAO,YAAY,eAAe,QAAQ,IAAI,aAAa,QAAQ;AACtE,gBAAc,cAAc,4QAA4Q;AACzS;AACA,IAAO,gBAAQ,EAAC,eAAc,kCAAiC,QAAO,yBAAwB;;;AFkCvF;AA1BA,IAAM,iBAAa;AAAA,EACzB,SAASA,YACR;AAAA,IACC;AAAA,IACA;AAAA;AAAA,IAEA,UAAU;AAAA,IACV;AAAA,IACA;AAAA,
|
|
4
|
+
"sourcesContent": ["import clsx from 'clsx';\nimport { forwardRef } from '@wordpress/element';\nimport { Button } from '../button';\nimport { Icon } from '../icon';\nimport * as Tooltip from '../tooltip';\nimport styles from './style.module.css';\nimport { type IconButtonProps } from './types';\n\n/**\n * An icon-only button with automatic tooltip and optimized styling.\n * Inherits all Button props while providing icon-specific enhancements.\n */\nexport const IconButton = forwardRef< HTMLButtonElement, IconButtonProps >(\n\tfunction IconButton(\n\t\t{\n\t\t\tlabel,\n\t\t\tclassName,\n\t\t\t// Prevent accidental forwarding of `children`\n\t\t\tchildren: _children,\n\t\t\tdisabled,\n\t\t\tfocusableWhenDisabled = true,\n\t\t\ticon,\n\t\t\tsize,\n\t\t\tshortcut,\n\t\t\tpositioner,\n\t\t\t...restProps\n\t\t}: IconButtonProps & { children?: unknown },\n\t\tref\n\t) {\n\t\tconst classes = clsx( styles[ 'icon-button' ], className );\n\n\t\treturn (\n\t\t\t<Tooltip.Provider delay={ 0 }>\n\t\t\t\t<Tooltip.Root>\n\t\t\t\t\t<Tooltip.Trigger\n\t\t\t\t\t\tref={ ref }\n\t\t\t\t\t\tdisabled={ disabled && ! focusableWhenDisabled }\n\t\t\t\t\t\trender={\n\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t{ ...restProps }\n\t\t\t\t\t\t\t\tsize={ size }\n\t\t\t\t\t\t\t\taria-label={ label }\n\t\t\t\t\t\t\t\taria-keyshortcuts={ shortcut?.ariaKeyShortcut }\n\t\t\t\t\t\t\t\tdisabled={ disabled }\n\t\t\t\t\t\t\t\tfocusableWhenDisabled={ focusableWhenDisabled }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t}\n\t\t\t\t\t\tclassName={ classes }\n\t\t\t\t\t>\n\t\t\t\t\t\t<Icon\n\t\t\t\t\t\t\ticon={ icon }\n\t\t\t\t\t\t\tsize={ 24 }\n\t\t\t\t\t\t\tclassName={ styles.icon }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</Tooltip.Trigger>\n\t\t\t\t\t<Tooltip.Popup positioner={ positioner }>\n\t\t\t\t\t\t{ label }\n\t\t\t\t\t\t{ shortcut && (\n\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t{ ' ' }\n\t\t\t\t\t\t\t\t<span aria-hidden=\"true\">\n\t\t\t\t\t\t\t\t\t{ shortcut.displayShortcut }\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</Tooltip.Popup>\n\t\t\t\t</Tooltip.Root>\n\t\t\t</Tooltip.Provider>\n\t\t);\n\t}\n);\n", "type GlobalScopeWithStyleRuntime = typeof globalThis & {\n\t// This global is shared by separately bundled copies of this package.\n\t// Keep its shape backward compatible after release.\n\t__wpStyleRuntime?: {\n\t\tdocuments: Map< Document, number >;\n\t\tstyles: Map< string, string >;\n\t\tinjectedStyles: WeakMap< Document, Set< string > >;\n\t};\n};\n\nconst STYLE_HASH_ATTRIBUTE = 'data-wp-hash';\n\n/**\n * Returns the shared style runtime registry.\n *\n * The registry is stored on `globalThis` so separately bundled copies of this\n * package can coordinate through the same document and style maps.\n *\n * @return The shared runtime registry.\n */\nfunction getRuntime() {\n\tconst globalScope = globalThis as GlobalScopeWithStyleRuntime;\n\n\tif ( globalScope.__wpStyleRuntime ) {\n\t\treturn globalScope.__wpStyleRuntime;\n\t}\n\n\tglobalScope.__wpStyleRuntime = {\n\t\tdocuments: new Map(),\n\t\tstyles: new Map(),\n\t\tinjectedStyles: new WeakMap(),\n\t};\n\n\tif ( typeof document !== 'undefined' ) {\n\t\tregisterDocument( document );\n\t}\n\n\treturn globalScope.__wpStyleRuntime;\n}\n\n/**\n * Checks whether a document already contains a style tag for a hash.\n *\n * @param targetDocument Document to inspect.\n * @param hash Stable hash for the transformed CSS.\n *\n * @return Whether the style hash already exists in the document.\n */\nfunction documentContainsStyleHash(\n\ttargetDocument: Document,\n\thash: string\n): boolean {\n\tif ( ! targetDocument.head ) {\n\t\treturn false;\n\t}\n\n\tfor ( const style of targetDocument.head.querySelectorAll(\n\t\t`style[${ STYLE_HASH_ATTRIBUTE }]`\n\t) ) {\n\t\tif ( style.getAttribute( STYLE_HASH_ATTRIBUTE ) === hash ) {\n\t\t\treturn true;\n\t\t}\n\t}\n\n\treturn false;\n}\n\n/**\n * Injects a registered style into a document, unless that document already\n * contains a style tag for the same hash.\n *\n * @param targetDocument Document to inject the style into.\n * @param hash Stable hash for the transformed CSS.\n * @param css CSS text to inject.\n */\nfunction injectStyle( targetDocument: Document, hash: string, css: string ) {\n\tif ( ! targetDocument.head ) {\n\t\treturn;\n\t}\n\n\tconst runtime = getRuntime();\n\tlet injectedStyles = runtime.injectedStyles.get( targetDocument );\n\n\tif ( ! injectedStyles ) {\n\t\tinjectedStyles = new Set();\n\t\truntime.injectedStyles.set( targetDocument, injectedStyles );\n\t}\n\n\tif ( injectedStyles.has( hash ) ) {\n\t\treturn;\n\t}\n\n\t// Older generated CSS module output can still inject matching style tags\n\t// after this document's cache is created, so keep the DOM as the fallback\n\t// source of truth on cache misses.\n\tif ( documentContainsStyleHash( targetDocument, hash ) ) {\n\t\tinjectedStyles.add( hash );\n\t\treturn;\n\t}\n\n\tconst style = targetDocument.createElement( 'style' );\n\tstyle.setAttribute( STYLE_HASH_ATTRIBUTE, hash );\n\tstyle.appendChild( targetDocument.createTextNode( css ) );\n\ttargetDocument.head.appendChild( style );\n\tinjectedStyles.add( hash );\n}\n\n/**\n * Registers a document as a style injection target.\n *\n * Existing registered styles are replayed into the document immediately.\n * Documents are reference-counted so multiple providers can safely register the\n * same document without one cleanup removing it while another registration is\n * still active.\n *\n * @param targetDocument Document to receive registered styles.\n * @return Cleanup function that unregisters this document registration.\n */\nexport function registerDocument( targetDocument: Document ) {\n\tconst runtime = getRuntime();\n\n\truntime.documents.set(\n\t\ttargetDocument,\n\t\t( runtime.documents.get( targetDocument ) ?? 0 ) + 1\n\t);\n\n\tfor ( const [ hash, css ] of runtime.styles ) {\n\t\tinjectStyle( targetDocument, hash, css );\n\t}\n\n\treturn () => {\n\t\tconst count = runtime.documents.get( targetDocument );\n\n\t\tif ( count === undefined ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( count <= 1 ) {\n\t\t\truntime.documents.delete( targetDocument );\n\t\t\treturn;\n\t\t}\n\n\t\truntime.documents.set( targetDocument, count - 1 );\n\t};\n}\n\n/**\n * Registers a style and injects it into all registered documents.\n *\n * The hash is used as the deduplication key, so calling this repeatedly with\n * the same hash will not add duplicate style tags to a document.\n * Registered styles are retained for the lifetime of the page so they can be\n * replayed into documents that are registered later.\n *\n * @param hash Stable hash for the transformed CSS.\n * @param css CSS text to inject.\n */\nexport function registerStyle( hash: string, css: string ) {\n\tconst runtime = getRuntime();\n\n\truntime.styles.set( hash, css );\n\n\tfor ( const targetDocument of runtime.documents.keys() ) {\n\t\tinjectStyle( targetDocument, hash, css );\n\t}\n}\n", "import { registerStyle } from '@wordpress/style-runtime';\nif (typeof process === 'undefined' || process.env.NODE_ENV !== 'test') {\n\tregisterStyle(\"358a2a646a\", \"@layer wp-ui-utilities, wp-ui-components, wp-ui-compositions, wp-ui-overrides;@layer wp-ui-compositions{._28cfdc260e755391__icon-button{--wp-ui-button-aspect-ratio:1;--wp-ui-button-padding-inline:0;--wp-ui-button-min-width:unset}.f1c70d719989a85a__icon{margin:-1px}}\");\n}\nexport default {\"icon-button\":\"_28cfdc260e755391__icon-button\",\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zD,WACC,4CAAS,kBAAR,EAAiB,OAAQ,GACzB,uDAAS,cAAR,EACA;AAAA;AAAA,QAAS;AAAA,QAAR;AAAA,UACA;AAAA,UACA,UAAW,YAAY,CAAE;AAAA,UACzB,QACC;AAAA,YAAC;AAAA;AAAA,cACE,GAAG;AAAA,cACL;AAAA,cACA,cAAa;AAAA,cACb,qBAAoB,UAAU;AAAA,cAC9B;AAAA,cACA;AAAA;AAAA,UACD;AAAA,UAED,WAAY;AAAA,UAEZ;AAAA,YAAC;AAAA;AAAA,cACA;AAAA,cACA,MAAO;AAAA,cACP,WAAY,cAAO;AAAA;AAAA,UACpB;AAAA;AAAA,MACD;AAAA,MACA,6CAAS,eAAR,EAAc,YACZ;AAAA;AAAA,QACA,YACD,4EACG;AAAA;AAAA,UACF,4CAAC,UAAK,eAAY,QACf,mBAAS,iBACZ;AAAA,WACD;AAAA,SAEF;AAAA,OACD,GACD;AAAA,EAEF;AACD;",
|
|
6
6
|
"names": ["IconButton", "clsx"]
|
|
7
7
|
}
|
package/build/index.cjs
CHANGED
|
@@ -41,7 +41,9 @@ __export(index_exports, {
|
|
|
41
41
|
Notice: () => Notice,
|
|
42
42
|
Popover: () => Popover,
|
|
43
43
|
Tabs: () => Tabs,
|
|
44
|
-
Tooltip: () => Tooltip
|
|
44
|
+
Tooltip: () => Tooltip,
|
|
45
|
+
getWpCompatOverlaySlot: () => import_wp_compat_overlay_slot.getWpCompatOverlaySlot,
|
|
46
|
+
useEnableWpCompatOverlaySlot: () => import_use_enable_wp_compat_overlay_slot.useEnableWpCompatOverlaySlot
|
|
45
47
|
});
|
|
46
48
|
module.exports = __toCommonJS(index_exports);
|
|
47
49
|
__reExport(index_exports, require("./badge/index.cjs"), module.exports);
|
|
@@ -63,6 +65,8 @@ __reExport(index_exports, require("./stack/index.cjs"), module.exports);
|
|
|
63
65
|
var Tabs = __toESM(require("./tabs/index.cjs"));
|
|
64
66
|
__reExport(index_exports, require("./text/index.cjs"), module.exports);
|
|
65
67
|
var Tooltip = __toESM(require("./tooltip/index.cjs"));
|
|
68
|
+
var import_wp_compat_overlay_slot = require("./utils/wp-compat-overlay-slot.cjs");
|
|
69
|
+
var import_use_enable_wp_compat_overlay_slot = require("./utils/use-enable-wp-compat-overlay-slot.cjs");
|
|
66
70
|
__reExport(index_exports, require("./visually-hidden/index.cjs"), module.exports);
|
|
67
71
|
// Annotate the CommonJS export names for ESM import in node:
|
|
68
72
|
0 && (module.exports = {
|
|
@@ -77,6 +81,8 @@ __reExport(index_exports, require("./visually-hidden/index.cjs"), module.exports
|
|
|
77
81
|
Popover,
|
|
78
82
|
Tabs,
|
|
79
83
|
Tooltip,
|
|
84
|
+
getWpCompatOverlaySlot,
|
|
85
|
+
useEnableWpCompatOverlaySlot,
|
|
80
86
|
...require("./badge/index.cjs"),
|
|
81
87
|
...require("./button/index.cjs"),
|
|
82
88
|
...require("./form/index.cjs"),
|
package/build/index.cjs.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/index.ts"],
|
|
4
|
-
"sourcesContent": ["export * from './badge';\nexport * from './button';\nexport * as Card from './card';\nexport * as Collapsible from './collapsible';\nexport * as CollapsibleCard from './collapsible-card';\nexport * as AlertDialog from './alert-dialog';\nexport * as Dialog from './dialog';\nexport * as Drawer from './drawer';\nexport * as EmptyState from './empty-state';\nexport * from './form';\nexport * from './icon';\nexport * from './icon-button';\nexport * from './link';\nexport * as Notice from './notice';\nexport * as Popover from './popover';\nexport * from './stack';\nexport * as Tabs from './tabs';\nexport * from './text';\nexport * as Tooltip from './tooltip';\nexport * from './visually-hidden';\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,0BAAc,8BAAd;AACA,0BAAc,+BADd;AAEA,WAAsB;AACtB,kBAA6B;AAC7B,sBAAiC;AACjC,kBAA6B;AAC7B,aAAwB;AACxB,aAAwB;AACxB,iBAA4B;AAC5B,0BAAc,6BATd;AAUA,0BAAc,6BAVd;AAWA,0BAAc,oCAXd;AAYA,0BAAc,6BAZd;AAaA,aAAwB;AACxB,cAAyB;AACzB,0BAAc,8BAfd;AAgBA,WAAsB;AACtB,0BAAc,6BAjBd;AAkBA,cAAyB;AACzB,0BAAc,
|
|
4
|
+
"sourcesContent": ["export * from './badge';\nexport * from './button';\nexport * as Card from './card';\nexport * as Collapsible from './collapsible';\nexport * as CollapsibleCard from './collapsible-card';\nexport * as AlertDialog from './alert-dialog';\nexport * as Dialog from './dialog';\nexport * as Drawer from './drawer';\nexport * as EmptyState from './empty-state';\nexport * from './form';\nexport * from './icon';\nexport * from './icon-button';\nexport * from './link';\nexport * as Notice from './notice';\nexport * as Popover from './popover';\nexport * from './stack';\nexport * as Tabs from './tabs';\nexport * from './text';\nexport * as Tooltip from './tooltip';\nexport { getWpCompatOverlaySlot } from './utils/wp-compat-overlay-slot';\nexport { useEnableWpCompatOverlaySlot } from './utils/use-enable-wp-compat-overlay-slot';\nexport * from './visually-hidden';\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,0BAAc,8BAAd;AACA,0BAAc,+BADd;AAEA,WAAsB;AACtB,kBAA6B;AAC7B,sBAAiC;AACjC,kBAA6B;AAC7B,aAAwB;AACxB,aAAwB;AACxB,iBAA4B;AAC5B,0BAAc,6BATd;AAUA,0BAAc,6BAVd;AAWA,0BAAc,oCAXd;AAYA,0BAAc,6BAZd;AAaA,aAAwB;AACxB,cAAyB;AACzB,0BAAc,8BAfd;AAgBA,WAAsB;AACtB,0BAAc,6BAjBd;AAkBA,cAAyB;AACzB,oCAAuC;AACvC,+CAA6C;AAC7C,0BAAc,wCArBd;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/build/popover/index.cjs
CHANGED
|
@@ -25,6 +25,7 @@ __export(popover_exports, {
|
|
|
25
25
|
Description: () => import_description.Description,
|
|
26
26
|
Popup: () => import_popup.Popup,
|
|
27
27
|
Portal: () => import_portal.Portal,
|
|
28
|
+
Positioner: () => import_positioner.Positioner,
|
|
28
29
|
Root: () => import_root.Root,
|
|
29
30
|
Title: () => import_title.Title,
|
|
30
31
|
Trigger: () => import_trigger.Trigger
|
|
@@ -35,6 +36,7 @@ var import_close = require("./close.cjs");
|
|
|
35
36
|
var import_description = require("./description.cjs");
|
|
36
37
|
var import_popup = require("./popup.cjs");
|
|
37
38
|
var import_portal = require("./portal.cjs");
|
|
39
|
+
var import_positioner = require("./positioner.cjs");
|
|
38
40
|
var import_root = require("./root.cjs");
|
|
39
41
|
var import_title = require("./title.cjs");
|
|
40
42
|
var import_trigger = require("./trigger.cjs");
|
|
@@ -45,6 +47,7 @@ var import_trigger = require("./trigger.cjs");
|
|
|
45
47
|
Description,
|
|
46
48
|
Popup,
|
|
47
49
|
Portal,
|
|
50
|
+
Positioner,
|
|
48
51
|
Root,
|
|
49
52
|
Title,
|
|
50
53
|
Trigger
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/popover/index.ts"],
|
|
4
|
-
"sourcesContent": ["import { Arrow } from './arrow';\nimport { Close } from './close';\nimport { Description } from './description';\nimport { Popup } from './popup';\nimport { Portal } from './portal';\nimport { Root } from './root';\nimport { Title } from './title';\nimport { Trigger } from './trigger';\n\nexport {
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAsB;AACtB,mBAAsB;AACtB,yBAA4B;AAC5B,mBAAsB;AACtB,oBAAuB;AACvB,kBAAqB;AACrB,mBAAsB;AACtB,qBAAwB;",
|
|
4
|
+
"sourcesContent": ["import { Arrow } from './arrow';\nimport { Close } from './close';\nimport { Description } from './description';\nimport { Popup } from './popup';\nimport { Portal } from './portal';\nimport { Positioner } from './positioner';\nimport { Root } from './root';\nimport { Title } from './title';\nimport { Trigger } from './trigger';\n\nexport {\n\tArrow,\n\tClose,\n\tDescription,\n\tPopup,\n\tPortal,\n\tPositioner,\n\tRoot,\n\tTitle,\n\tTrigger,\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAsB;AACtB,mBAAsB;AACtB,yBAA4B;AAC5B,mBAAsB;AACtB,oBAAuB;AACvB,wBAA2B;AAC3B,kBAAqB;AACrB,mBAAsB;AACtB,qBAAwB;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/build/popover/popup.cjs
CHANGED
|
@@ -39,6 +39,11 @@ var import_element = require("@wordpress/element");
|
|
|
39
39
|
var import_compose = require("@wordpress/compose");
|
|
40
40
|
var import_theme = require("@wordpress/theme");
|
|
41
41
|
var import_lock_unlock = require("../lock-unlock.cjs");
|
|
42
|
+
var import_use_deprioritized_initial_focus = require("../utils/use-deprioritized-initial-focus.cjs");
|
|
43
|
+
var import_render_slot_with_children = require("../utils/render-slot-with-children.cjs");
|
|
44
|
+
var import_context = require("./context.cjs");
|
|
45
|
+
var import_portal = require("./portal.cjs");
|
|
46
|
+
var import_positioner = require("./positioner.cjs");
|
|
42
47
|
|
|
43
48
|
// packages/style-runtime/src/index.ts
|
|
44
49
|
var STYLE_HASH_ATTRIBUTE = "data-wp-hash";
|
|
@@ -122,18 +127,6 @@ function registerStyle(hash, css) {
|
|
|
122
127
|
}
|
|
123
128
|
}
|
|
124
129
|
|
|
125
|
-
// packages/ui/src/utils/css/resets.module.css
|
|
126
|
-
if (typeof process === "undefined" || process.env.NODE_ENV !== "test") {
|
|
127
|
-
registerStyle("e3ae230cea", "@layer wp-ui-utilities, wp-ui-components, wp-ui-compositions, wp-ui-overrides;@layer wp-ui-utilities{._336cd3e4e743482f__box-sizing{box-sizing:border-box;*,:after,:before{box-sizing:inherit}}}");
|
|
128
|
-
}
|
|
129
|
-
var resets_default = { "box-sizing": "_336cd3e4e743482f__box-sizing" };
|
|
130
|
-
|
|
131
|
-
// packages/ui/src/popover/popup.tsx
|
|
132
|
-
var import_use_deprioritized_initial_focus = require("../utils/use-deprioritized-initial-focus.cjs");
|
|
133
|
-
var import_render_slot_with_children = require("../utils/render-slot-with-children.cjs");
|
|
134
|
-
var import_context = require("./context.cjs");
|
|
135
|
-
var import_portal = require("./portal.cjs");
|
|
136
|
-
|
|
137
130
|
// packages/ui/src/popover/style.module.css
|
|
138
131
|
if (typeof process === "undefined" || process.env.NODE_ENV !== "test") {
|
|
139
132
|
registerStyle("cc851ac208", '@layer wp-ui-utilities, wp-ui-components, wp-ui-compositions, wp-ui-overrides;@layer wp-ui-components{._10450722b9676f78__positioner{z-index:var(--wp-ui-popover-z-index,initial)}._84e8f597bcf683b8__popup{background-color:var(--wpds-color-bg-surface-neutral-strong,#fff);border:var(--wpds-border-width-xs,1px) solid var(--wpds-color-stroke-surface-neutral,#dbdbdb);border-radius:var(--wpds-border-radius-md,4px);box-shadow:var(--wpds-elevation-md,0 2px 3px 0 #0000000d,0 4px 5px 0 #0000000a,0 12px 12px 0 #00000008,0 16px 16px 0 #00000005);color:var(--wpds-color-fg-content-neutral,#1e1e1e);font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-size:var(--wpds-typography-font-size-md,13px);line-height:var(--wpds-typography-line-height-md,24px);outline:0;padding:var(--wpds-dimension-padding-lg,16px)}.e4d544aa033f05c6__backdrop~* ._84e8f597bcf683b8__popup{border-color:#0000}@media (forced-colors:active){._84e8f597bcf683b8__popup,.e4d544aa033f05c6__backdrop~* ._84e8f597bcf683b8__popup{border-color:CanvasText}}.ca05d3eb89321fcd__arrow{display:flex;&[data-side=top]{bottom:-8px;rotate:180deg}&[data-side=bottom]{rotate:0deg;top:-8px}&[data-side=left]{inset-inline-end:-13px;rotate:90deg}&[data-side=right]{inset-inline-start:-13px;rotate:-90deg}}._12d8edd9eb946b5f__arrow-fill{fill:var(--wpds-color-bg-surface-neutral-strong,#fff)}._6ddab482bd929dad__arrow-stroke{fill:var(--wpds-color-stroke-surface-neutral,#dbdbdb)}._6d7e4729cd96960e__title{--_gcd-heading-color:var(--wpds-color-fg-content-neutral,#1e1e1e);color:var(--wpds-color-fg-content-neutral,#1e1e1e)}.e4d544aa033f05c6__backdrop{background-color:#00000026;inset:0;position:fixed;z-index:var(--wp-ui-popover-z-index,initial)}}');
|
|
@@ -145,23 +138,13 @@ var import_jsx_runtime = require("react/jsx-runtime");
|
|
|
145
138
|
var ThemeProvider = (0, import_lock_unlock.unlock)(import_theme.privateApis).ThemeProvider;
|
|
146
139
|
var CLOSE_ATTR = "data-wp-ui-popover-close";
|
|
147
140
|
var Popup = (0, import_element.forwardRef)(function PopoverPopup({
|
|
148
|
-
align = "center",
|
|
149
|
-
alignOffset,
|
|
150
|
-
anchor,
|
|
151
|
-
// Matches the popup's border-radius (--wpds-border-radius-md).
|
|
152
|
-
arrowPadding = 8,
|
|
153
141
|
backdrop = false,
|
|
154
142
|
children,
|
|
155
143
|
className,
|
|
156
|
-
collisionAvoidance,
|
|
157
|
-
collisionBoundary,
|
|
158
|
-
collisionPadding,
|
|
159
144
|
portal,
|
|
145
|
+
positioner,
|
|
160
146
|
finalFocus,
|
|
161
147
|
initialFocus,
|
|
162
|
-
side = "bottom",
|
|
163
|
-
sideOffset = 8,
|
|
164
|
-
sticky,
|
|
165
148
|
variant = "default",
|
|
166
149
|
...props
|
|
167
150
|
}, ref) {
|
|
@@ -171,39 +154,28 @@ var Popup = (0, import_element.forwardRef)(function PopoverPopup({
|
|
|
171
154
|
});
|
|
172
155
|
const mergedPopupRef = (0, import_compose.useMergeRefs)([ref, popupRef]);
|
|
173
156
|
const backdropElement = backdrop ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_popover.Popover.Backdrop, { className: style_default.backdrop }) : null;
|
|
174
|
-
const
|
|
175
|
-
import_popover.Popover.
|
|
157
|
+
const popupContent = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ThemeProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
158
|
+
import_popover.Popover.Popup,
|
|
176
159
|
{
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
sticky,
|
|
187
|
-
className: (0, import_clsx.default)(resets_default["box-sizing"], style_default.positioner),
|
|
188
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ThemeProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
189
|
-
import_popover.Popover.Popup,
|
|
190
|
-
{
|
|
191
|
-
ref: mergedPopupRef,
|
|
192
|
-
initialFocus: resolvedInitialFocus,
|
|
193
|
-
finalFocus,
|
|
194
|
-
className: (0, import_clsx.default)(
|
|
195
|
-
variant !== "unstyled" && style_default.popup,
|
|
196
|
-
className
|
|
197
|
-
),
|
|
198
|
-
...props,
|
|
199
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_context.PopoverValidationProvider, { children })
|
|
200
|
-
}
|
|
201
|
-
) })
|
|
160
|
+
ref: mergedPopupRef,
|
|
161
|
+
initialFocus: resolvedInitialFocus,
|
|
162
|
+
finalFocus,
|
|
163
|
+
className: (0, import_clsx.default)(
|
|
164
|
+
variant !== "unstyled" && style_default.popup,
|
|
165
|
+
className
|
|
166
|
+
),
|
|
167
|
+
...props,
|
|
168
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_context.PopoverValidationProvider, { children })
|
|
202
169
|
}
|
|
170
|
+
) });
|
|
171
|
+
const positionedPopup = (0, import_render_slot_with_children.renderSlotWithChildren)(
|
|
172
|
+
positioner,
|
|
173
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_positioner.Positioner, {}),
|
|
174
|
+
popupContent
|
|
203
175
|
);
|
|
204
176
|
const portalChildren = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
205
177
|
backdropElement,
|
|
206
|
-
|
|
178
|
+
positionedPopup
|
|
207
179
|
] });
|
|
208
180
|
return (0, import_render_slot_with_children.renderSlotWithChildren)(portal, /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_portal.Portal, {}), portalChildren);
|
|
209
181
|
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../src/popover/popup.tsx", "../../../style-runtime/src/index.ts", "../../src/
|
|
4
|
-
"sourcesContent": ["import { Popover as _Popover } from '@base-ui/react/popover';\nimport clsx from 'clsx';\nimport { forwardRef } from '@wordpress/element';\nimport { useMergeRefs } from '@wordpress/compose';\nimport {\n\ttype ThemeProvider as ThemeProviderType,\n\tprivateApis as themePrivateApis,\n} from '@wordpress/theme';\nimport { unlock } from '../lock-unlock';\nimport resetStyles from '../utils/css/resets.module.css';\nimport { useDeprioritizedInitialFocus } from '../utils/use-deprioritized-initial-focus';\nimport { renderSlotWithChildren } from '../utils/render-slot-with-children';\nimport { PopoverValidationProvider } from './context';\nimport { Portal } from './portal';\nimport styles from './style.module.css';\nimport type { PopupProps } from './types';\n\nconst ThemeProvider: typeof ThemeProviderType =\n\tunlock( themePrivateApis ).ThemeProvider;\n\nconst CLOSE_ATTR = 'data-wp-ui-popover-close';\n\n/**\n * Renders the floating popup container for the popover content.\n *\n * Handles portal rendering, positioning relative to the anchor, collision\n * avoidance, focus management, and optional backdrop. Use\n * `portal={ <Popover.Portal container={ ... } /> }` for cross-document\n * scenarios such as iframes.\n */\nconst Popup = forwardRef< HTMLDivElement, PopupProps >( function PopoverPopup(\n\t{\n\t\talign = 'center',\n\t\talignOffset,\n\t\tanchor,\n\t\t// Matches the popup's border-radius (--wpds-border-radius-md).\n\t\tarrowPadding = 8,\n\t\tbackdrop = false,\n\t\tchildren,\n\t\tclassName,\n\t\tcollisionAvoidance,\n\t\tcollisionBoundary,\n\t\tcollisionPadding,\n\t\tportal,\n\t\tfinalFocus,\n\t\tinitialFocus,\n\t\tside = 'bottom',\n\t\tsideOffset = 8,\n\t\tsticky,\n\t\tvariant = 'default',\n\t\t...props\n\t},\n\tref\n) {\n\tconst { resolvedInitialFocus, popupRef } = useDeprioritizedInitialFocus( {\n\t\tinitialFocus,\n\t\tdeprioritizedAttributes: [ CLOSE_ATTR ],\n\t} );\n\tconst mergedPopupRef = useMergeRefs( [ ref, popupRef ] );\n\n\tconst backdropElement = backdrop ? (\n\t\t<_Popover.Backdrop className={ styles.backdrop } />\n\t) : null;\n\n\tconst positioner = (\n\t\t<_Popover.Positioner\n\t\t\talign={ align }\n\t\t\talignOffset={ alignOffset }\n\t\t\tanchor={ anchor }\n\t\t\tarrowPadding={ arrowPadding }\n\t\t\tcollisionAvoidance={ collisionAvoidance }\n\t\t\tcollisionBoundary={ collisionBoundary }\n\t\t\tcollisionPadding={ collisionPadding }\n\t\t\tside={ side }\n\t\t\tsideOffset={ sideOffset }\n\t\t\tsticky={ sticky }\n\t\t\tclassName={ clsx( resetStyles[ 'box-sizing' ], styles.positioner ) }\n\t\t>\n\t\t\t<ThemeProvider>\n\t\t\t\t<_Popover.Popup\n\t\t\t\t\tref={ mergedPopupRef }\n\t\t\t\t\tinitialFocus={ resolvedInitialFocus }\n\t\t\t\t\tfinalFocus={ finalFocus }\n\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\tvariant !== 'unstyled' && styles.popup,\n\t\t\t\t\t\tclassName\n\t\t\t\t\t) }\n\t\t\t\t\t{ ...props }\n\t\t\t\t>\n\t\t\t\t\t<PopoverValidationProvider>\n\t\t\t\t\t\t{ children }\n\t\t\t\t\t</PopoverValidationProvider>\n\t\t\t\t</_Popover.Popup>\n\t\t\t</ThemeProvider>\n\t\t</_Popover.Positioner>\n\t);\n\n\tconst portalChildren = (\n\t\t<>\n\t\t\t{ backdropElement }\n\t\t\t{ positioner }\n\t\t</>\n\t);\n\n\treturn renderSlotWithChildren( portal, <Portal />, portalChildren );\n} );\n\nexport { Popup };\n", "type GlobalScopeWithStyleRuntime = typeof globalThis & {\n\t// This global is shared by separately bundled copies of this package.\n\t// Keep its shape backward compatible after release.\n\t__wpStyleRuntime?: {\n\t\tdocuments: Map< Document, number >;\n\t\tstyles: Map< string, string >;\n\t\tinjectedStyles: WeakMap< Document, Set< string > >;\n\t};\n};\n\nconst STYLE_HASH_ATTRIBUTE = 'data-wp-hash';\n\n/**\n * Returns the shared style runtime registry.\n *\n * The registry is stored on `globalThis` so separately bundled copies of this\n * package can coordinate through the same document and style maps.\n *\n * @return The shared runtime registry.\n */\nfunction getRuntime() {\n\tconst globalScope = globalThis as GlobalScopeWithStyleRuntime;\n\n\tif ( globalScope.__wpStyleRuntime ) {\n\t\treturn globalScope.__wpStyleRuntime;\n\t}\n\n\tglobalScope.__wpStyleRuntime = {\n\t\tdocuments: new Map(),\n\t\tstyles: new Map(),\n\t\tinjectedStyles: new WeakMap(),\n\t};\n\n\tif ( typeof document !== 'undefined' ) {\n\t\tregisterDocument( document );\n\t}\n\n\treturn globalScope.__wpStyleRuntime;\n}\n\n/**\n * Checks whether a document already contains a style tag for a hash.\n *\n * @param targetDocument Document to inspect.\n * @param hash Stable hash for the transformed CSS.\n *\n * @return Whether the style hash already exists in the document.\n */\nfunction documentContainsStyleHash(\n\ttargetDocument: Document,\n\thash: string\n): boolean {\n\tif ( ! targetDocument.head ) {\n\t\treturn false;\n\t}\n\n\tfor ( const style of targetDocument.head.querySelectorAll(\n\t\t`style[${ STYLE_HASH_ATTRIBUTE }]`\n\t) ) {\n\t\tif ( style.getAttribute( STYLE_HASH_ATTRIBUTE ) === hash ) {\n\t\t\treturn true;\n\t\t}\n\t}\n\n\treturn false;\n}\n\n/**\n * Injects a registered style into a document, unless that document already\n * contains a style tag for the same hash.\n *\n * @param targetDocument Document to inject the style into.\n * @param hash Stable hash for the transformed CSS.\n * @param css CSS text to inject.\n */\nfunction injectStyle( targetDocument: Document, hash: string, css: string ) {\n\tif ( ! targetDocument.head ) {\n\t\treturn;\n\t}\n\n\tconst runtime = getRuntime();\n\tlet injectedStyles = runtime.injectedStyles.get( targetDocument );\n\n\tif ( ! injectedStyles ) {\n\t\tinjectedStyles = new Set();\n\t\truntime.injectedStyles.set( targetDocument, injectedStyles );\n\t}\n\n\tif ( injectedStyles.has( hash ) ) {\n\t\treturn;\n\t}\n\n\t// Older generated CSS module output can still inject matching style tags\n\t// after this document's cache is created, so keep the DOM as the fallback\n\t// source of truth on cache misses.\n\tif ( documentContainsStyleHash( targetDocument, hash ) ) {\n\t\tinjectedStyles.add( hash );\n\t\treturn;\n\t}\n\n\tconst style = targetDocument.createElement( 'style' );\n\tstyle.setAttribute( STYLE_HASH_ATTRIBUTE, hash );\n\tstyle.appendChild( targetDocument.createTextNode( css ) );\n\ttargetDocument.head.appendChild( style );\n\tinjectedStyles.add( hash );\n}\n\n/**\n * Registers a document as a style injection target.\n *\n * Existing registered styles are replayed into the document immediately.\n * Documents are reference-counted so multiple providers can safely register the\n * same document without one cleanup removing it while another registration is\n * still active.\n *\n * @param targetDocument Document to receive registered styles.\n * @return Cleanup function that unregisters this document registration.\n */\nexport function registerDocument( targetDocument: Document ) {\n\tconst runtime = getRuntime();\n\n\truntime.documents.set(\n\t\ttargetDocument,\n\t\t( runtime.documents.get( targetDocument ) ?? 0 ) + 1\n\t);\n\n\tfor ( const [ hash, css ] of runtime.styles ) {\n\t\tinjectStyle( targetDocument, hash, css );\n\t}\n\n\treturn () => {\n\t\tconst count = runtime.documents.get( targetDocument );\n\n\t\tif ( count === undefined ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( count <= 1 ) {\n\t\t\truntime.documents.delete( targetDocument );\n\t\t\treturn;\n\t\t}\n\n\t\truntime.documents.set( targetDocument, count - 1 );\n\t};\n}\n\n/**\n * Registers a style and injects it into all registered documents.\n *\n * The hash is used as the deduplication key, so calling this repeatedly with\n * the same hash will not add duplicate style tags to a document.\n * Registered styles are retained for the lifetime of the page so they can be\n * replayed into documents that are registered later.\n *\n * @param hash Stable hash for the transformed CSS.\n * @param css CSS text to inject.\n */\nexport function registerStyle( hash: string, css: string ) {\n\tconst runtime = getRuntime();\n\n\truntime.styles.set( hash, css );\n\n\tfor ( const targetDocument of runtime.documents.keys() ) {\n\t\tinjectStyle( targetDocument, hash, css );\n\t}\n}\n", "import { registerStyle } from '@wordpress/style-runtime';\nif (typeof process === 'undefined' || process.env.NODE_ENV !== 'test') {\n\tregisterStyle(\"e3ae230cea\", \"@layer wp-ui-utilities, wp-ui-components, wp-ui-compositions, wp-ui-overrides;@layer wp-ui-utilities{._336cd3e4e743482f__box-sizing{box-sizing:border-box;*,:after,:before{box-sizing:inherit}}}\");\n}\nexport default {\"box-sizing\":\"_336cd3e4e743482f__box-sizing\"};\n", "import { registerStyle } from '@wordpress/style-runtime';\nif (typeof process === 'undefined' || process.env.NODE_ENV !== 'test') {\n\tregisterStyle(\"cc851ac208\", \"@layer wp-ui-utilities, wp-ui-components, wp-ui-compositions, wp-ui-overrides;@layer wp-ui-components{._10450722b9676f78__positioner{z-index:var(--wp-ui-popover-z-index,initial)}._84e8f597bcf683b8__popup{background-color:var(--wpds-color-bg-surface-neutral-strong,#fff);border:var(--wpds-border-width-xs,1px) solid var(--wpds-color-stroke-surface-neutral,#dbdbdb);border-radius:var(--wpds-border-radius-md,4px);box-shadow:var(--wpds-elevation-md,0 2px 3px 0 #0000000d,0 4px 5px 0 #0000000a,0 12px 12px 0 #00000008,0 16px 16px 0 #00000005);color:var(--wpds-color-fg-content-neutral,#1e1e1e);font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,\\\"Segoe UI\\\",\\\"Roboto\\\",\\\"Oxygen-Sans\\\",\\\"Ubuntu\\\",\\\"Cantarell\\\",\\\"Helvetica Neue\\\",sans-serif);font-size:var(--wpds-typography-font-size-md,13px);line-height:var(--wpds-typography-line-height-md,24px);outline:0;padding:var(--wpds-dimension-padding-lg,16px)}.e4d544aa033f05c6__backdrop~* ._84e8f597bcf683b8__popup{border-color:#0000}@media (forced-colors:active){._84e8f597bcf683b8__popup,.e4d544aa033f05c6__backdrop~* ._84e8f597bcf683b8__popup{border-color:CanvasText}}.ca05d3eb89321fcd__arrow{display:flex;&[data-side=top]{bottom:-8px;rotate:180deg}&[data-side=bottom]{rotate:0deg;top:-8px}&[data-side=left]{inset-inline-end:-13px;rotate:90deg}&[data-side=right]{inset-inline-start:-13px;rotate:-90deg}}._12d8edd9eb946b5f__arrow-fill{fill:var(--wpds-color-bg-surface-neutral-strong,#fff)}._6ddab482bd929dad__arrow-stroke{fill:var(--wpds-color-stroke-surface-neutral,#dbdbdb)}._6d7e4729cd96960e__title{--_gcd-heading-color:var(--wpds-color-fg-content-neutral,#1e1e1e);color:var(--wpds-color-fg-content-neutral,#1e1e1e)}.e4d544aa033f05c6__backdrop{background-color:#00000026;inset:0;position:fixed;z-index:var(--wp-ui-popover-z-index,initial)}}\");\n}\nexport default {\"positioner\":\"_10450722b9676f78__positioner\",\"popup\":\"_84e8f597bcf683b8__popup\",\"backdrop\":\"e4d544aa033f05c6__backdrop\",\"arrow\":\"ca05d3eb89321fcd__arrow\",\"arrow-fill\":\"_12d8edd9eb946b5f__arrow-fill\",\"arrow-stroke\":\"_6ddab482bd929dad__arrow-stroke\",\"title\":\"_6d7e4729cd96960e__title\"};\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qBAAoC;AACpC,kBAAiB;AACjB,qBAA2B;AAC3B,qBAA6B;AAC7B,mBAGO;AACP,yBAAuB;;;
|
|
3
|
+
"sources": ["../../src/popover/popup.tsx", "../../../style-runtime/src/index.ts", "../../src/popover/style.module.css"],
|
|
4
|
+
"sourcesContent": ["import { Popover as _Popover } from '@base-ui/react/popover';\nimport clsx from 'clsx';\nimport { forwardRef } from '@wordpress/element';\nimport { useMergeRefs } from '@wordpress/compose';\nimport {\n\ttype ThemeProvider as ThemeProviderType,\n\tprivateApis as themePrivateApis,\n} from '@wordpress/theme';\nimport { unlock } from '../lock-unlock';\nimport { useDeprioritizedInitialFocus } from '../utils/use-deprioritized-initial-focus';\nimport { renderSlotWithChildren } from '../utils/render-slot-with-children';\nimport { PopoverValidationProvider } from './context';\nimport { Portal } from './portal';\nimport { Positioner } from './positioner';\nimport styles from './style.module.css';\nimport type { PopupProps } from './types';\n\nconst ThemeProvider: typeof ThemeProviderType =\n\tunlock( themePrivateApis ).ThemeProvider;\n\nconst CLOSE_ATTR = 'data-wp-ui-popover-close';\n\n/**\n * Renders the floating popup container for the popover content.\n *\n * Handles portal rendering, positioning relative to the anchor, collision\n * avoidance, focus management, and optional backdrop. Use\n * `portal={ <Popover.Portal container={ ... } /> }` for cross-document\n * scenarios such as iframes, and `positioner={ <Popover.Positioner \u2026 /> }`\n * to customize placement.\n */\nconst Popup = forwardRef< HTMLDivElement, PopupProps >( function PopoverPopup(\n\t{\n\t\tbackdrop = false,\n\t\tchildren,\n\t\tclassName,\n\t\tportal,\n\t\tpositioner,\n\t\tfinalFocus,\n\t\tinitialFocus,\n\t\tvariant = 'default',\n\t\t...props\n\t},\n\tref\n) {\n\tconst { resolvedInitialFocus, popupRef } = useDeprioritizedInitialFocus( {\n\t\tinitialFocus,\n\t\tdeprioritizedAttributes: [ CLOSE_ATTR ],\n\t} );\n\tconst mergedPopupRef = useMergeRefs( [ ref, popupRef ] );\n\n\tconst backdropElement = backdrop ? (\n\t\t<_Popover.Backdrop className={ styles.backdrop } />\n\t) : null;\n\n\tconst popupContent = (\n\t\t<ThemeProvider>\n\t\t\t<_Popover.Popup\n\t\t\t\tref={ mergedPopupRef }\n\t\t\t\tinitialFocus={ resolvedInitialFocus }\n\t\t\t\tfinalFocus={ finalFocus }\n\t\t\t\tclassName={ clsx(\n\t\t\t\t\tvariant !== 'unstyled' && styles.popup,\n\t\t\t\t\tclassName\n\t\t\t\t) }\n\t\t\t\t{ ...props }\n\t\t\t>\n\t\t\t\t<PopoverValidationProvider>\n\t\t\t\t\t{ children }\n\t\t\t\t</PopoverValidationProvider>\n\t\t\t</_Popover.Popup>\n\t\t</ThemeProvider>\n\t);\n\n\tconst positionedPopup = renderSlotWithChildren(\n\t\tpositioner,\n\t\t<Positioner />,\n\t\tpopupContent\n\t);\n\n\tconst portalChildren = (\n\t\t<>\n\t\t\t{ backdropElement }\n\t\t\t{ positionedPopup }\n\t\t</>\n\t);\n\n\treturn renderSlotWithChildren( portal, <Portal />, portalChildren );\n} );\n\nexport { Popup };\n", "type GlobalScopeWithStyleRuntime = typeof globalThis & {\n\t// This global is shared by separately bundled copies of this package.\n\t// Keep its shape backward compatible after release.\n\t__wpStyleRuntime?: {\n\t\tdocuments: Map< Document, number >;\n\t\tstyles: Map< string, string >;\n\t\tinjectedStyles: WeakMap< Document, Set< string > >;\n\t};\n};\n\nconst STYLE_HASH_ATTRIBUTE = 'data-wp-hash';\n\n/**\n * Returns the shared style runtime registry.\n *\n * The registry is stored on `globalThis` so separately bundled copies of this\n * package can coordinate through the same document and style maps.\n *\n * @return The shared runtime registry.\n */\nfunction getRuntime() {\n\tconst globalScope = globalThis as GlobalScopeWithStyleRuntime;\n\n\tif ( globalScope.__wpStyleRuntime ) {\n\t\treturn globalScope.__wpStyleRuntime;\n\t}\n\n\tglobalScope.__wpStyleRuntime = {\n\t\tdocuments: new Map(),\n\t\tstyles: new Map(),\n\t\tinjectedStyles: new WeakMap(),\n\t};\n\n\tif ( typeof document !== 'undefined' ) {\n\t\tregisterDocument( document );\n\t}\n\n\treturn globalScope.__wpStyleRuntime;\n}\n\n/**\n * Checks whether a document already contains a style tag for a hash.\n *\n * @param targetDocument Document to inspect.\n * @param hash Stable hash for the transformed CSS.\n *\n * @return Whether the style hash already exists in the document.\n */\nfunction documentContainsStyleHash(\n\ttargetDocument: Document,\n\thash: string\n): boolean {\n\tif ( ! targetDocument.head ) {\n\t\treturn false;\n\t}\n\n\tfor ( const style of targetDocument.head.querySelectorAll(\n\t\t`style[${ STYLE_HASH_ATTRIBUTE }]`\n\t) ) {\n\t\tif ( style.getAttribute( STYLE_HASH_ATTRIBUTE ) === hash ) {\n\t\t\treturn true;\n\t\t}\n\t}\n\n\treturn false;\n}\n\n/**\n * Injects a registered style into a document, unless that document already\n * contains a style tag for the same hash.\n *\n * @param targetDocument Document to inject the style into.\n * @param hash Stable hash for the transformed CSS.\n * @param css CSS text to inject.\n */\nfunction injectStyle( targetDocument: Document, hash: string, css: string ) {\n\tif ( ! targetDocument.head ) {\n\t\treturn;\n\t}\n\n\tconst runtime = getRuntime();\n\tlet injectedStyles = runtime.injectedStyles.get( targetDocument );\n\n\tif ( ! injectedStyles ) {\n\t\tinjectedStyles = new Set();\n\t\truntime.injectedStyles.set( targetDocument, injectedStyles );\n\t}\n\n\tif ( injectedStyles.has( hash ) ) {\n\t\treturn;\n\t}\n\n\t// Older generated CSS module output can still inject matching style tags\n\t// after this document's cache is created, so keep the DOM as the fallback\n\t// source of truth on cache misses.\n\tif ( documentContainsStyleHash( targetDocument, hash ) ) {\n\t\tinjectedStyles.add( hash );\n\t\treturn;\n\t}\n\n\tconst style = targetDocument.createElement( 'style' );\n\tstyle.setAttribute( STYLE_HASH_ATTRIBUTE, hash );\n\tstyle.appendChild( targetDocument.createTextNode( css ) );\n\ttargetDocument.head.appendChild( style );\n\tinjectedStyles.add( hash );\n}\n\n/**\n * Registers a document as a style injection target.\n *\n * Existing registered styles are replayed into the document immediately.\n * Documents are reference-counted so multiple providers can safely register the\n * same document without one cleanup removing it while another registration is\n * still active.\n *\n * @param targetDocument Document to receive registered styles.\n * @return Cleanup function that unregisters this document registration.\n */\nexport function registerDocument( targetDocument: Document ) {\n\tconst runtime = getRuntime();\n\n\truntime.documents.set(\n\t\ttargetDocument,\n\t\t( runtime.documents.get( targetDocument ) ?? 0 ) + 1\n\t);\n\n\tfor ( const [ hash, css ] of runtime.styles ) {\n\t\tinjectStyle( targetDocument, hash, css );\n\t}\n\n\treturn () => {\n\t\tconst count = runtime.documents.get( targetDocument );\n\n\t\tif ( count === undefined ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( count <= 1 ) {\n\t\t\truntime.documents.delete( targetDocument );\n\t\t\treturn;\n\t\t}\n\n\t\truntime.documents.set( targetDocument, count - 1 );\n\t};\n}\n\n/**\n * Registers a style and injects it into all registered documents.\n *\n * The hash is used as the deduplication key, so calling this repeatedly with\n * the same hash will not add duplicate style tags to a document.\n * Registered styles are retained for the lifetime of the page so they can be\n * replayed into documents that are registered later.\n *\n * @param hash Stable hash for the transformed CSS.\n * @param css CSS text to inject.\n */\nexport function registerStyle( hash: string, css: string ) {\n\tconst runtime = getRuntime();\n\n\truntime.styles.set( hash, css );\n\n\tfor ( const targetDocument of runtime.documents.keys() ) {\n\t\tinjectStyle( targetDocument, hash, css );\n\t}\n}\n", "import { registerStyle } from '@wordpress/style-runtime';\nif (typeof process === 'undefined' || process.env.NODE_ENV !== 'test') {\n\tregisterStyle(\"cc851ac208\", \"@layer wp-ui-utilities, wp-ui-components, wp-ui-compositions, wp-ui-overrides;@layer wp-ui-components{._10450722b9676f78__positioner{z-index:var(--wp-ui-popover-z-index,initial)}._84e8f597bcf683b8__popup{background-color:var(--wpds-color-bg-surface-neutral-strong,#fff);border:var(--wpds-border-width-xs,1px) solid var(--wpds-color-stroke-surface-neutral,#dbdbdb);border-radius:var(--wpds-border-radius-md,4px);box-shadow:var(--wpds-elevation-md,0 2px 3px 0 #0000000d,0 4px 5px 0 #0000000a,0 12px 12px 0 #00000008,0 16px 16px 0 #00000005);color:var(--wpds-color-fg-content-neutral,#1e1e1e);font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,\\\"Segoe UI\\\",\\\"Roboto\\\",\\\"Oxygen-Sans\\\",\\\"Ubuntu\\\",\\\"Cantarell\\\",\\\"Helvetica Neue\\\",sans-serif);font-size:var(--wpds-typography-font-size-md,13px);line-height:var(--wpds-typography-line-height-md,24px);outline:0;padding:var(--wpds-dimension-padding-lg,16px)}.e4d544aa033f05c6__backdrop~* ._84e8f597bcf683b8__popup{border-color:#0000}@media (forced-colors:active){._84e8f597bcf683b8__popup,.e4d544aa033f05c6__backdrop~* ._84e8f597bcf683b8__popup{border-color:CanvasText}}.ca05d3eb89321fcd__arrow{display:flex;&[data-side=top]{bottom:-8px;rotate:180deg}&[data-side=bottom]{rotate:0deg;top:-8px}&[data-side=left]{inset-inline-end:-13px;rotate:90deg}&[data-side=right]{inset-inline-start:-13px;rotate:-90deg}}._12d8edd9eb946b5f__arrow-fill{fill:var(--wpds-color-bg-surface-neutral-strong,#fff)}._6ddab482bd929dad__arrow-stroke{fill:var(--wpds-color-stroke-surface-neutral,#dbdbdb)}._6d7e4729cd96960e__title{--_gcd-heading-color:var(--wpds-color-fg-content-neutral,#1e1e1e);color:var(--wpds-color-fg-content-neutral,#1e1e1e)}.e4d544aa033f05c6__backdrop{background-color:#00000026;inset:0;position:fixed;z-index:var(--wp-ui-popover-z-index,initial)}}\");\n}\nexport default {\"positioner\":\"_10450722b9676f78__positioner\",\"popup\":\"_84e8f597bcf683b8__popup\",\"backdrop\":\"e4d544aa033f05c6__backdrop\",\"arrow\":\"ca05d3eb89321fcd__arrow\",\"arrow-fill\":\"_12d8edd9eb946b5f__arrow-fill\",\"arrow-stroke\":\"_6ddab482bd929dad__arrow-stroke\",\"title\":\"_6d7e4729cd96960e__title\"};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qBAA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;AACJ,GACA,KACC;AACD,QAAM,EAAE,sBAAsB,SAAS,QAAI,qEAA8B;AAAA,IACxE;AAAA,IACA,yBAAyB,CAAE,UAAW;AAAA,EACvC,CAAE;AACF,QAAM,qBAAiB,6BAAc,CAAE,KAAK,QAAS,CAAE;AAEvD,QAAM,kBAAkB,WACvB,4CAAC,eAAAC,QAAS,UAAT,EAAkB,WAAY,cAAO,UAAW,IAC9C;AAEJ,QAAM,eACL,4CAAC,iBACA;AAAA,IAAC,eAAAA,QAAS;AAAA,IAAT;AAAA,MACA,KAAM;AAAA,MACN,cAAe;AAAA,MACf;AAAA,MACA,eAAY,YAAAC;AAAA,QACX,YAAY,cAAc,cAAO;AAAA,QACjC;AAAA,MACD;AAAA,MACE,GAAG;AAAA,MAEL,sDAAC,4CACE,UACH;AAAA;AAAA,EACD,GACD;AAGD,QAAM,sBAAkB;AAAA,IACvB;AAAA,IACA,4CAAC,gCAAW;AAAA,IACZ;AAAA,EACD;AAEA,QAAM,iBACL,4EACG;AAAA;AAAA,IACA;AAAA,KACH;AAGD,aAAO,yDAAwB,QAAQ,4CAAC,wBAAO,GAAI,cAAe;AACnE,CAAE;",
|
|
6
6
|
"names": ["themePrivateApis", "_Popover", "clsx"]
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/popover/portal.tsx"],
|
|
4
|
-
"sourcesContent": ["import { Popover as _Popover } from '@base-ui/react/popover';\nimport { forwardRef } from '@wordpress/element';\nimport type { PortalProps } from './types';\n\n/**\n *
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qBAAoC;AACpC,qBAA2B;
|
|
4
|
+
"sourcesContent": ["import { Popover as _Popover } from '@base-ui/react/popover';\nimport { forwardRef } from '@wordpress/element';\nimport type { PortalProps } from './types';\n\n/**\n * Used to apply custom portal behavior to `Popover`'s floating content.\n */\nconst Portal = forwardRef< HTMLDivElement, PortalProps >(\n\tfunction PopoverPortal( props, ref ) {\n\t\treturn <_Popover.Portal ref={ ref } { ...props } />;\n\t}\n);\n\nexport { Portal };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qBAAoC;AACpC,qBAA2B;AAQlB;AAFT,IAAM,aAAS;AAAA,EACd,SAAS,cAAe,OAAO,KAAM;AACpC,WAAO,4CAAC,eAAAA,QAAS,QAAT,EAAgB,KAAc,GAAG,OAAQ;AAAA,EAClD;AACD;",
|
|
6
6
|
"names": ["_Popover"]
|
|
7
7
|
}
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
|
|
30
|
+
// packages/ui/src/popover/positioner.tsx
|
|
31
|
+
var positioner_exports = {};
|
|
32
|
+
__export(positioner_exports, {
|
|
33
|
+
Positioner: () => Positioner
|
|
34
|
+
});
|
|
35
|
+
module.exports = __toCommonJS(positioner_exports);
|
|
36
|
+
var import_clsx = __toESM(require("clsx"));
|
|
37
|
+
var import_popover = require("@base-ui/react/popover");
|
|
38
|
+
var import_element = require("@wordpress/element");
|
|
39
|
+
|
|
40
|
+
// packages/style-runtime/src/index.ts
|
|
41
|
+
var STYLE_HASH_ATTRIBUTE = "data-wp-hash";
|
|
42
|
+
function getRuntime() {
|
|
43
|
+
const globalScope = globalThis;
|
|
44
|
+
if (globalScope.__wpStyleRuntime) {
|
|
45
|
+
return globalScope.__wpStyleRuntime;
|
|
46
|
+
}
|
|
47
|
+
globalScope.__wpStyleRuntime = {
|
|
48
|
+
documents: /* @__PURE__ */ new Map(),
|
|
49
|
+
styles: /* @__PURE__ */ new Map(),
|
|
50
|
+
injectedStyles: /* @__PURE__ */ new WeakMap()
|
|
51
|
+
};
|
|
52
|
+
if (typeof document !== "undefined") {
|
|
53
|
+
registerDocument(document);
|
|
54
|
+
}
|
|
55
|
+
return globalScope.__wpStyleRuntime;
|
|
56
|
+
}
|
|
57
|
+
function documentContainsStyleHash(targetDocument, hash) {
|
|
58
|
+
if (!targetDocument.head) {
|
|
59
|
+
return false;
|
|
60
|
+
}
|
|
61
|
+
for (const style of targetDocument.head.querySelectorAll(
|
|
62
|
+
`style[${STYLE_HASH_ATTRIBUTE}]`
|
|
63
|
+
)) {
|
|
64
|
+
if (style.getAttribute(STYLE_HASH_ATTRIBUTE) === hash) {
|
|
65
|
+
return true;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
return false;
|
|
69
|
+
}
|
|
70
|
+
function injectStyle(targetDocument, hash, css) {
|
|
71
|
+
if (!targetDocument.head) {
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
const runtime = getRuntime();
|
|
75
|
+
let injectedStyles = runtime.injectedStyles.get(targetDocument);
|
|
76
|
+
if (!injectedStyles) {
|
|
77
|
+
injectedStyles = /* @__PURE__ */ new Set();
|
|
78
|
+
runtime.injectedStyles.set(targetDocument, injectedStyles);
|
|
79
|
+
}
|
|
80
|
+
if (injectedStyles.has(hash)) {
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
if (documentContainsStyleHash(targetDocument, hash)) {
|
|
84
|
+
injectedStyles.add(hash);
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
const style = targetDocument.createElement("style");
|
|
88
|
+
style.setAttribute(STYLE_HASH_ATTRIBUTE, hash);
|
|
89
|
+
style.appendChild(targetDocument.createTextNode(css));
|
|
90
|
+
targetDocument.head.appendChild(style);
|
|
91
|
+
injectedStyles.add(hash);
|
|
92
|
+
}
|
|
93
|
+
function registerDocument(targetDocument) {
|
|
94
|
+
const runtime = getRuntime();
|
|
95
|
+
runtime.documents.set(
|
|
96
|
+
targetDocument,
|
|
97
|
+
(runtime.documents.get(targetDocument) ?? 0) + 1
|
|
98
|
+
);
|
|
99
|
+
for (const [hash, css] of runtime.styles) {
|
|
100
|
+
injectStyle(targetDocument, hash, css);
|
|
101
|
+
}
|
|
102
|
+
return () => {
|
|
103
|
+
const count = runtime.documents.get(targetDocument);
|
|
104
|
+
if (count === void 0) {
|
|
105
|
+
return;
|
|
106
|
+
}
|
|
107
|
+
if (count <= 1) {
|
|
108
|
+
runtime.documents.delete(targetDocument);
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
111
|
+
runtime.documents.set(targetDocument, count - 1);
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
function registerStyle(hash, css) {
|
|
115
|
+
const runtime = getRuntime();
|
|
116
|
+
runtime.styles.set(hash, css);
|
|
117
|
+
for (const targetDocument of runtime.documents.keys()) {
|
|
118
|
+
injectStyle(targetDocument, hash, css);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
// packages/ui/src/utils/css/resets.module.css
|
|
123
|
+
if (typeof process === "undefined" || process.env.NODE_ENV !== "test") {
|
|
124
|
+
registerStyle("e3ae230cea", "@layer wp-ui-utilities, wp-ui-components, wp-ui-compositions, wp-ui-overrides;@layer wp-ui-utilities{._336cd3e4e743482f__box-sizing{box-sizing:border-box;*,:after,:before{box-sizing:inherit}}}");
|
|
125
|
+
}
|
|
126
|
+
var resets_default = { "box-sizing": "_336cd3e4e743482f__box-sizing" };
|
|
127
|
+
|
|
128
|
+
// packages/ui/src/popover/style.module.css
|
|
129
|
+
if (typeof process === "undefined" || process.env.NODE_ENV !== "test") {
|
|
130
|
+
registerStyle("cc851ac208", '@layer wp-ui-utilities, wp-ui-components, wp-ui-compositions, wp-ui-overrides;@layer wp-ui-components{._10450722b9676f78__positioner{z-index:var(--wp-ui-popover-z-index,initial)}._84e8f597bcf683b8__popup{background-color:var(--wpds-color-bg-surface-neutral-strong,#fff);border:var(--wpds-border-width-xs,1px) solid var(--wpds-color-stroke-surface-neutral,#dbdbdb);border-radius:var(--wpds-border-radius-md,4px);box-shadow:var(--wpds-elevation-md,0 2px 3px 0 #0000000d,0 4px 5px 0 #0000000a,0 12px 12px 0 #00000008,0 16px 16px 0 #00000005);color:var(--wpds-color-fg-content-neutral,#1e1e1e);font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-size:var(--wpds-typography-font-size-md,13px);line-height:var(--wpds-typography-line-height-md,24px);outline:0;padding:var(--wpds-dimension-padding-lg,16px)}.e4d544aa033f05c6__backdrop~* ._84e8f597bcf683b8__popup{border-color:#0000}@media (forced-colors:active){._84e8f597bcf683b8__popup,.e4d544aa033f05c6__backdrop~* ._84e8f597bcf683b8__popup{border-color:CanvasText}}.ca05d3eb89321fcd__arrow{display:flex;&[data-side=top]{bottom:-8px;rotate:180deg}&[data-side=bottom]{rotate:0deg;top:-8px}&[data-side=left]{inset-inline-end:-13px;rotate:90deg}&[data-side=right]{inset-inline-start:-13px;rotate:-90deg}}._12d8edd9eb946b5f__arrow-fill{fill:var(--wpds-color-bg-surface-neutral-strong,#fff)}._6ddab482bd929dad__arrow-stroke{fill:var(--wpds-color-stroke-surface-neutral,#dbdbdb)}._6d7e4729cd96960e__title{--_gcd-heading-color:var(--wpds-color-fg-content-neutral,#1e1e1e);color:var(--wpds-color-fg-content-neutral,#1e1e1e)}.e4d544aa033f05c6__backdrop{background-color:#00000026;inset:0;position:fixed;z-index:var(--wp-ui-popover-z-index,initial)}}');
|
|
131
|
+
}
|
|
132
|
+
var style_default = { "positioner": "_10450722b9676f78__positioner", "popup": "_84e8f597bcf683b8__popup", "backdrop": "e4d544aa033f05c6__backdrop", "arrow": "ca05d3eb89321fcd__arrow", "arrow-fill": "_12d8edd9eb946b5f__arrow-fill", "arrow-stroke": "_6ddab482bd929dad__arrow-stroke", "title": "_6d7e4729cd96960e__title" };
|
|
133
|
+
|
|
134
|
+
// packages/ui/src/popover/positioner.tsx
|
|
135
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
136
|
+
var Positioner = (0, import_element.forwardRef)(
|
|
137
|
+
function PopoverPositioner({
|
|
138
|
+
align = "center",
|
|
139
|
+
// Matches the popup's border-radius (--wpds-border-radius-md).
|
|
140
|
+
arrowPadding = 8,
|
|
141
|
+
className,
|
|
142
|
+
side = "bottom",
|
|
143
|
+
sideOffset = 8,
|
|
144
|
+
...props
|
|
145
|
+
}, ref) {
|
|
146
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
147
|
+
import_popover.Popover.Positioner,
|
|
148
|
+
{
|
|
149
|
+
ref,
|
|
150
|
+
align,
|
|
151
|
+
arrowPadding,
|
|
152
|
+
side,
|
|
153
|
+
sideOffset,
|
|
154
|
+
...props,
|
|
155
|
+
className: (0, import_clsx.default)(
|
|
156
|
+
resets_default["box-sizing"],
|
|
157
|
+
style_default.positioner,
|
|
158
|
+
className
|
|
159
|
+
)
|
|
160
|
+
}
|
|
161
|
+
);
|
|
162
|
+
}
|
|
163
|
+
);
|
|
164
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
165
|
+
0 && (module.exports = {
|
|
166
|
+
Positioner
|
|
167
|
+
});
|
|
168
|
+
//# sourceMappingURL=positioner.cjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/popover/positioner.tsx", "../../../style-runtime/src/index.ts", "../../src/utils/css/resets.module.css", "../../src/popover/style.module.css"],
|
|
4
|
+
"sourcesContent": ["import clsx from 'clsx';\nimport { Popover as _Popover } from '@base-ui/react/popover';\nimport { forwardRef } from '@wordpress/element';\nimport type { PositionerProps } from './types';\nimport resetStyles from '../utils/css/resets.module.css';\nimport styles from './style.module.css';\n\n/**\n * Used to apply custom positioning to `Popover`'s floating content.\n */\nconst Positioner = forwardRef< HTMLDivElement, PositionerProps >(\n\tfunction PopoverPositioner(\n\t\t{\n\t\t\talign = 'center',\n\t\t\t// Matches the popup's border-radius (--wpds-border-radius-md).\n\t\t\tarrowPadding = 8,\n\t\t\tclassName,\n\t\t\tside = 'bottom',\n\t\t\tsideOffset = 8,\n\t\t\t...props\n\t\t},\n\t\tref\n\t) {\n\t\treturn (\n\t\t\t<_Popover.Positioner\n\t\t\t\tref={ ref }\n\t\t\t\talign={ align }\n\t\t\t\tarrowPadding={ arrowPadding }\n\t\t\t\tside={ side }\n\t\t\t\tsideOffset={ sideOffset }\n\t\t\t\t{ ...props }\n\t\t\t\tclassName={ clsx(\n\t\t\t\t\tresetStyles[ 'box-sizing' ],\n\t\t\t\t\tstyles.positioner,\n\t\t\t\t\tclassName\n\t\t\t\t) }\n\t\t\t/>\n\t\t);\n\t}\n);\n\nexport { Positioner };\n", "type GlobalScopeWithStyleRuntime = typeof globalThis & {\n\t// This global is shared by separately bundled copies of this package.\n\t// Keep its shape backward compatible after release.\n\t__wpStyleRuntime?: {\n\t\tdocuments: Map< Document, number >;\n\t\tstyles: Map< string, string >;\n\t\tinjectedStyles: WeakMap< Document, Set< string > >;\n\t};\n};\n\nconst STYLE_HASH_ATTRIBUTE = 'data-wp-hash';\n\n/**\n * Returns the shared style runtime registry.\n *\n * The registry is stored on `globalThis` so separately bundled copies of this\n * package can coordinate through the same document and style maps.\n *\n * @return The shared runtime registry.\n */\nfunction getRuntime() {\n\tconst globalScope = globalThis as GlobalScopeWithStyleRuntime;\n\n\tif ( globalScope.__wpStyleRuntime ) {\n\t\treturn globalScope.__wpStyleRuntime;\n\t}\n\n\tglobalScope.__wpStyleRuntime = {\n\t\tdocuments: new Map(),\n\t\tstyles: new Map(),\n\t\tinjectedStyles: new WeakMap(),\n\t};\n\n\tif ( typeof document !== 'undefined' ) {\n\t\tregisterDocument( document );\n\t}\n\n\treturn globalScope.__wpStyleRuntime;\n}\n\n/**\n * Checks whether a document already contains a style tag for a hash.\n *\n * @param targetDocument Document to inspect.\n * @param hash Stable hash for the transformed CSS.\n *\n * @return Whether the style hash already exists in the document.\n */\nfunction documentContainsStyleHash(\n\ttargetDocument: Document,\n\thash: string\n): boolean {\n\tif ( ! targetDocument.head ) {\n\t\treturn false;\n\t}\n\n\tfor ( const style of targetDocument.head.querySelectorAll(\n\t\t`style[${ STYLE_HASH_ATTRIBUTE }]`\n\t) ) {\n\t\tif ( style.getAttribute( STYLE_HASH_ATTRIBUTE ) === hash ) {\n\t\t\treturn true;\n\t\t}\n\t}\n\n\treturn false;\n}\n\n/**\n * Injects a registered style into a document, unless that document already\n * contains a style tag for the same hash.\n *\n * @param targetDocument Document to inject the style into.\n * @param hash Stable hash for the transformed CSS.\n * @param css CSS text to inject.\n */\nfunction injectStyle( targetDocument: Document, hash: string, css: string ) {\n\tif ( ! targetDocument.head ) {\n\t\treturn;\n\t}\n\n\tconst runtime = getRuntime();\n\tlet injectedStyles = runtime.injectedStyles.get( targetDocument );\n\n\tif ( ! injectedStyles ) {\n\t\tinjectedStyles = new Set();\n\t\truntime.injectedStyles.set( targetDocument, injectedStyles );\n\t}\n\n\tif ( injectedStyles.has( hash ) ) {\n\t\treturn;\n\t}\n\n\t// Older generated CSS module output can still inject matching style tags\n\t// after this document's cache is created, so keep the DOM as the fallback\n\t// source of truth on cache misses.\n\tif ( documentContainsStyleHash( targetDocument, hash ) ) {\n\t\tinjectedStyles.add( hash );\n\t\treturn;\n\t}\n\n\tconst style = targetDocument.createElement( 'style' );\n\tstyle.setAttribute( STYLE_HASH_ATTRIBUTE, hash );\n\tstyle.appendChild( targetDocument.createTextNode( css ) );\n\ttargetDocument.head.appendChild( style );\n\tinjectedStyles.add( hash );\n}\n\n/**\n * Registers a document as a style injection target.\n *\n * Existing registered styles are replayed into the document immediately.\n * Documents are reference-counted so multiple providers can safely register the\n * same document without one cleanup removing it while another registration is\n * still active.\n *\n * @param targetDocument Document to receive registered styles.\n * @return Cleanup function that unregisters this document registration.\n */\nexport function registerDocument( targetDocument: Document ) {\n\tconst runtime = getRuntime();\n\n\truntime.documents.set(\n\t\ttargetDocument,\n\t\t( runtime.documents.get( targetDocument ) ?? 0 ) + 1\n\t);\n\n\tfor ( const [ hash, css ] of runtime.styles ) {\n\t\tinjectStyle( targetDocument, hash, css );\n\t}\n\n\treturn () => {\n\t\tconst count = runtime.documents.get( targetDocument );\n\n\t\tif ( count === undefined ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( count <= 1 ) {\n\t\t\truntime.documents.delete( targetDocument );\n\t\t\treturn;\n\t\t}\n\n\t\truntime.documents.set( targetDocument, count - 1 );\n\t};\n}\n\n/**\n * Registers a style and injects it into all registered documents.\n *\n * The hash is used as the deduplication key, so calling this repeatedly with\n * the same hash will not add duplicate style tags to a document.\n * Registered styles are retained for the lifetime of the page so they can be\n * replayed into documents that are registered later.\n *\n * @param hash Stable hash for the transformed CSS.\n * @param css CSS text to inject.\n */\nexport function registerStyle( hash: string, css: string ) {\n\tconst runtime = getRuntime();\n\n\truntime.styles.set( hash, css );\n\n\tfor ( const targetDocument of runtime.documents.keys() ) {\n\t\tinjectStyle( targetDocument, hash, css );\n\t}\n}\n", "import { registerStyle } from '@wordpress/style-runtime';\nif (typeof process === 'undefined' || process.env.NODE_ENV !== 'test') {\n\tregisterStyle(\"e3ae230cea\", \"@layer wp-ui-utilities, wp-ui-components, wp-ui-compositions, wp-ui-overrides;@layer wp-ui-utilities{._336cd3e4e743482f__box-sizing{box-sizing:border-box;*,:after,:before{box-sizing:inherit}}}\");\n}\nexport default {\"box-sizing\":\"_336cd3e4e743482f__box-sizing\"};\n", "import { registerStyle } from '@wordpress/style-runtime';\nif (typeof process === 'undefined' || process.env.NODE_ENV !== 'test') {\n\tregisterStyle(\"cc851ac208\", \"@layer wp-ui-utilities, wp-ui-components, wp-ui-compositions, wp-ui-overrides;@layer wp-ui-components{._10450722b9676f78__positioner{z-index:var(--wp-ui-popover-z-index,initial)}._84e8f597bcf683b8__popup{background-color:var(--wpds-color-bg-surface-neutral-strong,#fff);border:var(--wpds-border-width-xs,1px) solid var(--wpds-color-stroke-surface-neutral,#dbdbdb);border-radius:var(--wpds-border-radius-md,4px);box-shadow:var(--wpds-elevation-md,0 2px 3px 0 #0000000d,0 4px 5px 0 #0000000a,0 12px 12px 0 #00000008,0 16px 16px 0 #00000005);color:var(--wpds-color-fg-content-neutral,#1e1e1e);font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,\\\"Segoe UI\\\",\\\"Roboto\\\",\\\"Oxygen-Sans\\\",\\\"Ubuntu\\\",\\\"Cantarell\\\",\\\"Helvetica Neue\\\",sans-serif);font-size:var(--wpds-typography-font-size-md,13px);line-height:var(--wpds-typography-line-height-md,24px);outline:0;padding:var(--wpds-dimension-padding-lg,16px)}.e4d544aa033f05c6__backdrop~* ._84e8f597bcf683b8__popup{border-color:#0000}@media (forced-colors:active){._84e8f597bcf683b8__popup,.e4d544aa033f05c6__backdrop~* ._84e8f597bcf683b8__popup{border-color:CanvasText}}.ca05d3eb89321fcd__arrow{display:flex;&[data-side=top]{bottom:-8px;rotate:180deg}&[data-side=bottom]{rotate:0deg;top:-8px}&[data-side=left]{inset-inline-end:-13px;rotate:90deg}&[data-side=right]{inset-inline-start:-13px;rotate:-90deg}}._12d8edd9eb946b5f__arrow-fill{fill:var(--wpds-color-bg-surface-neutral-strong,#fff)}._6ddab482bd929dad__arrow-stroke{fill:var(--wpds-color-stroke-surface-neutral,#dbdbdb)}._6d7e4729cd96960e__title{--_gcd-heading-color:var(--wpds-color-fg-content-neutral,#1e1e1e);color:var(--wpds-color-fg-content-neutral,#1e1e1e)}.e4d544aa033f05c6__backdrop{background-color:#00000026;inset:0;position:fixed;z-index:var(--wp-ui-popover-z-index,initial)}}\");\n}\nexport default {\"positioner\":\"_10450722b9676f78__positioner\",\"popup\":\"_84e8f597bcf683b8__popup\",\"backdrop\":\"e4d544aa033f05c6__backdrop\",\"arrow\":\"ca05d3eb89321fcd__arrow\",\"arrow-fill\":\"_12d8edd9eb946b5f__arrow-fill\",\"arrow-stroke\":\"_6ddab482bd929dad__arrow-stroke\",\"title\":\"_6d7e4729cd96960e__title\"};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAiB;AACjB,qBAAoC;AACpC,qBAA2B;;;ACQ3B,IAAM,uBAAuB;AAU7B,SAAS,aAAa;AACrB,QAAM,cAAc;AAEpB,MAAK,YAAY,kBAAmB;AACnC,WAAO,YAAY;AAAA,EACpB;AAEA,cAAY,mBAAmB;AAAA,IAC9B,WAAW,oBAAI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ACD;",
|
|
6
|
+
"names": ["_Popover", "clsx"]
|
|
7
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/popover/root.tsx"],
|
|
4
|
-
"sourcesContent": ["import { Popover as _Popover } from '@base-ui/react/popover';\nimport type { RootProps } from './types';\n\n/**\n * An accessible popup anchored to a trigger element.\n *\n * Popover renders ARIA-compliant floating content that appears next to its\n * trigger. It can contain interactive content such as form controls, menus,\n * and rich descriptions.\n *\n * Compose the compound components to build a popover:\n *\n * - `Popover.Root` \u2014 provides open state and context to all sub-components.\n * - `Popover.Trigger` \u2014 the button that toggles the popup.\n * - `Popover.Popup` \u2014 the floating container
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qBAAoC;
|
|
4
|
+
"sourcesContent": ["import { Popover as _Popover } from '@base-ui/react/popover';\nimport type { RootProps } from './types';\n\n/**\n * An accessible popup anchored to a trigger element.\n *\n * Popover renders ARIA-compliant floating content that appears next to its\n * trigger. It can contain interactive content such as form controls, menus,\n * and rich descriptions.\n *\n * Compose the compound components to build a popover:\n *\n * - `Popover.Root` \u2014 provides open state and context to all sub-components.\n * - `Popover.Trigger` \u2014 the button that toggles the popup.\n * - `Popover.Popup` \u2014 the floating container. Portals by default or via\n * `portal={ <Popover.Portal /> }`, and is positioned by default or via\n * `positioner={ <Popover.Positioner /> }`.\n * - `Popover.Positioner` \u2014 controls placement, alignment, offset, collision\n * behavior, and anchor for the floating content.\n * - `Popover.Arrow` \u2014 an optional arrow pointing toward the anchor.\n * - `Popover.Title` \u2014 **required** heading that labels the popover for\n * accessibility (can be visually hidden).\n * - `Popover.Description` \u2014 optional paragraph linked via `aria-describedby`.\n * - `Popover.Close` \u2014 a button that closes the popover when clicked.\n * **Required** when `modal` is `true` or `'trap-focus'` so that focus\n * can cycle correctly and the user can dismiss the popover.\n *\n * ```jsx\n * <Popover.Root>\n * <Popover.Trigger>Open</Popover.Trigger>\n * <Popover.Popup>\n * <Popover.Arrow />\n * <Popover.Title>Popover title</Popover.Title>\n * <Popover.Description>Popover description</Popover.Description>\n * <Popover.Close>Close</Popover.Close>\n * </Popover.Popup>\n * </Popover.Root>\n * ```\n */\nfunction Root( props: RootProps ) {\n\treturn <_Popover.Root { ...props } />;\n}\n\nexport { Root };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qBAAoC;AAwC5B;AADR,SAAS,KAAM,OAAmB;AACjC,SAAO,4CAAC,eAAAA,QAAS,MAAT,EAAgB,GAAG,OAAQ;AACpC;",
|
|
6
6
|
"names": ["_Popover"]
|
|
7
7
|
}
|