@telegraph/select 0.0.1

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/CHANGELOG.md ADDED
@@ -0,0 +1,10 @@
1
+ # @telegraph/select
2
+
3
+ ## 0.0.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [#299](https://github.com/knocklabs/telegraph/pull/299) [`57d486e`](https://github.com/knocklabs/telegraph/commit/57d486e1da7b0c650bc39ac12528a5f0f4f3a374) Thanks [@kylemcd](https://github.com/kylemcd)! - new select component + combobox fixes
8
+
9
+ - Updated dependencies [[`57d486e`](https://github.com/knocklabs/telegraph/commit/57d486e1da7b0c650bc39ac12528a5f0f4f3a374)]:
10
+ - @telegraph/combobox@0.0.40
package/README.md ADDED
@@ -0,0 +1,17 @@
1
+ ![Telegraph by Knock](https://github.com/knocklabs/telegraph/assets/29106675/9b5022e3-b02c-4582-ba57-3d6171e45e44)
2
+
3
+ [![npm version](https://img.shields.io/npm/v/@telegraph/button.svg)](https://www.npmjs.com/package/@telegraph/select)
4
+
5
+ # @telegraph/select
6
+ > A simple select component built on top of @telegraph/combobox
7
+
8
+ ## Installation Instructions
9
+
10
+ ```
11
+ npm install @telegraph/select
12
+ ```
13
+
14
+ ### Add stylesheet
15
+ ```
16
+ @import "@telegraph/select"
17
+ ```
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),a=require("@telegraph/combobox"),c=require("react"),C=({size:l="1",multiple:s=!1,value:e,onValueChange:p,triggerProps:x,contentProps:m,optionsProps:d,children:b,...f})=>{const u=c.useMemo(()=>c.Children.toArray(b).filter(o=>c.isValidElement(o)&&o.props.value).map(o=>{var n;const t=o;return{value:t.props.value,label:((n=t.props)==null?void 0:n.children)||t.props.value}}),[b]),j=c.useMemo(()=>{var r;return s&&e&&Array.isArray(e)?e.map(o=>{var t;return{value:o,label:(t=u.find(n=>n.value===o))==null?void 0:t.label}}):e?{value:e,label:(r=u.find(o=>o.value===e))==null?void 0:r.label}:void 0},[s,e,u]);return i.jsxs(a.Combobox.Root,{value:j,onValueChange:r=>{if(s&&r&&Array.isArray(r)){const n=p;n==null||n(r.map(y=>y.value));return}const o=p,t=r.value;o(t)},closeOnSelect:!s,...f,children:[i.jsx(a.Combobox.Trigger,{size:l,...x}),i.jsx(a.Combobox.Content,{...m,children:i.jsx(a.Combobox.Options,{...d,children:b})})]})},O=({value:l,children:s,...e})=>i.jsx(a.Combobox.Option,{value:l,label:s,...e}),S={Root:C,Option:O};exports.Select=S;
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../src/Select/Select.tsx"],"sourcesContent":["import { Combobox } from \"@telegraph/combobox\";\nimport { TgphComponentProps } from \"@telegraph/helpers\";\nimport React from \"react\";\n\ntype Option = TgphComponentProps<typeof Combobox.Option>;\n\ntype SingleValue = string;\ntype MultipleValue = Array<string>;\n\ntype RootProps = Omit<\n TgphComponentProps<typeof Combobox.Root>,\n \"value\" | \"onValueChange\" | \"layout\"\n> & {\n size?: TgphComponentProps<typeof Combobox.Trigger>[\"size\"];\n triggerProps?: TgphComponentProps<typeof Combobox.Trigger>;\n contentProps?: TgphComponentProps<typeof Combobox.Content>;\n optionsProps?: TgphComponentProps<typeof Combobox.Options>;\n multiple?: boolean;\n} & (\n | {\n multiple?: true;\n value?: MultipleValue;\n onValueChange?: (value: MultipleValue) => void;\n layout?: TgphComponentProps<typeof Combobox.Root>[\"layout\"];\n }\n | {\n multiple?: false;\n value?: SingleValue;\n onValueChange?: (value: SingleValue) => void;\n layout?: never;\n }\n );\n\nconst Root = ({\n size = \"1\",\n multiple = false,\n value,\n onValueChange,\n triggerProps,\n contentProps,\n optionsProps,\n children,\n ...props\n}: RootProps) => {\n // Get all of the options passed into Select so that we can display\n // the label of the selected option in the trigger.\n const options = React.useMemo(() => {\n const options = React.Children.toArray(children)\n // Filter down to the components that are Option components\n .filter((child) => {\n return React.isValidElement(child) && child.props.value;\n })\n // Map the Option components to an array of objects that have a value and label\n // so that we can display the label of the selected option in the trigger.\n .map((child) => {\n const childOption = child as React.ReactElement<OptionProps>;\n return {\n value: childOption.props.value,\n // If the Option component has a label, use it. Otherwise, use the value\n // so that we can display something.\n label: childOption.props?.children || childOption.props.value,\n };\n });\n\n return options;\n }, [children]);\n\n const derivedValue = React.useMemo(() => {\n if (multiple && value && Array.isArray(value)) {\n return value.map((v) => ({\n value: v,\n label: options.find((o) => o.value === v)?.label,\n }));\n }\n return value\n ? {\n value: value as string,\n label: options.find((o) => o.value === value)?.label,\n }\n : undefined;\n }, [multiple, value, options]);\n\n return (\n <Combobox.Root\n value={derivedValue}\n onValueChange={(value) => {\n if (multiple && value && Array.isArray(value)) {\n const changeFn = onValueChange as (value: MultipleValue) => void;\n changeFn?.(value.map((v) => v.value));\n return;\n }\n\n const changeFn = onValueChange as (value: SingleValue) => void;\n const valueString = (value as { value: string }).value;\n changeFn(valueString);\n }}\n closeOnSelect={!multiple}\n {...props}\n >\n <Combobox.Trigger size={size} {...triggerProps} />\n <Combobox.Content {...contentProps}>\n <Combobox.Options {...optionsProps}>{children}</Combobox.Options>\n </Combobox.Content>\n </Combobox.Root>\n );\n};\n\ntype OptionProps = Omit<TgphComponentProps<typeof Combobox.Option>, \"label\">;\n\nconst Option = ({ value, children, ...props }: OptionProps) => {\n return <Combobox.Option value={value} label={children} {...props} />;\n};\n\nconst Select = { Root, Option };\ntype SelectProps = RootProps;\n\nexport { Select };\nexport type { SelectProps, OptionProps, Option };\n"],"names":["Root","size","multiple","value","onValueChange","triggerProps","contentProps","optionsProps","children","props","options","React","child","childOption","_a","derivedValue","v","o","jsxs","Combobox","changeFn","valueString","jsx","Option","Select"],"mappings":"yKAiCMA,EAAO,CAAC,CACZ,KAAAC,EAAO,IACP,SAAAC,EAAW,GACX,MAAAC,EACA,cAAAC,EACA,aAAAC,EACA,aAAAC,EACA,aAAAC,EACA,SAAAC,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AAA,SAAS,QAAT,CAAkB,GAAGZ,EAAe,SAAAC,EAAS,CAChD,CAAA,CAAA,CAAA,CAAA,CAGN,EAIMe,EAAS,CAAC,CAAE,MAAApB,EAAO,SAAAK,EAAU,GAAGC,KAC7Ba,EAAA,IAACH,WAAS,OAAT,CAAgB,MAAAhB,EAAc,MAAOK,EAAW,GAAGC,CAAO,CAAA,EAG9De,EAAS,CAAE,KAAAxB,EAAM,OAAAuB,CAAO"}
@@ -0,0 +1,62 @@
1
+ import { jsxs as x, jsx as p } from "react/jsx-runtime";
2
+ import { Combobox as i } from "@telegraph/combobox";
3
+ import a from "react";
4
+ const g = ({
5
+ size: l = "1",
6
+ multiple: s = !1,
7
+ value: r,
8
+ onValueChange: u,
9
+ triggerProps: f,
10
+ contentProps: b,
11
+ optionsProps: d,
12
+ children: c,
13
+ ...y
14
+ }) => {
15
+ const m = a.useMemo(() => a.Children.toArray(c).filter((o) => a.isValidElement(o) && o.props.value).map((o) => {
16
+ var n;
17
+ const e = o;
18
+ return {
19
+ value: e.props.value,
20
+ // If the Option component has a label, use it. Otherwise, use the value
21
+ // so that we can display something.
22
+ label: ((n = e.props) == null ? void 0 : n.children) || e.props.value
23
+ };
24
+ }), [c]), A = a.useMemo(() => {
25
+ var t;
26
+ return s && r && Array.isArray(r) ? r.map((o) => {
27
+ var e;
28
+ return {
29
+ value: o,
30
+ label: (e = m.find((n) => n.value === o)) == null ? void 0 : e.label
31
+ };
32
+ }) : r ? {
33
+ value: r,
34
+ label: (t = m.find((o) => o.value === r)) == null ? void 0 : t.label
35
+ } : void 0;
36
+ }, [s, r, m]);
37
+ return /* @__PURE__ */ x(
38
+ i.Root,
39
+ {
40
+ value: A,
41
+ onValueChange: (t) => {
42
+ if (s && t && Array.isArray(t)) {
43
+ const n = u;
44
+ n == null || n(t.map((O) => O.value));
45
+ return;
46
+ }
47
+ const o = u, e = t.value;
48
+ o(e);
49
+ },
50
+ closeOnSelect: !s,
51
+ ...y,
52
+ children: [
53
+ /* @__PURE__ */ p(i.Trigger, { size: l, ...f }),
54
+ /* @__PURE__ */ p(i.Content, { ...b, children: /* @__PURE__ */ p(i.Options, { ...d, children: c }) })
55
+ ]
56
+ }
57
+ );
58
+ }, v = ({ value: l, children: s, ...r }) => /* @__PURE__ */ p(i.Option, { value: l, label: s, ...r }), h = { Root: g, Option: v };
59
+ export {
60
+ h as Select
61
+ };
62
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","sources":["../../src/Select/Select.tsx"],"sourcesContent":["import { Combobox } from \"@telegraph/combobox\";\nimport { TgphComponentProps } from \"@telegraph/helpers\";\nimport React from \"react\";\n\ntype Option = TgphComponentProps<typeof Combobox.Option>;\n\ntype SingleValue = string;\ntype MultipleValue = Array<string>;\n\ntype RootProps = Omit<\n TgphComponentProps<typeof Combobox.Root>,\n \"value\" | \"onValueChange\" | \"layout\"\n> & {\n size?: TgphComponentProps<typeof Combobox.Trigger>[\"size\"];\n triggerProps?: TgphComponentProps<typeof Combobox.Trigger>;\n contentProps?: TgphComponentProps<typeof Combobox.Content>;\n optionsProps?: TgphComponentProps<typeof Combobox.Options>;\n multiple?: boolean;\n} & (\n | {\n multiple?: true;\n value?: MultipleValue;\n onValueChange?: (value: MultipleValue) => void;\n layout?: TgphComponentProps<typeof Combobox.Root>[\"layout\"];\n }\n | {\n multiple?: false;\n value?: SingleValue;\n onValueChange?: (value: SingleValue) => void;\n layout?: never;\n }\n );\n\nconst Root = ({\n size = \"1\",\n multiple = false,\n value,\n onValueChange,\n triggerProps,\n contentProps,\n optionsProps,\n children,\n ...props\n}: RootProps) => {\n // Get all of the options passed into Select so that we can display\n // the label of the selected option in the trigger.\n const options = React.useMemo(() => {\n const options = React.Children.toArray(children)\n // Filter down to the components that are Option components\n .filter((child) => {\n return React.isValidElement(child) && child.props.value;\n })\n // Map the Option components to an array of objects that have a value and label\n // so that we can display the label of the selected option in the trigger.\n .map((child) => {\n const childOption = child as React.ReactElement<OptionProps>;\n return {\n value: childOption.props.value,\n // If the Option component has a label, use it. Otherwise, use the value\n // so that we can display something.\n label: childOption.props?.children || childOption.props.value,\n };\n });\n\n return options;\n }, [children]);\n\n const derivedValue = React.useMemo(() => {\n if (multiple && value && Array.isArray(value)) {\n return value.map((v) => ({\n value: v,\n label: options.find((o) => o.value === v)?.label,\n }));\n }\n return value\n ? {\n value: value as string,\n label: options.find((o) => o.value === value)?.label,\n }\n : undefined;\n }, [multiple, value, options]);\n\n return (\n <Combobox.Root\n value={derivedValue}\n onValueChange={(value) => {\n if (multiple && value && Array.isArray(value)) {\n const changeFn = onValueChange as (value: MultipleValue) => void;\n changeFn?.(value.map((v) => v.value));\n return;\n }\n\n const changeFn = onValueChange as (value: SingleValue) => void;\n const valueString = (value as { value: string }).value;\n changeFn(valueString);\n }}\n closeOnSelect={!multiple}\n {...props}\n >\n <Combobox.Trigger size={size} {...triggerProps} />\n <Combobox.Content {...contentProps}>\n <Combobox.Options {...optionsProps}>{children}</Combobox.Options>\n </Combobox.Content>\n </Combobox.Root>\n );\n};\n\ntype OptionProps = Omit<TgphComponentProps<typeof Combobox.Option>, \"label\">;\n\nconst Option = ({ value, children, ...props }: OptionProps) => {\n return <Combobox.Option value={value} label={children} {...props} />;\n};\n\nconst Select = { Root, Option };\ntype SelectProps = RootProps;\n\nexport { Select };\nexport type { SelectProps, OptionProps, Option };\n"],"names":["Root","size","multiple","value","onValueChange","triggerProps","contentProps","optionsProps","children","props","options","React","child","childOption","_a","derivedValue","v","o","jsxs","Combobox","changeFn","valueString","jsx","Option","Select"],"mappings":";;;AAiCA,MAAMA,IAAO,CAAC;AAAA,EACZ,MAAAC,IAAO;AAAA,EACP,UAAAC,IAAW;AAAA,EACX,OAAAC;AAAA,EACA,eAAAC;AAAA,EACA,cAAAC;AAAA,EACA,cAAAC;AAAA,EACA,cAAAC;AAAA,EACA,UAAAC;AAAA,EACA,GAAGC;AACL,MAAiB;AAGT,QAAAC,IAAUC,EAAM,QAAQ,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AT,EAAiB,MAAAlB,GAAa,GAAGI,EAAc,CAAA;AAAA,QAC/C,gBAAAiB,EAAAH,EAAS,SAAT,EAAkB,GAAGb,GACpB,UAAC,gBAAAgB,EAAAH,EAAS,SAAT,EAAkB,GAAGZ,GAAe,UAAAC,GAAS,EAChD,CAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGN,GAIMe,IAAS,CAAC,EAAE,OAAApB,GAAO,UAAAK,GAAU,GAAGC,QAC7B,gBAAAa,EAACH,EAAS,QAAT,EAAgB,OAAAhB,GAAc,OAAOK,GAAW,GAAGC,EAAO,CAAA,GAG9De,IAAS,EAAE,MAAAxB,GAAM,QAAAuB,EAAO;"}
@@ -0,0 +1,33 @@
1
+ import { Combobox } from '@telegraph/combobox';
2
+ import { TgphComponentProps } from '@telegraph/helpers';
3
+
4
+ type Option = TgphComponentProps<typeof Combobox.Option>;
5
+ type SingleValue = string;
6
+ type MultipleValue = Array<string>;
7
+ type RootProps = Omit<TgphComponentProps<typeof Combobox.Root>, "value" | "onValueChange" | "layout"> & {
8
+ size?: TgphComponentProps<typeof Combobox.Trigger>["size"];
9
+ triggerProps?: TgphComponentProps<typeof Combobox.Trigger>;
10
+ contentProps?: TgphComponentProps<typeof Combobox.Content>;
11
+ optionsProps?: TgphComponentProps<typeof Combobox.Options>;
12
+ multiple?: boolean;
13
+ } & ({
14
+ multiple?: true;
15
+ value?: MultipleValue;
16
+ onValueChange?: (value: MultipleValue) => void;
17
+ layout?: TgphComponentProps<typeof Combobox.Root>["layout"];
18
+ } | {
19
+ multiple?: false;
20
+ value?: SingleValue;
21
+ onValueChange?: (value: SingleValue) => void;
22
+ layout?: never;
23
+ });
24
+ type OptionProps = Omit<TgphComponentProps<typeof Combobox.Option>, "label">;
25
+ declare const Option: ({ value, children, ...props }: OptionProps) => import("react/jsx-runtime").JSX.Element;
26
+ declare const Select: {
27
+ Root: ({ size, multiple, value, onValueChange, triggerProps, contentProps, optionsProps, children, ...props }: RootProps) => import("react/jsx-runtime").JSX.Element;
28
+ Option: ({ value, children, ...props }: OptionProps) => import("react/jsx-runtime").JSX.Element;
29
+ };
30
+ type SelectProps = RootProps;
31
+ export { Select };
32
+ export type { SelectProps, OptionProps, Option };
33
+ //# sourceMappingURL=Select.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Select.d.ts","sourceRoot":"","sources":["../../../src/Select/Select.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAGxD,KAAK,MAAM,GAAG,kBAAkB,CAAC,OAAO,QAAQ,CAAC,MAAM,CAAC,CAAC;AAEzD,KAAK,WAAW,GAAG,MAAM,CAAC;AAC1B,KAAK,aAAa,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC;AAEnC,KAAK,SAAS,GAAG,IAAI,CACnB,kBAAkB,CAAC,OAAO,QAAQ,CAAC,IAAI,CAAC,EACxC,OAAO,GAAG,eAAe,GAAG,QAAQ,CACrC,GAAG;IACF,IAAI,CAAC,EAAE,kBAAkB,CAAC,OAAO,QAAQ,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC;IAC3D,YAAY,CAAC,EAAE,kBAAkB,CAAC,OAAO,QAAQ,CAAC,OAAO,CAAC,CAAC;IAC3D,YAAY,CAAC,EAAE,kBAAkB,CAAC,OAAO,QAAQ,CAAC,OAAO,CAAC,CAAC;IAC3D,YAAY,CAAC,EAAE,kBAAkB,CAAC,OAAO,QAAQ,CAAC,OAAO,CAAC,CAAC;IAC3D,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,GAAG,CACE;IACE,QAAQ,CAAC,EAAE,IAAI,CAAC;IAChB,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,IAAI,CAAC;IAC/C,MAAM,CAAC,EAAE,kBAAkB,CAAC,OAAO,QAAQ,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,CAAC;CAC7D,GACD;IACE,QAAQ,CAAC,EAAE,KAAK,CAAC;IACjB,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,WAAW,KAAK,IAAI,CAAC;IAC7C,MAAM,CAAC,EAAE,KAAK,CAAC;CAChB,CACJ,CAAC;AA4EJ,KAAK,WAAW,GAAG,IAAI,CAAC,kBAAkB,CAAC,OAAO,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC,CAAC;AAE7E,QAAA,MAAM,MAAM,kCAAmC,WAAW,4CAEzD,CAAC;AAEF,QAAA,MAAM,MAAM;mHAtET,SAAS;4CAkEmC,WAAW;CAI3B,CAAC;AAChC,KAAK,WAAW,GAAG,SAAS,CAAC;AAE7B,OAAO,EAAE,MAAM,EAAE,CAAC;AAClB,YAAY,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,EAAE,CAAC"}
@@ -0,0 +1,3 @@
1
+ export { Select } from './Select';
2
+ export type { SelectProps, OptionProps, Option } from './Select';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/Select/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,YAAY,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC"}
@@ -0,0 +1,3 @@
1
+ export { Select } from './Select';
2
+ export type { SelectProps, OptionProps, Option } from './Select';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,YAAY,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC"}
package/package.json ADDED
@@ -0,0 +1,53 @@
1
+ {
2
+ "name": "@telegraph/select",
3
+ "version": "0.0.1",
4
+ "description": "A simple select component built on top of @telegraph/combobox",
5
+ "repository": "https://github.com/knocklabs/telegraph/tree/main/packages/select",
6
+ "author": "@knocklabs",
7
+ "license": "MIT",
8
+ "main": "./dist/cjs/index.js",
9
+ "module": "./dist/esm/index.mjs",
10
+ "types": "./dist/types/index.d.ts",
11
+ "exports": {
12
+ ".": {
13
+ "import": "./dist/esm/index.mjs",
14
+ "require": "./dist/cjs/index.js",
15
+ "types": "./dist/types/index.d.ts"
16
+ }
17
+ },
18
+ "files": [
19
+ "dist",
20
+ "README.md"
21
+ ],
22
+ "prettier": "@telegraph/prettier-config",
23
+ "scripts": {
24
+ "clean": "rm -rf dist",
25
+ "dev": "vite build --watch --emptyOutDir false",
26
+ "build": "yarn clean && vite build",
27
+ "lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
28
+ "format": "prettier \"src/**/*.{js,ts,tsx}\" --write",
29
+ "format:check": "prettier \"src/**/*.{js,ts,tsx}\" --check",
30
+ "preview": "vite preview"
31
+ },
32
+ "dependencies": {
33
+ "@telegraph/combobox": "0.0.40",
34
+ "@telegraph/helpers": "0.0.7"
35
+ },
36
+ "devDependencies": {
37
+ "@knocklabs/eslint-config": "^0.0.3",
38
+ "@knocklabs/typescript-config": "^0.0.2",
39
+ "@telegraph/postcss-config": "^0.0.20",
40
+ "@telegraph/prettier-config": "^0.0.6",
41
+ "@telegraph/vite-config": "^0.0.11",
42
+ "@types/react": "^18.2.48",
43
+ "eslint": "^8.56.0",
44
+ "react": "^18.2.0",
45
+ "react-dom": "^18.3.1",
46
+ "typescript": "^5.5.4",
47
+ "vite": "^5.3.6"
48
+ },
49
+ "peerDependencies": {
50
+ "react": "^18.2.0",
51
+ "react-dom": "^18.2.0"
52
+ }
53
+ }