@kanso-labs/kanso-ui 0.48.3 → 0.49.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.
@@ -50,7 +50,7 @@ import Menu, { MenuAlign, MenuContent, MenuContentProps, MenuItem, MenuItemProps
50
50
  import Meter, { MeterProps, MeterTone } from "./meter/index.js";
51
51
  import NavigationBar, { NavigationBarItem, NavigationBarProps } from "./navigation-bar/index.js";
52
52
  import { NavigationItemProps } from "../navigation/index.js";
53
- import NavigationRail, { NavigationRailItem, NavigationRailProps } from "./navigation-rail/index.js";
53
+ import NavigationRail, { NavigationRailFab, NavigationRailFabProps, NavigationRailItem, NavigationRailProps } from "./navigation-rail/index.js";
54
54
  import NavigationTree, { NavigationTreeItem, NavigationTreeItemProps, NavigationTreeProps, NavigationTreeSection, NavigationTreeSectionProps } from "./navigation-tree/index.js";
55
55
  import NumberField, { NumberFieldProps } from "./number-field/index.js";
56
56
  import Popover, { PopoverAlign, PopoverContent, PopoverContentProps, PopoverDescription, PopoverDescriptionProps, PopoverProps, PopoverSide, PopoverSize, PopoverTitle, PopoverTitleProps, PopoverTrigger } from "./popover/index.js";
@@ -82,4 +82,4 @@ import TokenField, { TokenFieldProps, TokenSegment } from "./token-field/index.j
82
82
  import Toolbar, { ToolbarProps, ToolbarTone } from "./toolbar/index.js";
83
83
  import Tooltip, { TooltipAlign, TooltipProps, TooltipSide } from "./tooltip/index.js";
84
84
  import Tree, { TreeItem, TreeItemProps, TreeLoadMore, TreeLoadMoreProps, TreeProps, TreeSection, TreeSectionProps } from "./tree/index.js";
85
- export { AppBar, type AppBarProps, type AppBarScroll, type AppBarScrollOptions, Autocomplete, type AutocompleteFilter, type AutocompleteProps, Avatar, type AvatarProps, Badge, type BadgeProps, Breadcrumbs, BreadcrumbsItem, type BreadcrumbsItemProps, type BreadcrumbsProps, Button, ButtonGroup, type ButtonGroupProps, type ButtonGroupVariant, type ButtonProps, type ButtonShape, type ButtonSize, type ButtonVariant, Calendar, type CalendarProps, Card, type CardProps, type CardVariant, Carousel, CarouselItem, type CarouselItemProps, type CarouselItemRenderProps, type CarouselLayout, type CarouselProps, Checkbox, CheckboxGroup, type CheckboxGroupProps, type CheckboxProps, Chip, type ChipActionProps, type ChipDropdownProps, type ChipFilterProps, ChipGroup, ChipGroupChip, type ChipGroupChipProps, type ChipGroupProps, type ChipProps, type ChipVariant, Code, type CodeProps, ColorArea, type ColorAreaProps, ColorField, type ColorFieldProps, ColorPicker, type ColorPickerProps, ColorSlider, type ColorSliderProps, ColorSwatch, ColorSwatchPicker, ColorSwatchPickerItem, type ColorSwatchPickerItemProps, type ColorSwatchPickerProps, type ColorSwatchProps, ColorWheel, type ColorWheelProps, ComboBox, type ComboBoxProps, type ComboBoxSelectionMode, Container, type ContainerProps, CopyField, type CopyFieldProps, Currency, type CurrencyDisplay, type CurrencyNotation, type CurrencyProps, type CurrencySignDisplay, type CurrencyTone, DateField, type DateFieldProps, DatePicker, type DatePickerProps, DateRangePicker, type DateRangePickerProps, Dialog, DialogBody, DialogContent, type DialogContentProps, DialogFooter, DialogHeader, type DialogProps, DialogTitle, type DialogTitleProps, Disclosure, DisclosureGroup, type DisclosureGroupProps, DisclosureHeader, type DisclosureHeaderProps, DisclosurePanel, type DisclosurePanelProps, type DisclosureProps, DropZone, type DropZoneProps, Fab, FabMenu, FabMenuItem, type FabMenuItemProps, type FabMenuProps, type FabProps, type FabSize, type FabTone, type FabVariant, Feed, type FeedProps, type FieldVariant, FileTrigger, type FileTriggerProps, Form, type FormProps, IconButton, type IconButtonProps, type IconButtonSize, type IconButtonVariant, Keycap, type KeycapProps, Link, type LinkProps, type LinkTone, type LinkUnderline, List, ListBox, ListBoxItem, type ListBoxItemProps, ListBoxLoadMore, type ListBoxLoadMoreProps, type ListBoxProps, ListBoxSection, type ListBoxSectionProps, ListDetail, type ListDetailProps, ListItem, type ListItemProps, ListLoadMore, type ListLoadMoreProps, type ListProps, ListRow, type ListRowProps, ListSection, type ListSectionProps, LoadingIndicator, type LoadingIndicatorProps, Menu, type MenuAlign, MenuContent, type MenuContentProps, MenuItem, type MenuItemProps, MenuLoadMore, type MenuLoadMoreProps, type MenuProps, MenuSection, type MenuSectionProps, MenuSeparator, type MenuSeparatorProps, type MenuSide, MenuSubmenu, type MenuSubmenuProps, Meter, type MeterProps, type MeterTone, NavigationBar, NavigationBarItem, type NavigationItemProps as NavigationBarItemProps, type NavigationBarProps, NavigationRail, NavigationRailItem, type NavigationItemProps as NavigationRailItemProps, type NavigationRailProps, NavigationTree, NavigationTreeItem, type NavigationTreeItemProps, type NavigationTreeProps, NavigationTreeSection, type NavigationTreeSectionProps, NumberField, type NumberFieldProps, Popover, type PopoverAlign, PopoverContent, type PopoverContentProps, PopoverDescription, type PopoverDescriptionProps, type PopoverProps, type PopoverSide, type PopoverSize, PopoverTitle, type PopoverTitleProps, type PopoverTrigger, ProductIcon, type ProductIconProps, ProgressIndicator, type ProgressIndicatorProps, type ProgressIndicatorShape, type ProgressIndicatorTone, type ProgressIndicatorVariant, Radio, RadioGroup, type RadioGroupProps, type RadioProps, RangeCalendar, type RangeCalendarProps, SearchField, type SearchFieldProps, SearchView, SearchViewContent, type SearchViewContentProps, type SearchViewProps, SegmentedButton, type SegmentedButtonProps, SegmentedButtonSegment, type SegmentedButtonSegmentProps, Select, type SelectProps, Separator, type SeparatorInset, type SeparatorProps, Sheet, SheetBody, SheetContent, type SheetContentProps, SheetFooter, SheetHandle, SheetHeader, type SheetProps, SheetTitle, type SheetTitleProps, Slider, type SliderProps, type SliderSize, Snackbar, type SnackbarAction, type SnackbarMessage, type SnackbarOptions, type SnackbarProps, type SnackbarQueue, type ToastRegionRenderProps as SnackbarRegionRenderProps, SplitButton, SplitButtonAction, type SplitButtonActionProps, SplitButtonMenu, type SplitButtonMenuProps, type SplitButtonProps, type SplitButtonVariant, Stack, type StackAlign, type StackGap, type StackJustify, type StackProps, SupportingPane, type SupportingPaneProps, Switch, type SwitchProps, Table, type TableAlign, TableBody, type TableBodyProps, TableCell, type TableCellProps, TableColumn, type TableColumnProps, TableFooter, type TableFooterProps, TableHeader, type TableHeaderProps, TableLoadMore, type TableLoadMoreProps, type TableProps, TableRow, type TableRowProps, Tabs, type TabsLayout, TabsList, type TabsListProps, TabsPanel, type TabsPanelProps, TabsPanels, type TabsPanelsProps, type TabsProps, TabsTab, type TabsTabProps, type TabsVariant, Tag, type TagProps, type TagTone, type TagVariant, Text, TextArea, type TextAreaProps, TextField, type TextFieldProps, type TextProps, TimeField, type TimeFieldProps, TimePicker, type TimePickerMode, type TimePickerProps, TokenField, type TokenFieldProps, type TokenSegment, Toolbar, type ToolbarProps, type ToolbarTone, Tooltip, type TooltipAlign, type TooltipProps, type TooltipSide, Tree, TreeItem, type TreeItemProps, TreeLoadMore, type TreeLoadMoreProps, type TreeProps, TreeSection, type TreeSectionProps, useAppBarScroll };
85
+ export { AppBar, type AppBarProps, type AppBarScroll, type AppBarScrollOptions, Autocomplete, type AutocompleteFilter, type AutocompleteProps, Avatar, type AvatarProps, Badge, type BadgeProps, Breadcrumbs, BreadcrumbsItem, type BreadcrumbsItemProps, type BreadcrumbsProps, Button, ButtonGroup, type ButtonGroupProps, type ButtonGroupVariant, type ButtonProps, type ButtonShape, type ButtonSize, type ButtonVariant, Calendar, type CalendarProps, Card, type CardProps, type CardVariant, Carousel, CarouselItem, type CarouselItemProps, type CarouselItemRenderProps, type CarouselLayout, type CarouselProps, Checkbox, CheckboxGroup, type CheckboxGroupProps, type CheckboxProps, Chip, type ChipActionProps, type ChipDropdownProps, type ChipFilterProps, ChipGroup, ChipGroupChip, type ChipGroupChipProps, type ChipGroupProps, type ChipProps, type ChipVariant, Code, type CodeProps, ColorArea, type ColorAreaProps, ColorField, type ColorFieldProps, ColorPicker, type ColorPickerProps, ColorSlider, type ColorSliderProps, ColorSwatch, ColorSwatchPicker, ColorSwatchPickerItem, type ColorSwatchPickerItemProps, type ColorSwatchPickerProps, type ColorSwatchProps, ColorWheel, type ColorWheelProps, ComboBox, type ComboBoxProps, type ComboBoxSelectionMode, Container, type ContainerProps, CopyField, type CopyFieldProps, Currency, type CurrencyDisplay, type CurrencyNotation, type CurrencyProps, type CurrencySignDisplay, type CurrencyTone, DateField, type DateFieldProps, DatePicker, type DatePickerProps, DateRangePicker, type DateRangePickerProps, Dialog, DialogBody, DialogContent, type DialogContentProps, DialogFooter, DialogHeader, type DialogProps, DialogTitle, type DialogTitleProps, Disclosure, DisclosureGroup, type DisclosureGroupProps, DisclosureHeader, type DisclosureHeaderProps, DisclosurePanel, type DisclosurePanelProps, type DisclosureProps, DropZone, type DropZoneProps, Fab, FabMenu, FabMenuItem, type FabMenuItemProps, type FabMenuProps, type FabProps, type FabSize, type FabTone, type FabVariant, Feed, type FeedProps, type FieldVariant, FileTrigger, type FileTriggerProps, Form, type FormProps, IconButton, type IconButtonProps, type IconButtonSize, type IconButtonVariant, Keycap, type KeycapProps, Link, type LinkProps, type LinkTone, type LinkUnderline, List, ListBox, ListBoxItem, type ListBoxItemProps, ListBoxLoadMore, type ListBoxLoadMoreProps, type ListBoxProps, ListBoxSection, type ListBoxSectionProps, ListDetail, type ListDetailProps, ListItem, type ListItemProps, ListLoadMore, type ListLoadMoreProps, type ListProps, ListRow, type ListRowProps, ListSection, type ListSectionProps, LoadingIndicator, type LoadingIndicatorProps, Menu, type MenuAlign, MenuContent, type MenuContentProps, MenuItem, type MenuItemProps, MenuLoadMore, type MenuLoadMoreProps, type MenuProps, MenuSection, type MenuSectionProps, MenuSeparator, type MenuSeparatorProps, type MenuSide, MenuSubmenu, type MenuSubmenuProps, Meter, type MeterProps, type MeterTone, NavigationBar, NavigationBarItem, type NavigationItemProps as NavigationBarItemProps, type NavigationBarProps, NavigationRail, NavigationRailFab, type NavigationRailFabProps, NavigationRailItem, type NavigationItemProps as NavigationRailItemProps, type NavigationRailProps, NavigationTree, NavigationTreeItem, type NavigationTreeItemProps, type NavigationTreeProps, NavigationTreeSection, type NavigationTreeSectionProps, NumberField, type NumberFieldProps, Popover, type PopoverAlign, PopoverContent, type PopoverContentProps, PopoverDescription, type PopoverDescriptionProps, type PopoverProps, type PopoverSide, type PopoverSize, PopoverTitle, type PopoverTitleProps, type PopoverTrigger, ProductIcon, type ProductIconProps, ProgressIndicator, type ProgressIndicatorProps, type ProgressIndicatorShape, type ProgressIndicatorTone, type ProgressIndicatorVariant, Radio, RadioGroup, type RadioGroupProps, type RadioProps, RangeCalendar, type RangeCalendarProps, SearchField, type SearchFieldProps, SearchView, SearchViewContent, type SearchViewContentProps, type SearchViewProps, SegmentedButton, type SegmentedButtonProps, SegmentedButtonSegment, type SegmentedButtonSegmentProps, Select, type SelectProps, Separator, type SeparatorInset, type SeparatorProps, Sheet, SheetBody, SheetContent, type SheetContentProps, SheetFooter, SheetHandle, SheetHeader, type SheetProps, SheetTitle, type SheetTitleProps, Slider, type SliderProps, type SliderSize, Snackbar, type SnackbarAction, type SnackbarMessage, type SnackbarOptions, type SnackbarProps, type SnackbarQueue, type ToastRegionRenderProps as SnackbarRegionRenderProps, SplitButton, SplitButtonAction, type SplitButtonActionProps, SplitButtonMenu, type SplitButtonMenuProps, type SplitButtonProps, type SplitButtonVariant, Stack, type StackAlign, type StackGap, type StackJustify, type StackProps, SupportingPane, type SupportingPaneProps, Switch, type SwitchProps, Table, type TableAlign, TableBody, type TableBodyProps, TableCell, type TableCellProps, TableColumn, type TableColumnProps, TableFooter, type TableFooterProps, TableHeader, type TableHeaderProps, TableLoadMore, type TableLoadMoreProps, type TableProps, TableRow, type TableRowProps, Tabs, type TabsLayout, TabsList, type TabsListProps, TabsPanel, type TabsPanelProps, TabsPanels, type TabsPanelsProps, type TabsProps, TabsTab, type TabsTabProps, type TabsVariant, Tag, type TagProps, type TagTone, type TagVariant, Text, TextArea, type TextAreaProps, TextField, type TextFieldProps, type TextProps, TimeField, type TimeFieldProps, TimePicker, type TimePickerMode, type TimePickerProps, TokenField, type TokenFieldProps, type TokenSegment, Toolbar, type ToolbarProps, type ToolbarTone, Tooltip, type TooltipAlign, type TooltipProps, type TooltipSide, Tree, TreeItem, type TreeItemProps, TreeLoadMore, type TreeLoadMoreProps, type TreeProps, TreeSection, type TreeSectionProps, useAppBarScroll };
@@ -1,10 +1,29 @@
1
1
  import { ReactNode, RefAttributes } from "react";
2
2
  import { NavigationItemProps } from "../../navigation/index.js";
3
3
  import { RenderComponentProps } from "../../render/useRender.js";
4
+ import { FabProps } from "../fab/index.js";
5
+ type NavigationRailFabProps = Omit<FabProps, 'aria-label' | 'label' | 'size'> & RefAttributes<HTMLAnchorElement | HTMLButtonElement> & {
6
+ /**
7
+ * The FAB's name in either form, in place of `label`, for a name that
8
+ * says more than the words drawn beside the icon.
9
+ */
10
+ 'aria-label'?: string;
11
+ /**
12
+ * What the FAB does, in words: drawn beside the icon in the expanded rail,
13
+ * and the FAB's name in the collapsed one, where the icon stands alone.
14
+ */
15
+ label: string;
16
+ };
4
17
  type NavigationRailProps = RenderComponentProps<'nav'> & {
5
18
  /**
6
- * What the rail draws above its destinations: a menu button that expands
7
- * it, or a floating action button.
19
+ * The screen's floating action button, a `NavigationRail.Fab`, drawn above
20
+ * the destinations and under the header: its icon alone in the collapsed
21
+ * rail, and the extended FAB in the expanded one.
22
+ */
23
+ fab?: ReactNode;
24
+ /**
25
+ * What the rail draws above its destinations and its FAB: a menu button
26
+ * that expands it, or a mark.
8
27
  */
9
28
  header?: ReactNode;
10
29
  /**
@@ -40,10 +59,30 @@ type NavigationRailProps = RenderComponentProps<'nav'> & {
40
59
  *
41
60
  * The call site's `className` and `style` land on the `<nav>`.
42
61
  */
43
- declare function NavigationRail({ children, header, isExpanded, render, selectedRoute, ...props }: NavigationRailProps): import("react").JSX.Element;
62
+ declare function NavigationRail({ children, fab, header, isExpanded, render, selectedRoute, ...props }: NavigationRailProps): import("react").JSX.Element;
44
63
  declare namespace NavigationRail {
64
+ var Fab: typeof NavigationRailFab;
45
65
  var Item: typeof NavigationRailItem;
46
66
  }
67
+ /**
68
+ * The screen's floating action button in a navigation rail's `fab` slot: the
69
+ * 56dp FAB, its icon alone in the collapsed rail and named by `label`, and
70
+ * the extended FAB with `label` beside the icon in the expanded rail.
71
+ *
72
+ * ```tsx
73
+ * <NavigationRail
74
+ * aria-label="Label"
75
+ * fab={
76
+ * <NavigationRail.Fab label="Label" onPress={add}>
77
+ * <PlusIcon />
78
+ * </NavigationRail.Fab>
79
+ * }
80
+ * />
81
+ * ```
82
+ *
83
+ * It takes Fab's props otherwise: `tone`, `variant`, `href` and the rest.
84
+ */
85
+ declare function NavigationRailFab({ label, ...props }: NavigationRailFabProps): import("react").JSX.Element;
47
86
  /**
48
87
  * One destination of a navigation rail — an icon, a label and, when it is the
49
88
  * current one, the active indicator. See `NavigationRail`.
@@ -54,4 +93,4 @@ declare namespace NavigationRail {
54
93
  * component itself rather than a reference to a client one.
55
94
  */
56
95
  declare function NavigationRailItem(props: NavigationItemProps & RefAttributes<HTMLAnchorElement>): import("react").JSX.Element;
57
- export { NavigationRailItem, type NavigationItemProps as NavigationRailItemProps, type NavigationRailProps, NavigationRail as default };
96
+ export { NavigationRailFab, type NavigationRailFabProps, NavigationRailItem, type NavigationItemProps as NavigationRailItemProps, type NavigationRailProps, NavigationRail as default };
@@ -1,29 +1,57 @@
1
1
  "use client";
2
2
  import { c } from "react/compiler-runtime";
3
- import "react";
3
+ import { props } from "../../node_modules/@stylexjs/stylex/lib/es/stylex.js";
4
+ import { use } from "react";
4
5
  import { NavigationItem, NavigationList } from "../../navigation/index.js";
5
6
  import { NavigationContext } from "../../navigation/context.js";
7
+ import { hasContent } from "../../render/content.js";
6
8
  import { useRender } from "../../render/useRender.js";
7
9
  import { mergeStyles } from "../../styles/merge.js";
10
+ import Fab from "../fab/index.js";
8
11
  import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
9
12
  // src/components/navigation-rail/index.tsx
10
- const styles = { destinations: {
11
- kGNEyG: "x6s0dn4",
12
- kSGwAc: "xkh2ocl",
13
- kB7OPa: "x9f619",
14
- k1xSpc: "x78zum5",
15
- kCS8Yb: "xdl72j9",
16
- kXwgrk: "xdt5ytf",
17
- kzQI83: "x1iyjqo2",
18
- kmuXW: "xs83m0k",
19
- kqGvvJ: "x15zwqr x196bl58",
20
- kUOVxO: "x13jr4wj x1knonev",
21
- kAzted: "x2lwn1j",
22
- kORKVm: "x1odjw0f",
23
- k8WAf4: "xifx94n x1flqomg",
24
- kg3NbH: "xm9j1uf x1snzwe2",
25
- $$css: true
26
- } };
13
+ const styles = {
14
+ destinations: {
15
+ kGNEyG: "x6s0dn4",
16
+ kSGwAc: "xkh2ocl",
17
+ kB7OPa: "x9f619",
18
+ k1xSpc: "x78zum5",
19
+ kCS8Yb: "xdl72j9",
20
+ kXwgrk: "xdt5ytf",
21
+ kzQI83: "x1iyjqo2",
22
+ kmuXW: "xs83m0k",
23
+ kqGvvJ: "x15zwqr x196bl58",
24
+ kUOVxO: "x13jr4wj x1knonev",
25
+ kAzted: "x2lwn1j",
26
+ kORKVm: "x1odjw0f",
27
+ k8WAf4: "xifx94n x1flqomg",
28
+ kg3NbH: "xm9j1uf x1snzwe2",
29
+ $$css: true
30
+ },
31
+ header: {
32
+ kGNEyG: "x6s0dn4",
33
+ kB7OPa: "x9f619",
34
+ k1xSpc: "x78zum5",
35
+ kXwgrk: "xdt5ytf",
36
+ k1K539: "xqa3g7y",
37
+ $$css: true
38
+ },
39
+ headerAboveFab: {
40
+ k1K539: "xat24cr",
41
+ $$css: true
42
+ },
43
+ headerAboveFabExpanded: {
44
+ k1K539: "x135sh1i",
45
+ $$css: true
46
+ },
47
+ headerExpanded: {
48
+ kGNEyG: "x1cy8zhl",
49
+ kSGwAc: "xkh2ocl",
50
+ k1K539: "x1mgj515",
51
+ kZCmMZ: "xdxifnh",
52
+ $$css: true
53
+ }
54
+ };
27
55
  /**
28
56
  * The column of top-level destinations a medium or wider window keeps at its
29
57
  * leading edge, collapsed or, with `isExpanded`, expanded. Each destination
@@ -44,127 +72,192 @@ const styles = { destinations: {
44
72
  * The call site's `className` and `style` land on the `<nav>`.
45
73
  */
46
74
  function NavigationRail(t0) {
47
- const $ = c(32);
75
+ const $ = c(36);
48
76
  let children;
49
77
  let context;
50
- let header;
78
+ let fab;
79
+ let hasFab;
51
80
  let isExpanded;
52
81
  let render;
53
82
  let t1;
54
83
  let t2;
55
84
  let t3;
56
85
  let t4;
86
+ let t5;
57
87
  if ($[0] !== t0) {
58
- const { children: t5, header: t6, isExpanded: t7, render: t8, selectedRoute, ...props } = t0;
59
- children = t5;
60
- header = t6;
61
- render = t8;
62
- isExpanded = t7 === void 0 ? false : t7;
63
- const t9 = isExpanded ? "expanded" : "collapsed";
64
- let t10;
65
- if ($[10] !== selectedRoute || $[11] !== t9) {
66
- t10 = {
67
- form: t9,
88
+ const { children: t6, fab: t7, header, isExpanded: t8, render: t9, selectedRoute, ...props$1 } = t0;
89
+ children = t6;
90
+ fab = t7;
91
+ render = t9;
92
+ isExpanded = t8 === void 0 ? false : t8;
93
+ const t10 = isExpanded ? "expanded" : "collapsed";
94
+ let t11;
95
+ if ($[12] !== selectedRoute || $[13] !== t10) {
96
+ t11 = {
97
+ form: t10,
68
98
  selectedRoute
69
99
  };
70
- $[10] = selectedRoute;
71
- $[11] = t9;
72
- $[12] = t10;
73
- } else t10 = $[12];
74
- context = t10;
75
- t4 = useRender;
76
- t3 = "nav";
77
- t1 = props;
78
- t2 = mergeStyles({
100
+ $[12] = selectedRoute;
101
+ $[13] = t10;
102
+ $[14] = t11;
103
+ } else t11 = $[14];
104
+ context = t11;
105
+ hasFab = hasContent(fab);
106
+ t5 = useRender;
107
+ t4 = "nav";
108
+ t2 = props$1;
109
+ t3 = mergeStyles({
79
110
  0: { className: "x6s0dn4 x14s9m32 x5yr21d x9f619 x78zum5 xdt5ytf x2lah0s x8i8c5o xlaft8j xzoy561 x13oubkp" },
80
111
  1: { className: "x6s0dn4 x14s9m32 x5yr21d x9f619 x78zum5 xdt5ytf x2lah0s x8i8c5o xlaft8j xeq5yr9 xxc7z9f x12rczxh x17qtykl" }
81
- }[!!isExpanded << 0], props);
112
+ }[!!isExpanded << 0], props$1);
113
+ t1 = header === void 0 ? null : /* @__PURE__ */ jsx("div", {
114
+ ...props(styles.header, isExpanded && styles.headerExpanded, hasFab && (isExpanded ? styles.headerAboveFabExpanded : styles.headerAboveFab)),
115
+ children: header
116
+ });
82
117
  $[0] = t0;
83
118
  $[1] = children;
84
119
  $[2] = context;
85
- $[3] = header;
86
- $[4] = isExpanded;
87
- $[5] = render;
88
- $[6] = t1;
89
- $[7] = t2;
90
- $[8] = t3;
91
- $[9] = t4;
120
+ $[3] = fab;
121
+ $[4] = hasFab;
122
+ $[5] = isExpanded;
123
+ $[6] = render;
124
+ $[7] = t1;
125
+ $[8] = t2;
126
+ $[9] = t3;
127
+ $[10] = t4;
128
+ $[11] = t5;
92
129
  } else {
93
130
  children = $[1];
94
131
  context = $[2];
95
- header = $[3];
96
- isExpanded = $[4];
97
- render = $[5];
98
- t1 = $[6];
99
- t2 = $[7];
100
- t3 = $[8];
101
- t4 = $[9];
132
+ fab = $[3];
133
+ hasFab = $[4];
134
+ isExpanded = $[5];
135
+ render = $[6];
136
+ t1 = $[7];
137
+ t2 = $[8];
138
+ t3 = $[9];
139
+ t4 = $[10];
140
+ t5 = $[11];
102
141
  }
103
- let t5;
104
- if ($[13] !== header || $[14] !== isExpanded) {
105
- t5 = header === void 0 ? null : /* @__PURE__ */ jsx("div", {
142
+ let t6;
143
+ if ($[15] !== fab || $[16] !== hasFab || $[17] !== isExpanded) {
144
+ t6 = hasFab ? /* @__PURE__ */ jsx("div", {
106
145
  ...{
107
146
  0: { className: "x6s0dn4 x9f619 x78zum5 xdt5ytf xqa3g7y" },
108
- 1: { className: "x9f619 x78zum5 xdt5ytf x1cy8zhl xkh2ocl x1mgj515 xdxifnh" }
147
+ 1: { className: "x9f619 x78zum5 xdt5ytf x1cy8zhl xkh2ocl x1mgj515" }
109
148
  }[!!isExpanded << 0],
110
- children: header
111
- });
112
- $[13] = header;
113
- $[14] = isExpanded;
114
- $[15] = t5;
115
- } else t5 = $[15];
116
- let t6;
117
- if ($[16] !== children) {
118
- t6 = /* @__PURE__ */ jsx(NavigationList, {
149
+ children: fab
150
+ }) : null;
151
+ $[15] = fab;
152
+ $[16] = hasFab;
153
+ $[17] = isExpanded;
154
+ $[18] = t6;
155
+ } else t6 = $[18];
156
+ let t7;
157
+ if ($[19] !== children) {
158
+ t7 = /* @__PURE__ */ jsx(NavigationList, {
119
159
  layout: styles.destinations,
120
160
  children
121
161
  });
122
- $[16] = children;
123
- $[17] = t6;
124
- } else t6 = $[17];
125
- let t7;
126
- if ($[18] !== t5 || $[19] !== t6) {
127
- t7 = /* @__PURE__ */ jsxs(Fragment$1, { children: [t5, t6] });
128
- $[18] = t5;
129
- $[19] = t6;
162
+ $[19] = children;
130
163
  $[20] = t7;
131
164
  } else t7 = $[20];
132
165
  let t8;
133
- if ($[21] !== t1 || $[22] !== t2 || $[23] !== t7) {
134
- t8 = {
135
- ...t1,
136
- ...t2,
137
- children: t7
138
- };
166
+ if ($[21] !== t1 || $[22] !== t6 || $[23] !== t7) {
167
+ t8 = /* @__PURE__ */ jsxs(Fragment$1, { children: [
168
+ t1,
169
+ t6,
170
+ t7
171
+ ] });
139
172
  $[21] = t1;
140
- $[22] = t2;
173
+ $[22] = t6;
141
174
  $[23] = t7;
142
175
  $[24] = t8;
143
176
  } else t8 = $[24];
144
177
  let t9;
145
- if ($[25] !== render || $[26] !== t3 || $[27] !== t8) {
178
+ if ($[25] !== t2 || $[26] !== t3 || $[27] !== t8) {
146
179
  t9 = {
147
- defaultTagName: t3,
148
- props: t8,
149
- render
180
+ ...t2,
181
+ ...t3,
182
+ children: t8
150
183
  };
151
- $[25] = render;
184
+ $[25] = t2;
152
185
  $[26] = t3;
153
186
  $[27] = t8;
154
187
  $[28] = t9;
155
188
  } else t9 = $[28];
156
- const rail = t4(t9);
157
189
  let t10;
158
- if ($[29] !== context || $[30] !== rail) {
159
- t10 = /* @__PURE__ */ jsx(NavigationContext, {
190
+ if ($[29] !== render || $[30] !== t4 || $[31] !== t9) {
191
+ t10 = {
192
+ defaultTagName: t4,
193
+ props: t9,
194
+ render
195
+ };
196
+ $[29] = render;
197
+ $[30] = t4;
198
+ $[31] = t9;
199
+ $[32] = t10;
200
+ } else t10 = $[32];
201
+ const rail = t5(t10);
202
+ let t11;
203
+ if ($[33] !== context || $[34] !== rail) {
204
+ t11 = /* @__PURE__ */ jsx(NavigationContext, {
160
205
  value: context,
161
206
  children: rail
162
207
  });
163
- $[29] = context;
164
- $[30] = rail;
165
- $[31] = t10;
166
- } else t10 = $[31];
167
- return t10;
208
+ $[33] = context;
209
+ $[34] = rail;
210
+ $[35] = t11;
211
+ } else t11 = $[35];
212
+ return t11;
213
+ }
214
+ /**
215
+ * The screen's floating action button in a navigation rail's `fab` slot: the
216
+ * 56dp FAB, its icon alone in the collapsed rail and named by `label`, and
217
+ * the extended FAB with `label` beside the icon in the expanded rail.
218
+ *
219
+ * ```tsx
220
+ * <NavigationRail
221
+ * aria-label="Label"
222
+ * fab={
223
+ * <NavigationRail.Fab label="Label" onPress={add}>
224
+ * <PlusIcon />
225
+ * </NavigationRail.Fab>
226
+ * }
227
+ * />
228
+ * ```
229
+ *
230
+ * It takes Fab's props otherwise: `tone`, `variant`, `href` and the rest.
231
+ */
232
+ function NavigationRailFab(t0) {
233
+ const $ = c(7);
234
+ let label;
235
+ let props;
236
+ if ($[0] !== t0) {
237
+ ({label, ...props} = t0);
238
+ $[0] = t0;
239
+ $[1] = label;
240
+ $[2] = props;
241
+ } else {
242
+ label = $[1];
243
+ props = $[2];
244
+ }
245
+ const { form } = use(NavigationContext);
246
+ let t1;
247
+ if ($[3] !== form || $[4] !== label || $[5] !== props) {
248
+ t1 = form === "expanded" ? /* @__PURE__ */ jsx(Fab, {
249
+ ...props,
250
+ label
251
+ }) : /* @__PURE__ */ jsx(Fab, {
252
+ ...props,
253
+ "aria-label": props["aria-label"] ?? label
254
+ });
255
+ $[3] = form;
256
+ $[4] = label;
257
+ $[5] = props;
258
+ $[6] = t1;
259
+ } else t1 = $[6];
260
+ return t1;
168
261
  }
169
262
  /**
170
263
  * One destination of a navigation rail — an icon, a label and, when it is the
@@ -185,7 +278,8 @@ function NavigationRailItem(props) {
185
278
  } else t0 = $[1];
186
279
  return t0;
187
280
  }
281
+ NavigationRail.Fab = NavigationRailFab;
188
282
  NavigationRail.Item = NavigationRailItem;
189
- export { NavigationRailItem, NavigationRail as default };
283
+ export { NavigationRailFab, NavigationRailItem, NavigationRail as default };
190
284
 
191
285
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["_c","useRender","mergeStyles","styles","destinations","kGNEyG","kSGwAc","kB7OPa","k1xSpc","kCS8Yb","kXwgrk","kzQI83","kmuXW","kqGvvJ","kUOVxO","kAzted","kORKVm","k8WAf4","kg3NbH","$$css","header","isExpanded","selectedRoute","NavigationRail","t0","$","children","context","render","t1","t2","t3","t4","t5","t6","t7","t8","props","undefined","t9","t10","form","0","className","1","defaultTagName","rail","NavigationRailItem","Item"],"sources":["../../../src/components/navigation-rail/index.tsx"],"sourcesContent":["'use client';\n\nimport type { ReactNode, RefAttributes } from 'react';\nimport * as stylex from '@stylexjs/stylex';\nimport { useMemo } from 'react';\nimport type { NavigationItemProps } from '../../navigation';\nimport type { RenderComponentProps } from '../../render/useRender';\nimport { NavigationItem, NavigationList } from '../../navigation';\nimport { NavigationContext } from '../../navigation/context';\nimport { useRender } from '../../render/useRender';\nimport { mergeStyles } from '../../styles/merge';\nimport '../../tokens/design.tokens.stylex';\nimport { colors, spacing } from '../../tokens/design.tokens.stylex';\n\n// The navigation rail page's rail, in both its forms: collapsed, a 96dp\n// column of vertical destinations down the leading edge of a medium or wider\n// window, and expanded, between 220dp and 360dp with each destination the\n// page's 56dp horizontal pill. The expanded rail is what the page has\n// replace the navigation drawer, so an app's top-level destinations reach\n// every window size between this and NavigationBar. Both forms are on the\n// surface role, with their contents 44dp from the top: the first destination,\n// or a header when the rail has one — a menu button that expands it, say —\n// with the first destination 40dp under it. The destinations are\n// `src/navigation`'s, shared with NavigationBar, which holds their values.\n//\n// A collapsed destination's label stays on one line in the 88dp under its\n// indicator, about thirteen characters of label medium. A longer one is cut\n// short with an ellipsis and shows its full text in the browser's tooltip on\n// hover — see `src/navigation`. Once the reader has enlarged their text, by\n// a text-only zoom or a minimum font size, the label takes further lines\n// instead and its destination grows to hold them, since that text no longer\n// fits the lengths around it — see src/hooks/useEnlargedText.ts. The expanded\n// rail's labels sit beside their icons, with the rest of the rail's 360dp at\n// most.\n//\n// The rail is a `<nav>`, and a page usually has more than one navigation\n// landmark, so name it with `aria-label`.\n\n// Windows High Contrast and the rest of the forced-colours modes. Spelled\n// here rather than imported, for the reason src/field/styles.ts records.\nconst FORCED_COLORS = '@media (forced-colors: active)';\n\n// How far a destination's focus ring reaches past it: the 2dp offset and\n// the 3dp ring, and 3dp more under forced colours, where the ring is twice\n// as heavy — see `ringWeight` in src/navigation/styles.ts. The destinations\n// scroll, and a scroll container clips what overflows it, so the block they\n// scroll in is padded by this much and pulled back out by as much, which\n// leaves every destination where it was and every ring whole.\nconst RING_REACH = {\n default: '5px',\n [FORCED_COLORS]: '8px'\n};\nconst RING_PULL = {\n default: '-5px',\n [FORCED_COLORS]: '-8px'\n};\nconst styles = {\n destinations: {\n kGNEyG: \"x6s0dn4\",\n kSGwAc: \"xkh2ocl\",\n kB7OPa: \"x9f619\",\n k1xSpc: \"x78zum5\",\n kCS8Yb: \"xdl72j9\",\n kXwgrk: \"xdt5ytf\",\n kzQI83: \"x1iyjqo2\",\n kmuXW: \"xs83m0k\",\n kqGvvJ: \"x15zwqr x196bl58\",\n kUOVxO: \"x13jr4wj x1knonev\",\n kAzted: \"x2lwn1j\",\n kORKVm: \"x1odjw0f\",\n k8WAf4: \"xifx94n x1flqomg\",\n kg3NbH: \"xm9j1uf x1snzwe2\",\n $$css: true\n }\n};\ntype NavigationRailProps = RenderComponentProps<'nav'> & {\n /**\n * What the rail draws above its destinations: a menu button that expands\n * it, or a floating action button.\n */\n header?: ReactNode;\n /**\n * Whether the rail is in its expanded form, each destination a pill with\n * its label beside the icon, rather than collapsed with the label under it.\n * @default false\n */\n isExpanded?: boolean;\n /**\n * The route of the current destination, matched exactly against each\n * destination's `href`. The match carries `aria-current=\"page\"` and the\n * active indicator. For a route nested under a destination, which no\n * `href` matches whole, mark that destination with its own `isCurrent`.\n */\n selectedRoute?: string;\n};\n\n/**\n * The column of top-level destinations a medium or wider window keeps at its\n * leading edge, collapsed or, with `isExpanded`, expanded. Each destination\n * is a link, so it routes through React Aria's `RouterProvider` when the app\n * has one.\n *\n * ```tsx\n * <NavigationRail aria-label=\"Label\" selectedRoute=\"/first\">\n * <NavigationRail.Item href=\"/first\" icon={<FirstIcon />}>\n * First item\n * </NavigationRail.Item>\n * <NavigationRail.Item href=\"/second\" icon={<SecondIcon />}>\n * Second item\n * </NavigationRail.Item>\n * </NavigationRail>\n * ```\n *\n * The call site's `className` and `style` land on the `<nav>`.\n */\nfunction NavigationRail({\n children,\n header,\n isExpanded = false,\n render,\n selectedRoute,\n ...props\n}: NavigationRailProps) {\n const context = useMemo(() => ({\n form: isExpanded ? 'expanded' as const : 'collapsed' as const,\n selectedRoute\n }), [isExpanded, selectedRoute]);\n const rail = useRender({\n defaultTagName: 'nav',\n props: {\n ...props,\n ...mergeStyles({\n 0: {\n className: \"x6s0dn4 x14s9m32 x5yr21d x9f619 x78zum5 xdt5ytf x2lah0s x8i8c5o xlaft8j xzoy561 x13oubkp\"\n },\n 1: {\n className: \"x6s0dn4 x14s9m32 x5yr21d x9f619 x78zum5 xdt5ytf x2lah0s x8i8c5o xlaft8j xeq5yr9 xxc7z9f x12rczxh x17qtykl\"\n }\n }[!!isExpanded << 0], props),\n children: <>\n {header === undefined ? null : <div {...{\n 0: {\n className: \"x6s0dn4 x9f619 x78zum5 xdt5ytf xqa3g7y\"\n },\n 1: {\n className: \"x9f619 x78zum5 xdt5ytf x1cy8zhl xkh2ocl x1mgj515 xdxifnh\"\n }\n }[!!isExpanded << 0]}>\n {header}\n </div>}\n <NavigationList layout={styles.destinations}>\n {children}\n </NavigationList>\n </>\n },\n render\n });\n return <NavigationContext value={context}>{rail}</NavigationContext>;\n}\n\n/**\n * One destination of a navigation rail — an icon, a label and, when it is the\n * current one, the active indicator. See `NavigationRail`.\n *\n * Defined here rather than re-exported from `src/navigation`: a re-export\n * let the build hand the package entry that module directly, past this\n * module's client directive, and a server component importing it got the\n * component itself rather than a reference to a client one.\n */\nfunction NavigationRailItem(props: NavigationItemProps & RefAttributes<HTMLAnchorElement>) {\n return <NavigationItem {...props} />;\n}\nNavigationRail.Item = NavigationRailItem;\nexport type { NavigationItemProps as NavigationRailItemProps, NavigationRailProps };\nexport { NavigationRailItem };\nexport default NavigationRail;"],"mappings":";;;;;;;;;AAwDA,MAAMG,SAAS,EACbC,cAAc;CACZC,QAAQ;CACRC,QAAQ;CACRC,QAAQ;CACRC,QAAQ;CACRC,QAAQ;CACRC,QAAQ;CACRC,QAAQ;CACRC,OAAO;CACPC,QAAQ;CACRC,QAAQ;CACRC,QAAQ;CACRC,QAAQ;CACRC,QAAQ;CACRC,QAAQ;CACRC,OAAO;AACT,EACF;;;;;;;;;;;;;;;;;;;;AAyCA,SAAAI,eAAAC,IAAA;CAAA,MAAAC,IAAAzB,EAAA,EAAA;CAAA,IAAA0B;CAAA,IAAAC;CAAA,IAAAP;CAAA,IAAAC;CAAA,IAAAO;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAP,EAAA,OAAAD,IAAA;EAAwB,MAAA,EAAAE,UAAAO,IAAAb,QAAAc,IAAAb,YAAAc,IAAAP,QAAAQ,IAAAd,eAAA,GAAAe,UAAAb;EAAAE,WAAAO;EAAAb,SAAAc;EAAAN,SAAAQ;EAGtBf,aAAAc,OAAAG,KAAAA,IAAA,QAAAH;EAMQ,MAAAI,KAAAlB,aAAa,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EAAA,OAAAY,OAAA;EACSb,KAAA,oBAAC,gBAAD,EAAe,GAAKa,MAAK,CAAA;EAAIZ,EAAA,KAAAY;EAAAZ,EAAA,KAAAD;CAAA,OAAAA,KAAAC,EAAA;CAAA,OAA7BD;AAA6B;AAEtCD,eAAeyB,OAAOD"}
1
+ {"version":3,"file":"index.js","names":["_c","stylex","use","NavigationContext","hasContent","useRender","mergeStyles","Fab","styles","destinations","kGNEyG","kSGwAc","kB7OPa","k1xSpc","kCS8Yb","kXwgrk","kzQI83","kmuXW","kqGvvJ","kUOVxO","kAzted","kORKVm","k8WAf4","kg3NbH","$$css","header","k1K539","headerAboveFab","headerAboveFabExpanded","headerExpanded","kZCmMZ","label","fab","isExpanded","selectedRoute","NavigationRail","t0","$","children","context","hasFab","render","t1","t2","t3","t4","t5","t6","t7","t8","t9","props","undefined","t10","t11","form","0","className","1","defaultTagName","rail","NavigationRailFab","NavigationRailItem","Item"],"sources":["../../../src/components/navigation-rail/index.tsx"],"sourcesContent":["'use client';\n\nimport type { ReactNode, RefAttributes } from 'react';\nimport * as stylex from '@stylexjs/stylex';\nimport { use, useMemo } from 'react';\nimport type { NavigationItemProps } from '../../navigation';\nimport type { RenderComponentProps } from '../../render/useRender';\nimport type { FabProps } from '../fab';\nimport { NavigationItem, NavigationList } from '../../navigation';\nimport { NavigationContext } from '../../navigation/context';\nimport { hasContent } from '../../render/content';\nimport { useRender } from '../../render/useRender';\nimport { mergeStyles } from '../../styles/merge';\nimport '../../tokens/design.tokens.stylex';\nimport { colors, spacing } from '../../tokens/design.tokens.stylex';\nimport Fab from '../fab';\n\n// The navigation rail page's rail, in both its forms: collapsed, a 96dp\n// column of vertical destinations down the leading edge of a medium or wider\n// window, and expanded, between 220dp and 360dp with each destination the\n// page's 56dp horizontal pill. The expanded rail is what the page has\n// replace the navigation drawer, so an app's top-level destinations reach\n// every window size between this and NavigationBar. Both forms are on the\n// surface role, with their contents 44dp from the top: the first destination,\n// or a header when the rail has one — a menu button that expands it, say —\n// with the first destination 40dp under it. The destinations are\n// `src/navigation`'s, shared with NavigationBar, which holds their values.\n//\n// A collapsed destination's label stays on one line in the 88dp under its\n// indicator, about thirteen characters of label medium. A longer one is cut\n// short with an ellipsis and shows its full text in the browser's tooltip on\n// hover — see `src/navigation`. Once the reader has enlarged their text, by\n// a text-only zoom or a minimum font size, the label takes further lines\n// instead and its destination grows to hold them, since that text no longer\n// fits the lengths around it — see src/hooks/useEnlargedText.ts. The expanded\n// rail's labels sit beside their icons, with the rest of the rail's 360dp at\n// most.\n//\n// The rail can hold the screen's FAB, where Material Design's rail puts it:\n// above the destinations, under the header when there is one, with the first\n// destination the page's 40dp under the FAB rather than under the header. The\n// header keeps whatever else stands there, such as a menu button or a mark,\n// 4dp above the FAB, the collapsed rail's gap between destinations.\n// `NavigationRail.Fab` is the 56dp FAB, taking its form from the rail's: the\n// icon alone in the collapsed rail, named by its label, and the extended FAB,\n// icon and label, in the expanded one, at the pills' leading edge so its icon\n// sits over theirs. It keeps the FAB's level 3 shadow. It sits outside the\n// list of destinations and before it, so a screen reader reaches it first.\n//\n// The rail is a `<nav>`, and a page usually has more than one navigation\n// landmark, so name it with `aria-label`.\n\n// Windows High Contrast and the rest of the forced-colours modes. Spelled\n// here rather than imported, for the reason src/field/styles.ts records.\nconst FORCED_COLORS = '@media (forced-colors: active)';\n\n// How far a destination's focus ring reaches past it: the 2dp offset and\n// the 3dp ring, and 3dp more under forced colours, where the ring is twice\n// as heavy — see `ringWeight` in src/navigation/styles.ts. The destinations\n// scroll, and a scroll container clips what overflows it, so the block they\n// scroll in is padded by this much and pulled back out by as much, which\n// leaves every destination where it was and every ring whole.\nconst RING_REACH = {\n default: '5px',\n [FORCED_COLORS]: '8px'\n};\nconst RING_PULL = {\n default: '-5px',\n [FORCED_COLORS]: '-8px'\n};\nconst styles = {\n destinations: {\n kGNEyG: \"x6s0dn4\",\n kSGwAc: \"xkh2ocl\",\n kB7OPa: \"x9f619\",\n k1xSpc: \"x78zum5\",\n kCS8Yb: \"xdl72j9\",\n kXwgrk: \"xdt5ytf\",\n kzQI83: \"x1iyjqo2\",\n kmuXW: \"xs83m0k\",\n kqGvvJ: \"x15zwqr x196bl58\",\n kUOVxO: \"x13jr4wj x1knonev\",\n kAzted: \"x2lwn1j\",\n kORKVm: \"x1odjw0f\",\n k8WAf4: \"xifx94n x1flqomg\",\n kg3NbH: \"xm9j1uf x1snzwe2\",\n $$css: true\n },\n header: {\n kGNEyG: \"x6s0dn4\",\n kB7OPa: \"x9f619\",\n k1xSpc: \"x78zum5\",\n kXwgrk: \"xdt5ytf\",\n k1K539: \"xqa3g7y\",\n $$css: true\n },\n headerAboveFab: {\n k1K539: \"xat24cr\",\n $$css: true\n },\n headerAboveFabExpanded: {\n k1K539: \"x135sh1i\",\n $$css: true\n },\n headerExpanded: {\n kGNEyG: \"x1cy8zhl\",\n kSGwAc: \"xkh2ocl\",\n k1K539: \"x1mgj515\",\n kZCmMZ: \"xdxifnh\",\n $$css: true\n }\n};\ntype NavigationRailFabProps = Omit<FabProps, 'aria-label' | 'label' | 'size'> & RefAttributes<HTMLAnchorElement | HTMLButtonElement> & {\n /**\n * The FAB's name in either form, in place of `label`, for a name that\n * says more than the words drawn beside the icon.\n */\n 'aria-label'?: string;\n /**\n * What the FAB does, in words: drawn beside the icon in the expanded rail,\n * and the FAB's name in the collapsed one, where the icon stands alone.\n */\n label: string;\n};\ntype NavigationRailProps = RenderComponentProps<'nav'> & {\n /**\n * The screen's floating action button, a `NavigationRail.Fab`, drawn above\n * the destinations and under the header: its icon alone in the collapsed\n * rail, and the extended FAB in the expanded one.\n */\n fab?: ReactNode;\n /**\n * What the rail draws above its destinations and its FAB: a menu button\n * that expands it, or a mark.\n */\n header?: ReactNode;\n /**\n * Whether the rail is in its expanded form, each destination a pill with\n * its label beside the icon, rather than collapsed with the label under it.\n * @default false\n */\n isExpanded?: boolean;\n /**\n * The route of the current destination, matched exactly against each\n * destination's `href`. The match carries `aria-current=\"page\"` and the\n * active indicator. For a route nested under a destination, which no\n * `href` matches whole, mark that destination with its own `isCurrent`.\n */\n selectedRoute?: string;\n};\n\n/**\n * The column of top-level destinations a medium or wider window keeps at its\n * leading edge, collapsed or, with `isExpanded`, expanded. Each destination\n * is a link, so it routes through React Aria's `RouterProvider` when the app\n * has one.\n *\n * ```tsx\n * <NavigationRail aria-label=\"Label\" selectedRoute=\"/first\">\n * <NavigationRail.Item href=\"/first\" icon={<FirstIcon />}>\n * First item\n * </NavigationRail.Item>\n * <NavigationRail.Item href=\"/second\" icon={<SecondIcon />}>\n * Second item\n * </NavigationRail.Item>\n * </NavigationRail>\n * ```\n *\n * The call site's `className` and `style` land on the `<nav>`.\n */\nfunction NavigationRail({\n children,\n fab,\n header,\n isExpanded = false,\n render,\n selectedRoute,\n ...props\n}: NavigationRailProps) {\n const context = useMemo(() => ({\n form: isExpanded ? 'expanded' as const : 'collapsed' as const,\n selectedRoute\n }), [isExpanded, selectedRoute]);\n // A slot handed `false` or `null`, as `fab={isWide && <Fab />}` hands it,\n // holds nothing, and the header keeps its own 40dp.\n const hasFab = hasContent(fab);\n const rail = useRender({\n defaultTagName: 'nav',\n props: {\n ...props,\n ...mergeStyles({\n 0: {\n className: \"x6s0dn4 x14s9m32 x5yr21d x9f619 x78zum5 xdt5ytf x2lah0s x8i8c5o xlaft8j xzoy561 x13oubkp\"\n },\n 1: {\n className: \"x6s0dn4 x14s9m32 x5yr21d x9f619 x78zum5 xdt5ytf x2lah0s x8i8c5o xlaft8j xeq5yr9 xxc7z9f x12rczxh x17qtykl\"\n }\n }[!!isExpanded << 0], props),\n children: <>\n {header === undefined ? null : <div {...stylex.props(styles.header, isExpanded && styles.headerExpanded, hasFab && (isExpanded ? styles.headerAboveFabExpanded : styles.headerAboveFab))}>\n {header}\n </div>}\n {hasFab ? <div {...{\n 0: {\n className: \"x6s0dn4 x9f619 x78zum5 xdt5ytf xqa3g7y\"\n },\n 1: {\n className: \"x9f619 x78zum5 xdt5ytf x1cy8zhl xkh2ocl x1mgj515\"\n }\n }[!!isExpanded << 0]}>\n {fab}\n </div> : null}\n <NavigationList layout={styles.destinations}>\n {children}\n </NavigationList>\n </>\n },\n render\n });\n return <NavigationContext value={context}>{rail}</NavigationContext>;\n}\n\n/**\n * The screen's floating action button in a navigation rail's `fab` slot: the\n * 56dp FAB, its icon alone in the collapsed rail and named by `label`, and\n * the extended FAB with `label` beside the icon in the expanded rail.\n *\n * ```tsx\n * <NavigationRail\n * aria-label=\"Label\"\n * fab={\n * <NavigationRail.Fab label=\"Label\" onPress={add}>\n * <PlusIcon />\n * </NavigationRail.Fab>\n * }\n * />\n * ```\n *\n * It takes Fab's props otherwise: `tone`, `variant`, `href` and the rest.\n */\nfunction NavigationRailFab({\n label,\n ...props\n}: NavigationRailFabProps) {\n const {\n form\n } = use(NavigationContext);\n return form === 'expanded' ? <Fab {...props} label={label} /> : <Fab {...props} aria-label={props['aria-label'] ?? label} />;\n}\n\n/**\n * One destination of a navigation rail — an icon, a label and, when it is the\n * current one, the active indicator. See `NavigationRail`.\n *\n * Defined here rather than re-exported from `src/navigation`: a re-export\n * let the build hand the package entry that module directly, past this\n * module's client directive, and a server component importing it got the\n * component itself rather than a reference to a client one.\n */\nfunction NavigationRailItem(props: NavigationItemProps & RefAttributes<HTMLAnchorElement>) {\n return <NavigationItem {...props} />;\n}\nNavigationRail.Fab = NavigationRailFab;\nNavigationRail.Item = NavigationRailItem;\nexport type { NavigationRailFabProps, NavigationItemProps as NavigationRailItemProps, NavigationRailProps };\nexport { NavigationRailFab, NavigationRailItem };\nexport default NavigationRail;"],"mappings":";;;;;;;;;;;;AAsEA,MAAMQ,SAAS;CACbC,cAAc;EACZC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,OAAO;EACPC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,OAAO;CACT;C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L,OAAA,GAAAoB,SAAAf;EAGFC,EAAA,KAAAD;EAAAC,EAAA,KAAAN;EAAAM,EAAA,KAAAc;CAAA,OAAA;EAAApB,QAAAM,EAAA;EAAAc,QAAAd,EAAA;CAAA;CACvB,MAAA,EAAAkB,SAEIrD,IAAIC,iBAAiB;CAAE,IAAAuC;CAAA,IAAAL,EAAA,OAAAkB,QAAAlB,EAAA,OAAAN,SAAAM,EAAA,OAAAc,OAAA;EACpBT,KAAAa,SAAS,aAAa,oBAAC,KAAD;GAAI,GAAKJ;GAAcpB;EAAK,CAAA,IAAO,oBAAC,KAAD;GAAI,GAAKoB;GAAmB,cAAAA,MAAM,iBAANpB;EAA4B,CAAA;EAAIM,EAAA,KAAAkB;EAAAlB,EAAA,KAAAN;EAAAM,EAAA,KAAAc;EAAAd,EAAA,KAAAK;CAAA,OAAAA,KAAAL,EAAA;CAAA,OAArHK;AAAqH;;;;;;;;;;AAY9H,SAAAoB,mBAAAX,OAAA;CAAA,MAAAd,IAAArC,EAAA,CAAA;CAAA,IAAAoC;CAAA,IAAAC,EAAA,OAAAc,OAAA;EACSf,KAAA,oBAAC,gBAAD,EAAe,GAAKe,MAAK,CAAA;EAAId,EAAA,KAAAc;EAAAd,EAAA,KAAAD;CAAA,OAAAA,KAAAC,EAAA;CAAA,OAA7BD;AAA6B;AAEtCD,eAAe5B,MAAMsD;AACrB1B,eAAe4B,OAAOD"}
@@ -1,15 +1,26 @@
1
1
  import { c } from "react/compiler-runtime";
2
2
  import { useState } from "react";
3
3
  // src/hooks/useImageLoadingStatus.ts
4
+ /** Settles an image whose natural width cannot tell a load from a failure. */
5
+ async function settleOnDecode(image, onLoaded, onFailed) {
6
+ try {
7
+ await image.decode();
8
+ } catch {
9
+ onFailed(image);
10
+ return;
11
+ }
12
+ onLoaded(image);
13
+ }
4
14
  /**
5
15
  * Whether the picture at `src` can be shown yet, from what the component's
6
16
  * own `<img>` reports. The image is rendered from the start and hidden until
7
17
  * it loads, so the browser fetches it as it would any image — `loading`,
8
18
  * `srcSet` and `sizes` all apply, which a detached preloader started on
9
- * mount left them no part in — and hand `onLoad` and `onError` to that
10
- * element. A component keeps its fallback until the picture is ready and
11
- * brings it back if the picture fails, so the browser's broken-image glyph
12
- * is never what shows.
19
+ * mount left them no part in — and hand `onLoad`, `onError` and `ref` to
20
+ * that element, the last for a picture that settled before the other two
21
+ * were attached. A component keeps its fallback until the picture is ready
22
+ * and brings it back if the picture fails, so the browser's broken-image
23
+ * glyph is never what shows.
13
24
  *
14
25
  * `previous` is the picture last loaded, while a new `src` is still loading,
15
26
  * so the component can keep showing it rather than drop back to the fallback
@@ -22,13 +33,12 @@ import { useState } from "react";
22
33
  * change of `src` reads as loading rather than as the old outcome.
23
34
  */
24
35
  function useImageLoadingStatus(src) {
25
- const $ = c(5);
36
+ const $ = c(8);
26
37
  const [loaded, setLoaded] = useState(null);
27
38
  const [failed, setFailed] = useState(null);
28
39
  let t0;
29
40
  if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
30
- t0 = (event) => {
31
- const image = event.currentTarget;
41
+ t0 = (image) => {
32
42
  const from = image.getAttribute("src");
33
43
  if (from !== null) setLoaded({
34
44
  shown: image.currentSrc === "" ? from : image.currentSrc,
@@ -37,33 +47,63 @@ function useImageLoadingStatus(src) {
37
47
  };
38
48
  $[0] = t0;
39
49
  } else t0 = $[0];
40
- const onLoad = t0;
50
+ const settleLoaded = t0;
41
51
  let t1;
42
52
  if ($[1] === Symbol.for("react.memo_cache_sentinel")) {
43
- t1 = (event_0) => {
44
- const from_0 = event_0.currentTarget.getAttribute("src");
53
+ t1 = (image_0) => {
54
+ const from_0 = image_0.getAttribute("src");
45
55
  if (from_0 !== null) setFailed(from_0);
46
56
  };
47
57
  $[1] = t1;
48
58
  } else t1 = $[1];
49
- const onError = t1;
59
+ const settleFailed = t1;
60
+ let t2;
61
+ if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
62
+ t2 = (event) => {
63
+ settleLoaded(event.currentTarget);
64
+ };
65
+ $[2] = t2;
66
+ } else t2 = $[2];
67
+ const onLoad = t2;
68
+ let t3;
69
+ if ($[3] === Symbol.for("react.memo_cache_sentinel")) {
70
+ t3 = (event_0) => {
71
+ settleFailed(event_0.currentTarget);
72
+ };
73
+ $[3] = t3;
74
+ } else t3 = $[3];
75
+ const onError = t3;
76
+ let t4;
77
+ if ($[4] === Symbol.for("react.memo_cache_sentinel")) {
78
+ t4 = (image_1) => {
79
+ if (image_1 === null || !image_1.complete) return;
80
+ if (image_1.naturalWidth > 0) {
81
+ settleLoaded(image_1);
82
+ return;
83
+ }
84
+ settleOnDecode(image_1, settleLoaded, settleFailed);
85
+ };
86
+ $[4] = t4;
87
+ } else t4 = $[4];
88
+ const ref = t4;
50
89
  let status = "loading";
51
90
  if (src === void 0 || failed === src) status = "error";
52
91
  else if (loaded?.src === src) status = "loaded";
53
- const t2 = status === "loading" ? loaded?.shown : void 0;
54
- let t3;
55
- if ($[2] !== status || $[3] !== t2) {
56
- t3 = {
92
+ const t5 = status === "loading" ? loaded?.shown : void 0;
93
+ let t6;
94
+ if ($[5] !== status || $[6] !== t5) {
95
+ t6 = {
57
96
  onError,
58
97
  onLoad,
59
- previous: t2,
98
+ previous: t5,
99
+ ref,
60
100
  status
61
101
  };
62
- $[2] = status;
63
- $[3] = t2;
64
- $[4] = t3;
65
- } else t3 = $[4];
66
- return t3;
102
+ $[5] = status;
103
+ $[6] = t5;
104
+ $[7] = t6;
105
+ } else t6 = $[7];
106
+ return t6;
67
107
  }
68
108
  export { useImageLoadingStatus };
69
109
 
@@ -1 +1 @@
1
- {"version":3,"file":"useImageLoadingStatus.js","names":["useState","shown","src","useImageLoadingStatus","$","_c","loaded","setLoaded","failed","setFailed","t0","Symbol","for","event","image","currentTarget","from","getAttribute","currentSrc","onLoad","t1","event_0","from_0","onError","status","undefined","t2","t3","previous"],"sources":["../../src/hooks/useImageLoadingStatus.ts"],"sourcesContent":["import type { SyntheticEvent } from 'react'\n\nimport { useCallback, useState } from 'react'\n\ntype ImageLoadingStatus = 'error' | 'loaded' | 'loading'\n\ninterface Loaded {\n /** The resource the browser chose and loaded, out of a `srcSet` too. */\n shown: string\n /** The `src` it loaded for. */\n src: string\n}\n\n/**\n * Whether the picture at `src` can be shown yet, from what the component's\n * own `<img>` reports. The image is rendered from the start and hidden until\n * it loads, so the browser fetches it as it would any image — `loading`,\n * `srcSet` and `sizes` all apply, which a detached preloader started on\n * mount left them no part in — and hand `onLoad` and `onError` to that\n * element. A component keeps its fallback until the picture is ready and\n * brings it back if the picture fails, so the browser's broken-image glyph\n * is never what shows.\n *\n * `previous` is the picture last loaded, while a new `src` is still loading,\n * so the component can keep showing it rather than drop back to the fallback\n * for as long as the new one takes — a theme swapping one logo for another\n * flashed the initial between them. It is the resource the browser actually\n * loaded, which is cached, so an element showing it needs no `srcSet`.\n *\n * No `src` counts as a failure, since the outcome is the same: the fallback\n * shows. Outcomes are remembered against the `src` they came for, so a\n * change of `src` reads as loading rather than as the old outcome.\n */\nfunction useImageLoadingStatus(src: string | undefined) {\n const [loaded, setLoaded] = useState<Loaded | null>(null)\n const [failed, setFailed] = useState<null | string>(null)\n\n // Read off the element rather than closed over, so the one pair of\n // handlers serves whichever `src` the element carries when it settles.\n const onLoad = useCallback((event: SyntheticEvent<HTMLImageElement>) => {\n const image = event.currentTarget\n const from = image.getAttribute('src')\n if (from !== null) {\n setLoaded({\n shown: image.currentSrc === '' ? from : image.currentSrc,\n src: from,\n })\n }\n }, [])\n const onError = useCallback((event: SyntheticEvent<HTMLImageElement>) => {\n const from = event.currentTarget.getAttribute('src')\n if (from !== null) {\n setFailed(from)\n }\n }, [])\n\n let status: ImageLoadingStatus = 'loading'\n if (src === undefined || failed === src) {\n status = 'error'\n } else if (loaded?.src === src) {\n status = 'loaded'\n }\n\n return {\n onError,\n onLoad,\n previous: status === 'loading' ? loaded?.shown : undefined,\n status,\n }\n}\n\nexport type { ImageLoadingStatus }\n\nexport { useImageLoadingStatus }\n"],"mappings":";;;;;;;;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","settleOnDecode","image","onLoaded","onFailed","decode","useImageLoadingStatus","$","_c","loaded","setLoaded","failed","setFailed","t0","Symbol","for","from","getAttribute","currentSrc","settleLoaded","t1","image_0","from_0","settleFailed","t2","event","currentTarget","onLoad","t3","event_0","onError","t4","image_1","complete","naturalWidth","ref","status","undefined","t5","t6","previous"],"sources":["../../src/hooks/useImageLoadingStatus.ts"],"sourcesContent":["import type { SyntheticEvent } from 'react'\n\nimport { useCallback, useState } from 'react'\n\ntype ImageLoadingStatus = 'error' | 'loaded' | 'loading'\n\ninterface Loaded {\n /** The resource the browser chose and loaded, out of a `srcSet` too. */\n shown: string\n /** The `src` it loaded for. */\n src: string\n}\n\n/** Settles an image whose natural width cannot tell a load from a failure. */\nasync function settleOnDecode(\n image: HTMLImageElement,\n onLoaded: (image: HTMLImageElement) => void,\n onFailed: (image: HTMLImageElement) => void,\n) {\n try {\n await image.decode()\n } catch {\n onFailed(image)\n return\n }\n onLoaded(image)\n}\n\n/**\n * Whether the picture at `src` can be shown yet, from what the component's\n * own `<img>` reports. The image is rendered from the start and hidden until\n * it loads, so the browser fetches it as it would any image — `loading`,\n * `srcSet` and `sizes` all apply, which a detached preloader started on\n * mount left them no part in — and hand `onLoad`, `onError` and `ref` to\n * that element, the last for a picture that settled before the other two\n * were attached. A component keeps its fallback until the picture is ready\n * and brings it back if the picture fails, so the browser's broken-image\n * glyph is never what shows.\n *\n * `previous` is the picture last loaded, while a new `src` is still loading,\n * so the component can keep showing it rather than drop back to the fallback\n * for as long as the new one takes — a theme swapping one logo for another\n * flashed the initial between them. It is the resource the browser actually\n * loaded, which is cached, so an element showing it needs no `srcSet`.\n *\n * No `src` counts as a failure, since the outcome is the same: the fallback\n * shows. Outcomes are remembered against the `src` they came for, so a\n * change of `src` reads as loading rather than as the old outcome.\n */\nfunction useImageLoadingStatus(src: string | undefined) {\n const [loaded, setLoaded] = useState<Loaded | null>(null)\n const [failed, setFailed] = useState<null | string>(null)\n\n // Read off the element rather than closed over, so the one set of\n // handlers serves whichever `src` the element carries when it settles.\n const settleLoaded = useCallback((image: HTMLImageElement) => {\n const from = image.getAttribute('src')\n if (from !== null) {\n setLoaded({\n shown: image.currentSrc === '' ? from : image.currentSrc,\n src: from,\n })\n }\n }, [])\n const settleFailed = useCallback((image: HTMLImageElement) => {\n const from = image.getAttribute('src')\n if (from !== null) {\n setFailed(from)\n }\n }, [])\n const onLoad = useCallback(\n (event: SyntheticEvent<HTMLImageElement>) => {\n settleLoaded(event.currentTarget)\n },\n [settleLoaded],\n )\n const onError = useCallback(\n (event: SyntheticEvent<HTMLImageElement>) => {\n settleFailed(event.currentTarget)\n },\n [settleFailed],\n )\n\n // An image can settle before React is listening for it. A server-rendered\n // page fetches its images before its script runs, so a small or cached\n // picture has loaded, or failed, by the time React hydrates the element\n // and attaches `onLoad` and `onError` — and the event they wait for has\n // already gone. The ref reads the outcome off the element instead.\n // `complete` is also true of a broken image, and a loaded one has a\n // natural width, so that answers it, except for an SVG with no intrinsic\n // size: Firefox gives one a natural width of 0. `decode()` resolves for a\n // picture that loaded and rejects for one that failed, which settles\n // those. An image still loading is left to its handlers.\n const ref = useCallback(\n (image: HTMLImageElement | null) => {\n if (image === null || !image.complete) {\n return\n }\n if (image.naturalWidth > 0) {\n settleLoaded(image)\n return\n }\n void settleOnDecode(image, settleLoaded, settleFailed)\n },\n [settleFailed, settleLoaded],\n )\n\n let status: ImageLoadingStatus = 'loading'\n if (src === undefined || failed === src) {\n status = 'error'\n } else if (loaded?.src === src) {\n status = 'loaded'\n }\n\n return {\n onError,\n onLoad,\n previous: status === 'loading' ? loaded?.shown : undefined,\n ref,\n status,\n }\n}\n\nexport type { ImageLoadingStatus }\n\nexport { useImageLoadingStatus }\n"],"mappings":";;;;AAcA,eAAeG,eACbC,OACAC,UACAC,UACA;CACA,IAAI;EACF,MAAMF,MAAMG,OAAO;CACrB,QAAQ;EACND,SAASF,KAAK;EACd;CACF;CACAC,SAASD,KAAK;AAChB;;;;;;;;;;;;;;;;;;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GAGrC,IAAI/B,QAAKgC,eAAgB,GAAC;IACxBf,aAAajB,OAAK;IAAC;GAAA;GAGhBD,eAAeC,SAAOiB,cAAcI,YAAY;EAAC;EACvDhB,EAAA,KAAAwB;CAAA,OAAAA,KAAAxB,EAAA;CAVH,MAAA4B,MAAYJ;CAcZ,IAAAK,SAAiC;CACjC,IAAIpC,QAAQqC,KAAAA,KAAa1B,WAAWX,KAClCoC,SAASA;MACJ,IAAI3B,QAAMT,QAAUA,KACzBoC,SAASA;CAMC,MAAAE,KAAAF,WAAW,YAAY3B,QAAMV,QAA7BsC,KAAAA;CAAgD,IAAAE;CAAA,IAAAhC,EAAA,OAAA6B,UAAA7B,EAAA,OAAA+B,IAAA;EAHrDC,KAAA;GAAAT;GAAAH;GAAAa,UAGKF;GAAgDH;GAAAC;EAG5D;EAAC7B,EAAA,KAAA6B;EAAA7B,EAAA,KAAA+B;EAAA/B,EAAA,KAAAgC;CAAA,OAAAA,KAAAhC,EAAA;CAAA,OANMgC;AAMN"}
package/dist/index.d.ts CHANGED
@@ -52,7 +52,7 @@ import Menu, { MenuAlign, MenuContent, MenuContentProps, MenuItem, MenuItemProps
52
52
  import Meter, { MeterProps, MeterTone } from "./components/meter/index.js";
53
53
  import { NavigationItemProps } from "./navigation/index.js";
54
54
  import NavigationBar, { NavigationBarItem, NavigationBarProps } from "./components/navigation-bar/index.js";
55
- import NavigationRail, { NavigationRailItem, NavigationRailProps } from "./components/navigation-rail/index.js";
55
+ import NavigationRail, { NavigationRailFab, NavigationRailFabProps, NavigationRailItem, NavigationRailProps } from "./components/navigation-rail/index.js";
56
56
  import NavigationTree, { NavigationTreeItem, NavigationTreeItemProps, NavigationTreeProps, NavigationTreeSection, NavigationTreeSectionProps } from "./components/navigation-tree/index.js";
57
57
  import NumberField, { NumberFieldProps } from "./components/number-field/index.js";
58
58
  import Popover, { PopoverAlign, PopoverContent, PopoverContentProps, PopoverDescription, PopoverDescriptionProps, PopoverProps, PopoverSide, PopoverSize, PopoverTitle, PopoverTitleProps, PopoverTrigger } from "./components/popover/index.js";
@@ -87,6 +87,6 @@ import "./components/index.js";
87
87
  import { collectionSizes } from "./layout.js";
88
88
  import { useDragAndDrop } from "./drag/hooks.js";
89
89
  import { Collection, DIRECTORY_DRAG_TYPE, Focusable, FocusableElement, GridLayout, HoverEvent, I18nProvider, Key, KeyboardEvent, ListLayout, PressEvent, Pressable, RouterProvider, Selection, SharedElement, SharedElementTransition, SortDescriptor, TableLayout, TokenFieldValue, Virtualizer, VisuallyHidden, WaterfallLayout, getColorChannels, isDirectoryDropItem, isFileDropItem, isTextDropItem, parseColor, useAsyncList, useDrag, useDrop, useFilter, useListData, useLocale, useTreeData } from "./react-aria.js";
90
- import { t as KuiTheme } from "./kanso-ui-core/defaults-D9KBLBW_.js";
90
+ import { t as KuiTheme } from "./kanso-ui-core/defaults-DYY7ddNI.js";
91
91
  import { ThemeScope, ThemeScopeProps } from "./theme-scope.js";
92
- export { AppBar, type AppBarProps, type AppBarScroll, type AppBarScrollOptions, Autocomplete, type AutocompleteFilter, type AutocompleteProps, Avatar, type AvatarProps, Badge, type BadgeProps, Breadcrumbs, BreadcrumbsItem, type BreadcrumbsItemProps, type BreadcrumbsProps, Button, ButtonGroup, type ButtonGroupProps, type ButtonGroupVariant, type ButtonProps, type ButtonShape, type ButtonSize, type ButtonVariant, Calendar, type CalendarProps, Card, type CardProps, type CardVariant, Carousel, CarouselItem, type CarouselItemProps, type CarouselItemRenderProps, type CarouselLayout, type CarouselProps, Checkbox, CheckboxGroup, type CheckboxGroupProps, type CheckboxProps, Chip, type ChipActionProps, type ChipDropdownProps, type ChipFilterProps, ChipGroup, ChipGroupChip, type ChipGroupChipProps, type ChipGroupProps, type ChipProps, type ChipVariant, Code, type CodeProps, Collection, ColorArea, type ColorAreaProps, ColorField, type ColorFieldProps, ColorPicker, type ColorPickerProps, ColorSlider, type ColorSliderProps, ColorSwatch, ColorSwatchPicker, ColorSwatchPickerItem, type ColorSwatchPickerItemProps, type ColorSwatchPickerProps, type ColorSwatchProps, ColorWheel, type ColorWheelProps, ComboBox, type ComboBoxProps, type ComboBoxSelectionMode, Container, type ContainerProps, CopyField, type CopyFieldProps, Currency, type CurrencyDisplay, type CurrencyNotation, type CurrencyProps, type CurrencySignDisplay, type CurrencyTone, DIRECTORY_DRAG_TYPE, DateField, type DateFieldProps, DatePicker, type DatePickerProps, DateRangePicker, type DateRangePickerProps, Dialog, DialogBody, DialogContent, type DialogContentProps, DialogFooter, DialogHeader, type DialogProps, DialogTitle, type DialogTitleProps, Disclosure, DisclosureGroup, type DisclosureGroupProps, DisclosureHeader, type DisclosureHeaderProps, DisclosurePanel, type DisclosurePanelProps, type DisclosureProps, DropZone, type DropZoneProps, Fab, FabMenu, FabMenuItem, type FabMenuItemProps, type FabMenuProps, type FabProps, type FabSize, type FabTone, type FabVariant, Feed, type FeedProps, type FieldVariant, FileTrigger, type FileTriggerProps, Focusable, type FocusableElement, Form, type FormProps, GridLayout, type HoverEvent, I18nProvider, IconButton, type IconButtonProps, type IconButtonSize, type IconButtonVariant, type Key, type KeyboardEvent, Keycap, type KeycapProps, type KuiTheme, Link, type LinkProps, type LinkTone, type LinkUnderline, List, ListBox, ListBoxItem, type ListBoxItemProps, ListBoxLoadMore, type ListBoxLoadMoreProps, type ListBoxProps, ListBoxSection, type ListBoxSectionProps, ListDetail, type ListDetailProps, ListItem, type ListItemProps, ListLayout, ListLoadMore, type ListLoadMoreProps, type ListProps, ListRow, type ListRowProps, ListSection, type ListSectionProps, LoadingIndicator, type LoadingIndicatorProps, Menu, type MenuAlign, MenuContent, type MenuContentProps, MenuItem, type MenuItemProps, MenuLoadMore, type MenuLoadMoreProps, type MenuProps, MenuSection, type MenuSectionProps, MenuSeparator, type MenuSeparatorProps, type MenuSide, MenuSubmenu, type MenuSubmenuProps, Meter, type MeterProps, type MeterTone, NavigationBar, NavigationBarItem, type NavigationItemProps as NavigationBarItemProps, type NavigationBarProps, NavigationRail, NavigationRailItem, type NavigationItemProps as NavigationRailItemProps, type NavigationRailProps, NavigationTree, NavigationTreeItem, type NavigationTreeItemProps, type NavigationTreeProps, NavigationTreeSection, type NavigationTreeSectionProps, NumberField, type NumberFieldProps, Popover, type PopoverAlign, PopoverContent, type PopoverContentProps, PopoverDescription, type PopoverDescriptionProps, type PopoverProps, type PopoverSide, type PopoverSize, PopoverTitle, type PopoverTitleProps, type PopoverTrigger, type PressEvent, Pressable, ProductIcon, type ProductIconProps, ProgressIndicator, type ProgressIndicatorProps, type ProgressIndicatorShape, type ProgressIndicatorTone, type ProgressIndicatorVariant, Radio, RadioGroup, type RadioGroupProps, type RadioProps, RangeCalendar, type RangeCalendarProps, RouterProvider, SearchField, type SearchFieldProps, SearchView, SearchViewContent, type SearchViewContentProps, type SearchViewProps, SegmentedButton, type SegmentedButtonProps, SegmentedButtonSegment, type SegmentedButtonSegmentProps, Select, type SelectProps, type Selection, Separator, type SeparatorInset, type SeparatorProps, SharedElement, SharedElementTransition, Sheet, SheetBody, SheetContent, type SheetContentProps, SheetFooter, SheetHandle, SheetHeader, type SheetProps, SheetTitle, type SheetTitleProps, Slider, type SliderProps, type SliderSize, Snackbar, type SnackbarAction, type SnackbarMessage, type SnackbarOptions, type SnackbarProps, type SnackbarQueue, type ToastRegionRenderProps as SnackbarRegionRenderProps, type SortDescriptor, SplitButton, SplitButtonAction, type SplitButtonActionProps, SplitButtonMenu, type SplitButtonMenuProps, type SplitButtonProps, type SplitButtonVariant, Stack, type StackAlign, type StackGap, type StackJustify, type StackProps, SupportingPane, type SupportingPaneProps, Switch, type SwitchProps, Table, type TableAlign, TableBody, type TableBodyProps, TableCell, type TableCellProps, TableColumn, type TableColumnProps, TableFooter, type TableFooterProps, TableHeader, type TableHeaderProps, TableLayout, TableLoadMore, type TableLoadMoreProps, type TableProps, TableRow, type TableRowProps, Tabs, type TabsLayout, TabsList, type TabsListProps, TabsPanel, type TabsPanelProps, TabsPanels, type TabsPanelsProps, type TabsProps, TabsTab, type TabsTabProps, type TabsVariant, Tag, type TagProps, type TagTone, type TagVariant, Text, TextArea, type TextAreaProps, TextField, type TextFieldProps, type TextProps, ThemeScope, type ThemeScopeProps, TimeField, type TimeFieldProps, TimePicker, type TimePickerMode, type TimePickerProps, TokenField, type TokenFieldProps, TokenFieldValue, type TokenSegment, Toolbar, type ToolbarProps, type ToolbarTone, Tooltip, type TooltipAlign, type TooltipProps, type TooltipSide, Tree, TreeItem, type TreeItemProps, TreeLoadMore, type TreeLoadMoreProps, type TreeProps, TreeSection, type TreeSectionProps, Virtualizer, VisuallyHidden, WaterfallLayout, collectionSizes, colorScheme, getColorChannels, isDirectoryDropItem, isFileDropItem, isTextDropItem, parseColor, themeScope, useAppBarScroll, useAsyncList, useDrag, useDragAndDrop, useDrop, useFilter, useListData, useLocale, useTreeData };
92
+ export { AppBar, type AppBarProps, type AppBarScroll, type AppBarScrollOptions, Autocomplete, type AutocompleteFilter, type AutocompleteProps, Avatar, type AvatarProps, Badge, type BadgeProps, Breadcrumbs, BreadcrumbsItem, type BreadcrumbsItemProps, type BreadcrumbsProps, Button, ButtonGroup, type ButtonGroupProps, type ButtonGroupVariant, type ButtonProps, type ButtonShape, type ButtonSize, type ButtonVariant, Calendar, type CalendarProps, Card, type CardProps, type CardVariant, Carousel, CarouselItem, type CarouselItemProps, type CarouselItemRenderProps, type CarouselLayout, type CarouselProps, Checkbox, CheckboxGroup, type CheckboxGroupProps, type CheckboxProps, Chip, type ChipActionProps, type ChipDropdownProps, type ChipFilterProps, ChipGroup, ChipGroupChip, type ChipGroupChipProps, type ChipGroupProps, type ChipProps, type ChipVariant, Code, type CodeProps, Collection, ColorArea, type ColorAreaProps, ColorField, type ColorFieldProps, ColorPicker, type ColorPickerProps, ColorSlider, type ColorSliderProps, ColorSwatch, ColorSwatchPicker, ColorSwatchPickerItem, type ColorSwatchPickerItemProps, type ColorSwatchPickerProps, type ColorSwatchProps, ColorWheel, type ColorWheelProps, ComboBox, type ComboBoxProps, type ComboBoxSelectionMode, Container, type ContainerProps, CopyField, type CopyFieldProps, Currency, type CurrencyDisplay, type CurrencyNotation, type CurrencyProps, type CurrencySignDisplay, type CurrencyTone, DIRECTORY_DRAG_TYPE, DateField, type DateFieldProps, DatePicker, type DatePickerProps, DateRangePicker, type DateRangePickerProps, Dialog, DialogBody, DialogContent, type DialogContentProps, DialogFooter, DialogHeader, type DialogProps, DialogTitle, type DialogTitleProps, Disclosure, DisclosureGroup, type DisclosureGroupProps, DisclosureHeader, type DisclosureHeaderProps, DisclosurePanel, type DisclosurePanelProps, type DisclosureProps, DropZone, type DropZoneProps, Fab, FabMenu, FabMenuItem, type FabMenuItemProps, type FabMenuProps, type FabProps, type FabSize, type FabTone, type FabVariant, Feed, type FeedProps, type FieldVariant, FileTrigger, type FileTriggerProps, Focusable, type FocusableElement, Form, type FormProps, GridLayout, type HoverEvent, I18nProvider, IconButton, type IconButtonProps, type IconButtonSize, type IconButtonVariant, type Key, type KeyboardEvent, Keycap, type KeycapProps, type KuiTheme, Link, type LinkProps, type LinkTone, type LinkUnderline, List, ListBox, ListBoxItem, type ListBoxItemProps, ListBoxLoadMore, type ListBoxLoadMoreProps, type ListBoxProps, ListBoxSection, type ListBoxSectionProps, ListDetail, type ListDetailProps, ListItem, type ListItemProps, ListLayout, ListLoadMore, type ListLoadMoreProps, type ListProps, ListRow, type ListRowProps, ListSection, type ListSectionProps, LoadingIndicator, type LoadingIndicatorProps, Menu, type MenuAlign, MenuContent, type MenuContentProps, MenuItem, type MenuItemProps, MenuLoadMore, type MenuLoadMoreProps, type MenuProps, MenuSection, type MenuSectionProps, MenuSeparator, type MenuSeparatorProps, type MenuSide, MenuSubmenu, type MenuSubmenuProps, Meter, type MeterProps, type MeterTone, NavigationBar, NavigationBarItem, type NavigationItemProps as NavigationBarItemProps, type NavigationBarProps, NavigationRail, NavigationRailFab, type NavigationRailFabProps, NavigationRailItem, type NavigationItemProps as NavigationRailItemProps, type NavigationRailProps, NavigationTree, NavigationTreeItem, type NavigationTreeItemProps, type NavigationTreeProps, NavigationTreeSection, type NavigationTreeSectionProps, NumberField, type NumberFieldProps, Popover, type PopoverAlign, PopoverContent, type PopoverContentProps, PopoverDescription, type PopoverDescriptionProps, type PopoverProps, type PopoverSide, type PopoverSize, PopoverTitle, type PopoverTitleProps, type PopoverTrigger, type PressEvent, Pressable, ProductIcon, type ProductIconProps, ProgressIndicator, type ProgressIndicatorProps, type ProgressIndicatorShape, type ProgressIndicatorTone, type ProgressIndicatorVariant, Radio, RadioGroup, type RadioGroupProps, type RadioProps, RangeCalendar, type RangeCalendarProps, RouterProvider, SearchField, type SearchFieldProps, SearchView, SearchViewContent, type SearchViewContentProps, type SearchViewProps, SegmentedButton, type SegmentedButtonProps, SegmentedButtonSegment, type SegmentedButtonSegmentProps, Select, type SelectProps, type Selection, Separator, type SeparatorInset, type SeparatorProps, SharedElement, SharedElementTransition, Sheet, SheetBody, SheetContent, type SheetContentProps, SheetFooter, SheetHandle, SheetHeader, type SheetProps, SheetTitle, type SheetTitleProps, Slider, type SliderProps, type SliderSize, Snackbar, type SnackbarAction, type SnackbarMessage, type SnackbarOptions, type SnackbarProps, type SnackbarQueue, type ToastRegionRenderProps as SnackbarRegionRenderProps, type SortDescriptor, SplitButton, SplitButtonAction, type SplitButtonActionProps, SplitButtonMenu, type SplitButtonMenuProps, type SplitButtonProps, type SplitButtonVariant, Stack, type StackAlign, type StackGap, type StackJustify, type StackProps, SupportingPane, type SupportingPaneProps, Switch, type SwitchProps, Table, type TableAlign, TableBody, type TableBodyProps, TableCell, type TableCellProps, TableColumn, type TableColumnProps, TableFooter, type TableFooterProps, TableHeader, type TableHeaderProps, TableLayout, TableLoadMore, type TableLoadMoreProps, type TableProps, TableRow, type TableRowProps, Tabs, type TabsLayout, TabsList, type TabsListProps, TabsPanel, type TabsPanelProps, TabsPanels, type TabsPanelsProps, type TabsProps, TabsTab, type TabsTabProps, type TabsVariant, Tag, type TagProps, type TagTone, type TagVariant, Text, TextArea, type TextAreaProps, TextField, type TextFieldProps, type TextProps, ThemeScope, type ThemeScopeProps, TimeField, type TimeFieldProps, TimePicker, type TimePickerMode, type TimePickerProps, TokenField, type TokenFieldProps, TokenFieldValue, type TokenSegment, Toolbar, type ToolbarProps, type ToolbarTone, Tooltip, type TooltipAlign, type TooltipProps, type TooltipSide, Tree, TreeItem, type TreeItemProps, TreeLoadMore, type TreeLoadMoreProps, type TreeProps, TreeSection, type TreeSectionProps, Virtualizer, VisuallyHidden, WaterfallLayout, collectionSizes, colorScheme, getColorChannels, isDirectoryDropItem, isFileDropItem, isTextDropItem, parseColor, themeScope, useAppBarScroll, useAsyncList, useDrag, useDragAndDrop, useDrop, useFilter, useListData, useLocale, useTreeData };
package/dist/index.js CHANGED
@@ -53,7 +53,7 @@ import LoadingIndicator from "./components/loading-indicator/index.js";
53
53
  import Menu, { MenuContent, MenuItem, MenuLoadMore, MenuSection, MenuSeparator, MenuSubmenu } from "./components/menu/index.js";
54
54
  import Meter from "./components/meter/index.js";
55
55
  import NavigationBar, { NavigationBarItem } from "./components/navigation-bar/index.js";
56
- import NavigationRail, { NavigationRailItem } from "./components/navigation-rail/index.js";
56
+ import NavigationRail, { NavigationRailFab, NavigationRailItem } from "./components/navigation-rail/index.js";
57
57
  import NavigationTree, { NavigationTreeItem, NavigationTreeSection } from "./components/navigation-tree/index.js";
58
58
  import NumberField from "./components/number-field/index.js";
59
59
  import Popover, { PopoverContent, PopoverDescription, PopoverTitle } from "./components/popover/index.js";
@@ -85,4 +85,4 @@ import { collectionSizes } from "./layout.js";
85
85
  import { useDragAndDrop } from "./drag/hooks.js";
86
86
  import { Collection, DIRECTORY_DRAG_TYPE, Focusable, GridLayout, I18nProvider, ListLayout, Pressable, RouterProvider, SharedElement, SharedElementTransition, TableLayout, TokenFieldValue, Virtualizer, VisuallyHidden, WaterfallLayout, getColorChannels, isDirectoryDropItem, isFileDropItem, isTextDropItem, parseColor, useAsyncList, useDrag, useDrop, useFilter, useListData, useLocale, useTreeData } from "./react-aria.js";
87
87
  import { ThemeScope } from "./theme-scope.js";
88
- export { AppBar, Autocomplete, Avatar, Badge, Breadcrumbs, BreadcrumbsItem, Button, ButtonGroup, Calendar, Card, Carousel, CarouselItem, Checkbox, CheckboxGroup, Chip, ChipGroup, ChipGroupChip, Code, Collection, ColorArea, ColorField, ColorPicker, ColorSlider, ColorSwatch, ColorSwatchPicker, ColorSwatchPickerItem, ColorWheel, ComboBox, Container, CopyField, Currency, DIRECTORY_DRAG_TYPE, DateField, DatePicker, DateRangePicker, Dialog, DialogBody, DialogContent, DialogFooter, DialogHeader, DialogTitle, Disclosure, DisclosureGroup, DisclosureHeader, DisclosurePanel, DropZone, Fab, FabMenu, FabMenuItem, Feed, FileTrigger, Focusable, Form, GridLayout, I18nProvider, IconButton, Keycap, Link, List, ListBox, ListBoxItem, ListBoxLoadMore, ListBoxSection, ListDetail, ListItem, ListLayout, ListLoadMore, ListRow, ListSection, LoadingIndicator, Menu, MenuContent, MenuItem, MenuLoadMore, MenuSection, MenuSeparator, MenuSubmenu, Meter, NavigationBar, NavigationBarItem, NavigationRail, NavigationRailItem, NavigationTree, NavigationTreeItem, NavigationTreeSection, NumberField, Popover, PopoverContent, PopoverDescription, PopoverTitle, Pressable, ProductIcon, ProgressIndicator, Radio, RadioGroup, RangeCalendar, RouterProvider, SearchField, SearchView, SearchViewContent, SegmentedButton, SegmentedButtonSegment, Select, Separator, SharedElement, SharedElementTransition, Sheet, SheetBody, SheetContent, SheetFooter, SheetHandle, SheetHeader, SheetTitle, Slider, Snackbar, SplitButton, SplitButtonAction, SplitButtonMenu, Stack, SupportingPane, Switch, Table, TableBody, TableCell, TableColumn, TableFooter, TableHeader, TableLayout, TableLoadMore, TableRow, Tabs, TabsList, TabsPanel, TabsPanels, TabsTab, Tag, Text, TextArea, TextField, ThemeScope, TimeField, TimePicker, TokenField, TokenFieldValue, Toolbar, Tooltip, Tree, TreeItem, TreeLoadMore, TreeSection, Virtualizer, VisuallyHidden, WaterfallLayout, collectionSizes, colorScheme, getColorChannels, isDirectoryDropItem, isFileDropItem, isTextDropItem, parseColor, themeScope, useAppBarScroll, useAsyncList, useDrag, useDragAndDrop, useDrop, useFilter, useListData, useLocale, useTreeData };
88
+ export { AppBar, Autocomplete, Avatar, Badge, Breadcrumbs, BreadcrumbsItem, Button, ButtonGroup, Calendar, Card, Carousel, CarouselItem, Checkbox, CheckboxGroup, Chip, ChipGroup, ChipGroupChip, Code, Collection, ColorArea, ColorField, ColorPicker, ColorSlider, ColorSwatch, ColorSwatchPicker, ColorSwatchPickerItem, ColorWheel, ComboBox, Container, CopyField, Currency, DIRECTORY_DRAG_TYPE, DateField, DatePicker, DateRangePicker, Dialog, DialogBody, DialogContent, DialogFooter, DialogHeader, DialogTitle, Disclosure, DisclosureGroup, DisclosureHeader, DisclosurePanel, DropZone, Fab, FabMenu, FabMenuItem, Feed, FileTrigger, Focusable, Form, GridLayout, I18nProvider, IconButton, Keycap, Link, List, ListBox, ListBoxItem, ListBoxLoadMore, ListBoxSection, ListDetail, ListItem, ListLayout, ListLoadMore, ListRow, ListSection, LoadingIndicator, Menu, MenuContent, MenuItem, MenuLoadMore, MenuSection, MenuSeparator, MenuSubmenu, Meter, NavigationBar, NavigationBarItem, NavigationRail, NavigationRailFab, NavigationRailItem, NavigationTree, NavigationTreeItem, NavigationTreeSection, NumberField, Popover, PopoverContent, PopoverDescription, PopoverTitle, Pressable, ProductIcon, ProgressIndicator, Radio, RadioGroup, RangeCalendar, RouterProvider, SearchField, SearchView, SearchViewContent, SegmentedButton, SegmentedButtonSegment, Select, Separator, SharedElement, SharedElementTransition, Sheet, SheetBody, SheetContent, SheetFooter, SheetHandle, SheetHeader, SheetTitle, Slider, Snackbar, SplitButton, SplitButtonAction, SplitButtonMenu, Stack, SupportingPane, Switch, Table, TableBody, TableCell, TableColumn, TableFooter, TableHeader, TableLayout, TableLoadMore, TableRow, Tabs, TabsList, TabsPanel, TabsPanels, TabsTab, Tag, Text, TextArea, TextField, ThemeScope, TimeField, TimePicker, TokenField, TokenFieldValue, Toolbar, Tooltip, Tree, TreeItem, TreeLoadMore, TreeSection, Virtualizer, VisuallyHidden, WaterfallLayout, collectionSizes, colorScheme, getColorChannels, isDirectoryDropItem, isFileDropItem, isTextDropItem, parseColor, themeScope, useAppBarScroll, useAsyncList, useDrag, useDragAndDrop, useDrop, useFilter, useListData, useLocale, useTreeData };
@@ -14,6 +14,8 @@ type KuiTheme = {
14
14
  readonly '--kui-color-error'?: string;
15
15
  /** Defaults to `#f9dedc` in the light scheme and `#8c1d18` in the dark. */
16
16
  readonly '--kui-color-error-container'?: string;
17
+ /** Defaults to `#f2b8b5` in the light scheme and `#b3261e` in the dark. */
18
+ readonly '--kui-color-inverse-error'?: string;
17
19
  /** Defaults to `#f5eff7` in the light scheme and `#322f35` in the dark. */
18
20
  readonly '--kui-color-inverse-on-surface'?: string;
19
21
  /** Defaults to `#d0bcff` in the light scheme and `#6750a4` in the dark. */
@@ -32,12 +32,12 @@ const KINDS = {
32
32
  * pill.
33
33
  */
34
34
  function Mark(t0) {
35
- const $ = c(41);
35
+ const $ = c(42);
36
36
  const { decorative: t1, imgProps, kind, name, render, showPersonIcon: t2, size, src, tone, ...props$1 } = t0;
37
37
  const decorative = t1 === void 0 ? false : t1;
38
38
  const showPersonIcon = t2 === void 0 ? true : t2;
39
39
  const { fit, initials, shape, tintsFallback } = KINDS[kind];
40
- const { onError, onLoad, previous, status } = useImageLoadingStatus(src);
40
+ const { onError, onLoad, previous, ref, status } = useImageLoadingStatus(src);
41
41
  const { locale } = useLocale();
42
42
  let t3;
43
43
  if ($[0] !== initials || $[1] !== locale || $[2] !== name) {
@@ -92,7 +92,7 @@ function Mark(t0) {
92
92
  $[15] = t5;
93
93
  } else t5 = $[15];
94
94
  let t6;
95
- if ($[16] !== fit || $[17] !== imgProps || $[18] !== onError || $[19] !== onLoad || $[20] !== src || $[21] !== status) {
95
+ if ($[16] !== fit || $[17] !== imgProps || $[18] !== onError || $[19] !== onLoad || $[20] !== ref || $[21] !== src || $[22] !== status) {
96
96
  t6 = src === void 0 || status === "error" ? null : /* @__PURE__ */ jsx("img", {
97
97
  alt: "",
98
98
  decoding: "async",
@@ -100,6 +100,7 @@ function Mark(t0) {
100
100
  ...imgProps,
101
101
  onError,
102
102
  onLoad,
103
+ ref,
103
104
  src,
104
105
  ...props(markStyles.image, fit, status !== "loaded" && markStyles.imagePending)
105
106
  }, src);
@@ -107,43 +108,44 @@ function Mark(t0) {
107
108
  $[17] = imgProps;
108
109
  $[18] = onError;
109
110
  $[19] = onLoad;
110
- $[20] = src;
111
- $[21] = status;
112
- $[22] = t6;
113
- } else t6 = $[22];
111
+ $[20] = ref;
112
+ $[21] = src;
113
+ $[22] = status;
114
+ $[23] = t6;
115
+ } else t6 = $[23];
114
116
  let t7;
115
- if ($[23] !== initialsNode || $[24] !== t5 || $[25] !== t6) {
117
+ if ($[24] !== initialsNode || $[25] !== t5 || $[26] !== t6) {
116
118
  t7 = /* @__PURE__ */ jsxs(Fragment, { children: [
117
119
  initialsNode,
118
120
  t5,
119
121
  t6
120
122
  ] });
121
- $[23] = initialsNode;
122
- $[24] = t5;
123
- $[25] = t6;
124
- $[26] = t7;
125
- } else t7 = $[26];
123
+ $[24] = initialsNode;
124
+ $[25] = t5;
125
+ $[26] = t6;
126
+ $[27] = t7;
127
+ } else t7 = $[27];
126
128
  const children = t7;
127
129
  const t8 = "span";
128
130
  let t9;
129
- if ($[27] !== name || $[28] !== named) {
131
+ if ($[28] !== name || $[29] !== named) {
130
132
  t9 = named ? {
131
133
  "aria-label": name,
132
134
  role: "img"
133
135
  } : {};
134
- $[27] = name;
135
- $[28] = named;
136
- $[29] = t9;
137
- } else t9 = $[29];
136
+ $[28] = name;
137
+ $[29] = named;
138
+ $[30] = t9;
139
+ } else t9 = $[30];
138
140
  let t10;
139
- if ($[30] !== decorative) {
141
+ if ($[31] !== decorative) {
140
142
  t10 = decorative ? { "aria-hidden": true } : {};
141
- $[30] = decorative;
142
- $[31] = t10;
143
- } else t10 = $[31];
143
+ $[31] = decorative;
144
+ $[32] = t10;
145
+ } else t10 = $[32];
144
146
  const t11 = mergeStyles(props(markStyles.base, shape, markStyles[size], !tintsFallback && markStyles[tone]), props$1);
145
147
  let t12;
146
- if ($[32] !== children || $[33] !== props$1 || $[34] !== t10 || $[35] !== t11 || $[36] !== t9) {
148
+ if ($[33] !== children || $[34] !== props$1 || $[35] !== t10 || $[36] !== t11 || $[37] !== t9) {
147
149
  t12 = {
148
150
  ...t9,
149
151
  ...t10,
@@ -151,24 +153,24 @@ function Mark(t0) {
151
153
  children,
152
154
  ...t11
153
155
  };
154
- $[32] = children;
155
- $[33] = props$1;
156
- $[34] = t10;
157
- $[35] = t11;
158
- $[36] = t9;
159
- $[37] = t12;
160
- } else t12 = $[37];
156
+ $[33] = children;
157
+ $[34] = props$1;
158
+ $[35] = t10;
159
+ $[36] = t11;
160
+ $[37] = t9;
161
+ $[38] = t12;
162
+ } else t12 = $[38];
161
163
  let t13;
162
- if ($[38] !== render || $[39] !== t12) {
164
+ if ($[39] !== render || $[40] !== t12) {
163
165
  t13 = {
164
166
  defaultTagName: t8,
165
167
  props: t12,
166
168
  render
167
169
  };
168
- $[38] = render;
169
- $[39] = t12;
170
- $[40] = t13;
171
- } else t13 = $[40];
170
+ $[39] = render;
171
+ $[40] = t12;
172
+ $[41] = t13;
173
+ } else t13 = $[41];
172
174
  return useRender(t13);
173
175
  }
174
176
  export { Mark as default };
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["stylex","useLocale","useImageLoadingStatus","useRender","mergeStyles","initialOfThing","initialsOfPerson","markStyles","KINDS","person","fit","cover","initials","shape","circle","tintsFallback","thing","contain","square","decorative","imgProps","kind","name","showPersonIcon","size","src","tone","Mark","t0","$","_c","t1","render","t2","props","undefined","onError","onLoad","previous","status","locale","t3","fallback","t4","trim","named","showsPicture","initialsNode","t5","personGlyph","image","t6","imagePending","t7","children","t8","t9","role","t10","t11","base","t12","t13","defaultTagName"],"sources":["../../src/mark/index.tsx"],"sourcesContent":["import type { ImgHTMLAttributes } from 'react';\nimport * as stylex from '@stylexjs/stylex';\nimport { useLocale } from 'react-aria-components';\nimport type { RenderComponentProps } from '../render/useRender';\nimport type { MarkSize, MarkTone } from './styles';\nimport { PersonGlyph } from '../glyphs';\nimport { useImageLoadingStatus } from '../hooks/useImageLoadingStatus';\nimport { useRender } from '../render/useRender';\nimport { mergeStyles } from '../styles/merge';\nimport { initialOfThing, initialsOfPerson } from './initials';\nimport { markStyles } from './styles';\n\n// What each kind of mark is drawn as. The header of `./styles` says why the\n// two differ where they do; everything not in this table is the same for\n// both.\nconst KINDS = {\n person: {\n fit: markStyles.cover,\n initials: initialsOfPerson,\n shape: markStyles.circle,\n tintsFallback: false\n },\n thing: {\n fit: markStyles.contain,\n initials: initialOfThing,\n shape: markStyles.square,\n tintsFallback: true\n }\n} as const;\ntype MarkProps = {\n /**\n * Hides the mark from assistive technology, for one beside the name it\n * stands for, which would otherwise be announced twice.\n */\n decorative?: boolean | undefined;\n /** Attributes for the picture's own `<img>`, as Avatar and ProductIcon take them. */\n imgProps?: Pick<ImgHTMLAttributes<HTMLImageElement>, 'crossOrigin' | 'decoding' | 'fetchPriority' | 'loading' | 'referrerPolicy' | 'sizes' | 'srcSet'> | undefined;\n /** A person, which Avatar draws, or anything else, which ProductIcon does. */\n kind: keyof typeof KINDS;\n /** Supplies the fallback's initials, and the accessible name unless decorative. */\n name: string;\n /**\n * Whether a person with no initials to take — a blank name — draws the\n * anonymous person glyph, or an empty disc, as a loading skeleton wants.\n */\n showPersonIcon?: boolean | undefined;\n size: MarkSize;\n /** An image to show in place of the initials once it has loaded. */\n src?: string;\n tone: MarkTone;\n} & Omit<RenderComponentProps<'span'>, 'children'>;\n\n/**\n * The small identity mark Avatar and ProductIcon both render: an image once\n * it has loaded, initials until then or if it fails, named for whoever or\n * whatever it stands for. Shared rather than written into each, so a fix to\n * one reaches both. Not a component of the library's own and not exported\n * from the package; see `src/chip` for the same arrangement around a chip's\n * pill.\n */\nfunction Mark({\n decorative = false,\n imgProps,\n kind,\n name,\n render,\n showPersonIcon = true,\n size,\n src,\n tone,\n ...props\n}: MarkProps) {\n const {\n fit,\n initials,\n shape,\n tintsFallback\n } = KINDS[kind];\n // The image is rendered from the start and shown once it has loaded, and\n // the initials stay until then and come back if it fails — see\n // useImageLoadingStatus.\n const {\n onError,\n onLoad,\n previous,\n status\n } = useImageLoadingStatus(src);\n const {\n locale\n } = useLocale();\n const fallback = initials(name, locale);\n\n // role/aria-label rather than letting the initials be read: \"AL\" is not\n // what anyone means to announce. Marking the root as an image also makes\n // its contents presentational, so the image and the initials can't be\n // announced a second time underneath the name. A span rather than an\n // <img>, which is void: this element's whole job is to hold the initials\n // shown when there is no image, or none has loaded yet.\n //\n // A blank name — one still loading, say — names nothing, so the mark is\n // then a plain element rather than an image with no name, which a screen\n // reader reads as a bare \"image\". Its empty initials, or its image with an\n // empty alt, leave it nothing to announce.\n //\n // A decorative mark is hidden outright. Beside the name it stands for — a\n // list row whose headline is the person — the name came out twice, once as\n // the image and once as the text, and with no role the initials would be\n // read as bare letters instead.\n const named = !decorative && name.trim() !== '';\n\n // The initials while no picture shows: before the first loads, and once\n // one fails. They are left out under a picture rather than kept beneath\n // it, since a letterboxed logo would show them through its transparent\n // parts.\n const showsPicture = status === 'loaded' || previous !== undefined;\n let initialsNode = null;\n if (!showsPicture && kind === 'person' && fallback === '') {\n // A person with no initials to take — a blank name, one still loading —\n // draws Material Design's anonymous person in the tone's on-container\n // colour, where it drew an empty disc. Decoration: a blank name is\n // unnamed, and the glyph announces nothing either.\n initialsNode = showPersonIcon ? <PersonGlyph {...stylex.props(markStyles.personGlyph)} /> : null;\n } else if (!showsPicture) {\n initialsNode = tintsFallback ? <span {...stylex.props(markStyles.fallback, markStyles[tone])}>\n {fallback}\n </span> : fallback;\n }\n\n // Two pictures at most, laid over the initials. The one last loaded stays\n // while a new `src` loads, and the new one is rendered on top of it from\n // the start, hidden until it has loaded: lazy, so an avatar far down an\n // unvirtualised list is not fetched on mount, and decoded off the main\n // thread, both of which the call site can change through `imgProps`. The\n // last loaded one is the resource the browser chose, out of a `srcSet`\n // too, and is cached, so it needs none of those.\n const children = <>\n {initialsNode}\n {previous === undefined ? null : <img alt=\"\" key={previous} src={previous} {...stylex.props(markStyles.image, fit)} />}\n {src === undefined || status === 'error' ? null : <img alt=\"\" decoding=\"async\" key={src} loading=\"lazy\" {...imgProps} onError={onError} onLoad={onLoad} src={src} {...stylex.props(markStyles.image, fit, status !== 'loaded' && markStyles.imagePending)} />}\n </>;\n return useRender({\n defaultTagName: 'span',\n props: {\n ...(named ? {\n 'aria-label': name,\n role: 'img'\n } : {}),\n ...(decorative ? {\n 'aria-hidden': true\n } : {}),\n ...props,\n children,\n ...mergeStyles(stylex.props(markStyles.base, shape, markStyles[size], !tintsFallback && markStyles[tone]), props)\n },\n render\n });\n}\nexport default Mark;"],"mappings":";;;;;;;;;;;AAeA,MAAMQ,QAAQ;CACZC,QAAQ;EACNC,KAAKH,WAAWI;EAChBC,UAAUN;EACVO,OAAON,WAAWO;EAClBC,eAAe;CACjB;CACAC,OAAO;EACLN,KAAKH,WAAWU;EAChBL,UAAUP;EACVQ,OAAON,WAAWW;EAClBH,eAAe;CACjB;AACF;;;;;;;;;AAgCA,SAAAY,KAAAC,IAAA;CAAA,MAAAC,IAAAC,EAAA,EAAA;CAAc,MAAA,EAAAX,YAAAY,IAAAX,UAAAC,MAAAC,MAAAU,QAAAT,gBAAAU,IAAAT,MAAAC,KAAAC,MAAA,GAAAQ,YAAAN;CACZ,MAAAT,aAAAY,OAAAI,KAAAA,IAAA,QAAAJ;CAKA,MAAAR,iBAAAU,OAAAE,KAAAA,IAAA,OAAAF;CAMA,MAAA,EAAAvB,KAAAE,UAAAC,OAAAE,kBAKIP,MAAMa;CAIV,MAAA,EAAAe,SAAAC,QAAAC,UAAAC,WAKIrC,sBAAsBuB,GAAG;CAC7B,MAAA,EAAAe,WAEIvC,UAAU;CAAE,IAAAwC;CA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AAA,QAAAP,QAAAO,EAAA,QAAAgB,OAAA;EAEhBW,KAAAX,QAAA;GAAA,cACYvB;GAAImC,MACZ;EACH,IAHD,CAGC;EAAC5B,EAAA,MAAAP;EAAAO,EAAA,MAAAgB;EAAAhB,EAAA,MAAA2B;CAAA,OAAAA,KAAA3B,EAAA;CAAA,IAAA6B;CAAA,IAAA7B,EAAA,QAAAV,YAAA;EACFuC,MAAAvC,aAAA,EAAA,eACa,KACZ,IAFD,CAEC;EAACU,EAAA,MAAAV;EAAAU,EAAA,MAAA6B;CAAA,OAAAA,MAAA7B,EAAA;CAGH,MAAA8B,MAAAvD,YAAYJ,MAAaO,WAAUqD,MAAO/C,OAAON,WAAWiB,OAAO,CAACT,iBAAiBR,WAAWmB,KAAK,GAAGQ,OAAK;CAAC,IAAA2B;CAAA,IAAAhC,EAAA,QAAAyB,YAAAzB,EAAA,QAAAK,WAAAL,EAAA,QAAA6B,OAAA7B,EAAA,QAAA8B,OAAA9B,EAAA,QAAA2B,IAAA;EAV5GK,MAAA;GAAA,GACDL;GAGE,GACFE;GAEE,GACHxB;GAAKoB;GAAA,GAELK;EACL;EAAC9B,EAAA,MAAAyB;EAAAzB,EAAA,MAAAK;EAAAL,EAAA,MAAA6B;EAAA7B,EAAA,MAAA8B;EAAA9B,EAAA,MAAA2B;EAAA3B,EAAA,MAAAgC;CAAA,OAAAA,MAAAhC,EAAA;CAAA,IAAAiC;CAAA,IAAAjC,EAAA,QAAAG,UAAAH,EAAA,QAAAgC,KAAA;EAbcC,MAAA;GAAAC,gBACCR;GAAMrB,OACf2B;GAWN7B;EAEH;EAACH,EAAA,MAAAG;EAAAH,EAAA,MAAAgC;EAAAhC,EAAA,MAAAiC;CAAA,OAAAA,MAAAjC,EAAA;CAAA,OAfM1B,UAAU2D,GAehB;AAAC"}
1
+ {"version":3,"file":"index.js","names":["stylex","useLocale","useImageLoadingStatus","useRender","mergeStyles","initialOfThing","initialsOfPerson","markStyles","KINDS","person","fit","cover","initials","shape","circle","tintsFallback","thing","contain","square","decorative","imgProps","kind","name","showPersonIcon","size","src","tone","Mark","t0","$","_c","t1","render","t2","props","undefined","onError","onLoad","previous","ref","status","locale","t3","fallback","t4","trim","named","showsPicture","initialsNode","t5","personGlyph","image","t6","imagePending","t7","children","t8","t9","role","t10","t11","base","t12","t13","defaultTagName"],"sources":["../../src/mark/index.tsx"],"sourcesContent":["import type { ImgHTMLAttributes } from 'react';\nimport * as stylex from '@stylexjs/stylex';\nimport { useLocale } from 'react-aria-components';\nimport type { RenderComponentProps } from '../render/useRender';\nimport type { MarkSize, MarkTone } from './styles';\nimport { PersonGlyph } from '../glyphs';\nimport { useImageLoadingStatus } from '../hooks/useImageLoadingStatus';\nimport { useRender } from '../render/useRender';\nimport { mergeStyles } from '../styles/merge';\nimport { initialOfThing, initialsOfPerson } from './initials';\nimport { markStyles } from './styles';\n\n// What each kind of mark is drawn as. The header of `./styles` says why the\n// two differ where they do; everything not in this table is the same for\n// both.\nconst KINDS = {\n person: {\n fit: markStyles.cover,\n initials: initialsOfPerson,\n shape: markStyles.circle,\n tintsFallback: false\n },\n thing: {\n fit: markStyles.contain,\n initials: initialOfThing,\n shape: markStyles.square,\n tintsFallback: true\n }\n} as const;\ntype MarkProps = {\n /**\n * Hides the mark from assistive technology, for one beside the name it\n * stands for, which would otherwise be announced twice.\n */\n decorative?: boolean | undefined;\n /** Attributes for the picture's own `<img>`, as Avatar and ProductIcon take them. */\n imgProps?: Pick<ImgHTMLAttributes<HTMLImageElement>, 'crossOrigin' | 'decoding' | 'fetchPriority' | 'loading' | 'referrerPolicy' | 'sizes' | 'srcSet'> | undefined;\n /** A person, which Avatar draws, or anything else, which ProductIcon does. */\n kind: keyof typeof KINDS;\n /** Supplies the fallback's initials, and the accessible name unless decorative. */\n name: string;\n /**\n * Whether a person with no initials to take — a blank name — draws the\n * anonymous person glyph, or an empty disc, as a loading skeleton wants.\n */\n showPersonIcon?: boolean | undefined;\n size: MarkSize;\n /** An image to show in place of the initials once it has loaded. */\n src?: string;\n tone: MarkTone;\n} & Omit<RenderComponentProps<'span'>, 'children'>;\n\n/**\n * The small identity mark Avatar and ProductIcon both render: an image once\n * it has loaded, initials until then or if it fails, named for whoever or\n * whatever it stands for. Shared rather than written into each, so a fix to\n * one reaches both. Not a component of the library's own and not exported\n * from the package; see `src/chip` for the same arrangement around a chip's\n * pill.\n */\nfunction Mark({\n decorative = false,\n imgProps,\n kind,\n name,\n render,\n showPersonIcon = true,\n size,\n src,\n tone,\n ...props\n}: MarkProps) {\n const {\n fit,\n initials,\n shape,\n tintsFallback\n } = KINDS[kind];\n // The image is rendered from the start and shown once it has loaded, and\n // the initials stay until then and come back if it fails — see\n // useImageLoadingStatus.\n const {\n onError,\n onLoad,\n previous,\n ref,\n status\n } = useImageLoadingStatus(src);\n const {\n locale\n } = useLocale();\n const fallback = initials(name, locale);\n\n // role/aria-label rather than letting the initials be read: \"AL\" is not\n // what anyone means to announce. Marking the root as an image also makes\n // its contents presentational, so the image and the initials can't be\n // announced a second time underneath the name. A span rather than an\n // <img>, which is void: this element's whole job is to hold the initials\n // shown when there is no image, or none has loaded yet.\n //\n // A blank name — one still loading, say — names nothing, so the mark is\n // then a plain element rather than an image with no name, which a screen\n // reader reads as a bare \"image\". Its empty initials, or its image with an\n // empty alt, leave it nothing to announce.\n //\n // A decorative mark is hidden outright. Beside the name it stands for — a\n // list row whose headline is the person — the name came out twice, once as\n // the image and once as the text, and with no role the initials would be\n // read as bare letters instead.\n const named = !decorative && name.trim() !== '';\n\n // The initials while no picture shows: before the first loads, and once\n // one fails. They are left out under a picture rather than kept beneath\n // it, since a letterboxed logo would show them through its transparent\n // parts.\n const showsPicture = status === 'loaded' || previous !== undefined;\n let initialsNode = null;\n if (!showsPicture && kind === 'person' && fallback === '') {\n // A person with no initials to take — a blank name, one still loading —\n // draws Material Design's anonymous person in the tone's on-container\n // colour, where it drew an empty disc. Decoration: a blank name is\n // unnamed, and the glyph announces nothing either.\n initialsNode = showPersonIcon ? <PersonGlyph {...stylex.props(markStyles.personGlyph)} /> : null;\n } else if (!showsPicture) {\n initialsNode = tintsFallback ? <span {...stylex.props(markStyles.fallback, markStyles[tone])}>\n {fallback}\n </span> : fallback;\n }\n\n // Two pictures at most, laid over the initials. The one last loaded stays\n // while a new `src` loads, and the new one is rendered on top of it from\n // the start, hidden until it has loaded: lazy, so an avatar far down an\n // unvirtualised list is not fetched on mount, and decoded off the main\n // thread, both of which the call site can change through `imgProps`. The\n // last loaded one is the resource the browser chose, out of a `srcSet`\n // too, and is cached, so it needs none of those.\n const children = <>\n {initialsNode}\n {previous === undefined ? null : <img alt=\"\" key={previous} src={previous} {...stylex.props(markStyles.image, fit)} />}\n {src === undefined || status === 'error' ? null : <img alt=\"\" decoding=\"async\" key={src} loading=\"lazy\" {...imgProps} onError={onError} onLoad={onLoad} ref={ref} src={src} {...stylex.props(markStyles.image, fit, status !== 'loaded' && markStyles.imagePending)} />}\n </>;\n return useRender({\n defaultTagName: 'span',\n props: {\n ...(named ? {\n 'aria-label': name,\n role: 'img'\n } : {}),\n ...(decorative ? {\n 'aria-hidden': true\n } : {}),\n ...props,\n children,\n ...mergeStyles(stylex.props(markStyles.base, shape, markStyles[size], !tintsFallback && markStyles[tone]), props)\n },\n render\n });\n}\nexport default Mark;"],"mappings":";;;;;;;;;;;AAeA,MAAMQ,QAAQ;CACZC,QAAQ;EACNC,KAAKH,WAAWI;EAChBC,UAAUN;EACVO,OAAON,WAAWO;EAClBC,eAAe;CACjB;CACAC,OAAO;EACLN,KAAKH,WAAWU;EAChBL,UAAUP;EACVQ,OAAON,WAAWW;EAClBH,eAAe;CACjB;AACF;;;;;;;;;AAgCA,SAAAY,KAAAC,IAAA;CAAA,MAAAC,IAAAC,EAAA,EAAA;CAAc,MAAA,EAAAX,YAAAY,IAAAX,UAAAC,MAAAC,MAAAU,QAAAT,gBAAAU,IAAAT,MAAAC,KAAAC,MAAA,GAAAQ,YAAAN;CACZ,MAAAT,aAAAY,OAAAI,KAAAA,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AA;GAAAC,gBACCR;GAAMtB,OACf4B;GAWN9B;EAEH;EAACH,EAAA,MAAAG;EAAAH,EAAA,MAAAiC;EAAAjC,EAAA,MAAAkC;CAAA,OAAAA,MAAAlC,EAAA;CAAA,OAfM1B,UAAU4D,GAehB;AAAC"}
package/dist/styles.css CHANGED
@@ -3,6 +3,7 @@
3
3
  --x11lqfhi: #fef7ff;
4
4
  --xrqi77u: #b3261e;
5
5
  --x82z8jw: #f9dedc;
6
+ --x14zg7k0: #f2b8b5;
6
7
  --xey760i: #f5eff7;
7
8
  --x1trscgf: #d0bcff;
8
9
  --x1i3zbmj: #322f35;
@@ -209,6 +210,7 @@
209
210
  --xm52p6p: var(--kui-color-background, var(--x11lqfhi));
210
211
  --x12p1wyw: var(--kui-color-error, var(--xrqi77u));
211
212
  --x7wk2f4: var(--kui-color-error-container, var(--x82z8jw));
213
+ --xq7t4w: var(--kui-color-inverse-error, var(--x14zg7k0));
212
214
  --x1balm44: var(--kui-color-inverse-on-surface, var(--xey760i));
213
215
  --x1v1ejj2: var(--kui-color-inverse-primary, var(--x1trscgf));
214
216
  --x1614qkl: var(--kui-color-inverse-surface, var(--x1i3zbmj));
@@ -278,6 +280,7 @@
278
280
  --x11lqfhi: #141218;
279
281
  --xrqi77u: #f2b8b5;
280
282
  --x82z8jw: #8c1d18;
283
+ --x14zg7k0: #b3261e;
281
284
  --xey760i: #322f35;
282
285
  --x1trscgf: #6750a4;
283
286
  --x1i3zbmj: #e6e0e9;
@@ -335,10 +338,11 @@
335
338
  }
336
339
  }
337
340
 
338
- .xf26cth.xf26cth, .xf26cth.xf26cth:root {
341
+ .xf2gwb6.xf2gwb6, .xf2gwb6.xf2gwb6:root {
339
342
  --x11lqfhi: #141218;
340
343
  --xrqi77u: #f2b8b5;
341
344
  --x82z8jw: #8c1d18;
345
+ --x14zg7k0: #b3261e;
342
346
  --xey760i: #322f35;
343
347
  --x1trscgf: #6750a4;
344
348
  --x1i3zbmj: #e6e0e9;
@@ -395,10 +399,11 @@
395
399
  --x1mnnhxz: #efb8c8;
396
400
  }
397
401
 
398
- .x1vipc3i.x1vipc3i, .x1vipc3i.x1vipc3i:root {
402
+ .xjbqju4.xjbqju4, .xjbqju4.xjbqju4:root {
399
403
  --x11lqfhi: #fef7ff;
400
404
  --xrqi77u: #b3261e;
401
405
  --x82z8jw: #f9dedc;
406
+ --x14zg7k0: #f2b8b5;
402
407
  --xey760i: #f5eff7;
403
408
  --x1trscgf: #d0bcff;
404
409
  --x1i3zbmj: #322f35;
@@ -4937,6 +4942,10 @@
4937
4942
  left: calc(95.167cqi - 4px);
4938
4943
  }
4939
4944
 
4945
+ .xat24cr {
4946
+ margin-bottom: 0;
4947
+ }
4948
+
4940
4949
  .xieb3on {
4941
4950
  margin-bottom: 20px;
4942
4951
  }
@@ -4961,6 +4970,10 @@
4961
4970
  margin-bottom: var(--x3km7fe);
4962
4971
  }
4963
4972
 
4973
+ .x135sh1i {
4974
+ margin-bottom: var(--xbmbo34);
4975
+ }
4976
+
4964
4977
  .x1mgj515 {
4965
4978
  margin-bottom: var(--xqgx294);
4966
4979
  }
@@ -1,4 +1,4 @@
1
- import { t as KuiTheme } from "./kanso-ui-core/defaults-D9KBLBW_.js";
1
+ import { t as KuiTheme } from "./kanso-ui-core/defaults-DYY7ddNI.js";
2
2
  import { RenderComponentProps } from "./render/useRender.js";
3
3
  type ThemeScopeProps = RenderComponentProps<'div'> & {
4
4
  /**
@@ -3,6 +3,7 @@ const colors = {
3
3
  background: "var(--xm52p6p)",
4
4
  error: "var(--x12p1wyw)",
5
5
  errorContainer: "var(--x7wk2f4)",
6
+ inverseError: "var(--xq7t4w)",
6
7
  inverseOnSurface: "var(--x1balm44)",
7
8
  inversePrimary: "var(--x1v1ejj2)",
8
9
  inverseSurface: "var(--x1614qkl)",
@@ -60,11 +61,11 @@ const colors = {
60
61
  __varGroupHash__: "x1qza42b"
61
62
  };
62
63
  const colorDefaultsLightTheme = {
63
- x9cbvzh: "x1vipc3i x9cbvzh",
64
+ x9cbvzh: "xjbqju4 x9cbvzh",
64
65
  $$css: true
65
66
  };
66
67
  const colorDefaultsDarkTheme = {
67
- x9cbvzh: "xf26cth x9cbvzh",
68
+ x9cbvzh: "xf2gwb6 x9cbvzh",
68
69
  $$css: true
69
70
  };
70
71
  const typography = {
@@ -1 +1 @@
1
- {"version":3,"file":"design.tokens.stylex.js","names":["background","error","errorContainer","inverseOnSurface","inversePrimary","inverseSurface","negative","negativeContainer","onBackground","onError","onErrorContainer","onNegative","onNegativeContainer","onPositive","onPositiveContainer","onPrimary","onPrimaryContainer","onPrimaryFixed","onPrimaryFixedVariant","onSecondary","onSecondaryContainer","onSecondaryFixed","onSecondaryFixedVariant","onSurface","onSurfaceVariant","onTertiary","onTertiaryContainer","onTertiaryFixed","onTertiaryFixedVariant","outline","outlineVariant","positive","positiveContainer","primary","primaryContainer","primaryFixed","primaryFixedDim","scrim","secondary","secondaryContainer","secondaryFixed","secondaryFixedDim","shadow","surface","surfaceBright","surfaceContainer","surfaceContainerHigh","surfaceContainerHighest","surfaceContainerLow","surfaceContainerLowest","surfaceDim","surfaceTint","surfaceVariant","tertiary","tertiaryContainer","tertiaryFixed","tertiaryFixedDim","__varGroupHash__","colors","colorDefaultsLightTheme","x9cbvzh","$$css","colorDefaultsDarkTheme","typography","bodyLargeFont","bodyLargeLineHeight","bodyLargeSize","bodyLargeTracking","bodyLargeWeight","bodyMediumFont","bodyMediumLineHeight","bodyMediumSize","bodyMediumTracking","bodyMediumWeight","bodySmallFont","bodySmallLineHeight","bodySmallSize","bodySmallTracking","bodySmallWeight","displayLargeFont","displayLargeLineHeight","displayLargeSize","displayLargeTracking","displayLargeWeight","displayMediumFont","displayMediumLineHeight","displayMediumSize","displayMediumTracking","displayMediumWeight","displaySmallFont","displaySmallLineHeight","displaySmallSize","displaySmallTracking","displaySmallWeight","fontFamilyBrand","fontFamilyMono","fontFamilyPlain","headlineLargeFont","headlineLargeLineHeight","headlineLargeSize","headlineLargeTracking","headlineLargeWeight","headlineMediumFont","headlineMediumLineHeight","headlineMediumSize","headlineMediumTracking","headlineMediumWeight","headlineSmallFont","headlineSmallLineHeight","headlineSmallSize","headlineSmallTracking","headlineSmallWeight","labelLargeFont","labelLargeLineHeight","labelLargeSize","labelLargeTracking","labelLargeWeight","labelMediumFont","labelMediumLineHeight","labelMediumSize","labelMediumTracking","labelMediumWeight","labelSmallFont","labelSmallLineHeight","labelSmallSize","labelSmallTracking","labelSmallWeight","titleLargeFont","titleLargeLineHeight","titleLargeSize","titleLargeTracking","titleLargeWeight","titleMediumFont","titleMediumLineHeight","titleMediumSize","titleMediumTracking","titleMediumWeight","titleSmallFont","titleSmallLineHeight","titleSmallSize","titleSmallTracking","titleSmallWeight","weightBold","weightMedium","weightRegular","spacing","lg","md","sm","xl","xs","xxl","xxs","xxxl","radii","circle","none","pill","sizing","controlLg","controlMd","controlSm","controlXl","controlXs","controlXxl","rowLg","rowMd","rowSm","rowXs","stateLayerOpacity","disabledContainer","disabledContent","dragged","focus","hover","pressed","colorsScope","x1qza42b","motionScope","x1dv3b2k","radiiScope","xhnz8s7","shadowsScope","x1j0lhbx","sizingScope","xzhmma2","spacingScope","x1egpaah","stateLayerOpacityScope","x1dldgtb","typographyScope","x1q1jnkv","tokenScope"],"sources":["../../src/tokens/design.tokens.stylex.ts"],"sourcesContent":["// AUTO-GENERATED by scripts/build-tokens.mjs from @kanso-labs/kanso-ui-core's\n// tokens.json, and not committed. Do not hand-edit — a token changes in\n// kanso-ui-core, and `npm run tokens:build` regenerates this.\n// The .stylex.ts suffix is required by @stylexjs/babel-plugin for cross-file\n// variable resolution — see the comment at the top of build-tokens.mjs.\n\nimport * as stylex from '@stylexjs/stylex';\nconst DARK = '@media (prefers-color-scheme: dark)';\nconst colorDefaults = {\n background: \"var(--x11lqfhi)\",\n error: \"var(--xrqi77u)\",\n errorContainer: \"var(--x82z8jw)\",\n inverseOnSurface: \"var(--xey760i)\",\n inversePrimary: \"var(--x1trscgf)\",\n inverseSurface: \"var(--x1i3zbmj)\",\n negative: \"var(--x1srpzsd)\",\n negativeContainer: \"var(--x15kkkkd)\",\n onBackground: \"var(--x3jqtd5)\",\n onError: \"var(--x1p11w7)\",\n onErrorContainer: \"var(--x1g3s5u0)\",\n onNegative: \"var(--xvkb642)\",\n onNegativeContainer: \"var(--x1bbk4uq)\",\n onPositive: \"var(--xirk23p)\",\n onPositiveContainer: \"var(--xtdi97o)\",\n onPrimary: \"var(--x1pbr5ko)\",\n onPrimaryContainer: \"var(--x16857a7)\",\n onPrimaryFixed: \"var(--xbdn1ia)\",\n onPrimaryFixedVariant: \"var(--x17lawo6)\",\n onSecondary: \"var(--x1cp179l)\",\n onSecondaryContainer: \"var(--x1jlz0n7)\",\n onSecondaryFixed: \"var(--x1hhc6tz)\",\n onSecondaryFixedVariant: \"var(--xq0cxz6)\",\n onSurface: \"var(--xdn6aro)\",\n onSurfaceVariant: \"var(--x4604rt)\",\n onTertiary: \"var(--x132ctuv)\",\n onTertiaryContainer: \"var(--xgnutht)\",\n onTertiaryFixed: \"var(--x1ysnvcz)\",\n onTertiaryFixedVariant: \"var(--xs3mjkr)\",\n outline: \"var(--x1fpgh70)\",\n outlineVariant: \"var(--xzldpa8)\",\n positive: \"var(--x13hikrd)\",\n positiveContainer: \"var(--xlj0u70)\",\n primary: \"var(--x14za91n)\",\n primaryContainer: \"var(--x1ec4otz)\",\n primaryFixed: \"var(--x1j381ev)\",\n primaryFixedDim: \"var(--x8doykj)\",\n scrim: \"var(--xyme5sg)\",\n secondary: \"var(--x1ol0e1a)\",\n secondaryContainer: \"var(--xemq5b8)\",\n secondaryFixed: \"var(--xhpqfgm)\",\n secondaryFixedDim: \"var(--x41clx7)\",\n shadow: \"var(--x1wc4n63)\",\n surface: \"var(--xpk6svv)\",\n surfaceBright: \"var(--xqwhmb8)\",\n surfaceContainer: \"var(--x1sde9bn)\",\n surfaceContainerHigh: \"var(--xcu50ml)\",\n surfaceContainerHighest: \"var(--x1rcd2bb)\",\n surfaceContainerLow: \"var(--xnes5mg)\",\n surfaceContainerLowest: \"var(--x2633xs)\",\n surfaceDim: \"var(--x1qike4i)\",\n surfaceTint: \"var(--x117542l)\",\n surfaceVariant: \"var(--x13gaudu)\",\n tertiary: \"var(--xp06fov)\",\n tertiaryContainer: \"var(--xjl3qbu)\",\n tertiaryFixed: \"var(--xepjwm)\",\n tertiaryFixedDim: \"var(--x1mnnhxz)\",\n __varGroupHash__: \"x9cbvzh\"\n};\nexport { colorDefaults };\nconst colors = {\n background: \"var(--xm52p6p)\",\n error: \"var(--x12p1wyw)\",\n errorContainer: \"var(--x7wk2f4)\",\n inverseOnSurface: \"var(--x1balm44)\",\n inversePrimary: \"var(--x1v1ejj2)\",\n inverseSurface: \"var(--x1614qkl)\",\n negative: \"var(--x1m9zerx)\",\n negativeContainer: \"var(--x1sa9icp)\",\n onBackground: \"var(--xwr0q4)\",\n onError: \"var(--xwloagh)\",\n onErrorContainer: \"var(--xqsbqtq)\",\n onNegative: \"var(--x1ey4ils)\",\n onNegativeContainer: \"var(--x1snvm1r)\",\n onPositive: \"var(--xyvlj6c)\",\n onPositiveContainer: \"var(--xn09qcj)\",\n onPrimary: \"var(--x1f7qwsz)\",\n onPrimaryContainer: \"var(--x1p425jc)\",\n onPrimaryFixed: \"var(--x7fing4)\",\n onPrimaryFixedVariant: \"var(--x9qmz6i)\",\n onSecondary: \"var(--xkltk4j)\",\n onSecondaryContainer: \"var(--x1bo8p7i)\",\n onSecondaryFixed: \"var(--xs1em01)\",\n onSecondaryFixedVariant: \"var(--xpj09jl)\",\n onSurface: \"var(--xn0syi6)\",\n onSurfaceVariant: \"var(--x28n2pw)\",\n onTertiary: \"var(--x7tegcs)\",\n onTertiaryContainer: \"var(--x1pzkjol)\",\n onTertiaryFixed: \"var(--xl08771)\",\n onTertiaryFixedVariant: \"var(--x1b7jmlf)\",\n outline: \"var(--x1ridy1o)\",\n outlineVariant: \"var(--x7dbk6n)\",\n positive: \"var(--xiob6mg)\",\n positiveContainer: \"var(--x1xvl3py)\",\n primary: \"var(--x1cjupv7)\",\n primaryContainer: \"var(--x17f4f9w)\",\n primaryFixed: \"var(--x1irt4fq)\",\n primaryFixedDim: \"var(--x1ver3t)\",\n scrim: \"var(--x1khq28e)\",\n secondary: \"var(--x189y34t)\",\n secondaryContainer: \"var(--xliov21)\",\n secondaryFixed: \"var(--xmiml2p)\",\n secondaryFixedDim: \"var(--x1lc0aek)\",\n shadow: \"var(--xj3yx3l)\",\n surface: \"var(--x1dzgr7y)\",\n surfaceBright: \"var(--x1ghurj8)\",\n surfaceContainer: \"var(--x3cqee7)\",\n surfaceContainerHigh: \"var(--x1xbp8h6)\",\n surfaceContainerHighest: \"var(--x13o0mym)\",\n surfaceContainerLow: \"var(--xi1exwt)\",\n surfaceContainerLowest: \"var(--x1b34qje)\",\n surfaceDim: \"var(--xo1km0t)\",\n surfaceTint: \"var(--x1jo8snc)\",\n surfaceVariant: \"var(--x17proku)\",\n tertiary: \"var(--x1bb0p1w)\",\n tertiaryContainer: \"var(--x1p33ujy)\",\n tertiaryFixed: \"var(--x9erpvp)\",\n tertiaryFixedDim: \"var(--x1or1uxx)\",\n __varGroupHash__: \"x1qza42b\"\n};\nexport { colors };\nconst colorDefaultsLightTheme = {\n x9cbvzh: \"x1vipc3i x9cbvzh\",\n $$css: true\n};\nexport { colorDefaultsLightTheme };\nconst colorDefaultsDarkTheme = {\n x9cbvzh: \"xf26cth x9cbvzh\",\n $$css: true\n};\nexport { colorDefaultsDarkTheme };\nconst typography = {\n bodyLargeFont: \"var(--x1ygl7cg)\",\n bodyLargeLineHeight: \"var(--xol8812)\",\n bodyLargeSize: \"var(--xjulk4j)\",\n bodyLargeTracking: \"var(--x10nh56i)\",\n bodyLargeWeight: \"var(--x16erikp)\",\n bodyMediumFont: \"var(--x1q0k4yu)\",\n bodyMediumLineHeight: \"var(--x1j54qr5)\",\n bodyMediumSize: \"var(--x1gawvsv)\",\n bodyMediumTracking: \"var(--x1wq3zjd)\",\n bodyMediumWeight: \"var(--x1ayguju)\",\n bodySmallFont: \"var(--x15dz6tq)\",\n bodySmallLineHeight: \"var(--x1lrg4gv)\",\n bodySmallSize: \"var(--x18q7aov)\",\n bodySmallTracking: \"var(--xw822is)\",\n bodySmallWeight: \"var(--x1ok1j4r)\",\n displayLargeFont: \"var(--x134eq0n)\",\n displayLargeLineHeight: \"var(--xhofdxx)\",\n displayLargeSize: \"var(--x17lio9c)\",\n displayLargeTracking: \"var(--x1gxj0qs)\",\n displayLargeWeight: \"var(--xe5fuv)\",\n displayMediumFont: \"var(--xyhb918)\",\n displayMediumLineHeight: \"var(--xb6v12a)\",\n displayMediumSize: \"var(--xtenqmo)\",\n displayMediumTracking: \"var(--x116sb5h)\",\n displayMediumWeight: \"var(--xoezdz5)\",\n displaySmallFont: \"var(--xdjewjw)\",\n displaySmallLineHeight: \"var(--x1pjhsc4)\",\n displaySmallSize: \"var(--xa0mhat)\",\n displaySmallTracking: \"var(--x1p2yclr)\",\n displaySmallWeight: \"var(--xhws6hb)\",\n fontFamilyBrand: \"var(--x1dvys7s)\",\n fontFamilyMono: \"var(--xawtrnj)\",\n fontFamilyPlain: \"var(--xa58n4l)\",\n headlineLargeFont: \"var(--xof041q)\",\n headlineLargeLineHeight: \"var(--xurq05k)\",\n headlineLargeSize: \"var(--xb8fm24)\",\n headlineLargeTracking: \"var(--xl627c)\",\n headlineLargeWeight: \"var(--xvbu8tx)\",\n headlineMediumFont: \"var(--xsd729e)\",\n headlineMediumLineHeight: \"var(--x1tcnfxo)\",\n headlineMediumSize: \"var(--xt0lczk)\",\n headlineMediumTracking: \"var(--xpyu5e0)\",\n headlineMediumWeight: \"var(--x9gskfq)\",\n headlineSmallFont: \"var(--x1jqfzdj)\",\n headlineSmallLineHeight: \"var(--xkj6wu1)\",\n headlineSmallSize: \"var(--x1oc1922)\",\n headlineSmallTracking: \"var(--x1te0yyg)\",\n headlineSmallWeight: \"var(--x1lrnn0r)\",\n labelLargeFont: \"var(--xnff2fy)\",\n labelLargeLineHeight: \"var(--x9imlvm)\",\n labelLargeSize: \"var(--xl3tx9q)\",\n labelLargeTracking: \"var(--x14fmv7u)\",\n labelLargeWeight: \"var(--xwguucb)\",\n labelMediumFont: \"var(--xbejnr)\",\n labelMediumLineHeight: \"var(--xqehqp9)\",\n labelMediumSize: \"var(--x48e3yn)\",\n labelMediumTracking: \"var(--xe8jatf)\",\n labelMediumWeight: \"var(--x1a51kfj)\",\n labelSmallFont: \"var(--xm0ylhd)\",\n labelSmallLineHeight: \"var(--xt3caw9)\",\n labelSmallSize: \"var(--x5h3z1j)\",\n labelSmallTracking: \"var(--x2j42vm)\",\n labelSmallWeight: \"var(--xj1uwei)\",\n titleLargeFont: \"var(--xr826oj)\",\n titleLargeLineHeight: \"var(--xuc6kgf)\",\n titleLargeSize: \"var(--xs4cscp)\",\n titleLargeTracking: \"var(--xt8l743)\",\n titleLargeWeight: \"var(--x1i0wwws)\",\n titleMediumFont: \"var(--x1bjiv9x)\",\n titleMediumLineHeight: \"var(--x3j91oh)\",\n titleMediumSize: \"var(--x1yypmzp)\",\n titleMediumTracking: \"var(--x1b77t50)\",\n titleMediumWeight: \"var(--x3ehn1q)\",\n titleSmallFont: \"var(--x1kgqo6c)\",\n titleSmallLineHeight: \"var(--x1l4af85)\",\n titleSmallSize: \"var(--x1hrxtmi)\",\n titleSmallTracking: \"var(--xn7tcr9)\",\n titleSmallWeight: \"var(--xj437rg)\",\n weightBold: \"var(--xlvbdhw)\",\n weightMedium: \"var(--x1vg17ag)\",\n weightRegular: \"var(--xgz8ay1)\",\n __varGroupHash__: \"x1q1jnkv\"\n};\nexport { typography };\nconst spacing = {\n lg: \"var(--x3km7fe)\",\n md: \"var(--x6borv4)\",\n sm: \"var(--xod9tvo)\",\n xl: \"var(--x196ey9q)\",\n xs: \"var(--xbmbo34)\",\n xxl: \"var(--xi3mssk)\",\n xxs: \"var(--x1ug6acx)\",\n xxxl: \"var(--xqgx294)\",\n __varGroupHash__: \"x1egpaah\"\n};\nexport { spacing };\nconst radii = {\n circle: \"var(--x1s0h5j3)\",\n lg: \"var(--xf3l8oo)\",\n md: \"var(--x1m0y4ip)\",\n none: \"var(--x1lckk6t)\",\n pill: \"var(--x3hih16)\",\n sm: \"var(--xslt97v)\",\n xl: \"var(--x1w5u0jm)\",\n xs: \"var(--x1qkrqlv)\",\n __varGroupHash__: \"xhnz8s7\"\n};\nexport { radii };\nconst sizing = {\n controlLg: \"var(--x1hfhk6y)\",\n controlMd: \"var(--x1imqybj)\",\n controlSm: \"var(--x1ww3f7m)\",\n controlXl: \"var(--x1eqeuls)\",\n controlXs: \"var(--x67cwyw)\",\n controlXxl: \"var(--xmcpupp)\",\n rowLg: \"var(--xnychtd)\",\n rowMd: \"var(--xz029kk)\",\n rowSm: \"var(--x1m307d3)\",\n rowXs: \"var(--x15xxfuy)\",\n __varGroupHash__: \"xzhmma2\"\n};\nexport { sizing };\nconst shadows = {\n elevation1: \"var(--xt04dnm)\",\n elevation2: \"var(--x14ermby)\",\n elevation3: \"var(--x1tlgjf0)\",\n elevation4: \"var(--x1vx95kd)\",\n elevation5: \"var(--x4ackbv)\",\n __varGroupHash__: \"x1j0lhbx\"\n};\nexport { shadows };\nconst stateLayerOpacity = {\n disabledContainer: \"var(--x1cq03z9)\",\n disabledContent: \"var(--xu361ij)\",\n dragged: \"var(--x1uapny3)\",\n focus: \"var(--x124j18r)\",\n hover: \"var(--x8z5t6h)\",\n pressed: \"var(--xhaltwz)\",\n __varGroupHash__: \"x1dldgtb\"\n};\nexport { stateLayerOpacity };\nconst motion = {\n durationLong1: \"var(--x1f45rvw)\",\n durationLong2: \"var(--x13xtsm0)\",\n durationLong3: \"var(--xyz43tr)\",\n durationMedium1: \"var(--x1neymab)\",\n durationMedium2: \"var(--x1v2b4mt)\",\n durationMedium3: \"var(--x1vta88b)\",\n durationShort1: \"var(--x1xkwyvg)\",\n durationShort2: \"var(--x12wc0xg)\",\n durationShort3: \"var(--xaryv6b)\",\n easingEmphasized: \"var(--x1naowyp)\",\n easingEmphasizedAccelerate: \"var(--xm20gsr)\",\n easingEmphasizedDecelerate: \"var(--xtxwhk6)\",\n easingSpringFast: \"var(--x1m2kglw)\",\n easingSpringSlow: \"var(--xhdhzmf)\",\n easingStandard: \"var(--x77wm8g)\",\n __varGroupHash__: \"x1dv3b2k\"\n};\nexport { motion };\nconst colorsScope = {\n x1qza42b: \"xph554m x1qza42b\",\n $$css: true\n};\nconst motionScope = {\n x1dv3b2k: \"xph554m x1dv3b2k\",\n $$css: true\n};\nconst radiiScope = {\n xhnz8s7: \"xph554m xhnz8s7\",\n $$css: true\n};\nconst shadowsScope = {\n x1j0lhbx: \"xph554m x1j0lhbx\",\n $$css: true\n};\nconst sizingScope = {\n xzhmma2: \"xph554m xzhmma2\",\n $$css: true\n};\nconst spacingScope = {\n x1egpaah: \"xph554m x1egpaah\",\n $$css: true\n};\nconst stateLayerOpacityScope = {\n x1dldgtb: \"xph554m x1dldgtb\",\n $$css: true\n};\nconst typographyScope = {\n x1q1jnkv: \"xph554m x1q1jnkv\",\n $$css: true\n};\nconst tokenScope = [colorsScope, motionScope, radiiScope, shadowsScope, sizingScope, spacingScope, stateLayerOpacityScope, typographyScope];\nexport { tokenScope };\nconst breakpoints = {\n compact: \"0px\",\n expanded: \"840px\",\n extraLarge: \"1600px\",\n large: \"1200px\",\n medium: \"600px\"\n};\nexport { breakpoints };\nconst container = {\n belowExpanded: \"@container (width < 840px)\",\n belowExtraLarge: \"@container (width < 1600px)\",\n belowLarge: \"@container (width < 1200px)\",\n belowMedium: \"@container (width < 600px)\",\n expanded: \"@container (width >= 840px)\",\n extraLarge: \"@container (width >= 1600px)\",\n large: \"@container (width >= 1200px)\",\n medium: \"@container (width >= 600px)\"\n};\nexport { container };\nconst media = {\n belowExpanded: \"@media (width < 840px)\",\n belowExtraLarge: \"@media (width < 1600px)\",\n belowLarge: \"@media (width < 1200px)\",\n belowMedium: \"@media (width < 600px)\",\n expanded: \"@media (width >= 840px)\",\n extraLarge: \"@media (width >= 1600px)\",\n large: \"@media (width >= 1200px)\",\n medium: \"@media (width >= 600px)\"\n};\nexport { media };"],"mappings":";AAqEA,MAAM0D,SAAS;CACb1D,YAAY;CACZC,OAAO;CACPC,gBAAgB;CAChBC,kBAAkB;CAClBC,gBAAgB;CAChBC,gBAAgB;CAChBC,UAAU;CACVC,mBAAmB;CACnBC,cAAc;CACdC,SAAS;CACTC,kBAAkB;CAClBC,YAAY;CACZC,qBAAqB;CACrBC,YAAY;CACZC,qBAAqB;CACrBC,WAAW;CACXC,oBAAoB;CACpBC,gBAAgB;CAChBC,uBAAuB;CACvBC,aAAa;CACbC,sBAAsB;CACtBC,kBAAkB;CAClBC,yBAAyB;CACzBC,WAAW;CACXC,kBAAkB;CAClBC,YAAY;CACZC,qBAAqB;CACrBC,iBAAiB;CACjBC,wBAAwB;CACxBC,SAAS;CACTC,gBAAgB;CAChBC,UAAU;CACVC,mBAAmB;CACnBC,SAAS;CACTC,kBAAkB;CAClBC,cAAc;CACdC,iBAAiB;CACjBC,OAAO;CACPC,WAAW;CACXC,oBAAoB;CACpBC,gBAAgB;CAChBC,mBAAmB;CACnBC,QAAQ;CACRC,SAAS;CACTC,eAAe;CACfC,kBAAkB;CAClBC,sBAAsB;CACtBC,yBAAyB;CACzBC,qBAAqB;CACrBC,wBAAwB;CACxBC,YAAY;CACZC,aAAa;CACbC,gBAAgB;CAChBC,UAAU;CACVC,mBAAmB;CACnBC,eAAe;CACfC,kBAAkB;CAClBC,kBAAkB;AACpB;AAEA,MAAME,0BAA0B;CAC9BC,SAAS;CACTC,OAAO;AACT;AAEA,MAAMC,yBAAyB;CAC7BF,SAAS;CACTC,OAAO;AACT;AAEA,MAAME,aAAa;CACjBC,eAAe;CACfC,qBAAqB;CACrBC,eAAe;CACfC,mBAAmB;CACnBC,iBAAiB;CACjBC,gBAAgB;CAChBC,sBAAsB;CACtBC,gBAAgB;CAChBC,oBAAoB;CACpBC,kBAAkB;CAClBC,eAAe;CACfC,q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B;AAEA,MAAMiG,QAAQ;CACZC,QAAQ;CACRT,IAAI;CACJC,IAAI;CACJS,MAAM;CACNC,MAAM;CACNT,IAAI;CACJC,IAAI;CACJC,IAAI;CACJ7F,kBAAkB;AACpB;AAEA,MAAMqG,SAAS;CACbC,WAAW;CACXC,WAAW;CACXC,WAAW;CACXC,WAAW;CACXC,WAAW;CACXC,YAAY;CACZC,OAAO;CACPC,OAAO;CACPC,OAAO;CACPC,OAAO;CACP/G,kBAAkB;AACpB;AAWA,MAAMgH,oBAAoB;CACxBC,mBAAmB;CACnBC,iBAAiB;CACjBC,SAAS;CACTC,OAAO;CACPC,OAAO;CACPC,SAAS;CACTtH,kBAAkB;AACpB;AAqDA,MAAMuI,aAAa;CAAChB;EA/BlBC,UAAU;EACVpH,OAAO;CA8BWmH;CAAaE;EA3B/BC,UAAU;EACVtH,OAAO;CA0BwBqH;CAAaE;EAvB5CC,SAAS;EACTxH,OAAO;CAsBqCuH;CAAYE;EAnBxDC,UAAU;EACV1H,OAAO;CAkBiDyH;CAAcE;EAftEC,SAAS;EACT5H,OAAO;CAc+D2H;CAAaE;EAXnFC,UAAU;EACV9H,OAAO;CAU4E6H;CAAcE;EAPjGC,UAAU;EACVhI,OAAO;CAM0F+H;CAAwBE;EAHzHC,UAAU;EACVlI,OAAO;CAEkHiI;AAAe"}
1
+ {"version":3,"file":"design.tokens.stylex.js","names":["background","error","errorContainer","inverseError","inverseOnSurface","inversePrimary","inverseSurface","negative","negativeContainer","onBackground","onError","onErrorContainer","onNegative","onNegativeContainer","onPositive","onPositiveContainer","onPrimary","onPrimaryContainer","onPrimaryFixed","onPrimaryFixedVariant","onSecondary","onSecondaryContainer","onSecondaryFixed","onSecondaryFixedVariant","onSurface","onSurfaceVariant","onTertiary","onTertiaryContainer","onTertiaryFixed","onTertiaryFixedVariant","outline","outlineVariant","positive","positiveContainer","primary","primaryContainer","primaryFixed","primaryFixedDim","scrim","secondary","secondaryContainer","secondaryFixed","secondaryFixedDim","shadow","surface","surfaceBright","surfaceContainer","surfaceContainerHigh","surfaceContainerHighest","surfaceContainerLow","surfaceContainerLowest","surfaceDim","surfaceTint","surfaceVariant","tertiary","tertiaryContainer","tertiaryFixed","tertiaryFixedDim","__varGroupHash__","colors","colorDefaultsLightTheme","x9cbvzh","$$css","colorDefaultsDarkTheme","typography","bodyLargeFont","bodyLargeLineHeight","bodyLargeSize","bodyLargeTracking","bodyLargeWeight","bodyMediumFont","bodyMediumLineHeight","bodyMediumSize","bodyMediumTracking","bodyMediumWeight","bodySmallFont","bodySmallLineHeight","bodySmallSize","bodySmallTracking","bodySmallWeight","displayLargeFont","displayLargeLineHeight","displayLargeSize","displayLargeTracking","displayLargeWeight","displayMediumFont","displayMediumLineHeight","displayMediumSize","displayMediumTracking","displayMediumWeight","displaySmallFont","displaySmallLineHeight","displaySmallSize","displaySmallTracking","displaySmallWeight","fontFamilyBrand","fontFamilyMono","fontFamilyPlain","headlineLargeFont","headlineLargeLineHeight","headlineLargeSize","headlineLargeTracking","headlineLargeWeight","headlineMediumFont","headlineMediumLineHeight","headlineMediumSize","headlineMediumTracking","headlineMediumWeight","headlineSmallFont","headlineSmallLineHeight","headlineSmallSize","headlineSmallTracking","headlineSmallWeight","labelLargeFont","labelLargeLineHeight","labelLargeSize","labelLargeTracking","labelLargeWeight","labelMediumFont","labelMediumLineHeight","labelMediumSize","labelMediumTracking","labelMediumWeight","labelSmallFont","labelSmallLineHeight","labelSmallSize","labelSmallTracking","labelSmallWeight","titleLargeFont","titleLargeLineHeight","titleLargeSize","titleLargeTracking","titleLargeWeight","titleMediumFont","titleMediumLineHeight","titleMediumSize","titleMediumTracking","titleMediumWeight","titleSmallFont","titleSmallLineHeight","titleSmallSize","titleSmallTracking","titleSmallWeight","weightBold","weightMedium","weightRegular","spacing","lg","md","sm","xl","xs","xxl","xxs","xxxl","radii","circle","none","pill","sizing","controlLg","controlMd","controlSm","controlXl","controlXs","controlXxl","rowLg","rowMd","rowSm","rowXs","stateLayerOpacity","disabledContainer","disabledContent","dragged","focus","hover","pressed","colorsScope","x1qza42b","motionScope","x1dv3b2k","radiiScope","xhnz8s7","shadowsScope","x1j0lhbx","sizingScope","xzhmma2","spacingScope","x1egpaah","stateLayerOpacityScope","x1dldgtb","typographyScope","x1q1jnkv","tokenScope"],"sources":["../../src/tokens/design.tokens.stylex.ts"],"sourcesContent":["// AUTO-GENERATED by scripts/build-tokens.mjs from @kanso-labs/kanso-ui-core's\n// tokens.json, and not committed. Do not hand-edit — a token changes in\n// kanso-ui-core, and `npm run tokens:build` regenerates this.\n// The .stylex.ts suffix is required by @stylexjs/babel-plugin for cross-file\n// variable resolution — see the comment at the top of build-tokens.mjs.\n\nimport * as stylex from '@stylexjs/stylex';\nconst DARK = '@media (prefers-color-scheme: dark)';\nconst colorDefaults = {\n background: \"var(--x11lqfhi)\",\n error: \"var(--xrqi77u)\",\n errorContainer: \"var(--x82z8jw)\",\n inverseError: \"var(--x14zg7k0)\",\n inverseOnSurface: \"var(--xey760i)\",\n inversePrimary: \"var(--x1trscgf)\",\n inverseSurface: \"var(--x1i3zbmj)\",\n negative: \"var(--x1srpzsd)\",\n negativeContainer: \"var(--x15kkkkd)\",\n onBackground: \"var(--x3jqtd5)\",\n onError: \"var(--x1p11w7)\",\n onErrorContainer: \"var(--x1g3s5u0)\",\n onNegative: \"var(--xvkb642)\",\n onNegativeContainer: \"var(--x1bbk4uq)\",\n onPositive: \"var(--xirk23p)\",\n onPositiveContainer: \"var(--xtdi97o)\",\n onPrimary: \"var(--x1pbr5ko)\",\n onPrimaryContainer: \"var(--x16857a7)\",\n onPrimaryFixed: \"var(--xbdn1ia)\",\n onPrimaryFixedVariant: \"var(--x17lawo6)\",\n onSecondary: \"var(--x1cp179l)\",\n onSecondaryContainer: \"var(--x1jlz0n7)\",\n onSecondaryFixed: \"var(--x1hhc6tz)\",\n onSecondaryFixedVariant: \"var(--xq0cxz6)\",\n onSurface: \"var(--xdn6aro)\",\n onSurfaceVariant: \"var(--x4604rt)\",\n onTertiary: \"var(--x132ctuv)\",\n onTertiaryContainer: \"var(--xgnutht)\",\n onTertiaryFixed: \"var(--x1ysnvcz)\",\n onTertiaryFixedVariant: \"var(--xs3mjkr)\",\n outline: \"var(--x1fpgh70)\",\n outlineVariant: \"var(--xzldpa8)\",\n positive: \"var(--x13hikrd)\",\n positiveContainer: \"var(--xlj0u70)\",\n primary: \"var(--x14za91n)\",\n primaryContainer: \"var(--x1ec4otz)\",\n primaryFixed: \"var(--x1j381ev)\",\n primaryFixedDim: \"var(--x8doykj)\",\n scrim: \"var(--xyme5sg)\",\n secondary: \"var(--x1ol0e1a)\",\n secondaryContainer: \"var(--xemq5b8)\",\n secondaryFixed: \"var(--xhpqfgm)\",\n secondaryFixedDim: \"var(--x41clx7)\",\n shadow: \"var(--x1wc4n63)\",\n surface: \"var(--xpk6svv)\",\n surfaceBright: \"var(--xqwhmb8)\",\n surfaceContainer: \"var(--x1sde9bn)\",\n surfaceContainerHigh: \"var(--xcu50ml)\",\n surfaceContainerHighest: \"var(--x1rcd2bb)\",\n surfaceContainerLow: \"var(--xnes5mg)\",\n surfaceContainerLowest: \"var(--x2633xs)\",\n surfaceDim: \"var(--x1qike4i)\",\n surfaceTint: \"var(--x117542l)\",\n surfaceVariant: \"var(--x13gaudu)\",\n tertiary: \"var(--xp06fov)\",\n tertiaryContainer: \"var(--xjl3qbu)\",\n tertiaryFixed: \"var(--xepjwm)\",\n tertiaryFixedDim: \"var(--x1mnnhxz)\",\n __varGroupHash__: \"x9cbvzh\"\n};\nexport { colorDefaults };\nconst colors = {\n background: \"var(--xm52p6p)\",\n error: \"var(--x12p1wyw)\",\n errorContainer: \"var(--x7wk2f4)\",\n inverseError: \"var(--xq7t4w)\",\n inverseOnSurface: \"var(--x1balm44)\",\n inversePrimary: \"var(--x1v1ejj2)\",\n inverseSurface: \"var(--x1614qkl)\",\n negative: \"var(--x1m9zerx)\",\n negativeContainer: \"var(--x1sa9icp)\",\n onBackground: \"var(--xwr0q4)\",\n onError: \"var(--xwloagh)\",\n onErrorContainer: \"var(--xqsbqtq)\",\n onNegative: \"var(--x1ey4ils)\",\n onNegativeContainer: \"var(--x1snvm1r)\",\n onPositive: \"var(--xyvlj6c)\",\n onPositiveContainer: \"var(--xn09qcj)\",\n onPrimary: \"var(--x1f7qwsz)\",\n onPrimaryContainer: \"var(--x1p425jc)\",\n onPrimaryFixed: \"var(--x7fing4)\",\n onPrimaryFixedVariant: \"var(--x9qmz6i)\",\n onSecondary: \"var(--xkltk4j)\",\n onSecondaryContainer: \"var(--x1bo8p7i)\",\n onSecondaryFixed: \"var(--xs1em01)\",\n onSecondaryFixedVariant: \"var(--xpj09jl)\",\n onSurface: \"var(--xn0syi6)\",\n onSurfaceVariant: \"var(--x28n2pw)\",\n onTertiary: \"var(--x7tegcs)\",\n onTertiaryContainer: \"var(--x1pzkjol)\",\n onTertiaryFixed: \"var(--xl08771)\",\n onTertiaryFixedVariant: \"var(--x1b7jmlf)\",\n outline: \"var(--x1ridy1o)\",\n outlineVariant: \"var(--x7dbk6n)\",\n positive: \"var(--xiob6mg)\",\n positiveContainer: \"var(--x1xvl3py)\",\n primary: \"var(--x1cjupv7)\",\n primaryContainer: \"var(--x17f4f9w)\",\n primaryFixed: \"var(--x1irt4fq)\",\n primaryFixedDim: \"var(--x1ver3t)\",\n scrim: \"var(--x1khq28e)\",\n secondary: \"var(--x189y34t)\",\n secondaryContainer: \"var(--xliov21)\",\n secondaryFixed: \"var(--xmiml2p)\",\n secondaryFixedDim: \"var(--x1lc0aek)\",\n shadow: \"var(--xj3yx3l)\",\n surface: \"var(--x1dzgr7y)\",\n surfaceBright: \"var(--x1ghurj8)\",\n surfaceContainer: \"var(--x3cqee7)\",\n surfaceContainerHigh: \"var(--x1xbp8h6)\",\n surfaceContainerHighest: \"var(--x13o0mym)\",\n surfaceContainerLow: \"var(--xi1exwt)\",\n surfaceContainerLowest: \"var(--x1b34qje)\",\n surfaceDim: \"var(--xo1km0t)\",\n surfaceTint: \"var(--x1jo8snc)\",\n surfaceVariant: \"var(--x17proku)\",\n tertiary: \"var(--x1bb0p1w)\",\n tertiaryContainer: \"var(--x1p33ujy)\",\n tertiaryFixed: \"var(--x9erpvp)\",\n tertiaryFixedDim: \"var(--x1or1uxx)\",\n __varGroupHash__: \"x1qza42b\"\n};\nexport { colors };\nconst colorDefaultsLightTheme = {\n x9cbvzh: \"xjbqju4 x9cbvzh\",\n $$css: true\n};\nexport { colorDefaultsLightTheme };\nconst colorDefaultsDarkTheme = {\n x9cbvzh: \"xf2gwb6 x9cbvzh\",\n $$css: true\n};\nexport { colorDefaultsDarkTheme };\nconst typography = {\n bodyLargeFont: \"var(--x1ygl7cg)\",\n bodyLargeLineHeight: \"var(--xol8812)\",\n bodyLargeSize: \"var(--xjulk4j)\",\n bodyLargeTracking: \"var(--x10nh56i)\",\n bodyLargeWeight: \"var(--x16erikp)\",\n bodyMediumFont: \"var(--x1q0k4yu)\",\n bodyMediumLineHeight: \"var(--x1j54qr5)\",\n bodyMediumSize: \"var(--x1gawvsv)\",\n bodyMediumTracking: \"var(--x1wq3zjd)\",\n bodyMediumWeight: \"var(--x1ayguju)\",\n bodySmallFont: \"var(--x15dz6tq)\",\n bodySmallLineHeight: \"var(--x1lrg4gv)\",\n bodySmallSize: \"var(--x18q7aov)\",\n bodySmallTracking: \"var(--xw822is)\",\n bodySmallWeight: \"var(--x1ok1j4r)\",\n displayLargeFont: \"var(--x134eq0n)\",\n displayLargeLineHeight: \"var(--xhofdxx)\",\n displayLargeSize: \"var(--x17lio9c)\",\n displayLargeTracking: \"var(--x1gxj0qs)\",\n displayLargeWeight: \"var(--xe5fuv)\",\n displayMediumFont: \"var(--xyhb918)\",\n displayMediumLineHeight: \"var(--xb6v12a)\",\n displayMediumSize: \"var(--xtenqmo)\",\n displayMediumTracking: \"var(--x116sb5h)\",\n displayMediumWeight: \"var(--xoezdz5)\",\n displaySmallFont: \"var(--xdjewjw)\",\n displaySmallLineHeight: \"var(--x1pjhsc4)\",\n displaySmallSize: \"var(--xa0mhat)\",\n displaySmallTracking: \"var(--x1p2yclr)\",\n displaySmallWeight: \"var(--xhws6hb)\",\n fontFamilyBrand: \"var(--x1dvys7s)\",\n fontFamilyMono: \"var(--xawtrnj)\",\n fontFamilyPlain: \"var(--xa58n4l)\",\n headlineLargeFont: \"var(--xof041q)\",\n headlineLargeLineHeight: \"var(--xurq05k)\",\n headlineLargeSize: \"var(--xb8fm24)\",\n headlineLargeTracking: \"var(--xl627c)\",\n headlineLargeWeight: \"var(--xvbu8tx)\",\n headlineMediumFont: \"var(--xsd729e)\",\n headlineMediumLineHeight: \"var(--x1tcnfxo)\",\n headlineMediumSize: \"var(--xt0lczk)\",\n headlineMediumTracking: \"var(--xpyu5e0)\",\n headlineMediumWeight: \"var(--x9gskfq)\",\n headlineSmallFont: \"var(--x1jqfzdj)\",\n headlineSmallLineHeight: \"var(--xkj6wu1)\",\n headlineSmallSize: \"var(--x1oc1922)\",\n headlineSmallTracking: \"var(--x1te0yyg)\",\n headlineSmallWeight: \"var(--x1lrnn0r)\",\n labelLargeFont: \"var(--xnff2fy)\",\n labelLargeLineHeight: \"var(--x9imlvm)\",\n labelLargeSize: \"var(--xl3tx9q)\",\n labelLargeTracking: \"var(--x14fmv7u)\",\n labelLargeWeight: \"var(--xwguucb)\",\n labelMediumFont: \"var(--xbejnr)\",\n labelMediumLineHeight: \"var(--xqehqp9)\",\n labelMediumSize: \"var(--x48e3yn)\",\n labelMediumTracking: \"var(--xe8jatf)\",\n labelMediumWeight: \"var(--x1a51kfj)\",\n labelSmallFont: \"var(--xm0ylhd)\",\n labelSmallLineHeight: \"var(--xt3caw9)\",\n labelSmallSize: \"var(--x5h3z1j)\",\n labelSmallTracking: \"var(--x2j42vm)\",\n labelSmallWeight: \"var(--xj1uwei)\",\n titleLargeFont: \"var(--xr826oj)\",\n titleLargeLineHeight: \"var(--xuc6kgf)\",\n titleLargeSize: \"var(--xs4cscp)\",\n titleLargeTracking: \"var(--xt8l743)\",\n titleLargeWeight: \"var(--x1i0wwws)\",\n titleMediumFont: \"var(--x1bjiv9x)\",\n titleMediumLineHeight: \"var(--x3j91oh)\",\n titleMediumSize: \"var(--x1yypmzp)\",\n titleMediumTracking: \"var(--x1b77t50)\",\n titleMediumWeight: \"var(--x3ehn1q)\",\n titleSmallFont: \"var(--x1kgqo6c)\",\n titleSmallLineHeight: \"var(--x1l4af85)\",\n titleSmallSize: \"var(--x1hrxtmi)\",\n titleSmallTracking: \"var(--xn7tcr9)\",\n titleSmallWeight: \"var(--xj437rg)\",\n weightBold: \"var(--xlvbdhw)\",\n weightMedium: \"var(--x1vg17ag)\",\n weightRegular: \"var(--xgz8ay1)\",\n __varGroupHash__: \"x1q1jnkv\"\n};\nexport { typography };\nconst spacing = {\n lg: \"var(--x3km7fe)\",\n md: \"var(--x6borv4)\",\n sm: \"var(--xod9tvo)\",\n xl: \"var(--x196ey9q)\",\n xs: \"var(--xbmbo34)\",\n xxl: \"var(--xi3mssk)\",\n xxs: \"var(--x1ug6acx)\",\n xxxl: \"var(--xqgx294)\",\n __varGroupHash__: \"x1egpaah\"\n};\nexport { spacing };\nconst radii = {\n circle: \"var(--x1s0h5j3)\",\n lg: \"var(--xf3l8oo)\",\n md: \"var(--x1m0y4ip)\",\n none: \"var(--x1lckk6t)\",\n pill: \"var(--x3hih16)\",\n sm: \"var(--xslt97v)\",\n xl: \"var(--x1w5u0jm)\",\n xs: \"var(--x1qkrqlv)\",\n __varGroupHash__: \"xhnz8s7\"\n};\nexport { radii };\nconst sizing = {\n controlLg: \"var(--x1hfhk6y)\",\n controlMd: \"var(--x1imqybj)\",\n controlSm: \"var(--x1ww3f7m)\",\n controlXl: \"var(--x1eqeuls)\",\n controlXs: \"var(--x67cwyw)\",\n controlXxl: \"var(--xmcpupp)\",\n rowLg: \"var(--xnychtd)\",\n rowMd: \"var(--xz029kk)\",\n rowSm: \"var(--x1m307d3)\",\n rowXs: \"var(--x15xxfuy)\",\n __varGroupHash__: \"xzhmma2\"\n};\nexport { sizing };\nconst shadows = {\n elevation1: \"var(--xt04dnm)\",\n elevation2: \"var(--x14ermby)\",\n elevation3: \"var(--x1tlgjf0)\",\n elevation4: \"var(--x1vx95kd)\",\n elevation5: \"var(--x4ackbv)\",\n __varGroupHash__: \"x1j0lhbx\"\n};\nexport { shadows };\nconst stateLayerOpacity = {\n disabledContainer: \"var(--x1cq03z9)\",\n disabledContent: \"var(--xu361ij)\",\n dragged: \"var(--x1uapny3)\",\n focus: \"var(--x124j18r)\",\n hover: \"var(--x8z5t6h)\",\n pressed: \"var(--xhaltwz)\",\n __varGroupHash__: \"x1dldgtb\"\n};\nexport { stateLayerOpacity };\nconst motion = {\n durationLong1: \"var(--x1f45rvw)\",\n durationLong2: \"var(--x13xtsm0)\",\n durationLong3: \"var(--xyz43tr)\",\n durationMedium1: \"var(--x1neymab)\",\n durationMedium2: \"var(--x1v2b4mt)\",\n durationMedium3: \"var(--x1vta88b)\",\n durationShort1: \"var(--x1xkwyvg)\",\n durationShort2: \"var(--x12wc0xg)\",\n durationShort3: \"var(--xaryv6b)\",\n easingEmphasized: \"var(--x1naowyp)\",\n easingEmphasizedAccelerate: \"var(--xm20gsr)\",\n easingEmphasizedDecelerate: \"var(--xtxwhk6)\",\n easingSpringFast: \"var(--x1m2kglw)\",\n easingSpringSlow: \"var(--xhdhzmf)\",\n easingStandard: \"var(--x77wm8g)\",\n __varGroupHash__: \"x1dv3b2k\"\n};\nexport { motion };\nconst colorsScope = {\n x1qza42b: \"xph554m x1qza42b\",\n $$css: true\n};\nconst motionScope = {\n x1dv3b2k: \"xph554m x1dv3b2k\",\n $$css: true\n};\nconst radiiScope = {\n xhnz8s7: \"xph554m xhnz8s7\",\n $$css: true\n};\nconst shadowsScope = {\n x1j0lhbx: \"xph554m x1j0lhbx\",\n $$css: true\n};\nconst sizingScope = {\n xzhmma2: \"xph554m xzhmma2\",\n $$css: true\n};\nconst spacingScope = {\n x1egpaah: \"xph554m x1egpaah\",\n $$css: true\n};\nconst stateLayerOpacityScope = {\n x1dldgtb: \"xph554m x1dldgtb\",\n $$css: true\n};\nconst typographyScope = {\n x1q1jnkv: \"xph554m x1q1jnkv\",\n $$css: true\n};\nconst tokenScope = [colorsScope, motionScope, radiiScope, shadowsScope, sizingScope, spacingScope, stateLayerOpacityScope, typographyScope];\nexport { tokenScope };\nconst breakpoints = {\n compact: \"0px\",\n expanded: \"840px\",\n extraLarge: \"1600px\",\n large: \"1200px\",\n medium: \"600px\"\n};\nexport { breakpoints };\nconst container = {\n belowExpanded: \"@container (width < 840px)\",\n belowExtraLarge: \"@container (width < 1600px)\",\n belowLarge: \"@container (width < 1200px)\",\n belowMedium: \"@container (width < 600px)\",\n expanded: \"@container (width >= 840px)\",\n extraLarge: \"@container (width >= 1600px)\",\n large: \"@container (width >= 1200px)\",\n medium: \"@container (width >= 600px)\"\n};\nexport { container };\nconst media = {\n belowExpanded: \"@media (width < 840px)\",\n belowExtraLarge: \"@media (width < 1600px)\",\n belowLarge: \"@media (width < 1200px)\",\n belowMedium: \"@media (width < 600px)\",\n expanded: \"@media (width >= 840px)\",\n extraLarge: \"@media (width >= 1600px)\",\n large: \"@media (width >= 1200px)\",\n medium: \"@media (width >= 600px)\"\n};\nexport { media };"],"mappings":";AAsEA,MAAM2D,SAAS;CACb3D,YAAY;CACZC,OAAO;CACPC,gBAAgB;CAChBC,cAAc;CACdC,kBAAkB;CAClBC,gBAAgB;CAChBC,gBAAgB;CAChBC,UAAU;CACVC,mBAAmB;CACnBC,cAAc;CACdC,SAAS;CACTC,kBAAkB;CAClBC,YAAY;CACZC,qBAAqB;CACrBC,YAAY;CACZC,qBAAqB;CACrBC,WAAW;CACXC,oBAAoB;CACpBC,gBAAgB;CAChBC,uBAAuB;CACvBC,aAAa;CACbC,sBAAsB;CACtBC,kBAAkB;CAClBC,yBAAyB;CACzBC,WAAW;CACXC,kBAAkB;CAClBC,YAAY;CACZC,qBAAqB;CACrBC,iBAAiB;CACjBC,wBAAwB;CACxBC,S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;CA0BwBqH;CAAaE;EAvB5CC,SAAS;EACTxH,OAAO;CAsBqCuH;CAAYE;EAnBxDC,UAAU;EACV1H,OAAO;CAkBiDyH;CAAcE;EAftEC,SAAS;EACT5H,OAAO;CAc+D2H;CAAaE;EAXnFC,UAAU;EACV9H,OAAO;CAU4E6H;CAAcE;EAPjGC,UAAU;EACVhI,OAAO;CAM0F+H;CAAwBE;EAHzHC,UAAU;EACVlI,OAAO;CAEkHiI;AAAe"}
package/dist/tokens.css CHANGED
@@ -9,6 +9,7 @@
9
9
  --kui-color-background: #fef7ff;
10
10
  --kui-color-error-container: #f9dedc;
11
11
  --kui-color-error: #b3261e;
12
+ --kui-color-inverse-error: #f2b8b5;
12
13
  --kui-color-inverse-on-surface: #f5eff7;
13
14
  --kui-color-inverse-primary: #d0bcff;
14
15
  --kui-color-inverse-surface: #322f35;
@@ -348,6 +349,7 @@
348
349
  --kui-color-background: #141218;
349
350
  --kui-color-error-container: #8c1d18;
350
351
  --kui-color-error: #f2b8b5;
352
+ --kui-color-inverse-error: #b3261e;
351
353
  --kui-color-inverse-on-surface: #322f35;
352
354
  --kui-color-inverse-primary: #6750a4;
353
355
  --kui-color-inverse-surface: #e6e0e9;
package/dist/tokens.json CHANGED
@@ -385,6 +385,9 @@
385
385
  "errorContainer": {
386
386
  "$value": "{color.error.90}"
387
387
  },
388
+ "inverseError": {
389
+ "$value": "{color.error.80}"
390
+ },
388
391
  "inverseOnSurface": {
389
392
  "$value": "{color.neutral.95}"
390
393
  },
@@ -558,6 +561,9 @@
558
561
  "errorContainer": {
559
562
  "$value": "{color.error.30}"
560
563
  },
564
+ "inverseError": {
565
+ "$value": "{color.error.40}"
566
+ },
561
567
  "inverseOnSurface": {
562
568
  "$value": "{color.neutral.20}"
563
569
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kanso-labs/kanso-ui",
3
- "version": "0.48.3",
3
+ "version": "0.49.0",
4
4
  "description": "A React component library built on React Aria Components primitives and styled with StyleX, with design tokens sourced from a single W3C DTCG file and compiled via Style Dictionary",
5
5
  "keywords": [
6
6
  "react",
@@ -86,7 +86,7 @@
86
86
  "@commitlint/cli": "21.2.4",
87
87
  "@commitlint/config-conventional": "21.2.4",
88
88
  "@eslint/js": "10.0.1",
89
- "@kanso-labs/kanso-ui-core": "0.1.24",
89
+ "@kanso-labs/kanso-ui-core": "0.2.0",
90
90
  "@kanso-labs/unplugin-style-dictionary": "0.10.74",
91
91
  "@microsoft/api-extractor": "7.60.1",
92
92
  "@rolldown/plugin-babel": "0.3.1",
@@ -119,7 +119,7 @@
119
119
  "lint-staged": "17.6.1",
120
120
  "oxfmt": "0.79.0",
121
121
  "oxlint": "1.94.0",
122
- "oxlint-tsgolint": "7.0.2007",
122
+ "oxlint-tsgolint": "7.0.2008",
123
123
  "playwright": "1.65.1",
124
124
  "publint": "0.3.25",
125
125
  "react": "19.3.1",