Skip to content

Commit

Permalink
fix: export various types to allow the vue sfc compiler to work properly
Browse files Browse the repository at this point in the history
  • Loading branch information
cschroeter committed Apr 24, 2024
1 parent c271c5c commit e9d82a1
Show file tree
Hide file tree
Showing 18 changed files with 48 additions and 8 deletions.
6 changes: 2 additions & 4 deletions packages/machines/color-picker/src/color-picker.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import type { StateMachine as S } from "@zag-js/core"
import type { InteractOutsideHandlers } from "@zag-js/dismissable"
import type { PositioningOptions } from "@zag-js/popper"
import type { CommonProperties, MaybeElement, Orientation, PropTypes, RequiredBy } from "@zag-js/types"
import type { MaybeFunction } from "@zag-js/utils"

export type ExtendedColorChannel = ColorChannel | "hex" | "css"

Expand Down Expand Up @@ -98,11 +97,10 @@ interface PublicContext extends CommonProperties, InteractOutsideHandlers {
* The positioning options for the color picker
*/
positioning: PositioningOptions

/**
* The initial focus element when the color picker is opened.
*/
initialFocusEl?: MaybeFunction<MaybeElement>
initialFocusEl?: MaybeElement | (() => MaybeElement)
/**
* Whether the color picker is open
*/
Expand Down Expand Up @@ -336,4 +334,4 @@ export interface MachineApi<T extends PropTypes = PropTypes> {
* Re-exported types
* -----------------------------------------------------------------------------*/

export type { Color, ColorAxes, ColorChannel, ColorFormat, ColorType }
export type { Color, ColorAxes, ColorChannel, ColorFormat, ColorType, PositioningOptions }
2 changes: 2 additions & 0 deletions packages/machines/color-picker/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
export type { FocusOutsideEvent, InteractOutsideEvent, PointerDownOutsideEvent } from "@zag-js/dismissable"
export { anatomy } from "./color-picker.anatomy"
export { connect } from "./color-picker.connect"
export { machine } from "./color-picker.machine"
Expand All @@ -16,6 +17,7 @@ export type {
ElementIds,
FormatChangeDetails,
OpenChangeDetails,
PositioningOptions,
SwatchProps,
SwatchTriggerProps,
SwatchTriggerState,
Expand Down
1 change: 1 addition & 0 deletions packages/machines/combobox/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
export type { FocusOutsideEvent, InteractOutsideEvent, PointerDownOutsideEvent } from "@zag-js/dismissable"
export { anatomy } from "./combobox.anatomy"
export { collection } from "./combobox.collection"
export { connect } from "./combobox.connect"
Expand Down
1 change: 1 addition & 0 deletions packages/machines/date-picker/src/date-picker.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -597,5 +597,6 @@ export type {
DateFormatter,
DateRangePreset,
DateValue,
PositioningOptions,
ZonedDateTime,
}
2 changes: 2 additions & 0 deletions packages/machines/date-picker/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
export type { FocusOutsideEvent, InteractOutsideEvent, PointerDownOutsideEvent } from "@zag-js/dismissable"
export { anatomy } from "./date-picker.anatomy"
export { connect } from "./date-picker.connect"
export { machine } from "./date-picker.machine"
Expand All @@ -23,6 +24,7 @@ export type {
IntlTranslations,
MonthGridProps,
OpenChangeDetails,
PositioningOptions,
PresetTriggerProps,
SelectionMode,
Send,
Expand Down
1 change: 1 addition & 0 deletions packages/machines/dialog/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
export type { FocusOutsideEvent, InteractOutsideEvent, PointerDownOutsideEvent } from "@zag-js/dismissable"
export { anatomy } from "./dialog.anatomy"
export { connect } from "./dialog.connect"
export { machine } from "./dialog.machine"
Expand Down
1 change: 1 addition & 0 deletions packages/machines/editable/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
export type { FocusOutsideEvent, InteractOutsideEvent, PointerDownOutsideEvent } from "@zag-js/interact-outside"
export { anatomy } from "./editable.anatomy"
export { connect } from "./editable.connect"
export { machine } from "./editable.machine"
Expand Down
3 changes: 3 additions & 0 deletions packages/machines/menu/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
export type { FocusOutsideEvent, InteractOutsideEvent, PointerDownOutsideEvent } from "@zag-js/dismissable"
export { anatomy } from "./menu.anatomy"
export { connect } from "./menu.connect"
export { machine } from "./menu.machine"
Expand All @@ -13,6 +14,8 @@ export type {
OpenChangeDetails,
OptionItemProps,
OptionItemState,
Point,
PositioningOptions,
SelectionDetails,
Service,
} from "./menu.types"
6 changes: 6 additions & 0 deletions packages/machines/menu/src/menu.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -309,3 +309,9 @@ export interface MachineApi<T extends PropTypes = PropTypes> {
getItemGroupLabelProps(options: ItemGroupLabelProps): T["element"]
getItemGroupProps(options: ItemGroupProps): T["element"]
}

/* -----------------------------------------------------------------------------
* Re-exported types
* -----------------------------------------------------------------------------*/

export type { PositioningOptions, Point }
1 change: 1 addition & 0 deletions packages/machines/popover/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
export type { FocusOutsideEvent, InteractOutsideEvent, PointerDownOutsideEvent } from "@zag-js/dismissable"
export { anatomy } from "./popover.anatomy"
export { connect } from "./popover.connect"
export { machine } from "./popover.machine"
Expand Down
1 change: 1 addition & 0 deletions packages/machines/progress/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ export type {
MachineApi as Api,
UserDefinedContext as Context,
IntlTranslations,
Orientation,
ProgressState,
ValueTranslationDetails,
ViewProps,
Expand Down
15 changes: 14 additions & 1 deletion packages/machines/progress/src/progress.types.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
import type { StateMachine as S } from "@zag-js/core"
import type { CommonProperties, DirectionProperty, OrientationProperty, PropTypes, RequiredBy } from "@zag-js/types"
import type {
CommonProperties,
DirectionProperty,
Orientation,
OrientationProperty,
PropTypes,
RequiredBy,
} from "@zag-js/types"

export type ProgressState = "indeterminate" | "loading" | "complete"

Expand Down Expand Up @@ -106,3 +113,9 @@ export interface MachineApi<T extends PropTypes> {
circleTrackProps: T["circle"]
circleRangeProps: T["circle"]
}

/* -----------------------------------------------------------------------------
* Re-exported types
* -----------------------------------------------------------------------------*/

export type { Orientation }
4 changes: 3 additions & 1 deletion packages/machines/select/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
export type { FocusOutsideEvent, InteractOutsideEvent, PointerDownOutsideEvent } from "@zag-js/dismissable"
export { anatomy } from "./select.anatomy"
export { collection } from "./select.collection"
export { connect } from "./select.connect"
Expand All @@ -10,11 +11,12 @@ export type {
UserDefinedContext as Context,
ElementIds,
HighlightChangeDetails,
ScrollToIndexDetails,
ItemGroupLabelProps,
ItemGroupProps,
ItemProps,
ItemState,
OpenChangeDetails,
PositioningOptions,
ScrollToIndexDetails,
ValueChangeDetails,
} from "./select.types"
2 changes: 1 addition & 1 deletion packages/machines/select/src/select.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -337,4 +337,4 @@ export interface MachineApi<T extends PropTypes = PropTypes, V extends Collectio
* Re-exported types
* -----------------------------------------------------------------------------*/

export type { CollectionOptions, CollectionItem }
export type { CollectionItem, CollectionOptions, PositioningOptions }
1 change: 1 addition & 0 deletions packages/machines/tags-input/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
export type { FocusOutsideEvent, InteractOutsideEvent, PointerDownOutsideEvent } from "@zag-js/interact-outside"
export { anatomy } from "./tags-input.anatomy"
export { connect } from "./tags-input.connect"
export { machine } from "./tags-input.machine"
Expand Down
2 changes: 1 addition & 1 deletion packages/machines/tags-input/src/tags-input.types.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { StateMachine as S } from "@zag-js/core"
import type { InteractOutsideHandlers } from "@zag-js/interact-outside"
import type { LiveRegion } from "@zag-js/live-region"
import type { CommonProperties, DirectionProperty, PropTypes, RequiredBy } from "@zag-js/types"
import type { InteractOutsideHandlers } from "@zag-js/interact-outside"

/* -----------------------------------------------------------------------------
* Callback details
Expand Down
1 change: 1 addition & 0 deletions packages/machines/toggle-group/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@ export type {
ElementIds,
ItemProps,
ItemState,
Orientation,
ValueChangeDetails,
} from "./toggle-group.types"
6 changes: 6 additions & 0 deletions packages/machines/toggle-group/src/toggle-group.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,3 +137,9 @@ export interface MachineApi<T extends PropTypes = PropTypes> {
rootProps: T["element"]
getItemProps(props: ItemProps): T["button"]
}

/* -----------------------------------------------------------------------------
* Re-exported types
* -----------------------------------------------------------------------------*/

export type { Orientation }

0 comments on commit e9d82a1

Please sign in to comment.