@vireo-ai/trellis-ui 0.1.8 → 0.1.10

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.
Files changed (173) hide show
  1. package/package.json +8 -4
  2. package/packages/client/src/components/app/styles.css +1 -30
  3. package/packages/client/src/components/button/styles.css +1 -122
  4. package/packages/client/src/components/date-picker/styles.css +47 -77
  5. package/packages/client/src/components/field/styles.css +10 -0
  6. package/packages/client/src/components/file-upload/styles.css +0 -28
  7. package/packages/client/src/components/panels/styles.css +43 -0
  8. package/packages/client/src/components/radio/styles.css +26 -21
  9. package/packages/client/src/components/scroll-area/styles.css +0 -4
  10. package/packages/client/src/components/select/styles.css +0 -30
  11. package/packages/client/src/components/sidebar/styles.css +8 -0
  12. package/packages/client/src/components/toast/styles.css +14 -7
  13. package/packages/client/src/styles/components.css +1 -0
  14. package/packages/client/src/styles/generated/theme-fonts.css +5 -0
  15. package/packages/client/src/styles/generated/theme-palette.css +2656 -0
  16. package/packages/client/src/styles/generated/theme-runtime.css +2966 -0
  17. package/packages/client/src/styles/generated-sources.css +1 -1
  18. package/packages/client/src/styles/static.css +1 -0
  19. package/packages/client/src/styles/theme.css +777 -738
  20. package/packages/client/types/cdn.d.ts +1 -4
  21. package/packages/client/types/component-api.d.ts +21 -0
  22. package/packages/client/types/components/accordion/contract.d.ts +3 -2
  23. package/packages/client/types/components/accordion/index.d.ts +28 -42
  24. package/packages/client/types/components/accordion/machine.d.ts +131 -0
  25. package/packages/client/types/components/accordion/runtime-docs.d.ts +2 -0
  26. package/packages/client/types/components/action/contract.d.ts +3 -3
  27. package/packages/client/types/components/app/contract.d.ts +25 -12
  28. package/packages/client/types/components/app/index.d.ts +2 -2
  29. package/packages/client/types/components/badge/contract.d.ts +5 -5
  30. package/packages/client/types/components/box/contract.d.ts +25 -28
  31. package/packages/client/types/components/brand/contract.d.ts +2 -2
  32. package/packages/client/types/components/button/contract.d.ts +5 -5
  33. package/packages/client/types/components/card/contract.d.ts +28 -31
  34. package/packages/client/types/components/checkbox/contract.d.ts +17 -17
  35. package/packages/client/types/components/checkbox/index.d.ts +20 -26
  36. package/packages/client/types/components/checkbox/machine.d.ts +41 -0
  37. package/packages/client/types/components/checkbox/runtime-docs.d.ts +2 -0
  38. package/packages/client/types/components/common.d.ts +53 -235
  39. package/packages/client/types/components/container/contract.d.ts +11 -12
  40. package/packages/client/types/components/date-picker/contract.d.ts +21 -16
  41. package/packages/client/types/components/date-picker/index.d.ts +38 -60
  42. package/packages/client/types/components/date-picker/machine.d.ts +529 -0
  43. package/packages/client/types/components/date-picker/runtime-docs.d.ts +2 -0
  44. package/packages/client/types/components/date-picker/value.d.ts +28 -0
  45. package/packages/client/types/components/dropdown/contract.d.ts +4 -4
  46. package/packages/client/types/components/dropdown/index.d.ts +20 -45
  47. package/packages/client/types/components/dropdown/machine.d.ts +93 -0
  48. package/packages/client/types/components/dropdown/runtime-docs.d.ts +2 -0
  49. package/packages/client/types/components/field/contract.d.ts +10 -6
  50. package/packages/client/types/components/field/index.d.ts +6 -6
  51. package/packages/client/types/components/field/machine.d.ts +13 -0
  52. package/packages/client/types/components/field/runtime-docs.d.ts +2 -0
  53. package/packages/client/types/components/file-upload/contract.d.ts +7 -4
  54. package/packages/client/types/components/file-upload/index.d.ts +34 -31
  55. package/packages/client/types/components/file-upload/machine.d.ts +127 -0
  56. package/packages/client/types/components/file-upload/runtime-docs.d.ts +2 -0
  57. package/packages/client/types/components/flex/contract.d.ts +16 -17
  58. package/packages/client/types/components/frame/contract.d.ts +41 -47
  59. package/packages/client/types/components/frame/index.d.ts +2 -2
  60. package/packages/client/types/components/grid/contract.d.ts +20 -21
  61. package/packages/client/types/components/heading/contract.d.ts +1 -1
  62. package/packages/client/types/components/image/contract.d.ts +3 -3
  63. package/packages/client/types/components/input/contract.d.ts +2 -2
  64. package/packages/client/types/components/input/index.d.ts +15 -12
  65. package/packages/client/types/components/input/machine.d.ts +20 -0
  66. package/packages/client/types/components/layout.d.ts +44 -225
  67. package/packages/client/types/components/menu/contract.d.ts +14 -8
  68. package/packages/client/types/components/modal/contract.d.ts +12 -12
  69. package/packages/client/types/components/modal/index.d.ts +41 -75
  70. package/packages/client/types/components/modal/machine.d.ts +129 -0
  71. package/packages/client/types/components/modal/runtime-docs.d.ts +2 -0
  72. package/packages/client/types/components/overlay/contract.d.ts +3 -3
  73. package/packages/client/types/components/panels/contract.d.ts +39 -0
  74. package/packages/client/types/components/panels/index.d.ts +54 -0
  75. package/packages/client/types/components/panels/machine.d.ts +151 -0
  76. package/packages/client/types/components/panels/runtime-docs.d.ts +2 -0
  77. package/packages/client/types/components/radio/contract.d.ts +11 -11
  78. package/packages/client/types/components/radio/index.d.ts +19 -23
  79. package/packages/client/types/components/radio/machine.d.ts +40 -0
  80. package/packages/client/types/components/radio/runtime-docs.d.ts +2 -0
  81. package/packages/client/types/components/runtime-docs.d.ts +2 -0
  82. package/packages/client/types/components/runtime.d.ts +16 -19
  83. package/packages/client/types/components/scroll-area/contract.d.ts +4 -7
  84. package/packages/client/types/components/scroll-area/index.d.ts +23 -49
  85. package/packages/client/types/components/scroll-area/machine.d.ts +21 -0
  86. package/packages/client/types/components/scroll-area/runtime-docs.d.ts +2 -0
  87. package/packages/client/types/components/section/contract.d.ts +12 -13
  88. package/packages/client/types/components/select/contract.d.ts +19 -15
  89. package/packages/client/types/components/select/index.d.ts +42 -89
  90. package/packages/client/types/components/select/machine.d.ts +476 -0
  91. package/packages/client/types/components/select/runtime-docs.d.ts +2 -0
  92. package/packages/client/types/components/shared/controlled-open.d.ts +11 -0
  93. package/packages/client/types/components/sidebar/contract.d.ts +19 -12
  94. package/packages/client/types/components/sidebar/index.d.ts +51 -88
  95. package/packages/client/types/components/sidebar/machine.d.ts +100 -0
  96. package/packages/client/types/components/sidebar/runtime-docs.d.ts +2 -0
  97. package/packages/client/types/components/slider/contract.d.ts +3 -3
  98. package/packages/client/types/components/slider/index.d.ts +17 -21
  99. package/packages/client/types/components/slider/machine.d.ts +37 -0
  100. package/packages/client/types/components/slider/runtime-docs.d.ts +2 -0
  101. package/packages/client/types/components/stack/contract.d.ts +16 -17
  102. package/packages/client/types/components/surface-manifest.d.ts +9 -0
  103. package/packages/client/types/components/switch/contract.d.ts +11 -11
  104. package/packages/client/types/components/switch/index.d.ts +13 -18
  105. package/packages/client/types/components/switch/machine.d.ts +19 -0
  106. package/packages/client/types/components/switch/runtime-docs.d.ts +2 -0
  107. package/packages/client/types/components/table/contract.d.ts +18 -18
  108. package/packages/client/types/components/tabs/contract.d.ts +10 -5
  109. package/packages/client/types/components/tabs/index.d.ts +33 -51
  110. package/packages/client/types/components/tabs/machine.d.ts +84 -0
  111. package/packages/client/types/components/tabs/runtime-docs.d.ts +2 -0
  112. package/packages/client/types/components/text/contract.d.ts +1 -1
  113. package/packages/client/types/components/textarea/contract.d.ts +2 -2
  114. package/packages/client/types/components/toast/contract.d.ts +5 -4
  115. package/packages/client/types/components/toast/index.d.ts +38 -12
  116. package/packages/client/types/components/toast/machine.d.ts +115 -0
  117. package/packages/client/types/components/toast/runtime-docs.d.ts +2 -0
  118. package/packages/client/types/directives/index.d.ts +3 -1
  119. package/packages/client/types/directives/layout.d.ts +3 -0
  120. package/packages/client/types/directives/request.d.ts +1 -2
  121. package/packages/client/types/directives/transition.d.ts +3 -0
  122. package/packages/client/types/docs/transition-docs.d.ts +30 -0
  123. package/packages/client/types/index.d.ts +8 -40
  124. package/packages/client/types/motion/animate.d.ts +5 -44
  125. package/packages/client/types/motion/controller.d.ts +33 -0
  126. package/packages/client/types/motion/index.d.ts +43 -20
  127. package/packages/client/types/motion/owned.d.ts +5 -0
  128. package/packages/client/types/motion/plan.d.ts +46 -0
  129. package/packages/client/types/motion/recipe.d.ts +56 -0
  130. package/packages/client/types/motion/registry.d.ts +12 -0
  131. package/packages/client/types/motion/resize.d.ts +15 -0
  132. package/packages/client/types/motion/subject.d.ts +10 -0
  133. package/packages/client/types/motion/targets.d.ts +2 -5
  134. package/packages/client/types/motion/view.d.ts +7 -2
  135. package/packages/client/types/runtime/alpine-machine.d.ts +68 -0
  136. package/packages/client/types/runtime/anchored-popover.d.ts +10 -2
  137. package/packages/client/types/runtime/codecs.d.ts +16 -2
  138. package/packages/client/types/runtime/{resizable.d.ts → drag-and-drop/index.d.ts} +4 -2
  139. package/packages/client/types/runtime/engine/request.d.ts +2 -2
  140. package/packages/client/types/runtime/engine/stream.d.ts +11 -5
  141. package/packages/client/types/runtime/focus-scope.d.ts +7 -0
  142. package/packages/client/types/runtime/identity.d.ts +3 -0
  143. package/packages/client/types/runtime/index.d.ts +9 -75
  144. package/packages/client/types/runtime/merge-bindings.d.ts +1 -1
  145. package/packages/client/types/runtime/semantic-observer.d.ts +10 -0
  146. package/packages/client/types/runtime/state-machine/index.d.ts +4 -0
  147. package/packages/client/types/runtime/state-machine/machine.d.ts +83 -0
  148. package/packages/client/types/runtime/state-machine/props-change.d.ts +12 -0
  149. package/packages/client/types/runtime/transition-coordinator.d.ts +52 -0
  150. package/packages/client/types/runtime/ui.d.ts +15 -0
  151. package/packages/client/types/utils/index.d.ts +2 -1
  152. package/packages/client/types/utils/number.d.ts +2 -0
  153. package/packages/client/types/utils/object.d.ts +4 -1
  154. package/packages/server/trellis_ui/static/trellis_ui/assets/css/trellis.css +9097 -2595
  155. package/packages/server/trellis_ui/static/trellis_ui/assets/css/trellis.min.css +1 -1
  156. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/index.js +17313 -13281
  157. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/index.js.map +1 -1
  158. package/packages/server/trellis_ui/static/trellis_ui/assets/js/trellis.js +8 -15
  159. package/packages/server/trellis_ui/static/trellis_ui/assets/js/trellis.min.js +8 -15
  160. package/packages/client/types/bindings/disclosure.d.ts +0 -3
  161. package/packages/client/types/bindings/index.d.ts +0 -7
  162. package/packages/client/types/bindings/motion.d.ts +0 -3
  163. package/packages/client/types/bindings/state.d.ts +0 -3
  164. package/packages/client/types/bindings/types.d.ts +0 -33
  165. package/packages/client/types/components/combobox/contract.d.ts +0 -60
  166. package/packages/client/types/components/combobox/index.d.ts +0 -80
  167. package/packages/client/types/components/textarea/index.d.ts +0 -13
  168. package/packages/client/types/motion/presence.d.ts +0 -34
  169. package/packages/client/types/runtime/class-name.d.ts +0 -9
  170. package/packages/client/types/runtime/create.d.ts +0 -8
  171. package/packages/client/types/runtime/machine.d.ts +0 -55
  172. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/cally-TZl4LpyH.js +0 -1134
  173. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/cally-TZl4LpyH.js.map +0 -1
