ingred-ui 27.0.5 → 27.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.
@@ -36,4 +36,5 @@ export declare const NormalWithIcon: StoryObj<typeof Badge>;
36
36
  export declare const Pill: StoryObj<typeof Badge>;
37
37
  export declare const Signal: StoryObj<typeof Badge>;
38
38
  export declare const SizesComparison: StoryObj<typeof Badge>;
39
+ export declare const PillColorVariations: StoryObj<typeof Badge>;
39
40
  export declare const ColorVariations: StoryObj<typeof Badge>;
@@ -1,13 +1,34 @@
1
1
  import * as React from "react";
2
- export type NotificationBadgeProps = {
3
- variant?: "normal" | "dot";
2
+ import type { BadgeProps } from "../Badge/types";
3
+ /** `layout="inline"` のとき `Badge`(`type="pill"`)へ渡すプロップ(BadgeProps のサブセット。いずれも省略可) */
4
+ export type NotificationBadgePillProps = Partial<Pick<BadgeProps, "color" | "fontSize" | "fontWeight" | "size">>;
5
+ type NotificationBadgeBaseProps = NotificationBadgePillProps & {
4
6
  badgeContent?: number | string;
5
- position?: "top-right" | "top-left" | "bottom-right" | "bottom-left";
6
7
  max?: number;
7
8
  showZero?: boolean;
8
9
  invisible?: boolean;
9
- dotSize?: "small" | "medium" | "large";
10
10
  children: React.ReactNode;
11
11
  };
12
+ type OverlayNormalProps = NotificationBadgeBaseProps & {
13
+ layout?: "overlay";
14
+ variant?: "normal";
15
+ position?: "top-right" | "top-left" | "bottom-right" | "bottom-left";
16
+ dotSize?: never;
17
+ };
18
+ type OverlayDotProps = NotificationBadgeBaseProps & {
19
+ layout?: "overlay";
20
+ variant: "dot";
21
+ position?: "top-right" | "top-left" | "bottom-right" | "bottom-left";
22
+ /** dot variant のサイズ */
23
+ dotSize?: "small" | "medium" | "large";
24
+ };
25
+ type InlineProps = NotificationBadgeBaseProps & {
26
+ /** 子と並べて右端に数値 pill を表示 */
27
+ layout: "inline";
28
+ variant?: "normal";
29
+ position?: never;
30
+ dotSize?: never;
31
+ };
32
+ export type NotificationBadgeProps = OverlayNormalProps | OverlayDotProps | InlineProps;
12
33
  declare const NotificationBadge: React.ForwardRefExoticComponent<NotificationBadgeProps & React.RefAttributes<HTMLDivElement>>;
13
34
  export default NotificationBadge;
@@ -9,3 +9,5 @@ export default _default;
9
9
  export declare const Number: StoryObj<NotificationBadgeProps>;
10
10
  export declare const Text: StoryObj<NotificationBadgeProps>;
11
11
  export declare const Dot: StoryObj<NotificationBadgeProps>;
12
+ export declare const InlinePill: StoryObj<NotificationBadgeProps>;
13
+ export declare const InlinePillColors: () => JSX.Element;
@@ -1,2 +1,2 @@
1
1
  export { default } from "./NotificationBadge";
2
- export type { NotificationBadgeProps } from "./NotificationBadge";
2
+ export type { NotificationBadgePillProps, NotificationBadgeProps, } from "./NotificationBadge";
@@ -1,9 +1,12 @@
1
1
  export declare const Container: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
2
- type BadgeProps = {
3
- variant: "dot" | "normal";
2
+ export declare const InlineContainer: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
3
+ type BadgeAnchorProps = {
4
4
  position: string;
5
- size: string;
6
5
  invisible: boolean;
7
6
  };
8
- export declare const Badge: import("styled-components").StyledComponent<"span", import("styled-components").DefaultTheme, BadgeProps, never>;
7
+ export declare const BadgeAnchor: import("styled-components").StyledComponent<"span", import("styled-components").DefaultTheme, BadgeAnchorProps, never>;
8
+ export declare const DotBadge: import("styled-components").StyledComponent<"span", import("styled-components").DefaultTheme, {
9
+ size: string;
10
+ invisible: boolean;
11
+ }, never>;
9
12
  export {};
@@ -3,6 +3,8 @@ type TabsProps<T> = {
3
3
  data: {
4
4
  text: string;
5
5
  count?: number;
6
+ /** 省略時は 99。`count` がこれを超えると `99+` 形式で表示 */
7
+ countMax?: number;
6
8
  value: T;
7
9
  }[];
8
10
  value: T;
@@ -5,6 +5,7 @@ declare const _default: {
5
5
  data: {
6
6
  text: string;
7
7
  count?: number | undefined;
8
+ countMax?: number | undefined;
8
9
  value: T;
9
10
  }[];
10
11
  value: T;
@@ -14,6 +15,7 @@ declare const _default: {
14
15
  data: {
15
16
  text: string;
16
17
  count?: number | undefined;
18
+ countMax?: number | undefined;
17
19
  value: unknown;
18
20
  }[];
19
21
  value: unknown;
@@ -25,3 +27,4 @@ export default _default;
25
27
  export declare const Example: () => JSX.Element;
26
28
  export declare const WithBadge: () => JSX.Element;
27
29
  export declare const FixableBadge: () => JSX.Element;
30
+ export declare const WithBadgeCountMax: () => JSX.Element;
@@ -2,6 +2,7 @@ import * as React from "react";
2
2
  type TabProps = {
3
3
  text: string;
4
4
  count?: number;
5
+ countMax?: number;
5
6
  value: any;
6
7
  selected: boolean;
7
8
  onChange?: (value: any) => void;