@keboola/design 6.0.0 → 6.1.0

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.
@@ -1072,13 +1072,14 @@ var init_Clipboard2 = __esm({
1072
1072
  init_Clipboard();
1073
1073
  }
1074
1074
  });
1075
- var DEFAULT_ICON, ClipboardButton;
1075
+ var DEFAULT_ICON, DEFAULT_ARIA_LABEL, ClipboardButton;
1076
1076
  var init_ClipboardButton = __esm({
1077
1077
  "src/blocks/ClipboardButton/ClipboardButton.tsx"() {
1078
1078
  init_Button2();
1079
1079
  init_Clipboard2();
1080
1080
  init_icons();
1081
1081
  DEFAULT_ICON = /* @__PURE__ */ jsxRuntime.jsx(icons_exports.Copy, {});
1082
+ DEFAULT_ARIA_LABEL = "Copy";
1082
1083
  ClipboardButton = ({
1083
1084
  // clipboard props
1084
1085
  text,
@@ -1090,20 +1091,24 @@ var init_ClipboardButton = __esm({
1090
1091
  variant = "outline",
1091
1092
  children,
1092
1093
  ...rest
1093
- }) => /* @__PURE__ */ jsxRuntime.jsx(
1094
- Clipboard,
1095
- {
1096
- asChild: true,
1097
- tooltip,
1098
- tooltipPlacement,
1099
- tooltipVariant,
1100
- text,
1101
- children: /* @__PURE__ */ jsxRuntime.jsxs(Button, { ...rest, variant, disabled: !text, children: [
1102
- icon,
1103
- children
1104
- ] })
1105
- }
1106
- );
1094
+ }) => {
1095
+ const defaultAriaLabel = typeof tooltip === "string" && tooltip.trim() ? tooltip : DEFAULT_ARIA_LABEL;
1096
+ const ariaLabel = rest["aria-label"] ?? (children == null ? defaultAriaLabel : void 0);
1097
+ return /* @__PURE__ */ jsxRuntime.jsx(
1098
+ Clipboard,
1099
+ {
1100
+ asChild: true,
1101
+ tooltip,
1102
+ tooltipPlacement,
1103
+ tooltipVariant,
1104
+ text,
1105
+ children: /* @__PURE__ */ jsxRuntime.jsxs(Button, { ...rest, "aria-label": ariaLabel, variant, disabled: !text, children: [
1106
+ icon,
1107
+ children
1108
+ ] })
1109
+ }
1110
+ );
1111
+ };
1107
1112
  }
1108
1113
  });
1109
1114