@neo4j-ndl/react 5.6.0 → 5.6.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/lib/cjs/clipboard-button/ClipboardButton.js +7 -5
- package/lib/cjs/clipboard-button/ClipboardButton.js.map +1 -1
- package/lib/cjs/icons/index.js +3 -3
- package/lib/esm/clipboard-button/ClipboardButton.mjs +7 -5
- package/lib/esm/clipboard-button/ClipboardButton.mjs.map +1 -1
- package/lib/esm/icons/index.mjs +3 -3
- package/lib/types/clipboard-button/ClipboardButton.d.ts.map +1 -1
- package/package.json +1 -1
- package/skills/ndl-react/SKILL.md +2 -2
|
@@ -6,7 +6,8 @@ Object.defineProperties(exports, {
|
|
|
6
6
|
const require_runtime = require("../_virtual/_rolldown/runtime.js");
|
|
7
7
|
const require_clean_icon_button_CleanIconButton = require("../clean-icon-button/CleanIconButton.js");
|
|
8
8
|
const require_icon_button_IconButton = require("../icon-button/IconButton.js");
|
|
9
|
-
const
|
|
9
|
+
const require_icons_generated_custom_CheckOutline = require("../icons/generated/custom/CheckOutline.js");
|
|
10
|
+
const require_icons_generated_custom_CopyOutline = require("../icons/generated/custom/CopyOutline.js");
|
|
10
11
|
const require_kbd_Kbd = require("../kbd/Kbd.js");
|
|
11
12
|
const require_outlined_button_OutlinedButton = require("../outlined-button/OutlinedButton.js");
|
|
12
13
|
const require_tooltip_Tooltip = require("../tooltip/Tooltip.js");
|
|
@@ -66,6 +67,7 @@ const ConfirmationButton = (_ref) => {
|
|
|
66
67
|
setIsOpen(true);
|
|
67
68
|
};
|
|
68
69
|
const content = timeoutId === null ? description : actionFeedbackText;
|
|
70
|
+
const currentIcon = timeoutId === null ? icon : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_icons_generated_custom_CheckOutline.default, { className: "ndl-icon-svg" });
|
|
69
71
|
if (type === "clean-icon-button") return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_clean_icon_button_CleanIconButton.CleanIconButton, require_objectSpread2.default(require_objectSpread2.default({}, restProps.cleanIconButtonProps), {}, {
|
|
70
72
|
description: content,
|
|
71
73
|
descriptionKbdProps,
|
|
@@ -84,7 +86,7 @@ const ConfirmationButton = (_ref) => {
|
|
|
84
86
|
},
|
|
85
87
|
className: restProps.className,
|
|
86
88
|
htmlAttributes,
|
|
87
|
-
children:
|
|
89
|
+
children: currentIcon
|
|
88
90
|
}));
|
|
89
91
|
else if (type === "icon-button") return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_icon_button_IconButton.IconButton, require_objectSpread2.default(require_objectSpread2.default({}, restProps.iconButtonProps), {}, {
|
|
90
92
|
description: content,
|
|
@@ -103,7 +105,7 @@ const ConfirmationButton = (_ref) => {
|
|
|
103
105
|
},
|
|
104
106
|
className: restProps.className,
|
|
105
107
|
htmlAttributes,
|
|
106
|
-
children:
|
|
108
|
+
children: currentIcon
|
|
107
109
|
}));
|
|
108
110
|
else if (type === "outlined-button") return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_tooltip_Tooltip.Tooltip, require_objectSpread2.default(require_objectSpread2.default({
|
|
109
111
|
type: "simple",
|
|
@@ -129,7 +131,7 @@ const ConfirmationButton = (_ref) => {
|
|
|
129
131
|
if (onClick) onClick(event);
|
|
130
132
|
handleClick();
|
|
131
133
|
},
|
|
132
|
-
leadingVisual:
|
|
134
|
+
leadingVisual: currentIcon,
|
|
133
135
|
className: restProps.className,
|
|
134
136
|
htmlAttributes,
|
|
135
137
|
children
|
|
@@ -166,7 +168,7 @@ const ClipboardButton = ({ textToCopy, descriptionKbdProps, isDisabled, size, to
|
|
|
166
168
|
type: "clean-icon-button"
|
|
167
169
|
}), {}, {
|
|
168
170
|
tooltipProps,
|
|
169
|
-
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
171
|
+
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_icons_generated_custom_CopyOutline.default, { className: "ndl-icon-svg" }),
|
|
170
172
|
htmlAttributes: require_objectSpread2.default({ "aria-live": "polite" }, htmlAttributes),
|
|
171
173
|
children: type === "outlined-button" && "Copy"
|
|
172
174
|
}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ClipboardButton.js","names":["React","CleanIconButton","IconButton","Tooltip","OutlinedButton","Kbd","useCopyToClipboard","Square2StackIconOutline"],"sources":["../../../src/clipboard-button/ClipboardButton.tsx"],"sourcesContent":["/*!\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\nimport React from 'react';\n\nimport { type ButtonSizes } from '../button';\nimport { CleanIconButton } from '../clean-icon-button';\nimport { useCopyToClipboard } from '../hooks';\nimport { IconButton } from '../icon-button';\nimport { Square2StackIconOutline } from '../icons/generated/heroIcons/Square2StackIconOutline';\nimport { Kbd } from '../kbd';\nimport { OutlinedButton } from '../outlined-button';\nimport { Tooltip } from '../tooltip';\n\ntype ConfirmationButtonProps = {\n description: string;\n descriptionKbdProps?: React.ComponentProps<typeof Kbd>;\n actionFeedbackText: string;\n tooltipProps?: Omit<React.ComponentProps<typeof Tooltip>, 'children'>;\n onClick?: React.ComponentPropsWithoutRef<'button'>['onClick'];\n children: React.ReactNode;\n className?: string;\n icon: React.ReactNode;\n htmlAttributes?: React.ComponentPropsWithoutRef<'button'>;\n} & (\n | {\n type: 'clean-icon-button';\n cleanIconButtonProps?: Omit<\n React.ComponentProps<typeof CleanIconButton>,\n 'children' | 'onClick' | 'tooltip'\n >;\n }\n | {\n type: 'icon-button';\n iconButtonProps?: Omit<\n React.ComponentProps<typeof IconButton>,\n 'children' | 'onClick' | 'tooltip'\n >;\n }\n | {\n type: 'outlined-button';\n outlinedButtonProps?: Omit<\n React.ComponentProps<typeof OutlinedButton>,\n 'children' | 'onClick' | 'tooltip'\n >;\n }\n);\n\nconst ConfirmationButton = ({\n descriptionKbdProps,\n description,\n actionFeedbackText,\n icon,\n children,\n onClick,\n htmlAttributes,\n tooltipProps,\n type = 'clean-icon-button',\n ...restProps\n}: ConfirmationButtonProps) => {\n const [timeoutId, setTimeoutId] = React.useState<number | null>(null);\n const [isOpen, setIsOpen] = React.useState(false);\n\n const handleClick = () => {\n if (timeoutId !== null) {\n clearTimeout(timeoutId);\n }\n\n const newTimeoutId = window.setTimeout(() => {\n setTimeoutId(null);\n }, 2000);\n\n setTimeoutId(newTimeoutId);\n };\n\n const handleCloseTooltip = () => {\n setIsOpen(false);\n };\n\n const handleOpenTooltip = () => {\n setIsOpen(true);\n };\n\n const content = timeoutId === null ? description : actionFeedbackText;\n /* Controlling the tip to make it disappear in a timely manner */\n\n if (type === 'clean-icon-button') {\n return (\n <CleanIconButton\n {...(\n restProps as {\n cleanIconButtonProps: React.ComponentProps<typeof CleanIconButton>;\n }\n ).cleanIconButtonProps}\n description={content}\n descriptionKbdProps={descriptionKbdProps}\n tooltipProps={{\n root: {\n ...tooltipProps,\n isOpen: isOpen || timeoutId !== null,\n },\n trigger: {\n htmlAttributes: {\n onBlur: handleCloseTooltip,\n onFocus: handleOpenTooltip,\n onMouseEnter: handleOpenTooltip,\n onMouseLeave: handleCloseTooltip,\n },\n },\n }}\n onClick={(event) => {\n if (onClick) {\n onClick(event);\n }\n handleClick();\n }}\n className={restProps.className}\n htmlAttributes={htmlAttributes}\n >\n {icon}\n </CleanIconButton>\n );\n } else if (type === 'icon-button') {\n return (\n <IconButton\n {...(\n restProps as {\n iconButtonProps: React.ComponentProps<typeof IconButton>;\n }\n ).iconButtonProps}\n description={content}\n tooltipProps={{\n root: {\n ...tooltipProps,\n isOpen: isOpen || timeoutId !== null,\n },\n trigger: {\n htmlAttributes: {\n onBlur: handleCloseTooltip,\n onFocus: handleOpenTooltip,\n onMouseEnter: handleOpenTooltip,\n onMouseLeave: handleCloseTooltip,\n },\n },\n }}\n onClick={(event) => {\n if (onClick) {\n onClick(event);\n }\n handleClick();\n }}\n className={restProps.className}\n htmlAttributes={htmlAttributes}\n >\n {icon}\n </IconButton>\n );\n } else if (type === 'outlined-button') {\n return (\n <Tooltip\n type=\"simple\"\n isOpen={isOpen || timeoutId !== null}\n {...tooltipProps}\n onOpenChange={(open) => {\n if (open) {\n handleOpenTooltip();\n } else {\n handleCloseTooltip();\n }\n tooltipProps?.onOpenChange?.(open);\n }}\n >\n <Tooltip.Trigger\n hasButtonWrapper\n htmlAttributes={{\n 'aria-label': content,\n onBlur: handleCloseTooltip,\n onFocus: handleOpenTooltip,\n onMouseEnter: handleOpenTooltip,\n onMouseLeave: handleCloseTooltip,\n }}\n >\n <OutlinedButton\n variant=\"neutral\"\n {...(\n restProps as {\n outlinedButtonProps: React.ComponentProps<\n typeof OutlinedButton\n >;\n }\n ).outlinedButtonProps}\n onClick={(event) => {\n if (onClick) {\n onClick(event);\n }\n handleClick();\n }}\n leadingVisual={icon}\n className={restProps.className}\n htmlAttributes={htmlAttributes}\n >\n {children}\n </OutlinedButton>\n </Tooltip.Trigger>\n <Tooltip.Content>\n {content}\n {descriptionKbdProps && <Kbd {...descriptionKbdProps} />}\n </Tooltip.Content>\n </Tooltip>\n );\n }\n};\n\n/**\n * @remarks\n * For more information of the `TooltipProps` type, see the Tooltip component documentation.\n */\ninterface ClipboardButtonProps {\n /** The text that should be set to users clipboard */\n textToCopy: string;\n descriptionKbdProps?: React.ComponentProps<typeof Kbd>;\n tooltipProps?: Omit<React.ComponentProps<typeof Tooltip>, 'children'>;\n isDisabled?: boolean;\n size?: ButtonSizes;\n htmlAttributes?: React.ComponentPropsWithoutRef<'button'>;\n type?: 'outlined-button' | 'clean-icon-button' | 'icon-button';\n}\n\nexport const ClipboardButton = ({\n textToCopy,\n descriptionKbdProps,\n isDisabled,\n size,\n tooltipProps,\n htmlAttributes,\n type,\n}: ClipboardButtonProps) => {\n const [, copyFunction] = useCopyToClipboard();\n\n const isOutlinedButton = type === 'outlined-button';\n const isIconButton = type === 'icon-button';\n\n const props = isOutlinedButton\n ? {\n outlinedButtonProps: {\n isDisabled,\n size,\n },\n type: 'outlined-button' as const,\n }\n : isIconButton\n ? {\n iconButtonProps: {\n description: 'Copy to clipboard',\n isDisabled,\n size,\n },\n type: 'icon-button' as const,\n }\n : {\n cleanIconButtonProps: {\n description: 'Copy to clipboard',\n isDisabled,\n size,\n },\n type: 'clean-icon-button' as const,\n };\n\n return (\n <ConfirmationButton\n onClick={() => copyFunction(textToCopy)}\n description=\"Copy to clipboard\"\n actionFeedbackText=\"Copied\"\n descriptionKbdProps={descriptionKbdProps}\n {...props}\n tooltipProps={tooltipProps}\n icon={<Square2StackIconOutline className=\"ndl-icon-svg\" />}\n htmlAttributes={{\n 'aria-live': 'polite',\n ...htmlAttributes,\n }}\n >\n {type === 'outlined-button' && 'Copy'}\n </ConfirmationButton>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkEE;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;;AATF,MAAM,sBAAsB,SAWG;CAXH,IAAA,EAC1B,qBACA,aACA,oBACA,MACA,UACA,SACA,gBACA,cACA,OAAO,wBAAA,MACJ,YAAA,gCAAA,QAAA,MAAA,SAAA;CAEH,MAAM,CAAC,WAAW,gBAAgBA,MAAAA,QAAM,SAAwB,IAAI;CACpE,MAAM,CAAC,QAAQ,aAAaA,MAAAA,QAAM,SAAS,KAAK;CAEhD,MAAM,oBAAoB;EACxB,IAAI,cAAc,MAChB,aAAa,SAAS;EAGxB,MAAM,eAAe,OAAO,iBAAiB;GAC3C,aAAa,IAAI;EACnB,GAAG,GAAI;EA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,SAAS,gBAWxB;EACE,iBAAiB;GACf,aAAa;GACb;GACA;EACF;EACA,MAAM;CACR,IACA;EACE,sBAAsB;GACpB,aAAa;GACb;GACA;EACF;EACA,MAAM;CACR,CAAA,GAAA,CAAA,GAAA;EASY;EACd,MAAM,iBAAA,GAAA,kBAAA,IAAA,CAACC,0DAAAA,yBAAD,EAAyB,WAAU,eAAgB,CAAA;EACzD,gBAAA,sBAAA,QAAA,EACE,aAAa,SAAA,GACV,cACL;EAEC,UAAA,SAAS,qBAAqB;CACb,CAAA,CAAA;AAExB"}
|
|
1
|
+
{"version":3,"file":"ClipboardButton.js","names":["React","CheckOutlineIcon","CleanIconButton","IconButton","Tooltip","OutlinedButton","Kbd","useCopyToClipboard","CopyOutlineIcon"],"sources":["../../../src/clipboard-button/ClipboardButton.tsx"],"sourcesContent":["/*!\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\nimport React from 'react';\n\nimport { type ButtonSizes } from '../button';\nimport { CleanIconButton } from '../clean-icon-button';\nimport { useCopyToClipboard } from '../hooks';\nimport { IconButton } from '../icon-button';\nimport CheckOutlineIcon from '../icons/generated/custom/CheckOutline';\nimport CopyOutlineIcon from '../icons/generated/custom/CopyOutline';\nimport { Kbd } from '../kbd';\nimport { OutlinedButton } from '../outlined-button';\nimport { Tooltip } from '../tooltip';\n\ntype ConfirmationButtonProps = {\n description: string;\n descriptionKbdProps?: React.ComponentProps<typeof Kbd>;\n actionFeedbackText: string;\n tooltipProps?: Omit<React.ComponentProps<typeof Tooltip>, 'children'>;\n onClick?: React.ComponentPropsWithoutRef<'button'>['onClick'];\n children: React.ReactNode;\n className?: string;\n icon: React.ReactNode;\n htmlAttributes?: React.ComponentPropsWithoutRef<'button'>;\n} & (\n | {\n type: 'clean-icon-button';\n cleanIconButtonProps?: Omit<\n React.ComponentProps<typeof CleanIconButton>,\n 'children' | 'onClick' | 'tooltip'\n >;\n }\n | {\n type: 'icon-button';\n iconButtonProps?: Omit<\n React.ComponentProps<typeof IconButton>,\n 'children' | 'onClick' | 'tooltip'\n >;\n }\n | {\n type: 'outlined-button';\n outlinedButtonProps?: Omit<\n React.ComponentProps<typeof OutlinedButton>,\n 'children' | 'onClick' | 'tooltip'\n >;\n }\n);\n\nconst ConfirmationButton = ({\n descriptionKbdProps,\n description,\n actionFeedbackText,\n icon,\n children,\n onClick,\n htmlAttributes,\n tooltipProps,\n type = 'clean-icon-button',\n ...restProps\n}: ConfirmationButtonProps) => {\n const [timeoutId, setTimeoutId] = React.useState<number | null>(null);\n const [isOpen, setIsOpen] = React.useState(false);\n\n const handleClick = () => {\n if (timeoutId !== null) {\n clearTimeout(timeoutId);\n }\n\n const newTimeoutId = window.setTimeout(() => {\n setTimeoutId(null);\n }, 2000);\n\n setTimeoutId(newTimeoutId);\n };\n\n const handleCloseTooltip = () => {\n setIsOpen(false);\n };\n\n const handleOpenTooltip = () => {\n setIsOpen(true);\n };\n\n const content = timeoutId === null ? description : actionFeedbackText;\n const currentIcon =\n timeoutId === null ? icon : <CheckOutlineIcon className=\"ndl-icon-svg\" />;\n /* Controlling the tip to make it disappear in a timely manner */\n\n if (type === 'clean-icon-button') {\n return (\n <CleanIconButton\n {...(\n restProps as {\n cleanIconButtonProps: React.ComponentProps<typeof CleanIconButton>;\n }\n ).cleanIconButtonProps}\n description={content}\n descriptionKbdProps={descriptionKbdProps}\n tooltipProps={{\n root: {\n ...tooltipProps,\n isOpen: isOpen || timeoutId !== null,\n },\n trigger: {\n htmlAttributes: {\n onBlur: handleCloseTooltip,\n onFocus: handleOpenTooltip,\n onMouseEnter: handleOpenTooltip,\n onMouseLeave: handleCloseTooltip,\n },\n },\n }}\n onClick={(event) => {\n if (onClick) {\n onClick(event);\n }\n handleClick();\n }}\n className={restProps.className}\n htmlAttributes={htmlAttributes}\n >\n {currentIcon}\n </CleanIconButton>\n );\n } else if (type === 'icon-button') {\n return (\n <IconButton\n {...(\n restProps as {\n iconButtonProps: React.ComponentProps<typeof IconButton>;\n }\n ).iconButtonProps}\n description={content}\n tooltipProps={{\n root: {\n ...tooltipProps,\n isOpen: isOpen || timeoutId !== null,\n },\n trigger: {\n htmlAttributes: {\n onBlur: handleCloseTooltip,\n onFocus: handleOpenTooltip,\n onMouseEnter: handleOpenTooltip,\n onMouseLeave: handleCloseTooltip,\n },\n },\n }}\n onClick={(event) => {\n if (onClick) {\n onClick(event);\n }\n handleClick();\n }}\n className={restProps.className}\n htmlAttributes={htmlAttributes}\n >\n {currentIcon}\n </IconButton>\n );\n } else if (type === 'outlined-button') {\n return (\n <Tooltip\n type=\"simple\"\n isOpen={isOpen || timeoutId !== null}\n {...tooltipProps}\n onOpenChange={(open) => {\n if (open) {\n handleOpenTooltip();\n } else {\n handleCloseTooltip();\n }\n tooltipProps?.onOpenChange?.(open);\n }}\n >\n <Tooltip.Trigger\n hasButtonWrapper\n htmlAttributes={{\n 'aria-label': content,\n onBlur: handleCloseTooltip,\n onFocus: handleOpenTooltip,\n onMouseEnter: handleOpenTooltip,\n onMouseLeave: handleCloseTooltip,\n }}\n >\n <OutlinedButton\n variant=\"neutral\"\n {...(\n restProps as {\n outlinedButtonProps: React.ComponentProps<\n typeof OutlinedButton\n >;\n }\n ).outlinedButtonProps}\n onClick={(event) => {\n if (onClick) {\n onClick(event);\n }\n handleClick();\n }}\n leadingVisual={currentIcon}\n className={restProps.className}\n htmlAttributes={htmlAttributes}\n >\n {children}\n </OutlinedButton>\n </Tooltip.Trigger>\n <Tooltip.Content>\n {content}\n {descriptionKbdProps && <Kbd {...descriptionKbdProps} />}\n </Tooltip.Content>\n </Tooltip>\n );\n }\n};\n\n/**\n * @remarks\n * For more information of the `TooltipProps` type, see the Tooltip component documentation.\n */\ninterface ClipboardButtonProps {\n /** The text that should be set to users clipboard */\n textToCopy: string;\n descriptionKbdProps?: React.ComponentProps<typeof Kbd>;\n tooltipProps?: Omit<React.ComponentProps<typeof Tooltip>, 'children'>;\n isDisabled?: boolean;\n size?: ButtonSizes;\n htmlAttributes?: React.ComponentPropsWithoutRef<'button'>;\n type?: 'outlined-button' | 'clean-icon-button' | 'icon-button';\n}\n\nexport const ClipboardButton = ({\n textToCopy,\n descriptionKbdProps,\n isDisabled,\n size,\n tooltipProps,\n htmlAttributes,\n type,\n}: ClipboardButtonProps) => {\n const [, copyFunction] = useCopyToClipboard();\n\n const isOutlinedButton = type === 'outlined-button';\n const isIconButton = type === 'icon-button';\n\n const props = isOutlinedButton\n ? {\n outlinedButtonProps: {\n isDisabled,\n size,\n },\n type: 'outlined-button' as const,\n }\n : isIconButton\n ? {\n iconButtonProps: {\n description: 'Copy to clipboard',\n isDisabled,\n size,\n },\n type: 'icon-button' as const,\n }\n : {\n cleanIconButtonProps: {\n description: 'Copy to clipboard',\n isDisabled,\n size,\n },\n type: 'clean-icon-button' as const,\n };\n\n return (\n <ConfirmationButton\n onClick={() => copyFunction(textToCopy)}\n description=\"Copy to clipboard\"\n actionFeedbackText=\"Copied\"\n descriptionKbdProps={descriptionKbdProps}\n {...props}\n tooltipProps={tooltipProps}\n icon={<CopyOutlineIcon className=\"ndl-icon-svg\" />}\n htmlAttributes={{\n 'aria-live': 'polite',\n ...htmlAttributes,\n }}\n >\n {type === 'outlined-button' && 'Copy'}\n </ConfirmationButton>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmEE;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;;AATF,MAAM,sBAAsB,SAWG;CAXH,IA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uB,iBAAA,GAAA,kBAAA,IAAA,CAACE,gBAAAA,KAAAA,sBAAAA,QAAAA,CAAAA,GAAQ,mBAAsB,CAAA,CACxC,EAAA,CAAA,CACV;;AAGf;AAiBA,MAAa,mBAAmB,EAC9B,YACA,qBACA,YACA,MACA,cACA,gBACA,WAC0B;CAC1B,MAAM,GAAG,iBAAA,GAAgBC,YAAAA,mBAAAA,CAAmB;CA+B5C,OACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,oBAAA,sBAAA,QAAA,sBAAA,QAAA;EACC,eAAe,aAAa,UAAU;EACtC,aAAY;EACZ,oBAAmB;EACE;CAlCA,GAAA,SAAS,oBAI9B;EACE,qBAAqB;GACnB;GACA;EACF;EACA,MAAM;CACR,IATiB,SAAS,gBAWxB;EACE,iBAAiB;GACf,aAAa;GACb;GACA;EACF;EACA,MAAM;CACR,IACA;EACE,sBAAsB;GACpB,aAAa;GACb;GACA;EACF;EACA,MAAM;CACR,CAAA,GAAA,CAAA,GAAA;EASY;EACd,MAAM,iBAAA,GAAA,kBAAA,IAAA,CAACC,2CAAAA,SAAD,EAAiB,WAAU,eAAgB,CAAA;EACjD,gBAAA,sBAAA,QAAA,EACE,aAAa,SAAA,GACV,cACL;EAEC,UAAA,SAAS,qBAAqB;CACb,CAAA,CAAA;AAExB"}
|
package/lib/cjs/icons/index.js
CHANGED
|
@@ -44,7 +44,8 @@ const require_icons_generated_custom_Neo4JIconWhite = require("./generated/custo
|
|
|
44
44
|
const require_icons_generated_custom_Neo4JLogoBlack = require("./generated/custom/Neo4JLogoBlack.js");
|
|
45
45
|
const require_icons_generated_custom_Neo4JLogoColor = require("./generated/custom/Neo4JLogoColor.js");
|
|
46
46
|
const require_icons_generated_custom_Neo4JLogoWhite = require("./generated/custom/Neo4JLogoWhite.js");
|
|
47
|
-
const
|
|
47
|
+
const require_icons_generated_custom_CheckOutline = require("./generated/custom/CheckOutline.js");
|
|
48
|
+
const require_icons_generated_custom_CopyOutline = require("./generated/custom/CopyOutline.js");
|
|
48
49
|
const require_icons_generated_heroIcons_PencilIconOutline = require("./generated/heroIcons/PencilIconOutline.js");
|
|
49
50
|
const require_icons_generated_custom_Drag = require("./generated/custom/Drag.js");
|
|
50
51
|
const require_icons_generated_heroIcons_EyeDropperIconOutline = require("./generated/heroIcons/EyeDropperIconOutline.js");
|
|
@@ -315,6 +316,7 @@ const require_icons_generated_heroIcons_SlashIconOutline = require("./generated/
|
|
|
315
316
|
const require_icons_generated_heroIcons_SparklesIconOutline = require("./generated/heroIcons/SparklesIconOutline.js");
|
|
316
317
|
const require_icons_generated_heroIcons_SpeakerWaveIconOutline = require("./generated/heroIcons/SpeakerWaveIconOutline.js");
|
|
317
318
|
const require_icons_generated_heroIcons_SpeakerXMarkIconOutline = require("./generated/heroIcons/SpeakerXMarkIconOutline.js");
|
|
319
|
+
const require_icons_generated_heroIcons_Square2StackIconOutline = require("./generated/heroIcons/Square2StackIconOutline.js");
|
|
318
320
|
const require_icons_generated_heroIcons_Square3Stack3DIconOutline = require("./generated/heroIcons/Square3Stack3DIconOutline.js");
|
|
319
321
|
const require_icons_generated_heroIcons_Squares2X2IconOutline = require("./generated/heroIcons/Squares2X2IconOutline.js");
|
|
320
322
|
const require_icons_generated_heroIcons_SquaresPlusIconOutline = require("./generated/heroIcons/SquaresPlusIconOutline.js");
|
|
@@ -787,7 +789,6 @@ const require_icons_generated_custom_ChatBubbleOvalLeftOutline = require("./gene
|
|
|
787
789
|
const require_icons_generated_custom_CheckBadgeOutline = require("./generated/custom/CheckBadgeOutline.js");
|
|
788
790
|
const require_icons_generated_custom_CheckCircleOutline = require("./generated/custom/CheckCircleOutline.js");
|
|
789
791
|
const require_icons_generated_custom_CheckCircleSolid = require("./generated/custom/CheckCircleSolid.js");
|
|
790
|
-
const require_icons_generated_custom_CheckOutline = require("./generated/custom/CheckOutline.js");
|
|
791
792
|
const require_icons_generated_custom_ChevronDoubleDownOutline = require("./generated/custom/ChevronDoubleDownOutline.js");
|
|
792
793
|
const require_icons_generated_custom_ChevronDoubleLeftOutline = require("./generated/custom/ChevronDoubleLeftOutline.js");
|
|
793
794
|
const require_icons_generated_custom_ChevronDoubleRightOutline = require("./generated/custom/ChevronDoubleRightOutline.js");
|
|
@@ -832,7 +833,6 @@ const require_icons_generated_custom_ComputerDesktopOutline = require("./generat
|
|
|
832
833
|
const require_icons_generated_custom_ConfigureOutline = require("./generated/custom/ConfigureOutline.js");
|
|
833
834
|
const require_icons_generated_custom_Configure = require("./generated/custom/Configure.js");
|
|
834
835
|
const require_icons_generated_custom_ConnectedNodesOutline = require("./generated/custom/ConnectedNodesOutline.js");
|
|
835
|
-
const require_icons_generated_custom_CopyOutline = require("./generated/custom/CopyOutline.js");
|
|
836
836
|
const require_icons_generated_custom_CpuChipOutline = require("./generated/custom/CpuChipOutline.js");
|
|
837
837
|
const require_icons_generated_custom_CreditCardOutline = require("./generated/custom/CreditCardOutline.js");
|
|
838
838
|
const require_icons_generated_custom_CubeOutline = require("./generated/custom/CubeOutline.js");
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { CleanIconButton } from "../clean-icon-button/CleanIconButton.mjs";
|
|
2
2
|
import { useCopyToClipboard } from "../hooks/index.mjs";
|
|
3
3
|
import { IconButton } from "../icon-button/IconButton.mjs";
|
|
4
|
-
import
|
|
4
|
+
import SvgCheckOutline from "../icons/generated/custom/CheckOutline.mjs";
|
|
5
|
+
import SvgCopyOutline from "../icons/generated/custom/CopyOutline.mjs";
|
|
5
6
|
import { Kbd } from "../kbd/Kbd.mjs";
|
|
6
7
|
import { OutlinedButton } from "../outlined-button/OutlinedButton.mjs";
|
|
7
8
|
import { Tooltip } from "../tooltip/Tooltip.mjs";
|
|
@@ -59,6 +60,7 @@ const ConfirmationButton = (_ref) => {
|
|
|
59
60
|
setIsOpen(true);
|
|
60
61
|
};
|
|
61
62
|
const content = timeoutId === null ? description : actionFeedbackText;
|
|
63
|
+
const currentIcon = timeoutId === null ? icon : /* @__PURE__ */ jsx(SvgCheckOutline, { className: "ndl-icon-svg" });
|
|
62
64
|
if (type === "clean-icon-button") return /* @__PURE__ */ jsx(CleanIconButton, _objectSpread2(_objectSpread2({}, restProps.cleanIconButtonProps), {}, {
|
|
63
65
|
description: content,
|
|
64
66
|
descriptionKbdProps,
|
|
@@ -77,7 +79,7 @@ const ConfirmationButton = (_ref) => {
|
|
|
77
79
|
},
|
|
78
80
|
className: restProps.className,
|
|
79
81
|
htmlAttributes,
|
|
80
|
-
children:
|
|
82
|
+
children: currentIcon
|
|
81
83
|
}));
|
|
82
84
|
else if (type === "icon-button") return /* @__PURE__ */ jsx(IconButton, _objectSpread2(_objectSpread2({}, restProps.iconButtonProps), {}, {
|
|
83
85
|
description: content,
|
|
@@ -96,7 +98,7 @@ const ConfirmationButton = (_ref) => {
|
|
|
96
98
|
},
|
|
97
99
|
className: restProps.className,
|
|
98
100
|
htmlAttributes,
|
|
99
|
-
children:
|
|
101
|
+
children: currentIcon
|
|
100
102
|
}));
|
|
101
103
|
else if (type === "outlined-button") return /* @__PURE__ */ jsxs(Tooltip, _objectSpread2(_objectSpread2({
|
|
102
104
|
type: "simple",
|
|
@@ -122,7 +124,7 @@ const ConfirmationButton = (_ref) => {
|
|
|
122
124
|
if (onClick) onClick(event);
|
|
123
125
|
handleClick();
|
|
124
126
|
},
|
|
125
|
-
leadingVisual:
|
|
127
|
+
leadingVisual: currentIcon,
|
|
126
128
|
className: restProps.className,
|
|
127
129
|
htmlAttributes,
|
|
128
130
|
children
|
|
@@ -159,7 +161,7 @@ const ClipboardButton = ({ textToCopy, descriptionKbdProps, isDisabled, size, to
|
|
|
159
161
|
type: "clean-icon-button"
|
|
160
162
|
}), {}, {
|
|
161
163
|
tooltipProps,
|
|
162
|
-
icon: /* @__PURE__ */ jsx(
|
|
164
|
+
icon: /* @__PURE__ */ jsx(SvgCopyOutline, { className: "ndl-icon-svg" }),
|
|
163
165
|
htmlAttributes: _objectSpread2({ "aria-live": "polite" }, htmlAttributes),
|
|
164
166
|
children: type === "outlined-button" && "Copy"
|
|
165
167
|
}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ClipboardButton.mjs","names":[],"sources":["../../../src/clipboard-button/ClipboardButton.tsx"],"sourcesContent":["/*!\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\nimport React from 'react';\n\nimport { type ButtonSizes } from '../button';\nimport { CleanIconButton } from '../clean-icon-button';\nimport { useCopyToClipboard } from '../hooks';\nimport { IconButton } from '../icon-button';\nimport { Square2StackIconOutline } from '../icons/generated/heroIcons/Square2StackIconOutline';\nimport { Kbd } from '../kbd';\nimport { OutlinedButton } from '../outlined-button';\nimport { Tooltip } from '../tooltip';\n\ntype ConfirmationButtonProps = {\n description: string;\n descriptionKbdProps?: React.ComponentProps<typeof Kbd>;\n actionFeedbackText: string;\n tooltipProps?: Omit<React.ComponentProps<typeof Tooltip>, 'children'>;\n onClick?: React.ComponentPropsWithoutRef<'button'>['onClick'];\n children: React.ReactNode;\n className?: string;\n icon: React.ReactNode;\n htmlAttributes?: React.ComponentPropsWithoutRef<'button'>;\n} & (\n | {\n type: 'clean-icon-button';\n cleanIconButtonProps?: Omit<\n React.ComponentProps<typeof CleanIconButton>,\n 'children' | 'onClick' | 'tooltip'\n >;\n }\n | {\n type: 'icon-button';\n iconButtonProps?: Omit<\n React.ComponentProps<typeof IconButton>,\n 'children' | 'onClick' | 'tooltip'\n >;\n }\n | {\n type: 'outlined-button';\n outlinedButtonProps?: Omit<\n React.ComponentProps<typeof OutlinedButton>,\n 'children' | 'onClick' | 'tooltip'\n >;\n }\n);\n\nconst ConfirmationButton = ({\n descriptionKbdProps,\n description,\n actionFeedbackText,\n icon,\n children,\n onClick,\n htmlAttributes,\n tooltipProps,\n type = 'clean-icon-button',\n ...restProps\n}: ConfirmationButtonProps) => {\n const [timeoutId, setTimeoutId] = React.useState<number | null>(null);\n const [isOpen, setIsOpen] = React.useState(false);\n\n const handleClick = () => {\n if (timeoutId !== null) {\n clearTimeout(timeoutId);\n }\n\n const newTimeoutId = window.setTimeout(() => {\n setTimeoutId(null);\n }, 2000);\n\n setTimeoutId(newTimeoutId);\n };\n\n const handleCloseTooltip = () => {\n setIsOpen(false);\n };\n\n const handleOpenTooltip = () => {\n setIsOpen(true);\n };\n\n const content = timeoutId === null ? description : actionFeedbackText;\n /* Controlling the tip to make it disappear in a timely manner */\n\n if (type === 'clean-icon-button') {\n return (\n <CleanIconButton\n {...(\n restProps as {\n cleanIconButtonProps: React.ComponentProps<typeof CleanIconButton>;\n }\n ).cleanIconButtonProps}\n description={content}\n descriptionKbdProps={descriptionKbdProps}\n tooltipProps={{\n root: {\n ...tooltipProps,\n isOpen: isOpen || timeoutId !== null,\n },\n trigger: {\n htmlAttributes: {\n onBlur: handleCloseTooltip,\n onFocus: handleOpenTooltip,\n onMouseEnter: handleOpenTooltip,\n onMouseLeave: handleCloseTooltip,\n },\n },\n }}\n onClick={(event) => {\n if (onClick) {\n onClick(event);\n }\n handleClick();\n }}\n className={restProps.className}\n htmlAttributes={htmlAttributes}\n >\n {icon}\n </CleanIconButton>\n );\n } else if (type === 'icon-button') {\n return (\n <IconButton\n {...(\n restProps as {\n iconButtonProps: React.ComponentProps<typeof IconButton>;\n }\n ).iconButtonProps}\n description={content}\n tooltipProps={{\n root: {\n ...tooltipProps,\n isOpen: isOpen || timeoutId !== null,\n },\n trigger: {\n htmlAttributes: {\n onBlur: handleCloseTooltip,\n onFocus: handleOpenTooltip,\n onMouseEnter: handleOpenTooltip,\n onMouseLeave: handleCloseTooltip,\n },\n },\n }}\n onClick={(event) => {\n if (onClick) {\n onClick(event);\n }\n handleClick();\n }}\n className={restProps.className}\n htmlAttributes={htmlAttributes}\n >\n {icon}\n </IconButton>\n );\n } else if (type === 'outlined-button') {\n return (\n <Tooltip\n type=\"simple\"\n isOpen={isOpen || timeoutId !== null}\n {...tooltipProps}\n onOpenChange={(open) => {\n if (open) {\n handleOpenTooltip();\n } else {\n handleCloseTooltip();\n }\n tooltipProps?.onOpenChange?.(open);\n }}\n >\n <Tooltip.Trigger\n hasButtonWrapper\n htmlAttributes={{\n 'aria-label': content,\n onBlur: handleCloseTooltip,\n onFocus: handleOpenTooltip,\n onMouseEnter: handleOpenTooltip,\n onMouseLeave: handleCloseTooltip,\n }}\n >\n <OutlinedButton\n variant=\"neutral\"\n {...(\n restProps as {\n outlinedButtonProps: React.ComponentProps<\n typeof OutlinedButton\n >;\n }\n ).outlinedButtonProps}\n onClick={(event) => {\n if (onClick) {\n onClick(event);\n }\n handleClick();\n }}\n leadingVisual={icon}\n className={restProps.className}\n htmlAttributes={htmlAttributes}\n >\n {children}\n </OutlinedButton>\n </Tooltip.Trigger>\n <Tooltip.Content>\n {content}\n {descriptionKbdProps && <Kbd {...descriptionKbdProps} />}\n </Tooltip.Content>\n </Tooltip>\n );\n }\n};\n\n/**\n * @remarks\n * For more information of the `TooltipProps` type, see the Tooltip component documentation.\n */\ninterface ClipboardButtonProps {\n /** The text that should be set to users clipboard */\n textToCopy: string;\n descriptionKbdProps?: React.ComponentProps<typeof Kbd>;\n tooltipProps?: Omit<React.ComponentProps<typeof Tooltip>, 'children'>;\n isDisabled?: boolean;\n size?: ButtonSizes;\n htmlAttributes?: React.ComponentPropsWithoutRef<'button'>;\n type?: 'outlined-button' | 'clean-icon-button' | 'icon-button';\n}\n\nexport const ClipboardButton = ({\n textToCopy,\n descriptionKbdProps,\n isDisabled,\n size,\n tooltipProps,\n htmlAttributes,\n type,\n}: ClipboardButtonProps) => {\n const [, copyFunction] = useCopyToClipboard();\n\n const isOutlinedButton = type === 'outlined-button';\n const isIconButton = type === 'icon-button';\n\n const props = isOutlinedButton\n ? {\n outlinedButtonProps: {\n isDisabled,\n size,\n },\n type: 'outlined-button' as const,\n }\n : isIconButton\n ? {\n iconButtonProps: {\n description: 'Copy to clipboard',\n isDisabled,\n size,\n },\n type: 'icon-button' as const,\n }\n : {\n cleanIconButtonProps: {\n description: 'Copy to clipboard',\n isDisabled,\n size,\n },\n type: 'clean-icon-button' as const,\n };\n\n return (\n <ConfirmationButton\n onClick={() => copyFunction(textToCopy)}\n description=\"Copy to clipboard\"\n actionFeedbackText=\"Copied\"\n descriptionKbdProps={descriptionKbdProps}\n {...props}\n tooltipProps={tooltipProps}\n icon={<Square2StackIconOutline className=\"ndl-icon-svg\" />}\n htmlAttributes={{\n 'aria-live': 'polite',\n ...htmlAttributes,\n }}\n >\n {type === 'outlined-button' && 'Copy'}\n </ConfirmationButton>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkEE;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;;AATF,MAAM,sBAAsB,SAWG;CAXH,IAAA,EAC1B,qBACA,aACA,oBACA,MACA,UACA,SACA,gBACA,cACA,OAAO,wBAAA,MACJ,YAAA,yBAAA,MAAA,SAAA;CAEH,MAAM,CAAC,WAAW,gBAAgB,MAAM,SAAwB,IAAI;CACpE,MAAM,CAAC,QAAQ,aAAa,MAAM,SAAS,KAAK;CAEhD,MAAM,oBAAoB;EACxB,IAAI,cAAc,MAChB,aAAa,SAAS;EAGxB,MAAM,eAAe,OAAO,iBAAiB;GAC3C,aAAa,IAAI;EACnB,GAAG,GAAI;EAEP,aAAa,YAAY;CAC3B;CAEA,MAAM,2BAA2B;EAC/B,UAAU,KAAK;CACjB;CAEA,MAAM,0BAA0B;EAC9B,UAAU,IAAI;CAChB;CAEA,MAAM,UAAU,cAAc,OAAO,cAAc;C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ACT,cAAc;IACd,cAAc;GAChB;GAEA,UAAA,oBAAC,gBAAA,eAAA,eAAA,EACC,SAAQ,UAAA,GAEN,UAKA,mBAAA,GAAA,CAAA,GAAA;IACF,UAAU,UAAU;KAClB,IAAI,SACF,QAAQ,KAAK;KAEf,YAAY;IACd;IACA,eAAe;IACf,WAAW,UAAU;IACL;IAEf;GACa,CAAA,CAAA;EACD,CAAA,GACjB,qBAAC,QAAQ,SAAT,EAAA,UAAA,CACG,SACA,uBAAuB,oBAAC,KAAA,eAAA,CAAA,GAAQ,mBAAsB,CAAA,CACxC,EAAA,CAAA,CACV;;AAGf;AAiBA,MAAa,mBAAmB,EAC9B,YACA,qBACA,YACA,MACA,cACA,gBACA,WAC0B;CAC1B,MAAM,GAAG,gBAAgB,mBAAmB;CA+B5C,OACE,oBAAC,oBAAA,eAAA,eAAA;EACC,eAAe,aAAa,UAAU;EACtC,aAAY;EACZ,oBAAmB;EACE;CAlCA,GAAA,SAAS,oBAI9B;EACE,qBAAqB;GACnB;GACA;EACF;EACA,MAAM;CACR,IATiB,SAAS,gBAWxB;EACE,iBAAiB;GACf,aAAa;GACb;GACA;EACF;EACA,MAAM;CACR,IACA;EACE,sBAAsB;GACpB,aAAa;GACb;GACA;EACF;EACA,MAAM;CACR,CAAA,GAAA,CAAA,GAAA;EASY;EACd,MAAM,oBAAC,yBAAD,EAAyB,WAAU,eAAgB,CAAA;EACzD,gBAAA,eAAA,EACE,aAAa,SAAA,GACV,cACL;EAEC,UAAA,SAAS,qBAAqB;CACb,CAAA,CAAA;AAExB"}
|
|
1
|
+
{"version":3,"file":"ClipboardButton.mjs","names":["CheckOutlineIcon","CopyOutlineIcon"],"sources":["../../../src/clipboard-button/ClipboardButton.tsx"],"sourcesContent":["/*!\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\nimport React from 'react';\n\nimport { type ButtonSizes } from '../button';\nimport { CleanIconButton } from '../clean-icon-button';\nimport { useCopyToClipboard } from '../hooks';\nimport { IconButton } from '../icon-button';\nimport CheckOutlineIcon from '../icons/generated/custom/CheckOutline';\nimport CopyOutlineIcon from '../icons/generated/custom/CopyOutline';\nimport { Kbd } from '../kbd';\nimport { OutlinedButton } from '../outlined-button';\nimport { Tooltip } from '../tooltip';\n\ntype ConfirmationButtonProps = {\n description: string;\n descriptionKbdProps?: React.ComponentProps<typeof Kbd>;\n actionFeedbackText: string;\n tooltipProps?: Omit<React.ComponentProps<typeof Tooltip>, 'children'>;\n onClick?: React.ComponentPropsWithoutRef<'button'>['onClick'];\n children: React.ReactNode;\n className?: string;\n icon: React.ReactNode;\n htmlAttributes?: React.ComponentPropsWithoutRef<'button'>;\n} & (\n | {\n type: 'clean-icon-button';\n cleanIconButtonProps?: Omit<\n React.ComponentProps<typeof CleanIconButton>,\n 'children' | 'onClick' | 'tooltip'\n >;\n }\n | {\n type: 'icon-button';\n iconButtonProps?: Omit<\n React.ComponentProps<typeof IconButton>,\n 'children' | 'onClick' | 'tooltip'\n >;\n }\n | {\n type: 'outlined-button';\n outlinedButtonProps?: Omit<\n React.ComponentProps<typeof OutlinedButton>,\n 'children' | 'onClick' | 'tooltip'\n >;\n }\n);\n\nconst ConfirmationButton = ({\n descriptionKbdProps,\n description,\n actionFeedbackText,\n icon,\n children,\n onClick,\n htmlAttributes,\n tooltipProps,\n type = 'clean-icon-button',\n ...restProps\n}: ConfirmationButtonProps) => {\n const [timeoutId, setTimeoutId] = React.useState<number | null>(null);\n const [isOpen, setIsOpen] = React.useState(false);\n\n const handleClick = () => {\n if (timeoutId !== null) {\n clearTimeout(timeoutId);\n }\n\n const newTimeoutId = window.setTimeout(() => {\n setTimeoutId(null);\n }, 2000);\n\n setTimeoutId(newTimeoutId);\n };\n\n const handleCloseTooltip = () => {\n setIsOpen(false);\n };\n\n const handleOpenTooltip = () => {\n setIsOpen(true);\n };\n\n const content = timeoutId === null ? description : actionFeedbackText;\n const currentIcon =\n timeoutId === null ? icon : <CheckOutlineIcon className=\"ndl-icon-svg\" />;\n /* Controlling the tip to make it disappear in a timely manner */\n\n if (type === 'clean-icon-button') {\n return (\n <CleanIconButton\n {...(\n restProps as {\n cleanIconButtonProps: React.ComponentProps<typeof CleanIconButton>;\n }\n ).cleanIconButtonProps}\n description={content}\n descriptionKbdProps={descriptionKbdProps}\n tooltipProps={{\n root: {\n ...tooltipProps,\n isOpen: isOpen || timeoutId !== null,\n },\n trigger: {\n htmlAttributes: {\n onBlur: handleCloseTooltip,\n onFocus: handleOpenTooltip,\n onMouseEnter: handleOpenTooltip,\n onMouseLeave: handleCloseTooltip,\n },\n },\n }}\n onClick={(event) => {\n if (onClick) {\n onClick(event);\n }\n handleClick();\n }}\n className={restProps.className}\n htmlAttributes={htmlAttributes}\n >\n {currentIcon}\n </CleanIconButton>\n );\n } else if (type === 'icon-button') {\n return (\n <IconButton\n {...(\n restProps as {\n iconButtonProps: React.ComponentProps<typeof IconButton>;\n }\n ).iconButtonProps}\n description={content}\n tooltipProps={{\n root: {\n ...tooltipProps,\n isOpen: isOpen || timeoutId !== null,\n },\n trigger: {\n htmlAttributes: {\n onBlur: handleCloseTooltip,\n onFocus: handleOpenTooltip,\n onMouseEnter: handleOpenTooltip,\n onMouseLeave: handleCloseTooltip,\n },\n },\n }}\n onClick={(event) => {\n if (onClick) {\n onClick(event);\n }\n handleClick();\n }}\n className={restProps.className}\n htmlAttributes={htmlAttributes}\n >\n {currentIcon}\n </IconButton>\n );\n } else if (type === 'outlined-button') {\n return (\n <Tooltip\n type=\"simple\"\n isOpen={isOpen || timeoutId !== null}\n {...tooltipProps}\n onOpenChange={(open) => {\n if (open) {\n handleOpenTooltip();\n } else {\n handleCloseTooltip();\n }\n tooltipProps?.onOpenChange?.(open);\n }}\n >\n <Tooltip.Trigger\n hasButtonWrapper\n htmlAttributes={{\n 'aria-label': content,\n onBlur: handleCloseTooltip,\n onFocus: handleOpenTooltip,\n onMouseEnter: handleOpenTooltip,\n onMouseLeave: handleCloseTooltip,\n }}\n >\n <OutlinedButton\n variant=\"neutral\"\n {...(\n restProps as {\n outlinedButtonProps: React.ComponentProps<\n typeof OutlinedButton\n >;\n }\n ).outlinedButtonProps}\n onClick={(event) => {\n if (onClick) {\n onClick(event);\n }\n handleClick();\n }}\n leadingVisual={currentIcon}\n className={restProps.className}\n htmlAttributes={htmlAttributes}\n >\n {children}\n </OutlinedButton>\n </Tooltip.Trigger>\n <Tooltip.Content>\n {content}\n {descriptionKbdProps && <Kbd {...descriptionKbdProps} />}\n </Tooltip.Content>\n </Tooltip>\n );\n }\n};\n\n/**\n * @remarks\n * For more information of the `TooltipProps` type, see the Tooltip component documentation.\n */\ninterface ClipboardButtonProps {\n /** The text that should be set to users clipboard */\n textToCopy: string;\n descriptionKbdProps?: React.ComponentProps<typeof Kbd>;\n tooltipProps?: Omit<React.ComponentProps<typeof Tooltip>, 'children'>;\n isDisabled?: boolean;\n size?: ButtonSizes;\n htmlAttributes?: React.ComponentPropsWithoutRef<'button'>;\n type?: 'outlined-button' | 'clean-icon-button' | 'icon-button';\n}\n\nexport const ClipboardButton = ({\n textToCopy,\n descriptionKbdProps,\n isDisabled,\n size,\n tooltipProps,\n htmlAttributes,\n type,\n}: ClipboardButtonProps) => {\n const [, copyFunction] = useCopyToClipboard();\n\n const isOutlinedButton = type === 'outlined-button';\n const isIconButton = type === 'icon-button';\n\n const props = isOutlinedButton\n ? {\n outlinedButtonProps: {\n isDisabled,\n size,\n },\n type: 'outlined-button' as const,\n }\n : isIconButton\n ? {\n iconButtonProps: {\n description: 'Copy to clipboard',\n isDisabled,\n size,\n },\n type: 'icon-button' as const,\n }\n : {\n cleanIconButtonProps: {\n description: 'Copy to clipboard',\n isDisabled,\n size,\n },\n type: 'clean-icon-button' as const,\n };\n\n return (\n <ConfirmationButton\n onClick={() => copyFunction(textToCopy)}\n description=\"Copy to clipboard\"\n actionFeedbackText=\"Copied\"\n descriptionKbdProps={descriptionKbdProps}\n {...props}\n tooltipProps={tooltipProps}\n icon={<CopyOutlineIcon className=\"ndl-icon-svg\" />}\n htmlAttributes={{\n 'aria-live': 'polite',\n ...htmlAttributes,\n }}\n >\n {type === 'outlined-button' && 'Copy'}\n </ConfirmationButton>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmEE;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;;AATF,MAAM,sBAAsB,SAWG;CAXH,IAAA,EAC1B,qBACA,aACA,oBACA,MACA,UACA,SACA,gBACA,cACA,OAAO,wBAAA,MACJ,YAAA,yBAAA,MAAA,SAAA;CAEH,MAAM,CAAC,WAAW,gBAAgB,MAAM,SAAwB,IAAI;CACpE,MAAM,CAAC,QAAQ,aAAa,MAAM,SAAS,KAAK;CAEhD,MAAM,oBAAoB;EACxB,IAAI,cAAc,MAChB,aAAa,SAAS;EAGxB,MAAM,eAAe,OAAO,iBAAiB;GAC3C,aAAa,IAAI;EACnB,GAAG,GAAI;EAEP,aAAa,YAAY;CAC3B;CAEA,MAAM,2BAA2B;EAC/B,UAAU,KAAK;CACjB;CAEA,MAAM,0BAA0B;EAC9B,UAAU,IAAI;CAChB;CAEA,MAAM,UAAU,cAAc,OAAO,cAAc;CACnD,MAAM,cACJ,cAAc,OAAO,OAAO,oBAACA,iBAAD,EAAkB,WAAU,eAAgB,CAAA;CAG1E,IAAI,SAAS,qBACX,OACE,oBAAC,iBAAA,eAAA,eAAA,CAAA,GAEG,UAGA,oBAAA,GAAA,CAAA,GAAA;EACF,aAAa;EACQ;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AAA;IACF,UAAU,UAAU;KAClB,IAAI,SACF,QAAQ,KAAK;KAEf,YAAY;IACd;IACA,eAAe;IACf,WAAW,UAAU;IACL;IAEf;GACa,CAAA,CAAA;EACD,CAAA,GACjB,qBAAC,QAAQ,SAAT,EAAA,UAAA,CACG,SACA,uBAAuB,oBAAC,KAAA,eAAA,CAAA,GAAQ,mBAAsB,CAAA,CACxC,EAAA,CAAA,CACV;;AAGf;AAiBA,MAAa,mBAAmB,EAC9B,YACA,qBACA,YACA,MACA,cACA,gBACA,WAC0B;CAC1B,MAAM,GAAG,gBAAgB,mBAAmB;CA+B5C,OACE,oBAAC,oBAAA,eAAA,eAAA;EACC,eAAe,aAAa,UAAU;EACtC,aAAY;EACZ,oBAAmB;EACE;CAlCA,GAAA,SAAS,oBAI9B;EACE,qBAAqB;GACnB;GACA;EACF;EACA,MAAM;CACR,IATiB,SAAS,gBAWxB;EACE,iBAAiB;GACf,aAAa;GACb;GACA;EACF;EACA,MAAM;CACR,IACA;EACE,sBAAsB;GACpB,aAAa;GACb;GACA;EACF;EACA,MAAM;CACR,CAAA,GAAA,CAAA,GAAA;EASY;EACd,MAAM,oBAACC,gBAAD,EAAiB,WAAU,eAAgB,CAAA;EACjD,gBAAA,eAAA,EACE,aAAa,SAAA,GACV,cACL;EAEC,UAAA,SAAS,qBAAqB;CACb,CAAA,CAAA;AAExB"}
|
package/lib/esm/icons/index.mjs
CHANGED
|
@@ -39,7 +39,8 @@ import SvgNeo4JIconWhite from "./generated/custom/Neo4JIconWhite.mjs";
|
|
|
39
39
|
import SvgNeo4JLogoBlack from "./generated/custom/Neo4JLogoBlack.mjs";
|
|
40
40
|
import SvgNeo4JLogoColor from "./generated/custom/Neo4JLogoColor.mjs";
|
|
41
41
|
import SvgNeo4JLogoWhite from "./generated/custom/Neo4JLogoWhite.mjs";
|
|
42
|
-
import
|
|
42
|
+
import SvgCheckOutline from "./generated/custom/CheckOutline.mjs";
|
|
43
|
+
import SvgCopyOutline from "./generated/custom/CopyOutline.mjs";
|
|
43
44
|
import { PencilIconOutline } from "./generated/heroIcons/PencilIconOutline.mjs";
|
|
44
45
|
import SvgDrag from "./generated/custom/Drag.mjs";
|
|
45
46
|
import { EyeDropperIconOutline } from "./generated/heroIcons/EyeDropperIconOutline.mjs";
|
|
@@ -310,6 +311,7 @@ import { SlashIconOutline } from "./generated/heroIcons/SlashIconOutline.mjs";
|
|
|
310
311
|
import { SparklesIconOutline } from "./generated/heroIcons/SparklesIconOutline.mjs";
|
|
311
312
|
import { SpeakerWaveIconOutline } from "./generated/heroIcons/SpeakerWaveIconOutline.mjs";
|
|
312
313
|
import { SpeakerXMarkIconOutline } from "./generated/heroIcons/SpeakerXMarkIconOutline.mjs";
|
|
314
|
+
import { Square2StackIconOutline } from "./generated/heroIcons/Square2StackIconOutline.mjs";
|
|
313
315
|
import { Square3Stack3DIconOutline } from "./generated/heroIcons/Square3Stack3DIconOutline.mjs";
|
|
314
316
|
import { Squares2X2IconOutline } from "./generated/heroIcons/Squares2X2IconOutline.mjs";
|
|
315
317
|
import { SquaresPlusIconOutline } from "./generated/heroIcons/SquaresPlusIconOutline.mjs";
|
|
@@ -782,7 +784,6 @@ import SvgChatBubbleOvalLeftOutline from "./generated/custom/ChatBubbleOvalLeftO
|
|
|
782
784
|
import SvgCheckBadgeOutline from "./generated/custom/CheckBadgeOutline.mjs";
|
|
783
785
|
import SvgCheckCircleOutline from "./generated/custom/CheckCircleOutline.mjs";
|
|
784
786
|
import SvgCheckCircleSolid from "./generated/custom/CheckCircleSolid.mjs";
|
|
785
|
-
import SvgCheckOutline from "./generated/custom/CheckOutline.mjs";
|
|
786
787
|
import SvgChevronDoubleDownOutline from "./generated/custom/ChevronDoubleDownOutline.mjs";
|
|
787
788
|
import SvgChevronDoubleLeftOutline from "./generated/custom/ChevronDoubleLeftOutline.mjs";
|
|
788
789
|
import SvgChevronDoubleRightOutline from "./generated/custom/ChevronDoubleRightOutline.mjs";
|
|
@@ -827,7 +828,6 @@ import SvgComputerDesktopOutline from "./generated/custom/ComputerDesktopOutline
|
|
|
827
828
|
import SvgConfigureOutline from "./generated/custom/ConfigureOutline.mjs";
|
|
828
829
|
import SvgConfigure from "./generated/custom/Configure.mjs";
|
|
829
830
|
import SvgConnectedNodesOutline from "./generated/custom/ConnectedNodesOutline.mjs";
|
|
830
|
-
import SvgCopyOutline from "./generated/custom/CopyOutline.mjs";
|
|
831
831
|
import SvgCpuChipOutline from "./generated/custom/CpuChipOutline.mjs";
|
|
832
832
|
import SvgCreditCardOutline from "./generated/custom/CreditCardOutline.mjs";
|
|
833
833
|
import SvgCubeOutline from "./generated/custom/CubeOutline.mjs";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ClipboardButton.d.ts","sourceRoot":"","sources":["../../../src/clipboard-button/ClipboardButton.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"ClipboardButton.d.ts","sourceRoot":"","sources":["../../../src/clipboard-button/ClipboardButton.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,WAAW,CAAC;AAM7C,OAAO,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAC;AAE7B,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AA2MrC;;;GAGG;AACH,UAAU,oBAAoB;IAC5B,qDAAqD;IACrD,UAAU,EAAE,MAAM,CAAC;IACnB,mBAAmB,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,GAAG,CAAC,CAAC;IACvD,YAAY,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,OAAO,OAAO,CAAC,EAAE,UAAU,CAAC,CAAC;IACtE,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB,cAAc,CAAC,EAAE,KAAK,CAAC,wBAAwB,CAAC,QAAQ,CAAC,CAAC;IAC1D,IAAI,CAAC,EAAE,iBAAiB,GAAG,mBAAmB,GAAG,aAAa,CAAC;CAChE;AAED,eAAO,MAAM,eAAe,GAAI,4FAQ7B,oBAAoB,4CAiDtB,CAAC"}
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
name: ndl-react
|
|
3
3
|
metadata:
|
|
4
4
|
package: '@neo4j-ndl/react'
|
|
5
|
-
version: '5.6.
|
|
5
|
+
version: '5.6.1'
|
|
6
6
|
description: >-
|
|
7
7
|
Build and edit UI with the Neo4j Needle React design system
|
|
8
8
|
(@neo4j-ndl/react). Use when adding, composing, or modifying Needle components
|
|
@@ -15,7 +15,7 @@ description: >-
|
|
|
15
15
|
|
|
16
16
|
# Neo4j Needle (@neo4j-ndl/react)
|
|
17
17
|
|
|
18
|
-
> 📌 Shipped with `@neo4j-ndl/react` v5.6.
|
|
18
|
+
> 📌 Shipped with `@neo4j-ndl/react` v5.6.1. Once installed into your repo (e.g. via
|
|
19
19
|
> `npx skills add`) this folder is detached from the package — the installed
|
|
20
20
|
> package (TypeScript types in `node_modules/@neo4j-ndl/react`) is the source of
|
|
21
21
|
> truth.
|