@und-ui/react 0.0.0-stage → 0.1.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.
Files changed (228) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +35 -2
  3. package/dist/generated/index.d.ts +44 -0
  4. package/dist/generated/index.d.ts.map +1 -0
  5. package/dist/generated/index.js +45 -0
  6. package/dist/generated/index.js.map +1 -0
  7. package/dist/generated/jsx.d.ts +176 -0
  8. package/dist/generated/jsx.d.ts.map +1 -0
  9. package/dist/generated/jsx.js +2 -0
  10. package/dist/generated/jsx.js.map +1 -0
  11. package/dist/generated/shared.d.ts +20 -0
  12. package/dist/generated/shared.d.ts.map +1 -0
  13. package/dist/generated/shared.js +55 -0
  14. package/dist/generated/shared.js.map +1 -0
  15. package/dist/generated/und-accordion.d.ts +11 -0
  16. package/dist/generated/und-accordion.d.ts.map +1 -0
  17. package/dist/generated/und-accordion.js +11 -0
  18. package/dist/generated/und-accordion.js.map +1 -0
  19. package/dist/generated/und-alert.d.ts +20 -0
  20. package/dist/generated/und-alert.d.ts.map +1 -0
  21. package/dist/generated/und-alert.js +16 -0
  22. package/dist/generated/und-alert.js.map +1 -0
  23. package/dist/generated/und-avatar-group.d.ts +17 -0
  24. package/dist/generated/und-avatar-group.d.ts.map +1 -0
  25. package/dist/generated/und-avatar-group.js +11 -0
  26. package/dist/generated/und-avatar-group.js.map +1 -0
  27. package/dist/generated/und-avatar.d.ts +27 -0
  28. package/dist/generated/und-avatar.d.ts.map +1 -0
  29. package/dist/generated/und-avatar.js +11 -0
  30. package/dist/generated/und-avatar.js.map +1 -0
  31. package/dist/generated/und-badge.d.ts +17 -0
  32. package/dist/generated/und-badge.d.ts.map +1 -0
  33. package/dist/generated/und-badge.js +11 -0
  34. package/dist/generated/und-badge.js.map +1 -0
  35. package/dist/generated/und-breadcrumb-item.d.ts +13 -0
  36. package/dist/generated/und-breadcrumb-item.d.ts.map +1 -0
  37. package/dist/generated/und-breadcrumb-item.js +11 -0
  38. package/dist/generated/und-breadcrumb-item.js.map +1 -0
  39. package/dist/generated/und-breadcrumb.d.ts +11 -0
  40. package/dist/generated/und-breadcrumb.d.ts.map +1 -0
  41. package/dist/generated/und-breadcrumb.js +11 -0
  42. package/dist/generated/und-breadcrumb.js.map +1 -0
  43. package/dist/generated/und-button.d.ts +54 -0
  44. package/dist/generated/und-button.d.ts.map +1 -0
  45. package/dist/generated/und-button.js +16 -0
  46. package/dist/generated/und-button.js.map +1 -0
  47. package/dist/generated/und-card.d.ts +19 -0
  48. package/dist/generated/und-card.d.ts.map +1 -0
  49. package/dist/generated/und-card.js +11 -0
  50. package/dist/generated/und-card.js.map +1 -0
  51. package/dist/generated/und-checkbox.d.ts +36 -0
  52. package/dist/generated/und-checkbox.d.ts.map +1 -0
  53. package/dist/generated/und-checkbox.js +23 -0
  54. package/dist/generated/und-checkbox.js.map +1 -0
  55. package/dist/generated/und-combobox.d.ts +56 -0
  56. package/dist/generated/und-combobox.d.ts.map +1 -0
  57. package/dist/generated/und-combobox.js +25 -0
  58. package/dist/generated/und-combobox.js.map +1 -0
  59. package/dist/generated/und-dialog.d.ts +39 -0
  60. package/dist/generated/und-dialog.d.ts.map +1 -0
  61. package/dist/generated/und-dialog.js +18 -0
  62. package/dist/generated/und-dialog.js.map +1 -0
  63. package/dist/generated/und-divider.d.ts +13 -0
  64. package/dist/generated/und-divider.d.ts.map +1 -0
  65. package/dist/generated/und-divider.js +11 -0
  66. package/dist/generated/und-divider.js.map +1 -0
  67. package/dist/generated/und-drawer.d.ts +41 -0
  68. package/dist/generated/und-drawer.d.ts.map +1 -0
  69. package/dist/generated/und-drawer.js +18 -0
  70. package/dist/generated/und-drawer.js.map +1 -0
  71. package/dist/generated/und-form-field.d.ts +19 -0
  72. package/dist/generated/und-form-field.d.ts.map +1 -0
  73. package/dist/generated/und-form-field.js +11 -0
  74. package/dist/generated/und-form-field.js.map +1 -0
  75. package/dist/generated/und-icon-button.d.ts +54 -0
  76. package/dist/generated/und-icon-button.d.ts.map +1 -0
  77. package/dist/generated/und-icon-button.js +16 -0
  78. package/dist/generated/und-icon-button.js.map +1 -0
  79. package/dist/generated/und-link.d.ts +23 -0
  80. package/dist/generated/und-link.d.ts.map +1 -0
  81. package/dist/generated/und-link.js +11 -0
  82. package/dist/generated/und-link.js.map +1 -0
  83. package/dist/generated/und-menu-group.d.ts +11 -0
  84. package/dist/generated/und-menu-group.d.ts.map +1 -0
  85. package/dist/generated/und-menu-group.js +11 -0
  86. package/dist/generated/und-menu-group.js.map +1 -0
  87. package/dist/generated/und-menu-item.d.ts +21 -0
  88. package/dist/generated/und-menu-item.d.ts.map +1 -0
  89. package/dist/generated/und-menu-item.js +11 -0
  90. package/dist/generated/und-menu-item.js.map +1 -0
  91. package/dist/generated/und-menu-separator.d.ts +9 -0
  92. package/dist/generated/und-menu-separator.d.ts.map +1 -0
  93. package/dist/generated/und-menu-separator.js +11 -0
  94. package/dist/generated/und-menu-separator.js.map +1 -0
  95. package/dist/generated/und-menu.d.ts +25 -0
  96. package/dist/generated/und-menu.d.ts.map +1 -0
  97. package/dist/generated/und-menu.js +17 -0
  98. package/dist/generated/und-menu.js.map +1 -0
  99. package/dist/generated/und-pagination.d.ts +30 -0
  100. package/dist/generated/und-pagination.d.ts.map +1 -0
  101. package/dist/generated/und-pagination.js +16 -0
  102. package/dist/generated/und-pagination.js.map +1 -0
  103. package/dist/generated/und-popover.d.ts +31 -0
  104. package/dist/generated/und-popover.d.ts.map +1 -0
  105. package/dist/generated/und-popover.js +18 -0
  106. package/dist/generated/und-popover.js.map +1 -0
  107. package/dist/generated/und-progress.d.ts +23 -0
  108. package/dist/generated/und-progress.d.ts.map +1 -0
  109. package/dist/generated/und-progress.js +11 -0
  110. package/dist/generated/und-progress.js.map +1 -0
  111. package/dist/generated/und-radio-group.d.ts +32 -0
  112. package/dist/generated/und-radio-group.d.ts.map +1 -0
  113. package/dist/generated/und-radio-group.js +23 -0
  114. package/dist/generated/und-radio-group.js.map +1 -0
  115. package/dist/generated/und-radio.d.ts +19 -0
  116. package/dist/generated/und-radio.d.ts.map +1 -0
  117. package/dist/generated/und-radio.js +11 -0
  118. package/dist/generated/und-radio.js.map +1 -0
  119. package/dist/generated/und-select.d.ts +38 -0
  120. package/dist/generated/und-select.d.ts.map +1 -0
  121. package/dist/generated/und-select.js +24 -0
  122. package/dist/generated/und-select.js.map +1 -0
  123. package/dist/generated/und-skeleton.d.ts +13 -0
  124. package/dist/generated/und-skeleton.d.ts.map +1 -0
  125. package/dist/generated/und-skeleton.js +11 -0
  126. package/dist/generated/und-skeleton.js.map +1 -0
  127. package/dist/generated/und-slider.d.ts +50 -0
  128. package/dist/generated/und-slider.d.ts.map +1 -0
  129. package/dist/generated/und-slider.js +23 -0
  130. package/dist/generated/und-slider.js.map +1 -0
  131. package/dist/generated/und-spinner.d.ts +15 -0
  132. package/dist/generated/und-spinner.d.ts.map +1 -0
  133. package/dist/generated/und-spinner.js +11 -0
  134. package/dist/generated/und-spinner.js.map +1 -0
  135. package/dist/generated/und-switch.d.ts +34 -0
  136. package/dist/generated/und-switch.d.ts.map +1 -0
  137. package/dist/generated/und-switch.js +23 -0
  138. package/dist/generated/und-switch.js.map +1 -0
  139. package/dist/generated/und-tab-panel.d.ts +11 -0
  140. package/dist/generated/und-tab-panel.d.ts.map +1 -0
  141. package/dist/generated/und-tab-panel.js +11 -0
  142. package/dist/generated/und-tab-panel.js.map +1 -0
  143. package/dist/generated/und-tab.d.ts +15 -0
  144. package/dist/generated/und-tab.d.ts.map +1 -0
  145. package/dist/generated/und-tab.js +11 -0
  146. package/dist/generated/und-tab.js.map +1 -0
  147. package/dist/generated/und-table.d.ts +26 -0
  148. package/dist/generated/und-table.d.ts.map +1 -0
  149. package/dist/generated/und-table.js +16 -0
  150. package/dist/generated/und-table.js.map +1 -0
  151. package/dist/generated/und-tabs.d.ts +20 -0
  152. package/dist/generated/und-tabs.d.ts.map +1 -0
  153. package/dist/generated/und-tabs.js +16 -0
  154. package/dist/generated/und-tabs.js.map +1 -0
  155. package/dist/generated/und-text-field.d.ts +58 -0
  156. package/dist/generated/und-text-field.d.ts.map +1 -0
  157. package/dist/generated/und-text-field.js +23 -0
  158. package/dist/generated/und-text-field.js.map +1 -0
  159. package/dist/generated/und-textarea.d.ts +48 -0
  160. package/dist/generated/und-textarea.d.ts.map +1 -0
  161. package/dist/generated/und-textarea.js +23 -0
  162. package/dist/generated/und-textarea.js.map +1 -0
  163. package/dist/generated/und-toast.d.ts +26 -0
  164. package/dist/generated/und-toast.d.ts.map +1 -0
  165. package/dist/generated/und-toast.js +16 -0
  166. package/dist/generated/und-toast.js.map +1 -0
  167. package/dist/generated/und-toaster.d.ts +15 -0
  168. package/dist/generated/und-toaster.d.ts.map +1 -0
  169. package/dist/generated/und-toaster.js +11 -0
  170. package/dist/generated/und-toaster.js.map +1 -0
  171. package/dist/generated/und-tooltip.d.ts +29 -0
  172. package/dist/generated/und-tooltip.d.ts.map +1 -0
  173. package/dist/generated/und-tooltip.js +16 -0
  174. package/dist/generated/und-tooltip.js.map +1 -0
  175. package/dist/generated/und-visually-hidden.d.ts +11 -0
  176. package/dist/generated/und-visually-hidden.d.ts.map +1 -0
  177. package/dist/generated/und-visually-hidden.js +11 -0
  178. package/dist/generated/und-visually-hidden.js.map +1 -0
  179. package/dist/index.d.ts +2 -0
  180. package/dist/index.d.ts.map +1 -0
  181. package/dist/index.js +2 -0
  182. package/dist/index.js.map +1 -0
  183. package/package.json +61 -3
  184. package/src/generated/index.ts +46 -0
  185. package/src/generated/jsx.ts +166 -0
  186. package/src/generated/shared.ts +67 -0
  187. package/src/generated/und-accordion.ts +19 -0
  188. package/src/generated/und-alert.ts +32 -0
  189. package/src/generated/und-avatar-group.ts +25 -0
  190. package/src/generated/und-avatar.ts +35 -0
  191. package/src/generated/und-badge.ts +25 -0
  192. package/src/generated/und-breadcrumb-item.ts +21 -0
  193. package/src/generated/und-breadcrumb.ts +19 -0
  194. package/src/generated/und-button.ts +64 -0
  195. package/src/generated/und-card.ts +27 -0
  196. package/src/generated/und-checkbox.ts +55 -0
  197. package/src/generated/und-combobox.ts +77 -0
  198. package/src/generated/und-dialog.ts +50 -0
  199. package/src/generated/und-divider.ts +21 -0
  200. package/src/generated/und-drawer.ts +52 -0
  201. package/src/generated/und-form-field.ts +27 -0
  202. package/src/generated/und-icon-button.ts +64 -0
  203. package/src/generated/und-link.ts +31 -0
  204. package/src/generated/und-menu-group.ts +19 -0
  205. package/src/generated/und-menu-item.ts +29 -0
  206. package/src/generated/und-menu-separator.ts +17 -0
  207. package/src/generated/und-menu.ts +33 -0
  208. package/src/generated/und-pagination.ts +42 -0
  209. package/src/generated/und-popover.ts +42 -0
  210. package/src/generated/und-progress.ts +31 -0
  211. package/src/generated/und-radio-group.ts +51 -0
  212. package/src/generated/und-radio.ts +27 -0
  213. package/src/generated/und-select.ts +58 -0
  214. package/src/generated/und-skeleton.ts +21 -0
  215. package/src/generated/und-slider.ts +69 -0
  216. package/src/generated/und-spinner.ts +23 -0
  217. package/src/generated/und-switch.ts +53 -0
  218. package/src/generated/und-tab-panel.ts +19 -0
  219. package/src/generated/und-tab.ts +23 -0
  220. package/src/generated/und-table.ts +38 -0
  221. package/src/generated/und-tabs.ts +32 -0
  222. package/src/generated/und-text-field.ts +77 -0
  223. package/src/generated/und-textarea.ts +67 -0
  224. package/src/generated/und-toast.ts +36 -0
  225. package/src/generated/und-toaster.ts +23 -0
  226. package/src/generated/und-tooltip.ts +38 -0
  227. package/src/generated/und-visually-hidden.ts +19 -0
  228. package/src/index.ts +1 -0
