@ultralabs/glass 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/CHANGELOG.md +318 -0
- package/DESIGN.md +682 -0
- package/LICENSE +21 -0
- package/README.md +690 -2
- package/dist/esm/index.js +20872 -0
- package/dist/types/src/charts/ULCartesianChart.d.ts +177 -0
- package/dist/types/src/charts/ULDonutChart.d.ts +65 -0
- package/dist/types/src/charts/ULFunnelChart.d.ts +64 -0
- package/dist/types/src/charts/ULHeatmapChart.d.ts +40 -0
- package/dist/types/src/charts/ULRadarChart.d.ts +19 -0
- package/dist/types/src/charts/ULRadialChart.d.ts +48 -0
- package/dist/types/src/charts/ULScatterChart.d.ts +49 -0
- package/dist/types/src/charts/core.d.ts +287 -0
- package/dist/types/src/charts/decimate.d.ts +8 -0
- package/dist/types/src/charts/nav.d.ts +368 -0
- package/dist/types/src/charts/quadtree.d.ts +9 -0
- package/dist/types/src/charts/scales.d.ts +59 -0
- package/dist/types/src/charts/timeseries.d.ts +56 -0
- package/dist/types/src/components/ULAnchoredSurface/ULAnchoredSurface.d.ts +72 -0
- package/dist/types/src/components/ULBatch2/carousel.d.ts +31 -0
- package/dist/types/src/components/ULBatch2/hovercard.d.ts +40 -0
- package/dist/types/src/components/ULBatch2/layout.d.ts +16 -0
- package/dist/types/src/components/ULBatch2/menubar.d.ts +29 -0
- package/dist/types/src/components/ULBatch2/navmenu.d.ts +51 -0
- package/dist/types/src/components/ULBatch2/resizable.d.ts +48 -0
- package/dist/types/src/components/ULBatch2/typography.d.ts +55 -0
- package/dist/types/src/components/ULButton/ULButton.d.ts +87 -0
- package/dist/types/src/components/ULContainers/ULCard.d.ts +54 -0
- package/dist/types/src/components/ULContainers/ULDialog.d.ts +57 -0
- package/dist/types/src/components/ULContainers/ULLayout.d.ts +81 -0
- package/dist/types/src/components/ULContainers/ULMenu.d.ts +99 -0
- package/dist/types/src/components/ULContainers/ULOverlays.d.ts +113 -0
- package/dist/types/src/components/ULContainers/contextTarget.d.ts +91 -0
- package/dist/types/src/components/ULData/ULData.d.ts +225 -0
- package/dist/types/src/components/ULData/ULKpi.d.ts +159 -0
- package/dist/types/src/components/ULField/ULField.d.ts +93 -0
- package/dist/types/src/components/ULForms/fieldContext.d.ts +39 -0
- package/dist/types/src/components/ULForms/forms.d.ts +143 -0
- package/dist/types/src/components/ULIsland/ULIsland.d.ts +39 -0
- package/dist/types/src/components/ULIsland/headerConfig.d.ts +43 -0
- package/dist/types/src/components/ULIsland/navIndicator.d.ts +26 -0
- package/dist/types/src/components/ULListbox/ULListbox.d.ts +75 -0
- package/dist/types/src/components/ULPickers/ULPickers.d.ts +141 -0
- package/dist/types/src/components/ULSegmented/ULSegmented.d.ts +50 -0
- package/dist/types/src/components/ULSelection/ULSelection.d.ts +71 -0
- package/dist/types/src/components/ULSlider/ULSlider.d.ts +43 -0
- package/dist/types/src/components/ULSpinner/ULSpinner.d.ts +8 -0
- package/dist/types/src/components/ULStructure/kbd.d.ts +22 -0
- package/dist/types/src/components/ULStructure/structure.d.ts +154 -0
- package/dist/types/src/components/ULTabs/ULTabs.d.ts +28 -0
- package/dist/types/src/components/ULTooltip/anchoredTooltip.d.ts +22 -0
- package/dist/types/src/components/actions/actions.d.ts +175 -0
- package/dist/types/src/components/actions/core.d.ts +346 -0
- package/dist/types/src/components/dashboard/blocks.d.ts +583 -0
- package/dist/types/src/components/dashboard/blocks2.d.ts +297 -0
- package/dist/types/src/components/dashboard/columnsDrag.d.ts +27 -0
- package/dist/types/src/components/shared/ULCheckMark.d.ts +9 -0
- package/dist/types/src/components/shared/dev.d.ts +13 -0
- package/dist/types/src/components/shared/icons.d.ts +23 -0
- package/dist/types/src/glass/ULGlass.d.ts +78 -0
- package/dist/types/src/glass/ULGlassGroup.d.ts +16 -0
- package/dist/types/src/glass/accent.d.ts +31 -0
- package/dist/types/src/glass/contrast.d.ts +78 -0
- package/dist/types/src/glass/engine.d.ts +177 -0
- package/dist/types/src/glass/glassDebug.d.ts +27 -0
- package/dist/types/src/glass/material.d.ts +49 -0
- package/dist/types/src/glass/radius.d.ts +2 -0
- package/dist/types/src/hooks/useAnchoredMorph.d.ts +20 -0
- package/dist/types/src/hooks/usePointerLight.d.ts +6 -0
- package/dist/types/src/hooks/useReducedMotion.d.ts +3 -0
- package/dist/types/src/index.d.ts +150 -0
- package/dist/types/src/island/sectionAccent.d.ts +18 -0
- package/dist/types/src/live/ULLiveStatus.d.ts +18 -0
- package/dist/types/src/live/liveQueue.d.ts +13 -0
- package/dist/types/src/live/liveSource.d.ts +149 -0
- package/dist/types/src/live/liveStore.d.ts +72 -0
- package/dist/types/src/motion/anchoredMorph.d.ts +163 -0
- package/dist/types/src/motion/goo.d.ts +3 -0
- package/dist/types/src/motion/lensBubble.d.ts +143 -0
- package/dist/types/src/motion/lensSelect.d.ts +31 -0
- package/dist/types/src/motion/overlayStack.d.ts +13 -0
- package/dist/types/src/motion/placement.d.ts +18 -0
- package/dist/types/src/motion/spring.d.ts +20 -0
- package/dist/types/src/motion/topLayer.d.ts +13 -0
- package/dist/types/src/motion/viewSwap.d.ts +33 -0
- package/dist/types/src/motion/virtualAnchor.d.ts +28 -0
- package/dist/ul-glass.css +10508 -0
- package/dist/ul-glass.js +20915 -0
- package/dist/ul-glass.min.js +14 -0
- package/dist/ul-glass.min.js.map +7 -0
- package/icons/arrow-up-down.svg +5 -0
- package/icons/bell.svg +3 -0
- package/icons/bold.svg +2 -0
- package/icons/calendar.svg +5 -0
- package/icons/check.svg +2 -0
- package/icons/chevron-down.svg +2 -0
- package/icons/chevron-left.svg +2 -0
- package/icons/chevron-right.svg +2 -0
- package/icons/chevrons-right.svg +3 -0
- package/icons/circle-check.svg +3 -0
- package/icons/circle-x.svg +4 -0
- package/icons/circle.svg +2 -0
- package/icons/copy.svg +3 -0
- package/icons/ellipsis.svg +4 -0
- package/icons/eye.svg +3 -0
- package/icons/filter.svg +2 -0
- package/icons/flags/LICENSE.md +2 -0
- package/icons/flags/cs.svg +1 -0
- package/icons/flags/de.svg +1 -0
- package/icons/flags/en.svg +1 -0
- package/icons/flags/sk.svg +1 -0
- package/icons/folder-kanban.svg +5 -0
- package/icons/icons.json +1 -0
- package/icons/inbox.svg +3 -0
- package/icons/info.svg +4 -0
- package/icons/layout-dashboard.svg +5 -0
- package/icons/layout-grid.svg +5 -0
- package/icons/loader-circle.svg +2 -0
- package/icons/lock.svg +3 -0
- package/icons/mail.svg +3 -0
- package/icons/menu.svg +4 -0
- package/icons/minus.svg +2 -0
- package/icons/panel-left-close.svg +4 -0
- package/icons/plus.svg +3 -0
- package/icons/refresh-cw.svg +5 -0
- package/icons/search.svg +3 -0
- package/icons/shield-check.svg +3 -0
- package/icons/shopping-bag.svg +4 -0
- package/icons/sparkles.svg +6 -0
- package/icons/trash-2.svg +6 -0
- package/icons/triangle-alert.svg +4 -0
- package/icons/upload.svg +4 -0
- package/icons/users.svg +5 -0
- package/icons/x.svg +3 -0
- package/package.json +62 -4
- package/tokens/tokens.css +799 -0
- package/tokens/tokens.json +1017 -0
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { type MenuItem } from '../ULContainers/ULMenu.js';
|
|
3
|
+
import { type ContextMenuSpec, type ContextMenuProps } from '../ULContainers/contextTarget.js';
|
|
4
|
+
import { type Accent } from '../../glass/accent.js';
|
|
5
|
+
import type { LiveStore } from '../../live/liveStore.js';
|
|
6
|
+
import './ULData.css';
|
|
7
|
+
export type Tone = 'neutral' | 'accent' | 'success' | 'warning' | 'danger';
|
|
8
|
+
export interface ULBadgeProps extends React.HTMLAttributes<HTMLSpanElement> {
|
|
9
|
+
tone?: Tone; /** "soft" (default) | "solid" | "outline". */
|
|
10
|
+
variant?: 'soft' | 'solid' | 'outline'; /** Leading status dot. Default false. */
|
|
11
|
+
dot?: boolean; /** Size step (see the type). */
|
|
12
|
+
size?: 'sm' | 'md';
|
|
13
|
+
}
|
|
14
|
+
/** Badge. contextMenu target: { component: 'badge', kind: 'self', id }. */
|
|
15
|
+
export declare function ULBadge(props: ULBadgeProps & ContextMenuProps): React.ReactElement<unknown, string | React.JSXElementConstructor<any>>;
|
|
16
|
+
export interface ULAvatarProps extends Omit<React.HTMLAttributes<HTMLSpanElement>, 'children'> {
|
|
17
|
+
name: string; /** Image URL; initials show while loading or on error. */
|
|
18
|
+
src?: string; /** Size step (see the type). */
|
|
19
|
+
size?: 'sm' | 'md' | 'lg'; /** Presence dot: "online" | "away" | "busy" | "offline". */
|
|
20
|
+
status?: 'online' | 'away' | 'busy' | 'offline'; /** Accessible text for the presence dot. Default localised from status. */
|
|
21
|
+
statusLabel?: string;
|
|
22
|
+
}
|
|
23
|
+
/** Avatar. contextMenu target: { component: 'avatar', kind: 'self', id: name }. */
|
|
24
|
+
export declare function ULAvatar(props: ULAvatarProps & ContextMenuProps): React.ReactElement<unknown, string | React.JSXElementConstructor<any>>;
|
|
25
|
+
export interface ULAvatarGroupProps {
|
|
26
|
+
people: {
|
|
27
|
+
name: string;
|
|
28
|
+
src?: string;
|
|
29
|
+
}[]; /** Avatars shown before the "+n" chip. */
|
|
30
|
+
max?: number; /** Size step (see the type). */
|
|
31
|
+
size?: 'sm' | 'md' | 'lg'; /** Visible label / accessible name. */
|
|
32
|
+
label?: string;
|
|
33
|
+
}
|
|
34
|
+
export declare function ULAvatarGroup({ people, max, size, label }: ULAvatarGroupProps): React.JSX.Element;
|
|
35
|
+
export interface ULProgressProps {
|
|
36
|
+
value?: number; /** Maximum value. Default 100. */
|
|
37
|
+
max?: number; /** "bar" (default) | "ring". */
|
|
38
|
+
kind?: 'bar' | 'ring'; /** Visible label / accessible name. */
|
|
39
|
+
label: string; /** Show the formatted value next to the bar / inside the ring. Default true. */
|
|
40
|
+
showValue?: boolean; /** Semantic tone: "neutral" | "accent" | "success" | "warning" | "danger" | "info" (--ul-tone-*). */
|
|
41
|
+
tone?: Tone; /** Ring diameter in px (kind="ring"). */
|
|
42
|
+
size?: number; /** Formats the number for display (Intl options or a function, per prop type). */
|
|
43
|
+
format?: (v: number, max: number) => string;
|
|
44
|
+
}
|
|
45
|
+
export declare function ULProgress({ value, max, kind, label, showValue, tone, size, format }: ULProgressProps): React.JSX.Element;
|
|
46
|
+
export interface ULSkeletonProps {
|
|
47
|
+
shape?: 'text' | 'rect' | 'circle'; /** Number of text lines (shape="text"). Default 1. */
|
|
48
|
+
lines?: number; /** Width (px or CSS length). */
|
|
49
|
+
width?: number | string; /** Height (px or CSS length). */
|
|
50
|
+
height?: number | string; /** Extra class on the root element. */
|
|
51
|
+
className?: string;
|
|
52
|
+
}
|
|
53
|
+
export declare function ULSkeleton({ shape, lines, width, height, className }: ULSkeletonProps): React.JSX.Element;
|
|
54
|
+
export interface ULEmptyStateProps {
|
|
55
|
+
icon?: React.ReactNode; /** Heading. */
|
|
56
|
+
title: React.ReactNode; /** Explanation under the title. */
|
|
57
|
+
description?: React.ReactNode; /** Primary action (button / link). */
|
|
58
|
+
action?: React.ReactNode; /** Size step (see the type). */
|
|
59
|
+
size?: 'sm' | 'md'; /** Heading level of the title: 2 | 3 (default) | 4. */
|
|
60
|
+
level?: 2 | 3 | 4;
|
|
61
|
+
}
|
|
62
|
+
export declare function ULEmptyState({ icon, title, description, action, size, level }: ULEmptyStateProps): React.JSX.Element;
|
|
63
|
+
export interface Crumb {
|
|
64
|
+
label: string;
|
|
65
|
+
href?: string; /** In-app navigation (e.g. treemap drill-up): renders a button. */
|
|
66
|
+
onSelect?: () => void;
|
|
67
|
+
}
|
|
68
|
+
export interface ULBreadcrumbsProps {
|
|
69
|
+
items: Crumb[]; /** Visible label / accessible name. */
|
|
70
|
+
label?: string; /** Collapse the middle into a menu above this count. Default 4. */
|
|
71
|
+
maxItems?: number; /** Accessible label of the collapsed-crumbs button. Default localised. */
|
|
72
|
+
moreLabel?: string; /** Inside a glass panel (chart, card): the hover lens is flat, no second glass surface. */
|
|
73
|
+
embedded?: boolean;
|
|
74
|
+
}
|
|
75
|
+
/** Breadcrumbs. contextMenu target: { component: 'breadcrumbs', kind: 'crumb', id: label, data: Crumb }. */
|
|
76
|
+
export declare function ULBreadcrumbs(props: ULBreadcrumbsProps & ContextMenuProps<Crumb>): React.ReactElement<unknown, string | React.JSXElementConstructor<any>>;
|
|
77
|
+
export interface ULPaginationProps {
|
|
78
|
+
page: number; /** Total number of pages. */
|
|
79
|
+
pageCount: number; /** Called with the new 1-based page. */
|
|
80
|
+
onPageChange: (p: number) => void; /** Pages shown on each side of the current one. Default 1. */
|
|
81
|
+
siblings?: number; /** Visible label / accessible name. */
|
|
82
|
+
label?: string; /** Previous button label. Default "Previous page" (English; pass a translated string). */
|
|
83
|
+
prevLabel?: string; /** Next button label. Default "Next page" (English; pass a translated string). */
|
|
84
|
+
nextLabel?: string; /** Accessible label per page button, e.g. (p) => `Page ${p}`. */
|
|
85
|
+
pageLabel?: (p: number) => string;
|
|
86
|
+
}
|
|
87
|
+
export declare function pageRange(page: number, count: number, sib?: number): (number | '…')[];
|
|
88
|
+
/** Constant slot count (min(count, 5 + 2·sib)) so the segmented indicator glides between stable slots instead of re-mounting. */
|
|
89
|
+
export declare function pageSlots(page: number, count: number, sib?: number): (number | '…')[];
|
|
90
|
+
export declare function ULPagination({ page, pageCount, onPageChange, siblings, label, prevLabel, nextLabel, pageLabel }: ULPaginationProps): React.JSX.Element;
|
|
91
|
+
export interface ULStatTileProps {
|
|
92
|
+
label: string; /** Value to display. */
|
|
93
|
+
value?: number | string; /** Formats the number for display (Intl options or a function, per prop type). */
|
|
94
|
+
format?: (v: number) => string; /** Change versus the previous period (number; sign decides the arrow). */
|
|
95
|
+
delta?: number; /** Formats the delta (default: signed percent). */
|
|
96
|
+
deltaFormat?: (d: number) => string; /** Higher is better (default) or worse (costs, errors). */
|
|
97
|
+
trend?: 'up-good' | 'down-good'; /** Context for the delta (e.g. "vs last week"). */
|
|
98
|
+
deltaLabel?: string; /** Values for the inline sparkline (oldest first). */
|
|
99
|
+
sparkline?: number[]; /** Loading state: skeleton / spinner and aria-busy. Default false. */
|
|
100
|
+
loading?: boolean; /** Text shown when there is no value / data. Default localised. */
|
|
101
|
+
emptyText?: string; /** "calm" (default, flat tint) | "well" (inset). */
|
|
102
|
+
surface?: 'calm' | 'well'; /** Accent colour name or CSS colour (checked by guardAccent). */
|
|
103
|
+
accent?: Accent; /** Interactive tile: lifts 2px, pointer light, one stretched button. */
|
|
104
|
+
onSelect?: () => void;
|
|
105
|
+
}
|
|
106
|
+
/** Stat tile. contextMenu target: { component: 'stat', kind: 'self', data: { label, value, delta } }. */
|
|
107
|
+
export declare function ULStatTile(props: ULStatTileProps & ContextMenuProps<{
|
|
108
|
+
label: string;
|
|
109
|
+
value?: number | string;
|
|
110
|
+
delta?: number;
|
|
111
|
+
}>): React.ReactElement<unknown, string | React.JSXElementConstructor<any>>;
|
|
112
|
+
export interface TableColumn<R> {
|
|
113
|
+
key: string;
|
|
114
|
+
header: React.ReactNode;
|
|
115
|
+
align?: 'start' | 'end' | 'center';
|
|
116
|
+
sortable?: boolean;
|
|
117
|
+
width?: number | string;
|
|
118
|
+
/** Sort / change-detection value (default row[key]). */ value?: (r: R) => string | number;
|
|
119
|
+
render?: (r: R) => React.ReactNode;
|
|
120
|
+
numeric?: boolean;
|
|
121
|
+
/** Number cell that rolls (ULRollingNumber) when the value changes; animates only while the row is in view. */
|
|
122
|
+
roll?: {
|
|
123
|
+
format?: Intl.NumberFormatOptions;
|
|
124
|
+
locale?: string;
|
|
125
|
+
compact?: boolean;
|
|
126
|
+
};
|
|
127
|
+
/** Sticky column (ULColumnsMenu / applyColumns). Offsets come from the widths of the pinned columns before it (default 160px). */
|
|
128
|
+
pin?: 'left' | 'right';
|
|
129
|
+
}
|
|
130
|
+
export type SortState = {
|
|
131
|
+
key: string;
|
|
132
|
+
dir: 'asc' | 'desc';
|
|
133
|
+
} | null;
|
|
134
|
+
export interface TableLiveOptions {
|
|
135
|
+
/** Queue inserts / removes / reorders while the pointer or focus is in the table or a row menu is open. Default true. */
|
|
136
|
+
queue?: boolean;
|
|
137
|
+
/** Cell flash + insert glow. Default true. */
|
|
138
|
+
flash?: boolean;
|
|
139
|
+
/** Summarized, throttled polite announcements ("12 new rows"). Default true. */
|
|
140
|
+
announce?: boolean;
|
|
141
|
+
pendingLabel?: (n: number) => string;
|
|
142
|
+
summary?: (s: {
|
|
143
|
+
inserted: number;
|
|
144
|
+
removed: number;
|
|
145
|
+
}) => string;
|
|
146
|
+
}
|
|
147
|
+
export interface ULTableProps<R> {
|
|
148
|
+
/** Column definitions ({ key, header, cell?, sort?, align?, width?, pin? }). */ columns: TableColumn<R>[];
|
|
149
|
+
/** Static rows (or the latest snapshot). Ignored when `store` is given. */
|
|
150
|
+
rows?: R[];
|
|
151
|
+
/** Live keyed store (useLiveStore): rows re-render individually; the table only re-renders on structure changes. */
|
|
152
|
+
store?: LiveStore<R>;
|
|
153
|
+
/** Stable key per row (selection, live updates, row menus). */ rowKey: (r: R) => string;
|
|
154
|
+
/** Visible label / accessible name. */ label: string;
|
|
155
|
+
/** "compact" | "cozy" (default) | "comfortable" row height. Compact cells are a documented 24px hit-area exception. */ density?: 'compact' | 'cozy' | 'comfortable';
|
|
156
|
+
/** Controlled sort { key, dir } or null. */ sort?: SortState;
|
|
157
|
+
/** Initial sort when uncontrolled. Default null. */ defaultSort?: SortState;
|
|
158
|
+
/** Called with the next sort when a header is activated. */ onSortChange?: (s: SortState) => void;
|
|
159
|
+
/** Applies to live rows too. */
|
|
160
|
+
filter?: (r: R) => boolean;
|
|
161
|
+
/** Adds a checkbox column (row + header select-all). Default false. */ selectable?: boolean;
|
|
162
|
+
/** Controlled selected row keys. */ selected?: string[];
|
|
163
|
+
/** Called with the selected row keys. */ onSelectionChange?: (keys: string[]) => void;
|
|
164
|
+
/** Menu items per row (row actions button and right-click share them). */ rowActions?: (r: R) => MenuItem[];
|
|
165
|
+
/** Called with (item id, row) when a row action is chosen. */ onRowAction?: (id: string, r: R) => void;
|
|
166
|
+
/** Loading state: skeleton / spinner and aria-busy. Default false. */ loading?: boolean;
|
|
167
|
+
/** Skeleton rows while loading. Default 6. */ loadingRows?: number;
|
|
168
|
+
/** Content shown when there are no rows. */ empty?: React.ReactNode;
|
|
169
|
+
/** Sticky header row inside the scroll area. Default true. */ stickyHeader?: boolean;
|
|
170
|
+
/** Max height of the scroll area (px or CSS length). */ maxHeight?: number | string;
|
|
171
|
+
/** Controlled 1-based page (with pageSize). */ page?: number;
|
|
172
|
+
/** Rows per page; enables the pagination footer. */ pageSize?: number;
|
|
173
|
+
/** Called with the new 1-based page. */ onPageChange?: (p: number) => void;
|
|
174
|
+
/** Virtualise rows: { rowHeight, overscan? } (fixed row height). */ virtual?: {
|
|
175
|
+
rowHeight: number;
|
|
176
|
+
overscan?: number;
|
|
177
|
+
};
|
|
178
|
+
/** Live behaviour (on automatically with `store`). */
|
|
179
|
+
live?: TableLiveOptions | boolean;
|
|
180
|
+
/** Extra class on the root element. */ className?: string;
|
|
181
|
+
/** Row context menu (right-click, long-press, ContextMenu key / Shift+F10). Target: kind 'row', id = row key, data = row,
|
|
182
|
+
* selection = the selected keys when the row is selected, else [key]. */
|
|
183
|
+
contextMenu?: ContextMenuSpec<R>;
|
|
184
|
+
/** Header cells: kind 'header', column = column key. */
|
|
185
|
+
contextMenuHeader?: ContextMenuSpec<R>;
|
|
186
|
+
/** Single cells: kind 'cell', column = column key (falls back to the row menu). */
|
|
187
|
+
contextMenuCell?: ContextMenuSpec<R>;
|
|
188
|
+
/** ONE item list for the row-actions button AND the row context menu. */
|
|
189
|
+
rowMenu?: (r: R) => MenuItem[];
|
|
190
|
+
/** Called when a row / header context menu opens. */ onContextMenuOpen?: ContextMenuProps<R>['onContextMenuOpen'];
|
|
191
|
+
/** Called when the context menu closes. */ onContextMenuClose?: ContextMenuProps<R>['onContextMenuClose'];
|
|
192
|
+
/** Called with the chosen context-menu item. */ onContextMenuAction?: ContextMenuProps<R>['onContextMenuAction'];
|
|
193
|
+
/** Let the browser menu show (no custom context menu). Default false. */ contextMenuNative?: ContextMenuProps<R>['contextMenuNative'];
|
|
194
|
+
/** Bulk-action mode: while rows are selected, structural live changes queue (selected rows never move or vanish under the bulk bar). */
|
|
195
|
+
pinSelection?: boolean;
|
|
196
|
+
}
|
|
197
|
+
export declare function ULTable<R>({ columns, rows, store, rowKey, label, density, sort, defaultSort, onSortChange, filter, selectable, selected, onSelectionChange, rowActions, onRowAction, loading, loadingRows, empty, stickyHeader, maxHeight, page, pageSize, onPageChange, virtual, live, className, contextMenu, contextMenuHeader, contextMenuCell, rowMenu, onContextMenuOpen, onContextMenuClose, onContextMenuAction, contextMenuNative, pinSelection }: ULTableProps<R>): React.JSX.Element;
|
|
198
|
+
export interface ChartSeries {
|
|
199
|
+
name: string;
|
|
200
|
+
data: number[];
|
|
201
|
+
}
|
|
202
|
+
export interface ULChartProps {
|
|
203
|
+
/** "line" | "area" | "bar". */ kind?: 'line' | 'area' | 'bar';
|
|
204
|
+
/** Series ({ name, values }). */ series: ChartSeries[];
|
|
205
|
+
/** Category labels (x axis). */ labels: string[];
|
|
206
|
+
/** Heading. */ title: string;
|
|
207
|
+
/** Text summary for screen readers. */ summary?: string;
|
|
208
|
+
/** Plot height in px. */ height?: number;
|
|
209
|
+
/** Formats the number for display (Intl options or a function, per prop type). */ format?: (v: number) => string;
|
|
210
|
+
/** Show the data table toggle. Default true. */ showTable?: boolean;
|
|
211
|
+
/** Accent colour name or CSS colour (checked by guardAccent). */ accent?: Accent;
|
|
212
|
+
/** Render inside its own lite glass panel. Default true (pass false when the chart already sits in a panel). */
|
|
213
|
+
panel?: boolean;
|
|
214
|
+
/** Extra class on the root element. */ className?: string;
|
|
215
|
+
}
|
|
216
|
+
/** Chart context-menu payload: the data point under the pointer, a legend series, or the plot background. */
|
|
217
|
+
export interface ChartTargetData {
|
|
218
|
+
index?: number;
|
|
219
|
+
label?: string;
|
|
220
|
+
values?: {
|
|
221
|
+
series: string;
|
|
222
|
+
value: number;
|
|
223
|
+
}[];
|
|
224
|
+
series?: string;
|
|
225
|
+
}
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { type Accent } from '../../glass/accent.js';
|
|
3
|
+
import { type ContextMenuProps } from '../ULContainers/contextTarget.js';
|
|
4
|
+
import './ULKpi.css';
|
|
5
|
+
export declare const resolveLocale: (l?: string) => string;
|
|
6
|
+
export declare function numberFormat(locale?: string, o?: Intl.NumberFormatOptions, compact?: boolean): Intl.NumberFormat;
|
|
7
|
+
export interface ULRollingNumberProps {
|
|
8
|
+
/** Number to show; digit cells roll on change (one glyph per cell at rest). */ value: number | null | undefined;
|
|
9
|
+
/** Intl.NumberFormat options (currency, percent, compact…). */ format?: Intl.NumberFormatOptions;
|
|
10
|
+
/** en | sk | de | cs or any BCP 47 tag. Default: the KPI grid context locale, else "en". */
|
|
11
|
+
locale?: string;
|
|
12
|
+
/** 12.4k notation. */
|
|
13
|
+
compact?: boolean;
|
|
14
|
+
/** Animate changes (false or a function returning false = jump; tables pass "row in view"). Default true. */
|
|
15
|
+
animate?: boolean | (() => boolean);
|
|
16
|
+
/** Staggered roll from zero on mount (once). Default true. */
|
|
17
|
+
reveal?: boolean;
|
|
18
|
+
/** Polite live announcements, throttled to --ul-kpi-announce-gap. Default false (the card / table summarizes). */
|
|
19
|
+
announce?: boolean;
|
|
20
|
+
/** Screen-reader prefix, e.g. "Revenue". */
|
|
21
|
+
label?: string;
|
|
22
|
+
/** Text for null / undefined. */
|
|
23
|
+
placeholder?: string;
|
|
24
|
+
/** Extra class on the root element. */ className?: string;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Every digit is a vertical reel (one text node per reel) that rolls to the new digit; the direction follows the change.
|
|
28
|
+
* Only changed digits roll, staggered (--ul-kpi-roll-order right | left), with a soft blur and a small elastic settle.
|
|
29
|
+
* Digit count changes animate the width per character (no layout jump). More than --ul-kpi-rate-threshold updates per
|
|
30
|
+
* second switch to a coalesced mode (≤ 1 roll per --ul-kpi-coalesce, to the latest value). Reduced motion: crossfade.
|
|
31
|
+
* Screen readers get the formatted final value as text; the reels are aria-hidden.
|
|
32
|
+
*/
|
|
33
|
+
export declare function ULRollingNumber({ value, format, locale, compact, animate, reveal, announce, label, placeholder, className }: ULRollingNumberProps): React.JSX.Element;
|
|
34
|
+
export interface ULKpiDeltaProps {
|
|
35
|
+
/** Change in percent (7.8 = +7.8 %) or absolute when `format` says so. */
|
|
36
|
+
value: number | null | undefined;
|
|
37
|
+
/** Formats the number for display (Intl options or a function, per prop type). */ format?: Intl.NumberFormatOptions;
|
|
38
|
+
/** "en" | "sk" | "de" | "cs" for built-in strings, numbers and dates. Default: the KPI grid context locale, else "en". */ locale?: string;
|
|
39
|
+
/** Which direction is good: up (revenue) or down (latency, errors, costs). Default up. */
|
|
40
|
+
goodDirection?: 'up' | 'down';
|
|
41
|
+
/** "vs previous period" — visible after the capsule and read by screen readers. */
|
|
42
|
+
context?: string;
|
|
43
|
+
/** Animate changes (respects reduced motion). Default true. */ animate?: boolean | (() => boolean);
|
|
44
|
+
/** Accessible text for a rise. Default "Up" (English; pass a translated string). */ upLabel?: string; /** Accessible text for a fall. Default "Down" (English; pass a translated string). */
|
|
45
|
+
downLabel?: string;
|
|
46
|
+
}
|
|
47
|
+
export declare function ULKpiDelta({ value, format, locale, goodDirection, context, animate, upLabel, downLabel }: ULKpiDeltaProps): React.JSX.Element | null;
|
|
48
|
+
export interface ULSparklineProps {
|
|
49
|
+
data: number[]; /** Width in px. */
|
|
50
|
+
width?: number; /** Height in px. */
|
|
51
|
+
height?: number; /** Fill under the line. Default true. */
|
|
52
|
+
area?: boolean; /** Bead on the last point. Default true. */
|
|
53
|
+
bead?: boolean; /** Extra class on the root element. */
|
|
54
|
+
className?: string; /** Animate changes (respects reduced motion). Default true. */
|
|
55
|
+
animate?: boolean;
|
|
56
|
+
}
|
|
57
|
+
/** Draws in on mount; appended points slide in from the right; the end bead (flattened lens) pulses on new data. aria-hidden: the card states the value. */
|
|
58
|
+
export declare function ULSparkline({ data, width, height, area, bead, className, animate }: ULSparklineProps): React.JSX.Element | null;
|
|
59
|
+
export interface ULKpiGoalProps {
|
|
60
|
+
value: number; /** Goal value; progress = value / target. */
|
|
61
|
+
target: number; /** Visible label / accessible name. */
|
|
62
|
+
label?: string; /** Formats the number for display (Intl options or a function, per prop type). */
|
|
63
|
+
format?: (v: number) => string;
|
|
64
|
+
}
|
|
65
|
+
export declare function ULKpiGoal({ value, target, label, format }: ULKpiGoalProps): React.JSX.Element;
|
|
66
|
+
type KpiState = 'ready' | 'loading' | 'empty' | 'error';
|
|
67
|
+
export interface ULKpiCardProps {
|
|
68
|
+
/** "simple" (default) | "sparkline" | "progress". */ variant?: 'simple' | 'sparkline' | 'progress' | 'comparison' | 'target';
|
|
69
|
+
/** "md" (default) | "hero". */ size?: 'md' | 'hero';
|
|
70
|
+
/** "ready" | "loading" | "empty" | "error" | "stale". */ state?: KpiState;
|
|
71
|
+
/** Text shown when there is no value / data. Default localised. */ emptyText?: string;
|
|
72
|
+
/** Error text (state="error"). Default localised. */ errorText?: string;
|
|
73
|
+
/** Shows a Retry action; called when it is pressed. */ onRetry?: () => void;
|
|
74
|
+
/** Retry button label. Default localised. */ retryLabel?: string;
|
|
75
|
+
/** "en" | "sk" | "de" | "cs" for built-in strings, numbers and dates. Default: the KPI grid context locale, else "en". */ locale?: string;
|
|
76
|
+
/** Accent colour name or CSS colour (checked by guardAccent). */ accent?: Accent;
|
|
77
|
+
/** Interactive tile: lifts 2px on hover with pointer light; the label becomes a button / link stretched over the card. */
|
|
78
|
+
onSelect?: () => void;
|
|
79
|
+
/** Makes the whole card a link (one link, actions above it). */ href?: string;
|
|
80
|
+
/** Pass false (or a function) to stop number animations (e.g. off-screen). */
|
|
81
|
+
animate?: boolean | (() => boolean);
|
|
82
|
+
/** Visible label / accessible name. */ label?: React.ReactNode;
|
|
83
|
+
/** Value to display. */ value?: number | null;
|
|
84
|
+
/** Formats the number for display (Intl options or a function, per prop type). */ format?: Intl.NumberFormatOptions;
|
|
85
|
+
/** Compact number notation (12.3k). Default false. */ compact?: boolean;
|
|
86
|
+
/** Change versus the previous period (number; sign decides the arrow). */ delta?: number | null;
|
|
87
|
+
/** Context for the delta (e.g. "vs last month"). */ deltaContext?: string;
|
|
88
|
+
/** Which direction is good: "up" (default) | "down" (colours the delta). */ goodDirection?: 'up' | 'down';
|
|
89
|
+
/** Values for the inline sparkline (oldest first). */ sparkline?: number[];
|
|
90
|
+
/** Custom trend (e.g. <ULSparkChart variant="bars" />); replaces the default sparkline. */
|
|
91
|
+
trend?: React.ReactNode;
|
|
92
|
+
/** Progress variant data { value, max }. */ progress?: {
|
|
93
|
+
value: number;
|
|
94
|
+
max?: number;
|
|
95
|
+
label?: string;
|
|
96
|
+
};
|
|
97
|
+
/** Previous-period value shown as context. */ previous?: number | null;
|
|
98
|
+
/** Label for the previous value. Default "Previous period" (English; pass a translated string). */ previousLabel?: string;
|
|
99
|
+
/** Target value shown as context. */ target?: number;
|
|
100
|
+
/** Label for the target. Default "Goal" (English; pass a translated string). */ targetLabel?: string;
|
|
101
|
+
/** Decorative icon next to the label. */ icon?: React.ReactNode;
|
|
102
|
+
/** Live value: rolling updates, flash on change, rate-limited announcements. Default false. */ live?: boolean;
|
|
103
|
+
/** Last update time (ms epoch) for "updated n ago" and staleness. */ updatedAt?: number;
|
|
104
|
+
/** Mark stale after this many ms without updates. Default --ul-kpi-stale-after. */ staleAfter?: number;
|
|
105
|
+
/** Content. */ children?: React.ReactNode;
|
|
106
|
+
/** Extra class on the root element. */ className?: string;
|
|
107
|
+
}
|
|
108
|
+
/** contextMenu target: { component: 'kpi', kind: 'self', data: { label, value, delta, state } }. */
|
|
109
|
+
declare function CardCtx(props: ULKpiCardProps & ContextMenuProps<{
|
|
110
|
+
label?: React.ReactNode;
|
|
111
|
+
value?: number | null;
|
|
112
|
+
delta?: number | null;
|
|
113
|
+
state?: string;
|
|
114
|
+
}>): React.ReactElement<unknown, string | React.JSXElementConstructor<any>>;
|
|
115
|
+
/** KPI card with compound slots: ULKpiCard.Label / Value / Delta / Trend / Footer / Icon / Actions / Status. */
|
|
116
|
+
export declare const ULKpiCard: typeof CardCtx & {
|
|
117
|
+
Label: (p: {
|
|
118
|
+
children?: React.ReactNode;
|
|
119
|
+
id?: string;
|
|
120
|
+
}) => React.ReactElement | null;
|
|
121
|
+
Value: (p: {
|
|
122
|
+
value?: number | null;
|
|
123
|
+
format?: Intl.NumberFormatOptions;
|
|
124
|
+
compact?: boolean;
|
|
125
|
+
locale?: string;
|
|
126
|
+
label?: string;
|
|
127
|
+
children?: React.ReactNode;
|
|
128
|
+
}) => React.ReactElement | null;
|
|
129
|
+
Delta: (p: ULKpiDeltaProps) => React.ReactElement | null;
|
|
130
|
+
Trend: (p: {
|
|
131
|
+
children?: React.ReactNode;
|
|
132
|
+
}) => React.ReactElement | null;
|
|
133
|
+
Footer: (p: {
|
|
134
|
+
children?: React.ReactNode;
|
|
135
|
+
}) => React.ReactElement | null;
|
|
136
|
+
Icon: (p: {
|
|
137
|
+
children?: React.ReactNode;
|
|
138
|
+
}) => React.ReactElement | null;
|
|
139
|
+
Actions: (p: {
|
|
140
|
+
children?: React.ReactNode;
|
|
141
|
+
}) => React.ReactElement | null;
|
|
142
|
+
Status: (p: {
|
|
143
|
+
live?: boolean;
|
|
144
|
+
updatedAt?: number;
|
|
145
|
+
staleAfter?: number;
|
|
146
|
+
liveLabel?: string;
|
|
147
|
+
staleLabel?: string;
|
|
148
|
+
}) => React.ReactElement | null;
|
|
149
|
+
};
|
|
150
|
+
export interface ULKpiGridProps {
|
|
151
|
+
children?: React.ReactNode; /** Minimum card width before wrapping (px or CSS length). */
|
|
152
|
+
minWidth?: number | string; /** Gap between cards (px or CSS length). */
|
|
153
|
+
gap?: number | string; /** Visible label / accessible name. */
|
|
154
|
+
label?: string; /** Extra class on the root element. */
|
|
155
|
+
className?: string;
|
|
156
|
+
}
|
|
157
|
+
/** Responsive columns (auto-fill, min --ul-kpi-min-w); hero cards span two columns when there is room. No drag-to-reorder (not cheap enough without a layout engine; skipped). */
|
|
158
|
+
export declare function ULKpiGrid({ children, minWidth, gap, label, className }: ULKpiGridProps): React.JSX.Element;
|
|
159
|
+
export {};
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import type { ForceState } from '../ULButton/ULButton.js';
|
|
3
|
+
import './ULField.css';
|
|
4
|
+
import { type ContextMenuProps } from '../ULContainers/contextTarget.js';
|
|
5
|
+
import { type Material } from '../../glass/material.js';
|
|
6
|
+
export interface FieldBaseProps {
|
|
7
|
+
/** Visible label (required for a11y unless the field sits in ULField, which owns the label). Floats into the well by default. */
|
|
8
|
+
label: string;
|
|
9
|
+
/** false = label above the well. Default true. */
|
|
10
|
+
floating?: boolean;
|
|
11
|
+
/** Help text under the control (aria-describedby). */ helper?: React.ReactNode;
|
|
12
|
+
/** Error message. Sets aria-invalid and replaces the helper. */
|
|
13
|
+
error?: React.ReactNode;
|
|
14
|
+
/** Element before the input (icon, prefix). Decorative icons are aria-hidden. */ leading?: React.ReactNode;
|
|
15
|
+
/** Element after the input (icon, unit, button). */ trailing?: React.ReactNode;
|
|
16
|
+
/** md 56 (default) or compact 44. */
|
|
17
|
+
size?: 'md' | 'compact';
|
|
18
|
+
/** "rounded" (default) | "capsule". */ shape?: 'rounded' | 'capsule';
|
|
19
|
+
/** Shows a spinner and sets aria-busy; the control stays focusable. Default false. */ loading?: boolean;
|
|
20
|
+
/** Disables the control (not focusable, dimmed). Default false. */ disabled?: boolean;
|
|
21
|
+
/** Marks the control required (aria-required, required marker in the label). Default false. */ required?: boolean;
|
|
22
|
+
/** Id of the control (labels and messages are linked to it). Default: generated. */ id?: string;
|
|
23
|
+
/** Extra class on the root element. */ className?: string;
|
|
24
|
+
/** Inline style on the root element. */ style?: React.CSSProperties;
|
|
25
|
+
/** "flat" | "glass" (inputs category). Flat well: no pointer light. Omit to resolve from ULProvider. @default undefined (resolved: "flat") */
|
|
26
|
+
material?: Material;
|
|
27
|
+
/** @internal */
|
|
28
|
+
forceState?: ForceState;
|
|
29
|
+
}
|
|
30
|
+
export interface ULTextFieldProps extends FieldBaseProps, Omit<React.InputHTMLAttributes<HTMLInputElement>, 'size' | 'type' | 'id' | 'className' | 'style' | 'disabled' | 'required'> {
|
|
31
|
+
/** Native input type: "text" (default) | "email" | "password" (adds a reveal button) | "search" (adds a clear button, Esc clears) | "url" | "tel". */ type?: 'text' | 'email' | 'password' | 'search' | 'url' | 'tel';
|
|
32
|
+
/** Called with the new string on every input. The native onChange event is still forwarded (documented native wrapper). */ onValueChange?: (value: string) => void;
|
|
33
|
+
/** Search only: collapsed width (--ul-field-search-w) until focused or filled. */
|
|
34
|
+
expandOnFocus?: boolean;
|
|
35
|
+
/** Accessible label of the password reveal button. Default "Show password". */ revealLabel?: string;
|
|
36
|
+
/** Accessible label of the password hide button. Default "Hide password". */ hideLabel?: string;
|
|
37
|
+
/** Accessible label of the search clear button. Default "Clear search". */ clearLabel?: string;
|
|
38
|
+
}
|
|
39
|
+
export declare const ULTextField: React.ForwardRefExoticComponent<ULTextFieldProps & React.RefAttributes<HTMLInputElement>>;
|
|
40
|
+
export interface ULTextAreaProps extends FieldBaseProps, Omit<React.TextareaHTMLAttributes<HTMLTextAreaElement>, 'id' | 'className' | 'style' | 'disabled' | 'required'> {
|
|
41
|
+
/** Called with the new string on every input. The native onChange event is still forwarded. */ onValueChange?: (value: string) => void;
|
|
42
|
+
/** Default 3. */
|
|
43
|
+
minRows?: number;
|
|
44
|
+
/** Then it scrolls. Default 10. */
|
|
45
|
+
maxRows?: number;
|
|
46
|
+
}
|
|
47
|
+
export declare const ULTextArea: React.ForwardRefExoticComponent<ULTextAreaProps & React.RefAttributes<HTMLTextAreaElement>>;
|
|
48
|
+
export interface ULNumberFieldProps extends FieldBaseProps {
|
|
49
|
+
/** Controlled value; null = empty. */ value?: number | null;
|
|
50
|
+
/** Initial value when uncontrolled; null = empty. */ defaultValue?: number | null;
|
|
51
|
+
/** Called with the parsed number (or null) when the text is committed (blur, Enter, steppers, arrows). */ onValueChange?: (value: number | null) => void;
|
|
52
|
+
/** Earliest / lowest allowed value. */ min?: number;
|
|
53
|
+
/** Latest / highest allowed value. */ max?: number;
|
|
54
|
+
/** Default 1. PageUp/PageDown move 10 steps. */
|
|
55
|
+
step?: number;
|
|
56
|
+
/** Display format (Intl). Default: plain number in the document locale. */
|
|
57
|
+
format?: Intl.NumberFormatOptions;
|
|
58
|
+
/** Number format locale ("en" | "sk" | "de" | "cs"); parsing accepts both separators. Default "en". */ locale?: string;
|
|
59
|
+
/** Accessible label of the − stepper. Default "Decrease". */ decrementLabel?: string;
|
|
60
|
+
/** Accessible label of the + stepper. Default "Increase". */ incrementLabel?: string;
|
|
61
|
+
/** Form field name (native form submission). */ name?: string;
|
|
62
|
+
}
|
|
63
|
+
export declare function ULNumberField(props: ULNumberFieldProps): React.JSX.Element;
|
|
64
|
+
export interface ULOtpFieldProps extends Omit<FieldBaseProps, 'floating' | 'leading' | 'trailing' | 'shape'> {
|
|
65
|
+
/** Default 6. */
|
|
66
|
+
length?: number;
|
|
67
|
+
/** Controlled code (string of digits / characters). */ value?: string;
|
|
68
|
+
/** Initial code when uncontrolled. */ defaultValue?: string;
|
|
69
|
+
/** Called with the whole code on every change (paste fills all cells). */ onValueChange?: (value: string) => void;
|
|
70
|
+
/** Called once all boxes are filled. */
|
|
71
|
+
onComplete?: (value: string) => void;
|
|
72
|
+
/** Default numeric. */
|
|
73
|
+
mode?: 'numeric' | 'alphanumeric';
|
|
74
|
+
/** aria-label per box, {n} and {total} are replaced. */
|
|
75
|
+
boxLabel?: string;
|
|
76
|
+
}
|
|
77
|
+
export declare function ULOtpField(props: ULOtpFieldProps): React.JSX.Element;
|
|
78
|
+
export interface ULTagFieldProps extends FieldBaseProps {
|
|
79
|
+
/** Controlled tag list. */ value?: string[];
|
|
80
|
+
/** Initial tags when uncontrolled. */ defaultValue?: string[];
|
|
81
|
+
/** Called with the next tag list (add on Enter / separator, remove on × or Backspace). */ onValueChange?: (tags: string[]) => void;
|
|
82
|
+
/** Placeholder shown while empty. */ placeholder?: string;
|
|
83
|
+
/** Characters (besides Enter) that commit a tag. Default [',']. */
|
|
84
|
+
separators?: string[];
|
|
85
|
+
/** Maximum number of tags; further input is ignored and announced. */ maxTags?: number;
|
|
86
|
+
/** Return false to reject a tag. */
|
|
87
|
+
validate?: (tag: string) => boolean;
|
|
88
|
+
/** Accessible label of a tag's remove button; "{tag}" is replaced. Default "Remove {tag}" (English; pass a translated string). */ removeLabel?: string;
|
|
89
|
+
/** Polite announcement after adding; "{tag}" is replaced. Default "{tag} added" (English; pass a translated string). */ addedText?: string;
|
|
90
|
+
/** Polite announcement after removing; "{tag}" is replaced. Default "{tag} removed" (English; pass a translated string). */ removedText?: string;
|
|
91
|
+
}
|
|
92
|
+
/** Tags: contextMenu target { component: 'tagfield', kind: 'tag', id: tag text } (tags only; the input keeps the native menu). */
|
|
93
|
+
export declare function ULTagField(props: ULTagFieldProps & ContextMenuProps<string>): React.JSX.Element;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
/** ULField → control wiring (ids + aria). Controls read it; ULField owns the label, description and error. */
|
|
3
|
+
export interface FieldCtxValue {
|
|
4
|
+
id: string;
|
|
5
|
+
labelId: string;
|
|
6
|
+
descId?: string;
|
|
7
|
+
errId?: string;
|
|
8
|
+
invalid: boolean;
|
|
9
|
+
required: boolean;
|
|
10
|
+
disabled: boolean;
|
|
11
|
+
/** space-separated ids for aria-describedby (description, addons, counter, error) */
|
|
12
|
+
describedBy?: string;
|
|
13
|
+
}
|
|
14
|
+
export declare const FieldCtx: React.Context<FieldCtxValue | null>;
|
|
15
|
+
export declare const useFieldCtx: () => FieldCtxValue | null;
|
|
16
|
+
/** ULInputGroup → inner control. The group owns the one well; inner controls drop their own well chrome. */
|
|
17
|
+
export interface InputGroupCtxValue {
|
|
18
|
+
/** inner control reports its current text (clear button, counter) */
|
|
19
|
+
report: (value: string) => void;
|
|
20
|
+
/** inner control registers how to clear itself + its focus target */
|
|
21
|
+
register: (api: {
|
|
22
|
+
clear: () => void;
|
|
23
|
+
focus: () => void;
|
|
24
|
+
} | null) => void;
|
|
25
|
+
extraDescribedBy?: string;
|
|
26
|
+
maxLength?: number;
|
|
27
|
+
}
|
|
28
|
+
export declare const InputGroupCtx: React.Context<InputGroupCtxValue | null>;
|
|
29
|
+
export declare const useInputGroupCtx: () => InputGroupCtxValue | null;
|
|
30
|
+
/** aria attributes for a control inside ULField / ULInputGroup (merged with the control's own). */
|
|
31
|
+
export declare function fieldAria(ctx: FieldCtxValue | null, group: InputGroupCtxValue | null, own?: {
|
|
32
|
+
describedBy?: string;
|
|
33
|
+
invalid?: boolean;
|
|
34
|
+
}): {
|
|
35
|
+
readonly 'aria-describedby': string | undefined;
|
|
36
|
+
readonly 'aria-invalid': true | undefined;
|
|
37
|
+
readonly 'aria-errormessage': string | undefined;
|
|
38
|
+
readonly 'aria-required': true | undefined;
|
|
39
|
+
};
|