@zenkigen-inc/component-ui 1.14.4 → 1.14.5
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/README.md +0 -5
- package/dist/hooks/use-outside-click.d.ts +1 -1
- package/dist/index.esm.js +14 -15
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +18 -18
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -44,11 +44,6 @@ yarn generate-component
|
|
|
44
44
|
|
|
45
45
|
使用する側の import を簡略化させるため root にある [packages/component-ui/src/index.ts](https://github.com/zenkigen/zenkigen-component/blob/main/packages/components/src/index.ts) に実装したコンポーネントを export してください。
|
|
46
46
|
|
|
47
|
-
### コーディングガイドライン(社内のみ)
|
|
48
|
-
|
|
49
|
-
開発する際は以下を参照してください。
|
|
50
|
-
https://www.notion.so/zenkigen/5d4ebd0d93b74124a533cf167b852ec0
|
|
51
|
-
|
|
52
47
|
## ライセンス
|
|
53
48
|
|
|
54
49
|
@zenkigen-inc/component-ui は MIT ライセンスに基づいています。
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { RefObject } from 'react';
|
|
2
|
-
export declare const useOutsideClick: <T extends HTMLElement = HTMLElement>(ref: RefObject<T>, handler: (event: Event) => void, enabled?: boolean) => void;
|
|
2
|
+
export declare const useOutsideClick: <T extends HTMLElement = HTMLElement>(ref: RefObject<T | null>, handler: (event: Event) => void, enabled?: boolean) => void;
|
package/dist/index.esm.js
CHANGED
|
@@ -18,7 +18,7 @@ function _objectWithoutPropertiesLoose(r, e) {
|
|
|
18
18
|
if (null == r) return {};
|
|
19
19
|
var t = {};
|
|
20
20
|
for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
|
|
21
|
-
if (e.
|
|
21
|
+
if (-1 !== e.indexOf(n)) continue;
|
|
22
22
|
t[n] = r[n];
|
|
23
23
|
}
|
|
24
24
|
return t;
|
|
@@ -697,7 +697,7 @@ function Modal(_ref) {
|
|
|
697
697
|
useEffect(function () {
|
|
698
698
|
setIsMounted(true);
|
|
699
699
|
}, []);
|
|
700
|
-
return isMounted && isOpen ? /*#__PURE__*/createPortal(
|
|
700
|
+
return isMounted && isOpen ? /*#__PURE__*/createPortal(/*#__PURE__*/jsx(ModalContext.Provider, {
|
|
701
701
|
value: {
|
|
702
702
|
onClose: onClose
|
|
703
703
|
},
|
|
@@ -1602,15 +1602,18 @@ var TextInput = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
1602
1602
|
disabled = _ref$disabled === void 0 ? false : _ref$disabled,
|
|
1603
1603
|
onClickClearButton = _ref.onClickClearButton,
|
|
1604
1604
|
props = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
1605
|
+
var isShowClearButton = !!onClickClearButton && props.value.length !== 0 && !disabled;
|
|
1605
1606
|
var inputWrapClasses = clsx('relative flex items-center gap-2 overflow-hidden rounded border', {
|
|
1606
1607
|
'border-uiBorder02': !isError && !disabled,
|
|
1607
1608
|
'border-supportError': isError && !disabled,
|
|
1608
1609
|
'hover:border-hoverInput': !disabled && !isError,
|
|
1609
1610
|
'hover:focus-within:border-activeInput': !isError,
|
|
1610
1611
|
'focus-within:border-activeInput': !isError,
|
|
1611
|
-
'bg-disabled02 border-disabled01': disabled
|
|
1612
|
+
'bg-disabled02 border-disabled01': disabled,
|
|
1613
|
+
'pr-2': size === 'medium' && isShowClearButton,
|
|
1614
|
+
'pr-3': size === 'large' && isShowClearButton
|
|
1612
1615
|
});
|
|
1613
|
-
var inputClasses = clsx('flex-1
|
|
1616
|
+
var inputClasses = clsx('flex-1 outline-0 placeholder:text-textPlaceholder disabled:text-textPlaceholder', (_clsx = {}, _clsx['typography-label14regular min-h-8 px-2'] = size === 'medium', _clsx['typography-label16regular min-h-10 px-3'] = size === 'large', _clsx['text-text01'] = !isError, _clsx['text-supportError'] = isError, _clsx['pr-0'] = isShowClearButton, _clsx));
|
|
1614
1617
|
return /*#__PURE__*/jsxs("div", {
|
|
1615
1618
|
className: inputWrapClasses,
|
|
1616
1619
|
children: [/*#__PURE__*/jsx("input", _extends({
|
|
@@ -1619,15 +1622,11 @@ var TextInput = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
1619
1622
|
className: inputClasses,
|
|
1620
1623
|
disabled: disabled,
|
|
1621
1624
|
onChange: props.onChange
|
|
1622
|
-
}, props)),
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
size: "small",
|
|
1628
|
-
isNoPadding: true,
|
|
1629
|
-
onClick: onClickClearButton
|
|
1630
|
-
})
|
|
1625
|
+
}, props)), isShowClearButton && /*#__PURE__*/jsx(IconButton, {
|
|
1626
|
+
variant: "text",
|
|
1627
|
+
icon: "close",
|
|
1628
|
+
size: "small",
|
|
1629
|
+
onClick: onClickClearButton
|
|
1631
1630
|
})]
|
|
1632
1631
|
});
|
|
1633
1632
|
});
|
|
@@ -1745,7 +1744,7 @@ var ToastProvider = function ToastProvider(_ref) {
|
|
|
1745
1744
|
addToast: addToast,
|
|
1746
1745
|
removeToast: removeToast
|
|
1747
1746
|
},
|
|
1748
|
-
children: [children, isClientRender && /*#__PURE__*/createPortal(
|
|
1747
|
+
children: [children, isClientRender && /*#__PURE__*/createPortal(/*#__PURE__*/jsx("div", {
|
|
1749
1748
|
className: "pointer-events-none fixed bottom-0 left-0 z-toast mb-4 ml-4 flex w-full flex-col-reverse gap-[16px]",
|
|
1750
1749
|
children: toasts.map(function (_ref3) {
|
|
1751
1750
|
var id = _ref3.id,
|
|
@@ -2032,7 +2031,7 @@ function Tooltip(_ref) {
|
|
|
2032
2031
|
verticalPosition: verticalPosition,
|
|
2033
2032
|
horizontalAlign: horizontalAlign,
|
|
2034
2033
|
tooltipPosition: tooltipPosition
|
|
2035
|
-
}) : (
|
|
2034
|
+
}) : (/*#__PURE__*/createPortal(/*#__PURE__*/jsx(TooltipContent, {
|
|
2036
2035
|
isPortal: true,
|
|
2037
2036
|
content: content,
|
|
2038
2037
|
size: size,
|