smarthr-ui 99.1.0 → 99.2.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/lib/components/Calendar/Calendar.cjs +7 -3
- package/lib/components/Calendar/Calendar.cjs.map +1 -1
- package/lib/components/Calendar/Calendar.js +8 -4
- package/lib/components/Calendar/Calendar.js.map +1 -1
- package/lib/components/Checkbox/Checkbox.cjs +7 -5
- package/lib/components/Checkbox/Checkbox.cjs.map +1 -1
- package/lib/components/Checkbox/Checkbox.js +8 -6
- package/lib/components/Checkbox/Checkbox.js.map +1 -1
- package/lib/components/Chip/Chip.cjs +3 -9
- package/lib/components/Chip/Chip.cjs.map +1 -1
- package/lib/components/Chip/Chip.d.ts +3 -22
- package/lib/components/Chip/Chip.js +3 -9
- package/lib/components/Chip/Chip.js.map +1 -1
- package/lib/components/Combobox/ItemButton.cjs +5 -39
- package/lib/components/Combobox/ItemButton.cjs.map +1 -1
- package/lib/components/Combobox/ItemButton.d.ts +3 -7
- package/lib/components/Combobox/ItemButton.js +6 -40
- package/lib/components/Combobox/ItemButton.js.map +1 -1
- package/lib/components/Combobox/MultiCombobox/MultiCombobox.cjs +237 -192
- package/lib/components/Combobox/MultiCombobox/MultiCombobox.cjs.map +1 -1
- package/lib/components/Combobox/MultiCombobox/MultiCombobox.d.ts +1 -1
- package/lib/components/Combobox/MultiCombobox/MultiCombobox.js +238 -193
- package/lib/components/Combobox/MultiCombobox/MultiCombobox.js.map +1 -1
- package/lib/components/Combobox/MultiCombobox/MultiSelectedItem.cjs +62 -51
- package/lib/components/Combobox/MultiCombobox/MultiSelectedItem.cjs.map +1 -1
- package/lib/components/Combobox/MultiCombobox/MultiSelectedItem.d.ts +2 -2
- package/lib/components/Combobox/MultiCombobox/MultiSelectedItem.js +63 -52
- package/lib/components/Combobox/MultiCombobox/MultiSelectedItem.js.map +1 -1
- package/lib/components/Combobox/SingleCombobox/SingleCombobox.cjs +144 -155
- package/lib/components/Combobox/SingleCombobox/SingleCombobox.cjs.map +1 -1
- package/lib/components/Combobox/SingleCombobox/SingleCombobox.js +145 -156
- package/lib/components/Combobox/SingleCombobox/SingleCombobox.js.map +1 -1
- package/lib/components/Combobox/useListbox.cjs +156 -124
- package/lib/components/Combobox/useListbox.cjs.map +1 -1
- package/lib/components/Combobox/useListbox.d.ts +1 -1
- package/lib/components/Combobox/useListbox.js +157 -125
- package/lib/components/Combobox/useListbox.js.map +1 -1
- package/lib/components/Dialog/ControlledActionDialog/ActionDialogContentInner.cjs.map +1 -1
- package/lib/components/Dialog/ControlledActionDialog/ActionDialogContentInner.d.ts +1 -1
- package/lib/components/Dialog/ControlledActionDialog/ActionDialogContentInner.js.map +1 -1
- package/lib/components/Dialog/ControlledFormDialog/FormDialogContentInner.cjs.map +1 -1
- package/lib/components/Dialog/ControlledFormDialog/FormDialogContentInner.d.ts +1 -1
- package/lib/components/Dialog/ControlledFormDialog/FormDialogContentInner.js.map +1 -1
- package/lib/components/Dialog/DialogContentInner.cjs +17 -9
- package/lib/components/Dialog/DialogContentInner.cjs.map +1 -1
- package/lib/components/Dialog/DialogContentInner.js +18 -10
- package/lib/components/Dialog/DialogContentInner.js.map +1 -1
- package/lib/components/Dialog/ModelessDialog/ModelessDialog.cjs +4 -4
- package/lib/components/Dialog/ModelessDialog/ModelessDialog.cjs.map +1 -1
- package/lib/components/Dialog/ModelessDialog/ModelessDialog.js +4 -4
- package/lib/components/Dialog/ModelessDialog/ModelessDialog.js.map +1 -1
- package/lib/components/Dialog/RemoteDialogTrigger/ActionDialog.cjs +2 -2
- package/lib/components/Dialog/RemoteDialogTrigger/ActionDialog.cjs.map +1 -1
- package/lib/components/Dialog/RemoteDialogTrigger/ActionDialog.d.ts +1 -1
- package/lib/components/Dialog/RemoteDialogTrigger/ActionDialog.js +1 -1
- package/lib/components/Dialog/RemoteDialogTrigger/ActionDialog.js.map +1 -1
- package/lib/components/Dialog/RemoteDialogTrigger/FormDialog.cjs +2 -2
- package/lib/components/Dialog/RemoteDialogTrigger/FormDialog.cjs.map +1 -1
- package/lib/components/Dialog/RemoteDialogTrigger/FormDialog.d.ts +1 -1
- package/lib/components/Dialog/RemoteDialogTrigger/FormDialog.js +1 -1
- package/lib/components/Dialog/RemoteDialogTrigger/FormDialog.js.map +1 -1
- package/lib/components/Dialog/RemoteDialogTrigger/MessageDialog.cjs +2 -2
- package/lib/components/Dialog/RemoteDialogTrigger/MessageDialog.cjs.map +1 -1
- package/lib/components/Dialog/RemoteDialogTrigger/MessageDialog.d.ts +1 -1
- package/lib/components/Dialog/RemoteDialogTrigger/MessageDialog.js +1 -1
- package/lib/components/Dialog/RemoteDialogTrigger/MessageDialog.js.map +1 -1
- package/lib/components/Dialog/RemoteDialogTrigger/RemoteDialogTrigger.cjs +2 -2
- package/lib/components/Dialog/RemoteDialogTrigger/RemoteDialogTrigger.cjs.map +1 -1
- package/lib/components/Dialog/RemoteDialogTrigger/RemoteDialogTrigger.js +1 -1
- package/lib/components/Dialog/RemoteDialogTrigger/RemoteDialogTrigger.js.map +1 -1
- package/lib/components/Dialog/RemoteDialogTrigger/StepFormDialog.cjs +2 -2
- package/lib/components/Dialog/RemoteDialogTrigger/StepFormDialog.cjs.map +1 -1
- package/lib/components/Dialog/RemoteDialogTrigger/StepFormDialog.d.ts +1 -1
- package/lib/components/Dialog/RemoteDialogTrigger/StepFormDialog.js +1 -1
- package/lib/components/Dialog/RemoteDialogTrigger/StepFormDialog.js.map +1 -1
- package/lib/components/Dialog/{useRemoteTrigger.cjs → RemoteDialogTrigger/useRemoteTrigger.cjs} +1 -1
- package/lib/components/Dialog/RemoteDialogTrigger/useRemoteTrigger.cjs.map +1 -0
- package/lib/components/Dialog/{useRemoteTrigger.js → RemoteDialogTrigger/useRemoteTrigger.js} +1 -1
- package/lib/components/Dialog/RemoteDialogTrigger/useRemoteTrigger.js.map +1 -0
- package/lib/components/DropZone/DropZone.cjs +4 -5
- package/lib/components/DropZone/DropZone.cjs.map +1 -1
- package/lib/components/DropZone/DropZone.js +4 -5
- package/lib/components/DropZone/DropZone.js.map +1 -1
- package/lib/components/Dropdown/Dropdown.cjs +60 -40
- package/lib/components/Dropdown/Dropdown.cjs.map +1 -1
- package/lib/components/Dropdown/Dropdown.d.ts +1 -1
- package/lib/components/Dropdown/Dropdown.js +62 -42
- package/lib/components/Dropdown/Dropdown.js.map +1 -1
- package/lib/components/Dropdown/DropdownContentInner.cjs +1 -1
- package/lib/components/Dropdown/DropdownContentInner.cjs.map +1 -1
- package/lib/components/Dropdown/DropdownContentInner.js +1 -1
- package/lib/components/Dropdown/DropdownContentInner.js.map +1 -1
- package/lib/components/Dropdown/DropdownTrigger.cjs +3 -3
- package/lib/components/Dropdown/DropdownTrigger.cjs.map +1 -1
- package/lib/components/Dropdown/DropdownTrigger.js +3 -3
- package/lib/components/Dropdown/DropdownTrigger.js.map +1 -1
- package/lib/components/Dropdown/FilterDropdown/FilterDropdown.cjs +15 -38
- package/lib/components/Dropdown/FilterDropdown/FilterDropdown.cjs.map +1 -1
- package/lib/components/Dropdown/FilterDropdown/FilterDropdown.js +15 -38
- package/lib/components/Dropdown/FilterDropdown/FilterDropdown.js.map +1 -1
- package/lib/components/Dropdown/SortDropdown/useSortDropdown.cjs +3 -7
- package/lib/components/Dropdown/SortDropdown/useSortDropdown.cjs.map +1 -1
- package/lib/components/Dropdown/SortDropdown/useSortDropdown.js +4 -8
- package/lib/components/Dropdown/SortDropdown/useSortDropdown.js.map +1 -1
- package/lib/components/FileViewer/FileViewer.cjs +3 -29
- package/lib/components/FileViewer/FileViewer.cjs.map +1 -1
- package/lib/components/FileViewer/FileViewer.js +4 -30
- package/lib/components/FileViewer/FileViewer.js.map +1 -1
- package/lib/components/FileViewer/SearchController.cjs +0 -1
- package/lib/components/FileViewer/SearchController.cjs.map +1 -1
- package/lib/components/FileViewer/SearchController.js +0 -1
- package/lib/components/FileViewer/SearchController.js.map +1 -1
- package/lib/components/Heading/Heading.cjs +5 -2
- package/lib/components/Heading/Heading.cjs.map +1 -1
- package/lib/components/Heading/Heading.d.ts +41 -2
- package/lib/components/Heading/Heading.js +6 -3
- package/lib/components/Heading/Heading.js.map +1 -1
- package/lib/components/Heading/PageHeading/PageHeading.cjs +9 -6
- package/lib/components/Heading/PageHeading/PageHeading.cjs.map +1 -1
- package/lib/components/Heading/PageHeading/PageHeading.d.ts +1 -1
- package/lib/components/Heading/PageHeading/PageHeading.js +10 -7
- package/lib/components/Heading/PageHeading/PageHeading.js.map +1 -1
- package/lib/components/InputFile/FilePreviewDialog.cjs +28 -5
- package/lib/components/InputFile/FilePreviewDialog.cjs.map +1 -1
- package/lib/components/InputFile/FilePreviewDialog.js +29 -6
- package/lib/components/InputFile/FilePreviewDialog.js.map +1 -1
- package/lib/components/InputFile/parts.cjs +4 -4
- package/lib/components/InputFile/parts.cjs.map +1 -1
- package/lib/components/InputFile/parts.js +4 -4
- package/lib/components/InputFile/parts.js.map +1 -1
- package/lib/components/Table/TableScroller.cjs +6 -20
- package/lib/components/Table/TableScroller.cjs.map +1 -1
- package/lib/components/Table/TableScroller.js +6 -20
- package/lib/components/Table/TableScroller.js.map +1 -1
- package/lib/components/Table/useTableHeadCellCount.cjs +4 -0
- package/lib/components/Table/useTableHeadCellCount.cjs.map +1 -1
- package/lib/components/Table/useTableHeadCellCount.js +4 -0
- package/lib/components/Table/useTableHeadCellCount.js.map +1 -1
- package/lib/components/Text/Text.cjs +3 -3
- package/lib/components/Text/Text.cjs.map +1 -1
- package/lib/components/Text/Text.d.ts +4 -2
- package/lib/components/Text/Text.js +4 -4
- package/lib/components/Text/Text.js.map +1 -1
- package/lib/components/TextLink/TextLink.cjs +9 -7
- package/lib/components/TextLink/TextLink.cjs.map +1 -1
- package/lib/components/TextLink/TextLink.js +9 -7
- package/lib/components/TextLink/TextLink.js.map +1 -1
- package/lib/components/Timeline/TimelineItem.cjs +3 -1
- package/lib/components/Timeline/TimelineItem.cjs.map +1 -1
- package/lib/components/Timeline/TimelineItem.js +3 -1
- package/lib/components/Timeline/TimelineItem.js.map +1 -1
- package/lib/components/Tooltip/Tooltip.cjs +58 -38
- package/lib/components/Tooltip/Tooltip.cjs.map +1 -1
- package/lib/components/Tooltip/Tooltip.js +59 -39
- package/lib/components/Tooltip/Tooltip.js.map +1 -1
- package/lib/components/VisuallyHiddenText/VisuallyHiddenText.cjs +3 -3
- package/lib/components/VisuallyHiddenText/VisuallyHiddenText.cjs.map +1 -1
- package/lib/components/VisuallyHiddenText/VisuallyHiddenText.d.ts +3 -2
- package/lib/components/VisuallyHiddenText/VisuallyHiddenText.js +4 -4
- package/lib/components/VisuallyHiddenText/VisuallyHiddenText.js.map +1 -1
- package/lib/hooks/usePortal.cjs +9 -5
- package/lib/hooks/usePortal.cjs.map +1 -1
- package/lib/hooks/usePortal.d.ts +3 -2
- package/lib/hooks/usePortal.js +9 -5
- package/lib/hooks/usePortal.js.map +1 -1
- package/lib/intl/locales/en_us.json.cjs +8 -5
- package/lib/intl/locales/en_us.json.cjs.map +1 -1
- package/lib/intl/locales/en_us.json.js +8 -5
- package/lib/intl/locales/en_us.json.js.map +1 -1
- package/lib/intl/locales/id_id.json.cjs +5 -2
- package/lib/intl/locales/id_id.json.cjs.map +1 -1
- package/lib/intl/locales/id_id.json.js +5 -2
- package/lib/intl/locales/id_id.json.js.map +1 -1
- package/lib/intl/locales/index.d.ts +25 -0
- package/lib/intl/locales/ja.cjs +1 -0
- package/lib/intl/locales/ja.cjs.map +1 -1
- package/lib/intl/locales/ja.d.ts +1 -0
- package/lib/intl/locales/ja.js +1 -0
- package/lib/intl/locales/ja.js.map +1 -1
- package/lib/intl/locales/ja.json.cjs +1 -0
- package/lib/intl/locales/ja.json.cjs.map +1 -1
- package/lib/intl/locales/ja.json.js +1 -0
- package/lib/intl/locales/ja.json.js.map +1 -1
- package/lib/intl/locales/ja_easy.json.cjs +8 -5
- package/lib/intl/locales/ja_easy.json.cjs.map +1 -1
- package/lib/intl/locales/ja_easy.json.js +8 -5
- package/lib/intl/locales/ja_easy.json.js.map +1 -1
- package/lib/intl/locales/ko_kr.json.cjs +8 -5
- package/lib/intl/locales/ko_kr.json.cjs.map +1 -1
- package/lib/intl/locales/ko_kr.json.js +8 -5
- package/lib/intl/locales/ko_kr.json.js.map +1 -1
- package/lib/intl/locales/pt_br.json.cjs +5 -2
- package/lib/intl/locales/pt_br.json.cjs.map +1 -1
- package/lib/intl/locales/pt_br.json.js +5 -2
- package/lib/intl/locales/pt_br.json.js.map +1 -1
- package/lib/intl/locales/vi_vn.json.cjs +8 -5
- package/lib/intl/locales/vi_vn.json.cjs.map +1 -1
- package/lib/intl/locales/vi_vn.json.js +8 -5
- package/lib/intl/locales/vi_vn.json.js.map +1 -1
- package/lib/intl/locales/zh_hans_cn.json.cjs +10 -7
- package/lib/intl/locales/zh_hans_cn.json.cjs.map +1 -1
- package/lib/intl/locales/zh_hans_cn.json.js +10 -7
- package/lib/intl/locales/zh_hans_cn.json.js.map +1 -1
- package/lib/intl/locales/zh_hant_tw.json.cjs +8 -5
- package/lib/intl/locales/zh_hant_tw.json.cjs.map +1 -1
- package/lib/intl/locales/zh_hant_tw.json.js +8 -5
- package/lib/intl/locales/zh_hant_tw.json.js.map +1 -1
- package/lib/libs/delegate.cjs +13 -0
- package/lib/libs/delegate.cjs.map +1 -0
- package/lib/libs/delegate.d.ts +3 -0
- package/lib/libs/delegate.js +11 -0
- package/lib/libs/delegate.js.map +1 -0
- package/lib/vendor/.pnpm/{react-draggable@4.7.0_react-dom@19.2.8_react@19.2.8__react@19.2.8/vendor/react-draggable/build/cjs/chunk-RXGSR3JC.cjs → react-draggable@4.7.1_react-dom@19.2.8_react@19.2.8__react@19.2.8/vendor/react-draggable/build/cjs/chunk-ACOTSM7X.cjs} +38 -22
- package/lib/vendor/.pnpm/react-draggable@4.7.1_react-dom@19.2.8_react@19.2.8__react@19.2.8/vendor/react-draggable/build/cjs/chunk-ACOTSM7X.cjs.map +1 -0
- package/lib/vendor/.pnpm/{react-draggable@4.7.0_react-dom@19.2.8_react@19.2.8__react@19.2.8/vendor/react-draggable/build/cjs/chunk-RXGSR3JC.js → react-draggable@4.7.1_react-dom@19.2.8_react@19.2.8__react@19.2.8/vendor/react-draggable/build/cjs/chunk-ACOTSM7X.js} +38 -22
- package/lib/vendor/.pnpm/react-draggable@4.7.1_react-dom@19.2.8_react@19.2.8__react@19.2.8/vendor/react-draggable/build/cjs/chunk-ACOTSM7X.js.map +1 -0
- package/lib/vendor/.pnpm/{react-draggable@4.7.0_react-dom@19.2.8_react@19.2.8__react@19.2.8 → react-draggable@4.7.1_react-dom@19.2.8_react@19.2.8__react@19.2.8}/vendor/react-draggable/build/cjs/cjs.cjs +3 -3
- package/lib/vendor/.pnpm/{react-draggable@4.7.0_react-dom@19.2.8_react@19.2.8__react@19.2.8 → react-draggable@4.7.1_react-dom@19.2.8_react@19.2.8__react@19.2.8}/vendor/react-draggable/build/cjs/cjs.cjs.map +1 -1
- package/lib/vendor/.pnpm/{react-draggable@4.7.0_react-dom@19.2.8_react@19.2.8__react@19.2.8 → react-draggable@4.7.1_react-dom@19.2.8_react@19.2.8__react@19.2.8}/vendor/react-draggable/build/cjs/cjs.js +2 -2
- package/lib/vendor/.pnpm/{react-draggable@4.7.0_react-dom@19.2.8_react@19.2.8__react@19.2.8 → react-draggable@4.7.1_react-dom@19.2.8_react@19.2.8__react@19.2.8}/vendor/react-draggable/build/cjs/cjs.js.map +1 -1
- package/metadata.json +1 -1
- package/package.json +4 -4
- package/smarthr-ui.css +105 -42
- package/lib/components/Combobox/useFocusControl.cjs +0 -60
- package/lib/components/Combobox/useFocusControl.cjs.map +0 -1
- package/lib/components/Combobox/useFocusControl.d.ts +0 -7
- package/lib/components/Combobox/useFocusControl.js +0 -58
- package/lib/components/Combobox/useFocusControl.js.map +0 -1
- package/lib/components/Dialog/useBodyScrollLock.cjs +0 -21
- package/lib/components/Dialog/useBodyScrollLock.cjs.map +0 -1
- package/lib/components/Dialog/useBodyScrollLock.d.ts +0 -1
- package/lib/components/Dialog/useBodyScrollLock.js +0 -19
- package/lib/components/Dialog/useBodyScrollLock.js.map +0 -1
- package/lib/components/Dialog/useRemoteTrigger.cjs.map +0 -1
- package/lib/components/Dialog/useRemoteTrigger.js.map +0 -1
- package/lib/vendor/.pnpm/react-draggable@4.7.0_react-dom@19.2.8_react@19.2.8__react@19.2.8/vendor/react-draggable/build/cjs/chunk-RXGSR3JC.cjs.map +0 -1
- package/lib/vendor/.pnpm/react-draggable@4.7.0_react-dom@19.2.8_react@19.2.8__react@19.2.8/vendor/react-draggable/build/cjs/chunk-RXGSR3JC.js.map +0 -1
- /package/lib/components/Dialog/{useRemoteTrigger.d.ts → RemoteDialogTrigger/useRemoteTrigger.d.ts} +0 -0
|
@@ -5,6 +5,7 @@ var jsxRuntime = require('react/jsx-runtime');
|
|
|
5
5
|
var dayjs_min = require('../../_virtual/dayjs.min.cjs');
|
|
6
6
|
var React = require('react');
|
|
7
7
|
var index = require('./../../vendor/.pnpm/tailwind-variants@0.3.1_tailwindcss@3.4.19_ts-node@10.9.2_@swc_core@1.15.46_@types_node@20.19.43_typescript@5.9.3__/vendor/tailwind-variants/dist/index.cjs');
|
|
8
|
+
var hooks_useLatest = require('../../hooks/useLatest.cjs');
|
|
8
9
|
require('../../intl/IntlProvider.cjs');
|
|
9
10
|
require('react-intl');
|
|
10
11
|
var intl_useDateFormat = require('../../intl/useDateFormat.cjs');
|
|
@@ -121,9 +122,12 @@ const Calendar = React.forwardRef(({ from = components_Calendar_calendarHelper.m
|
|
|
121
122
|
const YearMonthRender = React.memo(({ children, className }) => jsxRuntime.jsx("div", { className: className, children: children }));
|
|
122
123
|
const YearSelectButton = React.memo(({ handleClick, ...rest }) => (jsxRuntime.jsx(components_Button_Button.Button, { ...rest, onClick: handleClick, size: "S", children: jsxRuntime.jsx(components_Icon_FaIcon.FaCaretDownIcon, { alt: jsxRuntime.jsx(intl_Localizer.Localizer, { id: "smarthr-ui/Calendar/selectYear", defaultText: "\u5E74\u3092\u9078\u629E\u3059\u308B" }) }) })));
|
|
123
124
|
const MonthDirectionCluster = React.memo(({ isSelectingYear, directionMonth: { prev, next }, from, to, setCurrentMonth, className }) => {
|
|
124
|
-
const
|
|
125
|
-
const
|
|
126
|
-
|
|
125
|
+
const latest = hooks_useLatest.useLatest({ prev, next, setCurrentMonth });
|
|
126
|
+
const functions = React.useMemo(() => ({
|
|
127
|
+
handleClickMonthPrev: () => latest.setCurrentMonth(latest.prev),
|
|
128
|
+
handleClickMonthNext: () => latest.setCurrentMonth(latest.next),
|
|
129
|
+
}), [latest]);
|
|
130
|
+
return (jsxRuntime.jsxs(components_Layout_Cluster_Cluster.Cluster, { gap: 0.5, className: className, children: [jsxRuntime.jsx(components_Button_Button.Button, { disabled: isSelectingYear || prev.isBefore(from, 'month'), onClick: functions.handleClickMonthPrev, size: "S", className: "smarthr-ui-Calendar-monthButtonPrev", children: jsxRuntime.jsx(components_Icon_FaIcon.FaChevronLeftIcon, { alt: jsxRuntime.jsx(intl_Localizer.Localizer, { id: "smarthr-ui/Calendar/previousMonth", defaultText: "\u524D\u306E\u6708\u3078" }) }) }), jsxRuntime.jsx(components_Button_Button.Button, { disabled: isSelectingYear || next.isAfter(to, 'month'), onClick: functions.handleClickMonthNext, size: "S", className: "smarthr-ui-Calendar-monthButtonNext", children: jsxRuntime.jsx(components_Icon_FaIcon.FaChevronRightIcon, { alt: jsxRuntime.jsx(intl_Localizer.Localizer, { id: "smarthr-ui/Calendar/nextMonth", defaultText: "\u6B21\u306E\u6708\u3078" }) }) })] }));
|
|
127
131
|
});
|
|
128
132
|
|
|
129
133
|
exports.Calendar = Calendar;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Calendar.cjs","sources":["../../../src/components/Calendar/Calendar.tsx"],"sourcesContent":["'use client'\n\nimport dayjs from 'dayjs'\nimport {\n type ComponentProps,\n type MouseEvent,\n type PropsWithChildren,\n forwardRef,\n memo,\n
|
|
1
|
+
{"version":3,"file":"Calendar.cjs","sources":["../../../src/components/Calendar/Calendar.tsx"],"sourcesContent":["'use client'\n\nimport dayjs from 'dayjs'\nimport {\n type ComponentProps,\n type MouseEvent,\n type PropsWithChildren,\n forwardRef,\n memo,\n useEffect,\n useId,\n useMemo,\n useState,\n} from 'react'\nimport { tv } from 'tailwind-variants'\n\nimport { useLatest } from '../../hooks/useLatest'\nimport { Localizer, useDateFormat } from '../../intl'\nimport { Button } from '../Button'\nimport { FaCaretDownIcon, FaChevronLeftIcon, FaChevronRightIcon } from '../Icon'\nimport { Cluster } from '../Layout'\n\nimport { CalendarTable } from './CalendarTable'\nimport { YearPicker } from './YearPicker'\nimport { getFromDate, getMonthArray, getToDate, isBetween, minDate } from './calendarHelper'\n\ntype BaseProps = {\n /** 選択可能な開始日 */\n from?: Date\n /** 選択可能な終了日 */\n to?: Date\n /** トリガのセレクトイベントを処理するハンドラ */\n onSelectDate: (e: MouseEvent, date: Date) => void\n /** 選択された日付 */\n value?: Date\n}\ntype Props = BaseProps & Omit<ComponentProps<'div'>, keyof BaseProps>\n\ntype DayJsType = ReturnType<typeof dayjs>\n\nconst classNameGenerator = tv({\n slots: {\n container:\n 'smarthr-ui-Calendar shr-inline-block shr-overflow-hidden shr-rounded-m shr-bg-white shr-text-black shr-shadow-layer-3 forced-colors:shr-border-shorthand forced-colors:shr-shadow-none',\n header: 'smarthr-ui-Calendar-header shr-border-b-shorthand shr-flex shr-items-center shr-p-1',\n yearMonth: 'smarthr-ui-Calendar-yearMonth shr-me-0.5 shr-text-base shr-font-bold',\n monthButtons: 'smarthr-ui-Calendar-monthButtons shr-ms-auto shr-flex',\n tableLayout: 'shr-relative',\n yearSelectButton:\n 'smarthr-ui-Calendar-selectingYear [&[aria-expanded=\"true\"]_.smarthr-ui-Icon]:shr-rotate-180',\n },\n})\n\nexport const Calendar = forwardRef<HTMLDivElement, Props>(\n ({ from = minDate, to, onSelectDate, value, className, ...rest }, ref) => {\n const { formatDate, getWeekStartDay } = useDateFormat()\n\n const classNames = useMemo(() => {\n const { container, yearMonth, header, monthButtons, tableLayout, yearSelectButton } =\n classNameGenerator()\n\n return {\n container: container({ className }),\n header: header(),\n yearMonth: yearMonth(),\n monthButtons: monthButtons(),\n tableLayout: tableLayout(),\n yearSelectButton: yearSelectButton(),\n }\n }, [className])\n\n const formattedFrom = useMemo(() => {\n const date = getFromDate(from)\n const day = dayjs(date)\n\n return {\n day,\n date,\n year: day.year(),\n }\n }, [from])\n const formattedTo = useMemo(() => {\n const date = getToDate(to)\n const day = dayjs(date)\n\n return {\n day,\n date,\n year: day.year(),\n }\n }, [to])\n\n const isValidValue = useMemo(\n () => value && isBetween(value, formattedFrom.date, formattedTo.date),\n [value, formattedFrom.date, formattedTo.date],\n )\n\n const [currentMonth, setCurrentMonth] = useState(() => {\n if (isValidValue) {\n return dayjs(value)\n }\n\n const today = dayjs()\n\n return formattedTo.day.isBefore(today)\n ? formattedTo.day\n : formattedFrom.day.isAfter(today)\n ? formattedFrom.day\n : today\n })\n const [isSelectingYear, setIsSelectingYear] = useState(false)\n\n const yearPickerId = useId()\n\n useEffect(() => {\n if (isValidValue) {\n setCurrentMonth(dayjs(value))\n }\n }, [value, isValidValue])\n\n const calculatedCurrentMonth = useMemo(() => {\n const d = currentMonth.toDate()\n\n return {\n prev: currentMonth.subtract(1, 'month'),\n next: currentMonth.add(1, 'month'),\n day: currentMonth,\n months: getMonthArray(d, getWeekStartDay()),\n yearMonthText: formatDate({\n date: d,\n parts: ['year', 'month'],\n options: {\n disableSlashInJa: true,\n capitalizeFirstLetter: true,\n },\n }),\n selectedText: currentMonth.toString(),\n }\n }, [currentMonth, formatDate, getWeekStartDay])\n\n const functions = useMemo(\n () => ({\n handleSelectYear: (e: MouseEvent<HTMLButtonElement>) => {\n e.stopPropagation()\n\n const year = parseInt(e.currentTarget.value, 10)\n\n setCurrentMonth((prev) => prev.year(year))\n setIsSelectingYear(false)\n },\n handleClickSelectYear: (e: MouseEvent<HTMLButtonElement>) => {\n e.stopPropagation()\n setIsSelectingYear((current) => !current)\n },\n }),\n [],\n )\n\n return (\n <div {...rest} ref={ref} className={classNames.container}>\n <header className={classNames.header}>\n <YearMonthRender className={classNames.yearMonth}>\n {calculatedCurrentMonth.yearMonthText}\n </YearMonthRender>\n <YearSelectButton\n aria-expanded={isSelectingYear}\n aria-controls={yearPickerId}\n handleClick={functions.handleClickSelectYear}\n className={classNames.yearSelectButton}\n />\n <MonthDirectionCluster\n isSelectingYear={isSelectingYear}\n directionMonth={calculatedCurrentMonth}\n from={formattedFrom.day}\n to={formattedTo.day}\n setCurrentMonth={setCurrentMonth}\n className={classNames.monthButtons}\n />\n </header>\n <div className={classNames.tableLayout}>\n <YearPicker\n fromYear={formattedFrom.year}\n toYear={formattedTo.year}\n selectedYear={value?.getFullYear()}\n handleSelectYear={functions.handleSelectYear}\n isDisplayed={isSelectingYear}\n id={yearPickerId}\n />\n <CalendarTable\n current={calculatedCurrentMonth}\n from={formattedFrom.date}\n to={formattedTo.date}\n onSelectDate={onSelectDate}\n selectedDayText={isValidValue ? calculatedCurrentMonth.selectedText : ''}\n />\n </div>\n </div>\n )\n },\n)\n\nconst YearMonthRender = memo<PropsWithChildren<{ className: string }>>(\n ({ children, className }) => <div className={className}>{children}</div>,\n)\n\nconst YearSelectButton = memo<{\n 'aria-expanded': boolean\n 'aria-controls': string\n handleClick: (e: MouseEvent<HTMLButtonElement>) => void\n className: string\n}>(({ handleClick, ...rest }) => (\n <Button {...rest} onClick={handleClick} size=\"S\">\n <FaCaretDownIcon\n alt={<Localizer id=\"smarthr-ui/Calendar/selectYear\" defaultText=\"年を選択する\" />}\n />\n </Button>\n))\n\nconst MonthDirectionCluster = memo<{\n isSelectingYear: boolean\n directionMonth: {\n prev: DayJsType\n next: DayJsType\n }\n from: DayJsType\n to: DayJsType\n setCurrentMonth: (day: DayJsType) => void\n className: string\n}>(({ isSelectingYear, directionMonth: { prev, next }, from, to, setCurrentMonth, className }) => {\n const latest = useLatest({ prev, next, setCurrentMonth })\n\n const functions = useMemo(\n () => ({\n handleClickMonthPrev: () => latest.setCurrentMonth(latest.prev),\n handleClickMonthNext: () => latest.setCurrentMonth(latest.next),\n }),\n [latest],\n )\n\n return (\n <Cluster gap={0.5} className={className}>\n <Button\n disabled={isSelectingYear || prev.isBefore(from, 'month')}\n onClick={functions.handleClickMonthPrev}\n size=\"S\"\n className=\"smarthr-ui-Calendar-monthButtonPrev\"\n >\n <FaChevronLeftIcon\n alt={<Localizer id=\"smarthr-ui/Calendar/previousMonth\" defaultText=\"前の月へ\" />}\n />\n </Button>\n <Button\n disabled={isSelectingYear || next.isAfter(to, 'month')}\n onClick={functions.handleClickMonthNext}\n size=\"S\"\n className=\"smarthr-ui-Calendar-monthButtonNext\"\n >\n <FaChevronRightIcon\n alt={<Localizer id=\"smarthr-ui/Calendar/nextMonth\" defaultText=\"次の月へ\" />}\n />\n </Button>\n </Cluster>\n )\n})\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwCA;AACE;AACE;AAEA;AACA;AACA;AACA;AACA;AAED;AACF;AAEM;;AAIH;AACE;;AAIE;;;;;;;AAOJ;AAEA;AACE;AACA;;;;AAKE;;AAEJ;AACA;AACE;AACA;;;;AAKE;;AAEJ;AAEA;;;AAOI;;AAGF;AAEA;;;;;AAKF;;AAGA;;;AAII;;AAEJ;AAEA;AACE;;;;AAKE;AACA;;AAEE;AACA;AACA;AACE;AACA;AACD;;AAEH;;;AAIJ;AAEI;;AAGE;AAEA;;;AAGF;;;;;AAQJ;AAwCF;AAGF;AAIA;AAaA;AAWE;AAEA;;;AAIG;;AA4BL;;"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
3
|
import dayjs from '../../_virtual/dayjs.min.js';
|
|
4
|
-
import { forwardRef, useMemo, useState, useId, useEffect, memo
|
|
4
|
+
import { forwardRef, useMemo, useState, useId, useEffect, memo } from 'react';
|
|
5
5
|
import { tv as ce } from './../../vendor/.pnpm/tailwind-variants@0.3.1_tailwindcss@3.4.19_ts-node@10.9.2_@swc_core@1.15.46_@types_node@20.19.43_typescript@5.9.3__/vendor/tailwind-variants/dist/index.js';
|
|
6
|
+
import { useLatest } from '../../hooks/useLatest.js';
|
|
6
7
|
import '../../intl/IntlProvider.js';
|
|
7
8
|
import 'react-intl';
|
|
8
9
|
import { useDateFormat } from '../../intl/useDateFormat.js';
|
|
@@ -119,9 +120,12 @@ const Calendar = forwardRef(({ from = minDate, to, onSelectDate, value, classNam
|
|
|
119
120
|
const YearMonthRender = memo(({ children, className }) => jsx("div", { className: className, children: children }));
|
|
120
121
|
const YearSelectButton = memo(({ handleClick, ...rest }) => (jsx(Button, { ...rest, onClick: handleClick, size: "S", children: jsx(FaCaretDownIcon, { alt: jsx(Localizer, { id: "smarthr-ui/Calendar/selectYear", defaultText: "\u5E74\u3092\u9078\u629E\u3059\u308B" }) }) })));
|
|
121
122
|
const MonthDirectionCluster = memo(({ isSelectingYear, directionMonth: { prev, next }, from, to, setCurrentMonth, className }) => {
|
|
122
|
-
const
|
|
123
|
-
const
|
|
124
|
-
|
|
123
|
+
const latest = useLatest({ prev, next, setCurrentMonth });
|
|
124
|
+
const functions = useMemo(() => ({
|
|
125
|
+
handleClickMonthPrev: () => latest.setCurrentMonth(latest.prev),
|
|
126
|
+
handleClickMonthNext: () => latest.setCurrentMonth(latest.next),
|
|
127
|
+
}), [latest]);
|
|
128
|
+
return (jsxs(Cluster, { gap: 0.5, className: className, children: [jsx(Button, { disabled: isSelectingYear || prev.isBefore(from, 'month'), onClick: functions.handleClickMonthPrev, size: "S", className: "smarthr-ui-Calendar-monthButtonPrev", children: jsx(FaChevronLeftIcon, { alt: jsx(Localizer, { id: "smarthr-ui/Calendar/previousMonth", defaultText: "\u524D\u306E\u6708\u3078" }) }) }), jsx(Button, { disabled: isSelectingYear || next.isAfter(to, 'month'), onClick: functions.handleClickMonthNext, size: "S", className: "smarthr-ui-Calendar-monthButtonNext", children: jsx(FaChevronRightIcon, { alt: jsx(Localizer, { id: "smarthr-ui/Calendar/nextMonth", defaultText: "\u6B21\u306E\u6708\u3078" }) }) })] }));
|
|
125
129
|
});
|
|
126
130
|
|
|
127
131
|
export { Calendar };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Calendar.js","sources":["../../../src/components/Calendar/Calendar.tsx"],"sourcesContent":["'use client'\n\nimport dayjs from 'dayjs'\nimport {\n type ComponentProps,\n type MouseEvent,\n type PropsWithChildren,\n forwardRef,\n memo,\n
|
|
1
|
+
{"version":3,"file":"Calendar.js","sources":["../../../src/components/Calendar/Calendar.tsx"],"sourcesContent":["'use client'\n\nimport dayjs from 'dayjs'\nimport {\n type ComponentProps,\n type MouseEvent,\n type PropsWithChildren,\n forwardRef,\n memo,\n useEffect,\n useId,\n useMemo,\n useState,\n} from 'react'\nimport { tv } from 'tailwind-variants'\n\nimport { useLatest } from '../../hooks/useLatest'\nimport { Localizer, useDateFormat } from '../../intl'\nimport { Button } from '../Button'\nimport { FaCaretDownIcon, FaChevronLeftIcon, FaChevronRightIcon } from '../Icon'\nimport { Cluster } from '../Layout'\n\nimport { CalendarTable } from './CalendarTable'\nimport { YearPicker } from './YearPicker'\nimport { getFromDate, getMonthArray, getToDate, isBetween, minDate } from './calendarHelper'\n\ntype BaseProps = {\n /** 選択可能な開始日 */\n from?: Date\n /** 選択可能な終了日 */\n to?: Date\n /** トリガのセレクトイベントを処理するハンドラ */\n onSelectDate: (e: MouseEvent, date: Date) => void\n /** 選択された日付 */\n value?: Date\n}\ntype Props = BaseProps & Omit<ComponentProps<'div'>, keyof BaseProps>\n\ntype DayJsType = ReturnType<typeof dayjs>\n\nconst classNameGenerator = tv({\n slots: {\n container:\n 'smarthr-ui-Calendar shr-inline-block shr-overflow-hidden shr-rounded-m shr-bg-white shr-text-black shr-shadow-layer-3 forced-colors:shr-border-shorthand forced-colors:shr-shadow-none',\n header: 'smarthr-ui-Calendar-header shr-border-b-shorthand shr-flex shr-items-center shr-p-1',\n yearMonth: 'smarthr-ui-Calendar-yearMonth shr-me-0.5 shr-text-base shr-font-bold',\n monthButtons: 'smarthr-ui-Calendar-monthButtons shr-ms-auto shr-flex',\n tableLayout: 'shr-relative',\n yearSelectButton:\n 'smarthr-ui-Calendar-selectingYear [&[aria-expanded=\"true\"]_.smarthr-ui-Icon]:shr-rotate-180',\n },\n})\n\nexport const Calendar = forwardRef<HTMLDivElement, Props>(\n ({ from = minDate, to, onSelectDate, value, className, ...rest }, ref) => {\n const { formatDate, getWeekStartDay } = useDateFormat()\n\n const classNames = useMemo(() => {\n const { container, yearMonth, header, monthButtons, tableLayout, yearSelectButton } =\n classNameGenerator()\n\n return {\n container: container({ className }),\n header: header(),\n yearMonth: yearMonth(),\n monthButtons: monthButtons(),\n tableLayout: tableLayout(),\n yearSelectButton: yearSelectButton(),\n }\n }, [className])\n\n const formattedFrom = useMemo(() => {\n const date = getFromDate(from)\n const day = dayjs(date)\n\n return {\n day,\n date,\n year: day.year(),\n }\n }, [from])\n const formattedTo = useMemo(() => {\n const date = getToDate(to)\n const day = dayjs(date)\n\n return {\n day,\n date,\n year: day.year(),\n }\n }, [to])\n\n const isValidValue = useMemo(\n () => value && isBetween(value, formattedFrom.date, formattedTo.date),\n [value, formattedFrom.date, formattedTo.date],\n )\n\n const [currentMonth, setCurrentMonth] = useState(() => {\n if (isValidValue) {\n return dayjs(value)\n }\n\n const today = dayjs()\n\n return formattedTo.day.isBefore(today)\n ? formattedTo.day\n : formattedFrom.day.isAfter(today)\n ? formattedFrom.day\n : today\n })\n const [isSelectingYear, setIsSelectingYear] = useState(false)\n\n const yearPickerId = useId()\n\n useEffect(() => {\n if (isValidValue) {\n setCurrentMonth(dayjs(value))\n }\n }, [value, isValidValue])\n\n const calculatedCurrentMonth = useMemo(() => {\n const d = currentMonth.toDate()\n\n return {\n prev: currentMonth.subtract(1, 'month'),\n next: currentMonth.add(1, 'month'),\n day: currentMonth,\n months: getMonthArray(d, getWeekStartDay()),\n yearMonthText: formatDate({\n date: d,\n parts: ['year', 'month'],\n options: {\n disableSlashInJa: true,\n capitalizeFirstLetter: true,\n },\n }),\n selectedText: currentMonth.toString(),\n }\n }, [currentMonth, formatDate, getWeekStartDay])\n\n const functions = useMemo(\n () => ({\n handleSelectYear: (e: MouseEvent<HTMLButtonElement>) => {\n e.stopPropagation()\n\n const year = parseInt(e.currentTarget.value, 10)\n\n setCurrentMonth((prev) => prev.year(year))\n setIsSelectingYear(false)\n },\n handleClickSelectYear: (e: MouseEvent<HTMLButtonElement>) => {\n e.stopPropagation()\n setIsSelectingYear((current) => !current)\n },\n }),\n [],\n )\n\n return (\n <div {...rest} ref={ref} className={classNames.container}>\n <header className={classNames.header}>\n <YearMonthRender className={classNames.yearMonth}>\n {calculatedCurrentMonth.yearMonthText}\n </YearMonthRender>\n <YearSelectButton\n aria-expanded={isSelectingYear}\n aria-controls={yearPickerId}\n handleClick={functions.handleClickSelectYear}\n className={classNames.yearSelectButton}\n />\n <MonthDirectionCluster\n isSelectingYear={isSelectingYear}\n directionMonth={calculatedCurrentMonth}\n from={formattedFrom.day}\n to={formattedTo.day}\n setCurrentMonth={setCurrentMonth}\n className={classNames.monthButtons}\n />\n </header>\n <div className={classNames.tableLayout}>\n <YearPicker\n fromYear={formattedFrom.year}\n toYear={formattedTo.year}\n selectedYear={value?.getFullYear()}\n handleSelectYear={functions.handleSelectYear}\n isDisplayed={isSelectingYear}\n id={yearPickerId}\n />\n <CalendarTable\n current={calculatedCurrentMonth}\n from={formattedFrom.date}\n to={formattedTo.date}\n onSelectDate={onSelectDate}\n selectedDayText={isValidValue ? calculatedCurrentMonth.selectedText : ''}\n />\n </div>\n </div>\n )\n },\n)\n\nconst YearMonthRender = memo<PropsWithChildren<{ className: string }>>(\n ({ children, className }) => <div className={className}>{children}</div>,\n)\n\nconst YearSelectButton = memo<{\n 'aria-expanded': boolean\n 'aria-controls': string\n handleClick: (e: MouseEvent<HTMLButtonElement>) => void\n className: string\n}>(({ handleClick, ...rest }) => (\n <Button {...rest} onClick={handleClick} size=\"S\">\n <FaCaretDownIcon\n alt={<Localizer id=\"smarthr-ui/Calendar/selectYear\" defaultText=\"年を選択する\" />}\n />\n </Button>\n))\n\nconst MonthDirectionCluster = memo<{\n isSelectingYear: boolean\n directionMonth: {\n prev: DayJsType\n next: DayJsType\n }\n from: DayJsType\n to: DayJsType\n setCurrentMonth: (day: DayJsType) => void\n className: string\n}>(({ isSelectingYear, directionMonth: { prev, next }, from, to, setCurrentMonth, className }) => {\n const latest = useLatest({ prev, next, setCurrentMonth })\n\n const functions = useMemo(\n () => ({\n handleClickMonthPrev: () => latest.setCurrentMonth(latest.prev),\n handleClickMonthNext: () => latest.setCurrentMonth(latest.next),\n }),\n [latest],\n )\n\n return (\n <Cluster gap={0.5} className={className}>\n <Button\n disabled={isSelectingYear || prev.isBefore(from, 'month')}\n onClick={functions.handleClickMonthPrev}\n size=\"S\"\n className=\"smarthr-ui-Calendar-monthButtonPrev\"\n >\n <FaChevronLeftIcon\n alt={<Localizer id=\"smarthr-ui/Calendar/previousMonth\" defaultText=\"前の月へ\" />}\n />\n </Button>\n <Button\n disabled={isSelectingYear || next.isAfter(to, 'month')}\n onClick={functions.handleClickMonthNext}\n size=\"S\"\n className=\"smarthr-ui-Calendar-monthButtonNext\"\n >\n <FaChevronRightIcon\n alt={<Localizer id=\"smarthr-ui/Calendar/nextMonth\" defaultText=\"次の月へ\" />}\n />\n </Button>\n </Cluster>\n )\n})\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAwCA;AACE;AACE;AAEA;AACA;AACA;AACA;AACA;AAED;AACF;AAEM;;AAIH;AACE;;AAIE;;;;;;;AAOJ;AAEA;AACE;AACA;;;;AAKE;;AAEJ;AACA;AACE;AACA;;;;AAKE;;AAEJ;AAEA;;;AAOI;;AAGF;AAEA;;;;;AAKF;;AAGA;;;AAII;;AAEJ;AAEA;AACE;;;;AAKE;AACA;;AAEE;AACA;AACA;AACE;AACA;AACD;;AAEH;;;AAIJ;AAEI;;AAGE;AAEA;;;AAGF;;;;;AAQJ;AAwCF;AAGF;AAIA;AAaA;AAWE;AAEA;;;AAIG;;AA4BL;;"}
|
|
@@ -59,19 +59,21 @@ const Checkbox = React.forwardRef(({ checked, mixed, error, className, children,
|
|
|
59
59
|
};
|
|
60
60
|
}, [className]);
|
|
61
61
|
const inputRef = React.useRef(null);
|
|
62
|
+
const defaultId = React.useId();
|
|
63
|
+
const checkBoxId = id || defaultId;
|
|
62
64
|
React.useImperativeHandle(ref, () => inputRef.current);
|
|
63
65
|
React.useEffect(() => {
|
|
64
66
|
if (inputRef.current) {
|
|
65
67
|
inputRef.current.indeterminate = !!(checked && mixed);
|
|
66
68
|
}
|
|
67
69
|
}, [checked, mixed]);
|
|
68
|
-
|
|
69
|
-
const checkBoxId = id || defaultId;
|
|
70
|
-
return (jsxRuntime.jsxs("span", { "data-disabled": disabled, className: classNames.wrapper, children: [jsxRuntime.jsxs("span", { className: classNames.innerWrapper, children: [jsxRuntime.jsx("input", { ...rest, ref: inputRef, type: "checkbox", id: checkBoxId, checked: checked, disabled: disabled, "aria-invalid": error || undefined, className: classNames.input, "data-smarthr-ui-input": "true" }), jsxRuntime.jsx(AriaHiddenBox, { className: classNames.box }), jsxRuntime.jsx(CheckIconArea, { mixed: mixed, className: classNames.iconWrap, iconClassName: classNames.icon })] }), jsxRuntime.jsx(LabeledChildren, { htmlFor: checkBoxId, className: classNames.label, children: children })] }));
|
|
70
|
+
return (jsxRuntime.jsxs("span", { "data-disabled": disabled, className: classNames.wrapper, children: [jsxRuntime.jsxs("span", { className: classNames.innerWrapper, children: [jsxRuntime.jsx("input", { ...rest, ref: inputRef, type: "checkbox", id: checkBoxId, checked: checked, disabled: disabled, "aria-invalid": error || undefined, className: classNames.input, "data-smarthr-ui-input": "true" }), jsxRuntime.jsx(AriaHiddenBox, { className: classNames.box }), jsxRuntime.jsx(CheckIconArea, { mixed: mixed, classNames: classNames })] }), children && (jsxRuntime.jsx("label", { htmlFor: checkBoxId, className: classNames.label, children: children }))] }));
|
|
71
71
|
});
|
|
72
72
|
const AriaHiddenBox = React.memo(({ className }) => (jsxRuntime.jsx("span", { className: className, "aria-hidden": "true" })));
|
|
73
|
-
const CheckIconArea = React.memo(({ mixed,
|
|
74
|
-
const
|
|
73
|
+
const CheckIconArea = React.memo(({ mixed, classNames }) => {
|
|
74
|
+
const Icon = mixed ? components_Icon_FaIcon.FaMinusIcon : components_Icon_FaIcon.FaCheckIcon;
|
|
75
|
+
return (jsxRuntime.jsx("span", { className: classNames.iconWrap, children: jsxRuntime.jsx(Icon, { className: classNames.icon }) }));
|
|
76
|
+
});
|
|
75
77
|
|
|
76
78
|
exports.Checkbox = Checkbox;
|
|
77
79
|
//# sourceMappingURL=Checkbox.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Checkbox.cjs","sources":["../../../src/components/Checkbox/Checkbox.tsx"],"sourcesContent":["'use client'\n\nimport {\n type ComponentPropsWithRef,\n type PropsWithChildren,\n forwardRef,\n memo,\n useEffect,\n useId,\n useImperativeHandle,\n useMemo,\n useRef,\n} from 'react'\nimport { tv } from 'tailwind-variants'\n\nimport { FaCheckIcon, FaMinusIcon } from '../Icon'\n\nexport type Props = PropsWithChildren<\n ComponentPropsWithRef<'input'> & {\n /** `true` のとき、チェック状態を `mixed` にする */\n mixed?: boolean\n /** チェックボックスにエラーがあるかどうか */\n error?: boolean\n }\n>\n\nconst classNameGenerator = tv({\n slots: {\n wrapper: 'smarthr-ui-Checkbox shr-inline-flex shr-items-baseline',\n box: [\n 'shr-border-shorthand shr-pointer-events-none shr-absolute shr-box-border shr-h-full shr-w-full shr-rounded-s shr-bg-white',\n 'contrast-more:shr-border-high-contrast',\n /* 強制カラーモードのときは、ブラウザ標準のUIを表示する */\n 'forced-colors:shr-hidden',\n 'peer-checked:shr-border-main peer-checked:shr-bg-main contrast-more:peer-checked:shr-border-high-contrast',\n 'peer-indeterminate:shr-border-main peer-indeterminate:shr-bg-main contrast-more:peer-indeterminate:shr-border-high-contrast',\n 'peer-disabled:shr-border-disabled peer-disabled:shr-bg-white-darken',\n 'peer-disabled:peer-checked:shr-border-default peer-disabled:peer-checked:shr-bg-border',\n 'peer-disabled:peer-indeterminate:shr-border-default peer-disabled:peer-indeterminate:shr-bg-border',\n 'peer-focus-visible:shr-focus-indicator--outer',\n 'peer-hover:shr-shadow-input-hover',\n 'shr-border-default',\n 'peer-[[aria-invalid]]:shr-border-danger',\n ],\n input: [\n 'smarthr-ui-Checkbox-checkbox shr-peer shr-absolute shr-left-0 shr-top-0 shr-m-0 shr-h-full shr-w-full shr-cursor-pointer shr-opacity-0 disabled:shr-pointer-events-none',\n /* 強制カラーモードのときは、ブラウザ標準のUIを表示する */\n 'forced-colors:shr-static forced-colors:shr-opacity-100',\n ],\n icon: 'shr-fill-current',\n iconWrap: [\n 'shr-pointer-events-none shr-absolute shr-left-1/2 shr-top-1/2 shr-inline-block shr-h-[theme(fontSize.2xs)] shr-w-[theme(fontSize.2xs)] -shr-translate-x-1/2 -shr-translate-y-1/2 shr-text-2xs',\n 'shr-text-transparent peer-checked:shr-text-white peer-indeterminate:shr-text-white',\n 'peer-disabled:peer-checked:shr-text-white-darken peer-disabled:peer-indeterminate:shr-text-white-darken',\n 'forced-colors:shr-hidden',\n ],\n innerWrapper:\n 'shr-relative shr-box-border shr-inline-block shr-h-[theme(fontSize.base)] shr-w-[theme(fontSize.base)] shr-shrink-0 shr-translate-y-[0.125em] shr-leading-none',\n label: [\n 'smarthr-ui-Checkbox-label shr-ms-0.5 shr-cursor-pointer shr-text-base shr-leading-tight',\n '[[data-disabled=true]>&]:shr-pointer-events-none [[data-disabled=true]>&]:shr-cursor-not-allowed [[data-disabled=true]>&]:shr-text-disabled',\n ],\n },\n})\n\nexport const Checkbox = forwardRef<HTMLInputElement, Props>(\n ({ checked, mixed, error, className, children, disabled, id, ...rest }, ref) => {\n const classNames = useMemo(() => {\n const { wrapper, innerWrapper, box, input, iconWrap, icon, label } = classNameGenerator()\n\n return {\n wrapper: wrapper({ className }),\n innerWrapper: innerWrapper(),\n box: box(),\n input: input(),\n iconWrap: iconWrap(),\n icon: icon(),\n label: label(),\n }\n }, [className])\n\n const inputRef = useRef<HTMLInputElement>(null)\n\n useImperativeHandle<HTMLInputElement | null, HTMLInputElement | null>(\n ref,\n () => inputRef.current,\n )\n\n useEffect(() => {\n if (inputRef.current) {\n inputRef.current.indeterminate = !!(checked && mixed)\n }\n }, [checked, mixed])\n\n
|
|
1
|
+
{"version":3,"file":"Checkbox.cjs","sources":["../../../src/components/Checkbox/Checkbox.tsx"],"sourcesContent":["'use client'\n\nimport {\n type ComponentPropsWithRef,\n type PropsWithChildren,\n forwardRef,\n memo,\n useEffect,\n useId,\n useImperativeHandle,\n useMemo,\n useRef,\n} from 'react'\nimport { tv } from 'tailwind-variants'\n\nimport { FaCheckIcon, FaMinusIcon } from '../Icon'\n\nexport type Props = PropsWithChildren<\n ComponentPropsWithRef<'input'> & {\n /** `true` のとき、チェック状態を `mixed` にする */\n mixed?: boolean\n /** チェックボックスにエラーがあるかどうか */\n error?: boolean\n }\n>\n\nconst classNameGenerator = tv({\n slots: {\n wrapper: 'smarthr-ui-Checkbox shr-inline-flex shr-items-baseline',\n box: [\n 'shr-border-shorthand shr-pointer-events-none shr-absolute shr-box-border shr-h-full shr-w-full shr-rounded-s shr-bg-white',\n 'contrast-more:shr-border-high-contrast',\n /* 強制カラーモードのときは、ブラウザ標準のUIを表示する */\n 'forced-colors:shr-hidden',\n 'peer-checked:shr-border-main peer-checked:shr-bg-main contrast-more:peer-checked:shr-border-high-contrast',\n 'peer-indeterminate:shr-border-main peer-indeterminate:shr-bg-main contrast-more:peer-indeterminate:shr-border-high-contrast',\n 'peer-disabled:shr-border-disabled peer-disabled:shr-bg-white-darken',\n 'peer-disabled:peer-checked:shr-border-default peer-disabled:peer-checked:shr-bg-border',\n 'peer-disabled:peer-indeterminate:shr-border-default peer-disabled:peer-indeterminate:shr-bg-border',\n 'peer-focus-visible:shr-focus-indicator--outer',\n 'peer-hover:shr-shadow-input-hover',\n 'shr-border-default',\n 'peer-[[aria-invalid]]:shr-border-danger',\n ],\n input: [\n 'smarthr-ui-Checkbox-checkbox shr-peer shr-absolute shr-left-0 shr-top-0 shr-m-0 shr-h-full shr-w-full shr-cursor-pointer shr-opacity-0 disabled:shr-pointer-events-none',\n /* 強制カラーモードのときは、ブラウザ標準のUIを表示する */\n 'forced-colors:shr-static forced-colors:shr-opacity-100',\n ],\n icon: 'shr-fill-current',\n iconWrap: [\n 'shr-pointer-events-none shr-absolute shr-left-1/2 shr-top-1/2 shr-inline-block shr-h-[theme(fontSize.2xs)] shr-w-[theme(fontSize.2xs)] -shr-translate-x-1/2 -shr-translate-y-1/2 shr-text-2xs',\n 'shr-text-transparent peer-checked:shr-text-white peer-indeterminate:shr-text-white',\n 'peer-disabled:peer-checked:shr-text-white-darken peer-disabled:peer-indeterminate:shr-text-white-darken',\n 'forced-colors:shr-hidden',\n ],\n innerWrapper:\n 'shr-relative shr-box-border shr-inline-block shr-h-[theme(fontSize.base)] shr-w-[theme(fontSize.base)] shr-shrink-0 shr-translate-y-[0.125em] shr-leading-none',\n label: [\n 'smarthr-ui-Checkbox-label shr-ms-0.5 shr-cursor-pointer shr-text-base shr-leading-tight',\n '[[data-disabled=true]>&]:shr-pointer-events-none [[data-disabled=true]>&]:shr-cursor-not-allowed [[data-disabled=true]>&]:shr-text-disabled',\n ],\n },\n})\n\nexport const Checkbox = forwardRef<HTMLInputElement, Props>(\n ({ checked, mixed, error, className, children, disabled, id, ...rest }, ref) => {\n const classNames = useMemo(() => {\n const { wrapper, innerWrapper, box, input, iconWrap, icon, label } = classNameGenerator()\n\n return {\n wrapper: wrapper({ className }),\n innerWrapper: innerWrapper(),\n box: box(),\n input: input(),\n iconWrap: iconWrap(),\n icon: icon(),\n label: label(),\n }\n }, [className])\n\n const inputRef = useRef<HTMLInputElement>(null)\n\n const defaultId = useId()\n const checkBoxId = id || defaultId\n\n useImperativeHandle<HTMLInputElement | null, HTMLInputElement | null>(\n ref,\n () => inputRef.current,\n )\n\n useEffect(() => {\n if (inputRef.current) {\n inputRef.current.indeterminate = !!(checked && mixed)\n }\n }, [checked, mixed])\n\n return (\n <span data-disabled={disabled} className={classNames.wrapper}>\n <span className={classNames.innerWrapper}>\n <input\n {...rest}\n ref={inputRef}\n type=\"checkbox\"\n id={checkBoxId}\n checked={checked}\n disabled={disabled}\n aria-invalid={error || undefined}\n className={classNames.input}\n data-smarthr-ui-input=\"true\"\n />\n <AriaHiddenBox className={classNames.box} />\n <CheckIconArea mixed={mixed} classNames={classNames} />\n </span>\n\n {children && (\n <label htmlFor={checkBoxId} className={classNames.label}>\n {children}\n </label>\n )}\n </span>\n )\n },\n)\n\nconst AriaHiddenBox = memo<{ className: string }>(({ className }) => (\n <span className={className} aria-hidden=\"true\" />\n))\n\nconst CheckIconArea = memo<\n Pick<Props, 'mixed'> & { classNames: { iconWrap: string; icon: string } }\n>(({ mixed, classNames }) => {\n const Icon = mixed ? FaMinusIcon : FaCheckIcon\n\n return (\n <span className={classNames.iconWrap}>\n <Icon className={classNames.icon} />\n </span>\n )\n})\n"],"names":[],"mappings":";;;;;;;;;;AA0BA;AACE;AACE;AACA;;;;;;;;;;;;;;AAcC;AACD;;;;AAIC;AACD;AACA;;;;;AAKC;AACD;AAEA;;;AAGC;AACF;AACF;AAEM;AAEH;AACE;;AAGE;;;;;;;;AAQJ;AAEA;AAEA;AACA;;;AAQE;AACE;;AAEJ;;AA2BF;AAGF;AAIA;;AAKE;AAKF;;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
|
-
import { forwardRef, useMemo, useRef, useImperativeHandle, useEffect,
|
|
3
|
+
import { forwardRef, useMemo, useRef, useId, useImperativeHandle, useEffect, memo } from 'react';
|
|
4
4
|
import { tv as ce } from './../../vendor/.pnpm/tailwind-variants@0.3.1_tailwindcss@3.4.19_ts-node@10.9.2_@swc_core@1.15.46_@types_node@20.19.43_typescript@5.9.3__/vendor/tailwind-variants/dist/index.js';
|
|
5
5
|
import { FaMinusIcon, FaCheckIcon } from '../Icon/FaIcon.js';
|
|
6
6
|
import '../Icon/generateIcon.js';
|
|
@@ -57,19 +57,21 @@ const Checkbox = forwardRef(({ checked, mixed, error, className, children, disab
|
|
|
57
57
|
};
|
|
58
58
|
}, [className]);
|
|
59
59
|
const inputRef = useRef(null);
|
|
60
|
+
const defaultId = useId();
|
|
61
|
+
const checkBoxId = id || defaultId;
|
|
60
62
|
useImperativeHandle(ref, () => inputRef.current);
|
|
61
63
|
useEffect(() => {
|
|
62
64
|
if (inputRef.current) {
|
|
63
65
|
inputRef.current.indeterminate = !!(checked && mixed);
|
|
64
66
|
}
|
|
65
67
|
}, [checked, mixed]);
|
|
66
|
-
|
|
67
|
-
const checkBoxId = id || defaultId;
|
|
68
|
-
return (jsxs("span", { "data-disabled": disabled, className: classNames.wrapper, children: [jsxs("span", { className: classNames.innerWrapper, children: [jsx("input", { ...rest, ref: inputRef, type: "checkbox", id: checkBoxId, checked: checked, disabled: disabled, "aria-invalid": error || undefined, className: classNames.input, "data-smarthr-ui-input": "true" }), jsx(AriaHiddenBox, { className: classNames.box }), jsx(CheckIconArea, { mixed: mixed, className: classNames.iconWrap, iconClassName: classNames.icon })] }), jsx(LabeledChildren, { htmlFor: checkBoxId, className: classNames.label, children: children })] }));
|
|
68
|
+
return (jsxs("span", { "data-disabled": disabled, className: classNames.wrapper, children: [jsxs("span", { className: classNames.innerWrapper, children: [jsx("input", { ...rest, ref: inputRef, type: "checkbox", id: checkBoxId, checked: checked, disabled: disabled, "aria-invalid": error || undefined, className: classNames.input, "data-smarthr-ui-input": "true" }), jsx(AriaHiddenBox, { className: classNames.box }), jsx(CheckIconArea, { mixed: mixed, classNames: classNames })] }), children && (jsx("label", { htmlFor: checkBoxId, className: classNames.label, children: children }))] }));
|
|
69
69
|
});
|
|
70
70
|
const AriaHiddenBox = memo(({ className }) => (jsx("span", { className: className, "aria-hidden": "true" })));
|
|
71
|
-
const CheckIconArea = memo(({ mixed,
|
|
72
|
-
const
|
|
71
|
+
const CheckIconArea = memo(({ mixed, classNames }) => {
|
|
72
|
+
const Icon = mixed ? FaMinusIcon : FaCheckIcon;
|
|
73
|
+
return (jsx("span", { className: classNames.iconWrap, children: jsx(Icon, { className: classNames.icon }) }));
|
|
74
|
+
});
|
|
73
75
|
|
|
74
76
|
export { Checkbox };
|
|
75
77
|
//# sourceMappingURL=Checkbox.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Checkbox.js","sources":["../../../src/components/Checkbox/Checkbox.tsx"],"sourcesContent":["'use client'\n\nimport {\n type ComponentPropsWithRef,\n type PropsWithChildren,\n forwardRef,\n memo,\n useEffect,\n useId,\n useImperativeHandle,\n useMemo,\n useRef,\n} from 'react'\nimport { tv } from 'tailwind-variants'\n\nimport { FaCheckIcon, FaMinusIcon } from '../Icon'\n\nexport type Props = PropsWithChildren<\n ComponentPropsWithRef<'input'> & {\n /** `true` のとき、チェック状態を `mixed` にする */\n mixed?: boolean\n /** チェックボックスにエラーがあるかどうか */\n error?: boolean\n }\n>\n\nconst classNameGenerator = tv({\n slots: {\n wrapper: 'smarthr-ui-Checkbox shr-inline-flex shr-items-baseline',\n box: [\n 'shr-border-shorthand shr-pointer-events-none shr-absolute shr-box-border shr-h-full shr-w-full shr-rounded-s shr-bg-white',\n 'contrast-more:shr-border-high-contrast',\n /* 強制カラーモードのときは、ブラウザ標準のUIを表示する */\n 'forced-colors:shr-hidden',\n 'peer-checked:shr-border-main peer-checked:shr-bg-main contrast-more:peer-checked:shr-border-high-contrast',\n 'peer-indeterminate:shr-border-main peer-indeterminate:shr-bg-main contrast-more:peer-indeterminate:shr-border-high-contrast',\n 'peer-disabled:shr-border-disabled peer-disabled:shr-bg-white-darken',\n 'peer-disabled:peer-checked:shr-border-default peer-disabled:peer-checked:shr-bg-border',\n 'peer-disabled:peer-indeterminate:shr-border-default peer-disabled:peer-indeterminate:shr-bg-border',\n 'peer-focus-visible:shr-focus-indicator--outer',\n 'peer-hover:shr-shadow-input-hover',\n 'shr-border-default',\n 'peer-[[aria-invalid]]:shr-border-danger',\n ],\n input: [\n 'smarthr-ui-Checkbox-checkbox shr-peer shr-absolute shr-left-0 shr-top-0 shr-m-0 shr-h-full shr-w-full shr-cursor-pointer shr-opacity-0 disabled:shr-pointer-events-none',\n /* 強制カラーモードのときは、ブラウザ標準のUIを表示する */\n 'forced-colors:shr-static forced-colors:shr-opacity-100',\n ],\n icon: 'shr-fill-current',\n iconWrap: [\n 'shr-pointer-events-none shr-absolute shr-left-1/2 shr-top-1/2 shr-inline-block shr-h-[theme(fontSize.2xs)] shr-w-[theme(fontSize.2xs)] -shr-translate-x-1/2 -shr-translate-y-1/2 shr-text-2xs',\n 'shr-text-transparent peer-checked:shr-text-white peer-indeterminate:shr-text-white',\n 'peer-disabled:peer-checked:shr-text-white-darken peer-disabled:peer-indeterminate:shr-text-white-darken',\n 'forced-colors:shr-hidden',\n ],\n innerWrapper:\n 'shr-relative shr-box-border shr-inline-block shr-h-[theme(fontSize.base)] shr-w-[theme(fontSize.base)] shr-shrink-0 shr-translate-y-[0.125em] shr-leading-none',\n label: [\n 'smarthr-ui-Checkbox-label shr-ms-0.5 shr-cursor-pointer shr-text-base shr-leading-tight',\n '[[data-disabled=true]>&]:shr-pointer-events-none [[data-disabled=true]>&]:shr-cursor-not-allowed [[data-disabled=true]>&]:shr-text-disabled',\n ],\n },\n})\n\nexport const Checkbox = forwardRef<HTMLInputElement, Props>(\n ({ checked, mixed, error, className, children, disabled, id, ...rest }, ref) => {\n const classNames = useMemo(() => {\n const { wrapper, innerWrapper, box, input, iconWrap, icon, label } = classNameGenerator()\n\n return {\n wrapper: wrapper({ className }),\n innerWrapper: innerWrapper(),\n box: box(),\n input: input(),\n iconWrap: iconWrap(),\n icon: icon(),\n label: label(),\n }\n }, [className])\n\n const inputRef = useRef<HTMLInputElement>(null)\n\n useImperativeHandle<HTMLInputElement | null, HTMLInputElement | null>(\n ref,\n () => inputRef.current,\n )\n\n useEffect(() => {\n if (inputRef.current) {\n inputRef.current.indeterminate = !!(checked && mixed)\n }\n }, [checked, mixed])\n\n
|
|
1
|
+
{"version":3,"file":"Checkbox.js","sources":["../../../src/components/Checkbox/Checkbox.tsx"],"sourcesContent":["'use client'\n\nimport {\n type ComponentPropsWithRef,\n type PropsWithChildren,\n forwardRef,\n memo,\n useEffect,\n useId,\n useImperativeHandle,\n useMemo,\n useRef,\n} from 'react'\nimport { tv } from 'tailwind-variants'\n\nimport { FaCheckIcon, FaMinusIcon } from '../Icon'\n\nexport type Props = PropsWithChildren<\n ComponentPropsWithRef<'input'> & {\n /** `true` のとき、チェック状態を `mixed` にする */\n mixed?: boolean\n /** チェックボックスにエラーがあるかどうか */\n error?: boolean\n }\n>\n\nconst classNameGenerator = tv({\n slots: {\n wrapper: 'smarthr-ui-Checkbox shr-inline-flex shr-items-baseline',\n box: [\n 'shr-border-shorthand shr-pointer-events-none shr-absolute shr-box-border shr-h-full shr-w-full shr-rounded-s shr-bg-white',\n 'contrast-more:shr-border-high-contrast',\n /* 強制カラーモードのときは、ブラウザ標準のUIを表示する */\n 'forced-colors:shr-hidden',\n 'peer-checked:shr-border-main peer-checked:shr-bg-main contrast-more:peer-checked:shr-border-high-contrast',\n 'peer-indeterminate:shr-border-main peer-indeterminate:shr-bg-main contrast-more:peer-indeterminate:shr-border-high-contrast',\n 'peer-disabled:shr-border-disabled peer-disabled:shr-bg-white-darken',\n 'peer-disabled:peer-checked:shr-border-default peer-disabled:peer-checked:shr-bg-border',\n 'peer-disabled:peer-indeterminate:shr-border-default peer-disabled:peer-indeterminate:shr-bg-border',\n 'peer-focus-visible:shr-focus-indicator--outer',\n 'peer-hover:shr-shadow-input-hover',\n 'shr-border-default',\n 'peer-[[aria-invalid]]:shr-border-danger',\n ],\n input: [\n 'smarthr-ui-Checkbox-checkbox shr-peer shr-absolute shr-left-0 shr-top-0 shr-m-0 shr-h-full shr-w-full shr-cursor-pointer shr-opacity-0 disabled:shr-pointer-events-none',\n /* 強制カラーモードのときは、ブラウザ標準のUIを表示する */\n 'forced-colors:shr-static forced-colors:shr-opacity-100',\n ],\n icon: 'shr-fill-current',\n iconWrap: [\n 'shr-pointer-events-none shr-absolute shr-left-1/2 shr-top-1/2 shr-inline-block shr-h-[theme(fontSize.2xs)] shr-w-[theme(fontSize.2xs)] -shr-translate-x-1/2 -shr-translate-y-1/2 shr-text-2xs',\n 'shr-text-transparent peer-checked:shr-text-white peer-indeterminate:shr-text-white',\n 'peer-disabled:peer-checked:shr-text-white-darken peer-disabled:peer-indeterminate:shr-text-white-darken',\n 'forced-colors:shr-hidden',\n ],\n innerWrapper:\n 'shr-relative shr-box-border shr-inline-block shr-h-[theme(fontSize.base)] shr-w-[theme(fontSize.base)] shr-shrink-0 shr-translate-y-[0.125em] shr-leading-none',\n label: [\n 'smarthr-ui-Checkbox-label shr-ms-0.5 shr-cursor-pointer shr-text-base shr-leading-tight',\n '[[data-disabled=true]>&]:shr-pointer-events-none [[data-disabled=true]>&]:shr-cursor-not-allowed [[data-disabled=true]>&]:shr-text-disabled',\n ],\n },\n})\n\nexport const Checkbox = forwardRef<HTMLInputElement, Props>(\n ({ checked, mixed, error, className, children, disabled, id, ...rest }, ref) => {\n const classNames = useMemo(() => {\n const { wrapper, innerWrapper, box, input, iconWrap, icon, label } = classNameGenerator()\n\n return {\n wrapper: wrapper({ className }),\n innerWrapper: innerWrapper(),\n box: box(),\n input: input(),\n iconWrap: iconWrap(),\n icon: icon(),\n label: label(),\n }\n }, [className])\n\n const inputRef = useRef<HTMLInputElement>(null)\n\n const defaultId = useId()\n const checkBoxId = id || defaultId\n\n useImperativeHandle<HTMLInputElement | null, HTMLInputElement | null>(\n ref,\n () => inputRef.current,\n )\n\n useEffect(() => {\n if (inputRef.current) {\n inputRef.current.indeterminate = !!(checked && mixed)\n }\n }, [checked, mixed])\n\n return (\n <span data-disabled={disabled} className={classNames.wrapper}>\n <span className={classNames.innerWrapper}>\n <input\n {...rest}\n ref={inputRef}\n type=\"checkbox\"\n id={checkBoxId}\n checked={checked}\n disabled={disabled}\n aria-invalid={error || undefined}\n className={classNames.input}\n data-smarthr-ui-input=\"true\"\n />\n <AriaHiddenBox className={classNames.box} />\n <CheckIconArea mixed={mixed} classNames={classNames} />\n </span>\n\n {children && (\n <label htmlFor={checkBoxId} className={classNames.label}>\n {children}\n </label>\n )}\n </span>\n )\n },\n)\n\nconst AriaHiddenBox = memo<{ className: string }>(({ className }) => (\n <span className={className} aria-hidden=\"true\" />\n))\n\nconst CheckIconArea = memo<\n Pick<Props, 'mixed'> & { classNames: { iconWrap: string; icon: string } }\n>(({ mixed, classNames }) => {\n const Icon = mixed ? FaMinusIcon : FaCheckIcon\n\n return (\n <span className={classNames.iconWrap}>\n <Icon className={classNames.icon} />\n </span>\n )\n})\n"],"names":[],"mappings":";;;;;;;;AA0BA;AACE;AACE;AACA;;;;;;;;;;;;;;AAcC;AACD;;;;AAIC;AACD;AACA;;;;;AAKC;AACD;AAEA;;;AAGC;AACF;AACF;AAEM;AAEH;AACE;;AAGE;;;;;;;;AAQJ;AAEA;AAEA;AACA;;;AAQE;AACE;;AAEJ;;AA2BF;AAGF;AAIA;;AAKE;AAKF;;"}
|
|
@@ -9,6 +9,7 @@ const classNameGenerator = index.tv({
|
|
|
9
9
|
'smarthr-ui-Chip',
|
|
10
10
|
'shr-border-shorthand shr-rounded-full shr-bg-white shr-leading-none shr-text-black',
|
|
11
11
|
'contrast-more:shr-border-high-contrast',
|
|
12
|
+
'data-[disabled]:shr-bg-white/50 data-[disabled]:shr-text-disabled',
|
|
12
13
|
],
|
|
13
14
|
variants: {
|
|
14
15
|
color: {
|
|
@@ -21,18 +22,11 @@ const classNameGenerator = index.tv({
|
|
|
21
22
|
size: {
|
|
22
23
|
S: 'shr-px-0.5 shr-py-0.25 shr-text-sm',
|
|
23
24
|
},
|
|
24
|
-
disabled: {
|
|
25
|
-
true: 'shr-bg-white/50 shr-text-disabled',
|
|
26
|
-
},
|
|
27
|
-
},
|
|
28
|
-
defaultVariants: {
|
|
29
|
-
size: 'S',
|
|
30
|
-
color: 'grey',
|
|
31
25
|
},
|
|
32
26
|
});
|
|
33
27
|
const Chip = ({ size, color, disabled, className, ...rest }) => {
|
|
34
|
-
const actualClassName = React.useMemo(() => classNameGenerator({ size, color
|
|
35
|
-
return jsxRuntime.jsx("span", { ...rest, className: actualClassName });
|
|
28
|
+
const actualClassName = React.useMemo(() => classNameGenerator({ size: size || 'S', color: color || 'grey', className }), [size, color, className]);
|
|
29
|
+
return jsxRuntime.jsx("span", { ...rest, "data-disabled": disabled || undefined, className: actualClassName });
|
|
36
30
|
};
|
|
37
31
|
|
|
38
32
|
exports.Chip = Chip;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Chip.cjs","sources":["../../../src/components/Chip/Chip.tsx"],"sourcesContent":["import { type ComponentPropsWithoutRef, type FC, type PropsWithChildren, useMemo } from 'react'\nimport { type VariantProps, tv } from 'tailwind-variants'\n\ntype Props = PropsWithChildren<\n VariantProps<typeof classNameGenerator>
|
|
1
|
+
{"version":3,"file":"Chip.cjs","sources":["../../../src/components/Chip/Chip.tsx"],"sourcesContent":["import { type ComponentPropsWithoutRef, type FC, type PropsWithChildren, useMemo } from 'react'\nimport { type VariantProps, tv } from 'tailwind-variants'\n\ntype Props = PropsWithChildren<\n VariantProps<typeof classNameGenerator> &\n ComponentPropsWithoutRef<'span'> & { disabled?: boolean }\n>\n\nconst classNameGenerator = tv({\n base: [\n 'smarthr-ui-Chip',\n 'shr-border-shorthand shr-rounded-full shr-bg-white shr-leading-none shr-text-black',\n 'contrast-more:shr-border-high-contrast',\n 'data-[disabled]:shr-bg-white/50 data-[disabled]:shr-text-disabled',\n ],\n variants: {\n color: {\n grey: 'shr-border-grey-20',\n blue: 'shr-border-main',\n green: 'shr-border-green',\n orange: 'shr-border-orange',\n red: 'shr-border-danger',\n },\n size: {\n S: 'shr-px-0.5 shr-py-0.25 shr-text-sm',\n },\n },\n})\n\nexport const Chip: FC<Props> = ({ size, color, disabled, className, ...rest }) => {\n const actualClassName = useMemo(\n () => classNameGenerator({ size: size || 'S', color: color || 'grey', className }),\n [size, color, className],\n )\n\n return <span {...rest} data-disabled={disabled || undefined} className={actualClassName} />\n}\n"],"names":["tv","useMemo","_jsx"],"mappings":";;;;;;AAQA,MAAM,kBAAkB,GAAGA,QAAE,CAAC;AAC5B,IAAA,IAAI,EAAE;QACJ,iBAAiB;QACjB,oFAAoF;QACpF,wCAAwC;QACxC,mEAAmE;AACpE,KAAA;AACD,IAAA,QAAQ,EAAE;AACR,QAAA,KAAK,EAAE;AACL,YAAA,IAAI,EAAE,oBAAoB;AAC1B,YAAA,IAAI,EAAE,iBAAiB;AACvB,YAAA,KAAK,EAAE,kBAAkB;AACzB,YAAA,MAAM,EAAE,mBAAmB;AAC3B,YAAA,GAAG,EAAE,mBAAmB;AACzB,SAAA;AACD,QAAA,IAAI,EAAE;AACJ,YAAA,CAAC,EAAE,oCAAoC;AACxC,SAAA;AACF,KAAA;AACF,CAAA,CAAC;AAEK,MAAM,IAAI,GAAc,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,IAAI,EAAE,KAAI;AAC/E,IAAA,MAAM,eAAe,GAAGC,aAAO,CAC7B,MAAM,kBAAkB,CAAC,EAAE,IAAI,EAAE,IAAI,IAAI,GAAG,EAAE,KAAK,EAAE,KAAK,IAAI,MAAM,EAAE,SAAS,EAAE,CAAC,EAClF,CAAC,IAAI,EAAE,KAAK,EAAE,SAAS,CAAC,CACzB;IAED,OAAOC,cAAA,CAAA,MAAA,EAAA,EAAA,GAAU,IAAI,EAAA,eAAA,EAAiB,QAAQ,IAAI,SAAS,EAAE,SAAS,EAAE,eAAe,EAAA,CAAI;AAC7F;;;;"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { type ComponentPropsWithoutRef, type FC, type PropsWithChildren } from 'react';
|
|
2
2
|
import { type VariantProps } from 'tailwind-variants';
|
|
3
|
-
type Props = PropsWithChildren<VariantProps<typeof classNameGenerator> & ComponentPropsWithoutRef<'span'
|
|
3
|
+
type Props = PropsWithChildren<VariantProps<typeof classNameGenerator> & ComponentPropsWithoutRef<'span'> & {
|
|
4
|
+
disabled?: boolean;
|
|
5
|
+
}>;
|
|
4
6
|
declare const classNameGenerator: import("tailwind-variants").TVReturnType<{
|
|
5
7
|
color: {
|
|
6
8
|
grey: string;
|
|
@@ -12,9 +14,6 @@ declare const classNameGenerator: import("tailwind-variants").TVReturnType<{
|
|
|
12
14
|
size: {
|
|
13
15
|
S: string;
|
|
14
16
|
};
|
|
15
|
-
disabled: {
|
|
16
|
-
true: string;
|
|
17
|
-
};
|
|
18
17
|
}, undefined, string[], import("tailwind-variants/dist/config").TVConfig<{
|
|
19
18
|
color: {
|
|
20
19
|
grey: string;
|
|
@@ -26,9 +25,6 @@ declare const classNameGenerator: import("tailwind-variants").TVReturnType<{
|
|
|
26
25
|
size: {
|
|
27
26
|
S: string;
|
|
28
27
|
};
|
|
29
|
-
disabled: {
|
|
30
|
-
true: string;
|
|
31
|
-
};
|
|
32
28
|
}, {
|
|
33
29
|
color: {
|
|
34
30
|
grey: string;
|
|
@@ -40,9 +36,6 @@ declare const classNameGenerator: import("tailwind-variants").TVReturnType<{
|
|
|
40
36
|
size: {
|
|
41
37
|
S: string;
|
|
42
38
|
};
|
|
43
|
-
disabled: {
|
|
44
|
-
true: string;
|
|
45
|
-
};
|
|
46
39
|
}>, {
|
|
47
40
|
color: {
|
|
48
41
|
grey: string;
|
|
@@ -54,9 +47,6 @@ declare const classNameGenerator: import("tailwind-variants").TVReturnType<{
|
|
|
54
47
|
size: {
|
|
55
48
|
S: string;
|
|
56
49
|
};
|
|
57
|
-
disabled: {
|
|
58
|
-
true: string;
|
|
59
|
-
};
|
|
60
50
|
}, undefined, import("tailwind-variants").TVReturnType<{
|
|
61
51
|
color: {
|
|
62
52
|
grey: string;
|
|
@@ -68,9 +58,6 @@ declare const classNameGenerator: import("tailwind-variants").TVReturnType<{
|
|
|
68
58
|
size: {
|
|
69
59
|
S: string;
|
|
70
60
|
};
|
|
71
|
-
disabled: {
|
|
72
|
-
true: string;
|
|
73
|
-
};
|
|
74
61
|
}, undefined, string[], import("tailwind-variants/dist/config").TVConfig<{
|
|
75
62
|
color: {
|
|
76
63
|
grey: string;
|
|
@@ -82,9 +69,6 @@ declare const classNameGenerator: import("tailwind-variants").TVReturnType<{
|
|
|
82
69
|
size: {
|
|
83
70
|
S: string;
|
|
84
71
|
};
|
|
85
|
-
disabled: {
|
|
86
|
-
true: string;
|
|
87
|
-
};
|
|
88
72
|
}, {
|
|
89
73
|
color: {
|
|
90
74
|
grey: string;
|
|
@@ -96,9 +80,6 @@ declare const classNameGenerator: import("tailwind-variants").TVReturnType<{
|
|
|
96
80
|
size: {
|
|
97
81
|
S: string;
|
|
98
82
|
};
|
|
99
|
-
disabled: {
|
|
100
|
-
true: string;
|
|
101
|
-
};
|
|
102
83
|
}>, unknown, unknown, undefined>>;
|
|
103
84
|
export declare const Chip: FC<Props>;
|
|
104
85
|
export {};
|
|
@@ -7,6 +7,7 @@ const classNameGenerator = ce({
|
|
|
7
7
|
'smarthr-ui-Chip',
|
|
8
8
|
'shr-border-shorthand shr-rounded-full shr-bg-white shr-leading-none shr-text-black',
|
|
9
9
|
'contrast-more:shr-border-high-contrast',
|
|
10
|
+
'data-[disabled]:shr-bg-white/50 data-[disabled]:shr-text-disabled',
|
|
10
11
|
],
|
|
11
12
|
variants: {
|
|
12
13
|
color: {
|
|
@@ -19,18 +20,11 @@ const classNameGenerator = ce({
|
|
|
19
20
|
size: {
|
|
20
21
|
S: 'shr-px-0.5 shr-py-0.25 shr-text-sm',
|
|
21
22
|
},
|
|
22
|
-
disabled: {
|
|
23
|
-
true: 'shr-bg-white/50 shr-text-disabled',
|
|
24
|
-
},
|
|
25
|
-
},
|
|
26
|
-
defaultVariants: {
|
|
27
|
-
size: 'S',
|
|
28
|
-
color: 'grey',
|
|
29
23
|
},
|
|
30
24
|
});
|
|
31
25
|
const Chip = ({ size, color, disabled, className, ...rest }) => {
|
|
32
|
-
const actualClassName = useMemo(() => classNameGenerator({ size, color
|
|
33
|
-
return jsx("span", { ...rest, className: actualClassName });
|
|
26
|
+
const actualClassName = useMemo(() => classNameGenerator({ size: size || 'S', color: color || 'grey', className }), [size, color, className]);
|
|
27
|
+
return jsx("span", { ...rest, "data-disabled": disabled || undefined, className: actualClassName });
|
|
34
28
|
};
|
|
35
29
|
|
|
36
30
|
export { Chip };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Chip.js","sources":["../../../src/components/Chip/Chip.tsx"],"sourcesContent":["import { type ComponentPropsWithoutRef, type FC, type PropsWithChildren, useMemo } from 'react'\nimport { type VariantProps, tv } from 'tailwind-variants'\n\ntype Props = PropsWithChildren<\n VariantProps<typeof classNameGenerator>
|
|
1
|
+
{"version":3,"file":"Chip.js","sources":["../../../src/components/Chip/Chip.tsx"],"sourcesContent":["import { type ComponentPropsWithoutRef, type FC, type PropsWithChildren, useMemo } from 'react'\nimport { type VariantProps, tv } from 'tailwind-variants'\n\ntype Props = PropsWithChildren<\n VariantProps<typeof classNameGenerator> &\n ComponentPropsWithoutRef<'span'> & { disabled?: boolean }\n>\n\nconst classNameGenerator = tv({\n base: [\n 'smarthr-ui-Chip',\n 'shr-border-shorthand shr-rounded-full shr-bg-white shr-leading-none shr-text-black',\n 'contrast-more:shr-border-high-contrast',\n 'data-[disabled]:shr-bg-white/50 data-[disabled]:shr-text-disabled',\n ],\n variants: {\n color: {\n grey: 'shr-border-grey-20',\n blue: 'shr-border-main',\n green: 'shr-border-green',\n orange: 'shr-border-orange',\n red: 'shr-border-danger',\n },\n size: {\n S: 'shr-px-0.5 shr-py-0.25 shr-text-sm',\n },\n },\n})\n\nexport const Chip: FC<Props> = ({ size, color, disabled, className, ...rest }) => {\n const actualClassName = useMemo(\n () => classNameGenerator({ size: size || 'S', color: color || 'grey', className }),\n [size, color, className],\n )\n\n return <span {...rest} data-disabled={disabled || undefined} className={actualClassName} />\n}\n"],"names":["tv","_jsx"],"mappings":";;;;AAQA,MAAM,kBAAkB,GAAGA,EAAE,CAAC;AAC5B,IAAA,IAAI,EAAE;QACJ,iBAAiB;QACjB,oFAAoF;QACpF,wCAAwC;QACxC,mEAAmE;AACpE,KAAA;AACD,IAAA,QAAQ,EAAE;AACR,QAAA,KAAK,EAAE;AACL,YAAA,IAAI,EAAE,oBAAoB;AAC1B,YAAA,IAAI,EAAE,iBAAiB;AACvB,YAAA,KAAK,EAAE,kBAAkB;AACzB,YAAA,MAAM,EAAE,mBAAmB;AAC3B,YAAA,GAAG,EAAE,mBAAmB;AACzB,SAAA;AACD,QAAA,IAAI,EAAE;AACJ,YAAA,CAAC,EAAE,oCAAoC;AACxC,SAAA;AACF,KAAA;AACF,CAAA,CAAC;AAEK,MAAM,IAAI,GAAc,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,IAAI,EAAE,KAAI;AAC/E,IAAA,MAAM,eAAe,GAAG,OAAO,CAC7B,MAAM,kBAAkB,CAAC,EAAE,IAAI,EAAE,IAAI,IAAI,GAAG,EAAE,KAAK,EAAE,KAAK,IAAI,MAAM,EAAE,SAAS,EAAE,CAAC,EAClF,CAAC,IAAI,EAAE,KAAK,EAAE,SAAS,CAAC,CACzB;IAED,OAAOC,GAAA,CAAA,MAAA,EAAA,EAAA,GAAU,IAAI,EAAA,eAAA,EAAiB,QAAQ,IAAI,SAAS,EAAE,SAAS,EAAE,eAAe,EAAA,CAAI;AAC7F;;;;"}
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
var jsxRuntime = require('react/jsx-runtime');
|
|
4
4
|
var React = require('react');
|
|
5
5
|
var index = require('./../../vendor/.pnpm/tailwind-variants@0.3.1_tailwindcss@3.4.19_ts-node@10.9.2_@swc_core@1.15.46_@types_node@20.19.43_typescript@5.9.3__/vendor/tailwind-variants/dist/index.cjs');
|
|
6
|
-
var hooks_useLatest = require('../../hooks/useLatest.cjs');
|
|
7
6
|
require('../../intl/IntlProvider.cjs');
|
|
8
7
|
require('react-intl');
|
|
9
8
|
var intl_Localizer = require('../../intl/Localizer.cjs');
|
|
@@ -29,44 +28,11 @@ const classNameGenerator = index.tv({
|
|
|
29
28
|
},
|
|
30
29
|
},
|
|
31
30
|
});
|
|
32
|
-
const
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
latest.onMouseOver(latest.option);
|
|
36
|
-
}, [latest]);
|
|
37
|
-
const handleAddClick = React.useCallback(() => {
|
|
38
|
-
latest.onAdd?.(latest.option);
|
|
39
|
-
}, [latest]);
|
|
40
|
-
const handleSelectClick = React.useCallback(() => {
|
|
41
|
-
latest.onSelect(latest.option);
|
|
42
|
-
}, [latest]);
|
|
43
|
-
const commonAttrs = {
|
|
44
|
-
id: option.id,
|
|
45
|
-
label: option.item.label,
|
|
46
|
-
activeRef,
|
|
47
|
-
onMouseOver: handleMouseOver,
|
|
48
|
-
};
|
|
49
|
-
return option.isNew ? (jsxRuntime.jsx(AddButton, { ...commonAttrs, onClick: handleAddClick })) : (jsxRuntime.jsx(SelectButton, { ...commonAttrs, disabled: option.item.disabled, selected: option.selected, onClick: handleSelectClick }));
|
|
31
|
+
const CLASS_NAMES = {
|
|
32
|
+
new: classNameGenerator({ new: true }),
|
|
33
|
+
select: classNameGenerator({ new: false }),
|
|
50
34
|
};
|
|
51
|
-
const
|
|
52
|
-
const Memoized = typedMemo(ItemButton);
|
|
53
|
-
const AddButton = React.memo(({ id, label, activeRef, onClick, onMouseOver }) => {
|
|
54
|
-
const className = classNameGenerator({
|
|
55
|
-
new: true,
|
|
56
|
-
});
|
|
57
|
-
return (jsxRuntime.jsx("button", { ref: activeRef, type: "button", role: "option", "aria-selected": false, id: id, "data-active": !!activeRef, onClick: onClick,
|
|
58
|
-
// eslint-disable-next-line jsx-a11y/mouse-events-have-key-events
|
|
59
|
-
onMouseOver: onMouseOver, className: className, children: jsxRuntime.jsx(MemoizedNewIconWithText, { label: label }) }));
|
|
60
|
-
});
|
|
61
|
-
const MemoizedNewIconWithText = React.memo(({ label }) => (jsxRuntime.jsx(components_Text_Text.Text, { color: "TEXT_LINK", icon: jsxRuntime.jsx(components_Icon_FaIcon.FaCirclePlusIcon, { color: "TEXT_LINK" }), children: jsxRuntime.jsx(intl_Localizer.Localizer, { id: "smarthr-ui/Combobox/addItemButtonLabel", defaultText: "\u300C{name}\u300D\u3092\u8FFD\u52A0", values: { name: label } }) })));
|
|
62
|
-
const SelectButton = React.memo(({ id, label, disabled, selected, activeRef, onClick, onMouseOver }) => {
|
|
63
|
-
const className = classNameGenerator({
|
|
64
|
-
new: false,
|
|
65
|
-
});
|
|
66
|
-
return (jsxRuntime.jsx("button", { ref: activeRef, type: "button", role: "option", id: id, disabled: disabled, "aria-selected": selected, "data-active": !!activeRef, onClick: onClick,
|
|
67
|
-
// eslint-disable-next-line jsx-a11y/mouse-events-have-key-events
|
|
68
|
-
onMouseOver: onMouseOver, className: className, children: label }));
|
|
69
|
-
});
|
|
35
|
+
const ItemButton = React.memo(({ id, label, disabled, selected, isNew, activeRef }) => (jsxRuntime.jsx("button", { ref: activeRef, type: "button", role: "option", id: id, "data-active": !!activeRef, "aria-selected": isNew ? false : selected, disabled: isNew ? undefined : disabled, className: isNew ? CLASS_NAMES.new : CLASS_NAMES.select, children: isNew ? (jsxRuntime.jsx(components_Text_Text.Text, { color: "TEXT_LINK", icon: jsxRuntime.jsx(components_Icon_FaIcon.FaCirclePlusIcon, { color: "TEXT_LINK" }), children: jsxRuntime.jsx(intl_Localizer.Localizer, { id: "smarthr-ui/Combobox/addItemButtonLabel", defaultText: "\u300C{name}\u300D\u3092\u8FFD\u52A0", values: { name: label } }) })) : (label) })));
|
|
70
36
|
|
|
71
|
-
exports.ItemButton =
|
|
37
|
+
exports.ItemButton = ItemButton;
|
|
72
38
|
//# sourceMappingURL=ItemButton.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ItemButton.cjs","sources":["../../../src/components/Combobox/ItemButton.tsx"],"sourcesContent":["import { type
|
|
1
|
+
{"version":3,"file":"ItemButton.cjs","sources":["../../../src/components/Combobox/ItemButton.tsx"],"sourcesContent":["import { type RefObject, memo } from 'react'\nimport { tv } from 'tailwind-variants'\n\nimport { Localizer } from '../../intl'\nimport { FaCirclePlusIcon } from '../Icon'\nimport { Text } from '../Text'\n\nimport type { ComboboxOption } from './types'\n\ntype Props = Omit<ComboboxOption<unknown>, 'item'> &\n Omit<ComboboxOption<unknown>['item'], 'data' | 'value'> & {\n activeRef: RefObject<HTMLButtonElement> | undefined\n }\n\nconst classNameGenerator = tv({\n base: [\n 'shr-block shr-min-w-full shr-cursor-pointer shr-border-none shr-px-1 shr-py-0.5 shr-text-left shr-text-base shr-leading-tight',\n 'aria-selected:shr-text-white',\n 'disabled:shr-cursor-not-allowed disabled:shr-text-disabled',\n 'data-[active=true]:shr-bg-white-darken data-[active=true]:aria-selected:shr-bg-main-darken',\n 'data-[active=false]:shr-bg-white data-[active=false]:aria-selected:shr-bg-main',\n ],\n variants: {\n new: {\n true: 'smarthr-ui-Combobox-addButton shr-flex shr-items-center',\n false: 'smarthr-ui-Combobox-selectButton',\n },\n },\n})\n\nconst CLASS_NAMES = {\n new: classNameGenerator({ new: true }),\n select: classNameGenerator({ new: false }),\n}\n\nexport const ItemButton = memo<Props>(({ id, label, disabled, selected, isNew, activeRef }) => (\n <button\n ref={activeRef}\n type=\"button\"\n role=\"option\"\n id={id}\n data-active={!!activeRef}\n aria-selected={isNew ? false : selected}\n disabled={isNew ? undefined : disabled}\n className={isNew ? CLASS_NAMES.new : CLASS_NAMES.select}\n >\n {isNew ? (\n <Text color=\"TEXT_LINK\" icon={<FaCirclePlusIcon color=\"TEXT_LINK\" />}>\n <Localizer\n id=\"smarthr-ui/Combobox/addItemButtonLabel\"\n defaultText=\"「{name}」を追加\"\n values={{ name: label }}\n />\n </Text>\n ) : (\n label\n )}\n </button>\n))\n"],"names":["tv","memo","_jsx","Text","FaCirclePlusIcon","Localizer"],"mappings":";;;;;;;;;;;;;;;AAcA,MAAM,kBAAkB,GAAGA,QAAE,CAAC;AAC5B,IAAA,IAAI,EAAE;QACJ,+HAA+H;QAC/H,8BAA8B;QAC9B,4DAA4D;QAC5D,4FAA4F;QAC5F,gFAAgF;AACjF,KAAA;AACD,IAAA,QAAQ,EAAE;AACR,QAAA,GAAG,EAAE;AACH,YAAA,IAAI,EAAE,yDAAyD;AAC/D,YAAA,KAAK,EAAE,kCAAkC;AAC1C,SAAA;AACF,KAAA;AACF,CAAA,CAAC;AAEF,MAAM,WAAW,GAAG;IAClB,GAAG,EAAE,kBAAkB,CAAC,EAAE,GAAG,EAAE,IAAI,EAAE,CAAC;IACtC,MAAM,EAAE,kBAAkB,CAAC,EAAE,GAAG,EAAE,KAAK,EAAE,CAAC;CAC3C;AAEM,MAAM,UAAU,GAAGC,UAAI,CAAQ,CAAC,EAAE,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,SAAS,EAAE,MACxFC,cAAA,CAAA,QAAA,EAAA,EACE,GAAG,EAAE,SAAS,EACd,IAAI,EAAC,QAAQ,EACb,IAAI,EAAC,QAAQ,EACb,EAAE,EAAE,EAAE,EAAA,aAAA,EACO,CAAC,CAAC,SAAS,EAAA,eAAA,EACT,KAAK,GAAG,KAAK,GAAG,QAAQ,EACvC,QAAQ,EAAE,KAAK,GAAG,SAAS,GAAG,QAAQ,EACtC,SAAS,EAAE,KAAK,GAAG,WAAW,CAAC,GAAG,GAAG,WAAW,CAAC,MAAM,EAAA,QAAA,EAEtD,KAAK,IACJA,cAAA,CAACC,yBAAI,IAAC,KAAK,EAAC,WAAW,EAAC,IAAI,EAAED,cAAA,CAACE,uCAAgB,IAAC,KAAK,EAAC,WAAW,EAAA,CAAG,EAAA,QAAA,EAClEF,cAAA,CAACG,wBAAS,EAAA,EACR,EAAE,EAAC,wCAAwC,EAC3C,WAAW,EAAC,sCAAa,EACzB,MAAM,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,EAAA,CACvB,EAAA,CACG,KAEP,KAAK,CACN,EAAA,CACM,CACV;;;;"}
|
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
import { type RefObject } from 'react';
|
|
2
2
|
import type { ComboboxOption } from './types';
|
|
3
|
-
type Props<
|
|
4
|
-
option: ComboboxOption<T>;
|
|
5
|
-
onAdd?: (option: ComboboxOption<T>) => void;
|
|
6
|
-
onSelect: (option: ComboboxOption<T>) => void;
|
|
7
|
-
onMouseOver: (option: ComboboxOption<T>) => void;
|
|
3
|
+
type Props = Omit<ComboboxOption<unknown>, 'item'> & Omit<ComboboxOption<unknown>['item'], 'data' | 'value'> & {
|
|
8
4
|
activeRef: RefObject<HTMLButtonElement> | undefined;
|
|
9
5
|
};
|
|
10
|
-
declare const
|
|
11
|
-
export {
|
|
6
|
+
export declare const ItemButton: import("react").NamedExoticComponent<Props>;
|
|
7
|
+
export {};
|