@wordpress/ui 0.4.0 → 0.5.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 +20 -0
- package/LICENSE.md +1 -1
- package/README.md +18 -0
- package/build/badge/badge.cjs +95 -0
- package/build/badge/badge.cjs.map +7 -0
- package/build/{lock-unlock.js → badge/index.cjs} +8 -14
- package/build/badge/index.cjs.map +7 -0
- package/build/badge/types.cjs +19 -0
- package/build/badge/types.cjs.map +7 -0
- package/build/box/{box.js → box.cjs} +7 -6
- package/build/box/box.cjs.map +7 -0
- package/build/box/{index.js → index.cjs} +2 -2
- package/build/box/{types.js → types.cjs} +1 -1
- package/build/box/types.cjs.map +7 -0
- package/build/button/button.cjs +401 -0
- package/build/button/button.cjs.map +7 -0
- package/build/{utils/element.js → button/icon.cjs} +22 -20
- package/build/button/icon.cjs.map +7 -0
- package/build/button/index.cjs +39 -0
- package/build/button/index.cjs.map +7 -0
- package/build/button/types.cjs +19 -0
- package/build/button/types.cjs.map +7 -0
- package/build/form/primitives/field/control.cjs +38 -0
- package/build/form/primitives/field/control.cjs.map +7 -0
- package/build/form/primitives/field/description.cjs +92 -0
- package/build/form/primitives/field/description.cjs.map +7 -0
- package/build/form/primitives/field/details.cjs +99 -0
- package/build/form/primitives/field/details.cjs.map +7 -0
- package/build/form/primitives/field/index.cjs +46 -0
- package/build/form/primitives/field/index.cjs.map +7 -0
- package/build/form/primitives/field/item.cjs +36 -0
- package/build/form/primitives/field/item.cjs.map +7 -0
- package/build/form/primitives/field/label.cjs +98 -0
- package/build/form/primitives/field/label.cjs.map +7 -0
- package/build/form/primitives/field/root.cjs +79 -0
- package/build/form/primitives/field/root.cjs.map +7 -0
- package/build/form/primitives/field/types.cjs +19 -0
- package/build/form/primitives/field/types.cjs.map +7 -0
- package/build/form/primitives/fieldset/context.cjs +40 -0
- package/build/form/primitives/fieldset/context.cjs.map +7 -0
- package/build/form/primitives/fieldset/description.cjs +101 -0
- package/build/form/primitives/fieldset/description.cjs.map +7 -0
- package/build/form/primitives/fieldset/details.cjs +103 -0
- package/build/form/primitives/fieldset/details.cjs.map +7 -0
- package/build/form/primitives/fieldset/index.cjs +40 -0
- package/build/form/primitives/fieldset/index.cjs.map +7 -0
- package/build/form/primitives/fieldset/legend.cjs +94 -0
- package/build/form/primitives/fieldset/legend.cjs.map +7 -0
- package/build/form/primitives/fieldset/root.cjs +86 -0
- package/build/form/primitives/fieldset/root.cjs.map +7 -0
- package/build/form/primitives/fieldset/types.cjs +19 -0
- package/build/form/primitives/fieldset/types.cjs.map +7 -0
- package/build/form/primitives/index.cjs +50 -0
- package/build/form/primitives/index.cjs.map +7 -0
- 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 +148 -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/context.cjs +49 -0
- package/build/form/primitives/input-layout/context.cjs.map +7 -0
- package/build/form/primitives/input-layout/index.cjs +35 -0
- package/build/form/primitives/input-layout/index.cjs.map +7 -0
- package/build/form/primitives/input-layout/input-layout.cjs +196 -0
- package/build/form/primitives/input-layout/input-layout.cjs.map +7 -0
- package/build/form/primitives/input-layout/slot.cjs +165 -0
- package/build/form/primitives/input-layout/slot.cjs.map +7 -0
- package/build/form/primitives/input-layout/types.cjs +19 -0
- package/build/form/primitives/input-layout/types.cjs.map +7 -0
- package/build/icon/icon.cjs +46 -0
- package/build/icon/icon.cjs.map +7 -0
- package/build/{index.js → icon/index.cjs} +13 -7
- package/build/icon/index.cjs.map +7 -0
- package/build/icon/types.cjs +19 -0
- package/build/icon/types.cjs.map +7 -0
- package/build/index.cjs +37 -0
- package/build/index.cjs.map +7 -0
- package/build/stack/{index.js → index.cjs} +2 -2
- package/build/stack/index.cjs.map +7 -0
- package/build/stack/{stack.js → stack.cjs} +6 -18
- package/build/stack/stack.cjs.map +7 -0
- package/build/stack/{types.js → types.cjs} +1 -1
- package/build/stack/types.cjs.map +7 -0
- package/build/types/css-modules.d.cjs +2 -0
- package/build/types/css-modules.d.cjs.map +7 -0
- package/build/types/{react.d.js → react.d.cjs} +1 -1
- package/build/utils/{types.js → types.cjs} +1 -1
- package/build/visually-hidden/index.cjs +31 -0
- package/build/visually-hidden/index.cjs.map +7 -0
- package/build/visually-hidden/types.cjs +19 -0
- package/build/visually-hidden/types.cjs.map +7 -0
- package/build/visually-hidden/visually-hidden.cjs +69 -0
- package/build/visually-hidden/visually-hidden.cjs.map +7 -0
- package/build-module/badge/badge.mjs +70 -0
- package/build-module/badge/badge.mjs.map +7 -0
- package/build-module/badge/index.mjs +6 -0
- package/build-module/badge/index.mjs.map +7 -0
- package/build-module/badge/types.mjs +1 -0
- package/build-module/box/{box.js → box.mjs} +7 -6
- package/build-module/box/box.mjs.map +7 -0
- package/build-module/box/index.mjs +6 -0
- package/build-module/box/types.mjs +1 -0
- package/build-module/button/button.mjs +366 -0
- package/build-module/button/button.mjs.map +7 -0
- package/build-module/button/icon.mjs +22 -0
- package/build-module/button/icon.mjs.map +7 -0
- package/build-module/button/index.mjs +14 -0
- package/build-module/button/index.mjs.map +7 -0
- package/build-module/button/types.mjs +1 -0
- package/build-module/form/primitives/field/control.mjs +13 -0
- package/build-module/form/primitives/field/control.mjs.map +7 -0
- package/build-module/form/primitives/field/description.mjs +57 -0
- package/build-module/form/primitives/field/description.mjs.map +7 -0
- package/build-module/form/primitives/field/details.mjs +64 -0
- package/build-module/form/primitives/field/details.mjs.map +7 -0
- package/build-module/form/primitives/field/index.mjs +16 -0
- package/build-module/form/primitives/field/index.mjs.map +7 -0
- package/build-module/form/primitives/field/item.mjs +11 -0
- package/build-module/form/primitives/field/item.mjs.map +7 -0
- package/build-module/form/primitives/field/label.mjs +63 -0
- package/build-module/form/primitives/field/label.mjs.map +7 -0
- package/build-module/form/primitives/field/root.mjs +44 -0
- package/build-module/form/primitives/field/root.mjs.map +7 -0
- package/build-module/form/primitives/field/types.mjs +1 -0
- package/build-module/form/primitives/fieldset/context.mjs +14 -0
- package/build-module/form/primitives/fieldset/context.mjs.map +7 -0
- package/build-module/form/primitives/fieldset/description.mjs +66 -0
- package/build-module/form/primitives/fieldset/description.mjs.map +7 -0
- package/build-module/form/primitives/fieldset/details.mjs +68 -0
- package/build-module/form/primitives/fieldset/details.mjs.map +7 -0
- package/build-module/form/primitives/fieldset/index.mjs +12 -0
- package/build-module/form/primitives/fieldset/index.mjs.map +7 -0
- package/build-module/form/primitives/fieldset/legend.mjs +59 -0
- package/build-module/form/primitives/fieldset/legend.mjs.map +7 -0
- package/build-module/form/primitives/fieldset/root.mjs +51 -0
- package/build-module/form/primitives/fieldset/root.mjs.map +7 -0
- package/build-module/form/primitives/fieldset/types.mjs +1 -0
- package/build-module/form/primitives/index.mjs +12 -0
- package/build-module/form/primitives/index.mjs.map +7 -0
- 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 +113 -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/context.mjs +22 -0
- package/build-module/form/primitives/input-layout/context.mjs.map +7 -0
- package/build-module/form/primitives/input-layout/index.mjs +10 -0
- package/build-module/form/primitives/input-layout/index.mjs.map +7 -0
- package/build-module/form/primitives/input-layout/input-layout.mjs +161 -0
- package/build-module/form/primitives/input-layout/input-layout.mjs.map +7 -0
- package/build-module/form/primitives/input-layout/slot.mjs +130 -0
- package/build-module/form/primitives/input-layout/slot.mjs.map +7 -0
- package/build-module/form/primitives/input-layout/types.mjs +1 -0
- package/build-module/form/primitives/input-layout/types.mjs.map +7 -0
- package/build-module/icon/icon.mjs +21 -0
- package/build-module/icon/icon.mjs.map +7 -0
- package/build-module/icon/index.mjs +6 -0
- package/build-module/icon/index.mjs.map +7 -0
- package/build-module/icon/types.mjs +1 -0
- package/build-module/icon/types.mjs.map +7 -0
- package/build-module/index.mjs +9 -0
- package/build-module/index.mjs.map +7 -0
- package/build-module/stack/index.mjs +6 -0
- package/build-module/stack/index.mjs.map +7 -0
- package/build-module/stack/{stack.js → stack.mjs} +6 -8
- package/build-module/stack/stack.mjs.map +7 -0
- package/build-module/stack/types.mjs +1 -0
- package/build-module/stack/types.mjs.map +7 -0
- package/build-module/types/css-modules.d.mjs +1 -0
- package/build-module/types/css-modules.d.mjs.map +7 -0
- package/build-module/types/{react.d.js → react.d.mjs} +1 -1
- package/build-module/utils/types.mjs +1 -0
- package/build-module/utils/types.mjs.map +7 -0
- package/build-module/visually-hidden/index.mjs +6 -0
- package/build-module/visually-hidden/index.mjs.map +7 -0
- package/build-module/visually-hidden/types.mjs +1 -0
- package/build-module/visually-hidden/types.mjs.map +7 -0
- package/build-module/visually-hidden/visually-hidden.mjs +44 -0
- package/build-module/visually-hidden/visually-hidden.mjs.map +7 -0
- package/build-types/badge/badge.d.ts +7 -0
- package/build-types/badge/badge.d.ts.map +1 -0
- package/build-types/badge/index.d.ts +2 -0
- package/build-types/badge/index.d.ts.map +1 -0
- package/build-types/badge/stories/index.story.d.ts +15 -0
- package/build-types/badge/stories/index.story.d.ts.map +1 -0
- package/build-types/badge/types.d.ts +14 -0
- package/build-types/badge/types.d.ts.map +1 -0
- package/build-types/box/box.d.ts +0 -3
- package/build-types/box/box.d.ts.map +1 -1
- package/build-types/box/stories/index.story.d.ts +1 -11
- package/build-types/box/stories/index.story.d.ts.map +1 -1
- package/build-types/box/types.d.ts +8 -15
- package/build-types/box/types.d.ts.map +1 -1
- package/build-types/button/button.d.ts +3 -0
- package/build-types/button/button.d.ts.map +1 -0
- package/build-types/button/icon.d.ts +10 -0
- package/build-types/button/icon.d.ts.map +1 -0
- package/build-types/button/index.d.ts +10 -0
- package/build-types/button/index.d.ts.map +1 -0
- package/build-types/button/stories/index.story.d.ts +23 -0
- package/build-types/button/stories/index.story.d.ts.map +1 -0
- package/build-types/button/test/button.test.d.ts +2 -0
- package/build-types/button/test/button.test.d.ts.map +1 -0
- package/build-types/button/test/icon.test.d.ts +2 -0
- package/build-types/button/test/icon.test.d.ts.map +1 -0
- package/build-types/button/types.d.ts +63 -0
- package/build-types/button/types.d.ts.map +1 -0
- package/build-types/form/primitives/field/control.d.ts +6 -0
- package/build-types/form/primitives/field/control.d.ts.map +1 -0
- package/build-types/form/primitives/field/description.d.ts +9 -0
- package/build-types/form/primitives/field/description.d.ts.map +1 -0
- package/build-types/form/primitives/field/details.d.ts +21 -0
- package/build-types/form/primitives/field/details.d.ts.map +1 -0
- package/build-types/form/primitives/field/index.d.ts +8 -0
- package/build-types/form/primitives/field/index.d.ts.map +1 -0
- package/build-types/form/primitives/field/item.d.ts +3 -0
- package/build-types/form/primitives/field/item.d.ts.map +1 -0
- package/build-types/form/primitives/field/label.d.ts +11 -0
- package/build-types/form/primitives/field/label.d.ts.map +1 -0
- package/build-types/form/primitives/field/root.d.ts +15 -0
- package/build-types/form/primitives/field/root.d.ts.map +1 -0
- package/build-types/form/primitives/field/stories/index.story.d.ts +39 -0
- package/build-types/form/primitives/field/stories/index.story.d.ts.map +1 -0
- package/build-types/form/primitives/field/test/index.test.d.ts +2 -0
- package/build-types/form/primitives/field/test/index.test.d.ts.map +1 -0
- package/build-types/form/primitives/field/types.d.ts +62 -0
- package/build-types/form/primitives/field/types.d.ts.map +1 -0
- package/build-types/form/primitives/fieldset/context.d.ts +8 -0
- package/build-types/form/primitives/fieldset/context.d.ts.map +1 -0
- package/build-types/form/primitives/fieldset/description.d.ts +9 -0
- package/build-types/form/primitives/fieldset/description.d.ts.map +1 -0
- package/build-types/form/primitives/fieldset/details.d.ts +21 -0
- package/build-types/form/primitives/fieldset/details.d.ts.map +1 -0
- package/build-types/form/primitives/fieldset/index.d.ts +6 -0
- package/build-types/form/primitives/fieldset/index.d.ts.map +1 -0
- package/build-types/form/primitives/fieldset/legend.d.ts +9 -0
- package/build-types/form/primitives/fieldset/legend.d.ts.map +1 -0
- package/build-types/form/primitives/fieldset/root.d.ts +15 -0
- package/build-types/form/primitives/fieldset/root.d.ts.map +1 -0
- package/build-types/form/primitives/fieldset/stories/index.story.d.ts +18 -0
- package/build-types/form/primitives/fieldset/stories/index.story.d.ts.map +1 -0
- package/build-types/form/primitives/fieldset/test/index.test.d.ts +2 -0
- package/build-types/form/primitives/fieldset/test/index.test.d.ts.map +1 -0
- package/build-types/form/primitives/fieldset/types.d.ts +32 -0
- package/build-types/form/primitives/fieldset/types.d.ts.map +1 -0
- package/build-types/form/primitives/index.d.ts +5 -0
- package/build-types/form/primitives/index.d.ts.map +1 -0
- 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/context.d.ts +17 -0
- package/build-types/form/primitives/input-layout/context.d.ts.map +1 -0
- package/build-types/form/primitives/input-layout/index.d.ts +4 -0
- package/build-types/form/primitives/input-layout/index.d.ts.map +1 -0
- package/build-types/form/primitives/input-layout/input-layout.d.ts +7 -0
- package/build-types/form/primitives/input-layout/input-layout.d.ts.map +1 -0
- package/build-types/form/primitives/input-layout/slot.d.ts +6 -0
- package/build-types/form/primitives/input-layout/slot.d.ts.map +1 -0
- package/build-types/form/primitives/input-layout/stories/index.story.d.ts +24 -0
- package/build-types/form/primitives/input-layout/stories/index.story.d.ts.map +1 -0
- package/build-types/form/primitives/input-layout/test/index.test.d.ts +2 -0
- package/build-types/form/primitives/input-layout/test/index.test.d.ts.map +1 -0
- package/build-types/form/primitives/input-layout/types.d.ts +41 -0
- package/build-types/form/primitives/input-layout/types.d.ts.map +1 -0
- package/build-types/icon/icon.d.ts +14 -0
- package/build-types/icon/icon.d.ts.map +1 -0
- package/build-types/icon/index.d.ts +2 -0
- package/build-types/icon/index.d.ts.map +1 -0
- package/build-types/icon/stories/index.story.d.ts +11 -0
- package/build-types/icon/stories/index.story.d.ts.map +1 -0
- package/build-types/icon/test/icon.test.d.ts +2 -0
- package/build-types/icon/test/icon.test.d.ts.map +1 -0
- package/build-types/icon/types.d.ts +15 -0
- package/build-types/icon/types.d.ts.map +1 -0
- package/build-types/index.d.ts +6 -0
- package/build-types/index.d.ts.map +1 -1
- package/build-types/stack/index.d.ts +0 -3
- package/build-types/stack/index.d.ts.map +1 -1
- package/build-types/stack/stack.d.ts.map +1 -1
- package/build-types/stack/stories/index.story.d.ts +1 -11
- package/build-types/stack/stories/index.story.d.ts.map +1 -1
- package/build-types/stack/types.d.ts +2 -5
- package/build-types/stack/types.d.ts.map +1 -1
- package/build-types/test/index.test.d.ts +2 -0
- package/build-types/test/index.test.d.ts.map +1 -0
- package/build-types/visually-hidden/index.d.ts +2 -0
- package/build-types/visually-hidden/index.d.ts.map +1 -0
- package/build-types/visually-hidden/stories/index.story.d.ts +7 -0
- package/build-types/visually-hidden/stories/index.story.d.ts.map +1 -0
- package/build-types/visually-hidden/test/visually-hidden.test.d.ts +2 -0
- package/build-types/visually-hidden/test/visually-hidden.test.d.ts.map +1 -0
- package/build-types/visually-hidden/types.d.ts +8 -0
- package/build-types/visually-hidden/types.d.ts.map +1 -0
- package/build-types/visually-hidden/visually-hidden.d.ts +7 -0
- package/build-types/visually-hidden/visually-hidden.d.ts.map +1 -0
- package/package.json +26 -9
- package/src/badge/badge.tsx +88 -0
- package/src/badge/index.ts +1 -0
- package/src/badge/stories/choosing-intent.mdx +112 -0
- package/src/badge/stories/index.story.tsx +120 -0
- package/src/badge/types.ts +22 -0
- package/src/box/box.tsx +11 -23
- package/src/box/stories/index.story.tsx +3 -15
- package/src/box/types.ts +16 -59
- package/src/button/button.tsx +57 -0
- package/src/button/icon.tsx +24 -0
- package/src/button/index.ts +16 -0
- package/src/button/stories/index.story.tsx +192 -0
- package/src/button/style.module.css +232 -0
- package/src/button/test/button.test.tsx +89 -0
- package/src/button/test/icon.test.tsx +13 -0
- package/src/button/types.ts +72 -0
- package/src/form/primitives/field/control.tsx +9 -0
- package/src/form/primitives/field/description.tsx +18 -0
- package/src/form/primitives/field/details.tsx +36 -0
- package/src/form/primitives/field/index.ts +8 -0
- package/src/form/primitives/field/item.tsx +9 -0
- package/src/form/primitives/field/label.tsx +21 -0
- package/src/form/primitives/field/root.tsx +33 -0
- package/src/form/primitives/field/stories/index.story.tsx +132 -0
- package/src/form/primitives/field/test/index.test.tsx +36 -0
- package/src/form/primitives/field/types.ts +82 -0
- package/src/form/primitives/fieldset/context.tsx +13 -0
- package/src/form/primitives/fieldset/description.tsx +36 -0
- package/src/form/primitives/fieldset/details.tsx +46 -0
- package/src/form/primitives/fieldset/index.ts +6 -0
- package/src/form/primitives/fieldset/legend.tsx +17 -0
- package/src/form/primitives/fieldset/root.tsx +42 -0
- package/src/form/primitives/fieldset/stories/index.story.tsx +67 -0
- package/src/form/primitives/fieldset/style.module.css +12 -0
- package/src/form/primitives/fieldset/test/index.test.tsx +135 -0
- package/src/form/primitives/fieldset/types.ts +35 -0
- package/src/form/primitives/index.ts +4 -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/context.tsx +36 -0
- package/src/form/primitives/input-layout/index.ts +6 -0
- package/src/form/primitives/input-layout/input-layout.tsx +49 -0
- package/src/form/primitives/input-layout/slot.tsx +39 -0
- package/src/form/primitives/input-layout/stories/index.story.tsx +67 -0
- package/src/form/primitives/input-layout/style.module.css +82 -0
- package/src/form/primitives/input-layout/test/index.test.tsx +23 -0
- package/src/form/primitives/input-layout/types.ts +44 -0
- package/src/icon/icon.tsx +30 -0
- package/src/icon/index.ts +1 -0
- package/src/icon/stories/index.story.tsx +47 -0
- package/src/icon/test/icon.test.tsx +13 -0
- package/src/icon/types.ts +14 -0
- package/src/index.ts +6 -0
- package/src/stack/index.ts +0 -3
- package/src/stack/stack.tsx +5 -18
- package/src/stack/stories/index.story.tsx +1 -14
- package/src/stack/test/stack.test.tsx +22 -12
- package/src/stack/types.ts +2 -6
- package/src/stories/introduction.mdx +6 -0
- package/src/test/index.test.ts +22 -0
- package/src/utils/css/field.module.css +27 -0
- package/src/utils/css/focus.module.css +31 -0
- package/src/utils/css/resets.module.css +13 -0
- package/src/visually-hidden/index.ts +1 -0
- package/src/visually-hidden/stories/index.story.tsx +22 -0
- package/src/visually-hidden/style.module.css +15 -0
- package/src/visually-hidden/test/visually-hidden.test.tsx +59 -0
- package/src/visually-hidden/types.ts +8 -0
- package/src/visually-hidden/visually-hidden.tsx +23 -0
- package/build/box/box.js.map +0 -7
- package/build/box/types.js.map +0 -7
- package/build/index.js.map +0 -7
- package/build/lock-unlock.js.map +0 -7
- package/build/stack/index.js.map +0 -7
- package/build/stack/stack.js.map +0 -7
- package/build/stack/types.js.map +0 -7
- package/build/types/css-modules.d.js +0 -2
- package/build/utils/element.js.map +0 -7
- package/build-module/box/box.js.map +0 -7
- package/build-module/box/index.js +0 -6
- package/build-module/box/types.js +0 -1
- package/build-module/index.js +0 -3
- package/build-module/index.js.map +0 -7
- package/build-module/lock-unlock.js +0 -11
- package/build-module/lock-unlock.js.map +0 -7
- package/build-module/stack/index.js +0 -6
- package/build-module/stack/index.js.map +0 -7
- package/build-module/stack/stack.js.map +0 -7
- package/build-module/stack/types.js +0 -1
- package/build-module/types/css-modules.d.js +0 -1
- package/build-module/utils/element.js +0 -20
- package/build-module/utils/element.js.map +0 -7
- package/build-module/utils/types.js +0 -1
- package/build-types/lock-unlock.d.ts +0 -2
- package/build-types/lock-unlock.d.ts.map +0 -1
- package/build-types/utils/element.d.ts +0 -25
- package/build-types/utils/element.d.ts.map +0 -1
- package/src/lock-unlock.ts +0 -10
- package/src/utils/element.ts +0 -51
- package/tsconfig.json +0 -13
- package/tsconfig.tsbuildinfo +0 -1
- /package/build/box/{index.js.map → index.cjs.map} +0 -0
- /package/build/types/{react.d.js.map → react.d.cjs.map} +0 -0
- /package/build/utils/{types.js.map → types.cjs.map} +0 -0
- /package/build-module/{box/types.js.map → badge/types.mjs.map} +0 -0
- /package/build-module/box/{index.js.map → index.mjs.map} +0 -0
- /package/build-module/{stack/types.js.map → box/types.mjs.map} +0 -0
- /package/build-module/{types/css-modules.d.js.map → button/types.mjs.map} +0 -0
- /package/build-module/{utils/types.js.map → form/primitives/field/types.mjs.map} +0 -0
- /package/{build/types/css-modules.d.js.map → build-module/form/primitives/fieldset/types.mjs.map} +0 -0
- /package/build-module/types/{react.d.js.map → react.d.mjs.map} +0 -0
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
// packages/ui/src/button/icon.tsx
|
|
2
|
+
import { forwardRef } from "@wordpress/element";
|
|
3
|
+
import { Icon } from "../icon/index.mjs";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
var ButtonIcon = forwardRef(
|
|
6
|
+
function ButtonIcon2({ icon, ...props }, ref) {
|
|
7
|
+
return /* @__PURE__ */ jsx(
|
|
8
|
+
Icon,
|
|
9
|
+
{
|
|
10
|
+
ref,
|
|
11
|
+
icon,
|
|
12
|
+
viewBox: "4 4 16 16",
|
|
13
|
+
size: 16,
|
|
14
|
+
...props
|
|
15
|
+
}
|
|
16
|
+
);
|
|
17
|
+
}
|
|
18
|
+
);
|
|
19
|
+
export {
|
|
20
|
+
ButtonIcon
|
|
21
|
+
};
|
|
22
|
+
//# sourceMappingURL=icon.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/button/icon.tsx"],
|
|
4
|
+
"sourcesContent": ["import { forwardRef } from '@wordpress/element';\nimport { type IconProps } from '../icon/types';\nimport { Icon } from '../icon';\n\ninterface ButtonIconProps extends IconProps {\n\t/**\n\t * The icon to display, from the `@wordpress/icons` package.\n\t */\n\ticon: IconProps[ 'icon' ];\n}\n\nexport const ButtonIcon = forwardRef< SVGSVGElement, ButtonIconProps >(\n\tfunction ButtonIcon( { icon, ...props }, ref ) {\n\t\treturn (\n\t\t\t<Icon\n\t\t\t\tref={ ref }\n\t\t\t\ticon={ icon }\n\t\t\t\tviewBox=\"4 4 16 16\"\n\t\t\t\tsize={ 16 }\n\t\t\t\t{ ...props }\n\t\t\t/>\n\t\t);\n\t}\n);\n"],
|
|
5
|
+
"mappings": ";AAAA,SAAS,kBAAkB;AAE3B,SAAS,YAAY;AAYlB;AAHI,IAAM,aAAa;AAAA,EACzB,SAASA,YAAY,EAAE,MAAM,GAAG,MAAM,GAAG,KAAM;AAC9C,WACC;AAAA,MAAC;AAAA;AAAA,QACA;AAAA,QACA;AAAA,QACA,SAAQ;AAAA,QACR,MAAO;AAAA,QACL,GAAG;AAAA;AAAA,IACN;AAAA,EAEF;AACD;",
|
|
6
|
+
"names": ["ButtonIcon"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// packages/ui/src/button/index.ts
|
|
2
|
+
import { Button as ButtonButton } from "./button.mjs";
|
|
3
|
+
import { ButtonIcon } from "./icon.mjs";
|
|
4
|
+
var Button = Object.assign(ButtonButton, {
|
|
5
|
+
/**
|
|
6
|
+
* An icon component specifically designed to work well when rendered inside
|
|
7
|
+
* a `Button` component.
|
|
8
|
+
*/
|
|
9
|
+
Icon: ButtonIcon
|
|
10
|
+
});
|
|
11
|
+
export {
|
|
12
|
+
Button
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/button/index.ts"],
|
|
4
|
+
"sourcesContent": ["import { Button as ButtonButton } from './button';\nimport { ButtonIcon } from './icon';\n\n/**\n * A versatile button component with multiple variants, tones, and sizes.\n * Built on design tokens for consistent theming and accessibility.\n */\nexport const Button = Object.assign( ButtonButton, {\n\t/**\n\t * An icon component specifically designed to work well when rendered inside\n\t * a `Button` component.\n\t */\n\tIcon: ButtonIcon,\n} ) as typeof ButtonButton & {\n\tIcon: typeof ButtonIcon;\n};\n"],
|
|
5
|
+
"mappings": ";AAAA,SAAS,UAAU,oBAAoB;AACvC,SAAS,kBAAkB;AAMpB,IAAM,SAAS,OAAO,OAAQ,cAAc;AAAA;AAAA;AAAA;AAAA;AAAA,EAKlD,MAAM;AACP,CAAE;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=types.mjs.map
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// packages/ui/src/form/primitives/field/control.tsx
|
|
2
|
+
import { Field as _Field } from "@base-ui/react/field";
|
|
3
|
+
import { forwardRef } from "@wordpress/element";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
var Control = forwardRef(
|
|
6
|
+
function Control2(props, ref) {
|
|
7
|
+
return /* @__PURE__ */ jsx(_Field.Control, { ref, ...props });
|
|
8
|
+
}
|
|
9
|
+
);
|
|
10
|
+
export {
|
|
11
|
+
Control
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=control.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/form/primitives/field/control.tsx"],
|
|
4
|
+
"sourcesContent": ["import { Field as _Field } from '@base-ui/react/field';\nimport { forwardRef } from '@wordpress/element';\nimport type { FieldControlProps } from './types';\n\nexport const Control = forwardRef< HTMLInputElement, FieldControlProps >(\n\tfunction Control( props, ref ) {\n\t\treturn <_Field.Control ref={ ref } { ...props } />;\n\t}\n);\n"],
|
|
5
|
+
"mappings": ";AAAA,SAAS,SAAS,cAAc;AAChC,SAAS,kBAAkB;AAKlB;AAFF,IAAM,UAAU;AAAA,EACtB,SAASA,SAAS,OAAO,KAAM;AAC9B,WAAO,oBAAC,OAAO,SAAP,EAAe,KAAc,GAAG,OAAQ;AAAA,EACjD;AACD;",
|
|
6
|
+
"names": ["Control"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
// packages/ui/src/form/primitives/field/description.tsx
|
|
2
|
+
import clsx from "clsx";
|
|
3
|
+
import { Field as _Field } from "@base-ui/react/field";
|
|
4
|
+
import { forwardRef } from "@wordpress/element";
|
|
5
|
+
|
|
6
|
+
// packages/ui/src/utils/css/field.module.css
|
|
7
|
+
var css = `@layer wp-ui-utilities, wp-ui-components, wp-ui-compositions, wp-ui-overrides;
|
|
8
|
+
|
|
9
|
+
@layer wp-ui-utilities {
|
|
10
|
+
.field-module__label__LVrYU {
|
|
11
|
+
--wp-ui-field-label-line-height: var(--wpds-font-line-height-xs);
|
|
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
|
+
}
|
|
33
|
+
}
|
|
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
|
+
};
|
|
41
|
+
|
|
42
|
+
// packages/ui/src/form/primitives/field/description.tsx
|
|
43
|
+
import { jsx } from "react/jsx-runtime";
|
|
44
|
+
var Description = forwardRef(function Description2({ className, ...restProps }, ref) {
|
|
45
|
+
return /* @__PURE__ */ jsx(
|
|
46
|
+
_Field.Description,
|
|
47
|
+
{
|
|
48
|
+
ref,
|
|
49
|
+
className: clsx(field_default.description, className),
|
|
50
|
+
...restProps
|
|
51
|
+
}
|
|
52
|
+
);
|
|
53
|
+
});
|
|
54
|
+
export {
|
|
55
|
+
Description
|
|
56
|
+
};
|
|
57
|
+
//# sourceMappingURL=description.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 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", "const css = `@layer wp-ui-utilities, wp-ui-components, wp-ui-compositions, wp-ui-overrides;\n\n@layer wp-ui-utilities {\n\t.field-module__label__LVrYU {\n\t\t--wp-ui-field-label-line-height: var(--wpds-font-line-height-xs);\n\n\t\tfont-family: var(--wpds-font-family-body);\n\t\tfont-size: var(--wpds-font-size-xs);\n\t\tline-height: var(--wp-ui-field-label-line-height);\n\t\tfont-weight: var(--wpds-font-weight-medium);\n\t\ttext-transform: uppercase;\n\t\tcolor: var(--wpds-color-fg-content-neutral);\n\n\t\t&.field-module__is-plain__F8QhR {\n\t\t\tfont-size: var(--wpds-font-size-md);\n\t\t\ttext-transform: none;\n\t\t}\n\t}\n\n\t.field-module__description__CKN1B {\n\t\tmargin: 0;\n\t\tfont-family: var(--wpds-font-family-body);\n\t\tfont-size: var(--wpds-font-size-sm);\n\t\tline-height: var(--wpds-font-line-height-xs);\n\t\tcolor: var(--wpds-color-fg-content-neutral-weak);\n\t}\n}\n`;\ndocument.head\n .appendChild(document.createElement(\"style\"))\n .appendChild(document.createTextNode(css));\nexport {css};\nexport default {\n \"label\": \"field-module__label__LVrYU\",\n \"is-plain\": \"field-module__is-plain__F8QhR\",\n \"description\": \"field-module__description__CKN1B\"\n};"],
|
|
5
|
+
"mappings": ";AAAA,OAAO,UAAU;AACjB,SAAS,SAAS,cAAc;AAChC,SAAS,kBAAkB;;;ACF3B,IAAM,MAAM;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA4BZ,SAAS,KACJ,YAAY,SAAS,cAAc,OAAO,CAAC,EAC3C,YAAY,SAAS,eAAe,GAAG,CAAC;AAE7C,IAAO,gBAAQ;AAAA,EACb,SAAS;AAAA,EACT,YAAY;AAAA,EACZ,eAAe;AACjB;;;ADzBE;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
|
+
"names": ["Description"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
// packages/ui/src/form/primitives/field/details.tsx
|
|
2
|
+
import clsx from "clsx";
|
|
3
|
+
import { Field as _Field } from "@base-ui/react/field";
|
|
4
|
+
import { forwardRef } from "@wordpress/element";
|
|
5
|
+
import { __ } from "@wordpress/i18n";
|
|
6
|
+
|
|
7
|
+
// packages/ui/src/utils/css/field.module.css
|
|
8
|
+
var css = `@layer wp-ui-utilities, wp-ui-components, wp-ui-compositions, wp-ui-overrides;
|
|
9
|
+
|
|
10
|
+
@layer wp-ui-utilities {
|
|
11
|
+
.field-module__label__LVrYU {
|
|
12
|
+
--wp-ui-field-label-line-height: var(--wpds-font-line-height-xs);
|
|
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
|
+
}
|
|
34
|
+
}
|
|
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
|
+
};
|
|
42
|
+
|
|
43
|
+
// packages/ui/src/form/primitives/field/details.tsx
|
|
44
|
+
import { VisuallyHidden } from "../../../visually-hidden/index.mjs";
|
|
45
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
46
|
+
var Details = forwardRef(
|
|
47
|
+
function Details2({ className, ...restProps }, ref) {
|
|
48
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
49
|
+
/* @__PURE__ */ jsx(_Field.Description, { render: /* @__PURE__ */ jsx(VisuallyHidden, {}), children: __("More details follow the field.") }),
|
|
50
|
+
/* @__PURE__ */ jsx(
|
|
51
|
+
"div",
|
|
52
|
+
{
|
|
53
|
+
ref,
|
|
54
|
+
className: clsx(field_default.description, className),
|
|
55
|
+
...restProps
|
|
56
|
+
}
|
|
57
|
+
)
|
|
58
|
+
] });
|
|
59
|
+
}
|
|
60
|
+
);
|
|
61
|
+
export {
|
|
62
|
+
Details
|
|
63
|
+
};
|
|
64
|
+
//# sourceMappingURL=details.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 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", "const css = `@layer wp-ui-utilities, wp-ui-components, wp-ui-compositions, wp-ui-overrides;\n\n@layer wp-ui-utilities {\n\t.field-module__label__LVrYU {\n\t\t--wp-ui-field-label-line-height: var(--wpds-font-line-height-xs);\n\n\t\tfont-family: var(--wpds-font-family-body);\n\t\tfont-size: var(--wpds-font-size-xs);\n\t\tline-height: var(--wp-ui-field-label-line-height);\n\t\tfont-weight: var(--wpds-font-weight-medium);\n\t\ttext-transform: uppercase;\n\t\tcolor: var(--wpds-color-fg-content-neutral);\n\n\t\t&.field-module__is-plain__F8QhR {\n\t\t\tfont-size: var(--wpds-font-size-md);\n\t\t\ttext-transform: none;\n\t\t}\n\t}\n\n\t.field-module__description__CKN1B {\n\t\tmargin: 0;\n\t\tfont-family: var(--wpds-font-family-body);\n\t\tfont-size: var(--wpds-font-size-sm);\n\t\tline-height: var(--wpds-font-line-height-xs);\n\t\tcolor: var(--wpds-color-fg-content-neutral-weak);\n\t}\n}\n`;\ndocument.head\n .appendChild(document.createElement(\"style\"))\n .appendChild(document.createTextNode(css));\nexport {css};\nexport default {\n \"label\": \"field-module__label__LVrYU\",\n \"is-plain\": \"field-module__is-plain__F8QhR\",\n \"description\": \"field-module__description__CKN1B\"\n};"],
|
|
5
|
+
"mappings": ";AAAA,OAAO,UAAU;AACjB,SAAS,SAAS,cAAc;AAChC,SAAS,kBAAkB;AAC3B,SAAS,UAAU;;;ACHnB,IAAM,MAAM;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA4BZ,SAAS,KACJ,YAAY,SAAS,cAAc,OAAO,CAAC,EAC3C,YAAY,SAAS,eAAe,GAAG,CAAC;AAE7C,IAAO,gBAAQ;AAAA,EACb,SAAS;AAAA,EACT,YAAY;AAAA,EACZ,eAAe;AACjB;;;AD9BA,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
|
+
"names": ["Details"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
// packages/ui/src/form/primitives/field/index.ts
|
|
2
|
+
import { Root } from "./root.mjs";
|
|
3
|
+
import { Item } from "./item.mjs";
|
|
4
|
+
import { Label } from "./label.mjs";
|
|
5
|
+
import { Description } from "./description.mjs";
|
|
6
|
+
import { Details } from "./details.mjs";
|
|
7
|
+
import { Control } from "./control.mjs";
|
|
8
|
+
export {
|
|
9
|
+
Control,
|
|
10
|
+
Description,
|
|
11
|
+
Details,
|
|
12
|
+
Item,
|
|
13
|
+
Label,
|
|
14
|
+
Root
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/form/primitives/field/index.ts"],
|
|
4
|
+
"sourcesContent": ["import { Root } from './root';\nimport { Item } from './item';\nimport { Label } from './label';\nimport { Description } from './description';\nimport { Details } from './details';\nimport { Control } from './control';\n\nexport { Root, Item, Label, Description, Details, Control };\n"],
|
|
5
|
+
"mappings": ";AAAA,SAAS,YAAY;AACrB,SAAS,YAAY;AACrB,SAAS,aAAa;AACtB,SAAS,mBAAmB;AAC5B,SAAS,eAAe;AACxB,SAAS,eAAe;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// packages/ui/src/form/primitives/field/item.tsx
|
|
2
|
+
import { Field as _Field } from "@base-ui/react/field";
|
|
3
|
+
import { forwardRef } from "@wordpress/element";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
var Item = forwardRef(function Item2(props, ref) {
|
|
6
|
+
return /* @__PURE__ */ jsx(_Field.Item, { ref, ...props });
|
|
7
|
+
});
|
|
8
|
+
export {
|
|
9
|
+
Item
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=item.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/form/primitives/field/item.tsx"],
|
|
4
|
+
"sourcesContent": ["import { Field as _Field } from '@base-ui/react/field';\nimport { forwardRef } from '@wordpress/element';\nimport type { FieldItemProps } from './types';\n\nexport const Item: React.ForwardRefExoticComponent<\n\tFieldItemProps & React.RefAttributes< HTMLDivElement >\n> = forwardRef( function Item( props, ref ) {\n\treturn <_Field.Item ref={ ref } { ...props } />;\n} );\n"],
|
|
5
|
+
"mappings": ";AAAA,SAAS,SAAS,cAAc;AAChC,SAAS,kBAAkB;AAMnB;AAHD,IAAM,OAET,WAAY,SAASA,MAAM,OAAO,KAAM;AAC3C,SAAO,oBAAC,OAAO,MAAP,EAAY,KAAc,GAAG,OAAQ;AAC9C,CAAE;",
|
|
6
|
+
"names": ["Item"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
// packages/ui/src/form/primitives/field/label.tsx
|
|
2
|
+
import clsx from "clsx";
|
|
3
|
+
import { Field as _Field } from "@base-ui/react/field";
|
|
4
|
+
import { forwardRef } from "@wordpress/element";
|
|
5
|
+
|
|
6
|
+
// packages/ui/src/utils/css/field.module.css
|
|
7
|
+
var css = `@layer wp-ui-utilities, wp-ui-components, wp-ui-compositions, wp-ui-overrides;
|
|
8
|
+
|
|
9
|
+
@layer wp-ui-utilities {
|
|
10
|
+
.field-module__label__LVrYU {
|
|
11
|
+
--wp-ui-field-label-line-height: var(--wpds-font-line-height-xs);
|
|
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
|
+
}
|
|
33
|
+
}
|
|
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
|
+
};
|
|
41
|
+
|
|
42
|
+
// packages/ui/src/form/primitives/field/label.tsx
|
|
43
|
+
import { jsx } from "react/jsx-runtime";
|
|
44
|
+
var Label = forwardRef(
|
|
45
|
+
function Label2({ className, variant, ...restProps }, ref) {
|
|
46
|
+
return /* @__PURE__ */ jsx(
|
|
47
|
+
_Field.Label,
|
|
48
|
+
{
|
|
49
|
+
ref,
|
|
50
|
+
className: clsx(
|
|
51
|
+
field_default.label,
|
|
52
|
+
variant && field_default[`is-${variant}`],
|
|
53
|
+
className
|
|
54
|
+
),
|
|
55
|
+
...restProps
|
|
56
|
+
}
|
|
57
|
+
);
|
|
58
|
+
}
|
|
59
|
+
);
|
|
60
|
+
export {
|
|
61
|
+
Label
|
|
62
|
+
};
|
|
63
|
+
//# sourceMappingURL=label.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/form/primitives/field/label.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 { FieldLabelProps } from './types';\n\nexport const Label = forwardRef< HTMLLabelElement, FieldLabelProps >(\n\tfunction Label( { className, variant, ...restProps }, ref ) {\n\t\treturn (\n\t\t\t<_Field.Label\n\t\t\t\tref={ ref }\n\t\t\t\tclassName={ clsx(\n\t\t\t\t\tfieldStyles.label,\n\t\t\t\t\tvariant && fieldStyles[ `is-${ variant }` ],\n\t\t\t\t\tclassName\n\t\t\t\t) }\n\t\t\t\t{ ...restProps }\n\t\t\t/>\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-utilities {\n\t.field-module__label__LVrYU {\n\t\t--wp-ui-field-label-line-height: var(--wpds-font-line-height-xs);\n\n\t\tfont-family: var(--wpds-font-family-body);\n\t\tfont-size: var(--wpds-font-size-xs);\n\t\tline-height: var(--wp-ui-field-label-line-height);\n\t\tfont-weight: var(--wpds-font-weight-medium);\n\t\ttext-transform: uppercase;\n\t\tcolor: var(--wpds-color-fg-content-neutral);\n\n\t\t&.field-module__is-plain__F8QhR {\n\t\t\tfont-size: var(--wpds-font-size-md);\n\t\t\ttext-transform: none;\n\t\t}\n\t}\n\n\t.field-module__description__CKN1B {\n\t\tmargin: 0;\n\t\tfont-family: var(--wpds-font-family-body);\n\t\tfont-size: var(--wpds-font-size-sm);\n\t\tline-height: var(--wpds-font-line-height-xs);\n\t\tcolor: var(--wpds-color-fg-content-neutral-weak);\n\t}\n}\n`;\ndocument.head\n .appendChild(document.createElement(\"style\"))\n .appendChild(document.createTextNode(css));\nexport {css};\nexport default {\n \"label\": \"field-module__label__LVrYU\",\n \"is-plain\": \"field-module__is-plain__F8QhR\",\n \"description\": \"field-module__description__CKN1B\"\n};"],
|
|
5
|
+
"mappings": ";AAAA,OAAO,UAAU;AACjB,SAAS,SAAS,cAAc;AAChC,SAAS,kBAAkB;;;ACF3B,IAAM,MAAM;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA4BZ,SAAS,KACJ,YAAY,SAAS,cAAc,OAAO,CAAC,EAC3C,YAAY,SAAS,eAAe,GAAG,CAAC;AAE7C,IAAO,gBAAQ;AAAA,EACb,SAAS;AAAA,EACT,YAAY;AAAA,EACZ,eAAe;AACjB;;;AD3BG;AAHI,IAAM,QAAQ;AAAA,EACpB,SAASA,OAAO,EAAE,WAAW,SAAS,GAAG,UAAU,GAAG,KAAM;AAC3D,WACC;AAAA,MAAC,OAAO;AAAA,MAAP;AAAA,QACA;AAAA,QACA,WAAY;AAAA,UACX,cAAY;AAAA,UACZ,WAAW,cAAa,MAAO,OAAQ,EAAG;AAAA,UAC1C;AAAA,QACD;AAAA,QACE,GAAG;AAAA;AAAA,IACN;AAAA,EAEF;AACD;",
|
|
6
|
+
"names": ["Label"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
// packages/ui/src/form/primitives/field/root.tsx
|
|
2
|
+
import clsx from "clsx";
|
|
3
|
+
import { Field as _Field } from "@base-ui/react/field";
|
|
4
|
+
import { forwardRef } from "@wordpress/element";
|
|
5
|
+
|
|
6
|
+
// packages/ui/src/utils/css/resets.module.css
|
|
7
|
+
var css = `@layer wp-ui-utilities, wp-ui-components, wp-ui-compositions, wp-ui-overrides;
|
|
8
|
+
|
|
9
|
+
@layer wp-ui-utilities {
|
|
10
|
+
.resets-module__box-sizing__M2zT5 {
|
|
11
|
+
box-sizing: border-box;
|
|
12
|
+
|
|
13
|
+
*,
|
|
14
|
+
*::before,
|
|
15
|
+
*::after {
|
|
16
|
+
box-sizing: inherit;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
`;
|
|
21
|
+
document.head.appendChild(document.createElement("style")).appendChild(document.createTextNode(css));
|
|
22
|
+
var resets_default = {
|
|
23
|
+
"box-sizing": "resets-module__box-sizing__M2zT5"
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
// packages/ui/src/form/primitives/field/root.tsx
|
|
27
|
+
import { Stack } from "../../../stack/index.mjs";
|
|
28
|
+
import { jsx } from "react/jsx-runtime";
|
|
29
|
+
var DEFAULT_RENDER = (props) => /* @__PURE__ */ jsx(Stack, { ...props, direction: "column", gap: "xs" });
|
|
30
|
+
var Root = forwardRef(function Root2({ className, render = DEFAULT_RENDER, ...restProps }, ref) {
|
|
31
|
+
return /* @__PURE__ */ jsx(
|
|
32
|
+
_Field.Root,
|
|
33
|
+
{
|
|
34
|
+
ref,
|
|
35
|
+
className: clsx(resets_default["box-sizing"], className),
|
|
36
|
+
render,
|
|
37
|
+
...restProps
|
|
38
|
+
}
|
|
39
|
+
);
|
|
40
|
+
});
|
|
41
|
+
export {
|
|
42
|
+
Root
|
|
43
|
+
};
|
|
44
|
+
//# sourceMappingURL=root.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/form/primitives/field/root.tsx", "../../../../src/utils/css/resets.module.css"],
|
|
4
|
+
"sourcesContent": ["import clsx from 'clsx';\nimport { Field as _Field } from '@base-ui/react/field';\nimport { forwardRef } from '@wordpress/element';\nimport resetStyles from '../../../utils/css/resets.module.css';\nimport type { FieldRootProps } from './types';\nimport { Stack } from '../../../stack';\n\nconst DEFAULT_RENDER = ( props: React.ComponentProps< typeof Stack > ) => (\n\t<Stack { ...props } direction=\"column\" gap=\"xs\" />\n);\n\n/**\n * A low-level component that associates an accessible label and description\n * with a single form control element.\n *\n * To label a group of multiple form control elements, use the `Fieldset` component instead.\n *\n * Simply wrapping a control with this component does not guarantee\n * accessible labeling. See examples for how to associate the label in different cases.\n */\nexport const Root = forwardRef< HTMLDivElement, FieldRootProps >( function Root(\n\t{ className, render = DEFAULT_RENDER, ...restProps },\n\tref\n) {\n\treturn (\n\t\t<_Field.Root\n\t\t\tref={ ref }\n\t\t\tclassName={ clsx( resetStyles[ 'box-sizing' ], className ) }\n\t\t\trender={ render }\n\t\t\t{ ...restProps }\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-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};"],
|
|
5
|
+
"mappings": ";AAAA,OAAO,UAAU;AACjB,SAAS,SAAS,cAAc;AAChC,SAAS,kBAAkB;;;ACF3B,IAAM,MAAM;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAcZ,SAAS,KACJ,YAAY,SAAS,cAAc,OAAO,CAAC,EAC3C,YAAY,SAAS,eAAe,GAAG,CAAC;AAE7C,IAAO,iBAAQ;AAAA,EACb,cAAc;AAChB;;;ADfA,SAAS,aAAa;AAGrB;AADD,IAAM,iBAAiB,CAAE,UACxB,oBAAC,SAAQ,GAAG,OAAQ,WAAU,UAAS,KAAI,MAAK;AAY1C,IAAM,OAAO,WAA8C,SAASA,MAC1E,EAAE,WAAW,SAAS,gBAAgB,GAAG,UAAU,GACnD,KACC;AACD,SACC;AAAA,IAAC,OAAO;AAAA,IAAP;AAAA,MACA;AAAA,MACA,WAAY,KAAM,eAAa,YAAa,GAAG,SAAU;AAAA,MACzD;AAAA,MACE,GAAG;AAAA;AAAA,EACN;AAEF,CAAE;",
|
|
6
|
+
"names": ["Root"]
|
|
7
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=types.mjs.map
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// packages/ui/src/form/primitives/fieldset/context.tsx
|
|
2
|
+
import { createContext, useContext } from "@wordpress/element";
|
|
3
|
+
var FieldsetContext = createContext({
|
|
4
|
+
registerDescriptionId: () => {
|
|
5
|
+
},
|
|
6
|
+
unregisterDescriptionId: () => {
|
|
7
|
+
}
|
|
8
|
+
});
|
|
9
|
+
var useFieldsetContext = () => useContext(FieldsetContext);
|
|
10
|
+
export {
|
|
11
|
+
FieldsetContext,
|
|
12
|
+
useFieldsetContext
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=context.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/form/primitives/fieldset/context.tsx"],
|
|
4
|
+
"sourcesContent": ["import { createContext, useContext } from '@wordpress/element';\n\ntype FieldsetContextType = {\n\tregisterDescriptionId: ( id: string ) => void;\n\tunregisterDescriptionId: () => void;\n};\n\nexport const FieldsetContext = createContext< FieldsetContextType >( {\n\tregisterDescriptionId: () => {},\n\tunregisterDescriptionId: () => {},\n} );\n\nexport const useFieldsetContext = () => useContext( FieldsetContext );\n"],
|
|
5
|
+
"mappings": ";AAAA,SAAS,eAAe,kBAAkB;AAOnC,IAAM,kBAAkB,cAAsC;AAAA,EACpE,uBAAuB,MAAM;AAAA,EAAC;AAAA,EAC9B,yBAAyB,MAAM;AAAA,EAAC;AACjC,CAAE;AAEK,IAAM,qBAAqB,MAAM,WAAY,eAAgB;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
// packages/ui/src/form/primitives/fieldset/description.tsx
|
|
2
|
+
import clsx from "clsx";
|
|
3
|
+
import { mergeProps, useRender } from "@base-ui/react";
|
|
4
|
+
import { forwardRef, useEffect, useId } from "@wordpress/element";
|
|
5
|
+
|
|
6
|
+
// packages/ui/src/utils/css/field.module.css
|
|
7
|
+
var css = `@layer wp-ui-utilities, wp-ui-components, wp-ui-compositions, wp-ui-overrides;
|
|
8
|
+
|
|
9
|
+
@layer wp-ui-utilities {
|
|
10
|
+
.field-module__label__LVrYU {
|
|
11
|
+
--wp-ui-field-label-line-height: var(--wpds-font-line-height-xs);
|
|
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
|
+
}
|
|
33
|
+
}
|
|
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
|
+
};
|
|
41
|
+
|
|
42
|
+
// packages/ui/src/form/primitives/fieldset/description.tsx
|
|
43
|
+
import { useFieldsetContext } from "./context.mjs";
|
|
44
|
+
var FieldsetDescription = forwardRef(function FieldsetDescription2({ className, id: idProp, render, ...restProps }, ref) {
|
|
45
|
+
const generatedId = useId();
|
|
46
|
+
const id = idProp ?? generatedId;
|
|
47
|
+
const { registerDescriptionId, unregisterDescriptionId } = useFieldsetContext();
|
|
48
|
+
useEffect(() => {
|
|
49
|
+
registerDescriptionId(id);
|
|
50
|
+
return unregisterDescriptionId;
|
|
51
|
+
}, [registerDescriptionId, unregisterDescriptionId, id]);
|
|
52
|
+
const element = useRender({
|
|
53
|
+
defaultTagName: "p",
|
|
54
|
+
render,
|
|
55
|
+
ref,
|
|
56
|
+
props: mergeProps(
|
|
57
|
+
{ className: clsx(field_default.description, className), id },
|
|
58
|
+
restProps
|
|
59
|
+
)
|
|
60
|
+
});
|
|
61
|
+
return element;
|
|
62
|
+
});
|
|
63
|
+
export {
|
|
64
|
+
FieldsetDescription
|
|
65
|
+
};
|
|
66
|
+
//# sourceMappingURL=description.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/form/primitives/fieldset/description.tsx", "../../../../src/utils/css/field.module.css"],
|
|
4
|
+
"sourcesContent": ["import clsx from 'clsx';\nimport { mergeProps, useRender } from '@base-ui/react';\nimport { forwardRef, useEffect, useId } from '@wordpress/element';\nimport fieldStyles from '../../../utils/css/field.module.css';\nimport { useFieldsetContext } from './context';\nimport type { FieldsetDescriptionProps } from './types';\n\nexport const FieldsetDescription = forwardRef<\n\tHTMLParagraphElement,\n\tFieldsetDescriptionProps\n>( function FieldsetDescription(\n\t{ className, id: idProp, render, ...restProps },\n\tref\n) {\n\tconst generatedId = useId();\n\tconst id = idProp ?? generatedId;\n\tconst { registerDescriptionId, unregisterDescriptionId } =\n\t\tuseFieldsetContext();\n\n\tuseEffect( () => {\n\t\tregisterDescriptionId( id );\n\t\treturn unregisterDescriptionId;\n\t}, [ registerDescriptionId, unregisterDescriptionId, id ] );\n\n\tconst element = useRender( {\n\t\tdefaultTagName: 'p',\n\t\trender,\n\t\tref,\n\t\tprops: mergeProps< 'p' >(\n\t\t\t{ className: clsx( fieldStyles.description, className ), id },\n\t\t\trestProps\n\t\t),\n\t} );\n\n\treturn element;\n} );\n", "const css = `@layer wp-ui-utilities, wp-ui-components, wp-ui-compositions, wp-ui-overrides;\n\n@layer wp-ui-utilities {\n\t.field-module__label__LVrYU {\n\t\t--wp-ui-field-label-line-height: var(--wpds-font-line-height-xs);\n\n\t\tfont-family: var(--wpds-font-family-body);\n\t\tfont-size: var(--wpds-font-size-xs);\n\t\tline-height: var(--wp-ui-field-label-line-height);\n\t\tfont-weight: var(--wpds-font-weight-medium);\n\t\ttext-transform: uppercase;\n\t\tcolor: var(--wpds-color-fg-content-neutral);\n\n\t\t&.field-module__is-plain__F8QhR {\n\t\t\tfont-size: var(--wpds-font-size-md);\n\t\t\ttext-transform: none;\n\t\t}\n\t}\n\n\t.field-module__description__CKN1B {\n\t\tmargin: 0;\n\t\tfont-family: var(--wpds-font-family-body);\n\t\tfont-size: var(--wpds-font-size-sm);\n\t\tline-height: var(--wpds-font-line-height-xs);\n\t\tcolor: var(--wpds-color-fg-content-neutral-weak);\n\t}\n}\n`;\ndocument.head\n .appendChild(document.createElement(\"style\"))\n .appendChild(document.createTextNode(css));\nexport {css};\nexport default {\n \"label\": \"field-module__label__LVrYU\",\n \"is-plain\": \"field-module__is-plain__F8QhR\",\n \"description\": \"field-module__description__CKN1B\"\n};"],
|
|
5
|
+
"mappings": ";AAAA,OAAO,UAAU;AACjB,SAAS,YAAY,iBAAiB;AACtC,SAAS,YAAY,WAAW,aAAa;;;ACF7C,IAAM,MAAM;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA4BZ,SAAS,KACJ,YAAY,SAAS,cAAc,OAAO,CAAC,EAC3C,YAAY,SAAS,eAAe,GAAG,CAAC;AAE7C,IAAO,gBAAQ;AAAA,EACb,SAAS;AAAA,EACT,YAAY;AAAA,EACZ,eAAe;AACjB;;;ADhCA,SAAS,0BAA0B;AAG5B,IAAM,sBAAsB,WAGhC,SAASA,qBACX,EAAE,WAAW,IAAI,QAAQ,QAAQ,GAAG,UAAU,GAC9C,KACC;AACD,QAAM,cAAc,MAAM;AAC1B,QAAM,KAAK,UAAU;AACrB,QAAM,EAAE,uBAAuB,wBAAwB,IACtD,mBAAmB;AAEpB,YAAW,MAAM;AAChB,0BAAuB,EAAG;AAC1B,WAAO;AAAA,EACR,GAAG,CAAE,uBAAuB,yBAAyB,EAAG,CAAE;AAE1D,QAAM,UAAU,UAAW;AAAA,IAC1B,gBAAgB;AAAA,IAChB;AAAA,IACA;AAAA,IACA,OAAO;AAAA,MACN,EAAE,WAAW,KAAM,cAAY,aAAa,SAAU,GAAG,GAAG;AAAA,MAC5D;AAAA,IACD;AAAA,EACD,CAAE;AAEF,SAAO;AACR,CAAE;",
|
|
6
|
+
"names": ["FieldsetDescription"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
// packages/ui/src/form/primitives/fieldset/details.tsx
|
|
2
|
+
import clsx from "clsx";
|
|
3
|
+
import { forwardRef, useEffect, useId } from "@wordpress/element";
|
|
4
|
+
import { __ } from "@wordpress/i18n";
|
|
5
|
+
|
|
6
|
+
// packages/ui/src/utils/css/field.module.css
|
|
7
|
+
var css = `@layer wp-ui-utilities, wp-ui-components, wp-ui-compositions, wp-ui-overrides;
|
|
8
|
+
|
|
9
|
+
@layer wp-ui-utilities {
|
|
10
|
+
.field-module__label__LVrYU {
|
|
11
|
+
--wp-ui-field-label-line-height: var(--wpds-font-line-height-xs);
|
|
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
|
+
}
|
|
33
|
+
}
|
|
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
|
+
};
|
|
41
|
+
|
|
42
|
+
// packages/ui/src/form/primitives/fieldset/details.tsx
|
|
43
|
+
import { useFieldsetContext } from "./context.mjs";
|
|
44
|
+
import { VisuallyHidden } from "../../../visually-hidden/index.mjs";
|
|
45
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
46
|
+
var FieldsetDetails = forwardRef(function FieldsetDetails2({ className, ...restProps }, ref) {
|
|
47
|
+
const id = useId();
|
|
48
|
+
const { registerDescriptionId, unregisterDescriptionId } = useFieldsetContext();
|
|
49
|
+
useEffect(() => {
|
|
50
|
+
registerDescriptionId(id);
|
|
51
|
+
return unregisterDescriptionId;
|
|
52
|
+
}, [registerDescriptionId, unregisterDescriptionId, id]);
|
|
53
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
54
|
+
/* @__PURE__ */ jsx(VisuallyHidden, { id, children: __("More details follow.") }),
|
|
55
|
+
/* @__PURE__ */ jsx(
|
|
56
|
+
"div",
|
|
57
|
+
{
|
|
58
|
+
ref,
|
|
59
|
+
className: clsx(field_default.description, className),
|
|
60
|
+
...restProps
|
|
61
|
+
}
|
|
62
|
+
)
|
|
63
|
+
] });
|
|
64
|
+
});
|
|
65
|
+
export {
|
|
66
|
+
FieldsetDetails
|
|
67
|
+
};
|
|
68
|
+
//# sourceMappingURL=details.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/form/primitives/fieldset/details.tsx", "../../../../src/utils/css/field.module.css"],
|
|
4
|
+
"sourcesContent": ["import clsx from 'clsx';\nimport { forwardRef, useEffect, useId } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport fieldStyles from '../../../utils/css/field.module.css';\nimport { useFieldsetContext } from './context';\nimport { VisuallyHidden } from '../../../visually-hidden';\nimport type { FieldsetDetailsProps } from './types';\n\n/**\n * A component for showing additional information about the fieldset,\n * styled similarly to a normal `Fieldset.Description`.\n * Unlike a normal description, it can include links and other semantic elements.\n *\n * Although this content is not associated with the fieldset 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 `Fieldset.Description` instead,\n * so the readout is not unnecessarily verbose for screen reader users.\n */\nexport const FieldsetDetails = forwardRef<\n\tHTMLDivElement,\n\tFieldsetDetailsProps\n>( function FieldsetDetails( { className, ...restProps }, ref ) {\n\tconst id = useId();\n\tconst { registerDescriptionId, unregisterDescriptionId } =\n\t\tuseFieldsetContext();\n\n\tuseEffect( () => {\n\t\tregisterDescriptionId( id );\n\t\treturn unregisterDescriptionId;\n\t}, [ registerDescriptionId, unregisterDescriptionId, id ] );\n\n\treturn (\n\t\t<>\n\t\t\t<VisuallyHidden id={ id }>\n\t\t\t\t{ __( 'More details follow.' ) }\n\t\t\t</VisuallyHidden>\n\t\t\t<div\n\t\t\t\tref={ ref }\n\t\t\t\tclassName={ clsx( fieldStyles.description, className ) }\n\t\t\t\t{ ...restProps }\n\t\t\t/>\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-utilities {\n\t.field-module__label__LVrYU {\n\t\t--wp-ui-field-label-line-height: var(--wpds-font-line-height-xs);\n\n\t\tfont-family: var(--wpds-font-family-body);\n\t\tfont-size: var(--wpds-font-size-xs);\n\t\tline-height: var(--wp-ui-field-label-line-height);\n\t\tfont-weight: var(--wpds-font-weight-medium);\n\t\ttext-transform: uppercase;\n\t\tcolor: var(--wpds-color-fg-content-neutral);\n\n\t\t&.field-module__is-plain__F8QhR {\n\t\t\tfont-size: var(--wpds-font-size-md);\n\t\t\ttext-transform: none;\n\t\t}\n\t}\n\n\t.field-module__description__CKN1B {\n\t\tmargin: 0;\n\t\tfont-family: var(--wpds-font-family-body);\n\t\tfont-size: var(--wpds-font-size-sm);\n\t\tline-height: var(--wpds-font-line-height-xs);\n\t\tcolor: var(--wpds-color-fg-content-neutral-weak);\n\t}\n}\n`;\ndocument.head\n .appendChild(document.createElement(\"style\"))\n .appendChild(document.createTextNode(css));\nexport {css};\nexport default {\n \"label\": \"field-module__label__LVrYU\",\n \"is-plain\": \"field-module__is-plain__F8QhR\",\n \"description\": \"field-module__description__CKN1B\"\n};"],
|
|
5
|
+
"mappings": ";AAAA,OAAO,UAAU;AACjB,SAAS,YAAY,WAAW,aAAa;AAC7C,SAAS,UAAU;;;ACFnB,IAAM,MAAM;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA4BZ,SAAS,KACJ,YAAY,SAAS,cAAc,OAAO,CAAC,EAC3C,YAAY,SAAS,eAAe,GAAG,CAAC;AAE7C,IAAO,gBAAQ;AAAA,EACb,SAAS;AAAA,EACT,YAAY;AAAA,EACZ,eAAe;AACjB;;;ADhCA,SAAS,0BAA0B;AACnC,SAAS,sBAAsB;AA6B7B,mBACC,KADD;AAdK,IAAM,kBAAkB,WAG5B,SAASA,iBAAiB,EAAE,WAAW,GAAG,UAAU,GAAG,KAAM;AAC/D,QAAM,KAAK,MAAM;AACjB,QAAM,EAAE,uBAAuB,wBAAwB,IACtD,mBAAmB;AAEpB,YAAW,MAAM;AAChB,0BAAuB,EAAG;AAC1B,WAAO;AAAA,EACR,GAAG,CAAE,uBAAuB,yBAAyB,EAAG,CAAE;AAE1D,SACC,iCACC;AAAA,wBAAC,kBAAe,IACb,aAAI,sBAAuB,GAC9B;AAAA,IACA;AAAA,MAAC;AAAA;AAAA,QACA;AAAA,QACA,WAAY,KAAM,cAAY,aAAa,SAAU;AAAA,QACnD,GAAG;AAAA;AAAA,IACN;AAAA,KACD;AAEF,CAAE;",
|
|
6
|
+
"names": ["FieldsetDetails"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// packages/ui/src/form/primitives/fieldset/index.ts
|
|
2
|
+
import { FieldsetRoot as Root } from "./root.mjs";
|
|
3
|
+
import { FieldsetLegend as Legend } from "./legend.mjs";
|
|
4
|
+
import { FieldsetDescription as Description } from "./description.mjs";
|
|
5
|
+
import { FieldsetDetails as Details } from "./details.mjs";
|
|
6
|
+
export {
|
|
7
|
+
Description,
|
|
8
|
+
Details,
|
|
9
|
+
Legend,
|
|
10
|
+
Root
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/form/primitives/fieldset/index.ts"],
|
|
4
|
+
"sourcesContent": ["import { FieldsetRoot as Root } from './root';\nimport { FieldsetLegend as Legend } from './legend';\nimport { FieldsetDescription as Description } from './description';\nimport { FieldsetDetails as Details } from './details';\n\nexport { Root, Legend, Description, Details };\n"],
|
|
5
|
+
"mappings": ";AAAA,SAAS,gBAAgB,YAAY;AACrC,SAAS,kBAAkB,cAAc;AACzC,SAAS,uBAAuB,mBAAmB;AACnD,SAAS,mBAAmB,eAAe;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|