@mond-design-system/react 4.0.0 → 4.1.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.cjs +67 -23
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +33 -2
- package/dist/index.css.map +1 -1
- package/dist/index.d.cts +33 -5
- package/dist/index.d.ts +33 -5
- package/dist/index.js +67 -23
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
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,14 @@ 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
|
+
/** Drop the frame: no tray, no padding around the segments. The tray is
|
|
777
|
+
what makes the group read as a form field, and in a header bar a field
|
|
778
|
+
is what it is not. The chosen segment still carries its own surface. */
|
|
779
|
+
bare?: boolean;
|
|
771
780
|
className?: string;
|
|
772
781
|
}
|
|
773
782
|
/**
|
|
@@ -786,7 +795,7 @@ interface SegmentedControlProps<T extends string = string> {
|
|
|
786
795
|
* />
|
|
787
796
|
* ```
|
|
788
797
|
*/
|
|
789
|
-
declare function SegmentedControl<T extends string = string>({ label, options, value, onChange, disabled, fullWidth, className, }: SegmentedControlProps<T>): ReactElement;
|
|
798
|
+
declare function SegmentedControl<T extends string = string>({ label, options, value, onChange, disabled, fullWidth, size, bare, className, }: SegmentedControlProps<T>): ReactElement;
|
|
790
799
|
|
|
791
800
|
interface SearchFieldProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "type" | "size" | "value" | "onChange"> {
|
|
792
801
|
/** Accessible name. */
|
|
@@ -929,12 +938,25 @@ interface TabPanelProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
929
938
|
declare function TabPanel({ value, className, children, ...rest }: TabPanelProps): ReactElement;
|
|
930
939
|
|
|
931
940
|
type ToastTone = "neutral" | "success" | "danger";
|
|
941
|
+
interface ToastAction {
|
|
942
|
+
/** The word on the button — localise. */
|
|
943
|
+
label: string;
|
|
944
|
+
onClick: () => void;
|
|
945
|
+
}
|
|
932
946
|
interface ToastOptions {
|
|
933
947
|
title: string;
|
|
934
948
|
description?: string | undefined;
|
|
935
949
|
tone?: ToastTone | undefined;
|
|
936
950
|
/** ms until auto-dismiss. 0 = stays until dismissed. Default 5000. */
|
|
937
951
|
duration?: number | undefined;
|
|
952
|
+
/** One thing to do about the message, beside it. A toast that asks for
|
|
953
|
+
something — "Update ready", "Add to home screen" — has nowhere else to
|
|
954
|
+
put the doing. Taking it closes the toast: the message is answered. */
|
|
955
|
+
action?: ToastAction | undefined;
|
|
956
|
+
/** Fires however the toast leaves — timeout, dismiss button, or action.
|
|
957
|
+
A nudge that must remember a refusal has one place to write it down,
|
|
958
|
+
rather than three that can disagree. */
|
|
959
|
+
onDismiss?: (() => void) | undefined;
|
|
938
960
|
}
|
|
939
961
|
interface ToastContextValue {
|
|
940
962
|
toast: (options: ToastOptions) => number;
|
|
@@ -1244,7 +1266,7 @@ interface ScreenContentProps extends HTMLAttributes<HTMLElement> {
|
|
|
1244
1266
|
/** The scrollable main region of a Screen. */
|
|
1245
1267
|
declare function ScreenContent({ children, flush, className, ref, ...rest }: ScreenContentProps): react.JSX.Element;
|
|
1246
1268
|
|
|
1247
|
-
interface AppBarProps {
|
|
1269
|
+
interface AppBarProps extends Omit<HTMLAttributes<HTMLElement>, "title"> {
|
|
1248
1270
|
/** Page heading — rendered as the h1. A node is allowed for titles that
|
|
1249
1271
|
are themselves a control (e.g. a thread title that opens the event). */
|
|
1250
1272
|
title?: ReactNode;
|
|
@@ -1255,6 +1277,7 @@ interface AppBarProps {
|
|
|
1255
1277
|
leading?: ReactNode;
|
|
1256
1278
|
/** Right slot — actions. */
|
|
1257
1279
|
trailing?: ReactNode;
|
|
1280
|
+
ref?: Ref<HTMLElement>;
|
|
1258
1281
|
}
|
|
1259
1282
|
/**
|
|
1260
1283
|
* Top app bar. Sticky, one per screen; the title is the page h1.
|
|
@@ -1270,7 +1293,7 @@ interface AppBarProps {
|
|
|
1270
1293
|
* />
|
|
1271
1294
|
* ```
|
|
1272
1295
|
*/
|
|
1273
|
-
declare function AppBar({ title, subtitle, leading, trailing }: AppBarProps): react.JSX.Element;
|
|
1296
|
+
declare function AppBar({ title, subtitle, leading, trailing, className, ref, ...rest }: AppBarProps): react.JSX.Element;
|
|
1274
1297
|
|
|
1275
1298
|
interface TabBarProps {
|
|
1276
1299
|
/** Accessible name of the navigation landmark. */
|
|
@@ -1302,8 +1325,13 @@ interface TabBarItemProps {
|
|
|
1302
1325
|
/** Element override for the link, e.g. a router's Link. A bottom bar is
|
|
1303
1326
|
where a full page reload costs the most — it restarts the whole shell. */
|
|
1304
1327
|
as?: ElementType;
|
|
1328
|
+
/** Take the caption off the screen and leave it in the accessible name.
|
|
1329
|
+
For a bar whose glyphs carry the meaning: four captions on the narrowest
|
|
1330
|
+
phone wrap, and a translation twice the length of the English wraps
|
|
1331
|
+
everywhere. Hidden, never dropped — the word is the item's name. */
|
|
1332
|
+
hideLabel?: boolean | undefined;
|
|
1305
1333
|
}
|
|
1306
|
-
declare function TabBarItem({ label, icon, href, onClick, active, badge, as }: TabBarItemProps): react.JSX.Element;
|
|
1334
|
+
declare function TabBarItem({ label, icon, href, onClick, active, badge, as, hideLabel, }: TabBarItemProps): react.JSX.Element;
|
|
1307
1335
|
interface TabBarActionProps {
|
|
1308
1336
|
/** Names the action — icon-only, so this is all a screen reader gets. */
|
|
1309
1337
|
label: string;
|
|
@@ -1677,4 +1705,4 @@ interface RovingGroupOptions {
|
|
|
1677
1705
|
*/
|
|
1678
1706
|
declare function useRovingGroup(ref: RefObject<HTMLElement | null>, { selector, orientation }: RovingGroupOptions): (event: KeyboardEvent<HTMLElement>) => void;
|
|
1679
1707
|
|
|
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 };
|
|
1708
|
+
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,14 @@ 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
|
+
/** Drop the frame: no tray, no padding around the segments. The tray is
|
|
777
|
+
what makes the group read as a form field, and in a header bar a field
|
|
778
|
+
is what it is not. The chosen segment still carries its own surface. */
|
|
779
|
+
bare?: boolean;
|
|
771
780
|
className?: string;
|
|
772
781
|
}
|
|
773
782
|
/**
|
|
@@ -786,7 +795,7 @@ interface SegmentedControlProps<T extends string = string> {
|
|
|
786
795
|
* />
|
|
787
796
|
* ```
|
|
788
797
|
*/
|
|
789
|
-
declare function SegmentedControl<T extends string = string>({ label, options, value, onChange, disabled, fullWidth, className, }: SegmentedControlProps<T>): ReactElement;
|
|
798
|
+
declare function SegmentedControl<T extends string = string>({ label, options, value, onChange, disabled, fullWidth, size, bare, className, }: SegmentedControlProps<T>): ReactElement;
|
|
790
799
|
|
|
791
800
|
interface SearchFieldProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "type" | "size" | "value" | "onChange"> {
|
|
792
801
|
/** Accessible name. */
|
|
@@ -929,12 +938,25 @@ interface TabPanelProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
929
938
|
declare function TabPanel({ value, className, children, ...rest }: TabPanelProps): ReactElement;
|
|
930
939
|
|
|
931
940
|
type ToastTone = "neutral" | "success" | "danger";
|
|
941
|
+
interface ToastAction {
|
|
942
|
+
/** The word on the button — localise. */
|
|
943
|
+
label: string;
|
|
944
|
+
onClick: () => void;
|
|
945
|
+
}
|
|
932
946
|
interface ToastOptions {
|
|
933
947
|
title: string;
|
|
934
948
|
description?: string | undefined;
|
|
935
949
|
tone?: ToastTone | undefined;
|
|
936
950
|
/** ms until auto-dismiss. 0 = stays until dismissed. Default 5000. */
|
|
937
951
|
duration?: number | undefined;
|
|
952
|
+
/** One thing to do about the message, beside it. A toast that asks for
|
|
953
|
+
something — "Update ready", "Add to home screen" — has nowhere else to
|
|
954
|
+
put the doing. Taking it closes the toast: the message is answered. */
|
|
955
|
+
action?: ToastAction | undefined;
|
|
956
|
+
/** Fires however the toast leaves — timeout, dismiss button, or action.
|
|
957
|
+
A nudge that must remember a refusal has one place to write it down,
|
|
958
|
+
rather than three that can disagree. */
|
|
959
|
+
onDismiss?: (() => void) | undefined;
|
|
938
960
|
}
|
|
939
961
|
interface ToastContextValue {
|
|
940
962
|
toast: (options: ToastOptions) => number;
|
|
@@ -1244,7 +1266,7 @@ interface ScreenContentProps extends HTMLAttributes<HTMLElement> {
|
|
|
1244
1266
|
/** The scrollable main region of a Screen. */
|
|
1245
1267
|
declare function ScreenContent({ children, flush, className, ref, ...rest }: ScreenContentProps): react.JSX.Element;
|
|
1246
1268
|
|
|
1247
|
-
interface AppBarProps {
|
|
1269
|
+
interface AppBarProps extends Omit<HTMLAttributes<HTMLElement>, "title"> {
|
|
1248
1270
|
/** Page heading — rendered as the h1. A node is allowed for titles that
|
|
1249
1271
|
are themselves a control (e.g. a thread title that opens the event). */
|
|
1250
1272
|
title?: ReactNode;
|
|
@@ -1255,6 +1277,7 @@ interface AppBarProps {
|
|
|
1255
1277
|
leading?: ReactNode;
|
|
1256
1278
|
/** Right slot — actions. */
|
|
1257
1279
|
trailing?: ReactNode;
|
|
1280
|
+
ref?: Ref<HTMLElement>;
|
|
1258
1281
|
}
|
|
1259
1282
|
/**
|
|
1260
1283
|
* Top app bar. Sticky, one per screen; the title is the page h1.
|
|
@@ -1270,7 +1293,7 @@ interface AppBarProps {
|
|
|
1270
1293
|
* />
|
|
1271
1294
|
* ```
|
|
1272
1295
|
*/
|
|
1273
|
-
declare function AppBar({ title, subtitle, leading, trailing }: AppBarProps): react.JSX.Element;
|
|
1296
|
+
declare function AppBar({ title, subtitle, leading, trailing, className, ref, ...rest }: AppBarProps): react.JSX.Element;
|
|
1274
1297
|
|
|
1275
1298
|
interface TabBarProps {
|
|
1276
1299
|
/** Accessible name of the navigation landmark. */
|
|
@@ -1302,8 +1325,13 @@ interface TabBarItemProps {
|
|
|
1302
1325
|
/** Element override for the link, e.g. a router's Link. A bottom bar is
|
|
1303
1326
|
where a full page reload costs the most — it restarts the whole shell. */
|
|
1304
1327
|
as?: ElementType;
|
|
1328
|
+
/** Take the caption off the screen and leave it in the accessible name.
|
|
1329
|
+
For a bar whose glyphs carry the meaning: four captions on the narrowest
|
|
1330
|
+
phone wrap, and a translation twice the length of the English wraps
|
|
1331
|
+
everywhere. Hidden, never dropped — the word is the item's name. */
|
|
1332
|
+
hideLabel?: boolean | undefined;
|
|
1305
1333
|
}
|
|
1306
|
-
declare function TabBarItem({ label, icon, href, onClick, active, badge, as }: TabBarItemProps): react.JSX.Element;
|
|
1334
|
+
declare function TabBarItem({ label, icon, href, onClick, active, badge, as, hideLabel, }: TabBarItemProps): react.JSX.Element;
|
|
1307
1335
|
interface TabBarActionProps {
|
|
1308
1336
|
/** Names the action — icon-only, so this is all a screen reader gets. */
|
|
1309
1337
|
label: string;
|
|
@@ -1677,4 +1705,4 @@ interface RovingGroupOptions {
|
|
|
1677
1705
|
*/
|
|
1678
1706
|
declare function useRovingGroup(ref: RefObject<HTMLElement | null>, { selector, orientation }: RovingGroupOptions): (event: KeyboardEvent<HTMLElement>) => void;
|
|
1679
1707
|
|
|
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 };
|
|
1708
|
+
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", "
|
|
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,40 @@ function SegmentedControl({
|
|
|
1235
1235
|
onChange,
|
|
1236
1236
|
disabled = false,
|
|
1237
1237
|
fullWidth = false,
|
|
1238
|
+
size = "md",
|
|
1239
|
+
bare = false,
|
|
1238
1240
|
className
|
|
1239
1241
|
}) {
|
|
1240
1242
|
const name = useId();
|
|
1241
|
-
return /* @__PURE__ */ jsx(
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
className
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1243
|
+
return /* @__PURE__ */ jsx(
|
|
1244
|
+
"div",
|
|
1245
|
+
{
|
|
1246
|
+
role: "radiogroup",
|
|
1247
|
+
"aria-label": label,
|
|
1248
|
+
className: cx(
|
|
1249
|
+
SegmentedControl_module_default.group,
|
|
1250
|
+
SegmentedControl_module_default[`size-${size}`],
|
|
1251
|
+
fullWidth && SegmentedControl_module_default.fullWidth,
|
|
1252
|
+
bare && SegmentedControl_module_default.bare,
|
|
1253
|
+
className
|
|
1254
|
+
),
|
|
1255
|
+
children: options.map((option) => /* @__PURE__ */ jsxs("label", { className: SegmentedControl_module_default.segment, children: [
|
|
1256
|
+
/* @__PURE__ */ jsx(
|
|
1257
|
+
"input",
|
|
1258
|
+
{
|
|
1259
|
+
type: "radio",
|
|
1260
|
+
name,
|
|
1261
|
+
value: option.value,
|
|
1262
|
+
checked: option.value === value,
|
|
1263
|
+
onChange: () => onChange(option.value),
|
|
1264
|
+
disabled,
|
|
1265
|
+
className: SegmentedControl_module_default.input
|
|
1266
|
+
}
|
|
1267
|
+
),
|
|
1268
|
+
/* @__PURE__ */ jsx("span", { className: SegmentedControl_module_default.face, children: option.label })
|
|
1269
|
+
] }, option.value))
|
|
1270
|
+
}
|
|
1271
|
+
);
|
|
1256
1272
|
}
|
|
1257
1273
|
|
|
1258
1274
|
// mds-cssmod:/home/runner/work/mond-design-system/mond-design-system/packages/react/src/components/SearchField/SearchField.module.css?mds-scoped
|
|
@@ -1467,7 +1483,7 @@ function TabPanel({ value, className, children, ...rest }) {
|
|
|
1467
1483
|
}
|
|
1468
1484
|
|
|
1469
1485
|
// 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" };
|
|
1486
|
+
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
1487
|
var ToastContext = createContext(null);
|
|
1472
1488
|
function useToast() {
|
|
1473
1489
|
const context = useContext(ToastContext);
|
|
@@ -1481,13 +1497,20 @@ function ToastProvider({
|
|
|
1481
1497
|
}) {
|
|
1482
1498
|
const [toasts, setToasts] = useState([]);
|
|
1483
1499
|
const nextId = useRef(1);
|
|
1500
|
+
const leaving = useRef(/* @__PURE__ */ new Map());
|
|
1484
1501
|
const dismiss = useCallback((id) => {
|
|
1485
1502
|
setToasts((current) => current.filter((entry) => entry.id !== id));
|
|
1503
|
+
const said = leaving.current.get(id);
|
|
1504
|
+
if (said !== void 0) {
|
|
1505
|
+
leaving.current.delete(id);
|
|
1506
|
+
said();
|
|
1507
|
+
}
|
|
1486
1508
|
}, []);
|
|
1487
1509
|
const toast = useCallback(
|
|
1488
|
-
({ title, description, tone = "neutral", duration = 5e3 }) => {
|
|
1510
|
+
({ title, description, tone = "neutral", duration = 5e3, action, onDismiss }) => {
|
|
1489
1511
|
const id = nextId.current++;
|
|
1490
|
-
|
|
1512
|
+
if (onDismiss !== void 0) leaving.current.set(id, onDismiss);
|
|
1513
|
+
setToasts((current) => [...current, { id, title, description, tone, action }]);
|
|
1491
1514
|
if (duration > 0) setTimeout(() => dismiss(id), duration);
|
|
1492
1515
|
return id;
|
|
1493
1516
|
},
|
|
@@ -1501,6 +1524,18 @@ function ToastProvider({
|
|
|
1501
1524
|
/* @__PURE__ */ jsx("span", { className: Toast_module_default.title, children: entry.title }),
|
|
1502
1525
|
entry.description !== void 0 && /* @__PURE__ */ jsx("span", { className: Toast_module_default.description, children: entry.description })
|
|
1503
1526
|
] }),
|
|
1527
|
+
entry.action !== void 0 && /* @__PURE__ */ jsx(
|
|
1528
|
+
"button",
|
|
1529
|
+
{
|
|
1530
|
+
type: "button",
|
|
1531
|
+
className: Toast_module_default.action,
|
|
1532
|
+
onClick: () => {
|
|
1533
|
+
entry.action?.onClick();
|
|
1534
|
+
dismiss(entry.id);
|
|
1535
|
+
},
|
|
1536
|
+
children: entry.action.label
|
|
1537
|
+
}
|
|
1538
|
+
),
|
|
1504
1539
|
/* @__PURE__ */ jsx(
|
|
1505
1540
|
"button",
|
|
1506
1541
|
{
|
|
@@ -1718,9 +1753,9 @@ function ScreenContent({ children, flush = false, className, ref, ...rest }) {
|
|
|
1718
1753
|
|
|
1719
1754
|
// mds-cssmod:/home/runner/work/mond-design-system/mond-design-system/packages/react/src/components/AppBar/AppBar.module.css?mds-scoped
|
|
1720
1755
|
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 }) {
|
|
1756
|
+
function AppBar({ title, subtitle, leading, trailing, className, ref, ...rest }) {
|
|
1722
1757
|
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: [
|
|
1758
|
+
return /* @__PURE__ */ jsxs("header", { ref, className: cx(AppBar_module_default.bar, className), ...rest, children: [
|
|
1724
1759
|
leading ? /* @__PURE__ */ jsx("div", { className: AppBar_module_default.slot, children: leading }) : null,
|
|
1725
1760
|
subtitle != null ? /* @__PURE__ */ jsxs("div", { className: AppBar_module_default.text, children: [
|
|
1726
1761
|
heading,
|
|
@@ -1735,14 +1770,23 @@ var TabBar_module_default = { "bar": "mds-TabBar__bar", "item": "mds-TabBar__ite
|
|
|
1735
1770
|
function TabBar({ label, children }) {
|
|
1736
1771
|
return /* @__PURE__ */ jsx("nav", { "aria-label": label, className: TabBar_module_default.bar, children });
|
|
1737
1772
|
}
|
|
1738
|
-
function TabBarItem({
|
|
1773
|
+
function TabBarItem({
|
|
1774
|
+
label,
|
|
1775
|
+
icon,
|
|
1776
|
+
href,
|
|
1777
|
+
onClick,
|
|
1778
|
+
active = false,
|
|
1779
|
+
badge = false,
|
|
1780
|
+
as,
|
|
1781
|
+
hideLabel = false
|
|
1782
|
+
}) {
|
|
1739
1783
|
const className = cx(TabBar_module_default.item, active && TabBar_module_default.active);
|
|
1740
1784
|
const content = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1741
1785
|
/* @__PURE__ */ jsxs("span", { className: TabBar_module_default.icon, "aria-hidden": "true", children: [
|
|
1742
1786
|
icon,
|
|
1743
1787
|
badge ? /* @__PURE__ */ jsx("span", { className: TabBar_module_default.badge, "data-testid": "mds-tabbar-badge" }) : null
|
|
1744
1788
|
] }),
|
|
1745
|
-
/* @__PURE__ */ jsx("span", { className: TabBar_module_default.label, children: label })
|
|
1789
|
+
hideLabel ? /* @__PURE__ */ jsx(VisuallyHidden, { children: label }) : /* @__PURE__ */ jsx("span", { className: TabBar_module_default.label, children: label })
|
|
1746
1790
|
] });
|
|
1747
1791
|
if (href !== void 0) {
|
|
1748
1792
|
const Element = as ?? "a";
|