@moneyforward/mfui-components 3.35.0 → 3.36.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 (99) hide show
  1. package/dist/src/DataTable/DataTable.d.ts +50 -0
  2. package/dist/src/DataTable/DataTable.js +44 -0
  3. package/dist/src/DataTable/DataTableFilterButton/DataTableFilterButton.d.ts +6 -0
  4. package/dist/src/DataTable/DataTableFilterButton/DataTableFilterButton.js +63 -0
  5. package/dist/src/DataTable/DataTableFilterButton/DataTableFilterButton.types.d.ts +49 -0
  6. package/dist/src/DataTable/DataTableFilterButton/DataTableFilterButton.types.js +1 -0
  7. package/dist/src/DataTable/DataTableFilterButton/index.d.ts +2 -0
  8. package/dist/src/DataTable/DataTableFilterButton/index.js +1 -0
  9. package/dist/src/DataTable/DataTableHeaderCell/DataTableHeaderCell.js +6 -2
  10. package/dist/src/DataTable/DataTableHeaderCell/DataTableHeaderCell.types.d.ts +23 -1
  11. package/dist/src/DataTable/DataTableSortButton/DataTableSortButton.d.ts +4 -0
  12. package/dist/src/DataTable/DataTableSortButton/DataTableSortButton.js +17 -0
  13. package/dist/src/DataTable/DataTableSortButton/DataTableSortButton.types.d.ts +25 -0
  14. package/dist/src/DataTable/DataTableSortButton/DataTableSortButton.types.js +1 -0
  15. package/dist/src/DataTable/DataTableSortButton/index.d.ts +2 -0
  16. package/dist/src/DataTable/DataTableSortButton/index.js +1 -0
  17. package/dist/src/DataTable/index.d.ts +2 -0
  18. package/dist/src/DateTimeSelection/DatePicker/DatePickerDateCell/DatePickerDateCell.js +3 -0
  19. package/dist/src/DateTimeSelection/DateRangePicker/DateRangePickerPopover/DateRangePickerCalendar/DateRangePickerDateCell.d.ts +2 -2
  20. package/dist/src/DateTimeSelection/DateRangePicker/DateRangePickerPopover/DateRangePickerCalendar/DateRangePickerDateCell.js +5 -2
  21. package/dist/src/DateTimeSelection/DateRangePicker/DateRangePickerTrigger/DateRangePickerTrigger.js +3 -2
  22. package/dist/src/DateTimeSelection/DateRangePicker/DateRangePickerTrigger/DateRangePickerTrigger.types.d.ts +17 -0
  23. package/dist/src/DateTimeSelection/FilterDateRangePicker/DateRangePickerContent/DateRangePickerContent.js +3 -1
  24. package/dist/src/DateTimeSelection/FilterDateRangePicker/FilterDateRangePicker.types.d.ts +2 -1
  25. package/dist/src/DateTimeSelection/FilterMonthPicker/FilterMonthPicker.types.d.ts +2 -1
  26. package/dist/src/DateTimeSelection/FilterMonthPicker/MonthPickerPopover/MonthPickerPopover.js +2 -1
  27. package/dist/src/DateTimeSelection/MonthRangePicker/MonthRangePickerMonthCell/MonthRangePickerMonthCell.d.ts +1 -0
  28. package/dist/src/DateTimeSelection/MonthRangePicker/MonthRangePickerMonthCell/MonthRangePickerMonthCell.js +11 -8
  29. package/dist/src/DateTimeSelection/MonthRangePicker/MonthRangePickerMonthCell/constants.d.ts +7 -15
  30. package/dist/src/DateTimeSelection/MonthRangePicker/MonthRangePickerMonthCell/constants.js +26 -13
  31. package/dist/src/DateTimeSelection/TimePicker/TimePicker.d.ts +2 -0
  32. package/dist/src/DateTimeSelection/TimePicker/TimePicker.js +3 -2
  33. package/dist/src/DateTimeSelection/TimePicker/TimePicker.types.d.ts +27 -0
  34. package/dist/src/DateTimeSelection/shared/BasePicker/BasePicker.js +4 -1
  35. package/dist/src/DateTimeSelection/shared/BasePicker/constants.d.ts +1 -1
  36. package/dist/src/DateTimeSelection/shared/BasePicker/constants.js +2 -0
  37. package/dist/src/DateTimeSelection/shared/BaseRangePicker/BaseRangePicker.d.ts +1 -1
  38. package/dist/src/DateTimeSelection/shared/BaseRangePicker/BaseRangePicker.js +4 -4
  39. package/dist/src/DateTimeSelection/shared/BaseRangePicker/BaseRangePicker.types.d.ts +33 -1
  40. package/dist/src/DateTimeSelection/shared/BaseRangePicker/BaseRangePickerPopover/BaseRangePickerCalendar/BaseRangePickerDateCell.d.ts +2 -2
  41. package/dist/src/DateTimeSelection/shared/BaseRangePicker/BaseRangePickerPopover/BaseRangePickerCalendar/BaseRangePickerDateCell.js +15 -36
  42. package/dist/src/DateTimeSelection/shared/BaseRangePicker/BaseRangePickerPopover/BaseRangePickerCalendar/index.d.ts +0 -1
  43. package/dist/src/DateTimeSelection/shared/BaseRangePicker/BaseRangePickerPopover/BaseRangePickerCalendar/index.js +0 -1
  44. package/dist/src/DateTimeSelection/shared/BaseRangePicker/BaseRangePickerPopover/BaseRangePickerPopover.js +2 -1
  45. package/dist/src/DateTimeSelection/shared/BaseRangePicker/BaseRangePickerTrigger/BaseRangePickerTrigger.js +3 -2
  46. package/dist/src/DateTimeSelection/shared/BaseRangePicker/BaseRangePickerTrigger/BaseRangePickerTrigger.types.d.ts +17 -0
  47. package/dist/src/DateTimeSelection/shared/accessibility/constants.d.ts +7 -16
  48. package/dist/src/DateTimeSelection/shared/accessibility/constants.js +30 -14
  49. package/dist/src/DateTimeSelection/shared/accessibility/generateDateLabel.d.ts +6 -1
  50. package/dist/src/DateTimeSelection/shared/accessibility/generateDateLabel.js +14 -8
  51. package/dist/src/DeterminateProgressIndicator/DeterminateProgressIndicator.d.ts +18 -0
  52. package/dist/src/DeterminateProgressIndicator/DeterminateProgressIndicator.js +20 -0
  53. package/dist/src/DeterminateProgressIndicator/DeterminateProgressIndicator.types.d.ts +41 -0
  54. package/dist/src/DeterminateProgressIndicator/DeterminateProgressIndicator.types.js +1 -0
  55. package/dist/src/DeterminateProgressIndicator/index.d.ts +2 -0
  56. package/dist/src/DeterminateProgressIndicator/index.js +1 -0
  57. package/dist/src/FilterSelectBox/FilterSelectBox.types.d.ts +1 -1
  58. package/dist/src/MultipleFilterSelectBox/MultipleFilterSelectBox.types.d.ts +1 -1
  59. package/dist/src/MultipleSelectBox/MultipleSelectBox.d.ts +1 -1
  60. package/dist/src/MultipleSelectBox/MultipleSelectBox.js +2 -2
  61. package/dist/src/MultipleSelectBox/MultipleSelectBox.types.d.ts +1 -1
  62. package/dist/src/MultipleSelectBox/MultipleSelectBoxTrigger/MultipleSelectBoxTrigger.js +2 -2
  63. package/dist/src/MultipleSelectBox/MultipleSelectBoxTrigger/MultipleSelectBoxTrigger.types.d.ts +39 -1
  64. package/dist/src/Popover/Popover.js +1 -1
  65. package/dist/src/Popover/Popover.types.d.ts +1 -1
  66. package/dist/src/SelectBox/SelectBox.d.ts +1 -1
  67. package/dist/src/SelectBox/SelectBox.js +3 -3
  68. package/dist/src/SelectBox/SelectBox.types.d.ts +31 -1
  69. package/dist/src/TextBox/TextBox.d.ts +2 -1
  70. package/dist/src/TextBox/TextBox.js +4 -3
  71. package/dist/src/TextBox/TextBox.types.d.ts +26 -0
  72. package/dist/src/Textarea/Textarea.d.ts +2 -1
  73. package/dist/src/Textarea/Textarea.js +11 -3
  74. package/dist/src/Textarea/Textarea.types.d.ts +26 -0
  75. package/dist/src/index.d.ts +1 -0
  76. package/dist/src/index.js +1 -0
  77. package/dist/styled-system/recipes/base-range-picker-trigger-slot-recipe.d.ts +1 -0
  78. package/dist/styled-system/recipes/base-range-picker-trigger-slot-recipe.js +5 -0
  79. package/dist/styled-system/recipes/data-table-filter-button-slot-recipe.d.ts +33 -0
  80. package/dist/styled-system/recipes/data-table-filter-button-slot-recipe.js +43 -0
  81. package/dist/styled-system/recipes/data-table-header-cell-slot-recipe.d.ts +3 -2
  82. package/dist/styled-system/recipes/data-table-header-cell-slot-recipe.js +69 -1
  83. package/dist/styled-system/recipes/data-table-sort-button-slot-recipe.d.ts +33 -0
  84. package/dist/styled-system/recipes/data-table-sort-button-slot-recipe.js +35 -0
  85. package/dist/styled-system/recipes/determinate-progress-indicator-slot-recipe.d.ts +36 -0
  86. package/dist/styled-system/recipes/determinate-progress-indicator-slot-recipe.js +61 -0
  87. package/dist/styled-system/recipes/index.d.ts +3 -0
  88. package/dist/styled-system/recipes/index.js +3 -0
  89. package/dist/styled-system/recipes/text-box-slot-recipe.d.ts +4 -0
  90. package/dist/styled-system/recipes/text-box-slot-recipe.js +8 -2
  91. package/dist/styled-system/recipes/textarea-slot-recipe.d.ts +4 -0
  92. package/dist/styled-system/recipes/textarea-slot-recipe.js +6 -0
  93. package/dist/styled-system/recipes/time-picker-slot-recipe.d.ts +4 -0
  94. package/dist/styled-system/recipes/time-picker-slot-recipe.js +8 -2
  95. package/dist/styles.css +265 -10
  96. package/dist/tsconfig.build.tsbuildinfo +1 -1
  97. package/package.json +11 -11
  98. package/dist/src/DateTimeSelection/shared/BaseRangePicker/BaseRangePickerPopover/BaseRangePickerCalendar/constants.d.ts +0 -18
  99. package/dist/src/DateTimeSelection/shared/BaseRangePicker/BaseRangePickerPopover/BaseRangePickerCalendar/constants.js +0 -18
