@ultraviolet/form 3.9.2 → 3.9.4

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.
@@ -21,6 +21,8 @@ const SelectableCardField = ({
21
21
  label,
22
22
  shouldUnregister = false,
23
23
  validate,
24
+ productIcon,
25
+ illustration,
24
26
  "data-testid": dataTestId
25
27
  }) => {
26
28
  const {
@@ -38,7 +40,7 @@ const SelectableCardField = ({
38
40
  }
39
41
  });
40
42
  const isChecked = type === "checkbox" && Array.isArray(field.value) && value ? (field.value ?? []).includes(value) : field.value === value;
41
- return /* @__PURE__ */ jsxRuntime.jsx(ui.SelectableCard, { isError: !!error, showTick, checked: isChecked, className, disabled, onChange: (event) => {
43
+ return /* @__PURE__ */ jsxRuntime.jsx(ui.SelectableCard, { productIcon, illustration, isError: !!error, showTick, checked: isChecked, className, disabled, onChange: (event) => {
42
44
  if (type === "checkbox") {
43
45
  const fieldValue = field.value ?? [];
44
46
  if (fieldValue?.includes(event.currentTarget.value)) {
@@ -4,6 +4,8 @@ import type { FieldPath, FieldValues } from 'react-hook-form';
4
4
  import type { BaseFieldProps } from '../../types';
5
5
  type SelectableCardFieldProps<TFieldValues extends FieldValues, TFieldName extends FieldPath<TFieldValues>> = Omit<BaseFieldProps<TFieldValues, TFieldName>, 'label'> & Partial<Pick<ComponentProps<typeof SelectableCard>, 'disabled' | 'onBlur' | 'onFocus' | 'showTick' | 'type' | 'id' | 'children' | 'tooltip' | 'label' | 'data-testid'>> & {
6
6
  className?: string;
7
+ illustration?: string;
8
+ productIcon?: never;
7
9
  };
8
- export declare const SelectableCardField: <TFieldValues extends FieldValues, TFieldName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>({ name, control, value, onChange, showTick, type, disabled, children, className, onFocus, onBlur, required, tooltip, id, label, shouldUnregister, validate, "data-testid": dataTestId, }: SelectableCardFieldProps<TFieldValues, TFieldName>) => import("@emotion/react/jsx-runtime").JSX.Element;
10
+ export declare const SelectableCardField: <TFieldValues extends FieldValues, TFieldName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>({ name, control, value, onChange, showTick, type, disabled, children, className, onFocus, onBlur, required, tooltip, id, label, shouldUnregister, validate, productIcon, illustration, "data-testid": dataTestId, }: SelectableCardFieldProps<TFieldValues, TFieldName>) => import("@emotion/react/jsx-runtime").JSX.Element;
9
11
  export {};
@@ -19,6 +19,8 @@ const SelectableCardField = ({
19
19
  label,
20
20
  shouldUnregister = false,
21
21
  validate,
22
+ productIcon,
23
+ illustration,
22
24
  "data-testid": dataTestId
23
25
  }) => {
24
26
  const {
@@ -36,7 +38,7 @@ const SelectableCardField = ({
36
38
  }
37
39
  });
38
40
  const isChecked = type === "checkbox" && Array.isArray(field.value) && value ? (field.value ?? []).includes(value) : field.value === value;
39
- return /* @__PURE__ */ jsx(SelectableCard, { isError: !!error, showTick, checked: isChecked, className, disabled, onChange: (event) => {
41
+ return /* @__PURE__ */ jsx(SelectableCard, { productIcon, illustration, isError: !!error, showTick, checked: isChecked, className, disabled, onChange: (event) => {
40
42
  if (type === "checkbox") {
41
43
  const fieldValue = field.value ?? [];
42
44
  if (fieldValue?.includes(event.currentTarget.value)) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ultraviolet/form",
3
- "version": "3.9.2",
3
+ "version": "3.9.4",
4
4
  "description": "Ultraviolet Form",
5
5
  "homepage": "https://github.com/scaleway/ultraviolet#readme",
6
6
  "repository": {
@@ -57,22 +57,22 @@
57
57
  "react-dom": "18.x"
58
58
  },
59
59
  "devDependencies": {
60
- "@babel/core": "7.25.2",
60
+ "@babel/core": "7.25.7",
61
61
  "@emotion/react": "11.13.3",
62
62
  "@emotion/styled": "11.13.0",
63
63
  "@types/final-form-focus": "1.1.7",
64
- "@types/react": "18.3.10",
64
+ "@types/react": "18.3.11",
65
65
  "@types/react-dom": "18.3.0",
66
66
  "react": "18.3.1",
67
67
  "react-dom": "18.3.1",
68
68
  "@utils/test": "0.0.1"
69
69
  },
70
70
  "dependencies": {
71
- "@babel/runtime": "7.25.6",
71
+ "@babel/runtime": "7.25.7",
72
72
  "react-hook-form": "7.53.0",
73
73
  "react-select": "5.8.1",
74
74
  "@ultraviolet/themes": "1.14.2",
75
- "@ultraviolet/ui": "1.72.0"
75
+ "@ultraviolet/ui": "1.72.2"
76
76
  },
77
77
  "scripts": {
78
78
  "build:profile": "npx vite-bundle-visualizer -c vite.config.ts",