@moneyforward/mfui-components 3.11.0 → 3.12.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.
Files changed (45) hide show
  1. package/dist/src/Breadcrumbs/Breadcrumbs.d.ts +9 -0
  2. package/dist/src/Breadcrumbs/Breadcrumbs.js +150 -0
  3. package/dist/src/Breadcrumbs/Breadcrumbs.types.d.ts +31 -0
  4. package/dist/src/Breadcrumbs/Breadcrumbs.types.js +1 -0
  5. package/dist/src/Breadcrumbs/index.d.ts +2 -0
  6. package/dist/src/Breadcrumbs/index.js +1 -0
  7. package/dist/src/Button/Button.d.ts +1 -1
  8. package/dist/src/CheckboxGroup/CheckboxGroup.d.ts +1 -1
  9. package/dist/src/DateTimeSelection/DateRangePicker/DateRangePickerProvider/DateRangePickerProvider.d.ts +2 -2
  10. package/dist/src/DateTimeSelection/shared/BaseRangePicker/BaseRangePickerProvider/BaseRangePickerProvider.d.ts +2 -2
  11. package/dist/src/IconButton/IconButton.d.ts +2 -2
  12. package/dist/src/MultipleSelectBox/MultipleSelectBox.d.ts +1 -1
  13. package/dist/src/MultipleSelectBox/MultipleSelectBox.js +5 -2
  14. package/dist/src/MultipleSelectBox/MultipleSelectBox.types.d.ts +9 -0
  15. package/dist/src/RadioButton/RadioButton.d.ts +1 -1
  16. package/dist/src/RadioGroup/RadioGroup.d.ts +1 -1
  17. package/dist/src/SplitView/SplitView.d.ts +7 -16
  18. package/dist/src/SplitView/SplitView.js +110 -70
  19. package/dist/src/SplitView/SplitView.types.d.ts +84 -56
  20. package/dist/src/SplitView/hooks/useSplitViewAnimation.d.ts +6 -6
  21. package/dist/src/SplitView/hooks/useSplitViewAnimation.js +46 -48
  22. package/dist/src/SplitView/hooks/useSplitViewDrag.d.ts +5 -4
  23. package/dist/src/SplitView/hooks/useSplitViewDrag.js +22 -12
  24. package/dist/src/SplitView/hooks/useSplitViewKeyboard.d.ts +7 -6
  25. package/dist/src/SplitView/hooks/useSplitViewKeyboard.js +22 -16
  26. package/dist/src/SplitView/hooks/useSplitViewPanelVisibility.d.ts +3 -3
  27. package/dist/src/SplitView/hooks/useSplitViewPanelVisibility.js +9 -9
  28. package/dist/src/SplitView/hooks/useSplitViewResize.d.ts +6 -6
  29. package/dist/src/SplitView/hooks/useSplitViewResize.js +16 -16
  30. package/dist/src/SplitView/utils/calculatePanelSize.d.ts +11 -11
  31. package/dist/src/SplitView/utils/calculatePanelSize.js +13 -13
  32. package/dist/src/SplitView/utils/styles.d.ts +21 -5
  33. package/dist/src/SplitView/utils/styles.js +47 -21
  34. package/dist/src/Tooltip/Tooltip.d.ts +2 -1
  35. package/dist/src/Tooltip/Tooltip.js +4 -2
  36. package/dist/src/Tooltip/Tooltip.types.d.ts +11 -0
  37. package/dist/src/index.d.ts +1 -0
  38. package/dist/src/index.js +1 -0
  39. package/dist/styled-system/recipes/breadcrumbs-slot-recipe.d.ts +33 -0
  40. package/dist/styled-system/recipes/breadcrumbs-slot-recipe.js +63 -0
  41. package/dist/styled-system/recipes/index.d.ts +1 -0
  42. package/dist/styled-system/recipes/index.js +1 -0
  43. package/dist/styles.css +88 -7
  44. package/dist/tsconfig.build.tsbuildinfo +1 -1
  45. package/package.json +3 -3
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Breadcrumbs is a navigation component that shows the user's current location
3
+ * within the site hierarchy and allows quick navigation to parent pages.
4
+ */
5
+ export declare const Breadcrumbs: import("react").ForwardRefExoticComponent<{
6
+ items: import("./Breadcrumbs.types").BreadcrumbItem[];
7
+ wrap?: boolean;
8
+ customLinkComponent?: import("react").ElementType;
9
+ } & Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, "ref"> & import("react").RefAttributes<HTMLElement>>;
@@ -0,0 +1,150 @@
1
+ 'use client';
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { forwardRef, useEffect, useLayoutEffect, useRef, useState } from 'react';
4
+ import { MoreHorizontal, NavigationToDetail } from '@moneyforward/mfui-icons-react';
5
+ import { TextLink } from '../TextLink';
6
+ import { DropdownMenu } from '../DropdownMenu';
7
+ import { Tooltip } from '../Tooltip';
8
+ import { cx } from '../../styled-system/css';
9
+ import { breadcrumbsSlotRecipe } from '../../styled-system/recipes';
10
+ const FULL_WIDTH_2_CHARS = 24; // Width of 2 full-width characters
11
+ const SEPARATOR_ICON_WIDTH = 28; // Width of the separator icon
12
+ const ELLIPSIS_WIDTH = 12; // Width of the ellipsis
13
+ const ITEM_MIN_WIDTH = FULL_WIDTH_2_CHARS + SEPARATOR_ICON_WIDTH + ELLIPSIS_WIDTH; // = 64
14
+ const CURRENT_ITEM_MIN_WIDTH = FULL_WIDTH_2_CHARS + ELLIPSIS_WIDTH; // = 36
15
+ function Separator({ className }) {
16
+ return (_jsx("span", { "aria-hidden": true, className: className, children: _jsx(NavigationToDetail, { width: 14, height: 14 }) }));
17
+ }
18
+ /**
19
+ * Breadcrumbs is a navigation component that shows the user's current location
20
+ * within the site hierarchy and allows quick navigation to parent pages.
21
+ */
22
+ export const Breadcrumbs = forwardRef(({ items, wrap = false, customLinkComponent, className, 'aria-label': ariaLabel = '現在のページ位置', ...rest }, ref) => {
23
+ const classes = breadcrumbsSlotRecipe({ wrap });
24
+ // Decompose items into logical groups:
25
+ // - rootItem: items[0] (always shown, link)
26
+ // - currentItem: items[n-1] (always shown, non-link)
27
+ // - parentItem: items[n-2] (shown when items.length >= 3, link)
28
+ // - middleItems: items[1..n-3] (shown when items.length >= 4, truncation targets)
29
+ const rootItem = items.length > 1 ? items[0] : undefined;
30
+ const currentItem = items.at(-1);
31
+ const parentItem = items.length >= 3 ? items.at(-2) : undefined;
32
+ const middleItems = items.length >= 4 ? items.slice(1, -2) : [];
33
+ const [collapsedCount, setCollapsedCount] = useState(0);
34
+ const [containerWidth, setContainerWidth] = useState(0);
35
+ // True when all middle items are collapsed (or there are none).
36
+ // In this state flex-shrink: 1 is active and CSS ellipsis kicks in.
37
+ const allCollapsed = middleItems.length === 0 || collapsedCount === middleItems.length;
38
+ const listRef = useRef(null);
39
+ // Previous container width, used to detect expansion and trigger a reset.
40
+ const previousContainerWidthRef = useRef(0);
41
+ const rootLinkRef = useRef(null);
42
+ const parentLinkRef = useRef(null);
43
+ const currentItemRef = useRef(null);
44
+ const rootItemLiRef = useRef(null);
45
+ const parentItemLiRef = useRef(null);
46
+ const currentItemLiRef = useRef(null);
47
+ const [rootTruncated, setRootTruncated] = useState(false);
48
+ const [parentTruncated, setParentTruncated] = useState(false);
49
+ const [currentTruncated, setCurrentTruncated] = useState(false);
50
+ const [rootMinWidth, setRootMinWidth] = useState();
51
+ const [parentMinWidth, setParentMinWidth] = useState();
52
+ const [currentMinWidth, setCurrentMinWidth] = useState();
53
+ const itemsKey = items.map((item) => `${item.label}::${item.href ?? ''}`).join('|');
54
+ // Reset collapsedCount when items change.
55
+ useLayoutEffect(() => {
56
+ if (wrap)
57
+ return;
58
+ previousContainerWidthRef.current = 0;
59
+ setCollapsedCount(0);
60
+ // Use itemsKey as dependency instead of items to avoid referential inequality.
61
+ }, [itemsKey, wrap]);
62
+ // Overflow-based truncation: collapse middle items one by one from the left
63
+ // as long as scrollWidth > clientWidth.
64
+ useLayoutEffect(() => {
65
+ if (wrap || middleItems.length === 0) {
66
+ setCollapsedCount(0);
67
+ return;
68
+ }
69
+ if (!listRef.current)
70
+ return;
71
+ const list = listRef.current;
72
+ const currentWidth = list.clientWidth;
73
+ // Container expanded — reset and re-evaluate to show as many items as possible.
74
+ if (currentWidth > previousContainerWidthRef.current && collapsedCount > 0) {
75
+ previousContainerWidthRef.current = currentWidth;
76
+ setCollapsedCount(0);
77
+ return;
78
+ }
79
+ previousContainerWidthRef.current = currentWidth;
80
+ // Still overflowing — collapse one more item from the left.
81
+ if (list.scrollWidth > list.clientWidth && collapsedCount < middleItems.length) {
82
+ setCollapsedCount((c) => c + 1);
83
+ }
84
+ }, [containerWidth, collapsedCount, middleItems.length, wrap]);
85
+ // Watch container width changes with ResizeObserver.
86
+ useEffect(() => {
87
+ if (wrap || !listRef.current)
88
+ return;
89
+ const observer = new ResizeObserver((entries) => {
90
+ const entry = entries[0];
91
+ if (entry) {
92
+ setContainerWidth(entry.contentRect.width);
93
+ }
94
+ });
95
+ observer.observe(listRef.current);
96
+ return () => {
97
+ observer.disconnect();
98
+ };
99
+ }, [wrap]);
100
+ // Measure each item's natural (unshrunk) width and cap it at the maximum.
101
+ // Temporarily sets flex-shrink: 0 before measuring so that shrinkage doesn't skew the result.
102
+ useLayoutEffect(() => {
103
+ if (wrap) {
104
+ setRootMinWidth(undefined);
105
+ setParentMinWidth(undefined);
106
+ setCurrentMinWidth(undefined);
107
+ return;
108
+ }
109
+ const entries = [
110
+ { ref: rootItemLiRef, set: setRootMinWidth, max: ITEM_MIN_WIDTH },
111
+ { ref: parentItemLiRef, set: setParentMinWidth, max: ITEM_MIN_WIDTH },
112
+ { ref: currentItemLiRef, set: setCurrentMinWidth, max: CURRENT_ITEM_MIN_WIDTH },
113
+ ];
114
+ // Step 1: disable flex-shrink on all items (marks layout dirty).
115
+ entries.forEach(({ ref }) => {
116
+ const element = ref.current;
117
+ if (element)
118
+ element.style.flexShrink = '0';
119
+ });
120
+ // Step 2: read offsetWidth (first access forces reflow with all items unshrunk).
121
+ entries.forEach(({ ref, set, max }) => {
122
+ const element = ref.current;
123
+ if (element)
124
+ set(Math.min(element.offsetWidth, max));
125
+ });
126
+ // Step 3: restore (CSS class will re-apply flex-shrink: 1 when all-collapsed).
127
+ entries.forEach(({ ref }) => {
128
+ const element = ref.current;
129
+ if (element)
130
+ element.style.flexShrink = '';
131
+ });
132
+ }, [itemsKey, wrap]);
133
+ // Detect whether each item's text is actually truncated (disabled in wrap mode).
134
+ useLayoutEffect(() => {
135
+ if (wrap) {
136
+ setRootTruncated(false);
137
+ setParentTruncated(false);
138
+ setCurrentTruncated(false);
139
+ return;
140
+ }
141
+ setRootTruncated(!!(rootLinkRef.current && rootLinkRef.current.scrollWidth > rootLinkRef.current.clientWidth));
142
+ setParentTruncated(!!(parentLinkRef.current && parentLinkRef.current.scrollWidth > parentLinkRef.current.clientWidth));
143
+ setCurrentTruncated(!!(currentItemRef.current && currentItemRef.current.scrollWidth > currentItemRef.current.clientWidth));
144
+ }, [containerWidth, collapsedCount, wrap]);
145
+ const truncatedItems = middleItems.slice(0, collapsedCount);
146
+ return (_jsx("nav", { ref: ref, className: cx(classes.root, className), "aria-label": ariaLabel, ...rest, children: _jsxs("ol", { ref: listRef, className: classes.list, "data-mfui-all-collapsed": allCollapsed ? true : undefined, children: [rootItem ? (_jsxs("li", { ref: rootItemLiRef, className: classes.item, style: allCollapsed && rootMinWidth !== undefined ? { minWidth: rootMinWidth } : undefined, children: [_jsx(Tooltip, { hideFromScreenReader: true, content: rootItem.label, disabled: !rootTruncated, placement: "bottom", style: { display: 'flex', alignItems: 'center', minWidth: 0, overflow: 'hidden' }, children: _jsx(TextLink, { ref: rootLinkRef, href: rootItem.href, variant: "condensedBody", customLinkComponent: customLinkComponent, className: classes.linkText, children: rootItem.label }) }), _jsx(Separator, { className: classes.separator })] })) : null, collapsedCount > 0 ? (_jsxs("li", { className: classes.truncateItem, children: [_jsx(DropdownMenu, { label: "\u7701\u7565\u3055\u308C\u305F\u30A2\u30A4\u30C6\u30E0\u3092\u8868\u793A", icon: _jsx(MoreHorizontal, {}), triggerProps: {
147
+ className: classes.truncateButton,
148
+ }, children: truncatedItems.map((item, i) => item.href !== undefined ? (_jsx(DropdownMenu.Item, { href: item.href, customLinkComponent: customLinkComponent, children: item.label }, i)) : (_jsx(DropdownMenu.Item, { children: item.label }, i))) }), _jsx(Separator, { className: classes.separator })] })) : null, middleItems.map((item, i) => (_jsxs("li", { className: classes.item, style: i < collapsedCount ? { display: 'none' } : undefined, children: [_jsx(TextLink, { href: item.href, variant: "condensedBody", customLinkComponent: customLinkComponent, className: classes.linkText, children: item.label }), _jsx(Separator, { className: classes.separator })] }, i))), parentItem ? (_jsxs("li", { ref: parentItemLiRef, className: classes.item, style: allCollapsed && parentMinWidth !== undefined ? { minWidth: parentMinWidth } : undefined, children: [_jsx(Tooltip, { hideFromScreenReader: true, content: parentItem.label, disabled: !parentTruncated, placement: "bottom", style: { display: 'flex', alignItems: 'center', minWidth: 0, overflow: 'hidden' }, children: _jsx(TextLink, { ref: parentLinkRef, href: parentItem.href, variant: "condensedBody", customLinkComponent: customLinkComponent, className: classes.linkText, children: parentItem.label }) }), _jsx(Separator, { className: classes.separator })] })) : null, currentItem ? (_jsx("li", { ref: currentItemLiRef, className: classes.item, "aria-current": "page", style: allCollapsed && currentMinWidth !== undefined ? { minWidth: currentMinWidth } : undefined, children: _jsx(Tooltip, { hideFromScreenReader: true, content: currentItem.label, disabled: !currentTruncated, placement: "bottom", style: { display: 'flex', alignItems: 'center', minWidth: 0, overflow: 'hidden' }, children: _jsx("span", { ref: currentItemRef, className: classes.currentItem, children: currentItem.label }) }) })) : null] }) }));
149
+ });
150
+ Breadcrumbs.displayName = 'Breadcrumbs';
@@ -0,0 +1,31 @@
1
+ import { type ComponentPropsWithoutRef, type ElementType } from 'react';
2
+ /** A single item in the breadcrumb list. */
3
+ export type BreadcrumbItem = {
4
+ /** The display label of the page. */
5
+ label: string;
6
+ /** The URL to link to. */
7
+ href?: string;
8
+ };
9
+ export type BreadcrumbsProps = {
10
+ /**
11
+ * Array of breadcrumb items.
12
+ * The last item is treated as the current page and rendered as non-link.
13
+ * If only one item is provided, only the current item is shown.
14
+ */
15
+ items: BreadcrumbItem[];
16
+ /**
17
+ * Whether to allow text wrapping.
18
+ * When `true`, items wrap to multiple lines (truncation is disabled).
19
+ * When `false` (default), items stay on one line and overflowing middle items are truncated.
20
+ * In wrap mode, each item includes a separator to prevent separators from appearing at line starts.
21
+ *
22
+ * @default false
23
+ */
24
+ wrap?: boolean;
25
+ /**
26
+ * Custom link component (e.g. Next.js Link).
27
+ * Falls back to a plain `<a>` tag when omitted.
28
+ * Also applied to truncated items in the DropdownMenu.
29
+ */
30
+ customLinkComponent?: ElementType;
31
+ } & ComponentPropsWithoutRef<'nav'>;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ export { Breadcrumbs } from './Breadcrumbs';
2
+ export type { BreadcrumbItem, BreadcrumbsProps } from './Breadcrumbs.types';
@@ -0,0 +1 @@
1
+ export { Breadcrumbs } from './Breadcrumbs';
@@ -20,4 +20,4 @@ export declare const Button: import("react").ForwardRefExoticComponent<{
20
20
  rightIcon?: React.ReactElement;
21
21
  href?: string;
22
22
  customLinkComponent?: import("react").ElementType;
23
- } & Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & Pick<Omit<import("react").DetailedHTMLProps<import("react").AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>, "ref">, "type" | "rel" | "download" | "hrefLang" | "ping" | "target" | "referrerPolicy"> & import("react").RefAttributes<HTMLAnchorElement | HTMLButtonElement>>;
23
+ } & Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & Pick<Omit<import("react").DetailedHTMLProps<import("react").AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>, "ref">, "target" | "type" | "download" | "hrefLang" | "ping" | "referrerPolicy" | "rel"> & import("react").RefAttributes<HTMLAnchorElement | HTMLButtonElement>>;
@@ -14,4 +14,4 @@ export declare const CheckboxGroup: import("react").ForwardRefExoticComponent<{
14
14
  defaultValues?: (string | number | readonly string[] | undefined)[];
15
15
  values?: (string | number | readonly string[] | undefined)[];
16
16
  onChange?: (selectedValue: (string | number | readonly string[] | undefined)[]) => void;
17
- } & Pick<import("..").CheckboxProps, "disabled" | "name"> & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, "onChange"> & import("react").RefAttributes<HTMLDivElement>>;
17
+ } & Pick<import("..").CheckboxProps, "name" | "disabled"> & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, "onChange"> & import("react").RefAttributes<HTMLDivElement>>;
@@ -31,7 +31,7 @@ export declare function useDateRangePickerContext(): {
31
31
  handleClear: () => void;
32
32
  handleApply: () => void;
33
33
  handleCancel: () => void;
34
- selecting: "start" | "end";
34
+ selecting: "end" | "start";
35
35
  temporaryStart: Date | undefined;
36
36
  temporaryEnd: Date | undefined;
37
37
  previewDate: Date | undefined;
@@ -43,7 +43,7 @@ export declare function useDateRangePickerContext(): {
43
43
  isRangeEnd: (date: Date) => boolean;
44
44
  setTemporaryStart: import("react").Dispatch<import("react").SetStateAction<Date | undefined>>;
45
45
  setTemporaryEnd: import("react").Dispatch<import("react").SetStateAction<Date | undefined>>;
46
- setSelecting: import("react").Dispatch<import("react").SetStateAction<"start" | "end">>;
46
+ setSelecting: import("react").Dispatch<import("react").SetStateAction<"end" | "start">>;
47
47
  disableAutoOpen: boolean | undefined;
48
48
  pendingFocusDate: string | null;
49
49
  setPendingFocusDate: import("react").Dispatch<import("react").SetStateAction<string | null>>;
@@ -31,7 +31,7 @@ export declare function useBaseRangePickerContext(): {
31
31
  handleClear: () => void;
32
32
  handleApply: () => void;
33
33
  handleCancel: () => void;
34
- selecting: "start" | "end";
34
+ selecting: "end" | "start";
35
35
  temporaryStart: Date | undefined;
36
36
  temporaryEnd: Date | undefined;
37
37
  previewDate: Date | undefined;
@@ -43,7 +43,7 @@ export declare function useBaseRangePickerContext(): {
43
43
  isRangeEnd: (date: Date) => boolean;
44
44
  setTemporaryStart: import("react").Dispatch<import("react").SetStateAction<Date | undefined>>;
45
45
  setTemporaryEnd: import("react").Dispatch<import("react").SetStateAction<Date | undefined>>;
46
- setSelecting: import("react").Dispatch<import("react").SetStateAction<"start" | "end">>;
46
+ setSelecting: import("react").Dispatch<import("react").SetStateAction<"end" | "start">>;
47
47
  disableAutoOpen: boolean | undefined;
48
48
  pendingFocusDate: string | null;
49
49
  setPendingFocusDate: import("react").Dispatch<import("react").SetStateAction<string | null>>;
@@ -4,7 +4,7 @@ export declare const InternalIconButton: import("react").ForwardRefExoticCompone
4
4
  disabled?: boolean;
5
5
  href?: string;
6
6
  customLinkComponent?: import("react").ElementType;
7
- } & Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & Pick<Omit<import("react").DetailedHTMLProps<import("react").AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>, "ref">, "type" | "rel" | "download" | "hrefLang" | "ping" | "target" | "referrerPolicy"> & {
7
+ } & Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & Pick<Omit<import("react").DetailedHTMLProps<import("react").AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>, "ref">, "target" | "type" | "download" | "hrefLang" | "ping" | "referrerPolicy" | "rel"> & {
8
8
  size?: import("../../styled-system/recipes").IconButtonSlotRecipeVariant["size"];
9
9
  } & import("react").RefAttributes<HTMLAnchorElement | HTMLButtonElement>>;
10
10
  export declare const IconButton: import("react").ForwardRefExoticComponent<{
@@ -13,4 +13,4 @@ export declare const IconButton: import("react").ForwardRefExoticComponent<{
13
13
  disabled?: boolean;
14
14
  href?: string;
15
15
  customLinkComponent?: import("react").ElementType;
16
- } & Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & Pick<Omit<import("react").DetailedHTMLProps<import("react").AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>, "ref">, "type" | "rel" | "download" | "hrefLang" | "ping" | "target" | "referrerPolicy"> & import("react").RefAttributes<HTMLAnchorElement | HTMLButtonElement>>;
16
+ } & Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & Pick<Omit<import("react").DetailedHTMLProps<import("react").AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>, "ref">, "target" | "type" | "download" | "hrefLang" | "ping" | "referrerPolicy" | "rel"> & import("react").RefAttributes<HTMLAnchorElement | HTMLButtonElement>>;
@@ -4,4 +4,4 @@ import { type MultipleSelectBoxProps, type AllowedValueTypes } from './MultipleS
4
4
  * This component is separated from the SelectBox component because it has a different behavior.
5
5
  * This component switches the variants of looks and behaviors depends on the props: size, invalid, disabled.
6
6
  */
7
- export declare function MultipleSelectBox<T extends AllowedValueTypes = string, AdditionalProps extends Record<string, unknown> = Record<string, never>>({ id, triggerProps, triggerWrapperProps, size, options, defaultValue, placeholder, emptyMessage, disabled, invalid, targetDOMNode, name, onChange, value, showDisplayValueAsTag, renderDisplayValue, enableSearchOptions, notFoundMessage, searchBoxProps, loading, onSearchOptions, clearButtonProps, disableClearButton, optionPanelProps, popoverWrapperProps, enableAllOptionsControls, enableApplyControls, selectAllButtonProps, clearAllButtonProps, selectedCountProps, cancelButtonProps, applyButtonProps, renderOption, onOpenStateChanged, enableAutoUnmount, onBlur, showGroupOptionDivider, enableVirtualization, virtualizationOptions, infiniteScroll, }: MultipleSelectBoxProps<T, AdditionalProps>): import("react/jsx-runtime").JSX.Element;
7
+ export declare function MultipleSelectBox<T extends AllowedValueTypes = string, AdditionalProps extends Record<string, unknown> = Record<string, never>>({ id, triggerProps, triggerWrapperProps, size, options, defaultValue, placeholder, emptyMessage, disabled, invalid, targetDOMNode, name, onChange, value, showDisplayValueAsTag, renderDisplayValue, enableSearchOptions, notFoundMessage, searchBoxProps, loading, onSearchOptions, clearButtonProps, disableClearButton, optionPanelProps, popoverWrapperProps, enableAllOptionsControls, enableApplyControls, showSelectedCount, selectAllButtonProps, clearAllButtonProps, selectedCountProps, cancelButtonProps, applyButtonProps, renderOption, onOpenStateChanged, enableAutoUnmount, onBlur, showGroupOptionDivider, enableVirtualization, virtualizationOptions, infiniteScroll, }: MultipleSelectBoxProps<T, AdditionalProps>): import("react/jsx-runtime").JSX.Element;
@@ -34,7 +34,7 @@ const SKELETON_ITEM_COUNT = 4;
34
34
  */
35
35
  export function MultipleSelectBox({ id, triggerProps, triggerWrapperProps, size, options = [], defaultValue,
36
36
  // eslint-disable-next-line @typescript-eslint/no-deprecated
37
- placeholder, emptyMessage, disabled, invalid, targetDOMNode, name, onChange, value, showDisplayValueAsTag, renderDisplayValue, enableSearchOptions = false, notFoundMessage, searchBoxProps, loading = false, onSearchOptions, clearButtonProps, disableClearButton = false, optionPanelProps, popoverWrapperProps, enableAllOptionsControls = false, enableApplyControls = false, selectAllButtonProps, clearAllButtonProps, selectedCountProps, cancelButtonProps, applyButtonProps, renderOption, onOpenStateChanged, enableAutoUnmount = true, onBlur, showGroupOptionDivider, enableVirtualization = false, virtualizationOptions, infiniteScroll, }) {
37
+ placeholder, emptyMessage, disabled, invalid, targetDOMNode, name, onChange, value, showDisplayValueAsTag, renderDisplayValue, enableSearchOptions = false, notFoundMessage, searchBoxProps, loading = false, onSearchOptions, clearButtonProps, disableClearButton = false, optionPanelProps, popoverWrapperProps, enableAllOptionsControls = false, enableApplyControls = false, showSelectedCount = false, selectAllButtonProps, clearAllButtonProps, selectedCountProps, cancelButtonProps, applyButtonProps, renderOption, onOpenStateChanged, enableAutoUnmount = true, onBlur, showGroupOptionDivider, enableVirtualization = false, virtualizationOptions, infiniteScroll, }) {
38
38
  const classes = multipleSelectBoxSlotRecipe({ showGroupOptionDivider });
39
39
  const triggerRef = useRef(null);
40
40
  const listBoxId = useId();
@@ -325,5 +325,8 @@ placeholder, emptyMessage, disabled, invalid, targetDOMNode, name, onChange, val
325
325
  ? notFoundMessage
326
326
  : emptyMessage }) }, "empty"),
