@zenkigen-inc/component-ui 1.16.0 → 1.16.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +14 -5
- package/dist/index.d.ts +14 -5
- package/dist/index.js +77 -64
- package/dist/index.mjs +52 -39
- package/package.json +3 -3
package/dist/index.d.mts
CHANGED
|
@@ -143,20 +143,27 @@ declare const Icon: ({ size, isDisabled, ...props }: Props$o) => react.JSX.Eleme
|
|
|
143
143
|
type Size = 'small' | 'medium' | 'large';
|
|
144
144
|
type Variant = 'outline' | 'text';
|
|
145
145
|
type Props$n = {
|
|
146
|
+
/** 表示するアイコン名 */
|
|
146
147
|
icon: IconName;
|
|
148
|
+
/** ボタンのサイズ */
|
|
147
149
|
size?: Size;
|
|
150
|
+
/** ボタンが無効かどうか */
|
|
148
151
|
isDisabled?: boolean;
|
|
152
|
+
/** ボタンが選択されているかどうか */
|
|
153
|
+
isSelected?: boolean;
|
|
154
|
+
/** パディングを無効にするかどうか */
|
|
149
155
|
isNoPadding?: boolean;
|
|
156
|
+
/** ボタンのバリアント */
|
|
150
157
|
variant?: Variant;
|
|
151
|
-
} & ({
|
|
158
|
+
} & (({
|
|
152
159
|
isAnchor: true;
|
|
153
160
|
href: string;
|
|
154
161
|
target?: HTMLAnchorElement['target'];
|
|
155
|
-
} | {
|
|
162
|
+
} & Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, 'href' | 'target' | 'className'>) | ({
|
|
156
163
|
isAnchor?: false;
|
|
157
164
|
onClick?: () => void;
|
|
158
|
-
});
|
|
159
|
-
declare function IconButton({ size, variant, isNoPadding, isDisabled, ...props }: Props$n): react.JSX.Element;
|
|
165
|
+
} & Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'onClick' | 'disabled' | 'className'>));
|
|
166
|
+
declare function IconButton({ icon, size, variant, isNoPadding, isDisabled, isSelected, ...props }: Props$n): react.JSX.Element;
|
|
160
167
|
|
|
161
168
|
type Props$m = {
|
|
162
169
|
size?: 'small' | 'medium' | 'large';
|
|
@@ -354,8 +361,10 @@ declare function SortButton({ size, width, label, sortOrder, isDisabled, onClick
|
|
|
354
361
|
|
|
355
362
|
type Props$9 = {
|
|
356
363
|
children?: ReactNode;
|
|
364
|
+
/** レイアウトタイプ */
|
|
365
|
+
layout?: 'auto' | 'equal';
|
|
357
366
|
};
|
|
358
|
-
declare function Tab({ children }: Props$9): react.JSX.Element;
|
|
367
|
+
declare function Tab({ children, layout }: Props$9): react.JSX.Element;
|
|
359
368
|
declare namespace Tab {
|
|
360
369
|
var Item: ({ isSelected, ...props }: {
|
|
361
370
|
id: string;
|
package/dist/index.d.ts
CHANGED
|
@@ -143,20 +143,27 @@ declare const Icon: ({ size, isDisabled, ...props }: Props$o) => react.JSX.Eleme
|
|
|
143
143
|
type Size = 'small' | 'medium' | 'large';
|
|
144
144
|
type Variant = 'outline' | 'text';
|
|
145
145
|
type Props$n = {
|
|
146
|
+
/** 表示するアイコン名 */
|
|
146
147
|
icon: IconName;
|
|
148
|
+
/** ボタンのサイズ */
|
|
147
149
|
size?: Size;
|
|
150
|
+
/** ボタンが無効かどうか */
|
|
148
151
|
isDisabled?: boolean;
|
|
152
|
+
/** ボタンが選択されているかどうか */
|
|
153
|
+
isSelected?: boolean;
|
|
154
|
+
/** パディングを無効にするかどうか */
|
|
149
155
|
isNoPadding?: boolean;
|
|
156
|
+
/** ボタンのバリアント */
|
|
150
157
|
variant?: Variant;
|
|
151
|
-
} & ({
|
|
158
|
+
} & (({
|
|
152
159
|
isAnchor: true;
|
|
153
160
|
href: string;
|
|
154
161
|
target?: HTMLAnchorElement['target'];
|
|
155
|
-
} | {
|
|
162
|
+
} & Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, 'href' | 'target' | 'className'>) | ({
|
|
156
163
|
isAnchor?: false;
|
|
157
164
|
onClick?: () => void;
|
|
158
|
-
});
|
|
159
|
-
declare function IconButton({ size, variant, isNoPadding, isDisabled, ...props }: Props$n): react.JSX.Element;
|
|
165
|
+
} & Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'onClick' | 'disabled' | 'className'>));
|
|
166
|
+
declare function IconButton({ icon, size, variant, isNoPadding, isDisabled, isSelected, ...props }: Props$n): react.JSX.Element;
|
|
160
167
|
|
|
161
168
|
type Props$m = {
|
|
162
169
|
size?: 'small' | 'medium' | 'large';
|
|
@@ -354,8 +361,10 @@ declare function SortButton({ size, width, label, sortOrder, isDisabled, onClick
|
|
|
354
361
|
|
|
355
362
|
type Props$9 = {
|
|
356
363
|
children?: ReactNode;
|
|
364
|
+
/** レイアウトタイプ */
|
|
365
|
+
layout?: 'auto' | 'equal';
|
|
357
366
|
};
|
|
358
|
-
declare function Tab({ children }: Props$9): react.JSX.Element;
|
|
367
|
+
declare function Tab({ children, layout }: Props$9): react.JSX.Element;
|
|
359
368
|
declare namespace Tab {
|
|
360
369
|
var Item: ({ isSelected, ...props }: {
|
|
361
370
|
id: string;
|
package/dist/index.js
CHANGED
|
@@ -636,15 +636,16 @@ var import_component_theme9 = require("@zenkigen-inc/component-theme");
|
|
|
636
636
|
var import_clsx10 = require("clsx");
|
|
637
637
|
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
638
638
|
function IconButton({
|
|
639
|
+
icon,
|
|
639
640
|
size = "medium",
|
|
640
641
|
variant = "outline",
|
|
641
642
|
isNoPadding = false,
|
|
642
643
|
isDisabled = false,
|
|
644
|
+
isSelected = false,
|
|
643
645
|
...props
|
|
644
646
|
}) {
|
|
645
647
|
const baseClasses = (0, import_clsx10.clsx)(
|
|
646
648
|
"typography-label16regular flex items-center justify-center gap-1 rounded",
|
|
647
|
-
import_component_theme9.buttonColors[variant].base,
|
|
648
649
|
import_component_theme9.buttonColors[variant].hover,
|
|
649
650
|
import_component_theme9.buttonColors[variant].active,
|
|
650
651
|
import_component_theme9.buttonColors[variant].disabled,
|
|
@@ -655,14 +656,20 @@ function IconButton({
|
|
|
655
656
|
"h-8 w-8": size === "medium" && !isNoPadding,
|
|
656
657
|
"h-10 w-10": size === "large" && !isNoPadding,
|
|
657
658
|
"inline-flex": props.isAnchor,
|
|
658
|
-
"pointer-events-none": isDisabled
|
|
659
|
+
"pointer-events-none": isDisabled,
|
|
660
|
+
[import_component_theme9.buttonColors[variant].selected]: isSelected,
|
|
661
|
+
[import_component_theme9.buttonColors[variant].base]: !isSelected
|
|
659
662
|
}
|
|
660
663
|
);
|
|
661
664
|
const iconSize = size === "small" ? "small" : "medium";
|
|
662
665
|
if (props.isAnchor === true) {
|
|
663
|
-
|
|
666
|
+
const buttonProps = Object.fromEntries(Object.entries(props).filter(([key]) => key !== "isAnchor"));
|
|
667
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("a", { className: baseClasses, ...buttonProps, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Icon, { name: icon, size: iconSize }) });
|
|
664
668
|
} else {
|
|
665
|
-
|
|
669
|
+
const buttonProps = Object.fromEntries(
|
|
670
|
+
Object.entries(props).filter(([key]) => key !== "isAnchor" && key !== "onClick")
|
|
671
|
+
);
|
|
672
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("button", { type: "button", className: baseClasses, disabled: isDisabled, onClick: props.onClick, ...buttonProps, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Icon, { name: icon, size: iconSize }) });
|
|
666
673
|
}
|
|
667
674
|
}
|
|
668
675
|
|
|
@@ -1681,12 +1688,16 @@ function SortButton({
|
|
|
1681
1688
|
) });
|
|
1682
1689
|
}
|
|
1683
1690
|
|
|
1691
|
+
// src/tab/tab.tsx
|
|
1692
|
+
var import_clsx27 = require("clsx");
|
|
1693
|
+
var import_react26 = require("react");
|
|
1694
|
+
|
|
1684
1695
|
// src/tab/tab-item.tsx
|
|
1685
1696
|
var import_clsx26 = require("clsx");
|
|
1686
1697
|
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
1687
1698
|
var TabItem = ({ isSelected = false, ...props }) => {
|
|
1688
1699
|
const classes = (0, import_clsx26.clsx)(
|
|
1689
|
-
"relative z-0 flex py-2 leading-[24px] before:absolute before:inset-x-0 before:bottom-0 before:h-px hover:text-text01 disabled:pointer-events-none disabled:text-disabled01",
|
|
1700
|
+
"relative z-0 flex justify-center py-2 leading-[24px] before:absolute before:inset-x-0 before:bottom-0 before:h-px hover:text-text01 disabled:pointer-events-none disabled:text-disabled01",
|
|
1690
1701
|
{
|
|
1691
1702
|
"typography-label14regular": !isSelected,
|
|
1692
1703
|
"text-interactive02 hover:before:bg-uiBorder04": !isSelected,
|
|
@@ -1710,31 +1721,33 @@ var TabItem = ({ isSelected = false, ...props }) => {
|
|
|
1710
1721
|
|
|
1711
1722
|
// src/tab/tab.tsx
|
|
1712
1723
|
var import_jsx_runtime36 = require("react/jsx-runtime");
|
|
1713
|
-
function Tab({ children }) {
|
|
1714
|
-
|
|
1715
|
-
|
|
1724
|
+
function Tab({ children, layout = "auto" }) {
|
|
1725
|
+
const childrenCount = import_react26.Children.count(children);
|
|
1726
|
+
const containerStyle = layout === "equal" ? { gridTemplateColumns: `repeat(${childrenCount}, minmax(0,1fr))` } : {};
|
|
1727
|
+
const containerClasses = (0, import_clsx27.clsx)(
|
|
1728
|
+
"relative gap-4 px-6 before:absolute before:inset-x-0 before:bottom-0 before:h-px before:bg-uiBorder01",
|
|
1716
1729
|
{
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
children
|
|
1730
|
+
flex: layout === "auto",
|
|
1731
|
+
grid: layout === "equal"
|
|
1720
1732
|
}
|
|
1721
1733
|
);
|
|
1734
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { role: "tablist", className: containerClasses, style: containerStyle, children });
|
|
1722
1735
|
}
|
|
1723
1736
|
Tab.Item = TabItem;
|
|
1724
1737
|
|
|
1725
1738
|
// src/table/table-cell.tsx
|
|
1726
|
-
var
|
|
1739
|
+
var import_clsx28 = __toESM(require("clsx"));
|
|
1727
1740
|
var import_jsx_runtime37 = require("react/jsx-runtime");
|
|
1728
1741
|
function TableCell({ children, className, isHeader = false }) {
|
|
1729
|
-
const classes = (0,
|
|
1742
|
+
const classes = (0, import_clsx28.default)("border-b border-uiBorder01", { "sticky top-0 z-10 bg-white": isHeader }, className);
|
|
1730
1743
|
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: classes, children });
|
|
1731
1744
|
}
|
|
1732
1745
|
|
|
1733
1746
|
// src/table/table-row.tsx
|
|
1734
|
-
var
|
|
1747
|
+
var import_clsx29 = __toESM(require("clsx"));
|
|
1735
1748
|
var import_jsx_runtime38 = require("react/jsx-runtime");
|
|
1736
1749
|
function TableRow({ children, isHoverBackgroundVisible = false }) {
|
|
1737
|
-
const rowClasses = (0,
|
|
1750
|
+
const rowClasses = (0, import_clsx29.default)("contents", isHoverBackgroundVisible && "[&:hover>div]:bg-hoverUi02");
|
|
1738
1751
|
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: rowClasses, children });
|
|
1739
1752
|
}
|
|
1740
1753
|
|
|
@@ -1768,18 +1781,18 @@ Table.Cell = TableCell;
|
|
|
1768
1781
|
|
|
1769
1782
|
// src/tag/tag.tsx
|
|
1770
1783
|
var import_component_theme20 = require("@zenkigen-inc/component-theme");
|
|
1771
|
-
var
|
|
1784
|
+
var import_clsx31 = __toESM(require("clsx"));
|
|
1772
1785
|
|
|
1773
1786
|
// src/tag/delete-icon.tsx
|
|
1774
1787
|
var import_component_theme19 = require("@zenkigen-inc/component-theme");
|
|
1775
|
-
var
|
|
1788
|
+
var import_clsx30 = __toESM(require("clsx"));
|
|
1776
1789
|
var import_jsx_runtime40 = require("react/jsx-runtime");
|
|
1777
1790
|
var DeleteIcon = ({ color, variant, onClick }) => {
|
|
1778
|
-
const deleteButtonClasses = (0,
|
|
1791
|
+
const deleteButtonClasses = (0, import_clsx30.default)(
|
|
1779
1792
|
"group ml-2 size-[14px] rounded-full p-0.5 hover:cursor-pointer hover:bg-iconOnColor focus-visible:bg-iconOnColor",
|
|
1780
1793
|
import_component_theme19.focusVisible.normal
|
|
1781
1794
|
);
|
|
1782
|
-
const deletePathClasses = (0,
|
|
1795
|
+
const deletePathClasses = (0, import_clsx30.default)({
|
|
1783
1796
|
"fill-interactive02": color === "gray" || variant === "light",
|
|
1784
1797
|
"group-hover:fill-interactive02 group-focus-visible:fill-interactive02 fill-iconOnColor": color !== "gray"
|
|
1785
1798
|
});
|
|
@@ -1797,7 +1810,7 @@ var DeleteIcon = ({ color, variant, onClick }) => {
|
|
|
1797
1810
|
// src/tag/tag.tsx
|
|
1798
1811
|
var import_jsx_runtime41 = require("react/jsx-runtime");
|
|
1799
1812
|
function Tag({ id, children, color, variant = "normal", size = "medium", isEditable, onDelete }) {
|
|
1800
|
-
const wrapperClasses = (0,
|
|
1813
|
+
const wrapperClasses = (0, import_clsx31.default)("flex", "items-center", "justify-center", {
|
|
1801
1814
|
[import_component_theme20.tagColors[color]]: variant === "normal",
|
|
1802
1815
|
[import_component_theme20.tagLightColors[color]]: variant === "light",
|
|
1803
1816
|
"h-[14px] typography-label11regular": !isEditable && size === "x-small",
|
|
@@ -1816,10 +1829,10 @@ function Tag({ id, children, color, variant = "normal", size = "medium", isEdita
|
|
|
1816
1829
|
}
|
|
1817
1830
|
|
|
1818
1831
|
// src/text-area/text-area.tsx
|
|
1819
|
-
var
|
|
1820
|
-
var
|
|
1832
|
+
var import_clsx32 = require("clsx");
|
|
1833
|
+
var import_react27 = require("react");
|
|
1821
1834
|
var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
1822
|
-
var TextArea = (0,
|
|
1835
|
+
var TextArea = (0, import_react27.forwardRef)(
|
|
1823
1836
|
({
|
|
1824
1837
|
size = "medium",
|
|
1825
1838
|
isResizable = false,
|
|
@@ -1830,7 +1843,7 @@ var TextArea = (0, import_react26.forwardRef)(
|
|
|
1830
1843
|
height,
|
|
1831
1844
|
...props
|
|
1832
1845
|
}, ref) => {
|
|
1833
|
-
const classes = (0,
|
|
1846
|
+
const classes = (0, import_clsx32.clsx)(
|
|
1834
1847
|
"w-full rounded border outline-0 placeholder:text-textPlaceholder disabled:text-textPlaceholder",
|
|
1835
1848
|
{
|
|
1836
1849
|
"border-supportError": isError && !disabled,
|
|
@@ -1865,13 +1878,13 @@ var TextArea = (0, import_react26.forwardRef)(
|
|
|
1865
1878
|
TextArea.displayName = "TextArea";
|
|
1866
1879
|
|
|
1867
1880
|
// src/text-input/text-input.tsx
|
|
1868
|
-
var
|
|
1869
|
-
var
|
|
1881
|
+
var import_clsx33 = require("clsx");
|
|
1882
|
+
var import_react28 = require("react");
|
|
1870
1883
|
var import_jsx_runtime43 = require("react/jsx-runtime");
|
|
1871
|
-
var TextInput = (0,
|
|
1884
|
+
var TextInput = (0, import_react28.forwardRef)(
|
|
1872
1885
|
({ size = "medium", isError = false, disabled = false, onClickClearButton, ...props }, ref) => {
|
|
1873
1886
|
const isShowClearButton = !!onClickClearButton && props.value.length !== 0 && !disabled;
|
|
1874
|
-
const inputWrapClasses = (0,
|
|
1887
|
+
const inputWrapClasses = (0, import_clsx33.clsx)("relative flex items-center gap-2 overflow-hidden rounded border", {
|
|
1875
1888
|
"border-uiBorder02": !isError && !disabled,
|
|
1876
1889
|
"border-supportError": isError && !disabled,
|
|
1877
1890
|
"hover:border-hoverInput": !disabled && !isError,
|
|
@@ -1881,7 +1894,7 @@ var TextInput = (0, import_react27.forwardRef)(
|
|
|
1881
1894
|
"pr-2": size === "medium" && isShowClearButton,
|
|
1882
1895
|
"pr-3": size === "large" && isShowClearButton
|
|
1883
1896
|
});
|
|
1884
|
-
const inputClasses = (0,
|
|
1897
|
+
const inputClasses = (0, import_clsx33.clsx)("flex-1 outline-0 placeholder:text-textPlaceholder disabled:text-textPlaceholder", {
|
|
1885
1898
|
["typography-label14regular min-h-8 px-2"]: size === "medium",
|
|
1886
1899
|
["typography-label16regular min-h-10 px-3"]: size === "large",
|
|
1887
1900
|
"text-text01": !isError,
|
|
@@ -1897,8 +1910,8 @@ var TextInput = (0, import_react27.forwardRef)(
|
|
|
1897
1910
|
TextInput.displayName = "TextInput";
|
|
1898
1911
|
|
|
1899
1912
|
// src/toast/toast.tsx
|
|
1900
|
-
var
|
|
1901
|
-
var
|
|
1913
|
+
var import_clsx34 = __toESM(require("clsx"));
|
|
1914
|
+
var import_react29 = require("react");
|
|
1902
1915
|
var import_jsx_runtime44 = require("react/jsx-runtime");
|
|
1903
1916
|
var CLOSE_TIME_MSEC = 5e3;
|
|
1904
1917
|
function Toast({
|
|
@@ -1909,8 +1922,8 @@ function Toast({
|
|
|
1909
1922
|
children,
|
|
1910
1923
|
onClickClose
|
|
1911
1924
|
}) {
|
|
1912
|
-
const [isRemoving, setIsRemoving] = (0,
|
|
1913
|
-
const handleClose = (0,
|
|
1925
|
+
const [isRemoving, setIsRemoving] = (0, import_react29.useState)(false);
|
|
1926
|
+
const handleClose = (0, import_react29.useCallback)(() => {
|
|
1914
1927
|
if (isAnimation) {
|
|
1915
1928
|
setIsRemoving(true);
|
|
1916
1929
|
} else {
|
|
@@ -1918,17 +1931,17 @@ function Toast({
|
|
|
1918
1931
|
}
|
|
1919
1932
|
}, [isAnimation, onClickClose]);
|
|
1920
1933
|
const handleAnimationEnd = (e) => window.getComputedStyle(e.currentTarget).opacity === "0" && onClickClose();
|
|
1921
|
-
const wrapperClasses = (0,
|
|
1934
|
+
const wrapperClasses = (0, import_clsx34.default)("pointer-events-auto flex items-start gap-1 bg-white p-4 shadow-floatingShadow", {
|
|
1922
1935
|
["animate-toast-in"]: isAnimation && !isRemoving,
|
|
1923
1936
|
["animate-toast-out opacity-0"]: isAnimation && isRemoving
|
|
1924
1937
|
});
|
|
1925
|
-
const iconClasses = (0,
|
|
1938
|
+
const iconClasses = (0, import_clsx34.default)("flex items-center", {
|
|
1926
1939
|
"fill-supportSuccess": state === "success",
|
|
1927
1940
|
"fill-supportError": state === "error",
|
|
1928
1941
|
"fill-supportWarning": state === "warning",
|
|
1929
1942
|
"fill-supportInfo": state === "information"
|
|
1930
1943
|
});
|
|
1931
|
-
const textClasses = (0,
|
|
1944
|
+
const textClasses = (0, import_clsx34.default)("typography-body13regular flex-1 pt-[3px]", {
|
|
1932
1945
|
"text-supportError": state === "error",
|
|
1933
1946
|
"text-text01": state === "success" || state === "warning" || state === "information"
|
|
1934
1947
|
});
|
|
@@ -1938,7 +1951,7 @@ function Toast({
|
|
|
1938
1951
|
warning: "warning",
|
|
1939
1952
|
information: "information-filled"
|
|
1940
1953
|
};
|
|
1941
|
-
(0,
|
|
1954
|
+
(0, import_react29.useEffect)(() => {
|
|
1942
1955
|
const timer = window.setTimeout(() => {
|
|
1943
1956
|
if (isAutoClose) {
|
|
1944
1957
|
setIsRemoving(true);
|
|
@@ -1954,20 +1967,20 @@ function Toast({
|
|
|
1954
1967
|
}
|
|
1955
1968
|
|
|
1956
1969
|
// src/toast/toast-provider.tsx
|
|
1957
|
-
var
|
|
1970
|
+
var import_react30 = require("react");
|
|
1958
1971
|
var import_react_dom3 = require("react-dom");
|
|
1959
1972
|
var import_jsx_runtime45 = require("react/jsx-runtime");
|
|
1960
|
-
var ToastContext = (0,
|
|
1973
|
+
var ToastContext = (0, import_react30.createContext)({});
|
|
1961
1974
|
var ToastProvider = ({ children }) => {
|
|
1962
|
-
const [isClientRender, setIsClientRender] = (0,
|
|
1963
|
-
const [toasts, setToasts] = (0,
|
|
1964
|
-
const addToast = (0,
|
|
1975
|
+
const [isClientRender, setIsClientRender] = (0, import_react30.useState)(false);
|
|
1976
|
+
const [toasts, setToasts] = (0, import_react30.useState)([]);
|
|
1977
|
+
const addToast = (0, import_react30.useCallback)(({ message, state }) => {
|
|
1965
1978
|
setToasts((prev) => [...prev, { id: Math.trunc(Math.random() * 1e5), message, state }]);
|
|
1966
1979
|
}, []);
|
|
1967
|
-
const removeToast = (0,
|
|
1980
|
+
const removeToast = (0, import_react30.useCallback)((id) => {
|
|
1968
1981
|
setToasts((prev) => prev.filter((snackbar) => snackbar.id !== id));
|
|
1969
1982
|
}, []);
|
|
1970
|
-
(0,
|
|
1983
|
+
(0, import_react30.useEffect)(() => {
|
|
1971
1984
|
setIsClientRender(true);
|
|
1972
1985
|
}, []);
|
|
1973
1986
|
return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(ToastContext.Provider, { value: { addToast, removeToast }, children: [
|
|
@@ -1979,11 +1992,11 @@ var ToastProvider = ({ children }) => {
|
|
|
1979
1992
|
] });
|
|
1980
1993
|
};
|
|
1981
1994
|
var useToast = () => {
|
|
1982
|
-
return (0,
|
|
1995
|
+
return (0, import_react30.useContext)(ToastContext);
|
|
1983
1996
|
};
|
|
1984
1997
|
|
|
1985
1998
|
// src/toggle/toggle.tsx
|
|
1986
|
-
var
|
|
1999
|
+
var import_clsx35 = __toESM(require("clsx"));
|
|
1987
2000
|
var import_jsx_runtime46 = require("react/jsx-runtime");
|
|
1988
2001
|
function Toggle({
|
|
1989
2002
|
id,
|
|
@@ -1994,7 +2007,7 @@ function Toggle({
|
|
|
1994
2007
|
labelPosition = "right",
|
|
1995
2008
|
isDisabled = false
|
|
1996
2009
|
}) {
|
|
1997
|
-
const baseClasses = (0,
|
|
2010
|
+
const baseClasses = (0, import_clsx35.default)("relative flex items-center rounded-full", {
|
|
1998
2011
|
"bg-disabledOn": isDisabled && isChecked,
|
|
1999
2012
|
"bg-disabled01": isDisabled && !isChecked,
|
|
2000
2013
|
"bg-interactive01 peer-hover:bg-hover01": !isDisabled && isChecked,
|
|
@@ -2002,16 +2015,16 @@ function Toggle({
|
|
|
2002
2015
|
"w-8 h-4 px-[3px]": size === "small",
|
|
2003
2016
|
"w-12 h-6 px-1": size === "medium" || size === "large"
|
|
2004
2017
|
});
|
|
2005
|
-
const inputClasses = (0,
|
|
2018
|
+
const inputClasses = (0, import_clsx35.default)(
|
|
2006
2019
|
"peer absolute inset-0 z-[1] opacity-0",
|
|
2007
2020
|
isDisabled ? "cursor-not-allowed" : "cursor-pointer"
|
|
2008
2021
|
);
|
|
2009
|
-
const indicatorClasses = (0,
|
|
2022
|
+
const indicatorClasses = (0, import_clsx35.default)("rounded-full bg-iconOnColor", {
|
|
2010
2023
|
"w-2.5 h-2.5": size === "small",
|
|
2011
2024
|
"w-4 h-4": size === "medium" || size === "large",
|
|
2012
2025
|
"ml-auto": isChecked
|
|
2013
2026
|
});
|
|
2014
|
-
const labelClasses = (0,
|
|
2027
|
+
const labelClasses = (0, import_clsx35.default)("break-all", {
|
|
2015
2028
|
"mr-2": labelPosition === "left",
|
|
2016
2029
|
"ml-2": labelPosition === "right",
|
|
2017
2030
|
"typography-label14regular": size === "small" || size === "medium",
|
|
@@ -2039,17 +2052,17 @@ function Toggle({
|
|
|
2039
2052
|
}
|
|
2040
2053
|
|
|
2041
2054
|
// src/tooltip/tooltip.tsx
|
|
2042
|
-
var
|
|
2055
|
+
var import_react32 = require("react");
|
|
2043
2056
|
var import_react_dom4 = require("react-dom");
|
|
2044
2057
|
|
|
2045
2058
|
// src/tooltip/tooltip-content.tsx
|
|
2046
|
-
var
|
|
2059
|
+
var import_clsx37 = __toESM(require("clsx"));
|
|
2047
2060
|
|
|
2048
2061
|
// src/tooltip/tail-icon.tsx
|
|
2049
|
-
var
|
|
2062
|
+
var import_clsx36 = __toESM(require("clsx"));
|
|
2050
2063
|
var import_jsx_runtime47 = require("react/jsx-runtime");
|
|
2051
2064
|
var TailIcon = (props) => {
|
|
2052
|
-
const tailClasses = (0,
|
|
2065
|
+
const tailClasses = (0, import_clsx36.default)("absolute fill-uiBackgroundTooltip", {
|
|
2053
2066
|
"rotate-180": props.verticalPosition === "bottom",
|
|
2054
2067
|
"rotate-0": props.verticalPosition !== "bottom",
|
|
2055
2068
|
"-top-1": props.verticalPosition === "bottom" && props.size === "small",
|
|
@@ -2092,7 +2105,7 @@ var TooltipContent = ({
|
|
|
2092
2105
|
maxWidth,
|
|
2093
2106
|
isPortal = false
|
|
2094
2107
|
}) => {
|
|
2095
|
-
const tooltipWrapperClasses = (0,
|
|
2108
|
+
const tooltipWrapperClasses = (0, import_clsx37.default)("absolute z-tooltip m-auto flex", {
|
|
2096
2109
|
"top-0": !isPortal && verticalPosition === "top",
|
|
2097
2110
|
"bottom-0": !isPortal && verticalPosition === "bottom",
|
|
2098
2111
|
"justify-start": horizontalAlign === "left",
|
|
@@ -2101,7 +2114,7 @@ var TooltipContent = ({
|
|
|
2101
2114
|
"w-[24px]": size === "small",
|
|
2102
2115
|
"w-[46px]": size !== "small"
|
|
2103
2116
|
});
|
|
2104
|
-
const tooltipBodyClasses = (0,
|
|
2117
|
+
const tooltipBodyClasses = (0, import_clsx37.default)(
|
|
2105
2118
|
"absolute z-tooltip inline-block w-max rounded bg-uiBackgroundTooltip text-textOnColor",
|
|
2106
2119
|
{
|
|
2107
2120
|
"typography-body12regular": size === "small",
|
|
@@ -2134,9 +2147,9 @@ var TooltipContent = ({
|
|
|
2134
2147
|
};
|
|
2135
2148
|
|
|
2136
2149
|
// src/tooltip/tooltip-hook.ts
|
|
2137
|
-
var
|
|
2150
|
+
var import_react31 = require("react");
|
|
2138
2151
|
var useTooltip = () => {
|
|
2139
|
-
const calculatePosition = (0,
|
|
2152
|
+
const calculatePosition = (0, import_react31.useCallback)(
|
|
2140
2153
|
(args) => {
|
|
2141
2154
|
const result = {
|
|
2142
2155
|
maxWidth: "none",
|
|
@@ -2200,8 +2213,8 @@ function Tooltip({
|
|
|
2200
2213
|
portalTarget
|
|
2201
2214
|
}) {
|
|
2202
2215
|
const { calculatePosition } = useTooltip();
|
|
2203
|
-
const [isVisible, setIsVisible] = (0,
|
|
2204
|
-
const [tooltipPosition, setTooltipPosition] = (0,
|
|
2216
|
+
const [isVisible, setIsVisible] = (0, import_react32.useState)(false);
|
|
2217
|
+
const [tooltipPosition, setTooltipPosition] = (0, import_react32.useState)({
|
|
2205
2218
|
maxWidth: "none",
|
|
2206
2219
|
width: "auto",
|
|
2207
2220
|
left: "0px",
|
|
@@ -2210,17 +2223,17 @@ function Tooltip({
|
|
|
2210
2223
|
translateX: "0",
|
|
2211
2224
|
translateY: "0"
|
|
2212
2225
|
});
|
|
2213
|
-
const targetRef = (0,
|
|
2214
|
-
const handleMouseOverWrapper = (0,
|
|
2226
|
+
const targetRef = (0, import_react32.useRef)(null);
|
|
2227
|
+
const handleMouseOverWrapper = (0, import_react32.useCallback)(() => {
|
|
2215
2228
|
if (isDisabledHover) {
|
|
2216
2229
|
return;
|
|
2217
2230
|
}
|
|
2218
2231
|
setIsVisible(true);
|
|
2219
2232
|
}, [isDisabledHover]);
|
|
2220
|
-
const handleMouseOutWrapper = (0,
|
|
2233
|
+
const handleMouseOutWrapper = (0, import_react32.useCallback)(() => {
|
|
2221
2234
|
setIsVisible(false);
|
|
2222
2235
|
}, []);
|
|
2223
|
-
(0,
|
|
2236
|
+
(0, import_react32.useEffect)(() => {
|
|
2224
2237
|
if (targetRef.current === null) return;
|
|
2225
2238
|
const dimensions = targetRef.current?.getBoundingClientRect();
|
|
2226
2239
|
const position = calculatePosition({ dimensions, maxWidth, verticalPosition, horizontalAlign, tooltipSize: size });
|
package/dist/index.mjs
CHANGED
|
@@ -566,15 +566,16 @@ import { buttonColors as buttonColors3, focusVisible as focusVisible6 } from "@z
|
|
|
566
566
|
import { clsx as clsx10 } from "clsx";
|
|
567
567
|
import { jsx as jsx12 } from "react/jsx-runtime";
|
|
568
568
|
function IconButton({
|
|
569
|
+
icon,
|
|
569
570
|
size = "medium",
|
|
570
571
|
variant = "outline",
|
|
571
572
|
isNoPadding = false,
|
|
572
573
|
isDisabled = false,
|
|
574
|
+
isSelected = false,
|
|
573
575
|
...props
|
|
574
576
|
}) {
|
|
575
577
|
const baseClasses = clsx10(
|
|
576
578
|
"typography-label16regular flex items-center justify-center gap-1 rounded",
|
|
577
|
-
buttonColors3[variant].base,
|
|
578
579
|
buttonColors3[variant].hover,
|
|
579
580
|
buttonColors3[variant].active,
|
|
580
581
|
buttonColors3[variant].disabled,
|
|
@@ -585,14 +586,20 @@ function IconButton({
|
|
|
585
586
|
"h-8 w-8": size === "medium" && !isNoPadding,
|
|
586
587
|
"h-10 w-10": size === "large" && !isNoPadding,
|
|
587
588
|
"inline-flex": props.isAnchor,
|
|
588
|
-
"pointer-events-none": isDisabled
|
|
589
|
+
"pointer-events-none": isDisabled,
|
|
590
|
+
[buttonColors3[variant].selected]: isSelected,
|
|
591
|
+
[buttonColors3[variant].base]: !isSelected
|
|
589
592
|
}
|
|
590
593
|
);
|
|
591
594
|
const iconSize = size === "small" ? "small" : "medium";
|
|
592
595
|
if (props.isAnchor === true) {
|
|
593
|
-
|
|
596
|
+
const buttonProps = Object.fromEntries(Object.entries(props).filter(([key]) => key !== "isAnchor"));
|
|
597
|
+
return /* @__PURE__ */ jsx12("a", { className: baseClasses, ...buttonProps, children: /* @__PURE__ */ jsx12(Icon, { name: icon, size: iconSize }) });
|
|
594
598
|
} else {
|
|
595
|
-
|
|
599
|
+
const buttonProps = Object.fromEntries(
|
|
600
|
+
Object.entries(props).filter(([key]) => key !== "isAnchor" && key !== "onClick")
|
|
601
|
+
);
|
|
602
|
+
return /* @__PURE__ */ jsx12("button", { type: "button", className: baseClasses, disabled: isDisabled, onClick: props.onClick, ...buttonProps, children: /* @__PURE__ */ jsx12(Icon, { name: icon, size: iconSize }) });
|
|
596
603
|
}
|
|
597
604
|
}
|
|
598
605
|
|
|
@@ -1611,12 +1618,16 @@ function SortButton({
|
|
|
1611
1618
|
) });
|
|
1612
1619
|
}
|
|
1613
1620
|
|
|
1621
|
+
// src/tab/tab.tsx
|
|
1622
|
+
import { clsx as clsx27 } from "clsx";
|
|
1623
|
+
import { Children as Children2 } from "react";
|
|
1624
|
+
|
|
1614
1625
|
// src/tab/tab-item.tsx
|
|
1615
1626
|
import { clsx as clsx26 } from "clsx";
|
|
1616
1627
|
import { jsx as jsx33 } from "react/jsx-runtime";
|
|
1617
1628
|
var TabItem = ({ isSelected = false, ...props }) => {
|
|
1618
1629
|
const classes = clsx26(
|
|
1619
|
-
"relative z-0 flex py-2 leading-[24px] before:absolute before:inset-x-0 before:bottom-0 before:h-px hover:text-text01 disabled:pointer-events-none disabled:text-disabled01",
|
|
1630
|
+
"relative z-0 flex justify-center py-2 leading-[24px] before:absolute before:inset-x-0 before:bottom-0 before:h-px hover:text-text01 disabled:pointer-events-none disabled:text-disabled01",
|
|
1620
1631
|
{
|
|
1621
1632
|
"typography-label14regular": !isSelected,
|
|
1622
1633
|
"text-interactive02 hover:before:bg-uiBorder04": !isSelected,
|
|
@@ -1640,31 +1651,33 @@ var TabItem = ({ isSelected = false, ...props }) => {
|
|
|
1640
1651
|
|
|
1641
1652
|
// src/tab/tab.tsx
|
|
1642
1653
|
import { jsx as jsx34 } from "react/jsx-runtime";
|
|
1643
|
-
function Tab({ children }) {
|
|
1644
|
-
|
|
1645
|
-
|
|
1654
|
+
function Tab({ children, layout = "auto" }) {
|
|
1655
|
+
const childrenCount = Children2.count(children);
|
|
1656
|
+
const containerStyle = layout === "equal" ? { gridTemplateColumns: `repeat(${childrenCount}, minmax(0,1fr))` } : {};
|
|
1657
|
+
const containerClasses = clsx27(
|
|
1658
|
+
"relative gap-4 px-6 before:absolute before:inset-x-0 before:bottom-0 before:h-px before:bg-uiBorder01",
|
|
1646
1659
|
{
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
children
|
|
1660
|
+
flex: layout === "auto",
|
|
1661
|
+
grid: layout === "equal"
|
|
1650
1662
|
}
|
|
1651
1663
|
);
|
|
1664
|
+
return /* @__PURE__ */ jsx34("div", { role: "tablist", className: containerClasses, style: containerStyle, children });
|
|
1652
1665
|
}
|
|
1653
1666
|
Tab.Item = TabItem;
|
|
1654
1667
|
|
|
1655
1668
|
// src/table/table-cell.tsx
|
|
1656
|
-
import
|
|
1669
|
+
import clsx28 from "clsx";
|
|
1657
1670
|
import { jsx as jsx35 } from "react/jsx-runtime";
|
|
1658
1671
|
function TableCell({ children, className, isHeader = false }) {
|
|
1659
|
-
const classes =
|
|
1672
|
+
const classes = clsx28("border-b border-uiBorder01", { "sticky top-0 z-10 bg-white": isHeader }, className);
|
|
1660
1673
|
return /* @__PURE__ */ jsx35("div", { className: classes, children });
|
|
1661
1674
|
}
|
|
1662
1675
|
|
|
1663
1676
|
// src/table/table-row.tsx
|
|
1664
|
-
import
|
|
1677
|
+
import clsx29 from "clsx";
|
|
1665
1678
|
import { jsx as jsx36 } from "react/jsx-runtime";
|
|
1666
1679
|
function TableRow({ children, isHoverBackgroundVisible = false }) {
|
|
1667
|
-
const rowClasses =
|
|
1680
|
+
const rowClasses = clsx29("contents", isHoverBackgroundVisible && "[&:hover>div]:bg-hoverUi02");
|
|
1668
1681
|
return /* @__PURE__ */ jsx36("div", { className: rowClasses, children });
|
|
1669
1682
|
}
|
|
1670
1683
|
|
|
@@ -1698,18 +1711,18 @@ Table.Cell = TableCell;
|
|
|
1698
1711
|
|
|
1699
1712
|
// src/tag/tag.tsx
|
|
1700
1713
|
import { tagColors, tagLightColors } from "@zenkigen-inc/component-theme";
|
|
1701
|
-
import
|
|
1714
|
+
import clsx31 from "clsx";
|
|
1702
1715
|
|
|
1703
1716
|
// src/tag/delete-icon.tsx
|
|
1704
1717
|
import { focusVisible as focusVisible16 } from "@zenkigen-inc/component-theme";
|
|
1705
|
-
import
|
|
1718
|
+
import clsx30 from "clsx";
|
|
1706
1719
|
import { jsx as jsx38 } from "react/jsx-runtime";
|
|
1707
1720
|
var DeleteIcon = ({ color, variant, onClick }) => {
|
|
1708
|
-
const deleteButtonClasses =
|
|
1721
|
+
const deleteButtonClasses = clsx30(
|
|
1709
1722
|
"group ml-2 size-[14px] rounded-full p-0.5 hover:cursor-pointer hover:bg-iconOnColor focus-visible:bg-iconOnColor",
|
|
1710
1723
|
focusVisible16.normal
|
|
1711
1724
|
);
|
|
1712
|
-
const deletePathClasses =
|
|
1725
|
+
const deletePathClasses = clsx30({
|
|
1713
1726
|
"fill-interactive02": color === "gray" || variant === "light",
|
|
1714
1727
|
"group-hover:fill-interactive02 group-focus-visible:fill-interactive02 fill-iconOnColor": color !== "gray"
|
|
1715
1728
|
});
|
|
@@ -1727,7 +1740,7 @@ var DeleteIcon = ({ color, variant, onClick }) => {
|
|
|
1727
1740
|
// src/tag/tag.tsx
|
|
1728
1741
|
import { jsx as jsx39, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
1729
1742
|
function Tag({ id, children, color, variant = "normal", size = "medium", isEditable, onDelete }) {
|
|
1730
|
-
const wrapperClasses =
|
|
1743
|
+
const wrapperClasses = clsx31("flex", "items-center", "justify-center", {
|
|
1731
1744
|
[tagColors[color]]: variant === "normal",
|
|
1732
1745
|
[tagLightColors[color]]: variant === "light",
|
|
1733
1746
|
"h-[14px] typography-label11regular": !isEditable && size === "x-small",
|
|
@@ -1746,7 +1759,7 @@ function Tag({ id, children, color, variant = "normal", size = "medium", isEdita
|
|
|
1746
1759
|
}
|
|
1747
1760
|
|
|
1748
1761
|
// src/text-area/text-area.tsx
|
|
1749
|
-
import { clsx as
|
|
1762
|
+
import { clsx as clsx32 } from "clsx";
|
|
1750
1763
|
import { forwardRef as forwardRef2 } from "react";
|
|
1751
1764
|
import { jsx as jsx40 } from "react/jsx-runtime";
|
|
1752
1765
|
var TextArea = forwardRef2(
|
|
@@ -1760,7 +1773,7 @@ var TextArea = forwardRef2(
|
|
|
1760
1773
|
height,
|
|
1761
1774
|
...props
|
|
1762
1775
|
}, ref) => {
|
|
1763
|
-
const classes =
|
|
1776
|
+
const classes = clsx32(
|
|
1764
1777
|
"w-full rounded border outline-0 placeholder:text-textPlaceholder disabled:text-textPlaceholder",
|
|
1765
1778
|
{
|
|
1766
1779
|
"border-supportError": isError && !disabled,
|
|
@@ -1795,13 +1808,13 @@ var TextArea = forwardRef2(
|
|
|
1795
1808
|
TextArea.displayName = "TextArea";
|
|
1796
1809
|
|
|
1797
1810
|
// src/text-input/text-input.tsx
|
|
1798
|
-
import { clsx as
|
|
1811
|
+
import { clsx as clsx33 } from "clsx";
|
|
1799
1812
|
import { forwardRef as forwardRef3 } from "react";
|
|
1800
1813
|
import { jsx as jsx41, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
1801
1814
|
var TextInput = forwardRef3(
|
|
1802
1815
|
({ size = "medium", isError = false, disabled = false, onClickClearButton, ...props }, ref) => {
|
|
1803
1816
|
const isShowClearButton = !!onClickClearButton && props.value.length !== 0 && !disabled;
|
|
1804
|
-
const inputWrapClasses =
|
|
1817
|
+
const inputWrapClasses = clsx33("relative flex items-center gap-2 overflow-hidden rounded border", {
|
|
1805
1818
|
"border-uiBorder02": !isError && !disabled,
|
|
1806
1819
|
"border-supportError": isError && !disabled,
|
|
1807
1820
|
"hover:border-hoverInput": !disabled && !isError,
|
|
@@ -1811,7 +1824,7 @@ var TextInput = forwardRef3(
|
|
|
1811
1824
|
"pr-2": size === "medium" && isShowClearButton,
|
|
1812
1825
|
"pr-3": size === "large" && isShowClearButton
|
|
1813
1826
|
});
|
|
1814
|
-
const inputClasses =
|
|
1827
|
+
const inputClasses = clsx33("flex-1 outline-0 placeholder:text-textPlaceholder disabled:text-textPlaceholder", {
|
|
1815
1828
|
["typography-label14regular min-h-8 px-2"]: size === "medium",
|
|
1816
1829
|
["typography-label16regular min-h-10 px-3"]: size === "large",
|
|
1817
1830
|
"text-text01": !isError,
|
|
@@ -1827,7 +1840,7 @@ var TextInput = forwardRef3(
|
|
|
1827
1840
|
TextInput.displayName = "TextInput";
|
|
1828
1841
|
|
|
1829
1842
|
// src/toast/toast.tsx
|
|
1830
|
-
import
|
|
1843
|
+
import clsx34 from "clsx";
|
|
1831
1844
|
import { useCallback as useCallback8, useEffect as useEffect4, useState as useState9 } from "react";
|
|
1832
1845
|
import { jsx as jsx42, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
1833
1846
|
var CLOSE_TIME_MSEC = 5e3;
|
|
@@ -1848,17 +1861,17 @@ function Toast({
|
|
|
1848
1861
|
}
|
|
1849
1862
|
}, [isAnimation, onClickClose]);
|
|
1850
1863
|
const handleAnimationEnd = (e) => window.getComputedStyle(e.currentTarget).opacity === "0" && onClickClose();
|
|
1851
|
-
const wrapperClasses =
|
|
1864
|
+
const wrapperClasses = clsx34("pointer-events-auto flex items-start gap-1 bg-white p-4 shadow-floatingShadow", {
|
|
1852
1865
|
["animate-toast-in"]: isAnimation && !isRemoving,
|
|
1853
1866
|
["animate-toast-out opacity-0"]: isAnimation && isRemoving
|
|
1854
1867
|
});
|
|
1855
|
-
const iconClasses =
|
|
1868
|
+
const iconClasses = clsx34("flex items-center", {
|
|
1856
1869
|
"fill-supportSuccess": state === "success",
|
|
1857
1870
|
"fill-supportError": state === "error",
|
|
1858
1871
|
"fill-supportWarning": state === "warning",
|
|
1859
1872
|
"fill-supportInfo": state === "information"
|
|
1860
1873
|
});
|
|
1861
|
-
const textClasses =
|
|
1874
|
+
const textClasses = clsx34("typography-body13regular flex-1 pt-[3px]", {
|
|
1862
1875
|
"text-supportError": state === "error",
|
|
1863
1876
|
"text-text01": state === "success" || state === "warning" || state === "information"
|
|
1864
1877
|
});
|
|
@@ -1913,7 +1926,7 @@ var useToast = () => {
|
|
|
1913
1926
|
};
|
|
1914
1927
|
|
|
1915
1928
|
// src/toggle/toggle.tsx
|
|
1916
|
-
import
|
|
1929
|
+
import clsx35 from "clsx";
|
|
1917
1930
|
import { jsx as jsx44, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
1918
1931
|
function Toggle({
|
|
1919
1932
|
id,
|
|
@@ -1924,7 +1937,7 @@ function Toggle({
|
|
|
1924
1937
|
labelPosition = "right",
|
|
1925
1938
|
isDisabled = false
|
|
1926
1939
|
}) {
|
|
1927
|
-
const baseClasses =
|
|
1940
|
+
const baseClasses = clsx35("relative flex items-center rounded-full", {
|
|
1928
1941
|
"bg-disabledOn": isDisabled && isChecked,
|
|
1929
1942
|
"bg-disabled01": isDisabled && !isChecked,
|
|
1930
1943
|
"bg-interactive01 peer-hover:bg-hover01": !isDisabled && isChecked,
|
|
@@ -1932,16 +1945,16 @@ function Toggle({
|
|
|
1932
1945
|
"w-8 h-4 px-[3px]": size === "small",
|
|
1933
1946
|
"w-12 h-6 px-1": size === "medium" || size === "large"
|
|
1934
1947
|
});
|
|
1935
|
-
const inputClasses =
|
|
1948
|
+
const inputClasses = clsx35(
|
|
1936
1949
|
"peer absolute inset-0 z-[1] opacity-0",
|
|
1937
1950
|
isDisabled ? "cursor-not-allowed" : "cursor-pointer"
|
|
1938
1951
|
);
|
|
1939
|
-
const indicatorClasses =
|
|
1952
|
+
const indicatorClasses = clsx35("rounded-full bg-iconOnColor", {
|
|
1940
1953
|
"w-2.5 h-2.5": size === "small",
|
|
1941
1954
|
"w-4 h-4": size === "medium" || size === "large",
|
|
1942
1955
|
"ml-auto": isChecked
|
|
1943
1956
|
});
|
|
1944
|
-
const labelClasses =
|
|
1957
|
+
const labelClasses = clsx35("break-all", {
|
|
1945
1958
|
"mr-2": labelPosition === "left",
|
|
1946
1959
|
"ml-2": labelPosition === "right",
|
|
1947
1960
|
"typography-label14regular": size === "small" || size === "medium",
|
|
@@ -1973,13 +1986,13 @@ import { useCallback as useCallback11, useEffect as useEffect6, useRef as useRef
|
|
|
1973
1986
|
import { createPortal as createPortal4 } from "react-dom";
|
|
1974
1987
|
|
|
1975
1988
|
// src/tooltip/tooltip-content.tsx
|
|
1976
|
-
import
|
|
1989
|
+
import clsx37 from "clsx";
|
|
1977
1990
|
|
|
1978
1991
|
// src/tooltip/tail-icon.tsx
|
|
1979
|
-
import
|
|
1992
|
+
import clsx36 from "clsx";
|
|
1980
1993
|
import { jsx as jsx45 } from "react/jsx-runtime";
|
|
1981
1994
|
var TailIcon = (props) => {
|
|
1982
|
-
const tailClasses =
|
|
1995
|
+
const tailClasses = clsx36("absolute fill-uiBackgroundTooltip", {
|
|
1983
1996
|
"rotate-180": props.verticalPosition === "bottom",
|
|
1984
1997
|
"rotate-0": props.verticalPosition !== "bottom",
|
|
1985
1998
|
"-top-1": props.verticalPosition === "bottom" && props.size === "small",
|
|
@@ -2022,7 +2035,7 @@ var TooltipContent = ({
|
|
|
2022
2035
|
maxWidth,
|
|
2023
2036
|
isPortal = false
|
|
2024
2037
|
}) => {
|
|
2025
|
-
const tooltipWrapperClasses =
|
|
2038
|
+
const tooltipWrapperClasses = clsx37("absolute z-tooltip m-auto flex", {
|
|
2026
2039
|
"top-0": !isPortal && verticalPosition === "top",
|
|
2027
2040
|
"bottom-0": !isPortal && verticalPosition === "bottom",
|
|
2028
2041
|
"justify-start": horizontalAlign === "left",
|
|
@@ -2031,7 +2044,7 @@ var TooltipContent = ({
|
|
|
2031
2044
|
"w-[24px]": size === "small",
|
|
2032
2045
|
"w-[46px]": size !== "small"
|
|
2033
2046
|
});
|
|
2034
|
-
const tooltipBodyClasses =
|
|
2047
|
+
const tooltipBodyClasses = clsx37(
|
|
2035
2048
|
"absolute z-tooltip inline-block w-max rounded bg-uiBackgroundTooltip text-textOnColor",
|
|
2036
2049
|
{
|
|
2037
2050
|
"typography-body12regular": size === "small",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zenkigen-inc/component-ui",
|
|
3
|
-
"version": "1.16.
|
|
3
|
+
"version": "1.16.1",
|
|
4
4
|
"repository": "https://github.com/zenkigen/zenkigen-component",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"publishConfig": {
|
|
@@ -37,8 +37,8 @@
|
|
|
37
37
|
"react-dom": "^18.0.0 || ^19.0.0"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@zenkigen-inc/component-icons": "1.16.
|
|
41
|
-
"@zenkigen-inc/component-theme": "1.16.
|
|
40
|
+
"@zenkigen-inc/component-icons": "1.16.1",
|
|
41
|
+
"@zenkigen-inc/component-theme": "1.16.1",
|
|
42
42
|
"clsx": "2.1.1"
|
|
43
43
|
}
|
|
44
44
|
}
|