@mond-design-system/react 4.8.0 → 4.10.1
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/README.md +2 -1
- package/dist/index.cjs +168 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +87 -0
- package/dist/index.css.map +1 -1
- package/dist/index.d.cts +70 -3
- package/dist/index.d.ts +70 -3
- package/dist/index.js +167 -6
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.d.cts
CHANGED
|
@@ -840,6 +840,37 @@ interface SearchFieldProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "
|
|
|
840
840
|
*/
|
|
841
841
|
declare function SearchField({ label, clearLabel, value, onChange, className, ...rest }: SearchFieldProps): ReactElement;
|
|
842
842
|
|
|
843
|
+
interface ScrollerLabels {
|
|
844
|
+
previous: string;
|
|
845
|
+
next: string;
|
|
846
|
+
}
|
|
847
|
+
interface ScrollerProps extends Omit<HTMLAttributes<HTMLElement>, "title"> {
|
|
848
|
+
/** Words over the row. They name the scrolling group too. */
|
|
849
|
+
title: string;
|
|
850
|
+
/** The arrows are glyphs, so the words are the app's. */
|
|
851
|
+
labels: ScrollerLabels;
|
|
852
|
+
/** Where the title sits in the document outline. Default 2. */
|
|
853
|
+
level?: HeadingLevel;
|
|
854
|
+
/** Beside the title, before the arrows — a link to the rest. */
|
|
855
|
+
action?: ReactNode;
|
|
856
|
+
children: ReactNode;
|
|
857
|
+
ref?: Ref<HTMLElement>;
|
|
858
|
+
}
|
|
859
|
+
/**
|
|
860
|
+
* A titled row that scrolls sideways — featured posts, a shelf of covers.
|
|
861
|
+
* The row scrolls with the finger; the arrows do the same for a pointer or a
|
|
862
|
+
* key, and shut themselves at each end.
|
|
863
|
+
*
|
|
864
|
+
* ```tsx
|
|
865
|
+
* <Scroller title={t("home.featured")} labels={t.scroller}>
|
|
866
|
+
* {slots.map((slot) => (
|
|
867
|
+
* <PostCard key={slot.id} post={slot.post} variant="grid" />
|
|
868
|
+
* ))}
|
|
869
|
+
* </Scroller>
|
|
870
|
+
* ```
|
|
871
|
+
*/
|
|
872
|
+
declare function Scroller({ title, labels, level, action, children, className, ...rest }: ScrollerProps): ReactElement;
|
|
873
|
+
|
|
843
874
|
interface ListGroupProps extends HTMLAttributes<HTMLUListElement> {
|
|
844
875
|
children: ReactNode;
|
|
845
876
|
/** Heading over the group. Also names the list to a screen reader. */
|
|
@@ -876,13 +907,15 @@ interface ListItemProps extends Omit<HTMLAttributes<HTMLElement>, "title" | "onC
|
|
|
876
907
|
`trailing` and it is a button inside the link. This slot sits outside
|
|
877
908
|
the hit target, where a second control can be reached. */
|
|
878
909
|
actions?: ReactNode;
|
|
879
|
-
/** Makes the whole row a button
|
|
910
|
+
/** Makes the whole row a button — or, with `href`, reports the press on the
|
|
911
|
+
way out: a notification marked read, a tap counted. */
|
|
880
912
|
onClick?: () => void;
|
|
881
913
|
/** Marks an onClick row as a toggle — a picker row that selects rather than
|
|
882
914
|
navigates. Lands as aria-pressed on the row button itself, where the
|
|
883
915
|
screen reader's focus is. Leave unset for rows that navigate. */
|
|
884
916
|
pressed?: boolean;
|
|
885
|
-
/** Makes the whole row a link.
|
|
917
|
+
/** Makes the whole row a link. The row navigates rather than acts, and any
|
|
918
|
+
onClick rides along with the navigation. */
|
|
886
919
|
href?: string;
|
|
887
920
|
/** Element override for that link, e.g. a router's Link. */
|
|
888
921
|
as?: ElementType;
|
|
@@ -1663,6 +1696,40 @@ interface UploadProgressProps extends Omit<HTMLAttributes<HTMLDivElement>, "chil
|
|
|
1663
1696
|
*/
|
|
1664
1697
|
declare function UploadProgress({ name, labels, preview, mark, value, status, detail, error, onCancel, onRetry, onRemove, className, ...rest }: UploadProgressProps): ReactElement;
|
|
1665
1698
|
|
|
1699
|
+
interface FileDropProps extends Omit<HTMLAttributes<HTMLDivElement>, "onDrop"> {
|
|
1700
|
+
/** The invitation, in the app's words — what to hand over, and how. */
|
|
1701
|
+
label: string;
|
|
1702
|
+
/** The rule under it: the kinds taken, the size ceiling, how many fit. */
|
|
1703
|
+
hint?: string;
|
|
1704
|
+
/** Glyph above the words, from the app's icon set. */
|
|
1705
|
+
icon?: ReactNode;
|
|
1706
|
+
/** Passed to the picker, so it offers the right kinds. Same syntax as the
|
|
1707
|
+
input attribute: "image/*", ".pdf,.docx". */
|
|
1708
|
+
accept?: string;
|
|
1709
|
+
/** More than one at a time. A drop of several is cut to one without it —
|
|
1710
|
+
the picker would not have let them through either. */
|
|
1711
|
+
multiple?: boolean;
|
|
1712
|
+
disabled?: boolean;
|
|
1713
|
+
/** What arrived, picked or dropped. Never empty. */
|
|
1714
|
+
onFiles: (files: File[]) => void;
|
|
1715
|
+
ref?: Ref<HTMLDivElement>;
|
|
1716
|
+
}
|
|
1717
|
+
/**
|
|
1718
|
+
* A place to hand over a file: press it for the picker, or drop one on it.
|
|
1719
|
+
* The list of what is on its way up is UploadProgress' job.
|
|
1720
|
+
*
|
|
1721
|
+
* ```tsx
|
|
1722
|
+
* <FileDrop
|
|
1723
|
+
* label={t.upload.drop}
|
|
1724
|
+
* hint={t.upload.limit}
|
|
1725
|
+
* accept="image/*"
|
|
1726
|
+
* multiple
|
|
1727
|
+
* onFiles={upload.add}
|
|
1728
|
+
* />
|
|
1729
|
+
* ```
|
|
1730
|
+
*/
|
|
1731
|
+
declare function FileDrop({ label, hint, icon, accept, multiple, disabled, onFiles, className, ref, ...rest }: FileDropProps): ReactElement;
|
|
1732
|
+
|
|
1666
1733
|
interface LightboxLabels {
|
|
1667
1734
|
/** Names the dialog itself, e.g. "Image". */
|
|
1668
1735
|
dialog: string;
|
|
@@ -1872,4 +1939,4 @@ interface RovingGroupOptions {
|
|
|
1872
1939
|
*/
|
|
1873
1940
|
declare function useRovingGroup(ref: RefObject<HTMLElement | null>, { selector, orientation }: RovingGroupOptions): (event: KeyboardEvent<HTMLElement>) => void;
|
|
1874
1941
|
|
|
1875
|
-
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, type DataColumn, DataTable, type DataTableProps, type DataTableSelectionLabels, 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, SideNav, SideNavGroup, type SideNavGroupProps, SideNavItem, type SideNavItemProps, type SideNavProps, 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 };
|
|
1942
|
+
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, type DataColumn, DataTable, type DataTableProps, type DataTableSelectionLabels, DateTimePicker, type DateTimePickerLabels, type DateTimePickerProps, Divider, type DividerProps, EmptyState, type EmptyStateProps, Field, type FieldContextValue, type FieldProps, FileDrop, type FileDropProps, 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, Scroller, type ScrollerLabels, type ScrollerProps, SearchField, type SearchFieldProps, type SegmentOption, SegmentedControl, type SegmentedControlProps, type SegmentedControlSize, Select, type SelectProps, type SelectSize, Sheet, SheetBody, SheetFooter, SheetHeader, type SheetProps, SideNav, SideNavGroup, type SideNavGroupProps, SideNavItem, type SideNavItemProps, type SideNavProps, 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
|
@@ -840,6 +840,37 @@ interface SearchFieldProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "
|
|
|
840
840
|
*/
|
|
841
841
|
declare function SearchField({ label, clearLabel, value, onChange, className, ...rest }: SearchFieldProps): ReactElement;
|
|
842
842
|
|
|
843
|
+
interface ScrollerLabels {
|
|
844
|
+
previous: string;
|
|
845
|
+
next: string;
|
|
846
|
+
}
|
|
847
|
+
interface ScrollerProps extends Omit<HTMLAttributes<HTMLElement>, "title"> {
|
|
848
|
+
/** Words over the row. They name the scrolling group too. */
|
|
849
|
+
title: string;
|
|
850
|
+
/** The arrows are glyphs, so the words are the app's. */
|
|
851
|
+
labels: ScrollerLabels;
|
|
852
|
+
/** Where the title sits in the document outline. Default 2. */
|
|
853
|
+
level?: HeadingLevel;
|
|
854
|
+
/** Beside the title, before the arrows — a link to the rest. */
|
|
855
|
+
action?: ReactNode;
|
|
856
|
+
children: ReactNode;
|
|
857
|
+
ref?: Ref<HTMLElement>;
|
|
858
|
+
}
|
|
859
|
+
/**
|
|
860
|
+
* A titled row that scrolls sideways — featured posts, a shelf of covers.
|
|
861
|
+
* The row scrolls with the finger; the arrows do the same for a pointer or a
|
|
862
|
+
* key, and shut themselves at each end.
|
|
863
|
+
*
|
|
864
|
+
* ```tsx
|
|
865
|
+
* <Scroller title={t("home.featured")} labels={t.scroller}>
|
|
866
|
+
* {slots.map((slot) => (
|
|
867
|
+
* <PostCard key={slot.id} post={slot.post} variant="grid" />
|
|
868
|
+
* ))}
|
|
869
|
+
* </Scroller>
|
|
870
|
+
* ```
|
|
871
|
+
*/
|
|
872
|
+
declare function Scroller({ title, labels, level, action, children, className, ...rest }: ScrollerProps): ReactElement;
|
|
873
|
+
|
|
843
874
|
interface ListGroupProps extends HTMLAttributes<HTMLUListElement> {
|
|
844
875
|
children: ReactNode;
|
|
845
876
|
/** Heading over the group. Also names the list to a screen reader. */
|
|
@@ -876,13 +907,15 @@ interface ListItemProps extends Omit<HTMLAttributes<HTMLElement>, "title" | "onC
|
|
|
876
907
|
`trailing` and it is a button inside the link. This slot sits outside
|
|
877
908
|
the hit target, where a second control can be reached. */
|
|
878
909
|
actions?: ReactNode;
|
|
879
|
-
/** Makes the whole row a button
|
|
910
|
+
/** Makes the whole row a button — or, with `href`, reports the press on the
|
|
911
|
+
way out: a notification marked read, a tap counted. */
|
|
880
912
|
onClick?: () => void;
|
|
881
913
|
/** Marks an onClick row as a toggle — a picker row that selects rather than
|
|
882
914
|
navigates. Lands as aria-pressed on the row button itself, where the
|
|
883
915
|
screen reader's focus is. Leave unset for rows that navigate. */
|
|
884
916
|
pressed?: boolean;
|
|
885
|
-
/** Makes the whole row a link.
|
|
917
|
+
/** Makes the whole row a link. The row navigates rather than acts, and any
|
|
918
|
+
onClick rides along with the navigation. */
|
|
886
919
|
href?: string;
|
|
887
920
|
/** Element override for that link, e.g. a router's Link. */
|
|
888
921
|
as?: ElementType;
|
|
@@ -1663,6 +1696,40 @@ interface UploadProgressProps extends Omit<HTMLAttributes<HTMLDivElement>, "chil
|
|
|
1663
1696
|
*/
|
|
1664
1697
|
declare function UploadProgress({ name, labels, preview, mark, value, status, detail, error, onCancel, onRetry, onRemove, className, ...rest }: UploadProgressProps): ReactElement;
|
|
1665
1698
|
|
|
1699
|
+
interface FileDropProps extends Omit<HTMLAttributes<HTMLDivElement>, "onDrop"> {
|
|
1700
|
+
/** The invitation, in the app's words — what to hand over, and how. */
|
|
1701
|
+
label: string;
|
|
1702
|
+
/** The rule under it: the kinds taken, the size ceiling, how many fit. */
|
|
1703
|
+
hint?: string;
|
|
1704
|
+
/** Glyph above the words, from the app's icon set. */
|
|
1705
|
+
icon?: ReactNode;
|
|
1706
|
+
/** Passed to the picker, so it offers the right kinds. Same syntax as the
|
|
1707
|
+
input attribute: "image/*", ".pdf,.docx". */
|
|
1708
|
+
accept?: string;
|
|
1709
|
+
/** More than one at a time. A drop of several is cut to one without it —
|
|
1710
|
+
the picker would not have let them through either. */
|
|
1711
|
+
multiple?: boolean;
|
|
1712
|
+
disabled?: boolean;
|
|
1713
|
+
/** What arrived, picked or dropped. Never empty. */
|
|
1714
|
+
onFiles: (files: File[]) => void;
|
|
1715
|
+
ref?: Ref<HTMLDivElement>;
|
|
1716
|
+
}
|
|
1717
|
+
/**
|
|
1718
|
+
* A place to hand over a file: press it for the picker, or drop one on it.
|
|
1719
|
+
* The list of what is on its way up is UploadProgress' job.
|
|
1720
|
+
*
|
|
1721
|
+
* ```tsx
|
|
1722
|
+
* <FileDrop
|
|
1723
|
+
* label={t.upload.drop}
|
|
1724
|
+
* hint={t.upload.limit}
|
|
1725
|
+
* accept="image/*"
|
|
1726
|
+
* multiple
|
|
1727
|
+
* onFiles={upload.add}
|
|
1728
|
+
* />
|
|
1729
|
+
* ```
|
|
1730
|
+
*/
|
|
1731
|
+
declare function FileDrop({ label, hint, icon, accept, multiple, disabled, onFiles, className, ref, ...rest }: FileDropProps): ReactElement;
|
|
1732
|
+
|
|
1666
1733
|
interface LightboxLabels {
|
|
1667
1734
|
/** Names the dialog itself, e.g. "Image". */
|
|
1668
1735
|
dialog: string;
|
|
@@ -1872,4 +1939,4 @@ interface RovingGroupOptions {
|
|
|
1872
1939
|
*/
|
|
1873
1940
|
declare function useRovingGroup(ref: RefObject<HTMLElement | null>, { selector, orientation }: RovingGroupOptions): (event: KeyboardEvent<HTMLElement>) => void;
|
|
1874
1941
|
|
|
1875
|
-
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, type DataColumn, DataTable, type DataTableProps, type DataTableSelectionLabels, 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, SideNav, SideNavGroup, type SideNavGroupProps, SideNavItem, type SideNavItemProps, type SideNavProps, 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 };
|
|
1942
|
+
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, type DataColumn, DataTable, type DataTableProps, type DataTableSelectionLabels, DateTimePicker, type DateTimePickerLabels, type DateTimePickerProps, Divider, type DividerProps, EmptyState, type EmptyStateProps, Field, type FieldContextValue, type FieldProps, FileDrop, type FileDropProps, 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, Scroller, type ScrollerLabels, type ScrollerProps, SearchField, type SearchFieldProps, type SegmentOption, SegmentedControl, type SegmentedControlProps, type SegmentedControlSize, Select, type SelectProps, type SelectSize, Sheet, SheetBody, SheetFooter, SheetHeader, type SheetProps, SideNav, SideNavGroup, type SideNavGroupProps, SideNavItem, type SideNavItemProps, type SideNavProps, 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
|
@@ -501,7 +501,15 @@ function Field({ label, children, hint, error, required = false, className }) {
|
|
|
501
501
|
children
|
|
502
502
|
}
|
|
503
503
|
),
|
|
504
|
-
message && /* @__PURE__ */ jsx(
|
|
504
|
+
message && /* @__PURE__ */ jsx(
|
|
505
|
+
"span",
|
|
506
|
+
{
|
|
507
|
+
id: messageId,
|
|
508
|
+
role: error !== void 0 ? "alert" : void 0,
|
|
509
|
+
className: cx(Field_module_default.message, error !== void 0 && Field_module_default.error),
|
|
510
|
+
children: message
|
|
511
|
+
}
|
|
512
|
+
)
|
|
505
513
|
] });
|
|
506
514
|
}
|
|
507
515
|
|
|
@@ -1351,6 +1359,85 @@ function SearchField({
|
|
|
1351
1359
|
] });
|
|
1352
1360
|
}
|
|
1353
1361
|
|
|
1362
|
+
// mds-cssmod:/home/runner/work/mond-design-system/mond-design-system/packages/react/src/components/Scroller/Scroller.module.css?mds-scoped
|
|
1363
|
+
var Scroller_module_default = { "scroller": "mds-Scroller__scroller", "header": "mds-Scroller__header", "trailing": "mds-Scroller__trailing", "track": "mds-Scroller__track", "arrows": "mds-Scroller__arrows" };
|
|
1364
|
+
var STEP = 0.8;
|
|
1365
|
+
function Scroller({
|
|
1366
|
+
title,
|
|
1367
|
+
labels,
|
|
1368
|
+
level = 2,
|
|
1369
|
+
action,
|
|
1370
|
+
children,
|
|
1371
|
+
className,
|
|
1372
|
+
...rest
|
|
1373
|
+
}) {
|
|
1374
|
+
const track = useRef(null);
|
|
1375
|
+
const titleId = useId();
|
|
1376
|
+
const [atStart, setAtStart] = useState(true);
|
|
1377
|
+
const [atEnd, setAtEnd] = useState(true);
|
|
1378
|
+
const measure = useCallback(() => {
|
|
1379
|
+
const row = track.current;
|
|
1380
|
+
if (row === null) return;
|
|
1381
|
+
setAtStart(row.scrollLeft <= 0);
|
|
1382
|
+
setAtEnd(row.scrollLeft + row.clientWidth >= row.scrollWidth - 1);
|
|
1383
|
+
}, []);
|
|
1384
|
+
useEffect(measure);
|
|
1385
|
+
useEffect(() => {
|
|
1386
|
+
window.addEventListener("resize", measure);
|
|
1387
|
+
return () => window.removeEventListener("resize", measure);
|
|
1388
|
+
}, [measure]);
|
|
1389
|
+
const step = (direction) => {
|
|
1390
|
+
const row = track.current;
|
|
1391
|
+
if (row === null) return;
|
|
1392
|
+
row.scrollBy({ left: direction * Math.round(row.clientWidth * STEP) });
|
|
1393
|
+
};
|
|
1394
|
+
return /* @__PURE__ */ jsxs("section", { className: cx(Scroller_module_default.scroller, className), ...rest, children: [
|
|
1395
|
+
/* @__PURE__ */ jsxs("div", { className: Scroller_module_default.header, children: [
|
|
1396
|
+
/* @__PURE__ */ jsx(Heading, { level, variant: "label", id: titleId, children: title }),
|
|
1397
|
+
/* @__PURE__ */ jsxs("div", { className: Scroller_module_default.trailing, children: [
|
|
1398
|
+
action,
|
|
1399
|
+
/* @__PURE__ */ jsxs("div", { className: Scroller_module_default.arrows, children: [
|
|
1400
|
+
/* @__PURE__ */ jsx(
|
|
1401
|
+
Button,
|
|
1402
|
+
{
|
|
1403
|
+
variant: "ghost",
|
|
1404
|
+
size: "sm",
|
|
1405
|
+
iconOnly: true,
|
|
1406
|
+
"aria-label": labels.previous,
|
|
1407
|
+
disabled: atStart,
|
|
1408
|
+
onClick: () => step(-1),
|
|
1409
|
+
children: /* @__PURE__ */ jsx(ChevronLeftGlyph, {})
|
|
1410
|
+
}
|
|
1411
|
+
),
|
|
1412
|
+
/* @__PURE__ */ jsx(
|
|
1413
|
+
Button,
|
|
1414
|
+
{
|
|
1415
|
+
variant: "ghost",
|
|
1416
|
+
size: "sm",
|
|
1417
|
+
iconOnly: true,
|
|
1418
|
+
"aria-label": labels.next,
|
|
1419
|
+
disabled: atEnd,
|
|
1420
|
+
onClick: () => step(1),
|
|
1421
|
+
children: /* @__PURE__ */ jsx(ChevronRightGlyph, {})
|
|
1422
|
+
}
|
|
1423
|
+
)
|
|
1424
|
+
] })
|
|
1425
|
+
] })
|
|
1426
|
+
] }),
|
|
1427
|
+
/* @__PURE__ */ jsx(
|
|
1428
|
+
"div",
|
|
1429
|
+
{
|
|
1430
|
+
className: Scroller_module_default.track,
|
|
1431
|
+
ref: track,
|
|
1432
|
+
role: "group",
|
|
1433
|
+
"aria-labelledby": titleId,
|
|
1434
|
+
onScroll: measure,
|
|
1435
|
+
children
|
|
1436
|
+
}
|
|
1437
|
+
)
|
|
1438
|
+
] });
|
|
1439
|
+
}
|
|
1440
|
+
|
|
1354
1441
|
// mds-cssmod:/home/runner/work/mond-design-system/mond-design-system/packages/react/src/components/List/List.module.css?mds-scoped
|
|
1355
1442
|
var List_module_default = { "group": "mds-List__group", "labelledGroup": "mds-List__labelledGroup", "label": "mds-List__label", "item": "mds-List__item", "surface-card": "mds-List__surface-card", "surface-sunken": "mds-List__surface-sunken", "surface-accent": "mds-List__surface-accent", "surface-plain": "mds-List__surface-plain", "row": "mds-List__row", "interactive": "mds-List__interactive", "withActions": "mds-List__withActions", "actions": "mds-List__actions", "leading": "mds-List__leading", "trailing": "mds-List__trailing", "text": "mds-List__text", "title": "mds-List__title", "description": "mds-List__description" };
|
|
1356
1443
|
var ListGroupContext = createContext(false);
|
|
@@ -1409,7 +1496,7 @@ function ListItem({
|
|
|
1409
1496
|
ref,
|
|
1410
1497
|
...rest,
|
|
1411
1498
|
children: [
|
|
1412
|
-
href !== void 0 ? /* @__PURE__ */ jsx(LinkElement, { className: cx(List_module_default.row, List_module_default.interactive), href, children: content }) : onClick !== void 0 ? /* @__PURE__ */ jsx(
|
|
1499
|
+
href !== void 0 ? /* @__PURE__ */ jsx(LinkElement, { className: cx(List_module_default.row, List_module_default.interactive), href, onClick, children: content }) : onClick !== void 0 ? /* @__PURE__ */ jsx(
|
|
1413
1500
|
"button",
|
|
1414
1501
|
{
|
|
1415
1502
|
type: "button",
|
|
@@ -2269,11 +2356,85 @@ function UploadProgress({
|
|
|
2269
2356
|
] });
|
|
2270
2357
|
}
|
|
2271
2358
|
|
|
2359
|
+
// mds-cssmod:/home/runner/work/mond-design-system/mond-design-system/packages/react/src/components/FileDrop/FileDrop.module.css?mds-scoped
|
|
2360
|
+
var FileDrop_module_default = { "drop": "mds-FileDrop__drop", "target": "mds-FileDrop__target", "over": "mds-FileDrop__over", "icon": "mds-FileDrop__icon", "picker": "mds-FileDrop__picker" };
|
|
2361
|
+
function FileDrop({
|
|
2362
|
+
label,
|
|
2363
|
+
hint,
|
|
2364
|
+
icon,
|
|
2365
|
+
accept,
|
|
2366
|
+
multiple = false,
|
|
2367
|
+
disabled = false,
|
|
2368
|
+
onFiles,
|
|
2369
|
+
className,
|
|
2370
|
+
ref,
|
|
2371
|
+
...rest
|
|
2372
|
+
}) {
|
|
2373
|
+
const picker = useRef(null);
|
|
2374
|
+
const [over, setOver] = useState(false);
|
|
2375
|
+
const take = (list) => {
|
|
2376
|
+
if (disabled || list === null || list.length === 0) return;
|
|
2377
|
+
const files = [...list];
|
|
2378
|
+
onFiles(multiple ? files : files.slice(0, 1));
|
|
2379
|
+
};
|
|
2380
|
+
const dropped = (event) => {
|
|
2381
|
+
event.preventDefault();
|
|
2382
|
+
setOver(false);
|
|
2383
|
+
take(event.dataTransfer.files);
|
|
2384
|
+
};
|
|
2385
|
+
return /* @__PURE__ */ jsxs(
|
|
2386
|
+
"div",
|
|
2387
|
+
{
|
|
2388
|
+
className: cx(FileDrop_module_default.drop, over && FileDrop_module_default.over, className),
|
|
2389
|
+
ref,
|
|
2390
|
+
onDragOver: (event) => {
|
|
2391
|
+
event.preventDefault();
|
|
2392
|
+
setOver(!disabled);
|
|
2393
|
+
},
|
|
2394
|
+
onDragLeave: () => setOver(false),
|
|
2395
|
+
onDrop: dropped,
|
|
2396
|
+
...rest,
|
|
2397
|
+
children: [
|
|
2398
|
+
/* @__PURE__ */ jsxs(
|
|
2399
|
+
"button",
|
|
2400
|
+
{
|
|
2401
|
+
type: "button",
|
|
2402
|
+
className: FileDrop_module_default.target,
|
|
2403
|
+
disabled,
|
|
2404
|
+
onClick: () => picker.current?.click(),
|
|
2405
|
+
children: [
|
|
2406
|
+
icon !== void 0 && /* @__PURE__ */ jsx("span", { className: FileDrop_module_default.icon, children: icon }),
|
|
2407
|
+
/* @__PURE__ */ jsx(Text, { variant: "label", children: label }),
|
|
2408
|
+
hint !== void 0 && /* @__PURE__ */ jsx(Text, { variant: "meta", children: hint })
|
|
2409
|
+
]
|
|
2410
|
+
}
|
|
2411
|
+
),
|
|
2412
|
+
/* @__PURE__ */ jsx(
|
|
2413
|
+
"input",
|
|
2414
|
+
{
|
|
2415
|
+
type: "file",
|
|
2416
|
+
className: FileDrop_module_default.picker,
|
|
2417
|
+
ref: picker,
|
|
2418
|
+
tabIndex: -1,
|
|
2419
|
+
"aria-hidden": "true",
|
|
2420
|
+
multiple,
|
|
2421
|
+
...accept === void 0 ? {} : { accept },
|
|
2422
|
+
onChange: (event) => {
|
|
2423
|
+
take(event.target.files);
|
|
2424
|
+
event.target.value = "";
|
|
2425
|
+
}
|
|
2426
|
+
}
|
|
2427
|
+
)
|
|
2428
|
+
]
|
|
2429
|
+
}
|
|
2430
|
+
);
|
|
2431
|
+
}
|
|
2432
|
+
|
|
2272
2433
|
// mds-cssmod:/home/runner/work/mond-design-system/mond-design-system/packages/react/src/components/Lightbox/Lightbox.module.css?mds-scoped
|
|
2273
2434
|
var Lightbox_module_default = { "panel": "mds-Lightbox__panel", "bar": "mds-Lightbox__bar", "surface": "mds-Lightbox__surface", "image": "mds-Lightbox__image", "caption": "mds-Lightbox__caption" };
|
|
2274
2435
|
var MIN_SCALE = 1;
|
|
2275
2436
|
var MAX_SCALE = 4;
|
|
2276
|
-
var
|
|
2437
|
+
var STEP2 = 1;
|
|
2277
2438
|
var DOUBLE = 2.5;
|
|
2278
2439
|
var WHEEL = 0.01;
|
|
2279
2440
|
var ORIGIN = { x: 0, y: 0 };
|
|
@@ -2386,7 +2547,7 @@ function Lightbox({ open, onClose, src, alt = "", caption, labels }) {
|
|
|
2386
2547
|
variant: "ghost",
|
|
2387
2548
|
onMedia: true,
|
|
2388
2549
|
disabled: scale <= MIN_SCALE,
|
|
2389
|
-
onClick: () => zoom(scale -
|
|
2550
|
+
onClick: () => zoom(scale - STEP2),
|
|
2390
2551
|
children: /* @__PURE__ */ jsx(ZoomOutGlyph, {})
|
|
2391
2552
|
}
|
|
2392
2553
|
),
|
|
@@ -2398,7 +2559,7 @@ function Lightbox({ open, onClose, src, alt = "", caption, labels }) {
|
|
|
2398
2559
|
variant: "ghost",
|
|
2399
2560
|
onMedia: true,
|
|
2400
2561
|
disabled: scale >= MAX_SCALE,
|
|
2401
|
-
onClick: () => zoom(scale +
|
|
2562
|
+
onClick: () => zoom(scale + STEP2),
|
|
2402
2563
|
children: /* @__PURE__ */ jsx(ZoomInGlyph, {})
|
|
2403
2564
|
}
|
|
2404
2565
|
),
|
|
@@ -2661,6 +2822,6 @@ function useRovingGroup(ref, { selector, orientation = "horizontal" }) {
|
|
|
2661
2822
|
);
|
|
2662
2823
|
}
|
|
2663
2824
|
|
|
2664
|
-
export { AppBar, Avatar, AvatarGroup, Badge, Breadcrumb, Button, Card, CardBody, CardFooter, CardHeader, Checkbox, Chip, ChipBar, ChipGroup, ConfirmDialog, Container, CountButton, DataTable, DateTimePicker, Divider, EmptyState, Field, Heading, Icon, IconProvider, ImageCarousel, Inline, Input, Lightbox, Link, ListGroup, ListItem, MediaPlaceholder, Modal, ModalBody, ModalFooter, ModalHeader, OverlayHistoryContext, PasswordInput, ProgressBar, Radio, Screen, ScreenContent, SearchField, SegmentedControl, Select, Sheet, SheetBody, SheetFooter, SheetHeader, SideNav, SideNavGroup, SideNavItem, Skeleton, Spinner, Stack, Switch, Tab, TabBar, TabBarAction, TabBarItem, TabList, TabPanel, Tabs, Tag, Text, Textarea, ToastProvider, UploadProgress, VideoPlayer, VisuallyHidden, cx, useFieldContext, useOverlay, usePresence, useRovingGroup, useToast };
|
|
2825
|
+
export { AppBar, Avatar, AvatarGroup, Badge, Breadcrumb, Button, Card, CardBody, CardFooter, CardHeader, Checkbox, Chip, ChipBar, ChipGroup, ConfirmDialog, Container, CountButton, DataTable, DateTimePicker, Divider, EmptyState, Field, FileDrop, Heading, Icon, IconProvider, ImageCarousel, Inline, Input, Lightbox, Link, ListGroup, ListItem, MediaPlaceholder, Modal, ModalBody, ModalFooter, ModalHeader, OverlayHistoryContext, PasswordInput, ProgressBar, Radio, Screen, ScreenContent, Scroller, SearchField, SegmentedControl, Select, Sheet, SheetBody, SheetFooter, SheetHeader, SideNav, SideNavGroup, SideNavItem, Skeleton, Spinner, Stack, Switch, Tab, TabBar, TabBarAction, TabBarItem, TabList, TabPanel, Tabs, Tag, Text, Textarea, ToastProvider, UploadProgress, VideoPlayer, VisuallyHidden, cx, useFieldContext, useOverlay, usePresence, useRovingGroup, useToast };
|
|
2665
2826
|
//# sourceMappingURL=index.js.map
|
|
2666
2827
|
//# sourceMappingURL=index.js.map
|