@espressif/dashboard-ui-components 1.12.0 → 1.13.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.
Files changed (40) hide show
  1. package/.claude/rules/dashboard-ui-consumption.md +22 -2
  2. package/.cursor/rules/dashboard-ui-consumption.mdc +22 -2
  3. package/CHANGELOG.md +43 -0
  4. package/README.md +9 -4
  5. package/dist/components/cards/section-card.js +37 -29
  6. package/dist/components/floating-window/_hooks/use-drag-move.js +1 -0
  7. package/dist/components/floating-window/_hooks/use-resize.js +133 -0
  8. package/dist/components/floating-window/floating-window.js +67 -40
  9. package/dist/components/floating-window/index.d.ts +21 -2
  10. package/dist/components/horizontal-stepper/index.d.ts +1 -1
  11. package/dist/components/index.d.ts +5 -1
  12. package/dist/components/index.js +11 -6
  13. package/dist/components/keyframes/index.d.ts +53 -0
  14. package/dist/components/keyframes/index.js +3 -0
  15. package/dist/components/keyframes/keyframes-motion.js +23 -0
  16. package/dist/components/keyframes/keyframes.js +37 -0
  17. package/dist/components/qr-code/index.d.ts +26 -0
  18. package/dist/components/qr-code/index.js +2 -0
  19. package/dist/components/qr-code/qr-code.js +69 -0
  20. package/dist/components/range-field/index.d.ts +45 -0
  21. package/dist/components/range-field/index.js +2 -0
  22. package/dist/components/range-field/range-field.js +164 -0
  23. package/dist/components/reveal/index.d.ts +6 -3
  24. package/dist/components/reveal/reveal.js +7 -4
  25. package/dist/components/search-box/index.d.ts +3 -1
  26. package/dist/components/search-box/search-box.js +7 -12
  27. package/dist/components/showcase-card/index.d.ts +14 -3
  28. package/dist/components/showcase-card/showcase-card.js +43 -2
  29. package/dist/components/simple-clickable-card/simple-clickable-card-shared.js +3 -1
  30. package/dist/components/step-tabs/index.d.ts +1 -1
  31. package/dist/components/trace/index.d.ts +49 -0
  32. package/dist/components/trace/index.js +2 -0
  33. package/dist/components/trace/trace.js +109 -0
  34. package/dist/components/vertical-stepper/index.d.ts +2 -2
  35. package/dist/components/vertical-stepper/vertical-stepper.js +7 -4
  36. package/dist/index.d.ts +5 -1
  37. package/dist/index.js +11 -6
  38. package/dist/{vertical-stepper.props-BXYcbW70.d.ts → vertical-stepper.props-DONJJXIy.d.ts} +1 -0
  39. package/package.json +7 -1
  40. package/src/styles/theme.css +15 -0
@@ -67,6 +67,12 @@ import { FloatingWindow } from "./floating-window/floating-window.js";
67
67
  import { IconTextActionCard } from "./icon-text-action-card/icon-text-action-card.js";
68
68
  import { Alert } from "./alert/alert.js";
69
69
  import { NoticeStrip } from "./notice-strip/notice-strip.js";
70
+ import { GlitchText } from "./text-effects/glitch-effect/glitch-text.js";
71
+ import { GradientText } from "./text-effects/gradient-text/gradient-text.js";
72
+ import { HighlightText } from "./text-effects/highlight-text/highlight-text.js";
73
+ import { ShimmeringText } from "./text-effects/shimmer-text/shimmer-text.js";
74
+ import { parseTextMarkup } from "./text-effects/parse-text-markup.js";
75
+ import { Trace, TraceCollapsible, TraceCollapsibleContent, TraceCollapsibleTrigger, TraceDescription, TraceIcon, TraceLine, TraceTitle } from "./trace/trace.js";
70
76
  import { Readout } from "./readout/readout.js";
71
77
  import { ChoiceCard } from "./choice-card/choice-card.js";
72
78
  import { MediaCard, MediaCardAction, MediaCardBody, MediaCardFooter, MediaCardLink, MediaCardMedia, MediaCardMeta, MediaCardTitle } from "./media-card/media-card.js";
@@ -84,6 +90,10 @@ import { supportsViewTransitions, useFiltersCollapsed } from "./facet-filters/us
84
90
  import { InputGroup, InputGroupAddon, InputGroupTextarea } from "./input-group/input-group.js";
85
91
  import { Bubble } from "./bubble/bubble.js";
86
92
  import { Reveal } from "./reveal/reveal.js";
93
+ import { QrCode } from "./qr-code/qr-code.js";
94
+ import { RangeField } from "./range-field/range-field.js";
95
+ import { KeyframesMotion, easeOutSplines, keyTimes } from "./keyframes/keyframes-motion.js";
96
+ import { Keyframes } from "./keyframes/keyframes.js";
87
97
  import { CheckBadge } from "./check-badge/check-badge.js";
88
98
  import { MessageScroller } from "./message-scroller/message-scroller.js";
89
99
  import { ResizableGroup } from "./resizable/resizable-group.js";
@@ -173,13 +183,8 @@ import { InlineError } from "./error-display/inline-error/inline-error.js";
173
183
  import { SimpleClickableCard } from "./simple-clickable-card/simple-clickable-card.js";
174
184
  import { CategoryCard } from "./category-card/category-card.js";
175
185
  import { SimpleInfoCard } from "./simple-info-card/simple-info-card.js";
176
- import { GlitchText } from "./text-effects/glitch-effect/glitch-text.js";
177
- import { GradientText } from "./text-effects/gradient-text/gradient-text.js";
178
- import { HighlightText } from "./text-effects/highlight-text/highlight-text.js";
179
- import { ShimmeringText } from "./text-effects/shimmer-text/shimmer-text.js";
180
- import { parseTextMarkup } from "./text-effects/parse-text-markup.js";
181
186
  import { CodeEditor } from "./code-editor/code-editor.js";