327
327
  renderInfiniteScrollError(),
328
- ].filter(Boolean) }) }), enableApplyControls ? (_jsxs(HStack, { className: cx(classes.menuFooter, 'mfui-MultipleSelectBox__menuFooter'), justifyContent: "space-between", alignItems: "center", children: [_jsx(Typography, { variant: "body", color: "neutral.600", children: selectedCountProps?.render?.(temporaryValues.size) ?? `${String(temporaryValues.size)}件選択中` }), _jsxs(HStack, { gap: "horizontal.0-1of2", children: [_jsx(Button, { ref: cancelButtonRef, size: "small", priority: "secondary", onClick: handleCancelButtonClick, children: cancelButtonProps?.label ?? 'キャンセル' }), _jsx(Button, { ref: applyButtonRef, size: "small", priority: "primary", onClick: handleApplyButtonClick, children: applyButtonProps?.label ?? '適用' })] })] })) : null] })), open: isOptionPanelOpen, targetDOMNode: targetDOMNode, enableAutoUnmount: enableAutoUnmount, onOpenStateChanged: toggleOptionPanel, onBlur: onBlur }));
328
+ ].filter(Boolean) }) }), enableApplyControls || showSelectedCount ? (_jsxs(HStack, { className: cx(classes.menuFooter, 'mfui-MultipleSelectBox__menuFooter'), justifyContent: "space-between", alignItems: "center", children: [_jsx(Typography, { variant: "body", color: "neutral.600", children: enableApplyControls
329
+ ? (selectedCountProps?.render?.(temporaryValues.size) ?? `${String(temporaryValues.size)}件選択中`)
330
+ : (selectedCountProps?.render?.(localSelectedValuesSet.size) ??
331
+ `${String(localSelectedValuesSet.size)}件選択中`) }), enableApplyControls ? (_jsxs(HStack, { gap: "horizontal.0-1of2", children: [_jsx(Button, { ref: cancelButtonRef, size: "small", priority: "secondary", onClick: handleCancelButtonClick, children: cancelButtonProps?.label ?? 'キャンセル' }), _jsx(Button, { ref: applyButtonRef, size: "small", priority: "primary", onClick: handleApplyButtonClick, children: applyButtonProps?.label ?? '適用' })] })) : null] })) : null] })), open: isOptionPanelOpen, targetDOMNode: targetDOMNode, enableAutoUnmount: enableAutoUnmount, onOpenStateChanged: toggleOptionPanel, onBlur: onBlur }));
329
332
  }
