@ceebee/ui 0.3.3 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client.d.ts +140 -20
- package/dist/client.js +443 -159
- package/dist/index.d.ts +58 -10
- package/dist/index.js +78 -18
- package/dist/styles.css +569 -249
- package/package.json +6 -6
package/dist/client.d.ts
CHANGED
|
@@ -148,7 +148,7 @@ interface TextInputProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'si
|
|
|
148
148
|
/** Marks invalid when used outside a Field; inside one, the Field decides. */
|
|
149
149
|
invalid?: boolean;
|
|
150
150
|
}
|
|
151
|
-
declare const
|
|
151
|
+
declare const Input: react.ForwardRefExoticComponent<TextInputProps & react.RefAttributes<HTMLInputElement>>;
|
|
152
152
|
interface TextareaProps extends TextareaHTMLAttributes<HTMLTextAreaElement> {
|
|
153
153
|
invalid?: boolean;
|
|
154
154
|
}
|
|
@@ -208,10 +208,18 @@ interface RadioGroupProps<T extends string = string> {
|
|
|
208
208
|
/** Names the group for assistive technology when it is not inside a Field. */
|
|
209
209
|
label?: string;
|
|
210
210
|
direction?: 'column' | 'row';
|
|
211
|
+
/**
|
|
212
|
+
* `segmented` draws the group as one track of adjoining cells instead of a
|
|
213
|
+
* list of dots. Appearance and geometry only — the role, the keyboard, and
|
|
214
|
+
* the value it reports are a radiogroup's either way (ADR 0014). Reach for it
|
|
215
|
+
* where the options are few enough to show at once, which is where a dropdown
|
|
216
|
+
* is the wrong control anyway.
|
|
217
|
+
*/
|
|
218
|
+
variant?: 'list' | 'segmented';
|
|
211
219
|
disabled?: boolean;
|
|
212
220
|
className?: string;
|
|
213
221
|
}
|
|
214
|
-
declare function RadioGroup<T extends string = string>({ options, value, defaultValue, onValueChange, name, label, direction, disabled, className, }: RadioGroupProps<T>): react.JSX.Element;
|
|
222
|
+
declare function RadioGroup<T extends string = string>({ options, value, defaultValue, onValueChange, name, label, direction, variant, disabled, className, }: RadioGroupProps<T>): react.JSX.Element;
|
|
215
223
|
interface SwitchProps {
|
|
216
224
|
label: ReactNode;
|
|
217
225
|
checked?: boolean;
|
|
@@ -231,26 +239,48 @@ interface ComboboxOption {
|
|
|
231
239
|
value: string;
|
|
232
240
|
label: string;
|
|
233
241
|
description?: ReactNode;
|
|
242
|
+
disabled?: boolean;
|
|
234
243
|
}
|
|
244
|
+
/**
|
|
245
|
+
* Fetches the options for a query. Receiving one puts the AutoComplete in async mode:
|
|
246
|
+
* the built-in match is switched off, because whatever answered the query has
|
|
247
|
+
* already decided what matches and filtering the reply again would drop rows whose
|
|
248
|
+
* label does not happen to contain what was typed.
|
|
249
|
+
*
|
|
250
|
+
* The `signal` aborts when a newer query supersedes this one. Replies are also
|
|
251
|
+
* discarded by sequence, so a slow "a" landing after a fast "abc" cannot overwrite
|
|
252
|
+
* the newer list — the failure that makes an async picker show the wrong rows.
|
|
253
|
+
*/
|
|
254
|
+
type ComboboxLoader = (query: string, signal: AbortSignal) => Promise<ComboboxOption[]>;
|
|
235
255
|
interface ComboboxProps {
|
|
236
|
-
|
|
256
|
+
/** The whole list, filtered in the browser. Omit when `loadItems` is given. */
|
|
257
|
+
items?: ComboboxOption[];
|
|
258
|
+
/** Asks somewhere else for the options instead of holding them all (ADR 0006). */
|
|
259
|
+
loadItems?: ComboboxLoader;
|
|
260
|
+
/** How long typing has to stop before `loadItems` is asked. */
|
|
261
|
+
loadDelay?: number;
|
|
237
262
|
value?: string | null;
|
|
238
263
|
defaultValue?: string | null;
|
|
239
264
|
onValueChange?: (value: string | null) => void;
|
|
240
265
|
placeholder?: string;
|
|
241
266
|
/** Shown when the query matches nothing. */
|
|
242
267
|
emptyMessage?: ReactNode;
|
|
268
|
+
/** Shown while `loadItems` is outstanding. */
|
|
269
|
+
loadingMessage?: ReactNode;
|
|
270
|
+
/** Shown when `loadItems` rejects. */
|
|
271
|
+
errorMessage?: ReactNode;
|
|
243
272
|
size?: Size;
|
|
244
273
|
disabled?: boolean;
|
|
245
274
|
invalid?: boolean;
|
|
246
275
|
name?: string;
|
|
276
|
+
id?: string;
|
|
247
277
|
className?: string;
|
|
248
278
|
}
|
|
249
279
|
/**
|
|
250
280
|
* A Select you can type into. Reach for it past roughly a dozen options — below that, scanning a
|
|
251
281
|
* list is faster than typing, and Select is the simpler component.
|
|
252
282
|
*/
|
|
253
|
-
declare function
|
|
283
|
+
declare function AutoComplete({ items, loadItems, loadDelay, value, defaultValue, onValueChange, placeholder, emptyMessage, loadingMessage, errorMessage, size, disabled, invalid, name, id, className, }: ComboboxProps): react.JSX.Element;
|
|
254
284
|
|
|
255
285
|
interface DateInputProps {
|
|
256
286
|
value?: Date | null;
|
|
@@ -271,7 +301,7 @@ interface DateInputProps {
|
|
|
271
301
|
* Typing and picking, both. Typing is what fast people do and what a date of birth needs; the
|
|
272
302
|
* calendar is for "the second Tuesday" questions a text field cannot answer.
|
|
273
303
|
*/
|
|
274
|
-
declare function
|
|
304
|
+
declare function DatePicker({ value, defaultValue, onValueChange, min, max, format, weekStartsOn, size, disabled, invalid, placeholder, className, }: DateInputProps): react.JSX.Element;
|
|
275
305
|
|
|
276
306
|
/** Date arithmetic for the picker. Pure, and dealing only in local calendar days. */
|
|
277
307
|
interface DayCell {
|
|
@@ -325,10 +355,10 @@ interface TimeInputProps {
|
|
|
325
355
|
className?: string;
|
|
326
356
|
}
|
|
327
357
|
/**
|
|
328
|
-
* The
|
|
358
|
+
* The DatePicker's sibling. Typing accepts what people actually type — `9`, `0930`, `9:30`,
|
|
329
359
|
* `9pm` — and the list is a convenience on top, never the only way to answer.
|
|
330
360
|
*/
|
|
331
|
-
declare function
|
|
361
|
+
declare function TimePicker({ value, defaultValue, onValueChange, min, max, step, size, disabled, invalid, placeholder, className, }: TimeInputProps): react.JSX.Element;
|
|
332
362
|
|
|
333
363
|
/** File acceptance rules, kept pure: what gets rejected and why is worth asserting. */
|
|
334
364
|
interface FileRules {
|
|
@@ -355,7 +385,7 @@ declare function partitionFiles(incoming: File[], existing: File[], rules: FileR
|
|
|
355
385
|
/** The " — PDF up to 5 MB" tail under the drop zone. Empty when there is nothing to say. */
|
|
356
386
|
declare function describeAccept(rules: FileRules): string;
|
|
357
387
|
|
|
358
|
-
interface
|
|
388
|
+
interface UploadProps extends FileRules {
|
|
359
389
|
onFilesChange: (files: File[]) => void;
|
|
360
390
|
files?: File[];
|
|
361
391
|
/** Rejections are surfaced rather than swallowed — a file that vanishes silently reads as a bug. */
|
|
@@ -367,7 +397,7 @@ interface FileDropProps extends FileRules {
|
|
|
367
397
|
children?: ReactNode;
|
|
368
398
|
className?: string;
|
|
369
399
|
}
|
|
370
|
-
declare function
|
|
400
|
+
declare function Upload({ onFilesChange, files, onReject, accept, maxSize, maxFiles, multiple, disabled, children, className, }: UploadProps): react.JSX.Element;
|
|
371
401
|
|
|
372
402
|
/** Numeric input arithmetic, kept pure so the awkward cases are asserted, not hoped for. */
|
|
373
403
|
interface NumberBounds {
|
|
@@ -404,7 +434,7 @@ interface NumberInputProps extends NumberBounds {
|
|
|
404
434
|
* A text input that speaks numbers, not `<input type="number">`: that one scrolls its value
|
|
405
435
|
* away under the wheel, accepts 'e' and '+', and formats inconsistently across locales.
|
|
406
436
|
*/
|
|
407
|
-
declare function
|
|
437
|
+
declare function InputNumber({ value, defaultValue, onValueChange, min, max, step, size, disabled, invalid, name, placeholder, suffix, className, }: NumberInputProps): react.JSX.Element;
|
|
408
438
|
|
|
409
439
|
interface DialogProps {
|
|
410
440
|
open?: boolean;
|
|
@@ -426,9 +456,28 @@ interface DialogProps {
|
|
|
426
456
|
* (ADR 0003). Enter and exit are CSS transitions driven by Base UI's own state attributes,
|
|
427
457
|
* because Base UI owns this element's mount lifecycle — motion is used where we own it.
|
|
428
458
|
*/
|
|
429
|
-
declare function
|
|
459
|
+
declare function Modal({ open, defaultOpen, onOpenChange, title, description, children, footer, size, placement, trigger, className, }: DialogProps): react.JSX.Element;
|
|
430
460
|
declare const DialogClose: react.ForwardRefExoticComponent<Omit<_base_ui_react.AlertDialogCloseProps, "ref"> & react.RefAttributes<HTMLButtonElement>>;
|
|
431
461
|
|
|
462
|
+
interface DrawerProps {
|
|
463
|
+
open?: boolean;
|
|
464
|
+
defaultOpen?: boolean;
|
|
465
|
+
onOpenChange?: (open: boolean) => void;
|
|
466
|
+
title: ReactNode;
|
|
467
|
+
description?: ReactNode;
|
|
468
|
+
children?: ReactNode;
|
|
469
|
+
footer?: ReactNode;
|
|
470
|
+
/** The element that opens it. Omit for a fully controlled drawer. */
|
|
471
|
+
trigger?: ReactNode;
|
|
472
|
+
className?: string;
|
|
473
|
+
}
|
|
474
|
+
/**
|
|
475
|
+
* Modal navigation or task panel anchored to the inline end edge. Base UI supplies
|
|
476
|
+
* focus trapping, dismissal, scroll locking, and accessible dialog semantics.
|
|
477
|
+
*/
|
|
478
|
+
declare function Drawer({ open, defaultOpen, onOpenChange, title, description, children, footer, trigger, className, }: DrawerProps): react.JSX.Element;
|
|
479
|
+
declare const DrawerClose: react.ForwardRefExoticComponent<Omit<_base_ui_react.AlertDialogCloseProps, "ref"> & react.RefAttributes<HTMLButtonElement>>;
|
|
480
|
+
|
|
432
481
|
/** Command matching and ranking. Pure — search that ranks badly is a bug you can only see in a test. */
|
|
433
482
|
interface Command {
|
|
434
483
|
id: string;
|
|
@@ -515,9 +564,70 @@ interface TooltipProps {
|
|
|
515
564
|
/** Plain text. A tooltip that needs markup is a Popover — screen readers read this as a label. */
|
|
516
565
|
label: string;
|
|
517
566
|
side?: Side;
|
|
567
|
+
align?: Align;
|
|
568
|
+
/** Distance from the anchor, in px. */
|
|
569
|
+
sideOffset?: number;
|
|
570
|
+
showArrow?: boolean;
|
|
518
571
|
delay?: number;
|
|
519
572
|
}
|
|
520
|
-
declare function Tooltip({ children, label, side, delay }: TooltipProps): react.JSX.Element;
|
|
573
|
+
declare function Tooltip({ children, label, side, align, sideOffset, showArrow, delay, }: TooltipProps): react.JSX.Element;
|
|
574
|
+
|
|
575
|
+
interface TagProps {
|
|
576
|
+
children: ReactNode;
|
|
577
|
+
tone?: Tone;
|
|
578
|
+
variant?: 'soft' | 'solid' | 'outline';
|
|
579
|
+
size?: 'sm' | 'md';
|
|
580
|
+
icon?: ReactNode;
|
|
581
|
+
/** Makes the tag itself pressable — filtering by it, or opening what it names. */
|
|
582
|
+
onClick?: () => void;
|
|
583
|
+
/** Whether a pressable tag is currently on. Reported as `aria-pressed`. */
|
|
584
|
+
pressed?: boolean;
|
|
585
|
+
/** Adds a control that takes the tag away. Not the same as pressing it. */
|
|
586
|
+
onClose?: () => void;
|
|
587
|
+
/** Render something else in the tag's place — a router's own Link. */
|
|
588
|
+
render?: ReactElement;
|
|
589
|
+
className?: string;
|
|
590
|
+
}
|
|
591
|
+
/**
|
|
592
|
+
* A label you can do something to.
|
|
593
|
+
*
|
|
594
|
+
* `Badge` is the one you cannot: it says what something is and nothing more, and
|
|
595
|
+
* its own note says that a label which can be pressed or removed is this instead.
|
|
596
|
+
* That is the whole boundary between them — not the size, not the colour, but
|
|
597
|
+
* whether there is anything to press (ADR 0014). They share the look and differ
|
|
598
|
+
* in what they are.
|
|
599
|
+
*
|
|
600
|
+
* Pressing and removing are also two different things, so they are two props. A
|
|
601
|
+
* tag that filters by its own value and a tag that takes itself off a list are
|
|
602
|
+
* not the same gesture, and one component that guessed which you meant would be
|
|
603
|
+
* wrong half the time.
|
|
604
|
+
*/
|
|
605
|
+
declare function Tag({ children, tone, variant, size, icon, onClick, pressed, onClose, render, className, }: TagProps): react.JSX.Element;
|
|
606
|
+
|
|
607
|
+
interface RateProps {
|
|
608
|
+
/** 0 means nothing chosen, which is different from choosing the lowest score. */
|
|
609
|
+
value: number;
|
|
610
|
+
onValueChange?: (value: number) => void;
|
|
611
|
+
count?: number;
|
|
612
|
+
size?: number;
|
|
613
|
+
/** Shows a score without offering to change it. */
|
|
614
|
+
readOnly?: boolean;
|
|
615
|
+
/** Names the group when it is not inside a Field. */
|
|
616
|
+
label?: string;
|
|
617
|
+
className?: string;
|
|
618
|
+
}
|
|
619
|
+
/**
|
|
620
|
+
* A score out of a few, set by pressing one of them.
|
|
621
|
+
*
|
|
622
|
+
* A radiogroup, not a row of buttons: exactly one of a small visible set is the
|
|
623
|
+
* definition of one, and it buys the arrow keys and the announced position for
|
|
624
|
+
* free. Read-only it is not a group at all — there is nothing to choose, so it
|
|
625
|
+
* is an image with a label saying what it shows.
|
|
626
|
+
*
|
|
627
|
+
* Pressing the current score again clears it. Nought stars and one star are
|
|
628
|
+
* different answers, and without this there is no way back to the first.
|
|
629
|
+
*/
|
|
630
|
+
declare function Rate({ value, onValueChange, count, size, readOnly, label, className, }: RateProps): react.JSX.Element;
|
|
521
631
|
|
|
522
632
|
interface AlertProps {
|
|
523
633
|
title?: ReactNode;
|
|
@@ -596,15 +706,25 @@ interface MenuItem {
|
|
|
596
706
|
checked?: boolean;
|
|
597
707
|
onSelect?: () => void;
|
|
598
708
|
}
|
|
599
|
-
interface
|
|
600
|
-
|
|
709
|
+
interface MenuSection {
|
|
710
|
+
label?: ReactNode;
|
|
601
711
|
items: MenuItem[];
|
|
712
|
+
}
|
|
713
|
+
interface DropdownMenuBaseProps {
|
|
714
|
+
trigger: ReactElement;
|
|
602
715
|
align?: 'start' | 'center' | 'end';
|
|
603
716
|
side?: 'top' | 'right' | 'bottom' | 'left';
|
|
604
717
|
className?: string;
|
|
605
718
|
}
|
|
719
|
+
type DropdownMenuProps = DropdownMenuBaseProps & ({
|
|
720
|
+
items: MenuItem[];
|
|
721
|
+
sections?: never;
|
|
722
|
+
} | {
|
|
723
|
+
items?: never;
|
|
724
|
+
sections: MenuSection[];
|
|
725
|
+
});
|
|
606
726
|
/** Typeahead, roving focus, and dismissal are Base UI's; the surface and the rhythm are ours. */
|
|
607
|
-
declare function
|
|
727
|
+
declare function Dropdown({ trigger, items, sections, align, side, className }: DropdownMenuProps): react.JSX.Element;
|
|
608
728
|
|
|
609
729
|
interface NavItem {
|
|
610
730
|
label: ReactNode;
|
|
@@ -637,7 +757,7 @@ interface SidebarProps {
|
|
|
637
757
|
*/
|
|
638
758
|
declare function Sidebar({ sections, header, footer, collapsed, onCollapsedChange, className }: SidebarProps): react.JSX.Element;
|
|
639
759
|
interface TopBarProps {
|
|
640
|
-
/** Page title, or a
|
|
760
|
+
/** Page title, or a Breadcrumb trail. */
|
|
641
761
|
title?: ReactNode;
|
|
642
762
|
subtitle?: ReactNode;
|
|
643
763
|
/** Search, filters — anything that belongs in the middle. */
|
|
@@ -697,7 +817,7 @@ interface DataTableProps<Row> {
|
|
|
697
817
|
sort?: SortState | null;
|
|
698
818
|
onSortChange?: (sort: SortState | null) => void;
|
|
699
819
|
onRowClick?: (row: Row) => void;
|
|
700
|
-
/** Rendered in place of the body when there are no rows — an
|
|
820
|
+
/** Rendered in place of the body when there are no rows — an Empty, usually. */
|
|
701
821
|
empty?: ReactNode;
|
|
702
822
|
className?: string;
|
|
703
823
|
}
|
|
@@ -705,8 +825,8 @@ interface DataTableProps<Row> {
|
|
|
705
825
|
* A table, not a grid: no virtualisation, no column resizing, no editing. It renders rows and
|
|
706
826
|
* sorts by a column, and anything past that is a product feature rather than a design system one.
|
|
707
827
|
*/
|
|
708
|
-
declare function
|
|
709
|
-
declare namespace
|
|
828
|
+
declare function Table<Row>({ columns, rows, rowKey, label, sort, onSortChange, onRowClick, empty, className, }: DataTableProps<Row>): react.JSX.Element;
|
|
829
|
+
declare namespace Table {
|
|
710
830
|
var Skeleton: typeof DataTableSkeleton;
|
|
711
831
|
}
|
|
712
832
|
interface DataTableSkeletonProps {
|
|
@@ -929,4 +1049,4 @@ interface StaggerProps {
|
|
|
929
1049
|
/** Wraps each child in a Reveal with an increasing delay — the list arrives, it does not pop. */
|
|
930
1050
|
declare function Stagger({ children, step, from, onView, className }: StaggerProps): react.JSX.Element;
|
|
931
1051
|
|
|
932
|
-
export { Alert, type AlertProps, type Align, type AutoplayConditions, Button, type ButtonProps, Carousel, type CarouselProps, type CarouselSkeletonProps, type CarouselSlideProps, Checkbox, type CheckboxProps, Checklist, type ChecklistProps, type ChecklistTask, Coachmark, type CoachmarkProps, type Column,
|
|
1052
|
+
export { Alert, type AlertProps, type Align, AutoComplete, type AutoplayConditions, Button, type ButtonProps, Carousel, type CarouselProps, type CarouselSkeletonProps, type CarouselSlideProps, Checkbox, type CheckboxProps, Checklist, type ChecklistProps, type ChecklistTask, Coachmark, type CoachmarkProps, type Column, type ComboboxOption, type ComboboxProps, type Command, CommandPalette, type CommandPaletteProps, DEFAULT_LABELS, type DataTableProps, type DataTableSkeletonProps, type DateInputProps, DatePicker, type DayCell, DialogClose, type DialogProps, Drawer, DrawerClose, type DrawerProps, Dropdown, type DropdownMenuProps, type DurationToken, Field, type FieldProps, type FileRules, Image, type ImageProps, Input, InputNumber, type Labels, LabelsProvider, type LabelsProviderProps, type MenuItem, type MenuSection, Modal, type MotionHelpers, MotionProvider, type MotionProviderProps, type MotionSettings, type NavItem, type NavSection, type NumberBounds, type NumberInputProps, type PageRange, Pagination, type PaginationProps, type PaletteCommand, Popover, type PopoverProps, RadioGroup, type RadioGroupProps, type RadioOption, type RankedCommand, Rate, type RateProps, type Rejection, Reveal, type RevealProps, type SeenStore, Select, type SelectOption, type SelectProps, type Side, Sidebar, type SidebarProps, type SortDirection, type SortState, type SpringPreset, Stagger, type StaggerProps, type StepTarget, Switch, type SwitchProps, type TabItem, Table, Tabs, type TabsProps, Tag, type TagProps, type TextInputProps, Textarea, type TextareaProps, type ThemeChoice, ThemeProvider, type TimeInputProps, TimePicker, type TimeValue, type ToastOptions, type ToastPosition, ToastProvider, type ToastProviderProps, Tooltip, type TooltipProps, TopBar, type TopBarProps, Tour, type TourAction, type TourProps, type TourState, type TourStatus, type TourStep, Upload, type UploadProps, ariaSortFor, canStep, clamp, decimalPlaces, describeAccept, filterCommands, formatISO, formatTime, groupCommands, hasEnded, initialTourState, isOutOfRange, isSameDay, isTimeOutOfRange, matchesAccept, monthMatrix, nextSort, pageRange, parseDateInput, parseNumber, parseTime, partitionFiles, rankCommand, resolveTarget, shouldAutoplay, startOfDay, stepBy, timeOptions, timeToMinutes, tourReducer, useFieldWiring, useLabels, useMotionSettings, useTheme, useToast };
|