182
187
  import { ContentContainer } from "./content-container/content-container.js";
183
188
  import PageContainer from "./page-container/page-container.js";
184
189
  import PageContainerSkeleton from "./page-container/page-container-skeleton.js";
185
- export { Accordion, ActiveFilters, AdvancedSearchBox, Alert, AnchoredPanel, AnimatedCard, AreaChart, AsyncCombobox, AsyncMultiSelect, Avatar, AvatarGroup, BORDERS, Badge, BarChart, BasicDetailsCard, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Bubble, Button, ButtonGroup, ButtonGroupSeparator, ButtonGroupText, CHART_CATEGORY_COLORS, CHART_SERIES_COLORS, Calendar, CalendarDayButton, Card, CardContent, CardDescription, CardFooter, CardHeader, CardRail, CardTitle, Carousel, CategoryCard, ChartContainer, ChartLegend, ChartLegendContent, ChartLegendList, ChartStyle, ChartTooltip, ChartTooltipContent, CheckBadge, Checkbox, ChoiceCard, CircularProgress, Code, CodeEditor, Collapsible, CollapsibleCard, CollapsibleContent, CollapsibleTrigger, ColumnPanel, ComposedChart, ConfirmationDialog, ContentContainer, CopiableText, CopyButton, Coverflow, DEFAULT_CHART_SERIES_COLORS, DEFAULT_PAGE_SIZE_OPTIONS, DENSITIES, DataTable, DataTableRowActions, DatePicker, DateRangePicker, DateTimePicker, DeviceIcon, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger, DonutChart, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, DynamicList, ELEVATIONS, ExpandableText, FeatureGrid, FileInput, FileUpload, FilterGroup, FiltersBar, FiltersPanel, FiltersPill, FlashButton, FlipCard, FloatingWindow, Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, FullSizeError, FullscreenDialog, GlitchText, GradientText, HighlightText, HorizontalStepper, IconAvatar, IconTextActionCard, Identicon, Illustration, InlineError, Input, InputGroup, InputGroupAddon, InputGroupTextarea, InputOTP, InputOTPSeparator, InputPassword, InvertButton, KeyValueManager, LIST_CLASS_NAMES, Label, LineChart, Link, List, ListDetails, LottieAnimationContainer, MarkdownContent, MediaCard, MediaCardAction, MediaCardBody, MediaCardFooter, MediaCardImage, MediaCardLink, MediaCardMedia, MediaCardMeta, MediaCardReveal, MediaCardRevealChips, MediaCardRevealFooter, MediaCardRevealItem, MediaCardTitle, MediaStage, Menu, MessageScroller, MiniBarChart, MonospaceContent, NavBar, NoDataCard, NoticeStrip, OptionCardGroup, OverflowBadgeList, PRESET_GRADIENT_BACKDROP, PRESET_GRADIENT_FRAME, PRESET_IDS, PRESET_LABELS, PageBanner, PageContainer, PageContainerSkeleton, Pagination, PopCollectionItem, Popover, PopoverAnchor, PopoverContent, PopoverGroup, PopoverTrigger, PreviewCard, PreviewCardBackdrop, PreviewCardPanel, PreviewCardTrigger, ProgressBar, RADII, ROLLING_PRESET_IDS, RadioGroup, RankNumeral, ReactionButton, Readout, RequirementList, ResizableGroup, ResizablePanel, ResizableSeparator, Reveal, ScrollArea, ScrollBar, ScrollableSections, SearchBox, SectionCard, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, SelectableCardList, Separator, ShareMenu, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger, ShimmeringText, ShowcaseCard, Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, Sidebar$1 as SidebarPrimitive, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, SimpleCard, SimpleClickableCard, SimpleInfoCard, SimpleList, SimplePaginatedList, SimplifiedDate, Skeleton, SortMenu, Spinner, StatCard, StatusBadge, StatusCardList, StepTabs, StyleScope, Switch, TYPOGRAPHY_VARIANTS, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, TableSkeleton, Tabs, TabsContent, TabsContents, TabsList, TabsTrigger, Tag, TagInput, Textarea, ThumbnailStrip, TimePicker, Timeline, Toast, Toaster, TogglableItemsList, ToggleGroup, ToggleGroupItem, Toolbar, ToolbarButton, Tooltip, TooltipContent, TooltipProvider, Tooltip$1 as TooltipRoot, TooltipTrigger, TransferList, TreemapChart, TruncatedLineWithTooltip, Typography, UserTypeBadge, VARIANTS, VARIANT_GRADIENT_BACKDROP_BASE, VARIANT_GRADIENT_DURATION_CLASS, VARIANT_GRADIENT_HOVER_OVERLAY_CLASS, VARIANT_GRADIENT_TRANSITION_DURATION_MS, VerificationInProgress, VerticalStepper, ViewToggle, animatedCardAnimations, animatedCardTypeKeys, arbitraryGradientBackgroundImage, badgeVariants, buildSeriesChartConfig, buttonGroupVariants, buttonVariants, computeDateRange, densityStyle, getChartSeriesColor, illustrationRegistry, illustrationsById, isSidebarGroup, listStyleValues, listVariants, parseSvgViewBoxAspectRatio, parseTextMarkup, registerDensity, registerStyleValue, registerVariant, resolveDensity, resolveStyleValue, resolveVariantStyles, statusBadgeSizeVariants, supportsViewTransitions, toast, typographyDefaultElement, typographyVariantClasses, useFiltersCollapsed, useFormField, useIsMobile, usePanelFlag, useSidebar, useStyleAxes, userTypeBadgeRegistry, userTypeBadgeSizeVariants, userTypeBadgeUserTypes };
190
+ export { Accordion, ActiveFilters, AdvancedSearchBox, Alert, AnchoredPanel, AnimatedCard, AreaChart, AsyncCombobox, AsyncMultiSelect, Avatar, AvatarGroup, BORDERS, Badge, BarChart, BasicDetailsCard, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Bubble, Button, ButtonGroup, ButtonGroupSeparator, ButtonGroupText, CHART_CATEGORY_COLORS, CHART_SERIES_COLORS, Calendar, CalendarDayButton, Card, CardContent, CardDescription, CardFooter, CardHeader, CardRail, CardTitle, Carousel, CategoryCard, ChartContainer, ChartLegend, ChartLegendContent, ChartLegendList, ChartStyle, ChartTooltip, ChartTooltipContent, CheckBadge, Checkbox, ChoiceCard, CircularProgress, Code, CodeEditor, Collapsible, CollapsibleCard, CollapsibleContent, CollapsibleTrigger, ColumnPanel, ComposedChart, ConfirmationDialog, ContentContainer, CopiableText, CopyButton, Coverflow, DEFAULT_CHART_SERIES_COLORS, DEFAULT_PAGE_SIZE_OPTIONS, DENSITIES, DataTable, DataTableRowActions, DatePicker, DateRangePicker, DateTimePicker, DeviceIcon, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger, DonutChart, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, DynamicList, ELEVATIONS, ExpandableText, FeatureGrid, FileInput, FileUpload, FilterGroup, FiltersBar, FiltersPanel, FiltersPill, FlashButton, FlipCard, FloatingWindow, Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, FullSizeError, FullscreenDialog, GlitchText, GradientText, HighlightText, HorizontalStepper, IconAvatar, IconTextActionCard, Identicon, Illustration, InlineError, Input, InputGroup, InputGroupAddon, InputGroupTextarea, InputOTP, InputOTPSeparator, InputPassword, InvertButton, KeyValueManager, Keyframes, KeyframesMotion, LIST_CLASS_NAMES, Label, LineChart, Link, List, ListDetails, LottieAnimationContainer, MarkdownContent, MediaCard, MediaCardAction, MediaCardBody, MediaCardFooter, MediaCardImage, MediaCardLink, MediaCardMedia, MediaCardMeta, MediaCardReveal, MediaCardRevealChips, MediaCardRevealFooter, MediaCardRevealItem, MediaCardTitle, MediaStage, Menu, MessageScroller, MiniBarChart, MonospaceContent, NavBar, NoDataCard, NoticeStrip, OptionCardGroup, OverflowBadgeList, PRESET_GRADIENT_BACKDROP, PRESET_GRADIENT_FRAME, PRESET_IDS, PRESET_LABELS, PageBanner, PageContainer, PageContainerSkeleton, Pagination, PopCollectionItem, Popover, PopoverAnchor, PopoverContent, PopoverGroup, PopoverTrigger, PreviewCard, PreviewCardBackdrop, PreviewCardPanel, PreviewCardTrigger, ProgressBar, QrCode, RADII, ROLLING_PRESET_IDS, RadioGroup, RangeField, RankNumeral, ReactionButton, Readout, RequirementList, ResizableGroup, ResizablePanel, ResizableSeparator, Reveal, ScrollArea, ScrollBar, ScrollableSections, SearchBox, SectionCard, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, SelectableCardList, Separator, ShareMenu, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger, ShimmeringText, ShowcaseCard, Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, Sidebar$1 as SidebarPrimitive, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, SimpleCard, SimpleClickableCard, SimpleInfoCard, SimpleList, SimplePaginatedList, SimplifiedDate, Skeleton, SortMenu, Spinner, StatCard, StatusBadge, StatusCardList, StepTabs, StyleScope, Switch, TYPOGRAPHY_VARIANTS, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, TableSkeleton, Tabs, TabsContent, TabsContents, TabsList, TabsTrigger, Tag, TagInput, Textarea, ThumbnailStrip, TimePicker, Timeline, Toast, Toaster, TogglableItemsList, ToggleGroup, ToggleGroupItem, Toolbar, ToolbarButton, Tooltip, TooltipContent, TooltipProvider, Tooltip$1 as TooltipRoot, TooltipTrigger, Trace, TraceCollapsible, TraceCollapsibleContent, TraceCollapsibleTrigger, TraceDescription, TraceIcon, TraceLine, TraceTitle, TransferList, TreemapChart, TruncatedLineWithTooltip, Typography, UserTypeBadge, VARIANTS, VARIANT_GRADIENT_BACKDROP_BASE, VARIANT_GRADIENT_DURATION_CLASS, VARIANT_GRADIENT_HOVER_OVERLAY_CLASS, VARIANT_GRADIENT_TRANSITION_DURATION_MS, VerificationInProgress, VerticalStepper, ViewToggle, animatedCardAnimations, animatedCardTypeKeys, arbitraryGradientBackgroundImage, badgeVariants, buildSeriesChartConfig, buttonGroupVariants, buttonVariants, computeDateRange, densityStyle, easeOutSplines, getChartSeriesColor, illustrationRegistry, illustrationsById, isSidebarGroup, keyTimes, listStyleValues, listVariants, parseSvgViewBoxAspectRatio, parseTextMarkup, registerDensity, registerStyleValue, registerVariant, resolveDensity, resolveStyleValue, resolveVariantStyles, statusBadgeSizeVariants, supportsViewTransitions, toast, typographyDefaultElement, typographyVariantClasses, useFiltersCollapsed, useFormField, useIsMobile, usePanelFlag, useSidebar, useStyleAxes, userTypeBadgeRegistry, userTypeBadgeSizeVariants, userTypeBadgeUserTypes };
@@ -0,0 +1,53 @@
1
+ import * as React from 'react';
2
+
3
+ interface KeyframesProps {
4
+ /** The attribute animated: `opacity`, `stroke-dashoffset`, … or `transform`. */
5
+ attributeName: string;
6
+ /** For `transform` only: `translate`, `scale` or `rotate`. */
7
+ type?: "translate" | "scale" | "rotate";
8
+ /** One value per time. */
9
+ values: readonly (number | string)[];
10
+ /**
11
+ * When each value is reached, in seconds from the scene"s start; the first
12
+ * is normally 0, so the element holds its first value until the second
13
+ * time. The last value stays (`fill="freeze"`) unless `repeat` is set.
14
+ */
15
+ times: readonly number[];
16
+ /** Loop for as long as the scene shows. */
17
+ repeat?: boolean;
18
+ /**
19
+ * `discrete` jumps from value to value at each time instead of easing
20
+ * between them: a label swapped for another, a screen for the next.
21
+ */
22
+ calcMode?: "linear" | "discrete";
23
+ /**
24
+ * `out` eases every step out (fast start, soft landing) — a stroke drawing
25
+ * itself, a badge settling. Ignored with `calcMode`.
26
+ */
27
+ ease?: "out";
28
+ }
29
+
30
+ /**
31
+ * One SMIL animation on its parent SVG element, written as values at times —
32
+ * the timing is data, never `style`. Every animation starts with the scene,
33
+ * so an element waits on its first value rather than flashing its resting
34
+ * state before a `begin`. Renders nothing unless a `KeyframesMotion` provider
35
+ * says the scene may animate; the parent's own attributes are then its
36
+ * resting frame, which is why they are always written as the LAST value.
37
+ */
38
+ declare function Keyframes({ attributeName, type, values, times, repeat, calcMode, ease }: KeyframesProps): React.JSX.Element | null;
39
+
40
+ /**
41
+ * Whether the SVG scene showing may animate. Provide it once around the
42
+ * scene, `false` when the person prefers reduced motion: every
43
+ * `<Keyframes>` inside then renders nothing, and the scene shows its resting
44
+ * (final) frame. Default `false`, so a `<Keyframes>` with no provider stays
45
+ * still.
46
+ */
47
+ declare const KeyframesMotion: React.Context<boolean>;
48
+ /** SMIL `keyTimes` for `times` in seconds: each one as a fraction of the last. */
49
+ declare function keyTimes(times: readonly number[]): string;
50
+ /** SMIL `keySplines` easing each of the `count - 1` steps between `count` values out. */
51
+ declare function easeOutSplines(count: number): string;
52
+
53
+ export { Keyframes, KeyframesMotion, type KeyframesProps, easeOutSplines, keyTimes };
@@ -0,0 +1,3 @@
1
+ import { KeyframesMotion, easeOutSplines, keyTimes } from "./keyframes-motion.js";
2
+ import { Keyframes } from "./keyframes.js";
3
+ export { Keyframes, KeyframesMotion, easeOutSplines, keyTimes };
@@ -0,0 +1,23 @@
1
+ import { createContext } from "react";
2
+ //#region src/components/keyframes/keyframes-motion.ts
3
+ /**
4
+ * Whether the SVG scene showing may animate. Provide it once around the
5
+ * scene, `false` when the person prefers reduced motion: every
6
+ * `<Keyframes>` inside then renders nothing, and the scene shows its resting
7
+ * (final) frame. Default `false`, so a `<Keyframes>` with no provider stays
8
+ * still.
9
+ */
10
+ var KeyframesMotion = createContext(false);
11
+ /** SMIL `keyTimes` for `times` in seconds: each one as a fraction of the last. */
12
+ function keyTimes(times) {
13
+ const total = times[times.length - 1] ?? 0;
14
+ if (total <= 0) return times.map(() => 0).join(";");
15
+ return times.map((time) => Number((time / total).toFixed(4))).join(";");
16
+ }
17
+ var EASE_OUT = "0 0 0.58 1";
18
+ /** SMIL `keySplines` easing each of the `count - 1` steps between `count` values out. */
19
+ function easeOutSplines(count) {
20
+ return Array.from({ length: Math.max(count - 1, 1) }, () => EASE_OUT).join(";");
21
+ }
22
+ //#endregion
23
+ export { KeyframesMotion, easeOutSplines, keyTimes };
@@ -0,0 +1,37 @@
1
+ import { KeyframesMotion, easeOutSplines, keyTimes } from "./keyframes-motion.js";
2
+ import { useContext } from "react";
3
+ import { jsx } from "react/jsx-runtime";
4
+ //#region src/components/keyframes/keyframes.tsx
5
+ /**
6
+ * One SMIL animation on its parent SVG element, written as values at times —
7
+ * the timing is data, never `style`. Every animation starts with the scene,
8
+ * so an element waits on its first value rather than flashing its resting
9
+ * state before a `begin`. Renders nothing unless a `KeyframesMotion` provider
10
+ * says the scene may animate; the parent's own attributes are then its
11
+ * resting frame, which is why they are always written as the LAST value.
12
+ */
13
+ function Keyframes({ attributeName, type, values, times, repeat = false, calcMode, ease }) {
14
+ if (!useContext(KeyframesMotion)) return null;
15
+ const timing = {
16
+ values: values.join(";"),
17
+ keyTimes: keyTimes(times),
18
+ dur: `${times[times.length - 1] ?? 0}s`,
19
+ fill: "freeze",
20
+ repeatCount: repeat ? "indefinite" : void 0,
21
+ ...ease && !calcMode ? {
22
+ calcMode: "spline",
23
+ keySplines: easeOutSplines(values.length)
24
+ } : { calcMode }
25
+ };
26
+ if (type) return /* @__PURE__ */ jsx("animateTransform", {
27
+ attributeName,
28
+ type,
29
+ ...timing
30
+ });
31
+ return /* @__PURE__ */ jsx("animate", {
32
+ attributeName,
33
+ ...timing
34
+ });
35
+ }
36
+ //#endregion
37
+ export { Keyframes };
@@ -0,0 +1,26 @@
1
+ import * as React from 'react';
2
+
3
+ interface QrCodeProps {
4
+ /** Exactly what the code encodes. */
5
+ text: string;
6
+ /** What the picture is, read out in its place (the code itself is not words). */
7
+ label: string;
8
+ /** Shown in its place when the code cannot be made (no `qrcode` installed, text too long). */
9
+ fallback: string;
10
+ /** Sizes the code (`size-40`); it is square. */
11
+ className?: string;
12
+ /** The modules' colour. Default black: a phone reads dark on light, so keep it dark in every theme. */
13
+ ink?: string;
14
+ /** The background and quiet zone. Default white. */
15
+ paper?: string;
16
+ }
17
+
18
+ /**
19
+ * A QR code, drawn as SVG from the encoder's modules, dark on light in every
20
+ * theme so a phone can read it. The encoder (`qrcode`, an optional peer
21
+ * dependency) is loaded only when a code is shown. A placeholder while it
22
+ * loads; `fallback` in its place when the code cannot be made.
23
+ */
24
+ declare function QrCode({ text, label, fallback, className, ink, paper }: QrCodeProps): React.JSX.Element;
25
+
26
+ export { QrCode, type QrCodeProps };
@@ -0,0 +1,2 @@
1
+ import { QrCode } from "./qr-code.js";
2
+ export { QrCode };
@@ -0,0 +1,69 @@
1
+ import { cn } from "../../utils/cn.js";
2
+ import { Skeleton } from "../../core/skeleton.js";
3
+ import { Typography } from "../typography/typography.js";
4
+ import { useEffect, useState } from "react";
5
+ import { jsx, jsxs } from "react/jsx-runtime";
6
+ //#region src/components/qr-code/qr-code.tsx
7
+ /** The quiet margin around the modules, in modules: what lets a camera find the code's edge. */
8
+ var QUIET = 2;
9
+ /** One path of every dark module, each a unit square at its row and column. */
10
+ async function draw(text) {
11
+ const { create } = await import("qrcode");
12
+ const { modules } = create(text, { errorCorrectionLevel: "M" });
13
+ let path = "";
14
+ for (let row = 0; row < modules.size; row += 1) for (let col = 0; col < modules.size; col += 1) if (modules.get(row, col)) path += `M${col + QUIET} ${row + QUIET}h1v1h-1z`;
15
+ return {
16
+ text,
17
+ size: modules.size,
18
+ path
19
+ };
20
+ }
21
+ /**
22
+ * A QR code, drawn as SVG from the encoder's modules, dark on light in every
23
+ * theme so a phone can read it. The encoder (`qrcode`, an optional peer
24
+ * dependency) is loaded only when a code is shown. A placeholder while it
25
+ * loads; `fallback` in its place when the code cannot be made.
26
+ */
27
+ function QrCode({ text, label, fallback, className, ink = "#000000", paper = "#ffffff" }) {
28
+ const [drawn, setDrawn] = useState(null);
29
+ useEffect(() => {
30
+ let alive = true;
31
+ draw(text).then((next) => alive && setDrawn(next)).catch(() => alive && setDrawn({
32
+ text,
33
+ size: 0,
34
+ path: ""
35
+ }));
36
+ return () => {
37
+ alive = false;
38
+ };
39
+ }, [text]);
40
+ if (drawn?.text !== text) return /* @__PURE__ */ jsx(Skeleton, {
41
+ role: "img",
42
+ "aria-label": label,
43
+ className: cn("aspect-square rounded-md", className)
44
+ });
45
+ if (drawn.size === 0) return /* @__PURE__ */ jsx(Typography, {
46
+ variant: "body2",
47
+ className: "m-0 text-sm text-muted-foreground",
48
+ children: fallback
49
+ });
50
+ const side = drawn.size + QUIET * 2;
51
+ return /* @__PURE__ */ jsxs("svg", {
52
+ "data-slot": "qr-code",
53
+ role: "img",
54
+ "aria-label": label,
55
+ viewBox: `0 0 ${side} ${side}`,
56
+ shapeRendering: "crispEdges",
57
+ className: cn("aspect-square", className),
58
+ children: [/* @__PURE__ */ jsx("rect", {
59
+ width: side,
60
+ height: side,
61
+ fill: paper
62
+ }), /* @__PURE__ */ jsx("path", {
63
+ d: drawn.path,
64
+ fill: ink
65
+ })]
66
+ });
67
+ }
68
+ //#endregion
69
+ export { QrCode };
@@ -0,0 +1,45 @@
1
+ import * as React from 'react';
2
+
3
+ interface RangeFieldLabels {
4
+ /** The − button's name ("Temperature down by 2"). */
5
+ down: string;
6
+ /** The + button's name. */
7
+ up: string;
8
+ /** The slider's name. */
9
+ slider: string;
10
+ }
11
+ interface RangeFieldProps {
12
+ label: string;
13
+ value: number;
14
+ onChange: (value: number) => void;
15
+ min: number;
16
+ max: number;
17
+ /** The display precision, and the slider's step. */
18
+ step: number;
19
+ unit?: string;
20
+ /** How far − and + move it. Default ten steps, at most the whole range. */
21
+ by?: number;
22
+ /** A compass: − and + go round, the last position to the first. */
23
+ wrap?: boolean;
24
+ /** The range in words ("−40 to 80 °C"), beside the label. */
25
+ rangeText?: string;
26
+ labels: RangeFieldLabels;
27
+ disabled?: boolean;
28
+ }
29
+
30
+ /**
31
+ * One number in a range, on three short rows that need no width: its name,
32
+ * with the range after it in brackets (reference, in a quiet hand — one
33
+ * phrase, so a narrow panel wraps it rather than squeezing two ends of a
34
+ * row); the slider alone on its own row, as wide as the panel, drawn in the
35
+ * scope's own corners; then the exact value as ONE control — a box to type
36
+ * it (kept as typed until Enter or leaving it, then clamped) between − and +
37
+ * for a step either way — and its unit, at the left, under the name and the
38
+ * slider's start, where the eye already is. The slider is the quick way, the
39
+ * box the precise one; − and + stay because a compass goes round (the last
40
+ * position to the first), which neither of the others can do. Nothing here
41
+ * shares a row with the slider, so a narrow panel squeezes nothing.
42
+ */
43
+ declare function RangeField({ label, value, onChange, min, max, step: by, unit, by: nudgeBy, wrap, rangeText, labels, disabled }: RangeFieldProps): React.JSX.Element;
44
+
45
+ export { RangeField, type RangeFieldLabels, type RangeFieldProps };
@@ -0,0 +1,2 @@
1
+ import { RangeField } from "./range-field.js";
2
+ export { RangeField };
@@ -0,0 +1,164 @@
1
+ import { cn } from "../../utils/cn.js";
2
+ import { Button } from "../button/button.js";
3
+ import { Input } from "../../core/input/input.js";
4
+ import { Label } from "../../core/label.js";
5
+ import { useLayoutEffect, useRef, useState } from "react";
6
+ import { jsx, jsxs } from "react/jsx-runtime";
7
+ import { Minus, Plus } from "lucide-react";
8
+ //#region src/components/range-field/range-field.tsx
9
+ /** Decimal places a step shows: 0.1 -> 1, 0.25 -> 2, 5 -> 0. */
10
+ function placesOf(step) {
11
+ const s = String(step);
12
+ return s.includes(".") ? (s.split(".")[1] ?? "").length : 0;
13
+ }
14
+ /** `n` brought back into the range by going round it, as a compass does: one step past the last is the first. */
15
+ function wrapped(n, range) {
16
+ const span = range.max - range.min + range.step;
17
+ return range.min + ((n - range.min) % span + span) % span;
18
+ }
19
+ var step = {
20
+ type: "button",
21
+ size: "icon",
22
+ fullWidth: false,
23
+ variant: "ghost",
24
+ color: "gray",
25
+ hideRingOnHover: true
26
+ };
27
+ /**
28
+ * The slider drawn by us, not the browser: a hairline track, the part of it
29
+ * below the value filled, and a thumb — all in the scope's control radius
30
+ * (`--espd-radius-control`, the token every library control rounds by; the
31
+ * library's own classes read the same variable), so it is square where the
32
+ * scope's controls are square and round where they are round. The native slider's own
33
+ * drawing is turned off (`appearance-none`) and its thumb restyled through
34
+ * the two vendors' pseudo-elements; the input stays a real range input, so
35
+ * the keyboard, the wheel and assistive tech see nothing different.
36
+ */
37
+ var SLIDER = cn("relative z-10 h-5 w-full cursor-pointer appearance-none bg-transparent outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-default disabled:opacity-50", "[&::-webkit-slider-runnable-track]:h-5 [&::-webkit-slider-runnable-track]:bg-transparent", "[&::-webkit-slider-thumb]:mt-0.5 [&::-webkit-slider-thumb]:h-4 [&::-webkit-slider-thumb]:w-4 [&::-webkit-slider-thumb]:appearance-none [&::-webkit-slider-thumb]:rounded-(--espd-radius-control) [&::-webkit-slider-thumb]:border-2 [&::-webkit-slider-thumb]:border-background [&::-webkit-slider-thumb]:bg-primary [&::-webkit-slider-thumb]:shadow-sm", "[&::-moz-range-thumb]:h-4 [&::-moz-range-thumb]:w-4 [&::-moz-range-thumb]:appearance-none [&::-moz-range-thumb]:rounded-(--espd-radius-control) [&::-moz-range-thumb]:border-2 [&::-moz-range-thumb]:border-background [&::-moz-range-thumb]:bg-primary [&::-moz-range-thumb]:shadow-sm");
38
+ /** The filled part of the track, as a share of it: it moves with every drag frame, so it is written to the element, never a class. */
39
+ function useFill(share) {
40
+ const ref = useRef(null);
41
+ useLayoutEffect(() => {
42
+ if (ref.current) ref.current.style.width = `${share}%`;
43
+ }, [share]);
44
+ return ref;
45
+ }
46
+ /**
47
+ * One number in a range, on three short rows that need no width: its name,
48
+ * with the range after it in brackets (reference, in a quiet hand — one
49
+ * phrase, so a narrow panel wraps it rather than squeezing two ends of a
50
+ * row); the slider alone on its own row, as wide as the panel, drawn in the
51
+ * scope's own corners; then the exact value as ONE control — a box to type
52
+ * it (kept as typed until Enter or leaving it, then clamped) between − and +
53
+ * for a step either way — and its unit, at the left, under the name and the
54
+ * slider's start, where the eye already is. The slider is the quick way, the
55
+ * box the precise one; − and + stay because a compass goes round (the last
56
+ * position to the first), which neither of the others can do. Nothing here
57
+ * shares a row with the slider, so a narrow panel squeezes nothing.
58
+ */
59
+ function RangeField({ label, value, onChange, min, max, step: by, unit, by: nudgeBy, wrap = false, rangeText, labels, disabled = false }) {
60
+ const [draft, setDraft] = useState(null);
61
+ const nudge = nudgeBy ?? Math.min(by * 10, max - min);
62
+ const fill = useFill(max > min ? Math.min(100, Math.max(0, (value - min) / (max - min) * 100)) : 0);
63
+ function set(n) {
64
+ setDraft(null);
65
+ onChange(wrap ? wrapped(n, {
66
+ min,
67
+ max,
68
+ step: by
69
+ }) : Math.min(max, Math.max(min, n)));
70
+ }
71
+ function commit() {
72
+ const n = Number(draft);
73
+ if (draft === null || draft.trim() === "" || !Number.isFinite(n)) {
74
+ setDraft(null);
75
+ return;
76
+ }
77
+ set(n);
78
+ }
79
+ return /* @__PURE__ */ jsxs("div", {
80
+ className: "flex flex-col gap-1",
81
+ children: [
82
+ /* @__PURE__ */ jsxs(Label, {
83
+ className: "text-xs",
84
+ children: [label, rangeText && /* @__PURE__ */ jsxs("span", {
85
+ className: "ml-1.5 font-mono text-xs font-normal text-foreground-muted tabular-nums",
86
+ children: [
87
+ "(",
88
+ rangeText,
89
+ ")"
90
+ ]
91
+ })]
92
+ }),
93
+ /* @__PURE__ */ jsxs("span", {
94
+ className: "relative flex h-5 w-full items-center",
95
+ children: [
96
+ /* @__PURE__ */ jsx("span", {
97
+ "aria-hidden": true,
98
+ className: "absolute inset-x-0 h-1 rounded-(--espd-radius-control) bg-border"
99
+ }),
100
+ /* @__PURE__ */ jsx("span", {
101
+ ref: fill,
102
+ "aria-hidden": true,
103
+ className: cn("absolute left-0 h-1 w-0 rounded-(--espd-radius-control) bg-primary", disabled && "opacity-50")
104
+ }),
105
+ /* @__PURE__ */ jsx("input", {
106
+ type: "range",
107
+ "aria-label": labels.slider,
108
+ min,
109
+ max,
110
+ step: by,
111
+ value,
112
+ disabled,
113
+ onChange: (event) => set(Number(event.target.value)),
114
+ className: SLIDER
115
+ })
116
+ ]
117
+ }),
118
+ /* @__PURE__ */ jsxs("div", {
119
+ className: "flex items-center gap-2",
120
+ children: [/* @__PURE__ */ jsxs("span", {
121
+ className: "inline-flex items-center rounded-xs border border-border",
122
+ children: [
123
+ /* @__PURE__ */ jsx(Button, {
124
+ ...step,
125
+ disabled,
126
+ "aria-label": labels.down,
127
+ onClick: () => set(value - nudge),
128
+ className: "size-7 rounded-none",
129
+ children: /* @__PURE__ */ jsx(Minus, { className: "h-3.5 w-3.5" })
130
+ }),
131
+ /* @__PURE__ */ jsx(Input, {
132
+ size: "sm",
133
+ type: "number",
134
+ inputMode: "decimal",
135
+ "aria-label": label,
136
+ min,
137
+ max,
138
+ step: by,
139
+ disabled,
140
+ value: draft ?? value.toFixed(placesOf(by)),
141
+ onChange: (event) => setDraft(event.target.value),
142
+ onBlur: commit,
143
+ onKeyDown: (event) => event.key === "Enter" && commit(),
144
+ className: "h-7 w-20 rounded-none border-x border-y-0 border-border text-center font-mono tabular-nums shadow-none"
145
+ }),
146
+ /* @__PURE__ */ jsx(Button, {
147
+ ...step,
148
+ disabled,
149
+ "aria-label": labels.up,
150
+ onClick: () => set(value + nudge),
151
+ className: "size-7 rounded-none",
152
+ children: /* @__PURE__ */ jsx(Plus, { className: "h-3.5 w-3.5" })
153
+ })
154
+ ]
155
+ }), unit && /* @__PURE__ */ jsx("span", {
156
+ className: "w-7 font-mono text-xs text-foreground-secondary",
157
+ children: unit
158
+ })]
159
+ })
160
+ ]
161
+ });
162
+ }
163
+ //#endregion
164
+ export { RangeField, placesOf, wrapped };
@@ -13,9 +13,12 @@ interface RevealProps {
13
13
  }
