@opengovsg/oui 0.0.5 → 0.0.6
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.
|
@@ -73,7 +73,7 @@ function ComboBox({
|
|
|
73
73
|
const formatMessage = reactAria.useMessageFormatter(i18nStrings);
|
|
74
74
|
const styles = ouiTheme.comboBoxStyles({ size });
|
|
75
75
|
const layout = react.useMemo(() => {
|
|
76
|
-
return new reactAriaComponents.
|
|
76
|
+
return new reactAriaComponents.ListLayout({
|
|
77
77
|
estimatedRowHeight: calculateEstimatedRowHeight(size ?? "md"),
|
|
78
78
|
...listLayoutOptions
|
|
79
79
|
});
|
|
@@ -189,7 +189,7 @@ function ComboBox({
|
|
|
189
189
|
] }),
|
|
190
190
|
description && /* @__PURE__ */ jsxRuntime.jsx(field.Description, { size, children: description }),
|
|
191
191
|
/* @__PURE__ */ jsxRuntime.jsx(field.FieldError, { size, children: errorMessage }),
|
|
192
|
-
/* @__PURE__ */ jsxRuntime.jsx(reactAriaComponents.
|
|
192
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactAriaComponents.Virtualizer, { layout, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
193
193
|
reactAriaComponents.Popover,
|
|
194
194
|
{
|
|
195
195
|
className: ouiTheme.composeRenderProps(
|
|
@@ -4,7 +4,7 @@ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
|
4
4
|
import { useMemo, useCallback } from 'react';
|
|
5
5
|
import { comboBoxItemStyles, cn, comboBoxStyles, composeTailwindRenderProps, composeRenderProps, comboBoxClearButtonStyles } from '@opengovsg/oui-theme';
|
|
6
6
|
import { useMessageFormatter } from 'react-aria';
|
|
7
|
-
import {
|
|
7
|
+
import { ListLayout, ComboBox as ComboBox$1, Input, Button, Virtualizer, Popover, ListBox, ListBoxItem, Text } from 'react-aria-components';
|
|
8
8
|
import { Label, FieldGroup, Description, FieldError } from '../field/field.js';
|
|
9
9
|
import ChevronUp from '../node_modules/.pnpm/lucide-react@0.475.0_react@19.0.0/node_modules/lucide-react/dist/esm/icons/chevron-up.js';
|
|
10
10
|
import ChevronDown from '../node_modules/.pnpm/lucide-react@0.475.0_react@19.0.0/node_modules/lucide-react/dist/esm/icons/chevron-down.js';
|
|
@@ -71,7 +71,7 @@ function ComboBox({
|
|
|
71
71
|
const formatMessage = useMessageFormatter(i18nStrings);
|
|
72
72
|
const styles = comboBoxStyles({ size });
|
|
73
73
|
const layout = useMemo(() => {
|
|
74
|
-
return new
|
|
74
|
+
return new ListLayout({
|
|
75
75
|
estimatedRowHeight: calculateEstimatedRowHeight(size ?? "md"),
|
|
76
76
|
...listLayoutOptions
|
|
77
77
|
});
|
|
@@ -187,7 +187,7 @@ function ComboBox({
|
|
|
187
187
|
] }),
|
|
188
188
|
description && /* @__PURE__ */ jsx(Description, { size, children: description }),
|
|
189
189
|
/* @__PURE__ */ jsx(FieldError, { size, children: errorMessage }),
|
|
190
|
-
/* @__PURE__ */ jsx(
|
|
190
|
+
/* @__PURE__ */ jsx(Virtualizer, { layout, children: /* @__PURE__ */ jsx(
|
|
191
191
|
Popover,
|
|
192
192
|
{
|
|
193
193
|
className: composeRenderProps(
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"combo-box.d.ts","sourceRoot":"","sources":["../../../src/combo-box/combo-box.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,EAAE,GAAG,EAAwB,MAAM,OAAO,CAAA;AACxD,OAAO,EAGL,iBAAiB,EAEjB,wBAAwB,EACxB,aAAa,EAEb,oBAAoB,EAGpB,cAAc,EACf,MAAM,sBAAsB,CAAA;AAG7B,OAAO,EAGL,aAAa,IAAI,iBAAiB,EAIlC,gBAAgB,EAChB,sBAAsB,EACtB,YAAY,
|
|
1
|
+
{"version":3,"file":"combo-box.d.ts","sourceRoot":"","sources":["../../../src/combo-box/combo-box.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,EAAE,GAAG,EAAwB,MA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
6
6
|
"type": "module",
|
|
@@ -69,15 +69,15 @@
|
|
|
69
69
|
"lodash-es": "^4.17.21",
|
|
70
70
|
"nanoid": "^5.0.9",
|
|
71
71
|
"react": "^19.0.0",
|
|
72
|
-
"react-aria": "^3.
|
|
73
|
-
"react-aria-components": "^1.
|
|
72
|
+
"react-aria": "^3.38.1",
|
|
73
|
+
"react-aria-components": "^1.7.1",
|
|
74
74
|
"react-stately": "^3.35.0",
|
|
75
75
|
"type-fest": "^4.34.1",
|
|
76
76
|
"use-deep-compare": "^1.3.0"
|
|
77
77
|
},
|
|
78
78
|
"peerDependencies": {
|
|
79
79
|
"motion": ">=11.12.0 || >=12.0.0-alpha.1",
|
|
80
|
-
"react-aria-components": "^1.
|
|
80
|
+
"react-aria-components": "^1.7.1",
|
|
81
81
|
"@opengovsg/oui-theme": "0.0.4"
|
|
82
82
|
},
|
|
83
83
|
"prettier": "@oui/prettier-config",
|