@@ -0,0 +1,41 @@
1
+ import { type ComponentPropsWithoutRef } from 'react';
2
+ export type DeterminateProgressIndicatorProps = {
3
+ /**
4
+ * The current progress value expressed as a percentage (`0`–`100`).
5
+ *
6
+ * Values outside this range are clamped to `0` or `100`.
7
+ */
8
+ value: number;
9
+ /**
10
+ * Whether to display the value text (the progress percentage as a number).
11
+ *
12
+ * @default true
13
+ */
14
+ showValueText?: boolean;
15
+ /**
16
+ * Where to place the value text relative to the progress indicator.
17
+ *
18
+ * - `'right'`: to the right of the progress indicator, vertically centered.
19
+ * - `'top'`: in the upper-right corner, above the progress indicator.
20
+ *
21
+ * @default 'right'
22
+ */
23
+ valueTextPosition?: 'right' | 'top';
24
+ /**
25
+ * The unit shown after the value. Set to an empty string to hide the unit.
26
+ *
27
+ * @default '%'
28
+ */
29
+ unit?: string;
30
+ /**
31
+ * The accessible name describing what is loading.
32
+ *
33
+ * Provide this (or `aria-labelledby`) so assistive technologies can announce
34
+ * the purpose of the progress indicator.
35
+ */
36
+ 'aria-label'?: string;
37
+ /**
38
+ * The additional class name for the root element.
39
+ */
40
+ className?: string;
41
+ } & Omit<ComponentPropsWithoutRef<'div'>, 'role' | 'children'>;
@@ -0,0 +1,2 @@
1
+ export { DeterminateProgressIndicator } from './DeterminateProgressIndicator';
2
+ export type { DeterminateProgressIndicatorProps } from './DeterminateProgressIndicator.types';
@@ -0,0 +1 @@
1
+ export { DeterminateProgressIndicator } from './DeterminateProgressIndicator';
@@ -14,4 +14,4 @@ export type FilterSelectBoxProps = {
14
14
  * @param open - The new open state of the FilterSelectBox.
15
15
  */
16
16
  onOpenStateChanged?: (open: boolean) => void;
17
- } & Omit<SelectBoxProps, 'renderDisplayValue' | 'placeholder' | 'invalid' | 'triggerProps'>;
17
+ } & Omit<SelectBoxProps, 'renderDisplayValue' | 'placeholder' | 'invalid' | 'caution' | 'triggerProps'>;
@@ -8,4 +8,4 @@ export type MultipleFilterSelectBoxProps<T extends AllowedValueTypes = string, A
8
8
  * The class name to apply to the component
9
9
  */
10
10
  className?: string;
11
- } & Omit<MultipleSelectBoxProps<T, AdditionalProps>, 'renderDisplayValue' | 'showDisplayValueAsTag' | 'placeholder' | 'invalid' | 'triggerWrapperProps' | 'triggerProps'>;
11
+ } & Omit<MultipleSelectBoxProps<T, AdditionalProps>, 'renderDisplayValue' | 'showDisplayValueAsTag' | 'placeholder' | 'invalid' | 'caution' | 'triggerWrapperProps' | 'triggerProps'>;
@@ -4,4 +4,4 @@ import { type MultipleSelectBoxProps, type AllowedValueTypes } from './MultipleS
4
4
  * This component is separated from the SelectBox component because it has a different behavior.
5
5
  * This component switches the variants of looks and behaviors depends on the props: size, invalid, disabled.
6
6
  */