14
14
 
15
15
  /**
16
- * One part of a section's entrance: it rises into place and fades in when
17
- * `revealed` turns true (the section first scrolled into view — pair it with
18
- * `useIsInView` or an observer of your own). Uniform motion, so Tailwind
16
+ * One part of a section's entrance: it rises into place when `revealed` turns
17
+ * true (the section first scrolled into view — pair it with `useIsInView` or
18
+ * an observer of your own). It waits a little low, and a touch small with
19
+ * `grow`, but always fully drawn: a page read without scrolling it in (a
20
+ * screenshot, a background tab whose observer never fires, a reader jumping
21
+ * by heading, reduced motion) shows every word. Uniform motion, so Tailwind
19
22
  * utilities on library tokens; under reduced motion it is simply there.
20
23
  */
21
24
  declare function Reveal({ revealed, order, grow, className, children }: RevealProps): React.JSX.Element;
@@ -8,15 +8,18 @@ var DELAY = [
8
8
  "delay-450"
9
9
  ];
10
10
  /**
11
- * One part of a section's entrance: it rises into place and fades in when
12
- * `revealed` turns true (the section first scrolled into view — pair it with
13
- * `useIsInView` or an observer of your own). Uniform motion, so Tailwind
11
+ * One part of a section's entrance: it rises into place when `revealed` turns
12
+ * true (the section first scrolled into view — pair it with `useIsInView` or
13
+ * an observer of your own). It waits a little low, and a touch small with
14
+ * `grow`, but always fully drawn: a page read without scrolling it in (a
15
+ * screenshot, a background tab whose observer never fires, a reader jumping
16
+ * by heading, reduced motion) shows every word. Uniform motion, so Tailwind
14
17
  * utilities on library tokens; under reduced motion it is simply there.
15
18
  */
