@lessly/ui 2.2.0 → 2.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/dist/{chunk-F5RMHSPS.js → chunk-CEXND5YW.js} +38 -5
- package/dist/index.d.ts +142 -43
- package/dist/index.js +435 -171
- package/dist/router.js +3 -3
- package/dist/styles-federated.css +34 -0
- package/dist/styles.css +34 -0
- package/package.json +1 -1
|
@@ -3,6 +3,31 @@ import { clsx } from "clsx";
|
|
|
3
3
|
import { extendTailwindMerge } from "tailwind-merge";
|
|
4
4
|
var TOKEN_FONT_WEIGHTS = ["regular", "medium", "semibold", "bold", "extrabold"];
|
|
5
5
|
var TOKEN_BORDER_WIDTHS = ["none", "thin", "medium", "thick", "heavy"];
|
|
6
|
+
var TOKEN_DURATIONS = [
|
|
7
|
+
"instant",
|
|
8
|
+
"fast",
|
|
9
|
+
"normal",
|
|
10
|
+
"slow",
|
|
11
|
+
"slower",
|
|
12
|
+
"slowest",
|
|
13
|
+
"ui",
|
|
14
|
+
"collapse",
|
|
15
|
+
"slide",
|
|
16
|
+
"overlay",
|
|
17
|
+
"toast"
|
|
18
|
+
];
|
|
19
|
+
var TOKEN_EASINGS = [
|
|
20
|
+
"default",
|
|
21
|
+
"in",
|
|
22
|
+
"out",
|
|
23
|
+
"in-out",
|
|
24
|
+
"spring",
|
|
25
|
+
"linear",
|
|
26
|
+
"standard",
|
|
27
|
+
"enter",
|
|
28
|
+
"exit",
|
|
29
|
+
"emphasized"
|
|
30
|
+
];
|
|
6
31
|
var twMerge = extendTailwindMerge((config) => {
|
|
7
32
|
config.theme["font-weight"] = [...config.theme["font-weight"] ?? [], ...TOKEN_FONT_WEIGHTS];
|
|
8
33
|
for (const group of Object.keys(config.classGroups)) {
|
|
@@ -12,6 +37,11 @@ var twMerge = extendTailwindMerge((config) => {
|
|
|
12
37
|
{ [group.replace("border-w", "border")]: TOKEN_BORDER_WIDTHS }
|
|
13
38
|
];
|
|
14
39
|
}
|
|
40
|
+
config.classGroups["duration"] = [
|
|
41
|
+
...config.classGroups["duration"] ?? [],
|
|
42
|
+
{ duration: TOKEN_DURATIONS }
|
|
43
|
+
];
|
|
44
|
+
config.classGroups["ease"] = [...config.classGroups["ease"] ?? [], { ease: TOKEN_EASINGS }];
|
|
15
45
|
for (const entry of config.classGroups["outline-w"] ?? []) {
|
|
16
46
|
if (typeof entry !== "object" || Array.isArray(entry)) continue;
|
|
17
47
|
for (const [name, members] of Object.entries(entry)) {
|
|
@@ -33,7 +63,7 @@ import { Slot } from "@radix-ui/react-slot";
|
|
|
33
63
|
import { cva } from "class-variance-authority";
|
|
34
64
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
35
65
|
var buttonVariants = cva(
|
|
36
|
-
"inline-flex cursor-pointer items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 disabled:pointer-events-none disabled:opacity-50",
|
|
66
|
+
"inline-flex cursor-pointer items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors duration-fast focus-visible:outline-none focus-visible:ring-2 disabled:pointer-events-none disabled:opacity-50",
|
|
37
67
|
{
|
|
38
68
|
variants: {
|
|
39
69
|
// Every variant names its own `focus-visible:ring-*` colour and the base names none, because
|
|
@@ -232,7 +262,10 @@ var SheetOverlay = React3.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
232
262
|
));
|
|
233
263
|
SheetOverlay.displayName = SheetPrimitive.Overlay.displayName;
|
|
234
264
|
var sheetVariants = cva2(
|
|
235
|
-
|
|
265
|
+
// The slide is a keyframe animation, not a transition: `animate-in`/`animate-out` read
|
|
266
|
+
// `--tw-duration` and `--tw-ease`, which the `duration-*` pair and `ease-in-out` set. Nothing here
|
|
267
|
+
// transitions, so there is no bare `transition` and no resting duration to write.
|
|
268
|
+
"fixed z-50 gap-4 bg-bg-elevated p-6 shadow-lg ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500",
|
|
236
269
|
{
|
|
237
270
|
variants: {
|
|
238
271
|
side: {
|
|
@@ -257,7 +290,7 @@ var SheetContent = React3.forwardRef(({ side = "right", className, children, ...
|
|
|
257
290
|
...props,
|
|
258
291
|
children: [
|
|
259
292
|
children,
|
|
260
|
-
/* @__PURE__ */ jsxs2(SheetPrimitive.Close, { className: "absolute right-4 top-4 rounded-sm text-text-tertiary opacity-70 transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-border-focus disabled:pointer-events-none", children: [
|
|
293
|
+
/* @__PURE__ */ jsxs2(SheetPrimitive.Close, { className: "absolute right-4 top-4 rounded-sm text-text-tertiary opacity-70 transition-opacity duration-fast hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-border-focus disabled:pointer-events-none", children: [
|
|
261
294
|
/* @__PURE__ */ jsx3(X, { className: "h-4 w-4" }),
|
|
262
295
|
/* @__PURE__ */ jsx3("span", { className: "sr-only", children: "Close" })
|
|
263
296
|
] })
|
|
@@ -346,7 +379,7 @@ function useSidebar(options = {}) {
|
|
|
346
379
|
import * as React4 from "react";
|
|
347
380
|
import { Slot as Slot2 } from "@radix-ui/react-slot";
|
|
348
381
|
import { Fragment as Fragment2, jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
349
|
-
var base = "flex w-full items-center text-left text-sm transition-colors focus-visible:outline-none";
|
|
382
|
+
var base = "flex w-full items-center text-left text-sm transition-colors duration-fast focus-visible:outline-none";
|
|
350
383
|
var ring = "focus-visible:ring-2 focus-visible:ring-border-focus";
|
|
351
384
|
var plate = "relative isolate after:pointer-events-none after:absolute after:inset-x-1.5 after:inset-y-1 after:-z-10 after:rounded-lg";
|
|
352
385
|
var shape = {
|
|
@@ -361,7 +394,7 @@ var state = {
|
|
|
361
394
|
},
|
|
362
395
|
menu: {
|
|
363
396
|
idle: "font-medium text-text-secondary hover:bg-[var(--menu-hov)]",
|
|
364
|
-
active: "font-semibold text-text-
|
|
397
|
+
active: "bg-bg-sunken font-semibold text-text-primary"
|
|
365
398
|
},
|
|
366
399
|
// A settings line reads as a label, not as navigation, so it idles at the body weight the rest of
|
|
367
400
|
// the card is set in — and never marks itself current, because it isn't.
|
package/dist/index.d.ts
CHANGED
|
@@ -69,7 +69,7 @@ type AutoHeightProps = React$1.HTMLAttributes<HTMLDivElement>;
|
|
|
69
69
|
declare const AutoHeight: React$1.ForwardRefExoticComponent<AutoHeightProps & React$1.RefAttributes<HTMLDivElement>>;
|
|
70
70
|
|
|
71
71
|
declare const buttonVariants: (props?: ({
|
|
72
|
-
variant?: "
|
|
72
|
+
variant?: "default" | "link" | "destructive" | "destructive-ghost" | "destructive-solid" | "outline" | "secondary" | "ghost" | null | undefined;
|
|
73
73
|
size?: "default" | "sm" | "xs" | "lg" | "icon" | null | undefined;
|
|
74
74
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
75
75
|
type ButtonBase = Omit<React$1.ButtonHTMLAttributes<HTMLButtonElement>, 'children'> & VariantProps<typeof buttonVariants>;
|
|
@@ -427,37 +427,22 @@ declare const Textarea: React$1.ForwardRefExoticComponent<TextareaProps & React$
|
|
|
427
427
|
declare const Slider: React$1.ForwardRefExoticComponent<Omit<SliderPrimitive.SliderProps & React$1.RefAttributes<HTMLSpanElement>, "ref"> & React$1.RefAttributes<HTMLSpanElement>>;
|
|
428
428
|
|
|
429
429
|
/**
|
|
430
|
-
* Two
|
|
430
|
+
* Two treatments for two shapes, and `ToggleGroup` picks between them from its `type` — the question
|
|
431
|
+
* being "can nothing be selected?". `frame` is a standalone `Toggle` and every `type="multiple"`
|
|
432
|
+
* group; `track` is every `type="single"` one. What each mark is, and why, is
|
|
433
|
+
* `Guidelines/Look/Selection weight`.
|
|
431
434
|
*
|
|
432
|
-
*
|
|
433
|
-
*
|
|
434
|
-
*
|
|
435
|
-
* - `frame` (a standalone `Toggle`, and every `type="multiple"` group): each item carries its own
|
|
436
|
-
* 1px hairline and selection steps it up to `border-strong` — 5.17:1 against the page in light and
|
|
437
|
-
* 5.47:1 in dark, and 3.63:1 / 4.31:1 above the resting hairline it replaces. Nothing is filled but
|
|
438
|
-
* the hovered item, so a filter row still says which of its filters are applied.
|
|
439
|
-
* - `track` (every `type="single"` group): the selected slot is a `bg-brand-subtle` tint with its
|
|
440
|
-
* label in `text-brand` at 600 against the unselected 500. No edge on the slot and no frame around
|
|
441
|
-
* the set. The tint measures 1.104:1 against the page in light and 1.144:1 in dark; the selected
|
|
442
|
-
* word measures 1.55:1 light and 1.26:1 against the unselected word — 1.19:1 and 1.35:1 with hue
|
|
443
|
-
* removed — and 5.89:1 light / 5.07:1 dark against the tint it sits on. The weight step is the one
|
|
444
|
-
* channel that survives hue removal.
|
|
435
|
+
* Both treatments carry the weight step, so the two read as one rule with one difference: the word
|
|
436
|
+
* thickens either way, and only what happens to its box changes.
|
|
445
437
|
*
|
|
446
438
|
* The `frame` mark is a **ring**, not a border: a ring is a box-shadow, so it costs no layout and an
|
|
447
|
-
* icon-only toggle stays square at the height its `size` declares.
|
|
448
|
-
* `shadow-sm`: `shadow-sm` is the one dark step `@lessly/tokens@0.7.0` leaves without a rim, so in
|
|
449
|
-
* dark it can only darken, and its blur composites to 1.11:1 against the page in dark and 1.14:1 in
|
|
450
|
-
* light.
|
|
439
|
+
* icon-only toggle stays square at the height its `size` declares.
|
|
451
440
|
*
|
|
452
|
-
*
|
|
453
|
-
*
|
|
441
|
+
* `track` draws no ring and no `shadow-sm`. `shadow-sm` is the one dark step
|
|
442
|
+
* `@lessly/tokens@0.7.0` leaves without a rim, so in dark it can only darken.
|
|
454
443
|
*
|
|
455
|
-
* **
|
|
456
|
-
*
|
|
457
|
-
* only content is a 16px glyph, so `min-w-*` binds only while it stays under it: `sm` and `default`
|
|
458
|
-
* cleared that by coincidence (10+16+10 = 36, 12+16+12 = 40) and `lg` did not — `px-5` around a
|
|
459
|
-
* glyph is 56 against `h-12`, and an icon-only `lg` shipped 56×48. A **text** toggle is
|
|
460
|
-
* untouched at every size.
|
|
444
|
+
* Focus is an **outline held 2px off the box** rather than a flush ring, which would paint over the
|
|
445
|
+
* mark it has to be told apart from.
|
|
461
446
|
*/
|
|
462
447
|
declare const toggleVariants: (props?: ({
|
|
463
448
|
treatment?: "track" | "frame" | null | undefined;
|
|
@@ -471,22 +456,14 @@ declare const Toggle: React$1.ForwardRefExoticComponent<Omit<TogglePrimitive.Tog
|
|
|
471
456
|
} & class_variance_authority_types.ClassProp) | undefined) => string> & React$1.RefAttributes<HTMLButtonElement>>;
|
|
472
457
|
|
|
473
458
|
/**
|
|
474
|
-
* `type` answers "can nothing be selected?", and that is what decides how selection reads
|
|
459
|
+
* `type` answers "can nothing be selected?", and that is what decides how selection reads.
|
|
475
460
|
*
|
|
476
461
|
* `multiple` is a set of independent chips — a filter row, where nothing need be on — so each chip
|
|
477
|
-
* carries its own edge
|
|
478
|
-
* so it takes the segmented-control treatment (#346).
|
|
479
|
-
*
|
|
480
|
-
* A `single` set of **glyphs** is the exception, and it is the treatment's own limit rather than a
|
|
481
|
-
* special case: with no word to thicken the mark would be the tint alone, which greyscale erases.
|
|
482
|
-
* That set takes `frame`, the same as a `multiple` one (#755).
|
|
462
|
+
* carries its own edge. `single` is one object with a moving part, so it takes the track.
|
|
483
463
|
*
|
|
484
|
-
*
|
|
485
|
-
*
|
|
486
|
-
*
|
|
487
|
-
* against the unselected word — 1.19:1 and 1.35:1 with hue removed, so the weight step is the one
|
|
488
|
-
* channel that does not depend on seeing colour. There is no edge on the slot and no frame around
|
|
489
|
-
* the set: down a stacked list a frame put a rounded rectangle around every row.
|
|
464
|
+
* A `single` set of **glyphs** takes `frame` too. That is the treatment stating its own limit rather
|
|
465
|
+
* than an exception to it: the track leans on a weight step, and a glyph has no weight to step
|
|
466
|
+
* (`Guidelines/Look/Selection weight`).
|
|
490
467
|
*/
|
|
491
468
|
declare const ToggleGroup: React$1.ForwardRefExoticComponent<((Omit<ToggleGroupPrimitive.ToggleGroupSingleProps & React$1.RefAttributes<HTMLDivElement>, "ref"> | Omit<ToggleGroupPrimitive.ToggleGroupMultipleProps & React$1.RefAttributes<HTMLDivElement>, "ref">) & VariantProps<(props?: ({
|
|
492
469
|
treatment?: "track" | "frame" | null | undefined;
|
|
@@ -708,7 +685,7 @@ declare const MenubarShortcut: {
|
|
|
708
685
|
* is read as part of the ladder rather than as a state pill. See Guidelines/Colour marks actions.
|
|
709
686
|
*/
|
|
710
687
|
declare const badgeVariants: (props?: ({
|
|
711
|
-
variant?: "
|
|
688
|
+
variant?: "default" | "status" | "destructive" | "outline" | "secondary" | "danger-subtle" | "warning-subtle" | "neutral-subtle" | "success" | "warning" | null | undefined;
|
|
712
689
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
713
690
|
interface BadgeProps extends React$1.HTMLAttributes<HTMLDivElement>, VariantProps<typeof badgeVariants> {
|
|
714
691
|
}
|
|
@@ -744,7 +721,7 @@ declare const Skeleton: React$1.ForwardRefExoticComponent<React$1.HTMLAttributes
|
|
|
744
721
|
/**
|
|
745
722
|
* @deprecated Use `PersonAvatar` for a person, `GlyphAvatar` for an agent or a group, or
|
|
746
723
|
* `EntityTile` for an object. Those three share one size scale, a tint family that holds contrast in
|
|
747
|
-
* both themes, and a fallback that survives a 404.
|
|
724
|
+
* both themes, and a fallback that survives a 404. Removed in a future major.
|
|
748
725
|
*/
|
|
749
726
|
declare const Avatar: React$1.ForwardRefExoticComponent<Omit<AvatarPrimitive.AvatarProps & React$1.RefAttributes<HTMLSpanElement>, "ref"> & React$1.RefAttributes<HTMLSpanElement>>;
|
|
750
727
|
declare const AvatarImage: React$1.ForwardRefExoticComponent<Omit<AvatarPrimitive.AvatarImageProps & React$1.RefAttributes<HTMLImageElement>, "ref"> & React$1.RefAttributes<HTMLImageElement>>;
|
|
@@ -816,6 +793,18 @@ declare const Progress: React$1.ForwardRefExoticComponent<Omit<ProgressPrimitive
|
|
|
816
793
|
declare const AspectRatio: React$1.ForwardRefExoticComponent<AspectRatioPrimitive.AspectRatioProps & React$1.RefAttributes<HTMLDivElement>>;
|
|
817
794
|
|
|
818
795
|
declare const Tabs: React$1.ForwardRefExoticComponent<TabsPrimitive.TabsProps & React$1.RefAttributes<HTMLDivElement>>;
|
|
796
|
+
/**
|
|
797
|
+
* The track rests on `bg-surface` so the selected slot can be the sunken step every other selection
|
|
798
|
+
* in the console is: 1.167:1 against the track in light and 1.201:1 in dark, with the word at 600 in
|
|
799
|
+
* `text-primary` against the resting 500 in `text-secondary`, 1.76:1 and 2.04:1. Neither channel is
|
|
800
|
+
* hue and neither is a shadow.
|
|
801
|
+
*
|
|
802
|
+
* A recessed track cannot hold the mark. On `bg-secondary` the sunken step is 1.126:1 in light and
|
|
803
|
+
* 1.034:1 in dark — invisible — because `bg-secondary` is already near the bottom of the surface
|
|
804
|
+
* stack in dark. Raising the track instead of inverting the step keeps one direction for "selected"
|
|
805
|
+
* across the kit. On a `bg-surface` card the track itself disappears, which is what `ToggleGroup`'s
|
|
806
|
+
* track already does: the set is read from its slots, not from a frame around them.
|
|
807
|
+
*/
|
|
819
808
|
declare const TabsList: React$1.ForwardRefExoticComponent<Omit<TabsPrimitive.TabsListProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
|
|
820
809
|
declare const TabsTrigger: React$1.ForwardRefExoticComponent<Omit<TabsPrimitive.TabsTriggerProps & React$1.RefAttributes<HTMLButtonElement>, "ref"> & React$1.RefAttributes<HTMLButtonElement>>;
|
|
821
810
|
declare const TabsContent: React$1.ForwardRefExoticComponent<Omit<TabsPrimitive.TabsContentProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
|
|
@@ -2300,6 +2289,18 @@ declare const RemovableChip: React$1.ForwardRefExoticComponent<RemovableChipProp
|
|
|
2300
2289
|
/** True when the viewport is narrower than the `md` breakpoint (768px). SSR-safe. */
|
|
2301
2290
|
declare function useIsMobile(): boolean;
|
|
2302
2291
|
|
|
2292
|
+
interface UseFreshHighlightResult {
|
|
2293
|
+
/** True for the id most recently passed to `markFresh`, until the class is dropped. */
|
|
2294
|
+
isFresh: (id: string) => boolean;
|
|
2295
|
+
/** Mark an id fresh, optionally announcing it to screen readers. */
|
|
2296
|
+
markFresh: (id: string, announce?: string) => void;
|
|
2297
|
+
/** Callback ref for the fresh element — scrolls it into view only if it is off-screen. */
|
|
2298
|
+
freshRef: (el: HTMLElement | null) => void;
|
|
2299
|
+
/** The polite live region. Render it once, anywhere in the tree. */
|
|
2300
|
+
announcer: React$1.ReactElement;
|
|
2301
|
+
}
|
|
2302
|
+
declare function useFreshHighlight(): UseFreshHighlightResult;
|
|
2303
|
+
|
|
2303
2304
|
interface UseSidebarOptions {
|
|
2304
2305
|
/** Controlled collapsed value. When provided, the hook does not own state. */
|
|
2305
2306
|
collapsed?: boolean;
|
|
@@ -3383,4 +3384,102 @@ interface SecretRevealProps extends Omit<React$1.HTMLAttributes<HTMLDivElement>,
|
|
|
3383
3384
|
}
|
|
3384
3385
|
declare const SecretReveal: React$1.ForwardRefExoticComponent<SecretRevealProps & React$1.RefAttributes<HTMLDivElement>>;
|
|
3385
3386
|
|
|
3386
|
-
|
|
3387
|
+
/**
|
|
3388
|
+
* The mark is a **fill**, never a hue. A rating is a state, and state carries no colour here
|
|
3389
|
+
* (`Guidelines/Look/Colour marks actions`) — so the amber star every other kit reaches for is out.
|
|
3390
|
+
* What is left is the glyph's own two channels: an unrated star is the outline at
|
|
3391
|
+
* `text-text-tertiary`, a rated one is the same outline filled at `text-text-primary`. Solid against
|
|
3392
|
+
* hollow survives greyscale the way the weight step does, and reads the same in both themes.
|
|
3393
|
+
*
|
|
3394
|
+
* **Cumulative, not per-slot.** Star N standing for "N out of max" means the pointer over star 3
|
|
3395
|
+
* fills 1–3, and a value of 3 rests with 1–3 filled. So the preview is one index the row holds, not
|
|
3396
|
+
* a hover state each star owns — a `:hover` rule per star can only ever light the one under the
|
|
3397
|
+
* cursor.
|
|
3398
|
+
*
|
|
3399
|
+
* **A radio group, because that is what it is:** one value out of an ordered few. Radix gives the
|
|
3400
|
+
* roving tabindex, the arrow keys and the `radiogroup`/`radio` roles; wrapping it means the keyboard
|
|
3401
|
+
* story is not re-derived here. Each star needs a name a screen reader can read on its own, and
|
|
3402
|
+
* "3 stars" is not one — `itemLabel` writes the whole phrase.
|
|
3403
|
+
*/
|
|
3404
|
+
declare const STAR_BOX: {
|
|
3405
|
+
readonly sm: "size-4";
|
|
3406
|
+
readonly md: "size-5";
|
|
3407
|
+
readonly lg: "size-6";
|
|
3408
|
+
};
|
|
3409
|
+
type StarRatingSize = keyof typeof STAR_BOX;
|
|
3410
|
+
interface StarRatingProps extends Omit<React$1.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Root>, 'value' | 'defaultValue' | 'onValueChange' | 'dir'> {
|
|
3411
|
+
/** The rating, 1..`max`. `0` is "not rated yet" and rests with every star hollow. */
|
|
3412
|
+
value?: number;
|
|
3413
|
+
defaultValue?: number;
|
|
3414
|
+
onValueChange?: (value: number) => void;
|
|
3415
|
+
/** How many stars the scale has. */
|
|
3416
|
+
max?: number;
|
|
3417
|
+
/**
|
|
3418
|
+
* The lowest answer the scale accepts. `1` is a mandatory rating; `0` lets it be cleared —
|
|
3419
|
+
* pressing the resting star again, or `Backspace`/`Delete`, takes the row back to no rating.
|
|
3420
|
+
* There is no zeroth star to click, because "no answer" is the absence of a mark and not one.
|
|
3421
|
+
*/
|
|
3422
|
+
min?: 0 | 1;
|
|
3423
|
+
size?: StarRatingSize;
|
|
3424
|
+
/**
|
|
3425
|
+
* Shows the value and takes no input — an average on a list row, a rating already given. Renders
|
|
3426
|
+
* one labelled image rather than a set of controls, because there is nothing to choose.
|
|
3427
|
+
*/
|
|
3428
|
+
readOnly?: boolean;
|
|
3429
|
+
/** The accessible name of each star. The default reads "3 out of 5 stars". */
|
|
3430
|
+
itemLabel?: (value: number, max: number) => string;
|
|
3431
|
+
/** The accessible name of the whole scale, read once before the stars. */
|
|
3432
|
+
'aria-label'?: string;
|
|
3433
|
+
}
|
|
3434
|
+
declare const StarRating: React$1.ForwardRefExoticComponent<StarRatingProps & React$1.RefAttributes<HTMLDivElement>>;
|
|
3435
|
+
|
|
3436
|
+
/**
|
|
3437
|
+
* A row of numbered slots for the questions a star cannot answer — an NPS 0..10, an effort 1..5.
|
|
3438
|
+
*
|
|
3439
|
+
* **The mark is the hairline stepped up, plus the weight step.** A scale is a set where nothing need
|
|
3440
|
+
* be on until someone answers, so it takes the frame treatment rather than the sunken plate
|
|
3441
|
+
* (`Guidelines/Look/Selection weight`): every slot is a box you click to answer a question, so it
|
|
3442
|
+
* rests on the `--field-border` family like any other field (`Guidelines/Look/Borders`), and the
|
|
3443
|
+
* chosen one steps to `border-border-strong` and thickens its number. That is 5.17:1 light and
|
|
3444
|
+
* 5.47:1 dark, where the plate alone measures 1.208:1 and 1.109:1 — a selected slate that is
|
|
3445
|
+
* legible in dark is the whole reason this is a component and not eleven buttons per product.
|
|
3446
|
+
*
|
|
3447
|
+
* **Every slot is the same box, one digit or two.** The width is a `min-w-*` a two-digit label
|
|
3448
|
+
* cannot exceed at this type step, and the digits are `tabular-nums`, so `10` is the same object as
|
|
3449
|
+
* `9` and the row does not stagger at its end.
|
|
3450
|
+
*
|
|
3451
|
+
* A radio group underneath, like `StarRating`: arrow keys walk the scale, and each slot's number is
|
|
3452
|
+
* not a name a screen reader can use on its own, so `itemLabel` writes the phrase.
|
|
3453
|
+
*/
|
|
3454
|
+
declare const SLOT_BOX: {
|
|
3455
|
+
readonly sm: "h-8 min-w-8 px-2 text-xs";
|
|
3456
|
+
readonly md: "h-9 min-w-9 px-2 text-sm";
|
|
3457
|
+
readonly lg: "h-11 min-w-11 px-3 text-base";
|
|
3458
|
+
};
|
|
3459
|
+
type RatingScaleSize = keyof typeof SLOT_BOX;
|
|
3460
|
+
interface RatingScaleProps extends Omit<React$1.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Root>, 'value' | 'defaultValue' | 'onValueChange' | 'dir'> {
|
|
3461
|
+
value?: number;
|
|
3462
|
+
defaultValue?: number;
|
|
3463
|
+
onValueChange?: (value: number) => void;
|
|
3464
|
+
/** The first slot. `0` for an NPS, `1` for a 1..5 effort scale. */
|
|
3465
|
+
min?: number;
|
|
3466
|
+
/** The last slot. */
|
|
3467
|
+
max?: number;
|
|
3468
|
+
size?: RatingScaleSize;
|
|
3469
|
+
/** Shows the answer and takes no input. */
|
|
3470
|
+
readOnly?: boolean;
|
|
3471
|
+
/**
|
|
3472
|
+
* The words under the two ends — "Not at all likely" / "Extremely likely". Both or neither: one
|
|
3473
|
+
* end labelled alone leaves the row telling you which way it runs only half the time.
|
|
3474
|
+
*/
|
|
3475
|
+
endLabels?: {
|
|
3476
|
+
low: string;
|
|
3477
|
+
high: string;
|
|
3478
|
+
};
|
|
3479
|
+
/** The accessible name of each slot. The default reads "7 out of 10". */
|
|
3480
|
+
itemLabel?: (value: number, min: number, max: number) => string;
|
|
3481
|
+
'aria-label'?: string;
|
|
3482
|
+
}
|
|
3483
|
+
declare const RatingScale: React$1.ForwardRefExoticComponent<RatingScaleProps & React$1.RefAttributes<HTMLDivElement>>;
|
|
3484
|
+
|
|
3485
|
+
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, AddPicker, type AddPickerItem, type AddPickerProps, Alert, AlertDescription, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AlertTitle, AspectRatio, AttachmentChip, type AttachmentChipProps, type AttachmentState, AutoHeight, type AutoHeightProps, Avatar, AvatarFallback, AvatarImage, BackLink, type BackLinkProps, Badge, type BadgeProps, type BeneficialOwnerPayload, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, type ButtonProps, COUNTRY_OPTIONS, Calendar, type CalendarProps, Card, CardContent, CardDescription, CardFooter, CardHeader, CardNote, type CardNoteProps, type CardProps, CardTitle, type CardTitleProps, Carousel, type CarouselApi, CarouselContent, type CarouselContextProps, CarouselItem, CarouselNext, type CarouselOptions, type CarouselPlugin, CarouselPrevious, type CarouselProps, Checkbox, Code, CodeBlock, type CodeBlockProps, type CodeLang, type CodeProps, type CodeVariant, Col, type ColProps, Collapsible, CollapsibleContent, CollapsibleTrigger, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, type CommandItemProps, CommandList, CommandSeparator, CommandShortcut, ConfirmDialog, type ConfirmDialogProps, type ConfirmDialogStepUp, ConnectorCard, type ConnectorCardProps, type ConnectorOrigin, type ConnectorStatus, ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuPortal, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger, CopyButton, type CopyButtonProps, DatePicker, type DatePickerProps, DecorativeIcon, type DecorativeIconProps, type DeltaDirection, type DeltaTone, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DocsLink, type DocsLinkProps, Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, EmptyState, type EmptyStateProps, EntityRow, type EntityRowOpens, type EntityRowOpensProps, type EntityRowProps, EntityTile, type EntityTileProps, ExtensionIcon, type ExtensionIconProps, FeedbackButton, type FeedbackButtonLabels, type FeedbackButtonProps, Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, GlyphAvatar, type GlyphAvatarProps, type GrantRole, type GrantRoleNotes, GrantRolePicker, type GrantRolePickerProps, GrantRow, type GrantRowProps, Grid, GridOverlay, type GridOverlayProps, type GridProps, HoverCard, HoverCardContent, HoverCardTrigger, IconHint, type IconHintProps, ImageCropDialog, type ImageCropDialogProps, type ImageCropShape, type ImageCropType, ImageCropper, type ImageCropperProps, ImageUpload, type ImageUploadProps, type ImageUploadSize, InlineError, type InlineErrorProps, Input, InputAddon, type InputAddonProps, InputGroup, InputGroupInput, type InputGroupInputProps, type InputGroupProps, InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot, type InputProps, Label, ListCells, type ListCellsProps, type ListColumn, type ListColumnWidth, ListHeader, type ListHeaderProps, MISSING_TONE, Medallion, type MedallionProps, MenuDivider, MenuPopup, type MenuPopupProps, Menubar, MenubarCheckboxItem, MenubarContent, MenubarGroup, MenubarItem, MenubarLabel, MenubarMenu, MenubarPortal, MenubarRadioGroup, MenubarRadioItem, MenubarSeparator, MenubarShortcut, MenubarSub, MenubarSubContent, MenubarSubTrigger, MenubarTrigger, NavRow, type NavRowProps, type NavRowVariant, NavSectionLabel, type NavSectionLabelProps, NavigationMenu, NavigationMenuContent, NavigationMenuIndicator, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuTrigger, NavigationMenuViewport, type NotifClass, type NotificationAction, NotificationBell, type NotificationBellProps, NotificationCenter, type NotificationCenterProps, type NotificationClass, type NotificationDeepLink, type NotificationItem, type NotificationMute, type NotificationPreferences, type NotificationProduct, NotificationRow, type NotificationRowProps, NotificationSettings, type NotificationSettingsProps, type NotificationSeverity, type NotificationSubscription, type NotificationThreshold, NotificationToast, type NotificationToastDwell, type NotificationToastProps, NotificationToaster, type NotificationToasterPosition, type NotificationToasterProps, OptionCard, type OptionCardProps, OrgProductSwitcher, type OrgProductSwitcherAction, type OrgProductSwitcherItem, type OrgProductSwitcherProps, type OrganizationOnboardingDefaults, OrganizationOnboardingForm, type OrganizationOnboardingFormProps, type OrganizationOnboardingPayload, PageColumn, type PageColumnProps, PageHeader, type PageHeaderProps, Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, type PaginationLinkProps, PaginationNext, PaginationPrevious, PersonAvatar, type PersonAvatarProps, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, Progress, RadioGroup, RadioGroupItem, RatingScale, type RatingScaleProps, type RatingScaleSize, RemovableChip, type RemovableChipProps, RemoveButton, type RemoveButtonProps, RequestRow, type RequestRowProps, type RequestState, type RequestSurface, type ResolvedTheme, type Responsive, ScrollArea, ScrollBar, SecretReveal, type SecretRevealProps, SectionIntro, type SectionIntroProps, Select, type SelectOption, type SelectProps, Separator, SettingRow, type SettingRowProps, type Severity, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, SidebarBackHeader, type SidebarBackHeaderProps, SidebarProductHeader, type SidebarProductHeaderProps, Skeleton, Slider, StarRating, type StarRatingProps, type StarRatingSize, StatCard, type StatCardProps, StatusDot, type StatusDotProps, StepUpChallenge, type StepUpChallengeProps, type StepUpMethod, type StepUpProof, Switch, type SwitchProps, TOAST_DWELL, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, type TableProps, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, type TextareaProps, type Theme, ThemePicker, type ThemePickerProps, ThemeToggle, Toaster, Toggle, ToggleGroup, ToggleGroupItem, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, TopBar, type TopBarProps, TopBarUtilities, type TopBarUtilitiesProps, type TopBarUtility, type UseFreshHighlightResult, type UseSidebarOptions, type UseSidebarResult, UserMenu, type UserMenuItem, type UserMenuProps, type UserMenuUser, WEIGHT_TONE, alertVariants, attachmentChipVariants, badgeVariants, buttonVariants, cn, formatRelativeAge, grantRemoveLabel, isKnownExtensionIcon, isNotificationSettled, navigationMenuTriggerStyle, severityBadgeVariant, severityLabels, statusDotVariants, toggleVariants, useCarousel, useFormField, useFreshHighlight, useIsMobile, useSidebar, useTheme };
|