ingred-ui 28.1.0 → 28.2.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.
- package/dist/components/Checkbox/Checkbox.stories.d.ts +2 -2
- package/dist/components/CheckboxCard/CheckboxCard.d.ts +8 -0
- package/dist/components/CheckboxCard/CheckboxCard.stories.d.ts +46 -0
- package/dist/components/CheckboxCard/__tests__/CheckboxCard.test.d.ts +1 -0
- package/dist/components/CheckboxCard/index.d.ts +2 -0
- package/dist/components/CheckboxCard/types.d.ts +9 -0
- package/dist/components/IconText/IconText.d.ts +25 -0
- package/dist/components/IconText/IconText.stories.d.ts +10 -0
- package/dist/components/IconText/__tests__/IconText.test.d.ts +1 -0
- package/dist/components/IconText/index.d.ts +3 -0
- package/dist/components/IconText/styled.d.ts +11 -0
- package/dist/components/IconText/types.d.ts +25 -0
- package/dist/components/RadioCard/RadioCard.d.ts +8 -0
- package/dist/components/RadioCard/RadioCard.stories.d.ts +41 -0
- package/dist/components/RadioCard/__tests__/RadioCard.test.d.ts +1 -0
- package/dist/components/RadioCard/index.d.ts +2 -0
- package/dist/components/RadioCard/types.d.ts +10 -0
- package/dist/components/SelectableCard/SelectableCardLayout.d.ts +4 -0
- package/dist/components/SelectableCard/__tests__/utils.test.d.ts +1 -0
- package/dist/components/SelectableCard/styled.d.ts +24 -0
- package/dist/components/SelectableCard/types.d.ts +11 -0
- package/dist/components/SelectableCard/useSelectableCardHeaderClick.d.ts +10 -0
- package/dist/components/SelectableCard/utils.d.ts +2 -0
- package/dist/components/index.d.ts +5 -0
- package/dist/index.es.js +813 -704
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +815 -706
- package/dist/index.js.map +1 -1
- package/dist/styles/interaction.d.ts +3 -1
- package/package.json +1 -1
|
@@ -53,7 +53,7 @@ declare const _default: {
|
|
|
53
53
|
results?: number | undefined;
|
|
54
54
|
security?: string | undefined;
|
|
55
55
|
unselectable?: "on" | "off" | undefined;
|
|
56
|
-
inputMode?: "text" | "
|
|
56
|
+
inputMode?: "text" | "none" | "search" | "email" | "tel" | "url" | "numeric" | "decimal" | undefined;
|
|
57
57
|
is?: string | undefined;
|
|
58
58
|
'aria-activedescendant'?: string | undefined;
|
|
59
59
|
'aria-atomic'?: (boolean | "true" | "false") | undefined;
|
|
@@ -98,7 +98,7 @@ declare const _default: {
|
|
|
98
98
|
'aria-rowspan'?: number | undefined;
|
|
99
99
|
'aria-selected'?: (boolean | "true" | "false") | undefined;
|
|
100
100
|
'aria-setsize'?: number | undefined;
|
|
101
|
-
'aria-sort'?: "
|
|
101
|
+
'aria-sort'?: "none" | "other" | "ascending" | "descending" | undefined;
|
|
102
102
|
'aria-valuemax'?: number | undefined;
|
|
103
103
|
'aria-valuemin'?: number | undefined;
|
|
104
104
|
'aria-valuenow'?: number | undefined;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
declare const CheckboxCard: React.ForwardRefExoticComponent<Omit<import("../Checkbox").CheckBoxProps, "slot" | "children"> & {
|
|
3
|
+
title: React.ReactNode;
|
|
4
|
+
description?: React.ReactNode;
|
|
5
|
+
slotContent?: React.ReactNode;
|
|
6
|
+
slotExpansion?: import("..").SlotExpansion | undefined;
|
|
7
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
8
|
+
export default CheckboxCard;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { StoryObj } from "@storybook/react-vite";
|
|
3
|
+
declare const _default: {
|
|
4
|
+
title: string;
|
|
5
|
+
component: React.ForwardRefExoticComponent<Omit<import("..").CheckBoxProps, "slot" | "children"> & {
|
|
6
|
+
title: React.ReactNode;
|
|
7
|
+
description?: React.ReactNode;
|
|
8
|
+
slotContent?: React.ReactNode;
|
|
9
|
+
slotExpansion?: import("..").SlotExpansion | undefined;
|
|
10
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
11
|
+
parameters: {
|
|
12
|
+
docs: {
|
|
13
|
+
description: {
|
|
14
|
+
component: string;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
argTypes: {
|
|
19
|
+
disabled: {
|
|
20
|
+
control: {
|
|
21
|
+
type: string;
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
checked: {
|
|
25
|
+
control: {
|
|
26
|
+
type: string;
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
indeterminate: {
|
|
30
|
+
control: {
|
|
31
|
+
type: string;
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
slotExpansion: {
|
|
35
|
+
control: {
|
|
36
|
+
type: string;
|
|
37
|
+
};
|
|
38
|
+
options: string[];
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
export default _default;
|
|
43
|
+
/** 上からシンプル→複雑(各ブロック独立した state) */
|
|
44
|
+
export declare const Showcase: StoryObj;
|
|
45
|
+
/** 未チェックのときだけスロット内容を disabled にする例(slot は always で常時表示) */
|
|
46
|
+
export declare const SlotInputsDependOnChecked: StoryObj;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "@testing-library/jest-dom";
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
import type { CheckBoxProps } from "../Checkbox";
|
|
3
|
+
import type { SlotExpansion } from "../SelectableCard/types";
|
|
4
|
+
export type CheckboxCardProps = Omit<CheckBoxProps, "children" | "slot"> & {
|
|
5
|
+
title: ReactNode;
|
|
6
|
+
description?: ReactNode;
|
|
7
|
+
slotContent?: ReactNode;
|
|
8
|
+
slotExpansion?: SlotExpansion;
|
|
9
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { type AnchorHTMLAttributes, type ReactElement, type ReactNode } from "react";
|
|
2
|
+
import { type IconTextSize, type IconTextPos } from "./types";
|
|
3
|
+
export type IconTextProps = {
|
|
4
|
+
/** 単体アイコンのとき(`prependIcon`/`appendIcon` 未指定時)。 */
|
|
5
|
+
icon?: ReactElement;
|
|
6
|
+
size?: IconTextSize;
|
|
7
|
+
/** 単体 `icon` の配置。両端アイコン指定時は無視される。 */
|
|
8
|
+
pos?: IconTextPos;
|
|
9
|
+
/** テキスト左側のアイコン。`appendIcon` と同時指定可。その場合 `icon` / `pos` は無視。 */
|
|
10
|
+
prependIcon?: ReactElement;
|
|
11
|
+
/** テキスト右側のアイコン。同上。 */
|
|
12
|
+
appendIcon?: ReactElement;
|
|
13
|
+
/**
|
|
14
|
+
* テキストとアイコンの共通デフォルト色(CSS カラー)。
|
|
15
|
+
* 非リンク時: 省略時は黒。`iconColor` / `textColor` で個別上書き可。
|
|
16
|
+
* リンク時: 共通色には使わず(プライマリが既定)。個別指定は `iconColor` / `textColor`。
|
|
17
|
+
*/
|
|
18
|
+
color?: string;
|
|
19
|
+
/** アイコン色のみ指定。省略時は `color`(非リンク)またはプライマリ(リンク)にフォールバック */
|
|
20
|
+
iconColor?: string;
|
|
21
|
+
/** テキスト色のみ指定。省略時は `color`(非リンク)またはプライマリ(リンク)にフォールバック */
|
|
22
|
+
textColor?: string;
|
|
23
|
+
children: ReactNode;
|
|
24
|
+
} & Omit<AnchorHTMLAttributes<HTMLAnchorElement>, "color">;
|
|
25
|
+
export declare const IconText: ({ icon, size, pos, prependIcon, appendIcon, color, iconColor, textColor, children, ...rest }: IconTextProps) => JSX.Element;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { StoryObj } from "@storybook/react-vite";
|
|
3
|
+
declare const meta: Meta<({ icon, size, pos, prependIcon, appendIcon, color, iconColor, textColor, children, ...rest }: import("./IconText").IconTextProps) => JSX.Element>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof meta>;
|
|
6
|
+
export declare const Default: Story;
|
|
7
|
+
export declare const Sizes: Story;
|
|
8
|
+
export declare const Positions: Story;
|
|
9
|
+
export declare const DualIcons: Story;
|
|
10
|
+
export declare const Colors: Story;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "@testing-library/jest-dom";
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { IconTextSize } from "./types";
|
|
2
|
+
type StyledIconTextProps = {
|
|
3
|
+
$size: IconTextSize;
|
|
4
|
+
$isLink: boolean;
|
|
5
|
+
};
|
|
6
|
+
/** 先に定義し、Container の hover で参照して下線色をテキストの color と揃える */
|
|
7
|
+
export declare const Text: import("styled-components").StyledComponent<"span", import("styled-components").DefaultTheme, {
|
|
8
|
+
$color: string;
|
|
9
|
+
}, never>;
|
|
10
|
+
export declare const Container: import("styled-components").StyledComponent<"a", import("styled-components").DefaultTheme, StyledIconTextProps, never>;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export type IconTextSize = "xs" | "small" | "medium" | "large";
|
|
2
|
+
export type IconTextPos = "prepend" | "append";
|
|
3
|
+
/** Figma Icon text と対応(xs〜large) */
|
|
4
|
+
export declare const ICON_TEXT_SIZES: {
|
|
5
|
+
readonly xs: {
|
|
6
|
+
readonly iconSize: 14;
|
|
7
|
+
readonly fontSize: 12;
|
|
8
|
+
readonly gap: "2px";
|
|
9
|
+
};
|
|
10
|
+
readonly small: {
|
|
11
|
+
readonly iconSize: 16;
|
|
12
|
+
readonly fontSize: 13;
|
|
13
|
+
readonly gap: "4px";
|
|
14
|
+
};
|
|
15
|
+
readonly medium: {
|
|
16
|
+
readonly iconSize: 18;
|
|
17
|
+
readonly fontSize: 14;
|
|
18
|
+
readonly gap: "6px";
|
|
19
|
+
};
|
|
20
|
+
readonly large: {
|
|
21
|
+
readonly iconSize: 20;
|
|
22
|
+
readonly fontSize: 16;
|
|
23
|
+
readonly gap: "6px";
|
|
24
|
+
};
|
|
25
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
declare const RadioCard: React.ForwardRefExoticComponent<Omit<import("../RadioButton").RadioButtonProps, "slot" | "children"> & {
|
|
3
|
+
title: React.ReactNode;
|
|
4
|
+
description?: React.ReactNode;
|
|
5
|
+
slotContent?: React.ReactNode;
|
|
6
|
+
slotExpansion?: import("./types").SlotExpansion | undefined;
|
|
7
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
8
|
+
export default RadioCard;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { StoryObj } from "@storybook/react-vite";
|
|
3
|
+
declare const _default: {
|
|
4
|
+
title: string;
|
|
5
|
+
component: React.ForwardRefExoticComponent<Omit<import("..").RadioButtonProps, "slot" | "children"> & {
|
|
6
|
+
title: React.ReactNode;
|
|
7
|
+
description?: React.ReactNode;
|
|
8
|
+
slotContent?: React.ReactNode;
|
|
9
|
+
slotExpansion?: import("..").SlotExpansion | undefined;
|
|
10
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
11
|
+
parameters: {
|
|
12
|
+
docs: {
|
|
13
|
+
description: {
|
|
14
|
+
component: string;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
argTypes: {
|
|
19
|
+
disabled: {
|
|
20
|
+
control: {
|
|
21
|
+
type: string;
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
checked: {
|
|
25
|
+
control: {
|
|
26
|
+
type: string;
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
slotExpansion: {
|
|
30
|
+
control: {
|
|
31
|
+
type: string;
|
|
32
|
+
};
|
|
33
|
+
options: string[];
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
export default _default;
|
|
38
|
+
/** 上からシンプル→複雑(各ブロック独立した state) */
|
|
39
|
+
export declare const Showcase: StoryObj;
|
|
40
|
+
/** 未選択のときだけスロット内容を disabled にする例(slot は always で常時表示) */
|
|
41
|
+
export declare const SlotInputsDependOnChecked: StoryObj;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "@testing-library/jest-dom";
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
import type { RadioButtonProps } from "../RadioButton";
|
|
3
|
+
import type { SlotExpansion } from "../SelectableCard/types";
|
|
4
|
+
export type { SlotExpansion };
|
|
5
|
+
export type RadioCardProps = Omit<RadioButtonProps, "children" | "slot"> & {
|
|
6
|
+
title: ReactNode;
|
|
7
|
+
description?: ReactNode;
|
|
8
|
+
slotContent?: ReactNode;
|
|
9
|
+
slotExpansion?: SlotExpansion;
|
|
10
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export declare const Root: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
|
|
2
|
+
$checked: boolean;
|
|
3
|
+
$disabled: boolean;
|
|
4
|
+
}, never>;
|
|
5
|
+
export declare const HeaderRow: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
|
|
6
|
+
$checked: boolean;
|
|
7
|
+
$disabled: boolean;
|
|
8
|
+
$clickable?: boolean | undefined;
|
|
9
|
+
}, never>;
|
|
10
|
+
/** grid 0fr/1fr でスロット開閉をアニメーション */
|
|
11
|
+
export declare const SlotExpandWrapper: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
|
|
12
|
+
$open: boolean;
|
|
13
|
+
}, never>;
|
|
14
|
+
export declare const SlotOverflow: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
15
|
+
export declare const Slot: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
|
|
16
|
+
$checked: boolean;
|
|
17
|
+
$disabled: boolean;
|
|
18
|
+
}, never>;
|
|
19
|
+
/** For click-boundary checks only; does not generate a box (no extra height vs bare span). */
|
|
20
|
+
export declare const ControlWrap: import("styled-components").StyledComponent<"span", import("styled-components").DefaultTheme, {}, never>;
|
|
21
|
+
export declare const HeaderControlRow: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
22
|
+
export declare const CardDescription: import("styled-components").StyledComponent<"span", import("styled-components").DefaultTheme, {
|
|
23
|
+
$disabled?: boolean | undefined;
|
|
24
|
+
}, never>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export type SlotExpansion = "whenChecked" | "always";
|
|
3
|
+
export type SelectableCardLayoutProps = {
|
|
4
|
+
checked: boolean;
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
header: React.ReactNode;
|
|
7
|
+
/** ヘッダー領域全体のクリック(コントロール外からの選択用) */
|
|
8
|
+
onHeaderClick?: (e: React.MouseEvent<HTMLDivElement>) => void;
|
|
9
|
+
slot?: React.ReactNode;
|
|
10
|
+
slotExpansion?: SlotExpansion;
|
|
11
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
/**
|
|
3
|
+
* ヘッダー領域クリックで input をトグルするための ref・ハンドラ。
|
|
4
|
+
* コントロール本体(ラベル内)のクリックと二重発火しないよう ControlWrap + contains で抑止する。
|
|
5
|
+
*/
|
|
6
|
+
export declare function useSelectableCardHeaderClick(disabled: boolean | undefined, inputRefProp: React.Ref<HTMLInputElement> | undefined): {
|
|
7
|
+
controlWrapRef: React.MutableRefObject<HTMLSpanElement | null>;
|
|
8
|
+
assignInputRef: (node: HTMLInputElement | null) => void;
|
|
9
|
+
handleHeaderClick: (e: React.MouseEvent<HTMLDivElement>) => void;
|
|
10
|
+
};
|
|
@@ -19,6 +19,8 @@ export { default as Card } from "./Card";
|
|
|
19
19
|
export * from "./Card";
|
|
20
20
|
export { default as Checkbox } from "./Checkbox";
|
|
21
21
|
export * from "./Checkbox";
|
|
22
|
+
export { default as CheckboxCard } from "./CheckboxCard";
|
|
23
|
+
export * from "./CheckboxCard";
|
|
22
24
|
export { default as ClickAwayListener } from "./ClickAwayListener";
|
|
23
25
|
export * from "./ClickAwayListener";
|
|
24
26
|
export { default as ConfirmModal } from "./ConfirmModal";
|
|
@@ -67,6 +69,7 @@ export { default as Grow } from "./Grow";
|
|
|
67
69
|
export * from "./Grow";
|
|
68
70
|
export { default as Icon } from "./Icon";
|
|
69
71
|
export * from "./Icon";
|
|
72
|
+
export * from "./IconText";
|
|
70
73
|
export { default as Input } from "./Input";
|
|
71
74
|
export * from "./Input";
|
|
72
75
|
export { default as ItemEmpty } from "./ItemEmpty";
|
|
@@ -97,6 +100,8 @@ export { default as Popover } from "./Popover";
|
|
|
97
100
|
export * from "./Popover";
|
|
98
101
|
export { default as Portal } from "./Portal";
|
|
99
102
|
export * from "./Portal";
|
|
103
|
+
export { default as RadioCard } from "./RadioCard";
|
|
104
|
+
export * from "./RadioCard";
|
|
100
105
|
export { default as RadioButton } from "./RadioButton";
|
|
101
106
|
export * from "./RadioButton";
|
|
102
107
|
export { default as ScrollArea } from "./ScrollArea";
|