@wordpress/ui 0.11.0 → 0.12.1-next.v.202604201441.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 +24 -0
- package/README.md +4 -4
- package/build/alert-dialog/popup.cjs +4 -4
- package/build/alert-dialog/popup.cjs.map +2 -2
- package/build/collapsible-card/header.cjs +10 -0
- package/build/collapsible-card/header.cjs.map +3 -3
- package/build/dialog/context.cjs +21 -9
- package/build/dialog/context.cjs.map +2 -2
- package/build/dialog/footer.cjs +4 -4
- package/build/dialog/footer.cjs.map +2 -2
- package/build/dialog/header.cjs +4 -4
- package/build/dialog/header.cjs.map +2 -2
- package/build/dialog/popup.cjs +4 -4
- package/build/dialog/popup.cjs.map +2 -2
- package/build/dialog/title.cjs +9 -6
- package/build/dialog/title.cjs.map +2 -2
- package/build/form/primitives/select/item.cjs +3 -3
- package/build/form/primitives/select/item.cjs.map +2 -2
- package/build/form/primitives/select/popup.cjs +3 -3
- package/build/form/primitives/select/popup.cjs.map +2 -2
- package/build/link/link.cjs +8 -18
- package/build/link/link.cjs.map +2 -2
- package/build/link/types.cjs.map +1 -1
- package/build/notice/action-button.cjs +3 -3
- package/build/notice/action-button.cjs.map +2 -2
- package/build/notice/action-link.cjs +8 -7
- package/build/notice/action-link.cjs.map +2 -2
- package/build/notice/actions.cjs +3 -3
- package/build/notice/actions.cjs.map +2 -2
- package/build/notice/close-icon.cjs +3 -3
- package/build/notice/close-icon.cjs.map +2 -2
- package/build/notice/description.cjs +3 -3
- package/build/notice/description.cjs.map +2 -2
- package/build/notice/root.cjs +3 -3
- package/build/notice/root.cjs.map +2 -2
- package/build/notice/title.cjs +3 -3
- package/build/notice/title.cjs.map +2 -2
- package/build/popover/arrow.cjs +4 -4
- package/build/popover/arrow.cjs.map +2 -2
- package/build/popover/context.cjs +21 -9
- package/build/popover/context.cjs.map +2 -2
- package/build/popover/description.cjs +4 -4
- package/build/popover/description.cjs.map +2 -2
- package/build/popover/popup.cjs +8 -5
- package/build/popover/popup.cjs.map +2 -2
- package/build/popover/title.cjs +5 -2
- package/build/popover/title.cjs.map +2 -2
- package/build/tabs/context.cjs +9 -22
- package/build/tabs/context.cjs.map +2 -2
- package/build/tabs/list.cjs +4 -4
- package/build/tabs/list.cjs.map +2 -2
- package/build/tabs/panel.cjs +19 -6
- package/build/tabs/panel.cjs.map +3 -3
- package/build/tabs/tab.cjs +4 -4
- package/build/tabs/tab.cjs.map +2 -2
- package/build/tooltip/popup.cjs +4 -4
- package/build/tooltip/popup.cjs.map +2 -2
- package/build/utils/use-schedule-validation.cjs +59 -0
- package/build/utils/use-schedule-validation.cjs.map +7 -0
- package/build-module/alert-dialog/popup.mjs +4 -4
- package/build-module/alert-dialog/popup.mjs.map +2 -2
- package/build-module/collapsible-card/header.mjs +10 -0
- package/build-module/collapsible-card/header.mjs.map +3 -3
- package/build-module/dialog/context.mjs +21 -9
- package/build-module/dialog/context.mjs.map +2 -2
- package/build-module/dialog/footer.mjs +4 -4
- package/build-module/dialog/footer.mjs.map +2 -2
- package/build-module/dialog/header.mjs +4 -4
- package/build-module/dialog/header.mjs.map +2 -2
- package/build-module/dialog/popup.mjs +4 -4
- package/build-module/dialog/popup.mjs.map +2 -2
- package/build-module/dialog/title.mjs +10 -7
- package/build-module/dialog/title.mjs.map +2 -2
- package/build-module/form/primitives/select/item.mjs +3 -3
- package/build-module/form/primitives/select/item.mjs.map +2 -2
- package/build-module/form/primitives/select/popup.mjs +3 -3
- package/build-module/form/primitives/select/popup.mjs.map +2 -2
- package/build-module/link/link.mjs +8 -18
- package/build-module/link/link.mjs.map +2 -2
- package/build-module/notice/action-button.mjs +3 -3
- package/build-module/notice/action-button.mjs.map +2 -2
- package/build-module/notice/action-link.mjs +8 -7
- package/build-module/notice/action-link.mjs.map +2 -2
- package/build-module/notice/actions.mjs +3 -3
- package/build-module/notice/actions.mjs.map +2 -2
- package/build-module/notice/close-icon.mjs +3 -3
- package/build-module/notice/close-icon.mjs.map +2 -2
- package/build-module/notice/description.mjs +3 -3
- package/build-module/notice/description.mjs.map +2 -2
- package/build-module/notice/root.mjs +3 -3
- package/build-module/notice/root.mjs.map +2 -2
- package/build-module/notice/title.mjs +3 -3
- package/build-module/notice/title.mjs.map +2 -2
- package/build-module/popover/arrow.mjs +4 -4
- package/build-module/popover/arrow.mjs.map +2 -2
- package/build-module/popover/context.mjs +21 -9
- package/build-module/popover/context.mjs.map +2 -2
- package/build-module/popover/description.mjs +4 -4
- package/build-module/popover/description.mjs.map +2 -2
- package/build-module/popover/popup.mjs +8 -5
- package/build-module/popover/popup.mjs.map +2 -2
- package/build-module/popover/title.mjs +6 -3
- package/build-module/popover/title.mjs.map +2 -2
- package/build-module/tabs/context.mjs +11 -24
- package/build-module/tabs/context.mjs.map +2 -2
- package/build-module/tabs/list.mjs +4 -4
- package/build-module/tabs/list.mjs.map +2 -2
- package/build-module/tabs/panel.mjs +19 -6
- package/build-module/tabs/panel.mjs.map +3 -3
- package/build-module/tabs/tab.mjs +4 -4
- package/build-module/tabs/tab.mjs.map +2 -2
- package/build-module/tooltip/popup.mjs +4 -4
- package/build-module/tooltip/popup.mjs.map +2 -2
- package/build-module/utils/use-schedule-validation.mjs +34 -0
- package/build-module/utils/use-schedule-validation.mjs.map +7 -0
- package/build-types/alert-dialog/stories/index.story.d.ts +1 -1
- package/build-types/alert-dialog/stories/index.story.d.ts.map +1 -1
- package/build-types/badge/stories/index.story.d.ts.map +1 -1
- package/build-types/collapsible-card/header.d.ts.map +1 -1
- package/build-types/dialog/context.d.ts +1 -1
- package/build-types/dialog/context.d.ts.map +1 -1
- package/build-types/dialog/title.d.ts.map +1 -1
- package/build-types/empty-state/stories/index.story.d.ts +1 -1
- package/build-types/empty-state/stories/index.story.d.ts.map +1 -1
- package/build-types/form/input-control/stories/index.story.d.ts +1 -1
- package/build-types/form/input-control/stories/index.story.d.ts.map +1 -1
- package/build-types/form/primitives/field/stories/index.story.d.ts +1 -1
- package/build-types/form/primitives/field/stories/index.story.d.ts.map +1 -1
- package/build-types/form/primitives/fieldset/stories/index.story.d.ts +1 -1
- package/build-types/form/primitives/fieldset/stories/index.story.d.ts.map +1 -1
- package/build-types/form/primitives/input/stories/index.story.d.ts +1 -1
- package/build-types/form/primitives/input/stories/index.story.d.ts.map +1 -1
- package/build-types/form/primitives/input-layout/stories/index.story.d.ts +1 -1
- package/build-types/form/primitives/input-layout/stories/index.story.d.ts.map +1 -1
- package/build-types/form/primitives/select/stories/index.story.d.ts +1 -1
- package/build-types/form/primitives/select/stories/index.story.d.ts.map +1 -1
- package/build-types/link/link.d.ts.map +1 -1
- package/build-types/link/types.d.ts +1 -2
- package/build-types/link/types.d.ts.map +1 -1
- package/build-types/notice/action-link.d.ts.map +1 -1
- package/build-types/popover/context.d.ts +1 -1
- package/build-types/popover/context.d.ts.map +1 -1
- package/build-types/popover/popup.d.ts.map +1 -1
- package/build-types/popover/stories/index.story.d.ts +1 -1
- package/build-types/popover/stories/index.story.d.ts.map +1 -1
- package/build-types/popover/title.d.ts.map +1 -1
- package/build-types/stack/stories/index.story.d.ts.map +1 -1
- package/build-types/tabs/context.d.ts.map +1 -1
- package/build-types/tabs/panel.d.ts.map +1 -1
- package/build-types/tabs/stories/index.story.d.ts +1 -1
- package/build-types/tabs/stories/index.story.d.ts.map +1 -1
- package/build-types/text/stories/index.story.d.ts.map +1 -1
- package/build-types/tooltip/stories/index.story.d.ts +1 -1
- package/build-types/tooltip/stories/index.story.d.ts.map +1 -1
- package/build-types/tooltip/stories/usage-guidelines.story.d.ts.map +1 -1
- package/build-types/utils/use-schedule-validation.d.ts +13 -0
- package/build-types/utils/use-schedule-validation.d.ts.map +1 -0
- package/package.json +11 -11
- package/src/alert-dialog/stories/index.story.tsx +2 -2
- package/src/badge/stories/choosing-intent.story.tsx +1 -1
- package/src/badge/stories/index.story.tsx +1 -0
- package/src/collapsible-card/header.tsx +2 -0
- package/src/dialog/context.tsx +28 -15
- package/src/dialog/style.module.css +12 -0
- package/src/dialog/test/index.test.tsx +222 -142
- package/src/dialog/title.tsx +6 -4
- package/src/empty-state/stories/index.story.tsx +2 -1
- package/src/form/input-control/stories/index.story.tsx +4 -1
- package/src/form/primitives/field/stories/index.story.tsx +1 -1
- package/src/form/primitives/fieldset/stories/index.story.tsx +1 -1
- package/src/form/primitives/input/stories/index.story.tsx +2 -1
- package/src/form/primitives/input-layout/stories/index.story.tsx +2 -1
- package/src/form/primitives/select/stories/index.story.tsx +1 -1
- package/src/link/link.tsx +12 -26
- package/src/link/style.module.css +4 -16
- package/src/link/test/index.test.tsx +31 -27
- package/src/link/types.ts +1 -2
- package/src/notice/action-link.tsx +7 -4
- package/src/notice/style.module.css +5 -5
- package/src/popover/context.tsx +28 -12
- package/src/popover/popup.tsx +4 -1
- package/src/popover/stories/index.story.tsx +2 -1
- package/src/popover/style.module.css +23 -1
- package/src/popover/test/index.test.tsx +146 -70
- package/src/popover/title.tsx +6 -3
- package/src/stack/stories/index.story.tsx +1 -0
- package/src/tabs/context.tsx +14 -34
- package/src/tabs/panel.tsx +7 -2
- package/src/tabs/stories/index.story.tsx +2 -1
- package/src/tabs/style.module.css +0 -17
- package/src/tabs/test/index.test.tsx +7 -3
- package/src/text/stories/index.story.tsx +1 -0
- package/src/tooltip/stories/index.story.tsx +2 -1
- package/src/tooltip/stories/usage-guidelines.story.tsx +5 -1
- package/src/tooltip/style.module.css +12 -0
- package/src/utils/css/item-popup.module.css +12 -0
- package/src/utils/use-schedule-validation.ts +45 -0
- package/build/types/css-modules.d.cjs +0 -2
- package/build/types/css-modules.d.cjs.map +0 -7
- package/build/types/react.d.cjs +0 -5
- package/build/types/react.d.cjs.map +0 -7
- package/build-module/types/css-modules.d.mjs +0 -1
- package/build-module/types/css-modules.d.mjs.map +0 -7
- package/build-module/types/react.d.mjs +0 -3
- package/build-module/types/react.d.mjs.map +0 -7
- package/src/types/css-modules.d.ts +0 -4
- package/src/types/react.d.ts +0 -7
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,29 @@
|
|
|
2
2
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
|
+
## 0.12.0-next.0 (2026-04-20)
|
|
6
|
+
|
|
7
|
+
### Documentation
|
|
8
|
+
|
|
9
|
+
- Restructure setup docs into "Within standard WordPress editor screens" and "Elsewhere" for clarity ([#77338](https://github.com/WordPress/gutenberg/pull/77338)).
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
- `Link`: Fix text decoration on the `unstyled` variant when `openInNewTab` is enabled, and simplify new-tab icon markup ([#77420](https://github.com/WordPress/gutenberg/pull/77420)).
|
|
14
|
+
- `Dialog`, `AlertDialog`, `Popover`, `Tooltip`, `Select`: Fix broken focus-trap caused by ThemeProvider's `display: contents` and Base UI's `checkVisibility()` ([#77381](https://github.com/WordPress/gutenberg/pull/77381)).
|
|
15
|
+
- `CollapsibleCard`: Fix missing keyboard focus ring on the header chevron icon when rendered inside wp-admin ([#77468](https://github.com/WordPress/gutenberg/pull/77468)).
|
|
16
|
+
- `Tabs`: Fix missing keyboard focus ring on the panel in Windows High Contrast mode when rendered inside wp-admin ([#77469](https://github.com/WordPress/gutenberg/pull/77469)).
|
|
17
|
+
|
|
18
|
+
### Enhancements
|
|
19
|
+
|
|
20
|
+
- `Dialog`, `Popover`: Upgrade dev-only title validation from mount-only to cleanup-based re-validation, catching conditionally rendered titles ([#77165](https://github.com/WordPress/gutenberg/pull/77165)).
|
|
21
|
+
- `Link`: Honor `openInNewTab` consistently instead of treating hash links as a special case ([#77422](https://github.com/WordPress/gutenberg/pull/77422)).
|
|
22
|
+
|
|
23
|
+
### Internal
|
|
24
|
+
|
|
25
|
+
- Extract shared `useScheduleValidation` hook; refactor `Dialog`, `Popover`, and `Tabs` validation contexts to use it ([#77165](https://github.com/WordPress/gutenberg/pull/77165)).
|
|
26
|
+
- `Tabs`: Wrap two validation timeout waits in `act(...)` to avoid intermittent test warnings ([#77319](https://github.com/WordPress/gutenberg/pull/77319)).
|
|
27
|
+
|
|
5
28
|
## 0.11.0 (2026-04-15)
|
|
6
29
|
|
|
7
30
|
### Breaking Changes
|
|
@@ -38,6 +61,7 @@
|
|
|
38
61
|
- `AlertDialog`: Rewrite internals to use Base UI's `AlertDialog` primitives directly instead of `Dialog` wrappers. Introduces an internal state machine for async confirm flows ([#76937](https://github.com/WordPress/gutenberg/pull/76937)).
|
|
39
62
|
- `Field.Label`, `Fieldset.Legend`, `Field.Details`: Refactor `VisuallyHidden` composition to preserve semantic HTML elements when visually hiding content.
|
|
40
63
|
- `Badge`: Use `Text` component for typography ([#77295](https://github.com/WordPress/gutenberg/pull/77295)).
|
|
64
|
+
- `Notice.ActionLink`: Use `Text` component for typography ([#77332](https://github.com/WordPress/gutenberg/pull/77332)).
|
|
41
65
|
- Update `@base-ui/react` from `1.3.0` to `1.4.0` ([#77308](https://github.com/WordPress/gutenberg/pull/77308)).
|
|
42
66
|
|
|
43
67
|
## 0.10.0 (2026-04-01)
|
package/README.md
CHANGED
|
@@ -28,13 +28,13 @@ npm install @wordpress/ui
|
|
|
28
28
|
|
|
29
29
|
As an implementation of the design system and companion to the `@wordpress/theme` package, these components depend on CSS custom properties defined by the theme package. What you need to set up depends on whether you're building for a WordPress context, and how much of the theming features you want to use.
|
|
30
30
|
|
|
31
|
-
### Within WordPress
|
|
31
|
+
### Within standard WordPress editor screens
|
|
32
32
|
|
|
33
|
-
|
|
33
|
+
In standard WordPress editor screens (such as the post editor or the site editor), stylesheets, isolation styles, and layout styles are managed centrally by Gutenberg. You don't need to add any setup yourself — and you should avoid doing so in this shared context to prevent conflicts.
|
|
34
34
|
|
|
35
|
-
###
|
|
35
|
+
### Elsewhere
|
|
36
36
|
|
|
37
|
-
|
|
37
|
+
The components ship with built-in fallback values for all CSS custom properties, so they work out of the box without any theme setup. For full theming capabilities, it's recommended that you install and load the design tokens stylesheet:
|
|
38
38
|
|
|
39
39
|
```
|
|
40
40
|
npm install @wordpress/theme
|
|
@@ -41,13 +41,13 @@ var import_theme = require("@wordpress/theme");
|
|
|
41
41
|
var import_button = require("../button/index.cjs");
|
|
42
42
|
|
|
43
43
|
// packages/ui/src/dialog/style.module.css
|
|
44
|
-
if (typeof document !== "undefined" && process.env.NODE_ENV !== "test" && !document.head.querySelector("style[data-wp-hash='
|
|
44
|
+
if (typeof document !== "undefined" && process.env.NODE_ENV !== "test" && !document.head.querySelector("style[data-wp-hash='7d3678184b']")) {
|
|
45
45
|
const style = document.createElement("style");
|
|
46
|
-
style.setAttribute("data-wp-hash", "
|
|
47
|
-
style.appendChild(document.createTextNode('@layer wp-ui-utilities, wp-ui-components, wp-ui-compositions, wp-ui-overrides
|
|
46
|
+
style.setAttribute("data-wp-hash", "7d3678184b");
|
|
47
|
+
style.appendChild(document.createTextNode('@layer wp-ui-utilities, wp-ui-components, wp-ui-compositions, wp-ui-overrides;[data-wpds-theme-provider-id]:has(>._8acaa98861620d4d__popup){display:block}@layer wp-ui-components{._074affe4c56b4f2f__backdrop{background-color:#00000059;inset:0;position:fixed;z-index:var(--wp-ui-dialog-z-index,initial);&[data-ending-style],&[data-starting-style]{opacity:0}&[data-open]{opacity:1}@media not (prefers-reduced-motion){transition:opacity .2s ease-out}}._8acaa98861620d4d__popup{background-color:var(--wpds-color-bg-surface-neutral-strong,#fff);border-radius:var(--wpds-border-radius-lg,8px);box-shadow:var(--wpds-elevation-lg,0 5px 15px 0 #00000014,0 15px 27px 0 #00000012,0 30px 36px 0 #0000000a,0 50px 43px 0 #00000005);box-sizing:border-box;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);left:50%;line-height:var(--wpds-typography-line-height-md,24px);max-height:calc(100vh - var(--wpds-dimension-padding-2xl, 24px)*2);min-width:var(--wpds-dimension-surface-width-sm,320px);overflow:auto;padding:var(--wpds-dimension-padding-2xl,24px);position:fixed;top:50%;transform:translate(-50%,-50%);width:calc(100vw - var(--wpds-dimension-padding-2xl, 24px)*2);z-index:var(--wp-ui-dialog-z-index,initial);&[data-ending-style],&[data-starting-style]{opacity:0;transform:translate(-50%,-50%) scale(.9)}@media not (prefers-reduced-motion){transition:opacity .2s cubic-bezier(1,0,.2,1),transform .2s cubic-bezier(1,0,.2,1);&[data-open]{transition:opacity .2s cubic-bezier(.29,0,0,1),transform .2s cubic-bezier(.29,0,0,1)}}@media (min-width:480px){min-width:var(--wpds-dimension-surface-width-md,400px)}&._7acfa67ebf092988__is-small{max-width:var(--wpds-dimension-surface-width-md,400px)}&._1eeeed880cb5769d__is-medium{max-width:var(--wpds-dimension-surface-width-lg,560px)}&._99f900b2267e22d0__is-large{max-width:var(--wpds-dimension-surface-width-2xl,960px)}&.b49f7ff9c06fe387__is-stretch{max-width:none}&.dcd4c2f5036cbf1a__is-full{height:100vh}}._76fb3b28fcbd45fc__header{align-items:center;display:flex;gap:var(--wpds-dimension-gap-sm,8px);margin-bottom:var(--wpds-dimension-gap-lg,16px)}.f636832002af749e__title{--_gcd-heading-margin:0 auto 0 0;margin-inline-end:auto;&:dir(rtl){--_gcd-heading-margin:0 0 0 auto}}._00eeb4f220cddae3__footer{align-items:center;display:flex;gap:var(--wpds-dimension-gap-sm,8px);justify-content:flex-end;margin-top:var(--wpds-dimension-gap-lg,16px);padding-top:var(--wpds-dimension-padding-lg,16px)}}'));
|
|
48
48
|
document.head.appendChild(style);
|
|
49
49
|
}
|
|
50
|
-
var style_default = { "
|
|
50
|
+
var style_default = { "popup": "_8acaa98861620d4d__popup", "backdrop": "_074affe4c56b4f2f__backdrop", "is-small": "_7acfa67ebf092988__is-small", "is-medium": "_1eeeed880cb5769d__is-medium", "is-large": "_99f900b2267e22d0__is-large", "is-stretch": "b49f7ff9c06fe387__is-stretch", "is-full": "dcd4c2f5036cbf1a__is-full", "header": "_76fb3b28fcbd45fc__header", "title": "f636832002af749e__title", "footer": "_00eeb4f220cddae3__footer" };
|
|
51
51
|
|
|
52
52
|
// packages/ui/src/alert-dialog/popup.tsx
|
|
53
53
|
var import_lock_unlock = require("../lock-unlock.cjs");
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/alert-dialog/popup.tsx", "../../src/dialog/style.module.css", "../../src/alert-dialog/style.module.css"],
|
|
4
|
-
"sourcesContent": ["import { AlertDialog as _AlertDialog } from '@base-ui/react/alert-dialog';\nimport clsx from 'clsx';\nimport { forwardRef, useContext } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport {\n\ttype ThemeProvider as ThemeProviderType,\n\tprivateApis as themePrivateApis,\n} from '@wordpress/theme';\n\nimport { Button } from '../button';\nimport dialogStyles from '../dialog/style.module.css';\nimport { unlock } from '../lock-unlock';\nimport { Stack } from '../stack';\nimport { Text } from '../text';\nimport { AlertDialogContext } from './context';\nimport alertDialogStyles from './style.module.css';\nimport type { PopupProps } from './types';\n\nconst ThemeProvider: typeof ThemeProviderType =\n\tunlock( themePrivateApis ).ThemeProvider;\n\nconst Popup = forwardRef< HTMLDivElement, PopupProps >(\n\tfunction AlertDialogPopup(\n\t\t{\n\t\t\tclassName,\n\t\t\tcontainer,\n\t\t\tintent = 'default',\n\t\t\ttitle,\n\t\t\tdescription,\n\t\t\tchildren,\n\t\t\tconfirmButtonText = __( 'OK' ),\n\t\t\tcancelButtonText = __( 'Cancel' ),\n\t\t\t...props\n\t\t},\n\t\tref\n\t) {\n\t\tconst { phase, showSpinner, errorMessage, confirm } =\n\t\t\tuseContext( AlertDialogContext );\n\n\t\tconst confirmClassName =\n\t\t\tintent === 'irreversible'\n\t\t\t\t? alertDialogStyles[ 'irreversible-action' ]\n\t\t\t\t: undefined;\n\n\t\tconst buttonsDisabled = phase !== 'idle' || undefined;\n\n\t\treturn (\n\t\t\t<_AlertDialog.Portal container={ container }>\n\t\t\t\t<_AlertDialog.Backdrop className={ dialogStyles.backdrop } />\n\t\t\t\t<ThemeProvider>\n\t\t\t\t\t<_AlertDialog.Popup\n\t\t\t\t\t\tref={ ref }\n\t\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t\tdialogStyles.popup,\n\t\t\t\t\t\t\tclassName,\n\t\t\t\t\t\t\tdialogStyles[ 'is-medium' ]\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t{ ...props }\n\t\t\t\t\t>\n\t\t\t\t\t\t<Stack\n\t\t\t\t\t\t\tdirection=\"column\"\n\t\t\t\t\t\t\tgap=\"sm\"\n\t\t\t\t\t\t\tclassName={ alertDialogStyles.header }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<Text\n\t\t\t\t\t\t\t\tvariant=\"heading-xl\"\n\t\t\t\t\t\t\t\trender={ <_AlertDialog.Title /> }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ title }\n\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t\t{ description && (\n\t\t\t\t\t\t\t\t<Text\n\t\t\t\t\t\t\t\t\tvariant=\"body-md\"\n\t\t\t\t\t\t\t\t\trender={ <_AlertDialog.Description /> }\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{ description }\n\t\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</Stack>\n\t\t\t\t\t\t{ children }\n\t\t\t\t\t\t<Stack direction=\"column\" gap=\"md\">\n\t\t\t\t\t\t\t<div className={ dialogStyles.footer }>\n\t\t\t\t\t\t\t\t<_AlertDialog.Close\n\t\t\t\t\t\t\t\t\trender={ <Button variant=\"minimal\" /> }\n\t\t\t\t\t\t\t\t\tdisabled={ buttonsDisabled }\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{ cancelButtonText }\n\t\t\t\t\t\t\t\t</_AlertDialog.Close>\n\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\tclassName={ confirmClassName }\n\t\t\t\t\t\t\t\t\tonClick={ confirm }\n\t\t\t\t\t\t\t\t\tloading={ showSpinner || undefined }\n\t\t\t\t\t\t\t\t\tdisabled={ buttonsDisabled }\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{ confirmButtonText }\n\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t{ errorMessage && (\n\t\t\t\t\t\t\t\t<Text\n\t\t\t\t\t\t\t\t\tvariant=\"body-sm\"\n\t\t\t\t\t\t\t\t\tclassName={\n\t\t\t\t\t\t\t\t\t\talertDialogStyles[ 'error-message' ]\n\t\t\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\t{ errorMessage }\n\t\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</Stack>\n\t\t\t\t\t</_AlertDialog.Popup>\n\t\t\t\t</ThemeProvider>\n\t\t\t</_AlertDialog.Portal>\n\t\t);\n\t}\n);\n\nexport { Popup };\n", "if (typeof document !== 'undefined' && process.env.NODE_ENV !== 'test' && !document.head.querySelector(\"style[data-wp-hash='
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,0BAA4C;AAC5C,kBAAiB;AACjB,qBAAuC;AACvC,kBAAmB;AACnB,mBAGO;AAEP,oBAAuB;;;ACTvB,IAAI,OAAO,aAAa,eAAe,QAAQ,IAAI,aAAa,UAAU,CAAC,SAAS,KAAK,cAAc,kCAAkC,GAAG;AAC3I,QAAM,QAAQ,SAAS,cAAc,OAAO;AAC5C,QAAM,aAAa,gBAAgB,YAAY;AAC/C,QAAM,YAAY,SAAS,eAAe,
|
|
4
|
+
"sourcesContent": ["import { AlertDialog as _AlertDialog } from '@base-ui/react/alert-dialog';\nimport clsx from 'clsx';\nimport { forwardRef, useContext } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport {\n\ttype ThemeProvider as ThemeProviderType,\n\tprivateApis as themePrivateApis,\n} from '@wordpress/theme';\n\nimport { Button } from '../button';\nimport dialogStyles from '../dialog/style.module.css';\nimport { unlock } from '../lock-unlock';\nimport { Stack } from '../stack';\nimport { Text } from '../text';\nimport { AlertDialogContext } from './context';\nimport alertDialogStyles from './style.module.css';\nimport type { PopupProps } from './types';\n\nconst ThemeProvider: typeof ThemeProviderType =\n\tunlock( themePrivateApis ).ThemeProvider;\n\nconst Popup = forwardRef< HTMLDivElement, PopupProps >(\n\tfunction AlertDialogPopup(\n\t\t{\n\t\t\tclassName,\n\t\t\tcontainer,\n\t\t\tintent = 'default',\n\t\t\ttitle,\n\t\t\tdescription,\n\t\t\tchildren,\n\t\t\tconfirmButtonText = __( 'OK' ),\n\t\t\tcancelButtonText = __( 'Cancel' ),\n\t\t\t...props\n\t\t},\n\t\tref\n\t) {\n\t\tconst { phase, showSpinner, errorMessage, confirm } =\n\t\t\tuseContext( AlertDialogContext );\n\n\t\tconst confirmClassName =\n\t\t\tintent === 'irreversible'\n\t\t\t\t? alertDialogStyles[ 'irreversible-action' ]\n\t\t\t\t: undefined;\n\n\t\tconst buttonsDisabled = phase !== 'idle' || undefined;\n\n\t\treturn (\n\t\t\t<_AlertDialog.Portal container={ container }>\n\t\t\t\t<_AlertDialog.Backdrop className={ dialogStyles.backdrop } />\n\t\t\t\t<ThemeProvider>\n\t\t\t\t\t<_AlertDialog.Popup\n\t\t\t\t\t\tref={ ref }\n\t\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t\tdialogStyles.popup,\n\t\t\t\t\t\t\tclassName,\n\t\t\t\t\t\t\tdialogStyles[ 'is-medium' ]\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t{ ...props }\n\t\t\t\t\t>\n\t\t\t\t\t\t<Stack\n\t\t\t\t\t\t\tdirection=\"column\"\n\t\t\t\t\t\t\tgap=\"sm\"\n\t\t\t\t\t\t\tclassName={ alertDialogStyles.header }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<Text\n\t\t\t\t\t\t\t\tvariant=\"heading-xl\"\n\t\t\t\t\t\t\t\trender={ <_AlertDialog.Title /> }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ title }\n\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t\t{ description && (\n\t\t\t\t\t\t\t\t<Text\n\t\t\t\t\t\t\t\t\tvariant=\"body-md\"\n\t\t\t\t\t\t\t\t\trender={ <_AlertDialog.Description /> }\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{ description }\n\t\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</Stack>\n\t\t\t\t\t\t{ children }\n\t\t\t\t\t\t<Stack direction=\"column\" gap=\"md\">\n\t\t\t\t\t\t\t<div className={ dialogStyles.footer }>\n\t\t\t\t\t\t\t\t<_AlertDialog.Close\n\t\t\t\t\t\t\t\t\trender={ <Button variant=\"minimal\" /> }\n\t\t\t\t\t\t\t\t\tdisabled={ buttonsDisabled }\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{ cancelButtonText }\n\t\t\t\t\t\t\t\t</_AlertDialog.Close>\n\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\tclassName={ confirmClassName }\n\t\t\t\t\t\t\t\t\tonClick={ confirm }\n\t\t\t\t\t\t\t\t\tloading={ showSpinner || undefined }\n\t\t\t\t\t\t\t\t\tdisabled={ buttonsDisabled }\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{ confirmButtonText }\n\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t{ errorMessage && (\n\t\t\t\t\t\t\t\t<Text\n\t\t\t\t\t\t\t\t\tvariant=\"body-sm\"\n\t\t\t\t\t\t\t\t\tclassName={\n\t\t\t\t\t\t\t\t\t\talertDialogStyles[ 'error-message' ]\n\t\t\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\t{ errorMessage }\n\t\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</Stack>\n\t\t\t\t\t</_AlertDialog.Popup>\n\t\t\t\t</ThemeProvider>\n\t\t\t</_AlertDialog.Portal>\n\t\t);\n\t}\n);\n\nexport { Popup };\n", "if (typeof document !== 'undefined' && process.env.NODE_ENV !== 'test' && !document.head.querySelector(\"style[data-wp-hash='7d3678184b']\")) {\n\tconst style = document.createElement(\"style\");\n\tstyle.setAttribute(\"data-wp-hash\", \"7d3678184b\");\n\tstyle.appendChild(document.createTextNode(\"@layer wp-ui-utilities, wp-ui-components, wp-ui-compositions, wp-ui-overrides;[data-wpds-theme-provider-id]:has(>._8acaa98861620d4d__popup){display:block}@layer wp-ui-components{._074affe4c56b4f2f__backdrop{background-color:#00000059;inset:0;position:fixed;z-index:var(--wp-ui-dialog-z-index,initial);&[data-ending-style],&[data-starting-style]{opacity:0}&[data-open]{opacity:1}@media not (prefers-reduced-motion){transition:opacity .2s ease-out}}._8acaa98861620d4d__popup{background-color:var(--wpds-color-bg-surface-neutral-strong,#fff);border-radius:var(--wpds-border-radius-lg,8px);box-shadow:var(--wpds-elevation-lg,0 5px 15px 0 #00000014,0 15px 27px 0 #00000012,0 30px 36px 0 #0000000a,0 50px 43px 0 #00000005);box-sizing:border-box;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);left:50%;line-height:var(--wpds-typography-line-height-md,24px);max-height:calc(100vh - var(--wpds-dimension-padding-2xl, 24px)*2);min-width:var(--wpds-dimension-surface-width-sm,320px);overflow:auto;padding:var(--wpds-dimension-padding-2xl,24px);position:fixed;top:50%;transform:translate(-50%,-50%);width:calc(100vw - var(--wpds-dimension-padding-2xl, 24px)*2);z-index:var(--wp-ui-dialog-z-index,initial);&[data-ending-style],&[data-starting-style]{opacity:0;transform:translate(-50%,-50%) scale(.9)}@media not (prefers-reduced-motion){transition:opacity .2s cubic-bezier(1,0,.2,1),transform .2s cubic-bezier(1,0,.2,1);&[data-open]{transition:opacity .2s cubic-bezier(.29,0,0,1),transform .2s cubic-bezier(.29,0,0,1)}}@media (min-width:480px){min-width:var(--wpds-dimension-surface-width-md,400px)}&._7acfa67ebf092988__is-small{max-width:var(--wpds-dimension-surface-width-md,400px)}&._1eeeed880cb5769d__is-medium{max-width:var(--wpds-dimension-surface-width-lg,560px)}&._99f900b2267e22d0__is-large{max-width:var(--wpds-dimension-surface-width-2xl,960px)}&.b49f7ff9c06fe387__is-stretch{max-width:none}&.dcd4c2f5036cbf1a__is-full{height:100vh}}._76fb3b28fcbd45fc__header{align-items:center;display:flex;gap:var(--wpds-dimension-gap-sm,8px);margin-bottom:var(--wpds-dimension-gap-lg,16px)}.f636832002af749e__title{--_gcd-heading-margin:0 auto 0 0;margin-inline-end:auto;&:dir(rtl){--_gcd-heading-margin:0 0 0 auto}}._00eeb4f220cddae3__footer{align-items:center;display:flex;gap:var(--wpds-dimension-gap-sm,8px);justify-content:flex-end;margin-top:var(--wpds-dimension-gap-lg,16px);padding-top:var(--wpds-dimension-padding-lg,16px)}}\"));\n\tdocument.head.appendChild(style);\n}\nexport default {\"popup\":\"_8acaa98861620d4d__popup\",\"backdrop\":\"_074affe4c56b4f2f__backdrop\",\"is-small\":\"_7acfa67ebf092988__is-small\",\"is-medium\":\"_1eeeed880cb5769d__is-medium\",\"is-large\":\"_99f900b2267e22d0__is-large\",\"is-stretch\":\"b49f7ff9c06fe387__is-stretch\",\"is-full\":\"dcd4c2f5036cbf1a__is-full\",\"header\":\"_76fb3b28fcbd45fc__header\",\"title\":\"f636832002af749e__title\",\"footer\":\"_00eeb4f220cddae3__footer\"};\n", "if (typeof document !== 'undefined' && process.env.NODE_ENV !== 'test' && !document.head.querySelector(\"style[data-wp-hash='113a8b8edd']\")) {\n\tconst style = document.createElement(\"style\");\n\tstyle.setAttribute(\"data-wp-hash\", \"113a8b8edd\");\n\tstyle.appendChild(document.createTextNode(\"@layer wp-ui-utilities, wp-ui-components, wp-ui-compositions, wp-ui-overrides;@layer wp-ui-components{._837a6eb481252f50__header{margin-bottom:var(--wpds-dimension-gap-lg,16px)}.dbff6618234a2a93__error-message{align-self:flex-end;color:var(--wpds-color-fg-content-error,#470000)}}@layer wp-ui-compositions{._2ddc2fc9155a1dad__irreversible-action{--wp-ui-button-background-color:var(--wpds-color-bg-interactive-error-strong,#cc1818);--wp-ui-button-background-color-active:var(--wpds-color-bg-interactive-error-strong-active,#b90000);--wp-ui-button-foreground-color:var(--wpds-color-fg-interactive-error-strong,#f2efef);--wp-ui-button-foreground-color-active:var(--wpds-color-fg-interactive-error-strong-active,#f2efef)}}\"));\n\tdocument.head.appendChild(style);\n}\nexport default {\"header\":\"_837a6eb481252f50__header\",\"error-message\":\"dbff6618234a2a93__error-message\",\"irreversible-action\":\"_2ddc2fc9155a1dad__irreversible-action\"};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,0BAA4C;AAC5C,kBAAiB;AACjB,qBAAuC;AACvC,kBAAmB;AACnB,mBAGO;AAEP,oBAAuB;;;ACTvB,IAAI,OAAO,aAAa,eAAe,QAAQ,IAAI,aAAa,UAAU,CAAC,SAAS,KAAK,cAAc,kCAAkC,GAAG;AAC3I,QAAM,QAAQ,SAAS,cAAc,OAAO;AAC5C,QAAM,aAAa,gBAAgB,YAAY;AAC/C,QAAM,YAAY,SAAS,eAAe,0kFAAslF,CAAC;AACjoF,WAAS,KAAK,YAAY,KAAK;AAChC;AACA,IAAO,gBAAQ,EAAC,SAAQ,4BAA2B,YAAW,+BAA8B,YAAW,+BAA8B,aAAY,gCAA+B,YAAW,+BAA8B,cAAa,gCAA+B,WAAU,6BAA4B,UAAS,6BAA4B,SAAQ,2BAA0B,UAAS,4BAA2B;;;ADKtZ,yBAAuB;AACvB,mBAAsB;AACtB,kBAAqB;AACrB,qBAAmC;;;AEdnC,IAAI,OAAO,aAAa,eAAe,QAAQ,IAAI,aAAa,UAAU,CAAC,SAAS,KAAK,cAAc,kCAAkC,GAAG;AAC3I,QAAM,QAAQ,SAAS,cAAc,OAAO;AAC5C,QAAM,aAAa,gBAAgB,YAAY;AAC/C,QAAM,YAAY,SAAS,eAAe,itBAAitB,CAAC;AAC5vB,WAAS,KAAK,YAAY,KAAK;AAChC;AACA,IAAOA,iBAAQ,EAAC,UAAS,6BAA4B,iBAAgB,mCAAkC,uBAAsB,yCAAwC;;;AF0CjK;AA9BJ,IAAM,oBACL,2BAAQ,aAAAC,WAAiB,EAAE;AAE5B,IAAM,YAAQ;AAAA,EACb,SAAS,iBACR;AAAA,IACC;AAAA,IACA;AAAA,IACA,SAAS;AAAA,IACT;AAAA,IACA;AAAA,IACA;AAAA,IACA,wBAAoB,gBAAI,IAAK;AAAA,IAC7B,uBAAmB,gBAAI,QAAS;AAAA,IAChC,GAAG;AAAA,EACJ,GACA,KACC;AACD,UAAM,EAAE,OAAO,aAAa,cAAc,QAAQ,QACjD,2BAAY,iCAAmB;AAEhC,UAAM,mBACL,WAAW,iBACRC,eAAmB,qBAAsB,IACzC;AAEJ,UAAM,kBAAkB,UAAU,UAAU;AAE5C,WACC,6CAAC,oBAAAC,YAAa,QAAb,EAAoB,WACpB;AAAA,kDAAC,oBAAAA,YAAa,UAAb,EAAsB,WAAY,cAAa,UAAW;AAAA,MAC3D,4CAAC,iBACA;AAAA,QAAC,oBAAAA,YAAa;AAAA,QAAb;AAAA,UACA;AAAA,UACA,eAAY,YAAAC;AAAA,YACX,cAAa;AAAA,YACb;AAAA,YACA,cAAc,WAAY;AAAA,UAC3B;AAAA,UACE,GAAG;AAAA,UAEL;AAAA;AAAA,cAAC;AAAA;AAAA,gBACA,WAAU;AAAA,gBACV,KAAI;AAAA,gBACJ,WAAYF,eAAkB;AAAA,gBAE9B;AAAA;AAAA,oBAAC;AAAA;AAAA,sBACA,SAAQ;AAAA,sBACR,QAAS,4CAAC,oBAAAC,YAAa,OAAb,EAAmB;AAAA,sBAE3B;AAAA;AAAA,kBACH;AAAA,kBACE,eACD;AAAA,oBAAC;AAAA;AAAA,sBACA,SAAQ;AAAA,sBACR,QAAS,4CAAC,oBAAAA,YAAa,aAAb,EAAyB;AAAA,sBAEjC;AAAA;AAAA,kBACH;AAAA;AAAA;AAAA,YAEF;AAAA,YACE;AAAA,YACF,6CAAC,sBAAM,WAAU,UAAS,KAAI,MAC7B;AAAA,2DAAC,SAAI,WAAY,cAAa,QAC7B;AAAA;AAAA,kBAAC,oBAAAA,YAAa;AAAA,kBAAb;AAAA,oBACA,QAAS,4CAAC,wBAAO,SAAQ,WAAU;AAAA,oBACnC,UAAW;AAAA,oBAET;AAAA;AAAA,gBACH;AAAA,gBACA;AAAA,kBAAC;AAAA;AAAA,oBACA,WAAY;AAAA,oBACZ,SAAU;AAAA,oBACV,SAAU,eAAe;AAAA,oBACzB,UAAW;AAAA,oBAET;AAAA;AAAA,gBACH;AAAA,iBACD;AAAA,cACE,gBACD;AAAA,gBAAC;AAAA;AAAA,kBACA,SAAQ;AAAA,kBACR,WACCD,eAAmB,eAAgB;AAAA,kBAGlC;AAAA;AAAA,cACH;AAAA,eAEF;AAAA;AAAA;AAAA,MACD,GACD;AAAA,OACD;AAAA,EAEF;AACD;",
|
|
6
6
|
"names": ["style_default", "themePrivateApis", "style_default", "_AlertDialog", "clsx"]
|
|
7
7
|
}
|
|
@@ -49,6 +49,15 @@ if (typeof document !== "undefined" && process.env.NODE_ENV !== "test" && !docum
|
|
|
49
49
|
}
|
|
50
50
|
var style_default = { "header-content": "cab17c7a373cb60d__header-content", "header-trigger-positioner": "dd89d27c4f15912d__header-trigger-positioner", "header-trigger-wrapper": "bcfab5f2448bafef__header-trigger-wrapper", "header-trigger": "_3106f8d2b0330faa__header-trigger", "header": "_5d2dfcb4085c6d0f__header", "content": "e34cf37ccd0d81e0__content", "content-inner": "_41bfdbf7b6c087c2__content-inner" };
|
|
51
51
|
|
|
52
|
+
// packages/ui/src/utils/css/global-css-defense.module.css
|
|
53
|
+
if (typeof document !== "undefined" && process.env.NODE_ENV !== "test" && !document.head.querySelector("style[data-wp-hash='1fb29d3a3c']")) {
|
|
54
|
+
const style = document.createElement("style");
|
|
55
|
+
style.setAttribute("data-wp-hash", "1fb29d3a3c");
|
|
56
|
+
style.appendChild(document.createTextNode("._6defc79820e382c6__button{box-sizing:var(--_gcd-button-box-sizing,border-box);font-family:var(--_gcd-button-font-family,inherit);font-size:var(--_gcd-button-font-size,inherit);font-weight:var(--_gcd-button-font-weight,inherit)}.d2cff2e5dea83bd1__input{box-sizing:var(--_gcd-input-box-sizing,border-box);font-family:var(--_gcd-input-font-family,inherit);font-size:var(--_gcd-input-font-size,inherit);font-weight:var(--_gcd-input-font-weight,inherit);margin:var(--_gcd-input-margin,0);&:is(textarea,[type=text],[type=password],[type=color],[type=date],[type=datetime],[type=datetime-local],[type=email],[type=month],[type=number],[type=search],[type=tel],[type=time],[type=url],[type=week]){background-color:var(--_gcd-input-background-color,#0000);border:var(--_gcd-input-border,none);border-radius:var(--_gcd-input-border-radius,0);box-shadow:var(--_gcd-input-box-shadow,0 0 0 #0000);color:var(--_gcd-input-color,var(--wpds-color-fg-interactive-neutral,#1e1e1e));&:focus{border-color:var(--_gcd-input-border-color-focus,var(--wp-admin-theme-color));box-shadow:var(--_gcd-input-box-shadow-focus,none);outline:var(--_gcd-input-outline-focus,none)}&:disabled{background:var(--_gcd-input-background-disabled,#0000);border-color:var(--_gcd-input-border-color-disabled,#0000);box-shadow:var(--_gcd-input-box-shadow-disabled,none);color:var(--_gcd-input-color-disabled,var(--wpds-color-fg-interactive-neutral-disabled,#8d8d8d))}&::placeholder{color:var(--_gcd-input-placeholder-color,var(--wpds-color-fg-interactive-neutral-disabled,#8d8d8d))}}&:is(textarea,[type=text],[type=password],[type=date],[type=datetime],[type=datetime-local],[type=email],[type=month],[type=number],[type=search],[type=tel],[type=time],[type=url],[type=week]){line-height:var(--_gcd-input-line-height,inherit);min-height:var(--_gcd-input-min-height,auto);padding:var(--_gcd-input-padding,0)}}._547d86373d02e108__textarea{box-sizing:var(--_gcd-textarea-box-sizing,border-box);overflow:var(--_gcd-textarea-overflow,auto);resize:var(--_gcd-textarea-resize,block)}._8c15fd0ed9f28ba4__div{outline:var(--_gcd-div-outline,0 solid #0000)}p._43cec3e1eec1066d__p{font-size:var(--_gcd-p-font-size,13px);line-height:var(--_gcd-p-line-height,1.5);margin:var(--_gcd-p-margin,0)}:is(h1,h2,h3,h4,h5,h6).e97669c6d9a38497__heading{color:var(--_gcd-heading-color,var(--wpds-color-fg-content-neutral,#1e1e1e));font-size:var(--_gcd-heading-font-size,inherit);font-weight:var(--_gcd-heading-font-weight,var(--wpds-typography-font-weight-medium,499));margin:var(--_gcd-heading-margin,0)}._2c0831b0499dbd6e__a,._2c0831b0499dbd6e__a:is(:hover,:focus,:active){border-radius:var(--_gcd-a-border-radius,0);box-shadow:var(--_gcd-a-box-shadow,none);color:var(--_gcd-a-color,inherit);outline:var(--_gcd-a-outline,0 solid #0000);transition:var(--_gcd-a-transition,none)}"));
|
|
57
|
+
document.head.appendChild(style);
|
|
58
|
+
}
|
|
59
|
+
var global_css_defense_default = { "button": "_6defc79820e382c6__button", "input": "d2cff2e5dea83bd1__input", "textarea": "_547d86373d02e108__textarea", "div": "_8c15fd0ed9f28ba4__div", "p": "_43cec3e1eec1066d__p", "heading": "e97669c6d9a38497__heading", "a": "_2c0831b0499dbd6e__a" };
|
|
60
|
+
|
|
52
61
|
// packages/ui/src/utils/css/focus.module.css
|
|
53
62
|
if (typeof document !== "undefined" && process.env.NODE_ENV !== "test" && !document.head.querySelector("style[data-wp-hash='2a5ab8f3a7']")) {
|
|
54
63
|
const style = document.createElement("style");
|
|
@@ -95,6 +104,7 @@ var Header2 = (0, import_element.forwardRef)(
|
|
|
95
104
|
{
|
|
96
105
|
className: (0, import_clsx.default)(
|
|
97
106
|
style_default["header-trigger-wrapper"],
|
|
107
|
+
global_css_defense_default.div,
|
|
98
108
|
// While the interactive trigger element is the whole header,
|
|
99
109
|
// the focus ring will be displayed only on the icon to visually
|
|
100
110
|
// emulate it being the button.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../src/collapsible-card/header.tsx", "../../src/collapsible-card/style.module.css", "../../src/utils/css/focus.module.css"],
|
|
4
|
-
"sourcesContent": ["import clsx from 'clsx';\nimport { forwardRef, useMemo, useState } from '@wordpress/element';\nimport { chevronDown } from '@wordpress/icons';\nimport * as Card from '../card';\nimport * as Collapsible from '../collapsible';\nimport { Icon } from '../icon';\nimport styles from './style.module.css';\nimport focusStyles from '../utils/css/focus.module.css';\nimport { HeaderDescriptionIdContext } from './context';\nimport type { HeaderProps } from './types';\n\n/**\n * The header of a collapsible card. Always visible, and acts as the\n * toggle trigger \u2014 clicking anywhere on it expands or collapses the\n * card's content.\n *\n * Avoid placing interactive elements (buttons, links, inputs) inside the\n * header, since the entire area is clickable and their events will bubble\n * to trigger the collapse toggle.\n */\nexport const Header = forwardRef< HTMLDivElement, HeaderProps >(\n\tfunction CollapsibleCardHeader(\n\t\t{ children, className, render, ...restProps },\n\t\tref\n\t) {\n\t\tconst [ descriptionId, setDescriptionId ] = useState< string >();\n\n\t\tconst contextValue = useMemo(\n\t\t\t() => ( { setDescriptionId } ),\n\t\t\t[ setDescriptionId ]\n\t\t);\n\n\t\treturn (\n\t\t\t<HeaderDescriptionIdContext.Provider value={ contextValue }>\n\t\t\t\t<Collapsible.Trigger\n\t\t\t\t\tclassName={ clsx( styles.header, className ) }\n\t\t\t\t\trender={\n\t\t\t\t\t\t<Card.Header\n\t\t\t\t\t\t\tref={ ref }\n\t\t\t\t\t\t\trender={ render }\n\t\t\t\t\t\t\t{ ...restProps }\n\t\t\t\t\t\t/>\n\t\t\t\t\t}\n\t\t\t\t\tnativeButton={ false }\n\t\t\t\t\taria-describedby={ descriptionId }\n\t\t\t\t>\n\t\t\t\t\t<div className={ styles[ 'header-content' ] }>\n\t\t\t\t\t\t{ children }\n\t\t\t\t\t</div>\n\t\t\t\t\t<div\n\t\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t\tstyles[ 'header-trigger-positioner' ]\n\t\t\t\t\t\t) }\n\t\t\t\t\t>\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t\t\tstyles[ 'header-trigger-wrapper' ],\n\t\t\t\t\t\t\t\t// While the interactive trigger element is the whole header,\n\t\t\t\t\t\t\t\t// the focus ring will be displayed only on the icon to visually\n\t\t\t\t\t\t\t\t// emulate it being the button.\n\t\t\t\t\t\t\t\tfocusStyles[\n\t\t\t\t\t\t\t\t\t'outset-ring--focus-parent-visible'\n\t\t\t\t\t\t\t\t]\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<Icon\n\t\t\t\t\t\t\t\ticon={ chevronDown }\n\t\t\t\t\t\t\t\tclassName={ styles[ 'header-trigger' ] }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</Collapsible.Trigger>\n\t\t\t</HeaderDescriptionIdContext.Provider>\n\t\t);\n\t}\n);\n", "if (typeof document !== 'undefined' && process.env.NODE_ENV !== 'test' && !document.head.querySelector(\"style[data-wp-hash='718ddb3557']\")) {\n\tconst style = document.createElement(\"style\");\n\tstyle.setAttribute(\"data-wp-hash\", \"718ddb3557\");\n\tstyle.appendChild(document.createTextNode(\"@layer wp-ui-utilities, wp-ui-components, wp-ui-compositions, wp-ui-overrides;@layer wp-ui-components{.cab17c7a373cb60d__header-content{flex:1;min-width:0}.dd89d27c4f15912d__header-trigger-positioner{align-self:center;flex-shrink:0;max-height:0;overflow:visible}.bcfab5f2448bafef__header-trigger-wrapper{border-radius:var(--wpds-border-radius-sm,2px);display:flex;translate:0 -50%}._3106f8d2b0330faa__header-trigger{@media not (prefers-reduced-motion){transition:rotate .15s ease-out}}._5d2dfcb4085c6d0f__header[data-panel-open] ._3106f8d2b0330faa__header-trigger{rotate:180deg}._5d2dfcb4085c6d0f__header[data-disabled] ._3106f8d2b0330faa__header-trigger{color:var(--wpds-color-fg-interactive-neutral-disabled,#8d8d8d)}.e34cf37ccd0d81e0__content{height:var(--collapsible-panel-height);margin-block-start:var(--wp-ui-card-header-content-margin);overflow:hidden;&[hidden]:not([hidden=until-found]){display:none}&[data-ending-style],&[data-starting-style]{height:0}@media not (prefers-reduced-motion){transition:all .15s ease-out}}}@layer wp-ui-compositions{._41bfdbf7b6c087c2__content-inner{padding-block-start:0}._5d2dfcb4085c6d0f__header{align-items:stretch;display:flex;flex-direction:row;gap:var(--wpds-dimension-gap-sm,8px);outline:none;&:not([data-disabled]){cursor:var(--wpds-cursor-control,pointer)}}}\"));\n\tdocument.head.appendChild(style);\n}\nexport default {\"header-content\":\"cab17c7a373cb60d__header-content\",\"header-trigger-positioner\":\"dd89d27c4f15912d__header-trigger-positioner\",\"header-trigger-wrapper\":\"bcfab5f2448bafef__header-trigger-wrapper\",\"header-trigger\":\"_3106f8d2b0330faa__header-trigger\",\"header\":\"_5d2dfcb4085c6d0f__header\",\"content\":\"e34cf37ccd0d81e0__content\",\"content-inner\":\"_41bfdbf7b6c087c2__content-inner\"};\n", "if (typeof document !== 'undefined' && process.env.NODE_ENV !== 'test' && !document.head.querySelector(\"style[data-wp-hash='2a5ab8f3a7']\")) {\n\tconst style = document.createElement(\"style\");\n\tstyle.setAttribute(\"data-wp-hash\", \"2a5ab8f3a7\");\n\tstyle.appendChild(document.createTextNode(\"@layer wp-ui-utilities, wp-ui-components, wp-ui-compositions, wp-ui-overrides;@layer wp-ui-utilities{._08e8a2e44959f892__outset-ring--focus,._970d04df7376df67__outset-ring--focus-within-except-active,.c5cb3ee4bddaa8e4__outset-ring--focus-within-visible,.cd83dfc2126a0846__outset-ring--focus-within,.d0541bc9dd9dc7b6__outset-ring--focus-visible,.e25b2bdd7aa21721__outset-ring--focus-except-active,.ecadb9e080e2dfa5__outset-ring--focus-parent-visible{@media not (prefers-reduced-motion){--_gcd-a-transition:outline 0.1s ease-out;transition:outline .1s ease-out}outline:0 solid #0000;outline-offset:1px}._08e8a2e44959f892__outset-ring--focus:focus,._970d04df7376df67__outset-ring--focus-within-except-active:focus-within:not(:has(:active)),.c5cb3ee4bddaa8e4__outset-ring--focus-within-visible:focus-within:has(:focus-visible),.cd83dfc2126a0846__outset-ring--focus-within:focus-within,.d0541bc9dd9dc7b6__outset-ring--focus-visible:focus-visible,.e25b2bdd7aa21721__outset-ring--focus-except-active:focus:not(:active),:focus-visible .ecadb9e080e2dfa5__outset-ring--focus-parent-visible{--_gcd-a-outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--wpds-color-stroke-focus-brand,var(--wp-admin-theme-color,#3858e9));--_gcd-div-outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--wpds-color-stroke-focus-brand,var(--wp-admin-theme-color,#3858e9));outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--wpds-color-stroke-focus-brand,var(--wp-admin-theme-color,#3858e9))}}\"));\n\tdocument.head.appendChild(style);\n}\nexport default {\"outset-ring--focus\":\"_08e8a2e44959f892__outset-ring--focus\",\"outset-ring--focus-except-active\":\"e25b2bdd7aa21721__outset-ring--focus-except-active\",\"outset-ring--focus-visible\":\"d0541bc9dd9dc7b6__outset-ring--focus-visible\",\"outset-ring--focus-within\":\"cd83dfc2126a0846__outset-ring--focus-within\",\"outset-ring--focus-within-except-active\":\"_970d04df7376df67__outset-ring--focus-within-except-active\",\"outset-ring--focus-within-visible\":\"c5cb3ee4bddaa8e4__outset-ring--focus-within-visible\",\"outset-ring--focus-parent-visible\":\"ecadb9e080e2dfa5__outset-ring--focus-parent-visible\"};\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA,gBAAAA;AAAA;AAAA;AAAA,kBAAiB;AACjB,qBAA8C;AAC9C,mBAA4B;AAC5B,WAAsB;AACtB,kBAA6B;AAC7B,kBAAqB;;;ACLrB,IAAI,OAAO,aAAa,eAAe,QAAQ,IAAI,aAAa,UAAU,CAAC,SAAS,KAAK,cAAc,kCAAkC,GAAG;AAC3I,QAAM,QAAQ,SAAS,cAAc,OAAO;AAC5C,QAAM,aAAa,gBAAgB,YAAY;AAC/C,QAAM,YAAY,SAAS,eAAe,6xCAA6xC,CAAC;AACx0C,WAAS,KAAK,YAAY,KAAK;AAChC;AACA,IAAO,gBAAQ,EAAC,kBAAiB,oCAAmC,6BAA4B,+CAA8C,0BAAyB,4CAA2C,kBAAiB,qCAAoC,UAAS,6BAA4B,WAAU,6BAA4B,iBAAgB,mCAAkC;;;ACNpY,IAAI,OAAO,aAAa,eAAe,QAAQ,IAAI,aAAa,UAAU,CAAC,SAAS,KAAK,cAAc,kCAAkC,GAAG;AAC3I,QAAM,QAAQ,SAAS,cAAc,OAAO;AAC5C,QAAM,aAAa,gBAAgB,YAAY;AAC/C,QAAM,YAAY,SAAS,eAAe,siDAAsiD,CAAC;AACjlD,WAAS,KAAK,YAAY,KAAK;AAChC;AACA,IAAO,gBAAQ,EAAC,sBAAqB,yCAAwC,oCAAmC,sDAAqD,8BAA6B,gDAA+C,6BAA4B,+CAA8C,2CAA0C,8DAA6D,qCAAoC,uDAAsD,qCAAoC,sDAAqD;;;
|
|
3
|
+
"sources": ["../../src/collapsible-card/header.tsx", "../../src/collapsible-card/style.module.css", "../../src/utils/css/global-css-defense.module.css", "../../src/utils/css/focus.module.css"],
|
|
4
|
+
"sourcesContent": ["import clsx from 'clsx';\nimport { forwardRef, useMemo, useState } from '@wordpress/element';\nimport { chevronDown } from '@wordpress/icons';\nimport * as Card from '../card';\nimport * as Collapsible from '../collapsible';\nimport { Icon } from '../icon';\nimport styles from './style.module.css';\nimport defenseStyles from '../utils/css/global-css-defense.module.css';\nimport focusStyles from '../utils/css/focus.module.css';\nimport { HeaderDescriptionIdContext } from './context';\nimport type { HeaderProps } from './types';\n\n/**\n * The header of a collapsible card. Always visible, and acts as the\n * toggle trigger \u2014 clicking anywhere on it expands or collapses the\n * card's content.\n *\n * Avoid placing interactive elements (buttons, links, inputs) inside the\n * header, since the entire area is clickable and their events will bubble\n * to trigger the collapse toggle.\n */\nexport const Header = forwardRef< HTMLDivElement, HeaderProps >(\n\tfunction CollapsibleCardHeader(\n\t\t{ children, className, render, ...restProps },\n\t\tref\n\t) {\n\t\tconst [ descriptionId, setDescriptionId ] = useState< string >();\n\n\t\tconst contextValue = useMemo(\n\t\t\t() => ( { setDescriptionId } ),\n\t\t\t[ setDescriptionId ]\n\t\t);\n\n\t\treturn (\n\t\t\t<HeaderDescriptionIdContext.Provider value={ contextValue }>\n\t\t\t\t<Collapsible.Trigger\n\t\t\t\t\tclassName={ clsx( styles.header, className ) }\n\t\t\t\t\trender={\n\t\t\t\t\t\t<Card.Header\n\t\t\t\t\t\t\tref={ ref }\n\t\t\t\t\t\t\trender={ render }\n\t\t\t\t\t\t\t{ ...restProps }\n\t\t\t\t\t\t/>\n\t\t\t\t\t}\n\t\t\t\t\tnativeButton={ false }\n\t\t\t\t\taria-describedby={ descriptionId }\n\t\t\t\t>\n\t\t\t\t\t<div className={ styles[ 'header-content' ] }>\n\t\t\t\t\t\t{ children }\n\t\t\t\t\t</div>\n\t\t\t\t\t<div\n\t\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t\tstyles[ 'header-trigger-positioner' ]\n\t\t\t\t\t\t) }\n\t\t\t\t\t>\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t\t\tstyles[ 'header-trigger-wrapper' ],\n\t\t\t\t\t\t\t\tdefenseStyles.div,\n\t\t\t\t\t\t\t\t// While the interactive trigger element is the whole header,\n\t\t\t\t\t\t\t\t// the focus ring will be displayed only on the icon to visually\n\t\t\t\t\t\t\t\t// emulate it being the button.\n\t\t\t\t\t\t\t\tfocusStyles[\n\t\t\t\t\t\t\t\t\t'outset-ring--focus-parent-visible'\n\t\t\t\t\t\t\t\t]\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<Icon\n\t\t\t\t\t\t\t\ticon={ chevronDown }\n\t\t\t\t\t\t\t\tclassName={ styles[ 'header-trigger' ] }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</Collapsible.Trigger>\n\t\t\t</HeaderDescriptionIdContext.Provider>\n\t\t);\n\t}\n);\n", "if (typeof document !== 'undefined' && process.env.NODE_ENV !== 'test' && !document.head.querySelector(\"style[data-wp-hash='718ddb3557']\")) {\n\tconst style = document.createElement(\"style\");\n\tstyle.setAttribute(\"data-wp-hash\", \"718ddb3557\");\n\tstyle.appendChild(document.createTextNode(\"@layer wp-ui-utilities, wp-ui-components, wp-ui-compositions, wp-ui-overrides;@layer wp-ui-components{.cab17c7a373cb60d__header-content{flex:1;min-width:0}.dd89d27c4f15912d__header-trigger-positioner{align-self:center;flex-shrink:0;max-height:0;overflow:visible}.bcfab5f2448bafef__header-trigger-wrapper{border-radius:var(--wpds-border-radius-sm,2px);display:flex;translate:0 -50%}._3106f8d2b0330faa__header-trigger{@media not (prefers-reduced-motion){transition:rotate .15s ease-out}}._5d2dfcb4085c6d0f__header[data-panel-open] ._3106f8d2b0330faa__header-trigger{rotate:180deg}._5d2dfcb4085c6d0f__header[data-disabled] ._3106f8d2b0330faa__header-trigger{color:var(--wpds-color-fg-interactive-neutral-disabled,#8d8d8d)}.e34cf37ccd0d81e0__content{height:var(--collapsible-panel-height);margin-block-start:var(--wp-ui-card-header-content-margin);overflow:hidden;&[hidden]:not([hidden=until-found]){display:none}&[data-ending-style],&[data-starting-style]{height:0}@media not (prefers-reduced-motion){transition:all .15s ease-out}}}@layer wp-ui-compositions{._41bfdbf7b6c087c2__content-inner{padding-block-start:0}._5d2dfcb4085c6d0f__header{align-items:stretch;display:flex;flex-direction:row;gap:var(--wpds-dimension-gap-sm,8px);outline:none;&:not([data-disabled]){cursor:var(--wpds-cursor-control,pointer)}}}\"));\n\tdocument.head.appendChild(style);\n}\nexport default {\"header-content\":\"cab17c7a373cb60d__header-content\",\"header-trigger-positioner\":\"dd89d27c4f15912d__header-trigger-positioner\",\"header-trigger-wrapper\":\"bcfab5f2448bafef__header-trigger-wrapper\",\"header-trigger\":\"_3106f8d2b0330faa__header-trigger\",\"header\":\"_5d2dfcb4085c6d0f__header\",\"content\":\"e34cf37ccd0d81e0__content\",\"content-inner\":\"_41bfdbf7b6c087c2__content-inner\"};\n", "if (typeof document !== 'undefined' && process.env.NODE_ENV !== 'test' && !document.head.querySelector(\"style[data-wp-hash='1fb29d3a3c']\")) {\n\tconst style = document.createElement(\"style\");\n\tstyle.setAttribute(\"data-wp-hash\", \"1fb29d3a3c\");\n\tstyle.appendChild(document.createTextNode(\"._6defc79820e382c6__button{box-sizing:var(--_gcd-button-box-sizing,border-box);font-family:var(--_gcd-button-font-family,inherit);font-size:var(--_gcd-button-font-size,inherit);font-weight:var(--_gcd-button-font-weight,inherit)}.d2cff2e5dea83bd1__input{box-sizing:var(--_gcd-input-box-sizing,border-box);font-family:var(--_gcd-input-font-family,inherit);font-size:var(--_gcd-input-font-size,inherit);font-weight:var(--_gcd-input-font-weight,inherit);margin:var(--_gcd-input-margin,0);&:is(textarea,[type=text],[type=password],[type=color],[type=date],[type=datetime],[type=datetime-local],[type=email],[type=month],[type=number],[type=search],[type=tel],[type=time],[type=url],[type=week]){background-color:var(--_gcd-input-background-color,#0000);border:var(--_gcd-input-border,none);border-radius:var(--_gcd-input-border-radius,0);box-shadow:var(--_gcd-input-box-shadow,0 0 0 #0000);color:var(--_gcd-input-color,var(--wpds-color-fg-interactive-neutral,#1e1e1e));&:focus{border-color:var(--_gcd-input-border-color-focus,var(--wp-admin-theme-color));box-shadow:var(--_gcd-input-box-shadow-focus,none);outline:var(--_gcd-input-outline-focus,none)}&:disabled{background:var(--_gcd-input-background-disabled,#0000);border-color:var(--_gcd-input-border-color-disabled,#0000);box-shadow:var(--_gcd-input-box-shadow-disabled,none);color:var(--_gcd-input-color-disabled,var(--wpds-color-fg-interactive-neutral-disabled,#8d8d8d))}&::placeholder{color:var(--_gcd-input-placeholder-color,var(--wpds-color-fg-interactive-neutral-disabled,#8d8d8d))}}&:is(textarea,[type=text],[type=password],[type=date],[type=datetime],[type=datetime-local],[type=email],[type=month],[type=number],[type=search],[type=tel],[type=time],[type=url],[type=week]){line-height:var(--_gcd-input-line-height,inherit);min-height:var(--_gcd-input-min-height,auto);padding:var(--_gcd-input-padding,0)}}._547d86373d02e108__textarea{box-sizing:var(--_gcd-textarea-box-sizing,border-box);overflow:var(--_gcd-textarea-overflow,auto);resize:var(--_gcd-textarea-resize,block)}._8c15fd0ed9f28ba4__div{outline:var(--_gcd-div-outline,0 solid #0000)}p._43cec3e1eec1066d__p{font-size:var(--_gcd-p-font-size,13px);line-height:var(--_gcd-p-line-height,1.5);margin:var(--_gcd-p-margin,0)}:is(h1,h2,h3,h4,h5,h6).e97669c6d9a38497__heading{color:var(--_gcd-heading-color,var(--wpds-color-fg-content-neutral,#1e1e1e));font-size:var(--_gcd-heading-font-size,inherit);font-weight:var(--_gcd-heading-font-weight,var(--wpds-typography-font-weight-medium,499));margin:var(--_gcd-heading-margin,0)}._2c0831b0499dbd6e__a,._2c0831b0499dbd6e__a:is(:hover,:focus,:active){border-radius:var(--_gcd-a-border-radius,0);box-shadow:var(--_gcd-a-box-shadow,none);color:var(--_gcd-a-color,inherit);outline:var(--_gcd-a-outline,0 solid #0000);transition:var(--_gcd-a-transition,none)}\"));\n\tdocument.head.appendChild(style);\n}\nexport default {\"button\":\"_6defc79820e382c6__button\",\"input\":\"d2cff2e5dea83bd1__input\",\"textarea\":\"_547d86373d02e108__textarea\",\"div\":\"_8c15fd0ed9f28ba4__div\",\"p\":\"_43cec3e1eec1066d__p\",\"heading\":\"e97669c6d9a38497__heading\",\"a\":\"_2c0831b0499dbd6e__a\"};\n", "if (typeof document !== 'undefined' && process.env.NODE_ENV !== 'test' && !document.head.querySelector(\"style[data-wp-hash='2a5ab8f3a7']\")) {\n\tconst style = document.createElement(\"style\");\n\tstyle.setAttribute(\"data-wp-hash\", \"2a5ab8f3a7\");\n\tstyle.appendChild(document.createTextNode(\"@layer wp-ui-utilities, wp-ui-components, wp-ui-compositions, wp-ui-overrides;@layer wp-ui-utilities{._08e8a2e44959f892__outset-ring--focus,._970d04df7376df67__outset-ring--focus-within-except-active,.c5cb3ee4bddaa8e4__outset-ring--focus-within-visible,.cd83dfc2126a0846__outset-ring--focus-within,.d0541bc9dd9dc7b6__outset-ring--focus-visible,.e25b2bdd7aa21721__outset-ring--focus-except-active,.ecadb9e080e2dfa5__outset-ring--focus-parent-visible{@media not (prefers-reduced-motion){--_gcd-a-transition:outline 0.1s ease-out;transition:outline .1s ease-out}outline:0 solid #0000;outline-offset:1px}._08e8a2e44959f892__outset-ring--focus:focus,._970d04df7376df67__outset-ring--focus-within-except-active:focus-within:not(:has(:active)),.c5cb3ee4bddaa8e4__outset-ring--focus-within-visible:focus-within:has(:focus-visible),.cd83dfc2126a0846__outset-ring--focus-within:focus-within,.d0541bc9dd9dc7b6__outset-ring--focus-visible:focus-visible,.e25b2bdd7aa21721__outset-ring--focus-except-active:focus:not(:active),:focus-visible .ecadb9e080e2dfa5__outset-ring--focus-parent-visible{--_gcd-a-outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--wpds-color-stroke-focus-brand,var(--wp-admin-theme-color,#3858e9));--_gcd-div-outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--wpds-color-stroke-focus-brand,var(--wp-admin-theme-color,#3858e9));outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--wpds-color-stroke-focus-brand,var(--wp-admin-theme-color,#3858e9))}}\"));\n\tdocument.head.appendChild(style);\n}\nexport default {\"outset-ring--focus\":\"_08e8a2e44959f892__outset-ring--focus\",\"outset-ring--focus-except-active\":\"e25b2bdd7aa21721__outset-ring--focus-except-active\",\"outset-ring--focus-visible\":\"d0541bc9dd9dc7b6__outset-ring--focus-visible\",\"outset-ring--focus-within\":\"cd83dfc2126a0846__outset-ring--focus-within\",\"outset-ring--focus-within-except-active\":\"_970d04df7376df67__outset-ring--focus-within-except-active\",\"outset-ring--focus-within-visible\":\"c5cb3ee4bddaa8e4__outset-ring--focus-within-visible\",\"outset-ring--focus-parent-visible\":\"ecadb9e080e2dfa5__outset-ring--focus-parent-visible\"};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA,gBAAAA;AAAA;AAAA;AAAA,kBAAiB;AACjB,qBAA8C;AAC9C,mBAA4B;AAC5B,WAAsB;AACtB,kBAA6B;AAC7B,kBAAqB;;;ACLrB,IAAI,OAAO,aAAa,eAAe,QAAQ,IAAI,aAAa,UAAU,CAAC,SAAS,KAAK,cAAc,kCAAkC,GAAG;AAC3I,QAAM,QAAQ,SAAS,cAAc,OAAO;AAC5C,QAAM,aAAa,gBAAgB,YAAY;AAC/C,QAAM,YAAY,SAAS,eAAe,6xCAA6xC,CAAC;AACx0C,WAAS,KAAK,YAAY,KAAK;AAChC;AACA,IAAO,gBAAQ,EAAC,kBAAiB,oCAAmC,6BAA4B,+CAA8C,0BAAyB,4CAA2C,kBAAiB,qCAAoC,UAAS,6BAA4B,WAAU,6BAA4B,iBAAgB,mCAAkC;;;ACNpY,IAAI,OAAO,aAAa,eAAe,QAAQ,IAAI,aAAa,UAAU,CAAC,SAAS,KAAK,cAAc,kCAAkC,GAAG;AAC3I,QAAM,QAAQ,SAAS,cAAc,OAAO;AAC5C,QAAM,aAAa,gBAAgB,YAAY;AAC/C,QAAM,YAAY,SAAS,eAAe,2vFAA2vF,CAAC;AACtyF,WAAS,KAAK,YAAY,KAAK;AAChC;AACA,IAAO,6BAAQ,EAAC,UAAS,6BAA4B,SAAQ,2BAA0B,YAAW,+BAA8B,OAAM,0BAAyB,KAAI,wBAAuB,WAAU,6BAA4B,KAAI,uBAAsB;;;ACN1P,IAAI,OAAO,aAAa,eAAe,QAAQ,IAAI,aAAa,UAAU,CAAC,SAAS,KAAK,cAAc,kCAAkC,GAAG;AAC3I,QAAM,QAAQ,SAAS,cAAc,OAAO;AAC5C,QAAM,aAAa,gBAAgB,YAAY;AAC/C,QAAM,YAAY,SAAS,eAAe,siDAAsiD,CAAC;AACjlD,WAAS,KAAK,YAAY,KAAK;AAChC;AACA,IAAO,gBAAQ,EAAC,sBAAqB,yCAAwC,oCAAmC,sDAAqD,8BAA6B,gDAA+C,6BAA4B,+CAA8C,2CAA0C,8DAA6D,qCAAoC,uDAAsD,qCAAoC,sDAAqD;;;AHGrlB,qBAA2C;AA0BvC;AAdG,IAAMC,cAAS;AAAA,EACrB,SAAS,sBACR,EAAE,UAAU,WAAW,QAAQ,GAAG,UAAU,GAC5C,KACC;AACD,UAAM,CAAE,eAAe,gBAAiB,QAAI,yBAAmB;AAE/D,UAAM,mBAAe;AAAA,MACpB,OAAQ,EAAE,iBAAiB;AAAA,MAC3B,CAAE,gBAAiB;AAAA,IACpB;AAEA,WACC,4CAAC,0CAA2B,UAA3B,EAAoC,OAAQ,cAC5C;AAAA,MAAa;AAAA,MAAZ;AAAA,QACA,eAAY,YAAAC,SAAM,cAAO,QAAQ,SAAU;AAAA,QAC3C,QACC;AAAA,UAAM;AAAA,UAAL;AAAA,YACA;AAAA,YACA;AAAA,YACE,GAAG;AAAA;AAAA,QACN;AAAA,QAED,cAAe;AAAA,QACf,oBAAmB;AAAA,QAEnB;AAAA,sDAAC,SAAI,WAAY,cAAQ,gBAAiB,GACvC,UACH;AAAA,UACA;AAAA,YAAC;AAAA;AAAA,cACA,eAAY,YAAAA;AAAA,gBACX,cAAQ,2BAA4B;AAAA,cACrC;AAAA,cAEA;AAAA,gBAAC;AAAA;AAAA,kBACA,eAAY,YAAAA;AAAA,oBACX,cAAQ,wBAAyB;AAAA,oBACjC,2BAAc;AAAA;AAAA;AAAA;AAAA,oBAId,cACC,mCACD;AAAA,kBACD;AAAA,kBAEA;AAAA,oBAAC;AAAA;AAAA,sBACA,MAAO;AAAA,sBACP,WAAY,cAAQ,gBAAiB;AAAA;AAAA,kBACtC;AAAA;AAAA,cACD;AAAA;AAAA,UACD;AAAA;AAAA;AAAA,IACD,GACD;AAAA,EAEF;AACD;",
|
|
6
6
|
"names": ["Header", "Header", "clsx"]
|
|
7
7
|
}
|
package/build/dialog/context.cjs
CHANGED
|
@@ -25,6 +25,7 @@ __export(context_exports, {
|
|
|
25
25
|
});
|
|
26
26
|
module.exports = __toCommonJS(context_exports);
|
|
27
27
|
var import_element = require("@wordpress/element");
|
|
28
|
+
var import_use_schedule_validation = require("../utils/use-schedule-validation.cjs");
|
|
28
29
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
29
30
|
var VALIDATION_ENABLED = process.env.NODE_ENV !== "production";
|
|
30
31
|
var DialogValidationContext = VALIDATION_ENABLED ? (0, import_element.createContext)(null) : null;
|
|
@@ -39,14 +40,7 @@ function DialogValidationProviderDev({
|
|
|
39
40
|
children
|
|
40
41
|
}) {
|
|
41
42
|
const titleElementRef = (0, import_element.useRef)(null);
|
|
42
|
-
const
|
|
43
|
-
titleElementRef.current = element;
|
|
44
|
-
}, []);
|
|
45
|
-
const contextValue = (0, import_element.useMemo)(
|
|
46
|
-
() => ({ registerTitle }),
|
|
47
|
-
[registerTitle]
|
|
48
|
-
);
|
|
49
|
-
(0, import_element.useEffect)(() => {
|
|
43
|
+
const scheduleValidation = (0, import_use_schedule_validation.useScheduleValidation)(() => {
|
|
50
44
|
const titleElement = titleElementRef.current;
|
|
51
45
|
if (!titleElement) {
|
|
52
46
|
throw new Error(
|
|
@@ -59,7 +53,25 @@ function DialogValidationProviderDev({
|
|
|
59
53
|
"Dialog: <Dialog.Title> cannot be empty. Provide meaningful text content for the dialog title."
|
|
60
54
|
);
|
|
61
55
|
}
|
|
62
|
-
}
|
|
56
|
+
});
|
|
57
|
+
const registerTitle = (0, import_element.useCallback)(
|
|
58
|
+
(element) => {
|
|
59
|
+
titleElementRef.current = element;
|
|
60
|
+
scheduleValidation();
|
|
61
|
+
return () => {
|
|
62
|
+
titleElementRef.current = null;
|
|
63
|
+
scheduleValidation();
|
|
64
|
+
};
|
|
65
|
+
},
|
|
66
|
+
[scheduleValidation]
|
|
67
|
+
);
|
|
68
|
+
(0, import_element.useEffect)(() => {
|
|
69
|
+
scheduleValidation();
|
|
70
|
+
}, [scheduleValidation]);
|
|
71
|
+
const contextValue = (0, import_element.useMemo)(
|
|
72
|
+
() => ({ registerTitle }),
|
|
73
|
+
[registerTitle]
|
|
74
|
+
);
|
|
63
75
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DialogValidationContext.Provider, { value: contextValue, children });
|
|
64
76
|
}
|
|
65
77
|
function DialogValidationProviderProd({
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/dialog/context.tsx"],
|
|
4
|
-
"sourcesContent": ["import {\n\tcreateContext,\n\tuseCallback,\n\tuseContext,\n\tuseEffect,\n\tuseMemo,\n\tuseRef,\n} from '@wordpress/element';\n\n/**\n * Whether validation is enabled. This is a build-time constant that allows\n * bundlers to tree-shake all validation code in production builds.\n */\nconst VALIDATION_ENABLED = process.env.NODE_ENV !== 'production';\n\ntype DialogValidationContextType = {\n\tregisterTitle: ( element: HTMLElement | null ) => void;\n};\n\n// Context is only created in development mode.\nconst DialogValidationContext = VALIDATION_ENABLED\n\t? createContext< DialogValidationContextType | null >( null )\n\t: ( null as unknown as React.Context< DialogValidationContextType | null > );\n\n/**\n * Development-only hook to access the dialog validation context.\n */\nfunction useDialogValidationContextDev() {\n\treturn useContext( DialogValidationContext );\n}\n\n/**\n * Production no-op hook.\n */\nfunction useDialogValidationContextProd() {\n\treturn null;\n}\n\n/**\n * Hook to access the dialog validation context.\n * Returns null in production or if not within a Dialog.Popup.\n */\nexport const useDialogValidationContext = VALIDATION_ENABLED\n\t? useDialogValidationContextDev\n\t: useDialogValidationContextProd;\n\n/**\n * Development-only provider that tracks whether Dialog.Title is rendered.\n */\nfunction DialogValidationProviderDev( {\n\tchildren,\n}: {\n\tchildren: React.ReactNode;\n} ) {\n\tconst titleElementRef = useRef< HTMLElement | null >( null );\n\n\tconst
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qBAOO;
|
|
4
|
+
"sourcesContent": ["import {\n\tcreateContext,\n\tuseCallback,\n\tuseContext,\n\tuseEffect,\n\tuseMemo,\n\tuseRef,\n} from '@wordpress/element';\nimport { useScheduleValidation } from '../utils/use-schedule-validation';\n\n/**\n * Whether validation is enabled. This is a build-time constant that allows\n * bundlers to tree-shake all validation code in production builds.\n */\nconst VALIDATION_ENABLED = process.env.NODE_ENV !== 'production';\n\ntype DialogValidationContextType = {\n\tregisterTitle: ( element: HTMLElement | null ) => () => void;\n};\n\n// Context is only created in development mode.\nconst DialogValidationContext = VALIDATION_ENABLED\n\t? createContext< DialogValidationContextType | null >( null )\n\t: ( null as unknown as React.Context< DialogValidationContextType | null > );\n\n/**\n * Development-only hook to access the dialog validation context.\n */\nfunction useDialogValidationContextDev() {\n\treturn useContext( DialogValidationContext );\n}\n\n/**\n * Production no-op hook.\n */\nfunction useDialogValidationContextProd() {\n\treturn null;\n}\n\n/**\n * Hook to access the dialog validation context.\n * Returns null in production or if not within a Dialog.Popup.\n */\nexport const useDialogValidationContext = VALIDATION_ENABLED\n\t? useDialogValidationContextDev\n\t: useDialogValidationContextProd;\n\n/**\n * Development-only provider that tracks whether Dialog.Title is rendered.\n */\nfunction DialogValidationProviderDev( {\n\tchildren,\n}: {\n\tchildren: React.ReactNode;\n} ) {\n\tconst titleElementRef = useRef< HTMLElement | null >( null );\n\n\tconst scheduleValidation = useScheduleValidation( () => {\n\t\tconst titleElement = titleElementRef.current;\n\n\t\tif ( ! titleElement ) {\n\t\t\tthrow new Error(\n\t\t\t\t'Dialog: Missing <Dialog.Title>. ' +\n\t\t\t\t\t'For accessibility, every dialog requires a title. ' +\n\t\t\t\t\t'If needed, the title can be visually hidden but must not be omitted.'\n\t\t\t);\n\t\t}\n\n\t\tconst textContent = titleElement.textContent?.trim();\n\t\tif ( ! textContent ) {\n\t\t\tthrow new Error(\n\t\t\t\t'Dialog: <Dialog.Title> cannot be empty. ' +\n\t\t\t\t\t'Provide meaningful text content for the dialog title.'\n\t\t\t);\n\t\t}\n\t} );\n\n\tconst registerTitle = useCallback(\n\t\t( element: HTMLElement | null ) => {\n\t\t\ttitleElementRef.current = element;\n\t\t\tscheduleValidation();\n\n\t\t\treturn () => {\n\t\t\t\ttitleElementRef.current = null;\n\t\t\t\tscheduleValidation();\n\t\t\t};\n\t\t},\n\t\t[ scheduleValidation ]\n\t);\n\n\t// Schedule an initial validation on mount to catch missing titles\n\t// (when no Title component is rendered, registerTitle is never called).\n\tuseEffect( () => {\n\t\tscheduleValidation();\n\t}, [ scheduleValidation ] );\n\n\tconst contextValue = useMemo(\n\t\t() => ( { registerTitle } ),\n\t\t[ registerTitle ]\n\t);\n\n\treturn (\n\t\t<DialogValidationContext.Provider value={ contextValue }>\n\t\t\t{ children }\n\t\t</DialogValidationContext.Provider>\n\t);\n}\n\n/**\n * Production no-op provider that just renders children.\n */\nfunction DialogValidationProviderProd( {\n\tchildren,\n}: {\n\tchildren: React.ReactNode;\n} ) {\n\treturn <>{ children }</>;\n}\n\n/**\n * Provider component that validates Dialog.Title presence in development mode.\n * In production, this component is a no-op and just renders children.\n */\nexport const DialogValidationProvider = VALIDATION_ENABLED\n\t? DialogValidationProviderDev\n\t: DialogValidationProviderProd;\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qBAOO;AACP,qCAAsC;AA8FpC;AAxFF,IAAM,qBAAqB,QAAQ,IAAI,aAAa;AAOpD,IAAM,0BAA0B,yBAC7B,8BAAqD,IAAK,IACxD;AAKL,SAAS,gCAAgC;AACxC,aAAO,2BAAY,uBAAwB;AAC5C;AAKA,SAAS,iCAAiC;AACzC,SAAO;AACR;AAMO,IAAM,6BAA6B,qBACvC,gCACA;AAKH,SAAS,4BAA6B;AAAA,EACrC;AACD,GAEI;AACH,QAAM,sBAAkB,uBAA8B,IAAK;AAE3D,QAAM,yBAAqB,sDAAuB,MAAM;AACvD,UAAM,eAAe,gBAAgB;AAErC,QAAK,CAAE,cAAe;AACrB,YAAM,IAAI;AAAA,QACT;AAAA,MAGD;AAAA,IACD;AAEA,UAAM,cAAc,aAAa,aAAa,KAAK;AACnD,QAAK,CAAE,aAAc;AACpB,YAAM,IAAI;AAAA,QACT;AAAA,MAED;AAAA,IACD;AAAA,EACD,CAAE;AAEF,QAAM,oBAAgB;AAAA,IACrB,CAAE,YAAiC;AAClC,sBAAgB,UAAU;AAC1B,yBAAmB;AAEnB,aAAO,MAAM;AACZ,wBAAgB,UAAU;AAC1B,2BAAmB;AAAA,MACpB;AAAA,IACD;AAAA,IACA,CAAE,kBAAmB;AAAA,EACtB;AAIA,gCAAW,MAAM;AAChB,uBAAmB;AAAA,EACpB,GAAG,CAAE,kBAAmB,CAAE;AAE1B,QAAM,mBAAe;AAAA,IACpB,OAAQ,EAAE,cAAc;AAAA,IACxB,CAAE,aAAc;AAAA,EACjB;AAEA,SACC,4CAAC,wBAAwB,UAAxB,EAAiC,OAAQ,cACvC,UACH;AAEF;AAKA,SAAS,6BAA8B;AAAA,EACtC;AACD,GAEI;AACH,SAAO,2EAAI,UAAU;AACtB;AAMO,IAAM,2BAA2B,qBACrC,8BACA;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/build/dialog/footer.cjs
CHANGED
|
@@ -38,13 +38,13 @@ var import_clsx = __toESM(require("clsx"));
|
|
|
38
38
|
var import_element = require("@wordpress/element");
|
|
39
39
|
|
|
40
40
|
// packages/ui/src/dialog/style.module.css
|
|
41
|
-
if (typeof document !== "undefined" && process.env.NODE_ENV !== "test" && !document.head.querySelector("style[data-wp-hash='
|
|
41
|
+
if (typeof document !== "undefined" && process.env.NODE_ENV !== "test" && !document.head.querySelector("style[data-wp-hash='7d3678184b']")) {
|
|
42
42
|
const style = document.createElement("style");
|
|
43
|
-
style.setAttribute("data-wp-hash", "
|
|
44
|
-
style.appendChild(document.createTextNode('@layer wp-ui-utilities, wp-ui-components, wp-ui-compositions, wp-ui-overrides
|
|
43
|
+
style.setAttribute("data-wp-hash", "7d3678184b");
|
|
44
|
+
style.appendChild(document.createTextNode('@layer wp-ui-utilities, wp-ui-components, wp-ui-compositions, wp-ui-overrides;[data-wpds-theme-provider-id]:has(>._8acaa98861620d4d__popup){display:block}@layer wp-ui-components{._074affe4c56b4f2f__backdrop{background-color:#00000059;inset:0;position:fixed;z-index:var(--wp-ui-dialog-z-index,initial);&[data-ending-style],&[data-starting-style]{opacity:0}&[data-open]{opacity:1}@media not (prefers-reduced-motion){transition:opacity .2s ease-out}}._8acaa98861620d4d__popup{background-color:var(--wpds-color-bg-surface-neutral-strong,#fff);border-radius:var(--wpds-border-radius-lg,8px);box-shadow:var(--wpds-elevation-lg,0 5px 15px 0 #00000014,0 15px 27px 0 #00000012,0 30px 36px 0 #0000000a,0 50px 43px 0 #00000005);box-sizing:border-box;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);left:50%;line-height:var(--wpds-typography-line-height-md,24px);max-height:calc(100vh - var(--wpds-dimension-padding-2xl, 24px)*2);min-width:var(--wpds-dimension-surface-width-sm,320px);overflow:auto;padding:var(--wpds-dimension-padding-2xl,24px);position:fixed;top:50%;transform:translate(-50%,-50%);width:calc(100vw - var(--wpds-dimension-padding-2xl, 24px)*2);z-index:var(--wp-ui-dialog-z-index,initial);&[data-ending-style],&[data-starting-style]{opacity:0;transform:translate(-50%,-50%) scale(.9)}@media not (prefers-reduced-motion){transition:opacity .2s cubic-bezier(1,0,.2,1),transform .2s cubic-bezier(1,0,.2,1);&[data-open]{transition:opacity .2s cubic-bezier(.29,0,0,1),transform .2s cubic-bezier(.29,0,0,1)}}@media (min-width:480px){min-width:var(--wpds-dimension-surface-width-md,400px)}&._7acfa67ebf092988__is-small{max-width:var(--wpds-dimension-surface-width-md,400px)}&._1eeeed880cb5769d__is-medium{max-width:var(--wpds-dimension-surface-width-lg,560px)}&._99f900b2267e22d0__is-large{max-width:var(--wpds-dimension-surface-width-2xl,960px)}&.b49f7ff9c06fe387__is-stretch{max-width:none}&.dcd4c2f5036cbf1a__is-full{height:100vh}}._76fb3b28fcbd45fc__header{align-items:center;display:flex;gap:var(--wpds-dimension-gap-sm,8px);margin-bottom:var(--wpds-dimension-gap-lg,16px)}.f636832002af749e__title{--_gcd-heading-margin:0 auto 0 0;margin-inline-end:auto;&:dir(rtl){--_gcd-heading-margin:0 0 0 auto}}._00eeb4f220cddae3__footer{align-items:center;display:flex;gap:var(--wpds-dimension-gap-sm,8px);justify-content:flex-end;margin-top:var(--wpds-dimension-gap-lg,16px);padding-top:var(--wpds-dimension-padding-lg,16px)}}'));
|
|
45
45
|
document.head.appendChild(style);
|
|
46
46
|
}
|
|
47
|
-
var style_default = { "
|
|
47
|
+
var style_default = { "popup": "_8acaa98861620d4d__popup", "backdrop": "_074affe4c56b4f2f__backdrop", "is-small": "_7acfa67ebf092988__is-small", "is-medium": "_1eeeed880cb5769d__is-medium", "is-large": "_99f900b2267e22d0__is-large", "is-stretch": "b49f7ff9c06fe387__is-stretch", "is-full": "dcd4c2f5036cbf1a__is-full", "header": "_76fb3b28fcbd45fc__header", "title": "f636832002af749e__title", "footer": "_00eeb4f220cddae3__footer" };
|
|
48
48
|
|
|
49
49
|
// packages/ui/src/dialog/footer.tsx
|
|
50
50
|
var Footer = (0, import_element.forwardRef)(function DialogFooter({ className, render, ...props }, ref) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/dialog/footer.tsx", "../../src/dialog/style.module.css"],
|
|
4
|
-
"sourcesContent": ["import { mergeProps, useRender } from '@base-ui/react';\nimport clsx from 'clsx';\nimport { forwardRef } from '@wordpress/element';\nimport styles from './style.module.css';\nimport type { FooterProps } from './types';\n\n/**\n * Renders the footer section of the dialog, typically containing\n * action buttons.\n */\nconst Footer = forwardRef< HTMLDivElement, FooterProps >( function DialogFooter(\n\t{ className, render, ...props },\n\tref\n) {\n\tconst element = useRender( {\n\t\trender,\n\t\tref,\n\t\tprops: mergeProps< 'div' >( props, {\n\t\t\tclassName: clsx( styles.footer, className ),\n\t\t} ),\n\t} );\n\n\treturn element;\n} );\n\nexport { Footer };\n", "if (typeof document !== 'undefined' && process.env.NODE_ENV !== 'test' && !document.head.querySelector(\"style[data-wp-hash='
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAsC;AACtC,kBAAiB;AACjB,qBAA2B;;;ACF3B,IAAI,OAAO,aAAa,eAAe,QAAQ,IAAI,aAAa,UAAU,CAAC,SAAS,KAAK,cAAc,kCAAkC,GAAG;AAC3I,QAAM,QAAQ,SAAS,cAAc,OAAO;AAC5C,QAAM,aAAa,gBAAgB,YAAY;AAC/C,QAAM,YAAY,SAAS,eAAe,
|
|
4
|
+
"sourcesContent": ["import { mergeProps, useRender } from '@base-ui/react';\nimport clsx from 'clsx';\nimport { forwardRef } from '@wordpress/element';\nimport styles from './style.module.css';\nimport type { FooterProps } from './types';\n\n/**\n * Renders the footer section of the dialog, typically containing\n * action buttons.\n */\nconst Footer = forwardRef< HTMLDivElement, FooterProps >( function DialogFooter(\n\t{ className, render, ...props },\n\tref\n) {\n\tconst element = useRender( {\n\t\trender,\n\t\tref,\n\t\tprops: mergeProps< 'div' >( props, {\n\t\t\tclassName: clsx( styles.footer, className ),\n\t\t} ),\n\t} );\n\n\treturn element;\n} );\n\nexport { Footer };\n", "if (typeof document !== 'undefined' && process.env.NODE_ENV !== 'test' && !document.head.querySelector(\"style[data-wp-hash='7d3678184b']\")) {\n\tconst style = document.createElement(\"style\");\n\tstyle.setAttribute(\"data-wp-hash\", \"7d3678184b\");\n\tstyle.appendChild(document.createTextNode(\"@layer wp-ui-utilities, wp-ui-components, wp-ui-compositions, wp-ui-overrides;[data-wpds-theme-provider-id]:has(>._8acaa98861620d4d__popup){display:block}@layer wp-ui-components{._074affe4c56b4f2f__backdrop{background-color:#00000059;inset:0;position:fixed;z-index:var(--wp-ui-dialog-z-index,initial);&[data-ending-style],&[data-starting-style]{opacity:0}&[data-open]{opacity:1}@media not (prefers-reduced-motion){transition:opacity .2s ease-out}}._8acaa98861620d4d__popup{background-color:var(--wpds-color-bg-surface-neutral-strong,#fff);border-radius:var(--wpds-border-radius-lg,8px);box-shadow:var(--wpds-elevation-lg,0 5px 15px 0 #00000014,0 15px 27px 0 #00000012,0 30px 36px 0 #0000000a,0 50px 43px 0 #00000005);box-sizing:border-box;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);left:50%;line-height:var(--wpds-typography-line-height-md,24px);max-height:calc(100vh - var(--wpds-dimension-padding-2xl, 24px)*2);min-width:var(--wpds-dimension-surface-width-sm,320px);overflow:auto;padding:var(--wpds-dimension-padding-2xl,24px);position:fixed;top:50%;transform:translate(-50%,-50%);width:calc(100vw - var(--wpds-dimension-padding-2xl, 24px)*2);z-index:var(--wp-ui-dialog-z-index,initial);&[data-ending-style],&[data-starting-style]{opacity:0;transform:translate(-50%,-50%) scale(.9)}@media not (prefers-reduced-motion){transition:opacity .2s cubic-bezier(1,0,.2,1),transform .2s cubic-bezier(1,0,.2,1);&[data-open]{transition:opacity .2s cubic-bezier(.29,0,0,1),transform .2s cubic-bezier(.29,0,0,1)}}@media (min-width:480px){min-width:var(--wpds-dimension-surface-width-md,400px)}&._7acfa67ebf092988__is-small{max-width:var(--wpds-dimension-surface-width-md,400px)}&._1eeeed880cb5769d__is-medium{max-width:var(--wpds-dimension-surface-width-lg,560px)}&._99f900b2267e22d0__is-large{max-width:var(--wpds-dimension-surface-width-2xl,960px)}&.b49f7ff9c06fe387__is-stretch{max-width:none}&.dcd4c2f5036cbf1a__is-full{height:100vh}}._76fb3b28fcbd45fc__header{align-items:center;display:flex;gap:var(--wpds-dimension-gap-sm,8px);margin-bottom:var(--wpds-dimension-gap-lg,16px)}.f636832002af749e__title{--_gcd-heading-margin:0 auto 0 0;margin-inline-end:auto;&:dir(rtl){--_gcd-heading-margin:0 0 0 auto}}._00eeb4f220cddae3__footer{align-items:center;display:flex;gap:var(--wpds-dimension-gap-sm,8px);justify-content:flex-end;margin-top:var(--wpds-dimension-gap-lg,16px);padding-top:var(--wpds-dimension-padding-lg,16px)}}\"));\n\tdocument.head.appendChild(style);\n}\nexport default {\"popup\":\"_8acaa98861620d4d__popup\",\"backdrop\":\"_074affe4c56b4f2f__backdrop\",\"is-small\":\"_7acfa67ebf092988__is-small\",\"is-medium\":\"_1eeeed880cb5769d__is-medium\",\"is-large\":\"_99f900b2267e22d0__is-large\",\"is-stretch\":\"b49f7ff9c06fe387__is-stretch\",\"is-full\":\"dcd4c2f5036cbf1a__is-full\",\"header\":\"_76fb3b28fcbd45fc__header\",\"title\":\"f636832002af749e__title\",\"footer\":\"_00eeb4f220cddae3__footer\"};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAsC;AACtC,kBAAiB;AACjB,qBAA2B;;;ACF3B,IAAI,OAAO,aAAa,eAAe,QAAQ,IAAI,aAAa,UAAU,CAAC,SAAS,KAAK,cAAc,kCAAkC,GAAG;AAC3I,QAAM,QAAQ,SAAS,cAAc,OAAO;AAC5C,QAAM,aAAa,gBAAgB,YAAY;AAC/C,QAAM,YAAY,SAAS,eAAe,0kFAAslF,CAAC;AACjoF,WAAS,KAAK,YAAY,KAAK;AAChC;AACA,IAAO,gBAAQ,EAAC,SAAQ,4BAA2B,YAAW,+BAA8B,YAAW,+BAA8B,aAAY,gCAA+B,YAAW,+BAA8B,cAAa,gCAA+B,WAAU,6BAA4B,UAAS,6BAA4B,SAAQ,2BAA0B,UAAS,4BAA2B;;;ADItZ,IAAM,aAAS,2BAA2C,SAAS,aAClE,EAAE,WAAW,QAAQ,GAAG,MAAM,GAC9B,KACC;AACD,QAAM,cAAU,wBAAW;AAAA,IAC1B;AAAA,IACA;AAAA,IACA,WAAO,yBAAqB,OAAO;AAAA,MAClC,eAAW,YAAAA,SAAM,cAAO,QAAQ,SAAU;AAAA,IAC3C,CAAE;AAAA,EACH,CAAE;AAEF,SAAO;AACR,CAAE;",
|
|
6
6
|
"names": ["clsx"]
|
|
7
7
|
}
|
package/build/dialog/header.cjs
CHANGED
|
@@ -38,13 +38,13 @@ var import_clsx = __toESM(require("clsx"));
|
|
|
38
38
|
var import_element = require("@wordpress/element");
|
|
39
39
|
|
|
40
40
|
// packages/ui/src/dialog/style.module.css
|
|
41
|
-
if (typeof document !== "undefined" && process.env.NODE_ENV !== "test" && !document.head.querySelector("style[data-wp-hash='
|
|
41
|
+
if (typeof document !== "undefined" && process.env.NODE_ENV !== "test" && !document.head.querySelector("style[data-wp-hash='7d3678184b']")) {
|
|
42
42
|
const style = document.createElement("style");
|
|
43
|
-
style.setAttribute("data-wp-hash", "
|
|
44
|
-
style.appendChild(document.createTextNode('@layer wp-ui-utilities, wp-ui-components, wp-ui-compositions, wp-ui-overrides
|
|
43
|
+
style.setAttribute("data-wp-hash", "7d3678184b");
|
|
44
|
+
style.appendChild(document.createTextNode('@layer wp-ui-utilities, wp-ui-components, wp-ui-compositions, wp-ui-overrides;[data-wpds-theme-provider-id]:has(>._8acaa98861620d4d__popup){display:block}@layer wp-ui-components{._074affe4c56b4f2f__backdrop{background-color:#00000059;inset:0;position:fixed;z-index:var(--wp-ui-dialog-z-index,initial);&[data-ending-style],&[data-starting-style]{opacity:0}&[data-open]{opacity:1}@media not (prefers-reduced-motion){transition:opacity .2s ease-out}}._8acaa98861620d4d__popup{background-color:var(--wpds-color-bg-surface-neutral-strong,#fff);border-radius:var(--wpds-border-radius-lg,8px);box-shadow:var(--wpds-elevation-lg,0 5px 15px 0 #00000014,0 15px 27px 0 #00000012,0 30px 36px 0 #0000000a,0 50px 43px 0 #00000005);box-sizing:border-box;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);left:50%;line-height:var(--wpds-typography-line-height-md,24px);max-height:calc(100vh - var(--wpds-dimension-padding-2xl, 24px)*2);min-width:var(--wpds-dimension-surface-width-sm,320px);overflow:auto;padding:var(--wpds-dimension-padding-2xl,24px);position:fixed;top:50%;transform:translate(-50%,-50%);width:calc(100vw - var(--wpds-dimension-padding-2xl, 24px)*2);z-index:var(--wp-ui-dialog-z-index,initial);&[data-ending-style],&[data-starting-style]{opacity:0;transform:translate(-50%,-50%) scale(.9)}@media not (prefers-reduced-motion){transition:opacity .2s cubic-bezier(1,0,.2,1),transform .2s cubic-bezier(1,0,.2,1);&[data-open]{transition:opacity .2s cubic-bezier(.29,0,0,1),transform .2s cubic-bezier(.29,0,0,1)}}@media (min-width:480px){min-width:var(--wpds-dimension-surface-width-md,400px)}&._7acfa67ebf092988__is-small{max-width:var(--wpds-dimension-surface-width-md,400px)}&._1eeeed880cb5769d__is-medium{max-width:var(--wpds-dimension-surface-width-lg,560px)}&._99f900b2267e22d0__is-large{max-width:var(--wpds-dimension-surface-width-2xl,960px)}&.b49f7ff9c06fe387__is-stretch{max-width:none}&.dcd4c2f5036cbf1a__is-full{height:100vh}}._76fb3b28fcbd45fc__header{align-items:center;display:flex;gap:var(--wpds-dimension-gap-sm,8px);margin-bottom:var(--wpds-dimension-gap-lg,16px)}.f636832002af749e__title{--_gcd-heading-margin:0 auto 0 0;margin-inline-end:auto;&:dir(rtl){--_gcd-heading-margin:0 0 0 auto}}._00eeb4f220cddae3__footer{align-items:center;display:flex;gap:var(--wpds-dimension-gap-sm,8px);justify-content:flex-end;margin-top:var(--wpds-dimension-gap-lg,16px);padding-top:var(--wpds-dimension-padding-lg,16px)}}'));
|
|
45
45
|
document.head.appendChild(style);
|
|
46
46
|
}
|
|
47
|
-
var style_default = { "
|
|
47
|
+
var style_default = { "popup": "_8acaa98861620d4d__popup", "backdrop": "_074affe4c56b4f2f__backdrop", "is-small": "_7acfa67ebf092988__is-small", "is-medium": "_1eeeed880cb5769d__is-medium", "is-large": "_99f900b2267e22d0__is-large", "is-stretch": "b49f7ff9c06fe387__is-stretch", "is-full": "dcd4c2f5036cbf1a__is-full", "header": "_76fb3b28fcbd45fc__header", "title": "f636832002af749e__title", "footer": "_00eeb4f220cddae3__footer" };
|
|
48
48
|
|
|
49
49
|
// packages/ui/src/dialog/header.tsx
|
|
50
50
|
var Header = (0, import_element.forwardRef)(function DialogHeader({ className, render, ...props }, ref) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/dialog/header.tsx", "../../src/dialog/style.module.css"],
|
|
4
|
-
"sourcesContent": ["import { mergeProps, useRender } from '@base-ui/react';\nimport clsx from 'clsx';\nimport { forwardRef } from '@wordpress/element';\nimport styles from './style.module.css';\nimport type { HeaderProps } from './types';\n\n/**\n * Renders the header section of the dialog, typically containing\n * the heading and close button.\n */\nconst Header = forwardRef< HTMLDivElement, HeaderProps >( function DialogHeader(\n\t{ className, render, ...props },\n\tref\n) {\n\tconst element = useRender( {\n\t\trender,\n\t\tref,\n\t\tprops: mergeProps< 'div' >( props, {\n\t\t\tclassName: clsx( styles.header, className ),\n\t\t} ),\n\t} );\n\n\treturn element;\n} );\n\nexport { Header };\n", "if (typeof document !== 'undefined' && process.env.NODE_ENV !== 'test' && !document.head.querySelector(\"style[data-wp-hash='
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAsC;AACtC,kBAAiB;AACjB,qBAA2B;;;ACF3B,IAAI,OAAO,aAAa,eAAe,QAAQ,IAAI,aAAa,UAAU,CAAC,SAAS,KAAK,cAAc,kCAAkC,GAAG;AAC3I,QAAM,QAAQ,SAAS,cAAc,OAAO;AAC5C,QAAM,aAAa,gBAAgB,YAAY;AAC/C,QAAM,YAAY,SAAS,eAAe,
|
|
4
|
+
"sourcesContent": ["import { mergeProps, useRender } from '@base-ui/react';\nimport clsx from 'clsx';\nimport { forwardRef } from '@wordpress/element';\nimport styles from './style.module.css';\nimport type { HeaderProps } from './types';\n\n/**\n * Renders the header section of the dialog, typically containing\n * the heading and close button.\n */\nconst Header = forwardRef< HTMLDivElement, HeaderProps >( function DialogHeader(\n\t{ className, render, ...props },\n\tref\n) {\n\tconst element = useRender( {\n\t\trender,\n\t\tref,\n\t\tprops: mergeProps< 'div' >( props, {\n\t\t\tclassName: clsx( styles.header, className ),\n\t\t} ),\n\t} );\n\n\treturn element;\n} );\n\nexport { Header };\n", "if (typeof document !== 'undefined' && process.env.NODE_ENV !== 'test' && !document.head.querySelector(\"style[data-wp-hash='7d3678184b']\")) {\n\tconst style = document.createElement(\"style\");\n\tstyle.setAttribute(\"data-wp-hash\", \"7d3678184b\");\n\tstyle.appendChild(document.createTextNode(\"@layer wp-ui-utilities, wp-ui-components, wp-ui-compositions, wp-ui-overrides;[data-wpds-theme-provider-id]:has(>._8acaa98861620d4d__popup){display:block}@layer wp-ui-components{._074affe4c56b4f2f__backdrop{background-color:#00000059;inset:0;position:fixed;z-index:var(--wp-ui-dialog-z-index,initial);&[data-ending-style],&[data-starting-style]{opacity:0}&[data-open]{opacity:1}@media not (prefers-reduced-motion){transition:opacity .2s ease-out}}._8acaa98861620d4d__popup{background-color:var(--wpds-color-bg-surface-neutral-strong,#fff);border-radius:var(--wpds-border-radius-lg,8px);box-shadow:var(--wpds-elevation-lg,0 5px 15px 0 #00000014,0 15px 27px 0 #00000012,0 30px 36px 0 #0000000a,0 50px 43px 0 #00000005);box-sizing:border-box;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);left:50%;line-height:var(--wpds-typography-line-height-md,24px);max-height:calc(100vh - var(--wpds-dimension-padding-2xl, 24px)*2);min-width:var(--wpds-dimension-surface-width-sm,320px);overflow:auto;padding:var(--wpds-dimension-padding-2xl,24px);position:fixed;top:50%;transform:translate(-50%,-50%);width:calc(100vw - var(--wpds-dimension-padding-2xl, 24px)*2);z-index:var(--wp-ui-dialog-z-index,initial);&[data-ending-style],&[data-starting-style]{opacity:0;transform:translate(-50%,-50%) scale(.9)}@media not (prefers-reduced-motion){transition:opacity .2s cubic-bezier(1,0,.2,1),transform .2s cubic-bezier(1,0,.2,1);&[data-open]{transition:opacity .2s cubic-bezier(.29,0,0,1),transform .2s cubic-bezier(.29,0,0,1)}}@media (min-width:480px){min-width:var(--wpds-dimension-surface-width-md,400px)}&._7acfa67ebf092988__is-small{max-width:var(--wpds-dimension-surface-width-md,400px)}&._1eeeed880cb5769d__is-medium{max-width:var(--wpds-dimension-surface-width-lg,560px)}&._99f900b2267e22d0__is-large{max-width:var(--wpds-dimension-surface-width-2xl,960px)}&.b49f7ff9c06fe387__is-stretch{max-width:none}&.dcd4c2f5036cbf1a__is-full{height:100vh}}._76fb3b28fcbd45fc__header{align-items:center;display:flex;gap:var(--wpds-dimension-gap-sm,8px);margin-bottom:var(--wpds-dimension-gap-lg,16px)}.f636832002af749e__title{--_gcd-heading-margin:0 auto 0 0;margin-inline-end:auto;&:dir(rtl){--_gcd-heading-margin:0 0 0 auto}}._00eeb4f220cddae3__footer{align-items:center;display:flex;gap:var(--wpds-dimension-gap-sm,8px);justify-content:flex-end;margin-top:var(--wpds-dimension-gap-lg,16px);padding-top:var(--wpds-dimension-padding-lg,16px)}}\"));\n\tdocument.head.appendChild(style);\n}\nexport default {\"popup\":\"_8acaa98861620d4d__popup\",\"backdrop\":\"_074affe4c56b4f2f__backdrop\",\"is-small\":\"_7acfa67ebf092988__is-small\",\"is-medium\":\"_1eeeed880cb5769d__is-medium\",\"is-large\":\"_99f900b2267e22d0__is-large\",\"is-stretch\":\"b49f7ff9c06fe387__is-stretch\",\"is-full\":\"dcd4c2f5036cbf1a__is-full\",\"header\":\"_76fb3b28fcbd45fc__header\",\"title\":\"f636832002af749e__title\",\"footer\":\"_00eeb4f220cddae3__footer\"};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAsC;AACtC,kBAAiB;AACjB,qBAA2B;;;ACF3B,IAAI,OAAO,aAAa,eAAe,QAAQ,IAAI,aAAa,UAAU,CAAC,SAAS,KAAK,cAAc,kCAAkC,GAAG;AAC3I,QAAM,QAAQ,SAAS,cAAc,OAAO;AAC5C,QAAM,aAAa,gBAAgB,YAAY;AAC/C,QAAM,YAAY,SAAS,eAAe,0kFAAslF,CAAC;AACjoF,WAAS,KAAK,YAAY,KAAK;AAChC;AACA,IAAO,gBAAQ,EAAC,SAAQ,4BAA2B,YAAW,+BAA8B,YAAW,+BAA8B,aAAY,gCAA+B,YAAW,+BAA8B,cAAa,gCAA+B,WAAU,6BAA4B,UAAS,6BAA4B,SAAQ,2BAA0B,UAAS,4BAA2B;;;ADItZ,IAAM,aAAS,2BAA2C,SAAS,aAClE,EAAE,WAAW,QAAQ,GAAG,MAAM,GAC9B,KACC;AACD,QAAM,cAAU,wBAAW;AAAA,IAC1B;AAAA,IACA;AAAA,IACA,WAAO,yBAAqB,OAAO;AAAA,MAClC,eAAW,YAAAA,SAAM,cAAO,QAAQ,SAAU;AAAA,IAC3C,CAAE;AAAA,EACH,CAAE;AAEF,SAAO;AACR,CAAE;",
|
|
6
6
|
"names": ["clsx"]
|
|
7
7
|
}
|
package/build/dialog/popup.cjs
CHANGED
|
@@ -43,13 +43,13 @@ var import_use_deprioritized_initial_focus = require("../utils/use-deprioritized
|
|
|
43
43
|
var import_context = require("./context.cjs");
|
|
44
44
|
|
|
45
45
|
// packages/ui/src/dialog/style.module.css
|
|
46
|
-
if (typeof document !== "undefined" && process.env.NODE_ENV !== "test" && !document.head.querySelector("style[data-wp-hash='
|
|
46
|
+
if (typeof document !== "undefined" && process.env.NODE_ENV !== "test" && !document.head.querySelector("style[data-wp-hash='7d3678184b']")) {
|
|
47
47
|
const style = document.createElement("style");
|
|
48
|
-
style.setAttribute("data-wp-hash", "
|
|
49
|
-
style.appendChild(document.createTextNode('@layer wp-ui-utilities, wp-ui-components, wp-ui-compositions, wp-ui-overrides
|
|
48
|
+
style.setAttribute("data-wp-hash", "7d3678184b");
|
|
49
|
+
style.appendChild(document.createTextNode('@layer wp-ui-utilities, wp-ui-components, wp-ui-compositions, wp-ui-overrides;[data-wpds-theme-provider-id]:has(>._8acaa98861620d4d__popup){display:block}@layer wp-ui-components{._074affe4c56b4f2f__backdrop{background-color:#00000059;inset:0;position:fixed;z-index:var(--wp-ui-dialog-z-index,initial);&[data-ending-style],&[data-starting-style]{opacity:0}&[data-open]{opacity:1}@media not (prefers-reduced-motion){transition:opacity .2s ease-out}}._8acaa98861620d4d__popup{background-color:var(--wpds-color-bg-surface-neutral-strong,#fff);border-radius:var(--wpds-border-radius-lg,8px);box-shadow:var(--wpds-elevation-lg,0 5px 15px 0 #00000014,0 15px 27px 0 #00000012,0 30px 36px 0 #0000000a,0 50px 43px 0 #00000005);box-sizing:border-box;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);left:50%;line-height:var(--wpds-typography-line-height-md,24px);max-height:calc(100vh - var(--wpds-dimension-padding-2xl, 24px)*2);min-width:var(--wpds-dimension-surface-width-sm,320px);overflow:auto;padding:var(--wpds-dimension-padding-2xl,24px);position:fixed;top:50%;transform:translate(-50%,-50%);width:calc(100vw - var(--wpds-dimension-padding-2xl, 24px)*2);z-index:var(--wp-ui-dialog-z-index,initial);&[data-ending-style],&[data-starting-style]{opacity:0;transform:translate(-50%,-50%) scale(.9)}@media not (prefers-reduced-motion){transition:opacity .2s cubic-bezier(1,0,.2,1),transform .2s cubic-bezier(1,0,.2,1);&[data-open]{transition:opacity .2s cubic-bezier(.29,0,0,1),transform .2s cubic-bezier(.29,0,0,1)}}@media (min-width:480px){min-width:var(--wpds-dimension-surface-width-md,400px)}&._7acfa67ebf092988__is-small{max-width:var(--wpds-dimension-surface-width-md,400px)}&._1eeeed880cb5769d__is-medium{max-width:var(--wpds-dimension-surface-width-lg,560px)}&._99f900b2267e22d0__is-large{max-width:var(--wpds-dimension-surface-width-2xl,960px)}&.b49f7ff9c06fe387__is-stretch{max-width:none}&.dcd4c2f5036cbf1a__is-full{height:100vh}}._76fb3b28fcbd45fc__header{align-items:center;display:flex;gap:var(--wpds-dimension-gap-sm,8px);margin-bottom:var(--wpds-dimension-gap-lg,16px)}.f636832002af749e__title{--_gcd-heading-margin:0 auto 0 0;margin-inline-end:auto;&:dir(rtl){--_gcd-heading-margin:0 0 0 auto}}._00eeb4f220cddae3__footer{align-items:center;display:flex;gap:var(--wpds-dimension-gap-sm,8px);justify-content:flex-end;margin-top:var(--wpds-dimension-gap-lg,16px);padding-top:var(--wpds-dimension-padding-lg,16px)}}'));
|
|
50
50
|
document.head.appendChild(style);
|
|
51
51
|
}
|
|
52
|
-
var style_default = { "
|
|
52
|
+
var style_default = { "popup": "_8acaa98861620d4d__popup", "backdrop": "_074affe4c56b4f2f__backdrop", "is-small": "_7acfa67ebf092988__is-small", "is-medium": "_1eeeed880cb5769d__is-medium", "is-large": "_99f900b2267e22d0__is-large", "is-stretch": "b49f7ff9c06fe387__is-stretch", "is-full": "dcd4c2f5036cbf1a__is-full", "header": "_76fb3b28fcbd45fc__header", "title": "f636832002af749e__title", "footer": "_00eeb4f220cddae3__footer" };
|
|
53
53
|
|
|
54
54
|
// packages/ui/src/dialog/popup.tsx
|
|
55
55
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/dialog/popup.tsx", "../../src/dialog/style.module.css"],
|
|
4
|
-
"sourcesContent": ["import { Dialog as _Dialog } from '@base-ui/react/dialog';\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 { DialogValidationProvider } from './context';\nimport styles from './style.module.css';\nimport type { PopupProps } from './types';\n\nconst ThemeProvider: typeof ThemeProviderType =\n\tunlock( themePrivateApis ).ThemeProvider;\n\nconst CLOSE_ICON_ATTR = 'data-wp-ui-dialog-close-icon';\n\n/**\n * Renders the dialog popup element that contains the dialog content.\n * Uses a portal to render outside the DOM hierarchy.\n */\nconst Popup = forwardRef< HTMLDivElement, PopupProps >( function DialogPopup(\n\t{\n\t\tclassName,\n\t\tcontainer,\n\t\tsize = 'medium',\n\t\tinitialFocus,\n\t\tfinalFocus,\n\t\tchildren,\n\t\t...props\n\t},\n\tref\n) {\n\tconst { resolvedInitialFocus, popupRef } = useDeprioritizedInitialFocus( {\n\t\tinitialFocus,\n\t\tdeprioritizedAttribute: CLOSE_ICON_ATTR,\n\t} );\n\tconst mergedRef = useMergeRefs( [ ref, popupRef ] );\n\n\treturn (\n\t\t<_Dialog.Portal container={ container }>\n\t\t\t<_Dialog.Backdrop className={ styles.backdrop } />\n\t\t\t<ThemeProvider>\n\t\t\t\t<_Dialog.Popup\n\t\t\t\t\tref={ mergedRef }\n\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\tstyles.popup,\n\t\t\t\t\t\tclassName,\n\t\t\t\t\t\tstyles[ `is-${ size }` ]\n\t\t\t\t\t) }\n\t\t\t\t\tinitialFocus={ resolvedInitialFocus }\n\t\t\t\t\tfinalFocus={ finalFocus }\n\t\t\t\t\t{ ...props }\n\t\t\t\t>\n\t\t\t\t\t<DialogValidationProvider>\n\t\t\t\t\t\t{ children }\n\t\t\t\t\t</DialogValidationProvider>\n\t\t\t\t</_Dialog.Popup>\n\t\t\t</ThemeProvider>\n\t\t</_Dialog.Portal>\n\t);\n} );\n\nexport { Popup };\n", "if (typeof document !== 'undefined' && process.env.NODE_ENV !== 'test' && !document.head.querySelector(\"style[data-wp-hash='
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAAkC;AAClC,kBAAiB;AACjB,qBAA2B;AAC3B,qBAA6B;AAC7B,mBAGO;AACP,yBAAuB;AACvB,6CAA6C;AAC7C,qBAAyC;;;ACVzC,IAAI,OAAO,aAAa,eAAe,QAAQ,IAAI,aAAa,UAAU,CAAC,SAAS,KAAK,cAAc,kCAAkC,GAAG;AAC3I,QAAM,QAAQ,SAAS,cAAc,OAAO;AAC5C,QAAM,aAAa,gBAAgB,YAAY;AAC/C,QAAM,YAAY,SAAS,eAAe,
|
|
4
|
+
"sourcesContent": ["import { Dialog as _Dialog } from '@base-ui/react/dialog';\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 { DialogValidationProvider } from './context';\nimport styles from './style.module.css';\nimport type { PopupProps } from './types';\n\nconst ThemeProvider: typeof ThemeProviderType =\n\tunlock( themePrivateApis ).ThemeProvider;\n\nconst CLOSE_ICON_ATTR = 'data-wp-ui-dialog-close-icon';\n\n/**\n * Renders the dialog popup element that contains the dialog content.\n * Uses a portal to render outside the DOM hierarchy.\n */\nconst Popup = forwardRef< HTMLDivElement, PopupProps >( function DialogPopup(\n\t{\n\t\tclassName,\n\t\tcontainer,\n\t\tsize = 'medium',\n\t\tinitialFocus,\n\t\tfinalFocus,\n\t\tchildren,\n\t\t...props\n\t},\n\tref\n) {\n\tconst { resolvedInitialFocus, popupRef } = useDeprioritizedInitialFocus( {\n\t\tinitialFocus,\n\t\tdeprioritizedAttribute: CLOSE_ICON_ATTR,\n\t} );\n\tconst mergedRef = useMergeRefs( [ ref, popupRef ] );\n\n\treturn (\n\t\t<_Dialog.Portal container={ container }>\n\t\t\t<_Dialog.Backdrop className={ styles.backdrop } />\n\t\t\t<ThemeProvider>\n\t\t\t\t<_Dialog.Popup\n\t\t\t\t\tref={ mergedRef }\n\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\tstyles.popup,\n\t\t\t\t\t\tclassName,\n\t\t\t\t\t\tstyles[ `is-${ size }` ]\n\t\t\t\t\t) }\n\t\t\t\t\tinitialFocus={ resolvedInitialFocus }\n\t\t\t\t\tfinalFocus={ finalFocus }\n\t\t\t\t\t{ ...props }\n\t\t\t\t>\n\t\t\t\t\t<DialogValidationProvider>\n\t\t\t\t\t\t{ children }\n\t\t\t\t\t</DialogValidationProvider>\n\t\t\t\t</_Dialog.Popup>\n\t\t\t</ThemeProvider>\n\t\t</_Dialog.Portal>\n\t);\n} );\n\nexport { Popup };\n", "if (typeof document !== 'undefined' && process.env.NODE_ENV !== 'test' && !document.head.querySelector(\"style[data-wp-hash='7d3678184b']\")) {\n\tconst style = document.createElement(\"style\");\n\tstyle.setAttribute(\"data-wp-hash\", \"7d3678184b\");\n\tstyle.appendChild(document.createTextNode(\"@layer wp-ui-utilities, wp-ui-components, wp-ui-compositions, wp-ui-overrides;[data-wpds-theme-provider-id]:has(>._8acaa98861620d4d__popup){display:block}@layer wp-ui-components{._074affe4c56b4f2f__backdrop{background-color:#00000059;inset:0;position:fixed;z-index:var(--wp-ui-dialog-z-index,initial);&[data-ending-style],&[data-starting-style]{opacity:0}&[data-open]{opacity:1}@media not (prefers-reduced-motion){transition:opacity .2s ease-out}}._8acaa98861620d4d__popup{background-color:var(--wpds-color-bg-surface-neutral-strong,#fff);border-radius:var(--wpds-border-radius-lg,8px);box-shadow:var(--wpds-elevation-lg,0 5px 15px 0 #00000014,0 15px 27px 0 #00000012,0 30px 36px 0 #0000000a,0 50px 43px 0 #00000005);box-sizing:border-box;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);left:50%;line-height:var(--wpds-typography-line-height-md,24px);max-height:calc(100vh - var(--wpds-dimension-padding-2xl, 24px)*2);min-width:var(--wpds-dimension-surface-width-sm,320px);overflow:auto;padding:var(--wpds-dimension-padding-2xl,24px);position:fixed;top:50%;transform:translate(-50%,-50%);width:calc(100vw - var(--wpds-dimension-padding-2xl, 24px)*2);z-index:var(--wp-ui-dialog-z-index,initial);&[data-ending-style],&[data-starting-style]{opacity:0;transform:translate(-50%,-50%) scale(.9)}@media not (prefers-reduced-motion){transition:opacity .2s cubic-bezier(1,0,.2,1),transform .2s cubic-bezier(1,0,.2,1);&[data-open]{transition:opacity .2s cubic-bezier(.29,0,0,1),transform .2s cubic-bezier(.29,0,0,1)}}@media (min-width:480px){min-width:var(--wpds-dimension-surface-width-md,400px)}&._7acfa67ebf092988__is-small{max-width:var(--wpds-dimension-surface-width-md,400px)}&._1eeeed880cb5769d__is-medium{max-width:var(--wpds-dimension-surface-width-lg,560px)}&._99f900b2267e22d0__is-large{max-width:var(--wpds-dimension-surface-width-2xl,960px)}&.b49f7ff9c06fe387__is-stretch{max-width:none}&.dcd4c2f5036cbf1a__is-full{height:100vh}}._76fb3b28fcbd45fc__header{align-items:center;display:flex;gap:var(--wpds-dimension-gap-sm,8px);margin-bottom:var(--wpds-dimension-gap-lg,16px)}.f636832002af749e__title{--_gcd-heading-margin:0 auto 0 0;margin-inline-end:auto;&:dir(rtl){--_gcd-heading-margin:0 0 0 auto}}._00eeb4f220cddae3__footer{align-items:center;display:flex;gap:var(--wpds-dimension-gap-sm,8px);justify-content:flex-end;margin-top:var(--wpds-dimension-gap-lg,16px);padding-top:var(--wpds-dimension-padding-lg,16px)}}\"));\n\tdocument.head.appendChild(style);\n}\nexport default {\"popup\":\"_8acaa98861620d4d__popup\",\"backdrop\":\"_074affe4c56b4f2f__backdrop\",\"is-small\":\"_7acfa67ebf092988__is-small\",\"is-medium\":\"_1eeeed880cb5769d__is-medium\",\"is-large\":\"_99f900b2267e22d0__is-large\",\"is-stretch\":\"b49f7ff9c06fe387__is-stretch\",\"is-full\":\"dcd4c2f5036cbf1a__is-full\",\"header\":\"_76fb3b28fcbd45fc__header\",\"title\":\"f636832002af749e__title\",\"footer\":\"_00eeb4f220cddae3__footer\"};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAAkC;AAClC,kBAAiB;AACjB,qBAA2B;AAC3B,qBAA6B;AAC7B,mBAGO;AACP,yBAAuB;AACvB,6CAA6C;AAC7C,qBAAyC;;;ACVzC,IAAI,OAAO,aAAa,eAAe,QAAQ,IAAI,aAAa,UAAU,CAAC,SAAS,KAAK,cAAc,kCAAkC,GAAG;AAC3I,QAAM,QAAQ,SAAS,cAAc,OAAO;AAC5C,QAAM,aAAa,gBAAgB,YAAY;AAC/C,QAAM,YAAY,SAAS,eAAe,0kFAAslF,CAAC;AACjoF,WAAS,KAAK,YAAY,KAAK;AAChC;AACA,IAAO,gBAAQ,EAAC,SAAQ,4BAA2B,YAAW,+BAA8B,YAAW,+BAA8B,aAAY,gCAA+B,YAAW,+BAA8B,cAAa,gCAA+B,WAAU,6BAA4B,UAAS,6BAA4B,SAAQ,2BAA0B,UAAS,4BAA2B;;;ADoCpZ;AA5BF,IAAM,oBACL,2BAAQ,aAAAA,WAAiB,EAAE;AAE5B,IAAM,kBAAkB;AAMxB,IAAM,YAAQ,2BAA0C,SAAS,YAChE;AAAA,EACC;AAAA,EACA;AAAA,EACA,OAAO;AAAA,EACP;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACJ,GACA,KACC;AACD,QAAM,EAAE,sBAAsB,SAAS,QAAI,qEAA8B;AAAA,IACxE;AAAA,IACA,wBAAwB;AAAA,EACzB,CAAE;AACF,QAAM,gBAAY,6BAAc,CAAE,KAAK,QAAS,CAAE;AAElD,SACC,6CAAC,cAAAC,OAAQ,QAAR,EAAe,WACf;AAAA,gDAAC,cAAAA,OAAQ,UAAR,EAAiB,WAAY,cAAO,UAAW;AAAA,IAChD,4CAAC,iBACA;AAAA,MAAC,cAAAA,OAAQ;AAAA,MAAR;AAAA,QACA,KAAM;AAAA,QACN,eAAY,YAAAC;AAAA,UACX,cAAO;AAAA,UACP;AAAA,UACA,cAAQ,MAAO,IAAK,EAAG;AAAA,QACxB;AAAA,QACA,cAAe;AAAA,QACf;AAAA,QACE,GAAG;AAAA,QAEL,sDAAC,2CACE,UACH;AAAA;AAAA,IACD,GACD;AAAA,KACD;AAEF,CAAE;",
|
|
6
6
|
"names": ["themePrivateApis", "_Dialog", "clsx"]
|
|
7
7
|
}
|
package/build/dialog/title.cjs
CHANGED
|
@@ -30,13 +30,13 @@ var import_text = require("../text/index.cjs");
|
|
|
30
30
|
var import_context = require("./context.cjs");
|
|
31
31
|
|
|
32
32
|
// packages/ui/src/dialog/style.module.css
|
|
33
|
-
if (typeof document !== "undefined" && process.env.NODE_ENV !== "test" && !document.head.querySelector("style[data-wp-hash='
|
|
33
|
+
if (typeof document !== "undefined" && process.env.NODE_ENV !== "test" && !document.head.querySelector("style[data-wp-hash='7d3678184b']")) {
|
|
34
34
|
const style = document.createElement("style");
|
|
35
|
-
style.setAttribute("data-wp-hash", "
|
|
36
|
-
style.appendChild(document.createTextNode('@layer wp-ui-utilities, wp-ui-components, wp-ui-compositions, wp-ui-overrides
|
|
35
|
+
style.setAttribute("data-wp-hash", "7d3678184b");
|
|
36
|
+
style.appendChild(document.createTextNode('@layer wp-ui-utilities, wp-ui-components, wp-ui-compositions, wp-ui-overrides;[data-wpds-theme-provider-id]:has(>._8acaa98861620d4d__popup){display:block}@layer wp-ui-components{._074affe4c56b4f2f__backdrop{background-color:#00000059;inset:0;position:fixed;z-index:var(--wp-ui-dialog-z-index,initial);&[data-ending-style],&[data-starting-style]{opacity:0}&[data-open]{opacity:1}@media not (prefers-reduced-motion){transition:opacity .2s ease-out}}._8acaa98861620d4d__popup{background-color:var(--wpds-color-bg-surface-neutral-strong,#fff);border-radius:var(--wpds-border-radius-lg,8px);box-shadow:var(--wpds-elevation-lg,0 5px 15px 0 #00000014,0 15px 27px 0 #00000012,0 30px 36px 0 #0000000a,0 50px 43px 0 #00000005);box-sizing:border-box;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);left:50%;line-height:var(--wpds-typography-line-height-md,24px);max-height:calc(100vh - var(--wpds-dimension-padding-2xl, 24px)*2);min-width:var(--wpds-dimension-surface-width-sm,320px);overflow:auto;padding:var(--wpds-dimension-padding-2xl,24px);position:fixed;top:50%;transform:translate(-50%,-50%);width:calc(100vw - var(--wpds-dimension-padding-2xl, 24px)*2);z-index:var(--wp-ui-dialog-z-index,initial);&[data-ending-style],&[data-starting-style]{opacity:0;transform:translate(-50%,-50%) scale(.9)}@media not (prefers-reduced-motion){transition:opacity .2s cubic-bezier(1,0,.2,1),transform .2s cubic-bezier(1,0,.2,1);&[data-open]{transition:opacity .2s cubic-bezier(.29,0,0,1),transform .2s cubic-bezier(.29,0,0,1)}}@media (min-width:480px){min-width:var(--wpds-dimension-surface-width-md,400px)}&._7acfa67ebf092988__is-small{max-width:var(--wpds-dimension-surface-width-md,400px)}&._1eeeed880cb5769d__is-medium{max-width:var(--wpds-dimension-surface-width-lg,560px)}&._99f900b2267e22d0__is-large{max-width:var(--wpds-dimension-surface-width-2xl,960px)}&.b49f7ff9c06fe387__is-stretch{max-width:none}&.dcd4c2f5036cbf1a__is-full{height:100vh}}._76fb3b28fcbd45fc__header{align-items:center;display:flex;gap:var(--wpds-dimension-gap-sm,8px);margin-bottom:var(--wpds-dimension-gap-lg,16px)}.f636832002af749e__title{--_gcd-heading-margin:0 auto 0 0;margin-inline-end:auto;&:dir(rtl){--_gcd-heading-margin:0 0 0 auto}}._00eeb4f220cddae3__footer{align-items:center;display:flex;gap:var(--wpds-dimension-gap-sm,8px);justify-content:flex-end;margin-top:var(--wpds-dimension-gap-lg,16px);padding-top:var(--wpds-dimension-padding-lg,16px)}}'));
|
|
37
37
|
document.head.appendChild(style);
|
|
38
38
|
}
|
|
39
|
-
var style_default = { "
|
|
39
|
+
var style_default = { "popup": "_8acaa98861620d4d__popup", "backdrop": "_074affe4c56b4f2f__backdrop", "is-small": "_7acfa67ebf092988__is-small", "is-medium": "_1eeeed880cb5769d__is-medium", "is-large": "_99f900b2267e22d0__is-large", "is-stretch": "b49f7ff9c06fe387__is-stretch", "is-full": "dcd4c2f5036cbf1a__is-full", "header": "_76fb3b28fcbd45fc__header", "title": "f636832002af749e__title", "footer": "_00eeb4f220cddae3__footer" };
|
|
40
40
|
|
|
41
41
|
// packages/ui/src/dialog/title.tsx
|
|
42
42
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
@@ -45,8 +45,11 @@ var Title = (0, import_element.forwardRef)(
|
|
|
45
45
|
const validationContext = (0, import_context.useDialogValidationContext)();
|
|
46
46
|
const internalRef = (0, import_element.useRef)(null);
|
|
47
47
|
const mergedRef = (0, import_compose.useMergeRefs)([internalRef, forwardedRef]);
|
|
48
|
-
(0, import_element.
|
|
49
|
-
validationContext
|
|
48
|
+
(0, import_element.useEffect)(() => {
|
|
49
|
+
if (validationContext) {
|
|
50
|
+
return validationContext.registerTitle(internalRef.current);
|
|
51
|
+
}
|
|
52
|
+
return void 0;
|
|
50
53
|
}, [validationContext]);
|
|
51
54
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
52
55
|
import_text.Text,
|