ingred-ui 19.5.0 → 19.7.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/DualListBox2/DualListBox2.d.ts +50 -0
- package/dist/components/DualListBox2/DualListBox2.stories.d.ts +56 -0
- package/dist/components/DualListBox2/DualListBox2Accordion.d.ts +9 -0
- package/dist/components/DualListBox2/DualListBox2Item.d.ts +12 -0
- package/dist/components/DualListBox2/DualListBox2Section.d.ts +10 -0
- package/dist/components/DualListBox2/__tests__/DualListBox2.test.d.ts +1 -0
- package/dist/components/DualListBox2/__tests__/utils.test.d.ts +1 -0
- package/dist/components/DualListBox2/index.d.ts +6 -0
- package/dist/components/DualListBox2/lib.d.ts +23 -0
- package/dist/components/DualListBox2/styled.d.ts +35 -0
- package/dist/components/DualListBox2/types.d.ts +5 -0
- package/dist/components/RadioButton/RadioButton.d.ts +11 -1
- package/dist/components/RadioButton/RadioButton.stories.d.ts +17 -2
- package/dist/components/RadioButton/styled.d.ts +13 -0
- package/dist/index.es.js +2 -2
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/package.json +2 -1
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import React, { type ReactNode } from "react";
|
|
2
|
+
import { type Item } from "./types";
|
|
3
|
+
type DualListBox2Props = {
|
|
4
|
+
/**
|
|
5
|
+
* 選択済みの「追加」項目
|
|
6
|
+
**/
|
|
7
|
+
included: Item[];
|
|
8
|
+
/**
|
|
9
|
+
* 選択済みの「除外」項目
|
|
10
|
+
**/
|
|
11
|
+
excluded: Item[];
|
|
12
|
+
/**
|
|
13
|
+
* 追加ボタンを非活性にし、「排他のみモード」にするかどうか
|
|
14
|
+
**/
|
|
15
|
+
disableInclude?: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* 除外ボタンを非活性にし、「排他のみモード」にするかどうか
|
|
18
|
+
**/
|
|
19
|
+
disableExclude?: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* メニューに表示するボタン要素
|
|
22
|
+
**/
|
|
23
|
+
menuButtons?: ReactNode;
|
|
24
|
+
/**
|
|
25
|
+
* ローディング中かどうかのフラグ
|
|
26
|
+
**/
|
|
27
|
+
loading?: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* 項目リスト(DualListBox2Item, DualListBox2Accordion, DualListBox2Section のいずれかのみ)
|
|
30
|
+
**/
|
|
31
|
+
children: ReactNode;
|
|
32
|
+
/**
|
|
33
|
+
* 「追加」状態の変更イベントハンドラ
|
|
34
|
+
**/
|
|
35
|
+
onIncludedChange: (includedIds: string[]) => void;
|
|
36
|
+
/**
|
|
37
|
+
* 「除外」状態の変更イベントハンドラ
|
|
38
|
+
**/
|
|
39
|
+
onExcludedChange: (excludedIds: string[]) => void;
|
|
40
|
+
/**
|
|
41
|
+
* セクション切り替え時のハンドラ
|
|
42
|
+
**/
|
|
43
|
+
onActiveSectionChange?: (activeSection: string | null) => void;
|
|
44
|
+
/**
|
|
45
|
+
* 「さらに読み込む」ボタンが押されたときのハンドラ
|
|
46
|
+
**/
|
|
47
|
+
onLoadMore?: () => void;
|
|
48
|
+
};
|
|
49
|
+
export declare const DualListBox2: React.ForwardRefExoticComponent<DualListBox2Props & React.RefAttributes<HTMLDivElement>>;
|
|
50
|
+
export {};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { StoryObj } from "@storybook/react";
|
|
3
|
+
import { type Item, DualListBox2 } from "./index";
|
|
4
|
+
declare const meta: {
|
|
5
|
+
title: string;
|
|
6
|
+
component: React.ForwardRefExoticComponent<{
|
|
7
|
+
included: Item[];
|
|
8
|
+
excluded: Item[];
|
|
9
|
+
disableInclude?: boolean | undefined;
|
|
10
|
+
disableExclude?: boolean | undefined;
|
|
11
|
+
menuButtons?: React.ReactNode;
|
|
12
|
+
loading?: boolean | undefined;
|
|
13
|
+
children: React.ReactNode;
|
|
14
|
+
onIncludedChange: (includedIds: string[]) => void;
|
|
15
|
+
onExcludedChange: (excludedIds: string[]) => void;
|
|
16
|
+
onActiveSectionChange?: ((activeSection: string | null) => void) | undefined;
|
|
17
|
+
onLoadMore?: (() => void) | undefined;
|
|
18
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
19
|
+
argTypes: {};
|
|
20
|
+
};
|
|
21
|
+
export default meta;
|
|
22
|
+
/**
|
|
23
|
+
* #### ベーシックなタイプ
|
|
24
|
+
*
|
|
25
|
+
* 件数の上限が不明で都度サーバへ問い合わせる必要がある場合、上限が決まっている場合いずれにも使えます。
|
|
26
|
+
*
|
|
27
|
+
* ---
|
|
28
|
+
*
|
|
29
|
+
* `included` と `excluded` で選択中の値を指定します。
|
|
30
|
+
* 選択状態変更時は、`onIncludedChange` と `onExcludedChange` で、新しい `included` と `excluded` を受け取れるので、これを使って `included` と `excluded` を更新してください。
|
|
31
|
+
*
|
|
32
|
+
* children には、左パネル用の選択できる項目を渡します。右パネルの内容は状態に応じて自動で表示管理されます。
|
|
33
|
+
*
|
|
34
|
+
*/
|
|
35
|
+
export declare const Default: StoryObj<typeof meta>;
|
|
36
|
+
/**
|
|
37
|
+
* #### 選択候補がアコーディオンで折りたたまれているタイプ
|
|
38
|
+
*
|
|
39
|
+
* 件数の上限が決まっていて、多い場合や区切りたい場合に利用します。
|
|
40
|
+
* セクションごとに一括選択もできます。
|
|
41
|
+
*/
|
|
42
|
+
export declare const Accordion: StoryObj<typeof DualListBox2>;
|
|
43
|
+
/**
|
|
44
|
+
* 「追加」「除外」のいずれかしかできない場合の例です。
|
|
45
|
+
* 状況に応じて、`disableExclude`(除外無効)、`disableInclude`(追加無効) に `true` を指定して制御してください。
|
|
46
|
+
*/
|
|
47
|
+
export declare const Either: StoryObj<typeof DualListBox2>;
|
|
48
|
+
/**
|
|
49
|
+
* #### 選択候補がセクションで分かれているタイプ
|
|
50
|
+
*
|
|
51
|
+
* 件数の上限が不明で都度サーバへ問い合わせる必要がある場合に利用します。
|
|
52
|
+
* 検索は各セクションに移動後に使えます。
|
|
53
|
+
*
|
|
54
|
+
* 任意のセクション選択中は、その他のセクションは非表示となります。
|
|
55
|
+
*/
|
|
56
|
+
export declare const Section: StoryObj<typeof DualListBox2>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
type DualListBox2AccordionProps = {
|
|
3
|
+
label: string;
|
|
4
|
+
disableInclude?: boolean;
|
|
5
|
+
disableExclude?: boolean;
|
|
6
|
+
children: ReactNode;
|
|
7
|
+
};
|
|
8
|
+
export declare const DualListBox2Accordion: ({ label, disableInclude, disableExclude, children, }: DualListBox2AccordionProps) => JSX.Element;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
type DualListBox2ItemProps = {
|
|
3
|
+
id: string;
|
|
4
|
+
children: ReactNode;
|
|
5
|
+
disableInclude?: boolean;
|
|
6
|
+
disableExclude?: boolean;
|
|
7
|
+
};
|
|
8
|
+
export declare const DualListBox2Item: {
|
|
9
|
+
({ id, disableInclude, disableExclude, children, }: DualListBox2ItemProps): JSX.Element | null;
|
|
10
|
+
displayName: string;
|
|
11
|
+
};
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
type DualListBox2SectionProps = {
|
|
3
|
+
label: string;
|
|
4
|
+
children: ReactNode;
|
|
5
|
+
};
|
|
6
|
+
export declare const DualListBox2Section: {
|
|
7
|
+
({ label, children, }: DualListBox2SectionProps): JSX.Element | null;
|
|
8
|
+
displayName: string;
|
|
9
|
+
};
|
|
10
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "@testing-library/jest-dom";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export type { Item } from "./types";
|
|
2
|
+
export { DualListBox2 } from "./DualListBox2";
|
|
3
|
+
export { DualListBox2Item } from "./DualListBox2Item";
|
|
4
|
+
export { DualListBox2Accordion } from "./DualListBox2Accordion";
|
|
5
|
+
export { DualListBox2Section } from "./DualListBox2Section";
|
|
6
|
+
export { toGroupedItems } from "./lib";
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
import type { Item } from "./types";
|
|
3
|
+
export declare const DualListBox2Context: import("react").Context<{
|
|
4
|
+
filterWords: string[];
|
|
5
|
+
includedIds: string[];
|
|
6
|
+
excludedIds: string[];
|
|
7
|
+
activeSection: string | null;
|
|
8
|
+
onIncludedChange: (includedIds: string[]) => void;
|
|
9
|
+
onExcludedChange: (excludedIds: string[]) => void;
|
|
10
|
+
setActiveSection: (activeSection: string | null) => void;
|
|
11
|
+
}>;
|
|
12
|
+
export declare const DualListBox2GroupContext: import("react").Context<{
|
|
13
|
+
groupName: string;
|
|
14
|
+
}>;
|
|
15
|
+
export declare const traverseChildren: (children: ReactNode, callback: (child: ReactNode) => void) => void;
|
|
16
|
+
export declare const extractAllItems: (children: ReactNode) => Item[];
|
|
17
|
+
export declare const getAllIds: (children: ReactNode) => string[];
|
|
18
|
+
type groupedItems = {
|
|
19
|
+
groupName?: string;
|
|
20
|
+
items: Item[];
|
|
21
|
+
};
|
|
22
|
+
export declare const toGroupedItems: (items: Item[]) => groupedItems[];
|
|
23
|
+
export {};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export declare const DualListBox2: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
2
|
+
export declare const TabList: import("styled-components").StyledComponent<"ul", import("styled-components").DefaultTheme, {}, never>;
|
|
3
|
+
export declare const CountBadge: import("styled-components").StyledComponent<"span", import("styled-components").DefaultTheme, {}, never>;
|
|
4
|
+
export declare const Inner: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
5
|
+
export declare const LeftPanel: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
|
|
6
|
+
isShow: boolean;
|
|
7
|
+
}, never>;
|
|
8
|
+
export declare const LeftPanelBody: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
9
|
+
export declare const LeftPanelHeader: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
10
|
+
export declare const HeaderSearch: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
11
|
+
export declare const HeaderMenuButton: import("styled-components").StyledComponent<"button", import("styled-components").DefaultTheme, {}, never>;
|
|
12
|
+
export declare const HeaderCount: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
13
|
+
export declare const HeaderButtons: import("styled-components").StyledComponent<"ul", import("styled-components").DefaultTheme, {}, never>;
|
|
14
|
+
export declare const HeaderLoadButton: import("styled-components").StyledComponent<"button", import("styled-components").DefaultTheme, {}, never>;
|
|
15
|
+
export declare const RightPanel: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
|
|
16
|
+
isShow: boolean;
|
|
17
|
+
}, never>;
|
|
18
|
+
export declare const RightPanelHeader: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
19
|
+
export declare const RightPanelBody: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
20
|
+
export declare const SelectedCounts: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
21
|
+
export declare const SelectedCountIncluded: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
22
|
+
export declare const SelectedCountExcluded: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
23
|
+
export declare const SelectedClearButton: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
24
|
+
export declare const SelectedPanelHeading: import("styled-components").StyledComponent<"p", import("styled-components").DefaultTheme, {}, never>;
|
|
25
|
+
export declare const ItemActions: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
26
|
+
export declare const DualListBox2Item: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
27
|
+
export declare const DualListBox2SelectedItem: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
28
|
+
export declare const DualListBox2SelectedLabel: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
29
|
+
export declare const AccordionHeader: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
30
|
+
export declare const AccordionButton: import("styled-components").StyledComponent<"button", import("styled-components").DefaultTheme, {}, never>;
|
|
31
|
+
export declare const AccordionActionButtons: import("styled-components").StyledComponent<"ul", import("styled-components").DefaultTheme, {}, never>;
|
|
32
|
+
export declare const AccordionIcon: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
33
|
+
export declare const SectionButtonBefore: import("styled-components").StyledComponent<"span", import("styled-components").DefaultTheme, {}, never>;
|
|
34
|
+
export declare const SectionButtonAfter: import("styled-components").StyledComponent<"span", import("styled-components").DefaultTheme, {}, never>;
|
|
35
|
+
export declare const SectionButton: import("styled-components").StyledComponent<"button", import("styled-components").DefaultTheme, {}, never>;
|
|
@@ -1,8 +1,18 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
export declare enum RadioButtonSize {
|
|
3
|
+
SMALL = "16px",
|
|
3
4
|
MEDIUM = "18px"
|
|
4
5
|
}
|
|
5
|
-
export declare const
|
|
6
|
+
export declare const indicatorSizes: {
|
|
7
|
+
"16px": {
|
|
8
|
+
inside: string;
|
|
9
|
+
border: string;
|
|
10
|
+
};
|
|
11
|
+
"18px": {
|
|
12
|
+
inside: string;
|
|
13
|
+
border: string;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
6
16
|
export type RadioButtonChangeHandler = (e: React.ChangeEvent<HTMLInputElement>, checked: boolean) => void;
|
|
7
17
|
export type RadioButtonProps = Omit<React.InputHTMLAttributes<HTMLInputElement>, "size" | "onChange"> & {
|
|
8
18
|
size?: RadioButtonSize;
|
|
@@ -9,8 +9,23 @@ declare const _default: {
|
|
|
9
9
|
onChange?: import("./RadioButton").RadioButtonChangeHandler | undefined;
|
|
10
10
|
inputRef?: React.Ref<HTMLInputElement> | undefined;
|
|
11
11
|
} & React.RefAttributes<HTMLSpanElement | HTMLLabelElement>>;
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
argTypes: {
|
|
13
|
+
disabled: {
|
|
14
|
+
control: {
|
|
15
|
+
type: string;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
checked: {
|
|
19
|
+
control: {
|
|
20
|
+
type: string;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
size: {
|
|
24
|
+
control: {
|
|
25
|
+
type: string;
|
|
26
|
+
options: RadioButtonSize[];
|
|
27
|
+
};
|
|
28
|
+
};
|
|
14
29
|
};
|
|
15
30
|
};
|
|
16
31
|
export default _default;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { RadioButtonSize } from "./RadioButton";
|
|
2
|
+
export declare const Wrapper: import("styled-components").StyledComponent<"label", import("styled-components").DefaultTheme, {
|
|
3
|
+
size: RadioButtonSize;
|
|
4
|
+
disabled?: boolean | undefined;
|
|
5
|
+
}, never>;
|
|
6
|
+
type IndicatorProps = {
|
|
7
|
+
size: RadioButtonSize;
|
|
8
|
+
inside: string;
|
|
9
|
+
border: string;
|
|
10
|
+
};
|
|
11
|
+
export declare const Indicator: import("styled-components").StyledComponent<"span", import("styled-components").DefaultTheme, IndicatorProps, never>;
|
|
12
|
+
export declare const Label: import("styled-components").StyledComponent<"span", import("styled-components").DefaultTheme, {}, never>;
|
|
13
|
+
export {};
|