@ultraviolet/form 2.3.0 → 2.3.2

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.
@@ -24,6 +24,7 @@ const KeyValueField = ({
24
24
  control
25
25
  });
26
26
  const canAdd = fields.length !== undefined && fields.length < maxSize;
27
+ const maxSizeReachedTooltip = addButton.maxSizeReachedTooltip ?? `Cannot add more than ${maxSize} elements`;
27
28
  return jsxs(Stack, {
28
29
  gap: 3,
29
30
  children: [fields.length ? jsx(Stack, {
@@ -66,7 +67,7 @@ const KeyValueField = ({
66
67
  sentiment: "neutral",
67
68
  fullWidth: addButton.fullWidth,
68
69
  disabled: !canAdd || readonly,
69
- tooltip: !canAdd ? addButton.maxSizeReachedTooltip : addButton.tooltip
70
+ tooltip: !canAdd ? maxSizeReachedTooltip : addButton.tooltip
70
71
  // @ts-expect-error can't infer properly
71
72
  ,
72
73
  onClick: () => append({
package/dist/index.d.ts CHANGED
@@ -335,8 +335,8 @@ type InputValueProps = {
335
335
  type AddButtonProps = {
336
336
  name: ComponentProps<typeof Button>['children'];
337
337
  fullWidth?: ComponentProps<typeof Button>['fullWidth'];
338
- tooltip: string;
339
- maxSizeReachedTooltip: string;
338
+ tooltip?: string;
339
+ maxSizeReachedTooltip?: string;
340
340
  };
341
341
  type KeyValueFieldProps<TFieldValues extends FieldValues, TFieldArrayName extends FieldArrayPath<TFieldValues>> = {
342
342
  name: TFieldArrayName;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ultraviolet/form",
3
- "version": "2.3.0",
3
+ "version": "2.3.2",
4
4
  "description": "Ultraviolet Form",
5
5
  "homepage": "https://github.com/scaleway/ultraviolet#readme",
6
6
  "repository": {
@@ -53,7 +53,7 @@
53
53
  "@emotion/styled": "11.11.0",
54
54
  "react-select": "5.8.0",
55
55
  "react-hook-form": "7.49.3",
56
- "@ultraviolet/ui": "1.31.0"
56
+ "@ultraviolet/ui": "1.31.2"
57
57
  },
58
58
  "scripts": {
59
59
  "build": "rollup -c ../../rollup.config.mjs",