@worldresources/wri-design-systems 2.208.2 → 2.209.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.
- package/dist/index.cjs.js +269 -226
- package/dist/index.d.ts +24 -5
- package/dist/index.esm.js +266 -223
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -132,6 +132,8 @@ type ComboboxLabels = {
|
|
|
132
132
|
toggleOptionsLabel: string;
|
|
133
133
|
/** Visible text shown when no results match. Rendered as JSX child. Default: "No items found" */
|
|
134
134
|
noItemsFoundLabel: ReactNodeLabel;
|
|
135
|
+
/** Builds the visible text for the create-new-option row. Default: (inputValue) => `Create “${inputValue}”` */
|
|
136
|
+
createOptionLabel: (inputValue: string) => ReactNodeLabel;
|
|
135
137
|
};
|
|
136
138
|
/** Labels for CloseButton internal UI strings. */
|
|
137
139
|
type CloseButtonLabels = {
|
|
@@ -1230,11 +1232,12 @@ type TextInputProps = Omit<InputProps, 'size' | 'variant' | 'colorPalette' | 'de
|
|
|
1230
1232
|
|
|
1231
1233
|
declare const TextInput: ({ label, caption, placeholder, errorMessage, required, disabled, size, showOptionalLabel, noMarginBottom, defaultValue, onChange, onFocus, onBlur, labels, value: controlledValue, ...rest }: TextInputProps) => _emotion_react_jsx_runtime.JSX.Element;
|
|
1232
1234
|
|
|
1235
|
+
type ComboboxItem = {
|
|
1236
|
+
label: string;
|
|
1237
|
+
value: string;
|
|
1238
|
+
};
|
|
1233
1239
|
type ComboboxProps = {
|
|
1234
|
-
initialItems?:
|
|
1235
|
-
label: string;
|
|
1236
|
-
value: string;
|
|
1237
|
-
}[];
|
|
1240
|
+
initialItems?: ComboboxItem[];
|
|
1238
1241
|
label?: string;
|
|
1239
1242
|
required?: boolean;
|
|
1240
1243
|
caption?: string;
|
|
@@ -1247,9 +1250,25 @@ type ComboboxProps = {
|
|
|
1247
1250
|
noMarginBottom?: boolean;
|
|
1248
1251
|
multiple?: boolean;
|
|
1249
1252
|
showSelectedItems?: boolean;
|
|
1253
|
+
/**
|
|
1254
|
+
* Controlled selected values. When provided, the component is fully
|
|
1255
|
+
* controlled — pair with `onChange`.
|
|
1256
|
+
*/
|
|
1257
|
+
value?: string[];
|
|
1258
|
+
/** Initial selected values for uncontrolled usage. */
|
|
1259
|
+
defaultValue?: string[];
|
|
1260
|
+
/** Called with the selected values whenever the selection changes. */
|
|
1261
|
+
onChange?: (values: string[]) => void;
|
|
1262
|
+
/**
|
|
1263
|
+
* Whether the user can create options that do not exist in `initialItems`.
|
|
1264
|
+
* When `true`, typing a non-matching value shows a "Create …" row that adds
|
|
1265
|
+
* the entry to the list on selection.
|
|
1266
|
+
* @default false
|
|
1267
|
+
*/
|
|
1268
|
+
creatable?: boolean;
|
|
1250
1269
|
};
|
|
1251
1270
|
|
|
1252
|
-
declare const Combobox: ({ label, required, caption, errorMessage, size, disabled, showOptionalLabel, placeholder, labels, noMarginBottom, initialItems, multiple, showSelectedItems, }: ComboboxProps) => _emotion_react_jsx_runtime.JSX.Element;
|
|
1271
|
+
declare const Combobox: ({ label, required, caption, errorMessage, size, disabled, showOptionalLabel, placeholder, labels, noMarginBottom, initialItems, multiple, showSelectedItems, value: controlledValue, defaultValue, onChange, creatable, }: ComboboxProps) => _emotion_react_jsx_runtime.JSX.Element;
|
|
1253
1272
|
|
|
1254
1273
|
type TagProps = Omit<Tag$1.RootProps, 'size' | 'variant' | 'colorPalette' | 'children'> & {
|
|
1255
1274
|
label: string;
|