7
- export declare function MultipleSelectBox<T extends AllowedValueTypes = string, AdditionalProps extends Record<string, unknown> = Record<string, never>>({ id, triggerProps, triggerWrapperProps, size, options, defaultValue, placeholder, emptyMessage, disabled, invalid, targetDOMNode, name, onChange, value, showDisplayValueAsTag, renderDisplayValue, enableSearchOptions, notFoundMessage, searchBoxProps, loading, onSearchOptions, clearButtonProps, disableClearButton, optionPanelProps, popoverWrapperProps, enableAllOptionsControls, enableApplyControls, showSelectedCount, selectAllButtonProps, clearAllButtonProps, selectedCountProps, cancelButtonProps, applyButtonProps, renderOption, renderPopoverHeader, renderOptionList, renderPopoverFooter, onOpenStateChanged, enableAutoUnmount, onBlur, showGroupOptionDivider, enableVirtualization, virtualizationOptions, infiniteScroll, enableCreateOption, onCreateOption, createOptionProps, }: MultipleSelectBoxProps<T, AdditionalProps>): import("react/jsx-runtime").JSX.Element;
7
+ export declare function MultipleSelectBox<T extends AllowedValueTypes = string, AdditionalProps extends Record<string, unknown> = Record<string, never>>({ id, triggerProps, triggerWrapperProps, size, options, defaultValue, placeholder, emptyMessage, disabled, invalid, required, caution, targetDOMNode, name, onChange, value, showDisplayValueAsTag, renderDisplayValue, enableSearchOptions, notFoundMessage, searchBoxProps, loading, onSearchOptions, clearButtonProps, disableClearButton, optionPanelProps, popoverWrapperProps, enableAllOptionsControls, enableApplyControls, showSelectedCount, selectAllButtonProps, clearAllButtonProps, selectedCountProps, cancelButtonProps, applyButtonProps, renderOption, renderPopoverHeader, renderOptionList, renderPopoverFooter, onOpenStateChanged, enableAutoUnmount, onBlur, showGroupOptionDivider, enableVirtualization, virtualizationOptions, infiniteScroll, enableCreateOption, onCreateOption, createOptionProps, }: MultipleSelectBoxProps<T, AdditionalProps>): import("react/jsx-runtime").JSX.Element;
@@ -36,7 +36,7 @@ const SKELETON_ITEM_COUNT = 4;
36
36
  */
37
37
  export function MultipleSelectBox({ id, triggerProps, triggerWrapperProps, size, options = [], defaultValue,
38
38
  // eslint-disable-next-line @typescript-eslint/no-deprecated
39
- placeholder, emptyMessage, disabled, invalid, targetDOMNode, name, onChange, value, showDisplayValueAsTag, renderDisplayValue, enableSearchOptions = false, notFoundMessage, searchBoxProps, loading = false, onSearchOptions, clearButtonProps, disableClearButton = false, optionPanelProps, popoverWrapperProps, enableAllOptionsControls = false, enableApplyControls = false, showSelectedCount = false, selectAllButtonProps, clearAllButtonProps, selectedCountProps, cancelButtonProps, applyButtonProps, renderOption, renderPopoverHeader, renderOptionList, renderPopoverFooter, onOpenStateChanged, enableAutoUnmount = true, onBlur, showGroupOptionDivider, enableVirtualization = false, virtualizationOptions, infiniteScroll, enableCreateOption = false, onCreateOption, createOptionProps, }) {
39
+ placeholder, emptyMessage, disabled, invalid, required, caution, targetDOMNode, name, onChange, value, showDisplayValueAsTag, renderDisplayValue, enableSearchOptions = false, notFoundMessage, searchBoxProps, loading = false, onSearchOptions, clearButtonProps, disableClearButton = false, optionPanelProps, popoverWrapperProps, enableAllOptionsControls = false, enableApplyControls = false, showSelectedCount = false, selectAllButtonProps, clearAllButtonProps, selectedCountProps, cancelButtonProps, applyButtonProps, renderOption, renderPopoverHeader, renderOptionList, renderPopoverFooter, onOpenStateChanged, enableAutoUnmount = true, onBlur, showGroupOptionDivider, enableVirtualization = false, virtualizationOptions, infiniteScroll, enableCreateOption = false, onCreateOption, createOptionProps, }) {
40
40
  const classes = multipleSelectBoxSlotRecipe({ showGroupOptionDivider });
41
41
  const triggerRef = useRef(null);
42
42
  const listBoxId = useId();
@@ -350,5 +350,5 @@ placeholder, emptyMessage, disabled, invalid, targetDOMNode, name, onChange, val
350
350
  `${searchText.trim()}を追加できませんでした。` }) })) : null] })) : null;
351
351
  return (_jsx(Popover, { renderTrigger: ({ setTriggerRef, togglePopover, handleTriggerKeyDown, handleTriggerBlur }) => (_jsx(MultipleSelectBoxTrigger, { ref: triggerRef, wrapperRef: setTriggerRef, selectedOptions: localSelectedOptions, id: id, disabled: disabled, triggerProps: triggerProps, triggerWrapperProps: triggerWrapperProps, name: name,
352
352
  // eslint-disable-next-line @typescript-eslint/no-deprecated
353
- placeholder: placeholder, size: size, listBoxId: listBoxId, isOptionPanelOpen: isOptionPanelOpen, invalid: invalid, showDisplayValueAsTag: showDisplayValueAsTag, renderDisplayValue: renderDisplayValue, clearButtonProps: clearButtonProps, disableClearButton: disableClearButton, updateSelectedValues: updateSelectedValues, onClick: togglePopover, onKeyDown: handleTriggerKeyDown, onBlur: handleTriggerBlur })), contentProps: { className: classes.popover }, minWidth: optionPanelProps?.minWidth, maxHeight: popoverWrapperProps?.maxHeight, allowedPlacements: optionPanelProps?.allowedPlacements, renderContent: () => (_jsxs("div", { ref: optionPanelRef, className: cx(classes.optionPanel, 'mfui-MultipleSelectBox__optionPanel', optionPanelProps?.className), tabIndex: -1, onKeyDown: handleKeyDownMenu, children: [enableSearchOptions || enableAllOptionsControls ? (_jsx(VStack, { className: cx(classes.menuHeader, 'mfui-MultipleSelectBox__menuHeader'), gap: "8px", children: renderPopoverHeader ? (renderPopoverHeader({ searchNode, allOptionsControlsNode })) : (_jsxs(_Fragment, { children: [searchNode, allOptionsControlsNode] })) })) : null, renderOptionList ? (renderOptionList({ optionsNode, createOptionAreaNode })) : (_jsxs(_Fragment, { children: [optionsNode, createOptionAreaNode] })), enableApplyControls || showSelectedCount ? (_jsx(HStack, { className: cx(classes.menuFooter, 'mfui-MultipleSelectBox__menuFooter'), justifyContent: "space-between", alignItems: "center", children: renderPopoverFooter ? (renderPopoverFooter({ selectedCountNode, applyControlsNode })) : (_jsxs(_Fragment, { children: [selectedCountNode, applyControlsNode] })) })) : null] })), open: isOptionPanelOpen, targetDOMNode: targetDOMNode, enableAutoUnmount: enableAutoUnmount, onOpenStateChanged: toggleOptionPanel, onBlur: onBlur }));
353
+ placeholder: placeholder, size: size, listBoxId: listBoxId, isOptionPanelOpen: isOptionPanelOpen, invalid: invalid, required: required, caution: caution, showDisplayValueAsTag: showDisplayValueAsTag, renderDisplayValue: renderDisplayValue, clearButtonProps: clearButtonProps, disableClearButton: disableClearButton, updateSelectedValues: updateSelectedValues, onClick: togglePopover, onKeyDown: handleTriggerKeyDown, onBlur: handleTriggerBlur })), contentProps: { className: classes.popover }, minWidth: optionPanelProps?.minWidth, maxHeight: popoverWrapperProps?.maxHeight, allowedPlacements: optionPanelProps?.allowedPlacements, renderContent: () => (_jsxs("div", { ref: optionPanelRef, className: cx(classes.optionPanel, 'mfui-MultipleSelectBox__optionPanel', optionPanelProps?.className), tabIndex: -1, onKeyDown: handleKeyDownMenu, children: [enableSearchOptions || enableAllOptionsControls ? (_jsx(VStack, { className: cx(classes.menuHeader, 'mfui-MultipleSelectBox__menuHeader'), gap: "8px", children: renderPopoverHeader ? (renderPopoverHeader({ searchNode, allOptionsControlsNode })) : (_jsxs(_Fragment, { children: [searchNode, allOptionsControlsNode] })) })) : null, renderOptionList ? (renderOptionList({ optionsNode, createOptionAreaNode })) : (_jsxs(_Fragment, { children: [optionsNode, createOptionAreaNode] })), enableApplyControls || showSelectedCount ? (_jsx(HStack, { className: cx(classes.menuFooter, 'mfui-MultipleSelectBox__menuFooter'), justifyContent: "space-between", alignItems: "center", children: renderPopoverFooter ? (renderPopoverFooter({ selectedCountNode, applyControlsNode })) : (_jsxs(_Fragment, { children: [selectedCountNode, applyControlsNode] })) })) : null] })), open: isOptionPanelOpen, targetDOMNode: targetDOMNode, enableAutoUnmount: enableAutoUnmount, onOpenStateChanged: toggleOptionPanel, onBlur: onBlur }));
354
354
  }
