@vireo-ai/trellis-ui 0.1.0

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 (116) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +1 -0
  3. package/package.json +84 -0
  4. package/src/theme.css +536 -0
  5. package/trellis_ui/static/trellis_ui/css/styles.css +4382 -0
  6. package/trellis_ui/static/trellis_ui/js/esm/chunks/cally-TZl4LpyH.js +1134 -0
  7. package/trellis_ui/static/trellis_ui/js/esm/chunks/cally-TZl4LpyH.js.map +1 -0
  8. package/trellis_ui/static/trellis_ui/js/esm/chunks/dist-DMX3Q5Zu.js +551 -0
  9. package/trellis_ui/static/trellis_ui/js/esm/chunks/dist-DMX3Q5Zu.js.map +1 -0
  10. package/trellis_ui/static/trellis_ui/js/esm/index.js +14181 -0
  11. package/trellis_ui/static/trellis_ui/js/esm/index.js.map +1 -0
  12. package/trellis_ui/static/trellis_ui/js/index.js +10 -0
  13. package/types/bindings/disclosure.d.ts +3 -0
  14. package/types/bindings/index.d.ts +7 -0
  15. package/types/bindings/motion.d.ts +3 -0
  16. package/types/bindings/state.d.ts +3 -0
  17. package/types/bindings/types.d.ts +35 -0
  18. package/types/components/accordion/contract.d.ts +29 -0
  19. package/types/components/accordion/index.d.ts +44 -0
  20. package/types/components/action/contract.d.ts +14 -0
  21. package/types/components/action/index.d.ts +2 -0
  22. package/types/components/app/contract.d.ts +29 -0
  23. package/types/components/app/index.d.ts +2 -0
  24. package/types/components/badge/contract.d.ts +42 -0
  25. package/types/components/badge/index.d.ts +0 -0
  26. package/types/components/box/contract.d.ts +44 -0
  27. package/types/components/box/index.d.ts +2 -0
  28. package/types/components/brand/contract.d.ts +18 -0
  29. package/types/components/brand/index.d.ts +0 -0
  30. package/types/components/button/contract.d.ts +34 -0
  31. package/types/components/button/index.d.ts +3 -0
  32. package/types/components/card/contract.d.ts +56 -0
  33. package/types/components/card/index.d.ts +0 -0
  34. package/types/components/checkbox/contract.d.ts +85 -0
  35. package/types/components/checkbox/index.d.ts +34 -0
  36. package/types/components/combobox/contract.d.ts +57 -0
  37. package/types/components/combobox/index.d.ts +74 -0
  38. package/types/components/common.d.ts +61 -0
  39. package/types/components/date-picker/contract.d.ts +86 -0
  40. package/types/components/date-picker/index.d.ts +70 -0
  41. package/types/components/dropdown/contract.d.ts +18 -0
  42. package/types/components/dropdown/index.d.ts +53 -0
  43. package/types/components/field/contract.d.ts +67 -0
  44. package/types/components/field/index.d.ts +11 -0
  45. package/types/components/file-upload/contract.d.ts +60 -0
  46. package/types/components/file-upload/index.d.ts +35 -0
  47. package/types/components/frame/contract.d.ts +60 -0
  48. package/types/components/frame/index.d.ts +2 -0
  49. package/types/components/heading/contract.d.ts +8 -0
  50. package/types/components/heading/index.d.ts +0 -0
  51. package/types/components/image/contract.d.ts +19 -0
  52. package/types/components/image/index.d.ts +1 -0
  53. package/types/components/index.d.ts +1 -0
  54. package/types/components/input/contract.d.ts +49 -0
  55. package/types/components/input/index.d.ts +17 -0
  56. package/types/components/menu/contract.d.ts +34 -0
  57. package/types/components/menu/index.d.ts +0 -0
  58. package/types/components/modal/contract.d.ts +56 -0
  59. package/types/components/modal/index.d.ts +85 -0
  60. package/types/components/overlay/contract.d.ts +13 -0
  61. package/types/components/overlay/index.d.ts +0 -0
  62. package/types/components/radio/contract.d.ts +55 -0
  63. package/types/components/radio/index.d.ts +28 -0
  64. package/types/components/runtime.d.ts +35 -0
  65. package/types/components/scroll-area/contract.d.ts +23 -0
  66. package/types/components/scroll-area/index.d.ts +68 -0
  67. package/types/components/select/contract.d.ts +90 -0
  68. package/types/components/select/index.d.ts +92 -0
  69. package/types/components/separator/contract.d.ts +7 -0
  70. package/types/components/separator/index.d.ts +0 -0
  71. package/types/components/sidebar/contract.d.ts +66 -0
  72. package/types/components/sidebar/index.d.ts +106 -0
  73. package/types/components/slider/contract.d.ts +56 -0
  74. package/types/components/slider/index.d.ts +40 -0
  75. package/types/components/spacer/index.d.ts +0 -0
  76. package/types/components/stream/index.d.ts +0 -0
  77. package/types/components/switch/contract.d.ts +57 -0
  78. package/types/components/switch/index.d.ts +24 -0
  79. package/types/components/table/contract.d.ts +99 -0
  80. package/types/components/table/index.d.ts +2 -0
  81. package/types/components/tabs/contract.d.ts +25 -0
  82. package/types/components/tabs/index.d.ts +60 -0
  83. package/types/components/text/contract.d.ts +10 -0
  84. package/types/components/text/index.d.ts +0 -0
  85. package/types/components/textarea/contract.d.ts +22 -0
  86. package/types/components/textarea/index.d.ts +0 -0
  87. package/types/components/theme/contract.d.ts +6 -0
  88. package/types/components/theme/index.d.ts +0 -0
  89. package/types/components/toast/contract.d.ts +28 -0
  90. package/types/components/toast/index.d.ts +27 -0
  91. package/types/index.d.ts +46 -0
  92. package/types/motion/animate.d.ts +49 -0
  93. package/types/motion/index.d.ts +24 -0
  94. package/types/motion/presence.d.ts +34 -0
  95. package/types/motion/reduced-motion.d.ts +9 -0
  96. package/types/motion/stream.d.ts +18 -0
  97. package/types/motion/targets.d.ts +31 -0
  98. package/types/motion/view.d.ts +22 -0
  99. package/types/runtime/anchored-popover.d.ts +20 -0
  100. package/types/runtime/class-name.d.ts +9 -0
  101. package/types/runtime/codecs.d.ts +66 -0
  102. package/types/runtime/collection-navigation.d.ts +33 -0
  103. package/types/runtime/confirm.d.ts +18 -0
  104. package/types/runtime/create.d.ts +8 -0
  105. package/types/runtime/dismissable-layer.d.ts +8 -0
  106. package/types/runtime/dom.d.ts +39 -0
  107. package/types/runtime/form-control.d.ts +44 -0
  108. package/types/runtime/index.d.ts +85 -0
  109. package/types/runtime/manifest.d.ts +49 -0
  110. package/types/runtime/option-data.d.ts +5 -0
  111. package/types/runtime/props.d.ts +9 -0
  112. package/types/runtime/resizable.d.ts +36 -0
  113. package/types/runtime/scroll-lock.d.ts +3 -0
  114. package/types/runtime/stream.d.ts +47 -0
  115. package/types/runtime/styles.d.ts +28 -0
  116. package/types/runtime/theme.d.ts +17 -0
