ingred-ui 31.1.0 → 32.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3,5 +3,5 @@ export type LabelFixtureTooltip = (isFixed: boolean) => string;
3
3
  type Props = {
4
4
  labelFixtureTooltip?: LabelFixtureTooltip;
5
5
  };
6
- declare const Fixture: React.ForwardRefExoticComponent<Props & React.RefAttributes<HTMLDivElement>>;
6
+ declare const Fixture: React.ForwardRefExoticComponent<Props & React.RefAttributes<HTMLButtonElement>>;
7
7
  export { Fixture };
@@ -1 +1,2 @@
1
- export declare const Container: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<any, never> & Partial<Pick<any, never>>> & string;
1
+ /** Tooltip の参照要素。子の入れ替え時もホバー追跡を安定させる */
2
+ export declare const FixtureTooltipAnchor: import("styled-components/dist/types").IStyledComponentBase<"web", any> & string;
@@ -0,0 +1,9 @@
1
+ import React from "react";
2
+ /**
3
+ * モバイルの「メニューを開く」ボタン。
4
+ *
5
+ * `NavigationRail.Container` 配下の任意の場所(独自 AppBar 内など)に設置できる。
6
+ * 設置すると Container は自動でデフォルト(右上固定)のメニューボタンを描画しなくなるため、
7
+ * 二重描画にならない。開閉ロジック・通知バッジ・アクセシビリティは組み込みと同一。
8
+ */
9
+ export declare const MobileMenuButton: React.ForwardRefExoticComponent<React.RefAttributes<HTMLButtonElement>>;
@@ -0,0 +1,7 @@
1
+ import React from "react";
2
+ /**
3
+ * モバイルの「メニューを開く」ボタン本体(presentational)。
4
+ * 表示条件(モバイル かつ ドロワー閉)と通知バッジ表示を内包する。
5
+ * 配置(固定/インライン)は呼び出し側に委ねる。
6
+ */
7
+ export declare const MobileMenuButtonView: React.ForwardRefExoticComponent<React.RefAttributes<HTMLButtonElement>>;
@@ -0,0 +1 @@
1
+ export { MobileMenuButton } from "./MobileMenuButton";
@@ -6,6 +6,8 @@ import { Fixture } from "./Fixture";
6
6
  import { Menu } from "./Menu";
7
7
  import { ExpansionMenu } from "./ExpansionMenu";
8
8
  import { ExpansionMenuItem } from "./ExpansionMenuItem";
