@baton8/general-components 3.1.0-alpha.1 → 3.1.0-alpha.11

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.
Files changed (46) hide show
  1. package/dist/components/atoms/button/button.d.ts +1 -1
  2. package/dist/components/atoms/generalIcon/generalIcon.d.ts +6 -1
  3. package/dist/components/atoms/icon/icon.d.ts +5 -0
  4. package/dist/components/atoms/iconButton/iconButton.d.ts +1 -1
  5. package/dist/components/atoms/input/input.d.ts +2 -0
  6. package/dist/components/atoms/link/link.d.ts +2 -0
  7. package/dist/components/atoms/segmentGroup/index.d.ts +3 -0
  8. package/dist/components/atoms/segmentGroup/segment.d.ts +32 -0
  9. package/dist/components/atoms/segmentGroup/segmentGroup.d.ts +21 -0
  10. package/dist/components/atoms/segmentGroup/segmentIconContainer.d.ts +15 -0
  11. package/dist/components/atoms/tag/tag.d.ts +5 -3
  12. package/dist/components/atoms/textarea/textarea.d.ts +1 -1
  13. package/dist/components/index.d.ts +4 -0
  14. package/dist/components/modules/card/cardButton.d.ts +1 -1
  15. package/dist/components/modules/dialog/dialog.d.ts +0 -1
  16. package/dist/components/modules/dialog/dialogButton.d.ts +1 -1
  17. package/dist/components/modules/drawer/drawer.d.ts +2 -0
  18. package/dist/components/modules/drawer/drawerButton.d.ts +1 -1
  19. package/dist/components/modules/drawer/drawerCloseButton.d.ts +13 -0
  20. package/dist/components/modules/drawer/drawerFooter.d.ts +0 -3
  21. package/dist/components/modules/drawer/index.d.ts +2 -0
  22. package/dist/components/modules/menu/menu.d.ts +5 -0
  23. package/dist/components/modules/popover/index.d.ts +1 -0
  24. package/dist/components/modules/popover/popover.d.ts +38 -0
  25. package/dist/components/modules/simpleCard/index.d.ts +3 -0
  26. package/dist/components/modules/simpleCard/simpleCard.d.ts +5 -0
  27. package/dist/components/modules/simpleCard/simpleCardBody.d.ts +7 -0
  28. package/dist/components/modules/simpleCard/simpleCardButton.d.ts +5 -0
  29. package/dist/components/modules/simpleCardList/index.d.ts +4 -0
  30. package/dist/components/modules/simpleCardList/simpleCardListAuto.d.ts +5 -0
  31. package/dist/components/modules/simpleCardList/simpleCardListBodyAuto.d.ts +5 -0
  32. package/dist/components/modules/simpleCardList/simpleCardListFooterAuto.d.ts +5 -0
  33. package/dist/components/modules/simpleCardList/simpleCardListHeader.d.ts +6 -0
  34. package/dist/components/modules/stepper/stepperItem.d.ts +5 -1
  35. package/dist/contexts/segmentGroup/context.d.ts +11 -0
  36. package/dist/index.js +357 -163
  37. package/dist/index.js.map +1 -1
  38. package/dist/stories/atoms/input/input.stories.d.ts +1 -0
  39. package/dist/stories/atoms/segmentGroup/segmentGroup.stories.d.ts +7 -0
  40. package/dist/stories/modules/drawer/drawer.stories.d.ts +2 -0
  41. package/dist/stories/modules/popover/popover.stories.d.ts +33 -0
  42. package/dist/stories/modules/stepper/stepper.stories.d.ts +1 -0
  43. package/package.json +6 -6
  44. package/dist/stories/modules/dialog/dialogButton.stories.d.ts +0 -8
  45. package/dist/stories/modules/drawer/drawerButton.stories.d.ts +0 -7
  46. package/dist/stories/modules/drawer/drawerFooter.stories.d.ts +0 -7
