@und-ui/react 0.2.0 → 0.3.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/README.md +31 -2
- package/dist/charts.d.ts +6 -0
- package/dist/charts.d.ts.map +1 -0
- package/dist/charts.js +6 -0
- package/dist/charts.js.map +1 -0
- package/dist/generated/charts/index.d.ts +4 -0
- package/dist/generated/charts/index.d.ts.map +1 -0
- package/dist/generated/charts/index.js +5 -0
- package/dist/generated/charts/index.js.map +1 -0
- package/dist/generated/charts/jsx.d.ts +24 -0
- package/dist/generated/charts/jsx.d.ts.map +1 -0
- package/dist/generated/charts/jsx.js +2 -0
- package/dist/generated/charts/jsx.js.map +1 -0
- package/dist/generated/charts/und-chart.d.ts +37 -0
- package/dist/generated/charts/und-chart.d.ts.map +1 -0
- package/dist/generated/charts/und-chart.js +17 -0
- package/dist/generated/charts/und-chart.js.map +1 -0
- package/dist/generated/index.d.ts +12 -0
- package/dist/generated/index.d.ts.map +1 -1
- package/dist/generated/index.js +12 -0
- package/dist/generated/index.js.map +1 -1
- package/dist/generated/jsx.d.ts +75 -7
- package/dist/generated/jsx.d.ts.map +1 -1
- package/dist/generated/richtext/index.d.ts +4 -0
- package/dist/generated/richtext/index.d.ts.map +1 -0
- package/dist/generated/richtext/index.js +5 -0
- package/dist/generated/richtext/index.js.map +1 -0
- package/dist/generated/richtext/jsx.d.ts +14 -0
- package/dist/generated/richtext/jsx.d.ts.map +1 -0
- package/dist/generated/richtext/jsx.js +2 -0
- package/dist/generated/richtext/jsx.js.map +1 -0
- package/dist/generated/richtext/und-rich-text-editor.d.ts +32 -0
- package/dist/generated/richtext/und-rich-text-editor.d.ts.map +1 -0
- package/dist/generated/richtext/und-rich-text-editor.js +23 -0
- package/dist/generated/richtext/und-rich-text-editor.js.map +1 -0
- package/dist/generated/und-aspect-ratio.d.ts +4 -2
- package/dist/generated/und-aspect-ratio.d.ts.map +1 -1
- package/dist/generated/und-aspect-ratio.js.map +1 -1
- package/dist/generated/und-avatar-group.d.ts +4 -2
- package/dist/generated/und-avatar-group.d.ts.map +1 -1
- package/dist/generated/und-avatar-group.js.map +1 -1
- package/dist/generated/und-avatar.d.ts +3 -3
- package/dist/generated/und-avatar.d.ts.map +1 -1
- package/dist/generated/und-badge.d.ts +3 -1
- package/dist/generated/und-badge.d.ts.map +1 -1
- package/dist/generated/und-badge.js.map +1 -1
- package/dist/generated/und-banner.d.ts +7 -1
- package/dist/generated/und-banner.d.ts.map +1 -1
- package/dist/generated/und-banner.js.map +1 -1
- package/dist/generated/und-bottom-sheet.d.ts +4 -2
- package/dist/generated/und-bottom-sheet.d.ts.map +1 -1
- package/dist/generated/und-bottom-sheet.js.map +1 -1
- package/dist/generated/und-breadcrumb.d.ts +3 -1
- package/dist/generated/und-breadcrumb.d.ts.map +1 -1
- package/dist/generated/und-breadcrumb.js.map +1 -1
- package/dist/generated/und-card.d.ts +4 -2
- package/dist/generated/und-card.d.ts.map +1 -1
- package/dist/generated/und-card.js.map +1 -1
- package/dist/generated/und-carousel.d.ts +9 -1
- package/dist/generated/und-carousel.d.ts.map +1 -1
- package/dist/generated/und-carousel.js.map +1 -1
- package/dist/generated/und-center.d.ts +19 -1
- package/dist/generated/und-center.d.ts.map +1 -1
- package/dist/generated/und-center.js.map +1 -1
- package/dist/generated/und-chat-composer.d.ts +13 -1
- package/dist/generated/und-chat-composer.d.ts.map +1 -1
- package/dist/generated/und-chat-composer.js +2 -1
- package/dist/generated/und-chat-composer.js.map +1 -1
- package/dist/generated/und-chat-layout.d.ts +5 -1
- package/dist/generated/und-chat-layout.d.ts.map +1 -1
- package/dist/generated/und-chat-layout.js.map +1 -1
- package/dist/generated/und-chat-message.d.ts +11 -5
- package/dist/generated/und-chat-message.d.ts.map +1 -1
- package/dist/generated/und-chat-message.js.map +1 -1
- package/dist/generated/und-checkbox.d.ts +11 -1
- package/dist/generated/und-checkbox.d.ts.map +1 -1
- package/dist/generated/und-checkbox.js.map +1 -1
- package/dist/generated/und-citation.d.ts +5 -1
- package/dist/generated/und-citation.d.ts.map +1 -1
- package/dist/generated/und-citation.js.map +1 -1
- package/dist/generated/und-clickable-card.d.ts +4 -2
- package/dist/generated/und-clickable-card.d.ts.map +1 -1
- package/dist/generated/und-clickable-card.js.map +1 -1
- package/dist/generated/und-code-block.d.ts +11 -1
- package/dist/generated/und-code-block.d.ts.map +1 -1
- package/dist/generated/und-code-block.js.map +1 -1
- package/dist/generated/und-code.d.ts +5 -1
- package/dist/generated/und-code.d.ts.map +1 -1
- package/dist/generated/und-code.js.map +1 -1
- package/dist/generated/und-command-palette.d.ts +4 -2
- package/dist/generated/und-command-palette.d.ts.map +1 -1
- package/dist/generated/und-command-palette.js.map +1 -1
- package/dist/generated/und-date-input.d.ts +11 -1
- package/dist/generated/und-date-input.d.ts.map +1 -1
- package/dist/generated/und-date-input.js.map +1 -1
- package/dist/generated/und-date-range-input.d.ts +11 -1
- package/dist/generated/und-date-range-input.d.ts.map +1 -1
- package/dist/generated/und-date-range-input.js.map +1 -1
- package/dist/generated/und-dialog.d.ts +4 -2
- package/dist/generated/und-dialog.d.ts.map +1 -1
- package/dist/generated/und-dialog.js.map +1 -1
- package/dist/generated/und-divider.d.ts +5 -1
- package/dist/generated/und-divider.d.ts.map +1 -1
- package/dist/generated/und-divider.js.map +1 -1
- package/dist/generated/und-drawer.d.ts +4 -2
- package/dist/generated/und-drawer.d.ts.map +1 -1
- package/dist/generated/und-drawer.js.map +1 -1
- package/dist/generated/und-empty-state.d.ts +3 -1
- package/dist/generated/und-empty-state.d.ts.map +1 -1
- package/dist/generated/und-empty-state.js.map +1 -1
- package/dist/generated/und-file-input.d.ts +11 -1
- package/dist/generated/und-file-input.d.ts.map +1 -1
- package/dist/generated/und-file-input.js.map +1 -1
- package/dist/generated/und-form-field.d.ts +9 -1
- package/dist/generated/und-form-field.d.ts.map +1 -1
- package/dist/generated/und-form-field.js.map +1 -1
- package/dist/generated/und-form-layout.d.ts +3 -1
- package/dist/generated/und-form-layout.d.ts.map +1 -1
- package/dist/generated/und-form-layout.js.map +1 -1
- package/dist/generated/und-grid.d.ts +15 -3
- package/dist/generated/und-grid.d.ts.map +1 -1
- package/dist/generated/und-grid.js.map +1 -1
- package/dist/generated/und-heading.d.ts +14 -2
- package/dist/generated/und-heading.d.ts.map +1 -1
- package/dist/generated/und-heading.js.map +1 -1
- package/dist/generated/und-hover-card.d.ts +3 -1
- package/dist/generated/und-hover-card.d.ts.map +1 -1
- package/dist/generated/und-hover-card.js.map +1 -1
- package/dist/generated/und-icon.d.ts +6 -2
- package/dist/generated/und-icon.d.ts.map +1 -1
- package/dist/generated/und-icon.js.map +1 -1
- package/dist/generated/und-indicator.d.ts +17 -0
- package/dist/generated/und-indicator.d.ts.map +1 -0
- package/dist/generated/und-indicator.js +11 -0
- package/dist/generated/und-indicator.js.map +1 -0
- package/dist/generated/und-info-tip.d.ts +3 -1
- package/dist/generated/und-info-tip.d.ts.map +1 -1
- package/dist/generated/und-info-tip.js.map +1 -1
- package/dist/generated/und-input-group.d.ts +17 -1
- package/dist/generated/und-input-group.d.ts.map +1 -1
- package/dist/generated/und-input-group.js +2 -1
- package/dist/generated/und-input-group.js.map +1 -1
- package/dist/generated/und-item.d.ts +33 -0
- package/dist/generated/und-item.d.ts.map +1 -0
- package/dist/generated/und-item.js +11 -0
- package/dist/generated/und-item.js.map +1 -0
- package/dist/generated/und-kbd.d.ts +3 -1
- package/dist/generated/und-kbd.d.ts.map +1 -1
- package/dist/generated/und-kbd.js.map +1 -1
- package/dist/generated/und-layout.d.ts +25 -0
- package/dist/generated/und-layout.d.ts.map +1 -0
- package/dist/generated/und-layout.js +11 -0
- package/dist/generated/und-layout.js.map +1 -0
- package/dist/generated/und-lightbox.d.ts +4 -2
- package/dist/generated/und-lightbox.d.ts.map +1 -1
- package/dist/generated/und-lightbox.js.map +1 -1
- package/dist/generated/und-list-item.d.ts +13 -1
- package/dist/generated/und-list-item.d.ts.map +1 -1
- package/dist/generated/und-list-item.js.map +1 -1
- package/dist/generated/und-list.d.ts +9 -1
- package/dist/generated/und-list.d.ts.map +1 -1
- package/dist/generated/und-list.js.map +1 -1
- package/dist/generated/und-markdown.d.ts +3 -1
- package/dist/generated/und-markdown.d.ts.map +1 -1
- package/dist/generated/und-markdown.js.map +1 -1
- package/dist/generated/und-metadata-list.d.ts +10 -2
- package/dist/generated/und-metadata-list.d.ts.map +1 -1
- package/dist/generated/und-metadata-list.js.map +1 -1
- package/dist/generated/und-nav-icon.d.ts +11 -0
- package/dist/generated/und-nav-icon.d.ts.map +1 -0
- package/dist/generated/und-nav-icon.js +11 -0
- package/dist/generated/und-nav-icon.js.map +1 -0
- package/dist/generated/und-nav-item.d.ts +23 -0
- package/dist/generated/und-nav-item.d.ts.map +1 -0
- package/dist/generated/und-nav-item.js +11 -0
- package/dist/generated/und-nav-item.js.map +1 -0
- package/dist/generated/und-nav-menu-item.d.ts +17 -0
- package/dist/generated/und-nav-menu-item.d.ts.map +1 -0
- package/dist/generated/und-nav-menu-item.js +11 -0
- package/dist/generated/und-nav-menu-item.js.map +1 -0
- package/dist/generated/und-nav-menu.d.ts +20 -0
- package/dist/generated/und-nav-menu.d.ts.map +1 -0
- package/dist/generated/und-nav-menu.js +16 -0
- package/dist/generated/und-nav-menu.js.map +1 -0
- package/dist/generated/und-number-input.d.ts +13 -1
- package/dist/generated/und-number-input.d.ts.map +1 -1
- package/dist/generated/und-number-input.js.map +1 -1
- package/dist/generated/und-outline.d.ts +3 -1
- package/dist/generated/und-outline.d.ts.map +1 -1
- package/dist/generated/und-outline.js.map +1 -1
- package/dist/generated/und-pagination.d.ts +11 -1
- package/dist/generated/und-pagination.d.ts.map +1 -1
- package/dist/generated/und-pagination.js.map +1 -1
- package/dist/generated/und-popover.d.ts +5 -1
- package/dist/generated/und-popover.d.ts.map +1 -1
- package/dist/generated/und-popover.js.map +1 -1
- package/dist/generated/und-power-search.d.ts +50 -0
- package/dist/generated/und-power-search.d.ts.map +1 -0
- package/dist/generated/und-power-search.js +25 -0
- package/dist/generated/und-power-search.js.map +1 -0
- package/dist/generated/und-progress.d.ts +8 -2
- package/dist/generated/und-progress.d.ts.map +1 -1
- package/dist/generated/und-progress.js.map +1 -1
- package/dist/generated/und-resize-handle.d.ts +4 -2
- package/dist/generated/und-resize-handle.d.ts.map +1 -1
- package/dist/generated/und-resize-handle.js.map +1 -1
- package/dist/generated/und-section.d.ts +19 -3
- package/dist/generated/und-section.d.ts.map +1 -1
- package/dist/generated/und-section.js.map +1 -1
- package/dist/generated/und-select.d.ts +4 -4
- package/dist/generated/und-select.d.ts.map +1 -1
- package/dist/generated/und-select.js +2 -2
- package/dist/generated/und-select.js.map +1 -1
- package/dist/generated/und-selectable-card.d.ts +13 -1
- package/dist/generated/und-selectable-card.d.ts.map +1 -1
- package/dist/generated/und-selectable-card.js.map +1 -1
- package/dist/generated/und-skeleton.d.ts +7 -1
- package/dist/generated/und-skeleton.d.ts.map +1 -1
- package/dist/generated/und-skeleton.js.map +1 -1
- package/dist/generated/und-slider.d.ts +11 -1
- package/dist/generated/und-slider.d.ts.map +1 -1
- package/dist/generated/und-slider.js.map +1 -1
- package/dist/generated/und-snap-paging.d.ts +19 -0
- package/dist/generated/und-snap-paging.d.ts.map +1 -0
- package/dist/generated/und-snap-paging.js +16 -0
- package/dist/generated/und-snap-paging.js.map +1 -0
- package/dist/generated/und-spinner.d.ts +3 -1
- package/dist/generated/und-spinner.d.ts.map +1 -1
- package/dist/generated/und-spinner.js.map +1 -1
- package/dist/generated/und-stack.d.ts +24 -4
- package/dist/generated/und-stack.d.ts.map +1 -1
- package/dist/generated/und-stack.js.map +1 -1
- package/dist/generated/und-status-dot.d.ts +5 -1
- package/dist/generated/und-status-dot.d.ts.map +1 -1
- package/dist/generated/und-status-dot.js.map +1 -1
- package/dist/generated/und-swipe-action.d.ts +15 -0
- package/dist/generated/und-swipe-action.d.ts.map +1 -0
- package/dist/generated/und-swipe-action.js +11 -0
- package/dist/generated/und-swipe-action.js.map +1 -0
- package/dist/generated/und-swipe.d.ts +20 -0
- package/dist/generated/und-swipe.d.ts.map +1 -0
- package/dist/generated/und-swipe.js +17 -0
- package/dist/generated/und-swipe.js.map +1 -0
- package/dist/generated/und-switch.d.ts +11 -1
- package/dist/generated/und-switch.d.ts.map +1 -1
- package/dist/generated/und-switch.js.map +1 -1
- package/dist/generated/und-table.d.ts +14 -2
- package/dist/generated/und-table.d.ts.map +1 -1
- package/dist/generated/und-table.js +2 -1
- package/dist/generated/und-table.js.map +1 -1
- package/dist/generated/und-text-field.d.ts +17 -1
- package/dist/generated/und-text-field.d.ts.map +1 -1
- package/dist/generated/und-text-field.js +2 -1
- package/dist/generated/und-text-field.js.map +1 -1
- package/dist/generated/und-text.d.ts +11 -1
- package/dist/generated/und-text.d.ts.map +1 -1
- package/dist/generated/und-text.js.map +1 -1
- package/dist/generated/und-textarea.d.ts +15 -1
- package/dist/generated/und-textarea.d.ts.map +1 -1
- package/dist/generated/und-textarea.js.map +1 -1
- package/dist/generated/und-thumbnail.d.ts +13 -1
- package/dist/generated/und-thumbnail.d.ts.map +1 -1
- package/dist/generated/und-thumbnail.js +2 -1
- package/dist/generated/und-thumbnail.js.map +1 -1
- package/dist/generated/und-time-input.d.ts +11 -1
- package/dist/generated/und-time-input.d.ts.map +1 -1
- package/dist/generated/und-time-input.js.map +1 -1
- package/dist/generated/und-timestamp.d.ts +5 -1
- package/dist/generated/und-timestamp.d.ts.map +1 -1
- package/dist/generated/und-timestamp.js.map +1 -1
- package/dist/generated/und-toast.d.ts +3 -1
- package/dist/generated/und-toast.d.ts.map +1 -1
- package/dist/generated/und-toast.js.map +1 -1
- package/dist/generated/und-toggle-button.d.ts +54 -0
- package/dist/generated/und-toggle-button.d.ts.map +1 -0
- package/dist/generated/und-toggle-button.js +16 -0
- package/dist/generated/und-toggle-button.js.map +1 -0
- package/dist/generated/und-token.d.ts +5 -1
- package/dist/generated/und-token.d.ts.map +1 -1
- package/dist/generated/und-token.js.map +1 -1
- package/dist/generated/und-tree-list.d.ts +3 -1
- package/dist/generated/und-tree-list.d.ts.map +1 -1
- package/dist/generated/und-tree-list.js.map +1 -1
- package/dist/richtext.d.ts +6 -0
- package/dist/richtext.d.ts.map +1 -0
- package/dist/richtext.js +6 -0
- package/dist/richtext.js.map +1 -0
- package/package.json +23 -3
- package/src/charts.ts +5 -0
- package/src/generated/charts/index.ts +6 -0
- package/src/generated/charts/jsx.ts +25 -0
- package/src/generated/charts/und-chart.ts +45 -0
- package/src/generated/index.ts +12 -0
- package/src/generated/jsx.ts +66 -10
- package/src/generated/richtext/index.ts +6 -0
- package/src/generated/richtext/jsx.ts +21 -0
- package/src/generated/richtext/und-rich-text-editor.ts +51 -0
- package/src/generated/und-aspect-ratio.ts +4 -2
- package/src/generated/und-avatar-group.ts +4 -2
- package/src/generated/und-avatar.ts +3 -3
- package/src/generated/und-badge.ts +3 -1
- package/src/generated/und-banner.ts +7 -1
- package/src/generated/und-bottom-sheet.ts +4 -2
- package/src/generated/und-breadcrumb.ts +3 -1
- package/src/generated/und-card.ts +4 -2
- package/src/generated/und-carousel.ts +9 -1
- package/src/generated/und-center.ts +19 -1
- package/src/generated/und-chat-composer.ts +13 -2
- package/src/generated/und-chat-layout.ts +5 -1
- package/src/generated/und-chat-message.ts +11 -5
- package/src/generated/und-checkbox.ts +11 -1
- package/src/generated/und-citation.ts +5 -1
- package/src/generated/und-clickable-card.ts +4 -2
- package/src/generated/und-code-block.ts +11 -1
- package/src/generated/und-code.ts +5 -1
- package/src/generated/und-command-palette.ts +4 -2
- package/src/generated/und-date-input.ts +11 -1
- package/src/generated/und-date-range-input.ts +11 -1
- package/src/generated/und-dialog.ts +4 -2
- package/src/generated/und-divider.ts +5 -1
- package/src/generated/und-drawer.ts +4 -2
- package/src/generated/und-empty-state.ts +3 -1
- package/src/generated/und-file-input.ts +11 -1
- package/src/generated/und-form-field.ts +9 -1
- package/src/generated/und-form-layout.ts +3 -1
- package/src/generated/und-grid.ts +15 -3
- package/src/generated/und-heading.ts +14 -2
- package/src/generated/und-hover-card.ts +3 -1
- package/src/generated/und-icon.ts +6 -2
- package/src/generated/und-indicator.ts +25 -0
- package/src/generated/und-info-tip.ts +3 -1
- package/src/generated/und-input-group.ts +19 -2
- package/src/generated/und-item.ts +41 -0
- package/src/generated/und-kbd.ts +3 -1
- package/src/generated/und-layout.ts +33 -0
- package/src/generated/und-lightbox.ts +4 -2
- package/src/generated/und-list-item.ts +13 -1
- package/src/generated/und-list.ts +9 -1
- package/src/generated/und-markdown.ts +3 -1
- package/src/generated/und-metadata-list.ts +10 -2
- package/src/generated/und-nav-icon.ts +19 -0
- package/src/generated/und-nav-item.ts +31 -0
- package/src/generated/und-nav-menu-item.ts +25 -0
- package/src/generated/und-nav-menu.ts +30 -0
- package/src/generated/und-number-input.ts +13 -1
- package/src/generated/und-outline.ts +3 -1
- package/src/generated/und-pagination.ts +11 -1
- package/src/generated/und-popover.ts +5 -1
- package/src/generated/und-power-search.ts +69 -0
- package/src/generated/und-progress.ts +8 -2
- package/src/generated/und-resize-handle.ts +4 -2
- package/src/generated/und-section.ts +19 -3
- package/src/generated/und-select.ts +6 -6
- package/src/generated/und-selectable-card.ts +13 -1
- package/src/generated/und-skeleton.ts +7 -1
- package/src/generated/und-slider.ts +11 -1
- package/src/generated/und-snap-paging.ts +28 -0
- package/src/generated/und-spinner.ts +3 -1
- package/src/generated/und-stack.ts +24 -4
- package/src/generated/und-status-dot.ts +5 -1
- package/src/generated/und-swipe-action.ts +23 -0
- package/src/generated/und-swipe.ts +33 -0
- package/src/generated/und-switch.ts +11 -1
- package/src/generated/und-table.ts +14 -3
- package/src/generated/und-text-field.ts +19 -2
- package/src/generated/und-text.ts +11 -1
- package/src/generated/und-textarea.ts +15 -1
- package/src/generated/und-thumbnail.ts +15 -2
- package/src/generated/und-time-input.ts +11 -1
- package/src/generated/und-timestamp.ts +5 -1
- package/src/generated/und-toast.ts +3 -1
- package/src/generated/und-toggle-button.ts +64 -0
- package/src/generated/und-token.ts +5 -1
- package/src/generated/und-tree-list.ts +3 -1
- package/src/richtext.ts +5 -0
|
@@ -8,9 +8,11 @@ import type { UndSelectableCard as UndSelectableCardElement } from '@und-ui/core
|
|
|
8
8
|
import { useControlledProp, type UndEvent } from './shared.js';
|
|
9
9
|
|
|
10
10
|
export interface UndSelectableCardProps
|
|
11
|
-
extends Omit<HTMLAttributes<UndSelectableCardElement>, 'type' | 'checked' | 'defaultChecked' | 'value' | 'label' | 'description' | 'error' | 'required' | 'optional' | 'disabled' | 'name' | 'onInput' | 'onChange'> {
|
|
11
|
+
extends Omit<HTMLAttributes<UndSelectableCardElement>, 'type' | 'hideIndicator' | 'checked' | 'defaultChecked' | 'value' | 'label' | 'description' | 'error' | 'required' | 'optional' | 'disabled' | 'name' | 'status' | 'statusMessage' | 'statusVariant' | 'labelHidden' | 'labelTooltip' | 'onInput' | 'onChange'> {
|
|
12
12
|
/** `checkbox` toggles on its own; `radio` selects one card of those that share a `name`. */
|
|
13
13
|
type?: UndSelectableCardElement['type'];
|
|
14
|
+
/** Hides the check circle or box: the selected ring alone shows the state. The native input stays for keyboard, forms and assistive technology. */
|
|
15
|
+
hideIndicator?: UndSelectableCardElement['hideIndicator'];
|
|
14
16
|
/** Whether the control is checked. The `checked` attribute also sets the default restored by a form reset, as on a native checkbox. */
|
|
15
17
|
checked?: UndSelectableCardElement['checked'];
|
|
16
18
|
/** Checked state restored on form reset (defaults to the initial `checked`). */
|
|
@@ -31,6 +33,16 @@ export interface UndSelectableCardProps
|
|
|
31
33
|
disabled?: UndSelectableCardElement['disabled'];
|
|
32
34
|
/** Name submitted with the form data. */
|
|
33
35
|
name?: UndSelectableCardElement['name'];
|
|
36
|
+
/** Validation status without blocking submission: `warning` or `success` (or `error`, which marks the control invalid like `error` does, without a custom validity message). Colours the border, shows a status icon and the `status-message`. A non-empty `error` always wins. */
|
|
37
|
+
status?: UndSelectableCardElement['status'];
|
|
38
|
+
/** Message shown for `status` (announced with a hidden "Warning:" or "Success:" prefix). */
|
|
39
|
+
statusMessage?: UndSelectableCardElement['statusMessage'];
|
|
40
|
+
/** Where the status message sits: `attached` (tucked under the bordered control) or `detached` (its own box with an icon). Defaults per control. */
|
|
41
|
+
statusVariant?: UndSelectableCardElement['statusVariant'];
|
|
42
|
+
/** Hides the label and description visually; they stay in the accessibility tree (use for search boxes whose icon says enough). */
|
|
43
|
+
labelHidden?: UndSelectableCardElement['labelHidden'];
|
|
44
|
+
/** Help text for an info button after the label (an `und-info-tip` named "About {label}"). Register `und-info-tip` yourself (import `@und-ui/core/info-tip.js` or use the autoloader); fields do not bundle it. */
|
|
45
|
+
labelTooltip?: UndSelectableCardElement['labelTooltip'];
|
|
34
46
|
/** Native `input` from the inner input. */
|
|
35
47
|
onInput?: (event: UndEvent<InputEvent, UndSelectableCardElement>) => void;
|
|
36
48
|
/** Native `change` after the user selects or clears the card. */
|
|
@@ -7,11 +7,17 @@ import '@und-ui/core/skeleton.js';
|
|
|
7
7
|
import type { UndSkeleton as UndSkeletonElement } from '@und-ui/core';
|
|
8
8
|
|
|
9
9
|
export interface UndSkeletonProps
|
|
10
|
-
extends Omit<HTMLAttributes<UndSkeletonElement>, 'shape' | 'lines'> {
|
|
10
|
+
extends Omit<HTMLAttributes<UndSkeletonElement>, 'shape' | 'lines' | 'radius' | 'effect' | 'index'> {
|
|
11
11
|
/** Placeholder shape. */
|
|
12
12
|
shape?: UndSkeletonElement['shape'];
|
|
13
13
|
/** Number of text lines (`text` shape). The last of several lines is shorter. */
|
|
14
14
|
lines?: UndSkeletonElement['lines'];
|
|
15
|
+
/** Corner radius: `none`/`0` square, `1` 4px, `2` 8px, `3`/`4` 12px (the default), `rounded` a pill. A circle stays round. */
|
|
16
|
+
radius?: UndSkeletonElement['radius'];
|
|
17
|
+
/** Animation: `pulse` (a stepped fade), `shimmer` (a moving highlight) or `none`. */
|
|
18
|
+
effect?: UndSkeletonElement['effect'];
|
|
19
|
+
/** Position in a group of skeletons; each step delays the fade by 100ms so the group fades in a wave. */
|
|
20
|
+
index?: UndSkeletonElement['index'];
|
|
15
21
|
ref?: Ref<UndSkeletonElement>;
|
|
16
22
|
}
|
|
17
23
|
|
|
@@ -8,7 +8,7 @@ import type { UndSlider as UndSliderElement } from '@und-ui/core';
|
|
|
8
8
|
import { useControlledProp, type UndEvent } from './shared.js';
|
|
9
9
|
|
|
10
10
|
export interface UndSliderProps
|
|
11
|
-
extends Omit<HTMLAttributes<UndSliderElement>, 'value' | 'valueEnd' | 'min' | 'max' | 'step' | 'largeStep' | 'range' | 'startLabel' | 'endLabel' | 'formatOptions' | 'valueText' | 'label' | 'description' | 'error' | 'required' | 'optional' | 'disabled' | 'name' | 'onInput' | 'onChange'> {
|
|
11
|
+
extends Omit<HTMLAttributes<UndSliderElement>, 'value' | 'valueEnd' | 'min' | 'max' | 'step' | 'largeStep' | 'range' | 'startLabel' | 'endLabel' | 'formatOptions' | 'valueText' | 'label' | 'description' | 'error' | 'required' | 'optional' | 'disabled' | 'name' | 'status' | 'statusMessage' | 'statusVariant' | 'labelHidden' | 'labelTooltip' | 'onInput' | 'onChange'> {
|
|
12
12
|
/** The value (single mode) or the start of the range (range mode). */
|
|
13
13
|
value?: UndSliderElement['value'];
|
|
14
14
|
/** The end of the range (range mode). Defaults to `max`. */
|
|
@@ -45,6 +45,16 @@ export interface UndSliderProps
|
|
|
45
45
|
disabled?: UndSliderElement['disabled'];
|
|
46
46
|
/** Name submitted with the form data. */
|
|
47
47
|
name?: UndSliderElement['name'];
|
|
48
|
+
/** Validation status without blocking submission: `warning` or `success` (or `error`, which marks the control invalid like `error` does, without a custom validity message). Colours the border, shows a status icon and the `status-message`. A non-empty `error` always wins. */
|
|
49
|
+
status?: UndSliderElement['status'];
|
|
50
|
+
/** Message shown for `status` (announced with a hidden "Warning:" or "Success:" prefix). */
|
|
51
|
+
statusMessage?: UndSliderElement['statusMessage'];
|
|
52
|
+
/** Where the status message sits: `attached` (tucked under the bordered control) or `detached` (its own box with an icon). Defaults per control. */
|
|
53
|
+
statusVariant?: UndSliderElement['statusVariant'];
|
|
54
|
+
/** Hides the label and description visually; they stay in the accessibility tree (use for search boxes whose icon says enough). */
|
|
55
|
+
labelHidden?: UndSliderElement['labelHidden'];
|
|
56
|
+
/** Help text for an info button after the label (an `und-info-tip` named "About {label}"). Register `und-info-tip` yourself (import `@und-ui/core/info-tip.js` or use the autoloader); fields do not bundle it. */
|
|
57
|
+
labelTooltip?: UndSliderElement['labelTooltip'];
|
|
48
58
|
/** Native `input` from the moving thumb, continuously while it moves. */
|
|
49
59
|
onInput?: (event: UndEvent<InputEvent, UndSliderElement>) => void;
|
|
50
60
|
/** Native `change` when the user commits a value. */
|
|
@@ -0,0 +1,28 @@
|
|
|
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/snap-paging.js';
|
|
7
|
+
import type { UndSnapPaging as UndSnapPagingElement } from '@und-ui/core';
|
|
8
|
+
import { type UndEvent } from './shared.js';
|
|
9
|
+
|
|
10
|
+
export interface UndSnapPagingProps
|
|
11
|
+
extends Omit<HTMLAttributes<UndSnapPagingElement>, 'pages' | 'label' | 'onUndPageChange'> {
|
|
12
|
+
/** What one flick moves: `view` lands on the item start nearest one viewport on; `item` moves one item. */
|
|
13
|
+
pages?: UndSnapPagingElement['pages'];
|
|
14
|
+
/** Accessible name of the scrolling row. */
|
|
15
|
+
label?: UndSnapPagingElement['label'];
|
|
16
|
+
/** The settled page changed. */
|
|
17
|
+
onUndPageChange?: (event: UndEvent<CustomEvent<{ page: number; pages: number }>, UndSnapPagingElement>) => void;
|
|
18
|
+
ref?: Ref<UndSnapPagingElement>;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/** A scrolling row that moves one view or one item per flick. */
|
|
22
|
+
export function UndSnapPaging(props: UndSnapPagingProps): ReactElement {
|
|
23
|
+
const { onUndPageChange, ...rest } = props;
|
|
24
|
+
return createElement('und-snap-paging', {
|
|
25
|
+
...rest,
|
|
26
|
+
'onund-page-change': onUndPageChange,
|
|
27
|
+
});
|
|
28
|
+
}
|
|
@@ -7,9 +7,11 @@ import '@und-ui/core/spinner.js';
|
|
|
7
7
|
import type { UndSpinner as UndSpinnerElement } from '@und-ui/core';
|
|
8
8
|
|
|
9
9
|
export interface UndSpinnerProps
|
|
10
|
-
extends Omit<HTMLAttributes<UndSpinnerElement>, 'size' | 'label' | 'decorative'> {
|
|
10
|
+
extends Omit<HTMLAttributes<UndSpinnerElement>, 'size' | 'shade' | 'label' | 'decorative'> {
|
|
11
11
|
/** Size of the spinner. */
|
|
12
12
|
size?: UndSpinnerElement['size'];
|
|
13
|
+
/** Colour: `default` (accent), `subtle` (secondary text colour), `on-media` (white, for dark or photo backgrounds) or `inherit` (the current text colour, such as inside a button). */
|
|
14
|
+
shade?: UndSpinnerElement['shade'];
|
|
13
15
|
/** Accessible name. Localize it. */
|
|
14
16
|
label?: UndSpinnerElement['label'];
|
|
15
17
|
/** Hides the spinner from assistive technology, for places that already expose the busy state (a loading button, an `aria-busy` region). */
|
|
@@ -7,19 +7,39 @@ import '@und-ui/core/stack.js';
|
|
|
7
7
|
import type { UndStack as UndStackElement } from '@und-ui/core';
|
|
8
8
|
|
|
9
9
|
export interface UndStackProps
|
|
10
|
-
extends Omit<HTMLAttributes<UndStackElement>, 'direction' | 'gap' | 'alignItems' | 'justifyContent' | 'wrap' | 'inline'> {
|
|
11
|
-
/** Main axis: `column` (
|
|
10
|
+
extends Omit<HTMLAttributes<UndStackElement>, 'direction' | 'gap' | 'alignItems' | 'justifyContent' | 'hAlign' | 'vAlign' | 'wrap' | 'inline' | 'scrollable' | 'padding' | 'paddingInline' | 'paddingBlock' | 'paddingInlineStart' | 'paddingInlineEnd' | 'paddingBlockStart' | 'paddingBlockEnd'> {
|
|
11
|
+
/** Main axis: `column` (default) or `vertical`, `row` or `horizontal`. */
|
|
12
12
|
direction?: UndStackElement['direction'];
|
|
13
|
-
/** Gap between items, a space
|
|
13
|
+
/** Gap between items, a space step (`0`, `0.5`, `1`, `1.5`, `2` ... `32`). Default `4`. */
|
|
14
14
|
gap?: UndStackElement['gap'];
|
|
15
15
|
/** Cross-axis alignment. */
|
|
16
16
|
alignItems?: UndStackElement['alignItems'];
|
|
17
17
|
/** Main-axis distribution. */
|
|
18
18
|
justifyContent?: UndStackElement['justifyContent'];
|
|
19
|
-
/**
|
|
19
|
+
/** Horizontal alignment whatever the direction: the main axis of a row (`start`, `center`, `end`, `between`, `around`, `evenly`), the cross axis of a column (`start`, `center`, `end`, `stretch`). Wins over `align-items` and `justify-content`. */
|
|
20
|
+
hAlign?: UndStackElement['hAlign'];
|
|
21
|
+
/** Vertical alignment whatever the direction: the cross axis of a row (`start`, `center`, `end`, `stretch`), the main axis of a column (`start`, `center`, `end`, `between`, `around`, `evenly`). */
|
|
22
|
+
vAlign?: UndStackElement['vAlign'];
|
|
23
|
+
/** Lets items wrap onto further lines. A bare attribute wraps; the values `wrap`, `wrap-reverse` and `nowrap` are accepted too. */
|
|
20
24
|
wrap?: UndStackElement['wrap'];
|
|
21
25
|
/** Shrinks to its content instead of filling the line. */
|
|
22
26
|
inline?: UndStackElement['inline'];
|
|
27
|
+
/** Scrolls its own overflow (`overflow: auto`). Give it a size, and an `aria-label` plus `tabindex="0"` when the content has nothing focusable. */
|
|
28
|
+
scrollable?: UndStackElement['scrollable'];
|
|
29
|
+
/** Padding on every side, a space step (`0`, `0.5`, `1`, `1.5`, `2` ... `32`). */
|
|
30
|
+
padding?: UndStackElement['padding'];
|
|
31
|
+
/** Inline (start and end) padding, a space step. Wins over `padding`. */
|
|
32
|
+
paddingInline?: UndStackElement['paddingInline'];
|
|
33
|
+
/** Block (top and bottom) padding, a space step. Wins over `padding`. */
|
|
34
|
+
paddingBlock?: UndStackElement['paddingBlock'];
|
|
35
|
+
/** Inline-start padding, a space step. Wins over `padding-inline`. */
|
|
36
|
+
paddingInlineStart?: UndStackElement['paddingInlineStart'];
|
|
37
|
+
/** Inline-end padding, a space step. Wins over `padding-inline`. */
|
|
38
|
+
paddingInlineEnd?: UndStackElement['paddingInlineEnd'];
|
|
39
|
+
/** Block-start padding, a space step. Wins over `padding-block`. */
|
|
40
|
+
paddingBlockStart?: UndStackElement['paddingBlockStart'];
|
|
41
|
+
/** Block-end padding, a space step. Wins over `padding-block`. */
|
|
42
|
+
paddingBlockEnd?: UndStackElement['paddingBlockEnd'];
|
|
23
43
|
ref?: Ref<UndStackElement>;
|
|
24
44
|
}
|
|
25
45
|
|
|
@@ -7,11 +7,15 @@ import '@und-ui/core/status-dot.js';
|
|
|
7
7
|
import type { UndStatusDot as UndStatusDotElement } from '@und-ui/core';
|
|
8
8
|
|
|
9
9
|
export interface UndStatusDotProps
|
|
10
|
-
extends Omit<HTMLAttributes<UndStatusDotElement>, 'tone' | 'label'> {
|
|
10
|
+
extends Omit<HTMLAttributes<UndStatusDotElement>, 'tone' | 'label' | 'shape' | 'pulse'> {
|
|
11
11
|
/** Color intent and shape. */
|
|
12
12
|
tone?: UndStatusDotElement['tone'];
|
|
13
13
|
/** Accessible name of a dot that has no visible text ("Online"). Ignored when the element has text. */
|
|
14
14
|
label?: UndStatusDotElement['label'];
|
|
15
|
+
/** `auto` draws a different shape per tone; `dot` a round dot for every tone (only next to visible text). */
|
|
16
|
+
shape?: UndStatusDotElement['shape'];
|
|
17
|
+
/** Pulses the dot to show ongoing activity (still under reduced motion). */
|
|
18
|
+
pulse?: UndStatusDotElement['pulse'];
|
|
15
19
|
ref?: Ref<UndStatusDotElement>;
|
|
16
20
|
}
|
|
17
21
|
|
|
@@ -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/swipe-action.js';
|
|
7
|
+
import type { UndSwipeAction as UndSwipeActionElement } from '@und-ui/core';
|
|
8
|
+
|
|
9
|
+
export interface UndSwipeActionProps
|
|
10
|
+
extends Omit<HTMLAttributes<UndSwipeActionElement>, 'variant' | 'disabled' | 'label'> {
|
|
11
|
+
/** Color: `accent`, `neutral`, `danger`, `success` or `warning`. */
|
|
12
|
+
variant?: UndSwipeActionElement['variant'];
|
|
13
|
+
/** Disables the action. */
|
|
14
|
+
disabled?: UndSwipeActionElement['disabled'];
|
|
15
|
+
/** Accessible name when the visible label is an icon only. */
|
|
16
|
+
label?: UndSwipeActionElement['label'];
|
|
17
|
+
ref?: Ref<UndSwipeActionElement>;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/** An action revealed by swiping an `und-swipe` row. */
|
|
21
|
+
export function UndSwipeAction(props: UndSwipeActionProps): ReactElement {
|
|
22
|
+
return createElement('und-swipe-action', props);
|
|
23
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
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/swipe.js';
|
|
7
|
+
import type { UndSwipe as UndSwipeElement } from '@und-ui/core';
|
|
8
|
+
import { type UndEvent } from './shared.js';
|
|
9
|
+
|
|
10
|
+
export interface UndSwipeProps
|
|
11
|
+
extends Omit<HTMLAttributes<UndSwipeElement>, 'behavior' | 'open' | 'disabled' | 'onUndSwipeChange' | 'onUndSwipeAction'> {
|
|
12
|
+
/** What a swipe does: `reveal` rests the row open with every action a real button; `commit` runs the outermost action when the swipe goes far enough. */
|
|
13
|
+
behavior?: UndSwipeElement['behavior'];
|
|
14
|
+
/** The side currently open (`leading` or `trailing`), if any. Set it to open a side from code, or remove it to close. */
|
|
15
|
+
open?: UndSwipeElement['open'];
|
|
16
|
+
/** Turns the gesture off. The actions stay in the DOM. */
|
|
17
|
+
disabled?: UndSwipeElement['disabled'];
|
|
18
|
+
/** The open side changed. */
|
|
19
|
+
onUndSwipeChange?: (event: UndEvent<CustomEvent<unknown>, UndSwipeElement>) => void;
|
|
20
|
+
/** An action was activated. */
|
|
21
|
+
onUndSwipeAction?: (event: UndEvent<CustomEvent<unknown>, UndSwipeElement>) => void;
|
|
22
|
+
ref?: Ref<UndSwipeElement>;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/** A row that uncovers actions when swiped sideways. */
|
|
26
|
+
export function UndSwipe(props: UndSwipeProps): ReactElement {
|
|
27
|
+
const { onUndSwipeChange, onUndSwipeAction, ...rest } = props;
|
|
28
|
+
return createElement('und-swipe', {
|
|
29
|
+
...rest,
|
|
30
|
+
'onund-swipe-change': onUndSwipeChange,
|
|
31
|
+
'onund-swipe-action': onUndSwipeAction,
|
|
32
|
+
});
|
|
33
|
+
}
|
|
@@ -8,7 +8,7 @@ import type { UndSwitch as UndSwitchElement } from '@und-ui/core';
|
|
|
8
8
|
import { useControlledProp, type UndEvent } from './shared.js';
|
|
9
9
|
|
|
10
10
|
export interface UndSwitchProps
|
|
11
|
-
extends Omit<HTMLAttributes<UndSwitchElement>, 'checked' | 'defaultChecked' | 'value' | 'label' | 'description' | 'error' | 'required' | 'optional' | 'disabled' | 'name' | 'onInput' | 'onChange'> {
|
|
11
|
+
extends Omit<HTMLAttributes<UndSwitchElement>, 'checked' | 'defaultChecked' | 'value' | 'label' | 'description' | 'error' | 'required' | 'optional' | 'disabled' | 'name' | 'status' | 'statusMessage' | 'statusVariant' | 'labelHidden' | 'labelTooltip' | 'onInput' | 'onChange'> {
|
|
12
12
|
/** Whether the control is checked. The `checked` attribute also sets the default restored by a form reset, as on a native checkbox. */
|
|
13
13
|
checked?: UndSwitchElement['checked'];
|
|
14
14
|
/** Checked state restored on form reset (defaults to the initial `checked`). */
|
|
@@ -29,6 +29,16 @@ export interface UndSwitchProps
|
|
|
29
29
|
disabled?: UndSwitchElement['disabled'];
|
|
30
30
|
/** Name submitted with the form data. */
|
|
31
31
|
name?: UndSwitchElement['name'];
|
|
32
|
+
/** Validation status without blocking submission: `warning` or `success` (or `error`, which marks the control invalid like `error` does, without a custom validity message). Colours the border, shows a status icon and the `status-message`. A non-empty `error` always wins. */
|
|
33
|
+
status?: UndSwitchElement['status'];
|
|
34
|
+
/** Message shown for `status` (announced with a hidden "Warning:" or "Success:" prefix). */
|
|
35
|
+
statusMessage?: UndSwitchElement['statusMessage'];
|
|
36
|
+
/** Where the status message sits: `attached` (tucked under the bordered control) or `detached` (its own box with an icon). Defaults per control. */
|
|
37
|
+
statusVariant?: UndSwitchElement['statusVariant'];
|
|
38
|
+
/** Hides the label and description visually; they stay in the accessibility tree (use for search boxes whose icon says enough). */
|
|
39
|
+
labelHidden?: UndSwitchElement['labelHidden'];
|
|
40
|
+
/** Help text for an info button after the label (an `und-info-tip` named "About {label}"). Register `und-info-tip` yourself (import `@und-ui/core/info-tip.js` or use the autoloader); fields do not bundle it. */
|
|
41
|
+
labelTooltip?: UndSwitchElement['labelTooltip'];
|
|
32
42
|
/** Native `input` from the inner switch input. */
|
|
33
43
|
onInput?: (event: UndEvent<InputEvent, UndSwitchElement>) => void;
|
|
34
44
|
/** Native `change` after the user toggles the switch. */
|
|
@@ -8,19 +8,27 @@ import type { UndTable as UndTableElement } from '@und-ui/core';
|
|
|
8
8
|
import { type UndEvent } from './shared.js';
|
|
9
9
|
|
|
10
10
|
export interface UndTableProps
|
|
11
|
-
extends Omit<HTMLAttributes<UndTableElement>, 'label' | 'density' | 'striped' | 'stickyHeader' | 'stickyFirstColumn' | 'resizable' | 'selectionMessage' | 'resizeLabel' | 'sortMessage' | 'ascendingLabel' | 'descendingLabel' | 'onUndSort' | 'onUndSelectionChange' | 'onUndColumnResize' | 'onUndExpandChange'> {
|
|
11
|
+
extends Omit<HTMLAttributes<UndTableElement>, 'label' | 'density' | 'striped' | 'hoverable' | 'columnDividers' | 'stickyHeader' | 'bare' | 'stickyFirstColumn' | 'resizable' | 'hiddenColumns' | 'selectionMessage' | 'resizeLabel' | 'sortMessage' | 'ascendingLabel' | 'descendingLabel' | 'onUndSort' | 'onUndSelectionChange' | 'onUndColumnResize' | 'onUndExpandChange' | 'onUndColumnsChange'> {
|
|
12
12
|
/** Accessible name of the scroll region. Defaults to the caption text. */
|
|
13
13
|
label?: UndTableElement['label'];
|
|
14
|
-
/** Cell spacing. */
|
|
14
|
+
/** Cell spacing: `compact` (4/8 px), `balanced` or `comfortable` (8/12 px, the default) and `spacious` (12/16 px). */
|
|
15
15
|
density?: UndTableElement['density'];
|
|
16
16
|
/** Shades every other body row. */
|
|
17
17
|
striped?: UndTableElement['striped'];
|
|
18
|
+
/** Tints the body row under the pointer. */
|
|
19
|
+
hoverable?: UndTableElement['hoverable'];
|
|
20
|
+
/** Draws a divider between columns. */
|
|
21
|
+
columnDividers?: UndTableElement['columnDividers'];
|
|
18
22
|
/** Keeps the header row visible while the region scrolls vertically. Set a maximum height with `--und-table-max-height`. */
|
|
19
23
|
stickyHeader?: UndTableElement['stickyHeader'];
|
|
24
|
+
/** Drops the rounded card (border, radius, surface) around the table, for a table that sits inside another card. */
|
|
25
|
+
bare?: UndTableElement['bare'];
|
|
20
26
|
/** Keeps the first column visible while the region scrolls horizontally. */
|
|
21
27
|
stickyFirstColumn?: UndTableElement['stickyFirstColumn'];
|
|
22
28
|
/** Adds a keyboard- and pointer-operable resize handle to each header cell (cells with `data-resize="false"` or a column span are skipped). */
|
|
23
29
|
resizable?: UndTableElement['resizable'];
|
|
30
|
+
/** Zero-based indexes of columns to hide, comma separated (`1,3`). Build your own column picker with `columns` and `setColumnHidden()`; this stays headless. */
|
|
31
|
+
hiddenColumns?: UndTableElement['hiddenColumns'];
|
|
24
32
|
/** Text of the selected-count status; `{count}` is replaced. */
|
|
25
33
|
selectionMessage?: UndTableElement['selectionMessage'];
|
|
26
34
|
/** Accessible name of a resize handle; `{column}` is replaced by the header text. */
|
|
@@ -39,17 +47,20 @@ export interface UndTableProps
|
|
|
39
47
|
onUndColumnResize?: (event: UndEvent<CustomEvent<unknown>, UndTableElement>) => void;
|
|
40
48
|
/** The user expanded or collapsed a row. */
|
|
41
49
|
onUndExpandChange?: (event: UndEvent<CustomEvent<unknown>, UndTableElement>) => void;
|
|
50
|
+
/** `setColumnHidden()` changed which columns are shown. */
|
|
51
|
+
onUndColumnsChange?: (event: UndEvent<CustomEvent<{ hidden: number[] }>, UndTableElement>) => void;
|
|
42
52
|
ref?: Ref<UndTableElement>;
|
|
43
53
|
}
|
|
44
54
|
|
|
45
55
|
/** A styled native table with responsive overflow, sorting, selection, resizing and expandable rows. */
|
|
46
56
|
export function UndTable(props: UndTableProps): ReactElement {
|
|
47
|
-
const { onUndSort, onUndSelectionChange, onUndColumnResize, onUndExpandChange, ...rest } = props;
|
|
57
|
+
const { onUndSort, onUndSelectionChange, onUndColumnResize, onUndExpandChange, onUndColumnsChange, ...rest } = props;
|
|
48
58
|
return createElement('und-table', {
|
|
49
59
|
...rest,
|
|
50
60
|
'onund-sort': onUndSort,
|
|
51
61
|
'onund-selection-change': onUndSelectionChange,
|
|
52
62
|
'onund-column-resize': onUndColumnResize,
|
|
53
63
|
'onund-expand-change': onUndExpandChange,
|
|
64
|
+
'onund-columns-change': onUndColumnsChange,
|
|
54
65
|
});
|
|
55
66
|
}
|
|
@@ -8,7 +8,11 @@ import type { UndTextField as UndTextFieldElement } from '@und-ui/core';
|
|
|
8
8
|
import { useControlledProp, type UndEvent } from './shared.js';
|
|
9
9
|
|
|
10
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'> {
|
|
11
|
+
extends Omit<HTMLAttributes<UndTextFieldElement>, 'clearable' | 'loading' | 'type' | 'value' | 'defaultValue' | 'size' | 'readOnly' | 'placeholder' | 'autocomplete' | 'inputMode' | 'enterKeyHint' | 'minLength' | 'maxLength' | 'pattern' | 'min' | 'max' | 'step' | 'label' | 'description' | 'error' | 'required' | 'optional' | 'disabled' | 'name' | 'status' | 'statusMessage' | 'statusVariant' | 'labelHidden' | 'labelTooltip' | 'onUndClear' | 'onInput' | 'onChange'> {
|
|
12
|
+
/** Shows a clear button while the input has a value. */
|
|
13
|
+
clearable?: UndTextFieldElement['clearable'];
|
|
14
|
+
/** Shows a spinner at the end of the input (async validation, search). */
|
|
15
|
+
loading?: UndTextFieldElement['loading'];
|
|
12
16
|
/** Input type. */
|
|
13
17
|
type?: UndTextFieldElement['type'];
|
|
14
18
|
/** Current value. The `value` attribute also sets the default value that a form reset restores, as on a native input. */
|
|
@@ -53,6 +57,18 @@ export interface UndTextFieldProps
|
|
|
53
57
|
disabled?: UndTextFieldElement['disabled'];
|
|
54
58
|
/** Name submitted with the form data. */
|
|
55
59
|
name?: UndTextFieldElement['name'];
|
|
60
|
+
/** Validation status without blocking submission: `warning` or `success` (or `error`, which marks the control invalid like `error` does, without a custom validity message). Colours the border, shows a status icon and the `status-message`. A non-empty `error` always wins. */
|
|
61
|
+
status?: UndTextFieldElement['status'];
|
|
62
|
+
/** Message shown for `status` (announced with a hidden "Warning:" or "Success:" prefix). */
|
|
63
|
+
statusMessage?: UndTextFieldElement['statusMessage'];
|
|
64
|
+
/** Where the status message sits: `attached` (tucked under the bordered control) or `detached` (its own box with an icon). Defaults per control. */
|
|
65
|
+
statusVariant?: UndTextFieldElement['statusVariant'];
|
|
66
|
+
/** Hides the label and description visually; they stay in the accessibility tree (use for search boxes whose icon says enough). */
|
|
67
|
+
labelHidden?: UndTextFieldElement['labelHidden'];
|
|
68
|
+
/** Help text for an info button after the label (an `und-info-tip` named "About {label}"). Register `und-info-tip` yourself (import `@und-ui/core/info-tip.js` or use the autoloader); fields do not bundle it. */
|
|
69
|
+
labelTooltip?: UndTextFieldElement['labelTooltip'];
|
|
70
|
+
/** The clear button emptied the input (an `input` event fires too). */
|
|
71
|
+
onUndClear?: (event: UndEvent<CustomEvent<unknown>, UndTextFieldElement>) => void;
|
|
56
72
|
/** Native `input` from the inner `<input>`, bubbling through the host. `event.isComposing` is true during IME composition. */
|
|
57
73
|
onInput?: (event: UndEvent<InputEvent, UndTextFieldElement>) => void;
|
|
58
74
|
/** Native `change`: fires when the value is committed, never in the middle of IME composition. */
|
|
@@ -62,12 +78,13 @@ export interface UndTextFieldProps
|
|
|
62
78
|
|
|
63
79
|
/** A labelled single-line text input with description and error. */
|
|
64
80
|
export function UndTextField(props: UndTextFieldProps): ReactElement {
|
|
65
|
-
const { onInput, onChange, ref, ...rest } = props;
|
|
81
|
+
const { onUndClear, onInput, onChange, ref, ...rest } = props;
|
|
66
82
|
// Controlled when `value` is set: a change the handler rejects is undone.
|
|
67
83
|
const controlled = useControlledProp<UndTextFieldElement, 'value'>('value', props.value, ref);
|
|
68
84
|
return createElement('und-text-field', {
|
|
69
85
|
...rest,
|
|
70
86
|
ref: controlled.ref,
|
|
87
|
+
'onund-clear': onUndClear,
|
|
71
88
|
'oninput': (event: UndEvent<InputEvent, UndTextFieldElement>) => {
|
|
72
89
|
onInput?.(event);
|
|
73
90
|
controlled.settle();
|
|
@@ -7,13 +7,23 @@ import '@und-ui/core/text.js';
|
|
|
7
7
|
import type { UndText as UndTextElement } from '@und-ui/core';
|
|
8
8
|
|
|
9
9
|
export interface UndTextProps
|
|
10
|
-
extends Omit<HTMLAttributes<UndTextElement>, 'size' | 'weight' | 'tone' | 'lines' | 'block'> {
|
|
10
|
+
extends Omit<HTMLAttributes<UndTextElement>, 'size' | 'type' | 'weight' | 'tone' | 'align' | 'textWrap' | 'strikethrough' | 'tabular' | 'lines' | 'block'> {
|
|
11
11
|
/** Type scale step. `inherit` keeps the surrounding font size and line height. */
|
|
12
12
|
size?: UndTextElement['size'];
|
|
13
|
+
/** Type role from the Astryx scale; wins over `size`. `body` 14/20, `large` 17/24 semibold, `label` 14/20 medium, `supporting` 12/20, `code` 14/20 monospace, `display-1` to `display-3` 42, 35 and 29 px regular. */
|
|
14
|
+
type?: UndTextElement['type'];
|
|
13
15
|
/** Font weight. Unset keeps the weight of the size. */
|
|
14
16
|
weight?: UndTextElement['weight'];
|
|
15
17
|
/** Color intent. */
|
|
16
18
|
tone?: UndTextElement['tone'];
|
|
19
|
+
/** Text alignment (logical: `start`, `center`, `end`). */
|
|
20
|
+
align?: UndTextElement['align'];
|
|
21
|
+
/** Line wrapping. */
|
|
22
|
+
textWrap?: UndTextElement['textWrap'];
|
|
23
|
+
/** Draws a line through the text. */
|
|
24
|
+
strikethrough?: UndTextElement['strikethrough'];
|
|
25
|
+
/** Uses tabular (equal width) numbers, for figures that line up. */
|
|
26
|
+
tabular?: UndTextElement['tabular'];
|
|
17
27
|
/** Clamps the text to this many lines and ends it with an ellipsis (visual only; the full text stays available to assistive technology). Unset or 0 shows all of it. A clamped text is block level. */
|
|
18
28
|
lines?: UndTextElement['lines'];
|
|
19
29
|
/** Lays the text out as a block instead of inline. */
|
|
@@ -8,7 +8,11 @@ import type { UndTextarea as UndTextareaElement } from '@und-ui/core';
|
|
|
8
8
|
import { useControlledProp, type UndEvent } from './shared.js';
|
|
9
9
|
|
|
10
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'> {
|
|
11
|
+
extends Omit<HTMLAttributes<UndTextareaElement>, 'size' | 'showCount' | 'value' | 'defaultValue' | 'rows' | 'autoResize' | 'resize' | 'readOnly' | 'placeholder' | 'autocomplete' | 'minLength' | 'maxLength' | 'label' | 'description' | 'error' | 'required' | 'optional' | 'disabled' | 'name' | 'status' | 'statusMessage' | 'statusVariant' | 'labelHidden' | 'labelTooltip' | 'onInput' | 'onChange'> {
|
|
12
|
+
/** Size: `lg` adds block padding (`sm` and `md` match Astryx and look alike). */
|
|
13
|
+
size?: UndTextareaElement['size'];
|
|
14
|
+
/** Shows a character counter in the bottom corner. With `maxlength` it reads "12/200" and turns red at the limit. */
|
|
15
|
+
showCount?: UndTextareaElement['showCount'];
|
|
12
16
|
/** Current value. The initial value is also the default restored by a form reset, as on a native textarea. */
|
|
13
17
|
value?: UndTextareaElement['value'];
|
|
14
18
|
/** Value restored on form reset (defaults to the initial `value`). */
|
|
@@ -43,6 +47,16 @@ export interface UndTextareaProps
|
|
|
43
47
|
disabled?: UndTextareaElement['disabled'];
|
|
44
48
|
/** Name submitted with the form data. */
|
|
45
49
|
name?: UndTextareaElement['name'];
|
|
50
|
+
/** Validation status without blocking submission: `warning` or `success` (or `error`, which marks the control invalid like `error` does, without a custom validity message). Colours the border, shows a status icon and the `status-message`. A non-empty `error` always wins. */
|
|
51
|
+
status?: UndTextareaElement['status'];
|
|
52
|
+
/** Message shown for `status` (announced with a hidden "Warning:" or "Success:" prefix). */
|
|
53
|
+
statusMessage?: UndTextareaElement['statusMessage'];
|
|
54
|
+
/** Where the status message sits: `attached` (tucked under the bordered control) or `detached` (its own box with an icon). Defaults per control. */
|
|
55
|
+
statusVariant?: UndTextareaElement['statusVariant'];
|
|
56
|
+
/** Hides the label and description visually; they stay in the accessibility tree (use for search boxes whose icon says enough). */
|
|
57
|
+
labelHidden?: UndTextareaElement['labelHidden'];
|
|
58
|
+
/** Help text for an info button after the label (an `und-info-tip` named "About {label}"). Register `und-info-tip` yourself (import `@und-ui/core/info-tip.js` or use the autoloader); fields do not bundle it. */
|
|
59
|
+
labelTooltip?: UndTextareaElement['labelTooltip'];
|
|
46
60
|
/** Native `input` from the inner `<textarea>`. `event.isComposing` is true during IME composition. */
|
|
47
61
|
onInput?: (event: UndEvent<InputEvent, UndTextareaElement>) => void;
|
|
48
62
|
/** Native `change`: fires when the value is committed, never in the middle of IME composition. */
|
|
@@ -8,7 +8,7 @@ import type { UndThumbnail as UndThumbnailElement } from '@und-ui/core';
|
|
|
8
8
|
import { type UndEvent } from './shared.js';
|
|
9
9
|
|
|
10
10
|
export interface UndThumbnailProps
|
|
11
|
-
extends Omit<HTMLAttributes<UndThumbnailElement>, 'src' | 'alt' | 'ratio' | 'fit' | 'loading' | 'onUndLoad' | 'onUndError'> {
|
|
11
|
+
extends Omit<HTMLAttributes<UndThumbnailElement>, 'src' | 'alt' | 'ratio' | 'fit' | 'loading' | 'busy' | 'disabled' | 'removable' | 'showRemoveOn' | 'removeLabel' | 'onUndLoad' | 'onUndError' | 'onUndRemove'> {
|
|
12
12
|
/** Image URL. Only http(s), blob, `data:image/...` and relative URLs load. */
|
|
13
13
|
src?: UndThumbnailElement['src'];
|
|
14
14
|
/** Text alternative. Required; `""` marks the image decorative. */
|
|
@@ -19,19 +19,32 @@ export interface UndThumbnailProps
|
|
|
19
19
|
fit?: UndThumbnailElement['fit'];
|
|
20
20
|
/** Image loading strategy. */
|
|
21
21
|
loading?: UndThumbnailElement['loading'];
|
|
22
|
+
/** Shows that the image is uploading or loading: a spinner over the image, or a shimmer while there is no image. Sets `aria-busy` on the host. */
|
|
23
|
+
busy?: UndThumbnailElement['busy'];
|
|
24
|
+
/** Dims the thumbnail and makes the remove button inert. */
|
|
25
|
+
disabled?: UndThumbnailElement['disabled'];
|
|
26
|
+
/** Adds an overlaid remove button that fires `und-remove`. */
|
|
27
|
+
removable?: UndThumbnailElement['removable'];
|
|
28
|
+
/** When the remove button shows: `hover` (on hover and keyboard focus, and always on touch screens) or `always`. */
|
|
29
|
+
showRemoveOn?: UndThumbnailElement['showRemoveOn'];
|
|
30
|
+
/** Accessible name of the remove button (localise it, and name the file, for example "Remove beach.jpg"). */
|
|
31
|
+
removeLabel?: UndThumbnailElement['removeLabel'];
|
|
22
32
|
/** The image loaded. */
|
|
23
33
|
onUndLoad?: (event: UndEvent<CustomEvent<undefined>, UndThumbnailElement>) => void;
|
|
24
34
|
/** The image failed; the fallback is shown. */
|
|
25
35
|
onUndError?: (event: UndEvent<CustomEvent<undefined>, UndThumbnailElement>) => void;
|
|
36
|
+
/** The remove button was pressed (remove the thumbnail yourself). */
|
|
37
|
+
onUndRemove?: (event: UndEvent<CustomEvent<undefined>, UndThumbnailElement>) => void;
|
|
26
38
|
ref?: Ref<UndThumbnailElement>;
|
|
27
39
|
}
|
|
28
40
|
|
|
29
41
|
/** An image with an aspect ratio and a fallback. */
|
|
30
42
|
export function UndThumbnail(props: UndThumbnailProps): ReactElement {
|
|
31
|
-
const { onUndLoad, onUndError, ...rest } = props;
|
|
43
|
+
const { onUndLoad, onUndError, onUndRemove, ...rest } = props;
|
|
32
44
|
return createElement('und-thumbnail', {
|
|
33
45
|
...rest,
|
|
34
46
|
'onund-load': onUndLoad,
|
|
35
47
|
'onund-error': onUndError,
|
|
48
|
+
'onund-remove': onUndRemove,
|
|
36
49
|
});
|
|
37
50
|
}
|
|
@@ -8,7 +8,7 @@ import type { UndTimeInput as UndTimeInputElement } from '@und-ui/core';
|
|
|
8
8
|
import { useControlledProp, type UndEvent } from './shared.js';
|
|
9
9
|
|
|
10
10
|
export interface UndTimeInputProps
|
|
11
|
-
extends Omit<HTMLAttributes<UndTimeInputElement>, 'value' | 'defaultValue' | 'min' | 'max' | 'step' | 'locale' | 'hourCycle' | 'size' | 'readOnly' | 'placeholder' | 'autocomplete' | 'label' | 'description' | 'error' | 'required' | 'optional' | 'disabled' | 'name' | 'onUndChange' | 'onInput' | 'onChange'> {
|
|
11
|
+
extends Omit<HTMLAttributes<UndTimeInputElement>, 'value' | 'defaultValue' | 'min' | 'max' | 'step' | 'locale' | 'hourCycle' | 'size' | 'readOnly' | 'placeholder' | 'autocomplete' | 'label' | 'description' | 'error' | 'required' | 'optional' | 'disabled' | 'name' | 'status' | 'statusMessage' | 'statusVariant' | 'labelHidden' | 'labelTooltip' | 'onUndChange' | 'onInput' | 'onChange'> {
|
|
12
12
|
/** The time, `HH:MM` (24-hour), or empty. */
|
|
13
13
|
value?: UndTimeInputElement['value'];
|
|
14
14
|
/** Value restored on form reset (defaults to the initial `value`). */
|
|
@@ -45,6 +45,16 @@ export interface UndTimeInputProps
|
|
|
45
45
|
disabled?: UndTimeInputElement['disabled'];
|
|
46
46
|
/** Name submitted with the form data. */
|
|
47
47
|
name?: UndTimeInputElement['name'];
|
|
48
|
+
/** Validation status without blocking submission: `warning` or `success` (or `error`, which marks the control invalid like `error` does, without a custom validity message). Colours the border, shows a status icon and the `status-message`. A non-empty `error` always wins. */
|
|
49
|
+
status?: UndTimeInputElement['status'];
|
|
50
|
+
/** Message shown for `status` (announced with a hidden "Warning:" or "Success:" prefix). */
|
|
51
|
+
statusMessage?: UndTimeInputElement['statusMessage'];
|
|
52
|
+
/** Where the status message sits: `attached` (tucked under the bordered control) or `detached` (its own box with an icon). Defaults per control. */
|
|
53
|
+
statusVariant?: UndTimeInputElement['statusVariant'];
|
|
54
|
+
/** Hides the label and description visually; they stay in the accessibility tree (use for search boxes whose icon says enough). */
|
|
55
|
+
labelHidden?: UndTimeInputElement['labelHidden'];
|
|
56
|
+
/** Help text for an info button after the label (an `und-info-tip` named "About {label}"). Register `und-info-tip` yourself (import `@und-ui/core/info-tip.js` or use the autoloader); fields do not bundle it. */
|
|
57
|
+
labelTooltip?: UndTimeInputElement['labelTooltip'];
|
|
48
58
|
/** The time was committed (blur, Enter, or a key step). `value` is `HH:MM`, or empty. */
|
|
49
59
|
onUndChange?: (event: UndEvent<CustomEvent<{ value: string }>, UndTimeInputElement>) => void;
|
|
50
60
|
/** Native input event of the text input. */
|
|
@@ -7,7 +7,7 @@ import '@und-ui/core/timestamp.js';
|
|
|
7
7
|
import type { UndTimestamp as UndTimestampElement } from '@und-ui/core';
|
|
8
8
|
|
|
9
9
|
export interface UndTimestampProps
|
|
10
|
-
extends Omit<HTMLAttributes<UndTimestampElement>, 'datetime' | 'mode' | 'format' | 'dateStyle' | 'timeStyle' | 'relativeStyle' | 'numeric' | 'timeZone' | 'locale'> {
|
|
10
|
+
extends Omit<HTMLAttributes<UndTimestampElement>, 'datetime' | 'mode' | 'format' | 'dateStyle' | 'timeStyle' | 'relativeStyle' | 'numeric' | 'timeZone' | 'locale' | 'type' | 'color'> {
|
|
11
11
|
/** The moment: an ISO 8601 string, a `Date` or epoch milliseconds. */
|
|
12
12
|
datetime?: UndTimestampElement['datetime'];
|
|
13
13
|
/** `absolute` writes the date and time, `relative` writes "3 hours ago" and keeps it current while the element is visible. */
|
|
@@ -26,6 +26,10 @@ export interface UndTimestampProps
|
|
|
26
26
|
timeZone?: UndTimestampElement['timeZone'];
|
|
27
27
|
/** BCP 47 language tag. Default: the `lang` of the page or an ancestor. */
|
|
28
28
|
locale?: UndTimestampElement['locale'];
|
|
29
|
+
/** Text style: `supporting` (12px), `body` (14px) or `inherit` (the surrounding text). */
|
|
30
|
+
type?: UndTimestampElement['type'];
|
|
31
|
+
/** Text colour: `secondary`, `primary` or `inherit`. */
|
|
32
|
+
color?: UndTimestampElement['color'];
|
|
29
33
|
ref?: Ref<UndTimestampElement>;
|
|
30
34
|
}
|
|
31
35
|
|
|
@@ -8,11 +8,13 @@ import type { UndToast as UndToastElement } from '@und-ui/core';
|
|
|
8
8
|
import { type UndEvent } from './shared.js';
|
|
9
9
|
|
|
10
10
|
export interface UndToastProps
|
|
11
|
-
extends Omit<HTMLAttributes<UndToastElement>, 'label' | 'tone' | 'duration' | 'priority' | 'dismissible' | 'closeLabel' | 'onUndDismiss'> {
|
|
11
|
+
extends Omit<HTMLAttributes<UndToastElement>, 'label' | 'tone' | 'variant' | 'duration' | 'priority' | 'dismissible' | 'closeLabel' | 'onUndDismiss'> {
|
|
12
12
|
/** The title. */
|
|
13
13
|
label?: UndToastElement['label'];
|
|
14
14
|
/** Color intent. */
|
|
15
15
|
tone?: UndToastElement['tone'];
|
|
16
|
+
/** Look of the card: `inverted` (default, dark on a light page; `danger` paints it in the danger color) or `surface` (a raised card with a stripe in the tone color). */
|
|
17
|
+
variant?: UndToastElement['variant'];
|
|
16
18
|
/** 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
19
|
duration?: UndToastElement['duration'];
|
|
18
20
|
/** `assertive` interrupts the screen reader; reserve it for errors. */
|
|
@@ -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/toggle-button.js';
|
|
7
|
+
import type { UndToggleButton as UndToggleButtonElement } from '@und-ui/core';
|
|
8
|
+
import { type UndEvent } from './shared.js';
|
|
9
|
+
|
|
10
|
+
export interface UndToggleButtonProps
|
|
11
|
+
extends Omit<HTMLAttributes<UndToggleButtonElement>, 'toggle' | 'variant' | 'tone' | 'size' | 'type' | 'disabled' | 'disabledFocusable' | 'loading' | 'loadingLabel' | 'label' | 'name' | 'value' | 'fullWidth' | 'pressed' | 'href' | 'target' | 'rel' | 'download' | 'command' | 'commandFor' | 'onUndPressedChange'> {
|
|
12
|
+
/** Makes it a toggle button: it exposes `aria-pressed` and flips `pressed` on activation, after a cancelable `und-pressed-change`. */
|
|
13
|
+
toggle?: UndToggleButtonElement['toggle'];
|
|
14
|
+
/** Visual style. */
|
|
15
|
+
variant?: UndToggleButtonElement['variant'];
|
|
16
|
+
/** Color intent. */
|
|
17
|
+
tone?: UndToggleButtonElement['tone'];
|
|
18
|
+
/** Size of the button. */
|
|
19
|
+
size?: UndToggleButtonElement['size'];
|
|
20
|
+
/** Behaviour inside a form, as on a native button. Ignored in link mode. */
|
|
21
|
+
type?: UndToggleButtonElement['type'];
|
|
22
|
+
/** Disables the button. It is removed from the tab order, as natively. */
|
|
23
|
+
disabled?: UndToggleButtonElement['disabled'];
|
|
24
|
+
/** Blocks activation but keeps the button in the tab order (`aria-disabled="true"`), so it can be found and explain why it is unavailable. */
|
|
25
|
+
disabledFocusable?: UndToggleButtonElement['disabledFocusable'];
|
|
26
|
+
/** Shows a spinner, sets `aria-busy` and blocks activation while keeping focus on the button. */
|
|
27
|
+
loading?: UndToggleButtonElement['loading'];
|
|
28
|
+
/** Text announced through a polite live region when `loading` turns on. */
|
|
29
|
+
loadingLabel?: UndToggleButtonElement['loadingLabel'];
|
|
30
|
+
/** Accessible name for icon-only buttons (forwarded as `aria-label` to the inner control). Prefer visible text when you can. */
|
|
31
|
+
label?: UndToggleButtonElement['label'];
|
|
32
|
+
/** Name submitted with the form data when this button submits the form. */
|
|
33
|
+
name?: UndToggleButtonElement['name'];
|
|
34
|
+
/** Value submitted with `name` when this button submits the form. */
|
|
35
|
+
value?: UndToggleButtonElement['value'];
|
|
36
|
+
/** Stretches the button to the inline size of its container. */
|
|
37
|
+
fullWidth?: UndToggleButtonElement['fullWidth'];
|
|
38
|
+
/** Pressed state of a toggle button. Setting it also exposes `aria-pressed`. */
|
|
39
|
+
pressed?: UndToggleButtonElement['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?: UndToggleButtonElement['href'];
|
|
42
|
+
/** Link target (link mode). Any target other than `_self`, `_parent` or `_top` adds `rel="noopener noreferrer"`. */
|
|
43
|
+
target?: UndToggleButtonElement['target'];
|
|
44
|
+
/** Link relationship (link mode). */
|
|
45
|
+
rel?: UndToggleButtonElement['rel'];
|
|
46
|
+
/** Downloads the linked resource, optionally under this file name (link mode). */
|
|
47
|
+
download?: UndToggleButtonElement['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?: UndToggleButtonElement['command'];
|
|
50
|
+
/** Id of the element that `command` acts on, looked up in the button's own tree (document or shadow root). */
|
|
51
|
+
commandFor?: UndToggleButtonElement['commandFor'];
|
|
52
|
+
/** About to change the pressed state. Cancelable. */
|
|
53
|
+
onUndPressedChange?: (event: UndEvent<CustomEvent<{ pressed: boolean }>, UndToggleButtonElement>) => void;
|
|
54
|
+
ref?: Ref<UndToggleButtonElement>;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/** A button with a pressed state. */
|
|
58
|
+
export function UndToggleButton(props: UndToggleButtonProps): ReactElement {
|
|
59
|
+
const { onUndPressedChange, ...rest } = props;
|
|
60
|
+
return createElement('und-toggle-button', {
|
|
61
|
+
...rest,
|
|
62
|
+
'onund-pressed-change': onUndPressedChange,
|
|
63
|
+
});
|
|
64
|
+
}
|