@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
@@ -1,7 +1,10 @@
1
1
  import type Alpine from 'alpinejs';
2
- import { type BindingObject, type CleanupStack, type Machine, type PropState, type TrellisAlpineComponent } from '../../runtime';
3
- import type { PresenceLifecycle, PresencePhase } from '../../motion';
2
+ import { type AlpineMachine, type TrellisAlpineComponent } from '../../runtime';
3
+ import { type SchemaToProps } from '../../runtime/codecs';
4
+ import { type BindingObject } from '../../runtime/merge-bindings';
5
+ import { type MotionHandle, type MotionTransitionSubject } from '../../motion';
4
6
  import { type SidebarProps, type SidebarToggleAction } from './contract';
7
+ import { sidebarHooks, type SidebarContext, type SidebarMode } from './machine';
5
8
  type SidebarController = {
6
9
  readonly id: string;
7
10
  isExpanded(): boolean;
@@ -10,104 +13,64 @@ type SidebarController = {
10
13
  };
11
14
  declare const togglePropsSchema: {
12
15
  target: import("../../runtime/codecs").StringCodec;
13
- action: import("../../runtime/codecs").OneOfCodec<"close" | "toggle" | "open" | "stash" | "expand">;
16
+ action: import("../../runtime/codecs").OneOfCodec<"close" | "toggle" | "open" | "expand" | "stash">;
14
17
  class: import("../../runtime/codecs").StringCodec;
15
18
  };
16
- type SidebarToggleProps = PropState<typeof togglePropsSchema>;
17
- declare const edgePropsSchema: {
18
- target: import("../../runtime/codecs").StringCodec;
19
- action: import("../../runtime/codecs").OneOfCodec<"close" | "toggle" | "open" | "stash" | "expand">;
20
- class: import("../../runtime/codecs").StringCodec;
21
- };
22
- type SidebarEdgeProps = PropState<typeof edgePropsSchema>;
23
- type SidebarMachineContext = {
24
- desktopStashed: boolean;
25
- };
26
- type SidebarData = SidebarController & {
27
- props: SidebarProps;
28
- machine: Machine<SidebarMachineContext>;
29
- readonly mobileOpen: boolean;
30
- readonly desktopStashed: boolean;
31
- readonly desktopDrawerOpen: boolean;
32
- readonly drawerExiting: boolean;
33
- readonly sidebarExiting: boolean;
34
- sidebarExitFreezeCleanup: (() => void) | null;
35
- drawerMotionRun: number;
36
- readonly drawerMotionPhase: PresencePhase | null;
37
- desktopMode: boolean;
38
- renderedExpanded: boolean;
39
- renderedDrawerOpen: boolean;
40
- lastPointer: {
41
- clientX: number;
42
- clientY: number;
43
- } | null;
44
- activeTrigger: HTMLElement | null;
45
- currentWidth: string;
46
- cleanup: CleanupStack;
47
- drawerMotion: PresenceLifecycle | null;
48
- backdropMotion: PresenceLifecycle | null;
49
- hasScrollLock: boolean;
50
- mediaQuery: MediaQueryList | null;
51
- mediaQueryCleanup: (() => void) | null;
52
- root: BindingObject;
53
- setupMediaQuery(): void;
54
- applyProps(changedKeys?: string[]): void;
55
- isDesktop(): boolean;
56
- isMobileCollapsible(): boolean;
57
- isDesktopCollapsible(): boolean;
58
- hasOpenDrawer(): boolean;
59
- isExpanded(): boolean;
19
+ type SidebarToggleProps = SchemaToProps<typeof togglePropsSchema>;
20
+ type SidebarEdgeProps = SidebarToggleProps;
21
+ /** Public Alpine API for `ui.sidebar`. @public */
22
+ interface UiSidebarApi {
23
+ /** Sidebar id used by external controls. */
24
+ readonly id: string;
25
+ /** Whether the sidebar is fully open or currently opening. */
26
+ readonly isOpen: boolean;
27
+ /** Whether the observed shell is at or above the theme-generated shell breakpoint. */
28
+ readonly isDesktop: boolean;
29
+ /** Whether side placement is persistently stashed on desktop. */
30
+ readonly isStashed: boolean;
31
+ /** Current side-placement track width. */
32
+ readonly width: string;
33
+ /** Current top-placement track height. */
34
+ readonly height: string;
35
+ /** Opens the responsive drawer or temporarily reveals a stashed desktop sidebar. */
36
+ open(event?: Event): void;
37
+ /** Closes the responsive drawer or stashes an expanded desktop sidebar. */
38
+ close(event?: Event): void;
39
+ /** Reverses the current visibility intent, including an in-flight transition. */
40
+ toggle(event?: Event): void;
41
+ /** Permanently removes side placement from the desktop layout track. */
42
+ stash(event?: Event): void;
43
+ /** Permanently restores side placement to the desktop layout track. */
44
+ expand(event?: Event): void;
45
+ }
46
+ type SidebarData = AlpineMachine<SidebarContext, SidebarProps, typeof sidebarHooks> & UiSidebarApi & {
47
+ readonly root: BindingObject;
48
+ init(): void;
49
+ destroy(): void;
60
50
  perform(action: SidebarToggleAction, trigger?: HTMLElement | null): void;
61
- open(trigger?: HTMLElement | null): void;
62
- close(trigger?: HTMLElement | null): void;
63
- closeTemporaryDrawer(trigger?: HTMLElement | null, event?: MouseEvent): void;
64
- handleBreakpointChange(): void;
65
- handlePointerMove(event: Event): void;
66
- pointerWithinEdge(event: MouseEvent): boolean;
67
- pointerWithinRevealArea(event: MouseEvent): boolean;
68
- pointerWithinDrawer(pointer: {
69
- clientX: number;
70
- clientY: number;
71
- }): boolean;
72
- toggle(trigger?: HTMLElement | null): void;
73
- syncAll(): void;
74
- syncApp(): void;
75
- syncRoot(): void;
76
- syncBackdrop(): void;
77
- syncEdge(): void;
78
51
  syncToggles(): void;
79
- syncStateIcons(): void;
80
- animateDrawerEnter(): void;
81
- animateDrawerExit(run: number): void;
82
- animateSidebarEnter(run: number): void;
83
- animateSidebarExit(run: number, freezeCleanup?: (() => void) | null, withBackdrop?: boolean): void;
84
- finishSidebarExit(run: number, freezeCleanup?: (() => void) | null): void;
85
- freezeSidebarForExit(): (() => void) | null;
86
- clearSidebarExitFreeze(freezeCleanup?: (() => void) | null): void;
87
- handleResize(event: Event): void;
88
- setupGroups(): void;
89
- appEl(): HTMLElement | null;
90
- backdropEl(): HTMLElement | null;
91
- edgeEls(): HTMLElement[];
92
- focusRestoreTarget(trigger?: HTMLElement | null): HTMLElement | null;
93
- moveFocusBeforeHide(target: HTMLElement | null): void;
94
- storageKey(): string;
95
- storedStashed(): boolean | null;
96
- persistStashed(): void;
52
+ isExpanded(): boolean;
53
+ transitionSidebar(transition: SidebarMotionTransition): MotionHandle;
97
54
  };
55
+ type SidebarMotionTransition = MotionTransitionSubject & Readonly<{
56
+ data: {
57
+ mode: SidebarMode;
58
+ presentation: 'drawer' | 'layout';
59
+ };
60
+ to: string;
61
+ }>;
98
62
  declare const UiSidebar: () => TrellisAlpineComponent<SidebarData>;
99
63
  declare const UiSidebarToggle: () => TrellisAlpineComponent<{
100
64
  props: SidebarToggleProps;
101
- root: BindingObject;
102
- targetId(): string;
65
+ readonly root: BindingObject;
103
66
  trigger(event?: Event): void;
104
67
  }>;
105
68
  declare const UiSidebarEdge: () => TrellisAlpineComponent<{
106
69
  props: SidebarEdgeProps;
107
- root: BindingObject;
108
- targetId(): string;
70
+ readonly root: BindingObject;
109
71
  trigger(event?: Event): void;
72
+ leave(event?: Event): void;
110
73
  }>;
111
74
  declare const registerSidebar: (AlpineInstance: Alpine.Alpine) => void;
112
- export { registerSidebar, UiSidebar, UiSidebarEdge, UiSidebarToggle, };
113
- export type { SidebarController, SidebarData };
75
+ export { registerSidebar, UiSidebar, UiSidebarEdge, UiSidebarToggle };
76
+ export type { SidebarController, SidebarData, UiSidebarApi };
@@ -0,0 +1,100 @@
1
+ import { type Machine } from '../../runtime/state-machine';
2
+ import type { SidebarProps } from './contract';
3
+ type SidebarMode = 'mobile' | 'desktop';
4
+ type SidebarPresentation = 'drawer' | 'layout';
5
+ type SidebarTarget = 'mobileClosed' | 'mobileOpen' | 'desktopExpanded' | 'desktopStashed' | 'desktopDrawer' | 'desktopTop';
6
+ type SidebarContext = {
7
+ responsive: {
8
+ mode: SidebarMode;
9
+ };
10
+ layout: {
11
+ desktopStashed: boolean;
12
+ desktopDrawerOpen: boolean;
13
+ width: string;
14
+ height: string;
15
+ };
16
+ transition: {
17
+ target: SidebarTarget;
18
+ presentation: SidebarPresentation;
19
+ };
20
+ };
21
+ type SidebarMachineEffects = {
22
+ prepareOpen(): void;
23
+ finishOpen(): void;
24
+ prepareClose(): void;
25
+ finishClose(): void;
26
+ sync(): void;
27
+ syncProps(): void;
28
+ };
29
+ type CreateSidebarMachineOptions = {
30
+ props: SidebarProps;
31
+ mode: SidebarMode;
32
+ desktopStashed: boolean;
33
+ effects: SidebarMachineEffects;
34
+ };
35
+ declare const sidebarHooks: readonly [Readonly<{
36
+ name: "opening";
37
+ state: string;
38
+ onDone: string;
39
+ onError: string;
40
+ required?: boolean;
41
+ sends?: Record<string, import("../..").TransitionEventCreator>;
42
+ project?: (snapshot: Readonly<{
43
+ value: import("../..").MachineStateValue;
44
+ tags: readonly string[];
45
+ context: Readonly<SidebarContext>;
46
+ props: Readonly<unknown>;
47
+ generations: Readonly<Record<string, number>>;
48
+ }>) => {
49
+ mode: SidebarMode;
50
+ presentation: SidebarPresentation;
51
+ width: string;
52
+ height: string;
53
+ };
54
+ projectEach?: (snapshot: Readonly<{
55
+ value: import("../..").MachineStateValue;
56
+ tags: readonly string[];
57
+ context: Readonly<SidebarContext>;
58
+ props: Readonly<unknown>;
59
+ generations: Readonly<Record<string, number>>;
60
+ }>) => readonly {
61
+ mode: SidebarMode;
62
+ presentation: SidebarPresentation;
63
+ width: string;
64
+ height: string;
65
+ }[];
66
+ }>, Readonly<{
67
+ name: "closing";
68
+ state: string;
69
+ onDone: string;
70
+ onError: string;
71
+ required?: boolean;
72
+ sends?: Record<string, import("../..").TransitionEventCreator>;
73
+ project?: (snapshot: Readonly<{
74
+ value: import("../..").MachineStateValue;
75
+ tags: readonly string[];
76
+ context: Readonly<SidebarContext>;
77
+ props: Readonly<unknown>;
78
+ generations: Readonly<Record<string, number>>;
79
+ }>) => {
80
+ mode: SidebarMode;
81
+ presentation: SidebarPresentation;
82
+ width: string;
83
+ height: string;
84
+ };
85
+ projectEach?: (snapshot: Readonly<{
86
+ value: import("../..").MachineStateValue;
87
+ tags: readonly string[];
88
+ context: Readonly<SidebarContext>;
89
+ props: Readonly<unknown>;
90
+ generations: Readonly<Record<string, number>>;
91
+ }>) => readonly {
92
+ mode: SidebarMode;
93
+ presentation: SidebarPresentation;
94
+ width: string;
95
+ height: string;
96
+ }[];
97
+ }>];
98
+ declare const createSidebarMachine: ({ props, mode, desktopStashed, effects }: CreateSidebarMachineOptions) => Machine<SidebarContext, SidebarProps>;
99
+ export { createSidebarMachine, sidebarHooks };
100
+ export type { CreateSidebarMachineOptions, SidebarContext, SidebarMachineEffects, SidebarMode, SidebarPresentation, SidebarTarget };
@@ -0,0 +1,2 @@
1
+ declare const sidebarRuntimeDocs: import("../../docs/transition-docs").ComponentTransitionDocs;
2
+ export { sidebarRuntimeDocs };
@@ -1,4 +1,4 @@
1
- import { type PropState } from '../../runtime';
1
+ import { type SchemaToProps } from '../../runtime';
2
2
  import { type ControlSize, type DefaultVariant, type Orientation } from '../common';
3
3
  declare const SLIDER_SIZES: readonly ["xs", "sm", "md", "lg", "xlg"];
4
4
  declare const SLIDER_VARIANTS: readonly ["default"];
@@ -50,7 +50,7 @@ declare const sliderTickSchema: {
50
50
  label: import("../../runtime/codecs").StringCodec;
51
51
  class: import("../../runtime/codecs").StringCodec;
52
52
  };
53
- type SliderProps = PropState<typeof sliderSchema>;
54
- type SliderTickProps = PropState<typeof sliderTickSchema>;
53
+ type SliderProps = SchemaToProps<typeof sliderSchema>;
54
+ type SliderTickProps = SchemaToProps<typeof sliderTickSchema>;
55
55
  export { SLIDER_FORMATS, SLIDER_ORIENTATIONS, SLIDER_SIZES, SLIDER_VARIANTS, sliderSchema, sliderTickSchema, };
56
56
  export type { SliderFormat, SliderOrientation, SliderProps, SliderSize, SliderTickProps, SliderVariant, };
@@ -1,7 +1,7 @@
1
1
  import type Alpine from 'alpinejs';
2
- import { type CleanupStack, type TrellisAlpineComponent } from '../../runtime';
2
+ import { type AlpineMachine, type TrellisAlpineComponent } from '../../runtime';
3
3
  import { type SliderProps } from './contract';
4
- type SliderThumbName = 'single' | 'lower' | 'upper';
4
+ import { type SliderContext, sliderHooks, type SliderThumbName, type SliderValues } from './machine';
5
5
  type SliderElements = {
6
6
  root: HTMLElement;
7
7
  track: HTMLElement | null;
@@ -16,26 +16,22 @@ type SliderElements = {
16
16
  hiddenInputs: HTMLElement | null;
17
17
  ticks: HTMLElement[];
18
18
  };
19
- type SliderValues = {
20
- lower: number;
21
- upper: number;
22
- };
23
- type SliderData = {
24
- props: SliderProps;
25
- listeners: CleanupStack;
26
- hiddenInputsKey: string;
27
- draggingThumb: SliderThumbName | null;
28
- elements(): SliderElements;
29
- applyProps(changedKeys?: string[]): void;
30
- sync(): void;
31
- syncFromInput(event: Event): void;
32
- commitFromInput(event: Event): void;
33
- handleKeydown(event: KeyboardEvent): void;
34
- handlePointerDown(event: PointerEvent): void;
35
- handlePointerMove(event: PointerEvent): void;
36
- handlePointerUp(event: PointerEvent): void;
19
+ /**
20
+ * Public Alpine API for `ui.slider`.
21
+ *
22
+ * @public
23
+ */
24
+ interface UiSliderApi {
25
+ /** Current normalized values: one item for single mode, lower and upper for range mode. */
26
+ readonly values: readonly number[];
27
+ /** Set and commit a normalized single value or lower/upper range. */
28
+ setValue(value: number | readonly [number, number]): void;
29
+ }
30
+ type SliderData = AlpineMachine<SliderContext, SliderProps, typeof sliderHooks> & UiSliderApi & {
31
+ init(): void;
32
+ destroy(): void;
37
33
  };
38
34
  declare const UiSlider: () => TrellisAlpineComponent<SliderData>;
39
35
  declare const registerSlider: (AlpineInstance: Alpine.Alpine) => void;
40
36
  export { registerSlider, UiSlider };
41
- export type { SliderData, SliderElements, SliderThumbName, SliderValues };
37
+ export type { SliderData, SliderElements, SliderThumbName, SliderValues, UiSliderApi };
@@ -0,0 +1,37 @@
1
+ import { type Machine, type MachineScope } from '../../runtime/state-machine';
2
+ import type { SliderProps } from './contract';
3
+ type SliderThumbName = 'single' | 'lower' | 'upper';
4
+ type SliderValues = {
5
+ lower: number;
6
+ upper: number;
7
+ };
8
+ type SliderContext = {
9
+ value: SliderValues;
10
+ interaction: {
11
+ activeThumb: SliderThumbName | null;
12
+ };
13
+ };
14
+ type SliderMachineEffects = {
15
+ sync(scope: MachineScope<SliderContext, SliderProps>): void;
16
+ beginDrag(scope: MachineScope<SliderContext, SliderProps>): void;
17
+ endDrag(scope: MachineScope<SliderContext, SliderProps>): void;
18
+ emitInput(scope: MachineScope<SliderContext, SliderProps>): void;
19
+ emitChange(scope: MachineScope<SliderContext, SliderProps>): void;
20
+ };
21
+ type CreateSliderMachineOptions = {
22
+ props: SliderProps;
23
+ context: SliderContext;
24
+ effects: SliderMachineEffects;
25
+ };
26
+ declare const sliderHooks: readonly [];
27
+ declare const sliderBounds: (props: SliderProps) => {
28
+ min: number;
29
+ max: number;
30
+ step: number;
31
+ bigStep: number;
32
+ };
33
+ declare const normalizeSliderValues: (props: SliderProps, values: SliderValues, changedThumb?: SliderThumbName | null) => SliderValues;
34
+ declare const initialSliderValues: (props: SliderProps) => SliderValues;
35
+ declare const createSliderMachine: ({ props, context, effects }: CreateSliderMachineOptions) => Machine<SliderContext, SliderProps>;
36
+ export { createSliderMachine, initialSliderValues, normalizeSliderValues, sliderBounds, sliderHooks, };
37
+ export type { CreateSliderMachineOptions, SliderContext, SliderMachineEffects, SliderThumbName, SliderValues, };
@@ -0,0 +1,2 @@
1
+ declare const sliderRuntimeDocs: import("../../docs/transition-docs").ComponentTransitionDocs;
2
+ export { sliderRuntimeDocs };
@@ -1,29 +1,28 @@
1
- import { type PropState } from '../../runtime';
1
+ import { type SchemaToProps } from '../../runtime';
2
2
  import { type LayoutAlign, type LayoutAs, type LayoutJustify, type LayoutSpace } from '../layout';
3
3
  declare const STACK_DISPLAYS: readonly ["grid", "inline-grid", "none"];
4
4
  declare const stackSchema: {
5
- padding: import("../../runtime/codecs").OneOfCodec<"0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9">;
6
- paddingX: import("../../runtime/codecs").OneOfCodec<"0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9">;
7
- paddingY: import("../../runtime/codecs").OneOfCodec<"0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9">;
8
- margin: import("../../runtime/codecs").OneOfCodec<"0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9">;
9
- marginX: import("../../runtime/codecs").OneOfCodec<"0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9">;
10
- marginY: import("../../runtime/codecs").OneOfCodec<"0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9">;
11
- surface: import("../../runtime/codecs").OneOfCodec<"none" | "subtle" | "accent" | "app" | "chrome" | "panel" | "raised" | "overlay" | "inverse">;
12
- tone: import("../../runtime/codecs").OneOfCodec<"solid" | "alpha">;
5
+ padding: import("../../runtime/codecs").OneOfCodec<"1" | "0" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | "10" | "11" | "12" | "0.5" | "1.5" | "2.5" | "3.5" | "4.5" | "5.5" | "6.5" | "7.5" | "8.5" | "9.5" | "10.5" | "11.5">;
6
+ paddingX: import("../../runtime/codecs").OneOfCodec<"1" | "0" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | "10" | "11" | "12" | "0.5" | "1.5" | "2.5" | "3.5" | "4.5" | "5.5" | "6.5" | "7.5" | "8.5" | "9.5" | "10.5" | "11.5">;
7
+ paddingY: import("../../runtime/codecs").OneOfCodec<"1" | "0" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | "10" | "11" | "12" | "0.5" | "1.5" | "2.5" | "3.5" | "4.5" | "5.5" | "6.5" | "7.5" | "8.5" | "9.5" | "10.5" | "11.5">;
8
+ margin: import("../../runtime/codecs").OneOfCodec<"1" | "0" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | "10" | "11" | "12" | "0.5" | "1.5" | "2.5" | "3.5" | "4.5" | "5.5" | "6.5" | "7.5" | "8.5" | "9.5" | "10.5" | "11.5">;
9
+ marginX: import("../../runtime/codecs").OneOfCodec<"1" | "0" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | "10" | "11" | "12" | "0.5" | "1.5" | "2.5" | "3.5" | "4.5" | "5.5" | "6.5" | "7.5" | "8.5" | "9.5" | "10.5" | "11.5">;
10
+ marginY: import("../../runtime/codecs").OneOfCodec<"1" | "0" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | "10" | "11" | "12" | "0.5" | "1.5" | "2.5" | "3.5" | "4.5" | "5.5" | "6.5" | "7.5" | "8.5" | "9.5" | "10.5" | "11.5">;
11
+ surface: import("../../runtime/codecs").OneOfCodec<"1" | "0" | "2" | "inherit" | "3" | "4" | "5" | "6" | "7" | "8" | "+1" | "+2" | "+3" | "+4" | "+5" | "+6" | "+7" | "+8">;
13
12
  radius: import("../../runtime/codecs").OneOfCodec<"none" | "xs" | "sm" | "md" | "lg" | "full">;
14
- elevation: import("../../runtime/codecs").OneOfCodec<"1" | "none" | "2" | "3" | "4" | "5" | "6">;
13
+ elevation: import("../../runtime/codecs").OneOfCodec<"1" | "match" | "2" | "none" | "3" | "4" | "5" | "6" | "7" | "8">;
15
14
  width: import("../../runtime/codecs").OneOfCodec<"xs" | "sm" | "md" | "lg" | "full" | "auto" | "xl" | "prose">;
16
15
  height: import("../../runtime/codecs").OneOfCodec<"xs" | "sm" | "md" | "lg" | "full" | "auto" | "xl">;
17
16
  class: import("../../runtime/codecs").StringCodec;
18
- align: import("../../runtime/codecs").OneOfCodec<"end" | "center" | "start" | "stretch" | "baseline">;
19
- justify: import("../../runtime/codecs").OneOfCodec<"end" | "center" | "start" | "between">;
20
- gap: import("../../runtime/codecs").OneOfCodec<"0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9">;
21
- gapX: import("../../runtime/codecs").OneOfCodec<"0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9">;
22
- gapY: import("../../runtime/codecs").OneOfCodec<"0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9">;
17
+ align: import("../../runtime/codecs").OneOfCodec<"start" | "center" | "end" | "stretch" | "baseline">;
18
+ justify: import("../../runtime/codecs").OneOfCodec<"start" | "center" | "end" | "between">;
19
+ gap: import("../../runtime/codecs").OneOfCodec<"1" | "0" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | "10" | "11" | "12" | "0.5" | "1.5" | "2.5" | "3.5" | "4.5" | "5.5" | "6.5" | "7.5" | "8.5" | "9.5" | "10.5" | "11.5">;
20
+ gapX: import("../../runtime/codecs").OneOfCodec<"1" | "0" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | "10" | "11" | "12" | "0.5" | "1.5" | "2.5" | "3.5" | "4.5" | "5.5" | "6.5" | "7.5" | "8.5" | "9.5" | "10.5" | "11.5">;
21
+ gapY: import("../../runtime/codecs").OneOfCodec<"1" | "0" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | "10" | "11" | "12" | "0.5" | "1.5" | "2.5" | "3.5" | "4.5" | "5.5" | "6.5" | "7.5" | "8.5" | "9.5" | "10.5" | "11.5">;
23
22
  as: import("../../runtime/codecs").OneOfCodec<"article" | "aside" | "div" | "footer" | "form" | "header" | "li" | "main" | "nav" | "ol" | "section" | "span" | "ul">;
24
- display: import("../../runtime/codecs").OneOfCodec<"grid" | "none" | "inline-grid">;
23
+ display: import("../../runtime/codecs").OneOfCodec<"none" | "grid" | "inline-grid">;
25
24
  };
26
25
  type StackDisplay = typeof STACK_DISPLAYS[number];
27
- type StackProps = PropState<typeof stackSchema>;
26
+ type StackProps = SchemaToProps<typeof stackSchema>;
28
27
  export { STACK_DISPLAYS, stackSchema, };
29
28
  export type { LayoutAlign as StackAlign, LayoutAs as StackAs, LayoutJustify as StackJustify, LayoutSpace as StackSpace, StackDisplay, StackProps, };
@@ -0,0 +1,9 @@
1
+ declare const GENERATED_SURFACE_TOKENS: {
2
+ name: string;
3
+ description: string;
4
+ }[];
5
+ declare const GENERATED_ELEVATION_TOKENS: {
6
+ name: string;
7
+ description: string;
8
+ }[];
9
+ export { GENERATED_ELEVATION_TOKENS, GENERATED_SURFACE_TOKENS };
@@ -1,4 +1,4 @@
1
- import { type PropState } from '../../runtime';
1
+ import { type SchemaToProps } from '../../runtime';
2
2
  import { type ControlSize, type DefaultVariant } from '../common';
3
3
  declare const SWITCH_PLACEMENTS: readonly ["trailing", "leading"];
4
4
  declare const SWITCH_SIZES: readonly ["xs", "sm", "md", "lg", "xlg"];
@@ -11,10 +11,10 @@ declare const switchControlSchema: {
11
11
  name: import("../../runtime/codecs").StringCodec;
12
12
  label: import("../../runtime/codecs").StringCodec;
13
13
  description: import("../../runtime/codecs").StringCodec;
14
- checked: import("../../runtime/codecs").BoolCodec;
15
- disabled: import("../../runtime/codecs").BoolCodec;
16
- required: import("../../runtime/codecs").BoolCodec;
17
- invalid: import("../../runtime/codecs").BoolCodec;
14
+ checked: import("../..").CodecFn<boolean>;
15
+ disabled: import("../..").CodecFn<boolean>;
16
+ required: import("../..").CodecFn<boolean>;
17
+ invalid: import("../..").CodecFn<boolean>;
18
18
  placement: import("../../runtime/codecs").OneOfCodec<"leading" | "trailing">;
19
19
  variant: import("../../runtime/codecs").OneOfCodec<"default">;
20
20
  size: import("../../runtime/codecs").OneOfCodec<"xs" | "sm" | "md" | "lg" | "xlg">;
@@ -36,10 +36,10 @@ declare const switchSchema: {
36
36
  fieldClass: import("../../runtime/codecs").StringCodec;
37
37
  value: import("../../runtime/codecs").StringCodec;
38
38
  name: import("../../runtime/codecs").StringCodec;
39
- checked: import("../../runtime/codecs").BoolCodec;
40
- disabled: import("../../runtime/codecs").BoolCodec;
41
- required: import("../../runtime/codecs").BoolCodec;
42
- invalid: import("../../runtime/codecs").BoolCodec;
39
+ checked: import("../..").CodecFn<boolean>;
40
+ disabled: import("../..").CodecFn<boolean>;
41
+ required: import("../..").CodecFn<boolean>;
42
+ invalid: import("../..").CodecFn<boolean>;
43
43
  placement: import("../../runtime/codecs").OneOfCodec<"leading" | "trailing">;
44
44
  variant: import("../../runtime/codecs").OneOfCodec<"default">;
45
45
  size: import("../../runtime/codecs").OneOfCodec<"xs" | "sm" | "md" | "lg" | "xlg">;
@@ -51,7 +51,7 @@ declare const switchSchema: {
51
51
  descriptionClass: import("../../runtime/codecs").StringCodec;
52
52
  class: import("../../runtime/codecs").StringCodec;
53
53
  };
54
- type SwitchControlProps = PropState<typeof switchControlSchema>;
55
- type SwitchProps = PropState<typeof switchSchema>;
54
+ type SwitchControlProps = SchemaToProps<typeof switchControlSchema>;
55
+ type SwitchProps = SchemaToProps<typeof switchSchema>;
56
56
  export { SWITCH_PLACEMENTS, SWITCH_SIZES, SWITCH_VARIANTS, switchControlSchema, switchSchema, };
57
57
  export type { SwitchPlacement, SwitchControlProps, SwitchProps, SwitchSize, SwitchVariant, };
@@ -1,24 +1,19 @@
1
1
  import type Alpine from 'alpinejs';
2
- import { type CleanupStack, type TrellisAlpineComponent } from '../../runtime';
2
+ import { type AlpineMachine, type TrellisAlpineComponent } from '../../runtime';
3
3
  import { type SwitchControlProps } from './contract';
4
- type SwitchItem = {
5
- root: HTMLElement;
6
- input: HTMLInputElement;
7
- track: HTMLElement | null;
8
- thumb: HTMLElement | null;
9
- disabled: boolean;
10
- required: boolean;
11
- invalid: boolean;
12
- };
13
- type SwitchData = {
14
- props: SwitchControlProps;
15
- listeners: CleanupStack;
16
- input(): HTMLInputElement;
17
- item(): SwitchItem;
18
- sync(): void;
19
- toggleFromEnter(event: KeyboardEvent): void;
4
+ import { switchHooks, type SwitchContext } from './machine';
5
+ /** Public Alpine API for `ui.switch` and `ui.switch.control`. @public */
6
+ interface UiSwitchApi {
7
+ /** Current settled checked state. */
8
+ readonly checked: boolean;
9
+ /** Set and commit the checked state. */
10
+ setChecked(checked: boolean): void;
11
+ }
12
+ type SwitchData = AlpineMachine<SwitchContext, SwitchControlProps, typeof switchHooks> & UiSwitchApi & {
13
+ init(): void;
14
+ destroy(): void;
20
15
  };
21
16
  declare const UiSwitch: () => TrellisAlpineComponent<SwitchData>;
22
17
  declare const registerSwitch: (AlpineInstance: Alpine.Alpine) => void;
23
18
  export { registerSwitch, UiSwitch };
24
- export type { SwitchData, SwitchItem };
19
+ export type { SwitchData, UiSwitchApi };
@@ -0,0 +1,19 @@
1
+ import { type Machine, type MachineScope } from '../../runtime/state-machine';
2
+ import type { SwitchControlProps } from './contract';
3
+ type SwitchContext = {
4
+ selection: {
5
+ checked: boolean;
6
+ };
7
+ };
8
+ type SwitchEffects = {
9
+ sync(scope: MachineScope<SwitchContext, SwitchControlProps>): void;
10
+ emitInput(scope: MachineScope<SwitchContext, SwitchControlProps>): void;
11
+ emitChange(scope: MachineScope<SwitchContext, SwitchControlProps>): void;
12
+ };
13
+ declare const switchHooks: readonly [];
14
+ declare const createSwitchMachine: ({ props, effects }: {
15
+ props: SwitchControlProps;
16
+ effects: SwitchEffects;
17
+ }) => Machine<SwitchContext, SwitchControlProps>;
18
+ export { createSwitchMachine, switchHooks };
19
+ export type { SwitchContext, SwitchEffects };
@@ -0,0 +1,2 @@
1
+ declare const switchRuntimeDocs: import("../../docs/transition-docs").ComponentTransitionDocs;
2
+ export { switchRuntimeDocs };