@@ -46,7 +46,7 @@ export declare const Button: import("react").ForwardRefExoticComponent<import(".
46
46
  * HTML と違ってデフォルト値が `"button"` になっているので、フォームの送信ボタンとして使う場合は明示的に `"submit"` を指定してください。
47
47
  * @defaultValue `"button"`
48
48
  */
49
- type?: "button" | "submit" | "reset" | undefined;
49
+ type?: "button" | "reset" | "submit" | undefined;
50
50
  /**
51
51
  * 無効にするかどうか。
52
52
  */
@@ -42,7 +42,7 @@ export declare const GeneralIcon: import("react").ForwardRefExoticComponent<impo
42
42
  * アイコンの反転。
43
43
  * @defaultValue `"none"`
44
44
  */
45
- flip?: "none" | "both" | "horizontal" | "vertical" | undefined;
45
+ flip?: "both" | "none" | "horizontal" | "vertical" | undefined;
46
46
  /**
47
47
  * アイコンの回転角度。
48
48
  * @defaultValue `0`
@@ -53,6 +53,11 @@ export declare const GeneralIcon: import("react").ForwardRefExoticComponent<impo
53
53
  * @defaultValue `false`
54
54
  */
55
55
  spin?: boolean | undefined;
56
+ /**
57
+ * アイコンの幅を固定するかどうか。
58
+ * @defaultValue `false`
59
+ */
60
+ isFixedWidth?: boolean | undefined;
56
61
  /** */
57
62
  className?: string | undefined;
58
63
  } & import("react").RefAttributes<SVGSVGElement>>;
@@ -23,6 +23,11 @@ export declare const Icon: import("react").ForwardRefExoticComponent<import("../
23
23
  name: keyof typeof BUILTIN_ICONS;
24
24
  /** */
25
25
  label?: string | undefined;
26
+ /**
27
+ * アイコンの幅を固定するかどうか。
28
+ * @defaultValue `false`
29
+ */
30
+ isFixedWidth?: boolean | undefined;
26
31
  /** */
27
32
  className?: string | undefined;
28
33
  } & import("react").RefAttributes<SVGSVGElement>>;
@@ -38,7 +38,7 @@ export declare const IconButton: import("react").ForwardRefExoticComponent<impor
38
38
  * HTML と違ってデフォルト値が `"button"` になっているので、フォームの送信ボタンとして使う場合は明示的に `"submit"` を指定してください。
39
39
  * @defaultValue `"button"`
40
40
  */
41
- type?: "button" | "submit" | "reset" | undefined;
41
+ type?: "button" | "reset" | "submit" | undefined;
42
42
  /**
43
43
  * 無効にするかどうか。
44
44
  */
