@wordpress/ui 0.7.2-next.v.202602200903.0 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +17 -1
- package/CONTRIBUTING.md +51 -0
- package/build/badge/badge.cjs +2 -2
- package/build/badge/badge.cjs.map +2 -2
- package/build/button/button.cjs +5 -5
- package/build/button/button.cjs.map +2 -2
- package/build/dialog/footer.cjs +3 -3
- package/build/dialog/footer.cjs.map +2 -2
- package/build/dialog/header.cjs +3 -3
- package/build/dialog/header.cjs.map +2 -2
- package/build/dialog/popup.cjs +3 -3
- package/build/dialog/popup.cjs.map +2 -2
- package/build/dialog/title.cjs +3 -3
- package/build/dialog/title.cjs.map +2 -2
- package/build/form/primitives/field/description.cjs +2 -2
- package/build/form/primitives/field/description.cjs.map +2 -2
- package/build/form/primitives/field/details.cjs +2 -2
- package/build/form/primitives/field/details.cjs.map +2 -2
- package/build/form/primitives/field/label.cjs +2 -2
- package/build/form/primitives/field/label.cjs.map +2 -2
- package/build/form/primitives/field/root.cjs +1 -1
- package/build/form/primitives/field/root.cjs.map +2 -2
- package/build/form/primitives/fieldset/description.cjs +2 -2
- package/build/form/primitives/fieldset/description.cjs.map +2 -2
- package/build/form/primitives/fieldset/details.cjs +2 -2
- package/build/form/primitives/fieldset/details.cjs.map +2 -2
- package/build/form/primitives/fieldset/legend.cjs +2 -2
- package/build/form/primitives/fieldset/legend.cjs.map +2 -2
- package/build/form/primitives/fieldset/root.cjs +2 -2
- package/build/form/primitives/fieldset/root.cjs.map +2 -2
- package/build/form/primitives/input/input.cjs +4 -4
- package/build/form/primitives/input/input.cjs.map +2 -2
- package/build/form/primitives/input-layout/input-layout.cjs +21 -8
- package/build/form/primitives/input-layout/input-layout.cjs.map +2 -2
- package/build/form/primitives/input-layout/slot.cjs +5 -14
- package/build/form/primitives/input-layout/slot.cjs.map +2 -2
- package/build/form/primitives/input-layout/types.cjs.map +1 -1
- 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 +4 -4
- package/build/form/primitives/select/popup.cjs.map +2 -2
- package/build/form/primitives/select/trigger.cjs +4 -4
- package/build/form/primitives/select/trigger.cjs.map +2 -2
- package/build/form/primitives/textarea/textarea.cjs +1 -1
- package/build/form/primitives/textarea/textarea.cjs.map +2 -2
- package/build/icon-button/icon-button.cjs +7 -2
- package/build/icon-button/icon-button.cjs.map +2 -2
- package/build/index.cjs +3 -0
- package/build/index.cjs.map +2 -2
- package/build/notice/action-button.cjs +76 -0
- package/build/notice/action-button.cjs.map +7 -0
- package/build/notice/action-link.cjs +70 -0
- package/build/notice/action-link.cjs.map +7 -0
- package/build/notice/actions.cjs +59 -0
- package/build/notice/actions.cjs.map +7 -0
- package/build/notice/close-icon.cjs +74 -0
- package/build/notice/close-icon.cjs.map +7 -0
- package/build/notice/description.cjs +57 -0
- package/build/notice/description.cjs.map +7 -0
- package/build/notice/index.cjs +49 -0
- package/build/notice/index.cjs.map +7 -0
- package/build/notice/root.cjs +137 -0
- package/build/notice/root.cjs.map +7 -0
- package/build/notice/title.cjs +54 -0
- package/build/notice/title.cjs.map +7 -0
- package/build/notice/types.cjs +19 -0
- package/build/notice/types.cjs.map +7 -0
- package/build/stack/stack.cjs +11 -2
- package/build/stack/stack.cjs.map +2 -2
- package/build/tabs/list.cjs +2 -2
- package/build/tabs/list.cjs.map +2 -2
- package/build/tabs/panel.cjs +2 -2
- package/build/tabs/panel.cjs.map +2 -2
- package/build/tabs/tab.cjs +2 -2
- package/build/tabs/tab.cjs.map +2 -2
- package/build/tooltip/popup.cjs +3 -3
- package/build/tooltip/popup.cjs.map +2 -2
- package/build/visually-hidden/visually-hidden.cjs +1 -1
- package/build/visually-hidden/visually-hidden.cjs.map +2 -2
- package/build-module/badge/badge.mjs +2 -2
- package/build-module/badge/badge.mjs.map +2 -2
- package/build-module/button/button.mjs +5 -5
- package/build-module/button/button.mjs.map +2 -2
- package/build-module/dialog/footer.mjs +3 -3
- package/build-module/dialog/footer.mjs.map +2 -2
- package/build-module/dialog/header.mjs +3 -3
- package/build-module/dialog/header.mjs.map +2 -2
- package/build-module/dialog/popup.mjs +3 -3
- package/build-module/dialog/popup.mjs.map +2 -2
- package/build-module/dialog/title.mjs +3 -3
- package/build-module/dialog/title.mjs.map +2 -2
- package/build-module/form/primitives/field/description.mjs +2 -2
- package/build-module/form/primitives/field/description.mjs.map +2 -2
- package/build-module/form/primitives/field/details.mjs +2 -2
- package/build-module/form/primitives/field/details.mjs.map +2 -2
- package/build-module/form/primitives/field/label.mjs +2 -2
- package/build-module/form/primitives/field/label.mjs.map +2 -2
- package/build-module/form/primitives/field/root.mjs +1 -1
- package/build-module/form/primitives/field/root.mjs.map +2 -2
- package/build-module/form/primitives/fieldset/description.mjs +2 -2
- package/build-module/form/primitives/fieldset/description.mjs.map +2 -2
- package/build-module/form/primitives/fieldset/details.mjs +2 -2
- package/build-module/form/primitives/fieldset/details.mjs.map +2 -2
- package/build-module/form/primitives/fieldset/legend.mjs +2 -2
- package/build-module/form/primitives/fieldset/legend.mjs.map +2 -2
- package/build-module/form/primitives/fieldset/root.mjs +2 -2
- package/build-module/form/primitives/fieldset/root.mjs.map +2 -2
- package/build-module/form/primitives/input/input.mjs +4 -4
- package/build-module/form/primitives/input/input.mjs.map +2 -2
- package/build-module/form/primitives/input-layout/input-layout.mjs +22 -9
- package/build-module/form/primitives/input-layout/input-layout.mjs.map +2 -2
- package/build-module/form/primitives/input-layout/slot.mjs +5 -14
- 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 +4 -4
- package/build-module/form/primitives/select/popup.mjs.map +2 -2
- package/build-module/form/primitives/select/trigger.mjs +4 -4
- package/build-module/form/primitives/select/trigger.mjs.map +2 -2
- package/build-module/form/primitives/textarea/textarea.mjs +1 -1
- package/build-module/form/primitives/textarea/textarea.mjs.map +2 -2
- package/build-module/icon-button/icon-button.mjs +7 -2
- package/build-module/icon-button/icon-button.mjs.map +2 -2
- package/build-module/index.mjs +2 -0
- package/build-module/index.mjs.map +2 -2
- package/build-module/notice/action-button.mjs +41 -0
- package/build-module/notice/action-button.mjs.map +7 -0
- package/build-module/notice/action-link.mjs +35 -0
- package/build-module/notice/action-link.mjs.map +7 -0
- package/build-module/notice/actions.mjs +34 -0
- package/build-module/notice/actions.mjs.map +7 -0
- package/build-module/notice/close-icon.mjs +39 -0
- package/build-module/notice/close-icon.mjs.map +7 -0
- package/build-module/notice/description.mjs +32 -0
- package/build-module/notice/description.mjs.map +7 -0
- package/build-module/notice/index.mjs +18 -0
- package/build-module/notice/index.mjs.map +7 -0
- package/build-module/notice/root.mjs +102 -0
- package/build-module/notice/root.mjs.map +7 -0
- package/build-module/notice/title.mjs +29 -0
- package/build-module/notice/title.mjs.map +7 -0
- package/build-module/notice/types.mjs +1 -0
- package/build-module/notice/types.mjs.map +7 -0
- package/build-module/stack/stack.mjs +11 -2
- package/build-module/stack/stack.mjs.map +2 -2
- package/build-module/tabs/list.mjs +2 -2
- package/build-module/tabs/list.mjs.map +2 -2
- package/build-module/tabs/panel.mjs +2 -2
- package/build-module/tabs/panel.mjs.map +2 -2
- package/build-module/tabs/tab.mjs +2 -2
- package/build-module/tabs/tab.mjs.map +2 -2
- package/build-module/tooltip/popup.mjs +3 -3
- package/build-module/tooltip/popup.mjs.map +2 -2
- package/build-module/visually-hidden/visually-hidden.mjs +1 -1
- package/build-module/visually-hidden/visually-hidden.mjs.map +2 -2
- package/build-types/dialog/stories/index.story.d.ts +10 -0
- package/build-types/dialog/stories/index.story.d.ts.map +1 -1
- package/build-types/form/primitives/input-layout/input-layout.d.ts.map +1 -1
- package/build-types/form/primitives/input-layout/slot.d.ts.map +1 -1
- package/build-types/form/primitives/input-layout/types.d.ts +1 -9
- package/build-types/form/primitives/input-layout/types.d.ts.map +1 -1
- package/build-types/icon-button/icon-button.d.ts.map +1 -1
- package/build-types/index.d.ts +1 -0
- package/build-types/index.d.ts.map +1 -1
- package/build-types/notice/action-button.d.ts +6 -0
- package/build-types/notice/action-button.d.ts.map +1 -0
- package/build-types/notice/action-link.d.ts +8 -0
- package/build-types/notice/action-link.d.ts.map +1 -0
- package/build-types/notice/actions.d.ts +6 -0
- package/build-types/notice/actions.d.ts.map +1 -0
- package/build-types/notice/close-icon.d.ts +6 -0
- package/build-types/notice/close-icon.d.ts.map +1 -0
- package/build-types/notice/description.d.ts +6 -0
- package/build-types/notice/description.d.ts.map +1 -0
- package/build-types/notice/index.d.ts +10 -0
- package/build-types/notice/index.d.ts.map +1 -0
- package/build-types/notice/root.d.ts +23 -0
- package/build-types/notice/root.d.ts.map +1 -0
- package/build-types/notice/stories/index.story.d.ts +28 -0
- package/build-types/notice/stories/index.story.d.ts.map +1 -0
- package/build-types/notice/test/index.test.d.ts +2 -0
- package/build-types/notice/test/index.test.d.ts.map +1 -0
- package/build-types/notice/title.d.ts +6 -0
- package/build-types/notice/title.d.ts.map +1 -0
- package/build-types/notice/types.d.ts +77 -0
- package/build-types/notice/types.d.ts.map +1 -0
- package/build-types/stack/stack.d.ts.map +1 -1
- package/package.json +11 -11
- package/src/dialog/stories/index.story.tsx +14 -0
- package/src/dialog/style.module.css +2 -0
- package/src/form/primitives/input-layout/input-layout.tsx +17 -8
- package/src/form/primitives/input-layout/slot.tsx +1 -15
- package/src/form/primitives/input-layout/style.module.css +6 -2
- package/src/form/primitives/input-layout/test/index.test.tsx +34 -1
- package/src/form/primitives/input-layout/types.ts +1 -10
- package/src/icon-button/icon-button.tsx +5 -0
- package/src/icon-button/test/index.test.tsx +33 -0
- package/src/index.ts +1 -0
- package/src/notice/action-button.tsx +36 -0
- package/src/notice/action-link.tsx +28 -0
- package/src/notice/actions.tsx +25 -0
- package/src/notice/close-icon.tsx +30 -0
- package/src/notice/description.tsx +23 -0
- package/src/notice/index.ts +19 -0
- package/src/notice/root.tsx +132 -0
- package/src/notice/stories/index.story.tsx +157 -0
- package/src/notice/style.module.css +147 -0
- package/src/notice/test/index.test.tsx +206 -0
- package/src/notice/title.tsx +20 -0
- package/src/notice/types.ts +100 -0
- package/src/stack/stack.tsx +14 -1
- package/build/form/primitives/input-layout/context.cjs +0 -49
- package/build/form/primitives/input-layout/context.cjs.map +0 -7
- package/build-module/form/primitives/input-layout/context.mjs +0 -22
- package/build-module/form/primitives/input-layout/context.mjs.map +0 -7
- package/build-types/form/primitives/input-layout/context.d.ts +0 -17
- package/build-types/form/primitives/input-layout/context.d.ts.map +0 -1
- package/src/form/primitives/input-layout/context.tsx +0 -36
|
@@ -0,0 +1,70 @@
|
|
|
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/notice/action-link.tsx
|
|
31
|
+
var action_link_exports = {};
|
|
32
|
+
__export(action_link_exports, {
|
|
33
|
+
ActionLink: () => ActionLink
|
|
34
|
+
});
|
|
35
|
+
module.exports = __toCommonJS(action_link_exports);
|
|
36
|
+
var import_element = require("@wordpress/element");
|
|
37
|
+
var import_react = require("@base-ui/react");
|
|
38
|
+
var import_clsx = __toESM(require("clsx"));
|
|
39
|
+
|
|
40
|
+
// packages/ui/src/notice/style.module.css
|
|
41
|
+
if (typeof document !== "undefined" && process.env.NODE_ENV !== "test" && !document.head.querySelector("style[data-wp-hash='6925b16354']")) {
|
|
42
|
+
const style = document.createElement("style");
|
|
43
|
+
style.setAttribute("data-wp-hash", "6925b16354");
|
|
44
|
+
style.appendChild(document.createTextNode('@layer wp-ui-utilities, wp-ui-components, wp-ui-compositions, wp-ui-overrides;@layer wp-ui-components{._4145abab73d17514__notice{--icon-height:24px;--text-vertical-padding:calc((var(--icon-height) - var(--wpds-font-line-height-sm, 20px))/2);--wp-ui-notice-background-color:var(--wpds-color-bg-surface-neutral-weak,#f0f0f0);--wp-ui-notice-border-color:var(--wpds-color-stroke-surface-neutral,#d8d8d8);--wp-ui-notice-text-color:var(--wpds-color-fg-content-neutral,#1e1e1e);--wp-ui-notice-decorative-icon-color:var(--wpds-color-fg-content-neutral,#1e1e1e);align-items:start;background-color:var(--wp-ui-notice-background-color);border:1px solid var(--wp-ui-notice-border-color);border-radius:var(--wpds-border-radius-lg,8px);display:grid;grid-template-columns:auto 1fr auto;padding:var(--wpds-dimension-padding-md,12px)}.d0a25570cb528528__icon{color:var(--wp-ui-notice-decorative-icon-color);grid-column:1;grid-row:1;margin-inline-end:var(--wpds-dimension-gap-xs,4px)}.b5397fb9d05389e3__title{font-family:var(--wpds-font-family-heading,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-weight:var(--wpds-font-weight-medium,499)}._1904b570a89bb815__description,.b5397fb9d05389e3__title{color:var(--wp-ui-notice-text-color);font-size:var(--wpds-font-size-md,13px);grid-column:2;line-height:var(--wpds-font-line-height-sm,20px);padding-block:var(--text-vertical-padding)}._1904b570a89bb815__description{text-wrap:pretty;font-family:var(--wpds-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-weight:var(--wpds-font-weight-regular,400)}._0a1270dcdd79c031__actions{display:flex;flex-wrap:wrap;gap:var(--wpds-dimension-gap-md,12px);grid-column:2}._4145abab73d17514__notice:has(._1904b570a89bb815__description) ._0a1270dcdd79c031__actions,._4145abab73d17514__notice:has(.b5397fb9d05389e3__title) ._0a1270dcdd79c031__actions{margin-block-start:var(--wpds-dimension-gap-sm,8px)}._983740ab855c4e09__action-button{flex-shrink:0}.d329e7416d368d31__action-link{color:var(--wpds-color-fg-interactive-neutral,#1e1e1e);flex-shrink:0;font-family:var(--wpds-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-size:var(--wpds-font-size-md,13px);font-weight:var(--wpds-font-weight-regular,400);line-height:var(--wpds-font-line-height-sm,20px);margin-block:auto;text-decoration-color:var(--wpds-color-stroke-interactive-neutral,#8a8a8a);text-decoration-thickness:.5px;text-underline-offset:.2em;&:visited{color:var(--wpds-color-fg-interactive-neutral,#1e1e1e);text-decoration-color:var(--wpds-color-stroke-interactive-neutral,#8a8a8a)}&:active,&:hover{color:var(--wpds-color-fg-interactive-neutral-active,#1e1e1e)}&:not(:first-child){margin-inline-start:var(--wpds-dimension-gap-xs,4px)}&:not(:last-child){margin-inline-end:var(--wpds-dimension-gap-xs,4px)}}._487e6a5c1375f7dc__close-icon{grid-column:3;grid-row:1;margin-inline-start:var(--wpds-dimension-gap-xs,4px)}._531c140826094795__is-info{--wp-ui-notice-background-color:var(--wpds-color-bg-surface-info-weak,#f2f9ff);--wp-ui-notice-border-color:var(--wpds-color-stroke-surface-info,#9fbcdc);--wp-ui-notice-text-color:var(--wpds-color-fg-content-info,#001b4f);--wp-ui-notice-decorative-icon-color:var(--wpds-color-fg-content-info-weak,#006bd7)}.ae2e1004697cce95__is-warning{--wp-ui-notice-background-color:var(--wpds-color-bg-surface-warning-weak,#fff7e0);--wp-ui-notice-border-color:var(--wpds-color-stroke-surface-warning,#d0b381);--wp-ui-notice-text-color:var(--wpds-color-fg-content-warning,#2e1900);--wp-ui-notice-decorative-icon-color:var(--wpds-color-fg-content-warning-weak,#926300)}._2e614a76af494837__is-success{--wp-ui-notice-background-color:var(--wpds-color-bg-surface-success-weak,#eaffed);--wp-ui-notice-border-color:var(--wpds-color-stroke-surface-success,#8ac894);--wp-ui-notice-text-color:var(--wpds-color-fg-content-success,#002900);--wp-ui-notice-decorative-icon-color:var(--wpds-color-fg-content-success-weak,#007f30)}.af00331ae17a0065__is-error{--wp-ui-notice-background-color:var(--wpds-color-bg-surface-error-weak,#fff6f4);--wp-ui-notice-border-color:var(--wpds-color-stroke-surface-error,#daa39b);--wp-ui-notice-text-color:var(--wpds-color-fg-content-error,#470000);--wp-ui-notice-decorative-icon-color:var(--wpds-color-fg-content-error-weak,#cc1818)}}@layer wp-ui-compositions{._487e6a5c1375f7dc__close-icon,._983740ab855c4e09__action-button:is(._8ddb8fb33fbf3d38__is-action-button-outline,._77bbde495a8a0af3__is-action-button-minimal){--wp-ui-button-background-color-active:color-mix(in srgb,#0000 50%,var(--wpds-color-bg-interactive-neutral-weak-active,#eaeaea))}}'));
|
|
45
|
+
document.head.appendChild(style);
|
|
46
|
+
}
|
|
47
|
+
var style_default = { "notice": "_4145abab73d17514__notice", "icon": "d0a25570cb528528__icon", "title": "b5397fb9d05389e3__title", "description": "_1904b570a89bb815__description", "actions": "_0a1270dcdd79c031__actions", "action-button": "_983740ab855c4e09__action-button", "action-link": "d329e7416d368d31__action-link", "close-icon": "_487e6a5c1375f7dc__close-icon", "is-info": "_531c140826094795__is-info", "is-warning": "ae2e1004697cce95__is-warning", "is-success": "_2e614a76af494837__is-success", "is-error": "af00331ae17a0065__is-error", "is-action-button-outline": "_8ddb8fb33fbf3d38__is-action-button-outline", "is-action-button-minimal": "_77bbde495a8a0af3__is-action-button-minimal" };
|
|
48
|
+
|
|
49
|
+
// packages/ui/src/notice/action-link.tsx
|
|
50
|
+
var ActionLink = (0, import_element.forwardRef)(
|
|
51
|
+
function NoticeActionLink({ className, render, ...props }, ref) {
|
|
52
|
+
const element = (0, import_react.useRender)({
|
|
53
|
+
defaultTagName: "a",
|
|
54
|
+
render,
|
|
55
|
+
ref,
|
|
56
|
+
props: (0, import_react.mergeProps)(
|
|
57
|
+
{
|
|
58
|
+
className: (0, import_clsx.default)(style_default["action-link"], className)
|
|
59
|
+
},
|
|
60
|
+
props
|
|
61
|
+
)
|
|
62
|
+
});
|
|
63
|
+
return element;
|
|
64
|
+
}
|
|
65
|
+
);
|
|
66
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
67
|
+
0 && (module.exports = {
|
|
68
|
+
ActionLink
|
|
69
|
+
});
|
|
70
|
+
//# sourceMappingURL=action-link.cjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/notice/action-link.tsx", "../../src/notice/style.module.css"],
|
|
4
|
+
"sourcesContent": ["import { forwardRef } from '@wordpress/element';\nimport { useRender, mergeProps } from '@base-ui/react';\nimport clsx from 'clsx';\nimport type { ActionLinkProps } from './types';\nimport styles from './style.module.css';\n\n/**\n * An action link for use within Notice.Actions.\n *\n * TODO: This should use a shared Link component.\n */\nexport const ActionLink = forwardRef< HTMLAnchorElement, ActionLinkProps >(\n\tfunction NoticeActionLink( { className, render, ...props }, ref ) {\n\t\tconst element = useRender( {\n\t\t\tdefaultTagName: 'a',\n\t\t\trender,\n\t\t\tref,\n\t\t\tprops: mergeProps< 'a' >(\n\t\t\t\t{\n\t\t\t\t\tclassName: clsx( styles[ 'action-link' ], className ),\n\t\t\t\t},\n\t\t\t\tprops\n\t\t\t),\n\t\t} );\n\n\t\treturn element;\n\t}\n);\n", "if (typeof document !== 'undefined' && process.env.NODE_ENV !== 'test' && !document.head.querySelector(\"style[data-wp-hash='6925b16354']\")) {\n\tconst style = document.createElement(\"style\");\n\tstyle.setAttribute(\"data-wp-hash\", \"6925b16354\");\n\tstyle.appendChild(document.createTextNode(\"@layer wp-ui-utilities, wp-ui-components, wp-ui-compositions, wp-ui-overrides;@layer wp-ui-components{._4145abab73d17514__notice{--icon-height:24px;--text-vertical-padding:calc((var(--icon-height) - var(--wpds-font-line-height-sm, 20px))/2);--wp-ui-notice-background-color:var(--wpds-color-bg-surface-neutral-weak,#f0f0f0);--wp-ui-notice-border-color:var(--wpds-color-stroke-surface-neutral,#d8d8d8);--wp-ui-notice-text-color:var(--wpds-color-fg-content-neutral,#1e1e1e);--wp-ui-notice-decorative-icon-color:var(--wpds-color-fg-content-neutral,#1e1e1e);align-items:start;background-color:var(--wp-ui-notice-background-color);border:1px solid var(--wp-ui-notice-border-color);border-radius:var(--wpds-border-radius-lg,8px);display:grid;grid-template-columns:auto 1fr auto;padding:var(--wpds-dimension-padding-md,12px)}.d0a25570cb528528__icon{color:var(--wp-ui-notice-decorative-icon-color);grid-column:1;grid-row:1;margin-inline-end:var(--wpds-dimension-gap-xs,4px)}.b5397fb9d05389e3__title{font-family:var(--wpds-font-family-heading,-apple-system,system-ui,\\\"Segoe UI\\\",\\\"Roboto\\\",\\\"Oxygen-Sans\\\",\\\"Ubuntu\\\",\\\"Cantarell\\\",\\\"Helvetica Neue\\\",sans-serif);font-weight:var(--wpds-font-weight-medium,499)}._1904b570a89bb815__description,.b5397fb9d05389e3__title{color:var(--wp-ui-notice-text-color);font-size:var(--wpds-font-size-md,13px);grid-column:2;line-height:var(--wpds-font-line-height-sm,20px);padding-block:var(--text-vertical-padding)}._1904b570a89bb815__description{text-wrap:pretty;font-family:var(--wpds-font-family-body,-apple-system,system-ui,\\\"Segoe UI\\\",\\\"Roboto\\\",\\\"Oxygen-Sans\\\",\\\"Ubuntu\\\",\\\"Cantarell\\\",\\\"Helvetica Neue\\\",sans-serif);font-weight:var(--wpds-font-weight-regular,400)}._0a1270dcdd79c031__actions{display:flex;flex-wrap:wrap;gap:var(--wpds-dimension-gap-md,12px);grid-column:2}._4145abab73d17514__notice:has(._1904b570a89bb815__description) ._0a1270dcdd79c031__actions,._4145abab73d17514__notice:has(.b5397fb9d05389e3__title) ._0a1270dcdd79c031__actions{margin-block-start:var(--wpds-dimension-gap-sm,8px)}._983740ab855c4e09__action-button{flex-shrink:0}.d329e7416d368d31__action-link{color:var(--wpds-color-fg-interactive-neutral,#1e1e1e);flex-shrink:0;font-family:var(--wpds-font-family-body,-apple-system,system-ui,\\\"Segoe UI\\\",\\\"Roboto\\\",\\\"Oxygen-Sans\\\",\\\"Ubuntu\\\",\\\"Cantarell\\\",\\\"Helvetica Neue\\\",sans-serif);font-size:var(--wpds-font-size-md,13px);font-weight:var(--wpds-font-weight-regular,400);line-height:var(--wpds-font-line-height-sm,20px);margin-block:auto;text-decoration-color:var(--wpds-color-stroke-interactive-neutral,#8a8a8a);text-decoration-thickness:.5px;text-underline-offset:.2em;&:visited{color:var(--wpds-color-fg-interactive-neutral,#1e1e1e);text-decoration-color:var(--wpds-color-stroke-interactive-neutral,#8a8a8a)}&:active,&:hover{color:var(--wpds-color-fg-interactive-neutral-active,#1e1e1e)}&:not(:first-child){margin-inline-start:var(--wpds-dimension-gap-xs,4px)}&:not(:last-child){margin-inline-end:var(--wpds-dimension-gap-xs,4px)}}._487e6a5c1375f7dc__close-icon{grid-column:3;grid-row:1;margin-inline-start:var(--wpds-dimension-gap-xs,4px)}._531c140826094795__is-info{--wp-ui-notice-background-color:var(--wpds-color-bg-surface-info-weak,#f2f9ff);--wp-ui-notice-border-color:var(--wpds-color-stroke-surface-info,#9fbcdc);--wp-ui-notice-text-color:var(--wpds-color-fg-content-info,#001b4f);--wp-ui-notice-decorative-icon-color:var(--wpds-color-fg-content-info-weak,#006bd7)}.ae2e1004697cce95__is-warning{--wp-ui-notice-background-color:var(--wpds-color-bg-surface-warning-weak,#fff7e0);--wp-ui-notice-border-color:var(--wpds-color-stroke-surface-warning,#d0b381);--wp-ui-notice-text-color:var(--wpds-color-fg-content-warning,#2e1900);--wp-ui-notice-decorative-icon-color:var(--wpds-color-fg-content-warning-weak,#926300)}._2e614a76af494837__is-success{--wp-ui-notice-background-color:var(--wpds-color-bg-surface-success-weak,#eaffed);--wp-ui-notice-border-color:var(--wpds-color-stroke-surface-success,#8ac894);--wp-ui-notice-text-color:var(--wpds-color-fg-content-success,#002900);--wp-ui-notice-decorative-icon-color:var(--wpds-color-fg-content-success-weak,#007f30)}.af00331ae17a0065__is-error{--wp-ui-notice-background-color:var(--wpds-color-bg-surface-error-weak,#fff6f4);--wp-ui-notice-border-color:var(--wpds-color-stroke-surface-error,#daa39b);--wp-ui-notice-text-color:var(--wpds-color-fg-content-error,#470000);--wp-ui-notice-decorative-icon-color:var(--wpds-color-fg-content-error-weak,#cc1818)}}@layer wp-ui-compositions{._487e6a5c1375f7dc__close-icon,._983740ab855c4e09__action-button:is(._8ddb8fb33fbf3d38__is-action-button-outline,._77bbde495a8a0af3__is-action-button-minimal){--wp-ui-button-background-color-active:color-mix(in srgb,#0000 50%,var(--wpds-color-bg-interactive-neutral-weak-active,#eaeaea))}}\"));\n\tdocument.head.appendChild(style);\n}\nexport default {\"notice\":\"_4145abab73d17514__notice\",\"icon\":\"d0a25570cb528528__icon\",\"title\":\"b5397fb9d05389e3__title\",\"description\":\"_1904b570a89bb815__description\",\"actions\":\"_0a1270dcdd79c031__actions\",\"action-button\":\"_983740ab855c4e09__action-button\",\"action-link\":\"d329e7416d368d31__action-link\",\"close-icon\":\"_487e6a5c1375f7dc__close-icon\",\"is-info\":\"_531c140826094795__is-info\",\"is-warning\":\"ae2e1004697cce95__is-warning\",\"is-success\":\"_2e614a76af494837__is-success\",\"is-error\":\"af00331ae17a0065__is-error\",\"is-action-button-outline\":\"_8ddb8fb33fbf3d38__is-action-button-outline\",\"is-action-button-minimal\":\"_77bbde495a8a0af3__is-action-button-minimal\"};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qBAA2B;AAC3B,mBAAsC;AACtC,kBAAiB;;;ACFjB,IAAI,OAAO,aAAa,eAAe,QAAQ,IAAI,aAAa,UAAU,CAAC,SAAS,KAAK,cAAc,kCAAkC,GAAG;AAC3I,QAAM,QAAQ,SAAS,cAAc,OAAO;AAC5C,QAAM,aAAa,gBAAgB,YAAY;AAC/C,QAAM,YAAY,SAAS,eAAe,6oJAAirJ,CAAC;AAC5tJ,WAAS,KAAK,YAAY,KAAK;AAChC;AACA,IAAO,gBAAQ,EAAC,UAAS,6BAA4B,QAAO,0BAAyB,SAAQ,2BAA0B,eAAc,kCAAiC,WAAU,8BAA6B,iBAAgB,oCAAmC,eAAc,iCAAgC,cAAa,iCAAgC,WAAU,8BAA6B,cAAa,gCAA+B,cAAa,iCAAgC,YAAW,8BAA6B,4BAA2B,+CAA8C,4BAA2B,8CAA6C;;;ADK7oB,IAAM,iBAAa;AAAA,EACzB,SAAS,iBAAkB,EAAE,WAAW,QAAQ,GAAG,MAAM,GAAG,KAAM;AACjE,UAAM,cAAU,wBAAW;AAAA,MAC1B,gBAAgB;AAAA,MAChB;AAAA,MACA;AAAA,MACA,WAAO;AAAA,QACN;AAAA,UACC,eAAW,YAAAA,SAAM,cAAQ,aAAc,GAAG,SAAU;AAAA,QACrD;AAAA,QACA;AAAA,MACD;AAAA,IACD,CAAE;AAEF,WAAO;AAAA,EACR;AACD;",
|
|
6
|
+
"names": ["clsx"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// packages/ui/src/notice/actions.tsx
|
|
21
|
+
var actions_exports = {};
|
|
22
|
+
__export(actions_exports, {
|
|
23
|
+
Actions: () => Actions
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(actions_exports);
|
|
26
|
+
var import_element = require("@wordpress/element");
|
|
27
|
+
var import_react = require("@base-ui/react");
|
|
28
|
+
|
|
29
|
+
// packages/ui/src/notice/style.module.css
|
|
30
|
+
if (typeof document !== "undefined" && process.env.NODE_ENV !== "test" && !document.head.querySelector("style[data-wp-hash='6925b16354']")) {
|
|
31
|
+
const style = document.createElement("style");
|
|
32
|
+
style.setAttribute("data-wp-hash", "6925b16354");
|
|
33
|
+
style.appendChild(document.createTextNode('@layer wp-ui-utilities, wp-ui-components, wp-ui-compositions, wp-ui-overrides;@layer wp-ui-components{._4145abab73d17514__notice{--icon-height:24px;--text-vertical-padding:calc((var(--icon-height) - var(--wpds-font-line-height-sm, 20px))/2);--wp-ui-notice-background-color:var(--wpds-color-bg-surface-neutral-weak,#f0f0f0);--wp-ui-notice-border-color:var(--wpds-color-stroke-surface-neutral,#d8d8d8);--wp-ui-notice-text-color:var(--wpds-color-fg-content-neutral,#1e1e1e);--wp-ui-notice-decorative-icon-color:var(--wpds-color-fg-content-neutral,#1e1e1e);align-items:start;background-color:var(--wp-ui-notice-background-color);border:1px solid var(--wp-ui-notice-border-color);border-radius:var(--wpds-border-radius-lg,8px);display:grid;grid-template-columns:auto 1fr auto;padding:var(--wpds-dimension-padding-md,12px)}.d0a25570cb528528__icon{color:var(--wp-ui-notice-decorative-icon-color);grid-column:1;grid-row:1;margin-inline-end:var(--wpds-dimension-gap-xs,4px)}.b5397fb9d05389e3__title{font-family:var(--wpds-font-family-heading,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-weight:var(--wpds-font-weight-medium,499)}._1904b570a89bb815__description,.b5397fb9d05389e3__title{color:var(--wp-ui-notice-text-color);font-size:var(--wpds-font-size-md,13px);grid-column:2;line-height:var(--wpds-font-line-height-sm,20px);padding-block:var(--text-vertical-padding)}._1904b570a89bb815__description{text-wrap:pretty;font-family:var(--wpds-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-weight:var(--wpds-font-weight-regular,400)}._0a1270dcdd79c031__actions{display:flex;flex-wrap:wrap;gap:var(--wpds-dimension-gap-md,12px);grid-column:2}._4145abab73d17514__notice:has(._1904b570a89bb815__description) ._0a1270dcdd79c031__actions,._4145abab73d17514__notice:has(.b5397fb9d05389e3__title) ._0a1270dcdd79c031__actions{margin-block-start:var(--wpds-dimension-gap-sm,8px)}._983740ab855c4e09__action-button{flex-shrink:0}.d329e7416d368d31__action-link{color:var(--wpds-color-fg-interactive-neutral,#1e1e1e);flex-shrink:0;font-family:var(--wpds-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-size:var(--wpds-font-size-md,13px);font-weight:var(--wpds-font-weight-regular,400);line-height:var(--wpds-font-line-height-sm,20px);margin-block:auto;text-decoration-color:var(--wpds-color-stroke-interactive-neutral,#8a8a8a);text-decoration-thickness:.5px;text-underline-offset:.2em;&:visited{color:var(--wpds-color-fg-interactive-neutral,#1e1e1e);text-decoration-color:var(--wpds-color-stroke-interactive-neutral,#8a8a8a)}&:active,&:hover{color:var(--wpds-color-fg-interactive-neutral-active,#1e1e1e)}&:not(:first-child){margin-inline-start:var(--wpds-dimension-gap-xs,4px)}&:not(:last-child){margin-inline-end:var(--wpds-dimension-gap-xs,4px)}}._487e6a5c1375f7dc__close-icon{grid-column:3;grid-row:1;margin-inline-start:var(--wpds-dimension-gap-xs,4px)}._531c140826094795__is-info{--wp-ui-notice-background-color:var(--wpds-color-bg-surface-info-weak,#f2f9ff);--wp-ui-notice-border-color:var(--wpds-color-stroke-surface-info,#9fbcdc);--wp-ui-notice-text-color:var(--wpds-color-fg-content-info,#001b4f);--wp-ui-notice-decorative-icon-color:var(--wpds-color-fg-content-info-weak,#006bd7)}.ae2e1004697cce95__is-warning{--wp-ui-notice-background-color:var(--wpds-color-bg-surface-warning-weak,#fff7e0);--wp-ui-notice-border-color:var(--wpds-color-stroke-surface-warning,#d0b381);--wp-ui-notice-text-color:var(--wpds-color-fg-content-warning,#2e1900);--wp-ui-notice-decorative-icon-color:var(--wpds-color-fg-content-warning-weak,#926300)}._2e614a76af494837__is-success{--wp-ui-notice-background-color:var(--wpds-color-bg-surface-success-weak,#eaffed);--wp-ui-notice-border-color:var(--wpds-color-stroke-surface-success,#8ac894);--wp-ui-notice-text-color:var(--wpds-color-fg-content-success,#002900);--wp-ui-notice-decorative-icon-color:var(--wpds-color-fg-content-success-weak,#007f30)}.af00331ae17a0065__is-error{--wp-ui-notice-background-color:var(--wpds-color-bg-surface-error-weak,#fff6f4);--wp-ui-notice-border-color:var(--wpds-color-stroke-surface-error,#daa39b);--wp-ui-notice-text-color:var(--wpds-color-fg-content-error,#470000);--wp-ui-notice-decorative-icon-color:var(--wpds-color-fg-content-error-weak,#cc1818)}}@layer wp-ui-compositions{._487e6a5c1375f7dc__close-icon,._983740ab855c4e09__action-button:is(._8ddb8fb33fbf3d38__is-action-button-outline,._77bbde495a8a0af3__is-action-button-minimal){--wp-ui-button-background-color-active:color-mix(in srgb,#0000 50%,var(--wpds-color-bg-interactive-neutral-weak-active,#eaeaea))}}'));
|
|
34
|
+
document.head.appendChild(style);
|
|
35
|
+
}
|
|
36
|
+
var style_default = { "notice": "_4145abab73d17514__notice", "icon": "d0a25570cb528528__icon", "title": "b5397fb9d05389e3__title", "description": "_1904b570a89bb815__description", "actions": "_0a1270dcdd79c031__actions", "action-button": "_983740ab855c4e09__action-button", "action-link": "d329e7416d368d31__action-link", "close-icon": "_487e6a5c1375f7dc__close-icon", "is-info": "_531c140826094795__is-info", "is-warning": "ae2e1004697cce95__is-warning", "is-success": "_2e614a76af494837__is-success", "is-error": "af00331ae17a0065__is-error", "is-action-button-outline": "_8ddb8fb33fbf3d38__is-action-button-outline", "is-action-button-minimal": "_77bbde495a8a0af3__is-action-button-minimal" };
|
|
37
|
+
|
|
38
|
+
// packages/ui/src/notice/actions.tsx
|
|
39
|
+
var Actions = (0, import_element.forwardRef)(
|
|
40
|
+
function NoticeActions({ render, ...props }, ref) {
|
|
41
|
+
const element = (0, import_react.useRender)({
|
|
42
|
+
defaultTagName: "div",
|
|
43
|
+
render,
|
|
44
|
+
ref,
|
|
45
|
+
props: (0, import_react.mergeProps)(
|
|
46
|
+
{
|
|
47
|
+
className: style_default.actions
|
|
48
|
+
},
|
|
49
|
+
props
|
|
50
|
+
)
|
|
51
|
+
});
|
|
52
|
+
return element;
|
|
53
|
+
}
|
|
54
|
+
);
|
|
55
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
56
|
+
0 && (module.exports = {
|
|
57
|
+
Actions
|
|
58
|
+
});
|
|
59
|
+
//# sourceMappingURL=actions.cjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/notice/actions.tsx", "../../src/notice/style.module.css"],
|
|
4
|
+
"sourcesContent": ["import { forwardRef } from '@wordpress/element';\nimport { useRender, mergeProps } from '@base-ui/react';\nimport type { ActionsProps } from './types';\nimport styles from './style.module.css';\n\n/**\n * A container for Notice.ActionButton and Notice.ActionLink.\n */\nexport const Actions = forwardRef< HTMLDivElement, ActionsProps >(\n\tfunction NoticeActions( { render, ...props }, ref ) {\n\t\tconst element = useRender( {\n\t\t\tdefaultTagName: 'div',\n\t\t\trender,\n\t\t\tref,\n\t\t\tprops: mergeProps< 'div' >(\n\t\t\t\t{\n\t\t\t\t\tclassName: styles.actions,\n\t\t\t\t},\n\t\t\t\tprops\n\t\t\t),\n\t\t} );\n\n\t\treturn element;\n\t}\n);\n", "if (typeof document !== 'undefined' && process.env.NODE_ENV !== 'test' && !document.head.querySelector(\"style[data-wp-hash='6925b16354']\")) {\n\tconst style = document.createElement(\"style\");\n\tstyle.setAttribute(\"data-wp-hash\", \"6925b16354\");\n\tstyle.appendChild(document.createTextNode(\"@layer wp-ui-utilities, wp-ui-components, wp-ui-compositions, wp-ui-overrides;@layer wp-ui-components{._4145abab73d17514__notice{--icon-height:24px;--text-vertical-padding:calc((var(--icon-height) - var(--wpds-font-line-height-sm, 20px))/2);--wp-ui-notice-background-color:var(--wpds-color-bg-surface-neutral-weak,#f0f0f0);--wp-ui-notice-border-color:var(--wpds-color-stroke-surface-neutral,#d8d8d8);--wp-ui-notice-text-color:var(--wpds-color-fg-content-neutral,#1e1e1e);--wp-ui-notice-decorative-icon-color:var(--wpds-color-fg-content-neutral,#1e1e1e);align-items:start;background-color:var(--wp-ui-notice-background-color);border:1px solid var(--wp-ui-notice-border-color);border-radius:var(--wpds-border-radius-lg,8px);display:grid;grid-template-columns:auto 1fr auto;padding:var(--wpds-dimension-padding-md,12px)}.d0a25570cb528528__icon{color:var(--wp-ui-notice-decorative-icon-color);grid-column:1;grid-row:1;margin-inline-end:var(--wpds-dimension-gap-xs,4px)}.b5397fb9d05389e3__title{font-family:var(--wpds-font-family-heading,-apple-system,system-ui,\\\"Segoe UI\\\",\\\"Roboto\\\",\\\"Oxygen-Sans\\\",\\\"Ubuntu\\\",\\\"Cantarell\\\",\\\"Helvetica Neue\\\",sans-serif);font-weight:var(--wpds-font-weight-medium,499)}._1904b570a89bb815__description,.b5397fb9d05389e3__title{color:var(--wp-ui-notice-text-color);font-size:var(--wpds-font-size-md,13px);grid-column:2;line-height:var(--wpds-font-line-height-sm,20px);padding-block:var(--text-vertical-padding)}._1904b570a89bb815__description{text-wrap:pretty;font-family:var(--wpds-font-family-body,-apple-system,system-ui,\\\"Segoe UI\\\",\\\"Roboto\\\",\\\"Oxygen-Sans\\\",\\\"Ubuntu\\\",\\\"Cantarell\\\",\\\"Helvetica Neue\\\",sans-serif);font-weight:var(--wpds-font-weight-regular,400)}._0a1270dcdd79c031__actions{display:flex;flex-wrap:wrap;gap:var(--wpds-dimension-gap-md,12px);grid-column:2}._4145abab73d17514__notice:has(._1904b570a89bb815__description) ._0a1270dcdd79c031__actions,._4145abab73d17514__notice:has(.b5397fb9d05389e3__title) ._0a1270dcdd79c031__actions{margin-block-start:var(--wpds-dimension-gap-sm,8px)}._983740ab855c4e09__action-button{flex-shrink:0}.d329e7416d368d31__action-link{color:var(--wpds-color-fg-interactive-neutral,#1e1e1e);flex-shrink:0;font-family:var(--wpds-font-family-body,-apple-system,system-ui,\\\"Segoe UI\\\",\\\"Roboto\\\",\\\"Oxygen-Sans\\\",\\\"Ubuntu\\\",\\\"Cantarell\\\",\\\"Helvetica Neue\\\",sans-serif);font-size:var(--wpds-font-size-md,13px);font-weight:var(--wpds-font-weight-regular,400);line-height:var(--wpds-font-line-height-sm,20px);margin-block:auto;text-decoration-color:var(--wpds-color-stroke-interactive-neutral,#8a8a8a);text-decoration-thickness:.5px;text-underline-offset:.2em;&:visited{color:var(--wpds-color-fg-interactive-neutral,#1e1e1e);text-decoration-color:var(--wpds-color-stroke-interactive-neutral,#8a8a8a)}&:active,&:hover{color:var(--wpds-color-fg-interactive-neutral-active,#1e1e1e)}&:not(:first-child){margin-inline-start:var(--wpds-dimension-gap-xs,4px)}&:not(:last-child){margin-inline-end:var(--wpds-dimension-gap-xs,4px)}}._487e6a5c1375f7dc__close-icon{grid-column:3;grid-row:1;margin-inline-start:var(--wpds-dimension-gap-xs,4px)}._531c140826094795__is-info{--wp-ui-notice-background-color:var(--wpds-color-bg-surface-info-weak,#f2f9ff);--wp-ui-notice-border-color:var(--wpds-color-stroke-surface-info,#9fbcdc);--wp-ui-notice-text-color:var(--wpds-color-fg-content-info,#001b4f);--wp-ui-notice-decorative-icon-color:var(--wpds-color-fg-content-info-weak,#006bd7)}.ae2e1004697cce95__is-warning{--wp-ui-notice-background-color:var(--wpds-color-bg-surface-warning-weak,#fff7e0);--wp-ui-notice-border-color:var(--wpds-color-stroke-surface-warning,#d0b381);--wp-ui-notice-text-color:var(--wpds-color-fg-content-warning,#2e1900);--wp-ui-notice-decorative-icon-color:var(--wpds-color-fg-content-warning-weak,#926300)}._2e614a76af494837__is-success{--wp-ui-notice-background-color:var(--wpds-color-bg-surface-success-weak,#eaffed);--wp-ui-notice-border-color:var(--wpds-color-stroke-surface-success,#8ac894);--wp-ui-notice-text-color:var(--wpds-color-fg-content-success,#002900);--wp-ui-notice-decorative-icon-color:var(--wpds-color-fg-content-success-weak,#007f30)}.af00331ae17a0065__is-error{--wp-ui-notice-background-color:var(--wpds-color-bg-surface-error-weak,#fff6f4);--wp-ui-notice-border-color:var(--wpds-color-stroke-surface-error,#daa39b);--wp-ui-notice-text-color:var(--wpds-color-fg-content-error,#470000);--wp-ui-notice-decorative-icon-color:var(--wpds-color-fg-content-error-weak,#cc1818)}}@layer wp-ui-compositions{._487e6a5c1375f7dc__close-icon,._983740ab855c4e09__action-button:is(._8ddb8fb33fbf3d38__is-action-button-outline,._77bbde495a8a0af3__is-action-button-minimal){--wp-ui-button-background-color-active:color-mix(in srgb,#0000 50%,var(--wpds-color-bg-interactive-neutral-weak-active,#eaeaea))}}\"));\n\tdocument.head.appendChild(style);\n}\nexport default {\"notice\":\"_4145abab73d17514__notice\",\"icon\":\"d0a25570cb528528__icon\",\"title\":\"b5397fb9d05389e3__title\",\"description\":\"_1904b570a89bb815__description\",\"actions\":\"_0a1270dcdd79c031__actions\",\"action-button\":\"_983740ab855c4e09__action-button\",\"action-link\":\"d329e7416d368d31__action-link\",\"close-icon\":\"_487e6a5c1375f7dc__close-icon\",\"is-info\":\"_531c140826094795__is-info\",\"is-warning\":\"ae2e1004697cce95__is-warning\",\"is-success\":\"_2e614a76af494837__is-success\",\"is-error\":\"af00331ae17a0065__is-error\",\"is-action-button-outline\":\"_8ddb8fb33fbf3d38__is-action-button-outline\",\"is-action-button-minimal\":\"_77bbde495a8a0af3__is-action-button-minimal\"};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qBAA2B;AAC3B,mBAAsC;;;ACDtC,IAAI,OAAO,aAAa,eAAe,QAAQ,IAAI,aAAa,UAAU,CAAC,SAAS,KAAK,cAAc,kCAAkC,GAAG;AAC3I,QAAM,QAAQ,SAAS,cAAc,OAAO;AAC5C,QAAM,aAAa,gBAAgB,YAAY;AAC/C,QAAM,YAAY,SAAS,eAAe,6oJAAirJ,CAAC;AAC5tJ,WAAS,KAAK,YAAY,KAAK;AAChC;AACA,IAAO,gBAAQ,EAAC,UAAS,6BAA4B,QAAO,0BAAyB,SAAQ,2BAA0B,eAAc,kCAAiC,WAAU,8BAA6B,iBAAgB,oCAAmC,eAAc,iCAAgC,cAAa,iCAAgC,WAAU,8BAA6B,cAAa,gCAA+B,cAAa,iCAAgC,YAAW,8BAA6B,4BAA2B,+CAA8C,4BAA2B,8CAA6C;;;ADE7oB,IAAM,cAAU;AAAA,EACtB,SAAS,cAAe,EAAE,QAAQ,GAAG,MAAM,GAAG,KAAM;AACnD,UAAM,cAAU,wBAAW;AAAA,MAC1B,gBAAgB;AAAA,MAChB;AAAA,MACA;AAAA,MACA,WAAO;AAAA,QACN;AAAA,UACC,WAAW,cAAO;AAAA,QACnB;AAAA,QACA;AAAA,MACD;AAAA,IACD,CAAE;AAEF,WAAO;AAAA,EACR;AACD;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
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/notice/close-icon.tsx
|
|
31
|
+
var close_icon_exports = {};
|
|
32
|
+
__export(close_icon_exports, {
|
|
33
|
+
CloseIcon: () => CloseIcon
|
|
34
|
+
});
|
|
35
|
+
module.exports = __toCommonJS(close_icon_exports);
|
|
36
|
+
var import_element = require("@wordpress/element");
|
|
37
|
+
var import_i18n = require("@wordpress/i18n");
|
|
38
|
+
var import_icons = require("@wordpress/icons");
|
|
39
|
+
var import_clsx = __toESM(require("clsx"));
|
|
40
|
+
var import_icon_button = require("../icon-button/index.cjs");
|
|
41
|
+
|
|
42
|
+
// packages/ui/src/notice/style.module.css
|
|
43
|
+
if (typeof document !== "undefined" && process.env.NODE_ENV !== "test" && !document.head.querySelector("style[data-wp-hash='6925b16354']")) {
|
|
44
|
+
const style = document.createElement("style");
|
|
45
|
+
style.setAttribute("data-wp-hash", "6925b16354");
|
|
46
|
+
style.appendChild(document.createTextNode('@layer wp-ui-utilities, wp-ui-components, wp-ui-compositions, wp-ui-overrides;@layer wp-ui-components{._4145abab73d17514__notice{--icon-height:24px;--text-vertical-padding:calc((var(--icon-height) - var(--wpds-font-line-height-sm, 20px))/2);--wp-ui-notice-background-color:var(--wpds-color-bg-surface-neutral-weak,#f0f0f0);--wp-ui-notice-border-color:var(--wpds-color-stroke-surface-neutral,#d8d8d8);--wp-ui-notice-text-color:var(--wpds-color-fg-content-neutral,#1e1e1e);--wp-ui-notice-decorative-icon-color:var(--wpds-color-fg-content-neutral,#1e1e1e);align-items:start;background-color:var(--wp-ui-notice-background-color);border:1px solid var(--wp-ui-notice-border-color);border-radius:var(--wpds-border-radius-lg,8px);display:grid;grid-template-columns:auto 1fr auto;padding:var(--wpds-dimension-padding-md,12px)}.d0a25570cb528528__icon{color:var(--wp-ui-notice-decorative-icon-color);grid-column:1;grid-row:1;margin-inline-end:var(--wpds-dimension-gap-xs,4px)}.b5397fb9d05389e3__title{font-family:var(--wpds-font-family-heading,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-weight:var(--wpds-font-weight-medium,499)}._1904b570a89bb815__description,.b5397fb9d05389e3__title{color:var(--wp-ui-notice-text-color);font-size:var(--wpds-font-size-md,13px);grid-column:2;line-height:var(--wpds-font-line-height-sm,20px);padding-block:var(--text-vertical-padding)}._1904b570a89bb815__description{text-wrap:pretty;font-family:var(--wpds-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-weight:var(--wpds-font-weight-regular,400)}._0a1270dcdd79c031__actions{display:flex;flex-wrap:wrap;gap:var(--wpds-dimension-gap-md,12px);grid-column:2}._4145abab73d17514__notice:has(._1904b570a89bb815__description) ._0a1270dcdd79c031__actions,._4145abab73d17514__notice:has(.b5397fb9d05389e3__title) ._0a1270dcdd79c031__actions{margin-block-start:var(--wpds-dimension-gap-sm,8px)}._983740ab855c4e09__action-button{flex-shrink:0}.d329e7416d368d31__action-link{color:var(--wpds-color-fg-interactive-neutral,#1e1e1e);flex-shrink:0;font-family:var(--wpds-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-size:var(--wpds-font-size-md,13px);font-weight:var(--wpds-font-weight-regular,400);line-height:var(--wpds-font-line-height-sm,20px);margin-block:auto;text-decoration-color:var(--wpds-color-stroke-interactive-neutral,#8a8a8a);text-decoration-thickness:.5px;text-underline-offset:.2em;&:visited{color:var(--wpds-color-fg-interactive-neutral,#1e1e1e);text-decoration-color:var(--wpds-color-stroke-interactive-neutral,#8a8a8a)}&:active,&:hover{color:var(--wpds-color-fg-interactive-neutral-active,#1e1e1e)}&:not(:first-child){margin-inline-start:var(--wpds-dimension-gap-xs,4px)}&:not(:last-child){margin-inline-end:var(--wpds-dimension-gap-xs,4px)}}._487e6a5c1375f7dc__close-icon{grid-column:3;grid-row:1;margin-inline-start:var(--wpds-dimension-gap-xs,4px)}._531c140826094795__is-info{--wp-ui-notice-background-color:var(--wpds-color-bg-surface-info-weak,#f2f9ff);--wp-ui-notice-border-color:var(--wpds-color-stroke-surface-info,#9fbcdc);--wp-ui-notice-text-color:var(--wpds-color-fg-content-info,#001b4f);--wp-ui-notice-decorative-icon-color:var(--wpds-color-fg-content-info-weak,#006bd7)}.ae2e1004697cce95__is-warning{--wp-ui-notice-background-color:var(--wpds-color-bg-surface-warning-weak,#fff7e0);--wp-ui-notice-border-color:var(--wpds-color-stroke-surface-warning,#d0b381);--wp-ui-notice-text-color:var(--wpds-color-fg-content-warning,#2e1900);--wp-ui-notice-decorative-icon-color:var(--wpds-color-fg-content-warning-weak,#926300)}._2e614a76af494837__is-success{--wp-ui-notice-background-color:var(--wpds-color-bg-surface-success-weak,#eaffed);--wp-ui-notice-border-color:var(--wpds-color-stroke-surface-success,#8ac894);--wp-ui-notice-text-color:var(--wpds-color-fg-content-success,#002900);--wp-ui-notice-decorative-icon-color:var(--wpds-color-fg-content-success-weak,#007f30)}.af00331ae17a0065__is-error{--wp-ui-notice-background-color:var(--wpds-color-bg-surface-error-weak,#fff6f4);--wp-ui-notice-border-color:var(--wpds-color-stroke-surface-error,#daa39b);--wp-ui-notice-text-color:var(--wpds-color-fg-content-error,#470000);--wp-ui-notice-decorative-icon-color:var(--wpds-color-fg-content-error-weak,#cc1818)}}@layer wp-ui-compositions{._487e6a5c1375f7dc__close-icon,._983740ab855c4e09__action-button:is(._8ddb8fb33fbf3d38__is-action-button-outline,._77bbde495a8a0af3__is-action-button-minimal){--wp-ui-button-background-color-active:color-mix(in srgb,#0000 50%,var(--wpds-color-bg-interactive-neutral-weak-active,#eaeaea))}}'));
|
|
47
|
+
document.head.appendChild(style);
|
|
48
|
+
}
|
|
49
|
+
var style_default = { "notice": "_4145abab73d17514__notice", "icon": "d0a25570cb528528__icon", "title": "b5397fb9d05389e3__title", "description": "_1904b570a89bb815__description", "actions": "_0a1270dcdd79c031__actions", "action-button": "_983740ab855c4e09__action-button", "action-link": "d329e7416d368d31__action-link", "close-icon": "_487e6a5c1375f7dc__close-icon", "is-info": "_531c140826094795__is-info", "is-warning": "ae2e1004697cce95__is-warning", "is-success": "_2e614a76af494837__is-success", "is-error": "af00331ae17a0065__is-error", "is-action-button-outline": "_8ddb8fb33fbf3d38__is-action-button-outline", "is-action-button-minimal": "_77bbde495a8a0af3__is-action-button-minimal" };
|
|
50
|
+
|
|
51
|
+
// packages/ui/src/notice/close-icon.tsx
|
|
52
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
53
|
+
var CloseIcon = (0, import_element.forwardRef)(
|
|
54
|
+
function NoticeCloseIcon({ className, icon = import_icons.closeSmall, label = (0, import_i18n.__)("Dismiss"), ...props }, ref) {
|
|
55
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
56
|
+
import_icon_button.IconButton,
|
|
57
|
+
{
|
|
58
|
+
...props,
|
|
59
|
+
ref,
|
|
60
|
+
className: (0, import_clsx.default)(style_default["close-icon"], className),
|
|
61
|
+
variant: "minimal",
|
|
62
|
+
size: "small",
|
|
63
|
+
tone: "neutral",
|
|
64
|
+
icon,
|
|
65
|
+
label
|
|
66
|
+
}
|
|
67
|
+
);
|
|
68
|
+
}
|
|
69
|
+
);
|
|
70
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
71
|
+
0 && (module.exports = {
|
|
72
|
+
CloseIcon
|
|
73
|
+
});
|
|
74
|
+
//# sourceMappingURL=close-icon.cjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/notice/close-icon.tsx", "../../src/notice/style.module.css"],
|
|
4
|
+
"sourcesContent": ["import { forwardRef } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport { closeSmall } from '@wordpress/icons';\nimport clsx from 'clsx';\nimport { IconButton } from '../icon-button';\nimport type { CloseIconProps } from './types';\nimport styles from './style.module.css';\n\n/**\n * The close button for a notice. Renders an icon button with a close icon.\n */\nexport const CloseIcon = forwardRef< HTMLButtonElement, CloseIconProps >(\n\tfunction NoticeCloseIcon(\n\t\t{ className, icon = closeSmall, label = __( 'Dismiss' ), ...props },\n\t\tref\n\t) {\n\t\treturn (\n\t\t\t<IconButton\n\t\t\t\t{ ...props }\n\t\t\t\tref={ ref }\n\t\t\t\tclassName={ clsx( styles[ 'close-icon' ], className ) }\n\t\t\t\tvariant=\"minimal\"\n\t\t\t\tsize=\"small\"\n\t\t\t\ttone=\"neutral\"\n\t\t\t\ticon={ icon }\n\t\t\t\tlabel={ label }\n\t\t\t/>\n\t\t);\n\t}\n);\n", "if (typeof document !== 'undefined' && process.env.NODE_ENV !== 'test' && !document.head.querySelector(\"style[data-wp-hash='6925b16354']\")) {\n\tconst style = document.createElement(\"style\");\n\tstyle.setAttribute(\"data-wp-hash\", \"6925b16354\");\n\tstyle.appendChild(document.createTextNode(\"@layer wp-ui-utilities, wp-ui-components, wp-ui-compositions, wp-ui-overrides;@layer wp-ui-components{._4145abab73d17514__notice{--icon-height:24px;--text-vertical-padding:calc((var(--icon-height) - var(--wpds-font-line-height-sm, 20px))/2);--wp-ui-notice-background-color:var(--wpds-color-bg-surface-neutral-weak,#f0f0f0);--wp-ui-notice-border-color:var(--wpds-color-stroke-surface-neutral,#d8d8d8);--wp-ui-notice-text-color:var(--wpds-color-fg-content-neutral,#1e1e1e);--wp-ui-notice-decorative-icon-color:var(--wpds-color-fg-content-neutral,#1e1e1e);align-items:start;background-color:var(--wp-ui-notice-background-color);border:1px solid var(--wp-ui-notice-border-color);border-radius:var(--wpds-border-radius-lg,8px);display:grid;grid-template-columns:auto 1fr auto;padding:var(--wpds-dimension-padding-md,12px)}.d0a25570cb528528__icon{color:var(--wp-ui-notice-decorative-icon-color);grid-column:1;grid-row:1;margin-inline-end:var(--wpds-dimension-gap-xs,4px)}.b5397fb9d05389e3__title{font-family:var(--wpds-font-family-heading,-apple-system,system-ui,\\\"Segoe UI\\\",\\\"Roboto\\\",\\\"Oxygen-Sans\\\",\\\"Ubuntu\\\",\\\"Cantarell\\\",\\\"Helvetica Neue\\\",sans-serif);font-weight:var(--wpds-font-weight-medium,499)}._1904b570a89bb815__description,.b5397fb9d05389e3__title{color:var(--wp-ui-notice-text-color);font-size:var(--wpds-font-size-md,13px);grid-column:2;line-height:var(--wpds-font-line-height-sm,20px);padding-block:var(--text-vertical-padding)}._1904b570a89bb815__description{text-wrap:pretty;font-family:var(--wpds-font-family-body,-apple-system,system-ui,\\\"Segoe UI\\\",\\\"Roboto\\\",\\\"Oxygen-Sans\\\",\\\"Ubuntu\\\",\\\"Cantarell\\\",\\\"Helvetica Neue\\\",sans-serif);font-weight:var(--wpds-font-weight-regular,400)}._0a1270dcdd79c031__actions{display:flex;flex-wrap:wrap;gap:var(--wpds-dimension-gap-md,12px);grid-column:2}._4145abab73d17514__notice:has(._1904b570a89bb815__description) ._0a1270dcdd79c031__actions,._4145abab73d17514__notice:has(.b5397fb9d05389e3__title) ._0a1270dcdd79c031__actions{margin-block-start:var(--wpds-dimension-gap-sm,8px)}._983740ab855c4e09__action-button{flex-shrink:0}.d329e7416d368d31__action-link{color:var(--wpds-color-fg-interactive-neutral,#1e1e1e);flex-shrink:0;font-family:var(--wpds-font-family-body,-apple-system,system-ui,\\\"Segoe UI\\\",\\\"Roboto\\\",\\\"Oxygen-Sans\\\",\\\"Ubuntu\\\",\\\"Cantarell\\\",\\\"Helvetica Neue\\\",sans-serif);font-size:var(--wpds-font-size-md,13px);font-weight:var(--wpds-font-weight-regular,400);line-height:var(--wpds-font-line-height-sm,20px);margin-block:auto;text-decoration-color:var(--wpds-color-stroke-interactive-neutral,#8a8a8a);text-decoration-thickness:.5px;text-underline-offset:.2em;&:visited{color:var(--wpds-color-fg-interactive-neutral,#1e1e1e);text-decoration-color:var(--wpds-color-stroke-interactive-neutral,#8a8a8a)}&:active,&:hover{color:var(--wpds-color-fg-interactive-neutral-active,#1e1e1e)}&:not(:first-child){margin-inline-start:var(--wpds-dimension-gap-xs,4px)}&:not(:last-child){margin-inline-end:var(--wpds-dimension-gap-xs,4px)}}._487e6a5c1375f7dc__close-icon{grid-column:3;grid-row:1;margin-inline-start:var(--wpds-dimension-gap-xs,4px)}._531c140826094795__is-info{--wp-ui-notice-background-color:var(--wpds-color-bg-surface-info-weak,#f2f9ff);--wp-ui-notice-border-color:var(--wpds-color-stroke-surface-info,#9fbcdc);--wp-ui-notice-text-color:var(--wpds-color-fg-content-info,#001b4f);--wp-ui-notice-decorative-icon-color:var(--wpds-color-fg-content-info-weak,#006bd7)}.ae2e1004697cce95__is-warning{--wp-ui-notice-background-color:var(--wpds-color-bg-surface-warning-weak,#fff7e0);--wp-ui-notice-border-color:var(--wpds-color-stroke-surface-warning,#d0b381);--wp-ui-notice-text-color:var(--wpds-color-fg-content-warning,#2e1900);--wp-ui-notice-decorative-icon-color:var(--wpds-color-fg-content-warning-weak,#926300)}._2e614a76af494837__is-success{--wp-ui-notice-background-color:var(--wpds-color-bg-surface-success-weak,#eaffed);--wp-ui-notice-border-color:var(--wpds-color-stroke-surface-success,#8ac894);--wp-ui-notice-text-color:var(--wpds-color-fg-content-success,#002900);--wp-ui-notice-decorative-icon-color:var(--wpds-color-fg-content-success-weak,#007f30)}.af00331ae17a0065__is-error{--wp-ui-notice-background-color:var(--wpds-color-bg-surface-error-weak,#fff6f4);--wp-ui-notice-border-color:var(--wpds-color-stroke-surface-error,#daa39b);--wp-ui-notice-text-color:var(--wpds-color-fg-content-error,#470000);--wp-ui-notice-decorative-icon-color:var(--wpds-color-fg-content-error-weak,#cc1818)}}@layer wp-ui-compositions{._487e6a5c1375f7dc__close-icon,._983740ab855c4e09__action-button:is(._8ddb8fb33fbf3d38__is-action-button-outline,._77bbde495a8a0af3__is-action-button-minimal){--wp-ui-button-background-color-active:color-mix(in srgb,#0000 50%,var(--wpds-color-bg-interactive-neutral-weak-active,#eaeaea))}}\"));\n\tdocument.head.appendChild(style);\n}\nexport default {\"notice\":\"_4145abab73d17514__notice\",\"icon\":\"d0a25570cb528528__icon\",\"title\":\"b5397fb9d05389e3__title\",\"description\":\"_1904b570a89bb815__description\",\"actions\":\"_0a1270dcdd79c031__actions\",\"action-button\":\"_983740ab855c4e09__action-button\",\"action-link\":\"d329e7416d368d31__action-link\",\"close-icon\":\"_487e6a5c1375f7dc__close-icon\",\"is-info\":\"_531c140826094795__is-info\",\"is-warning\":\"ae2e1004697cce95__is-warning\",\"is-success\":\"_2e614a76af494837__is-success\",\"is-error\":\"af00331ae17a0065__is-error\",\"is-action-button-outline\":\"_8ddb8fb33fbf3d38__is-action-button-outline\",\"is-action-button-minimal\":\"_77bbde495a8a0af3__is-action-button-minimal\"};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qBAA2B;AAC3B,kBAAmB;AACnB,mBAA2B;AAC3B,kBAAiB;AACjB,yBAA2B;;;ACJ3B,IAAI,OAAO,aAAa,eAAe,QAAQ,IAAI,aAAa,UAAU,CAAC,SAAS,KAAK,cAAc,kCAAkC,GAAG;AAC3I,QAAM,QAAQ,SAAS,cAAc,OAAO;AAC5C,QAAM,aAAa,gBAAgB,YAAY;AAC/C,QAAM,YAAY,SAAS,eAAe,6oJAAirJ,CAAC;AAC5tJ,WAAS,KAAK,YAAY,KAAK;AAChC;AACA,IAAO,gBAAQ,EAAC,UAAS,6BAA4B,QAAO,0BAAyB,SAAQ,2BAA0B,eAAc,kCAAiC,WAAU,8BAA6B,iBAAgB,oCAAmC,eAAc,iCAAgC,cAAa,iCAAgC,WAAU,8BAA6B,cAAa,gCAA+B,cAAa,iCAAgC,YAAW,8BAA6B,4BAA2B,+CAA8C,4BAA2B,8CAA6C;;;ADWjpB;AANI,IAAM,gBAAY;AAAA,EACxB,SAAS,gBACR,EAAE,WAAW,OAAO,yBAAY,YAAQ,gBAAI,SAAU,GAAG,GAAG,MAAM,GAClE,KACC;AACD,WACC;AAAA,MAAC;AAAA;AAAA,QACE,GAAG;AAAA,QACL;AAAA,QACA,eAAY,YAAAA,SAAM,cAAQ,YAAa,GAAG,SAAU;AAAA,QACpD,SAAQ;AAAA,QACR,MAAK;AAAA,QACL,MAAK;AAAA,QACL;AAAA,QACA;AAAA;AAAA,IACD;AAAA,EAEF;AACD;",
|
|
6
|
+
"names": ["clsx"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// packages/ui/src/notice/description.tsx
|
|
21
|
+
var description_exports = {};
|
|
22
|
+
__export(description_exports, {
|
|
23
|
+
Description: () => Description
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(description_exports);
|
|
26
|
+
var import_element = require("@wordpress/element");
|
|
27
|
+
var import_react = require("@base-ui/react");
|
|
28
|
+
|
|
29
|
+
// packages/ui/src/notice/style.module.css
|
|
30
|
+
if (typeof document !== "undefined" && process.env.NODE_ENV !== "test" && !document.head.querySelector("style[data-wp-hash='6925b16354']")) {
|
|
31
|
+
const style = document.createElement("style");
|
|
32
|
+
style.setAttribute("data-wp-hash", "6925b16354");
|
|
33
|
+
style.appendChild(document.createTextNode('@layer wp-ui-utilities, wp-ui-components, wp-ui-compositions, wp-ui-overrides;@layer wp-ui-components{._4145abab73d17514__notice{--icon-height:24px;--text-vertical-padding:calc((var(--icon-height) - var(--wpds-font-line-height-sm, 20px))/2);--wp-ui-notice-background-color:var(--wpds-color-bg-surface-neutral-weak,#f0f0f0);--wp-ui-notice-border-color:var(--wpds-color-stroke-surface-neutral,#d8d8d8);--wp-ui-notice-text-color:var(--wpds-color-fg-content-neutral,#1e1e1e);--wp-ui-notice-decorative-icon-color:var(--wpds-color-fg-content-neutral,#1e1e1e);align-items:start;background-color:var(--wp-ui-notice-background-color);border:1px solid var(--wp-ui-notice-border-color);border-radius:var(--wpds-border-radius-lg,8px);display:grid;grid-template-columns:auto 1fr auto;padding:var(--wpds-dimension-padding-md,12px)}.d0a25570cb528528__icon{color:var(--wp-ui-notice-decorative-icon-color);grid-column:1;grid-row:1;margin-inline-end:var(--wpds-dimension-gap-xs,4px)}.b5397fb9d05389e3__title{font-family:var(--wpds-font-family-heading,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-weight:var(--wpds-font-weight-medium,499)}._1904b570a89bb815__description,.b5397fb9d05389e3__title{color:var(--wp-ui-notice-text-color);font-size:var(--wpds-font-size-md,13px);grid-column:2;line-height:var(--wpds-font-line-height-sm,20px);padding-block:var(--text-vertical-padding)}._1904b570a89bb815__description{text-wrap:pretty;font-family:var(--wpds-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-weight:var(--wpds-font-weight-regular,400)}._0a1270dcdd79c031__actions{display:flex;flex-wrap:wrap;gap:var(--wpds-dimension-gap-md,12px);grid-column:2}._4145abab73d17514__notice:has(._1904b570a89bb815__description) ._0a1270dcdd79c031__actions,._4145abab73d17514__notice:has(.b5397fb9d05389e3__title) ._0a1270dcdd79c031__actions{margin-block-start:var(--wpds-dimension-gap-sm,8px)}._983740ab855c4e09__action-button{flex-shrink:0}.d329e7416d368d31__action-link{color:var(--wpds-color-fg-interactive-neutral,#1e1e1e);flex-shrink:0;font-family:var(--wpds-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-size:var(--wpds-font-size-md,13px);font-weight:var(--wpds-font-weight-regular,400);line-height:var(--wpds-font-line-height-sm,20px);margin-block:auto;text-decoration-color:var(--wpds-color-stroke-interactive-neutral,#8a8a8a);text-decoration-thickness:.5px;text-underline-offset:.2em;&:visited{color:var(--wpds-color-fg-interactive-neutral,#1e1e1e);text-decoration-color:var(--wpds-color-stroke-interactive-neutral,#8a8a8a)}&:active,&:hover{color:var(--wpds-color-fg-interactive-neutral-active,#1e1e1e)}&:not(:first-child){margin-inline-start:var(--wpds-dimension-gap-xs,4px)}&:not(:last-child){margin-inline-end:var(--wpds-dimension-gap-xs,4px)}}._487e6a5c1375f7dc__close-icon{grid-column:3;grid-row:1;margin-inline-start:var(--wpds-dimension-gap-xs,4px)}._531c140826094795__is-info{--wp-ui-notice-background-color:var(--wpds-color-bg-surface-info-weak,#f2f9ff);--wp-ui-notice-border-color:var(--wpds-color-stroke-surface-info,#9fbcdc);--wp-ui-notice-text-color:var(--wpds-color-fg-content-info,#001b4f);--wp-ui-notice-decorative-icon-color:var(--wpds-color-fg-content-info-weak,#006bd7)}.ae2e1004697cce95__is-warning{--wp-ui-notice-background-color:var(--wpds-color-bg-surface-warning-weak,#fff7e0);--wp-ui-notice-border-color:var(--wpds-color-stroke-surface-warning,#d0b381);--wp-ui-notice-text-color:var(--wpds-color-fg-content-warning,#2e1900);--wp-ui-notice-decorative-icon-color:var(--wpds-color-fg-content-warning-weak,#926300)}._2e614a76af494837__is-success{--wp-ui-notice-background-color:var(--wpds-color-bg-surface-success-weak,#eaffed);--wp-ui-notice-border-color:var(--wpds-color-stroke-surface-success,#8ac894);--wp-ui-notice-text-color:var(--wpds-color-fg-content-success,#002900);--wp-ui-notice-decorative-icon-color:var(--wpds-color-fg-content-success-weak,#007f30)}.af00331ae17a0065__is-error{--wp-ui-notice-background-color:var(--wpds-color-bg-surface-error-weak,#fff6f4);--wp-ui-notice-border-color:var(--wpds-color-stroke-surface-error,#daa39b);--wp-ui-notice-text-color:var(--wpds-color-fg-content-error,#470000);--wp-ui-notice-decorative-icon-color:var(--wpds-color-fg-content-error-weak,#cc1818)}}@layer wp-ui-compositions{._487e6a5c1375f7dc__close-icon,._983740ab855c4e09__action-button:is(._8ddb8fb33fbf3d38__is-action-button-outline,._77bbde495a8a0af3__is-action-button-minimal){--wp-ui-button-background-color-active:color-mix(in srgb,#0000 50%,var(--wpds-color-bg-interactive-neutral-weak-active,#eaeaea))}}'));
|
|
34
|
+
document.head.appendChild(style);
|
|
35
|
+
}
|
|
36
|
+
var style_default = { "notice": "_4145abab73d17514__notice", "icon": "d0a25570cb528528__icon", "title": "b5397fb9d05389e3__title", "description": "_1904b570a89bb815__description", "actions": "_0a1270dcdd79c031__actions", "action-button": "_983740ab855c4e09__action-button", "action-link": "d329e7416d368d31__action-link", "close-icon": "_487e6a5c1375f7dc__close-icon", "is-info": "_531c140826094795__is-info", "is-warning": "ae2e1004697cce95__is-warning", "is-success": "_2e614a76af494837__is-success", "is-error": "af00331ae17a0065__is-error", "is-action-button-outline": "_8ddb8fb33fbf3d38__is-action-button-outline", "is-action-button-minimal": "_77bbde495a8a0af3__is-action-button-minimal" };
|
|
37
|
+
|
|
38
|
+
// packages/ui/src/notice/description.tsx
|
|
39
|
+
var Description = (0, import_element.forwardRef)(
|
|
40
|
+
function NoticeDescription({ render, ...props }, ref) {
|
|
41
|
+
const element = (0, import_react.useRender)({
|
|
42
|
+
defaultTagName: "div",
|
|
43
|
+
render,
|
|
44
|
+
ref,
|
|
45
|
+
props: (0, import_react.mergeProps)(
|
|
46
|
+
{ className: style_default.description },
|
|
47
|
+
props
|
|
48
|
+
)
|
|
49
|
+
});
|
|
50
|
+
return element;
|
|
51
|
+
}
|
|
52
|
+
);
|
|
53
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
54
|
+
0 && (module.exports = {
|
|
55
|
+
Description
|
|
56
|
+
});
|
|
57
|
+
//# sourceMappingURL=description.cjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/notice/description.tsx", "../../src/notice/style.module.css"],
|
|
4
|
+
"sourcesContent": ["import { forwardRef } from '@wordpress/element';\nimport { useRender, mergeProps } from '@base-ui/react';\nimport type { DescriptionProps } from './types';\nimport styles from './style.module.css';\n\n/**\n * The description text for a notice.\n */\nexport const Description = forwardRef< HTMLDivElement, DescriptionProps >(\n\tfunction NoticeDescription( { render, ...props }, ref ) {\n\t\tconst element = useRender( {\n\t\t\tdefaultTagName: 'div',\n\t\t\trender,\n\t\t\tref,\n\t\t\tprops: mergeProps< 'div' >(\n\t\t\t\t{ className: styles.description },\n\t\t\t\tprops\n\t\t\t),\n\t\t} );\n\n\t\treturn element;\n\t}\n);\n", "if (typeof document !== 'undefined' && process.env.NODE_ENV !== 'test' && !document.head.querySelector(\"style[data-wp-hash='6925b16354']\")) {\n\tconst style = document.createElement(\"style\");\n\tstyle.setAttribute(\"data-wp-hash\", \"6925b16354\");\n\tstyle.appendChild(document.createTextNode(\"@layer wp-ui-utilities, wp-ui-components, wp-ui-compositions, wp-ui-overrides;@layer wp-ui-components{._4145abab73d17514__notice{--icon-height:24px;--text-vertical-padding:calc((var(--icon-height) - var(--wpds-font-line-height-sm, 20px))/2);--wp-ui-notice-background-color:var(--wpds-color-bg-surface-neutral-weak,#f0f0f0);--wp-ui-notice-border-color:var(--wpds-color-stroke-surface-neutral,#d8d8d8);--wp-ui-notice-text-color:var(--wpds-color-fg-content-neutral,#1e1e1e);--wp-ui-notice-decorative-icon-color:var(--wpds-color-fg-content-neutral,#1e1e1e);align-items:start;background-color:var(--wp-ui-notice-background-color);border:1px solid var(--wp-ui-notice-border-color);border-radius:var(--wpds-border-radius-lg,8px);display:grid;grid-template-columns:auto 1fr auto;padding:var(--wpds-dimension-padding-md,12px)}.d0a25570cb528528__icon{color:var(--wp-ui-notice-decorative-icon-color);grid-column:1;grid-row:1;margin-inline-end:var(--wpds-dimension-gap-xs,4px)}.b5397fb9d05389e3__title{font-family:var(--wpds-font-family-heading,-apple-system,system-ui,\\\"Segoe UI\\\",\\\"Roboto\\\",\\\"Oxygen-Sans\\\",\\\"Ubuntu\\\",\\\"Cantarell\\\",\\\"Helvetica Neue\\\",sans-serif);font-weight:var(--wpds-font-weight-medium,499)}._1904b570a89bb815__description,.b5397fb9d05389e3__title{color:var(--wp-ui-notice-text-color);font-size:var(--wpds-font-size-md,13px);grid-column:2;line-height:var(--wpds-font-line-height-sm,20px);padding-block:var(--text-vertical-padding)}._1904b570a89bb815__description{text-wrap:pretty;font-family:var(--wpds-font-family-body,-apple-system,system-ui,\\\"Segoe UI\\\",\\\"Roboto\\\",\\\"Oxygen-Sans\\\",\\\"Ubuntu\\\",\\\"Cantarell\\\",\\\"Helvetica Neue\\\",sans-serif);font-weight:var(--wpds-font-weight-regular,400)}._0a1270dcdd79c031__actions{display:flex;flex-wrap:wrap;gap:var(--wpds-dimension-gap-md,12px);grid-column:2}._4145abab73d17514__notice:has(._1904b570a89bb815__description) ._0a1270dcdd79c031__actions,._4145abab73d17514__notice:has(.b5397fb9d05389e3__title) ._0a1270dcdd79c031__actions{margin-block-start:var(--wpds-dimension-gap-sm,8px)}._983740ab855c4e09__action-button{flex-shrink:0}.d329e7416d368d31__action-link{color:var(--wpds-color-fg-interactive-neutral,#1e1e1e);flex-shrink:0;font-family:var(--wpds-font-family-body,-apple-system,system-ui,\\\"Segoe UI\\\",\\\"Roboto\\\",\\\"Oxygen-Sans\\\",\\\"Ubuntu\\\",\\\"Cantarell\\\",\\\"Helvetica Neue\\\",sans-serif);font-size:var(--wpds-font-size-md,13px);font-weight:var(--wpds-font-weight-regular,400);line-height:var(--wpds-font-line-height-sm,20px);margin-block:auto;text-decoration-color:var(--wpds-color-stroke-interactive-neutral,#8a8a8a);text-decoration-thickness:.5px;text-underline-offset:.2em;&:visited{color:var(--wpds-color-fg-interactive-neutral,#1e1e1e);text-decoration-color:var(--wpds-color-stroke-interactive-neutral,#8a8a8a)}&:active,&:hover{color:var(--wpds-color-fg-interactive-neutral-active,#1e1e1e)}&:not(:first-child){margin-inline-start:var(--wpds-dimension-gap-xs,4px)}&:not(:last-child){margin-inline-end:var(--wpds-dimension-gap-xs,4px)}}._487e6a5c1375f7dc__close-icon{grid-column:3;grid-row:1;margin-inline-start:var(--wpds-dimension-gap-xs,4px)}._531c140826094795__is-info{--wp-ui-notice-background-color:var(--wpds-color-bg-surface-info-weak,#f2f9ff);--wp-ui-notice-border-color:var(--wpds-color-stroke-surface-info,#9fbcdc);--wp-ui-notice-text-color:var(--wpds-color-fg-content-info,#001b4f);--wp-ui-notice-decorative-icon-color:var(--wpds-color-fg-content-info-weak,#006bd7)}.ae2e1004697cce95__is-warning{--wp-ui-notice-background-color:var(--wpds-color-bg-surface-warning-weak,#fff7e0);--wp-ui-notice-border-color:var(--wpds-color-stroke-surface-warning,#d0b381);--wp-ui-notice-text-color:var(--wpds-color-fg-content-warning,#2e1900);--wp-ui-notice-decorative-icon-color:var(--wpds-color-fg-content-warning-weak,#926300)}._2e614a76af494837__is-success{--wp-ui-notice-background-color:var(--wpds-color-bg-surface-success-weak,#eaffed);--wp-ui-notice-border-color:var(--wpds-color-stroke-surface-success,#8ac894);--wp-ui-notice-text-color:var(--wpds-color-fg-content-success,#002900);--wp-ui-notice-decorative-icon-color:var(--wpds-color-fg-content-success-weak,#007f30)}.af00331ae17a0065__is-error{--wp-ui-notice-background-color:var(--wpds-color-bg-surface-error-weak,#fff6f4);--wp-ui-notice-border-color:var(--wpds-color-stroke-surface-error,#daa39b);--wp-ui-notice-text-color:var(--wpds-color-fg-content-error,#470000);--wp-ui-notice-decorative-icon-color:var(--wpds-color-fg-content-error-weak,#cc1818)}}@layer wp-ui-compositions{._487e6a5c1375f7dc__close-icon,._983740ab855c4e09__action-button:is(._8ddb8fb33fbf3d38__is-action-button-outline,._77bbde495a8a0af3__is-action-button-minimal){--wp-ui-button-background-color-active:color-mix(in srgb,#0000 50%,var(--wpds-color-bg-interactive-neutral-weak-active,#eaeaea))}}\"));\n\tdocument.head.appendChild(style);\n}\nexport default {\"notice\":\"_4145abab73d17514__notice\",\"icon\":\"d0a25570cb528528__icon\",\"title\":\"b5397fb9d05389e3__title\",\"description\":\"_1904b570a89bb815__description\",\"actions\":\"_0a1270dcdd79c031__actions\",\"action-button\":\"_983740ab855c4e09__action-button\",\"action-link\":\"d329e7416d368d31__action-link\",\"close-icon\":\"_487e6a5c1375f7dc__close-icon\",\"is-info\":\"_531c140826094795__is-info\",\"is-warning\":\"ae2e1004697cce95__is-warning\",\"is-success\":\"_2e614a76af494837__is-success\",\"is-error\":\"af00331ae17a0065__is-error\",\"is-action-button-outline\":\"_8ddb8fb33fbf3d38__is-action-button-outline\",\"is-action-button-minimal\":\"_77bbde495a8a0af3__is-action-button-minimal\"};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qBAA2B;AAC3B,mBAAsC;;;ACDtC,IAAI,OAAO,aAAa,eAAe,QAAQ,IAAI,aAAa,UAAU,CAAC,SAAS,KAAK,cAAc,kCAAkC,GAAG;AAC3I,QAAM,QAAQ,SAAS,cAAc,OAAO;AAC5C,QAAM,aAAa,gBAAgB,YAAY;AAC/C,QAAM,YAAY,SAAS,eAAe,6oJAAirJ,CAAC;AAC5tJ,WAAS,KAAK,YAAY,KAAK;AAChC;AACA,IAAO,gBAAQ,EAAC,UAAS,6BAA4B,QAAO,0BAAyB,SAAQ,2BAA0B,eAAc,kCAAiC,WAAU,8BAA6B,iBAAgB,oCAAmC,eAAc,iCAAgC,cAAa,iCAAgC,WAAU,8BAA6B,cAAa,gCAA+B,cAAa,iCAAgC,YAAW,8BAA6B,4BAA2B,+CAA8C,4BAA2B,8CAA6C;;;ADE7oB,IAAM,kBAAc;AAAA,EAC1B,SAAS,kBAAmB,EAAE,QAAQ,GAAG,MAAM,GAAG,KAAM;AACvD,UAAM,cAAU,wBAAW;AAAA,MAC1B,gBAAgB;AAAA,MAChB;AAAA,MACA;AAAA,MACA,WAAO;AAAA,QACN,EAAE,WAAW,cAAO,YAAY;AAAA,QAChC;AAAA,MACD;AAAA,IACD,CAAE;AAEF,WAAO;AAAA,EACR;AACD;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// packages/ui/src/notice/index.ts
|
|
21
|
+
var notice_exports = {};
|
|
22
|
+
__export(notice_exports, {
|
|
23
|
+
ActionButton: () => import_action_button.ActionButton,
|
|
24
|
+
ActionLink: () => import_action_link.ActionLink,
|
|
25
|
+
Actions: () => import_actions.Actions,
|
|
26
|
+
CloseIcon: () => import_close_icon.CloseIcon,
|
|
27
|
+
Description: () => import_description.Description,
|
|
28
|
+
Root: () => import_root.Root,
|
|
29
|
+
Title: () => import_title.Title
|
|
30
|
+
});
|
|
31
|
+
module.exports = __toCommonJS(notice_exports);
|
|
32
|
+
var import_root = require("./root.cjs");
|
|
33
|
+
var import_title = require("./title.cjs");
|
|
34
|
+
var import_description = require("./description.cjs");
|
|
35
|
+
var import_actions = require("./actions.cjs");
|
|
36
|
+
var import_close_icon = require("./close-icon.cjs");
|
|
37
|
+
var import_action_button = require("./action-button.cjs");
|
|
38
|
+
var import_action_link = require("./action-link.cjs");
|
|
39
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
40
|
+
0 && (module.exports = {
|
|
41
|
+
ActionButton,
|
|
42
|
+
ActionLink,
|
|
43
|
+
Actions,
|
|
44
|
+
CloseIcon,
|
|
45
|
+
Description,
|
|
46
|
+
Root,
|
|
47
|
+
Title
|
|
48
|
+
});
|
|
49
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/notice/index.ts"],
|
|
4
|
+
"sourcesContent": ["import { Root } from './root';\nimport { Title } from './title';\nimport { Description } from './description';\nimport { Actions } from './actions';\nimport { CloseIcon } from './close-icon';\nimport { ActionButton } from './action-button';\nimport { ActionLink } from './action-link';\n\nexport {\n\tRoot,\n\tTitle,\n\tDescription,\n\tActions,\n\tCloseIcon,\n\tActionButton,\n\tActionLink,\n};\n\nexport type { NoticeIntent } from './types';\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAqB;AACrB,mBAAsB;AACtB,yBAA4B;AAC5B,qBAAwB;AACxB,wBAA0B;AAC1B,2BAA6B;AAC7B,yBAA2B;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,137 @@
|
|
|
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/notice/root.tsx
|
|
31
|
+
var root_exports = {};
|
|
32
|
+
__export(root_exports, {
|
|
33
|
+
Root: () => Root
|
|
34
|
+
});
|
|
35
|
+
module.exports = __toCommonJS(root_exports);
|
|
36
|
+
var import_a11y = require("@wordpress/a11y");
|
|
37
|
+
var import_element = require("@wordpress/element");
|
|
38
|
+
var import_icons = require("@wordpress/icons");
|
|
39
|
+
var import_react = require("@base-ui/react");
|
|
40
|
+
var import_clsx = __toESM(require("clsx"));
|
|
41
|
+
var import_icon = require("../icon/index.cjs");
|
|
42
|
+
|
|
43
|
+
// packages/ui/src/utils/css/resets.module.css
|
|
44
|
+
if (typeof document !== "undefined" && process.env.NODE_ENV !== "test" && !document.head.querySelector("style[data-wp-hash='671ebfc62d']")) {
|
|
45
|
+
const style = document.createElement("style");
|
|
46
|
+
style.setAttribute("data-wp-hash", "671ebfc62d");
|
|
47
|
+
style.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}}}"));
|
|
48
|
+
document.head.appendChild(style);
|
|
49
|
+
}
|
|
50
|
+
var resets_default = { "box-sizing": "_336cd3e4e743482f__box-sizing" };
|
|
51
|
+
|
|
52
|
+
// packages/ui/src/notice/style.module.css
|
|
53
|
+
if (typeof document !== "undefined" && process.env.NODE_ENV !== "test" && !document.head.querySelector("style[data-wp-hash='6925b16354']")) {
|
|
54
|
+
const style = document.createElement("style");
|
|
55
|
+
style.setAttribute("data-wp-hash", "6925b16354");
|
|
56
|
+
style.appendChild(document.createTextNode('@layer wp-ui-utilities, wp-ui-components, wp-ui-compositions, wp-ui-overrides;@layer wp-ui-components{._4145abab73d17514__notice{--icon-height:24px;--text-vertical-padding:calc((var(--icon-height) - var(--wpds-font-line-height-sm, 20px))/2);--wp-ui-notice-background-color:var(--wpds-color-bg-surface-neutral-weak,#f0f0f0);--wp-ui-notice-border-color:var(--wpds-color-stroke-surface-neutral,#d8d8d8);--wp-ui-notice-text-color:var(--wpds-color-fg-content-neutral,#1e1e1e);--wp-ui-notice-decorative-icon-color:var(--wpds-color-fg-content-neutral,#1e1e1e);align-items:start;background-color:var(--wp-ui-notice-background-color);border:1px solid var(--wp-ui-notice-border-color);border-radius:var(--wpds-border-radius-lg,8px);display:grid;grid-template-columns:auto 1fr auto;padding:var(--wpds-dimension-padding-md,12px)}.d0a25570cb528528__icon{color:var(--wp-ui-notice-decorative-icon-color);grid-column:1;grid-row:1;margin-inline-end:var(--wpds-dimension-gap-xs,4px)}.b5397fb9d05389e3__title{font-family:var(--wpds-font-family-heading,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-weight:var(--wpds-font-weight-medium,499)}._1904b570a89bb815__description,.b5397fb9d05389e3__title{color:var(--wp-ui-notice-text-color);font-size:var(--wpds-font-size-md,13px);grid-column:2;line-height:var(--wpds-font-line-height-sm,20px);padding-block:var(--text-vertical-padding)}._1904b570a89bb815__description{text-wrap:pretty;font-family:var(--wpds-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-weight:var(--wpds-font-weight-regular,400)}._0a1270dcdd79c031__actions{display:flex;flex-wrap:wrap;gap:var(--wpds-dimension-gap-md,12px);grid-column:2}._4145abab73d17514__notice:has(._1904b570a89bb815__description) ._0a1270dcdd79c031__actions,._4145abab73d17514__notice:has(.b5397fb9d05389e3__title) ._0a1270dcdd79c031__actions{margin-block-start:var(--wpds-dimension-gap-sm,8px)}._983740ab855c4e09__action-button{flex-shrink:0}.d329e7416d368d31__action-link{color:var(--wpds-color-fg-interactive-neutral,#1e1e1e);flex-shrink:0;font-family:var(--wpds-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-size:var(--wpds-font-size-md,13px);font-weight:var(--wpds-font-weight-regular,400);line-height:var(--wpds-font-line-height-sm,20px);margin-block:auto;text-decoration-color:var(--wpds-color-stroke-interactive-neutral,#8a8a8a);text-decoration-thickness:.5px;text-underline-offset:.2em;&:visited{color:var(--wpds-color-fg-interactive-neutral,#1e1e1e);text-decoration-color:var(--wpds-color-stroke-interactive-neutral,#8a8a8a)}&:active,&:hover{color:var(--wpds-color-fg-interactive-neutral-active,#1e1e1e)}&:not(:first-child){margin-inline-start:var(--wpds-dimension-gap-xs,4px)}&:not(:last-child){margin-inline-end:var(--wpds-dimension-gap-xs,4px)}}._487e6a5c1375f7dc__close-icon{grid-column:3;grid-row:1;margin-inline-start:var(--wpds-dimension-gap-xs,4px)}._531c140826094795__is-info{--wp-ui-notice-background-color:var(--wpds-color-bg-surface-info-weak,#f2f9ff);--wp-ui-notice-border-color:var(--wpds-color-stroke-surface-info,#9fbcdc);--wp-ui-notice-text-color:var(--wpds-color-fg-content-info,#001b4f);--wp-ui-notice-decorative-icon-color:var(--wpds-color-fg-content-info-weak,#006bd7)}.ae2e1004697cce95__is-warning{--wp-ui-notice-background-color:var(--wpds-color-bg-surface-warning-weak,#fff7e0);--wp-ui-notice-border-color:var(--wpds-color-stroke-surface-warning,#d0b381);--wp-ui-notice-text-color:var(--wpds-color-fg-content-warning,#2e1900);--wp-ui-notice-decorative-icon-color:var(--wpds-color-fg-content-warning-weak,#926300)}._2e614a76af494837__is-success{--wp-ui-notice-background-color:var(--wpds-color-bg-surface-success-weak,#eaffed);--wp-ui-notice-border-color:var(--wpds-color-stroke-surface-success,#8ac894);--wp-ui-notice-text-color:var(--wpds-color-fg-content-success,#002900);--wp-ui-notice-decorative-icon-color:var(--wpds-color-fg-content-success-weak,#007f30)}.af00331ae17a0065__is-error{--wp-ui-notice-background-color:var(--wpds-color-bg-surface-error-weak,#fff6f4);--wp-ui-notice-border-color:var(--wpds-color-stroke-surface-error,#daa39b);--wp-ui-notice-text-color:var(--wpds-color-fg-content-error,#470000);--wp-ui-notice-decorative-icon-color:var(--wpds-color-fg-content-error-weak,#cc1818)}}@layer wp-ui-compositions{._487e6a5c1375f7dc__close-icon,._983740ab855c4e09__action-button:is(._8ddb8fb33fbf3d38__is-action-button-outline,._77bbde495a8a0af3__is-action-button-minimal){--wp-ui-button-background-color-active:color-mix(in srgb,#0000 50%,var(--wpds-color-bg-interactive-neutral-weak-active,#eaeaea))}}'));
|
|
57
|
+
document.head.appendChild(style);
|
|
58
|
+
}
|
|
59
|
+
var style_default = { "notice": "_4145abab73d17514__notice", "icon": "d0a25570cb528528__icon", "title": "b5397fb9d05389e3__title", "description": "_1904b570a89bb815__description", "actions": "_0a1270dcdd79c031__actions", "action-button": "_983740ab855c4e09__action-button", "action-link": "d329e7416d368d31__action-link", "close-icon": "_487e6a5c1375f7dc__close-icon", "is-info": "_531c140826094795__is-info", "is-warning": "ae2e1004697cce95__is-warning", "is-success": "_2e614a76af494837__is-success", "is-error": "af00331ae17a0065__is-error", "is-action-button-outline": "_8ddb8fb33fbf3d38__is-action-button-outline", "is-action-button-minimal": "_77bbde495a8a0af3__is-action-button-minimal" };
|
|
60
|
+
|
|
61
|
+
// packages/ui/src/notice/root.tsx
|
|
62
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
63
|
+
var icons = {
|
|
64
|
+
neutral: null,
|
|
65
|
+
info: import_icons.info,
|
|
66
|
+
warning: import_icons.caution,
|
|
67
|
+
success: import_icons.published,
|
|
68
|
+
error: import_icons.error
|
|
69
|
+
};
|
|
70
|
+
function getDefaultPoliteness(intent) {
|
|
71
|
+
return intent === "error" ? "assertive" : "polite";
|
|
72
|
+
}
|
|
73
|
+
function safeRenderToString(message) {
|
|
74
|
+
if (!message) {
|
|
75
|
+
return void 0;
|
|
76
|
+
}
|
|
77
|
+
if (typeof message === "string") {
|
|
78
|
+
return message;
|
|
79
|
+
}
|
|
80
|
+
try {
|
|
81
|
+
return (0, import_element.renderToString)(message);
|
|
82
|
+
} catch {
|
|
83
|
+
return void 0;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
function useSpokenMessage(message, politeness) {
|
|
87
|
+
const spokenMessage = safeRenderToString(message);
|
|
88
|
+
(0, import_element.useEffect)(() => {
|
|
89
|
+
if (spokenMessage) {
|
|
90
|
+
(0, import_a11y.speak)(spokenMessage, politeness);
|
|
91
|
+
}
|
|
92
|
+
}, [spokenMessage, politeness]);
|
|
93
|
+
}
|
|
94
|
+
var Root = (0, import_element.forwardRef)(function Notice({
|
|
95
|
+
intent = "neutral",
|
|
96
|
+
children,
|
|
97
|
+
icon,
|
|
98
|
+
spokenMessage = children,
|
|
99
|
+
politeness = getDefaultPoliteness(intent),
|
|
100
|
+
render,
|
|
101
|
+
...restProps
|
|
102
|
+
}, ref) {
|
|
103
|
+
useSpokenMessage(spokenMessage, politeness);
|
|
104
|
+
const iconElement = icon === null ? null : icon ?? icons[intent];
|
|
105
|
+
const mergedClassName = (0, import_clsx.default)(
|
|
106
|
+
style_default.notice,
|
|
107
|
+
style_default[`is-${intent}`],
|
|
108
|
+
resets_default["box-sizing"]
|
|
109
|
+
);
|
|
110
|
+
const element = (0, import_react.useRender)({
|
|
111
|
+
defaultTagName: "div",
|
|
112
|
+
render,
|
|
113
|
+
ref,
|
|
114
|
+
props: (0, import_react.mergeProps)(
|
|
115
|
+
{
|
|
116
|
+
className: mergedClassName,
|
|
117
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
118
|
+
children,
|
|
119
|
+
iconElement && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
120
|
+
import_icon.Icon,
|
|
121
|
+
{
|
|
122
|
+
className: style_default.icon,
|
|
123
|
+
icon: iconElement
|
|
124
|
+
}
|
|
125
|
+
)
|
|
126
|
+
] })
|
|
127
|
+
},
|
|
128
|
+
restProps
|
|
129
|
+
)
|
|
130
|
+
});
|
|
131
|
+
return element;
|
|
132
|
+
});
|
|
133
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
134
|
+
0 && (module.exports = {
|
|
135
|
+
Root
|
|
136
|
+
});
|
|
137
|
+
//# sourceMappingURL=root.cjs.map
|