@mond-design-system/react 4.9.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/dist/index.cjs +93 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +43 -0
- package/dist/index.css.map +1 -1
- package/dist/index.d.cts +36 -3
- package/dist/index.d.ts +36 -3
- package/dist/index.js +93 -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;
|
|
@@ -1906,4 +1939,4 @@ interface RovingGroupOptions {
|
|
|
1906
1939
|
*/
|
|
1907
1940
|
declare function useRovingGroup(ref: RefObject<HTMLElement | null>, { selector, orientation }: RovingGroupOptions): (event: KeyboardEvent<HTMLElement>) => void;
|
|
1908
1941
|
|
|
1909
|
-
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, 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;
|
|
@@ -1906,4 +1939,4 @@ interface RovingGroupOptions {
|
|
|
1906
1939
|
*/
|
|
1907
1940
|
declare function useRovingGroup(ref: RefObject<HTMLElement | null>, { selector, orientation }: RovingGroupOptions): (event: KeyboardEvent<HTMLElement>) => void;
|
|
1908
1941
|
|
|
1909
|
-
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, 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",
|
|
@@ -2347,7 +2434,7 @@ function FileDrop({
|
|
|
2347
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" };
|
|
2348
2435
|
var MIN_SCALE = 1;
|
|
2349
2436
|
var MAX_SCALE = 4;
|
|
2350
|
-
var
|
|
2437
|
+
var STEP2 = 1;
|
|
2351
2438
|
var DOUBLE = 2.5;
|
|
2352
2439
|
var WHEEL = 0.01;
|
|
2353
2440
|
var ORIGIN = { x: 0, y: 0 };
|
|
@@ -2460,7 +2547,7 @@ function Lightbox({ open, onClose, src, alt = "", caption, labels }) {
|
|
|
2460
2547
|
variant: "ghost",
|
|
2461
2548
|
onMedia: true,
|
|
2462
2549
|
disabled: scale <= MIN_SCALE,
|
|
2463
|
-
onClick: () => zoom(scale -
|
|
2550
|
+
onClick: () => zoom(scale - STEP2),
|
|
2464
2551
|
children: /* @__PURE__ */ jsx(ZoomOutGlyph, {})
|
|
2465
2552
|
}
|
|
2466
2553
|
),
|
|
@@ -2472,7 +2559,7 @@ function Lightbox({ open, onClose, src, alt = "", caption, labels }) {
|
|
|
2472
2559
|
variant: "ghost",
|
|
2473
2560
|
onMedia: true,
|
|
2474
2561
|
disabled: scale >= MAX_SCALE,
|
|
2475
|
-
onClick: () => zoom(scale +
|
|
2562
|
+
onClick: () => zoom(scale + STEP2),
|
|
2476
2563
|
children: /* @__PURE__ */ jsx(ZoomInGlyph, {})
|
|
2477
2564
|
}
|
|
2478
2565
|
),
|
|
@@ -2735,6 +2822,6 @@ function useRovingGroup(ref, { selector, orientation = "horizontal" }) {
|
|
|
2735
2822
|
);
|
|
2736
2823
|
}
|
|
2737
2824
|
|
|
2738
|
-
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, 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 };
|
|
2739
2826
|
//# sourceMappingURL=index.js.map
|
|
2740
2827
|
//# sourceMappingURL=index.js.map
|