diff --git a/.changeset/fluffy-islands-punch.md b/.changeset/fluffy-islands-punch.md index 0f18b07a70..e1579e1028 100644 --- a/.changeset/fluffy-islands-punch.md +++ b/.changeset/fluffy-islands-punch.md @@ -2,4 +2,5 @@ "@zag-js/tabs": minor --- -Optimize onFocus and onChange type declaration. Remove onDelete from type defintion. +- Optimize `onFocus` and `onChange` type declaration. +- Remove `onDelete` from type defintion. diff --git a/.changeset/gentle-mails-occur.md b/.changeset/gentle-mails-occur.md index 67bc2c1db3..556027e909 100644 --- a/.changeset/gentle-mails-occur.md +++ b/.changeset/gentle-mails-occur.md @@ -2,4 +2,4 @@ "@zag-js/date-picker": patch --- -Fix issue where datepicker value onChange returned a proxy array +Fix issue where datepicker value `onChange` returned a proxy array diff --git a/.changeset/nasty-windows-change.md b/.changeset/nasty-windows-change.md index 02732f29f2..cf87dfbaa6 100644 --- a/.changeset/nasty-windows-change.md +++ b/.changeset/nasty-windows-change.md @@ -2,4 +2,4 @@ "@zag-js/radio-group": patch --- -Remove unsupport `readOnly` property from types +Remove unsupported `readOnly` property from types diff --git a/.changeset/neat-moose-guess.md b/.changeset/neat-moose-guess.md index e3e9a9ae59..ab80f76726 100644 --- a/.changeset/neat-moose-guess.md +++ b/.changeset/neat-moose-guess.md @@ -2,4 +2,4 @@ "@zag-js/editable": minor --- -Rename MaschineApi to Api +Rename `MachineApi` to `Api` diff --git a/CHANGELOG.md b/CHANGELOG.md index 377c1a3c95..e17d332def 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,54 @@ All notable changes to this project will be documented in this file. See the [Changesets](./.changeset) for the latest changes. +## [0.18.0] - 2023-09-05 + +### Fixed + +- **DatePicker** + - Fix issue where datepicker value `onChange` returned a proxy array + - Fix issue where clearing the date picker value prevent selecting a new date when `inline: true` is set +- **Menu**: Fix issue where `closeOnSelect` on menu item props isn't respected in machine +- **NumberInput**: Fix issue where number input goes into infinite update cycles due to additional input event + +### Added + +- **React**: Export `PropTypes` from react package for consistency +- **Select, Combobox**: Add support for selecting multiple items +- **Combobox**: Add support for `closeOnSelect` + +### Changed + +- **RadioGroup**: Remove unsupported `readOnly` property from types + +> 💥 Breaking changes + +Redesign select and combobox API to allow passing value as `string` and `collection` + +Prior to this change, Zag computes the label and value from the DOM element. While this worked, it makes it challenging +to manage complex objects that don't match the `label` and `value` convention. + +```jsx +// Create the collection +const collection = select.collection({ + items: [], + itemToString(item) { + return item.label + }, + itemToValue(item) { + return item.value + }, +}) + +// Pass the collection to the select machine +const [state, send] = useMachine( + select.machine({ + collection, + id: useId(), + }), +) +``` + ## [0.17.0] - 2023-08-26 ### Fixed