-
-
Notifications
You must be signed in to change notification settings - Fork 171
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: expose machine context props for better dx
- Loading branch information
1 parent
4a7d739
commit 2a024fb
Showing
70 changed files
with
846 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
--- | ||
"@zag-js/accordion": minor | ||
"@zag-js/clipboard": minor | ||
"@zag-js/carousel": minor | ||
"@zag-js/checkbox": minor | ||
"@zag-js/avatar": minor | ||
"@zag-js/types": minor | ||
--- | ||
|
||
Expose all machine context properties as array to improve DX of building design system components. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@zag-js/splitter": patch | ||
--- | ||
|
||
Remove support for `onSizeChangeStart` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
"@zag-js/menu": minor | ||
--- | ||
|
||
- Rename `GroupProps` to `ItemGroupProps` | ||
- Rename `LabelProps` to `ItemGroupLabelProps` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { createProps } from "@zag-js/types" | ||
import type { ItemProps, UserDefinedContext } from "./accordion.types" | ||
|
||
export const props = createProps<UserDefinedContext>()([ | ||
"collapsible", | ||
"dir", | ||
"disabled", | ||
"getRootNode", | ||
"id", | ||
"ids", | ||
"multiple", | ||
"onFocusChange", | ||
"onValueChange", | ||
"orientation", | ||
"value", | ||
]) | ||
|
||
export const itemProps = createProps<ItemProps>()(["value", "disabled"]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import { createProps } from "@zag-js/types" | ||
import type { UserDefinedContext } from "./avatar.types" | ||
|
||
export const props = createProps<UserDefinedContext>()(["dir", "id", "onLoadingStatusChange", "getRootNode"]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
export { anatomy } from "./avatar.anatomy" | ||
export { connect } from "./avatar.connect" | ||
export { machine } from "./avatar.machine" | ||
export type { UserDefinedContext as Context, MachineApi as Api, StatusChangeDetails } from "./avatar.types" | ||
export * from "./avatar.props" | ||
export type { MachineApi as Api, UserDefinedContext as Context, StatusChangeDetails } from "./avatar.types" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { createProps } from "@zag-js/types" | ||
import type { IndicatorProps, UserDefinedContext } from "./carousel.types" | ||
|
||
export const props = createProps<UserDefinedContext>()([ | ||
"align", | ||
"dir", | ||
"getRootNode", | ||
"id", | ||
"ids", | ||
"index", | ||
"loop", | ||
"onIndexChange", | ||
"orientation", | ||
"slidesPerView", | ||
"spacing", | ||
]) | ||
|
||
export const indicatorProps = createProps<IndicatorProps>()(["index", "readOnly"]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { createProps } from "@zag-js/types" | ||
import type { UserDefinedContext } from "./checkbox.types" | ||
|
||
export const props = createProps<UserDefinedContext>()([ | ||
"checked", | ||
"dir", | ||
"disabled", | ||
"form", | ||
"getRootNode", | ||
"id", | ||
"ids", | ||
"invalid", | ||
"name", | ||
"onCheckedChange", | ||
"required", | ||
"value", | ||
]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { createProps } from "@zag-js/types" | ||
import type { IndicatorProps, UserDefinedContext } from "./clipboard.types" | ||
|
||
export const props = createProps<UserDefinedContext>()([ | ||
"getRootNode", | ||
"id", | ||
"ids", | ||
"value", | ||
"timeout", | ||
"onCopyStatusChange", | ||
]) | ||
|
||
export const indicatorProps = createProps<IndicatorProps>()(["copied"]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,11 @@ | ||
export { anatomy } from "./clipboard.anatomy" | ||
export { connect } from "./clipboard.connect" | ||
export { machine } from "./clipboard.machine" | ||
export * from "./clipboard.props" | ||
export type { | ||
MachineApi as Api, | ||
UserDefinedContext as Context, | ||
ElementIds, | ||
CopyStatusDetails, | ||
ElementIds, | ||
IndicatorProps, | ||
} from "./clipboard.types" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { createProps } from "@zag-js/types" | ||
import type { UserDefinedContext } from "./collapsible.types" | ||
|
||
export const props = createProps<UserDefinedContext>()([ | ||
"dir", | ||
"disabled", | ||
"getRootNode", | ||
"id", | ||
"ids", | ||
"onOpenChange", | ||
"open.controlled", | ||
"open", | ||
]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import { createProps } from "@zag-js/types" | ||
import type { | ||
AreaProps, | ||
ChannelProps, | ||
SwatchProps, | ||
SwatchTriggerProps, | ||
TransparencyGridProps, | ||
UserDefinedContext, | ||
} from "./color-picker.types" | ||
|
||
export const props = createProps<UserDefinedContext>()([ | ||
"closeOnSelect", | ||
"dir", | ||
"disabled", | ||
"format", | ||
"getRootNode", | ||
"id", | ||
"ids", | ||
"initialFocusEl", | ||
"name", | ||
"name", | ||
"onFocusOutside", | ||
"onFormatChange", | ||
"onInteractOutside", | ||
"onOpenChange", | ||
"onPointerDownOutside", | ||
"onValueChange", | ||
"onValueChangeEnd", | ||
"open.controlled", | ||
"open", | ||
"positioning", | ||
"readOnly", | ||
"value", | ||
]) | ||
|
||
export const areaProps = createProps<AreaProps>()(["xChannel", "yChannel"]) | ||
|
||
export const channelProps = createProps<ChannelProps>()(["channel", "orientation"]) | ||
|
||
export const swatchTriggerProps = createProps<SwatchTriggerProps>()(["value", "disabled"]) | ||
|
||
export const swatchProps = createProps<SwatchProps>()(["value", "respectAlpha"]) | ||
|
||
export const transparencyGridProps = createProps<TransparencyGridProps>()(["size"]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import { createProps } from "@zag-js/types" | ||
import type { ItemGroupLabelProps, ItemGroupProps, ItemProps, UserDefinedContext } from "./combobox.types" | ||
|
||
export const props = createProps<UserDefinedContext>()([ | ||
"allowCustomValue", | ||
"autoFocus", | ||
"closeOnSelect", | ||
"dir", | ||
"disabled", | ||
"form", | ||
"getRootNode", | ||
"highlightedValue", | ||
"id", | ||
"ids", | ||
"inputBehavior", | ||
"collection", | ||
"inputValue", | ||
"invalid", | ||
"loop", | ||
"multiple", | ||
"name", | ||
"onFocusOutside", | ||
"onHighlightChange", | ||
"onInputValueChange", | ||
"onInteractOutside", | ||
"onOpenChange", | ||
"onOpenChange", | ||
"onPointerDownOutside", | ||
"onValueChange", | ||
"openOnClick", | ||
"placeholder", | ||
"positioning", | ||
"readOnly", | ||
"selectionBehavior", | ||
"selectOnBlur", | ||
"translations", | ||
"value", | ||
]) | ||
|
||
export const itemGroupLabelProps = createProps<ItemGroupLabelProps>()(["htmlFor"]) | ||
|
||
export const itemGroupProps = createProps<ItemGroupProps>()(["id"]) | ||
|
||
export const itemProps = createProps<ItemProps>()(["item"]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
import { createProps } from "@zag-js/types" | ||
import type { | ||
InputProps, | ||
PresetTriggerProps, | ||
TableCellProps, | ||
TableProps, | ||
UserDefinedContext, | ||
ViewProps, | ||
} from "./date-picker.types" | ||
|
||
export const props = createProps<UserDefinedContext>()([ | ||
"closeOnSelect", | ||
"dir", | ||
"disabled", | ||
"fixedWeeks", | ||
"focusedValue", | ||
"format", | ||
"getRootNode", | ||
"id", | ||
"ids", | ||
"isDateUnavailable", | ||
"isDateUnavailable", | ||
"locale", | ||
"max", | ||
"min", | ||
"modal", | ||
"name", | ||
"numOfMonths", | ||
"onFocusChange", | ||
"onOpenChange", | ||
"onValueChange", | ||
"onViewChange", | ||
"open", | ||
"open.controlled", | ||
"parse", | ||
"positioning", | ||
"readOnly", | ||
"selectionMode", | ||
"startOfWeek", | ||
"timeZone", | ||
"translations", | ||
"value", | ||
"view", | ||
]) | ||
|
||
export const inputProps = createProps<InputProps>()(["index"]) | ||
|
||
export const presetTriggerProps = createProps<PresetTriggerProps>()(["value"]) | ||
|
||
export const tableProps = createProps<TableProps>()(["columns", "id", "view"]) | ||
|
||
export const tableCellProps = createProps<TableCellProps>()(["disabled", "value", "columns"]) | ||
|
||
export const viewProps = createProps<ViewProps>()(["view"]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import { createProps } from "@zag-js/types" | ||
import type { UserDefinedContext } from "./dialog.types" | ||
|
||
export const props = createProps<UserDefinedContext>()([ | ||
"aria-label", | ||
"closeOnEscapeKeyDown", | ||
"closeOnInteractOutside", | ||
"dir", | ||
"finalFocusEl", | ||
"getRootNode", | ||
"getRootNode", | ||
"id", | ||
"id", | ||
"ids", | ||
"initialFocusEl", | ||
"modal", | ||
"onEscapeKeyDown", | ||
"onFocusOutside", | ||
"onInteractOutside", | ||
"onOpenChange", | ||
"onPointerDownOutside", | ||
"open.controlled", | ||
"open", | ||
"preventScroll", | ||
"restoreFocus", | ||
"role", | ||
"trapFocus", | ||
]) |
Oops, something went wrong.