@rjsf/chakra-ui 6.5.2 → 6.6.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.
Files changed (61) hide show
  1. package/dist/chakra-ui.esm.js +309 -309
  2. package/dist/chakra-ui.esm.js.map +4 -4
  3. package/dist/chakra-ui.umd.js +188 -188
  4. package/dist/index.cjs +339 -339
  5. package/dist/index.cjs.map +4 -4
  6. package/lib/AddButton/AddButton.js +1 -1
  7. package/lib/AddButton/AddButton.js.map +1 -1
  8. package/lib/AltDateWidget/AltDateWidget.js.map +1 -1
  9. package/lib/BaseInputTemplate/BaseInputTemplate.js +1 -1
  10. package/lib/BaseInputTemplate/BaseInputTemplate.js.map +1 -1
  11. package/lib/ChakraFrameProvider.js +2 -2
  12. package/lib/ChakraFrameProvider.js.map +1 -1
  13. package/lib/CheckboxWidget/CheckboxWidget.js +1 -1
  14. package/lib/CheckboxWidget/CheckboxWidget.js.map +1 -1
  15. package/lib/CheckboxesWidget/CheckboxesWidget.js.map +1 -1
  16. package/lib/DescriptionField/DescriptionField.js +1 -1
  17. package/lib/DescriptionField/DescriptionField.js.map +1 -1
  18. package/lib/ErrorList/ErrorList.js +1 -1
  19. package/lib/ErrorList/ErrorList.js.map +1 -1
  20. package/lib/FieldErrorTemplate/FieldErrorTemplate.js +1 -1
  21. package/lib/FieldErrorTemplate/FieldErrorTemplate.js.map +1 -1
  22. package/lib/FieldHelpTemplate/FieldHelpTemplate.js +1 -1
  23. package/lib/FieldHelpTemplate/FieldHelpTemplate.js.map +1 -1
  24. package/lib/Form/Form.js.map +1 -1
  25. package/lib/NativeSelectWidget/NativeSelectWidget.js +1 -1
  26. package/lib/NativeSelectWidget/NativeSelectWidget.js.map +1 -1
  27. package/lib/SelectWidget/SelectWidget.js +1 -1
  28. package/lib/SelectWidget/SelectWidget.js.map +1 -1
  29. package/lib/Templates/Templates.js +1 -1
  30. package/lib/Templates/Templates.js.map +1 -1
  31. package/lib/Theme/Theme.js.map +1 -1
  32. package/lib/TitleField/TitleField.js.map +1 -1
  33. package/lib/UpDownWidget/UpDownWidget.js.map +1 -1
  34. package/lib/Widgets/Widgets.js +2 -2
  35. package/lib/Widgets/Widgets.js.map +1 -1
  36. package/lib/WrapIfAdditionalTemplate/WrapIfAdditionalTemplate.js +1 -1
  37. package/lib/WrapIfAdditionalTemplate/WrapIfAdditionalTemplate.js.map +1 -1
  38. package/lib/tsconfig.tsbuildinfo +1 -1
  39. package/lib/utils.js.map +1 -1
  40. package/package.json +18 -19
  41. package/src/AddButton/AddButton.tsx +1 -1
  42. package/src/AltDateWidget/AltDateWidget.tsx +1 -0
  43. package/src/BaseInputTemplate/BaseInputTemplate.tsx +1 -1
  44. package/src/ChakraFrameProvider.tsx +2 -2
  45. package/src/CheckboxWidget/CheckboxWidget.tsx +1 -1
  46. package/src/CheckboxesWidget/CheckboxesWidget.tsx +1 -1
  47. package/src/DescriptionField/DescriptionField.tsx +1 -1
  48. package/src/ErrorList/ErrorList.tsx +1 -1
  49. package/src/FieldErrorTemplate/FieldErrorTemplate.tsx +1 -1
  50. package/src/FieldHelpTemplate/FieldHelpTemplate.tsx +1 -1
  51. package/src/Form/Form.tsx +2 -1
  52. package/src/NativeSelectWidget/NativeSelectWidget.tsx +1 -1
  53. package/src/SelectWidget/SelectWidget.tsx +1 -2
  54. package/src/Templates/Templates.ts +3 -2
  55. package/src/Theme/Theme.tsx +1 -1
  56. package/src/TitleField/TitleField.tsx +1 -1
  57. package/src/UpDownWidget/UpDownWidget.tsx +1 -2
  58. package/src/Widgets/Widgets.ts +4 -3
  59. package/src/WrapIfAdditionalTemplate/WrapIfAdditionalTemplate.tsx +1 -1
  60. package/src/tsconfig.json +0 -1
  61. package/src/utils.ts +1 -1
