@zenkigen-inc/component-ui 1.20.1 → 1.20.4
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 +20 -9
- package/dist/index.d.ts +20 -9
- package/dist/index.js +632 -479
- package/dist/index.mjs +391 -238
- package/package.json +4 -4
package/dist/index.mjs
CHANGED
|
@@ -4,7 +4,6 @@ import { clsx as clsx2 } from "clsx";
|
|
|
4
4
|
|
|
5
5
|
// src/icon/icon.tsx
|
|
6
6
|
import { iconElements } from "@zenkigen-inc/component-icons";
|
|
7
|
-
import { iconColors } from "@zenkigen-inc/component-theme";
|
|
8
7
|
import { clsx } from "clsx";
|
|
9
8
|
import { Fragment, jsx } from "react/jsx-runtime";
|
|
10
9
|
var Icon = ({ size = "medium", isDisabled = false, ...props }) => {
|
|
@@ -12,10 +11,7 @@ var Icon = ({ size = "medium", isDisabled = false, ...props }) => {
|
|
|
12
11
|
"inline-block shrink-0",
|
|
13
12
|
{
|
|
14
13
|
"fill-disabled01": isDisabled,
|
|
15
|
-
[
|
|
16
|
-
[iconColors.icon02]: !isDisabled && props.color === "icon02",
|
|
17
|
-
[iconColors.icon03]: !isDisabled && props.color === "icon03",
|
|
18
|
-
[iconColors.iconOnColor]: !isDisabled && props.color === "iconOnColor",
|
|
14
|
+
[`fill-${props.color}`]: !isDisabled && props.color != null,
|
|
19
15
|
"w-3 h-3": size === "x-small",
|
|
20
16
|
"w-4 h-4": size === "small",
|
|
21
17
|
"w-6 h-6": size === "medium",
|
|
@@ -108,6 +104,7 @@ var createButton = (props) => {
|
|
|
108
104
|
"h-6 px-2": size === "small",
|
|
109
105
|
"h-8 px-3": size === "medium",
|
|
110
106
|
"h-10 px-4 leading-[24px]": size === "large",
|
|
107
|
+
"h-12 px-4 leading-[24px]": size === "x-large",
|
|
111
108
|
"inline-flex": elementAs === "a",
|
|
112
109
|
[buttonColors[variant].selected]: isSelected,
|
|
113
110
|
[buttonColors[variant].base]: !isSelected,
|
|
@@ -116,8 +113,8 @@ var createButton = (props) => {
|
|
|
116
113
|
"rounded-button": borderRadius == null,
|
|
117
114
|
"justify-start": justifyContent === "start",
|
|
118
115
|
"justify-center": justifyContent === "center",
|
|
119
|
-
"typography-label16regular": size === "large",
|
|
120
|
-
"typography-label14regular": size !== "large"
|
|
116
|
+
"typography-label16regular": size === "large" || size === "x-large",
|
|
117
|
+
"typography-label14regular": size !== "large" && size !== "x-large"
|
|
121
118
|
}
|
|
122
119
|
);
|
|
123
120
|
const Component = elementAs ?? "button";
|
|
@@ -136,18 +133,22 @@ var InternalButton = (props) => {
|
|
|
136
133
|
|
|
137
134
|
// src/checkbox/checkbox.tsx
|
|
138
135
|
import { focusVisible as focusVisible2 } from "@zenkigen-inc/component-theme";
|
|
139
|
-
import
|
|
136
|
+
import clsx6 from "clsx";
|
|
140
137
|
import { useCallback, useState } from "react";
|
|
141
138
|
|
|
142
139
|
// src/checkbox/checked-icon.tsx
|
|
140
|
+
import clsx4 from "clsx";
|
|
143
141
|
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
144
|
-
var CheckedIcon = () => {
|
|
142
|
+
var CheckedIcon = ({ size = "medium" }) => {
|
|
145
143
|
return /* @__PURE__ */ jsx5(
|
|
146
144
|
"svg",
|
|
147
145
|
{
|
|
148
146
|
viewBox: "0 0 20 20",
|
|
149
147
|
xmlns: "http://www.w3.org/2000/svg",
|
|
150
|
-
className: "absolute z-10
|
|
148
|
+
className: clsx4("absolute z-10 rounded-sm fill-iconOnColor hover:rounded-sm", {
|
|
149
|
+
"size-5": size === "medium",
|
|
150
|
+
"size-6": size === "large"
|
|
151
|
+
}),
|
|
151
152
|
children: /* @__PURE__ */ jsx5(
|
|
152
153
|
"path",
|
|
153
154
|
{
|
|
@@ -161,14 +162,18 @@ var CheckedIcon = () => {
|
|
|
161
162
|
};
|
|
162
163
|
|
|
163
164
|
// src/checkbox/minus-icon.tsx
|
|
165
|
+
import clsx5 from "clsx";
|
|
164
166
|
import { jsx as jsx6 } from "react/jsx-runtime";
|
|
165
|
-
var MinusIcon = () => {
|
|
167
|
+
var MinusIcon = ({ size = "medium" }) => {
|
|
166
168
|
return /* @__PURE__ */ jsx6(
|
|
167
169
|
"svg",
|
|
168
170
|
{
|
|
169
171
|
viewBox: "0 0 20 20",
|
|
170
172
|
xmlns: "http://www.w3.org/2000/svg",
|
|
171
|
-
className: "absolute z-10
|
|
173
|
+
className: clsx5("absolute z-10 rounded-sm fill-iconOnColor hover:rounded-sm", {
|
|
174
|
+
"size-5": size === "medium",
|
|
175
|
+
"size-6": size === "large"
|
|
176
|
+
}),
|
|
172
177
|
children: /* @__PURE__ */ jsx6("path", { d: "M4.94723 10.5028H9.49726H10.5028H15.0528C15.3293 10.5028 15.5556 10.2766 15.5556 10C15.5556 9.72352 15.3293 9.49725 15.0528 9.49725H10.5028H9.49726H4.94723C4.67071 9.49725 4.44446 9.72352 4.44446 10C4.44446 10.2766 4.67071 10.5028 4.94723 10.5028Z" })
|
|
173
178
|
}
|
|
174
179
|
);
|
|
@@ -185,7 +190,8 @@ function Checkbox({
|
|
|
185
190
|
isDisabled = false,
|
|
186
191
|
onChange,
|
|
187
192
|
label,
|
|
188
|
-
color = "default"
|
|
193
|
+
color = "default",
|
|
194
|
+
size = "medium"
|
|
189
195
|
}) {
|
|
190
196
|
const [isMouseOver, setIsMouseOver] = useState(false);
|
|
191
197
|
const handleMouseOverInput = useCallback(() => {
|
|
@@ -198,12 +204,14 @@ function Checkbox({
|
|
|
198
204
|
(e) => !isDisabled && onChange?.(e),
|
|
199
205
|
[isDisabled, onChange]
|
|
200
206
|
);
|
|
201
|
-
const
|
|
207
|
+
const sizeBox = size === "large" ? "size-6" : "size-5";
|
|
208
|
+
const baseInputClasses = clsx6("peer absolute inset-0 z-[1] opacity-0", {
|
|
202
209
|
"cursor-not-allowed": isDisabled,
|
|
203
210
|
"cursor-pointer": !isDisabled
|
|
204
211
|
});
|
|
205
|
-
const boxClasses =
|
|
206
|
-
"inline-flex
|
|
212
|
+
const boxClasses = clsx6(
|
|
213
|
+
"inline-flex items-center justify-center rounded-sm border bg-white",
|
|
214
|
+
sizeBox,
|
|
207
215
|
focusVisible2.normalPeer,
|
|
208
216
|
{
|
|
209
217
|
"border-disabled01": isDisabled,
|
|
@@ -214,11 +222,11 @@ function Checkbox({
|
|
|
214
222
|
"border-supportError": !isDisabled && !isMouseOver && color === "error"
|
|
215
223
|
}
|
|
216
224
|
);
|
|
217
|
-
const indicatorClasses =
|
|
225
|
+
const indicatorClasses = clsx6("relative flex flex-[0_0_auto] items-center justify-center", sizeBox, {
|
|
218
226
|
"bg-disabled01": isDisabled && isChecked,
|
|
219
227
|
"border-disabled01": isDisabled
|
|
220
228
|
});
|
|
221
|
-
const afterClasses =
|
|
229
|
+
const afterClasses = clsx6("absolute inset-0 m-auto block rounded-sm", {
|
|
222
230
|
"bg-disabled01": isDisabled && isChecked,
|
|
223
231
|
"bg-hover01": !(isDisabled && isChecked) && isMouseOver,
|
|
224
232
|
"bg-interactive01": !(isDisabled && isChecked) && !isMouseOver,
|
|
@@ -229,15 +237,23 @@ function Checkbox({
|
|
|
229
237
|
"scale-0": !isChecked,
|
|
230
238
|
"scale-100": isChecked
|
|
231
239
|
});
|
|
232
|
-
const hoverIndicatorClasses =
|
|
240
|
+
const hoverIndicatorClasses = clsx6("inline-block rounded-[1px]", {
|
|
241
|
+
"size-3": size === "medium",
|
|
242
|
+
"size-4": size === "large",
|
|
233
243
|
"bg-hoverUi": !isDisabled && !isChecked && isMouseOver
|
|
234
244
|
});
|
|
235
|
-
const labelClasses =
|
|
245
|
+
const labelClasses = clsx6("ml-2 flex-[1_0_0] break-all", {
|
|
246
|
+
"typography-label14regular": size === "medium",
|
|
247
|
+
"typography-label16regular": size === "large",
|
|
236
248
|
"pointer-events-none cursor-not-allowed text-disabled01": isDisabled,
|
|
237
249
|
"cursor-pointer text-text01": !isDisabled
|
|
238
250
|
});
|
|
251
|
+
const outerWrapperClasses = clsx6("relative flex items-center justify-center", {
|
|
252
|
+
"size-6": size === "medium",
|
|
253
|
+
"h-8 w-7": size === "large"
|
|
254
|
+
});
|
|
239
255
|
return /* @__PURE__ */ jsxs2("div", { className: "flex items-center", children: [
|
|
240
|
-
/* @__PURE__ */ jsxs2("div", { className:
|
|
256
|
+
/* @__PURE__ */ jsxs2("div", { className: outerWrapperClasses, children: [
|
|
241
257
|
/* @__PURE__ */ jsx7(
|
|
242
258
|
"input",
|
|
243
259
|
{
|
|
@@ -255,8 +271,8 @@ function Checkbox({
|
|
|
255
271
|
),
|
|
256
272
|
/* @__PURE__ */ jsx7("div", { className: boxClasses, children: /* @__PURE__ */ jsxs2("div", { className: indicatorClasses, children: [
|
|
257
273
|
/* @__PURE__ */ jsxs2("span", { className: afterClasses, children: [
|
|
258
|
-
isChecked && !isIndeterminate && /* @__PURE__ */ jsx7(CheckedIcon, {}),
|
|
259
|
-
isIndeterminate && /* @__PURE__ */ jsx7(MinusIcon, {})
|
|
274
|
+
isChecked && !isIndeterminate && /* @__PURE__ */ jsx7(CheckedIcon, { size }),
|
|
275
|
+
isIndeterminate && /* @__PURE__ */ jsx7(MinusIcon, { size })
|
|
260
276
|
] }),
|
|
261
277
|
/* @__PURE__ */ jsx7("span", { className: hoverIndicatorClasses })
|
|
262
278
|
] }) })
|
|
@@ -272,17 +288,17 @@ import {
|
|
|
272
288
|
cloneElement as cloneElement3,
|
|
273
289
|
isValidElement,
|
|
274
290
|
useCallback as useCallback3,
|
|
275
|
-
useEffect as
|
|
291
|
+
useEffect as useEffect4,
|
|
276
292
|
useId,
|
|
277
293
|
useMemo as useMemo2,
|
|
278
|
-
useRef as
|
|
294
|
+
useRef as useRef4,
|
|
279
295
|
useState as useState2
|
|
280
296
|
} from "react";
|
|
281
297
|
import { DayPicker } from "react-day-picker";
|
|
282
298
|
|
|
283
299
|
// src/icon-button/icon-button.tsx
|
|
284
300
|
import { buttonColors as buttonColors2, focusVisible as focusVisible3 } from "@zenkigen-inc/component-theme";
|
|
285
|
-
import { clsx as
|
|
301
|
+
import { clsx as clsx7 } from "clsx";
|
|
286
302
|
import { jsx as jsx8 } from "react/jsx-runtime";
|
|
287
303
|
function IconButton({
|
|
288
304
|
icon,
|
|
@@ -291,10 +307,11 @@ function IconButton({
|
|
|
291
307
|
isNoPadding = false,
|
|
292
308
|
isDisabled = false,
|
|
293
309
|
isSelected = false,
|
|
310
|
+
iconColor,
|
|
294
311
|
iconAccentColor,
|
|
295
312
|
...props
|
|
296
313
|
}) {
|
|
297
|
-
const baseClasses =
|
|
314
|
+
const baseClasses = clsx7(
|
|
298
315
|
"typography-label16regular flex items-center justify-center gap-1 rounded",
|
|
299
316
|
buttonColors2[variant].hover,
|
|
300
317
|
buttonColors2[variant].active,
|
|
@@ -312,24 +329,40 @@ function IconButton({
|
|
|
312
329
|
}
|
|
313
330
|
);
|
|
314
331
|
const iconSize = size === "small" ? "small" : "medium";
|
|
332
|
+
const iconColorProps = !isSelected && iconColor ? { color: iconColor } : {};
|
|
315
333
|
const iconAccentColorProps = !isSelected && iconAccentColor ? { accentColor: iconAccentColor } : {};
|
|
316
334
|
if (props.isAnchor === true) {
|
|
317
335
|
const buttonProps = Object.fromEntries(Object.entries(props).filter(([key]) => key !== "isAnchor"));
|
|
318
|
-
return /* @__PURE__ */ jsx8("a", { className: baseClasses, ...buttonProps, children: /* @__PURE__ */ jsx8(Icon, { name: icon, size: iconSize, ...iconAccentColorProps }) });
|
|
336
|
+
return /* @__PURE__ */ jsx8("a", { className: baseClasses, ...buttonProps, children: /* @__PURE__ */ jsx8(Icon, { name: icon, size: iconSize, ...iconColorProps, ...iconAccentColorProps }) });
|
|
319
337
|
} else {
|
|
320
338
|
const buttonProps = Object.fromEntries(Object.entries(props).filter(([key]) => key !== "isAnchor"));
|
|
321
|
-
return /* @__PURE__ */ jsx8("button", { type: "button", className: baseClasses, disabled: isDisabled, ...buttonProps, children: /* @__PURE__ */ jsx8(Icon, { name: icon, size: iconSize, ...iconAccentColorProps }) });
|
|
339
|
+
return /* @__PURE__ */ jsx8("button", { type: "button", className: baseClasses, disabled: isDisabled, ...buttonProps, children: /* @__PURE__ */ jsx8(Icon, { name: icon, size: iconSize, ...iconColorProps, ...iconAccentColorProps }) });
|
|
322
340
|
}
|
|
323
341
|
}
|
|
324
342
|
|
|
325
343
|
// src/popover/popover.tsx
|
|
326
344
|
import { autoUpdate, offset, useFloating, useId as useFloatingId } from "@floating-ui/react";
|
|
327
|
-
import { useEffect as
|
|
345
|
+
import { useEffect as useEffect3, useMemo, useRef as useRef3 } from "react";
|
|
328
346
|
|
|
329
347
|
// src/popover/popover-content.tsx
|
|
330
348
|
import { FloatingPortal, useDismiss, useInteractions, useRole } from "@floating-ui/react";
|
|
331
349
|
import * as React from "react";
|
|
332
|
-
import { forwardRef, useCallback as useCallback2, useEffect, useRef } from "react";
|
|
350
|
+
import { forwardRef, useCallback as useCallback2, useEffect as useEffect2, useRef as useRef2 } from "react";
|
|
351
|
+
|
|
352
|
+
// src/hooks/use-dismiss-on-modal-open.ts
|
|
353
|
+
import { useEffect, useRef } from "react";
|
|
354
|
+
var MODAL_OPEN_EVENT = "zenkigen-modal-open";
|
|
355
|
+
var useDismissOnModalOpen = (dismiss) => {
|
|
356
|
+
const dismissRef = useRef(dismiss);
|
|
357
|
+
dismissRef.current = dismiss;
|
|
358
|
+
useEffect(() => {
|
|
359
|
+
const handler = () => {
|
|
360
|
+
dismissRef.current();
|
|
361
|
+
};
|
|
362
|
+
window.addEventListener(MODAL_OPEN_EVENT, handler);
|
|
363
|
+
return () => window.removeEventListener(MODAL_OPEN_EVENT, handler);
|
|
364
|
+
}, []);
|
|
365
|
+
};
|
|
333
366
|
|
|
334
367
|
// src/utils/react-utils.ts
|
|
335
368
|
function composeRefs(...refs) {
|
|
@@ -372,7 +405,7 @@ var PopoverContent = forwardRef(function PopoverContent2({ children }, ref) {
|
|
|
372
405
|
return true;
|
|
373
406
|
}
|
|
374
407
|
const floatingElement = floating.refs.floating.current;
|
|
375
|
-
const closestOverlay = target.closest(".z-
|
|
408
|
+
const closestOverlay = target.closest(".z-popover, .z-dropdown");
|
|
376
409
|
if (closestOverlay !== null && floatingElement instanceof Element) {
|
|
377
410
|
const isInsideOwnFloating = floatingElement.contains(closestOverlay);
|
|
378
411
|
return isInsideOwnFloating;
|
|
@@ -387,14 +420,19 @@ var PopoverContent = forwardRef(function PopoverContent2({ children }, ref) {
|
|
|
387
420
|
escapeKey: false
|
|
388
421
|
});
|
|
389
422
|
const interactions = useInteractions([dismiss, useRole(floating.context, { role: "dialog" })]);
|
|
390
|
-
|
|
423
|
+
useDismissOnModalOpen(() => {
|
|
424
|
+
if (isOpen && onClose != null) {
|
|
425
|
+
onClose({ reason: "modal-open" });
|
|
426
|
+
}
|
|
427
|
+
});
|
|
428
|
+
useEffect2(() => {
|
|
391
429
|
if (isOpen) {
|
|
392
430
|
const element = floating.refs.floating.current;
|
|
393
431
|
element?.focus?.({ preventScroll: true });
|
|
394
432
|
}
|
|
395
433
|
}, [isOpen, floating.refs.floating]);
|
|
396
|
-
const prevIsOpenRef =
|
|
397
|
-
|
|
434
|
+
const prevIsOpenRef = useRef2(isOpen);
|
|
435
|
+
useEffect2(() => {
|
|
398
436
|
const hasPreviouslyBeenOpen = prevIsOpenRef.current;
|
|
399
437
|
prevIsOpenRef.current = isOpen;
|
|
400
438
|
if (hasPreviouslyBeenOpen && !isOpen) {
|
|
@@ -481,7 +519,7 @@ function Popover({
|
|
|
481
519
|
onClose,
|
|
482
520
|
anchorRef
|
|
483
521
|
}) {
|
|
484
|
-
const triggerRef =
|
|
522
|
+
const triggerRef = useRef3(null);
|
|
485
523
|
const floating = useFloating({
|
|
486
524
|
open: isOpen,
|
|
487
525
|
onOpenChange: (open) => {
|
|
@@ -494,7 +532,7 @@ function Popover({
|
|
|
494
532
|
whileElementsMounted: autoUpdate,
|
|
495
533
|
strategy: "fixed"
|
|
496
534
|
});
|
|
497
|
-
|
|
535
|
+
useEffect3(() => {
|
|
498
536
|
if (anchorRef?.current) {
|
|
499
537
|
floating.refs.setReference(anchorRef.current);
|
|
500
538
|
}
|
|
@@ -531,11 +569,11 @@ var useDatePickerCompoundContext = (componentName) => {
|
|
|
531
569
|
|
|
532
570
|
// src/date-picker/date-picker-day-button.tsx
|
|
533
571
|
import { focusVisible as focusVisible4 } from "@zenkigen-inc/component-theme";
|
|
534
|
-
import { clsx as
|
|
572
|
+
import { clsx as clsx9 } from "clsx";
|
|
535
573
|
import { DayButton } from "react-day-picker";
|
|
536
574
|
|
|
537
575
|
// src/date-picker/date-picker-styles.ts
|
|
538
|
-
import { clsx as
|
|
576
|
+
import { clsx as clsx8 } from "clsx";
|
|
539
577
|
import { getDefaultClassNames } from "react-day-picker";
|
|
540
578
|
var defaultDayPickerClassNames = getDefaultClassNames();
|
|
541
579
|
var DAY_PICKER_FONT_SIZE = "12px";
|
|
@@ -552,7 +590,7 @@ var dayPickerStyle = {
|
|
|
552
590
|
fontWeight: 700
|
|
553
591
|
};
|
|
554
592
|
var dayPickerClassNames = {
|
|
555
|
-
month:
|
|
593
|
+
month: clsx8(defaultDayPickerClassNames.month, "flex flex-col px-[7px] py-2")
|
|
556
594
|
};
|
|
557
595
|
var dayButtonBaseClass = "relative grid size-full place-items-center rounded-full !border !border-solid";
|
|
558
596
|
|
|
@@ -572,7 +610,7 @@ var CustomDayButton = ({ day, modifiers, className, style, ...buttonProps }) =>
|
|
|
572
610
|
day,
|
|
573
611
|
modifiers,
|
|
574
612
|
style: { ...style, fontSize: DAY_PICKER_FONT_SIZE },
|
|
575
|
-
className:
|
|
613
|
+
className: clsx9(
|
|
576
614
|
className,
|
|
577
615
|
dayButtonBaseClass,
|
|
578
616
|
// 共通: フォーカスリング(有効な日のみ)
|
|
@@ -595,7 +633,7 @@ var CustomDayButton = ({ day, modifiers, className, style, ...buttonProps }) =>
|
|
|
595
633
|
};
|
|
596
634
|
|
|
597
635
|
// src/date-picker/date-picker-error-message.tsx
|
|
598
|
-
import { clsx as
|
|
636
|
+
import { clsx as clsx10 } from "clsx";
|
|
599
637
|
import { forwardRef as forwardRef3 } from "react";
|
|
600
638
|
import { jsx as jsx12 } from "react/jsx-runtime";
|
|
601
639
|
var DatePickerErrorMessage = forwardRef3(
|
|
@@ -605,14 +643,14 @@ var DatePickerErrorMessage = forwardRef3(
|
|
|
605
643
|
if (isError !== true) {
|
|
606
644
|
return null;
|
|
607
645
|
}
|
|
608
|
-
const errorMessageClassName =
|
|
646
|
+
const errorMessageClassName = clsx10(typographyClass, "text-supportError");
|
|
609
647
|
return /* @__PURE__ */ jsx12("div", { ref, className: errorMessageClassName, "aria-live": ariaLive, ...props });
|
|
610
648
|
}
|
|
611
649
|
);
|
|
612
650
|
DatePickerErrorMessage.displayName = "DatePicker.ErrorMessage";
|
|
613
651
|
|
|
614
652
|
// src/date-picker/date-picker-month-caption.tsx
|
|
615
|
-
import { clsx as
|
|
653
|
+
import { clsx as clsx11 } from "clsx";
|
|
616
654
|
import { useDayPicker } from "react-day-picker";
|
|
617
655
|
|
|
618
656
|
// src/date-picker/date-picker-utils.ts
|
|
@@ -686,7 +724,7 @@ var CustomMonthCaption = ({ calendarMonth, className, displayIndex, style, ...pr
|
|
|
686
724
|
return /* @__PURE__ */ jsxs3(
|
|
687
725
|
"div",
|
|
688
726
|
{
|
|
689
|
-
className:
|
|
727
|
+
className: clsx11("flex items-center justify-between px-1 pb-0.5", className),
|
|
690
728
|
style: { ...style, fontSize: "inherit", fontWeight: "inherit" },
|
|
691
729
|
...props,
|
|
692
730
|
children: [
|
|
@@ -719,14 +757,14 @@ var CustomMonthCaption = ({ calendarMonth, className, displayIndex, style, ...pr
|
|
|
719
757
|
};
|
|
720
758
|
|
|
721
759
|
// src/date-picker/date-picker-weekday.tsx
|
|
722
|
-
import { clsx as
|
|
760
|
+
import { clsx as clsx12 } from "clsx";
|
|
723
761
|
import { jsx as jsx14 } from "react/jsx-runtime";
|
|
724
762
|
var CustomWeekday = ({ className, children, style, ...props }) => {
|
|
725
763
|
return /* @__PURE__ */ jsx14(
|
|
726
764
|
"th",
|
|
727
765
|
{
|
|
728
766
|
...props,
|
|
729
|
-
className:
|
|
767
|
+
className: clsx12(className, "m-0 size-7 p-0 text-center align-middle text-text02"),
|
|
730
768
|
style: { ...style, fontSize: "inherit", fontWeight: "bold" },
|
|
731
769
|
children
|
|
732
770
|
}
|
|
@@ -760,7 +798,7 @@ var DatePicker = ({
|
|
|
760
798
|
}
|
|
761
799
|
return getMonthStartDate(value, timeZone);
|
|
762
800
|
});
|
|
763
|
-
const calendarRef =
|
|
801
|
+
const calendarRef = useRef4(null);
|
|
764
802
|
const selectedKey = useMemo2(() => value == null ? null : formatDateKey(value, timeZone), [value, timeZone]);
|
|
765
803
|
const selectedDate = useMemo2(() => {
|
|
766
804
|
if (selectedKey == null) {
|
|
@@ -798,7 +836,7 @@ var DatePicker = ({
|
|
|
798
836
|
[isOutsideMonth, isMinMaxDisabled]
|
|
799
837
|
);
|
|
800
838
|
const todayForCalendar = useMemo2(() => createLocalDateFromKey(formatLocalDateKey()), []);
|
|
801
|
-
|
|
839
|
+
useEffect4(() => {
|
|
802
840
|
if (value == null) {
|
|
803
841
|
const todayKey = formatLocalDateKey(/* @__PURE__ */ new Date());
|
|
804
842
|
setDisplayMonth(createLocalDateFromKey(`${todayKey.slice(0, 7)}-01`));
|
|
@@ -806,7 +844,7 @@ var DatePicker = ({
|
|
|
806
844
|
}
|
|
807
845
|
setDisplayMonth(getMonthStartDate(value, timeZone));
|
|
808
846
|
}, [value, timeZone]);
|
|
809
|
-
|
|
847
|
+
useEffect4(() => {
|
|
810
848
|
if (!isOpen) {
|
|
811
849
|
return;
|
|
812
850
|
}
|
|
@@ -822,7 +860,7 @@ var DatePicker = ({
|
|
|
822
860
|
});
|
|
823
861
|
return () => cancelAnimationFrame(frame);
|
|
824
862
|
}, [displayMonth, isOpen, value]);
|
|
825
|
-
|
|
863
|
+
useEffect4(() => {
|
|
826
864
|
if (isDisabled) {
|
|
827
865
|
setIsOpen(false);
|
|
828
866
|
}
|
|
@@ -974,14 +1012,14 @@ function Divider() {
|
|
|
974
1012
|
|
|
975
1013
|
// src/dropdown/dropdown.tsx
|
|
976
1014
|
import { buttonColors as buttonColors3, focusVisible as focusVisible6 } from "@zenkigen-inc/component-theme";
|
|
977
|
-
import
|
|
978
|
-
import { useCallback as useCallback4, useRef as
|
|
1015
|
+
import clsx15 from "clsx";
|
|
1016
|
+
import { useCallback as useCallback4, useRef as useRef5, useState as useState3 } from "react";
|
|
979
1017
|
import { createPortal } from "react-dom";
|
|
980
1018
|
|
|
981
1019
|
// src/hooks/use-outside-click.ts
|
|
982
|
-
import { useEffect as
|
|
1020
|
+
import { useEffect as useEffect5 } from "react";
|
|
983
1021
|
var useOutsideClick = (ref, handler, enabled = true) => {
|
|
984
|
-
|
|
1022
|
+
useEffect5(() => {
|
|
985
1023
|
const listener = (event) => {
|
|
986
1024
|
const element = ref?.current;
|
|
987
1025
|
const target = event.target;
|
|
@@ -1012,7 +1050,7 @@ var DropdownContext = createContext3({
|
|
|
1012
1050
|
|
|
1013
1051
|
// src/dropdown/dropdown-item.tsx
|
|
1014
1052
|
import { focusVisible as focusVisible5 } from "@zenkigen-inc/component-theme";
|
|
1015
|
-
import
|
|
1053
|
+
import clsx13 from "clsx";
|
|
1016
1054
|
import { useContext as useContext3 } from "react";
|
|
1017
1055
|
import { jsx as jsx17 } from "react/jsx-runtime";
|
|
1018
1056
|
function DropdownItem({ children, color = "gray", onClick }) {
|
|
@@ -1021,7 +1059,7 @@ function DropdownItem({ children, color = "gray", onClick }) {
|
|
|
1021
1059
|
setIsVisible(false);
|
|
1022
1060
|
onClick?.(event);
|
|
1023
1061
|
};
|
|
1024
|
-
const itemClasses =
|
|
1062
|
+
const itemClasses = clsx13(
|
|
1025
1063
|
"typography-label14regular flex h-8 w-full items-center px-3 hover:bg-hover02 active:bg-active02",
|
|
1026
1064
|
focusVisible5.inset,
|
|
1027
1065
|
{
|
|
@@ -1033,7 +1071,7 @@ function DropdownItem({ children, color = "gray", onClick }) {
|
|
|
1033
1071
|
}
|
|
1034
1072
|
|
|
1035
1073
|
// src/dropdown/dropdown-menu.tsx
|
|
1036
|
-
import
|
|
1074
|
+
import clsx14 from "clsx";
|
|
1037
1075
|
import { useContext as useContext4 } from "react";
|
|
1038
1076
|
import { jsx as jsx18 } from "react/jsx-runtime";
|
|
1039
1077
|
function DropdownMenu({
|
|
@@ -1044,7 +1082,7 @@ function DropdownMenu({
|
|
|
1044
1082
|
horizontalAlign = "left"
|
|
1045
1083
|
}) {
|
|
1046
1084
|
const { isVisible, isDisabled, targetDimensions, variant, portalTargetRef } = useContext4(DropdownContext);
|
|
1047
|
-
const wrapperClasses =
|
|
1085
|
+
const wrapperClasses = clsx14("z-dropdown w-max overflow-y-auto rounded bg-uiBackground01 shadow-floatingShadow", {
|
|
1048
1086
|
absolute: !portalTargetRef,
|
|
1049
1087
|
"border-solid border border-uiBorder01": variant === "outline",
|
|
1050
1088
|
"py-1": !isNoPadding,
|
|
@@ -1085,8 +1123,13 @@ function Dropdown({
|
|
|
1085
1123
|
width: 0,
|
|
1086
1124
|
height: 0
|
|
1087
1125
|
});
|
|
1088
|
-
const targetRef =
|
|
1126
|
+
const targetRef = useRef5(null);
|
|
1089
1127
|
useOutsideClick(targetRef, () => setIsVisible(false));
|
|
1128
|
+
useDismissOnModalOpen(() => {
|
|
1129
|
+
if (isVisible) {
|
|
1130
|
+
setIsVisible(false);
|
|
1131
|
+
}
|
|
1132
|
+
});
|
|
1090
1133
|
const handleToggle = useCallback4(() => {
|
|
1091
1134
|
if (targetRef.current === null) {
|
|
1092
1135
|
return;
|
|
@@ -1103,10 +1146,10 @@ function Dropdown({
|
|
|
1103
1146
|
setIsVisible(true);
|
|
1104
1147
|
}
|
|
1105
1148
|
}, [isVisible]);
|
|
1106
|
-
const wrapperClasses =
|
|
1149
|
+
const wrapperClasses = clsx15("relative flex shrink-0 items-center gap-1 rounded", {
|
|
1107
1150
|
"cursor-not-allowed": isDisabled
|
|
1108
1151
|
});
|
|
1109
|
-
const childrenButtonClasses =
|
|
1152
|
+
const childrenButtonClasses = clsx15(
|
|
1110
1153
|
"flex items-center justify-center rounded bg-uiBackground01 p-1 hover:bg-hover02 active:bg-active02",
|
|
1111
1154
|
focusVisible6.normal,
|
|
1112
1155
|
{
|
|
@@ -1114,7 +1157,7 @@ function Dropdown({
|
|
|
1114
1157
|
"border border-uiBorder02": variant === "outline"
|
|
1115
1158
|
}
|
|
1116
1159
|
);
|
|
1117
|
-
const buttonClasses =
|
|
1160
|
+
const buttonClasses = clsx15(
|
|
1118
1161
|
"flex items-center rounded bg-uiBackground01",
|
|
1119
1162
|
buttonColors3[variant].base,
|
|
1120
1163
|
buttonColors3[variant].hover,
|
|
@@ -1128,7 +1171,7 @@ function Dropdown({
|
|
|
1128
1171
|
"h-10 px-4": size === "large"
|
|
1129
1172
|
}
|
|
1130
1173
|
);
|
|
1131
|
-
const labelClasses =
|
|
1174
|
+
const labelClasses = clsx15("flex items-center", {
|
|
1132
1175
|
"mr-1": !isArrowHidden && size === "x-small",
|
|
1133
1176
|
"mr-2": !isArrowHidden && size !== "x-small",
|
|
1134
1177
|
"typography-label12regular": size === "x-small",
|
|
@@ -1175,7 +1218,7 @@ Dropdown.Item = DropdownItem;
|
|
|
1175
1218
|
// src/evaluation-star/evaluation-star.tsx
|
|
1176
1219
|
import { iconElements as iconElements2 } from "@zenkigen-inc/component-icons";
|
|
1177
1220
|
import { focusVisible as focusVisible7 } from "@zenkigen-inc/component-theme";
|
|
1178
|
-
import
|
|
1221
|
+
import clsx16 from "clsx";
|
|
1179
1222
|
import { useCallback as useCallback5, useState as useState4 } from "react";
|
|
1180
1223
|
import { jsx as jsx20 } from "react/jsx-runtime";
|
|
1181
1224
|
function EvaluationStar({ value, isEditable = false, onChangeRating, size = "medium" }) {
|
|
@@ -1192,7 +1235,7 @@ function EvaluationStar({ value, isEditable = false, onChangeRating, size = "med
|
|
|
1192
1235
|
},
|
|
1193
1236
|
[isEditable, onChangeRating]
|
|
1194
1237
|
);
|
|
1195
|
-
const starClasses =
|
|
1238
|
+
const starClasses = clsx16(focusVisible7.inset, { "w-6 h-6": size === "large", "w-4 h-4": size === "medium" });
|
|
1196
1239
|
const renderStar = (rating) => {
|
|
1197
1240
|
const color = rating <= currentRating ? "fill-yellow-yellow50" : "fill-icon03";
|
|
1198
1241
|
const IconComponent = iconElements2["star-filled"];
|
|
@@ -1201,7 +1244,7 @@ function EvaluationStar({ value, isEditable = false, onChangeRating, size = "med
|
|
|
1201
1244
|
{
|
|
1202
1245
|
type: "button",
|
|
1203
1246
|
onClick: () => handleChangeRating(rating),
|
|
1204
|
-
className:
|
|
1247
|
+
className: clsx16(color, starClasses),
|
|
1205
1248
|
disabled: !isEditable,
|
|
1206
1249
|
children: /* @__PURE__ */ jsx20(IconComponent, {})
|
|
1207
1250
|
},
|
|
@@ -1213,8 +1256,8 @@ function EvaluationStar({ value, isEditable = false, onChangeRating, size = "med
|
|
|
1213
1256
|
}
|
|
1214
1257
|
|
|
1215
1258
|
// src/file-input/file-input.tsx
|
|
1216
|
-
import { clsx as
|
|
1217
|
-
import { forwardRef as forwardRef4, useCallback as useCallback6, useId as useId2, useImperativeHandle, useRef as
|
|
1259
|
+
import { clsx as clsx17 } from "clsx";
|
|
1260
|
+
import { forwardRef as forwardRef4, useCallback as useCallback6, useId as useId2, useImperativeHandle, useRef as useRef6, useState as useState5 } from "react";
|
|
1218
1261
|
import { Fragment as Fragment2, jsx as jsx21, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
1219
1262
|
var ERROR_TYPES = {
|
|
1220
1263
|
SIZE_TOO_LARGE: "SIZE_TOO_LARGE",
|
|
@@ -1229,7 +1272,7 @@ var FileInput = forwardRef4(
|
|
|
1229
1272
|
const size = variant === "button" ? rest.size ?? "medium" : "medium";
|
|
1230
1273
|
const [selectedFile, setSelectedFile] = useState5(null);
|
|
1231
1274
|
const [isDragOver, setIsDragOver] = useState5(false);
|
|
1232
|
-
const fileInputRef =
|
|
1275
|
+
const fileInputRef = useRef6(null);
|
|
1233
1276
|
const errorId = useId2();
|
|
1234
1277
|
const fallbackId = useId2();
|
|
1235
1278
|
const inputId = id ?? fallbackId;
|
|
@@ -1344,7 +1387,7 @@ var FileInput = forwardRef4(
|
|
|
1344
1387
|
);
|
|
1345
1388
|
const hasErrorMessages = !isDisabled && errorMessages != null && errorMessages.length > 0;
|
|
1346
1389
|
const hasErrors = !isDisabled && isError === true;
|
|
1347
|
-
const dropzoneClasses =
|
|
1390
|
+
const dropzoneClasses = clsx17(
|
|
1348
1391
|
"flex flex-1 flex-col items-center justify-center gap-4 rounded border border-dashed px-6 text-center",
|
|
1349
1392
|
selectedFile ? "py-[52px]" : "py-4",
|
|
1350
1393
|
{
|
|
@@ -1401,7 +1444,7 @@ var FileInput = forwardRef4(
|
|
|
1401
1444
|
width: "100%",
|
|
1402
1445
|
onClick: handleButtonClick,
|
|
1403
1446
|
before: /* @__PURE__ */ jsx21(Icon, { name: "upload", size: "small" }),
|
|
1404
|
-
after: /* @__PURE__ */ jsx21(Fragment2, { children: selectedFile ? /* @__PURE__ */ jsx21("span", { className:
|
|
1447
|
+
after: /* @__PURE__ */ jsx21(Fragment2, { children: selectedFile ? /* @__PURE__ */ jsx21("span", { className: clsx17("typography-label12regular truncate", !isDisabled && "text-text01"), children: selectedFile.name }) : "" }),
|
|
1405
1448
|
children: /* @__PURE__ */ jsx21("span", { className: "truncate", children: "\u30D5\u30A1\u30A4\u30EB\u3092\u9078\u629E" })
|
|
1406
1449
|
}
|
|
1407
1450
|
) }),
|
|
@@ -1448,14 +1491,14 @@ var FileInput = forwardRef4(
|
|
|
1448
1491
|
"\u3053\u3053\u306B\u30D5\u30A1\u30A4\u30EB\u3092\u30C9\u30ED\u30C3\u30D7\u3057\u3066\u304F\u3060\u3055\u3044\u3002",
|
|
1449
1492
|
/* @__PURE__ */ jsx21("br", {}),
|
|
1450
1493
|
"\u307E\u305F\u306F\u3001",
|
|
1451
|
-
/* @__PURE__ */ jsx21("span", { className:
|
|
1494
|
+
/* @__PURE__ */ jsx21("span", { className: clsx17(!isDisabled ? "text-link01" : ""), children: "\u30D5\u30A1\u30A4\u30EB\u3092\u9078\u629E" }),
|
|
1452
1495
|
"\u3057\u3066\u304F\u3060\u3055\u3044\u3002"
|
|
1453
1496
|
] }) }) }),
|
|
1454
1497
|
!selectedFile && /* @__PURE__ */ jsxs6("div", { className: "flex flex-col gap-1", children: [
|
|
1455
|
-
/* @__PURE__ */ jsx21("div", { className:
|
|
1456
|
-
/* @__PURE__ */ jsx21("div", { className:
|
|
1457
|
-
/* @__PURE__ */ jsx21("div", { className:
|
|
1458
|
-
/* @__PURE__ */ jsx21("div", { className:
|
|
1498
|
+
/* @__PURE__ */ jsx21("div", { className: clsx17("typography-label11regular", isDisabled ? "text-textPlaceholder" : "text-text02"), children: "\u5BFE\u5FDC\u5F62\u5F0F" }),
|
|
1499
|
+
/* @__PURE__ */ jsx21("div", { className: clsx17("typography-body12regular", isDisabled ? "text-textPlaceholder" : "text-text01"), children: acceptLabel }),
|
|
1500
|
+
/* @__PURE__ */ jsx21("div", { className: clsx17("typography-label11regular", isDisabled ? "text-textPlaceholder" : "text-text02"), children: "\u30B5\u30A4\u30BA" }),
|
|
1501
|
+
/* @__PURE__ */ jsx21("div", { className: clsx17("typography-body12regular", isDisabled ? "text-textPlaceholder" : "text-text01"), children: maxSizeLabel })
|
|
1459
1502
|
] }),
|
|
1460
1503
|
selectedFile && /* @__PURE__ */ jsxs6("div", { className: "mt-2 flex flex-col items-center gap-1", children: [
|
|
1461
1504
|
/* @__PURE__ */ jsx21("span", { className: "typography-label11regular text-text02", children: "\u30D5\u30A1\u30A4\u30EB\u540D" }),
|
|
@@ -1507,11 +1550,11 @@ FileInput.displayName = "FileInput";
|
|
|
1507
1550
|
|
|
1508
1551
|
// src/heading/heading.tsx
|
|
1509
1552
|
import { typography } from "@zenkigen-inc/component-theme";
|
|
1510
|
-
import { clsx as
|
|
1553
|
+
import { clsx as clsx18 } from "clsx";
|
|
1511
1554
|
import { jsxs as jsxs7 } from "react/jsx-runtime";
|
|
1512
1555
|
function Heading(props) {
|
|
1513
1556
|
const TagName = `h${props.level}`;
|
|
1514
|
-
const classes =
|
|
1557
|
+
const classes = clsx18(`flex items-center text-text01`, typography.heading[TagName], {
|
|
1515
1558
|
"gap-2": props.level === 1,
|
|
1516
1559
|
"gap-1": props.level > 1
|
|
1517
1560
|
});
|
|
@@ -1593,11 +1636,11 @@ var useRovingFocus = ({
|
|
|
1593
1636
|
};
|
|
1594
1637
|
|
|
1595
1638
|
// src/loading/loading.tsx
|
|
1596
|
-
import
|
|
1639
|
+
import clsx19 from "clsx";
|
|
1597
1640
|
import { Fragment as Fragment3, jsx as jsx22, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
1598
1641
|
function Loading({ size = "medium", position = "fixed", height = "100%" }) {
|
|
1599
|
-
const wrapperClasses =
|
|
1600
|
-
const svgClasses =
|
|
1642
|
+
const wrapperClasses = clsx19(position, "left-0 top-0 z-20 flex w-full items-center justify-center");
|
|
1643
|
+
const svgClasses = clsx19({
|
|
1601
1644
|
"h-4 w-4": size === "small",
|
|
1602
1645
|
"h-8 w-8": size === "medium",
|
|
1603
1646
|
"h-16 w-16": size === "large"
|
|
@@ -1643,7 +1686,7 @@ function Loading({ size = "medium", position = "fixed", height = "100%" }) {
|
|
|
1643
1686
|
}
|
|
1644
1687
|
|
|
1645
1688
|
// src/modal/modal.tsx
|
|
1646
|
-
import { useEffect as
|
|
1689
|
+
import { useEffect as useEffect6, useState as useState7 } from "react";
|
|
1647
1690
|
import { createPortal as createPortal2 } from "react-dom";
|
|
1648
1691
|
|
|
1649
1692
|
// src/modal/body-scroll-lock.tsx
|
|
@@ -1706,22 +1749,22 @@ var ModalContext = createContext4({
|
|
|
1706
1749
|
});
|
|
1707
1750
|
|
|
1708
1751
|
// src/modal/modal-footer.tsx
|
|
1709
|
-
import
|
|
1752
|
+
import clsx20 from "clsx";
|
|
1710
1753
|
import { jsx as jsx24 } from "react/jsx-runtime";
|
|
1711
1754
|
function ModalFooter({ children, isNoBorder = false }) {
|
|
1712
|
-
const wrapperClasses =
|
|
1755
|
+
const wrapperClasses = clsx20("flex w-full shrink-0 items-center rounded-b-lg px-6 py-4", {
|
|
1713
1756
|
"border-t-[1px] border-uiBorder01": !isNoBorder
|
|
1714
1757
|
});
|
|
1715
1758
|
return /* @__PURE__ */ jsx24("div", { className: wrapperClasses, children });
|
|
1716
1759
|
}
|
|
1717
1760
|
|
|
1718
1761
|
// src/modal/modal-header.tsx
|
|
1719
|
-
import
|
|
1762
|
+
import clsx21 from "clsx";
|
|
1720
1763
|
import { useContext as useContext5 } from "react";
|
|
1721
1764
|
import { jsx as jsx25, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
1722
1765
|
function ModalHeader({ children, isNoBorder = false }) {
|
|
1723
1766
|
const { onClose } = useContext5(ModalContext);
|
|
1724
|
-
const headerClasses =
|
|
1767
|
+
const headerClasses = clsx21(
|
|
1725
1768
|
"typography-h5 flex w-full shrink-0 items-center justify-between rounded-t-lg px-6 text-text01",
|
|
1726
1769
|
{
|
|
1727
1770
|
"border-b border-uiBorder01": !isNoBorder,
|
|
@@ -1751,9 +1794,14 @@ function Modal({
|
|
|
1751
1794
|
const [isMounted, setIsMounted] = useState7(false);
|
|
1752
1795
|
const renderWidth = typeof width === "number" ? Math.max(width, LIMIT_WIDTH) : width;
|
|
1753
1796
|
const renderHeight = typeof height === "number" ? Math.max(height, LIMIT_HEIGHT) : height;
|
|
1754
|
-
|
|
1797
|
+
useEffect6(() => {
|
|
1755
1798
|
setIsMounted(true);
|
|
1756
1799
|
}, []);
|
|
1800
|
+
useEffect6(() => {
|
|
1801
|
+
if (isOpen) {
|
|
1802
|
+
window.dispatchEvent(new CustomEvent(MODAL_OPEN_EVENT));
|
|
1803
|
+
}
|
|
1804
|
+
}, [isOpen]);
|
|
1757
1805
|
return isMounted && isOpen ? /* @__PURE__ */ jsxs10(Fragment4, { children: [
|
|
1758
1806
|
/* @__PURE__ */ jsx26(BodyScrollLock, {}),
|
|
1759
1807
|
createPortal2(
|
|
@@ -1776,10 +1824,10 @@ Modal.Header = ModalHeader;
|
|
|
1776
1824
|
Modal.Footer = ModalFooter;
|
|
1777
1825
|
|
|
1778
1826
|
// src/notification-inline/notification-inline.tsx
|
|
1779
|
-
import { clsx as
|
|
1827
|
+
import { clsx as clsx22 } from "clsx";
|
|
1780
1828
|
import { jsx as jsx27, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
1781
1829
|
function NotificationInline({ state = "default", size = "medium", ...props }) {
|
|
1782
|
-
const wrapperClasses =
|
|
1830
|
+
const wrapperClasses = clsx22("typography-body13regular flex items-center gap-1 rounded text-text01", {
|
|
1783
1831
|
"bg-uiBackgroundError": state === "attention",
|
|
1784
1832
|
"bg-uiBackgroundWarning": state === "warning",
|
|
1785
1833
|
"bg-uiBackgroundBlue": state === "information",
|
|
@@ -1788,7 +1836,7 @@ function NotificationInline({ state = "default", size = "medium", ...props }) {
|
|
|
1788
1836
|
"p-2": size === "small",
|
|
1789
1837
|
"p-3": size === "medium"
|
|
1790
1838
|
});
|
|
1791
|
-
const iconClasses =
|
|
1839
|
+
const iconClasses = clsx22("flex items-center", {
|
|
1792
1840
|
"fill-supportError": state === "attention",
|
|
1793
1841
|
"fill-supportWarning": state === "warning",
|
|
1794
1842
|
"fill-blue-blue50": state === "information",
|
|
@@ -1812,7 +1860,7 @@ function NotificationInline({ state = "default", size = "medium", ...props }) {
|
|
|
1812
1860
|
}
|
|
1813
1861
|
|
|
1814
1862
|
// src/pagination/pagination-button.tsx
|
|
1815
|
-
import { clsx as
|
|
1863
|
+
import { clsx as clsx23 } from "clsx";
|
|
1816
1864
|
import { useContext as useContext6 } from "react";
|
|
1817
1865
|
|
|
1818
1866
|
// src/pagination/pagination-context.ts
|
|
@@ -1825,7 +1873,7 @@ var PaginationContext = createContext5({
|
|
|
1825
1873
|
import { jsx as jsx28 } from "react/jsx-runtime";
|
|
1826
1874
|
function PaginationButton({ page, onClick }) {
|
|
1827
1875
|
const { currentPage } = useContext6(PaginationContext);
|
|
1828
|
-
const buttonClasses =
|
|
1876
|
+
const buttonClasses = clsx23(
|
|
1829
1877
|
"flex h-8 min-w-8 items-center justify-center rounded fill-icon01 px-1",
|
|
1830
1878
|
"typography-label14regular",
|
|
1831
1879
|
"text-interactive02",
|
|
@@ -1913,8 +1961,8 @@ function Pagination({ currentPage, totalPage, sideNumPagesToShow = 3, onClick })
|
|
|
1913
1961
|
// src/select/select.tsx
|
|
1914
1962
|
import { autoUpdate as autoUpdate2, FloatingPortal as FloatingPortal2, offset as offset2, size as sizeMiddleware, useFloating as useFloating2 } from "@floating-ui/react";
|
|
1915
1963
|
import { focusVisible as focusVisible10, selectColors } from "@zenkigen-inc/component-theme";
|
|
1916
|
-
import
|
|
1917
|
-
import { useRef as
|
|
1964
|
+
import clsx26 from "clsx";
|
|
1965
|
+
import { useRef as useRef7, useState as useState8 } from "react";
|
|
1918
1966
|
|
|
1919
1967
|
// src/select/select-context.ts
|
|
1920
1968
|
import { createContext as createContext6 } from "react";
|
|
@@ -1927,7 +1975,7 @@ var SelectContext = createContext6({
|
|
|
1927
1975
|
|
|
1928
1976
|
// src/select/select-item.tsx
|
|
1929
1977
|
import { focusVisible as focusVisible8 } from "@zenkigen-inc/component-theme";
|
|
1930
|
-
import
|
|
1978
|
+
import clsx24 from "clsx";
|
|
1931
1979
|
import { useContext as useContext7 } from "react";
|
|
1932
1980
|
import { jsx as jsx30, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
1933
1981
|
function SelectItem({ option }) {
|
|
@@ -1936,7 +1984,7 @@ function SelectItem({ option }) {
|
|
|
1936
1984
|
onChange?.(option2);
|
|
1937
1985
|
setIsOptionListOpen(false);
|
|
1938
1986
|
};
|
|
1939
|
-
const itemClasses =
|
|
1987
|
+
const itemClasses = clsx24(
|
|
1940
1988
|
"typography-label14regular flex h-8 w-full items-center px-3 hover:bg-hover02 active:bg-active02",
|
|
1941
1989
|
focusVisible8.inset,
|
|
1942
1990
|
{
|
|
@@ -1955,7 +2003,7 @@ function SelectItem({ option }) {
|
|
|
1955
2003
|
|
|
1956
2004
|
// src/select/select-list.tsx
|
|
1957
2005
|
import { focusVisible as focusVisible9 } from "@zenkigen-inc/component-theme";
|
|
1958
|
-
import
|
|
2006
|
+
import clsx25 from "clsx";
|
|
1959
2007
|
import { forwardRef as forwardRef5, useContext as useContext8, useLayoutEffect as useLayoutEffect2 } from "react";
|
|
1960
2008
|
import { jsx as jsx31, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
1961
2009
|
var SelectList = forwardRef5(({ children, maxHeight }, ref) => {
|
|
@@ -1982,10 +2030,10 @@ var SelectList = forwardRef5(({ children, maxHeight }, ref) => {
|
|
|
1982
2030
|
}
|
|
1983
2031
|
}
|
|
1984
2032
|
}, [selectedOption, maxHeight, floatingRef]);
|
|
1985
|
-
const listClasses =
|
|
2033
|
+
const listClasses = clsx25("overflow-y-auto rounded bg-uiBackground01 py-2 shadow-floatingShadow", {
|
|
1986
2034
|
"border-solid border border-uiBorder01": variant === "outline"
|
|
1987
2035
|
});
|
|
1988
|
-
const deselectButtonClasses =
|
|
2036
|
+
const deselectButtonClasses = clsx25(
|
|
1989
2037
|
"typography-label14regular flex h-8 w-full items-center px-3 text-interactive02 hover:bg-hover02 active:bg-active02",
|
|
1990
2038
|
focusVisible9.inset
|
|
1991
2039
|
);
|
|
@@ -2016,8 +2064,13 @@ function Select({
|
|
|
2016
2064
|
matchListToTrigger = false
|
|
2017
2065
|
}) {
|
|
2018
2066
|
const [isOptionListOpen, setIsOptionListOpen] = useState8(false);
|
|
2019
|
-
const targetRef =
|
|
2067
|
+
const targetRef = useRef7(null);
|
|
2020
2068
|
useOutsideClick(targetRef, () => setIsOptionListOpen(false));
|
|
2069
|
+
useDismissOnModalOpen(() => {
|
|
2070
|
+
if (isOptionListOpen) {
|
|
2071
|
+
setIsOptionListOpen(false);
|
|
2072
|
+
}
|
|
2073
|
+
});
|
|
2021
2074
|
const { refs, floatingStyles } = useFloating2({
|
|
2022
2075
|
open: isOptionListOpen,
|
|
2023
2076
|
onOpenChange: setIsOptionListOpen,
|
|
@@ -2041,13 +2094,13 @@ function Select({
|
|
|
2041
2094
|
const handleClickToggle = () => setIsOptionListOpen((prev) => !prev);
|
|
2042
2095
|
const buttonVariant = isError && !isDisabled ? `${variant}Error` : variant;
|
|
2043
2096
|
const isSelected = isOptionSelected && !isDisabled && selectedOption !== null && !isError;
|
|
2044
|
-
const wrapperClasses =
|
|
2097
|
+
const wrapperClasses = clsx26("relative flex shrink-0 items-center gap-1 rounded bg-uiBackground01", {
|
|
2045
2098
|
"h-6": size === "x-small" || size === "small",
|
|
2046
2099
|
"h-8": size === "medium",
|
|
2047
2100
|
"h-10": size === "large",
|
|
2048
2101
|
"cursor-not-allowed": isDisabled
|
|
2049
2102
|
});
|
|
2050
|
-
const buttonClasses =
|
|
2103
|
+
const buttonClasses = clsx26(
|
|
2051
2104
|
"flex size-full items-center rounded",
|
|
2052
2105
|
selectColors[buttonVariant].hover,
|
|
2053
2106
|
selectColors[buttonVariant].active,
|
|
@@ -2062,7 +2115,7 @@ function Select({
|
|
|
2062
2115
|
"border-supportError": !isSelected && !isDisabled && isError
|
|
2063
2116
|
}
|
|
2064
2117
|
);
|
|
2065
|
-
const labelClasses =
|
|
2118
|
+
const labelClasses = clsx26("overflow-hidden", {
|
|
2066
2119
|
"mr-1": size === "x-small",
|
|
2067
2120
|
"mr-2": size !== "x-small",
|
|
2068
2121
|
"typography-label12regular": size === "x-small",
|
|
@@ -2105,7 +2158,7 @@ function Select({
|
|
|
2105
2158
|
]
|
|
2106
2159
|
}
|
|
2107
2160
|
),
|
|
2108
|
-
isOptionListOpen && !isDisabled && /* @__PURE__ */ jsx32(FloatingPortal2, { children: /* @__PURE__ */ jsx32("div", { className: "relative z-
|
|
2161
|
+
isOptionListOpen && !isDisabled && /* @__PURE__ */ jsx32(FloatingPortal2, { children: /* @__PURE__ */ jsx32("div", { className: "relative z-popover", children: /* @__PURE__ */ jsx32(SelectList, { ref: refs.setFloating, maxHeight: optionListMaxHeight, children }) }) })
|
|
2109
2162
|
] })
|
|
2110
2163
|
}
|
|
2111
2164
|
);
|
|
@@ -2196,7 +2249,7 @@ function PaginationSelect({
|
|
|
2196
2249
|
import { forwardRef as forwardRef9, useState as useState9 } from "react";
|
|
2197
2250
|
|
|
2198
2251
|
// src/text-input/text-input.tsx
|
|
2199
|
-
import { clsx as
|
|
2252
|
+
import { clsx as clsx29 } from "clsx";
|
|
2200
2253
|
import { Children as Children2, cloneElement as cloneElement4, forwardRef as forwardRef8, isValidElement as isValidElement2, useId as useId3, useMemo as useMemo3 } from "react";
|
|
2201
2254
|
|
|
2202
2255
|
// src/text-input/text-input-context.tsx
|
|
@@ -2211,7 +2264,7 @@ var useTextInputCompoundContext = (componentName) => {
|
|
|
2211
2264
|
};
|
|
2212
2265
|
|
|
2213
2266
|
// src/text-input/text-input-error-message.tsx
|
|
2214
|
-
import { clsx as
|
|
2267
|
+
import { clsx as clsx27 } from "clsx";
|
|
2215
2268
|
import { forwardRef as forwardRef6 } from "react";
|
|
2216
2269
|
import { jsx as jsx34 } from "react/jsx-runtime";
|
|
2217
2270
|
var TextInputErrorMessage = forwardRef6(
|
|
@@ -2222,20 +2275,20 @@ var TextInputErrorMessage = forwardRef6(
|
|
|
2222
2275
|
if (!shouldRender) {
|
|
2223
2276
|
return null;
|
|
2224
2277
|
}
|
|
2225
|
-
const errorMessageClassName =
|
|
2278
|
+
const errorMessageClassName = clsx27(typographyClass, "text-supportError");
|
|
2226
2279
|
return /* @__PURE__ */ jsx34("div", { ref, className: errorMessageClassName, "aria-live": ariaLive, ...props });
|
|
2227
2280
|
}
|
|
2228
2281
|
);
|
|
2229
2282
|
TextInputErrorMessage.displayName = "TextInput.ErrorMessage";
|
|
2230
2283
|
|
|
2231
2284
|
// src/text-input/text-input-helper-message.tsx
|
|
2232
|
-
import { clsx as
|
|
2285
|
+
import { clsx as clsx28 } from "clsx";
|
|
2233
2286
|
import { forwardRef as forwardRef7 } from "react";
|
|
2234
2287
|
import { jsx as jsx35 } from "react/jsx-runtime";
|
|
2235
2288
|
var TextInputHelperMessage = forwardRef7((props, ref) => {
|
|
2236
2289
|
const { inputProps } = useTextInputCompoundContext("TextInput.HelperMessage");
|
|
2237
2290
|
const typographyClass = inputProps.size === "large" ? "typography-label13regular" : "typography-label12regular";
|
|
2238
|
-
const helperMessageClassName =
|
|
2291
|
+
const helperMessageClassName = clsx28(typographyClass, "text-text02");
|
|
2239
2292
|
return /* @__PURE__ */ jsx35("div", { ref, className: helperMessageClassName, ...props });
|
|
2240
2293
|
});
|
|
2241
2294
|
TextInputHelperMessage.displayName = "TextInput.HelperMessage";
|
|
@@ -2244,6 +2297,7 @@ TextInputHelperMessage.displayName = "TextInput.HelperMessage";
|
|
|
2244
2297
|
import { jsx as jsx36, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
2245
2298
|
function TextInputInner({
|
|
2246
2299
|
size = "medium",
|
|
2300
|
+
variant = "outline",
|
|
2247
2301
|
isError = false,
|
|
2248
2302
|
disabled = false,
|
|
2249
2303
|
onClickClearButton,
|
|
@@ -2311,21 +2365,37 @@ function TextInputInner({
|
|
|
2311
2365
|
};
|
|
2312
2366
|
const isShowClearButton = !!onClickClearButton && restInputProps.value.length !== 0 && !disabled;
|
|
2313
2367
|
const hasTrailingElement = isShowClearButton || after != null;
|
|
2314
|
-
const
|
|
2315
|
-
|
|
2316
|
-
|
|
2317
|
-
"
|
|
2318
|
-
"
|
|
2319
|
-
"
|
|
2320
|
-
"
|
|
2321
|
-
"
|
|
2322
|
-
"
|
|
2368
|
+
const isBorderless = variant === "text";
|
|
2369
|
+
const inputWrapClasses = clsx29("relative flex items-center gap-2 overflow-hidden rounded border", {
|
|
2370
|
+
// outline variant
|
|
2371
|
+
"border-uiBorder02": !isBorderless && !isError && !disabled,
|
|
2372
|
+
"border-supportError": !isBorderless && isError && !disabled,
|
|
2373
|
+
"hover:border-hoverInput": !isBorderless && !disabled && !isError,
|
|
2374
|
+
"hover:focus-within:border-activeInput": !isBorderless && !isError,
|
|
2375
|
+
"focus-within:border-activeInput": !isBorderless && !isError,
|
|
2376
|
+
"bg-disabled02 border-disabled01": !isBorderless && disabled,
|
|
2377
|
+
// text variant
|
|
2378
|
+
"border-transparent": isBorderless,
|
|
2379
|
+
// 共通
|
|
2380
|
+
"bg-uiBackground01": !disabled || isBorderless,
|
|
2381
|
+
"pr-2": !isBorderless && size === "medium" && hasTrailingElement,
|
|
2382
|
+
"pr-3": !isBorderless && size === "large" && hasTrailingElement
|
|
2323
2383
|
});
|
|
2324
|
-
const inputClasses =
|
|
2325
|
-
|
|
2326
|
-
|
|
2384
|
+
const inputClasses = clsx29("flex-1 bg-transparent outline-none", {
|
|
2385
|
+
"disabled:text-textPlaceholder": !isBorderless,
|
|
2386
|
+
"disabled:text-disabled01": isBorderless,
|
|
2387
|
+
// outline: 従来の padding
|
|
2388
|
+
"typography-label14regular min-h-8 px-2": !isBorderless && size === "medium",
|
|
2389
|
+
"typography-label16regular min-h-10 px-3": !isBorderless && size === "large",
|
|
2390
|
+
// text: padding なし
|
|
2391
|
+
"typography-label14regular min-h-8": isBorderless && size === "medium",
|
|
2392
|
+
"typography-label16regular min-h-10": isBorderless && size === "large",
|
|
2393
|
+
// テキスト色
|
|
2327
2394
|
"text-text01": !isError,
|
|
2328
2395
|
"text-supportError": isError,
|
|
2396
|
+
// placeholder 色(text variant エラー時のみ上書き)
|
|
2397
|
+
"placeholder:text-textPlaceholder": !(isBorderless && isError && !disabled),
|
|
2398
|
+
"placeholder:text-supportErrorLight": isBorderless && isError && !disabled,
|
|
2329
2399
|
"pr-0": hasTrailingElement
|
|
2330
2400
|
});
|
|
2331
2401
|
const inputElement = /* @__PURE__ */ jsxs17("div", { className: inputWrapClasses, children: [
|
|
@@ -2464,10 +2534,20 @@ Popup.Footer = PopupFooter;
|
|
|
2464
2534
|
|
|
2465
2535
|
// src/radio/radio.tsx
|
|
2466
2536
|
import { focusVisible as focusVisible11 } from "@zenkigen-inc/component-theme";
|
|
2467
|
-
import
|
|
2537
|
+
import clsx30 from "clsx";
|
|
2468
2538
|
import { useCallback as useCallback8, useState as useState10 } from "react";
|
|
2469
2539
|
import { jsx as jsx42, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
2470
|
-
function Radio({
|
|
2540
|
+
function Radio({
|
|
2541
|
+
name,
|
|
2542
|
+
value,
|
|
2543
|
+
id,
|
|
2544
|
+
label,
|
|
2545
|
+
isChecked = false,
|
|
2546
|
+
isDisabled = false,
|
|
2547
|
+
size = "medium",
|
|
2548
|
+
onChange
|
|
2549
|
+
}) {
|
|
2550
|
+
const isLarge = size === "large";
|
|
2471
2551
|
const [isMouseOver, setIsMouseOver] = useState10(false);
|
|
2472
2552
|
const handleMouseOverInput = useCallback8(() => {
|
|
2473
2553
|
setIsMouseOver(true);
|
|
@@ -2479,12 +2559,15 @@ function Radio({ name, value, id, label, isChecked = false, isDisabled = false,
|
|
|
2479
2559
|
(e) => !isDisabled && onChange?.(e),
|
|
2480
2560
|
[isDisabled, onChange]
|
|
2481
2561
|
);
|
|
2482
|
-
const inputClasses =
|
|
2562
|
+
const inputClasses = clsx30("peer absolute z-[1] opacity-0", {
|
|
2563
|
+
"size-6": !isLarge,
|
|
2564
|
+
"size-8": isLarge,
|
|
2483
2565
|
"cursor-not-allowed": isDisabled,
|
|
2484
2566
|
"cursor-pointer": !isDisabled
|
|
2485
2567
|
});
|
|
2486
|
-
const boxClasses =
|
|
2487
|
-
"inline-flex
|
|
2568
|
+
const boxClasses = clsx30(
|
|
2569
|
+
"inline-flex items-center justify-center rounded-full border border-solid bg-white",
|
|
2570
|
+
{ "size-5": !isLarge, "size-7": isLarge },
|
|
2488
2571
|
focusVisible11.normalPeer,
|
|
2489
2572
|
{
|
|
2490
2573
|
"border-disabled01 hover:border-disabled01": isDisabled && !isMouseOver,
|
|
@@ -2494,21 +2577,31 @@ function Radio({ name, value, id, label, isChecked = false, isDisabled = false,
|
|
|
2494
2577
|
"cursor-pointer": !isDisabled
|
|
2495
2578
|
}
|
|
2496
2579
|
);
|
|
2497
|
-
const afterClasses =
|
|
2498
|
-
"
|
|
2499
|
-
"
|
|
2500
|
-
|
|
2501
|
-
|
|
2502
|
-
|
|
2503
|
-
|
|
2504
|
-
|
|
2505
|
-
|
|
2506
|
-
|
|
2580
|
+
const afterClasses = clsx30(
|
|
2581
|
+
"absolute inset-0 m-auto block rounded-full",
|
|
2582
|
+
{ "size-3": !isLarge, "size-4": isLarge },
|
|
2583
|
+
{
|
|
2584
|
+
"bg-disabled01": isDisabled && isChecked,
|
|
2585
|
+
"bg-activeSelectedUi": !isDisabled && isChecked,
|
|
2586
|
+
"scale-0": !isChecked,
|
|
2587
|
+
"scale-100": isChecked
|
|
2588
|
+
}
|
|
2589
|
+
);
|
|
2590
|
+
const hoverIndicatorClasses = clsx30(
|
|
2591
|
+
"inline-block rounded-full",
|
|
2592
|
+
{ "size-3": !isLarge, "size-4": isLarge },
|
|
2593
|
+
{
|
|
2594
|
+
"bg-hoverUi": !isDisabled && !isChecked && isMouseOver
|
|
2595
|
+
}
|
|
2596
|
+
);
|
|
2597
|
+
const labelClasses = clsx30("ml-2 flex-[1_0_0] select-none break-all", {
|
|
2598
|
+
"typography-label14regular": !isLarge,
|
|
2599
|
+
"typography-label16regular": isLarge,
|
|
2507
2600
|
"pointer-events-none cursor-not-allowed text-disabled01": isDisabled,
|
|
2508
2601
|
"cursor-pointer text-text01": !isDisabled
|
|
2509
2602
|
});
|
|
2510
2603
|
return /* @__PURE__ */ jsxs19("div", { className: "flex items-center", children: [
|
|
2511
|
-
/* @__PURE__ */ jsxs19("div", { className: "flex
|
|
2604
|
+
/* @__PURE__ */ jsxs19("div", { className: clsx30("relative flex items-center justify-center", { "size-6": !isLarge, "size-8": isLarge }), children: [
|
|
2512
2605
|
/* @__PURE__ */ jsx42(
|
|
2513
2606
|
"input",
|
|
2514
2607
|
{
|
|
@@ -2524,26 +2617,35 @@ function Radio({ name, value, id, label, isChecked = false, isDisabled = false,
|
|
|
2524
2617
|
className: inputClasses
|
|
2525
2618
|
}
|
|
2526
2619
|
),
|
|
2527
|
-
/* @__PURE__ */ jsx42("div", { className: boxClasses, children: /* @__PURE__ */ jsxs19(
|
|
2528
|
-
|
|
2529
|
-
|
|
2530
|
-
|
|
2620
|
+
/* @__PURE__ */ jsx42("div", { className: boxClasses, children: /* @__PURE__ */ jsxs19(
|
|
2621
|
+
"div",
|
|
2622
|
+
{
|
|
2623
|
+
className: clsx30("relative flex flex-[0_0_auto] items-center justify-center", {
|
|
2624
|
+
"size-5": !isLarge,
|
|
2625
|
+
"size-7": isLarge
|
|
2626
|
+
}),
|
|
2627
|
+
children: [
|
|
2628
|
+
/* @__PURE__ */ jsx42("span", { className: afterClasses }),
|
|
2629
|
+
/* @__PURE__ */ jsx42("span", { className: hoverIndicatorClasses })
|
|
2630
|
+
]
|
|
2631
|
+
}
|
|
2632
|
+
) })
|
|
2531
2633
|
] }),
|
|
2532
2634
|
/* @__PURE__ */ jsx42("label", { htmlFor: id, className: labelClasses, children: label })
|
|
2533
2635
|
] });
|
|
2534
2636
|
}
|
|
2535
2637
|
|
|
2536
2638
|
// src/search/search.tsx
|
|
2537
|
-
import { clsx as
|
|
2639
|
+
import { clsx as clsx31 } from "clsx";
|
|
2538
2640
|
import { forwardRef as forwardRef10 } from "react";
|
|
2539
2641
|
import { jsx as jsx43, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
2540
2642
|
var Search = forwardRef10(({ width = "100%", size = "medium", ...props }, ref) => {
|
|
2541
|
-
const classes =
|
|
2643
|
+
const classes = clsx31(
|
|
2542
2644
|
"flex items-center rounded-full border border-uiBorder02 bg-uiBackground01 focus-within:border-activeInput",
|
|
2543
2645
|
{ "h-8 px-3": size === "medium" },
|
|
2544
2646
|
{ "h-10 px-4": size === "large" }
|
|
2545
2647
|
);
|
|
2546
|
-
const inputClasses =
|
|
2648
|
+
const inputClasses = clsx31("mx-2 h-full flex-1 text-text01 outline-none placeholder:text-textPlaceholder", {
|
|
2547
2649
|
["typography-label14regular"]: size === "medium",
|
|
2548
2650
|
["typography-label16regular"]: size === "large"
|
|
2549
2651
|
});
|
|
@@ -2575,7 +2677,7 @@ var Search = forwardRef10(({ width = "100%", size = "medium", ...props }, ref) =
|
|
|
2575
2677
|
Search.displayName = "Search";
|
|
2576
2678
|
|
|
2577
2679
|
// src/segmented-control/segmented-control.tsx
|
|
2578
|
-
import React4, { Children as Children3, useRef as
|
|
2680
|
+
import React4, { Children as Children3, useRef as useRef9 } from "react";
|
|
2579
2681
|
|
|
2580
2682
|
// src/segmented-control/segmented-control-context.ts
|
|
2581
2683
|
import { createContext as createContext9 } from "react";
|
|
@@ -2583,8 +2685,8 @@ var SegmentedControlContext = createContext9(null);
|
|
|
2583
2685
|
|
|
2584
2686
|
// src/segmented-control/segmented-control-item.tsx
|
|
2585
2687
|
import { focusVisible as focusVisible12 } from "@zenkigen-inc/component-theme";
|
|
2586
|
-
import { clsx as
|
|
2587
|
-
import { useContext as useContext12, useEffect as
|
|
2688
|
+
import { clsx as clsx32 } from "clsx";
|
|
2689
|
+
import { useContext as useContext12, useEffect as useEffect7, useRef as useRef8 } from "react";
|
|
2588
2690
|
import { jsx as jsx44, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
2589
2691
|
var SegmentedControlItem = ({
|
|
2590
2692
|
label,
|
|
@@ -2595,8 +2697,8 @@ var SegmentedControlItem = ({
|
|
|
2595
2697
|
...rest
|
|
2596
2698
|
}) => {
|
|
2597
2699
|
const context = useContext12(SegmentedControlContext);
|
|
2598
|
-
const buttonRef =
|
|
2599
|
-
const lastInteractionWasMouse =
|
|
2700
|
+
const buttonRef = useRef8(null);
|
|
2701
|
+
const lastInteractionWasMouse = useRef8(false);
|
|
2600
2702
|
if (context === null) {
|
|
2601
2703
|
throw new Error("SegmentedControl.Item must be used within SegmentedControl");
|
|
2602
2704
|
}
|
|
@@ -2612,7 +2714,7 @@ var SegmentedControlItem = ({
|
|
|
2612
2714
|
const isSelected = value === selectedValue;
|
|
2613
2715
|
const isFocused = value === focusedValue;
|
|
2614
2716
|
const isOptionDisabled = isContextDisabled || itemDisabled === true;
|
|
2615
|
-
|
|
2717
|
+
useEffect7(() => {
|
|
2616
2718
|
if (isFocused === true && buttonRef.current !== null) {
|
|
2617
2719
|
buttonRef.current.focus();
|
|
2618
2720
|
}
|
|
@@ -2634,7 +2736,7 @@ var SegmentedControlItem = ({
|
|
|
2634
2736
|
lastInteractionWasMouse.current = false;
|
|
2635
2737
|
onBlur?.();
|
|
2636
2738
|
};
|
|
2637
|
-
const buttonClasses =
|
|
2739
|
+
const buttonClasses = clsx32("relative flex items-center justify-center gap-1 rounded", focusVisible12.normal, {
|
|
2638
2740
|
"px-2 min-h-[24px] typography-label12regular": size === "small",
|
|
2639
2741
|
"px-4 min-h-[32px] typography-label14regular": size === "medium",
|
|
2640
2742
|
// States - Default with hover
|
|
@@ -2664,7 +2766,7 @@ var SegmentedControlItem = ({
|
|
|
2664
2766
|
Boolean(icon) === true && icon && /* @__PURE__ */ jsx44(
|
|
2665
2767
|
"span",
|
|
2666
2768
|
{
|
|
2667
|
-
className:
|
|
2769
|
+
className: clsx32("flex items-center", {
|
|
2668
2770
|
"fill-disabled01": isOptionDisabled === true,
|
|
2669
2771
|
"fill-interactive01": isSelected === true && isOptionDisabled === false,
|
|
2670
2772
|
"fill-icon01": isSelected === false && isOptionDisabled === false
|
|
@@ -2689,7 +2791,7 @@ var SegmentedControl = ({
|
|
|
2689
2791
|
"aria-label": ariaLabel,
|
|
2690
2792
|
...rest
|
|
2691
2793
|
}) => {
|
|
2692
|
-
const containerRef =
|
|
2794
|
+
const containerRef = useRef9(null);
|
|
2693
2795
|
const itemIds = Children3.toArray(children).filter((child) => {
|
|
2694
2796
|
if (!React4.isValidElement(child) || typeof child.props !== "object" || child.props === null || !("value" in child.props)) {
|
|
2695
2797
|
return false;
|
|
@@ -2742,19 +2844,19 @@ SegmentedControl.Item = SegmentedControlItem;
|
|
|
2742
2844
|
|
|
2743
2845
|
// src/select-sort/select-sort.tsx
|
|
2744
2846
|
import { buttonColors as buttonColors4, focusVisible as focusVisible15 } from "@zenkigen-inc/component-theme";
|
|
2745
|
-
import
|
|
2746
|
-
import { useCallback as useCallback9, useRef as
|
|
2847
|
+
import clsx35 from "clsx";
|
|
2848
|
+
import { useCallback as useCallback9, useRef as useRef10, useState as useState11 } from "react";
|
|
2747
2849
|
|
|
2748
2850
|
// src/select-sort/select-list.tsx
|
|
2749
2851
|
import { focusVisible as focusVisible14 } from "@zenkigen-inc/component-theme";
|
|
2750
|
-
import
|
|
2852
|
+
import clsx34 from "clsx";
|
|
2751
2853
|
|
|
2752
2854
|
// src/select-sort/select-item.tsx
|
|
2753
2855
|
import { focusVisible as focusVisible13 } from "@zenkigen-inc/component-theme";
|
|
2754
|
-
import
|
|
2856
|
+
import clsx33 from "clsx";
|
|
2755
2857
|
import { jsx as jsx46, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
2756
2858
|
function SelectItem2({ children, isSortKey, onClickItem }) {
|
|
2757
|
-
const itemClasses =
|
|
2859
|
+
const itemClasses = clsx33(
|
|
2758
2860
|
"typography-label14regular flex h-8 w-full items-center px-3 hover:bg-hover02 active:bg-active02",
|
|
2759
2861
|
focusVisible13.inset,
|
|
2760
2862
|
{
|
|
@@ -2771,7 +2873,7 @@ function SelectItem2({ children, isSortKey, onClickItem }) {
|
|
|
2771
2873
|
// src/select-sort/select-list.tsx
|
|
2772
2874
|
import { jsx as jsx47, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
2773
2875
|
function SelectList2({ size, variant, sortOrder, onClickItem, onClickDeselect }) {
|
|
2774
|
-
const listClasses =
|
|
2876
|
+
const listClasses = clsx34(
|
|
2775
2877
|
"absolute z-dropdown w-max overflow-y-auto rounded bg-uiBackground01 py-2 shadow-floatingShadow",
|
|
2776
2878
|
{
|
|
2777
2879
|
"top-7": size === "x-small" || size === "small",
|
|
@@ -2780,7 +2882,7 @@ function SelectList2({ size, variant, sortOrder, onClickItem, onClickDeselect })
|
|
|
2780
2882
|
"border-solid border border-uiBorder01": variant === "outline"
|
|
2781
2883
|
}
|
|
2782
2884
|
);
|
|
2783
|
-
const deselectButtonClasses =
|
|
2885
|
+
const deselectButtonClasses = clsx34(
|
|
2784
2886
|
"typography-label14regular flex h-8 w-full items-center px-3 text-interactive02 hover:bg-hover02 active:bg-active02",
|
|
2785
2887
|
focusVisible14.inset
|
|
2786
2888
|
);
|
|
@@ -2805,8 +2907,13 @@ function SelectSort({
|
|
|
2805
2907
|
onClickDeselect
|
|
2806
2908
|
}) {
|
|
2807
2909
|
const [isOptionListOpen, setIsOptionListOpen] = useState11(false);
|
|
2808
|
-
const targetRef =
|
|
2910
|
+
const targetRef = useRef10(null);
|
|
2809
2911
|
useOutsideClick(targetRef, () => setIsOptionListOpen(false));
|
|
2912
|
+
useDismissOnModalOpen(() => {
|
|
2913
|
+
if (isOptionListOpen) {
|
|
2914
|
+
setIsOptionListOpen(false);
|
|
2915
|
+
}
|
|
2916
|
+
});
|
|
2810
2917
|
const handleClickToggle = () => setIsOptionListOpen((prev) => !prev);
|
|
2811
2918
|
const handleClickItem = useCallback9(
|
|
2812
2919
|
(value) => {
|
|
@@ -2815,13 +2922,13 @@ function SelectSort({
|
|
|
2815
2922
|
},
|
|
2816
2923
|
[onChange]
|
|
2817
2924
|
);
|
|
2818
|
-
const wrapperClasses =
|
|
2925
|
+
const wrapperClasses = clsx35("relative flex shrink-0 items-center gap-1 rounded", {
|
|
2819
2926
|
"h-6": size === "x-small" || size === "small",
|
|
2820
2927
|
"h-8": size === "medium",
|
|
2821
2928
|
"h-10": size === "large",
|
|
2822
2929
|
"cursor-not-allowed": isDisabled
|
|
2823
2930
|
});
|
|
2824
|
-
const buttonClasses =
|
|
2931
|
+
const buttonClasses = clsx35(
|
|
2825
2932
|
"flex size-full items-center rounded",
|
|
2826
2933
|
buttonColors4[variant].hover,
|
|
2827
2934
|
buttonColors4[variant].active,
|
|
@@ -2835,7 +2942,7 @@ function SelectSort({
|
|
|
2835
2942
|
"pointer-events-none": isDisabled
|
|
2836
2943
|
}
|
|
2837
2944
|
);
|
|
2838
|
-
const labelClasses =
|
|
2945
|
+
const labelClasses = clsx35("truncate", {
|
|
2839
2946
|
"typography-label12regular": size === "x-small",
|
|
2840
2947
|
"typography-label14regular": size === "small" || size === "medium",
|
|
2841
2948
|
"typography-label16regular": size === "large",
|
|
@@ -2874,7 +2981,7 @@ function SelectSort({
|
|
|
2874
2981
|
|
|
2875
2982
|
// src/sort-button/sort-button.tsx
|
|
2876
2983
|
import { buttonColors as buttonColors5, focusVisible as focusVisible16 } from "@zenkigen-inc/component-theme";
|
|
2877
|
-
import
|
|
2984
|
+
import clsx36 from "clsx";
|
|
2878
2985
|
import { useCallback as useCallback10 } from "react";
|
|
2879
2986
|
import { jsx as jsx49, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
2880
2987
|
function SortButton({
|
|
@@ -2896,13 +3003,13 @@ function SortButton({
|
|
|
2896
3003
|
if (sortOrder === "descend") return "arrow-down";
|
|
2897
3004
|
return "angle-small-down";
|
|
2898
3005
|
};
|
|
2899
|
-
const wrapperClasses =
|
|
3006
|
+
const wrapperClasses = clsx36("relative flex shrink-0 items-center gap-1 rounded", {
|
|
2900
3007
|
"h-6": size === "x-small" || size === "small",
|
|
2901
3008
|
"h-8": size === "medium",
|
|
2902
3009
|
"h-10": size === "large",
|
|
2903
3010
|
"cursor-not-allowed": isDisabled
|
|
2904
3011
|
});
|
|
2905
|
-
const buttonClasses =
|
|
3012
|
+
const buttonClasses = clsx36(
|
|
2906
3013
|
"flex size-full items-center rounded",
|
|
2907
3014
|
buttonColors5.text.hover,
|
|
2908
3015
|
buttonColors5.text.active,
|
|
@@ -2918,7 +3025,7 @@ function SortButton({
|
|
|
2918
3025
|
"pointer-events-none": isDisabled
|
|
2919
3026
|
}
|
|
2920
3027
|
);
|
|
2921
|
-
const labelClasses =
|
|
3028
|
+
const labelClasses = clsx36("truncate", {
|
|
2922
3029
|
"typography-label12regular": size === "x-small",
|
|
2923
3030
|
"typography-label14regular": size === "small" || size === "medium",
|
|
2924
3031
|
"typography-label16regular": size === "large",
|
|
@@ -2944,14 +3051,14 @@ function SortButton({
|
|
|
2944
3051
|
}
|
|
2945
3052
|
|
|
2946
3053
|
// src/tab/tab.tsx
|
|
2947
|
-
import { clsx as
|
|
3054
|
+
import { clsx as clsx38 } from "clsx";
|
|
2948
3055
|
import { Children as Children4 } from "react";
|
|
2949
3056
|
|
|
2950
3057
|
// src/tab/tab-item.tsx
|
|
2951
|
-
import { clsx as
|
|
3058
|
+
import { clsx as clsx37 } from "clsx";
|
|
2952
3059
|
import { jsx as jsx50, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
2953
3060
|
var TabItem = ({ isSelected = false, isDisabled = false, icon, ...props }) => {
|
|
2954
|
-
const classes =
|
|
3061
|
+
const classes = clsx37(
|
|
2955
3062
|
"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",
|
|
2956
3063
|
{
|
|
2957
3064
|
"typography-label14regular text-interactive02": !isSelected,
|
|
@@ -2959,7 +3066,7 @@ var TabItem = ({ isSelected = false, isDisabled = false, icon, ...props }) => {
|
|
|
2959
3066
|
"before:bg-interactive01 hover:before:bg-interactive01 pointer-events-none": isSelected
|
|
2960
3067
|
}
|
|
2961
3068
|
);
|
|
2962
|
-
const iconWrapperClasses =
|
|
3069
|
+
const iconWrapperClasses = clsx37("flex shrink-0 items-center", {
|
|
2963
3070
|
"fill-disabled01": isDisabled,
|
|
2964
3071
|
"fill-interactive01": !isDisabled && isSelected,
|
|
2965
3072
|
"fill-icon01 group-hover:fill-interactive01": !isDisabled && !isSelected
|
|
@@ -2986,7 +3093,7 @@ import { jsx as jsx51 } from "react/jsx-runtime";
|
|
|
2986
3093
|
function Tab({ children, layout = "auto" }) {
|
|
2987
3094
|
const childrenCount = Children4.count(children);
|
|
2988
3095
|
const containerStyle = layout === "equal" ? { gridTemplateColumns: `repeat(${childrenCount}, minmax(0,1fr))` } : {};
|
|
2989
|
-
const containerClasses =
|
|
3096
|
+
const containerClasses = clsx38(
|
|
2990
3097
|
"relative gap-4 px-6 before:absolute before:inset-x-0 before:bottom-0 before:h-px before:bg-uiBorder01",
|
|
2991
3098
|
{
|
|
2992
3099
|
flex: layout === "auto",
|
|
@@ -2998,18 +3105,18 @@ function Tab({ children, layout = "auto" }) {
|
|
|
2998
3105
|
Tab.Item = TabItem;
|
|
2999
3106
|
|
|
3000
3107
|
// src/table/table-cell.tsx
|
|
3001
|
-
import
|
|
3108
|
+
import clsx39 from "clsx";
|
|
3002
3109
|
import { jsx as jsx52 } from "react/jsx-runtime";
|
|
3003
3110
|
function TableCell({ children, className, isHeader = false }) {
|
|
3004
|
-
const classes =
|
|
3111
|
+
const classes = clsx39("border-b border-uiBorder01", { "sticky top-0 z-10 bg-white": isHeader }, className);
|
|
3005
3112
|
return /* @__PURE__ */ jsx52("div", { className: classes, children });
|
|
3006
3113
|
}
|
|
3007
3114
|
|
|
3008
3115
|
// src/table/table-row.tsx
|
|
3009
|
-
import
|
|
3116
|
+
import clsx40 from "clsx";
|
|
3010
3117
|
import { jsx as jsx53 } from "react/jsx-runtime";
|
|
3011
3118
|
function TableRow({ children, isHoverBackgroundVisible = false }) {
|
|
3012
|
-
const rowClasses =
|
|
3119
|
+
const rowClasses = clsx40("contents", isHoverBackgroundVisible && "[&:hover>div]:bg-hoverUi02");
|
|
3013
3120
|
return /* @__PURE__ */ jsx53("div", { className: rowClasses, children });
|
|
3014
3121
|
}
|
|
3015
3122
|
|
|
@@ -3043,18 +3150,18 @@ Table.Cell = TableCell;
|
|
|
3043
3150
|
|
|
3044
3151
|
// src/tag/tag.tsx
|
|
3045
3152
|
import { tagColors, tagLightColors } from "@zenkigen-inc/component-theme";
|
|
3046
|
-
import
|
|
3153
|
+
import clsx42 from "clsx";
|
|
3047
3154
|
|
|
3048
3155
|
// src/tag/delete-icon.tsx
|
|
3049
3156
|
import { focusVisible as focusVisible17 } from "@zenkigen-inc/component-theme";
|
|
3050
|
-
import
|
|
3157
|
+
import clsx41 from "clsx";
|
|
3051
3158
|
import { jsx as jsx55 } from "react/jsx-runtime";
|
|
3052
3159
|
var DeleteIcon = ({ color, variant, onClick }) => {
|
|
3053
|
-
const deleteButtonClasses =
|
|
3160
|
+
const deleteButtonClasses = clsx41(
|
|
3054
3161
|
"group ml-2 size-[14px] rounded-full p-0.5 hover:cursor-pointer hover:bg-iconOnColor focus-visible:bg-iconOnColor",
|
|
3055
3162
|
focusVisible17.normal
|
|
3056
3163
|
);
|
|
3057
|
-
const deletePathClasses =
|
|
3164
|
+
const deletePathClasses = clsx41({
|
|
3058
3165
|
"fill-interactive02": color === "gray" || variant === "light",
|
|
3059
3166
|
"group-hover:fill-interactive02 group-focus-visible:fill-interactive02 fill-iconOnColor": color !== "gray"
|
|
3060
3167
|
});
|
|
@@ -3072,17 +3179,16 @@ var DeleteIcon = ({ color, variant, onClick }) => {
|
|
|
3072
3179
|
// src/tag/tag.tsx
|
|
3073
3180
|
import { jsx as jsx56, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
3074
3181
|
function Tag({ id, children, color, variant = "normal", size = "medium", isEditable, onDelete }) {
|
|
3075
|
-
const wrapperClasses =
|
|
3182
|
+
const wrapperClasses = clsx42("flex", "items-center", "justify-center", {
|
|
3076
3183
|
[tagColors[color]]: variant === "normal",
|
|
3077
3184
|
[tagLightColors[color]]: variant === "light",
|
|
3078
3185
|
"h-[14px] typography-label11regular": !isEditable && size === "x-small",
|
|
3079
3186
|
"h-4 typography-label12regular": !isEditable && size === "small",
|
|
3080
|
-
"h-
|
|
3081
|
-
"h-[22px] typography-label14regular": isEditable && size === "medium",
|
|
3187
|
+
"h-5 typography-label14regular": size === "medium",
|
|
3082
3188
|
"rounded-full": isEditable,
|
|
3083
3189
|
rounded: !isEditable,
|
|
3084
|
-
"
|
|
3085
|
-
"
|
|
3190
|
+
"px-1": !isEditable,
|
|
3191
|
+
"px-2": isEditable
|
|
3086
3192
|
});
|
|
3087
3193
|
return /* @__PURE__ */ jsxs27("div", { className: wrapperClasses, children: [
|
|
3088
3194
|
children,
|
|
@@ -3091,7 +3197,7 @@ function Tag({ id, children, color, variant = "normal", size = "medium", isEdita
|
|
|
3091
3197
|
}
|
|
3092
3198
|
|
|
3093
3199
|
// src/text-area/text-area.tsx
|
|
3094
|
-
import { clsx as
|
|
3200
|
+
import { clsx as clsx45 } from "clsx";
|
|
3095
3201
|
import { Children as Children5, cloneElement as cloneElement5, forwardRef as forwardRef13, isValidElement as isValidElement3, useId as useId4, useMemo as useMemo4 } from "react";
|
|
3096
3202
|
|
|
3097
3203
|
// src/text-area/text-area-context.tsx
|
|
@@ -3106,7 +3212,7 @@ var useTextAreaCompoundContext = (componentName) => {
|
|
|
3106
3212
|
};
|
|
3107
3213
|
|
|
3108
3214
|
// src/text-area/text-area-error-message.tsx
|
|
3109
|
-
import { clsx as
|
|
3215
|
+
import { clsx as clsx43 } from "clsx";
|
|
3110
3216
|
import { forwardRef as forwardRef11 } from "react";
|
|
3111
3217
|
import { jsx as jsx57 } from "react/jsx-runtime";
|
|
3112
3218
|
var TextAreaErrorMessage = forwardRef11(
|
|
@@ -3117,20 +3223,20 @@ var TextAreaErrorMessage = forwardRef11(
|
|
|
3117
3223
|
if (!shouldRender) {
|
|
3118
3224
|
return null;
|
|
3119
3225
|
}
|
|
3120
|
-
const errorMessageClassName =
|
|
3226
|
+
const errorMessageClassName = clsx43(typographyClass, "text-supportError");
|
|
3121
3227
|
return /* @__PURE__ */ jsx57("div", { ref, className: errorMessageClassName, "aria-live": ariaLive, ...props });
|
|
3122
3228
|
}
|
|
3123
3229
|
);
|
|
3124
3230
|
TextAreaErrorMessage.displayName = "TextArea.ErrorMessage";
|
|
3125
3231
|
|
|
3126
3232
|
// src/text-area/text-area-helper-message.tsx
|
|
3127
|
-
import { clsx as
|
|
3233
|
+
import { clsx as clsx44 } from "clsx";
|
|
3128
3234
|
import { forwardRef as forwardRef12 } from "react";
|
|
3129
3235
|
import { jsx as jsx58 } from "react/jsx-runtime";
|
|
3130
3236
|
var TextAreaHelperMessage = forwardRef12((props, ref) => {
|
|
3131
3237
|
const { textAreaProps } = useTextAreaCompoundContext("TextArea.HelperMessage");
|
|
3132
3238
|
const typographyClass = textAreaProps.size === "large" ? "typography-label13regular" : "typography-label12regular";
|
|
3133
|
-
const helperMessageClassName =
|
|
3239
|
+
const helperMessageClassName = clsx44(typographyClass, "text-text02");
|
|
3134
3240
|
return /* @__PURE__ */ jsx58("div", { ref, className: helperMessageClassName, ...props });
|
|
3135
3241
|
});
|
|
3136
3242
|
TextAreaHelperMessage.displayName = "TextArea.HelperMessage";
|
|
@@ -3139,6 +3245,7 @@ TextAreaHelperMessage.displayName = "TextArea.HelperMessage";
|
|
|
3139
3245
|
import { jsx as jsx59, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
3140
3246
|
function TextAreaInner({
|
|
3141
3247
|
size = "medium",
|
|
3248
|
+
variant = "outline",
|
|
3142
3249
|
isResizable = false,
|
|
3143
3250
|
autoHeight = false,
|
|
3144
3251
|
maxHeight,
|
|
@@ -3156,9 +3263,10 @@ function TextAreaInner({
|
|
|
3156
3263
|
const textAreaPropsForContext = useMemo4(
|
|
3157
3264
|
() => ({
|
|
3158
3265
|
size,
|
|
3266
|
+
variant,
|
|
3159
3267
|
isError
|
|
3160
3268
|
}),
|
|
3161
|
-
[size, isError]
|
|
3269
|
+
[size, variant, isError]
|
|
3162
3270
|
);
|
|
3163
3271
|
const contextValue = useMemo4(
|
|
3164
3272
|
() => ({
|
|
@@ -3210,30 +3318,41 @@ function TextAreaInner({
|
|
|
3210
3318
|
...ariaInvalidProps,
|
|
3211
3319
|
...maxLengthProps
|
|
3212
3320
|
};
|
|
3213
|
-
const
|
|
3321
|
+
const isBorderless = variant === "text";
|
|
3322
|
+
const textAreaWrapperClassName = clsx45(
|
|
3214
3323
|
"box-border flex w-full overflow-hidden rounded border",
|
|
3215
3324
|
{
|
|
3216
|
-
|
|
3217
|
-
"border-
|
|
3218
|
-
"
|
|
3219
|
-
"hover:
|
|
3220
|
-
"focus-within:border-activeInput": !isError,
|
|
3221
|
-
"
|
|
3325
|
+
// outline variant
|
|
3326
|
+
"border-supportError": !isBorderless && isError && !disabled,
|
|
3327
|
+
"border-uiBorder02": !isBorderless && !isError && !disabled,
|
|
3328
|
+
"hover:border-hoverInput": !isBorderless && !disabled && !isError,
|
|
3329
|
+
"hover:focus-within:border-activeInput": !isBorderless && !isError,
|
|
3330
|
+
"focus-within:border-activeInput": !isBorderless && !isError,
|
|
3331
|
+
"bg-disabled02 border-disabled01": !isBorderless && disabled,
|
|
3332
|
+
// text variant
|
|
3333
|
+
"border-transparent": isBorderless
|
|
3222
3334
|
},
|
|
3223
|
-
className
|
|
3224
|
-
|
|
3225
|
-
const textAreaClassName = clsx43(
|
|
3226
|
-
"w-full border-none bg-uiBackground01 outline-none placeholder:text-textPlaceholder disabled:text-textPlaceholder",
|
|
3227
|
-
{
|
|
3228
|
-
"typography-body14regular px-2 py-2": size === "medium",
|
|
3229
|
-
"typography-body16regular px-3 py-2": size === "large",
|
|
3230
|
-
"field-sizing-content": autoHeight,
|
|
3231
|
-
"text-text01": !isError,
|
|
3232
|
-
"text-supportError": isError,
|
|
3233
|
-
"bg-disabled02": disabled,
|
|
3234
|
-
"resize-none": !isResizable
|
|
3235
|
-
}
|
|
3335
|
+
// className は variant="outline" のみ受け入れ、後方互換のため wrapper の末尾に合成(@deprecated)
|
|
3336
|
+
!isBorderless && className
|
|
3236
3337
|
);
|
|
3338
|
+
const textAreaClassName = clsx45("w-full border-none bg-uiBackground01 outline-none", {
|
|
3339
|
+
// outline: 従来の padding
|
|
3340
|
+
"typography-body14regular px-2 py-2": !isBorderless && size === "medium",
|
|
3341
|
+
"typography-body16regular px-3 py-2": !isBorderless && size === "large",
|
|
3342
|
+
// text: padding なし
|
|
3343
|
+
"typography-body14regular": isBorderless && size === "medium",
|
|
3344
|
+
"typography-body16regular": isBorderless && size === "large",
|
|
3345
|
+
"disabled:text-textPlaceholder": !isBorderless,
|
|
3346
|
+
"disabled:text-disabled01": isBorderless,
|
|
3347
|
+
"field-sizing-content": autoHeight,
|
|
3348
|
+
"text-text01": !isError,
|
|
3349
|
+
"text-supportError": isError,
|
|
3350
|
+
// placeholder 色(text variant エラー時のみ上書き)
|
|
3351
|
+
"placeholder:text-textPlaceholder": !(isBorderless && isError && !disabled),
|
|
3352
|
+
"placeholder:text-supportErrorLight": isBorderless && isError && !disabled,
|
|
3353
|
+
"bg-disabled02": !isBorderless && disabled,
|
|
3354
|
+
"resize-none": !isResizable
|
|
3355
|
+
});
|
|
3237
3356
|
const hasHeight = height != null && String(height).trim().length > 0;
|
|
3238
3357
|
const textAreaElement = /* @__PURE__ */ jsx59(
|
|
3239
3358
|
"div",
|
|
@@ -3242,7 +3361,8 @@ function TextAreaInner({
|
|
|
3242
3361
|
style: {
|
|
3243
3362
|
...{ maxHeight },
|
|
3244
3363
|
// height/minHeight はラッパに適用し、外形を揃える
|
|
3245
|
-
|
|
3364
|
+
// isResizable 時はラッパに固定高さを設定しない(textarea のリサイズに追従させるため)
|
|
3365
|
+
...!autoHeight && hasHeight && !isResizable ? { height } : {},
|
|
3246
3366
|
...autoHeight && hasHeight ? { minHeight: height } : {}
|
|
3247
3367
|
},
|
|
3248
3368
|
children: /* @__PURE__ */ jsx59(
|
|
@@ -3253,7 +3373,8 @@ function TextAreaInner({
|
|
|
3253
3373
|
...mergedTextAreaProps,
|
|
3254
3374
|
disabled,
|
|
3255
3375
|
style: {
|
|
3256
|
-
|
|
3376
|
+
// isResizable 時は height を textarea の初期高さとして直接設定し、リサイズ起点にする
|
|
3377
|
+
height: autoHeight ? "auto" : isResizable && hasHeight ? height : "100%",
|
|
3257
3378
|
minHeight: autoHeight && hasHeight ? "100%" : "auto"
|
|
3258
3379
|
}
|
|
3259
3380
|
}
|
|
@@ -3264,7 +3385,7 @@ function TextAreaInner({
|
|
|
3264
3385
|
"div",
|
|
3265
3386
|
{
|
|
3266
3387
|
id: counterId,
|
|
3267
|
-
className:
|
|
3388
|
+
className: clsx45(
|
|
3268
3389
|
"shrink-0",
|
|
3269
3390
|
size === "large" ? "typography-label13regular" : "typography-label12regular",
|
|
3270
3391
|
!disabled && isExceeded ? "text-supportError" : "text-text02"
|
|
@@ -3300,8 +3421,8 @@ var TextAreaBase = forwardRef13(function TextAreaBase2(props, ref) {
|
|
|
3300
3421
|
var TextArea = attachStatics2(TextAreaBase);
|
|
3301
3422
|
|
|
3302
3423
|
// src/toast/toast.tsx
|
|
3303
|
-
import
|
|
3304
|
-
import { useCallback as useCallback11, useEffect as
|
|
3424
|
+
import clsx46 from "clsx";
|
|
3425
|
+
import { useCallback as useCallback11, useEffect as useEffect8, useState as useState12 } from "react";
|
|
3305
3426
|
import { jsx as jsx60, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
3306
3427
|
var CLOSE_TIME_MSEC = 5e3;
|
|
3307
3428
|
function Toast({
|
|
@@ -3321,17 +3442,17 @@ function Toast({
|
|
|
3321
3442
|
}
|
|
3322
3443
|
}, [isAnimation, onClickClose]);
|
|
3323
3444
|
const handleAnimationEnd = (e) => window.getComputedStyle(e.currentTarget).opacity === "0" && onClickClose();
|
|
3324
|
-
const wrapperClasses =
|
|
3445
|
+
const wrapperClasses = clsx46("pointer-events-auto flex items-start gap-1 bg-white p-4 shadow-floatingShadow", {
|
|
3325
3446
|
["animate-toast-in"]: isAnimation && !isRemoving,
|
|
3326
3447
|
["animate-toast-out opacity-0"]: isAnimation && isRemoving
|
|
3327
3448
|
});
|
|
3328
|
-
const iconClasses =
|
|
3449
|
+
const iconClasses = clsx46("flex items-center", {
|
|
3329
3450
|
"fill-supportSuccess": state === "success",
|
|
3330
3451
|
"fill-supportError": state === "error",
|
|
3331
3452
|
"fill-supportWarning": state === "warning",
|
|
3332
3453
|
"fill-supportInfo": state === "information"
|
|
3333
3454
|
});
|
|
3334
|
-
const textClasses =
|
|
3455
|
+
const textClasses = clsx46("typography-body13regular flex-1 pt-[3px]", {
|
|
3335
3456
|
"text-supportError": state === "error",
|
|
3336
3457
|
"text-text01": state === "success" || state === "warning" || state === "information"
|
|
3337
3458
|
});
|
|
@@ -3341,7 +3462,7 @@ function Toast({
|
|
|
3341
3462
|
warning: "warning",
|
|
3342
3463
|
information: "information-filled"
|
|
3343
3464
|
};
|
|
3344
|
-
|
|
3465
|
+
useEffect8(() => {
|
|
3345
3466
|
const timer = window.setTimeout(() => {
|
|
3346
3467
|
if (isAutoClose) {
|
|
3347
3468
|
setIsRemoving(true);
|
|
@@ -3357,7 +3478,7 @@ function Toast({
|
|
|
3357
3478
|
}
|
|
3358
3479
|
|
|
3359
3480
|
// src/toast/toast-provider.tsx
|
|
3360
|
-
import { createContext as createContext11, useCallback as useCallback12, useContext as useContext14, useEffect as
|
|
3481
|
+
import { createContext as createContext11, useCallback as useCallback12, useContext as useContext14, useEffect as useEffect9, useState as useState13 } from "react";
|
|
3361
3482
|
import { createPortal as createPortal3 } from "react-dom";
|
|
3362
3483
|
import { jsx as jsx61, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
3363
3484
|
var ToastContext = createContext11({});
|
|
@@ -3370,7 +3491,7 @@ var ToastProvider = ({ children }) => {
|
|
|
3370
3491
|
const removeToast = useCallback12((id) => {
|
|
3371
3492
|
setToasts((prev) => prev.filter((snackbar) => snackbar.id !== id));
|
|
3372
3493
|
}, []);
|
|
3373
|
-
|
|
3494
|
+
useEffect9(() => {
|
|
3374
3495
|
setIsClientRender(true);
|
|
3375
3496
|
}, []);
|
|
3376
3497
|
return /* @__PURE__ */ jsxs30(ToastContext.Provider, { value: { addToast, removeToast }, children: [
|
|
@@ -3386,7 +3507,7 @@ var useToast = () => {
|
|
|
3386
3507
|
};
|
|
3387
3508
|
|
|
3388
3509
|
// src/toggle/toggle.tsx
|
|
3389
|
-
import
|
|
3510
|
+
import clsx47 from "clsx";
|
|
3390
3511
|
import { jsx as jsx62, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
3391
3512
|
function Toggle({
|
|
3392
3513
|
id,
|
|
@@ -3397,7 +3518,7 @@ function Toggle({
|
|
|
3397
3518
|
labelPosition = "right",
|
|
3398
3519
|
isDisabled = false
|
|
3399
3520
|
}) {
|
|
3400
|
-
const baseClasses =
|
|
3521
|
+
const baseClasses = clsx47("relative flex items-center rounded-full", {
|
|
3401
3522
|
"bg-disabledOn": isDisabled && isChecked,
|
|
3402
3523
|
"bg-disabled01": isDisabled && !isChecked,
|
|
3403
3524
|
"bg-interactive01 peer-hover:bg-hover01": !isDisabled && isChecked,
|
|
@@ -3405,16 +3526,16 @@ function Toggle({
|
|
|
3405
3526
|
"w-8 h-4 px-[3px]": size === "small",
|
|
3406
3527
|
"w-12 h-6 px-1": size === "medium" || size === "large"
|
|
3407
3528
|
});
|
|
3408
|
-
const inputClasses =
|
|
3529
|
+
const inputClasses = clsx47(
|
|
3409
3530
|
"peer absolute inset-0 z-[1] opacity-0",
|
|
3410
3531
|
isDisabled ? "cursor-not-allowed" : "cursor-pointer"
|
|
3411
3532
|
);
|
|
3412
|
-
const indicatorClasses =
|
|
3533
|
+
const indicatorClasses = clsx47("rounded-full bg-iconOnColor", {
|
|
3413
3534
|
"w-2.5 h-2.5": size === "small",
|
|
3414
3535
|
"w-4 h-4": size === "medium" || size === "large",
|
|
3415
3536
|
"ml-auto": isChecked
|
|
3416
3537
|
});
|
|
3417
|
-
const labelClasses =
|
|
3538
|
+
const labelClasses = clsx47("break-all", {
|
|
3418
3539
|
"mr-2": labelPosition === "left",
|
|
3419
3540
|
"ml-2": labelPosition === "right",
|
|
3420
3541
|
"typography-label14regular": size === "small" || size === "medium",
|
|
@@ -3442,17 +3563,17 @@ function Toggle({
|
|
|
3442
3563
|
}
|
|
3443
3564
|
|
|
3444
3565
|
// src/tooltip/tooltip.tsx
|
|
3445
|
-
import { useCallback as useCallback14, useEffect as
|
|
3566
|
+
import { useCallback as useCallback14, useEffect as useEffect10, useRef as useRef11, useState as useState14 } from "react";
|
|
3446
3567
|
import { createPortal as createPortal4 } from "react-dom";
|
|
3447
3568
|
|
|
3448
3569
|
// src/tooltip/tooltip-content.tsx
|
|
3449
|
-
import
|
|
3570
|
+
import clsx49 from "clsx";
|
|
3450
3571
|
|
|
3451
3572
|
// src/tooltip/tail-icon.tsx
|
|
3452
|
-
import
|
|
3573
|
+
import clsx48 from "clsx";
|
|
3453
3574
|
import { jsx as jsx63 } from "react/jsx-runtime";
|
|
3454
3575
|
var TailIcon = (props) => {
|
|
3455
|
-
const tailClasses =
|
|
3576
|
+
const tailClasses = clsx48("absolute fill-uiBackgroundTooltip", {
|
|
3456
3577
|
"rotate-180": props.verticalPosition === "bottom",
|
|
3457
3578
|
"rotate-0": props.verticalPosition !== "bottom",
|
|
3458
3579
|
"-top-1": props.verticalPosition === "bottom" && props.size === "small",
|
|
@@ -3495,7 +3616,7 @@ var TooltipContent = ({
|
|
|
3495
3616
|
maxWidth,
|
|
3496
3617
|
isPortal = false
|
|
3497
3618
|
}) => {
|
|
3498
|
-
const tooltipWrapperClasses =
|
|
3619
|
+
const tooltipWrapperClasses = clsx49("absolute z-tooltip m-auto flex", {
|
|
3499
3620
|
"top-0": !isPortal && verticalPosition === "top",
|
|
3500
3621
|
"bottom-0": !isPortal && verticalPosition === "bottom",
|
|
3501
3622
|
"justify-start": horizontalAlign === "left",
|
|
@@ -3504,7 +3625,7 @@ var TooltipContent = ({
|
|
|
3504
3625
|
"w-[24px]": size === "small",
|
|
3505
3626
|
"w-[46px]": size !== "small"
|
|
3506
3627
|
});
|
|
3507
|
-
const tooltipBodyClasses =
|
|
3628
|
+
const tooltipBodyClasses = clsx49(
|
|
3508
3629
|
"absolute z-tooltip inline-block w-max rounded bg-uiBackgroundTooltip text-textOnColor",
|
|
3509
3630
|
{
|
|
3510
3631
|
"typography-body12regular": size === "small",
|
|
@@ -3613,22 +3734,54 @@ function Tooltip({
|
|
|
3613
3734
|
translateX: "0",
|
|
3614
3735
|
translateY: "0"
|
|
3615
3736
|
});
|
|
3616
|
-
const targetRef =
|
|
3737
|
+
const targetRef = useRef11(null);
|
|
3617
3738
|
const handleMouseOverWrapper = useCallback14(() => {
|
|
3618
3739
|
if (isDisabledHover) {
|
|
3619
3740
|
return;
|
|
3620
3741
|
}
|
|
3742
|
+
if (targetRef.current !== null) {
|
|
3743
|
+
const dimensions = targetRef.current.getBoundingClientRect();
|
|
3744
|
+
const position = calculatePosition({
|
|
3745
|
+
dimensions,
|
|
3746
|
+
maxWidth,
|
|
3747
|
+
verticalPosition,
|
|
3748
|
+
horizontalAlign,
|
|
3749
|
+
tooltipSize: size
|
|
3750
|
+
});
|
|
3751
|
+
setTooltipPosition(position);
|
|
3752
|
+
}
|
|
3621
3753
|
setIsVisible(true);
|
|
3622
|
-
}, [isDisabledHover]);
|
|
3754
|
+
}, [isDisabledHover, calculatePosition, maxWidth, verticalPosition, horizontalAlign, size]);
|
|
3623
3755
|
const handleMouseOutWrapper = useCallback14(() => {
|
|
3624
3756
|
setIsVisible(false);
|
|
3625
3757
|
}, []);
|
|
3626
|
-
|
|
3758
|
+
useEffect10(() => {
|
|
3627
3759
|
if (targetRef.current === null) return;
|
|
3628
3760
|
const dimensions = targetRef.current?.getBoundingClientRect();
|
|
3629
3761
|
const position = calculatePosition({ dimensions, maxWidth, verticalPosition, horizontalAlign, tooltipSize: size });
|
|
3630
3762
|
setTooltipPosition(position);
|
|
3631
3763
|
}, [calculatePosition, horizontalAlign, maxWidth, size, verticalPosition]);
|
|
3764
|
+
useEffect10(() => {
|
|
3765
|
+
if (!isVisible) return;
|
|
3766
|
+
const updatePosition = () => {
|
|
3767
|
+
if (targetRef.current === null) return;
|
|
3768
|
+
const dimensions = targetRef.current.getBoundingClientRect();
|
|
3769
|
+
const position = calculatePosition({
|
|
3770
|
+
dimensions,
|
|
3771
|
+
maxWidth,
|
|
3772
|
+
verticalPosition,
|
|
3773
|
+
horizontalAlign,
|
|
3774
|
+
tooltipSize: size
|
|
3775
|
+
});
|
|
3776
|
+
setTooltipPosition(position);
|
|
3777
|
+
};
|
|
3778
|
+
window.addEventListener("scroll", updatePosition, { capture: true, passive: true });
|
|
3779
|
+
window.addEventListener("resize", updatePosition, { passive: true });
|
|
3780
|
+
return () => {
|
|
3781
|
+
window.removeEventListener("scroll", updatePosition, { capture: true });
|
|
3782
|
+
window.removeEventListener("resize", updatePosition);
|
|
3783
|
+
};
|
|
3784
|
+
}, [isVisible, calculatePosition, maxWidth, verticalPosition, horizontalAlign, size]);
|
|
3632
3785
|
return /* @__PURE__ */ jsxs33(
|
|
3633
3786
|
"div",
|
|
3634
3787
|
{
|