@@ -235,6 +235,15 @@ export type MultipleSelectBoxProps<T extends AllowedValueTypes = string, Additio
235
235
  * @default false
236
236
  */
237
237
  enableApplyControls?: boolean;
238
+ /**
239
+ * Whether to show the number of selected options in the popover footer.
240
+ * When `enableApplyControls` is true, the count is always shown automatically.
241
+ * When `enableApplyControls` is false, this prop controls the visibility.
242
+ * The count reflects the actual confirmed selection.
243
+ *
244
+ * @default false
245
+ */
246
+ showSelectedCount?: boolean;
238
247
  /**
239
248
  * Properties for the "Select All Button"
240
249
  */
@@ -10,4 +10,4 @@ export declare const RadioButton: import("react").ForwardRefExoticComponent<{
10
10
  label?: string;
11
11
  checked?: boolean | undefined;
12
12
  disabled?: boolean | undefined;
13
- } & Omit<Omit<import("react").DetailedHTMLProps<import("react").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "ref">, "disabled" | "checked"> & import("react").RefAttributes<HTMLInputElement>>;
13
+ } & Omit<Omit<import("react").DetailedHTMLProps<import("react").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "ref">, "checked" | "disabled"> & import("react").RefAttributes<HTMLInputElement>>;
@@ -10,4 +10,4 @@
10
10
  *