16
19
  function Reveal({ revealed, order, grow = false, className, children }) {
17
20
  return /* @__PURE__ */ jsx("div", {
18
21
  "data-slot": "reveal",
19
- className: cn("transition duration-700 ease-emphasized motion-reduce:transition-none", DELAY[order], revealed ? "translate-y-0 scale-100 opacity-100" : cn("translate-y-8 opacity-0", grow && "scale-97"), className),
22
+ className: cn("transition duration-700 ease-emphasized motion-reduce:transition-none", DELAY[order], revealed ? "translate-y-0 scale-100" : cn("translate-y-4", grow && "scale-97"), className),
20
23
  children
21
24
  });
22
25
  }
@@ -25,8 +25,10 @@ interface SearchBoxProps extends Pick<StyleAxisProps, "radius" | "border">, Sear
25
25
  onValueChange?: (value: string) => void;
26
26
  size?: Size;
27
27
  className?: string;
28
+ /** The clear button's accessible name, in the page's language. Default "Clear search". */
29
+ clearLabel?: string;
28
30
  }
29
31
 
30
- declare function SearchBox({ placeholder, value: controlledValue, defaultValue, onSearch, onClear, onValueChange, size, className, radius, border, id, name, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, "aria-describedby": ariaDescribedBy, }: SearchBoxProps): React.JSX.Element;
32
+ declare function SearchBox({ placeholder, value: controlledValue, defaultValue, onSearch, onClear, onValueChange, size, className, radius, border, id, name, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, "aria-describedby": ariaDescribedBy, clearLabel, }: SearchBoxProps): React.JSX.Element;
31
33
 