@@ -414,7 +414,7 @@ export type MultipleSelectBoxProps<T extends AllowedValueTypes = string, Additio
414
414
  * Pass `aria-label` to override the search input's default
415
415
  * accessible name (`検索する`).
416
416
  */
417
- searchBoxProps?: Pick<SearchBoxProps, 'clearButtonProps' | 'placeholder' | 'invalid' | 'aria-label'>;
417
+ searchBoxProps?: Pick<SearchBoxProps, 'clearButtonProps' | 'placeholder' | 'invalid' | 'caution' | 'aria-label'>;
418
418
  /**
419
419
  * The properties for the option panel element.
420
420
  *
@@ -14,7 +14,7 @@ import { cx } from '../../../styled-system/css';
14
14
  *
15
15
  * @param ref - The forwarded ref to the trigger button element
16
16
  */
17
- function MultipleSelectBoxTriggerInner({ wrapperRef, triggerProps, triggerWrapperProps, size, selectedOptions, listBoxId, isOptionPanelOpen, invalid, showDisplayValueAsTag,
17
+ function MultipleSelectBoxTriggerInner({ wrapperRef, triggerProps, triggerWrapperProps, size, selectedOptions, listBoxId, isOptionPanelOpen, invalid, required, caution = false, showDisplayValueAsTag,
18
18
  // eslint-disable-next-line @typescript-eslint/no-deprecated
19
19
  placeholder, renderDisplayValue, updateSelectedValues, clearButtonProps, disableClearButton, onKeyDown, onBlur, name, disabled, ...rest }, ref) {
20
20
  const classes = multipleSelectBoxTriggerRecipe({ size });
@@ -48,6 +48,6 @@ placeholder, renderDisplayValue, updateSelectedValues, clearButtonProps, disable
48
48
  .map((option) => option.value)
49
49
  .filter((v) => v != null)
50
50
  .map(String);
51
- return (_jsx(FocusIndicator, { children: _jsxs("div", { ref: wrapperRef, className: cx(classes.wrapper, 'mfui-MultipleSelectBoxTrigger__wrapper', triggerWrapperProps?.className), children: [_jsx("button", { ref: mergeRefs(ref, triggerRef), type: "button", role: "combobox", "aria-controls": listBoxId, "aria-expanded": isOptionPanelOpen, "aria-haspopup": "listbox", "aria-invalid": invalid, value: selectedValues, disabled: disabled, onKeyDown: onKeyDown, onBlur: onBlur, ...rest, ...triggerProps, className: cx(classes.trigger, 'mfui-MultipleSelectBoxTrigger__trigger', triggerProps?.className) }), _jsx("input", { type: "hidden", name: name, value: selectedValues }), _jsx("div", { className: cx(classes.displayValues, 'mfui-MultipleSelectBoxTrigger__displayValues'), "data-mfui-content": "multiple-select-box-trigger-display-values", children: renderer() }), selectedOptions.length > 0 && !disabled && !disableClearButton ? (_jsx("div", { className: cx(classes.clearButtonContainer, 'mfui-MultipleSelectBoxTrigger__clearButtonContainer'), children: _jsx(ClearButton, { size: size === 'small' ? 'small' : 'default', className: cx(classes.clearButton, 'mfui-MultipleSelectBoxTrigger__clearButton'), "aria-label": clearButtonProps?.['aria-label'] ?? '値をクリアする', "data-mfui-content": "multiple-select-box-clear-button", onClick: handleClearValue }) })) : null, _jsx("div", { className: cx(classes.dropdownIconContainer, 'mfui-MultipleSelectBoxTrigger__dropdownIconContainer'), children: _jsx(DropdownIcon, { "aria-hidden": "true", className: cx(classes.dropdownIcon, 'mfui-MultipleSelectBoxTrigger__dropdownIcon') }) })] }) }));
51
+ return (_jsx(FocusIndicator, { children: _jsxs("div", { ref: wrapperRef, className: cx(classes.wrapper, 'mfui-MultipleSelectBoxTrigger__wrapper', triggerWrapperProps?.className), children: [_jsx("button", { ref: mergeRefs(ref, triggerRef), type: "button", role: "combobox", "aria-controls": listBoxId, "aria-expanded": isOptionPanelOpen, "aria-haspopup": "listbox", "aria-invalid": invalid, "aria-required": required || undefined, "data-mfui-caution": caution && !invalid ? true : undefined, value: selectedValues, disabled: disabled, onKeyDown: onKeyDown, onBlur: onBlur, ...rest, ...triggerProps, className: cx(classes.trigger, 'mfui-MultipleSelectBoxTrigger__trigger', triggerProps?.className) }), _jsx("input", { type: "hidden", name: name, value: selectedValues }), _jsx("div", { className: cx(classes.displayValues, 'mfui-MultipleSelectBoxTrigger__displayValues'), "data-mfui-content": "multiple-select-box-trigger-display-values", children: renderer() }), selectedOptions.length > 0 && !disabled && !disableClearButton ? (_jsx("div", { className: cx(classes.clearButtonContainer, 'mfui-MultipleSelectBoxTrigger__clearButtonContainer'), children: _jsx(ClearButton, { size: size === 'small' ? 'small' : 'default', className: cx(classes.clearButton, 'mfui-MultipleSelectBoxTrigger__clearButton'), "aria-label": clearButtonProps?.['aria-label'] ?? '値をクリアする', "data-mfui-content": "multiple-select-box-clear-button", onClick: handleClearValue }) })) : null, _jsx("div", { className: cx(classes.dropdownIconContainer, 'mfui-MultipleSelectBoxTrigger__dropdownIconContainer'), children: _jsx(DropdownIcon, { "aria-hidden": "true", className: cx(classes.dropdownIcon, 'mfui-MultipleSelectBoxTrigger__dropdownIcon') }) })] }) }));
52
52
  }
53
53
  export const MultipleSelectBoxTrigger = forwardRef(MultipleSelectBoxTriggerInner);
@@ -39,16 +39,54 @@ export type PassedProps<T extends AllowedValueTypes = string, AdditionalProps ex
39
39
  * @default false
40
40
  */
41
41
  invalid?: boolean;
42
+ /**
43
+ * Whether the trigger is required.
44
+ * When true, `aria-required="true"` is forwarded to the trigger so that
45
+ * assistive technologies announce the field as required.
46
+ *
47
+ * @default false
48
+ */
49
+ required?: boolean;
50
+ /**
51
+ * Whether the trigger element shows a caution state — the selection is valid but is
52
+ * worth double-checking.
53
+ *
54
+ * Unlike `invalid`, this does not set `aria-invalid` — the state is advisory, not an error.
55
+ * It changes the border color only, so you must also render an adjacent
56
+ * `<HelpMessage messageType="caution">` describing the concern — color alone does not
57
+ * convey the state (WCAG 2.2 1.4.1).
58
+ *
59
+ * Associate that `HelpMessage` with the trigger via `triggerProps['aria-describedby']` so
60
+ * screen readers announce it on focus, and give it `role="status"` so it is also announced
61
+ * the moment it appears while focus is already on the trigger.
62
+ *
63
+ * ```tsx
64
+ * const cautionMessageId = useId();
65
+ *
66
+ * <MultipleSelectBox caution triggerProps={{ 'aria-describedby': cautionMessageId }} />
67
+ * <HelpMessage id={cautionMessageId} role="status" messageType="caution">
68
+ * 通常より多くの項目が選択されています。
69
+ * </HelpMessage>
70
+ * ```
71
+ *
72
+ * Ignored while `invalid` is `true`, because the error state takes precedence.
73
+ *
74
+ * @default false
75
+ */
76
+ caution?: boolean;
42
77
  /**
43
78
  * The properties for the trigger element.
44
79
  *
45
80
  * @property aria-label - The alternative text for the trigger element. It is overridden by associated label using labelId prop.
46
81
  *
82
+ * @property aria-describedby - The id of the element describing the trigger element,
83
+ * such as an adjacent `HelpMessage`.
84
+ *
47
85
  * @property className - The class name for the trigger element.
48
86
  *
49
87
  * @default undefined
50
88
  */
51
- triggerProps?: Pick<ComponentPropsWithoutRef<'button'>, 'aria-label' | 'className'>;
89
+ triggerProps?: Pick<ComponentPropsWithoutRef<'button'>, 'aria-label' | 'aria-describedby' | 'className'>;
52
90
  /**
53
91
  * The properties for the wrapper element of the trigger element.
54
92
  *
@@ -253,7 +253,7 @@ export function Popover({ renderTrigger, renderContent, open, onOpenStateChanged
253
253
  });
254
254
  };
255
255
  }, [isPopoverOpen, refs.reference, refs.floating]);
256
- return (_jsxs(_Fragment, { children: [renderTrigger(options), shouldRenderTheContent ? (_jsx(Portal, { targetDOMNode: targetElement, children: _jsx("div", { ref: refs.setFloating, tabIndex: contentProps.tabIndex ?? 0, "data-mfui-content": "popover-portal-content", "data-mfui-popover-depth": nestingDepth, className: cx(classes.root, 'mfui-Popover__root', contentProps.className), style: {
256
+ return (_jsxs(_Fragment, { children: [renderTrigger(options), shouldRenderTheContent ? (_jsx(Portal, { targetDOMNode: targetElement, children: _jsx("div", { ref: refs.setFloating, id: contentProps.id, tabIndex: contentProps.tabIndex ?? 0, "data-mfui-content": "popover-portal-content", "data-mfui-popover-depth": nestingDepth, className: cx(classes.root, 'mfui-Popover__root', contentProps.className), style: {
257
257
  ...floatingStyles,
258
258
  ...(!enableAutoUnmount && !isPopoverOpen && { display: 'none' }),
259
259
  }, onKeyDown: handleKeyDownPopover, children: _jsx(TargetDomNodeProvider, { targetDomNode: refs.floating.current, children: _jsx(PopoverContextProvider, { children: renderContent(options) }) }) }) })) : null] }));
@@ -126,7 +126,7 @@ export type PopoverProps = {
126
126
  *
127
127
  * @default {}
128
128
  */
129
- contentProps?: Pick<ComponentProps<'div'>, 'className'> & {
129
+ contentProps?: Pick<ComponentProps<'div'>, 'className' | 'id'> & {
130
130
  /**
131
131
  * The tab index of the popover content element.
132
132
  * Please note if you set this prop, it may cause the incorrect focus behavior when `enableAutoFocusOnPopover` is true.
@@ -2,7 +2,7 @@ import React from 'react';
2
2
  import { type BasedAdditionalProps, type SelectBoxProps } from './SelectBox.types';
3
3
  /**
4
4
  * The general-purpose SelectBox component.
5
- * This component switches the variants of looks and behaviors depends on the props: size, invalid, disabled.
5
+ * This component switches the variants of looks and behaviors depends on the props: size, invalid, caution, disabled.
6
6
  */
7
7
  export declare const SelectBox: (<T extends string | number | undefined = string, AdditionalProps extends BasedAdditionalProps = BasedAdditionalProps>(props: SelectBoxProps<T, AdditionalProps> & {
8
8
  ref?: React.ForwardedRef<HTMLInputElement>;
@@ -33,12 +33,12 @@ const DEFAULT_SCROLL_OPTIONS = {
33
33
  const SKELETON_ITEM_COUNT = 4;
34
34
  /**
35
35
  * The general-purpose SelectBox component.
36
- * This component switches the variants of looks and behaviors depends on the props: size, invalid, disabled.
36
+ * This component switches the variants of looks and behaviors depends on the props: size, invalid, caution, disabled.
37
37
  */
38
38
  export const SelectBox = forwardRef((props, ref) => {
39
39
  const { id, triggerProps, clearButtonProps, enableClearButton = false, size, options = [], defaultValue,
40
40
  // eslint-disable-next-line @typescript-eslint/no-deprecated
41
- placeholder, emptyMessage, disabled, invalid, required, targetDOMNode, name, onChange, onBlur, value, enableSearchOptions = false, notFoundMessage, searchBoxProps, loading = false, onSearchOptions, renderDisplayValue, renderOption, renderPopoverContent, enableAutoScrollToSelectedOption, popoverContentProps, popoverWrapperProps, onOpenStateChanged, showGroupOptionDivider, triggerWrapperProps, enableAutoUnmount = true, enableConstrainedPopoverWidth = false, enableVirtualization = false, virtualizationOptions, infiniteScroll, } = props;
41
+ placeholder, emptyMessage, disabled, invalid, caution = false, required, targetDOMNode, name, onChange, onBlur, value, enableSearchOptions = false, notFoundMessage, searchBoxProps, loading = false, onSearchOptions, renderDisplayValue, renderOption, renderPopoverContent, enableAutoScrollToSelectedOption, popoverContentProps, popoverWrapperProps, onOpenStateChanged, showGroupOptionDivider, triggerWrapperProps, enableAutoUnmount = true, enableConstrainedPopoverWidth = false, enableVirtualization = false, virtualizationOptions, infiniteScroll, } = props;
42
42
  const classes = selectBoxSlotRecipe({ size, showGroupOptionDivider });
43
43
  const triggerRef = useRef(null);
44
44
  const listBoxId = useId();
@@ -338,7 +338,7 @@ export const SelectBox = forwardRef((props, ref) => {
338
338
  const hasSelectedValue = value !== undefined || localSelectedOption !== null;
339
339
  const showClearButton = enableClearButton && hasSelectedValue;
340
340
  // Use Popover's centralized blur handling instead of custom logic
341
- return (_jsx(Popover, { open: isOptionPanelOpen, targetDOMNode: targetDOMNode, minWidth: popoverContentProps?.minWidth, maxHeight: popoverWrapperProps?.maxHeight, allowedPlacements: popoverContentProps?.allowedPlacements, enableConstrainedContentWidth: enableConstrainedPopoverWidth, renderContent: () => (_jsx("div", { ref: optionPanelRef, id: listBoxId, className: cx(classes.optionPanel, 'mfui-SelectBox__optionPanel', popoverContentProps?.className), tabIndex: -1, onKeyDown: handleKeyDownMenu, children: renderPopoverContent ? (renderPopoverContent({ searchNode, optionsNode })) : (_jsxs(_Fragment, { children: [searchNode, optionsNode] })) })), renderTrigger: ({ setTriggerRef, togglePopover, isPopoverOpen, handleTriggerKeyDown, handleTriggerBlur }) => (_jsxs("div", { ref: setTriggerRef, ...triggerWrapperProps, className: cx(classes.triggerWrapper, 'mfui-SelectBox__triggerWrapper', triggerWrapperProps?.className), children: [_jsx(FocusIndicator, { children: _jsxs("button", { ref: triggerRef, id: id, type: "button", role: "combobox", disabled: disabled, "aria-label": triggerProps?.['aria-label'], "aria-controls": listBoxId, "aria-expanded": isPopoverOpen, "aria-haspopup": "listbox", "aria-invalid": invalid, "aria-required": required, className: cx(classes.trigger, 'mfui-SelectBox__trigger', triggerProps?.className), "data-placeholder": !!placeholder && !localSelectedOption, "data-selected": !!localSelectedOption, "data-mfui-has-clear-button": showClearButton, onClick: togglePopover, onKeyDown: (event) => {
341
+ return (_jsx(Popover, { open: isOptionPanelOpen, targetDOMNode: targetDOMNode, minWidth: popoverContentProps?.minWidth, maxHeight: popoverWrapperProps?.maxHeight, allowedPlacements: popoverContentProps?.allowedPlacements, enableConstrainedContentWidth: enableConstrainedPopoverWidth, renderContent: () => (_jsx("div", { ref: optionPanelRef, id: listBoxId, className: cx(classes.optionPanel, 'mfui-SelectBox__optionPanel', popoverContentProps?.className), tabIndex: -1, onKeyDown: handleKeyDownMenu, children: renderPopoverContent ? (renderPopoverContent({ searchNode, optionsNode })) : (_jsxs(_Fragment, { children: [searchNode, optionsNode] })) })), renderTrigger: ({ setTriggerRef, togglePopover, isPopoverOpen, handleTriggerKeyDown, handleTriggerBlur }) => (_jsxs("div", { ref: setTriggerRef, ...triggerWrapperProps, className: cx(classes.triggerWrapper, 'mfui-SelectBox__triggerWrapper', triggerWrapperProps?.className), children: [_jsx(FocusIndicator, { children: _jsxs("button", { ref: triggerRef, id: id, type: "button", role: "combobox", disabled: disabled, "aria-label": triggerProps?.['aria-label'], "aria-controls": listBoxId, "aria-describedby": triggerProps?.['aria-describedby'], "aria-expanded": isPopoverOpen, "aria-haspopup": "listbox", "aria-invalid": invalid, "aria-required": required, className: cx(classes.trigger, 'mfui-SelectBox__trigger', triggerProps?.className), "data-placeholder": !!placeholder && !localSelectedOption, "data-selected": !!localSelectedOption, "data-mfui-has-clear-button": showClearButton, "data-mfui-caution": caution && !invalid ? true : undefined, onClick: togglePopover, onKeyDown: (event) => {
342
342
  handleTypeAhead(event.nativeEvent);
343
343
  handleTriggerKeyDown(event);
344
344
  }, onBlur: handleTriggerBlur, children: [_jsx("span", { "data-mfui-content": "select-box-trigger-display-value", children: renderTriggerLabel() }), _jsx(DropdownIcon, { "aria-hidden": "true", focusable: false }), _jsx("input", { ref: ref, type: "hidden", value: localSelectedOption?.value ?? '', name: name, disabled: disabled })] }) }), showClearButton ? (_jsx("div", { className: cx(classes.clearButtonWrapper, 'mfui-SelectBox__clearButtonWrapper'), children: _jsx(ClearButton, { size: size === 'small' ? 'small' : size === 'large' ? 'large' : 'default', "aria-label": clearButtonProps?.['aria-label'] ?? '値をクリアする', "data-mfui-content": "select-box-clear-button", onClick: (event) => {
@@ -157,9 +157,12 @@ export type SelectBoxProps<T extends AllowedValueTypes = string, AdditionalProps
157
157
  *
158
158
  * @property aria-label - The alternative text for the trigger element.
159
159
  *
160
+ * @property aria-describedby - The id of the element describing the trigger element,
161
+ * such as an adjacent `HelpMessage`.
162
+ *
160
163
  * @property className - The class name of the trigger element.
161
164
  */
162
- triggerProps?: Pick<ComponentPropsWithoutRef<'button'>, 'aria-label' | 'className'>;
165
+ triggerProps?: Pick<ComponentPropsWithoutRef<'button'>, 'aria-label' | 'aria-describedby' | 'className'>;
163
166
  /**
164
167
  * Whether you let user to clear the content or not.
165
168
  * This will add the Clear button if current SelectBox has value.
@@ -227,6 +230,33 @@ export type SelectBoxProps<T extends AllowedValueTypes = string, AdditionalProps
227
230
  * Whether the trigger is invalid.
228
231
  */
229
232
  invalid?: boolean;
233
+ /**
234
+ * Whether the trigger needs the user's attention while still being submittable.
235
+ * Use it when the selection is valid but is worth double-checking.
236
+ *
237
+ * Unlike `invalid`, this does not set `aria-invalid` — the state is advisory, not an error.
238
+ * It changes the border color only, so you must also render an adjacent
239
+ * `<HelpMessage messageType="caution">` describing the concern — color alone does not
240
+ * convey the state (WCAG 2.2 1.4.1).
241
+ *
242
+ * Associate that `HelpMessage` with the trigger via `triggerProps['aria-describedby']` so
243
+ * screen readers announce it on focus, and give it `role="status"` so it is also announced
244
+ * the moment it appears while focus is already on the trigger.
245
+ *
246
+ * ```tsx
247
+ * const cautionMessageId = useId();
248
+ *
249
+ * <SelectBox caution triggerProps={{ 'aria-describedby': cautionMessageId }} />
250
+ * <HelpMessage id={cautionMessageId} role="status" messageType="caution">
251
+ * 通常とは異なる勘定科目が選択されています。
252
+ * </HelpMessage>
253
+ * ```
254
+ *
255
+ * Ignored while `invalid` is `true`, because the error state takes precedence.
256
+ *
257
+ * @default false
258
+ */
259
+ caution?: boolean;
230
260
  /**
231
261
  * Whether the trigger is required.
232
262
  * When true, `aria-required="true"` is forwarded to the trigger so that
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  /**
3
3
  * The general-purpose TextBox component.
4
- * This component switches the variants of looks and behaviors depends on the props: size, invalid, disabled, enableClearButton.
4
+ * This component switches the variants of looks and behaviors depends on the props: size, invalid, caution, disabled, enableClearButton.
5
5
  *
6
6
  * Also extends the props of `<input>` element
7
7
  *
@@ -11,6 +11,7 @@ export declare const TextBox: React.ForwardRefExoticComponent<{
11
11
  enableClearButton?: boolean;
12
12
  onClear?: import("..").IconButtonProps['onClick'];
13
13
  invalid?: import("../../styled-system/recipes").TextBoxSlotRecipeVariant['invalid'];
14
+ caution?: import("../../styled-system/recipes").TextBoxSlotRecipeVariant['caution'];
14
15
  textBoxSize?: import("../../styled-system/recipes").TextBoxSlotRecipeVariant['size'];
15
16
  disabled?: import("../../styled-system/recipes").TextBoxSlotRecipeVariant['disabled'];
16
17
  wrapperProps?: React.ComponentPropsWithRef<'div'>;
@@ -11,13 +11,13 @@ import { useInputHasValue } from '../utilities/state/useInputHasValue';
11
11
  import { useIsTouchDevice } from '../utilities/dom/useIsTouchDevice';
12
12
  /**
13
13
  * The general-purpose TextBox component.
14
- * This component switches the variants of looks and behaviors depends on the props: size, invalid, disabled, enableClearButton.
14
+ * This component switches the variants of looks and behaviors depends on the props: size, invalid, caution, disabled, enableClearButton.
15
15
  *
16
16
  * Also extends the props of `<input>` element
17
17
  *
18
18
  * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input
19
19
  */
20
- export const TextBox = forwardRef(({ enableClearButton = false, onClear, invalid = false, textBoxSize = 'medium', disabled = false, wrapperProps = {}, prefixSlot, suffixSlot, clearButtonProps, touchDeviceReadOnly = false, ...inputProps }, ref) => {
20
+ export const TextBox = forwardRef(({ enableClearButton = false, onClear, invalid = false, caution = false, textBoxSize = 'medium', disabled = false, wrapperProps = {}, prefixSlot, suffixSlot, clearButtonProps, touchDeviceReadOnly = false, ...inputProps }, ref) => {
21
21
  const isTouchDevice = useIsTouchDevice();
22
22
  const shouldUseTouchDeviceMode = isTouchDevice && touchDeviceReadOnly;
23
23
  const inputRef = useRef(null);
@@ -28,7 +28,8 @@ export const TextBox = forwardRef(({ enableClearButton = false, onClear, invalid
28
28
  onInput: inputProps.onInput,
29
29
  });
30
30
  const shouldShowClearButton = enableClearButton && hasValue;
31
- const classes = textBoxSlotRecipe({ invalid, disabled, size: textBoxSize });
31
+ // The error state takes precedence over the caution state
32
+ const classes = textBoxSlotRecipe({ invalid, caution: caution && !invalid, disabled, size: textBoxSize });
32
33
  const mergedInputRef = mergeRefs(ref, inputRef);
33
34
  const onClickClear = useCallback((event) => {
34
35
  if (!inputRef.current)
@@ -26,6 +26,32 @@ export type TextBoxProps = {
26
26
  * @default false
27
27
  */
28
28
  invalid?: TextBoxSlotRecipeVariant['invalid'];
29
+ /**
30
+ * Whether the text box needs the user's attention while still being submittable.
31
+ * Use it when the value passes validation but is worth double-checking.
32
+ *
33
+ * This changes the border color only, so you must also render an adjacent
34
+ * `<HelpMessage messageType="caution">` describing the concern — color alone does not
35
+ * convey the state (WCAG 2.2 1.4.1).
36
+ *
37
+ * Associate that `HelpMessage` with the text box via `aria-describedby` so screen readers
38
+ * announce it on focus, and give it `role="status"` so it is also announced the moment it
39
+ * appears while focus is already inside the text box.
40
+ *
41
+ * ```tsx
42
+ * const cautionMessageId = useId();
43
+ *
44
+ * <TextBox caution aria-describedby={cautionMessageId} />
45
+ * <HelpMessage id={cautionMessageId} role="status" messageType="caution">
46
+ * 過去の平均を大きく上回る金額です。
47
+ * </HelpMessage>
48
+ * ```
49
+ *
50
+ * Ignored while `invalid` is `true`, because the error state takes precedence.
51
+ *
52
+ * @default false
53
+ */
54
+ caution?: TextBoxSlotRecipeVariant['caution'];
29
55
  /**
30
56
  * The size of the text box.
31
57
  *
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * The general-purpose Textarea component.
3
- * This component switches the variants of looks and behaviors depends on the props: size, invalid, disabled.
3
+ * This component switches the variants of looks and behaviors depends on the props: size, invalid, caution, disabled.
4
4
  *
5
5
  * Also extends the props of `<textarea>` element
6
6
  *
@@ -11,6 +11,7 @@
11
11
  */
12
12
  export declare const Textarea: import("react").ForwardRefExoticComponent<{
13
13
  invalid?: import("../../styled-system/recipes").TextBoxSlotRecipeVariant['invalid'];
14
+ caution?: import("../../styled-system/recipes").TextBoxSlotRecipeVariant['caution'];
14
15
  size?: import("../../styled-system/recipes").TextBoxSlotRecipeVariant['size'];
15
16
  disabled?: import("../../styled-system/recipes").TextBoxSlotRecipeVariant['disabled'];
16
17
  enableAutoResize?: boolean;
@@ -6,7 +6,7 @@ import { FocusIndicator } from '../FocusIndicator';
6
6
  import { mergeRefs } from '../utilities/dom/mergeRefs';
7
7
  /**
8
8
  * The general-purpose Textarea component.
9
- * This component switches the variants of looks and behaviors depends on the props: size, invalid, disabled.
9
+ * This component switches the variants of looks and behaviors depends on the props: size, invalid, caution, disabled.
10
10
  *
11
11
  * Also extends the props of `<textarea>` element
12
12
  *
@@ -15,11 +15,19 @@ import { mergeRefs } from '../utilities/dom/mergeRefs';
15
15
  *
16
16
  * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/textarea
17
17
  */
18
- export const Textarea = forwardRef(({ invalid = false, size = 'medium', disabled = false, rows = 1, enableAutoResize = false, resize = 'both', onChange, ...props }, ref) => {
18
+ export const Textarea = forwardRef(({ invalid = false, caution = false, size = 'medium', disabled = false, rows = 1, enableAutoResize = false, resize = 'both', onChange, ...props }, ref) => {
19
19
  const localRef = useRef(null);
20
20
  // When enableAutoResize is true, force resize to 'none' to prevent conflicts
21
21
  const effectiveResize = enableAutoResize ? 'none' : resize;
22
- const classes = textareaSlotRecipe({ size, disabled, invalid, enableAutoResize, resize: effectiveResize });
22
+ // The error state takes precedence over the caution state
23
+ const classes = textareaSlotRecipe({
24
+ size,
25
+ disabled,
26
+ invalid,
27
+ caution: caution && !invalid,
28
+ enableAutoResize,
29
+ resize: effectiveResize,
30
+ });
23
31
  const adjustHeight = useCallback(() => {
24
32
  if (!enableAutoResize || !localRef.current)
25
33
  return;
@@ -11,6 +11,32 @@ export type TextareaProps = {
11
11
  * @default false
12
12
  */
13
13
  invalid?: TextBoxSlotRecipeVariant['invalid'];
14
+ /**
15
+ * Whether the textarea needs the user's attention while still being submittable.
16
+ * Use it when the value passes validation but is worth double-checking.
17
+ *
18
+ * This changes the border color only, so you must also render an adjacent
19
+ * `<HelpMessage messageType="caution">` describing the concern — color alone does not
20
+ * convey the state (WCAG 2.2 1.4.1).
21
+ *
22
+ * Associate that `HelpMessage` with the textarea via `aria-describedby` so screen readers
23
+ * announce it on focus, and give it `role="status"` so it is also announced the moment it
24
+ * appears while focus is already inside the textarea.
25
+ *
26
+ * ```tsx
27
+ * const cautionMessageId = useId();
28
+ *
29
+ * <Textarea caution aria-describedby={cautionMessageId} />
30
+ * <HelpMessage id={cautionMessageId} role="status" messageType="caution">
31
+ * 送信先に社外メンバーが含まれています。内容をご確認ください。
32
+ * </HelpMessage>
33
+ * ```
34
+ *
35
+ * Ignored while `invalid` is `true`, because the error state takes precedence.
36
+ *
37
+ * @default false
38
+ */
39
+ caution?: TextBoxSlotRecipeVariant['caution'];
14
40
  /**
15
41
  * The size of the textarea.
16
42
  *
@@ -8,6 +8,7 @@ export * from './CheckboxGroup';
8
8
  export * from './DataGrid';
9
9
  export * from './DataTable';
10
10
  export * from './DateTimeSelection';
11
+ export * from './DeterminateProgressIndicator';
11
12
  export * from './Dialog';
12
13
  export * from './Disclosure';
13
14
  export * from './DisplayTable';
package/dist/src/index.js CHANGED
@@ -8,6 +8,7 @@ export * from './CheckboxGroup';
8
8
  export * from './DataGrid';
9
9
  export * from './DataTable';
10
10
  export * from './DateTimeSelection';
11
+ export * from './DeterminateProgressIndicator';
11
12
  export * from './Dialog';
12
13
  export * from './Disclosure';
13
14
  export * from './DisplayTable';
@@ -4,6 +4,7 @@ import type { DistributiveOmit, Pretty } from '../types/system-types';
4
4
 
5
5
  interface BaseRangePickerTriggerSlotRecipeVariant {
6
6
  invalid: boolean
7
+ caution: boolean
7
8
  disabled: boolean
8
9
  size: "small" | "medium" | "large"
9
10
  }
@@ -30,6 +30,7 @@ const baseRangePickerTriggerSlotRecipeFn = memo((props = {}) => {
30
30
  });
31
31
  const baseRangePickerTriggerSlotRecipeVariantKeys = [
32
32
  "invalid",
33
+ "caution",
33
34
  "disabled",
34
35
  "size"
35
36
  ];
@@ -45,6 +46,10 @@ export const baseRangePickerTriggerSlotRecipe = /* @__PURE__ */ Object.assign(ba
45
46
  "true",
46
47
  "false"
47
48
  ],
49
+ "caution": [
50
+ "true",
51
+ "false"
52
+ ],
48
53
  "disabled": [
49
54
  "true",
50
55
  "false"
@@ -0,0 +1,33 @@
1
+ /* eslint-disable */
2
+ import type { ConditionalValue } from '../types/index';
3
+ import type { DistributiveOmit, Pretty } from '../types/system-types';
4
+
5
+ interface DataTableFilterButtonSlotRecipeVariant {
6
+ filtered: boolean
7
+ }
8
+
9
+ type DataTableFilterButtonSlotRecipeVariantMap = {
10
+ [key in keyof DataTableFilterButtonSlotRecipeVariant]: Array<DataTableFilterButtonSlotRecipeVariant[key]>
11
+ }
12
+
13
+ type DataTableFilterButtonSlotRecipeSlot = "root" | "dialog" | "filteredDescription"
14
+
15
+ export type DataTableFilterButtonSlotRecipeVariantProps = {
16
+ [key in keyof DataTableFilterButtonSlotRecipeVariant]?: ConditionalValue<DataTableFilterButtonSlotRecipeVariant[key]> | undefined
17
+ }
18
+
19
+ export interface DataTableFilterButtonSlotRecipeRecipe {
20
+ __slot: DataTableFilterButtonSlotRecipeSlot
21
+ __type: DataTableFilterButtonSlotRecipeVariantProps
22
+ (props?: DataTableFilterButtonSlotRecipeVariantProps): Pretty<Record<DataTableFilterButtonSlotRecipeSlot, string>>
23
+ raw: (props?: DataTableFilterButtonSlotRecipeVariantProps) => DataTableFilterButtonSlotRecipeVariantProps
24
+ variantMap: DataTableFilterButtonSlotRecipeVariantMap
25
+ variantKeys: Array<keyof DataTableFilterButtonSlotRecipeVariant>
26
+ splitVariantProps<Props extends DataTableFilterButtonSlotRecipeVariantProps>(props: Props): [DataTableFilterButtonSlotRecipeVariantProps, Pretty<DistributiveOmit<Props, keyof DataTableFilterButtonSlotRecipeVariantProps>>]
27
+ getVariantProps: (props?: DataTableFilterButtonSlotRecipeVariantProps) => DataTableFilterButtonSlotRecipeVariantProps
28
+ }
29
+
30
+ /**
31
+ * Slot class created for the MFUI DataTable.FilterButton sub-component.
32
+ */
33
+ export declare const dataTableFilterButtonSlotRecipe: DataTableFilterButtonSlotRecipeRecipe
@@ -0,0 +1,43 @@
1
+ import { compact, getSlotCompoundVariant, memo, splitProps } from '../helpers.js';
2
+ import { createRecipe } from './create-recipe.js';
3
+ const dataTableFilterButtonSlotRecipeDefaultVariants = {};
4
+ const dataTableFilterButtonSlotRecipeCompoundVariants = [];
5
+ const dataTableFilterButtonSlotRecipeSlotNames = [
6
+ [
7
+ "root",
8
+ "DataTableFilterButton__root"
9
+ ],
10
+ [
11
+ "dialog",
12
+ "DataTableFilterButton__dialog"
13
+ ],
14
+ [
15
+ "filteredDescription",
16
+ "DataTableFilterButton__filteredDescription"
17
+ ]
18
+ ];
19
+ const dataTableFilterButtonSlotRecipeSlotFns = /* @__PURE__ */ dataTableFilterButtonSlotRecipeSlotNames.map(([slotName, slotKey]) => [slotName, createRecipe(slotKey, dataTableFilterButtonSlotRecipeDefaultVariants, getSlotCompoundVariant(dataTableFilterButtonSlotRecipeCompoundVariants, slotName))]);
20
+ const dataTableFilterButtonSlotRecipeFn = memo((props = {}) => {
21
+ return Object.fromEntries(dataTableFilterButtonSlotRecipeSlotFns.map(([slotName, slotFn]) => [slotName, slotFn.recipeFn(props)]));
22
+ });
23
+ const dataTableFilterButtonSlotRecipeVariantKeys = [
24
+ "filtered"
25
+ ];
26
+ const getVariantProps = (variants) => ({ ...dataTableFilterButtonSlotRecipeDefaultVariants, ...compact(variants) });
27
+ export const dataTableFilterButtonSlotRecipe = /* @__PURE__ */ Object.assign(dataTableFilterButtonSlotRecipeFn, {
28
+ __recipe__: false,
29
+ __name__: 'dataTableFilterButtonSlotRecipe',
30
+ raw: (props) => props,
31
+ classNameMap: {},
32
+ variantKeys: dataTableFilterButtonSlotRecipeVariantKeys,
33
+ variantMap: {
34
+ "filtered": [
35
+ "true",
36
+ "false"
37
+ ]
38
+ },
39
+ splitVariantProps(props) {
40
+ return splitProps(props, dataTableFilterButtonSlotRecipeVariantKeys);
41
+ },
42
+ getVariantProps
43
+ });
@@ -4,6 +4,7 @@ import type { DistributiveOmit, Pretty } from '../types/system-types';
4
4
 
5
5
  interface DataTableHeaderCellSlotRecipeVariant {
6
6
  size: "small" | "medium"
7
+ hasActions: boolean
7
8
  fixedColumn: boolean
8
9
  verticalBorder: boolean
9
10
  edgeFixedColumn: "left" | "right"
@@ -15,10 +16,10 @@ type DataTableHeaderCellSlotRecipeVariantMap = {
15
16
  [key in keyof DataTableHeaderCellSlotRecipeVariant]: Array<DataTableHeaderCellSlotRecipeVariant[key]>
16
17
  }
17
18
 
18
- type DataTableHeaderCellSlotRecipeSlot = "root" | "headerCell" | "sortButton" | "sortIconContainer" | "sortIcon" | "unsortedIcon"
19
+ type DataTableHeaderCellSlotRecipeSlot = "root" | "headerCell" | "sortButton" | "sortIconContainer" | "sortIcon" | "unsortedIcon" | "container" | "actionsContainer"
19
20
 
20
21
  export type DataTableHeaderCellSlotRecipeVariantProps = {
21
- [key in keyof DataTableHeaderCellSlotRecipeVariant]?: ConditionalValue<DataTableHeaderCellSlotRecipeVariant[key]> | undefined
22
+ [key in keyof DataTableHeaderCellSlotRecipeVariant]?: DataTableHeaderCellSlotRecipeVariant[key] | undefined
22
23
  }
23
24
 
24
25
  export interface DataTableHeaderCellSlotRecipeRecipe {