9
+ import { Slot, SlotContent } from "./Slot";
10
+ import { MobileMenuButton } from "./MobileMenuButton";
9
11
  type ExportedComponentType = {
10
12
  (props: Props & React.RefAttributes<HTMLDivElement>): JSX.Element;
11
13
  Container: typeof NavigationRailContainer;
@@ -17,13 +19,12 @@ type ExportedComponentType = {
17
19
  ExpansionMenuItem: typeof ExpansionMenuItem;
18
20
  Fixture: typeof Fixture;
19
21
  MainContent: typeof MainContent;
22
+ Slot: typeof Slot;
23
+ SlotContent: typeof SlotContent;
24
+ MobileMenuButton: typeof MobileMenuButton;
20
25
  };
21
26
  type Props = {
22
27
  children?: React.ReactNode;
23
- /**
24
- * モバイルメニューが開いた時に、閉じるボタンとメニューの間に表示するコンテンツ
25
- */
26
- mobileHeaderContent?: React.ReactNode;
27
28
  };
28
- declare const _default: ExportedComponentType;
29
- export default _default;
29
+ declare const ExportedComponent: ExportedComponentType;
30
+ export default ExportedComponent;
@@ -12,6 +12,23 @@ export type NavigationRailContainerProps = {
12
12
  * It can define callback function that triggered when NavigationRail is `fixed`.
13
13
  */
14
14
  onChangeFixed?: (isFixed: boolean) => void;
15
+ /**
16
+ * モバイル向けの未読件数。メニュー内の `Menu` / `ExpansionMenu` 等も含めた合算を渡す。
17
+ * ドロワー閉時はメニューを開くボタンに赤ドット(件数なし)、開時は Slot 内の通知ボタンへ件数表示。
18
+ */
19
+ notificationCount?: number;
20
+ /**
21
+ * デスクトップ向け、Slot 領域のみの未読件数(通知ボタンへ件数表示)。
22
+ * 折りたたみ時の `Fixture` には 1 件以上で赤ドットのみ(件数なし)。メニュー行とは別管理。
23
+ */
24
+ slotNotificationCount?: number;
25
+ /**
26
+ * モバイル時にデフォルト(右上固定)の「メニューを開く」ボタンを描画するか。
27
+ * `NavigationRail.MobileMenuButton` を配置した場合はデフォルトが自動抑制される。
28
+ * 自前ボタンのみ使う場合は `false` を指定する。
29
+ * @default true
30
+ */
31
+ showMobileMenuButton?: boolean;
15
32
  children: React.ReactNode;
16
33
  };
17
34
  declare const NavigationRailContainer: React.ForwardRefExoticComponent<NavigationRailContainerProps & React.RefAttributes<HTMLDivElement>>;
@@ -0,0 +1,13 @@
1
+ import React from "react";
2
+ export type SlotProps = {
3
+ children?: React.ReactNode;
4
+ /**
5
+ * 右端に表示する操作(デスクトップの Fixture など)。
6
+ * モバイル時は上段に閉じるボタンのみ表示し、`actions` は無視される。
7
+ * 下段 `children` の padding は利用側で指定する。
8
+ * 未指定時のデスクトップ: Fixture。
9
+ */
10
+ actions?: React.ReactNode;
11
+ };
12
+ declare const Slot: React.ForwardRefExoticComponent<SlotProps & React.RefAttributes<HTMLDivElement>>;
13
+ export { Slot };
@@ -0,0 +1,14 @@
1
+ import React from "react";
2
+ export type SlotContentVisibility = "desktop" | "mobile" | "all";
3
+ export type SlotContentProps = {
4
+ children?: React.ReactNode;
5
+ /**
6
+ * 表示するビューポート。
7
+ * - `desktop`: 576px 超のみ
8
+ * - `mobile`: 576px 以下のみ
9
+ * - `all`: 常に(レール開閉による非表示は Slot 側で制御)
10
+ */
11
+ visibility?: SlotContentVisibility;
12
+ };
13
+ declare const SlotContent: React.ForwardRefExoticComponent<SlotContentProps & React.RefAttributes<HTMLDivElement>>;
14
+ export { SlotContent };
@@ -0,0 +1,4 @@
1
+ export { Slot } from "./Slot";
2
+ export type { SlotProps } from "./Slot";
3
+ export { SlotContent } from "./SlotContent";
4
+ export type { SlotContentProps, SlotContentVisibility } from "./SlotContent";
@@ -0,0 +1,6 @@
1
+ export declare const MobileSlotRoot: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<any, never> & Partial<Pick<any, never>>> & string;
2
+ export declare const MobileCloseBar: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<any, never> & Partial<Pick<any, never>>> & string;
3
+ export declare const SlotBar: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<any, never> & Partial<Pick<any, never>>> & string;
4
+ export declare const SlotCustom: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<any, never> & Partial<Pick<any, never>>> & string;
5
+ export declare const SlotActions: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<any, never> & Partial<Pick<any, never>>> & string;
6
+ export declare const SlotContentWrapper: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<any, never> & Partial<Pick<any, never>>> & string;
@@ -1,9 +1,14 @@
1
1
  export declare const NavigationRailWidth: {
2
- readonly NARROW: "74px";
2
+ readonly NARROW: "64px";
3
3
  readonly WIDE: "256px";
4
4
  };
5
5
  export declare const NavigationRailContentHeight: {
6
6
  readonly HEADER: "72px";
7
7
  readonly FOOTER: "72px";
8
+ readonly SLOT: "56px";
9
+ /** モバイル Slot 上段(閉じるボタン専用行) */
10
+ readonly SLOT_MOBILE_CLOSE: "48px";
8
11
  };
9
12
  export declare const NavigationRailTransitionDuration = 0.3;
13
+ /** NotificationBadge overlay の角からのオフセット(%)。アイコンボタン向け */
14
+ export declare const NavigationRailBadgeOverlayOffsetPercent = 10;
@@ -0,0 +1,2 @@
1
+ import { type NavigationRailContextValues } from "../utils";
2
+ export declare function useNavigationRail(): NavigationRailContextValues;
@@ -3,4 +3,6 @@ export type { NavigationRailExpansionMenuProps } from "./ExpansionMenu";
3
3
  export type { NavigationRailExpansionMenuItemProps } from "./ExpansionMenuItem";
4
4
  export type { NavigationRailMenuProps } from "./Menu";
5
5
  export type { NavigationRailContainerProps } from "./NavigationRailContainer";
6
+ export type { SlotProps } from "./Slot";
7
+ export type { SlotContentProps, SlotContentVisibility } from "./Slot";
6
8
  export * from "./utils";
@@ -1,4 +1,2 @@
1
1
  export declare const Container: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<any, never> & Partial<Pick<any, never>>> & string;
2
2
  export declare const MobileOverlay: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<any, never> & Partial<Pick<any, never>>> & string;
3
- export declare const MobileCloseButton: import("styled-components/dist/types").IStyledComponentBase<"web", any> & string;
4
- export declare const MobileHeaderContent: import("styled-components/dist/types").IStyledComponentBase<"web", any> & string;
@@ -9,5 +9,20 @@ export type NavigationRailContextValues = {
9
9
  isMobile: boolean;
10
10
  isMobileMenuOpen: boolean;
11
11
  handleMobileMenuToggle?: () => void;
12
+ /**
13
+ * 任意位置に設置された `NavigationRail.MobileMenuButton` を登録する。
14
+ * 登録があると Container はデフォルト(右上固定)のメニューボタンを描画しない。
15
+ */
16
+ registerMobileMenuButton?: () => void;
17
+ unregisterMobileMenuButton?: () => void;
18
+ /**
19
+ * モバイル向けの未読件数(メニュー内の通知を含む合算。ドロワー閉時は開くボタンへ表示)。
20
+ */
21
+ notificationCount: number;
22
+ /**
23
+ * デスクトップ向け、Slot 領域のみの未読件数(通知ボタン・折りたたみ時の Fixture)。
24
+ */
25
+ slotNotificationCount: number;
12
26
  };
13
27
  export declare const NavigationRailContext: React.Context<NavigationRailContextValues>;
28
+ export { useNavigationRail } from "./hooks/useNavigationRail";
@@ -8,17 +8,23 @@ type NotificationBadgeBaseProps = NotificationBadgePillProps & {
8
8
  showZero?: boolean;
9
9
  invisible?: boolean;
10
10
  children: React.ReactNode;
11
+ /**
12
+ * overlay 時、角から外へずらす量(バッジ自身の幅・高さに対する %)。
13
+ * 小さいほど子(主にアイコン)に近づく。`0` で角に揃う。inline では無視される。
14
+ * @default 50
15
+ */
16
+ overlayOffsetPercent?: number;
11
17
  };
12
- type OverlayNormalProps = NotificationBadgeBaseProps & {
18
+ type OverlayLayoutProps = NotificationBadgeBaseProps & {
13
19
  layout?: "overlay";
14
- variant?: "normal";
15
20
  position?: "top-right" | "top-left" | "bottom-right" | "bottom-left";
21
+ };
22
+ type OverlayNormalProps = OverlayLayoutProps & {
23
+ variant?: "normal";
16
24
  dotSize?: never;
17
25
  };
18
- type OverlayDotProps = NotificationBadgeBaseProps & {
19
- layout?: "overlay";
26
+ type OverlayDotProps = OverlayLayoutProps & {
20
27
  variant: "dot";
21
- position?: "top-right" | "top-left" | "bottom-right" | "bottom-left";
22
28
  /** dot variant のサイズ */
23
29
  dotSize?: "small" | "medium" | "large";
24
30
  };
@@ -28,6 +34,7 @@ type InlineProps = NotificationBadgeBaseProps & {
28
34
  variant?: "normal";
29
35
  position?: never;
30
36
  dotSize?: never;
37
+ overlayOffsetPercent?: never;
31
38
  };
32
39
  export type NotificationBadgeProps = OverlayNormalProps | OverlayDotProps | InlineProps;
33
40
  declare const NotificationBadge: React.ForwardRefExoticComponent<NotificationBadgeProps & React.RefAttributes<HTMLDivElement>>;