ingred-ui 28.3.2 → 29.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.
@@ -2,6 +2,7 @@ import { Dayjs } from "dayjs";
2
2
  import React from "react";
3
3
  import { PresetButton } from "../internal/Actions";
4
4
  import { TimeFieldProps } from "../../TimeField/TimeField";
5
+ import type { CalendarWeekConfig } from "../types";
5
6
  export type CalendarProps = React.HTMLAttributes<HTMLDivElement> & {
6
7
  /**
7
8
  * 日付
@@ -13,15 +14,10 @@ export type CalendarProps = React.HTMLAttributes<HTMLDivElement> & {
13
14
  */
14
15
  monthFormat?: string;
15
16
  /**
16
- * カレンダーに表示する曜日のリスト
17
- * @memo dayjs().format("ddd") で対応したいが、階層が深くなったりするので一旦静的な値で対処
17
+ * 週の開始曜日と曜日見出し。未指定時はコンポーネント既定(日曜始まり・日本語短縮曜日)。
18
+ * `LocaleProvider` defaultProps で上書き可能。
18
19
  */
19
- weekList?: string[];
20
- /**
21
- * 週の開始日 (0=日曜日, 1=月曜日, 2=火曜日, ...)
22
- * @default 0
23
- */
24
- weekStart?: number;
20
+ weekConfig?: CalendarWeekConfig;
25
21
  /**
26
22
  * デフォルトで選択されているプリセットボタン
27
23
  */
@@ -75,15 +71,10 @@ declare const _default: React.MemoExoticComponent<React.ForwardRefExoticComponen
75
71
  */
76
72
  monthFormat?: string | undefined;
77
73
  /**
78
- * カレンダーに表示する曜日のリスト
79
- * @memo dayjs().format("ddd") で対応したいが、階層が深くなったりするので一旦静的な値で対処
80
- */
81
- weekList?: string[] | undefined;
82
- /**
83
- * 週の開始日 (0=日曜日, 1=月曜日, 2=火曜日, ...)
84
- * @default 0
74
+ * 週の開始曜日と曜日見出し。未指定時はコンポーネント既定(日曜始まり・日本語短縮曜日)。
75
+ * `LocaleProvider` defaultProps で上書き可能。
85
76
  */
86
- weekStart?: number | undefined;
77
+ weekConfig?: CalendarWeekConfig | undefined;
87
78
  /**
88
79
  * デフォルトで選択されているプリセットボタン
89
80
  */
@@ -7,8 +7,7 @@ declare const _default: {
7
7
  components: React.MemoExoticComponent<React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & {
8
8
  date: dayjs.Dayjs;
9
9
  monthFormat?: string | undefined;
10
- weekList?: string[] | undefined;
11
- weekStart?: number | undefined;
10
+ weekConfig?: import("..").CalendarWeekConfig | undefined;
12
11
  defaultPresetButton?: string | undefined;
13
12
  presetButtons?: import("../internal/Actions").PresetButton[] | undefined;
14
13
  onPresetButtonClick?: ((action: import("../internal/Actions").PresetButton) => void) | undefined;
@@ -3,6 +3,7 @@ import { DateRange } from "../..";
3
3
  import React from "react";
4
4
  import { PresetButton } from "../internal/Actions";
5
5
  import { TimeFieldProps } from "../../TimeField/TimeField";
6
+ import type { CalendarWeekConfig } from "../types";
6
7
  export type CalendarRangeProps = React.HTMLAttributes<HTMLDivElement> & {
7
8
  /**
8
9
  * 開始日
@@ -19,15 +20,10 @@ export type CalendarRangeProps = React.HTMLAttributes<HTMLDivElement> & {
19
20
  */
20
21
  monthFormat?: string;
21
22
  /**
22
- * カレンダーに表示する曜日のリスト
23
- * @memo dayjs().format("ddd") で対応したいが、階層が深くなったりするので一旦静的な値で対処
23
+ * 週の開始曜日と曜日見出し。未指定時はコンポーネント既定(日曜始まり・日本語短縮曜日)。
24
+ * `LocaleProvider` defaultProps で上書き可能。
24
25
  */
25
- weekList?: string[];
26
- /**
27
- * 週の開始日 (0=日曜日, 1=月曜日, 2=火曜日, ...)
28
- * @default 0
29
- */
30
- weekStart?: number;
26
+ weekConfig?: CalendarWeekConfig;
31
27
  /**
32
28
  * デフォルトで選択されているプリセットボタン
33
29
  */
@@ -109,15 +105,10 @@ export declare const CalendarRange: React.ForwardRefExoticComponent<React.HTMLAt
109
105
  */
110
106
  monthFormat?: string | undefined;
111
107
  /**
112
- * カレンダーに表示する曜日のリスト
113
- * @memo dayjs().format("ddd") で対応したいが、階層が深くなったりするので一旦静的な値で対処
114
- */
115
- weekList?: string[] | undefined;
116
- /**
117
- * 週の開始日 (0=日曜日, 1=月曜日, 2=火曜日, ...)
118
- * @default 0
108
+ * 週の開始曜日と曜日見出し。未指定時はコンポーネント既定(日曜始まり・日本語短縮曜日)。
109
+ * `LocaleProvider` defaultProps で上書き可能。
119
110
  */
120
- weekStart?: number | undefined;
111
+ weekConfig?: CalendarWeekConfig | undefined;
121
112
  /**
122
113
  * デフォルトで選択されているプリセットボタン
123
114
  */
@@ -195,15 +186,10 @@ declare const _default: React.MemoExoticComponent<React.ForwardRefExoticComponen
195
186
  */
196
187
  monthFormat?: string | undefined;
197
188
  /**
198
- * カレンダーに表示する曜日のリスト
199
- * @memo dayjs().format("ddd") で対応したいが、階層が深くなったりするので一旦静的な値で対処
200
- */
201
- weekList?: string[] | undefined;
202
- /**
203
- * 週の開始日 (0=日曜日, 1=月曜日, 2=火曜日, ...)
204
- * @default 0
189
+ * 週の開始曜日と曜日見出し。未指定時はコンポーネント既定(日曜始まり・日本語短縮曜日)。
190
+ * `LocaleProvider` defaultProps で上書き可能。
205
191
  */
206
- weekStart?: number | undefined;
192
+ weekConfig?: CalendarWeekConfig | undefined;
207
193
  /**
208
194
  * デフォルトで選択されているプリセットボタン
209
195
  */
@@ -8,8 +8,7 @@ declare const _default: {
8
8
  startDate: dayjs.Dayjs;
9
9
  endDate: dayjs.Dayjs;
10
10
  monthFormat?: string | undefined;
11
- weekList?: string[] | undefined;
12
- weekStart?: number | undefined;
11
+ weekConfig?: import("..").CalendarWeekConfig | undefined;
13
12
  defaultPresetButton?: string | undefined;
14
13
  presetButtons?: import("../internal/Actions").PresetButton[] | undefined;
15
14
  onPresetButtonClick?: ((action: import("../internal/Actions").PresetButton) => void) | undefined;
@@ -1,2 +1,8 @@
1
1
  /** カレンダーカード(グリッド+Actions)の最大幅。1fr グリッドや広い親・100vw 上限だけでは横に伸び切るのを防ぐ */
2
2
  export declare const CALENDAR_CARD_MAX_WIDTH_PX = 640;
3
+ /**
4
+ * `weekConfig` 未指定かつ `LocaleProvider` でも埋まらないときの曜日見出し(日曜始まり・日本語1文字)。
5
+ * ja のロケール既定と揃える。
6
+ */
7
+ export declare const DEFAULT_CALENDAR_WEEK_FALLBACK_LABELS: readonly string[];
8
+ export declare const DEFAULT_CALENDAR_WEEK_FALLBACK_START = 0;
@@ -1,3 +1,4 @@
1
1
  import Calendar from "./Calendar";
2
2
  import CalendarRange from "./CalendarRange";
3
3
  export { Calendar, CalendarRange };
4
+ export type { CalendarWeekConfig } from "./types";
@@ -0,0 +1,15 @@
1
+ /**
2
+ * カレンダー見出し行とグリッドの左端をひとまとめにした設定。
3
+ * `labels` の先頭は `start` で指定した曜日に対応する必要がある。
4
+ */
5
+ export type CalendarWeekConfig = {
6
+ /**
7
+ * 週の開始曜日 (0=日曜日, 1=月曜日, … 6=土曜日)。
8
+ * 列の左端がこの曜日になる。
9
+ */
10
+ start: number;
11
+ /**
12
+ * 左から右へ並ぶ 7 つの曜日見出し文言。
13
+ */
14
+ labels: string[];
15
+ };
@@ -0,0 +1,12 @@
1
+ import type { CalendarWeekConfig } from "../types";
2
+ export type ResolveCalendarWeekDisplayArgs = {
3
+ weekConfig?: CalendarWeekConfig;
4
+ fallbackLabels: string[];
5
+ fallbackStart: number;
6
+ };
7
+ /** dayjs().day() と同じ 0–6(日–土)に収める */
8
+ export declare function normalizeCalendarWeekStart(start: number): number;
9
+ /**
10
+ * `weekConfig` があれば検証して返し、なければフォールバックで埋める。
11
+ */
12
+ export declare function resolveCalendarWeekDisplay(args: ResolveCalendarWeekDisplayArgs): CalendarWeekConfig;
@@ -1,4 +1,8 @@
1
1
  import React from "react";
2
+ /** styled の transient。フォーカスリング用 padding を付けるか(検索ヘッダー内など親レイアウトがある場合は false) */
3
+ export type ContextMenu2TextInputItemStyledProps = {
4
+ $insetFocusRingPadding?: boolean;
5
+ };
2
6
  export declare const ContextMenu2TextInputItem: import("styled-components").StyledComponent<React.ForwardRefExoticComponent<{
3
7
  onEnter?: (() => void) | undefined;
4
- } & React.InputHTMLAttributes<HTMLInputElement> & React.RefAttributes<HTMLInputElement>>, import("styled-components").DefaultTheme, {}, never>;
8
+ } & React.InputHTMLAttributes<HTMLInputElement> & React.RefAttributes<HTMLInputElement>>, import("styled-components").DefaultTheme, ContextMenu2TextInputItemStyledProps, never>;
@@ -0,0 +1,7 @@
1
+ /**
2
+ * ButtonItem / CheckItem / TriggerItem / SwitchItem 共通のレイアウトとベース見た目。
3
+ * タイポや gap・ホバーは各コンポーネント側で足す。
4
+ */
5
+ export declare const contextMenu2InteractiveRowLayout: import("styled-components").FlattenSimpleInterpolation;
6
+ /** メインラベルがテキストの行向け(UI/Text 14) */
7
+ export declare const contextMenu2RowTextUi: import("styled-components").FlattenSimpleInterpolation;
@@ -1,4 +1,5 @@
1
1
  import React from "react";
2
+ import type { CalendarWeekConfig } from "../Calendar/types";
2
3
  import { PresetButton } from "../Calendar/internal/Actions";
3
4
  import { Dayjs } from "dayjs";
4
5
  import { TimeFieldProps } from "../TimeField/TimeField";
@@ -63,14 +64,9 @@ export type DatePickerProps = {
63
64
  */
64
65
  monthFormat?: string;
65
66
  /**
66
- * カレンダーに表示する曜日のリスト
67
+ * 週の開始曜日と曜日見出し。未指定時は `LocaleProvider` の defaultProps、なければ Calendar と同様のフォールバック。
67
68
  */
68
- weekList?: string[];
69
- /**
70
- * 週の開始日 (0=日曜日, 1=月曜日, 2=火曜日, ...)
71
- * @default 0
72
- */
73
- weekStart?: number;
69
+ weekConfig?: CalendarWeekConfig;
74
70
  /**
75
71
  * カレンダーのActionsエリアにDateFieldを表示する
76
72
  * @default false
@@ -1,5 +1,6 @@
1
1
  import * as React from "react";
2
2
  import { Dayjs } from "dayjs";
3
+ import type { CalendarWeekConfig } from "../Calendar/types";
3
4
  import { PresetButton } from "../Calendar/internal/Actions";
4
5
  import { TimeFieldProps } from "../TimeField/TimeField";
5
6
  import { InputSize, InputVariant } from "../Input/types";
@@ -63,14 +64,9 @@ export type DateRangePickerProps = {
63
64
  */
64
65
  monthFormat?: string;
65
66
  /**
66
- * カレンダーに表示する曜日のリスト
67
+ * 週の開始曜日と曜日見出し。未指定時は `LocaleProvider` の defaultProps、なければ Calendar と同様のフォールバック。
67
68
  */
68
- weekList?: string[];
69
- /**
70
- * 週の開始日 (0=日曜日, 1=月曜日, 2=火曜日, ...)
71
- * @default 0
72
- */
73
- weekStart?: number;
69
+ weekConfig?: CalendarWeekConfig;
74
70
  /**
75
71
  * カレンダーのActionsエリアにDateFieldを表示する
76
72
  * @default false
@@ -18,7 +18,9 @@ export declare const Select: import("styled-components").StyledComponent<"button
18
18
  export declare const SelectIcon: import("styled-components").StyledComponent<"span", import("styled-components").DefaultTheme, {}, never>;
19
19
  export declare const StyledContextMenu2TextInputItem: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<{
20
20
  onEnter?: (() => void) | undefined;
21
- } & import("react").InputHTMLAttributes<HTMLInputElement> & import("react").RefAttributes<HTMLInputElement>>, import("styled-components").DefaultTheme, {}, never>;
21
+ } & import("react").InputHTMLAttributes<HTMLInputElement> & import("react").RefAttributes<HTMLInputElement>>, import("styled-components").DefaultTheme, import("../ContextMenu2/ContextMenu2TextInputItem").ContextMenu2TextInputItemStyledProps & {
22
+ $insetFocusRingPadding: boolean;
23
+ }, "$insetFocusRingPadding">;
22
24
  export declare const SearchHeaderContainer: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
23
25
  export declare const SearchInputWrapper: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
24
26
  export declare const SearchResetButton: import("styled-components").StyledComponent<"button", import("styled-components").DefaultTheme, {}, never>;
@@ -16,7 +16,9 @@ type StyledContextMenu2TextInputItemProps = {
16
16
  };
17
17
  export declare const StyledContextMenu2TextInputItem: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<{
18
18
  onEnter?: (() => void) | undefined;
19
- } & import("react").InputHTMLAttributes<HTMLInputElement> & import("react").RefAttributes<HTMLInputElement>>, import("styled-components").DefaultTheme, StyledContextMenu2TextInputItemProps, never>;
19
+ } & import("react").InputHTMLAttributes<HTMLInputElement> & import("react").RefAttributes<HTMLInputElement>>, import("styled-components").DefaultTheme, import("../ContextMenu2/ContextMenu2TextInputItem").ContextMenu2TextInputItemStyledProps & {
20
+ $insetFocusRingPadding: boolean;
21
+ } & StyledContextMenu2TextInputItemProps, "$insetFocusRingPadding">;
20
22
  export declare const StyledTrigger: import("styled-components").StyledComponent<"button", import("styled-components").DefaultTheme, {
21
23
  $isOpen?: boolean | undefined;
22
24
  $placeholder?: boolean | undefined;
@@ -42,7 +42,9 @@ export declare const IconArea: import("styled-components").StyledComponent<"div"
42
42
  }, never>;
43
43
  export declare const StyledContextMenu2TextInputItem: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<{
44
44
  onEnter?: (() => void) | undefined;
45
- } & import("react").InputHTMLAttributes<HTMLInputElement> & import("react").RefAttributes<HTMLInputElement>>, import("styled-components").DefaultTheme, {}, never>;
45
+ } & import("react").InputHTMLAttributes<HTMLInputElement> & import("react").RefAttributes<HTMLInputElement>>, import("styled-components").DefaultTheme, import("../ContextMenu2/ContextMenu2TextInputItem").ContextMenu2TextInputItemStyledProps & {
46
+ $insetFocusRingPadding: boolean;
47
+ }, "$insetFocusRingPadding">;
46
48
  export declare const OptionsContainer: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
47
49
  export declare const SearchHeaderContainer: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
48
50
  export declare const SearchInputWrapper: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
@@ -1,5 +1,5 @@
1
1
  import { ConfirmModalProps, FileUploaderProps, ItemEmptyProps, MultipleFilterProps } from "..";
2
- import { DatePickerProps, SelectProps } from "../components";
2
+ import { DatePickerProps, DateRangePickerProps, SelectProps } from "../components";
3
3
  import { CreatableSelectProps } from "../components/CreatableSelect";
4
4
  import { FullSizeConfirmModalProps } from "../components/FullSizeConfirmModal";
5
5
  import { EditFilterCardProps } from "../components/MultipleFilter/internal/EditFilterCard/EditFilterCard";
@@ -34,18 +34,10 @@ export interface Localization {
34
34
  defaultProps: Pick<EditFilterCardProps, "editButtonTitle" | "inputErrorText" | "formPlaceholder" | "sectionTitle" | "conditionTitle">;
35
35
  };
36
36
  DatePicker?: {
37
- defaultProps: Pick<DatePickerProps, "monthFormat"> & {
38
- weekList: string[];
39
- weekStart: number;
40
- };
37
+ defaultProps: Pick<DatePickerProps, "monthFormat" | "weekConfig">;
41
38
  };
42
39
  DateRangePicker?: {
43
- defaultProps: Pick<DatePickerProps, "monthFormat"> & {
44
- weekList: string[];
45
- weekStart: number;
46
- applyButtonText: string;
47
- cancelButtonText: string;
48
- };
40
+ defaultProps: Pick<DateRangePickerProps, "monthFormat" | "weekConfig" | "applyButtonText" | "cancelButtonText">;
49
41
  };
50
42
  WeekTime?: {
51
43
  defaultProps: {