@@ -0,0 +1,85 @@
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';
4
+ export { createCollectionNavigation, type CollectionElementOptions, type CollectionItemsOptions, type CollectionKeydownOptions, type CollectionNavigation, type CollectionNavigationOptions, } from './collection-navigation';
5
+ export { registerConfirm, unregisterConfirm, type ConfirmEventDetail, type ConfirmRuntimeOptions } from './confirm';
6
+ export { create, type CreateOptions, type StyleTree } from './create';
7
+ export { props, type BindingObject, type PropInput, type PropsOptions } from './props';
8
+ export { defineProps, string, number, bool, json, oneOf, type CodecFn, type PropState, type SchemaToProps } from './codecs';
9
+ export { addListener, asBool, dispatch, isRtl, removeAttribute, setAttribute, setPresence, type AddListenerOptions, type AttributeOptions, type BoolOptions, type CleanupStack, type DispatchOptions, type ElementOptions, type PresenceOptions, } from './dom';
10
+ export { addDismissableLayer, type DismissableLayerOptions } from './dismissable-layer';
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 { getPathValue, normalizeOptionText, parseItemData, splitControlValues } from './option-data';
13
+ export { createResizable, registerResizable, type ResizableOptions, type ResizeAxis, type ResizeEvent, type ResizeMode, type ResizePhase, } from './resizable';
14
+ export { defineManifest, propsFromSchema, type ComponentManifest, type DefineManifestOptions, type ManifestPart, type ManifestProp, type ManifestPropDetails, type ManifestToken, type PropsFromSchemaOptions, type SchemaPropDetails, } from './manifest';
15
+ export { defineStyles, resolveStyle, type DefineStylesOptions, type ResolveStyleOptions, type StyleDefinition, type StylePart, type StyleProps, } from './styles';
16
+ export { applyStreamPatch, applyStreamPatches, applyUiEffect, applyUiEffects, connectStream, dispatchStreamEvent, registerStream, type PatchMode, type StreamEventPayload, type StreamPatchPayload, type UiEffectPayload, } from './stream';
17
+ export { applyThemeMode, createDarkModeStore, registerThemeStore, type DarkModeStore, type ThemeChangeDetail, type ThemeMode, } from './theme';
18
+ export { lockDocumentScroll, unlockDocumentScroll } from './scroll-lock';
19
+ type TrellisAlpineComponent<T> = Alpine.AlpineComponent<T> & {
20
+ init(): void;
21
+ destroy(): void;
22
+ };
23
+ export type { TrellisAlpineComponent };
24
+ declare const ui: {
25
+ readonly createAnchoredPopover: ({ reference, floating, position: getPosition, align: getAlign, gap, offset, matchReferenceWidth, }: import("./anchored-popover").AnchoredPopoverOptions) => import("./anchored-popover").AnchoredPopover;
26
+ readonly createCollectionNavigation: ({ root: getRoot, itemSelector, activeAttribute, isDisabled, loop, }: import("./collection-navigation").CollectionNavigationOptions) => import("./collection-navigation").CollectionNavigation;
27
+ readonly create: <const T extends Record<string, import("./create").StyleTree>>({ definition }: import("./create").CreateOptions<T>) => Readonly<T>;
28
+ readonly addDismissableLayer: ({ isEnabled, roots, onDismiss, }: import("./dismissable-layer").DismissableLayerOptions) => (() => void);
29
+ readonly addListener: ({ target, event, handler, cleanup, options, }: import("./dom").AddListenerOptions) => (() => void);
30
+ readonly asBool: ({ value }: import("./dom").BoolOptions) => boolean;
31
+ readonly dispatch: <T = unknown>({ el, name, detail }: import("./dom").DispatchOptions<T>) => void;
32
+ readonly dispatchNativeControlChange: ({ container, fallback, marker, }: import("./form-control").DispatchNativeControlChangeOptions) => void;
33
+ readonly isRtl: ({ el }: import("./dom").ElementOptions) => boolean;
34
+ readonly removeAttribute: ({ el, attr }: Omit<import("./dom").AttributeOptions, "value">) => void;
35
+ readonly setAttribute: ({ el, attr, value }: import("./dom").AttributeOptions) => void;
36
+ readonly setPresence: ({ el, attr, present, value }: import("./dom").PresenceOptions) => void;
37
+ readonly syncControlPresence: ({ el, state, value, }: import("./form-control").SyncControlPresenceOptions) => void;
38
+ readonly syncNativeControl: ({ input, state, }: import("./form-control").SyncNativeControlOptions) => void;
39
+ readonly syncRepeatedHiddenInputs: ({ container, state, currentKey, }: import("./form-control").SyncRepeatedHiddenInputsOptions) => string;
40
+ readonly getPathValue: (item: unknown, path: string) => unknown;
41
+ readonly normalizeOptionText: (value: string) => string;
42
+ readonly parseItemData: (raw: string | undefined) => unknown;
43
+ readonly splitControlValues: (value: string) => string[];
44
+ readonly createResizable: ({ element, handle, axis, min, max, step, mode, hitArea, coarseHitArea, disabled, onStart, onResize, onEnd, }: import("./resizable").ResizableOptions) => (() => void);
45
+ readonly props: ({ inputs }: import("./props").PropsOptions) => import("./props").BindingObject;
46
+ readonly propsFromSchema: <const T extends Record<string, import("./codecs").CodecFn<unknown>>>({ schema, details, }: import("./manifest").PropsFromSchemaOptions<T>) => Record<string, import("./manifest").ManifestProp>;
47
+ readonly resolveStyle: ({ part, props, className: override, }: import("./styles").ResolveStyleOptions) => string;
48
+ readonly className: ({ values }: import("./class-name").ClassNameOptions) => string;
49
+ readonly cx: ({ values }: import("./class-name").ClassNameOptions) => string;
50
+ readonly motion: {
51
+ readonly createAnimator: <T extends string | number>(value: import("motion").MotionValue<T> | T, defaultOptions?: import("motion").ValueAnimationTransition<T>) => import("..").Animator<T>;
52
+ readonly parallel: (...handles: import("..").MotionHandle[]) => import("..").MotionHandle;
53
+ readonly sequential: (...steps: Array<() => import("..").MotionHandle>) => import("..").MotionHandle;
54
+ readonly bindTransform: <T extends import("..").TransformContext>(element: HTMLElement, values: T, compose: import("..").TransformComposer<T>) => (() => void);
55
+ readonly bindStyle: <T extends string | number>(element: HTMLElement, property: keyof CSSStyleDeclaration, value: import("motion").MotionValue<T>, map?: (value: T) => string) => (() => void);
56
+ readonly withReducedMotion: <T extends import("motion").AnimationOptions>(options: T, reducedOptions?: Partial<T>, preference?: import("..").MotionPreference) => T;
57
+ readonly resolveTargets: (scope?: import("..").ViewScope, targets?: import("..").MotionTarget | import("..").MotionTarget[] | null) => Element[];
58
+ readonly applyViewKeys: (scope?: import("..").ViewScope, options?: {
59
+ key?: string;
60
+ layout?: boolean;
61
+ }) => (() => void);
62
+ readonly animateView: (update: () => void | Promise<void>, targets?: import("..").MotionTarget | import("..").MotionTarget[] | null, options?: import("..").AnimateViewOptions) => import("..").MotionHandle;
63
+ readonly animatePresence: (element: Element, phase: import("..").PresencePhase, preset?: import("..").PresenceDefinition, options?: import("..").PresenceOptions) => import("..").MotionHandle;
64
+ readonly createPresenceLifecycle: ({ element, preset, enter, exit, options, enterOptions, exitOptions, owner, }: import("..").PresenceLifecycleOptions) => import("..").PresenceLifecycle;
65
+ readonly animateStreamPatch: <AlpineInstance>(_Alpine: AlpineInstance, patchOrPatches: import("../motion/stream").StreamPatchLike | import("../motion/stream").StreamPatchLike[], options?: import("..").AnimateStreamPatchOptions) => import("..").MotionHandle;
66
+ };
67
+ readonly applyStreamPatch: (AlpineInstance: import("./stream").StreamAlpine, payload: import("./stream").StreamPatchPayload) => void;
68
+ readonly applyStreamPatches: (AlpineInstance: import("./stream").StreamAlpine, payload: import("./stream").StreamPatchPayload | import("./stream").StreamPatchPayload[]) => void;
69
+ readonly applyUiEffect: (AlpineInstance: import("./stream").StreamAlpine, effect: import("./stream").UiEffectPayload) => void;
70
+ readonly applyUiEffects: (AlpineInstance: import("./stream").StreamAlpine, effects: import("./stream").UiEffectPayload | import("./stream").UiEffectPayload[]) => void;
71
+ readonly connectStream: (AlpineInstance: import("./stream").StreamAlpine, url: string) => Promise<{
72
+ abort(reason?: string): void;
73
+ }>;
74
+ readonly dispatchStreamEvent: (payload: import("./stream").StreamEventPayload) => void;
75
+ readonly applyThemeMode: (mode: import("./theme").ThemeMode) => import("./theme").ThemeChangeDetail;
76
+ readonly createDarkModeStore: () => import("./theme").DarkModeStore;
77
+ readonly lockDocumentScroll: () => void;
78
+ readonly registerConfirm: ({ root }?: import("./confirm").ConfirmRuntimeOptions) => void;
79
+ readonly registerResizable: (AlpineInstance: Alpine.Alpine) => void;
80
+ readonly registerStream: (AlpineInstance: Alpine.Alpine) => void;
81
+ readonly registerThemeStore: (AlpineInstance: Alpine.Alpine) => void;
82
+ readonly unregisterConfirm: () => void;
83
+ readonly unlockDocumentScroll: () => void;
84
+ };
85
+ export { ui };
@@ -0,0 +1,49 @@
1
+ import type { CodecFn } from './codecs';
2
+ type PropKind = 'string' | 'number' | 'boolean' | 'enum' | 'json';
3
+ type ManifestProp = {
4
+ type: PropKind;
5
+ default?: unknown;
6
+ values?: readonly string[];
7
+ description?: string;
8
+ };
9
+ type ManifestPart = {
10
+ selector: string;
11
+ description: string;
12
+ };
13
+ type ManifestToken = {
14
+ name: string;
15
+ description: string;
16
+ };
17
+ type ManifestAcceptedEvent = {
18
+ description: string;
19
+ detail?: Record<string, string>;
20
+ };
21
+ type ComponentManifest = {
22
+ name: string;
23
+ title: string;
24
+ description: string;
25
+ props?: Record<string, ManifestProp>;
26
+ propSchema?: Record<string, CodecFn<unknown>>;
27
+ slots?: Record<string, string>;
28
+ events?: Record<string, string>;
29
+ acceptedEvents?: Record<string, ManifestAcceptedEvent>;
30
+ parts?: Record<string, ManifestPart>;
31
+ tokens?: readonly ManifestToken[];
32
+ };
33
+ type ManifestPropDetails = Pick<ManifestProp, 'description'> & {
34
+ name?: string;
35
+ };
36
+ type SchemaPropDetails<T extends Record<string, CodecFn<unknown>>> = {
37
+ [K in keyof T]?: ManifestPropDetails;
38
+ };
39
+ type DefineManifestOptions<T extends ComponentManifest> = {
40
+ manifest: T;
41
+ };
42
+ type PropsFromSchemaOptions<T extends Record<string, CodecFn<unknown>>> = {
43
+ schema: T;
44
+ details: SchemaPropDetails<T>;
45
+ };
46
+ declare const defineManifest: <const T extends ComponentManifest>({ manifest }: DefineManifestOptions<T>) => Readonly<T>;
47
+ declare const propsFromSchema: <const T extends Record<string, CodecFn<unknown>>>({ schema, details, }: PropsFromSchemaOptions<T>) => Record<string, ManifestProp>;
48
+ export { defineManifest, propsFromSchema };
49
+ export type { ComponentManifest, DefineManifestOptions, ManifestPart, ManifestProp, ManifestPropDetails, ManifestAcceptedEvent, ManifestToken, PropsFromSchemaOptions, PropKind, SchemaPropDetails, };
@@ -0,0 +1,5 @@
1
+ declare const normalizeOptionText: (value: string) => string;
2
+ declare const splitControlValues: (value: string) => string[];
3
+ declare const parseItemData: (raw: string | undefined) => unknown;
4
+ declare const getPathValue: (item: unknown, path: string) => unknown;
5
+ export { getPathValue, normalizeOptionText, parseItemData, splitControlValues };
@@ -0,0 +1,9 @@
1
+ import { type ClassValue } from './class-name';
2
+ type AttributeValue = unknown;
3
+ export type BindingObject = Record<string, AttributeValue>;
4
+ export type PropInput = ClassValue | BindingObject;
5
+ export type PropsOptions = {
6
+ inputs: readonly PropInput[];
7
+ };
8
+ export declare const props: ({ inputs }: PropsOptions) => BindingObject;
9
+ export {};
@@ -0,0 +1,36 @@
1
+ import type Alpine from 'alpinejs';
2
+ type ResizeAxis = 'x' | 'y';
3
+ type ResizeMode = 'onChange' | 'onEnd';
4
+ type ResizePhase = 'start' | 'resize' | 'end';
5
+ type ResizeEvent = {
6
+ width: number;
7
+ height: number;
8
+ previewWidth: number;
9
+ previewHeight: number;
10
+ delta: number;
11
+ axis: ResizeAxis;
12
+ phase: ResizePhase;
13
+ input: {
14
+ clientX: number;
15
+ clientY: number;
16
+ };
17
+ };
18
+ type ResizableOptions = {
19
+ element: HTMLElement;
20
+ handle: HTMLElement;
21
+ axis?: ResizeAxis;
22
+ min?: number;
23
+ max?: number | null;
24
+ step?: number;
25
+ mode?: ResizeMode;
26
+ hitArea?: number;
27
+ coarseHitArea?: number;
28
+ disabled?: () => boolean;
29
+ onStart?: (event: ResizeEvent) => void;
30
+ onResize?: (event: ResizeEvent) => void;
31
+ onEnd?: (event: ResizeEvent) => void;
32
+ };
33
+ declare const createResizable: ({ element, handle, axis, min, max, step, mode, hitArea, coarseHitArea, disabled, onStart, onResize, onEnd, }: ResizableOptions) => (() => void);
34
+ declare const registerResizable: (AlpineInstance: Alpine.Alpine) => void;
35
+ export { createResizable, registerResizable };
36
+ export type { ResizableOptions, ResizeAxis, ResizeEvent, ResizeMode, ResizePhase };
@@ -0,0 +1,3 @@
1
+ declare const lockDocumentScroll: () => void;
2
+ declare const unlockDocumentScroll: () => void;
3
+ export { lockDocumentScroll, unlockDocumentScroll };
@@ -0,0 +1,47 @@
1
+ import type Alpine from 'alpinejs';
2
+ type PatchMode = 'morph' | 'outer' | 'replace' | 'update' | 'append' | 'prepend' | 'before' | 'after' | 'remove';
3
+ type StreamPatchPayload = {
4
+ html?: string | null;
5
+ target?: string | null;
6
+ selector?: string | null;
7
+ mode?: PatchMode | null;
8
+ };
9
+ type StreamEventPayload = {
10
+ event: string;
11
+ detail?: Record<string, unknown>;
12
+ };
13
+ type LocationPayload = {
14
+ url: string;
15
+ mode?: 'push' | 'replace' | 'assign';
16
+ };
17
+ type UiEffectPayload = ({
18
+ type: 'patch';
19
+ } & StreamPatchPayload) | ({
20
+ type: 'dispatch';
21
+ } & StreamEventPayload) | ({
22
+ type: 'location';
23
+ } & LocationPayload);
24
+ type StreamController = {
25
+ abort(reason?: string): void;
26
+ };
27
+ type StreamAlpine = {
28
+ initTree(el: HTMLElement): void;
29
+ morph?: (target: HTMLElement, html: string, options?: {
30
+ key?: (el: HTMLElement) => string | null;
31
+ }) => void;
32
+ };
33
+ declare const MANAGED_HISTORY_STATE_KEY = "__trellisUi";
34
+ type ManagedHistoryState = Record<string, unknown> & {
35
+ [MANAGED_HISTORY_STATE_KEY]: true;
36
+ };
37
+ declare const applyStreamPatchNow: (AlpineInstance: StreamAlpine, payload: StreamPatchPayload) => void;
38
+ declare const applyStreamPatches: (AlpineInstance: StreamAlpine, payload: StreamPatchPayload | StreamPatchPayload[]) => void;
39
+ declare const applyStreamPatch: (AlpineInstance: StreamAlpine, payload: StreamPatchPayload) => void;
40
+ declare const dispatchStreamEvent: (payload: StreamEventPayload) => void;
41
+ declare const isManagedHistoryState: (state: unknown) => state is ManagedHistoryState;
42
+ declare const applyUiEffect: (AlpineInstance: StreamAlpine, effect: UiEffectPayload) => void;
43
+ declare const applyUiEffects: (AlpineInstance: StreamAlpine, effects: UiEffectPayload | UiEffectPayload[]) => void;
44
+ declare const connectStream: (AlpineInstance: StreamAlpine, url: string) => Promise<StreamController>;
45
+ declare const registerStream: (AlpineInstance: Alpine.Alpine) => void;
46
+ export { applyUiEffect, applyUiEffects, applyStreamPatch, applyStreamPatchNow, applyStreamPatches, connectStream, dispatchStreamEvent, isManagedHistoryState, registerStream, };
47
+ export type { LocationPayload, PatchMode, StreamAlpine, StreamEventPayload, StreamPatchPayload, UiEffectPayload };
@@ -0,0 +1,28 @@
1
+ import { type ClassValue } from 'clsx';
2
+ type StyleProps = Record<string, unknown>;
3
+ type CompoundStyle = {
4
+ readonly when: Record<string, string | boolean | number>;
5
+ readonly class: ClassValue;
6
+ };
7
+ type StylePart = {
8
+ readonly base?: ClassValue;
9
+ readonly variants?: Record<string, Record<string, ClassValue>>;
10
+ readonly defaults?: Record<string, string | boolean | number>;
11
+ readonly compounds?: readonly CompoundStyle[];
12
+ };
13
+ type StyleDefinition = {
14
+ readonly component: string;
15
+ readonly parts: Record<string, StylePart>;
16
+ };
17
+ type DefineStylesOptions<T extends StyleDefinition> = {
18
+ definition: T;
19
+ };
20
+ type ResolveStyleOptions = {
21
+ part: StylePart;
22
+ props?: StyleProps;
23
+ className?: ClassValue;
24
+ };
25
+ declare const defineStyles: <const T extends StyleDefinition>({ definition }: DefineStylesOptions<T>) => Readonly<T>;
26
+ declare const resolveStyle: ({ part, props, className: override, }: ResolveStyleOptions) => string;
27
+ export { defineStyles, resolveStyle };
28
+ export type { CompoundStyle, DefineStylesOptions, ResolveStyleOptions, StyleDefinition, StylePart, StyleProps };
@@ -0,0 +1,17 @@
1
+ import type { Alpine as AlpineType } from 'alpinejs';
2
+ declare const THEME_VALUES: readonly ["light", "dark", "system"];
3
+ type ThemeMode = typeof THEME_VALUES[number];
4
+ type ThemeChangeDetail = {
5
+ mode: ThemeMode;
6
+ on: boolean;
7
+ };
8
+ type DarkModeStore = {
9
+ mode: ThemeMode;
10
+ on: boolean;
11
+ set: (mode: ThemeMode) => void;
12
+ toggle: () => void;
13
+ };
14
+ declare const applyThemeMode: (mode: ThemeMode) => ThemeChangeDetail;
15
+ declare const createDarkModeStore: () => DarkModeStore;
16
+ declare const registerThemeStore: (AlpineInstance: AlpineType) => void;
17
+ export { applyThemeMode, createDarkModeStore, registerThemeStore, type DarkModeStore, type ThemeChangeDetail, type ThemeMode, };