@yamada-ui/close-button 1.0.14-dev-20240222021039 → 1.0.14-dev-20240223042345
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/{chunk-GFO6JU7F.mjs → chunk-J6DNLFJ2.mjs} +12 -3
- package/dist/chunk-J6DNLFJ2.mjs.map +1 -0
- package/dist/close-button.d.mts +6 -0
- package/dist/close-button.d.ts +6 -0
- package/dist/close-button.js +11 -2
- package/dist/close-button.js.map +1 -1
- package/dist/close-button.mjs +1 -1
- package/dist/index.js +11 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +4 -4
- package/dist/chunk-GFO6JU7F.mjs.map +0 -1
|
@@ -14,7 +14,15 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
14
14
|
var CloseButton = forwardRef(
|
|
15
15
|
(props, ref) => {
|
|
16
16
|
const [styles, mergedProps] = useComponentStyle("CloseButton", props);
|
|
17
|
-
const {
|
|
17
|
+
const {
|
|
18
|
+
className,
|
|
19
|
+
children,
|
|
20
|
+
isDisabled,
|
|
21
|
+
isRounded,
|
|
22
|
+
__css,
|
|
23
|
+
disableRipple,
|
|
24
|
+
...rest
|
|
25
|
+
} = omitThemeProps(mergedProps);
|
|
18
26
|
const { onPointerDown, ...rippleProps } = useRipple({
|
|
19
27
|
...rest,
|
|
20
28
|
isDisabled: disableRipple || isDisabled
|
|
@@ -28,7 +36,8 @@ var CloseButton = forwardRef(
|
|
|
28
36
|
alignItems: "center",
|
|
29
37
|
flexShrink: 0,
|
|
30
38
|
...styles,
|
|
31
|
-
...__css
|
|
39
|
+
...__css,
|
|
40
|
+
...isRounded ? { borderRadius: "9999px", border: "1px solid currentColor" } : {}
|
|
32
41
|
};
|
|
33
42
|
return /* @__PURE__ */ jsxs(
|
|
34
43
|
ui.button,
|
|
@@ -53,4 +62,4 @@ var CloseButton = forwardRef(
|
|
|
53
62
|
export {
|
|
54
63
|
CloseButton
|
|
55
64
|
};
|
|
56
|
-
//# sourceMappingURL=chunk-
|
|
65
|
+
//# sourceMappingURL=chunk-J6DNLFJ2.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/close-button.tsx"],"sourcesContent":["import type { HTMLUIProps, ThemeProps, CSSUIObject } from \"@yamada-ui/core\"\nimport {\n ui,\n forwardRef,\n useComponentStyle,\n omitThemeProps,\n} from \"@yamada-ui/core\"\nimport { CloseIcon } from \"@yamada-ui/icon\"\nimport { Ripple, useRipple } from \"@yamada-ui/ripple\"\nimport { cx } from \"@yamada-ui/utils\"\n\ntype CloseButtonOptions = {\n /**\n * If `true`, the button is disabled.\n *\n * @default false\n */\n isDisabled?: boolean\n /**\n * If `true`, disable ripple effects when pressing a element.\n *\n * @default false\n */\n disableRipple?: boolean\n /**\n * If true, the button is full rounded.\n *\n * @default false\n */\n isRounded?: boolean\n}\n\nexport type CloseButtonProps = HTMLUIProps<\"button\"> &\n ThemeProps<\"CloseButton\"> &\n CloseButtonOptions\n\nexport const CloseButton = forwardRef<CloseButtonProps, \"button\">(\n (props, ref) => {\n const [styles, mergedProps] = useComponentStyle(\"CloseButton\", props)\n const {\n className,\n children,\n isDisabled,\n isRounded,\n __css,\n disableRipple,\n ...rest\n } = omitThemeProps(mergedProps)\n const { onPointerDown, ...rippleProps } = useRipple({\n ...rest,\n isDisabled: disableRipple || isDisabled,\n })\n\n const css: CSSUIObject = {\n position: \"relative\",\n overflow: \"hidden\",\n outline: 0,\n display: \"flex\",\n justifyContent: \"center\",\n alignItems: \"center\",\n flexShrink: 0,\n ...styles,\n ...__css,\n ...(isRounded\n ? { borderRadius: \"9999px\", border: \"1px solid currentColor\" }\n : {}),\n }\n\n return (\n <ui.button\n ref={ref}\n type=\"button\"\n aria-label=\"Close\"\n className={cx(\"ui-close-button\", className)}\n disabled={isDisabled}\n __css={css}\n {...rest}\n onPointerDown={onPointerDown}\n >\n {children || <CloseIcon width=\"1em\" height=\"1em\" />}\n\n <Ripple isDisabled={disableRipple || isDisabled} {...rippleProps} />\n </ui.button>\n )\n },\n)\n"],"mappings":";;;AACA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,iBAAiB;AAC1B,SAAS,QAAQ,iBAAiB;AAClC,SAAS,UAAU;AA4Db,SAUe,KAVf;AAjCC,IAAM,cAAc;AAAA,EACzB,CAAC,OAAO,QAAQ;AACd,UAAM,CAAC,QAAQ,WAAW,IAAI,kBAAkB,eAAe,KAAK;AACpE,UAAM;AAAA,MACJ;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,GAAG;AAAA,IACL,IAAI,eAAe,WAAW;AAC9B,UAAM,EAAE,eAAe,GAAG,YAAY,IAAI,UAAU;AAAA,MAClD,GAAG;AAAA,MACH,YAAY,iBAAiB;AAAA,IAC/B,CAAC;AAED,UAAM,MAAmB;AAAA,MACvB,UAAU;AAAA,MACV,UAAU;AAAA,MACV,SAAS;AAAA,MACT,SAAS;AAAA,MACT,gBAAgB;AAAA,MAChB,YAAY;AAAA,MACZ,YAAY;AAAA,MACZ,GAAG;AAAA,MACH,GAAG;AAAA,MACH,GAAI,YACA,EAAE,cAAc,UAAU,QAAQ,yBAAyB,IAC3D,CAAC;AAAA,IACP;AAEA,WACE;AAAA,MAAC,GAAG;AAAA,MAAH;AAAA,QACC;AAAA,QACA,MAAK;AAAA,QACL,cAAW;AAAA,QACX,WAAW,GAAG,mBAAmB,SAAS;AAAA,QAC1C,UAAU;AAAA,QACV,OAAO;AAAA,QACN,GAAG;AAAA,QACJ;AAAA,QAEC;AAAA,sBAAY,oBAAC,aAAU,OAAM,OAAM,QAAO,OAAM;AAAA,UAEjD,oBAAC,UAAO,YAAY,iBAAiB,YAAa,GAAG,aAAa;AAAA;AAAA;AAAA,IACpE;AAAA,EAEJ;AACF;","names":[]}
|
package/dist/close-button.d.mts
CHANGED
|
@@ -14,6 +14,12 @@ type CloseButtonOptions = {
|
|
|
14
14
|
* @default false
|
|
15
15
|
*/
|
|
16
16
|
disableRipple?: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* If true, the button is full rounded.
|
|
19
|
+
*
|
|
20
|
+
* @default false
|
|
21
|
+
*/
|
|
22
|
+
isRounded?: boolean;
|
|
17
23
|
};
|
|
18
24
|
type CloseButtonProps = HTMLUIProps<"button"> & ThemeProps<"CloseButton"> & CloseButtonOptions;
|
|
19
25
|
declare const CloseButton: _yamada_ui_core.Component<"button", CloseButtonProps>;
|
package/dist/close-button.d.ts
CHANGED
|
@@ -14,6 +14,12 @@ type CloseButtonOptions = {
|
|
|
14
14
|
* @default false
|
|
15
15
|
*/
|
|
16
16
|
disableRipple?: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* If true, the button is full rounded.
|
|
19
|
+
*
|
|
20
|
+
* @default false
|
|
21
|
+
*/
|
|
22
|
+
isRounded?: boolean;
|
|
17
23
|
};
|
|
18
24
|
type CloseButtonProps = HTMLUIProps<"button"> & ThemeProps<"CloseButton"> & CloseButtonOptions;
|
|
19
25
|
declare const CloseButton: _yamada_ui_core.Component<"button", CloseButtonProps>;
|
package/dist/close-button.js
CHANGED
|
@@ -32,7 +32,15 @@ var import_jsx_runtime = require("react/jsx-runtime");
|
|
|
32
32
|
var CloseButton = (0, import_core.forwardRef)(
|
|
33
33
|
(props, ref) => {
|
|
34
34
|
const [styles, mergedProps] = (0, import_core.useComponentStyle)("CloseButton", props);
|
|
35
|
-
const {
|
|
35
|
+
const {
|
|
36
|
+
className,
|
|
37
|
+
children,
|
|
38
|
+
isDisabled,
|
|
39
|
+
isRounded,
|
|
40
|
+
__css,
|
|
41
|
+
disableRipple,
|
|
42
|
+
...rest
|
|
43
|
+
} = (0, import_core.omitThemeProps)(mergedProps);
|
|
36
44
|
const { onPointerDown, ...rippleProps } = (0, import_ripple.useRipple)({
|
|
37
45
|
...rest,
|
|
38
46
|
isDisabled: disableRipple || isDisabled
|
|
@@ -46,7 +54,8 @@ var CloseButton = (0, import_core.forwardRef)(
|
|
|
46
54
|
alignItems: "center",
|
|
47
55
|
flexShrink: 0,
|
|
48
56
|
...styles,
|
|
49
|
-
...__css
|
|
57
|
+
...__css,
|
|
58
|
+
...isRounded ? { borderRadius: "9999px", border: "1px solid currentColor" } : {}
|
|
50
59
|
};
|
|
51
60
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
52
61
|
import_core.ui.button,
|
package/dist/close-button.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/close-button.tsx"],"sourcesContent":["import type { HTMLUIProps, ThemeProps, CSSUIObject } from \"@yamada-ui/core\"\nimport {\n ui,\n forwardRef,\n useComponentStyle,\n omitThemeProps,\n} from \"@yamada-ui/core\"\nimport { CloseIcon } from \"@yamada-ui/icon\"\nimport { Ripple, useRipple } from \"@yamada-ui/ripple\"\nimport { cx } from \"@yamada-ui/utils\"\n\ntype CloseButtonOptions = {\n /**\n * If `true`, the button is disabled.\n *\n * @default false\n */\n isDisabled?: boolean\n /**\n * If `true`, disable ripple effects when pressing a element.\n *\n * @default false\n */\n disableRipple?: boolean\n}\n\nexport type CloseButtonProps = HTMLUIProps<\"button\"> &\n ThemeProps<\"CloseButton\"> &\n CloseButtonOptions\n\nexport const CloseButton = forwardRef<CloseButtonProps, \"button\">(\n (props, ref) => {\n const [styles, mergedProps] = useComponentStyle(\"CloseButton\", props)\n const {
|
|
1
|
+
{"version":3,"sources":["../src/close-button.tsx"],"sourcesContent":["import type { HTMLUIProps, ThemeProps, CSSUIObject } from \"@yamada-ui/core\"\nimport {\n ui,\n forwardRef,\n useComponentStyle,\n omitThemeProps,\n} from \"@yamada-ui/core\"\nimport { CloseIcon } from \"@yamada-ui/icon\"\nimport { Ripple, useRipple } from \"@yamada-ui/ripple\"\nimport { cx } from \"@yamada-ui/utils\"\n\ntype CloseButtonOptions = {\n /**\n * If `true`, the button is disabled.\n *\n * @default false\n */\n isDisabled?: boolean\n /**\n * If `true`, disable ripple effects when pressing a element.\n *\n * @default false\n */\n disableRipple?: boolean\n /**\n * If true, the button is full rounded.\n *\n * @default false\n */\n isRounded?: boolean\n}\n\nexport type CloseButtonProps = HTMLUIProps<\"button\"> &\n ThemeProps<\"CloseButton\"> &\n CloseButtonOptions\n\nexport const CloseButton = forwardRef<CloseButtonProps, \"button\">(\n (props, ref) => {\n const [styles, mergedProps] = useComponentStyle(\"CloseButton\", props)\n const {\n className,\n children,\n isDisabled,\n isRounded,\n __css,\n disableRipple,\n ...rest\n } = omitThemeProps(mergedProps)\n const { onPointerDown, ...rippleProps } = useRipple({\n ...rest,\n isDisabled: disableRipple || isDisabled,\n })\n\n const css: CSSUIObject = {\n position: \"relative\",\n overflow: \"hidden\",\n outline: 0,\n display: \"flex\",\n justifyContent: \"center\",\n alignItems: \"center\",\n flexShrink: 0,\n ...styles,\n ...__css,\n ...(isRounded\n ? { borderRadius: \"9999px\", border: \"1px solid currentColor\" }\n : {}),\n }\n\n return (\n <ui.button\n ref={ref}\n type=\"button\"\n aria-label=\"Close\"\n className={cx(\"ui-close-button\", className)}\n disabled={isDisabled}\n __css={css}\n {...rest}\n onPointerDown={onPointerDown}\n >\n {children || <CloseIcon width=\"1em\" height=\"1em\" />}\n\n <Ripple isDisabled={disableRipple || isDisabled} {...rippleProps} />\n </ui.button>\n )\n },\n)\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,kBAKO;AACP,kBAA0B;AAC1B,oBAAkC;AAClC,mBAAmB;AA4Db;AAjCC,IAAM,kBAAc;AAAA,EACzB,CAAC,OAAO,QAAQ;AACd,UAAM,CAAC,QAAQ,WAAW,QAAI,+BAAkB,eAAe,KAAK;AACpE,UAAM;AAAA,MACJ;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,GAAG;AAAA,IACL,QAAI,4BAAe,WAAW;AAC9B,UAAM,EAAE,eAAe,GAAG,YAAY,QAAI,yBAAU;AAAA,MAClD,GAAG;AAAA,MACH,YAAY,iBAAiB;AAAA,IAC/B,CAAC;AAED,UAAM,MAAmB;AAAA,MACvB,UAAU;AAAA,MACV,UAAU;AAAA,MACV,SAAS;AAAA,MACT,SAAS;AAAA,MACT,gBAAgB;AAAA,MAChB,YAAY;AAAA,MACZ,YAAY;AAAA,MACZ,GAAG;AAAA,MACH,GAAG;AAAA,MACH,GAAI,YACA,EAAE,cAAc,UAAU,QAAQ,yBAAyB,IAC3D,CAAC;AAAA,IACP;AAEA,WACE;AAAA,MAAC,eAAG;AAAA,MAAH;AAAA,QACC;AAAA,QACA,MAAK;AAAA,QACL,cAAW;AAAA,QACX,eAAW,iBAAG,mBAAmB,SAAS;AAAA,QAC1C,UAAU;AAAA,QACV,OAAO;AAAA,QACN,GAAG;AAAA,QACJ;AAAA,QAEC;AAAA,sBAAY,4CAAC,yBAAU,OAAM,OAAM,QAAO,OAAM;AAAA,UAEjD,4CAAC,wBAAO,YAAY,iBAAiB,YAAa,GAAG,aAAa;AAAA;AAAA;AAAA,IACpE;AAAA,EAEJ;AACF;","names":[]}
|
package/dist/close-button.mjs
CHANGED
package/dist/index.js
CHANGED
|
@@ -34,7 +34,15 @@ var import_jsx_runtime = require("react/jsx-runtime");
|
|
|
34
34
|
var CloseButton = (0, import_core.forwardRef)(
|
|
35
35
|
(props, ref) => {
|
|
36
36
|
const [styles, mergedProps] = (0, import_core.useComponentStyle)("CloseButton", props);
|
|
37
|
-
const {
|
|
37
|
+
const {
|
|
38
|
+
className,
|
|
39
|
+
children,
|
|
40
|
+
isDisabled,
|
|
41
|
+
isRounded,
|
|
42
|
+
__css,
|
|
43
|
+
disableRipple,
|
|
44
|
+
...rest
|
|
45
|
+
} = (0, import_core.omitThemeProps)(mergedProps);
|
|
38
46
|
const { onPointerDown, ...rippleProps } = (0, import_ripple.useRipple)({
|
|
39
47
|
...rest,
|
|
40
48
|
isDisabled: disableRipple || isDisabled
|
|
@@ -48,7 +56,8 @@ var CloseButton = (0, import_core.forwardRef)(
|
|
|
48
56
|
alignItems: "center",
|
|
49
57
|
flexShrink: 0,
|
|
50
58
|
...styles,
|
|
51
|
-
...__css
|
|
59
|
+
...__css,
|
|
60
|
+
...isRounded ? { borderRadius: "9999px", border: "1px solid currentColor" } : {}
|
|
52
61
|
};
|
|
53
62
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
54
63
|
import_core.ui.button,
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts","../src/close-button.tsx"],"sourcesContent":["export { CloseButton } from \"./close-button\"\nexport type { CloseButtonProps } from \"./close-button\"\n","import type { HTMLUIProps, ThemeProps, CSSUIObject } from \"@yamada-ui/core\"\nimport {\n ui,\n forwardRef,\n useComponentStyle,\n omitThemeProps,\n} from \"@yamada-ui/core\"\nimport { CloseIcon } from \"@yamada-ui/icon\"\nimport { Ripple, useRipple } from \"@yamada-ui/ripple\"\nimport { cx } from \"@yamada-ui/utils\"\n\ntype CloseButtonOptions = {\n /**\n * If `true`, the button is disabled.\n *\n * @default false\n */\n isDisabled?: boolean\n /**\n * If `true`, disable ripple effects when pressing a element.\n *\n * @default false\n */\n disableRipple?: boolean\n}\n\nexport type CloseButtonProps = HTMLUIProps<\"button\"> &\n ThemeProps<\"CloseButton\"> &\n CloseButtonOptions\n\nexport const CloseButton = forwardRef<CloseButtonProps, \"button\">(\n (props, ref) => {\n const [styles, mergedProps] = useComponentStyle(\"CloseButton\", props)\n const {
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","../src/close-button.tsx"],"sourcesContent":["export { CloseButton } from \"./close-button\"\nexport type { CloseButtonProps } from \"./close-button\"\n","import type { HTMLUIProps, ThemeProps, CSSUIObject } from \"@yamada-ui/core\"\nimport {\n ui,\n forwardRef,\n useComponentStyle,\n omitThemeProps,\n} from \"@yamada-ui/core\"\nimport { CloseIcon } from \"@yamada-ui/icon\"\nimport { Ripple, useRipple } from \"@yamada-ui/ripple\"\nimport { cx } from \"@yamada-ui/utils\"\n\ntype CloseButtonOptions = {\n /**\n * If `true`, the button is disabled.\n *\n * @default false\n */\n isDisabled?: boolean\n /**\n * If `true`, disable ripple effects when pressing a element.\n *\n * @default false\n */\n disableRipple?: boolean\n /**\n * If true, the button is full rounded.\n *\n * @default false\n */\n isRounded?: boolean\n}\n\nexport type CloseButtonProps = HTMLUIProps<\"button\"> &\n ThemeProps<\"CloseButton\"> &\n CloseButtonOptions\n\nexport const CloseButton = forwardRef<CloseButtonProps, \"button\">(\n (props, ref) => {\n const [styles, mergedProps] = useComponentStyle(\"CloseButton\", props)\n const {\n className,\n children,\n isDisabled,\n isRounded,\n __css,\n disableRipple,\n ...rest\n } = omitThemeProps(mergedProps)\n const { onPointerDown, ...rippleProps } = useRipple({\n ...rest,\n isDisabled: disableRipple || isDisabled,\n })\n\n const css: CSSUIObject = {\n position: \"relative\",\n overflow: \"hidden\",\n outline: 0,\n display: \"flex\",\n justifyContent: \"center\",\n alignItems: \"center\",\n flexShrink: 0,\n ...styles,\n ...__css,\n ...(isRounded\n ? { borderRadius: \"9999px\", border: \"1px solid currentColor\" }\n : {}),\n }\n\n return (\n <ui.button\n ref={ref}\n type=\"button\"\n aria-label=\"Close\"\n className={cx(\"ui-close-button\", className)}\n disabled={isDisabled}\n __css={css}\n {...rest}\n onPointerDown={onPointerDown}\n >\n {children || <CloseIcon width=\"1em\" height=\"1em\" />}\n\n <Ripple isDisabled={disableRipple || isDisabled} {...rippleProps} />\n </ui.button>\n )\n },\n)\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACCA,kBAKO;AACP,kBAA0B;AAC1B,oBAAkC;AAClC,mBAAmB;AA4Db;AAjCC,IAAM,kBAAc;AAAA,EACzB,CAAC,OAAO,QAAQ;AACd,UAAM,CAAC,QAAQ,WAAW,QAAI,+BAAkB,eAAe,KAAK;AACpE,UAAM;AAAA,MACJ;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,GAAG;AAAA,IACL,QAAI,4BAAe,WAAW;AAC9B,UAAM,EAAE,eAAe,GAAG,YAAY,QAAI,yBAAU;AAAA,MAClD,GAAG;AAAA,MACH,YAAY,iBAAiB;AAAA,IAC/B,CAAC;AAED,UAAM,MAAmB;AAAA,MACvB,UAAU;AAAA,MACV,UAAU;AAAA,MACV,SAAS;AAAA,MACT,SAAS;AAAA,MACT,gBAAgB;AAAA,MAChB,YAAY;AAAA,MACZ,YAAY;AAAA,MACZ,GAAG;AAAA,MACH,GAAG;AAAA,MACH,GAAI,YACA,EAAE,cAAc,UAAU,QAAQ,yBAAyB,IAC3D,CAAC;AAAA,IACP;AAEA,WACE;AAAA,MAAC,eAAG;AAAA,MAAH;AAAA,QACC;AAAA,QACA,MAAK;AAAA,QACL,cAAW;AAAA,QACX,eAAW,iBAAG,mBAAmB,SAAS;AAAA,QAC1C,UAAU;AAAA,QACV,OAAO;AAAA,QACN,GAAG;AAAA,QACJ;AAAA,QAEC;AAAA,sBAAY,4CAAC,yBAAU,OAAM,OAAM,QAAO,OAAM;AAAA,UAEjD,4CAAC,wBAAO,YAAY,iBAAiB,YAAa,GAAG,aAAa;AAAA;AAAA;AAAA,IACpE;AAAA,EAEJ;AACF;","names":[]}
|
package/dist/index.mjs
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yamada-ui/close-button",
|
|
3
|
-
"version": "1.0.14-dev-
|
|
3
|
+
"version": "1.0.14-dev-20240223042345",
|
|
4
4
|
"description": "Yamada UI close button component",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"yamada",
|
|
@@ -36,10 +36,10 @@
|
|
|
36
36
|
"url": "https://github.com/hirotomoyamada/yamada-ui/issues"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@yamada-ui/core": "1.4.1-dev-
|
|
39
|
+
"@yamada-ui/core": "1.4.1-dev-20240223042345",
|
|
40
40
|
"@yamada-ui/utils": "1.0.5",
|
|
41
|
-
"@yamada-ui/ripple": "1.0.14-dev-
|
|
42
|
-
"@yamada-ui/icon": "1.0.13-dev-
|
|
41
|
+
"@yamada-ui/ripple": "1.0.14-dev-20240223042345",
|
|
42
|
+
"@yamada-ui/icon": "1.0.13-dev-20240223042345"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"react": "^18.0.0",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/close-button.tsx"],"sourcesContent":["import type { HTMLUIProps, ThemeProps, CSSUIObject } from \"@yamada-ui/core\"\nimport {\n ui,\n forwardRef,\n useComponentStyle,\n omitThemeProps,\n} from \"@yamada-ui/core\"\nimport { CloseIcon } from \"@yamada-ui/icon\"\nimport { Ripple, useRipple } from \"@yamada-ui/ripple\"\nimport { cx } from \"@yamada-ui/utils\"\n\ntype CloseButtonOptions = {\n /**\n * If `true`, the button is disabled.\n *\n * @default false\n */\n isDisabled?: boolean\n /**\n * If `true`, disable ripple effects when pressing a element.\n *\n * @default false\n */\n disableRipple?: boolean\n}\n\nexport type CloseButtonProps = HTMLUIProps<\"button\"> &\n ThemeProps<\"CloseButton\"> &\n CloseButtonOptions\n\nexport const CloseButton = forwardRef<CloseButtonProps, \"button\">(\n (props, ref) => {\n const [styles, mergedProps] = useComponentStyle(\"CloseButton\", props)\n const { className, children, isDisabled, __css, disableRipple, ...rest } =\n omitThemeProps(mergedProps)\n const { onPointerDown, ...rippleProps } = useRipple({\n ...rest,\n isDisabled: disableRipple || isDisabled,\n })\n\n const css: CSSUIObject = {\n position: \"relative\",\n overflow: \"hidden\",\n outline: 0,\n display: \"flex\",\n justifyContent: \"center\",\n alignItems: \"center\",\n flexShrink: 0,\n ...styles,\n ...__css,\n }\n\n return (\n <ui.button\n ref={ref}\n type=\"button\"\n aria-label=\"Close\"\n className={cx(\"ui-close-button\", className)}\n disabled={isDisabled}\n __css={css}\n {...rest}\n onPointerDown={onPointerDown}\n >\n {children || <CloseIcon width=\"1em\" height=\"1em\" />}\n\n <Ripple isDisabled={disableRipple || isDisabled} {...rippleProps} />\n </ui.button>\n )\n },\n)\n"],"mappings":";;;AACA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,iBAAiB;AAC1B,SAAS,QAAQ,iBAAiB;AAClC,SAAS,UAAU;AA4Cb,SAUe,KAVf;AAvBC,IAAM,cAAc;AAAA,EACzB,CAAC,OAAO,QAAQ;AACd,UAAM,CAAC,QAAQ,WAAW,IAAI,kBAAkB,eAAe,KAAK;AACpE,UAAM,EAAE,WAAW,UAAU,YAAY,OAAO,eAAe,GAAG,KAAK,IACrE,eAAe,WAAW;AAC5B,UAAM,EAAE,eAAe,GAAG,YAAY,IAAI,UAAU;AAAA,MAClD,GAAG;AAAA,MACH,YAAY,iBAAiB;AAAA,IAC/B,CAAC;AAED,UAAM,MAAmB;AAAA,MACvB,UAAU;AAAA,MACV,UAAU;AAAA,MACV,SAAS;AAAA,MACT,SAAS;AAAA,MACT,gBAAgB;AAAA,MAChB,YAAY;AAAA,MACZ,YAAY;AAAA,MACZ,GAAG;AAAA,MACH,GAAG;AAAA,IACL;AAEA,WACE;AAAA,MAAC,GAAG;AAAA,MAAH;AAAA,QACC;AAAA,QACA,MAAK;AAAA,QACL,cAAW;AAAA,QACX,WAAW,GAAG,mBAAmB,SAAS;AAAA,QAC1C,UAAU;AAAA,QACV,OAAO;AAAA,QACN,GAAG;AAAA,QACJ;AAAA,QAEC;AAAA,sBAAY,oBAAC,aAAU,OAAM,OAAM,QAAO,OAAM;AAAA,UAEjD,oBAAC,UAAO,YAAY,iBAAiB,YAAa,GAAG,aAAa;AAAA;AAAA;AAAA,IACpE;AAAA,EAEJ;AACF;","names":[]}
|