@mond-design-system/react 4.0.0 → 4.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.cts CHANGED
@@ -757,6 +757,7 @@ interface SegmentOption<T extends string = string> {
757
757
  value: T;
758
758
  label: string;
759
759
  }
760
+ type SegmentedControlSize = "sm" | "md";
760
761
  interface SegmentedControlProps<T extends string = string> {
761
762
  /** Accessible group name. */
762
763
  label: string;
@@ -768,6 +769,20 @@ interface SegmentedControlProps<T extends string = string> {
768
769
  /** Stretch across the container, segments sharing the width equally —
769
770
  the usual shape when the control heads a screen-wide view switch. */
770
771
  fullWidth?: boolean;
772
+ /** Control step. Default md. sm is for chrome — a switch sharing a header
773
+ bar with an avatar and a menu, where the medium step is the tallest
774
+ thing up there. */
775
+ size?: SegmentedControlSize;
776
+ /** Report the segment already chosen being picked again. Off by default:
777
+ a radio only fires when its checked state changes, and for most choices
778
+ that is the whole story. Turn it on where confirming the value on screen
779
+ is itself an act — pinning a language that until now was inferred from
780
+ the browser, so it stops following it. */
781
+ repick?: boolean;
782
+ /** Drop the frame: no tray, no padding around the segments. The tray is
783
+ what makes the group read as a form field, and in a header bar a field
784
+ is what it is not. The chosen segment still carries its own surface. */
785
+ bare?: boolean;
771
786
  className?: string;
772
787
  }
773
788
  /**
@@ -786,7 +801,7 @@ interface SegmentedControlProps<T extends string = string> {
786
801
  * />
787
802
  * ```
788
803
  */
789
- declare function SegmentedControl<T extends string = string>({ label, options, value, onChange, disabled, fullWidth, className, }: SegmentedControlProps<T>): ReactElement;
804
+ declare function SegmentedControl<T extends string = string>({ label, options, value, onChange, disabled, fullWidth, size, bare, repick, className, }: SegmentedControlProps<T>): ReactElement;
790
805
 
791
806
  interface SearchFieldProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "type" | "size" | "value" | "onChange"> {
792
807
  /** Accessible name. */
@@ -929,12 +944,25 @@ interface TabPanelProps extends HTMLAttributes<HTMLDivElement> {
929
944
  declare function TabPanel({ value, className, children, ...rest }: TabPanelProps): ReactElement;
930
945
 
931
946
  type ToastTone = "neutral" | "success" | "danger";
947
+ interface ToastAction {
948
+ /** The word on the button — localise. */
949
+ label: string;
950
+ onClick: () => void;
951
+ }
932
952
  interface ToastOptions {
933
953
  title: string;
934
954
  description?: string | undefined;
935
955
  tone?: ToastTone | undefined;
936
956
  /** ms until auto-dismiss. 0 = stays until dismissed. Default 5000. */
937
957
  duration?: number | undefined;
958
+ /** One thing to do about the message, beside it. A toast that asks for
959
+ something — "Update ready", "Add to home screen" — has nowhere else to
960
+ put the doing. Taking it closes the toast: the message is answered. */
961
+ action?: ToastAction | undefined;
962
+ /** Fires however the toast leaves — timeout, dismiss button, or action.
963
+ A nudge that must remember a refusal has one place to write it down,
964
+ rather than three that can disagree. */
965
+ onDismiss?: (() => void) | undefined;
938
966
  }
939
967
  interface ToastContextValue {
940
968
  toast: (options: ToastOptions) => number;
@@ -1244,7 +1272,7 @@ interface ScreenContentProps extends HTMLAttributes<HTMLElement> {
1244
1272
  /** The scrollable main region of a Screen. */
1245
1273
  declare function ScreenContent({ children, flush, className, ref, ...rest }: ScreenContentProps): react.JSX.Element;
1246
1274
 
1247
- interface AppBarProps {
1275
+ interface AppBarProps extends Omit<HTMLAttributes<HTMLElement>, "title"> {
1248
1276
  /** Page heading — rendered as the h1. A node is allowed for titles that
1249
1277
  are themselves a control (e.g. a thread title that opens the event). */
1250
1278
  title?: ReactNode;
@@ -1255,6 +1283,7 @@ interface AppBarProps {
1255
1283
  leading?: ReactNode;
1256
1284
  /** Right slot — actions. */
1257
1285
  trailing?: ReactNode;
1286
+ ref?: Ref<HTMLElement>;
1258
1287
  }
1259
1288
  /**
1260
1289
  * Top app bar. Sticky, one per screen; the title is the page h1.
@@ -1270,7 +1299,7 @@ interface AppBarProps {
1270
1299
  * />
1271
1300
  * ```
1272
1301
  */
1273
- declare function AppBar({ title, subtitle, leading, trailing }: AppBarProps): react.JSX.Element;
1302
+ declare function AppBar({ title, subtitle, leading, trailing, className, ref, ...rest }: AppBarProps): react.JSX.Element;
1274
1303
 
1275
1304
  interface TabBarProps {
1276
1305
  /** Accessible name of the navigation landmark. */
@@ -1302,8 +1331,13 @@ interface TabBarItemProps {
1302
1331
  /** Element override for the link, e.g. a router's Link. A bottom bar is
1303
1332
  where a full page reload costs the most — it restarts the whole shell. */
1304
1333
  as?: ElementType;
1334
+ /** Take the caption off the screen and leave it in the accessible name.
1335
+ For a bar whose glyphs carry the meaning: four captions on the narrowest
1336
+ phone wrap, and a translation twice the length of the English wraps
1337
+ everywhere. Hidden, never dropped — the word is the item's name. */
1338
+ hideLabel?: boolean | undefined;
1305
1339
  }
1306
- declare function TabBarItem({ label, icon, href, onClick, active, badge, as }: TabBarItemProps): react.JSX.Element;
1340
+ declare function TabBarItem({ label, icon, href, onClick, active, badge, as, hideLabel, }: TabBarItemProps): react.JSX.Element;
1307
1341
  interface TabBarActionProps {
1308
1342
  /** Names the action — icon-only, so this is all a screen reader gets. */
1309
1343
  label: string;
@@ -1677,4 +1711,4 @@ interface RovingGroupOptions {
1677
1711
  */
1678
1712
  declare function useRovingGroup(ref: RefObject<HTMLElement | null>, { selector, orientation }: RovingGroupOptions): (event: KeyboardEvent<HTMLElement>) => void;
1679
1713
 
1680
- export { AppBar, type AppBarProps, Avatar, AvatarGroup, type AvatarGroupProps, type AvatarProps, type AvatarSize, Badge, type BadgeProps, type BadgeTone, Breadcrumb, type BreadcrumbProps, Button, type ButtonProps, type ButtonShape, type ButtonSize, type ButtonVariant, type CSSVars, Card, CardBody, CardFooter, CardHeader, type CardProps, type CardSectionProps, type CardVariant, type CarouselPager, type CarouselSlide, Checkbox, type CheckboxProps, Chip, ChipBar, type ChipBarGap, type ChipBarProps, ChipGroup, type ChipGroupGap, type ChipGroupProps, type ChipProps, type ChipVariant, ConfirmDialog, type ConfirmDialogProps, type ConfirmDialogTone, Container, type ContainerProps, type ContainerWidth, CountButton, type CountButtonProps, type CountButtonTone, type Crumb, DateTimePicker, type DateTimePickerLabels, type DateTimePickerProps, Divider, type DividerProps, EmptyState, type EmptyStateProps, Field, type FieldContextValue, type FieldProps, Heading, type HeadingLevel, type HeadingProps, type HeadingTone, Icon, type IconProps, IconProvider, type IconProviderProps, type IconRender, type IconRenderProps, type IconSize, ImageCarousel, type ImageCarouselLabels, type ImageCarouselProps, Inline, type InlineAlign, type InlineGap, type InlineJustify, type InlineProps, Input, type InputProps, type InputSize, Lightbox, type LightboxLabels, type LightboxProps, Link, type LinkProps, type LinkVariant, ListGroup, type ListGroupProps, ListItem, type ListItemProps, MediaPlaceholder, type MediaPlaceholderProps, Modal, ModalBody, ModalFooter, ModalHeader, type ModalProps, type OverlayHistory, OverlayHistoryContext, PasswordInput, type PasswordInputProps, type Presence, ProgressBar, type ProgressBarProps, Radio, type RadioProps, type RovingGroupOptions, Screen, ScreenContent, type ScreenContentProps, SearchField, type SearchFieldProps, type SegmentOption, SegmentedControl, type SegmentedControlProps, Select, type SelectProps, type SelectSize, Sheet, SheetBody, SheetFooter, SheetHeader, type SheetProps, Skeleton, type SkeletonProps, type SkeletonVariant, Spinner, type SpinnerProps, Stack, type StackAlign, type StackGap, type StackProps, Switch, type SwitchProps, Tab, TabBar, TabBarAction, type TabBarActionProps, TabBarItem, type TabBarItemProps, type TabBarProps, TabList, type TabListProps, TabPanel, type TabPanelProps, type TabProps, Tabs, type TabsProps, Tag, type TagProps, type TagTone, Text, type TextProps, type TextTone, type TextVariant, Textarea, type TextareaProps, type ToastOptions, ToastProvider, type ToastProviderProps, type ToastTone, UploadProgress, type UploadProgressLabels, type UploadProgressProps, type UploadStatus, type UseOverlayOptions, type VideoCaptions, type VideoChapter, VideoPlayer, type VideoPlayerLabels, type VideoPlayerProps, VisuallyHidden, type VisuallyHiddenProps, cx, useFieldContext, useOverlay, usePresence, useRovingGroup, useToast };
1714
+ export { AppBar, type AppBarProps, Avatar, AvatarGroup, type AvatarGroupProps, type AvatarProps, type AvatarSize, Badge, type BadgeProps, type BadgeTone, Breadcrumb, type BreadcrumbProps, Button, type ButtonProps, type ButtonShape, type ButtonSize, type ButtonVariant, type CSSVars, Card, CardBody, CardFooter, CardHeader, type CardProps, type CardSectionProps, type CardVariant, type CarouselPager, type CarouselSlide, Checkbox, type CheckboxProps, Chip, ChipBar, type ChipBarGap, type ChipBarProps, ChipGroup, type ChipGroupGap, type ChipGroupProps, type ChipProps, type ChipVariant, ConfirmDialog, type ConfirmDialogProps, type ConfirmDialogTone, Container, type ContainerProps, type ContainerWidth, CountButton, type CountButtonProps, type CountButtonTone, type Crumb, DateTimePicker, type DateTimePickerLabels, type DateTimePickerProps, Divider, type DividerProps, EmptyState, type EmptyStateProps, Field, type FieldContextValue, type FieldProps, Heading, type HeadingLevel, type HeadingProps, type HeadingTone, Icon, type IconProps, IconProvider, type IconProviderProps, type IconRender, type IconRenderProps, type IconSize, ImageCarousel, type ImageCarouselLabels, type ImageCarouselProps, Inline, type InlineAlign, type InlineGap, type InlineJustify, type InlineProps, Input, type InputProps, type InputSize, Lightbox, type LightboxLabels, type LightboxProps, Link, type LinkProps, type LinkVariant, ListGroup, type ListGroupProps, ListItem, type ListItemProps, MediaPlaceholder, type MediaPlaceholderProps, Modal, ModalBody, ModalFooter, ModalHeader, type ModalProps, type OverlayHistory, OverlayHistoryContext, PasswordInput, type PasswordInputProps, type Presence, ProgressBar, type ProgressBarProps, Radio, type RadioProps, type RovingGroupOptions, Screen, ScreenContent, type ScreenContentProps, SearchField, type SearchFieldProps, type SegmentOption, SegmentedControl, type SegmentedControlProps, type SegmentedControlSize, Select, type SelectProps, type SelectSize, Sheet, SheetBody, SheetFooter, SheetHeader, type SheetProps, Skeleton, type SkeletonProps, type SkeletonVariant, Spinner, type SpinnerProps, Stack, type StackAlign, type StackGap, type StackProps, Switch, type SwitchProps, Tab, TabBar, TabBarAction, type TabBarActionProps, TabBarItem, type TabBarItemProps, type TabBarProps, TabList, type TabListProps, TabPanel, type TabPanelProps, type TabProps, Tabs, type TabsProps, Tag, type TagProps, type TagTone, Text, type TextProps, type TextTone, type TextVariant, Textarea, type TextareaProps, type ToastAction, type ToastOptions, ToastProvider, type ToastProviderProps, type ToastTone, UploadProgress, type UploadProgressLabels, type UploadProgressProps, type UploadStatus, type UseOverlayOptions, type VideoCaptions, type VideoChapter, VideoPlayer, type VideoPlayerLabels, type VideoPlayerProps, VisuallyHidden, type VisuallyHiddenProps, cx, useFieldContext, useOverlay, usePresence, useRovingGroup, useToast };
package/dist/index.d.ts CHANGED
@@ -757,6 +757,7 @@ interface SegmentOption<T extends string = string> {
757
757
  value: T;
758
758
  label: string;
759
759
  }
760
+ type SegmentedControlSize = "sm" | "md";
760
761
  interface SegmentedControlProps<T extends string = string> {
761
762
  /** Accessible group name. */
762
763
  label: string;
@@ -768,6 +769,20 @@ interface SegmentedControlProps<T extends string = string> {
768
769
  /** Stretch across the container, segments sharing the width equally —
769
770
  the usual shape when the control heads a screen-wide view switch. */
770
771
  fullWidth?: boolean;
772
+ /** Control step. Default md. sm is for chrome — a switch sharing a header
773
+ bar with an avatar and a menu, where the medium step is the tallest
774
+ thing up there. */
775
+ size?: SegmentedControlSize;
776
+ /** Report the segment already chosen being picked again. Off by default:
777
+ a radio only fires when its checked state changes, and for most choices
778
+ that is the whole story. Turn it on where confirming the value on screen
779
+ is itself an act — pinning a language that until now was inferred from
780
+ the browser, so it stops following it. */
781
+ repick?: boolean;
782
+ /** Drop the frame: no tray, no padding around the segments. The tray is
783
+ what makes the group read as a form field, and in a header bar a field
784
+ is what it is not. The chosen segment still carries its own surface. */
785
+ bare?: boolean;
771
786
  className?: string;
772
787
  }
773
788
  /**
@@ -786,7 +801,7 @@ interface SegmentedControlProps<T extends string = string> {
786
801
  * />
787
802
  * ```
788
803
  */
789
- declare function SegmentedControl<T extends string = string>({ label, options, value, onChange, disabled, fullWidth, className, }: SegmentedControlProps<T>): ReactElement;
804
+ declare function SegmentedControl<T extends string = string>({ label, options, value, onChange, disabled, fullWidth, size, bare, repick, className, }: SegmentedControlProps<T>): ReactElement;
790
805
 
791
806
  interface SearchFieldProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "type" | "size" | "value" | "onChange"> {
792
807
  /** Accessible name. */
@@ -929,12 +944,25 @@ interface TabPanelProps extends HTMLAttributes<HTMLDivElement> {
929
944
  declare function TabPanel({ value, className, children, ...rest }: TabPanelProps): ReactElement;
930
945
 
931
946
  type ToastTone = "neutral" | "success" | "danger";
947
+ interface ToastAction {
948
+ /** The word on the button — localise. */
949
+ label: string;
950
+ onClick: () => void;
951
+ }
932
952
  interface ToastOptions {
933
953
  title: string;
934
954
  description?: string | undefined;
935
955
  tone?: ToastTone | undefined;
936
956
  /** ms until auto-dismiss. 0 = stays until dismissed. Default 5000. */
937
957
  duration?: number | undefined;
958
+ /** One thing to do about the message, beside it. A toast that asks for
959
+ something — "Update ready", "Add to home screen" — has nowhere else to
960
+ put the doing. Taking it closes the toast: the message is answered. */
961
+ action?: ToastAction | undefined;
962
+ /** Fires however the toast leaves — timeout, dismiss button, or action.
963
+ A nudge that must remember a refusal has one place to write it down,
964
+ rather than three that can disagree. */
965
+ onDismiss?: (() => void) | undefined;
938
966
  }
939
967
  interface ToastContextValue {
940
968
  toast: (options: ToastOptions) => number;
@@ -1244,7 +1272,7 @@ interface ScreenContentProps extends HTMLAttributes<HTMLElement> {
1244
1272
  /** The scrollable main region of a Screen. */
1245
1273
  declare function ScreenContent({ children, flush, className, ref, ...rest }: ScreenContentProps): react.JSX.Element;
1246
1274
 
1247
- interface AppBarProps {
1275
+ interface AppBarProps extends Omit<HTMLAttributes<HTMLElement>, "title"> {
1248
1276
  /** Page heading — rendered as the h1. A node is allowed for titles that
1249
1277
  are themselves a control (e.g. a thread title that opens the event). */
1250
1278
  title?: ReactNode;
@@ -1255,6 +1283,7 @@ interface AppBarProps {
1255
1283
  leading?: ReactNode;
1256
1284
  /** Right slot — actions. */
1257
1285
  trailing?: ReactNode;
1286
+ ref?: Ref<HTMLElement>;
1258
1287
  }
1259
1288
  /**
1260
1289
  * Top app bar. Sticky, one per screen; the title is the page h1.
@@ -1270,7 +1299,7 @@ interface AppBarProps {
1270
1299
  * />
1271
1300
  * ```
1272
1301
  */
1273
- declare function AppBar({ title, subtitle, leading, trailing }: AppBarProps): react.JSX.Element;
1302
+ declare function AppBar({ title, subtitle, leading, trailing, className, ref, ...rest }: AppBarProps): react.JSX.Element;
1274
1303
 
1275
1304
  interface TabBarProps {
1276
1305
  /** Accessible name of the navigation landmark. */
@@ -1302,8 +1331,13 @@ interface TabBarItemProps {
1302
1331
  /** Element override for the link, e.g. a router's Link. A bottom bar is
1303
1332
  where a full page reload costs the most — it restarts the whole shell. */
1304
1333
  as?: ElementType;
1334
+ /** Take the caption off the screen and leave it in the accessible name.
1335
+ For a bar whose glyphs carry the meaning: four captions on the narrowest
1336
+ phone wrap, and a translation twice the length of the English wraps
1337
+ everywhere. Hidden, never dropped — the word is the item's name. */
1338
+ hideLabel?: boolean | undefined;
1305
1339
  }
1306
- declare function TabBarItem({ label, icon, href, onClick, active, badge, as }: TabBarItemProps): react.JSX.Element;
1340
+ declare function TabBarItem({ label, icon, href, onClick, active, badge, as, hideLabel, }: TabBarItemProps): react.JSX.Element;
1307
1341
  interface TabBarActionProps {
1308
1342
  /** Names the action — icon-only, so this is all a screen reader gets. */
1309
1343
  label: string;
@@ -1677,4 +1711,4 @@ interface RovingGroupOptions {
1677
1711
  */
1678
1712
  declare function useRovingGroup(ref: RefObject<HTMLElement | null>, { selector, orientation }: RovingGroupOptions): (event: KeyboardEvent<HTMLElement>) => void;
1679
1713
 
1680
- export { AppBar, type AppBarProps, Avatar, AvatarGroup, type AvatarGroupProps, type AvatarProps, type AvatarSize, Badge, type BadgeProps, type BadgeTone, Breadcrumb, type BreadcrumbProps, Button, type ButtonProps, type ButtonShape, type ButtonSize, type ButtonVariant, type CSSVars, Card, CardBody, CardFooter, CardHeader, type CardProps, type CardSectionProps, type CardVariant, type CarouselPager, type CarouselSlide, Checkbox, type CheckboxProps, Chip, ChipBar, type ChipBarGap, type ChipBarProps, ChipGroup, type ChipGroupGap, type ChipGroupProps, type ChipProps, type ChipVariant, ConfirmDialog, type ConfirmDialogProps, type ConfirmDialogTone, Container, type ContainerProps, type ContainerWidth, CountButton, type CountButtonProps, type CountButtonTone, type Crumb, DateTimePicker, type DateTimePickerLabels, type DateTimePickerProps, Divider, type DividerProps, EmptyState, type EmptyStateProps, Field, type FieldContextValue, type FieldProps, Heading, type HeadingLevel, type HeadingProps, type HeadingTone, Icon, type IconProps, IconProvider, type IconProviderProps, type IconRender, type IconRenderProps, type IconSize, ImageCarousel, type ImageCarouselLabels, type ImageCarouselProps, Inline, type InlineAlign, type InlineGap, type InlineJustify, type InlineProps, Input, type InputProps, type InputSize, Lightbox, type LightboxLabels, type LightboxProps, Link, type LinkProps, type LinkVariant, ListGroup, type ListGroupProps, ListItem, type ListItemProps, MediaPlaceholder, type MediaPlaceholderProps, Modal, ModalBody, ModalFooter, ModalHeader, type ModalProps, type OverlayHistory, OverlayHistoryContext, PasswordInput, type PasswordInputProps, type Presence, ProgressBar, type ProgressBarProps, Radio, type RadioProps, type RovingGroupOptions, Screen, ScreenContent, type ScreenContentProps, SearchField, type SearchFieldProps, type SegmentOption, SegmentedControl, type SegmentedControlProps, Select, type SelectProps, type SelectSize, Sheet, SheetBody, SheetFooter, SheetHeader, type SheetProps, Skeleton, type SkeletonProps, type SkeletonVariant, Spinner, type SpinnerProps, Stack, type StackAlign, type StackGap, type StackProps, Switch, type SwitchProps, Tab, TabBar, TabBarAction, type TabBarActionProps, TabBarItem, type TabBarItemProps, type TabBarProps, TabList, type TabListProps, TabPanel, type TabPanelProps, type TabProps, Tabs, type TabsProps, Tag, type TagProps, type TagTone, Text, type TextProps, type TextTone, type TextVariant, Textarea, type TextareaProps, type ToastOptions, ToastProvider, type ToastProviderProps, type ToastTone, UploadProgress, type UploadProgressLabels, type UploadProgressProps, type UploadStatus, type UseOverlayOptions, type VideoCaptions, type VideoChapter, VideoPlayer, type VideoPlayerLabels, type VideoPlayerProps, VisuallyHidden, type VisuallyHiddenProps, cx, useFieldContext, useOverlay, usePresence, useRovingGroup, useToast };
1714
+ export { AppBar, type AppBarProps, Avatar, AvatarGroup, type AvatarGroupProps, type AvatarProps, type AvatarSize, Badge, type BadgeProps, type BadgeTone, Breadcrumb, type BreadcrumbProps, Button, type ButtonProps, type ButtonShape, type ButtonSize, type ButtonVariant, type CSSVars, Card, CardBody, CardFooter, CardHeader, type CardProps, type CardSectionProps, type CardVariant, type CarouselPager, type CarouselSlide, Checkbox, type CheckboxProps, Chip, ChipBar, type ChipBarGap, type ChipBarProps, ChipGroup, type ChipGroupGap, type ChipGroupProps, type ChipProps, type ChipVariant, ConfirmDialog, type ConfirmDialogProps, type ConfirmDialogTone, Container, type ContainerProps, type ContainerWidth, CountButton, type CountButtonProps, type CountButtonTone, type Crumb, DateTimePicker, type DateTimePickerLabels, type DateTimePickerProps, Divider, type DividerProps, EmptyState, type EmptyStateProps, Field, type FieldContextValue, type FieldProps, Heading, type HeadingLevel, type HeadingProps, type HeadingTone, Icon, type IconProps, IconProvider, type IconProviderProps, type IconRender, type IconRenderProps, type IconSize, ImageCarousel, type ImageCarouselLabels, type ImageCarouselProps, Inline, type InlineAlign, type InlineGap, type InlineJustify, type InlineProps, Input, type InputProps, type InputSize, Lightbox, type LightboxLabels, type LightboxProps, Link, type LinkProps, type LinkVariant, ListGroup, type ListGroupProps, ListItem, type ListItemProps, MediaPlaceholder, type MediaPlaceholderProps, Modal, ModalBody, ModalFooter, ModalHeader, type ModalProps, type OverlayHistory, OverlayHistoryContext, PasswordInput, type PasswordInputProps, type Presence, ProgressBar, type ProgressBarProps, Radio, type RadioProps, type RovingGroupOptions, Screen, ScreenContent, type ScreenContentProps, SearchField, type SearchFieldProps, type SegmentOption, SegmentedControl, type SegmentedControlProps, type SegmentedControlSize, Select, type SelectProps, type SelectSize, Sheet, SheetBody, SheetFooter, SheetHeader, type SheetProps, Skeleton, type SkeletonProps, type SkeletonVariant, Spinner, type SpinnerProps, Stack, type StackAlign, type StackGap, type StackProps, Switch, type SwitchProps, Tab, TabBar, TabBarAction, type TabBarActionProps, TabBarItem, type TabBarItemProps, type TabBarProps, TabList, type TabListProps, TabPanel, type TabPanelProps, type TabProps, Tabs, type TabsProps, Tag, type TagProps, type TagTone, Text, type TextProps, type TextTone, type TextVariant, Textarea, type TextareaProps, type ToastAction, type ToastOptions, ToastProvider, type ToastProviderProps, type ToastTone, UploadProgress, type UploadProgressLabels, type UploadProgressProps, type UploadStatus, type UseOverlayOptions, type VideoCaptions, type VideoChapter, VideoPlayer, type VideoPlayerLabels, type VideoPlayerProps, VisuallyHidden, type VisuallyHiddenProps, cx, useFieldContext, useOverlay, usePresence, useRovingGroup, useToast };
package/dist/index.js CHANGED
@@ -1227,7 +1227,7 @@ function Switch({
1227
1227
  }
1228
1228
 
1229
1229
  // mds-cssmod:/home/runner/work/mond-design-system/mond-design-system/packages/react/src/components/SegmentedControl/SegmentedControl.module.css?mds-scoped
1230
- var SegmentedControl_module_default = { "group": "mds-SegmentedControl__group", "segment": "mds-SegmentedControl__segment", "fullWidth": "mds-SegmentedControl__fullWidth", "face": "mds-SegmentedControl__face", "input": "mds-SegmentedControl__input" };
1230
+ var SegmentedControl_module_default = { "group": "mds-SegmentedControl__group", "size-md": "mds-SegmentedControl__size-md", "face": "mds-SegmentedControl__face", "size-sm": "mds-SegmentedControl__size-sm", "bare": "mds-SegmentedControl__bare", "segment": "mds-SegmentedControl__segment", "fullWidth": "mds-SegmentedControl__fullWidth", "input": "mds-SegmentedControl__input" };
1231
1231
  function SegmentedControl({
1232
1232
  label,
1233
1233
  options,
@@ -1235,24 +1235,42 @@ function SegmentedControl({
1235
1235
  onChange,
1236
1236
  disabled = false,
1237
1237
  fullWidth = false,
1238
+ size = "md",
1239
+ bare = false,
1240
+ repick = false,
1238
1241
  className
1239
1242
  }) {
1240
1243
  const name = useId();
1241
- return /* @__PURE__ */ jsx("div", { role: "radiogroup", "aria-label": label, className: cx(SegmentedControl_module_default.group, fullWidth && SegmentedControl_module_default.fullWidth, className), children: options.map((option) => /* @__PURE__ */ jsxs("label", { className: SegmentedControl_module_default.segment, children: [
1242
- /* @__PURE__ */ jsx(
1243
- "input",
1244
- {
1245
- type: "radio",
1246
- name,
1247
- value: option.value,
1248
- checked: option.value === value,
1249
- onChange: () => onChange(option.value),
1250
- disabled,
1251
- className: SegmentedControl_module_default.input
1252
- }
1253
- ),
1254
- /* @__PURE__ */ jsx("span", { className: SegmentedControl_module_default.face, children: option.label })
1255
- ] }, option.value)) });
1244
+ return /* @__PURE__ */ jsx(
1245
+ "div",
1246
+ {
1247
+ role: "radiogroup",
1248
+ "aria-label": label,
1249
+ className: cx(
1250
+ SegmentedControl_module_default.group,
1251
+ SegmentedControl_module_default[`size-${size}`],
1252
+ fullWidth && SegmentedControl_module_default.fullWidth,
1253
+ bare && SegmentedControl_module_default.bare,
1254
+ className
1255
+ ),
1256
+ children: options.map((option) => /* @__PURE__ */ jsxs("label", { className: SegmentedControl_module_default.segment, children: [
1257
+ /* @__PURE__ */ jsx(
1258
+ "input",
1259
+ {
1260
+ type: "radio",
1261
+ name,
1262
+ value: option.value,
1263
+ checked: option.value === value,
1264
+ onChange: () => onChange(option.value),
1265
+ onClick: repick && option.value === value ? () => onChange(option.value) : void 0,
1266
+ disabled,
1267
+ className: SegmentedControl_module_default.input
1268
+ }
1269
+ ),
1270
+ /* @__PURE__ */ jsx("span", { className: SegmentedControl_module_default.face, children: option.label })
1271
+ ] }, option.value))
1272
+ }
1273
+ );
1256
1274
  }
1257
1275
 
1258
1276
  // mds-cssmod:/home/runner/work/mond-design-system/mond-design-system/packages/react/src/components/SearchField/SearchField.module.css?mds-scoped
@@ -1467,7 +1485,7 @@ function TabPanel({ value, className, children, ...rest }) {
1467
1485
  }
1468
1486
 
1469
1487
  // mds-cssmod:/home/runner/work/mond-design-system/mond-design-system/packages/react/src/components/Toast/Toast.module.css?mds-scoped
1470
- var Toast_module_default = { "viewport": "mds-Toast__viewport", "toast": "mds-Toast__toast", "tone-success": "mds-Toast__tone-success", "tone-danger": "mds-Toast__tone-danger", "body": "mds-Toast__body", "title": "mds-Toast__title", "description": "mds-Toast__description", "close": "mds-Toast__close mds-hit-area__hitArea", "closeGlyph": "mds-Toast__closeGlyph" };
1488
+ var Toast_module_default = { "viewport": "mds-Toast__viewport", "toast": "mds-Toast__toast", "tone-success": "mds-Toast__tone-success", "tone-danger": "mds-Toast__tone-danger", "body": "mds-Toast__body", "title": "mds-Toast__title", "description": "mds-Toast__description", "close": "mds-Toast__close mds-hit-area__hitArea", "closeGlyph": "mds-Toast__closeGlyph", "action": "mds-Toast__action mds-hit-area__hitArea" };
1471
1489
  var ToastContext = createContext(null);
1472
1490
  function useToast() {
1473
1491
  const context = useContext(ToastContext);
@@ -1481,13 +1499,20 @@ function ToastProvider({
1481
1499
  }) {
1482
1500
  const [toasts, setToasts] = useState([]);
1483
1501
  const nextId = useRef(1);
1502
+ const leaving = useRef(/* @__PURE__ */ new Map());
1484
1503
  const dismiss = useCallback((id) => {
1485
1504
  setToasts((current) => current.filter((entry) => entry.id !== id));
1505
+ const said = leaving.current.get(id);
1506
+ if (said !== void 0) {
1507
+ leaving.current.delete(id);
1508
+ said();
1509
+ }
1486
1510
  }, []);
1487
1511
  const toast = useCallback(
1488
- ({ title, description, tone = "neutral", duration = 5e3 }) => {
1512
+ ({ title, description, tone = "neutral", duration = 5e3, action, onDismiss }) => {
1489
1513
  const id = nextId.current++;
1490
- setToasts((current) => [...current, { id, title, description, tone }]);
1514
+ if (onDismiss !== void 0) leaving.current.set(id, onDismiss);
1515
+ setToasts((current) => [...current, { id, title, description, tone, action }]);
1491
1516
  if (duration > 0) setTimeout(() => dismiss(id), duration);
1492
1517
  return id;
1493
1518
  },
@@ -1501,6 +1526,18 @@ function ToastProvider({
1501
1526
  /* @__PURE__ */ jsx("span", { className: Toast_module_default.title, children: entry.title }),
1502
1527
  entry.description !== void 0 && /* @__PURE__ */ jsx("span", { className: Toast_module_default.description, children: entry.description })
1503
1528
  ] }),
1529
+ entry.action !== void 0 && /* @__PURE__ */ jsx(
1530
+ "button",
1531
+ {
1532
+ type: "button",
1533
+ className: Toast_module_default.action,
1534
+ onClick: () => {
1535
+ entry.action?.onClick();
1536
+ dismiss(entry.id);
1537
+ },
1538
+ children: entry.action.label
1539
+ }
1540
+ ),
1504
1541
  /* @__PURE__ */ jsx(
1505
1542
  "button",
1506
1543
  {
@@ -1718,9 +1755,9 @@ function ScreenContent({ children, flush = false, className, ref, ...rest }) {
1718
1755
 
1719
1756
  // mds-cssmod:/home/runner/work/mond-design-system/mond-design-system/packages/react/src/components/AppBar/AppBar.module.css?mds-scoped
1720
1757
  var AppBar_module_default = { "bar": "mds-AppBar__bar", "title": "mds-AppBar__title", "text": "mds-AppBar__text", "subtitle": "mds-AppBar__subtitle", "slot": "mds-AppBar__slot", "trailing": "mds-AppBar__trailing" };
1721
- function AppBar({ title, subtitle, leading, trailing }) {
1758
+ function AppBar({ title, subtitle, leading, trailing, className, ref, ...rest }) {
1722
1759
  const heading = title ? /* @__PURE__ */ jsx("h1", { className: AppBar_module_default.title, children: title }) : null;
1723
- return /* @__PURE__ */ jsxs("header", { className: AppBar_module_default.bar, children: [
1760
+ return /* @__PURE__ */ jsxs("header", { ref, className: cx(AppBar_module_default.bar, className), ...rest, children: [
1724
1761
  leading ? /* @__PURE__ */ jsx("div", { className: AppBar_module_default.slot, children: leading }) : null,
1725
1762
  subtitle != null ? /* @__PURE__ */ jsxs("div", { className: AppBar_module_default.text, children: [
1726
1763
  heading,
@@ -1735,14 +1772,23 @@ var TabBar_module_default = { "bar": "mds-TabBar__bar", "item": "mds-TabBar__ite
1735
1772
  function TabBar({ label, children }) {
1736
1773
  return /* @__PURE__ */ jsx("nav", { "aria-label": label, className: TabBar_module_default.bar, children });
1737
1774
  }
1738
- function TabBarItem({ label, icon, href, onClick, active = false, badge = false, as }) {
1775
+ function TabBarItem({
1776
+ label,
1777
+ icon,
1778
+ href,
1779
+ onClick,
1780
+ active = false,
1781
+ badge = false,
1782
+ as,
1783
+ hideLabel = false
1784
+ }) {
1739
1785
  const className = cx(TabBar_module_default.item, active && TabBar_module_default.active);
1740
1786
  const content = /* @__PURE__ */ jsxs(Fragment, { children: [
1741
1787
  /* @__PURE__ */ jsxs("span", { className: TabBar_module_default.icon, "aria-hidden": "true", children: [
1742
1788
  icon,
1743
1789
  badge ? /* @__PURE__ */ jsx("span", { className: TabBar_module_default.badge, "data-testid": "mds-tabbar-badge" }) : null
1744
1790
  ] }),
1745
- /* @__PURE__ */ jsx("span", { className: TabBar_module_default.label, children: label })
1791
+ hideLabel ? /* @__PURE__ */ jsx(VisuallyHidden, { children: label }) : /* @__PURE__ */ jsx("span", { className: TabBar_module_default.label, children: label })
1746
1792
  ] });
1747
1793
  if (href !== void 0) {
1748
1794
  const Element = as ?? "a";