@keboola/design 6.0.0 → 6.2.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.
package/dist/rjsf.js CHANGED
@@ -793,6 +793,7 @@ var Clipboard = ({
793
793
  ] });
794
794
  };
795
795
  var DEFAULT_ICON = /* @__PURE__ */ jsx(icons_exports.Copy, {});
796
+ var DEFAULT_ARIA_LABEL = "Copy";
796
797
  var ClipboardButton = ({
797
798
  // clipboard props
798
799
  text,
@@ -804,20 +805,24 @@ var ClipboardButton = ({
804
805
  variant = "outline",
805
806
  children,
806
807
  ...rest
807
- }) => /* @__PURE__ */ jsx(
808
- Clipboard,
809
- {
810
- asChild: true,
811
- tooltip,
812
- tooltipPlacement,
813
- tooltipVariant,
814
- text,
815
- children: /* @__PURE__ */ jsxs(Button, { ...rest, variant, disabled: !text, children: [
816
- icon,
817
- children
818
- ] })
819
- }
820
- );
808
+ }) => {
809
+ const defaultAriaLabel = typeof tooltip === "string" && tooltip.trim() ? tooltip : DEFAULT_ARIA_LABEL;
810
+ const ariaLabel = rest["aria-label"] ?? (children == null ? defaultAriaLabel : void 0);
811
+ return /* @__PURE__ */ jsx(
812
+ Clipboard,
813
+ {
814
+ asChild: true,
815
+ tooltip,
816
+ tooltipPlacement,
817
+ tooltipVariant,
818
+ text,
819
+ children: /* @__PURE__ */ jsxs(Button, { ...rest, "aria-label": ariaLabel, variant, disabled: !text, children: [
820
+ icon,
821
+ children
822
+ ] })
823
+ }
824
+ );
825
+ };
821
826
  var ButtonToolbar = ({ value, children }) => {
822
827
  if (!value && !children) return null;
823
828
  return /* @__PURE__ */ jsxs("div", { className: "tw-pointer-events-auto tw-ml-auto tw-mr-4 tw-flex tw-w-fit tw-gap-1 tw-overflow-visible tw-rounded-lg tw-border tw-border-solid tw-border-border !tw-bg-background tw-p-[3px] tw-shadow", children: [
@@ -1260,9 +1265,7 @@ var headerVariants = cva(
1260
1265
  variants: {
1261
1266
  variant: {
1262
1267
  default: "tw-bg-muted",
1263
- // White surface kept literal until a `card` token exists (UT-4396);
1264
- // `background` is the page base, not an elevated panel surface.
1265
- white: "tw-bg-white"
1268
+ white: "tw-bg-card"
1266
1269
  },
1267
1270
  isDisabled: {
1268
1271
  true: "tw-cursor-not-allowed tw-opacity-50",
@@ -1327,7 +1330,7 @@ var CollapsiblePanel = ({
1327
1330
  {
1328
1331
  open,
1329
1332
  className: cn(
1330
- "tw-rounded !tw-border !tw-border-solid !tw-border-border tw-bg-white",
1333
+ "tw-rounded !tw-border !tw-border-solid !tw-border-border tw-bg-card",
1331
1334
  className
1332
1335
  ),
1333
1336
  header: /* @__PURE__ */ jsxs(
@@ -8320,23 +8323,23 @@ var BadgeLabel = ({
8320
8323
  var badgeColors = {
8321
8324
  gray: "tw-bg-neutral-400 tw-text-white tw-decoration-neutral-400",
8322
8325
  "gray-darker": "tw-bg-neutral-500 tw-text-white tw-decoration-neutral-500",
8323
- "gray-inverse": "tw-bg-neutral-100 tw-text-neutral-400 tw-decoration-neutral-100",
8326
+ "gray-inverse": "tw-bg-neutral-100 tw-text-neutral-400 tw-decoration-neutral-100 [[data-theme=dark]_&]:tw-bg-neutral-800 [[data-theme=dark]_&]:tw-text-neutral-300 [[data-theme=dark]_&]:tw-decoration-neutral-800",
8324
8327
  green: "tw-bg-green-500 tw-text-white tw-decoration-green-500",
8325
8328
  "green-darker": "tw-bg-green-600 tw-text-white tw-decoration-green-600",
8326
- "green-inverse": "tw-bg-green-100 tw-text-green-900 tw-decoration-green-100",
8329
+ "green-inverse": "tw-bg-green-100 tw-text-green-900 tw-decoration-green-100 [[data-theme=dark]_&]:tw-bg-green-900 [[data-theme=dark]_&]:tw-text-green-200 [[data-theme=dark]_&]:tw-decoration-green-900",
8327
8330
  blue: "tw-bg-blue-500 tw-text-white tw-decoration-blue-500",
8328
- "blue-inverse": "tw-bg-blue-100 tw-text-blue-600 tw-decoration-blue-100",
8331
+ "blue-inverse": "tw-bg-blue-100 tw-text-blue-600 tw-decoration-blue-100 [[data-theme=dark]_&]:tw-bg-blue-900 [[data-theme=dark]_&]:tw-text-blue-200 [[data-theme=dark]_&]:tw-decoration-blue-900",
8329
8332
  red: "tw-bg-error-500 tw-text-white tw-decoration-error-500",
8330
8333
  orange: "tw-bg-warning-500 tw-text-white tw-decoration-warning-500",
8331
- "orange-inverse": "tw-bg-warning-100 tw-text-warning-500 tw-decoration-warning-100",
8334
+ "orange-inverse": "tw-bg-warning-100 tw-text-warning-500 tw-decoration-warning-100 [[data-theme=dark]_&]:tw-bg-warning-900 [[data-theme=dark]_&]:tw-text-warning-200 [[data-theme=dark]_&]:tw-decoration-warning-900",
8332
8335
  amber: "tw-bg-warning-300 tw-text-warning-800 tw-decoration-warning-300",
8333
8336
  "amber-inverse": "tw-bg-warning-100 tw-text-warning-700 tw-decoration-warning-100",
8334
8337
  teal: "tw-bg-teal-500 tw-text-white tw-decoration-teal-500",
8335
- "teal-inverse": "tw-bg-teal-100 tw-text-teal-800 tw-decoration-teal-100",
8338
+ "teal-inverse": "tw-bg-teal-100 tw-text-teal-800 tw-decoration-teal-100 [[data-theme=dark]_&]:tw-bg-teal-900 [[data-theme=dark]_&]:tw-text-teal-200 [[data-theme=dark]_&]:tw-decoration-teal-900",
8336
8339
  purple: "tw-bg-purple-500 tw-text-white tw-decoration-purple-500",
8337
- "purple-inverse": "tw-bg-purple-100 tw-text-purple-800 tw-decoration-purple-100",
8340
+ "purple-inverse": "tw-bg-purple-100 tw-text-purple-800 tw-decoration-purple-100 [[data-theme=dark]_&]:tw-bg-purple-900 [[data-theme=dark]_&]:tw-text-purple-200 [[data-theme=dark]_&]:tw-decoration-purple-900",
8338
8341
  cyan: "tw-bg-cyan-500 tw-text-white tw-decoration-cyan-500",
8339
- "cyan-inverse": "tw-bg-cyan-100 tw-text-cyan-800 tw-decoration-cyan-100",
8342
+ "cyan-inverse": "tw-bg-cyan-100 tw-text-cyan-800 tw-decoration-cyan-100 [[data-theme=dark]_&]:tw-bg-cyan-900 [[data-theme=dark]_&]:tw-text-cyan-200 [[data-theme=dark]_&]:tw-decoration-cyan-900",
8340
8343
  "sidebar-primary": "tw-bg-sidebar-primary tw-text-white tw-decoration-sidebar-primary",
8341
8344
  white: "tw-bg-white/90 tw-text-neutral-600 tw-decoration-white/90"
8342
8345
  };
@@ -9045,14 +9048,18 @@ var DynamicSelectWidget = ({
9045
9048
  const data = useRootFormData();
9046
9049
  const watch = widgetOptions.watch;
9047
9050
  const enumSource = widgetOptions.enumSource;
9048
- const items = watch ? buildDynamicOptions(watch, enumSource, data) : [];
9049
- const selectedItem = items.find((item) => item.value === (value == null ? "" : String(value)));
9051
+ const dynamicItems = watch ? buildDynamicOptions(watch, enumSource, data) : [];
9052
+ const stringValue = value == null ? "" : String(value);
9053
+ const matched = dynamicItems.find((item) => item.value === stringValue);
9054
+ const fallbackItem = !matched && stringValue !== "" ? { value: stringValue, label: stringValue } : null;
9055
+ const selectedItem = matched ?? fallbackItem;
9056
+ const items = fallbackItem ? [fallbackItem, ...dynamicItems] : dynamicItems;
9050
9057
  return /* @__PURE__ */ jsx(
9051
9058
  Combobox,
9052
9059
  {
9053
9060
  variant: "secondary",
9054
9061
  items,
9055
- value: selectedItem ?? null,
9062
+ value: selectedItem,
9056
9063
  disabled: disabled || readonly,
9057
9064
  onValueChange: (selected) => onChange(selected?.value ?? "")
9058
9065
  }