11
11
  * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/div
12
12
  */
13
- export declare const RadioGroup: import("react").ForwardRefExoticComponent<Pick<import("..").RadioButtonProps, "disabled" | "name" | "value" | "defaultValue" | "onChange"> & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, "onChange"> & import("react").RefAttributes<HTMLDivElement>>;
13
+ export declare const RadioGroup: import("react").ForwardRefExoticComponent<Pick<import("..").RadioButtonProps, "name" | "onChange" | "defaultValue" | "disabled" | "value"> & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, "onChange"> & import("react").RefAttributes<HTMLDivElement>>;
@@ -1,8 +1,9 @@
1
+ import { type SplitViewProps } from './SplitView.types';
1
2
  /**
2
3
  * A resizable split layout component with two panels.
3
4
  *
4
5
  * Users can adjust panel sizes by dragging the divider between panels.
5
- * The right panel can be shown or hidden using the `isOpen` prop.
6
+ * The controlled panel (determined by `targetPanel`) can be shown or hidden using the `isOpen` prop.
6
7
  *
7
8
  * @example
8
9
  * ```tsx
@@ -12,22 +13,12 @@
12
13
  * leftPanelSlot={<div>Left Panel</div>}
13
14
  * rightPanelSlot={<div>Right Panel</div>}
14
15
  * isOpen={isOpen}
15
- * initialRightPanelSize={300}
16
- * minRightPanelSize={200}
17
- * maxRightPanelSize={500}
16
+ * targetPanel="right"
17
+ * initialPanelSize={300}
18
+ * minPanelSize={200}
19
+ * maxPanelSize={500}
18
20
  * style={{ minWidth: '600px' }}
19
21
  * />
20
22
  * ```
21
23
  */
22
- export declare const SplitView: import("react").ForwardRefExoticComponent<{
23
- leftPanelSlot: import("react").ReactNode;
24
- rightPanelSlot: import("react").ReactNode;
25
- isOpen?: boolean;
26
- initialRightPanelSize: import("react").CSSProperties["width"];
27
- minRightPanelSize: import("react").CSSProperties["minWidth"];
28
- maxRightPanelSize: import("react").CSSProperties["maxWidth"];
29
- leftPanelProps?: import("react").ComponentPropsWithoutRef<"div">;
30
- rightPanelProps?: import("react").ComponentPropsWithoutRef<"div">;
31
- dividerProps?: import("react").ComponentPropsWithoutRef<"div">;
32
- enableAutoUnmount?: boolean;
33
- } & Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
24
+ export declare const SplitView: import("react").ForwardRefExoticComponent<SplitViewProps & import("react").RefAttributes<HTMLDivElement>>;