@moneyforward/mfui-components 3.20.0 → 3.21.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/src/DateTimeSelection/DatePicker/DatePicker.js +2 -11
- package/dist/src/DateTimeSelection/DateRangePicker/DateRangePicker.d.ts +1 -1
- package/dist/src/DateTimeSelection/DateRangePicker/DateRangePicker.js +10 -2
- package/dist/src/DateTimeSelection/DateRangePicker/DateRangePicker.types.d.ts +14 -0
- package/dist/src/DateTimeSelection/DateRangePicker/DateRangePickerPopover/DateRangePickerPopover.js +13 -5
- package/dist/src/DateTimeSelection/DateRangePicker/DateRangePickerPopover/utilities/createDateRangePickerPopoverTestUtility.js +2 -2
- package/dist/src/DateTimeSelection/DateRangePicker/DateRangePickerTrigger/utilities/createDateRangePickerTriggerTestUtility.js +3 -1
- package/dist/src/DateTimeSelection/MonthPicker/MonthPicker.d.ts +1 -1
- package/dist/src/DateTimeSelection/MonthPicker/MonthPicker.js +10 -2
- package/dist/src/DateTimeSelection/MonthPicker/MonthPicker.types.d.ts +14 -0
- package/dist/src/DateTimeSelection/MonthPicker/MonthPickerPanel/MonthCell/MonthCell.js +2 -25
- package/dist/src/DateTimeSelection/MonthPicker/MonthPickerPanel/MonthPickerPanel.js +1 -1
- package/dist/src/DateTimeSelection/MonthRangePicker/MonthRangePicker.d.ts +1 -1
- package/dist/src/DateTimeSelection/MonthRangePicker/MonthRangePicker.js +14 -5
- package/dist/src/DateTimeSelection/MonthRangePicker/MonthRangePicker.types.d.ts +21 -0
- package/dist/src/DateTimeSelection/MonthRangePicker/MonthRangePickerMonthCell/MonthRangePickerMonthCell.d.ts +1 -0
- package/dist/src/DateTimeSelection/MonthRangePicker/MonthRangePickerMonthCell/MonthRangePickerMonthCell.js +10 -3
- package/dist/src/DateTimeSelection/MonthRangePicker/MonthRangePickerNavigation/MonthRangePickerNavigation.js +16 -3
- package/dist/src/DateTimeSelection/MonthRangePicker/MonthRangePickerPanel/MonthRangePickerPanel.js +3 -1
- package/dist/src/DateTimeSelection/TimePicker/TimePicker.d.ts +43 -0
- package/dist/src/DateTimeSelection/TimePicker/TimePicker.js +85 -0
- package/dist/src/DateTimeSelection/TimePicker/TimePicker.types.d.ts +61 -0
- package/dist/src/DateTimeSelection/TimePicker/TimePicker.types.js +1 -0
- package/dist/src/DateTimeSelection/TimePicker/constants.d.ts +4 -0
- package/dist/src/DateTimeSelection/TimePicker/constants.js +12 -0
- package/dist/src/DateTimeSelection/TimePicker/index.d.ts +2 -0
- package/dist/src/DateTimeSelection/TimePicker/index.js +1 -0
- package/dist/src/DateTimeSelection/index.d.ts +1 -0
- package/dist/src/DateTimeSelection/index.js +1 -0
- package/dist/src/DateTimeSelection/shared/BaseRangePicker/BaseRangePicker.d.ts +1 -1
- package/dist/src/DateTimeSelection/shared/BaseRangePicker/BaseRangePicker.js +2 -2
- package/dist/src/DateTimeSelection/shared/BaseRangePicker/BaseRangePicker.types.d.ts +10 -0
- package/dist/src/DateTimeSelection/shared/BaseRangePicker/BaseRangePickerProvider/BaseRangePickerProvider.js +24 -20
- package/dist/src/DateTimeSelection/shared/BaseRangePicker/BaseRangePickerProvider/BaseRangePickerProvider.types.d.ts +9 -0
- package/dist/src/DateTimeSelection/shared/BaseRangePicker/BaseRangePickerTrigger/hooks/useDateRangeTriggerValueController.js +4 -4
- package/dist/src/DateTimeSelection/shared/CalendarLocale/CalendarLocaleContext.d.ts +1 -1
- package/dist/src/DateTimeSelection/shared/CalendarLocale/CalendarLocaleContext.js +1 -1
- package/dist/src/DateTimeSelection/shared/DayCell/DayCell.js +2 -3
- package/dist/src/DateTimeSelection/shared/YearSelector/YearSelector.js +1 -1
- package/dist/src/DateTimeSelection/shared/utilities/dateParsing.js +16 -9
- package/dist/src/DateTimeSelection/shared/utilities/japaneseCalendar.d.ts +36 -8
- package/dist/src/DateTimeSelection/shared/utilities/japaneseCalendar.js +82 -15
- package/dist/src/DateTimeSelection/shared/utilities/monthCellMonthFormat.d.ts +14 -0
- package/dist/src/DateTimeSelection/shared/utilities/monthCellMonthFormat.js +35 -0
- package/dist/styled-system/recipes/index.d.ts +1 -0
- package/dist/styled-system/recipes/index.js +1 -0
- package/dist/styled-system/recipes/time-picker-slot-recipe.d.ts +44 -0
- package/dist/styled-system/recipes/time-picker-slot-recipe.js +62 -0
- package/dist/styles.css +168 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +5 -5
- package/dist/src/DateTimeSelection/shared/BasePicker/YearSelector/YearSelector.d.ts +0 -18
- package/dist/src/DateTimeSelection/shared/BasePicker/YearSelector/YearSelector.js +0 -36
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@moneyforward/mfui-components",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.21.0",
|
|
4
4
|
"description": "React UI Component Library for all Money Forward products",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
],
|
|
32
32
|
"devDependencies": {
|
|
33
33
|
"@chromatic-com/storybook": "5.1.2",
|
|
34
|
-
"@pandacss/dev": "1.
|
|
34
|
+
"@pandacss/dev": "1.11.1",
|
|
35
35
|
"@storybook/addon-a11y": "10.3.6",
|
|
36
36
|
"@storybook/addon-docs": "10.3.6",
|
|
37
37
|
"@storybook/addon-links": "10.3.6",
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"react-dom": "19.2.3",
|
|
53
53
|
"storybook": "10.3.6",
|
|
54
54
|
"ts-node": "10.9.2",
|
|
55
|
-
"tsx": "4.
|
|
55
|
+
"tsx": "4.22.3",
|
|
56
56
|
"vitest": "3.2.4"
|
|
57
57
|
},
|
|
58
58
|
"peerDependencies": {
|
|
@@ -63,8 +63,8 @@
|
|
|
63
63
|
"@floating-ui/react-dom": "^2.1.2",
|
|
64
64
|
"@tanstack/react-virtual": "^3.13.18",
|
|
65
65
|
"dayjs": "^1.11.13",
|
|
66
|
-
"@moneyforward/mfui-
|
|
67
|
-
"@moneyforward/mfui-
|
|
66
|
+
"@moneyforward/mfui-icons-react": "^3.4.0",
|
|
67
|
+
"@moneyforward/mfui-design-tokens": "^3.2.0"
|
|
68
68
|
},
|
|
69
69
|
"scripts": {
|
|
70
70
|
"prepare:panda": "panda codegen",
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { type SelectBoxProps } from '../../../../SelectBox';
|
|
2
|
-
/**
|
|
3
|
-
* Props for YearSelector component
|
|
4
|
-
*/
|
|
5
|
-
type YearSelectorProps = {
|
|
6
|
-
/**
|
|
7
|
-
* Internal value of the DatePicker
|
|
8
|
-
*/
|
|
9
|
-
value?: Date;
|
|
10
|
-
/**
|
|
11
|
-
* This callback will be triggered whenever you click on a year.
|
|
12
|
-
*
|
|
13
|
-
* @param year - The year that user selected.
|
|
14
|
-
*/
|
|
15
|
-
onChange: (year: number) => void;
|
|
16
|
-
} & Pick<SelectBoxProps, 'targetDOMNode'>;
|
|
17
|
-
export declare function YearSelector({ value, onChange, targetDOMNode }: YearSelectorProps): import("react/jsx-runtime").JSX.Element;
|
|
18
|
-
export {};
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useCallback, useMemo } from 'react';
|
|
3
|
-
import { SelectBox } from '../../../../SelectBox';
|
|
4
|
-
import { yearSelectorSlotRecipe } from '../../../../../styled-system/recipes';
|
|
5
|
-
import { MAXIMUM_VIEWABLE_YEAR, MINIMUM_VIEWABLE_YEAR } from '../constants';
|
|
6
|
-
import { cx } from '../../../../../styled-system/css';
|
|
7
|
-
import { useCalendarLocale } from '../../CalendarLocale/CalendarLocaleContext';
|
|
8
|
-
import { useDisplayJapaneseCalendar } from '../../CalendarLocale/DisplayJapaneseCalendarContext';
|
|
9
|
-
import { yearToEraLabel } from '../../utilities/japaneseCalendar';
|
|
10
|
-
export function YearSelector({ value, onChange, targetDOMNode }) {
|
|
11
|
-
const calendarLocale = useCalendarLocale();
|
|
12
|
-
const displayJapaneseCalendar = useDisplayJapaneseCalendar();
|
|
13
|
-
const internalYearString = useMemo(() => (value ?? new Date()).getFullYear().toString(), [value]);
|
|
14
|
-
const options = useMemo(() => Array.from({ length: MAXIMUM_VIEWABLE_YEAR - MINIMUM_VIEWABLE_YEAR + 1 }).map((_, i) => {
|
|
15
|
-
const year = MINIMUM_VIEWABLE_YEAR + i;
|
|
16
|
-
let label;
|
|
17
|
-
if (displayJapaneseCalendar) {
|
|
18
|
-
label = yearToEraLabel(year, calendarLocale ?? 'ja');
|
|
19
|
-
}
|
|
20
|
-
else if (calendarLocale === 'ja') {
|
|
21
|
-
label = `${String(year)}年`;
|
|
22
|
-
}
|
|
23
|
-
else {
|
|
24
|
-
label = String(year);
|
|
25
|
-
}
|
|
26
|
-
return { value: String(year), label };
|
|
27
|
-
}), [calendarLocale, displayJapaneseCalendar]);
|
|
28
|
-
const selectedOption = useMemo(() => options.find((o) => o.value === internalYearString), [options, internalYearString]);
|
|
29
|
-
const handleChange = useCallback((option) => {
|
|
30
|
-
if (option) {
|
|
31
|
-
onChange(Number(option.value));
|
|
32
|
-
}
|
|
33
|
-
}, [onChange]);
|
|
34
|
-
const classes = yearSelectorSlotRecipe();
|
|
35
|
-
return (_jsx(SelectBox, { value: selectedOption, options: options, size: "small", targetDOMNode: targetDOMNode, enableAutoScrollToSelectedOption: { block: 'center', behavior: 'instant' }, popoverContentProps: { className: cx(classes.optionPanel, 'mfui-YearSelector__optionPanel') }, onChange: handleChange }));
|
|
36
|
-
}
|