@@ -53,6 +53,8 @@ export declare const Input: import("react").ForwardRefExoticComponent<import("..
53
53
  type?: "date" | "time" | "search" | "month" | "text" | "tel" | "url" | "email" | "datetime-local" | "week" | undefined;
54
54
  /** */
55
55
  inputMode?: "search" | "numeric" | "decimal" | "text" | "none" | "tel" | "url" | "email" | undefined;
56
+ /** */
57
+ placeholder?: string | undefined;
56
58
  /**
57
59
  * @defaultValue `"off"`
58
60
  */
@@ -52,6 +52,8 @@ export declare const Link: import("react").ForwardRefExoticComponent<import("../
52
52
  * @defaultValue `"medium"`
53
53
  */
54
54
  size?: "small" | "medium" | "large" | undefined;
55
+ /** */
56
+ download?: unknown;
55
57
  /**
56
58
  * 内部の余白を少なくし、全体を少し小さめに表示するかどうか。
57
59
  * 基本的には `false` (デフォルト値) で使うことを推奨しますが、フォームの一部として使う場合など、省スペースで表示したいときには `true` にしてください。
@@ -0,0 +1,3 @@
1
+ export * from "./segment";
2
+ export * from "./segmentGroup";
3
+ export * from "./segmentIconContainer";
@@ -0,0 +1,32 @@
1
+ import { AriaAttributes, ChangeEvent, ReactNode } from "react";
2
+ /**
3
+ * @group React コンポーネント
4
+ * @category React コンポーネント
5
+ */
6
+ export declare const Segment: import("react").ForwardRefExoticComponent<import("../../../modules/data").DataProps<string> & {
7
+ className?: string | undefined;
8
+ id?: string | undefined;
9
+ style?: import("react").CSSProperties | undefined;
10
+ } & AriaAttributes & {
11
+ /** */
12
+ value: string;
13
+ /**
14
+ * `<input>` 要素の `change` イベントのリスナー。
15
+ * 入力された値を取得したいだけの場合は、`onSet` prop を利用する方が便利です。
16
+ */
17
+ onChange?: ((event: ChangeEvent<HTMLInputElement>) => unknown) | undefined;
18
+ /** */
19
+ onBlur?: ((event: ChangeEvent<HTMLInputElement>) => unknown) | undefined;
20
+ /** */
21
+ children?: ReactNode;
22
+ /** */
23
+ className?: string | undefined;
24
+ /**
25
+ * 内部の `<input>` 要素のクラス名。
26
+ */
27
+ inputClassName?: string | undefined;
28
+ /**
29
+ * 内部の `<input>` 要素の ID。
30
+ */
31
+ inputId?: string | undefined;
32
+ } & import("react").RefAttributes<HTMLInputElement>>;
@@ -0,0 +1,21 @@
1
+ import { FunctionComponent, ReactNode } from "react";
2
+ import { LeveledColorScheme } from "../../../modules/color";
3
+ type SegmentGroupProps = {
4
+ /**
5
+ * カラースキーム。
6
+ * @defaultValue `"primary"`
7
+ */
8
+ scheme?: LeveledColorScheme;
9
+ /** */
10
+ value: string;
11
+ /** */
12
+ onSet: (value: string) => unknown;
13
+ /** */
14
+ children: ReactNode;
15
+ };
16
+ /**
17
+ * @group React コンポーネント
18
+ * @category React コンポーネント
19
+ */
20
+ export declare const SegmentGroup: FunctionComponent<SegmentGroupProps>;
21
+ export {};
@@ -0,0 +1,15 @@
1
+ import { ReactElement } from "react";
2
+ /**
3
+ * @group React コンポーネント
4
+ * @category React コンポーネント
5
+ */
6
+ export declare const SegmentIconContainer: import("react").ForwardRefExoticComponent<import("../../../modules/data").DataProps<string> & {
7
+ className?: string | undefined;
8
+ id?: string | undefined;
9
+ style?: import("react").CSSProperties | undefined;
10
+ } & {
11
+ /** */
12
+ children?: ReactElement<any, string | import("react").JSXElementConstructor<any>> | undefined;
13
+ /** */
14
+ className?: string | undefined;
15
+ } & import("react").RefAttributes<HTMLSpanElement>>;
@@ -1,9 +1,6 @@
1
1
  import { ReactNode } from "react";
2
2
  /**
3
3
  * ### タグ
4
- *
5
- * #### 専用コンポーネント
6
- * - [GenreTag](/docs/atoms-Tag-GenreTag-ドキュメント)
7
4
  * @group React コンポーネント
8
5
  * @category React コンポーネント
9
6
  */
@@ -17,6 +14,11 @@ export declare const Tag: import("react").ForwardRefExoticComponent<import("../.
17
14
  * @defaultValue `"gray"`
18
15
  */
19
16
  scheme?: "primary" | "secondary" | "blue" | "red" | "green" | "pink" | "yellow" | "purple" | "orange" | "gray" | "gold" | "silver" | "bronze" | undefined;
17
+ /**
18
+ * サイズ。
19
+ * @defaultValue `"small"`
20
+ */
21
+ size?: "small" | "medium" | undefined;
20
22
  /** */
21
23
  className?: string | undefined;
22
24
  /** */
@@ -23,7 +23,7 @@ export declare const Textarea: import("react").ForwardRefExoticComponent<import(
23
23
  * リサイズ可能な方向。
24
24
  * @defaultValue `"vertical"`
25
25
  */
26
- resize?: "none" | "both" | "horizontal" | "vertical" | undefined;
26
+ resize?: "both" | "none" | "horizontal" | "vertical" | undefined;
27
27
  /** */
28
28
  inputMode?: "search" | "numeric" | "decimal" | "text" | "none" | "tel" | "url" | "email" | undefined;
29
29
  /**
@@ -25,6 +25,7 @@ export * from "./atoms/radio";
25
25
  export * from "./atoms/radioGroup";
26
26
  export * from "./atoms/root";
27
27
  export * from "./atoms/secondaryHeading";
28
+ export * from "./atoms/segmentGroup";
28
29
  export * from "./atoms/select";
29
30
  export * from "./atoms/singleLineText";
30
31
  export * from "./atoms/switch";
@@ -45,7 +46,10 @@ export * from "./modules/fractionView";
45
46
  export * from "./modules/header";
46
47
  export * from "./modules/menu";
47
48
  export * from "./modules/pagination";
49
+ export * from "./modules/popover";
48
50
  export * from "./modules/rankView";
51
+ export * from "./modules/simpleCard";
52
+ export * from "./modules/simpleCardList";
49
53
  export * from "./modules/stepper";
50
54
  export * from "./modules/tabList";
51
55
  export * from "./modules/toast";
@@ -26,7 +26,7 @@ export declare const CardButton: import("react").ForwardRefExoticComponent<impor
26
26
  * `onClick` に文字列値が指定されていてリンクとして表示される際は、これは無視されます。
27
27
  * @defaultValue `"button"`
28
28
  */
29
- type?: "button" | "submit" | "reset" | undefined;
29
+ type?: "button" | "reset" | "submit" | undefined;
30
30
  /**
31
31
  * ボタンを縦に伸ばすかどうか。
32
32
  * 設定ボタン等は伸ばさない方が自然です。
@@ -40,7 +40,6 @@ type DialogProps = {
40
40
  * - [`DialogTitle`](/docs/modules-Dialog-DialogTitle--ドキュメント) (任意)
41
41
  * - [`DialogBody`](/docs/modules-Dialog-DialogBody--ドキュメント)
42
42
  * - [`DialogFooter`](/docs/modules-Dialog-DialogFooter--ドキュメント) (任意)
43
- * - [`DialogFooterButton`](/docs/modules-Dialog-DialogFooterButton--ドキュメント) (2 個まで任意)
44
43
  *
45
44
  * #### 使い方
46
45
  * 非制御と制御の 2 種類の使い方があります。
@@ -15,7 +15,7 @@ export declare const DialogButton: import("react").ForwardRefExoticComponent<imp
15
15
  variant?: "solid" | "light" | "underline" | "simple" | "unstyledUnderline" | "unstyledSimple" | undefined;
16
16
  size?: "small" | "medium" | "large" | undefined;
17
17
  isCompact?: boolean | undefined;
18
- type?: "button" | "submit" | "reset" | undefined;
18
+ type?: "button" | "reset" | "submit" | undefined;
19
19
  isDisabled?: boolean | undefined;
20
20
  isLoading?: boolean | undefined;
21
21
  onClick?: ((event: import("react").MouseEvent<HTMLButtonElement, MouseEvent>) => unknown) | undefined;
@@ -30,12 +30,14 @@ type DrawerProps = CommonProps & {
30
30
  * #### 構成
31
31
  * 以下のようなコンポーネント構成で利用してください。
32
32
  * - **`Drawer`**
33
+ * - [`DrawerCloseButton`](/docs/modules-Drawer-DrawerCloseButton--ドキュメント)
33
34
  * - [`DrawerHeader`](/docs/modules-Drawer-DrawerHeader--ドキュメント) (任意)
34
35
  * - [`DrawerHeaderLeft`](/docs/modules-Drawer-DrawerHeaderLeft--ドキュメント)
35
36
  * - [`DrawerHeaderTitle`](/docs/modules-Drawer-DrawerHeaderTitle--ドキュメント)
36
37
  * - [`DrawerHeaderCaption`](/docs/modules-Drawer-DrawerHeaderCaption--ドキュメント) (任意)
37
38
  * - [`DrawerHeaderRight`](/docs/modules-Drawer-DrawerHeaderRight--ドキュメント)
38
39
  * - [`DrawerBody`](/docs/modules-Drawer-DrawerBody--ドキュメント)
40
+ * - [`DrawerFooter`](/docs/modules-Drawer-DrawerFooter--ドキュメント) (任意)
39
41
  *
40
42
  * @group React コンポーネント
41
43
  * @category React コンポーネント
@@ -15,7 +15,7 @@ export declare const DrawerButton: import("react").ForwardRefExoticComponent<imp
15
15
  variant?: "solid" | "light" | "underline" | "simple" | "unstyledUnderline" | "unstyledSimple" | undefined;
16
16
  size?: "small" | "medium" | "large" | undefined;
17
17
  isCompact?: boolean | undefined;
18
- type?: "button" | "submit" | "reset" | undefined;
18
+ type?: "button" | "reset" | "submit" | undefined;
19
19
  isDisabled?: boolean | undefined;
20
20
  isLoading?: boolean | undefined;
21
21
  onClick?: ((event: import("react").MouseEvent<HTMLButtonElement, MouseEvent>) => unknown) | undefined;
@@ -0,0 +1,13 @@
1
+ /// <reference types="react" />
2
+ /**
3
+ * @group React コンポーネント
4
+ * @category React コンポーネント
5
+ */
6
+ export declare const DrawerCloseButton: import("react").ForwardRefExoticComponent<import("../../../modules/data").DataProps<string> & {
7
+ className?: string | undefined;
8
+ id?: string | undefined;
9
+ style?: import("react").CSSProperties | undefined;
10
+ } & {
11
+ /** */
12
+ className?: string | undefined;
13
+ } & import("react").RefAttributes<HTMLButtonElement>>;
@@ -1,8 +1,5 @@
1
1
  import { ReactNode } from "react";
2
2
  /**
3
- * @deprecated
4
- * これまでフッターに配置していたボタン等は、ヘッダーの右側に置くようにしてください。
5
- *
6
3
  * @group React コンポーネント
7
4
  * @category React コンポーネント
8
5
  */
@@ -2,6 +2,8 @@ export * from "./drawer";
2
2
  export * from "./drawerBody";
3
3
  export * from "./drawerButton";
4
4
  export * from "./drawerCaption";
5
+ export * from "./drawerCloseButton";
6
+ export * from "./drawerFooter";
5
7
  export * from "./drawerHeader";
6
8
  export * from "./drawerHeaderLeft";
7
9
  export * from "./drawerHeaderRight";
@@ -29,6 +29,11 @@ type MenuProps = {
29
29
  * @defaultValue `"bottom-start"`
30
30
  */
31
31
  placement?: Placement;
32
+ /**
33
+ * メニューの幅をトリガーの幅に合わせるかどうか。
34
+ * @defaultValue `false`
35
+ */
36
+ fitWidth?: boolean;
32
37
  /** */
33
38
  className?: string;
34
39
  /** */
@@ -0,0 +1 @@
1
+ export * from "./popover";
@@ -0,0 +1,38 @@
1
+ import { Placement } from "@floating-ui/react";
2
+ import { FunctionComponent, ReactElement, ReactNode } from "react";
3
+ type PopoverProps = {
4
+ /**
5
+ * トリガーとなる要素。
6
+ * ここに要素を指定すると、そこにインタラクションがあったときにポップオーバーが表示されるようになります。
7
+ */
8
+ trigger?: ReactElement;
9
+ /**
10
+ * トリガーの種類。
11
+ * @defaultValue `"click"`
12
+ */
13
+ triggerType?: "click" | "focus" | "hover";
14
+ /**
15
+ * トリガーの持続時間 (ミリ秒単位)。
16
+ * @defaultValue `null`
17
+ */
18
+ triggerRest?: number | null;
19
+ /**
20
+ * @defaultValue `false`
21
+ */
22
+ isInline?: boolean;
23
+ /**
24
+ * ポップオーバーの位置。
25
+ * @defaultValue `"bottom-start"`
26
+ */
27
+ placement?: Placement;
28
+ /** */
29
+ className?: string;
30
+ /** */
31
+ children?: ReactNode;
32
+ };
33
+ /**
34
+ * @group React コンポーネント
35
+ * @category React コンポーネント
36
+ */
37
+ export declare const Popover: FunctionComponent<PopoverProps>;
38
+ export {};
@@ -0,0 +1,3 @@
1
+ export * from "./simpleCard";
2
+ export * from "./simpleCardBody";
3
+ export * from "./simpleCardButton";
@@ -0,0 +1,5 @@
1
+ import { ComponentProps, FunctionComponent } from "react";
2
+ import { Card } from "../../../components/modules/card/card";
3
+ type Props = ComponentProps<typeof Card>;
4
+ export declare const SimpleCard: FunctionComponent<Props>;
5
+ export {};
@@ -0,0 +1,7 @@
1
+ import { ComponentProps, FunctionComponent } from "react";
2
+ import { CardBody } from "../../../components/modules/card/cardBody";
3
+ type Props = {
4
+ hasButton?: boolean;
5
+ } & ComponentProps<typeof CardBody>;
6
+ export declare const SimpleCardBody: FunctionComponent<Props>;
7
+ export {};
@@ -0,0 +1,5 @@
1
+ import { ComponentProps, FunctionComponent } from "react";
2
+ import { CardButton } from "../../../components/modules/card/cardButton";
3
+ type Props = ComponentProps<typeof CardButton>;
4
+ export declare const SimpleCardButton: FunctionComponent<Props>;
5
+ export {};
@@ -0,0 +1,4 @@
1
+ export * from "./simpleCardListAuto";
2
+ export * from "./simpleCardListBodyAuto";
3
+ export * from "./simpleCardListFooterAuto";
4
+ export * from "./simpleCardListHeader";
@@ -0,0 +1,5 @@
1
+ import { ComponentProps, FunctionComponent } from "react";
2
+ import { CardListAuto } from "../../../components/modules/cardList/cardListAuto";
3
+ type Props = ComponentProps<typeof CardListAuto>;
4
+ export declare const SimpleCardListAuto: FunctionComponent<Props>;
5
+ export {};
@@ -0,0 +1,5 @@
1
+ import { ComponentProps, FunctionComponent } from "react";
2
+ import { CardListBodyAuto } from "../../../components/modules/cardList/cardListBodyAuto";
3
+ type Props = ComponentProps<typeof CardListBodyAuto>;
4
+ export declare const SimpleCardListBodyAuto: FunctionComponent<Props>;
5
+ export {};
@@ -0,0 +1,5 @@
1
+ import { ComponentProps, FunctionComponent } from "react";
2
+ import { CardListFooterAuto } from "../../../components/modules/cardList/cardListFooterAuto";
3
+ type Props = ComponentProps<typeof CardListFooterAuto>;
4
+ export declare const SimpleCardListFooterAuto: FunctionComponent<Props>;
5
+ export {};
@@ -0,0 +1,6 @@
1
+ import { FunctionComponent, ReactNode } from "react";
2
+ type Props = {
3
+ children: ReactNode;
4
+ };
5
+ export declare const SimpleCardListHeader: FunctionComponent<Props>;
6
+ export {};
@@ -1,4 +1,4 @@
1
- import { ReactNode } from "react";
1
+ import { MouseEvent, ReactNode } from "react";
2
2
  /**
3
3
  * @group React コンポーネント
4
4
  * @category React コンポーネント
@@ -11,6 +11,10 @@ export declare const StepperItem: import("react").ForwardRefExoticComponent<impo
11
11
  /** */
12
12
  scheme?: "primary" | "secondary" | "blue" | "red" | "green" | "pink" | "yellow" | "purple" | "orange" | "gray" | "gold" | "silver" | "bronze" | undefined;
13
13
  /** */
14
+ href?: string | undefined;
15
+ /** */
16
+ onClick?: ((event: MouseEvent<HTMLElement>) => unknown) | undefined;
17
+ /** */
14
18
  children?: ReactNode;
15
19
  /** */
16
20
  className?: string | undefined;
@@ -0,0 +1,11 @@
1
+ /// <reference types="react" />
2
+ import { LeveledColorScheme } from "../../modules/color";
3
+ type SegmentGroupContextValue = {
4
+ scheme: LeveledColorScheme;
5
+ name: string;
6
+ value: string;
7
+ onSet: (value: string) => unknown;
8
+ };
9
+ export declare const segmentGroupContext: import("react").Context<SegmentGroupContextValue | undefined>;
10
+ export declare const SegmentGroupProvider: import("react").Provider<SegmentGroupContextValue | undefined>;
11
+ export {};