@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.
Files changed (53) hide show
  1. package/dist/src/DateTimeSelection/DatePicker/DatePicker.js +2 -11
  2. package/dist/src/DateTimeSelection/DateRangePicker/DateRangePicker.d.ts +1 -1
  3. package/dist/src/DateTimeSelection/DateRangePicker/DateRangePicker.js +10 -2
  4. package/dist/src/DateTimeSelection/DateRangePicker/DateRangePicker.types.d.ts +14 -0
  5. package/dist/src/DateTimeSelection/DateRangePicker/DateRangePickerPopover/DateRangePickerPopover.js +13 -5
  6. package/dist/src/DateTimeSelection/DateRangePicker/DateRangePickerPopover/utilities/createDateRangePickerPopoverTestUtility.js +2 -2
  7. package/dist/src/DateTimeSelection/DateRangePicker/DateRangePickerTrigger/utilities/createDateRangePickerTriggerTestUtility.js +3 -1
  8. package/dist/src/DateTimeSelection/MonthPicker/MonthPicker.d.ts +1 -1
  9. package/dist/src/DateTimeSelection/MonthPicker/MonthPicker.js +10 -2
  10. package/dist/src/DateTimeSelection/MonthPicker/MonthPicker.types.d.ts +14 -0
  11. package/dist/src/DateTimeSelection/MonthPicker/MonthPickerPanel/MonthCell/MonthCell.js +2 -25
  12. package/dist/src/DateTimeSelection/MonthPicker/MonthPickerPanel/MonthPickerPanel.js +1 -1
  13. package/dist/src/DateTimeSelection/MonthRangePicker/MonthRangePicker.d.ts +1 -1
  14. package/dist/src/DateTimeSelection/MonthRangePicker/MonthRangePicker.js +14 -5
  15. package/dist/src/DateTimeSelection/MonthRangePicker/MonthRangePicker.types.d.ts +21 -0
  16. package/dist/src/DateTimeSelection/MonthRangePicker/MonthRangePickerMonthCell/MonthRangePickerMonthCell.d.ts +1 -0
  17. package/dist/src/DateTimeSelection/MonthRangePicker/MonthRangePickerMonthCell/MonthRangePickerMonthCell.js +10 -3
  18. package/dist/src/DateTimeSelection/MonthRangePicker/MonthRangePickerNavigation/MonthRangePickerNavigation.js +16 -3
  19. package/dist/src/DateTimeSelection/MonthRangePicker/MonthRangePickerPanel/MonthRangePickerPanel.js +3 -1
  20. package/dist/src/DateTimeSelection/TimePicker/TimePicker.d.ts +43 -0
  21. package/dist/src/DateTimeSelection/TimePicker/TimePicker.js +85 -0
  22. package/dist/src/DateTimeSelection/TimePicker/TimePicker.types.d.ts +61 -0
  23. package/dist/src/DateTimeSelection/TimePicker/TimePicker.types.js +1 -0
  24. package/dist/src/DateTimeSelection/TimePicker/constants.d.ts +4 -0
  25. package/dist/src/DateTimeSelection/TimePicker/constants.js +12 -0
  26. package/dist/src/DateTimeSelection/TimePicker/index.d.ts +2 -0
  27. package/dist/src/DateTimeSelection/TimePicker/index.js +1 -0
  28. package/dist/src/DateTimeSelection/index.d.ts +1 -0
  29. package/dist/src/DateTimeSelection/index.js +1 -0
  30. package/dist/src/DateTimeSelection/shared/BaseRangePicker/BaseRangePicker.d.ts +1 -1
  31. package/dist/src/DateTimeSelection/shared/BaseRangePicker/BaseRangePicker.js +2 -2
  32. package/dist/src/DateTimeSelection/shared/BaseRangePicker/BaseRangePicker.types.d.ts +10 -0
  33. package/dist/src/DateTimeSelection/shared/BaseRangePicker/BaseRangePickerProvider/BaseRangePickerProvider.js +24 -20
  34. package/dist/src/DateTimeSelection/shared/BaseRangePicker/BaseRangePickerProvider/BaseRangePickerProvider.types.d.ts +9 -0
  35. package/dist/src/DateTimeSelection/shared/BaseRangePicker/BaseRangePickerTrigger/hooks/useDateRangeTriggerValueController.js +4 -4
  36. package/dist/src/DateTimeSelection/shared/CalendarLocale/CalendarLocaleContext.d.ts +1 -1
  37. package/dist/src/DateTimeSelection/shared/CalendarLocale/CalendarLocaleContext.js +1 -1
  38. package/dist/src/DateTimeSelection/shared/DayCell/DayCell.js +2 -3
  39. package/dist/src/DateTimeSelection/shared/YearSelector/YearSelector.js +1 -1
  40. package/dist/src/DateTimeSelection/shared/utilities/dateParsing.js +16 -9
  41. package/dist/src/DateTimeSelection/shared/utilities/japaneseCalendar.d.ts +36 -8
  42. package/dist/src/DateTimeSelection/shared/utilities/japaneseCalendar.js +82 -15
  43. package/dist/src/DateTimeSelection/shared/utilities/monthCellMonthFormat.d.ts +14 -0
  44. package/dist/src/DateTimeSelection/shared/utilities/monthCellMonthFormat.js +35 -0
  45. package/dist/styled-system/recipes/index.d.ts +1 -0
  46. package/dist/styled-system/recipes/index.js +1 -0
  47. package/dist/styled-system/recipes/time-picker-slot-recipe.d.ts +44 -0
  48. package/dist/styled-system/recipes/time-picker-slot-recipe.js +62 -0
  49. package/dist/styles.css +168 -1
  50. package/dist/tsconfig.build.tsbuildinfo +1 -1
  51. package/package.json +5 -5
  52. package/dist/src/DateTimeSelection/shared/BasePicker/YearSelector/YearSelector.d.ts +0 -18
  53. 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.20.0",
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.9.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.21.0",
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-design-tokens": "^3.2.0",
67
- "@moneyforward/mfui-icons-react": "^3.4.0"
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
- }