@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.
- package/package.json +8 -4
- package/packages/client/src/components/app/styles.css +1 -30
- package/packages/client/src/components/button/styles.css +1 -122
- package/packages/client/src/components/date-picker/styles.css +47 -77
- package/packages/client/src/components/field/styles.css +10 -0
- package/packages/client/src/components/file-upload/styles.css +0 -28
- package/packages/client/src/components/panels/styles.css +43 -0
- package/packages/client/src/components/radio/styles.css +26 -21
- package/packages/client/src/components/scroll-area/styles.css +0 -4
- package/packages/client/src/components/select/styles.css +0 -30
- package/packages/client/src/components/sidebar/styles.css +8 -0
- package/packages/client/src/components/toast/styles.css +14 -7
- package/packages/client/src/styles/components.css +1 -0
- package/packages/client/src/styles/generated/theme-fonts.css +5 -0
- package/packages/client/src/styles/generated/theme-palette.css +2656 -0
- package/packages/client/src/styles/generated/theme-runtime.css +2966 -0
- package/packages/client/src/styles/generated-sources.css +1 -1
- package/packages/client/src/styles/static.css +1 -0
- package/packages/client/src/styles/theme.css +777 -738
- package/packages/client/types/cdn.d.ts +1 -4
- package/packages/client/types/component-api.d.ts +21 -0
- package/packages/client/types/components/accordion/contract.d.ts +3 -2
- package/packages/client/types/components/accordion/index.d.ts +28 -42
- package/packages/client/types/components/accordion/machine.d.ts +131 -0
- package/packages/client/types/components/accordion/runtime-docs.d.ts +2 -0
- package/packages/client/types/components/action/contract.d.ts +3 -3
- package/packages/client/types/components/app/contract.d.ts +25 -12
- package/packages/client/types/components/app/index.d.ts +2 -2
- package/packages/client/types/components/badge/contract.d.ts +5 -5
- package/packages/client/types/components/box/contract.d.ts +25 -28
- package/packages/client/types/components/brand/contract.d.ts +2 -2
- package/packages/client/types/components/button/contract.d.ts +5 -5
- package/packages/client/types/components/card/contract.d.ts +28 -31
- package/packages/client/types/components/checkbox/contract.d.ts +17 -17
- package/packages/client/types/components/checkbox/index.d.ts +20 -26
- package/packages/client/types/components/checkbox/machine.d.ts +41 -0
- package/packages/client/types/components/checkbox/runtime-docs.d.ts +2 -0
- package/packages/client/types/components/common.d.ts +53 -235
- package/packages/client/types/components/container/contract.d.ts +11 -12
- package/packages/client/types/components/date-picker/contract.d.ts +21 -16
- package/packages/client/types/components/date-picker/index.d.ts +38 -60
- package/packages/client/types/components/date-picker/machine.d.ts +529 -0
- package/packages/client/types/components/date-picker/runtime-docs.d.ts +2 -0
- package/packages/client/types/components/date-picker/value.d.ts +28 -0
- package/packages/client/types/components/dropdown/contract.d.ts +4 -4
- package/packages/client/types/components/dropdown/index.d.ts +20 -45
- package/packages/client/types/components/dropdown/machine.d.ts +93 -0
- package/packages/client/types/components/dropdown/runtime-docs.d.ts +2 -0
- package/packages/client/types/components/field/contract.d.ts +10 -6
- package/packages/client/types/components/field/index.d.ts +6 -6
- package/packages/client/types/components/field/machine.d.ts +13 -0
- package/packages/client/types/components/field/runtime-docs.d.ts +2 -0
- package/packages/client/types/components/file-upload/contract.d.ts +7 -4
- package/packages/client/types/components/file-upload/index.d.ts +34 -31
- package/packages/client/types/components/file-upload/machine.d.ts +127 -0
- package/packages/client/types/components/file-upload/runtime-docs.d.ts +2 -0
- package/packages/client/types/components/flex/contract.d.ts +16 -17
- package/packages/client/types/components/frame/contract.d.ts +41 -47
- package/packages/client/types/components/frame/index.d.ts +2 -2
- package/packages/client/types/components/grid/contract.d.ts +20 -21
- package/packages/client/types/components/heading/contract.d.ts +1 -1
- package/packages/client/types/components/image/contract.d.ts +3 -3
- package/packages/client/types/components/input/contract.d.ts +2 -2
- package/packages/client/types/components/input/index.d.ts +15 -12
- package/packages/client/types/components/input/machine.d.ts +20 -0
- package/packages/client/types/components/layout.d.ts +44 -225
- package/packages/client/types/components/menu/contract.d.ts +14 -8
- package/packages/client/types/components/modal/contract.d.ts +12 -12
- package/packages/client/types/components/modal/index.d.ts +41 -75
- package/packages/client/types/components/modal/machine.d.ts +129 -0
- package/packages/client/types/components/modal/runtime-docs.d.ts +2 -0
- package/packages/client/types/components/overlay/contract.d.ts +3 -3
- package/packages/client/types/components/panels/contract.d.ts +39 -0
- package/packages/client/types/components/panels/index.d.ts +54 -0
- package/packages/client/types/components/panels/machine.d.ts +151 -0
- package/packages/client/types/components/panels/runtime-docs.d.ts +2 -0
- package/packages/client/types/components/radio/contract.d.ts +11 -11
- package/packages/client/types/components/radio/index.d.ts +19 -23
- package/packages/client/types/components/radio/machine.d.ts +40 -0
- package/packages/client/types/components/radio/runtime-docs.d.ts +2 -0
- package/packages/client/types/components/runtime-docs.d.ts +2 -0
- package/packages/client/types/components/runtime.d.ts +16 -19
- package/packages/client/types/components/scroll-area/contract.d.ts +4 -7
- package/packages/client/types/components/scroll-area/index.d.ts +23 -49
- package/packages/client/types/components/scroll-area/machine.d.ts +21 -0
- package/packages/client/types/components/scroll-area/runtime-docs.d.ts +2 -0
- package/packages/client/types/components/section/contract.d.ts +12 -13
- package/packages/client/types/components/select/contract.d.ts +19 -15
- package/packages/client/types/components/select/index.d.ts +42 -89
- package/packages/client/types/components/select/machine.d.ts +476 -0
- package/packages/client/types/components/select/runtime-docs.d.ts +2 -0
- package/packages/client/types/components/shared/controlled-open.d.ts +11 -0
- package/packages/client/types/components/sidebar/contract.d.ts +19 -12
- package/packages/client/types/components/sidebar/index.d.ts +51 -88
- package/packages/client/types/components/sidebar/machine.d.ts +100 -0
- package/packages/client/types/components/sidebar/runtime-docs.d.ts +2 -0
- package/packages/client/types/components/slider/contract.d.ts +3 -3
- package/packages/client/types/components/slider/index.d.ts +17 -21
- package/packages/client/types/components/slider/machine.d.ts +37 -0
- package/packages/client/types/components/slider/runtime-docs.d.ts +2 -0
- package/packages/client/types/components/stack/contract.d.ts +16 -17
- package/packages/client/types/components/surface-manifest.d.ts +9 -0
- package/packages/client/types/components/switch/contract.d.ts +11 -11
- package/packages/client/types/components/switch/index.d.ts +13 -18
- package/packages/client/types/components/switch/machine.d.ts +19 -0
- package/packages/client/types/components/switch/runtime-docs.d.ts +2 -0
- package/packages/client/types/components/table/contract.d.ts +18 -18
- package/packages/client/types/components/tabs/contract.d.ts +10 -5
- package/packages/client/types/components/tabs/index.d.ts +33 -51
- package/packages/client/types/components/tabs/machine.d.ts +84 -0
- package/packages/client/types/components/tabs/runtime-docs.d.ts +2 -0
- package/packages/client/types/components/text/contract.d.ts +1 -1
- package/packages/client/types/components/textarea/contract.d.ts +2 -2
- package/packages/client/types/components/toast/contract.d.ts +5 -4
- package/packages/client/types/components/toast/index.d.ts +38 -12
- package/packages/client/types/components/toast/machine.d.ts +115 -0
- package/packages/client/types/components/toast/runtime-docs.d.ts +2 -0
- package/packages/client/types/directives/index.d.ts +3 -1
- package/packages/client/types/directives/layout.d.ts +3 -0
- package/packages/client/types/directives/request.d.ts +1 -2
- package/packages/client/types/directives/transition.d.ts +3 -0
- package/packages/client/types/docs/transition-docs.d.ts +30 -0
- package/packages/client/types/index.d.ts +8 -40
- package/packages/client/types/motion/animate.d.ts +5 -44
- package/packages/client/types/motion/controller.d.ts +33 -0
- package/packages/client/types/motion/index.d.ts +43 -20
- package/packages/client/types/motion/owned.d.ts +5 -0
- package/packages/client/types/motion/plan.d.ts +46 -0
- package/packages/client/types/motion/recipe.d.ts +56 -0
- package/packages/client/types/motion/registry.d.ts +12 -0
- package/packages/client/types/motion/resize.d.ts +15 -0
- package/packages/client/types/motion/subject.d.ts +10 -0
- package/packages/client/types/motion/targets.d.ts +2 -5
- package/packages/client/types/motion/view.d.ts +7 -2
- package/packages/client/types/runtime/alpine-machine.d.ts +68 -0
- package/packages/client/types/runtime/anchored-popover.d.ts +10 -2
- package/packages/client/types/runtime/codecs.d.ts +16 -2
- package/packages/client/types/runtime/{resizable.d.ts → drag-and-drop/index.d.ts} +4 -2
- package/packages/client/types/runtime/engine/request.d.ts +2 -2
- package/packages/client/types/runtime/engine/stream.d.ts +11 -5
- package/packages/client/types/runtime/focus-scope.d.ts +7 -0
- package/packages/client/types/runtime/identity.d.ts +3 -0
- package/packages/client/types/runtime/index.d.ts +9 -75
- package/packages/client/types/runtime/merge-bindings.d.ts +1 -1
- package/packages/client/types/runtime/semantic-observer.d.ts +10 -0
- package/packages/client/types/runtime/state-machine/index.d.ts +4 -0
- package/packages/client/types/runtime/state-machine/machine.d.ts +83 -0
- package/packages/client/types/runtime/state-machine/props-change.d.ts +12 -0
- package/packages/client/types/runtime/transition-coordinator.d.ts +52 -0
- package/packages/client/types/runtime/ui.d.ts +15 -0
- package/packages/client/types/utils/index.d.ts +2 -1
- package/packages/client/types/utils/number.d.ts +2 -0
- package/packages/client/types/utils/object.d.ts +4 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/css/trellis.css +9097 -2595
- package/packages/server/trellis_ui/static/trellis_ui/assets/css/trellis.min.css +1 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/index.js +17313 -13281
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/index.js.map +1 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/trellis.js +8 -15
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/trellis.min.js +8 -15
- package/packages/client/types/bindings/disclosure.d.ts +0 -3
- package/packages/client/types/bindings/index.d.ts +0 -7
- package/packages/client/types/bindings/motion.d.ts +0 -3
- package/packages/client/types/bindings/state.d.ts +0 -3
- package/packages/client/types/bindings/types.d.ts +0 -33
- package/packages/client/types/components/combobox/contract.d.ts +0 -60
- package/packages/client/types/components/combobox/index.d.ts +0 -80
- package/packages/client/types/components/textarea/index.d.ts +0 -13
- package/packages/client/types/motion/presence.d.ts +0 -34
- package/packages/client/types/runtime/class-name.d.ts +0 -9
- package/packages/client/types/runtime/create.d.ts +0 -8
- package/packages/client/types/runtime/machine.d.ts +0 -55
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/cally-TZl4LpyH.js +0 -1134
- 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
|
|
3
|
-
import
|
|
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" | "
|
|
16
|
+
action: import("../../runtime/codecs").OneOfCodec<"close" | "toggle" | "open" | "expand" | "stash">;
|
|
14
17
|
class: import("../../runtime/codecs").StringCodec;
|
|
15
18
|
};
|
|
16
|
-
type SidebarToggleProps =
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
readonly
|
|
30
|
-
|
|
31
|
-
readonly
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
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
|
-
|
|
80
|
-
|
|
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 };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type
|
|
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 =
|
|
54
|
-
type SliderTickProps =
|
|
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
|
|
2
|
+
import { type AlpineMachine, type TrellisAlpineComponent } from '../../runtime';
|
|
3
3
|
import { type SliderProps } from './contract';
|
|
4
|
-
type SliderThumbName
|
|
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
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
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, };
|
|
@@ -1,29 +1,28 @@
|
|
|
1
|
-
import { type
|
|
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<"
|
|
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" | "
|
|
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<"
|
|
19
|
-
justify: import("../../runtime/codecs").OneOfCodec<"
|
|
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<"
|
|
23
|
+
display: import("../../runtime/codecs").OneOfCodec<"none" | "grid" | "inline-grid">;
|
|
25
24
|
};
|
|
26
25
|
type StackDisplay = typeof STACK_DISPLAYS[number];
|
|
27
|
-
type StackProps =
|
|
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, };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type
|
|
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("
|
|
15
|
-
disabled: import("
|
|
16
|
-
required: import("
|
|
17
|
-
invalid: import("
|
|
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("
|
|
40
|
-
disabled: import("
|
|
41
|
-
required: import("
|
|
42
|
-
invalid: import("
|
|
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 =
|
|
55
|
-
type SwitchProps =
|
|
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
|
|
2
|
+
import { type AlpineMachine, type TrellisAlpineComponent } from '../../runtime';
|
|
3
3
|
import { type SwitchControlProps } from './contract';
|
|
4
|
-
type
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
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,
|
|
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 };
|