@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/index.js CHANGED
@@ -82,18 +82,22 @@ function Breadcrumb({
82
82
  }
83
83
  Breadcrumb.Item = BreadcrumbItem;
84
84
 
85
- const _excluded$6 = ["size", "variant"];
85
+ const _excluded$6 = ["size", "variant", "type", "href", "target", "onClick"];
86
86
  function Button(_ref) {
87
87
  let {
88
88
  size = 'medium',
89
- variant = 'fill'
89
+ variant = 'fill',
90
+ type = 'button',
91
+ href,
92
+ target,
93
+ onClick
90
94
  } = _ref,
91
95
  props = _objectWithoutPropertiesLoose(_ref, _excluded$6);
92
96
  const baseClasses = clsx('flex shrink-0 items-center justify-center gap-1', buttonColors[variant].hover, buttonColors[variant].active, buttonColors[variant].disabled, focusVisible.normal, {
93
97
  'h-6 px-2.5': size === 'small',
94
98
  'h-8 px-3': size === 'medium',
95
99
  'h-10 px-4 leading-[24px]': size === 'large',
96
- 'inline-flex': props.isAnchor,
100
+ 'inline-flex': type === 'anchor',
97
101
  [buttonColors[variant].selected]: props.isSelected,
98
102
  [buttonColors[variant].base]: !props.isSelected,
99
103
  'hover:text-text-textOnColor active:text-text-textOnColor [&:hover>*]:fill-icon-iconOnColor [&:active>*]:fill-icon-iconOnColor': props.isSelected && variant !== 'outline' && variant !== 'text',
@@ -102,11 +106,11 @@ function Button(_ref) {
102
106
  'typography-label1regular': size === 'large',
103
107
  'typography-label2regular': size !== 'large'
104
108
  });
105
- if (props.isAnchor) {
109
+ if (type === 'anchor') {
106
110
  return /*#__PURE__*/jsxs("a", {
107
111
  className: baseClasses,
108
- href: props.href,
109
- target: props.target,
112
+ href: href,
113
+ target: target,
110
114
  style: {
111
115
  borderRadius: props.borderRadius
112
116
  },
@@ -114,10 +118,10 @@ function Button(_ref) {
114
118
  });
115
119
  } else {
116
120
  return /*#__PURE__*/jsxs("button", {
117
- type: "button",
121
+ type: type === 'submit' ? 'submit' : 'button',
118
122
  className: baseClasses,
119
123
  disabled: props.isDisabled,
120
- onClick: props.onClick,
124
+ onClick: onClick,
121
125
  style: {
122
126
  width: props.width,
123
127
  borderRadius: props.borderRadius
@@ -131,7 +135,7 @@ const CheckedIcon = () => {
131
135
  return /*#__PURE__*/jsx("svg", {
132
136
  viewBox: "0 0 20 20",
133
137
  xmlns: "http://www.w3.org/2000/svg",
134
- className: "absolute z-10 h-5 w-5 rounded-sm fill-icon-iconOnColor hover:rounded-sm",
138
+ className: "absolute z-10 size-5 rounded-sm fill-icon-iconOnColor hover:rounded-sm",
135
139
  children: /*#__PURE__*/jsx("path", {
136
140
  fillRule: "evenodd",
137
141
  clipRule: "evenodd",
@@ -144,7 +148,7 @@ const MinusIcon = () => {
144
148
  return /*#__PURE__*/jsx("svg", {
145
149
  viewBox: "0 0 20 20",
146
150
  xmlns: "http://www.w3.org/2000/svg",
147
- className: "absolute z-10 h-5 w-5 rounded-sm fill-icon-iconOnColor hover:rounded-sm",
151
+ className: "absolute z-10 size-5 rounded-sm fill-icon-iconOnColor hover:rounded-sm",
148
152
  children: /*#__PURE__*/jsx("path", {
149
153
  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"
150
154
  })
@@ -172,11 +176,11 @@ function Checkbox({
172
176
  const handleChange = useCallback(e => {
173
177
  !isDisabled && (onChange == null ? void 0 : onChange(e));
174
178
  }, [isDisabled, onChange]);
175
- const baseInputClasses = clsx$1('peer absolute z-[1] h-5 w-5 opacity-0', {
179
+ const baseInputClasses = clsx$1('peer absolute z-[1] size-5 opacity-0', {
176
180
  'cursor-not-allowed': isDisabled,
177
181
  'cursor-pointer': !isDisabled
178
182
  });
179
- const boxClasses = clsx$1('inline-flex h-5 w-5 items-center justify-center rounded-sm border bg-white', focusVisible.normalPeer, {
183
+ const boxClasses = clsx$1('inline-flex size-5 items-center justify-center rounded-sm border bg-white', focusVisible.normalPeer, {
180
184
  'border-disabled-disabled01': isDisabled,
181
185
  'border-hover-hoverUiBorder': !isDisabled && isMouseOver,
182
186
  'border-border-uiBorder03': !isDisabled && !isMouseOver,
@@ -184,7 +188,7 @@ function Checkbox({
184
188
  'border-hover-hoverError': !isDisabled && isMouseOver && color === 'error',
185
189
  'border-support-supportError': !isDisabled && !isMouseOver && color === 'error'
186
190
  });
187
- const indicatorClasses = clsx$1('relative flex h-5 w-5 flex-[0_0_auto] items-center justify-center', {
191
+ const indicatorClasses = clsx$1('relative flex size-5 flex-[0_0_auto] items-center justify-center', {
188
192
  'bg-disabled-disabled01': isDisabled && isChecked,
189
193
  'border-disabled-disabled01': isDisabled
190
194
  });
@@ -199,7 +203,7 @@ function Checkbox({
199
203
  'scale-0': !isChecked,
200
204
  'scale-100': isChecked
201
205
  });
202
- const hoverIndicatorClasses = clsx$1('inline-block h-3 w-3 rounded-[1px]', {
206
+ const hoverIndicatorClasses = clsx$1('inline-block size-3 rounded-[1px]', {
203
207
  'bg-hover-hoverUi': !isDisabled && !isChecked && isMouseOver
204
208
  });
205
209
  const labelClasses = clsx$1('typography-label2regular ml-2 flex-[1_0_0] break-all', {
@@ -209,7 +213,7 @@ function Checkbox({
209
213
  return /*#__PURE__*/jsxs("div", {
210
214
  className: "flex items-center",
211
215
  children: [/*#__PURE__*/jsxs("div", {
212
- className: "flex h-6 w-6 items-center justify-center",
216
+ className: "flex size-6 items-center justify-center",
213
217
  children: [/*#__PURE__*/jsx("input", {
214
218
  type: "checkbox",
215
219
  value: value,
@@ -31547,7 +31551,7 @@ function Modal({
31547
31551
  onClose
31548
31552
  },
31549
31553
  children: /*#__PURE__*/jsx("div", {
31550
- className: "fixed left-0 top-0 z-overlay flex h-full w-full items-center justify-center bg-background-backgroundOverlayBlack py-4",
31554
+ className: "fixed left-0 top-0 z-overlay flex size-full items-center justify-center bg-background-backgroundOverlayBlack py-4",
31551
31555
  children: /*#__PURE__*/jsx("div", {
31552
31556
  className: "grid max-h-full min-h-[120px] grid-rows-[max-content_1fr_max-content] flex-col rounded-lg bg-background-uiBackground01 shadow-modalShadow",
31553
31557
  style: {
@@ -31827,7 +31831,7 @@ function Select({
31827
31831
  'h-10': size === 'large',
31828
31832
  'cursor-not-allowed': isDisabled
31829
31833
  });
31830
- const buttonClasses = clsx$1('flex h-full w-full items-center rounded', buttonColors[variant].base, buttonColors[variant].hover, buttonColors[variant].active, buttonColors[variant].disabled, focusVisible.normal, {
31834
+ const buttonClasses = clsx$1('flex size-full items-center rounded', buttonColors[variant].base, buttonColors[variant].hover, buttonColors[variant].active, buttonColors[variant].disabled, focusVisible.normal, {
31831
31835
  'px-2': size === 'x-small' || size === 'small',
31832
31836
  'px-4': size === 'medium' || size === 'large',
31833
31837
  'pointer-events-none': isDisabled
@@ -31970,24 +31974,24 @@ function Radio({
31970
31974
  setIsMouseOver(false);
31971
31975
  }, []);
31972
31976
  const handleChange = useCallback(e => !isDisabled && (onChange == null ? void 0 : onChange(e)), [isDisabled, onChange]);
31973
- const inputClasses = clsx$1('peer absolute z-[1] h-6 w-6 opacity-0', {
31977
+ const inputClasses = clsx$1('peer absolute z-[1] size-6 opacity-0', {
31974
31978
  'cursor-not-allowed': isDisabled,
31975
31979
  'cursor-pointer': !isDisabled
31976
31980
  });
31977
- const boxClasses = clsx$1('inline-flex h-5 w-5 items-center justify-center rounded-full border border-solid bg-white', focusVisible.normalPeer, {
31981
+ const boxClasses = clsx$1('inline-flex size-5 items-center justify-center rounded-full border border-solid bg-white', focusVisible.normalPeer, {
31978
31982
  'border-disabled-disabled01 hover:border-disabled-disabled01': isDisabled && !isMouseOver,
31979
31983
  'border-hover-hoverUiBorder': !isDisabled && isMouseOver,
31980
31984
  'border-border-uiBorder03': !isDisabled,
31981
31985
  'cursor-not-allowed': isDisabled,
31982
31986
  'cursor-pointer': !isDisabled
31983
31987
  });
31984
- const afterClasses = clsx$1('absolute inset-0 m-auto block h-3 w-3 rounded-full', {
31988
+ const afterClasses = clsx$1('absolute inset-0 m-auto block size-3 rounded-full', {
31985
31989
  'bg-disabled-disabled01': isDisabled && isChecked,
31986
31990
  'bg-active-activeSelectedUi': !isDisabled && isChecked,
31987
31991
  'scale-0': !isChecked,
31988
31992
  'scale-100': isChecked
31989
31993
  });
31990
- const hoverIndicatorClasses = clsx$1('inline-block h-3 w-3 rounded-full', {
31994
+ const hoverIndicatorClasses = clsx$1('inline-block size-3 rounded-full', {
31991
31995
  'bg-hover-hoverUi': !isDisabled && !isChecked && isMouseOver
31992
31996
  });
31993
31997
  const labelClasses = clsx$1('typography-label2regular ml-2 flex-[1_0_0] select-none break-all', {
@@ -31997,7 +32001,7 @@ function Radio({
31997
32001
  return /*#__PURE__*/jsxs("div", {
31998
32002
  className: "flex items-center",
31999
32003
  children: [/*#__PURE__*/jsxs("div", {
32000
- className: "flex h-6 w-6 items-center justify-center",
32004
+ className: "flex size-6 items-center justify-center",
32001
32005
  children: [/*#__PURE__*/jsx("input", {
32002
32006
  type: "checkbox",
32003
32007
  value: value,
@@ -32012,7 +32016,7 @@ function Radio({
32012
32016
  }), /*#__PURE__*/jsx("div", {
32013
32017
  className: boxClasses,
32014
32018
  children: /*#__PURE__*/jsxs("div", {
32015
- className: "relative flex h-5 w-5 flex-[0_0_auto] items-center justify-center",
32019
+ className: "relative flex size-5 flex-[0_0_auto] items-center justify-center",
32016
32020
  children: [/*#__PURE__*/jsx("span", {
32017
32021
  className: afterClasses
32018
32022
  }), /*#__PURE__*/jsx("span", {
@@ -32167,7 +32171,7 @@ function SelectSort({
32167
32171
  'h-10': size === 'large',
32168
32172
  'cursor-not-allowed': isDisabled
32169
32173
  });
32170
- const buttonClasses = clsx$1('flex h-full w-full items-center rounded', buttonColors[variant].hover, buttonColors[variant].active, buttonColors[variant].disabled, focusVisible.normal, {
32174
+ const buttonClasses = clsx$1('flex size-full items-center rounded', buttonColors[variant].hover, buttonColors[variant].active, buttonColors[variant].disabled, focusVisible.normal, {
32171
32175
  [buttonColors[variant].selected]: isSortKey,
32172
32176
  [buttonColors[variant].base]: !isSortKey,
32173
32177
  'px-2': size === 'x-small' || size === 'small',
@@ -32293,7 +32297,7 @@ const DeleteIcon = ({
32293
32297
  variant,
32294
32298
  onClick
32295
32299
  }) => {
32296
- const deleteButtonClasses = clsx$1('group ml-2 h-[14px] w-[14px] rounded-full p-0.5 hover:cursor-pointer hover:bg-icon-iconOnColor focus-visible:bg-icon-iconOnColor', focusVisible.normal);
32300
+ const 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);
32297
32301
  const deletePathClasses = clsx$1({
32298
32302
  'fill-interactive-interactive02': color === 'gray' || variant === 'light',
32299
32303
  'group-hover:fill-interactive-interactive02 group-focus-visible:fill-interactive-interactive02 fill-icon-iconOnColor': color !== 'gray'
@@ -32386,7 +32390,7 @@ const TextInput = /*#__PURE__*/forwardRef((_ref, ref) => {
32386
32390
  onClickClearButton
32387
32391
  } = _ref,
32388
32392
  props = _objectWithoutPropertiesLoose(_ref, _excluded);
32389
- const inputWrapClasses = clsx('flex items-center gap-2 overflow-hidden rounded border pl-2 pr-3', {
32393
+ const inputWrapClasses = clsx('relative flex items-center gap-2 overflow-hidden rounded border', {
32390
32394
  'border-border-uiBorder01': !isError,
32391
32395
  'border-support-supportError': isError && !props.disabled,
32392
32396
  'hover:border-hover-hoverInput': !props.disabled && !isError,
@@ -32394,7 +32398,7 @@ const TextInput = /*#__PURE__*/forwardRef((_ref, ref) => {
32394
32398
  'focus-within:border-active-activeInput': !isError,
32395
32399
  'bg-disabled-disabled02 border-disabled-disabled02': props.disabled
32396
32400
  });
32397
- const inputClasses = clsx('flex-1 outline-0 placeholder:text-text-textPlaceholder disabled:text-text-textPlaceholder', {
32401
+ const inputClasses = clsx('flex-1 pl-2 pr-3 outline-0 placeholder:text-text-textPlaceholder disabled:text-text-textPlaceholder', {
32398
32402
  ['typography-label2regular pt-1.5 pb-2']: size === 'medium',
32399
32403
  ['typography-label1regular py-2.5']: size === 'large',
32400
32404
  'text-text-text01': !isError,
@@ -32407,12 +32411,15 @@ const TextInput = /*#__PURE__*/forwardRef((_ref, ref) => {
32407
32411
  size: 1,
32408
32412
  className: inputClasses,
32409
32413
  onChange: props.onChange
32410
- }, props)), onClickClearButton && props.value && props.value.length !== 0 && !props.disabled && /*#__PURE__*/jsx(IconButton, {
32411
- variant: "text",
32412
- icon: "close",
32413
- size: "small",
32414
- isNoPadding: true,
32415
- onClick: onClickClearButton
32414
+ }, props)), onClickClearButton && props.value && props.value.length !== 0 && !props.disabled && /*#__PURE__*/jsx("div", {
32415
+ className: "absolute right-3",
32416
+ children: /*#__PURE__*/jsx(IconButton, {
32417
+ variant: "text",
32418
+ icon: "close",
32419
+ size: "small",
32420
+ isNoPadding: true,
32421
+ onClick: onClickClearButton
32422
+ })
32416
32423
  })]
32417
32424
  });
32418
32425
  });