@wordpress/ui 0.5.1-next.v.0 → 0.6.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 +5 -1
- package/build/box/box.cjs +2 -2
- package/build/box/box.cjs.map +2 -2
- package/build/button/button.cjs +18 -303
- package/build/button/button.cjs.map +3 -3
- package/build/form/primitives/constants.cjs +35 -0
- package/build/form/primitives/constants.cjs.map +7 -0
- package/build/form/primitives/field/description.cjs +6 -33
- package/build/form/primitives/field/description.cjs.map +2 -2
- package/build/form/primitives/field/details.cjs +6 -33
- package/build/form/primitives/field/details.cjs.map +2 -2
- package/build/form/primitives/field/label.cjs +6 -33
- package/build/form/primitives/field/label.cjs.map +2 -2
- package/build/form/primitives/field/root.cjs +6 -17
- package/build/form/primitives/field/root.cjs.map +2 -2
- package/build/form/primitives/fieldset/description.cjs +6 -33
- package/build/form/primitives/fieldset/description.cjs.map +2 -2
- package/build/form/primitives/fieldset/details.cjs +6 -33
- package/build/form/primitives/fieldset/details.cjs.map +2 -2
- package/build/form/primitives/fieldset/legend.cjs +6 -33
- package/build/form/primitives/fieldset/legend.cjs.map +2 -2
- package/build/form/primitives/fieldset/root.cjs +6 -16
- package/build/form/primitives/fieldset/root.cjs.map +2 -2
- package/build/form/primitives/index.cjs +8 -2
- package/build/form/primitives/index.cjs.map +2 -2
- package/build/form/primitives/input/index.cjs +31 -0
- package/build/form/primitives/input/index.cjs.map +7 -0
- package/build/form/primitives/input/input.cjs +82 -0
- package/build/form/primitives/input/input.cjs.map +7 -0
- package/build/form/primitives/input/types.cjs +19 -0
- package/build/form/primitives/input/types.cjs.map +7 -0
- package/build/form/primitives/input-layout/input-layout.cjs +12 -111
- package/build/form/primitives/input-layout/input-layout.cjs.map +3 -3
- package/build/form/primitives/input-layout/slot.cjs +6 -94
- package/build/form/primitives/input-layout/slot.cjs.map +2 -2
- package/build/form/primitives/select/index.cjs +40 -0
- package/build/form/primitives/select/index.cjs.map +7 -0
- package/build/form/primitives/select/item.cjs +98 -0
- package/build/form/primitives/select/item.cjs.map +7 -0
- package/build/form/primitives/select/popup.cjs +109 -0
- package/build/form/primitives/select/popup.cjs.map +7 -0
- package/build/form/primitives/select/root.cjs +35 -0
- package/build/form/primitives/select/root.cjs.map +7 -0
- package/build/form/primitives/select/trigger.cjs +116 -0
- package/build/form/primitives/select/trigger.cjs.map +7 -0
- package/build/form/primitives/select/types.cjs +19 -0
- package/build/form/primitives/select/types.cjs.map +7 -0
- package/build/index.cjs +19 -0
- package/build/index.cjs.map +2 -2
- package/build/lock-unlock.cjs +37 -0
- package/build/lock-unlock.cjs.map +7 -0
- package/build/stack/stack.cjs +6 -11
- package/build/stack/stack.cjs.map +2 -2
- package/build/tooltip/index.cjs +40 -0
- package/build/tooltip/index.cjs.map +7 -0
- package/build/tooltip/popup.cjs +100 -0
- package/build/tooltip/popup.cjs.map +7 -0
- package/build/tooltip/provider.cjs +35 -0
- package/build/tooltip/provider.cjs.map +7 -0
- package/build/tooltip/root.cjs +35 -0
- package/build/tooltip/root.cjs.map +7 -0
- package/build/tooltip/trigger.cjs +38 -0
- package/build/tooltip/trigger.cjs.map +7 -0
- package/build/tooltip/types.cjs +19 -0
- package/build/tooltip/types.cjs.map +7 -0
- package/build/utils/types.cjs.map +1 -1
- package/build/visually-hidden/visually-hidden.cjs +6 -19
- package/build/visually-hidden/visually-hidden.cjs.map +2 -2
- package/build-module/box/box.mjs +2 -2
- package/build-module/box/box.mjs.map +2 -2
- package/build-module/button/button.mjs +18 -303
- package/build-module/button/button.mjs.map +3 -3
- package/build-module/form/primitives/constants.mjs +10 -0
- package/build-module/form/primitives/constants.mjs.map +7 -0
- package/build-module/form/primitives/field/description.mjs +6 -33
- package/build-module/form/primitives/field/description.mjs.map +2 -2
- package/build-module/form/primitives/field/details.mjs +6 -33
- package/build-module/form/primitives/field/details.mjs.map +2 -2
- package/build-module/form/primitives/field/label.mjs +6 -33
- package/build-module/form/primitives/field/label.mjs.map +2 -2
- package/build-module/form/primitives/field/root.mjs +6 -17
- package/build-module/form/primitives/field/root.mjs.map +2 -2
- package/build-module/form/primitives/fieldset/description.mjs +6 -33
- package/build-module/form/primitives/fieldset/description.mjs.map +2 -2
- package/build-module/form/primitives/fieldset/details.mjs +6 -33
- package/build-module/form/primitives/fieldset/details.mjs.map +2 -2
- package/build-module/form/primitives/fieldset/legend.mjs +6 -33
- package/build-module/form/primitives/fieldset/legend.mjs.map +2 -2
- package/build-module/form/primitives/fieldset/root.mjs +6 -16
- package/build-module/form/primitives/fieldset/root.mjs.map +2 -2
- package/build-module/form/primitives/index.mjs +5 -1
- package/build-module/form/primitives/index.mjs.map +2 -2
- package/build-module/form/primitives/input/index.mjs +6 -0
- package/build-module/form/primitives/input/index.mjs.map +7 -0
- package/build-module/form/primitives/input/input.mjs +47 -0
- package/build-module/form/primitives/input/input.mjs.map +7 -0
- package/build-module/form/primitives/input/types.mjs +1 -0
- package/build-module/form/primitives/input/types.mjs.map +7 -0
- package/build-module/form/primitives/input-layout/input-layout.mjs +12 -111
- package/build-module/form/primitives/input-layout/input-layout.mjs.map +3 -3
- package/build-module/form/primitives/input-layout/slot.mjs +6 -94
- package/build-module/form/primitives/input-layout/slot.mjs.map +2 -2
- package/build-module/form/primitives/select/index.mjs +12 -0
- package/build-module/form/primitives/select/index.mjs.map +7 -0
- package/build-module/form/primitives/select/item.mjs +63 -0
- package/build-module/form/primitives/select/item.mjs.map +7 -0
- package/build-module/form/primitives/select/popup.mjs +76 -0
- package/build-module/form/primitives/select/popup.mjs.map +7 -0
- package/build-module/form/primitives/select/root.mjs +10 -0
- package/build-module/form/primitives/select/root.mjs.map +7 -0
- package/build-module/form/primitives/select/trigger.mjs +81 -0
- package/build-module/form/primitives/select/trigger.mjs.map +7 -0
- package/build-module/form/primitives/select/types.mjs +1 -0
- package/build-module/form/primitives/select/types.mjs.map +7 -0
- package/build-module/index.mjs +4 -0
- package/build-module/index.mjs.map +2 -2
- package/build-module/lock-unlock.mjs +11 -0
- package/build-module/lock-unlock.mjs.map +7 -0
- package/build-module/stack/stack.mjs +6 -11
- package/build-module/stack/stack.mjs.map +2 -2
- package/build-module/tooltip/index.mjs +12 -0
- package/build-module/tooltip/index.mjs.map +7 -0
- package/build-module/tooltip/popup.mjs +67 -0
- package/build-module/tooltip/popup.mjs.map +7 -0
- package/build-module/tooltip/provider.mjs +10 -0
- package/build-module/tooltip/provider.mjs.map +7 -0
- package/build-module/tooltip/root.mjs +10 -0
- package/build-module/tooltip/root.mjs.map +7 -0
- package/build-module/tooltip/trigger.mjs +13 -0
- package/build-module/tooltip/trigger.mjs.map +7 -0
- package/build-module/tooltip/types.mjs +1 -0
- package/build-module/tooltip/types.mjs.map +7 -0
- package/build-module/visually-hidden/visually-hidden.mjs +6 -19
- package/build-module/visually-hidden/visually-hidden.mjs.map +2 -2
- package/build-types/badge/stories/choosing-intent.story.d.ts +17 -0
- package/build-types/badge/stories/choosing-intent.story.d.ts.map +1 -0
- package/build-types/badge/stories/index.story.d.ts +1 -1
- package/build-types/badge/stories/index.story.d.ts.map +1 -1
- package/build-types/box/stories/index.story.d.ts +1 -1
- package/build-types/box/stories/index.story.d.ts.map +1 -1
- package/build-types/button/stories/index.story.d.ts +1 -1
- package/build-types/button/stories/index.story.d.ts.map +1 -1
- package/build-types/form/primitives/constants.d.ts +9 -0
- package/build-types/form/primitives/constants.d.ts.map +1 -0
- package/build-types/form/primitives/field/stories/index.story.d.ts +1 -1
- package/build-types/form/primitives/field/stories/index.story.d.ts.map +1 -1
- package/build-types/form/primitives/fieldset/stories/index.story.d.ts +1 -1
- package/build-types/form/primitives/fieldset/stories/index.story.d.ts.map +1 -1
- package/build-types/form/primitives/index.d.ts +2 -0
- package/build-types/form/primitives/index.d.ts.map +1 -1
- package/build-types/form/primitives/input/index.d.ts +2 -0
- package/build-types/form/primitives/input/index.d.ts.map +1 -0
- package/build-types/form/primitives/input/input.d.ts +10 -0
- package/build-types/form/primitives/input/input.d.ts.map +1 -0
- package/build-types/form/primitives/input/stories/index.story.d.ts +13 -0
- package/build-types/form/primitives/input/stories/index.story.d.ts.map +1 -0
- package/build-types/form/primitives/input/test/index.test.d.ts +2 -0
- package/build-types/form/primitives/input/test/index.test.d.ts.map +1 -0
- package/build-types/form/primitives/input/types.d.ts +27 -0
- package/build-types/form/primitives/input/types.d.ts.map +1 -0
- package/build-types/form/primitives/input-layout/stories/index.story.d.ts +1 -1
- package/build-types/form/primitives/input-layout/stories/index.story.d.ts.map +1 -1
- package/build-types/form/primitives/select/index.d.ts +5 -0
- package/build-types/form/primitives/select/index.d.ts.map +1 -0
- package/build-types/form/primitives/select/item.d.ts +7 -0
- package/build-types/form/primitives/select/item.d.ts.map +1 -0
- package/build-types/form/primitives/select/popup.d.ts +2 -0
- package/build-types/form/primitives/select/popup.d.ts.map +1 -0
- package/build-types/form/primitives/select/root.d.ts +3 -0
- package/build-types/form/primitives/select/root.d.ts.map +1 -0
- package/build-types/form/primitives/select/stories/index.story.d.ts +50 -0
- package/build-types/form/primitives/select/stories/index.story.d.ts.map +1 -0
- package/build-types/form/primitives/select/test/index.test.d.ts +2 -0
- package/build-types/form/primitives/select/test/index.test.d.ts.map +1 -0
- package/build-types/form/primitives/select/trigger.d.ts +7 -0
- package/build-types/form/primitives/select/trigger.d.ts.map +1 -0
- package/build-types/form/primitives/select/types.d.ts +42 -0
- package/build-types/form/primitives/select/types.d.ts.map +1 -0
- package/build-types/icon/stories/index.story.d.ts +1 -1
- package/build-types/icon/stories/index.story.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/lock-unlock.d.ts +2 -0
- package/build-types/lock-unlock.d.ts.map +1 -0
- package/build-types/stack/stories/index.story.d.ts +1 -1
- package/build-types/stack/stories/index.story.d.ts.map +1 -1
- package/build-types/tooltip/index.d.ts +6 -0
- package/build-types/tooltip/index.d.ts.map +1 -0
- package/build-types/tooltip/popup.d.ts +4 -0
- package/build-types/tooltip/popup.d.ts.map +1 -0
- package/build-types/tooltip/provider.d.ts +4 -0
- package/build-types/tooltip/provider.d.ts.map +1 -0
- package/build-types/tooltip/root.d.ts +4 -0
- package/build-types/tooltip/root.d.ts.map +1 -0
- package/build-types/tooltip/stories/index.story.d.ts +23 -0
- package/build-types/tooltip/stories/index.story.d.ts.map +1 -0
- package/build-types/tooltip/test/index.test.d.ts +2 -0
- package/build-types/tooltip/test/index.test.d.ts.map +1 -0
- package/build-types/tooltip/trigger.d.ts +4 -0
- package/build-types/tooltip/trigger.d.ts.map +1 -0
- package/build-types/tooltip/types.d.ts +18 -0
- package/build-types/tooltip/types.d.ts.map +1 -0
- package/build-types/utils/types.d.ts +0 -3
- package/build-types/utils/types.d.ts.map +1 -1
- package/build-types/visually-hidden/stories/index.story.d.ts +1 -1
- package/build-types/visually-hidden/stories/index.story.d.ts.map +1 -1
- package/package.json +12 -10
- package/src/badge/stories/choosing-intent.mdx +29 -32
- package/src/badge/stories/choosing-intent.story.tsx +129 -0
- package/src/badge/stories/index.story.tsx +1 -1
- package/src/box/box.tsx +2 -2
- package/src/box/stories/index.story.tsx +1 -1
- package/src/box/test/box.test.tsx +0 -11
- package/src/button/stories/index.story.tsx +1 -6
- package/src/button/style.module.css +2 -2
- package/src/button/test/button.test.tsx +1 -16
- package/src/form/primitives/constants.ts +10 -0
- package/src/form/primitives/field/stories/index.story.tsx +1 -1
- package/src/form/primitives/fieldset/stories/index.story.tsx +1 -1
- package/src/form/primitives/index.ts +2 -0
- package/src/form/primitives/input/index.ts +1 -0
- package/src/form/primitives/input/input.tsx +28 -0
- package/src/form/primitives/input/stories/index.story.tsx +40 -0
- package/src/form/primitives/input/style.module.css +34 -0
- package/src/form/primitives/input/test/index.test.tsx +13 -0
- package/src/form/primitives/input/types.ts +31 -0
- package/src/form/primitives/input-layout/stories/index.story.tsx +1 -1
- package/src/form/primitives/input-layout/style.module.css +5 -4
- package/src/form/primitives/select/index.ts +4 -0
- package/src/form/primitives/select/item.tsx +39 -0
- package/src/form/primitives/select/popup.tsx +55 -0
- package/src/form/primitives/select/root.tsx +6 -0
- package/src/form/primitives/select/stories/index.story.tsx +276 -0
- package/src/form/primitives/select/style.module.css +7 -0
- package/src/form/primitives/select/test/index.test.tsx +35 -0
- package/src/form/primitives/select/trigger.tsx +58 -0
- package/src/form/primitives/select/types.ts +52 -0
- package/src/icon/stories/index.story.tsx +1 -1
- package/src/index.ts +1 -0
- package/src/lock-unlock.ts +7 -0
- package/src/stack/stories/index.story.tsx +1 -1
- package/src/stories/introduction.mdx +1 -1
- package/src/tooltip/index.ts +6 -0
- package/src/tooltip/popup.tsx +64 -0
- package/src/tooltip/provider.tsx +8 -0
- package/src/tooltip/root.tsx +8 -0
- package/src/tooltip/stories/index.story.tsx +97 -0
- package/src/tooltip/style.module.css +20 -0
- package/src/tooltip/test/index.test.tsx +87 -0
- package/src/tooltip/trigger.tsx +15 -0
- package/src/tooltip/types.ts +26 -0
- package/src/utils/css/dropdown-motion.module.css +47 -0
- package/src/utils/css/focus.module.css +1 -1
- package/src/utils/css/item-popup.module.css +127 -0
- package/src/utils/css/select-trigger.module.css +58 -0
- package/src/utils/types.ts +0 -3
- package/src/visually-hidden/stories/index.story.tsx +1 -1
|
@@ -6,316 +6,31 @@ import { forwardRef, useEffect } from "@wordpress/element";
|
|
|
6
6
|
import { __ } from "@wordpress/i18n";
|
|
7
7
|
|
|
8
8
|
// packages/ui/src/button/style.module.css
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
appearance: none;
|
|
15
|
-
padding: 0;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
.style-module__button__l7D8M {
|
|
19
|
-
/* Internal variables */
|
|
20
|
-
--wp-ui-button-font-weight: 499;
|
|
21
|
-
|
|
22
|
-
--wp-ui-button-background-color: var(--wpds-color-bg-interactive-brand-strong);
|
|
23
|
-
--wp-ui-button-background-color-active: var(--wpds-color-bg-interactive-brand-strong-active);
|
|
24
|
-
--wp-ui-button-background-color-disabled: var(--wpds-color-bg-interactive-neutral-strong-disabled);
|
|
25
|
-
--wp-ui-button-foreground-color: var(--wpds-color-fg-interactive-brand-strong);
|
|
26
|
-
--wp-ui-button-foreground-color-active: var(--wpds-color-fg-interactive-brand-strong-active);
|
|
27
|
-
--wp-ui-button-foreground-color-disabled: var(--wpds-color-fg-interactive-neutral-strong-disabled);
|
|
28
|
-
--wp-ui-button-padding-inline: calc(3 * var(--wpds-dimension-base)); /* TODO: Create new interactive padding tokens */
|
|
29
|
-
--wp-ui-button-height: 40px;
|
|
30
|
-
--wp-ui-button-aspect-ratio: auto; /* Useful for overrides such as icon buttons */
|
|
31
|
-
--wp-ui-button-font-size: var(--wpds-font-size-md);
|
|
32
|
-
|
|
33
|
-
/* by default, borders have the same color as the background */
|
|
34
|
-
--wp-ui-button-border-color: var(--wp-ui-button-background-color);
|
|
35
|
-
--wp-ui-button-border-color-active: var(--wp-ui-button-background-color-active);
|
|
36
|
-
--wp-ui-button-border-color-disabled: var(--wp-ui-button-background-color-disabled);
|
|
37
|
-
|
|
38
|
-
/* Styles */
|
|
39
|
-
position: relative;
|
|
40
|
-
display: inline-flex;
|
|
41
|
-
justify-content: center;
|
|
42
|
-
align-items: center;
|
|
43
|
-
gap: calc(2 * var(--wpds-dimension-base)); /* TODO: Consider new interactive/control gap tokens */
|
|
44
|
-
aspect-ratio: var(--wp-ui-button-aspect-ratio);
|
|
45
|
-
height: var(--wp-ui-button-height);
|
|
46
|
-
padding-inline: var(--wp-ui-button-padding-inline);
|
|
47
|
-
border-style: solid;
|
|
48
|
-
border-width: 1px;
|
|
49
|
-
border-color: var(--wp-ui-button-border-color);
|
|
50
|
-
border-radius: var(--wpds-border-radius-surface-sm);
|
|
51
|
-
background-color: var(--wp-ui-button-background-color);
|
|
52
|
-
background-clip: padding-box;
|
|
53
|
-
font-family: var(--wpds-font-family-body);
|
|
54
|
-
font-size: var(--wp-ui-button-font-size);
|
|
55
|
-
font-weight: var(--wp-ui-button-font-weight);
|
|
56
|
-
line-height: var(--wpds-font-line-height-sm);
|
|
57
|
-
text-decoration: none;
|
|
58
|
-
color: var(--wp-ui-button-foreground-color);
|
|
59
|
-
|
|
60
|
-
@media not ( prefers-reduced-motion ) {
|
|
61
|
-
transition: color 0.1s ease-out;
|
|
62
|
-
|
|
63
|
-
* {
|
|
64
|
-
transition: opacity 0.1s ease-out;
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
/* Use pointer cursor for buttons that are links */
|
|
69
|
-
&[href] {
|
|
70
|
-
cursor: pointer;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
/* Make sure that links rendered as children of \`Button\` use button styles */
|
|
74
|
-
*[href] {
|
|
75
|
-
color: inherit;
|
|
76
|
-
text-decoration: inherit;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
/* States */
|
|
80
|
-
&:not([aria-disabled="true"]):is(:hover, :active, :focus) {
|
|
81
|
-
/* hover/active/focus states apply when the button is not disabled. A non
|
|
82
|
-
disabled, loading button will have hover/active/focus styles */
|
|
83
|
-
--wp-ui-button-background-color: var(--wp-ui-button-background-color-active);
|
|
84
|
-
--wp-ui-button-foreground-color: var(--wp-ui-button-foreground-color-active);
|
|
85
|
-
--wp-ui-button-border-color: var(--wp-ui-button-border-color-active);
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
&[aria-disabled="true"]:not(.style-module__is-loading__kUtC8) {
|
|
89
|
-
/* A loading button, even when disabled, won't "look" disabled */
|
|
90
|
-
--wp-ui-button-background-color: var(--wp-ui-button-background-color-disabled);
|
|
91
|
-
--wp-ui-button-foreground-color: var(--wp-ui-button-foreground-color-disabled);
|
|
92
|
-
--wp-ui-button-border-color: var(--wp-ui-button-border-color-disabled);
|
|
93
|
-
|
|
94
|
-
@media ( forced-colors: active ) {
|
|
95
|
-
border-color: GrayText;
|
|
96
|
-
color: GrayText;
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
/* Loading spinner \u2014 not animated and hidden unless in loading state */
|
|
101
|
-
&::before {
|
|
102
|
-
content: "";
|
|
103
|
-
position: absolute;
|
|
104
|
-
top: 50%;
|
|
105
|
-
inset-inline-start: 50%;
|
|
106
|
-
transform: translate(-50%, -50%);
|
|
107
|
-
|
|
108
|
-
display: block;
|
|
109
|
-
box-sizing: border-box;
|
|
110
|
-
height: var(--wp-ui-button-font-size);
|
|
111
|
-
aspect-ratio: 1;
|
|
112
|
-
|
|
113
|
-
border: var(--wpds-border-width-interactive-focus) solid;
|
|
114
|
-
border-block-start-color: var(--wp-ui-button-foreground-color);
|
|
115
|
-
border-inline-end-color: var(--wp-ui-button-foreground-color);
|
|
116
|
-
border-block-end-color: transparent;
|
|
117
|
-
border-inline-start-color: transparent;
|
|
118
|
-
border-radius: 50%;
|
|
119
|
-
|
|
120
|
-
pointer-events: none;
|
|
121
|
-
opacity: 0;
|
|
122
|
-
|
|
123
|
-
@media not ( prefers-reduced-motion ) {
|
|
124
|
-
transition: opacity 0.1s ease-out;
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
.style-module__is-small__kIIFR {
|
|
130
|
-
--wp-ui-button-padding-inline: calc(2 * var(--wpds-dimension-base)); /* TODO: Create new interactive padding tokens */
|
|
131
|
-
--wp-ui-button-height: 24px;
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
/* Variants (\`tone\` + \`variant\`) overrides compared to default styles */
|
|
135
|
-
|
|
136
|
-
/* All outline buttons have a border */
|
|
137
|
-
.style-module__is-brand__3UYMl {
|
|
138
|
-
/* no need to redefine variables for .is-brand.is-solid as it's the default variant */
|
|
139
|
-
|
|
140
|
-
/* Outline and minimal buttons use the same foreground color */
|
|
141
|
-
&.style-module__is-outline__YtWne,
|
|
142
|
-
&.style-module__is-minimal__rQYZo {
|
|
143
|
-
--wp-ui-button-foreground-color: var(--wpds-color-fg-interactive-brand);
|
|
144
|
-
--wp-ui-button-foreground-color-active: var(--wpds-color-fg-interactive-brand-active);
|
|
145
|
-
--wp-ui-button-foreground-color-disabled: var(--wpds-color-fg-interactive-neutral-disabled);
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
&.style-module__is-outline__YtWne {
|
|
149
|
-
--wp-ui-button-background-color: var(--wpds-color-bg-interactive-brand-weak);
|
|
150
|
-
--wp-ui-button-background-color-active: var(--wpds-color-bg-interactive-brand-weak-active);
|
|
151
|
-
--wp-ui-button-background-color-disabled: var(--wpds-color-bg-interactive-neutral-weak-disabled);
|
|
152
|
-
--wp-ui-button-border-color: var(--wpds-color-stroke-interactive-brand);
|
|
153
|
-
--wp-ui-button-border-color-active: var(--wpds-color-stroke-interactive-brand-active);
|
|
154
|
-
--wp-ui-button-border-color-disabled: var(--wpds-color-stroke-interactive-neutral-disabled);
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
&.style-module__is-minimal__rQYZo {
|
|
158
|
-
--wp-ui-button-background-color: var(--wpds-color-bg-interactive-brand-weak);
|
|
159
|
-
--wp-ui-button-background-color-active: var(--wpds-color-bg-interactive-brand-weak-active);
|
|
160
|
-
--wp-ui-button-background-color-disabled: var(--wpds-color-bg-interactive-neutral-weak-disabled);
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
.style-module__is-neutral__5yKo- {
|
|
165
|
-
&.style-module__is-solid__tQszW {
|
|
166
|
-
--wp-ui-button-background-color: var(--wpds-color-bg-interactive-neutral-strong);
|
|
167
|
-
--wp-ui-button-background-color-active: var(--wpds-color-bg-interactive-neutral-strong-active);
|
|
168
|
-
--wp-ui-button-background-color-disabled: var(--wpds-color-bg-interactive-neutral-strong-disabled);
|
|
169
|
-
--wp-ui-button-foreground-color: var(--wpds-color-fg-interactive-neutral-strong);
|
|
170
|
-
--wp-ui-button-foreground-color-active: var(--wpds-color-fg-interactive-neutral-strong-active);
|
|
171
|
-
--wp-ui-button-foreground-color-disabled: var(--wpds-color-fg-interactive-neutral-strong-disabled);
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
/* Outline and minimal buttons use the same foreground color */
|
|
175
|
-
&.style-module__is-outline__YtWne,
|
|
176
|
-
&.style-module__is-minimal__rQYZo {
|
|
177
|
-
--wp-ui-button-foreground-color: var(--wpds-color-fg-interactive-neutral);
|
|
178
|
-
--wp-ui-button-foreground-color-active: var(--wpds-color-fg-interactive-neutral-active);
|
|
179
|
-
--wp-ui-button-foreground-color-disabled: var(--wpds-color-fg-interactive-neutral-disabled);
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
&.style-module__is-outline__YtWne {
|
|
183
|
-
--wp-ui-button-background-color: var(--wpds-color-bg-interactive-neutral-weak);
|
|
184
|
-
--wp-ui-button-background-color-active: var(--wpds-color-bg-interactive-neutral-weak-active);
|
|
185
|
-
--wp-ui-button-background-color-disabled: var(--wpds-color-bg-interactive-neutral-weak-disabled);
|
|
186
|
-
--wp-ui-button-border-color: var(--wpds-color-stroke-interactive-neutral);
|
|
187
|
-
--wp-ui-button-border-color-active: var(--wpds-color-stroke-interactive-neutral-active);
|
|
188
|
-
--wp-ui-button-border-color-disabled: var(--wpds-color-stroke-interactive-neutral-disabled);
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
&.style-module__is-minimal__rQYZo {
|
|
192
|
-
--wp-ui-button-background-color: var(--wpds-color-bg-interactive-neutral-weak);
|
|
193
|
-
--wp-ui-button-background-color-active: var(--wpds-color-bg-interactive-neutral-weak-active);
|
|
194
|
-
--wp-ui-button-background-color-disabled: var(--wpds-color-bg-interactive-neutral-weak-disabled);
|
|
195
|
-
}
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
.style-module__is-unstyled__q7snL {
|
|
199
|
-
border: none;
|
|
200
|
-
background: none;
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
.style-module__is-compact__z1nPG {
|
|
204
|
-
--wp-ui-button-height: 32px;
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
.style-module__is-loading__kUtC8 {
|
|
208
|
-
color: transparent;
|
|
209
|
-
|
|
210
|
-
* {
|
|
211
|
-
opacity: 0;
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
&::before {
|
|
215
|
-
transition-delay: 0.05s;
|
|
216
|
-
opacity: 1;
|
|
217
|
-
|
|
218
|
-
@media not ( prefers-reduced-motion ) {
|
|
219
|
-
animation: style-module__loading-animation__Wh1T2 1s linear infinite;
|
|
220
|
-
}
|
|
221
|
-
}
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
[aria-pressed="true"].style-module__is-minimal__rQYZo.style-module__is-neutral__5yKo- {
|
|
225
|
-
--wp-ui-button-background-color: var(--wpds-color-bg-interactive-neutral-strong);
|
|
226
|
-
--wp-ui-button-background-color-active: var(--wpds-color-bg-interactive-neutral-strong);
|
|
227
|
-
--wp-ui-button-foreground-color: var(--wpds-color-fg-interactive-neutral-strong);
|
|
228
|
-
--wp-ui-button-foreground-color-active: var(--wpds-color-fg-interactive-neutral-strong);
|
|
229
|
-
}
|
|
9
|
+
if (typeof document !== "undefined" && !document.head.querySelector("style[data-wp-hash='e89bb0a0ac']")) {
|
|
10
|
+
const style = document.createElement("style");
|
|
11
|
+
style.setAttribute("data-wp-hash", "e89bb0a0ac");
|
|
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: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)}}'));
|
|
13
|
+
document.head.appendChild(style);
|
|
230
14
|
}
|
|
231
|
-
|
|
232
|
-
@keyframes style-module__loading-animation__Wh1T2 {
|
|
233
|
-
0% {
|
|
234
|
-
transform: translate(-50%, -50%) rotate(0deg);
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
100% {
|
|
238
|
-
transform: translate(-50%, -50%) rotate(360deg);
|
|
239
|
-
}
|
|
240
|
-
}
|
|
241
|
-
`;
|
|
242
|
-
document.head.appendChild(document.createElement("style")).appendChild(document.createTextNode(css));
|
|
243
|
-
var style_default = {
|
|
244
|
-
"button": "style-module__button__l7D8M",
|
|
245
|
-
"is-unstyled": "style-module__is-unstyled__q7snL",
|
|
246
|
-
"is-loading": "style-module__is-loading__kUtC8",
|
|
247
|
-
"is-small": "style-module__is-small__kIIFR",
|
|
248
|
-
"is-brand": "style-module__is-brand__3UYMl",
|
|
249
|
-
"is-outline": "style-module__is-outline__YtWne",
|
|
250
|
-
"is-minimal": "style-module__is-minimal__rQYZo",
|
|
251
|
-
"is-neutral": "style-module__is-neutral__5yKo-",
|
|
252
|
-
"is-solid": "style-module__is-solid__tQszW",
|
|
253
|
-
"is-compact": "style-module__is-compact__z1nPG",
|
|
254
|
-
"loading-animation": "style-module__loading-animation__Wh1T2"
|
|
255
|
-
};
|
|
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" };
|
|
256
16
|
|
|
257
17
|
// packages/ui/src/utils/css/resets.module.css
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
*,
|
|
265
|
-
*::before,
|
|
266
|
-
*::after {
|
|
267
|
-
box-sizing: inherit;
|
|
268
|
-
}
|
|
269
|
-
}
|
|
18
|
+
if (typeof document !== "undefined" && !document.head.querySelector("style[data-wp-hash='671ebfc62d']")) {
|
|
19
|
+
const style = document.createElement("style");
|
|
20
|
+
style.setAttribute("data-wp-hash", "671ebfc62d");
|
|
21
|
+
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}}}"));
|
|
22
|
+
document.head.appendChild(style);
|
|
270
23
|
}
|
|
271
|
-
|
|
272
|
-
document.head.appendChild(document.createElement("style")).appendChild(document.createTextNode(css2));
|
|
273
|
-
var resets_default = {
|
|
274
|
-
"box-sizing": "resets-module__box-sizing__M2zT5"
|
|
275
|
-
};
|
|
24
|
+
var resets_default = { "box-sizing": "_336cd3e4e743482f__box-sizing" };
|
|
276
25
|
|
|
277
26
|
// packages/ui/src/utils/css/focus.module.css
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
.focus-module__outset-ring--focus-visible__0FQby,
|
|
284
|
-
.focus-module__outset-ring--focus-within__zYPfw,
|
|
285
|
-
.focus-module__outset-ring--focus-within-except-active__lw0E3,
|
|
286
|
-
.focus-module__outset-ring--focus-within-visible__xcs-5 {
|
|
287
|
-
@media not ( prefers-reduced-motion ) {
|
|
288
|
-
transition: outline 0.1s ease-out;
|
|
289
|
-
}
|
|
290
|
-
|
|
291
|
-
/* Outline width must be kept at 0 even with a transparent color,
|
|
292
|
-
or else the outline will be visible in forced-colors mode. */
|
|
293
|
-
outline-width: 0;
|
|
294
|
-
outline-style: solid;
|
|
295
|
-
outline-color: transparent;
|
|
296
|
-
outline-offset: 1px;
|
|
297
|
-
}
|
|
298
|
-
|
|
299
|
-
.focus-module__outset-ring--focus__COii5:focus,
|
|
300
|
-
.focus-module__outset-ring--focus-except-active__4lsr3:focus:not(:active),
|
|
301
|
-
.focus-module__outset-ring--focus-visible__0FQby:focus-visible,
|
|
302
|
-
.focus-module__outset-ring--focus-within__zYPfw:focus-within,
|
|
303
|
-
.focus-module__outset-ring--focus-within-except-active__lw0E3:focus-within:not(:has(:active)),
|
|
304
|
-
.focus-module__outset-ring--focus-within-visible__xcs-5:focus-within:has(:focus-visible) {
|
|
305
|
-
outline-width: var(--wpds-border-width-interactive-focus);
|
|
306
|
-
outline-color: var(--wpds-color-stroke-focus-brand);
|
|
307
|
-
}
|
|
27
|
+
if (typeof document !== "undefined" && !document.head.querySelector("style[data-wp-hash='28ad59e2e3']")) {
|
|
28
|
+
const style = document.createElement("style");
|
|
29
|
+
style.setAttribute("data-wp-hash", "28ad59e2e3");
|
|
30
|
+
style.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)}}"));
|
|
31
|
+
document.head.appendChild(style);
|
|
308
32
|
}
|
|
309
|
-
|
|
310
|
-
document.head.appendChild(document.createElement("style")).appendChild(document.createTextNode(css3));
|
|
311
|
-
var focus_default = {
|
|
312
|
-
"outset-ring--focus": "focus-module__outset-ring--focus__COii5",
|
|
313
|
-
"outset-ring--focus-except-active": "focus-module__outset-ring--focus-except-active__4lsr3",
|
|
314
|
-
"outset-ring--focus-visible": "focus-module__outset-ring--focus-visible__0FQby",
|
|
315
|
-
"outset-ring--focus-within": "focus-module__outset-ring--focus-within__zYPfw",
|
|
316
|
-
"outset-ring--focus-within-except-active": "focus-module__outset-ring--focus-within-except-active__lw0E3",
|
|
317
|
-
"outset-ring--focus-within-visible": "focus-module__outset-ring--focus-within-visible__xcs-5"
|
|
318
|
-
};
|
|
33
|
+
var focus_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" };
|
|
319
34
|
|
|
320
35
|
// packages/ui/src/button/button.tsx
|
|
321
36
|
import { jsx } from "react/jsx-runtime";
|
|
@@ -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", "const css = `@layer wp-ui-utilities, wp-ui-components, wp-ui-compositions, wp-ui-overrides;\n\n@layer wp-ui-components {\n\t.style-module__button__l7D8M,\n\t.style-module__is-unstyled__q7snL {\n\t\tappearance: none;\n\t\tpadding: 0;\n\t}\n\n\t.style-module__button__l7D8M {\n\t\t/* Internal variables */\n\t\t--wp-ui-button-font-weight: 499;\n\n\t\t--wp-ui-button-background-color: var(--wpds-color-bg-interactive-brand-strong);\n\t\t--wp-ui-button-background-color-active: var(--wpds-color-bg-interactive-brand-strong-active);\n\t\t--wp-ui-button-background-color-disabled: var(--wpds-color-bg-interactive-neutral-strong-disabled);\n\t\t--wp-ui-button-foreground-color: var(--wpds-color-fg-interactive-brand-strong);\n\t\t--wp-ui-button-foreground-color-active: var(--wpds-color-fg-interactive-brand-strong-active);\n\t\t--wp-ui-button-foreground-color-disabled: var(--wpds-color-fg-interactive-neutral-strong-disabled);\n\t\t--wp-ui-button-padding-inline: calc(3 * var(--wpds-dimension-base)); /* TODO: Create new interactive padding tokens */\n\t\t--wp-ui-button-height: 40px;\n\t\t--wp-ui-button-aspect-ratio: auto; /* Useful for overrides such as icon buttons */\n\t\t--wp-ui-button-font-size: var(--wpds-font-size-md);\n\n\t\t/* by default, borders have the same color as the background */\n\t\t--wp-ui-button-border-color: var(--wp-ui-button-background-color);\n\t\t--wp-ui-button-border-color-active: var(--wp-ui-button-background-color-active);\n\t\t--wp-ui-button-border-color-disabled: var(--wp-ui-button-background-color-disabled);\n\n\t\t/* Styles */\n\t\tposition: relative;\n\t\tdisplay: inline-flex;\n\t\tjustify-content: center;\n\t\talign-items: center;\n\t\tgap: calc(2 * var(--wpds-dimension-base)); /* TODO: Consider new interactive/control gap tokens */\n\t\taspect-ratio: var(--wp-ui-button-aspect-ratio);\n\t\theight: var(--wp-ui-button-height);\n\t\tpadding-inline: var(--wp-ui-button-padding-inline);\n\t\tborder-style: solid;\n\t\tborder-width: 1px;\n\t\tborder-color: var(--wp-ui-button-border-color);\n\t\tborder-radius: var(--wpds-border-radius-surface-sm);\n\t\tbackground-color: var(--wp-ui-button-background-color);\n\t\tbackground-clip: padding-box;\n\t\tfont-family: var(--wpds-font-family-body);\n\t\tfont-size: var(--wp-ui-button-font-size);\n\t\tfont-weight: var(--wp-ui-button-font-weight);\n\t\tline-height: var(--wpds-font-line-height-sm);\n\t\ttext-decoration: none;\n\t\tcolor: var(--wp-ui-button-foreground-color);\n\n\t\t@media not ( prefers-reduced-motion ) {\n\t\t\ttransition: color 0.1s ease-out;\n\n\t\t\t* {\n\t\t\t\ttransition: opacity 0.1s ease-out;\n\t\t\t}\n\t\t}\n\n\t\t/* Use pointer cursor for buttons that are links */\n\t\t&[href] {\n\t\t\tcursor: pointer;\n\t\t}\n\n\t\t/* Make sure that links rendered as children of \\`Button\\` use button styles */\n\t\t*[href] {\n\t\t\tcolor: inherit;\n\t\t\ttext-decoration: inherit;\n\t\t}\n\n\t\t/* States */\n\t\t&:not([aria-disabled=\"true\"]):is(:hover, :active, :focus) {\n\t\t\t/* hover/active/focus states apply when the button is not disabled. A non\n\t\t\tdisabled, loading button will have hover/active/focus styles */\n\t\t\t--wp-ui-button-background-color: var(--wp-ui-button-background-color-active);\n\t\t\t--wp-ui-button-foreground-color: var(--wp-ui-button-foreground-color-active);\n\t\t\t--wp-ui-button-border-color: var(--wp-ui-button-border-color-active);\n\t\t}\n\n\t\t&[aria-disabled=\"true\"]:not(.style-module__is-loading__kUtC8) {\n\t\t\t/* A loading button, even when disabled, won't \"look\" disabled */\n\t\t\t--wp-ui-button-background-color: var(--wp-ui-button-background-color-disabled);\n\t\t\t--wp-ui-button-foreground-color: var(--wp-ui-button-foreground-color-disabled);\n\t\t\t--wp-ui-button-border-color: var(--wp-ui-button-border-color-disabled);\n\n\t\t\t@media ( forced-colors: active ) {\n\t\t\t\tborder-color: GrayText;\n\t\t\t\tcolor: GrayText;\n\t\t\t}\n\t\t}\n\n\t\t/* Loading spinner \u2014 not animated and hidden unless in loading state */\n\t\t&::before {\n\t\t\tcontent: \"\";\n\t\t\tposition: absolute;\n\t\t\ttop: 50%;\n\t\t\tinset-inline-start: 50%;\n\t\t\ttransform: translate(-50%, -50%);\n\n\t\t\tdisplay: block;\n\t\t\tbox-sizing: border-box;\n\t\t\theight: var(--wp-ui-button-font-size);\n\t\t\taspect-ratio: 1;\n\n\t\t\tborder: var(--wpds-border-width-interactive-focus) solid;\n\t\t\tborder-block-start-color: var(--wp-ui-button-foreground-color);\n\t\t\tborder-inline-end-color: var(--wp-ui-button-foreground-color);\n\t\t\tborder-block-end-color: transparent;\n\t\t\tborder-inline-start-color: transparent;\n\t\t\tborder-radius: 50%;\n\n\t\t\tpointer-events: none;\n\t\t\topacity: 0;\n\n\t\t\t@media not ( prefers-reduced-motion ) {\n\t\t\t\ttransition: opacity 0.1s ease-out;\n\t\t\t}\n\t\t}\n\t}\n\n\t.style-module__is-small__kIIFR {\n\t\t--wp-ui-button-padding-inline: calc(2 * var(--wpds-dimension-base)); /* TODO: Create new interactive padding tokens */\n\t\t--wp-ui-button-height: 24px;\n\t}\n\n\t/* Variants (\\`tone\\` + \\`variant\\`) overrides compared to default styles */\n\n\t/* All outline buttons have a border */\n\t.style-module__is-brand__3UYMl {\n\t\t/* no need to redefine variables for .is-brand.is-solid as it's the default variant */\n\n\t\t/* Outline and minimal buttons use the same foreground color */\n\t\t&.style-module__is-outline__YtWne,\n\t\t&.style-module__is-minimal__rQYZo {\n\t\t\t--wp-ui-button-foreground-color: var(--wpds-color-fg-interactive-brand);\n\t\t\t--wp-ui-button-foreground-color-active: var(--wpds-color-fg-interactive-brand-active);\n\t\t\t--wp-ui-button-foreground-color-disabled: var(--wpds-color-fg-interactive-neutral-disabled);\n\t\t}\n\n\t\t&.style-module__is-outline__YtWne {\n\t\t\t--wp-ui-button-background-color: var(--wpds-color-bg-interactive-brand-weak);\n\t\t\t--wp-ui-button-background-color-active: var(--wpds-color-bg-interactive-brand-weak-active);\n\t\t\t--wp-ui-button-background-color-disabled: var(--wpds-color-bg-interactive-neutral-weak-disabled);\n\t\t\t--wp-ui-button-border-color: var(--wpds-color-stroke-interactive-brand);\n\t\t\t--wp-ui-button-border-color-active: var(--wpds-color-stroke-interactive-brand-active);\n\t\t\t--wp-ui-button-border-color-disabled: var(--wpds-color-stroke-interactive-neutral-disabled);\n\t\t}\n\n\t\t&.style-module__is-minimal__rQYZo {\n\t\t\t--wp-ui-button-background-color: var(--wpds-color-bg-interactive-brand-weak);\n\t\t\t--wp-ui-button-background-color-active: var(--wpds-color-bg-interactive-brand-weak-active);\n\t\t\t--wp-ui-button-background-color-disabled: var(--wpds-color-bg-interactive-neutral-weak-disabled);\n\t\t}\n\t}\n\n\t.style-module__is-neutral__5yKo- {\n\t\t&.style-module__is-solid__tQszW {\n\t\t\t--wp-ui-button-background-color: var(--wpds-color-bg-interactive-neutral-strong);\n\t\t\t--wp-ui-button-background-color-active: var(--wpds-color-bg-interactive-neutral-strong-active);\n\t\t\t--wp-ui-button-background-color-disabled: var(--wpds-color-bg-interactive-neutral-strong-disabled);\n\t\t\t--wp-ui-button-foreground-color: var(--wpds-color-fg-interactive-neutral-strong);\n\t\t\t--wp-ui-button-foreground-color-active: var(--wpds-color-fg-interactive-neutral-strong-active);\n\t\t\t--wp-ui-button-foreground-color-disabled: var(--wpds-color-fg-interactive-neutral-strong-disabled);\n\t\t}\n\n\t\t/* Outline and minimal buttons use the same foreground color */\n\t\t&.style-module__is-outline__YtWne,\n\t\t&.style-module__is-minimal__rQYZo {\n\t\t\t--wp-ui-button-foreground-color: var(--wpds-color-fg-interactive-neutral);\n\t\t\t--wp-ui-button-foreground-color-active: var(--wpds-color-fg-interactive-neutral-active);\n\t\t\t--wp-ui-button-foreground-color-disabled: var(--wpds-color-fg-interactive-neutral-disabled);\n\t\t}\n\n\t\t&.style-module__is-outline__YtWne {\n\t\t\t--wp-ui-button-background-color: var(--wpds-color-bg-interactive-neutral-weak);\n\t\t\t--wp-ui-button-background-color-active: var(--wpds-color-bg-interactive-neutral-weak-active);\n\t\t\t--wp-ui-button-background-color-disabled: var(--wpds-color-bg-interactive-neutral-weak-disabled);\n\t\t\t--wp-ui-button-border-color: var(--wpds-color-stroke-interactive-neutral);\n\t\t\t--wp-ui-button-border-color-active: var(--wpds-color-stroke-interactive-neutral-active);\n\t\t\t--wp-ui-button-border-color-disabled: var(--wpds-color-stroke-interactive-neutral-disabled);\n\t\t}\n\n\t\t&.style-module__is-minimal__rQYZo {\n\t\t\t--wp-ui-button-background-color: var(--wpds-color-bg-interactive-neutral-weak);\n\t\t\t--wp-ui-button-background-color-active: var(--wpds-color-bg-interactive-neutral-weak-active);\n\t\t\t--wp-ui-button-background-color-disabled: var(--wpds-color-bg-interactive-neutral-weak-disabled);\n\t\t}\n\t}\n\n\t.style-module__is-unstyled__q7snL {\n\t\tborder: none;\n\t\tbackground: none;\n\t}\n\n\t.style-module__is-compact__z1nPG {\n\t\t--wp-ui-button-height: 32px;\n\t}\n\n\t.style-module__is-loading__kUtC8 {\n\t\tcolor: transparent;\n\n\t\t* {\n\t\t\topacity: 0;\n\t\t}\n\n\t\t&::before {\n\t\t\ttransition-delay: 0.05s;\n\t\t\topacity: 1;\n\n\t\t\t@media not ( prefers-reduced-motion ) {\n\t\t\t\tanimation: style-module__loading-animation__Wh1T2 1s linear infinite;\n\t\t\t}\n\t\t}\n\t}\n\n\t[aria-pressed=\"true\"].style-module__is-minimal__rQYZo.style-module__is-neutral__5yKo- {\n\t\t--wp-ui-button-background-color: var(--wpds-color-bg-interactive-neutral-strong);\n\t\t--wp-ui-button-background-color-active: var(--wpds-color-bg-interactive-neutral-strong);\n\t\t--wp-ui-button-foreground-color: var(--wpds-color-fg-interactive-neutral-strong);\n\t\t--wp-ui-button-foreground-color-active: var(--wpds-color-fg-interactive-neutral-strong);\n\t}\n}\n\n@keyframes style-module__loading-animation__Wh1T2 {\n\t0% {\n\t\ttransform: translate(-50%, -50%) rotate(0deg);\n\t}\n\n\t100% {\n\t\ttransform: translate(-50%, -50%) rotate(360deg);\n\t}\n}\n`;\ndocument.head\n .appendChild(document.createElement(\"style\"))\n .appendChild(document.createTextNode(css));\nexport {css};\nexport default {\n \"button\": \"style-module__button__l7D8M\",\n \"is-unstyled\": \"style-module__is-unstyled__q7snL\",\n \"is-loading\": \"style-module__is-loading__kUtC8\",\n \"is-small\": \"style-module__is-small__kIIFR\",\n \"is-brand\": \"style-module__is-brand__3UYMl\",\n \"is-outline\": \"style-module__is-outline__YtWne\",\n \"is-minimal\": \"style-module__is-minimal__rQYZo\",\n \"is-neutral\": \"style-module__is-neutral__5yKo-\",\n \"is-solid\": \"style-module__is-solid__tQszW\",\n \"is-compact\": \"style-module__is-compact__z1nPG\",\n \"loading-animation\": \"style-module__loading-animation__Wh1T2\"\n};", "const css = `@layer wp-ui-utilities, wp-ui-components, wp-ui-compositions, wp-ui-overrides;\n\n@layer wp-ui-utilities {\n\t.resets-module__box-sizing__M2zT5 {\n\t\tbox-sizing: border-box;\n\n\t\t*,\n\t\t*::before,\n\t\t*::after {\n\t\t\tbox-sizing: inherit;\n\t\t}\n\t}\n}\n`;\ndocument.head\n .appendChild(document.createElement(\"style\"))\n .appendChild(document.createTextNode(css));\nexport {css};\nexport default {\n \"box-sizing\": \"resets-module__box-sizing__M2zT5\"\n};", "const css = `@layer wp-ui-utilities, wp-ui-components, wp-ui-compositions, wp-ui-overrides;\n\n@layer wp-ui-utilities {\n\t.focus-module__outset-ring--focus__COii5,\n\t.focus-module__outset-ring--focus-except-active__4lsr3,\n\t.focus-module__outset-ring--focus-visible__0FQby,\n\t.focus-module__outset-ring--focus-within__zYPfw,\n\t.focus-module__outset-ring--focus-within-except-active__lw0E3,\n\t.focus-module__outset-ring--focus-within-visible__xcs-5 {\n\t\t@media not ( prefers-reduced-motion ) {\n\t\t\ttransition: outline 0.1s ease-out;\n\t\t}\n\n\t\t/* Outline width must be kept at 0 even with a transparent color,\n\t\tor else the outline will be visible in forced-colors mode. */\n\t\toutline-width: 0;\n\t\toutline-style: solid;\n\t\toutline-color: transparent;\n\t\toutline-offset: 1px;\n\t}\n\n\t.focus-module__outset-ring--focus__COii5:focus,\n\t.focus-module__outset-ring--focus-except-active__4lsr3:focus:not(:active),\n\t.focus-module__outset-ring--focus-visible__0FQby:focus-visible,\n\t.focus-module__outset-ring--focus-within__zYPfw:focus-within,\n\t.focus-module__outset-ring--focus-within-except-active__lw0E3:focus-within:not(:has(:active)),\n\t.focus-module__outset-ring--focus-within-visible__xcs-5:focus-within:has(:focus-visible) {\n\t\toutline-width: var(--wpds-border-width-interactive-focus);\n\t\toutline-color: var(--wpds-color-stroke-focus-brand);\n\t}\n}\n`;\ndocument.head\n .appendChild(document.createElement(\"style\"))\n .appendChild(document.createTextNode(css));\nexport {css};\nexport default {\n \"outset-ring--focus\": \"focus-module__outset-ring--focus__COii5\",\n \"outset-ring--focus-except-active\": \"focus-module__outset-ring--focus-except-active__4lsr3\",\n \"outset-ring--focus-visible\": \"focus-module__outset-ring--focus-visible__0FQby\",\n \"outset-ring--focus-within\": \"focus-module__outset-ring--focus-within__zYPfw\",\n \"outset-ring--focus-within-except-active\": \"focus-module__outset-ring--focus-within-except-active__lw0E3\",\n \"outset-ring--focus-within-visible\": \"focus-module__outset-ring--focus-within-visible__xcs-5\"\n};"],
|
|
5
|
-
"mappings": ";AAAA,SAAS,UAAU,eAAe;AAClC,OAAO,UAAU;AACjB,SAAS,aAAa;AACtB,SAAS,YAAY,iBAAiB;AACtC,SAAS,UAAU;;;ACJnB,
|
|
6
|
-
"names": ["
|
|
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,qjOAAujO,CAAC;AAClmO,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
|
+
"names": ["Button"]
|
|
7
7
|
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/form/primitives/constants.ts"],
|
|
4
|
+
"sourcesContent": ["import type { Select as _Select } from '@base-ui/react/select';\n\n/**\n * Shared positioning props for item popups (Select, Combobox, etc.).\n */\nexport const ITEM_POPUP_POSITIONER_PROPS = {\n\talign: 'start',\n\tsideOffset: 8,\n\tcollisionPadding: 12,\n} satisfies Partial< _Select.Positioner.Props >;\n"],
|
|
5
|
+
"mappings": ";AAKO,IAAM,8BAA8B;AAAA,EAC1C,OAAO;AAAA,EACP,YAAY;AAAA,EACZ,kBAAkB;AACnB;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -4,40 +4,13 @@ import { Field as _Field } from "@base-ui/react/field";
|
|
|
4
4
|
import { forwardRef } from "@wordpress/element";
|
|
5
5
|
|
|
6
6
|
// packages/ui/src/utils/css/field.module.css
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
font-family: var(--wpds-font-family-body);
|
|
14
|
-
font-size: var(--wpds-font-size-xs);
|
|
15
|
-
line-height: var(--wp-ui-field-label-line-height);
|
|
16
|
-
font-weight: var(--wpds-font-weight-medium);
|
|
17
|
-
text-transform: uppercase;
|
|
18
|
-
color: var(--wpds-color-fg-content-neutral);
|
|
19
|
-
|
|
20
|
-
&.field-module__is-plain__F8QhR {
|
|
21
|
-
font-size: var(--wpds-font-size-md);
|
|
22
|
-
text-transform: none;
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
.field-module__description__CKN1B {
|
|
27
|
-
margin: 0;
|
|
28
|
-
font-family: var(--wpds-font-family-body);
|
|
29
|
-
font-size: var(--wpds-font-size-sm);
|
|
30
|
-
line-height: var(--wpds-font-line-height-xs);
|
|
31
|
-
color: var(--wpds-color-fg-content-neutral-weak);
|
|
32
|
-
}
|
|
7
|
+
if (typeof document !== "undefined" && !document.head.querySelector("style[data-wp-hash='04c8f253c6']")) {
|
|
8
|
+
const style = document.createElement("style");
|
|
9
|
+
style.setAttribute("data-wp-hash", "04c8f253c6");
|
|
10
|
+
style.appendChild(document.createTextNode("@layer wp-ui-utilities, wp-ui-components, wp-ui-compositions, wp-ui-overrides;@layer wp-ui-utilities{._2d5ad850b2f90964__label{--wp-ui-field-label-line-height:var(--wpds-font-line-height-xs);color:var(--wpds-color-fg-content-neutral);font-family:var(--wpds-font-family-body);font-size:var(--wpds-font-size-xs);font-weight:var(--wpds-font-weight-medium);line-height:var(--wp-ui-field-label-line-height);text-transform:uppercase;&._17c4214649230bea__is-plain{font-size:var(--wpds-font-size-md);text-transform:none}}._08a3750500e0233f__description{color:var(--wpds-color-fg-content-neutral-weak);font-family:var(--wpds-font-family-body);font-size:var(--wpds-font-size-sm);line-height:var(--wpds-font-line-height-xs);margin:0}}"));
|
|
11
|
+
document.head.appendChild(style);
|
|
33
12
|
}
|
|
34
|
-
|
|
35
|
-
document.head.appendChild(document.createElement("style")).appendChild(document.createTextNode(css));
|
|
36
|
-
var field_default = {
|
|
37
|
-
"label": "field-module__label__LVrYU",
|
|
38
|
-
"is-plain": "field-module__is-plain__F8QhR",
|
|
39
|
-
"description": "field-module__description__CKN1B"
|
|
40
|
-
};
|
|
13
|
+
var field_default = { "label": "_2d5ad850b2f90964__label", "is-plain": "_17c4214649230bea__is-plain", "description": "_08a3750500e0233f__description" };
|
|
41
14
|
|
|
42
15
|
// packages/ui/src/form/primitives/field/description.tsx
|
|
43
16
|
import { jsx } from "react/jsx-runtime";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/form/primitives/field/description.tsx", "../../../../src/utils/css/field.module.css"],
|
|
4
|
-
"sourcesContent": ["import clsx from 'clsx';\nimport { Field as _Field } from '@base-ui/react/field';\nimport { forwardRef } from '@wordpress/element';\nimport fieldStyles from '../../../utils/css/field.module.css';\nimport type { FieldDescriptionProps } from './types';\n\nexport const Description = forwardRef<\n\tHTMLParagraphElement,\n\tFieldDescriptionProps\n>( function Description( { className, ...restProps }, ref ) {\n\treturn (\n\t\t<_Field.Description\n\t\t\tref={ ref }\n\t\t\tclassName={ clsx( fieldStyles.description, className ) }\n\t\t\t{ ...restProps }\n\t\t/>\n\t);\n} );\n", "
|
|
5
|
-
"mappings": ";AAAA,OAAO,UAAU;AACjB,SAAS,SAAS,cAAc;AAChC,SAAS,kBAAkB;;;ACF3B,
|
|
4
|
+
"sourcesContent": ["import clsx from 'clsx';\nimport { Field as _Field } from '@base-ui/react/field';\nimport { forwardRef } from '@wordpress/element';\nimport fieldStyles from '../../../utils/css/field.module.css';\nimport type { FieldDescriptionProps } from './types';\n\nexport const Description = forwardRef<\n\tHTMLParagraphElement,\n\tFieldDescriptionProps\n>( function Description( { className, ...restProps }, ref ) {\n\treturn (\n\t\t<_Field.Description\n\t\t\tref={ ref }\n\t\t\tclassName={ clsx( fieldStyles.description, className ) }\n\t\t\t{ ...restProps }\n\t\t/>\n\t);\n} );\n", "if (typeof document !== 'undefined' && !document.head.querySelector(\"style[data-wp-hash='04c8f253c6']\")) {\n\tconst style = document.createElement(\"style\");\n\tstyle.setAttribute(\"data-wp-hash\", \"04c8f253c6\");\n\tstyle.appendChild(document.createTextNode(\"@layer wp-ui-utilities, wp-ui-components, wp-ui-compositions, wp-ui-overrides;@layer wp-ui-utilities{._2d5ad850b2f90964__label{--wp-ui-field-label-line-height:var(--wpds-font-line-height-xs);color:var(--wpds-color-fg-content-neutral);font-family:var(--wpds-font-family-body);font-size:var(--wpds-font-size-xs);font-weight:var(--wpds-font-weight-medium);line-height:var(--wp-ui-field-label-line-height);text-transform:uppercase;&._17c4214649230bea__is-plain{font-size:var(--wpds-font-size-md);text-transform:none}}._08a3750500e0233f__description{color:var(--wpds-color-fg-content-neutral-weak);font-family:var(--wpds-font-family-body);font-size:var(--wpds-font-size-sm);line-height:var(--wpds-font-line-height-xs);margin:0}}\"));\n\tdocument.head.appendChild(style);\n}\nexport default {\"label\":\"_2d5ad850b2f90964__label\",\"is-plain\":\"_17c4214649230bea__is-plain\",\"description\":\"_08a3750500e0233f__description\"};\n"],
|
|
5
|
+
"mappings": ";AAAA,OAAO,UAAU;AACjB,SAAS,SAAS,cAAc;AAChC,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,qtBAAqtB,CAAC;AAChwB,WAAS,KAAK,YAAY,KAAK;AAChC;AACA,IAAO,gBAAQ,EAAC,SAAQ,4BAA2B,YAAW,+BAA8B,eAAc,iCAAgC;;;ADKxI;AALK,IAAM,cAAc,WAGxB,SAASA,aAAa,EAAE,WAAW,GAAG,UAAU,GAAG,KAAM;AAC3D,SACC;AAAA,IAAC,OAAO;AAAA,IAAP;AAAA,MACA;AAAA,MACA,WAAY,KAAM,cAAY,aAAa,SAAU;AAAA,MACnD,GAAG;AAAA;AAAA,EACN;AAEF,CAAE;",
|
|
6
6
|
"names": ["Description"]
|
|
7
7
|
}
|
|
@@ -5,40 +5,13 @@ import { forwardRef } from "@wordpress/element";
|
|
|
5
5
|
import { __ } from "@wordpress/i18n";
|
|
6
6
|
|
|
7
7
|
// packages/ui/src/utils/css/field.module.css
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
font-family: var(--wpds-font-family-body);
|
|
15
|
-
font-size: var(--wpds-font-size-xs);
|
|
16
|
-
line-height: var(--wp-ui-field-label-line-height);
|
|
17
|
-
font-weight: var(--wpds-font-weight-medium);
|
|
18
|
-
text-transform: uppercase;
|
|
19
|
-
color: var(--wpds-color-fg-content-neutral);
|
|
20
|
-
|
|
21
|
-
&.field-module__is-plain__F8QhR {
|
|
22
|
-
font-size: var(--wpds-font-size-md);
|
|
23
|
-
text-transform: none;
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
.field-module__description__CKN1B {
|
|
28
|
-
margin: 0;
|
|
29
|
-
font-family: var(--wpds-font-family-body);
|
|
30
|
-
font-size: var(--wpds-font-size-sm);
|
|
31
|
-
line-height: var(--wpds-font-line-height-xs);
|
|
32
|
-
color: var(--wpds-color-fg-content-neutral-weak);
|
|
33
|
-
}
|
|
8
|
+
if (typeof document !== "undefined" && !document.head.querySelector("style[data-wp-hash='04c8f253c6']")) {
|
|
9
|
+
const style = document.createElement("style");
|
|
10
|
+
style.setAttribute("data-wp-hash", "04c8f253c6");
|
|
11
|
+
style.appendChild(document.createTextNode("@layer wp-ui-utilities, wp-ui-components, wp-ui-compositions, wp-ui-overrides;@layer wp-ui-utilities{._2d5ad850b2f90964__label{--wp-ui-field-label-line-height:var(--wpds-font-line-height-xs);color:var(--wpds-color-fg-content-neutral);font-family:var(--wpds-font-family-body);font-size:var(--wpds-font-size-xs);font-weight:var(--wpds-font-weight-medium);line-height:var(--wp-ui-field-label-line-height);text-transform:uppercase;&._17c4214649230bea__is-plain{font-size:var(--wpds-font-size-md);text-transform:none}}._08a3750500e0233f__description{color:var(--wpds-color-fg-content-neutral-weak);font-family:var(--wpds-font-family-body);font-size:var(--wpds-font-size-sm);line-height:var(--wpds-font-line-height-xs);margin:0}}"));
|
|
12
|
+
document.head.appendChild(style);
|
|
34
13
|
}
|
|
35
|
-
|
|
36
|
-
document.head.appendChild(document.createElement("style")).appendChild(document.createTextNode(css));
|
|
37
|
-
var field_default = {
|
|
38
|
-
"label": "field-module__label__LVrYU",
|
|
39
|
-
"is-plain": "field-module__is-plain__F8QhR",
|
|
40
|
-
"description": "field-module__description__CKN1B"
|
|
41
|
-
};
|
|
14
|
+
var field_default = { "label": "_2d5ad850b2f90964__label", "is-plain": "_17c4214649230bea__is-plain", "description": "_08a3750500e0233f__description" };
|
|
42
15
|
|
|
43
16
|
// packages/ui/src/form/primitives/field/details.tsx
|
|
44
17
|
import { VisuallyHidden } from "../../../visually-hidden/index.mjs";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/form/primitives/field/details.tsx", "../../../../src/utils/css/field.module.css"],
|
|
4
|
-
"sourcesContent": ["import clsx from 'clsx';\nimport { Field as _Field } from '@base-ui/react/field';\nimport { forwardRef } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport fieldStyles from '../../../utils/css/field.module.css';\nimport type { FieldDetailsProps } from './types';\nimport { VisuallyHidden } from '../../../visually-hidden';\n\n/**\n * A component for showing additional information about the field,\n * styled similarly to a normal `Field.Description`.\n * Unlike a normal description, it can include links and other semantic elements.\n *\n * Although this content is not associated with the field using direct semantics,\n * it is made discoverable to screen reader users via a visually hidden description,\n * alerting them to the presence of additional information below.\n *\n * If the content only includes plain text, use `Field.Description` instead,\n * so the readout is not unnecessarily verbose for screen reader users.\n */\nexport const Details = forwardRef< HTMLDivElement, FieldDetailsProps >(\n\tfunction Details( { className, ...restProps }, ref ) {\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<_Field.Description render={ <VisuallyHidden /> }>\n\t\t\t\t\t{ __( 'More details follow the field.' ) }\n\t\t\t\t</_Field.Description>\n\t\t\t\t<div\n\t\t\t\t\tref={ ref }\n\t\t\t\t\tclassName={ clsx( fieldStyles.description, className ) }\n\t\t\t\t\t{ ...restProps }\n\t\t\t\t></div>\n\t\t\t</>\n\t\t);\n\t}\n);\n", "
|
|
5
|
-
"mappings": ";AAAA,OAAO,UAAU;AACjB,SAAS,SAAS,cAAc;AAChC,SAAS,kBAAkB;AAC3B,SAAS,UAAU;;;ACHnB,
|
|
4
|
+
"sourcesContent": ["import clsx from 'clsx';\nimport { Field as _Field } from '@base-ui/react/field';\nimport { forwardRef } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport fieldStyles from '../../../utils/css/field.module.css';\nimport type { FieldDetailsProps } from './types';\nimport { VisuallyHidden } from '../../../visually-hidden';\n\n/**\n * A component for showing additional information about the field,\n * styled similarly to a normal `Field.Description`.\n * Unlike a normal description, it can include links and other semantic elements.\n *\n * Although this content is not associated with the field using direct semantics,\n * it is made discoverable to screen reader users via a visually hidden description,\n * alerting them to the presence of additional information below.\n *\n * If the content only includes plain text, use `Field.Description` instead,\n * so the readout is not unnecessarily verbose for screen reader users.\n */\nexport const Details = forwardRef< HTMLDivElement, FieldDetailsProps >(\n\tfunction Details( { className, ...restProps }, ref ) {\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<_Field.Description render={ <VisuallyHidden /> }>\n\t\t\t\t\t{ __( 'More details follow the field.' ) }\n\t\t\t\t</_Field.Description>\n\t\t\t\t<div\n\t\t\t\t\tref={ ref }\n\t\t\t\t\tclassName={ clsx( fieldStyles.description, className ) }\n\t\t\t\t\t{ ...restProps }\n\t\t\t\t></div>\n\t\t\t</>\n\t\t);\n\t}\n);\n", "if (typeof document !== 'undefined' && !document.head.querySelector(\"style[data-wp-hash='04c8f253c6']\")) {\n\tconst style = document.createElement(\"style\");\n\tstyle.setAttribute(\"data-wp-hash\", \"04c8f253c6\");\n\tstyle.appendChild(document.createTextNode(\"@layer wp-ui-utilities, wp-ui-components, wp-ui-compositions, wp-ui-overrides;@layer wp-ui-utilities{._2d5ad850b2f90964__label{--wp-ui-field-label-line-height:var(--wpds-font-line-height-xs);color:var(--wpds-color-fg-content-neutral);font-family:var(--wpds-font-family-body);font-size:var(--wpds-font-size-xs);font-weight:var(--wpds-font-weight-medium);line-height:var(--wp-ui-field-label-line-height);text-transform:uppercase;&._17c4214649230bea__is-plain{font-size:var(--wpds-font-size-md);text-transform:none}}._08a3750500e0233f__description{color:var(--wpds-color-fg-content-neutral-weak);font-family:var(--wpds-font-family-body);font-size:var(--wpds-font-size-sm);line-height:var(--wpds-font-line-height-xs);margin:0}}\"));\n\tdocument.head.appendChild(style);\n}\nexport default {\"label\":\"_2d5ad850b2f90964__label\",\"is-plain\":\"_17c4214649230bea__is-plain\",\"description\":\"_08a3750500e0233f__description\"};\n"],
|
|
5
|
+
"mappings": ";AAAA,OAAO,UAAU;AACjB,SAAS,SAAS,cAAc;AAChC,SAAS,kBAAkB;AAC3B,SAAS,UAAU;;;ACHnB,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,qtBAAqtB,CAAC;AAChwB,WAAS,KAAK,YAAY,KAAK;AAChC;AACA,IAAO,gBAAQ,EAAC,SAAQ,4BAA2B,YAAW,+BAA8B,eAAc,iCAAgC;;;ADA1I,SAAS,sBAAsB;AAiB5B,mBAC8B,KAD9B;AAHI,IAAM,UAAU;AAAA,EACtB,SAASA,SAAS,EAAE,WAAW,GAAG,UAAU,GAAG,KAAM;AACpD,WACC,iCACC;AAAA,0BAAC,OAAO,aAAP,EAAmB,QAAS,oBAAC,kBAAe,GAC1C,aAAI,gCAAiC,GACxC;AAAA,MACA;AAAA,QAAC;AAAA;AAAA,UACA;AAAA,UACA,WAAY,KAAM,cAAY,aAAa,SAAU;AAAA,UACnD,GAAG;AAAA;AAAA,MACL;AAAA,OACF;AAAA,EAEF;AACD;",
|
|
6
6
|
"names": ["Details"]
|
|
7
7
|
}
|