package/lib/utils.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwB,aAAa,EAAE,MAAM,kBAAkB,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AACrB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rjsf/chakra-ui",
3
- "version": "6.5.2",
3
+ "version": "6.6.0",
4
4
  "description": "Chakra UI theme, fields, and widgets for react-jsonschema-form",
5
5
  "main": "dist/index.js",
6
6
  "module": "lib/index.js",
@@ -44,18 +44,19 @@
44
44
  "build:esm": "esbuild ./src/index.ts --bundle --outfile=dist/chakra-ui.esm.js --sourcemap --packages=external --format=esm",
45
45
  "build:umd": "rollup dist/chakra-ui.esm.js --format=umd --file=dist/chakra-ui.umd.js --name=@rjsf/chakra-ui",
46
46
  "build": "npm run build:ts && npm run build:cjs && npm run build:esm && npm run build:umd",
47
- "cs-check": "prettier -l \"{src,test}/**/*.ts?(x)\"",
48
- "cs-format": "prettier \"{src,test}/**/*.ts?(x)\" --write",
49
- "lint": "eslint src test",
47
+ "cs-check": "oxfmt --check \"{src,test}/**/*.{ts,tsx}\"",
48
+ "cs-format": "oxfmt \"{src,test}/**/*.{ts,tsx}\"",
49
+ "lint": "oxlint src test",
50
50
  "precommit": "lint-staged",
51
- "test": "jest",
52
- "test:update": "jest --u",
53
- "test:watch": "jest --watch",
51
+ "test": "vitest run",
52
+ "test:update": "vitest run --update-snapshots",
53
+ "test:watch": "vitest",
54
54
  "type-check": "tsc --noEmit"
55
55
  },
56
56
  "lint-staged": {
57
- "{src,test}/**/*.ts?(x)": [
58
- "eslint --fix"
57
+ "{src,test}/**/*.{ts,tsx}": [
58
+ "oxlint --fix",
59
+ "oxfmt"
59
60
  ]
60
61
  },
61
62
  "engineStrict": false,
@@ -85,20 +86,18 @@
85
86
  },
86
87
  "license": "Apache-2.0",
87
88
  "devDependencies": {
88
- "@chakra-ui/cli": "^3.34.0",
89
- "@chakra-ui/react": "^3.34.0",
90
- "@emotion/eslint-plugin": "^11.12.0",
89
+ "@chakra-ui/cli": "^3.35.0",
90
+ "@chakra-ui/react": "^3.35.0",
91
91
  "@emotion/jest": "^11.14.2",
92
92
  "@emotion/react": "^11.14.0",
93
- "@rjsf/core": "6.5.2",
94
- "@rjsf/snapshot-tests": "6.5.2",
95
- "@rjsf/utils": "6.5.2",
96
- "@rjsf/validator-ajv8": "6.5.2",
97
- "chakra-react-select": "^6.1.1",
98
- "eslint": "^8.57.1"
93
+ "@rjsf/core": "6.6.0",
94
+ "@rjsf/snapshot-tests": "6.6.0",
95
+ "@rjsf/utils": "6.6.0",
96
+ "@rjsf/validator-ajv8": "6.6.0",
97
+ "chakra-react-select": "^6.1.3"
99
98
  },
100
99
  "dependencies": {
101
- "lucide-react": "^0.548.0",
100
+ "lucide-react": "^1.16.0",
102
101
  "react-icons": "^5.6.0",
103
102
  "react-select": "^5.10.2"
104
103
  }
@@ -1,5 +1,5 @@
1
- import { FormContextType, IconButtonProps, RJSFSchema, StrictRJSFSchema, TranslatableString } from '@rjsf/utils';
2
1
  import { Button } from '@chakra-ui/react';
2
+ import { FormContextType, IconButtonProps, RJSFSchema, StrictRJSFSchema, TranslatableString } from '@rjsf/utils';
3
3
  import { PlusIcon } from 'lucide-react';
4
4
 
