@nextlyhq/ui 0.0.2-alpha.77 → 0.0.2-alpha.79
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/index.cjs +472 -67
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +61 -9
- package/dist/index.d.ts +61 -9
- package/dist/index.mjs +473 -68
- package/dist/index.mjs.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/styles.scoped.css +1 -1
- package/package.json +5 -4
package/dist/index.d.cts
CHANGED
|
@@ -72,7 +72,7 @@ declare const BUTTON_VARIANT_MAP: {
|
|
|
72
72
|
* - destructive: Destructive action button (red background)
|
|
73
73
|
* - outline: Outlined button (transparent background, border)
|
|
74
74
|
* - ghost: Minimal button (transparent, no border)
|
|
75
|
-
* - link: Link-style button (underlined
|
|
75
|
+
* - link: Link-style button (text colour, underlined at rest)
|
|
76
76
|
*
|
|
77
77
|
* Note: 'primary' is a semantic alias for 'default' variant for better code readability
|
|
78
78
|
* @experimental
|
|
@@ -1540,7 +1540,19 @@ type AlertDialogCancelProps = ComponentPropsWithoutRef<typeof AlertDialogPrimiti
|
|
|
1540
1540
|
* @experimental
|
|
1541
1541
|
*/
|
|
1542
1542
|
declare const AlertDialogCancel: ForwardRefExoticComponent<PropsWithoutRef<AlertDialogCancelProps> & RefAttributes<ElementRef<typeof AlertDialogPrimitive.Cancel>>>;
|
|
1543
|
-
/**
|
|
1543
|
+
/**
|
|
1544
|
+
* The menu's root: Radix's, not modal unless a caller asks.
|
|
1545
|
+
*
|
|
1546
|
+
* A menu is a list of choices, not a dialog. A modal one marks everything
|
|
1547
|
+
* around it `aria-hidden` while those controls stay focusable, which hides
|
|
1548
|
+
* the page from a screen reader without taking it out of reach (axe:
|
|
1549
|
+
* `aria-hidden-focus`). Not modal, the menu still closes on Escape, on Tab
|
|
1550
|
+
* and on a press outside, and gives focus back to its trigger; the press
|
|
1551
|
+
* outside also reaches what it was on, and the page can scroll while the
|
|
1552
|
+
* menu is open. A menu that must hold the page still passes `modal`.
|
|
1553
|
+
*
|
|
1554
|
+
* @public
|
|
1555
|
+
*/
|
|
1544
1556
|
declare const DropdownMenu: typeof DropdownMenuPrimitive.Root;
|
|
1545
1557
|
/** @public */
|
|
1546
1558
|
declare const DropdownMenuTrigger: typeof DropdownMenuPrimitive.Trigger;
|
|
@@ -1997,6 +2009,18 @@ type CommandProps = ComponentPropsWithoutRef<typeof Command$1>;
|
|
|
1997
2009
|
declare const Command: ForwardRefExoticComponent<PropsWithoutRef<CommandProps> & RefAttributes<ElementRef<typeof Command$1>>>;
|
|
1998
2010
|
/** @experimental */
|
|
1999
2011
|
interface CommandDialogProps extends DialogPrimitive.DialogProps {
|
|
2012
|
+
/**
|
|
2013
|
+
* The dialog's accessible name, drawn visually hidden: the search field is what the eye
|
|
2014
|
+
* reads, but a dialog without a name is announced as "dialog" and nothing more, and the
|
|
2015
|
+
* field's placeholder names the INPUT, not the dialog around it. Defaults to "Command
|
|
2016
|
+
* palette"; a caller whose palette searches something narrower says what.
|
|
2017
|
+
*/
|
|
2018
|
+
title?: string;
|
|
2019
|
+
/**
|
|
2020
|
+
* What the dialog is for, drawn visually hidden and read after its name. Optional: without
|
|
2021
|
+
* one the dialog points at no description, rather than at an element that is not there.
|
|
2022
|
+
*/
|
|
2023
|
+
description?: string;
|
|
2000
2024
|
/**
|
|
2001
2025
|
* Passed to the command root this dialog renders internally.
|
|
2002
2026
|
*
|
|
@@ -2048,7 +2072,7 @@ interface CommandDialogProps extends DialogPrimitive.DialogProps {
|
|
|
2048
2072
|
* ```
|
|
2049
2073
|
* @experimental
|
|
2050
2074
|
*/
|
|
2051
|
-
declare const CommandDialog: ({ children, commandProps, contentProps, ...props }: CommandDialogProps) => JSX.Element;
|
|
2075
|
+
declare const CommandDialog: ({ children, title, description, commandProps, contentProps, ...props }: CommandDialogProps) => JSX.Element;
|
|
2052
2076
|
/** @experimental */
|
|
2053
2077
|
type CommandInputProps = ComponentPropsWithoutRef<typeof Command$1.Input>;
|
|
2054
2078
|
/**
|
|
@@ -2070,6 +2094,14 @@ type CommandEmptyProps = ComponentPropsWithoutRef<typeof Command$1.Empty>;
|
|
|
2070
2094
|
/**
|
|
2071
2095
|
* CommandEmpty - Empty state message when no results found.
|
|
2072
2096
|
* Centered text with muted color per design spec.
|
|
2097
|
+
*
|
|
2098
|
+
* A message of plain text inside a `CommandList` is drawn in the list but hidden from screen
|
|
2099
|
+
* readers, and the list says it from its own status line outside the list. The list is a
|
|
2100
|
+
* `listbox`, which may own only options and their groups: the library gives the message
|
|
2101
|
+
* `role="presentation"`, set after the props it is given, so the list would own its words, and
|
|
2102
|
+
* axe-core's `aria-required-children` fails a list a search found nothing in. A message holding
|
|
2103
|
+
* anything else, a "Try again" button say, stays where it is, so what it holds can still be
|
|
2104
|
+
* reached; so does one outside a list.
|
|
2073
2105
|
* @experimental
|
|
2074
2106
|
*/
|
|
2075
2107
|
declare const CommandEmpty: ForwardRefExoticComponent<PropsWithoutRef<CommandEmptyProps> & RefAttributes<ElementRef<typeof Command$1.Empty>>>;
|
|
@@ -2085,7 +2117,14 @@ declare const CommandGroup: ForwardRefExoticComponent<PropsWithoutRef<CommandGro
|
|
|
2085
2117
|
type CommandSeparatorProps = ComponentPropsWithoutRef<typeof Command$1.Separator>;
|
|
2086
2118
|
/**
|
|
2087
2119
|
* CommandSeparator - Visual divider between command groups.
|
|
2088
|
-
* 1px line
|
|
2120
|
+
* 1px line in the border colour, 8px margin top/bottom.
|
|
2121
|
+
*
|
|
2122
|
+
* Hidden from screen readers by default. It usually sits inside the list, which is a `listbox`,
|
|
2123
|
+
* and a listbox may own only options and their groups: the library's separator sets
|
|
2124
|
+
* `role="separator"` after the props it is given, so the role cannot be swapped out, and a
|
|
2125
|
+
* screen reader meeting it there finds a child the list should not have (axe-core's
|
|
2126
|
+
* `aria-required-children`). Groups already carry their own headings, so the line adds nothing
|
|
2127
|
+
* to what is announced. Placed outside the list, pass `aria-hidden={false}` to announce it.
|
|
2089
2128
|
* @experimental
|
|
2090
2129
|
*/
|
|
2091
2130
|
declare const CommandSeparator: ForwardRefExoticComponent<PropsWithoutRef<CommandSeparatorProps> & RefAttributes<ElementRef<typeof Command$1.Separator>>>;
|
|
@@ -2452,7 +2491,10 @@ interface ColorSwatch<TValue = string> {
|
|
|
2452
2491
|
interface ColorPickerProps<TValue = string> {
|
|
2453
2492
|
/** The colour shown on the surface, as hex. */
|
|
2454
2493
|
color: string;
|
|
2455
|
-
/**
|
|
2494
|
+
/**
|
|
2495
|
+
* A colour was chosen by editing — surface, hue, alpha or the field — as hex,
|
|
2496
|
+
* whichever notation it was typed in.
|
|
2497
|
+
*/
|
|
2456
2498
|
onColorChange: (color: string) => void;
|
|
2457
2499
|
/** Presets. Painted from `color`, returned by `value`. */
|
|
2458
2500
|
swatches?: ColorSwatch<TValue>[];
|
|
@@ -2465,16 +2507,26 @@ interface ColorPickerProps<TValue = string> {
|
|
|
2465
2507
|
/**
|
|
2466
2508
|
* Recently used colours. Owned by the host, never by this component — the
|
|
2467
2509
|
* admin scopes them per user, and a component writing `localStorage` at
|
|
2468
|
-
* render is unusable on a server and untestable without a DOM.
|
|
2510
|
+
* render is unusable on a server and untestable without a DOM. Given, the
|
|
2511
|
+
* "Recent colours" row shows, saying what will appear while it is empty;
|
|
2512
|
+
* absent, there is no row.
|
|
2469
2513
|
*/
|
|
2470
2514
|
recentColors?: string[];
|
|
2515
|
+
/**
|
|
2516
|
+
* A recent colour was chosen. Given, the colour comes back as the host
|
|
2517
|
+
* listed it, in its own notation, for the host to store as it is; absent,
|
|
2518
|
+
* the picker reads it and reports it as an edit, as it does a typed one.
|
|
2519
|
+
*/
|
|
2520
|
+
onRecentSelect?: (color: string) => void;
|
|
2471
2521
|
/** Alpha channel. Off by default: most call sites want an opaque colour. */
|
|
2472
2522
|
showAlpha?: boolean;
|
|
2473
2523
|
className?: string;
|
|
2474
2524
|
}
|
|
2475
2525
|
/**
|
|
2476
|
-
* A colour control: a saturation square, a hue strip, optional alpha, a
|
|
2477
|
-
*
|
|
2526
|
+
* A colour control: a saturation square, a hue strip, optional alpha, a field
|
|
2527
|
+
* that reads hex, `rgb()` or `hsl()` and shows whichever of the three the
|
|
2528
|
+
* author picks, the screen's eyedropper where the browser has one, and any
|
|
2529
|
+
* presets and recent colours the host supplies. What it reports is hex.
|
|
2478
2530
|
*
|
|
2479
2531
|
* Deliberately knows nothing about design tokens. A swatch carries an opaque
|
|
2480
2532
|
* `value` this component never reads and hands back untouched, so a host can
|
|
@@ -2494,7 +2546,7 @@ interface ColorPickerProps<TValue = string> {
|
|
|
2494
2546
|
* />
|
|
2495
2547
|
* ```
|
|
2496
2548
|
*/
|
|
2497
|
-
export declare function ColorPicker<TValue = string>({ color, onColorChange, swatches, onSwatchSelect, recentColors, showAlpha, className }: ColorPickerProps<TValue>): React$1.JSX.Element;
|
|
2549
|
+
export declare function ColorPicker<TValue = string>({ color, onColorChange, swatches, onSwatchSelect, recentColors, onRecentSelect, showAlpha, className }: ColorPickerProps<TValue>): React$1.JSX.Element;
|
|
2498
2550
|
/**
|
|
2499
2551
|
* One icon an icon source can draw.
|
|
2500
2552
|
*
|
package/dist/index.d.ts
CHANGED
|
@@ -72,7 +72,7 @@ declare const BUTTON_VARIANT_MAP: {
|
|
|
72
72
|
* - destructive: Destructive action button (red background)
|
|
73
73
|
* - outline: Outlined button (transparent background, border)
|
|
74
74
|
* - ghost: Minimal button (transparent, no border)
|
|
75
|
-
* - link: Link-style button (underlined
|
|
75
|
+
* - link: Link-style button (text colour, underlined at rest)
|
|
76
76
|
*
|
|
77
77
|
* Note: 'primary' is a semantic alias for 'default' variant for better code readability
|
|
78
78
|
* @experimental
|
|
@@ -1540,7 +1540,19 @@ type AlertDialogCancelProps = ComponentPropsWithoutRef<typeof AlertDialogPrimiti
|
|
|
1540
1540
|
* @experimental
|
|
1541
1541
|
*/
|
|
1542
1542
|
declare const AlertDialogCancel: ForwardRefExoticComponent<PropsWithoutRef<AlertDialogCancelProps> & RefAttributes<ElementRef<typeof AlertDialogPrimitive.Cancel>>>;
|
|
1543
|
-
/**
|
|
1543
|
+
/**
|
|
1544
|
+
* The menu's root: Radix's, not modal unless a caller asks.
|
|
1545
|
+
*
|
|
1546
|
+
* A menu is a list of choices, not a dialog. A modal one marks everything
|
|
1547
|
+
* around it `aria-hidden` while those controls stay focusable, which hides
|
|
1548
|
+
* the page from a screen reader without taking it out of reach (axe:
|
|
1549
|
+
* `aria-hidden-focus`). Not modal, the menu still closes on Escape, on Tab
|
|
1550
|
+
* and on a press outside, and gives focus back to its trigger; the press
|
|
1551
|
+
* outside also reaches what it was on, and the page can scroll while the
|
|
1552
|
+
* menu is open. A menu that must hold the page still passes `modal`.
|
|
1553
|
+
*
|
|
1554
|
+
* @public
|
|
1555
|
+
*/
|
|
1544
1556
|
declare const DropdownMenu: typeof DropdownMenuPrimitive.Root;
|
|
1545
1557
|
/** @public */
|
|
1546
1558
|
declare const DropdownMenuTrigger: typeof DropdownMenuPrimitive.Trigger;
|
|
@@ -1997,6 +2009,18 @@ type CommandProps = ComponentPropsWithoutRef<typeof Command$1>;
|
|
|
1997
2009
|
declare const Command: ForwardRefExoticComponent<PropsWithoutRef<CommandProps> & RefAttributes<ElementRef<typeof Command$1>>>;
|
|
1998
2010
|
/** @experimental */
|
|
1999
2011
|
interface CommandDialogProps extends DialogPrimitive.DialogProps {
|
|
2012
|
+
/**
|
|
2013
|
+
* The dialog's accessible name, drawn visually hidden: the search field is what the eye
|
|
2014
|
+
* reads, but a dialog without a name is announced as "dialog" and nothing more, and the
|
|
2015
|
+
* field's placeholder names the INPUT, not the dialog around it. Defaults to "Command
|
|
2016
|
+
* palette"; a caller whose palette searches something narrower says what.
|
|
2017
|
+
*/
|
|
2018
|
+
title?: string;
|
|
2019
|
+
/**
|
|
2020
|
+
* What the dialog is for, drawn visually hidden and read after its name. Optional: without
|
|
2021
|
+
* one the dialog points at no description, rather than at an element that is not there.
|
|
2022
|
+
*/
|
|
2023
|
+
description?: string;
|
|
2000
2024
|
/**
|
|
2001
2025
|
* Passed to the command root this dialog renders internally.
|
|
2002
2026
|
*
|
|
@@ -2048,7 +2072,7 @@ interface CommandDialogProps extends DialogPrimitive.DialogProps {
|
|
|
2048
2072
|
* ```
|
|
2049
2073
|
* @experimental
|
|
2050
2074
|
*/
|
|
2051
|
-
declare const CommandDialog: ({ children, commandProps, contentProps, ...props }: CommandDialogProps) => JSX.Element;
|
|
2075
|
+
declare const CommandDialog: ({ children, title, description, commandProps, contentProps, ...props }: CommandDialogProps) => JSX.Element;
|
|
2052
2076
|
/** @experimental */
|
|
2053
2077
|
type CommandInputProps = ComponentPropsWithoutRef<typeof Command$1.Input>;
|
|
2054
2078
|
/**
|
|
@@ -2070,6 +2094,14 @@ type CommandEmptyProps = ComponentPropsWithoutRef<typeof Command$1.Empty>;
|
|
|
2070
2094
|
/**
|
|
2071
2095
|
* CommandEmpty - Empty state message when no results found.
|
|
2072
2096
|
* Centered text with muted color per design spec.
|
|
2097
|
+
*
|
|
2098
|
+
* A message of plain text inside a `CommandList` is drawn in the list but hidden from screen
|
|
2099
|
+
* readers, and the list says it from its own status line outside the list. The list is a
|
|
2100
|
+
* `listbox`, which may own only options and their groups: the library gives the message
|
|
2101
|
+
* `role="presentation"`, set after the props it is given, so the list would own its words, and
|
|
2102
|
+
* axe-core's `aria-required-children` fails a list a search found nothing in. A message holding
|
|
2103
|
+
* anything else, a "Try again" button say, stays where it is, so what it holds can still be
|
|
2104
|
+
* reached; so does one outside a list.
|
|
2073
2105
|
* @experimental
|
|
2074
2106
|
*/
|
|
2075
2107
|
declare const CommandEmpty: ForwardRefExoticComponent<PropsWithoutRef<CommandEmptyProps> & RefAttributes<ElementRef<typeof Command$1.Empty>>>;
|
|
@@ -2085,7 +2117,14 @@ declare const CommandGroup: ForwardRefExoticComponent<PropsWithoutRef<CommandGro
|
|
|
2085
2117
|
type CommandSeparatorProps = ComponentPropsWithoutRef<typeof Command$1.Separator>;
|
|
2086
2118
|
/**
|
|
2087
2119
|
* CommandSeparator - Visual divider between command groups.
|
|
2088
|
-
* 1px line
|
|
2120
|
+
* 1px line in the border colour, 8px margin top/bottom.
|
|
2121
|
+
*
|
|
2122
|
+
* Hidden from screen readers by default. It usually sits inside the list, which is a `listbox`,
|
|
2123
|
+
* and a listbox may own only options and their groups: the library's separator sets
|
|
2124
|
+
* `role="separator"` after the props it is given, so the role cannot be swapped out, and a
|
|
2125
|
+
* screen reader meeting it there finds a child the list should not have (axe-core's
|
|
2126
|
+
* `aria-required-children`). Groups already carry their own headings, so the line adds nothing
|
|
2127
|
+
* to what is announced. Placed outside the list, pass `aria-hidden={false}` to announce it.
|
|
2089
2128
|
* @experimental
|
|
2090
2129
|
*/
|
|
2091
2130
|
declare const CommandSeparator: ForwardRefExoticComponent<PropsWithoutRef<CommandSeparatorProps> & RefAttributes<ElementRef<typeof Command$1.Separator>>>;
|
|
@@ -2452,7 +2491,10 @@ interface ColorSwatch<TValue = string> {
|
|
|
2452
2491
|
interface ColorPickerProps<TValue = string> {
|
|
2453
2492
|
/** The colour shown on the surface, as hex. */
|
|
2454
2493
|
color: string;
|
|
2455
|
-
/**
|
|
2494
|
+
/**
|
|
2495
|
+
* A colour was chosen by editing — surface, hue, alpha or the field — as hex,
|
|
2496
|
+
* whichever notation it was typed in.
|
|
2497
|
+
*/
|
|
2456
2498
|
onColorChange: (color: string) => void;
|
|
2457
2499
|
/** Presets. Painted from `color`, returned by `value`. */
|
|
2458
2500
|
swatches?: ColorSwatch<TValue>[];
|
|
@@ -2465,16 +2507,26 @@ interface ColorPickerProps<TValue = string> {
|
|
|
2465
2507
|
/**
|
|
2466
2508
|
* Recently used colours. Owned by the host, never by this component — the
|
|
2467
2509
|
* admin scopes them per user, and a component writing `localStorage` at
|
|
2468
|
-
* render is unusable on a server and untestable without a DOM.
|
|
2510
|
+
* render is unusable on a server and untestable without a DOM. Given, the
|
|
2511
|
+
* "Recent colours" row shows, saying what will appear while it is empty;
|
|
2512
|
+
* absent, there is no row.
|
|
2469
2513
|
*/
|
|
2470
2514
|
recentColors?: string[];
|
|
2515
|
+
/**
|
|
2516
|
+
* A recent colour was chosen. Given, the colour comes back as the host
|
|
2517
|
+
* listed it, in its own notation, for the host to store as it is; absent,
|
|
2518
|
+
* the picker reads it and reports it as an edit, as it does a typed one.
|
|
2519
|
+
*/
|
|
2520
|
+
onRecentSelect?: (color: string) => void;
|
|
2471
2521
|
/** Alpha channel. Off by default: most call sites want an opaque colour. */
|
|
2472
2522
|
showAlpha?: boolean;
|
|
2473
2523
|
className?: string;
|
|
2474
2524
|
}
|
|
2475
2525
|
/**
|
|
2476
|
-
* A colour control: a saturation square, a hue strip, optional alpha, a
|
|
2477
|
-
*
|
|
2526
|
+
* A colour control: a saturation square, a hue strip, optional alpha, a field
|
|
2527
|
+
* that reads hex, `rgb()` or `hsl()` and shows whichever of the three the
|
|
2528
|
+
* author picks, the screen's eyedropper where the browser has one, and any
|
|
2529
|
+
* presets and recent colours the host supplies. What it reports is hex.
|
|
2478
2530
|
*
|
|
2479
2531
|
* Deliberately knows nothing about design tokens. A swatch carries an opaque
|
|
2480
2532
|
* `value` this component never reads and hands back untouched, so a host can
|
|
@@ -2494,7 +2546,7 @@ interface ColorPickerProps<TValue = string> {
|
|
|
2494
2546
|
* />
|
|
2495
2547
|
* ```
|
|
2496
2548
|
*/
|
|
2497
|
-
export declare function ColorPicker<TValue = string>({ color, onColorChange, swatches, onSwatchSelect, recentColors, showAlpha, className }: ColorPickerProps<TValue>): React$1.JSX.Element;
|
|
2549
|
+
export declare function ColorPicker<TValue = string>({ color, onColorChange, swatches, onSwatchSelect, recentColors, onRecentSelect, showAlpha, className }: ColorPickerProps<TValue>): React$1.JSX.Element;
|
|
2498
2550
|
/**
|
|
2499
2551
|
* One icon an icon source can draw.
|
|
2500
2552
|
*
|