@zenkigen-inc/component-ui 1.7.4 → 1.8.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/button/button.d.ts +11 -3
- package/dist/index.esm.js +40 -32
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +40 -33
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/button/button.d.ts
CHANGED
|
@@ -11,12 +11,20 @@ type Props = {
|
|
|
11
11
|
after?: ReactNode;
|
|
12
12
|
borderRadius?: CSSProperties['borderRadius'];
|
|
13
13
|
} & ({
|
|
14
|
-
|
|
14
|
+
type?: 'anchor';
|
|
15
15
|
href: string;
|
|
16
16
|
target?: HTMLAnchorElement['target'];
|
|
17
|
+
onClick?: never;
|
|
17
18
|
} | {
|
|
18
|
-
|
|
19
|
+
type?: 'button';
|
|
20
|
+
href?: never;
|
|
21
|
+
target?: never;
|
|
22
|
+
onClick?: () => void;
|
|
23
|
+
} | {
|
|
24
|
+
type?: 'submit';
|
|
25
|
+
href?: never;
|
|
26
|
+
target?: never;
|
|
19
27
|
onClick?: () => void;
|
|
20
28
|
});
|
|
21
|
-
export declare function Button({ size, variant, ...props }: PropsWithChildren<Props>): import("react").JSX.Element;
|
|
29
|
+
export declare function Button({ size, variant, type, href, target, onClick, ...props }: PropsWithChildren<Props>): import("react").JSX.Element;
|
|
22
30
|
export {};
|
package/dist/index.esm.js
CHANGED
|
@@ -78,25 +78,30 @@ function Breadcrumb(_ref) {
|
|
|
78
78
|
}
|
|
79
79
|
Breadcrumb.Item = BreadcrumbItem;
|
|
80
80
|
|
|
81
|
-
var _excluded$6 = ["size", "variant"];
|
|
81
|
+
var _excluded$6 = ["size", "variant", "type", "href", "target", "onClick"];
|
|
82
82
|
function Button(_ref) {
|
|
83
83
|
var _clsx;
|
|
84
84
|
var _ref$size = _ref.size,
|
|
85
85
|
size = _ref$size === void 0 ? 'medium' : _ref$size,
|
|
86
86
|
_ref$variant = _ref.variant,
|
|
87
87
|
variant = _ref$variant === void 0 ? 'fill' : _ref$variant,
|
|
88
|
+
_ref$type = _ref.type,
|
|
89
|
+
type = _ref$type === void 0 ? 'button' : _ref$type,
|
|
90
|
+
href = _ref.href,
|
|
91
|
+
target = _ref.target,
|
|
92
|
+
onClick = _ref.onClick,
|
|
88
93
|
props = _objectWithoutPropertiesLoose(_ref, _excluded$6);
|
|
89
94
|
var baseClasses = clsx('flex shrink-0 items-center justify-center gap-1', buttonColors[variant].hover, buttonColors[variant].active, buttonColors[variant].disabled, focusVisible.normal, (_clsx = {
|
|
90
95
|
'h-6 px-2.5': size === 'small',
|
|
91
96
|
'h-8 px-3': size === 'medium',
|
|
92
97
|
'h-10 px-4 leading-[24px]': size === 'large',
|
|
93
|
-
'inline-flex':
|
|
98
|
+
'inline-flex': type === 'anchor'
|
|
94
99
|
}, _clsx[buttonColors[variant].selected] = props.isSelected, _clsx[buttonColors[variant].base] = !props.isSelected, _clsx['hover:text-text-textOnColor active:text-text-textOnColor [&:hover>*]:fill-icon-iconOnColor [&:active>*]:fill-icon-iconOnColor'] = props.isSelected && variant !== 'outline' && variant !== 'text', _clsx['pointer-events-none'] = props.isDisabled, _clsx['rounded-button'] = !props.borderRadius, _clsx['typography-label1regular'] = size === 'large', _clsx['typography-label2regular'] = size !== 'large', _clsx));
|
|
95
|
-
if (
|
|
100
|
+
if (type === 'anchor') {
|
|
96
101
|
return /*#__PURE__*/jsxs("a", {
|
|
97
102
|
className: baseClasses,
|
|
98
|
-
href:
|
|
99
|
-
target:
|
|
103
|
+
href: href,
|
|
104
|
+
target: target,
|
|
100
105
|
style: {
|
|
101
106
|
borderRadius: props.borderRadius
|
|
102
107
|
},
|
|
@@ -104,10 +109,10 @@ function Button(_ref) {
|
|
|
104
109
|
});
|
|
105
110
|
} else {
|
|
106
111
|
return /*#__PURE__*/jsxs("button", {
|
|
107
|
-
type:
|
|
112
|
+
type: type === 'submit' ? 'submit' : 'button',
|
|
108
113
|
className: baseClasses,
|
|
109
114
|
disabled: props.isDisabled,
|
|
110
|
-
onClick:
|
|
115
|
+
onClick: onClick,
|
|
111
116
|
style: {
|
|
112
117
|
width: props.width,
|
|
113
118
|
borderRadius: props.borderRadius
|
|
@@ -121,7 +126,7 @@ var CheckedIcon = function CheckedIcon() {
|
|
|
121
126
|
return /*#__PURE__*/jsx("svg", {
|
|
122
127
|
viewBox: "0 0 20 20",
|
|
123
128
|
xmlns: "http://www.w3.org/2000/svg",
|
|
124
|
-
className: "absolute z-10
|
|
129
|
+
className: "absolute z-10 size-5 rounded-sm fill-icon-iconOnColor hover:rounded-sm",
|
|
125
130
|
children: /*#__PURE__*/jsx("path", {
|
|
126
131
|
fillRule: "evenodd",
|
|
127
132
|
clipRule: "evenodd",
|
|
@@ -134,7 +139,7 @@ var MinusIcon = function MinusIcon() {
|
|
|
134
139
|
return /*#__PURE__*/jsx("svg", {
|
|
135
140
|
viewBox: "0 0 20 20",
|
|
136
141
|
xmlns: "http://www.w3.org/2000/svg",
|
|
137
|
-
className: "absolute z-10
|
|
142
|
+
className: "absolute z-10 size-5 rounded-sm fill-icon-iconOnColor hover:rounded-sm",
|
|
138
143
|
children: /*#__PURE__*/jsx("path", {
|
|
139
144
|
d: "M4.94723 10.5028H9.49726H10.5028H15.0528C15.3293 10.5028 15.5556 10.2766 15.5556 10C15.5556 9.72352 15.3293 9.49725 15.0528 9.49725H10.5028H9.49726H4.94723C4.67071 9.49725 4.44446 9.72352 4.44446 10C4.44446 10.2766 4.67071 10.5028 4.94723 10.5028Z"
|
|
140
145
|
})
|
|
@@ -167,11 +172,11 @@ function Checkbox(_ref) {
|
|
|
167
172
|
var handleChange = useCallback(function (e) {
|
|
168
173
|
!isDisabled && (onChange == null ? void 0 : onChange(e));
|
|
169
174
|
}, [isDisabled, onChange]);
|
|
170
|
-
var baseInputClasses = clsx$1('peer absolute z-[1]
|
|
175
|
+
var baseInputClasses = clsx$1('peer absolute z-[1] size-5 opacity-0', {
|
|
171
176
|
'cursor-not-allowed': isDisabled,
|
|
172
177
|
'cursor-pointer': !isDisabled
|
|
173
178
|
});
|
|
174
|
-
var boxClasses = clsx$1('inline-flex
|
|
179
|
+
var boxClasses = clsx$1('inline-flex size-5 items-center justify-center rounded-sm border bg-white', focusVisible.normalPeer, {
|
|
175
180
|
'border-disabled-disabled01': isDisabled,
|
|
176
181
|
'border-hover-hoverUiBorder': !isDisabled && isMouseOver,
|
|
177
182
|
'border-border-uiBorder03': !isDisabled && !isMouseOver,
|
|
@@ -179,7 +184,7 @@ function Checkbox(_ref) {
|
|
|
179
184
|
'border-hover-hoverError': !isDisabled && isMouseOver && color === 'error',
|
|
180
185
|
'border-support-supportError': !isDisabled && !isMouseOver && color === 'error'
|
|
181
186
|
});
|
|
182
|
-
var indicatorClasses = clsx$1('relative flex
|
|
187
|
+
var indicatorClasses = clsx$1('relative flex size-5 flex-[0_0_auto] items-center justify-center', {
|
|
183
188
|
'bg-disabled-disabled01': isDisabled && isChecked,
|
|
184
189
|
'border-disabled-disabled01': isDisabled
|
|
185
190
|
});
|
|
@@ -194,7 +199,7 @@ function Checkbox(_ref) {
|
|
|
194
199
|
'scale-0': !isChecked,
|
|
195
200
|
'scale-100': isChecked
|
|
196
201
|
});
|
|
197
|
-
var hoverIndicatorClasses = clsx$1('inline-block
|
|
202
|
+
var hoverIndicatorClasses = clsx$1('inline-block size-3 rounded-[1px]', {
|
|
198
203
|
'bg-hover-hoverUi': !isDisabled && !isChecked && isMouseOver
|
|
199
204
|
});
|
|
200
205
|
var labelClasses = clsx$1('typography-label2regular ml-2 flex-[1_0_0] break-all', {
|
|
@@ -204,7 +209,7 @@ function Checkbox(_ref) {
|
|
|
204
209
|
return /*#__PURE__*/jsxs("div", {
|
|
205
210
|
className: "flex items-center",
|
|
206
211
|
children: [/*#__PURE__*/jsxs("div", {
|
|
207
|
-
className: "flex
|
|
212
|
+
className: "flex size-6 items-center justify-center",
|
|
208
213
|
children: [/*#__PURE__*/jsx("input", {
|
|
209
214
|
type: "checkbox",
|
|
210
215
|
value: value,
|
|
@@ -31555,7 +31560,7 @@ function Modal(_ref) {
|
|
|
31555
31560
|
onClose: onClose
|
|
31556
31561
|
},
|
|
31557
31562
|
children: /*#__PURE__*/jsx("div", {
|
|
31558
|
-
className: "fixed left-0 top-0 z-overlay flex
|
|
31563
|
+
className: "fixed left-0 top-0 z-overlay flex size-full items-center justify-center bg-background-backgroundOverlayBlack py-4",
|
|
31559
31564
|
children: /*#__PURE__*/jsx("div", {
|
|
31560
31565
|
className: "grid max-h-full min-h-[120px] grid-rows-[max-content_1fr_max-content] flex-col rounded-lg bg-background-uiBackground01 shadow-modalShadow",
|
|
31561
31566
|
style: {
|
|
@@ -31860,7 +31865,7 @@ function Select(_ref) {
|
|
|
31860
31865
|
'h-10': size === 'large',
|
|
31861
31866
|
'cursor-not-allowed': isDisabled
|
|
31862
31867
|
});
|
|
31863
|
-
var buttonClasses = clsx$1('flex
|
|
31868
|
+
var buttonClasses = clsx$1('flex size-full items-center rounded', buttonColors[variant].base, buttonColors[variant].hover, buttonColors[variant].active, buttonColors[variant].disabled, focusVisible.normal, {
|
|
31864
31869
|
'px-2': size === 'x-small' || size === 'small',
|
|
31865
31870
|
'px-4': size === 'medium' || size === 'large',
|
|
31866
31871
|
'pointer-events-none': isDisabled
|
|
@@ -32016,24 +32021,24 @@ function Radio(_ref) {
|
|
|
32016
32021
|
var handleChange = useCallback(function (e) {
|
|
32017
32022
|
return !isDisabled && (onChange == null ? void 0 : onChange(e));
|
|
32018
32023
|
}, [isDisabled, onChange]);
|
|
32019
|
-
var inputClasses = clsx$1('peer absolute z-[1]
|
|
32024
|
+
var inputClasses = clsx$1('peer absolute z-[1] size-6 opacity-0', {
|
|
32020
32025
|
'cursor-not-allowed': isDisabled,
|
|
32021
32026
|
'cursor-pointer': !isDisabled
|
|
32022
32027
|
});
|
|
32023
|
-
var boxClasses = clsx$1('inline-flex
|
|
32028
|
+
var boxClasses = clsx$1('inline-flex size-5 items-center justify-center rounded-full border border-solid bg-white', focusVisible.normalPeer, {
|
|
32024
32029
|
'border-disabled-disabled01 hover:border-disabled-disabled01': isDisabled && !isMouseOver,
|
|
32025
32030
|
'border-hover-hoverUiBorder': !isDisabled && isMouseOver,
|
|
32026
32031
|
'border-border-uiBorder03': !isDisabled,
|
|
32027
32032
|
'cursor-not-allowed': isDisabled,
|
|
32028
32033
|
'cursor-pointer': !isDisabled
|
|
32029
32034
|
});
|
|
32030
|
-
var afterClasses = clsx$1('absolute inset-0 m-auto block
|
|
32035
|
+
var afterClasses = clsx$1('absolute inset-0 m-auto block size-3 rounded-full', {
|
|
32031
32036
|
'bg-disabled-disabled01': isDisabled && isChecked,
|
|
32032
32037
|
'bg-active-activeSelectedUi': !isDisabled && isChecked,
|
|
32033
32038
|
'scale-0': !isChecked,
|
|
32034
32039
|
'scale-100': isChecked
|
|
32035
32040
|
});
|
|
32036
|
-
var hoverIndicatorClasses = clsx$1('inline-block
|
|
32041
|
+
var hoverIndicatorClasses = clsx$1('inline-block size-3 rounded-full', {
|
|
32037
32042
|
'bg-hover-hoverUi': !isDisabled && !isChecked && isMouseOver
|
|
32038
32043
|
});
|
|
32039
32044
|
var labelClasses = clsx$1('typography-label2regular ml-2 flex-[1_0_0] select-none break-all', {
|
|
@@ -32043,7 +32048,7 @@ function Radio(_ref) {
|
|
|
32043
32048
|
return /*#__PURE__*/jsxs("div", {
|
|
32044
32049
|
className: "flex items-center",
|
|
32045
32050
|
children: [/*#__PURE__*/jsxs("div", {
|
|
32046
|
-
className: "flex
|
|
32051
|
+
className: "flex size-6 items-center justify-center",
|
|
32047
32052
|
children: [/*#__PURE__*/jsx("input", {
|
|
32048
32053
|
type: "checkbox",
|
|
32049
32054
|
value: value,
|
|
@@ -32058,7 +32063,7 @@ function Radio(_ref) {
|
|
|
32058
32063
|
}), /*#__PURE__*/jsx("div", {
|
|
32059
32064
|
className: boxClasses,
|
|
32060
32065
|
children: /*#__PURE__*/jsxs("div", {
|
|
32061
|
-
className: "relative flex
|
|
32066
|
+
className: "relative flex size-5 flex-[0_0_auto] items-center justify-center",
|
|
32062
32067
|
children: [/*#__PURE__*/jsx("span", {
|
|
32063
32068
|
className: afterClasses
|
|
32064
32069
|
}), /*#__PURE__*/jsx("span", {
|
|
@@ -32224,7 +32229,7 @@ function SelectSort(_ref) {
|
|
|
32224
32229
|
'h-10': size === 'large',
|
|
32225
32230
|
'cursor-not-allowed': isDisabled
|
|
32226
32231
|
});
|
|
32227
|
-
var buttonClasses = clsx$1('flex
|
|
32232
|
+
var buttonClasses = clsx$1('flex size-full items-center rounded', buttonColors[variant].hover, buttonColors[variant].active, buttonColors[variant].disabled, focusVisible.normal, (_clsx = {}, _clsx[buttonColors[variant].selected] = isSortKey, _clsx[buttonColors[variant].base] = !isSortKey, _clsx['px-2'] = size === 'x-small' || size === 'small', _clsx['px-4'] = size === 'medium' || size === 'large', _clsx['pointer-events-none'] = isDisabled, _clsx));
|
|
32228
32233
|
var labelClasses = clsx$1('truncate', {
|
|
32229
32234
|
'typography-label3regular': size === 'x-small',
|
|
32230
32235
|
'typography-label2regular': size === 'small' || size === 'medium',
|
|
@@ -32341,7 +32346,7 @@ var DeleteIcon = function DeleteIcon(_ref) {
|
|
|
32341
32346
|
var color = _ref.color,
|
|
32342
32347
|
variant = _ref.variant,
|
|
32343
32348
|
onClick = _ref.onClick;
|
|
32344
|
-
var deleteButtonClasses = clsx$1('group ml-2
|
|
32349
|
+
var deleteButtonClasses = clsx$1('group ml-2 size-[14px] rounded-full p-0.5 hover:cursor-pointer hover:bg-icon-iconOnColor focus-visible:bg-icon-iconOnColor', focusVisible.normal);
|
|
32345
32350
|
var deletePathClasses = clsx$1({
|
|
32346
32351
|
'fill-interactive-interactive02': color === 'gray' || variant === 'light',
|
|
32347
32352
|
'group-hover:fill-interactive-interactive02 group-focus-visible:fill-interactive-interactive02 fill-icon-iconOnColor': color !== 'gray'
|
|
@@ -32424,7 +32429,7 @@ var TextInput = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
32424
32429
|
isError = _ref.isError,
|
|
32425
32430
|
onClickClearButton = _ref.onClickClearButton,
|
|
32426
32431
|
props = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
32427
|
-
var inputWrapClasses = clsx('flex items-center gap-2 overflow-hidden rounded border
|
|
32432
|
+
var inputWrapClasses = clsx('relative flex items-center gap-2 overflow-hidden rounded border', {
|
|
32428
32433
|
'border-border-uiBorder01': !isError,
|
|
32429
32434
|
'border-support-supportError': isError && !props.disabled,
|
|
32430
32435
|
'hover:border-hover-hoverInput': !props.disabled && !isError,
|
|
@@ -32432,7 +32437,7 @@ var TextInput = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
32432
32437
|
'focus-within:border-active-activeInput': !isError,
|
|
32433
32438
|
'bg-disabled-disabled02 border-disabled-disabled02': props.disabled
|
|
32434
32439
|
});
|
|
32435
|
-
var inputClasses = clsx('flex-1 outline-0 placeholder:text-text-textPlaceholder disabled:text-text-textPlaceholder', (_clsx = {}, _clsx['typography-label2regular pt-1.5 pb-2'] = size === 'medium', _clsx['typography-label1regular py-2.5'] = size === 'large', _clsx['text-text-text01'] = !isError, _clsx['text-support-supportError'] = isError, _clsx));
|
|
32440
|
+
var inputClasses = clsx('flex-1 pl-2 pr-3 outline-0 placeholder:text-text-textPlaceholder disabled:text-text-textPlaceholder', (_clsx = {}, _clsx['typography-label2regular pt-1.5 pb-2'] = size === 'medium', _clsx['typography-label1regular py-2.5'] = size === 'large', _clsx['text-text-text01'] = !isError, _clsx['text-support-supportError'] = isError, _clsx));
|
|
32436
32441
|
return /*#__PURE__*/jsxs("div", {
|
|
32437
32442
|
className: inputWrapClasses,
|
|
32438
32443
|
children: [/*#__PURE__*/jsx("input", _extends({
|
|
@@ -32440,12 +32445,15 @@ var TextInput = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
32440
32445
|
size: 1,
|
|
32441
32446
|
className: inputClasses,
|
|
32442
32447
|
onChange: props.onChange
|
|
32443
|
-
}, props)), onClickClearButton && props.value && props.value.length !== 0 && !props.disabled && /*#__PURE__*/jsx(
|
|
32444
|
-
|
|
32445
|
-
|
|
32446
|
-
|
|
32447
|
-
|
|
32448
|
-
|
|
32448
|
+
}, props)), onClickClearButton && props.value && props.value.length !== 0 && !props.disabled && /*#__PURE__*/jsx("div", {
|
|
32449
|
+
className: "absolute right-3",
|
|
32450
|
+
children: /*#__PURE__*/jsx(IconButton, {
|
|
32451
|
+
variant: "text",
|
|
32452
|
+
icon: "close",
|
|
32453
|
+
size: "small",
|
|
32454
|
+
isNoPadding: true,
|
|
32455
|
+
onClick: onClickClearButton
|
|
32456
|
+
})
|
|
32449
32457
|
})]
|
|
32450
32458
|
});
|
|
32451
32459
|
});
|