@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.
- package/LICENSE +21 -0
- package/README.md +35 -2
- package/dist/generated/index.d.ts +44 -0
- package/dist/generated/index.d.ts.map +1 -0
- package/dist/generated/index.js +45 -0
- package/dist/generated/index.js.map +1 -0
- package/dist/generated/jsx.d.ts +176 -0
- package/dist/generated/jsx.d.ts.map +1 -0
- package/dist/generated/jsx.js +2 -0
- package/dist/generated/jsx.js.map +1 -0
- package/dist/generated/shared.d.ts +20 -0
- package/dist/generated/shared.d.ts.map +1 -0
- package/dist/generated/shared.js +55 -0
- package/dist/generated/shared.js.map +1 -0
- package/dist/generated/und-accordion.d.ts +11 -0
- package/dist/generated/und-accordion.d.ts.map +1 -0
- package/dist/generated/und-accordion.js +11 -0
- package/dist/generated/und-accordion.js.map +1 -0
- package/dist/generated/und-alert.d.ts +20 -0
- package/dist/generated/und-alert.d.ts.map +1 -0
- package/dist/generated/und-alert.js +16 -0
- package/dist/generated/und-alert.js.map +1 -0
- package/dist/generated/und-avatar-group.d.ts +17 -0
- package/dist/generated/und-avatar-group.d.ts.map +1 -0
- package/dist/generated/und-avatar-group.js +11 -0
- package/dist/generated/und-avatar-group.js.map +1 -0
- package/dist/generated/und-avatar.d.ts +27 -0
- package/dist/generated/und-avatar.d.ts.map +1 -0
- package/dist/generated/und-avatar.js +11 -0
- package/dist/generated/und-avatar.js.map +1 -0
- package/dist/generated/und-badge.d.ts +17 -0
- package/dist/generated/und-badge.d.ts.map +1 -0
- package/dist/generated/und-badge.js +11 -0
- package/dist/generated/und-badge.js.map +1 -0
- package/dist/generated/und-breadcrumb-item.d.ts +13 -0
- package/dist/generated/und-breadcrumb-item.d.ts.map +1 -0
- package/dist/generated/und-breadcrumb-item.js +11 -0
- package/dist/generated/und-breadcrumb-item.js.map +1 -0
- package/dist/generated/und-breadcrumb.d.ts +11 -0
- package/dist/generated/und-breadcrumb.d.ts.map +1 -0
- package/dist/generated/und-breadcrumb.js +11 -0
- package/dist/generated/und-breadcrumb.js.map +1 -0
- package/dist/generated/und-button.d.ts +54 -0
- package/dist/generated/und-button.d.ts.map +1 -0
- package/dist/generated/und-button.js +16 -0
- package/dist/generated/und-button.js.map +1 -0
- package/dist/generated/und-card.d.ts +19 -0
- package/dist/generated/und-card.d.ts.map +1 -0
- package/dist/generated/und-card.js +11 -0
- package/dist/generated/und-card.js.map +1 -0
- package/dist/generated/und-checkbox.d.ts +36 -0
- package/dist/generated/und-checkbox.d.ts.map +1 -0
- package/dist/generated/und-checkbox.js +23 -0
- package/dist/generated/und-checkbox.js.map +1 -0
- package/dist/generated/und-combobox.d.ts +56 -0
- package/dist/generated/und-combobox.d.ts.map +1 -0
- package/dist/generated/und-combobox.js +25 -0
- package/dist/generated/und-combobox.js.map +1 -0
- package/dist/generated/und-dialog.d.ts +39 -0
- package/dist/generated/und-dialog.d.ts.map +1 -0
- package/dist/generated/und-dialog.js +18 -0
- package/dist/generated/und-dialog.js.map +1 -0
- package/dist/generated/und-divider.d.ts +13 -0
- package/dist/generated/und-divider.d.ts.map +1 -0
- package/dist/generated/und-divider.js +11 -0
- package/dist/generated/und-divider.js.map +1 -0
- package/dist/generated/und-drawer.d.ts +41 -0
- package/dist/generated/und-drawer.d.ts.map +1 -0
- package/dist/generated/und-drawer.js +18 -0
- package/dist/generated/und-drawer.js.map +1 -0
- package/dist/generated/und-form-field.d.ts +19 -0
- package/dist/generated/und-form-field.d.ts.map +1 -0
- package/dist/generated/und-form-field.js +11 -0
- package/dist/generated/und-form-field.js.map +1 -0
- package/dist/generated/und-icon-button.d.ts +54 -0
- package/dist/generated/und-icon-button.d.ts.map +1 -0
- package/dist/generated/und-icon-button.js +16 -0
- package/dist/generated/und-icon-button.js.map +1 -0
- package/dist/generated/und-link.d.ts +23 -0
- package/dist/generated/und-link.d.ts.map +1 -0
- package/dist/generated/und-link.js +11 -0
- package/dist/generated/und-link.js.map +1 -0
- package/dist/generated/und-menu-group.d.ts +11 -0
- package/dist/generated/und-menu-group.d.ts.map +1 -0
- package/dist/generated/und-menu-group.js +11 -0
- package/dist/generated/und-menu-group.js.map +1 -0
- package/dist/generated/und-menu-item.d.ts +21 -0
- package/dist/generated/und-menu-item.d.ts.map +1 -0
- package/dist/generated/und-menu-item.js +11 -0
- package/dist/generated/und-menu-item.js.map +1 -0
- package/dist/generated/und-menu-separator.d.ts +9 -0
- package/dist/generated/und-menu-separator.d.ts.map +1 -0
- package/dist/generated/und-menu-separator.js +11 -0
- package/dist/generated/und-menu-separator.js.map +1 -0
- package/dist/generated/und-menu.d.ts +25 -0
- package/dist/generated/und-menu.d.ts.map +1 -0
- package/dist/generated/und-menu.js +17 -0
- package/dist/generated/und-menu.js.map +1 -0
- package/dist/generated/und-pagination.d.ts +30 -0
- package/dist/generated/und-pagination.d.ts.map +1 -0
- package/dist/generated/und-pagination.js +16 -0
- package/dist/generated/und-pagination.js.map +1 -0
- package/dist/generated/und-popover.d.ts +31 -0
- package/dist/generated/und-popover.d.ts.map +1 -0
- package/dist/generated/und-popover.js +18 -0
- package/dist/generated/und-popover.js.map +1 -0
- package/dist/generated/und-progress.d.ts +23 -0
- package/dist/generated/und-progress.d.ts.map +1 -0
- package/dist/generated/und-progress.js +11 -0
- package/dist/generated/und-progress.js.map +1 -0
- package/dist/generated/und-radio-group.d.ts +32 -0
- package/dist/generated/und-radio-group.d.ts.map +1 -0
- package/dist/generated/und-radio-group.js +23 -0
- package/dist/generated/und-radio-group.js.map +1 -0
- package/dist/generated/und-radio.d.ts +19 -0
- package/dist/generated/und-radio.d.ts.map +1 -0
- package/dist/generated/und-radio.js +11 -0
- package/dist/generated/und-radio.js.map +1 -0
- package/dist/generated/und-select.d.ts +38 -0
- package/dist/generated/und-select.d.ts.map +1 -0
- package/dist/generated/und-select.js +24 -0
- package/dist/generated/und-select.js.map +1 -0
- package/dist/generated/und-skeleton.d.ts +13 -0
- package/dist/generated/und-skeleton.d.ts.map +1 -0
- package/dist/generated/und-skeleton.js +11 -0
- package/dist/generated/und-skeleton.js.map +1 -0
- package/dist/generated/und-slider.d.ts +50 -0
- package/dist/generated/und-slider.d.ts.map +1 -0
- package/dist/generated/und-slider.js +23 -0
- package/dist/generated/und-slider.js.map +1 -0
- package/dist/generated/und-spinner.d.ts +15 -0
- package/dist/generated/und-spinner.d.ts.map +1 -0
- package/dist/generated/und-spinner.js +11 -0
- package/dist/generated/und-spinner.js.map +1 -0
- package/dist/generated/und-switch.d.ts +34 -0
- package/dist/generated/und-switch.d.ts.map +1 -0
- package/dist/generated/und-switch.js +23 -0
- package/dist/generated/und-switch.js.map +1 -0
- package/dist/generated/und-tab-panel.d.ts +11 -0
- package/dist/generated/und-tab-panel.d.ts.map +1 -0
- package/dist/generated/und-tab-panel.js +11 -0
- package/dist/generated/und-tab-panel.js.map +1 -0
- package/dist/generated/und-tab.d.ts +15 -0
- package/dist/generated/und-tab.d.ts.map +1 -0
- package/dist/generated/und-tab.js +11 -0
- package/dist/generated/und-tab.js.map +1 -0
- package/dist/generated/und-table.d.ts +26 -0
- package/dist/generated/und-table.d.ts.map +1 -0
- package/dist/generated/und-table.js +16 -0
- package/dist/generated/und-table.js.map +1 -0
- package/dist/generated/und-tabs.d.ts +20 -0
- package/dist/generated/und-tabs.d.ts.map +1 -0
- package/dist/generated/und-tabs.js +16 -0
- package/dist/generated/und-tabs.js.map +1 -0
- package/dist/generated/und-text-field.d.ts +58 -0
- package/dist/generated/und-text-field.d.ts.map +1 -0
- package/dist/generated/und-text-field.js +23 -0
- package/dist/generated/und-text-field.js.map +1 -0
- package/dist/generated/und-textarea.d.ts +48 -0
- package/dist/generated/und-textarea.d.ts.map +1 -0
- package/dist/generated/und-textarea.js +23 -0
- package/dist/generated/und-textarea.js.map +1 -0
- package/dist/generated/und-toast.d.ts +26 -0
- package/dist/generated/und-toast.d.ts.map +1 -0
- package/dist/generated/und-toast.js +16 -0
- package/dist/generated/und-toast.js.map +1 -0
- package/dist/generated/und-toaster.d.ts +15 -0
- package/dist/generated/und-toaster.d.ts.map +1 -0
- package/dist/generated/und-toaster.js +11 -0
- package/dist/generated/und-toaster.js.map +1 -0
- package/dist/generated/und-tooltip.d.ts +29 -0
- package/dist/generated/und-tooltip.d.ts.map +1 -0
- package/dist/generated/und-tooltip.js +16 -0
- package/dist/generated/und-tooltip.js.map +1 -0
- package/dist/generated/und-visually-hidden.d.ts +11 -0
- package/dist/generated/und-visually-hidden.d.ts.map +1 -0
- package/dist/generated/und-visually-hidden.js +11 -0
- package/dist/generated/und-visually-hidden.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -0
- package/package.json +61 -3
- package/src/generated/index.ts +46 -0
- package/src/generated/jsx.ts +166 -0
- package/src/generated/shared.ts +67 -0
- package/src/generated/und-accordion.ts +19 -0
- package/src/generated/und-alert.ts +32 -0
- package/src/generated/und-avatar-group.ts +25 -0
- package/src/generated/und-avatar.ts +35 -0
- package/src/generated/und-badge.ts +25 -0
- package/src/generated/und-breadcrumb-item.ts +21 -0
- package/src/generated/und-breadcrumb.ts +19 -0
- package/src/generated/und-button.ts +64 -0
- package/src/generated/und-card.ts +27 -0
- package/src/generated/und-checkbox.ts +55 -0
- package/src/generated/und-combobox.ts +77 -0
- package/src/generated/und-dialog.ts +50 -0
- package/src/generated/und-divider.ts +21 -0
- package/src/generated/und-drawer.ts +52 -0
- package/src/generated/und-form-field.ts +27 -0
- package/src/generated/und-icon-button.ts +64 -0
- package/src/generated/und-link.ts +31 -0
- package/src/generated/und-menu-group.ts +19 -0
- package/src/generated/und-menu-item.ts +29 -0
- package/src/generated/und-menu-separator.ts +17 -0
- package/src/generated/und-menu.ts +33 -0
- package/src/generated/und-pagination.ts +42 -0
- package/src/generated/und-popover.ts +42 -0
- package/src/generated/und-progress.ts +31 -0
- package/src/generated/und-radio-group.ts +51 -0
- package/src/generated/und-radio.ts +27 -0
- package/src/generated/und-select.ts +58 -0
- package/src/generated/und-skeleton.ts +21 -0
- package/src/generated/und-slider.ts +69 -0
- package/src/generated/und-spinner.ts +23 -0
- package/src/generated/und-switch.ts +53 -0
- package/src/generated/und-tab-panel.ts +19 -0
- package/src/generated/und-tab.ts +23 -0
- package/src/generated/und-table.ts +38 -0
- package/src/generated/und-tabs.ts +32 -0
- package/src/generated/und-text-field.ts +77 -0
- package/src/generated/und-textarea.ts +67 -0
- package/src/generated/und-toast.ts +36 -0
- package/src/generated/und-toaster.ts +23 -0
- package/src/generated/und-tooltip.ts +38 -0
- package/src/generated/und-visually-hidden.ts +19 -0
- package/src/index.ts +1 -0
|
@@ -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/tab-panel.js';
|
|
7
|
+
import type { UndTabPanel as UndTabPanelElement } from '@und-ui/core';
|
|
8
|
+
|
|
9
|
+
export interface UndTabPanelProps
|
|
10
|
+
extends Omit<HTMLAttributes<UndTabPanelElement>, 'value'> {
|
|
11
|
+
/** Matches the `value` of the tab that controls this panel. Defaults to the panel's position. */
|
|
12
|
+
value?: UndTabPanelElement['value'];
|
|
13
|
+
ref?: Ref<UndTabPanelElement>;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/** The content of a tab. */
|
|
17
|
+
export function UndTabPanel(props: UndTabPanelProps): ReactElement {
|
|
18
|
+
return createElement('und-tab-panel', props);
|
|
19
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
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/tab.js';
|
|
7
|
+
import type { UndTab as UndTabElement } from '@und-ui/core';
|
|
8
|
+
|
|
9
|
+
export interface UndTabProps
|
|
10
|
+
extends Omit<HTMLAttributes<UndTabElement>, 'value' | 'disabled' | 'selected'> {
|
|
11
|
+
/** Identifies the tab and its panel (the `und-tab-panel` with the same value). Defaults to the tab's position. */
|
|
12
|
+
value?: UndTabElement['value'];
|
|
13
|
+
/** Disables the tab. Arrow keys skip it and it cannot be selected. */
|
|
14
|
+
disabled?: UndTabElement['disabled'];
|
|
15
|
+
/** Whether the tab is selected. Managed by `und-tabs`; set `value` on the parent instead. */
|
|
16
|
+
selected?: UndTabElement['selected'];
|
|
17
|
+
ref?: Ref<UndTabElement>;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/** A tab in a tab list. */
|
|
21
|
+
export function UndTab(props: UndTabProps): ReactElement {
|
|
22
|
+
return createElement('und-tab', props);
|
|
23
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
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/table.js';
|
|
7
|
+
import type { UndTable as UndTableElement } from '@und-ui/core';
|
|
8
|
+
import { type UndEvent } from './shared.js';
|
|
9
|
+
|
|
10
|
+
export interface UndTableProps
|
|
11
|
+
extends Omit<HTMLAttributes<UndTableElement>, 'label' | 'density' | 'striped' | 'stickyHeader' | 'sortMessage' | 'ascendingLabel' | 'descendingLabel' | 'onUndSort'> {
|
|
12
|
+
/** Accessible name of the scroll region. Defaults to the caption text. */
|
|
13
|
+
label?: UndTableElement['label'];
|
|
14
|
+
/** Cell spacing. */
|
|
15
|
+
density?: UndTableElement['density'];
|
|
16
|
+
/** Shades every other body row. */
|
|
17
|
+
striped?: UndTableElement['striped'];
|
|
18
|
+
/** Keeps the header row visible while the region scrolls vertically. Set a maximum height with `--und-table-max-height`. */
|
|
19
|
+
stickyHeader?: UndTableElement['stickyHeader'];
|
|
20
|
+
/** Announcement after sorting; `{column}` and `{direction}` are replaced. */
|
|
21
|
+
sortMessage?: UndTableElement['sortMessage'];
|
|
22
|
+
/** Word used for `{direction}` when sorting ascending. */
|
|
23
|
+
ascendingLabel?: UndTableElement['ascendingLabel'];
|
|
24
|
+
/** Word used for `{direction}` when sorting descending. */
|
|
25
|
+
descendingLabel?: UndTableElement['descendingLabel'];
|
|
26
|
+
/** A sortable header was activated. Cancel it to sort the data yourself; `aria-sort` and the announcement still update. */
|
|
27
|
+
onUndSort?: (event: UndEvent<CustomEvent<unknown>, UndTableElement>) => void;
|
|
28
|
+
ref?: Ref<UndTableElement>;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/** A styled native table with responsive overflow and sortable headers. */
|
|
32
|
+
export function UndTable(props: UndTableProps): ReactElement {
|
|
33
|
+
const { onUndSort, ...rest } = props;
|
|
34
|
+
return createElement('und-table', {
|
|
35
|
+
...rest,
|
|
36
|
+
'onund-sort': onUndSort,
|
|
37
|
+
});
|
|
38
|
+
}
|
|
@@ -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/tabs.js';
|
|
7
|
+
import type { UndTabs as UndTabsElement } from '@und-ui/core';
|
|
8
|
+
import { type UndEvent } from './shared.js';
|
|
9
|
+
|
|
10
|
+
export interface UndTabsProps
|
|
11
|
+
extends Omit<HTMLAttributes<UndTabsElement>, 'value' | 'orientation' | 'activation' | 'label' | 'onUndChange'> {
|
|
12
|
+
/** Value of the selected tab (its `value`, or its position). Defaults to the first enabled tab. */
|
|
13
|
+
value?: UndTabsElement['value'];
|
|
14
|
+
/** Layout and arrow-key axis of the tab list. */
|
|
15
|
+
orientation?: UndTabsElement['orientation'];
|
|
16
|
+
/** `automatic` selects a tab when it receives focus; `manual` waits for Enter or Space. */
|
|
17
|
+
activation?: UndTabsElement['activation'];
|
|
18
|
+
/** Accessible name of the tab list. */
|
|
19
|
+
label?: UndTabsElement['label'];
|
|
20
|
+
/** The user selected another tab. */
|
|
21
|
+
onUndChange?: (event: UndEvent<CustomEvent<unknown>, UndTabsElement>) => void;
|
|
22
|
+
ref?: Ref<UndTabsElement>;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/** Switches between panels of related content. */
|
|
26
|
+
export function UndTabs(props: UndTabsProps): ReactElement {
|
|
27
|
+
const { onUndChange, ...rest } = props;
|
|
28
|
+
return createElement('und-tabs', {
|
|
29
|
+
...rest,
|
|
30
|
+
'onund-change': onUndChange,
|
|
31
|
+
});
|
|
32
|
+
}
|
|
@@ -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/text-field.js';
|
|
7
|
+
import type { UndTextField as UndTextFieldElement } from '@und-ui/core';
|
|
8
|
+
import { useControlledProp, type UndEvent } from './shared.js';
|
|
9
|
+
|
|
10
|
+
export interface UndTextFieldProps
|
|
11
|
+
extends Omit<HTMLAttributes<UndTextFieldElement>, 'type' | 'value' | 'defaultValue' | 'size' | 'readOnly' | 'placeholder' | 'autocomplete' | 'inputMode' | 'enterKeyHint' | 'minLength' | 'maxLength' | 'pattern' | 'min' | 'max' | 'step' | 'label' | 'description' | 'error' | 'required' | 'optional' | 'disabled' | 'name' | 'onInput' | 'onChange'> {
|
|
12
|
+
/** Input type. */
|
|
13
|
+
type?: UndTextFieldElement['type'];
|
|
14
|
+
/** Current value. The `value` attribute also sets the default value that a form reset restores, as on a native input. */
|
|
15
|
+
value?: UndTextFieldElement['value'];
|
|
16
|
+
/** Value restored on form reset (defaults to the initial `value`). */
|
|
17
|
+
defaultValue?: UndTextFieldElement['defaultValue'];
|
|
18
|
+
/** Size of the field. */
|
|
19
|
+
size?: UndTextFieldElement['size'];
|
|
20
|
+
/** Makes the value read-only (still focusable and submitted). */
|
|
21
|
+
readOnly?: UndTextFieldElement['readOnly'];
|
|
22
|
+
/** Placeholder hint. Never a substitute for a label. */
|
|
23
|
+
placeholder?: UndTextFieldElement['placeholder'];
|
|
24
|
+
/** Autofill hint, passed through (WCAG 1.3.5), for example `email` or `name`. */
|
|
25
|
+
autocomplete?: UndTextFieldElement['autocomplete'];
|
|
26
|
+
/** Virtual keyboard hint (`numeric`, `decimal`, `tel`, `email`, ...). */
|
|
27
|
+
inputMode?: UndTextFieldElement['inputMode'];
|
|
28
|
+
/** Label of the virtual keyboard's Enter key (`search`, `next`, `send`, ...). */
|
|
29
|
+
enterKeyHint?: UndTextFieldElement['enterKeyHint'];
|
|
30
|
+
/** Minimum length (native validation). */
|
|
31
|
+
minLength?: UndTextFieldElement['minLength'];
|
|
32
|
+
/** Maximum length (native, counted in UTF-16 code units). */
|
|
33
|
+
maxLength?: UndTextFieldElement['maxLength'];
|
|
34
|
+
/** Pattern the value must match (native validation). */
|
|
35
|
+
pattern?: UndTextFieldElement['pattern'];
|
|
36
|
+
/** Minimum for `type="number"`. */
|
|
37
|
+
min?: UndTextFieldElement['min'];
|
|
38
|
+
/** Maximum for `type="number"`. */
|
|
39
|
+
max?: UndTextFieldElement['max'];
|
|
40
|
+
/** Step for `type="number"`. */
|
|
41
|
+
step?: UndTextFieldElement['step'];
|
|
42
|
+
/** Visible label text. Rich content (links) can be passed as children instead on choice controls. */
|
|
43
|
+
label?: UndTextFieldElement['label'];
|
|
44
|
+
/** Help text under the label, referenced by `aria-describedby`. */
|
|
45
|
+
description?: UndTextFieldElement['description'];
|
|
46
|
+
/** 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. */
|
|
47
|
+
error?: UndTextFieldElement['error'];
|
|
48
|
+
/** Requires a value before the form submits (native constraint validation). */
|
|
49
|
+
required?: UndTextFieldElement['required'];
|
|
50
|
+
/** Shows an "(optional)" marker after the label (GOV.UK style). Ignored when `required` is set. */
|
|
51
|
+
optional?: UndTextFieldElement['optional'];
|
|
52
|
+
/** Disables the control. A disabled ancestor `<fieldset>` also disables it. */
|
|
53
|
+
disabled?: UndTextFieldElement['disabled'];
|
|
54
|
+
/** Name submitted with the form data. */
|
|
55
|
+
name?: UndTextFieldElement['name'];
|
|
56
|
+
/** Native `input` from the inner `<input>`, bubbling through the host. `event.isComposing` is true during IME composition. */
|
|
57
|
+
onInput?: (event: UndEvent<InputEvent, UndTextFieldElement>) => void;
|
|
58
|
+
/** Native `change`: fires when the value is committed, never in the middle of IME composition. */
|
|
59
|
+
onChange?: (event: UndEvent<Event, UndTextFieldElement>) => void;
|
|
60
|
+
ref?: Ref<UndTextFieldElement>;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/** A labelled single-line text input with description and error. */
|
|
64
|
+
export function UndTextField(props: UndTextFieldProps): ReactElement {
|
|
65
|
+
const { onInput, onChange, ref, ...rest } = props;
|
|
66
|
+
// Controlled when `value` is set: a change the handler rejects is undone.
|
|
67
|
+
const controlled = useControlledProp<UndTextFieldElement, 'value'>('value', props.value, ref);
|
|
68
|
+
return createElement('und-text-field', {
|
|
69
|
+
...rest,
|
|
70
|
+
ref: controlled.ref,
|
|
71
|
+
'oninput': (event: UndEvent<InputEvent, UndTextFieldElement>) => {
|
|
72
|
+
onInput?.(event);
|
|
73
|
+
controlled.settle();
|
|
74
|
+
},
|
|
75
|
+
'onchange': onChange,
|
|
76
|
+
});
|
|
77
|
+
}
|
|
@@ -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 { createElement, type HTMLAttributes, type ReactElement, type Ref } from 'react';
|
|
6
|
+
import '@und-ui/core/textarea.js';
|
|
7
|
+
import type { UndTextarea as UndTextareaElement } from '@und-ui/core';
|
|
8
|
+
import { useControlledProp, type UndEvent } from './shared.js';
|
|
9
|
+
|
|
10
|
+
export interface UndTextareaProps
|
|
11
|
+
extends Omit<HTMLAttributes<UndTextareaElement>, 'value' | 'defaultValue' | 'rows' | 'autoResize' | 'resize' | 'readOnly' | 'placeholder' | 'autocomplete' | 'minLength' | 'maxLength' | 'label' | 'description' | 'error' | 'required' | 'optional' | 'disabled' | 'name' | 'onInput' | 'onChange'> {
|
|
12
|
+
/** Current value. The initial value is also the default restored by a form reset, as on a native textarea. */
|
|
13
|
+
value?: UndTextareaElement['value'];
|
|
14
|
+
/** Value restored on form reset (defaults to the initial `value`). */
|
|
15
|
+
defaultValue?: UndTextareaElement['defaultValue'];
|
|
16
|
+
/** Visible rows (the minimum while auto-resizing). */
|
|
17
|
+
rows?: UndTextareaElement['rows'];
|
|
18
|
+
/** Grows the field with its content (up to `--und-textarea-max-height`). */
|
|
19
|
+
autoResize?: UndTextareaElement['autoResize'];
|
|
20
|
+
/** Which directions the user can resize the field in. */
|
|
21
|
+
resize?: UndTextareaElement['resize'];
|
|
22
|
+
/** Makes the value read-only (still focusable and submitted). */
|
|
23
|
+
readOnly?: UndTextareaElement['readOnly'];
|
|
24
|
+
/** Placeholder hint. Never a substitute for a label. */
|
|
25
|
+
placeholder?: UndTextareaElement['placeholder'];
|
|
26
|
+
/** Autofill hint, passed through (WCAG 1.3.5). */
|
|
27
|
+
autocomplete?: UndTextareaElement['autocomplete'];
|
|
28
|
+
/** Minimum length (native validation). */
|
|
29
|
+
minLength?: UndTextareaElement['minLength'];
|
|
30
|
+
/** Maximum length (native, counted in UTF-16 code units). */
|
|
31
|
+
maxLength?: UndTextareaElement['maxLength'];
|
|
32
|
+
/** Visible label text. Rich content (links) can be passed as children instead on choice controls. */
|
|
33
|
+
label?: UndTextareaElement['label'];
|
|
34
|
+
/** Help text under the label, referenced by `aria-describedby`. */
|
|
35
|
+
description?: UndTextareaElement['description'];
|
|
36
|
+
/** 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. */
|
|
37
|
+
error?: UndTextareaElement['error'];
|
|
38
|
+
/** Requires a value before the form submits (native constraint validation). */
|
|
39
|
+
required?: UndTextareaElement['required'];
|
|
40
|
+
/** Shows an "(optional)" marker after the label (GOV.UK style). Ignored when `required` is set. */
|
|
41
|
+
optional?: UndTextareaElement['optional'];
|
|
42
|
+
/** Disables the control. A disabled ancestor `<fieldset>` also disables it. */
|
|
43
|
+
disabled?: UndTextareaElement['disabled'];
|
|
44
|
+
/** Name submitted with the form data. */
|
|
45
|
+
name?: UndTextareaElement['name'];
|
|
46
|
+
/** Native `input` from the inner `<textarea>`. `event.isComposing` is true during IME composition. */
|
|
47
|
+
onInput?: (event: UndEvent<InputEvent, UndTextareaElement>) => void;
|
|
48
|
+
/** Native `change`: fires when the value is committed, never in the middle of IME composition. */
|
|
49
|
+
onChange?: (event: UndEvent<Event, UndTextareaElement>) => void;
|
|
50
|
+
ref?: Ref<UndTextareaElement>;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/** A labelled multi-line text input that can grow with its content. */
|
|
54
|
+
export function UndTextarea(props: UndTextareaProps): ReactElement {
|
|
55
|
+
const { onInput, onChange, ref, ...rest } = props;
|
|
56
|
+
// Controlled when `value` is set: a change the handler rejects is undone.
|
|
57
|
+
const controlled = useControlledProp<UndTextareaElement, 'value'>('value', props.value, ref);
|
|
58
|
+
return createElement('und-textarea', {
|
|
59
|
+
...rest,
|
|
60
|
+
ref: controlled.ref,
|
|
61
|
+
'oninput': (event: UndEvent<InputEvent, UndTextareaElement>) => {
|
|
62
|
+
onInput?.(event);
|
|
63
|
+
controlled.settle();
|
|
64
|
+
},
|
|
65
|
+
'onchange': onChange,
|
|
66
|
+
});
|
|
67
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
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/toast.js';
|
|
7
|
+
import type { UndToast as UndToastElement } from '@und-ui/core';
|
|
8
|
+
import { type UndEvent } from './shared.js';
|
|
9
|
+
|
|
10
|
+
export interface UndToastProps
|
|
11
|
+
extends Omit<HTMLAttributes<UndToastElement>, 'label' | 'tone' | 'duration' | 'priority' | 'dismissible' | 'closeLabel' | 'onUndDismiss'> {
|
|
12
|
+
/** The title. */
|
|
13
|
+
label?: UndToastElement['label'];
|
|
14
|
+
/** Color intent. */
|
|
15
|
+
tone?: UndToastElement['tone'];
|
|
16
|
+
/** Time in ms before the toast dismisses itself; `0` keeps it until closed. Defaults to 5000, or 0 when the toast has an action. */
|
|
17
|
+
duration?: UndToastElement['duration'];
|
|
18
|
+
/** `assertive` interrupts the screen reader; reserve it for errors. */
|
|
19
|
+
priority?: UndToastElement['priority'];
|
|
20
|
+
/** Shows the close button (default). Set `dismissible="false"` to hide it; Escape and swipe still work. */
|
|
21
|
+
dismissible?: UndToastElement['dismissible'];
|
|
22
|
+
/** Accessible name of the close button. */
|
|
23
|
+
closeLabel?: UndToastElement['closeLabel'];
|
|
24
|
+
/** The toast is closing (`timeout`, `close-button`, `escape`, `swipe` or `programmatic`). It is removed after its exit animation. */
|
|
25
|
+
onUndDismiss?: (event: UndEvent<CustomEvent<{ reason: string }>, UndToastElement>) => void;
|
|
26
|
+
ref?: Ref<UndToastElement>;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/** A brief notification. */
|
|
30
|
+
export function UndToast(props: UndToastProps): ReactElement {
|
|
31
|
+
const { onUndDismiss, ...rest } = props;
|
|
32
|
+
return createElement('und-toast', {
|
|
33
|
+
...rest,
|
|
34
|
+
'onund-dismiss': onUndDismiss,
|
|
35
|
+
});
|
|
36
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
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/toaster.js';
|
|
7
|
+
import type { UndToaster as UndToasterElement } from '@und-ui/core';
|
|
8
|
+
|
|
9
|
+
export interface UndToasterProps
|
|
10
|
+
extends Omit<HTMLAttributes<UndToasterElement>, 'placement' | 'label' | 'hotkey'> {
|
|
11
|
+
/** Corner or edge of the viewport where toasts appear. */
|
|
12
|
+
placement?: UndToasterElement['placement'];
|
|
13
|
+
/** Accessible name of the region. */
|
|
14
|
+
label?: UndToasterElement['label'];
|
|
15
|
+
/** Key (with optional `Alt+`, `Ctrl+`, `Shift+`, `Meta+`) that moves focus to the newest toast. Set it to an empty string to turn it off. */
|
|
16
|
+
hotkey?: UndToasterElement['hotkey'];
|
|
17
|
+
ref?: Ref<UndToasterElement>;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/** The region that shows toast notifications. */
|
|
21
|
+
export function UndToaster(props: UndToasterProps): ReactElement {
|
|
22
|
+
return createElement('und-toaster', props);
|
|
23
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
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/tooltip.js';
|
|
7
|
+
import type { UndTooltip as UndTooltipElement } from '@und-ui/core';
|
|
8
|
+
import { type UndEvent } from './shared.js';
|
|
9
|
+
|
|
10
|
+
export interface UndTooltipProps
|
|
11
|
+
extends Omit<HTMLAttributes<UndTooltipElement>, 'open' | 'htmlFor' | 'placement' | 'offset' | 'openDelay' | 'closeDelay' | 'disabled' | 'onUndOpenChange'> {
|
|
12
|
+
/** Whether the tooltip is visible. Set it to show or hide the tooltip from code. */
|
|
13
|
+
open?: UndTooltipElement['open'];
|
|
14
|
+
/** Id of the trigger element, in the same tree as the tooltip. Defaults to the previous sibling element. */
|
|
15
|
+
htmlFor?: UndTooltipElement['htmlFor'];
|
|
16
|
+
/** Preferred side; flips when there is not enough room. */
|
|
17
|
+
placement?: UndTooltipElement['placement'];
|
|
18
|
+
/** Gap between the trigger and the tooltip, in pixels. */
|
|
19
|
+
offset?: UndTooltipElement['offset'];
|
|
20
|
+
/** Hover delay before showing, in ms. Keyboard focus shows it immediately. */
|
|
21
|
+
openDelay?: UndTooltipElement['openDelay'];
|
|
22
|
+
/** Delay before hiding after the pointer leaves, in ms, so the pointer can reach the tooltip. */
|
|
23
|
+
closeDelay?: UndTooltipElement['closeDelay'];
|
|
24
|
+
/** Stops the tooltip from showing. */
|
|
25
|
+
disabled?: UndTooltipElement['disabled'];
|
|
26
|
+
/** The tooltip was shown or hidden. */
|
|
27
|
+
onUndOpenChange?: (event: UndEvent<CustomEvent<{ open: boolean; reason: string }>, UndTooltipElement>) => void;
|
|
28
|
+
ref?: Ref<UndTooltipElement>;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/** A text hint shown on hover and keyboard focus. */
|
|
32
|
+
export function UndTooltip(props: UndTooltipProps): ReactElement {
|
|
33
|
+
const { onUndOpenChange, ...rest } = props;
|
|
34
|
+
return createElement('und-tooltip', {
|
|
35
|
+
...rest,
|
|
36
|
+
'onund-open-change': onUndOpenChange,
|
|
37
|
+
});
|
|
38
|
+
}
|
|
@@ -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/visually-hidden.js';
|
|
7
|
+
import type { UndVisuallyHidden as UndVisuallyHiddenElement } from '@und-ui/core';
|
|
8
|
+
|
|
9
|
+
export interface UndVisuallyHiddenProps
|
|
10
|
+
extends Omit<HTMLAttributes<UndVisuallyHiddenElement>, 'focusable'> {
|
|
11
|
+
/** Show the content while something inside it has focus (skip links). */
|
|
12
|
+
focusable?: UndVisuallyHiddenElement['focusable'];
|
|
13
|
+
ref?: Ref<UndVisuallyHiddenElement>;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/** Screen-reader-only content. */
|
|
17
|
+
export function UndVisuallyHidden(props: UndVisuallyHiddenProps): ReactElement {
|
|
18
|
+
return createElement('und-visually-hidden', props);
|
|
19
|
+
}
|
package/src/index.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './generated/index.js';
|