@wordpress/ui 0.6.1-next.v.0 → 0.7.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/AGENTS.md +9 -0
- package/CHANGELOG.md +32 -1
- package/CLAUDE.md +1 -0
- package/README.md +13 -12
- package/build/badge/badge.cjs +37 -62
- package/build/badge/badge.cjs.map +4 -4
- package/build/button/button.cjs +3 -3
- package/build/button/button.cjs.map +2 -2
- package/build/dialog/action.cjs +46 -0
- package/build/dialog/action.cjs.map +7 -0
- package/build/dialog/close-icon.cjs +57 -0
- package/build/dialog/close-icon.cjs.map +7 -0
- package/build/dialog/context.cjs +76 -0
- package/build/dialog/context.cjs.map +7 -0
- package/build/dialog/footer.cjs +64 -0
- package/build/dialog/footer.cjs.map +7 -0
- package/build/dialog/header.cjs +64 -0
- package/build/dialog/header.cjs.map +7 -0
- package/build/dialog/index.cjs +52 -0
- package/build/dialog/index.cjs.map +7 -0
- package/build/dialog/popup.cjs +77 -0
- package/build/dialog/popup.cjs.map +7 -0
- package/build/dialog/root.cjs +35 -0
- package/build/dialog/root.cjs.map +7 -0
- package/build/dialog/title.cjs +76 -0
- package/build/dialog/title.cjs.map +7 -0
- package/build/dialog/trigger.cjs +38 -0
- package/build/dialog/trigger.cjs.map +7 -0
- package/build/dialog/types.cjs +19 -0
- package/build/dialog/types.cjs.map +7 -0
- package/build/form/primitives/field/root.cjs +1 -1
- package/build/form/primitives/field/root.cjs.map +1 -1
- package/build/form/primitives/fieldset/root.cjs +3 -3
- package/build/form/primitives/fieldset/root.cjs.map +2 -2
- package/build/form/primitives/index.cjs +5 -2
- package/build/form/primitives/index.cjs.map +2 -2
- package/build/form/primitives/input-layout/input-layout.cjs +3 -3
- package/build/form/primitives/input-layout/input-layout.cjs.map +2 -2
- package/build/form/primitives/input-layout/slot.cjs +3 -3
- package/build/form/primitives/input-layout/slot.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/form/primitives/select/trigger.cjs +3 -3
- package/build/form/primitives/select/trigger.cjs.map +2 -2
- package/build/{box → form/primitives/textarea}/index.cjs +7 -7
- package/build/form/primitives/textarea/index.cjs.map +7 -0
- package/build/form/primitives/textarea/textarea.cjs +90 -0
- package/build/form/primitives/textarea/textarea.cjs.map +7 -0
- package/build/form/primitives/textarea/types.cjs +19 -0
- package/build/form/primitives/textarea/types.cjs.map +7 -0
- package/build/icon-button/icon-button.cjs +104 -0
- package/build/icon-button/icon-button.cjs.map +7 -0
- package/build/icon-button/index.cjs +31 -0
- package/build/icon-button/index.cjs.map +7 -0
- package/build/icon-button/types.cjs +19 -0
- package/build/icon-button/types.cjs.map +7 -0
- package/build/index.cjs +8 -2
- package/build/index.cjs.map +2 -2
- package/build/tabs/index.cjs +40 -0
- package/build/tabs/index.cjs.map +7 -0
- package/build/tabs/list.cjs +145 -0
- package/build/tabs/list.cjs.map +7 -0
- package/build/tabs/panel.cjs +67 -0
- package/build/tabs/panel.cjs.map +7 -0
- package/build/tabs/root.cjs +38 -0
- package/build/tabs/root.cjs.map +7 -0
- package/build/tabs/tab.cjs +71 -0
- package/build/tabs/tab.cjs.map +7 -0
- package/build/{box → tabs}/types.cjs +1 -1
- package/build/tabs/types.cjs.map +7 -0
- package/build/tooltip/popup.cjs +3 -3
- package/build/tooltip/popup.cjs.map +2 -2
- package/build-module/badge/badge.mjs +27 -62
- package/build-module/badge/badge.mjs.map +3 -3
- package/build-module/button/button.mjs +3 -3
- package/build-module/button/button.mjs.map +2 -2
- package/build-module/dialog/action.mjs +21 -0
- package/build-module/dialog/action.mjs.map +7 -0
- package/build-module/dialog/close-icon.mjs +32 -0
- package/build-module/dialog/close-icon.mjs.map +7 -0
- package/build-module/dialog/context.mjs +57 -0
- package/build-module/dialog/context.mjs.map +7 -0
- package/build-module/dialog/footer.mjs +29 -0
- package/build-module/dialog/footer.mjs.map +7 -0
- package/build-module/dialog/header.mjs +29 -0
- package/build-module/dialog/header.mjs.map +7 -0
- package/build-module/dialog/index.mjs +20 -0
- package/build-module/dialog/index.mjs.map +7 -0
- package/build-module/dialog/popup.mjs +44 -0
- package/build-module/dialog/popup.mjs.map +7 -0
- package/build-module/dialog/root.mjs +10 -0
- package/build-module/dialog/root.mjs.map +7 -0
- package/build-module/dialog/title.mjs +41 -0
- package/build-module/dialog/title.mjs.map +7 -0
- package/build-module/dialog/trigger.mjs +13 -0
- package/build-module/dialog/trigger.mjs.map +7 -0
- package/build-module/form/primitives/field/root.mjs +1 -1
- package/build-module/form/primitives/field/root.mjs.map +1 -1
- package/build-module/form/primitives/fieldset/root.mjs +3 -3
- package/build-module/form/primitives/fieldset/root.mjs.map +2 -2
- package/build-module/form/primitives/index.mjs +3 -1
- package/build-module/form/primitives/index.mjs.map +2 -2
- package/build-module/form/primitives/input-layout/input-layout.mjs +3 -3
- package/build-module/form/primitives/input-layout/input-layout.mjs.map +2 -2
- package/build-module/form/primitives/input-layout/slot.mjs +3 -3
- package/build-module/form/primitives/input-layout/slot.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/form/primitives/select/trigger.mjs +3 -3
- package/build-module/form/primitives/select/trigger.mjs.map +2 -2
- package/build-module/form/primitives/textarea/index.mjs +6 -0
- package/build-module/form/primitives/textarea/index.mjs.map +7 -0
- package/build-module/form/primitives/textarea/textarea.mjs +55 -0
- package/build-module/form/primitives/textarea/textarea.mjs.map +7 -0
- package/build-module/form/primitives/textarea/types.mjs +1 -0
- package/build-module/form/primitives/textarea/types.mjs.map +7 -0
- package/build-module/icon-button/icon-button.mjs +69 -0
- package/build-module/icon-button/icon-button.mjs.map +7 -0
- package/build-module/icon-button/index.mjs +6 -0
- package/build-module/icon-button/index.mjs.map +7 -0
- package/build-module/icon-button/types.mjs +1 -0
- package/build-module/icon-button/types.mjs.map +7 -0
- package/build-module/index.mjs +5 -1
- package/build-module/index.mjs.map +2 -2
- package/build-module/tabs/index.mjs +12 -0
- package/build-module/tabs/index.mjs.map +7 -0
- package/build-module/tabs/list.mjs +110 -0
- package/build-module/tabs/list.mjs.map +7 -0
- package/build-module/tabs/panel.mjs +32 -0
- package/build-module/tabs/panel.mjs.map +7 -0
- package/build-module/tabs/root.mjs +13 -0
- package/build-module/tabs/root.mjs.map +7 -0
- package/build-module/tabs/tab.mjs +36 -0
- package/build-module/tabs/tab.mjs.map +7 -0
- package/build-module/tabs/types.mjs +1 -0
- package/build-module/tabs/types.mjs.map +7 -0
- package/build-module/tooltip/popup.mjs +3 -3
- package/build-module/tooltip/popup.mjs.map +2 -2
- package/build-types/badge/badge.d.ts +1 -2
- package/build-types/badge/badge.d.ts.map +1 -1
- package/build-types/button/stories/index.story.d.ts +1 -2
- package/build-types/button/stories/index.story.d.ts.map +1 -1
- package/build-types/dialog/action.d.ts +8 -0
- package/build-types/dialog/action.d.ts.map +1 -0
- package/build-types/dialog/close-icon.d.ts +8 -0
- package/build-types/dialog/close-icon.d.ts.map +1 -0
- package/build-types/dialog/context.d.ts +25 -0
- package/build-types/dialog/context.d.ts.map +1 -0
- package/build-types/dialog/footer.d.ts +8 -0
- package/build-types/dialog/footer.d.ts.map +1 -0
- package/build-types/dialog/header.d.ts +8 -0
- package/build-types/dialog/header.d.ts.map +1 -0
- package/build-types/dialog/index.d.ts +10 -0
- package/build-types/dialog/index.d.ts.map +1 -0
- package/build-types/dialog/popup.d.ts +8 -0
- package/build-types/dialog/popup.d.ts.map +1 -0
- package/build-types/dialog/root.d.ts +10 -0
- package/build-types/dialog/root.d.ts.map +1 -0
- package/build-types/dialog/stories/index.story.d.ts +18 -0
- package/build-types/dialog/stories/index.story.d.ts.map +1 -0
- package/build-types/dialog/test/index.test.d.ts +2 -0
- package/build-types/dialog/test/index.test.d.ts.map +1 -0
- package/build-types/dialog/title.d.ts +12 -0
- package/build-types/dialog/title.d.ts.map +1 -0
- package/build-types/dialog/trigger.d.ts +7 -0
- package/build-types/dialog/trigger.d.ts.map +1 -0
- package/build-types/dialog/types.d.ts +77 -0
- package/build-types/dialog/types.d.ts.map +1 -0
- package/build-types/form/primitives/field/stories/index.story.d.ts +0 -1
- package/build-types/form/primitives/field/stories/index.story.d.ts.map +1 -1
- package/build-types/form/primitives/index.d.ts +1 -0
- package/build-types/form/primitives/index.d.ts.map +1 -1
- package/build-types/form/primitives/input/input.d.ts +1 -1
- package/build-types/form/primitives/select/stories/index.story.d.ts +0 -1
- package/build-types/form/primitives/select/stories/index.story.d.ts.map +1 -1
- package/build-types/form/primitives/textarea/index.d.ts +2 -0
- package/build-types/form/primitives/textarea/index.d.ts.map +1 -0
- package/build-types/form/primitives/textarea/stories/index.story.d.ts +13 -0
- package/build-types/form/primitives/textarea/stories/index.story.d.ts.map +1 -0
- package/build-types/form/primitives/textarea/test/index.test.d.ts +2 -0
- package/build-types/form/primitives/textarea/test/index.test.d.ts.map +1 -0
- package/build-types/form/primitives/textarea/textarea.d.ts +4 -0
- package/build-types/form/primitives/textarea/textarea.d.ts.map +1 -0
- package/build-types/form/primitives/textarea/types.d.ts +11 -0
- package/build-types/form/primitives/textarea/types.d.ts.map +1 -0
- package/build-types/icon-button/icon-button.d.ts +13 -0
- package/build-types/icon-button/icon-button.d.ts.map +1 -0
- package/build-types/icon-button/index.d.ts +2 -0
- package/build-types/icon-button/index.d.ts.map +1 -0
- package/build-types/icon-button/stories/index.story.d.ts +19 -0
- package/build-types/icon-button/stories/index.story.d.ts.map +1 -0
- package/build-types/icon-button/test/index.test.d.ts +2 -0
- package/build-types/icon-button/test/index.test.d.ts.map +1 -0
- package/build-types/icon-button/types.d.ts +36 -0
- package/build-types/icon-button/types.d.ts.map +1 -0
- package/build-types/index.d.ts +3 -1
- package/build-types/index.d.ts.map +1 -1
- package/build-types/stack/stories/index.story.d.ts.map +1 -1
- package/build-types/tabs/index.d.ts +6 -0
- package/build-types/tabs/index.d.ts.map +1 -0
- package/build-types/tabs/list.d.ts +16 -0
- package/build-types/tabs/list.d.ts.map +1 -0
- package/build-types/tabs/panel.d.ts +15 -0
- package/build-types/tabs/panel.d.ts.map +1 -0
- package/build-types/tabs/root.d.ts +15 -0
- package/build-types/tabs/root.d.ts.map +1 -0
- package/build-types/tabs/stories/index.story.d.ts +13 -0
- package/build-types/tabs/stories/index.story.d.ts.map +1 -0
- package/build-types/tabs/tab.d.ts +15 -0
- package/build-types/tabs/tab.d.ts.map +1 -0
- package/build-types/tabs/test/index.test.d.ts +2 -0
- package/build-types/tabs/test/index.test.d.ts.map +1 -0
- package/build-types/tabs/types.d.ts +33 -0
- package/build-types/tabs/types.d.ts.map +1 -0
- package/package.json +12 -10
- package/src/badge/badge.tsx +19 -78
- package/src/badge/stories/choosing-intent.story.tsx +1 -1
- package/src/badge/style.module.css +48 -0
- package/src/button/stories/index.story.tsx +3 -16
- package/src/button/style.module.css +23 -12
- package/src/dialog/action.tsx +22 -0
- package/src/dialog/close-icon.tsx +32 -0
- package/src/dialog/context.tsx +113 -0
- package/src/dialog/footer.tsx +26 -0
- package/src/dialog/header.tsx +26 -0
- package/src/dialog/index.ts +10 -0
- package/src/dialog/popup.tsx +46 -0
- package/src/dialog/root.tsx +14 -0
- package/src/dialog/stories/index.story.tsx +177 -0
- package/src/dialog/style.module.css +114 -0
- package/src/dialog/test/index.test.tsx +309 -0
- package/src/dialog/title.tsx +39 -0
- package/src/dialog/trigger.tsx +14 -0
- package/src/dialog/types.ts +93 -0
- package/src/form/primitives/field/root.tsx +1 -1
- package/src/form/primitives/field/stories/index.story.tsx +0 -1
- package/src/form/primitives/fieldset/style.module.css +1 -1
- package/src/form/primitives/index.ts +1 -0
- package/src/form/primitives/input-layout/style.module.css +5 -8
- package/src/form/primitives/select/stories/index.story.tsx +0 -1
- package/src/form/primitives/select/test/index.test.tsx +0 -2
- package/src/form/primitives/textarea/index.ts +1 -0
- package/src/form/primitives/textarea/stories/index.story.tsx +40 -0
- package/src/form/primitives/textarea/style.module.css +22 -0
- package/src/form/primitives/textarea/test/index.test.tsx +143 -0
- package/src/form/primitives/textarea/textarea.tsx +51 -0
- package/src/form/primitives/textarea/types.ts +18 -0
- package/src/icon-button/icon-button.tsx +65 -0
- package/src/icon-button/index.ts +1 -0
- package/src/icon-button/stories/index.story.tsx +128 -0
- package/src/icon-button/style.module.css +16 -0
- package/src/icon-button/test/index.test.tsx +86 -0
- package/src/icon-button/types.ts +38 -0
- package/src/index.ts +3 -1
- package/src/stack/stories/index.story.tsx +4 -5
- package/src/tabs/index.ts +6 -0
- package/src/tabs/list.tsx +130 -0
- package/src/tabs/panel.tsx +23 -0
- package/src/tabs/root.tsx +15 -0
- package/src/tabs/stories/best-practices.mdx +85 -0
- package/src/tabs/stories/index.story.tsx +363 -0
- package/src/tabs/style.module.css +269 -0
- package/src/tabs/tab.tsx +29 -0
- package/src/tabs/test/index.test.tsx +2260 -0
- package/src/tabs/types.ts +36 -0
- package/src/tooltip/style.module.css +3 -3
- package/src/utils/css/item-popup.module.css +2 -2
- package/src/utils/css/select-trigger.module.css +1 -1
- package/build/box/box.cjs +0 -88
- package/build/box/box.cjs.map +0 -7
- package/build/box/index.cjs.map +0 -7
- package/build/box/types.cjs.map +0 -7
- package/build-module/box/box.mjs +0 -63
- package/build-module/box/box.mjs.map +0 -7
- package/build-module/box/index.mjs +0 -6
- package/build-module/box/index.mjs.map +0 -7
- package/build-types/box/box.d.ts +0 -7
- package/build-types/box/box.d.ts.map +0 -1
- package/build-types/box/index.d.ts +0 -2
- package/build-types/box/index.d.ts.map +0 -1
- package/build-types/box/stories/index.story.d.ts +0 -8
- package/build-types/box/stories/index.story.d.ts.map +0 -1
- package/build-types/box/test/box.test.d.ts +0 -2
- package/build-types/box/test/box.test.d.ts.map +0 -1
- package/build-types/box/types.d.ts +0 -46
- package/build-types/box/types.d.ts.map +0 -1
- package/src/box/box.tsx +0 -118
- package/src/box/index.ts +0 -1
- package/src/box/stories/index.story.tsx +0 -41
- package/src/box/test/box.test.tsx +0 -29
- package/src/box/types.ts +0 -61
- /package/build-module/{box → dialog}/types.mjs +0 -0
- /package/build-module/{box → dialog}/types.mjs.map +0 -0
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
|
|
30
|
+
// packages/ui/src/tabs/tab.tsx
|
|
31
|
+
var tab_exports = {};
|
|
32
|
+
__export(tab_exports, {
|
|
33
|
+
Tab: () => Tab
|
|
34
|
+
});
|
|
35
|
+
module.exports = __toCommonJS(tab_exports);
|
|
36
|
+
var import_element = require("@wordpress/element");
|
|
37
|
+
var import_clsx = __toESM(require("clsx"));
|
|
38
|
+
var import_tabs = require("@base-ui/react/tabs");
|
|
39
|
+
var import_icons = require("@wordpress/icons");
|
|
40
|
+
var import_icon = require("../icon/index.cjs");
|
|
41
|
+
|
|
42
|
+
// packages/ui/src/tabs/style.module.css
|
|
43
|
+
if (typeof document !== "undefined" && !document.head.querySelector("style[data-wp-hash='e0ff4b2c02']")) {
|
|
44
|
+
const style = document.createElement("style");
|
|
45
|
+
style.setAttribute("data-wp-hash", "e0ff4b2c02");
|
|
46
|
+
style.appendChild(document.createTextNode('@layer wp-ui-utilities, wp-ui-components, wp-ui-compositions, wp-ui-overrides;@layer wp-ui-components{._7313adbc8a112e90__tablist{--direction-factor:1;--direction-start:left;--direction-end:right;align-items:stretch;display:flex;overflow-inline:auto;overscroll-behavior-inline:none;position:relative;&:dir(rtl){--direction-factor:-1;--direction-start:right;--direction-end:left}&[data-orientation=horizontal]{--fade-width:4rem;--fade-gradient-base:#0000 0%,#000 var(--fade-width);--fade-gradient-composed:var(--fade-gradient-base),#000 60%,#0000 50%;width:fit-content;&._9f2ac729c68a735a__is-overflowing-first{mask-image:linear-gradient(to var(--direction-end),var(--fade-gradient-base))}&._81c799c1f3cdd261__is-overflowing-last{mask-image:linear-gradient(to var(--direction-start),var(--fade-gradient-base))}&._9f2ac729c68a735a__is-overflowing-first._81c799c1f3cdd261__is-overflowing-last{mask-image:linear-gradient(to right,var(--fade-gradient-composed)),linear-gradient(to left,var(--fade-gradient-composed))}&._59228b5227f38a99__is-minimal-variant{gap:1rem}}&[data-orientation=vertical]{flex-direction:column}}._1c37dcfaa1ad8cda__indicator{@media not (prefers-reduced-motion){transition-duration:.2s;transition-property:translate,width,height,border-radius,border-block;transition-timing-function:ease-out}outline:2px solid #0000;outline-offset:-1px;pointer-events:none;position:absolute;&[data-orientation=horizontal]{background-color:var(--wpds-color-stroke-interactive-neutral-strong);bottom:0;height:var(--wpds-border-width-focus);left:0;translate:var(--active-tab-left) 0;width:var(--active-tab-width);z-index:1}&[data-orientation=vertical]{background-color:var(--wpds-color-bg-interactive-neutral-weak-active);border-radius:var(--wpds-border-radius-sm);height:var(--active-tab-height);left:50%;top:0;translate:-50% var(--active-tab-top);width:100%;z-index:0}._7313adbc8a112e90__tablist[data-select-on-move=true]:has(:focus-visible)\n &[data-orientation=vertical]{border:var(--wpds-border-width-focus) solid var(--wpds-color-stroke-focus-brand);box-sizing:border-box}}.a5fd8814f195aa5e__tab{align-items:center;background:#0000;border:none;border-radius:0;box-shadow:none;color:var(--wpds-color-fg-interactive-neutral);cursor:pointer;display:flex;flex:1 0 auto;font-family:var(--wpds-font-family-body);font-size:var(--wpds-font-size-md);font-weight:400;line-height:1.2;outline:none;padding:0;position:relative;white-space:nowrap;z-index:1;&[data-disabled]{color:var(--wpds-color-fg-interactive-neutral-disabled);cursor:default;@media (forced-colors:active){color:GrayText}}&:not([data-disabled]):is(:hover,:focus-visible){color:var(--wpds-color-fg-interactive-neutral-active)}&:after{border-radius:var(--wpds-border-radius-sm);opacity:0;outline:var(--wpds-border-width-focus) solid var(--wpds-color-stroke-focus-brand);pointer-events:none;position:absolute;z-index:-1;@media not (prefers-reduced-motion){transition:opacity .1s linear}}&:focus-visible:after{opacity:1}[data-orientation=horizontal] &{height:48px;padding-inline:var(--wpds-dimension-padding-lg);scroll-margin:24px;&:after{content:"";inset:var(--wpds-dimension-padding-md)}}._59228b5227f38a99__is-minimal-variant[data-orientation=horizontal] &{padding-inline:0;&:after{inset-inline:round(up,var(--wpds-border-width-focus),1px)}}[data-orientation=vertical] &{min-height:40px;padding:var(--wpds-dimension-padding-sm) var(--wpds-dimension-padding-md)}[data-orientation=vertical][data-select-on-move=false] &:after{content:"";inset:var(--wpds-border-width-focus)}}._5dfc77e6edd345d4__tab-children{align-items:center;display:flex;flex-grow:1;[data-orientation=horizontal] &{justify-content:center}[data-orientation=vertical] &{justify-content:start}}._4a20e969d15e5ac1__tab-chevron{flex-shrink:0;margin-inline-end:calc(var(--wpds-dimension-gap-xs)*-1);opacity:0;[data-orientation=horizontal] &{display:none}[role=tab]:is([aria-selected=true],:focus-visible,:hover) &{opacity:1}@media not (prefers-reduced-motion){[data-select-on-move=true]\n [role=tab]:is([aria-selected=true])\n &{transition:opacity .15s linear .15s}}&:dir(rtl){rotate:180deg}}._49f4bf715948892a__tabpanel{&:focus{box-shadow:none;outline:none}&:focus-visible{box-shadow:0 0 0 var(--wpds-border-width-focus) var(--wpds-color-stroke-focus-brand);outline:2px solid #0000;outline-offset:0}}}'));
|
|
47
|
+
document.head.appendChild(style);
|
|
48
|
+
}
|
|
49
|
+
var style_default = { "tablist": "_7313adbc8a112e90__tablist", "is-overflowing-first": "_9f2ac729c68a735a__is-overflowing-first", "is-overflowing-last": "_81c799c1f3cdd261__is-overflowing-last", "is-minimal-variant": "_59228b5227f38a99__is-minimal-variant", "indicator": "_1c37dcfaa1ad8cda__indicator", "tab": "a5fd8814f195aa5e__tab", "tab-children": "_5dfc77e6edd345d4__tab-children", "tab-chevron": "_4a20e969d15e5ac1__tab-chevron", "tabpanel": "_49f4bf715948892a__tabpanel" };
|
|
50
|
+
|
|
51
|
+
// packages/ui/src/tabs/tab.tsx
|
|
52
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
53
|
+
var Tab = (0, import_element.forwardRef)(function Tab2({ className, children, ...otherProps }, forwardedRef) {
|
|
54
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
55
|
+
import_tabs.Tabs.Tab,
|
|
56
|
+
{
|
|
57
|
+
ref: forwardedRef,
|
|
58
|
+
className: (0, import_clsx.default)(style_default.tab, className),
|
|
59
|
+
...otherProps,
|
|
60
|
+
children: [
|
|
61
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: style_default["tab-children"], children }),
|
|
62
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icon.Icon, { icon: import_icons.chevronRight, className: style_default["tab-chevron"] })
|
|
63
|
+
]
|
|
64
|
+
}
|
|
65
|
+
);
|
|
66
|
+
});
|
|
67
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
68
|
+
0 && (module.exports = {
|
|
69
|
+
Tab
|
|
70
|
+
});
|
|
71
|
+
//# sourceMappingURL=tab.cjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/tabs/tab.tsx", "../../src/tabs/style.module.css"],
|
|
4
|
+
"sourcesContent": ["import { forwardRef } from '@wordpress/element';\nimport clsx from 'clsx';\nimport { Tabs as _Tabs } from '@base-ui/react/tabs';\nimport { chevronRight } from '@wordpress/icons';\nimport { Icon } from '../icon';\nimport styles from './style.module.css';\nimport type { TabProps } from './types';\n\n/**\n * An individual interactive tab button that toggles the corresponding panel.\n *\n * `Tabs` is a collection of React components that combine to render\n * an [ARIA-compliant tabs pattern](https://www.w3.org/WAI/ARIA/apg/patterns/tabs/).\n */\nexport const Tab = forwardRef< HTMLButtonElement, TabProps >( function Tab(\n\t{ className, children, ...otherProps },\n\tforwardedRef\n) {\n\treturn (\n\t\t<_Tabs.Tab\n\t\t\tref={ forwardedRef }\n\t\t\tclassName={ clsx( styles.tab, className ) }\n\t\t\t{ ...otherProps }\n\t\t>\n\t\t\t<span className={ styles[ 'tab-children' ] }>{ children }</span>\n\t\t\t<Icon icon={ chevronRight } className={ styles[ 'tab-chevron' ] } />\n\t\t</_Tabs.Tab>\n\t);\n} );\n", "if (typeof document !== 'undefined' && !document.head.querySelector(\"style[data-wp-hash='e0ff4b2c02']\")) {\n\tconst style = document.createElement(\"style\");\n\tstyle.setAttribute(\"data-wp-hash\", \"e0ff4b2c02\");\n\tstyle.appendChild(document.createTextNode(\"@layer wp-ui-utilities, wp-ui-components, wp-ui-compositions, wp-ui-overrides;@layer wp-ui-components{._7313adbc8a112e90__tablist{--direction-factor:1;--direction-start:left;--direction-end:right;align-items:stretch;display:flex;overflow-inline:auto;overscroll-behavior-inline:none;position:relative;&:dir(rtl){--direction-factor:-1;--direction-start:right;--direction-end:left}&[data-orientation=horizontal]{--fade-width:4rem;--fade-gradient-base:#0000 0%,#000 var(--fade-width);--fade-gradient-composed:var(--fade-gradient-base),#000 60%,#0000 50%;width:fit-content;&._9f2ac729c68a735a__is-overflowing-first{mask-image:linear-gradient(to var(--direction-end),var(--fade-gradient-base))}&._81c799c1f3cdd261__is-overflowing-last{mask-image:linear-gradient(to var(--direction-start),var(--fade-gradient-base))}&._9f2ac729c68a735a__is-overflowing-first._81c799c1f3cdd261__is-overflowing-last{mask-image:linear-gradient(to right,var(--fade-gradient-composed)),linear-gradient(to left,var(--fade-gradient-composed))}&._59228b5227f38a99__is-minimal-variant{gap:1rem}}&[data-orientation=vertical]{flex-direction:column}}._1c37dcfaa1ad8cda__indicator{@media not (prefers-reduced-motion){transition-duration:.2s;transition-property:translate,width,height,border-radius,border-block;transition-timing-function:ease-out}outline:2px solid #0000;outline-offset:-1px;pointer-events:none;position:absolute;&[data-orientation=horizontal]{background-color:var(--wpds-color-stroke-interactive-neutral-strong);bottom:0;height:var(--wpds-border-width-focus);left:0;translate:var(--active-tab-left) 0;width:var(--active-tab-width);z-index:1}&[data-orientation=vertical]{background-color:var(--wpds-color-bg-interactive-neutral-weak-active);border-radius:var(--wpds-border-radius-sm);height:var(--active-tab-height);left:50%;top:0;translate:-50% var(--active-tab-top);width:100%;z-index:0}._7313adbc8a112e90__tablist[data-select-on-move=true]:has(:focus-visible)\\n\\t\\t&[data-orientation=vertical]{border:var(--wpds-border-width-focus) solid var(--wpds-color-stroke-focus-brand);box-sizing:border-box}}.a5fd8814f195aa5e__tab{align-items:center;background:#0000;border:none;border-radius:0;box-shadow:none;color:var(--wpds-color-fg-interactive-neutral);cursor:pointer;display:flex;flex:1 0 auto;font-family:var(--wpds-font-family-body);font-size:var(--wpds-font-size-md);font-weight:400;line-height:1.2;outline:none;padding:0;position:relative;white-space:nowrap;z-index:1;&[data-disabled]{color:var(--wpds-color-fg-interactive-neutral-disabled);cursor:default;@media (forced-colors:active){color:GrayText}}&:not([data-disabled]):is(:hover,:focus-visible){color:var(--wpds-color-fg-interactive-neutral-active)}&:after{border-radius:var(--wpds-border-radius-sm);opacity:0;outline:var(--wpds-border-width-focus) solid var(--wpds-color-stroke-focus-brand);pointer-events:none;position:absolute;z-index:-1;@media not (prefers-reduced-motion){transition:opacity .1s linear}}&:focus-visible:after{opacity:1}[data-orientation=horizontal] &{height:48px;padding-inline:var(--wpds-dimension-padding-lg);scroll-margin:24px;&:after{content:\\\"\\\";inset:var(--wpds-dimension-padding-md)}}._59228b5227f38a99__is-minimal-variant[data-orientation=horizontal] &{padding-inline:0;&:after{inset-inline:round(up,var(--wpds-border-width-focus),1px)}}[data-orientation=vertical] &{min-height:40px;padding:var(--wpds-dimension-padding-sm) var(--wpds-dimension-padding-md)}[data-orientation=vertical][data-select-on-move=false] &:after{content:\\\"\\\";inset:var(--wpds-border-width-focus)}}._5dfc77e6edd345d4__tab-children{align-items:center;display:flex;flex-grow:1;[data-orientation=horizontal] &{justify-content:center}[data-orientation=vertical] &{justify-content:start}}._4a20e969d15e5ac1__tab-chevron{flex-shrink:0;margin-inline-end:calc(var(--wpds-dimension-gap-xs)*-1);opacity:0;[data-orientation=horizontal] &{display:none}[role=tab]:is([aria-selected=true],:focus-visible,:hover) &{opacity:1}@media not (prefers-reduced-motion){[data-select-on-move=true]\\n\\t\\t\\t[role=tab]:is([aria-selected=true])\\n\\t\\t\\t&{transition:opacity .15s linear .15s}}&:dir(rtl){rotate:180deg}}._49f4bf715948892a__tabpanel{&:focus{box-shadow:none;outline:none}&:focus-visible{box-shadow:0 0 0 var(--wpds-border-width-focus) var(--wpds-color-stroke-focus-brand);outline:2px solid #0000;outline-offset:0}}}\"));\n\tdocument.head.appendChild(style);\n}\nexport default {\"tablist\":\"_7313adbc8a112e90__tablist\",\"is-overflowing-first\":\"_9f2ac729c68a735a__is-overflowing-first\",\"is-overflowing-last\":\"_81c799c1f3cdd261__is-overflowing-last\",\"is-minimal-variant\":\"_59228b5227f38a99__is-minimal-variant\",\"indicator\":\"_1c37dcfaa1ad8cda__indicator\",\"tab\":\"a5fd8814f195aa5e__tab\",\"tab-children\":\"_5dfc77e6edd345d4__tab-children\",\"tab-chevron\":\"_4a20e969d15e5ac1__tab-chevron\",\"tabpanel\":\"_49f4bf715948892a__tabpanel\"};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qBAA2B;AAC3B,kBAAiB;AACjB,kBAA8B;AAC9B,mBAA6B;AAC7B,kBAAqB;;;ACJrB,IAAI,OAAO,aAAa,eAAe,CAAC,SAAS,KAAK,cAAc,kCAAkC,GAAG;AACxG,QAAM,QAAQ,SAAS,cAAc,OAAO;AAC5C,QAAM,aAAa,gBAAgB,YAAY;AAC/C,QAAM,YAAY,SAAS,eAAe,wuIAAovI,CAAC;AAC/xI,WAAS,KAAK,YAAY,KAAK;AAChC;AACA,IAAO,gBAAQ,EAAC,WAAU,8BAA6B,wBAAuB,2CAA0C,uBAAsB,0CAAyC,sBAAqB,yCAAwC,aAAY,gCAA+B,OAAM,yBAAwB,gBAAe,mCAAkC,eAAc,kCAAiC,YAAW,8BAA6B;;;ADanc;AALK,IAAM,UAAM,2BAA2C,SAASA,KACtE,EAAE,WAAW,UAAU,GAAG,WAAW,GACrC,cACC;AACD,SACC;AAAA,IAAC,YAAAC,KAAM;AAAA,IAAN;AAAA,MACA,KAAM;AAAA,MACN,eAAY,YAAAC,SAAM,cAAO,KAAK,SAAU;AAAA,MACtC,GAAG;AAAA,MAEL;AAAA,oDAAC,UAAK,WAAY,cAAQ,cAAe,GAAM,UAAU;AAAA,QACzD,4CAAC,oBAAK,MAAO,2BAAe,WAAY,cAAQ,aAAc,GAAI;AAAA;AAAA;AAAA,EACnE;AAEF,CAAE;",
|
|
6
|
+
"names": ["Tab", "_Tabs", "clsx"]
|
|
7
|
+
}
|
|
@@ -13,7 +13,7 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
13
13
|
};
|
|
14
14
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
15
15
|
|
|
16
|
-
// packages/ui/src/
|
|
16
|
+
// packages/ui/src/tabs/types.ts
|
|
17
17
|
var types_exports = {};
|
|
18
18
|
module.exports = __toCommonJS(types_exports);
|
|
19
19
|
//# sourceMappingURL=types.cjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/tabs/types.ts"],
|
|
4
|
+
"sourcesContent": ["import type { ReactNode } from 'react';\nimport type { Tabs as _Tabs } from '@base-ui/react/tabs';\nimport type { ComponentProps } from '../utils/types';\n\nexport type TabRootProps = ComponentProps< typeof _Tabs.Root > & {\n\t/**\n\t * The content to be rendered inside the component.\n\t */\n\tchildren?: ReactNode;\n};\n\nexport type TabListProps = ComponentProps< typeof _Tabs.List > & {\n\t/**\n\t * The content to be rendered inside the component.\n\t */\n\tchildren?: ReactNode;\n\t/**\n\t * The visual variant of the tab list.\n\t * @default \"default\"\n\t */\n\tvariant?: 'minimal' | 'default';\n};\n\nexport type TabProps = ComponentProps< typeof _Tabs.Tab > & {\n\t/**\n\t * The content to be rendered inside the component.\n\t */\n\tchildren?: ReactNode;\n};\n\nexport type TabPanelProps = ComponentProps< typeof _Tabs.Panel > & {\n\t/**\n\t * The content to be rendered inside the component.\n\t */\n\tchildren?: ReactNode;\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;AAAA;AAAA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/build/tooltip/popup.cjs
CHANGED
|
@@ -49,10 +49,10 @@ if (typeof document !== "undefined" && !document.head.querySelector("style[data-
|
|
|
49
49
|
var resets_default = { "box-sizing": "_336cd3e4e743482f__box-sizing" };
|
|
50
50
|
|
|
51
51
|
// packages/ui/src/tooltip/style.module.css
|
|
52
|
-
if (typeof document !== "undefined" && !document.head.querySelector("style[data-wp-hash='
|
|
52
|
+
if (typeof document !== "undefined" && !document.head.querySelector("style[data-wp-hash='7fd277f3a7']")) {
|
|
53
53
|
const style = document.createElement("style");
|
|
54
|
-
style.setAttribute("data-wp-hash", "
|
|
55
|
-
style.appendChild(document.createTextNode("@layer wp-ui-utilities, wp-ui-components, wp-ui-compositions, wp-ui-overrides;@layer wp-ui-components{._480b748dd3510e64__positioner{z-index:var(--wp-ui-tooltip-z-index,initial)}._50096b232db7709d__popup{background-color:var(--wpds-color-bg-surface-neutral-strong);border-radius:var(--wpds-border-radius-sm);box-shadow:var(--wpds-elevation-
|
|
54
|
+
style.setAttribute("data-wp-hash", "7fd277f3a7");
|
|
55
|
+
style.appendChild(document.createTextNode("@layer wp-ui-utilities, wp-ui-components, wp-ui-compositions, wp-ui-overrides;@layer wp-ui-components{._480b748dd3510e64__positioner{z-index:var(--wp-ui-tooltip-z-index,initial)}._50096b232db7709d__popup{background-color:var(--wpds-color-bg-surface-neutral-strong);border-radius:var(--wpds-border-radius-sm);box-shadow:var(--wpds-elevation-sm);color:var(--wpds-color-fg-content-neutral);font-family:var(--wpds-font-family-body);font-size:var(--wpds-font-size-sm);line-height:1.4;padding:var(--wpds-dimension-padding-xs) var(--wpds-dimension-padding-sm)}}"));
|
|
56
56
|
document.head.appendChild(style);
|
|
57
57
|
}
|
|
58
58
|
var style_default = { "positioner": "_480b748dd3510e64__positioner", "popup": "_50096b232db7709d__popup" };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/tooltip/popup.tsx", "../../src/utils/css/resets.module.css", "../../src/tooltip/style.module.css"],
|
|
4
|
-
"sourcesContent": ["import clsx from 'clsx';\nimport { Tooltip } from '@base-ui/react/tooltip';\nimport { forwardRef } from '@wordpress/element';\nimport {\n\ttype ThemeProvider as ThemeProviderType,\n\tprivateApis as themePrivateApis,\n} from '@wordpress/theme';\nimport type { PopupProps } from './types';\nimport { unlock } from '../lock-unlock';\nimport resetStyles from '../utils/css/resets.module.css';\nimport styles from './style.module.css';\n\nconst ThemeProvider: typeof ThemeProviderType =\n\tunlock( themePrivateApis ).ThemeProvider;\n\nconst Popup = forwardRef< HTMLDivElement, PopupProps >( function TooltipPopup(\n\t{\n\t\talign = 'center',\n\t\tside = 'bottom',\n\t\tsideOffset = 4,\n\t\tchildren,\n\t\tclassName,\n\t\tstyle,\n\t\t...props\n\t},\n\tref\n) {\n\treturn (\n\t\t<Tooltip.Portal>\n\t\t\t<Tooltip.Positioner\n\t\t\t\talign={ align }\n\t\t\t\tside={ side }\n\t\t\t\tsideOffset={ sideOffset }\n\t\t\t\tstyle={ style }\n\t\t\t\tclassName={ clsx(\n\t\t\t\t\tresetStyles[ 'box-sizing' ],\n\t\t\t\t\tclassName,\n\t\t\t\t\tstyles.positioner\n\t\t\t\t) }\n\t\t\t>\n\t\t\t\t{ /* This should ideally use whatever dark color makes sense,\n\t\t\t\tand not be hardcoded to #1e1e1e. The solutions would be to:\n\t\t\t\t - review the design of the tooltip, in case we want to stop\n\t\t\t\t hardcoding it to a dark background\n\t\t\t\t - create new semantic tokens as needed (aliasing either the \"inverted\n\t\t\t\t\t bg\" or \"perma-dark bg\" private tokens) and have Tooltip.Popup use\n\t\t\t\t them;\n\t\t\t\t - remove the hardcoded `bg` setting from the `ThemeProvider` below\n\t\t\t\t\t*/ }\n\t\t\t\t<ThemeProvider color={ { bg: '#1e1e1e' } }>\n\t\t\t\t\t<Tooltip.Popup\n\t\t\t\t\t\tref={ ref }\n\t\t\t\t\t\tclassName={ styles.popup }\n\t\t\t\t\t\t{ ...props }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ children }\n\t\t\t\t\t</Tooltip.Popup>\n\t\t\t\t</ThemeProvider>\n\t\t\t</Tooltip.Positioner>\n\t\t</Tooltip.Portal>\n\t);\n} );\n\nexport { Popup };\n", "if (typeof document !== 'undefined' && !document.head.querySelector(\"style[data-wp-hash='671ebfc62d']\")) {\n\tconst style = document.createElement(\"style\");\n\tstyle.setAttribute(\"data-wp-hash\", \"671ebfc62d\");\n\tstyle.appendChild(document.createTextNode(\"@layer wp-ui-utilities, wp-ui-components, wp-ui-compositions, wp-ui-overrides;@layer wp-ui-utilities{._336cd3e4e743482f__box-sizing{box-sizing:border-box;*,:after,:before{box-sizing:inherit}}}\"));\n\tdocument.head.appendChild(style);\n}\nexport default {\"box-sizing\":\"_336cd3e4e743482f__box-sizing\"};\n", "if (typeof document !== 'undefined' && !document.head.querySelector(\"style[data-wp-hash='
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAiB;AACjB,qBAAwB;AACxB,qBAA2B;AAC3B,mBAGO;AAEP,yBAAuB;;;ACRvB,IAAI,OAAO,aAAa,eAAe,CAAC,SAAS,KAAK,cAAc,kCAAkC,GAAG;AACxG,QAAM,QAAQ,SAAS,cAAc,OAAO;AAC5C,QAAM,aAAa,gBAAgB,YAAY;AAC/C,QAAM,YAAY,SAAS,eAAe,kMAAkM,CAAC;AAC7O,WAAS,KAAK,YAAY,KAAK;AAChC;AACA,IAAO,iBAAQ,EAAC,cAAa,gCAA+B;;;ACN5D,IAAI,OAAO,aAAa,eAAe,CAAC,SAAS,KAAK,cAAc,kCAAkC,GAAG;AACxG,QAAM,QAAQ,SAAS,cAAc,OAAO;AAC5C,QAAM,aAAa,gBAAgB,YAAY;AAC/C,QAAM,YAAY,SAAS,eAAe,
|
|
4
|
+
"sourcesContent": ["import clsx from 'clsx';\nimport { Tooltip } from '@base-ui/react/tooltip';\nimport { forwardRef } from '@wordpress/element';\nimport {\n\ttype ThemeProvider as ThemeProviderType,\n\tprivateApis as themePrivateApis,\n} from '@wordpress/theme';\nimport type { PopupProps } from './types';\nimport { unlock } from '../lock-unlock';\nimport resetStyles from '../utils/css/resets.module.css';\nimport styles from './style.module.css';\n\nconst ThemeProvider: typeof ThemeProviderType =\n\tunlock( themePrivateApis ).ThemeProvider;\n\nconst Popup = forwardRef< HTMLDivElement, PopupProps >( function TooltipPopup(\n\t{\n\t\talign = 'center',\n\t\tside = 'bottom',\n\t\tsideOffset = 4,\n\t\tchildren,\n\t\tclassName,\n\t\tstyle,\n\t\t...props\n\t},\n\tref\n) {\n\treturn (\n\t\t<Tooltip.Portal>\n\t\t\t<Tooltip.Positioner\n\t\t\t\talign={ align }\n\t\t\t\tside={ side }\n\t\t\t\tsideOffset={ sideOffset }\n\t\t\t\tstyle={ style }\n\t\t\t\tclassName={ clsx(\n\t\t\t\t\tresetStyles[ 'box-sizing' ],\n\t\t\t\t\tclassName,\n\t\t\t\t\tstyles.positioner\n\t\t\t\t) }\n\t\t\t>\n\t\t\t\t{ /* This should ideally use whatever dark color makes sense,\n\t\t\t\tand not be hardcoded to #1e1e1e. The solutions would be to:\n\t\t\t\t - review the design of the tooltip, in case we want to stop\n\t\t\t\t hardcoding it to a dark background\n\t\t\t\t - create new semantic tokens as needed (aliasing either the \"inverted\n\t\t\t\t\t bg\" or \"perma-dark bg\" private tokens) and have Tooltip.Popup use\n\t\t\t\t them;\n\t\t\t\t - remove the hardcoded `bg` setting from the `ThemeProvider` below\n\t\t\t\t\t*/ }\n\t\t\t\t<ThemeProvider color={ { bg: '#1e1e1e' } }>\n\t\t\t\t\t<Tooltip.Popup\n\t\t\t\t\t\tref={ ref }\n\t\t\t\t\t\tclassName={ styles.popup }\n\t\t\t\t\t\t{ ...props }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ children }\n\t\t\t\t\t</Tooltip.Popup>\n\t\t\t\t</ThemeProvider>\n\t\t\t</Tooltip.Positioner>\n\t\t</Tooltip.Portal>\n\t);\n} );\n\nexport { Popup };\n", "if (typeof document !== 'undefined' && !document.head.querySelector(\"style[data-wp-hash='671ebfc62d']\")) {\n\tconst style = document.createElement(\"style\");\n\tstyle.setAttribute(\"data-wp-hash\", \"671ebfc62d\");\n\tstyle.appendChild(document.createTextNode(\"@layer wp-ui-utilities, wp-ui-components, wp-ui-compositions, wp-ui-overrides;@layer wp-ui-utilities{._336cd3e4e743482f__box-sizing{box-sizing:border-box;*,:after,:before{box-sizing:inherit}}}\"));\n\tdocument.head.appendChild(style);\n}\nexport default {\"box-sizing\":\"_336cd3e4e743482f__box-sizing\"};\n", "if (typeof document !== 'undefined' && !document.head.querySelector(\"style[data-wp-hash='7fd277f3a7']\")) {\n\tconst style = document.createElement(\"style\");\n\tstyle.setAttribute(\"data-wp-hash\", \"7fd277f3a7\");\n\tstyle.appendChild(document.createTextNode(\"@layer wp-ui-utilities, wp-ui-components, wp-ui-compositions, wp-ui-overrides;@layer wp-ui-components{._480b748dd3510e64__positioner{z-index:var(--wp-ui-tooltip-z-index,initial)}._50096b232db7709d__popup{background-color:var(--wpds-color-bg-surface-neutral-strong);border-radius:var(--wpds-border-radius-sm);box-shadow:var(--wpds-elevation-sm);color:var(--wpds-color-fg-content-neutral);font-family:var(--wpds-font-family-body);font-size:var(--wpds-font-size-sm);line-height:1.4;padding:var(--wpds-dimension-padding-xs) var(--wpds-dimension-padding-sm)}}\"));\n\tdocument.head.appendChild(style);\n}\nexport default {\"positioner\":\"_480b748dd3510e64__positioner\",\"popup\":\"_50096b232db7709d__popup\"};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAiB;AACjB,qBAAwB;AACxB,qBAA2B;AAC3B,mBAGO;AAEP,yBAAuB;;;ACRvB,IAAI,OAAO,aAAa,eAAe,CAAC,SAAS,KAAK,cAAc,kCAAkC,GAAG;AACxG,QAAM,QAAQ,SAAS,cAAc,OAAO;AAC5C,QAAM,aAAa,gBAAgB,YAAY;AAC/C,QAAM,YAAY,SAAS,eAAe,kMAAkM,CAAC;AAC7O,WAAS,KAAK,YAAY,KAAK;AAChC;AACA,IAAO,iBAAQ,EAAC,cAAa,gCAA+B;;;ACN5D,IAAI,OAAO,aAAa,eAAe,CAAC,SAAS,KAAK,cAAc,kCAAkC,GAAG;AACxG,QAAM,QAAQ,SAAS,cAAc,OAAO;AAC5C,QAAM,aAAa,gBAAgB,YAAY;AAC/C,QAAM,YAAY,SAAS,eAAe,4iBAA4iB,CAAC;AACvlB,WAAS,KAAK,YAAY,KAAK;AAChC;AACA,IAAO,gBAAQ,EAAC,cAAa,iCAAgC,SAAQ,2BAA0B;;;AF4C1F;AAtCL,IAAM,oBACL,2BAAQ,aAAAA,WAAiB,EAAE;AAE5B,IAAM,YAAQ,2BAA0C,SAAS,aAChE;AAAA,EACC,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,aAAa;AAAA,EACb;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACJ,GACA,KACC;AACD,SACC,4CAAC,uBAAQ,QAAR,EACA;AAAA,IAAC,uBAAQ;AAAA,IAAR;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,eAAY,YAAAC;AAAA,QACX,eAAa,YAAa;AAAA,QAC1B;AAAA,QACA,cAAO;AAAA,MACR;AAAA,MAWA,sDAAC,iBAAc,OAAQ,EAAE,IAAI,UAAU,GACtC;AAAA,QAAC,uBAAQ;AAAA,QAAR;AAAA,UACA;AAAA,UACA,WAAY,cAAO;AAAA,UACjB,GAAG;AAAA,UAEH;AAAA;AAAA,MACH,GACD;AAAA;AAAA,EACD,GACD;AAEF,CAAE;",
|
|
6
6
|
"names": ["themePrivateApis", "clsx"]
|
|
7
7
|
}
|
|
@@ -1,68 +1,33 @@
|
|
|
1
1
|
// packages/ui/src/badge/badge.tsx
|
|
2
|
+
import { useRender, mergeProps } from "@base-ui/react";
|
|
3
|
+
import clsx from "clsx";
|
|
2
4
|
import { forwardRef } from "@wordpress/element";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
backgroundColor: "success",
|
|
26
|
-
color: "success"
|
|
27
|
-
};
|
|
28
|
-
case "informational":
|
|
29
|
-
return {
|
|
30
|
-
backgroundColor: "info",
|
|
31
|
-
color: "info"
|
|
32
|
-
};
|
|
33
|
-
case "draft":
|
|
34
|
-
return {
|
|
35
|
-
backgroundColor: "neutral-weak",
|
|
36
|
-
color: "neutral"
|
|
37
|
-
};
|
|
38
|
-
case "none":
|
|
39
|
-
default:
|
|
40
|
-
return {
|
|
41
|
-
backgroundColor: "neutral",
|
|
42
|
-
color: "neutral-weak"
|
|
43
|
-
};
|
|
44
|
-
}
|
|
45
|
-
};
|
|
46
|
-
var Badge = forwardRef(function Badge2({ children, intent = "none", render = DEFAULT_RENDER, ...props }, ref) {
|
|
47
|
-
const intentStyles = getIntentStyles(intent);
|
|
48
|
-
return /* @__PURE__ */ jsx(
|
|
49
|
-
Box,
|
|
50
|
-
{
|
|
51
|
-
...intentStyles,
|
|
52
|
-
padding: { inline: "xs", block: "2xs" },
|
|
53
|
-
borderRadius: "lg",
|
|
54
|
-
render,
|
|
55
|
-
style: {
|
|
56
|
-
fontFamily: "var(--wpds-font-family-body)",
|
|
57
|
-
fontSize: "var(--wpds-font-size-sm)",
|
|
58
|
-
fontWeight: "var(--wpds-font-weight-regular)",
|
|
59
|
-
lineHeight: "var(--wpds-font-line-height-xs)",
|
|
60
|
-
...props.style
|
|
61
|
-
},
|
|
62
|
-
ref,
|
|
5
|
+
|
|
6
|
+
// packages/ui/src/badge/style.module.css
|
|
7
|
+
if (typeof document !== "undefined" && !document.head.querySelector("style[data-wp-hash='244b5c59c0']")) {
|
|
8
|
+
const style = document.createElement("style");
|
|
9
|
+
style.setAttribute("data-wp-hash", "244b5c59c0");
|
|
10
|
+
style.appendChild(document.createTextNode("@layer wp-ui-utilities, wp-ui-components, wp-ui-compositions, wp-ui-overrides;@layer wp-ui-components{._96e6251aad1a6136__badge{border-radius:var(--wpds-border-radius-lg);font-family:var(--wpds-font-family-body);font-size:var(--wpds-font-size-sm);font-weight:var(--wpds-font-weight-regular);line-height:var(--wpds-font-line-height-xs);padding-block:var(--wpds-dimension-padding-xs);padding-inline:var(--wpds-dimension-padding-sm)}._99f7158cb520f750__is-high-intent{background-color:var(--wpds-color-bg-surface-error);color:var(--wpds-color-fg-content-error)}.c20ebef2365bc8b7__is-medium-intent{background-color:var(--wpds-color-bg-surface-warning);color:var(--wpds-color-fg-content-warning)}._365e1626c6202e52__is-low-intent{background-color:var(--wpds-color-bg-surface-caution);color:var(--wpds-color-fg-content-caution)}._33f8198127ddf4ef__is-stable-intent{background-color:var(--wpds-color-bg-surface-success);color:var(--wpds-color-fg-content-success)}._04c1aca8fc449412__is-informational-intent{background-color:var(--wpds-color-bg-surface-info);color:var(--wpds-color-fg-content-info)}._90726e69d495ec19__is-draft-intent{background-color:var(--wpds-color-bg-surface-neutral-weak);color:var(--wpds-color-fg-content-neutral)}._898f4a544993bd39__is-none-intent{background-color:var(--wpds-color-bg-surface-neutral);color:var(--wpds-color-fg-content-neutral-weak)}}"));
|
|
11
|
+
document.head.appendChild(style);
|
|
12
|
+
}
|
|
13
|
+
var style_default = { "badge": "_96e6251aad1a6136__badge", "is-high-intent": "_99f7158cb520f750__is-high-intent", "is-medium-intent": "c20ebef2365bc8b7__is-medium-intent", "is-low-intent": "_365e1626c6202e52__is-low-intent", "is-stable-intent": "_33f8198127ddf4ef__is-stable-intent", "is-informational-intent": "_04c1aca8fc449412__is-informational-intent", "is-draft-intent": "_90726e69d495ec19__is-draft-intent", "is-none-intent": "_898f4a544993bd39__is-none-intent" };
|
|
14
|
+
|
|
15
|
+
// packages/ui/src/badge/badge.tsx
|
|
16
|
+
var Badge = forwardRef(function Badge2({ children, intent = "none", render, className, ...props }, ref) {
|
|
17
|
+
const element = useRender({
|
|
18
|
+
render,
|
|
19
|
+
defaultTagName: "span",
|
|
20
|
+
ref,
|
|
21
|
+
props: mergeProps(props, {
|
|
22
|
+
className: clsx(
|
|
23
|
+
style_default.badge,
|
|
24
|
+
style_default[`is-${intent}-intent`],
|
|
25
|
+
className
|
|
26
|
+
),
|
|
63
27
|
children
|
|
64
|
-
}
|
|
65
|
-
);
|
|
28
|
+
})
|
|
29
|
+
});
|
|
30
|
+
return element;
|
|
66
31
|
});
|
|
67
32
|
export {
|
|
68
33
|
Badge
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../src/badge/badge.tsx"],
|
|
4
|
-
"sourcesContent": ["import {
|
|
5
|
-
"mappings": ";AAAA,SAAS,
|
|
3
|
+
"sources": ["../../src/badge/badge.tsx", "../../src/badge/style.module.css"],
|
|
4
|
+
"sourcesContent": ["import { useRender, mergeProps } from '@base-ui/react';\nimport clsx from 'clsx';\nimport { forwardRef } from '@wordpress/element';\nimport { type BadgeProps } from './types';\nimport styles from './style.module.css';\n\n/**\n * A badge component for displaying labels with semantic intent.\n */\nexport const Badge = forwardRef< HTMLSpanElement, BadgeProps >( function Badge(\n\t{ children, intent = 'none', render, className, ...props },\n\tref\n) {\n\tconst element = useRender( {\n\t\trender,\n\t\tdefaultTagName: 'span',\n\t\tref,\n\t\tprops: mergeProps< 'span' >( props, {\n\t\t\tclassName: clsx(\n\t\t\t\tstyles.badge,\n\t\t\t\tstyles[ `is-${ intent }-intent` ],\n\t\t\t\tclassName\n\t\t\t),\n\t\t\tchildren,\n\t\t} ),\n\t} );\n\n\treturn element;\n} );\n", "if (typeof document !== 'undefined' && !document.head.querySelector(\"style[data-wp-hash='244b5c59c0']\")) {\n\tconst style = document.createElement(\"style\");\n\tstyle.setAttribute(\"data-wp-hash\", \"244b5c59c0\");\n\tstyle.appendChild(document.createTextNode(\"@layer wp-ui-utilities, wp-ui-components, wp-ui-compositions, wp-ui-overrides;@layer wp-ui-components{._96e6251aad1a6136__badge{border-radius:var(--wpds-border-radius-lg);font-family:var(--wpds-font-family-body);font-size:var(--wpds-font-size-sm);font-weight:var(--wpds-font-weight-regular);line-height:var(--wpds-font-line-height-xs);padding-block:var(--wpds-dimension-padding-xs);padding-inline:var(--wpds-dimension-padding-sm)}._99f7158cb520f750__is-high-intent{background-color:var(--wpds-color-bg-surface-error);color:var(--wpds-color-fg-content-error)}.c20ebef2365bc8b7__is-medium-intent{background-color:var(--wpds-color-bg-surface-warning);color:var(--wpds-color-fg-content-warning)}._365e1626c6202e52__is-low-intent{background-color:var(--wpds-color-bg-surface-caution);color:var(--wpds-color-fg-content-caution)}._33f8198127ddf4ef__is-stable-intent{background-color:var(--wpds-color-bg-surface-success);color:var(--wpds-color-fg-content-success)}._04c1aca8fc449412__is-informational-intent{background-color:var(--wpds-color-bg-surface-info);color:var(--wpds-color-fg-content-info)}._90726e69d495ec19__is-draft-intent{background-color:var(--wpds-color-bg-surface-neutral-weak);color:var(--wpds-color-fg-content-neutral)}._898f4a544993bd39__is-none-intent{background-color:var(--wpds-color-bg-surface-neutral);color:var(--wpds-color-fg-content-neutral-weak)}}\"));\n\tdocument.head.appendChild(style);\n}\nexport default {\"badge\":\"_96e6251aad1a6136__badge\",\"is-high-intent\":\"_99f7158cb520f750__is-high-intent\",\"is-medium-intent\":\"c20ebef2365bc8b7__is-medium-intent\",\"is-low-intent\":\"_365e1626c6202e52__is-low-intent\",\"is-stable-intent\":\"_33f8198127ddf4ef__is-stable-intent\",\"is-informational-intent\":\"_04c1aca8fc449412__is-informational-intent\",\"is-draft-intent\":\"_90726e69d495ec19__is-draft-intent\",\"is-none-intent\":\"_898f4a544993bd39__is-none-intent\"};\n"],
|
|
5
|
+
"mappings": ";AAAA,SAAS,WAAW,kBAAkB;AACtC,OAAO,UAAU;AACjB,SAAS,kBAAkB;;;ACF3B,IAAI,OAAO,aAAa,eAAe,CAAC,SAAS,KAAK,cAAc,kCAAkC,GAAG;AACxG,QAAM,QAAQ,SAAS,cAAc,OAAO;AAC5C,QAAM,aAAa,gBAAgB,YAAY;AAC/C,QAAM,YAAY,SAAS,eAAe,y1CAAy1C,CAAC;AACp4C,WAAS,KAAK,YAAY,KAAK;AAChC;AACA,IAAO,gBAAQ,EAAC,SAAQ,4BAA2B,kBAAiB,qCAAoC,oBAAmB,sCAAqC,iBAAgB,oCAAmC,oBAAmB,uCAAsC,2BAA0B,8CAA6C,mBAAkB,sCAAqC,kBAAiB,oCAAmC;;;ADGvb,IAAM,QAAQ,WAA2C,SAASA,OACxE,EAAE,UAAU,SAAS,QAAQ,QAAQ,WAAW,GAAG,MAAM,GACzD,KACC;AACD,QAAM,UAAU,UAAW;AAAA,IAC1B;AAAA,IACA,gBAAgB;AAAA,IAChB;AAAA,IACA,OAAO,WAAsB,OAAO;AAAA,MACnC,WAAW;AAAA,QACV,cAAO;AAAA,QACP,cAAQ,MAAO,MAAO,SAAU;AAAA,QAChC;AAAA,MACD;AAAA,MACA;AAAA,IACD,CAAE;AAAA,EACH,CAAE;AAEF,SAAO;AACR,CAAE;",
|
|
6
6
|
"names": ["Badge"]
|
|
7
7
|
}
|
|
@@ -6,10 +6,10 @@ import { forwardRef, useEffect } from "@wordpress/element";
|
|
|
6
6
|
import { __ } from "@wordpress/i18n";
|
|
7
7
|
|
|
8
8
|
// packages/ui/src/button/style.module.css
|
|
9
|
-
if (typeof document !== "undefined" && !document.head.querySelector("style[data-wp-hash='
|
|
9
|
+
if (typeof document !== "undefined" && !document.head.querySelector("style[data-wp-hash='e0722a616e']")) {
|
|
10
10
|
const style = document.createElement("style");
|
|
11
|
-
style.setAttribute("data-wp-hash", "
|
|
12
|
-
style.appendChild(document.createTextNode('@layer wp-ui-utilities, wp-ui-components, wp-ui-compositions, wp-ui-overrides;@layer wp-ui-components{._97b0fc33c028be1a__button,.abbb272e2ce49bd6__is-unstyled{appearance:none;padding:0}._97b0fc33c028be1a__button{--wp-ui-button-font-weight:499;--wp-ui-button-background-color:var(--wpds-color-bg-interactive-brand-strong);--wp-ui-button-background-color-active:var(--wpds-color-bg-interactive-brand-strong-active);--wp-ui-button-background-color-disabled:var(--wpds-color-bg-interactive-neutral-strong-disabled);--wp-ui-button-foreground-color:var(--wpds-color-fg-interactive-brand-strong);--wp-ui-button-foreground-color-active:var(--wpds-color-fg-interactive-brand-strong-active);--wp-ui-button-foreground-color-disabled:var(--wpds-color-fg-interactive-neutral-strong-disabled);--wp-ui-button-padding-inline:
|
|
11
|
+
style.setAttribute("data-wp-hash", "e0722a616e");
|
|
12
|
+
style.appendChild(document.createTextNode('@layer wp-ui-utilities, wp-ui-components, wp-ui-compositions, wp-ui-overrides;@layer wp-ui-components{._97b0fc33c028be1a__button,.abbb272e2ce49bd6__is-unstyled{appearance:none;padding:0}._97b0fc33c028be1a__button{--wp-ui-button-font-weight:499;--wp-ui-button-background-color:var(--wpds-color-bg-interactive-brand-strong);--wp-ui-button-background-color-active:var(--wpds-color-bg-interactive-brand-strong-active);--wp-ui-button-background-color-disabled:var(--wpds-color-bg-interactive-neutral-strong-disabled);--wp-ui-button-foreground-color:var(--wpds-color-fg-interactive-brand-strong);--wp-ui-button-foreground-color-active:var(--wpds-color-fg-interactive-brand-strong-active);--wp-ui-button-foreground-color-disabled:var(--wpds-color-fg-interactive-neutral-strong-disabled);--wp-ui-button-padding-inline:var(--wpds-dimension-padding-md);--wp-ui-button-height:40px;--wp-ui-button-aspect-ratio:auto;--wp-ui-button-font-size:var(--wpds-font-size-md);--wp-ui-button-min-width:calc(4ch + var(--wp-ui-button-padding-inline)*2);--wp-ui-button-border-color:var(--wp-ui-button-background-color);--wp-ui-button-border-color-active:var(--wp-ui-button-background-color-active);--wp-ui-button-border-color-disabled:var(--wp-ui-button-background-color-disabled);align-items:center;aspect-ratio:var(--wp-ui-button-aspect-ratio);background-clip:padding-box;background-color:var(--wp-ui-button-background-color);border-color:var(--wp-ui-button-border-color);border-radius:var(--wpds-border-radius-sm);border-style:solid;border-width:1px;color:var(--wp-ui-button-foreground-color);display:inline-flex;font-family:var(--wpds-font-family-body);font-size:var(--wp-ui-button-font-size);font-weight:var(--wp-ui-button-font-weight);gap:var(--wpds-dimension-gap-sm);height:var(--wp-ui-button-height);justify-content:center;line-height:var(--wpds-font-line-height-sm);min-width:var(--wp-ui-button-min-width);padding-inline:var(--wp-ui-button-padding-inline);position:relative;text-decoration:none;@media not (prefers-reduced-motion){transition:color .1s ease-out;*{transition:opacity .1s ease-out}}&[href]{cursor:pointer}[href]{color:inherit;text-decoration:inherit}&:not([data-disabled]):is(:hover,:active,:focus){background-color:var(--wp-ui-button-background-color-active);border-color:var(--wp-ui-button-border-color-active);color:var(--wp-ui-button-foreground-color-active)}&[data-disabled]:not(._914b42f315c0e580__is-loading){background-color:var(--wp-ui-button-background-color-disabled);border-color:var(--wp-ui-button-border-color-disabled);color:var(--wp-ui-button-foreground-color-disabled);@media (forced-colors:active){border-bottom-color:GrayText;border-left-color:GrayText;border-right-color:GrayText;border-top-color:GrayText;color:GrayText}}&:before{aspect-ratio:1;border:var(--wpds-border-width-focus) solid;border-block-end-color:#0000;border-block-start-color:var(--wp-ui-button-foreground-color);border-inline-end-color:var(--wp-ui-button-foreground-color);border-inline-start-color:#0000;border-radius:50%;box-sizing:border-box;content:"";display:block;height:var(--wp-ui-button-font-size);inset-inline-start:50%;opacity:0;pointer-events:none;position:absolute;top:50%;transform:translate(-50%,-50%);@media not (prefers-reduced-motion){transition:opacity .1s ease-out}}}._908205475f9f2a92__is-small{--wp-ui-button-padding-inline:var(--wpds-dimension-padding-sm);--wp-ui-button-height:24px}.dd460c965226cc77__is-brand{&._62d5a778b7b258ee__is-outline,&.ad0619a3217c6a5b__is-minimal{--wp-ui-button-foreground-color:var(--wpds-color-fg-interactive-brand);--wp-ui-button-foreground-color-active:var(--wpds-color-fg-interactive-brand-active);--wp-ui-button-foreground-color-disabled:var(--wpds-color-fg-interactive-neutral-disabled)}&._62d5a778b7b258ee__is-outline{--wp-ui-button-background-color:var(--wpds-color-bg-interactive-brand-weak);--wp-ui-button-background-color-active:var(--wpds-color-bg-interactive-brand-weak-active);--wp-ui-button-background-color-disabled:var(--wpds-color-bg-interactive-neutral-weak-disabled);--wp-ui-button-border-color:var(--wpds-color-stroke-interactive-brand);--wp-ui-button-border-color-active:var(--wpds-color-stroke-interactive-brand-active);--wp-ui-button-border-color-disabled:var(--wpds-color-stroke-interactive-neutral-disabled)}&.ad0619a3217c6a5b__is-minimal{--wp-ui-button-background-color:var(--wpds-color-bg-interactive-brand-weak);--wp-ui-button-background-color-active:var(--wpds-color-bg-interactive-brand-weak-active);--wp-ui-button-background-color-disabled:var(--wpds-color-bg-interactive-neutral-weak-disabled)}}.e722a8f96726aa99__is-neutral{&.b50b3358c5fb4d0b__is-solid{--wp-ui-button-background-color:var(--wpds-color-bg-interactive-neutral-strong);--wp-ui-button-background-color-active:var(--wpds-color-bg-interactive-neutral-strong-active);--wp-ui-button-background-color-disabled:var(--wpds-color-bg-interactive-neutral-strong-disabled);--wp-ui-button-foreground-color:var(--wpds-color-fg-interactive-neutral-strong);--wp-ui-button-foreground-color-active:var(--wpds-color-fg-interactive-neutral-strong-active);--wp-ui-button-foreground-color-disabled:var(--wpds-color-fg-interactive-neutral-strong-disabled)}&._62d5a778b7b258ee__is-outline,&.ad0619a3217c6a5b__is-minimal{--wp-ui-button-foreground-color:var(--wpds-color-fg-interactive-neutral);--wp-ui-button-foreground-color-active:var(--wpds-color-fg-interactive-neutral-active);--wp-ui-button-foreground-color-disabled:var(--wpds-color-fg-interactive-neutral-disabled)}&._62d5a778b7b258ee__is-outline{--wp-ui-button-background-color:var(--wpds-color-bg-interactive-neutral-weak);--wp-ui-button-background-color-active:var(--wpds-color-bg-interactive-neutral-weak-active);--wp-ui-button-background-color-disabled:var(--wpds-color-bg-interactive-neutral-weak-disabled);--wp-ui-button-border-color:var(--wpds-color-stroke-interactive-neutral);--wp-ui-button-border-color-active:var(--wpds-color-stroke-interactive-neutral-active);--wp-ui-button-border-color-disabled:var(--wpds-color-stroke-interactive-neutral-disabled)}&.ad0619a3217c6a5b__is-minimal{--wp-ui-button-background-color:var(--wpds-color-bg-interactive-neutral-weak);--wp-ui-button-background-color-active:var(--wpds-color-bg-interactive-neutral-weak-active);--wp-ui-button-background-color-disabled:var(--wpds-color-bg-interactive-neutral-weak-disabled)}}.abbb272e2ce49bd6__is-unstyled{background:none;border:none;min-width:unset}.cf59cf1b69629838__is-compact{--wp-ui-button-height:32px}._914b42f315c0e580__is-loading{color:#0000;&:not([data-disabled]):is(:hover,:active,:focus){color:#0000}*{opacity:0}&:before{opacity:1;transition-delay:.05s;@media not (prefers-reduced-motion){animation:_5a1d53da6f830c8d__loading-animation 1s linear infinite}}}[aria-pressed=true].ad0619a3217c6a5b__is-minimal.e722a8f96726aa99__is-neutral{--wp-ui-button-background-color:var(--wpds-color-bg-interactive-neutral-strong);--wp-ui-button-background-color-active:var(--wpds-color-bg-interactive-neutral-strong);--wp-ui-button-foreground-color:var(--wpds-color-fg-interactive-neutral-strong);--wp-ui-button-foreground-color-active:var(--wpds-color-fg-interactive-neutral-strong)}}@keyframes _5a1d53da6f830c8d__loading-animation{0%{transform:translate(-50%,-50%) rotate(0deg)}to{transform:translate(-50%,-50%) rotate(1turn)}}'));
|
|
13
13
|
document.head.appendChild(style);
|
|
14
14
|
}
|
|
15
15
|
var style_default = { "button": "_97b0fc33c028be1a__button", "is-unstyled": "abbb272e2ce49bd6__is-unstyled", "is-loading": "_914b42f315c0e580__is-loading", "is-small": "_908205475f9f2a92__is-small", "is-brand": "dd460c965226cc77__is-brand", "is-outline": "_62d5a778b7b258ee__is-outline", "is-minimal": "ad0619a3217c6a5b__is-minimal", "is-neutral": "e722a8f96726aa99__is-neutral", "is-solid": "b50b3358c5fb4d0b__is-solid", "is-compact": "cf59cf1b69629838__is-compact", "loading-animation": "_5a1d53da6f830c8d__loading-animation" };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/button/button.tsx", "../../src/button/style.module.css", "../../src/utils/css/resets.module.css", "../../src/utils/css/focus.module.css"],
|
|
4
|
-
"sourcesContent": ["import { Button as _Button } from '@base-ui/react/button';\nimport clsx from 'clsx';\nimport { speak } from '@wordpress/a11y';\nimport { forwardRef, useEffect } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport { type ButtonProps } from './types';\nimport styles from './style.module.css';\nimport resetStyles from '../utils/css/resets.module.css';\nimport focusStyles from '../utils/css/focus.module.css';\n\nexport const Button = forwardRef< HTMLButtonElement, ButtonProps >(\n\tfunction Button(\n\t\t{\n\t\t\ttone = 'brand',\n\t\t\tvariant = 'solid',\n\t\t\tsize = 'default',\n\t\t\tclassName,\n\t\t\tfocusableWhenDisabled = true,\n\t\t\tdisabled,\n\t\t\tloading,\n\t\t\tloadingAnnouncement = __( 'Loading' ),\n\t\t\tchildren,\n\t\t\t...props\n\t\t},\n\t\tref\n\t) {\n\t\tconst mergedClassName = clsx(\n\t\t\tresetStyles[ 'box-sizing' ],\n\t\t\tfocusStyles[ 'outset-ring--focus-except-active' ],\n\t\t\tvariant !== 'unstyled' && styles.button,\n\t\t\tstyles[ `is-${ tone }` ],\n\t\t\tstyles[ `is-${ variant }` ],\n\t\t\tstyles[ `is-${ size }` ],\n\t\t\tloading && styles[ 'is-loading' ],\n\t\t\tclassName\n\t\t);\n\n\t\t// Announce loading state to assistive technology\n\t\tuseEffect( () => {\n\t\t\tif ( loading && loadingAnnouncement ) {\n\t\t\t\tspeak( loadingAnnouncement );\n\t\t\t}\n\t\t}, [ loading, loadingAnnouncement ] );\n\n\t\treturn (\n\t\t\t<_Button\n\t\t\t\tref={ ref }\n\t\t\t\tclassName={ mergedClassName }\n\t\t\t\tfocusableWhenDisabled={ focusableWhenDisabled }\n\t\t\t\tdisabled={ disabled ?? loading }\n\t\t\t\t{ ...props }\n\t\t\t>\n\t\t\t\t{ children }\n\t\t\t</_Button>\n\t\t);\n\t}\n);\n", "if (typeof document !== 'undefined' && !document.head.querySelector(\"style[data-wp-hash='e89bb0a0ac']\")) {\n\tconst style = document.createElement(\"style\");\n\tstyle.setAttribute(\"data-wp-hash\", \"e89bb0a0ac\");\n\tstyle.appendChild(document.createTextNode(\"@layer wp-ui-utilities, wp-ui-components, wp-ui-compositions, wp-ui-overrides;@layer wp-ui-components{._97b0fc33c028be1a__button,.abbb272e2ce49bd6__is-unstyled{appearance:none;padding:0}._97b0fc33c028be1a__button{--wp-ui-button-font-weight:499;--wp-ui-button-background-color:var(--wpds-color-bg-interactive-brand-strong);--wp-ui-button-background-color-active:var(--wpds-color-bg-interactive-brand-strong-active);--wp-ui-button-background-color-disabled:var(--wpds-color-bg-interactive-neutral-strong-disabled);--wp-ui-button-foreground-color:var(--wpds-color-fg-interactive-brand-strong);--wp-ui-button-foreground-color-active:var(--wpds-color-fg-interactive-brand-strong-active);--wp-ui-button-foreground-color-disabled:var(--wpds-color-fg-interactive-neutral-strong-disabled);--wp-ui-button-padding-inline:calc(var(--wpds-dimension-base)*3);--wp-ui-button-height:40px;--wp-ui-button-aspect-ratio:auto;--wp-ui-button-font-size:var(--wpds-font-size-md);--wp-ui-button-border-color:var(--wp-ui-button-background-color);--wp-ui-button-border-color-active:var(--wp-ui-button-background-color-active);--wp-ui-button-border-color-disabled:var(--wp-ui-button-background-color-disabled);align-items:center;aspect-ratio:var(--wp-ui-button-aspect-ratio);background-clip:padding-box;background-color:var(--wp-ui-button-background-color);border-color:var(--wp-ui-button-border-color);border-radius:var(--wpds-border-radius-sm);border-style:solid;border-width:1px;color:var(--wp-ui-button-foreground-color);display:inline-flex;font-family:var(--wpds-font-family-body);font-size:var(--wp-ui-button-font-size);font-weight:var(--wp-ui-button-font-weight);gap:calc(var(--wpds-dimension-base)*2);height:var(--wp-ui-button-height);justify-content:center;line-height:var(--wpds-font-line-height-sm);padding-inline:var(--wp-ui-button-padding-inline);position:relative;text-decoration:none;@media not (prefers-reduced-motion){transition:color .1s ease-out;*{transition:opacity .1s ease-out}}&[href]{cursor:pointer}[href]{color:inherit;text-decoration:inherit}&:not([aria-disabled=true]):is(:hover,:active,:focus){--wp-ui-button-background-color:var(--wp-ui-button-background-color-active);--wp-ui-button-foreground-color:var(--wp-ui-button-foreground-color-active);--wp-ui-button-border-color:var(--wp-ui-button-border-color-active)}&[aria-disabled=true]:not(._914b42f315c0e580__is-loading){--wp-ui-button-background-color:var(--wp-ui-button-background-color-disabled);--wp-ui-button-foreground-color:var(--wp-ui-button-foreground-color-disabled);--wp-ui-button-border-color:var(--wp-ui-button-border-color-disabled);@media (forced-colors:active){border-bottom-color:GrayText;border-left-color:GrayText;border-right-color:GrayText;border-top-color:GrayText;color:GrayText}}&:before{aspect-ratio:1;border:var(--wpds-border-width-focus) solid;border-block-end-color:#0000;border-block-start-color:var(--wp-ui-button-foreground-color);border-inline-end-color:var(--wp-ui-button-foreground-color);border-inline-start-color:#0000;border-radius:50%;box-sizing:border-box;content:\\\"\\\";display:block;height:var(--wp-ui-button-font-size);inset-inline-start:50%;opacity:0;pointer-events:none;position:absolute;top:50%;transform:translate(-50%,-50%);@media not (prefers-reduced-motion){transition:opacity .1s ease-out}}}._908205475f9f2a92__is-small{--wp-ui-button-padding-inline:calc(var(--wpds-dimension-base)*2);--wp-ui-button-height:24px}.dd460c965226cc77__is-brand{&._62d5a778b7b258ee__is-outline,&.ad0619a3217c6a5b__is-minimal{--wp-ui-button-foreground-color:var(--wpds-color-fg-interactive-brand);--wp-ui-button-foreground-color-active:var(--wpds-color-fg-interactive-brand-active);--wp-ui-button-foreground-color-disabled:var(--wpds-color-fg-interactive-neutral-disabled)}&._62d5a778b7b258ee__is-outline{--wp-ui-button-background-color:var(--wpds-color-bg-interactive-brand-weak);--wp-ui-button-background-color-active:var(--wpds-color-bg-interactive-brand-weak-active);--wp-ui-button-background-color-disabled:var(--wpds-color-bg-interactive-neutral-weak-disabled);--wp-ui-button-border-color:var(--wpds-color-stroke-interactive-brand);--wp-ui-button-border-color-active:var(--wpds-color-stroke-interactive-brand-active);--wp-ui-button-border-color-disabled:var(--wpds-color-stroke-interactive-neutral-disabled)}&.ad0619a3217c6a5b__is-minimal{--wp-ui-button-background-color:var(--wpds-color-bg-interactive-brand-weak);--wp-ui-button-background-color-active:var(--wpds-color-bg-interactive-brand-weak-active);--wp-ui-button-background-color-disabled:var(--wpds-color-bg-interactive-neutral-weak-disabled)}}.e722a8f96726aa99__is-neutral{&.b50b3358c5fb4d0b__is-solid{--wp-ui-button-background-color:var(--wpds-color-bg-interactive-neutral-strong);--wp-ui-button-background-color-active:var(--wpds-color-bg-interactive-neutral-strong-active);--wp-ui-button-background-color-disabled:var(--wpds-color-bg-interactive-neutral-strong-disabled);--wp-ui-button-foreground-color:var(--wpds-color-fg-interactive-neutral-strong);--wp-ui-button-foreground-color-active:var(--wpds-color-fg-interactive-neutral-strong-active);--wp-ui-button-foreground-color-disabled:var(--wpds-color-fg-interactive-neutral-strong-disabled)}&._62d5a778b7b258ee__is-outline,&.ad0619a3217c6a5b__is-minimal{--wp-ui-button-foreground-color:var(--wpds-color-fg-interactive-neutral);--wp-ui-button-foreground-color-active:var(--wpds-color-fg-interactive-neutral-active);--wp-ui-button-foreground-color-disabled:var(--wpds-color-fg-interactive-neutral-disabled)}&._62d5a778b7b258ee__is-outline{--wp-ui-button-background-color:var(--wpds-color-bg-interactive-neutral-weak);--wp-ui-button-background-color-active:var(--wpds-color-bg-interactive-neutral-weak-active);--wp-ui-button-background-color-disabled:var(--wpds-color-bg-interactive-neutral-weak-disabled);--wp-ui-button-border-color:var(--wpds-color-stroke-interactive-neutral);--wp-ui-button-border-color-active:var(--wpds-color-stroke-interactive-neutral-active);--wp-ui-button-border-color-disabled:var(--wpds-color-stroke-interactive-neutral-disabled)}&.ad0619a3217c6a5b__is-minimal{--wp-ui-button-background-color:var(--wpds-color-bg-interactive-neutral-weak);--wp-ui-button-background-color-active:var(--wpds-color-bg-interactive-neutral-weak-active);--wp-ui-button-background-color-disabled:var(--wpds-color-bg-interactive-neutral-weak-disabled)}}.abbb272e2ce49bd6__is-unstyled{background:none;border:none}.cf59cf1b69629838__is-compact{--wp-ui-button-height:32px}._914b42f315c0e580__is-loading{color:#0000;*{opacity:0}&:before{opacity:1;transition-delay:.05s;@media not (prefers-reduced-motion){animation:_5a1d53da6f830c8d__loading-animation 1s linear infinite}}}[aria-pressed=true].ad0619a3217c6a5b__is-minimal.e722a8f96726aa99__is-neutral{--wp-ui-button-background-color:var(--wpds-color-bg-interactive-neutral-strong);--wp-ui-button-background-color-active:var(--wpds-color-bg-interactive-neutral-strong);--wp-ui-button-foreground-color:var(--wpds-color-fg-interactive-neutral-strong);--wp-ui-button-foreground-color-active:var(--wpds-color-fg-interactive-neutral-strong)}}@keyframes _5a1d53da6f830c8d__loading-animation{0%{transform:translate(-50%,-50%) rotate(0deg)}to{transform:translate(-50%,-50%) rotate(1turn)}}\"));\n\tdocument.head.appendChild(style);\n}\nexport default {\"button\":\"_97b0fc33c028be1a__button\",\"is-unstyled\":\"abbb272e2ce49bd6__is-unstyled\",\"is-loading\":\"_914b42f315c0e580__is-loading\",\"is-small\":\"_908205475f9f2a92__is-small\",\"is-brand\":\"dd460c965226cc77__is-brand\",\"is-outline\":\"_62d5a778b7b258ee__is-outline\",\"is-minimal\":\"ad0619a3217c6a5b__is-minimal\",\"is-neutral\":\"e722a8f96726aa99__is-neutral\",\"is-solid\":\"b50b3358c5fb4d0b__is-solid\",\"is-compact\":\"cf59cf1b69629838__is-compact\",\"loading-animation\":\"_5a1d53da6f830c8d__loading-animation\"};\n", "if (typeof document !== 'undefined' && !document.head.querySelector(\"style[data-wp-hash='671ebfc62d']\")) {\n\tconst style = document.createElement(\"style\");\n\tstyle.setAttribute(\"data-wp-hash\", \"671ebfc62d\");\n\tstyle.appendChild(document.createTextNode(\"@layer wp-ui-utilities, wp-ui-components, wp-ui-compositions, wp-ui-overrides;@layer wp-ui-utilities{._336cd3e4e743482f__box-sizing{box-sizing:border-box;*,:after,:before{box-sizing:inherit}}}\"));\n\tdocument.head.appendChild(style);\n}\nexport default {\"box-sizing\":\"_336cd3e4e743482f__box-sizing\"};\n", "if (typeof document !== 'undefined' && !document.head.querySelector(\"style[data-wp-hash='28ad59e2e3']\")) {\n\tconst style = document.createElement(\"style\");\n\tstyle.setAttribute(\"data-wp-hash\", \"28ad59e2e3\");\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{@media not (prefers-reduced-motion){transition:outline .1s ease-out}outline-color:#0000;outline-offset:1px;outline-style:solid;outline-width:0}._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){outline-color:var(--wpds-color-stroke-focus-brand);outline-width:var(--wpds-border-width-focus)}}\"));\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\"};\n"],
|
|
5
|
-
"mappings": ";AAAA,SAAS,UAAU,eAAe;AAClC,OAAO,UAAU;AACjB,SAAS,aAAa;AACtB,SAAS,YAAY,iBAAiB;AACtC,SAAS,UAAU;;;ACJnB,IAAI,OAAO,aAAa,eAAe,CAAC,SAAS,KAAK,cAAc,kCAAkC,GAAG;AACxG,QAAM,QAAQ,SAAS,cAAc,OAAO;AAC5C,QAAM,aAAa,gBAAgB,YAAY;AAC/C,QAAM,YAAY,SAAS,eAAe,
|
|
4
|
+
"sourcesContent": ["import { Button as _Button } from '@base-ui/react/button';\nimport clsx from 'clsx';\nimport { speak } from '@wordpress/a11y';\nimport { forwardRef, useEffect } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport { type ButtonProps } from './types';\nimport styles from './style.module.css';\nimport resetStyles from '../utils/css/resets.module.css';\nimport focusStyles from '../utils/css/focus.module.css';\n\nexport const Button = forwardRef< HTMLButtonElement, ButtonProps >(\n\tfunction Button(\n\t\t{\n\t\t\ttone = 'brand',\n\t\t\tvariant = 'solid',\n\t\t\tsize = 'default',\n\t\t\tclassName,\n\t\t\tfocusableWhenDisabled = true,\n\t\t\tdisabled,\n\t\t\tloading,\n\t\t\tloadingAnnouncement = __( 'Loading' ),\n\t\t\tchildren,\n\t\t\t...props\n\t\t},\n\t\tref\n\t) {\n\t\tconst mergedClassName = clsx(\n\t\t\tresetStyles[ 'box-sizing' ],\n\t\t\tfocusStyles[ 'outset-ring--focus-except-active' ],\n\t\t\tvariant !== 'unstyled' && styles.button,\n\t\t\tstyles[ `is-${ tone }` ],\n\t\t\tstyles[ `is-${ variant }` ],\n\t\t\tstyles[ `is-${ size }` ],\n\t\t\tloading && styles[ 'is-loading' ],\n\t\t\tclassName\n\t\t);\n\n\t\t// Announce loading state to assistive technology\n\t\tuseEffect( () => {\n\t\t\tif ( loading && loadingAnnouncement ) {\n\t\t\t\tspeak( loadingAnnouncement );\n\t\t\t}\n\t\t}, [ loading, loadingAnnouncement ] );\n\n\t\treturn (\n\t\t\t<_Button\n\t\t\t\tref={ ref }\n\t\t\t\tclassName={ mergedClassName }\n\t\t\t\tfocusableWhenDisabled={ focusableWhenDisabled }\n\t\t\t\tdisabled={ disabled ?? loading }\n\t\t\t\t{ ...props }\n\t\t\t>\n\t\t\t\t{ children }\n\t\t\t</_Button>\n\t\t);\n\t}\n);\n", "if (typeof document !== 'undefined' && !document.head.querySelector(\"style[data-wp-hash='e0722a616e']\")) {\n\tconst style = document.createElement(\"style\");\n\tstyle.setAttribute(\"data-wp-hash\", \"e0722a616e\");\n\tstyle.appendChild(document.createTextNode(\"@layer wp-ui-utilities, wp-ui-components, wp-ui-compositions, wp-ui-overrides;@layer wp-ui-components{._97b0fc33c028be1a__button,.abbb272e2ce49bd6__is-unstyled{appearance:none;padding:0}._97b0fc33c028be1a__button{--wp-ui-button-font-weight:499;--wp-ui-button-background-color:var(--wpds-color-bg-interactive-brand-strong);--wp-ui-button-background-color-active:var(--wpds-color-bg-interactive-brand-strong-active);--wp-ui-button-background-color-disabled:var(--wpds-color-bg-interactive-neutral-strong-disabled);--wp-ui-button-foreground-color:var(--wpds-color-fg-interactive-brand-strong);--wp-ui-button-foreground-color-active:var(--wpds-color-fg-interactive-brand-strong-active);--wp-ui-button-foreground-color-disabled:var(--wpds-color-fg-interactive-neutral-strong-disabled);--wp-ui-button-padding-inline:var(--wpds-dimension-padding-md);--wp-ui-button-height:40px;--wp-ui-button-aspect-ratio:auto;--wp-ui-button-font-size:var(--wpds-font-size-md);--wp-ui-button-min-width:calc(4ch + var(--wp-ui-button-padding-inline)*2);--wp-ui-button-border-color:var(--wp-ui-button-background-color);--wp-ui-button-border-color-active:var(--wp-ui-button-background-color-active);--wp-ui-button-border-color-disabled:var(--wp-ui-button-background-color-disabled);align-items:center;aspect-ratio:var(--wp-ui-button-aspect-ratio);background-clip:padding-box;background-color:var(--wp-ui-button-background-color);border-color:var(--wp-ui-button-border-color);border-radius:var(--wpds-border-radius-sm);border-style:solid;border-width:1px;color:var(--wp-ui-button-foreground-color);display:inline-flex;font-family:var(--wpds-font-family-body);font-size:var(--wp-ui-button-font-size);font-weight:var(--wp-ui-button-font-weight);gap:var(--wpds-dimension-gap-sm);height:var(--wp-ui-button-height);justify-content:center;line-height:var(--wpds-font-line-height-sm);min-width:var(--wp-ui-button-min-width);padding-inline:var(--wp-ui-button-padding-inline);position:relative;text-decoration:none;@media not (prefers-reduced-motion){transition:color .1s ease-out;*{transition:opacity .1s ease-out}}&[href]{cursor:pointer}[href]{color:inherit;text-decoration:inherit}&:not([data-disabled]):is(:hover,:active,:focus){background-color:var(--wp-ui-button-background-color-active);border-color:var(--wp-ui-button-border-color-active);color:var(--wp-ui-button-foreground-color-active)}&[data-disabled]:not(._914b42f315c0e580__is-loading){background-color:var(--wp-ui-button-background-color-disabled);border-color:var(--wp-ui-button-border-color-disabled);color:var(--wp-ui-button-foreground-color-disabled);@media (forced-colors:active){border-bottom-color:GrayText;border-left-color:GrayText;border-right-color:GrayText;border-top-color:GrayText;color:GrayText}}&:before{aspect-ratio:1;border:var(--wpds-border-width-focus) solid;border-block-end-color:#0000;border-block-start-color:var(--wp-ui-button-foreground-color);border-inline-end-color:var(--wp-ui-button-foreground-color);border-inline-start-color:#0000;border-radius:50%;box-sizing:border-box;content:\\\"\\\";display:block;height:var(--wp-ui-button-font-size);inset-inline-start:50%;opacity:0;pointer-events:none;position:absolute;top:50%;transform:translate(-50%,-50%);@media not (prefers-reduced-motion){transition:opacity .1s ease-out}}}._908205475f9f2a92__is-small{--wp-ui-button-padding-inline:var(--wpds-dimension-padding-sm);--wp-ui-button-height:24px}.dd460c965226cc77__is-brand{&._62d5a778b7b258ee__is-outline,&.ad0619a3217c6a5b__is-minimal{--wp-ui-button-foreground-color:var(--wpds-color-fg-interactive-brand);--wp-ui-button-foreground-color-active:var(--wpds-color-fg-interactive-brand-active);--wp-ui-button-foreground-color-disabled:var(--wpds-color-fg-interactive-neutral-disabled)}&._62d5a778b7b258ee__is-outline{--wp-ui-button-background-color:var(--wpds-color-bg-interactive-brand-weak);--wp-ui-button-background-color-active:var(--wpds-color-bg-interactive-brand-weak-active);--wp-ui-button-background-color-disabled:var(--wpds-color-bg-interactive-neutral-weak-disabled);--wp-ui-button-border-color:var(--wpds-color-stroke-interactive-brand);--wp-ui-button-border-color-active:var(--wpds-color-stroke-interactive-brand-active);--wp-ui-button-border-color-disabled:var(--wpds-color-stroke-interactive-neutral-disabled)}&.ad0619a3217c6a5b__is-minimal{--wp-ui-button-background-color:var(--wpds-color-bg-interactive-brand-weak);--wp-ui-button-background-color-active:var(--wpds-color-bg-interactive-brand-weak-active);--wp-ui-button-background-color-disabled:var(--wpds-color-bg-interactive-neutral-weak-disabled)}}.e722a8f96726aa99__is-neutral{&.b50b3358c5fb4d0b__is-solid{--wp-ui-button-background-color:var(--wpds-color-bg-interactive-neutral-strong);--wp-ui-button-background-color-active:var(--wpds-color-bg-interactive-neutral-strong-active);--wp-ui-button-background-color-disabled:var(--wpds-color-bg-interactive-neutral-strong-disabled);--wp-ui-button-foreground-color:var(--wpds-color-fg-interactive-neutral-strong);--wp-ui-button-foreground-color-active:var(--wpds-color-fg-interactive-neutral-strong-active);--wp-ui-button-foreground-color-disabled:var(--wpds-color-fg-interactive-neutral-strong-disabled)}&._62d5a778b7b258ee__is-outline,&.ad0619a3217c6a5b__is-minimal{--wp-ui-button-foreground-color:var(--wpds-color-fg-interactive-neutral);--wp-ui-button-foreground-color-active:var(--wpds-color-fg-interactive-neutral-active);--wp-ui-button-foreground-color-disabled:var(--wpds-color-fg-interactive-neutral-disabled)}&._62d5a778b7b258ee__is-outline{--wp-ui-button-background-color:var(--wpds-color-bg-interactive-neutral-weak);--wp-ui-button-background-color-active:var(--wpds-color-bg-interactive-neutral-weak-active);--wp-ui-button-background-color-disabled:var(--wpds-color-bg-interactive-neutral-weak-disabled);--wp-ui-button-border-color:var(--wpds-color-stroke-interactive-neutral);--wp-ui-button-border-color-active:var(--wpds-color-stroke-interactive-neutral-active);--wp-ui-button-border-color-disabled:var(--wpds-color-stroke-interactive-neutral-disabled)}&.ad0619a3217c6a5b__is-minimal{--wp-ui-button-background-color:var(--wpds-color-bg-interactive-neutral-weak);--wp-ui-button-background-color-active:var(--wpds-color-bg-interactive-neutral-weak-active);--wp-ui-button-background-color-disabled:var(--wpds-color-bg-interactive-neutral-weak-disabled)}}.abbb272e2ce49bd6__is-unstyled{background:none;border:none;min-width:unset}.cf59cf1b69629838__is-compact{--wp-ui-button-height:32px}._914b42f315c0e580__is-loading{color:#0000;&:not([data-disabled]):is(:hover,:active,:focus){color:#0000}*{opacity:0}&:before{opacity:1;transition-delay:.05s;@media not (prefers-reduced-motion){animation:_5a1d53da6f830c8d__loading-animation 1s linear infinite}}}[aria-pressed=true].ad0619a3217c6a5b__is-minimal.e722a8f96726aa99__is-neutral{--wp-ui-button-background-color:var(--wpds-color-bg-interactive-neutral-strong);--wp-ui-button-background-color-active:var(--wpds-color-bg-interactive-neutral-strong);--wp-ui-button-foreground-color:var(--wpds-color-fg-interactive-neutral-strong);--wp-ui-button-foreground-color-active:var(--wpds-color-fg-interactive-neutral-strong)}}@keyframes _5a1d53da6f830c8d__loading-animation{0%{transform:translate(-50%,-50%) rotate(0deg)}to{transform:translate(-50%,-50%) rotate(1turn)}}\"));\n\tdocument.head.appendChild(style);\n}\nexport default {\"button\":\"_97b0fc33c028be1a__button\",\"is-unstyled\":\"abbb272e2ce49bd6__is-unstyled\",\"is-loading\":\"_914b42f315c0e580__is-loading\",\"is-small\":\"_908205475f9f2a92__is-small\",\"is-brand\":\"dd460c965226cc77__is-brand\",\"is-outline\":\"_62d5a778b7b258ee__is-outline\",\"is-minimal\":\"ad0619a3217c6a5b__is-minimal\",\"is-neutral\":\"e722a8f96726aa99__is-neutral\",\"is-solid\":\"b50b3358c5fb4d0b__is-solid\",\"is-compact\":\"cf59cf1b69629838__is-compact\",\"loading-animation\":\"_5a1d53da6f830c8d__loading-animation\"};\n", "if (typeof document !== 'undefined' && !document.head.querySelector(\"style[data-wp-hash='671ebfc62d']\")) {\n\tconst style = document.createElement(\"style\");\n\tstyle.setAttribute(\"data-wp-hash\", \"671ebfc62d\");\n\tstyle.appendChild(document.createTextNode(\"@layer wp-ui-utilities, wp-ui-components, wp-ui-compositions, wp-ui-overrides;@layer wp-ui-utilities{._336cd3e4e743482f__box-sizing{box-sizing:border-box;*,:after,:before{box-sizing:inherit}}}\"));\n\tdocument.head.appendChild(style);\n}\nexport default {\"box-sizing\":\"_336cd3e4e743482f__box-sizing\"};\n", "if (typeof document !== 'undefined' && !document.head.querySelector(\"style[data-wp-hash='28ad59e2e3']\")) {\n\tconst style = document.createElement(\"style\");\n\tstyle.setAttribute(\"data-wp-hash\", \"28ad59e2e3\");\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{@media not (prefers-reduced-motion){transition:outline .1s ease-out}outline-color:#0000;outline-offset:1px;outline-style:solid;outline-width:0}._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){outline-color:var(--wpds-color-stroke-focus-brand);outline-width:var(--wpds-border-width-focus)}}\"));\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\"};\n"],
|
|
5
|
+
"mappings": ";AAAA,SAAS,UAAU,eAAe;AAClC,OAAO,UAAU;AACjB,SAAS,aAAa;AACtB,SAAS,YAAY,iBAAiB;AACtC,SAAS,UAAU;;;ACJnB,IAAI,OAAO,aAAa,eAAe,CAAC,SAAS,KAAK,cAAc,kCAAkC,GAAG;AACxG,QAAM,QAAQ,SAAS,cAAc,OAAO;AAC5C,QAAM,aAAa,gBAAgB,YAAY;AAC/C,QAAM,YAAY,SAAS,eAAe,gnOAAknO,CAAC;AAC7pO,WAAS,KAAK,YAAY,KAAK;AAChC;AACA,IAAO,gBAAQ,EAAC,UAAS,6BAA4B,eAAc,iCAAgC,cAAa,iCAAgC,YAAW,+BAA8B,YAAW,8BAA6B,cAAa,iCAAgC,cAAa,gCAA+B,cAAa,gCAA+B,YAAW,8BAA6B,cAAa,gCAA+B,qBAAoB,uCAAsC;;;ACNpf,IAAI,OAAO,aAAa,eAAe,CAAC,SAAS,KAAK,cAAc,kCAAkC,GAAG;AACxG,QAAM,QAAQ,SAAS,cAAc,OAAO;AAC5C,QAAM,aAAa,gBAAgB,YAAY;AAC/C,QAAM,YAAY,SAAS,eAAe,kMAAkM,CAAC;AAC7O,WAAS,KAAK,YAAY,KAAK;AAChC;AACA,IAAO,iBAAQ,EAAC,cAAa,gCAA+B;;;ACN5D,IAAI,OAAO,aAAa,eAAe,CAAC,SAAS,KAAK,cAAc,kCAAkC,GAAG;AACxG,QAAM,QAAQ,SAAS,cAAc,OAAO;AAC5C,QAAM,aAAa,gBAAgB,YAAY;AAC/C,QAAM,YAAY,SAAS,eAAe,0hCAA0hC,CAAC;AACrkC,WAAS,KAAK,YAAY,KAAK;AAChC;AACA,IAAO,gBAAQ,EAAC,sBAAqB,yCAAwC,oCAAmC,sDAAqD,8BAA6B,gDAA+C,6BAA4B,+CAA8C,2CAA0C,8DAA6D,qCAAoC,sDAAqD;;;AHuCxf;AAnCI,IAAM,SAAS;AAAA,EACrB,SAASA,QACR;AAAA,IACC,OAAO;AAAA,IACP,UAAU;AAAA,IACV,OAAO;AAAA,IACP;AAAA,IACA,wBAAwB;AAAA,IACxB;AAAA,IACA;AAAA,IACA,sBAAsB,GAAI,SAAU;AAAA,IACpC;AAAA,IACA,GAAG;AAAA,EACJ,GACA,KACC;AACD,UAAM,kBAAkB;AAAA,MACvB,eAAa,YAAa;AAAA,MAC1B,cAAa,kCAAmC;AAAA,MAChD,YAAY,cAAc,cAAO;AAAA,MACjC,cAAQ,MAAO,IAAK,EAAG;AAAA,MACvB,cAAQ,MAAO,OAAQ,EAAG;AAAA,MAC1B,cAAQ,MAAO,IAAK,EAAG;AAAA,MACvB,WAAW,cAAQ,YAAa;AAAA,MAChC;AAAA,IACD;AAGA,cAAW,MAAM;AAChB,UAAK,WAAW,qBAAsB;AACrC,cAAO,mBAAoB;AAAA,MAC5B;AAAA,IACD,GAAG,CAAE,SAAS,mBAAoB,CAAE;AAEpC,WACC;AAAA,MAAC;AAAA;AAAA,QACA;AAAA,QACA,WAAY;AAAA,QACZ;AAAA,QACA,UAAW,YAAY;AAAA,QACrB,GAAG;AAAA,QAEH;AAAA;AAAA,IACH;AAAA,EAEF;AACD;",
|
|
6
6
|
"names": ["Button"]
|
|
7
7
|
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
// packages/ui/src/dialog/action.tsx
|
|
2
|
+
import { Dialog as _Dialog } from "@base-ui/react/dialog";
|
|
3
|
+
import { forwardRef } from "@wordpress/element";
|
|
4
|
+
import { Button } from "../button/index.mjs";
|
|
5
|
+
import { jsx } from "react/jsx-runtime";
|
|
6
|
+
var Action = forwardRef(
|
|
7
|
+
function DialogAction({ render, ...props }, ref) {
|
|
8
|
+
return /* @__PURE__ */ jsx(
|
|
9
|
+
_Dialog.Close,
|
|
10
|
+
{
|
|
11
|
+
ref,
|
|
12
|
+
render: /* @__PURE__ */ jsx(Button, { render }),
|
|
13
|
+
...props
|
|
14
|
+
}
|
|
15
|
+
);
|
|
16
|
+
}
|
|
17
|
+
);
|
|
18
|
+
export {
|
|
19
|
+
Action
|
|
20
|
+
};
|
|
21
|
+
//# sourceMappingURL=action.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/dialog/action.tsx"],
|
|
4
|
+
"sourcesContent": ["import { Dialog as _Dialog } from '@base-ui/react/dialog';\nimport { forwardRef } from '@wordpress/element';\nimport { Button } from '../button';\nimport type { ActionProps } from './types';\n\n/**\n * Renders a button that closes the dialog when clicked.\n * Accepts all Button component props for styling.\n */\nconst Action = forwardRef< HTMLButtonElement, ActionProps >(\n\tfunction DialogAction( { render, ...props }, ref ) {\n\t\treturn (\n\t\t\t<_Dialog.Close\n\t\t\t\tref={ ref }\n\t\t\t\trender={ <Button render={ render } /> }\n\t\t\t\t{ ...props }\n\t\t\t/>\n\t\t);\n\t}\n);\n\nexport { Action };\n"],
|
|
5
|
+
"mappings": ";AAAA,SAAS,UAAU,eAAe;AAClC,SAAS,kBAAkB;AAC3B,SAAS,cAAc;AAYV;AALb,IAAM,SAAS;AAAA,EACd,SAAS,aAAc,EAAE,QAAQ,GAAG,MAAM,GAAG,KAAM;AAClD,WACC;AAAA,MAAC,QAAQ;AAAA,MAAR;AAAA,QACA;AAAA,QACA,QAAS,oBAAC,UAAO,QAAkB;AAAA,QACjC,GAAG;AAAA;AAAA,IACN;AAAA,EAEF;AACD;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
// packages/ui/src/dialog/close-icon.tsx
|
|
2
|
+
import { Dialog as _Dialog } from "@base-ui/react/dialog";
|
|
3
|
+
import { forwardRef } from "@wordpress/element";
|
|
4
|
+
import { __ } from "@wordpress/i18n";
|
|
5
|
+
import { close } from "@wordpress/icons";
|
|
6
|
+
import { IconButton } from "../icon-button/index.mjs";
|
|
7
|
+
import { jsx } from "react/jsx-runtime";
|
|
8
|
+
var CloseIcon = forwardRef(
|
|
9
|
+
function DialogCloseIcon({ icon, label, ...props }, ref) {
|
|
10
|
+
return /* @__PURE__ */ jsx(
|
|
11
|
+
_Dialog.Close,
|
|
12
|
+
{
|
|
13
|
+
ref,
|
|
14
|
+
render: /* @__PURE__ */ jsx(
|
|
15
|
+
IconButton,
|
|
16
|
+
{
|
|
17
|
+
variant: "minimal",
|
|
18
|
+
size: "compact",
|
|
19
|
+
tone: "neutral",
|
|
20
|
+
...props,
|
|
21
|
+
icon: icon ?? close,
|
|
22
|
+
label: label ?? __("Close")
|
|
23
|
+
}
|
|
24
|
+
)
|
|
25
|
+
}
|
|
26
|
+
);
|
|
27
|
+
}
|
|
28
|
+
);
|
|
29
|
+
export {
|
|
30
|
+
CloseIcon
|
|
31
|
+
};
|
|
32
|
+
//# sourceMappingURL=close-icon.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/dialog/close-icon.tsx"],
|
|
4
|
+
"sourcesContent": ["import { Dialog as _Dialog } from '@base-ui/react/dialog';\nimport { forwardRef } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport { close } from '@wordpress/icons';\nimport { IconButton } from '../icon-button';\nimport type { CloseIconProps } from './types';\n\n/**\n * Renders an icon button that closes the dialog when clicked.\n * Provides a default close icon and accessible label.\n */\nconst CloseIcon = forwardRef< HTMLButtonElement, CloseIconProps >(\n\tfunction DialogCloseIcon( { icon, label, ...props }, ref ) {\n\t\treturn (\n\t\t\t<_Dialog.Close\n\t\t\t\tref={ ref }\n\t\t\t\trender={\n\t\t\t\t\t<IconButton\n\t\t\t\t\t\tvariant=\"minimal\"\n\t\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\t\ttone=\"neutral\"\n\t\t\t\t\t\t{ ...props }\n\t\t\t\t\t\ticon={ icon ?? close }\n\t\t\t\t\t\tlabel={ label ?? __( 'Close' ) }\n\t\t\t\t\t/>\n\t\t\t\t}\n\t\t\t/>\n\t\t);\n\t}\n);\n\nexport { CloseIcon };\n"],
|
|
5
|
+
"mappings": ";AAAA,SAAS,UAAU,eAAe;AAClC,SAAS,kBAAkB;AAC3B,SAAS,UAAU;AACnB,SAAS,aAAa;AACtB,SAAS,kBAAkB;AAatB;AANL,IAAM,YAAY;AAAA,EACjB,SAAS,gBAAiB,EAAE,MAAM,OAAO,GAAG,MAAM,GAAG,KAAM;AAC1D,WACC;AAAA,MAAC,QAAQ;AAAA,MAAR;AAAA,QACA;AAAA,QACA,QACC;AAAA,UAAC;AAAA;AAAA,YACA,SAAQ;AAAA,YACR,MAAK;AAAA,YACL,MAAK;AAAA,YACH,GAAG;AAAA,YACL,MAAO,QAAQ;AAAA,YACf,OAAQ,SAAS,GAAI,OAAQ;AAAA;AAAA,QAC9B;AAAA;AAAA,IAEF;AAAA,EAEF;AACD;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
// packages/ui/src/dialog/context.tsx
|
|
2
|
+
import {
|
|
3
|
+
createContext,
|
|
4
|
+
useCallback,
|
|
5
|
+
useContext,
|
|
6
|
+
useEffect,
|
|
7
|
+
useMemo,
|
|
8
|
+
useRef
|
|
9
|
+
} from "@wordpress/element";
|
|
10
|
+
import { Fragment, jsx } from "react/jsx-runtime";
|
|
11
|
+
var VALIDATION_ENABLED = process.env.NODE_ENV !== "production";
|
|
12
|
+
var DialogValidationContext = VALIDATION_ENABLED ? createContext(null) : null;
|
|
13
|
+
function useDialogValidationContextDev() {
|
|
14
|
+
return useContext(DialogValidationContext);
|
|
15
|
+
}
|
|
16
|
+
function useDialogValidationContextProd() {
|
|
17
|
+
return null;
|
|
18
|
+
}
|
|
19
|
+
var useDialogValidationContext = VALIDATION_ENABLED ? useDialogValidationContextDev : useDialogValidationContextProd;
|
|
20
|
+
function DialogValidationProviderDev({
|
|
21
|
+
children
|
|
22
|
+
}) {
|
|
23
|
+
const titleElementRef = useRef(null);
|
|
24
|
+
const registerTitle = useCallback((element) => {
|
|
25
|
+
titleElementRef.current = element;
|
|
26
|
+
}, []);
|
|
27
|
+
const contextValue = useMemo(
|
|
28
|
+
() => ({ registerTitle }),
|
|
29
|
+
[registerTitle]
|
|
30
|
+
);
|
|
31
|
+
useEffect(() => {
|
|
32
|
+
const titleElement = titleElementRef.current;
|
|
33
|
+
if (!titleElement) {
|
|
34
|
+
throw new Error(
|
|
35
|
+
"Dialog: Missing <Dialog.Title>. For accessibility, every dialog requires a title. If needed, the title can be visually hidden but must not be omitted."
|
|
36
|
+
);
|
|
37
|
+
}
|
|
38
|
+
const textContent = titleElement.textContent?.trim();
|
|
39
|
+
if (!textContent) {
|
|
40
|
+
throw new Error(
|
|
41
|
+
"Dialog: <Dialog.Title> cannot be empty. Provide meaningful text content for the dialog title."
|
|
42
|
+
);
|
|
43
|
+
}
|
|
44
|
+
}, []);
|
|
45
|
+
return /* @__PURE__ */ jsx(DialogValidationContext.Provider, { value: contextValue, children });
|
|
46
|
+
}
|
|
47
|
+
function DialogValidationProviderProd({
|
|
48
|
+
children
|
|
49
|
+
}) {
|
|
50
|
+
return /* @__PURE__ */ jsx(Fragment, { children });
|
|
51
|
+
}
|
|
52
|
+
var DialogValidationProvider = VALIDATION_ENABLED ? DialogValidationProviderDev : DialogValidationProviderProd;
|
|
53
|
+
export {
|
|
54
|
+
DialogValidationProvider,
|
|
55
|
+
useDialogValidationContext
|
|
56
|
+
};
|
|
57
|
+
//# sourceMappingURL=context.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 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 registerTitle = useCallback( ( element: HTMLElement | null ) => {\n\t\ttitleElementRef.current = element;\n\t}, [] );\n\n\tconst contextValue = useMemo(\n\t\t() => ( { registerTitle } ),\n\t\t[ registerTitle ]\n\t);\n\n\t// Validate that Dialog.Title is rendered with non-empty text content\n\tuseEffect( () => {\n\t\t// useLayoutEffect in Title runs before this useEffect,\n\t\t// so titleElementRef should already be set if Title is present\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\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,EACC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACM;AAkFL,SAcM,UAdN;AA5EF,IAAM,qBAAqB,QAAQ,IAAI,aAAa;AAOpD,IAAM,0BAA0B,qBAC7B,cAAqD,IAAK,IACxD;AAKL,SAAS,gCAAgC;AACxC,SAAO,WAAY,uBAAwB;AAC5C;AAKA,SAAS,iCAAiC;AACzC,SAAO;AACR;AAMO,IAAM,6BAA6B,qBACvC,gCACA;AAKH,SAAS,4BAA6B;AAAA,EACrC;AACD,GAEI;AACH,QAAM,kBAAkB,OAA8B,IAAK;AAE3D,QAAM,gBAAgB,YAAa,CAAE,YAAiC;AACrE,oBAAgB,UAAU;AAAA,EAC3B,GAAG,CAAC,CAAE;AAEN,QAAM,eAAe;AAAA,IACpB,OAAQ,EAAE,cAAc;AAAA,IACxB,CAAE,aAAc;AAAA,EACjB;AAGA,YAAW,MAAM;AAGhB,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,GAAG,CAAC,CAAE;AAEN,SACC,oBAAC,wBAAwB,UAAxB,EAAiC,OAAQ,cACvC,UACH;AAEF;AAKA,SAAS,6BAA8B;AAAA,EACtC;AACD,GAEI;AACH,SAAO,gCAAI,UAAU;AACtB;AAMO,IAAM,2BAA2B,qBACrC,8BACA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|