ingred-ui 31.1.0 → 32.0.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;
@@ -6,6 +6,7 @@ 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";
9
10
  type ExportedComponentType = {
10
11
  (props: Props & React.RefAttributes<HTMLDivElement>): JSX.Element;
11
12
  Container: typeof NavigationRailContainer;
@@ -17,13 +18,11 @@ type ExportedComponentType = {
17
18
  ExpansionMenuItem: typeof ExpansionMenuItem;
18
19
  Fixture: typeof Fixture;
19
20
  MainContent: typeof MainContent;
21
+ Slot: typeof Slot;
22
+ SlotContent: typeof SlotContent;
20
23
  };
21
24
  type Props = {
22
25
  children?: React.ReactNode;
23
- /**
24
- * モバイルメニューが開いた時に、閉じるボタンとメニューの間に表示するコンテンツ
25
- */
26
- mobileHeaderContent?: React.ReactNode;
27
26
  };
28
- declare const _default: ExportedComponentType;
29
- export default _default;
27
+ declare const ExportedComponent: ExportedComponentType;
28
+ export default ExportedComponent;
@@ -12,6 +12,16 @@ 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;
15
25
  children: React.ReactNode;
16
26
  };
17
27
  declare const NavigationRailContainer: React.ForwardRefExoticComponent<NavigationRailContainerProps & React.RefAttributes<HTMLDivElement>>;
@@ -1,2 +1,2 @@
1
1
  export declare const Container: import("styled-components/dist/types").IStyledComponentBase<"web", any> & string;
2
- export declare const MobileMenuButton: import("styled-components/dist/types").IStyledComponentBase<"web", any> & string;
2
+ export declare const MobileMenuButton: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<any, never> & Partial<Pick<any, never>>> & string;
@@ -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,14 @@ export type NavigationRailContextValues = {
9
9
  isMobile: boolean;
10
10
  isMobileMenuOpen: boolean;
11
11
  handleMobileMenuToggle?: () => void;
12
+ /**
13
+ * モバイル向けの未読件数(メニュー内の通知を含む合算。ドロワー閉時は開くボタンへ表示)。
14
+ */
15
+ notificationCount: number;
16
+ /**
17
+ * デスクトップ向け、Slot 領域のみの未読件数(通知ボタン・折りたたみ時の Fixture)。
18
+ */
19
+ slotNotificationCount: number;
12
20
  };
13
21
  export declare const NavigationRailContext: React.Context<NavigationRailContextValues>;
22
+ 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>>;