@zenkigen-inc/component-ui 1.21.1 → 1.23.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +175 -17
- package/dist/index.d.ts +175 -17
- package/dist/index.js +920 -327
- package/dist/index.mjs +872 -283
- package/package.json +5 -5
- package/vitest.setup.ts +6 -0
package/dist/index.mjs
CHANGED
|
@@ -1502,7 +1502,7 @@ import {
|
|
|
1502
1502
|
import { DayPicker } from "react-day-picker";
|
|
1503
1503
|
|
|
1504
1504
|
// src/popover/popover.tsx
|
|
1505
|
-
import { autoUpdate as autoUpdate2, offset as offset2, useFloating as useFloating2, useId as useFloatingId } from "@floating-ui/react";
|
|
1505
|
+
import { autoUpdate as autoUpdate2, flip as flip2, offset as offset2, shift, useFloating as useFloating2, useId as useFloatingId } from "@floating-ui/react";
|
|
1506
1506
|
import { useEffect as useEffect8, useMemo as useMemo4, useRef as useRef7 } from "react";
|
|
1507
1507
|
|
|
1508
1508
|
// src/popover/popover-content.tsx
|
|
@@ -1672,6 +1672,7 @@ var PopoverTrigger = forwardRef7(function PopoverTrigger2({ children }, ref) {
|
|
|
1672
1672
|
|
|
1673
1673
|
// src/popover/popover.tsx
|
|
1674
1674
|
import { jsx as jsx21 } from "react/jsx-runtime";
|
|
1675
|
+
var FLOATING_VIEWPORT_PADDING2 = 8;
|
|
1675
1676
|
function Popover({
|
|
1676
1677
|
isOpen,
|
|
1677
1678
|
children,
|
|
@@ -1681,6 +1682,14 @@ function Popover({
|
|
|
1681
1682
|
anchorRef
|
|
1682
1683
|
}) {
|
|
1683
1684
|
const triggerRef = useRef7(null);
|
|
1685
|
+
const middleware = useMemo4(
|
|
1686
|
+
() => [
|
|
1687
|
+
offset2(offsetValue),
|
|
1688
|
+
flip2({ padding: FLOATING_VIEWPORT_PADDING2, flipAlignment: false }),
|
|
1689
|
+
shift({ padding: FLOATING_VIEWPORT_PADDING2 })
|
|
1690
|
+
],
|
|
1691
|
+
[offsetValue]
|
|
1692
|
+
);
|
|
1684
1693
|
const floating = useFloating2({
|
|
1685
1694
|
open: isOpen,
|
|
1686
1695
|
onOpenChange: (open) => {
|
|
@@ -1689,7 +1698,7 @@ function Popover({
|
|
|
1689
1698
|
}
|
|
1690
1699
|
},
|
|
1691
1700
|
placement,
|
|
1692
|
-
middleware
|
|
1701
|
+
middleware,
|
|
1693
1702
|
whileElementsMounted: autoUpdate2,
|
|
1694
1703
|
strategy: "fixed"
|
|
1695
1704
|
});
|
|
@@ -1737,27 +1746,83 @@ import { DayButton } from "react-day-picker";
|
|
|
1737
1746
|
import { clsx as clsx15 } from "clsx";
|
|
1738
1747
|
import { getDefaultClassNames } from "react-day-picker";
|
|
1739
1748
|
var defaultDayPickerClassNames = getDefaultClassNames();
|
|
1740
|
-
var
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1749
|
+
var BASE_TOKENS = {
|
|
1750
|
+
triggerIcon: "small",
|
|
1751
|
+
dayPickerStyle: {
|
|
1752
|
+
"--rdp-nav-height": "30px",
|
|
1753
|
+
"--rdp-day-width": "30px",
|
|
1754
|
+
"--rdp-day-height": "30px",
|
|
1755
|
+
"--rdp-day_button-width": "28px",
|
|
1756
|
+
"--rdp-day_button-height": "28px",
|
|
1757
|
+
"--rdp-day_button-border": "1px solid transparent",
|
|
1758
|
+
"--rdp-weekday-padding": "0px",
|
|
1759
|
+
fontFamily: "Arial, 'Noto Sans JP', sans-serif",
|
|
1760
|
+
fontSize: "12px",
|
|
1761
|
+
fontWeight: 700
|
|
1762
|
+
},
|
|
1763
|
+
dayPickerClassNames: {
|
|
1764
|
+
month: clsx15(defaultDayPickerClassNames.month, "flex flex-col px-[7px] py-2")
|
|
1765
|
+
},
|
|
1766
|
+
dayButtonClass: "relative grid size-full place-items-center rounded-full !border !border-solid",
|
|
1767
|
+
dayButtonFontSize: "12px",
|
|
1768
|
+
monthCaptionClass: "flex items-center justify-between px-1 pb-0.5",
|
|
1769
|
+
monthCaptionTypography: "typography-label12bold",
|
|
1770
|
+
navIconButton: "small",
|
|
1771
|
+
weekdayClass: "m-0 size-7 p-0 text-center align-middle",
|
|
1772
|
+
footerIconButton: "medium",
|
|
1773
|
+
footerClearButton: "small",
|
|
1774
|
+
errorTypography: "typography-label11regular"
|
|
1775
|
+
};
|
|
1776
|
+
var LARGE_TOKENS = {
|
|
1777
|
+
...BASE_TOKENS,
|
|
1778
|
+
triggerIcon: "medium",
|
|
1779
|
+
errorTypography: "typography-label12regular"
|
|
1780
|
+
};
|
|
1781
|
+
var X_LARGE_TOKENS = {
|
|
1782
|
+
triggerIcon: "medium",
|
|
1783
|
+
dayPickerStyle: {
|
|
1784
|
+
"--rdp-nav-height": "40px",
|
|
1785
|
+
"--rdp-day-width": "48px",
|
|
1786
|
+
"--rdp-day-height": "48px",
|
|
1787
|
+
"--rdp-day_button-width": "40px",
|
|
1788
|
+
"--rdp-day_button-height": "40px",
|
|
1789
|
+
"--rdp-day_button-border": "1px solid transparent",
|
|
1790
|
+
"--rdp-weekday-padding": "0px",
|
|
1791
|
+
fontFamily: "Arial, 'Noto Sans JP', sans-serif",
|
|
1792
|
+
fontSize: "16px",
|
|
1793
|
+
fontWeight: 700
|
|
1794
|
+
},
|
|
1795
|
+
dayPickerClassNames: {
|
|
1796
|
+
month: clsx15(defaultDayPickerClassNames.month, "flex flex-col px-[3px] pb-1 pt-2")
|
|
1797
|
+
},
|
|
1798
|
+
dayButtonClass: "relative grid size-10 place-items-center rounded-full !border !border-solid",
|
|
1799
|
+
dayButtonFontSize: "16px",
|
|
1800
|
+
// caption は height 固定(--rdp-nav-height: 40px)のため pb-2 は食い込みとして働き、
|
|
1801
|
+
// ナビボタンが上へ 4px はみ出して月ヘッダーと曜日行の視覚間隔が 8px になる(上部ブロックコメント参照)
|
|
1802
|
+
monthCaptionClass: "flex items-center justify-between px-1 pb-2",
|
|
1803
|
+
monthCaptionTypography: "typography-label16bold",
|
|
1804
|
+
// IconButton に x-large は無いが、large が 40px で Figma と一致する(内部アイコンも 24px になる)
|
|
1805
|
+
navIconButton: "large",
|
|
1806
|
+
weekdayClass: "m-0 size-12 p-0 text-center align-middle",
|
|
1807
|
+
footerIconButton: "large",
|
|
1808
|
+
footerClearButton: "large",
|
|
1809
|
+
errorTypography: "typography-label12regular"
|
|
1752
1810
|
};
|
|
1753
|
-
var
|
|
1754
|
-
|
|
1811
|
+
var DATE_PICKER_SIZE_TOKENS = {
|
|
1812
|
+
small: BASE_TOKENS,
|
|
1813
|
+
medium: BASE_TOKENS,
|
|
1814
|
+
large: LARGE_TOKENS,
|
|
1815
|
+
"x-large": X_LARGE_TOKENS
|
|
1816
|
+
};
|
|
1817
|
+
var useDatePickerSizeTokens = (componentName = "DatePicker \u306E\u30AB\u30EC\u30F3\u30C0\u30FC") => {
|
|
1818
|
+
const context = useDatePickerCompoundContext(componentName);
|
|
1819
|
+
return { ...context, tokens: DATE_PICKER_SIZE_TOKENS[context.size] };
|
|
1755
1820
|
};
|
|
1756
|
-
var dayButtonBaseClass = "relative grid size-full place-items-center rounded-full !border !border-solid";
|
|
1757
1821
|
|
|
1758
1822
|
// src/date-picker/date-picker-day-button.tsx
|
|
1759
1823
|
import { jsx as jsx22 } from "react/jsx-runtime";
|
|
1760
1824
|
var CustomDayButton = ({ day, modifiers, className, style, ...buttonProps }) => {
|
|
1825
|
+
const { tokens } = useDatePickerSizeTokens();
|
|
1761
1826
|
const isSelected = Boolean(modifiers.selected);
|
|
1762
1827
|
const isOutside = Boolean(modifiers.outside);
|
|
1763
1828
|
const isMinMaxDisabled = Boolean(modifiers.minMaxDisabled);
|
|
@@ -1770,10 +1835,10 @@ var CustomDayButton = ({ day, modifiers, className, style, ...buttonProps }) =>
|
|
|
1770
1835
|
...buttonProps,
|
|
1771
1836
|
day,
|
|
1772
1837
|
modifiers,
|
|
1773
|
-
style: { ...style, fontSize:
|
|
1838
|
+
style: { ...style, fontSize: tokens.dayButtonFontSize },
|
|
1774
1839
|
className: clsx16(
|
|
1775
1840
|
className,
|
|
1776
|
-
|
|
1841
|
+
tokens.dayButtonClass,
|
|
1777
1842
|
// 共通: フォーカスリング(有効な日のみ)
|
|
1778
1843
|
// react-day-picker の rdp-day_button クラスが outline: none を設定しているため、!important で上書き
|
|
1779
1844
|
!isDisabledDay && focusVisible5.normalImportant,
|
|
@@ -1799,8 +1864,8 @@ import { forwardRef as forwardRef8 } from "react";
|
|
|
1799
1864
|
import { jsx as jsx23 } from "react/jsx-runtime";
|
|
1800
1865
|
var DatePickerErrorMessage = forwardRef8(
|
|
1801
1866
|
({ "aria-live": ariaLive = "assertive", ...props }, ref) => {
|
|
1802
|
-
const {
|
|
1803
|
-
const typographyClass =
|
|
1867
|
+
const { isError, tokens } = useDatePickerSizeTokens("DatePicker.ErrorMessage");
|
|
1868
|
+
const typographyClass = tokens.errorTypography;
|
|
1804
1869
|
if (isError !== true) {
|
|
1805
1870
|
return null;
|
|
1806
1871
|
}
|
|
@@ -1881,11 +1946,12 @@ import { jsx as jsx24, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
|
1881
1946
|
var CustomMonthCaption = ({ calendarMonth, className, displayIndex, style, ...props }) => {
|
|
1882
1947
|
void displayIndex;
|
|
1883
1948
|
const { goToMonth, nextMonth, previousMonth } = useDayPicker();
|
|
1949
|
+
const { tokens } = useDatePickerSizeTokens();
|
|
1884
1950
|
const captionMonth = calendarMonth.date;
|
|
1885
1951
|
return /* @__PURE__ */ jsxs7(
|
|
1886
1952
|
"div",
|
|
1887
1953
|
{
|
|
1888
|
-
className: clsx18(
|
|
1954
|
+
className: clsx18(tokens.monthCaptionClass, className),
|
|
1889
1955
|
style: { ...style, fontSize: "inherit", fontWeight: "inherit" },
|
|
1890
1956
|
...props,
|
|
1891
1957
|
children: [
|
|
@@ -1893,19 +1959,19 @@ var CustomMonthCaption = ({ calendarMonth, className, displayIndex, style, ...pr
|
|
|
1893
1959
|
IconButton,
|
|
1894
1960
|
{
|
|
1895
1961
|
icon: "angle-left",
|
|
1896
|
-
size:
|
|
1962
|
+
size: tokens.navIconButton,
|
|
1897
1963
|
variant: "text",
|
|
1898
1964
|
isDisabled: !previousMonth,
|
|
1899
1965
|
"aria-label": "\u524D\u306E\u6708",
|
|
1900
1966
|
onClick: () => previousMonth && goToMonth(previousMonth)
|
|
1901
1967
|
}
|
|
1902
1968
|
),
|
|
1903
|
-
/* @__PURE__ */ jsx24("span", { className: "
|
|
1969
|
+
/* @__PURE__ */ jsx24("span", { className: clsx18(tokens.monthCaptionTypography, "text-text02"), children: formatMonthLabel(captionMonth) }),
|
|
1904
1970
|
/* @__PURE__ */ jsx24(
|
|
1905
1971
|
IconButton,
|
|
1906
1972
|
{
|
|
1907
1973
|
icon: "angle-right",
|
|
1908
|
-
size:
|
|
1974
|
+
size: tokens.navIconButton,
|
|
1909
1975
|
variant: "text",
|
|
1910
1976
|
isDisabled: !nextMonth,
|
|
1911
1977
|
"aria-label": "\u6B21\u306E\u6708",
|
|
@@ -1921,11 +1987,12 @@ var CustomMonthCaption = ({ calendarMonth, className, displayIndex, style, ...pr
|
|
|
1921
1987
|
import { clsx as clsx19 } from "clsx";
|
|
1922
1988
|
import { jsx as jsx25 } from "react/jsx-runtime";
|
|
1923
1989
|
var CustomWeekday = ({ className, children, style, ...props }) => {
|
|
1990
|
+
const { tokens } = useDatePickerSizeTokens();
|
|
1924
1991
|
return /* @__PURE__ */ jsx25(
|
|
1925
1992
|
"th",
|
|
1926
1993
|
{
|
|
1927
1994
|
...props,
|
|
1928
|
-
className: clsx19(className, "
|
|
1995
|
+
className: clsx19(className, tokens.weekdayClass, "text-text02"),
|
|
1929
1996
|
style: { ...style, fontSize: "inherit", fontWeight: "bold" },
|
|
1930
1997
|
children
|
|
1931
1998
|
}
|
|
@@ -2060,7 +2127,7 @@ var DatePicker = ({
|
|
|
2060
2127
|
formatWeekdayName: (date) => weekdayFormatter.format(date)
|
|
2061
2128
|
};
|
|
2062
2129
|
}, []);
|
|
2063
|
-
const
|
|
2130
|
+
const tokens = DATE_PICKER_SIZE_TOKENS[size];
|
|
2064
2131
|
const displayText = value ? formatDisplayDate(value, timeZone) : placeholder;
|
|
2065
2132
|
const displayTextClasses = "min-w-0 truncate";
|
|
2066
2133
|
const errorIds = [];
|
|
@@ -2108,7 +2175,7 @@ var DatePicker = ({
|
|
|
2108
2175
|
size,
|
|
2109
2176
|
variant: isError ? "outlineDanger" : "outline",
|
|
2110
2177
|
isDisabled,
|
|
2111
|
-
before: /* @__PURE__ */ jsx26(Icon, { name: "calendar", size:
|
|
2178
|
+
before: /* @__PURE__ */ jsx26(Icon, { name: "calendar", size: tokens.triggerIcon }),
|
|
2112
2179
|
justifyContent: "start",
|
|
2113
2180
|
onClick: handleTriggerClick,
|
|
2114
2181
|
children: /* @__PURE__ */ jsx26("span", { className: displayTextClasses, children: displayText })
|
|
@@ -2122,7 +2189,7 @@ var DatePicker = ({
|
|
|
2122
2189
|
showOutsideDays: true,
|
|
2123
2190
|
hideNavigation: true,
|
|
2124
2191
|
weekStartsOn: 0,
|
|
2125
|
-
style: dayPickerStyle,
|
|
2192
|
+
style: tokens.dayPickerStyle,
|
|
2126
2193
|
month: displayMonth,
|
|
2127
2194
|
onMonthChange: setDisplayMonth,
|
|
2128
2195
|
selected: selectedDate,
|
|
@@ -2130,7 +2197,7 @@ var DatePicker = ({
|
|
|
2130
2197
|
today: todayForCalendar,
|
|
2131
2198
|
disabled: disabledDays,
|
|
2132
2199
|
modifiers: { minMaxDisabled: isMinMaxDisabled },
|
|
2133
|
-
classNames: dayPickerClassNames,
|
|
2200
|
+
classNames: tokens.dayPickerClassNames,
|
|
2134
2201
|
formatters,
|
|
2135
2202
|
fixedWeeks: true,
|
|
2136
2203
|
components: { MonthCaption: CustomMonthCaption, DayButton: CustomDayButton, Weekday: CustomWeekday }
|
|
@@ -2141,14 +2208,14 @@ var DatePicker = ({
|
|
|
2141
2208
|
IconButton,
|
|
2142
2209
|
{
|
|
2143
2210
|
icon: "calendar-today",
|
|
2144
|
-
size:
|
|
2211
|
+
size: tokens.footerIconButton,
|
|
2145
2212
|
variant: "text",
|
|
2146
2213
|
"aria-label": "\u4ECA\u65E5\u306B\u623B\u308B",
|
|
2147
2214
|
iconAccentColor: "supportInfo",
|
|
2148
2215
|
onClick: handleClickToday
|
|
2149
2216
|
}
|
|
2150
2217
|
),
|
|
2151
|
-
/* @__PURE__ */ jsx26(Button, { type: "button", size:
|
|
2218
|
+
/* @__PURE__ */ jsx26(Button, { type: "button", size: tokens.footerClearButton, variant: "text", onClick: handleClear, children: "\u30AF\u30EA\u30A2" })
|
|
2152
2219
|
] })
|
|
2153
2220
|
] }) })
|
|
2154
2221
|
] });
|
|
@@ -2968,22 +3035,35 @@ Modal.Footer = ModalFooter;
|
|
|
2968
3035
|
// src/notification-inline/notification-inline.tsx
|
|
2969
3036
|
import { clsx as clsx29 } from "clsx";
|
|
2970
3037
|
import { jsx as jsx38, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
2971
|
-
function NotificationInline({ state = "default", size = "medium", ...props }) {
|
|
2972
|
-
const
|
|
3038
|
+
function NotificationInline({ state = "default", size = "medium", variant = "default", ...props }) {
|
|
3039
|
+
const isOutline = variant === "outline";
|
|
3040
|
+
const wrapperClasses = clsx29("typography-body13regular flex items-center gap-1 rounded border text-text01", {
|
|
2973
3041
|
"bg-uiBackgroundError": state === "attention",
|
|
2974
3042
|
"bg-uiBackgroundWarning": state === "warning",
|
|
2975
3043
|
"bg-uiBackgroundBlue": state === "information",
|
|
2976
3044
|
"bg-uiBackgroundSuccess": state === "success",
|
|
2977
3045
|
"bg-uiBackgroundGray": state === "default",
|
|
2978
|
-
|
|
2979
|
-
|
|
3046
|
+
// 1 行時の高さの基準は small が閉じるボタン(24px)、medium がアイコン(24px)。
|
|
3047
|
+
// showClose / state によらず高さが変わらないよう、両サイズとも最小高を確保する
|
|
3048
|
+
"min-h-12 p-[calc(0.75rem_-_1px)]": size === "small",
|
|
3049
|
+
"min-h-14 p-[calc(1rem_-_1px)]": size === "medium",
|
|
3050
|
+
"border-transparent": !isOutline,
|
|
3051
|
+
"border-supportError": isOutline && state === "attention",
|
|
3052
|
+
"border-supportWarning": isOutline && state === "warning",
|
|
3053
|
+
"border-supportInfo": isOutline && state === "information",
|
|
3054
|
+
"border-supportSuccess": isOutline && state === "success",
|
|
3055
|
+
"border-uiBorder04": isOutline && state === "default"
|
|
2980
3056
|
});
|
|
2981
|
-
const iconClasses = clsx29("flex items-center", {
|
|
3057
|
+
const iconClasses = clsx29("flex shrink-0 items-center", {
|
|
3058
|
+
"h-5": size === "small",
|
|
2982
3059
|
"fill-supportError": state === "attention",
|
|
2983
3060
|
"fill-supportWarning": state === "warning",
|
|
2984
3061
|
"fill-blue-blue50": state === "information",
|
|
2985
3062
|
"fill-supportSuccess": state === "success"
|
|
2986
3063
|
});
|
|
3064
|
+
const textClasses = clsx29("flex-1", {
|
|
3065
|
+
"pt-[2px]": size === "medium" && state !== "default"
|
|
3066
|
+
});
|
|
2987
3067
|
const iconName = {
|
|
2988
3068
|
attention: "attention",
|
|
2989
3069
|
success: "success-filled",
|
|
@@ -2995,9 +3075,11 @@ function NotificationInline({ state = "default", size = "medium", ...props }) {
|
|
|
2995
3075
|
medium: "medium"
|
|
2996
3076
|
};
|
|
2997
3077
|
return /* @__PURE__ */ jsxs15("div", { className: wrapperClasses, children: [
|
|
2998
|
-
|
|
2999
|
-
|
|
3000
|
-
|
|
3078
|
+
/* @__PURE__ */ jsxs15("div", { className: "flex flex-1 items-start gap-1", children: [
|
|
3079
|
+
state !== "default" && /* @__PURE__ */ jsx38("div", { className: iconClasses, children: /* @__PURE__ */ jsx38(Icon, { name: iconName[state], size: iconSize[size] }) }),
|
|
3080
|
+
/* @__PURE__ */ jsx38("p", { className: textClasses, children: props.children })
|
|
3081
|
+
] }),
|
|
3082
|
+
props.showClose === true && /* @__PURE__ */ jsx38("div", { className: "ml-2 flex shrink-0 items-center", children: /* @__PURE__ */ jsx38(IconButton, { icon: "close", size: "small", variant: "text", onClick: props.onClickClose }) })
|
|
3001
3083
|
] });
|
|
3002
3084
|
}
|
|
3003
3085
|
|
|
@@ -3209,7 +3291,9 @@ function Select({
|
|
|
3209
3291
|
isOptionSelected = false,
|
|
3210
3292
|
onChange,
|
|
3211
3293
|
optionListMaxHeight,
|
|
3212
|
-
matchListToTrigger = false
|
|
3294
|
+
matchListToTrigger = false,
|
|
3295
|
+
"aria-label": ariaLabel,
|
|
3296
|
+
"aria-describedby": ariaDescribedby
|
|
3213
3297
|
}) {
|
|
3214
3298
|
const [isOptionListOpen, setIsOptionListOpen] = useState10(false);
|
|
3215
3299
|
const targetRef = useRef11(null);
|
|
@@ -3270,6 +3354,7 @@ function Select({
|
|
|
3270
3354
|
"typography-label14regular": size === "small" || size === "medium",
|
|
3271
3355
|
"typography-label16regular": size === "large"
|
|
3272
3356
|
});
|
|
3357
|
+
const ariaInvalidProps = isError ? { "aria-invalid": true } : {};
|
|
3273
3358
|
return /* @__PURE__ */ jsx43(
|
|
3274
3359
|
SelectContext.Provider,
|
|
3275
3360
|
{
|
|
@@ -3291,6 +3376,9 @@ function Select({
|
|
|
3291
3376
|
ref: refs.setReference,
|
|
3292
3377
|
className: buttonClasses,
|
|
3293
3378
|
type: "button",
|
|
3379
|
+
"aria-label": ariaLabel,
|
|
3380
|
+
"aria-describedby": ariaDescribedby,
|
|
3381
|
+
...ariaInvalidProps,
|
|
3294
3382
|
onClick: handleClickToggle,
|
|
3295
3383
|
disabled: isDisabled,
|
|
3296
3384
|
children: [
|
|
@@ -3599,23 +3687,207 @@ function Radio({
|
|
|
3599
3687
|
] });
|
|
3600
3688
|
}
|
|
3601
3689
|
|
|
3690
|
+
// src/radio-card/radio-card.tsx
|
|
3691
|
+
import { Children as Children5, cloneElement as cloneElement5, isValidElement as isValidElement5, useId as useId6, useMemo as useMemo6 } from "react";
|
|
3692
|
+
|
|
3693
|
+
// src/radio-card/radio-card-context.ts
|
|
3694
|
+
import { createContext as createContext12, useContext as useContext15 } from "react";
|
|
3695
|
+
var RadioCardContext = createContext12(null);
|
|
3696
|
+
function useRadioCardContext(componentName) {
|
|
3697
|
+
const context = useContext15(RadioCardContext);
|
|
3698
|
+
if (context === null) {
|
|
3699
|
+
throw new Error(`<${componentName}> \u306F <RadioCard> \u306E\u5185\u90E8\u3067\u4F7F\u7528\u3057\u3066\u304F\u3060\u3055\u3044`);
|
|
3700
|
+
}
|
|
3701
|
+
return context;
|
|
3702
|
+
}
|
|
3703
|
+
|
|
3704
|
+
// src/radio-card/radio-card-error-message.tsx
|
|
3705
|
+
import { jsx as jsx51 } from "react/jsx-runtime";
|
|
3706
|
+
function RadioCardErrorMessage({ children, id }) {
|
|
3707
|
+
const { isError } = useRadioCardContext("RadioCard.ErrorMessage");
|
|
3708
|
+
if (!isError) {
|
|
3709
|
+
return null;
|
|
3710
|
+
}
|
|
3711
|
+
return /* @__PURE__ */ jsx51("p", { id, className: "typography-label13regular text-supportError", "aria-live": "assertive", children });
|
|
3712
|
+
}
|
|
3713
|
+
RadioCardErrorMessage.displayName = "RadioCard.ErrorMessage";
|
|
3714
|
+
|
|
3715
|
+
// src/radio-card/radio-card-group.tsx
|
|
3716
|
+
import { jsx as jsx52 } from "react/jsx-runtime";
|
|
3717
|
+
function RadioCardGroup({ children }) {
|
|
3718
|
+
const { ariaLabel, ariaLabelledby, errorDescribedBy } = useRadioCardContext("RadioCard.Group");
|
|
3719
|
+
const describedByProps = errorDescribedBy != null ? { "aria-describedby": errorDescribedBy } : {};
|
|
3720
|
+
return /* @__PURE__ */ jsx52(
|
|
3721
|
+
"div",
|
|
3722
|
+
{
|
|
3723
|
+
role: "radiogroup",
|
|
3724
|
+
"aria-label": ariaLabel,
|
|
3725
|
+
"aria-labelledby": ariaLabelledby,
|
|
3726
|
+
className: "flex flex-col gap-4",
|
|
3727
|
+
...describedByProps,
|
|
3728
|
+
children
|
|
3729
|
+
}
|
|
3730
|
+
);
|
|
3731
|
+
}
|
|
3732
|
+
RadioCardGroup.displayName = "RadioCard.Group";
|
|
3733
|
+
|
|
3734
|
+
// src/radio-card/radio-card-item.tsx
|
|
3735
|
+
import { focusVisible as focusVisible13 } from "@zenkigen-inc/component-theme";
|
|
3736
|
+
import clsx35 from "clsx";
|
|
3737
|
+
import { useId as useId5 } from "react";
|
|
3738
|
+
import { jsx as jsx53, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
3739
|
+
function RadioCardItem({ value, label, description, isDisabled: itemDisabled = false, id }) {
|
|
3740
|
+
const context = useRadioCardContext("RadioCard.Item");
|
|
3741
|
+
const autoId = useId5();
|
|
3742
|
+
const inputId = id ?? autoId;
|
|
3743
|
+
const labelId = `${inputId}-label`;
|
|
3744
|
+
const descriptionId = `${inputId}-description`;
|
|
3745
|
+
const isChecked = context.value === value;
|
|
3746
|
+
const isDisabled = context.isDisabled || itemDisabled;
|
|
3747
|
+
const isError = context.isError && !isDisabled;
|
|
3748
|
+
const hasDescription = description != null && description !== "";
|
|
3749
|
+
const describedByProps = hasDescription ? { "aria-describedby": descriptionId } : {};
|
|
3750
|
+
const ariaInvalidProps = isError ? { "aria-invalid": true } : {};
|
|
3751
|
+
const handleChange = () => {
|
|
3752
|
+
if (!isDisabled) {
|
|
3753
|
+
context.onChange(value);
|
|
3754
|
+
}
|
|
3755
|
+
};
|
|
3756
|
+
const cardClasses = clsx35(
|
|
3757
|
+
"pointer-events-none flex flex-col gap-2 rounded border border-solid px-4 py-3",
|
|
3758
|
+
focusVisible13.normalPeer,
|
|
3759
|
+
{
|
|
3760
|
+
"border-uiBorder02 bg-uiBackground01": isDisabled,
|
|
3761
|
+
"border-supportError bg-uiBackground01 group-hover:bg-hoverUi02": isError,
|
|
3762
|
+
"border-selectedUiBorder bg-selectedUi group-hover:bg-hoverUi02": !isDisabled && !isError && isChecked,
|
|
3763
|
+
"border-uiBorder02 bg-uiBackground01 group-hover:bg-hoverUi02": !isDisabled && !isError && !isChecked
|
|
3764
|
+
}
|
|
3765
|
+
);
|
|
3766
|
+
const boxClasses = clsx35(
|
|
3767
|
+
"relative inline-flex size-5 shrink-0 items-center justify-center rounded-full border border-solid bg-white",
|
|
3768
|
+
{
|
|
3769
|
+
"border-disabled01": isDisabled,
|
|
3770
|
+
"border-supportError group-hover:border-hoverError": !isDisabled && isError,
|
|
3771
|
+
"border-uiBorder04 group-hover:border-hoverUiBorder": !isDisabled && !isError
|
|
3772
|
+
}
|
|
3773
|
+
);
|
|
3774
|
+
const dotClasses = clsx35("absolute inset-0 m-auto size-3 rounded-full", {
|
|
3775
|
+
"scale-100": isChecked,
|
|
3776
|
+
"scale-0": !isChecked,
|
|
3777
|
+
"bg-disabled01": isDisabled && isChecked,
|
|
3778
|
+
"bg-supportError": !isDisabled && isError && isChecked,
|
|
3779
|
+
"bg-activeSelectedUi": !isDisabled && !isError && isChecked
|
|
3780
|
+
});
|
|
3781
|
+
const hoverDotClasses = clsx35("size-3 rounded-full bg-transparent", {
|
|
3782
|
+
"group-hover:bg-hoverUi": !isDisabled && !isChecked
|
|
3783
|
+
});
|
|
3784
|
+
const labelClasses = clsx35("typography-label14regular ml-2 select-none break-all", {
|
|
3785
|
+
"text-disabled01": isDisabled,
|
|
3786
|
+
"text-text01": !isDisabled
|
|
3787
|
+
});
|
|
3788
|
+
const descriptionClasses = clsx35("typography-body12regular pl-7", {
|
|
3789
|
+
"text-disabled01": isDisabled,
|
|
3790
|
+
"text-text02": !isDisabled
|
|
3791
|
+
});
|
|
3792
|
+
return /* @__PURE__ */ jsxs23("div", { className: "group relative", children: [
|
|
3793
|
+
/* @__PURE__ */ jsx53(
|
|
3794
|
+
"input",
|
|
3795
|
+
{
|
|
3796
|
+
type: "radio",
|
|
3797
|
+
id: inputId,
|
|
3798
|
+
name: context.name,
|
|
3799
|
+
value,
|
|
3800
|
+
checked: isChecked,
|
|
3801
|
+
disabled: isDisabled,
|
|
3802
|
+
onChange: handleChange,
|
|
3803
|
+
"aria-labelledby": labelId,
|
|
3804
|
+
className: "peer absolute inset-0 size-full cursor-pointer opacity-0 disabled:cursor-not-allowed",
|
|
3805
|
+
...describedByProps,
|
|
3806
|
+
...ariaInvalidProps
|
|
3807
|
+
}
|
|
3808
|
+
),
|
|
3809
|
+
/* @__PURE__ */ jsxs23("div", { className: cardClasses, children: [
|
|
3810
|
+
/* @__PURE__ */ jsxs23("div", { className: "flex items-center", children: [
|
|
3811
|
+
/* @__PURE__ */ jsxs23("span", { className: boxClasses, "aria-hidden": "true", children: [
|
|
3812
|
+
/* @__PURE__ */ jsx53("span", { className: dotClasses }),
|
|
3813
|
+
/* @__PURE__ */ jsx53("span", { className: hoverDotClasses })
|
|
3814
|
+
] }),
|
|
3815
|
+
/* @__PURE__ */ jsx53("span", { id: labelId, className: labelClasses, children: label })
|
|
3816
|
+
] }),
|
|
3817
|
+
hasDescription ? /* @__PURE__ */ jsx53("p", { id: descriptionId, className: descriptionClasses, children: description }) : null
|
|
3818
|
+
] })
|
|
3819
|
+
] });
|
|
3820
|
+
}
|
|
3821
|
+
RadioCardItem.displayName = "RadioCard.Item";
|
|
3822
|
+
|
|
3823
|
+
// src/radio-card/radio-card.tsx
|
|
3824
|
+
import { jsx as jsx54 } from "react/jsx-runtime";
|
|
3825
|
+
function RadioCardRoot({
|
|
3826
|
+
children,
|
|
3827
|
+
value,
|
|
3828
|
+
onChange,
|
|
3829
|
+
name,
|
|
3830
|
+
isDisabled = false,
|
|
3831
|
+
isError = false,
|
|
3832
|
+
"aria-label": ariaLabel,
|
|
3833
|
+
"aria-labelledby": ariaLabelledby
|
|
3834
|
+
}) {
|
|
3835
|
+
const autoName = useId6();
|
|
3836
|
+
const baseId = useId6();
|
|
3837
|
+
const resolvedName = name ?? autoName;
|
|
3838
|
+
const errorIds = [];
|
|
3839
|
+
const enhancedChildren = Children5.map(children, (child) => {
|
|
3840
|
+
if (!isValidElement5(child)) {
|
|
3841
|
+
return child;
|
|
3842
|
+
}
|
|
3843
|
+
if (child.type === RadioCardErrorMessage && isError) {
|
|
3844
|
+
const errorChild = child;
|
|
3845
|
+
const assignedId = errorChild.props.id ?? `${baseId}-error-${errorIds.length + 1}`;
|
|
3846
|
+
errorIds.push(assignedId);
|
|
3847
|
+
return cloneElement5(errorChild, { id: assignedId });
|
|
3848
|
+
}
|
|
3849
|
+
return child;
|
|
3850
|
+
});
|
|
3851
|
+
const errorDescribedBy = errorIds.length > 0 ? errorIds.join(" ") : null;
|
|
3852
|
+
const contextValue = useMemo6(
|
|
3853
|
+
() => ({
|
|
3854
|
+
value,
|
|
3855
|
+
onChange,
|
|
3856
|
+
name: resolvedName,
|
|
3857
|
+
isDisabled,
|
|
3858
|
+
isError,
|
|
3859
|
+
errorDescribedBy,
|
|
3860
|
+
ariaLabel,
|
|
3861
|
+
ariaLabelledby
|
|
3862
|
+
}),
|
|
3863
|
+
[value, onChange, resolvedName, isDisabled, isError, errorDescribedBy, ariaLabel, ariaLabelledby]
|
|
3864
|
+
);
|
|
3865
|
+
return /* @__PURE__ */ jsx54(RadioCardContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsx54("div", { className: "flex flex-col gap-2", children: enhancedChildren }) });
|
|
3866
|
+
}
|
|
3867
|
+
var RadioCard = Object.assign(RadioCardRoot, {
|
|
3868
|
+
Group: RadioCardGroup,
|
|
3869
|
+
Item: RadioCardItem,
|
|
3870
|
+
ErrorMessage: RadioCardErrorMessage,
|
|
3871
|
+
displayName: "RadioCard"
|
|
3872
|
+
});
|
|
3873
|
+
|
|
3602
3874
|
// src/search/search.tsx
|
|
3603
|
-
import { clsx as
|
|
3875
|
+
import { clsx as clsx36 } from "clsx";
|
|
3604
3876
|
import { forwardRef as forwardRef12 } from "react";
|
|
3605
|
-
import { jsx as
|
|
3877
|
+
import { jsx as jsx55, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
3606
3878
|
var Search = forwardRef12(({ width = "100%", size = "medium", ...props }, ref) => {
|
|
3607
|
-
const classes =
|
|
3879
|
+
const classes = clsx36(
|
|
3608
3880
|
"flex items-center rounded-full border border-uiBorder02 bg-uiBackground01 focus-within:border-activeInput",
|
|
3609
3881
|
{ "h-8 px-3": size === "medium" },
|
|
3610
3882
|
{ "h-10 px-4": size === "large" }
|
|
3611
3883
|
);
|
|
3612
|
-
const inputClasses =
|
|
3884
|
+
const inputClasses = clsx36("mx-2 h-full flex-1 text-text01 outline-none placeholder:text-textPlaceholder", {
|
|
3613
3885
|
["typography-label14regular"]: size === "medium",
|
|
3614
3886
|
["typography-label16regular"]: size === "large"
|
|
3615
3887
|
});
|
|
3616
|
-
return /* @__PURE__ */
|
|
3617
|
-
/* @__PURE__ */
|
|
3618
|
-
/* @__PURE__ */
|
|
3888
|
+
return /* @__PURE__ */ jsx55("div", { className: "relative", ref, children: /* @__PURE__ */ jsx55("form", { onSubmit: props.onSubmit, children: /* @__PURE__ */ jsxs24("div", { className: classes, style: { width }, children: [
|
|
3889
|
+
/* @__PURE__ */ jsx55(Icon, { name: "search", color: "icon01", size: "medium" }),
|
|
3890
|
+
/* @__PURE__ */ jsx55(
|
|
3619
3891
|
"input",
|
|
3620
3892
|
{
|
|
3621
3893
|
type: "text",
|
|
@@ -3626,7 +3898,7 @@ var Search = forwardRef12(({ width = "100%", size = "medium", ...props }, ref) =
|
|
|
3626
3898
|
onChange: props.onChange
|
|
3627
3899
|
}
|
|
3628
3900
|
),
|
|
3629
|
-
props.onClickClearButton && props.value && props.value.length !== 0 && /* @__PURE__ */
|
|
3901
|
+
props.onClickClearButton && props.value && props.value.length !== 0 && /* @__PURE__ */ jsx55(
|
|
3630
3902
|
IconButton,
|
|
3631
3903
|
{
|
|
3632
3904
|
variant: "text",
|
|
@@ -3641,17 +3913,17 @@ var Search = forwardRef12(({ width = "100%", size = "medium", ...props }, ref) =
|
|
|
3641
3913
|
Search.displayName = "Search";
|
|
3642
3914
|
|
|
3643
3915
|
// src/segmented-control/segmented-control.tsx
|
|
3644
|
-
import React4, { Children as
|
|
3916
|
+
import React4, { Children as Children6, useRef as useRef13 } from "react";
|
|
3645
3917
|
|
|
3646
3918
|
// src/segmented-control/segmented-control-context.ts
|
|
3647
|
-
import { createContext as
|
|
3648
|
-
var SegmentedControlContext =
|
|
3919
|
+
import { createContext as createContext13 } from "react";
|
|
3920
|
+
var SegmentedControlContext = createContext13(null);
|
|
3649
3921
|
|
|
3650
3922
|
// src/segmented-control/segmented-control-item.tsx
|
|
3651
|
-
import { focusVisible as
|
|
3652
|
-
import { clsx as
|
|
3653
|
-
import { useContext as
|
|
3654
|
-
import { jsx as
|
|
3923
|
+
import { focusVisible as focusVisible14 } from "@zenkigen-inc/component-theme";
|
|
3924
|
+
import { clsx as clsx37 } from "clsx";
|
|
3925
|
+
import { useContext as useContext16, useEffect as useEffect11, useRef as useRef12 } from "react";
|
|
3926
|
+
import { jsx as jsx56, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
3655
3927
|
var SegmentedControlItem = ({
|
|
3656
3928
|
label,
|
|
3657
3929
|
value,
|
|
@@ -3660,7 +3932,7 @@ var SegmentedControlItem = ({
|
|
|
3660
3932
|
"aria-label": ariaLabel,
|
|
3661
3933
|
...rest
|
|
3662
3934
|
}) => {
|
|
3663
|
-
const context =
|
|
3935
|
+
const context = useContext16(SegmentedControlContext);
|
|
3664
3936
|
const buttonRef = useRef12(null);
|
|
3665
3937
|
const lastInteractionWasMouse = useRef12(false);
|
|
3666
3938
|
if (context === null) {
|
|
@@ -3700,7 +3972,7 @@ var SegmentedControlItem = ({
|
|
|
3700
3972
|
lastInteractionWasMouse.current = false;
|
|
3701
3973
|
onBlur?.();
|
|
3702
3974
|
};
|
|
3703
|
-
const buttonClasses =
|
|
3975
|
+
const buttonClasses = clsx37("relative flex items-center justify-center gap-1 rounded", focusVisible14.normal, {
|
|
3704
3976
|
"px-2 min-h-[24px] typography-label12regular": size === "small",
|
|
3705
3977
|
"px-4 min-h-[32px] typography-label14regular": size === "medium",
|
|
3706
3978
|
// States - Default with hover
|
|
@@ -3710,7 +3982,7 @@ var SegmentedControlItem = ({
|
|
|
3710
3982
|
// States - Disabled
|
|
3711
3983
|
"text-disabled01 bg-transparent": isOptionDisabled === true
|
|
3712
3984
|
});
|
|
3713
|
-
return /* @__PURE__ */
|
|
3985
|
+
return /* @__PURE__ */ jsxs25(
|
|
3714
3986
|
"button",
|
|
3715
3987
|
{
|
|
3716
3988
|
ref: buttonRef,
|
|
@@ -3727,25 +3999,25 @@ var SegmentedControlItem = ({
|
|
|
3727
3999
|
onMouseDown: handleMouseDown,
|
|
3728
4000
|
...rest,
|
|
3729
4001
|
children: [
|
|
3730
|
-
Boolean(icon) === true && icon && /* @__PURE__ */
|
|
4002
|
+
Boolean(icon) === true && icon && /* @__PURE__ */ jsx56(
|
|
3731
4003
|
"span",
|
|
3732
4004
|
{
|
|
3733
|
-
className:
|
|
4005
|
+
className: clsx37("flex items-center", {
|
|
3734
4006
|
"fill-disabled01": isOptionDisabled === true,
|
|
3735
4007
|
"fill-interactive01": isSelected === true && isOptionDisabled === false,
|
|
3736
4008
|
"fill-icon01": isSelected === false && isOptionDisabled === false
|
|
3737
4009
|
}),
|
|
3738
|
-
children: /* @__PURE__ */
|
|
4010
|
+
children: /* @__PURE__ */ jsx56(Icon, { name: icon, size: "small" })
|
|
3739
4011
|
}
|
|
3740
4012
|
),
|
|
3741
|
-
Boolean(label) === true && /* @__PURE__ */
|
|
4013
|
+
Boolean(label) === true && /* @__PURE__ */ jsx56("span", { className: "whitespace-nowrap", children: label })
|
|
3742
4014
|
]
|
|
3743
4015
|
}
|
|
3744
4016
|
);
|
|
3745
4017
|
};
|
|
3746
4018
|
|
|
3747
4019
|
// src/segmented-control/segmented-control.tsx
|
|
3748
|
-
import { Fragment as Fragment6, jsx as
|
|
4020
|
+
import { Fragment as Fragment6, jsx as jsx57 } from "react/jsx-runtime";
|
|
3749
4021
|
var SegmentedControl = ({
|
|
3750
4022
|
children,
|
|
3751
4023
|
value,
|
|
@@ -3756,14 +4028,14 @@ var SegmentedControl = ({
|
|
|
3756
4028
|
...rest
|
|
3757
4029
|
}) => {
|
|
3758
4030
|
const containerRef = useRef13(null);
|
|
3759
|
-
const itemIds =
|
|
4031
|
+
const itemIds = Children6.toArray(children).filter((child) => {
|
|
3760
4032
|
if (!React4.isValidElement(child) || typeof child.props !== "object" || child.props === null || !("value" in child.props)) {
|
|
3761
4033
|
return false;
|
|
3762
4034
|
}
|
|
3763
4035
|
const props = child.props;
|
|
3764
4036
|
return props.isDisabled !== true;
|
|
3765
4037
|
}).map((child) => child.props.value);
|
|
3766
|
-
const childrenCount =
|
|
4038
|
+
const childrenCount = Children6.count(children);
|
|
3767
4039
|
const containerStyle = { gridTemplateColumns: `repeat(${childrenCount}, minmax(0,1fr))` };
|
|
3768
4040
|
const {
|
|
3769
4041
|
focusedValue,
|
|
@@ -3790,7 +4062,7 @@ var SegmentedControl = ({
|
|
|
3790
4062
|
onBlur: handleBlurRovingFocus,
|
|
3791
4063
|
values: itemIds
|
|
3792
4064
|
};
|
|
3793
|
-
return /* @__PURE__ */
|
|
4065
|
+
return /* @__PURE__ */ jsx57(Fragment6, { children: /* @__PURE__ */ jsx57(SegmentedControlContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsx57(
|
|
3794
4066
|
"div",
|
|
3795
4067
|
{
|
|
3796
4068
|
ref: containerRef,
|
|
@@ -3807,22 +4079,22 @@ var SegmentedControl = ({
|
|
|
3807
4079
|
SegmentedControl.Item = SegmentedControlItem;
|
|
3808
4080
|
|
|
3809
4081
|
// src/select-sort/select-sort.tsx
|
|
3810
|
-
import { buttonColors as buttonColors4, focusVisible as
|
|
3811
|
-
import
|
|
4082
|
+
import { buttonColors as buttonColors4, focusVisible as focusVisible17 } from "@zenkigen-inc/component-theme";
|
|
4083
|
+
import clsx40 from "clsx";
|
|
3812
4084
|
import { useCallback as useCallback13, useRef as useRef14, useState as useState13 } from "react";
|
|
3813
4085
|
|
|
3814
4086
|
// src/select-sort/select-list.tsx
|
|
3815
|
-
import { focusVisible as
|
|
3816
|
-
import
|
|
4087
|
+
import { focusVisible as focusVisible16 } from "@zenkigen-inc/component-theme";
|
|
4088
|
+
import clsx39 from "clsx";
|
|
3817
4089
|
|
|
3818
4090
|
// src/select-sort/select-item.tsx
|
|
3819
|
-
import { focusVisible as
|
|
3820
|
-
import
|
|
3821
|
-
import { jsx as
|
|
4091
|
+
import { focusVisible as focusVisible15 } from "@zenkigen-inc/component-theme";
|
|
4092
|
+
import clsx38 from "clsx";
|
|
4093
|
+
import { jsx as jsx58, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
3822
4094
|
function SelectItem2({ children, isSortKey, size, onClickItem }) {
|
|
3823
|
-
const itemClasses =
|
|
4095
|
+
const itemClasses = clsx38(
|
|
3824
4096
|
"typography-label14regular flex w-full items-center px-3 hover:bg-hover02 active:bg-active02",
|
|
3825
|
-
|
|
4097
|
+
focusVisible15.inset,
|
|
3826
4098
|
{
|
|
3827
4099
|
"h-8": size !== "large",
|
|
3828
4100
|
"h-10": size === "large",
|
|
@@ -3830,16 +4102,16 @@ function SelectItem2({ children, isSortKey, size, onClickItem }) {
|
|
|
3830
4102
|
"bg-uiBackground01 fill-icon01 text-interactive02": !isSortKey
|
|
3831
4103
|
}
|
|
3832
4104
|
);
|
|
3833
|
-
return /* @__PURE__ */
|
|
3834
|
-
/* @__PURE__ */
|
|
3835
|
-
isSortKey && /* @__PURE__ */
|
|
4105
|
+
return /* @__PURE__ */ jsx58("li", { className: "flex w-full items-center", onClick: onClickItem, children: /* @__PURE__ */ jsxs26("button", { className: itemClasses, type: "button", children: [
|
|
4106
|
+
/* @__PURE__ */ jsx58("span", { className: "ml-1 mr-6", children }),
|
|
4107
|
+
isSortKey && /* @__PURE__ */ jsx58("div", { className: "ml-auto flex items-center", children: /* @__PURE__ */ jsx58(Icon, { name: "check", size: "small" }) })
|
|
3836
4108
|
] }) });
|
|
3837
4109
|
}
|
|
3838
4110
|
|
|
3839
4111
|
// src/select-sort/select-list.tsx
|
|
3840
|
-
import { jsx as
|
|
4112
|
+
import { jsx as jsx59, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
3841
4113
|
function SelectList2({ size, variant, sortOrder, onClickItem, onClickDeselect }) {
|
|
3842
|
-
const listClasses =
|
|
4114
|
+
const listClasses = clsx39(
|
|
3843
4115
|
"absolute z-dropdown w-max overflow-y-auto rounded bg-uiBackground01 py-2 shadow-floatingShadow",
|
|
3844
4116
|
{
|
|
3845
4117
|
"top-7": size === "x-small" || size === "small",
|
|
@@ -3848,23 +4120,23 @@ function SelectList2({ size, variant, sortOrder, onClickItem, onClickDeselect })
|
|
|
3848
4120
|
"border-solid border border-uiBorder01": variant === "outline"
|
|
3849
4121
|
}
|
|
3850
4122
|
);
|
|
3851
|
-
const deselectButtonClasses =
|
|
4123
|
+
const deselectButtonClasses = clsx39(
|
|
3852
4124
|
"typography-label14regular flex w-full items-center px-3 text-interactive02 hover:bg-hover02 active:bg-active02",
|
|
3853
|
-
|
|
4125
|
+
focusVisible16.inset,
|
|
3854
4126
|
{
|
|
3855
4127
|
"h-8": size !== "large",
|
|
3856
4128
|
"h-10": size === "large"
|
|
3857
4129
|
}
|
|
3858
4130
|
);
|
|
3859
|
-
return /* @__PURE__ */
|
|
3860
|
-
/* @__PURE__ */
|
|
3861
|
-
/* @__PURE__ */
|
|
3862
|
-
sortOrder !== null && onClickDeselect && /* @__PURE__ */
|
|
4131
|
+
return /* @__PURE__ */ jsxs27("ul", { className: listClasses, children: [
|
|
4132
|
+
/* @__PURE__ */ jsx59(SelectItem2, { size, isSortKey: sortOrder === "ascend", onClickItem: () => onClickItem("ascend"), children: "\u6607\u9806\u3067\u4E26\u3073\u66FF\u3048" }),
|
|
4133
|
+
/* @__PURE__ */ jsx59(SelectItem2, { size, isSortKey: sortOrder === "descend", onClickItem: () => onClickItem("descend"), children: "\u964D\u9806\u3067\u4E26\u3073\u66FF\u3048" }),
|
|
4134
|
+
sortOrder !== null && onClickDeselect && /* @__PURE__ */ jsx59("li", { children: /* @__PURE__ */ jsx59("button", { className: deselectButtonClasses, type: "button", onClick: onClickDeselect, children: "\u9078\u629E\u89E3\u9664" }) })
|
|
3863
4135
|
] });
|
|
3864
4136
|
}
|
|
3865
4137
|
|
|
3866
4138
|
// src/select-sort/select-sort.tsx
|
|
3867
|
-
import { jsx as
|
|
4139
|
+
import { jsx as jsx60, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
3868
4140
|
function SelectSort({
|
|
3869
4141
|
size = "medium",
|
|
3870
4142
|
variant = "outline",
|
|
@@ -3892,18 +4164,18 @@ function SelectSort({
|
|
|
3892
4164
|
},
|
|
3893
4165
|
[onChange]
|
|
3894
4166
|
);
|
|
3895
|
-
const wrapperClasses =
|
|
4167
|
+
const wrapperClasses = clsx40("relative flex shrink-0 items-center gap-1 rounded", {
|
|
3896
4168
|
"h-6": size === "x-small" || size === "small",
|
|
3897
4169
|
"h-8": size === "medium",
|
|
3898
4170
|
"h-10": size === "large",
|
|
3899
4171
|
"cursor-not-allowed": isDisabled
|
|
3900
4172
|
});
|
|
3901
|
-
const buttonClasses =
|
|
4173
|
+
const buttonClasses = clsx40(
|
|
3902
4174
|
"flex size-full items-center rounded",
|
|
3903
4175
|
buttonColors4[variant].hover,
|
|
3904
4176
|
buttonColors4[variant].active,
|
|
3905
4177
|
buttonColors4[variant].disabled,
|
|
3906
|
-
|
|
4178
|
+
focusVisible17.normal,
|
|
3907
4179
|
{
|
|
3908
4180
|
[buttonColors4[variant].selected]: isSortKey,
|
|
3909
4181
|
[buttonColors4[variant].base]: !isSortKey,
|
|
@@ -3912,23 +4184,23 @@ function SelectSort({
|
|
|
3912
4184
|
"pointer-events-none": isDisabled
|
|
3913
4185
|
}
|
|
3914
4186
|
);
|
|
3915
|
-
const labelClasses =
|
|
4187
|
+
const labelClasses = clsx40("truncate", {
|
|
3916
4188
|
"typography-label12regular": size === "x-small",
|
|
3917
4189
|
"typography-label14regular": size === "small" || size === "medium",
|
|
3918
4190
|
"typography-label16regular": size === "large",
|
|
3919
4191
|
"mr-1": size === "x-small",
|
|
3920
4192
|
"mr-2": size !== "x-small"
|
|
3921
4193
|
});
|
|
3922
|
-
return /* @__PURE__ */
|
|
3923
|
-
/* @__PURE__ */
|
|
3924
|
-
/* @__PURE__ */
|
|
3925
|
-
/* @__PURE__ */
|
|
4194
|
+
return /* @__PURE__ */ jsxs28("div", { className: wrapperClasses, style: { width }, ref: targetRef, children: [
|
|
4195
|
+
/* @__PURE__ */ jsxs28("button", { className: buttonClasses, type: "button", onClick: handleClickToggle, disabled: isDisabled, children: [
|
|
4196
|
+
/* @__PURE__ */ jsx60("div", { className: labelClasses, children: label }),
|
|
4197
|
+
/* @__PURE__ */ jsx60("div", { className: "ml-auto flex items-center", children: isSortKey ? /* @__PURE__ */ jsx60(
|
|
3926
4198
|
Icon,
|
|
3927
4199
|
{
|
|
3928
4200
|
name: sortOrder === "ascend" ? "arrow-up" : "arrow-down",
|
|
3929
4201
|
size: size === "large" ? "medium" : "small"
|
|
3930
4202
|
}
|
|
3931
|
-
) : /* @__PURE__ */
|
|
4203
|
+
) : /* @__PURE__ */ jsx60(
|
|
3932
4204
|
Icon,
|
|
3933
4205
|
{
|
|
3934
4206
|
name: isOptionListOpen ? "angle-small-up" : "angle-small-down",
|
|
@@ -3936,7 +4208,7 @@ function SelectSort({
|
|
|
3936
4208
|
}
|
|
3937
4209
|
) })
|
|
3938
4210
|
] }),
|
|
3939
|
-
isOptionListOpen && !isDisabled && /* @__PURE__ */
|
|
4211
|
+
isOptionListOpen && !isDisabled && /* @__PURE__ */ jsx60(
|
|
3940
4212
|
SelectList2,
|
|
3941
4213
|
{
|
|
3942
4214
|
size,
|
|
@@ -3950,10 +4222,10 @@ function SelectSort({
|
|
|
3950
4222
|
}
|
|
3951
4223
|
|
|
3952
4224
|
// src/sort-button/sort-button.tsx
|
|
3953
|
-
import { buttonColors as buttonColors5, focusVisible as
|
|
3954
|
-
import
|
|
4225
|
+
import { buttonColors as buttonColors5, focusVisible as focusVisible18 } from "@zenkigen-inc/component-theme";
|
|
4226
|
+
import clsx41 from "clsx";
|
|
3955
4227
|
import { useCallback as useCallback14 } from "react";
|
|
3956
|
-
import { jsx as
|
|
4228
|
+
import { jsx as jsx61, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
3957
4229
|
function SortButton({
|
|
3958
4230
|
size = "medium",
|
|
3959
4231
|
width,
|
|
@@ -3973,18 +4245,18 @@ function SortButton({
|
|
|
3973
4245
|
if (sortOrder === "descend") return "arrow-down";
|
|
3974
4246
|
return "angle-small-down";
|
|
3975
4247
|
};
|
|
3976
|
-
const wrapperClasses =
|
|
4248
|
+
const wrapperClasses = clsx41("relative flex shrink-0 items-center gap-1 rounded", {
|
|
3977
4249
|
"h-6": size === "x-small" || size === "small",
|
|
3978
4250
|
"h-8": size === "medium",
|
|
3979
4251
|
"h-10": size === "large",
|
|
3980
4252
|
"cursor-not-allowed": isDisabled
|
|
3981
4253
|
});
|
|
3982
|
-
const buttonClasses =
|
|
4254
|
+
const buttonClasses = clsx41(
|
|
3983
4255
|
"flex size-full items-center rounded",
|
|
3984
4256
|
buttonColors5.text.hover,
|
|
3985
4257
|
buttonColors5.text.active,
|
|
3986
4258
|
buttonColors5.text.disabled,
|
|
3987
|
-
|
|
4259
|
+
focusVisible18.normal,
|
|
3988
4260
|
{
|
|
3989
4261
|
[buttonColors5.text.selected]: !isDisabled && sortOrder !== null,
|
|
3990
4262
|
// ソート状態時は選択状態のスタイル
|
|
@@ -3995,14 +4267,14 @@ function SortButton({
|
|
|
3995
4267
|
"pointer-events-none": isDisabled
|
|
3996
4268
|
}
|
|
3997
4269
|
);
|
|
3998
|
-
const labelClasses =
|
|
4270
|
+
const labelClasses = clsx41("truncate", {
|
|
3999
4271
|
"typography-label12regular": size === "x-small",
|
|
4000
4272
|
"typography-label14regular": size === "small" || size === "medium",
|
|
4001
4273
|
"typography-label16regular": size === "large",
|
|
4002
4274
|
"mr-1": size === "x-small",
|
|
4003
4275
|
"mr-2": size !== "x-small"
|
|
4004
4276
|
});
|
|
4005
|
-
return /* @__PURE__ */
|
|
4277
|
+
return /* @__PURE__ */ jsx61("div", { className: wrapperClasses, style: { width }, children: /* @__PURE__ */ jsxs29(
|
|
4006
4278
|
"button",
|
|
4007
4279
|
{
|
|
4008
4280
|
className: buttonClasses,
|
|
@@ -4013,22 +4285,22 @@ function SortButton({
|
|
|
4013
4285
|
"aria-label": ariaLabel,
|
|
4014
4286
|
"aria-disabled": isDisabled,
|
|
4015
4287
|
children: [
|
|
4016
|
-
/* @__PURE__ */
|
|
4017
|
-
/* @__PURE__ */
|
|
4288
|
+
/* @__PURE__ */ jsx61("div", { className: labelClasses, children: label }),
|
|
4289
|
+
/* @__PURE__ */ jsx61("div", { className: "ml-auto flex items-center", children: /* @__PURE__ */ jsx61(Icon, { name: getIconName(), size: size === "large" ? "medium" : "small" }) })
|
|
4018
4290
|
]
|
|
4019
4291
|
}
|
|
4020
4292
|
) });
|
|
4021
4293
|
}
|
|
4022
4294
|
|
|
4023
4295
|
// src/steps/steps.tsx
|
|
4024
|
-
import { clsx as
|
|
4025
|
-
import { Children as
|
|
4296
|
+
import { clsx as clsx44 } from "clsx";
|
|
4297
|
+
import { Children as Children7, Fragment as Fragment7, isValidElement as isValidElement6, useId as useId7, useMemo as useMemo7, useState as useState14 } from "react";
|
|
4026
4298
|
|
|
4027
4299
|
// src/steps/steps-context.ts
|
|
4028
|
-
import { createContext as
|
|
4029
|
-
var StepsContext =
|
|
4300
|
+
import { createContext as createContext14, useContext as useContext17 } from "react";
|
|
4301
|
+
var StepsContext = createContext14(null);
|
|
4030
4302
|
function useStepsContext() {
|
|
4031
|
-
const context =
|
|
4303
|
+
const context = useContext17(StepsContext);
|
|
4032
4304
|
if (context === null) {
|
|
4033
4305
|
throw new Error("Steps.Item must be used within <Steps>");
|
|
4034
4306
|
}
|
|
@@ -4036,13 +4308,13 @@ function useStepsContext() {
|
|
|
4036
4308
|
}
|
|
4037
4309
|
|
|
4038
4310
|
// src/steps/steps-item.tsx
|
|
4039
|
-
import { clsx as
|
|
4311
|
+
import { clsx as clsx43 } from "clsx";
|
|
4040
4312
|
|
|
4041
4313
|
// src/steps/steps-item-context.ts
|
|
4042
|
-
import { createContext as
|
|
4043
|
-
var StepsItemContext =
|
|
4314
|
+
import { createContext as createContext15, useContext as useContext18 } from "react";
|
|
4315
|
+
var StepsItemContext = createContext15(null);
|
|
4044
4316
|
function useStepsItemContext() {
|
|
4045
|
-
const context =
|
|
4317
|
+
const context = useContext18(StepsItemContext);
|
|
4046
4318
|
if (context === null) {
|
|
4047
4319
|
throw new Error("Steps.Item must be rendered inside a <Steps> component");
|
|
4048
4320
|
}
|
|
@@ -4050,34 +4322,34 @@ function useStepsItemContext() {
|
|
|
4050
4322
|
}
|
|
4051
4323
|
|
|
4052
4324
|
// src/steps/steps-separator.tsx
|
|
4053
|
-
import { clsx as
|
|
4054
|
-
import { jsx as
|
|
4325
|
+
import { clsx as clsx42 } from "clsx";
|
|
4326
|
+
import { jsx as jsx62 } from "react/jsx-runtime";
|
|
4055
4327
|
function StepsSeparator({ progress }) {
|
|
4056
4328
|
const { orientation } = useStepsContext();
|
|
4057
4329
|
const isVerticalLine = orientation === "vertical";
|
|
4058
4330
|
const colorClass = progress === "completed" ? "bg-interactive01" : "bg-uiBorder01";
|
|
4059
4331
|
if (isVerticalLine) {
|
|
4060
|
-
return /* @__PURE__ */
|
|
4332
|
+
return /* @__PURE__ */ jsx62("div", { "aria-hidden": "true", className: clsx42("mx-auto h-full min-h-2 w-px", colorClass) });
|
|
4061
4333
|
}
|
|
4062
|
-
return /* @__PURE__ */
|
|
4334
|
+
return /* @__PURE__ */ jsx62("div", { "aria-hidden": "true", className: clsx42("h-px flex-1", colorClass) });
|
|
4063
4335
|
}
|
|
4064
4336
|
|
|
4065
4337
|
// src/steps/steps-item.tsx
|
|
4066
|
-
import { jsx as
|
|
4338
|
+
import { jsx as jsx63, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
4067
4339
|
var progressSrOnlyLabel = {
|
|
4068
4340
|
completed: "\u5B8C\u4E86: ",
|
|
4069
4341
|
current: "\u73FE\u5728\u306E\u30B9\u30C6\u30C3\u30D7: ",
|
|
4070
4342
|
upcoming: "\u672A\u7740\u624B: "
|
|
4071
4343
|
};
|
|
4072
4344
|
function getCircleSizeClass(size) {
|
|
4073
|
-
return
|
|
4345
|
+
return clsx43({
|
|
4074
4346
|
"size-6 typography-label12regular": size === "small",
|
|
4075
4347
|
"size-8 typography-label12regular": size === "medium",
|
|
4076
4348
|
"size-10 typography-label16regular": size === "large"
|
|
4077
4349
|
});
|
|
4078
4350
|
}
|
|
4079
4351
|
function getCircleVariantProgressClass(variant, progress) {
|
|
4080
|
-
return
|
|
4352
|
+
return clsx43({
|
|
4081
4353
|
// subtle(全 state border-transparent で box-sizing を揃える)
|
|
4082
4354
|
"bg-uiBackground02 text-text01 border-transparent": variant === "subtle" && progress === "upcoming",
|
|
4083
4355
|
"bg-activeUi text-text01 border-transparent": variant === "subtle" && progress === "current",
|
|
@@ -4089,7 +4361,7 @@ function getCircleVariantProgressClass(variant, progress) {
|
|
|
4089
4361
|
});
|
|
4090
4362
|
}
|
|
4091
4363
|
function getCircleClasses(size, variant, state) {
|
|
4092
|
-
return
|
|
4364
|
+
return clsx43(
|
|
4093
4365
|
"box-border flex items-center justify-center rounded-full border-2",
|
|
4094
4366
|
getCircleSizeClass(size),
|
|
4095
4367
|
getCircleVariantProgressClass(variant, state.progress)
|
|
@@ -4107,65 +4379,65 @@ function StepsItem({ label, description }) {
|
|
|
4107
4379
|
const { state, index, isLast, id } = useStepsItemContext();
|
|
4108
4380
|
const isCircleFilled = state.progress === "completed";
|
|
4109
4381
|
const circleClasses = getCircleClasses(size, variant, state);
|
|
4110
|
-
const checkIcon = variant === "solid" ? /* @__PURE__ */
|
|
4111
|
-
const circle = /* @__PURE__ */
|
|
4112
|
-
const labelBlock = /* @__PURE__ */
|
|
4113
|
-
/* @__PURE__ */
|
|
4382
|
+
const checkIcon = variant === "solid" ? /* @__PURE__ */ jsx63(Icon, { name: "check", size: getIconSize(size), color: "iconOnColor" }) : /* @__PURE__ */ jsx63(Icon, { name: "check", size: getIconSize(size), className: "fill-gray-gray100" });
|
|
4383
|
+
const circle = /* @__PURE__ */ jsx63("span", { "aria-hidden": "true", className: circleClasses, children: isCircleFilled ? checkIcon : /* @__PURE__ */ jsx63("span", { children: index + 1 }) });
|
|
4384
|
+
const labelBlock = /* @__PURE__ */ jsxs30("span", { className: clsx43("flex flex-col", textOrientation === "horizontal" ? "gap-1" : "items-center text-center"), children: [
|
|
4385
|
+
/* @__PURE__ */ jsxs30(
|
|
4114
4386
|
"span",
|
|
4115
4387
|
{
|
|
4116
|
-
className:
|
|
4388
|
+
className: clsx43(
|
|
4117
4389
|
"whitespace-nowrap text-text01",
|
|
4118
4390
|
size === "large" ? "typography-body16regular" : "typography-body14regular"
|
|
4119
4391
|
),
|
|
4120
4392
|
children: [
|
|
4121
|
-
/* @__PURE__ */
|
|
4393
|
+
/* @__PURE__ */ jsx63("span", { className: "sr-only", children: progressSrOnlyLabel[state.progress] }),
|
|
4122
4394
|
label
|
|
4123
4395
|
]
|
|
4124
4396
|
}
|
|
4125
4397
|
),
|
|
4126
|
-
description != null && /* @__PURE__ */
|
|
4398
|
+
description != null && /* @__PURE__ */ jsx63("span", { className: "typography-label12regular whitespace-nowrap text-text02", children: description })
|
|
4127
4399
|
] });
|
|
4128
4400
|
const ariaCurrentProps = state.progress === "current" ? { "aria-current": "step" } : {};
|
|
4129
4401
|
if (orientation === "horizontal" && textOrientation === "horizontal") {
|
|
4130
|
-
return /* @__PURE__ */
|
|
4402
|
+
return /* @__PURE__ */ jsx63("li", { ...ariaCurrentProps, id, children: /* @__PURE__ */ jsxs30("div", { className: "flex items-center gap-2", children: [
|
|
4131
4403
|
circle,
|
|
4132
4404
|
labelBlock
|
|
4133
4405
|
] }) });
|
|
4134
4406
|
}
|
|
4135
4407
|
if (orientation === "horizontal" && textOrientation === "vertical") {
|
|
4136
|
-
return /* @__PURE__ */
|
|
4408
|
+
return /* @__PURE__ */ jsx63("li", { ...ariaCurrentProps, id, children: /* @__PURE__ */ jsxs30("div", { className: "flex flex-col items-center gap-1", children: [
|
|
4137
4409
|
circle,
|
|
4138
4410
|
labelBlock
|
|
4139
4411
|
] }) });
|
|
4140
4412
|
}
|
|
4141
4413
|
if (orientation === "vertical" && textOrientation === "horizontal") {
|
|
4142
|
-
return /* @__PURE__ */
|
|
4414
|
+
return /* @__PURE__ */ jsxs30(
|
|
4143
4415
|
"li",
|
|
4144
4416
|
{
|
|
4145
4417
|
...ariaCurrentProps,
|
|
4146
|
-
className:
|
|
4418
|
+
className: clsx43(
|
|
4147
4419
|
"grid grid-cols-[min-content_1fr] grid-rows-[auto_1fr] items-center gap-x-2",
|
|
4148
4420
|
!isLast && "flex-1"
|
|
4149
4421
|
),
|
|
4150
4422
|
id,
|
|
4151
4423
|
children: [
|
|
4152
|
-
/* @__PURE__ */
|
|
4153
|
-
/* @__PURE__ */
|
|
4154
|
-
!isLast && /* @__PURE__ */
|
|
4424
|
+
/* @__PURE__ */ jsx63("div", { className: "col-start-1 row-start-1 flex items-center", children: circle }),
|
|
4425
|
+
/* @__PURE__ */ jsx63("div", { className: "col-start-2 row-start-1 flex items-center", children: labelBlock }),
|
|
4426
|
+
!isLast && /* @__PURE__ */ jsx63("div", { className: "col-start-1 row-start-2 flex items-stretch justify-center self-stretch py-2", children: /* @__PURE__ */ jsx63(StepsSeparator, { progress: state.progress }) })
|
|
4155
4427
|
]
|
|
4156
4428
|
}
|
|
4157
4429
|
);
|
|
4158
4430
|
}
|
|
4159
|
-
return /* @__PURE__ */
|
|
4431
|
+
return /* @__PURE__ */ jsxs30("li", { ...ariaCurrentProps, className: clsx43("flex flex-col items-center gap-1", !isLast && "flex-1"), id, children: [
|
|
4160
4432
|
circle,
|
|
4161
4433
|
labelBlock,
|
|
4162
|
-
!isLast && /* @__PURE__ */
|
|
4434
|
+
!isLast && /* @__PURE__ */ jsx63("div", { className: "flex flex-1 items-stretch self-stretch py-2", children: /* @__PURE__ */ jsx63(StepsSeparator, { progress: state.progress }) })
|
|
4163
4435
|
] });
|
|
4164
4436
|
}
|
|
4165
4437
|
StepsItem.displayName = "Steps.Item";
|
|
4166
4438
|
|
|
4167
4439
|
// src/steps/steps.tsx
|
|
4168
|
-
import { jsx as
|
|
4440
|
+
import { jsx as jsx64 } from "react/jsx-runtime";
|
|
4169
4441
|
function getSeparatorCellHeightClass(size) {
|
|
4170
4442
|
if (size === "small") return "h-6";
|
|
4171
4443
|
if (size === "medium") return "h-8";
|
|
@@ -4178,12 +4450,12 @@ function HorizontalSeparatorCell({
|
|
|
4178
4450
|
}) {
|
|
4179
4451
|
const heightClass = getSeparatorCellHeightClass(size);
|
|
4180
4452
|
const alignClass = textOrientation === "vertical" ? "self-start" : "";
|
|
4181
|
-
return /* @__PURE__ */
|
|
4453
|
+
return /* @__PURE__ */ jsx64("li", { "aria-hidden": "true", className: clsx44("flex items-center", heightClass, alignClass), role: "presentation", children: /* @__PURE__ */ jsx64(StepsSeparator, { progress }) });
|
|
4182
4454
|
}
|
|
4183
4455
|
function collectStepsItems(children) {
|
|
4184
4456
|
const result = [];
|
|
4185
|
-
|
|
4186
|
-
if (!
|
|
4457
|
+
Children7.toArray(children).forEach((child) => {
|
|
4458
|
+
if (!isValidElement6(child)) {
|
|
4187
4459
|
return;
|
|
4188
4460
|
}
|
|
4189
4461
|
if (child.type === StepsItem) {
|
|
@@ -4207,12 +4479,12 @@ function StepsRoot({
|
|
|
4207
4479
|
variant = "solid",
|
|
4208
4480
|
"aria-label": ariaLabel
|
|
4209
4481
|
}) {
|
|
4210
|
-
const baseId =
|
|
4482
|
+
const baseId = useId7();
|
|
4211
4483
|
const [internalStep] = useState14(defaultCurrentStep ?? 0);
|
|
4212
4484
|
const resolvedCurrentStep = currentStep ?? internalStep;
|
|
4213
|
-
const itemElements =
|
|
4485
|
+
const itemElements = useMemo7(() => collectStepsItems(children), [children]);
|
|
4214
4486
|
const stepsCount = itemElements.length;
|
|
4215
|
-
const contextValue =
|
|
4487
|
+
const contextValue = useMemo7(
|
|
4216
4488
|
() => ({
|
|
4217
4489
|
size,
|
|
4218
4490
|
orientation,
|
|
@@ -4231,13 +4503,13 @@ function StepsRoot({
|
|
|
4231
4503
|
const state = states[index] ?? { progress: "upcoming" };
|
|
4232
4504
|
const isLast = index === stepsCount - 1;
|
|
4233
4505
|
const id = `${baseId}-item-${index}`;
|
|
4234
|
-
return /* @__PURE__ */
|
|
4506
|
+
return /* @__PURE__ */ jsx64(StepsItemContext.Provider, { value: { index, state, isLast, id }, children: item }, item.key ?? `item-${index}`);
|
|
4235
4507
|
};
|
|
4236
4508
|
const renderedChildren = orientation === "horizontal" ? itemElements.flatMap((item, index) => {
|
|
4237
4509
|
const nodes = [wrapItem(item, index)];
|
|
4238
4510
|
if (index < stepsCount - 1) {
|
|
4239
4511
|
nodes.push(
|
|
4240
|
-
/* @__PURE__ */
|
|
4512
|
+
/* @__PURE__ */ jsx64(
|
|
4241
4513
|
HorizontalSeparatorCell,
|
|
4242
4514
|
{
|
|
4243
4515
|
progress: states[index]?.progress ?? "upcoming",
|
|
@@ -4250,7 +4522,7 @@ function StepsRoot({
|
|
|
4250
4522
|
}
|
|
4251
4523
|
return nodes;
|
|
4252
4524
|
}) : itemElements.map((item, index) => wrapItem(item, index));
|
|
4253
|
-
const listClassName =
|
|
4525
|
+
const listClassName = clsx44(
|
|
4254
4526
|
orientation === "horizontal" ? ["grid w-full gap-x-2", textOrientation === "vertical" ? "items-start" : "items-center"] : "flex flex-col items-stretch"
|
|
4255
4527
|
);
|
|
4256
4528
|
const horizontalGridTemplate = Array.from(
|
|
@@ -4258,20 +4530,20 @@ function StepsRoot({
|
|
|
4258
4530
|
(_unused, index) => index === stepsCount - 1 ? "max-content" : "max-content minmax(8px, 1fr)"
|
|
4259
4531
|
).join(" ");
|
|
4260
4532
|
const listStyleProps = orientation === "horizontal" ? { style: { gridTemplateColumns: horizontalGridTemplate } } : {};
|
|
4261
|
-
return /* @__PURE__ */
|
|
4533
|
+
return /* @__PURE__ */ jsx64(StepsContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsx64("ol", { "aria-label": ariaLabel, className: listClassName, role: "list", ...listStyleProps, children: renderedChildren }) });
|
|
4262
4534
|
}
|
|
4263
4535
|
var Steps = StepsRoot;
|
|
4264
4536
|
Steps.Item = StepsItem;
|
|
4265
4537
|
|
|
4266
4538
|
// src/tab/tab.tsx
|
|
4267
|
-
import { clsx as
|
|
4268
|
-
import { Children as
|
|
4539
|
+
import { clsx as clsx46 } from "clsx";
|
|
4540
|
+
import { Children as Children8 } from "react";
|
|
4269
4541
|
|
|
4270
4542
|
// src/tab/tab-item.tsx
|
|
4271
|
-
import { clsx as
|
|
4272
|
-
import { jsx as
|
|
4543
|
+
import { clsx as clsx45 } from "clsx";
|
|
4544
|
+
import { jsx as jsx65, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
4273
4545
|
var TabItem = ({ isSelected = false, isDisabled = false, icon, ...props }) => {
|
|
4274
|
-
const classes =
|
|
4546
|
+
const classes = clsx45(
|
|
4275
4547
|
"group relative z-0 flex items-center justify-center gap-1 py-2 leading-[24px] before:absolute before:inset-x-0 before:bottom-0 before:h-[2px] hover:text-interactive01 disabled:pointer-events-none disabled:text-disabled01",
|
|
4276
4548
|
{
|
|
4277
4549
|
"typography-label14regular text-interactive02": !isSelected,
|
|
@@ -4279,12 +4551,12 @@ var TabItem = ({ isSelected = false, isDisabled = false, icon, ...props }) => {
|
|
|
4279
4551
|
"before:bg-interactive01 hover:before:bg-interactive01 pointer-events-none": isSelected
|
|
4280
4552
|
}
|
|
4281
4553
|
);
|
|
4282
|
-
const iconWrapperClasses =
|
|
4554
|
+
const iconWrapperClasses = clsx45("flex shrink-0 items-center", {
|
|
4283
4555
|
"fill-disabled01": isDisabled,
|
|
4284
4556
|
"fill-interactive01": !isDisabled && isSelected,
|
|
4285
4557
|
"fill-icon01 group-hover:fill-interactive01": !isDisabled && !isSelected
|
|
4286
4558
|
});
|
|
4287
|
-
return /* @__PURE__ */
|
|
4559
|
+
return /* @__PURE__ */ jsxs31(
|
|
4288
4560
|
"button",
|
|
4289
4561
|
{
|
|
4290
4562
|
type: "button",
|
|
@@ -4294,7 +4566,7 @@ var TabItem = ({ isSelected = false, isDisabled = false, icon, ...props }) => {
|
|
|
4294
4566
|
disabled: isDisabled,
|
|
4295
4567
|
onClick: () => props.onClick(props.id),
|
|
4296
4568
|
children: [
|
|
4297
|
-
icon != null && /* @__PURE__ */
|
|
4569
|
+
icon != null && /* @__PURE__ */ jsx65("span", { className: iconWrapperClasses, children: /* @__PURE__ */ jsx65(Icon, { name: icon, size: "small" }) }),
|
|
4298
4570
|
props.children
|
|
4299
4571
|
]
|
|
4300
4572
|
}
|
|
@@ -4302,39 +4574,39 @@ var TabItem = ({ isSelected = false, isDisabled = false, icon, ...props }) => {
|
|
|
4302
4574
|
};
|
|
4303
4575
|
|
|
4304
4576
|
// src/tab/tab.tsx
|
|
4305
|
-
import { jsx as
|
|
4577
|
+
import { jsx as jsx66 } from "react/jsx-runtime";
|
|
4306
4578
|
function Tab({ children, layout = "auto" }) {
|
|
4307
|
-
const childrenCount =
|
|
4579
|
+
const childrenCount = Children8.count(children);
|
|
4308
4580
|
const containerStyle = layout === "equal" ? { gridTemplateColumns: `repeat(${childrenCount}, minmax(0,1fr))` } : {};
|
|
4309
|
-
const containerClasses =
|
|
4581
|
+
const containerClasses = clsx46(
|
|
4310
4582
|
"relative gap-4 px-6 before:absolute before:inset-x-0 before:bottom-0 before:h-px before:bg-uiBorder01",
|
|
4311
4583
|
{
|
|
4312
4584
|
flex: layout === "auto",
|
|
4313
4585
|
grid: layout === "equal"
|
|
4314
4586
|
}
|
|
4315
4587
|
);
|
|
4316
|
-
return /* @__PURE__ */
|
|
4588
|
+
return /* @__PURE__ */ jsx66("div", { role: "tablist", className: containerClasses, style: containerStyle, children });
|
|
4317
4589
|
}
|
|
4318
4590
|
Tab.Item = TabItem;
|
|
4319
4591
|
|
|
4320
4592
|
// src/table/table-cell.tsx
|
|
4321
|
-
import
|
|
4322
|
-
import { jsx as
|
|
4593
|
+
import clsx47 from "clsx";
|
|
4594
|
+
import { jsx as jsx67 } from "react/jsx-runtime";
|
|
4323
4595
|
function TableCell({ children, className, isHeader = false }) {
|
|
4324
|
-
const classes =
|
|
4325
|
-
return /* @__PURE__ */
|
|
4596
|
+
const classes = clsx47("border-b border-uiBorder01", { "sticky top-0 z-10 bg-white": isHeader }, className);
|
|
4597
|
+
return /* @__PURE__ */ jsx67("div", { className: classes, children });
|
|
4326
4598
|
}
|
|
4327
4599
|
|
|
4328
4600
|
// src/table/table-row.tsx
|
|
4329
|
-
import
|
|
4330
|
-
import { jsx as
|
|
4601
|
+
import clsx48 from "clsx";
|
|
4602
|
+
import { jsx as jsx68 } from "react/jsx-runtime";
|
|
4331
4603
|
function TableRow({ children, isHoverBackgroundVisible = false }) {
|
|
4332
|
-
const rowClasses =
|
|
4333
|
-
return /* @__PURE__ */
|
|
4604
|
+
const rowClasses = clsx48("contents", isHoverBackgroundVisible && "[&:hover>div]:bg-hoverUi02");
|
|
4605
|
+
return /* @__PURE__ */ jsx68("div", { className: rowClasses, children });
|
|
4334
4606
|
}
|
|
4335
4607
|
|
|
4336
4608
|
// src/table/table.tsx
|
|
4337
|
-
import { jsx as
|
|
4609
|
+
import { jsx as jsx69 } from "react/jsx-runtime";
|
|
4338
4610
|
function Table({
|
|
4339
4611
|
width,
|
|
4340
4612
|
templateRows,
|
|
@@ -4343,7 +4615,7 @@ function Table({
|
|
|
4343
4615
|
autoRows,
|
|
4344
4616
|
children
|
|
4345
4617
|
}) {
|
|
4346
|
-
return /* @__PURE__ */
|
|
4618
|
+
return /* @__PURE__ */ jsx69(
|
|
4347
4619
|
"div",
|
|
4348
4620
|
{
|
|
4349
4621
|
className: "grid",
|
|
@@ -4363,22 +4635,22 @@ Table.Cell = TableCell;
|
|
|
4363
4635
|
|
|
4364
4636
|
// src/tag/tag.tsx
|
|
4365
4637
|
import { tagColors, tagLightColors } from "@zenkigen-inc/component-theme";
|
|
4366
|
-
import
|
|
4638
|
+
import clsx50 from "clsx";
|
|
4367
4639
|
|
|
4368
4640
|
// src/tag/delete-icon.tsx
|
|
4369
|
-
import { focusVisible as
|
|
4370
|
-
import
|
|
4371
|
-
import { jsx as
|
|
4641
|
+
import { focusVisible as focusVisible19 } from "@zenkigen-inc/component-theme";
|
|
4642
|
+
import clsx49 from "clsx";
|
|
4643
|
+
import { jsx as jsx70 } from "react/jsx-runtime";
|
|
4372
4644
|
var DeleteIcon = ({ color, variant, onClick }) => {
|
|
4373
|
-
const deleteButtonClasses =
|
|
4645
|
+
const deleteButtonClasses = clsx49(
|
|
4374
4646
|
"group ml-2 size-[14px] rounded-full p-0.5 hover:cursor-pointer hover:bg-iconOnColor focus-visible:bg-iconOnColor",
|
|
4375
|
-
|
|
4647
|
+
focusVisible19.normal
|
|
4376
4648
|
);
|
|
4377
|
-
const deletePathClasses =
|
|
4649
|
+
const deletePathClasses = clsx49({
|
|
4378
4650
|
"fill-interactive02": color === "gray" || variant === "light",
|
|
4379
4651
|
"group-hover:fill-interactive02 group-focus-visible:fill-interactive02 fill-iconOnColor": color !== "gray"
|
|
4380
4652
|
});
|
|
4381
|
-
return /* @__PURE__ */
|
|
4653
|
+
return /* @__PURE__ */ jsx70("button", { type: "button", className: deleteButtonClasses, onClick, children: /* @__PURE__ */ jsx70("svg", { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ jsx70(
|
|
4382
4654
|
"path",
|
|
4383
4655
|
{
|
|
4384
4656
|
fillRule: "evenodd",
|
|
@@ -4390,9 +4662,9 @@ var DeleteIcon = ({ color, variant, onClick }) => {
|
|
|
4390
4662
|
};
|
|
4391
4663
|
|
|
4392
4664
|
// src/tag/tag.tsx
|
|
4393
|
-
import { jsx as
|
|
4665
|
+
import { jsx as jsx71, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
4394
4666
|
function Tag({ id, children, color, variant = "normal", size = "medium", isEditable, onDelete }) {
|
|
4395
|
-
const wrapperClasses =
|
|
4667
|
+
const wrapperClasses = clsx50("flex", "items-center", "justify-center", {
|
|
4396
4668
|
[tagColors[color]]: variant === "normal",
|
|
4397
4669
|
[tagLightColors[color]]: variant === "light",
|
|
4398
4670
|
"h-[14px] typography-label11regular": !isEditable && size === "x-small",
|
|
@@ -4403,21 +4675,21 @@ function Tag({ id, children, color, variant = "normal", size = "medium", isEdita
|
|
|
4403
4675
|
"px-1": !isEditable,
|
|
4404
4676
|
"px-2": isEditable
|
|
4405
4677
|
});
|
|
4406
|
-
return /* @__PURE__ */
|
|
4678
|
+
return /* @__PURE__ */ jsxs32("div", { className: wrapperClasses, children: [
|
|
4407
4679
|
children,
|
|
4408
|
-
isEditable ? /* @__PURE__ */
|
|
4680
|
+
isEditable ? /* @__PURE__ */ jsx71(DeleteIcon, { onClick: () => onDelete(id), color, variant }) : null
|
|
4409
4681
|
] });
|
|
4410
4682
|
}
|
|
4411
4683
|
|
|
4412
4684
|
// src/text-area/text-area.tsx
|
|
4413
|
-
import { clsx as
|
|
4414
|
-
import { Children as
|
|
4685
|
+
import { clsx as clsx53 } from "clsx";
|
|
4686
|
+
import { Children as Children9, cloneElement as cloneElement6, forwardRef as forwardRef15, isValidElement as isValidElement7, useId as useId8, useMemo as useMemo8 } from "react";
|
|
4415
4687
|
|
|
4416
4688
|
// src/text-area/text-area-context.tsx
|
|
4417
|
-
import { createContext as
|
|
4418
|
-
var TextAreaCompoundContext =
|
|
4689
|
+
import { createContext as createContext16, useContext as useContext19 } from "react";
|
|
4690
|
+
var TextAreaCompoundContext = createContext16(null);
|
|
4419
4691
|
var useTextAreaCompoundContext = (componentName) => {
|
|
4420
|
-
const context =
|
|
4692
|
+
const context = useContext19(TextAreaCompoundContext);
|
|
4421
4693
|
if (context == null) {
|
|
4422
4694
|
throw new Error(`${componentName} \u3092\u4F7F\u7528\u3059\u308B\u306B\u306F TextArea \u306E\u5B50\u8981\u7D20\u3068\u3057\u3066\u914D\u7F6E\u3059\u308B\u5FC5\u8981\u304C\u3042\u308B\u3002`);
|
|
4423
4695
|
}
|
|
@@ -4425,9 +4697,9 @@ var useTextAreaCompoundContext = (componentName) => {
|
|
|
4425
4697
|
};
|
|
4426
4698
|
|
|
4427
4699
|
// src/text-area/text-area-error-message.tsx
|
|
4428
|
-
import { clsx as
|
|
4700
|
+
import { clsx as clsx51 } from "clsx";
|
|
4429
4701
|
import { forwardRef as forwardRef13 } from "react";
|
|
4430
|
-
import { jsx as
|
|
4702
|
+
import { jsx as jsx72 } from "react/jsx-runtime";
|
|
4431
4703
|
var TextAreaErrorMessage = forwardRef13(
|
|
4432
4704
|
({ "aria-live": ariaLive = "assertive", ...props }, ref) => {
|
|
4433
4705
|
const { textAreaProps } = useTextAreaCompoundContext("TextArea.ErrorMessage");
|
|
@@ -4436,26 +4708,26 @@ var TextAreaErrorMessage = forwardRef13(
|
|
|
4436
4708
|
if (!shouldRender) {
|
|
4437
4709
|
return null;
|
|
4438
4710
|
}
|
|
4439
|
-
const errorMessageClassName =
|
|
4440
|
-
return /* @__PURE__ */
|
|
4711
|
+
const errorMessageClassName = clsx51(typographyClass, "text-supportError");
|
|
4712
|
+
return /* @__PURE__ */ jsx72("div", { ref, className: errorMessageClassName, "aria-live": ariaLive, ...props });
|
|
4441
4713
|
}
|
|
4442
4714
|
);
|
|
4443
4715
|
TextAreaErrorMessage.displayName = "TextArea.ErrorMessage";
|
|
4444
4716
|
|
|
4445
4717
|
// src/text-area/text-area-helper-message.tsx
|
|
4446
|
-
import { clsx as
|
|
4718
|
+
import { clsx as clsx52 } from "clsx";
|
|
4447
4719
|
import { forwardRef as forwardRef14 } from "react";
|
|
4448
|
-
import { jsx as
|
|
4720
|
+
import { jsx as jsx73 } from "react/jsx-runtime";
|
|
4449
4721
|
var TextAreaHelperMessage = forwardRef14((props, ref) => {
|
|
4450
4722
|
const { textAreaProps } = useTextAreaCompoundContext("TextArea.HelperMessage");
|
|
4451
4723
|
const typographyClass = textAreaProps.size === "large" ? "typography-label13regular" : "typography-label12regular";
|
|
4452
|
-
const helperMessageClassName =
|
|
4453
|
-
return /* @__PURE__ */
|
|
4724
|
+
const helperMessageClassName = clsx52(typographyClass, "text-text02");
|
|
4725
|
+
return /* @__PURE__ */ jsx73("div", { ref, className: helperMessageClassName, ...props });
|
|
4454
4726
|
});
|
|
4455
4727
|
TextAreaHelperMessage.displayName = "TextArea.HelperMessage";
|
|
4456
4728
|
|
|
4457
4729
|
// src/text-area/text-area.tsx
|
|
4458
|
-
import { jsx as
|
|
4730
|
+
import { jsx as jsx74, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
4459
4731
|
function TextAreaInner({
|
|
4460
4732
|
size = "medium",
|
|
4461
4733
|
variant = "outline",
|
|
@@ -4472,8 +4744,8 @@ function TextAreaInner({
|
|
|
4472
4744
|
maxLength,
|
|
4473
4745
|
...props
|
|
4474
4746
|
}, ref) {
|
|
4475
|
-
const autoGeneratedId =
|
|
4476
|
-
const textAreaPropsForContext =
|
|
4747
|
+
const autoGeneratedId = useId8();
|
|
4748
|
+
const textAreaPropsForContext = useMemo8(
|
|
4477
4749
|
() => ({
|
|
4478
4750
|
size,
|
|
4479
4751
|
variant,
|
|
@@ -4481,7 +4753,7 @@ function TextAreaInner({
|
|
|
4481
4753
|
}),
|
|
4482
4754
|
[size, variant, isError]
|
|
4483
4755
|
);
|
|
4484
|
-
const contextValue =
|
|
4756
|
+
const contextValue = useMemo8(
|
|
4485
4757
|
() => ({
|
|
4486
4758
|
textAreaProps: textAreaPropsForContext,
|
|
4487
4759
|
forwardedRef: ref
|
|
@@ -4491,21 +4763,21 @@ function TextAreaInner({
|
|
|
4491
4763
|
const helperMessageIds = [];
|
|
4492
4764
|
const errorIds = [];
|
|
4493
4765
|
const describedByBaseId = props.id ?? autoGeneratedId;
|
|
4494
|
-
const enhancedChildren =
|
|
4495
|
-
if (!
|
|
4766
|
+
const enhancedChildren = Children9.map(children, (child) => {
|
|
4767
|
+
if (!isValidElement7(child)) {
|
|
4496
4768
|
return child;
|
|
4497
4769
|
}
|
|
4498
4770
|
if (child.type === TextAreaHelperMessage) {
|
|
4499
4771
|
const helperChild = child;
|
|
4500
4772
|
const assignedId = helperChild.props.id ?? `${describedByBaseId}-helper-${helperMessageIds.length + 1}`;
|
|
4501
4773
|
helperMessageIds.push(assignedId);
|
|
4502
|
-
return
|
|
4774
|
+
return cloneElement6(helperChild, { id: assignedId });
|
|
4503
4775
|
}
|
|
4504
4776
|
if (child.type === TextAreaErrorMessage && isError) {
|
|
4505
4777
|
const errorChild = child;
|
|
4506
4778
|
const assignedId = errorChild.props.id ?? `${describedByBaseId}-error-${errorIds.length + 1}`;
|
|
4507
4779
|
errorIds.push(assignedId);
|
|
4508
|
-
return
|
|
4780
|
+
return cloneElement6(errorChild, { id: assignedId });
|
|
4509
4781
|
}
|
|
4510
4782
|
return child;
|
|
4511
4783
|
});
|
|
@@ -4532,7 +4804,7 @@ function TextAreaInner({
|
|
|
4532
4804
|
...maxLengthProps
|
|
4533
4805
|
};
|
|
4534
4806
|
const isBorderless = variant === "text";
|
|
4535
|
-
const textAreaWrapperClassName =
|
|
4807
|
+
const textAreaWrapperClassName = clsx53(
|
|
4536
4808
|
"box-border flex w-full overflow-hidden rounded border",
|
|
4537
4809
|
{
|
|
4538
4810
|
// outline variant
|
|
@@ -4548,7 +4820,7 @@ function TextAreaInner({
|
|
|
4548
4820
|
// className は variant="outline" のみ受け入れ、後方互換のため wrapper の末尾に合成(@deprecated)
|
|
4549
4821
|
!isBorderless && className
|
|
4550
4822
|
);
|
|
4551
|
-
const textAreaClassName =
|
|
4823
|
+
const textAreaClassName = clsx53("w-full border-none bg-uiBackground01 outline-none", {
|
|
4552
4824
|
// outline: 従来の padding
|
|
4553
4825
|
"typography-body14regular px-2 py-2": !isBorderless && size === "medium",
|
|
4554
4826
|
"typography-body16regular px-3 py-2": !isBorderless && size === "large",
|
|
@@ -4567,7 +4839,7 @@ function TextAreaInner({
|
|
|
4567
4839
|
"resize-none": !isResizable
|
|
4568
4840
|
});
|
|
4569
4841
|
const hasHeight = height != null && String(height).trim().length > 0;
|
|
4570
|
-
const textAreaElement = /* @__PURE__ */
|
|
4842
|
+
const textAreaElement = /* @__PURE__ */ jsx74(
|
|
4571
4843
|
"div",
|
|
4572
4844
|
{
|
|
4573
4845
|
className: textAreaWrapperClassName,
|
|
@@ -4578,7 +4850,7 @@ function TextAreaInner({
|
|
|
4578
4850
|
...!autoHeight && hasHeight && !isResizable ? { height } : {},
|
|
4579
4851
|
...autoHeight && hasHeight ? { minHeight: height } : {}
|
|
4580
4852
|
},
|
|
4581
|
-
children: /* @__PURE__ */
|
|
4853
|
+
children: /* @__PURE__ */ jsx74(
|
|
4582
4854
|
"textarea",
|
|
4583
4855
|
{
|
|
4584
4856
|
ref,
|
|
@@ -4594,11 +4866,11 @@ function TextAreaInner({
|
|
|
4594
4866
|
)
|
|
4595
4867
|
}
|
|
4596
4868
|
);
|
|
4597
|
-
const counterElement = isCounterVisible ? /* @__PURE__ */
|
|
4869
|
+
const counterElement = isCounterVisible ? /* @__PURE__ */ jsx74(
|
|
4598
4870
|
"div",
|
|
4599
4871
|
{
|
|
4600
4872
|
id: counterId,
|
|
4601
|
-
className:
|
|
4873
|
+
className: clsx53(
|
|
4602
4874
|
"shrink-0",
|
|
4603
4875
|
size === "large" ? "typography-label13regular" : "typography-label12regular",
|
|
4604
4876
|
!disabled && isExceeded ? "text-supportError" : "text-text02"
|
|
@@ -4607,17 +4879,17 @@ function TextAreaInner({
|
|
|
4607
4879
|
children: counterLimit != null ? `${currentLength}/${counterLimit}\u6587\u5B57` : `${currentLength}\u6587\u5B57`
|
|
4608
4880
|
}
|
|
4609
4881
|
) : null;
|
|
4610
|
-
const stackedChildren = enhancedChildren == null ? [] :
|
|
4882
|
+
const stackedChildren = enhancedChildren == null ? [] : Children9.toArray(enhancedChildren);
|
|
4611
4883
|
const hasMessageChildren = stackedChildren.length > 0;
|
|
4612
4884
|
const hasBottomContent = hasMessageChildren || counterElement != null;
|
|
4613
4885
|
if (!hasBottomContent) {
|
|
4614
|
-
return /* @__PURE__ */
|
|
4886
|
+
return /* @__PURE__ */ jsx74(TextAreaCompoundContext.Provider, { value: contextValue, children: textAreaElement });
|
|
4615
4887
|
}
|
|
4616
|
-
return /* @__PURE__ */
|
|
4888
|
+
return /* @__PURE__ */ jsx74(TextAreaCompoundContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsxs33("div", { className: "flex flex-col gap-2", children: [
|
|
4617
4889
|
textAreaElement,
|
|
4618
|
-
/* @__PURE__ */
|
|
4619
|
-
hasMessageChildren && /* @__PURE__ */
|
|
4620
|
-
!hasMessageChildren && counterElement != null && /* @__PURE__ */
|
|
4890
|
+
/* @__PURE__ */ jsxs33("div", { className: "flex items-start justify-between gap-2", children: [
|
|
4891
|
+
hasMessageChildren && /* @__PURE__ */ jsx74("div", { className: "flex min-w-0 flex-1 flex-col gap-2", children: stackedChildren }),
|
|
4892
|
+
!hasMessageChildren && counterElement != null && /* @__PURE__ */ jsx74("div", { className: "flex-1" }),
|
|
4621
4893
|
counterElement
|
|
4622
4894
|
] })
|
|
4623
4895
|
] }) });
|
|
@@ -4633,41 +4905,321 @@ var TextAreaBase = forwardRef15(function TextAreaBase2(props, ref) {
|
|
|
4633
4905
|
});
|
|
4634
4906
|
var TextArea = attachStatics2(TextAreaBase);
|
|
4635
4907
|
|
|
4908
|
+
// src/time-picker/time-picker.tsx
|
|
4909
|
+
import { clsx as clsx55 } from "clsx";
|
|
4910
|
+
import { Children as Children10, cloneElement as cloneElement7, Fragment as Fragment8, isValidElement as isValidElement8, useId as useId9, useMemo as useMemo9 } from "react";
|
|
4911
|
+
|
|
4912
|
+
// src/time-picker/time-picker-context.tsx
|
|
4913
|
+
import { createContext as createContext17, useContext as useContext20 } from "react";
|
|
4914
|
+
var TimePickerCompoundContext = createContext17(null);
|
|
4915
|
+
var useTimePickerCompoundContext = (componentName) => {
|
|
4916
|
+
const context = useContext20(TimePickerCompoundContext);
|
|
4917
|
+
if (context == null) {
|
|
4918
|
+
throw new Error(`${componentName} \u3092\u4F7F\u7528\u3059\u308B\u306B\u306F TimePicker \u306E\u5B50\u8981\u7D20\u3068\u3057\u3066\u914D\u7F6E\u3059\u308B\u5FC5\u8981\u304C\u3042\u308B\u3002`);
|
|
4919
|
+
}
|
|
4920
|
+
return context;
|
|
4921
|
+
};
|
|
4922
|
+
|
|
4923
|
+
// src/time-picker/time-picker-error-message.tsx
|
|
4924
|
+
import { clsx as clsx54 } from "clsx";
|
|
4925
|
+
import { forwardRef as forwardRef16 } from "react";
|
|
4926
|
+
import { jsx as jsx75 } from "react/jsx-runtime";
|
|
4927
|
+
var TimePickerErrorMessage = forwardRef16(
|
|
4928
|
+
({ "aria-live": ariaLive = "assertive", ...props }, ref) => {
|
|
4929
|
+
const { size, isError } = useTimePickerCompoundContext("TimePicker.ErrorMessage");
|
|
4930
|
+
const typographyClass = size === "large" ? "typography-label12regular" : "typography-label11regular";
|
|
4931
|
+
if (isError !== true) {
|
|
4932
|
+
return null;
|
|
4933
|
+
}
|
|
4934
|
+
const errorMessageClassName = clsx54(typographyClass, "text-supportError");
|
|
4935
|
+
return /* @__PURE__ */ jsx75("div", { ref, className: errorMessageClassName, "aria-live": ariaLive, ...props });
|
|
4936
|
+
}
|
|
4937
|
+
);
|
|
4938
|
+
TimePickerErrorMessage.displayName = "TimePicker.ErrorMessage";
|
|
4939
|
+
|
|
4940
|
+
// src/time-picker/time-picker-utils.ts
|
|
4941
|
+
var MIN_HOUR = 0;
|
|
4942
|
+
var MAX_HOUR = 23;
|
|
4943
|
+
var MIN_MINUTE = 0;
|
|
4944
|
+
var MAX_MINUTE = 59;
|
|
4945
|
+
var MINUTES_PER_HOUR = 60;
|
|
4946
|
+
var padZero = (value) => String(value).padStart(2, "0");
|
|
4947
|
+
var toTotalMinutes = (hour, minute) => hour * MINUTES_PER_HOUR + minute;
|
|
4948
|
+
var createHourOption = (hour) => ({
|
|
4949
|
+
id: `hour-${hour}`,
|
|
4950
|
+
value: String(hour),
|
|
4951
|
+
label: padZero(hour)
|
|
4952
|
+
});
|
|
4953
|
+
var createMinuteOption = (minute) => ({
|
|
4954
|
+
id: `minute-${minute}`,
|
|
4955
|
+
value: String(minute),
|
|
4956
|
+
label: padZero(minute)
|
|
4957
|
+
});
|
|
4958
|
+
var parseTime = (time) => {
|
|
4959
|
+
const match = /^(\d{1,2}):(\d{1,2})$/.exec(time);
|
|
4960
|
+
if (match == null) {
|
|
4961
|
+
return null;
|
|
4962
|
+
}
|
|
4963
|
+
const hour = Number(match[1]);
|
|
4964
|
+
const minute = Number(match[2]);
|
|
4965
|
+
if (Number.isNaN(hour) || Number.isNaN(minute)) {
|
|
4966
|
+
return null;
|
|
4967
|
+
}
|
|
4968
|
+
if (hour < MIN_HOUR || hour > MAX_HOUR || minute < MIN_MINUTE || minute > MAX_MINUTE) {
|
|
4969
|
+
return null;
|
|
4970
|
+
}
|
|
4971
|
+
return { hour, minute };
|
|
4972
|
+
};
|
|
4973
|
+
var formatTime = (value) => {
|
|
4974
|
+
if (value.hour == null || value.minute == null) {
|
|
4975
|
+
return null;
|
|
4976
|
+
}
|
|
4977
|
+
return `${padZero(value.hour)}:${padZero(value.minute)}`;
|
|
4978
|
+
};
|
|
4979
|
+
var isTimeInRange = (hour, minute, minTime, maxTime) => {
|
|
4980
|
+
const total = toTotalMinutes(hour, minute);
|
|
4981
|
+
const min = minTime != null ? parseTime(minTime) : null;
|
|
4982
|
+
const max = maxTime != null ? parseTime(maxTime) : null;
|
|
4983
|
+
if (min != null && total < toTotalMinutes(min.hour, min.minute)) {
|
|
4984
|
+
return false;
|
|
4985
|
+
}
|
|
4986
|
+
if (max != null && total > toTotalMinutes(max.hour, max.minute)) {
|
|
4987
|
+
return false;
|
|
4988
|
+
}
|
|
4989
|
+
return true;
|
|
4990
|
+
};
|
|
4991
|
+
var isMinuteAvailableForAnyHour = (minute, minTime, maxTime) => {
|
|
4992
|
+
for (let hour = MIN_HOUR; hour <= MAX_HOUR; hour += 1) {
|
|
4993
|
+
if (isTimeInRange(hour, minute, minTime, maxTime)) {
|
|
4994
|
+
return true;
|
|
4995
|
+
}
|
|
4996
|
+
}
|
|
4997
|
+
return false;
|
|
4998
|
+
};
|
|
4999
|
+
var generateMinuteOptions = (minuteStep, selectedHour, minTime, maxTime) => {
|
|
5000
|
+
const min = minTime != null ? parseTime(minTime) : null;
|
|
5001
|
+
const max = maxTime != null ? parseTime(maxTime) : null;
|
|
5002
|
+
const shouldFilterByRange = min != null || max != null;
|
|
5003
|
+
const options = [];
|
|
5004
|
+
for (let minute = MIN_MINUTE; minute <= MAX_MINUTE; minute += minuteStep) {
|
|
5005
|
+
if (shouldFilterByRange) {
|
|
5006
|
+
const isAvailable = selectedHour != null ? isTimeInRange(selectedHour, minute, minTime, maxTime) : isMinuteAvailableForAnyHour(minute, minTime, maxTime);
|
|
5007
|
+
if (!isAvailable) {
|
|
5008
|
+
continue;
|
|
5009
|
+
}
|
|
5010
|
+
}
|
|
5011
|
+
options.push(createMinuteOption(minute));
|
|
5012
|
+
}
|
|
5013
|
+
return options;
|
|
5014
|
+
};
|
|
5015
|
+
var generateHourOptions = (minuteStep, minTime, maxTime) => {
|
|
5016
|
+
const options = [];
|
|
5017
|
+
for (let hour = MIN_HOUR; hour <= MAX_HOUR; hour += 1) {
|
|
5018
|
+
if (generateMinuteOptions(minuteStep, hour, minTime, maxTime).length === 0) {
|
|
5019
|
+
continue;
|
|
5020
|
+
}
|
|
5021
|
+
options.push(createHourOption(hour));
|
|
5022
|
+
}
|
|
5023
|
+
return options;
|
|
5024
|
+
};
|
|
5025
|
+
|
|
5026
|
+
// src/time-picker/time-picker.tsx
|
|
5027
|
+
import { jsx as jsx76, jsxs as jsxs34 } from "react/jsx-runtime";
|
|
5028
|
+
var SELECT_WIDTH_BY_SIZE = {
|
|
5029
|
+
"x-small": 80,
|
|
5030
|
+
small: 80,
|
|
5031
|
+
medium: 80,
|
|
5032
|
+
large: 88
|
|
5033
|
+
};
|
|
5034
|
+
var PLACEHOLDER = "--";
|
|
5035
|
+
var HOUR_ARIA_LABEL = "\u6642";
|
|
5036
|
+
var MINUTE_ARIA_LABEL = "\u5206";
|
|
5037
|
+
var createTriggerAriaLabel = (baseLabel, selectedOption) => selectedOption != null ? `${baseLabel} ${selectedOption.label}` : baseLabel;
|
|
5038
|
+
var OPTION_LIST_MAX_HEIGHT = "250px";
|
|
5039
|
+
var TimePicker = ({
|
|
5040
|
+
value,
|
|
5041
|
+
onChange,
|
|
5042
|
+
size = "medium",
|
|
5043
|
+
minuteStep = 1,
|
|
5044
|
+
minTime,
|
|
5045
|
+
maxTime,
|
|
5046
|
+
isDisabled = false,
|
|
5047
|
+
isError = false,
|
|
5048
|
+
children
|
|
5049
|
+
}) => {
|
|
5050
|
+
const autoGeneratedId = useId9();
|
|
5051
|
+
const hourOptions = useMemo9(() => generateHourOptions(minuteStep, minTime, maxTime), [minuteStep, minTime, maxTime]);
|
|
5052
|
+
const minuteOptions = useMemo9(
|
|
5053
|
+
() => generateMinuteOptions(minuteStep, value.hour, minTime, maxTime),
|
|
5054
|
+
[minuteStep, value.hour, minTime, maxTime]
|
|
5055
|
+
);
|
|
5056
|
+
const selectedHourOption = value.hour != null ? createHourOption(value.hour) : null;
|
|
5057
|
+
const selectedMinuteOption = value.minute != null ? createMinuteOption(value.minute) : null;
|
|
5058
|
+
const handleHourChange = (option) => {
|
|
5059
|
+
const nextHour = option != null ? Number(option.value) : null;
|
|
5060
|
+
const shouldResetMinute = nextHour != null && value.minute != null && !isTimeInRange(nextHour, value.minute, minTime, maxTime);
|
|
5061
|
+
onChange({ hour: nextHour, minute: shouldResetMinute ? null : value.minute });
|
|
5062
|
+
};
|
|
5063
|
+
const handleMinuteChange = (option) => {
|
|
5064
|
+
onChange({ hour: value.hour, minute: option != null ? Number(option.value) : null });
|
|
5065
|
+
};
|
|
5066
|
+
const errorIds = [];
|
|
5067
|
+
const assignErrorIds = (nodes) => Children10.map(nodes, (child) => {
|
|
5068
|
+
if (!isValidElement8(child)) {
|
|
5069
|
+
return child;
|
|
5070
|
+
}
|
|
5071
|
+
if (child.type === Fragment8) {
|
|
5072
|
+
const fragmentChild = child;
|
|
5073
|
+
return cloneElement7(fragmentChild, {}, assignErrorIds(fragmentChild.props.children));
|
|
5074
|
+
}
|
|
5075
|
+
if (child.type === TimePickerErrorMessage && isError) {
|
|
5076
|
+
const errorChild = child;
|
|
5077
|
+
const assignedId = errorChild.props.id ?? `${autoGeneratedId}-error-${errorIds.length + 1}`;
|
|
5078
|
+
errorIds.push(assignedId);
|
|
5079
|
+
return cloneElement7(errorChild, { id: assignedId });
|
|
5080
|
+
}
|
|
5081
|
+
return child;
|
|
5082
|
+
});
|
|
5083
|
+
const enhancedChildren = assignErrorIds(children);
|
|
5084
|
+
const sharedAriaProps = errorIds.length > 0 ? { "aria-describedby": errorIds.join(" ") } : {};
|
|
5085
|
+
const separatorClasses = clsx55("text-text02", {
|
|
5086
|
+
"typography-label12regular": size === "x-small",
|
|
5087
|
+
"typography-label14regular": size === "small" || size === "medium",
|
|
5088
|
+
"typography-label16regular": size === "large"
|
|
5089
|
+
});
|
|
5090
|
+
const selectWidth = SELECT_WIDTH_BY_SIZE[size];
|
|
5091
|
+
const contextValue = useMemo9(() => ({ size, isError }), [size, isError]);
|
|
5092
|
+
const timeInputs = /* @__PURE__ */ jsxs34("div", { className: "flex items-center gap-2", children: [
|
|
5093
|
+
/* @__PURE__ */ jsx76(
|
|
5094
|
+
Select,
|
|
5095
|
+
{
|
|
5096
|
+
size,
|
|
5097
|
+
width: selectWidth,
|
|
5098
|
+
placeholder: PLACEHOLDER,
|
|
5099
|
+
selectedOption: selectedHourOption,
|
|
5100
|
+
isDisabled,
|
|
5101
|
+
isError,
|
|
5102
|
+
optionListMaxHeight: OPTION_LIST_MAX_HEIGHT,
|
|
5103
|
+
"aria-label": createTriggerAriaLabel(HOUR_ARIA_LABEL, selectedHourOption),
|
|
5104
|
+
...sharedAriaProps,
|
|
5105
|
+
onChange: handleHourChange,
|
|
5106
|
+
children: hourOptions.map((option) => /* @__PURE__ */ jsx76(Select.Option, { option }, option.id))
|
|
5107
|
+
}
|
|
5108
|
+
),
|
|
5109
|
+
/* @__PURE__ */ jsx76("span", { className: separatorClasses, children: ":" }),
|
|
5110
|
+
/* @__PURE__ */ jsx76(
|
|
5111
|
+
Select,
|
|
5112
|
+
{
|
|
5113
|
+
size,
|
|
5114
|
+
width: selectWidth,
|
|
5115
|
+
placeholder: PLACEHOLDER,
|
|
5116
|
+
selectedOption: selectedMinuteOption,
|
|
5117
|
+
isDisabled,
|
|
5118
|
+
isError,
|
|
5119
|
+
optionListMaxHeight: OPTION_LIST_MAX_HEIGHT,
|
|
5120
|
+
"aria-label": createTriggerAriaLabel(MINUTE_ARIA_LABEL, selectedMinuteOption),
|
|
5121
|
+
...sharedAriaProps,
|
|
5122
|
+
onChange: handleMinuteChange,
|
|
5123
|
+
children: minuteOptions.map((option) => /* @__PURE__ */ jsx76(Select.Option, { option }, option.id))
|
|
5124
|
+
}
|
|
5125
|
+
)
|
|
5126
|
+
] });
|
|
5127
|
+
const stackedChildren = enhancedChildren == null ? [] : Children10.toArray(enhancedChildren);
|
|
5128
|
+
const hasMessageChildren = stackedChildren.length > 0;
|
|
5129
|
+
if (!hasMessageChildren) {
|
|
5130
|
+
return /* @__PURE__ */ jsx76(TimePickerCompoundContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsx76("div", { className: "flex flex-col", children: timeInputs }) });
|
|
5131
|
+
}
|
|
5132
|
+
return /* @__PURE__ */ jsx76(TimePickerCompoundContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsxs34("div", { className: "flex flex-col gap-2", children: [
|
|
5133
|
+
timeInputs,
|
|
5134
|
+
stackedChildren
|
|
5135
|
+
] }) });
|
|
5136
|
+
};
|
|
5137
|
+
TimePicker.ErrorMessage = TimePickerErrorMessage;
|
|
5138
|
+
TimePicker.displayName = "TimePicker";
|
|
5139
|
+
|
|
4636
5140
|
// src/toast/toast.tsx
|
|
4637
|
-
import
|
|
4638
|
-
import { useCallback as useCallback15, useEffect as useEffect12, useState as useState15 } from "react";
|
|
4639
|
-
import { jsx as
|
|
5141
|
+
import { clsx as clsx56 } from "clsx";
|
|
5142
|
+
import { useCallback as useCallback15, useEffect as useEffect12, useRef as useRef15, useState as useState15 } from "react";
|
|
5143
|
+
import { jsx as jsx77, jsxs as jsxs35 } from "react/jsx-runtime";
|
|
4640
5144
|
var CLOSE_TIME_MSEC = 5e3;
|
|
5145
|
+
var REMOVAL_FALLBACK_MSEC = 1e3;
|
|
4641
5146
|
function Toast({
|
|
4642
5147
|
state = "information",
|
|
4643
5148
|
width = "auto",
|
|
5149
|
+
// 既定 false は v1.22.0 までの互換維持のため据え置き(自動クローズしない既定では、安全弁により閉じるボタンが表示される)。
|
|
5150
|
+
// 「自動クローズ・閉じるボタンなし」の新しい既定は ToastProvider が isAutoClose を明示的に渡すことで実現している。
|
|
4644
5151
|
isAutoClose = false,
|
|
4645
5152
|
isAnimation = false,
|
|
5153
|
+
hasCloseButton = false,
|
|
5154
|
+
description,
|
|
4646
5155
|
children,
|
|
4647
5156
|
onClickClose
|
|
4648
5157
|
}) {
|
|
4649
5158
|
const [isRemoving, setIsRemoving] = useState15(false);
|
|
5159
|
+
const onClickCloseRef = useRef15(onClickClose);
|
|
5160
|
+
useEffect12(() => {
|
|
5161
|
+
onClickCloseRef.current = onClickClose;
|
|
5162
|
+
}, [onClickClose]);
|
|
5163
|
+
const hasNotifiedCloseRef = useRef15(false);
|
|
5164
|
+
const notifyClose = useCallback15(() => {
|
|
5165
|
+
if (hasNotifiedCloseRef.current) {
|
|
5166
|
+
return;
|
|
5167
|
+
}
|
|
5168
|
+
hasNotifiedCloseRef.current = true;
|
|
5169
|
+
onClickCloseRef.current();
|
|
5170
|
+
}, []);
|
|
4650
5171
|
const handleClose = useCallback15(() => {
|
|
4651
5172
|
if (isAnimation) {
|
|
4652
5173
|
setIsRemoving(true);
|
|
4653
5174
|
} else {
|
|
4654
|
-
|
|
5175
|
+
notifyClose();
|
|
4655
5176
|
}
|
|
4656
|
-
}, [isAnimation,
|
|
4657
|
-
const handleAnimationEnd = (e) =>
|
|
4658
|
-
|
|
4659
|
-
|
|
4660
|
-
|
|
4661
|
-
|
|
4662
|
-
|
|
5177
|
+
}, [isAnimation, notifyClose]);
|
|
5178
|
+
const handleAnimationEnd = (e) => {
|
|
5179
|
+
if (e.target !== e.currentTarget) {
|
|
5180
|
+
return;
|
|
5181
|
+
}
|
|
5182
|
+
if (window.getComputedStyle(e.currentTarget).opacity === "0") {
|
|
5183
|
+
notifyClose();
|
|
5184
|
+
}
|
|
5185
|
+
};
|
|
5186
|
+
useEffect12(() => {
|
|
5187
|
+
if (!isAutoClose) {
|
|
5188
|
+
return;
|
|
5189
|
+
}
|
|
5190
|
+
const timer = window.setTimeout(() => {
|
|
5191
|
+
if (isAnimation) {
|
|
5192
|
+
setIsRemoving(true);
|
|
5193
|
+
} else {
|
|
5194
|
+
notifyClose();
|
|
5195
|
+
}
|
|
5196
|
+
}, CLOSE_TIME_MSEC);
|
|
5197
|
+
return () => window.clearTimeout(timer);
|
|
5198
|
+
}, [isAutoClose, isAnimation, notifyClose]);
|
|
5199
|
+
useEffect12(() => {
|
|
5200
|
+
if (!isRemoving) {
|
|
5201
|
+
return;
|
|
5202
|
+
}
|
|
5203
|
+
const fallbackTimer = window.setTimeout(notifyClose, REMOVAL_FALLBACK_MSEC);
|
|
5204
|
+
return () => window.clearTimeout(fallbackTimer);
|
|
5205
|
+
}, [isRemoving, notifyClose]);
|
|
5206
|
+
const isCloseButtonShown = hasCloseButton || !isAutoClose;
|
|
5207
|
+
const wrapperClasses = clsx56(
|
|
5208
|
+
"pointer-events-auto flex items-center gap-3 rounded border border-solid border-uiBorder01 bg-uiBackground01 p-4 shadow-floatingShadow",
|
|
5209
|
+
{
|
|
5210
|
+
["animate-toast-in"]: isAnimation && !isRemoving,
|
|
5211
|
+
["animate-toast-out opacity-0"]: isAnimation && isRemoving
|
|
5212
|
+
}
|
|
5213
|
+
);
|
|
5214
|
+
const iconClasses = clsx56("flex shrink-0 items-center", {
|
|
4663
5215
|
"fill-supportSuccess": state === "success",
|
|
4664
5216
|
"fill-supportError": state === "error",
|
|
4665
5217
|
"fill-supportWarning": state === "warning",
|
|
4666
5218
|
"fill-supportInfo": state === "information"
|
|
4667
5219
|
});
|
|
4668
|
-
const
|
|
5220
|
+
const titleClasses = clsx56("typography-body13regular break-words", {
|
|
4669
5221
|
"text-supportError": state === "error",
|
|
4670
|
-
"text-text01": state
|
|
5222
|
+
"text-text01": state !== "error"
|
|
4671
5223
|
});
|
|
4672
5224
|
const iconName = {
|
|
4673
5225
|
success: "success-filled",
|
|
@@ -4675,53 +5227,86 @@ function Toast({
|
|
|
4675
5227
|
warning: "warning",
|
|
4676
5228
|
information: "information-filled"
|
|
4677
5229
|
};
|
|
4678
|
-
|
|
4679
|
-
|
|
4680
|
-
|
|
4681
|
-
|
|
4682
|
-
|
|
4683
|
-
|
|
4684
|
-
|
|
4685
|
-
|
|
4686
|
-
|
|
4687
|
-
/* @__PURE__ */ jsx71("div", { className: iconClasses, children: /* @__PURE__ */ jsx71(Icon, { name: iconName[state] }) }),
|
|
4688
|
-
/* @__PURE__ */ jsx71("p", { className: textClasses, children }),
|
|
4689
|
-
/* @__PURE__ */ jsx71(IconButton, { icon: "close", size: "medium", variant: "text", onClick: handleClose, isNoPadding: true })
|
|
5230
|
+
return /* @__PURE__ */ jsxs35("div", { className: wrapperClasses, style: { width }, onAnimationEnd: handleAnimationEnd, children: [
|
|
5231
|
+
/* @__PURE__ */ jsxs35("div", { className: "flex min-w-0 flex-1 items-start gap-1", children: [
|
|
5232
|
+
/* @__PURE__ */ jsx77("div", { className: iconClasses, children: /* @__PURE__ */ jsx77(Icon, { name: iconName[state] }) }),
|
|
5233
|
+
/* @__PURE__ */ jsxs35("div", { className: "flex min-w-0 flex-1 flex-col gap-2 pt-[3px]", children: [
|
|
5234
|
+
/* @__PURE__ */ jsx77("p", { className: titleClasses, children }),
|
|
5235
|
+
description != null && description !== "" && /* @__PURE__ */ jsx77("p", { className: "typography-label12regular break-words text-text01", children: description })
|
|
5236
|
+
] })
|
|
5237
|
+
] }),
|
|
5238
|
+
isCloseButtonShown && /* @__PURE__ */ jsx77("div", { className: "flex shrink-0 items-center", children: /* @__PURE__ */ jsx77(IconButton, { icon: "close", size: "medium", variant: "text", isNoPadding: true, "aria-label": "\u9589\u3058\u308B", onClick: handleClose }) })
|
|
4690
5239
|
] });
|
|
4691
5240
|
}
|
|
4692
5241
|
|
|
4693
5242
|
// src/toast/toast-provider.tsx
|
|
4694
|
-
import { createContext as
|
|
5243
|
+
import { createContext as createContext18, useCallback as useCallback16, useContext as useContext21, useEffect as useEffect13, useRef as useRef16, useState as useState16 } from "react";
|
|
4695
5244
|
import { createPortal as createPortal3 } from "react-dom";
|
|
4696
|
-
import { jsx as
|
|
4697
|
-
var ToastContext =
|
|
4698
|
-
var ToastProvider = ({ children }) => {
|
|
5245
|
+
import { jsx as jsx78, jsxs as jsxs36 } from "react/jsx-runtime";
|
|
5246
|
+
var ToastContext = createContext18({});
|
|
5247
|
+
var ToastProvider = ({ children, hasCloseButton = false }) => {
|
|
4699
5248
|
const [isClientRender, setIsClientRender] = useState16(false);
|
|
4700
5249
|
const [toasts, setToasts] = useState16([]);
|
|
4701
|
-
const
|
|
4702
|
-
|
|
4703
|
-
|
|
5250
|
+
const nextIdRef = useRef16(0);
|
|
5251
|
+
const addToast = useCallback16(
|
|
5252
|
+
(args) => {
|
|
5253
|
+
nextIdRef.current += 1;
|
|
5254
|
+
const id = nextIdRef.current;
|
|
5255
|
+
setToasts((prev) => [
|
|
5256
|
+
...prev,
|
|
5257
|
+
{
|
|
5258
|
+
id,
|
|
5259
|
+
message: args.message,
|
|
5260
|
+
state: args.state,
|
|
5261
|
+
description: args.description,
|
|
5262
|
+
hasCloseButton: args.hasCloseButton ?? hasCloseButton,
|
|
5263
|
+
isAutoClose: args.isAutoClose ?? true
|
|
5264
|
+
}
|
|
5265
|
+
]);
|
|
5266
|
+
},
|
|
5267
|
+
[hasCloseButton]
|
|
5268
|
+
);
|
|
4704
5269
|
const removeToast = useCallback16((id) => {
|
|
4705
5270
|
setToasts((prev) => prev.filter((snackbar) => snackbar.id !== id));
|
|
4706
5271
|
}, []);
|
|
4707
5272
|
useEffect13(() => {
|
|
4708
5273
|
setIsClientRender(true);
|
|
4709
5274
|
}, []);
|
|
4710
|
-
return /* @__PURE__ */
|
|
5275
|
+
return /* @__PURE__ */ jsxs36(ToastContext.Provider, { value: { addToast, removeToast }, children: [
|
|
4711
5276
|
children,
|
|
4712
5277
|
isClientRender && createPortal3(
|
|
4713
|
-
/* @__PURE__ */
|
|
5278
|
+
/* @__PURE__ */ jsx78(
|
|
5279
|
+
"div",
|
|
5280
|
+
{
|
|
5281
|
+
role: "region",
|
|
5282
|
+
"aria-label": "\u901A\u77E5",
|
|
5283
|
+
className: "pointer-events-none fixed bottom-0 left-0 z-toast mb-4 ml-4 flex w-full flex-col-reverse gap-4",
|
|
5284
|
+
children: toasts.map((toast) => /* @__PURE__ */ jsx78("div", { role: toast.state === "error" ? "alert" : "status", children: /* @__PURE__ */ jsx78(
|
|
5285
|
+
Toast,
|
|
5286
|
+
{
|
|
5287
|
+
state: toast.state,
|
|
5288
|
+
description: toast.description,
|
|
5289
|
+
hasCloseButton: toast.hasCloseButton,
|
|
5290
|
+
isAutoClose: toast.isAutoClose,
|
|
5291
|
+
isAnimation: true,
|
|
5292
|
+
width: 475,
|
|
5293
|
+
onClickClose: () => removeToast(toast.id),
|
|
5294
|
+
children: toast.message
|
|
5295
|
+
}
|
|
5296
|
+
) }, toast.id))
|
|
5297
|
+
}
|
|
5298
|
+
),
|
|
4714
5299
|
document.body
|
|
4715
5300
|
)
|
|
4716
5301
|
] });
|
|
4717
5302
|
};
|
|
4718
5303
|
var useToast = () => {
|
|
4719
|
-
return
|
|
5304
|
+
return useContext21(ToastContext);
|
|
4720
5305
|
};
|
|
4721
5306
|
|
|
4722
5307
|
// src/toggle/toggle.tsx
|
|
4723
|
-
import
|
|
4724
|
-
import { jsx as
|
|
5308
|
+
import clsx57 from "clsx";
|
|
5309
|
+
import { jsx as jsx79, jsxs as jsxs37 } from "react/jsx-runtime";
|
|
4725
5310
|
function Toggle({
|
|
4726
5311
|
id,
|
|
4727
5312
|
size = "medium",
|
|
@@ -4731,7 +5316,7 @@ function Toggle({
|
|
|
4731
5316
|
labelPosition = "right",
|
|
4732
5317
|
isDisabled = false
|
|
4733
5318
|
}) {
|
|
4734
|
-
const baseClasses =
|
|
5319
|
+
const baseClasses = clsx57("relative flex items-center rounded-full", {
|
|
4735
5320
|
"bg-disabledOn": isDisabled && isChecked,
|
|
4736
5321
|
"bg-disabled01": isDisabled && !isChecked,
|
|
4737
5322
|
"bg-interactive01 peer-hover:bg-hover01": !isDisabled && isChecked,
|
|
@@ -4739,16 +5324,16 @@ function Toggle({
|
|
|
4739
5324
|
"w-8 h-4 px-[3px]": size === "small",
|
|
4740
5325
|
"w-12 h-6 px-1": size === "medium" || size === "large"
|
|
4741
5326
|
});
|
|
4742
|
-
const inputClasses =
|
|
5327
|
+
const inputClasses = clsx57(
|
|
4743
5328
|
"peer absolute inset-0 z-[1] opacity-0",
|
|
4744
5329
|
isDisabled ? "cursor-not-allowed" : "cursor-pointer"
|
|
4745
5330
|
);
|
|
4746
|
-
const indicatorClasses =
|
|
5331
|
+
const indicatorClasses = clsx57("rounded-full bg-iconOnColor", {
|
|
4747
5332
|
"w-2.5 h-2.5": size === "small",
|
|
4748
5333
|
"w-4 h-4": size === "medium" || size === "large",
|
|
4749
5334
|
"ml-auto": isChecked
|
|
4750
5335
|
});
|
|
4751
|
-
const labelClasses =
|
|
5336
|
+
const labelClasses = clsx57("break-all", {
|
|
4752
5337
|
"mr-2": labelPosition === "left",
|
|
4753
5338
|
"ml-2": labelPosition === "right",
|
|
4754
5339
|
"typography-label14regular": size === "small" || size === "medium",
|
|
@@ -4756,9 +5341,9 @@ function Toggle({
|
|
|
4756
5341
|
"pointer-events-none cursor-not-allowed text-disabled01": isDisabled,
|
|
4757
5342
|
"cursor-pointer text-text01": !isDisabled
|
|
4758
5343
|
});
|
|
4759
|
-
return /* @__PURE__ */
|
|
4760
|
-
label != null && labelPosition === "left" && /* @__PURE__ */
|
|
4761
|
-
/* @__PURE__ */
|
|
5344
|
+
return /* @__PURE__ */ jsxs37("div", { className: "relative flex flex-[0_0_auto] items-center", children: [
|
|
5345
|
+
label != null && labelPosition === "left" && /* @__PURE__ */ jsx79("label", { htmlFor: id, className: labelClasses, children: label }),
|
|
5346
|
+
/* @__PURE__ */ jsx79(
|
|
4762
5347
|
"input",
|
|
4763
5348
|
{
|
|
4764
5349
|
className: inputClasses,
|
|
@@ -4770,23 +5355,23 @@ function Toggle({
|
|
|
4770
5355
|
disabled: isDisabled
|
|
4771
5356
|
}
|
|
4772
5357
|
),
|
|
4773
|
-
/* @__PURE__ */
|
|
4774
|
-
label != null && labelPosition === "right" && /* @__PURE__ */
|
|
5358
|
+
/* @__PURE__ */ jsx79("div", { className: baseClasses, children: /* @__PURE__ */ jsx79("span", { className: indicatorClasses }) }),
|
|
5359
|
+
label != null && labelPosition === "right" && /* @__PURE__ */ jsx79("label", { htmlFor: id, className: labelClasses, children: label })
|
|
4775
5360
|
] });
|
|
4776
5361
|
}
|
|
4777
5362
|
|
|
4778
5363
|
// src/tooltip/tooltip.tsx
|
|
4779
|
-
import { useCallback as useCallback18, useEffect as useEffect14, useRef as
|
|
5364
|
+
import { useCallback as useCallback18, useEffect as useEffect14, useRef as useRef17, useState as useState17 } from "react";
|
|
4780
5365
|
import { createPortal as createPortal4 } from "react-dom";
|
|
4781
5366
|
|
|
4782
5367
|
// src/tooltip/tooltip-content.tsx
|
|
4783
|
-
import
|
|
5368
|
+
import clsx59 from "clsx";
|
|
4784
5369
|
|
|
4785
5370
|
// src/tooltip/tail-icon.tsx
|
|
4786
|
-
import
|
|
4787
|
-
import { jsx as
|
|
5371
|
+
import clsx58 from "clsx";
|
|
5372
|
+
import { jsx as jsx80 } from "react/jsx-runtime";
|
|
4788
5373
|
var TailIcon = (props) => {
|
|
4789
|
-
const tailClasses =
|
|
5374
|
+
const tailClasses = clsx58("absolute fill-uiBackgroundTooltip", {
|
|
4790
5375
|
"rotate-180": props.verticalPosition === "bottom",
|
|
4791
5376
|
"rotate-0": props.verticalPosition !== "bottom",
|
|
4792
5377
|
"-top-1": props.verticalPosition === "bottom" && props.size === "small",
|
|
@@ -4801,9 +5386,9 @@ var TailIcon = (props) => {
|
|
|
4801
5386
|
"left-1/2 -translate-x-2": props.horizontalAlign === "center" && props.size !== "small"
|
|
4802
5387
|
});
|
|
4803
5388
|
if (props.size === "small") {
|
|
4804
|
-
return /* @__PURE__ */
|
|
5389
|
+
return /* @__PURE__ */ jsx80("svg", { className: tailClasses, width: "8", height: "4", viewBox: "0 0 8 4", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ jsx80("path", { d: "M4 4L0 0H8L4 4Z" }) });
|
|
4805
5390
|
} else {
|
|
4806
|
-
return /* @__PURE__ */
|
|
5391
|
+
return /* @__PURE__ */ jsx80(
|
|
4807
5392
|
"svg",
|
|
4808
5393
|
{
|
|
4809
5394
|
className: tailClasses,
|
|
@@ -4812,14 +5397,14 @@ var TailIcon = (props) => {
|
|
|
4812
5397
|
viewBox: "0 0 14 8",
|
|
4813
5398
|
fill: "none",
|
|
4814
5399
|
xmlns: "http://www.w3.org/2000/svg",
|
|
4815
|
-
children: /* @__PURE__ */
|
|
5400
|
+
children: /* @__PURE__ */ jsx80("path", { d: "M7 8L0 0H14L7 8Z" })
|
|
4816
5401
|
}
|
|
4817
5402
|
);
|
|
4818
5403
|
}
|
|
4819
5404
|
};
|
|
4820
5405
|
|
|
4821
5406
|
// src/tooltip/tooltip-content.tsx
|
|
4822
|
-
import { jsx as
|
|
5407
|
+
import { jsx as jsx81, jsxs as jsxs38 } from "react/jsx-runtime";
|
|
4823
5408
|
var TooltipContent = ({
|
|
4824
5409
|
content,
|
|
4825
5410
|
horizontalAlign,
|
|
@@ -4829,7 +5414,7 @@ var TooltipContent = ({
|
|
|
4829
5414
|
maxWidth,
|
|
4830
5415
|
isPortal = false
|
|
4831
5416
|
}) => {
|
|
4832
|
-
const tooltipWrapperClasses =
|
|
5417
|
+
const tooltipWrapperClasses = clsx59("absolute z-tooltip m-auto flex", {
|
|
4833
5418
|
"top-0": !isPortal && verticalPosition === "top",
|
|
4834
5419
|
"bottom-0": !isPortal && verticalPosition === "bottom",
|
|
4835
5420
|
"justify-start": horizontalAlign === "left",
|
|
@@ -4838,7 +5423,7 @@ var TooltipContent = ({
|
|
|
4838
5423
|
"w-[24px]": size === "small",
|
|
4839
5424
|
"w-[46px]": size !== "small"
|
|
4840
5425
|
});
|
|
4841
|
-
const tooltipBodyClasses =
|
|
5426
|
+
const tooltipBodyClasses = clsx59(
|
|
4842
5427
|
"absolute z-tooltip inline-block w-max rounded bg-uiBackgroundTooltip text-textOnColor",
|
|
4843
5428
|
{
|
|
4844
5429
|
"typography-body12regular": size === "small",
|
|
@@ -4855,7 +5440,7 @@ var TooltipContent = ({
|
|
|
4855
5440
|
transform: `translate(${tooltipPosition.translateX}, ${tooltipPosition.translateY})`,
|
|
4856
5441
|
...tooltipPosition
|
|
4857
5442
|
} : {};
|
|
4858
|
-
return /* @__PURE__ */
|
|
5443
|
+
return /* @__PURE__ */ jsx81("div", { className: tooltipWrapperClasses, style: tooltipWrapperStyle, children: /* @__PURE__ */ jsxs38(
|
|
4859
5444
|
"div",
|
|
4860
5445
|
{
|
|
4861
5446
|
className: tooltipBodyClasses,
|
|
@@ -4864,7 +5449,7 @@ var TooltipContent = ({
|
|
|
4864
5449
|
},
|
|
4865
5450
|
children: [
|
|
4866
5451
|
content,
|
|
4867
|
-
/* @__PURE__ */
|
|
5452
|
+
/* @__PURE__ */ jsx81(TailIcon, { size, verticalPosition, horizontalAlign })
|
|
4868
5453
|
]
|
|
4869
5454
|
}
|
|
4870
5455
|
) });
|
|
@@ -4925,7 +5510,7 @@ var useTooltip = () => {
|
|
|
4925
5510
|
};
|
|
4926
5511
|
|
|
4927
5512
|
// src/tooltip/tooltip.tsx
|
|
4928
|
-
import { jsx as
|
|
5513
|
+
import { jsx as jsx82, jsxs as jsxs39 } from "react/jsx-runtime";
|
|
4929
5514
|
function Tooltip({
|
|
4930
5515
|
children,
|
|
4931
5516
|
content,
|
|
@@ -4947,7 +5532,7 @@ function Tooltip({
|
|
|
4947
5532
|
translateX: "0",
|
|
4948
5533
|
translateY: "0"
|
|
4949
5534
|
});
|
|
4950
|
-
const targetRef =
|
|
5535
|
+
const targetRef = useRef17(null);
|
|
4951
5536
|
const handleMouseOverWrapper = useCallback18(() => {
|
|
4952
5537
|
if (isDisabledHover) {
|
|
4953
5538
|
return;
|
|
@@ -4995,7 +5580,7 @@ function Tooltip({
|
|
|
4995
5580
|
window.removeEventListener("resize", updatePosition);
|
|
4996
5581
|
};
|
|
4997
5582
|
}, [isVisible, calculatePosition, maxWidth, verticalPosition, horizontalAlign, size]);
|
|
4998
|
-
return /* @__PURE__ */
|
|
5583
|
+
return /* @__PURE__ */ jsxs39(
|
|
4999
5584
|
"div",
|
|
5000
5585
|
{
|
|
5001
5586
|
ref: targetRef,
|
|
@@ -5004,7 +5589,7 @@ function Tooltip({
|
|
|
5004
5589
|
onMouseLeave: handleMouseOutWrapper,
|
|
5005
5590
|
children: [
|
|
5006
5591
|
children,
|
|
5007
|
-
isVisible && (portalTarget == null ? /* @__PURE__ */
|
|
5592
|
+
isVisible && (portalTarget == null ? /* @__PURE__ */ jsx82(
|
|
5008
5593
|
TooltipContent,
|
|
5009
5594
|
{
|
|
5010
5595
|
content,
|
|
@@ -5015,7 +5600,7 @@ function Tooltip({
|
|
|
5015
5600
|
tooltipPosition
|
|
5016
5601
|
}
|
|
5017
5602
|
) : createPortal4(
|
|
5018
|
-
/* @__PURE__ */
|
|
5603
|
+
/* @__PURE__ */ jsx82(
|
|
5019
5604
|
TooltipContent,
|
|
5020
5605
|
{
|
|
5021
5606
|
isPortal: true,
|
|
@@ -5059,6 +5644,7 @@ export {
|
|
|
5059
5644
|
PopoverTrigger,
|
|
5060
5645
|
Popup,
|
|
5061
5646
|
Radio,
|
|
5647
|
+
RadioCard,
|
|
5062
5648
|
Search,
|
|
5063
5649
|
SegmentedControl,
|
|
5064
5650
|
Select,
|
|
@@ -5073,10 +5659,13 @@ export {
|
|
|
5073
5659
|
Tag,
|
|
5074
5660
|
TextArea,
|
|
5075
5661
|
TextInput,
|
|
5662
|
+
TimePicker,
|
|
5076
5663
|
Toast,
|
|
5077
5664
|
ToastProvider,
|
|
5078
5665
|
Toggle,
|
|
5079
5666
|
Tooltip,
|
|
5667
|
+
formatTime,
|
|
5668
|
+
parseTime,
|
|
5080
5669
|
useOutsideClick,
|
|
5081
5670
|
useRovingFocus,
|
|
5082
5671
|
useToast
|