@zenkigen-inc/component-ui 1.18.0 → 1.18.2
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 +112 -75
- package/dist/index.d.ts +112 -75
- package/dist/index.js +611 -332
- package/dist/index.mjs +554 -275
- package/package.json +4 -4
package/dist/index.mjs
CHANGED
|
@@ -105,7 +105,7 @@ var createButton = (props) => {
|
|
|
105
105
|
buttonColors[variant].disabled,
|
|
106
106
|
focusVisible.normal,
|
|
107
107
|
{
|
|
108
|
-
"h-6 px-2
|
|
108
|
+
"h-6 px-2": size === "small",
|
|
109
109
|
"h-8 px-3": size === "medium",
|
|
110
110
|
"h-10 px-4 leading-[24px]": size === "large",
|
|
111
111
|
"inline-flex": elementAs === "a",
|
|
@@ -682,7 +682,8 @@ var FileInput = forwardRef(
|
|
|
682
682
|
"border-uiBorder03 bg-white text-text01": !isDisabled && !isDragOver && !hasErrors,
|
|
683
683
|
"border-activeInput bg-activeInput/5": !isDisabled && isDragOver && !hasErrors,
|
|
684
684
|
"border-supportDanger bg-white": hasErrors && !isDisabled,
|
|
685
|
-
"hover:bg-hover02
|
|
685
|
+
"cursor-pointer hover:bg-hover02 active:bg-active02": !isDisabled,
|
|
686
|
+
"hover:bg-uiBackgroundError active:bg-red-red20": !isDisabled && hasErrors,
|
|
686
687
|
"border-disabled01 bg-disabled02 text-textPlaceholder cursor-not-allowed": isDisabled
|
|
687
688
|
}
|
|
688
689
|
);
|
|
@@ -1168,47 +1169,69 @@ function PaginationButton({ page, onClick }) {
|
|
|
1168
1169
|
import { jsx as jsx21, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
1169
1170
|
var START_PAGE = 1;
|
|
1170
1171
|
function Pagination({ currentPage, totalPage, sideNumPagesToShow = 3, onClick }) {
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
const
|
|
1175
|
-
const
|
|
1176
|
-
const
|
|
1172
|
+
if (totalPage < START_PAGE) {
|
|
1173
|
+
return null;
|
|
1174
|
+
}
|
|
1175
|
+
const clamp = (value, min, max) => Math.min(Math.max(value, min), max);
|
|
1176
|
+
const clampedCurrentPage = clamp(currentPage, START_PAGE, totalPage);
|
|
1177
|
+
const maxSideNumPagesToShow = Math.max(0, totalPage - 2);
|
|
1178
|
+
const side = clamp(sideNumPagesToShow, 0, maxSideNumPagesToShow);
|
|
1179
|
+
const minPage = START_PAGE + 1;
|
|
1180
|
+
const maxPage = totalPage - 1;
|
|
1181
|
+
const availablePagesCount = Math.max(0, maxPage - minPage + 1);
|
|
1182
|
+
const hasBothSides = clampedCurrentPage > START_PAGE && clampedCurrentPage < totalPage;
|
|
1183
|
+
const windowSize = Math.min(availablePagesCount, hasBothSides ? side * 2 + 1 : side * 2);
|
|
1184
|
+
let start = minPage;
|
|
1185
|
+
if (windowSize > 0) {
|
|
1186
|
+
if (hasBothSides) {
|
|
1187
|
+
start = Math.max(minPage, Math.min(clampedCurrentPage - side, maxPage - windowSize + 1));
|
|
1188
|
+
} else if (clampedCurrentPage === totalPage) {
|
|
1189
|
+
start = Math.max(minPage, maxPage - windowSize + 1);
|
|
1190
|
+
}
|
|
1191
|
+
}
|
|
1192
|
+
const end = windowSize === 0 ? minPage - 1 : Math.min(maxPage, start + windowSize - 1);
|
|
1177
1193
|
const pageList = [];
|
|
1178
|
-
for (let i = start
|
|
1194
|
+
for (let i = start; i <= end; i++) {
|
|
1179
1195
|
pageList.push(i);
|
|
1180
1196
|
}
|
|
1181
1197
|
const threeDotIconClasses = "flex h-8 w-8 items-center justify-center gap-1 fill-icon01";
|
|
1198
|
+
const isFirstPage = clampedCurrentPage === START_PAGE;
|
|
1199
|
+
const isLastPage = clampedCurrentPage === totalPage;
|
|
1200
|
+
const firstPageInList = pageList.at(0) ?? null;
|
|
1201
|
+
const lastPageInList = pageList.at(-1) ?? null;
|
|
1202
|
+
const hasHeadEllipsis = firstPageInList !== null && firstPageInList > START_PAGE + 1;
|
|
1203
|
+
const hasTailEllipsis = lastPageInList !== null && lastPageInList < totalPage - 1;
|
|
1204
|
+
const hasLastPageButton = totalPage > START_PAGE;
|
|
1182
1205
|
return /* @__PURE__ */ jsx21(
|
|
1183
1206
|
PaginationContext.Provider,
|
|
1184
1207
|
{
|
|
1185
1208
|
value: {
|
|
1186
|
-
currentPage
|
|
1209
|
+
currentPage: clampedCurrentPage
|
|
1187
1210
|
},
|
|
1188
1211
|
children: /* @__PURE__ */ jsxs10("ul", { className: "flex gap-1", children: [
|
|
1189
1212
|
/* @__PURE__ */ jsx21("li", { className: "flex items-center", children: /* @__PURE__ */ jsx21(
|
|
1190
1213
|
IconButton,
|
|
1191
1214
|
{
|
|
1192
|
-
isDisabled:
|
|
1215
|
+
isDisabled: isFirstPage,
|
|
1193
1216
|
variant: "text",
|
|
1194
1217
|
icon: "angle-left",
|
|
1195
1218
|
size: "small",
|
|
1196
|
-
onClick: () => onClick(
|
|
1219
|
+
onClick: () => onClick(Math.max(START_PAGE, clampedCurrentPage - 1))
|
|
1197
1220
|
}
|
|
1198
1221
|
) }),
|
|
1199
1222
|
/* @__PURE__ */ jsx21("li", { children: /* @__PURE__ */ jsx21(PaginationButton, { onClick: () => onClick(START_PAGE), page: START_PAGE }) }),
|
|
1200
|
-
|
|
1223
|
+
hasHeadEllipsis && /* @__PURE__ */ jsx21("li", { className: threeDotIconClasses, children: /* @__PURE__ */ jsx21(Icon, { name: "more", size: "small" }) }),
|
|
1201
1224
|
pageList.map((page, index) => /* @__PURE__ */ jsx21("li", { children: /* @__PURE__ */ jsx21(PaginationButton, { onClick: () => onClick(page), page }) }, index)),
|
|
1202
|
-
|
|
1203
|
-
/* @__PURE__ */ jsx21("li", { children: /* @__PURE__ */ jsx21(PaginationButton, { onClick: () => onClick(totalPage), page: totalPage }) }),
|
|
1225
|
+
hasTailEllipsis && /* @__PURE__ */ jsx21("li", { className: threeDotIconClasses, children: /* @__PURE__ */ jsx21(Icon, { name: "more", size: "small" }) }),
|
|
1226
|
+
hasLastPageButton && /* @__PURE__ */ jsx21("li", { children: /* @__PURE__ */ jsx21(PaginationButton, { onClick: () => onClick(totalPage), page: totalPage }) }),
|
|
1204
1227
|
/* @__PURE__ */ jsx21("li", { className: "flex items-center", children: /* @__PURE__ */ jsx21(
|
|
1205
1228
|
IconButton,
|
|
1206
1229
|
{
|
|
1207
|
-
isDisabled:
|
|
1230
|
+
isDisabled: isLastPage,
|
|
1208
1231
|
variant: "text",
|
|
1209
1232
|
icon: "angle-right",
|
|
1210
1233
|
size: "small",
|
|
1211
|
-
onClick: () => onClick(
|
|
1234
|
+
onClick: () => onClick(Math.min(totalPage, clampedCurrentPage + 1))
|
|
1212
1235
|
}
|
|
1213
1236
|
) })
|
|
1214
1237
|
] })
|
|
@@ -1488,50 +1511,182 @@ function PaginationSelect({
|
|
|
1488
1511
|
}
|
|
1489
1512
|
|
|
1490
1513
|
// src/password-input/password-input.tsx
|
|
1491
|
-
import { forwardRef as
|
|
1514
|
+
import { forwardRef as forwardRef6, useState as useState8 } from "react";
|
|
1492
1515
|
|
|
1493
1516
|
// src/text-input/text-input.tsx
|
|
1517
|
+
import { clsx as clsx22 } from "clsx";
|
|
1518
|
+
import { Children, cloneElement, forwardRef as forwardRef5, isValidElement, useId as useId2, useMemo } from "react";
|
|
1519
|
+
|
|
1520
|
+
// src/text-input/text-input-context.tsx
|
|
1521
|
+
import { createContext as createContext5, useContext as useContext7 } from "react";
|
|
1522
|
+
var TextInputCompoundContext = createContext5(null);
|
|
1523
|
+
var useTextInputCompoundContext = (componentName) => {
|
|
1524
|
+
const context = useContext7(TextInputCompoundContext);
|
|
1525
|
+
if (context == null) {
|
|
1526
|
+
throw new Error(`${componentName} \u3092\u4F7F\u7528\u3059\u308B\u306B\u306F TextInput \u306E\u5B50\u8981\u7D20\u3068\u3057\u3066\u914D\u7F6E\u3059\u308B\u5FC5\u8981\u304C\u3042\u308B\u3002`);
|
|
1527
|
+
}
|
|
1528
|
+
return context;
|
|
1529
|
+
};
|
|
1530
|
+
|
|
1531
|
+
// src/text-input/text-input-error-message.tsx
|
|
1494
1532
|
import { clsx as clsx20 } from "clsx";
|
|
1495
1533
|
import { forwardRef as forwardRef3 } from "react";
|
|
1496
|
-
import { jsx as jsx26
|
|
1497
|
-
var
|
|
1498
|
-
({
|
|
1499
|
-
const
|
|
1500
|
-
const
|
|
1501
|
-
const
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
"bg-disabled02 border-disabled01": disabled,
|
|
1508
|
-
"pr-2": size === "medium" && hasTrailingElement,
|
|
1509
|
-
"pr-3": size === "large" && hasTrailingElement
|
|
1510
|
-
});
|
|
1511
|
-
const inputClasses = clsx20("flex-1 outline-0 placeholder:text-textPlaceholder disabled:text-textPlaceholder", {
|
|
1512
|
-
["typography-label14regular min-h-8 px-2"]: size === "medium",
|
|
1513
|
-
["typography-label16regular min-h-10 px-3"]: size === "large",
|
|
1514
|
-
"text-text01": !isError,
|
|
1515
|
-
"text-supportError": isError,
|
|
1516
|
-
"pr-0": hasTrailingElement
|
|
1517
|
-
});
|
|
1518
|
-
return /* @__PURE__ */ jsxs15("div", { className: inputWrapClasses, children: [
|
|
1519
|
-
/* @__PURE__ */ jsx26("input", { ref, size: 1, className: inputClasses, disabled, onChange: props.onChange, ...props }),
|
|
1520
|
-
after,
|
|
1521
|
-
isShowClearButton && /* @__PURE__ */ jsx26(IconButton, { variant: "text", icon: "close", size: "small", onClick: onClickClearButton })
|
|
1522
|
-
] });
|
|
1534
|
+
import { jsx as jsx26 } from "react/jsx-runtime";
|
|
1535
|
+
var TextInputErrorMessage = forwardRef3(
|
|
1536
|
+
({ "aria-live": ariaLive = "assertive", ...props }, ref) => {
|
|
1537
|
+
const { inputProps } = useTextInputCompoundContext("TextInput.ErrorMessage");
|
|
1538
|
+
const typographyClass = inputProps.size === "large" ? "typography-label12regular" : "typography-label11regular";
|
|
1539
|
+
const shouldRender = inputProps.isError === true;
|
|
1540
|
+
if (!shouldRender) {
|
|
1541
|
+
return null;
|
|
1542
|
+
}
|
|
1543
|
+
const errorMessageClassName = clsx20(typographyClass, "text-supportError");
|
|
1544
|
+
return /* @__PURE__ */ jsx26("div", { ref, className: errorMessageClassName, "aria-live": ariaLive, ...props });
|
|
1523
1545
|
}
|
|
1524
1546
|
);
|
|
1525
|
-
|
|
1547
|
+
TextInputErrorMessage.displayName = "TextInput.ErrorMessage";
|
|
1526
1548
|
|
|
1527
|
-
// src/
|
|
1549
|
+
// src/text-input/text-input-helper-message.tsx
|
|
1550
|
+
import { clsx as clsx21 } from "clsx";
|
|
1551
|
+
import { forwardRef as forwardRef4 } from "react";
|
|
1528
1552
|
import { jsx as jsx27 } from "react/jsx-runtime";
|
|
1529
|
-
var
|
|
1553
|
+
var TextInputHelperMessage = forwardRef4((props, ref) => {
|
|
1554
|
+
const { inputProps } = useTextInputCompoundContext("TextInput.HelperMessage");
|
|
1555
|
+
const typographyClass = inputProps.size === "large" ? "typography-label12regular" : "typography-label11regular";
|
|
1556
|
+
const helperMessageClassName = clsx21(typographyClass, "text-text02");
|
|
1557
|
+
return /* @__PURE__ */ jsx27("div", { ref, className: helperMessageClassName, ...props });
|
|
1558
|
+
});
|
|
1559
|
+
TextInputHelperMessage.displayName = "TextInput.HelperMessage";
|
|
1560
|
+
|
|
1561
|
+
// src/text-input/text-input.tsx
|
|
1562
|
+
import { jsx as jsx28, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
1563
|
+
function TextInputInner({
|
|
1564
|
+
size = "medium",
|
|
1565
|
+
isError = false,
|
|
1566
|
+
disabled = false,
|
|
1567
|
+
onClickClearButton,
|
|
1568
|
+
after,
|
|
1569
|
+
children,
|
|
1570
|
+
...props
|
|
1571
|
+
}, ref) {
|
|
1572
|
+
const autoGeneratedId = useId2();
|
|
1573
|
+
const { className: _className, ...restInputProps } = props;
|
|
1574
|
+
const inputPropsForContext = useMemo(
|
|
1575
|
+
() => ({
|
|
1576
|
+
...restInputProps,
|
|
1577
|
+
size,
|
|
1578
|
+
isError,
|
|
1579
|
+
disabled,
|
|
1580
|
+
onClickClearButton,
|
|
1581
|
+
after
|
|
1582
|
+
}),
|
|
1583
|
+
[restInputProps, size, isError, disabled, onClickClearButton, after]
|
|
1584
|
+
);
|
|
1585
|
+
const contextValue = useMemo(
|
|
1586
|
+
() => ({
|
|
1587
|
+
inputProps: inputPropsForContext,
|
|
1588
|
+
forwardedRef: ref
|
|
1589
|
+
}),
|
|
1590
|
+
[inputPropsForContext, ref]
|
|
1591
|
+
);
|
|
1592
|
+
const helperMessageIds = [];
|
|
1593
|
+
const errorIds = [];
|
|
1594
|
+
const describedByBaseId = restInputProps.id ?? autoGeneratedId;
|
|
1595
|
+
const enhancedChildren = Children.map(children, (child) => {
|
|
1596
|
+
if (!isValidElement(child)) {
|
|
1597
|
+
return child;
|
|
1598
|
+
}
|
|
1599
|
+
if (child.type === TextInputHelperMessage) {
|
|
1600
|
+
const helperChild = child;
|
|
1601
|
+
const assignedId = helperChild.props.id ?? `${describedByBaseId}-helper-${helperMessageIds.length + 1}`;
|
|
1602
|
+
helperMessageIds.push(assignedId);
|
|
1603
|
+
return cloneElement(helperChild, { id: assignedId });
|
|
1604
|
+
}
|
|
1605
|
+
if (child.type === TextInputErrorMessage && isError) {
|
|
1606
|
+
const errorChild = child;
|
|
1607
|
+
const assignedId = errorChild.props.id ?? `${describedByBaseId}-error-${errorIds.length + 1}`;
|
|
1608
|
+
errorIds.push(assignedId);
|
|
1609
|
+
return cloneElement(errorChild, { id: assignedId });
|
|
1610
|
+
}
|
|
1611
|
+
return child;
|
|
1612
|
+
});
|
|
1613
|
+
const describedByFromProps = typeof restInputProps["aria-describedby"] === "string" ? restInputProps["aria-describedby"] : null;
|
|
1614
|
+
const describedByList = [describedByFromProps, ...helperMessageIds, ...errorIds].filter(
|
|
1615
|
+
(id) => typeof id === "string" && id.trim().length > 0
|
|
1616
|
+
);
|
|
1617
|
+
const describedByProps = describedByList.length > 0 ? {
|
|
1618
|
+
"aria-describedby": describedByList.join(" ")
|
|
1619
|
+
} : {};
|
|
1620
|
+
const shouldMarkInvalid = isError === true || errorIds.length > 0;
|
|
1621
|
+
const ariaInvalidFromProps = restInputProps["aria-invalid"];
|
|
1622
|
+
const ariaInvalidValue = ariaInvalidFromProps != null ? ariaInvalidFromProps : shouldMarkInvalid ? true : null;
|
|
1623
|
+
const ariaInvalidProps = ariaInvalidValue == null ? {} : { "aria-invalid": ariaInvalidValue };
|
|
1624
|
+
const mergedInputProps = {
|
|
1625
|
+
...restInputProps,
|
|
1626
|
+
...describedByProps,
|
|
1627
|
+
...ariaInvalidProps,
|
|
1628
|
+
disabled
|
|
1629
|
+
};
|
|
1630
|
+
const isShowClearButton = !!onClickClearButton && restInputProps.value.length !== 0 && !disabled;
|
|
1631
|
+
const hasTrailingElement = isShowClearButton || after != null;
|
|
1632
|
+
const inputWrapClasses = clsx22("relative flex items-center gap-2 overflow-hidden rounded border", {
|
|
1633
|
+
"border-uiBorder02": !isError && !disabled,
|
|
1634
|
+
"border-supportError": isError && !disabled,
|
|
1635
|
+
"hover:border-hoverInput": !disabled && !isError,
|
|
1636
|
+
"hover:focus-within:border-activeInput": !isError,
|
|
1637
|
+
"focus-within:border-activeInput": !isError,
|
|
1638
|
+
"bg-disabled02 border-disabled01": disabled,
|
|
1639
|
+
"pr-2": size === "medium" && hasTrailingElement,
|
|
1640
|
+
"pr-3": size === "large" && hasTrailingElement
|
|
1641
|
+
});
|
|
1642
|
+
const inputClasses = clsx22("flex-1 outline-0 placeholder:text-textPlaceholder disabled:text-textPlaceholder", {
|
|
1643
|
+
["typography-label14regular min-h-8 px-2"]: size === "medium",
|
|
1644
|
+
["typography-label16regular min-h-10 px-3"]: size === "large",
|
|
1645
|
+
"text-text01": !isError,
|
|
1646
|
+
"text-supportError": isError,
|
|
1647
|
+
"pr-0": hasTrailingElement
|
|
1648
|
+
});
|
|
1649
|
+
const inputElement = /* @__PURE__ */ jsxs15("div", { className: inputWrapClasses, children: [
|
|
1650
|
+
/* @__PURE__ */ jsx28("input", { ref, size: 1, className: inputClasses, ...mergedInputProps }),
|
|
1651
|
+
after,
|
|
1652
|
+
isShowClearButton && /* @__PURE__ */ jsx28(IconButton, { variant: "text", icon: "close", size: "small", onClick: onClickClearButton })
|
|
1653
|
+
] });
|
|
1654
|
+
const stackedChildren = enhancedChildren == null ? [] : Children.toArray(enhancedChildren);
|
|
1655
|
+
const hasMessageChildren = stackedChildren.length > 0;
|
|
1656
|
+
if (!hasMessageChildren) {
|
|
1657
|
+
return /* @__PURE__ */ jsx28(TextInputCompoundContext.Provider, { value: contextValue, children: inputElement });
|
|
1658
|
+
}
|
|
1659
|
+
return /* @__PURE__ */ jsx28(TextInputCompoundContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsxs15("div", { className: "flex flex-col gap-2", children: [
|
|
1660
|
+
inputElement,
|
|
1661
|
+
stackedChildren
|
|
1662
|
+
] }) });
|
|
1663
|
+
}
|
|
1664
|
+
var attachStatics = (component) => {
|
|
1665
|
+
component.HelperMessage = TextInputHelperMessage;
|
|
1666
|
+
component.ErrorMessage = TextInputErrorMessage;
|
|
1667
|
+
component.displayName = "TextInput";
|
|
1668
|
+
return component;
|
|
1669
|
+
};
|
|
1670
|
+
var TextInputPublic = forwardRef5(function TextInputPublic2(props, ref) {
|
|
1671
|
+
return TextInputInner(props, ref);
|
|
1672
|
+
});
|
|
1673
|
+
var InternalTextInputBase = forwardRef5(
|
|
1674
|
+
function InternalTextInputBase2(props, ref) {
|
|
1675
|
+
return TextInputInner(props, ref);
|
|
1676
|
+
}
|
|
1677
|
+
);
|
|
1678
|
+
var TextInput = attachStatics(TextInputPublic);
|
|
1679
|
+
var InternalTextInput = attachStatics(InternalTextInputBase);
|
|
1680
|
+
|
|
1681
|
+
// src/password-input/password-input.tsx
|
|
1682
|
+
import { jsx as jsx29 } from "react/jsx-runtime";
|
|
1683
|
+
var PasswordInputBase = forwardRef6(function PasswordInput({ disabled = false, children, ...props }, ref) {
|
|
1530
1684
|
const [isPasswordVisible, setIsPasswordVisible] = useState8(false);
|
|
1685
|
+
const { className: _className, ...textInputProps } = props;
|
|
1531
1686
|
const handlePasswordVisibilityToggle = () => {
|
|
1532
|
-
setIsPasswordVisible(!
|
|
1687
|
+
setIsPasswordVisible((prev) => !prev);
|
|
1533
1688
|
};
|
|
1534
|
-
const passwordToggleButton = /* @__PURE__ */
|
|
1689
|
+
const passwordToggleButton = /* @__PURE__ */ jsx29(
|
|
1535
1690
|
IconButton,
|
|
1536
1691
|
{
|
|
1537
1692
|
variant: "text",
|
|
@@ -1542,27 +1697,32 @@ var PasswordInput = forwardRef4(({ disabled = false, ...props }, ref) => {
|
|
|
1542
1697
|
"aria-label": isPasswordVisible === true ? "\u30D1\u30B9\u30EF\u30FC\u30C9\u3092\u975E\u8868\u793A\u306B\u3059\u308B" : "\u30D1\u30B9\u30EF\u30FC\u30C9\u3092\u8868\u793A\u3059\u308B"
|
|
1543
1698
|
}
|
|
1544
1699
|
);
|
|
1545
|
-
return /* @__PURE__ */
|
|
1546
|
-
|
|
1700
|
+
return /* @__PURE__ */ jsx29(
|
|
1701
|
+
InternalTextInput,
|
|
1547
1702
|
{
|
|
1548
1703
|
ref,
|
|
1549
1704
|
type: isPasswordVisible === true ? "text" : "password",
|
|
1550
1705
|
disabled,
|
|
1551
|
-
|
|
1552
|
-
...
|
|
1706
|
+
after: passwordToggleButton,
|
|
1707
|
+
...textInputProps,
|
|
1708
|
+
children
|
|
1553
1709
|
}
|
|
1554
1710
|
);
|
|
1555
1711
|
});
|
|
1556
|
-
|
|
1712
|
+
var PasswordInput2 = Object.assign(PasswordInputBase, {
|
|
1713
|
+
HelperMessage: TextInputHelperMessage,
|
|
1714
|
+
ErrorMessage: TextInputErrorMessage,
|
|
1715
|
+
displayName: "PasswordInput"
|
|
1716
|
+
});
|
|
1557
1717
|
|
|
1558
1718
|
// src/popover/popover.tsx
|
|
1559
1719
|
import { autoUpdate as autoUpdate2, offset as offset2, useFloating as useFloating2, useId as useFloatingId } from "@floating-ui/react";
|
|
1560
|
-
import { useEffect as useEffect4, useMemo, useRef as useRef4 } from "react";
|
|
1720
|
+
import { useEffect as useEffect4, useMemo as useMemo2, useRef as useRef4 } from "react";
|
|
1561
1721
|
|
|
1562
1722
|
// src/popover/popover-content.tsx
|
|
1563
1723
|
import { FloatingPortal as FloatingPortal2, useDismiss, useInteractions, useRole } from "@floating-ui/react";
|
|
1564
1724
|
import * as React from "react";
|
|
1565
|
-
import { forwardRef as
|
|
1725
|
+
import { forwardRef as forwardRef7, useCallback as useCallback6, useEffect as useEffect3 } from "react";
|
|
1566
1726
|
|
|
1567
1727
|
// src/utils/react-utils.ts
|
|
1568
1728
|
function composeRefs(...refs) {
|
|
@@ -1584,10 +1744,10 @@ function isElement(node) {
|
|
|
1584
1744
|
}
|
|
1585
1745
|
|
|
1586
1746
|
// src/popover/popover-context.ts
|
|
1587
|
-
import { createContext as
|
|
1588
|
-
var PopoverContext =
|
|
1747
|
+
import { createContext as createContext6, useContext as useContext8 } from "react";
|
|
1748
|
+
var PopoverContext = createContext6(null);
|
|
1589
1749
|
var usePopoverContext = () => {
|
|
1590
|
-
const context =
|
|
1750
|
+
const context = useContext8(PopoverContext);
|
|
1591
1751
|
if (context == null) {
|
|
1592
1752
|
throw new Error("Popover components must be used inside <Popover.Root>");
|
|
1593
1753
|
}
|
|
@@ -1595,8 +1755,8 @@ var usePopoverContext = () => {
|
|
|
1595
1755
|
};
|
|
1596
1756
|
|
|
1597
1757
|
// src/popover/popover-content.tsx
|
|
1598
|
-
import { jsx as
|
|
1599
|
-
var PopoverContent =
|
|
1758
|
+
import { jsx as jsx30 } from "react/jsx-runtime";
|
|
1759
|
+
var PopoverContent = forwardRef7(function PopoverContent2({ children }, ref) {
|
|
1600
1760
|
const { isOpen, triggerRef, floating, panelId, onClose } = usePopoverContext();
|
|
1601
1761
|
const shouldCloseOnOutsidePress = useCallback6(
|
|
1602
1762
|
(event) => {
|
|
@@ -1651,7 +1811,7 @@ var PopoverContent = forwardRef5(function PopoverContent2({ children }, ref) {
|
|
|
1651
1811
|
...childProps.role == null && { role: "dialog" }
|
|
1652
1812
|
});
|
|
1653
1813
|
}
|
|
1654
|
-
return /* @__PURE__ */
|
|
1814
|
+
return /* @__PURE__ */ jsx30(FloatingPortal2, { children: isOpen ? /* @__PURE__ */ jsx30(
|
|
1655
1815
|
"div",
|
|
1656
1816
|
{
|
|
1657
1817
|
...interactions.getFloatingProps({
|
|
@@ -1672,8 +1832,8 @@ var PopoverContent = forwardRef5(function PopoverContent2({ children }, ref) {
|
|
|
1672
1832
|
|
|
1673
1833
|
// src/popover/popover-trigger.tsx
|
|
1674
1834
|
import * as React2 from "react";
|
|
1675
|
-
import { forwardRef as
|
|
1676
|
-
var PopoverTrigger =
|
|
1835
|
+
import { forwardRef as forwardRef8 } from "react";
|
|
1836
|
+
var PopoverTrigger = forwardRef8(function PopoverTrigger2({ children }, ref) {
|
|
1677
1837
|
const { isOpen, floating, triggerRef, anchorRef, panelId } = usePopoverContext();
|
|
1678
1838
|
if (!isElement(children)) {
|
|
1679
1839
|
return null;
|
|
@@ -1701,7 +1861,7 @@ var PopoverTrigger = forwardRef6(function PopoverTrigger2({ children }, ref) {
|
|
|
1701
1861
|
});
|
|
1702
1862
|
|
|
1703
1863
|
// src/popover/popover.tsx
|
|
1704
|
-
import { jsx as
|
|
1864
|
+
import { jsx as jsx31 } from "react/jsx-runtime";
|
|
1705
1865
|
function Popover({
|
|
1706
1866
|
isOpen,
|
|
1707
1867
|
children,
|
|
@@ -1730,7 +1890,7 @@ function Popover({
|
|
|
1730
1890
|
}, [anchorRef, floating.refs]);
|
|
1731
1891
|
const contentId = useFloatingId() ?? "";
|
|
1732
1892
|
const panelId = `${contentId}-panel`;
|
|
1733
|
-
const contextValue =
|
|
1893
|
+
const contextValue = useMemo2(
|
|
1734
1894
|
() => ({
|
|
1735
1895
|
isOpen,
|
|
1736
1896
|
triggerRef,
|
|
@@ -1742,53 +1902,53 @@ function Popover({
|
|
|
1742
1902
|
}),
|
|
1743
1903
|
[isOpen, triggerRef, anchorRef, floating, contentId, panelId, onClose]
|
|
1744
1904
|
);
|
|
1745
|
-
return /* @__PURE__ */
|
|
1905
|
+
return /* @__PURE__ */ jsx31(PopoverContext.Provider, { value: contextValue, children });
|
|
1746
1906
|
}
|
|
1747
1907
|
Popover.Trigger = PopoverTrigger;
|
|
1748
1908
|
Popover.Content = PopoverContent;
|
|
1749
1909
|
|
|
1750
1910
|
// src/popup/popup.tsx
|
|
1751
|
-
import { useContext as
|
|
1911
|
+
import { useContext as useContext10 } from "react";
|
|
1752
1912
|
|
|
1753
1913
|
// src/popup/popup-body.tsx
|
|
1754
|
-
import { jsx as
|
|
1914
|
+
import { jsx as jsx32 } from "react/jsx-runtime";
|
|
1755
1915
|
function PopupBody({ children }) {
|
|
1756
|
-
return /* @__PURE__ */
|
|
1916
|
+
return /* @__PURE__ */ jsx32("div", { className: "overflow-y-auto", children });
|
|
1757
1917
|
}
|
|
1758
1918
|
|
|
1759
1919
|
// src/popup/popup-context.ts
|
|
1760
|
-
import { createContext as
|
|
1761
|
-
var PopupContext =
|
|
1920
|
+
import { createContext as createContext7 } from "react";
|
|
1921
|
+
var PopupContext = createContext7({
|
|
1762
1922
|
isOpen: false,
|
|
1763
1923
|
onClose: () => null
|
|
1764
1924
|
});
|
|
1765
1925
|
|
|
1766
1926
|
// src/popup/popup-footer.tsx
|
|
1767
|
-
import { jsx as
|
|
1927
|
+
import { jsx as jsx33 } from "react/jsx-runtime";
|
|
1768
1928
|
function PopupFooter({ children }) {
|
|
1769
|
-
return /* @__PURE__ */
|
|
1929
|
+
return /* @__PURE__ */ jsx33("div", { className: "flex w-full shrink-0 items-center rounded-b-lg px-6 py-3", children });
|
|
1770
1930
|
}
|
|
1771
1931
|
|
|
1772
1932
|
// src/popup/popup-header.tsx
|
|
1773
|
-
import { useContext as
|
|
1774
|
-
import { jsx as
|
|
1933
|
+
import { useContext as useContext9 } from "react";
|
|
1934
|
+
import { jsx as jsx34, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
1775
1935
|
function PopupHeader({ children, before }) {
|
|
1776
|
-
const { onClose } =
|
|
1936
|
+
const { onClose } = useContext9(PopupContext);
|
|
1777
1937
|
return /* @__PURE__ */ jsxs16("div", { className: "typography-h5 flex h-12 w-full shrink-0 items-start justify-between rounded-t-lg px-6 pt-3 text-text01", children: [
|
|
1778
1938
|
/* @__PURE__ */ jsxs16("div", { className: "flex items-center gap-1", children: [
|
|
1779
1939
|
before,
|
|
1780
1940
|
children
|
|
1781
1941
|
] }),
|
|
1782
|
-
onClose && /* @__PURE__ */
|
|
1942
|
+
onClose && /* @__PURE__ */ jsx34(IconButton, { icon: "close", size: "small", variant: "text", onClick: onClose })
|
|
1783
1943
|
] });
|
|
1784
1944
|
}
|
|
1785
1945
|
|
|
1786
1946
|
// src/popup/popup.tsx
|
|
1787
|
-
import { jsx as
|
|
1947
|
+
import { jsx as jsx35 } from "react/jsx-runtime";
|
|
1788
1948
|
var LIMIT_WIDTH2 = 320;
|
|
1789
1949
|
var LIMIT_HEIGHT2 = 184;
|
|
1790
1950
|
function useOptionalPopoverContext() {
|
|
1791
|
-
return
|
|
1951
|
+
return useContext10(PopoverContext);
|
|
1792
1952
|
}
|
|
1793
1953
|
function Popup({ children, isOpen: controlledIsOpen, width = 480, height, onClose }) {
|
|
1794
1954
|
const renderWidth = typeof width === "number" ? Math.max(width, LIMIT_WIDTH2) : width;
|
|
@@ -1799,7 +1959,7 @@ function Popup({ children, isOpen: controlledIsOpen, width = 480, height, onClos
|
|
|
1799
1959
|
if (!isOpen) {
|
|
1800
1960
|
return null;
|
|
1801
1961
|
}
|
|
1802
|
-
return /* @__PURE__ */
|
|
1962
|
+
return /* @__PURE__ */ jsx35(PopupContext.Provider, { value: { isOpen, onClose }, children: /* @__PURE__ */ jsx35(
|
|
1803
1963
|
"div",
|
|
1804
1964
|
{
|
|
1805
1965
|
className: "grid max-h-full grid-rows-[max-content_1fr_max-content] flex-col rounded-lg bg-uiBackground01 shadow-floatingShadow",
|
|
@@ -1814,9 +1974,9 @@ Popup.Footer = PopupFooter;
|
|
|
1814
1974
|
|
|
1815
1975
|
// src/radio/radio.tsx
|
|
1816
1976
|
import { focusVisible as focusVisible10 } from "@zenkigen-inc/component-theme";
|
|
1817
|
-
import
|
|
1977
|
+
import clsx23 from "clsx";
|
|
1818
1978
|
import { useCallback as useCallback7, useState as useState9 } from "react";
|
|
1819
|
-
import { jsx as
|
|
1979
|
+
import { jsx as jsx36, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
1820
1980
|
function Radio({ name, value, id, label, isChecked = false, isDisabled = false, onChange }) {
|
|
1821
1981
|
const [isMouseOver, setIsMouseOver] = useState9(false);
|
|
1822
1982
|
const handleMouseOverInput = useCallback7(() => {
|
|
@@ -1829,11 +1989,11 @@ function Radio({ name, value, id, label, isChecked = false, isDisabled = false,
|
|
|
1829
1989
|
(e) => !isDisabled && onChange?.(e),
|
|
1830
1990
|
[isDisabled, onChange]
|
|
1831
1991
|
);
|
|
1832
|
-
const inputClasses =
|
|
1992
|
+
const inputClasses = clsx23("peer absolute z-[1] size-6 opacity-0", {
|
|
1833
1993
|
"cursor-not-allowed": isDisabled,
|
|
1834
1994
|
"cursor-pointer": !isDisabled
|
|
1835
1995
|
});
|
|
1836
|
-
const boxClasses =
|
|
1996
|
+
const boxClasses = clsx23(
|
|
1837
1997
|
"inline-flex size-5 items-center justify-center rounded-full border border-solid bg-white",
|
|
1838
1998
|
focusVisible10.normalPeer,
|
|
1839
1999
|
{
|
|
@@ -1844,22 +2004,22 @@ function Radio({ name, value, id, label, isChecked = false, isDisabled = false,
|
|
|
1844
2004
|
"cursor-pointer": !isDisabled
|
|
1845
2005
|
}
|
|
1846
2006
|
);
|
|
1847
|
-
const afterClasses =
|
|
2007
|
+
const afterClasses = clsx23("absolute inset-0 m-auto block size-3 rounded-full", {
|
|
1848
2008
|
"bg-disabled01": isDisabled && isChecked,
|
|
1849
2009
|
"bg-activeSelectedUi": !isDisabled && isChecked,
|
|
1850
2010
|
"scale-0": !isChecked,
|
|
1851
2011
|
"scale-100": isChecked
|
|
1852
2012
|
});
|
|
1853
|
-
const hoverIndicatorClasses =
|
|
2013
|
+
const hoverIndicatorClasses = clsx23("inline-block size-3 rounded-full", {
|
|
1854
2014
|
"bg-hoverUi": !isDisabled && !isChecked && isMouseOver
|
|
1855
2015
|
});
|
|
1856
|
-
const labelClasses =
|
|
2016
|
+
const labelClasses = clsx23("typography-label14regular ml-2 flex-[1_0_0] select-none break-all", {
|
|
1857
2017
|
"pointer-events-none cursor-not-allowed text-disabled01": isDisabled,
|
|
1858
2018
|
"cursor-pointer text-text01": !isDisabled
|
|
1859
2019
|
});
|
|
1860
2020
|
return /* @__PURE__ */ jsxs17("div", { className: "flex items-center", children: [
|
|
1861
2021
|
/* @__PURE__ */ jsxs17("div", { className: "flex size-6 items-center justify-center", children: [
|
|
1862
|
-
/* @__PURE__ */
|
|
2022
|
+
/* @__PURE__ */ jsx36(
|
|
1863
2023
|
"input",
|
|
1864
2024
|
{
|
|
1865
2025
|
type: "checkbox",
|
|
@@ -1874,32 +2034,32 @@ function Radio({ name, value, id, label, isChecked = false, isDisabled = false,
|
|
|
1874
2034
|
className: inputClasses
|
|
1875
2035
|
}
|
|
1876
2036
|
),
|
|
1877
|
-
/* @__PURE__ */
|
|
1878
|
-
/* @__PURE__ */
|
|
1879
|
-
/* @__PURE__ */
|
|
2037
|
+
/* @__PURE__ */ jsx36("div", { className: boxClasses, children: /* @__PURE__ */ jsxs17("div", { className: "relative flex size-5 flex-[0_0_auto] items-center justify-center", children: [
|
|
2038
|
+
/* @__PURE__ */ jsx36("span", { className: afterClasses }),
|
|
2039
|
+
/* @__PURE__ */ jsx36("span", { className: hoverIndicatorClasses })
|
|
1880
2040
|
] }) })
|
|
1881
2041
|
] }),
|
|
1882
|
-
/* @__PURE__ */
|
|
2042
|
+
/* @__PURE__ */ jsx36("label", { htmlFor: id, className: labelClasses, children: label })
|
|
1883
2043
|
] });
|
|
1884
2044
|
}
|
|
1885
2045
|
|
|
1886
2046
|
// src/search/search.tsx
|
|
1887
|
-
import { clsx as
|
|
1888
|
-
import { forwardRef as
|
|
1889
|
-
import { jsx as
|
|
1890
|
-
var Search =
|
|
1891
|
-
const classes =
|
|
2047
|
+
import { clsx as clsx24 } from "clsx";
|
|
2048
|
+
import { forwardRef as forwardRef9 } from "react";
|
|
2049
|
+
import { jsx as jsx37, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
2050
|
+
var Search = forwardRef9(({ width = "100%", size = "medium", ...props }, ref) => {
|
|
2051
|
+
const classes = clsx24(
|
|
1892
2052
|
"flex items-center rounded-full border border-uiBorder02 bg-uiBackground01 focus-within:border-activeInput",
|
|
1893
2053
|
{ "h-8 px-3": size === "medium" },
|
|
1894
2054
|
{ "h-10 px-4": size === "large" }
|
|
1895
2055
|
);
|
|
1896
|
-
const inputClasses =
|
|
2056
|
+
const inputClasses = clsx24("mx-2 h-full flex-1 text-text01 outline-0 placeholder:text-textPlaceholder", {
|
|
1897
2057
|
["typography-label14regular"]: size === "medium",
|
|
1898
2058
|
["typography-label16regular"]: size === "large"
|
|
1899
2059
|
});
|
|
1900
|
-
return /* @__PURE__ */
|
|
1901
|
-
/* @__PURE__ */
|
|
1902
|
-
/* @__PURE__ */
|
|
2060
|
+
return /* @__PURE__ */ jsx37("div", { className: "relative", ref, children: /* @__PURE__ */ jsx37("form", { onSubmit: props.onSubmit, children: /* @__PURE__ */ jsxs18("div", { className: classes, style: { width }, children: [
|
|
2061
|
+
/* @__PURE__ */ jsx37(Icon, { name: "search", color: "icon01", size: "medium" }),
|
|
2062
|
+
/* @__PURE__ */ jsx37(
|
|
1903
2063
|
"input",
|
|
1904
2064
|
{
|
|
1905
2065
|
type: "text",
|
|
@@ -1910,7 +2070,7 @@ var Search = forwardRef7(({ width = "100%", size = "medium", ...props }, ref) =>
|
|
|
1910
2070
|
onChange: props.onChange
|
|
1911
2071
|
}
|
|
1912
2072
|
),
|
|
1913
|
-
props.onClickClearButton && props.value && props.value.length !== 0 && /* @__PURE__ */
|
|
2073
|
+
props.onClickClearButton && props.value && props.value.length !== 0 && /* @__PURE__ */ jsx37(
|
|
1914
2074
|
IconButton,
|
|
1915
2075
|
{
|
|
1916
2076
|
variant: "text",
|
|
@@ -1925,17 +2085,17 @@ var Search = forwardRef7(({ width = "100%", size = "medium", ...props }, ref) =>
|
|
|
1925
2085
|
Search.displayName = "Search";
|
|
1926
2086
|
|
|
1927
2087
|
// src/segmented-control/segmented-control.tsx
|
|
1928
|
-
import React4, { Children, useRef as useRef6 } from "react";
|
|
2088
|
+
import React4, { Children as Children2, useRef as useRef6 } from "react";
|
|
1929
2089
|
|
|
1930
2090
|
// src/segmented-control/segmented-control-context.ts
|
|
1931
|
-
import { createContext as
|
|
1932
|
-
var SegmentedControlContext =
|
|
2091
|
+
import { createContext as createContext8 } from "react";
|
|
2092
|
+
var SegmentedControlContext = createContext8(null);
|
|
1933
2093
|
|
|
1934
2094
|
// src/segmented-control/segmented-control-item.tsx
|
|
1935
2095
|
import { focusVisible as focusVisible11 } from "@zenkigen-inc/component-theme";
|
|
1936
|
-
import { clsx as
|
|
1937
|
-
import { useContext as
|
|
1938
|
-
import { jsx as
|
|
2096
|
+
import { clsx as clsx25 } from "clsx";
|
|
2097
|
+
import { useContext as useContext11, useEffect as useEffect5, useRef as useRef5 } from "react";
|
|
2098
|
+
import { jsx as jsx38, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
1939
2099
|
var SegmentedControlItem = ({
|
|
1940
2100
|
label,
|
|
1941
2101
|
value,
|
|
@@ -1944,7 +2104,7 @@ var SegmentedControlItem = ({
|
|
|
1944
2104
|
"aria-label": ariaLabel,
|
|
1945
2105
|
...rest
|
|
1946
2106
|
}) => {
|
|
1947
|
-
const context =
|
|
2107
|
+
const context = useContext11(SegmentedControlContext);
|
|
1948
2108
|
const buttonRef = useRef5(null);
|
|
1949
2109
|
const lastInteractionWasMouse = useRef5(false);
|
|
1950
2110
|
if (context === null) {
|
|
@@ -1984,7 +2144,7 @@ var SegmentedControlItem = ({
|
|
|
1984
2144
|
lastInteractionWasMouse.current = false;
|
|
1985
2145
|
onBlur?.();
|
|
1986
2146
|
};
|
|
1987
|
-
const buttonClasses =
|
|
2147
|
+
const buttonClasses = clsx25("relative flex items-center justify-center gap-1 rounded", focusVisible11.normal, {
|
|
1988
2148
|
"px-2 min-h-[24px] typography-label12regular": size === "small",
|
|
1989
2149
|
"px-4 min-h-[32px] typography-label14regular": size === "medium",
|
|
1990
2150
|
// States - Default with hover
|
|
@@ -2011,25 +2171,25 @@ var SegmentedControlItem = ({
|
|
|
2011
2171
|
onMouseDown: handleMouseDown,
|
|
2012
2172
|
...rest,
|
|
2013
2173
|
children: [
|
|
2014
|
-
Boolean(icon) === true && icon && /* @__PURE__ */
|
|
2174
|
+
Boolean(icon) === true && icon && /* @__PURE__ */ jsx38(
|
|
2015
2175
|
"span",
|
|
2016
2176
|
{
|
|
2017
|
-
className:
|
|
2177
|
+
className: clsx25("flex items-center", {
|
|
2018
2178
|
"fill-disabled01": isOptionDisabled === true,
|
|
2019
2179
|
"fill-interactive01": isSelected === true && isOptionDisabled === false,
|
|
2020
2180
|
"fill-icon01": isSelected === false && isOptionDisabled === false
|
|
2021
2181
|
}),
|
|
2022
|
-
children: /* @__PURE__ */
|
|
2182
|
+
children: /* @__PURE__ */ jsx38(Icon, { name: icon, size: "small" })
|
|
2023
2183
|
}
|
|
2024
2184
|
),
|
|
2025
|
-
Boolean(label) === true && /* @__PURE__ */
|
|
2185
|
+
Boolean(label) === true && /* @__PURE__ */ jsx38("span", { className: "whitespace-nowrap", children: label })
|
|
2026
2186
|
]
|
|
2027
2187
|
}
|
|
2028
2188
|
);
|
|
2029
2189
|
};
|
|
2030
2190
|
|
|
2031
2191
|
// src/segmented-control/segmented-control.tsx
|
|
2032
|
-
import { Fragment as Fragment5, jsx as
|
|
2192
|
+
import { Fragment as Fragment5, jsx as jsx39 } from "react/jsx-runtime";
|
|
2033
2193
|
var SegmentedControl = ({
|
|
2034
2194
|
children,
|
|
2035
2195
|
value,
|
|
@@ -2040,14 +2200,14 @@ var SegmentedControl = ({
|
|
|
2040
2200
|
...rest
|
|
2041
2201
|
}) => {
|
|
2042
2202
|
const containerRef = useRef6(null);
|
|
2043
|
-
const itemIds =
|
|
2203
|
+
const itemIds = Children2.toArray(children).filter((child) => {
|
|
2044
2204
|
if (!React4.isValidElement(child) || typeof child.props !== "object" || child.props === null || !("value" in child.props)) {
|
|
2045
2205
|
return false;
|
|
2046
2206
|
}
|
|
2047
2207
|
const props = child.props;
|
|
2048
2208
|
return props.isDisabled !== true;
|
|
2049
2209
|
}).map((child) => child.props.value);
|
|
2050
|
-
const childrenCount =
|
|
2210
|
+
const childrenCount = Children2.count(children);
|
|
2051
2211
|
const containerStyle = { gridTemplateColumns: `repeat(${childrenCount}, minmax(0,1fr))` };
|
|
2052
2212
|
const {
|
|
2053
2213
|
focusedValue,
|
|
@@ -2074,7 +2234,7 @@ var SegmentedControl = ({
|
|
|
2074
2234
|
onBlur: handleBlurRovingFocus,
|
|
2075
2235
|
values: itemIds
|
|
2076
2236
|
};
|
|
2077
|
-
return /* @__PURE__ */
|
|
2237
|
+
return /* @__PURE__ */ jsx39(Fragment5, { children: /* @__PURE__ */ jsx39(SegmentedControlContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsx39(
|
|
2078
2238
|
"div",
|
|
2079
2239
|
{
|
|
2080
2240
|
ref: containerRef,
|
|
@@ -2092,19 +2252,19 @@ SegmentedControl.Item = SegmentedControlItem;
|
|
|
2092
2252
|
|
|
2093
2253
|
// src/select-sort/select-sort.tsx
|
|
2094
2254
|
import { buttonColors as buttonColors4, focusVisible as focusVisible14 } from "@zenkigen-inc/component-theme";
|
|
2095
|
-
import
|
|
2255
|
+
import clsx28 from "clsx";
|
|
2096
2256
|
import { useCallback as useCallback8, useRef as useRef7, useState as useState10 } from "react";
|
|
2097
2257
|
|
|
2098
2258
|
// src/select-sort/select-list.tsx
|
|
2099
2259
|
import { focusVisible as focusVisible13 } from "@zenkigen-inc/component-theme";
|
|
2100
|
-
import
|
|
2260
|
+
import clsx27 from "clsx";
|
|
2101
2261
|
|
|
2102
2262
|
// src/select-sort/select-item.tsx
|
|
2103
2263
|
import { focusVisible as focusVisible12 } from "@zenkigen-inc/component-theme";
|
|
2104
|
-
import
|
|
2105
|
-
import { jsx as
|
|
2264
|
+
import clsx26 from "clsx";
|
|
2265
|
+
import { jsx as jsx40, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
2106
2266
|
function SelectItem2({ children, isSortKey, onClickItem }) {
|
|
2107
|
-
const itemClasses =
|
|
2267
|
+
const itemClasses = clsx26(
|
|
2108
2268
|
"typography-label14regular flex h-8 w-full items-center px-3 hover:bg-hover02 active:bg-active02",
|
|
2109
2269
|
focusVisible12.inset,
|
|
2110
2270
|
{
|
|
@@ -2112,16 +2272,16 @@ function SelectItem2({ children, isSortKey, onClickItem }) {
|
|
|
2112
2272
|
"bg-uiBackground01 fill-icon01 text-interactive02": !isSortKey
|
|
2113
2273
|
}
|
|
2114
2274
|
);
|
|
2115
|
-
return /* @__PURE__ */
|
|
2116
|
-
/* @__PURE__ */
|
|
2117
|
-
isSortKey && /* @__PURE__ */
|
|
2275
|
+
return /* @__PURE__ */ jsx40("li", { className: "flex w-full items-center", onClick: onClickItem, children: /* @__PURE__ */ jsxs20("button", { className: itemClasses, type: "button", children: [
|
|
2276
|
+
/* @__PURE__ */ jsx40("span", { className: "ml-1 mr-6", children }),
|
|
2277
|
+
isSortKey && /* @__PURE__ */ jsx40("div", { className: "ml-auto flex items-center", children: /* @__PURE__ */ jsx40(Icon, { name: "check", size: "small" }) })
|
|
2118
2278
|
] }) });
|
|
2119
2279
|
}
|
|
2120
2280
|
|
|
2121
2281
|
// src/select-sort/select-list.tsx
|
|
2122
|
-
import { jsx as
|
|
2282
|
+
import { jsx as jsx41, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
2123
2283
|
function SelectList2({ size, variant, sortOrder, onClickItem, onClickDeselect }) {
|
|
2124
|
-
const listClasses =
|
|
2284
|
+
const listClasses = clsx27(
|
|
2125
2285
|
"absolute z-dropdown w-max overflow-y-auto rounded bg-uiBackground01 py-2 shadow-floatingShadow",
|
|
2126
2286
|
{
|
|
2127
2287
|
"top-7": size === "x-small" || size === "small",
|
|
@@ -2130,19 +2290,19 @@ function SelectList2({ size, variant, sortOrder, onClickItem, onClickDeselect })
|
|
|
2130
2290
|
"border-solid border border-uiBorder01": variant === "outline"
|
|
2131
2291
|
}
|
|
2132
2292
|
);
|
|
2133
|
-
const deselectButtonClasses =
|
|
2293
|
+
const deselectButtonClasses = clsx27(
|
|
2134
2294
|
"typography-label14regular flex h-8 w-full items-center px-3 text-interactive02 hover:bg-hover02 active:bg-active02",
|
|
2135
2295
|
focusVisible13.inset
|
|
2136
2296
|
);
|
|
2137
2297
|
return /* @__PURE__ */ jsxs21("ul", { className: listClasses, children: [
|
|
2138
|
-
/* @__PURE__ */
|
|
2139
|
-
/* @__PURE__ */
|
|
2140
|
-
sortOrder !== null && onClickDeselect && /* @__PURE__ */
|
|
2298
|
+
/* @__PURE__ */ jsx41(SelectItem2, { isSortKey: sortOrder === "ascend", onClickItem: () => onClickItem("ascend"), children: "\u6607\u9806\u3067\u4E26\u3073\u66FF\u3048" }),
|
|
2299
|
+
/* @__PURE__ */ jsx41(SelectItem2, { isSortKey: sortOrder === "descend", onClickItem: () => onClickItem("descend"), children: "\u964D\u9806\u3067\u4E26\u3073\u66FF\u3048" }),
|
|
2300
|
+
sortOrder !== null && onClickDeselect && /* @__PURE__ */ jsx41("li", { children: /* @__PURE__ */ jsx41("button", { className: deselectButtonClasses, type: "button", onClick: onClickDeselect, children: "\u9078\u629E\u89E3\u9664" }) })
|
|
2141
2301
|
] });
|
|
2142
2302
|
}
|
|
2143
2303
|
|
|
2144
2304
|
// src/select-sort/select-sort.tsx
|
|
2145
|
-
import { jsx as
|
|
2305
|
+
import { jsx as jsx42, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
2146
2306
|
function SelectSort({
|
|
2147
2307
|
size = "medium",
|
|
2148
2308
|
variant = "outline",
|
|
@@ -2165,13 +2325,13 @@ function SelectSort({
|
|
|
2165
2325
|
},
|
|
2166
2326
|
[onChange]
|
|
2167
2327
|
);
|
|
2168
|
-
const wrapperClasses =
|
|
2328
|
+
const wrapperClasses = clsx28("relative flex shrink-0 items-center gap-1 rounded", {
|
|
2169
2329
|
"h-6": size === "x-small" || size === "small",
|
|
2170
2330
|
"h-8": size === "medium",
|
|
2171
2331
|
"h-10": size === "large",
|
|
2172
2332
|
"cursor-not-allowed": isDisabled
|
|
2173
2333
|
});
|
|
2174
|
-
const buttonClasses =
|
|
2334
|
+
const buttonClasses = clsx28(
|
|
2175
2335
|
"flex size-full items-center rounded",
|
|
2176
2336
|
buttonColors4[variant].hover,
|
|
2177
2337
|
buttonColors4[variant].active,
|
|
@@ -2185,7 +2345,7 @@ function SelectSort({
|
|
|
2185
2345
|
"pointer-events-none": isDisabled
|
|
2186
2346
|
}
|
|
2187
2347
|
);
|
|
2188
|
-
const labelClasses =
|
|
2348
|
+
const labelClasses = clsx28("truncate", {
|
|
2189
2349
|
"typography-label12regular": size === "x-small",
|
|
2190
2350
|
"typography-label14regular": size === "small" || size === "medium",
|
|
2191
2351
|
"typography-label16regular": size === "large",
|
|
@@ -2194,14 +2354,14 @@ function SelectSort({
|
|
|
2194
2354
|
});
|
|
2195
2355
|
return /* @__PURE__ */ jsxs22("div", { className: wrapperClasses, style: { width }, ref: targetRef, children: [
|
|
2196
2356
|
/* @__PURE__ */ jsxs22("button", { className: buttonClasses, type: "button", onClick: handleClickToggle, disabled: isDisabled, children: [
|
|
2197
|
-
/* @__PURE__ */
|
|
2198
|
-
/* @__PURE__ */
|
|
2357
|
+
/* @__PURE__ */ jsx42("div", { className: labelClasses, children: label }),
|
|
2358
|
+
/* @__PURE__ */ jsx42("div", { className: "ml-auto flex items-center", children: isSortKey ? /* @__PURE__ */ jsx42(
|
|
2199
2359
|
Icon,
|
|
2200
2360
|
{
|
|
2201
2361
|
name: sortOrder === "ascend" ? "arrow-up" : "arrow-down",
|
|
2202
2362
|
size: size === "large" ? "medium" : "small"
|
|
2203
2363
|
}
|
|
2204
|
-
) : /* @__PURE__ */
|
|
2364
|
+
) : /* @__PURE__ */ jsx42(
|
|
2205
2365
|
Icon,
|
|
2206
2366
|
{
|
|
2207
2367
|
name: isOptionListOpen ? "angle-small-up" : "angle-small-down",
|
|
@@ -2209,7 +2369,7 @@ function SelectSort({
|
|
|
2209
2369
|
}
|
|
2210
2370
|
) })
|
|
2211
2371
|
] }),
|
|
2212
|
-
isOptionListOpen && !isDisabled && /* @__PURE__ */
|
|
2372
|
+
isOptionListOpen && !isDisabled && /* @__PURE__ */ jsx42(
|
|
2213
2373
|
SelectList2,
|
|
2214
2374
|
{
|
|
2215
2375
|
size,
|
|
@@ -2224,9 +2384,9 @@ function SelectSort({
|
|
|
2224
2384
|
|
|
2225
2385
|
// src/sort-button/sort-button.tsx
|
|
2226
2386
|
import { buttonColors as buttonColors5, focusVisible as focusVisible15 } from "@zenkigen-inc/component-theme";
|
|
2227
|
-
import
|
|
2387
|
+
import clsx29 from "clsx";
|
|
2228
2388
|
import { useCallback as useCallback9 } from "react";
|
|
2229
|
-
import { jsx as
|
|
2389
|
+
import { jsx as jsx43, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
2230
2390
|
function SortButton({
|
|
2231
2391
|
size = "medium",
|
|
2232
2392
|
width,
|
|
@@ -2246,13 +2406,13 @@ function SortButton({
|
|
|
2246
2406
|
if (sortOrder === "descend") return "arrow-down";
|
|
2247
2407
|
return "angle-small-down";
|
|
2248
2408
|
};
|
|
2249
|
-
const wrapperClasses =
|
|
2409
|
+
const wrapperClasses = clsx29("relative flex shrink-0 items-center gap-1 rounded", {
|
|
2250
2410
|
"h-6": size === "x-small" || size === "small",
|
|
2251
2411
|
"h-8": size === "medium",
|
|
2252
2412
|
"h-10": size === "large",
|
|
2253
2413
|
"cursor-not-allowed": isDisabled
|
|
2254
2414
|
});
|
|
2255
|
-
const buttonClasses =
|
|
2415
|
+
const buttonClasses = clsx29(
|
|
2256
2416
|
"flex size-full items-center rounded",
|
|
2257
2417
|
buttonColors5.text.hover,
|
|
2258
2418
|
buttonColors5.text.active,
|
|
@@ -2268,14 +2428,14 @@ function SortButton({
|
|
|
2268
2428
|
"pointer-events-none": isDisabled
|
|
2269
2429
|
}
|
|
2270
2430
|
);
|
|
2271
|
-
const labelClasses =
|
|
2431
|
+
const labelClasses = clsx29("truncate", {
|
|
2272
2432
|
"typography-label12regular": size === "x-small",
|
|
2273
2433
|
"typography-label14regular": size === "small" || size === "medium",
|
|
2274
2434
|
"typography-label16regular": size === "large",
|
|
2275
2435
|
"mr-1": size === "x-small",
|
|
2276
2436
|
"mr-2": size !== "x-small"
|
|
2277
2437
|
});
|
|
2278
|
-
return /* @__PURE__ */
|
|
2438
|
+
return /* @__PURE__ */ jsx43("div", { className: wrapperClasses, style: { width }, children: /* @__PURE__ */ jsxs23(
|
|
2279
2439
|
"button",
|
|
2280
2440
|
{
|
|
2281
2441
|
className: buttonClasses,
|
|
@@ -2286,78 +2446,85 @@ function SortButton({
|
|
|
2286
2446
|
"aria-label": ariaLabel,
|
|
2287
2447
|
"aria-disabled": isDisabled,
|
|
2288
2448
|
children: [
|
|
2289
|
-
/* @__PURE__ */
|
|
2290
|
-
/* @__PURE__ */
|
|
2449
|
+
/* @__PURE__ */ jsx43("div", { className: labelClasses, children: label }),
|
|
2450
|
+
/* @__PURE__ */ jsx43("div", { className: "ml-auto flex items-center", children: /* @__PURE__ */ jsx43(Icon, { name: getIconName(), size: size === "large" ? "medium" : "small" }) })
|
|
2291
2451
|
]
|
|
2292
2452
|
}
|
|
2293
2453
|
) });
|
|
2294
2454
|
}
|
|
2295
2455
|
|
|
2296
2456
|
// src/tab/tab.tsx
|
|
2297
|
-
import { clsx as
|
|
2298
|
-
import { Children as
|
|
2457
|
+
import { clsx as clsx31 } from "clsx";
|
|
2458
|
+
import { Children as Children3 } from "react";
|
|
2299
2459
|
|
|
2300
2460
|
// src/tab/tab-item.tsx
|
|
2301
|
-
import { clsx as
|
|
2302
|
-
import { jsx as
|
|
2303
|
-
var TabItem = ({ isSelected = false, ...props }) => {
|
|
2304
|
-
const classes =
|
|
2305
|
-
"relative z-0 flex justify-center py-2 leading-[24px] before:absolute before:inset-x-0 before:bottom-0 before:h-
|
|
2461
|
+
import { clsx as clsx30 } from "clsx";
|
|
2462
|
+
import { jsx as jsx44, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
2463
|
+
var TabItem = ({ isSelected = false, isDisabled = false, icon, ...props }) => {
|
|
2464
|
+
const classes = clsx30(
|
|
2465
|
+
"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",
|
|
2306
2466
|
{
|
|
2307
|
-
"typography-label14regular": !isSelected,
|
|
2308
|
-
"
|
|
2309
|
-
"typography-label14bold": isSelected,
|
|
2467
|
+
"typography-label14regular text-interactive02": !isSelected,
|
|
2468
|
+
"typography-label14bold text-interactive01": isSelected,
|
|
2310
2469
|
"before:bg-interactive01 hover:before:bg-interactive01 pointer-events-none": isSelected
|
|
2311
2470
|
}
|
|
2312
2471
|
);
|
|
2313
|
-
|
|
2472
|
+
const iconWrapperClasses = clsx30("flex shrink-0 items-center", {
|
|
2473
|
+
"fill-disabled01": isDisabled,
|
|
2474
|
+
"fill-interactive01": !isDisabled && isSelected,
|
|
2475
|
+
"fill-icon01 group-hover:fill-interactive01": !isDisabled && !isSelected
|
|
2476
|
+
});
|
|
2477
|
+
return /* @__PURE__ */ jsxs24(
|
|
2314
2478
|
"button",
|
|
2315
2479
|
{
|
|
2316
2480
|
type: "button",
|
|
2317
2481
|
role: "tab",
|
|
2318
2482
|
"aria-selected": isSelected,
|
|
2319
2483
|
className: classes,
|
|
2320
|
-
disabled:
|
|
2484
|
+
disabled: isDisabled,
|
|
2321
2485
|
onClick: () => props.onClick(props.id),
|
|
2322
|
-
children:
|
|
2486
|
+
children: [
|
|
2487
|
+
icon != null && /* @__PURE__ */ jsx44("span", { className: iconWrapperClasses, children: /* @__PURE__ */ jsx44(Icon, { name: icon, size: "small" }) }),
|
|
2488
|
+
props.children
|
|
2489
|
+
]
|
|
2323
2490
|
}
|
|
2324
2491
|
);
|
|
2325
2492
|
};
|
|
2326
2493
|
|
|
2327
2494
|
// src/tab/tab.tsx
|
|
2328
|
-
import { jsx as
|
|
2495
|
+
import { jsx as jsx45 } from "react/jsx-runtime";
|
|
2329
2496
|
function Tab({ children, layout = "auto" }) {
|
|
2330
|
-
const childrenCount =
|
|
2497
|
+
const childrenCount = Children3.count(children);
|
|
2331
2498
|
const containerStyle = layout === "equal" ? { gridTemplateColumns: `repeat(${childrenCount}, minmax(0,1fr))` } : {};
|
|
2332
|
-
const containerClasses =
|
|
2499
|
+
const containerClasses = clsx31(
|
|
2333
2500
|
"relative gap-4 px-6 before:absolute before:inset-x-0 before:bottom-0 before:h-px before:bg-uiBorder01",
|
|
2334
2501
|
{
|
|
2335
2502
|
flex: layout === "auto",
|
|
2336
2503
|
grid: layout === "equal"
|
|
2337
2504
|
}
|
|
2338
2505
|
);
|
|
2339
|
-
return /* @__PURE__ */
|
|
2506
|
+
return /* @__PURE__ */ jsx45("div", { role: "tablist", className: containerClasses, style: containerStyle, children });
|
|
2340
2507
|
}
|
|
2341
2508
|
Tab.Item = TabItem;
|
|
2342
2509
|
|
|
2343
2510
|
// src/table/table-cell.tsx
|
|
2344
|
-
import
|
|
2345
|
-
import { jsx as
|
|
2511
|
+
import clsx32 from "clsx";
|
|
2512
|
+
import { jsx as jsx46 } from "react/jsx-runtime";
|
|
2346
2513
|
function TableCell({ children, className, isHeader = false }) {
|
|
2347
|
-
const classes =
|
|
2348
|
-
return /* @__PURE__ */
|
|
2514
|
+
const classes = clsx32("border-b border-uiBorder01", { "sticky top-0 z-10 bg-white": isHeader }, className);
|
|
2515
|
+
return /* @__PURE__ */ jsx46("div", { className: classes, children });
|
|
2349
2516
|
}
|
|
2350
2517
|
|
|
2351
2518
|
// src/table/table-row.tsx
|
|
2352
|
-
import
|
|
2353
|
-
import { jsx as
|
|
2519
|
+
import clsx33 from "clsx";
|
|
2520
|
+
import { jsx as jsx47 } from "react/jsx-runtime";
|
|
2354
2521
|
function TableRow({ children, isHoverBackgroundVisible = false }) {
|
|
2355
|
-
const rowClasses =
|
|
2356
|
-
return /* @__PURE__ */
|
|
2522
|
+
const rowClasses = clsx33("contents", isHoverBackgroundVisible && "[&:hover>div]:bg-hoverUi02");
|
|
2523
|
+
return /* @__PURE__ */ jsx47("div", { className: rowClasses, children });
|
|
2357
2524
|
}
|
|
2358
2525
|
|
|
2359
2526
|
// src/table/table.tsx
|
|
2360
|
-
import { jsx as
|
|
2527
|
+
import { jsx as jsx48 } from "react/jsx-runtime";
|
|
2361
2528
|
function Table({
|
|
2362
2529
|
width,
|
|
2363
2530
|
templateRows,
|
|
@@ -2366,7 +2533,7 @@ function Table({
|
|
|
2366
2533
|
autoRows,
|
|
2367
2534
|
children
|
|
2368
2535
|
}) {
|
|
2369
|
-
return /* @__PURE__ */
|
|
2536
|
+
return /* @__PURE__ */ jsx48(
|
|
2370
2537
|
"div",
|
|
2371
2538
|
{
|
|
2372
2539
|
className: "grid",
|
|
@@ -2386,22 +2553,22 @@ Table.Cell = TableCell;
|
|
|
2386
2553
|
|
|
2387
2554
|
// src/tag/tag.tsx
|
|
2388
2555
|
import { tagColors, tagLightColors } from "@zenkigen-inc/component-theme";
|
|
2389
|
-
import
|
|
2556
|
+
import clsx35 from "clsx";
|
|
2390
2557
|
|
|
2391
2558
|
// src/tag/delete-icon.tsx
|
|
2392
2559
|
import { focusVisible as focusVisible16 } from "@zenkigen-inc/component-theme";
|
|
2393
|
-
import
|
|
2394
|
-
import { jsx as
|
|
2560
|
+
import clsx34 from "clsx";
|
|
2561
|
+
import { jsx as jsx49 } from "react/jsx-runtime";
|
|
2395
2562
|
var DeleteIcon = ({ color, variant, onClick }) => {
|
|
2396
|
-
const deleteButtonClasses =
|
|
2563
|
+
const deleteButtonClasses = clsx34(
|
|
2397
2564
|
"group ml-2 size-[14px] rounded-full p-0.5 hover:cursor-pointer hover:bg-iconOnColor focus-visible:bg-iconOnColor",
|
|
2398
2565
|
focusVisible16.normal
|
|
2399
2566
|
);
|
|
2400
|
-
const deletePathClasses =
|
|
2567
|
+
const deletePathClasses = clsx34({
|
|
2401
2568
|
"fill-interactive02": color === "gray" || variant === "light",
|
|
2402
2569
|
"group-hover:fill-interactive02 group-focus-visible:fill-interactive02 fill-iconOnColor": color !== "gray"
|
|
2403
2570
|
});
|
|
2404
|
-
return /* @__PURE__ */
|
|
2571
|
+
return /* @__PURE__ */ jsx49("button", { type: "button", className: deleteButtonClasses, onClick, children: /* @__PURE__ */ jsx49("svg", { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ jsx49(
|
|
2405
2572
|
"path",
|
|
2406
2573
|
{
|
|
2407
2574
|
fillRule: "evenodd",
|
|
@@ -2413,9 +2580,9 @@ var DeleteIcon = ({ color, variant, onClick }) => {
|
|
|
2413
2580
|
};
|
|
2414
2581
|
|
|
2415
2582
|
// src/tag/tag.tsx
|
|
2416
|
-
import { jsx as
|
|
2583
|
+
import { jsx as jsx50, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
2417
2584
|
function Tag({ id, children, color, variant = "normal", size = "medium", isEditable, onDelete }) {
|
|
2418
|
-
const wrapperClasses =
|
|
2585
|
+
const wrapperClasses = clsx35("flex", "items-center", "justify-center", {
|
|
2419
2586
|
[tagColors[color]]: variant === "normal",
|
|
2420
2587
|
[tagLightColors[color]]: variant === "light",
|
|
2421
2588
|
"h-[14px] typography-label11regular": !isEditable && size === "x-small",
|
|
@@ -2427,65 +2594,177 @@ function Tag({ id, children, color, variant = "normal", size = "medium", isEdita
|
|
|
2427
2594
|
"py-0.5 px-1": !isEditable,
|
|
2428
2595
|
"py-1 px-2": isEditable
|
|
2429
2596
|
});
|
|
2430
|
-
return /* @__PURE__ */
|
|
2597
|
+
return /* @__PURE__ */ jsxs25("div", { className: wrapperClasses, children: [
|
|
2431
2598
|
children,
|
|
2432
|
-
isEditable ? /* @__PURE__ */
|
|
2599
|
+
isEditable ? /* @__PURE__ */ jsx50(DeleteIcon, { onClick: () => onDelete(id), color, variant }) : null
|
|
2433
2600
|
] });
|
|
2434
2601
|
}
|
|
2435
2602
|
|
|
2436
2603
|
// src/text-area/text-area.tsx
|
|
2437
|
-
import { clsx as
|
|
2438
|
-
import { forwardRef as
|
|
2439
|
-
|
|
2440
|
-
|
|
2441
|
-
|
|
2442
|
-
|
|
2443
|
-
|
|
2444
|
-
|
|
2445
|
-
|
|
2446
|
-
|
|
2447
|
-
|
|
2448
|
-
|
|
2449
|
-
|
|
2450
|
-
|
|
2451
|
-
|
|
2452
|
-
|
|
2453
|
-
|
|
2454
|
-
|
|
2455
|
-
|
|
2456
|
-
|
|
2457
|
-
|
|
2458
|
-
|
|
2459
|
-
|
|
2460
|
-
|
|
2461
|
-
|
|
2462
|
-
|
|
2463
|
-
|
|
2464
|
-
);
|
|
2465
|
-
return /* @__PURE__ */ jsx49("div", { className: "flex", children: /* @__PURE__ */ jsx49(
|
|
2466
|
-
"textarea",
|
|
2467
|
-
{
|
|
2468
|
-
ref,
|
|
2469
|
-
className: classes,
|
|
2470
|
-
disabled,
|
|
2471
|
-
...props,
|
|
2472
|
-
style: {
|
|
2473
|
-
...{ maxHeight },
|
|
2474
|
-
// 自動高さではない場合で、height 指定がある場合は設定する
|
|
2475
|
-
...!autoHeight && height !== null ? { height } : {},
|
|
2476
|
-
// 自動高さの場合で、height が指定されている場合は、height を minHeight に設定する
|
|
2477
|
-
...autoHeight && height !== null ? { minHeight: height } : {}
|
|
2478
|
-
}
|
|
2479
|
-
}
|
|
2480
|
-
) });
|
|
2604
|
+
import { clsx as clsx38 } from "clsx";
|
|
2605
|
+
import { Children as Children4, cloneElement as cloneElement4, forwardRef as forwardRef12, isValidElement as isValidElement2, useId as useId3, useMemo as useMemo3 } from "react";
|
|
2606
|
+
|
|
2607
|
+
// src/text-area/text-area-context.tsx
|
|
2608
|
+
import { createContext as createContext9, useContext as useContext12 } from "react";
|
|
2609
|
+
var TextAreaCompoundContext = createContext9(null);
|
|
2610
|
+
var useTextAreaCompoundContext = (componentName) => {
|
|
2611
|
+
const context = useContext12(TextAreaCompoundContext);
|
|
2612
|
+
if (context == null) {
|
|
2613
|
+
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`);
|
|
2614
|
+
}
|
|
2615
|
+
return context;
|
|
2616
|
+
};
|
|
2617
|
+
|
|
2618
|
+
// src/text-area/text-area-error-message.tsx
|
|
2619
|
+
import { clsx as clsx36 } from "clsx";
|
|
2620
|
+
import { forwardRef as forwardRef10 } from "react";
|
|
2621
|
+
import { jsx as jsx51 } from "react/jsx-runtime";
|
|
2622
|
+
var TextAreaErrorMessage = forwardRef10(
|
|
2623
|
+
({ "aria-live": ariaLive = "assertive", ...props }, ref) => {
|
|
2624
|
+
const { textAreaProps } = useTextAreaCompoundContext("TextArea.ErrorMessage");
|
|
2625
|
+
const typographyClass = textAreaProps.size === "large" ? "typography-label12regular" : "typography-label11regular";
|
|
2626
|
+
const shouldRender = textAreaProps.isError === true;
|
|
2627
|
+
if (!shouldRender) {
|
|
2628
|
+
return null;
|
|
2629
|
+
}
|
|
2630
|
+
const errorMessageClassName = clsx36(typographyClass, "text-supportError");
|
|
2631
|
+
return /* @__PURE__ */ jsx51("div", { ref, className: errorMessageClassName, "aria-live": ariaLive, ...props });
|
|
2481
2632
|
}
|
|
2482
2633
|
);
|
|
2483
|
-
|
|
2634
|
+
TextAreaErrorMessage.displayName = "TextArea.ErrorMessage";
|
|
2635
|
+
|
|
2636
|
+
// src/text-area/text-area-helper-message.tsx
|
|
2637
|
+
import { clsx as clsx37 } from "clsx";
|
|
2638
|
+
import { forwardRef as forwardRef11 } from "react";
|
|
2639
|
+
import { jsx as jsx52 } from "react/jsx-runtime";
|
|
2640
|
+
var TextAreaHelperMessage = forwardRef11((props, ref) => {
|
|
2641
|
+
const { textAreaProps } = useTextAreaCompoundContext("TextArea.HelperMessage");
|
|
2642
|
+
const typographyClass = textAreaProps.size === "large" ? "typography-label12regular" : "typography-label11regular";
|
|
2643
|
+
const helperMessageClassName = clsx37(typographyClass, "text-text02");
|
|
2644
|
+
return /* @__PURE__ */ jsx52("div", { ref, className: helperMessageClassName, ...props });
|
|
2645
|
+
});
|
|
2646
|
+
TextAreaHelperMessage.displayName = "TextArea.HelperMessage";
|
|
2647
|
+
|
|
2648
|
+
// src/text-area/text-area.tsx
|
|
2649
|
+
import { jsx as jsx53, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
2650
|
+
function TextAreaInner({
|
|
2651
|
+
size = "medium",
|
|
2652
|
+
isResizable = false,
|
|
2653
|
+
autoHeight = false,
|
|
2654
|
+
maxHeight,
|
|
2655
|
+
isError = false,
|
|
2656
|
+
disabled = false,
|
|
2657
|
+
height,
|
|
2658
|
+
children,
|
|
2659
|
+
...props
|
|
2660
|
+
}, ref) {
|
|
2661
|
+
const autoGeneratedId = useId3();
|
|
2662
|
+
const textAreaPropsForContext = useMemo3(
|
|
2663
|
+
() => ({
|
|
2664
|
+
size,
|
|
2665
|
+
isError
|
|
2666
|
+
}),
|
|
2667
|
+
[size, isError]
|
|
2668
|
+
);
|
|
2669
|
+
const contextValue = useMemo3(
|
|
2670
|
+
() => ({
|
|
2671
|
+
textAreaProps: textAreaPropsForContext,
|
|
2672
|
+
forwardedRef: ref
|
|
2673
|
+
}),
|
|
2674
|
+
[textAreaPropsForContext, ref]
|
|
2675
|
+
);
|
|
2676
|
+
const helperMessageIds = [];
|
|
2677
|
+
const errorIds = [];
|
|
2678
|
+
const describedByBaseId = props.id ?? autoGeneratedId;
|
|
2679
|
+
const enhancedChildren = Children4.map(children, (child) => {
|
|
2680
|
+
if (!isValidElement2(child)) {
|
|
2681
|
+
return child;
|
|
2682
|
+
}
|
|
2683
|
+
if (child.type === TextAreaHelperMessage) {
|
|
2684
|
+
const helperChild = child;
|
|
2685
|
+
const assignedId = helperChild.props.id ?? `${describedByBaseId}-helper-${helperMessageIds.length + 1}`;
|
|
2686
|
+
helperMessageIds.push(assignedId);
|
|
2687
|
+
return cloneElement4(helperChild, { id: assignedId });
|
|
2688
|
+
}
|
|
2689
|
+
if (child.type === TextAreaErrorMessage && isError) {
|
|
2690
|
+
const errorChild = child;
|
|
2691
|
+
const assignedId = errorChild.props.id ?? `${describedByBaseId}-error-${errorIds.length + 1}`;
|
|
2692
|
+
errorIds.push(assignedId);
|
|
2693
|
+
return cloneElement4(errorChild, { id: assignedId });
|
|
2694
|
+
}
|
|
2695
|
+
return child;
|
|
2696
|
+
});
|
|
2697
|
+
const describedByFromProps = typeof props["aria-describedby"] === "string" ? props["aria-describedby"] : null;
|
|
2698
|
+
const describedByList = [describedByFromProps, ...helperMessageIds, ...errorIds].filter(
|
|
2699
|
+
(id) => typeof id === "string" && id.trim().length > 0
|
|
2700
|
+
);
|
|
2701
|
+
const describedByProps = describedByList.length > 0 ? {
|
|
2702
|
+
"aria-describedby": describedByList.join(" ")
|
|
2703
|
+
} : {};
|
|
2704
|
+
const shouldMarkInvalid = isError === true || errorIds.length > 0;
|
|
2705
|
+
const ariaInvalidFromProps = props["aria-invalid"];
|
|
2706
|
+
const ariaInvalidValue = ariaInvalidFromProps != null ? ariaInvalidFromProps : shouldMarkInvalid ? true : null;
|
|
2707
|
+
const ariaInvalidProps = ariaInvalidValue == null ? {} : { "aria-invalid": ariaInvalidValue };
|
|
2708
|
+
const mergedTextAreaProps = {
|
|
2709
|
+
...props,
|
|
2710
|
+
...describedByProps,
|
|
2711
|
+
...ariaInvalidProps
|
|
2712
|
+
};
|
|
2713
|
+
const classes = clsx38(
|
|
2714
|
+
"w-full rounded border outline-0 placeholder:text-textPlaceholder disabled:text-textPlaceholder",
|
|
2715
|
+
{
|
|
2716
|
+
"border-supportError": isError && !disabled,
|
|
2717
|
+
"hover:border-hoverInput": !disabled && !isError,
|
|
2718
|
+
"border-uiBorder02 hover:focus-within:border-activeInput focus-within:border-activeInput text-text01": !isError,
|
|
2719
|
+
"bg-disabled02 border-disabled01": disabled,
|
|
2720
|
+
"typography-body14regular px-2 pt-2 pb-2": size === "medium",
|
|
2721
|
+
"text-4 leading-normal px-3.5 py-2.5": size === "large",
|
|
2722
|
+
"field-sizing-content": autoHeight,
|
|
2723
|
+
"text-supportError": isError,
|
|
2724
|
+
"resize-none": !isResizable
|
|
2725
|
+
}
|
|
2726
|
+
);
|
|
2727
|
+
const textAreaElement = /* @__PURE__ */ jsx53("div", { className: "flex", children: /* @__PURE__ */ jsx53(
|
|
2728
|
+
"textarea",
|
|
2729
|
+
{
|
|
2730
|
+
ref,
|
|
2731
|
+
className: classes,
|
|
2732
|
+
...mergedTextAreaProps,
|
|
2733
|
+
disabled,
|
|
2734
|
+
style: {
|
|
2735
|
+
...{ maxHeight },
|
|
2736
|
+
// 自動高さではない場合で、height 指定がある場合は設定する
|
|
2737
|
+
...!autoHeight && height !== null ? { height } : {},
|
|
2738
|
+
// 自動高さの場合で、height が指定されている場合は、height を minHeight に設定する
|
|
2739
|
+
...autoHeight && height !== null ? { minHeight: height } : {}
|
|
2740
|
+
}
|
|
2741
|
+
}
|
|
2742
|
+
) });
|
|
2743
|
+
const stackedChildren = enhancedChildren == null ? [] : Children4.toArray(enhancedChildren);
|
|
2744
|
+
const hasMessageChildren = stackedChildren.length > 0;
|
|
2745
|
+
if (!hasMessageChildren) {
|
|
2746
|
+
return /* @__PURE__ */ jsx53(TextAreaCompoundContext.Provider, { value: contextValue, children: textAreaElement });
|
|
2747
|
+
}
|
|
2748
|
+
return /* @__PURE__ */ jsx53(TextAreaCompoundContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsxs26("div", { className: "flex flex-col gap-2", children: [
|
|
2749
|
+
textAreaElement,
|
|
2750
|
+
stackedChildren
|
|
2751
|
+
] }) });
|
|
2752
|
+
}
|
|
2753
|
+
var attachStatics2 = (component) => {
|
|
2754
|
+
component.HelperMessage = TextAreaHelperMessage;
|
|
2755
|
+
component.ErrorMessage = TextAreaErrorMessage;
|
|
2756
|
+
component.displayName = "TextArea";
|
|
2757
|
+
return component;
|
|
2758
|
+
};
|
|
2759
|
+
var TextAreaBase = forwardRef12(function TextAreaBase2(props, ref) {
|
|
2760
|
+
return TextAreaInner(props, ref);
|
|
2761
|
+
});
|
|
2762
|
+
var TextArea = attachStatics2(TextAreaBase);
|
|
2484
2763
|
|
|
2485
2764
|
// src/toast/toast.tsx
|
|
2486
|
-
import
|
|
2765
|
+
import clsx39 from "clsx";
|
|
2487
2766
|
import { useCallback as useCallback10, useEffect as useEffect6, useState as useState11 } from "react";
|
|
2488
|
-
import { jsx as
|
|
2767
|
+
import { jsx as jsx54, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
2489
2768
|
var CLOSE_TIME_MSEC = 5e3;
|
|
2490
2769
|
function Toast({
|
|
2491
2770
|
state = "information",
|
|
@@ -2504,17 +2783,17 @@ function Toast({
|
|
|
2504
2783
|
}
|
|
2505
2784
|
}, [isAnimation, onClickClose]);
|
|
2506
2785
|
const handleAnimationEnd = (e) => window.getComputedStyle(e.currentTarget).opacity === "0" && onClickClose();
|
|
2507
|
-
const wrapperClasses =
|
|
2786
|
+
const wrapperClasses = clsx39("pointer-events-auto flex items-start gap-1 bg-white p-4 shadow-floatingShadow", {
|
|
2508
2787
|
["animate-toast-in"]: isAnimation && !isRemoving,
|
|
2509
2788
|
["animate-toast-out opacity-0"]: isAnimation && isRemoving
|
|
2510
2789
|
});
|
|
2511
|
-
const iconClasses =
|
|
2790
|
+
const iconClasses = clsx39("flex items-center", {
|
|
2512
2791
|
"fill-supportSuccess": state === "success",
|
|
2513
2792
|
"fill-supportError": state === "error",
|
|
2514
2793
|
"fill-supportWarning": state === "warning",
|
|
2515
2794
|
"fill-supportInfo": state === "information"
|
|
2516
2795
|
});
|
|
2517
|
-
const textClasses =
|
|
2796
|
+
const textClasses = clsx39("typography-body13regular flex-1 pt-[3px]", {
|
|
2518
2797
|
"text-supportError": state === "error",
|
|
2519
2798
|
"text-text01": state === "success" || state === "warning" || state === "information"
|
|
2520
2799
|
});
|
|
@@ -2532,18 +2811,18 @@ function Toast({
|
|
|
2532
2811
|
}, CLOSE_TIME_MSEC);
|
|
2533
2812
|
return () => window.clearTimeout(timer);
|
|
2534
2813
|
}, [isAutoClose]);
|
|
2535
|
-
return /* @__PURE__ */
|
|
2536
|
-
/* @__PURE__ */
|
|
2537
|
-
/* @__PURE__ */
|
|
2538
|
-
/* @__PURE__ */
|
|
2814
|
+
return /* @__PURE__ */ jsxs27("div", { className: wrapperClasses, style: { width }, onAnimationEnd: handleAnimationEnd, children: [
|
|
2815
|
+
/* @__PURE__ */ jsx54("div", { className: iconClasses, children: /* @__PURE__ */ jsx54(Icon, { name: iconName[state] }) }),
|
|
2816
|
+
/* @__PURE__ */ jsx54("p", { className: textClasses, children }),
|
|
2817
|
+
/* @__PURE__ */ jsx54(IconButton, { icon: "close", size: "medium", variant: "text", onClick: handleClose, isNoPadding: true })
|
|
2539
2818
|
] });
|
|
2540
2819
|
}
|
|
2541
2820
|
|
|
2542
2821
|
// src/toast/toast-provider.tsx
|
|
2543
|
-
import { createContext as
|
|
2822
|
+
import { createContext as createContext10, useCallback as useCallback11, useContext as useContext13, useEffect as useEffect7, useState as useState12 } from "react";
|
|
2544
2823
|
import { createPortal as createPortal3 } from "react-dom";
|
|
2545
|
-
import { jsx as
|
|
2546
|
-
var ToastContext =
|
|
2824
|
+
import { jsx as jsx55, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
2825
|
+
var ToastContext = createContext10({});
|
|
2547
2826
|
var ToastProvider = ({ children }) => {
|
|
2548
2827
|
const [isClientRender, setIsClientRender] = useState12(false);
|
|
2549
2828
|
const [toasts, setToasts] = useState12([]);
|
|
@@ -2556,21 +2835,21 @@ var ToastProvider = ({ children }) => {
|
|
|
2556
2835
|
useEffect7(() => {
|
|
2557
2836
|
setIsClientRender(true);
|
|
2558
2837
|
}, []);
|
|
2559
|
-
return /* @__PURE__ */
|
|
2838
|
+
return /* @__PURE__ */ jsxs28(ToastContext.Provider, { value: { addToast, removeToast }, children: [
|
|
2560
2839
|
children,
|
|
2561
2840
|
isClientRender && createPortal3(
|
|
2562
|
-
/* @__PURE__ */
|
|
2841
|
+
/* @__PURE__ */ jsx55("div", { className: "pointer-events-none fixed bottom-0 left-0 z-toast mb-4 ml-4 flex w-full flex-col-reverse gap-[16px]", children: toasts.map(({ id, message, state }) => /* @__PURE__ */ jsx55(Toast, { state, isAutoClose: true, isAnimation: true, onClickClose: () => removeToast(id), width: 475, children: message }, id)) }),
|
|
2563
2842
|
document.body
|
|
2564
2843
|
)
|
|
2565
2844
|
] });
|
|
2566
2845
|
};
|
|
2567
2846
|
var useToast = () => {
|
|
2568
|
-
return
|
|
2847
|
+
return useContext13(ToastContext);
|
|
2569
2848
|
};
|
|
2570
2849
|
|
|
2571
2850
|
// src/toggle/toggle.tsx
|
|
2572
|
-
import
|
|
2573
|
-
import { jsx as
|
|
2851
|
+
import clsx40 from "clsx";
|
|
2852
|
+
import { jsx as jsx56, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
2574
2853
|
function Toggle({
|
|
2575
2854
|
id,
|
|
2576
2855
|
size = "medium",
|
|
@@ -2580,7 +2859,7 @@ function Toggle({
|
|
|
2580
2859
|
labelPosition = "right",
|
|
2581
2860
|
isDisabled = false
|
|
2582
2861
|
}) {
|
|
2583
|
-
const baseClasses =
|
|
2862
|
+
const baseClasses = clsx40("relative flex items-center rounded-full", {
|
|
2584
2863
|
"bg-disabledOn": isDisabled && isChecked,
|
|
2585
2864
|
"bg-disabled01": isDisabled && !isChecked,
|
|
2586
2865
|
"bg-interactive01 peer-hover:bg-hover01": !isDisabled && isChecked,
|
|
@@ -2588,16 +2867,16 @@ function Toggle({
|
|
|
2588
2867
|
"w-8 h-4 px-[3px]": size === "small",
|
|
2589
2868
|
"w-12 h-6 px-1": size === "medium" || size === "large"
|
|
2590
2869
|
});
|
|
2591
|
-
const inputClasses =
|
|
2870
|
+
const inputClasses = clsx40(
|
|
2592
2871
|
"peer absolute inset-0 z-[1] opacity-0",
|
|
2593
2872
|
isDisabled ? "cursor-not-allowed" : "cursor-pointer"
|
|
2594
2873
|
);
|
|
2595
|
-
const indicatorClasses =
|
|
2874
|
+
const indicatorClasses = clsx40("rounded-full bg-iconOnColor", {
|
|
2596
2875
|
"w-2.5 h-2.5": size === "small",
|
|
2597
2876
|
"w-4 h-4": size === "medium" || size === "large",
|
|
2598
2877
|
"ml-auto": isChecked
|
|
2599
2878
|
});
|
|
2600
|
-
const labelClasses =
|
|
2879
|
+
const labelClasses = clsx40("break-all", {
|
|
2601
2880
|
"mr-2": labelPosition === "left",
|
|
2602
2881
|
"ml-2": labelPosition === "right",
|
|
2603
2882
|
"typography-label14regular": size === "small" || size === "medium",
|
|
@@ -2605,9 +2884,9 @@ function Toggle({
|
|
|
2605
2884
|
"pointer-events-none cursor-not-allowed text-disabled01": isDisabled,
|
|
2606
2885
|
"cursor-pointer text-text01": !isDisabled
|
|
2607
2886
|
});
|
|
2608
|
-
return /* @__PURE__ */
|
|
2609
|
-
label != null && labelPosition === "left" && /* @__PURE__ */
|
|
2610
|
-
/* @__PURE__ */
|
|
2887
|
+
return /* @__PURE__ */ jsxs29("div", { className: "relative flex flex-[0_0_auto] items-center", children: [
|
|
2888
|
+
label != null && labelPosition === "left" && /* @__PURE__ */ jsx56("label", { htmlFor: id, className: labelClasses, children: label }),
|
|
2889
|
+
/* @__PURE__ */ jsx56(
|
|
2611
2890
|
"input",
|
|
2612
2891
|
{
|
|
2613
2892
|
className: inputClasses,
|
|
@@ -2619,8 +2898,8 @@ function Toggle({
|
|
|
2619
2898
|
disabled: isDisabled
|
|
2620
2899
|
}
|
|
2621
2900
|
),
|
|
2622
|
-
/* @__PURE__ */
|
|
2623
|
-
label != null && labelPosition === "right" && /* @__PURE__ */
|
|
2901
|
+
/* @__PURE__ */ jsx56("div", { className: baseClasses, children: /* @__PURE__ */ jsx56("span", { className: indicatorClasses }) }),
|
|
2902
|
+
label != null && labelPosition === "right" && /* @__PURE__ */ jsx56("label", { htmlFor: id, className: labelClasses, children: label })
|
|
2624
2903
|
] });
|
|
2625
2904
|
}
|
|
2626
2905
|
|
|
@@ -2629,13 +2908,13 @@ import { useCallback as useCallback13, useEffect as useEffect8, useRef as useRef
|
|
|
2629
2908
|
import { createPortal as createPortal4 } from "react-dom";
|
|
2630
2909
|
|
|
2631
2910
|
// src/tooltip/tooltip-content.tsx
|
|
2632
|
-
import
|
|
2911
|
+
import clsx42 from "clsx";
|
|
2633
2912
|
|
|
2634
2913
|
// src/tooltip/tail-icon.tsx
|
|
2635
|
-
import
|
|
2636
|
-
import { jsx as
|
|
2914
|
+
import clsx41 from "clsx";
|
|
2915
|
+
import { jsx as jsx57 } from "react/jsx-runtime";
|
|
2637
2916
|
var TailIcon = (props) => {
|
|
2638
|
-
const tailClasses =
|
|
2917
|
+
const tailClasses = clsx41("absolute fill-uiBackgroundTooltip", {
|
|
2639
2918
|
"rotate-180": props.verticalPosition === "bottom",
|
|
2640
2919
|
"rotate-0": props.verticalPosition !== "bottom",
|
|
2641
2920
|
"-top-1": props.verticalPosition === "bottom" && props.size === "small",
|
|
@@ -2650,9 +2929,9 @@ var TailIcon = (props) => {
|
|
|
2650
2929
|
"left-1/2 -translate-x-2": props.horizontalAlign === "center" && props.size !== "small"
|
|
2651
2930
|
});
|
|
2652
2931
|
if (props.size === "small") {
|
|
2653
|
-
return /* @__PURE__ */
|
|
2932
|
+
return /* @__PURE__ */ jsx57("svg", { className: tailClasses, width: "8", height: "4", viewBox: "0 0 8 4", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ jsx57("path", { d: "M4 4L0 0H8L4 4Z" }) });
|
|
2654
2933
|
} else {
|
|
2655
|
-
return /* @__PURE__ */
|
|
2934
|
+
return /* @__PURE__ */ jsx57(
|
|
2656
2935
|
"svg",
|
|
2657
2936
|
{
|
|
2658
2937
|
className: tailClasses,
|
|
@@ -2661,14 +2940,14 @@ var TailIcon = (props) => {
|
|
|
2661
2940
|
viewBox: "0 0 14 8",
|
|
2662
2941
|
fill: "none",
|
|
2663
2942
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2664
|
-
children: /* @__PURE__ */
|
|
2943
|
+
children: /* @__PURE__ */ jsx57("path", { d: "M7 8L0 0H14L7 8Z" })
|
|
2665
2944
|
}
|
|
2666
2945
|
);
|
|
2667
2946
|
}
|
|
2668
2947
|
};
|
|
2669
2948
|
|
|
2670
2949
|
// src/tooltip/tooltip-content.tsx
|
|
2671
|
-
import { jsx as
|
|
2950
|
+
import { jsx as jsx58, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
2672
2951
|
var TooltipContent = ({
|
|
2673
2952
|
content,
|
|
2674
2953
|
horizontalAlign,
|
|
@@ -2678,7 +2957,7 @@ var TooltipContent = ({
|
|
|
2678
2957
|
maxWidth,
|
|
2679
2958
|
isPortal = false
|
|
2680
2959
|
}) => {
|
|
2681
|
-
const tooltipWrapperClasses =
|
|
2960
|
+
const tooltipWrapperClasses = clsx42("absolute z-tooltip m-auto flex", {
|
|
2682
2961
|
"top-0": !isPortal && verticalPosition === "top",
|
|
2683
2962
|
"bottom-0": !isPortal && verticalPosition === "bottom",
|
|
2684
2963
|
"justify-start": horizontalAlign === "left",
|
|
@@ -2687,7 +2966,7 @@ var TooltipContent = ({
|
|
|
2687
2966
|
"w-[24px]": size === "small",
|
|
2688
2967
|
"w-[46px]": size !== "small"
|
|
2689
2968
|
});
|
|
2690
|
-
const tooltipBodyClasses =
|
|
2969
|
+
const tooltipBodyClasses = clsx42(
|
|
2691
2970
|
"absolute z-tooltip inline-block w-max rounded bg-uiBackgroundTooltip text-textOnColor",
|
|
2692
2971
|
{
|
|
2693
2972
|
"typography-body12regular": size === "small",
|
|
@@ -2704,7 +2983,7 @@ var TooltipContent = ({
|
|
|
2704
2983
|
transform: `translate(${tooltipPosition.translateX}, ${tooltipPosition.translateY})`,
|
|
2705
2984
|
...tooltipPosition
|
|
2706
2985
|
} : {};
|
|
2707
|
-
return /* @__PURE__ */
|
|
2986
|
+
return /* @__PURE__ */ jsx58("div", { className: tooltipWrapperClasses, style: tooltipWrapperStyle, children: /* @__PURE__ */ jsxs30(
|
|
2708
2987
|
"div",
|
|
2709
2988
|
{
|
|
2710
2989
|
className: tooltipBodyClasses,
|
|
@@ -2713,7 +2992,7 @@ var TooltipContent = ({
|
|
|
2713
2992
|
},
|
|
2714
2993
|
children: [
|
|
2715
2994
|
content,
|
|
2716
|
-
/* @__PURE__ */
|
|
2995
|
+
/* @__PURE__ */ jsx58(TailIcon, { size, verticalPosition, horizontalAlign })
|
|
2717
2996
|
]
|
|
2718
2997
|
}
|
|
2719
2998
|
) });
|
|
@@ -2774,7 +3053,7 @@ var useTooltip = () => {
|
|
|
2774
3053
|
};
|
|
2775
3054
|
|
|
2776
3055
|
// src/tooltip/tooltip.tsx
|
|
2777
|
-
import { jsx as
|
|
3056
|
+
import { jsx as jsx59, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
2778
3057
|
function Tooltip({
|
|
2779
3058
|
children,
|
|
2780
3059
|
content,
|
|
@@ -2812,7 +3091,7 @@ function Tooltip({
|
|
|
2812
3091
|
const position = calculatePosition({ dimensions, maxWidth, verticalPosition, horizontalAlign, tooltipSize: size });
|
|
2813
3092
|
setTooltipPosition(position);
|
|
2814
3093
|
}, [calculatePosition, horizontalAlign, maxWidth, size, verticalPosition]);
|
|
2815
|
-
return /* @__PURE__ */
|
|
3094
|
+
return /* @__PURE__ */ jsxs31(
|
|
2816
3095
|
"div",
|
|
2817
3096
|
{
|
|
2818
3097
|
ref: targetRef,
|
|
@@ -2821,7 +3100,7 @@ function Tooltip({
|
|
|
2821
3100
|
onMouseLeave: handleMouseOutWrapper,
|
|
2822
3101
|
children: [
|
|
2823
3102
|
children,
|
|
2824
|
-
isVisible && (portalTarget == null ? /* @__PURE__ */
|
|
3103
|
+
isVisible && (portalTarget == null ? /* @__PURE__ */ jsx59(
|
|
2825
3104
|
TooltipContent,
|
|
2826
3105
|
{
|
|
2827
3106
|
content,
|
|
@@ -2832,7 +3111,7 @@ function Tooltip({
|
|
|
2832
3111
|
tooltipPosition
|
|
2833
3112
|
}
|
|
2834
3113
|
) : createPortal4(
|
|
2835
|
-
/* @__PURE__ */
|
|
3114
|
+
/* @__PURE__ */ jsx59(
|
|
2836
3115
|
TooltipContent,
|
|
2837
3116
|
{
|
|
2838
3117
|
isPortal: true,
|
|
@@ -2866,7 +3145,7 @@ export {
|
|
|
2866
3145
|
NotificationInline,
|
|
2867
3146
|
Pagination,
|
|
2868
3147
|
PaginationSelect,
|
|
2869
|
-
PasswordInput,
|
|
3148
|
+
PasswordInput2 as PasswordInput,
|
|
2870
3149
|
Popover,
|
|
2871
3150
|
PopoverContent,
|
|
2872
3151
|
PopoverTrigger,
|