@@ -0,0 +1,67 @@
1
+ 'use client';
2
+ // GENERATED FILE. DO NOT EDIT.
3
+ // Source: @und-ui/core custom-elements.json, via tools/codegen/wrappers.mjs.
4
+ // Run `pnpm codegen` (or `pnpm build`) after changing a component.
5
+ import { useCallback, useLayoutEffect, useRef, type Ref, type RefCallback } from 'react';
6
+
7
+ /**
8
+ * A DOM event whose `currentTarget` is the UND UI element the handler is on,
9
+ * so `event.currentTarget.value` needs no cast.
10
+ */
11
+ export type UndEvent<E extends Event, T extends EventTarget> = E & { currentTarget: T };
12
+
13
+ function assignRef<T>(ref: Ref<T> | undefined, value: T): () => void {
14
+ if (typeof ref === 'function') {
15
+ const cleanup = ref(value);
16
+ return typeof cleanup === 'function' ? cleanup : () => ref(null);
17
+ }
18
+ if (ref) {
19
+ ref.current = value;
20
+ return () => {
21
+ ref.current = null;
22
+ };
23
+ }
24
+ return () => {};
25
+ }
26
+
27
+ /**
28
+ * @internal Makes `prop` controlled, like `value` on a React `<input>`: after
29
+ * the handler of a user change has run (`settle`) and after every render, the
30
+ * element is put back to the latest `value` prop when they differ. A handler
31
+ * that rejects the change (does not update state) therefore leaves the element
32
+ * showing the state. `undefined` leaves the element uncontrolled.
33
+ */
34
+ export function useControlledProp<E extends HTMLElement, K extends keyof E>(
35
+ prop: K,
36
+ value: E[K] | undefined,
37
+ ref: Ref<E> | undefined,
38
+ ): { ref: RefCallback<E>; settle: () => void } {
39
+ const latest = useRef(value);
40
+ const node = useRef<E | null>(null);
41
+ const restore = useCallback((): void => {
42
+ const el = node.current;
43
+ const current = latest.current;
44
+ if (el && current !== undefined && el[prop] !== current) el[prop] = current;
45
+ }, [prop]);
46
+ useLayoutEffect(() => {
47
+ latest.current = value;
48
+ restore();
49
+ });
50
+ const refCallback = useCallback(
51
+ (el: E | null) => {
52
+ if (!el) return;
53
+ node.current = el;
54
+ const release = assignRef(ref, el);
55
+ return () => {
56
+ node.current = null;
57
+ release();
58
+ };
59
+ },
60
+ [ref],
61
+ );
62
+ // Called after the user's handler: React flushes the state updates of a
63
+ // discrete event in a microtask the handler queued, so this one runs after
64
+ // that render has committed.
65
+ const settle = useCallback((): void => queueMicrotask(restore), [restore]);
66
+ return { ref: refCallback, settle };
67
+ }
@@ -0,0 +1,19 @@
1
+ 'use client';
2
+ // GENERATED FILE. DO NOT EDIT.
3
+ // Source: @und-ui/core custom-elements.json, via tools/codegen/wrappers.mjs.
4
+ // Run `pnpm codegen` (or `pnpm build`) after changing a component.
5
+ import { createElement, type HTMLAttributes, type ReactElement, type Ref } from 'react';
6
+ import '@und-ui/core/accordion.js';
7
+ import type { UndAccordion as UndAccordionElement } from '@und-ui/core';
8
+
9
+ export interface UndAccordionProps
10
+ extends Omit<HTMLAttributes<UndAccordionElement>, 'type'> {
11
+ /** `single` keeps at most one item open; `multiple` lets items open independently. */
12
+ type?: UndAccordionElement['type'];
13
+ ref?: Ref<UndAccordionElement>;
14
+ }
15
+
16
+ /** Stacked headers that show and hide sections of content. */
17
+ export function UndAccordion(props: UndAccordionProps): ReactElement {
18
+ return createElement('und-accordion', props);
19
+ }
@@ -0,0 +1,32 @@
1
+ 'use client';
2
+ // GENERATED FILE. DO NOT EDIT.
3
+ // Source: @und-ui/core custom-elements.json, via tools/codegen/wrappers.mjs.
4
+ // Run `pnpm codegen` (or `pnpm build`) after changing a component.
5
+ import { createElement, type HTMLAttributes, type ReactElement, type Ref } from 'react';
6
+ import '@und-ui/core/alert.js';
7
+ import type { UndAlert as UndAlertElement } from '@und-ui/core';
8
+ import { type UndEvent } from './shared.js';
9
+
10
+ export interface UndAlertProps
11
+ extends Omit<HTMLAttributes<UndAlertElement>, 'tone' | 'live' | 'dismissible' | 'dismissLabel' | 'onUndDismiss'> {
12
+ /** Color intent and default icon. */
13
+ tone?: UndAlertElement['tone'];
14
+ /** Live region behaviour. `off` (default) for content present on load; `polite` (role `status`) or `assertive` (role `alert`) for messages that appear or change while the user works. */
15
+ live?: UndAlertElement['live'];
16
+ /** Shows a dismiss button. Pressing it fires `und-dismiss` and hides the alert. */
17
+ dismissible?: UndAlertElement['dismissible'];
18
+ /** Accessible name of the dismiss button (localise it). */
19
+ dismissLabel?: UndAlertElement['dismissLabel'];
20
+ /** Before the alert hides after the dismiss button is pressed. Cancelable: call `preventDefault()` to keep it visible. */
21
+ onUndDismiss?: (event: UndEvent<CustomEvent<unknown>, UndAlertElement>) => void;
22
+ ref?: Ref<UndAlertElement>;
23
+ }
24
+
25
+ /** Shows a short, important message in context. */
26
+ export function UndAlert(props: UndAlertProps): ReactElement {
27
+ const { onUndDismiss, ...rest } = props;
28
+ return createElement('und-alert', {
29
+ ...rest,
30
+ 'onund-dismiss': onUndDismiss,
31
+ });
32
+ }
@@ -0,0 +1,25 @@
1
+ 'use client';
2
+ // GENERATED FILE. DO NOT EDIT.
3
+ // Source: @und-ui/core custom-elements.json, via tools/codegen/wrappers.mjs.
4
+ // Run `pnpm codegen` (or `pnpm build`) after changing a component.
5
+ import { createElement, type HTMLAttributes, type ReactElement, type Ref } from 'react';
6
+ import '@und-ui/core/avatar-group.js';
7
+ import type { UndAvatarGroup as UndAvatarGroupElement } from '@und-ui/core';
8
+
9
+ export interface UndAvatarGroupProps
10
+ extends Omit<HTMLAttributes<UndAvatarGroupElement>, 'label' | 'max' | 'size' | 'moreLabel'> {
11
+ /** Accessible name of the group, such as "Project members". */
12
+ label?: UndAvatarGroupElement['label'];
13
+ /** Maximum number of avatars shown before the "+N" counter. */
14
+ max?: UndAvatarGroupElement['max'];
15
+ /** Size of the "+N" counter; match it to the avatars. */
16
+ size?: UndAvatarGroupElement['size'];
17
+ /** Spoken text of the counter; `{count}` is replaced by the hidden count. */
18
+ moreLabel?: UndAvatarGroupElement['moreLabel'];
19
+ ref?: Ref<UndAvatarGroupElement>;
20
+ }
21
+
22
+ /** Overlapping avatars with an overflow counter. */
23
+ export function UndAvatarGroup(props: UndAvatarGroupProps): ReactElement {
24
+ return createElement('und-avatar-group', props);
25
+ }
@@ -0,0 +1,35 @@
1
+ 'use client';
2
+ // GENERATED FILE. DO NOT EDIT.
3
+ // Source: @und-ui/core custom-elements.json, via tools/codegen/wrappers.mjs.
4
+ // Run `pnpm codegen` (or `pnpm build`) after changing a component.
5
+ import { createElement, type HTMLAttributes, type ReactElement, type Ref } from 'react';
6
+ import '@und-ui/core/avatar.js';
7
+ import type { UndAvatar as UndAvatarElement } from '@und-ui/core';
8
+
9
+ export interface UndAvatarProps
10
+ extends Omit<HTMLAttributes<UndAvatarElement>, 'src' | 'name' | 'size' | 'shape' | 'status' | 'statusLabel' | 'decorative' | 'loading' | 'referrerPolicy'> {
11
+ /** Image URL. Loaded lazily; on error the initials are shown. Only http(s), blob, `data:image/...` and relative URLs are loaded (see `setAllowedUrlSchemes()`). */
12
+ src?: UndAvatarElement['src'];
13
+ /** Name of the person or entity: the accessible name and the source of the initials. */
14
+ name?: UndAvatarElement['name'];
15
+ /** Size of the avatar. */
16
+ size?: UndAvatarElement['size'];
17
+ /** Corner style. */
18
+ shape?: UndAvatarElement['shape'];
19
+ /** Presence indicator. It is part of the accessible name, not color only. */
20
+ status?: UndAvatarElement['status'];
21
+ /** Spoken text for `status` (defaults to the status value). Localize it. */
22
+ statusLabel?: UndAvatarElement['statusLabel'];
23
+ /** Hides the avatar from assistive technology (it sits next to a visible name). */
24
+ decorative?: UndAvatarElement['decorative'];
25
+ /** Image loading strategy. */
26
+ loading?: UndAvatarElement['loading'];
27
+ /** Referrer policy for the image request. */
28
+ referrerPolicy?: UndAvatarElement['referrerPolicy'];
29
+ ref?: Ref<UndAvatarElement>;
30
+ }
31
+
32
+ /** Picture, initials or icon for a person. */
33
+ export function UndAvatar(props: UndAvatarProps): ReactElement {
34
+ return createElement('und-avatar', props);
35
+ }
@@ -0,0 +1,25 @@
1
+ 'use client';
2
+ // GENERATED FILE. DO NOT EDIT.
3
+ // Source: @und-ui/core custom-elements.json, via tools/codegen/wrappers.mjs.
4
+ // Run `pnpm codegen` (or `pnpm build`) after changing a component.
5
+ import { createElement, type HTMLAttributes, type ReactElement, type Ref } from 'react';
6
+ import '@und-ui/core/badge.js';
7
+ import type { UndBadge as UndBadgeElement } from '@und-ui/core';
8
+
9
+ export interface UndBadgeProps
10
+ extends Omit<HTMLAttributes<UndBadgeElement>, 'tone' | 'variant' | 'size' | 'dot'> {
11
+ /** Color intent. */
12
+ tone?: UndBadgeElement['tone'];
13
+ /** Visual style. */
14
+ variant?: UndBadgeElement['variant'];
15
+ /** Size of the badge. */
16
+ size?: UndBadgeElement['size'];
17
+ /** Shows a status dot before the text (decorative; the text carries the meaning). */
18
+ dot?: UndBadgeElement['dot'];
19
+ ref?: Ref<UndBadgeElement>;
20
+ }
21
+
22
+ /** Static status, count or category label. */
23
+ export function UndBadge(props: UndBadgeProps): ReactElement {
24
+ return createElement('und-badge', props);
25
+ }
@@ -0,0 +1,21 @@
1
+ 'use client';
2
+ // GENERATED FILE. DO NOT EDIT.
3
+ // Source: @und-ui/core custom-elements.json, via tools/codegen/wrappers.mjs.
4
+ // Run `pnpm codegen` (or `pnpm build`) after changing a component.
5
+ import { createElement, type HTMLAttributes, type ReactElement, type Ref } from 'react';
6
+ import '@und-ui/core/breadcrumb-item.js';
7
+ import type { UndBreadcrumbItem as UndBreadcrumbItemElement } from '@und-ui/core';
8
+
9
+ export interface UndBreadcrumbItemProps
10
+ extends Omit<HTMLAttributes<UndBreadcrumbItemElement>, 'href' | 'current'> {
11
+ /** Link target. Without it the item renders as plain text. Only http(s), mailto, tel and relative URLs are linked (see `setAllowedUrlSchemes()`). */
12
+ href?: UndBreadcrumbItemElement['href'];
13
+ /** Marks this item as the current page. By default the last item is current. */
14
+ current?: UndBreadcrumbItemElement['current'];
15
+ ref?: Ref<UndBreadcrumbItemElement>;
16
+ }
17
+
18
+ /** A breadcrumb step. */
19
+ export function UndBreadcrumbItem(props: UndBreadcrumbItemProps): ReactElement {
20
+ return createElement('und-breadcrumb-item', props);
21
+ }
@@ -0,0 +1,19 @@
1
+ 'use client';
2
+ // GENERATED FILE. DO NOT EDIT.
3
+ // Source: @und-ui/core custom-elements.json, via tools/codegen/wrappers.mjs.
4
+ // Run `pnpm codegen` (or `pnpm build`) after changing a component.
5
+ import { createElement, type HTMLAttributes, type ReactElement, type Ref } from 'react';
6
+ import '@und-ui/core/breadcrumb.js';
7
+ import type { UndBreadcrumb as UndBreadcrumbElement } from '@und-ui/core';
8
+
9
+ export interface UndBreadcrumbProps
10
+ extends Omit<HTMLAttributes<UndBreadcrumbElement>, 'label'> {
11
+ /** Accessible name of the navigation landmark (localise it). */
12
+ label?: UndBreadcrumbElement['label'];
13
+ ref?: Ref<UndBreadcrumbElement>;
14
+ }
15
+
16
+ /** Shows where the current page sits in the site hierarchy. */
17
+ export function UndBreadcrumb(props: UndBreadcrumbProps): ReactElement {
18
+ return createElement('und-breadcrumb', props);
19
+ }
@@ -0,0 +1,64 @@
1
+ 'use client';
2
+ // GENERATED FILE. DO NOT EDIT.
3
+ // Source: @und-ui/core custom-elements.json, via tools/codegen/wrappers.mjs.
4
+ // Run `pnpm codegen` (or `pnpm build`) after changing a component.
5
+ import { createElement, type HTMLAttributes, type ReactElement, type Ref } from 'react';
6
+ import '@und-ui/core/button.js';
7
+ import type { UndButton as UndButtonElement } from '@und-ui/core';
8
+ import { type UndEvent } from './shared.js';
9
+
10
+ export interface UndButtonProps
11
+ extends Omit<HTMLAttributes<UndButtonElement>, 'variant' | 'tone' | 'size' | 'type' | 'disabled' | 'disabledFocusable' | 'loading' | 'loadingLabel' | 'label' | 'name' | 'value' | 'fullWidth' | 'toggle' | 'pressed' | 'href' | 'target' | 'rel' | 'download' | 'command' | 'commandFor' | 'onUndPressedChange'> {
12
+ /** Visual style. */
13
+ variant?: UndButtonElement['variant'];
14
+ /** Color intent. */
15
+ tone?: UndButtonElement['tone'];
16
+ /** Size of the button. */
17
+ size?: UndButtonElement['size'];
18
+ /** Behaviour inside a form, as on a native button. Ignored in link mode. */
19
+ type?: UndButtonElement['type'];
20
+ /** Disables the button. It is removed from the tab order, as natively. */
21
+ disabled?: UndButtonElement['disabled'];
22
+ /** Blocks activation but keeps the button in the tab order (`aria-disabled="true"`), so it can be found and explain why it is unavailable. */
23
+ disabledFocusable?: UndButtonElement['disabledFocusable'];
24
+ /** Shows a spinner, sets `aria-busy` and blocks activation while keeping focus on the button. */
25
+ loading?: UndButtonElement['loading'];
26
+ /** Text announced through a polite live region when `loading` turns on. */
27
+ loadingLabel?: UndButtonElement['loadingLabel'];
28
+ /** Accessible name for icon-only buttons (forwarded as `aria-label` to the inner control). Prefer visible text when you can. */
29
+ label?: UndButtonElement['label'];
30
+ /** Name submitted with the form data when this button submits the form. */
31
+ name?: UndButtonElement['name'];
32
+ /** Value submitted with `name` when this button submits the form. */
33
+ value?: UndButtonElement['value'];
34
+ /** Stretches the button to the inline size of its container. */
35
+ fullWidth?: UndButtonElement['fullWidth'];
36
+ /** Makes it a toggle button: it exposes `aria-pressed` and flips `pressed` on activation, after a cancelable `und-pressed-change`. */
37
+ toggle?: UndButtonElement['toggle'];
38
+ /** Pressed state of a toggle button. Setting it also exposes `aria-pressed`. */
39
+ pressed?: UndButtonElement['pressed'];
40
+ /** Renders a native link (`<a href>`) styled as a button. Only http(s), mailto, tel and relative URLs are linked (opt in to more with `setAllowedUrlSchemes()`). */
41
+ href?: UndButtonElement['href'];
42
+ /** Link target (link mode). Any target other than `_self`, `_parent` or `_top` adds `rel="noopener noreferrer"`. */
43
+ target?: UndButtonElement['target'];
44
+ /** Link relationship (link mode). */
45
+ rel?: UndButtonElement['rel'];
46
+ /** Downloads the linked resource, optionally under this file name (link mode). */
47
+ download?: UndButtonElement['download'];
48
+ /** Invoker command run on the `commandfor` element: `show-modal`, `close`, `request-close`, `toggle-popover`, `show-popover`, `hide-popover` or a `--custom` command. */
49
+ command?: UndButtonElement['command'];
50
+ /** Id of the element that `command` acts on, looked up in the button's own tree (document or shadow root). */
51
+ commandFor?: UndButtonElement['commandFor'];
52
+ /** A toggle button is about to change its pressed state. Cancelable: `preventDefault()` keeps the current state (controlled mode). */
53
+ onUndPressedChange?: (event: UndEvent<CustomEvent<{ pressed: boolean }>, UndButtonElement>) => void;
54
+ ref?: Ref<UndButtonElement>;
55
+ }
56
+
57
+ /** Triggers an action, submits a form, or navigates (with `href`). */
58
+ export function UndButton(props: UndButtonProps): ReactElement {
59
+ const { onUndPressedChange, ...rest } = props;
60
+ return createElement('und-button', {
61
+ ...rest,
62
+ 'onund-pressed-change': onUndPressedChange,
63
+ });
64
+ }
@@ -0,0 +1,27 @@
1
+ 'use client';
2
+ // GENERATED FILE. DO NOT EDIT.
3
+ // Source: @und-ui/core custom-elements.json, via tools/codegen/wrappers.mjs.
4
+ // Run `pnpm codegen` (or `pnpm build`) after changing a component.
5
+ import { createElement, type HTMLAttributes, type ReactElement, type Ref } from 'react';
6
+ import '@und-ui/core/card.js';
7
+ import type { UndCard as UndCardElement } from '@und-ui/core';
8
+
9
+ export interface UndCardProps
10
+ extends Omit<HTMLAttributes<UndCardElement>, 'variant' | 'headingLevel' | 'href' | 'target' | 'rel'> {
11
+ /** Surface style. */
12
+ variant?: UndCardElement['variant'];
13
+ /** Level of the heading (1 to 6), so the card fits the page outline. */
14
+ headingLevel?: UndCardElement['headingLevel'];
15
+ /** Makes the card interactive: the heading becomes a link whose hit area covers the card. Only http(s), mailto, tel and relative URLs are linked (opt in to more with `setAllowedUrlSchemes()`). */
16
+ href?: UndCardElement['href'];
17
+ /** Link target (with `href`). Any target other than `_self`, `_parent` or `_top` adds `rel="noopener noreferrer"`. */
18
+ target?: UndCardElement['target'];
19
+ /** Link relationship (with `href`). */
20
+ rel?: UndCardElement['rel'];
21
+ ref?: Ref<UndCardElement>;
22
+ }
23
+
24
+ /** Groups related content and actions on a surface. */
25
+ export function UndCard(props: UndCardProps): ReactElement {
26
+ return createElement('und-card', props);
27
+ }
@@ -0,0 +1,55 @@
1
+ 'use client';
2
+ // GENERATED FILE. DO NOT EDIT.
3
+ // Source: @und-ui/core custom-elements.json, via tools/codegen/wrappers.mjs.
4
+ // Run `pnpm codegen` (or `pnpm build`) after changing a component.
5
+ import { createElement, type HTMLAttributes, type ReactElement, type Ref } from 'react';
6
+ import '@und-ui/core/checkbox.js';
7
+ import type { UndCheckbox as UndCheckboxElement } from '@und-ui/core';
8
+ import { useControlledProp, type UndEvent } from './shared.js';
9
+
10
+ export interface UndCheckboxProps
11
+ extends Omit<HTMLAttributes<UndCheckboxElement>, 'indeterminate' | 'checked' | 'defaultChecked' | 'value' | 'label' | 'description' | 'error' | 'required' | 'optional' | 'disabled' | 'name' | 'onInput' | 'onChange'> {
12
+ /** Mixed state (`aria-checked="mixed"`), for a parent of partly checked children. Cleared when the user toggles the checkbox. */
13
+ indeterminate?: UndCheckboxElement['indeterminate'];
14
+ /** Whether the control is checked. The `checked` attribute also sets the default restored by a form reset, as on a native checkbox. */
15
+ checked?: UndCheckboxElement['checked'];
16
+ /** Checked state restored on form reset (defaults to the initial `checked`). */
17
+ defaultChecked?: UndCheckboxElement['defaultChecked'];
18
+ /** Value submitted with `name` when checked. */
19
+ value?: UndCheckboxElement['value'];
20
+ /** Visible label text. Rich content (links) can be passed as children instead on choice controls. */
21
+ label?: UndCheckboxElement['label'];
22
+ /** Help text under the label, referenced by `aria-describedby`. */
23
+ description?: UndCheckboxElement['description'];
24
+ /** Error message. Setting it marks the control invalid (`aria-invalid`, `setCustomValidity`) and shows the message, prefixed with a visually hidden "Error:". Native validation messages are shown automatically after a failed submit and cleared once the value is valid. */
25
+ error?: UndCheckboxElement['error'];
26
+ /** Requires a value before the form submits (native constraint validation). */
27
+ required?: UndCheckboxElement['required'];
28
+ /** Shows an "(optional)" marker after the label (GOV.UK style). Ignored when `required` is set. */
29
+ optional?: UndCheckboxElement['optional'];
30
+ /** Disables the control. A disabled ancestor `<fieldset>` also disables it. */
31
+ disabled?: UndCheckboxElement['disabled'];
32
+ /** Name submitted with the form data. */
33
+ name?: UndCheckboxElement['name'];
34
+ /** Native `input` from the inner checkbox. */
35
+ onInput?: (event: UndEvent<InputEvent, UndCheckboxElement>) => void;
36
+ /** Native `change` after the user toggles the checkbox. */
37
+ onChange?: (event: UndEvent<Event, UndCheckboxElement>) => void;
38
+ ref?: Ref<UndCheckboxElement>;
39
+ }
40
+
41
+ /** A checkbox with label, description, error and an indeterminate state. */
42
+ export function UndCheckbox(props: UndCheckboxProps): ReactElement {
43
+ const { onInput, onChange, ref, ...rest } = props;
44
+ // Controlled when `checked` is set: a change the handler rejects is undone.
45
+ const controlled = useControlledProp<UndCheckboxElement, 'checked'>('checked', props.checked, ref);
46
+ return createElement('und-checkbox', {
47
+ ...rest,
48
+ ref: controlled.ref,
49
+ 'oninput': onInput,
50
+ 'onchange': (event: UndEvent<Event, UndCheckboxElement>) => {
51
+ onChange?.(event);
52
+ controlled.settle();
53
+ },
54
+ });
55
+ }
@@ -0,0 +1,77 @@
1
+ 'use client';
2
+ // GENERATED FILE. DO NOT EDIT.
3
+ // Source: @und-ui/core custom-elements.json, via tools/codegen/wrappers.mjs.
4
+ // Run `pnpm codegen` (or `pnpm build`) after changing a component.
5
+ import { createElement, type HTMLAttributes, type ReactElement, type Ref } from 'react';
6
+ import '@und-ui/core/combobox.js';
7
+ import type { UndCombobox as UndComboboxElement } from '@und-ui/core';
8
+ import { useControlledProp, type UndEvent } from './shared.js';
9
+
10
+ export interface UndComboboxProps
11
+ extends Omit<HTMLAttributes<UndComboboxElement>, 'value' | 'label' | 'description' | 'error' | 'placeholder' | 'name' | 'size' | 'disabled' | 'required' | 'open' | 'filter' | 'allowCustomValue' | 'loading' | 'debounce' | 'noResultsText' | 'loadingText' | 'options' | 'inputValue' | 'resultsMessage' | 'onChange' | 'onInput' | 'onUndSearch' | 'onUndOpenChange'> {
12
+ /** The committed value: the selected option's `value`, or the typed text with `allow-custom-value`. The attribute sets the initial (and reset) value. */
13
+ value?: UndComboboxElement['value'];
14
+ /** Visible label text, shown above the input as on `und-text-field`. It is also the accessible name; a `<label for>`, `aria-labelledby` or `aria-label` on the element works too. */
15
+ label?: UndComboboxElement['label'];
16
+ /** Help text under the label, announced as the input's description. */
17
+ description?: UndComboboxElement['description'];
18
+ /** Error message. Marks the input invalid (`aria-invalid`, a custom validity error) and shows the message, prefixed with a visually hidden "Error:". A native "required" message also shows after a failed submit. */
19
+ error?: UndComboboxElement['error'];
20
+ /** Placeholder text of the input. */
21
+ placeholder?: UndComboboxElement['placeholder'];
22
+ /** Form field name. */
23
+ name?: UndComboboxElement['name'];
24
+ /** Size of the control. */
25
+ size?: UndComboboxElement['size'];
26
+ /** Disables the control. */
27
+ disabled?: UndComboboxElement['disabled'];
28
+ /** Requires a non-empty value. */
29
+ required?: UndComboboxElement['required'];
30
+ /** Whether the listbox is open. */
31
+ open?: UndComboboxElement['open'];
32
+ /** How typed text filters the options. `none` shows every option, for filtering on the server through `und-search`. */
33
+ filter?: UndComboboxElement['filter'];
34
+ /** Accept free text as the value instead of only listed options. */
35
+ allowCustomValue?: UndComboboxElement['allowCustomValue'];
36
+ /** Shows a loading state in the popup (sets `aria-busy` on the listbox). */
37
+ loading?: UndComboboxElement['loading'];
38
+ /** Delay in ms before `und-search` fires after typing (0 fires at once). */
39
+ debounce?: UndComboboxElement['debounce'];
40
+ /** Text shown (and announced) when no option matches. */
41
+ noResultsText?: UndComboboxElement['noResultsText'];
42
+ /** Text shown while `loading`. */
43
+ loadingText?: UndComboboxElement['loadingText'];
44
+ /** Options as data. When set, light-DOM options are ignored. */
45
+ options?: UndComboboxElement['options'];
46
+ /** The text currently in the input. */
47
+ inputValue?: UndComboboxElement['inputValue'];
48
+ /** Builds the polite announcement for the number of visible options. Override it to localise. */
49
+ resultsMessage?: UndComboboxElement['resultsMessage'];
50
+ /** The value was committed (option picked, or text committed on Enter or blur). */
51
+ onChange?: (event: UndEvent<Event, UndComboboxElement>) => void;
52
+ /** The text changed (native, from the input) or an option was picked. */
53
+ onInput?: (event: UndEvent<Event, UndComboboxElement>) => void;
54
+ /** The user typed; use it to load options asynchronously. */
55
+ onUndSearch?: (event: UndEvent<CustomEvent<unknown>, UndComboboxElement>) => void;
56
+ /** The listbox opened or closed. */
57
+ onUndOpenChange?: (event: UndEvent<CustomEvent<unknown>, UndComboboxElement>) => void;
58
+ ref?: Ref<UndComboboxElement>;
59
+ }
60
+
61
+ /** A text input with a filtered list of suggestions. */
62
+ export function UndCombobox(props: UndComboboxProps): ReactElement {
63
+ const { onChange, onInput, onUndSearch, onUndOpenChange, ref, ...rest } = props;
64
+ // Controlled when `value` is set: a change the handler rejects is undone.
65
+ const controlled = useControlledProp<UndComboboxElement, 'value'>('value', props.value, ref);
66
+ return createElement('und-combobox', {
67
+ ...rest,
68
+ ref: controlled.ref,
69
+ 'onchange': onChange,
70
+ 'oninput': (event: UndEvent<Event, UndComboboxElement>) => {
71
+ onInput?.(event);
72
+ controlled.settle();
73
+ },
74
+ 'onund-search': onUndSearch,
75
+ 'onund-open-change': onUndOpenChange,
76
+ });
77
+ }
@@ -0,0 +1,50 @@
1
+ 'use client';
2
+ // GENERATED FILE. DO NOT EDIT.
3
+ // Source: @und-ui/core custom-elements.json, via tools/codegen/wrappers.mjs.
4
+ // Run `pnpm codegen` (or `pnpm build`) after changing a component.
5
+ import { createElement, type HTMLAttributes, type ReactElement, type Ref } from 'react';
6
+ import '@und-ui/core/dialog.js';
7
+ import type { UndDialog as UndDialogElement } from '@und-ui/core';
8
+ import { type UndEvent } from './shared.js';
9
+
10
+ export interface UndDialogProps
11
+ extends Omit<HTMLAttributes<UndDialogElement>, 'open' | 'modal' | 'variant' | 'size' | 'closedBy' | 'label' | 'initialFocus' | 'closeLabel' | 'noCloseButton' | 'returnValue' | 'onUndOpenChange' | 'onUndAfterOpen' | 'onUndAfterClose'> {
12
+ /** Whether the dialog is open. Setting it opens or closes the dialog without firing `und-open-change`. */
13
+ open?: UndDialogElement['open'];
14
+ /** Modal (default): the page behind is inert and scrolling is locked. Set `modal="false"` for a non-modal dialog that leaves the page usable. */
15
+ modal?: UndDialogElement['modal'];
16
+ /** `alert` renders an alert dialog (`role="alertdialog"`) for confirmations: no close button, and the backdrop does not dismiss it. */
17
+ variant?: UndDialogElement['variant'];
18
+ /** Preferred width. */
19
+ size?: UndDialogElement['size'];
20
+ /** Which user actions close the dialog, as on the native attribute: `any` (Escape, backdrop click or outside click), `closerequest` (Escape only) or `none`. Defaults to `any`, or `closerequest` for `variant="alert"`. */
21
+ closedBy?: UndDialogElement['closedBy'];
22
+ /** The title, rendered as the heading that names the dialog. Use the `label` slot for rich content. */
23
+ label?: UndDialogElement['label'];
24
+ /** CSS selector (inside the dialog content) of the element to focus on open. Defaults to an `[autofocus]` element, then the first focusable element. */
25
+ initialFocus?: UndDialogElement['initialFocus'];
26
+ /** Accessible name of the close button. */
27
+ closeLabel?: UndDialogElement['closeLabel'];
28
+ /** Hides the close button. Make sure another way to close remains. */
29
+ noCloseButton?: UndDialogElement['noCloseButton'];
30
+ /** The value passed to `close(value)` or submitted by a `method="dialog"` form. */
31
+ returnValue?: UndDialogElement['returnValue'];
32
+ /** The user asked to open or close the dialog (Escape, backdrop, close button, invoker command, `method="dialog"` form). Cancelable: call `preventDefault()` to keep the current state. */
33
+ onUndOpenChange?: (event: UndEvent<CustomEvent<{ open: boolean; reason: string }>, UndDialogElement>) => void;
34
+ /** The dialog opened and its entry animation finished. */
35
+ onUndAfterOpen?: (event: UndEvent<CustomEvent<undefined>, UndDialogElement>) => void;
36
+ /** The dialog closed and its exit animation finished. */
37
+ onUndAfterClose?: (event: UndEvent<CustomEvent<undefined>, UndDialogElement>) => void;
38
+ ref?: Ref<UndDialogElement>;
39
+ }
40
+
41
+ /** A modal or non-modal dialog window. */
42
+ export function UndDialog(props: UndDialogProps): ReactElement {
43
+ const { onUndOpenChange, onUndAfterOpen, onUndAfterClose, ...rest } = props;
44
+ return createElement('und-dialog', {
45
+ ...rest,
46
+ 'onund-open-change': onUndOpenChange,
47
+ 'onund-after-open': onUndAfterOpen,
48
+ 'onund-after-close': onUndAfterClose,
49
+ });
50
+ }
@@ -0,0 +1,21 @@
1
+ 'use client';
2
+ // GENERATED FILE. DO NOT EDIT.
3
+ // Source: @und-ui/core custom-elements.json, via tools/codegen/wrappers.mjs.
4
+ // Run `pnpm codegen` (or `pnpm build`) after changing a component.
5
+ import { createElement, type HTMLAttributes, type ReactElement, type Ref } from 'react';
6
+ import '@und-ui/core/divider.js';
7
+ import type { UndDivider as UndDividerElement } from '@und-ui/core';
8
+
9
+ export interface UndDividerProps
10
+ extends Omit<HTMLAttributes<UndDividerElement>, 'orientation' | 'decorative'> {
11
+ /** Direction of the line. */
12
+ orientation?: UndDividerElement['orientation'];
13
+ /** Purely visual: hides the divider from assistive technology. */
14
+ decorative?: UndDividerElement['decorative'];
15
+ ref?: Ref<UndDividerElement>;
16
+ }
17
+
18
+ /** Separates content, optionally with a label. */
19
+ export function UndDivider(props: UndDividerProps): ReactElement {
20
+ return createElement('und-divider', props);
21
+ }
@@ -0,0 +1,52 @@
1
+ 'use client';
2
+ // GENERATED FILE. DO NOT EDIT.
3
+ // Source: @und-ui/core custom-elements.json, via tools/codegen/wrappers.mjs.
4
+ // Run `pnpm codegen` (or `pnpm build`) after changing a component.
5
+ import { createElement, type HTMLAttributes, type ReactElement, type Ref } from 'react';
6
+ import '@und-ui/core/drawer.js';
7
+ import type { UndDrawer as UndDrawerElement } from '@und-ui/core';
8
+ import { type UndEvent } from './shared.js';
9
+
10
+ export interface UndDrawerProps
11
+ extends Omit<HTMLAttributes<UndDrawerElement>, 'placement' | 'open' | 'modal' | 'variant' | 'size' | 'closedBy' | 'label' | 'initialFocus' | 'closeLabel' | 'noCloseButton' | 'returnValue' | 'onUndOpenChange' | 'onUndAfterOpen' | 'onUndAfterClose'> {
12
+ /** The edge the drawer is attached to. `start` and `end` follow the text direction. */
13
+ placement?: UndDrawerElement['placement'];
14
+ /** Whether the dialog is open. Setting it opens or closes the dialog without firing `und-open-change`. */
15
+ open?: UndDrawerElement['open'];
16
+ /** Modal (default): the page behind is inert and scrolling is locked. Set `modal="false"` for a non-modal dialog that leaves the page usable. */
17
+ modal?: UndDrawerElement['modal'];
18
+ /** `alert` renders an alert dialog (`role="alertdialog"`) for confirmations: no close button, and the backdrop does not dismiss it. */
19
+ variant?: UndDrawerElement['variant'];
20
+ /** Preferred width. */
21
+ size?: UndDrawerElement['size'];
22
+ /** Which user actions close the dialog, as on the native attribute: `any` (Escape, backdrop click or outside click), `closerequest` (Escape only) or `none`. Defaults to `any`, or `closerequest` for `variant="alert"`. */
23
+ closedBy?: UndDrawerElement['closedBy'];
24
+ /** The title, rendered as the heading that names the dialog. Use the `label` slot for rich content. */
25
+ label?: UndDrawerElement['label'];
26
+ /** CSS selector (inside the dialog content) of the element to focus on open. Defaults to an `[autofocus]` element, then the first focusable element. */
27
+ initialFocus?: UndDrawerElement['initialFocus'];
28
+ /** Accessible name of the close button. */
29
+ closeLabel?: UndDrawerElement['closeLabel'];
30
+ /** Hides the close button. Make sure another way to close remains. */
31
+ noCloseButton?: UndDrawerElement['noCloseButton'];
32
+ /** The value passed to `close(value)` or submitted by a `method="dialog"` form. */
33
+ returnValue?: UndDrawerElement['returnValue'];
34
+ /** The user asked to open or close the drawer. Cancelable. */
35
+ onUndOpenChange?: (event: UndEvent<CustomEvent<{ open: boolean; reason: string }>, UndDrawerElement>) => void;
36
+ /** The drawer opened and its entry animation finished. */
37
+ onUndAfterOpen?: (event: UndEvent<CustomEvent<undefined>, UndDrawerElement>) => void;
38
+ /** The drawer closed and its exit animation finished. */
39
+ onUndAfterClose?: (event: UndEvent<CustomEvent<undefined>, UndDrawerElement>) => void;
40
+ ref?: Ref<UndDrawerElement>;
41
+ }
42
+
43
+ /** A dialog that slides in from an edge of the screen. */
44
+ export function UndDrawer(props: UndDrawerProps): ReactElement {
45
+ const { onUndOpenChange, onUndAfterOpen, onUndAfterClose, ...rest } = props;
46
+ return createElement('und-drawer', {
47
+ ...rest,
48
+ 'onund-open-change': onUndOpenChange,
49
+ 'onund-after-open': onUndAfterOpen,
50
+ 'onund-after-close': onUndAfterClose,
51
+ });
52
+ }
@@ -0,0 +1,27 @@
1
+ 'use client';
2
+ // GENERATED FILE. DO NOT EDIT.
3
+ // Source: @und-ui/core custom-elements.json, via tools/codegen/wrappers.mjs.
4
+ // Run `pnpm codegen` (or `pnpm build`) after changing a component.
5
+ import { createElement, type HTMLAttributes, type ReactElement, type Ref } from 'react';
6
+ import '@und-ui/core/form-field.js';
7
+ import type { UndFormField as UndFormFieldElement } from '@und-ui/core';
8
+
9
+ export interface UndFormFieldProps
10
+ extends Omit<HTMLAttributes<UndFormFieldElement>, 'label' | 'description' | 'error' | 'required' | 'optional'> {
11
+ /** Visible label text. */
12
+ label?: UndFormFieldElement['label'];
13
+ /** Help text under the label, referenced by `aria-describedby`. */
14
+ description?: UndFormFieldElement['description'];
15
+ /** Error message. Marks the control invalid and shows the message, prefixed with a visually hidden "Error:". */
16
+ error?: UndFormFieldElement['error'];
17
+ /** Marks the control required (also sets `required` on a native control). */
18
+ required?: UndFormFieldElement['required'];
19
+ /** Shows an "(optional)" marker after the label. */
20
+ optional?: UndFormFieldElement['optional'];
21
+ ref?: Ref<UndFormFieldElement>;
22
+ }
23
+
24
+ /** Label, description and error wiring for any form control. */
25
+ export function UndFormField(props: UndFormFieldProps): ReactElement {
26
+ return createElement('und-form-field', props);
27
+ }