@@ -5,6 +5,7 @@ type StreamPatchPayload = {
5
5
  target?: string | null;
6
6
  selector?: string | null;
7
7
  mode?: PatchMode | null;
8
+ viewTransition?: boolean;
8
9
  };
9
10
  type StreamEventPayload = {
10
11
  event: string;
@@ -25,10 +26,15 @@ type SseFrame = {
25
26
  event: string;
26
27
  data: string;
27
28
  };
28
- type SseFrameHandler = (frame: SseFrame) => void;
29
29
  type StreamController = {
30
30
  abort(reason?: string): void;
31
31
  };
32
+ type StreamLifecycle = {
33
+ open?(): void;
34
+ disconnected?(): void;
35
+ reset?(data: string): void;
36
+ error?(data: string): void;
37
+ };
32
38
  type StreamAlpine = Pick<Alpine.Alpine, 'initTree'> & {
33
39
  morph?: (target: HTMLElement, html: string, options?: {
34
40
  key?: (el: HTMLElement) => string | null;
@@ -40,9 +46,9 @@ declare const applyStreamPatch: (AlpineInstance: StreamAlpine, payload: StreamPa
40
46
  declare const dispatchStreamEvent: (payload: StreamEventPayload) => void;
41
47
  declare const applyUiEffect: (AlpineInstance: StreamAlpine, effect: UiEffectPayload) => void;
42
48
  declare const applyUiEffects: (AlpineInstance: StreamAlpine, effects: UiEffectPayload | UiEffectPayload[]) => void;
43
- declare const streamSseFrames: (response: Response, onFrame: SseFrameHandler) => Promise<void>;
44
49
  declare const applySseFrame: (AlpineInstance: StreamAlpine, frame: SseFrame) => void;
45
- declare const connectStream: (AlpineInstance: StreamAlpine, url: string) => StreamController;
50
+ declare const streamUrl: (url: string, scopes?: string, client?: string) => string;
51
+ declare const connectStream: (AlpineInstance: StreamAlpine, url: string, scopes?: string, client?: string, lifecycle?: StreamLifecycle) => StreamController;
46
52
  declare const registerStream: (AlpineInstance: Alpine.Alpine) => void;
47
- export { applyUiEffect, applyUiEffects, applyStreamPatch, applyStreamPatchNow, applyStreamPatches, applySseFrame, connectStream, dispatchStreamEvent, registerStream, streamSseFrames, };
48
- export type { LocationPayload, PatchMode, SseFrame, SseFrameHandler, StreamAlpine, StreamEventPayload, StreamPatchPayload, UiEffectPayload };
53
+ export { applyUiEffect, applyUiEffects, applyStreamPatch, applyStreamPatchNow, applyStreamPatches, applySseFrame, connectStream, dispatchStreamEvent, registerStream, streamUrl, };
54
+ export type { LocationPayload, PatchMode, SseFrame, StreamAlpine, StreamEventPayload, StreamPatchPayload, UiEffectPayload };
@@ -0,0 +1,7 @@
1
+ declare const FOCUSABLE_SELECTOR: string;
2
+ declare const isFocusable: (el: HTMLElement) => boolean;
3
+ declare const closestFocusable: (el: HTMLElement) => HTMLElement;
4
+ declare const focusableElements: (scope: HTMLElement) => HTMLElement[];
5
+ declare const focusFirst: (scope: HTMLElement) => void;
6
+ declare const trapFocus: (event: KeyboardEvent, scope: HTMLElement) => void;
7
+ export { FOCUSABLE_SELECTOR, closestFocusable, focusFirst, focusableElements, isFocusable, trapFocus };
@@ -0,0 +1,3 @@
1
+ declare const STABLE_KEY_ATTR = "data-ui-key";
2
+ declare const stableIdentity: (element: Element, explicit?: unknown) => string | null;
3
+ export { STABLE_KEY_ATTR, stableIdentity };
@@ -1,94 +1,28 @@
1
1
  import type Alpine from 'alpinejs';
2
- export { createAnchoredPopover, type AnchoredPopover, type AnchoredPopoverOptions, type PopoverAlign, type PopoverSide, } from './anchored-popover';
3
- export { className, cx, type ClassArray, type ClassDictionary, type ClassNameOptions, type ClassValue } from './class-name';
2
+ export { createAlpineMachine, findAlpineMachineOwner, type AlpineMachine, type AlpineMachineOwner, type AlpinePropsChangedEvent, type CreateAlpineMachineOptions, type MachineFactoryScope, } from './alpine-machine';
3
+ export { createAnchoredPopover, createAnchoredPopoverSurface, type AnchoredPopover, type AnchoredPopoverOptions, type AnchoredPopoverSurface, type PopoverAlign, type PopoverSide, } from './anchored-popover';
4
4
  export { createCollectionNavigation, type CollectionElementOptions, type CollectionItemsOptions, type CollectionKeydownOptions, type CollectionNavigation, type CollectionNavigationOptions, } from './collection-navigation';
5
5
  export { registerConfirm, unregisterConfirm, type ConfirmEventDetail, type ConfirmRuntimeOptions } from './confirm';
6
- export { create, type CreateOptions, type StyleTree } from './create';
7
6
  export { mergeBindings, type BindingInput, type BindingObject, type MergeBindingsOptions } from './merge-bindings';
8
- export { defineProps, string, number, bool, json, oneOf, type CodecFn, type PropState, type SchemaToProps } from './codecs';
9
- export { createMachine, createVisibilityMachine, type Machine, type MachineAction, type MachineActionList, type MachineActionRef, type MachineConfig, type MachineEffect, type MachineEvent, type MachineEventObject, type MachineGuard, type MachineOptions, type MachineScope, type MachineStateConfig, type MachineTransition, type VisibilityMachineConfig, } from './machine';
7
+ export { attribute, boundNumber, clampNumber, dataAttributeForProp, dataAttributeForSchemaProp, decodeProps, defineProps, snapNumber, string, number, bool, json, oneOf, type CodecFn, type DecodePropsOptions, type PropState, type SchemaToProps, } from './codecs';
8
+ export { createMachine, type Machine, type MachineConfig, type MachineEffect, type MachineEffectList, type MachineEffectRef, type MachineEntry, type MachineEvent, type MachineEventObject, type MachineGuard, type MachineOptions, type MachineReducer, type MachineReducerList, type MachineReducerRef, type MachineScope, type MachineSnapshot, type MachineStateConfig, type MachineStateValue, type MachineTransition, type MachineTransitionDefinition, type MachineUpdate, } from './state-machine';
10
9
  export { addListener, asBool, dispatch, isRtl, removeAttribute, setAttribute, setPresence, type AddListenerOptions, type AttributeOptions, type BoolOptions, type CleanupStack, type DispatchOptions, type ElementOptions, type PresenceOptions, } from '../utils/dom';
11
10
  export { addDismissableLayer, type DismissableLayerOptions } from './dismissable-layer';
12
11
  export { dispatchNativeControlChange, syncControlPresence, syncNativeControl, syncRepeatedHiddenInputs, type ControlState, type DispatchNativeControlChangeOptions, type HiddenInputState, type NativeControlState, type SyncControlPresenceOptions, type SyncNativeControlOptions, type SyncRepeatedHiddenInputsOptions, } from './form-control';
12
+ export { FOCUSABLE_SELECTOR, closestFocusable, focusFirst, focusableElements, isFocusable, trapFocus } from './focus-scope';
13
13
  export { getPathValue, normalizeOptionText, parseItemData, splitControlValues } from './option-data';
14
- export { createResizable, registerResizable, type ResizableOptions, type ResizeAxis, type ResizeEvent, type ResizeMode, type ResizePhase, } from './resizable';
14
+ export { observeSemanticChanges, type SemanticObserverOptions } from './semantic-observer';
15
+ export { createResizable, registerResizable, type ResizableOptions, type ResizeAxis, type ResizeDirection, type ResizeEvent, type ResizeMode, type ResizePhase, } from './drag-and-drop';
15
16
  export { defineManifest, propsFromSchema, type ComponentManifest, type DefineManifestOptions, type ManifestPart, type ManifestProp, type ManifestPropDetails, type ManifestToken, type PropsFromSchemaOptions, type SchemaPropDetails, } from './manifest';
16
17
  export { defineStyles, resolveStyle, type DefineStylesOptions, type ResolveStyleOptions, type StyleDefinition, type StylePart, type StyleProps, } from './styles';
17
18
  export { del as deleteRequest, get, post, put, registerRequestRuntime, type RequestLifecycleDetail, type RequestMethod, type RequestOptions, type RequestResult, } from './engine/request';
18
19
  export { applyStreamPatch, applyStreamPatches, applyUiEffect, applyUiEffects, connectStream, dispatchStreamEvent, registerStream, type PatchMode, type StreamEventPayload, type StreamPatchPayload, type UiEffectPayload, } from './engine/stream';
19
20
  export { applyThemeMode, createThemeStore, registerThemeStore, type ResolvedThemeMode, type ThemeChangeDetail, type ThemeStore, type ThemeMode, } from './theme';
20
21
  export { lockDocumentScroll, unlockDocumentScroll } from './scroll-lock';
22
+ export { registerUiMagic, ui, type UiRuntime } from './ui';
23
+ export { createTransitionCoordinator, defineHook, type AnyTransitionHook, type TransitionCallback, type TransitionContext, type TransitionCoordinator, type TransitionCoordinatorOptions, type TransitionEventCreator, type TransitionElementResolver, type TransitionHookDefinition, } from './transition-coordinator';
21
24
  type TrellisAlpineComponent<T> = Alpine.AlpineComponent<T> & {
22
25
  init(): void;
23
26
  destroy(): void;
24
27
  };
25
28
  export type { TrellisAlpineComponent };
26
- declare const ui: {
27
- readonly createAnchoredPopover: ({ reference, floating, position: getPosition, align: getAlign, gap, offset, matchReferenceWidth, }: import("./anchored-popover").AnchoredPopoverOptions) => import("./anchored-popover").AnchoredPopover;
28
- readonly createCollectionNavigation: ({ root: getRoot, itemSelector, activeAttribute, isDisabled, loop, }: import("./collection-navigation").CollectionNavigationOptions) => import("./collection-navigation").CollectionNavigation;
29
- readonly create: <const T extends Record<string, import("./create").StyleTree>>({ definition }: import("./create").CreateOptions<T>) => Readonly<T>;
30
- readonly addDismissableLayer: ({ isEnabled, roots, onDismiss, }: import("./dismissable-layer").DismissableLayerOptions) => (() => void);
31
- readonly addListener: ({ target, event, handler, cleanup, options, }: import(".").AddListenerOptions) => (() => void);
32
- readonly asBool: ({ value }: import(".").BoolOptions) => boolean;
33
- readonly dispatch: <T = unknown>({ el, name, detail }: import(".").DispatchOptions<T>) => void;
34
- readonly dispatchNativeControlChange: ({ container, fallback, marker, }: import("./form-control").DispatchNativeControlChangeOptions) => void;
35
- readonly isRtl: ({ el }: import(".").ElementOptions) => boolean;
36
- readonly removeAttribute: ({ el, attr }: Omit<import(".").AttributeOptions, "value">) => void;
37
- readonly setAttribute: ({ el, attr, value }: import(".").AttributeOptions) => void;
38
- readonly setPresence: ({ el, attr, present, value }: import(".").PresenceOptions) => void;
39
- readonly syncControlPresence: ({ el, state, value, }: import("./form-control").SyncControlPresenceOptions) => void;
40
- readonly syncNativeControl: ({ input, state, }: import("./form-control").SyncNativeControlOptions) => void;
41
- readonly syncRepeatedHiddenInputs: ({ container, state, currentKey, }: import("./form-control").SyncRepeatedHiddenInputsOptions) => string;
42
- readonly getPathValue: (item: unknown, path: string) => unknown;
43
- readonly normalizeOptionText: (value: string) => string;
44
- readonly parseItemData: (raw: string | undefined) => unknown;
45
- readonly splitControlValues: (value: string) => string[];
46
- readonly createResizable: ({ element, handle, axis, min, max, step, mode, hitArea, coarseHitArea, disabled, onStart, onResize, onEnd, }: import("./resizable").ResizableOptions) => (() => void);
47
- readonly mergeBindings: ({ inputs }: import("./merge-bindings").MergeBindingsOptions) => import("./merge-bindings").BindingObject;
48
- readonly createMachine: <TContext>(config: import("./machine").MachineConfig<TContext>, options: import("./machine").MachineOptions<TContext>) => import("./machine").Machine<TContext>;
49
- readonly createVisibilityMachine: <TContext>({ enter, exit, }?: import("./machine").VisibilityMachineConfig) => import("./machine").MachineConfig<TContext>;
50
- readonly propsFromSchema: <const T extends Record<string, import("./codecs").CodecFn<unknown>>>({ schema, details, }: import("./manifest").PropsFromSchemaOptions<T>) => Record<string, import("./manifest").ManifestProp>;
51
- readonly resolveStyle: ({ part, props, className: override, }: import("./styles").ResolveStyleOptions) => string;
52
- readonly className: ({ values }: import("./class-name").ClassNameOptions) => string;
53
- readonly cx: ({ values }: import("./class-name").ClassNameOptions) => string;
54
- readonly motion: {
55
- readonly createAnimator: <T extends string | number>(value: import("../motion").MotionValue<T> | T, defaultOptions?: import("../motion").ValueAnimationTransition<T>) => import("..").Animator<T>;
56
- readonly parallel: (...handles: import("..").MotionHandle[]) => import("..").MotionHandle;
57
- readonly sequential: (...steps: Array<() => import("..").MotionHandle>) => import("..").MotionHandle;
58
- readonly bindTransform: <T extends import("..").TransformContext>(element: HTMLElement, values: T, compose: import("..").TransformComposer<T>) => (() => void);
59
- readonly bindStyle: <T extends string | number>(element: HTMLElement, property: keyof CSSStyleDeclaration, value: import("../motion").MotionValue<T>, map?: (value: T) => string) => (() => void);
60
- readonly withReducedMotion: <T extends import("../motion").AnimationOptions>(options: T, reducedOptions?: Partial<T>, preference?: import("..").MotionPreference) => T;
61
- readonly resolveTargets: (scope?: import("..").ViewScope, targets?: import("..").MotionTarget | import("..").MotionTarget[] | null) => Element[];
62
- readonly applyViewKeys: (scope?: import("..").ViewScope, options?: {
63
- key?: string;
64
- layout?: boolean;
65
- }) => (() => void);
66
- readonly animateView: (update: () => void | Promise<void>, targets?: import("..").MotionTarget | import("..").MotionTarget[] | null, options?: import("..").AnimateViewOptions) => import("..").MotionHandle;
67
- readonly animatePresence: (element: Element, phase: import("..").PresencePhase, preset?: import("..").PresenceDefinition, options?: import("..").PresenceOptions) => import("..").MotionHandle;
68
- readonly createPresenceLifecycle: ({ element, preset, enter, exit, options, enterOptions, exitOptions, owner, }: import("..").PresenceLifecycleOptions) => import("..").PresenceLifecycle;
69
- readonly animateStreamPatch: <AlpineInstance>(_Alpine: AlpineInstance, patchOrPatches: import("../motion/stream").StreamPatchLike | import("../motion/stream").StreamPatchLike[], options?: import("..").AnimateStreamPatchOptions) => import("..").MotionHandle;
70
- };
71
- readonly get: (url: string | URL, options?: import(".").RequestOptions) => Promise<import(".").RequestResult>;
72
- readonly post: (url: string | URL, options?: import(".").RequestOptions) => Promise<import(".").RequestResult>;
73
- readonly put: (url: string | URL, options?: import(".").RequestOptions) => Promise<import(".").RequestResult>;
74
- readonly delete: (url: string | URL, options?: import(".").RequestOptions) => Promise<import(".").RequestResult>;
75
- readonly registerRequestRuntime: (AlpineInstance: Alpine.Alpine | import("./engine").StreamAlpine) => void;
76
- readonly applyStreamPatch: (AlpineInstance: import("./engine").StreamAlpine, payload: import(".").StreamPatchPayload) => void;
77
- readonly applyStreamPatches: (AlpineInstance: import("./engine").StreamAlpine, payload: import(".").StreamPatchPayload | import(".").StreamPatchPayload[]) => void;
78
- readonly applyUiEffect: (AlpineInstance: import("./engine").StreamAlpine, effect: import(".").UiEffectPayload) => void;
79
- readonly applyUiEffects: (AlpineInstance: import("./engine").StreamAlpine, effects: import(".").UiEffectPayload | import(".").UiEffectPayload[]) => void;
80
- readonly connectStream: (AlpineInstance: import("./engine").StreamAlpine, url: string) => {
81
- abort(reason?: string): void;
82
- };
83
- readonly dispatchStreamEvent: (payload: import(".").StreamEventPayload) => void;
84
- readonly applyThemeMode: (mode: import("./theme").ThemeMode) => import("./theme").ThemeChangeDetail;
85
- readonly createThemeStore: () => import("./theme").ThemeStore;
86
- readonly lockDocumentScroll: () => void;
87
- readonly registerConfirm: ({ root }?: import("./confirm").ConfirmRuntimeOptions) => void;
88
- readonly registerResizable: (AlpineInstance: Alpine.Alpine) => void;
89
- readonly registerStream: (AlpineInstance: Alpine.Alpine) => void;
90
- readonly registerThemeStore: (AlpineInstance: Alpine.Alpine) => void;
91
- readonly unregisterConfirm: () => void;
92
- readonly unlockDocumentScroll: () => void;
93
- };
94
- export { ui };
@@ -1,4 +1,4 @@
1
- import { type ClassValue } from './class-name';
1
+ import { type ClassValue } from 'clsx';
2
2
  type AttributeValue = unknown;
3
3
  export type BindingObject = Record<string, AttributeValue>;
4
4
  export type BindingInput = ClassValue | BindingObject;
@@ -0,0 +1,10 @@
1
+ type SemanticObserverOptions<T> = {
2
+ targets: Element | readonly Element[];
3
+ read(): T;
4
+ onChange(value: T, previous: T): void;
5
+ observer: MutationObserverInit;
6
+ equals?(left: T, right: T): boolean;
7
+ };
8
+ declare const observeSemanticChanges: <T>({ targets, read, onChange, observer: observerOptions, equals, }: SemanticObserverOptions<T>) => (() => void);
9
+ export { observeSemanticChanges };
10
+ export type { SemanticObserverOptions };
@@ -0,0 +1,4 @@
1
+ export { createMachine } from './machine';
2
+ export { propsChanged, propsChangedEvent } from './props-change';
3
+ export type { PropsChangedEvent } from './props-change';
4
+ export type { Machine, MachineConfig, MachineEffect, MachineEffectList, MachineEffectRef, MachineEntry, MachineEvent, MachineEventObject, MachineGuard, MachineOptions, MachineReducer, MachineReducerList, MachineReducerRef, MachineScope, MachineSnapshot, MachineStateConfig, MachineStateValue, MachineTransition, MachineTransitionDefinition, MachineUpdate, } from './machine';
@@ -0,0 +1,83 @@
1
+ type MachineEventObject = {
2
+ type: string;
3
+ [key: string]: unknown;
4
+ };
5
+ type MachineEvent = string | MachineEventObject;
6
+ type MachineStateValue = string | readonly string[];
7
+ type MachineSnapshot<TContext, TProps> = Readonly<{
8
+ value: MachineStateValue;
9
+ tags: readonly string[];
10
+ context: Readonly<TContext>;
11
+ props: Readonly<TProps>;
12
+ generations: Readonly<Record<string, number>>;
13
+ }>;
14
+ type MachineEntry<TContext, TProps> = Readonly<{
15
+ path: string;
16
+ generation: number;
17
+ from: MachineStateValue;
18
+ to: MachineStateValue;
19
+ event: MachineEventObject;
20
+ snapshot: MachineSnapshot<TContext, TProps>;
21
+ }>;
22
+ type MachineScope<TContext, TProps> = {
23
+ snapshot: MachineSnapshot<TContext, TProps>;
24
+ context: Readonly<TContext>;
25
+ props: Readonly<TProps>;
26
+ event: MachineEventObject;
27
+ state: MachineStateValue;
28
+ };
29
+ type MachineGuard<TContext = unknown, TProps = Record<string, never>> = (scope: MachineScope<TContext, TProps>) => boolean;
30
+ type MachineUpdate<TContext, TProps> = {
31
+ context?: Partial<TContext>;
32
+ props?: Partial<TProps>;
33
+ };
34
+ type MachineReducer<TContext = unknown, TProps = Record<string, never>> = (scope: MachineScope<TContext, TProps>) => MachineUpdate<TContext, TProps> | void;
35
+ type MachineEffect<TContext = unknown, TProps = Record<string, never>> = (scope: MachineScope<TContext, TProps>) => void | (() => void);
36
+ type MachineReducerRef<TContext, TProps> = string | MachineReducer<TContext, TProps>;
37
+ type MachineEffectRef<TContext, TProps> = string | MachineEffect<TContext, TProps>;
38
+ type MachineReducerList<TContext, TProps> = MachineReducerRef<TContext, TProps> | MachineReducerRef<TContext, TProps>[];
39
+ type MachineEffectList<TContext, TProps> = MachineEffectRef<TContext, TProps> | MachineEffectRef<TContext, TProps>[];
40
+ type MachineTransitionDefinition<TContext, TProps> = {
41
+ target?: string;
42
+ guard?: string | MachineGuard<TContext, TProps>;
43
+ reduce?: MachineReducerList<TContext, TProps>;
44
+ effects?: MachineEffectList<TContext, TProps>;
45
+ };
46
+ type MachineTransition<TContext, TProps = Record<string, never>> = string | MachineTransitionDefinition<TContext, TProps>;
47
+ type MachineStateConfig<TContext, TProps = Record<string, never>> = {
48
+ id?: string;
49
+ type?: 'compound' | 'parallel' | 'final';
50
+ initial?: string;
51
+ tags?: string[];
52
+ reduce?: MachineReducerList<TContext, TProps>;
53
+ entry?: MachineEffectList<TContext, TProps>;
54
+ exit?: MachineEffectList<TContext, TProps>;
55
+ on?: Record<string, MachineTransition<TContext, TProps> | Array<MachineTransition<TContext, TProps>>>;
56
+ states?: Record<string, MachineStateConfig<TContext, TProps>>;
57
+ };
58
+ type MachineConfig<TContext, TProps = Record<string, never>> = MachineStateConfig<TContext, TProps> & {
59
+ initial?: string;
60
+ states: Record<string, MachineStateConfig<TContext, TProps>>;
61
+ };
62
+ type MachineOptions<TContext, TProps = Record<string, never>> = {
63
+ context: TContext;
64
+ props?: TProps;
65
+ reducers?: Record<string, MachineReducer<TContext, TProps>>;
66
+ guards?: Record<string, MachineGuard<TContext, TProps>>;
67
+ effects?: Record<string, MachineEffect<TContext, TProps>>;
68
+ };
69
+ type Machine<TContext, TProps = Record<string, never>> = {
70
+ readonly state: MachineStateValue;
71
+ readonly context: Readonly<TContext>;
72
+ readonly props: Readonly<TProps>;
73
+ getSnapshot(): MachineSnapshot<TContext, TProps>;
74
+ send(event: MachineEvent): void;
75
+ subscribe(listener: (snapshot: MachineSnapshot<TContext, TProps>) => void): () => void;
76
+ subscribeEntries(listener: (entry: MachineEntry<TContext, TProps>) => void): () => void;
77
+ matches(state: string): boolean;
78
+ hasTag(tag: string): boolean;
79
+ stop(): void;
80
+ };
81
+ declare const createMachine: <TContext, TProps = Record<string, never>>(config: MachineConfig<TContext, TProps>, options: MachineOptions<TContext, TProps>) => Machine<TContext, TProps>;
82
+ export { createMachine };
83
+ export type { Machine, MachineConfig, MachineEffect, MachineEffectList, MachineEffectRef, MachineEntry, MachineEvent, MachineEventObject, MachineGuard, MachineOptions, MachineReducer, MachineReducerList, MachineReducerRef, MachineScope, MachineSnapshot, MachineStateConfig, MachineStateValue, MachineTransition, MachineTransitionDefinition, MachineUpdate, };
@@ -0,0 +1,12 @@
1
+ import type { MachineEventObject } from './machine';
2
+ type PropsChangedEvent<TProps> = MachineEventObject & {
3
+ type: 'PROPS_CHANGED';
4
+ props: TProps;
5
+ changes: ReadonlyArray<{
6
+ key: keyof TProps;
7
+ }>;
8
+ };
9
+ declare const propsChangedEvent: <TProps>(event: MachineEventObject) => PropsChangedEvent<TProps> | null;
10
+ declare const propsChanged: <TProps>(event: MachineEventObject, ...keys: Array<keyof TProps>) => boolean;
11
+ export { propsChanged, propsChangedEvent };
12
+ export type { PropsChangedEvent };
@@ -0,0 +1,52 @@
1
+ import type { Machine, MachineEvent, MachineEventObject, MachineSnapshot } from './state-machine';
2
+ type TransitionEventCreator = (...args: never[]) => MachineEvent;
3
+ type TransitionSend = ((event: MachineEvent) => void) & {
4
+ [name: string]: ((...args: unknown[]) => void) | undefined;
5
+ };
6
+ type TransitionHookDefinition<TContext, TProps, TData, TName extends string = string, TSends extends Record<string, TransitionEventCreator> = Record<string, TransitionEventCreator>> = Readonly<{
7
+ name: TName;
8
+ state: string;
9
+ onDone: string;
10
+ onError: string;
11
+ required?: boolean;
12
+ sends?: TSends;
13
+ project?: (snapshot: MachineSnapshot<TContext, TProps>) => TData;
14
+ projectEach?: (snapshot: MachineSnapshot<TContext, TProps>) => readonly TData[];
15
+ }>;
16
+ type AnyTransitionHook<TContext, TProps> = TransitionHookDefinition<TContext, TProps, unknown>;
17
+ type TransitionContext<TProps, TData, TElement = unknown> = Readonly<{
18
+ el: TElement;
19
+ root: TElement;
20
+ from: string;
21
+ to: string;
22
+ event: MachineEventObject;
23
+ props: TProps;
24
+ data: TData;
25
+ send: TransitionSend;
26
+ signal: AbortSignal;
27
+ }>;
28
+ type TransitionCallback<TProps, TData, TElement = unknown> = (transition: TransitionContext<TProps, TData, TElement>) => unknown | Promise<unknown>;
29
+ type TransitionCoordinatorOptions<TContext, TProps, TElement> = {
30
+ machine: Machine<TContext, TProps>;
31
+ hooks: readonly AnyTransitionHook<TContext, TProps>[];
32
+ root?: TElement;
33
+ resolveElement?: TransitionElementResolver<TElement>;
34
+ };
35
+ type TransitionElementResolver<TElement> = (scope: Readonly<{
36
+ name: string;
37
+ data: unknown;
38
+ root: TElement;
39
+ registrationEl: TElement;
40
+ }>) => TElement | null | undefined;
41
+ type TransitionCoordinator<TProps, TElement = unknown> = {
42
+ register<TData>(registration: {
43
+ name: string;
44
+ el: TElement;
45
+ callback: TransitionCallback<TProps, TData, TElement>;
46
+ }): () => void;
47
+ destroy(): void;
48
+ };
49
+ declare const defineHook: <TContext, TProps, TData, const TName extends string, const TSends extends Record<string, TransitionEventCreator> = Record<string, TransitionEventCreator>>(definition: TransitionHookDefinition<TContext, TProps, TData, TName, TSends>) => typeof definition;
50
+ declare const createTransitionCoordinator: <TContext, TProps, TElement = unknown>({ machine, hooks, root: ownerRoot, resolveElement, }: TransitionCoordinatorOptions<TContext, TProps, TElement>) => TransitionCoordinator<TProps, TElement>;
51
+ export { createTransitionCoordinator, defineHook };
52
+ export type { AnyTransitionHook, TransitionCallback, TransitionContext, TransitionCoordinator, TransitionCoordinatorOptions, TransitionEventCreator, TransitionSend, TransitionElementResolver, TransitionHookDefinition, };
@@ -0,0 +1,15 @@
1
+ import type Alpine from 'alpinejs';
2
+ import { motion } from '../motion';
3
+ import { del, get, post, put } from './engine/request';
4
+ type UiRuntime = {
5
+ readonly delete: typeof del;
6
+ readonly get: typeof get;
7
+ readonly post: typeof post;
8
+ readonly put: typeof put;
9
+ readonly isFetching: boolean;
10
+ readonly motion: typeof motion;
11
+ };
12
+ declare const ui: UiRuntime;
13
+ declare const registerUiMagic: (AlpineInstance: Alpine.Alpine) => void;
14
+ export { registerUiMagic, ui };
15
+ export type { UiRuntime };
@@ -1,3 +1,4 @@
1
1
  export { addListener, asBool, dispatch, isRtl, removeAttribute, setAttribute, setPresence, type AddListenerOptions, type AttributeOptions, type BoolOptions, type CleanupStack, type DispatchOptions, type ElementOptions, type PresenceOptions, } from './dom';
2
- export { isRecord } from './object';
2
+ export { cloneSerializable, isPromiseLike, isRecord, isSerializableEqual } from './object';
3
+ export { clamp } from './number';
3
4
  export { warn } from './warn';
@@ -0,0 +1,2 @@
1
+ declare const clamp: (value: number, min: number, max: number) => number;
2
+ export { clamp };
@@ -1,2 +1,5 @@
1
1
  declare const isRecord: (value: unknown) => value is Record<string, unknown>;
2
- export { isRecord };
2
+ declare const cloneSerializable: <T>(value: T) => T;
3
+ declare const isSerializableEqual: (left: unknown, right: unknown) => boolean;
4
+ declare const isPromiseLike: (value: unknown) => value is PromiseLike<unknown>;
5
+ export { cloneSerializable, isPromiseLike, isRecord, isSerializableEqual };