5
5
  export default function AddButton<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>({
@@ -9,6 +9,7 @@ import {
9
9
  useAltDateWidgetProps,
10
10
  WidgetProps,
11
11
  } from '@rjsf/utils';
12
+
12
13
  import { getChakra } from '../utils';
13
14
 
14
15
  function AltDateWidget<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>({
@@ -1,5 +1,6 @@
1
1
  import { ChangeEvent, FocusEvent, MouseEvent, useCallback } from 'react';
2
2
  import { Input } from '@chakra-ui/react';
3
+ import { SchemaExamples } from '@rjsf/core';
3
4
  import {
4
5
  ariaDescribedByIds,
5
6
  BaseInputTemplateProps,
@@ -10,7 +11,6 @@ import {
10
11
  RJSFSchema,
11
12
  StrictRJSFSchema,
12
13
  } from '@rjsf/utils';
13
- import { SchemaExamples } from '@rjsf/core';
14
14
 
15
15
  import { Field } from '../components/ui/field';
16
16
  import { getChakra } from '../utils';
@@ -1,7 +1,7 @@
1
- import { CacheProvider } from '@emotion/react';
1
+ import { ChakraProvider, defaultSystem } from '@chakra-ui/react';
2
2
  import createCache from '@emotion/cache';
3
+ import { CacheProvider } from '@emotion/react';
3
4
  import weakMemoize from '@emotion/weak-memoize';
4
- import { ChakraProvider, defaultSystem } from '@chakra-ui/react';
5
5
 
6
6
  /**
7
7
  * __createChakraFrameProvider is used to ensure that <Global> emotion components
@@ -13,8 +13,8 @@ import {
13
13
  getUiOptions,
14
14
  } from '@rjsf/utils';
15
15
 
16
- import { Field } from '../components/ui/field';
17
16
  import { Checkbox } from '../components/ui/checkbox';
17
+ import { Field } from '../components/ui/field';
18
18
  import { getChakra } from '../utils';
19
19
 
20
20
  export default function CheckboxWidget<
@@ -1,3 +1,4 @@
1
+ import { FocusEvent } from 'react';
1
2
  import { CheckboxGroup, FieldsetRoot, Stack, Text, FieldsetLegend } from '@chakra-ui/react';
2
3
  import {
3
4
  ariaDescribedByIds,
@@ -12,7 +13,6 @@ import {
12
13
  WidgetProps,
13
14
  labelValue,
14
15
  } from '@rjsf/utils';
15
- import { FocusEvent } from 'react';
16
16
 
17
17
  import { Checkbox } from '../components/ui/checkbox';
18
18
  import { getChakra } from '../utils';
@@ -1,6 +1,6 @@
1
+ import { Text } from '@chakra-ui/react';
1
2
  import { RichDescription } from '@rjsf/core';
2
3
  import { DescriptionFieldProps, FormContextType, RJSFSchema, StrictRJSFSchema } from '@rjsf/utils';
3
- import { Text } from '@chakra-ui/react';
4
4
 
5
5
  /** The `DescriptionField` is the template to use to render the description of a field
6
6
  *
@@ -1,5 +1,5 @@
1
- import { ErrorListProps, FormContextType, RJSFSchema, StrictRJSFSchema, TranslatableString } from '@rjsf/utils';
2
1
  import { ListItem, ListRoot } from '@chakra-ui/react';
2
+ import { ErrorListProps, FormContextType, RJSFSchema, StrictRJSFSchema, TranslatableString } from '@rjsf/utils';
3
3
 
4
4
  import { Alert } from '../components/ui/alert';
5
5
 
@@ -1,5 +1,5 @@
1
- import { errorId, FieldErrorProps, FormContextType, RJSFSchema, StrictRJSFSchema } from '@rjsf/utils';
2
1
  import { Fieldset } from '@chakra-ui/react';
2
+ import { errorId, FieldErrorProps, FormContextType, RJSFSchema, StrictRJSFSchema } from '@rjsf/utils';
3
3
 
4
4
  /** The `FieldErrorTemplate` component renders the errors local to the particular field
5
5
  *
@@ -1,6 +1,6 @@
1
1
  import { Text } from '@chakra-ui/react';
2
- import { helpId, FieldHelpProps, FormContextType, RJSFSchema, StrictRJSFSchema } from '@rjsf/utils';
3
2
  import { RichHelp } from '@rjsf/core';
3
+ import { helpId, FieldHelpProps, FormContextType, RJSFSchema, StrictRJSFSchema } from '@rjsf/utils';
4
4
 
5
5
  /** The `FieldHelpTemplate` component renders any help desired for a field
6
6
  *
package/src/Form/Form.tsx CHANGED
@@ -1,8 +1,9 @@
1
1
  import { ComponentType } from 'react';
2
2
  import { withTheme, FormProps } from '@rjsf/core';
3
- import { generateTheme } from '../Theme';
4
3
  import { FormContextType, RJSFSchema, StrictRJSFSchema } from '@rjsf/utils';
5
4
 
5
+ import { generateTheme } from '../Theme';
6
+
6
7
  export function generateForm<
7
8
  T = any,
8
9
  S extends StrictRJSFSchema = RJSFSchema,
@@ -1,4 +1,5 @@
1
1
  import { ChangeEvent, FocusEvent, useMemo } from 'react';
2
+ import { createListCollection, NativeSelect } from '@chakra-ui/react';
2
3
  import {
3
4
  ariaDescribedByIds,
4
5
  EnumOptionsType,
@@ -11,7 +12,6 @@ import {
11
12
  WidgetProps,
12
13
  } from '@rjsf/utils';
13
14
  import { OptionsOrGroups } from 'chakra-react-select';
14
- import { createListCollection, NativeSelect } from '@chakra-ui/react';
15
15
 
16
16
  import { Field } from '../components/ui/field';
17
17
  import { getChakra } from '../utils';
@@ -1,5 +1,5 @@
1
1
  import { FocusEvent, useMemo, useRef } from 'react';
2
-
2
+ import { createListCollection, SelectValueChangeDetails, Select as ChakraSelect } from '@chakra-ui/react';
3
3
  import {
4
4
  ariaDescribedByIds,
5
5
  EnumOptionsType,
@@ -14,7 +14,6 @@ import {
14
14
  WidgetProps,
15
15
  } from '@rjsf/utils';
16
16
  import { OptionsOrGroups } from 'chakra-react-select';
17
- import { createListCollection, SelectValueChangeDetails, Select as ChakraSelect } from '@chakra-ui/react';
18
17
 
19
18
  import { Field } from '../components/ui/field';
20
19
  import { SelectRoot, SelectTrigger, SelectValueText } from '../components/ui/select';
@@ -1,21 +1,22 @@
1
+ import { FormContextType, RJSFSchema, StrictRJSFSchema, TemplatesType } from '@rjsf/utils';
2
+
1
3
  import AddButton from '../AddButton';
2
4
  import ArrayFieldItemTemplate from '../ArrayFieldItemTemplate';
3
5
  import ArrayFieldTemplate from '../ArrayFieldTemplate';
4
6
  import BaseInputTemplate from '../BaseInputTemplate/BaseInputTemplate';
5
7
  import DescriptionField from '../DescriptionField';
6
8
  import ErrorList from '../ErrorList';
7
- import { CopyButton, MoveDownButton, MoveUpButton, RemoveButton, ClearButton } from '../IconButton';
8
9
  import FieldErrorTemplate from '../FieldErrorTemplate';
9
10
  import FieldHelpTemplate from '../FieldHelpTemplate';
10
11
  import FieldTemplate from '../FieldTemplate';
11
12
  import GridTemplate from '../GridTemplate';
13
+ import { CopyButton, MoveDownButton, MoveUpButton, RemoveButton, ClearButton } from '../IconButton';
12
14
  import MultiSchemaFieldTemplate from '../MultiSchemaFieldTemplate';
13
15
  import ObjectFieldTemplate from '../ObjectFieldTemplate';
14
16
  import OptionalDataControlsTemplate from '../OptionalDataControlsTemplate';
15
17
  import SubmitButton from '../SubmitButton';
16
18
  import TitleField from '../TitleField';
17
19
  import WrapIfAdditionalTemplate from '../WrapIfAdditionalTemplate';
18
- import { FormContextType, RJSFSchema, StrictRJSFSchema, TemplatesType } from '@rjsf/utils';
19
20
 
20
21
  export function generateTemplates<
21
22
  T = any,
@@ -1,8 +1,8 @@
1
1
  import { ThemeProps } from '@rjsf/core';
2
+ import { FormContextType, RJSFSchema, StrictRJSFSchema } from '@rjsf/utils';
2
3
 
3
4
  import { generateTemplates } from '../Templates';
4
5
  import { generateWidgets } from '../Widgets';
5
- import { FormContextType, RJSFSchema, StrictRJSFSchema } from '@rjsf/utils';
6
6
 
7
7
  export function generateTheme<
8
8
  T = any,
@@ -1,5 +1,5 @@
1
- import { FormContextType, RJSFSchema, StrictRJSFSchema, TitleFieldProps } from '@rjsf/utils';
2
1
  import { Box, Flex, Heading, Separator, Spacer } from '@chakra-ui/react';
2
+ import { FormContextType, RJSFSchema, StrictRJSFSchema, TitleFieldProps } from '@rjsf/utils';
3
3
 
4
4
  export default function TitleField<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>({
5
5
  id,
@@ -1,5 +1,5 @@
1
1
  import { FocusEvent } from 'react';
2
-
2
+ import { NumberInputValueChangeDetails } from '@chakra-ui/react';
3
3
  import {
4
4
  ariaDescribedByIds,
5
5
  labelValue,
@@ -8,7 +8,6 @@ import {
8
8
  StrictRJSFSchema,
9
9
  WidgetProps,
10
10
  } from '@rjsf/utils';
11
- import { NumberInputValueChangeDetails } from '@chakra-ui/react';
12
11
 
13
12
  import { Field } from '../components/ui/field';
14
13
  import { NumberInputRoot } from '../components/ui/number-input';
@@ -1,14 +1,15 @@
1
+ import { FormContextType, RegistryWidgetsType, RJSFSchema, StrictRJSFSchema } from '@rjsf/utils';
2
+
1
3
  import AltDateTimeWidget from '../AltDateTimeWidget/AltDateTimeWidget';
2
4
  import AltDateWidget from '../AltDateWidget/AltDateWidget';
3
- import CheckboxWidget from '../CheckboxWidget/CheckboxWidget';
4
5
  import CheckboxesWidget from '../CheckboxesWidget/CheckboxesWidget';
6
+ import CheckboxWidget from '../CheckboxWidget/CheckboxWidget';
7
+ import NativeSelectWidget from '../NativeSelectWidget/NativeSelectWidget';
5
8
  import RadioWidget from '../RadioWidget/RadioWidget';
6
9
  import RangeWidget from '../RangeWidget/RangeWidget';
7
10
  import SelectWidget from '../SelectWidget/SelectWidget';
8
- import NativeSelectWidget from '../NativeSelectWidget/NativeSelectWidget';
9
11
  import TextareaWidget from '../TextareaWidget/TextareaWidget';
10
12
  import UpDownWidget from '../UpDownWidget/UpDownWidget';
11
- import { FormContextType, RegistryWidgetsType, RJSFSchema, StrictRJSFSchema } from '@rjsf/utils';
12
13
 
13
14
  export function generateWidgets<
14
15
  T = any,
@@ -1,3 +1,4 @@
1
+ import { Grid, GridItem, Input } from '@chakra-ui/react';
1
2
  import {
2
3
  ADDITIONAL_PROPERTY_FLAG,
3
4
  buttonId,
@@ -7,7 +8,6 @@ import {
7
8
  TranslatableString,
8
9
  WrapIfAdditionalTemplateProps,
9
10
  } from '@rjsf/utils';
10
- import { Grid, GridItem, Input } from '@chakra-ui/react';
11
11
 
12
12
  import { Field } from '../components/ui/field';
13
13
 
package/src/tsconfig.json CHANGED
@@ -4,7 +4,6 @@
4
4
  "compilerOptions": {
5
5
  "rootDir": "./",
6
6
  "outDir": "../lib",
7
- "baseUrl": "../",
8
7
  "jsx": "react-jsx",
9
8
  // There are type errors in @chakra-ui/menu type definitions because of which skipLibCheck had to be added
10
9
  // @chakra-ui/menu/dist/declarations/src/use-menu.d.ts:986:61 - error TS2694: Namespace '"node_modules/csstype/index".Property' has no exported member 'ColorAdjust'.
package/src/utils.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { Field as ChakraField, defaultSystem } from '@chakra-ui/react';
2
- import { UiSchema } from '@rjsf/utils';
3
2
  import shouldForwardProp from '@emotion/is-prop-valid';
3
+ import { UiSchema } from '@rjsf/utils';
4
4
 
5
5
  const { isValidProperty } = defaultSystem;
6
6