@zenkigen-inc/component-ui 1.13.0 → 1.14.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/button/button.d.ts +3 -1
- package/dist/index.esm.js +12 -10
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +11 -11
- package/dist/index.js.map +1 -1
- package/dist/tag/tag.d.ts +2 -1
- package/dist/toggle/toggle.d.ts +1 -1
- package/package.json +3 -3
package/dist/button/button.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { ComponentPropsWithoutRef, CSSProperties, ElementType, PropsWithChildren, ReactNode } from 'react';
|
|
2
2
|
type Size = 'small' | 'medium' | 'large';
|
|
3
3
|
type Variant = 'fill' | 'fillDanger' | 'outline' | 'text';
|
|
4
|
+
type JustifyContent = 'start' | 'center';
|
|
4
5
|
export type ElementAs = ElementType;
|
|
5
6
|
export type AsProp<T extends ElementAs> = {
|
|
6
7
|
elementAs?: T;
|
|
@@ -15,6 +16,7 @@ type Props<T extends ElementAs> = PolymorphicPropsWithoutRef<T, {
|
|
|
15
16
|
before?: ReactNode;
|
|
16
17
|
after?: ReactNode;
|
|
17
18
|
borderRadius?: CSSProperties['borderRadius'];
|
|
19
|
+
justifyContent?: JustifyContent;
|
|
18
20
|
}>;
|
|
19
|
-
export declare const Button: <T extends ElementAs = "button">({ size, variant, isDisabled, isSelected, width, borderRadius, before, after, elementAs, children, ...props }: Props<T>) => import("react").JSX.Element;
|
|
21
|
+
export declare const Button: <T extends ElementAs = "button">({ size, variant, isDisabled, isSelected, width, borderRadius, justifyContent, before, after, elementAs, children, ...props }: Props<T>) => import("react").JSX.Element;
|
|
20
22
|
export {};
|
package/dist/index.esm.js
CHANGED
|
@@ -71,7 +71,7 @@ function Breadcrumb(_ref) {
|
|
|
71
71
|
}
|
|
72
72
|
Breadcrumb.Item = BreadcrumbItem;
|
|
73
73
|
|
|
74
|
-
var _excluded$7 = ["size", "variant", "isDisabled", "isSelected", "width", "borderRadius", "before", "after", "elementAs", "children"];
|
|
74
|
+
var _excluded$7 = ["size", "variant", "isDisabled", "isSelected", "width", "borderRadius", "justifyContent", "before", "after", "elementAs", "children"];
|
|
75
75
|
var Button = function Button(_ref) {
|
|
76
76
|
var _clsx;
|
|
77
77
|
var _ref$size = _ref.size,
|
|
@@ -83,17 +83,19 @@ var Button = function Button(_ref) {
|
|
|
83
83
|
isSelected = _ref$isSelected === void 0 ? false : _ref$isSelected,
|
|
84
84
|
width = _ref.width,
|
|
85
85
|
borderRadius = _ref.borderRadius,
|
|
86
|
+
_ref$justifyContent = _ref.justifyContent,
|
|
87
|
+
justifyContent = _ref$justifyContent === void 0 ? 'center' : _ref$justifyContent,
|
|
86
88
|
before = _ref.before,
|
|
87
89
|
after = _ref.after,
|
|
88
90
|
elementAs = _ref.elementAs,
|
|
89
91
|
children = _ref.children,
|
|
90
92
|
props = _objectWithoutPropertiesLoose(_ref, _excluded$7);
|
|
91
|
-
var baseClasses = clsx('flex shrink-0 items-center
|
|
93
|
+
var baseClasses = clsx('flex shrink-0 items-center gap-1', buttonColors[variant].hover, buttonColors[variant].active, buttonColors[variant].disabled, focusVisible.normal, (_clsx = {
|
|
92
94
|
'h-6 px-2.5': size === 'small',
|
|
93
95
|
'h-8 px-3': size === 'medium',
|
|
94
96
|
'h-10 px-4 leading-[24px]': size === 'large',
|
|
95
97
|
'inline-flex': elementAs === 'a'
|
|
96
|
-
}, _clsx[buttonColors[variant].selected] = isSelected, _clsx[buttonColors[variant].base] = !isSelected, _clsx['hover:text-textOnColor active:text-textOnColor [&:hover>*]:fill-iconOnColor [&:active>*]:fill-iconOnColor'] = isSelected && variant !== 'outline' && variant !== 'text', _clsx['pointer-events-none'] = isDisabled, _clsx['rounded-button'] = borderRadius == null, _clsx['typography-label16regular'] = size === 'large', _clsx['typography-label14regular'] = size !== 'large', _clsx));
|
|
98
|
+
}, _clsx[buttonColors[variant].selected] = isSelected, _clsx[buttonColors[variant].base] = !isSelected, _clsx['hover:text-textOnColor active:text-textOnColor [&:hover>*]:fill-iconOnColor [&:active>*]:fill-iconOnColor'] = isSelected && variant !== 'outline' && variant !== 'text', _clsx['pointer-events-none'] = isDisabled, _clsx['rounded-button'] = borderRadius == null, _clsx['justify-start'] = justifyContent === 'start', _clsx['justify-center'] = justifyContent === 'center', _clsx['typography-label16regular'] = size === 'large', _clsx['typography-label14regular'] = size !== 'large', _clsx));
|
|
97
99
|
var Component = elementAs != null ? elementAs : 'button';
|
|
98
100
|
return /*#__PURE__*/jsxs(Component, _extends({
|
|
99
101
|
className: baseClasses,
|
|
@@ -258,7 +260,7 @@ var Icon = function Icon(_ref) {
|
|
|
258
260
|
props = _objectWithoutPropertiesLoose(_ref, _excluded$6);
|
|
259
261
|
var classes = clsx('inline-block shrink-0', (_clsx = {
|
|
260
262
|
'fill-disabled01': isDisabled
|
|
261
|
-
}, _clsx[iconColors.icon01] = !isDisabled && props.color === 'icon01', _clsx[iconColors.
|
|
263
|
+
}, _clsx[iconColors.icon01] = !isDisabled && props.color === 'icon01', _clsx[iconColors.icon02] = !isDisabled && props.color === 'icon02', _clsx[iconColors.icon03] = !isDisabled && props.color === 'icon03', _clsx[iconColors.iconOnColor] = !isDisabled && props.color === 'iconOnColor', _clsx['w-3 h-3'] = size === 'x-small', _clsx['w-4 h-4'] = size === 'small', _clsx['w-6 h-6'] = size === 'medium', _clsx['w-8 h-8'] = size === 'large', _clsx['w-10 h-10'] = size === 'x-large', _clsx), props.className);
|
|
262
264
|
return /*#__PURE__*/jsx("span", {
|
|
263
265
|
className: classes,
|
|
264
266
|
children: iconElements[props.name]
|
|
@@ -1245,7 +1247,7 @@ var Search = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
1245
1247
|
}, {
|
|
1246
1248
|
'h-10 px-4': size === 'large'
|
|
1247
1249
|
});
|
|
1248
|
-
var inputClasses = clsx('mx-2
|
|
1250
|
+
var inputClasses = clsx('mx-2 h-full flex-1 text-text01 outline-0 placeholder:text-textPlaceholder', (_clsx = {}, _clsx['typography-label14regular'] = size === 'medium', _clsx['typography-label16regular'] = size === 'large', _clsx));
|
|
1249
1251
|
return /*#__PURE__*/jsx("div", {
|
|
1250
1252
|
className: "relative",
|
|
1251
1253
|
ref: ref,
|
|
@@ -1432,7 +1434,7 @@ var TabItem = function TabItem(_ref) {
|
|
|
1432
1434
|
props = _objectWithoutPropertiesLoose(_ref, _excluded$2);
|
|
1433
1435
|
var classes = clsx('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', {
|
|
1434
1436
|
'typography-label14regular': !isSelected,
|
|
1435
|
-
'text-interactive02 hover:before:bg-
|
|
1437
|
+
'text-interactive02 hover:before:bg-uiBorder04': !isSelected,
|
|
1436
1438
|
'typography-label14bold': isSelected,
|
|
1437
1439
|
'before:bg-interactive01 hover:before:bg-interactive01 pointer-events-none': isSelected
|
|
1438
1440
|
});
|
|
@@ -1784,19 +1786,19 @@ function Toggle(_ref) {
|
|
|
1784
1786
|
'bg-interactive01 peer-hover:bg-hover01': !isDisabled && isChecked,
|
|
1785
1787
|
'bg-interactive02 peer-hover:bg-hover02Dark': !isDisabled && !isChecked,
|
|
1786
1788
|
'w-8 h-4 px-[3px]': size === 'small',
|
|
1787
|
-
'w-12 h-6 px-1': size === 'medium'
|
|
1789
|
+
'w-12 h-6 px-1': size === 'medium' || size === 'large'
|
|
1788
1790
|
});
|
|
1789
1791
|
var inputClasses = clsx$1('peer absolute inset-0 z-[1] opacity-0', isDisabled ? 'cursor-not-allowed' : 'cursor-pointer');
|
|
1790
1792
|
var indicatorClasses = clsx$1('rounded-full bg-iconOnColor', {
|
|
1791
1793
|
'w-2.5 h-2.5': size === 'small',
|
|
1792
|
-
'w-4 h-4': size === 'medium',
|
|
1794
|
+
'w-4 h-4': size === 'medium' || size === 'large',
|
|
1793
1795
|
'ml-auto': isChecked
|
|
1794
1796
|
});
|
|
1795
1797
|
var labelClasses = clsx$1('break-all', {
|
|
1796
1798
|
'mr-2': labelPosition === 'left',
|
|
1797
1799
|
'ml-2': labelPosition === 'right',
|
|
1798
|
-
'typography-
|
|
1799
|
-
'typography-label16regular': size === '
|
|
1800
|
+
'typography-label14regular': size === 'small' || size === 'medium',
|
|
1801
|
+
'typography-label16regular': size === 'large',
|
|
1800
1802
|
'pointer-events-none cursor-not-allowed text-disabled01': isDisabled,
|
|
1801
1803
|
'cursor-pointer text-text01': !isDisabled
|
|
1802
1804
|
});
|