@baseplate-dev/ui-components 0.6.3 → 0.6.4
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 +9 -0
- package/dist/components/ui/combobox-field/combobox-field.d.ts +2 -1
- package/dist/components/ui/combobox-field/combobox-field.d.ts.map +1 -1
- package/dist/components/ui/combobox-field/combobox-field.js +2 -2
- package/dist/components/ui/combobox-field/combobox-field.js.map +1 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# @baseplate-dev/ui-components
|
|
2
2
|
|
|
3
|
+
## 0.6.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#837](https://github.com/halfdomelabs/baseplate/pull/837) [`ba315aa`](https://github.com/halfdomelabs/baseplate/commit/ba315aaaec0e8842ec7fadb765b1fed5e3abda5a) Thanks [@kingston](https://github.com/kingston)! - Add `inputValue` prop to `ComboboxField` for controlled input state.
|
|
8
|
+
|
|
9
|
+
- Updated dependencies []:
|
|
10
|
+
- @baseplate-dev/utils@0.6.4
|
|
11
|
+
|
|
3
12
|
## 0.6.3
|
|
4
13
|
|
|
5
14
|
### Patch Changes
|
|
@@ -8,12 +8,13 @@ export interface ComboboxFieldProps<OptionType> extends SelectOptionProps<Option
|
|
|
8
8
|
disabled?: boolean;
|
|
9
9
|
value?: string | null;
|
|
10
10
|
onChange?: (value: string | null) => void;
|
|
11
|
+
inputValue?: string;
|
|
11
12
|
onInputValueChange?: (value: string) => void;
|
|
12
13
|
}
|
|
13
14
|
/**
|
|
14
15
|
* Field with label and error states that wraps a Combobox component.
|
|
15
16
|
*/
|
|
16
|
-
declare function ComboboxField<OptionType>({ label, description, error, value, placeholder, options, renderItemLabel, onChange, onInputValueChange, getOptionLabel, getOptionValue, className, noResultsText, disabled, }: ComboboxFieldProps<OptionType> & AddOptionRequiredFields<OptionType>): React.ReactElement;
|
|
17
|
+
declare function ComboboxField<OptionType>({ label, description, error, value, placeholder, options, renderItemLabel, onChange, inputValue, onInputValueChange, getOptionLabel, getOptionValue, className, noResultsText, disabled, }: ComboboxFieldProps<OptionType> & AddOptionRequiredFields<OptionType>): React.ReactElement;
|
|
17
18
|
interface ComboboxFieldControllerPropsBase<OptionType, TFieldValues extends FieldValues = FieldValues, TFieldName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>> extends Omit<ComboboxFieldProps<OptionType>, 'value'> {
|
|
18
19
|
control: Control<TFieldValues>;
|
|
19
20
|
name: TFieldName;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"combobox-field.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/combobox-field/combobox-field.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAIvE,OAAO,KAAK,EACV,uBAAuB,EACvB,cAAc,EACd,iBAAiB,EAClB,MAAM,oBAAoB,CAAC;AAoB5B,MAAM,WAAW,kBAAkB,CAAC,UAAU,CAC5C,SAAQ,iBAAiB,CAAC,UAAU,CAAC,EAAE,cAAc;IACrD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAChC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;IAC1C,kBAAkB,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CAC9C;AAED;;GAEG;AACH,iBAAS,aAAa,CAAC,UAAU,EAAE,EACjC,KAAK,EACL,WAAW,EACX,KAAK,EACL,KAAK,EACL,WAAW,EACX,OAAO,EACP,eAAe,EACf,QAAQ,EACR,kBAAkB,EAClB,cAA0D,EAC1D,cAAiE,EACjE,SAAS,EACT,aAAa,EACb,QAAQ,GACT,EAAE,kBAAkB,CAAC,UAAU,CAAC,GAC/B,uBAAuB,CAAC,UAAU,CAAC,GAAG,KAAK,CAAC,YAAY,
|
|
1
|
+
{"version":3,"file":"combobox-field.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/combobox-field/combobox-field.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAIvE,OAAO,KAAK,EACV,uBAAuB,EACvB,cAAc,EACd,iBAAiB,EAClB,MAAM,oBAAoB,CAAC;AAoB5B,MAAM,WAAW,kBAAkB,CAAC,UAAU,CAC5C,SAAQ,iBAAiB,CAAC,UAAU,CAAC,EAAE,cAAc;IACrD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAChC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;IAC1C,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,kBAAkB,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CAC9C;AAED;;GAEG;AACH,iBAAS,aAAa,CAAC,UAAU,EAAE,EACjC,KAAK,EACL,WAAW,EACX,KAAK,EACL,KAAK,EACL,WAAW,EACX,OAAO,EACP,eAAe,EACf,QAAQ,EACR,UAAU,EACV,kBAAkB,EAClB,cAA0D,EAC1D,cAAiE,EACjE,SAAS,EACT,aAAa,EACb,QAAQ,GACT,EAAE,kBAAkB,CAAC,UAAU,CAAC,GAC/B,uBAAuB,CAAC,UAAU,CAAC,GAAG,KAAK,CAAC,YAAY,CA6CzD;AAED,UAAU,gCAAgC,CACxC,UAAU,EACV,YAAY,SAAS,WAAW,GAAG,WAAW,EAC9C,UAAU,SAAS,SAAS,CAAC,YAAY,CAAC,GAAG,SAAS,CAAC,YAAY,CAAC,CACpE,SAAQ,IAAI,CAAC,kBAAkB,CAAC,UAAU,CAAC,EAAE,OAAO,CAAC;IACrD,OAAO,EAAE,OAAO,CAAC,YAAY,CAAC,CAAC;IAC/B,IAAI,EAAE,UAAU,CAAC;CAClB;AAED,KAAK,4BAA4B,CAC/B,UAAU,EACV,YAAY,SAAS,WAAW,GAAG,WAAW,EAC9C,UAAU,SAAS,SAAS,CAAC,YAAY,CAAC,GAAG,SAAS,CAAC,YAAY,CAAC,IAClE,gCAAgC,CAAC,UAAU,EAAE,YAAY,EAAE,UAAU,CAAC,CAAC;AAE3E,iBAAS,uBAAuB,CAC9B,UAAU,EACV,YAAY,SAAS,WAAW,GAAG,WAAW,EAC9C,UAAU,SAAS,SAAS,CAAC,YAAY,CAAC,GAAG,SAAS,CAAC,YAAY,CAAC,EACpE,EACA,IAAI,EACJ,OAAO,EACP,GAAG,IAAI,EACR,EAAE,4BAA4B,CAAC,UAAU,EAAE,YAAY,EAAE,UAAU,CAAC,GACnE,uBAAuB,CAAC,UAAU,CAAC,GAAG,KAAK,CAAC,YAAY,CAiBzD;AAED,OAAO,EAAE,aAAa,EAAE,uBAAuB,EAAE,CAAC"}
|
|
@@ -8,13 +8,13 @@ import { Field, FieldDescription, FieldError, FieldLabel, } from '../field/field
|
|
|
8
8
|
/**
|
|
9
9
|
* Field with label and error states that wraps a Combobox component.
|
|
10
10
|
*/
|
|
11
|
-
function ComboboxField({ label, description, error, value, placeholder, options, renderItemLabel, onChange, onInputValueChange, getOptionLabel = (val) => val.label, getOptionValue = (val) => val.value, className, noResultsText, disabled, }) {
|
|
11
|
+
function ComboboxField({ label, description, error, value, placeholder, options, renderItemLabel, onChange, inputValue, onInputValueChange, getOptionLabel = (val) => val.label, getOptionValue = (val) => val.value, className, noResultsText, disabled, }) {
|
|
12
12
|
const { comboboxNoResults } = useComponentStrings();
|
|
13
13
|
const id = useId();
|
|
14
14
|
const selectedOption = options.find((o) => getOptionValue(o) === value) ?? null;
|
|
15
15
|
return (_jsxs(Field, { "data-invalid": !!error, className: className, children: [_jsx(FieldLabel, { htmlFor: id, children: label }), _jsxs(Combobox, { value: selectedOption, onValueChange: (option) => {
|
|
16
16
|
onChange?.(option ? getOptionValue(option) : null);
|
|
17
|
-
}, onInputValueChange: onInputValueChange, disabled: disabled, items: options, itemToStringLabel: getOptionLabel, itemToStringValue: (option) => getOptionValue(option) ?? '', autoHighlight: true, children: [_jsx(ComboboxInput, { id: id, placeholder: placeholder }), _jsxs(ComboboxContent, { children: [_jsx(ComboboxEmpty, { children: noResultsText ?? comboboxNoResults }), _jsx(ComboboxList, { children: (option) => {
|
|
17
|
+
}, inputValue: inputValue, onInputValueChange: onInputValueChange, disabled: disabled, items: options, itemToStringLabel: getOptionLabel, itemToStringValue: (option) => getOptionValue(option) ?? '', autoHighlight: true, children: [_jsx(ComboboxInput, { id: id, placeholder: placeholder }), _jsxs(ComboboxContent, { children: [_jsx(ComboboxEmpty, { children: noResultsText ?? comboboxNoResults }), _jsx(ComboboxList, { children: (option) => {
|
|
18
18
|
const val = getOptionValue(option);
|
|
19
19
|
const optionLabel = getOptionLabel(option);
|
|
20
20
|
return (_jsx(ComboboxItem, { value: option, children: renderItemLabel
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"combobox-field.js","sourceRoot":"","sources":["../../../../src/components/ui/combobox-field/combobox-field.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAKb,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAC;AAQ9B,OAAO,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AACzE,OAAO,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAC;AAE1E,OAAO,EACL,QAAQ,EACR,eAAe,EACf,aAAa,EACb,aAAa,EACb,YAAY,EACZ,YAAY,GACb,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,KAAK,EACL,gBAAgB,EAChB,UAAU,EACV,UAAU,GACX,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"combobox-field.js","sourceRoot":"","sources":["../../../../src/components/ui/combobox-field/combobox-field.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAKb,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAC;AAQ9B,OAAO,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AACzE,OAAO,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAC;AAE1E,OAAO,EACL,QAAQ,EACR,eAAe,EACf,aAAa,EACb,aAAa,EACb,YAAY,EACZ,YAAY,GACb,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,KAAK,EACL,gBAAgB,EAChB,UAAU,EACV,UAAU,GACX,MAAM,mBAAmB,CAAC;AAc3B;;GAEG;AACH,SAAS,aAAa,CAAa,EACjC,KAAK,EACL,WAAW,EACX,KAAK,EACL,KAAK,EACL,WAAW,EACX,OAAO,EACP,eAAe,EACf,QAAQ,EACR,UAAU,EACV,kBAAkB,EAClB,cAAc,GAAG,CAAC,GAAG,EAAE,EAAE,CAAE,GAAyB,CAAC,KAAK,EAC1D,cAAc,GAAG,CAAC,GAAG,EAAE,EAAE,CAAE,GAAgC,CAAC,KAAK,EACjE,SAAS,EACT,aAAa,EACb,QAAQ,GAE2B;IACnC,MAAM,EAAE,iBAAiB,EAAE,GAAG,mBAAmB,EAAE,CAAC;IACpD,MAAM,EAAE,GAAG,KAAK,EAAE,CAAC;IAEnB,MAAM,cAAc,GAClB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,cAAc,CAAC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KAAK,GAAc,IAC1B,CACT,CAAC;AACJ,CAAC;AAiBD,SAAS,uBAAuB,CAI9B,EACA,IAAI,EACJ,OAAO,EACP,GAAG,IAAI,EAE4B;IACnC,MAAM,EACJ,KAAK,EACL,UAAU,EAAE,EAAE,KAAK,EAAE,GACtB,GAAG,mBAAmB,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,IAAI,CAAC,CAAC;IAEjD,MAAM,SAAS,GAAG,IACmB,CAAC;IAEtC,OAAO,CACL,KAAC,aAAa,IACZ,KAAK,EAAE,KAAK,EAAE,OAAO,KACjB,SAAS,KACT,KAAK,EACT,KAAK,EAAE,KAAK,CAAC,KAAK,IAAI,IAAI,GAC1B,CACH,CAAC;AACJ,CAAC;AAED,OAAO,EAAE,aAAa,EAAE,uBAAuB,EAAE,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@baseplate-dev/ui-components",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.4",
|
|
4
4
|
"description": "Shared UI component library",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"baseplate",
|
|
@@ -71,7 +71,7 @@
|
|
|
71
71
|
"tailwind-merge": "3.3.1",
|
|
72
72
|
"zod": "^4.3.6",
|
|
73
73
|
"zustand": "5.0.3",
|
|
74
|
-
"@baseplate-dev/utils": "0.6.
|
|
74
|
+
"@baseplate-dev/utils": "0.6.4"
|
|
75
75
|
},
|
|
76
76
|
"devDependencies": {
|
|
77
77
|
"@codemirror/state": "^6.5.4",
|
|
@@ -98,7 +98,7 @@
|
|
|
98
98
|
"vite": "7.1.12",
|
|
99
99
|
"vite-plugin-svgr": "4.5.0",
|
|
100
100
|
"vitest": "4.0.16",
|
|
101
|
-
"@baseplate-dev/tools": "0.6.
|
|
101
|
+
"@baseplate-dev/tools": "0.6.4"
|
|
102
102
|
},
|
|
103
103
|
"engines": {
|
|
104
104
|
"node": "^22.0.0"
|