ingred-ui 22.3.3 → 23.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.
@@ -1,27 +1,3 @@
1
1
  import React from "react";
2
- import { Select2Size, Select2Variant } from "./types";
3
- import { TagVariant } from "../Tag/types";
4
- type Select2Option = {
5
- value: string | number;
6
- label: string;
7
- disabled?: boolean;
8
- };
9
- type Select2Props = {
10
- value: (string | number) | (string | number)[];
11
- onChange: (value: (string | number) | (string | number)[]) => void;
12
- options: Select2Option[];
13
- multiple?: boolean;
14
- disabled?: boolean;
15
- placeholder?: string;
16
- size?: Select2Size;
17
- variant?: Select2Variant;
18
- tagVariant?: TagVariant;
19
- searchable?: boolean;
20
- searchPlaceholder?: string;
21
- noResultsMessage?: string;
22
- error?: boolean;
23
- applyButtonText?: string;
24
- cancelButtonText?: string;
25
- };
2
+ import { Select2Props } from "./types";
26
3
  export declare const Select2: React.FC<Select2Props>;
27
- export {};
@@ -0,0 +1,22 @@
1
+ import React from "react";
2
+ export type Select2OptionProps = {
3
+ /**
4
+ * 選択肢の値
5
+ */
6
+ value: string | number;
7
+ /**
8
+ * 無効状態
9
+ */
10
+ disabled?: boolean;
11
+ /**
12
+ * 表示するラベル
13
+ */
14
+ children: React.ReactNode;
15
+ };
16
+ /**
17
+ * Select2Optionコンポーネント
18
+ *
19
+ * Select2コンポーネント内で使用することを想定しています。
20
+ * 実際に何かをレンダリングせず、Select2の選択肢として登録するための宣言的なコンポーネントです。
21
+ */
22
+ export declare const Select2Option: React.FC<Select2OptionProps>;
@@ -0,0 +1,19 @@
1
+ import React, { ReactNode } from "react";
2
+ export type Select2OptionGroupProps = {
3
+ /**
4
+ * グループのラベル
5
+ */
6
+ label: string;
7
+ /**
8
+ * 子要素(Select2Option)
9
+ */
10
+ children: ReactNode;
11
+ };
12
+ /**
13
+ * Select2OptionGroupコンポーネント
14
+ *
15
+ * このコンポーネントはグループ化された選択肢を表現します。
16
+ * 内部的には何もレンダリングせず、Select2コンポーネントがこのコンポーネントの
17
+ * プロパティを取得して、適切な方法でレンダリングします。
18
+ */
19
+ export declare const Select2OptionGroup: React.FC<Select2OptionGroupProps>;
@@ -0,0 +1,9 @@
1
+ import React from "react";
2
+ /**
3
+ * Select2Separatorコンポーネント
4
+ *
5
+ * このコンポーネントはセパレータを表現します。
6
+ * 内部的には何もレンダリングせず、Select2コンポーネントがこのコンポーネントを
7
+ * 検出して、適切な方法でセパレータをレンダリングします。
8
+ */
9
+ export declare const Select2Separator: React.FC;
@@ -1,2 +1,4 @@
1
1
  export { Select2 } from "./Select2";
2
- export type { Select2Props, Select2Option, Select2Size, Select2Variant, } from "./types";
2
+ export { Select2OptionGroup } from "./Select2OptionGroup";
3
+ export { Select2Separator } from "./Select2Separator";
4
+ export * from "./types";
@@ -1,4 +1,5 @@
1
1
  import { Theme } from "../../themes";
2
+ import React from "react";
2
3
  export type Select2Size = "small" | "medium" | "large";
3
4
  export type Select2Variant = "light" | "dark";
4
5
  export type Select2SizeConfig = {
@@ -33,10 +34,6 @@ export type Select2StyleProps = {
33
34
  $hasValue?: boolean;
34
35
  };
35
36
  export type Select2Props = {
36
- /**
37
- * 選択肢の配列
38
- */
39
- options: Select2Option[];
40
37
  /**
41
38
  * 選択された値。multipleがtrueの場合は配列、falseの場合は単一の値
42
39
  */
@@ -111,4 +108,14 @@ export type Select2Props = {
111
108
  * @default "キャンセル"
112
109
  */
113
110
  cancelButtonText?: string;
111
+ /**
112
+ * 子要素(宣言的API用)
113
+ * Select2Option、ContextMenu2HeadingItem、ContextMenu2SeparatorItemなどを指定できます
114
+ */
115
+ children?: React.ReactNode;
116
+ /**
117
+ * 複数選択時の一時的な選択値が変化したときに呼ばれるコールバック
118
+ * multiple=trueのときのみ有効
119
+ */
120
+ onTempChange?: (tempSelected: (string | number)[]) => void;
114
121
  };