@opengovsg/oui 0.0.6 → 0.0.8
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/dist/cjs/badge/badge.cjs +42 -0
- package/dist/cjs/badge/index.cjs +8 -0
- package/dist/cjs/badge/use-badge.cjs +111 -0
- package/dist/cjs/banner/banner.cjs +1 -1
- package/dist/cjs/button/button.cjs +1 -1
- package/dist/cjs/combo-box/combo-box-fuzzy.cjs +53 -31
- package/dist/cjs/combo-box/combo-box-item.cjs +70 -0
- package/dist/cjs/combo-box/combo-box-variant-context.cjs +13 -0
- package/dist/cjs/combo-box/combo-box.cjs +47 -101
- package/dist/cjs/combo-box/index.cjs +5 -1
- package/dist/cjs/field/field.cjs +1 -1
- package/dist/cjs/govt-banner/govt-banner.cjs +1 -1
- package/dist/cjs/index.cjs +16 -3
- package/dist/cjs/input/input.cjs +1 -1
- package/dist/cjs/node_modules/.pnpm/lucide-react@0.475.0_react@19.0.0/node_modules/lucide-react/dist/esm/icons/check.cjs +19 -0
- package/dist/cjs/node_modules/.pnpm/lucide-react@0.475.0_react@19.0.0/node_modules/lucide-react/dist/esm/icons/chevrons-up-down.cjs +22 -0
- package/dist/cjs/select/index.cjs +13 -0
- package/dist/cjs/select/select-item.cjs +64 -0
- package/dist/cjs/select/select-variant-context.cjs +13 -0
- package/dist/cjs/select/select.cjs +103 -0
- package/dist/cjs/spinner/use-spinner.cjs +1 -1
- package/dist/cjs/system/react-utils/context.cjs +1 -5
- package/dist/cjs/system/react-utils/index.cjs +2 -0
- package/dist/cjs/system/react-utils/refs.cjs +12 -0
- package/dist/cjs/tag-field/tag-field-list.cjs +4 -3
- package/dist/cjs/tag-field/tag-field-trigger.cjs +1 -0
- package/dist/cjs/tag-field/tag-field.cjs +2 -2
- package/dist/cjs/tag-field/use-tag-field.cjs +1 -0
- package/dist/cjs/text-area/text-area.cjs +1 -1
- package/dist/cjs/text-area-field/text-area-field.cjs +1 -1
- package/dist/cjs/text-field/text-field.cjs +1 -1
- package/dist/cjs/toggle/toggle.cjs +1 -1
- package/dist/esm/badge/badge.js +40 -0
- package/dist/esm/badge/index.js +2 -0
- package/dist/esm/badge/use-badge.js +109 -0
- package/dist/esm/banner/banner.js +1 -1
- package/dist/esm/button/button.js +1 -1
- package/dist/esm/combo-box/combo-box-fuzzy.js +55 -33
- package/dist/esm/combo-box/combo-box-item.js +68 -0
- package/dist/esm/combo-box/combo-box-variant-context.js +10 -0
- package/dist/esm/combo-box/combo-box.js +49 -102
- package/dist/esm/combo-box/index.js +3 -1
- package/dist/esm/field/field.js +1 -1
- package/dist/esm/govt-banner/govt-banner.js +1 -1
- package/dist/esm/index.js +8 -2
- package/dist/esm/input/input.js +1 -1
- package/dist/esm/node_modules/.pnpm/lucide-react@0.475.0_react@19.0.0/node_modules/lucide-react/dist/esm/icons/check.js +14 -0
- package/dist/esm/node_modules/.pnpm/lucide-react@0.475.0_react@19.0.0/node_modules/lucide-react/dist/esm/icons/chevrons-up-down.js +17 -0
- package/dist/esm/select/index.js +4 -0
- package/dist/esm/select/select-item.js +62 -0
- package/dist/esm/select/select-variant-context.js +10 -0
- package/dist/esm/select/select.js +101 -0
- package/dist/esm/spinner/use-spinner.js +1 -1
- package/dist/esm/system/react-utils/context.js +1 -5
- package/dist/esm/system/react-utils/index.js +1 -0
- package/dist/esm/system/react-utils/refs.js +10 -0
- package/dist/esm/tag-field/tag-field-list.js +4 -3
- package/dist/esm/tag-field/tag-field-trigger.js +1 -0
- package/dist/esm/tag-field/tag-field.js +2 -2
- package/dist/esm/tag-field/use-tag-field.js +1 -0
- package/dist/esm/text-area/text-area.js +1 -1
- package/dist/esm/text-area-field/text-area-field.js +1 -1
- package/dist/esm/text-field/text-field.js +1 -1
- package/dist/esm/toggle/toggle.js +1 -1
- package/dist/types/badge/badge.d.ts +3 -0
- package/dist/types/badge/badge.d.ts.map +1 -0
- package/dist/types/badge/index.d.ts +2 -0
- package/dist/types/badge/index.d.ts.map +1 -0
- package/dist/types/badge/use-badge.d.ts +166 -0
- package/dist/types/badge/use-badge.d.ts.map +1 -0
- package/dist/types/banner/banner.d.ts +4 -3
- package/dist/types/banner/banner.d.ts.map +1 -1
- package/dist/types/button/button.d.ts +2 -11
- package/dist/types/button/button.d.ts.map +1 -1
- package/dist/types/combo-box/combo-box-fuzzy.d.ts +14 -5
- package/dist/types/combo-box/combo-box-fuzzy.d.ts.map +1 -1
- package/dist/types/combo-box/combo-box-item.d.ts +11 -0
- package/dist/types/combo-box/combo-box-item.d.ts.map +1 -0
- package/dist/types/combo-box/combo-box-variant-context.d.ts +4 -0
- package/dist/types/combo-box/combo-box-variant-context.d.ts.map +1 -0
- package/dist/types/combo-box/combo-box.d.ts +5 -21
- package/dist/types/combo-box/combo-box.d.ts.map +1 -1
- package/dist/types/combo-box/index.d.ts +2 -0
- package/dist/types/combo-box/index.d.ts.map +1 -1
- package/dist/types/field/field.d.ts +2 -2
- package/dist/types/field/field.d.ts.map +1 -1
- package/dist/types/govt-banner/govt-banner.d.ts +1 -1
- package/dist/types/govt-banner/govt-banner.d.ts.map +1 -1
- package/dist/types/index.d.mts +2 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/input/input.d.ts +3 -2
- package/dist/types/input/input.d.ts.map +1 -1
- package/dist/types/select/index.d.ts +4 -0
- package/dist/types/select/index.d.ts.map +1 -0
- package/dist/types/select/select-item.d.ts +9 -0
- package/dist/types/select/select-item.d.ts.map +1 -0
- package/dist/types/select/select-variant-context.d.ts +4 -0
- package/dist/types/select/select-variant-context.d.ts.map +1 -0
- package/dist/types/select/select.d.ts +17 -0
- package/dist/types/select/select.d.ts.map +1 -0
- package/dist/types/skip-nav-link/skip-nav-link.d.ts +3 -2
- package/dist/types/skip-nav-link/skip-nav-link.d.ts.map +1 -1
- package/dist/types/spinner/use-spinner.d.ts +1 -1
- package/dist/types/spinner/use-spinner.d.ts.map +1 -1
- package/dist/types/system/react-utils/context.d.ts +1 -5
- package/dist/types/system/react-utils/context.d.ts.map +1 -1
- package/dist/types/system/react-utils/index.d.ts +1 -0
- package/dist/types/system/react-utils/index.d.ts.map +1 -1
- package/dist/types/system/react-utils/refs.d.ts +4 -0
- package/dist/types/system/react-utils/refs.d.ts.map +1 -0
- package/dist/types/system/types.d.ts +1 -1
- package/dist/types/system/types.d.ts.map +1 -1
- package/dist/types/system/utils.d.ts +2 -2
- package/dist/types/system/utils.d.ts.map +1 -1
- package/dist/types/tag-field/tag-field-list.d.ts +10 -10
- package/dist/types/tag-field/tag-field-list.d.ts.map +1 -1
- package/dist/types/tag-field/tag-field-root.d.ts +6 -6
- package/dist/types/tag-field/tag-field-root.d.ts.map +1 -1
- package/dist/types/tag-field/tag-field-state-context.d.ts +2 -2
- package/dist/types/tag-field/tag-field-state-context.d.ts.map +1 -1
- package/dist/types/tag-field/tag-field-tag-list.d.ts +4 -5
- package/dist/types/tag-field/tag-field-tag-list.d.ts.map +1 -1
- package/dist/types/tag-field/tag-field-trigger.d.ts +2 -2
- package/dist/types/tag-field/tag-field-trigger.d.ts.map +1 -1
- package/dist/types/tag-field/tag-field.d.ts +2 -2
- package/dist/types/tag-field/tag-field.d.ts.map +1 -1
- package/dist/types/tag-field/types.d.ts +2 -7
- package/dist/types/tag-field/types.d.ts.map +1 -1
- package/dist/types/tag-field/use-tag-field-state.d.ts +4 -4
- package/dist/types/tag-field/use-tag-field-state.d.ts.map +1 -1
- package/dist/types/tag-field/use-tag-field.d.ts +7 -7
- package/dist/types/tag-field/use-tag-field.d.ts.map +1 -1
- package/dist/types/text-area/text-area.d.ts +3 -2
- package/dist/types/text-area/text-area.d.ts.map +1 -1
- package/dist/types/text-area-field/text-area-field.d.ts +3 -3
- package/dist/types/text-area-field/text-area-field.d.ts.map +1 -1
- package/dist/types/text-field/text-field.d.ts +3 -3
- package/dist/types/text-field/text-field.d.ts.map +1 -1
- package/dist/types/toggle/toggle.d.ts +3 -2
- package/dist/types/toggle/toggle.d.ts.map +1 -1
- package/package.json +6 -5
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
"use client";
|
|
3
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
4
|
+
import { useMemo } from 'react';
|
|
5
|
+
import { ListLayout, Provider, Select as Select$1, SelectValue, Popover, Virtualizer, ListBox } from 'react-aria-components';
|
|
6
|
+
import { selectStyles, composeRenderProps } from '@opengovsg/oui-theme';
|
|
7
|
+
import { mapPropsVariants } from '../system/utils.js';
|
|
8
|
+
import { SelectVariantContext } from './select-variant-context.js';
|
|
9
|
+
import ChevronsUpDown from '../node_modules/.pnpm/lucide-react@0.475.0_react@19.0.0/node_modules/lucide-react/dist/esm/icons/chevrons-up-down.js';
|
|
10
|
+
import { Label, Description } from '../field/field.js';
|
|
11
|
+
import { Button } from '../button/button.js';
|
|
12
|
+
|
|
13
|
+
const calculateEstimatedRowHeight = (size) => {
|
|
14
|
+
switch (size) {
|
|
15
|
+
case "xs":
|
|
16
|
+
return 44;
|
|
17
|
+
case "sm":
|
|
18
|
+
return 44;
|
|
19
|
+
case "md":
|
|
20
|
+
return 48;
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
function Select({
|
|
24
|
+
label,
|
|
25
|
+
description,
|
|
26
|
+
classNames,
|
|
27
|
+
...originalProps
|
|
28
|
+
}) {
|
|
29
|
+
const [_props, variantProps] = mapPropsVariants(
|
|
30
|
+
originalProps,
|
|
31
|
+
selectStyles.variantKeys
|
|
32
|
+
);
|
|
33
|
+
const { items, children, listLayoutOptions, ...props } = _props;
|
|
34
|
+
const styles = selectStyles(variantProps);
|
|
35
|
+
const layout = useMemo(() => {
|
|
36
|
+
return new ListLayout({
|
|
37
|
+
estimatedRowHeight: calculateEstimatedRowHeight(
|
|
38
|
+
variantProps.size ?? "md"
|
|
39
|
+
),
|
|
40
|
+
...listLayoutOptions
|
|
41
|
+
});
|
|
42
|
+
}, [listLayoutOptions, variantProps.size]);
|
|
43
|
+
return /* @__PURE__ */ jsx(Provider, { values: [[SelectVariantContext, variantProps]], children: /* @__PURE__ */ jsxs(
|
|
44
|
+
Select$1,
|
|
45
|
+
{
|
|
46
|
+
className: composeRenderProps(
|
|
47
|
+
props.className,
|
|
48
|
+
(className, renderProps) => styles.base({ className, ...renderProps })
|
|
49
|
+
),
|
|
50
|
+
...props,
|
|
51
|
+
children: [
|
|
52
|
+
label && /* @__PURE__ */ jsx(Label, { size: variantProps.size, className: classNames?.label, children: label }),
|
|
53
|
+
/* @__PURE__ */ jsxs(
|
|
54
|
+
Button,
|
|
55
|
+
{
|
|
56
|
+
size: variantProps.size,
|
|
57
|
+
variant: variantProps.variant ?? selectStyles.defaultVariants.variant,
|
|
58
|
+
color: variantProps.color ?? selectStyles.defaultVariants.color,
|
|
59
|
+
className: composeRenderProps(
|
|
60
|
+
classNames?.trigger,
|
|
61
|
+
(className, renderProps) => styles.trigger({ className, ...renderProps })
|
|
62
|
+
),
|
|
63
|
+
children: [
|
|
64
|
+
/* @__PURE__ */ jsx(
|
|
65
|
+
SelectValue,
|
|
66
|
+
{
|
|
67
|
+
className: styles.selectedText({
|
|
68
|
+
className: classNames?.selectedText
|
|
69
|
+
})
|
|
70
|
+
}
|
|
71
|
+
),
|
|
72
|
+
/* @__PURE__ */ jsx(ChevronsUpDown, { className: "h-4 w-4" })
|
|
73
|
+
]
|
|
74
|
+
}
|
|
75
|
+
),
|
|
76
|
+
description && /* @__PURE__ */ jsx(
|
|
77
|
+
Description,
|
|
78
|
+
{
|
|
79
|
+
size: variantProps.size,
|
|
80
|
+
className: classNames?.description,
|
|
81
|
+
children: description
|
|
82
|
+
}
|
|
83
|
+
),
|
|
84
|
+
/* @__PURE__ */ jsx(Popover, { className: styles.popover({ className: classNames?.popover }), children: /* @__PURE__ */ jsx(Virtualizer, { layout, children: /* @__PURE__ */ jsx(
|
|
85
|
+
ListBox,
|
|
86
|
+
{
|
|
87
|
+
items,
|
|
88
|
+
shouldFocusWrap: true,
|
|
89
|
+
className: composeRenderProps(
|
|
90
|
+
classNames?.list,
|
|
91
|
+
(className, renderProps) => styles.list({ className, ...renderProps })
|
|
92
|
+
),
|
|
93
|
+
children
|
|
94
|
+
}
|
|
95
|
+
) }) })
|
|
96
|
+
]
|
|
97
|
+
}
|
|
98
|
+
) });
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
export { Select };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
"use client";
|
|
3
3
|
import { useMemo, useCallback } from 'react';
|
|
4
|
-
import { spinnerStyles, cn } from '@opengovsg/oui-theme';
|
|
5
4
|
import { useDeepCompareMemo } from 'use-deep-compare';
|
|
5
|
+
import { spinnerStyles, cn } from '@opengovsg/oui-theme';
|
|
6
6
|
import { mapPropsVariants } from '../system/utils.js';
|
|
7
7
|
|
|
8
8
|
const useSpinner = (originalProps) => {
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
"use client";
|
|
2
3
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
3
4
|
import { createContext, useContext, createElement } from 'react';
|
|
4
|
-
import { tagFieldItemStyles, dataAttr } from '@opengovsg/oui-theme';
|
|
5
5
|
import { useContextProps } from 'react-aria-components';
|
|
6
|
+
import { tagFieldItemStyles, dataAttr } from '@opengovsg/oui-theme';
|
|
6
7
|
import { forwardRefGeneric } from '../system/utils.js';
|
|
7
8
|
import { TagFieldStateContext } from './tag-field-state-context.js';
|
|
8
9
|
|
|
@@ -54,8 +55,8 @@ const TagFieldListInner = (props, ref) => {
|
|
|
54
55
|
item,
|
|
55
56
|
isHighlighted: highlightedIndex === virtualRow.index,
|
|
56
57
|
key: virtualRow.key,
|
|
57
|
-
|
|
58
|
-
|
|
58
|
+
itemClassNames,
|
|
59
|
+
...itemProps
|
|
59
60
|
};
|
|
60
61
|
if (typeof props.children === "function") {
|
|
61
62
|
return props.children(childProps);
|
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
"use client";
|
|
3
3
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
4
4
|
import { createElement } from 'react';
|
|
5
|
-
import { tagFieldStyles } from '@opengovsg/oui-theme';
|
|
6
5
|
import { composeRenderProps, Popover } from 'react-aria-components';
|
|
6
|
+
import { tagFieldStyles } from '@opengovsg/oui-theme';
|
|
7
|
+
import { Input } from '../input/input.js';
|
|
7
8
|
import { TagFieldList, TagFieldListItem } from './tag-field-list.js';
|
|
8
9
|
import { TagFieldRoot } from './tag-field-root.js';
|
|
9
10
|
import { TagFieldTagList } from './tag-field-tag-list.js';
|
|
10
11
|
import { TagFieldTrigger } from './tag-field-trigger.js';
|
|
11
12
|
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';
|
|
12
13
|
import { Label, FieldGroup, Description, FieldError } from '../field/field.js';
|
|
13
|
-
import { Input } from '../input/input.js';
|
|
14
14
|
|
|
15
15
|
function TagField({
|
|
16
16
|
classNames,
|
|
@@ -125,6 +125,7 @@ function useTagField(props, state) {
|
|
|
125
125
|
});
|
|
126
126
|
const { isInvalid, validationErrors, validationDetails } = state.displayValidation;
|
|
127
127
|
const inputProps = getInputProps({
|
|
128
|
+
placeholder: props.placeholder,
|
|
128
129
|
ref: inputRef,
|
|
129
130
|
"aria-label": props["aria-label"],
|
|
130
131
|
"aria-labelledby": props["aria-labelledby"],
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
"use client";
|
|
3
3
|
import { jsx } from 'react/jsx-runtime';
|
|
4
4
|
import { forwardRef } from 'react';
|
|
5
|
-
import { composeRenderProps, textAreaStyles } from '@opengovsg/oui-theme';
|
|
6
5
|
import { TextArea as TextArea$1 } from 'react-aria-components';
|
|
6
|
+
import { composeRenderProps, textAreaStyles } from '@opengovsg/oui-theme';
|
|
7
7
|
|
|
8
8
|
const TextArea = forwardRef(
|
|
9
9
|
({ size, variant, isDisabled, ...props }, ref) => {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
"use client";
|
|
3
3
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
4
|
-
import { composeTailwindRenderProps } from '@opengovsg/oui-theme';
|
|
5
4
|
import { TextField } from 'react-aria-components';
|
|
5
|
+
import { composeTailwindRenderProps } from '@opengovsg/oui-theme';
|
|
6
6
|
import { TextArea } from '../text-area/text-area.js';
|
|
7
7
|
import { Label, Description, FieldError } from '../field/field.js';
|
|
8
8
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
"use client";
|
|
3
3
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
4
|
-
import { composeTailwindRenderProps } from '@opengovsg/oui-theme';
|
|
5
4
|
import { TextField as TextField$1 } from 'react-aria-components';
|
|
5
|
+
import { composeTailwindRenderProps } from '@opengovsg/oui-theme';
|
|
6
6
|
import { Input } from '../input/input.js';
|
|
7
7
|
import { Label, Description, FieldError } from '../field/field.js';
|
|
8
8
|
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
"use client";
|
|
3
3
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
4
4
|
import { useCallback, cloneElement } from 'react';
|
|
5
|
-
import { toggleStyles, composeTailwindRenderProps } from '@opengovsg/oui-theme';
|
|
6
5
|
import { mergeProps } from 'react-aria';
|
|
7
6
|
import { Switch } from 'react-aria-components';
|
|
7
|
+
import { toggleStyles, composeTailwindRenderProps } from '@opengovsg/oui-theme';
|
|
8
8
|
import { mapPropsVariants } from '../system/utils.js';
|
|
9
9
|
|
|
10
10
|
const Toggle = ({
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"badge.d.ts","sourceRoot":"","sources":["../../../src/badge/badge.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAGhD,eAAO,MAAM,KAAK,uHAwChB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/badge/index.tsx"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAA"}
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
import type { PressEvent } from "@react-types/shared";
|
|
2
|
+
import type { ReactNode } from "react";
|
|
3
|
+
import type { BadgeSlots, BadgeVariantProps, SlotsToClasses } from "@opengovsg/oui-theme";
|
|
4
|
+
import type { ReactRef } from "../system/react-utils";
|
|
5
|
+
import type { HtmlUiProps, PropGetter } from "../system/types";
|
|
6
|
+
export interface UseBadgeProps extends HtmlUiProps, BadgeVariantProps {
|
|
7
|
+
ref?: ReactRef<HTMLDivElement | null>;
|
|
8
|
+
/**
|
|
9
|
+
* Element to be rendered in the left side of the badge.
|
|
10
|
+
*/
|
|
11
|
+
startContent?: React.ReactNode;
|
|
12
|
+
/**
|
|
13
|
+
* Element to be rendered in the right side of the badge.
|
|
14
|
+
* if you pass this prop and the `onClose` prop, the passed element
|
|
15
|
+
* will have the close button props and it will be rendered instead of the
|
|
16
|
+
* default close button.
|
|
17
|
+
*/
|
|
18
|
+
endContent?: React.ReactNode;
|
|
19
|
+
/**
|
|
20
|
+
* Classname or List of classes to change the classNames of the element.
|
|
21
|
+
* if `className` is passed, it will be added to the base slot.
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* ```ts
|
|
25
|
+
* <Badge classNames={{
|
|
26
|
+
* base:"base-classes",
|
|
27
|
+
* dot: "dot-classes",
|
|
28
|
+
* content: "content-classes",
|
|
29
|
+
* closeButton: "close-button-classes",
|
|
30
|
+
* }} />
|
|
31
|
+
* ```
|
|
32
|
+
*/
|
|
33
|
+
classNames?: SlotsToClasses<BadgeSlots | "closeButton">;
|
|
34
|
+
/**
|
|
35
|
+
* Callback fired when the badge is closed. if you pass this prop,
|
|
36
|
+
* the badge will display a close button in the `endContent` slot.
|
|
37
|
+
* @param e PressEvent
|
|
38
|
+
*/
|
|
39
|
+
onClose?: (e: PressEvent) => void;
|
|
40
|
+
}
|
|
41
|
+
export declare function useBadge(originalProps: UseBadgeProps): {
|
|
42
|
+
Component: import("../system/types").As<any>;
|
|
43
|
+
children: ReactNode;
|
|
44
|
+
slots: {
|
|
45
|
+
closeButton: import("tailwind-variants").TVReturnType<{
|
|
46
|
+
size: {
|
|
47
|
+
xs: string;
|
|
48
|
+
sm: string;
|
|
49
|
+
md: string;
|
|
50
|
+
};
|
|
51
|
+
}, undefined, string, {
|
|
52
|
+
responsiveVariants?: boolean | (string | number | symbol)[] | {
|
|
53
|
+
size?: boolean | (string | number | symbol)[] | undefined;
|
|
54
|
+
isFocusVisible?: boolean | (string | number | symbol)[] | undefined;
|
|
55
|
+
} | undefined;
|
|
56
|
+
} & import("tailwind-variants/dist/config.js").TWMConfig & {
|
|
57
|
+
twMergeConfig: {
|
|
58
|
+
extend: {
|
|
59
|
+
theme: {};
|
|
60
|
+
classGroups: {
|
|
61
|
+
prose: {
|
|
62
|
+
prose: (() => boolean)[];
|
|
63
|
+
}[];
|
|
64
|
+
};
|
|
65
|
+
};
|
|
66
|
+
};
|
|
67
|
+
}, {
|
|
68
|
+
isFocusVisible: {
|
|
69
|
+
false: string;
|
|
70
|
+
true: string;
|
|
71
|
+
};
|
|
72
|
+
}, undefined, import("tailwind-variants").TVReturnType<{
|
|
73
|
+
isFocusVisible: {
|
|
74
|
+
false: string;
|
|
75
|
+
true: string;
|
|
76
|
+
};
|
|
77
|
+
}, undefined, "outline-offset-2 outline-none", {
|
|
78
|
+
responsiveVariants?: boolean | (string | number | symbol)[] | {
|
|
79
|
+
isFocusVisible?: boolean | (string | number | symbol)[] | undefined;
|
|
80
|
+
} | undefined;
|
|
81
|
+
} & import("tailwind-variants/dist/config.js").TWMConfig & {
|
|
82
|
+
twMergeConfig: {
|
|
83
|
+
extend: {
|
|
84
|
+
theme: {};
|
|
85
|
+
classGroups: {
|
|
86
|
+
prose: {
|
|
87
|
+
prose: (() => boolean)[];
|
|
88
|
+
}[];
|
|
89
|
+
};
|
|
90
|
+
};
|
|
91
|
+
};
|
|
92
|
+
}, {
|
|
93
|
+
isFocusVisible: {
|
|
94
|
+
false: string;
|
|
95
|
+
true: string;
|
|
96
|
+
};
|
|
97
|
+
}, undefined, import("tailwind-variants").TVReturnType<{
|
|
98
|
+
isFocusVisible: {
|
|
99
|
+
false: string;
|
|
100
|
+
true: string;
|
|
101
|
+
};
|
|
102
|
+
}, undefined, "outline-offset-2 outline-none", import("tailwind-variants/dist/config.js").TVConfig<{
|
|
103
|
+
isFocusVisible: {
|
|
104
|
+
false: string;
|
|
105
|
+
true: string;
|
|
106
|
+
};
|
|
107
|
+
}, {
|
|
108
|
+
isFocusVisible: {
|
|
109
|
+
false: string;
|
|
110
|
+
true: string;
|
|
111
|
+
};
|
|
112
|
+
}>, unknown, unknown, undefined>>>;
|
|
113
|
+
base: ((slotProps?: ({
|
|
114
|
+
size?: "md" | "sm" | "xs" | undefined;
|
|
115
|
+
color?: "sub" | "main" | "neutral" | "critical" | "warning" | "success" | undefined;
|
|
116
|
+
radius?: "lg" | "md" | "sm" | "none" | "full" | undefined;
|
|
117
|
+
variant?: "solid" | "outline" | "dot" | "subtle" | undefined;
|
|
118
|
+
isDisabled?: boolean | undefined;
|
|
119
|
+
isCloseable?: boolean | undefined;
|
|
120
|
+
} & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | undefined) => string) & ((slotProps?: ({
|
|
121
|
+
size?: "md" | "sm" | "xs" | undefined;
|
|
122
|
+
color?: "sub" | "main" | "neutral" | "critical" | "warning" | "success" | undefined;
|
|
123
|
+
radius?: "lg" | "md" | "sm" | "none" | "full" | undefined;
|
|
124
|
+
variant?: "solid" | "outline" | "dot" | "subtle" | undefined;
|
|
125
|
+
isDisabled?: boolean | undefined;
|
|
126
|
+
isCloseable?: boolean | undefined;
|
|
127
|
+
} & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | undefined) => string);
|
|
128
|
+
dot: ((slotProps?: ({
|
|
129
|
+
size?: "md" | "sm" | "xs" | undefined;
|
|
130
|
+
color?: "sub" | "main" | "neutral" | "critical" | "warning" | "success" | undefined;
|
|
131
|
+
radius?: "lg" | "md" | "sm" | "none" | "full" | undefined;
|
|
132
|
+
variant?: "solid" | "outline" | "dot" | "subtle" | undefined;
|
|
133
|
+
isDisabled?: boolean | undefined;
|
|
134
|
+
isCloseable?: boolean | undefined;
|
|
135
|
+
} & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | undefined) => string) & ((slotProps?: ({
|
|
136
|
+
size?: "md" | "sm" | "xs" | undefined;
|
|
137
|
+
color?: "sub" | "main" | "neutral" | "critical" | "warning" | "success" | undefined;
|
|
138
|
+
radius?: "lg" | "md" | "sm" | "none" | "full" | undefined;
|
|
139
|
+
variant?: "solid" | "outline" | "dot" | "subtle" | undefined;
|
|
140
|
+
isDisabled?: boolean | undefined;
|
|
141
|
+
isCloseable?: boolean | undefined;
|
|
142
|
+
} & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | undefined) => string);
|
|
143
|
+
content: ((slotProps?: ({
|
|
144
|
+
size?: "md" | "sm" | "xs" | undefined;
|
|
145
|
+
color?: "sub" | "main" | "neutral" | "critical" | "warning" | "success" | undefined;
|
|
146
|
+
radius?: "lg" | "md" | "sm" | "none" | "full" | undefined;
|
|
147
|
+
variant?: "solid" | "outline" | "dot" | "subtle" | undefined;
|
|
148
|
+
isDisabled?: boolean | undefined;
|
|
149
|
+
isCloseable?: boolean | undefined;
|
|
150
|
+
} & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | undefined) => string) & ((slotProps?: ({
|
|
151
|
+
size?: "md" | "sm" | "xs" | undefined;
|
|
152
|
+
color?: "sub" | "main" | "neutral" | "critical" | "warning" | "success" | undefined;
|
|
153
|
+
radius?: "lg" | "md" | "sm" | "none" | "full" | undefined;
|
|
154
|
+
variant?: "solid" | "outline" | "dot" | "subtle" | undefined;
|
|
155
|
+
isDisabled?: boolean | undefined;
|
|
156
|
+
isCloseable?: boolean | undefined;
|
|
157
|
+
} & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | undefined) => string);
|
|
158
|
+
};
|
|
159
|
+
classNames: SlotsToClasses<"content" | "base" | "dot" | "closeButton"> | undefined;
|
|
160
|
+
isCloseable: boolean;
|
|
161
|
+
startContent: import("react").DetailedReactHTMLElement<import("react").HTMLAttributes<HTMLElement>, HTMLElement> | null;
|
|
162
|
+
endContent: import("react").DetailedReactHTMLElement<import("react").HTMLAttributes<HTMLElement>, HTMLElement> | null;
|
|
163
|
+
getCloseButtonProps: PropGetter;
|
|
164
|
+
getChipProps: PropGetter;
|
|
165
|
+
};
|
|
166
|
+
//# sourceMappingURL=use-badge.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-badge.d.ts","sourceRoot":"","sources":["../../../src/badge/use-badge.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAA;AACrD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAOtC,OAAO,KAAK,EACV,UAAU,EACV,iBAAiB,EACjB,cAAc,EACf,MAAM,sBAAsB,CAAA;AAG7B,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AACrD,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAI9D,MAAM,WAAW,aAAc,SAAQ,WAAW,EAAE,iBAAiB;IACnE,GAAG,CAAC,EAAE,QAAQ,CAAC,cAAc,GAAG,IAAI,CAAC,CAAA;IACrC;;OAEG;IACH,YAAY,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAC9B;;;;;OAKG;IACH,UAAU,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAE5B;;;;;;;;;;;;;OAaG;IACH,UAAU,CAAC,EAAE,cAAc,CAAC,UAAU,GAAG,aAAa,CAAC,CAAA;IACvD;;;;OAIG;IACH,OAAO,CAAC,EAAE,CAAC,CAAC,EAAE,UAAU,KAAK,IAAI,CAAA;CAClC;AAiBD,wBAAgB,QAAQ,CAAC,aAAa,EAAE,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAiGpD"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { ReactNode } from "react";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
import type { AriaDisclosureProps } from "react-aria";
|
|
3
|
+
import type { BannerSlots, SlotsToClasses, VariantProps } from "@opengovsg/oui-theme";
|
|
4
|
+
import { bannerStyles } from "@opengovsg/oui-theme";
|
|
4
5
|
interface BannerProps extends VariantProps<typeof bannerStyles>, AriaDisclosureProps {
|
|
5
6
|
/**
|
|
6
7
|
* The banner start content. Will default to the relevant icons based on the `variant` prop.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"banner.d.ts","sourceRoot":"","sources":["../../../src/banner/banner.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,
|
|
1
|
+
{"version":3,"file":"banner.d.ts","sourceRoot":"","sources":["../../../src/banner/banner.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACtC,OAAO,KAAK,EAAE,mBAAmB,EAAoB,MAAM,YAAY,CAAA;AAMvE,OAAO,KAAK,EACV,WAAW,EACX,cAAc,EACd,YAAY,EACb,MAAM,sBAAsB,CAAA;AAC7B,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AAInD,UAAU,WACR,SAAQ,YAAY,CAAC,OAAO,YAAY,CAAC,EACvC,mBAAmB;IACrB;;OAEG;IACH,YAAY,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAC9B,QAAQ,EAAE,SAAS,CAAA;IACnB;;OAEG;IACH,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,UAAU,CAAC,EAAE,cAAc,CAAC,WAAW,CAAC,CAAA;CACzC;AAiBD,eAAO,MAAM,MAAM,2IAUhB,WAAW,mDA6Eb,CAAA"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import type { VariantProps } from "@opengovsg/oui-theme";
|
|
2
1
|
import type { ButtonProps as AriaButtonProps } from "react-aria-components";
|
|
3
|
-
import {
|
|
4
|
-
interface
|
|
2
|
+
import type { ButtonVariantProps } from "@opengovsg/oui-theme";
|
|
3
|
+
export interface ButtonProps extends Omit<AriaButtonProps, "children">, ButtonVariantProps {
|
|
5
4
|
/**
|
|
6
5
|
* Whether the button should display a ripple effect on press.
|
|
7
6
|
* @defaultValue false
|
|
@@ -32,17 +31,9 @@ interface _ButtonProps extends Omit<AriaButtonProps, "children">, VariantProps<t
|
|
|
32
31
|
*/
|
|
33
32
|
spinnerPlacement?: "start" | "end";
|
|
34
33
|
}
|
|
35
|
-
export type ButtonProps = Omit<_ButtonProps, "aria-label"> & ({
|
|
36
|
-
isIconOnly: true;
|
|
37
|
-
"aria-label": string;
|
|
38
|
-
} | {
|
|
39
|
-
isIconOnly?: false;
|
|
40
|
-
"aria-label"?: string;
|
|
41
|
-
});
|
|
42
34
|
/**
|
|
43
35
|
* You probably do not want to use this component if you are rendering a link.
|
|
44
36
|
* Use `LinkButton` component instead.
|
|
45
37
|
*/
|
|
46
38
|
export declare const Button: import("react").ForwardRefExoticComponent<ButtonProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
47
|
-
export {};
|
|
48
39
|
//# sourceMappingURL=button.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../../src/button/button.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../../src/button/button.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,IAAI,eAAe,EAAE,MAAM,uBAAuB,CAAA;AAK3E,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAA;AAO9D,MAAM,WAAW,WACf,SAAQ,IAAI,CAAC,eAAe,EAAE,UAAU,CAAC,EACvC,kBAAkB;IACpB;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;IACzB;;OAEG;IACH,YAAY,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAC9B;;OAEG;IACH,UAAU,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAC5B;;;OAGG;IACH,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAEzB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAA;IAEpB;;;OAGG;IACH,gBAAgB,CAAC,EAAE,OAAO,GAAG,KAAK,CAAA;CACnC;AAED;;;GAGG;AACH,eAAO,MAAM,MAAM,2GAwElB,CAAA"}
|
|
@@ -1,11 +1,20 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { SetRequired } from "type-fest";
|
|
3
|
-
import {
|
|
1
|
+
import type { Key } from "react-aria";
|
|
2
|
+
import type { SetRequired } from "type-fest";
|
|
3
|
+
import type { ComboBoxItemSlots, SlotsToClasses } from "@opengovsg/oui-theme";
|
|
4
|
+
import type { ComboBoxProps } from "./combo-box";
|
|
5
|
+
import { ComboBoxItem } from "./combo-box-item";
|
|
6
|
+
type ComboBoxItem = {
|
|
7
|
+
id: Key;
|
|
8
|
+
textValue: string;
|
|
9
|
+
description?: string;
|
|
10
|
+
};
|
|
4
11
|
export interface ComboBoxFuzzyProps<T extends ComboBoxItem = ComboBoxItem> extends SetRequired<ComboBoxProps<T>, "inputValue" | "onInputChange" | "onSelectionChange" | "selectedKey" | "items"> {
|
|
5
|
-
itemClassNames?:
|
|
12
|
+
itemClassNames?: SlotsToClasses<ComboBoxItemSlots> & SlotsToClasses<"highlight">;
|
|
6
13
|
}
|
|
7
14
|
/**
|
|
8
15
|
* Controlled variant of ComboBox, allows for fuzzy search and item highlight.
|
|
16
|
+
* @deprecated Use ComboBox instead (and bring your own fuzzysearch).
|
|
9
17
|
*/
|
|
10
|
-
export declare function ComboBoxFuzzy<T extends ComboBoxItem = ComboBoxItem>(
|
|
18
|
+
export declare function ComboBoxFuzzy<T extends ComboBoxItem = ComboBoxItem>(originalProps: ComboBoxFuzzyProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
export {};
|
|
11
20
|
//# sourceMappingURL=combo-box-fuzzy.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"combo-box-fuzzy.d.ts","sourceRoot":"","sources":["../../../src/combo-box/combo-box-fuzzy.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"combo-box-fuzzy.d.ts","sourceRoot":"","sources":["../../../src/combo-box/combo-box-fuzzy.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,YAAY,CAAA;AACrC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAA;AAK5C,OAAO,KAAK,EAEV,iBAAiB,EACjB,cAAc,EACf,MAAM,sBAAsB,CAAA;AAO7B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAGhD,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAA;AAQ/C,KAAK,YAAY,GAAG;IAClB,EAAE,EAAE,GAAG,CAAA;IACP,SAAS,EAAE,MAAM,CAAA;IACjB,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB,CAAA;AAwBD,MAAM,WAAW,kBAAkB,CAAC,CAAC,SAAS,YAAY,GAAG,YAAY,CACvE,SAAQ,WAAW,CACjB,aAAa,CAAC,CAAC,CAAC,EACd,YAAY,GACZ,eAAe,GACf,mBAAmB,GACnB,aAAa,GACb,OAAO,CACV;IACD,cAAc,CAAC,EAAE,cAAc,CAAC,iBAAiB,CAAC,GAChD,cAAc,CAAC,WAAW,CAAC,CAAA;CAC9B;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,CAAC,SAAS,YAAY,GAAG,YAAY,EACjE,aAAa,EAAE,kBAAkB,CAAC,CAAC,CAAC,2CAwGrC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { ListBoxItemProps } from "react-aria-components";
|
|
2
|
+
import type { ComboBoxItemSlots, ComboBoxItemVariantProps, SlotsToClasses } from "@opengovsg/oui-theme";
|
|
3
|
+
export interface ComboBoxItemProps extends ListBoxItemProps, ComboBoxItemVariantProps {
|
|
4
|
+
/**
|
|
5
|
+
* Description for the item, if any
|
|
6
|
+
*/
|
|
7
|
+
description?: React.ReactNode;
|
|
8
|
+
classNames?: SlotsToClasses<ComboBoxItemSlots>;
|
|
9
|
+
}
|
|
10
|
+
export declare const ComboBoxItem: import("../system/utils").InternalForwardRefRenderFunction<import("../system/types").As, ComboBoxItemProps, never>;
|
|
11
|
+
//# sourceMappingURL=combo-box-item.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"combo-box-item.d.ts","sourceRoot":"","sources":["../../../src/combo-box/combo-box-item.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AAS7D,OAAO,KAAK,EACV,iBAAiB,EACjB,wBAAwB,EACxB,cAAc,EACf,MAAM,sBAAsB,CAAA;AAM7B,MAAM,WAAW,iBACf,SAAQ,gBAAgB,EACtB,wBAAwB;IAC1B;;OAEG;IACH,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAC7B,UAAU,CAAC,EAAE,cAAc,CAAC,iBAAiB,CAAC,CAAA;CAC/C;AAED,eAAO,MAAM,YAAY,oHAgEvB,CAAA"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { ContextValue } from "react-aria-components";
|
|
2
|
+
import type { ComboBoxVariantProps } from "@opengovsg/oui-theme";
|
|
3
|
+
export declare const ComboBoxVariantContext: import("react").Context<ContextValue<ComboBoxVariantProps, any>>, useComboBoxVariantContext: () => ContextValue<ComboBoxVariantProps, any>;
|
|
4
|
+
//# sourceMappingURL=combo-box-variant-context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"combo-box-variant-context.d.ts","sourceRoot":"","sources":["../../../src/combo-box/combo-box-variant-context.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAA;AAEzD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAA;AAIhE,eAAO,MAAO,sBAAsB,oEAAE,yBAAyB,+CAO3D,CAAA"}
|
|
@@ -1,12 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
export type ComboBoxItem = {
|
|
5
|
-
value: string;
|
|
6
|
-
name: string;
|
|
7
|
-
description?: string;
|
|
8
|
-
};
|
|
9
|
-
export interface ComboBoxProps<T extends ComboBoxItem = ComboBoxItem> extends ComboBoxVariantProps, Omit<AriaComboBoxProps<T>, "children"> {
|
|
1
|
+
import type { ComboBoxProps as AriaComboBoxProps, ListBoxProps, ListLayoutOptions, ValidationResult } from "react-aria-components";
|
|
2
|
+
import type { ComboBoxSlots, ComboBoxVariantProps, SlotsToClasses } from "@opengovsg/oui-theme";
|
|
3
|
+
export interface ComboBoxProps<T extends object> extends ComboBoxVariantProps, Omit<AriaComboBoxProps<T>, "children"> {
|
|
10
4
|
label?: string;
|
|
11
5
|
/** The list of ComboBox items (uncontrolled). */
|
|
12
6
|
defaultItems?: T[];
|
|
@@ -15,12 +9,10 @@ export interface ComboBoxProps<T extends ComboBoxItem = ComboBoxItem> extends Co
|
|
|
15
9
|
description?: string | null;
|
|
16
10
|
errorMessage?: string | ((validation: ValidationResult) => string);
|
|
17
11
|
classNames?: SlotsToClasses<ComboBoxSlots> & SlotsToClasses<"clearButton" | "emptyState">;
|
|
18
|
-
itemClassNames?: SlotsToClasses<ComboBoxItemSlots>;
|
|
19
12
|
/**
|
|
20
13
|
* Any additional props to be spread to the list layout.
|
|
21
14
|
*/
|
|
22
15
|
listLayoutOptions?: ListLayoutOptions;
|
|
23
|
-
children?: (item: T) => JSX.Element;
|
|
24
16
|
/** Values that should invalidate the item cache when using dynamic collections. */
|
|
25
17
|
dependencies?: ListBoxProps<T>["dependencies"];
|
|
26
18
|
/**
|
|
@@ -33,18 +25,10 @@ export interface ComboBoxProps<T extends ComboBoxItem = ComboBoxItem> extends Co
|
|
|
33
25
|
*/
|
|
34
26
|
onClear?: () => void;
|
|
35
27
|
renderEmptyState?: ListBoxProps<T>["renderEmptyState"];
|
|
28
|
+
children?: ListBoxProps<T>["children"];
|
|
36
29
|
}
|
|
37
30
|
export declare function ComboBoxEmptyState({ size, className, }: Pick<ComboBoxVariantProps, "size"> & {
|
|
38
31
|
className?: string;
|
|
39
32
|
}): import("react/jsx-runtime").JSX.Element;
|
|
40
|
-
export declare function ComboBox<T extends
|
|
41
|
-
export interface ComboBoxItemProps extends ListBoxItemProps, ComboBoxItemVariantProps {
|
|
42
|
-
label: React.ReactNode | ((props: ListBoxItemRenderProps) => React.ReactNode);
|
|
43
|
-
/**
|
|
44
|
-
* Description for the item, if any
|
|
45
|
-
*/
|
|
46
|
-
description?: React.ReactNode | ((props: ListBoxItemRenderProps) => React.ReactNode);
|
|
47
|
-
classNames?: SlotsToClasses<ComboBoxItemSlots>;
|
|
48
|
-
}
|
|
49
|
-
export declare function ComboBoxItem({ className, size, description, label, classNames, ...props }: ComboBoxItemProps): import("react/jsx-runtime").JSX.Element;
|
|
33
|
+
export declare function ComboBox<T extends object>(originalProps: ComboBoxProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
50
34
|
//# sourceMappingURL=combo-box.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"combo-box.d.ts","sourceRoot":"","sources":["../../../src/combo-box/combo-box.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"combo-box.d.ts","sourceRoot":"","sources":["../../../src/combo-box/combo-box.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,aAAa,IAAI,iBAAiB,EAClC,YAAY,EAEZ,iBAAiB,EACjB,gBAAgB,EACjB,MAAM,uBAAuB,CAAA;AAe9B,OAAO,KAAK,EACV,aAAa,EACb,oBAAoB,EACpB,cAAc,EACf,MAAM,sBAAsB,CAAA;AAc7B,MAAM,WAAW,aAAa,CAAC,CAAC,SAAS,MAAM,CAC7C,SAAQ,oBAAoB,EAC1B,IAAI,CAAC,iBAAiB,CAAC,CAAC,CAAC,EAAE,UAAU,CAAC;IACxC,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,iDAAiD;IACjD,YAAY,CAAC,EAAE,CAAC,EAAE,CAAA;IAClB,+CAA+C;IAC/C,KAAK,CAAC,EAAE,CAAC,EAAE,CAAA;IACX,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC3B,YAAY,CAAC,EAAE,MAAM,GAAG,CAAC,CAAC,UAAU,EAAE,gBAAgB,KAAK,MAAM,CAAC,CAAA;IAClE,UAAU,CAAC,EAAE,cAAc,CAAC,aAAa,CAAC,GACxC,cAAc,CAAC,aAAa,GAAG,YAAY,CAAC,CAAA;IAC9C;;OAEG;IACH,iBAAiB,CAAC,EAAE,iBAAiB,CAAA;IAErC,mFAAmF;IACnF,YAAY,CAAC,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC,cAAc,CAAC,CAAA;IAE9C;;;;;;;OAOG;IACH,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;IAEpB,gBAAgB,CAAC,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC,kBAAkB,CAAC,CAAA;IAEtD,QAAQ,CAAC,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAA;CACvC;AAkCD,wBAAgB,kBAAkB,CAAC,EACjC,IAAI,EACJ,SAAS,GACV,EAAE,IAAI,CAAC,oBAAoB,EAAE,MAAM,CAAC,GAAG;IAAE,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,2CAY7D;AAED,wBAAgB,QAAQ,CAAC,CAAC,SAAS,MAAM,EAAE,aAAa,EAAE,aAAa,CAAC,CAAC,CAAC,2CA6JzE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/combo-box/index.tsx"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA;AAC3B,cAAc,mBAAmB,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/combo-box/index.tsx"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA;AAC3B,cAAc,mBAAmB,CAAA;AACjC,cAAc,kBAAkB,CAAA;AAChC,cAAc,6BAA6B,CAAA"}
|