32
34
  export { SearchBox, type SearchBoxProps };
@@ -6,7 +6,7 @@ import { useState } from "react";
6
6
  import { jsx, jsxs } from "react/jsx-runtime";
7
7
  import { Search, X } from "lucide-react";
8
8
  //#region src/components/search-box/search-box.tsx
9
- function SearchBox({ placeholder, value: controlledValue, defaultValue = "", onSearch, onClear, onValueChange, size = "default", className, radius, border, id, name, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, "aria-describedby": ariaDescribedBy }) {
9
+ function SearchBox({ placeholder, value: controlledValue, defaultValue = "", onSearch, onClear, onValueChange, size = "default", className, radius, border, id, name, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, "aria-describedby": ariaDescribedBy, clearLabel = "Clear search" }) {
10
10
  const axes = useStyleAxes({
11
11
  radius,
12
12
  border
@@ -29,7 +29,6 @@ function SearchBox({ placeholder, value: controlledValue, defaultValue = "", onS
29
29
  onValueChange?.(nextValue);
30
30
  };
31
31
  const iconSize = searchFieldIconSizeClasses[size];
32
- const trailingBtnClass = "h-auto w-auto p-0 m-0 shrink-0";
33
32
  return /* @__PURE__ */ jsxs("div", {
34
33
  className: cn(outlineSearchShellClasses, "flex w-full items-center gap-2 rounded-[var(--espd-own-radius,var(--espd-radius-control,var(--radius-md)))]", "focus-within:ring-2 focus-within:ring-ring focus-within:ring-offset-2 ring-offset-background", searchFieldContainerSizeClasses[size], className),
35
34
  style: axes.style,
@@ -51,17 +50,13 @@ function SearchBox({ placeholder, value: controlledValue, defaultValue = "", onS
51
50
  size,
52
51
  fullWidth: false,
53
52
  onClick: handleClear,
54
- "aria-label": "Clear search",
53
+ "aria-label": clearLabel,
55
54
  startIcon: /* @__PURE__ */ jsx(X, { className: iconSize }),
56
- className: trailingBtnClass
57
- }) : /* @__PURE__ */ jsx(Button, {
58
- type: "button",
59
- variant: "ghost",
60
- size,
61
- fullWidth: false,
62
- disabled: true,
63
- startIcon: /* @__PURE__ */ jsx(Search, { className: cn(iconSize, "text-muted-foreground") }),
64
- className: trailingBtnClass
55
+ className: "h-auto w-auto p-0 m-0 shrink-0"
56
+ }) : /* @__PURE__ */ jsx("span", {
57
+ "aria-hidden": true,
58
+ className: "inline-flex shrink-0 items-center",
59
+ children: /* @__PURE__ */ jsx(Search, { className: cn(iconSize, "text-muted-foreground") })
65
60
  })]
66
61
  });
67
62
  }
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import { ReactNode, ReactElement } from 'react';
2
+ import { ReactNode, ReactElement, HTMLAttributes } from 'react';
3
3
 
4
4
  /**
5
5
  * Where the card's title goes: a page (a real link), a page of this app
@@ -38,6 +38,17 @@ interface ShowcaseCardProps {
38
38
  footer?: ReactNode;
39
39
  /** On the body under the picture: a roomier card where it has the space. */
40
40
  bodyClassName?: string;
41
+ /**
42
+ * `column` (default): the picture on top. `row`: the picture fills the
43
+ * card's left side at full height on a tint that clears into the card, the
44
+ * words beside it, the footer at the bottom right. A row card sizes by its
45
+ * own width: under 28rem the picture narrows, `meta` keeps two lines and the
46
+ * footer goes. `reveal`, `mediaOverlay`, `titleAction` and the media props
47
+ * are for the column card only.
48
+ */
49
+ layout?: "column" | "row";
50
+ /** Pointer and focus handlers on the card itself (a picture that plays while the card is engaged). */
51
+ engage?: Pick<HTMLAttributes<HTMLDivElement>, "onPointerEnter" | "onPointerLeave" | "onFocus" | "onBlur">;
41
52
  }
42
53
 
43
54
  /**
@@ -46,8 +57,8 @@ interface ShowcaseCardProps {
46
57
  * footer row. Props only: builds, hardware parts or templates fill the same
47
58
  * frame. Cards glide to their new places in a view transition
48
59
  * (`view-transition-glide`), for instance when a filters panel opens beside
49
- * the grid.
60
+ * the grid. `layout="row"` lays the picture at the card's left instead.
50
61
  */
51
- declare function ShowcaseCard({ media, mediaLayout, mediaClassName, mediaOverlay, reveal, title, open, titlePrefix, titleAction, meta, footer, bodyClassName }: ShowcaseCardProps): React.JSX.Element;
62
+ declare function ShowcaseCard(props: ShowcaseCardProps): React.JSX.Element;
52
63
 
53
64
  export { ShowcaseCard, type ShowcaseCardOpen, type ShowcaseCardProps };